diff --git a/404.html b/404.html index 36e4da7eb..4e3710576 100644 --- a/404.html +++ b/404.html @@ -4,7 +4,7 @@ - + diff --git a/body-ui/main.js b/body-ui/main.js index 61b563af0..5342de5f0 100644 --- a/body-ui/main.js +++ b/body-ui/main.js @@ -1 +1 @@ -var dke=Object.defineProperty,hke=Object.defineProperties,fke=Object.getOwnPropertyDescriptors,C1=Object.getOwnPropertySymbols,jq=Object.prototype.hasOwnProperty,Vq=Object.prototype.propertyIsEnumerable,Er=Math.pow,Uq=(Ut,it,Je)=>it in Ut?dke(Ut,it,{enumerable:!0,configurable:!0,writable:!0,value:Je}):Ut[it]=Je,ot=(Ut,it)=>{for(var Je in it||(it={}))jq.call(it,Je)&&Uq(Ut,Je,it[Je]);if(C1)for(var Je of C1(it))Vq.call(it,Je)&&Uq(Ut,Je,it[Je]);return Ut},Cn=(Ut,it)=>hke(Ut,fke(it)),zq=(Ut,it)=>{var Je={};for(var yt in Ut)jq.call(Ut,yt)&&it.indexOf(yt)<0&&(Je[yt]=Ut[yt]);if(null!=Ut&&C1)for(var yt of C1(Ut))it.indexOf(yt)<0&&Vq.call(Ut,yt)&&(Je[yt]=Ut[yt]);return Je};(self.webpackChunkccf_ui=self.webpackChunkccf_ui||[]).push([[179],{440:(Ut,it,Je)=>{var yt=Je(52).default;Ut.exports=function Y(Se,he,W){function j(z,v){if(!he[z]){if(!Se[z]){if(P)return P(z,!0);var O=new Error("Cannot find module '"+z+"'");throw O.code="MODULE_NOT_FOUND",O}var A=he[z]={exports:{}};Se[z][0].call(A.exports,function(b){return j(Se[z][1][b]||b)},A,A.exports,Y,Se,he,W)}return he[z].exports}for(var P=void 0,Q=0;Q0&&G[G.length-1])&&(6===_t[0]||2===_t[0])){$e=0;continue}if(3===_t[0]&&(!G||_t[1]>G[0]&&_t[1]0?ce-4:ce;for($=0;$>16&255,I[X++]=R>>8&255,I[X++]=255&R;return 2===D&&(R=j[V.charCodeAt($)]<<2|j[V.charCodeAt($+1)]>>4,I[X++]=255&R),1===D&&(R=j[V.charCodeAt($)]<<10|j[V.charCodeAt($+1)]<<4|j[V.charCodeAt($+2)]>>2,I[X++]=R>>8&255,I[X++]=255&R),I},he.fromByteArray=function(V){for(var R,K=V.length,ce=K%3,D=[],I=16383,X=0,E=K-ce;XE?E:X+I));return 1===ce?D.push(W[(R=V[K-1])>>2]+W[R<<4&63]+"=="):2===ce&&D.push(W[(R=(V[K-2]<<8)+V[K-1])>>10]+W[R>>4&63]+W[R<<2&63]+"="),D.join("")};for(var W=[],j=[],P="undefined"!=typeof Uint8Array?Uint8Array:Array,Q="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",z=0,v=Q.length;z0)throw new Error("Invalid string. Length must be a multiple of 4");var K=V.indexOf("=");return-1===K&&(K=R),[K,K===R?0:4-K%4]}function y(V){return W[V>>18&63]+W[V>>12&63]+W[V>>6&63]+W[63&V]}function S(V,R,K){for(var D=[],I=R;I>5==6?2:D>>4==14?3:D>>3==30?4:D>>6==2?-1:-2}function A(D){var I=this.lastTotal-this.lastNeed,X=function(D,I,X){if(128!=(192&I[0]))return D.lastNeed=0,"\ufffd";if(D.lastNeed>1&&I.length>1){if(128!=(192&I[1]))return D.lastNeed=1,"\ufffd";if(D.lastNeed>2&&I.length>2&&128!=(192&I[2]))return D.lastNeed=2,"\ufffd"}}(this,D);return void 0!==X?X:this.lastNeed<=D.length?(D.copy(this.lastChar,I,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(D.copy(this.lastChar,I,0,D.length),void(this.lastNeed-=D.length))}function S(D,I){if((D.length-I)%2==0){var X=D.toString("utf16le",I);if(X){var E=X.charCodeAt(X.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],X.slice(0,-1)}return X}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=D[D.length-1],D.toString("utf16le",I,D.length-1)}function T(D){var I=D&&D.length?this.write(D):"";return this.lastNeed?I+this.lastChar.toString("utf16le",0,this.lastTotal-this.lastNeed):I}function V(D,I){var X=(D.length-I)%3;return 0===X?D.toString("base64",I):(this.lastNeed=3-X,this.lastTotal=3,1===X?this.lastChar[0]=D[D.length-1]:(this.lastChar[0]=D[D.length-2],this.lastChar[1]=D[D.length-1]),D.toString("base64",I,D.length-X))}function R(D){var I=D&&D.length?this.write(D):"";return this.lastNeed?I+this.lastChar.toString("base64",0,3-this.lastNeed):I}function K(D){return D.toString(this.encoding)}function ce(D){return D&&D.length?this.write(D):""}he.StringDecoder=z,z.prototype.write=function(D){if(0===D.length)return"";var I,X;if(this.lastNeed){if(void 0===(I=this.fillLast(D)))return"";X=this.lastNeed,this.lastNeed=0}else X=0;return X=0?($>0&&(D.lastNeed=$-1),$):--E=0?($>0&&(D.lastNeed=$-2),$):--E=0?($>0&&(2===$?$=0:D.lastNeed=$-3),$):0}(this,D,I);if(!this.lastNeed)return D.toString("utf8",I);this.lastTotal=X;var E=D.length-(X-this.lastNeed);return D.copy(this.lastChar,0,E),D.toString("utf8",I,E)},z.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(Y,Se,he){(function(W){(function(){"use strict";var j=Y("base64-js"),P=Y("ieee754");he.Buffer=x,he.SlowBuffer=function(L){return+L!=L&&(L=0),x.alloc(+L)},he.INSPECT_MAX_BYTES=50;var Q=2147483647;function v(L){if(L>Q)throw new RangeError('The value "'+L+'" is invalid for option "size"');var N=new Uint8Array(L);return N.__proto__=x.prototype,N}function x(L,N,B){if("number"==typeof L){if("string"==typeof N)throw new TypeError('The "string" argument must be of type string. Received type number');return y(L)}return O(L,N,B)}function O(L,N,B){if("string"==typeof L)return function(L,N){if(("string"!=typeof N||""===N)&&(N="utf8"),!x.isEncoding(N))throw new TypeError("Unknown encoding: "+N);var B=0|D(L,N),Re=v(B),Qe=Re.write(L,N);return Qe!==B&&(Re=Re.slice(0,Qe)),Re}(L,N);if(ArrayBuffer.isView(L))return T(L);if(null==L)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof L);if(pt(L,ArrayBuffer)||L&&pt(L.buffer,ArrayBuffer))return function(L,N,B){if(N<0||L.byteLength=Q)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Q.toString(16)+" bytes");return 0|L}function D(L,N){if(x.isBuffer(L))return L.length;if(ArrayBuffer.isView(L)||pt(L,ArrayBuffer))return L.byteLength;if("string"!=typeof L)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof L);var B=L.length,Re=arguments.length>2&&!0===arguments[2];if(!Re&&0===B)return 0;for(var Qe=!1;;)switch(N){case"ascii":case"latin1":case"binary":return B;case"utf8":case"utf-8":return G(L).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*B;case"hex":return B>>>1;case"base64":return je(L).length;default:if(Qe)return Re?-1:G(L).length;N=(""+N).toLowerCase(),Qe=!0}}function I(L,N,B){var Re=!1;if((void 0===N||N<0)&&(N=0),N>this.length||((void 0===B||B>this.length)&&(B=this.length),B<=0)||(B>>>=0)<=(N>>>=0))return"";for(L||(L="utf8");;)switch(L){case"hex":return tt(this,N,B);case"utf8":case"utf-8":return _e(this,N,B);case"ascii":return st(this,N,B);case"latin1":case"binary":return Xe(this,N,B);case"base64":return ne(this,N,B);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ye(this,N,B);default:if(Re)throw new TypeError("Unknown encoding: "+L);L=(L+"").toLowerCase(),Re=!0}}function X(L,N,B){var Re=L[N];L[N]=L[B],L[B]=Re}function E(L,N,B,Re,Qe){if(0===L.length)return-1;if("string"==typeof B?(Re=B,B=0):B>2147483647?B=2147483647:B<-2147483648&&(B=-2147483648),ve(B=+B)&&(B=Qe?0:L.length-1),B<0&&(B=L.length+B),B>=L.length){if(Qe)return-1;B=L.length-1}else if(B<0){if(!Qe)return-1;B=0}if("string"==typeof N&&(N=x.from(N,Re)),x.isBuffer(N))return 0===N.length?-1:$(L,N,B,Re,Qe);if("number"==typeof N)return N&=255,"function"==typeof Uint8Array.prototype.indexOf?Qe?Uint8Array.prototype.indexOf.call(L,N,B):Uint8Array.prototype.lastIndexOf.call(L,N,B):$(L,[N],B,Re,Qe);throw new TypeError("val must be string, number or Buffer")}function $(L,N,B,Re,Qe){var Yn,St=1,Nt=L.length,On=N.length;if(void 0!==Re&&("ucs2"===(Re=String(Re).toLowerCase())||"ucs-2"===Re||"utf16le"===Re||"utf-16le"===Re)){if(L.length<2||N.length<2)return-1;St=2,Nt/=2,On/=2,B/=2}function kn(Ls,gs){return 1===St?Ls[gs]:Ls.readUInt16BE(gs*St)}if(Qe){var Ti=-1;for(Yn=B;YnNt&&(B=Nt-On),Yn=B;Yn>=0;Yn--){for(var wi=!0,Xr=0;XrQe&&(Re=Qe):Re=Qe;var St=N.length;Re>St/2&&(Re=St/2);for(var Nt=0;Nt>8,St.push(B%256),St.push(Re);return St}(N,L.length-B),L,B,Re)}function ne(L,N,B){return j.fromByteArray(0===N&&B===L.length?L:L.slice(N,B))}function _e(L,N,B){B=Math.min(L.length,B);for(var Re=[],Qe=N;Qe239?4:St>223?3:St>191?2:1;if(Qe+On<=B)switch(On){case 1:St<128&&(Nt=St);break;case 2:128==(192&(kn=L[Qe+1]))&&(wi=(31&St)<<6|63&kn)>127&&(Nt=wi);break;case 3:Yn=L[Qe+2],128==(192&(kn=L[Qe+1]))&&128==(192&Yn)&&(wi=(15&St)<<12|(63&kn)<<6|63&Yn)>2047&&(wi<55296||wi>57343)&&(Nt=wi);break;case 4:Yn=L[Qe+2],Ti=L[Qe+3],128==(192&(kn=L[Qe+1]))&&128==(192&Yn)&&128==(192&Ti)&&(wi=(15&St)<<18|(63&kn)<<12|(63&Yn)<<6|63&Ti)>65535&&wi<1114112&&(Nt=wi)}null===Nt?(Nt=65533,On=1):Nt>65535&&(Re.push((Nt-=65536)>>>10&1023|55296),Nt=56320|1023&Nt),Re.push(Nt),Qe+=On}return function(L){var N=L.length;if(N<=4096)return String.fromCharCode.apply(String,L);for(var B="",Re=0;ReB&&(N+=" ... "),""},x.prototype.compare=function(N,B,Re,Qe,St){if(pt(N,Uint8Array)&&(N=x.from(N,N.offset,N.byteLength)),!x.isBuffer(N))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof N);if(void 0===B&&(B=0),void 0===Re&&(Re=N?N.length:0),void 0===Qe&&(Qe=0),void 0===St&&(St=this.length),B<0||Re>N.length||Qe<0||St>this.length)throw new RangeError("out of range index");if(Qe>=St&&B>=Re)return 0;if(Qe>=St)return-1;if(B>=Re)return 1;if(this===N)return 0;for(var Nt=(St>>>=0)-(Qe>>>=0),On=(Re>>>=0)-(B>>>=0),kn=Math.min(Nt,On),Yn=this.slice(Qe,St),Ti=N.slice(B,Re),wi=0;wi>>=0,isFinite(Re)?(Re>>>=0,void 0===Qe&&(Qe="utf8")):(Qe=Re,Re=void 0)}var St=this.length-B;if((void 0===Re||Re>St)&&(Re=St),N.length>0&&(Re<0||B<0)||B>this.length)throw new RangeError("Attempt to write outside buffer bounds");Qe||(Qe="utf8");for(var Nt=!1;;)switch(Qe){case"hex":return Z(this,N,B,Re);case"utf8":case"utf-8":return oe(this,N,B,Re);case"ascii":return se(this,N,B,Re);case"latin1":case"binary":return te(this,N,B,Re);case"base64":return Ce(this,N,B,Re);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return me(this,N,B,Re);default:if(Nt)throw new TypeError("Unknown encoding: "+Qe);Qe=(""+Qe).toLowerCase(),Nt=!0}},x.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function st(L,N,B){var Re="";B=Math.min(L.length,B);for(var Qe=N;QeRe)&&(B=Re);for(var Qe="",St=N;StB)throw new RangeError("Trying to access beyond buffer length")}function ke(L,N,B,Re,Qe,St){if(!x.isBuffer(L))throw new TypeError('"buffer" argument must be a Buffer instance');if(N>Qe||NL.length)throw new RangeError("Index out of range")}function Ke(L,N,B,Re,Qe,St){if(B+Re>L.length)throw new RangeError("Index out of range");if(B<0)throw new RangeError("Index out of range")}function Me(L,N,B,Re,Qe){return N=+N,B>>>=0,Qe||Ke(L,0,B,4),P.write(L,N,B,Re,23,4),B+4}function Ve(L,N,B,Re,Qe){return N=+N,B>>>=0,Qe||Ke(L,0,B,8),P.write(L,N,B,Re,52,8),B+8}x.prototype.slice=function(N,B){var Re=this.length;(N=~~N)<0?(N+=Re)<0&&(N=0):N>Re&&(N=Re),(B=void 0===B?Re:~~B)<0?(B+=Re)<0&&(B=0):B>Re&&(B=Re),B>>=0,B>>>=0,Re||Ue(N,B,this.length);for(var Qe=this[N],St=1,Nt=0;++Nt>>=0,B>>>=0,Re||Ue(N,B,this.length);for(var Qe=this[N+--B],St=1;B>0&&(St*=256);)Qe+=this[N+--B]*St;return Qe},x.prototype.readUInt8=function(N,B){return N>>>=0,B||Ue(N,1,this.length),this[N]},x.prototype.readUInt16LE=function(N,B){return N>>>=0,B||Ue(N,2,this.length),this[N]|this[N+1]<<8},x.prototype.readUInt16BE=function(N,B){return N>>>=0,B||Ue(N,2,this.length),this[N]<<8|this[N+1]},x.prototype.readUInt32LE=function(N,B){return N>>>=0,B||Ue(N,4,this.length),(this[N]|this[N+1]<<8|this[N+2]<<16)+16777216*this[N+3]},x.prototype.readUInt32BE=function(N,B){return N>>>=0,B||Ue(N,4,this.length),16777216*this[N]+(this[N+1]<<16|this[N+2]<<8|this[N+3])},x.prototype.readIntLE=function(N,B,Re){N>>>=0,B>>>=0,Re||Ue(N,B,this.length);for(var Qe=this[N],St=1,Nt=0;++Nt=(St*=128)&&(Qe-=Math.pow(2,8*B)),Qe},x.prototype.readIntBE=function(N,B,Re){N>>>=0,B>>>=0,Re||Ue(N,B,this.length);for(var Qe=B,St=1,Nt=this[N+--Qe];Qe>0&&(St*=256);)Nt+=this[N+--Qe]*St;return Nt>=(St*=128)&&(Nt-=Math.pow(2,8*B)),Nt},x.prototype.readInt8=function(N,B){return N>>>=0,B||Ue(N,1,this.length),128&this[N]?-1*(255-this[N]+1):this[N]},x.prototype.readInt16LE=function(N,B){N>>>=0,B||Ue(N,2,this.length);var Re=this[N]|this[N+1]<<8;return 32768&Re?4294901760|Re:Re},x.prototype.readInt16BE=function(N,B){N>>>=0,B||Ue(N,2,this.length);var Re=this[N+1]|this[N]<<8;return 32768&Re?4294901760|Re:Re},x.prototype.readInt32LE=function(N,B){return N>>>=0,B||Ue(N,4,this.length),this[N]|this[N+1]<<8|this[N+2]<<16|this[N+3]<<24},x.prototype.readInt32BE=function(N,B){return N>>>=0,B||Ue(N,4,this.length),this[N]<<24|this[N+1]<<16|this[N+2]<<8|this[N+3]},x.prototype.readFloatLE=function(N,B){return N>>>=0,B||Ue(N,4,this.length),P.read(this,N,!0,23,4)},x.prototype.readFloatBE=function(N,B){return N>>>=0,B||Ue(N,4,this.length),P.read(this,N,!1,23,4)},x.prototype.readDoubleLE=function(N,B){return N>>>=0,B||Ue(N,8,this.length),P.read(this,N,!0,52,8)},x.prototype.readDoubleBE=function(N,B){return N>>>=0,B||Ue(N,8,this.length),P.read(this,N,!1,52,8)},x.prototype.writeUIntLE=function(N,B,Re,Qe){N=+N,B>>>=0,Re>>>=0,Qe||ke(this,N,B,Re,Math.pow(2,8*Re)-1,0);var Nt=1,On=0;for(this[B]=255&N;++On>>=0,Re>>>=0,Qe||ke(this,N,B,Re,Math.pow(2,8*Re)-1,0);var Nt=Re-1,On=1;for(this[B+Nt]=255&N;--Nt>=0&&(On*=256);)this[B+Nt]=N/On&255;return B+Re},x.prototype.writeUInt8=function(N,B,Re){return N=+N,B>>>=0,Re||ke(this,N,B,1,255,0),this[B]=255&N,B+1},x.prototype.writeUInt16LE=function(N,B,Re){return N=+N,B>>>=0,Re||ke(this,N,B,2,65535,0),this[B]=255&N,this[B+1]=N>>>8,B+2},x.prototype.writeUInt16BE=function(N,B,Re){return N=+N,B>>>=0,Re||ke(this,N,B,2,65535,0),this[B]=N>>>8,this[B+1]=255&N,B+2},x.prototype.writeUInt32LE=function(N,B,Re){return N=+N,B>>>=0,Re||ke(this,N,B,4,4294967295,0),this[B+3]=N>>>24,this[B+2]=N>>>16,this[B+1]=N>>>8,this[B]=255&N,B+4},x.prototype.writeUInt32BE=function(N,B,Re){return N=+N,B>>>=0,Re||ke(this,N,B,4,4294967295,0),this[B]=N>>>24,this[B+1]=N>>>16,this[B+2]=N>>>8,this[B+3]=255&N,B+4},x.prototype.writeIntLE=function(N,B,Re,Qe){if(N=+N,B>>>=0,!Qe){var St=Math.pow(2,8*Re-1);ke(this,N,B,Re,St-1,-St)}var Nt=0,On=1,kn=0;for(this[B]=255&N;++Nt>0)-kn&255;return B+Re},x.prototype.writeIntBE=function(N,B,Re,Qe){if(N=+N,B>>>=0,!Qe){var St=Math.pow(2,8*Re-1);ke(this,N,B,Re,St-1,-St)}var Nt=Re-1,On=1,kn=0;for(this[B+Nt]=255&N;--Nt>=0&&(On*=256);)N<0&&0===kn&&0!==this[B+Nt+1]&&(kn=1),this[B+Nt]=(N/On>>0)-kn&255;return B+Re},x.prototype.writeInt8=function(N,B,Re){return N=+N,B>>>=0,Re||ke(this,N,B,1,127,-128),N<0&&(N=255+N+1),this[B]=255&N,B+1},x.prototype.writeInt16LE=function(N,B,Re){return N=+N,B>>>=0,Re||ke(this,N,B,2,32767,-32768),this[B]=255&N,this[B+1]=N>>>8,B+2},x.prototype.writeInt16BE=function(N,B,Re){return N=+N,B>>>=0,Re||ke(this,N,B,2,32767,-32768),this[B]=N>>>8,this[B+1]=255&N,B+2},x.prototype.writeInt32LE=function(N,B,Re){return N=+N,B>>>=0,Re||ke(this,N,B,4,2147483647,-2147483648),this[B]=255&N,this[B+1]=N>>>8,this[B+2]=N>>>16,this[B+3]=N>>>24,B+4},x.prototype.writeInt32BE=function(N,B,Re){return N=+N,B>>>=0,Re||ke(this,N,B,4,2147483647,-2147483648),N<0&&(N=4294967295+N+1),this[B]=N>>>24,this[B+1]=N>>>16,this[B+2]=N>>>8,this[B+3]=255&N,B+4},x.prototype.writeFloatLE=function(N,B,Re){return Me(this,N,B,!0,Re)},x.prototype.writeFloatBE=function(N,B,Re){return Me(this,N,B,!1,Re)},x.prototype.writeDoubleLE=function(N,B,Re){return Ve(this,N,B,!0,Re)},x.prototype.writeDoubleBE=function(N,B,Re){return Ve(this,N,B,!1,Re)},x.prototype.copy=function(N,B,Re,Qe){if(!x.isBuffer(N))throw new TypeError("argument should be a Buffer");if(Re||(Re=0),!Qe&&0!==Qe&&(Qe=this.length),B>=N.length&&(B=N.length),B||(B=0),Qe>0&&Qe=this.length)throw new RangeError("Index out of range");if(Qe<0)throw new RangeError("sourceEnd out of bounds");Qe>this.length&&(Qe=this.length),N.length-B=0;--Nt)N[Nt+B]=this[Nt+Re];else Uint8Array.prototype.set.call(N,this.subarray(Re,Qe),B);return St},x.prototype.fill=function(N,B,Re,Qe){if("string"==typeof N){if("string"==typeof B?(Qe=B,B=0,Re=this.length):"string"==typeof Re&&(Qe=Re,Re=this.length),void 0!==Qe&&"string"!=typeof Qe)throw new TypeError("encoding must be a string");if("string"==typeof Qe&&!x.isEncoding(Qe))throw new TypeError("Unknown encoding: "+Qe);if(1===N.length){var St=N.charCodeAt(0);("utf8"===Qe&&St<128||"latin1"===Qe)&&(N=St)}}else"number"==typeof N&&(N&=255);if(B<0||this.length>>=0,Re=void 0===Re?this.length:Re>>>0,N||(N=0),"number"==typeof N)for(Nt=B;Nt55295&&B<57344){if(!Qe){if(B>56319){(N-=3)>-1&&St.push(239,191,189);continue}if(Nt+1===Re){(N-=3)>-1&&St.push(239,191,189);continue}Qe=B;continue}if(B<56320){(N-=3)>-1&&St.push(239,191,189),Qe=B;continue}B=65536+(Qe-55296<<10|B-56320)}else Qe&&(N-=3)>-1&&St.push(239,191,189);if(Qe=null,B<128){if((N-=1)<0)break;St.push(B)}else if(B<2048){if((N-=2)<0)break;St.push(B>>6|192,63&B|128)}else if(B<65536){if((N-=3)<0)break;St.push(B>>12|224,B>>6&63|128,63&B|128)}else{if(!(B<1114112))throw new Error("Invalid code point");if((N-=4)<0)break;St.push(B>>18|240,B>>12&63|128,B>>6&63|128,63&B|128)}}return St}function je(L){return j.toByteArray(function(L){if((L=(L=L.split("=")[0]).trim().replace($e,"")).length<2)return"";for(;L.length%4!=0;)L+="=";return L}(L))}function _t(L,N,B,Re){for(var Qe=0;Qe=N.length||Qe>=L.length);++Qe)N[Qe+B]=L[Qe];return Qe}function pt(L,N){return L instanceof N||null!=L&&null!=L.constructor&&null!=L.constructor.name&&L.constructor.name===N.name}function ve(L){return L!=L}}).call(this)}).call(this,Y("buffer").Buffer)},{"base64-js":2,buffer:6,ieee754:9}],7:[function(Y,Se,he){"use strict";Se.exports=function W(j){return null===j||"object"!=typeof j||null!=j.toJSON?JSON.stringify(j):Array.isArray(j)?"["+j.reduce((P,Q,z)=>P+(0===z?"":",")+W(void 0===Q||"symbol"==typeof Q?null:Q),"")+"]":"{"+Object.keys(j).sort().reduce((P,Q,z)=>void 0===j[Q]||"symbol"==typeof j[Q]?P:P+(0===P.length?"":",")+W(Q)+":"+W(j[Q]),"")+"}"}},{}],8:[function(Y,Se,he){"use strict";var P,W="object"==typeof Reflect?Reflect:null,j=W&&"function"==typeof W.apply?W.apply:function($,Z,oe){return Function.prototype.apply.call($,Z,oe)};P=W&&"function"==typeof W.ownKeys?W.ownKeys:Object.getOwnPropertySymbols?function($){return Object.getOwnPropertyNames($).concat(Object.getOwnPropertySymbols($))}:function($){return Object.getOwnPropertyNames($)};var z=Number.isNaN||function($){return $!=$};function v(){v.init.call(this)}Se.exports=v,Se.exports.once=function(E,$){return new Promise(function(Z,oe){function se(Ce){E.removeListener($,te),oe(Ce)}function te(){"function"==typeof E.removeListener&&E.removeListener("error",se),Z([].slice.call(arguments))}X(E,$,te,{once:!0}),"error"!==$&&function(E,$,Z){"function"==typeof E.on&&X(E,"error",$,Z)}(E,se,{once:!0})})},v.EventEmitter=v,v.prototype._events=void 0,v.prototype._eventsCount=0,v.prototype._maxListeners=void 0;var x=10;function O(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?v.defaultMaxListeners:E._maxListeners}function b(E,$,Z,oe){var se,te,Ce;if(O(Z),void 0===(te=E._events)?(te=E._events=Object.create(null),E._eventsCount=0):(void 0!==te.newListener&&(E.emit("newListener",$,Z.listener?Z.listener:Z),te=E._events),Ce=te[$]),void 0===Ce)Ce=te[$]=Z,++E._eventsCount;else if("function"==typeof Ce?Ce=te[$]=oe?[Z,Ce]:[Ce,Z]:oe?Ce.unshift(Z):Ce.push(Z),(se=A(E))>0&&Ce.length>se&&!Ce.warned){Ce.warned=!0;var me=new Error("Possible EventEmitter memory leak detected. "+Ce.length+" "+String($)+" listeners added. Use emitter.setMaxListeners() to increase limit");me.name="MaxListenersExceededWarning",me.emitter=E,me.type=$,me.count=Ce.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 S(E,$,Z){var oe={fired:!1,wrapFn:void 0,target:E,type:$,listener:Z},se=y.bind(oe);return se.listener=Z,oe.wrapFn=se,se}function T(E,$,Z){var oe=E._events;if(void 0===oe)return[];var se=oe[$];return void 0===se?[]:"function"==typeof se?Z?[se.listener||se]:[se]:Z?function(E){for(var $=new Array(E.length),Z=0;Z<$.length;++Z)$[Z]=E[Z].listener||E[Z];return $}(se):R(se,se.length)}function V(E){var $=this._events;if(void 0!==$){var Z=$[E];if("function"==typeof Z)return 1;if(void 0!==Z)return Z.length}return 0}function R(E,$){for(var Z=new Array($),oe=0;oe<$;++oe)Z[oe]=E[oe];return Z}function X(E,$,Z,oe){if("function"==typeof E.on)oe.once?E.once($,Z):E.on($,Z);else{if("function"!=typeof E.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof E);E.addEventListener($,function se(te){oe.once&&E.removeEventListener($,se),Z(te)})}}Object.defineProperty(v,"defaultMaxListeners",{enumerable:!0,get:function(){return x},set:function(E){if("number"!=typeof E||E<0||z(E))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+E+".");x=E}}),v.init=function(){(void 0===this._events||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},v.prototype.setMaxListeners=function($){if("number"!=typeof $||$<0||z($))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+$+".");return this._maxListeners=$,this},v.prototype.getMaxListeners=function(){return A(this)},v.prototype.emit=function($){for(var Z=[],oe=1;oe0&&(Ce=Z[0]),Ce instanceof Error)throw Ce;var me=new Error("Unhandled error."+(Ce?" ("+Ce.message+")":""));throw me.context=Ce,me}var ne=te[$];if(void 0===ne)return!1;if("function"==typeof ne)j(ne,this,Z);else{var _e=ne.length,Ie=R(ne,_e);for(oe=0;oe<_e;++oe)j(Ie[oe],this,Z)}return!0},v.prototype.on=v.prototype.addListener=function($,Z){return b(this,$,Z,!1)},v.prototype.prependListener=function($,Z){return b(this,$,Z,!0)},v.prototype.once=function($,Z){return O(Z),this.on($,S(this,$,Z)),this},v.prototype.prependOnceListener=function($,Z){return O(Z),this.prependListener($,S(this,$,Z)),this},v.prototype.off=v.prototype.removeListener=function($,Z){var oe,se,te,Ce,me;if(O(Z),void 0===(se=this._events))return this;if(void 0===(oe=se[$]))return this;if(oe===Z||oe.listener===Z)0==--this._eventsCount?this._events=Object.create(null):(delete se[$],se.removeListener&&this.emit("removeListener",$,oe.listener||Z));else if("function"!=typeof oe){for(te=-1,Ce=oe.length-1;Ce>=0;Ce--)if(oe[Ce]===Z||oe[Ce].listener===Z){me=oe[Ce].listener,te=Ce;break}if(te<0)return this;0===te?oe.shift():function(E,$){for(;$+1=0;se--)this.removeListener($,Z[se]);return this},v.prototype.listeners=function($){return T(this,$,!0)},v.prototype.rawListeners=function($){return T(this,$,!1)},v.listenerCount=function(E,$){return"function"==typeof E.listenerCount?E.listenerCount($):V.call(E,$)},v.prototype.listenerCount=V,v.prototype.eventNames=function(){return this._eventsCount>0?P(this._events):[]}},{}],9:[function(Y,Se,he){he.read=function(W,j,P,Q,z){var v,x,O=8*z-Q-1,A=(1<>1,y=-7,S=P?z-1:0,T=P?-1:1,V=W[j+S];for(S+=T,v=V&(1<<-y)-1,V>>=-y,y+=O;y>0;v=256*v+W[j+S],S+=T,y-=8);for(x=v&(1<<-y)-1,v>>=-y,y+=Q;y>0;x=256*x+W[j+S],S+=T,y-=8);if(0===v)v=1-b;else{if(v===A)return x?NaN:1/0*(V?-1:1);x+=Math.pow(2,Q),v-=b}return(V?-1:1)*x*Math.pow(2,v-Q)},he.write=function(W,j,P,Q,z,v){var x,O,A,b=8*v-z-1,y=(1<>1,T=23===z?Math.pow(2,-24)-Math.pow(2,-77):0,V=Q?0:v-1,R=Q?1:-1,K=j<0||0===j&&1/j<0?1:0;for(j=Math.abs(j),isNaN(j)||j===1/0?(O=isNaN(j)?1:0,x=y):(x=Math.floor(Math.log(j)/Math.LN2),j*(A=Math.pow(2,-x))<1&&(x--,A*=2),(j+=x+S>=1?T/A:T*Math.pow(2,1-S))*A>=2&&(x++,A/=2),x+S>=y?(O=0,x=y):x+S>=1?(O=(j*A-1)*Math.pow(2,z),x+=S):(O=j*Math.pow(2,S-1)*Math.pow(2,z),x=0));z>=8;W[P+V]=255&O,V+=R,O/=256,z-=8);for(x=x<0;W[P+V]=255&x,V+=R,x/=256,b-=8);W[P+V-R]|=128*K}},{}],10:[function(Y,Se,he){Se.exports="function"==typeof Object.create?function(j,P){P&&(j.super_=P,j.prototype=Object.create(P.prototype,{constructor:{value:j,enumerable:!1,writable:!0,configurable:!0}}))}:function(j,P){if(P){j.super_=P;var Q=function(){};Q.prototype=P.prototype,j.prototype=new Q,j.prototype.constructor=j}}},{}],11:[function(Y,Se,he){"use strict";const{isArray:W,isObject:j,isString:P}=Y("./types"),{asArray:Q}=Y("./util"),{prependBase:z}=Y("./url"),v=Y("./JsonLdError"),x=Y("./ResolvedContext");function A(y){throw new v("Invalid JSON-LD syntax; @context must be an object.","jsonld.SyntaxError",{code:"invalid local context",context:y})}function b({context:y,base:S}){if(!y)return;const T=y["@context"];if(P(T))y["@context"]=z(S,T);else if(W(T))for(let V=0;V10)throw new v("Maximum number of @context URLs exceeded.","jsonld.ContextUrlError",{code:"json-ld-1.0"===S.processingMode?"loading remote context failed":"context overflow",max:10});if(R.has(T))throw new v("Cyclical @context URLs detected.","jsonld.ContextUrlError",{code:"json-ld-1.0"===S.processingMode?"recursive context inclusion":"context overflow",url:T});let K,ce;R.add(T);try{ce=yield V(T),K=ce.document||null,P(K)&&(K=JSON.parse(K))}catch(D){throw new v("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:D})}if(!j(K))throw new v("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 K="@context"in K?{"@context":K["@context"]}:{"@context":{}},ce.contextUrl&&(W(K["@context"])||(K["@context"]=[K["@context"]]),K["@context"].push(ce.contextUrl)),{context:K,remoteDoc:ce}})()}}},{"./JsonLdError":12,"./ResolvedContext":16,"./types":30,"./url":31,"./util":32}],12:[function(Y,Se,he){"use strict";Se.exports=class extends Error{constructor(j="An unspecified JSON-LD error occurred.",P="jsonld.Error",Q={}){super(j),this.name=P,this.message=j,this.details=Q}}},{}],13:[function(Y,Se,he){"use strict";Se.exports=W=>{class j{toString(){return"[object JsonLdProcessor]"}}return Object.defineProperty(j,"prototype",{writable:!1,enumerable:!1}),Object.defineProperty(j.prototype,"constructor",{writable:!0,enumerable:!1,configurable:!0,value:j}),j.compact=function(P,Q){return arguments.length<2?Promise.reject(new TypeError("Could not compact, too few arguments.")):W.compact(P,Q)},j.expand=function(P){return arguments.length<1?Promise.reject(new TypeError("Could not expand, too few arguments.")):W.expand(P)},j.flatten=function(P){return arguments.length<1?Promise.reject(new TypeError("Could not flatten, too few arguments.")):W.flatten(P)},j}},{}],14:[function(Y,Se,he){"use strict";Se.exports=Y("rdf-canonize").NQuads},{"rdf-canonize":46}],15:[function(Y,Se,he){"use strict";Se.exports=class{constructor(){this._requests={}}wrapLoader(j){const P=this;return P._loader=j,function(){return P.add.apply(P,arguments)}}add(j){var P=this;return yt(function*(){let Q=P._requests[j];if(Q)return Promise.resolve(Q);Q=P._requests[j]=P._loader(j);try{return yield Q}finally{delete P._requests[j]}})()}}},{}],16:[function(Y,Se,he){"use strict";const W=Y("lru-cache");Se.exports=class{constructor({document:Q}){this.document=Q,this.cache=new W({max:10})}getProcessed(Q){return this.cache.get(Q)}setProcessed(Q,z){this.cache.set(Q,z)}}},{"lru-cache":33}],17:[function(Y,Se,he){"use strict";const W=Y("./JsonLdError"),{isArray:j,isObject:P,isString:Q,isUndefined:z}=Y("./types"),{isList:v,isValue:x,isGraph:O,isSimpleGraph:A,isSubjectReference:b}=Y("./graphTypes"),{expandIri:y,getContextValue:S,isKeyword:T,process:V,processingMode:R}=Y("./context"),{removeBase:K,prependBase:ce}=Y("./url"),{addValue:D,asArray:I,compareShortestLeast:X}=Y("./util"),E={};function Z(oe,se,te){if("@nest"!==y(oe,se,{vocab:!0},te))throw new W("JSON-LD compact error; nested property must have an @nest value resolving to @nest.","jsonld.SyntaxError",{code:"invalid @nest value"})}Se.exports=E,E.compact=function(){var oe=yt(function*({activeCtx:se,activeProperty:te=null,element:Ce,options:me={},compactionMap:ne=(()=>{})}){if(j(Ce)){let Ie=[];for(let Ge=0;Ge1&&(tt=Array.from(tt).sort());const Ye=se;for(const ke of tt){const Ke=E.compactIri({activeCtx:Ye,iri:ke,relativeTo:{vocab:!0}}),Me=S(st,Ke,"@context");z(Me)||(se=yield V({activeCtx:se,localCtx:Me,options:me,propagate:!1}))}const Ue=Object.keys(Ce).sort();for(const ke of Ue){const Ke=Ce[ke];if("@id"!==ke)if("@type"!==ke)if("@reverse"!==ke)if("@preserve"!==ke)if("@index"!==ke)if("@graph"!==ke&&"@list"!==ke&&"@included"!==ke&&T(ke)){const Me=E.compactIri({activeCtx:se,iri:ke,relativeTo:{vocab:!0}});D(Ge,Me,Ke)}else{if(!j(Ke))throw new W("JSON-LD expansion error; expanded value must be an array.","jsonld.SyntaxError");if(0===Ke.length){const Me=E.compactIri({activeCtx:se,iri:ke,value:Ke,relativeTo:{vocab:!0},reverse:Ie}),Ve=se.mappings.has(Me)?se.mappings.get(Me)["@nest"]:null;let $e=Ge;Ve&&(Z(se,Ve,me),P(Ge[Ve])||(Ge[Ve]={}),$e=Ge[Ve]),D($e,Me,Ke,{propertyIsArray:!0})}for(const Me of Ke){const Ve=E.compactIri({activeCtx:se,iri:ke,value:Me,relativeTo:{vocab:!0},reverse:Ie}),$e=se.mappings.has(Ve)?se.mappings.get(Ve)["@nest"]:null;let Ne=Ge;$e&&(Z(se,$e,me),P(Ge[$e])||(Ge[$e]={}),Ne=Ge[$e]);const q=S(se,Ve,"@container")||[],G=O(Me),pe=v(Me);let ue;pe?ue=Me["@list"]:G&&(ue=Me["@graph"]);let je=yield E.compact({activeCtx:se,activeProperty:Ve,element:pe||G?ue:Me,options:me,compactionMap:ne});if(pe){if(j(je)||(je=[je]),q.includes("@list")){D(Ne,Ve,je,{valueIsArray:!0,allowDuplicate:!0});continue}je={[E.compactIri({activeCtx:se,iri:"@list",relativeTo:{vocab:!0}})]:je},"@index"in Me&&(je[E.compactIri({activeCtx:se,iri:"@index",relativeTo:{vocab:!0}})]=Me["@index"])}if(G)if(q.includes("@graph")&&(q.includes("@id")||q.includes("@index")&&A(Me))){let _t;Ne.hasOwnProperty(Ve)?_t=Ne[Ve]:Ne[Ve]=_t={};const pt=(q.includes("@id")?Me["@id"]:Me["@index"])||E.compactIri({activeCtx:se,iri:"@none",relativeTo:{vocab:!0}});D(_t,pt,je,{propertyIsArray:!me.compactArrays||q.includes("@set")})}else q.includes("@graph")&&A(Me)?(j(je)&&je.length>1&&(je={"@included":je}),D(Ne,Ve,je,{propertyIsArray:!me.compactArrays||q.includes("@set")})):(j(je)&&1===je.length&&me.compactArrays&&(je=je[0]),je={[E.compactIri({activeCtx:se,iri:"@graph",relativeTo:{vocab:!0}})]:je},"@id"in Me&&(je[E.compactIri({activeCtx:se,iri:"@id",relativeTo:{vocab:!0}})]=Me["@id"]),"@index"in Me&&(je[E.compactIri({activeCtx:se,iri:"@index",relativeTo:{vocab:!0}})]=Me["@index"]),D(Ne,Ve,je,{propertyIsArray:!me.compactArrays||q.includes("@set")}));else if(q.includes("@language")||q.includes("@index")||q.includes("@id")||q.includes("@type")){let _t,pt;if(Ne.hasOwnProperty(Ve)?_t=Ne[Ve]:Ne[Ve]=_t={},q.includes("@language"))x(je)&&(je=je["@value"]),pt=Me["@language"];else if(q.includes("@index")){const ve=S(se,Ve,"@index")||"@index",L=E.compactIri({activeCtx:se,iri:ve,relativeTo:{vocab:!0}});if("@index"===ve)pt=Me["@index"],delete je[L];else{let N;if([pt,...N]=I(je[ve]||[]),Q(pt))switch(N.length){case 0:delete je[ve];break;case 1:je[ve]=N[0];break;default:je[ve]=N}else pt=null}}else if(q.includes("@id")){const ve=E.compactIri({activeCtx:se,iri:"@id",relativeTo:{vocab:!0}});pt=je[ve],delete je[ve]}else if(q.includes("@type")){const ve=E.compactIri({activeCtx:se,iri:"@type",relativeTo:{vocab:!0}});let L;switch([pt,...L]=I(je[ve]||[]),L.length){case 0:delete je[ve];break;case 1:je[ve]=L[0];break;default:je[ve]=L}1===Object.keys(je).length&&"@id"in Me&&(je=yield E.compact({activeCtx:se,activeProperty:Ve,element:{"@id":Me["@id"]},options:me,compactionMap:ne}))}pt||(pt=E.compactIri({activeCtx:se,iri:"@none",relativeTo:{vocab:!0}})),D(_t,pt,je,{propertyIsArray:q.includes("@set")})}else{const _t=!me.compactArrays||q.includes("@set")||q.includes("@list")||j(je)&&0===je.length||"@list"===ke||"@graph"===ke;D(Ne,Ve,je,{propertyIsArray:_t})}}}else{if((S(se,te,"@container")||[]).includes("@index"))continue;const Ve=E.compactIri({activeCtx:se,iri:ke,relativeTo:{vocab:!0}});D(Ge,Ve,Ke)}else{const Me=yield E.compact({activeCtx:se,activeProperty:te,element:Ke,options:me,compactionMap:ne});j(Me)&&0===Me.length||D(Ge,ke,Me)}else{const Me=yield E.compact({activeCtx:se,activeProperty:"@reverse",element:Ke,options:me,compactionMap:ne});for(const Ve in Me)if(se.mappings.has(Ve)&&se.mappings.get(Ve).reverse){const $e=Me[Ve],q=(S(se,Ve,"@container")||[]).includes("@set")||!me.compactArrays;D(Ge,Ve,$e,{propertyIsArray:q}),delete Me[Ve]}if(Object.keys(Me).length>0){const Ve=E.compactIri({activeCtx:se,iri:ke,relativeTo:{vocab:!0}});D(Ge,Ve,Me)}}else{let Me=I(Ke).map(G=>E.compactIri({activeCtx:st,iri:G,relativeTo:{vocab:!0}}));1===Me.length&&(Me=Me[0]);const Ve=E.compactIri({activeCtx:se,iri:"@type",relativeTo:{vocab:!0}}),q=(S(se,Ve,"@container")||[]).includes("@set")&&R(se,1.1)||j(Me)&&0===Ke.length;D(Ge,Ve,Me,{propertyIsArray:q})}else{let Me=I(Ke).map($e=>E.compactIri({activeCtx:se,iri:$e,relativeTo:{vocab:!1},base:me.base}));1===Me.length&&(Me=Me[0]),Ge[E.compactIri({activeCtx:se,iri:"@id",relativeTo:{vocab:!0}})]=Me}}return Ge}return Ce});return function(se){return oe.apply(this,arguments)}}(),E.compactIri=({activeCtx:oe,iri:se,value:te=null,relativeTo:Ce={vocab:!1},reverse:me=!1,base:ne=null})=>{if(null===se)return se;oe.isPropertyTermScoped&&oe.previousContext&&(oe=oe.previousContext);const _e=oe.getInverse();if(T(se)&&se in _e&&"@none"in _e[se]&&"@type"in _e[se]["@none"]&&"@none"in _e[se]["@none"]["@type"])return _e[se]["@none"]["@type"]["@none"];if(Ce.vocab&&se in _e){const tt=oe["@language"]||"@none",Ye=[];P(te)&&"@index"in te&&!("@graph"in te)&&Ye.push("@index","@index@set"),P(te)&&"@preserve"in te&&(te=te["@preserve"][0]),O(te)?("@index"in te&&Ye.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in te&&Ye.push("@graph@id","@graph@id@set"),Ye.push("@graph","@graph@set","@set"),"@index"in te||Ye.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in te||Ye.push("@graph@id","@graph@id@set")):P(te)&&!x(te)&&Ye.push("@id","@id@set","@type","@set@type");let Ue="@language",ke="@null";if(me)Ue="@type",ke="@reverse",Ye.push("@set");else if(v(te)){"@index"in te||Ye.push("@list");const Me=te["@list"];if(0===Me.length)Ue="@any",ke="@none";else{let Ve=0===Me.length?tt:null,$e=null;for(let Ne=0;Nest.includes("_"));Ge&&_e.push(Ge.replace(/^[^_]+_/,"_"))}_e.push("@none");const Ie=oe.inverse[se];for(const Ge of Ce){if(!(Ge in Ie))continue;const st=Ie[Ge][me];for(const Xe of _e)if(Xe in st)return st[Xe]}return null}(oe,se,te,Ye,Ue,ke);if(null!==Ke)return Ke}if(Ce.vocab&&"@vocab"in oe){const tt=oe["@vocab"];if(0===se.indexOf(tt)&&se!==tt){const Ye=se.substr(tt.length);if(!oe.mappings.has(Ye))return Ye}}let Ie=null;const Ge=[];let st=oe.fastCurieMap;const Xe=se.length-1;for(let tt=0;tt=0;--tt){const Ye=Ge[tt],Ue=Ye.terms;for(const ke of Ue){const Ke=ke+":"+se.substr(Ye.iri.length);oe.mappings.get(ke)._prefix&&(!oe.mappings.has(Ke)||null===te&&oe.mappings.get(Ke)["@id"]===se)&&(null===Ie||X(Ke,Ie)<0)&&(Ie=Ke)}}if(null!==Ie)return Ie;for(const[tt,Ye]of oe.mappings)if(Ye&&Ye._prefix&&se.startsWith(tt+":"))throw new W(`Absolute IRI "${se}" confused with prefix "${tt}".`,"jsonld.SyntaxError",{code:"IRI confused with prefix",context:oe});return Ce.vocab?se:"@base"in oe?oe["@base"]?K(ce(ne,oe["@base"]),se):se:K(ne,se)},E.compactValue=({activeCtx:oe,activeProperty:se,value:te,options:Ce})=>{if(x(te)){const Ie=S(oe,se,"@type"),Ge=S(oe,se,"@language"),st=S(oe,se,"@direction"),Xe=S(oe,se,"@container")||[],tt="@index"in te&&!Xe.includes("@index");if(!tt&&"@none"!==Ie&&(te["@type"]===Ie||"@language"in te&&te["@language"]===Ge&&"@direction"in te&&te["@direction"]===st||"@language"in te&&te["@language"]===Ge||"@direction"in te&&te["@direction"]===st))return te["@value"];const Ye=Object.keys(te).length,Ue=1===Ye||2===Ye&&"@index"in te&&!tt,ke="@language"in oe,Ke=Q(te["@value"]),Me=oe.mappings.has(se)&&null===oe.mappings.get(se)["@language"];if(Ue&&"@none"!==Ie&&(!ke||!Ke||Me))return te["@value"];const Ve={};return tt&&(Ve[E.compactIri({activeCtx:oe,iri:"@index",relativeTo:{vocab:!0}})]=te["@index"]),"@type"in te?Ve[E.compactIri({activeCtx:oe,iri:"@type",relativeTo:{vocab:!0}})]=E.compactIri({activeCtx:oe,iri:te["@type"],relativeTo:{vocab:!0}}):"@language"in te&&(Ve[E.compactIri({activeCtx:oe,iri:"@language",relativeTo:{vocab:!0}})]=te["@language"]),"@direction"in te&&(Ve[E.compactIri({activeCtx:oe,iri:"@direction",relativeTo:{vocab:!0}})]=te["@direction"]),Ve[E.compactIri({activeCtx:oe,iri:"@value",relativeTo:{vocab:!0}})]=te["@value"],Ve}const me=y(oe,se,{vocab:!0},Ce),ne=S(oe,se,"@type"),_e=E.compactIri({activeCtx:oe,iri:te["@id"],relativeTo:{vocab:"@vocab"===ne},base:Ce.base});return"@id"===ne||"@vocab"===ne||"@graph"===me?_e:{[E.compactIri({activeCtx:oe,iri:"@id",relativeTo:{vocab:!0}})]:_e}}},{"./JsonLdError":12,"./context":19,"./graphTypes":25,"./types":30,"./url":31,"./util":32}],18:[function(Y,Se,he){"use strict";const W="http://www.w3.org/1999/02/22-rdf-syntax-ns#",j="http://www.w3.org/2001/XMLSchema#";Se.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:j,XSD_BOOLEAN:j+"boolean",XSD_DOUBLE:j+"double",XSD_INTEGER:j+"integer",XSD_STRING:j+"string"}},{}],19:[function(Y,Se,he){"use strict";const W=Y("./util"),j=Y("./JsonLdError"),{isArray:P,isObject:Q,isString:z,isUndefined:v}=Y("./types"),{isAbsolute:x,isRelative:O,prependBase:A}=Y("./url"),{asArray:b,compareShortestLeast:y}=Y("./util"),S=new Map,V=/^@[a-zA-Z]+$/,R={};function K(D,I,X,E,$,Z){if(null===I||!z(I)||R.isKeyword(I))return I;if(I.match(V))return null;if(E&&E.hasOwnProperty(I)&&!0!==$.get(I)&&R.createTermDefinition({activeCtx:D,localCtx:E,term:I,defined:$,options:Z}),(X=X||{}).vocab){const se=D.mappings.get(I);if(null===se)return null;if(Q(se)&&"@id"in se)return se["@id"]}const oe=I.indexOf(":");if(oe>0){const se=I.substr(0,oe),te=I.substr(oe+1);if("_"===se||0===te.indexOf("//"))return I;E&&E.hasOwnProperty(se)&&R.createTermDefinition({activeCtx:D,localCtx:E,term:se,defined:$,options:Z});const Ce=D.mappings.get(se);if(Ce&&Ce._prefix)return Ce["@id"]+te;if(x(I))return I}if(X.vocab&&"@vocab"in D)return D["@vocab"]+I;if(X.base&&"@base"in D){if(D["@base"])return A(A(Z.base,D["@base"]),I)}else if(X.base)return A(Z.base,I);return I}function ce(D,I){if(!D||"object"!=typeof D||!I||"object"!=typeof I)return D===I;const X=Array.isArray(D);if(X!==Array.isArray(I))return!1;if(X){if(D.length!==I.length)return!1;for(let Z=0;Z{if(E.has(X)){if(E.get(X))return;throw new j("Cyclical context definition detected.","jsonld.CyclicalContext",{code:"cyclic IRI mapping",context:I,term:X})}let oe;if(E.set(X,!1),I.hasOwnProperty(X)&&(oe=I[X]),"@type"===X&&Q(oe)&&"@set"===(oe["@container"]||"@set")&&R.processingMode(D,1.1)){const Ie=["@container","@id","@protected"],Ge=Object.keys(oe);if(0===Ge.length||Ge.some(st=>!Ie.includes(st)))throw new j("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:I,term:X})}else{if(R.isKeyword(X))throw new j("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:I,term:X});if(X.match(V))return void console.warn('WARNING: terms beginning with "@" are reserved for future use and ignored',{term:X});if(""===X)throw new j("Invalid JSON-LD syntax; a term cannot be an empty string.","jsonld.SyntaxError",{code:"invalid term definition",context:I})}const se=D.mappings.get(X);D.mappings.has(X)&&D.mappings.delete(X);let te=!1;if((z(oe)||null===oe)&&(te=!0,oe={"@id":oe}),!Q(oe))throw new j("Invalid JSON-LD syntax; @context term values must be strings or objects.","jsonld.SyntaxError",{code:"invalid term definition",context:I});const Ce={};D.mappings.set(X,Ce),Ce.reverse=!1;const me=["@container","@id","@language","@reverse","@type"];R.processingMode(D,1.1)&&me.push("@context","@direction","@index","@nest","@prefix","@protected");for(const Ie in oe)if(!me.includes(Ie))throw new j("Invalid JSON-LD syntax; a term definition must not contain "+Ie,"jsonld.SyntaxError",{code:"invalid term definition",context:I});const ne=X.indexOf(":");if(Ce._termHasColon=ne>0,"@reverse"in oe){if("@id"in oe)throw new j("Invalid JSON-LD syntax; a @reverse term definition must not contain @id.","jsonld.SyntaxError",{code:"invalid reverse property",context:I});if("@nest"in oe)throw new j("Invalid JSON-LD syntax; a @reverse term definition must not contain @nest.","jsonld.SyntaxError",{code:"invalid reverse property",context:I});const Ie=oe["@reverse"];if(!z(Ie))throw new j("Invalid JSON-LD syntax; a @context @reverse value must be a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:I});if(!R.isKeyword(Ie)&&Ie.match(V))return console.warn('WARNING: values beginning with "@" are reserved for future use and ignored',{reverse:Ie}),void(se?D.mappings.set(X,se):D.mappings.delete(X));const Ge=K(D,Ie,{vocab:!0,base:!1},I,E,$);if(!x(Ge))throw new j("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});Ce["@id"]=Ge,Ce.reverse=!0}else if("@id"in oe){let Ie=oe["@id"];if(Ie&&!z(Ie))throw new j("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===Ie)Ce["@id"]=null;else{if(!R.isKeyword(Ie)&&Ie.match(V))return console.warn('WARNING: values beginning with "@" are reserved for future use and ignored',{id:Ie}),void(se?D.mappings.set(X,se):D.mappings.delete(X));if(Ie!==X){if(Ie=K(D,Ie,{vocab:!0,base:!1},I,E,$),!x(Ie)&&!R.isKeyword(Ie))throw new j("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(X.match(/(?::[^:])|\//)&&K(D,X,{vocab:!0,base:!1},I,new Map(E).set(X,!0),$)!==Ie)throw new j("Invalid JSON-LD syntax; term in form of IRI must expand to definition.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:I});Ce["@id"]=Ie,Ce._prefix=te&&!Ce._termHasColon&&Ie.match(/[:\/\?#\[\]@]$/)}}}if(!("@id"in Ce))if(Ce._termHasColon){const Ie=X.substr(0,ne);if(I.hasOwnProperty(Ie)&&R.createTermDefinition({activeCtx:D,localCtx:I,term:Ie,defined:E,options:$}),D.mappings.has(Ie)){const Ge=X.substr(ne+1);Ce["@id"]=D.mappings.get(Ie)["@id"]+Ge}else Ce["@id"]=X}else if("@type"===X)Ce["@id"]=X;else{if(!("@vocab"in D))throw new j("Invalid JSON-LD syntax; @context terms must define an @id.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:I,term:X});Ce["@id"]=D["@vocab"]+X}if((!0===oe["@protected"]||!0===E.get("@protected")&&!1!==oe["@protected"])&&(D.protected[X]=!0,Ce.protected=!0),E.set(X,!0),"@type"in oe){let Ie=oe["@type"];if(!z(Ie))throw new j("Invalid JSON-LD syntax; an @context @type value must be a string.","jsonld.SyntaxError",{code:"invalid type mapping",context:I});if("@json"===Ie||"@none"===Ie){if(R.processingMode(D,1))throw new j(`Invalid JSON-LD syntax; an @context @type value must not be "${Ie}" in JSON-LD 1.0 mode.`,"jsonld.SyntaxError",{code:"invalid type mapping",context:I})}else if("@id"!==Ie&&"@vocab"!==Ie){if(Ie=K(D,Ie,{vocab:!0,base:!1},I,E,$),!x(Ie))throw new j("Invalid JSON-LD syntax; an @context @type value must be an absolute IRI.","jsonld.SyntaxError",{code:"invalid type mapping",context:I});if(0===Ie.indexOf("_:"))throw new j("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})}Ce["@type"]=Ie}if("@container"in oe){const Ie=z(oe["@container"])?[oe["@container"]]:oe["@container"]||[],Ge=["@list","@set","@index","@language"];let st=!0;const Xe=Ie.includes("@set");if(R.processingMode(D,1.1)){if(Ge.push("@graph","@id","@type"),Ie.includes("@list")){if(1!==Ie.length)throw new j("Invalid JSON-LD syntax; @context @container with @list must have no other values","jsonld.SyntaxError",{code:"invalid container mapping",context:I})}else if(Ie.includes("@graph")){if(Ie.some(tt=>"@graph"!==tt&&"@id"!==tt&&"@index"!==tt&&"@set"!==tt))throw new j("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 st&=Ie.length<=(Xe?2:1);if(Ie.includes("@type")&&(Ce["@type"]=Ce["@type"]||"@id",!["@id","@vocab"].includes(Ce["@type"])))throw new j("Invalid JSON-LD syntax; container: @type requires @type to be @id or @vocab.","jsonld.SyntaxError",{code:"invalid type mapping",context:I})}else st&=!P(oe["@container"]),st&=Ie.length<=1;if(st&=Ie.every(tt=>Ge.includes(tt)),st&=!(Xe&&Ie.includes("@list")),!st)throw new j("Invalid JSON-LD syntax; @context @container value must be one of the following: "+Ge.join(", "),"jsonld.SyntaxError",{code:"invalid container mapping",context:I});if(Ce.reverse&&!Ie.every(tt=>["@index","@set"].includes(tt)))throw new j("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});Ce["@container"]=Ie}if("@index"in oe){if(!("@container"in oe)||!Ce["@container"].includes("@index"))throw new j(`Invalid JSON-LD syntax; @index without @index in @container: "${oe["@index"]}" on term "${X}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:I});if(!z(oe["@index"])||0===oe["@index"].indexOf("@"))throw new j(`Invalid JSON-LD syntax; @index must expand to an IRI: "${oe["@index"]}" on term "${X}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:I});Ce["@index"]=oe["@index"]}if("@context"in oe&&(Ce["@context"]=oe["@context"]),"@language"in oe&&!("@type"in oe)){let Ie=oe["@language"];if(null!==Ie&&!z(Ie))throw new j("Invalid JSON-LD syntax; @context @language value must be a string or null.","jsonld.SyntaxError",{code:"invalid language mapping",context:I});null!==Ie&&(Ie=Ie.toLowerCase()),Ce["@language"]=Ie}if("@prefix"in oe){if(X.match(/:|\//))throw new j("Invalid JSON-LD syntax; @context @prefix used on a compact IRI term","jsonld.SyntaxError",{code:"invalid term definition",context:I});if(R.isKeyword(Ce["@id"]))throw new j("Invalid JSON-LD syntax; keywords may not be used as prefixes","jsonld.SyntaxError",{code:"invalid term definition",context:I});if("boolean"!=typeof oe["@prefix"])throw new j("Invalid JSON-LD syntax; @context value for @prefix must be boolean","jsonld.SyntaxError",{code:"invalid @prefix value",context:I});Ce._prefix=!0===oe["@prefix"]}if("@direction"in oe){const Ie=oe["@direction"];if(null!==Ie&&"ltr"!==Ie&&"rtl"!==Ie)throw new j('Invalid JSON-LD syntax; @direction value must be null, "ltr", or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",context:I});Ce["@direction"]=Ie}if("@nest"in oe){const Ie=oe["@nest"];if(!z(Ie)||"@nest"!==Ie&&0===Ie.indexOf("@"))throw new j("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});Ce["@nest"]=Ie}const _e=Ce["@id"];if("@context"===_e||"@preserve"===_e)throw new j("Invalid JSON-LD syntax; @context and @preserve cannot be aliased.","jsonld.SyntaxError",{code:"invalid keyword alias",context:I});if(se&&se.protected&&!Z&&(D.protected[X]=!0,Ce.protected=!0,!ce(se,Ce))){const Ie=$&&$.protectedMode||"error";if("error"===Ie)throw new j(`Invalid JSON-LD syntax; tried to redefine "${X}" which is a protected term.`,"jsonld.SyntaxError",{code:"protected term redefinition",context:I,term:X});if("warn"===Ie)return void console.warn("WARNING: protected term redefinition",{term:X});throw new j("Invalid protectedMode.","jsonld.SyntaxError",{code:"invalid protected mode",context:I,term:X,protectedMode:Ie})}},R.expandIri=(D,I,X,E)=>K(D,I,X,void 0,void 0,E),R.getInitialContext=D=>{const I=JSON.stringify({processingMode:D.processingMode}),X=S.get(I);if(X)return X;const E={processingMode:D.processingMode,mappings:new Map,inverse:null,getInverse:function(){const Ce=this;if(Ce.inverse)return Ce.inverse;const me=Ce.inverse={},ne=Ce.fastCurieMap={},_e={},Ie=(Ce["@language"]||"@none").toLowerCase(),Ge=Ce["@direction"],st=Ce.mappings,Xe=[...st.keys()].sort(y);for(const tt of Xe){const Ye=st.get(tt);if(null===Ye)continue;let Ue=Ye["@container"]||"@none";if(Ue=[].concat(Ue).sort().join(""),null===Ye["@id"])continue;const ke=b(Ye["@id"]);for(const Ke of ke){let Me=me[Ke];const Ve=R.isKeyword(Ke);if(Me)!Ve&&!Ye._termHasColon&&_e[Ke].push(tt);else if(me[Ke]=Me={},!Ve&&!Ye._termHasColon){_e[Ke]=[tt];const $e={iri:Ke,terms:_e[Ke]};Ke[0]in ne?ne[Ke[0]].push($e):ne[Ke[0]]=[$e]}if(Me[Ue]||(Me[Ue]={"@language":{},"@type":{},"@any":{}}),Me=Me[Ue],oe(tt,Me["@any"],"@none"),Ye.reverse)oe(tt,Me["@type"],"@reverse");else if("@none"===Ye["@type"])oe(tt,Me["@any"],"@none"),oe(tt,Me["@language"],"@none"),oe(tt,Me["@type"],"@none");else if("@type"in Ye)oe(tt,Me["@type"],Ye["@type"]);else if("@language"in Ye&&"@direction"in Ye){const $e=Ye["@language"],Ne=Ye["@direction"];oe(tt,Me["@language"],$e&&Ne?`${$e}_${Ne}`.toLowerCase():$e?$e.toLowerCase():Ne?`_${Ne}`:"@null")}else"@language"in Ye?oe(tt,Me["@language"],(Ye["@language"]||"@null").toLowerCase()):"@direction"in Ye?oe(tt,Me["@language"],Ye["@direction"]?`_${Ye["@direction"]}`:"@none"):Ge?(oe(tt,Me["@language"],`_${Ge}`),oe(tt,Me["@language"],"@none"),oe(tt,Me["@type"],"@none")):(oe(tt,Me["@language"],Ie),oe(tt,Me["@language"],"@none"),oe(tt,Me["@type"],"@none"))}}for(const tt in ne)Z(ne,tt,1);return me},clone:function(){const Ce={};return Ce.mappings=W.clone(this.mappings),Ce.clone=this.clone,Ce.inverse=null,Ce.getInverse=this.getInverse,Ce.protected=W.clone(this.protected),this.previousContext&&(Ce.previousContext=this.previousContext.clone()),Ce.revertToPreviousContext=this.revertToPreviousContext,"@base"in this&&(Ce["@base"]=this["@base"]),"@language"in this&&(Ce["@language"]=this["@language"]),"@vocab"in this&&(Ce["@vocab"]=this["@vocab"]),Ce},revertToPreviousContext:function(){return this.previousContext?this.previousContext.clone():this},protected:{}};return 1e4===S.size&&S.clear(),S.set(I,E),E;function Z(Ce,me,ne){const _e=Ce[me],Ie=Ce[me]={};let Ge,st;for(const Xe of _e)Ge=Xe.iri,st=ne>=Ge.length?"":Ge[ne],st in Ie?Ie[st].push(Xe):Ie[st]=[Xe];for(const Xe in Ie)""!==Xe&&Z(Ie,Xe,ne+1)}function oe(Ce,me,ne){me.hasOwnProperty(ne)||(me[ne]=Ce)}},R.getContextValue=(D,I,X)=>{if(null===I)return"@context"===X?void 0:null;if(D.mappings.has(I)){const E=D.mappings.get(I);if(v(X))return E;if(E.hasOwnProperty(X))return E[X]}return"@language"===X&&X in D||"@direction"===X&&X in D?D[X]:"@context"!==X?null:void 0},R.processingMode=(D,I)=>I.toString()>="1.1"?!D.processingMode||D.processingMode>="json-ld-"+I.toString():"json-ld-1.0"===D.processingMode,R.isKeyword=D=>{if(!z(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(Y,Se,he){"use strict";const{parseLinkHeader:W,buildHeaders:j}=Y("../util"),{LINK_HEADER_CONTEXT:P}=Y("../constants"),Q=Y("../JsonLdError"),z=Y("../RequestQueue"),{prependBase:v}=Y("../url"),x=/(^|(\r\n))link:/i;function O(A,b,y){const S=new(A=A||XMLHttpRequest);return new Promise((T,V)=>{S.onload=()=>T(S),S.onerror=R=>V(R),S.open("GET",b,!0);for(const R in y)S.setRequestHeader(R,y[R]);S.send()})}Se.exports=({secure:A,headers:b={},xhr:y}={headers:{}})=>{return b=j(b),(new z).wrapLoader(T);function T(R){return V.apply(this,arguments)}function V(){return(V=yt(function*(R){if(0!==R.indexOf("http:")&&0!==R.indexOf("https:"))throw new Q('URL could not be dereferenced; only "http" and "https" URLs are supported.',"jsonld.InvalidUrl",{code:"loading document failed",url:R});if(A&&0!==R.indexOf("https"))throw new Q('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 K;try{K=yield O(y,R,b)}catch(E){throw new Q("URL could not be dereferenced, an error occurred.","jsonld.LoadDocumentError",{code:"loading document failed",url:R,cause:E})}if(K.status>=400)throw new Q("URL could not be dereferenced: "+K.statusText,"jsonld.LoadDocumentError",{code:"loading document failed",url:R,httpStatusCode:K.status});let ce={contextUrl:null,documentUrl:R,document:K.response},D=null;const I=K.getResponseHeader("Content-Type");let X;if(x.test(K.getAllResponseHeaders())&&(X=K.getResponseHeader("Link")),X&&"application/ld+json"!==I){const E=W(X),$=E[P];if(Array.isArray($))throw new Q("URL could not be dereferenced, it has more than one associated HTTP Link Header.","jsonld.InvalidUrl",{code:"multiple context link headers",url:R});$&&(ce.contextUrl=$.target),D=E.alternate,D&&"application/ld+json"==D.type&&!(I||"").match(/^application\/(\w*\+)?json$/)&&(ce=yield T(v(R,D.target)))}return ce})).apply(this,arguments)}}},{"../JsonLdError":12,"../RequestQueue":15,"../constants":18,"../url":31,"../util":32}],21:[function(Y,Se,he){"use strict";const W=Y("./JsonLdError"),{isArray:j,isObject:P,isEmptyObject:Q,isString:z,isUndefined:v}=Y("./types"),{isList:x,isValue:O,isGraph:A,isSubject:b}=Y("./graphTypes"),{expandIri:y,getContextValue:S,isKeyword:T,process:V,processingMode:R}=Y("./context"),{isAbsolute:K}=Y("./url"),{addValue:ce,asArray:D,getValues:I,validateTypeValue:X}=Y("./util"),E={};Se.exports=E;const $=/^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$/;function Z(ne){return oe.apply(this,arguments)}function oe(){return(oe=yt(function*({activeCtx:ne,activeProperty:_e,expandedActiveProperty:Ie,element:Ge,expandedParent:st,options:Xe={},insideList:tt,typeKey:Ye,typeScopedContext:Ue,expansionMap:ke}){const Ke=Object.keys(Ge).sort(),Me=[];let Ve;const $e=Ge[Ye]&&"@json"===y(ne,j(Ge[Ye])?Ge[Ye][0]:Ge[Ye],{vocab:!0},Xe);for(const Ne of Ke){let G,q=Ge[Ne];if("@context"===Ne)continue;let pe=y(ne,Ne,{vocab:!0},Xe);if((null===pe||!K(pe)&&!T(pe))&&(pe=ke({unmappedProperty:Ne,activeCtx:ne,activeProperty:_e,parent:Ge,options:Xe,insideList:tt,value:q,expandedParent:st}),void 0===pe))continue;if(T(pe)){if("@reverse"===Ie)throw new W("Invalid JSON-LD syntax; a keyword cannot be used as a @reverse property.","jsonld.SyntaxError",{code:"invalid reverse property map",value:q});if(pe in st&&"@included"!==pe&&"@type"!==pe)throw new W("Invalid JSON-LD syntax; colliding keywords detected.","jsonld.SyntaxError",{code:"colliding keywords",keyword:pe})}if("@id"===pe){if(!z(q)){if(!Xe.isFrame)throw new W('Invalid JSON-LD syntax; "@id" value must a string.',"jsonld.SyntaxError",{code:"invalid @id value",value:q});if(P(q)){if(!Q(q))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:q})}else{if(!j(q))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:q});if(!q.every(pt=>z(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:q})}}ce(st,"@id",D(q).map(pt=>z(pt)?y(ne,pt,{base:!0},Xe):pt),{propertyIsArray:Xe.isFrame});continue}if("@type"===pe){P(q)&&(q=Object.fromEntries(Object.entries(q).map(([pt,ve])=>[y(Ue,pt,{vocab:!0}),D(ve).map(L=>y(Ue,L,{base:!0,vocab:!0}))]))),X(q,Xe.isFrame),ce(st,"@type",D(q).map(pt=>z(pt)?y(Ue,pt,{base:!0,vocab:!0},Xe):pt),{propertyIsArray:Xe.isFrame});continue}if("@included"===pe&&R(ne,1.1)){const pt=D(yield E.expand({activeCtx:ne,activeProperty:_e,element:q,options:Xe,expansionMap:ke}));if(!pt.every(ve=>b(ve)))throw new W("Invalid JSON-LD syntax; values of @included must expand to node objects.","jsonld.SyntaxError",{code:"invalid @included value",value:q});ce(st,"@included",pt,{propertyIsArray:!0});continue}if("@graph"===pe&&!P(q)&&!j(q))throw new W('Invalid JSON-LD syntax; "@graph" value must not be an object or an array.',"jsonld.SyntaxError",{code:"invalid @graph value",value:q});if("@value"===pe){Ve=q,$e&&R(ne,1.1)?st["@value"]=q:ce(st,"@value",q,{propertyIsArray:Xe.isFrame});continue}if("@language"===pe){if(null===q)continue;if(!z(q)&&!Xe.isFrame)throw new W('Invalid JSON-LD syntax; "@language" value must be a string.',"jsonld.SyntaxError",{code:"invalid language-tagged string",value:q});q=D(q).map(pt=>z(pt)?pt.toLowerCase():pt);for(const pt of q)z(pt)&&!pt.match($)&&console.warn(`@language must be valid BCP47: ${pt}`);ce(st,"@language",q,{propertyIsArray:Xe.isFrame});continue}if("@direction"===pe){if(!z(q)&&!Xe.isFrame)throw new W('Invalid JSON-LD syntax; "@direction" value must be a string.',"jsonld.SyntaxError",{code:"invalid base direction",value:q});q=D(q);for(const pt of q)if(z(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:q});ce(st,"@direction",q,{propertyIsArray:Xe.isFrame});continue}if("@index"===pe){if(!z(q))throw new W('Invalid JSON-LD syntax; "@index" value must be a string.',"jsonld.SyntaxError",{code:"invalid @index value",value:q});ce(st,"@index",q);continue}if("@reverse"===pe){if(!P(q))throw new W('Invalid JSON-LD syntax; "@reverse" value must be an object.',"jsonld.SyntaxError",{code:"invalid @reverse value",value:q});if(G=yield E.expand({activeCtx:ne,activeProperty:"@reverse",element:q,options:Xe,expansionMap:ke}),"@reverse"in G)for(const ve in G["@reverse"])ce(st,ve,G["@reverse"][ve],{propertyIsArray:!0});let pt=st["@reverse"]||null;for(const ve in G){if("@reverse"===ve)continue;null===pt&&(pt=st["@reverse"]={}),ce(pt,ve,[],{propertyIsArray:!0});const L=G[ve];for(let N=0;N"@id"===pt||"@index"===pt)&&(G=D(G).map(pt=>({"@graph":D(pt)}))),ue.mappings.has(Ne)&&ue.mappings.get(Ne).reverse){const pt=st["@reverse"]=st["@reverse"]||{};G=D(G);for(let ve=0;ve"@value"===y(ne,pe,{vocab:!0},Xe)))throw new W("Invalid JSON-LD syntax; nested value must be a node object.","jsonld.SyntaxError",{code:"invalid @nest value",value:G});yield Z({activeCtx:ne,activeProperty:_e,expandedActiveProperty:Ie,element:G,expandedParent:st,options:Xe,insideList:tt,typeScopedContext:Ue,typeKey:Ye,expansionMap:ke})}}})).apply(this,arguments)}function se({activeCtx:ne,activeProperty:_e,value:Ie,options:Ge}){if(null==Ie)return null;const st=y(ne,_e,{vocab:!0},Ge);if("@id"===st)return y(ne,Ie,{base:!0},Ge);if("@type"===st)return y(ne,Ie,{vocab:!0,base:!0},Ge);const Xe=S(ne,_e,"@type");if(("@id"===Xe||"@graph"===st)&&z(Ie))return{"@id":y(ne,Ie,{base:!0},Ge)};if("@vocab"===Xe&&z(Ie))return{"@id":y(ne,Ie,{vocab:!0,base:!0},Ge)};if(T(st))return Ie;const tt={};if(Xe&&!["@id","@vocab","@none"].includes(Xe))tt["@type"]=Xe;else if(z(Ie)){const Ye=S(ne,_e,"@language");null!==Ye&&(tt["@language"]=Ye);const Ue=S(ne,_e,"@direction");null!==Ue&&(tt["@direction"]=Ue)}return["boolean","number","string"].includes(typeof Ie)||(Ie=Ie.toString()),tt["@value"]=Ie,tt}function te(ne,_e,Ie,Ge){const st=[],Xe=Object.keys(_e).sort();for(const tt of Xe){const Ye=y(ne,tt,{vocab:!0},Ge);let Ue=_e[tt];j(Ue)||(Ue=[Ue]);for(const ke of Ue){if(null===ke)continue;if(!z(ke))throw new W("Invalid JSON-LD syntax; language map values must be strings.","jsonld.SyntaxError",{code:"invalid language map value",languageMap:_e});const Ke={"@value":ke};"@none"!==Ye&&(Ke["@language"]=tt.toLowerCase()),Ie&&(Ke["@direction"]=Ie),st.push(Ke)}}return st}function Ce(ne){return me.apply(this,arguments)}function me(){return(me=yt(function*({activeCtx:ne,options:_e,activeProperty:Ie,value:Ge,expansionMap:st,asGraph:Xe,indexKey:tt,propertyIndex:Ye}){const Ue=[],ke=Object.keys(Ge).sort(),Ke="@type"===tt;for(let Me of ke){if(Ke){const Ne=S(ne,Me,"@context");v(Ne)||(ne=yield V({activeCtx:ne,localCtx:Ne,propagate:!1,options:_e}))}let $e,Ve=Ge[Me];j(Ve)||(Ve=[Ve]),Ve=yield E.expand({activeCtx:ne,activeProperty:Ie,element:Ve,options:_e,insideList:!1,insideIndex:!0,expansionMap:st}),$e=Ye?"@none"===Me?"@none":se({activeCtx:ne,activeProperty:tt,value:Me,options:_e}):y(ne,Me,{vocab:!0},_e),"@id"===tt?Me=y(ne,Me,{base:!0},_e):Ke&&(Me=$e);for(let Ne of Ve){if(Xe&&!A(Ne)&&(Ne={"@graph":[Ne]}),"@type"===tt)"@none"===$e||(Ne["@type"]=Ne["@type"]?[Me].concat(Ne["@type"]):[Me]);else{if(O(Ne)&&!["@language","@type","@index"].includes(tt))throw new W(`Invalid JSON-LD syntax; Attempt to add illegal key to value object: "${tt}".`,"jsonld.SyntaxError",{code:"invalid value object",value:Ne});Ye?"@none"!==$e&&ce(Ne,Ye,$e,{propertyIsArray:!0,prependValue:!0}):"@none"!==$e&&!(tt in Ne)&&(Ne[tt]=Me)}Ue.push(Ne)}}return Ue})).apply(this,arguments)}E.expand=function(){var ne=yt(function*({activeCtx:_e,activeProperty:Ie=null,element:Ge,options:st={},insideList:Xe=!1,insideIndex:tt=!1,typeScopedContext:Ye=null,expansionMap:Ue=(()=>{})}){if(null==Ge)return null;if("@default"===Ie&&(st=Object.assign({},st,{isFrame:!1})),!j(Ge)&&!P(Ge)){if(!Xe&&(null===Ie||"@graph"===y(_e,Ie,{vocab:!0},st))){const G=yield Ue({unmappedValue:Ge,activeCtx:_e,activeProperty:Ie,options:st,insideList:Xe});return void 0===G?null:G}return se({activeCtx:_e,activeProperty:Ie,value:Ge,options:st})}if(j(Ge)){let G=[];const pe=S(_e,Ie,"@container")||[];Xe=Xe||pe.includes("@list");for(let ue=0;ue1?ue.slice().sort():ue:[ue];for(const _t of je){const pt=S(Ye,_t,"@context");v(pt)||(_e=yield V({activeCtx:_e,localCtx:pt,options:st,propagate:!1}))}}let Ne={};yield Z({activeCtx:_e,activeProperty:Ie,expandedActiveProperty:ke,element:Ge,expandedParent:Ne,options:st,insideList:Xe,typeKey:$e,typeScopedContext:Ye,expansionMap:Ue}),Me=Object.keys(Ne);let q=Me.length;if("@value"in Ne){if("@type"in Ne&&("@language"in Ne||"@direction"in Ne))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:Ne});let G=q-1;if("@type"in Ne&&(G-=1),"@index"in Ne&&(G-=1),"@language"in Ne&&(G-=1),"@direction"in Ne&&(G-=1),0!==G)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:Ne});const pe=null===Ne["@value"]?[]:D(Ne["@value"]),ue=I(Ne,"@type");if(!R(_e,1.1)||!ue.includes("@json")||1!==ue.length)if(0===pe.length){const je=yield Ue({unmappedValue:Ne,activeCtx:_e,activeProperty:Ie,element:Ge,options:st,insideList:Xe});Ne=void 0!==je?je:null}else{if(!pe.every(je=>z(je)||Q(je))&&"@language"in Ne)throw new W("Invalid JSON-LD syntax; only strings may be language-tagged.","jsonld.SyntaxError",{code:"invalid language-tagged value",element:Ne});if(!ue.every(je=>K(je)&&!(z(je)&&0===je.indexOf("_:"))||Q(je)))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:Ne})}}else if("@type"in Ne&&!j(Ne["@type"]))Ne["@type"]=[Ne["@type"]];else if("@set"in Ne||"@list"in Ne){if(q>1&&(2!==q||!("@index"in Ne)))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:Ne});"@set"in Ne&&(Ne=Ne["@set"],Me=Object.keys(Ne),q=Me.length)}else if(1===q&&"@language"in Ne){const G=yield Ue(Ne,{unmappedValue:Ne,activeCtx:_e,activeProperty:Ie,element:Ge,options:st,insideList:Xe});Ne=void 0!==G?G:null}if(P(Ne)&&!st.keepFreeFloatingNodes&&!Xe&&(null===Ie||"@graph"===ke)&&(0===q||"@value"in Ne||"@list"in Ne||1===q&&"@id"in Ne)){const G=yield Ue({unmappedValue:Ne,activeCtx:_e,activeProperty:Ie,element:Ge,options:st,insideList:Xe});Ne=void 0!==G?G:null}return Ne});return function(_e){return ne.apply(this,arguments)}}()},{"./JsonLdError":12,"./context":19,"./graphTypes":25,"./types":30,"./url":31,"./util":32}],22:[function(Y,Se,he){"use strict";const{isSubjectReference:W}=Y("./graphTypes"),{createMergedNodeMap:j}=Y("./nodeMap"),P={};Se.exports=P,P.flatten=Q=>{const z=j(Q),v=[],x=Object.keys(z).sort();for(let O=0;O=0;--oe){const se=Z[oe];if(se.graph===$&&se.subject["@id"]===E["@id"])return!0}return!1}function S(E,$,Z){const oe="@"+Z;let se=oe in E?E[oe][0]:$[Z];if("embed"===Z)if(!0===se)se="@once";else if(!1===se)se="@never";else if("@always"!==se&&"@never"!==se&&"@link"!==se&&"@first"!==se&&"@last"!==se&&"@once"!==se)throw new v("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:E});return se}function T(E){if(!P.isArray(E)||1!==E.length||!P.isObject(E[0]))throw new v("Invalid JSON-LD syntax; a JSON-LD frame must be a single object.","jsonld.SyntaxError",{frame:E});if("@id"in E[0])for(const $ of Q.asArray(E[0]["@id"]))if(!P.isObject($)&&!z.isAbsolute($)||P.isString($)&&0===$.indexOf("_:"))throw new v("Invalid JSON-LD syntax; invalid @id in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:E});if("@type"in E[0])for(const $ of Q.asArray(E[0]["@type"]))if(!P.isObject($)&&!z.isAbsolute($)||P.isString($)&&0===$.indexOf("_:"))throw new v("Invalid JSON-LD syntax; invalid @type in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:E})}function R(E,$,Z,oe){let se=!0,te=!1;for(const Ce in Z){let me=!1;const ne=Q.getValues($,Ce),_e=0===Q.getValues(Z,Ce).length;if("@id"===Ce){if(P.isEmptyObject(Z["@id"][0]||{})?me=!0:Z["@id"].length>=0&&(me=Z["@id"].includes(ne[0])),!oe.requireAll)return me}else if("@type"===Ce){if(se=!1,_e){if(ne.length>0)return!1;me=!0}else if(1===Z["@type"].length&&P.isEmptyObject(Z["@type"][0]))me=ne.length>0;else for(const Ie of Z["@type"])me=!(!P.isObject(Ie)||!("@default"in Ie))||me||ne.some(Ge=>Ge===Ie);if(!oe.requireAll)return me}else{if(W(Ce))continue;{const Ie=Q.getValues(Z,Ce)[0];let Ge=!1;if(Ie&&(T([Ie]),Ge="@default"in Ie),se=!1,0===ne.length&&Ge)continue;if(ne.length>0&&_e)return!1;if(void 0===Ie){if(ne.length>0)return!1;me=!0}else if(j.isList(Ie)){const st=Ie["@list"][0];if(j.isList(ne[0])){const Xe=ne[0]["@list"];j.isValue(st)?me=Xe.some(tt=>X(st,tt)):(j.isSubject(st)||j.isSubjectReference(st))&&(me=Xe.some(tt=>I(E,st,tt,oe)))}}else me=j.isValue(Ie)?ne.some(st=>X(Ie,st)):j.isSubjectReference(Ie)?ne.some(st=>I(E,Ie,st,oe)):!!P.isObject(Ie)&&ne.length>0}}if(!me&&oe.requireAll)return!1;te=te||me}return se||te}function K(E,$){const Z=E.uniqueEmbeds[E.graph],oe=Z[$],se=oe.parent,te=oe.property,Ce={"@id":$};if(P.isArray(se)){for(let ne=0;ne{const _e=Object.keys(Z);for(const Ie of _e)Ie in Z&&P.isObject(Z[Ie].parent)&&Z[Ie].parent["@id"]===ne&&(delete Z[Ie],me(Ie))};me($)}function ce(E,$){if(P.isArray(E))return E.map(Z=>ce(Z,$));if(P.isObject(E)){if("@preserve"in E)return E["@preserve"][0];if(j.isValue(E))return E;if(j.isList(E))return E["@list"]=ce(E["@list"],$),E;if("@id"in E){const Z=E["@id"];if($.link.hasOwnProperty(Z)){const oe=$.link[Z].indexOf(E);if(-1!==oe)return $.link[Z][oe];$.link[Z].push(E)}else $.link[Z]=[E]}for(const Z in E)"@id"===Z&&$.bnodesToClear.includes(E[Z])?delete E["@id"]:E[Z]=ce(E[Z],$)}return E}function D(E,$,Z){P.isObject(E)?Q.addValue(E,$,Z,{propertyIsArray:!0}):E.push(Z)}function I(E,$,Z,oe){if(!("@id"in Z))return!1;const se=E.subjects[Z["@id"]];return se&&R(E,se,$,oe)}function X(E,$){const Z=$["@value"],oe=$["@type"],se=$["@language"],te=E["@value"]?P.isArray(E["@value"])?E["@value"]:[E["@value"]]:[],Ce=E["@type"]?P.isArray(E["@type"])?E["@type"]:[E["@type"]]:[],me=E["@language"]?P.isArray(E["@language"])?E["@language"]:[E["@language"]]:[];return 0===te.length&&0===Ce.length&&0===me.length||!(!te.includes(Z)&&!P.isEmptyObject(te[0])||!(!oe&&0===Ce.length||Ce.includes(oe)||oe&&P.isEmptyObject(Ce[0]))||!(!se&&0===me.length||me.includes(se)||se&&P.isEmptyObject(me[0])))}Se.exports=A,A.frameMergedOrDefault=(E,$,Z)=>{const oe={options:Z,embedded:!1,graph:"@default",graphMap:{"@default":{}},subjectStack:[],link:{},bnodeMap:{}},se=new Q.IdentifierIssuer("_:b");x(E,oe.graphMap,"@default",se),Z.merged&&(oe.graphMap["@merged"]=O(oe.graphMap),oe.graph="@merged"),oe.subjects=oe.graphMap[oe.graph];const te=[];return A.frame(oe,Object.keys(oe.subjects).sort(),$,te),Z.pruneBlankNodeIdentifiers&&(Z.bnodesToClear=Object.keys(oe.bnodeMap).filter(Ce=>1===oe.bnodeMap[Ce].length)),Z.link={},ce(te,Z)},A.frame=(E,$,Z,oe,se=null)=>{T(Z);const te=E.options,Ce={embed:S(Z=Z[0],te,"embed"),explicit:S(Z,te,"explicit"),requireAll:S(Z,te,"requireAll")};E.link.hasOwnProperty(E.graph)||(E.link[E.graph]={});const me=E.link[E.graph],ne=function(E,$,Z,oe){const se={};for(const te of $){const Ce=E.graphMap[E.graph][te];R(E,Ce,Z,oe)&&(se[te]=Ce)}return se}(E,$,Z,Ce),_e=Object.keys(ne).sort();for(const Ie of _e){const Ge=ne[Ie];if(null===se?E.uniqueEmbeds={[E.graph]:{}}:E.uniqueEmbeds[E.graph]=E.uniqueEmbeds[E.graph]||{},"@link"===Ce.embed&&Ie in me){D(oe,se,me[Ie]);continue}const st={"@id":Ie};if(0===Ie.indexOf("_:")&&Q.addValue(E.bnodeMap,Ie,st,{propertyIsArray:!0}),me[Ie]=st,("@first"===Ce.embed||"@last"===Ce.embed)&&E.is11)throw new v("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:Z});if(E.embedded||!E.uniqueEmbeds[E.graph].hasOwnProperty(Ie)){if(E.embedded&&("@never"===Ce.embed||y(Ge,E.graph,E.subjectStack))){D(oe,se,st);continue}if(E.embedded&&("@first"==Ce.embed||"@once"==Ce.embed)&&E.uniqueEmbeds[E.graph].hasOwnProperty(Ie)){D(oe,se,st);continue}if("@last"===Ce.embed&&Ie in E.uniqueEmbeds[E.graph]&&K(E,Ie),E.uniqueEmbeds[E.graph][Ie]={parent:oe,property:se},E.subjectStack.push({subject:Ge,graph:E.graph}),Ie in E.graphMap){let Xe=!1,tt=null;"@graph"in Z?(tt=Z["@graph"][0],Xe=!("@merged"===Ie||"@default"===Ie),P.isObject(tt)||(tt={})):(Xe="@merged"!==E.graph,tt={}),Xe&&A.frame(Cn(ot({},E),{graph:Ie,embedded:!1}),Object.keys(E.graphMap[Ie]).sort(),[tt],st,"@graph")}"@included"in Z&&A.frame(Cn(ot({},E),{embedded:!1}),$,Z["@included"],st,"@included");for(const Xe of Object.keys(Ge).sort())if(W(Xe)){if(st[Xe]=Q.clone(Ge[Xe]),"@type"===Xe)for(const tt of Ge["@type"])0===tt.indexOf("_:")&&Q.addValue(E.bnodeMap,tt,st,{propertyIsArray:!0})}else if(!Ce.explicit||Xe in Z)for(const tt of Ge[Xe]){const Ye=Xe in Z?Z[Xe]:b(Ce);if(j.isList(tt)){const Ue=Z[Xe]&&Z[Xe][0]&&Z[Xe][0]["@list"]?Z[Xe][0]["@list"]:b(Ce),ke={"@list":[]};D(st,Xe,ke);const Ke=tt["@list"];for(const Me of Ke)j.isSubjectReference(Me)?A.frame(Cn(ot({},E),{embedded:!0}),[Me["@id"]],Ue,ke,"@list"):D(ke,"@list",Q.clone(Me))}else j.isSubjectReference(tt)?A.frame(Cn(ot({},E),{embedded:!0}),[tt["@id"]],Ye,st,Xe):X(Ye[0],tt)&&D(st,Xe,Q.clone(tt))}for(const Xe of Object.keys(Z).sort()){if("@type"===Xe){if(!P.isObject(Z[Xe][0])||!("@default"in Z[Xe][0]))continue}else if(W(Xe))continue;const tt=Z[Xe][0]||{};if(!S(tt,te,"omitDefault")&&!(Xe in st)){let Ue="@null";"@default"in tt&&(Ue=Q.clone(tt["@default"])),P.isArray(Ue)||(Ue=[Ue]),st[Xe]=[{"@preserve":Ue}]}}for(const Xe of Object.keys(Z["@reverse"]||{}).sort()){const tt=Z["@reverse"][Xe];for(const Ye of Object.keys(E.subjects))Q.getValues(E.subjects[Ye],Xe).some(ke=>ke["@id"]===Ie)&&(st["@reverse"]=st["@reverse"]||{},Q.addValue(st["@reverse"],Xe,[],{propertyIsArray:!0}),A.frame(Cn(ot({},E),{embedded:!0}),[Ye],tt,st["@reverse"][Xe],se))}D(oe,se,st),E.subjectStack.pop()}}},A.cleanupNull=(E,$)=>{if(P.isArray(E))return E.map(oe=>A.cleanupNull(oe,$)).filter(oe=>oe);if("@null"===E)return null;if(P.isObject(E)){if("@id"in E){const Z=E["@id"];if($.link.hasOwnProperty(Z)){const oe=$.link[Z].indexOf(E);if(-1!==oe)return $.link[Z][oe];$.link[Z].push(E)}else $.link[Z]=[E]}for(const Z in E)E[Z]=A.cleanupNull(E[Z],$)}return E}},{"./JsonLdError":12,"./context":19,"./graphTypes":25,"./nodeMap":27,"./types":30,"./url":31,"./util":32}],24:[function(Y,Se,he){"use strict";const W=Y("./JsonLdError"),j=Y("./graphTypes"),P=Y("./types"),Q=Y("./util"),{RDF_LIST:z,RDF_FIRST:v,RDF_REST:x,RDF_NIL:O,RDF_TYPE:A,RDF_JSON_LITERAL:b,XSD_BOOLEAN:y,XSD_DOUBLE:S,XSD_INTEGER:T,XSD_STRING:V}=Y("./constants"),R=/^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$/,K={};function ce(D,I,X){if(D.termType.endsWith("Node"))return{"@id":D.value};const E={"@value":D.value};if(D.language)E["@language"]=D.language;else{let $=D.datatype.value;if($||($=V),$===b){$="@json";try{E["@value"]=JSON.parse(E["@value"])}catch(Z){throw new W("JSON literal could not be parsed.","jsonld.InvalidJsonLiteral",{code:"invalid JSON literal",value:E["@value"],cause:Z})}}if(I){if($===y)"true"===E["@value"]?E["@value"]=!0:"false"===E["@value"]&&(E["@value"]=!1);else if(P.isNumeric(E["@value"]))if($===T){const Z=parseInt(E["@value"],10);Z.toFixed(0)===E["@value"]&&(E["@value"]=Z)}else $===S&&(E["@value"]=parseFloat(E["@value"]));[y,T,S,V].includes($)||(E["@type"]=$)}else if("i18n-datatype"===X&&$.startsWith("https://www.w3.org/ns/i18n#")){const[,Z,oe]=$.split(/[#_]/);Z.length>0&&(E["@language"]=Z,Z.match(R)||console.warn(`@language must be valid BCP47: ${Z}`)),E["@direction"]=oe}else $!==V&&(E["@type"]=$)}return E}Se.exports=K,K.fromRDF=function(){var D=yt(function*(I,{useRdfType:X=!1,useNativeTypes:E=!1,rdfDirection:$=null}){const Z={},oe={"@default":Z},se={};for(const me of I){const ne="DefaultGraph"===me.graph.termType?"@default":me.graph.value;ne in oe||(oe[ne]={}),"@default"!==ne&&!(ne in Z)&&(Z[ne]={"@id":ne});const _e=oe[ne],Ie=me.subject.value,Ge=me.predicate.value,st=me.object;Ie in _e||(_e[Ie]={"@id":Ie});const Xe=_e[Ie],tt=st.termType.endsWith("Node");if(tt&&!(st.value in _e)&&(_e[st.value]={"@id":st.value}),Ge===A&&!X&&tt){Q.addValue(Xe,"@type",st.value,{propertyIsArray:!0});continue}const Ye=ce(st,E,$);if(Q.addValue(Xe,Ge,Ye,{propertyIsArray:!0}),tt)if(st.value===O){const Ue=_e[st.value];"usages"in Ue||(Ue.usages=[]),Ue.usages.push({node:Xe,property:Ge,value:Ye})}else se[st.value]=!(st.value in se)&&{node:Xe,property:Ge,value:Ye}}for(const me in oe){const ne=oe[me];if(!(O in ne))continue;const _e=ne[O];if(_e.usages){for(let Ie of _e.usages){let Ge=Ie.node,st=Ie.property,Xe=Ie.value;const tt=[],Ye=[];let Ue=Object.keys(Ge).length;for(;st===x&&P.isObject(se[Ge["@id"]])&&P.isArray(Ge[v])&&1===Ge[v].length&&P.isArray(Ge[x])&&1===Ge[x].length&&(3===Ue||4===Ue&&P.isArray(Ge["@type"])&&1===Ge["@type"].length&&Ge["@type"][0]===z)&&(tt.push(Ge[v][0]),Ye.push(Ge["@id"]),Ie=se[Ge["@id"]],Ge=Ie.node,st=Ie.property,Xe=Ie.value,Ue=Object.keys(Ge).length,j.isBlankNode(Ge)););delete Xe["@id"],Xe["@list"]=tt.reverse();for(const ke of Ye)delete ne[ke]}delete _e.usages}}const te=[],Ce=Object.keys(Z).sort();for(const me of Ce){const ne=Z[me];if(me in oe){const _e=ne["@graph"]=[],Ie=oe[me],Ge=Object.keys(Ie).sort();for(const st of Ge){const Xe=Ie[st];j.isSubjectReference(Xe)||_e.push(Xe)}}j.isSubjectReference(ne)||te.push(ne)}return te});return function(I,X){return D.apply(this,arguments)}}()},{"./JsonLdError":12,"./constants":18,"./graphTypes":25,"./types":30,"./util":32}],25:[function(Y,Se,he){"use strict";const W=Y("./types"),j={};Se.exports=j,j.isSubject=P=>!(!W.isObject(P)||"@value"in P||"@set"in P||"@list"in P)&&(Object.keys(P).length>1||!("@id"in P)),j.isSubjectReference=P=>W.isObject(P)&&1===Object.keys(P).length&&"@id"in P,j.isValue=P=>W.isObject(P)&&"@value"in P,j.isList=P=>W.isObject(P)&&"@list"in P,j.isGraph=P=>W.isObject(P)&&"@graph"in P&&1===Object.keys(P).filter(Q=>"@id"!==Q&&"@index"!==Q).length,j.isSimpleGraph=P=>j.isGraph(P)&&!("@id"in P),j.isBlankNode=P=>!!W.isObject(P)&&("@id"in P?0===P["@id"].indexOf("_:"):0===Object.keys(P).length||!("@value"in P||"@set"in P||"@list"in P))},{"./types":30}],26:[function(Y,Se,he){const W=Y("rdf-canonize"),j=Y("./platform"),P=Y("./util"),Q=Y("./ContextResolver"),z=P.IdentifierIssuer,v=Y("./JsonLdError"),x=Y("lru-cache"),O=Y("./NQuads"),{expand:A}=Y("./expand"),{flatten:b}=Y("./flatten"),{fromRDF:y}=Y("./fromRdf"),{toRDF:S}=Y("./toRdf"),{frameMergedOrDefault:T,cleanupNull:V}=Y("./frame"),{isArray:R,isObject:K,isString:ce}=Y("./types"),{isSubjectReference:D}=Y("./graphTypes"),{expandIri:I,getInitialContext:X,process:E,processingMode:$}=Y("./context"),{compact:Z,compactIri:oe}=Y("./compact"),{createNodeMap:se,createMergedNodeMap:te,mergeNodeMaps:Ce}=Y("./nodeMap"),me=function(_e){const Ie={},st=new x({max:100});function Xe(tt,ke){var Ke=ke,{documentLoader:Ye=_e.documentLoader}=Ke,Ue=zq(Ke,["documentLoader"]);return Object.assign({},{documentLoader:Ye},Ue,tt)}return _e.compact=function(){var tt=yt(function*(Ye,Ue,ke){if(arguments.length<2)throw new TypeError("Could not compact, too few arguments.");if(null===Ue)throw new v("The compaction context must not be null.","jsonld.CompactError",{code:"invalid local context"});if(null===Ye)return null;let Ke;(ke=Xe(ke,{base:ce(Ye)?Ye:"",compactArrays:!0,compactToRelative:!0,graph:!1,skipExpansion:!1,link:!1,issuer:new z("_:b"),contextResolver:new Q({sharedCache:st})})).link&&(ke.skipExpansion=!0),ke.compactToRelative||delete ke.base,Ke=ke.skipExpansion?Ye:yield _e.expand(Ye,ke);const Me=yield _e.processContext(X(ke),Ue,ke);let Ve=yield Z({activeCtx:Me,element:Ke,options:ke,compactionMap:ke.compactionMap});ke.compactArrays&&!ke.graph&&R(Ve)?1===Ve.length?Ve=Ve[0]:0===Ve.length&&(Ve={}):ke.graph&&K(Ve)&&(Ve=[Ve]),K(Ue)&&"@context"in Ue&&(Ue=Ue["@context"]),Ue=P.clone(Ue),R(Ue)||(Ue=[Ue]);const $e=Ue;Ue=[];for(let q=0;q<$e.length;++q)(!K($e[q])||Object.keys($e[q]).length>0)&&Ue.push($e[q]);const Ne=Ue.length>0;if(1===Ue.length&&(Ue=Ue[0]),R(Ve)){const q=oe({activeCtx:Me,iri:"@graph",relativeTo:{vocab:!0}}),G=Ve;Ve={},Ne&&(Ve["@context"]=Ue),Ve[q]=G}else if(K(Ve)&&Ne){const q=Ve;Ve={"@context":Ue};for(const G in q)Ve[G]=q[G]}return Ve});return function(Ye,Ue,ke){return tt.apply(this,arguments)}}(),_e.expand=function(){var tt=yt(function*(Ye,Ue){if(arguments.length<1)throw new TypeError("Could not expand, too few arguments.");!1===(Ue=Xe(Ue,{keepFreeFloatingNodes:!1,contextResolver:new Q({sharedCache:st})})).expansionMap&&(Ue.expansionMap=void 0);const ke={},Ke=[];if("expandContext"in Ue){const Ne=P.clone(Ue.expandContext);ke.expandContext=K(Ne)&&"@context"in Ne?Ne:{"@context":Ne},Ke.push(ke.expandContext)}let Me;if(ce(Ye)){const Ne=yield _e.get(Ye,Ue);Me=Ne.documentUrl,ke.input=Ne.document,Ne.contextUrl&&(ke.remoteContext={"@context":Ne.contextUrl},Ke.push(ke.remoteContext))}else ke.input=P.clone(Ye);"base"in Ue||(Ue.base=Me||"");let Ve=X(Ue);for(const Ne of Ke)Ve=yield E({activeCtx:Ve,localCtx:Ne,options:Ue});let $e=yield A({activeCtx:Ve,element:ke.input,options:Ue,expansionMap:Ue.expansionMap});return K($e)&&"@graph"in $e&&1===Object.keys($e).length?$e=$e["@graph"]:null===$e&&($e=[]),R($e)||($e=[$e]),$e});return function(Ye,Ue){return tt.apply(this,arguments)}}(),_e.flatten=function(){var tt=yt(function*(Ye,Ue,ke){if(arguments.length<1)return new TypeError("Could not flatten, too few arguments.");Ue="function"==typeof Ue?null:Ue||null,ke=Xe(ke,{base:ce(Ye)?Ye:"",contextResolver:new Q({sharedCache:st})});const Ke=yield _e.expand(Ye,ke),Me=b(Ke);return null===Ue?Me:(ke.graph=!0,ke.skipExpansion=!0,yield _e.compact(Me,Ue,ke))});return function(Ye,Ue,ke){return tt.apply(this,arguments)}}(),_e.frame=function(){var tt=yt(function*(Ye,Ue,ke){if(arguments.length<2)throw new TypeError("Could not frame, too few arguments.");if(ke=Xe(ke,{base:ce(Ye)?Ye:"",embed:"@once",explicit:!1,requireAll:!1,omitDefault:!1,bnodesToClear:[],contextResolver:new Q({sharedCache:st})}),ce(Ue)){const ue=yield _e.get(Ue,ke);if(Ue=ue.document,ue.contextUrl){let je=Ue["@context"];je?R(je)?je.push(ue.contextUrl):je=[je,ue.contextUrl]:je=ue.contextUrl,Ue["@context"]=je}}const Ke=Ue&&Ue["@context"]||{},Me=yield _e.processContext(X(ke),Ke,ke);ke.hasOwnProperty("omitGraph")||(ke.omitGraph=$(Me,1.1)),ke.hasOwnProperty("pruneBlankNodeIdentifiers")||(ke.pruneBlankNodeIdentifiers=$(Me,1.1));const Ve=yield _e.expand(Ye,ke),$e=ot({},ke);$e.isFrame=!0,$e.keepFreeFloatingNodes=!0;const Ne=yield _e.expand(Ue,$e),q=Object.keys(Ue).map(ue=>I(Me,ue,{vocab:!0}));$e.merged=!q.includes("@graph"),$e.is11=$(Me,1.1);const G=T(Ve,Ne,$e);$e.graph=!ke.omitGraph,$e.skipExpansion=!0,$e.link={},$e.framing=!0;let pe=yield _e.compact(G,Ke,$e);return $e.link={},pe=V(pe,$e),pe});return function(Ye,Ue,ke){return tt.apply(this,arguments)}}(),_e.link=function(){var tt=yt(function*(Ye,Ue,ke){const Ke={};return Ue&&(Ke["@context"]=Ue),Ke["@embed"]="@link",_e.frame(Ye,Ke,ke)});return function(Ye,Ue,ke){return tt.apply(this,arguments)}}(),_e.normalize=_e.canonize=function(){var tt=yt(function*(Ye,Ue){if(arguments.length<1)throw new TypeError("Could not canonize, too few arguments.");if("inputFormat"in(Ue=Xe(Ue,{base:ce(Ye)?Ye:"",algorithm:"URDNA2015",skipExpansion:!1,contextResolver:new Q({sharedCache:st})}))){if("application/n-quads"!==Ue.inputFormat&&"application/nquads"!==Ue.inputFormat)throw new v("Unknown canonicalization input format.","jsonld.CanonizeError");const Me=O.parse(Ye);return W.canonize(Me,Ue)}const ke=ot({},Ue);delete ke.format,ke.produceGeneralizedRdf=!1;const Ke=yield _e.toRDF(Ye,ke);return W.canonize(Ke,Ue)});return function(Ye,Ue){return tt.apply(this,arguments)}}(),_e.fromRDF=function(){var tt=yt(function*(Ye,Ue){if(arguments.length<1)throw new TypeError("Could not convert from RDF, too few arguments.");Ue=Xe(Ue,{format:ce(Ye)?"application/n-quads":void 0});const{format:ke}=Ue;let{rdfParser:Ke}=Ue;if(ke){if(Ke=Ke||Ie[ke],!Ke)throw new v("Unknown input format.","jsonld.UnknownFormat",{format:ke})}else Ke=()=>Ye;const Me=yield Ke(Ye);return y(Me,Ue)});return function(Ye,Ue){return tt.apply(this,arguments)}}(),_e.toRDF=function(){var tt=yt(function*(Ye,Ue){if(arguments.length<1)throw new TypeError("Could not convert to RDF, too few arguments.");let ke;ke=(Ue=Xe(Ue,{base:ce(Ye)?Ye:"",skipExpansion:!1,contextResolver:new Q({sharedCache:st})})).skipExpansion?Ye:yield _e.expand(Ye,Ue);const Ke=S(ke,Ue);if(Ue.format){if("application/n-quads"===Ue.format||"application/nquads"===Ue.format)return O.serialize(Ke);throw new v("Unknown output format.","jsonld.UnknownFormat",{format:Ue.format})}return Ke});return function(Ye,Ue){return tt.apply(this,arguments)}}(),_e.createNodeMap=function(){var tt=yt(function*(Ye,Ue){if(arguments.length<1)throw new TypeError("Could not create node map, too few arguments.");Ue=Xe(Ue,{base:ce(Ye)?Ye:"",contextResolver:new Q({sharedCache:st})});const ke=yield _e.expand(Ye,Ue);return te(ke,Ue)});return function(Ye,Ue){return tt.apply(this,arguments)}}(),_e.merge=function(){var tt=yt(function*(Ye,Ue,ke){if(arguments.length<1)throw new TypeError("Could not merge, too few arguments.");if(!R(Ye))throw new TypeError('Could not merge, "docs" must be an array.');Ue="function"==typeof Ue?null:Ue||null,ke=Xe(ke,{contextResolver:new Q({sharedCache:st})});const Ke=yield Promise.all(Ye.map(ue=>{const je=ot({},ke);return _e.expand(ue,je)}));let Me=!0;"mergeNodes"in ke&&(Me=ke.mergeNodes);const Ve=ke.issuer||new z("_:b"),$e={"@default":{}};for(let ue=0;ue_e._documentLoader,set:tt=>_e._documentLoader=tt}),_e.documentLoader=function(){var tt=yt(function*(Ye){throw new v("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 tt.apply(this,arguments)}}(),_e.get=function(){var tt=yt(function*(Ye,Ue){let ke;ke="function"==typeof Ue.documentLoader?Ue.documentLoader:_e.documentLoader;const Ke=yield ke(Ye);try{if(!Ke.document)throw new v("No remote document found at the given URL.","jsonld.NullRemoteDocument");ce(Ke.document)&&(Ke.document=JSON.parse(Ke.document))}catch(Me){throw new v("Could not retrieve a JSON-LD document from the URL.","jsonld.LoadDocumentError",{code:"loading document failed",cause:Me,remoteDoc:Ke})}return Ke});return function(Ye,Ue){return tt.apply(this,arguments)}}(),_e.processContext=function(){var tt=yt(function*(Ye,Ue,ke){return ke=Xe(ke,{base:"",contextResolver:new Q({sharedCache:st})}),null===Ue?X(ke):(Ue=P.clone(Ue),K(Ue)&&"@context"in Ue||(Ue={"@context":Ue}),E({activeCtx:Ye,localCtx:Ue,options:ke}))});return function(Ye,Ue,ke){return tt.apply(this,arguments)}}(),_e.getContextValue=Y("./context").getContextValue,_e.documentLoaders={},_e.useDocumentLoader=function(tt){if(!(tt in _e.documentLoaders))throw new v('Unknown document loader type: "'+tt+'"',"jsonld.UnknownDocumentLoader",{type:tt});_e.documentLoader=_e.documentLoaders[tt].apply(_e,Array.prototype.slice.call(arguments,1))},_e.registerRDFParser=function(tt,Ye){Ie[tt]=Ye},_e.unregisterRDFParser=function(tt){delete Ie[tt]},_e.registerRDFParser("application/n-quads",O.parse),_e.registerRDFParser("application/nquads",O.parse),_e.url=Y("./url"),_e.util=P,Object.assign(_e,P),_e.promises=_e,_e.RequestQueue=Y("./RequestQueue"),_e.JsonLdProcessor=Y("./JsonLdProcessor")(_e),j.setupGlobals(_e),j.setupDocumentLoaders(_e),_e},ne=function(){return me(function(){return ne()})};me(ne),Se.exports=ne},{"./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,Se,he){"use strict";const{isKeyword:W}=Y("./context"),j=Y("./graphTypes"),P=Y("./types"),Q=Y("./util"),z=Y("./JsonLdError"),v={};Se.exports=v,v.createMergedNodeMap=(x,O)=>{const A=(O=O||{}).issuer||new Q.IdentifierIssuer("_:b"),b={"@default":{}};return v.createNodeMap(x,b,"@default",A),v.mergeNodeMaps(b)},v.createNodeMap=(x,O,A,b,y,S)=>{if(P.isArray(x)){for(const K of x)v.createNodeMap(K,O,A,b,void 0,S);return}if(!P.isObject(x))return void(S&&S.push(x));if(j.isValue(x)){if("@type"in x){let K=x["@type"];0===K.indexOf("_:")&&(x["@type"]=K=b.getId(K))}return void(S&&S.push(x))}if(S&&j.isList(x)){const K=[];return v.createNodeMap(x["@list"],O,A,b,y,K),void S.push({"@list":K})}if("@type"in x){const K=x["@type"];for(const ce of K)0===ce.indexOf("_:")&&b.getId(ce)}P.isUndefined(y)&&(y=j.isBlankNode(x)?b.getId(x["@id"]):x["@id"]),S&&S.push({"@id":y});const T=O[A],V=T[y]=T[y]||{};V["@id"]=y;const R=Object.keys(x).sort();for(let K of R){if("@id"===K)continue;if("@reverse"===K){const D={"@id":y},I=x["@reverse"];for(const X in I){const E=I[X];for(const $ of E){let Z=$["@id"];j.isBlankNode($)&&(Z=b.getId(Z)),v.createNodeMap($,O,A,b,Z),Q.addValue(T[Z],X,D,{propertyIsArray:!0,allowDuplicate:!1})}}continue}if("@graph"===K){y in O||(O[y]={}),v.createNodeMap(x[K],O,y,b);continue}if("@included"===K){v.createNodeMap(x[K],O,A,b);continue}if("@type"!==K&&W(K)){if("@index"===K&&K in V&&(x[K]!==V[K]||x[K]["@id"]!==V[K]["@id"]))throw new z("Invalid JSON-LD syntax; conflicting @index property detected.","jsonld.SyntaxError",{code:"conflicting indexes",subject:V});V[K]=x[K];continue}const ce=x[K];if(0===K.indexOf("_:")&&(K=b.getId(K)),0!==ce.length)for(let D of ce)if("@type"===K&&(D=0===D.indexOf("_:")?b.getId(D):D),j.isSubject(D)||j.isSubjectReference(D)){if("@id"in D&&!D["@id"])continue;const I=j.isBlankNode(D)?b.getId(D["@id"]):D["@id"];Q.addValue(V,K,{"@id":I},{propertyIsArray:!0,allowDuplicate:!1}),v.createNodeMap(D,O,A,b,I)}else if(j.isValue(D))Q.addValue(V,K,D,{propertyIsArray:!0,allowDuplicate:!1});else if(j.isList(D)){const I=[];v.createNodeMap(D["@list"],O,A,b,y,I),D={"@list":I},Q.addValue(V,K,D,{propertyIsArray:!0,allowDuplicate:!1})}else v.createNodeMap(D,O,A,b,y),Q.addValue(V,K,D,{propertyIsArray:!0,allowDuplicate:!1});else Q.addValue(V,K,[],{propertyIsArray:!0})}},v.mergeNodeMapGraphs=x=>{const O={};for(const A of Object.keys(x).sort())for(const b of Object.keys(x[A]).sort()){const y=x[A][b];b in O||(O[b]={"@id":b});const S=O[b];for(const T of Object.keys(y).sort())if(W(T)&&"@type"!==T)S[T]=Q.clone(y[T]);else for(const V of y[T])Q.addValue(S,T,Q.clone(V),{propertyIsArray:!0,allowDuplicate:!1})}return O},v.mergeNodeMaps=x=>{const O=x["@default"],A=Object.keys(x).sort();for(const b of A){if("@default"===b)continue;const y=x[b];let S=O[b];S?"@graph"in S||(S["@graph"]=[]):O[b]=S={"@id":b,"@graph":[]};const T=S["@graph"];for(const V of Object.keys(y).sort()){const R=y[V];j.isSubjectReference(R)||T.push(R)}}return O}},{"./JsonLdError":12,"./context":19,"./graphTypes":25,"./types":30,"./util":32}],28:[function(Y,Se,he){"use strict";const W=Y("./documentLoaders/xhr"),j={};Se.exports=j,j.setupDocumentLoaders=function(P){"undefined"!=typeof XMLHttpRequest&&(P.documentLoaders.xhr=W,P.useDocumentLoader("xhr"))},j.setupGlobals=function(P){void 0===globalThis.JsonLdProcessor&&Object.defineProperty(globalThis,"JsonLdProcessor",{writable:!0,enumerable:!1,configurable:!0,value:P.JsonLdProcessor})}},{"./documentLoaders/xhr":20}],29:[function(Y,Se,he){"use strict";const{createNodeMap:W}=Y("./nodeMap"),{isKeyword:j}=Y("./context"),P=Y("./graphTypes"),Q=Y("canonicalize"),z=Y("./types"),v=Y("./util"),{RDF_FIRST:x,RDF_REST:O,RDF_NIL:A,RDF_TYPE:b,RDF_JSON_LITERAL:y,RDF_LANGSTRING:S,XSD_BOOLEAN:T,XSD_DOUBLE:V,XSD_INTEGER:R,XSD_STRING:K}=Y("./constants"),{isAbsolute:ce}=Y("./url"),D={};function I($,Z,oe,se,te){const Ce=Object.keys(Z).sort();for(const me of Ce){const ne=Z[me],_e=Object.keys(ne).sort();for(let Ie of _e){const Ge=ne[Ie];if("@type"===Ie)Ie=b;else if(j(Ie))continue;for(const st of Ge){const Xe={termType:me.startsWith("_:")?"BlankNode":"NamedNode",value:me};if(!ce(me))continue;const tt={termType:Ie.startsWith("_:")?"BlankNode":"NamedNode",value:Ie};if(!ce(Ie)||"BlankNode"===tt.termType&&!te.produceGeneralizedRdf)continue;const Ye=E(st,se,$,oe,te.rdfDirection);Ye&&$.push({subject:Xe,predicate:tt,object:Ye,graph:oe})}}}}function E($,Z,oe,se,te){const Ce={};if(P.isValue($)){Ce.termType="Literal",Ce.value=void 0,Ce.datatype={termType:"NamedNode"};let me=$["@value"];const ne=$["@type"]||null;"@json"===ne?(Ce.value=Q(me),Ce.datatype.value=y):z.isBoolean(me)?(Ce.value=me.toString(),Ce.datatype.value=ne||T):z.isDouble(me)||ne===V?(z.isDouble(me)||(me=parseFloat(me)),Ce.value=me.toExponential(15).replace(/(\d)0*e\+?/,"$1E"),Ce.datatype.value=ne||V):z.isNumber(me)?(Ce.value=me.toFixed(0),Ce.datatype.value=ne||R):"i18n-datatype"===te&&"@direction"in $?(Ce.datatype.value="https://www.w3.org/ns/i18n#"+($["@language"]||"")+`_${$["@direction"]}`,Ce.value=me):"@language"in $?(Ce.value=me,Ce.datatype.value=ne||S,Ce.language=$["@language"]):(Ce.value=me,Ce.datatype.value=ne||K)}else if(P.isList($)){const me=function($,Z,oe,se,te){const Ce={termType:"NamedNode",value:x},me={termType:"NamedNode",value:O},ne={termType:"NamedNode",value:A},_e=$.pop(),Ie=_e?{termType:"BlankNode",value:Z.getId()}:ne;let Ge=Ie;for(const st of $){const Xe=E(st,Z,oe,se,te),tt={termType:"BlankNode",value:Z.getId()};oe.push({subject:Ge,predicate:Ce,object:Xe,graph:se}),oe.push({subject:Ge,predicate:me,object:tt,graph:se}),Ge=tt}if(_e){const st=E(_e,Z,oe,se,te);oe.push({subject:Ge,predicate:Ce,object:st,graph:se}),oe.push({subject:Ge,predicate:me,object:ne,graph:se})}return Ie}($["@list"],Z,oe,se,te);Ce.termType=me.termType,Ce.value=me.value}else{const me=z.isObject($)?$["@id"]:$;Ce.termType=me.startsWith("_:")?"BlankNode":"NamedNode",Ce.value=me}return"NamedNode"!==Ce.termType||ce(Ce.value)?Ce:null}Se.exports=D,D.toRDF=($,Z)=>{const oe=new v.IdentifierIssuer("_:b"),se={"@default":{}};W($,se,"@default",oe);const te=[],Ce=Object.keys(se).sort();for(const me of Ce){let ne;if("@default"===me)ne={termType:"DefaultGraph",value:""};else{if(!ce(me))continue;ne=me.startsWith("_:")?{termType:"BlankNode"}:{termType:"NamedNode"},ne.value=me}I(te,se[me],ne,oe,Z)}return te}},{"./constants":18,"./context":19,"./graphTypes":25,"./nodeMap":27,"./types":30,"./url":31,"./util":32,canonicalize:7}],30:[function(Y,Se,he){"use strict";const W={};Se.exports=W,W.isArray=Array.isArray,W.isBoolean=j=>"boolean"==typeof j||"[object Boolean]"===Object.prototype.toString.call(j),W.isDouble=j=>W.isNumber(j)&&(-1!==String(j).indexOf(".")||Math.abs(j)>=1e21),W.isEmptyObject=j=>W.isObject(j)&&0===Object.keys(j).length,W.isNumber=j=>"number"==typeof j||"[object Number]"===Object.prototype.toString.call(j),W.isNumeric=j=>!isNaN(parseFloat(j))&&isFinite(j),W.isObject=j=>"[object Object]"===Object.prototype.toString.call(j),W.isString=j=>"string"==typeof j||"[object String]"===Object.prototype.toString.call(j),W.isUndefined=j=>void 0===j},{}],31:[function(Y,Se,he){"use strict";const W=Y("./types"),j={};Se.exports=j,j.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*))?))?(?:(((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/}},j.parse=(Q,z)=>{const v={},x=j.parsers[z||"full"],O=x.regex.exec(Q);let A=x.keys.length;for(;A--;)v[x.keys[A]]=void 0===O[A]?null:O[A];return("https"===v.scheme&&"443"===v.port||"http"===v.scheme&&"80"===v.port)&&(v.href=v.href.replace(":"+v.port,""),v.authority=v.authority.replace(":"+v.port,""),v.port=null),v.normalizedPath=j.removeDotSegments(v.path),v},j.prependBase=(Q,z)=>{if(null===Q||j.isAbsolute(z))return z;(!Q||W.isString(Q))&&(Q=j.parse(Q||""));const v=j.parse(z),x={protocol:Q.protocol||""};if(null!==v.authority)x.authority=v.authority,x.path=v.path,x.query=v.query;else if(x.authority=Q.authority,""===v.path)x.path=Q.path,x.query=null!==v.query?v.query:Q.query;else{if(0===v.path.indexOf("/"))x.path=v.path;else{let A=Q.path;A=A.substr(0,A.lastIndexOf("/")+1),(A.length>0||Q.authority)&&"/"!==A.substr(-1)&&(A+="/"),A+=v.path,x.path=A}x.query=v.query}""!==v.path&&(x.path=j.removeDotSegments(x.path));let O=x.protocol;return null!==x.authority&&(O+="//"+x.authority),O+=x.path,null!==x.query&&(O+="?"+x.query),null!==v.fragment&&(O+="#"+v.fragment),""===O&&(O="./"),O},j.removeBase=(Q,z)=>{if(null===Q)return z;(!Q||W.isString(Q))&&(Q=j.parse(Q||""));let v="";if(""!==Q.href?v+=(Q.protocol||"")+"//"+(Q.authority||""):z.indexOf("//")&&(v+="//"),0!==z.indexOf(v))return z;const x=j.parse(z.substr(v.length)),O=Q.normalizedPath.split("/"),A=x.normalizedPath.split("/"),b=x.fragment||x.query?0:1;for(;O.length>0&&A.length>b&&O[0]===A[0];)O.shift(),A.shift();let y="";if(O.length>0){O.pop();for(let S=0;S{if(0===Q.length)return"";const z=Q.split("/"),v=[];for(;z.length>0;){const x=z.shift(),O=0===z.length;"."!==x?".."!==x?v.push(x):(v.pop(),O&&v.push("")):O&&v.push("")}return"/"===Q[0]&&v.length>0&&""!==v[0]&&v.unshift(""),1===v.length&&""===v[0]?"/":v.join("/")};const P=/^([A-Za-z][A-Za-z0-9+-.]*|_):[^\s]*$/;j.isAbsolute=Q=>W.isString(Q)&&P.test(Q),j.isRelative=Q=>W.isString(Q)},{"./types":30}],32:[function(Y,Se,he){"use strict";const W=Y("./graphTypes"),j=Y("./types"),P=Y("rdf-canonize").IdentifierIssuer,Q=Y("./JsonLdError"),z=/(?:<[^>]*?>|"[^"]*?"|[^,])+/g,v=/\s*<([^>]*?)>\s*(?:;\s*(.*))?/,x=/(.*?)=(?:(?:"([^"]*?)")|([^"]*?))\s*(?:(?:;\s*)|$)/g,O_headers={accept:"application/ld+json, application/json"},A={};function b(y,S){if(j.isArray(S))for(let T=0;T{if(Object.keys(y).some(T=>"accept"===T.toLowerCase()))throw new RangeError('Accept header may not be specified; only "'+O_headers.accept+'" is supported.');return Object.assign({Accept:O_headers.accept},y)},A.parseLinkHeader=y=>{const S={},T=y.match(z);for(let V=0;V{if(!(j.isString(y)||j.isArray(y)&&y.every(T=>j.isString(T)))){if(S&&j.isObject(y))switch(Object.keys(y).length){case 0:return;case 1:if("@default"in y&&A.asArray(y["@default"]).every(T=>j.isString(T)))return}throw new Q('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,S)=>{if(y.hasOwnProperty(S)){const T=y[S];return!j.isArray(T)||T.length>0}return!1},A.hasValue=(y,S,T)=>{if(A.hasProperty(y,S)){let V=y[S];const R=W.isList(V);if(j.isArray(V)||R){R&&(V=V["@list"]);for(let K=0;K{if("propertyIsArray"in(V=V||{})||(V.propertyIsArray=!1),"valueIsArray"in V||(V.valueIsArray=!1),"allowDuplicate"in V||(V.allowDuplicate=!0),"prependValue"in V||(V.prependValue=!1),V.valueIsArray)y[S]=T;else if(j.isArray(T)){0===T.length&&V.propertyIsArray&&!y.hasOwnProperty(S)&&(y[S]=[]),V.prependValue&&(T=T.concat(y[S]),y[S]=[]);for(let R=0;R[].concat(y[S]||[]),A.removeProperty=(y,S)=>{delete y[S]},A.removeValue=(y,S,T,V)=>{"propertyIsArray"in(V=V||{})||(V.propertyIsArray=!1);const R=A.getValues(y,S).filter(K=>!A.compareValues(K,T));0===R.length?A.removeProperty(y,S):y[S]=1!==R.length||V.propertyIsArray?R:R[0]},A.relabelBlankNodes=(y,S)=>b((S=S||{}).issuer||new P("_:b"),y),A.compareValues=(y,S)=>!!(y===S||W.isValue(y)&&W.isValue(S)&&y["@value"]===S["@value"]&&y["@type"]===S["@type"]&&y["@language"]===S["@language"]&&y["@index"]===S["@index"])||!!(j.isObject(y)&&"@id"in y&&j.isObject(S)&&"@id"in S)&&y["@id"]===S["@id"],A.compareShortestLeast=(y,S)=>y.length1;const V=(X,E,$)=>{const Z=X[b].get(E);if(Z){const oe=Z.value;if(R(X,oe)){if(ce(X,Z),!X[z])return}else $&&(X[y]&&(Z.value.now=Date.now()),X[A].unshiftNode(Z));return oe.value}},R=(X,E)=>{if(!E||!E.maxAge&&!X[v])return!1;const $=Date.now()-E.now;return E.maxAge?$>E.maxAge:X[v]&&$>X[v]},K=X=>{if(X[P]>X[j])for(let E=X[A].tail;X[P]>X[j]&&null!==E;){const $=E.prev;ce(X,E),E=$}},ce=(X,E)=>{if(E){const $=E.value;X[x]&&X[x]($.key,$.value),X[P]-=$.length,X[b].delete($.key),X[A].removeNode(E)}};class D{constructor(E,$,Z,oe,se){this.key=E,this.value=$,this.length=Z,this.now=oe,this.maxAge=se||0}}const I=(X,E,$,Z)=>{let oe=$.value;R(X,oe)&&(ce(X,$),X[z]||(oe=void 0)),oe&&E.call(Z,oe.value,oe.key,X)};Se.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[j]=E.max||1/0;const Z=E.length||S;if(this[Q]="function"!=typeof Z?S:Z,this[z]=E.stale||!1,E.maxAge&&"number"!=typeof E.maxAge)throw new TypeError("maxAge must be a number");this[v]=E.maxAge||0,this[x]=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[j]=E||1/0,K(this)}get max(){return this[j]}set allowStale(E){this[z]=!!E}get allowStale(){return this[z]}set maxAge(E){if("number"!=typeof E)throw new TypeError("maxAge must be a non-negative number");this[v]=E,K(this)}get maxAge(){return this[v]}set lengthCalculator(E){"function"!=typeof E&&(E=S),E!==this[Q]&&(this[Q]=E,this[P]=0,this[A].forEach($=>{$.length=this[Q]($.value,$.key),this[P]+=$.length})),K(this)}get lengthCalculator(){return this[Q]}get length(){return this[P]}get itemCount(){return this[A].length}rforEach(E,$){$=$||this;for(let Z=this[A].tail;null!==Z;){const oe=Z.prev;I(this,E,Z,$),Z=oe}}forEach(E,$){$=$||this;for(let Z=this[A].head;null!==Z;){const oe=Z.next;I(this,E,Z,$),Z=oe}}keys(){return this[A].toArray().map(E=>E.key)}values(){return this[A].toArray().map(E=>E.value)}reset(){this[x]&&this[A]&&this[A].length&&this[A].forEach(E=>this[x](E.key,E.value)),this[b]=new Map,this[A]=new W,this[P]=0}dump(){return this[A].map(E=>!R(this,E)&&{k:E.key,v:E.value,e:E.now+(E.maxAge||0)}).toArray().filter(E=>E)}dumpLru(){return this[A]}set(E,$,Z){if((Z=Z||this[v])&&"number"!=typeof Z)throw new TypeError("maxAge must be a number");const oe=Z?Date.now():0,se=this[Q]($,E);if(this[b].has(E)){if(se>this[j])return ce(this,this[b].get(E)),!1;const me=this[b].get(E).value;return this[x]&&(this[O]||this[x](E,me.value)),me.now=oe,me.maxAge=Z,me.value=$,this[P]+=se-me.length,me.length=se,this.get(E),K(this),!0}const te=new D(E,$,se,oe,Z);return te.length>this[j]?(this[x]&&this[x](E,$),!1):(this[P]+=te.length,this[A].unshift(te),this[b].set(E,this[A].head),K(this),!0)}has(E){if(!this[b].has(E))return!1;const $=this[b].get(E).value;return!R(this,$)}get(E){return V(this,E,!0)}peek(E){return V(this,E,!1)}pop(){const E=this[A].tail;return E?(ce(this,E),E.value):null}del(E){ce(this,this[b].get(E))}load(E){this.reset();const $=Date.now();for(let Z=E.length-1;Z>=0;Z--){const oe=E[Z],se=oe.e||0;if(0===se)this.set(oe.k,oe.v);else{const te=se-$;te>0&&this.set(oe.k,oe.v,te)}}}prune(){this[b].forEach((E,$)=>V(this,$,!1))}}},{yallist:92}],34:[function(Y,Se,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#",j="http://www.w3.org/2001/XMLSchema#",P="http://www.w3.org/2000/10/swap/";he.default={xsd:{decimal:`${j}decimal`,boolean:`${j}boolean`,double:`${j}double`,integer:`${j}integer`,string:`${j}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:`${P}reify#forSome`,forAll:`${P}reify#forAll`},log:{implies:`${P}log#implies`}}},{}],35:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.default=he.Variable=he.Triple=he.Term=he.Quad=he.NamedNode=he.Literal=he.DefaultGraph=he.BlankNode=void 0,he.escapeQuotes=E,he.termFromId=function D(ne,_e){if(_e=_e||b,!ne)return _e.defaultGraph();switch(ne[0]){case"?":return _e.variable(ne.substr(1));case"_":return _e.blankNode(ne.substr(2));case'"':if(_e===b)return new V(ne);if('"'===ne[ne.length-1])return _e.literal(ne.substr(1,ne.length-2));const Ie=ne.lastIndexOf('"',ne.length-1);return _e.literal(ne.substr(1,Ie-1),"@"===ne[Ie+1]?ne.substr(Ie+2):_e.namedNode(ne.substr(Ie+3)));case"<":const Ge=A.exec(ne);return _e.quad(D($(Ge[1]),_e),D($(Ge[2]),_e),D($(Ge[3]),_e),Ge[4]&&D($(Ge[4]),_e));default:return _e.namedNode(ne)}},he.termToId=function I(ne){if("string"==typeof ne)return ne;if(ne instanceof S&&"Quad"!==ne.termType)return ne.id;if(!ne)return v.id;switch(ne.termType){case"NamedNode":return ne.value;case"BlankNode":return`_:${ne.value}`;case"Variable":return`?${ne.value}`;case"DefaultGraph":return"";case"Literal":return`"${ne.value}"${ne.language?`@${ne.language}`:ne.datatype&&ne.datatype.value!==z.string?`^^${ne.datatype.value}`:""}`;case"Quad":return`<<${E(I(ne.subject))} ${E(I(ne.predicate))} ${E(I(ne.object))}${(0,j.isDefaultGraph)(ne.graph)?"":` ${I(ne.graph)}`}>>`;default:throw new Error(`Unexpected termType: ${ne.termType}`)}},he.unescapeQuotes=$;var ne,W=(ne=Y("./IRIs"))&&ne.__esModule?ne:{default:ne},j=Y("./N3Util");const{rdf:Q,xsd:z}=W.default;let v,x=0;const O=/^"(.*".*)(?="[^"]*$)/,A=/^<<("(?:""|[^"])*"[^ ]*|[^ ]+) ("(?:""|[^"])*"[^ ]*|[^ ]+) ("(?:""|[^"])*"[^ ]*|[^ ]+) ?("(?:""|[^"])*"[^ ]*|[^ ]+)?>>$/,b={namedNode:function(ne){return new T(ne)},blankNode:function(ne){return new R(ne||"n3-"+x++)},variable:function(ne){return new K(ne)},literal:function(ne,_e){if("string"==typeof _e)return new V(`"${ne}"@${_e.toLowerCase()}`);let Ie=_e?_e.value:"";return""===Ie&&("boolean"==typeof ne?Ie=z.boolean:"number"==typeof ne&&(Number.isFinite(ne)?Ie=Number.isInteger(ne)?z.integer:z.double:(Ie=z.double,Number.isNaN(ne)||(ne=ne>0?"INF":"-INF")))),new V(""===Ie||Ie===z.string?`"${ne}"`:`"${ne}"^^${Ie}`)},defaultGraph:function(){return v},quad:me,triple:me};he.default=b;class S{constructor(_e){this.id=_e}get value(){return this.id}equals(_e){return _e instanceof S?this.id===_e.id:!!_e&&this.termType===_e.termType&&this.value===_e.value}hashCode(){return 0}toJSON(){return{termType:this.termType,value:this.value}}}he.Term=S;class T extends S{get termType(){return"NamedNode"}}he.NamedNode=T;class V extends S{get termType(){return"Literal"}get value(){return this.id.substring(1,this.id.lastIndexOf('"'))}get language(){const _e=this.id;let Ie=_e.lastIndexOf('"')+1;return Ie<_e.length&&"@"===_e[Ie++]?_e.substr(Ie).toLowerCase():""}get datatype(){return new T(this.datatypeString)}get datatypeString(){const _e=this.id,Ie=_e.lastIndexOf('"')+1,Ge=Ie<_e.length?_e[Ie]:"";return"^"===Ge?_e.substr(Ie+2):"@"!==Ge?z.string:Q.langString}equals(_e){return _e instanceof V?this.id===_e.id:!!_e&&!!_e.datatype&&this.termType===_e.termType&&this.value===_e.value&&this.language===_e.language&&this.datatype.value===_e.datatype.value}toJSON(){return{termType:this.termType,value:this.value,language:this.language,datatype:{termType:"NamedNode",value:this.datatypeString}}}}he.Literal=V;class R extends S{constructor(_e){super(`_:${_e}`)}get termType(){return"BlankNode"}get value(){return this.id.substr(2)}}he.BlankNode=R;class K extends S{constructor(_e){super(`?${_e}`)}get termType(){return"Variable"}get value(){return this.id.substr(1)}}he.Variable=K;class ce extends S{constructor(){return super(""),v||this}get termType(){return"DefaultGraph"}equals(_e){return this===_e||!!_e&&this.termType===_e.termType}}he.DefaultGraph=ce,v=new ce;class X extends S{constructor(_e,Ie,Ge,st){super(""),this._subject=_e,this._predicate=Ie,this._object=Ge,this._graph=st||v}get termType(){return"Quad"}get subject(){return this._subject}get predicate(){return this._predicate}get object(){return this._object}get graph(){return this._graph}toJSON(){return{termType:this.termType,subject:this._subject.toJSON(),predicate:this._predicate.toJSON(),object:this._object.toJSON(),graph:this._graph.toJSON()}}equals(_e){return!!_e&&this._subject.equals(_e.subject)&&this._predicate.equals(_e.predicate)&&this._object.equals(_e.object)&&this._graph.equals(_e.graph)}}function E(ne){return ne.replace(O,(_e,Ie)=>`"${Ie.replace(/"/g,'""')}`)}function $(ne){return ne.replace(O,(_e,Ie)=>`"${Ie.replace(/""/g,'"')}`)}function me(ne,_e,Ie,Ge){return new X(ne,_e,Ie,Ge)}he.Triple=he.Quad=X},{"./IRIs":34,"./N3Util":41}],36:[function(Y,Se,he){(function(W){(function(){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.default=void 0;var j=Q(Y("./IRIs")),P=Q(Y("queue-microtask"));function Q(S){return S&&S.__esModule?S:{default:S}}const{xsd:z}=j.default,v=/\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{8})|\\([^])/g,x={"\\":"\\","'":"'",'"':'"',n:"\n",r:"\r",t:"\t",f:"\f",b:"\b",_:"_","~":"~",".":".","-":"-","!":"!",$:"$","&":"&","(":"(",")":")","*":"*","+":"+",",":",",";":";","=":"=","/":"/","?":"?","#":"#","@":"@","%":"%"},O=/[\x00-\x20<>\\"\{\}\|\^\`]/,A={_iri:!0,_unescapedIri:!0,_simpleQuotedString:!0,_langcode:!0,_blank:!0,_newline:!0,_comment:!0,_whitespace:!0,_endOfFile:!0},b=/$0^/;he.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 V in this)!(V in A)&&this[V]instanceof RegExp&&(this[V]=b)}else this._n3Mode=!1!==T.n3;this._comments=!!T.comments,this._literalClosingPos=0}_tokenizeToEnd(T,V){let R=this._input,K=R.length;for(;;){let I,X;for(;I=this._newline.exec(R);)this._comments&&(X=this._comment.exec(I[0]))&&ce("comment",X[1],"",this._line,I[0].length),R=R.substr(I[0].length,R.length),K=R.length,this._line++;if(!I&&(I=this._whitespace.exec(R))&&(R=R.substr(I[0].length,R.length)),this._endOfFile.test(R))return V&&(this._comments&&(X=this._comment.exec(R))&&ce("comment",X[1],"",this._line,R.length),R=null,ce("eof","","",this._line,0)),this._input=R;const E=this._line,$=R[0];let Z="",oe="",se="",te=null,Ce=0,me=!1;switch($){case"^":if(R.length<3)break;if("^"!==R[1]){this._n3Mode&&(Ce=1,Z="^");break}if(this._previousMarker="^^",R=R.substr(2),"<"!==R[0]){me=!0;break}case"<":if(te=this._unescapedIri.exec(R))Z="IRI",oe=te[1];else if(te=this._iri.exec(R)){if(oe=this._unescape(te[1]),null===oe||O.test(oe))return D(this);Z="IRI"}else R.length>1&&"<"===R[1]?(Z="<<",Ce=2):this._n3Mode&&R.length>1&&"="===R[1]&&(Z="inverse",Ce=2,oe=">");break;case">":R.length>1&&">"===R[1]&&(Z=">>",Ce=2);break;case"_":((te=this._blank.exec(R))||V&&(te=this._blank.exec(`${R} `)))&&(Z="blank",se="_",oe=te[1]);break;case'"':if(te=this._simpleQuotedString.exec(R))oe=te[1];else if(({value:oe,matchLength:Ce}=this._parseLiteral(R)),null===oe)return D(this);(null!==te||0!==Ce)&&(Z="literal",this._literalClosingPos=0);break;case"'":if(!this._lineMode){if(te=this._simpleApostropheString.exec(R))oe=te[1];else if(({value:oe,matchLength:Ce}=this._parseLiteral(R)),null===oe)return D(this);(null!==te||0!==Ce)&&(Z="literal",this._literalClosingPos=0)}break;case"?":this._n3Mode&&(te=this._variable.exec(R))&&(Z="var",oe=te[0]);break;case"@":"literal"===this._previousMarker&&(te=this._langcode.exec(R))?(Z="langcode",oe=te[1]):(te=this._keyword.exec(R))&&(Z=te[0]);break;case".":if(1===R.length?V:R[1]<"0"||R[1]>"9"){Z=".",Ce=1;break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"+":case"-":(te=this._number.exec(R)||V&&(te=this._number.exec(`${R} `)))&&(Z="literal",oe=te[0],se="string"==typeof te[1]?z.double:"string"==typeof te[2]?z.decimal:z.integer);break;case"B":case"b":case"p":case"P":case"G":case"g":(te=this._sparqlKeyword.exec(R))?Z=te[0].toUpperCase():me=!0;break;case"f":case"t":(te=this._boolean.exec(R))?(Z="literal",oe=te[0],se=z.boolean):me=!0;break;case"a":(te=this._shortPredicates.exec(R))?(Z="abbreviation",oe="a"):me=!0;break;case"=":this._n3Mode&&R.length>1&&(Z="abbreviation",">"!==R[1]?(Ce=1,oe="="):(Ce=2,oe=">"));break;case"!":if(!this._n3Mode)break;case",":case";":case"[":case"]":case"(":case")":case"{":case"}":this._lineMode||(Ce=1,Z=$);break;default:me=!0}if(me&&("@prefix"!==this._previousMarker&&"PREFIX"!==this._previousMarker||!(te=this._prefix.exec(R))?((te=this._prefixed.exec(R))||V&&(te=this._prefixed.exec(`${R} `)))&&(Z="prefixed",se=te[1]||"",oe=this._unescape(te[2])):(Z="prefix",oe=te[1]||"")),"^^"===this._previousMarker)switch(Z){case"prefixed":Z="type";break;case"IRI":Z="typeIRI";break;default:Z=""}if(!Z)return V||!/^'''|^"""/.test(R)&&/\n|\r/.test(R)?D(this):this._input=R;const ne=Ce||te[0].length,_e=ce(Z,oe,se,E,ne);this.previousToken=_e,this._previousMarker=Z,R=R.substr(ne,R.length)}function ce(I,X,E,$,Z){const oe=R?K-R.length:K,te={type:I,value:X,prefix:E,line:$,start:oe,end:oe+Z};return T(null,te),te}function D(I){T(I._syntaxError(/^\S*/.exec(R)[0]))}}_unescape(T){let V=!1;const R=T.replace(v,(K,ce,D,I)=>{if("string"==typeof ce)return String.fromCharCode(Number.parseInt(ce,16));if("string"==typeof D){let X=Number.parseInt(D,16);return X<=65535?String.fromCharCode(Number.parseInt(D,16)):String.fromCharCode(55296+((X-=65536)>>10),56320+(1023&X))}return I in x?x[I]:(V=!0,"")});return V?null:R}_parseLiteral(T){if(T.length>=3){const V=T.match(/^(?:"""|"|'''|'|)/)[0],R=V.length;let K=Math.max(this._literalClosingPos,R);for(;(K=T.indexOf(V,K))>0;){let ce=0;for(;"\\"===T[K-ce-1];)ce++;if(ce%2==0){const D=T.substring(R,K),I=D.split(/\r\n|\r|\n/).length-1,X=K+R;if(1===R&&0!==I||3===R&&this._lineMode)break;return this._line+=I,{value:this._unescape(D),matchLength:X}}K++}this._literalClosingPos=T.length-R+1}return{value:"",matchLength:0}}_syntaxError(T){this._input=null;const V=new Error(`Unexpected "${T}" on line ${this._line}.`);return V.context={token:void 0,line:this._line,previousToken:this.previousToken},V}_readStartingBom(T){return T.startsWith("\ufeff")?T.substr(1):T}tokenize(T,V){if(this._line=1,"string"==typeof T){if(this._input=this._readStartingBom(T),"function"!=typeof V){const R=[];let K;if(this._tokenizeToEnd((ce,D)=>ce?K=ce:R.push(D),!0),K)throw K;return R}(0,P.default)(()=>this._tokenizeToEnd(V,!0))}else this._pendingBuffer=null,"function"==typeof T.setEncoding&&T.setEncoding("utf8"),T.on("data",R=>{null!==this._input&&0!==R.length&&(this._pendingBuffer&&(R=W.concat([this._pendingBuffer,R]),this._pendingBuffer=null),128&R[R.length-1]?this._pendingBuffer=R:(void 0===this._input?this._input=this._readStartingBom("string"==typeof R?R:R.toString()):this._input+=R,this._tokenizeToEnd(V,!1)))}),T.on("end",()=>{"string"==typeof this._input&&this._tokenizeToEnd(V,!0)}),T.on("error",V)}}}).call(this)}).call(this,Y("buffer").Buffer)},{"./IRIs":34,buffer:6,"queue-microtask":45}],37:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.default=void 0;var W=Q(Y("./N3Lexer")),j=Q(Y("./N3DataFactory")),P=Q(Y("./IRIs"));function Q(A){return A&&A.__esModule?A:{default:A}}let z=0;class v{constructor(b){this._contextStack=[],this._graph=null,this._setBase((b=b||{}).baseIRI),b.factory&&O(this,b.factory);const y="string"==typeof b.format?b.format.match(/\w*$/)[0].toLowerCase():"",S=/turtle/.test(y),T=/trig/.test(y),V=/triple/.test(y),R=/quad/.test(y),K=this._n3Mode=/n3/.test(y),ce=V||R;(this._supportsNamedGraphs=!(S||K))||(this._readPredicateOrNamedGraph=this._readPredicate),this._supportsQuads=!(S||T||V||K),this._supportsRDFStar=""===y||/star|\*$/.test(y),ce&&(this._resolveRelativeIRI=D=>null),this._blankNodePrefix="string"!=typeof b.blankNodePrefix?"":b.blankNodePrefix.replace(/^(?!_:)/,"_:"),this._lexer=b.lexer||new W.default({lineMode:ce,n3:K}),this._explicitQuantifiers=!!b.explicitQuantifiers}static _resetBlankNodePrefix(){z=0}_setBase(b){if(b){const y=b.indexOf("#");y>=0&&(b=b.substr(0,y)),this._base=b,this._basePath=b.indexOf("/")<0?b:b.replace(/[^\/?]*(?:\?.*)?$/,""),b=b.match(/^(?:([a-z][a-z0-9+.-]*:))?(?:\/\/[^\/]*)?/i),this._baseRoot=b[0],this._baseScheme=b[1]}else this._base="",this._basePath=""}_saveContext(b,y,S,T,V){const R=this._n3Mode;this._contextStack.push({subject:S,predicate:T,object:V,graph:y,type:b,inverse:!!R&&this._inversePredicate,blankPrefix:R?this._prefixes._:"",quantified:R?this._quantified:null}),R&&(this._inversePredicate=!1,this._prefixes._=this._graph?`${this._graph.id.substr(2)}.`:".",this._quantified=Object.create(this._quantified))}_restoreContext(){const b=this._contextStack.pop(),y=this._n3Mode;this._subject=b.subject,this._predicate=b.predicate,this._object=b.object,this._graph=b.graph,y&&(this._inversePredicate=b.inverse,this._prefixes._=b.blankPrefix,this._quantified=b.quantified)}_readInTopContext(b){switch(b.type){case"eof":return null!==this._graph?this._error("Unclosed graph",b):(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(b)}}_readEntity(b,y){let S;switch(b.type){case"IRI":case"typeIRI":const T=this._resolveIRI(b.value);if(null===T)return this._error("Invalid IRI",b);S=this._namedNode(T);break;case"type":case"prefixed":const V=this._prefixes[b.prefix];if(void 0===V)return this._error(`Undefined prefix "${b.prefix}:"`,b);S=this._namedNode(V+b.value);break;case"blank":S=this._blankNode(this._prefixes[b.prefix]+b.value);break;case"var":S=this._variable(b.value.substr(1));break;default:return this._error(`Expected entity but got ${b.type}`,b)}return!y&&this._n3Mode&&S.id in this._quantified&&(S=this._quantified[S.id]),S}_readSubject(b){switch(this._predicate=null,b.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",b);case"}":return this._readPunctuation(b);case"@forSome":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORSOME,this._quantifier=this._blankNode,this._readQuantifierList):this._error('Unexpected "@forSome"',b);case"@forAll":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORALL,this._quantifier=this._variable,this._readQuantifierList):this._error('Unexpected "@forAll"',b);case"literal":if(!this._n3Mode)return this._error("Unexpected literal",b);if(0===b.prefix.length)return this._literalValue=b.value,this._completeSubjectLiteral;this._subject=this._literal(b.value,this._namedNode(b.prefix));break;case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,null,null,null),this._graph=null,this._readSubject):this._error("Unexpected RDF* syntax",b);default:if(void 0===(this._subject=this._readEntity(b)))return;if(this._n3Mode)return this._getPathReader(this._readPredicateOrNamedGraph)}return this._readPredicateOrNamedGraph}_readPredicate(b){const y=b.type;switch(y){case"inverse":this._inversePredicate=!0;case"abbreviation":this._predicate=this.ABBREVIATIONS[b.value];break;case".":case"]":case"}":return null===this._predicate?this._error(`Unexpected ${y}`,b):(this._subject=null,"]"===y?this._readBlankNodeTail(b):this._readPunctuation(b));case";":return null!==this._predicate?this._readPredicate:this._error("Expected predicate but got ;",b);case"[":if(this._n3Mode)return this._saveContext("blank",this._graph,this._subject,this._subject=this._blankNode(),null),this._readBlankNodeHead;case"blank":if(!this._n3Mode)return this._error("Disallowed blank node as predicate",b);default:if(void 0===(this._predicate=this._readEntity(b)))return}return this._readObject}_readObject(b){switch(b.type){case"literal":if(0===b.prefix.length)return this._literalValue=b.value,this._readDataTypeOrLang;this._object=this._literal(b.value,this._namedNode(b.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",b);case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,this._subject,this._predicate,null),this._graph=null,this._readSubject):this._error("Unexpected RDF* syntax",b);default:if(void 0===(this._object=this._readEntity(b)))return;if(this._n3Mode)return this._getPathReader(this._getContextEndReader())}return this._getContextEndReader()}_readPredicateOrNamedGraph(b){return"{"===b.type?this._readGraph(b):this._readPredicate(b)}_readGraph(b){return"{"!==b.type?this._error(`Expected graph but got ${b.type}`,b):(this._graph=this._subject,this._subject=null,this._readSubject)}_readBlankNodeHead(b){return"]"===b.type?(this._subject=null,this._readBlankNodeTail(b)):(this._predicate=null,this._readPredicate(b))}_readBlankNodeTail(b){if("]"!==b.type)return this._readBlankNodePunctuation(b);null!==this._subject&&this._emit(this._subject,this._predicate,this._object,this._graph);const y=null===this._predicate;return this._restoreContext(),null!==this._object?this._getContextEndReader():null!==this._predicate?this._readObject:y?this._readPredicateOrNamedGraph:this._readPredicateAfterBlank}_readPredicateAfterBlank(b){switch(b.type){case".":case"}":return this._subject=null,this._readPunctuation(b);default:return this._readPredicate(b)}}_readListItem(b){let y=null,S=null,T=this._readListItem;const V=this._subject,R=this._contextStack,K=R[R.length-1];switch(b.type){case"[":this._saveContext("blank",this._graph,S=this._blankNode(),this.RDF_FIRST,this._subject=y=this._blankNode()),T=this._readBlankNodeHead;break;case"(":this._saveContext("list",this._graph,S=this._blankNode(),this.RDF_FIRST,this.RDF_NIL),this._subject=null;break;case")":if(this._restoreContext(),0!==R.length&&"list"===R[R.length-1].type&&this._emit(this._subject,this._predicate,this._object,this._graph),null===this._predicate){if(T=this._readPredicate,this._subject===this.RDF_NIL)return T}else if(T=this._getContextEndReader(),this._object===this.RDF_NIL)return T;S=this.RDF_NIL;break;case"literal":0===b.prefix.length?(this._literalValue=b.value,T=this._readListItemDataTypeOrLang):(y=this._literal(b.value,this._namedNode(b.prefix)),T=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",b);default:if(void 0===(y=this._readEntity(b)))return}if(null===S&&(this._subject=S=this._blankNode()),null===V?null===K.predicate?K.subject=S:K.object=S:this._emit(V,this.RDF_REST,S,this._graph),null!==y){if(this._n3Mode&&("IRI"===b.type||"prefixed"===b.type))return this._saveContext("item",this._graph,S,this.RDF_FIRST,y),this._subject=y,this._predicate=null,this._getPathReader(this._readListItem);this._emit(S,this.RDF_FIRST,y,this._graph)}return T}_readDataTypeOrLang(b){return this._completeObjectLiteral(b,!1)}_readListItemDataTypeOrLang(b){return this._completeObjectLiteral(b,!0)}_completeLiteral(b){let y=this._literal(this._literalValue);switch(b.type){case"type":case"typeIRI":const S=this._readEntity(b);if(void 0===S)return;y=this._literal(this._literalValue,S),b=null;break;case"langcode":y=this._literal(this._literalValue,b.value),b=null}return{token:b,literal:y}}_completeSubjectLiteral(b){return this._subject=this._completeLiteral(b).literal,this._readPredicateOrNamedGraph}_completeObjectLiteral(b,y){const S=this._completeLiteral(b);if(S)return this._object=S.literal,y&&this._emit(this._subject,this.RDF_FIRST,this._object,this._graph),null===S.token?this._getContextEndReader():(this._readCallback=this._getContextEndReader(),this._readCallback(S.token))}_readFormulaTail(b){return"}"!==b.type?this._readPunctuation(b):(null!==this._subject&&this._emit(this._subject,this._predicate,this._object,this._graph),this._restoreContext(),null===this._object?this._readPredicate:this._getContextEndReader())}_readPunctuation(b){let y,S=this._graph;const T=this._subject,V=this._inversePredicate;switch(b.type){case"}":if(null===this._graph)return this._error("Unexpected graph closing",b);if(this._n3Mode)return this._readFormulaTail(b);this._graph=null;case".":this._subject=null,y=this._contextStack.length?this._readSubject:this._readInTopContext,V&&(this._inversePredicate=!1);break;case";":y=this._readPredicate;break;case",":y=this._readObject;break;default:if(this._supportsQuads&&null===this._graph&&void 0!==(S=this._readEntity(b))){y=this._readQuadPunctuation;break}return this._error(`Expected punctuation to follow "${this._object.id}"`,b)}if(null!==T){const R=this._predicate,K=this._object;V?this._emit(K,R,T,S):this._emit(T,R,K,S)}return y}_readBlankNodePunctuation(b){let y;switch(b.type){case";":y=this._readPredicate;break;case",":y=this._readObject;break;default:return this._error(`Expected punctuation to follow "${this._object.id}"`,b)}return this._emit(this._subject,this._predicate,this._object,this._graph),y}_readQuadPunctuation(b){return"."!==b.type?this._error("Expected dot to follow quad",b):this._readInTopContext}_readPrefix(b){return"prefix"!==b.type?this._error("Expected prefix to follow @prefix",b):(this._prefix=b.value,this._readPrefixIRI)}_readPrefixIRI(b){if("IRI"!==b.type)return this._error(`Expected IRI to follow prefix "${this._prefix}:"`,b);const y=this._readEntity(b);return this._prefixes[this._prefix]=y.value,this._prefixCallback(this._prefix,y),this._readDeclarationPunctuation}_readBaseIRI(b){const y="IRI"===b.type&&this._resolveIRI(b.value);return y?(this._setBase(y),this._readDeclarationPunctuation):this._error("Expected valid IRI to follow base declaration",b)}_readNamedGraphLabel(b){switch(b.type){case"IRI":case"blank":case"prefixed":return this._readSubject(b),this._readGraph;case"[":return this._readNamedGraphBlankLabel;default:return this._error("Invalid graph label",b)}}_readNamedGraphBlankLabel(b){return"]"!==b.type?this._error("Invalid graph label",b):(this._subject=this._blankNode(),this._readGraph)}_readDeclarationPunctuation(b){return this._sparqlStyle?(this._sparqlStyle=!1,this._readInTopContext(b)):"."!==b.type?this._error("Expected declaration to end with a dot",b):this._readInTopContext}_readQuantifierList(b){let y;switch(b.type){case"IRI":case"prefixed":if(void 0!==(y=this._readEntity(b,!0)))break;default:return this._error(`Unexpected ${b.type}`,b)}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(b){return","===b.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(b))}_getPathReader(b){return this._afterPath=b,this._readPath}_readPath(b){switch(b.type){case"!":return this._readForwardPath;case"^":return this._readBackwardPath;default:const y=this._contextStack,S=y.length&&y[y.length-1];if(S&&"item"===S.type){const T=this._subject;this._restoreContext(),this._emit(this._subject,this.RDF_FIRST,T,this._graph)}return this._afterPath(b)}}_readForwardPath(b){let y,S;const T=this._blankNode();if(void 0!==(S=this._readEntity(b)))return null===this._predicate?(y=this._subject,this._subject=T):(y=this._object,this._object=T),this._emit(y,S,T,this._graph),this._readPath}_readBackwardPath(b){const y=this._blankNode();let S,T;if(void 0!==(S=this._readEntity(b)))return null===this._predicate?(T=this._subject,this._subject=y):(T=this._object,this._object=y),this._emit(y,S,T,this._graph),this._readPath}_readRDFStarTailOrGraph(b){return">>"!==b.type?this._supportsQuads&&null===this._graph&&void 0!==(this._graph=this._readEntity(b))?this._readRDFStarTail:this._error(`Expected >> to follow "${this._object.id}"`,b):this._readRDFStarTail(b)}_readRDFStarTail(b){if(">>"!==b.type)return this._error(`Expected >> but got ${b.type}`,b);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 b=this._contextStack;if(!b.length)return this._readPunctuation;switch(b[b.length-1].type){case"blank":return this._readBlankNodeTail;case"list":return this._readListItem;case"formula":return this._readFormulaTail;case"<<":return this._readRDFStarTailOrGraph}}_emit(b,y,S,T){this._callback(null,this._quad(b,y,S,T||this.DEFAULTGRAPH))}_error(b,y){const S=new Error(`${b} on line ${y.line}.`);S.context={token:y,line:y.line,previousToken:this._lexer.previousToken},this._callback(S),this._callback=x}_resolveIRI(b){return/^[a-z][a-z0-9+.-]*:/i.test(b)?b:this._resolveRelativeIRI(b)}_resolveRelativeIRI(b){if(!b.length)return this._base;switch(b[0]){case"#":return this._base+b;case"?":return this._base.replace(/(?:\?.*)?$/,b);case"/":return("/"===b[1]?this._baseScheme:this._baseRoot)+this._removeDotSegments(b);default:return/^[^/:]*:/.test(b)?null:this._removeDotSegments(this._basePath+b)}}_removeDotSegments(b){if(!/(^|\/)\.\.?($|[/#?])/.test(b))return b;const y=b.length;let S="",T=-1,V=-1,R=0,K="/";for(;T=V&&(S=S.substr(0,R)),"/"!==K)return`${S}/${b.substr(T+1)}`;R=T+1}}}K=b[++T]}return S+b.substring(R)}parse(b,y,S){if(this._readCallback=this._readInTopContext,this._sparqlStyle=!1,this._prefixes=Object.create(null),this._prefixes._=this._blankNodePrefix?this._blankNodePrefix.substr(2):`b${z++}_`,this._prefixCallback=S||x,this._inversePredicate=!1,this._quantified=Object.create(null),!y){const T=[];let V;if(this._callback=(R,K)=>{R?V=R:K&&T.push(K)},this._lexer.tokenize(b).every(R=>this._readCallback=this._readCallback(R)),V)throw V;return T}this._callback=y,this._lexer.tokenize(b,(T,V)=>{null!==T?(this._callback(T),this._callback=x):this._readCallback&&(this._readCallback=this._readCallback(V))})}}function x(){}function O(A,b){const y=b.namedNode;A._namedNode=y,A._blankNode=b.blankNode,A._literal=b.literal,A._variable=b.variable,A._quad=b.quad,A.DEFAULTGRAPH=b.defaultGraph(),A.RDF_FIRST=y(P.default.rdf.first),A.RDF_REST=y(P.default.rdf.rest),A.RDF_NIL=y(P.default.rdf.nil),A.N3_FORALL=y(P.default.r.forAll),A.N3_FORSOME=y(P.default.r.forSome),A.ABBREVIATIONS={a:y(P.default.rdf.type),"=":y(P.default.owl.sameAs),">":y(P.default.log.implies)},A.QUANTIFIERS_GRAPH=y("urn:n3:quantifiers")}he.default=v,O(v.prototype,j.default)},{"./IRIs":34,"./N3DataFactory":35,"./N3Lexer":36}],38:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.default=void 0;var b,W=function(b,y){if(!y&&b&&b.__esModule)return b;if(null===b||"object"!=typeof b&&"function"!=typeof b)return{default:b};var S=z(y);if(S&&S.has(b))return S.get(b);var T={},V=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var R in b)if("default"!==R&&Object.prototype.hasOwnProperty.call(b,R)){var K=V?Object.getOwnPropertyDescriptor(b,R):null;K&&(K.get||K.set)?Object.defineProperty(T,R,K):T[R]=b[R]}return T.default=b,S&&S.set(b,T),T}(Y("./N3DataFactory")),j=Y("readable-stream"),P=(b=Y("./IRIs"))&&b.__esModule?b:{default:b};function z(b){if("function"!=typeof WeakMap)return null;var y=new WeakMap,S=new WeakMap;return(z=function(T){return T?S:y})(b)}class x{constructor(y,S){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,!S&&y&&!y[0]&&(S=y,y=null),this._factory=(S=S||{}).factory||W.default,y&&this.addQuads(y)}get size(){let y=this._size;if(null!==y)return y;y=0;const S=this._graphs;let T,V;for(const R in S)for(const K in T=S[R].subjects)for(const ce in V=T[K])y+=Object.keys(V[ce]).length;return this._size=y}_addToIndex(y,S,T,V){const R=y[S]||(y[S]={}),K=R[T]||(R[T]={}),ce=V in K;return ce||(K[V]=null),!ce}_removeFromIndex(y,S,T,V){const R=y[S],K=R[T];delete K[V];for(const ce in K)return;delete R[T];for(const ce in R)return;delete y[S]}*_findInIndex(y,S,T,V,R,K,ce,D){let I,X,E;const Z=!S+!T+!V>1?Object.keys(this._ids):this._entities,oe=(0,W.termFromId)(D,this._factory);S&&((I=y,y={})[S]=I[S]);for(const se in y){const te=Z[se];if(X=y[se]){T&&((I=X,X={})[T]=I[T]);for(const Ce in X){const me=Z[Ce];if(E=X[Ce]){const ne=V?V in E?[V]:[]:Object.keys(E);for(let _e=0;_e{T in S||(S[T]=!0,y((0,W.termFromId)(this._entities[T],this._factory)))}}add(y){return this.addQuad(y),this}addQuad(y,S,T,V){S||(V=y.graph,T=y.object,S=y.predicate,y=y.subject),y=(0,W.termToId)(y),S=(0,W.termToId)(S),T=(0,W.termToId)(T),V=(0,W.termToId)(V);let R=this._graphs[V];R||(R=this._graphs[V]={subjects:{},predicates:{},objects:{}},Object.freeze(R));const K=this._ids,ce=this._entities;y=K[y]||(K[ce[++this._id]=y]=this._id),S=K[S]||(K[ce[++this._id]=S]=this._id),T=K[T]||(K[ce[++this._id]=T]=this._id);const D=this._addToIndex(R.subjects,y,S,T);return this._addToIndex(R.predicates,S,T,y),this._addToIndex(R.objects,T,y,S),this._size=null,D}addQuads(y){for(let S=0;S{this.addQuad(S)}),y}removeQuad(y,S,T,V){S||(V=y.graph,T=y.object,S=y.predicate,y=y.subject),y=(0,W.termToId)(y),S=(0,W.termToId)(S),T=(0,W.termToId)(T),V=(0,W.termToId)(V);const R=this._ids,K=this._graphs;let ce,D,I;if(!((y=R[y])&&(S=R[S])&&(T=R[T])&&(ce=K[V])&&(D=ce.subjects[y])&&(I=D[S])&&T in I))return!1;for(y in this._removeFromIndex(ce.subjects,y,S,T),this._removeFromIndex(ce.predicates,S,T,y),this._removeFromIndex(ce.objects,T,y,S),null!==this._size&&this._size--,ce.subjects)return!0;return delete K[V],!0}removeQuads(y){for(let S=0;S{this.removeQuad(S)}),y}removeMatches(y,S,T,V){const R=new j.Readable({objectMode:!0});return R._read=()=>{for(const K of this.readQuads(y,S,T,V))R.push(K);R.push(null)},this.remove(R)}deleteGraph(y){return this.removeMatches(null,null,null,y)}getQuads(y,S,T,V){return[...this.readQuads(y,S,T,V)]}*readQuads(y,S,T,V){y=y&&(0,W.termToId)(y),S=S&&(0,W.termToId)(S),T=T&&(0,W.termToId)(T),V=V&&(0,W.termToId)(V);const R=this._getGraphs(V),K=this._ids;let ce,D,I,X;if(!(O(y)&&!(D=K[y])||O(S)&&!(I=K[S])||O(T)&&!(X=K[T])))for(const E in R)(ce=R[E])&&(D?X?yield*this._findInIndex(ce.objects,X,D,I,"object","subject","predicate",E,null,!0):yield*this._findInIndex(ce.subjects,D,I,null,"subject","predicate","object",E,null,!0):I?yield*this._findInIndex(ce.predicates,I,X,null,"predicate","object","subject",E,null,!0):X?yield*this._findInIndex(ce.objects,X,null,null,"object","subject","predicate",E,null,!0):yield*this._findInIndex(ce.subjects,null,null,null,"subject","predicate","object",E,null,!0))}match(y,S,T,V){return new A(this,y,S,T,V)}countQuads(y,S,T,V){y=y&&(0,W.termToId)(y),S=S&&(0,W.termToId)(S),T=T&&(0,W.termToId)(T),V=V&&(0,W.termToId)(V);const R=this._getGraphs(V),K=this._ids;let D,I,X,E,ce=0;if(O(y)&&!(I=K[y])||O(S)&&!(X=K[S])||O(T)&&!(E=K[T]))return 0;for(const $ in R)(D=R[$])&&(ce+=y?T?this._countInIndex(D.objects,E,I,X):this._countInIndex(D.subjects,I,X,E):S?this._countInIndex(D.predicates,X,E,I):this._countInIndex(D.objects,E,I,X));return ce}forEach(y,S,T,V,R){this.some(K=>(y(K),!1),S,T,V,R)}every(y,S,T,V,R){let K=!1;const ce=!this.some(D=>(K=!0,!y(D)),S,T,V,R);return K&&ce}some(y,S,T,V,R){for(const K of this.readQuads(S,T,V,R))if(y(K))return!0;return!1}getSubjects(y,S,T){const V=[];return this.forSubjects(R=>{V.push(R)},y,S,T),V}forSubjects(y,S,T,V){S=S&&(0,W.termToId)(S),T=T&&(0,W.termToId)(T),V=V&&(0,W.termToId)(V);const R=this._ids,K=this._getGraphs(V);let ce,D,I;if(y=this._uniqueEntities(y),!(O(S)&&!(D=R[S])||O(T)&&!(I=R[T])))for(V in K)(ce=K[V])&&(D?I?this._loopBy2Keys(ce.predicates,D,I,y):this._loopByKey1(ce.subjects,D,y):I?this._loopByKey0(ce.objects,I,y):this._loop(ce.subjects,y))}getPredicates(y,S,T){const V=[];return this.forPredicates(R=>{V.push(R)},y,S,T),V}forPredicates(y,S,T,V){S=S&&(0,W.termToId)(S),T=T&&(0,W.termToId)(T),V=V&&(0,W.termToId)(V);const R=this._ids,K=this._getGraphs(V);let ce,D,I;if(y=this._uniqueEntities(y),!(O(S)&&!(D=R[S])||O(T)&&!(I=R[T])))for(V in K)(ce=K[V])&&(D?I?this._loopBy2Keys(ce.objects,I,D,y):this._loopByKey0(ce.subjects,D,y):I?this._loopByKey1(ce.predicates,I,y):this._loop(ce.predicates,y))}getObjects(y,S,T){const V=[];return this.forObjects(R=>{V.push(R)},y,S,T),V}forObjects(y,S,T,V){S=S&&(0,W.termToId)(S),T=T&&(0,W.termToId)(T),V=V&&(0,W.termToId)(V);const R=this._ids,K=this._getGraphs(V);let ce,D,I;if(y=this._uniqueEntities(y),!(O(S)&&!(D=R[S])||O(T)&&!(I=R[T])))for(V in K)(ce=K[V])&&(D?I?this._loopBy2Keys(ce.subjects,D,I,y):this._loopByKey1(ce.objects,D,y):I?this._loopByKey0(ce.predicates,I,y):this._loop(ce.objects,y))}getGraphs(y,S,T){const V=[];return this.forGraphs(R=>{V.push(R)},y,S,T),V}forGraphs(y,S,T,V){for(const R in this._graphs)this.some(K=>(y(K.graph),!0),S,T,V,R)}createBlankNode(y){let S,T;if(y)for(S=y=`_:${y}`,T=1;this._ids[S];)S=y+T++;else do{S="_:b"+this._blankNodeIndex++}while(this._ids[S]);return this._ids[S]=++this._id,this._entities[this._id]=S,this._factory.blankNode(S.substr(2))}extractLists({remove:y=!1,ignoreErrors:S=!1}={}){const T={},V=S?()=>!0:(ce,D)=>{throw new Error(`${ce.value} ${D}`)},R=this.getQuads(null,P.default.rdf.rest,P.default.rdf.nil,null),K=y?[...R]:[];return R.forEach(ce=>{const D=[];let X,E,I=!1;const $=ce.graph;let Z=ce.subject;for(;Z&&!I;){const oe=this.getQuads(null,null,Z,null),se=this.getQuads(Z,null,null,null);let te,Ce=null,me=null,ne=null;for(let _e=0;_e{switch(b){case"data":O=y;break;case"end":A=y}}},(b,y)=>{b&&this.emit("error",b)||y&&this.push(y)},(b,y)=>{this.emit("prefix",b,y)}),this._transform=(b,y,S)=>{O(b),S()},this._flush=b=>{A(),b()}}import(v){return v.on("data",x=>{this.write(x)}),v.on("end",()=>{this.end()}),v.on("error",x=>{this.emit("error",x)}),this}}},{"./N3Parser":37,"readable-stream":81}],40:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.default=void 0;var z,W=Y("readable-stream"),j=(z=Y("./N3Writer"))&&z.__esModule?z:{default:z};he.default=class extends W.Transform{constructor(v){super({encoding:"utf8",writableObjectMode:!0});const x=this._writer=new j.default({write:(O,A,b)=>{this.push(O),b&&b()},end:O=>{this.push(null),O&&O()}},v);this._transform=(O,A,b)=>{x.addQuad(O,b)},this._flush=O=>{x.end(O)}}import(v){return v.on("data",x=>{this.write(x)}),v.on("end",()=>{this.end()}),v.on("error",x=>{this.emit("error",x)}),v.on("prefix",(x,O)=>{this._writer.addPrefix(x,O)}),this}}},{"./N3Writer":42,"readable-stream":81}],41:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.inDefaultGraph=function(y){return x(y.graph)},he.isBlankNode=function(y){return!!y&&"BlankNode"===y.termType},he.isDefaultGraph=x,he.isLiteral=function(y){return!!y&&"Literal"===y.termType},he.isNamedNode=function(y){return!!y&&"NamedNode"===y.termType},he.isVariable=function(y){return!!y&&"Variable"===y.termType},he.prefix=function(y,S){return b({"":y.value||y},S)("")},he.prefixes=b;var y,W=(y=Y("./N3DataFactory"))&&y.__esModule?y:{default:y};function x(y){return!!y&&"DefaultGraph"===y.termType}function b(y,S){const T=Object.create(null);for(const R in y)V(R,y[R]);function V(R,K){if("string"==typeof K){const ce=Object.create(null);T[R]=D=>ce[D]||(ce[D]=S.namedNode(K+D))}else if(!(R in T))throw new Error(`Unknown prefix: ${R}`);return T[R]}return S=S||W.default,V}},{"./N3DataFactory":35}],42:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.default=void 0;var ce,W=(ce=Y("./IRIs"))&&ce.__esModule?ce:{default:ce},j=function(ce,D){if(!D&&ce&&ce.__esModule)return ce;if(null===ce||"object"!=typeof ce&&"function"!=typeof ce)return{default:ce};var I=Q(D);if(I&&I.has(ce))return I.get(ce);var X={},E=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var $ in ce)if("default"!==$&&Object.prototype.hasOwnProperty.call(ce,$)){var Z=E?Object.getOwnPropertyDescriptor(ce,$):null;Z&&(Z.get||Z.set)?Object.defineProperty(X,$,Z):X[$]=ce[$]}return X.default=ce,I&&I.set(ce,X),X}(Y("./N3DataFactory")),P=Y("./N3Util");function Q(ce){if("function"!=typeof WeakMap)return null;var D=new WeakMap,I=new WeakMap;return(Q=function(X){return X?I:D})(ce)}const x=j.default.defaultGraph(),{rdf:O,xsd:A}=W.default,b=/["\\\t\n\r\b\f\u0000-\u0019\ud800-\udbff]/,y=/["\\\t\n\r\b\f\u0000-\u0019]|[\ud800-\udbff][\udc00-\udfff]/g,S={"\\":"\\\\",'"':'\\"',"\t":"\\t","\n":"\\n","\r":"\\r","\b":"\\b","\f":"\\f"};class T extends j.Term{equals(){return!1}}function R(ce){let D=S[ce];return void 0===D&&(1===ce.length?(D=ce.charCodeAt(0).toString(16),D="\\u0000".substr(0,6-D.length)+D):(D=(1024*(ce.charCodeAt(0)-55296)+ce.charCodeAt(1)+9216).toString(16),D="\\U00000000".substr(0,10-D.length)+D)),D}function K(ce){return ce.replace(/[\]\/\(\)\*\+\?\.\\\$]/g,"\\$&")}he.default=class{constructor(D,I){if(this._prefixRegex=/$0^/,D&&"function"!=typeof D.write&&(I=D,D=null),this._lists=(I=I||{}).lists,D)this._outputStream=D,this._endStream=void 0===I.end||!!I.end;else{let X="";this._outputStream={write(E,$,Z){X+=E,Z&&Z()},end:E=>{E&&E(null,X)}},this._endStream=!0}this._subject=null,/triple|quad/i.test(I.format)?(this._lineMode=!0,this._writeQuad=this._writeQuadLine):(this._lineMode=!1,this._graph=x,this._prefixIRIs=Object.create(null),I.prefixes&&this.addPrefixes(I.prefixes),I.baseIRI&&(this._baseMatcher=new RegExp(`^${K(I.baseIRI)}${I.baseIRI.endsWith("/")?"":"[#?]"}`),this._baseLength=I.baseIRI.length))}get _inDefaultGraph(){return x.equals(this._graph)}_write(D,I){this._outputStream.write(D,"utf8",I)}_writeQuad(D,I,X,E,$){try{E.equals(this._graph)||(this._write((null===this._subject?"":this._inDefaultGraph?".\n":"\n}\n")+(x.equals(E)?"":`${this._encodeIriOrBlank(E)} {\n`)),this._graph=E,this._subject=null),D.equals(this._subject)?I.equals(this._predicate)?this._write(`, ${this._encodeObject(X)}`,$):this._write(`;\n ${this._encodePredicate(this._predicate=I)} ${this._encodeObject(X)}`,$):this._write(`${(null===this._subject?"":".\n")+this._encodeSubject(this._subject=D)} ${this._encodePredicate(this._predicate=I)} ${this._encodeObject(X)}`,$)}catch(Z){$&&$(Z)}}_writeQuadLine(D,I,X,E,$){delete this._prefixMatch,this._write(this.quadToString(D,I,X,E),$)}quadToString(D,I,X,E){return`${this._encodeSubject(D)} ${this._encodeIriOrBlank(I)} ${this._encodeObject(X)}${E&&E.value?` ${this._encodeIriOrBlank(E)} .\n`:" .\n"}`}quadsToString(D){return D.map(I=>this.quadToString(I.subject,I.predicate,I.object,I.graph)).join("")}_encodeSubject(D){return"Quad"===D.termType?this._encodeQuad(D):this._encodeIriOrBlank(D)}_encodeIriOrBlank(D){if("NamedNode"!==D.termType)return this._lists&&D.value in this._lists&&(D=this.list(this._lists[D.value])),"id"in D?D.id:`_:${D.value}`;let I=D.value;this._baseMatcher&&this._baseMatcher.test(I)&&(I=I.substr(this._baseLength)),b.test(I)&&(I=I.replace(y,R));const X=this._prefixRegex.exec(I);return X?X[1]?this._prefixIRIs[X[1]]+X[2]:I:`<${I}>`}_encodeLiteral(D){let I=D.value;if(b.test(I)&&(I=I.replace(y,R)),D.language)return`"${I}"@${D.language}`;if(this._lineMode){if(D.datatype.value===A.string)return`"${I}"`}else switch(D.datatype.value){case A.string:return`"${I}"`;case A.boolean:if("true"===I||"false"===I)return I;break;case A.integer:if(/^[+-]?\d+$/.test(I))return I;break;case A.decimal:if(/^[+-]?\d*\.\d+$/.test(I))return I;break;case A.double:if(/^[+-]?(?:\d+\.\d*|\.?\d+)[eE][+-]?\d+$/.test(I))return I}return`"${I}"^^${this._encodeIriOrBlank(D.datatype)}`}_encodePredicate(D){return D.value===O.type?"a":this._encodeIriOrBlank(D)}_encodeObject(D){switch(D.termType){case"Quad":return this._encodeQuad(D);case"Literal":return this._encodeLiteral(D);default:return this._encodeIriOrBlank(D)}}_encodeQuad({subject:D,predicate:I,object:X,graph:E}){return`<<${this._encodeSubject(D)} ${this._encodePredicate(I)} ${this._encodeObject(X)}${(0,P.isDefaultGraph)(E)?"":` ${this._encodeIriOrBlank(E)}`}>>`}_blockedWrite(){throw new Error("Cannot write because the writer has been closed.")}addQuad(D,I,X,E,$){void 0===X?this._writeQuad(D.subject,D.predicate,D.object,D.graph,I):"function"==typeof E?this._writeQuad(D,I,X,x,E):this._writeQuad(D,I,X,E||x,$)}addQuads(D){for(let I=0;I.\n`)}if(X){let E="",$="";for(const Z in this._prefixIRIs)E+=E?`|${Z}`:Z,$+=($?"|":"")+this._prefixIRIs[Z];E=K(E),this._prefixRegex=new RegExp(`^(?:${$})[^/]*$|^(${E})([a-zA-Z][\\-_a-zA-Z0-9]*)$`)}this._write(X?"\n":"",I)}blank(D,I){let E,$,X=D;switch(void 0===D?X=[]:D.termType?X=[{predicate:D,object:I}]:"length"in D||(X=[D]),$=X.length){case 0:return new T("[]");case 1:if(E=X[0],!(E.object instanceof T))return new T(`[ ${this._encodePredicate(E.predicate)} ${this._encodeObject(E.object)} ]`);default:let Z="[";for(let oe=0;oe<$;oe++)E=X[oe],E.predicate.equals(D)?Z+=`, ${this._encodeObject(E.object)}`:(Z+=`${(oe?";\n ":"\n ")+this._encodePredicate(E.predicate)} ${this._encodeObject(E.object)}`,D=E.predicate);return new T(`${Z}\n]`)}}list(D){const I=D&&D.length||0,X=new Array(I);for(let E=0;E{I=null,D(X,E)});if(this._endStream)try{return this._outputStream.end(I)}catch(X){}I&&I()}}},{"./IRIs":34,"./N3DataFactory":35,"./N3Util":41}],43:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),Object.defineProperty(he,"BlankNode",{enumerable:!0,get:function(){return O.BlankNode}}),Object.defineProperty(he,"DataFactory",{enumerable:!0,get:function(){return O.default}}),Object.defineProperty(he,"DefaultGraph",{enumerable:!0,get:function(){return O.DefaultGraph}}),Object.defineProperty(he,"Lexer",{enumerable:!0,get:function(){return W.default}}),Object.defineProperty(he,"Literal",{enumerable:!0,get:function(){return O.Literal}}),Object.defineProperty(he,"NamedNode",{enumerable:!0,get:function(){return O.NamedNode}}),Object.defineProperty(he,"Parser",{enumerable:!0,get:function(){return j.default}}),Object.defineProperty(he,"Quad",{enumerable:!0,get:function(){return O.Quad}}),Object.defineProperty(he,"Store",{enumerable:!0,get:function(){return Q.default}}),Object.defineProperty(he,"StreamParser",{enumerable:!0,get:function(){return z.default}}),Object.defineProperty(he,"StreamWriter",{enumerable:!0,get:function(){return v.default}}),Object.defineProperty(he,"Term",{enumerable:!0,get:function(){return O.Term}}),Object.defineProperty(he,"Triple",{enumerable:!0,get:function(){return O.Triple}}),he.Util=void 0,Object.defineProperty(he,"Variable",{enumerable:!0,get:function(){return O.Variable}}),Object.defineProperty(he,"Writer",{enumerable:!0,get:function(){return P.default}}),he.default=void 0,Object.defineProperty(he,"termFromId",{enumerable:!0,get:function(){return O.termFromId}}),Object.defineProperty(he,"termToId",{enumerable:!0,get:function(){return O.termToId}});var W=y(Y("./N3Lexer")),j=y(Y("./N3Parser")),P=y(Y("./N3Writer")),Q=y(Y("./N3Store")),z=y(Y("./N3StreamParser")),v=y(Y("./N3StreamWriter")),x=b(Y("./N3Util"));he.Util=x;var O=b(Y("./N3DataFactory"));function A(T){if("function"!=typeof WeakMap)return null;var V=new WeakMap,R=new WeakMap;return(A=function(K){return K?R:V})(T)}function b(T,V){if(!V&&T&&T.__esModule)return T;if(null===T||"object"!=typeof T&&"function"!=typeof T)return{default:T};var R=A(V);if(R&&R.has(T))return R.get(T);var K={},ce=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var D in T)if("default"!==D&&Object.prototype.hasOwnProperty.call(T,D)){var I=ce?Object.getOwnPropertyDescriptor(T,D):null;I&&(I.get||I.set)?Object.defineProperty(K,D,I):K[D]=T[D]}return K.default=T,R&&R.set(T,K),K}function y(T){return T&&T.__esModule?T:{default:T}}he.default={Lexer:W.default,Parser:j.default,Writer:P.default,Store:Q.default,StreamParser:z.default,StreamWriter:v.default,Util:x,DataFactory:O.default,Term:O.Term,NamedNode:O.NamedNode,Literal:O.Literal,BlankNode:O.BlankNode,Variable:O.Variable,DefaultGraph:O.DefaultGraph,Quad:O.Quad,Triple:O.Triple,termFromId:O.termFromId,termToId:O.termToId}},{"./N3DataFactory":35,"./N3Lexer":36,"./N3Parser":37,"./N3Store":38,"./N3StreamParser":39,"./N3StreamWriter":40,"./N3Util":41,"./N3Writer":42}],44:[function(Y,Se,he){var j,P,W=Se.exports={};function Q(){throw new Error("setTimeout has not been defined")}function z(){throw new Error("clearTimeout has not been defined")}function v(K){if(j===setTimeout)return setTimeout(K,0);if((j===Q||!j)&&setTimeout)return j=setTimeout,setTimeout(K,0);try{return j(K,0)}catch(ce){try{return j.call(null,K,0)}catch(D){return j.call(this,K,0)}}}!function(){try{j="function"==typeof setTimeout?setTimeout:Q}catch(K){j=Q}try{P="function"==typeof clearTimeout?clearTimeout:z}catch(K){P=z}}();var b,O=[],A=!1,y=-1;function S(){!A||!b||(A=!1,b.length?O=b.concat(O):y=-1,O.length&&T())}function T(){if(!A){var K=v(S);A=!0;for(var ce=O.length;ce;){for(b=O,O=[];++y1)for(var D=1;D(j||(j=Promise.resolve())).then(P).catch(Q=>setTimeout(()=>{throw Q},0))}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],46:[function(Y,Se,he){Se.exports=Y("./lib")},{"./lib":55}],47:[function(Y,Se,he){"use strict";Se.exports=class Hq{constructor(j,P=new Map,Q=0){this.prefix=j,this._existing=P,this.counter=Q}clone(){const{prefix:j,_existing:P,counter:Q}=this;return new Hq(j,new Map(P),Q)}getId(j){const P=j&&this._existing.get(j);if(P)return P;const Q=this.prefix+this.counter;return this.counter++,j&&this._existing.set(j,Q),Q}hasId(j){return this._existing.has(j)}getOldIds(){return[...this._existing.keys()]}}},{}],48:[function(Y,Se,he){"use strict";Y("setimmediate");const W=self.crypto||self.msCrypto;Se.exports=class{constructor(P){if(!W||!W.subtle)throw new Error("crypto.subtle not found.");if("sha256"===P)this.algorithm={name:"SHA-256"};else{if("sha1"!==P)throw new Error(`Unsupport algorithm "${P}".`);this.algorithm={name:"SHA-1"}}this._content=""}update(P){this._content+=P}digest(){var P=this;return yt(function*(){const Q=(new TextEncoder).encode(P._content),z=new Uint8Array(yield W.subtle.digest(P.algorithm,Q));let v="";for(let x=0;x]*)>)|(_:(?:[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]*$'),Se.exports=class a2{static parse(K){const ce=[],D={},I=K.split(A.eoln);let X=0;for(const E of I){if(X++,A.empty.test(E))continue;const $=E.match(A.quad);if(null===$)throw new Error("N-Quads parse error on line "+X+".");const Z={subject:null,predicate:null,object:null,graph:null};if(Z.subject=void 0!==$[1]?{termType:z,value:$[1]}:{termType:v,value:$[2]},Z.predicate={termType:z,value:$[3]},void 0!==$[4]?Z.object={termType:z,value:$[4]}:void 0!==$[5]?Z.object={termType:v,value:$[5]}:(Z.object={termType:x,value:void 0,datatype:{termType:z}},void 0!==$[7]?Z.object.datatype.value=$[7]:void 0!==$[8]?(Z.object.datatype.value=P,Z.object.language=$[8]):Z.object.datatype.value=Q,Z.object.value=$[6].replace(T,function(K,ce,D,I){if(ce)switch(ce){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(I)throw new Error("Unsupported U escape")})),Z.graph=void 0!==$[9]?{termType:z,value:$[9]}:void 0!==$[10]?{termType:v,value:$[10]}:{termType:O,value:""},Z.graph.value in D){let oe=!0;const se=D[Z.graph.value];for(const te of se)if(b(te,Z)){oe=!1;break}oe&&(se.push(Z),ce.push(Z))}else D[Z.graph.value]=[Z],ce.push(Z)}return ce}static serialize(K){Array.isArray(K)||(K=a2.legacyDatasetToQuads(K));const ce=[];for(const D of K)ce.push(a2.serializeQuad(D));return ce.sort().join("")}static serializeQuad(K){const ce=K.subject,I=K.object,X=K.graph;let E="";return E+=ce.termType===z?`<${ce.value}>`:`${ce.value}`,E+=` <${K.predicate.value}> `,I.termType===z?E+=`<${I.value}>`:I.termType===v?E+=I.value:(E+=`"${R=I.value,R.replace(y,function(K){switch(K){case'"':return'\\"';case"\\":return"\\\\";case"\n":return"\\n";case"\r":return"\\r"}})}"`,I.datatype.value===P?I.language&&(E+=`@${I.language}`):I.datatype.value!==Q&&(E+=`^^<${I.datatype.value}>`)),X.termType===z?E+=` <${X.value}>`:X.termType===v&&(E+=` ${X.value}`),E+=" .\n",E;var R}static legacyDatasetToQuads(K){const ce=[],D={"blank node":v,IRI:z,literal:x};for(const I in K)K[I].forEach(E=>{const $={};for(const Z in E){const oe=E[Z],se={termType:D[oe.type],value:oe.value};se.termType===x&&(se.datatype={termType:z},"datatype"in oe&&(se.datatype.value=oe.datatype),"language"in oe?("datatype"in oe||(se.datatype.value=P),se.language=oe.language):"datatype"in oe||(se.datatype.value=Q)),$[Z]=se}$.graph="@default"===I?{termType:O,value:""}:{termType:I.startsWith("_:")?v:z,value:I},ce.push($)});return ce}};const y=/["\\\n\r]/g;const T=/(?:\\([tbnrf"'\\]))|(?:\\u([0-9A-Fa-f]{4}))|(?:\\U([0-9A-Fa-f]{8}))/g},{}],50:[function(Y,Se,he){"use strict";Se.exports=class{constructor(j){this.current=j.sort(),this.done=!1,this.dir=new Map;for(let P=0;Pz)&&(b&&O>0&&A>j[O-1]||!b&&Oj[O+1])&&(z=A,v=O)}if(null===z)this.done=!0;else{const O=P.get(z)?v-1:v+1;j[v]=j[O],j[O]=z;for(const A of j)A>z&&P.set(A,!P.get(A))}return Q}}},{}],51:[function(Y,Se,he){(function(W){(function(){"use strict";const j=Y("./IdentifierIssuer"),P=Y("./MessageDigest"),Q=Y("./Permuter"),z=Y("./NQuads");function v(x,O){return x.hashO.hash?1:0}Se.exports=class{constructor(){this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new j("_:c14n"),this.hashAlgorithm="sha256",this.quads=null}main(O){var A=this;return yt(function*(){A.quads=O;for(const K of O)A._addBlankNodeQuadInfo({quad:K,component:K.subject}),A._addBlankNodeQuadInfo({quad:K,component:K.object}),A._addBlankNodeQuadInfo({quad:K,component:K.graph});const b=new Map,y=[...A.blankNodeInfo.keys()];let S=0;for(const K of y)++S%100==0&&(yield A._yield()),yield A._hashAndTrackBlankNode({id:K,hashToBlankNodes:b});const T=[...b.keys()].sort(),V=[];for(const K of T){const ce=b.get(K);ce.length>1?V.push(ce):A.canonicalIssuer.getId(ce[0])}for(const K of V){const ce=[];for(const D of K){if(A.canonicalIssuer.hasId(D))continue;const I=new j("_:b");I.getId(D);const X=yield A.hashNDegreeQuads(D,I);ce.push(X)}ce.sort(v);for(const D of ce){const I=D.issuer.getOldIds();for(const X of I)A.canonicalIssuer.getId(X)}}const R=[];for(const K of A.quads){const ce=ot({},K);ce.subject=A._useCanonicalId({component:ce.subject}),ce.object=A._useCanonicalId({component:ce.object}),ce.graph=A._useCanonicalId({component:ce.graph}),R.push(z.serializeQuad(ce))}return R.sort(),R.join("")})()}hashFirstDegreeQuads(O){var A=this;return yt(function*(){const b=[],y=A.blankNodeInfo.get(O),S=y.quads;for(const V of S){const R={subject:null,predicate:V.predicate,object:null,graph:null};R.subject=A.modifyFirstDegreeComponent(O,V.subject,"subject"),R.object=A.modifyFirstDegreeComponent(O,V.object,"object"),R.graph=A.modifyFirstDegreeComponent(O,V.graph,"graph"),b.push(z.serializeQuad(R))}b.sort();const T=new P(A.hashAlgorithm);for(const V of b)T.update(V);return y.hash=yield T.digest(),y.hash})()}hashRelatedBlankNode(O,A,b,y){var S=this;return yt(function*(){let T;T=S.canonicalIssuer.hasId(O)?S.canonicalIssuer.getId(O):b.hasId(O)?b.getId(O):S.blankNodeInfo.get(O).hash;const V=new P(S.hashAlgorithm);return V.update(y),"g"!==y&&V.update(S.getRelatedPredicate(A)),V.update(T),V.digest()})()}hashNDegreeQuads(O,A){var b=this;return yt(function*(){const y=new P(b.hashAlgorithm),S=yield b.createHashToRelated(O,A),T=[...S.keys()].sort();for(const V of T){y.update(V);let K,R="";const ce=new Q(S.get(V));let D=0;for(;ce.hasNext();){const I=ce.next();++D%3==0&&(yield b._yield());let X=A.clone(),E="";const $=[];let Z=!1;for(const oe of I)if(b.canonicalIssuer.hasId(oe)?E+=b.canonicalIssuer.getId(oe):(X.hasId(oe)||$.push(oe),E+=X.getId(oe)),0!==R.length&&E>R){Z=!0;break}if(!Z){for(const oe of $){const se=yield b.hashNDegreeQuads(oe,X);if(E+=X.getId(oe),E+=`<${se.hash}>`,X=se.issuer,0!==R.length&&E>R){Z=!0;break}}Z||(0===R.length||E`}createHashToRelated(O,A){var b=this;return yt(function*(){const y=new Map,S=b.blankNodeInfo.get(O).quads;let T=0;for(const V of S)++T%100==0&&(yield b._yield()),yield Promise.all([b._addRelatedBlankNodeHash({quad:V,component:V.subject,position:"s",id:O,issuer:A,hashToRelated:y}),b._addRelatedBlankNodeHash({quad:V,component:V.object,position:"o",id:O,issuer:A,hashToRelated:y}),b._addRelatedBlankNodeHash({quad:V,component:V.graph,position:"g",id:O,issuer:A,hashToRelated:y})]);return y})()}_hashAndTrackBlankNode({id:O,hashToBlankNodes:A}){var b=this;return yt(function*(){const y=yield b.hashFirstDegreeQuads(O),S=A.get(y);S?S.push(O):A.set(y,[O])})()}_addBlankNodeQuadInfo({quad:O,component:A}){if("BlankNode"!==A.termType)return;const b=A.value,y=this.blankNodeInfo.get(b);y?y.quads.add(O):this.blankNodeInfo.set(b,{quads:new Set([O]),hash:null})}_addRelatedBlankNodeHash({quad:O,component:A,position:b,id:y,issuer:S,hashToRelated:T}){var V=this;return yt(function*(){if("BlankNode"!==A.termType||A.value===y)return;const R=A.value,K=yield V.hashRelatedBlankNode(R,O,S,b),ce=T.get(K);ce?ce.push(R):T.set(K,[R])})()}_useCanonicalId({component:O}){return"BlankNode"!==O.termType||O.value.startsWith(this.canonicalIssuer.prefix)?O:{termType:"BlankNode",value:this.canonicalIssuer.getId(O.value)}}_yield(){return yt(function*(){return new Promise(O=>W(O))})()}}}).call(this)}).call(this,Y("timers").setImmediate)},{"./IdentifierIssuer":47,"./MessageDigest":48,"./NQuads":49,"./Permuter":50,timers:89}],52:[function(Y,Se,he){"use strict";const W=Y("./IdentifierIssuer"),j=Y("./MessageDigest"),P=Y("./Permuter"),Q=Y("./NQuads");function z(v,x){return v.hashx.hash?1:0}Se.exports=class{constructor(){this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new W("_:c14n"),this.hashAlgorithm="sha256",this.quads=null}main(x){this.quads=x;for(const T of x)this._addBlankNodeQuadInfo({quad:T,component:T.subject}),this._addBlankNodeQuadInfo({quad:T,component:T.object}),this._addBlankNodeQuadInfo({quad:T,component:T.graph});const O=new Map,A=[...this.blankNodeInfo.keys()];for(const T of A)this._hashAndTrackBlankNode({id:T,hashToBlankNodes:O});const b=[...O.keys()].sort(),y=[];for(const T of b){const V=O.get(T);V.length>1?y.push(V):this.canonicalIssuer.getId(V[0])}for(const T of y){const V=[];for(const R of T){if(this.canonicalIssuer.hasId(R))continue;const K=new W("_:b");K.getId(R);const ce=this.hashNDegreeQuads(R,K);V.push(ce)}V.sort(z);for(const R of V){const K=R.issuer.getOldIds();for(const ce of K)this.canonicalIssuer.getId(ce)}}const S=[];for(const T of this.quads){const V=ot({},T);V.subject=this._useCanonicalId({component:V.subject}),V.object=this._useCanonicalId({component:V.object}),V.graph=this._useCanonicalId({component:V.graph}),S.push(Q.serializeQuad(V))}return S.sort(),S.join("")}hashFirstDegreeQuads(x){const O=[],A=this.blankNodeInfo.get(x),b=A.quads;for(const S of b){const T={subject:null,predicate:S.predicate,object:null,graph:null};T.subject=this.modifyFirstDegreeComponent(x,S.subject,"subject"),T.object=this.modifyFirstDegreeComponent(x,S.object,"object"),T.graph=this.modifyFirstDegreeComponent(x,S.graph,"graph"),O.push(Q.serializeQuad(T))}O.sort();const y=new j(this.hashAlgorithm);for(const S of O)y.update(S);return A.hash=y.digest(),A.hash}hashRelatedBlankNode(x,O,A,b){let y;y=this.canonicalIssuer.hasId(x)?this.canonicalIssuer.getId(x):A.hasId(x)?A.getId(x):this.blankNodeInfo.get(x).hash;const S=new j(this.hashAlgorithm);return S.update(b),"g"!==b&&S.update(this.getRelatedPredicate(O)),S.update(y),S.digest()}hashNDegreeQuads(x,O){const A=new j(this.hashAlgorithm),b=this.createHashToRelated(x,O),y=[...b.keys()].sort();for(const S of y){A.update(S);let V,T="";const R=new P(b.get(S));for(;R.hasNext();){const K=R.next();let ce=O.clone(),D="";const I=[];let X=!1;for(const E of K)if(this.canonicalIssuer.hasId(E)?D+=this.canonicalIssuer.getId(E):(ce.hasId(E)||I.push(E),D+=ce.getId(E)),0!==T.length&&D>T){X=!0;break}if(!X){for(const E of I){const $=this.hashNDegreeQuads(E,ce);if(D+=ce.getId(E),D+=`<${$.hash}>`,ce=$.issuer,0!==T.length&&D>T){X=!0;break}}X||(0===T.length||D`}createHashToRelated(x,O){const A=new Map,b=this.blankNodeInfo.get(x).quads;for(const y of b)this._addRelatedBlankNodeHash({quad:y,component:y.subject,position:"s",id:x,issuer:O,hashToRelated:A}),this._addRelatedBlankNodeHash({quad:y,component:y.object,position:"o",id:x,issuer:O,hashToRelated:A}),this._addRelatedBlankNodeHash({quad:y,component:y.graph,position:"g",id:x,issuer:O,hashToRelated:A});return A}_hashAndTrackBlankNode({id:x,hashToBlankNodes:O}){const A=this.hashFirstDegreeQuads(x),b=O.get(A);b?b.push(x):O.set(A,[x])}_addBlankNodeQuadInfo({quad:x,component:O}){if("BlankNode"!==O.termType)return;const A=O.value,b=this.blankNodeInfo.get(A);b?b.quads.add(x):this.blankNodeInfo.set(A,{quads:new Set([x]),hash:null})}_addRelatedBlankNodeHash({quad:x,component:O,position:A,id:b,issuer:y,hashToRelated:S}){if("BlankNode"!==O.termType||O.value===b)return;const T=O.value,V=this.hashRelatedBlankNode(T,x,y,A),R=S.get(V);R?R.push(T):S.set(V,[T])}_useCanonicalId({component:x}){return"BlankNode"!==x.termType||x.value.startsWith(this.canonicalIssuer.prefix)?x:{termType:"BlankNode",value:this.canonicalIssuer.getId(x.value)}}}},{"./IdentifierIssuer":47,"./MessageDigest":48,"./NQuads":49,"./Permuter":50}],53:[function(Y,Se,he){"use strict";const W=Y("./URDNA2015");Se.exports=class extends W{constructor(){super(),this.name="URGNA2012",this.hashAlgorithm="sha1"}modifyFirstDegreeComponent(P,Q,z){return"BlankNode"!==Q.termType?Q:"graph"===z?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:Q.value===P?"_:a":"_:z"}}getRelatedPredicate(P){return P.predicate.value}createHashToRelated(P,Q){var z=this;return yt(function*(){const v=new Map,x=z.blankNodeInfo.get(P).quads;let O=0;for(const A of x){let b,y;if("BlankNode"===A.subject.termType&&A.subject.value!==P)y=A.subject.value,b="p";else{if("BlankNode"!==A.object.termType||A.object.value===P)continue;y=A.object.value,b="r"}++O%100==0&&(yield z._yield());const S=yield z.hashRelatedBlankNode(y,A,Q,b),T=v.get(S);T?T.push(y):v.set(S,[y])}return v})()}}},{"./URDNA2015":51}],54:[function(Y,Se,he){"use strict";const W=Y("./URDNA2015Sync");Se.exports=class extends W{constructor(){super(),this.name="URGNA2012",this.hashAlgorithm="sha1"}modifyFirstDegreeComponent(P,Q,z){return"BlankNode"!==Q.termType?Q:"graph"===z?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:Q.value===P?"_:a":"_:z"}}getRelatedPredicate(P){return P.predicate.value}createHashToRelated(P,Q){const z=new Map,v=this.blankNodeInfo.get(P).quads;for(const x of v){let O,A;if("BlankNode"===x.subject.termType&&x.subject.value!==P)A=x.subject.value,O="p";else{if("BlankNode"!==x.object.termType||x.object.value===P)continue;A=x.object.value,O="r"}const b=this.hashRelatedBlankNode(A,x,Q,O),y=z.get(b);y?y.push(A):z.set(b,[A])}return z}}},{"./URDNA2015Sync":52}],55:[function(Y,Se,he){"use strict";const W=Y("./URDNA2015"),j=Y("./URGNA2012"),P=Y("./URDNA2015Sync"),Q=Y("./URGNA2012Sync");let z;try{z=Y("rdf-canonize-native")}catch(x){}const v={};Se.exports=v,v.NQuads=Y("./NQuads"),v.IdentifierIssuer=Y("./IdentifierIssuer"),v._rdfCanonizeNative=function(x){return x&&(z=x),z},v.canonize=function(){var x=yt(function*(O,A){if(Array.isArray(O)||(O=v.NQuads.legacyDatasetToQuads(O)),A.useNative){if(!z)throw new Error("rdf-canonize-native not available");return new Promise((b,y)=>z.canonize(O,A,(S,T)=>S?y(S):b(T)))}if("URDNA2015"===A.algorithm)return new W(A).main(O);if("URGNA2012"===A.algorithm)return new j(A).main(O);throw"algorithm"in A?new Error("Invalid RDF Dataset Canonicalization algorithm: "+A.algorithm):new Error("No RDF Dataset Canonicalization algorithm specified.")});return function(O,A){return x.apply(this,arguments)}}(),v._canonizeSync=function(x,O){if(Array.isArray(x)||(x=v.NQuads.legacyDatasetToQuads(x)),O.useNative){if(z)return z.canonizeSync(x,O);throw new Error("rdf-canonize-native not available")}if("URDNA2015"===O.algorithm)return new P(O).main(x);if("URGNA2012"===O.algorithm)return new Q(O).main(x);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(Y,Se,he){"use strict";var W=this&&this.__createBinding||(Object.create?function(P,Q,z,v){void 0===v&&(v=z),Object.defineProperty(P,v,{enumerable:!0,get:function(){return Q[z]}})}:function(P,Q,z,v){void 0===v&&(v=z),P[v]=Q[z]}),j=this&&this.__exportStar||function(P,Q){for(var z in P)"default"!==z&&!Object.prototype.hasOwnProperty.call(Q,z)&&W(Q,P,z)};Object.defineProperty(he,"__esModule",{value:!0}),j(Y("./lib/BlankNode"),he),j(Y("./lib/DataFactory"),he),j(Y("./lib/DefaultGraph"),he),j(Y("./lib/Literal"),he),j(Y("./lib/NamedNode"),he),j(Y("./lib/Quad"),he),j(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,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.BlankNode=void 0;he.BlankNode=class{constructor(P){this.termType="BlankNode",this.value=P}equals(P){return!!P&&"BlankNode"===P.termType&&P.value===this.value}}},{}],58:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.DataFactory=void 0;const W=Y("./BlankNode"),j=Y("./DefaultGraph"),P=Y("./Literal"),Q=Y("./NamedNode"),z=Y("./Quad"),v=Y("./Variable");let x=0;he.DataFactory=class{constructor(b){this.blankNodeCounter=0,this.blankNodePrefix=(b=b||{}).blankNodePrefix||`df_${x++}_`}namedNode(b){return new Q.NamedNode(b)}blankNode(b){return new W.BlankNode(b||`${this.blankNodePrefix}${this.blankNodeCounter++}`)}literal(b,y){return new P.Literal(b,y)}variable(b){return new v.Variable(b)}defaultGraph(){return j.DefaultGraph.INSTANCE}quad(b,y,S,T){return new z.Quad(b,y,S,T||this.defaultGraph())}fromTerm(b){switch(b.termType){case"NamedNode":return this.namedNode(b.value);case"BlankNode":return this.blankNode(b.value);case"Literal":return b.language?this.literal(b.value,b.language):b.datatype.equals(P.Literal.XSD_STRING)?this.literal(b.value):this.literal(b.value,this.fromTerm(b.datatype));case"Variable":return this.variable(b.value);case"DefaultGraph":return this.defaultGraph();case"Quad":return this.quad(this.fromTerm(b.subject),this.fromTerm(b.predicate),this.fromTerm(b.object),this.fromTerm(b.graph))}}fromQuad(b){return this.fromTerm(b)}resetBlankNodeCounter(){this.blankNodeCounter=0}}},{"./BlankNode":57,"./DefaultGraph":59,"./Literal":60,"./NamedNode":61,"./Quad":62,"./Variable":63}],59:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.DefaultGraph=void 0;class W{constructor(){this.termType="DefaultGraph",this.value=""}equals(P){return!!P&&"DefaultGraph"===P.termType}}he.DefaultGraph=W,W.INSTANCE=new W},{}],60:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.Literal=void 0;const W=Y("./NamedNode");class j{constructor(Q,z){this.termType="Literal",this.value=Q,"string"==typeof z?(this.language=z,this.datatype=j.RDF_LANGUAGE_STRING):z?(this.language="",this.datatype=z):(this.language="",this.datatype=j.XSD_STRING)}equals(Q){return!!Q&&"Literal"===Q.termType&&Q.value===this.value&&Q.language===this.language&&Q.datatype.equals(this.datatype)}}he.Literal=j,j.RDF_LANGUAGE_STRING=new W.NamedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),j.XSD_STRING=new W.NamedNode("http://www.w3.org/2001/XMLSchema#string")},{"./NamedNode":61}],61:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.NamedNode=void 0;he.NamedNode=class{constructor(P){this.termType="NamedNode",this.value=P}equals(P){return!!P&&"NamedNode"===P.termType&&P.value===this.value}}},{}],62:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.Quad=void 0;he.Quad=class{constructor(P,Q,z,v){this.termType="Quad",this.value="",this.subject=P,this.predicate=Q,this.object=z,this.graph=v}equals(P){return!!P&&("Quad"===P.termType||!P.termType)&&this.subject.equals(P.subject)&&this.predicate.equals(P.predicate)&&this.object.equals(P.object)&&this.graph.equals(P.graph)}}},{}],63:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.Variable=void 0;he.Variable=class{constructor(P){this.termType="Variable",this.value=P}equals(P){return!!P&&"Variable"===P.termType&&P.value===this.value}}},{}],64:[function(Y,Se,he){"use strict";var W=this&&this.__createBinding||(Object.create?function(P,Q,z,v){void 0===v&&(v=z),Object.defineProperty(P,v,{enumerable:!0,get:function(){return Q[z]}})}:function(P,Q,z,v){void 0===v&&(v=z),P[v]=Q[z]}),j=this&&this.__exportStar||function(P,Q){for(var z in P)"default"!==z&&!Object.prototype.hasOwnProperty.call(Q,z)&&W(Q,P,z)};Object.defineProperty(he,"__esModule",{value:!0}),j(Y("./lib/RdfXmlParser"),he)},{"./lib/RdfXmlParser":66}],65:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.ParseError=void 0;class W extends Error{constructor(P,Q){const z=P.saxStream._parser;super(P.trackPosition?`Line ${z.line+1} column ${z.column+1}: ${Q}`:Q)}}he.ParseError=W},{}],66:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.ParseType=he.RdfXmlParser=void 0;const W=Y("relative-to-absolute-iri"),j=Y("sax"),P=Y("stream"),Q=Y("./ParseError"),z=Y("rdf-data-factory");class v extends P.Transform{constructor(A){super({readableObjectMode:!0}),this.activeTagStack=[],this.nodeIds={},A&&(Object.assign(this,A),this.options=A),this.dataFactory||(this.dataFactory=new z.DataFactory),this.baseIRI||(this.baseIRI=""),this.defaultGraph||(this.defaultGraph=this.dataFactory.defaultGraph()),this.saxStream=j.createStream(this.strict,{xmlns:!1,position:this.trackPosition}),this.strict||(this.saxStream._parser.looseCase="toString"),this.attachSaxListeners()}static parseNamespace(A,b){const y={};let S=!1;for(const V in A.attributes)V.startsWith("xmlns")&&(5===V.length?(S=!0,y[""]=A.attributes[V]):":"===V.charAt(5)&&(S=!0,y[V.substr(6)]=A.attributes[V]));const T=b&&b.ns?b.ns:[v.DEFAULT_NS];return S?T.concat([y]):T}static expandPrefixedTerm(A,b,y){const S=A.indexOf(":");let T,V;S>=0?(T=A.substr(0,S),V=A.substr(S+1)):(T="",V=A);let R=null,K=null;for(let ce=b.length-1;ce>=0;ce--){const D=b[ce][T];if(D){R=D;break}K||(K=b[ce][""])}if(!R){if(T&&"xmlns"!==T)throw new Q.ParseError(y,`The prefix '${T}' in term '${A}' was not bound.`);R=K||""}return{prefix:T,local:V,uri:R}}static isValidIri(A){return v.IRI_REGEX.test(A)}import(A){const b=new P.PassThrough({readableObjectMode:!0});A.on("error",S=>y.emit("error",S)),A.on("data",S=>b.push(S)),A.on("end",()=>b.push(null));const y=b.pipe(new v(this.options));return y}_transform(A,b,y){try{this.saxStream.write(A,b)}catch(S){return y(S)}y()}newParseError(A){return new Q.ParseError(this,A)}valueToUri(A,b){return this.uriToNamedNode(W.resolve(A,b.baseIRI))}uriToNamedNode(A){if(!v.isValidIri(A))throw this.newParseError(`Invalid URI: ${A}`);return this.dataFactory.namedNode(A)}validateNcname(A){if(!v.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 b=this.activeTagStack.length?this.activeTagStack[this.activeTagStack.length-1]:null;let y=x.RESOURCE;if(b&&(b.hadChildren=!0,y=b.childrenParseType),b&&b.childrenStringTags){const T=A.name;let V="";for(const D in A.attributes)V+=` ${D}="${A.attributes[D]}"`;b.childrenStringTags.push(`<${T}${V}>`);const ce={childrenStringTags:b.childrenStringTags};return ce.childrenStringEmitClosingTag=``,void this.activeTagStack.push(ce)}const S={};b?(S.language=b.language,S.baseIRI=b.baseIRI):S.baseIRI=this.baseIRI,this.activeTagStack.push(S),S.ns=v.parseNamespace(A,b),y===x.RESOURCE?this.onTagResource(A,S,b,!b):this.onTagProperty(A,S,b)}onTagResource(A,b,y,S){const T=v.expandPrefixedTerm(A.name,b.ns,this);b.childrenParseType=x.PROPERTY;let V=!0;if(T.uri===v.RDF){if(!S&&v.FORBIDDEN_NODE_ELEMENTS.indexOf(T.local)>=0)throw this.newParseError(`Illegal node element name: ${T.local}`);switch(T.local){case"RDF":b.childrenParseType=x.RESOURCE;case"Description":V=!1}}const R=[],K=[];let ce=null,D=!1,I=!1,X=null;for(const E in A.attributes){const $=A.attributes[E],Z=v.expandPrefixedTerm(E,b.ns,this);if(y&&Z.uri===v.RDF)switch(Z.local){case"about":if(ce)throw this.newParseError(`Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ${$} and ${ce} where found.`);ce=$;continue;case"ID":if(ce)throw this.newParseError(`Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ${$} and ${ce} where found.`);this.validateNcname($),ce="#"+$,D=!0;continue;case"nodeID":if(ce)throw this.newParseError(`Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ${$} and ${ce} where found.`);this.validateNcname($),ce=$,I=!0;continue;case"bagID":throw this.newParseError("rdf:bagID is not supported.");case"type":X=$;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(Z.uri===v.XML){if("lang"===Z.local){b.language=""===$?null:$.toLowerCase();continue}if("base"===Z.local){b.baseIRI=W.resolve($,b.baseIRI);continue}}"xml"!==Z.prefix&&Z.uri&&(R.push(this.uriToNamedNode(Z.uri+Z.local)),K.push($))}if(null!==ce&&(b.subject=I?this.dataFactory.blankNode(ce):this.valueToUri(ce,b),D&&this.claimNodeId(b.subject)),b.subject||(b.subject=this.dataFactory.blankNode()),V){const E=this.uriToNamedNode(T.uri+T.local);this.emitTriple(b.subject,this.dataFactory.namedNode(v.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(v.RDF+"first"),b.subject,b.reifiedStatementId),y.childrenCollectionSubject=E,y.childrenCollectionPredicate=this.dataFactory.namedNode(v.RDF+"rest")}else{this.emitTriple(y.subject,y.predicate,b.subject,y.reifiedStatementId);for(let E=0;E=0)throw this.newParseError(`Illegal property element name: ${S.local}`);b.predicateSubPredicates=[],b.predicateSubObjects=[];let T=!1,V=!1,R=null,K=!0;const ce=[],D=[];for(const I in A.attributes){const X=A.attributes[I],E=v.expandPrefixedTerm(I,b.ns,this);if(E.uri===v.RDF)switch(E.local){case"resource":if(R)throw this.newParseError(`Found both rdf:resource (${X}) and rdf:nodeID (${R}).`);if(T)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:resource (${X})`);b.hadChildren=!0,R=X,K=!1;continue;case"datatype":if(V)throw this.newParseError(`Found both non-rdf:* property attributes and rdf:datatype (${X}).`);if(T)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:datatype (${X})`);b.datatype=this.valueToUri(X,b);continue;case"nodeID":if(V)throw this.newParseError(`Found both non-rdf:* property attributes and rdf:nodeID (${X}).`);if(b.hadChildren)throw this.newParseError(`Found both rdf:resource and rdf:nodeID (${X}).`);if(T)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:nodeID (${X})`);this.validateNcname(X),b.hadChildren=!0,R=X,K=!0;continue;case"bagID":throw this.newParseError("rdf:bagID is not supported.");case"parseType":if(V)throw this.newParseError("rdf:parseType is not allowed when non-rdf:* property attributes are present");if(b.datatype)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:datatype (${b.datatype.value})`);if(R)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:nodeID or rdf:resource (${R})`);if("Resource"===X){T=!0,b.childrenParseType=x.PROPERTY;const $=this.dataFactory.blankNode();this.emitTriple(b.subject,b.predicate,$,b.reifiedStatementId),b.subject=$,b.predicate=null}else"Collection"===X?(T=!0,b.hadChildren=!0,b.childrenCollectionSubject=b.subject,b.childrenCollectionPredicate=b.predicate,K=!1):"Literal"===X&&(T=!0,b.childrenTagsToString=!0,b.childrenStringTags=[]);continue;case"ID":this.validateNcname(X),b.reifiedStatementId=this.valueToUri("#"+X,b),this.claimNodeId(b.reifiedStatementId);continue}else if(E.uri===v.XML&&"lang"===E.local){b.language=""===X?null:X.toLowerCase();continue}if("xml"!==E.prefix&&"xmlns"!==E.prefix&&E.uri){if(T||b.datatype)throw this.newParseError(`Found illegal rdf:* properties on property element with attribute: ${X}`);b.hadChildren=!0,V=!0,ce.push(this.uriToNamedNode(E.uri+E.local)),D.push(this.dataFactory.literal(X,b.datatype||b.language))}}if(null!==R){const I=b.subject;b.subject=K?this.dataFactory.blankNode(R):this.valueToUri(R,b),this.emitTriple(I,b.predicate,b.subject,b.reifiedStatementId);for(let X=0;X/g,(b,y,S)=>(this.saxStream._parser.ENTITIES[y]=S,""))}}var x,O;he.RdfXmlParser=v,v.IRI_REGEX=/^([A-Za-z][A-Za-z0-9+-.]*):[^ "<>{}|\\\[\]`]*$/,v.MIME_TYPE="application/rdf+xml",v.RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#",v.XML="http://www.w3.org/XML/1998/namespace",v.XMLNS="http://www.w3.org/2000/xmlns/",v.DEFAULT_NS={xml:v.XML},v.FORBIDDEN_NODE_ELEMENTS=["RDF","ID","about","bagID","parseType","resource","nodeID","li","aboutEach","aboutEachPrefix"],v.FORBIDDEN_PROPERTY_ELEMENTS=["Description","RDF","ID","about","bagID","parseType","resource","nodeID","aboutEach","aboutEachPrefix"],v.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=x=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(Y,Se,he){"use strict";var j={};function P(O,A,b){b||(b=Error);var S=function(T){function V(R,K,ce){return T.call(this,function(T,V,R){return"string"==typeof A?A:A(T,V,R)}(R,K,ce))||this}return function(O,A){O.prototype=Object.create(A.prototype),O.prototype.constructor=O,O.__proto__=A}(V,T),V}(b);S.prototype.name=b.name,S.prototype.code=O,j[O]=S}function Q(O,A){if(Array.isArray(O)){var b=O.length;return O=O.map(function(y){return String(y)}),b>2?"one of ".concat(A," ").concat(O.slice(0,b-1).join(", "),", or ")+O[b-1]:2===b?"one of ".concat(A," ").concat(O[0]," or ").concat(O[1]):"of ".concat(A," ").concat(O[0])}return"of ".concat(A," ").concat(String(O))}P("ERR_INVALID_OPT_VALUE",function(O,A){return'The value "'+A+'" is invalid for option "'+O+'"'},TypeError),P("ERR_INVALID_ARG_TYPE",function(O,A,b){var y,S;if("string"==typeof A&&function(O,A,b){return O.substr(!b||b<0?0:+b,A.length)===A}(A,"not ")?(y="must not be",A=A.replace(/^not /,"")):y="must be",function(O,A,b){return(void 0===b||b>O.length)&&(b=O.length),O.substring(b-A.length,b)===A}(O," argument"))S="The ".concat(O," ").concat(y," ").concat(Q(A,"type"));else{var T=function(O,A,b){return"number"!=typeof b&&(b=0),!(b+A.length>O.length)&&-1!==O.indexOf(A,b)}(O,".")?"property":"argument";S='The "'.concat(O,'" ').concat(T," ").concat(y," ").concat(Q(A,"type"))}return S+". Received type ".concat(typeof b)},TypeError),P("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),P("ERR_METHOD_NOT_IMPLEMENTED",function(O){return"The "+O+" method is not implemented"}),P("ERR_STREAM_PREMATURE_CLOSE","Premature close"),P("ERR_STREAM_DESTROYED",function(O){return"Cannot call "+O+" after a stream was destroyed"}),P("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),P("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),P("ERR_STREAM_WRITE_AFTER_END","write after end"),P("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),P("ERR_UNKNOWN_ENCODING",function(O){return"Unknown encoding: "+O},TypeError),P("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),Se.exports.codes=j},{}],68:[function(Y,Se,he){(function(W){(function(){"use strict";var j=Object.keys||function(y){var S=[];for(var T in y)S.push(T);return S};Se.exports=O;var P=Y("./_stream_readable"),Q=Y("./_stream_writable");Y("inherits")(O,P);for(var z=j(Q.prototype),v=0;v0)if("string"!=typeof L&&!Qe.objectMode&&Object.getPrototypeOf(L)!==x.prototype&&(L=function(ve){return x.from(ve)}(L)),B)Qe.endEmitted?se(ve,new E):Ie(ve,Qe,L,!0);else if(Qe.ended)se(ve,new I);else{if(Qe.destroyed)return!1;Qe.reading=!1,Qe.decoder&&!N?(L=Qe.decoder.write(L),Qe.objectMode||0!==L.length?Ie(ve,Qe,L,!1):Ke(ve,Qe)):Ie(ve,Qe,L,!1)}else B||(Qe.reading=!1,Ke(ve,Qe));return!Qe.ended&&(Qe.lengthL.highWaterMark&&(L.highWaterMark=function(ve){return ve>=st?ve=st:(ve--,ve|=ve>>>1,ve|=ve>>>2,ve|=ve>>>4,ve|=ve>>>8,ve|=ve>>>16,ve++),ve}(ve)),ve<=L.length?ve:L.ended?L.length:(L.needReadable=!0,0))}function Ue(ve){var L=ve._readableState;S("emitReadable",L.needReadable,L.emittedReadable),L.needReadable=!1,L.emittedReadable||(S("emitReadable",L.flowing),L.emittedReadable=!0,W.nextTick(ke,ve))}function ke(ve){var L=ve._readableState;S("emitReadable_",L.destroyed,L.length,L.ended),!L.destroyed&&(L.length||L.ended)&&(ve.emit("readable"),L.emittedReadable=!1),L.needReadable=!L.flowing&&!L.ended&&L.length<=L.highWaterMark,pe(ve)}function Ke(ve,L){L.readingMore||(L.readingMore=!0,W.nextTick(Me,ve,L))}function Me(ve,L){for(;!L.reading&&!L.ended&&(L.length0,L.resumeScheduled&&!L.paused?L.flowing=!0:ve.listenerCount("data")>0&&ve.resume()}function Ne(ve){S("readable nexttick read 0"),ve.read(0)}function G(ve,L){S("resume",L.reading),L.reading||ve.read(0),L.resumeScheduled=!1,ve.emit("resume"),pe(ve),L.flowing&&!L.reading&&ve.read(0)}function pe(ve){var L=ve._readableState;for(S("flow",L.flowing);L.flowing&&null!==ve.read(););}function ue(ve,L){return 0===L.length?null:(L.objectMode?N=L.buffer.shift():!ve||ve>=L.length?(N=L.decoder?L.buffer.join(""):1===L.buffer.length?L.buffer.first():L.buffer.concat(L.length),L.buffer.clear()):N=L.buffer.consume(ve,L.decoder),N);var N}function je(ve){var L=ve._readableState;S("endReadable",L.endEmitted),L.endEmitted||(L.ended=!0,W.nextTick(_t,L,ve))}function _t(ve,L){if(S("endReadableNT",ve.endEmitted,ve.length),!ve.endEmitted&&0===ve.length&&(ve.endEmitted=!0,L.readable=!1,L.emit("end"),ve.autoDestroy)){var N=L._writableState;(!N||N.autoDestroy&&N.finished)&&L.destroy()}}function pt(ve,L){for(var N=0,B=ve.length;N=L.highWaterMark:L.length>0)||L.ended))return S("read: emitReadable",L.length,L.ended),0===L.length&&L.ended?je(this):Ue(this),null;if(0===(ve=tt(ve,L))&&L.ended)return 0===L.length&&je(this),null;var Re,B=L.needReadable;return S("need readable",B),(0===L.length||L.length-ve0?ue(ve,L):null)?(L.needReadable=L.length<=L.highWaterMark,ve=0):(L.length-=ve,L.awaitDrain=0),0===L.length&&(L.ended||(L.needReadable=!0),N!==ve&&L.ended&&je(this)),null!==Re&&this.emit("data",Re),Re},ne.prototype._read=function(ve){se(this,new X("_read()"))},ne.prototype.pipe=function(ve,L){var N=this,B=this._readableState;switch(B.pipesCount){case 0:B.pipes=ve;break;case 1:B.pipes=[B.pipes,ve];break;default:B.pipes.push(ve)}B.pipesCount+=1,S("pipe count=%d opts=%j",B.pipesCount,L);var Qe=L&&!1===L.end||ve===W.stdout||ve===W.stderr?gs:Nt;function St(Bs,Qr){S("onunpipe"),Bs===N&&Qr&&!1===Qr.hasUnpiped&&(Qr.hasUnpiped=!0,S("cleanup"),ve.removeListener("close",Xr),ve.removeListener("finish",Ls),ve.removeListener("drain",On),ve.removeListener("error",wi),ve.removeListener("unpipe",St),N.removeListener("end",Nt),N.removeListener("end",gs),N.removeListener("data",Ti),kn=!0,B.awaitDrain&&(!ve._writableState||ve._writableState.needDrain)&&On())}function Nt(){S("onend"),ve.end()}B.endEmitted?W.nextTick(Qe):N.once("end",Qe),ve.on("unpipe",St);var On=function(ve){return function(){var N=ve._readableState;S("pipeOnDrain",N.awaitDrain),N.awaitDrain&&N.awaitDrain--,0===N.awaitDrain&&z(ve,"data")&&(N.flowing=!0,pe(ve))}}(N);ve.on("drain",On);var kn=!1;function Ti(Bs){S("ondata");var Qr=ve.write(Bs);S("dest.write",Qr),!1===Qr&&((1===B.pipesCount&&B.pipes===ve||B.pipesCount>1&&-1!==pt(B.pipes,ve))&&!kn&&(S("false write response, pause",B.awaitDrain),B.awaitDrain++),N.pause())}function wi(Bs){S("onerror",Bs),gs(),ve.removeListener("error",wi),0===z(ve,"error")&&se(ve,Bs)}function Xr(){ve.removeListener("finish",Ls),gs()}function Ls(){S("onfinish"),ve.removeListener("close",Xr),gs()}function gs(){S("unpipe"),N.unpipe(ve)}return N.on("data",Ti),function(ve,L,N){if("function"==typeof ve.prependListener)return ve.prependListener(L,N);ve._events&&ve._events[L]?Array.isArray(ve._events[L])?ve._events[L].unshift(N):ve._events[L]=[N,ve._events[L]]:ve.on(L,N)}(ve,"error",wi),ve.once("close",Xr),ve.once("finish",Ls),ve.emit("pipe",N),B.flowing||(S("pipe resume"),N.resume()),ve},ne.prototype.unpipe=function(ve){var L=this._readableState,N={hasUnpiped:!1};if(0===L.pipesCount)return this;if(1===L.pipesCount)return ve&&ve!==L.pipes||(ve||(ve=L.pipes),L.pipes=null,L.pipesCount=0,L.flowing=!1,ve&&ve.emit("unpipe",this,N)),this;if(!ve){var B=L.pipes,Re=L.pipesCount;L.pipes=null,L.pipesCount=0,L.flowing=!1;for(var Qe=0;Qe0,!1!==B.flowing&&this.resume()):"readable"===ve&&!B.endEmitted&&!B.readableListening&&(B.readableListening=B.needReadable=!0,B.flowing=!1,B.emittedReadable=!1,S("on readable",B.length,B.reading),B.length?Ue(this):B.reading||W.nextTick(Ne,this)),N},ne.prototype.removeListener=function(ve,L){var N=v.prototype.removeListener.call(this,ve,L);return"readable"===ve&&W.nextTick($e,this),N},ne.prototype.removeAllListeners=function(ve){var L=v.prototype.removeAllListeners.apply(this,arguments);return("readable"===ve||void 0===ve)&&W.nextTick($e,this),L},ne.prototype.resume=function(){var ve=this._readableState;return ve.flowing||(S("resume"),ve.flowing=!ve.readableListening,function(ve,L){L.resumeScheduled||(L.resumeScheduled=!0,W.nextTick(G,ve,L))}(this,ve)),ve.paused=!1,this},ne.prototype.pause=function(){return S("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(S("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},ne.prototype.wrap=function(ve){var L=this,N=this._readableState,B=!1;for(var Re in ve.on("end",function(){if(S("wrapped end"),N.decoder&&!N.ended){var St=N.decoder.end();St&&St.length&&L.push(St)}L.push(null)}),ve.on("data",function(St){S("wrapped data"),N.decoder&&(St=N.decoder.write(St)),N.objectMode&&null==St||!(N.objectMode||St&&St.length)||L.push(St)||(B=!0,ve.pause())}),ve)void 0===this[Re]&&"function"==typeof ve[Re]&&(this[Re]=function(Nt){return function(){return ve[Nt].apply(ve,arguments)}}(Re));for(var Qe=0;Qe-1))throw new Z(ue);return this._writableState.defaultEncoding=ue,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(pe,ue,je){je(new ce("_write()"))},me.prototype._writev=null,me.prototype.end=function(pe,ue,je){var _t=this._writableState;return"function"==typeof pe?(je=pe,pe=null,ue=null):"function"==typeof ue&&(je=ue,ue=null),null!=pe&&this.write(pe,ue),_t.corked&&(_t.corked=1,this.uncork()),_t.ending||function(pe,ue,je){ue.ending=!0,Ne(pe,ue),je&&(ue.finished?W.nextTick(je):pe.once("finish",je)),ue.ended=!0,pe.writable=!1}(this,_t,je),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(ue){!this._writableState||(this._writableState.destroyed=ue)}}),me.prototype.destroy=S.destroy,me.prototype._undestroy=S.undestroy,me.prototype._destroy=function(pe,ue){ue(pe)}}).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,Se,he){(function(W){(function(){"use strict";var j;function P(I,X,E){return X in I?Object.defineProperty(I,X,{value:E,enumerable:!0,configurable:!0,writable:!0}):I[X]=E,I}var Q=Y("./end-of-stream"),z=Symbol("lastResolve"),v=Symbol("lastReject"),x=Symbol("error"),O=Symbol("ended"),A=Symbol("lastPromise"),b=Symbol("handlePromise"),y=Symbol("stream");function S(I,X){return{value:I,done:X}}function T(I){var X=I[z];if(null!==X){var E=I[y].read();null!==E&&(I[A]=null,I[z]=null,I[v]=null,X(S(E,!1)))}}function V(I){W.nextTick(T,I)}var K=Object.getPrototypeOf(function(){}),ce=Object.setPrototypeOf((P(j={get stream(){return this[y]},next:function(){var X=this,E=this[x];if(null!==E)return Promise.reject(E);if(this[O])return Promise.resolve(S(void 0,!0));if(this[y].destroyed)return new Promise(function(se,te){W.nextTick(function(){X[x]?te(X[x]):se(S(void 0,!0))})});var Z,$=this[A];if($)Z=new Promise(function(I,X){return function(E,$){I.then(function(){X[O]?E(S(void 0,!0)):X[b](E,$)},$)}}($,this));else{var oe=this[y].read();if(null!==oe)return Promise.resolve(S(oe,!1));Z=new Promise(this[b])}return this[A]=Z,Z}},Symbol.asyncIterator,function(){return this}),P(j,"return",function(){var X=this;return new Promise(function(E,$){X[y].destroy(null,function(Z){Z?$(Z):E(S(void 0,!0))})})}),j),K);Se.exports=function(X){var E,$=Object.create(ce,(P(E={},y,{value:X,writable:!0}),P(E,z,{value:null,writable:!0}),P(E,v,{value:null,writable:!0}),P(E,x,{value:null,writable:!0}),P(E,O,{value:X._readableState.endEmitted,writable:!0}),P(E,b,{value:function(oe,se){var te=$[y].read();te?($[A]=null,$[z]=null,$[v]=null,oe(S(te,!1))):($[z]=oe,$[v]=se)},writable:!0}),E));return $[A]=null,Q(X,function(Z){if(Z&&"ERR_STREAM_PREMATURE_CLOSE"!==Z.code){var oe=$[v];return null!==oe&&($[A]=null,$[z]=null,$[v]=null,oe(Z)),void($[x]=Z)}var se=$[z];null!==se&&($[A]=null,$[z]=null,$[v]=null,se(S(void 0,!0))),$[O]=!0}),X.on("readable",V.bind(null,$)),$}}).call(this)}).call(this,Y("_process"))},{"./end-of-stream":76,_process:44}],74:[function(Y,Se,he){"use strict";function W(T,V){var R=Object.keys(T);if(Object.getOwnPropertySymbols){var K=Object.getOwnPropertySymbols(T);V&&(K=K.filter(function(ce){return Object.getOwnPropertyDescriptor(T,ce).enumerable})),R.push.apply(R,K)}return R}function P(T,V,R){return V in T?Object.defineProperty(T,V,{value:R,enumerable:!0,configurable:!0,writable:!0}):T[V]=R,T}function z(T,V){for(var R=0;R0?this.tail.next=K:this.head=K,this.tail=K,++this.length}},{key:"unshift",value:function(R){var K={data:R,next:this.head};0===this.length&&(this.tail=K),this.head=K,++this.length}},{key:"shift",value:function(){if(0!==this.length){var R=this.head.data;return this.head=1===this.length?this.tail=null:this.head.next,--this.length,R}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(R){if(0===this.length)return"";for(var K=this.head,ce=""+K.data;K=K.next;)ce+=R+K.data;return ce}},{key:"concat",value:function(R){if(0===this.length)return O.alloc(0);for(var K=O.allocUnsafe(R>>>0),ce=this.head,D=0;ce;)S(ce.data,K,D),D+=ce.data.length,ce=ce.next;return K}},{key:"consume",value:function(R,K){var ce;return RI.length?I.length:R;if(D+=X===I.length?I:I.slice(0,R),0==(R-=X)){X===I.length?(++ce,this.head=K.next?K.next:this.tail=null):(this.head=K,K.data=I.slice(X));break}++ce}return this.length-=ce,D}},{key:"_getBuffer",value:function(R){var K=O.allocUnsafe(R),ce=this.head,D=1;for(ce.data.copy(K),R-=ce.data.length;ce=ce.next;){var I=ce.data,X=R>I.length?I.length:R;if(I.copy(K,K.length-R,0,X),0==(R-=X)){X===I.length?(++D,this.head=ce.next?ce.next:this.tail=null):(this.head=ce,ce.data=I.slice(X));break}++D}return this.length-=D,K}},{key:y,value:function(R,K){return b(this,function(T){for(var V=1;V0,function(Z){ce||(ce=Z),Z&&D.forEach(A),!E&&(D.forEach(A),K(ce))})});return V.reduce(b)}},{"../../../errors":67,"./end-of-stream":76}],79:[function(Y,Se,he){"use strict";var W=Y("../../../errors").codes.ERR_INVALID_OPT_VALUE;Se.exports={getHighWaterMark:function(Q,z,v,x){var O=function(Q,z,v){return null!=Q.highWaterMark?Q.highWaterMark:z?Q[v]:null}(z,x,v);if(null!=O){if(!isFinite(O)||Math.floor(O)!==O||O<0)throw new W(x?v:"highWaterMark",O);return Math.floor(O)}return Q.objectMode?16:16384}}},{"../../../errors":67}],80:[function(Y,Se,he){Se.exports=Y("events").EventEmitter},{events:8}],81:[function(Y,Se,he){(he=Se.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,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),function(j){for(var P in j)he.hasOwnProperty(P)||(he[P]=j[P])}(Y("./lib/Resolve"))},{"./lib/Resolve":83}],83:[function(Y,Se,he){"use strict";function j(z){const v=[];let x=0;for(;xO.join("")).join("/")}function P(z,v){let x=v+1;v>=0?"/"===z[v+1]&&"/"===z[v+2]&&(x=v+3):"/"===z[0]&&"/"===z[1]&&(x=2);const O=z.indexOf("/",x);return O<0?z:z.substr(0,O)+j(z.substr(O))}function Q(z){return!z||"#"===z||"?"===z||"/"===z}Object.defineProperty(he,"__esModule",{value:!0}),he.resolve=function(z,v){const x=(v=v||"").indexOf("#");if(x>0&&(v=v.substr(0,x)),!z.length){if(v.indexOf(":")<0)throw new Error(`Found invalid baseIRI '${v}' for value '${z}'`);return v}if(z.startsWith("?")){const V=v.indexOf("?");return V>0&&(v=v.substr(0,V)),v+z}if(z.startsWith("#"))return v+z;if(!v.length){const V=z.indexOf(":");if(V<0)throw new Error(`Found invalid relative IRI '${z}' for a missing baseIRI`);return P(z,V)}const O=z.indexOf(":");if(O>=0)return P(z,O);const A=v.indexOf(":");if(A<0)throw new Error(`Found invalid baseIRI '${v}' for value '${z}'`);const b=v.substr(0,A+1);if(0===z.indexOf("//"))return b+P(z,O);let y;if(v.indexOf("//",A)===A+1){if(y=v.indexOf("/",A+3),y<0)return v.length>A+3?v+"/"+P(z,O):b+P(z,O)}else if(y=v.indexOf("/",A+1),y<0)return b+P(z,O);if(0===z.indexOf("/"))return v.substr(0,y)+j(z);let S=v.substr(y);const T=S.lastIndexOf("/");return T>=0&&T"===ue?(ne(G,"onsgmldeclaration",G.sgmlDecl),G.sgmlDecl="",G.state=te.TEXT):($(ue)&&(G.state=te.SGML_DECL_QUOTED),G.sgmlDecl+=ue);continue;case te.SGML_DECL_QUOTED:ue===G.q&&(G.state=te.SGML_DECL,G.q=""),G.sgmlDecl+=ue;continue;case te.DOCTYPE:">"===ue?(G.state=te.TEXT,ne(G,"ondoctype",G.doctype),G.doctype=!0):(G.doctype+=ue,"["===ue?G.state=te.DOCTYPE_DTD:$(ue)&&(G.state=te.DOCTYPE_QUOTED,G.q=ue));continue;case te.DOCTYPE_QUOTED:G.doctype+=ue,ue===G.q&&(G.q="",G.state=te.DOCTYPE);continue;case te.DOCTYPE_DTD:G.doctype+=ue,"]"===ue?G.state=te.DOCTYPE:$(ue)&&(G.state=te.DOCTYPE_DTD_QUOTED,G.q=ue);continue;case te.DOCTYPE_DTD_QUOTED:G.doctype+=ue,ue===G.q&&(G.state=te.DOCTYPE_DTD,G.q="");continue;case te.COMMENT:"-"===ue?G.state=te.COMMENT_ENDING:G.comment+=ue;continue;case te.COMMENT_ENDING:"-"===ue?(G.state=te.COMMENT_ENDED,G.comment=Ie(G.opt,G.comment),G.comment&&ne(G,"oncomment",G.comment),G.comment=""):(G.comment+="-"+ue,G.state=te.COMMENT);continue;case te.COMMENT_ENDED:">"!==ue?(Xe(G,"Malformed comment"),G.comment+="--"+ue,G.state=te.COMMENT):G.state=te.TEXT;continue;case te.CDATA:"]"===ue?G.state=te.CDATA_ENDING:G.cdata+=ue;continue;case te.CDATA_ENDING:"]"===ue?G.state=te.CDATA_ENDING_2:(G.cdata+="]"+ue,G.state=te.CDATA);continue;case te.CDATA_ENDING_2:">"===ue?(G.cdata&&ne(G,"oncdata",G.cdata),ne(G,"onclosecdata"),G.cdata="",G.state=te.TEXT):"]"===ue?G.cdata+="]":(G.cdata+="]]"+ue,G.state=te.CDATA);continue;case te.PROC_INST:"?"===ue?G.state=te.PROC_INST_ENDING:E(ue)?G.state=te.PROC_INST_BODY:G.procInstName+=ue;continue;case te.PROC_INST_BODY:if(!G.procInstBody&&E(ue))continue;"?"===ue?G.state=te.PROC_INST_ENDING:G.procInstBody+=ue;continue;case te.PROC_INST_ENDING:">"===ue?(ne(G,"onprocessinginstruction",{name:G.procInstName,body:G.procInstBody}),G.procInstName=G.procInstBody="",G.state=te.TEXT):(G.procInstBody+="?"+ue,G.state=te.PROC_INST_BODY);continue;case te.OPEN_TAG:oe(D,ue)?G.tagName+=ue:(tt(G),">"===ue?ke(G):"/"===ue?G.state=te.OPEN_TAG_SLASH:(E(ue)||Xe(G,"Invalid character in tag name"),G.state=te.ATTRIB));continue;case te.OPEN_TAG_SLASH:">"===ue?(ke(G,!0),Ke(G)):(Xe(G,"Forward-slash in opening tag not followed by >"),G.state=te.ATTRIB);continue;case te.ATTRIB:if(E(ue))continue;">"===ue?ke(G):"/"===ue?G.state=te.OPEN_TAG_SLASH:oe(ce,ue)?(G.attribName=ue,G.attribValue="",G.state=te.ATTRIB_NAME):Xe(G,"Invalid attribute name");continue;case te.ATTRIB_NAME:"="===ue?G.state=te.ATTRIB_VALUE:">"===ue?(Xe(G,"Attribute without value"),G.attribValue=G.attribName,Ue(G),ke(G)):E(ue)?G.state=te.ATTRIB_NAME_SAW_WHITE:oe(D,ue)?G.attribName+=ue:Xe(G,"Invalid attribute name");continue;case te.ATTRIB_NAME_SAW_WHITE:if("="===ue)G.state=te.ATTRIB_VALUE;else{if(E(ue))continue;Xe(G,"Attribute without value"),G.tag.attributes[G.attribName]="",G.attribValue="",ne(G,"onattribute",{name:G.attribName,value:""}),G.attribName="",">"===ue?ke(G):oe(ce,ue)?(G.attribName=ue,G.state=te.ATTRIB_NAME):(Xe(G,"Invalid attribute name"),G.state=te.ATTRIB)}continue;case te.ATTRIB_VALUE:if(E(ue))continue;$(ue)?(G.q=ue,G.state=te.ATTRIB_VALUE_QUOTED):(Xe(G,"Unquoted attribute value"),G.state=te.ATTRIB_VALUE_UNQUOTED,G.attribValue=ue);continue;case te.ATTRIB_VALUE_QUOTED:if(ue!==G.q){"&"===ue?G.state=te.ATTRIB_VALUE_ENTITY_Q:G.attribValue+=ue;continue}Ue(G),G.q="",G.state=te.ATTRIB_VALUE_CLOSED;continue;case te.ATTRIB_VALUE_CLOSED:E(ue)?G.state=te.ATTRIB:">"===ue?ke(G):"/"===ue?G.state=te.OPEN_TAG_SLASH:oe(ce,ue)?(Xe(G,"No whitespace between attributes"),G.attribName=ue,G.attribValue="",G.state=te.ATTRIB_NAME):Xe(G,"Invalid attribute name");continue;case te.ATTRIB_VALUE_UNQUOTED:if(!Z(ue)){"&"===ue?G.state=te.ATTRIB_VALUE_ENTITY_U:G.attribValue+=ue;continue}Ue(G),">"===ue?ke(G):G.state=te.ATTRIB;continue;case te.CLOSE_TAG:if(G.tagName)">"===ue?Ke(G):oe(D,ue)?G.tagName+=ue:G.script?(G.script+=""===ue?Ke(G):Xe(G,"Invalid characters in closing tag");continue;case te.TEXT_ENTITY:case te.ATTRIB_VALUE_ENTITY_Q:case te.ATTRIB_VALUE_ENTITY_U:var pt,ve;switch(G.state){case te.TEXT_ENTITY:pt=te.TEXT,ve="textNode";break;case te.ATTRIB_VALUE_ENTITY_Q:pt=te.ATTRIB_VALUE_QUOTED,ve="attribValue";break;case te.ATTRIB_VALUE_ENTITY_U:pt=te.ATTRIB_VALUE_UNQUOTED,ve="attribValue"}";"===ue?(G[ve]+=Me(G),G.entity="",G.state=pt):oe(G.entity.length?X:I,ue)?G.entity+=ue:(Xe(G,"Invalid character in entity name"),G[ve]+="&"+G.entity+ue,G.entity="",G.state=pt);continue;default:throw new Error(G,"Unknown state: "+G.state)}return G.position>=G.bufferCheckPosition&&function(q){for(var G=Math.max(j.MAX_BUFFER_LENGTH,10),pe=0,ue=0,je=P.length;ueG)switch(P[ue]){case"textNode":_e(q);break;case"cdata":ne(q,"oncdata",q.cdata),q.cdata="";break;case"script":ne(q,"onscript",q.script),q.script="";break;default:Ge(q,"Max buffer length exceeded: "+P[ue])}pe=Math.max(pe,_t)}q.bufferCheckPosition=j.MAX_BUFFER_LENGTH-pe+q.position}(G),G},resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){!function(q){_e(q),""!==q.cdata&&(ne(q,"oncdata",q.cdata),q.cdata=""),""!==q.script&&(ne(q,"onscript",q.script),q.script="")}(this)}};try{O=Y("stream").Stream}catch(q){O=function(){}}var A=j.EVENTS.filter(function(q){return"error"!==q&&"end"!==q});function y(q,G){if(!(this instanceof y))return new y(q,G);O.apply(this),this._parser=new Q(q,G),this.writable=!0,this.readable=!0;var pe=this;this._parser.onend=function(){pe.emit("end")},this._parser.onerror=function(ue){pe.emit("error",ue),pe._parser.error=null},this._decoder=null,A.forEach(function(ue){Object.defineProperty(pe,"on"+ue,{get:function(){return pe._parser["on"+ue]},set:function(je){if(!je)return pe.removeAllListeners(ue),pe._parser["on"+ue]=je,je;pe.on(ue,je)},enumerable:!0,configurable:!1})})}(y.prototype=Object.create(O.prototype,{constructor:{value:y}})).write=function(q){if("function"==typeof W&&"function"==typeof W.isBuffer&&W.isBuffer(q)){if(!this._decoder){var G=Y("string_decoder").StringDecoder;this._decoder=new G("utf8")}q=this._decoder.write(q)}return this._parser.write(q.toString()),this.emit("data",q),!0},y.prototype.end=function(q){return q&&q.length&&this.write(q),this._parser.end(),!0},y.prototype.on=function(q,G){var pe=this;return!pe._parser["on"+q]&&-1!==A.indexOf(q)&&(pe._parser["on"+q]=function(){var ue=1===arguments.length?[arguments[0]]:Array.apply(null,arguments);ue.splice(0,0,q),pe.emit.apply(pe,ue)}),O.prototype.on.call(pe,q,G)};var V="http://www.w3.org/XML/1998/namespace",R="http://www.w3.org/2000/xmlns/",K={xml:V,xmlns:R},ce=/[:_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-]/,I=/[#:_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]/,X=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;function E(q){return" "===q||"\n"===q||"\r"===q||"\t"===q}function $(q){return'"'===q||"'"===q}function Z(q){return">"===q||E(q)}function oe(q,G){return q.test(G)}function se(q,G){return!oe(q,G)}var q,G,pe,te=0;for(var Ce in j.STATE={BEGIN:te++,BEGIN_WHITESPACE:te++,TEXT:te++,TEXT_ENTITY:te++,OPEN_WAKA:te++,SGML_DECL:te++,SGML_DECL_QUOTED:te++,DOCTYPE:te++,DOCTYPE_QUOTED:te++,DOCTYPE_DTD:te++,DOCTYPE_DTD_QUOTED:te++,COMMENT_STARTING:te++,COMMENT:te++,COMMENT_ENDING:te++,COMMENT_ENDED:te++,CDATA:te++,CDATA_ENDING:te++,CDATA_ENDING_2:te++,PROC_INST:te++,PROC_INST_BODY:te++,PROC_INST_ENDING:te++,OPEN_TAG:te++,OPEN_TAG_SLASH:te++,ATTRIB:te++,ATTRIB_NAME:te++,ATTRIB_NAME_SAW_WHITE:te++,ATTRIB_VALUE:te++,ATTRIB_VALUE_QUOTED:te++,ATTRIB_VALUE_CLOSED:te++,ATTRIB_VALUE_UNQUOTED:te++,ATTRIB_VALUE_ENTITY_Q:te++,ATTRIB_VALUE_ENTITY_U:te++,CLOSE_TAG:te++,CLOSE_TAG_SAW_WHITE:te++,SCRIPT:te++,SCRIPT_ENDING:te++},j.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},j.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(j.ENTITIES).forEach(function(q){var G=j.ENTITIES[q],pe="number"==typeof G?String.fromCharCode(G):G;j.ENTITIES[q]=pe}),j.STATE)j.STATE[j.STATE[Ce]]=Ce;function me(q,G,pe){q[G]&&q[G](pe)}function ne(q,G,pe){q.textNode&&_e(q),me(q,G,pe)}function _e(q){q.textNode=Ie(q.opt,q.textNode),q.textNode&&me(q,"ontext",q.textNode),q.textNode=""}function Ie(q,G){return q.trim&&(G=G.trim()),q.normalize&&(G=G.replace(/\s+/g," ")),G}function Ge(q,G){return _e(q),q.trackPosition&&(G+="\nLine: "+q.line+"\nColumn: "+q.column+"\nChar: "+q.c),G=new Error(G),q.error=G,me(q,"onerror",G),q}function st(q){return q.sawRoot&&!q.closedRoot&&Xe(q,"Unclosed root tag"),q.state!==te.BEGIN&&q.state!==te.BEGIN_WHITESPACE&&q.state!==te.TEXT&&Ge(q,"Unexpected end"),_e(q),q.c="",q.closed=!0,me(q,"onend"),Q.call(q,q.strict,q.opt),q}function Xe(q,G){if("object"!=typeof q||!(q instanceof Q))throw new Error("bad call to strictFail");q.strict&&Ge(q,G)}function tt(q){q.strict||(q.tagName=q.tagName[q.looseCase]());var G=q.tags[q.tags.length-1]||q,pe=q.tag={name:q.tagName,attributes:{}};q.opt.xmlns&&(pe.ns=G.ns),q.attribList.length=0,ne(q,"onopentagstart",pe)}function Ye(q,G){var ue=q.indexOf(":")<0?["",q]:q.split(":"),je=ue[0],_t=ue[1];return G&&"xmlns"===q&&(je="xmlns",_t=""),{prefix:je,local:_t}}function Ue(q){if(q.strict||(q.attribName=q.attribName[q.looseCase]()),-1!==q.attribList.indexOf(q.attribName)||q.tag.attributes.hasOwnProperty(q.attribName))q.attribName=q.attribValue="";else{if(q.opt.xmlns){var G=Ye(q.attribName,!0),ue=G.local;if("xmlns"===G.prefix)if("xml"===ue&&q.attribValue!==V)Xe(q,"xml: prefix must be bound to "+V+"\nActual: "+q.attribValue);else if("xmlns"===ue&&q.attribValue!==R)Xe(q,"xmlns: prefix must be bound to "+R+"\nActual: "+q.attribValue);else{var je=q.tag,_t=q.tags[q.tags.length-1]||q;je.ns===_t.ns&&(je.ns=Object.create(_t.ns)),je.ns[ue]=q.attribValue}q.attribList.push([q.attribName,q.attribValue])}else q.tag.attributes[q.attribName]=q.attribValue,ne(q,"onattribute",{name:q.attribName,value:q.attribValue});q.attribName=q.attribValue=""}}function ke(q,G){if(q.opt.xmlns){var pe=q.tag,ue=Ye(q.tagName);pe.prefix=ue.prefix,pe.local=ue.local,pe.uri=pe.ns[ue.prefix]||"",pe.prefix&&!pe.uri&&(Xe(q,"Unbound namespace prefix: "+JSON.stringify(q.tagName)),pe.uri=ue.prefix),pe.ns&&(q.tags[q.tags.length-1]||q).ns!==pe.ns&&Object.keys(pe.ns).forEach(function(On){ne(q,"onopennamespace",{prefix:On,uri:pe.ns[On]})});for(var _t=0,pt=q.attribList.length;_t",q.tagName="",void(q.state=te.SCRIPT);ne(q,"onscript",q.script),q.script=""}var G=q.tags.length,pe=q.tagName;q.strict||(pe=pe[q.looseCase]());for(var ue=pe;G--&&q.tags[G].name!==ue;)Xe(q,"Unexpected close tag");if(G<0)return Xe(q,"Unmatched closing tag: "+q.tagName),q.textNode+="",void(q.state=te.TEXT);q.tagName=pe;for(var _t=q.tags.length;_t-- >G;){var pt=q.tag=q.tags.pop();q.tagName=q.tag.name,ne(q,"onclosetag",q.tagName);var ve={};for(var L in pt.ns)ve[L]=pt.ns[L];q.opt.xmlns&&pt.ns!==(q.tags[q.tags.length-1]||q).ns&&Object.keys(pt.ns).forEach(function(B){ne(q,"onclosenamespace",{prefix:B,uri:pt.ns[B]})})}0===G&&(q.closedRoot=!0),q.tagName=q.attribValue=q.attribName="",q.attribList.length=0,q.state=te.TEXT}function Me(q){var ue,G=q.entity,pe=G.toLowerCase(),je="";return q.ENTITIES[G]?q.ENTITIES[G]:q.ENTITIES[pe]?q.ENTITIES[pe]:("#"===(G=pe).charAt(0)&&("x"===G.charAt(1)?(G=G.slice(2),je=(ue=parseInt(G,16)).toString(16)):(G=G.slice(1),je=(ue=parseInt(G,10)).toString(10))),G=G.replace(/^0+/,""),isNaN(ue)||je.toLowerCase()!==G?(Xe(q,"Invalid character entity"),"&"+q.entity+";"):String.fromCodePoint(ue))}function Ve(q,G){"<"===G?(q.state=te.OPEN_WAKA,q.startTagPosition=q.position):E(G)||(Xe(q,"Non-whitespace before first tag."),q.textNode=G,q.state=te.TEXT)}function $e(q,G){var pe="";return G1114111||G(B)!==B)throw RangeError("Invalid code point: "+B);B<=65535?je.push(B):je.push(55296+((B-=65536)>>10),B%1024+56320),(ve+1===L||je.length>ue)&&(N+=q.apply(null,je),je.length=0)}return N},Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:pe,configurable:!0,writable:!0}):String.fromCodePoint=pe)}(void 0===he?this.sax={}:he)}).call(this)}).call(this,Y("buffer").Buffer)},{buffer:6,stream:87,string_decoder:5}],86:[function(Y,Se,he){(function(W,j){(function(){!function(P,Q){"use strict";if(!P.setImmediate){var A,z=1,v={},x=!1,O=P.document,X=Object.getPrototypeOf&&Object.getPrototypeOf(P);X=X&&X.setTimeout?X:P,"[object process]"==={}.toString.call(P.process)?A=function(E){W.nextTick(function(){T(E)})}:function(){if(P.postMessage&&!P.importScripts){var E=!0,$=P.onmessage;return P.onmessage=function(){E=!1},P.postMessage("","*"),P.onmessage=$,E}}()?(E="setImmediate$"+Math.random()+"$",$=function(Z){Z.source===P&&"string"==typeof Z.data&&0===Z.data.indexOf(E)&&T(+Z.data.slice(E.length))},P.addEventListener?P.addEventListener("message",$,!1):P.attachEvent("onmessage",$),A=function(Z){P.postMessage(E+Z,"*")}):P.MessageChannel?function(){var E=new MessageChannel;E.port1.onmessage=function($){T($.data)},A=function($){E.port2.postMessage($)}}():O&&"onreadystatechange"in O.createElement("script")?function(){var E=O.documentElement;A=function($){var Z=O.createElement("script");Z.onreadystatechange=function(){T($),Z.onreadystatechange=null,E.removeChild(Z),Z=null},E.appendChild(Z)}}():A=function(E){setTimeout(T,0,E)},X.setImmediate=function(E){"function"!=typeof E&&(E=new Function(""+E));for(var $=new Array(arguments.length-1),Z=0;Z<$.length;Z++)$[Z]=arguments[Z+1];return v[z]={callback:E,args:$},A(z),z++},X.clearImmediate=y}var E,$;function y(E){delete v[E]}function T(E){if(x)setTimeout(T,0,E);else{var $=v[E];if($){x=!0;try{!function(E){var $=E.callback,Z=E.args;switch(Z.length){case 0:$();break;case 1:$(Z[0]);break;case 2:$(Z[0],Z[1]);break;case 3:$(Z[0],Z[1],Z[2]);break;default:$.apply(void 0,Z)}}($)}finally{y(E),x=!1}}}}}("undefined"==typeof self?void 0===j?this:j:self)}).call(this)}).call(this,Y("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:44}],87:[function(Y,Se,he){Se.exports=P;var W=Y("events").EventEmitter;function P(){W.call(this)}Y("inherits")(P,W),P.Readable=Y("readable-stream/lib/_stream_readable.js"),P.Writable=Y("readable-stream/lib/_stream_writable.js"),P.Duplex=Y("readable-stream/lib/_stream_duplex.js"),P.Transform=Y("readable-stream/lib/_stream_transform.js"),P.PassThrough=Y("readable-stream/lib/_stream_passthrough.js"),P.finished=Y("readable-stream/lib/internal/streams/end-of-stream.js"),P.pipeline=Y("readable-stream/lib/internal/streams/pipeline.js"),P.Stream=P,P.prototype.pipe=function(Q,z){var v=this;function x(V){Q.writable&&!1===Q.write(V)&&v.pause&&v.pause()}function O(){v.readable&&v.resume&&v.resume()}v.on("data",x),Q.on("drain",O),!Q._isStdio&&(!z||!1!==z.end)&&(v.on("end",b),v.on("close",y));var A=!1;function b(){A||(A=!0,Q.end())}function y(){A||(A=!0,"function"==typeof Q.destroy&&Q.destroy())}function S(V){if(T(),0===W.listenerCount(this,"error"))throw V}function T(){v.removeListener("data",x),Q.removeListener("drain",O),v.removeListener("end",b),v.removeListener("close",y),v.removeListener("error",S),Q.removeListener("error",S),v.removeListener("end",T),v.removeListener("close",T),Q.removeListener("close",T)}return v.on("error",S),Q.on("error",S),v.on("end",T),v.on("close",T),Q.on("close",T),Q.emit("pipe",v),Q}},{events:8,inherits:10,"readable-stream/lib/_stream_duplex.js":68,"readable-stream/lib/_stream_passthrough.js":69,"readable-stream/lib/_stream_readable.js":70,"readable-stream/lib/_stream_transform.js":71,"readable-stream/lib/_stream_writable.js":72,"readable-stream/lib/internal/streams/end-of-stream.js":76,"readable-stream/lib/internal/streams/pipeline.js":78}],88:[function(Y,Se,he){arguments[4][5][0].apply(he,arguments)},{dup:5,"safe-buffer":84}],89:[function(Y,Se,he){(function(W,j){(function(){var P=Y("process/browser.js").nextTick,Q=Function.prototype.apply,z=Array.prototype.slice,v={},x=0;function O(A,b){this._id=A,this._clearFn=b}he.setTimeout=function(){return new O(Q.call(setTimeout,window,arguments),clearTimeout)},he.setInterval=function(){return new O(Q.call(setInterval,window,arguments),clearInterval)},he.clearTimeout=he.clearInterval=function(A){A.close()},O.prototype.unref=O.prototype.ref=function(){},O.prototype.close=function(){this._clearFn.call(window,this._id)},he.enroll=function(A,b){clearTimeout(A._idleTimeoutId),A._idleTimeout=b},he.unenroll=function(A){clearTimeout(A._idleTimeoutId),A._idleTimeout=-1},he._unrefActive=he.active=function(A){clearTimeout(A._idleTimeoutId);var b=A._idleTimeout;b>=0&&(A._idleTimeoutId=setTimeout(function(){A._onTimeout&&A._onTimeout()},b))},he.setImmediate="function"==typeof W?W:function(A){var b=x++,y=!(arguments.length<2)&&z.call(arguments,1);return v[b]=!0,P(function(){v[b]&&(y?A.apply(null,y):A.call(null),he.clearImmediate(b))}),b},he.clearImmediate="function"==typeof j?j:function(A){delete v[A]}}).call(this)}).call(this,Y("timers").setImmediate,Y("timers").clearImmediate)},{"process/browser.js":44,timers:89}],90:[function(Y,Se,he){(function(W){(function(){function P(Q){try{if(!W.localStorage)return!1}catch(v){return!1}var z=W.localStorage[Q];return null!=z&&"true"===String(z).toLowerCase()}Se.exports=function(Q,z){if(P("noDeprecation"))return Q;var v=!1;return function(){if(!v){if(P("throwDeprecation"))throw new Error(z);P("traceDeprecation")?console.trace(z):console.warn(z),v=!0}return Q.apply(this,arguments)}}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],91:[function(Y,Se,he){"use strict";Se.exports=function(W){W.prototype[Symbol.iterator]=function*(){for(let j=this.head;j;j=j.next)yield j.value}}},{}],92:[function(Y,Se,he){"use strict";function W(v){var x=this;if(x instanceof W||(x=new W),x.tail=null,x.head=null,x.length=0,v&&"function"==typeof v.forEach)v.forEach(function(b){x.push(b)});else if(arguments.length>0)for(var O=0,A=arguments.length;O1)O=x;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");A=this.head.next,O=this.head.value}for(var b=0;null!==A;b++)O=v(O,A.value,b),A=A.next;return O},W.prototype.reduceReverse=function(v,x){var O,A=this.tail;if(arguments.length>1)O=x;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");A=this.tail.prev,O=this.tail.value}for(var b=this.length-1;null!==A;b--)O=v(O,A.value,b),A=A.prev;return O},W.prototype.toArray=function(){for(var v=new Array(this.length),x=0,O=this.head;null!==O;x++)v[x]=O.value,O=O.next;return v},W.prototype.toArrayReverse=function(){for(var v=new Array(this.length),x=0,O=this.tail;null!==O;x++)v[x]=O.value,O=O.prev;return v},W.prototype.slice=function(v,x){(x=x||this.length)<0&&(x+=this.length),(v=v||0)<0&&(v+=this.length);var O=new W;if(xthis.length&&(x=this.length);for(var A=0,b=this.head;null!==b&&Athis.length&&(x=this.length);for(var A=this.length,b=this.tail;null!==b&&A>x;A--)b=b.prev;for(;null!==b&&A>v;A--,b=b.prev)O.push(b.value);return O},W.prototype.splice=function(v,x,...O){v>this.length&&(v=this.length-1),v<0&&(v=this.length+v);for(var A=0,b=this.head;null!==b&&A{"use strict";Ut.exports=Je,Ut.exports.default=Je;var it=1e20;function Je(Y,Se,he,W,j,P){this.fontSize=Y||24,this.buffer=void 0===Se?3:Se,this.cutoff=W||.25,this.fontFamily=j||"sans-serif",this.fontWeight=P||"normal",this.radius=he||8;var Q=this.size=this.fontSize+2*this.buffer,z=Q+2*this.buffer;this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=Q,this.ctx=this.canvas.getContext("2d"),this.ctx.font=this.fontWeight+" "+this.fontSize+"px "+this.fontFamily,this.ctx.textAlign="left",this.ctx.fillStyle="black",this.gridOuter=new Float64Array(z*z),this.gridInner=new Float64Array(z*z),this.f=new Float64Array(z),this.z=new Float64Array(z+1),this.v=new Uint16Array(z),this.useMetrics=void 0!==this.ctx.measureText("A").actualBoundingBoxLeft,this.middle=Math.round(Q/2*(navigator.userAgent.indexOf("Gecko/")>=0?1.2:1))}function Tt(Y,Se,he,W,j,P){for(var Q=0;Q-1);P[++v]=z,Q[v]=x,Q[v+1]=it}for(z=0,v=0;z{Ut.exports=function(Je,yt){var ee=yt.length;if(0!==ee){var Tt=Je.length;Je.length+=ee;for(var dt=0;dt{"use strict";var yt=(()=>{return(Tt=yt||(yt={})).typeOfFunction="function",Tt.boolTrue=!0,yt;var Tt})();function ee(Tt,dt,Y){if(!Y||typeof Y.value!==yt.typeOfFunction)throw new TypeError("Only methods can be decorated with @bind. <"+dt+"> is not a method!");return{configurable:yt.boolTrue,get:function(){var Se=Y.value.bind(this);return Object.defineProperty(this,dt,{value:Se,configurable:yt.boolTrue,writable:yt.boolTrue}),Se}}}it.ak=ee,it.ZP=ee},266:(Ut,it,Je)=>{Ut.exports={ResizeSensor:Je(835),ElementQueries:Je(845)}},845:function(Ut,it,Je){"use strict";var yt,ee,Tt;"undefined"!=typeof window&&window,ee=[Je(835)],void 0!==(Tt="function"==typeof(yt=function(dt){var Y=function(){var he,W={},j=[];function P(D){D||(D=document.documentElement);var I=window.getComputedStyle(D,null).fontSize;return parseFloat(I)||16}function z(D,I){var X=I.split(/\d/),E=X[X.length-1];switch(I=parseFloat(I),E){case"px":return I;case"em":return I*P(D);case"rem":return I*P();case"vw":return I*document.documentElement.clientWidth/100;case"vh":return I*document.documentElement.clientHeight/100;case"vmin":case"vmax":var $=document.documentElement.clientWidth/100,Z=document.documentElement.clientHeight/100;return I*(0,Math["vmin"===E?"min":"max"])($,Z);default:return I}}function v(D,I){this.element=D;var X,E,$,Z,oe,se,te,Ce,me=["min-width","min-height","max-width","max-height"];this.call=function(){for(X in $=function(D){if(!D.getBoundingClientRect)return{width:D.offsetWidth,height:D.offsetHeight};var I=D.getBoundingClientRect();return{width:Math.round(I.width),height:Math.round(I.height)}}(this.element),se={},W[I])!W[I].hasOwnProperty(X)||(Z=z(this.element,(E=W[I][X]).value),oe="width"===E.property?$.width:$.height,te="","min"===E.mode&&oe>=Z&&(te+=E.value),"max"===E.mode&&oe<=Z&&(te+=E.value),se[Ce=E.mode+"-"+E.property]||(se[Ce]=""),te&&-1===(" "+se[Ce]+" ").indexOf(" "+te+" ")&&(se[Ce]+=" "+te));for(var ne in me)!me.hasOwnProperty(ne)||(se[me[ne]]?this.element.setAttribute(me[ne],se[me[ne]].substr(1)):this.element.removeAttribute(me[ne]))}}function x(D,I){D.elementQueriesSetupInformation||(D.elementQueriesSetupInformation=new v(D,I)),D.elementQueriesSensor||(D.elementQueriesSensor=new dt(D,function(){D.elementQueriesSetupInformation.call()}))}function O(D,I,X,E){if(void 0===W[D]){W[D]=[];var $=j.length;he.innerHTML+="\n"+D+" {animation: 0.1s element-queries;}",he.innerHTML+="\n"+D+" > .resize-sensor {min-width: "+$+"px;}",j.push(D)}W[D].push({mode:I,property:X,value:E})}function A(D){var I;if(document.querySelectorAll&&(I=D?D.querySelectorAll.bind(D):document.querySelectorAll.bind(document)),!I&&"undefined"!=typeof $$&&(I=$$),!I&&"undefined"!=typeof jQuery&&(I=jQuery),!I)throw"No document.querySelectorAll, jQuery or Mootools's $$ found.";return I}function y(D){var I=[],X=[],E=[],$=0,Z=-1,oe=[];for(var se in D.children)if(D.children.hasOwnProperty(se)&&D.children[se].tagName&&"img"===D.children[se].tagName.toLowerCase()){I.push(D.children[se]);var te=D.children[se].getAttribute("min-width")||D.children[se].getAttribute("data-min-width"),Ce=D.children[se].getAttribute("data-src")||D.children[se].getAttribute("url");E.push(Ce),X.push({minWidth:te}),te?D.children[se].style.display="none":($=I.length-1,D.children[se].style.display="block")}function ne(){var Ie,_e=!1;for(Ie in I)!I.hasOwnProperty(Ie)||X[Ie].minWidth&&D.offsetWidth>X[Ie].minWidth&&(_e=Ie);if(_e||(_e=$),Z!==_e)if(oe[_e])I[Z].style.display="none",I[_e].style.display="block",Z=_e;else{var Ge=new Image;Ge.onload=function(){I[_e].src=E[_e],I[Z].style.display="none",I[_e].style.display="block",oe[_e]=!0,Z=_e},Ge.src=E[_e]}else I[_e].src=E[_e]}Z=$,D.resizeSensorInstance=new dt(D,ne),ne()}var T=/,?[\s\t]*([^,\n]*?)((?:\[[\s\t]*?(?:min|max)-(?:width|height)[\s\t]*?[~$\^]?=[\s\t]*?"[^"]*?"[\s\t]*?])+)([^,\n\s\{]*)/gim,V=/\[[\s\t]*?(min|max)-(width|height)[\s\t]*?[~$\^]?=[\s\t]*?"([^"]*?)"[\s\t]*?]/gim;function R(D){var I,X,E,$;for(D=D.replace(/'/g,'"');null!==(I=T.exec(D));)for(X=I[1]+I[3],E=I[2];null!==($=V.exec(E));)O(X,$[1],$[2],$[3])}function K(D){var I="";if(D)if("string"==typeof D)(-1!==(D=D.toLowerCase()).indexOf("min-width")||-1!==D.indexOf("max-width"))&&R(D);else for(var X=0,E=D.length;X 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),ce=!0);for(var I=0,X=document.styleSheets.length;I{var yt=Je(910),ee=Je(369),Tt=Je(322);function dt(Q,z,v){if(!yt(Q))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(!Q.hasNode(z))throw new Error('graphology-shortest-path: the "'+z+'" source node does not exist in the given graph.');if(!Q.hasNode(v))throw new Error('graphology-shortest-path: the "'+v+'" target node does not exist in the given graph.');if((z=""+z)==(v=""+v))return[z];var x=Q.inboundNeighbors.bind(Q),O=Q.outboundNeighbors.bind(Q),A={},b={};A[z]=null,b[v]=null;var T,V,R,K,ce,D,I,X,y=[z],S=[v],E=!1;e:for(;y.length&&S.length;)if(y.length<=S.length){for(T=y,y=[],ce=0,I=T.length;ce{Ut.exports=function(Je){return null!==Je&&"object"==typeof Je&&"function"==typeof Je.addUndirectedEdgeWithKey&&"function"==typeof Je.dropNode&&"boolean"==typeof Je.multi}},698:function(Ut){Ut.exports=function(){"use strict";function it(ie){return(it="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(fe){return typeof fe}:function(fe){return fe&&"function"==typeof Symbol&&fe.constructor===Symbol&&fe!==Symbol.prototype?"symbol":typeof fe})(ie)}function Je(ie,fe){ie.prototype=Object.create(fe.prototype),ie.prototype.constructor=ie,ee(ie,fe)}function yt(ie){return(yt=Object.setPrototypeOf?Object.getPrototypeOf:function(fe){return fe.__proto__||Object.getPrototypeOf(fe)})(ie)}function ee(ie,fe){return(ee=Object.setPrototypeOf||function(re,M){return re.__proto__=M,re})(ie,fe)}function Tt(){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(ie){return!1}}function dt(ie,fe,re){return(dt=Tt()?Reflect.construct:function(M,k,J){var we=[null];we.push.apply(we,k);var Fe=new(Function.bind.apply(M,we));return J&&ee(Fe,J.prototype),Fe}).apply(null,arguments)}function Y(ie){var fe="function"==typeof Map?new Map:void 0;return(Y=function(re){if(null===re||-1===Function.toString.call(re).indexOf("[native code]"))return re;if("function"!=typeof re)throw new TypeError("Super expression must either be null or a function");if(void 0!==fe){if(fe.has(re))return fe.get(re);fe.set(re,k)}function k(){return dt(re,arguments,yt(this).constructor)}return k.prototype=Object.create(re.prototype,{constructor:{value:k,enumerable:!1,writable:!0,configurable:!0}}),ee(k,re)})(ie)}function Se(ie){if(void 0===ie)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return ie}var he=function(){for(var ie=arguments[0],fe=1,re=arguments.length;fe0&&we.length>k&&!we.warned){we.warned=!0;var nt=new Error("Possible EventEmitter memory leak detected. "+we.length+" "+String(fe)+" listeners added. Use emitter.setMaxListeners() to increase limit");nt.name="MaxListenersExceededWarning",nt.emitter=ie,nt.type=fe,nt.count=we.length,console&&console.warn&&console.warn(nt)}return ie}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 I(ie,fe,re){var M={fired:!1,wrapFn:void 0,target:ie,type:fe,listener:re},k=D.bind(M);return k.listener=re,M.wrapFn=k,k}function X(ie,fe,re){var M=ie._events;if(void 0===M)return[];var k=M[fe];return void 0===k?[]:"function"==typeof k?re?[k.listener||k]:[k]:re?function(J){for(var we=new Array(J.length),Fe=0;Fe0&&(J=fe[0]),J instanceof Error)throw J;var we=new Error("Unhandled error."+(J?" ("+J.message+")":""));throw we.context=J,we}var Fe=k[ie];if(void 0===Fe)return!1;if("function"==typeof Fe)y(Fe,this,fe);else{var nt=Fe.length,Ot=$(Fe,nt);for(re=0;re=0;J--)if(re[J]===fe||re[J].listener===fe){we=re[J].listener,k=J;break}if(k<0)return this;0===k?re.shift():function(Fe,nt){for(;nt+1=0;M--)this.removeListener(ie,fe[M]);return this},T.prototype.listeners=function(ie){return X(this,ie,!0)},T.prototype.rawListeners=function(ie){return X(this,ie,!1)},T.listenerCount=function(ie,fe){return"function"==typeof ie.listenerCount?ie.listenerCount(fe):E.call(ie,fe)},T.prototype.listenerCount=E,T.prototype.eventNames=function(){return this._eventsCount>0?O(this._events):[]},oe.prototype.next=function(){if(this.done)return{done:!0};var ie=this._next();return ie.done&&(this.done=!0),ie},"undefined"!=typeof Symbol&&(oe.prototype[Symbol.iterator]=function(){return this}),oe.of=function(){var ie=arguments,fe=ie.length,re=0;return new oe(function(){return re>=fe?{done:!0}:{done:!1,value:ie[re++]}})},oe.empty=function(){var ie=new oe(null);return ie.done=!0,ie},oe.is=function(ie){return ie instanceof oe||"object"==typeof ie&&null!==ie&&"function"==typeof ie.next};var se=oe,te=function(ie,fe){for(var re,M=arguments.length>1?fe:1/0,k=M!==1/0?new Array(M):[],J=0;;){if(J===M)return k;if((re=ie.next()).done)return J!==fe?k.slice(0,J):k;k[J++]=re.value}},Ce=function(ie){function fe(re,M){var k;return(k=ie.call(this)||this).name="GraphError",k.message=re||"",k.data=M||{},k}return Je(fe,ie),fe}(Y(Error)),me=function(ie){function fe(re,M){var k;return(k=ie.call(this,re,M)||this).name="InvalidArgumentsGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(Se(k),fe.prototype.constructor),k}return Je(fe,ie),fe}(Ce),ne=function(ie){function fe(re,M){var k;return(k=ie.call(this,re,M)||this).name="NotFoundGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(Se(k),fe.prototype.constructor),k}return Je(fe,ie),fe}(Ce),_e=function(ie){function fe(re,M){var k;return(k=ie.call(this,re,M)||this).name="UsageGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(Se(k),fe.prototype.constructor),k}return Je(fe,ie),fe}(Ce);function Ie(ie,fe){this.key=ie,this.attributes=fe,this.inDegree=0,this.outDegree=0,this.undirectedDegree=0,this.directedSelfLoops=0,this.undirectedSelfLoops=0,this.in={},this.out={},this.undirected={}}function Ge(ie,fe){this.key=ie,this.attributes=fe,this.inDegree=0,this.outDegree=0,this.directedSelfLoops=0,this.in={},this.out={}}function st(ie,fe){this.key=ie,this.attributes=fe,this.undirectedDegree=0,this.undirectedSelfLoops=0,this.undirected={}}function Xe(ie,fe,re,M,k,J){this.key=fe,this.attributes=J,this.undirected=ie,this.source=M,this.target=k,this.generatedKey=re}function tt(ie,fe,re,M,k,J,we){var Fe,nt,Ot="out",We="in";if(fe&&(Ot=We="undirected"),ie.multi){if(void 0===(nt=(Fe=J[Ot])[k])&&(nt=new Set,Fe[k]=nt),nt.add(re),M===k&&fe)return;void 0===(Fe=we[We])[M]&&(Fe[M]=nt)}else{if(J[Ot][k]=re,M===k&&fe)return;we[We][M]=re}}function Ye(ie,fe,re){var M=ie.multi,k=re.source,J=re.target,we=k.key,Fe=J.key,nt=k[fe?"undirected":"out"],Ot=fe?"undirected":"in";if(Fe in nt)if(M){var We=nt[Fe];1===We.size?(delete nt[Fe],delete J[Ot][we]):We.delete(re)}else delete nt[Fe];M||delete J[Ot][we]}Ge.prototype.upgradeToMixed=function(){this.undirectedDegree=0,this.undirectedSelfLoops=0,this.undirected={}},st.prototype.upgradeToMixed=function(){this.inDegree=0,this.outDegree=0,this.directedSelfLoops=0,this.in={},this.out={}};var Ue=[{name:function(ie){return"get".concat(ie,"Attribute")},attacher:function(ie,fe,re){ie.prototype[fe]=function(M,k){var J;if("mixed"!==this.type&&"mixed"!==re&&re!==this.type)throw new _e("Graph.".concat(fe,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new _e("Graph.".concat(fe,": 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=""+M,Fe=""+k;if(k=arguments[2],!(J=W(this,we,Fe,re)))throw new ne("Graph.".concat(fe,': could not find an edge for the given path ("').concat(we,'" - "').concat(Fe,'").'))}else if(!(J=this._edges.get(M=""+M)))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" edge in the graph.'));if("mixed"!==re&&J.undirected!==("undirected"===re))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" ').concat(re," edge in the graph."));return J.attributes[k]}}},{name:function(ie){return"get".concat(ie,"Attributes")},attacher:function(ie,fe,re){ie.prototype[fe]=function(M){var k;if("mixed"!==this.type&&"mixed"!==re&&re!==this.type)throw new _e("Graph.".concat(fe,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>1){if(this.multi)throw new _e("Graph.".concat(fe,": 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 J=""+M,we=""+arguments[1];if(!(k=W(this,J,we,re)))throw new ne("Graph.".concat(fe,': could not find an edge for the given path ("').concat(J,'" - "').concat(we,'").'))}else if(!(k=this._edges.get(M=""+M)))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" edge in the graph.'));if("mixed"!==re&&k.undirected!==("undirected"===re))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" ').concat(re," edge in the graph."));return k.attributes}}},{name:function(ie){return"has".concat(ie,"Attribute")},attacher:function(ie,fe,re){ie.prototype[fe]=function(M,k){var J;if("mixed"!==this.type&&"mixed"!==re&&re!==this.type)throw new _e("Graph.".concat(fe,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new _e("Graph.".concat(fe,": 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=""+M,Fe=""+k;if(k=arguments[2],!(J=W(this,we,Fe,re)))throw new ne("Graph.".concat(fe,': could not find an edge for the given path ("').concat(we,'" - "').concat(Fe,'").'))}else if(!(J=this._edges.get(M=""+M)))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" edge in the graph.'));if("mixed"!==re&&J.undirected!==("undirected"===re))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" ').concat(re," edge in the graph."));return J.attributes.hasOwnProperty(k)}}},{name:function(ie){return"set".concat(ie,"Attribute")},attacher:function(ie,fe,re){ie.prototype[fe]=function(M,k,J){var we;if("mixed"!==this.type&&"mixed"!==re&&re!==this.type)throw new _e("Graph.".concat(fe,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>3){if(this.multi)throw new _e("Graph.".concat(fe,": 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=""+M,nt=""+k;if(k=arguments[2],J=arguments[3],!(we=W(this,Fe,nt,re)))throw new ne("Graph.".concat(fe,': could not find an edge for the given path ("').concat(Fe,'" - "').concat(nt,'").'))}else if(!(we=this._edges.get(M=""+M)))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" edge in the graph.'));if("mixed"!==re&&we.undirected!==("undirected"===re))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" ').concat(re," edge in the graph."));return we.attributes[k]=J,this.emit("edgeAttributesUpdated",{key:we.key,type:"set",attributes:we.attributes,name:k}),this}}},{name:function(ie){return"update".concat(ie,"Attribute")},attacher:function(ie,fe,re){ie.prototype[fe]=function(M,k,J){var we;if("mixed"!==this.type&&"mixed"!==re&&re!==this.type)throw new _e("Graph.".concat(fe,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>3){if(this.multi)throw new _e("Graph.".concat(fe,": 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=""+M,nt=""+k;if(k=arguments[2],J=arguments[3],!(we=W(this,Fe,nt,re)))throw new ne("Graph.".concat(fe,': could not find an edge for the given path ("').concat(Fe,'" - "').concat(nt,'").'))}else if(!(we=this._edges.get(M=""+M)))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" edge in the graph.'));if("function"!=typeof J)throw new me("Graph.".concat(fe,": updater should be a function."));if("mixed"!==re&&we.undirected!==("undirected"===re))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" ').concat(re," edge in the graph."));return we.attributes[k]=J(we.attributes[k]),this.emit("edgeAttributesUpdated",{key:we.key,type:"set",attributes:we.attributes,name:k}),this}}},{name:function(ie){return"remove".concat(ie,"Attribute")},attacher:function(ie,fe,re){ie.prototype[fe]=function(M,k){var J;if("mixed"!==this.type&&"mixed"!==re&&re!==this.type)throw new _e("Graph.".concat(fe,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new _e("Graph.".concat(fe,": 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=""+M,Fe=""+k;if(k=arguments[2],!(J=W(this,we,Fe,re)))throw new ne("Graph.".concat(fe,': could not find an edge for the given path ("').concat(we,'" - "').concat(Fe,'").'))}else if(!(J=this._edges.get(M=""+M)))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" edge in the graph.'));if("mixed"!==re&&J.undirected!==("undirected"===re))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" ').concat(re," edge in the graph."));return delete J.attributes[k],this.emit("edgeAttributesUpdated",{key:J.key,type:"remove",attributes:J.attributes,name:k}),this}}},{name:function(ie){return"replace".concat(ie,"Attributes")},attacher:function(ie,fe,re){ie.prototype[fe]=function(M,k){var J;if("mixed"!==this.type&&"mixed"!==re&&re!==this.type)throw new _e("Graph.".concat(fe,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new _e("Graph.".concat(fe,": 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=""+M,Fe=""+k;if(k=arguments[2],!(J=W(this,we,Fe,re)))throw new ne("Graph.".concat(fe,': could not find an edge for the given path ("').concat(we,'" - "').concat(Fe,'").'))}else if(!(J=this._edges.get(M=""+M)))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" edge in the graph.'));if(!P(k))throw new me("Graph.".concat(fe,": provided attributes are not a plain object."));if("mixed"!==re&&J.undirected!==("undirected"===re))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" ').concat(re," edge in the graph."));return J.attributes=k,this.emit("edgeAttributesUpdated",{key:J.key,type:"replace",attributes:J.attributes}),this}}},{name:function(ie){return"merge".concat(ie,"Attributes")},attacher:function(ie,fe,re){ie.prototype[fe]=function(M,k){var J;if("mixed"!==this.type&&"mixed"!==re&&re!==this.type)throw new _e("Graph.".concat(fe,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new _e("Graph.".concat(fe,": 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=""+M,Fe=""+k;if(k=arguments[2],!(J=W(this,we,Fe,re)))throw new ne("Graph.".concat(fe,': could not find an edge for the given path ("').concat(we,'" - "').concat(Fe,'").'))}else if(!(J=this._edges.get(M=""+M)))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" edge in the graph.'));if(!P(k))throw new me("Graph.".concat(fe,": provided attributes are not a plain object."));if("mixed"!==re&&J.undirected!==("undirected"===re))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" ').concat(re," edge in the graph."));return he(J.attributes,k),this.emit("edgeAttributesUpdated",{key:J.key,type:"merge",attributes:J.attributes,data:k}),this}}}],ke=se,Ke=function(){var ie,fe=arguments,re=-1;return new ke(function M(){if(!ie){if(++re>=fe.length)return{done:!0};ie=fe[re]}var k=ie.next();return k.done?(ie=null,M()):k})},Me=[{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 Ve(ie,fe){for(var re in fe)ie.push(fe[re].key)}function $e(ie,fe){for(var re in fe)fe[re].forEach(function(M){return ie.push(M.key)})}function Ne(ie,fe,re){for(var M in ie)if(M!==re){var k=ie[M];fe(k.key,k.attributes,k.source.key,k.target.key,k.source.attributes,k.target.attributes,k.undirected,k.generatedKey)}}function q(ie,fe,re){for(var M in ie)M!==re&&ie[M].forEach(function(k){return fe(k.key,k.attributes,k.source.key,k.target.key,k.source.attributes,k.target.attributes,k.undirected,k.generatedKey)})}function G(ie,fe,re){for(var M in ie)if(M!==re){var k=ie[M];if(fe(k.key,k.attributes,k.source.key,k.target.key,k.source.attributes,k.target.attributes,k.undirected,k.generatedKey))return!0}return!1}function pe(ie,fe,re){var M,k,J,we,Fe;for(var nt in ie)if(nt!==re)for(M=ie[nt].values();!0!==(k=M.next()).done;)if(we=(J=k.value).source,fe(J.key,J.attributes,we.key,(Fe=J.target).key,we.attributes,Fe.attributes,J.undirected,J.generatedKey))return!0;return!1}function ue(ie,fe){var re=Object.keys(ie),M=re.length,k=null,J=0;return new se(function we(){var Fe;if(k){var nt=k.next();if(nt.done)return k=null,J++,we();Fe=nt.value}else{if(J>=M)return{done:!0};var Ot=re[J];if(Ot===fe)return J++,we();if((Fe=ie[Ot])instanceof Set)return k=Fe.values(),we();J++}return{done:!1,value:[Fe.key,Fe.attributes,Fe.source.key,Fe.target.key,Fe.source.attributes,Fe.target.attributes]}})}function je(ie,fe,re){var M=fe[re];M&&ie.push(M.key)}function _t(ie,fe,re){var M=fe[re];M&&M.forEach(function(k){return ie.push(k.key)})}function pt(ie,fe,re){var M=ie[fe];if(M){var k=M.source,J=M.target;re(M.key,M.attributes,k.key,J.key,k.attributes,J.attributes,M.undirected,M.generatedKey)}}function ve(ie,fe,re){var M=ie[fe];M&&M.forEach(function(k){return re(k.key,k.attributes,k.source.key,k.target.key,k.source.attributes,k.target.attributes,k.undirected,k.generatedKey)})}function L(ie,fe,re){var M=ie[fe];if(M){var k=M.source,J=M.target;return re(M.key,M.attributes,k.key,J.key,k.attributes,J.attributes,M.undirected,M.generatedKey)}}function N(ie,fe,re){var M=ie[fe];if(M){for(var k,J,we=M.values();!0!==(k=we.next()).done;)if(re((J=k.value).key,J.attributes,J.source.key,J.target.key,J.source.attributes,J.target.attributes,J.undirected,J.generatedKey))return!0;return!1}}function B(ie,fe){var re=ie[fe];if(re instanceof Set){var M=re.values();return new se(function(){var k=M.next();if(k.done)return k;var J=k.value;return{done:!1,value:[J.key,J.attributes,J.source.key,J.target.key,J.source.attributes,J.target.attributes]}})}return se.of([re.key,re.attributes,re.source.key,re.target.key,re.source.attributes,re.target.attributes])}function Re(ie,fe){if(0===ie.size)return[];if("mixed"===fe||fe===ie.type)return"function"==typeof Array.from?Array.from(ie._edges.keys()):te(ie._edges.keys(),ie._edges.size);for(var re,M,J=new Array("undirected"===fe?ie.undirectedSize:ie.directedSize),we="undirected"===fe,Fe=ie._edges.values(),nt=0;!0!==(re=Fe.next()).done;)(M=re.value).undirected===we&&(J[nt++]=M.key);return J}function Qe(ie,fe,re){if(0!==ie.size)for(var M,k,J="mixed"!==fe&&fe!==ie.type,we="undirected"===fe,Fe=ie._edges.values();!0!==(M=Fe.next()).done;)if(k=M.value,!J||k.undirected===we){var Wt=k.source,xt=k.target;re(k.key,k.attributes,Wt.key,xt.key,Wt.attributes,xt.attributes,k.undirected,k.generatedKey)}}function St(ie,fe,re){if(0!==ie.size)for(var M,k,J="mixed"!==fe&&fe!==ie.type,we="undirected"===fe,Fe=ie._edges.values();!0!==(M=Fe.next()).done;)if(k=M.value,!J||k.undirected===we){var Wt=k.source,xt=k.target;if(re(k.key,k.attributes,Wt.key,xt.key,Wt.attributes,xt.attributes,k.undirected,k.generatedKey))break}}function Nt(ie,fe){if(0===ie.size)return se.empty();var re="mixed"!==fe&&fe!==ie.type,M="undirected"===fe,k=ie._edges.values();return new se(function(){for(var J,we;;){if((J=k.next()).done)return J;if(we=J.value,!re||we.undirected===M)break}return{value:[we.key,we.attributes,we.source.key,we.target.key,we.source.attributes,we.target.attributes],done:!1}})}function On(ie,fe,re,M){var k=[],J=ie?$e:Ve;return"undirected"!==fe&&("out"!==re&&J(k,M.in),"in"!==re&&J(k,M.out),!re&&M.directedSelfLoops>0&&k.splice(k.lastIndexOf(M.key),1)),"directed"!==fe&&J(k,M.undirected),k}function kn(ie,fe,re,M,k){var J=ie?q:Ne;"undirected"!==fe&&("out"!==re&&J(M.in,k),"in"!==re&&J(M.out,k,re?null:M.key)),"directed"!==fe&&J(M.undirected,k)}function Yn(ie,fe,re,M,k){var J=ie?pe:G;"undirected"!==fe&&("out"!==re&&J(M.in,k)||"in"!==re&&J(M.out,k,re?null:M.key))||"directed"===fe||J(M.undirected,k)}function Ti(ie,fe,re){var M=se.empty();return"undirected"!==ie&&("out"!==fe&&void 0!==re.in&&(M=Ke(M,ue(re.in))),"in"!==fe&&void 0!==re.out&&(M=Ke(M,ue(re.out,fe?null:re.key)))),"directed"!==ie&&void 0!==re.undirected&&(M=Ke(M,ue(re.undirected))),M}function wi(ie,fe,re,M,k){var J=fe?_t:je,we=[];return"undirected"!==ie&&(void 0!==M.in&&"out"!==re&&J(we,M.in,k),void 0!==M.out&&"in"!==re&&J(we,M.out,k),!re&&M.directedSelfLoops>0&&we.splice(we.lastIndexOf(M.key),1)),"directed"!==ie&&void 0!==M.undirected&&J(we,M.undirected,k),we}function Xr(ie,fe,re,M,k,J){var we=fe?ve:pt;"undirected"!==ie&&(void 0!==M.in&&"out"!==re&&we(M.in,k,J),M.key!==k&&void 0!==M.out&&"in"!==re&&we(M.out,k,J)),"directed"!==ie&&void 0!==M.undirected&&we(M.undirected,k,J)}function Ls(ie,fe,re,M,k,J){var we=fe?N:L;"undirected"!==ie&&(void 0!==M.in&&"out"!==re&&we(M.in,k,J)||M.key!==k&&void 0!==M.out&&"in"!==re&&we(M.out,k,J,re?null:M.key))||"directed"===ie||void 0===M.undirected||we(M.undirected,k,J)}function gs(ie,fe,re,M){var k=se.empty();return"undirected"!==ie&&(void 0!==re.in&&"out"!==fe&&M in re.in&&(k=Ke(k,B(re.in,M))),void 0!==re.out&&"in"!==fe&&M in re.out&&(k=Ke(k,B(re.out,M)))),"directed"!==ie&&void 0!==re.undirected&&M in re.undirected&&(k=Ke(k,B(re.undirected,M))),k}var Bs=[{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 Qr(ie,fe){if(void 0!==fe)for(var re in fe)ie.add(re)}function el(ie,fe,re){if("mixed"!==ie){if("undirected"===ie)return Object.keys(re.undirected);if("string"==typeof fe)return Object.keys(re[fe])}var M=new Set;return"undirected"!==ie&&("out"!==fe&&Qr(M,re.in),"in"!==fe&&Qr(M,re.out)),"directed"!==ie&&Qr(M,re.undirected),te(M.values(),M.size)}function kl(ie,fe,re){for(var M in fe){var k=fe[M];k instanceof Set&&(k=k.values().next().value);var J=k.source,Fe=J===ie?k.target:J;re(Fe.key,Fe.attributes)}}function Sa(ie,fe,re,M){for(var k in re){var J=re[k];J instanceof Set&&(J=J.values().next().value);var we=J.source,nt=we===fe?J.target:we;ie.has(nt.key)||(ie.add(nt.key),M(nt.key,nt.attributes))}}function Es(ie,fe,re){for(var M in fe){var k=fe[M];k instanceof Set&&(k=k.values().next().value);var J=k.source,Fe=J===ie?k.target:J;if(re(Fe.key,Fe.attributes))return!0}return!1}function Jt(ie,fe,re,M){for(var k in re){var J=re[k];J instanceof Set&&(J=J.values().next().value);var we=J.source,nt=we===fe?J.target:we;if(!ie.has(nt.key)&&(ie.add(nt.key),M(nt.key,nt.attributes)))return!0}return!1}function tl(ie,fe){var re=Object.keys(fe),M=re.length,k=0;return new se(function(){if(k>=M)return{done:!0};var J=fe[re[k++]];J instanceof Set&&(J=J.values().next().value);var we=J.source,nt=we===ie?J.target:we;return{done:!1,value:[nt.key,nt.attributes]}})}function rt(ie,fe,re){var M=Object.keys(re),k=M.length,J=0;return new se(function we(){if(J>=k)return{done:!0};var Fe=re[M[J++]];Fe instanceof Set&&(Fe=Fe.values().next().value);var nt=Fe.source,We=nt===fe?Fe.target:nt;return ie.has(We.key)?we():(ie.add(We.key),{done:!1,value:[We.key,We.attributes]})})}function lt(ie,fe,re,M,k){var J=ie._nodes.get(M);if("undirected"!==fe){if("out"!==re&&void 0!==J.in)for(var we in J.in)if(we===k)return!0;if("in"!==re&&void 0!==J.out)for(var Fe in J.out)if(Fe===k)return!0}if("directed"!==fe&&void 0!==J.undirected)for(var nt in J.undirected)if(nt===k)return!0;return!1}function Le(ie,fe,re){for(var M,k,J,we,Fe,nt,Ot,We=fe._nodes.values(),Wt=fe.type;!0!==(M=We.next()).done;){if(k=M.value,"undirected"!==Wt)for(J in we=k.out)if(nt=(Fe=we[J]).target,Ot=re(k.key,nt.key,k.attributes,nt.attributes,Fe.key,Fe.attributes,Fe.undirected,Fe.generatedKey),ie&&Ot)return;if("directed"!==Wt)for(J in we=k.undirected)if((nt=(Fe=we[J]).target).key!==J&&(nt=Fe.source),Ot=re(k.key,nt.key,k.attributes,nt.attributes,Fe.key,Fe.attributes,Fe.undirected,Fe.generatedKey),ie&&Ot)return}}function ut(ie,fe,re){for(var M,k,J,we,Fe,nt,Ot,We,Wt,xt=fe._nodes.values(),vn=fe.type;!0!==(M=xt.next()).done;){if(k=M.value,"undirected"!==vn)for(J in nt=k.out)for(we=nt[J].values();!0!==(Fe=we.next()).done;)if(We=(Ot=Fe.value).target,Wt=re(k.key,We.key,k.attributes,We.attributes,Ot.key,Ot.attributes,Ot.undirected,Ot.generatedKey),ie&&Wt)return;if("directed"!==vn)for(J in nt=k.undirected)for(we=nt[J].values();!0!==(Fe=we.next()).done;)if((We=(Ot=Fe.value).target).key!==J&&(We=Ot.source),Wt=re(k.key,We.key,k.attributes,We.attributes,Ot.key,Ot.attributes,Ot.undirected,Ot.generatedKey),ie&&Wt)return}}function Ze(ie,fe){var re={key:ie};return Q(fe.attributes)||(re.attributes=he({},fe.attributes)),re}function At(ie,fe){var re={source:fe.source.key,target:fe.target.key};return fe.generatedKey||(re.key=ie),Q(fe.attributes)||(re.attributes=he({},fe.attributes)),fe.undirected&&(re.undirected=!0),re}function Mt(ie){return P(ie)?"key"in ie?!("attributes"in ie)||P(ie.attributes)&&null!==ie.attributes?null:"invalid-attributes":"no-key":"not-object"}function Dt(ie){return P(ie)?"source"in ie?"target"in ie?!("attributes"in ie)||P(ie.attributes)&&null!==ie.attributes?"undirected"in ie&&"boolean"!=typeof ie.undirected?"invalid-undirected":null:"invalid-attributes":"no-target":"no-source":"not-object"}var Xt=new Set(["directed","undirected","mixed"]),zn=new Set(["domain","_events","_eventsCount","_maxListeners"]),ai={allowSelfLoops:!0,edgeKeyGenerator:null,multi:!1,type:"mixed"};function Nn(ie,fe,re){var M=new ie.NodeDataClass(fe,re);return ie._nodes.set(fe,M),ie.emit("nodeAdded",{key:fe,attributes:re}),M}function bn(ie,fe,re,M,k,J,we,Fe){if(!M&&"undirected"===ie.type)throw new _e("Graph.".concat(fe,": you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead."));if(M&&"directed"===ie.type)throw new _e("Graph.".concat(fe,": you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead."));if(Fe&&!P(Fe))throw new me("Graph.".concat(fe,': invalid attributes. Expecting an object but got "').concat(Fe,'"'));if(J=""+J,we=""+we,Fe=Fe||{},!ie.allowSelfLoops&&J===we)throw new _e("Graph.".concat(fe,': source & target are the same ("').concat(J,"\"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false."));var nt=ie._nodes.get(J),Ot=ie._nodes.get(we);if(!nt)throw new ne("Graph.".concat(fe,': source node "').concat(J,'" not found.'));if(!Ot)throw new ne("Graph.".concat(fe,': target node "').concat(we,'" not found.'));var We={key:null,undirected:M,source:J,target:we,attributes:Fe};if(re&&(k=ie._edgeKeyGenerator(We)),ie._edges.has(k=""+k))throw new _e("Graph.".concat(fe,': the "').concat(k,'" edge already exists in the graph.'));if(!ie.multi&&(M?void 0!==nt.undirected[we]:void 0!==nt.out[we]))throw new _e("Graph.".concat(fe,': an edge linking "').concat(J,'" 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 Wt=new Xe(M,k,re,nt,Ot,Fe);return ie._edges.set(k,Wt),J===we?M?(nt.undirectedSelfLoops++,ie._undirectedSelfLoopCount++):(nt.directedSelfLoops++,ie._directedSelfLoopCount++):M?(nt.undirectedDegree++,Ot.undirectedDegree++):(nt.outDegree++,Ot.inDegree++),tt(ie,M,Wt,J,we,nt,Ot),M?ie._undirectedSize++:ie._directedSize++,We.key=k,ie.emit("edgeAdded",We),k}function $n(ie,fe,re,M,k,J,we,Fe,nt){if(!M&&"undirected"===ie.type)throw new _e("Graph.".concat(fe,": you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead."));if(M&&"directed"===ie.type)throw new _e("Graph.".concat(fe,": you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead."));if(Fe)if(nt){if("function"!=typeof Fe)throw new me("Graph.".concat(fe,': invalid updater function. Expecting a function but got "').concat(Fe,'"'))}else if(!P(Fe))throw new me("Graph.".concat(fe,': invalid attributes. Expecting an object but got "').concat(Fe,'"'));var Ot;if(J=""+J,we=""+we,nt&&(Ot=Fe,Fe=void 0),!ie.allowSelfLoops&&J===we)throw new _e("Graph.".concat(fe,': source & target are the same ("').concat(J,"\"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false."));var We,Wt,xt=ie._nodes.get(J),vn=ie._nodes.get(we);if(!re&&(We=ie._edges.get(k))){if(We.source.key!==J||We.target.key!==we||M&&(We.source.key!==we||We.target.key!==J))throw new _e("Graph.".concat(fe,': inconsistency detected when attempting to merge the "').concat(k,'" edge with "').concat(J,'" source & "').concat(we,'" target vs. ("').concat(We.source.key,'", "').concat(We.target.key,'").'));Wt=We}if(Wt||ie.multi||!xt||(Wt=M?xt.undirected[we]:xt.out[we]),Wt)return(nt?Ot:Fe)?(nt?(Wt.attributes=Ot(Wt.attributes),ie.emit("edgeAttributesUpdated",{type:"replace",key:Wt.key,attributes:Wt.attributes})):(he(Wt.attributes,Fe),ie.emit("edgeAttributesUpdated",{type:"merge",key:Wt.key,attributes:Wt.attributes,data:Fe})),Wt.key):Wt.key;Fe=Fe||{},nt&&Ot&&(Fe=Ot(Fe));var Jr={key:null,undirected:M,source:J,target:we,attributes:Fe};if(re&&(k=ie._edgeKeyGenerator(Jr)),ie._edges.has(k=""+k))throw new _e("Graph.".concat(fe,': the "').concat(k,'" edge already exists in the graph.'));return xt||(xt=Nn(ie,J,{}),J===we&&(vn=xt)),vn||(vn=Nn(ie,we,{})),We=new Xe(M,k,re,xt,vn,Fe),ie._edges.set(k,We),J===we?M?(xt.undirectedSelfLoops++,ie._undirectedSelfLoopCount++):(xt.directedSelfLoops++,ie._directedSelfLoopCount++):M?(xt.undirectedDegree++,vn.undirectedDegree++):(xt.outDegree++,vn.inDegree++),tt(ie,M,We,J,we,xt,vn),M?ie._undirectedSize++:ie._directedSize++,Jr.key=k,ie.emit("edgeAdded",Jr),k}var ie,Tn=function(ie){function fe(M){var k;if(k=ie.call(this)||this,(M=he({},ai,M)).edgeKeyGenerator&&"function"!=typeof M.edgeKeyGenerator)throw new me("Graph.constructor: invalid 'edgeKeyGenerator' option. Expecting a function but got \"".concat(M.edgeKeyGenerator,'".'));if("boolean"!=typeof M.multi)throw new me("Graph.constructor: invalid 'multi' option. Expecting a boolean but got \"".concat(M.multi,'".'));if(!Xt.has(M.type))throw new me('Graph.constructor: invalid \'type\' option. Should be one of "mixed", "directed" or "undirected" but got "'.concat(M.type,'".'));if("boolean"!=typeof M.allowSelfLoops)throw new me("Graph.constructor: invalid 'allowSelfLoops' option. Expecting a boolean but got \"".concat(M.allowSelfLoops,'".'));var J,we="mixed"===M.type?Ie:"directed"===M.type?Ge:st;return z(Se(k),"NodeDataClass",we),z(Se(k),"_attributes",{}),z(Se(k),"_nodes",new Map),z(Se(k),"_edges",new Map),z(Se(k),"_directedSize",0),z(Se(k),"_undirectedSize",0),z(Se(k),"_directedSelfLoopCount",0),z(Se(k),"_undirectedSelfLoopCount",0),z(Se(k),"_edgeKeyGenerator",M.edgeKeyGenerator||(J=0,function(){return J++})),z(Se(k),"_options",M),zn.forEach(function(Fe){return z(Se(k),Fe,k[Fe])}),v(Se(k),"order",function(){return k._nodes.size}),v(Se(k),"size",function(){return k._edges.size}),v(Se(k),"directedSize",function(){return k._directedSize}),v(Se(k),"undirectedSize",function(){return k._undirectedSize}),v(Se(k),"selfLoopCount",function(){return k._directedSelfLoopCount+k._undirectedSelfLoopCount}),v(Se(k),"directedSelfLoopCount",function(){return k._directedSelfLoopCount}),v(Se(k),"undirectedSelfLoopCount",function(){return k._undirectedSelfLoopCount}),v(Se(k),"multi",k._options.multi),v(Se(k),"type",k._options.type),v(Se(k),"allowSelfLoops",k._options.allowSelfLoops),v(Se(k),"implementation",function(){return"graphology"}),k}Je(fe,ie);var re=fe.prototype;return re.hasNode=function(M){return this._nodes.has(""+M)},re.hasDirectedEdge=function(M,k){if("undirected"===this.type)return!1;if(1===arguments.length){var we=this._edges.get(""+M);return!!we&&!we.undirected}if(2===arguments.length){k=""+k;var Fe=this._nodes.get(M=""+M);if(!Fe)return!1;var nt=Fe.out[k];return!(!nt||this.multi&&!nt.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."))},re.hasUndirectedEdge=function(M,k){if("directed"===this.type)return!1;if(1===arguments.length){var we=this._edges.get(""+M);return!!we&&we.undirected}if(2===arguments.length){k=""+k;var Fe=this._nodes.get(M=""+M);if(!Fe)return!1;var nt=Fe.undirected[k];return!(!nt||this.multi&&!nt.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."))},re.hasEdge=function(M,k){if(1===arguments.length)return this._edges.has(""+M);if(2===arguments.length){k=""+k;var we=this._nodes.get(M=""+M);if(!we)return!1;var Fe=void 0!==we.out&&we.out[k];return Fe||(Fe=void 0!==we.undirected&&we.undirected[k]),!(!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."))},re.directedEdge=function(M,k){if("undirected"!==this.type){if(M=""+M,k=""+k,this.multi)throw new _e("Graph.directedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.directedEdges instead.");var J=this._nodes.get(M);if(!J)throw new ne('Graph.directedEdge: could not find the "'.concat(M,'" source node in the graph.'));if(!this._nodes.has(k))throw new ne('Graph.directedEdge: could not find the "'.concat(k,'" target node in the graph.'));var we=J.out&&J.out[k]||void 0;return we?we.key:void 0}},re.undirectedEdge=function(M,k){if("directed"!==this.type){if(M=""+M,k=""+k,this.multi)throw new _e("Graph.undirectedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.undirectedEdges instead.");var J=this._nodes.get(M);if(!J)throw new ne('Graph.undirectedEdge: could not find the "'.concat(M,'" source node in the graph.'));if(!this._nodes.has(k))throw new ne('Graph.undirectedEdge: could not find the "'.concat(k,'" target node in the graph.'));var we=J.undirected&&J.undirected[k]||void 0;return we?we.key:void 0}},re.edge=function(M,k){if(this.multi)throw new _e("Graph.edge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.edges instead.");k=""+k;var J=this._nodes.get(M=""+M);if(!J)throw new ne('Graph.edge: could not find the "'.concat(M,'" source node in the graph.'));if(!this._nodes.has(k))throw new ne('Graph.edge: could not find the "'.concat(k,'" target node in the graph.'));var we=J.out&&J.out[k]||J.undirected&&J.undirected[k]||void 0;if(we)return we.key},re.inDegree=function(M){var k=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof k)throw new me('Graph.inDegree: Expecting a boolean but got "'.concat(k,'" for the second parameter (allowing self-loops to be counted).'));var J=this._nodes.get(M=""+M);if(!J)throw new ne('Graph.inDegree: could not find the "'.concat(M,'" node in the graph.'));return"undirected"===this.type?0:J.inDegree+(k?J.directedSelfLoops:0)},re.outDegree=function(M){var k=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof k)throw new me('Graph.outDegree: Expecting a boolean but got "'.concat(k,'" for the second parameter (allowing self-loops to be counted).'));var J=this._nodes.get(M=""+M);if(!J)throw new ne('Graph.outDegree: could not find the "'.concat(M,'" node in the graph.'));return"undirected"===this.type?0:J.outDegree+(k?J.directedSelfLoops:0)},re.directedDegree=function(M){var k=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof k)throw new me('Graph.directedDegree: Expecting a boolean but got "'.concat(k,'" for the second parameter (allowing self-loops to be counted).'));var J=this._nodes.get(M=""+M);if(!J)throw new ne('Graph.directedDegree: could not find the "'.concat(M,'" node in the graph.'));if("undirected"===this.type)return 0;var we=k?J.directedSelfLoops:0;return J.inDegree+we+(J.outDegree+we)},re.undirectedDegree=function(M){var k=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof k)throw new me('Graph.undirectedDegree: Expecting a boolean but got "'.concat(k,'" for the second parameter (allowing self-loops to be counted).'));var J=this._nodes.get(M=""+M);if(!J)throw new ne('Graph.undirectedDegree: could not find the "'.concat(M,'" node in the graph.'));return"directed"===this.type?0:J.undirectedDegree+2*(k?J.undirectedSelfLoops:0)},re.degree=function(M){var k=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof k)throw new me('Graph.degree: Expecting a boolean but got "'.concat(k,'" for the second parameter (allowing self-loops to be counted).'));var J=this._nodes.get(M=""+M);if(!J)throw new ne('Graph.degree: could not find the "'.concat(M,'" node in the graph.'));var we=0,Fe=0;return"directed"!==this.type&&(k&&(Fe=J.undirectedSelfLoops),we+=J.undirectedDegree+2*Fe),"undirected"!==this.type&&(k&&(Fe=J.directedSelfLoops),we+=J.inDegree+J.outDegree+2*Fe),we},re.source=function(M){var k=this._edges.get(M=""+M);if(!k)throw new ne('Graph.source: could not find the "'.concat(M,'" edge in the graph.'));return k.source.key},re.target=function(M){var k=this._edges.get(M=""+M);if(!k)throw new ne('Graph.target: could not find the "'.concat(M,'" edge in the graph.'));return k.target.key},re.extremities=function(M){var k=this._edges.get(M=""+M);if(!k)throw new ne('Graph.extremities: could not find the "'.concat(M,'" edge in the graph.'));return[k.source.key,k.target.key]},re.opposite=function(M,k){M=""+M;var J=this._edges.get(k=""+k);if(!J)throw new ne('Graph.opposite: could not find the "'.concat(k,'" edge in the graph.'));var we=J.source.key,Fe=J.target.key;if(M!==we&&M!==Fe)throw new ne('Graph.opposite: the "'.concat(M,'" node is not attached to the "').concat(k,'" edge (').concat(we,", ").concat(Fe,")."));return M===we?Fe:we},re.hasExtremity=function(M,k){k=""+k;var J=this._edges.get(M=""+M);if(!J)throw new ne('Graph.hasExtremity: could not find the "'.concat(M,'" edge in the graph.'));return J.source.key===k||J.target.key===k},re.isUndirected=function(M){var k=this._edges.get(M=""+M);if(!k)throw new ne('Graph.isUndirected: could not find the "'.concat(M,'" edge in the graph.'));return k.undirected},re.isDirected=function(M){var k=this._edges.get(M=""+M);if(!k)throw new ne('Graph.isDirected: could not find the "'.concat(M,'" edge in the graph.'));return!k.undirected},re.isSelfLoop=function(M){var k=this._edges.get(M=""+M);if(!k)throw new ne('Graph.isSelfLoop: could not find the "'.concat(M,'" edge in the graph.'));return k.source===k.target},re.hasGeneratedKey=function(M){var k=this._edges.get(M=""+M);if(!k)throw new ne('Graph.hasGeneratedKey: could not find the "'.concat(M,'" edge in the graph.'));return k.generatedKey},re.addNode=function(M,k){return function(J,we,Fe){if(Fe&&!P(Fe))throw new me('Graph.addNode: invalid attributes. Expecting an object but got "'.concat(Fe,'"'));if(Fe=Fe||{},J._nodes.has(we=""+we))throw new _e('Graph.addNode: the "'.concat(we,'" node already exist in the graph.'));var nt=new J.NodeDataClass(we,Fe);return J._nodes.set(we,nt),J.emit("nodeAdded",{key:we,attributes:Fe}),nt}(this,M,k).key},re.mergeNode=function(M,k){if(k&&!P(k))throw new me('Graph.mergeNode: invalid attributes. Expecting an object but got "'.concat(k,'"'));k=k||{};var J=this._nodes.get(M=""+M);return J?(k&&(he(J.attributes,k),this.emit("nodeAttributesUpdated",{type:"merge",key:M,attributes:J.attributes,data:k})),M):(J=new this.NodeDataClass(M,k),this._nodes.set(M,J),this.emit("nodeAdded",{key:M,attributes:k}),M)},re.updateNode=function(M,k){if(k&&"function"!=typeof k)throw new me('Graph.updateNode: invalid updater function. Expecting a function but got "'.concat(k,'"'));var J=this._nodes.get(M=""+M);if(J)return k&&(J.attributes=k(J.attributes),this.emit("nodeAttributesUpdated",{type:"replace",key:M,attributes:J.attributes})),M;var Fe=k?k({}):{};return J=new this.NodeDataClass(M,Fe),this._nodes.set(M,J),this.emit("nodeAdded",{key:M,attributes:Fe}),M},re.dropNode=function(M){var k=this,J=this._nodes.get(M=""+M);if(!J)throw new ne('Graph.dropNode: could not find the "'.concat(M,'" node in the graph.'));this.forEachEdge(M,function(we){k.dropEdge(we)}),this._nodes.delete(M),this.emit("nodeDropped",{key:M,attributes:J.attributes})},re.dropEdge=function(M){var k;if(arguments.length>1){var J=""+arguments[0],we=""+arguments[1];if(!(k=W(this,J,we,this.type)))throw new ne('Graph.dropEdge: could not find the "'.concat(J,'" -> "').concat(we,'" edge in the graph.'))}else if(!(k=this._edges.get(M=""+M)))throw new ne('Graph.dropEdge: could not find the "'.concat(M,'" edge in the graph.'));this._edges.delete(k.key);var nt=k.source,Ot=k.target,We=k.attributes,Wt=k.undirected;return nt===Ot?Wt?(nt.undirectedSelfLoops--,this._undirectedSelfLoopCount--):(nt.directedSelfLoops--,this._directedSelfLoopCount--):Wt?(nt.undirectedDegree--,Ot.undirectedDegree--):(nt.outDegree--,Ot.inDegree--),Ye(this,Wt,k),Wt?this._undirectedSize--:this._directedSize--,this.emit("edgeDropped",{key:M,attributes:We,source:nt.key,target:Ot.key,undirected:Wt}),this},re.clear=function(){this._edges.clear(),this._nodes.clear(),this.emit("cleared")},re.clearEdges=function(){this._edges.clear(),this.clearIndex(),this.emit("edgesCleared")},re.getAttribute=function(M){return this._attributes[M]},re.getAttributes=function(){return this._attributes},re.hasAttribute=function(M){return this._attributes.hasOwnProperty(M)},re.setAttribute=function(M,k){return this._attributes[M]=k,this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:M}),this},re.updateAttribute=function(M,k){if("function"!=typeof k)throw new me("Graph.updateAttribute: updater should be a function.");return this._attributes[M]=k(this._attributes[M]),this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:M}),this},re.removeAttribute=function(M){return delete this._attributes[M],this.emit("attributesUpdated",{type:"remove",attributes:this._attributes,name:M}),this},re.replaceAttributes=function(M){if(!P(M))throw new me("Graph.replaceAttributes: provided attributes are not a plain object.");return this._attributes=M,this.emit("attributesUpdated",{type:"replace",attributes:this._attributes}),this},re.mergeAttributes=function(M){if(!P(M))throw new me("Graph.mergeAttributes: provided attributes are not a plain object.");return he(this._attributes,M),this.emit("attributesUpdated",{type:"merge",attributes:this._attributes,data:M}),this},re.getNodeAttribute=function(M,k){var J=this._nodes.get(M=""+M);if(!J)throw new ne('Graph.getNodeAttribute: could not find the "'.concat(M,'" node in the graph.'));return J.attributes[k]},re.getNodeAttributes=function(M){var k=this._nodes.get(M=""+M);if(!k)throw new ne('Graph.getNodeAttributes: could not find the "'.concat(M,'" node in the graph.'));return k.attributes},re.hasNodeAttribute=function(M,k){var J=this._nodes.get(M=""+M);if(!J)throw new ne('Graph.hasNodeAttribute: could not find the "'.concat(M,'" node in the graph.'));return J.attributes.hasOwnProperty(k)},re.setNodeAttribute=function(M,k,J){var we=this._nodes.get(M=""+M);if(!we)throw new ne('Graph.setNodeAttribute: could not find the "'.concat(M,'" 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[k]=J,this.emit("nodeAttributesUpdated",{key:M,type:"set",attributes:we.attributes,name:k}),this},re.updateNodeAttribute=function(M,k,J){var we=this._nodes.get(M=""+M);if(!we)throw new ne('Graph.updateNodeAttribute: could not find the "'.concat(M,'" 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 J)throw new me("Graph.updateAttribute: updater should be a function.");var Fe=we.attributes,nt=J(Fe[k]);return Fe[k]=nt,this.emit("nodeAttributesUpdated",{key:M,type:"set",attributes:we.attributes,name:k}),this},re.removeNodeAttribute=function(M,k){var J=this._nodes.get(M=""+M);if(!J)throw new ne('Graph.hasNodeAttribute: could not find the "'.concat(M,'" node in the graph.'));return delete J.attributes[k],this.emit("nodeAttributesUpdated",{key:M,type:"remove",attributes:J.attributes,name:k}),this},re.replaceNodeAttributes=function(M,k){var J=this._nodes.get(M=""+M);if(!J)throw new ne('Graph.replaceNodeAttributes: could not find the "'.concat(M,'" node in the graph.'));if(!P(k))throw new me("Graph.replaceNodeAttributes: provided attributes are not a plain object.");return J.attributes=k,this.emit("nodeAttributesUpdated",{key:M,type:"replace",attributes:J.attributes}),this},re.mergeNodeAttributes=function(M,k){var J=this._nodes.get(M=""+M);if(!J)throw new ne('Graph.mergeNodeAttributes: could not find the "'.concat(M,'" node in the graph.'));if(!P(k))throw new me("Graph.mergeNodeAttributes: provided attributes are not a plain object.");return he(J.attributes,k),this.emit("nodeAttributesUpdated",{key:M,type:"merge",attributes:J.attributes,data:k}),this},re.updateEachNodeAttributes=function(M,k){if("function"!=typeof M)throw new me("Graph.updateEachNodeAttributes: expecting an updater function.");if(k&&!x(k))throw new me("Graph.updateEachNodeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");for(var J,we,Fe=this._nodes.values();!0!==(J=Fe.next()).done;)(we=J.value).attributes=M(we.key,we.attributes);this.emit("eachNodeAttributesUpdated",{hints:k||null})},re.updateEachEdgeAttributes=function(M,k){if("function"!=typeof M)throw new me("Graph.updateEachEdgeAttributes: expecting an updater function.");if(k&&!x(k))throw new me("Graph.updateEachEdgeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");for(var J,we,Fe=this._edges.values();!0!==(J=Fe.next()).done;)(we=J.value).attributes=M(we.key,we.attributes);this.emit("eachEdgeAttributesUpdated",{hints:k||null})},re.forEach=function(M){if("function"!=typeof M)throw new me("Graph.forEach: expecting a callback.");this.multi?ut(!1,this,M):Le(!1,this,M)},re.forEachUntil=function(M){if("function"!=typeof M)throw new me("Graph.forEach: expecting a callback.");this.multi?ut(!0,this,M):Le(!0,this,M)},re.adjacency=function(){return this.multi?(nt=(M=this)._nodes.values(),Ot=M.type,We="outer",Wt=null,new se(function xt(){var vn;if("outer"===We)return!0===(vn=nt.next()).done?vn:(k=vn.value,We="directed",xt());if("directed"===We)return"undirected"===Ot?(We="undirected",xt()):(we=k.out,J=Object.keys(k.out),Fe=0,We="inner-directed",xt());if("undirected"===We){if("directed"===Ot)return We="outer",xt();we=k.undirected,J=Object.keys(k.undirected),Fe=0,We="inner-undirected"}if(!Wt&&Fe>=J.length)return We="inner-undirected"===We?"outer":"undirected",xt();if(!Wt){var Ss=J[Fe++];return Wt=we[Ss].values(),xt()}if((vn=Wt.next()).done)return Wt=null,xt();var Jr=vn.value,Qs=Jr.target;return"inner-undirected"===We&&Qs.key===k.key&&(Qs=Jr.source),{done:!1,value:[k.key,Qs.key,k.attributes,Qs.attributes,Jr.key,Jr.attributes]}})):(Ll=(xt=this)._nodes.values(),po=xt.type,jr="outer",new se(function js(){var xc;if("outer"===jr)return!0===(xc=Ll.next()).done?xc:(vn=xc.value,jr="directed",js());if("directed"===jr)return"undirected"===po?(jr="undirected",js()):(Jr=vn.out,Ss=Object.keys(vn.out),Qs=0,jr="inner-directed",js());if("undirected"===jr){if("directed"===po)return jr="outer",js();Jr=vn.undirected,Ss=Object.keys(vn.undirected),Qs=0,jr="inner-undirected"}if(Qs>=Ss.length)return jr="inner-undirected"===jr?"outer":"undirected",js();var Sn=Ss[Qs++],go=Jr[Sn],Bl=go.target;return"inner-undirected"===jr&&Bl.key===vn.key&&(Bl=go.source),{done:!1,value:[vn.key,Bl.key,vn.attributes,Bl.attributes,go.key,go.attributes]}}));var xt,vn,Ss,Jr,Qs,Ll,po,jr,M,k,J,we,Fe,nt,Ot,We,Wt},re.nodes=function(){return"function"==typeof Array.from?Array.from(this._nodes.keys()):te(this._nodes.keys(),this._nodes.size)},re.forEachNode=function(M){if("function"!=typeof M)throw new me("Graph.forEachNode: expecting a callback.");this._nodes.forEach(function(k,J){M(J,k.attributes)})},re.forEachNodeUntil=function(M){if("function"!=typeof M)throw new me("Graph.forEachNode: expecting a callback.");for(var k,J,we=this._nodes.values();!0!==(k=we.next())&&!M((J=k.value).key,J.attributes););},re.nodeEntries=function(){var M=this._nodes.values();return new se(function(){var k=M.next();if(k.done)return k;var J=k.value;return{value:[J.key,J.attributes],done:!1}})},re.exportNode=function(M){var k=this._nodes.get(M=""+M);if(!k)throw new ne('Graph.exportNode: could not find the "'.concat(M,'" node in the graph.'));return Ze(M,k)},re.exportEdge=function(M){var k=this._edges.get(M=""+M);if(!k)throw new ne('Graph.exportEdge: could not find the "'.concat(M,'" edge in the graph.'));return At(M,k)},re.export=function(){var M=new Array(this._nodes.size),k=0;this._nodes.forEach(function(we,Fe){M[k++]=Ze(Fe,we)});var J=new Array(this._edges.size);return k=0,this._edges.forEach(function(we,Fe){J[k++]=At(Fe,we)}),{attributes:this.getAttributes(),nodes:M,edges:J,options:{type:this.type,multi:this.multi,allowSelfLoops:this.allowSelfLoops}}},re.importNode=function(M){var k=arguments.length>1&&void 0!==arguments[1]&&arguments[1],J=Mt(M);if(J){if("not-object"===J)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"===J)throw new me("Graph.importNode: no key provided.");if("invalid-attributes"===J)throw new me("Graph.importNode: invalid attributes. Attributes should be a plain object, null or omitted.")}var we=M.key,Fe=M.attributes,nt=void 0===Fe?{}:Fe;return k?this.mergeNode(we,nt):this.addNode(we,nt),this},re.importEdge=function(M){var k=arguments.length>1&&void 0!==arguments[1]&&arguments[1],J=Dt(M);if(J){if("not-object"===J)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"===J)throw new me("Graph.importEdge: missing souce.");if("no-target"===J)throw new me("Graph.importEdge: missing target.");if("invalid-attributes"===J)throw new me("Graph.importEdge: invalid attributes. Attributes should be a plain object, null or omitted.");if("invalid-undirected"===J)throw new me("Graph.importEdge: invalid undirected. Undirected should be boolean or omitted.")}var we=M.source,Fe=M.target,nt=M.attributes,Ot=void 0===nt?{}:nt,We=M.undirected,Wt=void 0!==We&&We;return"key"in M?(k?Wt?this.mergeUndirectedEdgeWithKey:this.mergeDirectedEdgeWithKey:Wt?this.addUndirectedEdgeWithKey:this.addDirectedEdgeWithKey).call(this,M.key,we,Fe,Ot):(k?Wt?this.mergeUndirectedEdge:this.mergeDirectedEdge:Wt?this.addUndirectedEdge:this.addDirectedEdge).call(this,we,Fe,Ot),this},re.import=function(M){var k,J,we,Fe=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(j(M))return this.import(M.export(),Fe),this;if(!P(M))throw new me("Graph.import: invalid argument. Expecting a serialized graph or, alternatively, a Graph instance.");if(M.attributes){if(!P(M.attributes))throw new me("Graph.import: invalid attributes. Expecting a plain object.");Fe?this.mergeAttributes(M.attributes):this.replaceAttributes(M.attributes)}if(M.nodes){if(we=M.nodes,!Array.isArray(we))throw new me("Graph.import: invalid nodes. Expecting an array.");for(k=0,J=we.length;kJ)){var Ot=new Set;Ot.add(k.undirected[nt]),k.undirected[nt]=Ot,M._nodes.get(nt).undirected[J]=Ot}})),this;var M},re.clearIndex=function(){return this._nodes.forEach(function(M){void 0!==M.in&&(M.in={},M.out={}),void 0!==M.undirected&&(M.undirected={})}),this},re.toJSON=function(){return this.export()},re.toString=function(){return"[object Graph]"},re.inspect=function(){var M=this,k={};this._nodes.forEach(function(Ot,We){k[We]=Ot.attributes});var J={},we={};this._edges.forEach(function(Ot,We){var Wt=Ot.undirected?"--":"->",xt="",vn="(".concat(Ot.source.key,")").concat(Wt,"(").concat(Ot.target.key,")");Ot.generatedKey?M.multi&&(void 0===we[vn]?we[vn]=0:we[vn]++,xt+="".concat(we[vn],". ")):xt+="[".concat(We,"]: "),J[xt+=vn]=Ot.attributes});var Fe={};for(var nt in this)this.hasOwnProperty(nt)&&!zn.has(nt)&&"function"!=typeof this[nt]&&(Fe[nt]=this[nt]);return Fe.attributes=this._attributes,Fe.nodes=k,Fe.edges=J,z(Fe,"constructor",this.constructor),Fe},fe}(A.exports.EventEmitter);"undefined"!=typeof Symbol&&(Tn.prototype[Symbol.for("nodejs.util.inspect.custom")]=Tn.prototype.inspect),[{name:function(ie){return"".concat(ie,"Edge")},generateKey:!0},{name:function(ie){return"".concat(ie,"DirectedEdge")},generateKey:!0,type:"directed"},{name:function(ie){return"".concat(ie,"UndirectedEdge")},generateKey:!0,type:"undirected"},{name:function(ie){return"".concat(ie,"EdgeWithKey")}},{name:function(ie){return"".concat(ie,"DirectedEdgeWithKey")},type:"directed"},{name:function(ie){return"".concat(ie,"UndirectedEdgeWithKey")},type:"undirected"}].forEach(function(ie){["add","merge","update"].forEach(function(fe){var re=ie.name(fe),M="add"===fe?bn:$n;Tn.prototype[re]=ie.generateKey?function(k,J,we){return M(this,re,!0,"undirected"===(ie.type||this.type),null,k,J,we,"update"===fe)}:function(k,J,we,Fe){return M(this,re,!1,"undirected"===(ie.type||this.type),k,J,we,Fe,"update"===fe)}})}),"undefined"!=typeof Symbol&&(Tn.prototype[Symbol.iterator]=Tn.prototype.adjacency),ie=Tn,Ue.forEach(function(fe){var re=fe.name,M=fe.attacher;M(ie,re("Edge"),"mixed"),M(ie,re("DirectedEdge"),"directed"),M(ie,re("UndirectedEdge"),"undirected")}),function(ie){Me.forEach(function(fe){var M,k,J,we;J=(M=fe).type,we=M.direction,ie.prototype[k=M.name]=function(Fe,nt){if("mixed"!==J&&"mixed"!==this.type&&J!==this.type)return[];if(!arguments.length)return Re(this,J);if(1===arguments.length){var Ot=this._nodes.get(Fe=""+Fe);if(void 0===Ot)throw new ne("Graph.".concat(k,': could not find the "').concat(Fe,'" node in the graph.'));return On(this.multi,"mixed"===J?this.type:J,we,Ot)}if(2===arguments.length){nt=""+nt;var We=this._nodes.get(Fe=""+Fe);if(!We)throw new ne("Graph.".concat(k,': could not find the "').concat(Fe,'" source node in the graph.'));if(!this._nodes.has(nt))throw new ne("Graph.".concat(k,': could not find the "').concat(nt,'" target node in the graph.'));return wi(J,this.multi,we,We,nt)}throw new me("Graph.".concat(k,": too many arguments (expecting 0, 1 or 2 and got ").concat(arguments.length,")."))},function(re,M){var k=M.name,J=M.type,we=M.direction,Fe="forEach"+k[0].toUpperCase()+k.slice(1,-1);re.prototype[Fe]=function(nt,Ot,We){if("mixed"===J||"mixed"===this.type||J===this.type){if(1===arguments.length)return Qe(this,J,We=nt);if(2===arguments.length){We=Ot;var Wt=this._nodes.get(nt=""+nt);if(void 0===Wt)throw new ne("Graph.".concat(Fe,': could not find the "').concat(nt,'" node in the graph.'));return kn(this.multi,"mixed"===J?this.type:J,we,Wt,We)}if(3===arguments.length){Ot=""+Ot;var xt=this._nodes.get(nt=""+nt);if(!xt)throw new ne("Graph.".concat(Fe,': could not find the "').concat(nt,'" source node in the graph.'));if(!this._nodes.has(Ot))throw new ne("Graph.".concat(Fe,': could not find the "').concat(Ot,'" target node in the graph.'));return Xr(J,this.multi,we,xt,Ot,We)}throw new me("Graph.".concat(Fe,": too many arguments (expecting 1, 2 or 3 and got ").concat(arguments.length,")."))}}}(ie,fe),function(re,M){var k=M.name,J=M.type,we=M.direction,Fe="forEach"+k[0].toUpperCase()+k.slice(1,-1)+"Until";re.prototype[Fe]=function(nt,Ot,We){if("mixed"===J||"mixed"===this.type||J===this.type){if(1===arguments.length)return St(this,J,We=nt);if(2===arguments.length){We=Ot;var Wt=this._nodes.get(nt=""+nt);if(void 0===Wt)throw new ne("Graph.".concat(Fe,': could not find the "').concat(nt,'" node in the graph.'));return Yn(this.multi,"mixed"===J?this.type:J,we,Wt,We)}if(3===arguments.length){Ot=""+Ot;var xt=this._nodes.get(nt=""+nt);if(!xt)throw new ne("Graph.".concat(Fe,': could not find the "').concat(nt,'" source node in the graph.'));if(!this._nodes.has(Ot))throw new ne("Graph.".concat(Fe,': could not find the "').concat(Ot,'" target node in the graph.'));return Ls(J,this.multi,we,xt,Ot,We)}throw new me("Graph.".concat(Fe,": too many arguments (expecting 1, 2 or 3 and got ").concat(arguments.length,")."))}}}(ie,fe),function(re,M){var J=M.type,we=M.direction,Fe=M.name.slice(0,-1)+"Entries";re.prototype[Fe]=function(nt,Ot){if("mixed"!==J&&"mixed"!==this.type&&J!==this.type)return se.empty();if(!arguments.length)return Nt(this,J);if(1===arguments.length){var We=this._nodes.get(nt=""+nt);if(!We)throw new ne("Graph.".concat(Fe,': could not find the "').concat(nt,'" node in the graph.'));return Ti(J,we,We)}if(2===arguments.length){Ot=""+Ot;var Wt=this._nodes.get(nt=""+nt);if(!Wt)throw new ne("Graph.".concat(Fe,': could not find the "').concat(nt,'" source node in the graph.'));if(!this._nodes.has(Ot))throw new ne("Graph.".concat(Fe,': could not find the "').concat(Ot,'" target node in the graph.'));return gs(J,we,Wt,Ot)}throw new me("Graph.".concat(Fe,": too many arguments (expecting 0, 1 or 2 and got ").concat(arguments.length,")."))}}(ie,fe)})}(Tn),function(ie){Bs.forEach(function(fe){var M,k,J,we;J=(M=fe).type,we=M.direction,ie.prototype[k=M.name]=function(Fe){if("mixed"!==J&&"mixed"!==this.type&&J!==this.type)return[];if(2===arguments.length){var nt=""+arguments[0],Ot=""+arguments[1];if(!this._nodes.has(nt))throw new ne("Graph.".concat(k,': could not find the "').concat(nt,'" node in the graph.'));if(!this._nodes.has(Ot))throw new ne("Graph.".concat(k,': could not find the "').concat(Ot,'" node in the graph.'));return lt(this,J,we,nt,Ot)}if(1===arguments.length){var We=this._nodes.get(Fe=""+Fe);if(void 0===We)throw new ne("Graph.".concat(k,': could not find the "').concat(Fe,'" node in the graph.'));return el("mixed"===J?this.type:J,we,We)}throw new me("Graph.".concat(k,": invalid number of arguments (expecting 1 or 2 and got ").concat(arguments.length,")."))},function(ie,fe){var re=fe.name,M=fe.type,k=fe.direction,J="forEach"+re[0].toUpperCase()+re.slice(1,-1);ie.prototype[J]=function(we,Fe){if("mixed"===M||"mixed"===this.type||M===this.type){var nt=this._nodes.get(we=""+we);if(void 0===nt)throw new ne("Graph.".concat(J,': could not find the "').concat(we,'" node in the graph.'));!function(Ot,We,Wt,xt){if("mixed"!==Ot){if("undirected"===Ot)return kl(Wt,Wt.undirected,xt);if("string"==typeof We)return kl(Wt,Wt[We],xt)}var vn=new Set;"undirected"!==Ot&&("out"!==We&&Sa(vn,Wt,Wt.in,xt),"in"!==We&&Sa(vn,Wt,Wt.out,xt)),"directed"!==Ot&&Sa(vn,Wt,Wt.undirected,xt)}("mixed"===M?this.type:M,k,nt,Fe)}}}(ie,fe),function(ie,fe){var re=fe.name,M=fe.type,k=fe.direction,J="forEach"+re[0].toUpperCase()+re.slice(1,-1)+"Until";ie.prototype[J]=function(we,Fe){if("mixed"===M||"mixed"===this.type||M===this.type){var nt=this._nodes.get(we=""+we);if(void 0===nt)throw new ne("Graph.".concat(J,': could not find the "').concat(we,'" node in the graph.'));!function(Ot,We,Wt,xt){if("mixed"!==Ot){if("undirected"===Ot)return Es(Wt,Wt.undirected,xt);if("string"==typeof We)return Es(Wt,Wt[We],xt)}var vn=new Set;"undirected"!==Ot&&("out"!==We&&Jt(vn,Wt,Wt.in,xt)||"in"!==We&&Jt(vn,Wt,Wt.out,xt))||"directed"===Ot||Jt(vn,Wt,Wt.undirected,xt)}("mixed"===M?this.type:M,k,nt,Fe)}}}(ie,fe),function(ie,fe){var M=fe.type,k=fe.direction,J=fe.name.slice(0,-1)+"Entries";ie.prototype[J]=function(we){if("mixed"!==M&&"mixed"!==this.type&&M!==this.type)return se.empty();var Fe=this._nodes.get(we=""+we);if(void 0===Fe)throw new ne("Graph.".concat(J,': could not find the "').concat(we,'" node in the graph.'));return function(nt,Ot,We){if("mixed"!==nt){if("undirected"===nt)return tl(We,We.undirected);if("string"==typeof Ot)return tl(We,We[Ot])}var Wt=se.empty(),xt=new Set;return"undirected"!==nt&&("out"!==Ot&&(Wt=Ke(Wt,rt(xt,We,We.in))),"in"!==Ot&&(Wt=Ke(Wt,rt(xt,We,We.out)))),"directed"!==nt&&(Wt=Ke(Wt,rt(xt,We,We.undirected))),Wt}("mixed"===M?this.type:M,k,Fe)}}(ie,fe)})}(Tn);var lr=function(ie){function fe(re){var M=he({type:"directed"},re);if("multi"in M&&!1!==M.multi)throw new me("DirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if("directed"!==M.type)throw new me('DirectedGraph.from: inconsistent "'+M.type+'" type in given options!');return ie.call(this,M)||this}return Je(fe,ie),fe}(Tn),cr=function(ie){function fe(re){var M=he({type:"undirected"},re);if("multi"in M&&!1!==M.multi)throw new me("UndirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if("undirected"!==M.type)throw new me('UndirectedGraph.from: inconsistent "'+M.type+'" type in given options!');return ie.call(this,M)||this}return Je(fe,ie),fe}(Tn),Xn=function(ie){function fe(re){var M=he({multi:!0},re);if("multi"in M&&!0!==M.multi)throw new me("MultiGraph.from: inconsistent indication that the graph should be simple in given options!");return ie.call(this,M)||this}return Je(fe,ie),fe}(Tn),$i=function(ie){function fe(re){var M=he({type:"directed",multi:!0},re);if("multi"in M&&!0!==M.multi)throw new me("MultiDirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if("directed"!==M.type)throw new me('MultiDirectedGraph.from: inconsistent "'+M.type+'" type in given options!');return ie.call(this,M)||this}return Je(fe,ie),fe}(Tn),xa=function(ie){function fe(re){var M=he({type:"undirected",multi:!0},re);if("multi"in M&&!0!==M.multi)throw new me("MultiUndirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if("undirected"!==M.type)throw new me('MultiUndirectedGraph.from: inconsistent "'+M.type+'" type in given options!');return ie.call(this,M)||this}return Je(fe,ie),fe}(Tn);function Zr(ie){ie.from=function(fe,re){var M=he({},fe.options,re),k=new ie(M);return k.import(fe),k}}return Zr(Tn),Zr(lr),Zr(cr),Zr(Xn),Zr($i),Zr(xa),Tn.Graph=Tn,Tn.DirectedGraph=lr,Tn.UndirectedGraph=cr,Tn.MultiGraph=Xn,Tn.MultiDirectedGraph=$i,Tn.MultiUndirectedGraph=xa,Tn.InvalidArgumentsGraphError=me,Tn.NotFoundGraphError=ne,Tn.UsageGraphError=_e,Tn}()},524:(Ut,it,Je)=>{var yt;!function(ee,Tt,dt,Y){"use strict";var A,Se=["","webkit","Moz","MS","ms","o"],he=Tt.createElement("div"),j=Math.round,P=Math.abs,Q=Date.now;function z(ye,De,He){return setTimeout(T(ye,He),De)}function v(ye,De,He){return!!Array.isArray(ye)&&(x(ye,He[De],He),!0)}function x(ye,De,He){var bt;if(ye)if(ye.forEach)ye.forEach(De,He);else if(ye.length!==Y)for(bt=0;bt\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",li=ee.console&&(ee.console.warn||ee.console.log);return li&&li.call(ee.console,bt,Yt),ye.apply(this,arguments)}}A="function"!=typeof Object.assign?function(De){if(De===Y||null===De)throw new TypeError("Cannot convert undefined or null to object");for(var He=Object(De),bt=1;bt-1}function X(ye){return ye.trim().split(/\s+/g)}function E(ye,De,He){if(ye.indexOf&&!He)return ye.indexOf(De);for(var bt=0;btxs[De]}):bt.sort()),bt}function oe(ye,De){for(var He,bt,Gt=De[0].toUpperCase()+De.slice(1),Yt=0;Yt1&&!He.firstMultiple?He.firstMultiple=St(De):1===Gt&&(He.firstMultiple=!1);var Yt=He.firstInput,li=He.firstMultiple,Vr=li?li.center:Yt.center,es=De.center=Nt(bt);De.timeStamp=Q(),De.deltaTime=De.timeStamp-Yt.timeStamp,De.angle=Ti(Vr,es),De.distance=Yn(Vr,es),function(ye,De){var He=De.center,bt=ye.offsetDelta||{},Gt=ye.prevDelta||{},Yt=ye.prevInput||{};(1===De.eventType||4===Yt.eventType)&&(Gt=ye.prevDelta={x:Yt.deltaX||0,y:Yt.deltaY||0},bt=ye.offsetDelta={x:He.x,y:He.y}),De.deltaX=Gt.x+(He.x-bt.x),De.deltaY=Gt.y+(He.y-bt.y)}(He,De),De.offsetDirection=kn(De.deltaX,De.deltaY);var xs=On(De.deltaTime,De.deltaX,De.deltaY);De.overallVelocityX=xs.x,De.overallVelocityY=xs.y,De.overallVelocity=P(xs.x)>P(xs.y)?xs.x:xs.y,De.scale=li?function(ye,De){return Yn(De[0],De[1],pt)/Yn(ye[0],ye[1],pt)}(li.pointers,bt):1,De.rotation=li?function(ye,De){return Ti(De[1],De[0],pt)+Ti(ye[1],ye[0],pt)}(li.pointers,bt):0,De.maxPointers=He.prevInput?De.pointers.length>He.prevInput.maxPointers?De.pointers.length:He.prevInput.maxPointers:De.pointers.length,function(ye,De){var Gt,Yt,li,Vr,He=ye.lastInterval||De,bt=De.timeStamp-He.timeStamp;if(8!=De.eventType&&(bt>25||He.velocity===Y)){var es=De.deltaX-He.deltaX,xs=De.deltaY-He.deltaY,Qn=On(bt,es,xs);Yt=Qn.x,li=Qn.y,Gt=P(Qn.x)>P(Qn.y)?Qn.x:Qn.y,Vr=kn(es,xs),ye.lastInterval=De}else Gt=He.velocity,Yt=He.velocityX,li=He.velocityY,Vr=He.direction;De.velocity=Gt,De.velocityX=Yt,De.velocityY=li,De.direction=Vr}(He,De);var Qn=ye.element;D(De.srcEvent.target,Qn)&&(Qn=De.srcEvent.target),De.target=Qn}(ye,He),ye.emit("hammer.input",He),ye.recognize(He),ye.session.prevInput=He}function St(ye){for(var De=[],He=0;He=P(De)?ye<0?2:4:De<0?8:16}function Yn(ye,De,He){He||(He=_t);var bt=De[He[0]]-ye[He[0]],Gt=De[He[1]]-ye[He[1]];return Math.sqrt(bt*bt+Gt*Gt)}function Ti(ye,De,He){return He||(He=_t),180*Math.atan2(De[He[1]]-ye[He[1]],De[He[0]]-ye[He[0]])/Math.PI}ve.prototype={handler:function(){},init:function(){this.evEl&&K(this.element,this.evEl,this.domHandler),this.evTarget&&K(this.target,this.evTarget,this.domHandler),this.evWin&&K(Ce(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&ce(this.element,this.evEl,this.domHandler),this.evTarget&&ce(this.target,this.evTarget,this.domHandler),this.evWin&&ce(Ce(this.element),this.evWin,this.domHandler)}};var Ls={mousedown:1,mousemove:2,mouseup:4},gs="mousedown",Bs="mousemove mouseup";function Qr(){this.evEl=gs,this.evWin=Bs,this.pressed=!1,ve.apply(this,arguments)}S(Qr,ve,{handler:function(De){var He=Ls[De.type];1&He&&0===De.button&&(this.pressed=!0),2&He&&1!==De.which&&(He=4),this.pressed&&(4&He&&(this.pressed=!1),this.callback(this.manager,He,{pointers:[De],changedPointers:[De],pointerType:Xe,srcEvent:De}))}});var el={pointerdown:1,pointermove:2,pointerup:4,pointercancel:8,pointerout:8},kl={2:Ge,3:"pen",4:Xe,5:"kinect"},Sa="pointerdown",Es="pointermove pointerup pointercancel";function Jt(){this.evEl=Sa,this.evWin=Es,ve.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}ee.MSPointerEvent&&!ee.PointerEvent&&(Sa="MSPointerDown",Es="MSPointerMove MSPointerUp MSPointerCancel"),S(Jt,ve,{handler:function(De){var He=this.store,bt=!1,Gt=De.type.toLowerCase().replace("ms",""),Yt=el[Gt],li=kl[De.pointerType]||De.pointerType,Vr=li==Ge,es=E(He,De.pointerId,"pointerId");1&Yt&&(0===De.button||Vr)?es<0&&(He.push(De),es=He.length-1):12&Yt&&(bt=!0),!(es<0)&&(He[es]=De,this.callback(this.manager,Yt,{pointers:He,changedPointers:[De],pointerType:li,srcEvent:De}),bt&&He.splice(es,1))}});var tl={touchstart:1,touchmove:2,touchend:4,touchcancel:8},rt="touchstart",lt="touchstart touchmove touchend touchcancel";function ht(){this.evTarget=rt,this.evWin=lt,this.started=!1,ve.apply(this,arguments)}function ge(ye,De){var He=$(ye.touches),bt=$(ye.changedTouches);return 12&De&&(He=Z(He.concat(bt),"identifier",!0)),[He,bt]}S(ht,ve,{handler:function(De){var He=tl[De.type];if(1===He&&(this.started=!0),this.started){var bt=ge.call(this,De,He);12&He&&bt[0].length-bt[1].length==0&&(this.started=!1),this.callback(this.manager,He,{pointers:bt[0],changedPointers:bt[1],pointerType:Ge,srcEvent:De})}}});var be={touchstart:1,touchmove:2,touchend:4,touchcancel:8},Le="touchstart touchmove touchend touchcancel";function ut(){this.evTarget=Le,this.targetIds={},ve.apply(this,arguments)}function Ze(ye,De){var He=$(ye.touches),bt=this.targetIds;if(3&De&&1===He.length)return bt[He[0].identifier]=!0,[He,He];var Gt,Yt,li=$(ye.changedTouches),Vr=[],es=this.target;if(Yt=He.filter(function(xs){return D(xs.target,es)}),1===De)for(Gt=0;Gt-1&&bt.splice(Yt,1)},2500)}}function ai(ye){for(var De=ye.srcEvent.clientX,He=ye.srcEvent.clientY,bt=0;bt-1&&this.requireFail.splice(De,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(ye){return!!this.simultaneous[ye.id]},emit:function(ye){var De=this,He=this.state;function bt(Gt){De.manager.emit(Gt,ye)}He<8&&bt(De.options.event+We(He)),bt(De.options.event),ye.additionalEvent&&bt(ye.additionalEvent),He>=8&&bt(De.options.event+We(He))},tryEmit:function(ye){if(this.canEmit())return this.emit(ye);this.state=32},canEmit:function(){for(var ye=0;yeDe.threshold&&Gt&De.direction},attrTest:function(ye){return vn.prototype.attrTest.call(this,ye)&&(2&this.state||!(2&this.state)&&this.directionTest(ye))},emit:function(ye){this.pX=ye.deltaX,this.pY=ye.deltaY;var De=Wt(ye.direction);De&&(ye.additionalEvent=this.options.event+De),this._super.emit.call(this,ye)}}),S(Jr,vn,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[cr]},attrTest:function(ye){return this._super.attrTest.call(this,ye)&&(Math.abs(ye.scale-1)>this.options.threshold||2&this.state)},emit:function(ye){1!==ye.scale&&(ye.additionalEvent=this.options.event+(ye.scale<1?"in":"out")),this._super.emit.call(this,ye)}}),S(Qs,Ot,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return["auto"]},process:function(ye){var De=this.options,He=ye.pointers.length===De.pointers,bt=ye.distanceDe.time;if(this._input=ye,!bt||!He||12&ye.eventType&&!Gt)this.reset();else if(1&ye.eventType)this.reset(),this._timer=z(function(){this.state=8,this.tryEmit()},De.time,this);else if(4&ye.eventType)return 8;return 32},reset:function(){clearTimeout(this._timer)},emit:function(ye){8===this.state&&(ye&&4&ye.eventType?this.manager.emit(this.options.event+"up",ye):(this._input.timeStamp=Q(),this.manager.emit(this.options.event,this._input)))}}),S(Ll,vn,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[cr]},attrTest:function(ye){return this._super.attrTest.call(this,ye)&&(Math.abs(ye.rotation)>this.options.threshold||2&this.state)}}),S(po,vn,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:30,pointers:1},getTouchAction:function(){return Ss.prototype.getTouchAction.call(this)},attrTest:function(ye){var He,De=this.options.direction;return 30&De?He=ye.overallVelocity:6&De?He=ye.overallVelocityX:24&De&&(He=ye.overallVelocityY),this._super.attrTest.call(this,ye)&&De&ye.offsetDirection&&ye.distance>this.options.threshold&&ye.maxPointers==this.options.pointers&&P(He)>this.options.velocity&&4&ye.eventType},emit:function(ye){var De=Wt(ye.offsetDirection);De&&this.manager.emit(this.options.event+De,ye),this.manager.emit(this.options.event,ye)}}),S(jr,Ot,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[lr]},process:function(ye){var De=this.options,He=ye.pointers.length===De.pointers,bt=ye.distance"']/g,Es=RegExp(kl.source),Jt=RegExp(Sa.source),tl=/<%-([\s\S]+?)%>/g,rt=/<%([\s\S]+?)%>/g,lt=/<%=([\s\S]+?)%>/g,ht=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ge=/^\w*$/,be=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Le=/[\\^$.*+?()[\]{}|]/g,ut=RegExp(Le.source),Ze=/^\s+/,At=/\s/,Mt=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Dt=/\{\n\/\* \[wrapped with (.+)\] \*/,Xt=/,? & /,zn=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ai=/[()=,{}\[\]\/\s]/,Nn=/\\(\\)?/g,bn=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,$n=/\w*$/,Tn=/^[-+]0x[0-9a-f]+$/i,lr=/^0b[01]+$/i,cr=/^\[object .+?Constructor\]$/,Xn=/^0o[0-7]+$/i,$i=/^(?:0|[1-9]\d*)$/,xa=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Zr=/($^)/,ie=/['\n\r\u2028\u2029\\]/g,fe="\\ud800-\\udfff",J="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",we="\\u2700-\\u27bf",Fe="a-z\\xdf-\\xf6\\xf8-\\xff",xt="A-Z\\xc0-\\xd6\\xd8-\\xde",vn="\\ufe0e\\ufe0f",Ss="\\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",Qs="["+fe+"]",Ll="["+Ss+"]",po="["+J+"]",jr="\\d+",js="["+we+"]",xc="["+Fe+"]",Sn="[^"+fe+Ss+jr+we+Fe+xt+"]",go="\\ud83c[\\udffb-\\udfff]",Ca="[^"+fe+"]",wd="(?:\\ud83c[\\udde6-\\uddff]){2}",ye="[\\ud800-\\udbff][\\udc00-\\udfff]",De="["+xt+"]",bt="(?:"+xc+"|"+Sn+")",Gt="(?:"+De+"|"+Sn+")",Yt="(?:['\u2019](?:d|ll|m|re|s|t|ve))?",li="(?:['\u2019](?:D|LL|M|RE|S|T|VE))?",Vr="(?:"+po+"|"+go+")?",es="["+vn+"]?",A1=es+Vr+"(?:\\u200d(?:"+[Ca,wd,ye].join("|")+")"+es+Vr+")*",Ed="(?:"+[js,wd,ye].join("|")+")"+A1,tr="(?:"+[Ca+po+"?",po,wd,ye,Qs].join("|")+")",fp=RegExp("['\u2019]","g"),Jm=RegExp(po,"g"),Dh=RegExp(go+"(?="+go+")|"+tr+A1,"g"),sv=RegExp([De+"?"+xc+"+"+Yt+"(?="+[Ll,De,"$"].join("|")+")",Gt+"+"+li+"(?="+[Ll,De+bt,"$"].join("|")+")",De+"?"+bt+"+"+Yt,De+"+"+li,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",jr,Ed].join("|"),"g"),T1=RegExp("[\\u200d"+fe+J+vn+"]"),jl=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Ih=["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"],M1=-1,ln={};ln[Nt]=ln[On]=ln[kn]=ln[Yn]=ln[Ti]=ln[wi]=ln[Xr]=ln[Ls]=ln[gs]=!0,ln[Xe]=ln[tt]=ln[Qe]=ln[Ue]=ln[St]=ln[ke]=ln[Me]=ln[Ve]=ln[Ne]=ln[q]=ln[pe]=ln[_t]=ln[pt]=ln[ve]=ln[B]=!1;var ur={};ur[Xe]=ur[tt]=ur[Qe]=ur[St]=ur[Ue]=ur[ke]=ur[Nt]=ur[On]=ur[kn]=ur[Yn]=ur[Ti]=ur[Ne]=ur[q]=ur[pe]=ur[_t]=ur[pt]=ur[ve]=ur[L]=ur[wi]=ur[Xr]=ur[Ls]=ur[gs]=!0,ur[Me]=ur[Ve]=ur[B]=!1;var on={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},D1=parseFloat,cv=parseInt,Rt="object"==typeof global&&global&&global.Object===Object&&global,Vs="object"==typeof self&&self&&self.Object===Object&&self,Vi=Rt||Vs||Function("return this")(),Vl=it&&!it.nodeType&&it,Aa=Vl&&Ut&&!Ut.nodeType&&Ut,Oo=Aa&&Aa.exports===Vl,e_=Oo&&Rt.process,Sr=function(){try{return Aa&&Aa.require&&Aa.require("util").types||e_&&e_.binding&&e_.binding("util")}catch(It){}}(),nn=Sr&&Sr.isArrayBuffer,hi=Sr&&Sr.isDate,pr=Sr&&Sr.isMap,mo=Sr&&Sr.isRegExp,Cc=Sr&&Sr.isSet,as=Sr&&Sr.isTypedArray;function ls(at,It,Et){switch(Et.length){case 0:return at.call(It);case 1:return at.call(It,Et[0]);case 2:return at.call(It,Et[0],Et[1]);case 3:return at.call(It,Et[0],Et[1],Et[2])}return at.apply(It,Et)}function Ur(at,It,Et,hn){for(var Dn=-1,Li=null==at?0:at.length;++Dn-1}function Oh(at,It,Et){for(var hn=-1,Dn=null==at?0:at.length;++hn-1;);return Et}function N1(at,It){for(var Et=at.length;Et--&&nl(It,at[Et],0)>-1;);return Et}function c2(at,It){for(var Et=at.length,hn=0;Et--;)at[Et]===It&&++hn;return hn}var u2=Qo({\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"}),d2=Qo({"&":"&","<":"<",">":">",'"':""","'":"'"});function h2(at){return"\\"+on[at]}function Ph(at){return T1.test(at)}function dv(at){var It=-1,Et=Array(at.size);return at.forEach(function(hn,Dn){Et[++It]=[Dn,hn]}),Et}function P1(at,It){return function(Et){return at(It(Et))}}function yu(at,It){for(var Et=-1,hn=at.length,Dn=0,Li=[];++Et",""":'"',"'":"'"}),kh=function at(It){var d,Et=(It=null==It?Vi:kh.defaults(Vi.Object(),It,kh.pick(Vi,Ih))).Array,hn=It.Date,Dn=It.Error,Li=It.Function,ts=It.Math,Ki=It.Object,a_=It.RegExp,l_=It.String,Da=It.TypeError,gr=Et.prototype,bu=Ki.prototype,gp=It["__core-js_shared__"],xr=Li.prototype.toString,Xi=bu.hasOwnProperty,y2=0,Lh=(d=/[^.]+$/.exec(gp&&gp.keys&&gp.keys.IE_PROTO||""))?"Symbol(src)_1."+d:"",Zs=bu.toString,L1=xr.call(Ki),c_=Vi._,Md=a_("^"+xr.call(Xi).replace(Le,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),zs=Oo?It.Buffer:ee,zl=It.Symbol,Dd=It.Uint8Array,pv=zs?zs.allocUnsafe:ee,Ia=P1(Ki.getPrototypeOf,Ki),u_=Ki.create,mp=bu.propertyIsEnumerable,Bn=gr.splice,B1=zl?zl.isConcatSpreadable:ee,Bh=zl?zl.iterator:ee,vu=zl?zl.toStringTag:ee,_p=function(){try{var d=Lc(Ki,"defineProperty");return d({},"",{}),d}catch(f){}}(),gv=It.clearTimeout!==Vi.clearTimeout&&It.clearTimeout,j1=hn&&hn.now!==Vi.Date.now&&hn.now,V1=It.setTimeout!==Vi.setTimeout&&It.setTimeout,jt=ts.ceil,Ei=ts.floor,Cr=Ki.getOwnPropertySymbols,cs=zs?zs.isBuffer:ee,d_=It.isFinite,jh=gr.join,rl=P1(Ki.keys,Ki),Hr=ts.max,ms=ts.min,b2=hn.now,U1=It.parseInt,Vh=ts.random,yp=gr.reverse,As=Lc(It,"DataView"),_o=Lc(It,"Map"),bp=Lc(It,"Promise"),Oa=Lc(It,"Set"),No=Lc(It,"WeakMap"),Uh=Lc(Ki,"create"),zh=No&&new No,Id={},z1=Ru(As),h_=Ru(_o),f_=Ru(bp),mv=Ru(Oa),p_=Ru(No),vp=zl?zl.prototype:ee,Od=vp?vp.valueOf:ee,Hh=vp?vp.toString:ee;function Ee(d){if(Mr(d)&&!Rn(d)&&!(d instanceof fi)){if(d instanceof Po)return d;if(Xi.call(d,"__wrapped__"))return nf(d)}return new Po(d)}var wu=function(){function d(){}return function(f){if(!Tr(f))return{};if(u_)return u_(f);d.prototype=f;var _=new d;return d.prototype=ee,_}}();function Gh(){}function Po(d,f){this.__wrapped__=d,this.__actions__=[],this.__chain__=!!f,this.__index__=0,this.__values__=ee}function fi(d){this.__wrapped__=d,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=_e,this.__views__=[]}function yo(d){var f=-1,_=null==d?0:d.length;for(this.clear();++f<_;){var F=d[f];this.set(F[0],F[1])}}function Hl(d){var f=-1,_=null==d?0:d.length;for(this.clear();++f<_;){var F=d[f];this.set(F[0],F[1])}}function sl(d){var f=-1,_=null==d?0:d.length;for(this.clear();++f<_;){var F=d[f];this.set(F[0],F[1])}}function Ra(d){var f=-1,_=null==d?0:d.length;for(this.__data__=new sl;++f<_;)this.add(d[f])}function Na(d){var f=this.__data__=new Hl(d);this.size=f.size}function Wh(d,f){var _=Rn(d),F=!_&&pl(d),ae=!_&&!F&&gl(d),Te=!_&&!F&&!ae&&cf(d),ze=_||F||ae||Te,qe=ze?Td(d.length,l_):[],ct=qe.length;for(var kt in d)(f||Xi.call(d,kt))&&(!ze||!("length"==kt||ae&&("offset"==kt||"parent"==kt)||Te&&("buffer"==kt||"byteLength"==kt||"byteOffset"==kt)||Bo(kt,ct)))&&qe.push(kt);return qe}function y_(d){var f=d.length;return f?d[Gl(0,f-1)]:ee}function vv(d,f){return Wd(eo(d),Eu(f,0,d.length))}function Rd(d){return Wd(eo(d))}function b_(d,f,_){(_!==ee&&!In(d[f],_)||_===ee&&!(f in d))&&al(d,f,_)}function ol(d,f,_){var F=d[f];(!Xi.call(d,f)||!In(F,_)||_===ee&&!(f in d))&&al(d,f,_)}function Nd(d,f){for(var _=d.length;_--;)if(In(d[_][0],f))return _;return-1}function Cp(d,f,_,F){return Ic(d,function(ae,Te,ze){f(F,ae,_(ae),ze)}),F}function Z1(d,f){return d&&Fa(f,Os(f),d)}function al(d,f,_){"__proto__"==f&&_p?_p(d,f,{configurable:!0,enumerable:!0,value:_,writable:!0}):d[f]=_}function v_(d,f){for(var _=-1,F=f.length,ae=Et(F),Te=null==d;++_=f?d:f)),d}function Hs(d,f,_,F,ae,Te){var ze,qe=1&f,ct=2&f,kt=4&f;if(_&&(ze=ae?_(d,F,ae,Te):_(d)),ze!==ee)return ze;if(!Tr(d))return d;var Lt=Rn(d);if(Lt){if(ze=function(d){var f=d.length,_=new d.constructor(f);return f&&"string"==typeof d[0]&&Xi.call(d,"index")&&(_.index=d.index,_.input=d.input),_}(d),!qe)return eo(d,ze)}else{var zt=$s(d),en=zt==Ve||zt==$e;if(gl(d))return Np(d,qe);if(zt==pe||zt==Xe||en&&!ae){if(ze=ct||en?{}:Hv(d),!qe)return ct?function(d,f){return Fa(d,Vv(d),f)}(d,function(d,f){return d&&Fa(f,no(f),d)}(ze,d)):function(d,f){return Fa(d,k_(d),f)}(d,Z1(ze,d))}else{if(!ur[zt])return ae?d:{};ze=function(d,f,_){var F=d.constructor;switch(f){case Qe:return Mu(d);case Ue:case ke:return new F(+d);case St:return function(d,f){var _=f?Mu(d.buffer):d.buffer;return new d.constructor(_,d.byteOffset,d.byteLength)}(d,_);case Nt:case On:case kn:case Yn:case Ti:case wi:case Xr:case Ls:case gs:return O_(d,_);case Ne:return new F;case q:case ve:return new F(d);case _t:return function(d){var f=new d.constructor(d.source,$n.exec(d));return f.lastIndex=d.lastIndex,f}(d);case pt:return new F;case L:return function(d){return Od?Ki(Od.call(d)):{}}(d)}}(d,zt,qe)}}Te||(Te=new Na);var wn=Te.get(d);if(wn)return wn;Te.set(d,ze),yT(d)?d.forEach(function(jn){ze.add(Hs(jn,f,_,jn,d,Te))}):pT(d)&&d.forEach(function(jn,mi){ze.set(mi,Hs(jn,f,_,mi,d,Te))});var gi=Lt?ee:(kt?ct?P_:Yl:ct?no:Os)(d);return Us(gi||d,function(jn,mi){gi&&(jn=d[mi=jn]),ol(ze,mi,Hs(jn,f,_,mi,d,Te))}),ze}function Ap(d,f,_){var F=_.length;if(null==d)return!F;for(d=Ki(d);F--;){var ae=_[F],ze=d[ae];if(ze===ee&&!(ae in d)||!(0,f[ae])(ze))return!1}return!0}function qh(d,f,_){if("function"!=typeof d)throw new Da(Se);return ef(function(){d.apply(ee,_)},f)}function Dc(d,f,_,F){var ae=-1,Te=Ul,ze=!0,qe=d.length,ct=[],kt=f.length;if(!qe)return ct;_&&(f=Yi(f,Jo(_))),F?(Te=Oh,ze=!1):f.length>=200&&(Te=Nh,ze=!1,f=new Ra(f));e:for(;++ae-1},Hl.prototype.set=function(d,f){var _=this.__data__,F=Nd(_,d);return F<0?(++this.size,_.push([d,f])):_[F][1]=f,this},sl.prototype.clear=function(){this.size=0,this.__data__={hash:new yo,map:new(_o||Hl),string:new yo}},sl.prototype.delete=function(d){var f=Gs(this,d).delete(d);return this.size-=f?1:0,f},sl.prototype.get=function(d){return Gs(this,d).get(d)},sl.prototype.has=function(d){return Gs(this,d).has(d)},sl.prototype.set=function(d,f){var _=Gs(this,d),F=_.size;return _.set(d,f),this.size+=_.size==F?0:1,this},Ra.prototype.add=Ra.prototype.push=function(d){return this.__data__.set(d,W),this},Ra.prototype.has=function(d){return this.__data__.has(d)},Na.prototype.clear=function(){this.__data__=new Hl,this.size=0},Na.prototype.delete=function(d){var f=this.__data__,_=f.delete(d);return this.size=f.size,_},Na.prototype.get=function(d){return this.__data__.get(d)},Na.prototype.has=function(d){return this.__data__.has(d)},Na.prototype.set=function(d,f){var _=this.__data__;if(_ instanceof Hl){var F=_.__data__;if(!_o||F.length<199)return F.push([d,f]),this.size=++_.size,this;_=this.__data__=new sl(F)}return _.set(d,f),this.size=_.size,this};var Ic=ul(ll),E_=ul(Tp,!0);function Ev(d,f){var _=!0;return Ic(d,function(F,ae,Te){return _=!!f(F,ae,Te)}),_}function Yh(d,f,_){for(var F=-1,ae=d.length;++F0&&_(qe)?f>1?Ts(qe,f-1,_,F,ae):zr(ae,qe):F||(ae[ae.length]=qe)}return ae}var Pd=Ov(),Fd=Ov(!0);function ll(d,f){return d&&Pd(d,f,Os)}function Tp(d,f){return d&&Fd(d,f,Os)}function Kh(d,f){return Ta(f,function(_){return la(d[_])})}function ea(d,f){for(var _=0,F=(f=Pc(f,d)).length;null!=d&&_f}function kd(d,f){return null!=d&&Xi.call(d,f)}function Ld(d,f){return null!=d&&f in Ki(d)}function Su(d,f,_){for(var F=_?Oh:Ul,ae=d[0].length,Te=d.length,ze=Te,qe=Et(Te),ct=1/0,kt=[];ze--;){var Lt=d[ze];ze&&f&&(Lt=Yi(Lt,Jo(f))),ct=ms(Lt.length,ct),qe[ze]=!_&&(f||ae>=120&&Lt.length>=120)?new Ra(ze&&Lt):ee}Lt=d[0];var zt=-1,en=qe[0];e:for(;++zt=qe?ct:ct*("desc"==_[F]?-1:1)}return d.index-f.index}(Te,ze,_)});Et--;)at[Et]=at[Et].value;return at}(iA(d,function(Te,ze,qe){return{criteria:Yi(f,function(kt){return kt(Te)}),index:++F,value:Te}}))}function Tv(d,f,_){for(var F=-1,ae=f.length,Te={};++F-1;)qe!==d&&Bn.call(qe,ct,1),Bn.call(d,ct,1);return d}function Qh(d,f){for(var _=d?f.length:0,F=_-1;_--;){var ae=f[_];if(_==F||ae!==Te){var Te=ae;Bo(ae)?Bn.call(d,ae,1):Cu(d,ae)}}return d}function Gl(d,f){return d+Ei(Vh()*(f-d+1))}function Dp(d,f){var _="";if(!d||f<1||f>Ce)return _;do{f%2&&(_+=d),(f=Ei(f/2))&&(d+=d)}while(f);return _}function pi(d,f){return Hp(bA(d,f,io),d+"")}function sA(d){return y_(th(d))}function M2(d,f){var _=th(d);return Wd(_,Eu(f,0,_.length))}function Ip(d,f,_,F){if(!Tr(d))return d;for(var ae=-1,Te=(f=Pc(f,d)).length,ze=Te-1,qe=d;null!=qe&&++aeae?0:ae+f),(_=_>ae?ae:_)<0&&(_+=ae),ae=f>_?0:_-f>>>0,f>>>=0;for(var Te=Et(ae);++F>>1,ze=d[Te];null!==ze&&!ca(ze)&&(_?ze<=f:ze=200){var kt=f?null:N_(d);if(kt)return r_(kt);ze=!1,ae=Nh,ct=new Ra}else ct=f?[]:qe;e:for(;++F=F?d:Ds(d,f,_)}var lA=gv||function(d){return Vi.clearTimeout(d)};function Np(d,f){if(f)return d.slice();var _=d.length,F=pv?pv(_):new d.constructor(_);return d.copy(F),F}function Mu(d){var f=new d.constructor(d.byteLength);return new Dd(f).set(new Dd(d)),f}function O_(d,f){var _=f?Mu(d.buffer):d.buffer;return new d.constructor(_,d.byteOffset,d.length)}function Fc(d,f){if(d!==f){var _=d!==ee,F=null===d,ae=d==d,Te=ca(d),ze=f!==ee,qe=null===f,ct=f==f,kt=ca(f);if(!qe&&!kt&&!Te&&d>f||Te&&ze&&ct&&!qe&&!kt||F&&ze&&ct||!_&&ct||!ae)return 1;if(!F&&!Te&&!kt&&d1?_[ae-1]:ee,ze=ae>2?_[2]:ee;for(Te=d.length>3&&"function"==typeof Te?(ae--,Te):ee,ze&&Ws(_[0],_[1],ze)&&(Te=ae<3?ee:Te,ae=1),f=Ki(f);++F-1?ae[Te?f[ze]:ze]:ee}}function Iu(d){return dl(function(f){var _=f.length,F=_,ae=Po.prototype.thru;for(d&&f.reverse();F--;){var Te=f[F];if("function"!=typeof Te)throw new Da(Se);if(ae&&!ze&&"wrapper"==Vp(Te))var ze=new Po([],!0)}for(F=ze?F:_;++F<_;){var qe=Vp(Te=f[F]),ct="wrapper"==qe?F_(Te):ee;ze=ct&&Up(ct[0])&&424==ct[1]&&!ct[4].length&&1==ct[9]?ze[Vp(ct[0])].apply(ze,ct[3]):1==Te.length&&Up(Te)?ze[qe]():ze.thru(Te)}return function(){var kt=arguments,Lt=kt[0];if(ze&&1==kt.length&&Rn(Lt))return ze.plant(Lt).value();for(var zt=0,en=_?f[zt].apply(this,kt):Lt;++zt<_;)en=f[zt].call(this,en);return en}})}function kc(d,f,_,F,ae,Te,ze,qe,ct,kt){var Lt=f&K,zt=1&f,en=2&f,wn=24&f,Ln=512&f,gi=en?ee:Hd(d);return function jn(){for(var mi=arguments.length,Mi=Et(mi),wo=mi;wo--;)Mi[wo]=arguments[wo];if(wn)var qs=$d(jn),ua=c2(Mi,qs);if(F&&(Mi=Ud(Mi,F,ae,wn)),Te&&(Mi=Iv(Mi,Te,ze,wn)),mi-=ua,wn&&mi1&&Mi.reverse(),Lt&&ctqe))return!1;var kt=Te.get(d),Lt=Te.get(f);if(kt&&Lt)return kt==f&&Lt==d;var zt=-1,en=!0,wn=2&_?new Ra:ee;for(Te.set(d,f),Te.set(f,d);++zt-1&&d%1==0&&d1?"& ":"")+f[F],f=f.join(_>2?", ":" "),d.replace(Mt,"{\n/* [wrapped with "+f+"] */\n")}(F,function(d,f){return Us(st,function(_){var F="_."+_[0];f&_[1]&&!Ul(d,F)&&d.push(F)}),d.sort()}(function(d){var f=d.match(Dt);return f?f[1].split(Xt):[]}(F),_)))}function z_(d){var f=0,_=0;return function(){var F=b2(),ae=16-(F-_);if(_=F,ae>0){if(++f>=800)return arguments[0]}else f=0;return d.apply(ee,arguments)}}function Wd(d,f){var _=-1,F=d.length,ae=F-1;for(f=f===ee?F:f;++_1?d[f-1]:ee;return _="function"==typeof _?(d.pop(),_):ee,GA(d,_)});function Z_(d){var f=Ee(d);return f.__chain__=!0,f}function Yd(d,f){return f(d)}var J_=dl(function(d){var f=d.length,_=f?d[0]:0,F=this.__wrapped__,ae=function(Te){return v_(Te,d)};return!(f>1||this.__actions__.length)&&F instanceof fi&&Bo(_)?((F=F.slice(_,+_+(f?1:0))).__actions__.push({func:Yd,args:[ae],thisArg:ee}),new Po(F,this.__chain__).thru(function(Te){return f&&!Te.length&&Te.push(ee),Te})):this.thru(ae)}),qA=ns(function(d,f,_){Xi.call(d,_)?++d[_]:al(d,_,1)}),XA=Nv(G_),QA=Nv($_);function iy(d,f){return(Rn(d)?Us:Ic)(d,Fn(f,3))}function Wp(d,f){return(Rn(d)?Sd:E_)(d,Fn(f,3))}var JA=ns(function(d,f,_){Xi.call(d,_)?d[_].push(f):al(d,_,[f])}),dw=pi(function(d,f,_){var F=-1,ae="function"==typeof f,Te=bo(d)?Et(d.length):[];return Ic(d,function(ze){Te[++F]=ae?ls(f,ze,_):Pa(ze,f,_)}),Te}),hw=ns(function(d,f,_){al(d,_,f)});function fl(d,f){return(Rn(d)?Yi:iA)(d,Fn(f,3))}var pw=ns(function(d,f,_){d[_?0:1].push(f)},function(){return[[],[]]}),Yp=pi(function(d,f){if(null==d)return[];var _=f.length;return _>1&&Ws(d,f[0],f[1])?f=[]:_>2&&Ws(f[0],f[1],f[2])&&(f=[f[0]]),Xh(d,Ts(f,1),[])}),Nu=j1||function(){return Vi.Date.now()};function Kp(d,f,_){return f=_?ee:f,ql(d,K,ee,ee,ee,ee,f=d&&null==f?d.length:f)}function sy(d,f){var _;if("function"!=typeof f)throw new Da(Se);return d=Jn(d),function(){return--d>0&&(_=f.apply(this,arguments)),d<=1&&(f=ee),_}}var af=pi(function(d,f,_){var F=1;if(_.length){var ae=yu(_,$d(af));F|=V}return ql(d,F,f,_,ae)}),Xd=pi(function(d,f,_){var F=3;if(_.length){var ae=yu(_,$d(Xd));F|=V}return ql(f,F,d,_,ae)});function ww(d,f,_){var F,ae,Te,ze,qe,ct,kt=0,Lt=!1,zt=!1,en=!0;if("function"!=typeof d)throw new Da(Se);function wn(Hi){var yl=F,Uc=ae;return F=ae=ee,kt=Hi,ze=d.apply(Uc,yl)}function Ln(Hi){return kt=Hi,qe=ef(mi,f),Lt?wn(Hi):ze}function jn(Hi){var yl=Hi-ct;return ct===ee||yl>=f||yl<0||zt&&Hi-kt>=Te}function mi(){var Hi=Nu();if(jn(Hi))return Mi(Hi);qe=ef(mi,function(Hi){var lM=f-(Hi-ct);return zt?ms(lM,Te-(Hi-kt)):lM}(Hi))}function Mi(Hi){return qe=ee,en&&F?wn(Hi):(F=ae=ee,ze)}function ua(){var Hi=Nu(),yl=jn(Hi);if(F=arguments,ae=this,ct=Hi,yl){if(qe===ee)return Ln(ct);if(zt)return lA(qe),qe=ef(mi,f),wn(ct)}return qe===ee&&(qe=ef(mi,f)),ze}return f=vo(f)||0,Tr(_)&&(Lt=!!_.leading,Te=(zt="maxWait"in _)?Hr(vo(_.maxWait)||0,f):Te,en="trailing"in _?!!_.trailing:en),ua.cancel=function(){qe!==ee&&lA(qe),kt=0,F=ct=ae=qe=ee},ua.flush=function(){return qe===ee?ze:Mi(Nu())},ua}var iT=pi(function(d,f){return qh(d,1,f)}),Ew=pi(function(d,f,_){return qh(d,vo(f)||0,_)});function lf(d,f){if("function"!=typeof d||null!=f&&"function"!=typeof f)throw new Da(Se);var _=function(){var F=arguments,ae=f?f.apply(this,F):F[0],Te=_.cache;if(Te.has(ae))return Te.get(ae);var ze=d.apply(this,F);return _.cache=Te.set(ae,ze)||Te,ze};return _.cache=new(lf.Cache||sl),_}function ly(d){if("function"!=typeof d)throw new Da(Se);return function(){var f=arguments;switch(f.length){case 0:return!d.call(this);case 1:return!d.call(this,f[0]);case 2:return!d.call(this,f[0],f[1]);case 3:return!d.call(this,f[0],f[1],f[2])}return!d.apply(this,f)}}lf.Cache=sl;var rT=aA(function(d,f){var _=(f=1==f.length&&Rn(f[0])?Yi(f[0],Jo(Fn())):Yi(Ts(f,1),Jo(Fn()))).length;return pi(function(F){for(var ae=-1,Te=ms(F.length,_);++ae=f}),pl=J1(function(){return arguments}())?J1:function(d){return Mr(d)&&Xi.call(d,"callee")&&!mp.call(d,"callee")},Rn=Et.isArray,Mw=nn?Jo(nn):function(d){return Mr(d)&&Ms(d)==Qe};function bo(d){return null!=d&&uy(d.length)&&!la(d)}function Ar(d){return Mr(d)&&bo(d)}var gl=cs||Ny,Dw=hi?Jo(hi):function(d){return Mr(d)&&Ms(d)==ke};function La(d){if(!Mr(d))return!1;var f=Ms(d);return f==Me||"[object DOMException]"==f||"string"==typeof d.message&&"string"==typeof d.name&&!Jp(d)}function la(d){if(!Tr(d))return!1;var f=Ms(d);return f==Ve||f==$e||"[object AsyncFunction]"==f||"[object Proxy]"==f}function Zp(d){return"number"==typeof d&&d==Jn(d)}function uy(d){return"number"==typeof d&&d>-1&&d%1==0&&d<=Ce}function Tr(d){var f=typeof d;return null!=d&&("object"==f||"function"==f)}function Mr(d){return null!=d&&"object"==typeof d}var pT=pr?Jo(pr):function(d){return Mr(d)&&$s(d)==Ne};function _T(d){return"number"==typeof d||Mr(d)&&Ms(d)==q}function Jp(d){if(!Mr(d)||Ms(d)!=pe)return!1;var f=Ia(d);if(null===f)return!0;var _=Xi.call(f,"constructor")&&f.constructor;return"function"==typeof _&&_ instanceof _&&xr.call(_)==L1}var Nw=mo?Jo(mo):function(d){return Mr(d)&&Ms(d)==_t},yT=Cc?Jo(Cc):function(d){return Mr(d)&&$s(d)==pt};function hy(d){return"string"==typeof d||!Rn(d)&&Mr(d)&&Ms(d)==ve}function ca(d){return"symbol"==typeof d||Mr(d)&&Ms(d)==L}var cf=as?Jo(as):function(d){return Mr(d)&&uy(d.length)&&!!ln[Ms(d)]},Bc=Lp(Av),fy=Lp(function(d,f){return d<=f});function Pw(d){if(!d)return[];if(bo(d))return hy(d)?il(d):eo(d);if(Bh&&d[Bh])return function(at){for(var It,Et=[];!(It=at.next()).done;)Et.push(It.value);return Et}(d[Bh]());var f=$s(d);return(f==Ne?dv:f==pt?r_:th)(d)}function ml(d){return d?(d=vo(d))===te||d===-te?17976931348623157e292*(d<0?-1:1):d==d?d:0:0===d?d:0}function Jn(d){var f=ml(d),_=f%1;return f==f?_?f-_:f:0}function py(d){return d?Eu(Jn(d),0,_e):0}function vo(d){if("number"==typeof d)return d;if(ca(d))return NaN;if(Tr(d)){var f="function"==typeof d.valueOf?d.valueOf():d;d=Tr(f)?f+"":f}if("string"!=typeof d)return 0===d?d:+d;d=uv(d);var _=lr.test(d);return _||Xn.test(d)?cv(d.slice(2),_?2:8):Tn.test(d)?NaN:+d}function Fw(d){return Fa(d,no(d))}function zi(d){return null==d?"":Lo(d)}var bT=$l(function(d,f){if(zp(f)||bo(f))Fa(f,Os(f),d);else for(var _ in f)Xi.call(f,_)&&ol(d,_,f[_])}),vT=$l(function(d,f){Fa(f,no(f),d)}),Qd=$l(function(d,f,_,F){Fa(f,no(f),d,F)}),wT=$l(function(d,f,_,F){Fa(f,Os(f),d,F)}),kw=dl(v_),ST=pi(function(d,f){d=Ki(d);var _=-1,F=f.length,ae=F>2?f[2]:ee;for(ae&&Ws(f[0],f[1],ae)&&(F=1);++_1),Te}),Fa(d,P_(d),_),F&&(_=Hs(_,7,Bp));for(var ae=f.length;ae--;)Cu(_,f[ae]);return _}),MT=dl(function(d,f){return null==d?{}:function(d,f){return Tv(d,f,function(_,F){return eg(d,F)})}(d,f)});function Hw(d,f){if(null==d)return{};var _=Yi(P_(d),function(F){return[F]});return f=Fn(f),Tv(d,_,function(F,ae){return f(F,ae[0])})}var DT=Ou(Os),$w=Ou(no);function th(d){return null==d?[]:i_(d,Os(d))}var PT=Wl(function(d,f,_){return f=f.toLowerCase(),d+(_?yy(f):f)});function yy(d){return ig(zi(d).toLowerCase())}function by(d){return(d=zi(d))&&d.replace(xa,u2).replace(Jm,"")}var kT=Wl(function(d,f,_){return d+(_?"-":"")+f.toLowerCase()}),LT=Wl(function(d,f,_){return d+(_?" ":"")+f.toLowerCase()}),K2=Pp("toLowerCase"),zT=Wl(function(d,f,_){return d+(_?"_":"")+f.toLowerCase()}),Ey=Wl(function(d,f,_){return d+(_?" ":"")+ig(f)}),Qw=Wl(function(d,f,_){return d+(_?" ":"")+f.toUpperCase()}),ig=Pp("toUpperCase");function Ay(d,f,_){return d=zi(d),(f=_?ee:f)===ee?function(at){return jl.test(at)}(d)?function(at){return at.match(sv)||[]}(d):function(at){return at.match(zn)||[]}(d):d.match(f)||[]}var Ty=pi(function(d,f){try{return ls(d,ee,f)}catch(_){return La(_)?_:new Dn(_)}}),Zw=dl(function(d,f){return Us(f,function(_){_=ni(_),al(d,_,af(d[_],d))}),d});function My(d){return function(){return d}}var Q2=Iu(),Pu=Iu(!0);function io(d){return d}function Fu(d){return nA("function"==typeof d?d:Hs(d,1))}var Dy=pi(function(d,f){return function(_){return Pa(_,d,f)}}),Jw=pi(function(d,f){return function(_){return Pa(d,_,f)}});function Iy(d,f,_){var F=Os(f),ae=Kh(f,F);null==_&&(!Tr(f)||!ae.length&&F.length)&&(_=f,f=d,d=this,ae=Kh(f,Os(f)));var Te=!(Tr(_)&&"chain"in _&&!_.chain),ze=la(d);return Us(ae,function(qe){var ct=f[qe];d[qe]=ct,ze&&(d.prototype[qe]=function(){var kt=this.__chain__;if(Te||kt){var Lt=d(this.__wrapped__),zt=Lt.__actions__=eo(this.__actions__);return zt.push({func:ct,args:arguments,thisArg:d}),Lt.__chain__=kt,Lt}return ct.apply(d,zr([this.value()],arguments))})}),d}function Oy(){}var XT=Fp(Yi),QT=Fp(ti),tE=Fp(Ro);function ku(d){return ra(d)?t_(ni(d)):function(d){return function(f){return ea(f,d)}}(d)}var ZT=Fv(),JT=Fv(!0);function Vc(){return[]}function Ny(){return!1}var Wn=R_(function(d,f){return d+f},0),Py=Gd("ceil"),J2=R_(function(d,f){return d/f},1),Ql=Gd("floor"),sE=R_(function(d,f){return d*f},1),oE=Gd("round"),aE=R_(function(d,f){return d-f},0);return Ee.after=function(d,f){if("function"!=typeof f)throw new Da(Se);return d=Jn(d),function(){if(--d<1)return f.apply(this,arguments)}},Ee.ary=Kp,Ee.assign=bT,Ee.assignIn=vT,Ee.assignInWith=Qd,Ee.assignWith=wT,Ee.at=kw,Ee.before=sy,Ee.bind=af,Ee.bindAll=Zw,Ee.bindKey=Xd,Ee.castArray=function(){if(!arguments.length)return[];var d=arguments[0];return Rn(d)?d:[d]},Ee.chain=Z_,Ee.chunk=function(d,f,_){f=(_?Ws(d,f,_):f===ee)?1:Hr(Jn(f),0);var F=null==d?0:d.length;if(!F||f<1)return[];for(var ae=0,Te=0,ze=Et(jt(F/f));aeae?0:ae+_),(F=F===ee||F>ae?ae:Jn(F))<0&&(F+=ae),F=_>F?0:py(F);_>>0)?(d=zi(d))&&("string"==typeof f||null!=f&&!Nw(f))&&!(f=Lo(f))&&Ph(d)?cl(il(d),0,_):d.split(f,_):[]},Ee.spread=function(d,f){if("function"!=typeof d)throw new Da(Se);return f=null==f?0:Hr(Jn(f),0),pi(function(_){var F=_[f],ae=cl(_,0,f);return F&&zr(ae,F),ls(d,this,ae)})},Ee.tail=function(d){var f=null==d?0:d.length;return f?Ds(d,1,f):[]},Ee.take=function(d,f,_){return d&&d.length?Ds(d,0,(f=_||f===ee?1:Jn(f))<0?0:f):[]},Ee.takeRight=function(d,f,_){var F=null==d?0:d.length;return F?Ds(d,(f=F-(f=_||f===ee?1:Jn(f)))<0?0:f,F):[]},Ee.takeRightWhile=function(d,f){return d&&d.length?Au(d,Fn(f,3),!1,!0):[]},Ee.takeWhile=function(d,f){return d&&d.length?Au(d,Fn(f,3)):[]},Ee.tap=function(d,f){return f(d),d},Ee.throttle=function(d,f,_){var F=!0,ae=!0;if("function"!=typeof d)throw new Da(Se);return Tr(_)&&(F="leading"in _?!!_.leading:F,ae="trailing"in _?!!_.trailing:ae),ww(d,f,{leading:F,maxWait:f,trailing:ae})},Ee.thru=Yd,Ee.toArray=Pw,Ee.toPairs=DT,Ee.toPairsIn=$w,Ee.toPath=function(d){return Rn(d)?Yi(d,ni):ca(d)?[d]:eo(qv(zi(d)))},Ee.toPlainObject=Fw,Ee.transform=function(d,f,_){var F=Rn(d),ae=F||gl(d)||cf(d);if(f=Fn(f,4),null==_){var Te=d&&d.constructor;_=ae?F?new Te:[]:Tr(d)&&la(Te)?wu(Ia(d)):{}}return(ae?Us:ll)(d,function(ze,qe,ct){return f(_,ze,qe,ct)}),_},Ee.unary=function(d){return Kp(d,1)},Ee.union=iw,Ee.unionBy=UA,Ee.unionWith=zA,Ee.uniq=function(d){return d&&d.length?Rc(d):[]},Ee.uniqBy=function(d,f){return d&&d.length?Rc(d,Fn(f,2)):[]},Ee.uniqWith=function(d,f){return f="function"==typeof f?f:ee,d&&d.length?Rc(d,ee,f):[]},Ee.unset=function(d,f){return null==d||Cu(d,f)},Ee.unzip=rw,Ee.unzipWith=GA,Ee.update=function(d,f,_){return null==d?d:Op(d,f,I_(_))},Ee.updateWith=function(d,f,_,F){return F="function"==typeof F?F:ee,null==d?d:Op(d,f,I_(_),F)},Ee.values=th,Ee.valuesIn=function(d){return null==d?[]:i_(d,no(d))},Ee.without=sw,Ee.words=Ay,Ee.wrap=function(d,f){return Xp(I_(f),d)},Ee.xor=B2,Ee.xorBy=jo,Ee.xorWith=X_,Ee.zip=Q_,Ee.zipObject=function(d,f){return Rp(d||[],f||[],ol)},Ee.zipObjectDeep=function(d,f){return Rp(d||[],f||[],Ip)},Ee.zipWith=of,Ee.entries=DT,Ee.entriesIn=$w,Ee.extend=vT,Ee.extendWith=Qd,Iy(Ee,Ee),Ee.add=Wn,Ee.attempt=Ty,Ee.camelCase=PT,Ee.capitalize=yy,Ee.ceil=Py,Ee.clamp=function(d,f,_){return _===ee&&(_=f,f=ee),_!==ee&&(_=(_=vo(_))==_?_:0),f!==ee&&(f=(f=vo(f))==f?f:0),Eu(vo(d),f,_)},Ee.clone=function(d){return Hs(d,4)},Ee.cloneDeep=function(d){return Hs(d,5)},Ee.cloneDeepWith=function(d,f){return Hs(d,5,f="function"==typeof f?f:ee)},Ee.cloneWith=function(d,f){return Hs(d,4,f="function"==typeof f?f:ee)},Ee.conformsTo=function(d,f){return null==f||Ap(d,f,Os(f))},Ee.deburr=by,Ee.defaultTo=function(d,f){return null==d||d!=d?f:d},Ee.divide=J2,Ee.endsWith=function(d,f,_){d=zi(d),f=Lo(f);var F=d.length,ae=_=_===ee?F:Eu(Jn(_),0,F);return(_-=f.length)>=0&&d.slice(_,ae)==f},Ee.eq=In,Ee.escape=function(d){return(d=zi(d))&&Jt.test(d)?d.replace(Sa,d2):d},Ee.escapeRegExp=function(d){return(d=zi(d))&&ut.test(d)?d.replace(Le,"\\$&"):d},Ee.every=function(d,f,_){var F=Rn(d)?ti:Ev;return _&&Ws(d,f,_)&&(f=ee),F(d,Fn(f,3))},Ee.find=XA,Ee.findIndex=G_,Ee.findKey=function(d,f){return Rh(d,Fn(f,3),ll)},Ee.findLast=QA,Ee.findLastIndex=$_,Ee.findLastKey=function(d,f){return Rh(d,Fn(f,3),Tp)},Ee.floor=Ql,Ee.forEach=iy,Ee.forEachRight=Wp,Ee.forIn=function(d,f){return null==d?d:Pd(d,Fn(f,3),no)},Ee.forInRight=function(d,f){return null==d?d:Fd(d,Fn(f,3),no)},Ee.forOwn=function(d,f){return d&&ll(d,Fn(f,3))},Ee.forOwnRight=function(d,f){return d&&Tp(d,Fn(f,3))},Ee.get=hf,Ee.gt=Zt,Ee.gte=Tw,Ee.has=function(d,f){return null!=d&&zv(d,f,kd)},Ee.hasIn=eg,Ee.head=Kv,Ee.identity=io,Ee.includes=function(d,f,_,F){d=bo(d)?d:th(d),_=_&&!F?Jn(_):0;var ae=d.length;return _<0&&(_=Hr(ae+_,0)),hy(d)?_<=ae&&d.indexOf(f,_)>-1:!!ae&&nl(d,f,_)>-1},Ee.indexOf=function(d,f,_){var F=null==d?0:d.length;if(!F)return-1;var ae=null==_?0:Jn(_);return ae<0&&(ae=Hr(F+ae,0)),nl(d,f,ae)},Ee.inRange=function(d,f,_){return f=ml(f),_===ee?(_=f,f=0):_=ml(_),function(d,f,_){return d>=ms(f,_)&&d=-Ce&&d<=Ce},Ee.isSet=yT,Ee.isString=hy,Ee.isSymbol=ca,Ee.isTypedArray=cf,Ee.isUndefined=function(d){return d===ee},Ee.isWeakMap=function(d){return Mr(d)&&$s(d)==B},Ee.isWeakSet=function(d){return Mr(d)&&"[object WeakSet]"==Ms(d)},Ee.join=function(d,f){return null==d?"":jh.call(d,f)},Ee.kebabCase=kT,Ee.last=sa,Ee.lastIndexOf=function(d,f,_){var F=null==d?0:d.length;if(!F)return-1;var ae=F;return _!==ee&&(ae=(ae=Jn(_))<0?Hr(F+ae,0):ms(ae,F-1)),f==f?function(at,It,Et){for(var hn=Et+1;hn--;)if(at[hn]===It)return hn;return hn}(d,f,ae):Cd(d,Ac,ae,!0)},Ee.lowerCase=LT,Ee.lowerFirst=K2,Ee.lt=Bc,Ee.lte=fy,Ee.max=function(d){return d&&d.length?Yh(d,io,Fo):ee},Ee.maxBy=function(d,f){return d&&d.length?Yh(d,Fn(f,2),Fo):ee},Ee.mean=function(d){return Cs(d,io)},Ee.meanBy=function(d,f){return Cs(d,Fn(f,2))},Ee.min=function(d){return d&&d.length?Yh(d,io,Av):ee},Ee.minBy=function(d,f){return d&&d.length?Yh(d,Fn(f,2),Av):ee},Ee.stubArray=Vc,Ee.stubFalse=Ny,Ee.stubObject=function(){return{}},Ee.stubString=function(){return""},Ee.stubTrue=function(){return!0},Ee.multiply=sE,Ee.nth=function(d,f){return d&&d.length?xu(d,Jn(f)):ee},Ee.noConflict=function(){return Vi._===this&&(Vi._=c_),this},Ee.noop=Oy,Ee.now=Nu,Ee.pad=function(d,f,_){d=zi(d);var F=(f=Jn(f))?Fh(d):0;if(!f||F>=f)return d;var ae=(f-F)/2;return kp(Ei(ae),_)+d+kp(jt(ae),_)},Ee.padEnd=function(d,f,_){d=zi(d);var F=(f=Jn(f))?Fh(d):0;return f&&Ff){var F=d;d=f,f=F}if(_||d%1||f%1){var ae=Vh();return ms(d+ae*(f-d+D1("1e-"+((ae+"").length-1))),f)}return Gl(d,f)},Ee.reduce=function(d,f,_){var F=Rn(d)?_u:Zo,ae=arguments.length<3;return F(d,Fn(f,4),_,ae,Ic)},Ee.reduceRight=function(d,f,_){var F=Rn(d)?xd:Zo,ae=arguments.length<3;return F(d,Fn(f,4),_,ae,E_)},Ee.repeat=function(d,f,_){return f=(_?Ws(d,f,_):f===ee)?1:Jn(f),Dp(zi(d),f)},Ee.replace=function(){var d=arguments,f=zi(d[0]);return d.length<3?f:f.replace(d[1],d[2])},Ee.result=function(d,f,_){var F=-1,ae=(f=Pc(f,d)).length;for(ae||(ae=1,d=ee);++FCe)return[];var _=_e,F=ms(d,_e);f=Fn(f),d-=_e;for(var ae=Td(F,f);++_=Te)return d;var qe=_-Fh(F);if(qe<1)return F;var ct=ze?cl(ze,0,qe).join(""):d.slice(0,qe);if(ae===ee)return ct+F;if(ze&&(qe+=ct.length-qe),Nw(ae)){if(d.slice(qe).search(ae)){var kt,Lt=ct;for(ae.global||(ae=a_(ae.source,zi($n.exec(ae))+"g")),ae.lastIndex=0;kt=ae.exec(Lt);)var zt=kt.index;ct=ct.slice(0,zt===ee?qe:zt)}}else if(d.indexOf(Lo(ae),qe)!=qe){var en=ct.lastIndexOf(ae);en>-1&&(ct=ct.slice(0,en))}return ct+F},Ee.unescape=function(d){return(d=zi(d))&&Es.test(d)?d.replace(kl,o_):d},Ee.uniqueId=function(d){var f=++y2;return zi(d)+f},Ee.upperCase=Qw,Ee.upperFirst=ig,Ee.each=iy,Ee.eachRight=Wp,Ee.first=Kv,Iy(Ee,function(){var d={};return ll(Ee,function(f,_){Xi.call(Ee.prototype,_)||(d[_]=f)}),d}(),{chain:!1}),Ee.VERSION="4.17.21",Us(["bind","bindKey","curry","curryRight","partial","partialRight"],function(d){Ee[d].placeholder=Ee}),Us(["drop","take"],function(d,f){fi.prototype[d]=function(_){_=_===ee?1:Hr(Jn(_),0);var F=this.__filtered__&&!f?new fi(this):this.clone();return F.__filtered__?F.__takeCount__=ms(_,F.__takeCount__):F.__views__.push({size:ms(_,_e),type:d+(F.__dir__<0?"Right":"")}),F},fi.prototype[d+"Right"]=function(_){return this.reverse()[d](_).reverse()}}),Us(["filter","map","takeWhile"],function(d,f){var _=f+1,F=1==_||3==_;fi.prototype[d]=function(ae){var Te=this.clone();return Te.__iteratees__.push({iteratee:Fn(ae,3),type:_}),Te.__filtered__=Te.__filtered__||F,Te}}),Us(["head","last"],function(d,f){var _="take"+(f?"Right":"");fi.prototype[d]=function(){return this[_](1).value()[0]}}),Us(["initial","tail"],function(d,f){var _="drop"+(f?"":"Right");fi.prototype[d]=function(){return this.__filtered__?new fi(this):this[_](1)}}),fi.prototype.compact=function(){return this.filter(io)},fi.prototype.find=function(d){return this.filter(d).head()},fi.prototype.findLast=function(d){return this.reverse().find(d)},fi.prototype.invokeMap=pi(function(d,f){return"function"==typeof d?new fi(this):this.map(function(_){return Pa(_,d,f)})}),fi.prototype.reject=function(d){return this.filter(ly(Fn(d)))},fi.prototype.slice=function(d,f){d=Jn(d);var _=this;return _.__filtered__&&(d>0||f<0)?new fi(_):(d<0?_=_.takeRight(-d):d&&(_=_.drop(d)),f!==ee&&(_=(f=Jn(f))<0?_.dropRight(-f):_.take(f-d)),_)},fi.prototype.takeRightWhile=function(d){return this.reverse().takeWhile(d).reverse()},fi.prototype.toArray=function(){return this.take(_e)},ll(fi.prototype,function(d,f){var _=/^(?:filter|find|map|reject)|While$/.test(f),F=/^(?:head|last)$/.test(f),ae=Ee[F?"take"+("last"==f?"Right":""):f],Te=F||/^find/.test(f);!ae||(Ee.prototype[f]=function(){var ze=this.__wrapped__,qe=F?[1]:arguments,ct=ze instanceof fi,kt=qe[0],Lt=ct||Rn(ze),zt=function(mi){var Mi=ae.apply(Ee,zr([mi],qe));return F&&en?Mi[0]:Mi};Lt&&_&&"function"==typeof kt&&1!=kt.length&&(ct=Lt=!1);var en=this.__chain__,wn=!!this.__actions__.length,Ln=Te&&!en,gi=ct&&!wn;if(!Te&&Lt){ze=gi?ze:new fi(this);var jn=d.apply(ze,qe);return jn.__actions__.push({func:Yd,args:[zt],thisArg:ee}),new Po(jn,en)}return Ln&&gi?d.apply(this,qe):(jn=this.thru(zt),Ln?F?jn.value()[0]:jn.value():jn)})}),Us(["pop","push","shift","sort","splice","unshift"],function(d){var f=gr[d],_=/^(?:push|sort|unshift)$/.test(d)?"tap":"thru",F=/^(?:pop|shift)$/.test(d);Ee.prototype[d]=function(){var ae=arguments;if(F&&!this.__chain__){var Te=this.value();return f.apply(Rn(Te)?Te:[],ae)}return this[_](function(ze){return f.apply(Rn(ze)?ze:[],ae)})}}),ll(fi.prototype,function(d,f){var _=Ee[f];if(_){var F=_.name+"";Xi.call(Id,F)||(Id[F]=[]),Id[F].push({name:f,func:_})}}),Id[kc(ee,2).name]=[{name:"wrapper",func:ee}],fi.prototype.clone=function(){var d=new fi(this.__wrapped__);return d.__actions__=eo(this.__actions__),d.__dir__=this.__dir__,d.__filtered__=this.__filtered__,d.__iteratees__=eo(this.__iteratees__),d.__takeCount__=this.__takeCount__,d.__views__=eo(this.__views__),d},fi.prototype.reverse=function(){if(this.__filtered__){var d=new fi(this);d.__dir__=-1,d.__filtered__=!0}else(d=this.clone()).__dir__*=-1;return d},fi.prototype.value=function(){var d=this.__wrapped__.value(),f=this.__dir__,_=Rn(d),F=f<0,ae=_?d.length:0,Te=function(d,f,_){for(var F=-1,ae=_.length;++F=this.__values__.length;return{done:d,value:d?ee:this.__values__[this.__index__++]}},Ee.prototype.plant=function(d){for(var f,_=this;_ instanceof Gh;){var F=nf(_);F.__index__=0,F.__values__=ee,f?ae.__wrapped__=F:f=F;var ae=F;_=_.__wrapped__}return ae.__wrapped__=d,f},Ee.prototype.reverse=function(){var d=this.__wrapped__;if(d instanceof fi){var f=d;return this.__actions__.length&&(f=new fi(this)),(f=f.reverse()).__actions__.push({func:Yd,args:[K_],thisArg:ee}),new Po(f,this.__chain__)}return this.thru(K_)},Ee.prototype.toJSON=Ee.prototype.valueOf=Ee.prototype.value=function(){return oA(this.__wrapped__,this.__actions__)},Ee.prototype.first=Ee.prototype.head,Bh&&(Ee.prototype[Bh]=function(){return this}),Ee}();Vi._=kh,(yt=function(){return kh}.call(it,Je,it,Ut))!==ee&&(Ut.exports=yt)}.call(this)},478:function(Ut){Ut.exports=function(){"use strict";function it(rt,lt){for(var ht=0;htrt.length)&&(lt=rt.length);for(var ht=0,ge=new Array(lt);ht=rt.length?{done:!0}:{done:!1,value:rt[ge++]}}}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 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}}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:Y,changeDefaults:function(rt){dt.exports.defaults=rt}};var he=/[&<>"']/,W=/[&<>"']/g,j=/[<>"']|&(?!#?\w+;)/,P=/[<>"']|&(?!#?\w+;)/g,Q={"&":"&","<":"<",">":">",'"':""","'":"'"},z=function(lt){return Q[lt]};var x=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function O(rt){return rt.replace(x,function(lt,ht){return"colon"===(ht=ht.toLowerCase())?":":"#"===ht.charAt(0)?"x"===ht.charAt(1)?String.fromCharCode(parseInt(ht.substring(2),16)):String.fromCharCode(+ht.substring(1)):""})}var A=/(^|[^\[])\^/g;var y=/[^\w:]/g,S=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;var V={},R=/^[^:]+:\/*[^/]*$/,K=/^([^:]+:)[\s\S]*$/,ce=/^([^:]+:\/*[^/]*)[\s\S]*$/;function D(rt,lt){V[" "+rt]||(V[" "+rt]=R.test(rt)?rt+"/":$(rt,"/",!0));var ht=-1===(rt=V[" "+rt]).indexOf(":");return"//"===lt.substring(0,2)?ht?lt:rt.replace(K,"$1")+lt:"/"===lt.charAt(0)?ht?lt:rt.replace(ce,"$1")+lt:rt+lt}function $(rt,lt,ht){var ge=rt.length;if(0===ge)return"";for(var be=0;be1;)1<&&(ht+=rt),lt>>=1,rt+=rt;return ht+rt},Ce=dt.exports.defaults,me=$,ne=function(rt,lt){var ge=rt.replace(/\|/g,function(Le,ut,Ze){for(var At=!1,Mt=ut;--Mt>=0&&"\\"===Ze[Mt];)At=!At;return At?"|":" |"}).split(/ \|/),be=0;if(ge.length>lt)ge.splice(lt);else for(;ge.length1?{type:"space",raw:be[0]}:{raw:"\n"}},lt.code=function(ge){var be=this.rules.block.code.exec(ge);if(be){var Le=be[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:be[0],codeBlockStyle:"indented",text:this.options.pedantic?Le:me(Le,"\n")}}},lt.fences=function(ge){var be=this.rules.block.fences.exec(ge);if(be){var Le=be[0],ut=function(rt,lt){var ht=rt.match(/^(\s+)(?:```)/);if(null===ht)return lt;var ge=ht[1];return lt.split("\n").map(function(be){var Le=be.match(/^\s+/);return null===Le?be:Le[0].length>=ge.length?be.slice(ge.length):be}).join("\n")}(Le,be[3]||"");return{type:"code",raw:Le,lang:be[2]?be[2].trim():be[2],text:ut}}},lt.heading=function(ge){var be=this.rules.block.heading.exec(ge);if(be){var Le=be[2].trim();if(/#$/.test(Le)){var ut=me(Le,"#");(this.options.pedantic||!ut||/ $/.test(ut))&&(Le=ut.trim())}return{type:"heading",raw:be[0],depth:be[1].length,text:Le}}},lt.nptable=function(ge){var be=this.rules.block.nptable.exec(ge);if(be){var Le={type:"table",header:ne(be[1].replace(/^ *| *\| *$/g,"")),align:be[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:be[3]?be[3].replace(/\n$/,"").split("\n"):[],raw:be[0]};if(Le.header.length===Le.align.length){var Ze,ut=Le.align.length;for(Ze=0;Ze ?/gm,"");return{type:"blockquote",raw:be[0],text:Le}}},lt.list=function(ge){var be=this.rules.block.list.exec(ge);if(be){var Xt,zn,ai,Nn,bn,$n,Tn,lr,cr,Le=be[0],ut=be[2],Ze=ut.length>1,At={type:"list",raw:Le,ordered:Ze,start:Ze?+ut.slice(0,-1):"",loose:!1,items:[]},Mt=be[0].match(this.rules.block.item),Dt=!1,Xn=Mt.length;ai=this.rules.block.listItemStart.exec(Mt[0]);for(var $i=0;$iai[1].length:Nn[1].length>=ai[0].length||Nn[1].length>3){Mt.splice($i,2,Mt[$i]+(!this.options.pedantic&&Nn[1].length/i.test(ut[0])&&(be=!1),!Le&&/^<(pre|code|kbd|script)(\s|>)/i.test(ut[0])?Le=!0:Le&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(ut[0])&&(Le=!1),{type:this.options.sanitize?"text":"html",raw:ut[0],inLink:be,inRawBlock:Le,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ut[0]):_e(ut[0]):ut[0]}},lt.link=function(ge){var be=this.rules.inline.link.exec(ge);if(be){var Le=be[2].trim();if(!this.options.pedantic&&/^$/.test(Le))return;var ut=me(Le.slice(0,-1),"\\");if((Le.length-ut.length)%2==0)return}else{var Ze=Ie(be[2],"()");if(Ze>-1){var Mt=(0===be[0].indexOf("!")?5:4)+be[1].length+Ze;be[2]=be[2].substring(0,Ze),be[0]=be[0].substring(0,Mt).trim(),be[3]=""}}var Dt=be[2],Xt="";if(this.options.pedantic){var zn=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Dt);zn&&(Dt=zn[1],Xt=zn[3])}else Xt=be[3]?be[3].slice(1,-1):"";return Dt=Dt.trim(),/^$/.test(Le)?Dt.slice(1):Dt.slice(1,-1)),Ge(be,{href:Dt&&Dt.replace(this.rules.inline._escapes,"$1"),title:Xt&&Xt.replace(this.rules.inline._escapes,"$1")},be[0])}},lt.reflink=function(ge,be){var Le;if((Le=this.rules.inline.reflink.exec(ge))||(Le=this.rules.inline.nolink.exec(ge))){var ut=(Le[2]||Le[1]).replace(/\s+/g," ");if(!(ut=be[ut.toLowerCase()])||!ut.href){var Ze=Le[0].charAt(0);return{type:"text",raw:Ze,text:Ze}}return Ge(Le,ut,Le[0])}},lt.emStrong=function(ge,be,Le){void 0===Le&&(Le="");var ut=this.rules.inline.emStrong.lDelim.exec(ge);if(ut&&(!ut[3]||!Le.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 Ze=ut[1]||ut[2]||"";if(!Ze||Ze&&(""===Le||this.rules.inline.punctuation.exec(Le))){var Mt,Dt,At=ut[0].length-1,Xt=At,zn=0,ai="*"===ut[0][0]?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(ai.lastIndex=0,be=be.slice(-1*ge.length+At);null!=(ut=ai.exec(be));)if(Mt=ut[1]||ut[2]||ut[3]||ut[4]||ut[5]||ut[6]){if(Dt=Mt.length,ut[3]||ut[4]){Xt+=Dt;continue}if((ut[5]||ut[6])&&At%3&&!((At+Dt)%3)){zn+=Dt;continue}if(!((Xt-=Dt)>0))return Dt=Math.min(Dt,Dt+Xt+zn),Math.min(At,Dt)%2?{type:"em",raw:ge.slice(0,At+ut.index+Dt+1),text:ge.slice(1,At+ut.index+Dt)}:{type:"strong",raw:ge.slice(0,At+ut.index+Dt+1),text:ge.slice(2,At+ut.index+Dt-1)}}}}},lt.codespan=function(ge){var be=this.rules.inline.code.exec(ge);if(be){var Le=be[2].replace(/\n/g," "),ut=/[^ ]/.test(Le),Ze=/^ /.test(Le)&&/ $/.test(Le);return ut&&Ze&&(Le=Le.substring(1,Le.length-1)),Le=_e(Le,!0),{type:"codespan",raw:be[0],text:Le}}},lt.br=function(ge){var be=this.rules.inline.br.exec(ge);if(be)return{type:"br",raw:be[0]}},lt.del=function(ge){var be=this.rules.inline.del.exec(ge);if(be)return{type:"del",raw:be[0],text:be[2]}},lt.autolink=function(ge,be){var ut,Ze,Le=this.rules.inline.autolink.exec(ge);if(Le)return Ze="@"===Le[2]?"mailto:"+(ut=_e(this.options.mangle?be(Le[1]):Le[1])):ut=_e(Le[1]),{type:"link",raw:Le[0],text:ut,href:Ze,tokens:[{type:"text",raw:ut,text:ut}]}},lt.url=function(ge,be){var Le;if(Le=this.rules.inline.url.exec(ge)){var ut,Ze;if("@"===Le[2])Ze="mailto:"+(ut=_e(this.options.mangle?be(Le[0]):Le[0]));else{var At;do{At=Le[0],Le[0]=this.rules.inline._backpedal.exec(Le[0])[0]}while(At!==Le[0]);ut=_e(Le[0]),Ze="www."===Le[1]?"http://"+ut:ut}return{type:"link",raw:Le[0],text:ut,href:Ze,tokens:[{type:"text",raw:ut,text:ut}]}}},lt.inlineText=function(ge,be,Le){var Ze,ut=this.rules.inline.text.exec(ge);if(ut)return Ze=be?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ut[0]):_e(ut[0]):ut[0]:_e(this.options.smartypants?Le(ut[0]):ut[0]),{type:"text",raw:ut[0],text:Ze}},rt}(),tt=te_noopTest,Ye=te_edit,Ue=te_merge,ke={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:tt,table:tt,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?'|\([^()]*\))/};ke.def=Ye(ke.def).replace("label",ke._label).replace("title",ke._title).getRegex(),ke.bullet=/(?:[*+-]|\d{1,9}[.)])/,ke.item=/^( *)(bull) ?[^\n]*(?:\n(?! *bull ?)[^\n]*)*/,ke.item=Ye(ke.item,"gm").replace(/bull/g,ke.bullet).getRegex(),ke.listItemStart=Ye(/^( *)(bull) */).replace("bull",ke.bullet).getRegex(),ke.list=Ye(ke.list).replace(/bull/g,ke.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+ke.def.source+")").getRegex(),ke._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",ke._comment=/|$)/,ke.html=Ye(ke.html,"i").replace("comment",ke._comment).replace("tag",ke._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ke.paragraph=Ye(ke._paragraph).replace("hr",ke.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",ke._tag).getRegex(),ke.blockquote=Ye(ke.blockquote).replace("paragraph",ke.paragraph).getRegex(),ke.normal=Ue({},ke),ke.gfm=Ue({},ke.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*|$)"}),ke.gfm.nptable=Ye(ke.gfm.nptable).replace("hr",ke.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",ke._tag).getRegex(),ke.gfm.table=Ye(ke.gfm.table).replace("hr",ke.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",ke._tag).getRegex(),ke.pedantic=Ue({},ke.normal,{html:Ye("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",ke._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:tt,paragraph:Ye(ke.normal._paragraph).replace("hr",ke.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",ke.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var Ke={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:tt,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:tt,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~"};Ke.punctuation=Ye(Ke.punctuation).replace(/punctuation/g,Ke._punctuation).getRegex(),Ke.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,Ke.escapedEmSt=/\\\*|\\_/g,Ke._comment=Ye(ke._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),Ke.emStrong.lDelim=Ye(Ke.emStrong.lDelim).replace(/punct/g,Ke._punctuation).getRegex(),Ke.emStrong.rDelimAst=Ye(Ke.emStrong.rDelimAst,"g").replace(/punct/g,Ke._punctuation).getRegex(),Ke.emStrong.rDelimUnd=Ye(Ke.emStrong.rDelimUnd,"g").replace(/punct/g,Ke._punctuation).getRegex(),Ke._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,Ke._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,Ke._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])?)+(?![-_])/,Ke.autolink=Ye(Ke.autolink).replace("scheme",Ke._scheme).replace("email",Ke._email).getRegex(),Ke._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,Ke.tag=Ye(Ke.tag).replace("comment",Ke._comment).replace("attribute",Ke._attribute).getRegex(),Ke._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Ke._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,Ke._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,Ke.link=Ye(Ke.link).replace("label",Ke._label).replace("href",Ke._href).replace("title",Ke._title).getRegex(),Ke.reflink=Ye(Ke.reflink).replace("label",Ke._label).getRegex(),Ke.reflinkSearch=Ye(Ke.reflinkSearch,"g").replace("reflink",Ke.reflink).replace("nolink",Ke.nolink).getRegex(),Ke.normal=Ue({},Ke),Ke.pedantic=Ue({},Ke.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",Ke._label).getRegex(),reflink:Ye(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Ke._label).getRegex()}),Ke.gfm=Ue({},Ke.normal,{escape:Ye(Ke.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&&(ge="x"+ge.toString(16)),lt+="&#"+ge+";";return lt}var je=function(){function rt(ht){this.tokens=[],this.tokens.links=Object.create(null),this.options=ht||$e,this.options.tokenizer=this.options.tokenizer||new Ve,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var ge={block:Ne.normal,inline:q.normal};this.options.pedantic?(ge.block=Ne.pedantic,ge.inline=q.pedantic):this.options.gfm&&(ge.block=Ne.gfm,ge.inline=this.options.breaks?q.breaks:q.gfm),this.tokenizer.rules=ge}rt.lex=function(ge,be){return new rt(be).lex(ge)},rt.lexInline=function(ge,be){return new rt(be).inlineTokens(ge)};var lt=rt.prototype;return lt.lex=function(ge){return ge=ge.replace(/\r\n|\r/g,"\n").replace(/\t/g," "),this.blockTokens(ge,this.tokens,!0),this.inline(this.tokens),this.tokens},lt.blockTokens=function(ge,be,Le){var Ze,At,Mt,Dt,Xt,zn,ut=this;for(void 0===be&&(be=[]),void 0===Le&&(Le=!0),this.options.pedantic&&(ge=ge.replace(/^ +$/gm,""));ge;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(function(Nn){return!!(Ze=Nn.call(ut,ge,be))&&(ge=ge.substring(Ze.raw.length),be.push(Ze),!0)}))){if(Ze=this.tokenizer.space(ge)){ge=ge.substring(Ze.raw.length),Ze.type&&be.push(Ze);continue}if(Ze=this.tokenizer.code(ge)){ge=ge.substring(Ze.raw.length),(Dt=be[be.length-1])&&"paragraph"===Dt.type?(Dt.raw+="\n"+Ze.raw,Dt.text+="\n"+Ze.text):be.push(Ze);continue}if(Ze=this.tokenizer.fences(ge)){ge=ge.substring(Ze.raw.length),be.push(Ze);continue}if(Ze=this.tokenizer.heading(ge)){ge=ge.substring(Ze.raw.length),be.push(Ze);continue}if(Ze=this.tokenizer.nptable(ge)){ge=ge.substring(Ze.raw.length),be.push(Ze);continue}if(Ze=this.tokenizer.hr(ge)){ge=ge.substring(Ze.raw.length),be.push(Ze);continue}if(Ze=this.tokenizer.blockquote(ge)){ge=ge.substring(Ze.raw.length),Ze.tokens=this.blockTokens(Ze.text,[],Le),be.push(Ze);continue}if(Ze=this.tokenizer.list(ge)){for(ge=ge.substring(Ze.raw.length),Mt=Ze.items.length,At=0;At=0&&(Nn=Math.min(Nn,$n))}),Nn<1/0&&Nn>=0&&(Xt=ge.substring(0,Nn+1))}(),Le&&(Ze=this.tokenizer.paragraph(Xt))){Dt=be[be.length-1],zn&&"paragraph"===Dt.type?(Dt.raw+="\n"+Ze.raw,Dt.text+="\n"+Ze.text):be.push(Ze),zn=Xt.length!==ge.length,ge=ge.substring(Ze.raw.length);continue}if(Ze=this.tokenizer.text(ge)){ge=ge.substring(Ze.raw.length),(Dt=be[be.length-1])&&"text"===Dt.type?(Dt.raw+="\n"+Ze.raw,Dt.text+="\n"+Ze.text):be.push(Ze);continue}if(ge){var ai="Infinite loop on byte: "+ge.charCodeAt(0);if(this.options.silent){console.error(ai);break}throw new Error(ai)}}return be},lt.inline=function(ge){var be,Le,ut,Ze,At,Mt,Dt=ge.length;for(be=0;be0)for(;null!=(zn=this.tokenizer.rules.inline.reflinkSearch.exec(Xt));)bn.includes(zn[0].slice(zn[0].lastIndexOf("[")+1,-1))&&(Xt=Xt.slice(0,zn.index)+"["+G("a",zn[0].length-2)+"]"+Xt.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(zn=this.tokenizer.rules.inline.blockSkip.exec(Xt));)Xt=Xt.slice(0,zn.index)+"["+G("a",zn[0].length-2)+"]"+Xt.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(zn=this.tokenizer.rules.inline.escapedEmSt.exec(Xt));)Xt=Xt.slice(0,zn.index)+"++"+Xt.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;ge;)if(ai||(Nn=""),ai=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(function(Tn){return!!(At=Tn.call(Ze,ge,be))&&(ge=ge.substring(At.raw.length),be.push(At),!0)}))){if(At=this.tokenizer.escape(ge)){ge=ge.substring(At.raw.length),be.push(At);continue}if(At=this.tokenizer.tag(ge,Le,ut)){ge=ge.substring(At.raw.length),Le=At.inLink,ut=At.inRawBlock,(Mt=be[be.length-1])&&"text"===At.type&&"text"===Mt.type?(Mt.raw+=At.raw,Mt.text+=At.text):be.push(At);continue}if(At=this.tokenizer.link(ge)){ge=ge.substring(At.raw.length),"link"===At.type&&(At.tokens=this.inlineTokens(At.text,[],!0,ut)),be.push(At);continue}if(At=this.tokenizer.reflink(ge,this.tokens.links)){ge=ge.substring(At.raw.length),Mt=be[be.length-1],"link"===At.type?(At.tokens=this.inlineTokens(At.text,[],!0,ut),be.push(At)):Mt&&"text"===At.type&&"text"===Mt.type?(Mt.raw+=At.raw,Mt.text+=At.text):be.push(At);continue}if(At=this.tokenizer.emStrong(ge,Xt,Nn)){ge=ge.substring(At.raw.length),At.tokens=this.inlineTokens(At.text,[],Le,ut),be.push(At);continue}if(At=this.tokenizer.codespan(ge)){ge=ge.substring(At.raw.length),be.push(At);continue}if(At=this.tokenizer.br(ge)){ge=ge.substring(At.raw.length),be.push(At);continue}if(At=this.tokenizer.del(ge)){ge=ge.substring(At.raw.length),At.tokens=this.inlineTokens(At.text,[],Le,ut),be.push(At);continue}if(At=this.tokenizer.autolink(ge,ue)){ge=ge.substring(At.raw.length),be.push(At);continue}if(!Le&&(At=this.tokenizer.url(ge,ue))){ge=ge.substring(At.raw.length),be.push(At);continue}if(Dt=ge,this.options.extensions&&this.options.extensions.startInline&&function(){var Tn=1/0,lr=ge.slice(1),cr=void 0;Ze.options.extensions.startInline.forEach(function(Xn){"number"==typeof(cr=Xn.call(this,lr))&&cr>=0&&(Tn=Math.min(Tn,cr))}),Tn<1/0&&Tn>=0&&(Dt=ge.substring(0,Tn+1))}(),At=this.tokenizer.inlineText(Dt,ut,pe)){ge=ge.substring(At.raw.length),"_"!==At.raw.slice(-1)&&(Nn=At.raw.slice(-1)),ai=!0,(Mt=be[be.length-1])&&"text"===Mt.type?(Mt.raw+=At.raw,Mt.text+=At.text):be.push(At);continue}if(ge){var $n="Infinite loop on byte: "+ge.charCodeAt(0);if(this.options.silent){console.error($n);break}throw new Error($n)}}return be},function(rt,lt,ht){lt&&it(rt.prototype,lt),ht&&it(rt,ht)}(rt,null,[{key:"rules",get:function(){return{block:Ne,inline:q}}}]),rt}(),_t=dt.exports.defaults,pt=te_cleanUrl,ve=te_escape,L=function(){function rt(ht){this.options=ht||_t}var lt=rt.prototype;return lt.code=function(ge,be,Le){var ut=(be||"").match(/\S*/)[0];if(this.options.highlight){var Ze=this.options.highlight(ge,ut);null!=Ze&&Ze!==ge&&(Le=!0,ge=Ze)}return ge=ge.replace(/\n$/,"")+"\n",ut?'
'+(Le?ge:ve(ge,!0))+"
\n":"
"+(Le?ge:ve(ge,!0))+"
\n"},lt.blockquote=function(ge){return"
\n"+ge+"
\n"},lt.html=function(ge){return ge},lt.heading=function(ge,be,Le,ut){return this.options.headerIds?"'+ge+"\n":""+ge+"\n"},lt.hr=function(){return this.options.xhtml?"
\n":"
\n"},lt.list=function(ge,be,Le){var ut=be?"ol":"ul";return"<"+ut+(be&&1!==Le?' start="'+Le+'"':"")+">\n"+ge+"\n"},lt.listitem=function(ge){return"
  • "+ge+"
  • \n"},lt.checkbox=function(ge){return" "},lt.paragraph=function(ge){return"

    "+ge+"

    \n"},lt.table=function(ge,be){return be&&(be=""+be+""),"\n\n"+ge+"\n"+be+"
    \n"},lt.tablerow=function(ge){return"\n"+ge+"\n"},lt.tablecell=function(ge,be){var Le=be.header?"th":"td";return(be.align?"<"+Le+' align="'+be.align+'">':"<"+Le+">")+ge+"\n"},lt.strong=function(ge){return""+ge+""},lt.em=function(ge){return""+ge+""},lt.codespan=function(ge){return""+ge+""},lt.br=function(){return this.options.xhtml?"
    ":"
    "},lt.del=function(ge){return""+ge+""},lt.link=function(ge,be,Le){if(null===(ge=pt(this.options.sanitize,this.options.baseUrl,ge)))return Le;var ut='"+Le+""},lt.image=function(ge,be,Le){if(null===(ge=pt(this.options.sanitize,this.options.baseUrl,ge)))return Le;var ut=''+Le+'":">")},lt.text=function(ge){return ge},rt}(),N=function(){function rt(){}var lt=rt.prototype;return lt.strong=function(ge){return ge},lt.em=function(ge){return ge},lt.codespan=function(ge){return ge},lt.del=function(ge){return ge},lt.html=function(ge){return ge},lt.text=function(ge){return ge},lt.link=function(ge,be,Le){return""+Le},lt.image=function(ge,be,Le){return""+Le},lt.br=function(){return""},rt}(),B=function(){function rt(){this.seen={}}var lt=rt.prototype;return lt.serialize=function(ge){return ge.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")},lt.getNextSafeSlug=function(ge,be){var Le=ge,ut=0;if(this.seen.hasOwnProperty(Le)){ut=this.seen[ge];do{Le=ge+"-"+ ++ut}while(this.seen.hasOwnProperty(Le))}return be||(this.seen[ge]=ut,this.seen[Le]=0),Le},lt.slug=function(ge,be){void 0===be&&(be={});var Le=this.serialize(ge);return this.getNextSafeSlug(Le,be.dryrun)},rt}(),Re=L,Qe=N,St=B,Nt=dt.exports.defaults,On=te_unescape,Yn=je,Ti=function(){function rt(ht){this.options=ht||Nt,this.options.renderer=this.options.renderer||new Re,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Qe,this.slugger=new St}rt.parse=function(ge,be){return new rt(be).parse(ge)},rt.parseInline=function(ge,be){return new rt(be).parseInline(ge)};var lt=rt.prototype;return lt.parse=function(ge,be){void 0===be&&(be=!0);var ut,Ze,At,Mt,Dt,Xt,zn,ai,Nn,bn,$n,Tn,lr,cr,Xn,$i,xa,Zr,ie,Le="",fe=ge.length;for(ut=0;ut0&&"text"===Xn.tokens[0].type?(Xn.tokens[0].text=Zr+" "+Xn.tokens[0].text,Xn.tokens[0].tokens&&Xn.tokens[0].tokens.length>0&&"text"===Xn.tokens[0].tokens[0].type&&(Xn.tokens[0].tokens[0].text=Zr+" "+Xn.tokens[0].tokens[0].text)):Xn.tokens.unshift({type:"text",text:Zr}):cr+=Zr),cr+=this.parse(Xn.tokens,lr),Nn+=this.renderer.listitem(cr,xa,$i);Le+=this.renderer.list(Nn,$n,Tn);continue;case"html":Le+=this.renderer.html(bn.text);continue;case"paragraph":Le+=this.renderer.paragraph(this.parseInline(bn.tokens));continue;case"text":for(Nn=bn.tokens?this.parseInline(bn.tokens):bn.text;ut+1An error occurred:

    "+el(At.message+"",!0)+"
    ";throw At}}return Jt.options=Jt.setOptions=function(rt){return Bs(Jt.defaults,rt),Sa(Jt.defaults),Jt},Jt.getDefaults=kl,Jt.defaults=Es,Jt.use=function(){for(var rt=this,lt=arguments.length,ht=new Array(lt),ge=0;geAn error occurred:

    "+el(ge.message+"",!0)+"
    ";throw ge}},Jt.Parser=Ti,Jt.parser=Ti.parse,Jt.Renderer=Xr,Jt.TextRenderer=Ls,Jt.Lexer=Yn,Jt.lexer=Yn.lex,Jt.Tokenizer=wi,Jt.Slugger=gs,Jt.parse=Jt,Jt}()},369:(Ut,it,Je)=>{var yt=Je(284),ee=Je(830);function Tt(){this.clear()}Tt.prototype.clear=function(){this.items=[],this.offset=0,this.size=0},Tt.prototype.enqueue=function(dt){return this.items.push(dt),++this.size},Tt.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}},Tt.prototype.peek=function(){if(this.size)return this.items[this.offset]},Tt.prototype.forEach=function(dt,Y){Y=arguments.length>1?Y:this;for(var Se=this.offset,he=0,W=this.items.length;Se=dt.length)return{done:!0};var Se=dt[Y];return Y++,{value:Se,done:!1}})},Tt.prototype.entries=function(){var dt=this.items,Y=this.offset,Se=0;return new yt(function(){if(Y>=dt.length)return{done:!0};var he=dt[Y];return Y++,{value:[Se++,he],done:!1}})},"undefined"!=typeof Symbol&&(Tt.prototype[Symbol.iterator]=Tt.prototype.values),Tt.prototype.toString=function(){return this.toArray().join(",")},Tt.prototype.toJSON=function(){return this.toArray()},Tt.prototype.inspect=function(){var dt=this.toArray();return Object.defineProperty(dt,"constructor",{value:Tt,enumerable:!1}),dt},"undefined"!=typeof Symbol&&(Tt.prototype[Symbol.for("nodejs.util.inspect.custom")]=Tt.prototype.inspect),Tt.from=function(dt){var Y=new Tt;return ee(dt,function(Se){Y.enqueue(Se)}),Y},Tt.of=function(){return Tt.from(arguments)},Ut.exports=Tt},830:Ut=>{var it="undefined"!=typeof ArrayBuffer,Je="undefined"!=typeof Symbol;function yt(ee,Tt){var dt,Y,Se,he,W;if(!ee)throw new Error("obliterator/forEach: invalid iterable.");if("function"!=typeof Tt)throw new Error("obliterator/forEach: expecting a callback.");if(Array.isArray(ee)||it&&ArrayBuffer.isView(ee)||"string"==typeof ee||"[object Arguments]"===ee.toString())for(Se=0,he=ee.length;Se{function it(Je){Object.defineProperty(this,"_next",{writable:!1,enumerable:!1,value:Je}),this.done=!1}it.prototype.next=function(){if(this.done)return{done:!0};var Je=this._next();return Je.done&&(this.done=!0),Je},"undefined"!=typeof Symbol&&(it.prototype[Symbol.iterator]=function(){return this}),it.of=function(){var Je=arguments,yt=Je.length,ee=0;return new it(function(){return ee>=yt?{done:!0}:{done:!1,value:Je[ee++]}})},it.empty=function(){var Je=new it(null);return Je.done=!0,Je},it.is=function(Je){return Je instanceof it||"object"==typeof Je&&null!==Je&&"function"==typeof Je.next},Ut.exports=it},310:(Ut,it,Je)=>{"use strict";var yt=Je(948);Object.defineProperty(it,"__esModule",{value:!0}),it.isMobile=function(){return void 0!==ee.window.orientation},it.default=function(he){if(!he&&!(0,Tt.default)())return"Node";if((0,dt.default)(he))return"Electron";var W="undefined"!=typeof navigator?navigator:{},j=he||W.userAgent||"";if(j.indexOf("Edge")>-1)return"Edge";var P=-1!==j.indexOf("MSIE "),Q=-1!==j.indexOf("Trident/");return P||Q?"IE":ee.window.chrome?"Chrome":ee.window.safari?"Safari":ee.window.mozInnerScreenX?"Firefox":"Unknown"};var ee=Je(151),Tt=yt(Je(602)),dt=yt(Je(344))},151:(Ut,it,Je)=>{"use strict";var yt=Je(948);Object.defineProperty(it,"__esModule",{value:!0}),it.console=it.process=it.document=it.global=it.window=it.self=void 0;var ee=yt(Je(321)),Tt={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,ee.default)(process))&&process};it.self=Tt.self||Tt.window||Tt.global,it.window=Tt.window||Tt.self||Tt.global,it.global=Tt.global||Tt.self||Tt.window,it.document=Tt.document||{},it.process=Tt.process||{};var j=console;it.console=j},761:(Ut,it,Je)=>{"use strict";var ee=Je(948),Tt=Je(321);Object.defineProperty(it,"CO",{enumerable:!0,get:function(){return dt.global}}),Object.defineProperty(it,"qs",{enumerable:!0,get:function(){return Se.default}});var dt=Je(151),Se=(j(Je(602)),j(Je(310)));ee(Je(344));function W(P){if("function"!=typeof WeakMap)return null;var Q=new WeakMap,z=new WeakMap;return(W=function(x){return x?z:Q})(P)}function j(P,Q){if(!Q&&P&&P.__esModule)return P;if(null===P||"object"!==Tt(P)&&"function"!=typeof P)return{default:P};var z=W(Q);if(z&&z.has(P))return z.get(P);var v={},x=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var O in P)if("default"!==O&&Object.prototype.hasOwnProperty.call(P,O)){var A=x?Object.getOwnPropertyDescriptor(P,O):null;A&&(A.get||A.set)?Object.defineProperty(v,O,A):v[O]=P[O]}return v.default=P,z&&z.set(P,v),v}},602:(Ut,it,Je)=>{"use strict";var yt=Je(948);Object.defineProperty(it,"__esModule",{value:!0}),it.default=dt,it.isBrowserMainThread=function(){return dt()&&"undefined"!=typeof document};var ee=yt(Je(321)),Tt=yt(Je(344));function dt(){return!("object"===("undefined"==typeof process?"undefined":(0,ee.default)(process))&&"[object process]"===String(process)&&!process.browser)||(0,Tt.default)()}},344:(Ut,it,Je)=>{"use strict";var yt=Je(948);Object.defineProperty(it,"__esModule",{value:!0}),it.default=function(dt){if("undefined"!=typeof window&&"object"===(0,ee.default)(window.process)&&"renderer"===window.process.type||"undefined"!=typeof process&&"object"===(0,ee.default)(process.versions)&&Boolean(process.versions.electron))return!0;var Y="object"===("undefined"==typeof navigator?"undefined":(0,ee.default)(navigator))&&"string"==typeof navigator.userAgent&&navigator.userAgent,Se=dt||Y;return!!(Se&&Se.indexOf("Electron")>=0)};var ee=yt(Je(321))},991:function(Ut,it,Je){"use strict";var yt=this&&this.__createBinding||(Object.create?function(Tt,dt,Y,Se){void 0===Se&&(Se=Y),Object.defineProperty(Tt,Se,{enumerable:!0,get:function(){return dt[Y]}})}:function(Tt,dt,Y,Se){void 0===Se&&(Se=Y),Tt[Se]=dt[Y]}),ee=this&&this.__exportStar||function(Tt,dt){for(var Y in Tt)"default"!==Y&&!Object.prototype.hasOwnProperty.call(dt,Y)&&yt(dt,Tt,Y)};Object.defineProperty(it,"__esModule",{value:!0}),ee(Je(180),it),ee(Je(103),it),ee(Je(965),it),ee(Je(595),it),ee(Je(417),it),ee(Je(451),it),ee(Je(735),it)},180:(Ut,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.BlankNode=void 0,it.BlankNode=class{constructor(ee){this.termType="BlankNode",this.value=ee}equals(ee){return!!ee&&"BlankNode"===ee.termType&&ee.value===this.value}}},103:(Ut,it,Je)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.DataFactory=void 0;const yt=Je(180),ee=Je(965),Tt=Je(595),dt=Je(417),Y=Je(451),Se=Je(735);let he=0;it.DataFactory=class{constructor(P){this.blankNodeCounter=0,this.blankNodePrefix=(P=P||{}).blankNodePrefix||`df_${he++}_`}namedNode(P){return new dt.NamedNode(P)}blankNode(P){return new yt.BlankNode(P||`${this.blankNodePrefix}${this.blankNodeCounter++}`)}literal(P,Q){return new Tt.Literal(P,Q)}variable(P){return new Se.Variable(P)}defaultGraph(){return ee.DefaultGraph.INSTANCE}quad(P,Q,z,v){return new Y.Quad(P,Q,z,v||this.defaultGraph())}fromTerm(P){switch(P.termType){case"NamedNode":return this.namedNode(P.value);case"BlankNode":return this.blankNode(P.value);case"Literal":return P.language?this.literal(P.value,P.language):P.datatype.equals(Tt.Literal.XSD_STRING)?this.literal(P.value):this.literal(P.value,this.fromTerm(P.datatype));case"Variable":return this.variable(P.value);case"DefaultGraph":return this.defaultGraph();case"Quad":return this.quad(this.fromTerm(P.subject),this.fromTerm(P.predicate),this.fromTerm(P.object),this.fromTerm(P.graph))}}fromQuad(P){return this.fromTerm(P)}resetBlankNodeCounter(){this.blankNodeCounter=0}}},965:(Ut,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.DefaultGraph=void 0;class Je{constructor(){this.termType="DefaultGraph",this.value=""}equals(ee){return!!ee&&"DefaultGraph"===ee.termType}}it.DefaultGraph=Je,Je.INSTANCE=new Je},595:(Ut,it,Je)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.Literal=void 0;const yt=Je(417);class ee{constructor(dt,Y){this.termType="Literal",this.value=dt,"string"==typeof Y?(this.language=Y,this.datatype=ee.RDF_LANGUAGE_STRING):Y?(this.language="",this.datatype=Y):(this.language="",this.datatype=ee.XSD_STRING)}equals(dt){return!!dt&&"Literal"===dt.termType&&dt.value===this.value&&dt.language===this.language&&dt.datatype.equals(this.datatype)}}it.Literal=ee,ee.RDF_LANGUAGE_STRING=new yt.NamedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),ee.XSD_STRING=new yt.NamedNode("http://www.w3.org/2001/XMLSchema#string")},417:(Ut,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.NamedNode=void 0,it.NamedNode=class{constructor(ee){this.termType="NamedNode",this.value=ee}equals(ee){return!!ee&&"NamedNode"===ee.termType&&ee.value===this.value}}},451:(Ut,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.Quad=void 0,it.Quad=class{constructor(ee,Tt,dt,Y){this.termType="Quad",this.value="",this.subject=ee,this.predicate=Tt,this.object=dt,this.graph=Y}equals(ee){return!!ee&&("Quad"===ee.termType||!ee.termType)&&this.subject.equals(ee.subject)&&this.predicate.equals(ee.predicate)&&this.object.equals(ee.object)&&this.graph.equals(ee.graph)}}},735:(Ut,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.Variable=void 0,it.Variable=class{constructor(ee){this.termType="Variable",this.value=ee}equals(ee){return!!ee&&"Variable"===ee.termType&&ee.value===this.value}}},609:function(Ut,it,Je){"use strict";var yt=this&&this.__createBinding||(Object.create?function(v,x,O,A){void 0===A&&(A=O),Object.defineProperty(v,A,{enumerable:!0,get:function(){return x[O]}})}:function(v,x,O,A){void 0===A&&(A=O),v[A]=x[O]}),ee=this&&this.__exportStar||function(v,x){for(var O in v)"default"!==O&&!Object.prototype.hasOwnProperty.call(x,O)&&yt(x,v,O)};Object.defineProperty(it,"__esModule",{value:!0}),it.getSupportedJavaScriptPrimitives=it.getSupportedRdfDatatypes=it.getTermRaw=it.toRdf=it.fromRdf=void 0;const Tt=Je(991),dt=Je(938),Y=Je(60);ee(Je(938),it),ee(Je(871),it),ee(Je(60),it);const Se=new Tt.DataFactory,he=new Y.Translator;function W(v,x){return he.fromRdf(v,x)}he.registerHandler(new dt.TypeHandlerString,dt.TypeHandlerString.TYPES.map(v=>Se.namedNode(v)),["string"]),he.registerHandler(new dt.TypeHandlerBoolean,[dt.TypeHandlerBoolean.TYPE].map(v=>Se.namedNode(v)),["boolean"]),he.registerHandler(new dt.TypeHandlerNumberDouble,dt.TypeHandlerNumberDouble.TYPES.map(v=>Se.namedNode(v)),["number"]),he.registerHandler(new dt.TypeHandlerNumberInteger,dt.TypeHandlerNumberInteger.TYPES.map(v=>Se.namedNode(v)),["number"]),he.registerHandler(new dt.TypeHandlerDate,dt.TypeHandlerDate.TYPES.map(v=>Se.namedNode(v)),["object"]),it.fromRdf=W,it.toRdf=function(v,x){return x&&"namedNode"in x&&(x={dataFactory:x}),(x=x||{})&&!x.dataFactory&&(x.dataFactory=Se),he.toRdf(v,x)},it.getTermRaw=function(v,x){return"Literal"===v.termType?W(v,x):v.value},it.getSupportedRdfDatatypes=function(){return he.getSupportedRdfDatatypes()},it.getSupportedJavaScriptPrimitives=function(){return he.getSupportedJavaScriptPrimitives()}},871:(Ut,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0})},60:(Ut,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(ee){throw new Error(`Invalid RDF ${ee.datatype.value} value: '${ee.value}'`)}registerHandler(ee,Tt,dt){for(const Y of Tt)this.supportedRdfDatatypes.push(Y),this.fromRdfHandlers[Y.value]=ee;for(const Y of dt){let Se=this.toRdfHandlers[Y];Se||(this.toRdfHandlers[Y]=Se=[]),Se.push(ee)}}fromRdf(ee,Tt){const dt=this.fromRdfHandlers[ee.datatype.value];return dt?dt.fromRdf(ee,Tt):ee.value}toRdf(ee,Tt){const dt=this.toRdfHandlers[typeof ee];if(dt)for(const Y of dt){const Se=Y.toRdf(ee,Tt);if(Se)return Se}throw new Error(`Invalid JavaScript value: '${ee}'`)}getSupportedRdfDatatypes(){return this.supportedRdfDatatypes}getSupportedJavaScriptPrimitives(){return Object.keys(this.toRdfHandlers)}}},727:(Ut,it,Je)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.TypeHandlerBoolean=void 0;const yt=Je(60);class ee{fromRdf(dt,Y){switch(dt.value){case"true":return!0;case"false":return!1;case"1":return!0;case"0":return!1}return Y&&yt.Translator.incorrectRdfDataType(dt),!1}toRdf(dt,{datatype:Y,dataFactory:Se}){return Se.literal(dt?"true":"false",Y||Se.namedNode(ee.TYPE))}}it.TypeHandlerBoolean=ee,ee.TYPE="http://www.w3.org/2001/XMLSchema#boolean"},525:(Ut,it,Je)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.TypeHandlerDate=void 0;const yt=Je(60);class ee{fromRdf(dt,Y){switch(Y&&!dt.value.match(ee.VALIDATORS[dt.datatype.value.substr(33,dt.datatype.value.length)])&&yt.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 Se=dt.value.split("-");return new Date(0,parseInt(Se[0],10)-1,parseInt(Se[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:Y,dataFactory:Se}){if(Y=Y||Se.namedNode(ee.TYPES[0]),!(dt instanceof Date))return null;const he=dt;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 Se.literal(W,Y)}}it.TypeHandlerDate=ee,ee.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"],ee.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:(Ut,it,Je)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.TypeHandlerNumberDouble=void 0;const yt=Je(60);class ee{fromRdf(dt,Y){const Se=parseFloat(dt.value);return Y&&isNaN(Se)&&yt.Translator.incorrectRdfDataType(dt),Se}toRdf(dt,{datatype:Y,dataFactory:Se}){return Y=Y||Se.namedNode(ee.TYPES[0]),isNaN(dt)?Se.literal("NaN",Y):isFinite(dt)?dt%1==0?null:Se.literal(dt.toExponential(15).replace(/(\d)0*e\+?/,"$1E"),Y):Se.literal(dt>0?"INF":"-INF",Y)}}it.TypeHandlerNumberDouble=ee,ee.TYPES=["http://www.w3.org/2001/XMLSchema#double","http://www.w3.org/2001/XMLSchema#decimal","http://www.w3.org/2001/XMLSchema#float"]},750:(Ut,it,Je)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.TypeHandlerNumberInteger=void 0;const yt=Je(60);class ee{fromRdf(dt,Y){const Se=parseInt(dt.value,10);return Y&&(isNaN(Se)||dt.value.indexOf(".")>=0)&&yt.Translator.incorrectRdfDataType(dt),Se}toRdf(dt,{datatype:Y,dataFactory:Se}){return Se.literal(String(dt),Y||Se.namedNode(dt<=ee.MAX_INT&&dt>=ee.MIN_INT?ee.TYPES[0]:ee.TYPES[1]))}}it.TypeHandlerNumberInteger=ee,ee.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"],ee.MAX_INT=2147483647,ee.MIN_INT=-2147483648},608:(Ut,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.TypeHandlerString=void 0;class Je{fromRdf(ee){return ee.value}toRdf(ee,{datatype:Tt,dataFactory:dt}){return dt.literal(ee,Tt)}}it.TypeHandlerString=Je,Je.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(Ut,it,Je){"use strict";var yt=this&&this.__createBinding||(Object.create?function(Tt,dt,Y,Se){void 0===Se&&(Se=Y),Object.defineProperty(Tt,Se,{enumerable:!0,get:function(){return dt[Y]}})}:function(Tt,dt,Y,Se){void 0===Se&&(Se=Y),Tt[Se]=dt[Y]}),ee=this&&this.__exportStar||function(Tt,dt){for(var Y in Tt)"default"!==Y&&!Object.prototype.hasOwnProperty.call(dt,Y)&&yt(dt,Tt,Y)};Object.defineProperty(it,"__esModule",{value:!0}),ee(Je(727),it),ee(Je(525),it),ee(Je(554),it),ee(Je(750),it),ee(Je(608),it)},303:(Ut,it,Je)=>{"use strict";var yt={};Je.r(yt),Je.d(yt,{decode:()=>Xme,encode:()=>Qme});var ee={};Je.r(ee),Je.d(ee,{decode:()=>n_e,encode:()=>i_e});var Tt={};Je.r(Tt),Je.d(Tt,{decode:()=>r_e,encode:()=>s_e});var dt={};function Y(n){return"function"==typeof n}Je.r(dt),Je.d(dt,{decode:()=>o_e,encode:()=>a_e});let Se=!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 Se&&console.log("RxJS: Back to a better error behavior. Thank you. <3");Se=n},get useDeprecatedSynchronousErrorHandling(){return Se}};function W(n){setTimeout(()=>{throw n},0)}const j={closed:!0,next(n){},error(n){if(he.useDeprecatedSynchronousErrorHandling)throw n;W(n)},complete(){}},P=Array.isArray||(n=>n&&"number"==typeof n.length);function Q(n){return null!==n&&"object"==typeof n}const v=(()=>{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 x{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 x)t.remove(this);else if(null!==t)for(let o=0;oe.concat(t instanceof v?t.errors:t),[])}x.EMPTY=((n=new x).closed=!0,n);const A="function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random();class y extends x{constructor(e,t,i){switch(super(),this.syncErrorValue=null,this.syncErrorThrown=!1,this.syncErrorThrowable=!1,this.isStopped=!1,arguments.length){case 0:this.destination=j;break;case 1:if(!e){this.destination=j;break}if("object"==typeof e){e instanceof y?(this.syncErrorThrowable=e.syncErrorThrowable,this.destination=e,e.add(this)):(this.syncErrorThrowable=!0,this.destination=new S(this,e));break}default:this.syncErrorThrowable=!0,this.destination=new S(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 S 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!==j&&(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 R="function"==typeof Symbol&&Symbol.observable||"@@observable";function K(n){return n}function ce(...n){return D(n)}function D(n){return 0===n.length?K:1===n.length?n[0]:function(t){return n.reduce((i,r)=>r(i),t)}}let I=(()=>{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(j)}(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=X(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)}[R](){return this}pipe(...t){return 0===t.length?this:D(t)(this)}toPromise(t){return new(t=X(t))((i,r)=>{let s;this.subscribe(o=>s=o,o=>r(o),()=>i(s))})}}return n.create=e=>new n(e),n})();function X(n){if(n||(n=he.Promise||Promise),!n)throw new Error("no Promise impl found");return n}const $=(()=>{function n(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return n.prototype=Object.create(Error.prototype),n})();class Z extends x{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 oe extends y{constructor(e){super(e),this.destination=e}}let se=(()=>{class n extends I{constructor(){super(),this.observers=[],this.closed=!1,this.isStopped=!1,this.hasError=!1,this.thrownError=null}[A](){return new oe(this)}lift(t){const i=new te(this,this);return i.operator=t,i}next(t){if(this.closed)throw new $;if(!this.isStopped){const{observers:i}=this,r=i.length,s=i.slice();for(let o=0;onew te(e,t),n})();class te extends se{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):x.EMPTY}}function Ce(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 ne(n,e))}}class ne{constructor(e,t){this.project=e,this.thisArg=t}call(e,t){return t.subscribe(new _e(e,this.project,this.thisArg))}}class _e 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 Ie=n=>e=>{for(let t=0,i=n.length;tn&&"number"==typeof n.length&&"function"!=typeof n;function Ke(n){return!!n&&"function"!=typeof n.subscribe&&"function"==typeof n.then}const Me=n=>{if(n&&"function"==typeof n[R])return(n=>e=>{const t=n[R]();if("function"!=typeof t.subscribe)throw new TypeError("Provided object does not correctly implement Symbol.observable");return t.subscribe(e)})(n);if(ke(n))return Ie(n);if(Ke(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[Xe])return(n=>e=>{const t=n[Xe]();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 ${Q(n)?"an invalid object":`'${n}'`} where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.`;throw new TypeError(t)}};function Ne(n,e){return new I(t=>{const i=new x;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 je(n,e){return e?function(n,e){if(null!=n){if(function(n){return n&&"function"==typeof n[R]}(n))return function(n,e){return new I(t=>{const i=new x;return i.add(e.schedule(()=>{const r=n[R]();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(Ke(n))return function(n,e){return new I(t=>{const i=new x;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(ke(n))return Ne(n,e);if(function(n){return n&&"function"==typeof n[Xe]}(n)||"string"==typeof n)return function(n,e){if(!n)throw new Error("Iterable cannot be null");return new I(t=>{const i=new x;let r;return i.add(()=>{r&&"function"==typeof r.return&&r.return()}),i.add(e.schedule(()=>{r=n[Xe](),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 I?n:new I(Me(n))}class _t 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 ve extends y{notifyNext(e){this.destination.next(e)}notifyError(e){this.destination.error(e)}notifyComplete(){this.destination.complete()}}function N(n,e){if(e.closed)return;if(n instanceof I)return n.subscribe(e);let t;try{t=Me(n)(e)}catch(i){e.error(i)}return t}function B(n,e,t=Number.POSITIVE_INFINITY){return"function"==typeof e?i=>i.pipe(B((r,s)=>je(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 Qe(e,this.project,this.concurrent))}}class Qe extends ve{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 Nt(n=Number.POSITIVE_INFINITY){return B(K,n)}function On(n,e){return e?Ne(n,e):new I(Ie(n))}function kn(...n){let e=Number.POSITIVE_INFINITY,t=null,i=n[n.length-1];return Ce(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 I?n[0]:Nt(e)(On(n,t))}function Yn(){return function(e){return e.lift(new Ti(e))}}class Ti{constructor(e){this.connectable=e}call(e,t){const{connectable:i}=this;i._refCount++;const r=new wi(e,i),s=t.subscribe(r);return r.closed||(r.connection=i.connect()),s}}class wi 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 Xr extends I{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 x,e.add(this.source.subscribe(new gs(this.getSubject(),this))),e.closed&&(this._connection=null,e=x.EMPTY)),e}refCount(){return Yn()(this)}}const Ls=(()=>{const n=Xr.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 gs extends oe{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()}}}function el(n,e){return function(i){let r;if(r="function"==typeof n?n:function(){return n},"function"==typeof e)return i.lift(new kl(r,e));const s=Object.create(i,Ls);return s.source=i,s.subjectFactory=r,s}}class kl{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 Sa(){return new se}function Es(){return n=>Yn()(el(Sa)(n))}function Jt(n){for(let e in n)if(n[e]===Jt)return e;throw Error("Could not find renamed property on target object.")}function tl(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 lt(n,e){return null==n||""===n?null===e?"":e:null==e||""===e?n:n+" "+e}const ht=Jt({__forward_ref__:Jt});function ge(n){return n.__forward_ref__=ge,n.toString=function(){return rt(this())},n}function be(n){return Le(n)?n():n}function Le(n){return"function"==typeof n&&n.hasOwnProperty(ht)&&n.__forward_ref__===ge}class Ze extends Error{constructor(e,t){super(function(n,e){return`${n?`NG0${n}: `:""}${e}`}(e,t)),this.code=e}}function Dt(n){return"string"==typeof n?n:null==n?"":String(n)}function Xt(n){return"function"==typeof n?n.name||n.toString():"object"==typeof n&&null!=n&&"function"==typeof n.type?n.type.name||n.type.toString():Dt(n)}function bn(n,e){const t=e?` in ${e}`:"";throw new Ze("201",`No provider for ${Xt(n)} found${t}`)}function J(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 xt(n){return{providers:n.providers||[],imports:n.imports||[]}}function vn(n){return Ss(n,po)||Ss(n,js)}function Ss(n,e){return n.hasOwnProperty(e)?n[e]:null}function Ll(n){return n&&(n.hasOwnProperty(jr)||n.hasOwnProperty(xc))?n[jr]:null}const po=Jt({\u0275prov:Jt}),jr=Jt({\u0275inj:Jt}),js=Jt({ngInjectableDef:Jt}),xc=Jt({ngInjectorDef:Jt});var Sn=(()=>((Sn=Sn||{})[Sn.Default=0]="Default",Sn[Sn.Host=1]="Host",Sn[Sn.Self=2]="Self",Sn[Sn.SkipSelf=4]="SkipSelf",Sn[Sn.Optional=8]="Optional",Sn))();let go;function Ca(n){const e=go;return go=n,e}function wd(n,e,t){const i=vn(n);return i&&"root"==i.providedIn?void 0===i.value?i.value=i.factory():i.value:t&Sn.Optional?null:void 0!==e?e:void bn(rt(n),"Injector")}function De(n){return{toString:n}.toString()}var He=(()=>((He=He||{})[He.OnPush=0]="OnPush",He[He.Default=1]="Default",He))(),Yt=(()=>((Yt=Yt||{})[Yt.Emulated=0]="Emulated",Yt[Yt.None=2]="None",Yt[Yt.ShadowDom=3]="ShadowDom",Yt))();const li="undefined"!=typeof globalThis&&globalThis,Vr="undefined"!=typeof window&&window,es="undefined"!=typeof self&&"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&self,xs="undefined"!=typeof global&&global,Qn=li||xs||Vr||es,Ed={},tr=[],fp=Jt({\u0275cmp:Jt}),Jm=Jt({\u0275dir:Jt}),Dh=Jt({\u0275pipe:Jt}),sv=Jt({\u0275mod:Jt}),T1=Jt({\u0275loc:Jt}),jl=Jt({\u0275fac:Jt}),Ih=Jt({__NG_ELEMENT_ID__:Jt});let M1=0;function ln(n){return De(()=>{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||tr,viewQuery:n.viewQuery||null,features:n.features||null,data:n.data||{},encapsulation:n.encapsulation||Yt.Emulated,id:"c",styles:n.styles||tr,_:null,setInput:null,schemas:n.schemas||null,tView:null},r=n.directives,s=n.features,o=n.pipes;return i.id+=M1++,i.inputs=cv(n.inputs,t),i.outputs=cv(n.outputs),s&&s.forEach(a=>a(i)),i.directiveDefs=r?()=>("function"==typeof r?r():r).map(ov):null,i.pipeDefs=o?()=>("function"==typeof o?o():o).map(av):null,i})}function ov(n){return Vi(n)||function(n){return n[Jm]||null}(n)}function av(n){return function(n){return n[Dh]||null}(n)}const lv={};function on(n){return De(()=>{const e={type:n.type,bootstrap:n.bootstrap||tr,declarations:n.declarations||tr,imports:n.imports||tr,exports:n.exports||tr,transitiveCompileScopes:null,schemas:n.schemas||null,id:n.id||null};return null!=n.id&&(lv[n.id]=n.type),e})}function cv(n,e){if(null==n)return Ed;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 Rt=ln;function Vs(n){return{type:n.type,name:n.name,factory:null,pure:!1!==n.pure,onDestroy:n.type.prototype.ngOnDestroy||null}}function Vi(n){return n[fp]||null}function Oo(n,e){const t=n[sv]||null;if(!t&&!0===e)throw new Error(`Type ${rt(n)} does not have '\u0275mod' property.`);return t}function Qo(n){return Array.isArray(n)&&"object"==typeof n[1]}function Zo(n){return Array.isArray(n)&&!0===n[1]}function n_(n){return 0!=(8&n.flags)}function Ad(n){return 2==(2&n.flags)}function Td(n){return 1==(1&n.flags)}function Ma(n){return null!==n.template}function uv(n){return 0!=(512&n[2])}function Tc(n,e){return n.hasOwnProperty(jl)?n[jl]:null}class o_{constructor(e,t,i){this.previousValue=e,this.currentValue=t,this.firstChange=i}isFirstChange(){return this.firstChange}}function Ui(){return fv}function fv(n){return n.type.prototype.ngOnChanges&&(n.setInput=k1),F1}function F1(){const n=at(this),e=null==n?void 0:n.current;if(e){const t=n.previous;if(t===Ed)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=at(n)||function(n,e){return n[kh]=e}(n,{previous:Ed,current:null}),s=r.current||(r.current={}),o=r.previous,a=this.declaredInputs[t],l=o[a];s[a]=new o_(l&&l.currentValue,e,o===Ed),n[i]=e}Ui.ngInherit=!0;const kh="__ngSimpleChanges__";function at(n){return n[kh]||null}let Ki;function gr(n){return!!n.listen}const bu={createRenderer:(n,e)=>void 0!==Ki?Ki:"undefined"!=typeof document?document:void 0};function xr(n){for(;Array.isArray(n);)n=n[0];return n}function Lh(n,e){return xr(e[n])}function Zs(n,e){return xr(e[n.index])}function c_(n,e){return n.data[e]}function zs(n,e){const t=e[n];return Qo(t)?t:t[0]}function zl(n){return 4==(4&n[2])}function Dd(n){return 128==(128&n[2])}function Ia(n,e){return null==e?null:n[e]}function u_(n){n[18]=0}function mp(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 Bn={lFrame:wu(null),bindingsEnabled:!0,isInCheckNoChangesMode:!1};function gv(){return Bn.bindingsEnabled}function jt(){return Bn.lFrame.lView}function Ei(){return Bn.lFrame.tView}function Cr(n){return Bn.lFrame.contextLView=n,n[8]}function cs(){let n=d_();for(;null!==n&&64===n.type;)n=n.parent;return n}function d_(){return Bn.lFrame.currentTNode}function rl(n,e){const t=Bn.lFrame;t.currentTNode=n,t.isParent=e}function Hr(){return Bn.lFrame.isParent}function ms(){Bn.lFrame.isParent=!1}function Vh(){return Bn.isInCheckNoChangesMode}function yp(n){Bn.isInCheckNoChangesMode=n}function Oa(){return Bn.lFrame.bindingIndex++}function No(n){const e=Bn.lFrame,t=e.bindingIndex;return e.bindingIndex=e.bindingIndex+n,t}function Id(n,e){const t=Bn.lFrame;t.bindingIndex=t.bindingRootIndex=n,h_(e)}function h_(n){Bn.lFrame.currentDirectiveIndex=n}function f_(n){const e=Bn.lFrame.currentDirectiveIndex;return-1===e?null:n[e]}function mv(){return Bn.lFrame.currentQueryIndex}function p_(n){Bn.lFrame.currentQueryIndex=n}function vp(n){const e=n[1];return 2===e.type?e.declTNode:1===e.type?n[6]:null}function Od(n,e,t){if(t&Sn.SkipSelf){let r=e,s=n;for(;!(r=r.parent,null!==r||t&Sn.Host||(r=vp(s),null===r||(s=s[15],10&r.type))););if(null===r)return!1;e=r,n=s}const i=Bn.lFrame=Ee();return i.currentTNode=e,i.lView=n,!0}function Hh(n){const e=Ee(),t=n[1];Bn.lFrame=e,e.currentTNode=t.firstChild,e.lView=n,e.tView=t,e.contextLView=n,e.bindingIndex=t.bindingStartIndex,e.inI18n=!1}function Ee(){const n=Bn.lFrame,e=null===n?null:n.child;return null===e?wu(n):e}function wu(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 Gh(){const n=Bn.lFrame;return Bn.lFrame=n.parent,n.currentTNode=null,n.lView=null,n}const Po=Gh;function fi(){const n=Gh();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 Js(){return Bn.lFrame.selectedIndex}function yo(n){Bn.lFrame.selectedIndex=n}function kr(){const n=Bn.lFrame;return c_(n.tView,n.selectedIndex)}function wp(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 $h{constructor(e,t,i){this.factory=e,this.resolving=!1,this.canSeeViewProviders=t,this.injectImpl=i}}function xp(n,e,t){const i=gr(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 Nd=!0;function Cp(n){const e=Nd;return Nd=n,e}let v_=0;function Hs(n,e){const t=Ap(n,e);if(-1!==t)return t;const i=e[1];i.firstCreatePass&&(n.injectorIndex=e.length,w_(i.data,n),w_(e,null),w_(i.blueprint,null));const r=qh(n,e),s=n.injectorIndex;if(vv(r)){const o=Rd(r),a=ol(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 w_(n,e){n.push(0,0,0,0,0,0,0,0,e)}function Ap(n,e){return-1===n.injectorIndex||n.parent&&n.parent.injectorIndex===n.injectorIndex||null===e[n.injectorIndex+8]?-1:n.injectorIndex}function qh(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 Dc(n,e,t){!function(n,e,t){let i;"string"==typeof t?i=t.charCodeAt(0)||0:t.hasOwnProperty(Ih)&&(i=t[Ih]),null==i&&(i=t[Ih]=v_++);const r=255&i;e.data[n+(r>>5)]|=1<=0?255&e:xv:e}(t);if("function"==typeof s){if(!Od(e,n,i))return i&Sn.Host?E_(r,t,i):Ev(e,t,i,r);try{const o=s(i);if(null!=o||i&Sn.Optional)return o;bn(t)}finally{Po()}}else if("number"==typeof s){let o=null,a=Ap(n,e),l=-1,c=i&Sn.Host?e[16][6]:null;for((-1===a||i&Sn.SkipSelf)&&(l=-1===a?qh(n,e):e[a+8],-1!==l&&Kh(i,!1)?(o=e[1],a=Rd(l),e=ol(l,e)):a=-1);-1!==a;){const u=e[1];if(Tp(s,a,u.data)){const h=Ts(a,e,t,o,i,c);if(h!==Sv)return h}l=e[a+8],-1!==l&&Kh(i,e[1].data[a+8]===c)&&Tp(s,a,e)?(o=u,a=Rd(l),e=ol(l,e)):a=-1}}}return Ev(e,t,i,r)}const Sv={};function xv(){return new ea(cs(),jt())}function Ts(n,e,t,i,r,s){const o=e[1],a=o.data[n+8],u=Pd(a,o,t,null==i?Ad(a)&&Nd:i!=o&&0!=(3&a.type),r&Sn.Host&&s===a);return null!==u?Fd(e,o,u,a):Sv}function Pd(n,e,t,i,r){const s=n.providerIndexes,o=e.data,a=1048575&s,l=n.directiveStart,u=s>>20,p=r?a+u:n.directiveEnd;for(let g=i?a:a+u;g=l&&m.type===t)return g}if(r){const g=o[l];if(g&&Ma(g)&&g.type===t)return l}return null}function Fd(n,e,t,i){let r=n[t];const s=e.data;if(function(n){return n instanceof $h}(r)){const o=r;o.resolving&&function(n,e){throw new Ze("200",`Circular dependency in DI detected for ${n}`)}(Xt(s[t]));const a=Cp(o.canSeeViewProviders);o.resolving=!0;const l=o.injectImpl?Ca(o.injectImpl):null;Od(n,i,Sn.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=fv(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&&Ca(l),Cp(a),o.resolving=!1,Po()}}return r}function Tp(n,e,t){return!!(t[e+(n>>5)]&1<{const e=n.prototype.constructor,t=e[jl]||Ms(e),i=Object.prototype;let r=Object.getPrototypeOf(n.prototype).constructor;for(;r&&r!==i;){const s=r[jl]||Ms(r);if(s&&s!==t)return s;r=Object.getPrototypeOf(r)}return s=>new s})}function Ms(n){return Le(n)?()=>{const e=Ms(be(n));return e&&e()}:Tc(n)}function Fo(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{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,u){const h=l.hasOwnProperty(Ld)?l[Ld]:Object.defineProperty(l,Ld,{value:[]})[Ld];for(;h.length<=u;)h.push(null);return(h[u]=h[u]||[]).push(o),l}}return t&&(r.prototype=Object.create(t.prototype)),r.prototype.ngMetadataName=n,r.annotationCls=r,r})}class Ht{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}`}}const xu=Function;function ta(n,e){void 0===e&&(e=n);for(let t=0;tArray.isArray(t)?na(t,e):e(t))}function Qh(n,e,t){e>=n.length?n.push(t):n.splice(e,0,t)}function Gl(n,e){return e>=n.length-1?n.pop():n.splice(e,1)[0]}function Oc(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 M_(n,e){const t=Ds(n,e);if(t>=0)return n[1|t]}function Ds(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(Pc,"\n ")}`}("\n"+n.message,r,t,i),n.ngTokenPath=r,n[Nc]=null,n}const zd=Ud(Pa("Inject",n=>({token:n})),-1),ns=Ud(Pa("Optional"),8),ul=Ud(Pa("SkipSelf"),4);let Gd;function Ou(n){var e;return(null===(e=function(){if(void 0===Gd&&(Gd=null,Qn.trustedTypes))try{Gd=Qn.trustedTypes.createPolicy("angular",{createHTML:n=>n,createScript:n=>n,createScriptURL:n=>n})}catch(n){}return Gd}())||void 0===e?void 0:e.createHTML(n))||n}class Yl{constructor(e){this.changingThisBreaksApplicationSecurity=e}toString(){return`SafeValue must use [property]=binding: ${this.changingThisBreaksApplicationSecurity} (see https://g.co/ng/security#xss)`}}class P_ extends Yl{getTypeName(){return"HTML"}}class F_ extends Yl{getTypeName(){return"Style"}}class Vp extends Yl{getTypeName(){return"Script"}}class $d extends Yl{getTypeName(){return"URL"}}class Fn extends Yl{getTypeName(){return"ResourceURL"}}function Gs(n){return n instanceof Yl?n.changingThisBreaksApplicationSecurity:n}function ia(n,e){const t=Lc(n);if(null!=t&&t!==e){if("ResourceURL"===t&&"URL"===e)return!0;throw new Error(`Required a safe ${e}, got a ${t} (see https://g.co/ng/security#xss)`)}return t===e}function Lc(n){return n instanceof Yl&&n.getTypeName()||null}class zv{constructor(e){this.inertDocumentHelper=e}getInertBodyElement(e){e=""+e;try{const t=(new window.DOMParser).parseFromString(Ou(e),"text/html").body;return null===t?this.inertDocumentHelper.getInertBodyElement(e):(t.removeChild(t.firstChild),t)}catch(t){return null}}}class pA{constructor(e){if(this.defaultDoc=e,this.inertDocument=this.defaultDoc.implementation.createHTMLDocument("sanitization-inert"),null==this.inertDocument.body){const t=this.inertDocument.createElement("html");this.inertDocument.appendChild(t);const i=this.inertDocument.createElement("body");t.appendChild(i)}}getInertBodyElement(e){const t=this.inertDocument.createElement("template");if("content"in t)return t.innerHTML=Ou(e),t;const i=this.inertDocument.createElement("body");return i.innerHTML=Ou(e),this.defaultDoc.documentMode&&this.stripCustomNsAttrs(i),i}stripCustomNsAttrs(e){const t=e.attributes;for(let r=t.length-1;0Bo(e.trim())).join(", ")}function ra(n){const e={};for(const t of n.split(","))e[t]=!0;return e}function Jh(...n){const e={};for(const t of n)for(const i in t)t.hasOwnProperty(i)&&(e[i]=!0);return e}const Up=ra("area,br,col,hr,img,wbr"),Gv=ra("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr"),$v=ra("rp,rt"),L_=Jh(Up,Jh(Gv,ra("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")),Jh($v,ra("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")),Jh($v,Gv)),B_=ra("background,cite,href,itemtype,longdesc,poster,src,xlink:href"),j_=ra("srcset"),V_=Jh(B_,j_,ra("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"),ra("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")),vA=ra("script,style,template");class U_{constructor(){this.sanitizedSomething=!1,this.buf=[]}sanitizeChildren(e){let t=e.firstChild,i=!0;for(;t;)if(t.nodeType===Node.ELEMENT_NODE?i=this.startElement(t):t.nodeType===Node.TEXT_NODE?this.chars(t.nodeValue):this.sanitizedSomething=!0,i&&t.firstChild)t=t.firstChild;else for(;t;){t.nodeType===Node.ELEMENT_NODE&&this.endElement(t);let r=this.checkClobberedElement(t,t.nextSibling);if(r){t=r;break}t=this.checkClobberedElement(t,t.parentNode)}return this.buf.join("")}startElement(e){const t=e.nodeName.toLowerCase();if(!L_.hasOwnProperty(t))return this.sanitizedSomething=!0,!vA.hasOwnProperty(t);this.buf.push("<"),this.buf.push(t);const i=e.attributes;for(let r=0;r"),!0}endElement(e){const t=e.nodeName.toLowerCase();L_.hasOwnProperty(t)&&!Up.hasOwnProperty(t)&&(this.buf.push(""))}chars(e){this.buf.push(Hp(e))}checkClobberedElement(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: ${e.outerHTML}`);return t}}const Wv=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,ef=/([^\#-~ |!])/g;function Hp(n){return n.replace(/&/g,"&").replace(Wv,function(e){return"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";"}).replace(ef,function(e){return"&#"+e.charCodeAt(0)+";"}).replace(//g,">")}let tf;function z_(n,e){let t=null;try{tf=tf||function(n){const e=new pA(n);return function(){try{return!!(new window.DOMParser).parseFromString(Ou(""),"text/html")}catch(n){return!1}}()?new zv(e):e}(n);let i=e?String(e):"";t=tf.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=t.innerHTML,t=tf.getInertBodyElement(i)}while(i!==s);return Ou((new U_).sanitizeChildren(Wd(t)||t))}finally{if(t){const i=Wd(t)||t;for(;i.firstChild;)i.removeChild(i.firstChild)}}}function Wd(n){return"content"in n&&function(n){return n.nodeType===Node.ELEMENT_NODE&&"TEMPLATE"===n.nodeName}(n)?n.content:null}var ni=(()=>((ni=ni||{})[ni.NONE=0]="NONE",ni[ni.HTML=1]="HTML",ni[ni.STYLE=2]="STYLE",ni[ni.SCRIPT=3]="SCRIPT",ni[ni.URL=4]="URL",ni[ni.RESOURCE_URL=5]="RESOURCE_URL",ni))();function nf(n){const e=function(){const n=jt();return n&&n[12]}();return e?e.sanitize(ni.URL,n)||"":ia(n,"URL")?Gs(n):Bo(Dt(n))}const $_="__ngContext__";function Is(n,e){n[$_]=e}function W_(n){const e=function(n){return n[$_]||null}(n);return e?Array.isArray(e)?e:e.lView:null}function Gp(n){return n.ngOriginalError}function NA(n,...e){n.error(...e)}class oa{constructor(){this._console=console}handleError(e){const t=this._findOriginalError(e),i=this._findContext(e),r=function(n){return n&&n.ngErrorLogger||NA}(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(Gp(e)):null}_findOriginalError(e){let t=e&&Gp(e);for(;t&&Gp(t);)t=Gp(t);return t||null}}const iw=(()=>("undefined"!=typeof requestAnimationFrame&&requestAnimationFrame||setTimeout).bind(Qn))();function hl(n){return n instanceof Function?n():n}var jo=(()=>((jo=jo||{})[jo.Important=1]="Important",jo[jo.DashCase=2]="DashCase",jo))();function Q_(n,e){return undefined(n,e)}function of(n){const e=n[3];return Zo(e)?e[3]:e}function Yd(n){return lw(n[13])}function J_(n){return lw(n[4])}function lw(n){for(;null!==n&&!Zo(n);)n=n[4];return n}function Kd(n,e,t,i,r){if(null!=i){let s,o=!1;Zo(i)?s=i:Qo(i)&&(o=!0,i=i[0]);const a=xr(i);0===n&&null!==t?null==r?fw(e,t,a):fl(e,t,a,r||null,!0):1===n&&null!==t?fl(e,t,a,r||null,!0):2===n?function(n,e,t){const i=qp(n,e);i&&function(n,e,t,i){gr(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!==xr(t)&&Kd(e,n,i,s,r);for(let a=10;a0&&(n[t-1][4]=i[4]);const s=Gl(n,10+e);!function(n,e){Xd(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 iy(n,e){if(!(256&e[2])){const t=e[11];gr(t)&&t.destroyNode&&Xd(n,e,t,3,null,null),function(n){let e=n[13];if(!e)return Wp(n[1],n);for(;e;){let t=null;if(Qo(e))t=e[13];else{const i=e[10];i&&(t=i)}if(!t){for(;e&&!e[4]&&e!==n;)Qo(e)&&Wp(e[1],e),e=e[3];null===e&&(e=n),Qo(e)&&Wp(e[1],e),t=e&&e[4]}e=t}}(e)}}function Wp(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[h+1].toLowerCase();const g=8&i?p:null;if(g&&-1!==lf(g,c,0)||2&i&&c!==p){if(ka(i))return!1;o=!0}}}}else{if(!o&&!ka(i)&&!ka(l))return!1;if(o&&ka(l))continue;o=!1,i=l|1&i}}return ka(i)||o}function ka(n){return 0==(1&n)}function oT(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&&!ka(o)&&(e+=Aw(s,r),r=""),i=o,s=s||!ka(i);t++}return""!==r&&(e+=Aw(s,r)),e}const In={};function Zt(n){Tw(Ei(),jt(),Js()+n,Vh())}function Tw(n,e,t,i){if(!i)if(3==(3&e[2])){const s=n.preOrderCheckHooks;null!==s&&Ep(e,s,t)}else{const s=n.preOrderHooks;null!==s&&Sp(e,s,0,t)}yo(t)}function pl(n,e){return n<<17|e<<2}function Rn(n){return n>>17&32767}function Ar(n){return 2|n}function Kl(n){return(131068&n)>>2}function gl(n,e){return-131069&n|e<<2}function cy(n){return 1|n}function kw(n,e){const t=n.contentQueries;if(null!==t)for(let i=0;i20&&Tw(n,e,20,Vh()),t(i,r)}finally{yo(s)}}function hf(n,e,t){!gv()||(function(n,e,t,i){const r=t.directiveStart,s=t.directiveEnd;n.firstCreatePass||Hs(t,e),Is(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 qw(n,e){null!==n.hostBindings&&n.hostBindings(1,e)}function Yw(n,e){e.flags|=2,(n.components||(n.components=[])).push(e.index)}function PT(n,e,t){if(t){if(e.exportAs)for(let i=0;i0&&wy(t)}}function wy(n){for(let i=Yd(n);null!==i;i=J_(i))for(let r=10;r0&&wy(s)}const t=n[1].components;if(null!==t)for(let i=0;i0&&wy(r)}}function UT(n,e){const t=zs(e,n),i=t[1];(function(n,e){for(let t=e.length;tPromise.resolve(null))();function Qw(n){return n[7]||(n[7]=[])}function ig(n){return n.cleanup||(n.cleanup=[])}function Ay(n,e,t){return(null===n||Ma(n))&&(t=function(n){for(;Array.isArray(n);){if("object"==typeof n[1])return n;n=n[0]}return null}(t[e.index])),t[11]}function Ty(n,e){const t=n[9],i=t?t.get(oa,null):null;i&&i.handleError(e)}function Zw(n,e,t,i,r){for(let s=0;sthis.processProvider(a,e,t)),na([e],a=>this.processInjectorType(a,[],s)),this.records.set(Pu,ku(void 0,this));const o=this.records.get(Fu);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=Tu,i=Sn.Default){this.assertNotDestroyed();const r=Vd(this),s=Ca(void 0);try{if(!(i&Sn.SkipSelf)){let a=this.records.get(e);if(void 0===a){const l=function(n){return"function"==typeof n||"object"==typeof n&&n instanceof Ht}(e)&&vn(e);a=l&&this.injectableDefInScope(l)?ku(Ry(e),ff):null,this.records.set(e,a)}if(null!=a)return this.hydrate(e,a)}return(i&Sn.Self?Jw():this.parent).get(e,t=i&Sn.Optional&&t===Tu?null:t)}catch(o){if("NullInjectorError"===o.name){if((o[Nc]=o[Nc]||[]).unshift(rt(e)),r)throw o;return eo(o,e,"R3InjectorError",this.source)}throw o}finally{Ca(s),Vd(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=be(e)))return!1;let r=Ll(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=Ll(s)),null==r)return!1;if(null!=r.imports&&!a){let u;i.push(o);try{na(r.imports,h=>{this.processInjectorType(h,t,i)&&(void 0===u&&(u=[]),u.push(h))})}finally{}if(void 0!==u)for(let h=0;hthis.processProvider(m,p,g||tr))}}this.injectorDefTypes.add(o);const l=Tc(o)||(()=>new o);this.records.set(o,ku(l,ff));const c=r.providers;if(null!=c&&!a){const u=e;na(c,h=>this.processProvider(h,u,c))}return void 0!==s&&void 0!==e.providers}processProvider(e,t,i){let r=Vc(e=be(e))?e:be(e&&e.provide);const s=function(n,e,t){return nE(n)?ku(void 0,n.useValue):ku(tE(n),ff)}(e);if(Vc(e)||!0!==e.multi)this.records.get(r);else{let o=this.records.get(r);o||(o=ku(void 0,ff,!0),o.factory=()=>Du(o.multi),this.records.set(r,o)),r=e,o.multi.push(e)}this.records.set(r,s)}hydrate(e,t){return t.value===ff&&(t.value=KT,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=be(e.providedIn);return"string"==typeof t?"any"===t||t===this.scope:this.injectorDefTypes.has(t)}}function Ry(n){const e=vn(n),t=null!==e?e.factory:Tc(n);if(null!==t)return t;if(n instanceof Ht)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=Oc(e,"?");throw new Error(`Can't resolve all parameters for ${rt(n)}: (${i.join(", ")}).`)}const t=function(n){const e=n&&(n[po]||n[js]);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 tE(n,e,t){let i;if(Vc(n)){const r=be(n);return Tc(r)||Ry(r)}if(nE(n))i=()=>be(n.useValue);else if(function(n){return!(!n||!n.useFactory)}(n))i=()=>n.useFactory(...Du(n.deps||[]));else if(function(n){return!(!n||!n.useExisting)}(n))i=()=>Oe(be(n.useExisting));else{const r=be(n&&(n.useClass||n.provide));if(!function(n){return!!n.deps}(n))return Tc(r)||Ry(r);i=()=>new r(...Du(n.deps))}return i}function ku(n,e,t=!1){return{factory:n,value:e,multi:t?[]:void 0}}function nE(n){return null!==n&&"object"==typeof n&&Np in n}function Vc(n){return"function"==typeof n}const iE=function(n,e,t){return function(n,e=null,t=null,i){const r=eE(n,e,t,i);return r._resolveInjectorDefTypes(),r}({name:t},e,n,t)};class Wn{static create(e,t){return Array.isArray(e)?iE(e,t,""):iE(e.providers,e.parent,e.name||"")}}function Gq(n,e){wp(W_(n)[1],cs())}function An(n){let e=function(n){return Object.getPrototypeOf(n.prototype).constructor}(n.type),t=!0;const i=[n];for(;e;){let r;if(Ma(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=cM(n.inputs),o.declaredInputs=cM(n.declaredInputs),o.outputs=cM(n.outputs);const a=r.hostBindings;a&&Yq(n,a);const l=r.viewQuery,c=r.contentQueries;if(l&&Wq(n,l),c&&qq(n,c),tl(n.inputs,r.inputs),tl(n.declaredInputs,r.declaredInputs),tl(n.outputs,r.outputs),Ma(r)&&r.data.animation){const u=n.data;u.animation=(u.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=Wh(r.hostAttrs,t=Wh(t,r.hostAttrs))}}(i)}function cM(n){return n===Ed?{}:n===tr?[]:n}function Wq(n,e){const t=n.viewQuery;n.viewQuery=t?(i,r)=>{e(i,r),t(i,r)}:e}function qq(n,e){const t=n.contentQueries;n.contentQueries=t?(i,r,s)=>{e(i,r,s),t(i,r,s)}:e}function Yq(n,e){const t=n.hostBindings;n.hostBindings=t?(i,r)=>{e(i,r),t(i,r)}:e}Wn.THROW_IF_NOT_FOUND=Tu,Wn.NULL=new io,Wn.\u0275prov=We({token:Wn,providedIn:"any",factory:()=>Oe(Pu)}),Wn.__NG_ELEMENT_ID__=-1;let lE=null;function sg(){if(!lE){const n=Qn.Symbol;if(n&&n.iterator)lE=n.iterator;else{const e=Object.getOwnPropertyNames(Map.prototype);for(let t=0;ta(xr(Ae[i.index])):i.index;if(gr(t)){let Ae=null;if(!a&&l&&(Ae=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!==Ae)(Ae.__ngLastListenerFn__||Ae).__ngNextListenerFn__=s,Ae.__ngLastListenerFn__=s,g=!1;else{s=mM(i,e,h,s,!1);const Pe=t.listen(H,r,s);p.push(s,Pe),u&&u.push(r,de,U,U+1)}}else s=mM(i,e,h,s,!0),H.addEventListener(r,s,o),p.push(s),u&&u.push(r,de,U,o)}else s=mM(i,e,h,s,!1);const m=i.outputs;let w;if(g&&null!==m&&(w=m[r])){const C=w.length;if(C)for(let H=0;H0;)e=e[15],n--;return e}(n,Bn.lFrame.contextLView))[8]}(n)}function MY(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 Rs={textEnd:0,key:0,keyEnd:0,value:0,valueEnd:0};function jk(n){return n.substring(Rs.key,Rs.keyEnd)}function Vk(n,e){const t=Rs.textEnd;return t===e?-1:(e=Rs.keyEnd=function(n,e,t){for(;e32;)e++;return e}(n,Rs.key=e,t),bg(n,e,t))}function bg(n,e,t){for(;e=0;t=Vk(e,t))ko(n,jk(e),!0)}function ec(n,e,t,i){const r=jt(),s=Ei(),o=No(2);s.firstUpdatePass&&Wk(s,n,o,i),e!==In&&Eo(r,o,e)&&Yk(s,s.data[Js()],r,r[11],n,r[o+1]=function(n,e){return null==n||("string"==typeof e?n+=e:"object"==typeof n&&(n=rt(Gs(n)))),n}(e,t),i,o)}function $k(n,e){return e>=n.expandoStartIndex}function Wk(n,e,t,i){const r=n.data;if(null===r[t+1]){const s=r[Js()],o=$k(n,t);Xk(s,i)&&null===e&&!o&&(e=!1),e=function(n,e,t,i){const r=f_(n);let s=i?e.residualClasses:e.residualStyles;if(null===r)0===(i?e.classBindings:e.styleBindings)&&(t=Vy(t=yM(null,n,e,t,i),e.attrs,i),s=null);else{const o=e.directiveStylingLast;if(-1===o||n[o]!==r)if(t=yM(r,n,e,t,i),null===s){let l=function(n,e,t){const i=t?e.classBindings:e.styleBindings;if(0!==Kl(i))return n[Rn(i)]}(n,e,i);void 0!==l&&Array.isArray(l)&&(l=yM(null,n,e,l[1],i),l=Vy(l,e.attrs,i),function(n,e,t,i){n[Rn(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 u=t;if(r)if(0!==l){const p=Rn(n[a+1]);n[i+1]=pl(p,a),0!==p&&(n[p+1]=gl(n[p+1],i)),n[a+1]=function(n,e){return 131071&n|e<<17}(n[a+1],i)}else n[i+1]=pl(a,0),0!==a&&(n[a+1]=gl(n[a+1],i)),a=i;else n[i+1]=pl(l,0),0===a?a=i:n[l+1]=gl(n[l+1],i),l=i;c&&(n[i+1]=Ar(n[i+1])),Bk(n,u,i,!0),Bk(n,u,i,!1),function(n,e,t,i,r){const s=r?n.residualClasses:n.residualStyles;null!=s&&"string"==typeof e&&Ds(s,e)>=0&&(t[i+1]=cy(t[i+1]))}(e,u,n,i,s),o=pl(a,l),s?e.classBindings=o:e.styleBindings=o}(r,s,e,t,o,i)}}function yM(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),u=c?l[1]:l,h=null===u;let p=t[r+1];p===In&&(p=h?tr:void 0);let g=h?M_(p,i):u===i?p:void 0;if(c&&!gE(g)&&(g=M_(l,i)),gE(g)&&(a=g,o))return a;const m=n[r+1];r=o?Rn(m):Kl(m)}if(null!==e){let l=s?e.residualClasses:e.residualStyles;null!=l&&(a=M_(l,i))}return a}function gE(n){return void 0!==n}function Xk(n,e){return 0!=(n.flags&(e?16:32))}function Oi(n,e=""){const t=jt(),i=Ei(),r=n+20,s=i.firstCreatePass?Zd(i,r,1,e,null):i.data[r],o=t[r]=function(n,e){return gr(n)?n.createText(e):n.createTextNode(e)}(t[11],e);Yp(i,t,o,s),rl(s,!1)}function da(n){return ha("",n,""),da}function ha(n,e,t){const i=jt(),r=ag(i,n,e,t);return r!==In&&Xl(i,Js(),r),ha}function Lu(n,e,t){const i=jt();return Eo(i,Oa(),e)&&Vo(Ei(),kr(),i,n,e,i[11],t,!0),Lu}function mE(n,e,t){const i=jt();if(Eo(i,Oa(),e)){const s=Ei(),o=kr();Vo(s,o,i,n,e,Ay(f_(s.data),o,i),t,!0)}return mE}const gf=void 0;var dK=["en",[["a","p"],["AM","PM"],gf],[["AM","PM"],gf,gf],[["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"]],gf,[["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"]],gf,[["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}",gf,"{1} 'at' {0}",gf],[".",",",";","%","+","-","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 vg={};function pL(n){return n in vg||(vg[n]=Qn.ng&&Qn.ng.common&&Qn.ng.common.locales&&Qn.ng.common.locales[n]),vg[n]}var cn=(()=>((cn=cn||{})[cn.LocaleId=0]="LocaleId",cn[cn.DayPeriodsFormat=1]="DayPeriodsFormat",cn[cn.DayPeriodsStandalone=2]="DayPeriodsStandalone",cn[cn.DaysFormat=3]="DaysFormat",cn[cn.DaysStandalone=4]="DaysStandalone",cn[cn.MonthsFormat=5]="MonthsFormat",cn[cn.MonthsStandalone=6]="MonthsStandalone",cn[cn.Eras=7]="Eras",cn[cn.FirstDayOfWeek=8]="FirstDayOfWeek",cn[cn.WeekendRange=9]="WeekendRange",cn[cn.DateFormat=10]="DateFormat",cn[cn.TimeFormat=11]="TimeFormat",cn[cn.DateTimeFormat=12]="DateTimeFormat",cn[cn.NumberSymbols=13]="NumberSymbols",cn[cn.NumberFormats=14]="NumberFormats",cn[cn.CurrencyCode=15]="CurrencyCode",cn[cn.CurrencySymbol=16]="CurrencySymbol",cn[cn.CurrencyName=17]="CurrencyName",cn[cn.Currencies=18]="Currencies",cn[cn.Directionality=19]="Directionality",cn[cn.PluralCase=20]="PluralCase",cn[cn.ExtraData=21]="ExtraData",cn))();const _E="en-US";let gL=_E;function vM(n){J(n,"Expected localeId to be defined"),"string"==typeof n&&(gL=n.toLowerCase().replace(/_/g,"-"))}function SM(n,e,t,i,r){if(n=be(n),Array.isArray(n))for(let s=0;s>20;if(Vc(n)||!n.multi){const g=new $h(l,r,xe),m=CM(a,e,r?u:u+p,h);-1===m?(Dc(Hs(c,o),s,a),xM(s,n,e.length),e.push(a),c.directiveStart++,c.directiveEnd++,r&&(c.providerIndexes+=1048576),t.push(g),o.push(g)):(t[m]=g,o[m]=g)}else{const g=CM(a,e,u+p,h),m=CM(a,e,u,u+p),w=g>=0&&t[g],C=m>=0&&t[m];if(r&&!C||!r&&!w){Dc(Hs(c,o),s,a);const H=function(n,e,t,i,r){const s=new $h(n,t,xe);return s.multi=[],s.index=e,s.componentProviders=0,jL(s,r,i&&!t),s}(r?lX:aX,t.length,r,i,l);!r&&C&&(t[m].providerFactory=H),xM(s,n,e.length,0),e.push(a),c.directiveStart++,c.directiveEnd++,r&&(c.providerIndexes+=1048576),t.push(H),o.push(H)}else xM(s,n,g>-1?g:m,jL(t[r?m:g],l,!r&&i));!r&&i&&C&&t[m].componentProviders++}}}function xM(n,e,t,i){const r=Vc(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 jL(n,e,t){return t&&n.componentProviders++,n.multi.push(e)-1}function CM(n,e,t,i){for(let r=t;r{t.providersResolver=(i,r)=>function(n,e,t){const i=Ei();if(i.firstCreatePass){const r=Ma(n);SM(t,i.data,i.blueprint,r,!0),SM(e,i.data,i.blueprint,r,!1)}}(i,r?r(n):n,e)}}class VL{}const zL="ngComponent";class dX{resolveComponentFactory(e){throw function(n){const e=Error(`No component factory found for ${rt(n)}. Did you add it to @NgModule.entryComponents?`);return e[zL]=n,e}(e)}}class wl{}function EE(...n){}function Eg(n,e){return new En(Zs(n,e))}wl.NULL=new dX;const pX=function(){return Eg(cs(),jt())};let En=(()=>{class n{constructor(t){this.nativeElement=t}}return n.__NG_ELEMENT_ID__=pX,n})();function HL(n){return n instanceof En?n.nativeElement:n}class mf{}let MM=(()=>{class n{}return n.\u0275prov=We({token:n,providedIn:"root",factory:()=>null}),n})();class ju{constructor(e){this.full=e,this.major=e.split(".")[0],this.minor=e.split(".")[1],this.patch=e.split(".").slice(2).join(".")}}const GL=new ju("12.2.5");class $L{constructor(){}supports(e){return Ly(e)}create(e){return new vX(e)}}const bX=(n,e)=>e;class vX{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||bX}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 wX(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 WL),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 WL),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 wX{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 EX{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 WL{constructor(){this.map=new Map}put(e){const t=e.trackById;let i=this.map.get(t);i||(i=new EX,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 qL(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 xX(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 xX{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 KL(){return new Sg([new $L])}let Sg=(()=>{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||KL()),deps:[[n,new ul,new ns]]}}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:KL}),n})();function XL(){return new xg([new YL])}let xg=(()=>{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||XL()),deps:[[n,new ul,new ns]]}}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:XL}),n})();function SE(n,e,t,i,r=!1){for(;null!==t;){const s=e[t.index];if(null!==s&&i.push(xr(s)),Zo(s))for(let a=10;a-1&&(ny(e,i),Gl(t,i))}this._attachedToViewContainer=!1}iy(this._lView[1],this._lView)}onDestroy(e){Vw(this._lView[1],this._lView,null,e)}markForCheck(){Ey(this._cdRefInjectingView||this._lView)}detach(){this._lView[2]&=-129}reattach(){this._lView[2]|=128}detectChanges(){xy(this._lView[1],this._lView,this.context)}checkNoChanges(){!function(n,e,t){yp(!0);try{xy(n,e,t)}finally{yp(!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){Xd(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 AX extends $y{constructor(e){super(e),this._view=e}detectChanges(){Xw(this._view)}checkNoChanges(){!function(n){yp(!0);try{Xw(n)}finally{yp(!1)}}(this._view)}get context(){return null}}const MX=function(n){return function(n,e,t){if(Ad(n)&&!t){const i=zs(n.index,e);return new $y(i,i)}return 47&n.type?new $y(e[16],e):null}(cs(),jt(),16==(16&n))};let Dr=(()=>{class n{}return n.__NG_ELEMENT_ID__=MX,n})();const OX=[new YL],NX=new Sg([new $L]),PX=new xg(OX),kX=function(){return xE(cs(),jt())};let zo=(()=>{class n{}return n.__NG_ELEMENT_ID__=kX,n})();const LX=zo,BX=class extends LX{constructor(e,t,i){super(),this._declarationLView=e,this._declarationTContainer=t,this.elementRef=i}createEmbeddedView(e){const t=this._declarationTContainer.tViews,i=uf(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)),df(t,i,e),new $y(i)}};function xE(n,e){return 4&n.type?new BX(e,n,Eg(n,e)):null}class $c{}const UX=function(){return e3(cs(),jt())};let Ns=(()=>{class n{}return n.__NG_ELEMENT_ID__=UX,n})();const HX=Ns,ZL=class extends HX{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 ea(this._hostTNode,this._hostLView)}get parentInjector(){const e=qh(this._hostTNode,this._hostLView);if(vv(e)){const t=ol(e,this._hostLView),i=Rd(e);return new ea(t[1].data[i+8],t)}return new ea(null,this._hostLView)}clear(){for(;this.length>0;)this.remove(this.length-1)}get(e){const t=JL(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($c,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 Zo(n[3])}(i)){const u=this.indexOf(e);if(-1!==u)this.detach(u);else{const h=i[3],p=new ZL(h,h[6],h[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),iiw});class S3 extends VL{constructor(e,t){super(),this.componentDef=e,this.ngModule=t,this.componentType=e.type,this.selector=function(n){return n.map(dT).join(",")}(e.selectors),this.ngContentSelectors=e.ngContentSelectors?e.ngContentSelectors:[],this.isBoundToModule=!!t}get inputs(){return E3(this.componentDef.inputs)}get outputs(){return E3(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,Mg,r);return s!==Mg||i===Mg?s:e.get(t,i,r)}}}(e,r.injector):e,o=s.get(mf,bu),a=s.get(MM,null),l=o.createRenderer(null,this.componentDef),c=this.componentDef.selectors[0][0]||"div",u=i?function(n,e,t){if(gr(n))return n.selectRootElement(e,t===Yt.ShadowDom);let i="string"==typeof e?n.querySelector(e):e;return i.textContent="",i}(l,i,this.componentDef.encapsulation):ty(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)),h=this.componentDef.onPush?576:528,p=function(n,e){return{components:[],scheduler:n||iw,clean:WT,playerHandler:e||null,flags:0}}(),g=tg(0,null,null,1,0,null,null,null,null,null),m=uf(null,g,p,h,null,null,o,l,a,s);let w,C;Hh(m);try{const H=function(n,e,t,i,r,s){const o=t[1];t[20]=n;const l=Zd(o,20,2,"#host",null),c=l.mergedAttrs=e.hostAttrs;null!==c&&(rg(l,c,!0),null!==n&&(xp(r,n,c),null!==l.classes&&ay(r,n,l.classes),null!==l.styles&&Ew(r,n,l.styles)));const u=i.createRenderer(n,e),h=uf(t,eg(e),null,e.onPush?64:16,t[20],l,i,u,s||null,null);return o.firstCreatePass&&(Dc(Hs(l,t),o,e.type),Yw(o,l),yy(l,t.length,1)),ng(t,h),t[20]=h}(u,this.componentDef,m,o,l);if(u)if(i)xp(l,u,["ng-version",GL.full]);else{const{attrs:U,classes:de}=function(n){const e=[],t=[];let i=1,r=2;for(;i0&&ay(l,u,de.join(" "))}if(C=c_(g,20),void 0!==t){const U=C.projection=[];for(let de=0;del(o,e)),e.contentQueries){const l=cs();e.contentQueries(1,o,l.directiveStart)}const a=cs();return!s.firstCreatePass||null===e.hostBindings&&null===e.hostAttrs||(yo(a.index),Ww(t[1],a,0,a.directiveStart,a.directiveEnd,e),qw(e,o)),o}(H,this.componentDef,m,p,[Gq]),df(g,m,null)}finally{fi()}return new zQ(this.componentType,w,Eg(C,m),m,C)}}class zQ 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 AX(r),this.componentType=e}get injector(){return new ea(this._tNode,this._rootLView)}destroy(){this.hostView.destroy()}onDestroy(e){this.hostView.onDestroy(e)}}const Dg=new Map;class $Q extends $c{constructor(e,t){super(),this._parent=t,this._bootstrapComponents=[],this.injector=this,this.destroyCbs=[],this.componentFactoryResolver=new w3(this);const i=Oo(e),r=function(n){return n[T1]||null}(e);r&&vM(r),this._bootstrapComponents=hl(i.bootstrap),this._r3Injector=eE(e,t,[{provide:$c,useValue:this},{provide:wl,useValue:this.componentFactoryResolver}],rt(e)),this._r3Injector._resolveInjectorDefTypes(),this.instance=this.get(e)}get(e,t=Wn.THROW_IF_NOT_FOUND,i=Sn.Default){return e===Wn||e===$c||e===Pu?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 zM extends class{}{constructor(e){super(),this.moduleType=e,null!==Oo(e)&&function(n){const e=new Set;!function t(i){const r=Oo(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,Dg.get(s),i),Dg.set(s,i));const o=hl(r.imports);for(const a of o)e.has(a)||(e.add(a),t(a))}(n)}(e)}create(e){return new $Q(this.moduleType,e)}}function T3(n,e,t,i,r,s){const o=e+t;return Eo(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===In?void 0:t}(n,o+1)}function xl(n,e){const t=Ei();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 Ze("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=Tc(i.type)),o=Ca(xe);try{const a=Cp(!1),l=s();return Cp(a),function(n,e,t,i){t>=n.data.length&&(n.data[t]=null,n.blueprint[t]=null),e[t]=i}(t,jt(),r,l),l}finally{Ca(o)}}function Vu(n,e,t){const i=n+20,r=jt(),s=function(n,e){return n[e]}(r,i);return function(n,e){Zl.isWrapped(e)&&(e=Zl.unwrap(e),n[Bn.lFrame.bindingIndex]=In);return e}(r,function(n,e){return n[1].data[e].pure}(r,i)?T3(r,function(){const n=Bn.lFrame;let e=n.bindingRootIndex;return-1===e&&(e=n.bindingRootIndex=n.tView.bindingStartIndex),e}(),e,s.transform,t,s):s.transform(t))}function HM(n){return e=>{setTimeout(n,void 0,e)}}const sn=class extends se{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 h=e;a=null===(r=h.next)||void 0===r?void 0:r.bind(h),l=null===(s=h.error)||void 0===s?void 0:s.bind(h),c=null===(o=h.complete)||void 0===o?void 0:o.bind(h)}this.__isAsync&&(l=HM(l),a&&(a=HM(a)),c&&(c=HM(c)));const u=super.subscribe({next:a,error:l,complete:c});return e instanceof x&&e.add(u),u}};function oZ(){return this._results[sg()]()}class bf{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=sg(),i=bf.prototype;i[t]||(i[t]=oZ)}get changes(){return this._changes||(this._changes=new sn)}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=ta(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],u=e[-l];for(let h=10;h{class n{constructor(t){this.appInits=t,this.resolve=EE,this.reject=EE,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)(Oe(vf,8))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const r0=new Ht("AppId"),zZ={provide:r0,useFactory:function(){return`${eD()}${eD()}${eD()}`},deps:[]};function eD(){return String.fromCharCode(97+Math.floor(25*Math.random()))}const eB=new Ht("Platform Initializer"),Wc=new Ht("Platform ID"),RE=new Ht("appBootstrapListener");let NE=(()=>{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 Uu=new Ht("LocaleId"),tB=new Ht("DefaultCurrencyCode");class GZ{constructor(e,t){this.ngModuleFactory=e,this.componentFactories=t}}const tD=function(n){return new zM(n)},$Z=tD,WZ=function(n){return Promise.resolve(tD(n))},nB=function(n){const e=tD(n),i=hl(Oo(n).declarations).reduce((r,s)=>{const o=Vi(s);return o&&r.push(new S3(o)),r},[]);return new GZ(e,i)},qZ=nB,YZ=function(n){return Promise.resolve(nB(n))};let wf=(()=>{class n{constructor(){this.compileModuleSync=$Z,this.compileModuleAsync=WZ,this.compileModuleAndAllComponentsSync=qZ,this.compileModuleAndAllComponentsAsync=YZ}clearCache(){}clearCacheFor(t){}getModuleId(t){}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const iB=new Ht("compilerOptions"),XZ=(()=>Promise.resolve(0))();function nD(n){"undefined"==typeof Zone?XZ.then(()=>{n&&n.apply(null,null)}):Zone.current.scheduleMicroTask("scheduleMicrotask",n)}class gn{constructor({enableLongStackTrace:e=!1,shouldCoalesceEventChangeDetection:t=!1,shouldCoalesceRunChangeDetection:i=!1}){if(this.hasPendingMacrotasks=!1,this.hasPendingMicrotasks=!1,this.isStable=!0,this.onUnstable=new sn(!1),this.onMicrotaskEmpty=new sn(!1),this.onStable=new sn(!1),this.onError=new sn(!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=Qn.requestAnimationFrame,e=Qn.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(Qn,()=>{n.fakeTopEventTask||(n.fakeTopEventTask=Zone.root.scheduleEventTask("fakeTopEventTask",()=>{n.lastRequestAnimationFrameId=-1,rD(n),n.isCheckStableRunning=!0,iD(n),n.isCheckStableRunning=!1},void 0,()=>{},()=>{})),n.fakeTopEventTask.invoke()}),rD(n))}(n)};n._inner=n._inner.fork({name:"angular",properties:{isAngularZone:!0},onInvokeTask:(t,i,r,s,o,a)=>{try{return rB(n),t.invokeTask(r,s,o,a)}finally{(n.shouldCoalesceEventChangeDetection&&"eventTask"===s.type||n.shouldCoalesceRunChangeDetection)&&e(),sB(n)}},onInvoke:(t,i,r,s,o,a,l)=>{try{return rB(n),t.invoke(r,s,o,a,l)}finally{n.shouldCoalesceRunChangeDetection&&e(),sB(n)}},onHasTask:(t,i,r,s)=>{t.hasTask(r,s),i===r&&("microTask"==s.change?(n._hasPendingMicrotasks=s.microTask,rD(n),iD(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(!gn.isInAngularZone())throw new Error("Expected to be in Angular Zone, but it is not!")}static assertNotInAngularZone(){if(gn.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,ZZ,EE,EE);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 ZZ={};function iD(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 rD(n){n.hasPendingMicrotasks=!!(n._hasPendingMicrotasks||(n.shouldCoalesceEventChangeDetection||n.shouldCoalesceRunChangeDetection)&&-1!==n.lastRequestAnimationFrameId)}function rB(n){n._nesting++,n.isStable&&(n.isStable=!1,n.onUnstable.emit(null))}function sB(n){n._nesting--,iD(n)}class tJ{constructor(){this.hasPendingMicrotasks=!1,this.hasPendingMacrotasks=!1,this.isStable=!0,this.onUnstable=new sn,this.onMicrotaskEmpty=new sn,this.onStable=new sn,this.onError=new sn}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 sD=(()=>{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:()=>{gn.assertNotInAngularZone(),nD(()=>{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())nD(()=>{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)(Oe(gn))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),oB=(()=>{class n{constructor(){this._applications=new Map,oD.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 oD.findTestabilityInTree(this,t,i)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();class nJ{addToWindow(e){}findTestabilityInTree(e,t,i){return null}}let oD=new nJ,aB=!0,lB=!1;function Ba(){return lB=!0,aB}let rc;const cB=new Ht("AllowMultipleToken");function uB(n,e,t=[]){const i=`Platform: ${e}`,r=new Ht(i);return(s=[])=>{let o=lD();if(!o||o.injector.get(cB,!1))if(n)n(t.concat(s).concat({provide:r,useValue:!0}));else{const a=t.concat(s).concat({provide:r,useValue:!0},{provide:Fu,useValue:"platform"});!function(n){if(rc&&!rc.destroyed&&!rc.injector.get(cB,!1))throw new Error("There can be only one platform. Destroy the previous one to create a new one.");rc=n.get(dB);const e=n.get(eB,null);e&&e.forEach(t=>t())}(Wn.create({providers:a,name:i}))}return function(n){const e=lD();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 lD(){return rc&&!rc.destroyed?rc:null}let dB=(()=>{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 tJ:("zone.js"===n?void 0:n)||new gn({enableLongStackTrace:Ba(),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:gn,useValue:a}];return a.run(()=>{const c=Wn.create({providers:l,parent:this.injector,name:t.moduleType.name}),u=t.create(c),h=u.injector.get(oa,null);if(!h)throw new Error("No ErrorHandler. Is platform module (BrowserModule) included?");return a.runOutsideAngular(()=>{const p=a.onError.subscribe({next:g=>{h.handleError(g)}});u.onDestroy(()=>{cD(this._modules,u),p.unsubscribe()})}),function(n,e,t){try{const i=t();return yg(i)?i.catch(r=>{throw e.runOutsideAngular(()=>n.handleError(r)),r}):i}catch(i){throw e.runOutsideAngular(()=>n.handleError(i)),i}}(h,a,()=>{const p=u.injector.get(Og);return p.runInitializers(),p.donePromise.then(()=>(vM(u.injector.get(Uu,_E)||_E),this._moduleDoBootstrap(u),u))})})}bootstrapModule(t,i=[]){const r=hB({},i);return function(n,e,t){const i=new zM(t);return Promise.resolve(i)}(0,0,t).then(s=>this.bootstrapModuleFactory(s,r))}_moduleDoBootstrap(t){const i=t.injector.get(ih);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)(Oe(Wn))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();function hB(n,e){return Array.isArray(e)?e.reduce(hB,n):Object.assign(Object.assign({},n),e)}let ih=(()=>{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 I(c=>{this._stable=this._zone.isStable&&!this._zone.hasPendingMacrotasks&&!this._zone.hasPendingMicrotasks,this._zone.runOutsideAngular(()=>{c.next(this._stable),c.complete()})}),l=new I(c=>{let u;this._zone.runOutsideAngular(()=>{u=this._zone.onStable.subscribe(()=>{gn.assertNotInAngularZone(),nD(()=>{!this._stable&&!this._zone.hasPendingMacrotasks&&!this._zone.hasPendingMicrotasks&&(this._stable=!0,c.next(!0))})})});const h=this._zone.onUnstable.subscribe(()=>{gn.assertInAngularZone(),this._stable&&(this._stable=!1,this._zone.runOutsideAngular(()=>{c.next(!1)}))});return()=>{u.unsubscribe(),h.unsubscribe()}});this.isStable=kn(a,l.pipe(Es()))}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 VL?t:this._componentFactoryResolver.resolveComponentFactory(t),this.componentTypes.push(r.componentType);const s=function(n){return n.isBoundToModule}(r)?void 0:this._injector.get($c),a=r.create(Wn.NULL,[],i||r.selector,s),l=a.location.nativeElement,c=a.injector.get(sD,null),u=c&&a.injector.get(oB);return c&&u&&u.registerApplication(l,c),a.onDestroy(()=>{this.detachView(a.hostView),cD(this.components,a),u&&u.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;cD(this._views,i),i.detachFromAppRef()}_loadComponent(t){this.attachView(t.hostView),this.tick(),this.components.push(t),this._injector.get(RE,[]).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)(Oe(gn),Oe(Wn),Oe(oa),Oe(wl),Oe(Og))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();function cD(n,e){const t=n.indexOf(e);t>-1&&n.splice(t,1)}const DJ=uB(null,"core",[{provide:Wc,useValue:"unknown"},{provide:dB,deps:[Wn]},{provide:oB,deps:[]},{provide:NE,deps:[]}]),PJ=[{provide:ih,useClass:ih,deps:[gn,Wn,oa,wl,Og]},{provide:jQ,deps:[gn],useFactory:function(n){let e=[];return n.onStable.subscribe(()=>{for(;e.length;)e.pop()()}),function(t){e.push(t)}}},{provide:Og,useClass:Og,deps:[[new ns,vf]]},{provide:wf,useClass:wf,deps:[]},zZ,{provide:Sg,useFactory:function(){return NX},deps:[]},{provide:xg,useFactory:function(){return PX},deps:[]},{provide:Uu,useFactory:function(n){return vM(n=n||"undefined"!=typeof $localize&&$localize.locale||_E),n},deps:[[new zd(Uu),new ns,new ul]]},{provide:tB,useValue:"USD"}];let kJ=(()=>{class n{constructor(t){}}return n.\u0275fac=function(t){return new(t||n)(Oe(ih))},n.\u0275mod=on({type:n}),n.\u0275inj=xt({providers:PJ}),n})(),GE=null;function qc(){return GE}const pn=new Ht("DocumentToken");let xf=(()=>{class n{historyGo(t){throw new Error("Not implemented")}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({factory:Fee,token:n,providedIn:"platform"}),n})();function Fee(){return Oe(VB)}let VB=(()=>{class n extends xf{constructor(t){super(),this._doc=t,this._init()}_init(){this.location=window.location,this._history=window.history}getBaseHrefFromDOM(){return qc().getBaseHref(this._doc)}onPopState(t){const i=qc().getGlobalEventTarget(this._doc,"window");return i.addEventListener("popstate",t,!1),()=>i.removeEventListener("popstate",t)}onHashChange(t){const i=qc().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){UB()?this._history.pushState(t,i,r):this.location.hash=r}replaceState(t,i,r){UB()?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)(Oe(pn))},n.\u0275prov=We({factory:Lee,token:n,providedIn:"platform"}),n})();function UB(){return!!window.history.pushState}function Lee(){return new VB(Oe(pn))}function xD(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}function zB(n){const e=n.match(/#|\?|$/),t=e&&e.index||n.length;return n.slice(0,t-("/"===n[t-1]?1:0))+n.slice(t)}function Hu(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:Bee,token:n,providedIn:"root"}),n})();function Bee(n){const e=Oe(pn).location;return new HB(Oe(xf),e&&e.origin||"")}const CD=new Ht("appBaseHref");let HB=(()=>{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 xD(this._baseHref,t)}path(t=!1){const i=this._platformLocation.pathname+Hu(this._platformLocation.search),r=this._platformLocation.hash;return r&&t?`${i}${r}`:i}pushState(t,i,r,s){const o=this.prepareExternalUrl(r+Hu(s));this._platformLocation.pushState(t,i,o)}replaceState(t,i,r,s){const o=this.prepareExternalUrl(r+Hu(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)(Oe(xf),Oe(CD,8))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),Pg=(()=>{class n{constructor(t,i){this._subject=new sn,this._urlChangeListeners=[],this._platformStrategy=t;const r=this._platformStrategy.getBaseHref();this._platformLocation=i,this._baseHref=zB(GB(r)),this._platformStrategy.onPopState(s=>{this._subject.emit({url:this.path(!0),pop:!0,state:s.state,type:s.type})})}path(t=!1){return this.normalize(this._platformStrategy.path(t))}getState(){return this._platformLocation.getState()}isCurrentPathEqualTo(t,i=""){return this.path()==this.normalize(t+Hu(i))}normalize(t){return n.stripTrailingSlash(function(n,e){return n&&e.startsWith(n)?e.substring(n.length):e}(this._baseHref,GB(t)))}prepareExternalUrl(t){return t&&"/"!==t[0]&&(t="/"+t),this._platformStrategy.prepareExternalUrl(t)}go(t,i="",r=null){this._platformStrategy.pushState(r,"",t,i),this._notifyUrlChangeListeners(this.prepareExternalUrl(t+Hu(i)),r)}replaceState(t,i="",r=null){this._platformStrategy.replaceState(r,"",t,i),this._notifyUrlChangeListeners(this.prepareExternalUrl(t+Hu(i)),r)}forward(){this._platformStrategy.forward()}back(){this._platformStrategy.back()}historyGo(t=0){var i,r;null===(r=(i=this._platformStrategy).historyGo)||void 0===r||r.call(i,t)}onUrlChange(t){this._urlChangeListeners.push(t),this._urlChangeSubscription||(this._urlChangeSubscription=this.subscribe(i=>{this._notifyUrlChangeListeners(i.url,i.state)}))}_notifyUrlChangeListeners(t="",i){this._urlChangeListeners.forEach(r=>r(t,i))}subscribe(t,i,r){return this._subject.subscribe({next:t,error:i,complete:r})}}return n.\u0275fac=function(t){return new(t||n)(Oe(Cf),Oe(xf))},n.normalizeQueryParams=Hu,n.joinWithSlash=xD,n.stripTrailingSlash=zB,n.\u0275prov=We({factory:Vee,token:n,providedIn:"root"}),n})();function Vee(){return new Pg(Oe(Cf),Oe(xf))}function GB(n){return n.replace(/\/index.html$/,"")}var _s=(()=>((_s=_s||{})[_s.Zero=0]="Zero",_s[_s.One=1]="One",_s[_s.Two=2]="Two",_s[_s.Few=3]="Few",_s[_s.Many=4]="Many",_s[_s.Other=5]="Other",_s))();const Yee=function(n){return function(n){const e=function(n){return n.toLowerCase().replace(/_/g,"-")}(n);let t=pL(e);if(t)return t;const i=e.split("-")[0];if(t=pL(i),t)return t;if("en"===i)return dK;throw new Error(`Missing locale data for the locale "${n}".`)}(n)[cn.PluralCase]};class eS{}let Ste=(()=>{class n extends eS{constructor(t){super(),this.locale=t}getPluralCategory(t,i){switch(Yee(i||this.locale)(t)){case _s.Zero:return"zero";case _s.One:return"one";case _s.Two:return"two";case _s.Few:return"few";case _s.Many:return"many";default:return"other"}}}return n.\u0275fac=function(t){return new(t||n)(Oe(Uu))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();class Cte{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 Af=(()=>{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 Cte(null,this._ngForOf,-1,-1),null===o?void 0:o),l=new ej(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 ej(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)(xe(Ns),xe(zo),xe(Sg))},n.\u0275dir=Rt({type:n,selectors:[["","ngFor","","ngForOf",""]],inputs:{ngForOf:"ngForOf",ngForTrackBy:"ngForTrackBy",ngForTemplate:"ngForTemplate"}}),n})();class ej{constructor(e,t){this.record=e,this.view=t}}let lc=(()=>{class n{constructor(t,i){this._viewContainer=t,this._context=new Tte,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){tj("ngIfThen",t),this._thenTemplateRef=t,this._thenViewRef=null,this._updateView()}set ngIfElse(t){tj("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)(xe(Ns),xe(zo))},n.\u0275dir=Rt({type:n,selectors:[["","ngIf",""]],inputs:{ngIf:"ngIf",ngIfThen:"ngIfThen",ngIfElse:"ngIfElse"}}),n})();class Tte{constructor(){this.$implicit=null,this.ngIf=null}}function tj(n,e){if(e&&!e.createEmbeddedView)throw new Error(`${n} must be a TemplateRef, but received '${rt(e)}'.`)}class Ote{createSubscription(e,t){return e.subscribe({next:t,error:i=>{throw i}})}dispose(e){e.unsubscribe()}onDestroy(e){e.unsubscribe()}}class Rte{createSubscription(e,t){return e.then(t,i=>{throw i})}dispose(e){}onDestroy(e){}}const Nte=new Rte,Pte=new Ote;let h0=(()=>{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(yg(t))return Nte;if(Tk(t))return Pte;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)(xe(Dr,16))},n.\u0275pipe=Vs({name:"async",type:n,pure:!1}),n})(),qr=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=on({type:n}),n.\u0275inj=xt({providers:[{provide:eS,useClass:Ste}]}),n})();const lj="browser";function Tf(n){return n===lj}class BD extends class extends class{}{constructor(){super(...arguments),this.supportsDOMEvents=!0}}{static makeCurrent(){!function(n){GE||(GE=n)}(new BD)}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=(f0=f0||document.querySelector("base"),f0?f0.getAttribute("href"):null);return null==t?null:function(n){nS=nS||document.createElement("a"),nS.setAttribute("href",n);const e=nS.pathname;return"/"===e.charAt(0)?e:`/${e}`}(t)}resetBaseElement(){f0=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 nS,f0=null;const hj=new Ht("TRANSITION_ID"),rne=[{provide:vf,useFactory:function(n,e,t){return()=>{t.get(Og).donePromise.then(()=>{const i=qc(),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},Qn.getAllAngularTestabilities=()=>e.getAllTestabilities(),Qn.getAllAngularRootElements=()=>e.getAllRootElements(),Qn.frameworkStabilizers||(Qn.frameworkStabilizers=[]),Qn.frameworkStabilizers.push(i=>{const r=Qn.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?qc().isShadowRoot(t)?this.findTestabilityInTree(e,t.host,!0):this.findTestabilityInTree(e,t.parentElement,!0):null}}let sne=(()=>{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 p0=new Ht("EventManagerPlugins");let rS=(()=>{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})(),g0=(()=>{class n extends pj{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(gj),this._hostNodes.delete(t)}onStylesAdded(t){this._hostNodes.forEach((i,r)=>{this._addStylesToHost(t,r,i)})}ngOnDestroy(){this._hostNodes.forEach(t=>t.forEach(gj))}}return n.\u0275fac=function(t){return new(t||n)(Oe(pn))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();function gj(n){qc().remove(n)}const UD={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/"},zD=/%COMP%/g;function sS(n,e,t){for(let i=0;i{if("__ngUnwrap__"===e)return n;!1===n(e)&&(e.preventDefault(),e.returnValue=!1)}}let oS=(()=>{class n{constructor(t,i,r){this.eventManager=t,this.sharedStylesHost=i,this.appId=r,this.rendererByCompId=new Map,this.defaultRenderer=new HD(t)}createRenderer(t,i){if(!t||!i)return this.defaultRenderer;switch(i.encapsulation){case Yt.Emulated:{let r=this.rendererByCompId.get(i.id);return r||(r=new vne(this.eventManager,this.sharedStylesHost,i,this.appId),this.rendererByCompId.set(i.id,r)),r.applyToHost(t),r}case 1:case Yt.ShadowDom:return new wne(this.eventManager,this.sharedStylesHost,t,i);default:if(!this.rendererByCompId.has(i.id)){const r=sS(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)(Oe(rS),Oe(g0),Oe(r0))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();class HD{constructor(e){this.eventManager=e,this.data=Object.create(null)}destroy(){}createElement(e,t){return t?document.createElementNS(UD[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=UD[r];s?e.setAttributeNS(s,t,i):e.setAttribute(t,i)}else e.setAttribute(t,i)}removeAttribute(e,t,i){if(i){const r=UD[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&(jo.DashCase|jo.Important)?e.style.setProperty(t,i,r&jo.Important?"important":""):e.style[t]=i}removeStyle(e,t,i){i&jo.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,yj(i)):this.eventManager.addEventListener(e,t,yj(i))}}class vne extends HD{constructor(e,t,i,r){super(e),this.component=i;const s=sS(r+"-"+i.id,i.styles,[]);t.addStyles(s),this.contentAttr=function(n){return"_ngcontent-%COMP%".replace(zD,n)}(r+"-"+i.id),this.hostAttr=function(n){return"_nghost-%COMP%".replace(zD,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 wne extends HD{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=sS(r.id,r.styles,[]);for(let o=0;o{class n extends VD{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)(Oe(pn))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const wj=["alt","control","meta","shift"],Dne={"\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"},Ej={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"},Ine={alt:n=>n.altKey,control:n=>n.ctrlKey,meta:n=>n.metaKey,shift:n=>n.shiftKey};let One=(()=>{class n extends VD{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(()=>qc().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(wj.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&&Ej.hasOwnProperty(e)&&(e=Ej[e]))}return Dne[e]||e}(t);return r=r.toLowerCase()," "===r?r="space":"."===r&&(r="dot"),wj.forEach(s=>{s!=r&&Ine[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)(Oe(pn))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),Mf=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({factory:function(){return Oe($D)},token:n,providedIn:"root"}),n})(),$D=(()=>{class n extends Mf{constructor(t){super(),this._doc=t}sanitize(t,i){if(null==i)return null;switch(t){case ni.NONE:return i;case ni.HTML:return ia(i,"HTML")?Gs(i):z_(this._doc,String(i)).toString();case ni.STYLE:return ia(i,"Style")?Gs(i):i;case ni.SCRIPT:if(ia(i,"Script"))return Gs(i);throw new Error("unsafe value used in a script context");case ni.URL:return Lc(i),ia(i,"URL")?Gs(i):Bo(String(i));case ni.RESOURCE_URL:if(ia(i,"ResourceURL"))return Gs(i);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(n){return new P_(n)}(t)}bypassSecurityTrustStyle(t){return function(n){return new F_(n)}(t)}bypassSecurityTrustScript(t){return function(n){return new Vp(n)}(t)}bypassSecurityTrustUrl(t){return function(n){return new $d(n)}(t)}bypassSecurityTrustResourceUrl(t){return function(n){return new Fn(n)}(t)}}return n.\u0275fac=function(t){return new(t||n)(Oe(pn))},n.\u0275prov=We({factory:function(){return function(n){return new $D(n.get(pn))}(Oe(Pu))},token:n,providedIn:"root"}),n})();const jne=uB(DJ,"browser",[{provide:Wc,useValue:lj},{provide:eB,useValue:function(){BD.makeCurrent(),jD.init()},multi:!0},{provide:pn,useFactory:function(){return function(n){Ki=n}(document),document},deps:[]}]),Vne=[[],{provide:Fu,useValue:"root"},{provide:oa,useFactory:function(){return new oa},deps:[]},{provide:p0,useClass:Ene,multi:!0,deps:[pn,gn,Wc]},{provide:p0,useClass:One,multi:!0,deps:[pn]},[],{provide:oS,useClass:oS,deps:[rS,g0,r0]},{provide:mf,useExisting:oS},{provide:pj,useExisting:g0},{provide:g0,useClass:g0,deps:[pn]},{provide:sD,useClass:sD,deps:[gn]},{provide:rS,useClass:rS,deps:[p0,gn]},{provide:class{},useClass:sne,deps:[]},[]];let WD=(()=>{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:r0,useValue:t.appId},{provide:hj,useExisting:r0},rne]}}}return n.\u0275fac=function(t){return new(t||n)(Oe(n,12))},n.\u0275mod=on({type:n}),n.\u0275inj=xt({providers:Vne,imports:[qr,kJ]}),n})();"undefined"!=typeof window&&window;class Yne extends x{constructor(e,t){super()}schedule(e,t=0){return this}}class aS extends Yne{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 xj=(()=>{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 uc extends xj{constructor(e,t=xj.now){super(e,()=>uc.delegate&&uc.delegate!==this?uc.delegate.now():t()),this.actions=[],this.active=!1,this.scheduled=void 0}schedule(e,t=0,i){return uc.delegate&&uc.delegate!==this?uc.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 Qne=new class extends uc{}(class extends aS{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)}}),Yc=new I(n=>n.complete());function lS(n){return n?function(n){return new I(e=>n.schedule(()=>e.complete()))}(n):Yc}function fn(...n){let e=n[n.length-1];return Ce(e)?(n.pop(),Ne(n,e)):On(n)}function Fg(n,e){return new I(e?t=>e.schedule(Jne,0,{error:n,subscriber:t}):t=>t.error(n))}function Jne({error:n,subscriber:e}){e.error(n)}class pa{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 fn(this.value);case"E":return Fg(this.error);case"C":return lS()}throw new Error("unexpected notification kind value")}static createNext(e){return void 0!==e?new pa("N",e):pa.undefinedValueNotification}static createError(e){return new pa("E",void 0,e)}static createComplete(){return pa.completeNotification}}pa.completeNotification=new pa("C"),pa.undefinedValueNotification=new pa("N",void 0);class cS 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(cS.dispatch,this.delay,new tie(e,this.destination)))}_next(e){this.scheduleMessage(pa.createNext(e))}_error(e){this.scheduleMessage(pa.createError(e)),this.unsubscribe()}_complete(){this.scheduleMessage(pa.createComplete()),this.unsubscribe()}}class tie{constructor(e,t){this.notification=e,this.destination=t}}class kg extends se{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 nie(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 $;if(this.isStopped||this.hasError?o=x.EMPTY:(this.observers.push(e),o=new Z(this,e)),r&&e.add(e=new cS(e,r)),t)for(let a=0;at&&(o=Math.max(o,s-t)),o>0&&r.splice(0,o),r}}class nie{constructor(e,t){this.time=e,this.value=t}}function Ir(n,e){return"function"==typeof e?t=>t.pipe(Ir((i,r)=>je(n(i,r)).pipe(me((s,o)=>e(i,s,r,o))))):t=>t.lift(new iie(n))}class iie{constructor(e){this.project=e}call(e,t){return t.subscribe(new rie(e,this.project))}}class rie extends ve{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 _t(this),r=this.destination;r.add(i),this.innerSubscription=N(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 uS={schedule(n,e){const t=setTimeout(n,e);return()=>clearTimeout(t)},scheduleBeforeRender(n){if("undefined"==typeof window)return uS.schedule(n,0);if(void 0===window.requestAnimationFrame)return uS.schedule(n,16);const e=window.requestAnimationFrame(n);return()=>window.cancelAnimationFrame(e)}};let YD;function pie(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(!YD){const t=Element.prototype;YD=t.matches||t.matchesSelector||t.mozMatchesSelector||t.msMatchesSelector||t.oMatchesSelector||t.webkitMatchesSelector}return n.nodeType===Node.ELEMENT_NODE&&YD.call(n,e)}(n,r)||(i=s,0))),i}class mie{constructor(e,t){this.componentFactory=t.get(wl).resolveComponentFactory(e)}create(e){return new _ie(this.componentFactory,e)}}class _ie{constructor(e,t){this.componentFactory=e,this.injector=t,this.eventEmitters=new kg(1),this.events=this.eventEmitters.pipe(Ir(i=>kn(...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(gn),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=uS.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=Wn.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=uS.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 o_(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 yie extends HTMLElement{constructor(){super(...arguments),this.ngElementEventsSubscription=null}}const vie={initialConfig:{},parse:{},rename:{}};class wie{constructor(e,t){this.configState=e,this.storedChanges={},this.options=Object.assign(Object.assign({},vie),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,u=null!==(s=o[e])&&void 0!==s?s:o[l];if(null==c)delete i[l];else if(u)try{i[l]=u(c)}catch(h){console.warn(`Failed to parse ${e} = ${c}`,h.message)}else i[l]=c}}let Eie=(()=>{class n{constructor(t,i,r={}){this.configState=t,this.cdr=i,this.options=r,this.initialized=!1,this.configManager=new wie(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=Rt({type:n,features:[Ui]}),n})();var KD;const m0={production:!0,disableDbWorker:!0,acceptableViewerDomains:["https://portal.hubmapconsortium.org","https://portal.test.hubmapconsortium.org"],dbOptions:{ccfOwlUrl:"https://ccf-api.hubmapconsortium.org/v1/ccf.owl.n3store.json",ccfContextUrl:"https://hubmapconsortium.github.io/ccf-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/v3/entities/search",hubmapAssetsUrl:"https://assets.hubmapconsortium.org",hubmapToken:null!==(KD=localStorage.getItem("HUBMAP_TOKEN"))&&void 0!==KD?KD:""},googleAnalyticsToken:"portal.hubmapconsortium.org"===window.location.hostname?"G-1WRJHN9FM6":"G-J9HWV9QPJ4"};function rr(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 Aj(n,e){return function(t,i){e(t,i,n)}}function dc(n,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(n,e)}function Fi(n,e,t,i){return new(t||(t=Promise))(function(s,o){function a(u){try{c(i.next(u))}catch(h){o(h)}}function l(u){try{c(i.throw(u))}catch(h){o(h)}}function c(u){u.done?s(u.value):function(s){return s instanceof t?s:new t(function(o){o(s)})}(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})}function Dj(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 QD(){return!("object"==typeof process&&"[object process]"===String(process)&&!process.browser)||Dj()}const Ij="undefined"!=typeof __VERSION__?__VERSION__:"untranspiled source",hS=QD();class Aie{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 ZD(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 Oj={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 Rj(n){return"string"==typeof n?Oj[n.toUpperCase()]||Oj.WHITE:n}function fS(n,e){if(!n)throw new Error(e||"Assertion failed")}const hc={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},_0=hc.window||hc.self||hc.global,Nj=hc.process||{};function Lg(){let n;if(hS&&_0.performance)n=_0.performance.now();else if(Nj.hrtime){const e=Nj.hrtime();n=1e3*e[0]+e[1]/1e6}else n=Date.now();return n}console;const Bg={debug:hS&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},Nie={enabled:!0,level:0};function Tl(){}const Pj={},Fj={once:!0};function Pie(n){for(const e in n)for(const t in n[e])return t||"untitled";return"empty"}let JD=(()=>{class n{constructor({id:t}={id:""}){this.id=t,this.VERSION=Ij,this._startTs=Lg(),this._deltaTs=Lg(),this.LOG_THROTTLE_TIMEOUT=0,this._storage=new Aie("__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((Lg()-this._startTs).toPrecision(10))}getDelta(){return Number((Lg()-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){fS(t,i)}warn(t){return this._getLogFunction(0,t,Bg.warn,arguments,Fj)}error(t){return this._getLogFunction(0,t,Bg.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,Bg.log,arguments,{time:!0,once:!0})}log(t,i){return this._getLogFunction(t,i,Bg.debug,arguments)}info(t,i){return this._getLogFunction(t,i,console.info,arguments)}once(t,i){return this._getLogFunction(t,i,Bg.debug||Bg.info,arguments,Fj)}table(t,i,r){return i?this._getLogFunction(t,i,console.table||Tl,r&&[r],{tag:Pie(i)}):Tl}image({logLevel:t,priority:i,image:r,message:s="",scale:o=1}){return this._shouldLog(t||i)?hS?function({image:n,message:e="",scale:t=1}){if("string"==typeof n){const r=new Image;return r.onload=()=>{const s=ZD(r,e,t);console.log(...s)},r.src=n,Tl}const i=n.nodeName||"";if("img"===i.toLowerCase())return console.log(...ZD(n,e,t)),Tl;if("canvas"===i.toLowerCase()){const r=new Image;return r.onload=()=>console.log(...ZD(r,e,t)),r.src=n.toDataURL(),Tl}return Tl}({image:r,message:s,scale:o}):function({image:n,message:e="",scale:t=1}){let i=null;try{i=Je(307)}catch(r){}return i?()=>i(n,{fit:"box",width:"".concat(Math.round(80*t),"%")}).then(r=>console.log(r)):Tl}({image:r,message:s,scale:o}):Tl}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||Tl)}group(t,i,r={collapsed:!1}){r=Lj({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||Tl)}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()>=kj(t)}_getLogFunction(t,i,r,s=[],o){if(this._shouldLog(t)){o=Lj({logLevel:t,message:i,args:s,opts:o}),fS(r=r||o.method),o.total=this.getTotal(),o.delta=this.getDelta(),this._deltaTs=Lg();const a=o.tag||o.message;if(o.once){if(Pj[a])return Tl;Pj[a]=Lg()}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!hS&&"string"==typeof n&&(e&&(e=Rj(e),n="\x1b[".concat(e,"m").concat(n,"\x1b[39m")),t&&(e=Rj(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 Tl}}return n.VERSION=Ij,n})();function kj(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 fS(Number.isFinite(e)&&e>=0),e}function Lj(n){const{logLevel:e,message:t}=n;n.logLevel=kj(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 fS("string"===r||"object"===r),Object.assign(n,n.opts)}const Ri=new JD({id:"deck"}),ji={DEFAULT:-1,LNGLAT:1,METER_OFFSETS:2,LNGLAT_OFFSETS:3,CARTESIAN:0};Object.defineProperty(ji,"IDENTITY",{get:()=>Ri.deprecated("COORDINATE_SYSTEM.IDENTITY","COORDINATE_SYSTEM.CARTESIAN")()||0});const Kc={WEB_MERCATOR:1,GLOBE:2,WEB_MERCATOR_AUTO_OFFSET:4,IDENTITY:0},Bj={click:{handler:"onClick"},panstart:{handler:"onDragStart"},panmove:{handler:"onDrag"},panend:{handler:"onDragEnd"}},mn=new JD({id:"luma.gl"});function $o(n,e){if(!n)throw new Error(e||"luma.gl: assertion failed.")}function pS(n){return"undefined"!=typeof WebGLRenderingContext&&n instanceof WebGLRenderingContext||"undefined"!=typeof WebGL2RenderingContext&&n instanceof WebGL2RenderingContext||Boolean(n&&Number.isFinite(n._version))}function Si(n){return"undefined"!=typeof WebGL2RenderingContext&&n instanceof WebGL2RenderingContext||Boolean(n&&2===n._version)}function gS(n){return $o(pS(n),"Invalid WebGLRenderingContext"),n}function Co(n){return $o(Si(n),"Requires WebGL2"),n}const y0={};const b0=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{globalThis.console&&globalThis.console.log&&globalThis.console.log("OESVertexArrayObject emulation library context restored"),t.reset_()},!0),this.reset_()};Df.prototype.VERTEX_ARRAY_BINDING_OES=34229,Df.prototype.reset_=function(){if(void 0!==this.vertexArrayObjects)for(let i=0;iSi(n)?void 0:0,tre={3074:n=>Si(n)?void 0:36064,35723:n=>Si(n)?void 0:4352,35977:br,32937:br,36795:(n,e)=>{const t=Si(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(Uj);return e(t&&t.UNMASKED_VENDOR_WEBGL||7936)},37446:(n,e)=>{const t=n.getExtension(Uj);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:br,35071:br,37447:br,36063:(n,e)=>{if(!Si(n)){const t=n.getExtension(Vj);return t?e(t.MAX_COLOR_ATTACHMENTS_WEBGL):0}},35379:br,35374:br,35377:br,34852:n=>{if(!Si(n)){const e=n.getExtension(Vj);return e?e.MAX_DRAW_BUFFERS_WEBGL:0}},36203:n=>n.getExtension(jj)?2147483647:65535,33001:n=>n.getExtension(jj)?16777216:65535,33e3:n=>16777216,37157:br,35373:br,35657:br,36183:br,37137:br,34045:br,35978:br,35979:br,35968:br,35376:br,35375:br,35659:br,37154:br,35371:br,35658:br,35076:br,35077:br,35380:br},zj="ANGLE_instanced_arrays",Hj={OES_vertex_array_object:{meta:{suffix:"OES"},createVertexArray:()=>{$o(!1,"VertexArray requires WebGL2 or OES_vertex_array_object extension")},deleteVertexArray:()=>{},bindVertexArray:()=>{},isVertexArray:()=>!1},[zj]:{meta:{suffix:"ANGLE"},vertexAttribDivisor(n,e){$o(0===e,"WebGL instanced rendering not supported")},drawElementsInstanced:()=>{},drawArraysInstanced:()=>{}},WEBGL_draw_buffers:{meta:{suffix:"WEBGL"},drawBuffers:()=>{$o(!1)}},EXT_disjoint_timer_query:{meta:{suffix:"EXT"},createQuery:()=>{$o(!1)},deleteQuery:()=>{$o(!1)},beginQuery:()=>{$o(!1)},endQuery:()=>{},getQuery(n,e){return this.getQueryObject(n,e)},getQueryParameter(n,e){return this.getQueryObject(n,e)},getQueryObject:()=>{}}},eI={readBuffer:(n,e,t)=>{Si(n)&&e(t)},getVertexAttrib:(n,e,t,i)=>{const{webgl2:r,ext:s}=function(n,e){return{webgl2:Si(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(!Si(n))switch(i){case 35967:return 35981;case 35971:case 35382:return 0}return e(t,i)},getInternalformatParameter:(n,e,t,i,r)=>{if(!Si(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=tre[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 fre(n,{extension:e,target:t,target2:i}){const r=Hj[e];$o(r);const{meta:s={}}=r,{suffix:o=""}=s,a=n.getExtension(e);for(const l of Object.keys(r)){const c=`${l}${o}`;let u=null;"meta"===l||"function"==typeof n[l]||(a&&"function"==typeof a[c]?u=(...h)=>a[c](...h):"function"==typeof r[l]&&(u=r[l].bind(t))),u&&(t[l]=u,i[l]=u)}}globalThis.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 Df(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&&fre(n,{extension:t,target:n.luma,target2:n})}(n,Hj),function(n,{target:e,target2:t}){Object.keys(eI).forEach(i=>{if("function"==typeof eI[i]){const r=n[i]?n[i].bind(n):()=>{},s=eI[i].bind(null,n,r);e[i]=s,t[i]=s}})}(n,{target:e,target2:n}),e.polyfilled=!0),n};const tI={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},oh=(n,e,t)=>e?n.enable(t):n.disable(t),Gj=(n,e,t)=>n.hint(t,e),ja=(n,e,t)=>n.pixelStorei(t,e);function v0(n){return Array.isArray(n)||ArrayBuffer.isView(n)}const mre={3042:oh,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:oh,2885:(n,e)=>n.cullFace(e),2929:oh,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:oh,35723:Gj,36006:(n,e)=>{const t=Si(n)?36009:36160;return n.bindFramebuffer(t,e)},2886:(n,e)=>n.frontFace(e),33170:Gj,2849:(n,e)=>n.lineWidth(e),32823:oh,32824:"polygonOffset",10752:"polygonOffset",35977:oh,32938:"sampleCoverage",32939:"sampleCoverage",3089:oh,3088:(n,e)=>n.scissor(...e),2960:oh,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:ja,3317:ja,37440:ja,37441:ja,37443:ja,3330:ja,3332:ja,3331:ja,36010:(n,e)=>n.bindFramebuffer(36008,e),3314:ja,32878:ja,3316:ja,3315:ja,32877:ja,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=v0(e)?e:[e,e],n.blendEquationSeparate(...e)},blendFunc:(n,e)=>{e=v0(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=v0(e)?e:[e,e];const[t,i]=e;n.stencilMaskSeparate(1028,t),n.stencilMaskSeparate(1029,i)},stencilFunc:(n,e)=>{e=v0(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=v0(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 os(n,e,t){return void 0!==e[n]?e[n]:t[n]}const _re={blendEquation:(n,e,t)=>n.blendEquationSeparate(os(32777,e,t),os(34877,e,t)),blendFunc:(n,e,t)=>n.blendFuncSeparate(os(32969,e,t),os(32968,e,t),os(32971,e,t),os(32970,e,t)),polygonOffset:(n,e,t)=>n.polygonOffset(os(32824,e,t),os(10752,e,t)),sampleCoverage:(n,e,t)=>n.sampleCoverage(os(32938,e,t),os(32939,e,t)),stencilFuncFront:(n,e,t)=>n.stencilFuncSeparate(1028,os(2962,e,t),os(2967,e,t),os(2963,e,t)),stencilFuncBack:(n,e,t)=>n.stencilFuncSeparate(1029,os(34816,e,t),os(36003,e,t),os(36004,e,t)),stencilOpFront:(n,e,t)=>n.stencilOpSeparate(1028,os(2964,e,t),os(2965,e,t),os(2966,e,t)),stencilOpBack:(n,e,t)=>n.stencilOpSeparate(1029,os(34817,e,t),os(34818,e,t),os(34819,e,t))},$j={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]})},Xc=(n,e)=>n.isEnabled(e),Wj={3042:Xc,2884:Xc,2929:Xc,3024:Xc,32823:Xc,32926:Xc,32928:Xc,3089:Xc,2960:Xc,35977:Xc};function qj(n){for(const e in n)return!1;return!0}function yre(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||tI)){const r=e,s=Wj[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=Wj[r];i[r]=s?s(n,Number(r)):n.getParameter(Number(r))}return i}(e):Object.assign({},tI),this.log=i,this._updateCache=this._updateCache.bind(this),Object.seal(this)}push(e={}){this.stateStack.push({})}pop(){$o(this.stateStack.length>0),$u(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){$o(void 0!==s);const o=e[s],a=this.cache[s];yre(o,a)||(t=!0,i=a,r&&!(s in r)&&(r[s]=a),this.cache[s]=o)}return{valueChanged:t,oldValue:i}}}function Kj(n,e={}){const{enable:t=!0,copyState:i}=e;if($o(void 0!==i),!n.state){const{polyfillContext:r}=globalThis;r&&r(n),n.state=new wre(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 s in $j)bre(n,s,$j[s]);Yj(n,"getParameter"),Yj(n,"isEnabled")}return n.state.enable=t,n}function Xj(n){$o(n.state),n.state.pop()}function $u(n,e){if($o(pS(n),"setParameters requires a WebGL context"),qj(e))return;const t={};for(const r in e){const s=Number(r),o=mre[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)_re[r](n,e,i)}function fc(n,e,t){if(qj(e))return t(n);const{nocatch:i=!0}=e;let r;if(function(n){n.state||Kj(n,{copyState:!1}),n.state.push()}(n),$u(n,e),i)r=t(n),Xj(n);else try{r=t(n)}finally{Xj(n)}return r}function mS(){return!("object"==typeof process&&"[object process]"===String(process)&&!process.browser)||function(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;return!!(e&&e.indexOf("Electron")>=0)}()}function jg(n){const{luma:e}=n;if(n.canvas&&e){const{clientWidth:t}=e.canvasSizeInfo;return t?n.drawingBufferWidth/t:1}return 1}function nI(n,e,t=!0){return function(n,e,t,i,r){const s=Qj(n[0],e,t);let o=Zj(n[1],e,i,r),a=Qj(n[0]+1,e,t);const l=a===t-1?a:a-1;let c;return a=Zj(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,jg(n),n.drawingBufferWidth,n.drawingBufferHeight,t)}function Qj(n,e,t){return Math.min(Math.round(n*e),t-1)}function Zj(n,e,t,i){return i?Math.max(0,t-1-Math.round(n*e)):Math.min(Math.round(n*e),t-1)}const iI=mS(),Mre=iI&&"undefined"!=typeof document,Jj={webgl2:!0,webgl1:!0,throwOnError:!0,manageState:!0,canvas:null,debug:!1,width:800,height:600};function eV(n={}){$o(iI,"createGLContext only available in the browser.\nCreate your own headless context or use 'createHeadlessContext' from @luma.gl/test-utils"),n=Object.assign({},Jj,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?(Mre&&"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=rI(r,n),function(n){const e=Si(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);mn.info(1,`${e}${n.debug?" debug":""} context ${t?`(${t.vendor},${t.renderer})`:""}`)()}(r),r):null}function rI(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({},Jj,e);const{manageState:t,debug:i}=e;return t&&Kj(n,{copyState:!1,log:(...r)=>mn.log(1,...r)()}),iI&&i&&(globalThis.makeDebugContext?(n=globalThis.makeDebugContext(n,e),mn.level=Math.max(mn.level,1)):mn.warn('WebGL debug mode not activated. import "@luma.gl/debug" to enable.')()),n._instrumented=!0,n}function tV(){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 nV{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=tV(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(tV()-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 sI{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 nV?e:new nV(t,i)),this.stats[t]}}const w0="8.5.12",If=new class{constructor(){this.stats=new Map}get(e){return this.stats.has(e)||this.stats.set(e,new sI({id:e})),this.stats.get(e)}};if(globalThis.luma&&globalThis.luma.VERSION!==w0)throw new Error(`luma.gl - multiple VERSIONs detected: ${globalThis.luma.VERSION} vs ${w0}`);function tn(n,e){if(!n)throw new Error(e||"luma.gl: assertion failed.")}function oI(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 ah(n,e){e=Number(e);for(const t in n)if(n[t]===e)return`GL.${t}`;return String(e)}globalThis.luma||(mS()&&mn.log(1,`luma.gl ${w0} - set luma.log.level=1 (or higher) to trace rendering`)(),globalThis.luma=globalThis.luma||{VERSION:w0,version:w0,log:mn,stats:If,globals:{modules:{},nodeIO:{}}}),globalThis;const aI={};function ga(n="id"){return aI[n]=aI[n]||1,`${n}-${aI[n]++}`}function iV(n){return tn("number"==typeof n,"Input must be a number"),n&&0==(n&n-1)}function Vg(n){let e=!0;for(const t in n){e=!1;break}return e}function rV(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 mn.removed(`Calling removed method ${e}.${o}: `,r)(),new Error(o)})})}const Ug="Resource subclass must define virtual methods";class Wu{get[Symbol.toStringTag](){return"Resource"}constructor(e,t={}){gS(e);const{id:i,userData:r={}}=t;this.gl=e,this.gl2=e,this.id=i||ga(this[Symbol.toStringTag]),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[Symbol.toStringTag]||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=oI(this.gl,e));const r=(this.constructor.PARAMETERS||{})[e];if(r){const s=Si(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=Si(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 h=i?ah(this.gl,l):l;o[h]=this.getParameter(l,e),i&&"GLenum"===c.type&&(o[h]=ah(this.gl,o[h]))}}return o}setParameter(e,t){tn(e=oI(this.gl,e));const r=(this.constructor.PARAMETERS||{})[e];if(r){const s=Si(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=oI(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 rV(this,e,t,i)}initialize(e){}_createHandle(){throw new Error(Ug)}_deleteHandle(){throw new Error(Ug)}_bindHandle(e){throw new Error(Ug)}_getOptsFromHandle(){throw new Error(Ug)}_getParameter(e,t){throw new Error(Ug)}_setParameter(e,t){throw new Error(Ug)}_context(){return this.gl.luma=this.gl.luma||{},this.gl.luma}_addStats(){const e=this[Symbol.toStringTag],t=If.get("Resource Counts");t.get("Resources Created").incrementCount(),t.get(`${e}s Created`).incrementCount(),t.get(`${e}s Active`).incrementCount()}_removeStats(){const e=this[Symbol.toStringTag];If.get("Resource Counts").get(`${e}s Active`).decrementCount()}_trackAllocatedMemory(e,t=this[Symbol.toStringTag]){const i=If.get("Memory Usage");i.get("GPU Memory").addCount(e),i.get(`${t} Memory`).addCount(e),this.byteLength=e}_trackDeallocatedMemory(e=this[Symbol.toStringTag]){const t=If.get("Memory Usage");t.get("GPU Memory").subtractCount(this.byteLength),t.get(`${e} Memory`).subtractCount(this.byteLength),this.byteLength=0}}function lI(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 E0(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 Vre({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 ma.getBytesPerElement(this)}get BYTES_PER_VERTEX(){return ma.getBytesPerVertex(this)}_assign(e={}){return void 0!==(e=cI("Accessor",e,zre)).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 oV={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:oV},Gre={removedProps:oV};class hr extends Wu{get[Symbol.toStringTag](){return"Buffer"}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/ma.getBytesPerElement(e))}getVertexCount(e=this.accessor){return Math.round(this.byteLength/ma.getBytesPerVertex(e))}initialize(e={}){return ArrayBuffer.isView(e)&&(e={data:e}),Number.isFinite(e)&&(e={byteLength:e}),e=cI("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=cI("Buffer",e,Gre))&&this.setAccessor(e.accessor),this}setAccessor(e){return delete(e=Object.assign({},e)).buffer,this.accessor=new ma(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?(Co(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 Co(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}={}){Co(this.gl);const s=E0(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 u=Math.min(o,l);return tn((r=r||u)<=u),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=lI(e);return tn(s),this.setAccessor(new ma(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/E0(this.accessor.type||5126,{clamped:!1}).BYTES_PER_ELEMENT;return this.getElementCount()-i}_inferType(e){this.accessor.type||this.setAccessor(new ma(this.accessor,{type:lI(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 mn.deprecated("Buffer.type","Buffer.accessor.type")(),this.accessor.type}get bytes(){return mn.deprecated("Buffer.bytes","Buffer.byteLength")(),this.byteLength}setByteLength(e){return mn.deprecated("setByteLength","reallocate")(),this.reallocate(e)}updateAccessor(e){return mn.deprecated("updateAccessor(...)","setAccessor(new Accessor(buffer.accessor, ...)")(),this.accessor=new ma(this.accessor,e),this}}const uI={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}},aV={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},lV={5126:4,5125:4,5124:4,5123:2,5122:2,5131:2,5120:1,5121:1},qre=[9729,9728],cV=globalThis.WebGLBuffer||function(){};class Of extends Wu{get[Symbol.toStringTag](){return"Texture"}static isSupported(e,t={}){const{format:i,linearFiltering:r}=t;let s=!0;return i&&(s=s&&function(n,e){const t=uI[e];if(!t)return!1;if(void 0===t.gl1&&void 0===t.gl2)return!0;const i=Si(n)&&t.gl2||t.gl1;return"string"==typeof i?n.getExtension(i):i}(e,i),s=s&&(!r||function(n,e){const t=uI[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=ga("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(U=>this.initialize(Object.assign({},e,{pixels:U,data:U}))),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:u}=e;t||(t=r);let{width:h,height:p,dataFormat:g,type:m,compressed:w=!1,mipmaps:C=!0}=e;const{depth:H=0}=e;return({width:h,height:p,compressed:w,dataFormat:g,type:m}=this._deduceParameters({format:s,type:m,dataFormat:g,compressed:w,data:t,width:h,height:p})),this.width=h,this.height=p,this.depth=H,this.format=s,this.type=m,this.dataFormat=g,this.border=o,this.textureUnit=u,Number.isFinite(this.textureUnit)&&(this.gl.activeTexture(33984+this.textureUnit),this.gl.bindTexture(this.target,this.handle)),C&&this._isNPOT()&&(mn.warn(`texture: ${this} is Non-Power-Of-Two, disabling mipmaping`)(),C=!1,this._updateForNPOT(l)),this.mipmaps=C,this.setImageData({data:t,width:h,height:p,depth:H,format:s,type:m,dataFormat:g,border:o,mipmaps:C,parameters:c,compressed:w}),C&&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:u=this.type,width:h=this.width,height:p=this.height,dataFormat:g=this.dataFormat,compressed:m=!1}=e;c||(c=i),({type:u,dataFormat:g,compressed:m,width:h,height:p}=this._deduceParameters({format:s,type:u,dataFormat:g,compressed:m,data:c,width:h,height:p}));const{gl:w}=this;w.bindTexture(this.target,this.handle);let C=null;({data:c,dataType:C}=this._getDataType({data:c,compressed:m}));let H,U=0;return fc(this.gl,l,()=>{switch(C){case"null":w.texImage2D(t,r,s,h,p,o,g,u,c);break;case"typed-array":w.texImage2D(t,r,s,h,p,o,g,u,c,a);break;case"buffer":H=Co(w),H.bindBuffer(35052,c.handle||c),H.texImage2D(t,r,s,h,p,o,g,u,a),H.bindBuffer(35052,null);break;case"browser-object":Si(w)?w.texImage2D(t,r,s,h,p,o,g,u,c):w.texImage2D(t,r,s,g,u,c);break;case"compressed":for(const[de,Ae]of c.entries())w.compressedTexImage2D(t,de,Ae.format,Ae.width,Ae.height,o,Ae.data),U+=Ae.levelSize;break;default:tn(!1,"Unknown image data type")}}),this._trackAllocatedMemory("compressed"===C?U:c&&c.byteLength?c.byteLength:this.width*this.height*(aV[this.dataFormat]||4)*(lV[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:u=this.type,dataFormat:h=this.dataFormat,compressed:p=!1,offset:g=0,border:m=this.border,parameters:w={}}){if(({type:u,dataFormat:h,compressed:p,width:o,height:a}=this._deduceParameters({format:c,type:u,dataFormat:h,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 C=i;i=C.data,o=C.shape[0],a=C.shape[1]}i instanceof hr&&(i=i.handle),this.gl.bindTexture(this.target,this.handle),fc(this.gl,w,()=>{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,h,u,null);else if(ArrayBuffer.isView(i))this.gl.texSubImage2D(e,l,r,s,o,a,h,u,i,g);else if(i instanceof cV){const C=Co(this.gl);C.bindBuffer(35052,i),C.texSubImage2D(e,l,r,s,o,a,h,u,g),C.bindBuffer(35052,null)}else Si(this.gl)?Co(this.gl).texSubImage2D(e,l,r,s,o,a,h,u,i):this.gl.texSubImage2D(e,l,r,s,h,u,i)}),this.gl.bindTexture(this.target,null)}copyFramebuffer(e={}){return mn.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 hr?{data:e.handle,dataType:"buffer"}:e instanceof cV?{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=uI[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!(Si(this.gl)||!this.width||!this.height||iV(this.width)&&iV(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===qre.indexOf(t)&&(t=9729);break;case 10242:case 10243:33071!==t&&(t=33071)}return t}}function Yre(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 _a extends Of{get[Symbol.toStringTag](){return"Texture2D"}static isSupported(e,t){return Of.isSupported(e,t)}constructor(e,t={}){gS(e),(t instanceof Promise||"string"==typeof t)&&(t={data:t}),"string"==typeof t.data&&(t=Object.assign({},t,{data:Yre(t.data)})),super(e,Object.assign({},t,{target:3553})),this.initialize(t),Object.seal(this)}}const Rf="EXT_color_buffer_float",uV={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:Rf,bpp:2},33327:{gl2:Rf,bpp:4},34842:{gl2:Rf,bpp:8},33326:{gl2:Rf,bpp:4},33328:{gl2:Rf,bpp:8},34836:{gl2:Rf,bpp:16},35898:{gl2:Rf,bpp:4}};class zg extends Wu{get[Symbol.toStringTag](){return"Renderbuffer"}static isSupported(e,{format:t}={format:null}){return!t||function(n,e,t){const i=t[e];if(!i)return!1;const r=Si(n)&&i.gl2||i.gl1;return"string"==typeof r?n.getExtension(r):r}(e,t,uV)}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&&Si(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)*uV[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 gV="clear: bad arguments";function hI(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,gV),fc(n,s,()=>{n.clear(o)})}function mV(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 oi(n){return function(){var e=this,t=arguments;return new Promise(function(i,r){var s=n.apply(e,t);function o(l){mV(s,i,r,o,a,"next",l)}function a(l){mV(s,i,r,o,a,"throw",l)}o(void 0)})}}const fI=[34069,34070,34071,34072,34073,34074];let tse=(()=>{class n extends Of{get[Symbol.toStringTag](){return"TextureCube"}constructor(t,i={}){gS(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 oi(function*(){const{gl:u}=c,h=r||s,p=yield Promise.all(fI.map(g=>{const m=h[g];return Promise.all(Array.isArray(m)?m:[m])}));c.bind(),fI.forEach((g,m)=>{p[m].length>1&&!1!==c.opts.mipmaps&&mn.warn(`${c.id} has mipmap and multiple LODs.`)(),p[m].forEach((w,C)=>{t&&i?u.texImage2D(g,C,a,t,i,o,a,l,w):u.texImage2D(g,C,a,a,l,w)})}),c.unbind()})()}setImageDataForFace(t){const{face:i,width:r,height:s,pixels:o,data:a,border:l=0,format:c=6408,type:u=5121}=t,{gl:h}=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?h.texImage2D(i,0,c,r,s,l,c,u,p):h.texImage2D(i,0,c,c,u,p),this}}return n.FACES=fI,n})();class nse extends Of{get[Symbol.toStringTag](){return"Texture3D"}static isSupported(e){return Si(e)}constructor(e,t={}){Co(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:u,parameters:h={}}){return this._trackDeallocatedMemory("Texture"),this.gl.bindTexture(this.target,this.handle),fc(this.gl,h,()=>{ArrayBuffer.isView(u)&&this.gl.texImage3D(this.target,e,t,i,r,s,o,a,l,u),u instanceof hr&&(this.gl.bindBuffer(35052,u.handle),this.gl.texImage3D(this.target,e,t,i,r,s,o,a,l,c))}),this._trackAllocatedMemory(u&&u.byteLength?u.byteLength:this.width*this.height*this.depth*(aV[this.dataFormat]||4)*(lV[this.type]||1),"Texture"),this.loaded=!0,this}}function _V(n,e){tn(n instanceof _a||n instanceof tse||n instanceof nse);const t=n.constructor,{gl:i,width:r,height:s,format:o,type:a,dataFormat:l,border:c,mipmaps:u}=n;return new t(i,Object.assign({width:r,height:s,format:o,type:a,dataFormat:l,border:c,mipmaps:u},e))}function ise(n,e){const{gl:t,width:i,height:r,id:s}=n;return new Fs(t,Object.assign({},e,{id:`framebuffer-for-${s}`,width:i,height:r,attachments:{36064:n}}))}function _S(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:u,deleteFramebuffer:h}=S0(n);tn(u);const{gl:p,handle:g,attachments:m}=u;a=a||u.width,l=l||u.height,36064===s&&null===g&&(s=1028),tn(m[s]),c=c||m[s].type,o=function(n,e,t,i,r){if(n)return n;return new(E0(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||lI(o);const w=p.bindFramebuffer(36160,g);return p.readPixels(t,i,a,l,r,c,o),p.bindFramebuffer(36160,w||null),h&&u.delete(),o}function pI(n,{sourceAttachment:e=36064,targetMaxHeight:t=Number.MAX_SAFE_INTEGER}={}){let i=_S(n,{sourceAttachment:e}),{width:r,height:s}=n;for(;s>t;)({data:i,width:r,height:s}=Vre({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 u in i){const h=i[u];(Array.isArray(h)?h[0]:h).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&&mn.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 zg)this._attachRenderbuffer({attachment:a,renderbuffer:c});else if(Array.isArray(l)){const[u,h=0,p=0]=l;c=u,this._attachTexture({attachment:a,texture:u,layer:h,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(Fs.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)&&hI(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]}={}){Co(n),fc(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,gV)}})}(this.gl,{drawBuffer:l,value:a})}),this.gl.bindFramebuffer(36160,o||null),this}readPixels(e={}){return mn.error("Framebuffer.readPixels() is no logner supported, use readPixelsToArray(framebuffer)")(),null}readPixelsToBuffer(e={}){return mn.error("Framebuffer.readPixelsToBuffer()is no logner supported, use readPixelsToBuffer(framebuffer)")(),null}copyToDataUrl(e={}){return mn.error("Framebuffer.copyToDataUrl() is no logner supported, use copyToDataUrl(framebuffer)")(),null}copyToImage(e={}){return mn.error("Framebuffer.copyToImage() is no logner supported, use copyToImage(framebuffer)")(),null}copyToTexture(e={}){return mn.error("Framebuffer.copyToTexture({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null}blit(e={}){return mn.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=Co(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=ah(this.gl,r)),r}getAttachmentParameters(e=36064,t,i=this.constructor.ATTACHMENT_PARAMETERS||[]){const r={};for(const s of i)r[t?ah(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?ah(this.gl,s):s]=this.getAttachmentParameters(s,e)}return i}show(){return"undefined"!=typeof window&&window.open(pI(this),"luma-debug-texture"),this}log(e=0,t=""){if(e>mn.level||"undefined"==typeof window)return this;t=t||`Framebuffer ${this.id}`;const i=pI(this,{targetMaxHeight:100});return mn.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 _a(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 zg(this.gl,{id:`${this.id}-depth-stencil`,format:35056,width:r,height:111}),this.ownResources.push(o[33306])):t?(o=o||{},o[36096]=new zg(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 zg?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:Co(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 Si(n)?n:null}(this.gl);t?t.readBuffer(e):tn(36064===e||1029===e,yV),this.readBuffer=e}_setDrawBuffers(e){const{gl:t}=this,i=Co(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]),yV)}this.drawBuffers=e}_getAttachmentParameterFallback(e){const t=function(n){n.luma=n.luma||{},n.luma.caps=n.luma.caps||{};for(const e in bV)void 0===n.luma.caps[e]&&(n.luma.caps[e]=wV(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)}}Fs.ATTACHMENT_PARAMETERS=[36049,36048,33296,33298,33299,33300,33301,33302,33303];const bV={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 _a(n,{format:6408,type:5126,dataFormat:6408}),t=new Fs(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 gI(n,e){return vV(n,e)}function vV(n,e){return(e=Array.isArray(e)?e:[e]).every(t=>wV(n,t))}function wV(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=bV[e];let i;tn(t,e);const r=Si(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]||mn.log(2,`Feature: ${e} not supported`)(),n.luma.caps[e]}class mI{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()}},gse=1/Math.PI*180,mse=1/180*Math.PI,Or={};function yse(n,{precision:e=Or.precision||4}={}){return n=function(n){return Math.round(n/Or.EPSILON)*Or.EPSILON}(n),`${parseFloat(n.toPrecision(e))}`}function lh(n){return Array.isArray(n)||ArrayBuffer.isView(n)&&!(n instanceof DataView)}function qu(n,e,t){if(lh(n)){t=t||function(n){return n.clone?n.clone():new Array(n.length)}(n);for(let i=0;it*mse,void 0)}(n)}function vse(n){return function(n,e){return qu(n,t=>t*gse,void 0)}(n)}function Va(n,e,t){return qu(n,i=>Math.max(e,Math.min(t,i)))}function yS(n,e,t){return lh(n)?n.map((i,r)=>yS(i,e[r],t)):t*e+(1-t)*n}function C0(n,e,t){const i=Or.EPSILON;t&&(Or.EPSILON=t);try{if(n===e)return!0;if(lh(n)&&lh(e)){if(n.length!==e.length)return!1;for(let r=0;r0?", ":"")+yse(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&&(LV.length=n.length,i=LV):i=kV,(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 BV(n){return n&&n[Symbol.asyncIterator]}function EI(n,e=(()=>!0)){return Array.isArray(n)?jV(n,e,[]):e(n)?[n]:[]}function jV(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 VV(n,e){return n?(Number.isFinite(n)&&(n={duration:n}),n.type=n.type||"interpolation",ot(ot(ot({},qse[n.type]),e),n)):null}function UV(n,e){return e.getBuffer()?[e.getBuffer(),{divisor:0,size:e.size,normalized:e.settings.normalized}]:e.value}function zV(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 HV(n){n.push(n.shift())}function xI(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 GV({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,u=r&&c,h=xI(t,e),p=t.state.constant;if(!u&&i>=h)return;const g=p?t.value:t.getBuffer().getData({srcByteOffset:l});if(t.settings.normalized&&!p){const H=s;s=(U,de)=>t._normalizeConstant(H(U,de))}const m=p?(H,U)=>s(g,U):(H,U)=>s(g.subarray(H,H+a),U),w=n.getData({length:i}),C=new Float32Array(h);(function({source:n,target:e,size:t,getData:i,sourceStartIndices:r,targetStartIndices:s}){if(!Array.isArray(s))return SI({source:n,target:e,size:t,getData:i}),e;let o=0,a=0;const l=i&&((u,h)=>i(u+a,h)),c=Math.min(r.length,s.length);for(let u=1;u(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===SS||(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=SS}clearNeedsUpdate(){this.state.needsUpdate=!1,this.state.updateRanges=Gse}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!==SS}),!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,u]of s)o.call(r,this,{data:t,startRow:c,endRow:u,props:i,numInstances:e});if(this.value)if(this.constant||this.buffer.byteLength{if(!r){const C=h*a+l;for(let H=0;Hu?c.set(de,w):(e._normalizeValue(de,H.target,0),Hse({target:c,source:H.target,start:w,count:Ae}));w+=Ae*u}else e._normalizeValue(de,c,w),w+=u}}_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 AI={};function To(n){Ri.level>0&&AI[n]&&AI[n].call(...arguments)}function Ua(n,e){if(!n)throw new Error(e||"shadertools: assertion failed.")}const $V="out vec4 transform_output;\nvoid main() {\n transform_output = vec4(0);\n}",Xse=`#version 300 es\n${$V}`;function WV(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 qV(n={}){const{version:e=100,input:t,inputType:i,output:r}=n;if(!t)return 300===e?Xse:e>300?`#version ${e}\n${$V}`:"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 Ua(!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 YV extends Wu{get[Symbol.toStringTag](){return"TransformFeedback"}static isSupported(e){return Si(e)}constructor(e,t={}){Co(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,Vg(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,mn.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 hr?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 eoe{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 hr?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(Si(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 YV(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 hr)}return{sourceBuffers:t,feedbackBuffers:i}}_createNewBuffer(e,t){const i=new hr(this.gl,t);return this.resources[e]&&this.resources[e].delete(),this.resources[e]=i,i}_getNextIndex(){return(this.currentIndex+1)%2}}function KV(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 D0="vs",ioe={[D0]:"#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"},xS="__LUMA_INJECT_DECLARATIONS__",XV=/void\s+main\s*\([^)]*\)\s*\{\n?/,QV=/}\n?[^{}]*$/,MI=[];function ZV(n,e,t,i=!1){const r=e===D0;for(const s in t){const o=t[s];o.sort((l,c)=>l.order-c.order),MI.length=o.length;for(let l=0,c=o.length;ll+a));break;case"vs:#main-end":r&&(n=n.replace(QV,l=>a+l));break;case"fs:#decl":r||(n=n.replace(xS,a));break;case"fs:#main-start":r||(n=n.replace(XV,l=>l+a));break;case"fs:#main-end":r||(n=n.replace(QV,l=>a+l));break;default:n=n.replace(s,l=>l+a)}}return n=n.replace(xS,""),i&&(n=n.replace(/\}\s*$/,s=>s+ioe[e])),n}function DI(n){const e={};return Ua(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 roe={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},CS="transform_uSize_",JV="transform_position";const hoe={10241:9728,10240:9728,10242:33071,10243:33071};class poe{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 h in this.samplerTextureMap)a[h]=i[this.samplerTextureMap[h]];this._setSourceTextureParameters();const u=function({sourceTextureMap:n,targetTextureVarying:e,targetTexture:t}){const i={};let r,s;e&&(({width:r,height:s}=t),i[`${CS}${e}`]=[r,s]);for(const o in n)({width:r,height:s}=n[o]),i[`${CS}${o}`]=[r,s];return i}({sourceTextureMap:i,targetTextureVarying:this.targetTextureVarying,targetTexture:s});Object.assign(a,u)}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=_S(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 Ua(!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 hr(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 Fs(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(hoe)}_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=_V(e,{parameters:{10241:9728,10240:9728,10242:33071,10243:33071},pixelStore:{37440:!1}});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 u=l.split("\n"),h=u.slice();if(u.forEach((p,g,m)=>{if(s>0){const w=function(n,e){const t={},i=function(n){return WV(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=`${CS}${n}`;return{samplerName:e,sizeName:t,uniformDeclerations:` uniform sampler2D ${e};\n uniform vec2 ${t};`}}(s),h=` ${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 Ua(!1),null}}(r)};\n`;return t[a]=s,{updatedLine:o,inject:{"vs:#decl":c,"vs:#main-start":h},samplerTextureMap:t}}return null}(p,e);if(w){const{updatedLine:C,inject:H}=w;h[g]=C,c=DI([c,H]),Object.assign(a,w.samplerTextureMap),s--}}t&&!o&&(o=function(n,e){const t=WV(n,["varying","out"]);return t&&t.name===e?t.type:null}(p,t))}),t){tn(i);const p=`${CS}${t}`;c=DI([c,{"vs:#decl":`uniform vec2 ${p};\n`,"vs:#main-start":` vec2 ${JV} = transform_getPos(${p});\n gl_Position = vec4(${JV}, 0, 1.);\n`}])}l=h.join("\n")}return{vs:l,targetTextureType:o,inject:c,samplerTextureMap:a}}({vs:e.vs,sourceTextureMap:t,targetTextureVarying:this.targetTextureVarying,targetTexture:i}),c=DI([e.inject||{},a]);return this.targetTextureType=o,this.samplerTextureMap=l,{vs:r,fs:e._fs||qV({version:KV(r),input:this.targetTextureVarying,inputType:o,output:"transform_output"}),modules:this.hasSourceTextures||this.targetTextureVarying?[roe].concat(e.modules||[]):e.modules,uniforms:s,inject:c}}}const II={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 moe(n){let e=eU(n);return"object"===e?n?"type"in n?Object.assign({},n,II[n.type]):"value"in n?(e=eU(n.value),Object.assign({type:e},n,II[e])):{type:"object",value:n}:{type:"object",value:null}:Object.assign({type:e,value:n},II[e])}function eU(n){return Array.isArray(n)||ArrayBuffer.isView(n)?"array":typeof n}class OI{constructor({name:e,vs:t,fs:i,dependencies:r=[],uniforms:s,getUniforms:o,deprecations:a=[],defines:l={},inject:c={},vertexShader:u,fragmentShader:h}){Ua("string"==typeof e),this.name=e,this.vs=t||u,this.fs=i||h,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=moe(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:Ua(!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&&Ua(s.validate(e[r],s),`${this.name}: invalid ${r}`),t[r]=e[r]):t[r]=s.value}return t}}function voe(n){return function(n){const e={},t={};return RI({modules:n,level:0,moduleMap:e,moduleDepth:t}),Object.keys(t).sort((i,r)=>t[r]-t[i]).map(i=>e[i])}(nU(n))}function RI({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 OI||(Ua("string"!=typeof t,`Shader module use by name is deprecated. Import shader module '${t}' and use it directly.`),Ua(t.name,"shader module has no name"),(t=new OI(t)).dependencies=nU(t.dependencies)),t))}const NI={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]},Nf={};function Moe(n,e){return n.match(/NVIDIA/i)||e.match(/NVIDIA/i)?"NVIDIA":n.match(/INTEL/i)||e.match(/INTEL/i)?"INTEL":n.match(/AMD/i)||e.match(/AMD/i)||n.match(/ATI/i)||e.match(/ATI/i)?"AMD":"UNKNOWN GPU"}Object.keys(NI).forEach(n=>{Nf[n]=n});const PI={};function iU(n,e,t={}){const i=NI[e];if(Ua(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 PI)return PI[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),PI[e]=l,l}function AS(n,e){return(e=Array.isArray(e)?e:[e]).every(t=>function(n,e){const t=NI[e];Ua(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 Ua(!1===r||!0===r),r}(n,t))}function Gg(n){return new RegExp(`\\b${n}[ \\t]+(\\w+[ \\t]+\\w+(\\[\\w+\\])?;)`,"g")}const rU=[[/^(#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("]],Roe=[...rU,[Gg("attribute"),"in $1"],[Gg("varying"),"out $1"]],Noe=[...rU,[Gg("varying"),"in $1"]],sU=[[/^#version[ \t]+300[ \t]+es/,"#version 100"],[/\btexture(2D|2DProj|Cube)Lod\(/g,"texture$1LodEXT("],[/\btexture\(/g,"texture2D("],[/\btextureLod\(/g,"texture2DLodEXT("]],Poe=[...sU,[Gg("in"),"attribute $1"],[Gg("out"),"varying $1"]],Foe=[...sU,[Gg("in"),"varying $1"]],FI="gl_FragColor",kI=/\bout[ \t]+vec4[ \t]+(\w+)[ \t]*;\n?/,koe=/void\s+main\s*\([^)]*\)\s*\{\n?/;function TS(n,e){for(const[t,i]of e)n=n.replace(t,i);return n}const Voe=`\n\n${xS}\n\n`,oU={[D0]:"vertex",fs:"fragment"};function aU(n,{id:e,source:t,type:i,modules:r,defines:s={},hookFunctions:o=[],inject:a={},transpileToGLSL100:l=!1,prologue:c=!0,log:u}){Ua("string"==typeof t,"shader source must be a string");const h=i===D0,p=t.split("\n");let g=100,m="",w=t;0===p[0].indexOf("#version ")?(g=300,m=p[0],w=p.slice(1).join("\n")):m=`#version ${g}`;const C={};r.forEach(Be=>{Object.assign(C,Be.getDefines())}),Object.assign(C,s);let H=c?`${m}\n${function({id:n,source:e,type:t}){return n&&"string"==typeof n&&-1===e.indexOf("SHADER_NAME")?`\n#define SHADER_NAME ${n}_${oU[t]}\n\n`:""}({id:e,source:t,type:i})}\n${function({type:n}){return`\n#define SHADER_TYPE_${oU[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:Moe(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// 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"}}(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 AS(n,Nf.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"),AS(n,Nf.GLSL_DERIVATIVES)&&iU(n,Nf.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"),AS(n,Nf.GLSL_FRAG_DATA)&&iU(n,Nf.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"),AS(n,Nf.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}(C)}\n${h?"":"precision highp float;\n\n"}\n`:`${m}\n`;const U=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),de={},Ae={},Pe={};for(const Be in a){const et="string"==typeof a[Be]?{injection:a[Be],order:0}:a[Be],wt=Be.match(/^(v|f)s:(#)?([\w-]+)$/);if(wt){const Ct=wt[3];wt[2]?"decl"===Ct?Ae[Be]=[et]:Pe[Be]=[et]:de[Be]=[et]}else Pe[Be]=[et]}for(const Be of r){u&&Be.checkDeprecations(w,u),H+=Be.getModuleSource(i,g);const wt=Be.injections[i];for(const vt in wt){const Ct=vt.match(/^(v|f)s:#([\w-]+)$/);if(Ct){const $t="decl"===Ct[2]?Ae:Pe;$t[vt]=$t[vt]||[],$t[vt].push(wt[vt])}else de[vt]=de[vt]||[],de[vt].push(wt[vt])}}return H+=Voe,H=ZV(H,i,Ae),H+=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}(U[i],de),H+=w,H=ZV(H,i,Pe),H=function(n,e,t){switch(e){case 300:return t?TS(n,Roe):function(n){const e=(n=TS(n,Noe)).match(kI);if(e){const t=e[1];n=n.replace(new RegExp(`\\b${FI}\\b`,"g"),t)}else{const t="fragmentColor";n=n.replace(koe,i=>`out vec4 ${t};\n${i}`).replace(new RegExp(`\\b${FI}\\b`,"g"),t)}return n}(n);case 100:return t?TS(n,Poe):function(n){const e=(n=TS(n,Foe)).match(kI);if(e){const t=e[1];n=n.replace(kI,"").replace(new RegExp(`\\b${t}\\b`,"g"),FI)}return n}(n);default:throw new Error(`unknown GLSL version ${e}`)}}(H,l?100:g,h),H}function Hoe(n){return function(t){const i={};for(const r of n){const s=r.getUniforms(t,i);Object.assign(i,s)}return i}}const Koe={5126:Rr.bind(null,"uniform1fv",za,1,Mo),35664:Rr.bind(null,"uniform2fv",za,2,Mo),35665:Rr.bind(null,"uniform3fv",za,3,Mo),35666:Rr.bind(null,"uniform4fv",za,4,Mo),5124:Rr.bind(null,"uniform1iv",ch,1,Mo),35667:Rr.bind(null,"uniform2iv",ch,2,Mo),35668:Rr.bind(null,"uniform3iv",ch,3,Mo),35669:Rr.bind(null,"uniform4iv",ch,4,Mo),35670:Rr.bind(null,"uniform1iv",ch,1,Mo),35671:Rr.bind(null,"uniform2iv",ch,2,Mo),35672:Rr.bind(null,"uniform3iv",ch,3,Mo),35673:Rr.bind(null,"uniform4iv",ch,4,Mo),35674:Rr.bind(null,"uniformMatrix2fv",za,4,Ku),35675:Rr.bind(null,"uniformMatrix3fv",za,9,Ku),35676:Rr.bind(null,"uniformMatrix4fv",za,16,Ku),35678:ro,35680:ro,5125:Rr.bind(null,"uniform1uiv",MS,1,Mo),36294:Rr.bind(null,"uniform2uiv",MS,2,Mo),36295:Rr.bind(null,"uniform3uiv",MS,3,Mo),36296:Rr.bind(null,"uniform4uiv",MS,4,Mo),35685:Rr.bind(null,"uniformMatrix2x3fv",za,6,Ku),35686:Rr.bind(null,"uniformMatrix2x4fv",za,8,Ku),35687:Rr.bind(null,"uniformMatrix3x2fv",za,6,Ku),35688:Rr.bind(null,"uniformMatrix3x4fv",za,12,Ku),35689:Rr.bind(null,"uniformMatrix4x2fv",za,8,Ku),35690:Rr.bind(null,"uniformMatrix4x3fv",za,12,Ku),35678:ro,35680:ro,35679:ro,35682:ro,36289:ro,36292:ro,36293:ro,36298:ro,36299:ro,36300:ro,36303:ro,36306:ro,36307:ro,36308:ro,36311:ro},Xoe={},Qoe={},Zoe={},lU=[0];function LI(n,e,t,i){1===e&&"boolean"==typeof n&&(n=n?1:0),Number.isFinite(n)&&(lU[0]=n,n=lU);const r=n.length;if(r%e&&mn.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 Rr(n,e,t,i){let r=null,s=null;return(o,a,l)=>{const c=e(l,t),u=c.length;let h=!1;if(null===r)r=new Float32Array(u),s=u,h=!0;else{tn(s===u,"Uniform length cannot change.");for(let p=0;p{const a=String(o+e);return hU(a,r-a.length)+t+s})}(e);return{shaderName:l,errors:dU(s,c),warnings:dU(o,c)}}(i,this.source,this.shaderType,this.id);throw mn.error(`GLSL compilation errors in ${r}\n${s}`)(),mn.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 BI extends I0{get[Symbol.toStringTag](){return"VertexShader"}constructor(e,t){"string"==typeof t&&(t={source:t}),super(e,Object.assign({},t,{shaderType:35633}))}_createHandle(){return this.gl.createShader(35633)}}class jI extends I0{get[Symbol.toStringTag](){return"FragmentShader"}constructor(e,t){"string"==typeof t&&(t={source:t}),super(e,Object.assign({},t,{shaderType:35632}))}_createHandle(){return this.gl.createShader(35632)}}const ks=5126,O0=5124,R0=5125,VI={[ks]:[ks,1,"float"],35664:[ks,2,"vec2"],35665:[ks,3,"vec3"],35666:[ks,4,"vec4"],[O0]:[O0,1,"int"],35667:[O0,2,"ivec2"],35668:[O0,3,"ivec3"],35669:[O0,4,"ivec4"],[R0]:[R0,1,"uint"],36294:[R0,2,"uvec2"],36295:[R0,3,"uvec3"],36296:[R0,4,"uvec4"],35670:[ks,1,"bool"],35671:[ks,2,"bvec2"],35672:[ks,3,"bvec3"],35673:[ks,4,"bvec4"],35674:[ks,8,"mat2"],35685:[ks,8,"mat2x3"],35686:[ks,8,"mat2x4"],35675:[ks,12,"mat3"],35687:[ks,12,"mat3x2"],35688:[ks,12,"mat3x4"],35676:[ks,16,"mat4"],35689:[ks,16,"mat4x2"],35690:[ks,16,"mat4x3"]};function yU(n){const e=VI[n];if(!e)return null;const[t,i]=e;return{type:t,components:i}}function bU(n,e){switch(n){case 5120:case 5121:case 5122:case 5123:n=ks}for(const t in VI){const[i,r,s]=VI[t];if(i===n&&r===e)return{glType:t,name:s}}return null}class kae{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(!Si(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}=yU(i),a={type:s,size:r*o};this._inferProperties(e,t,a);const l={location:e,name:t,accessor:new ma(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}=yU(i),l={location:e,name:t,accessor:new ma({type:s,size:r*o})};this.varyingInfos.push(l),this.varyingInfosByName[l.name]=l}}const Lae=35981,Bae=["setVertexArray","setAttributes","setBuffers","unsetBuffers","use","getUniformCount","getUniformInfo","getUniformLocation","getUniformValue","getVarying","getFragDataLocation","getAttachedShaders","getAttributeCount","getAttributeLocation","getAttributeInfo"];class wU extends Wu{get[Symbol.toStringTag](){return"Program"}constructor(e,t={}){super(e,t),this.stubRemovedMethods("Program","v6.0",Bae),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=Lae}=e;return this.hash=t||"",this.vs="string"==typeof i?new BI(this.gl,{id:`${e.id}-vs`,source:i}):i,this.fs="string"==typeof r?new jI(this.gl,{id:`${e.id}-fs`,source:r}):r,tn(this.vs instanceof BI),tn(this.fs instanceof jI),this.uniforms={},this._textureUniforms={},s&&s.length>0&&(Co(this.gl),this.varyings=s,this.gl2.transformFeedbackVaryings(this.handle,s,o)),this._compileAndLink(),this._readUniformLocationsFromLinkedProgram(),this.configuration=new kae(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:u=c>0,vertexArray:h=null,transformFeedback:p,framebuffer:g,parameters:m={},uniforms:w,samplers:C}){if((w||C)&&(mn.deprecated("Program.draw({uniforms})","Program.setUniforms(uniforms)")(),this.setUniforms(w||{})),mn.priority>=e){const H=g?g.id:"default",U=`mode=${ah(this.gl,t)} verts=${i} instances=${c} indexType=${ah(this.gl,l)} isInstanced=${u} isIndexed=${a} Framebuffer=${H}`;mn.log(e,U)()}return tn(h),this.gl.useProgram(this.handle),!(!this._areTexturesRenderable()||0===i||u&&0===c||(h.bindForDraw(i,c,()=>{if(void 0!==g&&(m=Object.assign({},m,{framebuffer:g})),p){const H=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(H)}this._bindTextures(),fc(this.gl,m,()=>{a&&u?this.gl2.drawElementsInstanced(t,i,l,r,c):a&&Si(this.gl)&&!isNaN(s)&&!isNaN(o)?this.gl2.drawRangeElements(t,s,o,i,l,r):a?this.gl.drawElements(t,i,l,r):u?this.gl2.drawArraysInstanced(t,r,i,c):this.gl.drawArrays(t,r,i)}),p&&p.end()}),0))}setUniforms(e={}){mn.priority>=2&&function(n,e,t){for(const i in n){const r=n[i];if((!t||Boolean(t[i]))&&!tae(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 Fs&&(s=s.texture),s instanceof Of)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)&&nae(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 BI({handle:r});break;case 35632:i.fs=new jI({handle:r})}return i}_getParameter(e){return this.gl.getProgramParameter(this.handle,e)}_setId(e){if(!e){const t=this._getName();this.id=ga(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),mn.time(4,`linkProgram for ${this._getName()}`)(),e.linkProgram(this.handle),mn.timeEnd(4,`linkProgram for ${this._getName()}`)(),e.debug||mn.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),u=this._getHash(t),h=this._getHash(i),p=c.map(de=>this._getHash(de.name)).sort(),g=o.map(de=>this._getHash(de)),m=Object.keys(r).sort(),w=Object.keys(s).sort(),C=[],H=[];for(const de of m)C.push(this._getHash(de)),C.push(this._getHash(r[de]));for(const de of w)H.push(this._getHash(de)),H.push(this._getHash(s[de]));const U=`${u}/${h}D${C.join("/")}M${p.join("/")}I${H.join("/")}V${g.join("/")}H${this.stateHash}B${a}${l?"T":""}`;if(!this._programCache[U]){const de=function(n,e){const{vs:t,fs:i}=e,r=voe(e.modules||[]);return{gl:n,vs:aU(n,Object.assign({},e,{source:t,type:D0,modules:r})),fs:aU(n,Object.assign({},e,{source:i,type:"fs",modules:r})),getUniforms:Hoe(r)}}(this.gl,{vs:t,fs:i,modules:c,inject:s,defines:r,hookFunctions:this._hookFunctions,transpileToGLSL100:l});this._programCache[U]=new wU(this.gl,{hash:U,vs:de.vs,fs:de.fs,varyings:o,bufferMode:a}),this._getUniforms[U]=de.getUniforms||(Ae=>{}),this._useCounts[U]=0}return this._useCounts[U]++,this._programCache[U]}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":_0.chrome?"Chrome":_0.safari?"Safari":_0.mozInnerScreenX?"Firefox":"Unknown"}()}static getDefaultArray(e){return e.luma=e.luma||{},e.luma.defaultVertexArray||(e.luma.defaultVertexArray=new Ha(e,{handle:null,isDefaultArray:!0})),e.luma.defaultVertexArray}static getMaxAttributes(e){return Ha.MAX_ATTRIBUTES=Ha.MAX_ATTRIBUTES||e.getParameter(34921),Ha.MAX_ATTRIBUTES}static setConstant(e,t,i){switch(i.constructor){case Float32Array:Ha._setConstantFloatArray(e,t,i);break;case Int32Array:Ha._setConstantIntArray(e,t,i);break;case Uint32Array:Ha._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 Ha.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:u}=i,{gl:h,gl2:p}=this;return e=Number(e),this.bind(()=>{h.bindBuffer(34962,t.handle),c?(tn(Si(h)),p.vertexAttribIPointer(e,r,s,o,a)):h.vertexAttribPointer(e,r,s,l,o,a),h.enableVertexAttribArray(e),p.vertexAttribDivisor(e,u||0)}),this}enable(e,t=!0){return!t&&0===e&&!Ha.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 hr(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(!OS||OS.byteLength{switch(e){case 34373:return this.gl.getVertexAttribOffset(t,e);default:return this.gl.getVertexAttrib(t,e)}})}}const $ae=/^(.+)__LOCATION_([0-9]+)$/,Wae=["setBuffers","setGeneric","clearBindings","setLocations","setGenericValues","setDivisor","enable","disable"];class qae{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 Ha(e),rV(this,"VertexArray","v6.0",Wae),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 hr(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,mn.once(3,()=>`unused value ${e} in ${this.id}`)(),s;const l=this._getAttributeInfo(a||o);if(!l)return s;const u=ma.resolve(l.accessor,this.accessors[o]||{},i,r),{size:h,type:p}=u;return tn(Number.isFinite(h)&&Number.isFinite(p)),{location:o,accessor:u}}_getAttributeInfo(e){return this.configuration&&this.configuration.getAttributeInfo(e)}_getAttributeIndex(e){const t=Number(e);if(Number.isFinite(t))return{location:t};const i=$ae.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 hr)this.setBuffer(e,t);else if(Array.isArray(t)&&t.length&&t[0]instanceof hr)this.setBuffer(e,t[0],t[1]);else if(ArrayBuffer.isView(t)||Array.isArray(t))this.setConstant(e,t);else{if(!(t.buffer instanceof hr))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 hr){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 mn.deprecated("setElements","setElementBuffer")(),this.setElementBuffer(e,t)}}function P0(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+=P0(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 EU(n,e,t,i){const{gl:r}=n;if(!e)return{[i]:"null","Format ":"N/A"};let c,u,h,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 hr){const p=e,{data:g,changed:m}=p.getDebugData();let w;return u=m?"*":"",h=g,l=p.byteLength,a=l/g.BYTES_PER_ELEMENT/o,t?w=`${t.divisor>0?"I ":"P "} ${a} (x${o}=${l} bytes ${ah(r,s)})`:(c=!0,w=`${l} bytes`),{[i]:`${u}${P0(h,{size:o,isInteger:c})}`,"Format ":w}}return h=e,o=e.length,s=String(e.constructor.name).replace("Array",""),c=-1!==s.indexOf("nt"),{[i]:`${P0(h,{size:o,isInteger:c})} (constant)`,"Format ":`${o}x${s} (constant)`}}function Xae(n,e){const{type:t,size:i}=e,r=bU(t,i);return r?`${n} (${r.name})`:n}function SU({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)&&UI({table:a,header:n,uniforms:t,uniformName:p,undefinedOnly:i})&&c++;for(const p of l)p.match(s)&&UI({table:a,header:n,uniforms:t,uniformName:p,undefinedOnly:i})&&c++;for(const p of l)a[p]||UI({table:a,header:n,uniforms:t,uniformName:p,undefinedOnly:i})&&c++;let u=0;const h={};if(!i)for(const p in t){const g=t[p];a[p]||(u++,h[p]={Type:`NOT USED: ${g}`,[n]:P0(g)})}return{table:a,count:c,unusedTable:h,unusedCount:u}}function UI({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?P0(s):"N/A","Uniform Type":o?s:"NOT PROVIDED"},0))}function xU(n){const{type:e,size:t}=n.accessor,i=bU(e,t);return i?`${i.name} ${n.name}`:n.name}const Jae={POSITION:"positions",NORMAL:"normals",COLOR_0:"colors",TEXCOORD_0:"texCoords",TEXCOORD_1:"texCoords1",TEXCOORD_2:"texCoords2"};function tle(n,e){const{attributeMap:t=Jae}=e||{};return t&&t[n]||n}function nle(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 CU=()=>{},sle={};class Yg{constructor(e,t={}){const{id:i=ga("model")}=t;tn(pS(e)),this.id=i,this.gl=e,this.id=t.id||ga("Model"),this.lastLogTime=0,this.animated=!1,this.initialize(t)}initialize(e){this.props={},this.programManager=e.programManager||N0.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:u}=e;this.programProps={program:t,vs:i,fs:r,modules:s,defines:o,inject:a,varyings:l,bufferMode:c,transpileToGLSL100:u},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:u}=e;this.programProps={program:t,vs:i,fs:r,modules:s,defines:o,inject:a,varyings:l,bufferMode:c,transpileToGLSL100:u},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=tle(s,undefined);if("indices"===s)r=o;else if(o.constant)i[a]=o.value;else{const l=o.value,c=ot({},o);delete c.value,i[a]=[new hr(n,l),c],nle(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 hr(n,{data:s,target:34963}),o]}return i}(this.gl,e),this.vertexArray.setAttributes(this.geometryBuffers),this}setAttributes(e={}){if(Vg(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 hI(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),mn.priority>=2&&(c=this._logDrawCallStart(2));const u=this.vertexArray.getDrawParams(),{isIndexed:h=u.isIndexed,indexType:p=u.indexType,indexOffset:g=u.indexOffset,vertexArrayInstanced:m=u.isInstanced}=this.props;m&&!this.isInstanced&&mn.warn("Found instanced attributes on non-instanced model",this.id)();const{isInstanced:w,instanceCount:C}=this,{onBeforeRender:H=CU,onAfterRender:U=CU}=this.props;H(),this.program.setUniforms(this.uniforms);const de=this.program.draw(Object.assign(sle,e,{logPriority:c,uniforms:null,framebuffer:i,parameters:a,drawMode:this.getDrawMode(),vertexCount:this.getVertexCount(),vertexArray:l,transformFeedback:o,isIndexed:h,indexType:p,isInstanced:w,instanceCount:C,offset:h?g:0}));return U(),mn.priority>=2&&this._logDrawCallEnd(c,l,i),de}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 mn.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:u}=this.programProps;t=this.programManager.get({vs:i,fs:r,modules:s,inject:o,defines:a,varyings:l,bufferMode:c,transpileToGLSL100:u}),this.program&&this._managedProgram&&this.programManager.release(this.program),this._programManagerState=this.programManager.stateHash,this._managedProgram=!0}tn(t instanceof wU,"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 qae(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 hr&&t.delete()}}_setAnimationProps(e){this.animated&&tn(e,"Model.draw(): animated uniforms but no animationProps")}_setFeedbackBuffers(e={}){if(Vg(e))return this;const{gl:t}=this.program;return this.transformFeedback=this.transformFeedback||new YV(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:mn.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=EU(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}: ${Xae(s.name,a)}`),t[o]=EU(n,i[r],a,e)}}return t}({vertexArray:t,header:`${this.id} attributes`,attributes:this._attributes}),{table:o,unusedTable:a,unusedCount:l}=SU({header:`${this.id} uniforms`,program:this.program,uniforms:Object.assign({},this.program.uniforms,i)}),{table:c,count:u}=SU({header:`${this.id} uniforms`,program:this.program,uniforms:Object.assign({},this.program.uniforms,i),undefinedOnly:!0});u>0&&mn.log("MISSING UNIFORMS",Object.keys(c))(),l>0&&mn.log("UNUSED UNIFORMS",Object.keys(a))();const h=function(n){const e={},t=`Accessors for ${n.id}`;for(const i of n.attributeInfos)i&&(e[`in ${xU(i)}`]={[t]:JSON.stringify(i.accessor)});for(const i of n.varyingInfos)i&&(e[`out ${xU(i)}`]={[t]:JSON.stringify(i.accessor)});return e}(this.vertexArray.configuration);mn.table(e,s)(),mn.table(e,o)(),mn.table(e+1,h)(),r&&r.log({logLevel:2,message:`Rendered to ${r.id}`}),mn.groupEnd(2,`>>> DRAWING MODEL ${this.id}`)()}}class zI{static isSupported(e){return Si(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 Yg(t,Object.assign({},e,{fs:e.fs||qV({version:KV(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!(Vg(n.feedbackBuffers)&&Vg(n.feedbackMap)&&!(n.varyings&&n.varyings.length>0))})(t)&&(this.bufferTransform=new eoe(e,t)),function(n){return!(Vg(n._sourceTextures)&&!n._targetTexture&&!n._targetTextureVarying)}(t)&&(this.textureTransform=new poe(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 RS(){}const lle={onStart:RS,onUpdate:RS,onInterrupt:RS,onEnd:RS};class F0{constructor(e){this._inProgress=!1,this._handle=null,this.timeline=e,this.settings={}}get inProgress(){return this._inProgress}start(e){this.cancel(),this.settings=ot(ot({},lle),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 mle={interpolation:class{constructor({gl:e,attribute:t,timeline:i}){this.gl=e,this.type="interpolation",this.transition=new F0(i),this.attribute=t,this.attributeInTransition=new CI(e,t.settings),this.currentStartIndices=t.startIndices,this.currentLength=0,this.transform=function(n,e){const t=zV(e.size);return new zI(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 hr(e,r),new hr(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;HV(r);const o={numInstances:t,attribute:s,fromLength:this.currentLength,fromStartIndices:this.currentStartIndices,getData:e.enter};for(const a of r)GV(ot({buffer:a},o));this.currentStartIndices=s.startIndices,this.currentLength=xI(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:UV(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 F0(i),this.attribute=t,this.attributeInTransition=new CI(e,Cn(ot({},t.settings),{normalized:!1})),this.currentStartIndices=t.startIndices,this.currentLength=0,this.texture=function(n){return new _a(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 Fs(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=zV(e.size);return new zI(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 hr(e,r),new hr(e,r),new hr(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)GV(ot({buffer:a},o));this.currentStartIndices=s.startIndices,this.currentLength=xI(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:UV(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]}}),HV(e),this.attributeInTransition.update({buffer:e[1],value:this.attribute.value}),_S(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 _le{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=zI.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 Ri.warn("WebGL2 not supported by this browser. Transition for ".concat(e," is disabled."))();r&&this._removeTransition(e);const o=mle[i.type];o?this.transitions[e]=new o({attribute:t,timeline:this.timeline,gl:this.gl}):(Ri.error("unsupported transition type '".concat(i.type,"'"))(),s=!1)}(s||t.needsRedraw())&&(this.needsRedraw=!0,this.transitions[e].start(i,this.numInstances))}}const AU="attributeManager.invalidate";class Sle{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 _le(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;To("attribute.updateStart",t),t.allocate(i)&&To("attribute.allocate",t,i),t.updateBuffer(e)&&(this.needsRedraw=!0,To("attribute.updateEnd",t,i))}}function MU(n,e,t,i,r){const s=e-n;return(t-e)*r+-s*i+s+e}function DU(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=VV(r)))return;const o=Tle[r.type];if(!o)return void Ri.error("unsupported transition type '".concat(r.type,"'"))();const a=new o(this.timeline);a.start(Cn(ot({},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 NS={COMPONENT:Symbol.for("component"),ASYNC_DEFAULTS:Symbol.for("asyncPropDefaults"),ASYNC_ORIGINAL:Symbol.for("asyncPropOriginal"),ASYNC_RESOLVED:Symbol.for("asyncPropResolved")},{COMPONENT:Dle}=NS;function Rle(n,e){if(!n.transitions)return null;const t={},i=GI(n);for(const r in n.transitions){const s=i[r],o=s&&s.type;("number"===o||"color"===o||"array"===o)&&HI(n[r],e[r],s)&&(t[r]=!0)}return t}function IU({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=HI(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=HI(n[s],e[s],i[s]);if(o)return"".concat(r,".").concat(s," ").concat(o)}}return null}function HI(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 Fle(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(!Ule(i[r],e[r])){t=n(i),e=i;break}return t}}function zle(n,e){if(!e)return n;const t=ot(ot({},n),e);if("defines"in e&&(t.defines=ot(ot({},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=ot({},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 $I(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],u=e[8],h=e[9],p=e[10],g=e[11],m=e[12],w=e[13],C=e[14],H=e[15],U=t*a-i*o,de=t*l-r*o,Ae=t*c-s*o,Pe=i*l-r*a,Be=i*c-s*a,et=r*c-s*l,wt=u*w-h*m,vt=u*C-p*m,Ct=u*H-g*m,Bt=h*C-p*w,$t=h*H-g*w,gt=p*H-g*C,mt=U*gt-de*$t+Ae*Bt+Pe*Ct-Be*vt+et*wt;return mt?(n[0]=(a*gt-l*$t+c*Bt)*(mt=1/mt),n[1]=(r*$t-i*gt-s*Bt)*mt,n[2]=(w*et-C*Be+H*Pe)*mt,n[3]=(p*Be-h*et-g*Pe)*mt,n[4]=(l*Ct-o*gt-c*vt)*mt,n[5]=(t*gt-r*Ct+s*vt)*mt,n[6]=(C*Ae-m*et-H*de)*mt,n[7]=(u*et-p*Ae+g*de)*mt,n[8]=(o*$t-a*Ct+c*wt)*mt,n[9]=(i*Ct-t*$t-s*wt)*mt,n[10]=(m*Be-w*Ae+H*U)*mt,n[11]=(h*Ae-u*Be-g*U)*mt,n[12]=(a*vt-o*Bt-l*wt)*mt,n[13]=(t*Bt-i*vt+r*wt)*mt,n[14]=(w*de-m*Pe-C*U)*mt,n[15]=(u*Pe-h*de+p*U)*mt,n):null}function Pf(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],u=e[7],h=e[8],p=e[9],g=e[10],m=e[11],w=e[12],C=e[13],H=e[14],U=e[15],de=t[0],Ae=t[1],Pe=t[2],Be=t[3];return n[0]=de*i+Ae*a+Pe*h+Be*w,n[1]=de*r+Ae*l+Pe*p+Be*C,n[2]=de*s+Ae*c+Pe*g+Be*H,n[3]=de*o+Ae*u+Pe*m+Be*U,n[4]=(de=t[4])*i+(Ae=t[5])*a+(Pe=t[6])*h+(Be=t[7])*w,n[5]=de*r+Ae*l+Pe*p+Be*C,n[6]=de*s+Ae*c+Pe*g+Be*H,n[7]=de*o+Ae*u+Pe*m+Be*U,n[8]=(de=t[8])*i+(Ae=t[9])*a+(Pe=t[10])*h+(Be=t[11])*w,n[9]=de*r+Ae*l+Pe*p+Be*C,n[10]=de*s+Ae*c+Pe*g+Be*H,n[11]=de*o+Ae*u+Pe*m+Be*U,n[12]=(de=t[12])*i+(Ae=t[13])*a+(Pe=t[14])*h+(Be=t[15])*w,n[13]=de*r+Ae*l+Pe*p+Be*C,n[14]=de*s+Ae*c+Pe*g+Be*H,n[15]=de*o+Ae*u+Pe*m+Be*U,n}function FS(n,e,t){var o,a,l,c,u,h,p,g,m,w,C,H,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],u=e[4],h=e[5],p=e[6],g=e[7],m=e[8],w=e[9],C=e[10],H=e[11],n[0]=o=e[0],n[1]=a,n[2]=l,n[3]=c,n[4]=u,n[5]=h,n[6]=p,n[7]=g,n[8]=m,n[9]=w,n[10]=C,n[11]=H,n[12]=o*i+u*r+m*s+e[12],n[13]=a*i+h*r+w*s+e[13],n[14]=l*i+p*r+C*s+e[14],n[15]=c*i+g*r+H*s+e[15]),n}function kS(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 RU(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],u=e[9],h=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+u*i,n[6]=a*r+h*i,n[7]=l*r+p*i,n[8]=c*r-s*i,n[9]=u*r-o*i,n[10]=h*r-a*i,n[11]=p*r-l*i,n}function NU(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],u=e[5],h=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+u*i,n[2]=a*r+h*i,n[3]=l*r+p*i,n[4]=c*r-s*i,n[5]=u*r-o*i,n[6]=h*r-a*i,n[7]=p*r-l*i,n}function FU(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 LS(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 kU(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],u=c*i+a*s-l*r,h=c*r+l*i-o*s,p=c*s+o*r-a*i,g=-o*i-a*r-l*s;return n[0]=u*c+g*-o+h*-l-p*-a,n[1]=h*c+g*-a+p*-o-u*-l,n[2]=p*c+g*-l+u*-a-h*-o,n[3]=e[3],n}!function(){var n=new ya(4);ya!=Float32Array&&(n[0]=0,n[1]=0,n[2]=0,n[3]=0)}();const LU=[0,0,0,0],fce=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0],pce=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],gce=[0,0,0],mce=[0,0,0],_ce=PS(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=LU,l=LU,c=n.cameraPosition;const{geospatialOrigin:u,shaderCoordinateOrigin:h,offsetMode:p}=BU(n,e,t);return p&&(l=n.projectPosition(u||h),c=[c[0]-l[0],c[1]-l[1],c[2]-l[2]],l[3]=1,a=LS([],l,o),s=i||s,o=Pf([],r,s),o=Pf([],o,fce)),{viewMatrix:s,viewProjectionMatrix:o,projectionCenter:a,originCommon:l,cameraPosCommon:c,shaderCoordinateOrigin:h,geospatialOrigin:u}}(n,t,i),u=n.getDistanceScales(),h=[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:h,project_uDevicePixelRatio:e,project_uFocalDistance:p,project_uCommonUnitsPerMeter:u.unitsPerMeter,project_uCommonUnitsPerWorldUnit:u.unitsPerMeter,project_uCommonUnitsPerWorldUnit2:gce,project_uScale:n.scale,project_uViewProjectionMatrix:s,project_uCameraPosition:a};if(c){const m=n.getDistanceScales(c);switch(t){case ji.METER_OFFSETS:g.project_uCommonUnitsPerWorldUnit=m.unitsPerMeter,g.project_uCommonUnitsPerWorldUnit2=m.unitsPerMeter2;break;case ji.LNGLAT:case ji.LNGLAT_OFFSETS:g.project_uCommonUnitsPerWorldUnit=m.unitsPerDegree,g.project_uCommonUnitsPerWorldUnit2=m.unitsPerDegree2;break;case ji.CARTESIAN:g.project_uCommonUnitsPerWorldUnit=[1,1,m.unitsPerMeter[2]],g.project_uCommonUnitsPerWorldUnit2=[0,0,m.unitsPerMeter2[2]]}}return g});function BU(n,e,t=mce){let r,i=t,s=!0;switch(r=e===ji.LNGLAT_OFFSETS||e===ji.METER_OFFSETS?t:n.isGeospatial?[Math.fround(n.longitude),Math.fround(n.latitude),0]:null,n.projectionMode){case Kc.WEB_MERCATOR:(e===ji.LNGLAT||e===ji.CARTESIAN)&&(s=!1);break;case Kc.WEB_MERCATOR_AUTO_OFFSET:e===ji.LNGLAT?i=r:e===ji.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 wce extends bS{get ELEMENTS(){return Yu(!1),0}get RANK(){return Yu(!1),0}toString(){let e="[";if(Or.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 qn).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 function(n,e,t,i,r){var o,s=1/Math.tan(e/2);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)}(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],u=n[9],h=n[10],p=n[11],g=n[12],m=n[13],w=n[14],C=n[15];return(e*o-t*s)*(h*C-p*w)-(e*a-i*s)*(u*C-p*m)+(e*l-r*s)*(u*w-h*m)+(t*a-i*o)*(c*C-p*g)-(t*l-r*o)*(c*w-h*g)+(i*l-r*a)*(c*m-u*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 $I(this,this),this.check()}multiplyLeft(e){return Pf(this,e,this),this.check()}multiplyRight(e){return Pf(this,this,e),this.check()}rotateX(e){return RU(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],u=e[9],h=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-u*i,n[2]=a*r-h*i,n[3]=l*r-p*i,n[8]=s*i+c*r,n[9]=o*i+u*r,n[10]=a*i+h*r,n[11]=l*i+p*r}(this,this,e),this.check()}rotateZ(e){return NU(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,u,h,p,g,m,w,C,H,U,de,Ae,Pe,Be,et,wt,vt,Ct,Bt,$t,gt,mt,Vt,r=i[0],s=i[1],o=i[2],a=Math.hypot(r,s,o);at?t:n}const WI=Math.log2||function(n){return Math.log(n)*Math.LOG2E};function Xu(n,e){if(!n)throw new Error(e||"@math.gl/web-mercator: assertion failed.")}const gc=Math.PI,GU=gc/4,mc=gc/180,qI=180/gc,YI=4003e4,jS=85.051129;function VS([n,e]){return Xu(Number.isFinite(n)),Xu(Number.isFinite(e)&&e>=-90&&e<=90,"invalid latitude"),[512*(n*mc+gc)/(2*gc),512*(gc+Math.log(Math.tan(GU+e*mc*.5)))/(2*gc)]}function Zg([n,e]){const t=n/512*(2*gc)-gc,i=2*(Math.atan(Math.exp(e/512*(2*gc)-gc))-GU);return[t*qI,i*qI]}function KI({latitude:n,longitude:e,highPrecision:t=!1}){Xu(Number.isFinite(n)&&Number.isFinite(e));const i={},s=Math.cos(n*mc),o=512/360,a=o/s,l=512/YI/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=mc*Math.tan(n*mc)/s,h=512/YI*c,p=h/a*l;i.unitsPerDegree2=[0,o*c/2,h],i.unitsPerMeter2=[p,0,p]}return i}function $U(n,e){const[t,i,r]=n,[s,o,a]=e,{unitsPerMeter:l,unitsPerMeter2:c}=KI({longitude:t,latitude:i,highPrecision:!0}),u=VS(n);u[0]+=s*(l[0]+c[0]*o),u[1]+=o*(l[1]+c[1]*o);const h=Zg(u),p=(r||0)+(a||0);return Number.isFinite(r)||Number.isFinite(a)?[h[0],h[1],p]:h}function qU(n){return 2*Math.atan(.5/n)*qI}function YU(n,e){const[t,i,r=0]=n;return Xu(Number.isFinite(t)&&Number.isFinite(i)&&Number.isFinite(r)),Qg(e,[t,i,r,1])}function L0(n,e,t=0){const[i,r,s]=n;if(Xu(Number.isFinite(i)&&Number.isFinite(r),"invalid pixel coordinate"),Number.isFinite(s))return Qg(e,[i,r,s,1]);const o=Qg(e,[i,r,0,1]),a=Qg(e,[i,r,1,1]),l=o[2],c=a[2];return VU([],o,a,l===c?0:((t||0)-l)/(c-l))}const KU=Math.PI/180;function XU(n,e,t){const{pixelUnprojectionMatrix:i}=n,r=Qg(i,[e,0,1,1]),s=Qg(i,[e,n.height,1,1]),c=Zg(VU([],r,s,(t*n.distanceScales.unitsPerMeter[2]-r[2])/(s[2]-r[2])));return c[2]=t,c}const Bce=Math.PI/180,jce=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],QI=[0,0,0],Uce={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&&C0(t.projectionMatrix,this.projectionMatrix)&&C0(t.viewMatrix,this.viewMatrix))}project(t,{topLeft:i=!0}={}){const s=YU(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,u=L0([s,i?o:this.height-o,a],this.pixelUnprojectionMatrix,r&&r*this.distanceScales.unitsPerMeter[2]),[h,p,g]=this.unprojectPosition(u);return Number.isFinite(a)?[h,p,g]:Number.isFinite(r)?[h,p,r]:[h,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?VS(t):t}unprojectFlat(t){return this.isGeospatial?Zg(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?KI({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:u=!1,repeat:h=!1,worldOffset:p=0}=t;let{width:g,height:m,altitude:w=1.5}=t;const C=Math.pow(2,s);g=g||1,m=m||1,w=Math.max(.75,w);const{fov:H,aspect:U,focalDistance:de,near:Ae,far:Pe}=function({width:n,height:e,fovy:t=qU(1.5),altitude:i,pitch:r=0,nearZMultiplier:s=1,farZMultiplier:o=1}){void 0!==i&&(t=qU(i));const a=.5*t*mc,l=function(n){return.5/Math.tan(.5*n*mc)}(t),c=r*mc,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:n/e,focalDistance:l,near:s,far:(Math.sin(c)*u+l)*o}}({width:g,height:m,pitch:o,altitude:w,nearZMultiplier:l,farZMultiplier:c});let Be=function({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 FS(o,o,[0,0,-i]),RU(o,o,-e*mc),NU(o,o,t*mc),kS(o,o,[r/=n,r,r]),s&&FS(o,o,function(n,e){return n[0]=-e[0],n[1]=-e[1],n[2]=-e[2],n}([],s)),o}({height:m,pitch:o,bearing:a,scale:C,altitude:w});p&&(Be=(new qn).translate([512*p,0,0]).multiplyLeft(Be)),super(Cn(ot({},t),{width:g,height:m,viewMatrix:Be,longitude:r,latitude:i,zoom:s,orthographic:u,fovyRadians:H,aspect:U,focalDistance:de,near:Ae,far:Pe})),this.latitude=i,this.longitude=r,this.zoom=s,this.pitch=o,this.bearing=a,this.altitude=w,this.orthographic=u,this._subViewports=h?[]: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(Cn(ot({},this),{worldOffset:s})):this;this._subViewports.push(o)}}return this._subViewports}addMetersToLngLat(t,i){return $U(t,i)}panByPosition(t,i){const r=L0(i,this.pixelUnprojectionMatrix),o=BS([],this.projectFlat(t),jU([],r)),a=BS([],this.center,o),[l,c]=this.unprojectFlat(a);return{longitude:l,latitude:c}}getBounds(t={}){const i=function(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*KU:Math.atan(.5/n.altitude))>(90-n.pitch)*KU-.01?(l=XU(n,0,e),c=XU(n,t,e)):(l=r([0,0],s),c=r([t,0],s)),[o,a,c,l]}(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}=function({width:n,height:e,bounds:t,minExtent:i=0,maxZoom:r=24,padding:s=0,offset:o=[0,0]}){const[[a,l],[c,u]]=t;Number.isFinite(s)?s={top:s,bottom:s,left:s,right:s}:Xu(Number.isFinite(s.top)&&Number.isFinite(s.bottom)&&Number.isFinite(s.left)&&Number.isFinite(s.right));const h=VS([a,HU(u,-jS,jS)]),p=VS([c,HU(l,-jS,jS)]),g=[Math.max(Math.abs(p[0]-h[0]),i),Math.max(Math.abs(p[1]-h[1]),i)],m=[n-s.left-s.right-2*Math.abs(o[0]),e-s.top-s.bottom-2*Math.abs(o[1])];Xu(m[0]>0&&m[1]>0);const w=m[0]/g[0],C=m[1]/g[1],Ae=Zg([(p[0]+h[0])/2+(s.right-s.left)/2/w,(p[1]+h[1])/2+(s.bottom-s.top)/2/C]),Pe=Math.min(r,WI(Math.abs(Math.min(w,C))));return Xu(Number.isFinite(Pe)),{longitude:Ae[0],latitude:Ae[1],zoom:Pe}}(ot({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 ZI(n,e,t=!1){const i=e.projectPosition(n);if(t&&e instanceof tz){const[r,s,o=0]=n,a=e.getDistanceScales([r,s]);i[2]=o*a.unitsPerMeter[2]}return i}function nz(n,{viewport:e,modelMatrix:t,coordinateSystem:i,coordinateOrigin:r,offsetMode:s}){let[o,a,l=0]=n;switch(t&&([o,a,l]=LS([],[o,a,l,1],t)),i){case ji.LNGLAT:return ZI([o,a,l],e,s);case ji.LNGLAT_OFFSETS:return ZI([o+r[0],a+r[1],l+(r[2]||0)],e,s);case ji.METER_OFFSETS:return ZI($U(r,[o,a,l]),e,s);case ji.CARTESIAN:default:return e.isGeospatial?[o+r[0],a+r[1],l+r[2]]:e.projectPosition([o,a,l])}}const Gce={10241:9987,10240:9729,10242:33071,10243:33071},JI={},qce={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||j0(n)&&(3===n.length||4===n.length),equal:(n,e,t)=>eO(n,e)},accessor:{validate(n,e){const t=US(n);return"function"===t||t===US(e.value)},equal:(n,e,t)=>"function"==typeof e||eO(n,e)},array:{validate:(n,e)=>e.optional&&!n||j0(n),equal:(n,e,t)=>t.compare?eO(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 _a)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 _a(t,Cn(ot({},e),{parameters:ot(ot(ot({},Gce),i),n.props.textureParameters)}));return JI[r.id]=!0,r}(t,n),release:n=>{!function(n){!n||!(n instanceof _a)||JI[n.id]&&(n.delete(),delete JI[n.id])}(n)}}};function eO(n,e){if(n===e)return!0;if(!j0(n)||!j0(e))return!1;const t=n.length;if(t!==e.length)return!1;for(let i=0;i{},this.oldProps=oue,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[rue]||{},i=e[iue]||e,r=e[sue]||{};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(BV(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 oi(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 h,c=!0,u=!1;try{for(var g,m,p=nO(t);c=(g=yield p.next()).done,m=yield g.value,!c;c=!0){const C=m,{dataTransform:H}=i.component?i.component.props:{};a=H?H(C,a):a.concat(C),Object.defineProperty(a,"__diff",{enumerable:!1,value:[{startRow:l,endRow:a.length}]}),l=a.length,i._setAsyncPropValue(e,a,o)}}catch(C){u=!0,h=C}finally{try{!c&&null!=p.return&&(yield p.return())}finally{if(u)throw h}}const w=null===(r=i.layer)||void 0===r?void 0:r.props.onDataLoad;w&&w(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:oz,ASYNC_RESOLVED:az,ASYNC_DEFAULTS:aue}=NS,lue={};let cue=0,uue=(()=>{class n{constructor(){this.props=Xce.apply(this,arguments),this.id=this.props.id,this.count=cue++,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[aue])s in i[az]?r[s]=i[az][s]:s in i[oz]&&(r[s]=i[oz][s]);return new this.constructor(ot(ot(ot({},i),r),t))}get stats(){return this.internalState.stats}_initState(){this.internalState=new sz({})}}return n.componentName="Component",n.defaultProps=lue,n})();class due extends sz{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 _c=n=>"function"==typeof n,uh=n=>null!==n&&"object"==typeof n,cz=n=>uh(n)&&n.constructor==={}.constructor,hue=n=>n&&"function"==typeof n[Symbol.iterator],fue=n=>n&&"function"==typeof n[Symbol.asyncIterator],U0=n=>"undefined"!=typeof Response&&n instanceof Response||n&&n.arrayBuffer&&n.text&&n.json,em=n=>"undefined"!=typeof Blob&&n instanceof Blob,uz=n=>(n=>"undefined"!=typeof ReadableStream&&n instanceof ReadableStream||uh(n)&&_c(n.tee)&&_c(n.cancel)&&_c(n.getReader))(n)||(n=>uh(n)&&_c(n.read)&&_c(n.pipe)&&(n=>"boolean"==typeof n)(n.readable))(n);function Ff(n,e){if(!n)throw new Error(e||"loader assertion failed.")}function iO(n){var e;return!!n&&(Array.isArray(n)&&(n=n[0]),Array.isArray(null===(e=n)||void 0===e?void 0:e.extensions))}function rO(n){var e,t;let i;return Ff(n,"null loader"),Ff(iO(n),"invalid loader"),Array.isArray(n)&&(i=n[1],n=Cn(ot({},n=n[0]),{options:ot(ot({},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 Zc={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},sO=Zc.global||Zc.self||Zc.window||{},bue="object"!=typeof process||"[object process]"!==String(process)||process.browser,dz="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version);dz&&parseFloat(dz[1]);const aO={};function vue(n){for(const e in aO)n.startsWith(e)&&(n=n.replace(e,aO[e]));return!n.startsWith("http://")&&!n.startsWith("https://")&&(n=`${n}`),n}const wue=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,Eue=/^([-\w.]+\/[-\w.+]+)/;function Sue(n){const e=Eue.exec(n);return e?e[1]:n}function hz(n){const e=wue.exec(n);return e?e[1]:""}const xue=/\?.*/;function $S(n){if(U0(n)){const e=lO(n.url||"");return{url:e,type:Sue(n.headers.get("content-type")||"")||hz(e)}}return em(n)?{url:lO(n.name||""),type:n.type||""}:"string"==typeof n?{url:lO(n),type:hz(n)}:{url:"",type:""}}function Cue(n){return U0(n)?n.headers["content-length"]||-1:em(n)?n.size:"string"==typeof n?n.length:n instanceof ArrayBuffer||ArrayBuffer.isView(n)?n.byteLength:-1}function lO(n){return n.replace(xue,"")}function fz(n){return cO.apply(this,arguments)}function cO(){return(cO=oi(function*(n){if(U0(n))return n;const e={},t=Cue(n);t>=0&&(e["content-length"]=String(t));const{url:i,type:r}=$S(n);r&&(e["content-type"]=r);const s=yield Mue(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 Aue(n){return uO.apply(this,arguments)}function uO(){return(uO=oi(function*(n){if(!n.ok){const e=yield Tue(n);throw new Error(e)}})).apply(this,arguments)}function Tue(n){return dO.apply(this,arguments)}function dO(){return(dO=oi(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 Mue(n){return hO.apply(this,arguments)}function hO(){return(hO=oi(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,${Due(n.slice(0,5))}`:null})).apply(this,arguments)}function Due(n){let e="";const t=new Uint8Array(n);for(let i=0;i{}}info(){return()=>{}}warn(){return()=>{}}error(){return()=>{}}}const mz={fetch:null,mimeType:void 0,nothrow:!1,log:new class{constructor(){Kn(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:[]},Rue={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 pO(){sO.loaders=sO.loaders||{};const{loaders:n}=sO;return n._state=n._state||{},n._state}const gO=()=>{const n=pO();return n.globalOptions=n.globalOptions||ot({},mz),n.globalOptions};function Nue(n,e,t,i){return t=t||[],function(n,e){yz(n,null,mz,Rue,e);for(const t of e)yz(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=ot({},n.options||{});return function(n,e){e&&!("baseUri"in n)&&(n.baseUri=e)}(r,t),null===r.log&&(r.log=new Iue),vz(r,gO()),vz(r,e),r}(e,n,i)}function _z(n,e){const t=gO(),i=n||t;return"function"==typeof i.fetch?i.fetch:uh(i.fetch)?r=>pz(r,i):null!=e&&e.fetch?null==e?void 0:e.fetch:pz}function yz(n,e,t,i,r){const s=e||"Top level",o=e?`${e}.`:"";for(const a in n){const l=!e&&uh(n[a]),c="baseUri"===a&&!e,u="workerUrl"===a&&e;if(!(a in t)&&!c&&!u)if(a in i)gz.warn(`${s} loader option '${o}${a}' no longer supported, use '${i[a]}'`)();else if(!l){const h=Fue(a,r);gz.warn(`${s} loader option '${o}${a}' not recognized. ${h}`)()}}}function Fue(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 vz(n,e){for(const t in e)t in e&&(n[t]=cz(e[t])&&cz(n[t])?ot(ot({},n[t]),e[t]):e[t])}function Jc(n,e){if(!n)throw new Error(e||"loaders.gl assertion failed.")}function Bue(n,e="3.0.12"){return Jc(n,"no worker provided"),!(!e||!n.version)}const eu={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},jue=eu.global||eu.self||eu.window||{},mO="object"!=typeof process||"[object process]"!==String(process)||process.browser,_O="function"==typeof importScripts,Vue="undefined"!=typeof window&&void 0!==window.orientation,wz="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version),yO=(wz&&parseFloat(wz[1]),new Map);function Ez(n){const e=new Blob([n],{type:"application/javascript"});return URL.createObjectURL(e)}function Sz(n,e=!0,t){const i=t||new Set;if(n)if(xz(n))i.add(n);else if(xz(n.buffer))i.add(n.buffer);else if(!ArrayBuffer.isView(n)&&e&&"object"==typeof n)for(const r in n)Sz(n[r],e,i);return void 0===t?Array.from(i):[]}function xz(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 bO=()=>{};class Cz{static isSupported(){return"undefined"!=typeof Worker}constructor(e){Kn(this,"name",void 0),Kn(this,"source",void 0),Kn(this,"url",void 0),Kn(this,"terminated",!1),Kn(this,"worker",void 0),Kn(this,"onMessage",void 0),Kn(this,"onError",void 0),Kn(this,"_loadableURL","");const{name:t,source:i,url:r}=e;Jc(i||r),this.name=t,this.source=i,this.url=r,this.onMessage=bO,this.onError=s=>console.log(s),this.worker=this._createBrowserWorker()}destroy(){this.onMessage=bO,this.onError=bO,this.worker.terminate(),this.terminated=!0}get isRunning(){return Boolean(this.onMessage)}postMessage(e,t){t=t||Sz(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){Jc(n.source&&!n.url||!n.source&&n.url);let e=yO.get(n.source||n.url);return e||(n.url&&(e=function(n){return n.startsWith("http")?Ez(function(n){return`try {\n importScripts('${n}');\n} catch (error) {\n console.error(error);\n throw error;\n}`}(n)):n}(n.url),yO.set(n.url,e)),n.source&&(e=Ez(n.source),yO.set(n.source,e))),Jc(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 Gue{constructor(e,t){Kn(this,"name",void 0),Kn(this,"workerThread",void 0),Kn(this,"isRunning",void 0),Kn(this,"result",void 0),Kn(this,"_resolve",void 0),Kn(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){Jc(this.isRunning),this.isRunning=!1,this._resolve(e)}error(e){Jc(this.isRunning),this.isRunning=!1,this._reject(e)}}class $ue{constructor(e){Kn(this,"name","unnamed"),Kn(this,"source",void 0),Kn(this,"url",void 0),Kn(this,"maxConcurrency",1),Kn(this,"maxMobileConcurrency",1),Kn(this,"onDebug",()=>{}),Kn(this,"reuseWorkers",!0),Kn(this,"props",{}),Kn(this,"jobQueue",[]),Kn(this,"idleQueue",[]),Kn(this,"count",0),Kn(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=ot(ot({},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 oi(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 oi(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 Gue(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 Qu{static isSupported(){return Cz.isSupported()}static getWorkerFarm(e={}){return Qu._workerFarm=Qu._workerFarm||new Qu({}),Qu._workerFarm.setProps(e),Qu._workerFarm}constructor(e){Kn(this,"props",void 0),Kn(this,"workerPools",new Map),this.props=ot({},Wue),this.setProps(e),this.workerPools=new Map}destroy(){for(const e of this.workerPools.values())e.destroy()}setProps(e){this.props=ot(ot({},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 $ue({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 Yue(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 Jc(r),r}function Kue(n,e){return!!Qu.isSupported()&&n.worker&&(null==e?void 0:e.worker)}function Xue(n,e,t,i,r){return vO.apply(this,arguments)}function vO(){return(vO=oi(function*(n,e,t,i,r){const s=n.id,o=Yue(n,t),l=Qu.getWorkerFarm(t).getWorkerPool({name:s,url:o});t=JSON.parse(JSON.stringify(t));const c=yield l.startJob("process-on-worker",Que.bind(null,r));return c.postMessage("process",{input:e,options:t}),yield(yield c.result).result})).apply(this,arguments)}function Que(n,e,t,i){return wO.apply(this,arguments)}function wO(){return(wO=oi(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)}Kn(Qu,"_workerFarm",void 0);var Tz=Je(521);function Mz(n){if(function(n){return n&&"object"==typeof n&&n.isBuffer}(n)&&(n=function(n){return Tz.toArrayBuffer?Tz.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 tde(...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 Dz(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 nde(n){return SO.apply(this,arguments)}function SO(){return(SO=oi(function*(n){const e=[];var r,t=!0,i=!1;try{for(var o,a,s=nO(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 tde(...e)})).apply(this,arguments)}const sde=262144;function Iz(n){this.wrapped=n}function z0(n){return new Iz(n)}function H0(n){var e,t;function r(o,a){try{var l=n[o](a),c=l.value,u=c instanceof Iz;Promise.resolve(u?c.wrapped:c).then(function(h){u?r("return"===o?"return":"next",h):s(l.done?"return":"normal",h)},function(h){r("throw",h)})}catch(h){s("throw",h)}}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 u={key:o,arg:a,resolve:l,reject:c,next:null};t?t=t.next=u:(e=t=u,r(o,a))})},"function"!=typeof n.return&&(this.return=void 0)}function CO(n){return function(){return new H0(n.apply(this,arguments))}}function AO(){return(AO=CO(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(DO)}function fde(n,e,t){return IO.apply(this,arguments)}function IO(){return(IO=oi(function*(n,e,t){const i=n instanceof ArrayBuffer||ArrayBuffer.isView(n);if("string"==typeof n||i)return hde(n,e);if(em(n)&&(n=yield fz(n)),U0(n)){const r=n;return yield Aue(r),e.binary?yield r.arrayBuffer():yield r.text()}if(uz(n)&&(n=dde(n,t)),hue(n)||fue(n))return nde(n);throw new Error(DO)})).apply(this,arguments)}function gde(n,e,t=null){if(t)return t;const i=ot({fetch:_z(e,n)},n);return Array.isArray(i.loaders)||(i.loaders=null),i}function mde(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 Rz=()=>{const n=pO();return n.loaderRegistry=n.loaderRegistry||[],n.loaderRegistry};function Nz(n){const e=Rz();n=Array.isArray(n)?n:[n];for(const t of n){const i=rO(t);e.find(r=>i===r)||e.unshift(i)}}const yde=/\.([^.]+)$/;function bde(n){return NO.apply(this,arguments)}function NO(){return(NO=oi(function*(n,e=[],t,i){if(!Fz(n))return null;let r=Pz(n,e,Cn(ot({},t),{nothrow:!0}),i);if(r)return r;if(em(n)&&(r=Pz(n=yield n.slice(0,10).arrayBuffer(),e,t,i)),!(r||null!=t&&t.nothrow))throw new Error(kz(n));return r})).apply(this,arguments)}function Pz(n,e=[],t,i){if(!Fz(n))return null;if(e&&!Array.isArray(e))return rO(e);let r=[];e&&(r=r.concat(e)),null!=t&&t.ignoreRegisteredLoaders||r.push(...Rz()),function(n){for(const e of n)rO(e)}(r);const s=function(n,e,t,i){const{url:r,type:s}=$S(n),o=r||(null==i?void 0:i.url);let a=null;return null!=t&&t.mimeType&&(a=PO(e,null==t?void 0:t.mimeType)),a=a||function(n,e){const t=e&&yde.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||PO(e,s),a=a||function(n,e){if(!e)return null;for(const t of n)if("string"==typeof e){if(Cde(e,t))return t}else if(ArrayBuffer.isView(e)){if(Lz(e.buffer,e.byteOffset,t))return t}else if(e instanceof ArrayBuffer&&Lz(e,0,t))return t;return null}(e,n),a=a||PO(e,null==t?void 0:t.fallbackMimeType),a}(n,r,t,i);if(!(s||null!=t&&t.nothrow))throw new Error(kz(n));return s}function Fz(n){return!(n instanceof Response&&204===n.status)}function kz(n){const{url:e,type:t}=$S(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)?FO(n.buffer,n.byteOffset,e):n instanceof ArrayBuffer?FO(n,0,e):""}(n)}", contentType: "${t}"`),e&&(i+=` url: ${e}`),i}function PO(n,e){for(const t of n)if(t.mimeTypes&&t.mimeTypes.includes(e)||e===`application/x.${t.id}`)return t;return null}function Cde(n,e){return e.testText?e.testText(n):(Array.isArray(e.tests)?e.tests:[e.tests]).some(i=>n.startsWith(i))}function Lz(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 tu=new Uint8ClampedArray(0);const kde={data:{type:"data",value:Pde,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=Cn(ot({},r),{fetch:Cn(ot({},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:G0(n,i),persistent:!1}),l=!0),l?o.subscribe({resourceId:n,onChange:c=>t.internalState.reloadAsyncProp(e,c),consumerId:t.id,requestId:e}):G0(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:ji.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 $0=(()=>{class n extends uue{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=nz(t,{viewport:i,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem}),[s,o,a]=YU(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=ot({},n);let{coordinateSystem:t}=n;const{viewport:i,coordinateOrigin:r,fromCoordinateSystem:s,fromCoordinateOrigin:o}=n;return t===ji.DEFAULT&&(t=i.isGeospatial?ji.LNGLAT:ji.CARTESIAN),void 0===s&&(e.fromCoordinateSystem=t),void 0===o&&(e.fromCoordinateOrigin=r),e.coordinateSystem=t,e}(e),{geospatialOrigin:l,shaderCoordinateOrigin:c,offsetMode:u}=BU(t,i,r),h=nz(n,{viewport:t,modelMatrix:s,coordinateSystem:o,coordinateOrigin:a,offsetMode:u});u&&function(n,e,t){n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2]}(h,h,t.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===ji.DEFAULT||t===ji.LNGLAT||t===ji.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){pc(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=zle(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 u of c)o.invalidateAll(u);else o.invalidateAll()}const l=i.highlightedObjectIndex>=0||i.pickable;if((t.highlightedObjectIndex>=0||t.pickable)!==l&&o){const{pickingColors:c,instancePickingColors:u}=o.attributes,h=c||u;h&&(l&&h.constant&&(h.constant=!1,o.invalidate(h.id)),!h.value&&!l&&(h.constant=!0,h.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||!Fde({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(tu.length/3);if(this.internalState.usesPickingColorCache=!0,rBz&&Ri.warn("Layer has too many data objects. Picking might not be able to distinguish all objects.")(),tu=x0.allocate(tu,i,{size:3,copy:!0,maxCount:Math.max(i,Bz)});const s=Math.floor(tu.length/3),o=[];for(let a=r;a{const c={moduleParameters:t,uniforms:i,parameters:r,context:this.context};for(const u of this.props.extensions)u.draw.call(this,c,u);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&&To("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=IU({newProps:n,oldProps:e,propTypes:GI(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&&OU(n,e,"all"))return{all:!0};const t={};let i=!1;for(const r in n.updateTriggers)"all"!==r&&OU(n,e,r)&&(t[r]=!0,i=t);return i}(n,e)),{dataChanged:i,propsChanged:t,updateTriggersChanged:r,extensionsChanged:Fle(n,e),transitionsChanged:Rle(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=GI(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 Sle(this.context.gl,{id:this.props.id,stats:this.context.stats,timeline:this.context.timeline})}_initState(){pc(!this.internalState&&!this.state),pc(isFinite(this.props.coordinateSystem));const t=this._getAttributeManager();t&&t.addInstanced({instancePickingColors:{type:5121,size:3,noAlloc:!0,update:this.calculateInstancePickingColors}}),this.internalState=new due({attributeManager:t,layer:this}),this.clearChangeFlags(),this.state={},Object.defineProperty(this.state,"attributeManager",{get:()=>(Ri.deprecated("layer.state.attributeManager","layer.getAttributeManager()"),t)}),this.internalState.layer=this,this.internalState.uniformTransitions=new Mle(this.context.timeline),this.internalState.onAsyncPropUpdated=this._onAsyncPropUpdated.bind(this),this.internalState.setAsyncProps(this.props)}_transferState(t){To("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=kde,n})(),jz=(()=>{class n extends $0{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:u,coordinateSystem:h,coordinateOrigin:p,wrapLongitude:g,positionFormat:m,modelMatrix:w,extensions:C,fetch:H,_subLayerProps:U}=this.props,de={opacity:i,pickable:r,visible:s,parameters:o,getPolygonOffset:a,highlightedObjectIndex:l,autoHighlight:c,highlightColor:u,coordinateSystem:h,coordinateOrigin:p,wrapLongitude:g,positionFormat:m,modelMatrix:w,extensions:C,fetch:H},Ae=U&&U[t.id],Pe=Ae&&Ae.updateTriggers,Be=t.id||"sublayer";if(Ae){const et=this.constructor._propTypes,wt=t.type?t.type._propTypes:{};for(const vt in Ae){const Ct=wt[vt]||et[vt];Ct&&"accessor"===Ct.type&&(Ae[vt]=this.getSubLayerAccessor(Ae[vt]))}}Object.assign(de,t,Ae),de.id="".concat(this.props.id,"-").concat(Be),de.updateTriggers=ot(ot({all:this.props.updateTriggers.all},t.updateTriggers),Pe);for(const et of C){const wt=et.getSubLayerProps.call(this,et);wt&&Object.assign(de,wt,{updateTriggers:Object.assign(de.updateTriggers,wt.updateTriggers)})}return de}_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=EI(t,Boolean),this.internalState.subLayers=t),To("compositeLayer.renderLayers",this,i,t);for(const r of t)r.parent=this}}return n.layerName="CompositeLayer",n})();const Bde=/([0-9]+\.?[0-9]*)(%|px)/;function qS(n){switch(typeof n){case"number":return{position:n,relative:!1};case"string":const e=n.match(Bde);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 YS(n,e){return n.relative?Math.round(n.position*e):n.position}function W0(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)&&W0(i,r)))return!1}return!0}class jO{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:u=1e3,modelMatrix:h=null,viewportInstance:p=null,type:g=Jg}=e;pc(!p||p instanceof Jg),this.viewportInstance=p,this.id=t||this.constructor.displayName||"view",this.type=g,this.props=Cn(ot({},e),{id:this.id,projectionMatrix:a,fovy:l,near:c,far:u,modelMatrix:h}),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):W0(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=ot({},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:YS(this._x,e),y:YS(this._y,t),width:YS(this._width,e),height:YS(this._height,t)}}_getControllerProps(e){let t=this.props.controller;return t?!0===t?e:("function"==typeof t&&(t={type:t}),ot(ot({},e),t)):null}_getViewport(e,t){const{type:i}=this;return new i(ot(ot(ot({},e),this.props),t))}_parseDimensions({x:e,y:t,width:i,height:r}){this._x=qS(e),this._y=qS(t),this._width=qS(i),this._height=qS(r)}}const q0=()=>{},Vz={transitionEasing:n=>n,transitionInterruption:1,onTransitionStart:q0,onTransitionInterrupt:q0,onTransitionEnd:q0};class jde{constructor(e,t={}){this.ControllerState=e,this.props=ot(ot({},Vz),t),this.propsInTransition=null,this.transition=new F0(t.timeline),this.onViewStateChange=t.onViewStateChange||q0,this.onStateChange=t.onStateChange||q0,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=ot(ot({},Vz),e),this.props=e,this._shouldIgnoreViewportChange(i,e))return t;if(this._isTransitionEnabled(e)){const{interruption:r,endProps:s}=this.transition.settings,o=ot(ot({},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(ot(ot({},this.props),c)).getViewportProps(),this.onViewStateChange({viewState:this.propsInTransition,oldViewState:this.props})}}const Uz=["longitude","latitude","zoom","bearing","pitch"],Ude=["longitude","latitude","zoom"];class zz 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)||!C0(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];pc(Number.isFinite(i)||Array.isArray(i),"".concat(t," is required for transition"))})}}{constructor(e={}){super((Array.isArray(e)?e:e.transitionProps)||{compare:Uz,extract:Uz,required:Ude}),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]=yS(e[s]||0,t[s]||0,i);if(t.aroundPosition){const s=this.opts.makeViewport(ot(ot({},t),r));Object.assign(r,s.panByPosition(t.aroundPosition,yS(e.around,t.around,i)))}return r}}const dh={transitionDuration:0},zde={transitionDuration:300,transitionEasing:n=>n,transitionInterruption:1},XS=n=>1-(1-n)*(1-n),tm_WHEEL=["wheel"],tm_PAN=["panstart","panmove","panend"],tm_PINCH=["pinchstart","pinchmove","pinchend"],tm_TRIPLE_PAN=["tripanstart","tripanmove","tripanend"],tm_DOUBLE_TAP=["doubletap"],tm_KEYBOARD=["keydown"];class VO{constructor(e,t={}){this.ControllerState=e,this.controllerState=null,this.controllerStateProps=null,this.eventManager=null,this.transitionManager=new jde(e,Cn(ot({},t),{onViewStateChange:this._onTransition.bind(this),onStateChange:this._setInteractionState.bind(this)}));const i=this.linearTransitionProps;this._transition=i&&Cn(ot({},zde),{transitionInterpolator:new zz({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(ot(ot({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,u=Boolean(this.onViewStateChange);this.toggleEvents(tm_WHEEL,u&&i),this.toggleEvents(tm_PAN,u&&(r||s)),this.toggleEvents(tm_PINCH,u&&(a||l)),this.toggleEvents(tm_TRIPLE_PAN,u&&l),this.toggleEvents(tm_DOUBLE_TAP,u&&o),this.toggleEvents(tm_KEYBOARD,u&&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=ot(ot({},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,dh,{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,dh,{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,Cn(ot({},this._getTransitionProps()),{transitionDuration:t,transitionEasing:XS}),{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,dh,{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,Cn(ot({},this._getTransitionProps()),{transitionDuration:t,transitionEasing:XS}),{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,Cn(ot({},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,dh,{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,dh,{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,Cn(ot({},this._getTransitionProps()),{transitionDuration:t,transitionEasing:XS}),{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,dh,{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,dh,{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,Cn(ot({},this._getTransitionProps({around:r})),{transitionDuration:t,transitionEasing:XS}),{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?Cn(ot({},t),{transitionInterpolator:new zz(Cn(ot({},e),{transitionProps:this.linearTransitionProps,makeViewport:this.controllerState.makeViewport}))}):t:dh}}class Hz{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 hh_target=[0,0,0];class QS extends Hz{constructor({makeViewport:e,width:t,height:i,rotationX:r=0,rotationOrbit:s=0,target:o=hh_target,zoom:a=0,minRotationX:l=-90,maxRotationX:c=90,minZoom:u=-(1/0),maxZoom:h=Infinity,startPanPosition:p,startRotatePos:g,startRotationX:m,startRotationOrbit:w,startZoomPosition:C,startZoom:H}){super({width:t,height:i,rotationX:r,rotationOrbit:s,target:o,zoom:a,minRotationX:l,maxRotationX:c,minZoom:u,maxZoom:h}),this._state={startPanPosition:p,startRotatePos:g,startRotationX:m,startRotationOrbit:w,startZoomPosition:C,startZoom:H},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 u=(e[0]-r[0])/a;(s<-90||s>90)&&(u*=-1),c={rotationX:s+(e[1]-r[1])/l*180,rotationOrbit:o+180*u}}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=ot({},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(Cn(ot({},this._viewportProps),{zoom:a}));return this._getUpdatedState(ot({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),Va(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 QS(ot(ot(ot({},this._viewportProps),this._state),e))}_applyConstraints(e){const{maxZoom:t,minZoom:i,zoom:r,maxRotationX:s,minRotationX:o,rotationOrbit:a}=e;return e.zoom=Va(r,i,t),e.rotationX=Va(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 Gde extends VO{constructor(e){super(QS,e)}get linearTransitionProps(){return["target","zoom","rotationX","rotationOrbit"]}}class $de extends VO{constructor(e){e.dragMode=e.dragMode||"pan",super(QS,e)}_onPanRotate(e){return!1}get linearTransitionProps(){return["target","zoom"]}}const Wde=(new qn).lookAt({eye:[0,0,1]});function qde({width:n,height:e,near:t,far:i}){return n=n||1,e=e||1,(new qn).ortho({left:-n/2,right:n/2,bottom:-e/2,top:e/2,near:t,far:i})}class Yde 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(Cn(ot({},e),{longitude:null,position:a,viewMatrix:Wde.clone().scale([c,c*(l?-1:1),c]),projectionMatrix:qde({width:t,height:i,near:r,far:s}),zoom:o}))}panByPosition(e,t){const r=BS([],e,jU([],L0(t,this.pixelUnprojectionMatrix)));return{target:BS([],this.center,r)}}}let Kde=(()=>{class n extends jO{constructor(t){super(Cn(ot({},t),{type:Yde}))}get controller(){return this._getControllerProps({type:$de})}}return n.displayName="OrthographicView",n})();const ZS=Math.PI/180;function Xde({height:n,fovy:e,orbitAxis:t,rotationX:i,rotationOrbit:r,zoom:s}){const o=.5/Math.tan(e*ZS/2),a="Z"===t?[0,0,1]:[0,1,0],l="Z"===t?[0,-o,0]:[0,0,o],c=(new qn).lookAt({eye:l,up:a});c.rotateX(i*ZS),"Z"===t?c.rotateZ(r*ZS):c.rotateY(r*ZS);const u=Math.pow(2,s)/(n||1);return c.scale(u),c}class Qde 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(Cn(ot({},e),{longitude:null,viewMatrix:Xde({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]=L0([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 Zde=(()=>{class n extends jO{constructor(t={}){const{orbitAxis:i="Z"}=t;super(Cn(ot({},t),{orbitAxis:i,type:Qde}))}get controller(){return this._getControllerProps({type:Gde})}}return n.displayName="OrbitView",n})();const Jde=[255,255,255],ehe=1;let the=0;class Gz{constructor(e={}){const{color:t=Jde}=e,{intensity:i=ehe}=e;this.id=e.id||"ambient-".concat(the++),this.color=t,this.intensity=i,this.type="ambient"}}const nhe=[255,255,255],ihe=1,rhe=[0,0,-1];let she=0;class $z{constructor(e={}){const{color:t=nhe}=e,{intensity:i=ihe}=e,{direction:r=rhe}=e,{_shadow:s=!1}=e;this.id=e.id||"directional-".concat(she++),this.color=t,this.intensity=i,this.type="directional",this.direction=new Ao(r).normalize().toArray(),this.shadow=s}getProjectedLight(){return this}}class Wz{constructor(e={}){const{id:t="effect"}=e;this.id=t,this.props=ot({},e)}preRender(){}getModuleParameters(){}cleanup(){}}class UO extends class{constructor(e,t={}){const{id:i="pass"}=t;this.id=i,this.gl=e,this.props=ot({},t)}setProps(e){Object.assign(this.props,e)}render(){}cleanup(){}}{render(e){return $u(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){$u(n,{viewport:[0,0,n.drawingBufferWidth,n.drawingBufferHeight]}),n.clear(16640)}(o);const a=[];for(const l of t){const c=l.viewport||l,u=i&&i[c.id];r(c);const h=this._getDrawLayerParams(c,e);e.view=u;const p=c.subViewports||[c];for(const g of p){e.viewport=g;const m=this._drawLayersInViewport(o,e,h);a.push(m)}}return a}_getDrawLayerParams(e,{layers:t,pass:i,layerFilter:r,effects:s,moduleParameters:o}){const a=[],l=qz(),c={viewport:e,isPicking:i.startsWith("picking"),renderPass:i};for(let u=0;uhI(e,c))}const l={totalCount:t.length,visibleCount:0,compositeCount:0,pickableCount:0};$u(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 u=t[l]=t[l]||qz(e[l],e);c=u(r,s),t[a]=u}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 che extends UO{constructor(e,t){super(e,t),this.shadowMap=new _a(e,{width:1,height:1,parameters:{10241:9729,10240:9729,10242:33071,10243:33071}}),this.depthBuffer=new zg(e,{format:33189,width:1,height:1}),this.fbo=new Fs(e,{id:"shadowmap",width:1,height:1,attachments:{36064:this.shadowMap,36096:this.depthBuffer}})}render(e){const t=this.fbo;fc(this.gl,{depthRange:[0,1],depthTest:!0,blend:!1,clearColor:[1,1,1,1]},()=>{const i=e.viewports[0],r=jg(this.gl),s=i.width*r,o=i.height*r;(s!==t.width||o!==t.height)&&t.resize({width:s,height:o}),super.render(Cn(ot({},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 dhe=Object.keys(ji).map(n=>"const int COORDINATE_SYSTEM_".concat(n," = ").concat(ji[n],";")).join(""),hhe=Object.keys(Kc).map(n=>"const int PROJECTION_MODE_".concat(n," = ").concat(Kc[n],";")).join(""),fhe="".concat(dhe,"\n").concat(hhe,"\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"),phe={},zO={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:fhe,getUniforms:function(n=phe){return n.viewport?function({viewport:n,devicePixelRatio:e=1,modelMatrix:t=null,coordinateSystem:i=ji.DEFAULT,coordinateOrigin:r,autoWrapLongitude:s=!1}={}){i===ji.DEFAULT&&(i=n.isGeospatial?ji.LNGLAT:ji.CARTESIAN);const o=_ce({viewport:n,devicePixelRatio:e,coordinateSystem:i,coordinateOrigin:r});return o.project_uWrapLongitude=s,o.project_uModelMatrix=t||pce,o}(n):{}}},yhe=PS(function({viewport:n,center:e}){return new qn(n.viewProjectionMatrix).invert().transform(e)}),bhe=PS(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=L0([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 Ao(n.center).negate()),l=s.map(u=>a.transform(u)),c=(new qn).ortho({left:Math.min(...l.map(u=>u[0])),right:Math.max(...l.map(u=>u[0])),bottom:Math.min(...l.map(u=>u[1])),top:Math.max(...l.map(u=>u[1])),near:Math.min(...l.map(u=>-u[2])),far:Math.max(...l.map(u=>-u[2]))});t.push(c.multiplyRight(o))}return t}),vhe=[0,0,0,1],whe=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0],HO={name:"shadow",dependencies:[zO],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||vhe,shadow_uLightId:n.shadowLightId||0,shadow_uLightCount:n.shadowMatrices.length},i=yhe({viewport:n.viewport,center:e.project_uCenter}),r=[],s=bhe({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{}}},Ahe={color:[255,255,255],intensity:1},Yz=[{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 GO extends Wz{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=N0.getDefaultProgramManager(e),HO&&this.programManager.addDefaultModule(HO)),this.dummyShadowMap||(this.dummyShadowMap=new _a(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(HO),this.programManager=null)}_createLightMatrix(){const e=[];for(const t of this.directionalLights){const i=(new qn).lookAt({eye:new Ao(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=Dhe++;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 Ihe{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=G0(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 Ohe{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 Ihe(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 Rhe=[{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"},zO],Nhe=["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 Phe(n){const e=N0.getDefaultProgramManager(n);for(const t of Rhe)e.addDefaultModule(t);for(const t of Nhe)e.addShaderHook(t);return e}const Lhe=Object.seal({layerManager:null,resourceManager:null,deck:null,gl:null,stats:null,shaderCache:null,pickingFBO:null,mousePosition:null,userData:{}});class Bhe{constructor(e,{deck:t,stats:i,viewport:r,timeline:s}={}){this.lastRenderedLayers=[],this.layers=[],this.resourceManager=new Ohe({gl:e,protocol:"deck://"}),this.context=Cn(ot({},Lhe),{layerManager:this,gl:e,deck:t,programManager:e&&Phe(e),stats:i||new sI({id:"deck.gl"}),viewport:r||new Jg({id:"DEFAULT-INITIAL-VIEWPORT"}),timeline:s||new Kz,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){To("layerManager.setLayers",this,t,e),this.lastRenderedLayers=e,e=EI(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 To("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]?Ri.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&&Ri.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 jhe{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=EI(e,Boolean),this._diffViews(e,this.views)&&this.setNeedsUpdate("views changed"),this.views=e}_setViewState(e){e?(!W0(e,this.viewState)&&this.setNeedsUpdate("viewState changed"),this.viewState=e):Ri.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)(ot({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=Cn(ot(ot(ot({},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 u=r[a.id];a.controller&&!u&&(s=!0),(s||!a.controller)&&u&&(u.finalize(),u=null),this.controllers[a.id]=this._updateController(a,l,c,u),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 Uhe extends Hz{constructor({makeViewport:e,width:t,height:i,latitude:r,longitude:s,zoom:o,bearing:a=0,pitch:l=0,altitude:c=1.5,maxZoom:u=20,minZoom:h=0,maxPitch:p=60,minPitch:g=0,startPanLngLat:m,startZoomLngLat:w,startRotatePos:C,startBearing:H,startPitch:U,startZoom:de,normalize:Ae}={}){pc(Number.isFinite(s)),pc(Number.isFinite(r)),pc(Number.isFinite(o)),super({width:t,height:i,latitude:r,longitude:s,zoom:o,bearing:a,pitch:l,altitude:c,maxZoom:u,minZoom:h,maxPitch:p,minPitch:g,normalize:Ae}),this._state={startPanLngLat:m,startZoomLngLat:w,startRotatePos:C,startBearing:H,startPitch:U,startZoom:de},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(Cn(ot({},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(Cn(ot({},this._viewportProps),{zoom:o}));return this._getUpdatedState(ot({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=ot({},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(ot(ot(ot({makeViewport:this.makeViewport},this._viewportProps),this._state),e))}_applyConstraints(e){const{maxZoom:t,minZoom:i,zoom:r}=e;e.zoom=Va(r,i,t);const{maxPitch:s,minPitch:o,pitch:a}=e;e.pitch=Va(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=zU(t+180,360)-180),(o<-180||o>180)&&(o=zU(o+180,360)-180);const a=WI(e/512);if(r<=a)r=a,i=0;else{const l=e/2/Math.pow(2,r),c=Zg([0,l])[1];if(iu&&(i=u)}}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 Va(t+Math.log2(e),r,i)}_calculateNewPitchAndBearing({deltaScaleX:e,deltaScaleY:t,startBearing:i,startPitch:r}){t=Va(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 u=0;return r>0?Math.abs(l-o)>5&&(u=r/(o-l)*1.2):r<0&&o>5&&(u=1-s/o),u=Math.min(1,Math.max(-1,u)),{deltaScaleX:c,deltaScaleY:u}}}class zhe extends VO{constructor(e){e.dragMode=e.dragMode||"pan",super(Uhe,e)}setProps(e){const t=this.controllerStateProps;super.setProps(e),(!t||t.height!==e.height)&&this.updateViewport(new this.ControllerState(ot(ot({makeViewport:this.makeViewport},this.controllerStateProps),this._state)))}get linearTransitionProps(){return["longitude","latitude","zoom","bearing","pitch"]}}let Hhe=(()=>{class n extends jO{constructor(t){super(Cn(ot({},t),{type:tz}))}get controller(){return this._getControllerProps({type:zhe})}}return n.displayName="MapView",n})();const Ghe=new GO;class $he{constructor(){this.effects=[],this._internalEffects=[],this._needsRedraw="Initial render",this.setEffects()}setProps(e){"effects"in e&&(e.effects.length!==this.effects.length||!W0(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 GO)||this._internalEffects.push(Ghe)}}class Whe extends UO{}const Qz={blendFunc:[1,0,32771,0],blendEquation:32774};class Zz extends UO{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:u},pass:h="picking",redrawReason:p,pickZ:g}){const m=this.gl;return this.pickZ=g,fc(m,Cn(ot({scissorTest:!0,scissor:[a,l,c,u],clearColor:[0,0,0,0],depthMask:!0,depthTest:!0,depthRange:[0,1],colorMask:[!0,!0,!0,!0]},Qz),{blend:!g}),()=>{super.render({target:o,layers:e,layerFilter:t,views:i,viewports:r,onViewportActive:s,pass:h,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}:Cn(ot({},Qz),{blend:!0,blendColor:[0,0,0,this.useAlpha?(t+1)/255:1]});return ot(ot({},e.props.parameters),i)}}class Yhe{constructor(e){this.gl=e,this.layerFilter=null,this.drawPickingColors=!1,this.drawLayersPass=new Whe(e),this.pickLayersPass=new Zz(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||Fs.getDefaultFramebuffer(this.gl),this._preRender(e.effects,e);const i=this.lastPostProcessEffect?this.renderBuffers[0]:e.target,r=t.render(Cn(ot({},e),{target:i}));this._postRender(e.effects,e),this.renderCount++,To("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 Fs(this.gl),new Fs(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 Khe={pickedColor:null,pickedLayer:null,pickedObjectIndex:-1};function Xhe({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 u=r*r,h=-1,p=0;for(let g=0;gu)p+=4*l;else for(let C=0;C=0){const U=C+o-t,de=U*U+w;de<=u&&(u=de,h=p)}p+=4}}if(h>=0){const g=n[h+3]-1,m=n.slice(h,h+4),w=e[g];if(w){const C=w.decodePickingColor(m),H=Math.floor(h/4/l);return{pickedColor:m,pickedLayer:w,pickedObjectIndex:C,pickedX:o+(h/4-H*l),pickedY:a+H}}Ri.error("Picked non-existent layer. Is picking buffer corrupt?")()}}return Khe}function Jz({pickInfo:n,mode:e,viewports:t,layerFilter:i,pixelRatio:r,x:s,y:o,z:a}){const l=n&&n.pickedLayer,u=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)}))),h=u&&u.unproject([s-u.x,o-u.y],{targetZ:a});return{color:null,layer:null,viewport:u,index:-1,picked:!1,x:s,y:o,pixel:[s,o],coordinate:h,devicePixel:n&&[n.pickedX,n.pickedY],pixelRatio:r}}function Zhe(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 h=t.index,p=t.layerId,g=o&&o.props.id;if(g!==p||a!==h){if(g!==p){const m=r.find(w=>w.props.id===p);m&&l.unshift(m)}t.layerId=g,t.index=a,t.info=null}}const c=Jz(n),u=new Map;return u.set(null,c),l.forEach(h=>{let p=ot({},c);h===o&&(p.color=s,p.index=a,p.picked=!0),p=e4({layer:h,info:p,mode:i}),h===o&&"hover"===i&&(t.info=p),u.set(p.layer.id,p),"hover"===i&&p.layer.updateAutoHighlight(p)}),u}function e4({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 efe{constructor(e){this.gl=e,this.pickingFBO=null,this.pickLayersPass=new Zz(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],u=c&&c.unproject([e-c.x,t-c.y]),h={x:e,y:t,viewport:c,coordinate:u,layer:l};return l?ot(ot({},s),h):Object.assign(h,{color:null,object:null,index:-1})}_resizeBuffer(){const{gl:e}=this;return this.pickingFBO||(this.pickingFBO=new Fs(e),Fs.isSupported(e,{colorBufferFloat:!0})&&(this.depthFBO=new Fs(e),this.depthFBO.attach({36064:new _a(e,{format:Si(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?(Ri.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:u}){if(!(e=this._getPickable(e)))return{result:[],emptyInfo:Jz({viewports:i,x:r,y:s})};this._resizeBuffer();const h=jg(this.gl),p=nI(this.gl,[r,s],!0),g=[p.x+Math.floor(p.width/2),p.y+Math.floor(p.height/2)],m=Math.round(o*h),{width:w,height:C}=this.pickingFBO,H=this._getPickingRect({deviceX:g[0],deviceY:g[1],deviceRadius:m,deviceWidth:w,deviceHeight:C});let U;const de=[],Ae={};for(let Pe=0;Pe=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)}):Ri.error("Picked non-existent layer. Is picking buffer corrupt?")()}}}return Array.from(t.values())}({pickedColors:this._drawAndSample({layers:e,views:t,viewports:i,onViewportActive:u,deviceRect:{x:g,y:H,width:w.x+w.width-g,height:m-H},pass:"picking:".concat(l),redrawReason:l}),layers:e}),Pe=new Map,Be=Number.isFinite(c);for(let et=0;et=c);et++){const wt=Ae[et];let vt={color:wt.pickedColor,layer:null,index:wt.pickedObjectIndex,picked:!0,x:r,y:s,width:o,height:a,pixelRatio:h};vt=e4({layer:wt.pickedLayer,info:vt,mode:l}),Pe.has(vt.object)||Pe.set(vt.object,vt)}return Array.from(Pe.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:u,y:h,width:p,height:g}=s,m=new(l?Float32Array:Uint8Array)(p*g*4);return _S(c,{sourceX:u,sourceY:h,sourceWidth:p,sourceHeight:g,target:m}),m}_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 tfe={zIndex:1,position:"absolute",pointerEvents:"none",color:"#a0a7b4",backgroundColor:"#29323c",padding:"10px",top:0,left:0,display:"none"};class nfe{constructor(e){const t=e.parentElement;t&&(this.el=document.createElement("div"),this.el.className="deck-tooltip",Object.assign(this.el.style,tfe),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 t4(n,e){if(!n)throw new Error(e)}const nu={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},n4=nu.global||nu.self||nu.window,rfe="object"!=typeof process||"[object process]"!==String(process)||process.browser,i4="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version),{_parseImageNode:sfe}=(i4&&parseFloat(i4[1]),n4),$O="undefined"!=typeof Image,WO="undefined"!=typeof ImageBitmap,ofe=Boolean(sfe),qO=!!rfe||ofe;function r4(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 s4(n){switch(r4(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 cfe=/^data:image\/svg\+xml/,ufe=/\.svg((\?|#).*)?$/;function YO(n){return n&&(cfe.test(n)||ufe.test(n))}function dfe(n,e){if(YO(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 a4(n,e)}function a4(n,e){if(YO(e))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(n)])}function l4(n,e,t){return KO.apply(this,arguments)}function KO(){return(KO=oi(function*(n,e,t){const i=dfe(n,t),r=self.URL||self.webkitURL,s="string"!=typeof i&&r.createObjectURL(i);try{return yield hfe(s||i,e)}finally{s&&r.revokeObjectURL(s)}})).apply(this,arguments)}function hfe(n,e){return XO.apply(this,arguments)}function XO(){return(XO=oi(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 ffe={};let c4=!0;function pfe(n,e,t){return QO.apply(this,arguments)}function QO(){return(QO=oi(function*(n,e,t){let i;i=YO(t)?yield l4(n,e,t):a4(n,t);const r=e&&e.imagebitmap;return yield gfe(i,r)})).apply(this,arguments)}function gfe(n){return ZO.apply(this,arguments)}function ZO(){return(ZO=oi(function*(n,e=null){if((mfe(e)||!c4)&&(e=null),e)try{return yield createImageBitmap(n,e)}catch(t){console.warn(t),c4=!1}return yield createImageBitmap(n)})).apply(this,arguments)}function mfe(n){for(const e in n||ffe)return!1;return!0}const iu=!1,Y0=!0;function JO(n){const e=K0(n);return function(n){const e=K0(n);return e.byteLength>=24&&2303741511===e.getUint32(0,iu)?{mimeType:"image/png",width:e.getUint32(16,iu),height:e.getUint32(20,iu)}:null}(e)||function(n){const e=K0(n);if(!(e.byteLength>=3&&65496===e.getUint16(0,iu)&&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,iu)?{mimeType:"image/gif",width:e.getUint16(6,Y0),height:e.getUint16(8,Y0)}:null}(e)||function(n){const e=K0(n);return e.byteLength>=14&&16973===e.getUint16(0,iu)&&e.getUint32(2,Y0)===e.byteLength?{mimeType:"image/bmp",width:e.getUint32(18,Y0),height:e.getUint32(22,Y0)}:null}(e)}function K0(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 Efe(n,e){const{mimeType:t}=JO(n)||{},{_parseImageNode:i}=n4;return t4(i),i(n,t,e)}function eR(){return(eR=oi(function*(n,e,t){const r=((e=e||{}).image||{}).type||"auto",{url:s}=t||{};let a;switch(xfe(r)){case"imagebitmap":a=yield pfe(n,e,s);break;case"image":a=yield l4(n,e,s);break;case"data":a=yield Efe(n,e);break;default:t4(!1)}return"data"===r&&(a=s4(a)),a})).apply(this,arguments)}function xfe(n){switch(n){case"auto":case"data":return function(){if(WO)return"imagebitmap";if($O)return"image";if(qO)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}();default:return function(n){switch(n){case"auto":return WO||$O||qO;case"imagebitmap":return WO;case"image":return $O;case"data":return qO;default:throw new Error(`@loaders.gl/images: image ${n} not supported in this environment`)}}(n),n}}const tR={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 eR.apply(this,arguments)},tests:[n=>Boolean(JO(new DataView(n)))],options:{image:{type:"auto",decode:!0}}};var nm=Je(761);const Afe={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},X0="8.5.8",JS=nm.CO.deck&&nm.CO.deck.VERSION;if(JS&&JS!==X0)throw new Error("deck.gl - multiple versions detected: ".concat(JS," vs ").concat(X0));JS||(Ri.log(1,"deck.gl ".concat(X0))(),nm.CO.deck=Object.assign(nm.CO.deck||{},{VERSION:X0,version:X0,log:Ri,_registerLoggers:function(n){AI=n}}),Nz([Afe,[tR,{imagebitmap:{premultiplyAlpha:"none"}}]]));const Tfe=nm.CO.deck;class ex extends Wu{get[Symbol.toStringTag](){return"Query"}static isSupported(e,t=[]){const i=Si(e),r=vV(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 ex.isSupported(this.gl)?this.gl2.createQuery():null}_deleteHandle(){this.gl2.deleteQuery(this.handle)}}const u4=mS()&&"undefined"!=typeof document;let Lfe=0;class Bfe{constructor(e={}){const{onCreateContext:t=(C=>eV(C)),onAddHTML:i=null,onInitialize:r=(()=>{}),onRender:s=(()=>{}),onFinalize:o=(()=>{}),onError:a,gl:l=null,glOptions:c={},debug:u=!1,createFramebuffer:h=!1,autoResizeViewport:p=!0,autoResizeDrawingBuffer:g=!0,stats:m=If.get("animation-loop-"+Lfe++)}=e;let{useDevicePixels:w=!0}=e;"useDevicePixelRatio"in e&&(mn.deprecated("useDevicePixelRatio","useDevicePixels")(),w=e.useDevicePixelRatio),this.props={onCreateContext:t,onAddHTML:i,onInitialize:r,onRender:s,onFinalize:o,onError:a,gl:l,glOptions:c,debug:u,createFramebuffer:h},this.gl=l,this.needsRedraw=null,this.timeline=null,this.stats=m,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:w}),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=ex.isSupported(this.gl,["timers"])?new ex(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 oi(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 mn.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=u4?new Promise((e,t)=>{u4&&"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?rI(this.props.gl,e):this.onCreateContext(e),!pS(this.gl))throw new Error("AnimationLoop.onCreateContext - illegal context returned");(function(n){$u(n,tI)})(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)&&(mn.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)&&(mn.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 Fs(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 jfe=Je(524),tx=Je.n(jfe);const Vfe={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}))}}(tx().MouseInput);const Gfe=tx().Manager,ru=tx(),$fe=ru?[[ru.Pan,{event:"tripan",pointers:3,threshold:0,enable:!1}],[ru.Rotate,{enable:!1}],[ru.Pinch,{enable:!1}],[ru.Swipe,{enable:!1}],[ru.Pan,{threshold:0,enable:!1}],[ru.Press,{enable:!1}],[ru.Tap,{event:"doubletap",taps:2,enable:!1}],[ru.Tap,{event:"anytap",enable:!1}],[ru.Tap,{enable:!1}]]:null,f4={tripan:["rotate","pinch","pan"],rotate:["pinch"],pinch:["pan"],pan:["press","doubletap","anytap","tap"],doubletap:["anytap"],anytap:["tap"]},Wfe={doubletap:["tap"]},qfe={pointerdown:"pointerdown",pointermove:"pointermove",pointerup:"pointerup",touchstart:"pointerdown",touchmove:"pointermove",touchend:"pointerup",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup"},iR={KEY_EVENTS:["keydown","keyup"],MOUSE_EVENTS:["mousedown","mousemove","mouseup","mouseover","mouseout","mouseleave"],WHEEL_EVENTS:["wheel","mousewheel"]},Yfe={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"},p4={click:"tap",anyclick:"anytap",dblclick:"doubletap",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup",mouseover:"pointerover",mouseout:"pointerout",mouseleave:"pointerleave"},Kfe="undefined"!=typeof navigator&&navigator.userAgent?navigator.userAgent.toLowerCase():"",im="undefined"!=typeof window?window:global;"undefined"!=typeof global?global:window,"undefined"!=typeof document&&document;let g4=!1;try{const n={get passive(){return g4=!0,!0}};im.addEventListener("test",n,n),im.removeEventListener("test",n,n)}catch(n){}const Xfe=-1!==Kfe.indexOf("firefox"),{WHEEL_EVENTS:Qfe}=iR,_4=4.000244140625;class epe{constructor(e,t,i={}){this.element=e,this.callback=t,this.options=Object.assign({enable:!0},i),this.events=Qfe.concat(i.events||[]),this.handleEvent=this.handleEvent.bind(this),this.events.forEach(r=>e.addEventListener(r,this.handleEvent,!!g4&&{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;im.WheelEvent&&(Xfe&&e.deltaMode===im.WheelEvent.DOM_DELTA_PIXEL&&(t/=im.devicePixelRatio),e.deltaMode===im.WheelEvent.DOM_DELTA_LINE&&(t*=40));const i={x:e.clientX,y:e.clientY};0!==t&&t%_4==0&&(t=Math.floor(t/_4)),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:tpe}=iR,y4="pointermove",b4="pointerover",v4="pointerout",w4="pointerleave";class npe{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=tpe.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===y4&&(this.enableMoveEvent=t),e===b4&&(this.enableOverEvent=t),e===v4&&(this.enableOutEvent=t),e===w4&&(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:b4,srcEvent:e,pointerType:"mouse",target:e.target})}handleOutEvent(e){this.enableOutEvent&&"mouseout"===e.type&&this.callback({type:v4,srcEvent:e,pointerType:"mouse",target:e.target})}handleLeaveEvent(e){this.enableLeaveEvent&&"mouseleave"===e.type&&this.callback({type:w4,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:y4,srcEvent:e,pointerType:"mouse",target:e.target});break;case"mouseup":this.pressed=!1}}}const{KEY_EVENTS:ipe}=iR,E4="keydown";class rpe{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=ipe.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===E4&&(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:E4,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 x4="contextmenu";class spe{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===x4&&(this.options.enable=t)}handleEvent(e){!this.options.enable||this.callback({type:x4,center:{x:e.clientX,y:e.clientY},srcEvent:e,pointerType:"mouse",target:e.target})}}const ope={pointerdown:1,pointermove:2,pointerup:4,mousedown:1,mousemove:2,mouseup:4},C4={srcElement:"root",priority:0};class ype{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({},C4,i):C4;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 u=l.length-1;for(;u>=0&&!(l[u].priority>=c.priority);)u--;l.splice(u+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&&f4[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 epe(e,this._onOtherEvent,{enable:!1}),this.moveInput=new npe(e,this._onOtherEvent,{enable:!1}),this.keyInput=new rpe(e,this._onOtherEvent,{enable:!1,tabIndex:t.tabIndex}),this.contextmenuInput=new spe(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=Wfe[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 u in e)this._addEventHandler(u,e[u],i,r,s);return}const{manager:o,events:a}=this,l=p4[e]||e;let c=a.get(l);c||(c=new ype(this),a.set(l,c),c.recognizerName=Yfe[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(p4[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=qfe[t.type];i&&this.manager.emit(i,e)}_onOtherEvent(e){this.manager.emit(e.type,e)}}function Lf(){}const A4={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:Lf,onResize:Lf,onViewStateChange:Lf,onInteractionStateChange:Lf,onBeforeRender:Lf,onAfterRender:Lf,onLoad:Lf,onError:(n,e)=>Ri.error(n)(),_onMetrics:null,getCursor:({isDragging:n})=>n?"grabbing":"grab",debug:!1,drawPickingColors:!1};class ix{constructor(e){e=ot(ot({},A4),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&&Ri.warn("View state tracking is disabled. Use either `initialViewState` for auto update or `viewState` for manual update.")(),"IE"===(0,nm.qs)()&&Ri.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 sI({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&&x0.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&&Ri.removed("onLayerHover","onHover")(),"onLayerClick"in e&&Ri.removed("onLayerClick","onClick")(),e.initialViewState&&!W0(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](ot({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),pc(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:u,autoResizeDrawingBuffer:h}=e;return new Bfe({width:t,height:i,useDevicePixels:u,autoResizeDrawingBuffer:h,autoResizeViewport:!1,gl:r,onCreateContext:p=>eV(Cn(ot(ot({},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 Hhe({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,rI(e,{enable:!0,copyState:!0})),this.tooltip=new nfe(this.canvas),$u(e,{blend:!0,blendFunc:[770,771,1,771],polygonOffsetFill:!0,depthTest:!0,depthFunc:515}),this.props.onWebGLInitialized(e);const t=new Kz;t.play(),this.animationLoop.attachTimeline(t),this.eventManager=new vpe(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 Bj)this.eventManager.on(r,this._onEvent);this.viewManager=new jhe({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 Bhe(e,{deck:this,stats:this.stats,viewport:i,timeline:t}),this.effectManager=new $he,this.deckRenderer=new Yhe(e),this.deckPicker=new efe(e),this.setProps(this.props),this._updateCanvasSize(),this.props.onLoad()}_drawLayers(e,t){const{gl:i}=this.layerManager.context;$u(i,this.props.parameters),this.props.onBeforeRender({gl:i}),this.deckRenderer.renderLayers(ot({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(),Ri.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=Cn(ot({},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=Bj[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=If.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}}ix.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(Wz)),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}},ix.defaultProps=A4,ix.VERSION=Tfe.VERSION;const rx={name:"project32",dependencies:[zO],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"},xpe={pickingSelectedColor:null,pickingHighlightColor:new Uint8Array([0,255,255,255]),pickingActive:!1,pickingAttribute:!1},sx=ot({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=xpe){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}}),T4={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6};class fh{static get DRAW_MODE(){return T4}constructor(e={}){const{id:t=ga("geometry"),drawMode:i=T4.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?ot({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 M4=()=>{},Ipe={10241:9987,10240:9729,10242:33071,10243:33071};function Ope(n){return Math.pow(2,Math.ceil(Math.log2(n)))}function Rpe(n,e,t,i){return t===e.width&&i===e.height?e:(n.canvas.height=i,n.canvas.width=t,n.clearRect(0,0,n.canvas.width,n.canvas.height),n.drawImage(e,0,0,e.width,e.height,0,0,t,i),n.canvas)}function Q0(n){return n&&(n.id||n.url)}function D4(n,e,t){for(let i=0;i0){const{mapping:i,xOffset:r,yOffset:s,rowHeight:o,canvasHeight:a}=function({icons:n,buffer:e,mapping:t={},xOffset:i=0,yOffset:r=0,rowHeight:s=0,canvasWidth:o}){let a=[];for(let l=0;lo&&(D4(t,a,r),i=0,r=s+r+e,s=0,a=[]),a.push({icon:c,xOffset:i}),i=i+p+e,s=Math.max(s,h)}}return a.length>0&&D4(t,a,r),{mapping:t,rowHeight:s,xOffset:i,yOffset:r,canvasWidth:o,canvasHeight:Ope(s+r+e)}}({icons:t,buffer:this._buffer,canvasWidth:this._canvasWidth,mapping:this._mapping,rowHeight:this._rowHeight,xOffset:this._xOffset,yOffset:this._yOffset});this._rowHeight=o,this._mapping=i,this._xOffset=r,this._yOffset=s,this._canvasHeight=a,this._texture||(this._texture=new _a(this.gl,{width:this._canvasWidth,height:this._canvasHeight,parameters:Ipe})),this._texture.height!==this._canvasHeight&&(this._texture=function(n,e,t,i){const r=e.width,s=e.height,o=_V(e,{width:t,height:i});return function(n,e,t={}){const{sourceX:i=0,sourceY:r=0,targetMipmaplevel:s=0,targetInternalFormat:o=6408}=t;let{targetX:a,targetY:l,targetZ:c,width:u,height:h}=t;const{framebuffer:p,deleteFramebuffer:g}=S0(n);tn(p);const{gl:m,handle:w}=p,C=void 0!==a||void 0!==l||void 0!==c;a=a||0,l=l||0,c=c||0;const H=m.bindFramebuffer(36160,w);tn(e);let U=null;if(e instanceof Of&&(U=e,u=Number.isFinite(u)?u:U.width,h=Number.isFinite(h)?h:U.height,U.bind(0),e=U.target),C)switch(e){case 3553:case 34067:m.copyTexSubImage2D(e,s,a,l,i,r,u,h);break;case 35866:case 32879:Co(m).copyTexSubImage3D(e,s,a,l,c,i,r,u,h)}else m.copyTexImage2D(e,s,o,i,r,u,h,0);U&&U.unbind(),m.bindFramebuffer(36160,H||null),g&&p.delete()}(e,o,{targetY:0,width:r,height:s}),e.delete(),o}(0,this._texture,this._canvasWidth,this._canvasHeight)),this.onUpdate(),this._loadIcons(t)}}_loadIcons(e){const t=this._canvas.getContext("2d");for(const i of e)this._pendingCount++,G0(i.url,tR,this._loadOptions).then(r=>{const s=Q0(i),{x:o,y:a,width:l,height:c}=this._mapping[s],u=Rpe(t,r,l,c);this._texture.setSubImageData({data:u,x:o,y:a,width:l,height:c}),this._texture.generateMipmap(),this.onUpdate()}).catch(r=>{this.onError({url:i.url,source:i.source,sourceIndex:i.sourceIndex,loadOptions:this._loadOptions,error:r})}).finally(()=>{this._pendingCount--})}}const I4=[0,0,0,255],Lpe={iconAtlas:{type:"image",value:null,async:!0},iconMapping:{type:"object",value:{},async:!0},sizeScale:{type:"number",value:1,min:0},billboard:!0,sizeUnits:"pixels",sizeMinPixels:{type:"number",min:0,value:0},sizeMaxPixels:{type:"number",min:0,value:Number.MAX_SAFE_INTEGER},alphaCutoff:{type:"number",value:.05,min:0,max:1},getPosition:{type:"accessor",value:n=>n.position},getIcon:{type:"accessor",value:n=>n.icon},getColor:{type:"accessor",value:I4},getSize:{type:"accessor",value:1},getAngle:{type:"accessor",value:0},getPixelOffset:{type:"accessor",value:[0,0]},onIconError:{type:"function",value:null,compare:!1,optional:!0}};let Bpe=(()=>{class n extends $0{getShaders(){return super.getShaders({vs:"#define SHADER_NAME icon-layer-vertex-shader\n\nattribute vec2 positions;\n\nattribute vec3 instancePositions;\nattribute vec3 instancePositions64Low;\nattribute float instanceSizes;\nattribute float instanceAngles;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\nattribute vec4 instanceIconFrames;\nattribute float instanceColorModes;\nattribute vec2 instanceOffsets;\nattribute vec2 instancePixelOffset;\n\nuniform float sizeScale;\nuniform vec2 iconsTextureDim;\nuniform float sizeMinPixels;\nuniform float sizeMaxPixels;\nuniform bool billboard;\n\nvarying float vColorMode;\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\nvarying vec2 uv;\n\nvec2 rotate_by_angle(vec2 vertex, float angle) {\n float angle_radian = angle * PI / 180.0;\n float cos_angle = cos(angle_radian);\n float sin_angle = sin(angle_radian);\n mat2 rotationMatrix = mat2(cos_angle, -sin_angle, sin_angle, cos_angle);\n return rotationMatrix * vertex;\n}\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n geometry.uv = positions;\n geometry.pickingColor = instancePickingColors;\n uv = positions;\n\n vec2 iconSize = instanceIconFrames.zw;\n float sizePixels = clamp(\n project_size_to_pixel(instanceSizes * sizeScale), \n sizeMinPixels, sizeMaxPixels\n );\n float instanceScale = iconSize.y == 0.0 ? 0.0 : sizePixels / iconSize.y;\n vec2 pixelOffset = positions / 2.0 * iconSize + instanceOffsets;\n pixelOffset = rotate_by_angle(pixelOffset, instanceAngles) * instanceScale;\n pixelOffset += instancePixelOffset;\n pixelOffset.y *= -1.0;\n\n if (billboard) {\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, vec3(0.0), geometry.position);\n vec3 offset = vec3(pixelOffset, 0.0);\n DECKGL_FILTER_SIZE(offset, geometry);\n gl_Position.xy += project_pixel_size_to_clipspace(offset.xy);\n\n } else {\n vec3 offset_common = vec3(project_pixel_size(pixelOffset), 0.0);\n DECKGL_FILTER_SIZE(offset_common, geometry);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, offset_common, geometry.position); \n }\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n vTextureCoords = mix(\n instanceIconFrames.xy,\n instanceIconFrames.xy + iconSize,\n (positions.xy + 1.0) / 2.0\n ) / iconsTextureDim;\n\n vColor = instanceColors;\n DECKGL_FILTER_COLOR(vColor, geometry);\n\n vColorMode = instanceColorModes;\n}\n",fs:"#define SHADER_NAME icon-layer-fragment-shader\n\nprecision highp float;\n\nuniform float opacity;\nuniform sampler2D iconsTexture;\nuniform float alphaCutoff;\n\nvarying float vColorMode;\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\nvarying vec2 uv;\n\nvoid main(void) {\n geometry.uv = uv;\n\n vec4 texColor = texture2D(iconsTexture, vTextureCoords);\n vec3 color = mix(texColor.rgb, vColor.rgb, vColorMode);\n float a = texColor.a * opacity * vColor.a;\n\n if (a < alphaCutoff) {\n discard;\n }\n\n gl_FragColor = vec4(color, a);\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:[rx,sx]})}initializeState(){this.state={iconManager:new kpe(this.context.gl,{onUpdate:this._onUpdate.bind(this),onError:this._onError.bind(this)})},this.getAttributeManager().addInstanced({instancePositions:{size:3,type:5130,fp64:this.use64bitPositions(),transition:!0,accessor:"getPosition"},instanceSizes:{size:1,transition:!0,accessor:"getSize",defaultValue:1},instanceOffsets:{size:2,accessor:"getIcon",transform:this.getInstanceOffset},instanceIconFrames:{size:4,accessor:"getIcon",transform:this.getInstanceIconFrame},instanceColorModes:{size:1,type:5121,accessor:"getIcon",transform:this.getInstanceColorMode},instanceColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:!0,accessor:"getColor",defaultValue:I4},instanceAngles:{size:1,transition:!0,accessor:"getAngle"},instancePixelOffset:{size:2,transition:!0,accessor:"getPixelOffset"}})}updateState({oldProps:t,props:i,changeFlags:r}){super.updateState({props:i,oldProps:t,changeFlags:r});const s=this.getAttributeManager(),{iconAtlas:o,iconMapping:a,data:l,getIcon:c}=i,{iconManager:u}=this.state;u.setProps({loadOptions:i.loadOptions});let h=!1;if(o||this.internalState.isAsyncPropLoading("iconAtlas")?(t.iconAtlas!==i.iconAtlas&&u.setProps({iconAtlas:o,autoPacking:!1}),t.iconMapping!==i.iconMapping&&(u.setProps({iconMapping:a}),h=!0)):u.setProps({autoPacking:!0}),(r.dataChanged||r.updateTriggersChanged&&(r.updateTriggersChanged.all||r.updateTriggersChanged.getIcon))&&u.setProps({data:l,getIcon:c}),h&&(s.invalidate("instanceOffsets"),s.invalidate("instanceIconFrames"),s.invalidate("instanceColorModes")),r.extensionsChanged){var g;const{gl:m}=this.context;null===(g=this.state.model)||void 0===g||g.delete(),this.state.model=this._getModel(m),s.invalidateAll()}}get isLoaded(){return super.isLoaded&&this.state.iconManager.isLoaded}finalizeState(){super.finalizeState(),this.state.iconManager.finalize()}draw({uniforms:t}){const{sizeScale:i,sizeMinPixels:r,sizeMaxPixels:s,sizeUnits:o,billboard:a,alphaCutoff:l}=this.props,{iconManager:c}=this.state,{viewport:u}=this.context,h=c.getTexture();h&&this.state.model.setUniforms(t).setUniforms({iconsTexture:h,iconsTextureDim:[h.width,h.height],sizeScale:i*("pixels"===o?u.metersPerPixel:1),sizeMinPixels:r,sizeMaxPixels:s,billboard:a,alphaCutoff:l}).draw()}_getModel(t){return new Yg(t,Cn(ot({},this.getShaders()),{id:this.props.id,geometry:new fh({drawMode:6,attributes:{positions:{size:2,value:new Float32Array([-1,-1,-1,1,1,1,1,-1])}}}),isInstanced:!0}))}_onUpdate(){this.setNeedsRedraw()}_onError(t){const{onIconError:i}=this.getCurrentLayer().props;i?i(t):Ri.error(t.error)()}getInstanceOffset(t){const i=this.state.iconManager.getIconMapping(t);return[i.width/2-i.anchorX||0,i.height/2-i.anchorY||0]}getInstanceColorMode(t){return this.state.iconManager.getIconMapping(t).mask?1:0}getInstanceIconFrame(t){const i=this.state.iconManager.getIconMapping(t);return[i.x||0,i.y||0,i.width||0,i.height||0]}}return n.layerName="IconLayer",n.defaultProps=Lpe,n})();const R4=[],Vpe={getIconOffsets:{type:"accessor",value:n=>n.offsets},alphaCutoff:.001,smoothing:.1,outlineWidth:0,outlineColor:{type:"color",value:[0,0,0,255]}};let Upe=(()=>{class n extends Bpe{getShaders(){return Cn(ot({},super.getShaders()),{fs:"#define SHADER_NAME multi-icon-layer-fragment-shader\n\nprecision highp float;\n\nuniform float opacity;\nuniform sampler2D iconsTexture;\nuniform float gamma;\nuniform bool sdf;\nuniform float alphaCutoff;\nuniform float buffer;\nuniform float outlineBuffer;\nuniform vec4 outlineColor;\n\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\nvarying vec2 uv;\n\nvoid main(void) {\n geometry.uv = uv;\n\n if (!picking_uActive) {\n float alpha = texture2D(iconsTexture, vTextureCoords).a;\n vec4 color = vColor;\n if (sdf) {\n float distance = alpha;\n alpha = smoothstep(buffer - gamma, buffer + gamma, distance);\n\n if (outlineBuffer > 0.0) {\n float inFill = alpha;\n float inBorder = smoothstep(outlineBuffer - gamma, outlineBuffer + gamma, distance);\n color = mix(outlineColor, vColor, inFill);\n alpha = inBorder;\n }\n }\n float a = alpha * color.a;\n \n if (a < alphaCutoff) {\n discard;\n }\n\n gl_FragColor = vec4(color.rgb, a * opacity);\n }\n\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n"})}initializeState(){super.initializeState(),this.getAttributeManager().addInstanced({instanceOffsets:{size:2,accessor:"getIconOffsets"},instancePickingColors:{type:5121,size:3,accessor:(i,{index:r,target:s})=>this.encodePickingColor(r,s)}})}updateState(t){super.updateState(t);const{props:i,oldProps:r}=t;let{outlineColor:s}=i;s!==r.outlineColor&&(s=s.map(o=>o/255),s[3]=Number.isFinite(s[3])?s[3]:1,this.setState({outlineColor:s})),!i.sdf&&i.outlineWidth&&Ri.warn("".concat(this.id,": fontSettings.sdf is required to render outline"))()}draw(t){const{sdf:i,smoothing:r,outlineWidth:s}=this.props,{outlineColor:o}=this.state;t.uniforms=Cn(ot({},t.uniforms),{buffer:.75,outlineBuffer:s?Math.max(r,.75*(1-s)):-1,gamma:r,sdf:Boolean(i),outlineColor:o}),super.draw(t)}getInstanceOffset(t){return t?Array.from(t).map(i=>super.getInstanceOffset(i)):R4}getInstanceColorMode(t){return 1}getInstanceIconFrame(t){return t?Array.from(t).map(i=>super.getInstanceIconFrame(i)):R4}}return n.layerName="MultiIconLayer",n.defaultProps=Vpe,n})();var zpe=Je(2),Hpe=Je.n(zpe);const $pe=[];function Wpe(n){return Math.pow(2,Math.ceil(Math.log2(n)))}function N4(n,e,t,i){let r=0;for(let s=e;si&&(oa){let h=N4(n,a,l,r);c+h>i&&(oi&&(h=P4(n,a,l,i,r,s),o=s[s.length-1])),a=l,c+=h}}(n,r,s,t,i,o),o}function Xpe(n,e,t,i,r,s){let o=0,a=0;for(let l=e;l0,u=[0,0],h=[];let p=0,g=0,m=0;for(let w=0;w<=s;w++){const C=n[w];if(("\n"===C||w===s)&&(m=w),m>g){const H=c?Kpe(n,t,i,r,g,m):$pe;for(let U=0;U<=H.length;U++){const de=0===U?g:H[U-1],Ae=Ui===e);t>=0&&this._order.splice(t,1)}_appendOrder(e){this._order.push(e)}}(3),nge=["fontFamily","fontWeight","characterSet","fontSize","sdf","buffer","cutoff","radius"];function rge(n,e){for(let t=0;t{o in e&&(this.props[o]=e[o])});const t=this._key;this._key=this._getKey();const i=function(n,e){const t=oR.get(n);if(!t)return e;const i=[];let s=Object.keys(t.mapping);s=new Set(s);let o=e;return o instanceof Array&&(o=new Set(o)),o.forEach(a=>{s.has(a)||i.push(a)}),i}(this._key,this.props.characterSet),r=oR.get(this._key);if(r&&0===i.length)return void(this._key!==t&&(this._atlas=r));const s=this._generateFontAtlas(this._key,i,r);this._atlas=s,oR.set(this._key,s)}_generateFontAtlas(e,t,i){const{fontFamily:r,fontWeight:s,fontSize:o,buffer:a,sdf:l,radius:c,cutoff:u}=this.props;let h=i&&i.data;h||(h=document.createElement("canvas"),h.width=1024);const p=h.getContext("2d");$4(p,r,o,s);const{mapping:g,canvasHeight:m,xOffset:w,yOffset:C}=function({characterSet:n,getFontWidth:e,fontHeight:t,buffer:i,maxCanvasWidth:r,mapping:s={},xOffset:o=0,yOffset:a=0}){let l=0,c=o,u=0;for(const p of n)if(!s[p]){const g=e(p,u++);c+g+2*i>r&&(c=0,l++),s[p]={x:c+i,y:a+l*(t+2*i)+i,width:g,height:t},c+=g+2*i}const h=t+2*i;return{mapping:s,xOffset:c,yOffset:a+l*h,canvasHeight:Wpe(a+(l+1)*h)}}(ot({getFontWidth:H=>p.measureText(H).width,fontHeight:1.2*o,buffer:a,characterSet:t,maxCanvasWidth:1024},i&&{mapping:i.mapping,xOffset:i.xOffset,yOffset:i.yOffset}));if(h.height!==m){const H=p.getImageData(0,0,h.width,h.height);h.height=m,p.putImageData(H,0,0)}if($4(p,r,o,s),l){const H=new(Hpe())(o,a,c,u,r,s),U=p.getImageData(0,0,H.size,H.size);for(const de of t)rge(H.draw(de),U),p.putImageData(U,g[de].x-a,g[de].y+a)}else for(const H of t)p.fillText(H,g[H].x,g[H].y+.9*o);return{xOffset:w,yOffset:C,mapping:g,data:h,width:h.width,height:h.height}}_getKey(){const{fontFamily:e,fontWeight:t,fontSize:i,buffer:r,sdf:s,radius:o,cutoff:a}=this.props;return s?"".concat(e," ").concat(t," ").concat(i," ").concat(r," ").concat(o," ").concat(a):"".concat(e," ").concat(t," ").concat(i," ").concat(r)}}const lge={billboard:!0,sizeScale:1,sizeUnits:"pixels",sizeMinPixels:0,sizeMaxPixels:Number.MAX_SAFE_INTEGER,padding:{type:"array",value:[0,0,0,0]},getPosition:{type:"accessor",value:n=>n.position},getSize:{type:"accessor",value:1},getAngle:{type:"accessor",value:0},getPixelOffset:{type:"accessor",value:[0,0]},getBoundingRect:{type:"accessor",value:[0,0,0,0]},getFillColor:{type:"accessor",value:[0,0,0,255]},getLineColor:{type:"accessor",value:[0,0,0,255]},getLineWidth:{type:"accessor",value:1}};let cge=(()=>{class n extends $0{getShaders(){return super.getShaders({vs:"#define SHADER_NAME text-background-layer-vertex-shader\n\nattribute vec2 positions;\n\nattribute vec3 instancePositions;\nattribute vec3 instancePositions64Low;\nattribute vec4 instanceRects;\nattribute float instanceSizes;\nattribute float instanceAngles;\nattribute vec2 instancePixelOffsets;\nattribute float instanceLineWidths;\nattribute vec4 instanceFillColors;\nattribute vec4 instanceLineColors;\nattribute vec3 instancePickingColors;\n\nuniform bool billboard;\nuniform float opacity;\nuniform float sizeScale;\nuniform float sizeMinPixels;\nuniform float sizeMaxPixels;\nuniform vec4 padding;\n\nvarying vec4 vFillColor;\nvarying vec4 vLineColor;\nvarying float vLineWidth;\nvarying vec2 uv;\nvarying vec2 dimensions;\n\nvec2 rotate_by_angle(vec2 vertex, float angle) {\n float angle_radian = radians(angle);\n float cos_angle = cos(angle_radian);\n float sin_angle = sin(angle_radian);\n mat2 rotationMatrix = mat2(cos_angle, -sin_angle, sin_angle, cos_angle);\n return rotationMatrix * vertex;\n}\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n geometry.uv = positions;\n geometry.pickingColor = instancePickingColors;\n uv = positions;\n vLineWidth = instanceLineWidths;\n float sizePixels = clamp(\n project_size_to_pixel(instanceSizes * sizeScale),\n sizeMinPixels, sizeMaxPixels\n );\n\n dimensions = instanceRects.zw * sizePixels + padding.xy + padding.zw;\n\n vec2 pixelOffset = (positions * instanceRects.zw + instanceRects.xy) * sizePixels + mix(-padding.xy, padding.zw, positions);\n pixelOffset = rotate_by_angle(pixelOffset, instanceAngles);\n pixelOffset += instancePixelOffsets;\n pixelOffset.y *= -1.0;\n\n if (billboard) {\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, vec3(0.0), geometry.position);\n vec3 offset = vec3(pixelOffset, 0.0);\n DECKGL_FILTER_SIZE(offset, geometry);\n gl_Position.xy += project_pixel_size_to_clipspace(offset.xy);\n } else {\n vec3 offset_common = vec3(project_pixel_size(pixelOffset), 0.0);\n DECKGL_FILTER_SIZE(offset_common, geometry);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, offset_common, geometry.position);\n }\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n vFillColor = vec4(instanceFillColors.rgb, instanceFillColors.a * opacity);\n DECKGL_FILTER_COLOR(vFillColor, geometry);\n vLineColor = vec4(instanceLineColors.rgb, instanceLineColors.a * opacity);\n DECKGL_FILTER_COLOR(vLineColor, geometry);\n}\n",fs:"#define SHADER_NAME text-background-layer-fragment-shader\n\nprecision highp float;\n\nuniform bool stroked;\n\nvarying vec4 vFillColor;\nvarying vec4 vLineColor;\nvarying float vLineWidth;\nvarying vec2 uv;\nvarying vec2 dimensions;\n\nvoid main(void) {\n geometry.uv = uv;\n\n vec2 pixelPosition = uv * dimensions;\n if (stroked) {\n float distToEdge = min(\n min(pixelPosition.x, dimensions.x - pixelPosition.x),\n min(pixelPosition.y, dimensions.y - pixelPosition.y)\n );\n float isBorder = smoothedge(distToEdge, vLineWidth);\n gl_FragColor = mix(vFillColor, vLineColor, isBorder);\n } else {\n gl_FragColor = vFillColor;\n }\n\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:[rx,sx]})}initializeState(){this.getAttributeManager().addInstanced({instancePositions:{size:3,type:5130,fp64:this.use64bitPositions(),transition:!0,accessor:"getPosition"},instanceSizes:{size:1,transition:!0,accessor:"getSize",defaultValue:1},instanceAngles:{size:1,transition:!0,accessor:"getAngle"},instanceRects:{size:4,accessor:"getBoundingRect"},instancePixelOffsets:{size:2,transition:!0,accessor:"getPixelOffset"},instanceFillColors:{size:4,transition:!0,normalized:!0,type:5121,accessor:"getFillColor",defaultValue:[0,0,0,255]},instanceLineColors:{size:4,transition:!0,normalized:!0,type:5121,accessor:"getLineColor",defaultValue:[0,0,0,255]},instanceLineWidths:{size:1,transition:!0,accessor:"getLineWidth",defaultValue:1}})}updateState({props:t,oldProps:i,changeFlags:r}){if(super.updateState({props:t,oldProps:i,changeFlags:r}),r.extensionsChanged){var s;const{gl:o}=this.context;null===(s=this.state.model)||void 0===s||s.delete(),this.state.model=this._getModel(o),this.getAttributeManager().invalidateAll()}}draw({uniforms:t}){const{viewport:i}=this.context,{billboard:r,sizeScale:s,sizeUnits:o,sizeMinPixels:a,sizeMaxPixels:l,getLineWidth:c}=this.props;let{padding:u}=this.props;const h="pixels"===o?i.metersPerPixel:1;u.length<4&&(u=[u[0],u[1],u[0],u[1]]),this.state.model.setUniforms(t).setUniforms({billboard:r,stroked:Boolean(c),padding:u,sizeScale:s*h,sizeMinPixels:a,sizeMaxPixels:l}).draw()}_getModel(t){return new Yg(t,Cn(ot({},this.getShaders()),{id:this.props.id,geometry:new fh({drawMode:6,vertexCount:4,attributes:{positions:{size:2,value:new Float32Array([0,0,1,0,1,1,0,1])}}}),isInstanced:!0}))}}return n.layerName="TextBackgroundLayer",n.defaultProps=lge,n})();const W4={fontSize:64,buffer:4,sdf:!1,radius:12,cutoff:.25,smoothing:.1},q4={start:1,middle:0,end:-1},Y4={top:1,center:0,bottom:-1},aR=[0,0,0,255],dge=["fontSize","buffer","sdf","radius","cutoff"],hge={billboard:!0,sizeScale:1,sizeUnits:"pixels",sizeMinPixels:0,sizeMaxPixels:Number.MAX_SAFE_INTEGER,background:!1,getBackgroundColor:{type:"accessor",value:[255,255,255,255]},getBorderColor:{type:"accessor",value:aR},getBorderWidth:{type:"accessor",value:0},backgroundPadding:{type:"array",value:[0,0,0,0]},characterSet:{type:"object",value:k4},fontFamily:L4,fontWeight:"normal",lineHeight:1,outlineWidth:{type:"number",value:0,min:0},outlineColor:{type:"color",value:aR},fontSettings:{},wordBreak:"break-word",maxWidth:{type:"number",value:-1},getText:{type:"accessor",value:n=>n.text},getPosition:{type:"accessor",value:n=>n.position},getColor:{type:"accessor",value:aR},getSize:{type:"accessor",value:32},getAngle:{type:"accessor",value:0},getTextAnchor:{type:"accessor",value:"middle"},getAlignmentBaseline:{type:"accessor",value:"center"},getPixelOffset:{type:"accessor",value:[0,0]},backgroundColor:{deprecatedFor:["background","getBackgroundColor"]}};let fge=(()=>{class n extends jz{initializeState(){this.state={styleVersion:0,fontAtlasManager:new sge}}updateState({props:t,oldProps:i,changeFlags:r}){const o=this.state.characterSet;(r.dataChanged||r.updateTriggersChanged&&(r.updateTriggersChanged.all||r.updateTriggersChanged.getText))&&this._updateText();const a=o!==this.state.characterSet||this._fontChanged(i,t);a&&this._updateFontAtlas(i,t),(a||t.lineHeight!==i.lineHeight||t.wordBreak!==i.wordBreak||t.maxWidth!==i.maxWidth)&&this.setState({styleVersion:this.state.styleVersion+1})}getPickingInfo({info:t}){return t.object=t.index>=0?this.props.data[t.index]:null,t}_updateFontAtlas(t,i){const{fontSettings:r,fontFamily:s,fontWeight:o}=i,{fontAtlasManager:a,characterSet:l}=this.state;a.setProps(Cn(ot(ot({},W4),r),{characterSet:l,fontFamily:s,fontWeight:o}))}_fontChanged(t,i){if(t.fontFamily!==i.fontFamily||t.fontWeight!==i.fontWeight)return!0;if(t.fontSettings===i.fontSettings)return!1;const r=t.fontSettings||{},s=i.fontSettings||{};return dge.some(o=>r[o]!==s[o])}_updateText(){const{data:t,characterSet:i}=this.props,r=t.attributes&&t.attributes.getText;let a,{getText:s}=this.props,{startIndices:o}=t;const l="auto"===i&&new Set;if(r&&o){const{texts:c,characterCount:u}=function({value:n,length:e,stride:t,offset:i,startIndices:r,characterSet:s}){const o=n.BYTES_PER_ELEMENT,a=t?t/o:1,l=i?i/o:0,c=r[e]||Math.ceil((n.length-l)/a),u=s&&new Set,h=new Array(e);let p=n;if(a>1||l>0){p=new n.constructor(c);for(let g=0;gc[p]}else{const{iterable:c,objectInfo:u}=ES(t);o=[0],a=0;for(const h of c){u.index++;const p=Array.from(s(h,u)||"");l&&p.forEach(l.add,l),a+=p.length,o.push(a)}}this.setState({getText:s,startIndices:o,numInstances:a,characterSet:l||i})}getBoundingRect(t,i){const r=this.state.fontAtlasManager.mapping,{getText:s}=this.state,{wordBreak:o,maxWidth:a,lineHeight:l,getTextAnchor:c,getAlignmentBaseline:u}=this.props,h=s(t,i)||"",{size:[p,g]}=F4(h,l,o,a,r);return[(q4["function"==typeof c?c(t,i):c]-1)*p/2,(Y4["function"==typeof u?u(t,i):u]-1)*g/2,p,g]}getIconOffsets(t,i){const r=this.state.fontAtlasManager.mapping,{getText:s}=this.state,{wordBreak:o,maxWidth:a,lineHeight:l,getTextAnchor:c,getAlignmentBaseline:u}=this.props,h=s(t,i)||"",{x:p,y:g,rowWidth:m,size:[w,C]}=F4(h,l,o,a,r),H=q4["function"==typeof c?c(t,i):c],U=Y4["function"==typeof u?u(t,i):u],de=p.length,Ae=new Array(2*de);let Pe=0;for(let Be=0;Bet*e/255)}const cR={name:"lights",vs:K4,fs:K4,getUniforms:function X4(n=pge){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?lR(n):[0,0,0],e.forEach((r,s)=>{i[`lighting_uPointLight[${s}].color`]=lR(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`]=lR(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 X4({lightSources:e})}return{}},defines:{MAX_LIGHTS:3}},mge={};const yge={name:"phong-lighting",dependencies:[cR],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=mge){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}}},uR=Math.PI/180,ox=new Float32Array(16),J4=new Float32Array(12);function e5(n,e,t){const i=e[0]*uR,r=e[1]*uR,s=e[2]*uR,o=Math.sin(s),a=Math.sin(i),l=Math.sin(r),c=Math.cos(s),u=Math.cos(i),h=Math.cos(r),p=t[0],g=t[1],m=t[2];n[0]=p*h*u,n[1]=p*l*u,n[2]=p*-a,n[3]=g*(-l*c+h*a*o),n[4]=g*(h*c+l*a*o),n[5]=g*u*o,n[6]=m*(l*o+h*a*c),n[7]=m*(-h*o+l*a*c),n[8]=m*u*c}function t5(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 n5={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,u=Array.isArray(s),h=Array.isArray(r),p=Array.isArray(o),g=c||!l&&Boolean(a(i[0]));n.constant=g?c:h&&u&&p;const m=n.value;if(n.constant){let w;g?(ox.set(a),w=t5(ox)):(w=J4,e5(w,r,s),w.set(o,9)),n.value=new Float32Array(w)}else{let w=e*n.size;const{iterable:C,objectInfo:H}=ES(i,e,t);for(const U of C){let de;H.index++,g?(ox.set(c?a:a(U,H)),de=t5(ox)):(de=J4,e5(de,h?r:r(U,H),u?s:s(U,H)),de.set(p?o:o(U,H),9)),m[w++]=de[0],m[w++]=de[1],m[w++]=de[2],m[w++]=de[3],m[w++]=de[4],m[w++]=de[5],m[w++]=de[6],m[w++]=de[7],m[w++]=de[8],m[w++]=de[9],m[w++]=de[10],m[w++]=de[11]}}}};function i5(n,e){return e===ji.CARTESIAN||e===ji.METER_OFFSETS||e===ji.DEFAULT&&!n.isGeospatial}function r5(n,e){(n.COLOR_0||n.colors)&&e||(n.colors={constant:!0,value:new Float32Array([1,1,1])}),Ri.assert(n.positions||n.POSITION,'no "postions" or "POSITION" attribute in mesh')}function wge(n,e){if(n.attributes)return r5(n.attributes,e),n instanceof fh?n:new fh(n);if(n.positions||n.POSITION)return r5(n,e),new fh({attributes:n});throw Error("Invalid mesh")}const Ege={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 Sge=(()=>{class n extends $0{getShaders(){const t=!Si(this.context.gl),i={};return gI(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:[rx,yge,sx],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:n5}),this.setState({emptyTexture:new _a(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||i5(i,s),flatShading:!this.state.hasNormals}).draw()}getModel(t){const i=new Yg(this.context.gl,Cn(ot({},this.getShaders()),{id:this.props.id,geometry:wge(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=Ege,n})();const s5={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:[cR]};class rm{constructor(e={}){const{id:t}=e;this.id=t||ga(this.constructor.name),this.display=!0,this.position=new Ao,this.rotation=new Ao,this.scale=new Ao(1,1,1),this.matrix=new qn,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 qn(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 Z0 extends rm{constructor(e={}){e=Array.isArray(e)?{children:e}:e;const{children:t=[]}=e;mn.assert(t.every(i=>i instanceof rm),"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 qn}={}){const i=new qn(t).multiplyRight(this.matrix);for(const r of this.children)r instanceof Z0?r.traverse(e,{worldMatrix:i}):e(r,{worldMatrix:i})}}function o5(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],u=e[7],h=e[8],p=t[0],g=t[1],m=t[2],w=t[3],C=t[4],H=t[5],U=t[6],de=t[7],Ae=t[8];return n[0]=p*i+g*o+m*c,n[1]=p*r+g*a+m*u,n[2]=p*s+g*l+m*h,n[3]=w*i+C*o+H*c,n[4]=w*r+C*a+H*u,n[5]=w*s+C*l+H*h,n[6]=U*i+de*o+Ae*c,n[7]=U*r+de*a+Ae*u,n[8]=U*s+de*l+Ae*h,n}function a5(n,e,t){var i=t[0],r=t[1];return n[0]=i*e[0],n[1]=i*e[1],n[2]=i*e[2],n[3]=r*e[3],n[4]=r*e[4],n[5]=r*e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n}function l5(){var n=new ya(4);return ya!=Float32Array&&(n[0]=0,n[1]=0,n[2]=0),n[3]=1,n}function c5(n){return n[0]=0,n[1]=0,n[2]=0,n[3]=1,n}function dR(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 ax(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],u=t[3];return n[0]=i*u+o*a+r*c-s*l,n[1]=r*u+o*l+s*a-i*c,n[2]=s*u+o*c+i*l-r*a,n[3]=o*u-i*a-r*l-s*c,n}function u5(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);return n[0]=i*l+o*a,n[1]=r*l+s*a,n[2]=s*l-r*a,n[3]=o*l-i*a,n}function d5(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);return n[0]=i*l-s*a,n[1]=r*l+o*a,n[2]=s*l+i*a,n[3]=o*l-r*a,n}function h5(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);return n[0]=i*l+r*a,n[1]=r*l-i*a,n[2]=s*l+o*a,n[3]=o*l-s*a,n}function f5(n,e){var t=e[0],i=e[1],r=e[2];return n[0]=t,n[1]=i,n[2]=r,n[3]=Math.sqrt(Math.abs(1-t*t-i*i-r*r)),n}function J0(n,e,t,i){var p,g,m,w,C,r=e[0],s=e[1],o=e[2],a=e[3],l=t[0],c=t[1],u=t[2],h=t[3];return(g=r*l+s*c+o*u+a*h)<0&&(g=-g,l=-l,c=-c,u=-u,h=-h),1-g>Qc?(p=Math.acos(g),m=Math.sin(p),w=Math.sin((1-i)*p)/m,C=Math.sin(i*p)/m):(w=1-i,C=i),n[0]=w*r+C*l,n[1]=w*s+C*c,n[2]=w*o+C*u,n[3]=w*a+C*h,n}function p5(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;return n[0]=-t*a,n[1]=-i*a,n[2]=-r*a,n[3]=s*a,n}function g5(n,e){return n[0]=-e[0],n[1]=-e[1],n[2]=-e[2],n[3]=e[3],n}function hR(n,e){var i,t=e[0]+e[4]+e[8];if(t>0)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}return n}var m5=function(n,e,t){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n},fR=FU,pR=function(n,e){return n[0]*e[0]+n[1]*e[1]+n[2]*e[2]+n[3]*e[3]},_5=function(n,e,t,i){var r=e[0],s=e[1],o=e[2],a=e[3];return 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),n},y5=function(n){return Math.hypot(n[0],n[1],n[2],n[3])},b5=function(n){var e=n[0],t=n[1],i=n[2],r=n[3];return e*e+t*t+i*i+r*r},w5=function(){var n=xV(),e=CV(1,0,0),t=CV(0,1,0);return function(i,r,s){var o=AV(r,s);return o<-.999999?(A0(n,e,r),function(n){return Math.hypot(n[0],n[1],n[2])}(n)<1e-6&&A0(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),dR(i,n,Math.PI),i):o>.999999?(i[0]=0,i[1]=0,i[2]=0,i[3]=1,i):(A0(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))}}();l5(),l5(),function(){var n=new ya(9);ya!=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 Nge=[0,0,0,1];class gR extends bS{constructor(e=0,t=0,i=0,r=1){super(-0,-0,-0,-0),Array.isArray(e)&&1===arguments.length?this.copy(e):this.set(e,t,i,r)}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this.check()}set(e,t,i,r){return this[0]=e,this[1]=t,this[2]=i,this[3]=r,this.check()}fromMatrix3(e){return hR(this,e),this.check()}identity(){return c5(this),this.check()}fromAxisRotation(e,t){return dR(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]=sr(e)}get y(){return this[1]}set y(e){this[1]=sr(e)}get z(){return this[2]}set z(e){this[2]=sr(e)}get w(){return this[3]}set w(e){this[3]=sr(e)}len(){return y5(this)}lengthSquared(){return b5(this)}dot(e,t){if(void 0!==t)throw new Error("Quaternion.dot only takes one argument");return pR(this,e)}rotationTo(e,t){return w5(this,e,t),this.check()}add(e,t){if(void 0!==t)throw new Error("Quaternion.add only takes one argument");return m5(this,this,e),this.check()}calculateW(){return f5(this,this),this.check()}conjugate(){return g5(this,this),this.check()}invert(){return p5(this,this),this.check()}lerp(e,t,i){return _5(this,e,t,i),this.check()}multiplyRight(e,t){return Yu(!t),ax(this,this,e),this.check()}multiplyLeft(e,t){return Yu(!t),ax(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 u5(this,this,e),this.check()}rotateY(e){return d5(this,this,e),this.check()}rotateZ(e){return h5(this,this,e),this.check()}scale(e){return fR(this,this,e),this.check()}slerp(e,t,i){switch(arguments.length){case 1:({start:e=Nge,target:t,ratio:i}=arguments[0]);break;case 2:[t,i]=arguments,e=this}return J0(this,e,t,i),this.check()}transformVector4(e,t=e){return kU(t,e,this),vS(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)}}const Pge={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Fge={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function E5(n){if(!n._animation){const e=Fge[n.componentType],t=Pge[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;l{(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:mn.warn(`Bad animation path ${s}`)()}tn(r[s].length===i[c].length);const u=e[c],h=e[l];switch(t){case"STEP":!function(n,e,t){for(let i=0;iu&&function(n,e,t,i,r){if("rotation"===e){mR.slerp({start:t,target:i,ratio:r});for(let s=0;su&&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:E5(e.accessors[a]),interpolation:l,output:E5(e.accessors[c])})),o=t.channels.map(({sampler:a,target:l})=>({sampler:s[a],target:e.nodes[l.node],path:l.path}));return new zge({name:r,channels:o})})}animate(e){this.setTime(e)}setTime(e){this.animations.forEach(t=>t.animate(e))}getAnimations(){return this.animations}}class Gge extends rm{constructor(e,t={}){super(t),this.onBeforeRender=null,this.AfterRender=null,e instanceof Yg?(this.model=e,this._setModelNodeProps(t)):this.model=new Yg(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 $ge{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},gI(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 _a(this.gl,ot({id:e.name||e.id,parameters:ot(ot({},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&&(mn.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 S5(n,e){return Si(n)?`#version 300 es\n${e}`:e}const Kge={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Xge={modelOptions:{},pbrDebug:!1,imageBasedLightingEnvironment:null,lights:!0,useTangents:!1};class Qge{constructor(e,t={}){this.gl=e,this.options=Object.assign({},Xge,t)}instantiate(e){return this.gltf=e,(e.scenes||[]).map(i=>this.createScene(i))}createAnimator(){return Array.isArray(this.gltf.animations)?new Hge(this.gltf):null}createScene(e){const i=(e.nodes||[]).map(s=>this.createNode(s));return new Z0({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 Z0({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 qn).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 Z0({id:e.name||e.id,children:i});e._mesh=r}return e._mesh}getVertexCount(e){mn.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 $ge(n,e);mn.info(4,"createGLTFModel defines: ",a.defines)();const l=[];l.push(...a.generatedTextures),l.push(...Object.values(s).map(u=>u.buffer));const c=new Gge(n,Object.assign({id:t,drawMode:i,vertexCount:r,modules:[s5],defines:a.defines,parameters:a.parameters,vs:S5(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:S5(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))),mn.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 hr(this.gl,{id:`from-${i.id}`,data:i.data||e.value,target:t})),i.lumaBuffers[t]}createAccessor(e,t){return new ma({buffer:t,offset:e.byteOffset||0,stride:e.bufferView.byteStride||0,type:e.componentType,size:Kge[e.type]})}createSampler(e){return e}needsPOT(){return!1}}function x5(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 sm(i,this.metadata)}selectAt(...e){const t=e.map(i=>this.fields[i]).filter(Boolean);return new sm(t,this.metadata)}assign(e){let t,i=this.metadata;if(e instanceof sm){const o=e;t=o.fields,i=M5(M5(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 sm(s,i)}}function M5(n,e){return new Map([...n||new Map,...e||new Map])}let Lr,D5,I5,O5,R5,N5,P5,F5;!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"}(Lr||(Lr={}));class _R{static isNull(e){return e&&e.typeId===Lr.Null}static isInt(e){return e&&e.typeId===Lr.Int}static isFloat(e){return e&&e.typeId===Lr.Float}static isBinary(e){return e&&e.typeId===Lr.Binary}static isUtf8(e){return e&&e.typeId===Lr.Utf8}static isBool(e){return e&&e.typeId===Lr.Bool}static isDecimal(e){return e&&e.typeId===Lr.Decimal}static isDate(e){return e&&e.typeId===Lr.Date}static isTime(e){return e&&e.typeId===Lr.Time}static isTimestamp(e){return e&&e.typeId===Lr.Timestamp}static isInterval(e){return e&&e.typeId===Lr.Interval}static isList(e){return e&&e.typeId===Lr.List}static isStruct(e){return e&&e.typeId===Lr.Struct}static isUnion(e){return e&&e.typeId===Lr.Union}static isFixedSizeBinary(e){return e&&e.typeId===Lr.FixedSizeBinary}static isFixedSizeList(e){return e&&e.typeId===Lr.FixedSizeList}static isMap(e){return e&&e.typeId===Lr.Map}static isDictionary(e){return e&&e.typeId===Lr.Dictionary}get typeId(){return Lr.NONE}compareTo(e){return this===e}}Symbol,Symbol,D5=Symbol.toStringTag;class om extends _R{constructor(e,t){super(),Kn(this,"isSigned",void 0),Kn(this,"bitWidth",void 0),this.isSigned=e,this.bitWidth=t}get typeId(){return Lr.Int}get[D5](){return"Int"}toString(){return`${this.isSigned?"I":"Ui"}nt${this.bitWidth}`}}class ame extends om{constructor(){super(!0,8)}}class lme extends om{constructor(){super(!0,16)}}class cme extends om{constructor(){super(!0,32)}}class ume extends om{constructor(){super(!1,8)}}class dme extends om{constructor(){super(!1,16)}}class hme extends om{constructor(){super(!1,32)}}I5=Symbol.toStringTag;class k5 extends _R{constructor(e){super(),Kn(this,"precision",void 0),this.precision=e}get typeId(){return Lr.Float}get[I5](){return"Float"}toString(){return`Float${this.precision}`}}class fme extends k5{constructor(){super(32)}}class pme extends k5{constructor(){super(64)}}Symbol,Symbol,O5=Symbol.toStringTag,R5=Symbol.toStringTag,N5=Symbol.toStringTag,P5=Symbol.toStringTag,F5=Symbol.toStringTag;class gme extends _R{constructor(e,t){super(),Kn(this,"listSize",void 0),Kn(this,"children",void 0),this.listSize=e,this.children=[t]}get typeId(){return Lr.FixedSizeList}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get[F5](){return"FixedSizeList"}toString(){return`FixedSizeList[${this.listSize}]<${this.valueType}>`}}class lx{constructor(e,t,i=!1,r=new Map){Kn(this,"name",void 0),Kn(this,"type",void 0),Kn(this,"nullable",void 0),Kn(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 lx(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 L5(n,e,t){const i=t?B5(t.metadata):void 0,r=function(n){switch(n.constructor){case Int8Array:return new ame;case Uint8Array:return new ume;case Int16Array:return new lme;case Uint16Array:return new dme;case Int32Array:return new cme;case Uint32Array:return new hme;case Float32Array:return new fme;case Float64Array:return new pme;default:throw new Error("array type not supported")}}(e.value);return new lx(n,new gme(e.size,new lx("value",r)),!1,i)}function B5(n){const e=new Map;for(const t in n)e.set(`${t}.string`,JSON.stringify(n[t]));return e}const j5={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},bme={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array};class wme{constructor(e){Kn(this,"draco",void 0),Kn(this,"decoder",void 0),Kn(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?u:r,s=h>s?h:s,o=p>o?p:o}return[[e,t,i],[r,s,o]]}(l.attributes),u=function(n,e,t){const i=B5(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=L5(o,n[o],s[o]);r.push(l)}if(t){const o=L5("indices",t);r.push(o)}return new sm(r,i)}(l.attributes,a,l.indices);return Cn(ot({loader:"draco",loaderData:a,header:{vertexCount:s.num_points(),boundingBox:c}},l),{schema:u})}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 cx=Je(125);const wR={};function ER(n){return SR.apply(this,arguments)}function SR(){return(SR=oi(function*(n,e=null,t={}){return e&&(n=Ame(n,e,t)),wR[n]=wR[n]||Tme(n),yield wR[n]})).apply(this,arguments)}function Ame(n,e,t){if(n.startsWith("http"))return n;const i=t.modules||{};return i[n]?i[n]:mO?t.CDN?(Jc(t.CDN.startsWith("http")),`${t.CDN}/${e}@3.0.12/dist/libs/${n}`):_O?`../src/libs/${n}`:`modules/${e}/src/libs/${n}`:`modules/${e}/dist/libs/${n}`}function Tme(n){return xR.apply(this,arguments)}function xR(){return(xR=oi(function*(n){return n.endsWith("wasm")?yield(yield fetch(n)).arrayBuffer():mO?_O?importScripts(n):Mme(yield(yield fetch(n)).text(),n):cx.requireFromFile&&(yield cx.requireFromFile(n))})).apply(this,arguments)}function Mme(n,e){if(!mO)return cx.requireFromString&&cx.requireFromString(n,e);if(_O)return eval.call(jue,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 Dme="https://www.gstatic.com/draco/versioned/decoders/1.4.1/draco_decoder.js",Ime="https://www.gstatic.com/draco/versioned/decoders/1.4.1/draco_wasm_wrapper.js",Ome="https://www.gstatic.com/draco/versioned/decoders/1.4.1/draco_decoder.wasm";let eb;function Nme(n){return CR.apply(this,arguments)}function CR(){return(CR=oi(function*(n){const e=n.modules||{};return eb=e.draco3d?eb||e.draco3d.createDecoderModule({}).then(t=>({draco:t})):eb||Pme(n),yield eb})).apply(this,arguments)}function Pme(n){return TR.apply(this,arguments)}function TR(){return(TR=oi(function*(n){let e,t;switch(n.draco&&n.draco.decoderType){case"js":e=yield ER(Dme,"draco",n);break;case"wasm":default:[e,t]=yield Promise.all([yield ER(Ime,"draco",n),yield ER(Ome,"draco",n)])}return e=e||globalThis.DracoDecoderModule,yield Fme(e,t)})).apply(this,arguments)}function Fme(n,e){const t={};return e&&(t.wasmBinary=e),new Promise(i=>{n(Cn(ot({},t),{onModuleLoaded:r=>i({draco:r})}))})}const DR=Cn(ot({},T5),{parse:function(n,e){return IR.apply(this,arguments)}});function IR(){return(IR=oi(function*(n,e){const{draco:t}=yield Nme(e),i=new wme(t);try{return i.parseSync(n,null==e?void 0:e.draco)}finally{i.destroy()}})).apply(this,arguments)}function nb(n,e){return Ff(n>=0),Ff(e>0),n+(e-1)&~(e-1)}function Bme(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+nb(i.byteLength,4)}const V5=["SCALAR","VEC2","VEC3","VEC4"],jme=[[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Uint32Array,5125],[Float32Array,5126],[Float64Array,5130]],Vme=new Map(jme),Ume={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},zme={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},Hme={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function U5(n){return V5[n-1]||V5[0]}function z5(n){const e=Vme.get(n.constructor);if(!e)throw new Error("Illegal typed array");return e}function H5(n,e){const t=Hme[n.componentType],i=Ume[n.type],s=n.count*i,o=n.count*i*zme[n.componentType];return Ga(o>=0&&o<=e.byteLength),{ArrayType:t,length:s,byteLength:o}}const Gme={asset:{version:"2.0",generator:"loaders.gl"},buffers:[]};class gh{constructor(e){Kn(this,"gltf",void 0),Kn(this,"sourceBuffers",void 0),Kn(this,"byteLength",void 0),this.gltf=e||{json:ot({},Gme),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 Ga(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}=H5(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 Ga(t),this.json.extensions=this.json.extensions||{},this.json.extensions[e]=t,this.registerUsedExtension(e),t}addRequiredExtension(e,t={}){return Ga(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=JO(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;Ga(Number.isFinite(t)),this.sourceBuffers=this.sourceBuffers||[],this.sourceBuffers.push(e);const i={buffer:0,byteOffset:this.byteLength,byteLength:t};return this.byteLength+=nb(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:U5(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:z5(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=Bme(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*t_e(n){for(const e of n.json.meshes||[])for(const t of e.primitives)yield t}function n_e(n){return NR.apply(this,arguments)}function NR(){return(NR=oi(function*(n){const e=new gh(n),{json:t}=e;e.removeExtension(dx);for(const i of t.materials||[])i.extensions&&i.extensions.KHR_materials_unlit&&(i.unlit=!0),e.removeObjectExtension(i,dx)})).apply(this,arguments)}function i_e(n){const e=new gh(n),{json:t}=e;if(e.materials)for(const i of t.materials||[])i.unlit&&(delete i.unlit,e.addObjectExtension(i,dx,{}),e.addExtension(dx))}function r_e(n){return PR.apply(this,arguments)}function PR(){return(PR=oi(function*(n){const e=new gh(n),{json:t}=e,i=e.getExtension(am);i&&(e.json.lights=i.lights,e.removeExtension(am));for(const r of t.nodes||[]){const s=e.getObjectExtension(r,am);s&&(r.light=s.light),e.removeObjectExtension(r,am)}})).apply(this,arguments)}function s_e(n){return FR.apply(this,arguments)}function FR(){return(FR=oi(function*(n){const e=new gh(n),{json:t}=e;if(t.lights){const i=e.addExtension(am);Ga(!i.lights),i.lights=t.lights,delete t.lights}if(e.json.lights){for(const i of e.json.lights)e.addObjectExtension(i.node,am,i);delete e.json.lights}})).apply(this,arguments)}function o_e(n){return kR.apply(this,arguments)}function kR(){return(kR=oi(function*(n){const e=new gh(n),{json:t}=e,i=e.getExtension(hx);if(i){const r=l_e(i,e);for(const s of t.materials||[]){const o=e.getObjectExtension(s,hx);o&&(s.technique=Object.assign({},o,r[o.technique]),s.technique.values=c_e(s.technique,e)),e.removeObjectExtension(s,hx)}e.removeExtension(hx)}})).apply(this,arguments)}function a_e(n,e){return LR.apply(this,arguments)}function LR(){return(LR=oi(function*(n,e){})).apply(this,arguments)}function l_e(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 c_e(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 W5={KHR_draco_mesh_compression:yt,KHR_materials_unlit:ee,KHR_lights_punctual:Tt,KHR_techniques_webgl:dt};function u_e(n){return BR.apply(this,arguments)}function BR(){return(BR=oi(function*(n,e={},t){for(const r in W5){var i;const s=(null==e||null===(i=e.gltf)||void 0===i?void 0:i.excludeExtensions)||{};r in s&&!s[r]||(yield W5[r].decode(n,e,t))}})).apply(this,arguments)}const q5={accessors:"accessor",animations:"animation",buffers:"buffer",bufferViews:"bufferView",images:"image",materials:"material",meshes:"mesh",nodes:"node",samplers:"sampler",scenes:"scene",skins:"skin",textures:"texture"},h_e={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 f_e{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 gh(n),{json:t}=e;for(const i of t.images||[]){const r=e.removeObjectExtension(i,G5);r&&Object.assign(i,r)}t.buffers&&t.buffers[0]&&delete t.buffers[0].uri,e.removeExtension(G5)}(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 q5)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 q5)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=h_e[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 p_e(n,e={}){return(new f_e).normalize(n,e)}const g_e={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},m_e={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},Ml={TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,REPEAT:10497,LINEAR:9729,NEAREST_MIPMAP_LINEAR:9986},__e={magFilter:Ml.TEXTURE_MAG_FILTER,minFilter:Ml.TEXTURE_MIN_FILTER,wrapS:Ml.TEXTURE_WRAP_S,wrapT:Ml.TEXTURE_WRAP_T},y_e={[Ml.TEXTURE_MAG_FILTER]:Ml.LINEAR,[Ml.TEXTURE_MIN_FILTER]:Ml.NEAREST_MIPMAP_LINEAR,[Ml.TEXTURE_WRAP_S]:Ml.REPEAT,[Ml.TEXTURE_WRAP_]:Ml.REPEAT};class w_e{postProcess(e,t={}){const{json:i,buffers:r=[],images:s=[],baseUri:o=""}=e;return Ga(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=ot({},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=ot({},e.normalTexture),e.normalTexture.texture=this.getTexture(e.normalTexture.index)),e.occlusionTexture&&(e.occlustionTexture=ot({},e.occlustionTexture),e.occlusionTexture.texture=this.getTexture(e.occlusionTexture.index)),e.emissiveTexture&&(e.emmisiveTexture=ot({},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=ot({},e.pbrMetallicRoughness);const i=e.pbrMetallicRoughness;i.baseColorTexture&&(i.baseColorTexture=ot({},i.baseColorTexture),i.baseColorTexture.texture=this.getTexture(i.baseColorTexture.index)),i.metallicRoughnessTexture&&(i.metallicRoughnessTexture=ot({},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 m_e[n]}(e.componentType),e.components=function(n){return g_e[n]}(e.type),e.bytesPerElement=e.bytesPerComponent*e.components,e.bufferView){const i=e.bufferView.buffer,{ArrayType:r,byteLength:s}=H5(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):y_e,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 __e[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 E_e(n,e){return(new w_e).postProcess(n,e)}const Y5=1735152710,lm=!0;function VR(n,e,t,i){const r=new Uint8Array(e.buffer,t,i),o=new TextDecoder("utf8").decode(r);return n.json=JSON.parse(o),nb(i,4)}function UR(n,e,t,i){return n.header.hasBinChunk=!0,n.binChunks.push({byteOffset:t,byteLength:i,arrayBuffer:e.buffer}),nb(i,4)}function P_e(n,e){return zR.apply(this,arguments)}function zR(){return(zR=oi(function*(n,e,t=0,i,r){var s,o,a,l;F_e(n,e,t,i),p_e(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 k_e(n,i,r)),null!=i&&null!==(a=i.gltf)&&void 0!==a&&a.loadImages){const h=L_e(n,i,r);c.push(h)}const u=u_e(n,i,r);return c.push(u),yield Promise.all(c),null!=i&&null!==(l=i.gltf)&&void 0!==l&&l.postProcess?E_e(n,i):n})).apply(this,arguments)}function F_e(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=Y5}=t,s=i.getUint32(e,!1);return s===r||s===Y5}(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)?x5(n.buffer,n.byteOffset,e):n instanceof ArrayBuffer?x5(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,lm),a=r.getUint32(t+8,lm);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){Ff(n.header.byteLength>20);const i=e.getUint32(t+0,lm),r=e.getUint32(t+4,lm);return t+=8,Ff(0===r),VR(n,e,t,i),(t+=i)+UR(n,e,t,n.header.byteLength)}(n,r,t);case 2:return function(n,e,t,i){return Ff(n.header.byteLength>20),function(n,e,t,i){for(;t+8<=n.header.byteLength;){const r=e.getUint32(t+0,lm),s=e.getUint32(t+4,lm);switch(t+=8,s){case 1313821514:VR(n,e,t,r);break;case 5130562:UR(n,e,t,r);break;case 0:i.strict||VR(n,e,t,r);break;case 1:i.strict||UR(n,e,t,r)}t+=nb(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),Ga("glTF"===o.type,`Invalid GLB magic string ${o.type}`),n._glb=o,n.json=o.json}else Ga(!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 k_e(n,e,t){return HR.apply(this,arguments)}function HR(){return(HR=oi(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 U_e(()=>e.some(t=>!t.loaded))})).apply(this,arguments)}function U_e(n){return YR.apply(this,arguments)}function YR(){return(YR=oi(function*(n){for(;n();)yield new Promise(e=>requestAnimationFrame(e))})).apply(this,arguments)}const K5=[255,255,255,255],G_e={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:K5},_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:[cm]};let $_e=(()=>{class n extends $0{getShaders(){const t=[rx,sx];return"pbr"===this.props._lighting&&t.push(s5),{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:K5,transition:!0},instanceModelMatrix:n5})}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 rm)r={scenes:[t.scenegraph]};else if(t.scenegraph&&!t.scenegraph.gltf){const l=t.scenegraph,c=function(n,e,t){const i=new Qge(n,t);return{scenes:i.instantiate(e),animator:i.createAnimator()}}(i,l,this._getModelOptions());r=ot({gltf:l},c),function(n){return qR.apply(this,arguments)}(c).then(()=>this.setNeedsRedraw())}else t.scenegraph&&(Ri.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 rm?(this._deleteScenegraph(),this._applyAllAttributes(o),this._applyAnimationsProp(o,a,t._animations),this.setState({scenegraph:o,animator:a})):null!==o&&Ri.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):Ri.warn("animation ".concat(o," not found"))()}})}_deleteScenegraph(){const{scenegraph:t}=this.state;t instanceof rm&&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:ot({isInstanced:!0,transpileToGLSL100:!Si(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:u}=this.props,h=this.getNumInstances();this.state.scenegraph.traverse((p,{worldMatrix:g})=>{p.model.setInstanceCount(h),p.updateModuleSettings(t),p.draw({parameters:i,uniforms:{sizeScale:o,opacity:c,sizeMinPixels:a,sizeMaxPixels:l,composeModelMatrix:i5(s,u),sceneModelMatrix:g,u_Camera:p.model.getUniforms().project_uCameraPosition}})})}}return n.layerName="ScenegraphLayer",n.defaultProps=G_e,n})();class W_e extends fh{constructor(e={}){const{id:t=ga("sphere-geometry")}=e,{indices:i,attributes:r}=function(n){const{nlat:e=10,nlong:t=10}=n;let{radius:i=1}=n;const o=Math.PI-0,c=2*Math.PI-0,u=(e+1)*(t+1);if("number"==typeof i){const H=i;i=(U,de,Ae,Pe,Be)=>H}const h=new Float32Array(3*u),p=new Float32Array(3*u),g=new Float32Array(2*u),w=new(u>65535?Uint32Array:Uint16Array)(e*t*6);for(let H=0;H<=e;H++)for(let U=0;U<=t;U++){const de=U/t,Ae=H/e,Pe=U+H*(t+1),Be=2*Pe,et=3*Pe,wt=c*de,vt=o*Ae,Ct=Math.sin(wt),Bt=Math.cos(wt),$t=Math.sin(vt),mt=Bt*$t,Vt=Math.cos(vt),ft=Ct*$t,qt=i(mt,Vt,ft,de,Ae);h[et+0]=qt*mt,h[et+1]=qt*Vt,h[et+2]=qt*ft,p[et+0]=mt,p[et+1]=Vt,p[et+2]=ft,g[Be+0]=de,g[Be+1]=1-Ae}const C=t+1;for(let H=0;Hs?(gt=i,$t=1,mt=t):mt=e+Bt/s*(t-e),(-2===Bt||Bt===s+2)&&(mt=0,$t=0),gt-=i/2;for(let Vt=0;Vts?0:ft*w,et[vt+Pe[1]]=Bt<0?-1:Bt>s?1:C,et[vt+Pe[2]]=Bt<0||Bt>s?0:qt*w,wt[Ct+0]=Vt/r,wt[Ct+1]=$t,Ct+=2,vt+=3}}for(let Bt=0;Bt0){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=sye,s=1/i;r.set(this.x*s,this.y*s,this.z*s);const o=oye;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(Q5),Q5.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 sye=new le,oye=new le,Q5=new le;class mr{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,u=this.upperBound;e.copy(c),t.set(u.x,c.y,c.z),i.set(u.x,u.y,c.z),r.set(c.x,u.y,u.z),s.set(u.x,c.y,u.z),o.set(c.x,u.y,c.z),a.set(c.x,c.y,u.z),l.copy(u)}toLocalFrame(e,t){const i=J5;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=J5;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,u=(this.upperBound.y-i.y)*s,h=(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,u)),Math.min(h,p)),m=Math.min(Math.min(Math.max(a,l),Math.max(c,u)),Math.max(h,p));return!(m<0||g>m)}}const Z5=new le,J5=[new le,new le,new le,new le,new le,new le,new le,new le];class hs{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=lye;e.tangents(i,cye),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(Er(e.length(),2)*Er(t.length(),2))+e.dot(t),this.normalize()}return this}mult(e,t=new hs){const i=this.x,r=this.y,s=this.z,o=this.w,a=e.x,l=e.y,c=e.z,u=e.w;return t.x=i*u+o*a+r*c-s*l,t.y=r*u+o*l+s*a-i*c,t.z=s*u+o*c+i*l-r*a,t.w=o*u-i*a-r*l-s*c,t}inverse(e=new hs){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 hs){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,u=c*i+a*s-l*r,h=c*r+l*i-o*s,p=c*s+o*r-a*i,g=-o*i-a*r-l*s;return t.x=u*c+g*-o+h*-l-p*-a,t.y=h*c+g*-a+p*-o-u*-l,t.z=p*c+g*-l+u*-a-h*-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 u=o*a+l*c;if(u>.499&&(i=2*Math.atan2(o,c),r=Math.PI/2,s=0),u<-.499&&(i=-2*Math.atan2(o,c),r=-Math.PI/2,s=0),void 0===i){const h=o*o,g=l*l;i=Math.atan2(2*a*c-2*o*l,1-a*a*2-2*g),r=Math.asin(2*u),s=Math.atan2(2*o*c-2*a*l,1-2*h-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),u=Math.sin(i/2);return"XYZ"===r?(this.x=l*o*a+s*c*u,this.y=s*c*a-l*o*u,this.z=s*o*u+l*c*a,this.w=s*o*a-l*c*u):"YXZ"===r?(this.x=l*o*a+s*c*u,this.y=s*c*a-l*o*u,this.z=s*o*u-l*c*a,this.w=s*o*a+l*c*u):"ZXY"===r?(this.x=l*o*a-s*c*u,this.y=s*c*a+l*o*u,this.z=s*o*u+l*c*a,this.w=s*o*a-l*c*u):"ZYX"===r?(this.x=l*o*a-s*c*u,this.y=s*c*a+l*o*u,this.z=s*o*u-l*c*a,this.w=s*o*a+l*c*u):"YZX"===r?(this.x=l*o*a+s*c*u,this.y=s*c*a+l*o*u,this.z=s*o*u-l*c*a,this.w=s*o*a-l*c*u):"XZY"===r&&(this.x=l*o*a-s*c*u,this.y=s*c*a-l*o*u,this.z=s*o*u+l*c*a,this.w=s*o*a+l*c*u),this}clone(){return new hs(this.x,this.y,this.z,this.w)}slerp(e,t,i=new hs){const r=this.x,s=this.y,o=this.z,a=this.w;let p,g,m,w,C,l=e.x,c=e.y,u=e.z,h=e.w;return g=r*l+s*c+o*u+a*h,g<0&&(g=-g,l=-l,c=-c,u=-u,h=-h),1-g>1e-6?(p=Math.acos(g),m=Math.sin(p),w=Math.sin((1-t)*p)/m,C=Math.sin(t*p)/m):(w=1-t,C=t),i.x=w*r+C*l,i.y=w*s+C*c,i.z=w*o+C*u,i.w=w*a+C*h,i}integrate(e,t,i,r=new hs){const s=e.x*i.x,o=e.y*i.y,a=e.z*i.z,l=this.x,c=this.y,u=this.z,h=this.w,p=.5*t;return r.x+=p*(s*h+o*u-a*c),r.y+=p*(o*h+a*l-s*u),r.z+=p*(a*h+s*c-o*l),r.w+=p*(-s*l-o*c-a*u),r}}const lye=new le,cye=new le,uye={SPHERE:1,PLANE:2,BOX:4,COMPOUND:8,CONVEXPOLYHEDRON:16,HEIGHTFIELD:32,PARTICLE:64,CYLINDER:128,TRIMESH:256};let _n=(()=>{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=uye,n})();class Gi{constructor(e={}){this.position=void 0,this.quaternion=void 0,this.position=new le,this.quaternion=new hs,e.position&&this.position.copy(e.position),e.quaternion&&this.quaternion.copy(e.quaternion)}pointToLocal(e,t){return Gi.pointToLocalFrame(this.position,this.quaternion,e,t)}pointToWorld(e,t){return Gi.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(t8),t8.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 t8=new hs;class Bf extends _n{constructor(e={}){const{vertices:t=[],faces:i=[],normals:r=[],axes:s,boundingSphereRadius:o}=e;super({type:_n.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 u=!1;for(let h=0;h!==i.length;h++)if(i[h].almostEquals(r)||i[h].almostEquals(r)){u=!0;break}u||i.push(r.clone())}}}computeNormals(){this.faceNormals.length=this.faces.length;for(let e=0;ep&&(p=w,h=m)}const g=[];for(let m=0;m=0&&this.clipFaceAgainstHull(o,e,t,g,a,l,c)}findSeparatingAxis(e,t,i,r,s,o,a,l){const c=new le,u=new le,h=new le,p=new le,g=new le,m=new le;let w=Number.MAX_VALUE;const C=this;if(C.uniqueAxes)for(let H=0;H!==C.uniqueAxes.length;H++){i.vmult(C.uniqueAxes[H],c);const U=C.testSepAxis(c,e,t,i,r,s);if(!1===U)return!1;U0&&o.negate(o),!0}testSepAxis(e,t,i,r,s,o){Bf.project(this,e,i,r,KR),Bf.project(t,e,s,o,XR);const l=KR[0],c=KR[1],u=XR[0],h=XR[1];if(l0?1/t:0,this.material=e.material||null,this.linearDamping="number"==typeof e.linearDamping?e.linearDamping:.01,this.type=t<=0?yn.STATIC:yn.DYNAMIC,typeof e.type==typeof yn.STATIC&&(this.type=e.type),this.allowSleep=void 0===e.allowSleep||e.allowSleep,this.sleepState=yn.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 hs,this.initQuaternion=new hs,this.previousQuaternion=new hs,this.interpolatedQuaternion=new hs,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 su,this.invMassSolve=0,this.invInertiaSolve=new le,this.invInertiaWorldSolve=new su,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 mr,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=yn.AWAKE,this.wakeUpAfterNarrowphase=!1,e===yn.SLEEPING&&this.dispatchEvent(yn.wakeupEvent)}sleep(){this.sleepState=yn.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=Er(this.sleepSpeedLimit,2);t===yn.AWAKE&&ir?this.wakeUp():t===yn.SLEEPY&&e-this.timeLastSleepy>this.sleepTimeLimit&&(this.sleep(),this.dispatchEvent(yn.sleepEvent))}}updateSolveMassProperties(){this.sleepState===yn.SLEEPING||this.type===yn.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 hs;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=fye,o=pye,a=this.quaternion,l=this.aabb,c=gye;for(let u=0;u!==r;u++){const h=e[u];a.vmult(t[u],s),s.vadd(this.position,s),a.mult(i[u],o),h.calculateWorldAABB(s,o,c.lowerBound,c.upperBound),0===u?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=mye,r=_ye;i.setRotationFromQuaternion(this.quaternion),i.transpose(r),i.scale(t,i),i.mmult(r,this.invInertiaWorld)}}applyForce(e,t=new le){if(this.type!==yn.DYNAMIC)return;this.sleepState===yn.SLEEPING&&this.wakeUp();const i=yye;t.cross(e,i),this.force.vadd(e,this.force),this.torque.vadd(i,this.torque)}applyLocalForce(e,t=new le){if(this.type!==yn.DYNAMIC)return;const i=bye,r=vye;this.vectorToWorldFrame(e,i),this.vectorToWorldFrame(t,r),this.applyForce(i,r)}applyTorque(e){this.type===yn.DYNAMIC&&(this.sleepState===yn.SLEEPING&&this.wakeUp(),this.torque.vadd(e,this.torque))}applyImpulse(e,t=new le){if(this.type!==yn.DYNAMIC)return;this.sleepState===yn.SLEEPING&&this.wakeUp();const i=t,r=wye;r.copy(e),r.scale(this.invMass,r),this.velocity.vadd(r,this.velocity);const s=Eye;i.cross(e,s),this.invInertiaWorld.vmult(s,s),this.angularVelocity.vadd(s,this.angularVelocity)}applyLocalImpulse(e,t=new le){if(this.type!==yn.DYNAMIC)return;const i=Sye,r=xye;this.vectorToWorldFrame(e,i),this.vectorToWorldFrame(t,r),this.applyImpulse(i,r)}updateMassProperties(){const e=Cye;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),px.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!==yn.DYNAMIC&&this.type!==yn.KINEMATIC||this.sleepState===yn.SLEEPING)return;const r=this.velocity,s=this.angularVelocity,o=this.position,a=this.force,l=this.torque,c=this.quaternion,h=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 m=h.elements,w=this.angularFactor,C=l.x*w.x,H=l.y*w.y,U=l.z*w.z;s.x+=e*(m[0]*C+m[1]*H+m[2]*U),s.y+=e*(m[3]*C+m[4]*H+m[5]*U),s.z+=e*(m[6]*C+m[7]*H+m[8]*U),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()}}yn.idCounter=0,yn.COLLIDE_EVENT_NAME="collide",yn.DYNAMIC=1,yn.STATIC=2,yn.KINEMATIC=4,yn.AWAKE=0,yn.SLEEPY=1,yn.SLEEPING=2,yn.wakeupEvent={type:"wakeup"},yn.sleepyEvent={type:"sleepy"},yn.sleepEvent={type:"sleep"};const fye=new le,pye=new hs,gye=new mr,mye=new su,_ye=new su,yye=new le,bye=new le,vye=new le,wye=new le,Eye=new le,Sye=new le,xye=new le,Cye=new le;new le,new le;class gx{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 n8,i8,r8,s8,o8,a8,l8;n8=_n.types.SPHERE,i8=_n.types.PLANE,r8=_n.types.BOX,s8=_n.types.CYLINDER,o8=_n.types.CONVEXPOLYHEDRON,a8=_n.types.HEIGHTFIELD,l8=_n.types.TRIMESH;class bs{get[n8](){return this._intersectSphere}get[i8](){return this._intersectPlane}get[r8](){return this._intersectBox}get[s8](){return this._intersectConvex}get[o8](){return this._intersectConvex}get[a8](){return this._intersectHeightfield}get[l8](){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=bs.ANY,this.result=new gx,this.hasHit=!1,this.callback=i=>{}}intersectWorld(e,t){return this.mode=t.mode||bs.ANY,this.result=t.result||new gx,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(c8),eN.length=0,e.broadphase.aabbQuery(e,c8,eN),this.intersectBodies(eN),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=Rye,s=Nye;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 u=new le;o.vsub(i,u);const h=u.dot(c);if(a.vsub(i,u),h*u.dot(c)>0||o.distanceTo(a)=0&&w<=1&&(o.lerp(a,w,g),g.vsub(i,m),m.normalize(),this.reportIntersection(m,g,s,r,-1)),this.result.shouldStop)return;C>=0&&C<=1&&(o.lerp(a,C,g),g.vsub(i,m),m.normalize(),this.reportIntersection(m,g,s,r,-1))}}_intersectConvex(e,t,i,r,s,o){const a=Bye,l=d8,c=o&&o.faceList||null,u=e.faces,h=e.vertices,p=e.faceNormals,g=this.direction,m=this.from,C=m.distanceTo(this.to),H=c?c.length:u.length,U=this.result;for(let de=0;!U.shouldStop&&deC||this.reportIntersection(a,ba,s,r,Ae)}}}}_intersectTrimesh(e,t,i,r,s,o){const a=jye,l=$ye,c=Wye,u=d8,h=Vye,p=Uye,g=zye,m=Gye,w=Hye,C=e.indices,H=this.from,U=this.to,de=this.direction;c.position.copy(i),c.quaternion.copy(t),Gi.vectorToLocalFrame(i,t,de,h),Gi.pointToLocalFrame(i,t,H,p),Gi.pointToLocalFrame(i,t,U,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,h),h.normalize();const Ae=p.distanceSquared(g);e.tree.rayQuery(this,c,l);for(let Pe=0,Be=l.length;!this.result.shouldStop&&Pe!==Be;Pe++){const et=l[Pe];e.getNormal(et,a),e.getVertex(C[3*et],yc),yc.vsub(p,u);const wt=h.dot(a),vt=a.dot(u)/wt;if(vt<0)continue;h.scale(vt,ba),ba.vadd(p,ba),e.getVertex(C[3*et+1],au),e.getVertex(C[3*et+2],lu);const Ct=ba.distanceSquared(p);!bs.pointInTriangle(ba,au,yc,lu)&&!bs.pointInTriangle(ba,yc,au,lu)||Ct>Ae||(Gi.vectorToWorldFrame(t,a,w),Gi.pointToWorldFrame(i,t,ba,m),this.reportIntersection(w,m,s,r,et))}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 bs.ALL:this.hasHit=!0,c.set(o,a,e,t,i,r,l),c.hasHit=!0,this.callback(c);break;case bs.CLOSEST:(l=0&&(h=s*c-o*a)>=0&&u+hDate.now()-n}var Hf=Je(517);class Br extends se{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 $;return this._value}next(e){super.next(this._value=e)}}function fm(n,e,t){e||(e=new qn(qn.IDENTITY));const i=new qn(qn.IDENTITY);if(!n)return!0;if(n.matrix)i.copy(n.matrix);else{if(i.identity(),n.translation&&i.translate(n.translation),n.rotation){const s=new qn(qn.IDENTITY).fromQuaternion(n.rotation);i.multiplyRight(s)}n.scale&&i.scale(n.scale)}const r=new qn(e).multiplyRight(i);if(!1===t(n,r,e))return!1;for(const s of n.nodes||n.children||[])if(!1===fm(s,r,t))return!1;return!0}function n6(){Nz([T5,cm])}function i6(n,e){var t;const i=null===(t=e.nodes)||void 0===t?void 0:t.find(r=>r.name===n);if(i){let r=!1;for(const s of e.scenes)r||fm(s,new qn(qn.IDENTITY),(o,a)=>o!==i||(o.matrix=a,o.translation=void 0,o.rotation=void 0,o.scale=void 0,r=!0,!1));return e.scene={id:n,name:n,nodes:[i]},e.scenes=[e.scene],{scene:e.scene,scenes:e.scenes}}return e}function rN(n,e){return Fi(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 WS(i,cm,{DracoLoader:DR,gltf:{decompressMeshes:!0,postProcess:!0}});return r.nodes||console.log("WARNING: Empty Scene",t,r),i6(n.scenegraphNode,r)})}function qve(n,e){return Fi(this,void 0,void 0,function*(){return i6(n,yield e)})}function sN(n,e,t){if(e&&0!==e.length){let i;switch(t.geometry){case"sphere":i=new W_e;break;case"cone":i=new X_e;break;case"cylinder":i=new Q_e;break;case"cube":default:i=new iye}return new Sge(Object.assign({id:n,pickable:!0,autoHighlight:!1,highlightColor:[30,136,229,255],coordinateSystem:ji.CARTESIAN,data:e,mesh:i,wireframe:!1,getTransformMatrix:r=>r.transformMatrix,getColor:r=>r.color||[255,255,255,229.5]},t))}}function r6(n,e,t){if(e&&0!==e.length)return new fge(Object.assign({id:n,pickable:!0,data:e.map(i=>Object.assign(Object.assign({},i),{position:new qn(i.transformMatrix).getTranslation()})),getText:i=>i.text,getPosition:i=>i.position,getColor:i=>i.color},t))}let Kve=(()=>{class n extends jz{initializeState(){const{data:t}=this.props;this.setState({data:null!=t?t:[],zoomOpacity:.8,doCollisions:!1}),n6()}renderLayers(){var t,i;const r=this.state,s={sphere:[],cone:[],cylinder:[],cube:[],text:[],wireframe:[],scenegraph:[]};for(const l of r.data){const c=null!==(t=l.geometry)&&void 0!==t?t:"cube";l.scenegraph?s.scenegraph.push(l):void 0!==s[c]&&s[c].push(l)}const o={};for(const l of s.scenegraph)l.scenegraph&&l.scenegraphNode&&!Object.prototype.hasOwnProperty.call(o,l.scenegraph)&&(o[l.scenegraph]=rN({scenegraph:l.scenegraph},n.gltfCache));const a=[];for(const[l,c]of Object.entries(s))if("scenegraph"===l)for(const u of c)a.push(new $_e({id:"models-"+u["@id"],opacity:u.zoomBasedOpacity?r.zoomOpacity:void 0!==u.opacity?u.opacity:1,pickable:!u.unpickable,coordinateSystem:ji.CARTESIAN,data:[u],scenegraph:u.scenegraphNode?qve(u.scenegraphNode,o[u.scenegraph]):u.scenegraph,_lighting:u._lighting,getTransformMatrix:u.transformMatrix,getColor:null!==(i=u.color)&&void 0!==i?i:[0,255,0,127.5],parameters:{depthMask:!u.zoomBasedOpacity&&(void 0===u.opacity||1===u.opacity)}}));else"text"===l?(a.push(r6("text",c.filter(u=>u.unpickable),{pickable:!1})),a.push(r6("textPickable",c.filter(u=>!u.unpickable),{pickable:!0}))):"wireframe"===l?a.push(sN(l,c,{wireframe:!0,pickable:!1,geometry:l})):(a.push(sN(l,c.filter(u=>u.unpickable),{wireframe:!1,pickable:!1,geometry:l})),a.push(sN(`${l}Pickable`,c.filter(u=>!u.unpickable),{wireframe:!1,pickable:!0,geometry:l})));return r.doCollisions&&function(n){Fi(this,void 0,void 0,function*(){console.log("Starting Collisioning");const e=n.filter(o=>!o.scenegraph&&"wireframe"!==o.geometry).map(o=>{const a=new qn(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 mr({lowerBound:new le(...l.map((u,h)=>Math.min(u,c[h]))),upperBound:new le(...c.map((u,h)=>Math.max(u,l[h])))})}}),t=[];for(const o of n.filter(a=>!!a.scenegraph)){const a=yield G0(o.scenegraph,cm,{DracoLoader:DR,decompress:!0,postProcess:!0});for(const l of a.scenes)fm(l,new qn(o.transformMatrix),(c,u)=>{if(c.mesh&&c.mesh.primitives&&c.mesh.primitives.length>0)for(const h of c.mesh.primitives)if(h.attributes.POSITION&&h.attributes.POSITION.min){const p=u.transformAsPoint(h.attributes.POSITION.min,[]),g=u.transformAsPoint(h.attributes.POSITION.max,[]);t.push({"@id":o["@id"],name:c.name,entityId:o.entityId,bbox:new mr({lowerBound:new le(...p.map((m,w)=>Math.min(m,g[w]))),upperBound:new le(...g.map((m,w)=>Math.max(m,p[w])))}),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})}(r.data),a.filter(l=>!!l)}getPickingInfo(t){return t.info}}return n.layerName="BodyUILayer",n.gltfCache={},n})();function s6(n,e=[]){for(const t of n.nodes||n.children||[])e.push(t.name),s6(t,e);return e}let Qve=(()=>{class n{constructor(t){var i,r,s,o,a;this.deckProps=t,this.bodyUILayer=new Kve({}),this.nodeClickSubject=new se,this.nodeHoverStartSubject=new se,this.nodeHoverStopSubject=new se,this.sceneRotationSubject=new Br([0,0]),this.nodeDragStartSubject=new se,this.nodeDragSubject=new se,this.nodeDragEndSubject=new se,this.nodeClick$=this.nodeClickSubject.pipe(Es()),this.nodeHoverStart$=this.nodeHoverStartSubject.pipe(Es()),this.nodeHoverStop$=this.nodeHoverStopSubject.pipe(Es()),this.sceneRotation$=this.sceneRotationSubject.pipe(Es()),this.nodeDragStart$=this.nodeDragStartSubject.pipe(Es()),this.nodeDrag$=this.nodeDragSubject.pipe(Es()),this.nodeDragEnd$=this.nodeDragEndSubject.pipe(Es());const l=Object.assign(Object.assign({},t),{views:["orthographic"===t.camera?new Kde({flipY:!1,near:-1e3}):new Zde({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 u;return null!==(u=this.cursor)&&void 0!==u?u:c.isDragging?"grabbing":"grab"}});t.legacyLighting&&(l.effects=[new GO({ambientLight:new Gz({color:[255,255,255],intensity:10})})]),this.deck=new ix(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 Fi(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 qn([.076,0,0,0,0,.076,16875389974302382e-33,0,0,-16875389974302382e-33,.076,0,.49,.034,.11,1]);(function(n,e,t){return Fi(this,void 0,void 0,function*(){n6();const i=yield rN({scenegraph:n,scenegraphNode:"VHF_Kidney_L_Low1"}),r={},s=[];for(const o of i.scenes)fm(o,e=new qn(e||qn.IDENTITY),(a,l)=>{const c={"@id":a.name||a.id,"@type":"ProcessedNode",transformMatrix:new qn(l),geometry:"wireframe",node:a};if(s.push({"@id":`GLTF:${c["@id"]}`,"@type":"GLTFNode",scenegraph:n,scenegraphNode:c["@id"],transformMatrix:new qn(e||qn.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 u of a.mesh.primitives)if(u.attributes.POSITION&&u.attributes.POSITION.min){const h=l.transformAsPoint(u.attributes.POSITION.min,[]),p=l.transformAsPoint(u.attributes.POSITION.max,[]);c.bbox=new mr({lowerBound:new le(...h.map((g,m)=>Math.min(g,p[m]))),upperBound:new le(...p.map((g,m)=>Math.max(g,h[m])))})}return r[c["@id"]]=c,!0});for(const o of Object.values(r).filter(a=>!a.bbox)){for(const a of s6(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,u=(o.size=o.bbox.upperBound.clone().vsub(a)).clone().vmul(new le(.5,.5,.5)),h=o.center=a.clone().vadd(u);o.transformMatrix=new qn(qn.IDENTITY).translate(h.toArray()).scale(u.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 qn(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 rr([Hf.ZP],n.prototype,"_onHover",null),rr([Hf.ZP],n.prototype,"_onClick",null),rr([Hf.ZP],n.prototype,"_onViewStateChange",null),rr([Hf.ZP],n.prototype,"_onDragStart",null),rr([Hf.ZP],n.prototype,"_onDrag",null),rr([Hf.ZP],n.prototype,"_onDragEnd",null),n})();function Zve(n,e){return n===e}function Jve(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 oN=(()=>{class n{constructor(){this.bootstrap$=new kg(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 aN=new Ht("INITIAL_STATE_TOKEN");let nwe=(()=>{class n{static set(t){this.value=t}static pop(){const t=this.value;return this.value={},t}}return n.value={},n})();const o6=new Ht("Internals.StateContextFactory"),a6=new Ht("Internals.StateFactory");function ub(...n){if(1===n.length){const e=n[0];if(P(e))return Cx(e,null);if(Q(e)&&Object.getPrototypeOf(e)===Object.prototype){const t=Object.keys(e);return Cx(t.map(i=>e[i]),t)}}if("function"==typeof n[n.length-1]){const e=n.pop();return Cx(n=1===n.length&&P(n[0])?n[0]:n,null).pipe(me(t=>e(...t)))}return Cx(n,null)}function Cx(n,e){return new I(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]=u},error:u=>t.error(u),complete:()=>{s++,(s===i||!c)&&(o===i&&t.next(e?e.reduce((u,h,p)=>(u[h]=r[p],u),{}):r),t.complete())}}))}})}function Qi(n,e){return function(i){return i.lift(new iwe(n,e))}}class iwe{constructor(e,t){this.predicate=e,this.thisArg=t}call(e,t){return t.subscribe(new rwe(e,this.predicate,this.thisArg))}}class rwe 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 $a(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(u){let h;s++,!r||a?(a=!1,r=new kg(n,e,i),h=r.subscribe(this),o=u.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)):h=r.subscribe(this),this.add(()=>{s--,h.unsubscribe(),h=void 0,o&&!l&&t&&0===s&&(o.unsubscribe(),o=void 0,r=void 0)})}}(i))}const l6=(()=>{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 Wi(n){return e=>0===n?lS():e.lift(new owe(n))}class owe{constructor(e){if(this.total=e,this.total<0)throw new l6}call(e,t){return t.subscribe(new awe(e,this.total))}}class awe 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 c6(n,e){return e?t=>t.pipe(c6((i,r)=>je(n(i,r)).pipe(me((s,o)=>e(i,s,r,o))))):t=>t.lift(new lwe(n))}class lwe{constructor(e){this.project=e}call(e,t){return t.subscribe(new cwe(e,this.project))}}class cwe extends ve{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 _t(this),i=this.destination;i.add(t);const r=N(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 Ax(n=null){return e=>e.lift(new uwe(n))}class uwe{constructor(e){this.defaultValue=e}call(e,t){return t.subscribe(new dwe(e,this.defaultValue))}}class dwe 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 bc(n){return function(t){const i=new hwe(n),r=t.lift(i);return i.caught=r}}class hwe{constructor(e){this.selector=e}call(e,t){return t.subscribe(new fwe(e,this.selector,this.caught))}}class fwe extends ve{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 _t(this);this.add(i);const r=N(t,i);r!==i&&this.add(r)}}}function _r(n){return e=>e.lift(new pwe(n))}class pwe{constructor(e){this.notifier=e}call(e,t){const i=new gwe(e),r=N(this.notifier,new _t(i));return r&&!i.seenValue?(i.add(r),t.subscribe(i)):i}}class gwe extends ve{constructor(e){super(e),this.seenValue=!1}notifyNext(){this.seenValue=!0,this.complete()}notifyComplete(){}}function _h(){}function Yr(n,e,t){return function(r){return r.lift(new mwe(n,e,t))}}class mwe{constructor(e,t,i){this.nextOrObserver=e,this.error=t,this.complete=i}call(e,t){return t.subscribe(new _we(e,this.nextOrObserver,this.error,this.complete))}}class _we extends y{constructor(e,t,i,r){super(e),this._tapNext=_h,this._tapError=_h,this._tapComplete=_h,this._tapError=i||_h,this._tapComplete=r||_h,Y(t)?(this._context=this,this._tapNext=t):t&&(this._context=t,this._tapNext=t.next||_h,this._tapError=t.error||_h,this._tapComplete=t.complete||_h)}_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 rd(n,e){return t=>t.lift(new ywe(n,e))}class ywe{constructor(e,t){this.compare=e,this.keySelector=t}call(e,t){return t.subscribe(new bwe(e,this.compare,this.keySelector))}}class bwe 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 Wa={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 u6=(()=>{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 gn.isInAngularZone()?t():this._ngZone.run(t)}runOutsideAngular(t){return gn.isInAngularZone()?this._ngZone.runOutsideAngular(t):t()}verifyZoneIsNotNooped(t){t instanceof gn||console.warn(Wa.ZONE_WARNING())}}return n.\u0275fac=function(t){return new(t||n)(Oe(gn),Oe(Wc))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const d6=new Ht("ROOT_STATE_TOKEN"),h6=new Ht("FEATURE_STATE_TOKEN"),f6=new Ht("NGXS_PLUGINS"),p6=new Ht("NG_TEST_MODE"),g6=new Ht("NG_DEV_MODE"),sd="NGXS_META",m6="NGXS_OPTIONS_META",lN="NGXS_SELECTOR_META";let Gf=(()=>{class n{constructor(){this.defaultsState={},this.selectorOptions={injectContainerState:!0,suppressErrors:!0},this.compatibility={strictContentSecurityPolicy:!1},this.executionStrategy=u6}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();class vwe{constructor(e,t,i){this.previousValue=e,this.currentValue=t,this.firstChange=i}}const _6=new Ht("NGXS_EXECUTION_STRATEGY");function $f(n){return n.constructor&&n.constructor.type?n.constructor.type:n.type}const y6=(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},Tx=(n,e)=>e.split(".").reduce((t,i)=>t&&t[i],n),cN=n=>n&&"object"==typeof n&&!Array.isArray(n),uN=(n,...e)=>{if(!e.length)return n;const t=e.shift();if(cN(n)&&cN(t))for(const i in t)cN(t[i])?(n[i]||Object.assign(n,{[i]:{}}),uN(n[i],t[i])):Object.assign(n,{[i]:t[i]});return uN(n,...e)};function dN(n){if(!n.hasOwnProperty(sd)){const e={name:null,actions:{},defaults:{},path:null,makeRootSelector:t=>t.getStateGetter(e.name),children:[]};Object.defineProperty(n,sd,{value:e})}return db(n)}function db(n){return n[sd]}function fN(n){return n[lN]}function b6(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(e[$f(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 Qi(t=>{const i=$f(t.action);return n[i]&&(!e||e[t.status])})}(i,r),t())}}(n,["DISPATCHED"])}function Owe(){return me(n=>n.action)}function Mx(n){return e=>new I(t=>e.subscribe({next(i){n.leave(()=>t.next(i))},error(i){n.leave(()=>t.error(i))},complete(){n.leave(()=>t.complete())}}))}let Dx=(()=>{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)(Oe(_6))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();class Pwe extends se{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 Ix=(()=>{class n extends Pwe{}return n.\u0275fac=function(){let e;return function(i){return(e||(e=nr(n)))(i||n)}}(),n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),Fwe=(()=>{class n extends I{constructor(t,i){super(r=>{const s=t.pipe(Mx(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)(Oe(Ix),Oe(Dx))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const w6=n=>(...e)=>n.shift()(...e,(...i)=>w6(n)(...i));let Ox=(()=>{class n extends Br{constructor(){super({})}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),pN=(()=>{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)(Oe(n,12),Oe(f6,8))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),gN=(()=>{class n extends se{}return n.\u0275fac=function(){let e;return function(i){return(e||(e=nr(n)))(i||n)}}(),n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),E6=(()=>{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(oa),this._errorHandler.handleError(r)}catch(s){}})}),i.pipe(Mx(this._ngxsExecutionStrategy))}dispatchByEvents(t){return Array.isArray(t)?0===t.length?fn(this._stateStream.getValue()):ub(t.map(i=>this.dispatchSingle(i))):this.dispatchSingle(t)}dispatchSingle(t){if(!$f(t))return Fg(new Error(`This action doesn't have a type property: ${t.constructor.name}`));const r=this._stateStream.getValue();return w6([...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($a())}getActionResultStream(t){return this._actionResults.pipe(Qi(i=>i.action===t&&"DISPATCHED"!==i.status),Wi(1),$a())}createDispatchObservable(t){return t.pipe(c6(i=>{switch(i.status){case"SUCCESSFUL":return fn(this._stateStream.getValue());case"ERRORED":return Fg(i.error);default:return Yc}})).pipe($a())}}return n.\u0275fac=function(t){return new(t||n)(Oe(Wn),Oe(Ix),Oe(gN),Oe(pN),Oe(Ox),Oe(Dx))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const S6=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])&&S6(n[i])}),n};let x6=(()=>{class n{constructor(t,i){this.isDevMode=t,this.isTestMode=i}}return n.\u0275fac=function(t){return new(t||n)(Oe(g6),Oe(p6))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),C6=(()=>{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(Wa.INCORRECT_PRODUCTION()):this.isIncorrectDevelopment&&console.warn(Wa.INCORRECT_DEVELOPMENT()))}}return n.\u0275fac=function(t){return new(t||n)(Oe(x6),Oe(Gf))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),gm=(()=>{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=S6(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)(Oe(Ox),Oe(E6),Oe(Gf),Oe(C6))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),Rx=(()=>{class n{constructor(t){this._internalStateOperations=t}createStateContext(t){const i=this._internalStateOperations.getRootStateOperations();function r(l){return Tx(l,t.path)}function s(l,c){const u=y6(l,t.path,c),h=t.instance;if(h.ngxsOnChanges){const p=v6(t,{currentAppState:l,newAppState:u});h.ngxsOnChanges(p)}return i.setState(u),u}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(Wa.PATCHING_ARRAY());if("object"!=typeof n)throw new Error(Wa.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)(Oe(gm))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();class Nx{static stateNameErrorMessage(e){return Wa.STATE_NAME(e)}static checkCorrectStateName(e){if(!e)throw new Error(Wa.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(Wa.STATE_UNIQUE(r,e.name,s.name));return r}static getValidStateMeta(e){const t=db(e);if(!t)throw new Error(Wa.STATE_DECORATOR());return t}}Nx.stateNameRegex=new RegExp("^[a-zA-Z0-9_]+$");let mm=(()=>{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=xx(()=>{const c=this;function u(p){const g=c.statePaths[p];return g?b6(g.split("."),c._config):null}return this._parentFactory?this._parentFactory.getRuntimeSelectorContext():{getStateGetter(p){let g=u(p);return g||((...m)=>(g||(g=u(p)),g?g(...m):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(Nx.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[sd].name};return n.reduce((t,i)=>{const{name:r,children:s}=i[sd];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[sd].name]=t,e),{})}(i),l=[];for(const c of s){const u=a[c],h=o[c],p=u[sd];this.addRuntimeInfoToMeta(p,h);const g={name:c,path:h,isInitialised:!1,actions:p.actions,instance:this._injector.get(u),defaults:n.cloneDefaults(p.defaults)};this.hasBeenMountedAndBootstrapped(c,h)||l.push(g),this.states.push(g)}return l}addAndReturnDefaults(t){const r=this.add(t||[]);return{defaults:r.reduce((o,a)=>y6(o,a.path,a.defaults),{}),states:r}}connectActionHandlers(){null===this._actionsSubscription&&(this._actionsSubscription=this._actions.pipe(Qi(t=>"DISPATCHED"===t.status),B(({action:t})=>this.invokeActions(this._actions,t).pipe(me(()=>({action:t,status:"SUCCESSFUL"})),Ax({action:t,status:"CANCELED"}),bc(i=>fn({action:t,status:"ERRORED",error:i}))))).subscribe(t=>this._actionResults.next(t)))}invokeActions(t,i){const r=$f(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 u=o.instance[l.fn](c,i);u instanceof Promise&&(u=je(u)),u instanceof I?(u=u.pipe(Ax({})),l.options.cancelUncompleted&&(u=u.pipe(_r(t.pipe(Mwe(i)))))):u=fn({}).pipe($a()),s.push(u)}catch(u){s.push(Fg(u))}}}return s.length||s.push(fn({})),ub(s)}addToStatesMap(t){const i=[],r=this.statesByName;for(const s of t){const o=Nx.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!==Tx(this._initialState,i);return this.statesByName[t]&&r}}return n.\u0275fac=function(t){return new(t||n)(Oe(Wn),Oe(Gf),Oe(n,12),Oe(Ix),Oe(gN),Oe(Rx),Oe(aN,8))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),mN=(()=>{class n{constructor(t,i,r){this.internalStateOperations=t,this.stateContextFactory=i,this.bootstrapper=r}ngxsBootstrap(t,i){this.internalStateOperations.getRootStateOperations().dispatch(t).pipe(Qi(()=>!!i),Yr(()=>this.invokeInit(i.states)),B(()=>this.bootstrapper.appBootstrapped$),Qi(r=>!!r)).subscribe(()=>this.invokeBootstrap(i.states))}invokeInit(t){for(const i of t){const r=i.instance;if(r.ngxsOnChanges){const a=v6(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)(Oe(gm),Oe(Rx),Oe(oN))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const Px_getOptions=n=>n&&n.NGXS_SELECTOR_OPTIONS_META||{};function Lwe(n,e,t){const i=t&&t.containerClass,s=xx(function(...c){const u=e.apply(i,c);return u instanceof Function?xx.apply(null,[u]):u});Object.setPrototypeOf(s,e);const o=function(n,e){const t=function(n){return n.hasOwnProperty(lN)||Object.defineProperty(n,lN,{value:{makeRootSelector:null,originalFn:null,containerClass:null,selectorName:null,getSelectorOptions:()=>({})}}),fN(n)}(n);t.originalFn=n;let i=()=>({});e&&(t.containerClass=e.containerClass,t.selectorName=e.selectorName,i=e.getSelectorOptions||i);const r=Object.assign({},t);return t.getSelectorOptions=()=>function(n,e){return Object.assign({},Px_getOptions(n.containerClass)||{},Px_getOptions(n.originalFn)||{},n.getSelectorOptions()||{},e)}(r,i()),t}(e,t);return o.makeRootSelector=l=>{const{argumentSelectorFunctions:c,selectorOptions:u}=function(n,e,t=[]){const i=e.getSelectorOptions(),r=n.getSelectorOptions(i);return{selectorOptions:r,argumentSelectorFunctions:function(n=[],e,t){const i=[];return t&&(0===n.length||e.injectContainerState)&&db(t)&&i.push(t),n&&i.push(...n),i}(t,r,e.containerClass).map(a=>T6(a)(n))}}(l,o,n);return function(p){const g=c.map(m=>m(p));try{return s(...g)}catch(m){if(m instanceof TypeError&&u.suppressErrors)return;throw m}}},s}function T6(n){const e=fN(n)||db(n);return e&&e.makeRootSelector||(()=>n)}let cu=(()=>{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),bc(r=>{const{suppressErrors:s}=this._config.selectorOptions;return r instanceof TypeError&&s?fn(void 0):Fg(r)}),rd(),Mx(this._internalExecutionStrategy))}selectOnce(t){return this.select(t).pipe(Wi(1))}selectSnapshot(t){return this.getStoreBoundSelectorFn(t)(this._stateStream.getValue())}subscribe(t){return this._stateStream.pipe(Mx(this._internalExecutionStrategy)).subscribe(t)}snapshot(){return this._internalStateOperations.getRootStateOperations().getState()}reset(t){return this._internalStateOperations.getRootStateOperations().setState(t)}getStoreBoundSelectorFn(t){return T6(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)(Oe(Ox),Oe(gm),Oe(Gf),Oe(Dx),Oe(mm),Oe(aN,8))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),hb=(()=>{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)(Oe(cu),Oe(Gf))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n.store=null,n.config=null,n})();class zwe{static get type(){return"@@INIT"}}class Hwe{constructor(e){this.addedStates=e}static get type(){return"@@UPDATE_STATE"}}const Fx=new kg(1);let $we=(()=>{class n{constructor(t,i,r,s,o=[],a){!function(){try{const n=window.ng,t=!(n.probe&&n.coreTokens)&&Ba();Fx.next(t)}catch(n){Fx.next(!1)}finally{Fx.complete()}}();const l=t.addAndReturnDefaults(o);i.setStateToTheCurrentWithNew(l),t.connectActionHandlers(),a.ngxsBootstrap(new zwe,l)}}return n.\u0275fac=function(t){return new(t||n)(Oe(mm),Oe(gm),Oe(cu),Oe(hb),Oe(d6,8),Oe(mN))},n.\u0275mod=on({type:n}),n.\u0275inj=xt({}),n})(),Wwe=(()=>{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 Hwe(l.defaults),l))}static flattenStates(t=[]){return t.reduce((i,r)=>i.concat(r),[])}}return n.\u0275fac=function(t){return new(t||n)(Oe(cu),Oe(gm),Oe(mm),Oe(h6,8),Oe(mN))},n.\u0275mod=on({type:n}),n.\u0275inj=xt({}),n})();class Wo{static forRoot(e=[],t={}){return{ngModule:$we,providers:[mm,Rx,Fwe,Ix,oN,C6,x6,mN,E6,gN,gm,Dx,cu,Ox,hb,pN,...e,...Wo.ngxsTokenProviders(e,t)]}}static forFeature(e=[]){return{ngModule:Wwe,providers:[mm,pN,...e,{provide:h6,multi:!0,useValue:e}]}}static ngxsTokenProviders(e,t){return[{provide:p6,useValue:twe},{provide:g6,useValue:Ba},{provide:_6,useClass:t.executionStrategy||u6},{provide:d6,useValue:e},{provide:Wo.ROOT_OPTIONS,useValue:t},{provide:Gf,useFactory:Wo.ngxsConfigFactory,deps:[Wo.ROOT_OPTIONS]},{provide:RE,useFactory:Wo.appBootstrapListenerFactory,multi:!0,deps:[oN]},{provide:aN,useFactory:Wo.getInitialState},{provide:o6,useExisting:Rx},{provide:a6,useExisting:mm}]}static ngxsConfigFactory(e){return uN(new Gf,e)}static appBootstrapListenerFactory(e){return()=>e.bootstrap()}static getInitialState(){return nwe.pop()}}function _N(n,e){return(t,i)=>{if(t.hasOwnProperty("prototype"))throw new Error(Wa.ACTION_DECORATOR());const s=dN(t.constructor);Array.isArray(n)||(n=[n]);for(const o of n){const a=o.type;s.actions[a]||(s.actions[a]=[]),s.actions[a].push({fn:i,options:e||{},type:a})}}}function M6(n){return i=>{!function(n){Fx.subscribe(e=>{e&&(n.\u0275prov||console.warn(Wa.UNDECORATED_STATE_IN_IVY(n.name)))})}(i);const r=i,s=dN(r),o=Object.getPrototypeOf(r),a=function(i){return Object.assign({},i[m6]||{},n)}(o);(function(i){const{meta:r,inheritedStateClass:s,optionsWithInheritance:o}=i,{children:a,defaults:l,name:c}=o,u="string"==typeof c?c:c&&c.getName()||null;Nx.checkCorrectStateName(u),s.hasOwnProperty(sd)&&(r.actions=Object.assign({},r.actions,(s[sd]||{}).actions)),r.children=a,r.defaults=l,r.name=u})({meta:s,inheritedStateClass:o,optionsWithInheritance:a}),r[m6]=a}}function kx(n,...e){return function(t,i){const r=i.toString(),s=`__${r}__selector`,o=function(n,e,t=[]){return"string"==typeof(e=e||function(n){const e=n.length-1;return 36===n.charCodeAt(e)?n.slice(0,e):n}(n))?b6(t.length?[e,...t]:e.split("."),hb.config):e}(r,n,e);Object.defineProperties(t,{[s]:{writable:!0,enumerable:!1,configurable:!0},[r]:{enumerable:!0,configurable:!0,get(){return this[s]||(this[s]=function(n){if(!hb.store)throw new Error(Wa.SELECT_FACTORY_NOT_CONNECTED());return hb.store.select(n)}(o))}}})}}function _m(n){return(e,t,i)=>{if(!i||null===i.value)throw new Error(Wa.SELECTOR_DECORATOR());const s=i.value,o=Lwe(n,s,{containerClass:e,selectorName:t.toString(),getSelectorOptions:()=>({})}),a={configurable:!0,get:()=>o};return a.originalFn=s,a}}function Dl(n,...e){return e.length?e.some(t=>n[t]):n.altKey||n.shiftKey||n.ctrlKey||n.metaKey}Wo.\u0275fac=function(e){return new(e||Wo)},Wo.\u0275mod=on({type:Wo}),Wo.\u0275inj=xt({}),Wo.ROOT_OPTIONS=new Ht("ROOT_OPTIONS");const Kx=new uc(aS);class iSe{constructor(e){this.total=e}call(e,t){return t.subscribe(new rSe(e,this.total))}}class rSe extends y{constructor(e,t){super(e),this.total=t,this.count=0}_next(e){++this.count>this.total&&this.destination.next(e)}}function xi(n){return null!=n&&"false"!=`${n}`}function Xx(n){return Array.isArray(n)?n:[n]}function vs(n){return null==n?"":"string"==typeof n?n:`${n}px`}function ad(n){return n instanceof En?n.nativeElement:n}let zN;try{zN="undefined"!=typeof Intl&&Intl.v8BreakIterator}catch(n){zN=!1}let Eb,qf,HN,Zi=(()=>{class n{constructor(t){this._platformId=t,this.isBrowser=this._platformId?Tf(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&&!zN)&&"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)(Oe(Wc))},n.\u0275prov=We({factory:function(){return new n(Oe(Wc))},token:n,providedIn:"root"}),n})();function vm(n){return function(){if(null==Eb&&"undefined"!=typeof window)try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:()=>Eb=!0}))}finally{Eb=Eb||!1}return Eb}()?n:!!n.capture}function LH(){if(null==qf){if("object"!=typeof document||!document||"function"!=typeof Element||!Element)return qf=!1,qf;if("scrollBehavior"in document.documentElement.style)qf=!0;else{const n=Element.prototype.scrollTo;qf=!!n&&!/\{\s*\[native code\]\s*\}/.test(n.toString())}}return qf}function Zx(){let n="undefined"!=typeof document&&document?document.activeElement:null;for(;n&&n.shadowRoot;){const e=n.shadowRoot.activeElement;if(e===n)break;n=e}return n}function Yf(n){return n.composedPath?n.composedPath()[0]:n.target}let qH=(()=>{class n{constructor(t){this._platform=t}isDisabled(t){return t.hasAttribute("disabled")}isVisible(t){return function(n){return!!(n.offsetWidth||n.offsetHeight||"function"==typeof n.getClientRects&&n.getClientRects().length)}(t)&&"visible"===getComputedStyle(t).visibility}isTabbable(t){if(!this._platform.isBrowser)return!1;const i=function(n){try{return n.frameElement}catch(e){return null}}(function(n){return n.ownerDocument&&n.ownerDocument.defaultView||window}(t));if(i&&(-1===KH(i)||!this.isVisible(i)))return!1;let r=t.nodeName.toLowerCase(),s=KH(t);return t.hasAttribute("contenteditable")?-1!==s:!("iframe"===r||"object"===r||this._platform.WEBKIT&&this._platform.IOS&&!function(n){let e=n.nodeName.toLowerCase(),t="input"===e&&n.type;return"text"===t||"password"===t||"select"===e||"textarea"===e}(t))&&("audio"===r?!!t.hasAttribute("controls")&&-1!==s:"video"===r?-1!==s&&(null!==s||this._platform.FIREFOX||t.hasAttribute("controls")):t.tabIndex>=0)}isFocusable(t,i){return function(n){return!function(n){return function(n){return"input"==n.nodeName.toLowerCase()}(n)&&"hidden"==n.type}(n)&&(function(n){let e=n.nodeName.toLowerCase();return"input"===e||"select"===e||"button"===e||"textarea"===e}(n)||function(n){return function(n){return"a"==n.nodeName.toLowerCase()}(n)&&n.hasAttribute("href")}(n)||n.hasAttribute("contenteditable")||YH(n))}(t)&&!this.isDisabled(t)&&((null==i?void 0:i.ignoreVisibility)||this.isVisible(t))}}return n.\u0275fac=function(t){return new(t||n)(Oe(Zi))},n.\u0275prov=We({factory:function(){return new n(Oe(Zi))},token:n,providedIn:"root"}),n})();function YH(n){if(!n.hasAttribute("tabindex")||void 0===n.tabIndex)return!1;let e=n.getAttribute("tabindex");return"-32768"!=e&&!(!e||isNaN(parseInt(e,10)))}function KH(n){if(!YH(n))return null;const e=parseInt(n.getAttribute("tabindex")||"",10);return isNaN(e)?-1:e}class xSe{constructor(e,t,i,r,s=!1){this._element=e,this._checker=t,this._ngZone=i,this._document=r,this._hasAttached=!1,this.startAnchorListener=()=>this.focusLastTabbableElement(),this.endAnchorListener=()=>this.focusFirstTabbableElement(),this._enabled=!0,s||this.attachAnchors()}get enabled(){return this._enabled}set enabled(e){this._enabled=e,this._startAnchor&&this._endAnchor&&(this._toggleAnchorTabIndex(e,this._startAnchor),this._toggleAnchorTabIndex(e,this._endAnchor))}destroy(){const 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}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(e){return new Promise(t=>{this._executeOnStable(()=>t(this.focusInitialElement(e)))})}focusFirstTabbableElementWhenReady(e){return new Promise(t=>{this._executeOnStable(()=>t(this.focusFirstTabbableElement(e)))})}focusLastTabbableElementWhenReady(e){return new Promise(t=>{this._executeOnStable(()=>t(this.focusLastTabbableElement(e)))})}_getRegionBoundary(e){let t=this._element.querySelectorAll(`[cdk-focus-region-${e}], [cdkFocusRegion${e}], [cdk-focus-${e}]`);for(let i=0;i=0;i--){let r=t[i].nodeType===this._document.ELEMENT_NODE?this._getLastTabbableElement(t[i]):null;if(r)return r}return null}_createAnchor(){const 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}_toggleAnchorTabIndex(e,t){e?t.setAttribute("tabindex","0"):t.removeAttribute("tabindex")}toggleAnchors(e){this._startAnchor&&this._endAnchor&&(this._toggleAnchorTabIndex(e,this._startAnchor),this._toggleAnchorTabIndex(e,this._endAnchor))}_executeOnStable(e){this._ngZone.isStable?e():this._ngZone.onStable.pipe(Wi(1)).subscribe(e)}}let XH=(()=>{class n{constructor(t,i,r){this._checker=t,this._ngZone=i,this._document=r}create(t,i=!1){return new xSe(t,this._checker,this._ngZone,this._document,i)}}return n.\u0275fac=function(t){return new(t||n)(Oe(qH),Oe(gn),Oe(pn))},n.\u0275prov=We({factory:function(){return new n(Oe(qH),Oe(gn),Oe(pn))},token:n,providedIn:"root"}),n})();"undefined"!=typeof Element&∈const JH=new Ht("cdk-input-modality-detector-options"),DSe={ignoreKeys:[18,17,224,91,16]},wm=vm({passive:!0,capture:!0});let tG=(()=>{class n{constructor(t,i,r,s){this._platform=t,this._mostRecentTarget=null,this._modality=new Br(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=Yf(o))},this._onMousedown=o=>{Date.now()-this._lastTouchMs<650||(this._modality.next(function(n){return 0===n.offsetX&&0===n.offsetY}(o)?"keyboard":"mouse"),this._mostRecentTarget=Yf(o))},this._onTouchstart=o=>{!function(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)}(o)?(this._lastTouchMs=Date.now(),this._modality.next("touch"),this._mostRecentTarget=Yf(o)):this._modality.next("keyboard")},this._options=Object.assign(Object.assign({},DSe),s),this.modalityDetected=this._modality.pipe(function(n){return e=>e.lift(new iSe(n))}(1)),this.modalityChanged=this.modalityDetected.pipe(rd()),t.isBrowser&&i.runOutsideAngular(()=>{r.addEventListener("keydown",this._onKeydown,wm),r.addEventListener("mousedown",this._onMousedown,wm),r.addEventListener("touchstart",this._onTouchstart,wm)})}get mostRecentModality(){return this._modality.value}ngOnDestroy(){!this._platform.isBrowser||(document.removeEventListener("keydown",this._onKeydown,wm),document.removeEventListener("mousedown",this._onMousedown,wm),document.removeEventListener("touchstart",this._onTouchstart,wm))}}return n.\u0275fac=function(t){return new(t||n)(Oe(Zi),Oe(gn),Oe(pn),Oe(JH,8))},n.\u0275prov=We({factory:function(){return new n(Oe(Zi),Oe(gn),Oe(pn),Oe(JH,8))},token:n,providedIn:"root"}),n})();const rG=new Ht("cdk-focus-monitor-default-options"),tC=vm({passive:!0,capture:!0});let du=(()=>{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 se,this._rootNodeFocusAndBlurListener=a=>{const l=Yf(a),c="focus"===a.type?this._onFocus:this._onBlur;for(let u=l;u;u=u.parentElement)c.call(this,a,u)},this._document=s,this._detectionMode=(null==o?void 0:o.detectionMode)||0}monitor(t,i=!1){const r=ad(t);if(!this._platform.isBrowser||1!==r.nodeType)return fn(null);const s=function(n){if(function(){if(null==HN){const n="undefined"!=typeof document?document.head:null;HN=!(!n||!n.createShadowRoot&&!n.attachShadow)}return HN}()){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 se,rootNode:s};return this._elementInfo.set(r,a),this._registerGlobalListeners(a),a.subject}stopMonitoring(t){const i=ad(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=ad(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=Yf(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,tC),i.addEventListener("blur",this._rootNodeFocusAndBlurListener,tC)}),this._rootNodeFocusListenerCount.set(i,r+1),1==++this._monitoredElementCount&&(this._ngZone.runOutsideAngular(()=>{this._getWindow().addEventListener("focus",this._windowFocusListener)}),this._inputModalityDetector.modalityDetected.pipe(_r(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,tC),i.removeEventListener("blur",this._rootNodeFocusAndBlurListener,tC),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)(Oe(gn),Oe(Zi),Oe(tG),Oe(pn,8),Oe(rG,8))},n.\u0275prov=We({factory:function(){return new n(Oe(gn),Oe(Zi),Oe(tG),Oe(pn,8),Oe(rG,8))},token:n,providedIn:"root"}),n})();const lG=new Ht("cdk-dir-doc",{providedIn:"root",factory:function(){return Fc(pn)}});let Il=(()=>{class n{constructor(t){if(this.value="ltr",this.change=new sn,t){const r=t.documentElement?t.documentElement.dir:null,s=(t.body?t.body.dir:null)||r;this.value="ltr"===s||"rtl"===s?s:"ltr"}}ngOnDestroy(){this.change.complete()}}return n.\u0275fac=function(t){return new(t||n)(Oe(lG,8))},n.\u0275prov=We({factory:function(){return new n(Oe(lG,8))},token:n,providedIn:"root"}),n})();function nC(...n){return Nt(1)(fn(...n))}function ao(...n){const e=n[n.length-1];return Ce(e)?(n.pop(),t=>nC(n,t,e)):t=>nC(n,t)}function Em(n,e){return{type:7,name:n,definitions:e,options:{}}}function cd(n,e=null){return{type:4,styles:e,timings:n}}function fs(n){return{type:6,styles:n,offset:null}}function vc(n,e,t){return{type:0,name:n,styles:e,options:t}}function ud(n,e,t=null){return{type:1,expr:n,animation:e,options:t}}function hG(n){Promise.resolve(null).then(n)}class Sm{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(){hG(()=>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 pG(){return"undefined"!=typeof window&&void 0!==window.document}function KN(){return"undefined"!=typeof process&&"[object process]"==={}.toString.call(process)}let JN=(n,e)=>!1,eP=(n,e)=>!1,_G=(n,e,t)=>[];const yG=KN();(yG||"undefined"!=typeof Element)&&(JN=pG()?(n,e)=>{for(;e&&e!==document.documentElement;){if(e===n)return!0;e=e.parentNode||e.host}return!1}:(n,e)=>n.contains(e),eP=(()=>{if(yG||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]):eP}})(),_G=(n,e,t)=>{let i=[];if(t){const r=n.querySelectorAll(e);for(let s=0;s{class n{validateStyleProperty(t){return tP(t)}matchesElement(t,i){return nP(t,i)}containsElement(t,i){return iP(t,i)}query(t,i,r){return rP(t,i,r)}computeStyle(t,i,r){return r||""}animate(t,i,r,s,o,a=[],l){return new Sm(r,s)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();class iC{}iC.NOOP=new wG;function CG(n,e,t){return t?e+":"+t+";":""}function AG(n){let e="";for(let t=0;t{const r=cP(i);t&&!t.hasOwnProperty(i)&&(t[i]=n.style[r]),n.style[r]=e[i]}),KN()&&AG(n))}function Qf(n,e){n.style&&(Object.keys(e).forEach(t=>{const i=cP(t);n.style[i]=""}),KN()&&AG(n))}const HSe=/-+([a-z0-9])/g;function cP(n){return n.replace(HSe,(...e)=>e[1].toUpperCase())}function GSe(n){return n.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}class Am{constructor(e,t,i){this._element=e,this._startStyles=t,this._endStyles=i,this._state=0;let r=Am.initialStylesByElement.get(e);r||Am.initialStylesByElement.set(e,r={}),this._initialStyles=r}start(){this._state<1&&(this._startStyles&&hu(this._element,this._startStyles,this._initialStyles),this._state=1)}finish(){this.start(),this._state<2&&(hu(this._element,this._initialStyles),this._endStyles&&(hu(this._element,this._endStyles),this._endStyles=null),this._state=1)}destroy(){this.finish(),this._state<3&&(Am.initialStylesByElement.delete(this._element),this._startStyles&&(Qf(this._element,this._startStyles),this._endStyles=null),this._endStyles&&(Qf(this._element,this._endStyles),this._endStyles=null),hu(this._element,this._initialStyles),this._state=3)}}Am.initialStylesByElement=new WeakMap;const Nl=new Ht("AnimationModuleType");function Mb(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 xP(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?function(n,e=0){return function(n){return!isNaN(parseFloat(n))&&!isNaN(Number(n))}(n)?Number(n):e}(t):this.defaultTabIndex}}}let ep;try{ep="undefined"!=typeof Intl}catch(n){ep=!1}function hd(n,e,t,i){return Y(t)&&(i=t,t=void 0),i?hd(n,e,t).pipe(me(r=>P(r)?i(...r):i(r))):new I(r=>{x$(n,e,function(o){r.next(arguments.length>1?Array.prototype.slice.call(arguments):o)},r,t)})}function x$(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;o0?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 zCe=1;const HCe=Promise.resolve(),xC={};function C$(n){return n in xC&&(delete xC[n],!0)}const A$={setImmediate(n){const e=zCe++;return xC[e]=!0,HCe.then(()=>C$(e)&&n()),e},clearImmediate(n){C$(n)}};new class extends uc{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=A$.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&&(A$.clearImmediate(t),e.scheduled=void 0)}});function Tm(n){return!!n&&(n instanceof I||"function"==typeof n.lift&&"function"==typeof n.subscribe)}class YCe{constructor(e){this.durationSelector=e}call(e,t){return t.subscribe(new KCe(e,this.durationSelector))}}class KCe extends ve{constructor(e,t){super(e),this.durationSelector=t,this.hasValue=!1}_next(e){if(this.value=e,this.hasValue=!0,!this.throttled){let t;try{const{durationSelector:r}=this;t=r(e)}catch(r){return this.destination.error(r)}const i=N(t,new _t(this));!i||i.closed?this.clearThrottle():this.add(this.throttled=i)}}clearThrottle(){const{value:e,hasValue:t,throttled:i}=this;i&&(this.remove(i),this.throttled=void 0,i.unsubscribe()),t&&(this.value=void 0,this.hasValue=!1,this.destination.next(e))}notifyNext(){this.clearThrottle()}notifyComplete(){this.clearThrottle()}}function T$(n){return!P(n)&&n-parseFloat(n)+1>=0}function QCe(n){const{index:e,period:t,subscriber:i}=n;if(i.next(e),!i.closed){if(-1===t)return i.complete();n.index=e+1,this.schedule(n,t)}}function CC(n,e=Kx){return function(n){return function(t){return t.lift(new YCe(n))}}(()=>function(n=0,e,t){let i=-1;return T$(e)?i=Number(e)<1?1:Number(e):Ce(e)&&(t=e),Ce(t)||(t=Kx),new I(r=>{const s=T$(n)?n:+n-t.now();return t.schedule(QCe,s,{index:0,period:i,subscriber:r})})}(n,e))}let D$=(()=>{class n{constructor(){this._listeners=[]}notify(t,i){for(let r of this._listeners)r(t,i)}listen(t){return this._listeners.push(t),()=>{this._listeners=this._listeners.filter(i=>t!==i)}}ngOnDestroy(){this._listeners=[]}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({factory:function(){return new n},token:n,providedIn:"root"}),n})(),Mm=(()=>{class n{constructor(t,i,r){this._ngZone=t,this._platform=i,this._scrolled=new se,this._globalSubscription=null,this._scrolledCount=0,this.scrollContainers=new Map,this._document=r}register(t){this.scrollContainers.has(t)||this.scrollContainers.set(t,t.elementScrolled().subscribe(()=>this._scrolled.next(t)))}deregister(t){const i=this.scrollContainers.get(t);i&&(i.unsubscribe(),this.scrollContainers.delete(t))}scrolled(t=20){return this._platform.isBrowser?new I(i=>{this._globalSubscription||this._addGlobalListener();const r=t>0?this._scrolled.pipe(CC(t)).subscribe(i):this._scrolled.subscribe(i);return this._scrolledCount++,()=>{r.unsubscribe(),this._scrolledCount--,this._scrolledCount||this._removeGlobalListener()}}):fn()}ngOnDestroy(){this._removeGlobalListener(),this.scrollContainers.forEach((t,i)=>this.deregister(i)),this._scrolled.complete()}ancestorScrolled(t,i){const r=this.getAncestorScrollContainers(t);return this.scrolled(i).pipe(Qi(s=>!s||r.indexOf(s)>-1))}getAncestorScrollContainers(t){const i=[];return this.scrollContainers.forEach((r,s)=>{this._scrollableContainsElement(s,t)&&i.push(s)}),i}_getWindow(){return this._document.defaultView||window}_scrollableContainsElement(t,i){let r=ad(i),s=t.getElementRef().nativeElement;do{if(r==s)return!0}while(r=r.parentElement);return!1}_addGlobalListener(){this._globalSubscription=this._ngZone.runOutsideAngular(()=>hd(this._getWindow().document,"scroll").subscribe(()=>this._scrolled.next()))}_removeGlobalListener(){this._globalSubscription&&(this._globalSubscription.unsubscribe(),this._globalSubscription=null)}}return n.\u0275fac=function(t){return new(t||n)(Oe(gn),Oe(Zi),Oe(pn,8))},n.\u0275prov=We({factory:function(){return new n(Oe(gn),Oe(Zi),Oe(pn,8))},token:n,providedIn:"root"}),n})(),Dm=(()=>{class n{constructor(t,i,r){this._platform=t,this._change=new se,this._changeListener=s=>{this._change.next(s)},this._document=r,i.runOutsideAngular(()=>{if(t.isBrowser){const s=this._getWindow();s.addEventListener("resize",this._changeListener),s.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:i,height:r}=this.getViewportSize();return{top:t.top,left:t.left,bottom:t.top+r,right:t.left+i,height:r,width:i}}getViewportScrollPosition(){if(!this._platform.isBrowser)return{top:0,left:0};const t=this._document,i=this._getWindow(),r=t.documentElement,s=r.getBoundingClientRect();return{top:-s.top||t.body.scrollTop||i.scrollY||r.scrollTop||0,left:-s.left||t.body.scrollLeft||i.scrollX||r.scrollLeft||0}}change(t=20){return t>0?this._change.pipe(CC(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 n.\u0275fac=function(t){return new(t||n)(Oe(Zi),Oe(gn),Oe(pn,8))},n.\u0275prov=We({factory:function(){return new n(Oe(Zi),Oe(gn),Oe(pn,8))},token:n,providedIn:"root"}),n})();class DP{attach(e){return this._attachedHost=e,e.attach(this)}detach(){let e=this._attachedHost;null!=e&&(this._attachedHost=null,e.detach())}get isAttached(){return null!=this._attachedHost}setAttachedHost(e){this._attachedHost=e}}class TC extends DP{constructor(e,t,i,r){super(),this.component=e,this.viewContainerRef=t,this.injector=i,this.componentFactoryResolver=r}}class Im extends DP{constructor(e,t,i){super(),this.templateRef=e,this.viewContainerRef=t,this.context=i}get origin(){return this.templateRef.elementRef}attach(e,t=this.context){return this.context=t,super.attach(e)}detach(){return this.context=void 0,super.detach()}}class p1e extends DP{constructor(e){super(),this.element=e instanceof En?e.nativeElement:e}}class MC{constructor(){this._isDisposed=!1,this.attachDomPortal=null}hasAttached(){return!!this._attachedPortal}attach(e){return e instanceof TC?(this._attachedPortal=e,this.attachComponentPortal(e)):e instanceof Im?(this._attachedPortal=e,this.attachTemplatePortal(e)):this.attachDomPortal&&e instanceof p1e?(this._attachedPortal=e,this.attachDomPortal(e)):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(e){this._disposeFn=e}_invokeDisposeFn(){this._disposeFn&&(this._disposeFn(),this._disposeFn=null)}}class g1e extends MC{constructor(e,t,i,r,s){super(),this.outletElement=e,this._componentFactoryResolver=t,this._appRef=i,this._defaultInjector=r,this.attachDomPortal=o=>{const a=o.element,l=this._document.createComment("dom-portal");a.parentNode.insertBefore(l,a),this.outletElement.appendChild(a),this._attachedPortal=o,super.setDisposeFn(()=>{l.parentNode&&l.parentNode.replaceChild(a,l)})},this._document=s}attachComponentPortal(e){const i=(e.componentFactoryResolver||this._componentFactoryResolver).resolveComponentFactory(e.component);let r;return e.viewContainerRef?(r=e.viewContainerRef.createComponent(i,e.viewContainerRef.length,e.injector||e.viewContainerRef.injector),this.setDisposeFn(()=>r.destroy())):(r=i.create(e.injector||this._defaultInjector),this._appRef.attachView(r.hostView),this.setDisposeFn(()=>{this._appRef.detachView(r.hostView),r.destroy()})),this.outletElement.appendChild(this._getComponentRootNode(r)),this._attachedPortal=e,r}attachTemplatePortal(e){let t=e.viewContainerRef,i=t.createEmbeddedView(e.templateRef,e.context);return i.rootNodes.forEach(r=>this.outletElement.appendChild(r)),i.detectChanges(),this.setDisposeFn(()=>{let r=t.indexOf(i);-1!==r&&t.remove(r)}),this._attachedPortal=e,i}dispose(){super.dispose(),null!=this.outletElement.parentNode&&this.outletElement.parentNode.removeChild(this.outletElement)}_getComponentRootNode(e){return e.hostView.rootNodes[0]}}let tp=(()=>{class n extends MC{constructor(t,i,r){super(),this._componentFactoryResolver=t,this._viewContainerRef=i,this._isInitialized=!1,this.attached=new sn,this.attachDomPortal=s=>{const o=s.element,a=this._document.createComment("dom-portal");s.setAttachedHost(this),o.parentNode.insertBefore(a,o),this._getRootNode().appendChild(o),this._attachedPortal=s,super.setDisposeFn(()=>{a.parentNode&&a.parentNode.replaceChild(o,a)})},this._document=r}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 i=null!=t.viewContainerRef?t.viewContainerRef:this._viewContainerRef,s=(t.componentFactoryResolver||this._componentFactoryResolver).resolveComponentFactory(t.component),o=i.createComponent(s,i.length,t.injector||i.injector);return i!==this._viewContainerRef&&this._getRootNode().appendChild(o.hostView.rootNodes[0]),super.setDisposeFn(()=>o.destroy()),this._attachedPortal=t,this._attachedRef=o,this.attached.emit(o),o}attachTemplatePortal(t){t.setAttachedHost(this);const i=this._viewContainerRef.createEmbeddedView(t.templateRef,t.context);return super.setDisposeFn(()=>this._viewContainerRef.clear()),this._attachedPortal=t,this._attachedRef=i,this.attached.emit(i),i}_getRootNode(){const t=this._viewContainerRef.element.nativeElement;return t.nodeType===t.ELEMENT_NODE?t:t.parentNode}}return n.\u0275fac=function(t){return new(t||n)(xe(wl),xe(Ns),xe(pn))},n.\u0275dir=Rt({type:n,selectors:[["","cdkPortalOutlet",""]],inputs:{portal:["cdkPortalOutlet","portal"]},outputs:{attached:"attached"},exportAs:["cdkPortalOutlet"],features:[An]}),n})();const k$=LH();class b1e{constructor(e,t){this._viewportRuler=e,this._previousHTMLStyles={top:"",left:""},this._isEnabled=!1,this._document=t}attach(){}enable(){if(this._canBeEnabled()){const e=this._document.documentElement;this._previousScrollPosition=this._viewportRuler.getViewportScrollPosition(),this._previousHTMLStyles.left=e.style.left||"",this._previousHTMLStyles.top=e.style.top||"",e.style.left=vs(-this._previousScrollPosition.left),e.style.top=vs(-this._previousScrollPosition.top),e.classList.add("cdk-global-scrollblock"),this._isEnabled=!0}}disable(){if(this._isEnabled){const e=this._document.documentElement,i=e.style,r=this._document.body.style,s=i.scrollBehavior||"",o=r.scrollBehavior||"";this._isEnabled=!1,i.left=this._previousHTMLStyles.left,i.top=this._previousHTMLStyles.top,e.classList.remove("cdk-global-scrollblock"),k$&&(i.scrollBehavior=r.scrollBehavior="auto"),window.scroll(this._previousScrollPosition.left,this._previousScrollPosition.top),k$&&(i.scrollBehavior=s,r.scrollBehavior=o)}}_canBeEnabled(){if(this._document.documentElement.classList.contains("cdk-global-scrollblock")||this._isEnabled)return!1;const t=this._document.body,i=this._viewportRuler.getViewportSize();return t.scrollHeight>i.height||t.scrollWidth>i.width}}class v1e{constructor(e,t,i,r){this._scrollDispatcher=e,this._ngZone=t,this._viewportRuler=i,this._config=r,this._scrollSubscription=null,this._detach=()=>{this.disable(),this._overlayRef.hasAttached()&&this._ngZone.run(()=>this._overlayRef.detach())}}attach(e){this._overlayRef=e}enable(){if(this._scrollSubscription)return;const e=this._scrollDispatcher.scrolled(0);this._config&&this._config.threshold&&this._config.threshold>1?(this._initialScrollPosition=this._viewportRuler.getViewportScrollPosition().top,this._scrollSubscription=e.subscribe(()=>{const t=this._viewportRuler.getViewportScrollPosition().top;Math.abs(t-this._initialScrollPosition)>this._config.threshold?this._detach():this._overlayRef.updatePosition()})):this._scrollSubscription=e.subscribe(this._detach)}disable(){this._scrollSubscription&&(this._scrollSubscription.unsubscribe(),this._scrollSubscription=null)}detach(){this.disable(),this._overlayRef=null}}class L${enable(){}disable(){}attach(){}}function IP(n,e){return e.some(t=>n.bottomt.bottom||n.rightt.right)}function B$(n,e){return e.some(t=>n.topt.bottom||n.leftt.right)}class w1e{constructor(e,t,i,r){this._scrollDispatcher=e,this._viewportRuler=t,this._ngZone=i,this._config=r,this._scrollSubscription=null}attach(e){this._overlayRef=e}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:i,height:r}=this._viewportRuler.getViewportSize();IP(t,[{width:i,height:r,bottom:r,right:i,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 E1e=(()=>{class n{constructor(t,i,r,s){this._scrollDispatcher=t,this._viewportRuler=i,this._ngZone=r,this.noop=()=>new L$,this.close=o=>new v1e(this._scrollDispatcher,this._ngZone,this._viewportRuler,o),this.block=()=>new b1e(this._viewportRuler,this._document),this.reposition=o=>new w1e(this._scrollDispatcher,this._viewportRuler,this._ngZone,o),this._document=s}}return n.\u0275fac=function(t){return new(t||n)(Oe(Mm),Oe(Dm),Oe(gn),Oe(pn))},n.\u0275prov=We({factory:function(){return new n(Oe(Mm),Oe(Dm),Oe(gn),Oe(pn))},token:n,providedIn:"root"}),n})();class IC{constructor(e){if(this.scrollStrategy=new L$,this.panelClass="",this.hasBackdrop=!1,this.backdropClass="cdk-overlay-dark-backdrop",this.disposeOnNavigation=!1,e){const t=Object.keys(e);for(const i of t)void 0!==e[i]&&(this[i]=e[i])}}}class S1e{constructor(e,t,i,r,s){this.offsetX=i,this.offsetY=r,this.panelClass=s,this.originX=e.originX,this.originY=e.originY,this.overlayX=t.overlayX,this.overlayY=t.overlayY}}class x1e{constructor(e,t){this.connectionPair=e,this.scrollableViewProperties=t}}let j$=(()=>{class n{constructor(t){this._attachedOverlays=[],this._document=t}ngOnDestroy(){this.detach()}add(t){this.remove(t),this._attachedOverlays.push(t)}remove(t){const i=this._attachedOverlays.indexOf(t);i>-1&&this._attachedOverlays.splice(i,1),0===this._attachedOverlays.length&&this.detach()}}return n.\u0275fac=function(t){return new(t||n)(Oe(pn))},n.\u0275prov=We({factory:function(){return new n(Oe(pn))},token:n,providedIn:"root"}),n})(),C1e=(()=>{class n extends j${constructor(t){super(t),this._keydownListener=i=>{const r=this._attachedOverlays;for(let s=r.length-1;s>-1;s--)if(r[s]._keydownEvents.observers.length>0){r[s]._keydownEvents.next(i);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 n.\u0275fac=function(t){return new(t||n)(Oe(pn))},n.\u0275prov=We({factory:function(){return new n(Oe(pn))},token:n,providedIn:"root"}),n})(),A1e=(()=>{class n extends j${constructor(t,i){super(t),this._platform=i,this._cursorStyleIsSet=!1,this._clickListener=r=>{const s=Yf(r),o=this._attachedOverlays.slice();for(let a=o.length-1;a>-1;a--){const l=o[a];if(!(l._outsidePointerEvents.observers.length<1)&&l.hasAttached()){if(l.overlayElement.contains(s))break;l._outsidePointerEvents.next(r)}}}}add(t){if(super.add(t),!this._isAttached){const i=this._document.body;i.addEventListener("click",this._clickListener,!0),i.addEventListener("auxclick",this._clickListener,!0),i.addEventListener("contextmenu",this._clickListener,!0),this._platform.IOS&&!this._cursorStyleIsSet&&(this._cursorOriginalValue=i.style.cursor,i.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 n.\u0275fac=function(t){return new(t||n)(Oe(pn),Oe(Zi))},n.\u0275prov=We({factory:function(){return new n(Oe(pn),Oe(Zi))},token:n,providedIn:"root"}),n})();const Sh="undefined"!=typeof window?window:{},V$=void 0!==Sh.__karma__&&!!Sh.__karma__||void 0!==Sh.jasmine&&!!Sh.jasmine||void 0!==Sh.jest&&!!Sh.jest||void 0!==Sh.Mocha&&!!Sh.Mocha;let Ob=(()=>{class n{constructor(t,i){this._platform=i,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||V$){const r=this._document.querySelectorAll(`.${t}[platform="server"], .${t}[platform="test"]`);for(let s=0;sthis._backdropClick.next(u),this._keydownEvents=new se,this._outsidePointerEvents=new se,r.scrollStrategy&&(this._scrollStrategy=r.scrollStrategy,this._scrollStrategy.attach(this)),this._positionStrategy=r.positionStrategy}get overlayElement(){return this._pane}get backdropElement(){return this._backdropElement}get hostElement(){return this._host}attach(e){let t=this._portalOutlet.attach(e);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(Wi(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),t}detach(){if(!this.hasAttached())return;this.detachBackdrop(),this._togglePointerEvents(!1),this._positionStrategy&&this._positionStrategy.detach&&this._positionStrategy.detach(),this._scrollStrategy&&this._scrollStrategy.disable();const e=this._portalOutlet.detach();return this._detachments.next(),this._keyboardDispatcher.remove(this),this._detachContentWhenStable(),this._locationChanges.unsubscribe(),this._outsideClickDispatcher.remove(this),e}dispose(){const e=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,e&&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(e){e!==this._positionStrategy&&(this._positionStrategy&&this._positionStrategy.dispose(),this._positionStrategy=e,this.hasAttached()&&(e.attach(this),this.updatePosition()))}updateSize(e){this._config=Object.assign(Object.assign({},this._config),e),this._updateElementSize()}setDirection(e){this._config=Object.assign(Object.assign({},this._config),{direction:e}),this._updateElementDirection()}addPanelClass(e){this._pane&&this._toggleClasses(this._pane,e,!0)}removePanelClass(e){this._pane&&this._toggleClasses(this._pane,e,!1)}getDirection(){const e=this._config.direction;return e?"string"==typeof e?e:e.value:"ltr"}updateScrollStrategy(e){e!==this._scrollStrategy&&(this._disposeScrollStrategy(),this._scrollStrategy=e,this.hasAttached()&&(e.attach(this),e.enable()))}_updateElementDirection(){this._host.setAttribute("dir",this.getDirection())}_updateElementSize(){if(!this._pane)return;const e=this._pane.style;e.width=vs(this._config.width),e.height=vs(this._config.height),e.minWidth=vs(this._config.minWidth),e.minHeight=vs(this._config.minHeight),e.maxWidth=vs(this._config.maxWidth),e.maxHeight=vs(this._config.maxHeight)}_togglePointerEvents(e){this._pane.style.pointerEvents=e?"":"none"}_attachBackdrop(){const e="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(e)})}):this._backdropElement.classList.add(e)}_updateStackingOrder(){this._host.nextSibling&&this._host.parentNode.appendChild(this._host)}detachBackdrop(){let e=this._backdropElement;if(!e)return;let t,i=()=>{e&&(e.removeEventListener("click",this._backdropClickHandler),e.removeEventListener("transitionend",i),e.parentNode&&e.parentNode.removeChild(e)),this._backdropElement==e&&(this._backdropElement=null),this._config.backdropClass&&this._toggleClasses(e,this._config.backdropClass,!1),clearTimeout(t)};e.classList.remove("cdk-overlay-backdrop-showing"),this._ngZone.runOutsideAngular(()=>{e.addEventListener("transitionend",i)}),e.style.pointerEvents="none",t=this._ngZone.runOutsideAngular(()=>setTimeout(i,500))}_toggleClasses(e,t,i){const r=e.classList;Xx(t).forEach(s=>{s&&(i?r.add(s):r.remove(s))})}_detachContentWhenStable(){this._ngZone.runOutsideAngular(()=>{const e=this._ngZone.onStable.pipe(_r(kn(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)),e.unsubscribe())})})}_disposeScrollStrategy(){const e=this._scrollStrategy;e&&(e.disable(),e.detach&&e.detach())}}const U$="cdk-overlay-connected-position-bounding-box",M1e=/([A-Za-z%]+)$/;class z${constructor(e,t,i,r,s){this._viewportRuler=t,this._document=i,this._platform=r,this._overlayContainer=s,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 se,this._resizeSubscription=x.EMPTY,this._offsetX=0,this._offsetY=0,this._appliedPanelClasses=[],this.positionChanges=this._positionChanges,this.setOrigin(e)}get positions(){return this._preferredPositions}attach(e){this._validatePositions(),e.hostElement.classList.add(U$),this._overlayRef=e,this._boundingBox=e.hostElement,this._pane=e.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 e=this._originRect,t=this._overlayRect,i=this._viewportRect,r=[];let s;for(let o of this._preferredPositions){let a=this._getOriginPoint(e,o),l=this._getOverlayPoint(a,t,o),c=this._getOverlayFit(l,t,i,o);if(c.isCompletelyWithinViewport)return this._isPushed=!1,void this._applyPosition(o,a);this._canFitWithFlexibleDimensions(c,l,i)?r.push({position:o,origin:a,overlayRect:t,boundingBoxRect:this._calculateBoundingBoxRect(a,o)}):(!s||s.overlayFit.visibleAreaa&&(a=c,o=l)}return this._isPushed=!1,void this._applyPosition(o.position,o.origin)}if(this._canPush)return this._isPushed=!0,void this._applyPosition(s.position,s.originPoint);this._applyPosition(s.position,s.originPoint)}detach(){this._clearPanelClasses(),this._lastPosition=null,this._previousPushAmount=null,this._resizeSubscription.unsubscribe()}dispose(){this._isDisposed||(this._boundingBox&&np(this._boundingBox.style,{top:"",left:"",right:"",bottom:"",height:"",width:"",alignItems:"",justifyContent:""}),this._pane&&this._resetOverlayElementStyles(),this._overlayRef&&this._overlayRef.hostElement.classList.remove(U$),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 e=this._lastPosition||this._preferredPositions[0],t=this._getOriginPoint(this._originRect,e);this._applyPosition(e,t)}}withScrollableContainers(e){return this._scrollables=e,this}withPositions(e){return this._preferredPositions=e,-1===e.indexOf(this._lastPosition)&&(this._lastPosition=null),this._validatePositions(),this}withViewportMargin(e){return this._viewportMargin=e,this}withFlexibleDimensions(e=!0){return this._hasFlexibleDimensions=e,this}withGrowAfterOpen(e=!0){return this._growAfterOpen=e,this}withPush(e=!0){return this._canPush=e,this}withLockedPosition(e=!0){return this._positionLocked=e,this}setOrigin(e){return this._origin=e,this}withDefaultOffsetX(e){return this._offsetX=e,this}withDefaultOffsetY(e){return this._offsetY=e,this}withTransformOriginOn(e){return this._transformOriginSelector=e,this}_getOriginPoint(e,t){let i,r;if("center"==t.originX)i=e.left+e.width/2;else{const s=this._isRtl()?e.right:e.left,o=this._isRtl()?e.left:e.right;i="start"==t.originX?s:o}return r="center"==t.originY?e.top+e.height/2:"top"==t.originY?e.top:e.bottom,{x:i,y:r}}_getOverlayPoint(e,t,i){let r,s;return r="center"==i.overlayX?-t.width/2:"start"===i.overlayX?this._isRtl()?-t.width:0:this._isRtl()?0:-t.width,s="center"==i.overlayY?-t.height/2:"top"==i.overlayY?0:-t.height,{x:e.x+r,y:e.y+s}}_getOverlayFit(e,t,i,r){const s=G$(t);let{x:o,y:a}=e,l=this._getOffset(r,"x"),c=this._getOffset(r,"y");l&&(o+=l),c&&(a+=c);let p=0-a,g=a+s.height-i.height,m=this._subtractOverflows(s.width,0-o,o+s.width-i.width),w=this._subtractOverflows(s.height,p,g),C=m*w;return{visibleArea:C,isCompletelyWithinViewport:s.width*s.height===C,fitsInViewportVertically:w===s.height,fitsInViewportHorizontally:m==s.width}}_canFitWithFlexibleDimensions(e,t,i){if(this._hasFlexibleDimensions){const r=i.bottom-t.y,s=i.right-t.x,o=H$(this._overlayRef.getConfig().minHeight),a=H$(this._overlayRef.getConfig().minWidth),c=e.fitsInViewportHorizontally||null!=a&&a<=s;return(e.fitsInViewportVertically||null!=o&&o<=r)&&c}return!1}_pushOverlayOnScreen(e,t,i){if(this._previousPushAmount&&this._positionLocked)return{x:e.x+this._previousPushAmount.x,y:e.y+this._previousPushAmount.y};const r=G$(t),s=this._viewportRect,o=Math.max(e.x+r.width-s.width,0),a=Math.max(e.y+r.height-s.height,0),l=Math.max(s.top-i.top-e.y,0),c=Math.max(s.left-i.left-e.x,0);let u=0,h=0;return u=r.width<=s.width?c||-o:e.xm&&!this._isInitialRender&&!this._growAfterOpen&&(o=e.y-m/2)}if("end"===t.overlayX&&!r||"start"===t.overlayX&&r)p=i.width-e.x+this._viewportMargin,u=e.x-this._viewportMargin;else if("start"===t.overlayX&&!r||"end"===t.overlayX&&r)h=e.x,u=i.right-e.x;else{const g=Math.min(i.right-e.x+i.left,e.x),m=this._lastBoundingBoxSize.width;u=2*g,h=e.x-g,u>m&&!this._isInitialRender&&!this._growAfterOpen&&(h=e.x-m/2)}return{top:o,left:h,bottom:a,right:p,width:u,height:s}}_setBoundingBoxStyles(e,t){const i=this._calculateBoundingBoxRect(e,t);!this._isInitialRender&&!this._growAfterOpen&&(i.height=Math.min(i.height,this._lastBoundingBoxSize.height),i.width=Math.min(i.width,this._lastBoundingBoxSize.width));const r={};if(this._hasExactPosition())r.top=r.left="0",r.bottom=r.right=r.maxHeight=r.maxWidth="",r.width=r.height="100%";else{const s=this._overlayRef.getConfig().maxHeight,o=this._overlayRef.getConfig().maxWidth;r.height=vs(i.height),r.top=vs(i.top),r.bottom=vs(i.bottom),r.width=vs(i.width),r.left=vs(i.left),r.right=vs(i.right),r.alignItems="center"===t.overlayX?"center":"end"===t.overlayX?"flex-end":"flex-start",r.justifyContent="center"===t.overlayY?"center":"bottom"===t.overlayY?"flex-end":"flex-start",s&&(r.maxHeight=vs(s)),o&&(r.maxWidth=vs(o))}this._lastBoundingBoxSize=i,np(this._boundingBox.style,r)}_resetBoundingBoxStyles(){np(this._boundingBox.style,{top:"0",left:"0",right:"0",bottom:"0",height:"",width:"",alignItems:"",justifyContent:""})}_resetOverlayElementStyles(){np(this._pane.style,{top:"",left:"",bottom:"",right:"",position:"",transform:""})}_setOverlayElementStyles(e,t){const i={},r=this._hasExactPosition(),s=this._hasFlexibleDimensions,o=this._overlayRef.getConfig();if(r){const u=this._viewportRuler.getViewportScrollPosition();np(i,this._getExactOverlayY(t,e,u)),np(i,this._getExactOverlayX(t,e,u))}else i.position="static";let a="",l=this._getOffset(t,"x"),c=this._getOffset(t,"y");l&&(a+=`translateX(${l}px) `),c&&(a+=`translateY(${c}px)`),i.transform=a.trim(),o.maxHeight&&(r?i.maxHeight=vs(o.maxHeight):s&&(i.maxHeight="")),o.maxWidth&&(r?i.maxWidth=vs(o.maxWidth):s&&(i.maxWidth="")),np(this._pane.style,i)}_getExactOverlayY(e,t,i){let r={top:"",bottom:""},s=this._getOverlayPoint(t,this._overlayRect,e);this._isPushed&&(s=this._pushOverlayOnScreen(s,this._overlayRect,i));let o=this._overlayContainer.getContainerElement().getBoundingClientRect().top;return s.y-=o,"bottom"===e.overlayY?r.bottom=this._document.documentElement.clientHeight-(s.y+this._overlayRect.height)+"px":r.top=vs(s.y),r}_getExactOverlayX(e,t,i){let o,r={left:"",right:""},s=this._getOverlayPoint(t,this._overlayRect,e);return this._isPushed&&(s=this._pushOverlayOnScreen(s,this._overlayRect,i)),o=this._isRtl()?"end"===e.overlayX?"left":"right":"end"===e.overlayX?"right":"left","right"===o?r.right=this._document.documentElement.clientWidth-(s.x+this._overlayRect.width)+"px":r.left=vs(s.x),r}_getScrollVisibility(){const e=this._getOriginRect(),t=this._pane.getBoundingClientRect(),i=this._scrollables.map(r=>r.getElementRef().nativeElement.getBoundingClientRect());return{isOriginClipped:B$(e,i),isOriginOutsideView:IP(e,i),isOverlayClipped:B$(t,i),isOverlayOutsideView:IP(t,i)}}_subtractOverflows(e,...t){return t.reduce((i,r)=>i-Math.max(r,0),e)}_getNarrowedViewportRect(){const e=this._document.documentElement.clientWidth,t=this._document.documentElement.clientHeight,i=this._viewportRuler.getViewportScrollPosition();return{top:i.top+this._viewportMargin,left:i.left+this._viewportMargin,right:i.left+e-this._viewportMargin,bottom:i.top+t-this._viewportMargin,width:e-2*this._viewportMargin,height:t-2*this._viewportMargin}}_isRtl(){return"rtl"===this._overlayRef.getDirection()}_hasExactPosition(){return!this._hasFlexibleDimensions||this._isPushed}_getOffset(e,t){return"x"===t?null==e.offsetX?this._offsetX:e.offsetX:null==e.offsetY?this._offsetY:e.offsetY}_validatePositions(){}_addPanelClasses(e){this._pane&&Xx(e).forEach(t=>{""!==t&&-1===this._appliedPanelClasses.indexOf(t)&&(this._appliedPanelClasses.push(t),this._pane.classList.add(t))})}_clearPanelClasses(){this._pane&&(this._appliedPanelClasses.forEach(e=>{this._pane.classList.remove(e)}),this._appliedPanelClasses=[])}_getOriginRect(){const e=this._origin;if(e instanceof En)return e.nativeElement.getBoundingClientRect();if(e instanceof Element)return e.getBoundingClientRect();const t=e.width||0,i=e.height||0;return{top:e.y,bottom:e.y+i,left:e.x,right:e.x+t,height:i,width:t}}}function np(n,e){for(let t in e)e.hasOwnProperty(t)&&(n[t]=e[t]);return n}function H$(n){if("number"!=typeof n&&null!=n){const[e,t]=n.split(M1e);return t&&"px"!==t?null:parseFloat(e)}return n||null}function G$(n){return{top:Math.floor(n.top),right:Math.floor(n.right),bottom:Math.floor(n.bottom),left:Math.floor(n.left),width:Math.floor(n.width),height:Math.floor(n.height)}}class D1e{constructor(e,t,i,r,s,o,a){this._preferredPositions=[],this._positionStrategy=new z$(i,r,s,o,a).withFlexibleDimensions(!1).withPush(!1).withViewportMargin(0),this.withFallbackPosition(e,t),this.onPositionChange=this._positionStrategy.positionChanges}get positions(){return this._preferredPositions}attach(e){this._overlayRef=e,this._positionStrategy.attach(e),this._direction&&(e.setDirection(this._direction),this._direction=null)}dispose(){this._positionStrategy.dispose()}detach(){this._positionStrategy.detach()}apply(){this._positionStrategy.apply()}recalculateLastPosition(){this._positionStrategy.reapplyLastPosition()}withScrollableContainers(e){this._positionStrategy.withScrollableContainers(e)}withFallbackPosition(e,t,i,r){const s=new S1e(e,t,i,r);return this._preferredPositions.push(s),this._positionStrategy.withPositions(this._preferredPositions),this}withDirection(e){return this._overlayRef?this._overlayRef.setDirection(e):this._direction=e,this}withOffsetX(e){return this._positionStrategy.withDefaultOffsetX(e),this}withOffsetY(e){return this._positionStrategy.withDefaultOffsetY(e),this}withLockedPosition(e){return this._positionStrategy.withLockedPosition(e),this}withPositions(e){return this._preferredPositions=e.slice(),this._positionStrategy.withPositions(this._preferredPositions),this}setOrigin(e){return this._positionStrategy.setOrigin(e),this}}const W$="cdk-global-overlay-wrapper";class I1e{constructor(){this._cssPosition="static",this._topOffset="",this._bottomOffset="",this._leftOffset="",this._rightOffset="",this._alignItems="",this._justifyContent="",this._width="",this._height=""}attach(e){const t=e.getConfig();this._overlayRef=e,this._width&&!t.width&&e.updateSize({width:this._width}),this._height&&!t.height&&e.updateSize({height:this._height}),e.hostElement.classList.add(W$),this._isDisposed=!1}top(e=""){return this._bottomOffset="",this._topOffset=e,this._alignItems="flex-start",this}left(e=""){return this._rightOffset="",this._leftOffset=e,this._justifyContent="flex-start",this}bottom(e=""){return this._topOffset="",this._bottomOffset=e,this._alignItems="flex-end",this}right(e=""){return this._leftOffset="",this._rightOffset=e,this._justifyContent="flex-end",this}width(e=""){return this._overlayRef?this._overlayRef.updateSize({width:e}):this._width=e,this}height(e=""){return this._overlayRef?this._overlayRef.updateSize({height:e}):this._height=e,this}centerHorizontally(e=""){return this.left(e),this._justifyContent="center",this}centerVertically(e=""){return this.top(e),this._alignItems="center",this}apply(){if(!this._overlayRef||!this._overlayRef.hasAttached())return;const e=this._overlayRef.overlayElement.style,t=this._overlayRef.hostElement.style,i=this._overlayRef.getConfig(),{width:r,height:s,maxWidth:o,maxHeight:a}=i,l=!("100%"!==r&&"100vw"!==r||o&&"100%"!==o&&"100vw"!==o),c=!("100%"!==s&&"100vh"!==s||a&&"100%"!==a&&"100vh"!==a);e.position=this._cssPosition,e.marginLeft=l?"0":this._leftOffset,e.marginTop=c?"0":this._topOffset,e.marginBottom=this._bottomOffset,e.marginRight=this._rightOffset,l?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=c?"flex-start":this._alignItems}dispose(){if(this._isDisposed||!this._overlayRef)return;const e=this._overlayRef.overlayElement.style,t=this._overlayRef.hostElement,i=t.style;t.classList.remove(W$),i.justifyContent=i.alignItems=e.marginTop=e.marginBottom=e.marginLeft=e.marginRight=e.position="",this._overlayRef=null,this._isDisposed=!0}}let O1e=(()=>{class n{constructor(t,i,r,s){this._viewportRuler=t,this._document=i,this._platform=r,this._overlayContainer=s}global(){return new I1e}connectedTo(t,i,r){return new D1e(i,r,t,this._viewportRuler,this._document,this._platform,this._overlayContainer)}flexibleConnectedTo(t){return new z$(t,this._viewportRuler,this._document,this._platform,this._overlayContainer)}}return n.\u0275fac=function(t){return new(t||n)(Oe(Dm),Oe(pn),Oe(Zi),Oe(Ob))},n.\u0275prov=We({factory:function(){return new n(Oe(Dm),Oe(pn),Oe(Zi),Oe(Ob))},token:n,providedIn:"root"}),n})(),R1e=0,wc=(()=>{class n{constructor(t,i,r,s,o,a,l,c,u,h,p){this.scrollStrategies=t,this._overlayContainer=i,this._componentFactoryResolver=r,this._positionBuilder=s,this._keyboardDispatcher=o,this._injector=a,this._ngZone=l,this._document=c,this._directionality=u,this._location=h,this._outsideClickDispatcher=p}create(t){const i=this._createHostElement(),r=this._createPaneElement(i),s=this._createPortalOutlet(r),o=new IC(t);return o.direction=o.direction||this._directionality.value,new T1e(s,i,r,o,this._ngZone,this._keyboardDispatcher,this._document,this._location,this._outsideClickDispatcher)}position(){return this._positionBuilder}_createPaneElement(t){const i=this._document.createElement("div");return i.id="cdk-overlay-"+R1e++,i.classList.add("cdk-overlay-pane"),t.appendChild(i),i}_createHostElement(){const t=this._document.createElement("div");return this._overlayContainer.getContainerElement().appendChild(t),t}_createPortalOutlet(t){return this._appRef||(this._appRef=this._injector.get(ih)),new g1e(t,this._componentFactoryResolver,this._appRef,this._injector,this._document)}}return n.\u0275fac=function(t){return new(t||n)(Oe(E1e),Oe(Ob),Oe(wl),Oe(O1e),Oe(C1e),Oe(Wn),Oe(gn),Oe(pn),Oe(Il),Oe(Pg),Oe(A1e))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();function a7(...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{this.headers=new Map,e.split("\n").forEach(t=>{const i=t.indexOf(":");if(i>0){const r=t.slice(0,i),s=r.toLowerCase(),o=t.slice(i+1).trim();this.maybeSetNormalizedName(r,s),this.headers.has(s)?this.headers.get(s).push(o):this.headers.set(s,[o])}})}:()=>{this.headers=new Map,Object.keys(e).forEach(t=>{let i=e[t];const r=t.toLowerCase();"string"==typeof i&&(i=[i]),i.length>0&&(this.headers.set(r,i),this.maybeSetNormalizedName(t,r))})}:this.headers=new Map}has(e){return this.init(),this.headers.has(e.toLowerCase())}get(e){this.init();const t=this.headers.get(e.toLowerCase());return t&&t.length>0?t[0]:null}keys(){return this.init(),Array.from(this.normalizedNames.values())}getAll(e){return this.init(),this.headers.get(e.toLowerCase())||null}append(e,t){return this.clone({name:e,value:t,op:"a"})}set(e,t){return this.clone({name:e,value:t,op:"s"})}delete(e,t){return this.clone({name:e,value:t,op:"d"})}maybeSetNormalizedName(e,t){this.normalizedNames.has(t)||this.normalizedNames.set(t,e)}init(){this.lazyInit&&(this.lazyInit instanceof fd?this.copyFrom(this.lazyInit):this.lazyInit(),this.lazyInit=null,this.lazyUpdate&&(this.lazyUpdate.forEach(e=>this.applyUpdate(e)),this.lazyUpdate=null))}copyFrom(e){e.init(),Array.from(e.headers.keys()).forEach(t=>{this.headers.set(t,e.headers.get(t)),this.normalizedNames.set(t,e.normalizedNames.get(t))})}clone(e){const t=new fd;return t.lazyInit=this.lazyInit&&this.lazyInit instanceof fd?this.lazyInit:this,t.lazyUpdate=(this.lazyUpdate||[]).concat([e]),t}applyUpdate(e){const t=e.name.toLowerCase();switch(e.op){case"a":case"s":let i=e.value;if("string"==typeof i&&(i=[i]),0===i.length)return;this.maybeSetNormalizedName(e.name,t);const r=("a"===e.op?this.headers.get(t):void 0)||[];r.push(...i),this.headers.set(t,r);break;case"d":const s=e.value;if(s){let o=this.headers.get(t);if(!o)return;o=o.filter(a=>-1===s.indexOf(a)),0===o.length?(this.headers.delete(t),this.normalizedNames.delete(t)):this.headers.set(t,o)}else this.headers.delete(t),this.normalizedNames.delete(t)}}forEach(e){this.init(),Array.from(this.normalizedNames.keys()).forEach(t=>e(this.normalizedNames.get(t),this.headers.get(t)))}}class iTe{encodeKey(e){return w7(e)}encodeValue(e){return w7(e)}decodeKey(e){return decodeURIComponent(e)}decodeValue(e){return decodeURIComponent(e)}}const sTe=/%(\d[a-f0-9])/gi,oTe={40:"@","3A":":",24:"$","2C":",","3B":";","2B":"+","3D":"=","3F":"?","2F":"/"};function w7(n){return encodeURIComponent(n).replace(sTe,(e,t)=>{var i;return null!==(i=oTe[t])&&void 0!==i?i:e})}function E7(n){return`${n}`}class xh{constructor(e={}){if(this.updates=null,this.cloneFrom=null,this.encoder=e.encoder||new iTe,e.fromString){if(e.fromObject)throw new Error("Cannot specify both fromString and fromObject.");this.map=function(n,e){const t=new Map;return n.length>0&&n.replace(/^\?/,"").split("&").forEach(r=>{const s=r.indexOf("="),[o,a]=-1==s?[e.decodeKey(r),""]:[e.decodeKey(r.slice(0,s)),e.decodeValue(r.slice(s+1))],l=t.get(o)||[];l.push(a),t.set(o,l)}),t}(e.fromString,this.encoder)}else e.fromObject?(this.map=new Map,Object.keys(e.fromObject).forEach(t=>{const i=e.fromObject[t];this.map.set(t,Array.isArray(i)?i:[i])})):this.map=null}has(e){return this.init(),this.map.has(e)}get(e){this.init();const t=this.map.get(e);return t?t[0]:null}getAll(e){return this.init(),this.map.get(e)||null}keys(){return this.init(),Array.from(this.map.keys())}append(e,t){return this.clone({param:e,value:t,op:"a"})}appendAll(e){const t=[];return Object.keys(e).forEach(i=>{const r=e[i];Array.isArray(r)?r.forEach(s=>{t.push({param:i,value:s,op:"a"})}):t.push({param:i,value:r,op:"a"})}),this.clone(t)}set(e,t){return this.clone({param:e,value:t,op:"s"})}delete(e,t){return this.clone({param:e,value:t,op:"d"})}toString(){return this.init(),this.keys().map(e=>{const t=this.encoder.encodeKey(e);return this.map.get(e).map(i=>t+"="+this.encoder.encodeValue(i)).join("&")}).filter(e=>""!==e).join("&")}clone(e){const t=new xh({encoder:this.encoder});return t.cloneFrom=this.cloneFrom||this,t.updates=(this.updates||[]).concat(e),t}init(){null===this.map&&(this.map=new Map),null!==this.cloneFrom&&(this.cloneFrom.init(),this.cloneFrom.keys().forEach(e=>this.map.set(e,this.cloneFrom.map.get(e))),this.updates.forEach(e=>{switch(e.op){case"a":case"s":const t=("a"===e.op?this.map.get(e.param):void 0)||[];t.push(E7(e.value)),this.map.set(e.param,t);break;case"d":if(void 0===e.value){this.map.delete(e.param);break}{let i=this.map.get(e.param)||[];const r=i.indexOf(E7(e.value));-1!==r&&i.splice(r,1),i.length>0?this.map.set(e.param,i):this.map.delete(e.param)}}}),this.cloneFrom=this.updates=null)}}class aTe{constructor(){this.map=new Map}set(e,t){return this.map.set(e,t),this}get(e){return this.map.has(e)||this.map.set(e,e.defaultValue()),this.map.get(e)}delete(e){return this.map.delete(e),this}keys(){return this.map.keys()}}function S7(n){return"undefined"!=typeof ArrayBuffer&&n instanceof ArrayBuffer}function x7(n){return"undefined"!=typeof Blob&&n instanceof Blob}function C7(n){return"undefined"!=typeof FormData&&n instanceof FormData}class Rb{constructor(e,t,i,r){let s;if(this.url=t,this.body=null,this.reportProgress=!1,this.withCredentials=!1,this.responseType="json",this.method=e.toUpperCase(),function(n){switch(n){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,s=r):s=i,s&&(this.reportProgress=!!s.reportProgress,this.withCredentials=!!s.withCredentials,s.responseType&&(this.responseType=s.responseType),s.headers&&(this.headers=s.headers),s.context&&(this.context=s.context),s.params&&(this.params=s.params)),this.headers||(this.headers=new fd),this.context||(this.context=new aTe),this.params){const o=this.params.toString();if(0===o.length)this.urlWithParams=t;else{const a=t.indexOf("?");this.urlWithParams=t+(-1===a?"?":ap.set(g,e.setHeaders[g]),c)),e.setParams&&(u=Object.keys(e.setParams).reduce((p,g)=>p.set(g,e.setParams[g]),u)),new Rb(i,r,o,{params:u,headers:c,context:h,reportProgress:l,responseType:s,withCredentials:a})}}var ws=(()=>((ws=ws||{})[ws.Sent=0]="Sent",ws[ws.UploadProgress=1]="UploadProgress",ws[ws.ResponseHeader=2]="ResponseHeader",ws[ws.DownloadProgress=3]="DownloadProgress",ws[ws.Response=4]="Response",ws[ws.User=5]="User",ws))();class RC extends class{constructor(e,t=200,i="OK"){this.headers=e.headers||new fd,this.status=void 0!==e.status?e.status:t,this.statusText=e.statusText||i,this.url=e.url||null,this.ok=this.status>=200&&this.status<300}}{constructor(e={}){super(e),this.type=ws.Response,this.body=void 0!==e.body?e.body:null}clone(e={}){return new RC({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})}}function LP(n,e){return{body:e,headers:n.headers,context:n.context,observe:n.observe,params:n.params,reportProgress:n.reportProgress,responseType:n.responseType,withCredentials:n.withCredentials}}let ip=(()=>{class n{constructor(t){this.handler=t}request(t,i,r={}){let s;if(t instanceof Rb)s=t;else{let l,c;l=r.headers instanceof fd?r.headers:new fd(r.headers),r.params&&(c=r.params instanceof xh?r.params:new xh({fromObject:r.params})),s=new Rb(t,i,void 0!==r.body?r.body:null,{headers:l,context:r.context,params:c,reportProgress:r.reportProgress,responseType:r.responseType||"json",withCredentials:r.withCredentials})}const o=fn(s).pipe(function(n,e){return B(n,e,1)}(l=>this.handler.handle(l)));if(t instanceof Rb||"events"===r.observe)return o;const a=o.pipe(Qi(l=>l instanceof RC));switch(r.observe||"body"){case"body":switch(s.responseType){case"arraybuffer":return a.pipe(me(l=>{if(null!==l.body&&!(l.body instanceof ArrayBuffer))throw new Error("Response is not an ArrayBuffer.");return l.body}));case"blob":return a.pipe(me(l=>{if(null!==l.body&&!(l.body instanceof Blob))throw new Error("Response is not a Blob.");return l.body}));case"text":return a.pipe(me(l=>{if(null!==l.body&&"string"!=typeof l.body)throw new Error("Response is not a string.");return l.body}));case"json":default:return a.pipe(me(l=>l.body))}case"response":return a;default:throw new Error(`Unreachable: unhandled observe type ${r.observe}}`)}}delete(t,i={}){return this.request("DELETE",t,i)}get(t,i={}){return this.request("GET",t,i)}head(t,i={}){return this.request("HEAD",t,i)}jsonp(t,i){return this.request("JSONP",t,{params:(new xh).append(i,"JSONP_CALLBACK"),observe:"body",responseType:"json"})}options(t,i={}){return this.request("OPTIONS",t,i)}patch(t,i,r={}){return this.request("PATCH",t,LP(r,i))}post(t,i,r={}){return this.request("POST",t,LP(r,i))}put(t,i,r={}){return this.request("PUT",t,LP(r,i))}}return n.\u0275fac=function(t){return new(t||n)(Oe(b7))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const _Te=["*"];function O7(n){return Error(`Unable to find icon with the name "${n}"`)}function R7(n){return Error(`The URL provided to MatIconRegistry was not trusted as a resource URL via Angular's DomSanitizer. Attempted URL was "${n}".`)}function N7(n){return Error(`The literal provided to MatIconRegistry was not trusted as safe HTML by Angular's DomSanitizer. Attempted literal was "${n}".`)}class rp{constructor(e,t,i){this.url=e,this.svgText=t,this.options=i}}let NC=(()=>{class n{constructor(t,i,r,s){this._httpClient=t,this._sanitizer=i,this._errorHandler=s,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=r}addSvgIcon(t,i,r){return this.addSvgIconInNamespace("",t,i,r)}addSvgIconLiteral(t,i,r){return this.addSvgIconLiteralInNamespace("",t,i,r)}addSvgIconInNamespace(t,i,r,s){return this._addSvgIconConfig(t,i,new rp(r,null,s))}addSvgIconResolver(t){return this._resolvers.push(t),this}addSvgIconLiteralInNamespace(t,i,r,s){const o=this._sanitizer.sanitize(ni.HTML,r);if(!o)throw N7(r);return this._addSvgIconConfig(t,i,new rp("",o,s))}addSvgIconSet(t,i){return this.addSvgIconSetInNamespace("",t,i)}addSvgIconSetLiteral(t,i){return this.addSvgIconSetLiteralInNamespace("",t,i)}addSvgIconSetInNamespace(t,i,r){return this._addSvgIconSetConfig(t,new rp(i,null,r))}addSvgIconSetLiteralInNamespace(t,i,r){const s=this._sanitizer.sanitize(ni.HTML,i);if(!s)throw N7(i);return this._addSvgIconSetConfig(t,new rp("",s,r))}registerFontClassAlias(t,i=t){return this._fontCssClassesByAlias.set(t,i),this}classNameForFontAlias(t){return this._fontCssClassesByAlias.get(t)||t}setDefaultFontSetClass(t){return this._defaultFontSetClass=t,this}getDefaultFontSetClass(){return this._defaultFontSetClass}getSvgIconFromUrl(t){const i=this._sanitizer.sanitize(ni.RESOURCE_URL,t);if(!i)throw R7(t);const r=this._cachedIconsByUrl.get(i);return r?fn(PC(r)):this._loadSvgIconFromConfig(new rp(t,null)).pipe(Yr(s=>this._cachedIconsByUrl.set(i,s)),me(s=>PC(s)))}getNamedSvgIcon(t,i=""){const r=P7(i,t);let s=this._svgIconConfigs.get(r);if(s)return this._getSvgFromConfig(s);if(s=this._getIconConfigFromResolvers(i,t),s)return this._svgIconConfigs.set(r,s),this._getSvgFromConfig(s);const o=this._iconSetConfigs.get(i);return o?this._getSvgFromIconSetConfigs(t,o):Fg(O7(r))}ngOnDestroy(){this._resolvers=[],this._svgIconConfigs.clear(),this._iconSetConfigs.clear(),this._cachedIconsByUrl.clear()}_getSvgFromConfig(t){return t.svgText?fn(PC(this._svgElementFromConfig(t))):this._loadSvgIconFromConfig(t).pipe(me(i=>PC(i)))}_getSvgFromIconSetConfigs(t,i){const r=this._extractIconWithNameFromAnySet(t,i);return r?fn(r):ub(i.filter(o=>!o.svgText).map(o=>this._loadSvgIconSetFromConfig(o).pipe(bc(a=>{const c=`Loading icon set URL: ${this._sanitizer.sanitize(ni.RESOURCE_URL,o.url)} failed: ${a.message}`;return this._errorHandler.handleError(new Error(c)),fn(null)})))).pipe(me(()=>{const o=this._extractIconWithNameFromAnySet(t,i);if(!o)throw O7(t);return o}))}_extractIconWithNameFromAnySet(t,i){for(let r=i.length-1;r>=0;r--){const s=i[r];if(s.svgText&&s.svgText.indexOf(t)>-1){const o=this._svgElementFromConfig(s),a=this._extractSvgIconFromSet(o,t,s.options);if(a)return a}}return null}_loadSvgIconFromConfig(t){return this._fetchIcon(t).pipe(Yr(i=>t.svgText=i),me(()=>this._svgElementFromConfig(t)))}_loadSvgIconSetFromConfig(t){return t.svgText?fn(null):this._fetchIcon(t).pipe(Yr(i=>t.svgText=i))}_extractSvgIconFromSet(t,i,r){const s=t.querySelector(`[id="${i}"]`);if(!s)return null;const o=s.cloneNode(!0);if(o.removeAttribute("id"),"svg"===o.nodeName.toLowerCase())return this._setSvgAttributes(o,r);if("symbol"===o.nodeName.toLowerCase())return this._setSvgAttributes(this._toSvgElement(o),r);const a=this._svgElementFromString("");return a.appendChild(o),this._setSvgAttributes(a,r)}_svgElementFromString(t){const i=this._document.createElement("DIV");i.innerHTML=t;const r=i.querySelector("svg");if(!r)throw Error(" tag not found");return r}_toSvgElement(t){const i=this._svgElementFromString(""),r=t.attributes;for(let s=0;se.lift(new tTe(n))}(()=>this._inProgressUrlFetches.delete(a)),Es());return this._inProgressUrlFetches.set(a,c),c}_addSvgIconConfig(t,i,r){return this._svgIconConfigs.set(P7(t,i),r),this}_addSvgIconSetConfig(t,i){const r=this._iconSetConfigs.get(t);return r?r.push(i):this._iconSetConfigs.set(t,[i]),this}_svgElementFromConfig(t){if(!t.svgElement){const i=this._svgElementFromString(t.svgText);this._setSvgAttributes(i,t.options),t.svgElement=i}return t.svgElement}_getIconConfigFromResolvers(t,i){for(let r=0;re?e.pathname+e.search:""}}}),F7=["clip-path","color-profile","src","cursor","fill","filter","marker","marker-start","marker-mid","marker-end","mask","stroke"],CTe=F7.map(n=>`[${n}]`).join(", "),ATe=/^url\(['"]?#(.*?)['"]?\)$/;let Nm=(()=>{class n extends wTe{constructor(t,i,r,s,o){super(t),this._iconRegistry=i,this._location=s,this._errorHandler=o,this._inline=!1,this._currentIconFetch=x.EMPTY,r||t.nativeElement.setAttribute("aria-hidden","true")}get inline(){return this._inline}set inline(t){this._inline=xi(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 i=this._cleanupFontValue(t);i!==this._fontSet&&(this._fontSet=i,this._updateFontIconClasses())}get fontIcon(){return this._fontIcon}set fontIcon(t){const i=this._cleanupFontValue(t);i!==this._fontIcon&&(this._fontIcon=i,this._updateFontIconClasses())}_splitIconName(t){if(!t)return["",""];const i=t.split(":");switch(i.length){case 1:return["",i[0]];case 2:return i;default:throw Error(`Invalid icon name: "${t}"`)}}ngOnInit(){this._updateFontIconClasses()}ngAfterViewChecked(){const t=this._elementsWithExternalReferences;if(t&&t.size){const i=this._location.getPathname();i!==this._previousPath&&(this._previousPath=i,this._prependPathToReferences(i))}}ngOnDestroy(){this._currentIconFetch.unsubscribe(),this._elementsWithExternalReferences&&this._elementsWithExternalReferences.clear()}_usingFontIcon(){return!this.svgIcon}_setSvgElement(t){this._clearSvgElement();const i=t.querySelectorAll("style");for(let s=0;s{r.forEach(o=>{s.setAttribute(o.name,`url('${t}#${o.value}')`)})})}_cacheChildrenWithExternalReferences(t){const i=t.querySelectorAll(CTe),r=this._elementsWithExternalReferences=this._elementsWithExternalReferences||new Map;for(let s=0;s{const a=i[s],l=a.getAttribute(o),c=l?l.match(ATe):null;if(c){let u=r.get(a);u||(u=[],r.set(a,u)),u.push({name:o,value:c[1]})}})}_updateSvgIcon(t){if(this._svgNamespace=null,this._svgName=null,this._currentIconFetch.unsubscribe(),t){const[i,r]=this._splitIconName(t);i&&(this._svgNamespace=i),r&&(this._svgName=r),this._currentIconFetch=this._iconRegistry.getNamedSvgIcon(r,i).pipe(Wi(1)).subscribe(s=>this._setSvgElement(s),s=>{this._errorHandler.handleError(new Error(`Error retrieving icon ${i}:${r}! ${s.message}`))})}}}return n.\u0275fac=function(t){return new(t||n)(xe(En),xe(NC),Fo("aria-hidden"),xe(ETe),xe(oa))},n.\u0275cmp=ln({type:n,selectors:[["mat-icon"]],hostAttrs:["role","img",1,"mat-icon","notranslate"],hostVars:7,hostBindings:function(t,i){2&t&&(Bi("data-mat-icon-type",i._usingFontIcon()?"font":"svg")("data-mat-icon-name",i._svgName||i.fontIcon)("data-mat-icon-namespace",i._svgNamespace||i.fontSet),vi("mat-icon-inline",i.inline)("mat-icon-no-color","primary"!==i.color&&"accent"!==i.color&&"warn"!==i.color))},inputs:{color:"color",inline:"inline",svgIcon:"svgIcon",fontSet:"fontSet",fontIcon:"fontIcon"},exportAs:["matIcon"],features:[An],ngContentSelectors:_Te,decls:1,vars:0,template:function(t,i){1&t&&(is(),si(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}),n})();function LTe(n,e){}class zP{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 BTe={dialogContainer:Em("dialogContainer",[vc("void, exit",fs({opacity:0,transform:"scale(0.7)"})),vc("enter",fs({transform:"none"})),ud("* => enter",cd("150ms cubic-bezier(0, 0, 0.2, 1)",fs({transform:"none",opacity:1}))),ud("* => void, * => exit",cd("75ms cubic-bezier(0.4, 0.0, 0.2, 1)",fs({opacity:0})))])};let jTe=(()=>{class n extends MC{constructor(t,i,r,s,o,a){super(),this._elementRef=t,this._focusTrapFactory=i,this._changeDetectorRef=r,this._config=o,this._focusMonitor=a,this._animationStateChanged=new sn,this._elementFocusedBeforeDialogWasOpened=null,this._closeInteractionType=null,this.attachDomPortal=l=>(this._portalOutlet.hasAttached(),this._portalOutlet.attachDomPortal(l)),this._ariaLabelledBy=o.ariaLabelledBy||null,this._document=s}_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 i=Zx(),r=this._elementRef.nativeElement;(!i||i===this._document.body||i===r||r.contains(i))&&(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=Zx())}_focusDialogContainer(){this._elementRef.nativeElement.focus&&this._elementRef.nativeElement.focus()}_containsFocus(){const t=this._elementRef.nativeElement,i=Zx();return t===i||t.contains(i)}}return n.\u0275fac=function(t){return new(t||n)(xe(En),xe(XH),xe(Dr),xe(pn,8),xe(zP),xe(du))},n.\u0275dir=Rt({type:n,viewQuery:function(t,i){if(1&t&&ss(tp,7),2&t){let r;ii(r=ri())&&(i._portalOutlet=r.first)}},features:[An]}),n})(),VTe=(()=>{class n extends jTe{constructor(){super(...arguments),this._state="enter"}_onAnimationDone({toState:t,totalTime:i}){"enter"===t?(this._trapFocus(),this._animationStateChanged.next({state:"opened",totalTime:i})):"exit"===t&&(this._restoreFocus(),this._animationStateChanged.next({state:"closed",totalTime:i}))}_onAnimationStart({toState:t,totalTime:i}){"enter"===t?this._animationStateChanged.next({state:"opening",totalTime:i}):("exit"===t||"void"===t)&&this._animationStateChanged.next({state:"closing",totalTime:i})}_startExitAnimation(){this._state="exit",this._changeDetectorRef.markForCheck()}}return n.\u0275fac=function(){let e;return function(i){return(e||(e=nr(n)))(i||n)}}(),n.\u0275cmp=ln({type:n,selectors:[["mat-dialog-container"]],hostAttrs:["tabindex","-1","aria-modal","true",1,"mat-dialog-container"],hostVars:6,hostBindings:function(t,i){1&t&&fE("@dialogContainer.start",function(s){return i._onAnimationStart(s)})("@dialogContainer.done",function(s){return i._onAnimationDone(s)}),2&t&&(Lu("id",i._id),Bi("role",i._config.role)("aria-labelledby",i._config.ariaLabel?null:i._ariaLabelledBy)("aria-label",i._config.ariaLabel)("aria-describedby",i._config.ariaDescribedBy||null),mE("@dialogContainer",i._state))},features:[An],decls:1,vars:0,consts:[["cdkPortalOutlet",""]],template:function(t,i){1&t&&Di(0,LTe,0,0,"ng-template",0)},directives:[tp],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:[BTe.dialogContainer]}}),n})(),UTe=0;class FC{constructor(e,t,i="mat-dialog-"+UTe++){this._overlayRef=e,this._containerInstance=t,this.id=i,this.disableClose=this._containerInstance._config.disableClose,this._afterOpened=new se,this._afterClosed=new se,this._beforeClosed=new se,this._state=0,t._id=i,t._animationStateChanged.pipe(Qi(r=>"opened"===r.state),Wi(1)).subscribe(()=>{this._afterOpened.next(),this._afterOpened.complete()}),t._animationStateChanged.pipe(Qi(r=>"closed"===r.state),Wi(1)).subscribe(()=>{clearTimeout(this._closeFallbackTimeout),this._finishDialogClose()}),e.detachments().subscribe(()=>{this._beforeClosed.next(this._result),this._beforeClosed.complete(),this._afterClosed.next(this._result),this._afterClosed.complete(),this.componentInstance=null,this._overlayRef.dispose()}),e.keydownEvents().pipe(Qi(r=>27===r.keyCode&&!this.disableClose&&!Dl(r))).subscribe(r=>{r.preventDefault(),HP(this,"keyboard")}),e.backdropClick().subscribe(()=>{this.disableClose?this._containerInstance._recaptureFocus():HP(this,"mouse")})}close(e){this._result=e,this._containerInstance._animationStateChanged.pipe(Qi(t=>"closing"===t.state),Wi(1)).subscribe(t=>{this._beforeClosed.next(e),this._beforeClosed.complete(),this._overlayRef.detachBackdrop(),this._closeFallbackTimeout=setTimeout(()=>this._finishDialogClose(),t.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(e){let 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}updateSize(e="",t=""){return this._overlayRef.updateSize({width:e,height:t}),this._overlayRef.updatePosition(),this}addPanelClass(e){return this._overlayRef.addPanelClass(e),this}removePanelClass(e){return this._overlayRef.removePanelClass(e),this}getState(){return this._state}_finishDialogClose(){this._state=2,this._overlayRef.dispose()}_getPositionStrategy(){return this._overlayRef.getConfig().positionStrategy}}function HP(n,e,t){return void 0!==n._containerInstance&&(n._containerInstance._closeInteractionType=e),n.close(t)}const B7=new Ht("MatDialogData"),zTe=new Ht("mat-dialog-default-options"),j7=new Ht("mat-dialog-scroll-strategy");let $Te=(()=>{class n{constructor(t,i,r,s,o,a,l,c,u){this._overlay=t,this._injector=i,this._defaultOptions=r,this._parentDialog=s,this._overlayContainer=o,this._dialogRefConstructor=l,this._dialogContainerType=c,this._dialogDataToken=u,this._openDialogsAtThisLevel=[],this._afterAllClosedAtThisLevel=new se,this._afterOpenedAtThisLevel=new se,this._ariaHiddenElements=new Map,this.afterAllClosed=function(n){return new I(e=>{let t;try{t=n()}catch(r){return void e.error(r)}return(t?je(t):lS()).subscribe(e)})}(()=>this.openDialogs.length?this._getAfterAllClosed():this._getAfterAllClosed().pipe(ao(void 0))),this._scrollStrategy=a}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,i){(i=function(n,e){return Object.assign(Object.assign({},e),n)}(i,this._defaultOptions||new zP)).id&&this.getDialogById(i.id);const r=this._createOverlay(i),s=this._attachDialogContainer(r,i),o=this._attachDialogContent(t,s,r,i);return this.openDialogs.length||this._hideNonDialogContentFromAssistiveTechnology(),this.openDialogs.push(o),o.afterClosed().subscribe(()=>this._removeOpenDialog(o)),this.afterOpened.next(o),s._initializeWithAttachedContent(),o}closeAll(){this._closeDialogs(this.openDialogs)}getDialogById(t){return this.openDialogs.find(i=>i.id===t)}ngOnDestroy(){this._closeDialogs(this._openDialogsAtThisLevel),this._afterAllClosedAtThisLevel.complete(),this._afterOpenedAtThisLevel.complete()}_createOverlay(t){const i=this._getOverlayConfig(t);return this._overlay.create(i)}_getOverlayConfig(t){const i=new IC({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&&(i.backdropClass=t.backdropClass),i}_attachDialogContainer(t,i){const s=Wn.create({parent:i&&i.viewContainerRef&&i.viewContainerRef.injector||this._injector,providers:[{provide:zP,useValue:i}]}),o=new TC(this._dialogContainerType,i.viewContainerRef,s,i.componentFactoryResolver);return t.attach(o).instance}_attachDialogContent(t,i,r,s){const o=new this._dialogRefConstructor(r,i,s.id);if(t instanceof zo)i.attachTemplatePortal(new Im(t,null,{$implicit:s.data,dialogRef:o}));else{const a=this._createInjector(s,o,i),l=i.attachComponentPortal(new TC(t,s.viewContainerRef,a));o.componentInstance=l.instance}return o.updateSize(s.width,s.height).updatePosition(s.position),o}_createInjector(t,i,r){const s=t&&t.viewContainerRef&&t.viewContainerRef.injector,o=[{provide:this._dialogContainerType,useValue:r},{provide:this._dialogDataToken,useValue:t.data},{provide:this._dialogRefConstructor,useValue:i}];return t.direction&&(!s||!s.get(Il,null,Sn.Optional))&&o.push({provide:Il,useValue:{value:t.direction,change:fn()}}),Wn.create({parent:s||this._injector,providers:o})}_removeOpenDialog(t){const i=this.openDialogs.indexOf(t);i>-1&&(this.openDialogs.splice(i,1),this.openDialogs.length||(this._ariaHiddenElements.forEach((r,s)=>{r?s.setAttribute("aria-hidden",r):s.removeAttribute("aria-hidden")}),this._ariaHiddenElements.clear(),this._getAfterAllClosed().next()))}_hideNonDialogContentFromAssistiveTechnology(){const t=this._overlayContainer.getContainerElement();if(t.parentElement){const i=t.parentElement.children;for(let r=i.length-1;r>-1;r--){let s=i[r];s!==t&&"SCRIPT"!==s.nodeName&&"STYLE"!==s.nodeName&&!s.hasAttribute("aria-live")&&(this._ariaHiddenElements.set(s,s.getAttribute("aria-hidden")),s.setAttribute("aria-hidden","true"))}}}_closeDialogs(t){let i=t.length;for(;i--;)t[i].close()}}return n.\u0275fac=function(t){return new(t||n)(xe(wc),xe(Wn),xe(void 0),xe(void 0),xe(Ob),xe(void 0),xe(xu),xe(xu),xe(Ht))},n.\u0275dir=Rt({type:n}),n})(),Pb=(()=>{class n extends $Te{constructor(t,i,r,s,o,a,l){super(t,i,s,a,l,o,FC,VTe,B7)}}return n.\u0275fac=function(t){return new(t||n)(Oe(wc),Oe(Wn),Oe(Pg,8),Oe(zTe,8),Oe(j7),Oe(n,12),Oe(Ob))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),qTe=0,V7=(()=>{class n{constructor(t,i,r){this._dialogRef=t,this._elementRef=i,this._dialog=r,this.id="mat-dialog-title-"+qTe++}ngOnInit(){this._dialogRef||(this._dialogRef=function(n,e){let t=n.nativeElement.parentElement;for(;t&&!t.classList.contains("mat-dialog-container");)t=t.parentElement;return t?e.find(i=>i.id===t.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 n.\u0275fac=function(t){return new(t||n)(xe(FC,8),xe(En),xe(Pb))},n.\u0275dir=Rt({type:n,selectors:[["","mat-dialog-title",""],["","matDialogTitle",""]],hostAttrs:[1,"mat-dialog-title"],hostVars:1,hostBindings:function(t,i){2&t&&Lu("id",i.id)},inputs:{id:"id"},exportAs:["matDialogTitle"]}),n})(),U7=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275dir=Rt({type:n,selectors:[["","mat-dialog-content",""],["mat-dialog-content"],["","matDialogContent",""]],hostAttrs:[1,"mat-dialog-content"]}),n})();const $P=new Ht("CdkAccordion");let XTe=0,ZTe=(()=>{class n{constructor(t,i,r){this.accordion=t,this._changeDetectorRef=i,this._expansionDispatcher=r,this._openCloseAllSubscription=x.EMPTY,this.closed=new sn,this.opened=new sn,this.destroyed=new sn,this.expandedChange=new sn,this.id="cdk-accordion-child-"+XTe++,this._expanded=!1,this._disabled=!1,this._removeUniqueSelectionListener=()=>{},this._removeUniqueSelectionListener=r.listen((s,o)=>{this.accordion&&!this.accordion.multi&&this.accordion.id===o&&this.id!==s&&(this.expanded=!1)}),this.accordion&&(this._openCloseAllSubscription=this._subscribeToOpenCloseAllActions())}get expanded(){return this._expanded}set expanded(t){t=xi(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=xi(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 n.\u0275fac=function(t){return new(t||n)(xe($P,12),xe(Dr),xe(D$))},n.\u0275dir=Rt({type:n,selectors:[["cdk-accordion-item"],["","cdkAccordionItem",""]],inputs:{expanded:"expanded",disabled:"disabled"},outputs:{closed:"closed",opened:"opened",destroyed:"destroyed",expandedChange:"expandedChange"},exportAs:["cdkAccordionItem"],features:[Hn([{provide:$P,useValue:void 0}])]}),n})();const eMe=["body"];function tMe(n,e){}const nMe=[[["mat-expansion-panel-header"]],"*",[["mat-action-row"]]],iMe=["mat-expansion-panel-header","*","mat-action-row"];function rMe(n,e){1&n&&bi(0,"span",2),2&n&&rn("@indicatorRotate",ci()._getExpandedState())}const sMe=[[["mat-panel-title"]],[["mat-panel-description"]],"*"],oMe=["mat-panel-title","mat-panel-description","*"],WP=new Ht("MAT_ACCORDION"),H7="225ms cubic-bezier(0.4,0.0,0.2,1)",G7={indicatorRotate:Em("indicatorRotate",[vc("collapsed, void",fs({transform:"rotate(0deg)"})),vc("expanded",fs({transform:"rotate(180deg)"})),ud("expanded <=> collapsed, void => collapsed",cd(H7))]),bodyExpansion:Em("bodyExpansion",[vc("collapsed, void",fs({height:"0px",visibility:"hidden"})),vc("expanded",fs({height:"*",visibility:"visible"})),ud("expanded <=> collapsed, void => collapsed",cd(H7))])};let aMe=(()=>{class n{constructor(t){this._template=t}}return n.\u0275fac=function(t){return new(t||n)(xe(zo))},n.\u0275dir=Rt({type:n,selectors:[["ng-template","matExpansionPanelContent",""]]}),n})(),lMe=0;const $7=new Ht("MAT_EXPANSION_PANEL_DEFAULT_OPTIONS");let W7=(()=>{class n extends ZTe{constructor(t,i,r,s,o,a,l){super(t,i,r),this._viewContainerRef=s,this._animationMode=a,this._hideToggle=!1,this.afterExpand=new sn,this.afterCollapse=new sn,this._inputChanges=new se,this._headerId="mat-expansion-panel-header-"+lMe++,this._bodyAnimationDone=new se,this.accordion=t,this._document=o,this._bodyAnimationDone.pipe(rd((c,u)=>c.fromState===u.fromState&&c.toState===u.toState)).subscribe(c=>{"void"!==c.fromState&&("expanded"===c.toState?this.afterExpand.emit():"collapsed"===c.toState&&this.afterCollapse.emit())}),l&&(this.hideToggle=l.hideToggle)}get hideToggle(){return this._hideToggle||this.accordion&&this.accordion.hideToggle}set hideToggle(t){this._hideToggle=xi(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(ao(null),Qi(()=>this.expanded&&!this._portal),Wi(1)).subscribe(()=>{this._portal=new Im(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,i=this._body.nativeElement;return t===i||i.contains(t)}return!1}}return n.\u0275fac=function(t){return new(t||n)(xe(WP,12),xe(Dr),xe(D$),xe(Ns),xe(pn),xe(Nl,8),xe($7,8))},n.\u0275cmp=ln({type:n,selectors:[["mat-expansion-panel"]],contentQueries:function(t,i,r){if(1&t&&function(n,e,t,i){const r=Ei();if(r.firstCreatePass){const s=cs();F3(r,new R3(e,t,i),s.index),function(n,e){const t=n.contentQueries||(n.contentQueries=[]);e!==(t.length?t[t.length-1]:-1)&&t.push(n.queries.length-1,e)}(r,n),2==(2&t)&&(r.staticContentQueries=!0)}P3(r,jt(),t)}(r,aMe,5),2&t){let s;ii(s=ri())&&(i._lazyContent=s.first)}},viewQuery:function(t,i){if(1&t&&ss(eMe,5),2&t){let r;ii(r=ri())&&(i._body=r.first)}},hostAttrs:[1,"mat-expansion-panel"],hostVars:6,hostBindings:function(t,i){2&t&&vi("mat-expanded",i.expanded)("_mat-animation-noopable","NoopAnimations"===i._animationMode)("mat-expansion-panel-spacing",i._hasSpacing())},inputs:{disabled:"disabled",expanded:"expanded",hideToggle:"hideToggle",togglePosition:"togglePosition"},outputs:{opened:"opened",closed:"closed",expandedChange:"expandedChange",afterExpand:"afterExpand",afterCollapse:"afterCollapse"},exportAs:["matExpansionPanel"],features:[Hn([{provide:WP,useValue:void 0}]),An,Ui],ngContentSelectors:iMe,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,i){1&t&&(is(nMe),si(0),Pt(1,"div",0,1),Un("@bodyExpansion.done",function(s){return i._bodyAnimationDone.next(s)}),Pt(3,"div",2),si(4,1),Di(5,tMe,0,0,"ng-template",3),Ft(),si(6,2),Ft()),2&t&&(Zt(1),rn("@bodyExpansion",i._getExpandedState())("id",i.id),Bi("aria-labelledby",i._headerId),Zt(4),rn("cdkPortalOutlet",i._portal))},directives:[tp],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:[G7.bodyExpansion]},changeDetection:0}),n})();class uMe{}const dMe=xP(uMe);let q7=(()=>{class n extends dMe{constructor(t,i,r,s,o,a,l){super(),this.panel=t,this._element=i,this._focusMonitor=r,this._changeDetectorRef=s,this._animationMode=a,this._parentChangeSubscription=x.EMPTY;const c=t.accordion?t.accordion._stateChanges.pipe(Qi(u=>!(!u.hideToggle&&!u.togglePosition))):Yc;this.tabIndex=parseInt(l||"")||0,this._parentChangeSubscription=kn(t.opened,t.closed,c,t._inputChanges.pipe(Qi(u=>!!(u.hideToggle||u.disabled||u.togglePosition)))).subscribe(()=>this._changeDetectorRef.markForCheck()),t.closed.pipe(Qi(()=>t._containsFocus())).subscribe(()=>r.focusVia(i,"program")),o&&(this.expandedHeight=o.expandedHeight,this.collapsedHeight=o.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:Dl(t)||(t.preventDefault(),this._toggle());break;default:return void(this.panel.accordion&&this.panel.accordion._handleHeaderKeydown(t))}}focus(t,i){t?this._focusMonitor.focusVia(this._element,t,i):this._element.nativeElement.focus(i)}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 n.\u0275fac=function(t){return new(t||n)(xe(W7,1),xe(En),xe(du),xe(Dr),xe($7,8),xe(Nl,8),Fo("tabindex"))},n.\u0275cmp=ln({type:n,selectors:[["mat-expansion-panel-header"]],hostAttrs:["role","button",1,"mat-expansion-panel-header","mat-focus-indicator"],hostVars:15,hostBindings:function(t,i){1&t&&Un("click",function(){return i._toggle()})("keydown",function(s){return i._keydown(s)}),2&t&&(Bi("id",i.panel._headerId)("tabindex",i.tabIndex)("aria-controls",i._getPanelId())("aria-expanded",i._isExpanded())("aria-disabled",i.panel.disabled),jy("height",i._getHeaderHeight()),vi("mat-expanded",i._isExpanded())("mat-expansion-toggle-indicator-after","after"===i._getTogglePosition())("mat-expansion-toggle-indicator-before","before"===i._getTogglePosition())("_mat-animation-noopable","NoopAnimations"===i._animationMode))},inputs:{tabIndex:"tabIndex",expandedHeight:"expandedHeight",collapsedHeight:"collapsedHeight"},features:[An],ngContentSelectors:oMe,decls:5,vars:1,consts:[[1,"mat-content"],["class","mat-expansion-indicator",4,"ngIf"],[1,"mat-expansion-indicator"]],template:function(t,i){1&t&&(is(sMe),Pt(0,"span",0),si(1),si(2,1),si(3,2),Ft(),Di(4,rMe,1,1,"span",1)),2&t&&(Zt(4),rn("ngIf",i._showToggle()))},directives:[lc],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:[G7.indicatorRotate]},changeDetection:0}),n})();var Y7=Je(478);Object.create(Error.prototype);const mMe=["*"];var LC=(()=>(function(n){n.LineHighlight="line-highlight",n.LineNumbers="line-numbers"}(LC||(LC={})),LC))();class yMe{}const X7=new Ht("SECURITY_CONTEXT");let qP=(()=>{class n{constructor(t,i,r,s,o){this.platform=t,this.securityContext=i,this.http=r,this.sanitizer=o,this.initialMarkedOptions={renderer:new Y7.Renderer},this.options=s}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,i=!1,r=!1,s=this.options){const o=this.trimIndentation(t),a=i?this.decodeHtml(o):o,l=r?this.renderEmoji(a):a,c=Y7.parse(l,s);return this.sanitizer.sanitize(this.securityContext,c)||""}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(me(i=>this.handleExtension(t,i)))}highlight(t){if(Tf(this.platform)&&"undefined"!=typeof Prism){t||(t=document);const i=t.querySelectorAll('pre code:not([class*="language-"])');Array.prototype.forEach.call(i,r=>r.classList.add("language-none")),Prism.highlightAllUnder(t)}}renderKatex(t,i){if(!Tf(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,(r,s)=>katex.renderToString(s,i))}decodeHtml(t){if(!Tf(this.platform))return t;const i=document.createElement("textarea");return i.innerHTML=t,i.value}handleExtension(t,i){const r=t?t.split("?")[0].split(".").splice(-1).join():"";return"md"!==r?"```"+r+"\n"+i+"\n```":i}renderEmoji(t){if(!Tf(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 i;return t.split("\n").map(r=>{let s=i;return r.length>0&&(s=isNaN(s)?r.search(/\S|$/):Math.min(r.search(/\S|$/),s)),isNaN(i)&&(i=s),s?r.substring(s):r}).join("\n")}}return n.\u0275fac=function(t){return new(t||n)(Oe(Wc),Oe(X7),Oe(ip,8),Oe(yMe,8),Oe(Mf))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),Q7=(()=>{class n{constructor(t,i){this.element=t,this.markdownService=i,this.error=new sn,this.load=new sn,this.ready=new sn,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,i=!1){let r=this.markdownService.compile(t,i,this.emoji);r=this.katex?this.markdownService.renderKatex(r,this.katexOptions):r,this.element.nativeElement.innerHTML=r,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,LC.LineNumbers),this.setPluginOptions(this.element.nativeElement,{dataStart:this.start}))}setPluginClass(t,i){const r=t.querySelectorAll("pre");for(let s=0;s{const a=i[o];if(a){const l=this.toLispCase(o);r.item(s).setAttribute(l,a.toString())}})}toLispCase(t){const i=t.match(/([A-Z])/g);if(!i)return t;let r=t.toString();for(let s=0,o=i.length;sP(i)?t(...i):t(i))):new I(i=>{const r=(...o)=>i.next(1===o.length?o[0]:o);let s;try{s=n(r)}catch(o){return void i.error(o)}if(Y(e))return()=>e(r,s)})}function YP(...n){return e=>{let t;return"function"==typeof n[n.length-1]&&(t=n.pop()),e.lift(new CMe(n,t))}}class CMe{constructor(e,t){this.observables=e,this.project=t}call(e,t){return t.subscribe(new AMe(e,this.observables,this.project))}}class AMe extends l7{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)}}class TMe{constructor(e,t,i=!1){this.accumulator=e,this.seed=t,this.hasSeed=i}call(e,t){return t.subscribe(new MMe(e,this.accumulator,this.seed,this.hasSeed))}}class MMe extends y{constructor(e,t,i,r){super(e),this.accumulator=t,this._seed=i,this.hasSeed=r,this.index=0}get seed(){return this._seed}set seed(e){this.hasSeed=!0,this._seed=e}_next(e){if(this.hasSeed)return this._tryNext(e);this.seed=e,this.destination.next(e)}_tryNext(e){const t=this.index++;let i;try{i=this.accumulator(this.seed,e,t)}catch(r){this.destination.error(r)}this.seed=i,this.destination.next(i)}}class OMe{constructor(e){this.predicate=e}call(e,t){return t.subscribe(new RMe(e,this.predicate))}}class RMe extends y{constructor(e,t){super(e),this.predicate=t,this.skipping=!0,this.index=0}_next(e){const t=this.destination;this.skipping&&this.tryCallPredicate(e),this.skipping||t.next(e)}tryCallPredicate(e){try{const t=this.predicate(e,this.index++);this.skipping=Boolean(t)}catch(t){this.destination.error(t)}}}const NMe=["youtubeContainer"];let tW=(()=>{class n{constructor(t,i){this._ngZone=t,this._youtubeContainer=new se,this._destroyed=new se,this._playerChanges=new Br(void 0),this._videoId=new Br(void 0),this._height=new Br(390),this._width=new Br(640),this._startSeconds=new Br(void 0),this._endSeconds=new Br(void 0),this._suggestedQuality=new Br(void 0),this._playerVars=new Br(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=Tf(i)}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=fn(!0);if(!window.YT||!window.YT.Player){const r=new se;this._existingApiReadyCallback=window.onYouTubeIframeAPIReady,window.onYouTubeIframeAPIReady=()=>{this._existingApiReadyCallback&&this._existingApiReadyCallback(),this._ngZone.run(()=>r.next(!0))},t=r.pipe(Wi(1),ao(!1))}const i=function(n,e,t,i,r,s,o){const a=Yo([e,s]).pipe(YP(Yo([i,r])),me(([l,c])=>{const[u,h]=l,[p,g]=c;return u?{videoId:u,playerVars:h,width:p,height:g}:void 0}));return Yo([n,a,fn(o)]).pipe(function(n){return ce(function(...n){let e=null;return"function"==typeof n[n.length-1]&&(e=n.pop()),1===n.length&&P(n[0])&&(n=n[0].slice()),t=>t.lift.call(je([t,...n]),new d7(e))}(n),function(n){return e=>e.lift(new OMe(n))}(([e,t])=>!t),me(([e])=>e))}(t),function(n,e){let t=!1;return arguments.length>=2&&(t=!0),function(r){return r.lift(new TMe(n,e,t))}}(jMe,void 0),rd())}(this._youtubeContainer,this._videoId,t,this._width,this._height,this._playerVars,this._ngZone).pipe(Yr(r=>{this._playerChanges.next(r)}),B(e=>e?nW(e)?fn(e):new I(t=>{let i=!1,r=!1;const s=o=>{r=!0,i||(o.target.removeEventListener("onReady",s),t.next(o.target))};return e.addEventListener("onReady",s),()=>{i=!0,r||(r=>{nW(r)||r.destroy()})(e)}}).pipe(Wi(1),ao(void 0)):fn(void 0)),_r(this._destroyed),el(new se));i.subscribe(r=>{this._player=r,r&&this._pendingPlayerState&&this._initializePlayer(r,this._pendingPlayerState),this._pendingPlayerState=void 0}),function(n,e,t){Yo([n,e,t]).subscribe(([i,r,s])=>i&&i.setSize(r,s))}(i,this._width,this._height),function(n,e){Yo([n,e]).subscribe(([t,i])=>t&&i&&t.setPlaybackQuality(i))}(i,this._suggestedQuality),function(n,e,t,i,r,s){const o=Yo([t,i]).pipe(me(([u,h])=>({startSeconds:u,endSeconds:h}))),a=o.pipe(XP(n,u=>!!u&&!function(n){const e=n.getPlayerState();return e!==YT.PlayerState.UNSTARTED&&e!==YT.PlayerState.CUED}(u))),l=e.pipe(XP(n,(u,h)=>!!u&&u.videoId!==h));kn(n.pipe(XP(Yo([e,o]),([u,h],p)=>!(!p||u==p.videoId&&!h.startSeconds&&!h.endSeconds))),l,a).pipe(YP(Yo([n,e,o,r])),me(([u,h])=>h),_r(s)).subscribe(([u,h,p,g])=>{!h||!u||(u.videoId=h,u.cueVideoById(Object.assign({videoId:h,suggestedQuality:g},p)))})}(i,this._videoId,this._startSeconds,this._endSeconds,this._suggestedQuality,this._destroyed),i.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,i){this._player?this._player.seekTo(t,i):this._getPendingState().seek={seconds:t,allowSeekAhead:i}}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,i){const{playbackState:r,playbackRate:s,volume:o,muted:a,seek:l}=i;switch(r){case YT.PlayerState.PLAYING:t.playVideo();break;case YT.PlayerState.PAUSED:t.pauseVideo();break;case YT.PlayerState.CUED:t.stopVideo()}null!=s&&t.setPlaybackRate(s),null!=o&&t.setVolume(o),null!=a&&(a?t.mute():t.unMute()),null!=l&&t.seekTo(l.seconds,l.allowSeekAhead)}_getLazyEmitter(t){return this._playerChanges.pipe(Ir(i=>i?Z7(r=>{i.addEventListener(t,r)},r=>{try{i.removeEventListener&&i.removeEventListener(t,r)}catch(s){}}):fn()),i=>new I(r=>i.subscribe({next:s=>this._ngZone.run(()=>r.next(s)),error:s=>r.error(s),complete:()=>r.complete()})),_r(this._destroyed))}}return n.\u0275fac=function(t){return new(t||n)(xe(gn),xe(Wc))},n.\u0275cmp=ln({type:n,selectors:[["youtube-player"]],viewQuery:function(t,i){if(1&t&&ss(NMe,5),2&t){let r;ii(r=ri())&&(i.youtubeContainer=r.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,i){1&t&&bi(0,"div",null,0)},encapsulation:2,changeDetection:0}),n})();function jMe(n,[e,t,i]){if(n&&t&&n.playerVars!==t.playerVars)n.destroy();else{if(!t)return void(n&&n.destroy());if(n)return n}const r=i.runOutsideAngular(()=>new YT.Player(e,t));return r.videoId=t.videoId,r.playerVars=t.playerVars,r}function nW(n){return"getPlayerStatus"in n}function XP(n,e){return ce(YP(n),Qi(([t,i])=>e(i,t)),me(([t])=>t))}let KMe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275dir=Rt({type:n,selectors:[["","mat-card-sm-image",""],["","matCardImageSmall",""]],hostAttrs:[1,"mat-card-sm-image"]}),n})();function kb(n){return!0===n}function Xa(n){return null==n}function Qa(n){return!Xa(n)}function QP(n){return Boolean(n)}function oW(n){return Xa(n)?n:JSON.parse(JSON.stringify(n))}const jC=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])&&jC(n[o])}),n};function aW(n){return Qa(n)&&"object"==typeof n&&function(n){return"[object Object]"===Object.prototype.toString.call(n)}(n)}const uW="NGXS_DATA_META",JP="NGXS_META",dW="NGXS_ARGUMENT_REGISTRY_META";let hW=(()=>{class n{constructor(t){this.sequence$=new Br(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)(Oe(cu,8))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();function Lb(n){return n[uW]}let Za=(()=>{class n{constructor(t,i,r){n.store=t.get(cu),n.ngZone=t.get(gn),n.factory=i,n.context=r,n.computed=t.get(hW)}}return n.store=null,n.computed=null,n.context=null,n.factory=null,n.ngZone=null,n.\u0275fac=function(t){return new(t||n)(Oe(Wn),Oe(a6),Oe(o6))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();class ps{constructor(){ps.statesCachedMeta.clear()}static createStateContext(e){return Za.context.createStateContext(e)}static ensureMappedState(e){if(Xa(Za.factory)||Xa(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(Qa(e.name)?ps.statesCachedMeta.get(e.name):null)||ps.ensureMeta(e)}static getRepositoryByInstance(e){var t;const r=null!==(t=Lb(ps.getStateClassByInstance(e)))&&void 0!==t?t:null;if(Xa(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=ps.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=ps.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=Qa(e.name)?null===(t=Za.factory.states)||void 0===t?void 0:t.find(r=>r.name===e.name):null;return Qa(i)&&Qa(e.name)&&ps.statesCachedMeta.set(e.name,i),i}}ps.statesCachedMeta=new Map,ps.\u0275fac=function(e){return new(e||ps)},ps.\u0275prov=We({token:ps,factory:ps.\u0275fac}),new kg(1);class mDe extends Error{constructor(e){super(`Child states can only be added to an object. Cannot convert ${Qa(null==e?void 0:e.constructor)?e.constructor.name:e} to PlainObject`)}}function fW(n){var e;return null!==(e=n.NGXS_OPTIONS_META)&&void 0!==e?e:{name:""}}function pW(n){var e;const t=fW(n),i=null!==(e=t.children)&&void 0!==e?e:[],s=oW(void 0===t.defaults?{}:t.defaults);if(i.length){if(aW(s))return function(n,e){return e.reduce((t,i)=>{const r=fW(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()]=pW(i),t},null!=n?n:{})}(s,i);throw new mDe(s)}return s}function mW(n){var e;return null!==(e=n.__NGXS_COMPUTED_OPTION__)&&void 0!==e?e:null}function _W(){var n,e;return null!==(e=null===(n=null==Za?void 0:Za.computed)||void 0===n?void 0:n.sequenceValue)&&void 0!==e?e:0}function vDe(n){let e=!1;return Tm(n)&&(e=!0),e}function eF(n){return n[dW]}class wDe extends Error{constructor(e,t){super(`An argument with the name '${e}' already exists in the method '${t}'`)}}class EDe{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(QP(this.argumentMap.has(e))||QP(this.payloadMap.has(e)))throw new wDe(e,t)}}function MDe(n){return{enumerable:!0,configurable:!0,get(){const e=Lb(n),t=ps.ensureMappedState(e.stateMeta);return ps.createStateContext(t)}}}function yW(){return(n,e,t)=>{!function(n,e){if(!function(n,e){var t;let i=n,r=!1;if(aW(i))for(;null!==i;){if(kb(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 Xa(mW(n))&&Object.defineProperties(n,{__NGXS_COMPUTED_OPTION__:{enumerable:!0,configurable:!0,value:new WeakMap}}),mW(n)}(this),o=null==s?void 0:s.get(i);if(kb(null==o?void 0:o.isObservable))return null==o?void 0:o.value;if(Xa(o)||o.sequenceId!==_W()){s.delete(i);const l=i.apply(this,r);return s.set(i,{value:l,sequenceId:_W(),isObservable:vDe(l)}),l}return o.value},t}}const PDe={cancelUncompleted:!0,insideZone:!1};function tF(n=PDe){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=ps.getRepositoryByInstance(a),u=c.operations;let h=u[s];const p=c.stateMeta,g=eF(r);if(Xa(h)){const U=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),de=function(n){const{statePath:e,argumentsNames:t,methodName:i,argumentRegistry:r}=n;let s="";for(let o=0;o{var U;return kb(n.insideZone)?null===(U=Za.ngZone)||void 0===U||U.run(()=>{l=r.apply(a,o)}):l=r.apply(a,o),Tm(l)?fn(null).pipe(me(()=>l)):l};const C=ps.createAction(h,o,g),H=Za.store.dispatch(C);return Tm(l)?function(n,e){return ub([n,e]).pipe(me(t=>t.pop()))}(H,l):l},i}}function bW(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 Xa(eF(t))&&Object.defineProperties(t,{[dW]:{enumerable:!0,configurable:!0,value:new EDe}}),eF(t)})(e,t).createPayloadType(r,t,i)}}function kDe(){return n=>{const e=function(n){if(function(n){return!QP(n)}(n.hasOwnProperty(JP))){const e={name:null,actions:{},defaults:{},path:null,makeRootSelector:t=>t.getStateGetter(e.name),children:[]};Object.defineProperty(n,JP,{value:e})}return function(n){var e;return null===(e=n)||void 0===e?void 0:e[JP]}(n)}(n);if(Xa(e.name))throw new Error("@StateRepository should be add before decorator @State");!function(n,e){(function(n){var e;const t=null!==(e=Lb(n))&&void 0!==e?e:null;return(Xa(t)||(null==t?void 0:t.stateClass)!==n)&&function(n){Object.defineProperty(n,uW,{writable:!0,configurable:!0,enumerable:!0,value:{stateMeta:null,operations:{},stateClass:n}})}(n),Lb(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:()=>oW(t)},context:MDe(n)})}(n,e,pW(n)),function(n){var e,t;const i=Lb(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(Qa(r)){const s=`__${r}__selector`;Object.defineProperties(n.prototype,{[s]:{writable:!0,enumerable:!1,configurable:!0},state$:{enumerable:!0,configurable:!0,get(){if(Qa(this[s]))return this[s];if(Xa(Za.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]=Za.store.select(n).pipe(me(o=>Ba()?jC(o):o),$a({refCount:!0,bufferSize:1})),this[s]}}})}}(n)}}let BDe=(()=>{class n{constructor(){this.browserStorageEvents$=new se,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})(),jDe=(()=>{class n extends BDe{get snapshot(){return function(n){return Ba()?jC(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:()=>Ba()?jC(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=nr(n)))(i||n)}}(),n.\u0275prov=We({token:n,factory:n.\u0275fac}),rr([yW(),dc("design:type",Object),dc("design:paramtypes",[])],n.prototype,"snapshot",null),rr([tF(),Aj(0,bW("patchValue")),dc("design:type",Function),dc("design:paramtypes",[Object]),dc("design:returntype",void 0)],n.prototype,"patchState",null),rr([tF(),Aj(0,bW("stateValue")),dc("design:type",Function),dc("design:paramtypes",[Object]),dc("design:returntype",void 0)],n.prototype,"setState",null),rr([tF(),dc("design:type",Function),dc("design:paramtypes",[]),dc("design:returntype",void 0)],n.prototype,"reset",null),n})();const jm=new Ht("ngx-google-analytics-settings",{factory:()=>({trackingCode:"",enableTracing:!1})}),xF=new Ht("ngx-window",{providedIn:"root",factory:()=>function(n){return Tf(n)?window:null}(Fc(Wc))}),ZOe=new Ht("ngx-data-layer",{providedIn:"root",factory:()=>function(n){return n?n.dataLayer=n.dataLayer||[]:null}(Fc(xF))}),CF=new Ht("ngx-gtag-fn",{providedIn:"root",factory:()=>function(n,e){return n?n.gtag=n.gtag||function(){e.push(arguments)}:null}(Fc(xF),Fc(ZOe))});let AF=(()=>{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||Ba())&&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)(Oe(jm),Oe(pn),Oe(CF))},n.\u0275prov=We({factory:function(){return new n(Oe(jm),Oe(pn),Oe(CF))},token:n,providedIn:"root"}),n})();new Ht("ngx-google-analytics-routing-settings",{factory:()=>({})}),new Ht("Key under which consent is stored",{providedIn:"root",factory:()=>"ALLOW_TELEMETRY"});class M9 extends Error{constructor(){super(...arguments),this.message="NgxsDispatchPluginModule is not imported"}}function bRe(){throw new M9}function vRe(){throw new M9}function DF(n,e,t){e.run(()=>n.dispatch(t))}function SRe(n,e,t,i){return yg(t)?function(n,e,t){return t.then(i=>(DF(n,e,i),i))}(n,e,t):Tm(t)?function(n,e,t,i){return null!==i&&(t=t.pipe(_r(i.cancelUncompleted$))),t.subscribe({next:r=>DF(n,e,r)}),t}(n,e,t,i):(DF(n,e,t),t)}class xRe{constructor(){this.cancelUncompleted$=new se}cancelPreviousAction(){this.cancelUncompleted$.next()}}const IF="\u0275fac",D9=Symbol("InjectorInstance"),I9=Symbol("FactoryHasBeenDecorated");function O9(n,e){const t=n[D9];return t?t.get(e):null}const TRe={cancelUncompleted:!1};function R9(n=TRe){return(e,t,i)=>{let r;const s=function(n){return n?new xRe:null}(n.cancelUncompleted);function o(){null!==s&&s.cancelPreviousAction();const a=O9(this,cu)||bRe(),l=O9(this,gn)||vRe(),c=r.apply(this,arguments);return l.runOutsideAngular(()=>SRe(a,l,c,s))}"function"==typeof(null==i?void 0:i.value)?(r=i.value,i.value=o):Object.defineProperty(e,t,{set:a=>r=a,get:()=>o}),function(n){if(I9 in n.constructor.prototype)return;const e=n.constructor;"function"==typeof e[IF]&&function(n){const e=n[IF];if("function"!=typeof e)return;const t=n.\u0275prov||n.\u0275pipe||n.\u0275cmp||n.\u0275dir,i=()=>{const r=e();return r[D9]=xe(Pu),r};t&&(t.factory=i),Object.defineProperty(n,IF,{get:()=>i})}(e),n.constructor.prototype[I9]=!0}(e)}}const tNe=["bodyCanvas"];let nNe=(()=>{class n{constructor(){this.clsName="ccf-body-ui",this.rotationChange=new sn,this.nodeDrag=new sn,this.nodeClick=new sn,this.nodeHoverStart=new sn,this.nodeHoverStop=new sn,this.initialized=new sn,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 Fi(this,void 0,void 0,function*(){const i=this.bodyCanvas.nativeElement,r=new Qve({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.target&&this.bodyUI.setTarget(this.target),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))],this.initialized.emit()})}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=ln({type:n,selectors:[["ccf-body-ui"]],viewQuery:function(t,i){if(1&t&&ss(tNe,5,En),2&t){let r;ii(r=ri())&&(i.bodyCanvas=r.first)}},hostVars:2,hostBindings:function(t,i){2&t&&vl(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",initialized:"initialized"},decls:2,vars:0,consts:[[1,"body-ui"],["bodyCanvas",""]],template:function(t,i){1&t&&bi(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})(),iNe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=on({type:n}),n.\u0275inj=xt({imports:[[qr]]}),n})();function ENe(n,e){if(1&n&&(Pt(0,"div",16),bi(1,"youtube-player",17),Ft()),2&n){const t=ci(3);Zt(1),pE("videoId",t.videoID)}}function SNe(n,e){if(1&n&&(Pt(0,"mat-expansion-panel",11),Pt(1,"mat-expansion-panel-header"),Pt(2,"h2",12),Oi(3),Ft(),Ft(),Pt(4,"div",13),bi(5,"markdown",14),Di(6,ENe,2,1,"div",15),Ft(),Ft()),2&n){const t=ci(),i=t.index,r=t.$implicit;rn("expanded",0===i),Zt(3),da(r.title),Zt(2),vi("first",0===i),rn("data",r.content),Zt(1),rn("ngIf",0===i)}}function xNe(n,e){if(1&n&&(Pt(0,"div",9),Di(1,SNe,7,6,"mat-expansion-panel",10),Ft()),2&n){const t=e.$implicit;Zt(1),rn("ngIf",t)}}new Ht("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:brain",organ:"Brain",name:"Brain",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000955"},{disabled:!0,src:"app:lymph-nodes",organ:"Lymph Node",name:"Lymph Node",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000029"},{src:"app:lymph-nodes",organ:"Lymph Node",name:"Lymph Node",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002509"},{disabled:!0,src:"app:eye",organ:"Eye",name:"Eye, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000970"},{src:"app:eye",organ:"Eye",name:"Eye, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0004548"},{src:"app:eye",organ:"Eye",name:"Eye, R",side:"right",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0004549"},{disabled:!0,src:"app:fallopian-tube-left",organ:"Fallopian Tube",name:"Fallopian Tube, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0003889"},{src:"app:fallopian-tube-left",organ:"Fallopian Tube",name:"Fallopian Tube, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0001303"},{src:"app:fallopian-tube-right",organ:"Fallopian Tube",name:"Fallopian Tube, R",side:"right",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0001302"},{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, L",side:"left",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"},{disabled:!0,src:"app:knee",organ:"Knee",name:"Knee, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001465"},{src:"app:knee",organ:"Knee",name:"Knee, L",side:"left",hasSex:!0,id:"http://purl.org/sig/ont/fma/fma24978"},{src:"app:knee",organ:"Knee",name:"Knee, R",side:"right",hasSex:!0,id:"http://purl.org/sig/ont/fma/fma24977"},{src:"app:liver",organ:"Liver",name:"Liver",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002107"},{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"},{disabled:!0,src:"app:mammary-gland",organ:"Mammary Gland",name:"Mammary Gland, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0001911"},{src:"app:mammary-gland",organ:"Mammary Gland",name:"Mammary Gland, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.org/sig/ont/fma/fma57991"},{src:"app:mammary-gland",organ:"Mammary Gland",name:"Mammary Gland, R",side:"right",hasSex:!1,sex:"female",id:"http://purl.org/sig/ont/fma/fma57987"},{disabled:!0,src:"app:ovary-left",organ:"Ovary",name:"Ovary, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0000992"},{src:"app:ovary-left",organ:"Ovary",name:"Ovary, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.org/sig/ont/fma/fma7214"},{src:"app:ovary-right",organ:"Ovary",name:"Ovary, R",side:"right",hasSex:!1,sex:"female",id:"http://purl.org/sig/ont/fma/fma7213"},{src:"app:pancreas",organ:"Pancreas",name:"Pancreas",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001264"},{src:"app:pelvis-f",organ:"Pelvis",name:"Pelvis",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001270"},{src:"app:placenta",organ:"Placenta",name:"Placenta",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0001987"},{src:"app:prostate",organ:"Prostate",name:"Prostate",hasSex:!1,sex:"male",id:"http://purl.obolibrary.org/obo/UBERON_0002367",disabled:!0},{src:"app:prostate",organ:"Prostate",name:"Prostate",hasSex:!1,sex:"male",id:"http://purl.obolibrary.org/obo/UBERON_0000079"},{src:"app:small-intestine",organ:"Small Intestine",name:"Small Intestine",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002108"},{src:"app:large-intestine",organ:"Large Intestine",name:"Large Intestine",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000059"},{src:"app:spinal-cord",organ:"Spinal Cord",name:"Spinal Cord",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002240"},{src:"app:spleen",organ:"Spleen",name:"Spleen",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002106"},{src:"app:thymus",organ:"Thymus",name:"Thymus",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002370"},{disabled:!0,src:"app:ureter-left",organ:"Ureter",name:"Ureter, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000056"},{src:"app:ureter-left",organ:"Ureter",name:"Ureter, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001223"},{src:"app:ureter-right",organ:"Ureter",name:"Ureter, R",side:"right",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001222"},{src:"app:bladder",organ:"Urinary Bladder",name:"Urinary Bladder",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001255"},{src:"app:uterus",organ:"Uterus",name:"Uterus",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0000995"},{src:"app:vasculature-thick",organ:"Blood Vasculature",name:"Blood Vasculature",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0004537"},{disabled:!0,src:"app:vasculature-thick",organ:"Blood Vasculature",name:"Blood Vasculature",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002049"}].sort((n,e)=>n.name.localeCompare(e.name)).filter(n=>!0!==n.disabled);let G9=(()=>{class n{constructor(t,i){this.dialogRef=t,this.data=i,this.documentationContents=i.content||[],this.infoTitle=i.title||"",this.videoID=i.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 n.\u0275fac=function(t){return new(t||n)(xe(FC),xe(B7))},n.\u0275cmp=ln({type:n,selectors:[["ccf-info-dialog"]],decls:11,vars:2,consts:[[1,"rui-about","wrapper"],[1,"container"],[1,"content"],[1,"header"],["mat-dialog-title","",1,"title"],[1,"close"],[1,"material-icons","close-icon",3,"click"],[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,i){1&t&&(Pt(0,"div",0),Pt(1,"div",1),Pt(2,"div",2),Pt(3,"div",3),Pt(4,"h2",4),Oi(5),Ft(),Pt(6,"div",5),Pt(7,"mat-icon",6),Un("click",function(){return i.close()}),Oi(8,"clear"),Ft(),Ft(),Ft(),Pt(9,"mat-dialog-content",7),Di(10,xNe,2,1,"div",8),Ft(),Ft(),Ft(),Ft()),2&t&&(Zt(5),da(i.infoTitle),Zt(5),rn("ngForOf",i.documentationContents))},directives:[V7,Nm,U7,Af,lc,W7,q7,Q7,tW],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%] .content[_ngcontent-%COMP%] .header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;height:3rem;margin-bottom:2.25rem;position:relative}.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%]{cursor:pointer;height:3rem;width:3rem;line-height:3rem;text-align:center;transition:.6s}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-size:1.5rem;margin:0 auto;line-height:3rem;height:3rem;justify-self:center;display:flex}.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;display:flex}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .dialog-content[_ngcontent-%COMP%] .variable-binding.first[_ngcontent-%COMP%]{padding-right:1rem;width:73%}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .dialog-content[_ngcontent-%COMP%] .variable-binding[_ngcontent-%COMP%] ul{margin:0}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .dialog-content[_ngcontent-%COMP%] .variable-binding[_ngcontent-%COMP%] img{margin-left:1rem;float:right}.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%}"]}),n})(),$9=(()=>{class n{constructor(t){this.http=t,this.panelContent=new Br({content:[],infoTitle:"",videoID:""})}updateData(t,i,r){this.http.get(t,{responseType:"text"}).subscribe(s=>{const o={content:this.parseMarkdown(s),infoTitle:r,videoID:i};this.panelContent.next(o)})}parseMarkdown(t){const i=[],r=t.split("# ");for(const s of r)if(s.length){const o=s.includes("\n\n")?"\n\n":"\r\n\r\n",a=s.split(o);i.push({title:a[0],content:a.splice(1).join(o)})}return i}}return n.\u0275fac=function(t){return new(t||n)(Oe(ip))},n.\u0275prov=We({token:n,factory:n.\u0275fac,providedIn:"root"}),n})(),ANe=(()=>{class n{constructor(){this.clsName="ccf-call-to-action",this.callToActionClicked=new sn,this.closeClicked=new sn}close(){this.closeClicked.emit()}onDialogButtonClick(){this.callToActionClicked.emit()}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=ln({type:n,selectors:[["ccf-call-to-action"]],hostVars:2,hostBindings:function(t,i){2&t&&vl(i.clsName)},inputs:{infoTitle:"infoTitle",imageUrl:"imageUrl",message:"message",callToAction:"callToAction"},outputs:{callToActionClicked:"callToActionClicked",closeClicked:"closeClicked"},decls:13,vars:4,consts:[[1,"rui-about","wrapper"],[1,"container"],[1,"content"],[1,"first-row"],["mat-dialog-title","",1,"title"],[1,"cta-mat-icon","material-icons","close-icon",3,"click"],["mat-card-sm-image","","alt","preview","layout-fill","",1,"cta-image",3,"src"],[1,"mat-typography","dialog-content"],[1,"message"],["mat-button","",1,"mat-button",3,"text","click"]],template:function(t,i){1&t&&(Pt(0,"div",0),Pt(1,"div",1),Pt(2,"div",2),Pt(3,"div",3),Pt(4,"p",4),Oi(5),Ft(),Pt(6,"mat-icon",5),Un("click",function(){return i.close()}),Oi(7,"clear"),Ft(),Ft(),bi(8,"img",6),Pt(9,"mat-dialog-content",7),Pt(10,"div",8),Oi(11),Ft(),Pt(12,"a",9),Un("click",function(){return i.onDialogButtonClick()}),Ft(),Ft(),Ft(),Ft(),Ft()),2&t&&(Zt(5),da(i.infoTitle),Zt(3),rn("src",i.imageUrl,nf),Zt(3),ha(" ",i.message,""),Zt(1),rn("text",i.callToAction))},directives:[V7,Nm,KMe,U7],styles:["[_nghost-%COMP%] .content[_ngcontent-%COMP%]{display:block;align-content:center;padding-left:1.6rem;padding-right:1.6rem;border-radius:.25rem}[_nghost-%COMP%] .info-button-wrapper[_ngcontent-%COMP%]{border-radius:.25rem;padding:.6rem;transition:.6s}[_nghost-%COMP%] .info-button-wrapper[_ngcontent-%COMP%] .ccf-info-button[_ngcontent-%COMP%]{cursor:pointer;transition:color .6s;font-size:1.2rem;vertical-align:sub}[_nghost-%COMP%] .first-row[_ngcontent-%COMP%]{display:flex;width:100%;line-height:.9rem}[_nghost-%COMP%] .first-row[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{padding-right:7rem;padding-left:.2rem;font-size:.875rem;padding-top:.75rem}[_nghost-%COMP%] .first-row[_ngcontent-%COMP%] .cta-mat-icon[_ngcontent-%COMP%]{height:30%;line-height:3.4rem}[_nghost-%COMP%] .message[_ngcontent-%COMP%]{padding:.5rem}[_nghost-%COMP%] .cta-image[_ngcontent-%COMP%]{align-self:center;-o-object-fit:cover;object-fit:cover;width:100%;border-radius:.25rem}[_nghost-%COMP%] .mat-button[_ngcontent-%COMP%]{background-color:#444a65;font-size:.75rem;position:relative;margin-bottom:1rem;width:100%;height:2rem;color:#fff}"],changeDetection:0}),n})(),Yb=(()=>{let n=class extends jDe{constructor(){super(...arguments),this.optionCache=new Map}get config$(){return this.state$.pipe(Qi(n=>null!=n),$a(1))}setConfig(t){this.setState(t)}patchConfig(t){this.patchState(t)}getProperty(t){return this.config$.pipe(a7(...t),rd(),$a(1))}getOption(...t){const i=this.getPathKey(t);if(this.optionCache.has(i))return this.optionCache.get(i);const r=this.config$.pipe(a7(...t),rd(),$a(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=nr(n)))(i||n)}}(),n.\u0275prov=We({token:n,factory:n.\u0275fac}),rr([yW()],n.prototype,"config$",null),n=rr([kDe(),M6({name:"globalConfig",defaults:null})],n),n})();!function(){const n=localStorage.getItem("ALLOW_TELEMETRY");null===n||n.toLowerCase()}(),new se;let PF=(()=>{class n{}return n.type="[CallToAction] Learn More",n})(),FF=(()=>{class n{}return n.type="[CallToAction] Open Dialog",n})(),kF=(()=>{class n{}return n.type="[CallToAction] Close Dialog",n})();var LF;class wa{get length(){var e,t;return null!==(t=null===(e=wa.storage)||void 0===e?void 0:e.length)&&void 0!==t?t:0}key(e){var t,i;return null!==(i=null===(t=wa.storage)||void 0===t?void 0:t.key(e))&&void 0!==i?i:null}getItem(e,t){var i,r,s;return null!==(s=null!==(r=null===(i=wa.storage)||void 0===i?void 0:i.getItem(e))&&void 0!==r?r:t)&&void 0!==s?s:null}setItem(e,t){var i;try{return null===(i=wa.storage)||void 0===i||i.setItem(e,t),!0}catch(r){return!1}}removeItem(e){var t;null===(t=wa.storage)||void 0===t||t.removeItem(e)}clear(){var e;null===(e=wa.storage)||void 0===e||e.clear()}}wa.storage=(()=>{let n;try{n=window.localStorage;const e="__storage_test__";return n.setItem(e,e),n.removeItem(e),n}catch(e){return e instanceof DOMException&&(22===e.code||1014===e.code||"QuotaExceededError"===e.name||"NS_ERROR_DOM_QUOTA_REACHED"===e.name)&&n&&0!==n.length?n:void 0}})(),wa.\u0275fac=function(e){return new(e||wa)},wa.\u0275prov=We({token:wa,factory:wa.\u0275fac,providedIn:"root"});const Y9="callToActionPopupShown";let Do=LF=class{constructor(e,t,i,r,s){this.dialog=e,this.ga=t,this.storage=i,this.infoService=r,this.http=s}static ctaDatePassed(e,t=Date.now){return+t()>+new Date(e)}ngxsOnInit(e){const{expirationDate:t,popupShown:i}=e.getState(),r=this.storage.getItem(Y9,`${i}`),s=LF.ctaDatePassed(t);"true"!==r&&!s&&e.dispatch(new FF)}getDialogData(){return this.http.get("assets/docs/SPATIAL_SEARCH_README.md",{responseType:"text"}).pipe(me(e=>this.infoService.parseMarkdown(e)))}launchLearnMore(e){this.dialog.open(G9,{autoFocus:!1,panelClass:"modal-animated",width:"72rem",data:{title:"Spatial Search",content:e,videoID:"UfxMpzatowE"}})}learnMore(e){return this.dialog.closeAll(),this.ga.event("open_learn_more","call_to_action"),this.getDialogData().pipe(Yr(t=>this.launchLearnMore(t)))}open(e){this.dialog.open(NNe,{autoFocus:!1,panelClass:"modal-animated",width:"30.75rem",height:"36.688rem"}),this.ga.event("open","call_to_action"),this.storage.setItem(Y9,"true"),e.patchState({popupShown:!0})}close(e){this.dialog.closeAll(),this.ga.event("close","call_to_action")}};Do.\u0275fac=function(e){return new(e||Do)(Oe(Pb),Oe(AF),Oe(wa),Oe($9),Oe(ip))},Do.\u0275prov=We({token:Do,factory:Do.\u0275fac}),rr([_N(PF)],Do.prototype,"learnMore",null),rr([_N(FF)],Do.prototype,"open",null),rr([_N(kF)],Do.prototype,"close",null),Do=LF=rr([M6({name:"callToAction",defaults:{title:"New to the Exploration User Interface",message:"Spatial Search has arrived!",callToAction:"Learn More",imageUrl:"assets/images/spatial_search.gif",expirationDate:"Dec 1, 2022",popupShown:!1}})],Do);let o1=(()=>{class n{static title(t){return t.title}static message(t){return t.message}static callToAction(t){return t.callToAction}static imageUrl(t){return t.imageUrl}static expirationDate(t){return t.expirationDate}static popupShown(t){return t.popupShown}}return rr([_m([Do])],n,"title",null),rr([_m([Do])],n,"message",null),rr([_m([Do])],n,"callToAction",null),rr([_m([Do])],n,"imageUrl",null),rr([_m([Do])],n,"expirationDate",null),rr([_m([Do])],n,"popupShown",null),n})(),NNe=(()=>{class n{constructor(){this.close=()=>new kF,this.learnMore=()=>new PF}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=ln({type:n,selectors:[["ccf-call-to-action-behavior"]],decls:5,vars:12,consts:[[3,"infoTitle","message","callToAction","imageUrl","callToActionClicked","closeClicked"]],template:function(t,i){1&t&&(Pt(0,"ccf-call-to-action",0),Un("callToActionClicked",function(){return i.learnMore()})("closeClicked",function(){return i.close()}),xl(1,"async"),xl(2,"async"),xl(3,"async"),xl(4,"async"),Ft()),2&t&&rn("infoTitle",Vu(1,4,i.title$))("message",Vu(2,6,i.message$))("callToAction",Vu(3,8,i.callToAction$))("imageUrl",Vu(4,10,i.imageUrl$))},directives:[ANe],pipes:[h0],styles:[""],changeDetection:0}),rr([kx(o1.title)],n.prototype,"title$",void 0),rr([kx(o1.message)],n.prototype,"message$",void 0),rr([kx(o1.callToAction)],n.prototype,"callToAction$",void 0),rr([kx(o1.imageUrl)],n.prototype,"imageUrl$",void 0),rr([R9()],n.prototype,"close",void 0),rr([R9()],n.prototype,"learnMore",void 0),n})();const K9="http://purl.org/ccf/latest/ccf-entity.owl#has_spatial_entity",BNe=[173,255,47,229.5];var xn=Je(440),HNe=Je(698),GNe=Je(445),$Ne=Je.n(GNe),fr=Je(815),Kb=Je(609);const or=xn.Util.prefixes({base:"http://purl.org/ccf/latest/ccf.owl#",ccf:"http://purl.org/ccf/",fma:"http://purl.org/sig/ont/fma/fma",obo:"http://purl.obolibrary.org/obo/",uberon:"http://purl.obolibrary.org/obo/UBERON_",cl:"http://purl.obolibrary.org/obo/CL_",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/",dcterms:"http://purl.org/dc/terms/"},xn.DataFactory),un=(or("rdf"),or("rdf")("type"),or("rdfs"),or("rdfs")("label"),or("rdfs")("comment"),or("rdfs")("isDefinedBy"),or("rdfs")("seeAlso"),or("ccf")),co_label=(or("ccf")("has_registration_location"),or("rdfs")("label")),co_description=or("rdfs")("comment"),co_link=un("url"),co_providerName=(un("sex"),un("age"),un("bmi"),xn.DataFactory.literal("Male"),xn.DataFactory.literal("Female"),un("consortium_name"),un("tissue_provider_name")),co_donor=(un("tissue_provider_uuid"),un("comes_from")),co_sections=un("subdivided_into_sections"),co_datasets=un("generates_dataset"),co_sampleType=un("sample_type"),co_sectionCount=(xn.DataFactory.literal("Tissue Block"),xn.DataFactory.literal("Tissue Section"),xn.DataFactory.literal("Non-standard"),un("section_count")),co_sectionSize=un("section_size"),co_sectionUnits=un("section_size_unit"),co_sectionNumber=un("section_number"),co_spatialEntity=un("has_registration_location"),co_technology=(un("has_ontology_term"),un("has_cell_type_term"),un("technology")),co_thumbnail=un("thumbnail"),md={x:un,base:or("base"),ontologyNode:{label:un("ccf_pref_label"),parent:un("ccf_part_of"),children:un("ccf_part_of"),rui_rank:un("rui_rank"),synonymLabels:xn.DataFactory.namedNode("http://www.geneontology.org/formats/oboInOwl#hasExactSynonym")},asctb:{part_of:un("ccf_part_of"),ct_is_a:un("ccf_ct_isa"),located_in:un("ccf_located_in"),characterizes:un("ccf_characterizes")},spatial:{Female:or("base")("VHFemale"),Male:or("base")("VHMale"),BothSexes:or("base")("VHBothSexes"),FemaleOrgans:or("base")("VHFemaleOrgans"),MaleOrgans:or("base")("VHMaleOrgans")},SpatialObjectReference:un("spatial_object_reference"),SpatialEntity:un("spatial_entity"),SpatialPlacement:un("spatial_placement"),spatialObjectReference:{file:un("file_url"),file_format:un("file_format"),file_subpath:un("file_subpath")},extractionSet:{label:or("rdfs")("label"),rui_rank:un("rui_rank")},spatialEntity:{label:or("rdfs")("label"),description:or("rdfs")("comment"),creator:or("dcterms")("creator"),creator_first_name:un("creator_first_name"),creator_last_name:un("creator_last_name"),creator_orcid:un("creator_orcid"),creation_date:or("dcterms")("created"),updated_date:un("updated_date"),ccf_annotations:un("collides_with"),representation_of:un("representation_of"),reference_organ:un("has_reference_organ"),extraction_set_for:un("extraction_set_for"),extraction_set:un("has_extraction_set"),sex:un("organ_owner_sex"),side:un("organ_side"),rui_rank:un("rui_rank"),slice_thickness:un("slice_thickness"),slice_count:un("slice_count"),x_dimension:un("x_dimension"),y_dimension:un("y_dimension"),z_dimension:un("z_dimension"),dimension_units:un("dimension_unit"),object:un("has_object_reference")},spatialPlacement:{source:un("placement_for"),target:un("placement_relative_to"),placement_date:or("dcterms")("created"),x_scaling:un("x_scaling"),y_scaling:un("y_scaling"),z_scaling:un("z_scaling"),scaling_units:un("scaling_unit"),x_rotation:un("x_rotation"),y_rotation:un("y_rotation"),z_rotation:un("z_rotation"),w_rotation:un("theta_rotation"),rotation_order:un("rotation_order"),rotation_units:un("rotation_unit"),x_translation:un("x_translation"),y_translation:un("y_translation"),z_translation:un("z_translation"),translation_units:un("translation_unit")}},ui={x:or("uberon"),body:or("uberon")("0013702")},YNe={x:or("cl"),cell:or("cl")("0000000")},Xb={x:or("fma")},X9=(or("lmha"),{body:ui.body,cell:YNe.cell,respiratory_system:ui.x("0001004"),colon:ui.x("0001155"),left_lung:ui.x("0002168"),right_lung:ui.x("0002167"),left_bronchus:ui.x("0002178"),right_bronchus:ui.x("0002177"),kidney:ui.x("0002113"),ureter:ui.x("0000056"),eye:ui.x("0000970"),fallopian_tube:ui.x("0003889"),knee:ui.x("0001465"),ovary:ui.x("0000992"),trachea:ui.x("0003126"),aorta:ui.x("0000947"),blood:ui.x("0000178"),bone_marrow:ui.x("0002371"),male_reproductive_system:ui.x("0000079"),lymph_node:ui.x("0000029"),blood_vasculature:ui.x("0004537"),brain:ui.x("0000955"),eye_left:ui.x("0004548"),eye_right:Xb.x("54449"),fallopian_tube_left:ui.x("0001303"),fallopian_tube_right:ui.x("0001302"),heart:ui.x("0000948"),kidney_left:ui.x("0004538"),kidney_right:ui.x("0004539"),knee_left:Xb.x("24978"),knee_right:Xb.x("24977"),large_intestine:ui.x("0000059"),liver:ui.x("0002107"),lungs:ui.x("0002048"),mesenteric_lymph_node:ui.x("0002509"),ovary_left:Xb.x("7214"),ovary_right:Xb.x("7213"),pancreas:ui.x("0001264"),pelvis:ui.x("0001270"),prostate_gland:ui.x("0002367"),skin:ui.x("0002097"),small_intestine:ui.x("0002108"),spleen:ui.x("0002106"),thymus:ui.x("0002370"),ureter_left:ui.x("0001223"),ureter_right:ui.x("0001222"),urinary_bladder:ui.x("0001255"),uterus:ui.x("0000995")});function BF(n){const e={};return Object.entries(n).forEach(([t,i])=>{e[i.id]=t}),e}BF(md.spatialObjectReference),BF(md.spatialEntity),BF(md.spatialPlacement),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"]);const zm=Object.freeze({OUTSIDE:-1,INTERSECTING:0,INSIDE:1}),Pr=(Math,Math,{});function cPe(n,{precision:e=Pr.precision||4}={}){return n=function(n){return Math.round(n/Pr.EPSILON)*Pr.EPSILON}(n),"".concat(parseFloat(n.toPrecision(e)))}function Ah(n){return Array.isArray(n)||ArrayBuffer.isView(n)&&!(n instanceof DataView)}function Zb(n,e,t){const i=Pr.EPSILON;t&&(Pr.EPSILON=t);try{if(n===e)return!0;if(Ah(n)&&Ah(e)){if(n.length!==e.length)return!1;for(let r=0;r0?", ":"")+cPe(this[i],e);return"".concat(e.printTypes?this.constructor.name:"","[").concat(t,"]")}equals(e){if(!e||this.length!==e.length)return!1;for(let t=0;t=0&&e=0&&e=a+s)return this.clone();if(s>=a+i)return e.clone();const l=.5*(i+a+s);return oq.copy(o).scale((-i+l)/a).add(t),this.center.copy(oq),this.radius=l,this}expand(e){const t=(e=Jb.from(e)).subtract(this.center).magnitude();return t>this.radius&&(this.radius=t),this}transform(e){this.center.transform(e);const t=function(n,e){var s=e[4],o=e[5],a=e[6],l=e[8],c=e[9],u=e[10];return n[0]=Math.hypot(e[0],e[1],e[2]),n[1]=Math.hypot(s,o,a),n[2]=Math.hypot(l,c,u),n}(Jb,e);return this.radius=Math.max(t[0],Math.max(t[1],t[2]))*this.radius,this}distanceSquaredTo(e){const t=this.distanceTo(e);return t*t}distanceTo(e){const t=(e=Jb.from(e)).subtract(this.center);return Math.max(0,t.len()-this.radius)}intersectPlane(e){const i=this.radius,s=e.normal.dot(this.center)+e.distance;return s<-i?zm.OUTSIDE:s0?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 u5(this,this,e),this.check()}rotateY(e){return d5(this,this,e),this.check()}rotateZ(e){return h5(this,this,e),this.check()}scale(e){return fR(this,this,e),this.check()}slerp(e,t,i){switch(arguments.length){case 1:({start:e=CPe,target:t,ratio:i}=arguments[0]);break;case 2:[t,i]=arguments,e=this}return J0(this,e,t,i),this.check()}transformVector4(e,t=e){return kU(t,e,this),tq(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)}}const APe=new Pn,TPe=new Pn,c1=new Pn,u1=new Pn,d1=new Pn,MPe=new Pn,DPe=new Pn;class GF{constructor(e=[0,0,0],t=[0,0,0,0,0,0,0,0,0]){this.center=(new Pn).from(e),this.halfAxes=new Xo(t)}get halfSize(){const e=this.halfAxes.getColumn(0),t=this.halfAxes.getColumn(1),i=this.halfAxes.getColumn(2);return[new Pn(e).len(),new Pn(t).len(),new Pn(i).len()]}get quaternion(){const e=this.halfAxes.getColumn(0),t=this.halfAxes.getColumn(1),i=this.halfAxes.getColumn(2),r=new Pn(e).normalize(),s=new Pn(t).normalize(),o=new Pn(i).normalize();return(new lq).fromMatrix3(new Xo([...r,...s,...o]))}fromCenterHalfSizeQuaternion(e,t,i){const r=new lq(i),s=(new Xo).fromQuaternion(r);return s[0]=s[0]*t[0],s[1]=s[1]*t[0],s[2]=s[2]*t[0],s[3]=s[3]*t[1],s[4]=s[4]*t[1],s[5]=s[5]*t[1],s[6]=s[6]*t[2],s[7]=s[7]*t[2],s[8]=s[8]*t[2],this.center=(new Pn).from(e),this.halfAxes=s,this}clone(){return new GF(this.center,this.halfAxes)}equals(e){return this===e||Boolean(e)&&this.center.equals(e.center)&&this.halfAxes.equals(e.halfAxes)}getBoundingSphere(e=new HF){const t=this.halfAxes,i=t.getColumn(0,c1),r=t.getColumn(1,u1),s=t.getColumn(2,d1),o=APe.copy(i).add(r).add(s);return e.center.copy(this.center),e.radius=o.magnitude(),e}intersectPlane(e){const t=this.center,i=e.normal,r=this.halfAxes,s=i.x,o=i.y,a=i.z,l=Math.abs(s*r[0]+o*r[1]+a*r[2])+Math.abs(s*r[3]+o*r[4]+a*r[5])+Math.abs(s*r[6]+o*r[7]+a*r[8]),c=i.dot(t)+e.distance;return c<=-l?zm.OUTSIDE:c>=l?zm.INSIDE:zm.INTERSECTING}distanceTo(e){return Math.sqrt(this.distanceSquaredTo(e))}distanceSquaredTo(e){const t=TPe.from(e).subtract(this.center),i=this.halfAxes,r=i.getColumn(0,c1),s=i.getColumn(1,u1),o=i.getColumn(2,d1),a=r.magnitude(),l=s.magnitude(),c=o.magnitude();r.normalize(),s.normalize(),o.normalize();let h,u=0;return h=Math.abs(t.dot(r))-a,h>0&&(u+=h*h),h=Math.abs(t.dot(s))-l,h>0&&(u+=h*h),h=Math.abs(t.dot(o))-c,h>0&&(u+=h*h),u}computePlaneDistances(e,t,i=[-0,-0]){let r=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY;const o=this.center,a=this.halfAxes,l=a.getColumn(0,c1),c=a.getColumn(1,u1),u=a.getColumn(2,d1),h=MPe.copy(l).add(c).add(u).add(o),p=DPe.copy(h).subtract(e);let g=t.dot(p);return r=Math.min(g,r),s=Math.max(g,s),h.copy(o).add(l).add(c).subtract(u),p.copy(h).subtract(e),g=t.dot(p),r=Math.min(g,r),s=Math.max(g,s),h.copy(o).add(l).subtract(c).add(u),p.copy(h).subtract(e),g=t.dot(p),r=Math.min(g,r),s=Math.max(g,s),h.copy(o).add(l).subtract(c).subtract(u),p.copy(h).subtract(e),g=t.dot(p),r=Math.min(g,r),s=Math.max(g,s),o.copy(h).subtract(l).add(c).add(u),p.copy(h).subtract(e),g=t.dot(p),r=Math.min(g,r),s=Math.max(g,s),o.copy(h).subtract(l).add(c).subtract(u),p.copy(h).subtract(e),g=t.dot(p),r=Math.min(g,r),s=Math.max(g,s),o.copy(h).subtract(l).subtract(c).add(u),p.copy(h).subtract(e),g=t.dot(p),r=Math.min(g,r),s=Math.max(g,s),o.copy(h).subtract(l).subtract(c).subtract(u),p.copy(h).subtract(e),g=t.dot(p),r=Math.min(g,r),s=Math.max(g,s),i[0]=r,i[1]=s,i}transform(e){this.center.transformAsPoint(e);const t=this.halfAxes.getColumn(0,c1);t.transformAsPoint(e);const i=this.halfAxes.getColumn(1,u1);i.transformAsPoint(e);const r=this.halfAxes.getColumn(2,d1);return r.transformAsPoint(e),this.halfAxes=new Xo([...t,...i,...r]),this}getTransform(){throw new Error("not implemented")}}const cq=new Pn,uq=new Pn;class $F{constructor(e=[0,0,1],t=0){this.normal=new Pn,this.distance=-0,this.fromNormalDistance(e,t)}fromNormalDistance(e,t){return Ec(Number.isFinite(t)),this.normal.from(e).normalize(),this.distance=t,this}fromPointNormal(e,t){e=cq.from(e),this.normal.from(t).normalize();const i=-this.normal.dot(e);return this.distance=i,this}fromCoefficients(e,t,i,r){return this.normal.set(e,t,i),Ec(Zb(this.normal.len(),1)),this.distance=r,this}clone(e){return new $F(this.normal,this.distance)}equals(e){return Zb(this.distance,e.distance)&&Zb(this.normal,e.normal)}getPointDistance(e){return this.normal.dot(e)+this.distance}transform(e){const t=uq.copy(this.normal).transformAsVector(e).normalize(),i=this.normal.scale(-this.distance).transform(e);return this.fromPointNormal(i,t)}projectPointOntoPlane(e,t=[0,0,0]){e=cq.from(e);const i=this.getPointDistance(e),r=uq.copy(this.normal).scale(i);return e.subtract(r).to(t)}}function bFe(n,e,t){const i={"@id":e,"@type":"OntologyTreeNode",id:e,parent:"",children:[],synonymLabels:[],label:""},r={[md.ontologyNode.label.id]:"label",[t]:"parent",[md.ontologyNode.synonymLabels.id]:"synonymLabels"};for(const[s,o]of function*(n,e,t){for(const[i,r]of Object.entries(t))for(const s of(0,xn.readQuads)(n,e,i,null,null)){const o="Literal"===s.object.termType?(0,Kb.fromRdf)(s.object):s.object.id;yield[r,o]}}(n,e,r))"synonymLabels"===s?i.synonymLabels.push(o):i[s]=o;return i.children=n.getSubjects(t,e,null).map(s=>s.id),i}function mq(n,e,t,i){const r={root:e,nodes:{}},s=new Set;for(const a of(0,xn.readQuads)(n,null,i,null,null))s.add(a.subject.id),s.add(a.object.id);for(const a of s)r.nodes[a]=bFe(n,a,i);r.nodes[e]||(r.nodes[e]={"@id":e,"@type":"OntologyTreeNode",id:e,label:t,children:[],synonymLabels:[]});const o=n.getSubjects(i,e,null).map(a=>a.id).sort((a,l)=>r.nodes[a].label.localeCompare(r.nodes[l].label));return r.nodes[e].children=o,_q(r),r}function _q(n,e,t=new Set){const i=n.nodes[null!=e?e:n.root];if(i){i.children=i.children.filter(r=>!t.has(r)),i.children.forEach(r=>t.add(r));for(const r of i.children)_q(n,r,t),n.nodes[r]&&(n.nodes[r].parent=i["@id"])}}new Pn([1,0,0]),new Pn([0,1,0]),new Pn([0,0,1]),new Pn,new Pn,new $F(new Pn(1,0,0),0),new Pn,new Pn,new Pn,new Pn,new Pn,new Pn,new Pn,new Pn,new Pn,new Pn,new Pn,new Pn,new Pn,new Pn,new Pn,new Pn,new Pn,Math,new Xo,new Xo,new Xo,new Xo,new Xo,new Pn,new Pn,new Pn,new Pn,new Pn,new Xo,new Xo,new Xo,(0,fr.memoize)(function(n){const e=mq(n,X9.body.id,"body",md.asctb.part_of.id);return e.nodes[X9.body.id].children=["http://purl.obolibrary.org/obo/UBERON_0000955","http://purl.obolibrary.org/obo/UBERON_0000029","http://purl.obolibrary.org/obo/UBERON_0000970","http://purl.obolibrary.org/obo/UBERON_0003889","http://purl.obolibrary.org/obo/UBERON_0000948","http://purl.obolibrary.org/obo/UBERON_0002113","http://purl.obolibrary.org/obo/UBERON_0001465","http://purl.obolibrary.org/obo/UBERON_0002107","http://purl.obolibrary.org/obo/UBERON_0002048","http://purl.obolibrary.org/obo/UBERON_0001911","http://purl.obolibrary.org/obo/UBERON_0000992","http://purl.obolibrary.org/obo/UBERON_0001264","http://purl.obolibrary.org/obo/UBERON_0001270","http://purl.obolibrary.org/obo/UBERON_0001987","http://purl.obolibrary.org/obo/UBERON_0002367","http://purl.obolibrary.org/obo/UBERON_0002097","http://purl.obolibrary.org/obo/UBERON_0002108","http://purl.obolibrary.org/obo/UBERON_0002240","http://purl.obolibrary.org/obo/UBERON_0000059","http://purl.obolibrary.org/obo/UBERON_0002106","http://purl.obolibrary.org/obo/UBERON_0002370","http://purl.obolibrary.org/obo/UBERON_0000056","http://purl.obolibrary.org/obo/UBERON_0001255","http://purl.obolibrary.org/obo/UBERON_0000995","http://purl.obolibrary.org/obo/UBERON_0004537"].filter(t=>t in e.nodes),e},()=>"");const p1={[co_label.id]:"label",[co_description.id]:"description",[co_link.id]:"link"};Object.assign(Object.assign({},p1),{[co_providerName.id]:"providerName"}),Object.assign(Object.assign({},p1),{[co_technology.id]:"technology",[co_thumbnail.id]:"thumbnail"}),Object.assign(Object.assign({},p1),{[co_sampleType.id]:"sampleType",[co_sectionNumber.id]:"sectionNumber",[co_datasets.id]:"datasets"}),Object.assign(Object.assign({},p1),{[co_sampleType.id]:"sampleType",[co_sectionCount.id]:"sectionCount",[co_sectionSize.id]:"sectionSize",[co_sectionUnits.id]:"sectionUnits",[co_donor.id]:"donor",[co_spatialEntity.id]:"spatialEntityId",[co_sections.id]:"sections",[co_datasets.id]:"datasets"});const 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"};function mu(n){return new Promise((e,t)=>{n.oncomplete=n.onsuccess=()=>e(n.result),n.onabort=n.onerror=()=>t(n.error)})}let ZF;function Sc(){return ZF||(ZF=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),mu(i)});return(i,r)=>t.then(s=>r(s.transaction(e,i).objectStore(e)))}(0,"keyval")),ZF}function vq(n,e=Sc()){return e("readonly",t=>mu(t.get(n)))}const g1="Unknown Euler angle order",$m=.99999;class Ji extends bS{static get ZYX(){return 0}static get YXZ(){return 1}static get XZY(){return 2}static get ZXY(){return 3}static get YZX(){return 4}static get XYZ(){return 5}static get RollPitchYaw(){return 0}static get DefaultOrder(){return Ji.ZYX}static get RotationOrders(){return["ZYX","YXZ","XZY","ZXY","YZX","XYZ"]}static rotationOrder(e){return Ji.RotationOrders[e]}get ELEMENTS(){return 4}constructor(e=0,t=0,i=0,r=Ji.DefaultOrder){super(-0,-0,-0,-0),arguments.length>0&&Array.isArray(arguments[0])?this.fromVector3(...arguments):this.set(e,t,i,r)}fromQuaternion(e){const[t,i,r,s]=e,o=i*i,a=-2*(o+r*r)+1,l=2*(t*i+s*r);let c=-2*(t*r-s*i);c=c>1?1:c,c=c<-1?-1:c;const p=Math.atan2(2*(i*r+s*t),-2*(t*t+o)+1),g=Math.asin(c),m=Math.atan2(l,a);return new Ji(p,g,m,Ji.RollPitchYaw)}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=Number.isFinite(e[3])||this.order,this.check()}set(e=0,t=0,i=0,r){return this[0]=e,this[1]=t,this[2]=i,this[3]=Number.isFinite(r)?r:this[3],this.check()}validate(){return function(n){return n>=0&&n<6}(this[3])&&Number.isFinite(this[0])&&Number.isFinite(this[1])&&Number.isFinite(this[2])}toArray(e=[],t=0){return e[t]=this[0],e[t+1]=this[1],e[t+2]=this[2],e}toArray4(e=[],t=0){return e[t]=this[0],e[t+1]=this[1],e[t+2]=this[2],e[t+3]=this[3],e}toVector3(e=[-0,-0,-0]){return e[0]=this[0],e[1]=this[1],e[2]=this[2],e}get x(){return this[0]}set x(e){this[0]=sr(e)}get y(){return this[1]}set y(e){this[1]=sr(e)}get z(){return this[2]}set z(e){this[2]=sr(e)}get alpha(){return this[0]}set alpha(e){this[0]=sr(e)}get beta(){return this[1]}set beta(e){this[1]=sr(e)}get gamma(){return this[2]}set gamma(e){this[2]=sr(e)}get phi(){return this[0]}set phi(e){this[0]=sr(e)}get theta(){return this[1]}set theta(e){this[1]=sr(e)}get psi(){return this[2]}set psi(e){this[2]=sr(e)}get roll(){return this[0]}set roll(e){this[0]=sr(e)}get pitch(){return this[1]}set pitch(e){this[1]=sr(e)}get yaw(){return this[2]}set yaw(e){this[2]=sr(e)}get order(){return this[3]}set order(e){this[3]=function(n){if(n<0&&n>=6)throw new Error(g1);return n}(e)}fromVector3(e,t){return this.set(e[0],e[1],e[2],Number.isFinite(t)?t:this[3])}fromArray(e,t=0){return this[0]=e[0+t],this[1]=e[1+t],this[2]=e[2+t],void 0!==e[3]&&(this[3]=e[3]),this.check()}fromRollPitchYaw(e,t,i){return this.set(e,t,i,Ji.ZYX)}fromRotationMatrix(e,t=Ji.DefaultOrder){return this._fromRotationMatrix(e,t),this.check()}getRotationMatrix(e){return this._getRotationMatrix(e)}getQuaternion(){const e=new gR;switch(this[4]){case Ji.XYZ:return e.rotateX(this[0]).rotateY(this[1]).rotateZ(this[2]);case Ji.YXZ:return e.rotateY(this[0]).rotateX(this[1]).rotateZ(this[2]);case Ji.ZXY:return e.rotateZ(this[0]).rotateX(this[1]).rotateY(this[2]);case Ji.ZYX:return e.rotateZ(this[0]).rotateY(this[1]).rotateX(this[2]);case Ji.YZX:return e.rotateY(this[0]).rotateZ(this[1]).rotateX(this[2]);case Ji.XZY:return e.rotateX(this[0]).rotateZ(this[1]).rotateY(this[2]);default:throw new Error(g1)}}_fromRotationMatrix(e,t=Ji.DefaultOrder){const i=e.elements,r=i[0],s=i[4],o=i[8],a=i[1],l=i[5],c=i[9],u=i[2],h=i[6],p=i[10];switch(t=t||this[3]){case Ji.XYZ:this[1]=Math.asin(Va(o,-1,1)),Math.abs(o)<$m?(this[0]=Math.atan2(-c,p),this[2]=Math.atan2(-s,r)):(this[0]=Math.atan2(h,l),this[2]=0);break;case Ji.YXZ:this[0]=Math.asin(-Va(c,-1,1)),Math.abs(c)<$m?(this[1]=Math.atan2(o,p),this[2]=Math.atan2(a,l)):(this[1]=Math.atan2(-u,r),this[2]=0);break;case Ji.ZXY:this[0]=Math.asin(Va(h,-1,1)),Math.abs(h)<$m?(this[1]=Math.atan2(-u,p),this[2]=Math.atan2(-s,l)):(this[1]=0,this[2]=Math.atan2(a,r));break;case Ji.ZYX:this[1]=Math.asin(-Va(u,-1,1)),Math.abs(u)<$m?(this[0]=Math.atan2(h,p),this[2]=Math.atan2(a,r)):(this[0]=0,this[2]=Math.atan2(-s,l));break;case Ji.YZX:this[2]=Math.asin(Va(a,-1,1)),Math.abs(a)<$m?(this[0]=Math.atan2(-c,l),this[1]=Math.atan2(-u,r)):(this[0]=0,this[1]=Math.atan2(o,p));break;case Ji.XZY:this[2]=Math.asin(-Va(s,-1,1)),Math.abs(s)<$m?(this[0]=Math.atan2(h,l),this[1]=Math.atan2(o,r)):(this[0]=Math.atan2(-c,p),this[1]=0);break;default:throw new Error(g1)}return this[3]=t,this}_getRotationMatrix(e){const t=e||[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],i=this.x,r=this.y,s=this.z,o=Math.cos(i),a=Math.cos(r),l=Math.cos(s),c=Math.sin(i),u=Math.sin(r),h=Math.sin(s);switch(this[3]){case Ji.XYZ:{const p=o*l,g=o*h,m=c*l,w=c*h;t[0]=a*l,t[4]=-a*h,t[8]=u,t[1]=g+m*u,t[5]=p-w*u,t[9]=-c*a,t[2]=w-p*u,t[6]=m+g*u,t[10]=o*a;break}case Ji.YXZ:{const p=a*l,g=a*h,m=u*l,w=u*h;t[0]=p+w*c,t[4]=m*c-g,t[8]=o*u,t[1]=o*h,t[5]=o*l,t[9]=-c,t[2]=g*c-m,t[6]=w+p*c,t[10]=o*a;break}case Ji.ZXY:{const p=a*l,g=a*h,m=u*l,w=u*h;t[0]=p-w*c,t[4]=-o*h,t[8]=m+g*c,t[1]=g+m*c,t[5]=o*l,t[9]=w-p*c,t[2]=-o*u,t[6]=c,t[10]=o*a;break}case Ji.ZYX:{const p=o*l,g=o*h,m=c*l,w=c*h;t[0]=a*l,t[4]=m*u-g,t[8]=p*u+w,t[1]=a*h,t[5]=w*u+p,t[9]=g*u-m,t[2]=-u,t[6]=c*a,t[10]=o*a;break}case Ji.YZX:{const p=o*a,g=o*u,m=c*a,w=c*u;t[0]=a*l,t[4]=w-p*h,t[8]=m*h+g,t[1]=h,t[5]=o*l,t[9]=-c*l,t[2]=-u*l,t[6]=g*h+m,t[10]=p-w*h;break}case Ji.XZY:{const p=o*a,g=o*u,m=c*a,w=c*u;t[0]=a*l,t[4]=-h,t[8]=u*l,t[1]=p*h+w,t[5]=o*l,t[9]=g*h-m,t[2]=m*h-g,t[6]=c*l,t[10]=w*h+p;break}default:throw new Error(g1)}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}toQuaternion(){const e=Math.cos(.5*this.yaw),t=Math.sin(.5*this.yaw),i=Math.cos(.5*this.roll),r=Math.sin(.5*this.roll),s=Math.cos(.5*this.pitch),o=Math.sin(.5*this.pitch);return new gR(e*r*s-t*i*o,e*i*o+t*r*s,t*i*s-e*r*o,e*i*s+t*r*o)}}var m1,FFe=new Uint8Array(16);function kFe(){if(!m1&&!(m1="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return m1(FFe)}const LFe=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,jFe=function(n){return"string"==typeof n&&LFe.test(n)};for(var ho=[],e2=0;e2<256;++e2)ho.push((e2+256).toString(16).substr(1));const HFe=function(n,e,t){var i=(n=n||{}).random||(n.rng||kFe)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,e){t=t||0;for(var r=0;r<16;++r)e[t+r]=i[r];return e}return function(n){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,t=(ho[n[e+0]]+ho[n[e+1]]+ho[n[e+2]]+ho[n[e+3]]+"-"+ho[n[e+4]]+ho[n[e+5]]+"-"+ho[n[e+6]]+ho[n[e+7]]+"-"+ho[n[e+8]]+ho[n[e+9]]+"-"+ho[n[e+10]]+ho[n[e+11]]+ho[n[e+12]]+ho[n[e+13]]+ho[n[e+14]]+ho[n[e+15]]).toLowerCase();if(!jFe(t))throw TypeError("Stringified UUID is invalid");return t}(i)};function*t2(n,e,t){for(const[i,r]of Object.entries(t))for(const s of(0,xn.readQuads)(n,e,i,null,null)){const o="Literal"===s.object.termType?(0,Kb.fromRdf)(s.object):s.object.id;yield[r,o]}}function dp(n,e,t,i){const r={"@id":e,"@type":t};for(const[s,o]of Object.entries(i))for(const a of(0,xn.readQuads)(n,r["@id"],s,null,null)){const l="Literal"===a.object.termType?(0,Kb.fromRdf)(a.object):a.object.id;r[o]=l}return r}const ar=xn.Util.prefixes({base:"http://purl.org/ccf/latest/ccf.owl#",ccf:"http://purl.org/ccf/",fma:"http://purl.org/sig/ont/fma/fma",obo:"http://purl.obolibrary.org/obo/",uberon:"http://purl.obolibrary.org/obo/UBERON_",cl:"http://purl.obolibrary.org/obo/CL_",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/",dcterms:"http://purl.org/dc/terms/"},xn.DataFactory),wq={x:ar("rdf"),type:ar("rdf")("type")},dn=(ar("rdfs"),ar("rdfs")("label"),ar("rdfs")("comment"),ar("rdfs")("isDefinedBy"),ar("rdfs")("seeAlso"),ar("ccf")),yi={id:ar("ccf")("has_registration_location"),label:ar("rdfs")("label"),description:ar("rdfs")("comment"),link:dn("url"),sex:dn("sex"),age:dn("age"),bmi:dn("bmi"),Male:xn.DataFactory.literal("Male"),Female:xn.DataFactory.literal("Female"),consortiumName:dn("consortium_name"),providerName:dn("tissue_provider_name"),providerUUID:dn("tissue_provider_uuid"),donor:dn("comes_from"),sections:dn("subdivided_into_sections"),datasets:dn("generates_dataset"),sampleType:dn("sample_type"),TissueBlock:xn.DataFactory.literal("Tissue Block"),TissueSection:xn.DataFactory.literal("Tissue Section"),NonStandard:xn.DataFactory.literal("Non-standard"),sectionCount:dn("section_count"),sectionSize:dn("section_size"),sectionUnits:dn("section_size_unit"),sectionNumber:dn("section_number"),spatialEntity:dn("has_registration_location"),ontologyTerms:dn("has_ontology_term"),cellTypeTerms:dn("has_cell_type_term"),technology:dn("technology"),thumbnail:dn("thumbnail")},ki={x:dn,base:ar("base"),ontologyNode:{label:dn("ccf_pref_label"),parent:dn("ccf_part_of"),children:dn("ccf_part_of"),rui_rank:dn("rui_rank"),synonymLabels:xn.DataFactory.namedNode("http://www.geneontology.org/formats/oboInOwl#hasExactSynonym")},asctb:{part_of:dn("ccf_part_of"),ct_is_a:dn("ccf_ct_isa"),located_in:dn("ccf_located_in"),characterizes:dn("ccf_characterizes")},spatial:{Female:ar("base")("VHFemale"),Male:ar("base")("VHMale"),BothSexes:ar("base")("VHBothSexes"),FemaleOrgans:ar("base")("VHFemaleOrgans"),MaleOrgans:ar("base")("VHMaleOrgans")},SpatialObjectReference:dn("spatial_object_reference"),SpatialEntity:dn("spatial_entity"),SpatialPlacement:dn("spatial_placement"),spatialObjectReference:{file:dn("file_url"),file_format:dn("file_format"),file_subpath:dn("file_subpath")},extractionSet:{label:ar("rdfs")("label"),rui_rank:dn("rui_rank")},spatialEntity:{label:ar("rdfs")("label"),description:ar("rdfs")("comment"),creator:ar("dcterms")("creator"),creator_first_name:dn("creator_first_name"),creator_last_name:dn("creator_last_name"),creator_orcid:dn("creator_orcid"),creation_date:ar("dcterms")("created"),updated_date:dn("updated_date"),ccf_annotations:dn("collides_with"),representation_of:dn("representation_of"),reference_organ:dn("has_reference_organ"),extraction_set_for:dn("extraction_set_for"),extraction_set:dn("has_extraction_set"),sex:dn("organ_owner_sex"),side:dn("organ_side"),rui_rank:dn("rui_rank"),slice_thickness:dn("slice_thickness"),slice_count:dn("slice_count"),x_dimension:dn("x_dimension"),y_dimension:dn("y_dimension"),z_dimension:dn("z_dimension"),dimension_units:dn("dimension_unit"),object:dn("has_object_reference")},spatialPlacement:{source:dn("placement_for"),target:dn("placement_relative_to"),placement_date:ar("dcterms")("created"),x_scaling:dn("x_scaling"),y_scaling:dn("y_scaling"),z_scaling:dn("z_scaling"),scaling_units:dn("scaling_unit"),x_rotation:dn("x_rotation"),y_rotation:dn("y_rotation"),z_rotation:dn("z_rotation"),w_rotation:dn("theta_rotation"),rotation_order:dn("rotation_order"),rotation_units:dn("rotation_unit"),x_translation:dn("x_translation"),y_translation:dn("y_translation"),z_translation:dn("z_translation"),translation_units:dn("translation_unit")}},di={x:ar("uberon"),body:ar("uberon")("0013702")},$Fe={x:ar("cl"),cell:ar("cl")("0000000")},nv={x:ar("fma")},bd=(ar("lmha"),{body:di.body,cell:$Fe.cell,respiratory_system:di.x("0001004"),colon:di.x("0001155"),left_lung:di.x("0002168"),right_lung:di.x("0002167"),left_bronchus:di.x("0002178"),right_bronchus:di.x("0002177"),kidney:di.x("0002113"),ureter:di.x("0000056"),eye:di.x("0000970"),fallopian_tube:di.x("0003889"),knee:di.x("0001465"),ovary:di.x("0000992"),trachea:di.x("0003126"),aorta:di.x("0000947"),blood:di.x("0000178"),bone_marrow:di.x("0002371"),male_reproductive_system:di.x("0000079"),lymph_node:di.x("0000029"),blood_vasculature:di.x("0004537"),brain:di.x("0000955"),eye_left:di.x("0004548"),eye_right:nv.x("54449"),fallopian_tube_left:di.x("0001303"),fallopian_tube_right:di.x("0001302"),heart:di.x("0000948"),kidney_left:di.x("0004538"),kidney_right:di.x("0004539"),knee_left:nv.x("24978"),knee_right:nv.x("24977"),large_intestine:di.x("0000059"),liver:di.x("0002107"),lungs:di.x("0002048"),mesenteric_lymph_node:di.x("0002509"),ovary_left:nv.x("7214"),ovary_right:nv.x("7213"),pancreas:di.x("0001264"),pelvis:di.x("0001270"),prostate_gland:di.x("0002367"),skin:di.x("0002097"),small_intestine:di.x("0002108"),spleen:di.x("0002106"),thymus:di.x("0002370"),ureter_left:di.x("0001223"),ureter_right:di.x("0001222"),urinary_bladder:di.x("0001255"),uterus:di.x("0000995")});function n2(n){const e={};return Object.entries(n).forEach(([t,i])=>{e[i.id]=t}),e}const _1={spatialObjectReference:n2(ki.spatialObjectReference),spatialEntity:n2(ki.spatialEntity),spatialPlacement:n2(ki.spatialPlacement)};function Eq(n,e){const t=dp(n,e,"ExtractionSet",_1.spatialEntity);return t.extractionSites=(0,fr.sortBy)(n.getSubjects(ki.spatialEntity.extraction_set,e,null).map(i=>hp(n,i.id)),["rui_rank"]),t}function hp(n,e){const t=dp(n,e,"SpatialEntity",_1.spatialEntity);return t.object&&(t.object=function(n,e){return dp(n,e,"SpatialObjectReference",_1.spatialObjectReference)}(n,t.object)),t.ccf_annotations&&(t.ccf_annotations=n.getObjects(e,ki.spatialEntity.ccf_annotations,null).map(i=>i.id)),n.forSubjects(i=>t.entityId=i.id,yi.spatialEntity,e,null),t}function XFe(n,e){const t=dp(n,e,"SpatialPlacement",_1.spatialPlacement);return t.source&&(t.source=hp(n,t.source)),t.target&&(t.target=hp(n,t.target)),t}function Sq(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(EV),o=[t.x_scaling,t.y_scaling,t.z_scaling];return n.translate(r).rotateXYZ(s).scale(o)}class xq{constructor(e){this.db=e,this.createGraph()}createGraph(){this.graph=new HNe.DirectedGraph;const e=this.db.store;e.forSubjects(i=>{this.addNode(i.id,"SpatialObjectReference")},wq.type,ki.SpatialObjectReference,null),e.forSubjects(i=>{this.addNode(i.id,"SpatialEntity")},wq.type,ki.SpatialEntity,null);const t={};for(const i of(0,xn.readQuads)(e,null,ki.spatialPlacement.source,null,null))t[i.subject.id]=i.object.id;for(const i of(0,xn.readQuads)(e,null,ki.spatialPlacement.target,null,null)){const r=t[i.subject.id];r&&this.addEdge(i.subject.id,r,i.object.id,"SpatialPlacement")}}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 qn(qn.IDENTITY);if(!this.graph.hasNode(e)||!this.graph.hasNode(t))return;const i=this.db.store,r=new qn(qn.IDENTITY),s=$Ne()(this.graph,e,t);if(s&&s.length>0){s.reverse();let o="";for(const a of s)o&&Sq(r,XFe(i,this.graph.getEdgeAttribute(a,o,"id"))),o=a;return r}}getSpatialPlacement(e,t){const i=this.graph.hasNode(e["@id"])?e["@id"]:void 0,r=(0,fr.get)(e,"placement[0]",(0,fr.get)(e,"placement",void 0));let s;if(r&&this.graph.hasNode(r.target)?(s=this.getTransformationMatrix(r.target,t),s&&(s=Sq(s,r))):i&&(s=this.getTransformationMatrix(i,t)),s){const o=(new Ji).fromRotationMatrix(s,Ji.XYZ),a=s.getTranslation().map(u=>1e3*u),l=o.toVector3().map(vse),c=s.getScale().map(u=>u<1&&u>.999999?1:u);return{"@context":"https://hubmapconsortium.github.io/hubmap-ontology/ccf-context.jsonld","@id":`http://purl.org/ccf/1.5/${HFe()}_placement`,"@type":"SpatialPlacement",source:e["@id"],target:t,placement_date:(new Date).toISOString().split("T")[0],x_scaling:c[0],y_scaling:c[1],z_scaling:c[2],scaling_units:"ratio",x_rotation:l[0],y_rotation:l[1],z_rotation:l[2],rotation_order:"XYZ",rotation_units:"degree",x_translation:a[0],y_translation:a[1],z_translation:a[2],translation_units:"millimeter"}}}}class Cq{constructor(e){this.db=e}getSpatialEntity(e){return hp(this.db.store,e)}getExtractionSets(e){return function(n,e){return(0,fr.sortBy)(n.getSubjects(ki.spatialEntity.extraction_set_for,e,null).map(t=>Eq(n,t.id)),["rui_rank"])}(this.db.store,e)}getExtractionSet(e){return Eq(this.db.store,e)}getAnatomicalStructures(e){return function(n,e){return(0,fr.sortBy)(n.getSubjects(ki.spatialEntity.reference_organ,e,null).map(t=>hp(n,t.id)).filter(t=>t["@id"]!==e),["rui_rank"])}(this.db.store,e)}getReferenceOrgans(){return function(n){const e=[];return n.forEach(t=>{t.subject.id===t.object.id&&e.push(hp(n,t.subject.id))},null,ki.spatialEntity.reference_organ,null,null),(0,fr.sortBy)(e,["rui_rank"])}(this.db.store)}getReferenceBody(e){let t;switch(null==e?void 0:e.sex){case"Male":t=ki.spatial.Male.id;break;case"Female":t=ki.spatial.Female.id;break;case"Both":default:t=ki.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),i=[];let r=[...this.getReferenceOrganSets(e).map(s=>{const o="http://purl.obolibrary.org/obo/UBERON_0002097"===s.representation_of,a=this.getSceneNode(s,t,{color:[255,255,255,255],opacity:o?.5:.2,unpickable:!0,_lighting:"pbr",zoomBasedOpacity:!o});return o&&a?void i.push(a):a})];return i.length>0&&(r=[...i,...r]),(null==e?void 0:e.debug)&&(r=r.concat([this.getSceneNode(this.getSpatialEntity(ki.base("VHRightKidney").id),t,{color:[0,0,255,127.5],geometry:"wireframe"}),this.getSceneNode(this.getSpatialEntity(ki.base("VHLeftKidney").id),t,{color:[255,0,0,127.5],geometry:"wireframe"}),this.getSceneNode(this.getSpatialEntity(ki.base("VHSpleenCC1").id),t,{color:[0,255,0,127.5],geometry:"wireframe"}),this.getSceneNode(this.getSpatialEntity(ki.base("VHSpleenCC2").id),t,{color:[0,255,0,127.5],geometry:"wireframe"}),this.getSceneNode(this.getSpatialEntity(ki.base("VHSpleenCC3").id),t,{color:[0,255,0,127.5],geometry:"wireframe"})])),r.filter(s=>void 0!==s)}getReferenceOrganScene(e,t){var i,r;const s=void 0!==(null==t?void 0:t.sex)&&"both"!==(null===(i=null==t?void 0:t.sex)||void 0===i?void 0:i.toLowerCase()),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"}),u=(null!==(r=this.db.getSpatialEntities(t))&&void 0!==r?r:[]).map(h=>this.getSceneNode(h,a,{color:[255,255,255,229.5]}));return[c].concat(u).filter(h=>void 0!==h)}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 u=this.db.graph.getTransformationMatrix(l&&e.object?e.object["@id"]:e["@id"],t["@id"]);if(u){if(l)u=new qn(qn.IDENTITY).rotateX(EV(90)).multiplyLeft(u);else{let h;switch(e.dimension_units){case"centimeter":h=.01;break;case"millimeter":h=.001;break;case"meter":default:h=1}const p=[e.x_dimension,e.y_dimension,e.z_dimension].map(g=>g*h/2);u.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:u,tooltip:e.label},i)}}getScene(e){return[...this.getReferenceSceneNodes(e),...this.getEntitySceneNodes(e)]}}const y1="https://entity.api.hubmapconsortium.org/entities/",Aq=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"]),ZFe={"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"},Wm={"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","5c106f29-ea2d-11e9-85e8-0efb3ba9a670":"RTI-General Electric","301615f9-c870-11eb-a8dc-35ce3d8786fe":"TMC-UConn"},Tq={"@base":"http://purl.org/ccf/latest/ccf-entity.owl#","@vocab":"http://purl.org/ccf/latest/ccf-entity.owl#",ccf:"http://purl.org/ccf/",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"},cellTypeTerms:{"@id":"has_cell_type_term","@type":"@id"},thumbnail:{"@id":"has_thumbnail"}};class t2e{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||[],u=(this.data.ancestors||[]).find(Be=>"Donor"===Be.entity_type);this.donor=this.getDonor(u,i);const h=this.getRuiLocation(e,this.donor);h?this.rui_location=h:this.bad=!0,Wm[e.group_uuid]||(Wm[e.group_uuid]=e.group_name);const p=new Date(e.last_modified_timestamp).toLocaleDateString(),g=Wm[e.group_uuid]||e.group_name,m=e.created_by_user_displayname;this["@id"]=y1+e.uuid,this.label=`Registered ${p}, ${m}, ${g}`,this.link=`${i}browse/sample/${e.uuid}`;const w={},C=[];this.sections=C;const H=[];this.datasets=H;for(const Be of c.filter(et=>"Sample"===et.entity_type)){const et=this.getSection(Be,e,i);w[Be.submission_id]=et,C.push(et),et.section_number=null!==(s=et.section_number)&&void 0!==s?s:C.length}for(const Be of c)if("Dataset"===Be.entity_type){const et=this.getDataset(Be,t,i,r),wt=(0,fr.get)(Be,["ingest_metadata","metadata","tissue_id"]);w[wt]?null===(o=w[wt].datasets)||void 0===o||o.push(et):H.push(et)}const U=null!=h?h:{},de=`${U.x_dimension} x ${U.y_dimension} x ${U.z_dimension} ${U.dimension_units}`;this.section_count=U.slice_count||C.length;const Ae=parseFloat((U.slice_thickness||(U.z_dimension||0)/Math.max(this.section_count,1)).toFixed(1));this.section_size=Ae;const Pe=U.dimension_units||"millimeter";this.section_units=Pe,this.description=`${de}, ${Ae} ${Pe}, ${e.specimen_type}, ${this.section_count} Sections`,C.forEach((Be,et)=>{Be.description=`${U.x_dimension} x ${U.y_dimension} x ${Ae} ${Pe}, ${Ae} ${Pe}, ${Be.description}`,Be.section_number=et+1})}getSection(e,t,i){const r=new Date(e.last_modified_timestamp).toLocaleDateString();return{"@id":y1+e.uuid,"@type":"Sample",label:`Registered ${r}, ${e.created_by_user_displayname}, ${Wm[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=Wm[e.group_uuid]||e.group_name,l=e.created_by_user_displayname,c=[...e.data_types,(0,fr.get)(e,["ingest_metadata","metadata","assay_type"],"")],u=c.join("|").toLowerCase();let h,p="assets/icons/ico-unknown.svg";return-1!==u.indexOf("10x")?(h="10x",p="assets/icons/ico-bulk-10x.svg"):-1!==u.indexOf("af")?(h="AF",p="assets/icons/ico-spatial-af.svg"):-1!==u.indexOf("codex")?(h="CODEX",p="assets/icons/ico-spatial-codex.svg"):-1!==u.indexOf("imc")?(h="IMC",p="assets/icons/ico-spatial-imc.svg"):-1!==u.indexOf("lc")&&-1===u.indexOf("af")?(h="LC",p="assets/icons/ico-bulk-lc.svg"):h=-1!==u.indexOf("maldi")?"MALDI":-1!==u.indexOf("pas")?"PAS":"OTHER",p=null!==(s=this.getDatasetThumbnail(e,t,r))&&void 0!==s?s:p,{"@id":y1+e.uuid,"@type":"Dataset",label:`Registered ${o}, ${l}, ${a}`,description:`Data/Assay Types: ${c.join(", ")}`,link:`${i}browse/dataset/${e.uuid}`,technology:h,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,fr.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=>Aq.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(Aq.has(s))return`assets/thumbnails/TMC-Vanderbilt/DR1/${s}`}}else if("07a29e4c-ed43-11e8-b56a-0e8017bdda58"===e.group_uuid){const r=ZFe[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,fr.toNumber)(s[1]));for(const p of(0,fr.get)(e,"metadata.organ_donor_data",(0,fr.get)(e,"metadata.living_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,fr.toNumber)(p.data_value):"Body mass index"===p.preferred_term&&(a=(0,fr.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(),u=Wm[e.group_uuid]||e.group_name;return{"@id":y1+e.uuid,"@type":"Donor",label:l,description:`Entered ${c}, ${e.created_by_user_displayname}, ${u}`,link:`${t}browse/donor/${e.uuid}`,age:o,sex:r,bmi:a,consortium_name:"HuBMAP",provider_name:u,provider_uuid:e.group_uuid,samples:[]}}getRuiLocation(e,t){var i;let r,s=e.rui_location;if(s&&("string"==typeof s&&(s=JSON.parse(s)),s.alignment_id?console.log("Detected a deprecated rui_location",e.uuid):s["@id"]&&(r=s)),r){const o=null!==(i=(0,fr.get)(r,["placement","target"]))&&void 0!==i?i:"";o.startsWith("http://purl.org/ccf/latest/ccf.owl#VHSpleenCC")?(0,fr.set)(r,["placement","target"],o.replace("#VHSpleenCC","Male"===t.sex?"#VHMSpleenCC":"#VHFSpleenCC")):("http://purl.org/ccf/latest/ccf.owl#VHLeftKidney"===o||"http://purl.org/ccf/latest/ccf.owl#VHRightKidney"===o)&&(0,fr.set)(r,["placement","target"],"Male"===t.sex?o.replace("#VH","#VHM")+"_Patch":o.replace("#VH","#VHF")+"_Patch")}return r}getTissueBlock(){return(0,fr.omit)(Object.assign({},this),["data","bad","donor"])}toJsonLd(){return Object.assign(Object.assign({},this.donor),{samples:[this.getTissueBlock()]})}}const i2e=["uuid","entity_type","group_uuid","group_name","last_modified_timestamp","created_by_user_displayname","ancestors.entity_type","ancestors.description","ancestors.metadata.organ_donor_data.preferred_term","ancestors.metadata.organ_donor_data.data_value","ancestors.metadata.living_donor_data.preferred_term","ancestors.metadata.living_donor_data.data_value","ancestors.last_modified_timestamp","ancestors.group_uuid","ancestors.group_name","ancestors.created_by_user_displayname","ancestors.uuid","descendants.entity_type","descendants.ingest_metadata.metadata.tissue_id","descendants.last_modified_timestamp","descendants.group_uuid","descendants.group_name","descendants.created_by_user_displayname","descendants.uuid","descendants.data_types","descendants.ingest_metadata.metadata.assay_type","descendants.thumbnail_file","descendants.metadata.files.rel_path","rui_location","specimen_type"],r2e={exists:{field:"rui_location"}};function Mq(n,e,t){return JSON.stringify({version:!0,from:n,size:e,stored_fields:["*"],script_fields:{},docvalue_fields:[],query:null!=t?t:r2e,_source:{includes:i2e}})}function r2(n,e){return Fi(this,void 0,void 0,function*(){try{const t=yield fetch(n,e);return t.ok?yield t.json():void 0}catch(t){return}})}function Dq(n,e,t,i,r="",s=""){return Fi(this,void 0,void 0,function*(){let o;if("static"===e?o=yield r2(n):"search-api"===e&&(o=yield function(n,e,t){return Fi(this,void 0,void 0,function*(){const i=250,r=function(n){const e=new Headers;return e.append("Content-type","application/json"),n&&e.append("Authorization",`Bearer ${n}`),e}(e),s=Mq(0,i,t),o=yield r2(n,{method:"POST",headers:r,body:s});if(!o)return;const a=o.hits.total.value;if(a<=i)return o;const l=[];for(let h=i;h!h))return;const u=c.map(h=>h.hits.hits);return Object.assign(Object.assign({},o),{hits:Object.assign(Object.assign({},o.hits),{hits:o.hits.hits.concat(...u)})})})}(n,i,t)),o)return function(n,e="",t="",i,r=!1){const o={},a=(0,fr.get)(n,"hits.hits",[]).map(c=>(0,fr.get)(c,"_source",{})).sort((c,u)=>c.uuid.localeCompare(u.uuid)).map(c=>new t2e(c,e,t,i).toJsonLd());for(const c of a){const u=c["@id"];o[u]?o[u].samples.push(c.samples[0]):o[u]=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":Tq},c)))),{"@context":Tq,"@graph":l}}(o,r,s,i);console.warn(`Unable to load ${n} as HuBMAP Data`)})}function iv(n,e,t){const i=new Set;for(const r of e)for(const s of(0,xn.readQuads)(n,r,t,null,null))i.add(s.object.id);return i}const u2e={[ki.spatialEntity.x_dimension.id]:"x",[ki.spatialEntity.y_dimension.id]:"y",[ki.spatialEntity.z_dimension.id]:"z"};function h2e(n,e,t,i){const r=e.getTransformationMatrix(t,i);let s;if(r){const o=r.getTranslation(),a=function(n,e){const t=dp(n,e,"Dimensions",u2e);return[t.x,t.y,t.z]}(n,t).map(c=>c/1e3/2),l=(new Ji).fromRotationMatrix(r,Ji.XYZ).toQuaternion().normalize().calculateW();s=(new GF).fromCenterHalfSizeQuaternion(o,a,l)}return s}function f2e(n,e,t,i){const{x:r,y:s,z:o,radius:a,target:l}=i,c=new Set,u=a/1e3*(a/1e3);for(const h of t){const p=h2e(n,e,h,l);p&&p.distanceSquaredTo([r,s,o].map(m=>m/1e3))<=u&&c.add(h)}return c}function b1(n,e,t){var i,r;const s=new Map,o=new Set;for(const c of e)for(const u of(0,xn.readQuads)(n,c,yi.donor,null,null))o.add(u.object.id),s.has(u.object.id)?null===(i=s.get(u.object.id))||void 0===i||i.push(c):s.set(u.object.id,[c]);const a=t(o),l=new Set;for(const c of a)for(const u of null!==(r=s.get(c))&&void 0!==r?r:[])l.add(u);return l}function s2(n,e,t){var i,r;const s=new Map,o=new Set;for(const c of e)for(const u of(0,xn.readQuads)(n,c,yi.spatialEntity,null,null))o.add(u.object.id),s.has(u.object.id)?null===(i=s.get(u.object.id))||void 0===i||i.push(c):s.set(u.object.id,[c]);const a=t(o),l=new Set;for(const c of a)for(const u of null!==(r=s.get(c))&&void 0!==r?r:[])l.add(u);return l}function rv(n,e){return function(t){n.has(t.id)&&e.add(t.id)}}function Iq(n,e,t){const i=new Set;for(const r of t){const s=xn.DataFactory.namedNode(r);n.forSubjects(rv(e,i),ki.spatialEntity.ccf_annotations,s,null)}return i}function Oq(n,e){const t=function(n,e){const t=new Map;for(const i of n)for(const r of(0,xn.readQuads)(e,i,yi.spatialEntity,null,null))t.has(r.object.id)?t.get(r.object.id).add(i):t.set(r.object.id,new Set([i]));return t}(n,e),i=new Map;for(const r of t.keys()){const s=t.get(r);for(const o of(0,xn.readQuads)(e,r,ki.spatialEntity.ccf_annotations,null,null))if(i.has(o.object.id)){const a=i.get(o.object.id);s.forEach(l=>a.add(l))}else i.set(o.object.id,new Set(s))}return i}function M2e(n,e,t){const i={"@id":e,"@type":"OntologyTreeNode",id:e,parent:"",children:[],synonymLabels:[],label:""},r={[ki.ontologyNode.label.id]:"label",[t]:"parent",[ki.ontologyNode.synonymLabels.id]:"synonymLabels"};for(const[s,o]of t2(n,e,r))"synonymLabels"===s?i.synonymLabels.push(o):i[s]=o;return i.children=n.getSubjects(t,e,null).map(s=>s.id),i}function Rq(n,e,t,i){const r={root:e,nodes:{}},s=new Set;for(const a of(0,xn.readQuads)(n,null,i,null,null))s.add(a.subject.id),s.add(a.object.id);for(const a of s)r.nodes[a]=M2e(n,a,i);r.nodes[e]||(r.nodes[e]={"@id":e,"@type":"OntologyTreeNode",id:e,label:t,children:[],synonymLabels:[]});const o=n.getSubjects(i,e,null).map(a=>a.id).sort((a,l)=>r.nodes[a].label.localeCompare(r.nodes[l].label));return r.nodes[e].children=o,Nq(r),r}function Nq(n,e,t=new Set){const i=n.nodes[null!=e?e:n.root];if(i){i.children=i.children.filter(r=>!t.has(r)),i.children.forEach(r=>t.add(r));for(const r of i.children)Nq(n,r,t),n.nodes[r]&&(n.nodes[r].parent=i["@id"])}}const Pq=(0,fr.memoize)(function(n){const e=Rq(n,bd.body.id,"body",ki.asctb.part_of.id);return e.nodes[bd.body.id].children=["http://purl.obolibrary.org/obo/UBERON_0000955","http://purl.obolibrary.org/obo/UBERON_0000029","http://purl.obolibrary.org/obo/UBERON_0000970","http://purl.obolibrary.org/obo/UBERON_0003889","http://purl.obolibrary.org/obo/UBERON_0000948","http://purl.obolibrary.org/obo/UBERON_0002113","http://purl.obolibrary.org/obo/UBERON_0001465","http://purl.obolibrary.org/obo/UBERON_0002107","http://purl.obolibrary.org/obo/UBERON_0002048","http://purl.obolibrary.org/obo/UBERON_0001911","http://purl.obolibrary.org/obo/UBERON_0000992","http://purl.obolibrary.org/obo/UBERON_0001264","http://purl.obolibrary.org/obo/UBERON_0001270","http://purl.obolibrary.org/obo/UBERON_0001987","http://purl.obolibrary.org/obo/UBERON_0002367","http://purl.obolibrary.org/obo/UBERON_0002097","http://purl.obolibrary.org/obo/UBERON_0002108","http://purl.obolibrary.org/obo/UBERON_0002240","http://purl.obolibrary.org/obo/UBERON_0000059","http://purl.obolibrary.org/obo/UBERON_0002106","http://purl.obolibrary.org/obo/UBERON_0002370","http://purl.obolibrary.org/obo/UBERON_0000056","http://purl.obolibrary.org/obo/UBERON_0001255","http://purl.obolibrary.org/obo/UBERON_0000995","http://purl.obolibrary.org/obo/UBERON_0004537"].filter(t=>t in e.nodes),e},()=>""),v1={[yi.label.id]:"label",[yi.description.id]:"description",[yi.link.id]:"link"},O2e=Object.assign(Object.assign({},v1),{[yi.providerName.id]:"providerName"}),R2e=Object.assign(Object.assign({},v1),{[yi.technology.id]:"technology",[yi.thumbnail.id]:"thumbnail"}),N2e=Object.assign(Object.assign({},v1),{[yi.sampleType.id]:"sampleType",[yi.sectionNumber.id]:"sectionNumber",[yi.datasets.id]:"datasets"}),P2e=Object.assign(Object.assign({},v1),{[yi.sampleType.id]:"sampleType",[yi.sectionCount.id]:"sectionCount",[yi.sectionSize.id]:"sectionSize",[yi.sectionUnits.id]:"sectionUnits",[yi.donor.id]:"donor",[yi.spatialEntity.id]:"spatialEntityId",[yi.sections.id]:"sections",[yi.datasets.id]:"datasets"});function F2e(n,e){return dp(n,e,"Donor",O2e)}function Fq(n,e){return dp(n,e,"Dataset",R2e)}function k2e(n,e){const t={"@id":e,"@type":"Sample",datasets:[]};for(const[i,r]of t2(n,e,N2e))if("datasets"===i){const s=Fq(n,r);t[i].push(s)}else t[i]=r;return t}class B2e{constructor(e){this.database=e,this.connect()}toJson(){return{status:this.status,message:this.message,checkback:"Ready"===this.status||"Error"===this.status?36e5:2e3,loadTime:this.loadTime}}connect(){this.status="Loading",this.message="Loading database";const e=Date.now();return this.database.connect().then(t=>Fi(this,void 0,void 0,function*(){t?(this.message="Building scene",yield this.database.getScene(),this.message="Building tissue block results",yield this.database.getTissueBlockResults(),this.message="Aggregating results",yield this.database.getAggregateResults(),this.status="Ready",this.message="Database successfully loaded"):(this.status="Error",this.message="Unknown error while loading database")})).catch(t=>{var i;this.status="Error",this.message=null!==(i=null==t?void 0:t.message)&&void 0!==i?i:"Unknown error while loading database"}).finally(()=>{this.loadTime=Date.now()-e})}}const j2e={"@context":{"@base":"http://purl.org/ccf/","@vocab":"http://purl.org/ccf/",ccf:"http://purl.org/ccf/",rdfs:"http://www.w3.org/2000/01/rdf-schema#",dcterms:"http://purl.org/dc/terms/",label:"rdfs:label",description:"rdfs:comment",link:"ccf:url",sex:"ccf:sex",age:"ccf:age",bmi:"ccf:bmi",consortium_name:"ccf:consortium_name",provider_name:"ccf:tissue_provider_name",provider_uuid:"ccf:tissue_provider_uuid",donor:{"@id":"ccf:comes_from","@type":"@id"},samples:{"@reverse":"donor"},sections:{"@id":"ccf:subdivided_into_sections","@type":"@id"},datasets:{"@id":"ccf:generates_dataset","@type":"@id"},sample_type:"ccf:sample_type",section_count:"ccf:section_count",section_size:"ccf:section_size",section_units:"ccf:section_size_unit",section_number:"ccf:section_number",rui_location:{"@id":"ccf:has_registration_location","@type":"@id"},ccf_annotations:{"@id":"ccf:collides_with","@type":"@id","@container":"@set"},representation_of:{"@id":"ccf:representation_of","@type":"@id"},reference_organ:{"@id":"ccf:has_reference_organ","@type":"@id"},extraction_set_for:{"@id":"ccf:extraction_set_for","@type":"@id"},extraction_set:{"@id":"ccf:has_extraction_set","@type":"@id"},organ_owner_sex:"ccf:organ_owner_sex",side:"ccf:organ_side",rui_rank:"ccf:rui_rank",slice_thickness:"ccf:slice_thickness",slice_count:"ccf:slice_count",object:{"@id":"ccf:has_object_reference","@type":"@id"},creation_date:"dcterms:created",updated_date:"ccf:updated_date",creator:"dcterms:creator",creator_first_name:"ccf:creator_first_name",creator_last_name:"ccf:creator_last_name",placement:{"@reverse":"ccf:placement_for"},placement_date:"dcterms:created",rotation_order:"ccf:rotation_order",dimension_units:"ccf:dimension_unit",rotation_units:"ccf:rotation_unit",scaling_units:"ccf:scaling_unit",translation_units:"ccf:translation_unit",source:{"@id":"ccf:placement_for","@type":"@id"},target:{"@id":"ccf:placement_relative_to","@type":"@id"},x_rotation:"ccf:x_rotation",y_rotation:"ccf:y_rotation",z_rotation:"ccf:z_rotation",x_scaling:"ccf:x_scaling",y_scaling:"ccf:y_scaling",z_scaling:"ccf:z_scaling",x_translation:"ccf:x_translation",y_translation:"ccf:y_translation",z_translation:"ccf:z_translation",x_dimension:"ccf:x_dimension",y_dimension:"ccf:y_dimension",z_dimension:"ccf:z_dimension",ontology_terms:{"@id":"ccf:has_ontology_term","@type":"@id"},technology:"ccf:technology",thumbnail:"ccf:thumbnail",file:"ccf:file_url",file_format:"ccf:file_format",file_subpath:"ccf:file_subpath"}};function o2(n){return JSON.parse(n,(e,t)=>"ccf_annotations"===e&&Array.isArray(t)?t.map(i=>(null==i?void 0:i.startsWith("http://purl.obolibrary.org/obo/FMA_"))?i.replace("http://purl.obolibrary.org/obo/FMA_","http://purl.org/sig/ont/fma/fma"):i):"@context"!==e||!t||"https://hubmapconsortium.github.io/hubmap-ontology/ccf-entity-context.jsonld"!==t&&"https://hubmapconsortium.github.io/hubmap-ontology/ccf-context.jsonld"!==t&&"https://hubmapconsortium.github.io/ccf-ontology/ccf-context.jsonld"!==t&&"http://purl.org/ccf/latest/ccf-entity.owl#"!==t["@base"]?t:j2e)}const U2e={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 z2e{constructor(e=U2e){this.options=e,this.store=new xn.Store(void 0,{factory:xn.DataFactory}),this.graph=new xq(this),this.scene=new Cq(this)}connect(e,t=!1){return Fi(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 Fi(this,void 0,void 0,function*(){const e=(new Date).getTime(),t="ccf-database.last_modified",i="ccf-database",r=yield vq(t).catch(()=>{});let s;r&&e-new Date(+r).getTime()>36e5?yield function(n,e=Sc()){return e("readwrite",t=>(n.forEach(i=>t.delete(i)),mu(t.transaction)))}([i,t]).catch(()=>{}):s=yield vq(i).catch(()=>{}),s?yield this.deserialize(s):(yield this.doConnect(),function(n,e=Sc()){return e("readwrite",t=>(n.forEach(i=>t.put(i[1],i[0])),mu(t.transaction)))}([[i,this.serialize()],[t,""+e]]).catch(()=>{}))})}doConnect(){var e,t;return Fi(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.startsWith("{"))this.store=(0,xn.deserializeN3Store)(s,xn.DataFactory);else 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,xn.deserializeN3Store)(o,xn.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(Dq(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 Fi(this,void 0,void 0,function*(){const i=null!=t?t:this.store;return yield Promise.all(e.map(r=>Fi(this,void 0,void 0,function*(){"string"==typeof r?(r.startsWith("http")||r.startsWith("assets/"))&&r.includes("jsonld")?(r=o2(r=yield fetch(r).then(s=>s.text())),yield(0,xn.addJsonLdToStore)(r,i)):r.endsWith("n3")?yield(0,xn.addN3ToStore)(r,i):r.endsWith("rdf")||r.endsWith("owl")||r.endsWith("xml")?yield(0,xn.addRdfXmlToStore)(r,i):(r=o2(r),yield(0,xn.addJsonLdToStore)(r,i)):(r=o2(JSON.stringify(r)),yield(0,xn.addJsonLdToStore)(r,i))}))),this})}synchronize(){return Fi(this,void 0,void 0,function*(){return yield new Promise(e=>{setTimeout(e,500)}),this.graph.createGraph(),function(n){var e,t,i;const r=Pq(n),s=new Map;for(const{subject:o,object:a}of(0,xn.readQuads)(n,null,ki.spatialEntity.representation_of,null,null)){const l=new Set([a.id]);let c=null===(e=r.nodes[a.id])||void 0===e?void 0:e.parent;for(;c&&!l.has(c);)l.add(c),c=null===(t=r.nodes[c])||void 0===t?void 0:t.parent;s.set(o.id,[...l].map(u=>xn.DataFactory.namedNode(u)))}for(const{object:o}of(0,xn.readQuads)(n,null,yi.spatialEntity,null,null))for(const{subject:a}of(0,xn.readQuads)(n,null,ki.spatialPlacement.source,o,null))for(const{object:l}of(0,xn.readQuads)(n,a,ki.spatialPlacement.target,null,null))for(const c of null!==(i=s.get(l.id))&&void 0!==i?i:[])n.addQuad(xn.DataFactory.namedNode(o.id),ki.spatialEntity.ccf_annotations,c)}(this.store),this})}serialize(){return(0,xn.serializeN3Store)(this.store)}deserialize(e){return Fi(this,void 0,void 0,function*(){this.store=(0,xn.deserializeN3Store)(e,xn.DataFactory),this.graph=new xq(this),this.scene=new Cq(this),yield new Promise(t=>{setTimeout(t,10)})})}getIds(e={}){return function(n,e,t){var i,r,s,o,a,l,c;let u=function(n){const e=new Set;return n.forSubjects(t=>e.add(t.id),yi.spatialEntity,null,null),e}(n);if(u.size>0&&(u=function(n,e,t=!0){const i=new Set;if(n.forSubjects(rv(e,i),yi.spatialEntity,null,null),!t){const r=new Set;return e.forEach(s=>i.has(s)?void 0:r.add(s)),r}return i}(n,u)),u.size>0&&("Male"===t.sex||"Female"===t.sex)){const h=t.sex;u=b1(n,u,p=>function(n,e,t){const i=new Set;return n.forSubjects(rv(e,i),yi.sex,yi[t],null),i}(n,p,h))}if(u.size>0&&(null===(i=t.tmc)||void 0===i?void 0:i.length)>0&&(u=b1(n,u,h=>function(n,e,t){const i=new Set;for(const r of t){const s=xn.DataFactory.literal(r);n.forSubjects(rv(e,i),yi.providerName,s,null)}return i}(n,h,t.tmc))),u.size>0&&(null===(r=t.technologies)||void 0===r?void 0:r.length)>0&&(u=function(n,e,t){var i,r;const s=new Map,o=new Set,a=new Set(e);for(const u of e)for(const h of(0,xn.readQuads)(n,u,yi.sections,null,null))a.add(h.object.id);for(const u of a)for(const h of(0,xn.readQuads)(n,u,yi.datasets,null,null))o.add(h.object.id),s.has(h.object.id)?null===(i=s.get(h.object.id))||void 0===i||i.push(u):s.set(h.object.id,[u]);const l=t(o),c=new Set;for(const u of l)for(const h of null!==(r=s.get(u))&&void 0!==r?r:[])c.add(h);return c}(n,u,h=>function(n,e,t){const i=new Set;for(const r of t){const s=xn.DataFactory.literal(r);n.forSubjects(rv(e,i),yi.technology,s,null)}return i}(n,h,t.technologies))),u.size>0&&(null===(s=t.spatialSearches)||void 0===s?void 0:s.length)>0&&(u=s2(n,u,h=>function(n,e,t,i){const r=new Set;for(const s of i)f2e(n,e,t,s).forEach(a=>r.add(a));return r}(n,e,h,t.spatialSearches))),u.size>0&&(null===(o=t.ontologyTerms)||void 0===o?void 0:o.length)>0){const h=t.ontologyTerms;-1===h.indexOf(bd.body.id)&&(u=s2(n,u,p=>Iq(n,p,h)))}if(u.size>0&&(null===(a=t.cellTypeTerms)||void 0===a?void 0:a.length)>0){const h=t.cellTypeTerms;-1===h.indexOf(bd.cell.id)&&(u=s2(n,u,p=>function(n,e,t){const i=new Set;for(const r of t)n.forObjects(s=>{i.add(s.id)},r,ki.asctb.located_in,null),r===bd.cell.id&&i.add(bd.body.id);return Iq(n,e,[...i])}(n,p,h)))}if(u.size>0&&2===(null===(l=t.ageRange)||void 0===l?void 0:l.length)&&(0,fr.isFinite)(t.ageRange[0])&&(0,fr.isFinite)(t.ageRange[1])){const h=Math.max(...t.ageRange),p=Math.min(...t.ageRange);1===p&&110===h||(u=b1(n,u,g=>function(n,e,t,i){const r=new Set;for(const s of e)for(const o of(0,xn.readQuads)(n,s,yi.age,null,null)){const a=(0,Kb.fromRdf)(o.object);a>=t&&a<=i&&r.add(s)}return r}(n,g,p,h)))}if(u.size>0&&2===(null===(c=t.bmiRange)||void 0===c?void 0:c.length)&&(0,fr.isFinite)(t.bmiRange[0])&&(0,fr.isFinite)(t.bmiRange[1])){const h=Math.max(...t.bmiRange),p=Math.min(...t.bmiRange);13===p&&83===h||(u=b1(n,u,g=>function(n,e,t,i){const r=new Set;for(const s of e)for(const o of(0,xn.readQuads)(n,s,yi.bmi,null,null)){const a=(0,Kb.fromRdf)(o.object);a>=t&&a<=i&&r.add(s)}return r}(n,g,p,h)))}return u}(this.store,this.graph,e)}get(e){return this.store.getQuads(xn.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=>function(n,e){const t=n.getObjects(xn.DataFactory.namedNode(e),yi.spatialEntity,null);if(t.length>0)return hp(n,t[0].id)}(this.store,t))}getDatabaseStatus(){return Fi(this,void 0,void 0,function*(){return this.status||(this.status=new B2e(this)),this.status.toJson()})}getDatasetTechnologyNames(){return Fi(this,void 0,void 0,function*(){return function(n){const e=new Set;for(const t of(0,xn.readQuads)(n,null,yi.technology,null,null))e.add(t.object.value);return Array.from(e).sort()}(this.store)})}getProviderNames(){return Fi(this,void 0,void 0,function*(){return function(n){const e=new Set;for(const t of(0,xn.readQuads)(n,null,yi.providerName,null,null))e.add(t.object.value);return Array.from(e).sort()}(this.store)})}getTissueBlockResults(e){return Fi(this,void 0,void 0,function*(){return e=Object.assign(Object.assign({},e),{hasSpatialEntity:!0}),[...this.getIds(e)].map(t=>function(n,e){const t={"@id":e,"@type":"Sample",sections:[],datasets:[]};for(const[i,r]of t2(n,e,P2e))if("sections"===i){const s=k2e(n,r);t[i].push(s)}else if("datasets"===i){const s=Fq(n,r);t[i].push(s)}else t[i]="donor"===i?F2e(n,r):r;return t}(this.store,t))})}getAggregateResults(e){return Fi(this,void 0,void 0,function*(){return function(n,e){const t=iv(e,n,yi.donor.id),i=iv(e,t,yi.providerUUID.id),r=new Set;for(const l of n)for(const c of(0,xn.readQuads)(e,l,yi.spatialEntity,null,null))r.add(c.subject.id);const s=iv(e,r,yi.sections.id),o=new Set([...iv(e,r,yi.datasets.id),...iv(e,s,yi.datasets.id)]);return 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 Fi(this,void 0,void 0,function*(){return function(n,e){const t={};return Oq(n,e).forEach((r,s)=>{t[s]=r.size}),t}(this.getIds(e),this.store)})}getCellTypeTermOccurences(e){return Fi(this,void 0,void 0,function*(){return function(n,e){var t,i;const r=Oq(n,e),s=new Map;for(const a of r.keys()){const l=r.get(a);for(const c of(0,xn.readQuads)(e,null,ki.asctb.located_in,a,null)){const u=c.subject.id;if(s.has(u)){const h=s.get(u);l.forEach(p=>h.add(p))}else s.set(u,new Set(l))}}const o={};return s.forEach((a,l)=>{o[l]=a.size}),o[bd.cell.id]=null!==(i=null===(t=r.get(bd.body.id))||void 0===t?void 0:t.size)&&void 0!==i?i:0,o}(this.getIds(e),this.store)})}getOntologyTreeModel(){return Fi(this,void 0,void 0,function*(){return Pq(this.store)})}getCellTypeTreeModel(){return Fi(this,void 0,void 0,function*(){return function(n){return Rq(n,bd.cell.id,"cell",ki.asctb.ct_is_a.id)}(this.store)})}getReferenceOrgans(){return Fi(this,void 0,void 0,function*(){return this.scene.getReferenceOrgans()})}getScene(e){return Fi(this,void 0,void 0,function*(){return this.graph.createGraph(),this.scene.getScene(e)})}getReferenceOrganScene(e,t){return Fi(this,void 0,void 0,function*(){return this.graph.createGraph(),this.scene.getReferenceOrganScene(e,t)})}getSpatialPlacement(e,t){return Fi(this,void 0,void 0,function*(){return this.graph.getSpatialPlacement(e,t)})}}function W2e(n,e){return n===e}let q2e=(()=>{class n{constructor(t,i){this.locator=t,this.globalConfig=i,this.subscriptions=new x,this.dataSource=i.getOption("data").pipe(me(r=>Object.assign(Object.assign({},bq),{dataSources:r})),Qi(r=>Object.keys(r).length>0),me(r=>r),rd(W2e),Ir(r=>function(n,e){return new I(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?je(r):Yc).subscribe(t);return()=>{o.unsubscribe(),i&&i.unsubscribe()}})}(()=>this.createDataSource(),s=>this.connectDataSource(s.source,r))),$a(1)),this.subscriptions.add(this.dataSource.subscribe())}ngOnDestroy(){this.subscriptions.unsubscribe()}getTissueBlockResults(t){return this.dataSource.pipe(Ir(i=>i.getTissueBlockResults(t)),Wi(1))}getAggregateResults(t){return this.dataSource.pipe(Ir(i=>i.getAggregateResults(t)),Wi(1))}getOntologyTermOccurences(t){return this.dataSource.pipe(Ir(i=>i.getOntologyTermOccurences(t)),Wi(1))}getCellTypeTermOccurences(t){return this.dataSource.pipe(Ir(i=>i.getCellTypeTermOccurences(t)),Wi(1))}getOntologyTreeModel(){return this.dataSource.pipe(Ir(t=>t.getOntologyTreeModel()),Wi(1))}getCellTypeTreeModel(){return this.dataSource.pipe(Ir(t=>t.getCellTypeTreeModel()),Wi(1))}getReferenceOrgans(){return this.dataSource.pipe(Ir(t=>t.getReferenceOrgans()),Wi(1))}getScene(t){return this.dataSource.pipe(Ir(i=>i.getScene(t)),Wi(1))}getOrganScene(t,i){return this.dataSource.pipe(Ir(r=>r.getReferenceOrganScene(t,i)),Wi(1))}createDataSource(){return{source:new z2e,unsubscribe:()=>{}}}connectDataSource(t,i){return Fi(this,void 0,void 0,function*(){const r=(new Date).getTime();return yield t.connect(i,!1),m0.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)(Oe(Cf),Oe(Yb))},n.\u0275prov=We({token:n,factory:n.\u0275fac,providedIn:"root"}),n})(),Y2e=(()=>{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$=Yo([this.data$,this.referenceOrgans$,this.source.dataSource]).pipe(Ir(([r,s,o])=>this.chooseScene(r,s))),this.organs$=this.configState.getOption("data").pipe(me(r=>this.selectOrgans(r)),$a(1)),this.filteredOrgans$=Yo([this.organs$,this.referenceOrgans$]).pipe(me(([r,s])=>this.getNeededReferenceOrgans(s,r)),$a(1)),this.filteredScene$=Yo([this.scene$,this.organs$,this.referenceOrgans$]).pipe(me(([r,s,o])=>this.filterSceneNodes(r,s,o)),function(n,e){const t=n.pipe(ao(""));return i=>Yo([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$,BNe),function(n){const e=n.pipe(ao(""));return t=>Yo([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$),$a(1))}chooseScene(t,i){var r;const s=null!==(r=null==t?void 0:t.map(a=>{const l=a[K9];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 fn([])}selectOrgans(t){const r=(null!=t?t:[]).map(s=>s[K9].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)(Oe(Yb),Oe(q2e))},n.\u0275prov=We({token:n,factory:n.\u0275fac,providedIn:"root"}),n})();const K2e=["bodyUI"];let X2e=(()=>{class n{constructor(t,i,r){this.configState=t,this.sceneSource=i,this.cdr=r,this.onMouseEnter=new sn,this.onMouseLeave=new sn,this.onClick=new sn,this.data$=this.configState.getOption("data"),this.organs$=this.sceneSource.filteredOrgans$,this.scene$=this.sceneSource.filteredScene$.pipe(Yr(s=>this.reset()))}reset(){var t,i;return Fi(this,void 0,void 0,function*(){const{bodyUI:r}=this;yield new Promise(a=>setTimeout(a,200));const s=yield this.organs$.pipe(Wi(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)(xe(Yb),xe(Y2e),xe(Dr))},n.\u0275cmp=ln({type:n,selectors:[["ccf-root"]],viewQuery:function(t,i){if(1&t&&ss(K2e,7),2&t){let r;ii(r=ri())&&(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&&(Pt(0,"ccf-body-ui",0,1),Un("nodeClick",function(s){return i.onClick.emit(s)})("nodeHoverStart",function(s){return i.onMouseEnter.emit(s)})("nodeHoverStop",function(s){return i.onMouseLeave.emit(s)}),xl(2,"async"),Ft()),2&t&&rn("scene",Vu(2,2,i.scene$))("interactive",!0)},directives:[nNe],pipes:[h0],styles:[".body-ui[_ngcontent-%COMP%]{height:100%;width:100%}"],changeDetection:0}),n})();function Q2e(n,e){if(1&n){const t=jt();Pt(0,"ccf-root",1),Un("onMouseEnter",function(r){return Cr(t),ci().onMouseEnter.emit(r)})("onMouseLeave",function(r){return Cr(t),ci().onMouseLeave.emit(r)})("onClick",function(r){return Cr(t),ci().onClick.emit(r)}),Ft()}}function Z2e(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 J2e=(()=>{class n extends Eie{constructor(t,i){super(t,i,{initialDelay:10,initialConfig:Object.assign(Object.assign({},m0.dbOptions),globalThis.dbOptions),parse:{data:Z2e}}),this.onMouseEnter=new sn,this.onMouseLeave=new sn,this.onClick=new sn}}return n.\u0275fac=function(t){return new(t||n)(xe(Yb),xe(Dr))},n.\u0275cmp=ln({type:n,selectors:[["ccf-root-wc"]],inputs:{data:"data",highlightID:"highlightID",zoomToID:"zoomToID"},outputs:{onMouseEnter:"onMouseEnter",onMouseLeave:"onMouseLeave",onClick:"onClick"},features:[An],decls:1,vars:1,consts:[[3,"onMouseEnter","onMouseLeave","onClick",4,"ngIf"],[3,"onMouseEnter","onMouseLeave","onClick"]],template:function(t,i){1&t&&Di(0,Q2e,1,0,"ccf-root",0),2&t&&rn("ngIf",i.initialized)},directives:[lc,X2e],encapsulation:2,changeDetection:0}),n})(),eke=(()=>{class n{constructor(t,i){this.accessor=t,this.injector=i}static forRoot(t=[]){return{ngModule:n,providers:[ps,Za,hW,...t]}}}return n.\u0275fac=function(t){return new(t||n)(Oe(ps,2),Oe(Za,2))},n.\u0275mod=on({type:n}),n.\u0275inj=xt({}),n})();const x1=(n,e)=>((n,e)=>new Array(e+1).join("0"))(0,e-n.toString().length)+n;class ike{constructor(e,t,i){this.action=e,this.store=t,this.logWriter=i}dispatched(e){const t=$f(this.action),i=function(n){return x1(n.getHours(),2)+":"+x1(n.getMinutes(),2)+":"+x1(n.getSeconds(),2)+"."+x1(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 rke{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 kq=new Ht("NGXS_LOGGER_PLUGIN_OPTIONS");let ske=(()=>{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 rke(this._options),this._store=this._store||this._injector.get(cu);const s=new ike(i,this._store,this._logWriter);return s.dispatched(t),r(t,i).pipe(Yr(o=>{s.completed(o)}),bc(o=>{throw s.errored(o),o}))}}return n.\u0275fac=function(t){return new(t||n)(Oe(kq),Oe(Wn))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const Lq=new Ht("LOGGER_USER_OPTIONS");function oke(n){return Object.assign({},{logger:console,collapsed:!1,disabled:!1,filter:()=>!0},n)}let ake=(()=>{class n{static forRoot(t){return{ngModule:n,providers:[{provide:f6,useClass:ske,multi:!0},{provide:Lq,useValue:t},{provide:kq,useFactory:oke,deps:[Lq]}]}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=on({type:n}),n.\u0275inj=xt({}),n})();const lke=[Yb];let cke=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=on({type:n}),n.\u0275inj=xt({imports:[[eke.forRoot(),Wo.forRoot(lke,{developmentMode:!m0.production}),ake.forRoot({disabled:m0.production})]]}),n})(),uke=(()=>{class n{constructor(t){this.injector=t}ngDoBootstrap(){const t=function(n,e){const t=function(n,e){return e.get(wl).resolveComponentFactory(n).inputs}(n,e.injector),i=e.strategyFactory||new mie(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 yie{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,u){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}(J2e,{injector:this.injector});customElements.define("ccf-body-ui-wc",t)}}return n.\u0275fac=function(t){return new(t||n)(Oe(Wn))},n.\u0275mod=on({type:n}),n.\u0275inj=xt({providers:[],imports:[[WD,cke,iNe]]}),n})();m0.production&&function(){if(lB)throw new Error("Cannot enable prod mode after platform setup.");aB=!1}(),jne().bootstrapModule(uke).catch(n=>console.error(n))},52:Ut=>{function it(yt,ee,Tt,dt,Y,Se,he){try{var W=yt[Se](he),j=W.value}catch(P){return void Tt(P)}W.done?ee(j):Promise.resolve(j).then(dt,Y)}Ut.exports=function(yt){return function(){var ee=this,Tt=arguments;return new Promise(function(dt,Y){var Se=yt.apply(ee,Tt);function he(j){it(Se,dt,Y,he,W,"next",j)}function W(j){it(Se,dt,Y,he,W,"throw",j)}he(void 0)})}},Ut.exports.default=Ut.exports,Ut.exports.__esModule=!0},948:Ut=>{Ut.exports=function(Je){return Je&&Je.__esModule?Je:{default:Je}},Ut.exports.default=Ut.exports,Ut.exports.__esModule=!0},321:Ut=>{function it(Je){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(Ut.exports=it=function(ee){return typeof ee},Ut.exports.default=Ut.exports,Ut.exports.__esModule=!0):(Ut.exports=it=function(ee){return ee&&"function"==typeof Symbol&&ee.constructor===Symbol&&ee!==Symbol.prototype?"symbol":typeof ee},Ut.exports.default=Ut.exports,Ut.exports.__esModule=!0),it(Je)}Ut.exports=it,Ut.exports.default=Ut.exports,Ut.exports.__esModule=!0},380:Ut=>{function it(Je){return Promise.resolve().then(()=>{var yt=new Error("Cannot find module '"+Je+"'");throw yt.code="MODULE_NOT_FOUND",yt})}it.keys=()=>[],it.resolve=it,it.id=380,Ut.exports=it},521:()=>{},125:()=>{},307:()=>{}},Ut=>{Ut(Ut.s=303)}]); \ No newline at end of file +var dke=Object.defineProperty,hke=Object.defineProperties,fke=Object.getOwnPropertyDescriptors,C1=Object.getOwnPropertySymbols,jq=Object.prototype.hasOwnProperty,Vq=Object.prototype.propertyIsEnumerable,Er=Math.pow,Uq=(Ut,it,Je)=>it in Ut?dke(Ut,it,{enumerable:!0,configurable:!0,writable:!0,value:Je}):Ut[it]=Je,ot=(Ut,it)=>{for(var Je in it||(it={}))jq.call(it,Je)&&Uq(Ut,Je,it[Je]);if(C1)for(var Je of C1(it))Vq.call(it,Je)&&Uq(Ut,Je,it[Je]);return Ut},Cn=(Ut,it)=>hke(Ut,fke(it)),zq=(Ut,it)=>{var Je={};for(var yt in Ut)jq.call(Ut,yt)&&it.indexOf(yt)<0&&(Je[yt]=Ut[yt]);if(null!=Ut&&C1)for(var yt of C1(Ut))it.indexOf(yt)<0&&Vq.call(Ut,yt)&&(Je[yt]=Ut[yt]);return Je};(self.webpackChunkccf_ui=self.webpackChunkccf_ui||[]).push([[179],{440:(Ut,it,Je)=>{var yt=Je(52).default;Ut.exports=function Y(Se,he,W){function j(z,v){if(!he[z]){if(!Se[z]){if(P)return P(z,!0);var O=new Error("Cannot find module '"+z+"'");throw O.code="MODULE_NOT_FOUND",O}var A=he[z]={exports:{}};Se[z][0].call(A.exports,function(b){return j(Se[z][1][b]||b)},A,A.exports,Y,Se,he,W)}return he[z].exports}for(var P=void 0,Q=0;Q0&&G[G.length-1])&&(6===_t[0]||2===_t[0])){$e=0;continue}if(3===_t[0]&&(!G||_t[1]>G[0]&&_t[1]0?ce-4:ce;for($=0;$>16&255,I[X++]=R>>8&255,I[X++]=255&R;return 2===D&&(R=j[V.charCodeAt($)]<<2|j[V.charCodeAt($+1)]>>4,I[X++]=255&R),1===D&&(R=j[V.charCodeAt($)]<<10|j[V.charCodeAt($+1)]<<4|j[V.charCodeAt($+2)]>>2,I[X++]=R>>8&255,I[X++]=255&R),I},he.fromByteArray=function(V){for(var R,K=V.length,ce=K%3,D=[],I=16383,X=0,E=K-ce;XE?E:X+I));return 1===ce?D.push(W[(R=V[K-1])>>2]+W[R<<4&63]+"=="):2===ce&&D.push(W[(R=(V[K-2]<<8)+V[K-1])>>10]+W[R>>4&63]+W[R<<2&63]+"="),D.join("")};for(var W=[],j=[],P="undefined"!=typeof Uint8Array?Uint8Array:Array,Q="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",z=0,v=Q.length;z0)throw new Error("Invalid string. Length must be a multiple of 4");var K=V.indexOf("=");return-1===K&&(K=R),[K,K===R?0:4-K%4]}function y(V){return W[V>>18&63]+W[V>>12&63]+W[V>>6&63]+W[63&V]}function S(V,R,K){for(var D=[],I=R;I>5==6?2:D>>4==14?3:D>>3==30?4:D>>6==2?-1:-2}function A(D){var I=this.lastTotal-this.lastNeed,X=function(D,I,X){if(128!=(192&I[0]))return D.lastNeed=0,"\ufffd";if(D.lastNeed>1&&I.length>1){if(128!=(192&I[1]))return D.lastNeed=1,"\ufffd";if(D.lastNeed>2&&I.length>2&&128!=(192&I[2]))return D.lastNeed=2,"\ufffd"}}(this,D);return void 0!==X?X:this.lastNeed<=D.length?(D.copy(this.lastChar,I,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(D.copy(this.lastChar,I,0,D.length),void(this.lastNeed-=D.length))}function S(D,I){if((D.length-I)%2==0){var X=D.toString("utf16le",I);if(X){var E=X.charCodeAt(X.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],X.slice(0,-1)}return X}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=D[D.length-1],D.toString("utf16le",I,D.length-1)}function T(D){var I=D&&D.length?this.write(D):"";return this.lastNeed?I+this.lastChar.toString("utf16le",0,this.lastTotal-this.lastNeed):I}function V(D,I){var X=(D.length-I)%3;return 0===X?D.toString("base64",I):(this.lastNeed=3-X,this.lastTotal=3,1===X?this.lastChar[0]=D[D.length-1]:(this.lastChar[0]=D[D.length-2],this.lastChar[1]=D[D.length-1]),D.toString("base64",I,D.length-X))}function R(D){var I=D&&D.length?this.write(D):"";return this.lastNeed?I+this.lastChar.toString("base64",0,3-this.lastNeed):I}function K(D){return D.toString(this.encoding)}function ce(D){return D&&D.length?this.write(D):""}he.StringDecoder=z,z.prototype.write=function(D){if(0===D.length)return"";var I,X;if(this.lastNeed){if(void 0===(I=this.fillLast(D)))return"";X=this.lastNeed,this.lastNeed=0}else X=0;return X=0?($>0&&(D.lastNeed=$-1),$):--E=0?($>0&&(D.lastNeed=$-2),$):--E=0?($>0&&(2===$?$=0:D.lastNeed=$-3),$):0}(this,D,I);if(!this.lastNeed)return D.toString("utf8",I);this.lastTotal=X;var E=D.length-(X-this.lastNeed);return D.copy(this.lastChar,0,E),D.toString("utf8",I,E)},z.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(Y,Se,he){(function(W){(function(){"use strict";var j=Y("base64-js"),P=Y("ieee754");he.Buffer=x,he.SlowBuffer=function(L){return+L!=L&&(L=0),x.alloc(+L)},he.INSPECT_MAX_BYTES=50;var Q=2147483647;function v(L){if(L>Q)throw new RangeError('The value "'+L+'" is invalid for option "size"');var N=new Uint8Array(L);return N.__proto__=x.prototype,N}function x(L,N,B){if("number"==typeof L){if("string"==typeof N)throw new TypeError('The "string" argument must be of type string. Received type number');return y(L)}return O(L,N,B)}function O(L,N,B){if("string"==typeof L)return function(L,N){if(("string"!=typeof N||""===N)&&(N="utf8"),!x.isEncoding(N))throw new TypeError("Unknown encoding: "+N);var B=0|D(L,N),Re=v(B),Qe=Re.write(L,N);return Qe!==B&&(Re=Re.slice(0,Qe)),Re}(L,N);if(ArrayBuffer.isView(L))return T(L);if(null==L)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof L);if(pt(L,ArrayBuffer)||L&&pt(L.buffer,ArrayBuffer))return function(L,N,B){if(N<0||L.byteLength=Q)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Q.toString(16)+" bytes");return 0|L}function D(L,N){if(x.isBuffer(L))return L.length;if(ArrayBuffer.isView(L)||pt(L,ArrayBuffer))return L.byteLength;if("string"!=typeof L)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof L);var B=L.length,Re=arguments.length>2&&!0===arguments[2];if(!Re&&0===B)return 0;for(var Qe=!1;;)switch(N){case"ascii":case"latin1":case"binary":return B;case"utf8":case"utf-8":return G(L).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*B;case"hex":return B>>>1;case"base64":return je(L).length;default:if(Qe)return Re?-1:G(L).length;N=(""+N).toLowerCase(),Qe=!0}}function I(L,N,B){var Re=!1;if((void 0===N||N<0)&&(N=0),N>this.length||((void 0===B||B>this.length)&&(B=this.length),B<=0)||(B>>>=0)<=(N>>>=0))return"";for(L||(L="utf8");;)switch(L){case"hex":return tt(this,N,B);case"utf8":case"utf-8":return _e(this,N,B);case"ascii":return st(this,N,B);case"latin1":case"binary":return Xe(this,N,B);case"base64":return ne(this,N,B);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ye(this,N,B);default:if(Re)throw new TypeError("Unknown encoding: "+L);L=(L+"").toLowerCase(),Re=!0}}function X(L,N,B){var Re=L[N];L[N]=L[B],L[B]=Re}function E(L,N,B,Re,Qe){if(0===L.length)return-1;if("string"==typeof B?(Re=B,B=0):B>2147483647?B=2147483647:B<-2147483648&&(B=-2147483648),ve(B=+B)&&(B=Qe?0:L.length-1),B<0&&(B=L.length+B),B>=L.length){if(Qe)return-1;B=L.length-1}else if(B<0){if(!Qe)return-1;B=0}if("string"==typeof N&&(N=x.from(N,Re)),x.isBuffer(N))return 0===N.length?-1:$(L,N,B,Re,Qe);if("number"==typeof N)return N&=255,"function"==typeof Uint8Array.prototype.indexOf?Qe?Uint8Array.prototype.indexOf.call(L,N,B):Uint8Array.prototype.lastIndexOf.call(L,N,B):$(L,[N],B,Re,Qe);throw new TypeError("val must be string, number or Buffer")}function $(L,N,B,Re,Qe){var Yn,St=1,Nt=L.length,On=N.length;if(void 0!==Re&&("ucs2"===(Re=String(Re).toLowerCase())||"ucs-2"===Re||"utf16le"===Re||"utf-16le"===Re)){if(L.length<2||N.length<2)return-1;St=2,Nt/=2,On/=2,B/=2}function kn(Ls,gs){return 1===St?Ls[gs]:Ls.readUInt16BE(gs*St)}if(Qe){var Ti=-1;for(Yn=B;YnNt&&(B=Nt-On),Yn=B;Yn>=0;Yn--){for(var wi=!0,Xr=0;XrQe&&(Re=Qe):Re=Qe;var St=N.length;Re>St/2&&(Re=St/2);for(var Nt=0;Nt>8,St.push(B%256),St.push(Re);return St}(N,L.length-B),L,B,Re)}function ne(L,N,B){return j.fromByteArray(0===N&&B===L.length?L:L.slice(N,B))}function _e(L,N,B){B=Math.min(L.length,B);for(var Re=[],Qe=N;Qe239?4:St>223?3:St>191?2:1;if(Qe+On<=B)switch(On){case 1:St<128&&(Nt=St);break;case 2:128==(192&(kn=L[Qe+1]))&&(wi=(31&St)<<6|63&kn)>127&&(Nt=wi);break;case 3:Yn=L[Qe+2],128==(192&(kn=L[Qe+1]))&&128==(192&Yn)&&(wi=(15&St)<<12|(63&kn)<<6|63&Yn)>2047&&(wi<55296||wi>57343)&&(Nt=wi);break;case 4:Yn=L[Qe+2],Ti=L[Qe+3],128==(192&(kn=L[Qe+1]))&&128==(192&Yn)&&128==(192&Ti)&&(wi=(15&St)<<18|(63&kn)<<12|(63&Yn)<<6|63&Ti)>65535&&wi<1114112&&(Nt=wi)}null===Nt?(Nt=65533,On=1):Nt>65535&&(Re.push((Nt-=65536)>>>10&1023|55296),Nt=56320|1023&Nt),Re.push(Nt),Qe+=On}return function(L){var N=L.length;if(N<=4096)return String.fromCharCode.apply(String,L);for(var B="",Re=0;ReB&&(N+=" ... "),""},x.prototype.compare=function(N,B,Re,Qe,St){if(pt(N,Uint8Array)&&(N=x.from(N,N.offset,N.byteLength)),!x.isBuffer(N))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof N);if(void 0===B&&(B=0),void 0===Re&&(Re=N?N.length:0),void 0===Qe&&(Qe=0),void 0===St&&(St=this.length),B<0||Re>N.length||Qe<0||St>this.length)throw new RangeError("out of range index");if(Qe>=St&&B>=Re)return 0;if(Qe>=St)return-1;if(B>=Re)return 1;if(this===N)return 0;for(var Nt=(St>>>=0)-(Qe>>>=0),On=(Re>>>=0)-(B>>>=0),kn=Math.min(Nt,On),Yn=this.slice(Qe,St),Ti=N.slice(B,Re),wi=0;wi>>=0,isFinite(Re)?(Re>>>=0,void 0===Qe&&(Qe="utf8")):(Qe=Re,Re=void 0)}var St=this.length-B;if((void 0===Re||Re>St)&&(Re=St),N.length>0&&(Re<0||B<0)||B>this.length)throw new RangeError("Attempt to write outside buffer bounds");Qe||(Qe="utf8");for(var Nt=!1;;)switch(Qe){case"hex":return Z(this,N,B,Re);case"utf8":case"utf-8":return oe(this,N,B,Re);case"ascii":return se(this,N,B,Re);case"latin1":case"binary":return te(this,N,B,Re);case"base64":return Ce(this,N,B,Re);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return me(this,N,B,Re);default:if(Nt)throw new TypeError("Unknown encoding: "+Qe);Qe=(""+Qe).toLowerCase(),Nt=!0}},x.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function st(L,N,B){var Re="";B=Math.min(L.length,B);for(var Qe=N;QeRe)&&(B=Re);for(var Qe="",St=N;StB)throw new RangeError("Trying to access beyond buffer length")}function ke(L,N,B,Re,Qe,St){if(!x.isBuffer(L))throw new TypeError('"buffer" argument must be a Buffer instance');if(N>Qe||NL.length)throw new RangeError("Index out of range")}function Ke(L,N,B,Re,Qe,St){if(B+Re>L.length)throw new RangeError("Index out of range");if(B<0)throw new RangeError("Index out of range")}function Me(L,N,B,Re,Qe){return N=+N,B>>>=0,Qe||Ke(L,0,B,4),P.write(L,N,B,Re,23,4),B+4}function Ve(L,N,B,Re,Qe){return N=+N,B>>>=0,Qe||Ke(L,0,B,8),P.write(L,N,B,Re,52,8),B+8}x.prototype.slice=function(N,B){var Re=this.length;(N=~~N)<0?(N+=Re)<0&&(N=0):N>Re&&(N=Re),(B=void 0===B?Re:~~B)<0?(B+=Re)<0&&(B=0):B>Re&&(B=Re),B>>=0,B>>>=0,Re||Ue(N,B,this.length);for(var Qe=this[N],St=1,Nt=0;++Nt>>=0,B>>>=0,Re||Ue(N,B,this.length);for(var Qe=this[N+--B],St=1;B>0&&(St*=256);)Qe+=this[N+--B]*St;return Qe},x.prototype.readUInt8=function(N,B){return N>>>=0,B||Ue(N,1,this.length),this[N]},x.prototype.readUInt16LE=function(N,B){return N>>>=0,B||Ue(N,2,this.length),this[N]|this[N+1]<<8},x.prototype.readUInt16BE=function(N,B){return N>>>=0,B||Ue(N,2,this.length),this[N]<<8|this[N+1]},x.prototype.readUInt32LE=function(N,B){return N>>>=0,B||Ue(N,4,this.length),(this[N]|this[N+1]<<8|this[N+2]<<16)+16777216*this[N+3]},x.prototype.readUInt32BE=function(N,B){return N>>>=0,B||Ue(N,4,this.length),16777216*this[N]+(this[N+1]<<16|this[N+2]<<8|this[N+3])},x.prototype.readIntLE=function(N,B,Re){N>>>=0,B>>>=0,Re||Ue(N,B,this.length);for(var Qe=this[N],St=1,Nt=0;++Nt=(St*=128)&&(Qe-=Math.pow(2,8*B)),Qe},x.prototype.readIntBE=function(N,B,Re){N>>>=0,B>>>=0,Re||Ue(N,B,this.length);for(var Qe=B,St=1,Nt=this[N+--Qe];Qe>0&&(St*=256);)Nt+=this[N+--Qe]*St;return Nt>=(St*=128)&&(Nt-=Math.pow(2,8*B)),Nt},x.prototype.readInt8=function(N,B){return N>>>=0,B||Ue(N,1,this.length),128&this[N]?-1*(255-this[N]+1):this[N]},x.prototype.readInt16LE=function(N,B){N>>>=0,B||Ue(N,2,this.length);var Re=this[N]|this[N+1]<<8;return 32768&Re?4294901760|Re:Re},x.prototype.readInt16BE=function(N,B){N>>>=0,B||Ue(N,2,this.length);var Re=this[N+1]|this[N]<<8;return 32768&Re?4294901760|Re:Re},x.prototype.readInt32LE=function(N,B){return N>>>=0,B||Ue(N,4,this.length),this[N]|this[N+1]<<8|this[N+2]<<16|this[N+3]<<24},x.prototype.readInt32BE=function(N,B){return N>>>=0,B||Ue(N,4,this.length),this[N]<<24|this[N+1]<<16|this[N+2]<<8|this[N+3]},x.prototype.readFloatLE=function(N,B){return N>>>=0,B||Ue(N,4,this.length),P.read(this,N,!0,23,4)},x.prototype.readFloatBE=function(N,B){return N>>>=0,B||Ue(N,4,this.length),P.read(this,N,!1,23,4)},x.prototype.readDoubleLE=function(N,B){return N>>>=0,B||Ue(N,8,this.length),P.read(this,N,!0,52,8)},x.prototype.readDoubleBE=function(N,B){return N>>>=0,B||Ue(N,8,this.length),P.read(this,N,!1,52,8)},x.prototype.writeUIntLE=function(N,B,Re,Qe){N=+N,B>>>=0,Re>>>=0,Qe||ke(this,N,B,Re,Math.pow(2,8*Re)-1,0);var Nt=1,On=0;for(this[B]=255&N;++On>>=0,Re>>>=0,Qe||ke(this,N,B,Re,Math.pow(2,8*Re)-1,0);var Nt=Re-1,On=1;for(this[B+Nt]=255&N;--Nt>=0&&(On*=256);)this[B+Nt]=N/On&255;return B+Re},x.prototype.writeUInt8=function(N,B,Re){return N=+N,B>>>=0,Re||ke(this,N,B,1,255,0),this[B]=255&N,B+1},x.prototype.writeUInt16LE=function(N,B,Re){return N=+N,B>>>=0,Re||ke(this,N,B,2,65535,0),this[B]=255&N,this[B+1]=N>>>8,B+2},x.prototype.writeUInt16BE=function(N,B,Re){return N=+N,B>>>=0,Re||ke(this,N,B,2,65535,0),this[B]=N>>>8,this[B+1]=255&N,B+2},x.prototype.writeUInt32LE=function(N,B,Re){return N=+N,B>>>=0,Re||ke(this,N,B,4,4294967295,0),this[B+3]=N>>>24,this[B+2]=N>>>16,this[B+1]=N>>>8,this[B]=255&N,B+4},x.prototype.writeUInt32BE=function(N,B,Re){return N=+N,B>>>=0,Re||ke(this,N,B,4,4294967295,0),this[B]=N>>>24,this[B+1]=N>>>16,this[B+2]=N>>>8,this[B+3]=255&N,B+4},x.prototype.writeIntLE=function(N,B,Re,Qe){if(N=+N,B>>>=0,!Qe){var St=Math.pow(2,8*Re-1);ke(this,N,B,Re,St-1,-St)}var Nt=0,On=1,kn=0;for(this[B]=255&N;++Nt>0)-kn&255;return B+Re},x.prototype.writeIntBE=function(N,B,Re,Qe){if(N=+N,B>>>=0,!Qe){var St=Math.pow(2,8*Re-1);ke(this,N,B,Re,St-1,-St)}var Nt=Re-1,On=1,kn=0;for(this[B+Nt]=255&N;--Nt>=0&&(On*=256);)N<0&&0===kn&&0!==this[B+Nt+1]&&(kn=1),this[B+Nt]=(N/On>>0)-kn&255;return B+Re},x.prototype.writeInt8=function(N,B,Re){return N=+N,B>>>=0,Re||ke(this,N,B,1,127,-128),N<0&&(N=255+N+1),this[B]=255&N,B+1},x.prototype.writeInt16LE=function(N,B,Re){return N=+N,B>>>=0,Re||ke(this,N,B,2,32767,-32768),this[B]=255&N,this[B+1]=N>>>8,B+2},x.prototype.writeInt16BE=function(N,B,Re){return N=+N,B>>>=0,Re||ke(this,N,B,2,32767,-32768),this[B]=N>>>8,this[B+1]=255&N,B+2},x.prototype.writeInt32LE=function(N,B,Re){return N=+N,B>>>=0,Re||ke(this,N,B,4,2147483647,-2147483648),this[B]=255&N,this[B+1]=N>>>8,this[B+2]=N>>>16,this[B+3]=N>>>24,B+4},x.prototype.writeInt32BE=function(N,B,Re){return N=+N,B>>>=0,Re||ke(this,N,B,4,2147483647,-2147483648),N<0&&(N=4294967295+N+1),this[B]=N>>>24,this[B+1]=N>>>16,this[B+2]=N>>>8,this[B+3]=255&N,B+4},x.prototype.writeFloatLE=function(N,B,Re){return Me(this,N,B,!0,Re)},x.prototype.writeFloatBE=function(N,B,Re){return Me(this,N,B,!1,Re)},x.prototype.writeDoubleLE=function(N,B,Re){return Ve(this,N,B,!0,Re)},x.prototype.writeDoubleBE=function(N,B,Re){return Ve(this,N,B,!1,Re)},x.prototype.copy=function(N,B,Re,Qe){if(!x.isBuffer(N))throw new TypeError("argument should be a Buffer");if(Re||(Re=0),!Qe&&0!==Qe&&(Qe=this.length),B>=N.length&&(B=N.length),B||(B=0),Qe>0&&Qe=this.length)throw new RangeError("Index out of range");if(Qe<0)throw new RangeError("sourceEnd out of bounds");Qe>this.length&&(Qe=this.length),N.length-B=0;--Nt)N[Nt+B]=this[Nt+Re];else Uint8Array.prototype.set.call(N,this.subarray(Re,Qe),B);return St},x.prototype.fill=function(N,B,Re,Qe){if("string"==typeof N){if("string"==typeof B?(Qe=B,B=0,Re=this.length):"string"==typeof Re&&(Qe=Re,Re=this.length),void 0!==Qe&&"string"!=typeof Qe)throw new TypeError("encoding must be a string");if("string"==typeof Qe&&!x.isEncoding(Qe))throw new TypeError("Unknown encoding: "+Qe);if(1===N.length){var St=N.charCodeAt(0);("utf8"===Qe&&St<128||"latin1"===Qe)&&(N=St)}}else"number"==typeof N&&(N&=255);if(B<0||this.length>>=0,Re=void 0===Re?this.length:Re>>>0,N||(N=0),"number"==typeof N)for(Nt=B;Nt55295&&B<57344){if(!Qe){if(B>56319){(N-=3)>-1&&St.push(239,191,189);continue}if(Nt+1===Re){(N-=3)>-1&&St.push(239,191,189);continue}Qe=B;continue}if(B<56320){(N-=3)>-1&&St.push(239,191,189),Qe=B;continue}B=65536+(Qe-55296<<10|B-56320)}else Qe&&(N-=3)>-1&&St.push(239,191,189);if(Qe=null,B<128){if((N-=1)<0)break;St.push(B)}else if(B<2048){if((N-=2)<0)break;St.push(B>>6|192,63&B|128)}else if(B<65536){if((N-=3)<0)break;St.push(B>>12|224,B>>6&63|128,63&B|128)}else{if(!(B<1114112))throw new Error("Invalid code point");if((N-=4)<0)break;St.push(B>>18|240,B>>12&63|128,B>>6&63|128,63&B|128)}}return St}function je(L){return j.toByteArray(function(L){if((L=(L=L.split("=")[0]).trim().replace($e,"")).length<2)return"";for(;L.length%4!=0;)L+="=";return L}(L))}function _t(L,N,B,Re){for(var Qe=0;Qe=N.length||Qe>=L.length);++Qe)N[Qe+B]=L[Qe];return Qe}function pt(L,N){return L instanceof N||null!=L&&null!=L.constructor&&null!=L.constructor.name&&L.constructor.name===N.name}function ve(L){return L!=L}}).call(this)}).call(this,Y("buffer").Buffer)},{"base64-js":2,buffer:6,ieee754:9}],7:[function(Y,Se,he){"use strict";Se.exports=function W(j){return null===j||"object"!=typeof j||null!=j.toJSON?JSON.stringify(j):Array.isArray(j)?"["+j.reduce((P,Q,z)=>P+(0===z?"":",")+W(void 0===Q||"symbol"==typeof Q?null:Q),"")+"]":"{"+Object.keys(j).sort().reduce((P,Q,z)=>void 0===j[Q]||"symbol"==typeof j[Q]?P:P+(0===P.length?"":",")+W(Q)+":"+W(j[Q]),"")+"}"}},{}],8:[function(Y,Se,he){"use strict";var P,W="object"==typeof Reflect?Reflect:null,j=W&&"function"==typeof W.apply?W.apply:function($,Z,oe){return Function.prototype.apply.call($,Z,oe)};P=W&&"function"==typeof W.ownKeys?W.ownKeys:Object.getOwnPropertySymbols?function($){return Object.getOwnPropertyNames($).concat(Object.getOwnPropertySymbols($))}:function($){return Object.getOwnPropertyNames($)};var z=Number.isNaN||function($){return $!=$};function v(){v.init.call(this)}Se.exports=v,Se.exports.once=function(E,$){return new Promise(function(Z,oe){function se(Ce){E.removeListener($,te),oe(Ce)}function te(){"function"==typeof E.removeListener&&E.removeListener("error",se),Z([].slice.call(arguments))}X(E,$,te,{once:!0}),"error"!==$&&function(E,$,Z){"function"==typeof E.on&&X(E,"error",$,Z)}(E,se,{once:!0})})},v.EventEmitter=v,v.prototype._events=void 0,v.prototype._eventsCount=0,v.prototype._maxListeners=void 0;var x=10;function O(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?v.defaultMaxListeners:E._maxListeners}function b(E,$,Z,oe){var se,te,Ce;if(O(Z),void 0===(te=E._events)?(te=E._events=Object.create(null),E._eventsCount=0):(void 0!==te.newListener&&(E.emit("newListener",$,Z.listener?Z.listener:Z),te=E._events),Ce=te[$]),void 0===Ce)Ce=te[$]=Z,++E._eventsCount;else if("function"==typeof Ce?Ce=te[$]=oe?[Z,Ce]:[Ce,Z]:oe?Ce.unshift(Z):Ce.push(Z),(se=A(E))>0&&Ce.length>se&&!Ce.warned){Ce.warned=!0;var me=new Error("Possible EventEmitter memory leak detected. "+Ce.length+" "+String($)+" listeners added. Use emitter.setMaxListeners() to increase limit");me.name="MaxListenersExceededWarning",me.emitter=E,me.type=$,me.count=Ce.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 S(E,$,Z){var oe={fired:!1,wrapFn:void 0,target:E,type:$,listener:Z},se=y.bind(oe);return se.listener=Z,oe.wrapFn=se,se}function T(E,$,Z){var oe=E._events;if(void 0===oe)return[];var se=oe[$];return void 0===se?[]:"function"==typeof se?Z?[se.listener||se]:[se]:Z?function(E){for(var $=new Array(E.length),Z=0;Z<$.length;++Z)$[Z]=E[Z].listener||E[Z];return $}(se):R(se,se.length)}function V(E){var $=this._events;if(void 0!==$){var Z=$[E];if("function"==typeof Z)return 1;if(void 0!==Z)return Z.length}return 0}function R(E,$){for(var Z=new Array($),oe=0;oe<$;++oe)Z[oe]=E[oe];return Z}function X(E,$,Z,oe){if("function"==typeof E.on)oe.once?E.once($,Z):E.on($,Z);else{if("function"!=typeof E.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof E);E.addEventListener($,function se(te){oe.once&&E.removeEventListener($,se),Z(te)})}}Object.defineProperty(v,"defaultMaxListeners",{enumerable:!0,get:function(){return x},set:function(E){if("number"!=typeof E||E<0||z(E))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+E+".");x=E}}),v.init=function(){(void 0===this._events||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},v.prototype.setMaxListeners=function($){if("number"!=typeof $||$<0||z($))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+$+".");return this._maxListeners=$,this},v.prototype.getMaxListeners=function(){return A(this)},v.prototype.emit=function($){for(var Z=[],oe=1;oe0&&(Ce=Z[0]),Ce instanceof Error)throw Ce;var me=new Error("Unhandled error."+(Ce?" ("+Ce.message+")":""));throw me.context=Ce,me}var ne=te[$];if(void 0===ne)return!1;if("function"==typeof ne)j(ne,this,Z);else{var _e=ne.length,Ie=R(ne,_e);for(oe=0;oe<_e;++oe)j(Ie[oe],this,Z)}return!0},v.prototype.on=v.prototype.addListener=function($,Z){return b(this,$,Z,!1)},v.prototype.prependListener=function($,Z){return b(this,$,Z,!0)},v.prototype.once=function($,Z){return O(Z),this.on($,S(this,$,Z)),this},v.prototype.prependOnceListener=function($,Z){return O(Z),this.prependListener($,S(this,$,Z)),this},v.prototype.off=v.prototype.removeListener=function($,Z){var oe,se,te,Ce,me;if(O(Z),void 0===(se=this._events))return this;if(void 0===(oe=se[$]))return this;if(oe===Z||oe.listener===Z)0==--this._eventsCount?this._events=Object.create(null):(delete se[$],se.removeListener&&this.emit("removeListener",$,oe.listener||Z));else if("function"!=typeof oe){for(te=-1,Ce=oe.length-1;Ce>=0;Ce--)if(oe[Ce]===Z||oe[Ce].listener===Z){me=oe[Ce].listener,te=Ce;break}if(te<0)return this;0===te?oe.shift():function(E,$){for(;$+1=0;se--)this.removeListener($,Z[se]);return this},v.prototype.listeners=function($){return T(this,$,!0)},v.prototype.rawListeners=function($){return T(this,$,!1)},v.listenerCount=function(E,$){return"function"==typeof E.listenerCount?E.listenerCount($):V.call(E,$)},v.prototype.listenerCount=V,v.prototype.eventNames=function(){return this._eventsCount>0?P(this._events):[]}},{}],9:[function(Y,Se,he){he.read=function(W,j,P,Q,z){var v,x,O=8*z-Q-1,A=(1<>1,y=-7,S=P?z-1:0,T=P?-1:1,V=W[j+S];for(S+=T,v=V&(1<<-y)-1,V>>=-y,y+=O;y>0;v=256*v+W[j+S],S+=T,y-=8);for(x=v&(1<<-y)-1,v>>=-y,y+=Q;y>0;x=256*x+W[j+S],S+=T,y-=8);if(0===v)v=1-b;else{if(v===A)return x?NaN:1/0*(V?-1:1);x+=Math.pow(2,Q),v-=b}return(V?-1:1)*x*Math.pow(2,v-Q)},he.write=function(W,j,P,Q,z,v){var x,O,A,b=8*v-z-1,y=(1<>1,T=23===z?Math.pow(2,-24)-Math.pow(2,-77):0,V=Q?0:v-1,R=Q?1:-1,K=j<0||0===j&&1/j<0?1:0;for(j=Math.abs(j),isNaN(j)||j===1/0?(O=isNaN(j)?1:0,x=y):(x=Math.floor(Math.log(j)/Math.LN2),j*(A=Math.pow(2,-x))<1&&(x--,A*=2),(j+=x+S>=1?T/A:T*Math.pow(2,1-S))*A>=2&&(x++,A/=2),x+S>=y?(O=0,x=y):x+S>=1?(O=(j*A-1)*Math.pow(2,z),x+=S):(O=j*Math.pow(2,S-1)*Math.pow(2,z),x=0));z>=8;W[P+V]=255&O,V+=R,O/=256,z-=8);for(x=x<0;W[P+V]=255&x,V+=R,x/=256,b-=8);W[P+V-R]|=128*K}},{}],10:[function(Y,Se,he){Se.exports="function"==typeof Object.create?function(j,P){P&&(j.super_=P,j.prototype=Object.create(P.prototype,{constructor:{value:j,enumerable:!1,writable:!0,configurable:!0}}))}:function(j,P){if(P){j.super_=P;var Q=function(){};Q.prototype=P.prototype,j.prototype=new Q,j.prototype.constructor=j}}},{}],11:[function(Y,Se,he){"use strict";const{isArray:W,isObject:j,isString:P}=Y("./types"),{asArray:Q}=Y("./util"),{prependBase:z}=Y("./url"),v=Y("./JsonLdError"),x=Y("./ResolvedContext");function A(y){throw new v("Invalid JSON-LD syntax; @context must be an object.","jsonld.SyntaxError",{code:"invalid local context",context:y})}function b({context:y,base:S}){if(!y)return;const T=y["@context"];if(P(T))y["@context"]=z(S,T);else if(W(T))for(let V=0;V10)throw new v("Maximum number of @context URLs exceeded.","jsonld.ContextUrlError",{code:"json-ld-1.0"===S.processingMode?"loading remote context failed":"context overflow",max:10});if(R.has(T))throw new v("Cyclical @context URLs detected.","jsonld.ContextUrlError",{code:"json-ld-1.0"===S.processingMode?"recursive context inclusion":"context overflow",url:T});let K,ce;R.add(T);try{ce=yield V(T),K=ce.document||null,P(K)&&(K=JSON.parse(K))}catch(D){throw new v("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:D})}if(!j(K))throw new v("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 K="@context"in K?{"@context":K["@context"]}:{"@context":{}},ce.contextUrl&&(W(K["@context"])||(K["@context"]=[K["@context"]]),K["@context"].push(ce.contextUrl)),{context:K,remoteDoc:ce}})()}}},{"./JsonLdError":12,"./ResolvedContext":16,"./types":30,"./url":31,"./util":32}],12:[function(Y,Se,he){"use strict";Se.exports=class extends Error{constructor(j="An unspecified JSON-LD error occurred.",P="jsonld.Error",Q={}){super(j),this.name=P,this.message=j,this.details=Q}}},{}],13:[function(Y,Se,he){"use strict";Se.exports=W=>{class j{toString(){return"[object JsonLdProcessor]"}}return Object.defineProperty(j,"prototype",{writable:!1,enumerable:!1}),Object.defineProperty(j.prototype,"constructor",{writable:!0,enumerable:!1,configurable:!0,value:j}),j.compact=function(P,Q){return arguments.length<2?Promise.reject(new TypeError("Could not compact, too few arguments.")):W.compact(P,Q)},j.expand=function(P){return arguments.length<1?Promise.reject(new TypeError("Could not expand, too few arguments.")):W.expand(P)},j.flatten=function(P){return arguments.length<1?Promise.reject(new TypeError("Could not flatten, too few arguments.")):W.flatten(P)},j}},{}],14:[function(Y,Se,he){"use strict";Se.exports=Y("rdf-canonize").NQuads},{"rdf-canonize":46}],15:[function(Y,Se,he){"use strict";Se.exports=class{constructor(){this._requests={}}wrapLoader(j){const P=this;return P._loader=j,function(){return P.add.apply(P,arguments)}}add(j){var P=this;return yt(function*(){let Q=P._requests[j];if(Q)return Promise.resolve(Q);Q=P._requests[j]=P._loader(j);try{return yield Q}finally{delete P._requests[j]}})()}}},{}],16:[function(Y,Se,he){"use strict";const W=Y("lru-cache");Se.exports=class{constructor({document:Q}){this.document=Q,this.cache=new W({max:10})}getProcessed(Q){return this.cache.get(Q)}setProcessed(Q,z){this.cache.set(Q,z)}}},{"lru-cache":33}],17:[function(Y,Se,he){"use strict";const W=Y("./JsonLdError"),{isArray:j,isObject:P,isString:Q,isUndefined:z}=Y("./types"),{isList:v,isValue:x,isGraph:O,isSimpleGraph:A,isSubjectReference:b}=Y("./graphTypes"),{expandIri:y,getContextValue:S,isKeyword:T,process:V,processingMode:R}=Y("./context"),{removeBase:K,prependBase:ce}=Y("./url"),{addValue:D,asArray:I,compareShortestLeast:X}=Y("./util"),E={};function Z(oe,se,te){if("@nest"!==y(oe,se,{vocab:!0},te))throw new W("JSON-LD compact error; nested property must have an @nest value resolving to @nest.","jsonld.SyntaxError",{code:"invalid @nest value"})}Se.exports=E,E.compact=function(){var oe=yt(function*({activeCtx:se,activeProperty:te=null,element:Ce,options:me={},compactionMap:ne=(()=>{})}){if(j(Ce)){let Ie=[];for(let Ge=0;Ge1&&(tt=Array.from(tt).sort());const Ye=se;for(const ke of tt){const Ke=E.compactIri({activeCtx:Ye,iri:ke,relativeTo:{vocab:!0}}),Me=S(st,Ke,"@context");z(Me)||(se=yield V({activeCtx:se,localCtx:Me,options:me,propagate:!1}))}const Ue=Object.keys(Ce).sort();for(const ke of Ue){const Ke=Ce[ke];if("@id"!==ke)if("@type"!==ke)if("@reverse"!==ke)if("@preserve"!==ke)if("@index"!==ke)if("@graph"!==ke&&"@list"!==ke&&"@included"!==ke&&T(ke)){const Me=E.compactIri({activeCtx:se,iri:ke,relativeTo:{vocab:!0}});D(Ge,Me,Ke)}else{if(!j(Ke))throw new W("JSON-LD expansion error; expanded value must be an array.","jsonld.SyntaxError");if(0===Ke.length){const Me=E.compactIri({activeCtx:se,iri:ke,value:Ke,relativeTo:{vocab:!0},reverse:Ie}),Ve=se.mappings.has(Me)?se.mappings.get(Me)["@nest"]:null;let $e=Ge;Ve&&(Z(se,Ve,me),P(Ge[Ve])||(Ge[Ve]={}),$e=Ge[Ve]),D($e,Me,Ke,{propertyIsArray:!0})}for(const Me of Ke){const Ve=E.compactIri({activeCtx:se,iri:ke,value:Me,relativeTo:{vocab:!0},reverse:Ie}),$e=se.mappings.has(Ve)?se.mappings.get(Ve)["@nest"]:null;let Ne=Ge;$e&&(Z(se,$e,me),P(Ge[$e])||(Ge[$e]={}),Ne=Ge[$e]);const q=S(se,Ve,"@container")||[],G=O(Me),pe=v(Me);let ue;pe?ue=Me["@list"]:G&&(ue=Me["@graph"]);let je=yield E.compact({activeCtx:se,activeProperty:Ve,element:pe||G?ue:Me,options:me,compactionMap:ne});if(pe){if(j(je)||(je=[je]),q.includes("@list")){D(Ne,Ve,je,{valueIsArray:!0,allowDuplicate:!0});continue}je={[E.compactIri({activeCtx:se,iri:"@list",relativeTo:{vocab:!0}})]:je},"@index"in Me&&(je[E.compactIri({activeCtx:se,iri:"@index",relativeTo:{vocab:!0}})]=Me["@index"])}if(G)if(q.includes("@graph")&&(q.includes("@id")||q.includes("@index")&&A(Me))){let _t;Ne.hasOwnProperty(Ve)?_t=Ne[Ve]:Ne[Ve]=_t={};const pt=(q.includes("@id")?Me["@id"]:Me["@index"])||E.compactIri({activeCtx:se,iri:"@none",relativeTo:{vocab:!0}});D(_t,pt,je,{propertyIsArray:!me.compactArrays||q.includes("@set")})}else q.includes("@graph")&&A(Me)?(j(je)&&je.length>1&&(je={"@included":je}),D(Ne,Ve,je,{propertyIsArray:!me.compactArrays||q.includes("@set")})):(j(je)&&1===je.length&&me.compactArrays&&(je=je[0]),je={[E.compactIri({activeCtx:se,iri:"@graph",relativeTo:{vocab:!0}})]:je},"@id"in Me&&(je[E.compactIri({activeCtx:se,iri:"@id",relativeTo:{vocab:!0}})]=Me["@id"]),"@index"in Me&&(je[E.compactIri({activeCtx:se,iri:"@index",relativeTo:{vocab:!0}})]=Me["@index"]),D(Ne,Ve,je,{propertyIsArray:!me.compactArrays||q.includes("@set")}));else if(q.includes("@language")||q.includes("@index")||q.includes("@id")||q.includes("@type")){let _t,pt;if(Ne.hasOwnProperty(Ve)?_t=Ne[Ve]:Ne[Ve]=_t={},q.includes("@language"))x(je)&&(je=je["@value"]),pt=Me["@language"];else if(q.includes("@index")){const ve=S(se,Ve,"@index")||"@index",L=E.compactIri({activeCtx:se,iri:ve,relativeTo:{vocab:!0}});if("@index"===ve)pt=Me["@index"],delete je[L];else{let N;if([pt,...N]=I(je[ve]||[]),Q(pt))switch(N.length){case 0:delete je[ve];break;case 1:je[ve]=N[0];break;default:je[ve]=N}else pt=null}}else if(q.includes("@id")){const ve=E.compactIri({activeCtx:se,iri:"@id",relativeTo:{vocab:!0}});pt=je[ve],delete je[ve]}else if(q.includes("@type")){const ve=E.compactIri({activeCtx:se,iri:"@type",relativeTo:{vocab:!0}});let L;switch([pt,...L]=I(je[ve]||[]),L.length){case 0:delete je[ve];break;case 1:je[ve]=L[0];break;default:je[ve]=L}1===Object.keys(je).length&&"@id"in Me&&(je=yield E.compact({activeCtx:se,activeProperty:Ve,element:{"@id":Me["@id"]},options:me,compactionMap:ne}))}pt||(pt=E.compactIri({activeCtx:se,iri:"@none",relativeTo:{vocab:!0}})),D(_t,pt,je,{propertyIsArray:q.includes("@set")})}else{const _t=!me.compactArrays||q.includes("@set")||q.includes("@list")||j(je)&&0===je.length||"@list"===ke||"@graph"===ke;D(Ne,Ve,je,{propertyIsArray:_t})}}}else{if((S(se,te,"@container")||[]).includes("@index"))continue;const Ve=E.compactIri({activeCtx:se,iri:ke,relativeTo:{vocab:!0}});D(Ge,Ve,Ke)}else{const Me=yield E.compact({activeCtx:se,activeProperty:te,element:Ke,options:me,compactionMap:ne});j(Me)&&0===Me.length||D(Ge,ke,Me)}else{const Me=yield E.compact({activeCtx:se,activeProperty:"@reverse",element:Ke,options:me,compactionMap:ne});for(const Ve in Me)if(se.mappings.has(Ve)&&se.mappings.get(Ve).reverse){const $e=Me[Ve],q=(S(se,Ve,"@container")||[]).includes("@set")||!me.compactArrays;D(Ge,Ve,$e,{propertyIsArray:q}),delete Me[Ve]}if(Object.keys(Me).length>0){const Ve=E.compactIri({activeCtx:se,iri:ke,relativeTo:{vocab:!0}});D(Ge,Ve,Me)}}else{let Me=I(Ke).map(G=>E.compactIri({activeCtx:st,iri:G,relativeTo:{vocab:!0}}));1===Me.length&&(Me=Me[0]);const Ve=E.compactIri({activeCtx:se,iri:"@type",relativeTo:{vocab:!0}}),q=(S(se,Ve,"@container")||[]).includes("@set")&&R(se,1.1)||j(Me)&&0===Ke.length;D(Ge,Ve,Me,{propertyIsArray:q})}else{let Me=I(Ke).map($e=>E.compactIri({activeCtx:se,iri:$e,relativeTo:{vocab:!1},base:me.base}));1===Me.length&&(Me=Me[0]),Ge[E.compactIri({activeCtx:se,iri:"@id",relativeTo:{vocab:!0}})]=Me}}return Ge}return Ce});return function(se){return oe.apply(this,arguments)}}(),E.compactIri=({activeCtx:oe,iri:se,value:te=null,relativeTo:Ce={vocab:!1},reverse:me=!1,base:ne=null})=>{if(null===se)return se;oe.isPropertyTermScoped&&oe.previousContext&&(oe=oe.previousContext);const _e=oe.getInverse();if(T(se)&&se in _e&&"@none"in _e[se]&&"@type"in _e[se]["@none"]&&"@none"in _e[se]["@none"]["@type"])return _e[se]["@none"]["@type"]["@none"];if(Ce.vocab&&se in _e){const tt=oe["@language"]||"@none",Ye=[];P(te)&&"@index"in te&&!("@graph"in te)&&Ye.push("@index","@index@set"),P(te)&&"@preserve"in te&&(te=te["@preserve"][0]),O(te)?("@index"in te&&Ye.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in te&&Ye.push("@graph@id","@graph@id@set"),Ye.push("@graph","@graph@set","@set"),"@index"in te||Ye.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in te||Ye.push("@graph@id","@graph@id@set")):P(te)&&!x(te)&&Ye.push("@id","@id@set","@type","@set@type");let Ue="@language",ke="@null";if(me)Ue="@type",ke="@reverse",Ye.push("@set");else if(v(te)){"@index"in te||Ye.push("@list");const Me=te["@list"];if(0===Me.length)Ue="@any",ke="@none";else{let Ve=0===Me.length?tt:null,$e=null;for(let Ne=0;Nest.includes("_"));Ge&&_e.push(Ge.replace(/^[^_]+_/,"_"))}_e.push("@none");const Ie=oe.inverse[se];for(const Ge of Ce){if(!(Ge in Ie))continue;const st=Ie[Ge][me];for(const Xe of _e)if(Xe in st)return st[Xe]}return null}(oe,se,te,Ye,Ue,ke);if(null!==Ke)return Ke}if(Ce.vocab&&"@vocab"in oe){const tt=oe["@vocab"];if(0===se.indexOf(tt)&&se!==tt){const Ye=se.substr(tt.length);if(!oe.mappings.has(Ye))return Ye}}let Ie=null;const Ge=[];let st=oe.fastCurieMap;const Xe=se.length-1;for(let tt=0;tt=0;--tt){const Ye=Ge[tt],Ue=Ye.terms;for(const ke of Ue){const Ke=ke+":"+se.substr(Ye.iri.length);oe.mappings.get(ke)._prefix&&(!oe.mappings.has(Ke)||null===te&&oe.mappings.get(Ke)["@id"]===se)&&(null===Ie||X(Ke,Ie)<0)&&(Ie=Ke)}}if(null!==Ie)return Ie;for(const[tt,Ye]of oe.mappings)if(Ye&&Ye._prefix&&se.startsWith(tt+":"))throw new W(`Absolute IRI "${se}" confused with prefix "${tt}".`,"jsonld.SyntaxError",{code:"IRI confused with prefix",context:oe});return Ce.vocab?se:"@base"in oe?oe["@base"]?K(ce(ne,oe["@base"]),se):se:K(ne,se)},E.compactValue=({activeCtx:oe,activeProperty:se,value:te,options:Ce})=>{if(x(te)){const Ie=S(oe,se,"@type"),Ge=S(oe,se,"@language"),st=S(oe,se,"@direction"),Xe=S(oe,se,"@container")||[],tt="@index"in te&&!Xe.includes("@index");if(!tt&&"@none"!==Ie&&(te["@type"]===Ie||"@language"in te&&te["@language"]===Ge&&"@direction"in te&&te["@direction"]===st||"@language"in te&&te["@language"]===Ge||"@direction"in te&&te["@direction"]===st))return te["@value"];const Ye=Object.keys(te).length,Ue=1===Ye||2===Ye&&"@index"in te&&!tt,ke="@language"in oe,Ke=Q(te["@value"]),Me=oe.mappings.has(se)&&null===oe.mappings.get(se)["@language"];if(Ue&&"@none"!==Ie&&(!ke||!Ke||Me))return te["@value"];const Ve={};return tt&&(Ve[E.compactIri({activeCtx:oe,iri:"@index",relativeTo:{vocab:!0}})]=te["@index"]),"@type"in te?Ve[E.compactIri({activeCtx:oe,iri:"@type",relativeTo:{vocab:!0}})]=E.compactIri({activeCtx:oe,iri:te["@type"],relativeTo:{vocab:!0}}):"@language"in te&&(Ve[E.compactIri({activeCtx:oe,iri:"@language",relativeTo:{vocab:!0}})]=te["@language"]),"@direction"in te&&(Ve[E.compactIri({activeCtx:oe,iri:"@direction",relativeTo:{vocab:!0}})]=te["@direction"]),Ve[E.compactIri({activeCtx:oe,iri:"@value",relativeTo:{vocab:!0}})]=te["@value"],Ve}const me=y(oe,se,{vocab:!0},Ce),ne=S(oe,se,"@type"),_e=E.compactIri({activeCtx:oe,iri:te["@id"],relativeTo:{vocab:"@vocab"===ne},base:Ce.base});return"@id"===ne||"@vocab"===ne||"@graph"===me?_e:{[E.compactIri({activeCtx:oe,iri:"@id",relativeTo:{vocab:!0}})]:_e}}},{"./JsonLdError":12,"./context":19,"./graphTypes":25,"./types":30,"./url":31,"./util":32}],18:[function(Y,Se,he){"use strict";const W="http://www.w3.org/1999/02/22-rdf-syntax-ns#",j="http://www.w3.org/2001/XMLSchema#";Se.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:j,XSD_BOOLEAN:j+"boolean",XSD_DOUBLE:j+"double",XSD_INTEGER:j+"integer",XSD_STRING:j+"string"}},{}],19:[function(Y,Se,he){"use strict";const W=Y("./util"),j=Y("./JsonLdError"),{isArray:P,isObject:Q,isString:z,isUndefined:v}=Y("./types"),{isAbsolute:x,isRelative:O,prependBase:A}=Y("./url"),{asArray:b,compareShortestLeast:y}=Y("./util"),S=new Map,V=/^@[a-zA-Z]+$/,R={};function K(D,I,X,E,$,Z){if(null===I||!z(I)||R.isKeyword(I))return I;if(I.match(V))return null;if(E&&E.hasOwnProperty(I)&&!0!==$.get(I)&&R.createTermDefinition({activeCtx:D,localCtx:E,term:I,defined:$,options:Z}),(X=X||{}).vocab){const se=D.mappings.get(I);if(null===se)return null;if(Q(se)&&"@id"in se)return se["@id"]}const oe=I.indexOf(":");if(oe>0){const se=I.substr(0,oe),te=I.substr(oe+1);if("_"===se||0===te.indexOf("//"))return I;E&&E.hasOwnProperty(se)&&R.createTermDefinition({activeCtx:D,localCtx:E,term:se,defined:$,options:Z});const Ce=D.mappings.get(se);if(Ce&&Ce._prefix)return Ce["@id"]+te;if(x(I))return I}if(X.vocab&&"@vocab"in D)return D["@vocab"]+I;if(X.base&&"@base"in D){if(D["@base"])return A(A(Z.base,D["@base"]),I)}else if(X.base)return A(Z.base,I);return I}function ce(D,I){if(!D||"object"!=typeof D||!I||"object"!=typeof I)return D===I;const X=Array.isArray(D);if(X!==Array.isArray(I))return!1;if(X){if(D.length!==I.length)return!1;for(let Z=0;Z{if(E.has(X)){if(E.get(X))return;throw new j("Cyclical context definition detected.","jsonld.CyclicalContext",{code:"cyclic IRI mapping",context:I,term:X})}let oe;if(E.set(X,!1),I.hasOwnProperty(X)&&(oe=I[X]),"@type"===X&&Q(oe)&&"@set"===(oe["@container"]||"@set")&&R.processingMode(D,1.1)){const Ie=["@container","@id","@protected"],Ge=Object.keys(oe);if(0===Ge.length||Ge.some(st=>!Ie.includes(st)))throw new j("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:I,term:X})}else{if(R.isKeyword(X))throw new j("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:I,term:X});if(X.match(V))return void console.warn('WARNING: terms beginning with "@" are reserved for future use and ignored',{term:X});if(""===X)throw new j("Invalid JSON-LD syntax; a term cannot be an empty string.","jsonld.SyntaxError",{code:"invalid term definition",context:I})}const se=D.mappings.get(X);D.mappings.has(X)&&D.mappings.delete(X);let te=!1;if((z(oe)||null===oe)&&(te=!0,oe={"@id":oe}),!Q(oe))throw new j("Invalid JSON-LD syntax; @context term values must be strings or objects.","jsonld.SyntaxError",{code:"invalid term definition",context:I});const Ce={};D.mappings.set(X,Ce),Ce.reverse=!1;const me=["@container","@id","@language","@reverse","@type"];R.processingMode(D,1.1)&&me.push("@context","@direction","@index","@nest","@prefix","@protected");for(const Ie in oe)if(!me.includes(Ie))throw new j("Invalid JSON-LD syntax; a term definition must not contain "+Ie,"jsonld.SyntaxError",{code:"invalid term definition",context:I});const ne=X.indexOf(":");if(Ce._termHasColon=ne>0,"@reverse"in oe){if("@id"in oe)throw new j("Invalid JSON-LD syntax; a @reverse term definition must not contain @id.","jsonld.SyntaxError",{code:"invalid reverse property",context:I});if("@nest"in oe)throw new j("Invalid JSON-LD syntax; a @reverse term definition must not contain @nest.","jsonld.SyntaxError",{code:"invalid reverse property",context:I});const Ie=oe["@reverse"];if(!z(Ie))throw new j("Invalid JSON-LD syntax; a @context @reverse value must be a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:I});if(!R.isKeyword(Ie)&&Ie.match(V))return console.warn('WARNING: values beginning with "@" are reserved for future use and ignored',{reverse:Ie}),void(se?D.mappings.set(X,se):D.mappings.delete(X));const Ge=K(D,Ie,{vocab:!0,base:!1},I,E,$);if(!x(Ge))throw new j("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});Ce["@id"]=Ge,Ce.reverse=!0}else if("@id"in oe){let Ie=oe["@id"];if(Ie&&!z(Ie))throw new j("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===Ie)Ce["@id"]=null;else{if(!R.isKeyword(Ie)&&Ie.match(V))return console.warn('WARNING: values beginning with "@" are reserved for future use and ignored',{id:Ie}),void(se?D.mappings.set(X,se):D.mappings.delete(X));if(Ie!==X){if(Ie=K(D,Ie,{vocab:!0,base:!1},I,E,$),!x(Ie)&&!R.isKeyword(Ie))throw new j("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(X.match(/(?::[^:])|\//)&&K(D,X,{vocab:!0,base:!1},I,new Map(E).set(X,!0),$)!==Ie)throw new j("Invalid JSON-LD syntax; term in form of IRI must expand to definition.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:I});Ce["@id"]=Ie,Ce._prefix=te&&!Ce._termHasColon&&Ie.match(/[:\/\?#\[\]@]$/)}}}if(!("@id"in Ce))if(Ce._termHasColon){const Ie=X.substr(0,ne);if(I.hasOwnProperty(Ie)&&R.createTermDefinition({activeCtx:D,localCtx:I,term:Ie,defined:E,options:$}),D.mappings.has(Ie)){const Ge=X.substr(ne+1);Ce["@id"]=D.mappings.get(Ie)["@id"]+Ge}else Ce["@id"]=X}else if("@type"===X)Ce["@id"]=X;else{if(!("@vocab"in D))throw new j("Invalid JSON-LD syntax; @context terms must define an @id.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:I,term:X});Ce["@id"]=D["@vocab"]+X}if((!0===oe["@protected"]||!0===E.get("@protected")&&!1!==oe["@protected"])&&(D.protected[X]=!0,Ce.protected=!0),E.set(X,!0),"@type"in oe){let Ie=oe["@type"];if(!z(Ie))throw new j("Invalid JSON-LD syntax; an @context @type value must be a string.","jsonld.SyntaxError",{code:"invalid type mapping",context:I});if("@json"===Ie||"@none"===Ie){if(R.processingMode(D,1))throw new j(`Invalid JSON-LD syntax; an @context @type value must not be "${Ie}" in JSON-LD 1.0 mode.`,"jsonld.SyntaxError",{code:"invalid type mapping",context:I})}else if("@id"!==Ie&&"@vocab"!==Ie){if(Ie=K(D,Ie,{vocab:!0,base:!1},I,E,$),!x(Ie))throw new j("Invalid JSON-LD syntax; an @context @type value must be an absolute IRI.","jsonld.SyntaxError",{code:"invalid type mapping",context:I});if(0===Ie.indexOf("_:"))throw new j("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})}Ce["@type"]=Ie}if("@container"in oe){const Ie=z(oe["@container"])?[oe["@container"]]:oe["@container"]||[],Ge=["@list","@set","@index","@language"];let st=!0;const Xe=Ie.includes("@set");if(R.processingMode(D,1.1)){if(Ge.push("@graph","@id","@type"),Ie.includes("@list")){if(1!==Ie.length)throw new j("Invalid JSON-LD syntax; @context @container with @list must have no other values","jsonld.SyntaxError",{code:"invalid container mapping",context:I})}else if(Ie.includes("@graph")){if(Ie.some(tt=>"@graph"!==tt&&"@id"!==tt&&"@index"!==tt&&"@set"!==tt))throw new j("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 st&=Ie.length<=(Xe?2:1);if(Ie.includes("@type")&&(Ce["@type"]=Ce["@type"]||"@id",!["@id","@vocab"].includes(Ce["@type"])))throw new j("Invalid JSON-LD syntax; container: @type requires @type to be @id or @vocab.","jsonld.SyntaxError",{code:"invalid type mapping",context:I})}else st&=!P(oe["@container"]),st&=Ie.length<=1;if(st&=Ie.every(tt=>Ge.includes(tt)),st&=!(Xe&&Ie.includes("@list")),!st)throw new j("Invalid JSON-LD syntax; @context @container value must be one of the following: "+Ge.join(", "),"jsonld.SyntaxError",{code:"invalid container mapping",context:I});if(Ce.reverse&&!Ie.every(tt=>["@index","@set"].includes(tt)))throw new j("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});Ce["@container"]=Ie}if("@index"in oe){if(!("@container"in oe)||!Ce["@container"].includes("@index"))throw new j(`Invalid JSON-LD syntax; @index without @index in @container: "${oe["@index"]}" on term "${X}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:I});if(!z(oe["@index"])||0===oe["@index"].indexOf("@"))throw new j(`Invalid JSON-LD syntax; @index must expand to an IRI: "${oe["@index"]}" on term "${X}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:I});Ce["@index"]=oe["@index"]}if("@context"in oe&&(Ce["@context"]=oe["@context"]),"@language"in oe&&!("@type"in oe)){let Ie=oe["@language"];if(null!==Ie&&!z(Ie))throw new j("Invalid JSON-LD syntax; @context @language value must be a string or null.","jsonld.SyntaxError",{code:"invalid language mapping",context:I});null!==Ie&&(Ie=Ie.toLowerCase()),Ce["@language"]=Ie}if("@prefix"in oe){if(X.match(/:|\//))throw new j("Invalid JSON-LD syntax; @context @prefix used on a compact IRI term","jsonld.SyntaxError",{code:"invalid term definition",context:I});if(R.isKeyword(Ce["@id"]))throw new j("Invalid JSON-LD syntax; keywords may not be used as prefixes","jsonld.SyntaxError",{code:"invalid term definition",context:I});if("boolean"!=typeof oe["@prefix"])throw new j("Invalid JSON-LD syntax; @context value for @prefix must be boolean","jsonld.SyntaxError",{code:"invalid @prefix value",context:I});Ce._prefix=!0===oe["@prefix"]}if("@direction"in oe){const Ie=oe["@direction"];if(null!==Ie&&"ltr"!==Ie&&"rtl"!==Ie)throw new j('Invalid JSON-LD syntax; @direction value must be null, "ltr", or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",context:I});Ce["@direction"]=Ie}if("@nest"in oe){const Ie=oe["@nest"];if(!z(Ie)||"@nest"!==Ie&&0===Ie.indexOf("@"))throw new j("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});Ce["@nest"]=Ie}const _e=Ce["@id"];if("@context"===_e||"@preserve"===_e)throw new j("Invalid JSON-LD syntax; @context and @preserve cannot be aliased.","jsonld.SyntaxError",{code:"invalid keyword alias",context:I});if(se&&se.protected&&!Z&&(D.protected[X]=!0,Ce.protected=!0,!ce(se,Ce))){const Ie=$&&$.protectedMode||"error";if("error"===Ie)throw new j(`Invalid JSON-LD syntax; tried to redefine "${X}" which is a protected term.`,"jsonld.SyntaxError",{code:"protected term redefinition",context:I,term:X});if("warn"===Ie)return void console.warn("WARNING: protected term redefinition",{term:X});throw new j("Invalid protectedMode.","jsonld.SyntaxError",{code:"invalid protected mode",context:I,term:X,protectedMode:Ie})}},R.expandIri=(D,I,X,E)=>K(D,I,X,void 0,void 0,E),R.getInitialContext=D=>{const I=JSON.stringify({processingMode:D.processingMode}),X=S.get(I);if(X)return X;const E={processingMode:D.processingMode,mappings:new Map,inverse:null,getInverse:function(){const Ce=this;if(Ce.inverse)return Ce.inverse;const me=Ce.inverse={},ne=Ce.fastCurieMap={},_e={},Ie=(Ce["@language"]||"@none").toLowerCase(),Ge=Ce["@direction"],st=Ce.mappings,Xe=[...st.keys()].sort(y);for(const tt of Xe){const Ye=st.get(tt);if(null===Ye)continue;let Ue=Ye["@container"]||"@none";if(Ue=[].concat(Ue).sort().join(""),null===Ye["@id"])continue;const ke=b(Ye["@id"]);for(const Ke of ke){let Me=me[Ke];const Ve=R.isKeyword(Ke);if(Me)!Ve&&!Ye._termHasColon&&_e[Ke].push(tt);else if(me[Ke]=Me={},!Ve&&!Ye._termHasColon){_e[Ke]=[tt];const $e={iri:Ke,terms:_e[Ke]};Ke[0]in ne?ne[Ke[0]].push($e):ne[Ke[0]]=[$e]}if(Me[Ue]||(Me[Ue]={"@language":{},"@type":{},"@any":{}}),Me=Me[Ue],oe(tt,Me["@any"],"@none"),Ye.reverse)oe(tt,Me["@type"],"@reverse");else if("@none"===Ye["@type"])oe(tt,Me["@any"],"@none"),oe(tt,Me["@language"],"@none"),oe(tt,Me["@type"],"@none");else if("@type"in Ye)oe(tt,Me["@type"],Ye["@type"]);else if("@language"in Ye&&"@direction"in Ye){const $e=Ye["@language"],Ne=Ye["@direction"];oe(tt,Me["@language"],$e&&Ne?`${$e}_${Ne}`.toLowerCase():$e?$e.toLowerCase():Ne?`_${Ne}`:"@null")}else"@language"in Ye?oe(tt,Me["@language"],(Ye["@language"]||"@null").toLowerCase()):"@direction"in Ye?oe(tt,Me["@language"],Ye["@direction"]?`_${Ye["@direction"]}`:"@none"):Ge?(oe(tt,Me["@language"],`_${Ge}`),oe(tt,Me["@language"],"@none"),oe(tt,Me["@type"],"@none")):(oe(tt,Me["@language"],Ie),oe(tt,Me["@language"],"@none"),oe(tt,Me["@type"],"@none"))}}for(const tt in ne)Z(ne,tt,1);return me},clone:function(){const Ce={};return Ce.mappings=W.clone(this.mappings),Ce.clone=this.clone,Ce.inverse=null,Ce.getInverse=this.getInverse,Ce.protected=W.clone(this.protected),this.previousContext&&(Ce.previousContext=this.previousContext.clone()),Ce.revertToPreviousContext=this.revertToPreviousContext,"@base"in this&&(Ce["@base"]=this["@base"]),"@language"in this&&(Ce["@language"]=this["@language"]),"@vocab"in this&&(Ce["@vocab"]=this["@vocab"]),Ce},revertToPreviousContext:function(){return this.previousContext?this.previousContext.clone():this},protected:{}};return 1e4===S.size&&S.clear(),S.set(I,E),E;function Z(Ce,me,ne){const _e=Ce[me],Ie=Ce[me]={};let Ge,st;for(const Xe of _e)Ge=Xe.iri,st=ne>=Ge.length?"":Ge[ne],st in Ie?Ie[st].push(Xe):Ie[st]=[Xe];for(const Xe in Ie)""!==Xe&&Z(Ie,Xe,ne+1)}function oe(Ce,me,ne){me.hasOwnProperty(ne)||(me[ne]=Ce)}},R.getContextValue=(D,I,X)=>{if(null===I)return"@context"===X?void 0:null;if(D.mappings.has(I)){const E=D.mappings.get(I);if(v(X))return E;if(E.hasOwnProperty(X))return E[X]}return"@language"===X&&X in D||"@direction"===X&&X in D?D[X]:"@context"!==X?null:void 0},R.processingMode=(D,I)=>I.toString()>="1.1"?!D.processingMode||D.processingMode>="json-ld-"+I.toString():"json-ld-1.0"===D.processingMode,R.isKeyword=D=>{if(!z(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(Y,Se,he){"use strict";const{parseLinkHeader:W,buildHeaders:j}=Y("../util"),{LINK_HEADER_CONTEXT:P}=Y("../constants"),Q=Y("../JsonLdError"),z=Y("../RequestQueue"),{prependBase:v}=Y("../url"),x=/(^|(\r\n))link:/i;function O(A,b,y){const S=new(A=A||XMLHttpRequest);return new Promise((T,V)=>{S.onload=()=>T(S),S.onerror=R=>V(R),S.open("GET",b,!0);for(const R in y)S.setRequestHeader(R,y[R]);S.send()})}Se.exports=({secure:A,headers:b={},xhr:y}={headers:{}})=>{return b=j(b),(new z).wrapLoader(T);function T(R){return V.apply(this,arguments)}function V(){return(V=yt(function*(R){if(0!==R.indexOf("http:")&&0!==R.indexOf("https:"))throw new Q('URL could not be dereferenced; only "http" and "https" URLs are supported.',"jsonld.InvalidUrl",{code:"loading document failed",url:R});if(A&&0!==R.indexOf("https"))throw new Q('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 K;try{K=yield O(y,R,b)}catch(E){throw new Q("URL could not be dereferenced, an error occurred.","jsonld.LoadDocumentError",{code:"loading document failed",url:R,cause:E})}if(K.status>=400)throw new Q("URL could not be dereferenced: "+K.statusText,"jsonld.LoadDocumentError",{code:"loading document failed",url:R,httpStatusCode:K.status});let ce={contextUrl:null,documentUrl:R,document:K.response},D=null;const I=K.getResponseHeader("Content-Type");let X;if(x.test(K.getAllResponseHeaders())&&(X=K.getResponseHeader("Link")),X&&"application/ld+json"!==I){const E=W(X),$=E[P];if(Array.isArray($))throw new Q("URL could not be dereferenced, it has more than one associated HTTP Link Header.","jsonld.InvalidUrl",{code:"multiple context link headers",url:R});$&&(ce.contextUrl=$.target),D=E.alternate,D&&"application/ld+json"==D.type&&!(I||"").match(/^application\/(\w*\+)?json$/)&&(ce=yield T(v(R,D.target)))}return ce})).apply(this,arguments)}}},{"../JsonLdError":12,"../RequestQueue":15,"../constants":18,"../url":31,"../util":32}],21:[function(Y,Se,he){"use strict";const W=Y("./JsonLdError"),{isArray:j,isObject:P,isEmptyObject:Q,isString:z,isUndefined:v}=Y("./types"),{isList:x,isValue:O,isGraph:A,isSubject:b}=Y("./graphTypes"),{expandIri:y,getContextValue:S,isKeyword:T,process:V,processingMode:R}=Y("./context"),{isAbsolute:K}=Y("./url"),{addValue:ce,asArray:D,getValues:I,validateTypeValue:X}=Y("./util"),E={};Se.exports=E;const $=/^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$/;function Z(ne){return oe.apply(this,arguments)}function oe(){return(oe=yt(function*({activeCtx:ne,activeProperty:_e,expandedActiveProperty:Ie,element:Ge,expandedParent:st,options:Xe={},insideList:tt,typeKey:Ye,typeScopedContext:Ue,expansionMap:ke}){const Ke=Object.keys(Ge).sort(),Me=[];let Ve;const $e=Ge[Ye]&&"@json"===y(ne,j(Ge[Ye])?Ge[Ye][0]:Ge[Ye],{vocab:!0},Xe);for(const Ne of Ke){let G,q=Ge[Ne];if("@context"===Ne)continue;let pe=y(ne,Ne,{vocab:!0},Xe);if((null===pe||!K(pe)&&!T(pe))&&(pe=ke({unmappedProperty:Ne,activeCtx:ne,activeProperty:_e,parent:Ge,options:Xe,insideList:tt,value:q,expandedParent:st}),void 0===pe))continue;if(T(pe)){if("@reverse"===Ie)throw new W("Invalid JSON-LD syntax; a keyword cannot be used as a @reverse property.","jsonld.SyntaxError",{code:"invalid reverse property map",value:q});if(pe in st&&"@included"!==pe&&"@type"!==pe)throw new W("Invalid JSON-LD syntax; colliding keywords detected.","jsonld.SyntaxError",{code:"colliding keywords",keyword:pe})}if("@id"===pe){if(!z(q)){if(!Xe.isFrame)throw new W('Invalid JSON-LD syntax; "@id" value must a string.',"jsonld.SyntaxError",{code:"invalid @id value",value:q});if(P(q)){if(!Q(q))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:q})}else{if(!j(q))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:q});if(!q.every(pt=>z(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:q})}}ce(st,"@id",D(q).map(pt=>z(pt)?y(ne,pt,{base:!0},Xe):pt),{propertyIsArray:Xe.isFrame});continue}if("@type"===pe){P(q)&&(q=Object.fromEntries(Object.entries(q).map(([pt,ve])=>[y(Ue,pt,{vocab:!0}),D(ve).map(L=>y(Ue,L,{base:!0,vocab:!0}))]))),X(q,Xe.isFrame),ce(st,"@type",D(q).map(pt=>z(pt)?y(Ue,pt,{base:!0,vocab:!0},Xe):pt),{propertyIsArray:Xe.isFrame});continue}if("@included"===pe&&R(ne,1.1)){const pt=D(yield E.expand({activeCtx:ne,activeProperty:_e,element:q,options:Xe,expansionMap:ke}));if(!pt.every(ve=>b(ve)))throw new W("Invalid JSON-LD syntax; values of @included must expand to node objects.","jsonld.SyntaxError",{code:"invalid @included value",value:q});ce(st,"@included",pt,{propertyIsArray:!0});continue}if("@graph"===pe&&!P(q)&&!j(q))throw new W('Invalid JSON-LD syntax; "@graph" value must not be an object or an array.',"jsonld.SyntaxError",{code:"invalid @graph value",value:q});if("@value"===pe){Ve=q,$e&&R(ne,1.1)?st["@value"]=q:ce(st,"@value",q,{propertyIsArray:Xe.isFrame});continue}if("@language"===pe){if(null===q)continue;if(!z(q)&&!Xe.isFrame)throw new W('Invalid JSON-LD syntax; "@language" value must be a string.',"jsonld.SyntaxError",{code:"invalid language-tagged string",value:q});q=D(q).map(pt=>z(pt)?pt.toLowerCase():pt);for(const pt of q)z(pt)&&!pt.match($)&&console.warn(`@language must be valid BCP47: ${pt}`);ce(st,"@language",q,{propertyIsArray:Xe.isFrame});continue}if("@direction"===pe){if(!z(q)&&!Xe.isFrame)throw new W('Invalid JSON-LD syntax; "@direction" value must be a string.',"jsonld.SyntaxError",{code:"invalid base direction",value:q});q=D(q);for(const pt of q)if(z(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:q});ce(st,"@direction",q,{propertyIsArray:Xe.isFrame});continue}if("@index"===pe){if(!z(q))throw new W('Invalid JSON-LD syntax; "@index" value must be a string.',"jsonld.SyntaxError",{code:"invalid @index value",value:q});ce(st,"@index",q);continue}if("@reverse"===pe){if(!P(q))throw new W('Invalid JSON-LD syntax; "@reverse" value must be an object.',"jsonld.SyntaxError",{code:"invalid @reverse value",value:q});if(G=yield E.expand({activeCtx:ne,activeProperty:"@reverse",element:q,options:Xe,expansionMap:ke}),"@reverse"in G)for(const ve in G["@reverse"])ce(st,ve,G["@reverse"][ve],{propertyIsArray:!0});let pt=st["@reverse"]||null;for(const ve in G){if("@reverse"===ve)continue;null===pt&&(pt=st["@reverse"]={}),ce(pt,ve,[],{propertyIsArray:!0});const L=G[ve];for(let N=0;N"@id"===pt||"@index"===pt)&&(G=D(G).map(pt=>({"@graph":D(pt)}))),ue.mappings.has(Ne)&&ue.mappings.get(Ne).reverse){const pt=st["@reverse"]=st["@reverse"]||{};G=D(G);for(let ve=0;ve"@value"===y(ne,pe,{vocab:!0},Xe)))throw new W("Invalid JSON-LD syntax; nested value must be a node object.","jsonld.SyntaxError",{code:"invalid @nest value",value:G});yield Z({activeCtx:ne,activeProperty:_e,expandedActiveProperty:Ie,element:G,expandedParent:st,options:Xe,insideList:tt,typeScopedContext:Ue,typeKey:Ye,expansionMap:ke})}}})).apply(this,arguments)}function se({activeCtx:ne,activeProperty:_e,value:Ie,options:Ge}){if(null==Ie)return null;const st=y(ne,_e,{vocab:!0},Ge);if("@id"===st)return y(ne,Ie,{base:!0},Ge);if("@type"===st)return y(ne,Ie,{vocab:!0,base:!0},Ge);const Xe=S(ne,_e,"@type");if(("@id"===Xe||"@graph"===st)&&z(Ie))return{"@id":y(ne,Ie,{base:!0},Ge)};if("@vocab"===Xe&&z(Ie))return{"@id":y(ne,Ie,{vocab:!0,base:!0},Ge)};if(T(st))return Ie;const tt={};if(Xe&&!["@id","@vocab","@none"].includes(Xe))tt["@type"]=Xe;else if(z(Ie)){const Ye=S(ne,_e,"@language");null!==Ye&&(tt["@language"]=Ye);const Ue=S(ne,_e,"@direction");null!==Ue&&(tt["@direction"]=Ue)}return["boolean","number","string"].includes(typeof Ie)||(Ie=Ie.toString()),tt["@value"]=Ie,tt}function te(ne,_e,Ie,Ge){const st=[],Xe=Object.keys(_e).sort();for(const tt of Xe){const Ye=y(ne,tt,{vocab:!0},Ge);let Ue=_e[tt];j(Ue)||(Ue=[Ue]);for(const ke of Ue){if(null===ke)continue;if(!z(ke))throw new W("Invalid JSON-LD syntax; language map values must be strings.","jsonld.SyntaxError",{code:"invalid language map value",languageMap:_e});const Ke={"@value":ke};"@none"!==Ye&&(Ke["@language"]=tt.toLowerCase()),Ie&&(Ke["@direction"]=Ie),st.push(Ke)}}return st}function Ce(ne){return me.apply(this,arguments)}function me(){return(me=yt(function*({activeCtx:ne,options:_e,activeProperty:Ie,value:Ge,expansionMap:st,asGraph:Xe,indexKey:tt,propertyIndex:Ye}){const Ue=[],ke=Object.keys(Ge).sort(),Ke="@type"===tt;for(let Me of ke){if(Ke){const Ne=S(ne,Me,"@context");v(Ne)||(ne=yield V({activeCtx:ne,localCtx:Ne,propagate:!1,options:_e}))}let $e,Ve=Ge[Me];j(Ve)||(Ve=[Ve]),Ve=yield E.expand({activeCtx:ne,activeProperty:Ie,element:Ve,options:_e,insideList:!1,insideIndex:!0,expansionMap:st}),$e=Ye?"@none"===Me?"@none":se({activeCtx:ne,activeProperty:tt,value:Me,options:_e}):y(ne,Me,{vocab:!0},_e),"@id"===tt?Me=y(ne,Me,{base:!0},_e):Ke&&(Me=$e);for(let Ne of Ve){if(Xe&&!A(Ne)&&(Ne={"@graph":[Ne]}),"@type"===tt)"@none"===$e||(Ne["@type"]=Ne["@type"]?[Me].concat(Ne["@type"]):[Me]);else{if(O(Ne)&&!["@language","@type","@index"].includes(tt))throw new W(`Invalid JSON-LD syntax; Attempt to add illegal key to value object: "${tt}".`,"jsonld.SyntaxError",{code:"invalid value object",value:Ne});Ye?"@none"!==$e&&ce(Ne,Ye,$e,{propertyIsArray:!0,prependValue:!0}):"@none"!==$e&&!(tt in Ne)&&(Ne[tt]=Me)}Ue.push(Ne)}}return Ue})).apply(this,arguments)}E.expand=function(){var ne=yt(function*({activeCtx:_e,activeProperty:Ie=null,element:Ge,options:st={},insideList:Xe=!1,insideIndex:tt=!1,typeScopedContext:Ye=null,expansionMap:Ue=(()=>{})}){if(null==Ge)return null;if("@default"===Ie&&(st=Object.assign({},st,{isFrame:!1})),!j(Ge)&&!P(Ge)){if(!Xe&&(null===Ie||"@graph"===y(_e,Ie,{vocab:!0},st))){const G=yield Ue({unmappedValue:Ge,activeCtx:_e,activeProperty:Ie,options:st,insideList:Xe});return void 0===G?null:G}return se({activeCtx:_e,activeProperty:Ie,value:Ge,options:st})}if(j(Ge)){let G=[];const pe=S(_e,Ie,"@container")||[];Xe=Xe||pe.includes("@list");for(let ue=0;ue1?ue.slice().sort():ue:[ue];for(const _t of je){const pt=S(Ye,_t,"@context");v(pt)||(_e=yield V({activeCtx:_e,localCtx:pt,options:st,propagate:!1}))}}let Ne={};yield Z({activeCtx:_e,activeProperty:Ie,expandedActiveProperty:ke,element:Ge,expandedParent:Ne,options:st,insideList:Xe,typeKey:$e,typeScopedContext:Ye,expansionMap:Ue}),Me=Object.keys(Ne);let q=Me.length;if("@value"in Ne){if("@type"in Ne&&("@language"in Ne||"@direction"in Ne))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:Ne});let G=q-1;if("@type"in Ne&&(G-=1),"@index"in Ne&&(G-=1),"@language"in Ne&&(G-=1),"@direction"in Ne&&(G-=1),0!==G)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:Ne});const pe=null===Ne["@value"]?[]:D(Ne["@value"]),ue=I(Ne,"@type");if(!R(_e,1.1)||!ue.includes("@json")||1!==ue.length)if(0===pe.length){const je=yield Ue({unmappedValue:Ne,activeCtx:_e,activeProperty:Ie,element:Ge,options:st,insideList:Xe});Ne=void 0!==je?je:null}else{if(!pe.every(je=>z(je)||Q(je))&&"@language"in Ne)throw new W("Invalid JSON-LD syntax; only strings may be language-tagged.","jsonld.SyntaxError",{code:"invalid language-tagged value",element:Ne});if(!ue.every(je=>K(je)&&!(z(je)&&0===je.indexOf("_:"))||Q(je)))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:Ne})}}else if("@type"in Ne&&!j(Ne["@type"]))Ne["@type"]=[Ne["@type"]];else if("@set"in Ne||"@list"in Ne){if(q>1&&(2!==q||!("@index"in Ne)))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:Ne});"@set"in Ne&&(Ne=Ne["@set"],Me=Object.keys(Ne),q=Me.length)}else if(1===q&&"@language"in Ne){const G=yield Ue(Ne,{unmappedValue:Ne,activeCtx:_e,activeProperty:Ie,element:Ge,options:st,insideList:Xe});Ne=void 0!==G?G:null}if(P(Ne)&&!st.keepFreeFloatingNodes&&!Xe&&(null===Ie||"@graph"===ke)&&(0===q||"@value"in Ne||"@list"in Ne||1===q&&"@id"in Ne)){const G=yield Ue({unmappedValue:Ne,activeCtx:_e,activeProperty:Ie,element:Ge,options:st,insideList:Xe});Ne=void 0!==G?G:null}return Ne});return function(_e){return ne.apply(this,arguments)}}()},{"./JsonLdError":12,"./context":19,"./graphTypes":25,"./types":30,"./url":31,"./util":32}],22:[function(Y,Se,he){"use strict";const{isSubjectReference:W}=Y("./graphTypes"),{createMergedNodeMap:j}=Y("./nodeMap"),P={};Se.exports=P,P.flatten=Q=>{const z=j(Q),v=[],x=Object.keys(z).sort();for(let O=0;O=0;--oe){const se=Z[oe];if(se.graph===$&&se.subject["@id"]===E["@id"])return!0}return!1}function S(E,$,Z){const oe="@"+Z;let se=oe in E?E[oe][0]:$[Z];if("embed"===Z)if(!0===se)se="@once";else if(!1===se)se="@never";else if("@always"!==se&&"@never"!==se&&"@link"!==se&&"@first"!==se&&"@last"!==se&&"@once"!==se)throw new v("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:E});return se}function T(E){if(!P.isArray(E)||1!==E.length||!P.isObject(E[0]))throw new v("Invalid JSON-LD syntax; a JSON-LD frame must be a single object.","jsonld.SyntaxError",{frame:E});if("@id"in E[0])for(const $ of Q.asArray(E[0]["@id"]))if(!P.isObject($)&&!z.isAbsolute($)||P.isString($)&&0===$.indexOf("_:"))throw new v("Invalid JSON-LD syntax; invalid @id in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:E});if("@type"in E[0])for(const $ of Q.asArray(E[0]["@type"]))if(!P.isObject($)&&!z.isAbsolute($)||P.isString($)&&0===$.indexOf("_:"))throw new v("Invalid JSON-LD syntax; invalid @type in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:E})}function R(E,$,Z,oe){let se=!0,te=!1;for(const Ce in Z){let me=!1;const ne=Q.getValues($,Ce),_e=0===Q.getValues(Z,Ce).length;if("@id"===Ce){if(P.isEmptyObject(Z["@id"][0]||{})?me=!0:Z["@id"].length>=0&&(me=Z["@id"].includes(ne[0])),!oe.requireAll)return me}else if("@type"===Ce){if(se=!1,_e){if(ne.length>0)return!1;me=!0}else if(1===Z["@type"].length&&P.isEmptyObject(Z["@type"][0]))me=ne.length>0;else for(const Ie of Z["@type"])me=!(!P.isObject(Ie)||!("@default"in Ie))||me||ne.some(Ge=>Ge===Ie);if(!oe.requireAll)return me}else{if(W(Ce))continue;{const Ie=Q.getValues(Z,Ce)[0];let Ge=!1;if(Ie&&(T([Ie]),Ge="@default"in Ie),se=!1,0===ne.length&&Ge)continue;if(ne.length>0&&_e)return!1;if(void 0===Ie){if(ne.length>0)return!1;me=!0}else if(j.isList(Ie)){const st=Ie["@list"][0];if(j.isList(ne[0])){const Xe=ne[0]["@list"];j.isValue(st)?me=Xe.some(tt=>X(st,tt)):(j.isSubject(st)||j.isSubjectReference(st))&&(me=Xe.some(tt=>I(E,st,tt,oe)))}}else me=j.isValue(Ie)?ne.some(st=>X(Ie,st)):j.isSubjectReference(Ie)?ne.some(st=>I(E,Ie,st,oe)):!!P.isObject(Ie)&&ne.length>0}}if(!me&&oe.requireAll)return!1;te=te||me}return se||te}function K(E,$){const Z=E.uniqueEmbeds[E.graph],oe=Z[$],se=oe.parent,te=oe.property,Ce={"@id":$};if(P.isArray(se)){for(let ne=0;ne{const _e=Object.keys(Z);for(const Ie of _e)Ie in Z&&P.isObject(Z[Ie].parent)&&Z[Ie].parent["@id"]===ne&&(delete Z[Ie],me(Ie))};me($)}function ce(E,$){if(P.isArray(E))return E.map(Z=>ce(Z,$));if(P.isObject(E)){if("@preserve"in E)return E["@preserve"][0];if(j.isValue(E))return E;if(j.isList(E))return E["@list"]=ce(E["@list"],$),E;if("@id"in E){const Z=E["@id"];if($.link.hasOwnProperty(Z)){const oe=$.link[Z].indexOf(E);if(-1!==oe)return $.link[Z][oe];$.link[Z].push(E)}else $.link[Z]=[E]}for(const Z in E)"@id"===Z&&$.bnodesToClear.includes(E[Z])?delete E["@id"]:E[Z]=ce(E[Z],$)}return E}function D(E,$,Z){P.isObject(E)?Q.addValue(E,$,Z,{propertyIsArray:!0}):E.push(Z)}function I(E,$,Z,oe){if(!("@id"in Z))return!1;const se=E.subjects[Z["@id"]];return se&&R(E,se,$,oe)}function X(E,$){const Z=$["@value"],oe=$["@type"],se=$["@language"],te=E["@value"]?P.isArray(E["@value"])?E["@value"]:[E["@value"]]:[],Ce=E["@type"]?P.isArray(E["@type"])?E["@type"]:[E["@type"]]:[],me=E["@language"]?P.isArray(E["@language"])?E["@language"]:[E["@language"]]:[];return 0===te.length&&0===Ce.length&&0===me.length||!(!te.includes(Z)&&!P.isEmptyObject(te[0])||!(!oe&&0===Ce.length||Ce.includes(oe)||oe&&P.isEmptyObject(Ce[0]))||!(!se&&0===me.length||me.includes(se)||se&&P.isEmptyObject(me[0])))}Se.exports=A,A.frameMergedOrDefault=(E,$,Z)=>{const oe={options:Z,embedded:!1,graph:"@default",graphMap:{"@default":{}},subjectStack:[],link:{},bnodeMap:{}},se=new Q.IdentifierIssuer("_:b");x(E,oe.graphMap,"@default",se),Z.merged&&(oe.graphMap["@merged"]=O(oe.graphMap),oe.graph="@merged"),oe.subjects=oe.graphMap[oe.graph];const te=[];return A.frame(oe,Object.keys(oe.subjects).sort(),$,te),Z.pruneBlankNodeIdentifiers&&(Z.bnodesToClear=Object.keys(oe.bnodeMap).filter(Ce=>1===oe.bnodeMap[Ce].length)),Z.link={},ce(te,Z)},A.frame=(E,$,Z,oe,se=null)=>{T(Z);const te=E.options,Ce={embed:S(Z=Z[0],te,"embed"),explicit:S(Z,te,"explicit"),requireAll:S(Z,te,"requireAll")};E.link.hasOwnProperty(E.graph)||(E.link[E.graph]={});const me=E.link[E.graph],ne=function(E,$,Z,oe){const se={};for(const te of $){const Ce=E.graphMap[E.graph][te];R(E,Ce,Z,oe)&&(se[te]=Ce)}return se}(E,$,Z,Ce),_e=Object.keys(ne).sort();for(const Ie of _e){const Ge=ne[Ie];if(null===se?E.uniqueEmbeds={[E.graph]:{}}:E.uniqueEmbeds[E.graph]=E.uniqueEmbeds[E.graph]||{},"@link"===Ce.embed&&Ie in me){D(oe,se,me[Ie]);continue}const st={"@id":Ie};if(0===Ie.indexOf("_:")&&Q.addValue(E.bnodeMap,Ie,st,{propertyIsArray:!0}),me[Ie]=st,("@first"===Ce.embed||"@last"===Ce.embed)&&E.is11)throw new v("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:Z});if(E.embedded||!E.uniqueEmbeds[E.graph].hasOwnProperty(Ie)){if(E.embedded&&("@never"===Ce.embed||y(Ge,E.graph,E.subjectStack))){D(oe,se,st);continue}if(E.embedded&&("@first"==Ce.embed||"@once"==Ce.embed)&&E.uniqueEmbeds[E.graph].hasOwnProperty(Ie)){D(oe,se,st);continue}if("@last"===Ce.embed&&Ie in E.uniqueEmbeds[E.graph]&&K(E,Ie),E.uniqueEmbeds[E.graph][Ie]={parent:oe,property:se},E.subjectStack.push({subject:Ge,graph:E.graph}),Ie in E.graphMap){let Xe=!1,tt=null;"@graph"in Z?(tt=Z["@graph"][0],Xe=!("@merged"===Ie||"@default"===Ie),P.isObject(tt)||(tt={})):(Xe="@merged"!==E.graph,tt={}),Xe&&A.frame(Cn(ot({},E),{graph:Ie,embedded:!1}),Object.keys(E.graphMap[Ie]).sort(),[tt],st,"@graph")}"@included"in Z&&A.frame(Cn(ot({},E),{embedded:!1}),$,Z["@included"],st,"@included");for(const Xe of Object.keys(Ge).sort())if(W(Xe)){if(st[Xe]=Q.clone(Ge[Xe]),"@type"===Xe)for(const tt of Ge["@type"])0===tt.indexOf("_:")&&Q.addValue(E.bnodeMap,tt,st,{propertyIsArray:!0})}else if(!Ce.explicit||Xe in Z)for(const tt of Ge[Xe]){const Ye=Xe in Z?Z[Xe]:b(Ce);if(j.isList(tt)){const Ue=Z[Xe]&&Z[Xe][0]&&Z[Xe][0]["@list"]?Z[Xe][0]["@list"]:b(Ce),ke={"@list":[]};D(st,Xe,ke);const Ke=tt["@list"];for(const Me of Ke)j.isSubjectReference(Me)?A.frame(Cn(ot({},E),{embedded:!0}),[Me["@id"]],Ue,ke,"@list"):D(ke,"@list",Q.clone(Me))}else j.isSubjectReference(tt)?A.frame(Cn(ot({},E),{embedded:!0}),[tt["@id"]],Ye,st,Xe):X(Ye[0],tt)&&D(st,Xe,Q.clone(tt))}for(const Xe of Object.keys(Z).sort()){if("@type"===Xe){if(!P.isObject(Z[Xe][0])||!("@default"in Z[Xe][0]))continue}else if(W(Xe))continue;const tt=Z[Xe][0]||{};if(!S(tt,te,"omitDefault")&&!(Xe in st)){let Ue="@null";"@default"in tt&&(Ue=Q.clone(tt["@default"])),P.isArray(Ue)||(Ue=[Ue]),st[Xe]=[{"@preserve":Ue}]}}for(const Xe of Object.keys(Z["@reverse"]||{}).sort()){const tt=Z["@reverse"][Xe];for(const Ye of Object.keys(E.subjects))Q.getValues(E.subjects[Ye],Xe).some(ke=>ke["@id"]===Ie)&&(st["@reverse"]=st["@reverse"]||{},Q.addValue(st["@reverse"],Xe,[],{propertyIsArray:!0}),A.frame(Cn(ot({},E),{embedded:!0}),[Ye],tt,st["@reverse"][Xe],se))}D(oe,se,st),E.subjectStack.pop()}}},A.cleanupNull=(E,$)=>{if(P.isArray(E))return E.map(oe=>A.cleanupNull(oe,$)).filter(oe=>oe);if("@null"===E)return null;if(P.isObject(E)){if("@id"in E){const Z=E["@id"];if($.link.hasOwnProperty(Z)){const oe=$.link[Z].indexOf(E);if(-1!==oe)return $.link[Z][oe];$.link[Z].push(E)}else $.link[Z]=[E]}for(const Z in E)E[Z]=A.cleanupNull(E[Z],$)}return E}},{"./JsonLdError":12,"./context":19,"./graphTypes":25,"./nodeMap":27,"./types":30,"./url":31,"./util":32}],24:[function(Y,Se,he){"use strict";const W=Y("./JsonLdError"),j=Y("./graphTypes"),P=Y("./types"),Q=Y("./util"),{RDF_LIST:z,RDF_FIRST:v,RDF_REST:x,RDF_NIL:O,RDF_TYPE:A,RDF_JSON_LITERAL:b,XSD_BOOLEAN:y,XSD_DOUBLE:S,XSD_INTEGER:T,XSD_STRING:V}=Y("./constants"),R=/^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$/,K={};function ce(D,I,X){if(D.termType.endsWith("Node"))return{"@id":D.value};const E={"@value":D.value};if(D.language)E["@language"]=D.language;else{let $=D.datatype.value;if($||($=V),$===b){$="@json";try{E["@value"]=JSON.parse(E["@value"])}catch(Z){throw new W("JSON literal could not be parsed.","jsonld.InvalidJsonLiteral",{code:"invalid JSON literal",value:E["@value"],cause:Z})}}if(I){if($===y)"true"===E["@value"]?E["@value"]=!0:"false"===E["@value"]&&(E["@value"]=!1);else if(P.isNumeric(E["@value"]))if($===T){const Z=parseInt(E["@value"],10);Z.toFixed(0)===E["@value"]&&(E["@value"]=Z)}else $===S&&(E["@value"]=parseFloat(E["@value"]));[y,T,S,V].includes($)||(E["@type"]=$)}else if("i18n-datatype"===X&&$.startsWith("https://www.w3.org/ns/i18n#")){const[,Z,oe]=$.split(/[#_]/);Z.length>0&&(E["@language"]=Z,Z.match(R)||console.warn(`@language must be valid BCP47: ${Z}`)),E["@direction"]=oe}else $!==V&&(E["@type"]=$)}return E}Se.exports=K,K.fromRDF=function(){var D=yt(function*(I,{useRdfType:X=!1,useNativeTypes:E=!1,rdfDirection:$=null}){const Z={},oe={"@default":Z},se={};for(const me of I){const ne="DefaultGraph"===me.graph.termType?"@default":me.graph.value;ne in oe||(oe[ne]={}),"@default"!==ne&&!(ne in Z)&&(Z[ne]={"@id":ne});const _e=oe[ne],Ie=me.subject.value,Ge=me.predicate.value,st=me.object;Ie in _e||(_e[Ie]={"@id":Ie});const Xe=_e[Ie],tt=st.termType.endsWith("Node");if(tt&&!(st.value in _e)&&(_e[st.value]={"@id":st.value}),Ge===A&&!X&&tt){Q.addValue(Xe,"@type",st.value,{propertyIsArray:!0});continue}const Ye=ce(st,E,$);if(Q.addValue(Xe,Ge,Ye,{propertyIsArray:!0}),tt)if(st.value===O){const Ue=_e[st.value];"usages"in Ue||(Ue.usages=[]),Ue.usages.push({node:Xe,property:Ge,value:Ye})}else se[st.value]=!(st.value in se)&&{node:Xe,property:Ge,value:Ye}}for(const me in oe){const ne=oe[me];if(!(O in ne))continue;const _e=ne[O];if(_e.usages){for(let Ie of _e.usages){let Ge=Ie.node,st=Ie.property,Xe=Ie.value;const tt=[],Ye=[];let Ue=Object.keys(Ge).length;for(;st===x&&P.isObject(se[Ge["@id"]])&&P.isArray(Ge[v])&&1===Ge[v].length&&P.isArray(Ge[x])&&1===Ge[x].length&&(3===Ue||4===Ue&&P.isArray(Ge["@type"])&&1===Ge["@type"].length&&Ge["@type"][0]===z)&&(tt.push(Ge[v][0]),Ye.push(Ge["@id"]),Ie=se[Ge["@id"]],Ge=Ie.node,st=Ie.property,Xe=Ie.value,Ue=Object.keys(Ge).length,j.isBlankNode(Ge)););delete Xe["@id"],Xe["@list"]=tt.reverse();for(const ke of Ye)delete ne[ke]}delete _e.usages}}const te=[],Ce=Object.keys(Z).sort();for(const me of Ce){const ne=Z[me];if(me in oe){const _e=ne["@graph"]=[],Ie=oe[me],Ge=Object.keys(Ie).sort();for(const st of Ge){const Xe=Ie[st];j.isSubjectReference(Xe)||_e.push(Xe)}}j.isSubjectReference(ne)||te.push(ne)}return te});return function(I,X){return D.apply(this,arguments)}}()},{"./JsonLdError":12,"./constants":18,"./graphTypes":25,"./types":30,"./util":32}],25:[function(Y,Se,he){"use strict";const W=Y("./types"),j={};Se.exports=j,j.isSubject=P=>!(!W.isObject(P)||"@value"in P||"@set"in P||"@list"in P)&&(Object.keys(P).length>1||!("@id"in P)),j.isSubjectReference=P=>W.isObject(P)&&1===Object.keys(P).length&&"@id"in P,j.isValue=P=>W.isObject(P)&&"@value"in P,j.isList=P=>W.isObject(P)&&"@list"in P,j.isGraph=P=>W.isObject(P)&&"@graph"in P&&1===Object.keys(P).filter(Q=>"@id"!==Q&&"@index"!==Q).length,j.isSimpleGraph=P=>j.isGraph(P)&&!("@id"in P),j.isBlankNode=P=>!!W.isObject(P)&&("@id"in P?0===P["@id"].indexOf("_:"):0===Object.keys(P).length||!("@value"in P||"@set"in P||"@list"in P))},{"./types":30}],26:[function(Y,Se,he){const W=Y("rdf-canonize"),j=Y("./platform"),P=Y("./util"),Q=Y("./ContextResolver"),z=P.IdentifierIssuer,v=Y("./JsonLdError"),x=Y("lru-cache"),O=Y("./NQuads"),{expand:A}=Y("./expand"),{flatten:b}=Y("./flatten"),{fromRDF:y}=Y("./fromRdf"),{toRDF:S}=Y("./toRdf"),{frameMergedOrDefault:T,cleanupNull:V}=Y("./frame"),{isArray:R,isObject:K,isString:ce}=Y("./types"),{isSubjectReference:D}=Y("./graphTypes"),{expandIri:I,getInitialContext:X,process:E,processingMode:$}=Y("./context"),{compact:Z,compactIri:oe}=Y("./compact"),{createNodeMap:se,createMergedNodeMap:te,mergeNodeMaps:Ce}=Y("./nodeMap"),me=function(_e){const Ie={},st=new x({max:100});function Xe(tt,ke){var Ke=ke,{documentLoader:Ye=_e.documentLoader}=Ke,Ue=zq(Ke,["documentLoader"]);return Object.assign({},{documentLoader:Ye},Ue,tt)}return _e.compact=function(){var tt=yt(function*(Ye,Ue,ke){if(arguments.length<2)throw new TypeError("Could not compact, too few arguments.");if(null===Ue)throw new v("The compaction context must not be null.","jsonld.CompactError",{code:"invalid local context"});if(null===Ye)return null;let Ke;(ke=Xe(ke,{base:ce(Ye)?Ye:"",compactArrays:!0,compactToRelative:!0,graph:!1,skipExpansion:!1,link:!1,issuer:new z("_:b"),contextResolver:new Q({sharedCache:st})})).link&&(ke.skipExpansion=!0),ke.compactToRelative||delete ke.base,Ke=ke.skipExpansion?Ye:yield _e.expand(Ye,ke);const Me=yield _e.processContext(X(ke),Ue,ke);let Ve=yield Z({activeCtx:Me,element:Ke,options:ke,compactionMap:ke.compactionMap});ke.compactArrays&&!ke.graph&&R(Ve)?1===Ve.length?Ve=Ve[0]:0===Ve.length&&(Ve={}):ke.graph&&K(Ve)&&(Ve=[Ve]),K(Ue)&&"@context"in Ue&&(Ue=Ue["@context"]),Ue=P.clone(Ue),R(Ue)||(Ue=[Ue]);const $e=Ue;Ue=[];for(let q=0;q<$e.length;++q)(!K($e[q])||Object.keys($e[q]).length>0)&&Ue.push($e[q]);const Ne=Ue.length>0;if(1===Ue.length&&(Ue=Ue[0]),R(Ve)){const q=oe({activeCtx:Me,iri:"@graph",relativeTo:{vocab:!0}}),G=Ve;Ve={},Ne&&(Ve["@context"]=Ue),Ve[q]=G}else if(K(Ve)&&Ne){const q=Ve;Ve={"@context":Ue};for(const G in q)Ve[G]=q[G]}return Ve});return function(Ye,Ue,ke){return tt.apply(this,arguments)}}(),_e.expand=function(){var tt=yt(function*(Ye,Ue){if(arguments.length<1)throw new TypeError("Could not expand, too few arguments.");!1===(Ue=Xe(Ue,{keepFreeFloatingNodes:!1,contextResolver:new Q({sharedCache:st})})).expansionMap&&(Ue.expansionMap=void 0);const ke={},Ke=[];if("expandContext"in Ue){const Ne=P.clone(Ue.expandContext);ke.expandContext=K(Ne)&&"@context"in Ne?Ne:{"@context":Ne},Ke.push(ke.expandContext)}let Me;if(ce(Ye)){const Ne=yield _e.get(Ye,Ue);Me=Ne.documentUrl,ke.input=Ne.document,Ne.contextUrl&&(ke.remoteContext={"@context":Ne.contextUrl},Ke.push(ke.remoteContext))}else ke.input=P.clone(Ye);"base"in Ue||(Ue.base=Me||"");let Ve=X(Ue);for(const Ne of Ke)Ve=yield E({activeCtx:Ve,localCtx:Ne,options:Ue});let $e=yield A({activeCtx:Ve,element:ke.input,options:Ue,expansionMap:Ue.expansionMap});return K($e)&&"@graph"in $e&&1===Object.keys($e).length?$e=$e["@graph"]:null===$e&&($e=[]),R($e)||($e=[$e]),$e});return function(Ye,Ue){return tt.apply(this,arguments)}}(),_e.flatten=function(){var tt=yt(function*(Ye,Ue,ke){if(arguments.length<1)return new TypeError("Could not flatten, too few arguments.");Ue="function"==typeof Ue?null:Ue||null,ke=Xe(ke,{base:ce(Ye)?Ye:"",contextResolver:new Q({sharedCache:st})});const Ke=yield _e.expand(Ye,ke),Me=b(Ke);return null===Ue?Me:(ke.graph=!0,ke.skipExpansion=!0,yield _e.compact(Me,Ue,ke))});return function(Ye,Ue,ke){return tt.apply(this,arguments)}}(),_e.frame=function(){var tt=yt(function*(Ye,Ue,ke){if(arguments.length<2)throw new TypeError("Could not frame, too few arguments.");if(ke=Xe(ke,{base:ce(Ye)?Ye:"",embed:"@once",explicit:!1,requireAll:!1,omitDefault:!1,bnodesToClear:[],contextResolver:new Q({sharedCache:st})}),ce(Ue)){const ue=yield _e.get(Ue,ke);if(Ue=ue.document,ue.contextUrl){let je=Ue["@context"];je?R(je)?je.push(ue.contextUrl):je=[je,ue.contextUrl]:je=ue.contextUrl,Ue["@context"]=je}}const Ke=Ue&&Ue["@context"]||{},Me=yield _e.processContext(X(ke),Ke,ke);ke.hasOwnProperty("omitGraph")||(ke.omitGraph=$(Me,1.1)),ke.hasOwnProperty("pruneBlankNodeIdentifiers")||(ke.pruneBlankNodeIdentifiers=$(Me,1.1));const Ve=yield _e.expand(Ye,ke),$e=ot({},ke);$e.isFrame=!0,$e.keepFreeFloatingNodes=!0;const Ne=yield _e.expand(Ue,$e),q=Object.keys(Ue).map(ue=>I(Me,ue,{vocab:!0}));$e.merged=!q.includes("@graph"),$e.is11=$(Me,1.1);const G=T(Ve,Ne,$e);$e.graph=!ke.omitGraph,$e.skipExpansion=!0,$e.link={},$e.framing=!0;let pe=yield _e.compact(G,Ke,$e);return $e.link={},pe=V(pe,$e),pe});return function(Ye,Ue,ke){return tt.apply(this,arguments)}}(),_e.link=function(){var tt=yt(function*(Ye,Ue,ke){const Ke={};return Ue&&(Ke["@context"]=Ue),Ke["@embed"]="@link",_e.frame(Ye,Ke,ke)});return function(Ye,Ue,ke){return tt.apply(this,arguments)}}(),_e.normalize=_e.canonize=function(){var tt=yt(function*(Ye,Ue){if(arguments.length<1)throw new TypeError("Could not canonize, too few arguments.");if("inputFormat"in(Ue=Xe(Ue,{base:ce(Ye)?Ye:"",algorithm:"URDNA2015",skipExpansion:!1,contextResolver:new Q({sharedCache:st})}))){if("application/n-quads"!==Ue.inputFormat&&"application/nquads"!==Ue.inputFormat)throw new v("Unknown canonicalization input format.","jsonld.CanonizeError");const Me=O.parse(Ye);return W.canonize(Me,Ue)}const ke=ot({},Ue);delete ke.format,ke.produceGeneralizedRdf=!1;const Ke=yield _e.toRDF(Ye,ke);return W.canonize(Ke,Ue)});return function(Ye,Ue){return tt.apply(this,arguments)}}(),_e.fromRDF=function(){var tt=yt(function*(Ye,Ue){if(arguments.length<1)throw new TypeError("Could not convert from RDF, too few arguments.");Ue=Xe(Ue,{format:ce(Ye)?"application/n-quads":void 0});const{format:ke}=Ue;let{rdfParser:Ke}=Ue;if(ke){if(Ke=Ke||Ie[ke],!Ke)throw new v("Unknown input format.","jsonld.UnknownFormat",{format:ke})}else Ke=()=>Ye;const Me=yield Ke(Ye);return y(Me,Ue)});return function(Ye,Ue){return tt.apply(this,arguments)}}(),_e.toRDF=function(){var tt=yt(function*(Ye,Ue){if(arguments.length<1)throw new TypeError("Could not convert to RDF, too few arguments.");let ke;ke=(Ue=Xe(Ue,{base:ce(Ye)?Ye:"",skipExpansion:!1,contextResolver:new Q({sharedCache:st})})).skipExpansion?Ye:yield _e.expand(Ye,Ue);const Ke=S(ke,Ue);if(Ue.format){if("application/n-quads"===Ue.format||"application/nquads"===Ue.format)return O.serialize(Ke);throw new v("Unknown output format.","jsonld.UnknownFormat",{format:Ue.format})}return Ke});return function(Ye,Ue){return tt.apply(this,arguments)}}(),_e.createNodeMap=function(){var tt=yt(function*(Ye,Ue){if(arguments.length<1)throw new TypeError("Could not create node map, too few arguments.");Ue=Xe(Ue,{base:ce(Ye)?Ye:"",contextResolver:new Q({sharedCache:st})});const ke=yield _e.expand(Ye,Ue);return te(ke,Ue)});return function(Ye,Ue){return tt.apply(this,arguments)}}(),_e.merge=function(){var tt=yt(function*(Ye,Ue,ke){if(arguments.length<1)throw new TypeError("Could not merge, too few arguments.");if(!R(Ye))throw new TypeError('Could not merge, "docs" must be an array.');Ue="function"==typeof Ue?null:Ue||null,ke=Xe(ke,{contextResolver:new Q({sharedCache:st})});const Ke=yield Promise.all(Ye.map(ue=>{const je=ot({},ke);return _e.expand(ue,je)}));let Me=!0;"mergeNodes"in ke&&(Me=ke.mergeNodes);const Ve=ke.issuer||new z("_:b"),$e={"@default":{}};for(let ue=0;ue_e._documentLoader,set:tt=>_e._documentLoader=tt}),_e.documentLoader=function(){var tt=yt(function*(Ye){throw new v("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 tt.apply(this,arguments)}}(),_e.get=function(){var tt=yt(function*(Ye,Ue){let ke;ke="function"==typeof Ue.documentLoader?Ue.documentLoader:_e.documentLoader;const Ke=yield ke(Ye);try{if(!Ke.document)throw new v("No remote document found at the given URL.","jsonld.NullRemoteDocument");ce(Ke.document)&&(Ke.document=JSON.parse(Ke.document))}catch(Me){throw new v("Could not retrieve a JSON-LD document from the URL.","jsonld.LoadDocumentError",{code:"loading document failed",cause:Me,remoteDoc:Ke})}return Ke});return function(Ye,Ue){return tt.apply(this,arguments)}}(),_e.processContext=function(){var tt=yt(function*(Ye,Ue,ke){return ke=Xe(ke,{base:"",contextResolver:new Q({sharedCache:st})}),null===Ue?X(ke):(Ue=P.clone(Ue),K(Ue)&&"@context"in Ue||(Ue={"@context":Ue}),E({activeCtx:Ye,localCtx:Ue,options:ke}))});return function(Ye,Ue,ke){return tt.apply(this,arguments)}}(),_e.getContextValue=Y("./context").getContextValue,_e.documentLoaders={},_e.useDocumentLoader=function(tt){if(!(tt in _e.documentLoaders))throw new v('Unknown document loader type: "'+tt+'"',"jsonld.UnknownDocumentLoader",{type:tt});_e.documentLoader=_e.documentLoaders[tt].apply(_e,Array.prototype.slice.call(arguments,1))},_e.registerRDFParser=function(tt,Ye){Ie[tt]=Ye},_e.unregisterRDFParser=function(tt){delete Ie[tt]},_e.registerRDFParser("application/n-quads",O.parse),_e.registerRDFParser("application/nquads",O.parse),_e.url=Y("./url"),_e.util=P,Object.assign(_e,P),_e.promises=_e,_e.RequestQueue=Y("./RequestQueue"),_e.JsonLdProcessor=Y("./JsonLdProcessor")(_e),j.setupGlobals(_e),j.setupDocumentLoaders(_e),_e},ne=function(){return me(function(){return ne()})};me(ne),Se.exports=ne},{"./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,Se,he){"use strict";const{isKeyword:W}=Y("./context"),j=Y("./graphTypes"),P=Y("./types"),Q=Y("./util"),z=Y("./JsonLdError"),v={};Se.exports=v,v.createMergedNodeMap=(x,O)=>{const A=(O=O||{}).issuer||new Q.IdentifierIssuer("_:b"),b={"@default":{}};return v.createNodeMap(x,b,"@default",A),v.mergeNodeMaps(b)},v.createNodeMap=(x,O,A,b,y,S)=>{if(P.isArray(x)){for(const K of x)v.createNodeMap(K,O,A,b,void 0,S);return}if(!P.isObject(x))return void(S&&S.push(x));if(j.isValue(x)){if("@type"in x){let K=x["@type"];0===K.indexOf("_:")&&(x["@type"]=K=b.getId(K))}return void(S&&S.push(x))}if(S&&j.isList(x)){const K=[];return v.createNodeMap(x["@list"],O,A,b,y,K),void S.push({"@list":K})}if("@type"in x){const K=x["@type"];for(const ce of K)0===ce.indexOf("_:")&&b.getId(ce)}P.isUndefined(y)&&(y=j.isBlankNode(x)?b.getId(x["@id"]):x["@id"]),S&&S.push({"@id":y});const T=O[A],V=T[y]=T[y]||{};V["@id"]=y;const R=Object.keys(x).sort();for(let K of R){if("@id"===K)continue;if("@reverse"===K){const D={"@id":y},I=x["@reverse"];for(const X in I){const E=I[X];for(const $ of E){let Z=$["@id"];j.isBlankNode($)&&(Z=b.getId(Z)),v.createNodeMap($,O,A,b,Z),Q.addValue(T[Z],X,D,{propertyIsArray:!0,allowDuplicate:!1})}}continue}if("@graph"===K){y in O||(O[y]={}),v.createNodeMap(x[K],O,y,b);continue}if("@included"===K){v.createNodeMap(x[K],O,A,b);continue}if("@type"!==K&&W(K)){if("@index"===K&&K in V&&(x[K]!==V[K]||x[K]["@id"]!==V[K]["@id"]))throw new z("Invalid JSON-LD syntax; conflicting @index property detected.","jsonld.SyntaxError",{code:"conflicting indexes",subject:V});V[K]=x[K];continue}const ce=x[K];if(0===K.indexOf("_:")&&(K=b.getId(K)),0!==ce.length)for(let D of ce)if("@type"===K&&(D=0===D.indexOf("_:")?b.getId(D):D),j.isSubject(D)||j.isSubjectReference(D)){if("@id"in D&&!D["@id"])continue;const I=j.isBlankNode(D)?b.getId(D["@id"]):D["@id"];Q.addValue(V,K,{"@id":I},{propertyIsArray:!0,allowDuplicate:!1}),v.createNodeMap(D,O,A,b,I)}else if(j.isValue(D))Q.addValue(V,K,D,{propertyIsArray:!0,allowDuplicate:!1});else if(j.isList(D)){const I=[];v.createNodeMap(D["@list"],O,A,b,y,I),D={"@list":I},Q.addValue(V,K,D,{propertyIsArray:!0,allowDuplicate:!1})}else v.createNodeMap(D,O,A,b,y),Q.addValue(V,K,D,{propertyIsArray:!0,allowDuplicate:!1});else Q.addValue(V,K,[],{propertyIsArray:!0})}},v.mergeNodeMapGraphs=x=>{const O={};for(const A of Object.keys(x).sort())for(const b of Object.keys(x[A]).sort()){const y=x[A][b];b in O||(O[b]={"@id":b});const S=O[b];for(const T of Object.keys(y).sort())if(W(T)&&"@type"!==T)S[T]=Q.clone(y[T]);else for(const V of y[T])Q.addValue(S,T,Q.clone(V),{propertyIsArray:!0,allowDuplicate:!1})}return O},v.mergeNodeMaps=x=>{const O=x["@default"],A=Object.keys(x).sort();for(const b of A){if("@default"===b)continue;const y=x[b];let S=O[b];S?"@graph"in S||(S["@graph"]=[]):O[b]=S={"@id":b,"@graph":[]};const T=S["@graph"];for(const V of Object.keys(y).sort()){const R=y[V];j.isSubjectReference(R)||T.push(R)}}return O}},{"./JsonLdError":12,"./context":19,"./graphTypes":25,"./types":30,"./util":32}],28:[function(Y,Se,he){"use strict";const W=Y("./documentLoaders/xhr"),j={};Se.exports=j,j.setupDocumentLoaders=function(P){"undefined"!=typeof XMLHttpRequest&&(P.documentLoaders.xhr=W,P.useDocumentLoader("xhr"))},j.setupGlobals=function(P){void 0===globalThis.JsonLdProcessor&&Object.defineProperty(globalThis,"JsonLdProcessor",{writable:!0,enumerable:!1,configurable:!0,value:P.JsonLdProcessor})}},{"./documentLoaders/xhr":20}],29:[function(Y,Se,he){"use strict";const{createNodeMap:W}=Y("./nodeMap"),{isKeyword:j}=Y("./context"),P=Y("./graphTypes"),Q=Y("canonicalize"),z=Y("./types"),v=Y("./util"),{RDF_FIRST:x,RDF_REST:O,RDF_NIL:A,RDF_TYPE:b,RDF_JSON_LITERAL:y,RDF_LANGSTRING:S,XSD_BOOLEAN:T,XSD_DOUBLE:V,XSD_INTEGER:R,XSD_STRING:K}=Y("./constants"),{isAbsolute:ce}=Y("./url"),D={};function I($,Z,oe,se,te){const Ce=Object.keys(Z).sort();for(const me of Ce){const ne=Z[me],_e=Object.keys(ne).sort();for(let Ie of _e){const Ge=ne[Ie];if("@type"===Ie)Ie=b;else if(j(Ie))continue;for(const st of Ge){const Xe={termType:me.startsWith("_:")?"BlankNode":"NamedNode",value:me};if(!ce(me))continue;const tt={termType:Ie.startsWith("_:")?"BlankNode":"NamedNode",value:Ie};if(!ce(Ie)||"BlankNode"===tt.termType&&!te.produceGeneralizedRdf)continue;const Ye=E(st,se,$,oe,te.rdfDirection);Ye&&$.push({subject:Xe,predicate:tt,object:Ye,graph:oe})}}}}function E($,Z,oe,se,te){const Ce={};if(P.isValue($)){Ce.termType="Literal",Ce.value=void 0,Ce.datatype={termType:"NamedNode"};let me=$["@value"];const ne=$["@type"]||null;"@json"===ne?(Ce.value=Q(me),Ce.datatype.value=y):z.isBoolean(me)?(Ce.value=me.toString(),Ce.datatype.value=ne||T):z.isDouble(me)||ne===V?(z.isDouble(me)||(me=parseFloat(me)),Ce.value=me.toExponential(15).replace(/(\d)0*e\+?/,"$1E"),Ce.datatype.value=ne||V):z.isNumber(me)?(Ce.value=me.toFixed(0),Ce.datatype.value=ne||R):"i18n-datatype"===te&&"@direction"in $?(Ce.datatype.value="https://www.w3.org/ns/i18n#"+($["@language"]||"")+`_${$["@direction"]}`,Ce.value=me):"@language"in $?(Ce.value=me,Ce.datatype.value=ne||S,Ce.language=$["@language"]):(Ce.value=me,Ce.datatype.value=ne||K)}else if(P.isList($)){const me=function($,Z,oe,se,te){const Ce={termType:"NamedNode",value:x},me={termType:"NamedNode",value:O},ne={termType:"NamedNode",value:A},_e=$.pop(),Ie=_e?{termType:"BlankNode",value:Z.getId()}:ne;let Ge=Ie;for(const st of $){const Xe=E(st,Z,oe,se,te),tt={termType:"BlankNode",value:Z.getId()};oe.push({subject:Ge,predicate:Ce,object:Xe,graph:se}),oe.push({subject:Ge,predicate:me,object:tt,graph:se}),Ge=tt}if(_e){const st=E(_e,Z,oe,se,te);oe.push({subject:Ge,predicate:Ce,object:st,graph:se}),oe.push({subject:Ge,predicate:me,object:ne,graph:se})}return Ie}($["@list"],Z,oe,se,te);Ce.termType=me.termType,Ce.value=me.value}else{const me=z.isObject($)?$["@id"]:$;Ce.termType=me.startsWith("_:")?"BlankNode":"NamedNode",Ce.value=me}return"NamedNode"!==Ce.termType||ce(Ce.value)?Ce:null}Se.exports=D,D.toRDF=($,Z)=>{const oe=new v.IdentifierIssuer("_:b"),se={"@default":{}};W($,se,"@default",oe);const te=[],Ce=Object.keys(se).sort();for(const me of Ce){let ne;if("@default"===me)ne={termType:"DefaultGraph",value:""};else{if(!ce(me))continue;ne=me.startsWith("_:")?{termType:"BlankNode"}:{termType:"NamedNode"},ne.value=me}I(te,se[me],ne,oe,Z)}return te}},{"./constants":18,"./context":19,"./graphTypes":25,"./nodeMap":27,"./types":30,"./url":31,"./util":32,canonicalize:7}],30:[function(Y,Se,he){"use strict";const W={};Se.exports=W,W.isArray=Array.isArray,W.isBoolean=j=>"boolean"==typeof j||"[object Boolean]"===Object.prototype.toString.call(j),W.isDouble=j=>W.isNumber(j)&&(-1!==String(j).indexOf(".")||Math.abs(j)>=1e21),W.isEmptyObject=j=>W.isObject(j)&&0===Object.keys(j).length,W.isNumber=j=>"number"==typeof j||"[object Number]"===Object.prototype.toString.call(j),W.isNumeric=j=>!isNaN(parseFloat(j))&&isFinite(j),W.isObject=j=>"[object Object]"===Object.prototype.toString.call(j),W.isString=j=>"string"==typeof j||"[object String]"===Object.prototype.toString.call(j),W.isUndefined=j=>void 0===j},{}],31:[function(Y,Se,he){"use strict";const W=Y("./types"),j={};Se.exports=j,j.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*))?))?(?:(((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/}},j.parse=(Q,z)=>{const v={},x=j.parsers[z||"full"],O=x.regex.exec(Q);let A=x.keys.length;for(;A--;)v[x.keys[A]]=void 0===O[A]?null:O[A];return("https"===v.scheme&&"443"===v.port||"http"===v.scheme&&"80"===v.port)&&(v.href=v.href.replace(":"+v.port,""),v.authority=v.authority.replace(":"+v.port,""),v.port=null),v.normalizedPath=j.removeDotSegments(v.path),v},j.prependBase=(Q,z)=>{if(null===Q||j.isAbsolute(z))return z;(!Q||W.isString(Q))&&(Q=j.parse(Q||""));const v=j.parse(z),x={protocol:Q.protocol||""};if(null!==v.authority)x.authority=v.authority,x.path=v.path,x.query=v.query;else if(x.authority=Q.authority,""===v.path)x.path=Q.path,x.query=null!==v.query?v.query:Q.query;else{if(0===v.path.indexOf("/"))x.path=v.path;else{let A=Q.path;A=A.substr(0,A.lastIndexOf("/")+1),(A.length>0||Q.authority)&&"/"!==A.substr(-1)&&(A+="/"),A+=v.path,x.path=A}x.query=v.query}""!==v.path&&(x.path=j.removeDotSegments(x.path));let O=x.protocol;return null!==x.authority&&(O+="//"+x.authority),O+=x.path,null!==x.query&&(O+="?"+x.query),null!==v.fragment&&(O+="#"+v.fragment),""===O&&(O="./"),O},j.removeBase=(Q,z)=>{if(null===Q)return z;(!Q||W.isString(Q))&&(Q=j.parse(Q||""));let v="";if(""!==Q.href?v+=(Q.protocol||"")+"//"+(Q.authority||""):z.indexOf("//")&&(v+="//"),0!==z.indexOf(v))return z;const x=j.parse(z.substr(v.length)),O=Q.normalizedPath.split("/"),A=x.normalizedPath.split("/"),b=x.fragment||x.query?0:1;for(;O.length>0&&A.length>b&&O[0]===A[0];)O.shift(),A.shift();let y="";if(O.length>0){O.pop();for(let S=0;S{if(0===Q.length)return"";const z=Q.split("/"),v=[];for(;z.length>0;){const x=z.shift(),O=0===z.length;"."!==x?".."!==x?v.push(x):(v.pop(),O&&v.push("")):O&&v.push("")}return"/"===Q[0]&&v.length>0&&""!==v[0]&&v.unshift(""),1===v.length&&""===v[0]?"/":v.join("/")};const P=/^([A-Za-z][A-Za-z0-9+-.]*|_):[^\s]*$/;j.isAbsolute=Q=>W.isString(Q)&&P.test(Q),j.isRelative=Q=>W.isString(Q)},{"./types":30}],32:[function(Y,Se,he){"use strict";const W=Y("./graphTypes"),j=Y("./types"),P=Y("rdf-canonize").IdentifierIssuer,Q=Y("./JsonLdError"),z=/(?:<[^>]*?>|"[^"]*?"|[^,])+/g,v=/\s*<([^>]*?)>\s*(?:;\s*(.*))?/,x=/(.*?)=(?:(?:"([^"]*?)")|([^"]*?))\s*(?:(?:;\s*)|$)/g,O_headers={accept:"application/ld+json, application/json"},A={};function b(y,S){if(j.isArray(S))for(let T=0;T{if(Object.keys(y).some(T=>"accept"===T.toLowerCase()))throw new RangeError('Accept header may not be specified; only "'+O_headers.accept+'" is supported.');return Object.assign({Accept:O_headers.accept},y)},A.parseLinkHeader=y=>{const S={},T=y.match(z);for(let V=0;V{if(!(j.isString(y)||j.isArray(y)&&y.every(T=>j.isString(T)))){if(S&&j.isObject(y))switch(Object.keys(y).length){case 0:return;case 1:if("@default"in y&&A.asArray(y["@default"]).every(T=>j.isString(T)))return}throw new Q('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,S)=>{if(y.hasOwnProperty(S)){const T=y[S];return!j.isArray(T)||T.length>0}return!1},A.hasValue=(y,S,T)=>{if(A.hasProperty(y,S)){let V=y[S];const R=W.isList(V);if(j.isArray(V)||R){R&&(V=V["@list"]);for(let K=0;K{if("propertyIsArray"in(V=V||{})||(V.propertyIsArray=!1),"valueIsArray"in V||(V.valueIsArray=!1),"allowDuplicate"in V||(V.allowDuplicate=!0),"prependValue"in V||(V.prependValue=!1),V.valueIsArray)y[S]=T;else if(j.isArray(T)){0===T.length&&V.propertyIsArray&&!y.hasOwnProperty(S)&&(y[S]=[]),V.prependValue&&(T=T.concat(y[S]),y[S]=[]);for(let R=0;R[].concat(y[S]||[]),A.removeProperty=(y,S)=>{delete y[S]},A.removeValue=(y,S,T,V)=>{"propertyIsArray"in(V=V||{})||(V.propertyIsArray=!1);const R=A.getValues(y,S).filter(K=>!A.compareValues(K,T));0===R.length?A.removeProperty(y,S):y[S]=1!==R.length||V.propertyIsArray?R:R[0]},A.relabelBlankNodes=(y,S)=>b((S=S||{}).issuer||new P("_:b"),y),A.compareValues=(y,S)=>!!(y===S||W.isValue(y)&&W.isValue(S)&&y["@value"]===S["@value"]&&y["@type"]===S["@type"]&&y["@language"]===S["@language"]&&y["@index"]===S["@index"])||!!(j.isObject(y)&&"@id"in y&&j.isObject(S)&&"@id"in S)&&y["@id"]===S["@id"],A.compareShortestLeast=(y,S)=>y.length1;const V=(X,E,$)=>{const Z=X[b].get(E);if(Z){const oe=Z.value;if(R(X,oe)){if(ce(X,Z),!X[z])return}else $&&(X[y]&&(Z.value.now=Date.now()),X[A].unshiftNode(Z));return oe.value}},R=(X,E)=>{if(!E||!E.maxAge&&!X[v])return!1;const $=Date.now()-E.now;return E.maxAge?$>E.maxAge:X[v]&&$>X[v]},K=X=>{if(X[P]>X[j])for(let E=X[A].tail;X[P]>X[j]&&null!==E;){const $=E.prev;ce(X,E),E=$}},ce=(X,E)=>{if(E){const $=E.value;X[x]&&X[x]($.key,$.value),X[P]-=$.length,X[b].delete($.key),X[A].removeNode(E)}};class D{constructor(E,$,Z,oe,se){this.key=E,this.value=$,this.length=Z,this.now=oe,this.maxAge=se||0}}const I=(X,E,$,Z)=>{let oe=$.value;R(X,oe)&&(ce(X,$),X[z]||(oe=void 0)),oe&&E.call(Z,oe.value,oe.key,X)};Se.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[j]=E.max||1/0;const Z=E.length||S;if(this[Q]="function"!=typeof Z?S:Z,this[z]=E.stale||!1,E.maxAge&&"number"!=typeof E.maxAge)throw new TypeError("maxAge must be a number");this[v]=E.maxAge||0,this[x]=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[j]=E||1/0,K(this)}get max(){return this[j]}set allowStale(E){this[z]=!!E}get allowStale(){return this[z]}set maxAge(E){if("number"!=typeof E)throw new TypeError("maxAge must be a non-negative number");this[v]=E,K(this)}get maxAge(){return this[v]}set lengthCalculator(E){"function"!=typeof E&&(E=S),E!==this[Q]&&(this[Q]=E,this[P]=0,this[A].forEach($=>{$.length=this[Q]($.value,$.key),this[P]+=$.length})),K(this)}get lengthCalculator(){return this[Q]}get length(){return this[P]}get itemCount(){return this[A].length}rforEach(E,$){$=$||this;for(let Z=this[A].tail;null!==Z;){const oe=Z.prev;I(this,E,Z,$),Z=oe}}forEach(E,$){$=$||this;for(let Z=this[A].head;null!==Z;){const oe=Z.next;I(this,E,Z,$),Z=oe}}keys(){return this[A].toArray().map(E=>E.key)}values(){return this[A].toArray().map(E=>E.value)}reset(){this[x]&&this[A]&&this[A].length&&this[A].forEach(E=>this[x](E.key,E.value)),this[b]=new Map,this[A]=new W,this[P]=0}dump(){return this[A].map(E=>!R(this,E)&&{k:E.key,v:E.value,e:E.now+(E.maxAge||0)}).toArray().filter(E=>E)}dumpLru(){return this[A]}set(E,$,Z){if((Z=Z||this[v])&&"number"!=typeof Z)throw new TypeError("maxAge must be a number");const oe=Z?Date.now():0,se=this[Q]($,E);if(this[b].has(E)){if(se>this[j])return ce(this,this[b].get(E)),!1;const me=this[b].get(E).value;return this[x]&&(this[O]||this[x](E,me.value)),me.now=oe,me.maxAge=Z,me.value=$,this[P]+=se-me.length,me.length=se,this.get(E),K(this),!0}const te=new D(E,$,se,oe,Z);return te.length>this[j]?(this[x]&&this[x](E,$),!1):(this[P]+=te.length,this[A].unshift(te),this[b].set(E,this[A].head),K(this),!0)}has(E){if(!this[b].has(E))return!1;const $=this[b].get(E).value;return!R(this,$)}get(E){return V(this,E,!0)}peek(E){return V(this,E,!1)}pop(){const E=this[A].tail;return E?(ce(this,E),E.value):null}del(E){ce(this,this[b].get(E))}load(E){this.reset();const $=Date.now();for(let Z=E.length-1;Z>=0;Z--){const oe=E[Z],se=oe.e||0;if(0===se)this.set(oe.k,oe.v);else{const te=se-$;te>0&&this.set(oe.k,oe.v,te)}}}prune(){this[b].forEach((E,$)=>V(this,$,!1))}}},{yallist:92}],34:[function(Y,Se,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#",j="http://www.w3.org/2001/XMLSchema#",P="http://www.w3.org/2000/10/swap/";he.default={xsd:{decimal:`${j}decimal`,boolean:`${j}boolean`,double:`${j}double`,integer:`${j}integer`,string:`${j}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:`${P}reify#forSome`,forAll:`${P}reify#forAll`},log:{implies:`${P}log#implies`}}},{}],35:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.default=he.Variable=he.Triple=he.Term=he.Quad=he.NamedNode=he.Literal=he.DefaultGraph=he.BlankNode=void 0,he.escapeQuotes=E,he.termFromId=function D(ne,_e){if(_e=_e||b,!ne)return _e.defaultGraph();switch(ne[0]){case"?":return _e.variable(ne.substr(1));case"_":return _e.blankNode(ne.substr(2));case'"':if(_e===b)return new V(ne);if('"'===ne[ne.length-1])return _e.literal(ne.substr(1,ne.length-2));const Ie=ne.lastIndexOf('"',ne.length-1);return _e.literal(ne.substr(1,Ie-1),"@"===ne[Ie+1]?ne.substr(Ie+2):_e.namedNode(ne.substr(Ie+3)));case"<":const Ge=A.exec(ne);return _e.quad(D($(Ge[1]),_e),D($(Ge[2]),_e),D($(Ge[3]),_e),Ge[4]&&D($(Ge[4]),_e));default:return _e.namedNode(ne)}},he.termToId=function I(ne){if("string"==typeof ne)return ne;if(ne instanceof S&&"Quad"!==ne.termType)return ne.id;if(!ne)return v.id;switch(ne.termType){case"NamedNode":return ne.value;case"BlankNode":return`_:${ne.value}`;case"Variable":return`?${ne.value}`;case"DefaultGraph":return"";case"Literal":return`"${ne.value}"${ne.language?`@${ne.language}`:ne.datatype&&ne.datatype.value!==z.string?`^^${ne.datatype.value}`:""}`;case"Quad":return`<<${E(I(ne.subject))} ${E(I(ne.predicate))} ${E(I(ne.object))}${(0,j.isDefaultGraph)(ne.graph)?"":` ${I(ne.graph)}`}>>`;default:throw new Error(`Unexpected termType: ${ne.termType}`)}},he.unescapeQuotes=$;var ne,W=(ne=Y("./IRIs"))&&ne.__esModule?ne:{default:ne},j=Y("./N3Util");const{rdf:Q,xsd:z}=W.default;let v,x=0;const O=/^"(.*".*)(?="[^"]*$)/,A=/^<<("(?:""|[^"])*"[^ ]*|[^ ]+) ("(?:""|[^"])*"[^ ]*|[^ ]+) ("(?:""|[^"])*"[^ ]*|[^ ]+) ?("(?:""|[^"])*"[^ ]*|[^ ]+)?>>$/,b={namedNode:function(ne){return new T(ne)},blankNode:function(ne){return new R(ne||"n3-"+x++)},variable:function(ne){return new K(ne)},literal:function(ne,_e){if("string"==typeof _e)return new V(`"${ne}"@${_e.toLowerCase()}`);let Ie=_e?_e.value:"";return""===Ie&&("boolean"==typeof ne?Ie=z.boolean:"number"==typeof ne&&(Number.isFinite(ne)?Ie=Number.isInteger(ne)?z.integer:z.double:(Ie=z.double,Number.isNaN(ne)||(ne=ne>0?"INF":"-INF")))),new V(""===Ie||Ie===z.string?`"${ne}"`:`"${ne}"^^${Ie}`)},defaultGraph:function(){return v},quad:me,triple:me};he.default=b;class S{constructor(_e){this.id=_e}get value(){return this.id}equals(_e){return _e instanceof S?this.id===_e.id:!!_e&&this.termType===_e.termType&&this.value===_e.value}hashCode(){return 0}toJSON(){return{termType:this.termType,value:this.value}}}he.Term=S;class T extends S{get termType(){return"NamedNode"}}he.NamedNode=T;class V extends S{get termType(){return"Literal"}get value(){return this.id.substring(1,this.id.lastIndexOf('"'))}get language(){const _e=this.id;let Ie=_e.lastIndexOf('"')+1;return Ie<_e.length&&"@"===_e[Ie++]?_e.substr(Ie).toLowerCase():""}get datatype(){return new T(this.datatypeString)}get datatypeString(){const _e=this.id,Ie=_e.lastIndexOf('"')+1,Ge=Ie<_e.length?_e[Ie]:"";return"^"===Ge?_e.substr(Ie+2):"@"!==Ge?z.string:Q.langString}equals(_e){return _e instanceof V?this.id===_e.id:!!_e&&!!_e.datatype&&this.termType===_e.termType&&this.value===_e.value&&this.language===_e.language&&this.datatype.value===_e.datatype.value}toJSON(){return{termType:this.termType,value:this.value,language:this.language,datatype:{termType:"NamedNode",value:this.datatypeString}}}}he.Literal=V;class R extends S{constructor(_e){super(`_:${_e}`)}get termType(){return"BlankNode"}get value(){return this.id.substr(2)}}he.BlankNode=R;class K extends S{constructor(_e){super(`?${_e}`)}get termType(){return"Variable"}get value(){return this.id.substr(1)}}he.Variable=K;class ce extends S{constructor(){return super(""),v||this}get termType(){return"DefaultGraph"}equals(_e){return this===_e||!!_e&&this.termType===_e.termType}}he.DefaultGraph=ce,v=new ce;class X extends S{constructor(_e,Ie,Ge,st){super(""),this._subject=_e,this._predicate=Ie,this._object=Ge,this._graph=st||v}get termType(){return"Quad"}get subject(){return this._subject}get predicate(){return this._predicate}get object(){return this._object}get graph(){return this._graph}toJSON(){return{termType:this.termType,subject:this._subject.toJSON(),predicate:this._predicate.toJSON(),object:this._object.toJSON(),graph:this._graph.toJSON()}}equals(_e){return!!_e&&this._subject.equals(_e.subject)&&this._predicate.equals(_e.predicate)&&this._object.equals(_e.object)&&this._graph.equals(_e.graph)}}function E(ne){return ne.replace(O,(_e,Ie)=>`"${Ie.replace(/"/g,'""')}`)}function $(ne){return ne.replace(O,(_e,Ie)=>`"${Ie.replace(/""/g,'"')}`)}function me(ne,_e,Ie,Ge){return new X(ne,_e,Ie,Ge)}he.Triple=he.Quad=X},{"./IRIs":34,"./N3Util":41}],36:[function(Y,Se,he){(function(W){(function(){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.default=void 0;var j=Q(Y("./IRIs")),P=Q(Y("queue-microtask"));function Q(S){return S&&S.__esModule?S:{default:S}}const{xsd:z}=j.default,v=/\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{8})|\\([^])/g,x={"\\":"\\","'":"'",'"':'"',n:"\n",r:"\r",t:"\t",f:"\f",b:"\b",_:"_","~":"~",".":".","-":"-","!":"!",$:"$","&":"&","(":"(",")":")","*":"*","+":"+",",":",",";":";","=":"=","/":"/","?":"?","#":"#","@":"@","%":"%"},O=/[\x00-\x20<>\\"\{\}\|\^\`]/,A={_iri:!0,_unescapedIri:!0,_simpleQuotedString:!0,_langcode:!0,_blank:!0,_newline:!0,_comment:!0,_whitespace:!0,_endOfFile:!0},b=/$0^/;he.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 V in this)!(V in A)&&this[V]instanceof RegExp&&(this[V]=b)}else this._n3Mode=!1!==T.n3;this._comments=!!T.comments,this._literalClosingPos=0}_tokenizeToEnd(T,V){let R=this._input,K=R.length;for(;;){let I,X;for(;I=this._newline.exec(R);)this._comments&&(X=this._comment.exec(I[0]))&&ce("comment",X[1],"",this._line,I[0].length),R=R.substr(I[0].length,R.length),K=R.length,this._line++;if(!I&&(I=this._whitespace.exec(R))&&(R=R.substr(I[0].length,R.length)),this._endOfFile.test(R))return V&&(this._comments&&(X=this._comment.exec(R))&&ce("comment",X[1],"",this._line,R.length),R=null,ce("eof","","",this._line,0)),this._input=R;const E=this._line,$=R[0];let Z="",oe="",se="",te=null,Ce=0,me=!1;switch($){case"^":if(R.length<3)break;if("^"!==R[1]){this._n3Mode&&(Ce=1,Z="^");break}if(this._previousMarker="^^",R=R.substr(2),"<"!==R[0]){me=!0;break}case"<":if(te=this._unescapedIri.exec(R))Z="IRI",oe=te[1];else if(te=this._iri.exec(R)){if(oe=this._unescape(te[1]),null===oe||O.test(oe))return D(this);Z="IRI"}else R.length>1&&"<"===R[1]?(Z="<<",Ce=2):this._n3Mode&&R.length>1&&"="===R[1]&&(Z="inverse",Ce=2,oe=">");break;case">":R.length>1&&">"===R[1]&&(Z=">>",Ce=2);break;case"_":((te=this._blank.exec(R))||V&&(te=this._blank.exec(`${R} `)))&&(Z="blank",se="_",oe=te[1]);break;case'"':if(te=this._simpleQuotedString.exec(R))oe=te[1];else if(({value:oe,matchLength:Ce}=this._parseLiteral(R)),null===oe)return D(this);(null!==te||0!==Ce)&&(Z="literal",this._literalClosingPos=0);break;case"'":if(!this._lineMode){if(te=this._simpleApostropheString.exec(R))oe=te[1];else if(({value:oe,matchLength:Ce}=this._parseLiteral(R)),null===oe)return D(this);(null!==te||0!==Ce)&&(Z="literal",this._literalClosingPos=0)}break;case"?":this._n3Mode&&(te=this._variable.exec(R))&&(Z="var",oe=te[0]);break;case"@":"literal"===this._previousMarker&&(te=this._langcode.exec(R))?(Z="langcode",oe=te[1]):(te=this._keyword.exec(R))&&(Z=te[0]);break;case".":if(1===R.length?V:R[1]<"0"||R[1]>"9"){Z=".",Ce=1;break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"+":case"-":(te=this._number.exec(R)||V&&(te=this._number.exec(`${R} `)))&&(Z="literal",oe=te[0],se="string"==typeof te[1]?z.double:"string"==typeof te[2]?z.decimal:z.integer);break;case"B":case"b":case"p":case"P":case"G":case"g":(te=this._sparqlKeyword.exec(R))?Z=te[0].toUpperCase():me=!0;break;case"f":case"t":(te=this._boolean.exec(R))?(Z="literal",oe=te[0],se=z.boolean):me=!0;break;case"a":(te=this._shortPredicates.exec(R))?(Z="abbreviation",oe="a"):me=!0;break;case"=":this._n3Mode&&R.length>1&&(Z="abbreviation",">"!==R[1]?(Ce=1,oe="="):(Ce=2,oe=">"));break;case"!":if(!this._n3Mode)break;case",":case";":case"[":case"]":case"(":case")":case"{":case"}":this._lineMode||(Ce=1,Z=$);break;default:me=!0}if(me&&("@prefix"!==this._previousMarker&&"PREFIX"!==this._previousMarker||!(te=this._prefix.exec(R))?((te=this._prefixed.exec(R))||V&&(te=this._prefixed.exec(`${R} `)))&&(Z="prefixed",se=te[1]||"",oe=this._unescape(te[2])):(Z="prefix",oe=te[1]||"")),"^^"===this._previousMarker)switch(Z){case"prefixed":Z="type";break;case"IRI":Z="typeIRI";break;default:Z=""}if(!Z)return V||!/^'''|^"""/.test(R)&&/\n|\r/.test(R)?D(this):this._input=R;const ne=Ce||te[0].length,_e=ce(Z,oe,se,E,ne);this.previousToken=_e,this._previousMarker=Z,R=R.substr(ne,R.length)}function ce(I,X,E,$,Z){const oe=R?K-R.length:K,te={type:I,value:X,prefix:E,line:$,start:oe,end:oe+Z};return T(null,te),te}function D(I){T(I._syntaxError(/^\S*/.exec(R)[0]))}}_unescape(T){let V=!1;const R=T.replace(v,(K,ce,D,I)=>{if("string"==typeof ce)return String.fromCharCode(Number.parseInt(ce,16));if("string"==typeof D){let X=Number.parseInt(D,16);return X<=65535?String.fromCharCode(Number.parseInt(D,16)):String.fromCharCode(55296+((X-=65536)>>10),56320+(1023&X))}return I in x?x[I]:(V=!0,"")});return V?null:R}_parseLiteral(T){if(T.length>=3){const V=T.match(/^(?:"""|"|'''|'|)/)[0],R=V.length;let K=Math.max(this._literalClosingPos,R);for(;(K=T.indexOf(V,K))>0;){let ce=0;for(;"\\"===T[K-ce-1];)ce++;if(ce%2==0){const D=T.substring(R,K),I=D.split(/\r\n|\r|\n/).length-1,X=K+R;if(1===R&&0!==I||3===R&&this._lineMode)break;return this._line+=I,{value:this._unescape(D),matchLength:X}}K++}this._literalClosingPos=T.length-R+1}return{value:"",matchLength:0}}_syntaxError(T){this._input=null;const V=new Error(`Unexpected "${T}" on line ${this._line}.`);return V.context={token:void 0,line:this._line,previousToken:this.previousToken},V}_readStartingBom(T){return T.startsWith("\ufeff")?T.substr(1):T}tokenize(T,V){if(this._line=1,"string"==typeof T){if(this._input=this._readStartingBom(T),"function"!=typeof V){const R=[];let K;if(this._tokenizeToEnd((ce,D)=>ce?K=ce:R.push(D),!0),K)throw K;return R}(0,P.default)(()=>this._tokenizeToEnd(V,!0))}else this._pendingBuffer=null,"function"==typeof T.setEncoding&&T.setEncoding("utf8"),T.on("data",R=>{null!==this._input&&0!==R.length&&(this._pendingBuffer&&(R=W.concat([this._pendingBuffer,R]),this._pendingBuffer=null),128&R[R.length-1]?this._pendingBuffer=R:(void 0===this._input?this._input=this._readStartingBom("string"==typeof R?R:R.toString()):this._input+=R,this._tokenizeToEnd(V,!1)))}),T.on("end",()=>{"string"==typeof this._input&&this._tokenizeToEnd(V,!0)}),T.on("error",V)}}}).call(this)}).call(this,Y("buffer").Buffer)},{"./IRIs":34,buffer:6,"queue-microtask":45}],37:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.default=void 0;var W=Q(Y("./N3Lexer")),j=Q(Y("./N3DataFactory")),P=Q(Y("./IRIs"));function Q(A){return A&&A.__esModule?A:{default:A}}let z=0;class v{constructor(b){this._contextStack=[],this._graph=null,this._setBase((b=b||{}).baseIRI),b.factory&&O(this,b.factory);const y="string"==typeof b.format?b.format.match(/\w*$/)[0].toLowerCase():"",S=/turtle/.test(y),T=/trig/.test(y),V=/triple/.test(y),R=/quad/.test(y),K=this._n3Mode=/n3/.test(y),ce=V||R;(this._supportsNamedGraphs=!(S||K))||(this._readPredicateOrNamedGraph=this._readPredicate),this._supportsQuads=!(S||T||V||K),this._supportsRDFStar=""===y||/star|\*$/.test(y),ce&&(this._resolveRelativeIRI=D=>null),this._blankNodePrefix="string"!=typeof b.blankNodePrefix?"":b.blankNodePrefix.replace(/^(?!_:)/,"_:"),this._lexer=b.lexer||new W.default({lineMode:ce,n3:K}),this._explicitQuantifiers=!!b.explicitQuantifiers}static _resetBlankNodePrefix(){z=0}_setBase(b){if(b){const y=b.indexOf("#");y>=0&&(b=b.substr(0,y)),this._base=b,this._basePath=b.indexOf("/")<0?b:b.replace(/[^\/?]*(?:\?.*)?$/,""),b=b.match(/^(?:([a-z][a-z0-9+.-]*:))?(?:\/\/[^\/]*)?/i),this._baseRoot=b[0],this._baseScheme=b[1]}else this._base="",this._basePath=""}_saveContext(b,y,S,T,V){const R=this._n3Mode;this._contextStack.push({subject:S,predicate:T,object:V,graph:y,type:b,inverse:!!R&&this._inversePredicate,blankPrefix:R?this._prefixes._:"",quantified:R?this._quantified:null}),R&&(this._inversePredicate=!1,this._prefixes._=this._graph?`${this._graph.id.substr(2)}.`:".",this._quantified=Object.create(this._quantified))}_restoreContext(){const b=this._contextStack.pop(),y=this._n3Mode;this._subject=b.subject,this._predicate=b.predicate,this._object=b.object,this._graph=b.graph,y&&(this._inversePredicate=b.inverse,this._prefixes._=b.blankPrefix,this._quantified=b.quantified)}_readInTopContext(b){switch(b.type){case"eof":return null!==this._graph?this._error("Unclosed graph",b):(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(b)}}_readEntity(b,y){let S;switch(b.type){case"IRI":case"typeIRI":const T=this._resolveIRI(b.value);if(null===T)return this._error("Invalid IRI",b);S=this._namedNode(T);break;case"type":case"prefixed":const V=this._prefixes[b.prefix];if(void 0===V)return this._error(`Undefined prefix "${b.prefix}:"`,b);S=this._namedNode(V+b.value);break;case"blank":S=this._blankNode(this._prefixes[b.prefix]+b.value);break;case"var":S=this._variable(b.value.substr(1));break;default:return this._error(`Expected entity but got ${b.type}`,b)}return!y&&this._n3Mode&&S.id in this._quantified&&(S=this._quantified[S.id]),S}_readSubject(b){switch(this._predicate=null,b.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",b);case"}":return this._readPunctuation(b);case"@forSome":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORSOME,this._quantifier=this._blankNode,this._readQuantifierList):this._error('Unexpected "@forSome"',b);case"@forAll":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORALL,this._quantifier=this._variable,this._readQuantifierList):this._error('Unexpected "@forAll"',b);case"literal":if(!this._n3Mode)return this._error("Unexpected literal",b);if(0===b.prefix.length)return this._literalValue=b.value,this._completeSubjectLiteral;this._subject=this._literal(b.value,this._namedNode(b.prefix));break;case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,null,null,null),this._graph=null,this._readSubject):this._error("Unexpected RDF* syntax",b);default:if(void 0===(this._subject=this._readEntity(b)))return;if(this._n3Mode)return this._getPathReader(this._readPredicateOrNamedGraph)}return this._readPredicateOrNamedGraph}_readPredicate(b){const y=b.type;switch(y){case"inverse":this._inversePredicate=!0;case"abbreviation":this._predicate=this.ABBREVIATIONS[b.value];break;case".":case"]":case"}":return null===this._predicate?this._error(`Unexpected ${y}`,b):(this._subject=null,"]"===y?this._readBlankNodeTail(b):this._readPunctuation(b));case";":return null!==this._predicate?this._readPredicate:this._error("Expected predicate but got ;",b);case"[":if(this._n3Mode)return this._saveContext("blank",this._graph,this._subject,this._subject=this._blankNode(),null),this._readBlankNodeHead;case"blank":if(!this._n3Mode)return this._error("Disallowed blank node as predicate",b);default:if(void 0===(this._predicate=this._readEntity(b)))return}return this._readObject}_readObject(b){switch(b.type){case"literal":if(0===b.prefix.length)return this._literalValue=b.value,this._readDataTypeOrLang;this._object=this._literal(b.value,this._namedNode(b.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",b);case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,this._subject,this._predicate,null),this._graph=null,this._readSubject):this._error("Unexpected RDF* syntax",b);default:if(void 0===(this._object=this._readEntity(b)))return;if(this._n3Mode)return this._getPathReader(this._getContextEndReader())}return this._getContextEndReader()}_readPredicateOrNamedGraph(b){return"{"===b.type?this._readGraph(b):this._readPredicate(b)}_readGraph(b){return"{"!==b.type?this._error(`Expected graph but got ${b.type}`,b):(this._graph=this._subject,this._subject=null,this._readSubject)}_readBlankNodeHead(b){return"]"===b.type?(this._subject=null,this._readBlankNodeTail(b)):(this._predicate=null,this._readPredicate(b))}_readBlankNodeTail(b){if("]"!==b.type)return this._readBlankNodePunctuation(b);null!==this._subject&&this._emit(this._subject,this._predicate,this._object,this._graph);const y=null===this._predicate;return this._restoreContext(),null!==this._object?this._getContextEndReader():null!==this._predicate?this._readObject:y?this._readPredicateOrNamedGraph:this._readPredicateAfterBlank}_readPredicateAfterBlank(b){switch(b.type){case".":case"}":return this._subject=null,this._readPunctuation(b);default:return this._readPredicate(b)}}_readListItem(b){let y=null,S=null,T=this._readListItem;const V=this._subject,R=this._contextStack,K=R[R.length-1];switch(b.type){case"[":this._saveContext("blank",this._graph,S=this._blankNode(),this.RDF_FIRST,this._subject=y=this._blankNode()),T=this._readBlankNodeHead;break;case"(":this._saveContext("list",this._graph,S=this._blankNode(),this.RDF_FIRST,this.RDF_NIL),this._subject=null;break;case")":if(this._restoreContext(),0!==R.length&&"list"===R[R.length-1].type&&this._emit(this._subject,this._predicate,this._object,this._graph),null===this._predicate){if(T=this._readPredicate,this._subject===this.RDF_NIL)return T}else if(T=this._getContextEndReader(),this._object===this.RDF_NIL)return T;S=this.RDF_NIL;break;case"literal":0===b.prefix.length?(this._literalValue=b.value,T=this._readListItemDataTypeOrLang):(y=this._literal(b.value,this._namedNode(b.prefix)),T=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",b);default:if(void 0===(y=this._readEntity(b)))return}if(null===S&&(this._subject=S=this._blankNode()),null===V?null===K.predicate?K.subject=S:K.object=S:this._emit(V,this.RDF_REST,S,this._graph),null!==y){if(this._n3Mode&&("IRI"===b.type||"prefixed"===b.type))return this._saveContext("item",this._graph,S,this.RDF_FIRST,y),this._subject=y,this._predicate=null,this._getPathReader(this._readListItem);this._emit(S,this.RDF_FIRST,y,this._graph)}return T}_readDataTypeOrLang(b){return this._completeObjectLiteral(b,!1)}_readListItemDataTypeOrLang(b){return this._completeObjectLiteral(b,!0)}_completeLiteral(b){let y=this._literal(this._literalValue);switch(b.type){case"type":case"typeIRI":const S=this._readEntity(b);if(void 0===S)return;y=this._literal(this._literalValue,S),b=null;break;case"langcode":y=this._literal(this._literalValue,b.value),b=null}return{token:b,literal:y}}_completeSubjectLiteral(b){return this._subject=this._completeLiteral(b).literal,this._readPredicateOrNamedGraph}_completeObjectLiteral(b,y){const S=this._completeLiteral(b);if(S)return this._object=S.literal,y&&this._emit(this._subject,this.RDF_FIRST,this._object,this._graph),null===S.token?this._getContextEndReader():(this._readCallback=this._getContextEndReader(),this._readCallback(S.token))}_readFormulaTail(b){return"}"!==b.type?this._readPunctuation(b):(null!==this._subject&&this._emit(this._subject,this._predicate,this._object,this._graph),this._restoreContext(),null===this._object?this._readPredicate:this._getContextEndReader())}_readPunctuation(b){let y,S=this._graph;const T=this._subject,V=this._inversePredicate;switch(b.type){case"}":if(null===this._graph)return this._error("Unexpected graph closing",b);if(this._n3Mode)return this._readFormulaTail(b);this._graph=null;case".":this._subject=null,y=this._contextStack.length?this._readSubject:this._readInTopContext,V&&(this._inversePredicate=!1);break;case";":y=this._readPredicate;break;case",":y=this._readObject;break;default:if(this._supportsQuads&&null===this._graph&&void 0!==(S=this._readEntity(b))){y=this._readQuadPunctuation;break}return this._error(`Expected punctuation to follow "${this._object.id}"`,b)}if(null!==T){const R=this._predicate,K=this._object;V?this._emit(K,R,T,S):this._emit(T,R,K,S)}return y}_readBlankNodePunctuation(b){let y;switch(b.type){case";":y=this._readPredicate;break;case",":y=this._readObject;break;default:return this._error(`Expected punctuation to follow "${this._object.id}"`,b)}return this._emit(this._subject,this._predicate,this._object,this._graph),y}_readQuadPunctuation(b){return"."!==b.type?this._error("Expected dot to follow quad",b):this._readInTopContext}_readPrefix(b){return"prefix"!==b.type?this._error("Expected prefix to follow @prefix",b):(this._prefix=b.value,this._readPrefixIRI)}_readPrefixIRI(b){if("IRI"!==b.type)return this._error(`Expected IRI to follow prefix "${this._prefix}:"`,b);const y=this._readEntity(b);return this._prefixes[this._prefix]=y.value,this._prefixCallback(this._prefix,y),this._readDeclarationPunctuation}_readBaseIRI(b){const y="IRI"===b.type&&this._resolveIRI(b.value);return y?(this._setBase(y),this._readDeclarationPunctuation):this._error("Expected valid IRI to follow base declaration",b)}_readNamedGraphLabel(b){switch(b.type){case"IRI":case"blank":case"prefixed":return this._readSubject(b),this._readGraph;case"[":return this._readNamedGraphBlankLabel;default:return this._error("Invalid graph label",b)}}_readNamedGraphBlankLabel(b){return"]"!==b.type?this._error("Invalid graph label",b):(this._subject=this._blankNode(),this._readGraph)}_readDeclarationPunctuation(b){return this._sparqlStyle?(this._sparqlStyle=!1,this._readInTopContext(b)):"."!==b.type?this._error("Expected declaration to end with a dot",b):this._readInTopContext}_readQuantifierList(b){let y;switch(b.type){case"IRI":case"prefixed":if(void 0!==(y=this._readEntity(b,!0)))break;default:return this._error(`Unexpected ${b.type}`,b)}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(b){return","===b.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(b))}_getPathReader(b){return this._afterPath=b,this._readPath}_readPath(b){switch(b.type){case"!":return this._readForwardPath;case"^":return this._readBackwardPath;default:const y=this._contextStack,S=y.length&&y[y.length-1];if(S&&"item"===S.type){const T=this._subject;this._restoreContext(),this._emit(this._subject,this.RDF_FIRST,T,this._graph)}return this._afterPath(b)}}_readForwardPath(b){let y,S;const T=this._blankNode();if(void 0!==(S=this._readEntity(b)))return null===this._predicate?(y=this._subject,this._subject=T):(y=this._object,this._object=T),this._emit(y,S,T,this._graph),this._readPath}_readBackwardPath(b){const y=this._blankNode();let S,T;if(void 0!==(S=this._readEntity(b)))return null===this._predicate?(T=this._subject,this._subject=y):(T=this._object,this._object=y),this._emit(y,S,T,this._graph),this._readPath}_readRDFStarTailOrGraph(b){return">>"!==b.type?this._supportsQuads&&null===this._graph&&void 0!==(this._graph=this._readEntity(b))?this._readRDFStarTail:this._error(`Expected >> to follow "${this._object.id}"`,b):this._readRDFStarTail(b)}_readRDFStarTail(b){if(">>"!==b.type)return this._error(`Expected >> but got ${b.type}`,b);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 b=this._contextStack;if(!b.length)return this._readPunctuation;switch(b[b.length-1].type){case"blank":return this._readBlankNodeTail;case"list":return this._readListItem;case"formula":return this._readFormulaTail;case"<<":return this._readRDFStarTailOrGraph}}_emit(b,y,S,T){this._callback(null,this._quad(b,y,S,T||this.DEFAULTGRAPH))}_error(b,y){const S=new Error(`${b} on line ${y.line}.`);S.context={token:y,line:y.line,previousToken:this._lexer.previousToken},this._callback(S),this._callback=x}_resolveIRI(b){return/^[a-z][a-z0-9+.-]*:/i.test(b)?b:this._resolveRelativeIRI(b)}_resolveRelativeIRI(b){if(!b.length)return this._base;switch(b[0]){case"#":return this._base+b;case"?":return this._base.replace(/(?:\?.*)?$/,b);case"/":return("/"===b[1]?this._baseScheme:this._baseRoot)+this._removeDotSegments(b);default:return/^[^/:]*:/.test(b)?null:this._removeDotSegments(this._basePath+b)}}_removeDotSegments(b){if(!/(^|\/)\.\.?($|[/#?])/.test(b))return b;const y=b.length;let S="",T=-1,V=-1,R=0,K="/";for(;T=V&&(S=S.substr(0,R)),"/"!==K)return`${S}/${b.substr(T+1)}`;R=T+1}}}K=b[++T]}return S+b.substring(R)}parse(b,y,S){if(this._readCallback=this._readInTopContext,this._sparqlStyle=!1,this._prefixes=Object.create(null),this._prefixes._=this._blankNodePrefix?this._blankNodePrefix.substr(2):`b${z++}_`,this._prefixCallback=S||x,this._inversePredicate=!1,this._quantified=Object.create(null),!y){const T=[];let V;if(this._callback=(R,K)=>{R?V=R:K&&T.push(K)},this._lexer.tokenize(b).every(R=>this._readCallback=this._readCallback(R)),V)throw V;return T}this._callback=y,this._lexer.tokenize(b,(T,V)=>{null!==T?(this._callback(T),this._callback=x):this._readCallback&&(this._readCallback=this._readCallback(V))})}}function x(){}function O(A,b){const y=b.namedNode;A._namedNode=y,A._blankNode=b.blankNode,A._literal=b.literal,A._variable=b.variable,A._quad=b.quad,A.DEFAULTGRAPH=b.defaultGraph(),A.RDF_FIRST=y(P.default.rdf.first),A.RDF_REST=y(P.default.rdf.rest),A.RDF_NIL=y(P.default.rdf.nil),A.N3_FORALL=y(P.default.r.forAll),A.N3_FORSOME=y(P.default.r.forSome),A.ABBREVIATIONS={a:y(P.default.rdf.type),"=":y(P.default.owl.sameAs),">":y(P.default.log.implies)},A.QUANTIFIERS_GRAPH=y("urn:n3:quantifiers")}he.default=v,O(v.prototype,j.default)},{"./IRIs":34,"./N3DataFactory":35,"./N3Lexer":36}],38:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.default=void 0;var b,W=function(b,y){if(!y&&b&&b.__esModule)return b;if(null===b||"object"!=typeof b&&"function"!=typeof b)return{default:b};var S=z(y);if(S&&S.has(b))return S.get(b);var T={},V=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var R in b)if("default"!==R&&Object.prototype.hasOwnProperty.call(b,R)){var K=V?Object.getOwnPropertyDescriptor(b,R):null;K&&(K.get||K.set)?Object.defineProperty(T,R,K):T[R]=b[R]}return T.default=b,S&&S.set(b,T),T}(Y("./N3DataFactory")),j=Y("readable-stream"),P=(b=Y("./IRIs"))&&b.__esModule?b:{default:b};function z(b){if("function"!=typeof WeakMap)return null;var y=new WeakMap,S=new WeakMap;return(z=function(T){return T?S:y})(b)}class x{constructor(y,S){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,!S&&y&&!y[0]&&(S=y,y=null),this._factory=(S=S||{}).factory||W.default,y&&this.addQuads(y)}get size(){let y=this._size;if(null!==y)return y;y=0;const S=this._graphs;let T,V;for(const R in S)for(const K in T=S[R].subjects)for(const ce in V=T[K])y+=Object.keys(V[ce]).length;return this._size=y}_addToIndex(y,S,T,V){const R=y[S]||(y[S]={}),K=R[T]||(R[T]={}),ce=V in K;return ce||(K[V]=null),!ce}_removeFromIndex(y,S,T,V){const R=y[S],K=R[T];delete K[V];for(const ce in K)return;delete R[T];for(const ce in R)return;delete y[S]}*_findInIndex(y,S,T,V,R,K,ce,D){let I,X,E;const Z=!S+!T+!V>1?Object.keys(this._ids):this._entities,oe=(0,W.termFromId)(D,this._factory);S&&((I=y,y={})[S]=I[S]);for(const se in y){const te=Z[se];if(X=y[se]){T&&((I=X,X={})[T]=I[T]);for(const Ce in X){const me=Z[Ce];if(E=X[Ce]){const ne=V?V in E?[V]:[]:Object.keys(E);for(let _e=0;_e{T in S||(S[T]=!0,y((0,W.termFromId)(this._entities[T],this._factory)))}}add(y){return this.addQuad(y),this}addQuad(y,S,T,V){S||(V=y.graph,T=y.object,S=y.predicate,y=y.subject),y=(0,W.termToId)(y),S=(0,W.termToId)(S),T=(0,W.termToId)(T),V=(0,W.termToId)(V);let R=this._graphs[V];R||(R=this._graphs[V]={subjects:{},predicates:{},objects:{}},Object.freeze(R));const K=this._ids,ce=this._entities;y=K[y]||(K[ce[++this._id]=y]=this._id),S=K[S]||(K[ce[++this._id]=S]=this._id),T=K[T]||(K[ce[++this._id]=T]=this._id);const D=this._addToIndex(R.subjects,y,S,T);return this._addToIndex(R.predicates,S,T,y),this._addToIndex(R.objects,T,y,S),this._size=null,D}addQuads(y){for(let S=0;S{this.addQuad(S)}),y}removeQuad(y,S,T,V){S||(V=y.graph,T=y.object,S=y.predicate,y=y.subject),y=(0,W.termToId)(y),S=(0,W.termToId)(S),T=(0,W.termToId)(T),V=(0,W.termToId)(V);const R=this._ids,K=this._graphs;let ce,D,I;if(!((y=R[y])&&(S=R[S])&&(T=R[T])&&(ce=K[V])&&(D=ce.subjects[y])&&(I=D[S])&&T in I))return!1;for(y in this._removeFromIndex(ce.subjects,y,S,T),this._removeFromIndex(ce.predicates,S,T,y),this._removeFromIndex(ce.objects,T,y,S),null!==this._size&&this._size--,ce.subjects)return!0;return delete K[V],!0}removeQuads(y){for(let S=0;S{this.removeQuad(S)}),y}removeMatches(y,S,T,V){const R=new j.Readable({objectMode:!0});return R._read=()=>{for(const K of this.readQuads(y,S,T,V))R.push(K);R.push(null)},this.remove(R)}deleteGraph(y){return this.removeMatches(null,null,null,y)}getQuads(y,S,T,V){return[...this.readQuads(y,S,T,V)]}*readQuads(y,S,T,V){y=y&&(0,W.termToId)(y),S=S&&(0,W.termToId)(S),T=T&&(0,W.termToId)(T),V=V&&(0,W.termToId)(V);const R=this._getGraphs(V),K=this._ids;let ce,D,I,X;if(!(O(y)&&!(D=K[y])||O(S)&&!(I=K[S])||O(T)&&!(X=K[T])))for(const E in R)(ce=R[E])&&(D?X?yield*this._findInIndex(ce.objects,X,D,I,"object","subject","predicate",E,null,!0):yield*this._findInIndex(ce.subjects,D,I,null,"subject","predicate","object",E,null,!0):I?yield*this._findInIndex(ce.predicates,I,X,null,"predicate","object","subject",E,null,!0):X?yield*this._findInIndex(ce.objects,X,null,null,"object","subject","predicate",E,null,!0):yield*this._findInIndex(ce.subjects,null,null,null,"subject","predicate","object",E,null,!0))}match(y,S,T,V){return new A(this,y,S,T,V)}countQuads(y,S,T,V){y=y&&(0,W.termToId)(y),S=S&&(0,W.termToId)(S),T=T&&(0,W.termToId)(T),V=V&&(0,W.termToId)(V);const R=this._getGraphs(V),K=this._ids;let D,I,X,E,ce=0;if(O(y)&&!(I=K[y])||O(S)&&!(X=K[S])||O(T)&&!(E=K[T]))return 0;for(const $ in R)(D=R[$])&&(ce+=y?T?this._countInIndex(D.objects,E,I,X):this._countInIndex(D.subjects,I,X,E):S?this._countInIndex(D.predicates,X,E,I):this._countInIndex(D.objects,E,I,X));return ce}forEach(y,S,T,V,R){this.some(K=>(y(K),!1),S,T,V,R)}every(y,S,T,V,R){let K=!1;const ce=!this.some(D=>(K=!0,!y(D)),S,T,V,R);return K&&ce}some(y,S,T,V,R){for(const K of this.readQuads(S,T,V,R))if(y(K))return!0;return!1}getSubjects(y,S,T){const V=[];return this.forSubjects(R=>{V.push(R)},y,S,T),V}forSubjects(y,S,T,V){S=S&&(0,W.termToId)(S),T=T&&(0,W.termToId)(T),V=V&&(0,W.termToId)(V);const R=this._ids,K=this._getGraphs(V);let ce,D,I;if(y=this._uniqueEntities(y),!(O(S)&&!(D=R[S])||O(T)&&!(I=R[T])))for(V in K)(ce=K[V])&&(D?I?this._loopBy2Keys(ce.predicates,D,I,y):this._loopByKey1(ce.subjects,D,y):I?this._loopByKey0(ce.objects,I,y):this._loop(ce.subjects,y))}getPredicates(y,S,T){const V=[];return this.forPredicates(R=>{V.push(R)},y,S,T),V}forPredicates(y,S,T,V){S=S&&(0,W.termToId)(S),T=T&&(0,W.termToId)(T),V=V&&(0,W.termToId)(V);const R=this._ids,K=this._getGraphs(V);let ce,D,I;if(y=this._uniqueEntities(y),!(O(S)&&!(D=R[S])||O(T)&&!(I=R[T])))for(V in K)(ce=K[V])&&(D?I?this._loopBy2Keys(ce.objects,I,D,y):this._loopByKey0(ce.subjects,D,y):I?this._loopByKey1(ce.predicates,I,y):this._loop(ce.predicates,y))}getObjects(y,S,T){const V=[];return this.forObjects(R=>{V.push(R)},y,S,T),V}forObjects(y,S,T,V){S=S&&(0,W.termToId)(S),T=T&&(0,W.termToId)(T),V=V&&(0,W.termToId)(V);const R=this._ids,K=this._getGraphs(V);let ce,D,I;if(y=this._uniqueEntities(y),!(O(S)&&!(D=R[S])||O(T)&&!(I=R[T])))for(V in K)(ce=K[V])&&(D?I?this._loopBy2Keys(ce.subjects,D,I,y):this._loopByKey1(ce.objects,D,y):I?this._loopByKey0(ce.predicates,I,y):this._loop(ce.objects,y))}getGraphs(y,S,T){const V=[];return this.forGraphs(R=>{V.push(R)},y,S,T),V}forGraphs(y,S,T,V){for(const R in this._graphs)this.some(K=>(y(K.graph),!0),S,T,V,R)}createBlankNode(y){let S,T;if(y)for(S=y=`_:${y}`,T=1;this._ids[S];)S=y+T++;else do{S="_:b"+this._blankNodeIndex++}while(this._ids[S]);return this._ids[S]=++this._id,this._entities[this._id]=S,this._factory.blankNode(S.substr(2))}extractLists({remove:y=!1,ignoreErrors:S=!1}={}){const T={},V=S?()=>!0:(ce,D)=>{throw new Error(`${ce.value} ${D}`)},R=this.getQuads(null,P.default.rdf.rest,P.default.rdf.nil,null),K=y?[...R]:[];return R.forEach(ce=>{const D=[];let X,E,I=!1;const $=ce.graph;let Z=ce.subject;for(;Z&&!I;){const oe=this.getQuads(null,null,Z,null),se=this.getQuads(Z,null,null,null);let te,Ce=null,me=null,ne=null;for(let _e=0;_e{switch(b){case"data":O=y;break;case"end":A=y}}},(b,y)=>{b&&this.emit("error",b)||y&&this.push(y)},(b,y)=>{this.emit("prefix",b,y)}),this._transform=(b,y,S)=>{O(b),S()},this._flush=b=>{A(),b()}}import(v){return v.on("data",x=>{this.write(x)}),v.on("end",()=>{this.end()}),v.on("error",x=>{this.emit("error",x)}),this}}},{"./N3Parser":37,"readable-stream":81}],40:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.default=void 0;var z,W=Y("readable-stream"),j=(z=Y("./N3Writer"))&&z.__esModule?z:{default:z};he.default=class extends W.Transform{constructor(v){super({encoding:"utf8",writableObjectMode:!0});const x=this._writer=new j.default({write:(O,A,b)=>{this.push(O),b&&b()},end:O=>{this.push(null),O&&O()}},v);this._transform=(O,A,b)=>{x.addQuad(O,b)},this._flush=O=>{x.end(O)}}import(v){return v.on("data",x=>{this.write(x)}),v.on("end",()=>{this.end()}),v.on("error",x=>{this.emit("error",x)}),v.on("prefix",(x,O)=>{this._writer.addPrefix(x,O)}),this}}},{"./N3Writer":42,"readable-stream":81}],41:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.inDefaultGraph=function(y){return x(y.graph)},he.isBlankNode=function(y){return!!y&&"BlankNode"===y.termType},he.isDefaultGraph=x,he.isLiteral=function(y){return!!y&&"Literal"===y.termType},he.isNamedNode=function(y){return!!y&&"NamedNode"===y.termType},he.isVariable=function(y){return!!y&&"Variable"===y.termType},he.prefix=function(y,S){return b({"":y.value||y},S)("")},he.prefixes=b;var y,W=(y=Y("./N3DataFactory"))&&y.__esModule?y:{default:y};function x(y){return!!y&&"DefaultGraph"===y.termType}function b(y,S){const T=Object.create(null);for(const R in y)V(R,y[R]);function V(R,K){if("string"==typeof K){const ce=Object.create(null);T[R]=D=>ce[D]||(ce[D]=S.namedNode(K+D))}else if(!(R in T))throw new Error(`Unknown prefix: ${R}`);return T[R]}return S=S||W.default,V}},{"./N3DataFactory":35}],42:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.default=void 0;var ce,W=(ce=Y("./IRIs"))&&ce.__esModule?ce:{default:ce},j=function(ce,D){if(!D&&ce&&ce.__esModule)return ce;if(null===ce||"object"!=typeof ce&&"function"!=typeof ce)return{default:ce};var I=Q(D);if(I&&I.has(ce))return I.get(ce);var X={},E=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var $ in ce)if("default"!==$&&Object.prototype.hasOwnProperty.call(ce,$)){var Z=E?Object.getOwnPropertyDescriptor(ce,$):null;Z&&(Z.get||Z.set)?Object.defineProperty(X,$,Z):X[$]=ce[$]}return X.default=ce,I&&I.set(ce,X),X}(Y("./N3DataFactory")),P=Y("./N3Util");function Q(ce){if("function"!=typeof WeakMap)return null;var D=new WeakMap,I=new WeakMap;return(Q=function(X){return X?I:D})(ce)}const x=j.default.defaultGraph(),{rdf:O,xsd:A}=W.default,b=/["\\\t\n\r\b\f\u0000-\u0019\ud800-\udbff]/,y=/["\\\t\n\r\b\f\u0000-\u0019]|[\ud800-\udbff][\udc00-\udfff]/g,S={"\\":"\\\\",'"':'\\"',"\t":"\\t","\n":"\\n","\r":"\\r","\b":"\\b","\f":"\\f"};class T extends j.Term{equals(){return!1}}function R(ce){let D=S[ce];return void 0===D&&(1===ce.length?(D=ce.charCodeAt(0).toString(16),D="\\u0000".substr(0,6-D.length)+D):(D=(1024*(ce.charCodeAt(0)-55296)+ce.charCodeAt(1)+9216).toString(16),D="\\U00000000".substr(0,10-D.length)+D)),D}function K(ce){return ce.replace(/[\]\/\(\)\*\+\?\.\\\$]/g,"\\$&")}he.default=class{constructor(D,I){if(this._prefixRegex=/$0^/,D&&"function"!=typeof D.write&&(I=D,D=null),this._lists=(I=I||{}).lists,D)this._outputStream=D,this._endStream=void 0===I.end||!!I.end;else{let X="";this._outputStream={write(E,$,Z){X+=E,Z&&Z()},end:E=>{E&&E(null,X)}},this._endStream=!0}this._subject=null,/triple|quad/i.test(I.format)?(this._lineMode=!0,this._writeQuad=this._writeQuadLine):(this._lineMode=!1,this._graph=x,this._prefixIRIs=Object.create(null),I.prefixes&&this.addPrefixes(I.prefixes),I.baseIRI&&(this._baseMatcher=new RegExp(`^${K(I.baseIRI)}${I.baseIRI.endsWith("/")?"":"[#?]"}`),this._baseLength=I.baseIRI.length))}get _inDefaultGraph(){return x.equals(this._graph)}_write(D,I){this._outputStream.write(D,"utf8",I)}_writeQuad(D,I,X,E,$){try{E.equals(this._graph)||(this._write((null===this._subject?"":this._inDefaultGraph?".\n":"\n}\n")+(x.equals(E)?"":`${this._encodeIriOrBlank(E)} {\n`)),this._graph=E,this._subject=null),D.equals(this._subject)?I.equals(this._predicate)?this._write(`, ${this._encodeObject(X)}`,$):this._write(`;\n ${this._encodePredicate(this._predicate=I)} ${this._encodeObject(X)}`,$):this._write(`${(null===this._subject?"":".\n")+this._encodeSubject(this._subject=D)} ${this._encodePredicate(this._predicate=I)} ${this._encodeObject(X)}`,$)}catch(Z){$&&$(Z)}}_writeQuadLine(D,I,X,E,$){delete this._prefixMatch,this._write(this.quadToString(D,I,X,E),$)}quadToString(D,I,X,E){return`${this._encodeSubject(D)} ${this._encodeIriOrBlank(I)} ${this._encodeObject(X)}${E&&E.value?` ${this._encodeIriOrBlank(E)} .\n`:" .\n"}`}quadsToString(D){return D.map(I=>this.quadToString(I.subject,I.predicate,I.object,I.graph)).join("")}_encodeSubject(D){return"Quad"===D.termType?this._encodeQuad(D):this._encodeIriOrBlank(D)}_encodeIriOrBlank(D){if("NamedNode"!==D.termType)return this._lists&&D.value in this._lists&&(D=this.list(this._lists[D.value])),"id"in D?D.id:`_:${D.value}`;let I=D.value;this._baseMatcher&&this._baseMatcher.test(I)&&(I=I.substr(this._baseLength)),b.test(I)&&(I=I.replace(y,R));const X=this._prefixRegex.exec(I);return X?X[1]?this._prefixIRIs[X[1]]+X[2]:I:`<${I}>`}_encodeLiteral(D){let I=D.value;if(b.test(I)&&(I=I.replace(y,R)),D.language)return`"${I}"@${D.language}`;if(this._lineMode){if(D.datatype.value===A.string)return`"${I}"`}else switch(D.datatype.value){case A.string:return`"${I}"`;case A.boolean:if("true"===I||"false"===I)return I;break;case A.integer:if(/^[+-]?\d+$/.test(I))return I;break;case A.decimal:if(/^[+-]?\d*\.\d+$/.test(I))return I;break;case A.double:if(/^[+-]?(?:\d+\.\d*|\.?\d+)[eE][+-]?\d+$/.test(I))return I}return`"${I}"^^${this._encodeIriOrBlank(D.datatype)}`}_encodePredicate(D){return D.value===O.type?"a":this._encodeIriOrBlank(D)}_encodeObject(D){switch(D.termType){case"Quad":return this._encodeQuad(D);case"Literal":return this._encodeLiteral(D);default:return this._encodeIriOrBlank(D)}}_encodeQuad({subject:D,predicate:I,object:X,graph:E}){return`<<${this._encodeSubject(D)} ${this._encodePredicate(I)} ${this._encodeObject(X)}${(0,P.isDefaultGraph)(E)?"":` ${this._encodeIriOrBlank(E)}`}>>`}_blockedWrite(){throw new Error("Cannot write because the writer has been closed.")}addQuad(D,I,X,E,$){void 0===X?this._writeQuad(D.subject,D.predicate,D.object,D.graph,I):"function"==typeof E?this._writeQuad(D,I,X,x,E):this._writeQuad(D,I,X,E||x,$)}addQuads(D){for(let I=0;I.\n`)}if(X){let E="",$="";for(const Z in this._prefixIRIs)E+=E?`|${Z}`:Z,$+=($?"|":"")+this._prefixIRIs[Z];E=K(E),this._prefixRegex=new RegExp(`^(?:${$})[^/]*$|^(${E})([a-zA-Z][\\-_a-zA-Z0-9]*)$`)}this._write(X?"\n":"",I)}blank(D,I){let E,$,X=D;switch(void 0===D?X=[]:D.termType?X=[{predicate:D,object:I}]:"length"in D||(X=[D]),$=X.length){case 0:return new T("[]");case 1:if(E=X[0],!(E.object instanceof T))return new T(`[ ${this._encodePredicate(E.predicate)} ${this._encodeObject(E.object)} ]`);default:let Z="[";for(let oe=0;oe<$;oe++)E=X[oe],E.predicate.equals(D)?Z+=`, ${this._encodeObject(E.object)}`:(Z+=`${(oe?";\n ":"\n ")+this._encodePredicate(E.predicate)} ${this._encodeObject(E.object)}`,D=E.predicate);return new T(`${Z}\n]`)}}list(D){const I=D&&D.length||0,X=new Array(I);for(let E=0;E{I=null,D(X,E)});if(this._endStream)try{return this._outputStream.end(I)}catch(X){}I&&I()}}},{"./IRIs":34,"./N3DataFactory":35,"./N3Util":41}],43:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),Object.defineProperty(he,"BlankNode",{enumerable:!0,get:function(){return O.BlankNode}}),Object.defineProperty(he,"DataFactory",{enumerable:!0,get:function(){return O.default}}),Object.defineProperty(he,"DefaultGraph",{enumerable:!0,get:function(){return O.DefaultGraph}}),Object.defineProperty(he,"Lexer",{enumerable:!0,get:function(){return W.default}}),Object.defineProperty(he,"Literal",{enumerable:!0,get:function(){return O.Literal}}),Object.defineProperty(he,"NamedNode",{enumerable:!0,get:function(){return O.NamedNode}}),Object.defineProperty(he,"Parser",{enumerable:!0,get:function(){return j.default}}),Object.defineProperty(he,"Quad",{enumerable:!0,get:function(){return O.Quad}}),Object.defineProperty(he,"Store",{enumerable:!0,get:function(){return Q.default}}),Object.defineProperty(he,"StreamParser",{enumerable:!0,get:function(){return z.default}}),Object.defineProperty(he,"StreamWriter",{enumerable:!0,get:function(){return v.default}}),Object.defineProperty(he,"Term",{enumerable:!0,get:function(){return O.Term}}),Object.defineProperty(he,"Triple",{enumerable:!0,get:function(){return O.Triple}}),he.Util=void 0,Object.defineProperty(he,"Variable",{enumerable:!0,get:function(){return O.Variable}}),Object.defineProperty(he,"Writer",{enumerable:!0,get:function(){return P.default}}),he.default=void 0,Object.defineProperty(he,"termFromId",{enumerable:!0,get:function(){return O.termFromId}}),Object.defineProperty(he,"termToId",{enumerable:!0,get:function(){return O.termToId}});var W=y(Y("./N3Lexer")),j=y(Y("./N3Parser")),P=y(Y("./N3Writer")),Q=y(Y("./N3Store")),z=y(Y("./N3StreamParser")),v=y(Y("./N3StreamWriter")),x=b(Y("./N3Util"));he.Util=x;var O=b(Y("./N3DataFactory"));function A(T){if("function"!=typeof WeakMap)return null;var V=new WeakMap,R=new WeakMap;return(A=function(K){return K?R:V})(T)}function b(T,V){if(!V&&T&&T.__esModule)return T;if(null===T||"object"!=typeof T&&"function"!=typeof T)return{default:T};var R=A(V);if(R&&R.has(T))return R.get(T);var K={},ce=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var D in T)if("default"!==D&&Object.prototype.hasOwnProperty.call(T,D)){var I=ce?Object.getOwnPropertyDescriptor(T,D):null;I&&(I.get||I.set)?Object.defineProperty(K,D,I):K[D]=T[D]}return K.default=T,R&&R.set(T,K),K}function y(T){return T&&T.__esModule?T:{default:T}}he.default={Lexer:W.default,Parser:j.default,Writer:P.default,Store:Q.default,StreamParser:z.default,StreamWriter:v.default,Util:x,DataFactory:O.default,Term:O.Term,NamedNode:O.NamedNode,Literal:O.Literal,BlankNode:O.BlankNode,Variable:O.Variable,DefaultGraph:O.DefaultGraph,Quad:O.Quad,Triple:O.Triple,termFromId:O.termFromId,termToId:O.termToId}},{"./N3DataFactory":35,"./N3Lexer":36,"./N3Parser":37,"./N3Store":38,"./N3StreamParser":39,"./N3StreamWriter":40,"./N3Util":41,"./N3Writer":42}],44:[function(Y,Se,he){var j,P,W=Se.exports={};function Q(){throw new Error("setTimeout has not been defined")}function z(){throw new Error("clearTimeout has not been defined")}function v(K){if(j===setTimeout)return setTimeout(K,0);if((j===Q||!j)&&setTimeout)return j=setTimeout,setTimeout(K,0);try{return j(K,0)}catch(ce){try{return j.call(null,K,0)}catch(D){return j.call(this,K,0)}}}!function(){try{j="function"==typeof setTimeout?setTimeout:Q}catch(K){j=Q}try{P="function"==typeof clearTimeout?clearTimeout:z}catch(K){P=z}}();var b,O=[],A=!1,y=-1;function S(){!A||!b||(A=!1,b.length?O=b.concat(O):y=-1,O.length&&T())}function T(){if(!A){var K=v(S);A=!0;for(var ce=O.length;ce;){for(b=O,O=[];++y1)for(var D=1;D(j||(j=Promise.resolve())).then(P).catch(Q=>setTimeout(()=>{throw Q},0))}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],46:[function(Y,Se,he){Se.exports=Y("./lib")},{"./lib":55}],47:[function(Y,Se,he){"use strict";Se.exports=class Hq{constructor(j,P=new Map,Q=0){this.prefix=j,this._existing=P,this.counter=Q}clone(){const{prefix:j,_existing:P,counter:Q}=this;return new Hq(j,new Map(P),Q)}getId(j){const P=j&&this._existing.get(j);if(P)return P;const Q=this.prefix+this.counter;return this.counter++,j&&this._existing.set(j,Q),Q}hasId(j){return this._existing.has(j)}getOldIds(){return[...this._existing.keys()]}}},{}],48:[function(Y,Se,he){"use strict";Y("setimmediate");const W=self.crypto||self.msCrypto;Se.exports=class{constructor(P){if(!W||!W.subtle)throw new Error("crypto.subtle not found.");if("sha256"===P)this.algorithm={name:"SHA-256"};else{if("sha1"!==P)throw new Error(`Unsupport algorithm "${P}".`);this.algorithm={name:"SHA-1"}}this._content=""}update(P){this._content+=P}digest(){var P=this;return yt(function*(){const Q=(new TextEncoder).encode(P._content),z=new Uint8Array(yield W.subtle.digest(P.algorithm,Q));let v="";for(let x=0;x]*)>)|(_:(?:[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]*$'),Se.exports=class a2{static parse(K){const ce=[],D={},I=K.split(A.eoln);let X=0;for(const E of I){if(X++,A.empty.test(E))continue;const $=E.match(A.quad);if(null===$)throw new Error("N-Quads parse error on line "+X+".");const Z={subject:null,predicate:null,object:null,graph:null};if(Z.subject=void 0!==$[1]?{termType:z,value:$[1]}:{termType:v,value:$[2]},Z.predicate={termType:z,value:$[3]},void 0!==$[4]?Z.object={termType:z,value:$[4]}:void 0!==$[5]?Z.object={termType:v,value:$[5]}:(Z.object={termType:x,value:void 0,datatype:{termType:z}},void 0!==$[7]?Z.object.datatype.value=$[7]:void 0!==$[8]?(Z.object.datatype.value=P,Z.object.language=$[8]):Z.object.datatype.value=Q,Z.object.value=$[6].replace(T,function(K,ce,D,I){if(ce)switch(ce){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(I)throw new Error("Unsupported U escape")})),Z.graph=void 0!==$[9]?{termType:z,value:$[9]}:void 0!==$[10]?{termType:v,value:$[10]}:{termType:O,value:""},Z.graph.value in D){let oe=!0;const se=D[Z.graph.value];for(const te of se)if(b(te,Z)){oe=!1;break}oe&&(se.push(Z),ce.push(Z))}else D[Z.graph.value]=[Z],ce.push(Z)}return ce}static serialize(K){Array.isArray(K)||(K=a2.legacyDatasetToQuads(K));const ce=[];for(const D of K)ce.push(a2.serializeQuad(D));return ce.sort().join("")}static serializeQuad(K){const ce=K.subject,I=K.object,X=K.graph;let E="";return E+=ce.termType===z?`<${ce.value}>`:`${ce.value}`,E+=` <${K.predicate.value}> `,I.termType===z?E+=`<${I.value}>`:I.termType===v?E+=I.value:(E+=`"${R=I.value,R.replace(y,function(K){switch(K){case'"':return'\\"';case"\\":return"\\\\";case"\n":return"\\n";case"\r":return"\\r"}})}"`,I.datatype.value===P?I.language&&(E+=`@${I.language}`):I.datatype.value!==Q&&(E+=`^^<${I.datatype.value}>`)),X.termType===z?E+=` <${X.value}>`:X.termType===v&&(E+=` ${X.value}`),E+=" .\n",E;var R}static legacyDatasetToQuads(K){const ce=[],D={"blank node":v,IRI:z,literal:x};for(const I in K)K[I].forEach(E=>{const $={};for(const Z in E){const oe=E[Z],se={termType:D[oe.type],value:oe.value};se.termType===x&&(se.datatype={termType:z},"datatype"in oe&&(se.datatype.value=oe.datatype),"language"in oe?("datatype"in oe||(se.datatype.value=P),se.language=oe.language):"datatype"in oe||(se.datatype.value=Q)),$[Z]=se}$.graph="@default"===I?{termType:O,value:""}:{termType:I.startsWith("_:")?v:z,value:I},ce.push($)});return ce}};const y=/["\\\n\r]/g;const T=/(?:\\([tbnrf"'\\]))|(?:\\u([0-9A-Fa-f]{4}))|(?:\\U([0-9A-Fa-f]{8}))/g},{}],50:[function(Y,Se,he){"use strict";Se.exports=class{constructor(j){this.current=j.sort(),this.done=!1,this.dir=new Map;for(let P=0;Pz)&&(b&&O>0&&A>j[O-1]||!b&&Oj[O+1])&&(z=A,v=O)}if(null===z)this.done=!0;else{const O=P.get(z)?v-1:v+1;j[v]=j[O],j[O]=z;for(const A of j)A>z&&P.set(A,!P.get(A))}return Q}}},{}],51:[function(Y,Se,he){(function(W){(function(){"use strict";const j=Y("./IdentifierIssuer"),P=Y("./MessageDigest"),Q=Y("./Permuter"),z=Y("./NQuads");function v(x,O){return x.hashO.hash?1:0}Se.exports=class{constructor(){this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new j("_:c14n"),this.hashAlgorithm="sha256",this.quads=null}main(O){var A=this;return yt(function*(){A.quads=O;for(const K of O)A._addBlankNodeQuadInfo({quad:K,component:K.subject}),A._addBlankNodeQuadInfo({quad:K,component:K.object}),A._addBlankNodeQuadInfo({quad:K,component:K.graph});const b=new Map,y=[...A.blankNodeInfo.keys()];let S=0;for(const K of y)++S%100==0&&(yield A._yield()),yield A._hashAndTrackBlankNode({id:K,hashToBlankNodes:b});const T=[...b.keys()].sort(),V=[];for(const K of T){const ce=b.get(K);ce.length>1?V.push(ce):A.canonicalIssuer.getId(ce[0])}for(const K of V){const ce=[];for(const D of K){if(A.canonicalIssuer.hasId(D))continue;const I=new j("_:b");I.getId(D);const X=yield A.hashNDegreeQuads(D,I);ce.push(X)}ce.sort(v);for(const D of ce){const I=D.issuer.getOldIds();for(const X of I)A.canonicalIssuer.getId(X)}}const R=[];for(const K of A.quads){const ce=ot({},K);ce.subject=A._useCanonicalId({component:ce.subject}),ce.object=A._useCanonicalId({component:ce.object}),ce.graph=A._useCanonicalId({component:ce.graph}),R.push(z.serializeQuad(ce))}return R.sort(),R.join("")})()}hashFirstDegreeQuads(O){var A=this;return yt(function*(){const b=[],y=A.blankNodeInfo.get(O),S=y.quads;for(const V of S){const R={subject:null,predicate:V.predicate,object:null,graph:null};R.subject=A.modifyFirstDegreeComponent(O,V.subject,"subject"),R.object=A.modifyFirstDegreeComponent(O,V.object,"object"),R.graph=A.modifyFirstDegreeComponent(O,V.graph,"graph"),b.push(z.serializeQuad(R))}b.sort();const T=new P(A.hashAlgorithm);for(const V of b)T.update(V);return y.hash=yield T.digest(),y.hash})()}hashRelatedBlankNode(O,A,b,y){var S=this;return yt(function*(){let T;T=S.canonicalIssuer.hasId(O)?S.canonicalIssuer.getId(O):b.hasId(O)?b.getId(O):S.blankNodeInfo.get(O).hash;const V=new P(S.hashAlgorithm);return V.update(y),"g"!==y&&V.update(S.getRelatedPredicate(A)),V.update(T),V.digest()})()}hashNDegreeQuads(O,A){var b=this;return yt(function*(){const y=new P(b.hashAlgorithm),S=yield b.createHashToRelated(O,A),T=[...S.keys()].sort();for(const V of T){y.update(V);let K,R="";const ce=new Q(S.get(V));let D=0;for(;ce.hasNext();){const I=ce.next();++D%3==0&&(yield b._yield());let X=A.clone(),E="";const $=[];let Z=!1;for(const oe of I)if(b.canonicalIssuer.hasId(oe)?E+=b.canonicalIssuer.getId(oe):(X.hasId(oe)||$.push(oe),E+=X.getId(oe)),0!==R.length&&E>R){Z=!0;break}if(!Z){for(const oe of $){const se=yield b.hashNDegreeQuads(oe,X);if(E+=X.getId(oe),E+=`<${se.hash}>`,X=se.issuer,0!==R.length&&E>R){Z=!0;break}}Z||(0===R.length||E`}createHashToRelated(O,A){var b=this;return yt(function*(){const y=new Map,S=b.blankNodeInfo.get(O).quads;let T=0;for(const V of S)++T%100==0&&(yield b._yield()),yield Promise.all([b._addRelatedBlankNodeHash({quad:V,component:V.subject,position:"s",id:O,issuer:A,hashToRelated:y}),b._addRelatedBlankNodeHash({quad:V,component:V.object,position:"o",id:O,issuer:A,hashToRelated:y}),b._addRelatedBlankNodeHash({quad:V,component:V.graph,position:"g",id:O,issuer:A,hashToRelated:y})]);return y})()}_hashAndTrackBlankNode({id:O,hashToBlankNodes:A}){var b=this;return yt(function*(){const y=yield b.hashFirstDegreeQuads(O),S=A.get(y);S?S.push(O):A.set(y,[O])})()}_addBlankNodeQuadInfo({quad:O,component:A}){if("BlankNode"!==A.termType)return;const b=A.value,y=this.blankNodeInfo.get(b);y?y.quads.add(O):this.blankNodeInfo.set(b,{quads:new Set([O]),hash:null})}_addRelatedBlankNodeHash({quad:O,component:A,position:b,id:y,issuer:S,hashToRelated:T}){var V=this;return yt(function*(){if("BlankNode"!==A.termType||A.value===y)return;const R=A.value,K=yield V.hashRelatedBlankNode(R,O,S,b),ce=T.get(K);ce?ce.push(R):T.set(K,[R])})()}_useCanonicalId({component:O}){return"BlankNode"!==O.termType||O.value.startsWith(this.canonicalIssuer.prefix)?O:{termType:"BlankNode",value:this.canonicalIssuer.getId(O.value)}}_yield(){return yt(function*(){return new Promise(O=>W(O))})()}}}).call(this)}).call(this,Y("timers").setImmediate)},{"./IdentifierIssuer":47,"./MessageDigest":48,"./NQuads":49,"./Permuter":50,timers:89}],52:[function(Y,Se,he){"use strict";const W=Y("./IdentifierIssuer"),j=Y("./MessageDigest"),P=Y("./Permuter"),Q=Y("./NQuads");function z(v,x){return v.hashx.hash?1:0}Se.exports=class{constructor(){this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new W("_:c14n"),this.hashAlgorithm="sha256",this.quads=null}main(x){this.quads=x;for(const T of x)this._addBlankNodeQuadInfo({quad:T,component:T.subject}),this._addBlankNodeQuadInfo({quad:T,component:T.object}),this._addBlankNodeQuadInfo({quad:T,component:T.graph});const O=new Map,A=[...this.blankNodeInfo.keys()];for(const T of A)this._hashAndTrackBlankNode({id:T,hashToBlankNodes:O});const b=[...O.keys()].sort(),y=[];for(const T of b){const V=O.get(T);V.length>1?y.push(V):this.canonicalIssuer.getId(V[0])}for(const T of y){const V=[];for(const R of T){if(this.canonicalIssuer.hasId(R))continue;const K=new W("_:b");K.getId(R);const ce=this.hashNDegreeQuads(R,K);V.push(ce)}V.sort(z);for(const R of V){const K=R.issuer.getOldIds();for(const ce of K)this.canonicalIssuer.getId(ce)}}const S=[];for(const T of this.quads){const V=ot({},T);V.subject=this._useCanonicalId({component:V.subject}),V.object=this._useCanonicalId({component:V.object}),V.graph=this._useCanonicalId({component:V.graph}),S.push(Q.serializeQuad(V))}return S.sort(),S.join("")}hashFirstDegreeQuads(x){const O=[],A=this.blankNodeInfo.get(x),b=A.quads;for(const S of b){const T={subject:null,predicate:S.predicate,object:null,graph:null};T.subject=this.modifyFirstDegreeComponent(x,S.subject,"subject"),T.object=this.modifyFirstDegreeComponent(x,S.object,"object"),T.graph=this.modifyFirstDegreeComponent(x,S.graph,"graph"),O.push(Q.serializeQuad(T))}O.sort();const y=new j(this.hashAlgorithm);for(const S of O)y.update(S);return A.hash=y.digest(),A.hash}hashRelatedBlankNode(x,O,A,b){let y;y=this.canonicalIssuer.hasId(x)?this.canonicalIssuer.getId(x):A.hasId(x)?A.getId(x):this.blankNodeInfo.get(x).hash;const S=new j(this.hashAlgorithm);return S.update(b),"g"!==b&&S.update(this.getRelatedPredicate(O)),S.update(y),S.digest()}hashNDegreeQuads(x,O){const A=new j(this.hashAlgorithm),b=this.createHashToRelated(x,O),y=[...b.keys()].sort();for(const S of y){A.update(S);let V,T="";const R=new P(b.get(S));for(;R.hasNext();){const K=R.next();let ce=O.clone(),D="";const I=[];let X=!1;for(const E of K)if(this.canonicalIssuer.hasId(E)?D+=this.canonicalIssuer.getId(E):(ce.hasId(E)||I.push(E),D+=ce.getId(E)),0!==T.length&&D>T){X=!0;break}if(!X){for(const E of I){const $=this.hashNDegreeQuads(E,ce);if(D+=ce.getId(E),D+=`<${$.hash}>`,ce=$.issuer,0!==T.length&&D>T){X=!0;break}}X||(0===T.length||D`}createHashToRelated(x,O){const A=new Map,b=this.blankNodeInfo.get(x).quads;for(const y of b)this._addRelatedBlankNodeHash({quad:y,component:y.subject,position:"s",id:x,issuer:O,hashToRelated:A}),this._addRelatedBlankNodeHash({quad:y,component:y.object,position:"o",id:x,issuer:O,hashToRelated:A}),this._addRelatedBlankNodeHash({quad:y,component:y.graph,position:"g",id:x,issuer:O,hashToRelated:A});return A}_hashAndTrackBlankNode({id:x,hashToBlankNodes:O}){const A=this.hashFirstDegreeQuads(x),b=O.get(A);b?b.push(x):O.set(A,[x])}_addBlankNodeQuadInfo({quad:x,component:O}){if("BlankNode"!==O.termType)return;const A=O.value,b=this.blankNodeInfo.get(A);b?b.quads.add(x):this.blankNodeInfo.set(A,{quads:new Set([x]),hash:null})}_addRelatedBlankNodeHash({quad:x,component:O,position:A,id:b,issuer:y,hashToRelated:S}){if("BlankNode"!==O.termType||O.value===b)return;const T=O.value,V=this.hashRelatedBlankNode(T,x,y,A),R=S.get(V);R?R.push(T):S.set(V,[T])}_useCanonicalId({component:x}){return"BlankNode"!==x.termType||x.value.startsWith(this.canonicalIssuer.prefix)?x:{termType:"BlankNode",value:this.canonicalIssuer.getId(x.value)}}}},{"./IdentifierIssuer":47,"./MessageDigest":48,"./NQuads":49,"./Permuter":50}],53:[function(Y,Se,he){"use strict";const W=Y("./URDNA2015");Se.exports=class extends W{constructor(){super(),this.name="URGNA2012",this.hashAlgorithm="sha1"}modifyFirstDegreeComponent(P,Q,z){return"BlankNode"!==Q.termType?Q:"graph"===z?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:Q.value===P?"_:a":"_:z"}}getRelatedPredicate(P){return P.predicate.value}createHashToRelated(P,Q){var z=this;return yt(function*(){const v=new Map,x=z.blankNodeInfo.get(P).quads;let O=0;for(const A of x){let b,y;if("BlankNode"===A.subject.termType&&A.subject.value!==P)y=A.subject.value,b="p";else{if("BlankNode"!==A.object.termType||A.object.value===P)continue;y=A.object.value,b="r"}++O%100==0&&(yield z._yield());const S=yield z.hashRelatedBlankNode(y,A,Q,b),T=v.get(S);T?T.push(y):v.set(S,[y])}return v})()}}},{"./URDNA2015":51}],54:[function(Y,Se,he){"use strict";const W=Y("./URDNA2015Sync");Se.exports=class extends W{constructor(){super(),this.name="URGNA2012",this.hashAlgorithm="sha1"}modifyFirstDegreeComponent(P,Q,z){return"BlankNode"!==Q.termType?Q:"graph"===z?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:Q.value===P?"_:a":"_:z"}}getRelatedPredicate(P){return P.predicate.value}createHashToRelated(P,Q){const z=new Map,v=this.blankNodeInfo.get(P).quads;for(const x of v){let O,A;if("BlankNode"===x.subject.termType&&x.subject.value!==P)A=x.subject.value,O="p";else{if("BlankNode"!==x.object.termType||x.object.value===P)continue;A=x.object.value,O="r"}const b=this.hashRelatedBlankNode(A,x,Q,O),y=z.get(b);y?y.push(A):z.set(b,[A])}return z}}},{"./URDNA2015Sync":52}],55:[function(Y,Se,he){"use strict";const W=Y("./URDNA2015"),j=Y("./URGNA2012"),P=Y("./URDNA2015Sync"),Q=Y("./URGNA2012Sync");let z;try{z=Y("rdf-canonize-native")}catch(x){}const v={};Se.exports=v,v.NQuads=Y("./NQuads"),v.IdentifierIssuer=Y("./IdentifierIssuer"),v._rdfCanonizeNative=function(x){return x&&(z=x),z},v.canonize=function(){var x=yt(function*(O,A){if(Array.isArray(O)||(O=v.NQuads.legacyDatasetToQuads(O)),A.useNative){if(!z)throw new Error("rdf-canonize-native not available");return new Promise((b,y)=>z.canonize(O,A,(S,T)=>S?y(S):b(T)))}if("URDNA2015"===A.algorithm)return new W(A).main(O);if("URGNA2012"===A.algorithm)return new j(A).main(O);throw"algorithm"in A?new Error("Invalid RDF Dataset Canonicalization algorithm: "+A.algorithm):new Error("No RDF Dataset Canonicalization algorithm specified.")});return function(O,A){return x.apply(this,arguments)}}(),v._canonizeSync=function(x,O){if(Array.isArray(x)||(x=v.NQuads.legacyDatasetToQuads(x)),O.useNative){if(z)return z.canonizeSync(x,O);throw new Error("rdf-canonize-native not available")}if("URDNA2015"===O.algorithm)return new P(O).main(x);if("URGNA2012"===O.algorithm)return new Q(O).main(x);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(Y,Se,he){"use strict";var W=this&&this.__createBinding||(Object.create?function(P,Q,z,v){void 0===v&&(v=z),Object.defineProperty(P,v,{enumerable:!0,get:function(){return Q[z]}})}:function(P,Q,z,v){void 0===v&&(v=z),P[v]=Q[z]}),j=this&&this.__exportStar||function(P,Q){for(var z in P)"default"!==z&&!Object.prototype.hasOwnProperty.call(Q,z)&&W(Q,P,z)};Object.defineProperty(he,"__esModule",{value:!0}),j(Y("./lib/BlankNode"),he),j(Y("./lib/DataFactory"),he),j(Y("./lib/DefaultGraph"),he),j(Y("./lib/Literal"),he),j(Y("./lib/NamedNode"),he),j(Y("./lib/Quad"),he),j(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,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.BlankNode=void 0;he.BlankNode=class{constructor(P){this.termType="BlankNode",this.value=P}equals(P){return!!P&&"BlankNode"===P.termType&&P.value===this.value}}},{}],58:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.DataFactory=void 0;const W=Y("./BlankNode"),j=Y("./DefaultGraph"),P=Y("./Literal"),Q=Y("./NamedNode"),z=Y("./Quad"),v=Y("./Variable");let x=0;he.DataFactory=class{constructor(b){this.blankNodeCounter=0,this.blankNodePrefix=(b=b||{}).blankNodePrefix||`df_${x++}_`}namedNode(b){return new Q.NamedNode(b)}blankNode(b){return new W.BlankNode(b||`${this.blankNodePrefix}${this.blankNodeCounter++}`)}literal(b,y){return new P.Literal(b,y)}variable(b){return new v.Variable(b)}defaultGraph(){return j.DefaultGraph.INSTANCE}quad(b,y,S,T){return new z.Quad(b,y,S,T||this.defaultGraph())}fromTerm(b){switch(b.termType){case"NamedNode":return this.namedNode(b.value);case"BlankNode":return this.blankNode(b.value);case"Literal":return b.language?this.literal(b.value,b.language):b.datatype.equals(P.Literal.XSD_STRING)?this.literal(b.value):this.literal(b.value,this.fromTerm(b.datatype));case"Variable":return this.variable(b.value);case"DefaultGraph":return this.defaultGraph();case"Quad":return this.quad(this.fromTerm(b.subject),this.fromTerm(b.predicate),this.fromTerm(b.object),this.fromTerm(b.graph))}}fromQuad(b){return this.fromTerm(b)}resetBlankNodeCounter(){this.blankNodeCounter=0}}},{"./BlankNode":57,"./DefaultGraph":59,"./Literal":60,"./NamedNode":61,"./Quad":62,"./Variable":63}],59:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.DefaultGraph=void 0;class W{constructor(){this.termType="DefaultGraph",this.value=""}equals(P){return!!P&&"DefaultGraph"===P.termType}}he.DefaultGraph=W,W.INSTANCE=new W},{}],60:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.Literal=void 0;const W=Y("./NamedNode");class j{constructor(Q,z){this.termType="Literal",this.value=Q,"string"==typeof z?(this.language=z,this.datatype=j.RDF_LANGUAGE_STRING):z?(this.language="",this.datatype=z):(this.language="",this.datatype=j.XSD_STRING)}equals(Q){return!!Q&&"Literal"===Q.termType&&Q.value===this.value&&Q.language===this.language&&Q.datatype.equals(this.datatype)}}he.Literal=j,j.RDF_LANGUAGE_STRING=new W.NamedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),j.XSD_STRING=new W.NamedNode("http://www.w3.org/2001/XMLSchema#string")},{"./NamedNode":61}],61:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.NamedNode=void 0;he.NamedNode=class{constructor(P){this.termType="NamedNode",this.value=P}equals(P){return!!P&&"NamedNode"===P.termType&&P.value===this.value}}},{}],62:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.Quad=void 0;he.Quad=class{constructor(P,Q,z,v){this.termType="Quad",this.value="",this.subject=P,this.predicate=Q,this.object=z,this.graph=v}equals(P){return!!P&&("Quad"===P.termType||!P.termType)&&this.subject.equals(P.subject)&&this.predicate.equals(P.predicate)&&this.object.equals(P.object)&&this.graph.equals(P.graph)}}},{}],63:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.Variable=void 0;he.Variable=class{constructor(P){this.termType="Variable",this.value=P}equals(P){return!!P&&"Variable"===P.termType&&P.value===this.value}}},{}],64:[function(Y,Se,he){"use strict";var W=this&&this.__createBinding||(Object.create?function(P,Q,z,v){void 0===v&&(v=z),Object.defineProperty(P,v,{enumerable:!0,get:function(){return Q[z]}})}:function(P,Q,z,v){void 0===v&&(v=z),P[v]=Q[z]}),j=this&&this.__exportStar||function(P,Q){for(var z in P)"default"!==z&&!Object.prototype.hasOwnProperty.call(Q,z)&&W(Q,P,z)};Object.defineProperty(he,"__esModule",{value:!0}),j(Y("./lib/RdfXmlParser"),he)},{"./lib/RdfXmlParser":66}],65:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.ParseError=void 0;class W extends Error{constructor(P,Q){const z=P.saxStream._parser;super(P.trackPosition?`Line ${z.line+1} column ${z.column+1}: ${Q}`:Q)}}he.ParseError=W},{}],66:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.ParseType=he.RdfXmlParser=void 0;const W=Y("relative-to-absolute-iri"),j=Y("sax"),P=Y("stream"),Q=Y("./ParseError"),z=Y("rdf-data-factory");class v extends P.Transform{constructor(A){super({readableObjectMode:!0}),this.activeTagStack=[],this.nodeIds={},A&&(Object.assign(this,A),this.options=A),this.dataFactory||(this.dataFactory=new z.DataFactory),this.baseIRI||(this.baseIRI=""),this.defaultGraph||(this.defaultGraph=this.dataFactory.defaultGraph()),this.saxStream=j.createStream(this.strict,{xmlns:!1,position:this.trackPosition}),this.strict||(this.saxStream._parser.looseCase="toString"),this.attachSaxListeners()}static parseNamespace(A,b){const y={};let S=!1;for(const V in A.attributes)V.startsWith("xmlns")&&(5===V.length?(S=!0,y[""]=A.attributes[V]):":"===V.charAt(5)&&(S=!0,y[V.substr(6)]=A.attributes[V]));const T=b&&b.ns?b.ns:[v.DEFAULT_NS];return S?T.concat([y]):T}static expandPrefixedTerm(A,b,y){const S=A.indexOf(":");let T,V;S>=0?(T=A.substr(0,S),V=A.substr(S+1)):(T="",V=A);let R=null,K=null;for(let ce=b.length-1;ce>=0;ce--){const D=b[ce][T];if(D){R=D;break}K||(K=b[ce][""])}if(!R){if(T&&"xmlns"!==T)throw new Q.ParseError(y,`The prefix '${T}' in term '${A}' was not bound.`);R=K||""}return{prefix:T,local:V,uri:R}}static isValidIri(A){return v.IRI_REGEX.test(A)}import(A){const b=new P.PassThrough({readableObjectMode:!0});A.on("error",S=>y.emit("error",S)),A.on("data",S=>b.push(S)),A.on("end",()=>b.push(null));const y=b.pipe(new v(this.options));return y}_transform(A,b,y){try{this.saxStream.write(A,b)}catch(S){return y(S)}y()}newParseError(A){return new Q.ParseError(this,A)}valueToUri(A,b){return this.uriToNamedNode(W.resolve(A,b.baseIRI))}uriToNamedNode(A){if(!v.isValidIri(A))throw this.newParseError(`Invalid URI: ${A}`);return this.dataFactory.namedNode(A)}validateNcname(A){if(!v.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 b=this.activeTagStack.length?this.activeTagStack[this.activeTagStack.length-1]:null;let y=x.RESOURCE;if(b&&(b.hadChildren=!0,y=b.childrenParseType),b&&b.childrenStringTags){const T=A.name;let V="";for(const D in A.attributes)V+=` ${D}="${A.attributes[D]}"`;b.childrenStringTags.push(`<${T}${V}>`);const ce={childrenStringTags:b.childrenStringTags};return ce.childrenStringEmitClosingTag=``,void this.activeTagStack.push(ce)}const S={};b?(S.language=b.language,S.baseIRI=b.baseIRI):S.baseIRI=this.baseIRI,this.activeTagStack.push(S),S.ns=v.parseNamespace(A,b),y===x.RESOURCE?this.onTagResource(A,S,b,!b):this.onTagProperty(A,S,b)}onTagResource(A,b,y,S){const T=v.expandPrefixedTerm(A.name,b.ns,this);b.childrenParseType=x.PROPERTY;let V=!0;if(T.uri===v.RDF){if(!S&&v.FORBIDDEN_NODE_ELEMENTS.indexOf(T.local)>=0)throw this.newParseError(`Illegal node element name: ${T.local}`);switch(T.local){case"RDF":b.childrenParseType=x.RESOURCE;case"Description":V=!1}}const R=[],K=[];let ce=null,D=!1,I=!1,X=null;for(const E in A.attributes){const $=A.attributes[E],Z=v.expandPrefixedTerm(E,b.ns,this);if(y&&Z.uri===v.RDF)switch(Z.local){case"about":if(ce)throw this.newParseError(`Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ${$} and ${ce} where found.`);ce=$;continue;case"ID":if(ce)throw this.newParseError(`Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ${$} and ${ce} where found.`);this.validateNcname($),ce="#"+$,D=!0;continue;case"nodeID":if(ce)throw this.newParseError(`Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ${$} and ${ce} where found.`);this.validateNcname($),ce=$,I=!0;continue;case"bagID":throw this.newParseError("rdf:bagID is not supported.");case"type":X=$;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(Z.uri===v.XML){if("lang"===Z.local){b.language=""===$?null:$.toLowerCase();continue}if("base"===Z.local){b.baseIRI=W.resolve($,b.baseIRI);continue}}"xml"!==Z.prefix&&Z.uri&&(R.push(this.uriToNamedNode(Z.uri+Z.local)),K.push($))}if(null!==ce&&(b.subject=I?this.dataFactory.blankNode(ce):this.valueToUri(ce,b),D&&this.claimNodeId(b.subject)),b.subject||(b.subject=this.dataFactory.blankNode()),V){const E=this.uriToNamedNode(T.uri+T.local);this.emitTriple(b.subject,this.dataFactory.namedNode(v.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(v.RDF+"first"),b.subject,b.reifiedStatementId),y.childrenCollectionSubject=E,y.childrenCollectionPredicate=this.dataFactory.namedNode(v.RDF+"rest")}else{this.emitTriple(y.subject,y.predicate,b.subject,y.reifiedStatementId);for(let E=0;E=0)throw this.newParseError(`Illegal property element name: ${S.local}`);b.predicateSubPredicates=[],b.predicateSubObjects=[];let T=!1,V=!1,R=null,K=!0;const ce=[],D=[];for(const I in A.attributes){const X=A.attributes[I],E=v.expandPrefixedTerm(I,b.ns,this);if(E.uri===v.RDF)switch(E.local){case"resource":if(R)throw this.newParseError(`Found both rdf:resource (${X}) and rdf:nodeID (${R}).`);if(T)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:resource (${X})`);b.hadChildren=!0,R=X,K=!1;continue;case"datatype":if(V)throw this.newParseError(`Found both non-rdf:* property attributes and rdf:datatype (${X}).`);if(T)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:datatype (${X})`);b.datatype=this.valueToUri(X,b);continue;case"nodeID":if(V)throw this.newParseError(`Found both non-rdf:* property attributes and rdf:nodeID (${X}).`);if(b.hadChildren)throw this.newParseError(`Found both rdf:resource and rdf:nodeID (${X}).`);if(T)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:nodeID (${X})`);this.validateNcname(X),b.hadChildren=!0,R=X,K=!0;continue;case"bagID":throw this.newParseError("rdf:bagID is not supported.");case"parseType":if(V)throw this.newParseError("rdf:parseType is not allowed when non-rdf:* property attributes are present");if(b.datatype)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:datatype (${b.datatype.value})`);if(R)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:nodeID or rdf:resource (${R})`);if("Resource"===X){T=!0,b.childrenParseType=x.PROPERTY;const $=this.dataFactory.blankNode();this.emitTriple(b.subject,b.predicate,$,b.reifiedStatementId),b.subject=$,b.predicate=null}else"Collection"===X?(T=!0,b.hadChildren=!0,b.childrenCollectionSubject=b.subject,b.childrenCollectionPredicate=b.predicate,K=!1):"Literal"===X&&(T=!0,b.childrenTagsToString=!0,b.childrenStringTags=[]);continue;case"ID":this.validateNcname(X),b.reifiedStatementId=this.valueToUri("#"+X,b),this.claimNodeId(b.reifiedStatementId);continue}else if(E.uri===v.XML&&"lang"===E.local){b.language=""===X?null:X.toLowerCase();continue}if("xml"!==E.prefix&&"xmlns"!==E.prefix&&E.uri){if(T||b.datatype)throw this.newParseError(`Found illegal rdf:* properties on property element with attribute: ${X}`);b.hadChildren=!0,V=!0,ce.push(this.uriToNamedNode(E.uri+E.local)),D.push(this.dataFactory.literal(X,b.datatype||b.language))}}if(null!==R){const I=b.subject;b.subject=K?this.dataFactory.blankNode(R):this.valueToUri(R,b),this.emitTriple(I,b.predicate,b.subject,b.reifiedStatementId);for(let X=0;X/g,(b,y,S)=>(this.saxStream._parser.ENTITIES[y]=S,""))}}var x,O;he.RdfXmlParser=v,v.IRI_REGEX=/^([A-Za-z][A-Za-z0-9+-.]*):[^ "<>{}|\\\[\]`]*$/,v.MIME_TYPE="application/rdf+xml",v.RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#",v.XML="http://www.w3.org/XML/1998/namespace",v.XMLNS="http://www.w3.org/2000/xmlns/",v.DEFAULT_NS={xml:v.XML},v.FORBIDDEN_NODE_ELEMENTS=["RDF","ID","about","bagID","parseType","resource","nodeID","li","aboutEach","aboutEachPrefix"],v.FORBIDDEN_PROPERTY_ELEMENTS=["Description","RDF","ID","about","bagID","parseType","resource","nodeID","aboutEach","aboutEachPrefix"],v.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=x=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(Y,Se,he){"use strict";var j={};function P(O,A,b){b||(b=Error);var S=function(T){function V(R,K,ce){return T.call(this,function(T,V,R){return"string"==typeof A?A:A(T,V,R)}(R,K,ce))||this}return function(O,A){O.prototype=Object.create(A.prototype),O.prototype.constructor=O,O.__proto__=A}(V,T),V}(b);S.prototype.name=b.name,S.prototype.code=O,j[O]=S}function Q(O,A){if(Array.isArray(O)){var b=O.length;return O=O.map(function(y){return String(y)}),b>2?"one of ".concat(A," ").concat(O.slice(0,b-1).join(", "),", or ")+O[b-1]:2===b?"one of ".concat(A," ").concat(O[0]," or ").concat(O[1]):"of ".concat(A," ").concat(O[0])}return"of ".concat(A," ").concat(String(O))}P("ERR_INVALID_OPT_VALUE",function(O,A){return'The value "'+A+'" is invalid for option "'+O+'"'},TypeError),P("ERR_INVALID_ARG_TYPE",function(O,A,b){var y,S;if("string"==typeof A&&function(O,A,b){return O.substr(!b||b<0?0:+b,A.length)===A}(A,"not ")?(y="must not be",A=A.replace(/^not /,"")):y="must be",function(O,A,b){return(void 0===b||b>O.length)&&(b=O.length),O.substring(b-A.length,b)===A}(O," argument"))S="The ".concat(O," ").concat(y," ").concat(Q(A,"type"));else{var T=function(O,A,b){return"number"!=typeof b&&(b=0),!(b+A.length>O.length)&&-1!==O.indexOf(A,b)}(O,".")?"property":"argument";S='The "'.concat(O,'" ').concat(T," ").concat(y," ").concat(Q(A,"type"))}return S+". Received type ".concat(typeof b)},TypeError),P("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),P("ERR_METHOD_NOT_IMPLEMENTED",function(O){return"The "+O+" method is not implemented"}),P("ERR_STREAM_PREMATURE_CLOSE","Premature close"),P("ERR_STREAM_DESTROYED",function(O){return"Cannot call "+O+" after a stream was destroyed"}),P("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),P("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),P("ERR_STREAM_WRITE_AFTER_END","write after end"),P("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),P("ERR_UNKNOWN_ENCODING",function(O){return"Unknown encoding: "+O},TypeError),P("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),Se.exports.codes=j},{}],68:[function(Y,Se,he){(function(W){(function(){"use strict";var j=Object.keys||function(y){var S=[];for(var T in y)S.push(T);return S};Se.exports=O;var P=Y("./_stream_readable"),Q=Y("./_stream_writable");Y("inherits")(O,P);for(var z=j(Q.prototype),v=0;v0)if("string"!=typeof L&&!Qe.objectMode&&Object.getPrototypeOf(L)!==x.prototype&&(L=function(ve){return x.from(ve)}(L)),B)Qe.endEmitted?se(ve,new E):Ie(ve,Qe,L,!0);else if(Qe.ended)se(ve,new I);else{if(Qe.destroyed)return!1;Qe.reading=!1,Qe.decoder&&!N?(L=Qe.decoder.write(L),Qe.objectMode||0!==L.length?Ie(ve,Qe,L,!1):Ke(ve,Qe)):Ie(ve,Qe,L,!1)}else B||(Qe.reading=!1,Ke(ve,Qe));return!Qe.ended&&(Qe.lengthL.highWaterMark&&(L.highWaterMark=function(ve){return ve>=st?ve=st:(ve--,ve|=ve>>>1,ve|=ve>>>2,ve|=ve>>>4,ve|=ve>>>8,ve|=ve>>>16,ve++),ve}(ve)),ve<=L.length?ve:L.ended?L.length:(L.needReadable=!0,0))}function Ue(ve){var L=ve._readableState;S("emitReadable",L.needReadable,L.emittedReadable),L.needReadable=!1,L.emittedReadable||(S("emitReadable",L.flowing),L.emittedReadable=!0,W.nextTick(ke,ve))}function ke(ve){var L=ve._readableState;S("emitReadable_",L.destroyed,L.length,L.ended),!L.destroyed&&(L.length||L.ended)&&(ve.emit("readable"),L.emittedReadable=!1),L.needReadable=!L.flowing&&!L.ended&&L.length<=L.highWaterMark,pe(ve)}function Ke(ve,L){L.readingMore||(L.readingMore=!0,W.nextTick(Me,ve,L))}function Me(ve,L){for(;!L.reading&&!L.ended&&(L.length0,L.resumeScheduled&&!L.paused?L.flowing=!0:ve.listenerCount("data")>0&&ve.resume()}function Ne(ve){S("readable nexttick read 0"),ve.read(0)}function G(ve,L){S("resume",L.reading),L.reading||ve.read(0),L.resumeScheduled=!1,ve.emit("resume"),pe(ve),L.flowing&&!L.reading&&ve.read(0)}function pe(ve){var L=ve._readableState;for(S("flow",L.flowing);L.flowing&&null!==ve.read(););}function ue(ve,L){return 0===L.length?null:(L.objectMode?N=L.buffer.shift():!ve||ve>=L.length?(N=L.decoder?L.buffer.join(""):1===L.buffer.length?L.buffer.first():L.buffer.concat(L.length),L.buffer.clear()):N=L.buffer.consume(ve,L.decoder),N);var N}function je(ve){var L=ve._readableState;S("endReadable",L.endEmitted),L.endEmitted||(L.ended=!0,W.nextTick(_t,L,ve))}function _t(ve,L){if(S("endReadableNT",ve.endEmitted,ve.length),!ve.endEmitted&&0===ve.length&&(ve.endEmitted=!0,L.readable=!1,L.emit("end"),ve.autoDestroy)){var N=L._writableState;(!N||N.autoDestroy&&N.finished)&&L.destroy()}}function pt(ve,L){for(var N=0,B=ve.length;N=L.highWaterMark:L.length>0)||L.ended))return S("read: emitReadable",L.length,L.ended),0===L.length&&L.ended?je(this):Ue(this),null;if(0===(ve=tt(ve,L))&&L.ended)return 0===L.length&&je(this),null;var Re,B=L.needReadable;return S("need readable",B),(0===L.length||L.length-ve0?ue(ve,L):null)?(L.needReadable=L.length<=L.highWaterMark,ve=0):(L.length-=ve,L.awaitDrain=0),0===L.length&&(L.ended||(L.needReadable=!0),N!==ve&&L.ended&&je(this)),null!==Re&&this.emit("data",Re),Re},ne.prototype._read=function(ve){se(this,new X("_read()"))},ne.prototype.pipe=function(ve,L){var N=this,B=this._readableState;switch(B.pipesCount){case 0:B.pipes=ve;break;case 1:B.pipes=[B.pipes,ve];break;default:B.pipes.push(ve)}B.pipesCount+=1,S("pipe count=%d opts=%j",B.pipesCount,L);var Qe=L&&!1===L.end||ve===W.stdout||ve===W.stderr?gs:Nt;function St(Bs,Qr){S("onunpipe"),Bs===N&&Qr&&!1===Qr.hasUnpiped&&(Qr.hasUnpiped=!0,S("cleanup"),ve.removeListener("close",Xr),ve.removeListener("finish",Ls),ve.removeListener("drain",On),ve.removeListener("error",wi),ve.removeListener("unpipe",St),N.removeListener("end",Nt),N.removeListener("end",gs),N.removeListener("data",Ti),kn=!0,B.awaitDrain&&(!ve._writableState||ve._writableState.needDrain)&&On())}function Nt(){S("onend"),ve.end()}B.endEmitted?W.nextTick(Qe):N.once("end",Qe),ve.on("unpipe",St);var On=function(ve){return function(){var N=ve._readableState;S("pipeOnDrain",N.awaitDrain),N.awaitDrain&&N.awaitDrain--,0===N.awaitDrain&&z(ve,"data")&&(N.flowing=!0,pe(ve))}}(N);ve.on("drain",On);var kn=!1;function Ti(Bs){S("ondata");var Qr=ve.write(Bs);S("dest.write",Qr),!1===Qr&&((1===B.pipesCount&&B.pipes===ve||B.pipesCount>1&&-1!==pt(B.pipes,ve))&&!kn&&(S("false write response, pause",B.awaitDrain),B.awaitDrain++),N.pause())}function wi(Bs){S("onerror",Bs),gs(),ve.removeListener("error",wi),0===z(ve,"error")&&se(ve,Bs)}function Xr(){ve.removeListener("finish",Ls),gs()}function Ls(){S("onfinish"),ve.removeListener("close",Xr),gs()}function gs(){S("unpipe"),N.unpipe(ve)}return N.on("data",Ti),function(ve,L,N){if("function"==typeof ve.prependListener)return ve.prependListener(L,N);ve._events&&ve._events[L]?Array.isArray(ve._events[L])?ve._events[L].unshift(N):ve._events[L]=[N,ve._events[L]]:ve.on(L,N)}(ve,"error",wi),ve.once("close",Xr),ve.once("finish",Ls),ve.emit("pipe",N),B.flowing||(S("pipe resume"),N.resume()),ve},ne.prototype.unpipe=function(ve){var L=this._readableState,N={hasUnpiped:!1};if(0===L.pipesCount)return this;if(1===L.pipesCount)return ve&&ve!==L.pipes||(ve||(ve=L.pipes),L.pipes=null,L.pipesCount=0,L.flowing=!1,ve&&ve.emit("unpipe",this,N)),this;if(!ve){var B=L.pipes,Re=L.pipesCount;L.pipes=null,L.pipesCount=0,L.flowing=!1;for(var Qe=0;Qe0,!1!==B.flowing&&this.resume()):"readable"===ve&&!B.endEmitted&&!B.readableListening&&(B.readableListening=B.needReadable=!0,B.flowing=!1,B.emittedReadable=!1,S("on readable",B.length,B.reading),B.length?Ue(this):B.reading||W.nextTick(Ne,this)),N},ne.prototype.removeListener=function(ve,L){var N=v.prototype.removeListener.call(this,ve,L);return"readable"===ve&&W.nextTick($e,this),N},ne.prototype.removeAllListeners=function(ve){var L=v.prototype.removeAllListeners.apply(this,arguments);return("readable"===ve||void 0===ve)&&W.nextTick($e,this),L},ne.prototype.resume=function(){var ve=this._readableState;return ve.flowing||(S("resume"),ve.flowing=!ve.readableListening,function(ve,L){L.resumeScheduled||(L.resumeScheduled=!0,W.nextTick(G,ve,L))}(this,ve)),ve.paused=!1,this},ne.prototype.pause=function(){return S("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(S("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},ne.prototype.wrap=function(ve){var L=this,N=this._readableState,B=!1;for(var Re in ve.on("end",function(){if(S("wrapped end"),N.decoder&&!N.ended){var St=N.decoder.end();St&&St.length&&L.push(St)}L.push(null)}),ve.on("data",function(St){S("wrapped data"),N.decoder&&(St=N.decoder.write(St)),N.objectMode&&null==St||!(N.objectMode||St&&St.length)||L.push(St)||(B=!0,ve.pause())}),ve)void 0===this[Re]&&"function"==typeof ve[Re]&&(this[Re]=function(Nt){return function(){return ve[Nt].apply(ve,arguments)}}(Re));for(var Qe=0;Qe-1))throw new Z(ue);return this._writableState.defaultEncoding=ue,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(pe,ue,je){je(new ce("_write()"))},me.prototype._writev=null,me.prototype.end=function(pe,ue,je){var _t=this._writableState;return"function"==typeof pe?(je=pe,pe=null,ue=null):"function"==typeof ue&&(je=ue,ue=null),null!=pe&&this.write(pe,ue),_t.corked&&(_t.corked=1,this.uncork()),_t.ending||function(pe,ue,je){ue.ending=!0,Ne(pe,ue),je&&(ue.finished?W.nextTick(je):pe.once("finish",je)),ue.ended=!0,pe.writable=!1}(this,_t,je),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(ue){!this._writableState||(this._writableState.destroyed=ue)}}),me.prototype.destroy=S.destroy,me.prototype._undestroy=S.undestroy,me.prototype._destroy=function(pe,ue){ue(pe)}}).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,Se,he){(function(W){(function(){"use strict";var j;function P(I,X,E){return X in I?Object.defineProperty(I,X,{value:E,enumerable:!0,configurable:!0,writable:!0}):I[X]=E,I}var Q=Y("./end-of-stream"),z=Symbol("lastResolve"),v=Symbol("lastReject"),x=Symbol("error"),O=Symbol("ended"),A=Symbol("lastPromise"),b=Symbol("handlePromise"),y=Symbol("stream");function S(I,X){return{value:I,done:X}}function T(I){var X=I[z];if(null!==X){var E=I[y].read();null!==E&&(I[A]=null,I[z]=null,I[v]=null,X(S(E,!1)))}}function V(I){W.nextTick(T,I)}var K=Object.getPrototypeOf(function(){}),ce=Object.setPrototypeOf((P(j={get stream(){return this[y]},next:function(){var X=this,E=this[x];if(null!==E)return Promise.reject(E);if(this[O])return Promise.resolve(S(void 0,!0));if(this[y].destroyed)return new Promise(function(se,te){W.nextTick(function(){X[x]?te(X[x]):se(S(void 0,!0))})});var Z,$=this[A];if($)Z=new Promise(function(I,X){return function(E,$){I.then(function(){X[O]?E(S(void 0,!0)):X[b](E,$)},$)}}($,this));else{var oe=this[y].read();if(null!==oe)return Promise.resolve(S(oe,!1));Z=new Promise(this[b])}return this[A]=Z,Z}},Symbol.asyncIterator,function(){return this}),P(j,"return",function(){var X=this;return new Promise(function(E,$){X[y].destroy(null,function(Z){Z?$(Z):E(S(void 0,!0))})})}),j),K);Se.exports=function(X){var E,$=Object.create(ce,(P(E={},y,{value:X,writable:!0}),P(E,z,{value:null,writable:!0}),P(E,v,{value:null,writable:!0}),P(E,x,{value:null,writable:!0}),P(E,O,{value:X._readableState.endEmitted,writable:!0}),P(E,b,{value:function(oe,se){var te=$[y].read();te?($[A]=null,$[z]=null,$[v]=null,oe(S(te,!1))):($[z]=oe,$[v]=se)},writable:!0}),E));return $[A]=null,Q(X,function(Z){if(Z&&"ERR_STREAM_PREMATURE_CLOSE"!==Z.code){var oe=$[v];return null!==oe&&($[A]=null,$[z]=null,$[v]=null,oe(Z)),void($[x]=Z)}var se=$[z];null!==se&&($[A]=null,$[z]=null,$[v]=null,se(S(void 0,!0))),$[O]=!0}),X.on("readable",V.bind(null,$)),$}}).call(this)}).call(this,Y("_process"))},{"./end-of-stream":76,_process:44}],74:[function(Y,Se,he){"use strict";function W(T,V){var R=Object.keys(T);if(Object.getOwnPropertySymbols){var K=Object.getOwnPropertySymbols(T);V&&(K=K.filter(function(ce){return Object.getOwnPropertyDescriptor(T,ce).enumerable})),R.push.apply(R,K)}return R}function P(T,V,R){return V in T?Object.defineProperty(T,V,{value:R,enumerable:!0,configurable:!0,writable:!0}):T[V]=R,T}function z(T,V){for(var R=0;R0?this.tail.next=K:this.head=K,this.tail=K,++this.length}},{key:"unshift",value:function(R){var K={data:R,next:this.head};0===this.length&&(this.tail=K),this.head=K,++this.length}},{key:"shift",value:function(){if(0!==this.length){var R=this.head.data;return this.head=1===this.length?this.tail=null:this.head.next,--this.length,R}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(R){if(0===this.length)return"";for(var K=this.head,ce=""+K.data;K=K.next;)ce+=R+K.data;return ce}},{key:"concat",value:function(R){if(0===this.length)return O.alloc(0);for(var K=O.allocUnsafe(R>>>0),ce=this.head,D=0;ce;)S(ce.data,K,D),D+=ce.data.length,ce=ce.next;return K}},{key:"consume",value:function(R,K){var ce;return RI.length?I.length:R;if(D+=X===I.length?I:I.slice(0,R),0==(R-=X)){X===I.length?(++ce,this.head=K.next?K.next:this.tail=null):(this.head=K,K.data=I.slice(X));break}++ce}return this.length-=ce,D}},{key:"_getBuffer",value:function(R){var K=O.allocUnsafe(R),ce=this.head,D=1;for(ce.data.copy(K),R-=ce.data.length;ce=ce.next;){var I=ce.data,X=R>I.length?I.length:R;if(I.copy(K,K.length-R,0,X),0==(R-=X)){X===I.length?(++D,this.head=ce.next?ce.next:this.tail=null):(this.head=ce,ce.data=I.slice(X));break}++D}return this.length-=D,K}},{key:y,value:function(R,K){return b(this,function(T){for(var V=1;V0,function(Z){ce||(ce=Z),Z&&D.forEach(A),!E&&(D.forEach(A),K(ce))})});return V.reduce(b)}},{"../../../errors":67,"./end-of-stream":76}],79:[function(Y,Se,he){"use strict";var W=Y("../../../errors").codes.ERR_INVALID_OPT_VALUE;Se.exports={getHighWaterMark:function(Q,z,v,x){var O=function(Q,z,v){return null!=Q.highWaterMark?Q.highWaterMark:z?Q[v]:null}(z,x,v);if(null!=O){if(!isFinite(O)||Math.floor(O)!==O||O<0)throw new W(x?v:"highWaterMark",O);return Math.floor(O)}return Q.objectMode?16:16384}}},{"../../../errors":67}],80:[function(Y,Se,he){Se.exports=Y("events").EventEmitter},{events:8}],81:[function(Y,Se,he){(he=Se.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,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),function(j){for(var P in j)he.hasOwnProperty(P)||(he[P]=j[P])}(Y("./lib/Resolve"))},{"./lib/Resolve":83}],83:[function(Y,Se,he){"use strict";function j(z){const v=[];let x=0;for(;xO.join("")).join("/")}function P(z,v){let x=v+1;v>=0?"/"===z[v+1]&&"/"===z[v+2]&&(x=v+3):"/"===z[0]&&"/"===z[1]&&(x=2);const O=z.indexOf("/",x);return O<0?z:z.substr(0,O)+j(z.substr(O))}function Q(z){return!z||"#"===z||"?"===z||"/"===z}Object.defineProperty(he,"__esModule",{value:!0}),he.resolve=function(z,v){const x=(v=v||"").indexOf("#");if(x>0&&(v=v.substr(0,x)),!z.length){if(v.indexOf(":")<0)throw new Error(`Found invalid baseIRI '${v}' for value '${z}'`);return v}if(z.startsWith("?")){const V=v.indexOf("?");return V>0&&(v=v.substr(0,V)),v+z}if(z.startsWith("#"))return v+z;if(!v.length){const V=z.indexOf(":");if(V<0)throw new Error(`Found invalid relative IRI '${z}' for a missing baseIRI`);return P(z,V)}const O=z.indexOf(":");if(O>=0)return P(z,O);const A=v.indexOf(":");if(A<0)throw new Error(`Found invalid baseIRI '${v}' for value '${z}'`);const b=v.substr(0,A+1);if(0===z.indexOf("//"))return b+P(z,O);let y;if(v.indexOf("//",A)===A+1){if(y=v.indexOf("/",A+3),y<0)return v.length>A+3?v+"/"+P(z,O):b+P(z,O)}else if(y=v.indexOf("/",A+1),y<0)return b+P(z,O);if(0===z.indexOf("/"))return v.substr(0,y)+j(z);let S=v.substr(y);const T=S.lastIndexOf("/");return T>=0&&T"===ue?(ne(G,"onsgmldeclaration",G.sgmlDecl),G.sgmlDecl="",G.state=te.TEXT):($(ue)&&(G.state=te.SGML_DECL_QUOTED),G.sgmlDecl+=ue);continue;case te.SGML_DECL_QUOTED:ue===G.q&&(G.state=te.SGML_DECL,G.q=""),G.sgmlDecl+=ue;continue;case te.DOCTYPE:">"===ue?(G.state=te.TEXT,ne(G,"ondoctype",G.doctype),G.doctype=!0):(G.doctype+=ue,"["===ue?G.state=te.DOCTYPE_DTD:$(ue)&&(G.state=te.DOCTYPE_QUOTED,G.q=ue));continue;case te.DOCTYPE_QUOTED:G.doctype+=ue,ue===G.q&&(G.q="",G.state=te.DOCTYPE);continue;case te.DOCTYPE_DTD:G.doctype+=ue,"]"===ue?G.state=te.DOCTYPE:$(ue)&&(G.state=te.DOCTYPE_DTD_QUOTED,G.q=ue);continue;case te.DOCTYPE_DTD_QUOTED:G.doctype+=ue,ue===G.q&&(G.state=te.DOCTYPE_DTD,G.q="");continue;case te.COMMENT:"-"===ue?G.state=te.COMMENT_ENDING:G.comment+=ue;continue;case te.COMMENT_ENDING:"-"===ue?(G.state=te.COMMENT_ENDED,G.comment=Ie(G.opt,G.comment),G.comment&&ne(G,"oncomment",G.comment),G.comment=""):(G.comment+="-"+ue,G.state=te.COMMENT);continue;case te.COMMENT_ENDED:">"!==ue?(Xe(G,"Malformed comment"),G.comment+="--"+ue,G.state=te.COMMENT):G.state=te.TEXT;continue;case te.CDATA:"]"===ue?G.state=te.CDATA_ENDING:G.cdata+=ue;continue;case te.CDATA_ENDING:"]"===ue?G.state=te.CDATA_ENDING_2:(G.cdata+="]"+ue,G.state=te.CDATA);continue;case te.CDATA_ENDING_2:">"===ue?(G.cdata&&ne(G,"oncdata",G.cdata),ne(G,"onclosecdata"),G.cdata="",G.state=te.TEXT):"]"===ue?G.cdata+="]":(G.cdata+="]]"+ue,G.state=te.CDATA);continue;case te.PROC_INST:"?"===ue?G.state=te.PROC_INST_ENDING:E(ue)?G.state=te.PROC_INST_BODY:G.procInstName+=ue;continue;case te.PROC_INST_BODY:if(!G.procInstBody&&E(ue))continue;"?"===ue?G.state=te.PROC_INST_ENDING:G.procInstBody+=ue;continue;case te.PROC_INST_ENDING:">"===ue?(ne(G,"onprocessinginstruction",{name:G.procInstName,body:G.procInstBody}),G.procInstName=G.procInstBody="",G.state=te.TEXT):(G.procInstBody+="?"+ue,G.state=te.PROC_INST_BODY);continue;case te.OPEN_TAG:oe(D,ue)?G.tagName+=ue:(tt(G),">"===ue?ke(G):"/"===ue?G.state=te.OPEN_TAG_SLASH:(E(ue)||Xe(G,"Invalid character in tag name"),G.state=te.ATTRIB));continue;case te.OPEN_TAG_SLASH:">"===ue?(ke(G,!0),Ke(G)):(Xe(G,"Forward-slash in opening tag not followed by >"),G.state=te.ATTRIB);continue;case te.ATTRIB:if(E(ue))continue;">"===ue?ke(G):"/"===ue?G.state=te.OPEN_TAG_SLASH:oe(ce,ue)?(G.attribName=ue,G.attribValue="",G.state=te.ATTRIB_NAME):Xe(G,"Invalid attribute name");continue;case te.ATTRIB_NAME:"="===ue?G.state=te.ATTRIB_VALUE:">"===ue?(Xe(G,"Attribute without value"),G.attribValue=G.attribName,Ue(G),ke(G)):E(ue)?G.state=te.ATTRIB_NAME_SAW_WHITE:oe(D,ue)?G.attribName+=ue:Xe(G,"Invalid attribute name");continue;case te.ATTRIB_NAME_SAW_WHITE:if("="===ue)G.state=te.ATTRIB_VALUE;else{if(E(ue))continue;Xe(G,"Attribute without value"),G.tag.attributes[G.attribName]="",G.attribValue="",ne(G,"onattribute",{name:G.attribName,value:""}),G.attribName="",">"===ue?ke(G):oe(ce,ue)?(G.attribName=ue,G.state=te.ATTRIB_NAME):(Xe(G,"Invalid attribute name"),G.state=te.ATTRIB)}continue;case te.ATTRIB_VALUE:if(E(ue))continue;$(ue)?(G.q=ue,G.state=te.ATTRIB_VALUE_QUOTED):(Xe(G,"Unquoted attribute value"),G.state=te.ATTRIB_VALUE_UNQUOTED,G.attribValue=ue);continue;case te.ATTRIB_VALUE_QUOTED:if(ue!==G.q){"&"===ue?G.state=te.ATTRIB_VALUE_ENTITY_Q:G.attribValue+=ue;continue}Ue(G),G.q="",G.state=te.ATTRIB_VALUE_CLOSED;continue;case te.ATTRIB_VALUE_CLOSED:E(ue)?G.state=te.ATTRIB:">"===ue?ke(G):"/"===ue?G.state=te.OPEN_TAG_SLASH:oe(ce,ue)?(Xe(G,"No whitespace between attributes"),G.attribName=ue,G.attribValue="",G.state=te.ATTRIB_NAME):Xe(G,"Invalid attribute name");continue;case te.ATTRIB_VALUE_UNQUOTED:if(!Z(ue)){"&"===ue?G.state=te.ATTRIB_VALUE_ENTITY_U:G.attribValue+=ue;continue}Ue(G),">"===ue?ke(G):G.state=te.ATTRIB;continue;case te.CLOSE_TAG:if(G.tagName)">"===ue?Ke(G):oe(D,ue)?G.tagName+=ue:G.script?(G.script+=""===ue?Ke(G):Xe(G,"Invalid characters in closing tag");continue;case te.TEXT_ENTITY:case te.ATTRIB_VALUE_ENTITY_Q:case te.ATTRIB_VALUE_ENTITY_U:var pt,ve;switch(G.state){case te.TEXT_ENTITY:pt=te.TEXT,ve="textNode";break;case te.ATTRIB_VALUE_ENTITY_Q:pt=te.ATTRIB_VALUE_QUOTED,ve="attribValue";break;case te.ATTRIB_VALUE_ENTITY_U:pt=te.ATTRIB_VALUE_UNQUOTED,ve="attribValue"}";"===ue?(G[ve]+=Me(G),G.entity="",G.state=pt):oe(G.entity.length?X:I,ue)?G.entity+=ue:(Xe(G,"Invalid character in entity name"),G[ve]+="&"+G.entity+ue,G.entity="",G.state=pt);continue;default:throw new Error(G,"Unknown state: "+G.state)}return G.position>=G.bufferCheckPosition&&function(q){for(var G=Math.max(j.MAX_BUFFER_LENGTH,10),pe=0,ue=0,je=P.length;ueG)switch(P[ue]){case"textNode":_e(q);break;case"cdata":ne(q,"oncdata",q.cdata),q.cdata="";break;case"script":ne(q,"onscript",q.script),q.script="";break;default:Ge(q,"Max buffer length exceeded: "+P[ue])}pe=Math.max(pe,_t)}q.bufferCheckPosition=j.MAX_BUFFER_LENGTH-pe+q.position}(G),G},resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){!function(q){_e(q),""!==q.cdata&&(ne(q,"oncdata",q.cdata),q.cdata=""),""!==q.script&&(ne(q,"onscript",q.script),q.script="")}(this)}};try{O=Y("stream").Stream}catch(q){O=function(){}}var A=j.EVENTS.filter(function(q){return"error"!==q&&"end"!==q});function y(q,G){if(!(this instanceof y))return new y(q,G);O.apply(this),this._parser=new Q(q,G),this.writable=!0,this.readable=!0;var pe=this;this._parser.onend=function(){pe.emit("end")},this._parser.onerror=function(ue){pe.emit("error",ue),pe._parser.error=null},this._decoder=null,A.forEach(function(ue){Object.defineProperty(pe,"on"+ue,{get:function(){return pe._parser["on"+ue]},set:function(je){if(!je)return pe.removeAllListeners(ue),pe._parser["on"+ue]=je,je;pe.on(ue,je)},enumerable:!0,configurable:!1})})}(y.prototype=Object.create(O.prototype,{constructor:{value:y}})).write=function(q){if("function"==typeof W&&"function"==typeof W.isBuffer&&W.isBuffer(q)){if(!this._decoder){var G=Y("string_decoder").StringDecoder;this._decoder=new G("utf8")}q=this._decoder.write(q)}return this._parser.write(q.toString()),this.emit("data",q),!0},y.prototype.end=function(q){return q&&q.length&&this.write(q),this._parser.end(),!0},y.prototype.on=function(q,G){var pe=this;return!pe._parser["on"+q]&&-1!==A.indexOf(q)&&(pe._parser["on"+q]=function(){var ue=1===arguments.length?[arguments[0]]:Array.apply(null,arguments);ue.splice(0,0,q),pe.emit.apply(pe,ue)}),O.prototype.on.call(pe,q,G)};var V="http://www.w3.org/XML/1998/namespace",R="http://www.w3.org/2000/xmlns/",K={xml:V,xmlns:R},ce=/[:_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-]/,I=/[#:_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]/,X=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;function E(q){return" "===q||"\n"===q||"\r"===q||"\t"===q}function $(q){return'"'===q||"'"===q}function Z(q){return">"===q||E(q)}function oe(q,G){return q.test(G)}function se(q,G){return!oe(q,G)}var q,G,pe,te=0;for(var Ce in j.STATE={BEGIN:te++,BEGIN_WHITESPACE:te++,TEXT:te++,TEXT_ENTITY:te++,OPEN_WAKA:te++,SGML_DECL:te++,SGML_DECL_QUOTED:te++,DOCTYPE:te++,DOCTYPE_QUOTED:te++,DOCTYPE_DTD:te++,DOCTYPE_DTD_QUOTED:te++,COMMENT_STARTING:te++,COMMENT:te++,COMMENT_ENDING:te++,COMMENT_ENDED:te++,CDATA:te++,CDATA_ENDING:te++,CDATA_ENDING_2:te++,PROC_INST:te++,PROC_INST_BODY:te++,PROC_INST_ENDING:te++,OPEN_TAG:te++,OPEN_TAG_SLASH:te++,ATTRIB:te++,ATTRIB_NAME:te++,ATTRIB_NAME_SAW_WHITE:te++,ATTRIB_VALUE:te++,ATTRIB_VALUE_QUOTED:te++,ATTRIB_VALUE_CLOSED:te++,ATTRIB_VALUE_UNQUOTED:te++,ATTRIB_VALUE_ENTITY_Q:te++,ATTRIB_VALUE_ENTITY_U:te++,CLOSE_TAG:te++,CLOSE_TAG_SAW_WHITE:te++,SCRIPT:te++,SCRIPT_ENDING:te++},j.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},j.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(j.ENTITIES).forEach(function(q){var G=j.ENTITIES[q],pe="number"==typeof G?String.fromCharCode(G):G;j.ENTITIES[q]=pe}),j.STATE)j.STATE[j.STATE[Ce]]=Ce;function me(q,G,pe){q[G]&&q[G](pe)}function ne(q,G,pe){q.textNode&&_e(q),me(q,G,pe)}function _e(q){q.textNode=Ie(q.opt,q.textNode),q.textNode&&me(q,"ontext",q.textNode),q.textNode=""}function Ie(q,G){return q.trim&&(G=G.trim()),q.normalize&&(G=G.replace(/\s+/g," ")),G}function Ge(q,G){return _e(q),q.trackPosition&&(G+="\nLine: "+q.line+"\nColumn: "+q.column+"\nChar: "+q.c),G=new Error(G),q.error=G,me(q,"onerror",G),q}function st(q){return q.sawRoot&&!q.closedRoot&&Xe(q,"Unclosed root tag"),q.state!==te.BEGIN&&q.state!==te.BEGIN_WHITESPACE&&q.state!==te.TEXT&&Ge(q,"Unexpected end"),_e(q),q.c="",q.closed=!0,me(q,"onend"),Q.call(q,q.strict,q.opt),q}function Xe(q,G){if("object"!=typeof q||!(q instanceof Q))throw new Error("bad call to strictFail");q.strict&&Ge(q,G)}function tt(q){q.strict||(q.tagName=q.tagName[q.looseCase]());var G=q.tags[q.tags.length-1]||q,pe=q.tag={name:q.tagName,attributes:{}};q.opt.xmlns&&(pe.ns=G.ns),q.attribList.length=0,ne(q,"onopentagstart",pe)}function Ye(q,G){var ue=q.indexOf(":")<0?["",q]:q.split(":"),je=ue[0],_t=ue[1];return G&&"xmlns"===q&&(je="xmlns",_t=""),{prefix:je,local:_t}}function Ue(q){if(q.strict||(q.attribName=q.attribName[q.looseCase]()),-1!==q.attribList.indexOf(q.attribName)||q.tag.attributes.hasOwnProperty(q.attribName))q.attribName=q.attribValue="";else{if(q.opt.xmlns){var G=Ye(q.attribName,!0),ue=G.local;if("xmlns"===G.prefix)if("xml"===ue&&q.attribValue!==V)Xe(q,"xml: prefix must be bound to "+V+"\nActual: "+q.attribValue);else if("xmlns"===ue&&q.attribValue!==R)Xe(q,"xmlns: prefix must be bound to "+R+"\nActual: "+q.attribValue);else{var je=q.tag,_t=q.tags[q.tags.length-1]||q;je.ns===_t.ns&&(je.ns=Object.create(_t.ns)),je.ns[ue]=q.attribValue}q.attribList.push([q.attribName,q.attribValue])}else q.tag.attributes[q.attribName]=q.attribValue,ne(q,"onattribute",{name:q.attribName,value:q.attribValue});q.attribName=q.attribValue=""}}function ke(q,G){if(q.opt.xmlns){var pe=q.tag,ue=Ye(q.tagName);pe.prefix=ue.prefix,pe.local=ue.local,pe.uri=pe.ns[ue.prefix]||"",pe.prefix&&!pe.uri&&(Xe(q,"Unbound namespace prefix: "+JSON.stringify(q.tagName)),pe.uri=ue.prefix),pe.ns&&(q.tags[q.tags.length-1]||q).ns!==pe.ns&&Object.keys(pe.ns).forEach(function(On){ne(q,"onopennamespace",{prefix:On,uri:pe.ns[On]})});for(var _t=0,pt=q.attribList.length;_t",q.tagName="",void(q.state=te.SCRIPT);ne(q,"onscript",q.script),q.script=""}var G=q.tags.length,pe=q.tagName;q.strict||(pe=pe[q.looseCase]());for(var ue=pe;G--&&q.tags[G].name!==ue;)Xe(q,"Unexpected close tag");if(G<0)return Xe(q,"Unmatched closing tag: "+q.tagName),q.textNode+="",void(q.state=te.TEXT);q.tagName=pe;for(var _t=q.tags.length;_t-- >G;){var pt=q.tag=q.tags.pop();q.tagName=q.tag.name,ne(q,"onclosetag",q.tagName);var ve={};for(var L in pt.ns)ve[L]=pt.ns[L];q.opt.xmlns&&pt.ns!==(q.tags[q.tags.length-1]||q).ns&&Object.keys(pt.ns).forEach(function(B){ne(q,"onclosenamespace",{prefix:B,uri:pt.ns[B]})})}0===G&&(q.closedRoot=!0),q.tagName=q.attribValue=q.attribName="",q.attribList.length=0,q.state=te.TEXT}function Me(q){var ue,G=q.entity,pe=G.toLowerCase(),je="";return q.ENTITIES[G]?q.ENTITIES[G]:q.ENTITIES[pe]?q.ENTITIES[pe]:("#"===(G=pe).charAt(0)&&("x"===G.charAt(1)?(G=G.slice(2),je=(ue=parseInt(G,16)).toString(16)):(G=G.slice(1),je=(ue=parseInt(G,10)).toString(10))),G=G.replace(/^0+/,""),isNaN(ue)||je.toLowerCase()!==G?(Xe(q,"Invalid character entity"),"&"+q.entity+";"):String.fromCodePoint(ue))}function Ve(q,G){"<"===G?(q.state=te.OPEN_WAKA,q.startTagPosition=q.position):E(G)||(Xe(q,"Non-whitespace before first tag."),q.textNode=G,q.state=te.TEXT)}function $e(q,G){var pe="";return G1114111||G(B)!==B)throw RangeError("Invalid code point: "+B);B<=65535?je.push(B):je.push(55296+((B-=65536)>>10),B%1024+56320),(ve+1===L||je.length>ue)&&(N+=q.apply(null,je),je.length=0)}return N},Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:pe,configurable:!0,writable:!0}):String.fromCodePoint=pe)}(void 0===he?this.sax={}:he)}).call(this)}).call(this,Y("buffer").Buffer)},{buffer:6,stream:87,string_decoder:5}],86:[function(Y,Se,he){(function(W,j){(function(){!function(P,Q){"use strict";if(!P.setImmediate){var A,z=1,v={},x=!1,O=P.document,X=Object.getPrototypeOf&&Object.getPrototypeOf(P);X=X&&X.setTimeout?X:P,"[object process]"==={}.toString.call(P.process)?A=function(E){W.nextTick(function(){T(E)})}:function(){if(P.postMessage&&!P.importScripts){var E=!0,$=P.onmessage;return P.onmessage=function(){E=!1},P.postMessage("","*"),P.onmessage=$,E}}()?(E="setImmediate$"+Math.random()+"$",$=function(Z){Z.source===P&&"string"==typeof Z.data&&0===Z.data.indexOf(E)&&T(+Z.data.slice(E.length))},P.addEventListener?P.addEventListener("message",$,!1):P.attachEvent("onmessage",$),A=function(Z){P.postMessage(E+Z,"*")}):P.MessageChannel?function(){var E=new MessageChannel;E.port1.onmessage=function($){T($.data)},A=function($){E.port2.postMessage($)}}():O&&"onreadystatechange"in O.createElement("script")?function(){var E=O.documentElement;A=function($){var Z=O.createElement("script");Z.onreadystatechange=function(){T($),Z.onreadystatechange=null,E.removeChild(Z),Z=null},E.appendChild(Z)}}():A=function(E){setTimeout(T,0,E)},X.setImmediate=function(E){"function"!=typeof E&&(E=new Function(""+E));for(var $=new Array(arguments.length-1),Z=0;Z<$.length;Z++)$[Z]=arguments[Z+1];return v[z]={callback:E,args:$},A(z),z++},X.clearImmediate=y}var E,$;function y(E){delete v[E]}function T(E){if(x)setTimeout(T,0,E);else{var $=v[E];if($){x=!0;try{!function(E){var $=E.callback,Z=E.args;switch(Z.length){case 0:$();break;case 1:$(Z[0]);break;case 2:$(Z[0],Z[1]);break;case 3:$(Z[0],Z[1],Z[2]);break;default:$.apply(void 0,Z)}}($)}finally{y(E),x=!1}}}}}("undefined"==typeof self?void 0===j?this:j:self)}).call(this)}).call(this,Y("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:44}],87:[function(Y,Se,he){Se.exports=P;var W=Y("events").EventEmitter;function P(){W.call(this)}Y("inherits")(P,W),P.Readable=Y("readable-stream/lib/_stream_readable.js"),P.Writable=Y("readable-stream/lib/_stream_writable.js"),P.Duplex=Y("readable-stream/lib/_stream_duplex.js"),P.Transform=Y("readable-stream/lib/_stream_transform.js"),P.PassThrough=Y("readable-stream/lib/_stream_passthrough.js"),P.finished=Y("readable-stream/lib/internal/streams/end-of-stream.js"),P.pipeline=Y("readable-stream/lib/internal/streams/pipeline.js"),P.Stream=P,P.prototype.pipe=function(Q,z){var v=this;function x(V){Q.writable&&!1===Q.write(V)&&v.pause&&v.pause()}function O(){v.readable&&v.resume&&v.resume()}v.on("data",x),Q.on("drain",O),!Q._isStdio&&(!z||!1!==z.end)&&(v.on("end",b),v.on("close",y));var A=!1;function b(){A||(A=!0,Q.end())}function y(){A||(A=!0,"function"==typeof Q.destroy&&Q.destroy())}function S(V){if(T(),0===W.listenerCount(this,"error"))throw V}function T(){v.removeListener("data",x),Q.removeListener("drain",O),v.removeListener("end",b),v.removeListener("close",y),v.removeListener("error",S),Q.removeListener("error",S),v.removeListener("end",T),v.removeListener("close",T),Q.removeListener("close",T)}return v.on("error",S),Q.on("error",S),v.on("end",T),v.on("close",T),Q.on("close",T),Q.emit("pipe",v),Q}},{events:8,inherits:10,"readable-stream/lib/_stream_duplex.js":68,"readable-stream/lib/_stream_passthrough.js":69,"readable-stream/lib/_stream_readable.js":70,"readable-stream/lib/_stream_transform.js":71,"readable-stream/lib/_stream_writable.js":72,"readable-stream/lib/internal/streams/end-of-stream.js":76,"readable-stream/lib/internal/streams/pipeline.js":78}],88:[function(Y,Se,he){arguments[4][5][0].apply(he,arguments)},{dup:5,"safe-buffer":84}],89:[function(Y,Se,he){(function(W,j){(function(){var P=Y("process/browser.js").nextTick,Q=Function.prototype.apply,z=Array.prototype.slice,v={},x=0;function O(A,b){this._id=A,this._clearFn=b}he.setTimeout=function(){return new O(Q.call(setTimeout,window,arguments),clearTimeout)},he.setInterval=function(){return new O(Q.call(setInterval,window,arguments),clearInterval)},he.clearTimeout=he.clearInterval=function(A){A.close()},O.prototype.unref=O.prototype.ref=function(){},O.prototype.close=function(){this._clearFn.call(window,this._id)},he.enroll=function(A,b){clearTimeout(A._idleTimeoutId),A._idleTimeout=b},he.unenroll=function(A){clearTimeout(A._idleTimeoutId),A._idleTimeout=-1},he._unrefActive=he.active=function(A){clearTimeout(A._idleTimeoutId);var b=A._idleTimeout;b>=0&&(A._idleTimeoutId=setTimeout(function(){A._onTimeout&&A._onTimeout()},b))},he.setImmediate="function"==typeof W?W:function(A){var b=x++,y=!(arguments.length<2)&&z.call(arguments,1);return v[b]=!0,P(function(){v[b]&&(y?A.apply(null,y):A.call(null),he.clearImmediate(b))}),b},he.clearImmediate="function"==typeof j?j:function(A){delete v[A]}}).call(this)}).call(this,Y("timers").setImmediate,Y("timers").clearImmediate)},{"process/browser.js":44,timers:89}],90:[function(Y,Se,he){(function(W){(function(){function P(Q){try{if(!W.localStorage)return!1}catch(v){return!1}var z=W.localStorage[Q];return null!=z&&"true"===String(z).toLowerCase()}Se.exports=function(Q,z){if(P("noDeprecation"))return Q;var v=!1;return function(){if(!v){if(P("throwDeprecation"))throw new Error(z);P("traceDeprecation")?console.trace(z):console.warn(z),v=!0}return Q.apply(this,arguments)}}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],91:[function(Y,Se,he){"use strict";Se.exports=function(W){W.prototype[Symbol.iterator]=function*(){for(let j=this.head;j;j=j.next)yield j.value}}},{}],92:[function(Y,Se,he){"use strict";function W(v){var x=this;if(x instanceof W||(x=new W),x.tail=null,x.head=null,x.length=0,v&&"function"==typeof v.forEach)v.forEach(function(b){x.push(b)});else if(arguments.length>0)for(var O=0,A=arguments.length;O1)O=x;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");A=this.head.next,O=this.head.value}for(var b=0;null!==A;b++)O=v(O,A.value,b),A=A.next;return O},W.prototype.reduceReverse=function(v,x){var O,A=this.tail;if(arguments.length>1)O=x;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");A=this.tail.prev,O=this.tail.value}for(var b=this.length-1;null!==A;b--)O=v(O,A.value,b),A=A.prev;return O},W.prototype.toArray=function(){for(var v=new Array(this.length),x=0,O=this.head;null!==O;x++)v[x]=O.value,O=O.next;return v},W.prototype.toArrayReverse=function(){for(var v=new Array(this.length),x=0,O=this.tail;null!==O;x++)v[x]=O.value,O=O.prev;return v},W.prototype.slice=function(v,x){(x=x||this.length)<0&&(x+=this.length),(v=v||0)<0&&(v+=this.length);var O=new W;if(xthis.length&&(x=this.length);for(var A=0,b=this.head;null!==b&&Athis.length&&(x=this.length);for(var A=this.length,b=this.tail;null!==b&&A>x;A--)b=b.prev;for(;null!==b&&A>v;A--,b=b.prev)O.push(b.value);return O},W.prototype.splice=function(v,x,...O){v>this.length&&(v=this.length-1),v<0&&(v=this.length+v);for(var A=0,b=this.head;null!==b&&A{"use strict";Ut.exports=Je,Ut.exports.default=Je;var it=1e20;function Je(Y,Se,he,W,j,P){this.fontSize=Y||24,this.buffer=void 0===Se?3:Se,this.cutoff=W||.25,this.fontFamily=j||"sans-serif",this.fontWeight=P||"normal",this.radius=he||8;var Q=this.size=this.fontSize+2*this.buffer,z=Q+2*this.buffer;this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=Q,this.ctx=this.canvas.getContext("2d"),this.ctx.font=this.fontWeight+" "+this.fontSize+"px "+this.fontFamily,this.ctx.textAlign="left",this.ctx.fillStyle="black",this.gridOuter=new Float64Array(z*z),this.gridInner=new Float64Array(z*z),this.f=new Float64Array(z),this.z=new Float64Array(z+1),this.v=new Uint16Array(z),this.useMetrics=void 0!==this.ctx.measureText("A").actualBoundingBoxLeft,this.middle=Math.round(Q/2*(navigator.userAgent.indexOf("Gecko/")>=0?1.2:1))}function Tt(Y,Se,he,W,j,P){for(var Q=0;Q-1);P[++v]=z,Q[v]=x,Q[v+1]=it}for(z=0,v=0;z{Ut.exports=function(Je,yt){var ee=yt.length;if(0!==ee){var Tt=Je.length;Je.length+=ee;for(var dt=0;dt{"use strict";var yt=(()=>{return(Tt=yt||(yt={})).typeOfFunction="function",Tt.boolTrue=!0,yt;var Tt})();function ee(Tt,dt,Y){if(!Y||typeof Y.value!==yt.typeOfFunction)throw new TypeError("Only methods can be decorated with @bind. <"+dt+"> is not a method!");return{configurable:yt.boolTrue,get:function(){var Se=Y.value.bind(this);return Object.defineProperty(this,dt,{value:Se,configurable:yt.boolTrue,writable:yt.boolTrue}),Se}}}it.ak=ee,it.ZP=ee},266:(Ut,it,Je)=>{Ut.exports={ResizeSensor:Je(835),ElementQueries:Je(845)}},845:function(Ut,it,Je){"use strict";var yt,ee,Tt;"undefined"!=typeof window&&window,ee=[Je(835)],void 0!==(Tt="function"==typeof(yt=function(dt){var Y=function(){var he,W={},j=[];function P(D){D||(D=document.documentElement);var I=window.getComputedStyle(D,null).fontSize;return parseFloat(I)||16}function z(D,I){var X=I.split(/\d/),E=X[X.length-1];switch(I=parseFloat(I),E){case"px":return I;case"em":return I*P(D);case"rem":return I*P();case"vw":return I*document.documentElement.clientWidth/100;case"vh":return I*document.documentElement.clientHeight/100;case"vmin":case"vmax":var $=document.documentElement.clientWidth/100,Z=document.documentElement.clientHeight/100;return I*(0,Math["vmin"===E?"min":"max"])($,Z);default:return I}}function v(D,I){this.element=D;var X,E,$,Z,oe,se,te,Ce,me=["min-width","min-height","max-width","max-height"];this.call=function(){for(X in $=function(D){if(!D.getBoundingClientRect)return{width:D.offsetWidth,height:D.offsetHeight};var I=D.getBoundingClientRect();return{width:Math.round(I.width),height:Math.round(I.height)}}(this.element),se={},W[I])!W[I].hasOwnProperty(X)||(Z=z(this.element,(E=W[I][X]).value),oe="width"===E.property?$.width:$.height,te="","min"===E.mode&&oe>=Z&&(te+=E.value),"max"===E.mode&&oe<=Z&&(te+=E.value),se[Ce=E.mode+"-"+E.property]||(se[Ce]=""),te&&-1===(" "+se[Ce]+" ").indexOf(" "+te+" ")&&(se[Ce]+=" "+te));for(var ne in me)!me.hasOwnProperty(ne)||(se[me[ne]]?this.element.setAttribute(me[ne],se[me[ne]].substr(1)):this.element.removeAttribute(me[ne]))}}function x(D,I){D.elementQueriesSetupInformation||(D.elementQueriesSetupInformation=new v(D,I)),D.elementQueriesSensor||(D.elementQueriesSensor=new dt(D,function(){D.elementQueriesSetupInformation.call()}))}function O(D,I,X,E){if(void 0===W[D]){W[D]=[];var $=j.length;he.innerHTML+="\n"+D+" {animation: 0.1s element-queries;}",he.innerHTML+="\n"+D+" > .resize-sensor {min-width: "+$+"px;}",j.push(D)}W[D].push({mode:I,property:X,value:E})}function A(D){var I;if(document.querySelectorAll&&(I=D?D.querySelectorAll.bind(D):document.querySelectorAll.bind(document)),!I&&"undefined"!=typeof $$&&(I=$$),!I&&"undefined"!=typeof jQuery&&(I=jQuery),!I)throw"No document.querySelectorAll, jQuery or Mootools's $$ found.";return I}function y(D){var I=[],X=[],E=[],$=0,Z=-1,oe=[];for(var se in D.children)if(D.children.hasOwnProperty(se)&&D.children[se].tagName&&"img"===D.children[se].tagName.toLowerCase()){I.push(D.children[se]);var te=D.children[se].getAttribute("min-width")||D.children[se].getAttribute("data-min-width"),Ce=D.children[se].getAttribute("data-src")||D.children[se].getAttribute("url");E.push(Ce),X.push({minWidth:te}),te?D.children[se].style.display="none":($=I.length-1,D.children[se].style.display="block")}function ne(){var Ie,_e=!1;for(Ie in I)!I.hasOwnProperty(Ie)||X[Ie].minWidth&&D.offsetWidth>X[Ie].minWidth&&(_e=Ie);if(_e||(_e=$),Z!==_e)if(oe[_e])I[Z].style.display="none",I[_e].style.display="block",Z=_e;else{var Ge=new Image;Ge.onload=function(){I[_e].src=E[_e],I[Z].style.display="none",I[_e].style.display="block",oe[_e]=!0,Z=_e},Ge.src=E[_e]}else I[_e].src=E[_e]}Z=$,D.resizeSensorInstance=new dt(D,ne),ne()}var T=/,?[\s\t]*([^,\n]*?)((?:\[[\s\t]*?(?:min|max)-(?:width|height)[\s\t]*?[~$\^]?=[\s\t]*?"[^"]*?"[\s\t]*?])+)([^,\n\s\{]*)/gim,V=/\[[\s\t]*?(min|max)-(width|height)[\s\t]*?[~$\^]?=[\s\t]*?"([^"]*?)"[\s\t]*?]/gim;function R(D){var I,X,E,$;for(D=D.replace(/'/g,'"');null!==(I=T.exec(D));)for(X=I[1]+I[3],E=I[2];null!==($=V.exec(E));)O(X,$[1],$[2],$[3])}function K(D){var I="";if(D)if("string"==typeof D)(-1!==(D=D.toLowerCase()).indexOf("min-width")||-1!==D.indexOf("max-width"))&&R(D);else for(var X=0,E=D.length;X 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),ce=!0);for(var I=0,X=document.styleSheets.length;I{var yt=Je(910),ee=Je(369),Tt=Je(322);function dt(Q,z,v){if(!yt(Q))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(!Q.hasNode(z))throw new Error('graphology-shortest-path: the "'+z+'" source node does not exist in the given graph.');if(!Q.hasNode(v))throw new Error('graphology-shortest-path: the "'+v+'" target node does not exist in the given graph.');if((z=""+z)==(v=""+v))return[z];var x=Q.inboundNeighbors.bind(Q),O=Q.outboundNeighbors.bind(Q),A={},b={};A[z]=null,b[v]=null;var T,V,R,K,ce,D,I,X,y=[z],S=[v],E=!1;e:for(;y.length&&S.length;)if(y.length<=S.length){for(T=y,y=[],ce=0,I=T.length;ce{Ut.exports=function(Je){return null!==Je&&"object"==typeof Je&&"function"==typeof Je.addUndirectedEdgeWithKey&&"function"==typeof Je.dropNode&&"boolean"==typeof Je.multi}},698:function(Ut){Ut.exports=function(){"use strict";function it(ie){return(it="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(fe){return typeof fe}:function(fe){return fe&&"function"==typeof Symbol&&fe.constructor===Symbol&&fe!==Symbol.prototype?"symbol":typeof fe})(ie)}function Je(ie,fe){ie.prototype=Object.create(fe.prototype),ie.prototype.constructor=ie,ee(ie,fe)}function yt(ie){return(yt=Object.setPrototypeOf?Object.getPrototypeOf:function(fe){return fe.__proto__||Object.getPrototypeOf(fe)})(ie)}function ee(ie,fe){return(ee=Object.setPrototypeOf||function(re,M){return re.__proto__=M,re})(ie,fe)}function Tt(){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(ie){return!1}}function dt(ie,fe,re){return(dt=Tt()?Reflect.construct:function(M,k,J){var we=[null];we.push.apply(we,k);var Fe=new(Function.bind.apply(M,we));return J&&ee(Fe,J.prototype),Fe}).apply(null,arguments)}function Y(ie){var fe="function"==typeof Map?new Map:void 0;return(Y=function(re){if(null===re||-1===Function.toString.call(re).indexOf("[native code]"))return re;if("function"!=typeof re)throw new TypeError("Super expression must either be null or a function");if(void 0!==fe){if(fe.has(re))return fe.get(re);fe.set(re,k)}function k(){return dt(re,arguments,yt(this).constructor)}return k.prototype=Object.create(re.prototype,{constructor:{value:k,enumerable:!1,writable:!0,configurable:!0}}),ee(k,re)})(ie)}function Se(ie){if(void 0===ie)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return ie}var he=function(){for(var ie=arguments[0],fe=1,re=arguments.length;fe0&&we.length>k&&!we.warned){we.warned=!0;var nt=new Error("Possible EventEmitter memory leak detected. "+we.length+" "+String(fe)+" listeners added. Use emitter.setMaxListeners() to increase limit");nt.name="MaxListenersExceededWarning",nt.emitter=ie,nt.type=fe,nt.count=we.length,console&&console.warn&&console.warn(nt)}return ie}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 I(ie,fe,re){var M={fired:!1,wrapFn:void 0,target:ie,type:fe,listener:re},k=D.bind(M);return k.listener=re,M.wrapFn=k,k}function X(ie,fe,re){var M=ie._events;if(void 0===M)return[];var k=M[fe];return void 0===k?[]:"function"==typeof k?re?[k.listener||k]:[k]:re?function(J){for(var we=new Array(J.length),Fe=0;Fe0&&(J=fe[0]),J instanceof Error)throw J;var we=new Error("Unhandled error."+(J?" ("+J.message+")":""));throw we.context=J,we}var Fe=k[ie];if(void 0===Fe)return!1;if("function"==typeof Fe)y(Fe,this,fe);else{var nt=Fe.length,Ot=$(Fe,nt);for(re=0;re=0;J--)if(re[J]===fe||re[J].listener===fe){we=re[J].listener,k=J;break}if(k<0)return this;0===k?re.shift():function(Fe,nt){for(;nt+1=0;M--)this.removeListener(ie,fe[M]);return this},T.prototype.listeners=function(ie){return X(this,ie,!0)},T.prototype.rawListeners=function(ie){return X(this,ie,!1)},T.listenerCount=function(ie,fe){return"function"==typeof ie.listenerCount?ie.listenerCount(fe):E.call(ie,fe)},T.prototype.listenerCount=E,T.prototype.eventNames=function(){return this._eventsCount>0?O(this._events):[]},oe.prototype.next=function(){if(this.done)return{done:!0};var ie=this._next();return ie.done&&(this.done=!0),ie},"undefined"!=typeof Symbol&&(oe.prototype[Symbol.iterator]=function(){return this}),oe.of=function(){var ie=arguments,fe=ie.length,re=0;return new oe(function(){return re>=fe?{done:!0}:{done:!1,value:ie[re++]}})},oe.empty=function(){var ie=new oe(null);return ie.done=!0,ie},oe.is=function(ie){return ie instanceof oe||"object"==typeof ie&&null!==ie&&"function"==typeof ie.next};var se=oe,te=function(ie,fe){for(var re,M=arguments.length>1?fe:1/0,k=M!==1/0?new Array(M):[],J=0;;){if(J===M)return k;if((re=ie.next()).done)return J!==fe?k.slice(0,J):k;k[J++]=re.value}},Ce=function(ie){function fe(re,M){var k;return(k=ie.call(this)||this).name="GraphError",k.message=re||"",k.data=M||{},k}return Je(fe,ie),fe}(Y(Error)),me=function(ie){function fe(re,M){var k;return(k=ie.call(this,re,M)||this).name="InvalidArgumentsGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(Se(k),fe.prototype.constructor),k}return Je(fe,ie),fe}(Ce),ne=function(ie){function fe(re,M){var k;return(k=ie.call(this,re,M)||this).name="NotFoundGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(Se(k),fe.prototype.constructor),k}return Je(fe,ie),fe}(Ce),_e=function(ie){function fe(re,M){var k;return(k=ie.call(this,re,M)||this).name="UsageGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(Se(k),fe.prototype.constructor),k}return Je(fe,ie),fe}(Ce);function Ie(ie,fe){this.key=ie,this.attributes=fe,this.inDegree=0,this.outDegree=0,this.undirectedDegree=0,this.directedSelfLoops=0,this.undirectedSelfLoops=0,this.in={},this.out={},this.undirected={}}function Ge(ie,fe){this.key=ie,this.attributes=fe,this.inDegree=0,this.outDegree=0,this.directedSelfLoops=0,this.in={},this.out={}}function st(ie,fe){this.key=ie,this.attributes=fe,this.undirectedDegree=0,this.undirectedSelfLoops=0,this.undirected={}}function Xe(ie,fe,re,M,k,J){this.key=fe,this.attributes=J,this.undirected=ie,this.source=M,this.target=k,this.generatedKey=re}function tt(ie,fe,re,M,k,J,we){var Fe,nt,Ot="out",We="in";if(fe&&(Ot=We="undirected"),ie.multi){if(void 0===(nt=(Fe=J[Ot])[k])&&(nt=new Set,Fe[k]=nt),nt.add(re),M===k&&fe)return;void 0===(Fe=we[We])[M]&&(Fe[M]=nt)}else{if(J[Ot][k]=re,M===k&&fe)return;we[We][M]=re}}function Ye(ie,fe,re){var M=ie.multi,k=re.source,J=re.target,we=k.key,Fe=J.key,nt=k[fe?"undirected":"out"],Ot=fe?"undirected":"in";if(Fe in nt)if(M){var We=nt[Fe];1===We.size?(delete nt[Fe],delete J[Ot][we]):We.delete(re)}else delete nt[Fe];M||delete J[Ot][we]}Ge.prototype.upgradeToMixed=function(){this.undirectedDegree=0,this.undirectedSelfLoops=0,this.undirected={}},st.prototype.upgradeToMixed=function(){this.inDegree=0,this.outDegree=0,this.directedSelfLoops=0,this.in={},this.out={}};var Ue=[{name:function(ie){return"get".concat(ie,"Attribute")},attacher:function(ie,fe,re){ie.prototype[fe]=function(M,k){var J;if("mixed"!==this.type&&"mixed"!==re&&re!==this.type)throw new _e("Graph.".concat(fe,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new _e("Graph.".concat(fe,": 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=""+M,Fe=""+k;if(k=arguments[2],!(J=W(this,we,Fe,re)))throw new ne("Graph.".concat(fe,': could not find an edge for the given path ("').concat(we,'" - "').concat(Fe,'").'))}else if(!(J=this._edges.get(M=""+M)))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" edge in the graph.'));if("mixed"!==re&&J.undirected!==("undirected"===re))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" ').concat(re," edge in the graph."));return J.attributes[k]}}},{name:function(ie){return"get".concat(ie,"Attributes")},attacher:function(ie,fe,re){ie.prototype[fe]=function(M){var k;if("mixed"!==this.type&&"mixed"!==re&&re!==this.type)throw new _e("Graph.".concat(fe,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>1){if(this.multi)throw new _e("Graph.".concat(fe,": 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 J=""+M,we=""+arguments[1];if(!(k=W(this,J,we,re)))throw new ne("Graph.".concat(fe,': could not find an edge for the given path ("').concat(J,'" - "').concat(we,'").'))}else if(!(k=this._edges.get(M=""+M)))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" edge in the graph.'));if("mixed"!==re&&k.undirected!==("undirected"===re))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" ').concat(re," edge in the graph."));return k.attributes}}},{name:function(ie){return"has".concat(ie,"Attribute")},attacher:function(ie,fe,re){ie.prototype[fe]=function(M,k){var J;if("mixed"!==this.type&&"mixed"!==re&&re!==this.type)throw new _e("Graph.".concat(fe,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new _e("Graph.".concat(fe,": 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=""+M,Fe=""+k;if(k=arguments[2],!(J=W(this,we,Fe,re)))throw new ne("Graph.".concat(fe,': could not find an edge for the given path ("').concat(we,'" - "').concat(Fe,'").'))}else if(!(J=this._edges.get(M=""+M)))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" edge in the graph.'));if("mixed"!==re&&J.undirected!==("undirected"===re))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" ').concat(re," edge in the graph."));return J.attributes.hasOwnProperty(k)}}},{name:function(ie){return"set".concat(ie,"Attribute")},attacher:function(ie,fe,re){ie.prototype[fe]=function(M,k,J){var we;if("mixed"!==this.type&&"mixed"!==re&&re!==this.type)throw new _e("Graph.".concat(fe,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>3){if(this.multi)throw new _e("Graph.".concat(fe,": 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=""+M,nt=""+k;if(k=arguments[2],J=arguments[3],!(we=W(this,Fe,nt,re)))throw new ne("Graph.".concat(fe,': could not find an edge for the given path ("').concat(Fe,'" - "').concat(nt,'").'))}else if(!(we=this._edges.get(M=""+M)))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" edge in the graph.'));if("mixed"!==re&&we.undirected!==("undirected"===re))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" ').concat(re," edge in the graph."));return we.attributes[k]=J,this.emit("edgeAttributesUpdated",{key:we.key,type:"set",attributes:we.attributes,name:k}),this}}},{name:function(ie){return"update".concat(ie,"Attribute")},attacher:function(ie,fe,re){ie.prototype[fe]=function(M,k,J){var we;if("mixed"!==this.type&&"mixed"!==re&&re!==this.type)throw new _e("Graph.".concat(fe,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>3){if(this.multi)throw new _e("Graph.".concat(fe,": 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=""+M,nt=""+k;if(k=arguments[2],J=arguments[3],!(we=W(this,Fe,nt,re)))throw new ne("Graph.".concat(fe,': could not find an edge for the given path ("').concat(Fe,'" - "').concat(nt,'").'))}else if(!(we=this._edges.get(M=""+M)))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" edge in the graph.'));if("function"!=typeof J)throw new me("Graph.".concat(fe,": updater should be a function."));if("mixed"!==re&&we.undirected!==("undirected"===re))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" ').concat(re," edge in the graph."));return we.attributes[k]=J(we.attributes[k]),this.emit("edgeAttributesUpdated",{key:we.key,type:"set",attributes:we.attributes,name:k}),this}}},{name:function(ie){return"remove".concat(ie,"Attribute")},attacher:function(ie,fe,re){ie.prototype[fe]=function(M,k){var J;if("mixed"!==this.type&&"mixed"!==re&&re!==this.type)throw new _e("Graph.".concat(fe,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new _e("Graph.".concat(fe,": 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=""+M,Fe=""+k;if(k=arguments[2],!(J=W(this,we,Fe,re)))throw new ne("Graph.".concat(fe,': could not find an edge for the given path ("').concat(we,'" - "').concat(Fe,'").'))}else if(!(J=this._edges.get(M=""+M)))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" edge in the graph.'));if("mixed"!==re&&J.undirected!==("undirected"===re))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" ').concat(re," edge in the graph."));return delete J.attributes[k],this.emit("edgeAttributesUpdated",{key:J.key,type:"remove",attributes:J.attributes,name:k}),this}}},{name:function(ie){return"replace".concat(ie,"Attributes")},attacher:function(ie,fe,re){ie.prototype[fe]=function(M,k){var J;if("mixed"!==this.type&&"mixed"!==re&&re!==this.type)throw new _e("Graph.".concat(fe,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new _e("Graph.".concat(fe,": 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=""+M,Fe=""+k;if(k=arguments[2],!(J=W(this,we,Fe,re)))throw new ne("Graph.".concat(fe,': could not find an edge for the given path ("').concat(we,'" - "').concat(Fe,'").'))}else if(!(J=this._edges.get(M=""+M)))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" edge in the graph.'));if(!P(k))throw new me("Graph.".concat(fe,": provided attributes are not a plain object."));if("mixed"!==re&&J.undirected!==("undirected"===re))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" ').concat(re," edge in the graph."));return J.attributes=k,this.emit("edgeAttributesUpdated",{key:J.key,type:"replace",attributes:J.attributes}),this}}},{name:function(ie){return"merge".concat(ie,"Attributes")},attacher:function(ie,fe,re){ie.prototype[fe]=function(M,k){var J;if("mixed"!==this.type&&"mixed"!==re&&re!==this.type)throw new _e("Graph.".concat(fe,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new _e("Graph.".concat(fe,": 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=""+M,Fe=""+k;if(k=arguments[2],!(J=W(this,we,Fe,re)))throw new ne("Graph.".concat(fe,': could not find an edge for the given path ("').concat(we,'" - "').concat(Fe,'").'))}else if(!(J=this._edges.get(M=""+M)))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" edge in the graph.'));if(!P(k))throw new me("Graph.".concat(fe,": provided attributes are not a plain object."));if("mixed"!==re&&J.undirected!==("undirected"===re))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" ').concat(re," edge in the graph."));return he(J.attributes,k),this.emit("edgeAttributesUpdated",{key:J.key,type:"merge",attributes:J.attributes,data:k}),this}}}],ke=se,Ke=function(){var ie,fe=arguments,re=-1;return new ke(function M(){if(!ie){if(++re>=fe.length)return{done:!0};ie=fe[re]}var k=ie.next();return k.done?(ie=null,M()):k})},Me=[{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 Ve(ie,fe){for(var re in fe)ie.push(fe[re].key)}function $e(ie,fe){for(var re in fe)fe[re].forEach(function(M){return ie.push(M.key)})}function Ne(ie,fe,re){for(var M in ie)if(M!==re){var k=ie[M];fe(k.key,k.attributes,k.source.key,k.target.key,k.source.attributes,k.target.attributes,k.undirected,k.generatedKey)}}function q(ie,fe,re){for(var M in ie)M!==re&&ie[M].forEach(function(k){return fe(k.key,k.attributes,k.source.key,k.target.key,k.source.attributes,k.target.attributes,k.undirected,k.generatedKey)})}function G(ie,fe,re){for(var M in ie)if(M!==re){var k=ie[M];if(fe(k.key,k.attributes,k.source.key,k.target.key,k.source.attributes,k.target.attributes,k.undirected,k.generatedKey))return!0}return!1}function pe(ie,fe,re){var M,k,J,we,Fe;for(var nt in ie)if(nt!==re)for(M=ie[nt].values();!0!==(k=M.next()).done;)if(we=(J=k.value).source,fe(J.key,J.attributes,we.key,(Fe=J.target).key,we.attributes,Fe.attributes,J.undirected,J.generatedKey))return!0;return!1}function ue(ie,fe){var re=Object.keys(ie),M=re.length,k=null,J=0;return new se(function we(){var Fe;if(k){var nt=k.next();if(nt.done)return k=null,J++,we();Fe=nt.value}else{if(J>=M)return{done:!0};var Ot=re[J];if(Ot===fe)return J++,we();if((Fe=ie[Ot])instanceof Set)return k=Fe.values(),we();J++}return{done:!1,value:[Fe.key,Fe.attributes,Fe.source.key,Fe.target.key,Fe.source.attributes,Fe.target.attributes]}})}function je(ie,fe,re){var M=fe[re];M&&ie.push(M.key)}function _t(ie,fe,re){var M=fe[re];M&&M.forEach(function(k){return ie.push(k.key)})}function pt(ie,fe,re){var M=ie[fe];if(M){var k=M.source,J=M.target;re(M.key,M.attributes,k.key,J.key,k.attributes,J.attributes,M.undirected,M.generatedKey)}}function ve(ie,fe,re){var M=ie[fe];M&&M.forEach(function(k){return re(k.key,k.attributes,k.source.key,k.target.key,k.source.attributes,k.target.attributes,k.undirected,k.generatedKey)})}function L(ie,fe,re){var M=ie[fe];if(M){var k=M.source,J=M.target;return re(M.key,M.attributes,k.key,J.key,k.attributes,J.attributes,M.undirected,M.generatedKey)}}function N(ie,fe,re){var M=ie[fe];if(M){for(var k,J,we=M.values();!0!==(k=we.next()).done;)if(re((J=k.value).key,J.attributes,J.source.key,J.target.key,J.source.attributes,J.target.attributes,J.undirected,J.generatedKey))return!0;return!1}}function B(ie,fe){var re=ie[fe];if(re instanceof Set){var M=re.values();return new se(function(){var k=M.next();if(k.done)return k;var J=k.value;return{done:!1,value:[J.key,J.attributes,J.source.key,J.target.key,J.source.attributes,J.target.attributes]}})}return se.of([re.key,re.attributes,re.source.key,re.target.key,re.source.attributes,re.target.attributes])}function Re(ie,fe){if(0===ie.size)return[];if("mixed"===fe||fe===ie.type)return"function"==typeof Array.from?Array.from(ie._edges.keys()):te(ie._edges.keys(),ie._edges.size);for(var re,M,J=new Array("undirected"===fe?ie.undirectedSize:ie.directedSize),we="undirected"===fe,Fe=ie._edges.values(),nt=0;!0!==(re=Fe.next()).done;)(M=re.value).undirected===we&&(J[nt++]=M.key);return J}function Qe(ie,fe,re){if(0!==ie.size)for(var M,k,J="mixed"!==fe&&fe!==ie.type,we="undirected"===fe,Fe=ie._edges.values();!0!==(M=Fe.next()).done;)if(k=M.value,!J||k.undirected===we){var Wt=k.source,xt=k.target;re(k.key,k.attributes,Wt.key,xt.key,Wt.attributes,xt.attributes,k.undirected,k.generatedKey)}}function St(ie,fe,re){if(0!==ie.size)for(var M,k,J="mixed"!==fe&&fe!==ie.type,we="undirected"===fe,Fe=ie._edges.values();!0!==(M=Fe.next()).done;)if(k=M.value,!J||k.undirected===we){var Wt=k.source,xt=k.target;if(re(k.key,k.attributes,Wt.key,xt.key,Wt.attributes,xt.attributes,k.undirected,k.generatedKey))break}}function Nt(ie,fe){if(0===ie.size)return se.empty();var re="mixed"!==fe&&fe!==ie.type,M="undirected"===fe,k=ie._edges.values();return new se(function(){for(var J,we;;){if((J=k.next()).done)return J;if(we=J.value,!re||we.undirected===M)break}return{value:[we.key,we.attributes,we.source.key,we.target.key,we.source.attributes,we.target.attributes],done:!1}})}function On(ie,fe,re,M){var k=[],J=ie?$e:Ve;return"undirected"!==fe&&("out"!==re&&J(k,M.in),"in"!==re&&J(k,M.out),!re&&M.directedSelfLoops>0&&k.splice(k.lastIndexOf(M.key),1)),"directed"!==fe&&J(k,M.undirected),k}function kn(ie,fe,re,M,k){var J=ie?q:Ne;"undirected"!==fe&&("out"!==re&&J(M.in,k),"in"!==re&&J(M.out,k,re?null:M.key)),"directed"!==fe&&J(M.undirected,k)}function Yn(ie,fe,re,M,k){var J=ie?pe:G;"undirected"!==fe&&("out"!==re&&J(M.in,k)||"in"!==re&&J(M.out,k,re?null:M.key))||"directed"===fe||J(M.undirected,k)}function Ti(ie,fe,re){var M=se.empty();return"undirected"!==ie&&("out"!==fe&&void 0!==re.in&&(M=Ke(M,ue(re.in))),"in"!==fe&&void 0!==re.out&&(M=Ke(M,ue(re.out,fe?null:re.key)))),"directed"!==ie&&void 0!==re.undirected&&(M=Ke(M,ue(re.undirected))),M}function wi(ie,fe,re,M,k){var J=fe?_t:je,we=[];return"undirected"!==ie&&(void 0!==M.in&&"out"!==re&&J(we,M.in,k),void 0!==M.out&&"in"!==re&&J(we,M.out,k),!re&&M.directedSelfLoops>0&&we.splice(we.lastIndexOf(M.key),1)),"directed"!==ie&&void 0!==M.undirected&&J(we,M.undirected,k),we}function Xr(ie,fe,re,M,k,J){var we=fe?ve:pt;"undirected"!==ie&&(void 0!==M.in&&"out"!==re&&we(M.in,k,J),M.key!==k&&void 0!==M.out&&"in"!==re&&we(M.out,k,J)),"directed"!==ie&&void 0!==M.undirected&&we(M.undirected,k,J)}function Ls(ie,fe,re,M,k,J){var we=fe?N:L;"undirected"!==ie&&(void 0!==M.in&&"out"!==re&&we(M.in,k,J)||M.key!==k&&void 0!==M.out&&"in"!==re&&we(M.out,k,J,re?null:M.key))||"directed"===ie||void 0===M.undirected||we(M.undirected,k,J)}function gs(ie,fe,re,M){var k=se.empty();return"undirected"!==ie&&(void 0!==re.in&&"out"!==fe&&M in re.in&&(k=Ke(k,B(re.in,M))),void 0!==re.out&&"in"!==fe&&M in re.out&&(k=Ke(k,B(re.out,M)))),"directed"!==ie&&void 0!==re.undirected&&M in re.undirected&&(k=Ke(k,B(re.undirected,M))),k}var Bs=[{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 Qr(ie,fe){if(void 0!==fe)for(var re in fe)ie.add(re)}function el(ie,fe,re){if("mixed"!==ie){if("undirected"===ie)return Object.keys(re.undirected);if("string"==typeof fe)return Object.keys(re[fe])}var M=new Set;return"undirected"!==ie&&("out"!==fe&&Qr(M,re.in),"in"!==fe&&Qr(M,re.out)),"directed"!==ie&&Qr(M,re.undirected),te(M.values(),M.size)}function kl(ie,fe,re){for(var M in fe){var k=fe[M];k instanceof Set&&(k=k.values().next().value);var J=k.source,Fe=J===ie?k.target:J;re(Fe.key,Fe.attributes)}}function Sa(ie,fe,re,M){for(var k in re){var J=re[k];J instanceof Set&&(J=J.values().next().value);var we=J.source,nt=we===fe?J.target:we;ie.has(nt.key)||(ie.add(nt.key),M(nt.key,nt.attributes))}}function Es(ie,fe,re){for(var M in fe){var k=fe[M];k instanceof Set&&(k=k.values().next().value);var J=k.source,Fe=J===ie?k.target:J;if(re(Fe.key,Fe.attributes))return!0}return!1}function Jt(ie,fe,re,M){for(var k in re){var J=re[k];J instanceof Set&&(J=J.values().next().value);var we=J.source,nt=we===fe?J.target:we;if(!ie.has(nt.key)&&(ie.add(nt.key),M(nt.key,nt.attributes)))return!0}return!1}function tl(ie,fe){var re=Object.keys(fe),M=re.length,k=0;return new se(function(){if(k>=M)return{done:!0};var J=fe[re[k++]];J instanceof Set&&(J=J.values().next().value);var we=J.source,nt=we===ie?J.target:we;return{done:!1,value:[nt.key,nt.attributes]}})}function rt(ie,fe,re){var M=Object.keys(re),k=M.length,J=0;return new se(function we(){if(J>=k)return{done:!0};var Fe=re[M[J++]];Fe instanceof Set&&(Fe=Fe.values().next().value);var nt=Fe.source,We=nt===fe?Fe.target:nt;return ie.has(We.key)?we():(ie.add(We.key),{done:!1,value:[We.key,We.attributes]})})}function lt(ie,fe,re,M,k){var J=ie._nodes.get(M);if("undirected"!==fe){if("out"!==re&&void 0!==J.in)for(var we in J.in)if(we===k)return!0;if("in"!==re&&void 0!==J.out)for(var Fe in J.out)if(Fe===k)return!0}if("directed"!==fe&&void 0!==J.undirected)for(var nt in J.undirected)if(nt===k)return!0;return!1}function Le(ie,fe,re){for(var M,k,J,we,Fe,nt,Ot,We=fe._nodes.values(),Wt=fe.type;!0!==(M=We.next()).done;){if(k=M.value,"undirected"!==Wt)for(J in we=k.out)if(nt=(Fe=we[J]).target,Ot=re(k.key,nt.key,k.attributes,nt.attributes,Fe.key,Fe.attributes,Fe.undirected,Fe.generatedKey),ie&&Ot)return;if("directed"!==Wt)for(J in we=k.undirected)if((nt=(Fe=we[J]).target).key!==J&&(nt=Fe.source),Ot=re(k.key,nt.key,k.attributes,nt.attributes,Fe.key,Fe.attributes,Fe.undirected,Fe.generatedKey),ie&&Ot)return}}function ut(ie,fe,re){for(var M,k,J,we,Fe,nt,Ot,We,Wt,xt=fe._nodes.values(),vn=fe.type;!0!==(M=xt.next()).done;){if(k=M.value,"undirected"!==vn)for(J in nt=k.out)for(we=nt[J].values();!0!==(Fe=we.next()).done;)if(We=(Ot=Fe.value).target,Wt=re(k.key,We.key,k.attributes,We.attributes,Ot.key,Ot.attributes,Ot.undirected,Ot.generatedKey),ie&&Wt)return;if("directed"!==vn)for(J in nt=k.undirected)for(we=nt[J].values();!0!==(Fe=we.next()).done;)if((We=(Ot=Fe.value).target).key!==J&&(We=Ot.source),Wt=re(k.key,We.key,k.attributes,We.attributes,Ot.key,Ot.attributes,Ot.undirected,Ot.generatedKey),ie&&Wt)return}}function Ze(ie,fe){var re={key:ie};return Q(fe.attributes)||(re.attributes=he({},fe.attributes)),re}function At(ie,fe){var re={source:fe.source.key,target:fe.target.key};return fe.generatedKey||(re.key=ie),Q(fe.attributes)||(re.attributes=he({},fe.attributes)),fe.undirected&&(re.undirected=!0),re}function Mt(ie){return P(ie)?"key"in ie?!("attributes"in ie)||P(ie.attributes)&&null!==ie.attributes?null:"invalid-attributes":"no-key":"not-object"}function Dt(ie){return P(ie)?"source"in ie?"target"in ie?!("attributes"in ie)||P(ie.attributes)&&null!==ie.attributes?"undirected"in ie&&"boolean"!=typeof ie.undirected?"invalid-undirected":null:"invalid-attributes":"no-target":"no-source":"not-object"}var Xt=new Set(["directed","undirected","mixed"]),zn=new Set(["domain","_events","_eventsCount","_maxListeners"]),ai={allowSelfLoops:!0,edgeKeyGenerator:null,multi:!1,type:"mixed"};function Nn(ie,fe,re){var M=new ie.NodeDataClass(fe,re);return ie._nodes.set(fe,M),ie.emit("nodeAdded",{key:fe,attributes:re}),M}function bn(ie,fe,re,M,k,J,we,Fe){if(!M&&"undirected"===ie.type)throw new _e("Graph.".concat(fe,": you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead."));if(M&&"directed"===ie.type)throw new _e("Graph.".concat(fe,": you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead."));if(Fe&&!P(Fe))throw new me("Graph.".concat(fe,': invalid attributes. Expecting an object but got "').concat(Fe,'"'));if(J=""+J,we=""+we,Fe=Fe||{},!ie.allowSelfLoops&&J===we)throw new _e("Graph.".concat(fe,': source & target are the same ("').concat(J,"\"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false."));var nt=ie._nodes.get(J),Ot=ie._nodes.get(we);if(!nt)throw new ne("Graph.".concat(fe,': source node "').concat(J,'" not found.'));if(!Ot)throw new ne("Graph.".concat(fe,': target node "').concat(we,'" not found.'));var We={key:null,undirected:M,source:J,target:we,attributes:Fe};if(re&&(k=ie._edgeKeyGenerator(We)),ie._edges.has(k=""+k))throw new _e("Graph.".concat(fe,': the "').concat(k,'" edge already exists in the graph.'));if(!ie.multi&&(M?void 0!==nt.undirected[we]:void 0!==nt.out[we]))throw new _e("Graph.".concat(fe,': an edge linking "').concat(J,'" 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 Wt=new Xe(M,k,re,nt,Ot,Fe);return ie._edges.set(k,Wt),J===we?M?(nt.undirectedSelfLoops++,ie._undirectedSelfLoopCount++):(nt.directedSelfLoops++,ie._directedSelfLoopCount++):M?(nt.undirectedDegree++,Ot.undirectedDegree++):(nt.outDegree++,Ot.inDegree++),tt(ie,M,Wt,J,we,nt,Ot),M?ie._undirectedSize++:ie._directedSize++,We.key=k,ie.emit("edgeAdded",We),k}function $n(ie,fe,re,M,k,J,we,Fe,nt){if(!M&&"undirected"===ie.type)throw new _e("Graph.".concat(fe,": you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead."));if(M&&"directed"===ie.type)throw new _e("Graph.".concat(fe,": you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead."));if(Fe)if(nt){if("function"!=typeof Fe)throw new me("Graph.".concat(fe,': invalid updater function. Expecting a function but got "').concat(Fe,'"'))}else if(!P(Fe))throw new me("Graph.".concat(fe,': invalid attributes. Expecting an object but got "').concat(Fe,'"'));var Ot;if(J=""+J,we=""+we,nt&&(Ot=Fe,Fe=void 0),!ie.allowSelfLoops&&J===we)throw new _e("Graph.".concat(fe,': source & target are the same ("').concat(J,"\"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false."));var We,Wt,xt=ie._nodes.get(J),vn=ie._nodes.get(we);if(!re&&(We=ie._edges.get(k))){if(We.source.key!==J||We.target.key!==we||M&&(We.source.key!==we||We.target.key!==J))throw new _e("Graph.".concat(fe,': inconsistency detected when attempting to merge the "').concat(k,'" edge with "').concat(J,'" source & "').concat(we,'" target vs. ("').concat(We.source.key,'", "').concat(We.target.key,'").'));Wt=We}if(Wt||ie.multi||!xt||(Wt=M?xt.undirected[we]:xt.out[we]),Wt)return(nt?Ot:Fe)?(nt?(Wt.attributes=Ot(Wt.attributes),ie.emit("edgeAttributesUpdated",{type:"replace",key:Wt.key,attributes:Wt.attributes})):(he(Wt.attributes,Fe),ie.emit("edgeAttributesUpdated",{type:"merge",key:Wt.key,attributes:Wt.attributes,data:Fe})),Wt.key):Wt.key;Fe=Fe||{},nt&&Ot&&(Fe=Ot(Fe));var Jr={key:null,undirected:M,source:J,target:we,attributes:Fe};if(re&&(k=ie._edgeKeyGenerator(Jr)),ie._edges.has(k=""+k))throw new _e("Graph.".concat(fe,': the "').concat(k,'" edge already exists in the graph.'));return xt||(xt=Nn(ie,J,{}),J===we&&(vn=xt)),vn||(vn=Nn(ie,we,{})),We=new Xe(M,k,re,xt,vn,Fe),ie._edges.set(k,We),J===we?M?(xt.undirectedSelfLoops++,ie._undirectedSelfLoopCount++):(xt.directedSelfLoops++,ie._directedSelfLoopCount++):M?(xt.undirectedDegree++,vn.undirectedDegree++):(xt.outDegree++,vn.inDegree++),tt(ie,M,We,J,we,xt,vn),M?ie._undirectedSize++:ie._directedSize++,Jr.key=k,ie.emit("edgeAdded",Jr),k}var ie,Tn=function(ie){function fe(M){var k;if(k=ie.call(this)||this,(M=he({},ai,M)).edgeKeyGenerator&&"function"!=typeof M.edgeKeyGenerator)throw new me("Graph.constructor: invalid 'edgeKeyGenerator' option. Expecting a function but got \"".concat(M.edgeKeyGenerator,'".'));if("boolean"!=typeof M.multi)throw new me("Graph.constructor: invalid 'multi' option. Expecting a boolean but got \"".concat(M.multi,'".'));if(!Xt.has(M.type))throw new me('Graph.constructor: invalid \'type\' option. Should be one of "mixed", "directed" or "undirected" but got "'.concat(M.type,'".'));if("boolean"!=typeof M.allowSelfLoops)throw new me("Graph.constructor: invalid 'allowSelfLoops' option. Expecting a boolean but got \"".concat(M.allowSelfLoops,'".'));var J,we="mixed"===M.type?Ie:"directed"===M.type?Ge:st;return z(Se(k),"NodeDataClass",we),z(Se(k),"_attributes",{}),z(Se(k),"_nodes",new Map),z(Se(k),"_edges",new Map),z(Se(k),"_directedSize",0),z(Se(k),"_undirectedSize",0),z(Se(k),"_directedSelfLoopCount",0),z(Se(k),"_undirectedSelfLoopCount",0),z(Se(k),"_edgeKeyGenerator",M.edgeKeyGenerator||(J=0,function(){return J++})),z(Se(k),"_options",M),zn.forEach(function(Fe){return z(Se(k),Fe,k[Fe])}),v(Se(k),"order",function(){return k._nodes.size}),v(Se(k),"size",function(){return k._edges.size}),v(Se(k),"directedSize",function(){return k._directedSize}),v(Se(k),"undirectedSize",function(){return k._undirectedSize}),v(Se(k),"selfLoopCount",function(){return k._directedSelfLoopCount+k._undirectedSelfLoopCount}),v(Se(k),"directedSelfLoopCount",function(){return k._directedSelfLoopCount}),v(Se(k),"undirectedSelfLoopCount",function(){return k._undirectedSelfLoopCount}),v(Se(k),"multi",k._options.multi),v(Se(k),"type",k._options.type),v(Se(k),"allowSelfLoops",k._options.allowSelfLoops),v(Se(k),"implementation",function(){return"graphology"}),k}Je(fe,ie);var re=fe.prototype;return re.hasNode=function(M){return this._nodes.has(""+M)},re.hasDirectedEdge=function(M,k){if("undirected"===this.type)return!1;if(1===arguments.length){var we=this._edges.get(""+M);return!!we&&!we.undirected}if(2===arguments.length){k=""+k;var Fe=this._nodes.get(M=""+M);if(!Fe)return!1;var nt=Fe.out[k];return!(!nt||this.multi&&!nt.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."))},re.hasUndirectedEdge=function(M,k){if("directed"===this.type)return!1;if(1===arguments.length){var we=this._edges.get(""+M);return!!we&&we.undirected}if(2===arguments.length){k=""+k;var Fe=this._nodes.get(M=""+M);if(!Fe)return!1;var nt=Fe.undirected[k];return!(!nt||this.multi&&!nt.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."))},re.hasEdge=function(M,k){if(1===arguments.length)return this._edges.has(""+M);if(2===arguments.length){k=""+k;var we=this._nodes.get(M=""+M);if(!we)return!1;var Fe=void 0!==we.out&&we.out[k];return Fe||(Fe=void 0!==we.undirected&&we.undirected[k]),!(!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."))},re.directedEdge=function(M,k){if("undirected"!==this.type){if(M=""+M,k=""+k,this.multi)throw new _e("Graph.directedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.directedEdges instead.");var J=this._nodes.get(M);if(!J)throw new ne('Graph.directedEdge: could not find the "'.concat(M,'" source node in the graph.'));if(!this._nodes.has(k))throw new ne('Graph.directedEdge: could not find the "'.concat(k,'" target node in the graph.'));var we=J.out&&J.out[k]||void 0;return we?we.key:void 0}},re.undirectedEdge=function(M,k){if("directed"!==this.type){if(M=""+M,k=""+k,this.multi)throw new _e("Graph.undirectedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.undirectedEdges instead.");var J=this._nodes.get(M);if(!J)throw new ne('Graph.undirectedEdge: could not find the "'.concat(M,'" source node in the graph.'));if(!this._nodes.has(k))throw new ne('Graph.undirectedEdge: could not find the "'.concat(k,'" target node in the graph.'));var we=J.undirected&&J.undirected[k]||void 0;return we?we.key:void 0}},re.edge=function(M,k){if(this.multi)throw new _e("Graph.edge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.edges instead.");k=""+k;var J=this._nodes.get(M=""+M);if(!J)throw new ne('Graph.edge: could not find the "'.concat(M,'" source node in the graph.'));if(!this._nodes.has(k))throw new ne('Graph.edge: could not find the "'.concat(k,'" target node in the graph.'));var we=J.out&&J.out[k]||J.undirected&&J.undirected[k]||void 0;if(we)return we.key},re.inDegree=function(M){var k=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof k)throw new me('Graph.inDegree: Expecting a boolean but got "'.concat(k,'" for the second parameter (allowing self-loops to be counted).'));var J=this._nodes.get(M=""+M);if(!J)throw new ne('Graph.inDegree: could not find the "'.concat(M,'" node in the graph.'));return"undirected"===this.type?0:J.inDegree+(k?J.directedSelfLoops:0)},re.outDegree=function(M){var k=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof k)throw new me('Graph.outDegree: Expecting a boolean but got "'.concat(k,'" for the second parameter (allowing self-loops to be counted).'));var J=this._nodes.get(M=""+M);if(!J)throw new ne('Graph.outDegree: could not find the "'.concat(M,'" node in the graph.'));return"undirected"===this.type?0:J.outDegree+(k?J.directedSelfLoops:0)},re.directedDegree=function(M){var k=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof k)throw new me('Graph.directedDegree: Expecting a boolean but got "'.concat(k,'" for the second parameter (allowing self-loops to be counted).'));var J=this._nodes.get(M=""+M);if(!J)throw new ne('Graph.directedDegree: could not find the "'.concat(M,'" node in the graph.'));if("undirected"===this.type)return 0;var we=k?J.directedSelfLoops:0;return J.inDegree+we+(J.outDegree+we)},re.undirectedDegree=function(M){var k=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof k)throw new me('Graph.undirectedDegree: Expecting a boolean but got "'.concat(k,'" for the second parameter (allowing self-loops to be counted).'));var J=this._nodes.get(M=""+M);if(!J)throw new ne('Graph.undirectedDegree: could not find the "'.concat(M,'" node in the graph.'));return"directed"===this.type?0:J.undirectedDegree+2*(k?J.undirectedSelfLoops:0)},re.degree=function(M){var k=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof k)throw new me('Graph.degree: Expecting a boolean but got "'.concat(k,'" for the second parameter (allowing self-loops to be counted).'));var J=this._nodes.get(M=""+M);if(!J)throw new ne('Graph.degree: could not find the "'.concat(M,'" node in the graph.'));var we=0,Fe=0;return"directed"!==this.type&&(k&&(Fe=J.undirectedSelfLoops),we+=J.undirectedDegree+2*Fe),"undirected"!==this.type&&(k&&(Fe=J.directedSelfLoops),we+=J.inDegree+J.outDegree+2*Fe),we},re.source=function(M){var k=this._edges.get(M=""+M);if(!k)throw new ne('Graph.source: could not find the "'.concat(M,'" edge in the graph.'));return k.source.key},re.target=function(M){var k=this._edges.get(M=""+M);if(!k)throw new ne('Graph.target: could not find the "'.concat(M,'" edge in the graph.'));return k.target.key},re.extremities=function(M){var k=this._edges.get(M=""+M);if(!k)throw new ne('Graph.extremities: could not find the "'.concat(M,'" edge in the graph.'));return[k.source.key,k.target.key]},re.opposite=function(M,k){M=""+M;var J=this._edges.get(k=""+k);if(!J)throw new ne('Graph.opposite: could not find the "'.concat(k,'" edge in the graph.'));var we=J.source.key,Fe=J.target.key;if(M!==we&&M!==Fe)throw new ne('Graph.opposite: the "'.concat(M,'" node is not attached to the "').concat(k,'" edge (').concat(we,", ").concat(Fe,")."));return M===we?Fe:we},re.hasExtremity=function(M,k){k=""+k;var J=this._edges.get(M=""+M);if(!J)throw new ne('Graph.hasExtremity: could not find the "'.concat(M,'" edge in the graph.'));return J.source.key===k||J.target.key===k},re.isUndirected=function(M){var k=this._edges.get(M=""+M);if(!k)throw new ne('Graph.isUndirected: could not find the "'.concat(M,'" edge in the graph.'));return k.undirected},re.isDirected=function(M){var k=this._edges.get(M=""+M);if(!k)throw new ne('Graph.isDirected: could not find the "'.concat(M,'" edge in the graph.'));return!k.undirected},re.isSelfLoop=function(M){var k=this._edges.get(M=""+M);if(!k)throw new ne('Graph.isSelfLoop: could not find the "'.concat(M,'" edge in the graph.'));return k.source===k.target},re.hasGeneratedKey=function(M){var k=this._edges.get(M=""+M);if(!k)throw new ne('Graph.hasGeneratedKey: could not find the "'.concat(M,'" edge in the graph.'));return k.generatedKey},re.addNode=function(M,k){return function(J,we,Fe){if(Fe&&!P(Fe))throw new me('Graph.addNode: invalid attributes. Expecting an object but got "'.concat(Fe,'"'));if(Fe=Fe||{},J._nodes.has(we=""+we))throw new _e('Graph.addNode: the "'.concat(we,'" node already exist in the graph.'));var nt=new J.NodeDataClass(we,Fe);return J._nodes.set(we,nt),J.emit("nodeAdded",{key:we,attributes:Fe}),nt}(this,M,k).key},re.mergeNode=function(M,k){if(k&&!P(k))throw new me('Graph.mergeNode: invalid attributes. Expecting an object but got "'.concat(k,'"'));k=k||{};var J=this._nodes.get(M=""+M);return J?(k&&(he(J.attributes,k),this.emit("nodeAttributesUpdated",{type:"merge",key:M,attributes:J.attributes,data:k})),M):(J=new this.NodeDataClass(M,k),this._nodes.set(M,J),this.emit("nodeAdded",{key:M,attributes:k}),M)},re.updateNode=function(M,k){if(k&&"function"!=typeof k)throw new me('Graph.updateNode: invalid updater function. Expecting a function but got "'.concat(k,'"'));var J=this._nodes.get(M=""+M);if(J)return k&&(J.attributes=k(J.attributes),this.emit("nodeAttributesUpdated",{type:"replace",key:M,attributes:J.attributes})),M;var Fe=k?k({}):{};return J=new this.NodeDataClass(M,Fe),this._nodes.set(M,J),this.emit("nodeAdded",{key:M,attributes:Fe}),M},re.dropNode=function(M){var k=this,J=this._nodes.get(M=""+M);if(!J)throw new ne('Graph.dropNode: could not find the "'.concat(M,'" node in the graph.'));this.forEachEdge(M,function(we){k.dropEdge(we)}),this._nodes.delete(M),this.emit("nodeDropped",{key:M,attributes:J.attributes})},re.dropEdge=function(M){var k;if(arguments.length>1){var J=""+arguments[0],we=""+arguments[1];if(!(k=W(this,J,we,this.type)))throw new ne('Graph.dropEdge: could not find the "'.concat(J,'" -> "').concat(we,'" edge in the graph.'))}else if(!(k=this._edges.get(M=""+M)))throw new ne('Graph.dropEdge: could not find the "'.concat(M,'" edge in the graph.'));this._edges.delete(k.key);var nt=k.source,Ot=k.target,We=k.attributes,Wt=k.undirected;return nt===Ot?Wt?(nt.undirectedSelfLoops--,this._undirectedSelfLoopCount--):(nt.directedSelfLoops--,this._directedSelfLoopCount--):Wt?(nt.undirectedDegree--,Ot.undirectedDegree--):(nt.outDegree--,Ot.inDegree--),Ye(this,Wt,k),Wt?this._undirectedSize--:this._directedSize--,this.emit("edgeDropped",{key:M,attributes:We,source:nt.key,target:Ot.key,undirected:Wt}),this},re.clear=function(){this._edges.clear(),this._nodes.clear(),this.emit("cleared")},re.clearEdges=function(){this._edges.clear(),this.clearIndex(),this.emit("edgesCleared")},re.getAttribute=function(M){return this._attributes[M]},re.getAttributes=function(){return this._attributes},re.hasAttribute=function(M){return this._attributes.hasOwnProperty(M)},re.setAttribute=function(M,k){return this._attributes[M]=k,this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:M}),this},re.updateAttribute=function(M,k){if("function"!=typeof k)throw new me("Graph.updateAttribute: updater should be a function.");return this._attributes[M]=k(this._attributes[M]),this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:M}),this},re.removeAttribute=function(M){return delete this._attributes[M],this.emit("attributesUpdated",{type:"remove",attributes:this._attributes,name:M}),this},re.replaceAttributes=function(M){if(!P(M))throw new me("Graph.replaceAttributes: provided attributes are not a plain object.");return this._attributes=M,this.emit("attributesUpdated",{type:"replace",attributes:this._attributes}),this},re.mergeAttributes=function(M){if(!P(M))throw new me("Graph.mergeAttributes: provided attributes are not a plain object.");return he(this._attributes,M),this.emit("attributesUpdated",{type:"merge",attributes:this._attributes,data:M}),this},re.getNodeAttribute=function(M,k){var J=this._nodes.get(M=""+M);if(!J)throw new ne('Graph.getNodeAttribute: could not find the "'.concat(M,'" node in the graph.'));return J.attributes[k]},re.getNodeAttributes=function(M){var k=this._nodes.get(M=""+M);if(!k)throw new ne('Graph.getNodeAttributes: could not find the "'.concat(M,'" node in the graph.'));return k.attributes},re.hasNodeAttribute=function(M,k){var J=this._nodes.get(M=""+M);if(!J)throw new ne('Graph.hasNodeAttribute: could not find the "'.concat(M,'" node in the graph.'));return J.attributes.hasOwnProperty(k)},re.setNodeAttribute=function(M,k,J){var we=this._nodes.get(M=""+M);if(!we)throw new ne('Graph.setNodeAttribute: could not find the "'.concat(M,'" 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[k]=J,this.emit("nodeAttributesUpdated",{key:M,type:"set",attributes:we.attributes,name:k}),this},re.updateNodeAttribute=function(M,k,J){var we=this._nodes.get(M=""+M);if(!we)throw new ne('Graph.updateNodeAttribute: could not find the "'.concat(M,'" 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 J)throw new me("Graph.updateAttribute: updater should be a function.");var Fe=we.attributes,nt=J(Fe[k]);return Fe[k]=nt,this.emit("nodeAttributesUpdated",{key:M,type:"set",attributes:we.attributes,name:k}),this},re.removeNodeAttribute=function(M,k){var J=this._nodes.get(M=""+M);if(!J)throw new ne('Graph.hasNodeAttribute: could not find the "'.concat(M,'" node in the graph.'));return delete J.attributes[k],this.emit("nodeAttributesUpdated",{key:M,type:"remove",attributes:J.attributes,name:k}),this},re.replaceNodeAttributes=function(M,k){var J=this._nodes.get(M=""+M);if(!J)throw new ne('Graph.replaceNodeAttributes: could not find the "'.concat(M,'" node in the graph.'));if(!P(k))throw new me("Graph.replaceNodeAttributes: provided attributes are not a plain object.");return J.attributes=k,this.emit("nodeAttributesUpdated",{key:M,type:"replace",attributes:J.attributes}),this},re.mergeNodeAttributes=function(M,k){var J=this._nodes.get(M=""+M);if(!J)throw new ne('Graph.mergeNodeAttributes: could not find the "'.concat(M,'" node in the graph.'));if(!P(k))throw new me("Graph.mergeNodeAttributes: provided attributes are not a plain object.");return he(J.attributes,k),this.emit("nodeAttributesUpdated",{key:M,type:"merge",attributes:J.attributes,data:k}),this},re.updateEachNodeAttributes=function(M,k){if("function"!=typeof M)throw new me("Graph.updateEachNodeAttributes: expecting an updater function.");if(k&&!x(k))throw new me("Graph.updateEachNodeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");for(var J,we,Fe=this._nodes.values();!0!==(J=Fe.next()).done;)(we=J.value).attributes=M(we.key,we.attributes);this.emit("eachNodeAttributesUpdated",{hints:k||null})},re.updateEachEdgeAttributes=function(M,k){if("function"!=typeof M)throw new me("Graph.updateEachEdgeAttributes: expecting an updater function.");if(k&&!x(k))throw new me("Graph.updateEachEdgeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");for(var J,we,Fe=this._edges.values();!0!==(J=Fe.next()).done;)(we=J.value).attributes=M(we.key,we.attributes);this.emit("eachEdgeAttributesUpdated",{hints:k||null})},re.forEach=function(M){if("function"!=typeof M)throw new me("Graph.forEach: expecting a callback.");this.multi?ut(!1,this,M):Le(!1,this,M)},re.forEachUntil=function(M){if("function"!=typeof M)throw new me("Graph.forEach: expecting a callback.");this.multi?ut(!0,this,M):Le(!0,this,M)},re.adjacency=function(){return this.multi?(nt=(M=this)._nodes.values(),Ot=M.type,We="outer",Wt=null,new se(function xt(){var vn;if("outer"===We)return!0===(vn=nt.next()).done?vn:(k=vn.value,We="directed",xt());if("directed"===We)return"undirected"===Ot?(We="undirected",xt()):(we=k.out,J=Object.keys(k.out),Fe=0,We="inner-directed",xt());if("undirected"===We){if("directed"===Ot)return We="outer",xt();we=k.undirected,J=Object.keys(k.undirected),Fe=0,We="inner-undirected"}if(!Wt&&Fe>=J.length)return We="inner-undirected"===We?"outer":"undirected",xt();if(!Wt){var Ss=J[Fe++];return Wt=we[Ss].values(),xt()}if((vn=Wt.next()).done)return Wt=null,xt();var Jr=vn.value,Qs=Jr.target;return"inner-undirected"===We&&Qs.key===k.key&&(Qs=Jr.source),{done:!1,value:[k.key,Qs.key,k.attributes,Qs.attributes,Jr.key,Jr.attributes]}})):(Ll=(xt=this)._nodes.values(),po=xt.type,jr="outer",new se(function js(){var xc;if("outer"===jr)return!0===(xc=Ll.next()).done?xc:(vn=xc.value,jr="directed",js());if("directed"===jr)return"undirected"===po?(jr="undirected",js()):(Jr=vn.out,Ss=Object.keys(vn.out),Qs=0,jr="inner-directed",js());if("undirected"===jr){if("directed"===po)return jr="outer",js();Jr=vn.undirected,Ss=Object.keys(vn.undirected),Qs=0,jr="inner-undirected"}if(Qs>=Ss.length)return jr="inner-undirected"===jr?"outer":"undirected",js();var Sn=Ss[Qs++],go=Jr[Sn],Bl=go.target;return"inner-undirected"===jr&&Bl.key===vn.key&&(Bl=go.source),{done:!1,value:[vn.key,Bl.key,vn.attributes,Bl.attributes,go.key,go.attributes]}}));var xt,vn,Ss,Jr,Qs,Ll,po,jr,M,k,J,we,Fe,nt,Ot,We,Wt},re.nodes=function(){return"function"==typeof Array.from?Array.from(this._nodes.keys()):te(this._nodes.keys(),this._nodes.size)},re.forEachNode=function(M){if("function"!=typeof M)throw new me("Graph.forEachNode: expecting a callback.");this._nodes.forEach(function(k,J){M(J,k.attributes)})},re.forEachNodeUntil=function(M){if("function"!=typeof M)throw new me("Graph.forEachNode: expecting a callback.");for(var k,J,we=this._nodes.values();!0!==(k=we.next())&&!M((J=k.value).key,J.attributes););},re.nodeEntries=function(){var M=this._nodes.values();return new se(function(){var k=M.next();if(k.done)return k;var J=k.value;return{value:[J.key,J.attributes],done:!1}})},re.exportNode=function(M){var k=this._nodes.get(M=""+M);if(!k)throw new ne('Graph.exportNode: could not find the "'.concat(M,'" node in the graph.'));return Ze(M,k)},re.exportEdge=function(M){var k=this._edges.get(M=""+M);if(!k)throw new ne('Graph.exportEdge: could not find the "'.concat(M,'" edge in the graph.'));return At(M,k)},re.export=function(){var M=new Array(this._nodes.size),k=0;this._nodes.forEach(function(we,Fe){M[k++]=Ze(Fe,we)});var J=new Array(this._edges.size);return k=0,this._edges.forEach(function(we,Fe){J[k++]=At(Fe,we)}),{attributes:this.getAttributes(),nodes:M,edges:J,options:{type:this.type,multi:this.multi,allowSelfLoops:this.allowSelfLoops}}},re.importNode=function(M){var k=arguments.length>1&&void 0!==arguments[1]&&arguments[1],J=Mt(M);if(J){if("not-object"===J)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"===J)throw new me("Graph.importNode: no key provided.");if("invalid-attributes"===J)throw new me("Graph.importNode: invalid attributes. Attributes should be a plain object, null or omitted.")}var we=M.key,Fe=M.attributes,nt=void 0===Fe?{}:Fe;return k?this.mergeNode(we,nt):this.addNode(we,nt),this},re.importEdge=function(M){var k=arguments.length>1&&void 0!==arguments[1]&&arguments[1],J=Dt(M);if(J){if("not-object"===J)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"===J)throw new me("Graph.importEdge: missing souce.");if("no-target"===J)throw new me("Graph.importEdge: missing target.");if("invalid-attributes"===J)throw new me("Graph.importEdge: invalid attributes. Attributes should be a plain object, null or omitted.");if("invalid-undirected"===J)throw new me("Graph.importEdge: invalid undirected. Undirected should be boolean or omitted.")}var we=M.source,Fe=M.target,nt=M.attributes,Ot=void 0===nt?{}:nt,We=M.undirected,Wt=void 0!==We&&We;return"key"in M?(k?Wt?this.mergeUndirectedEdgeWithKey:this.mergeDirectedEdgeWithKey:Wt?this.addUndirectedEdgeWithKey:this.addDirectedEdgeWithKey).call(this,M.key,we,Fe,Ot):(k?Wt?this.mergeUndirectedEdge:this.mergeDirectedEdge:Wt?this.addUndirectedEdge:this.addDirectedEdge).call(this,we,Fe,Ot),this},re.import=function(M){var k,J,we,Fe=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(j(M))return this.import(M.export(),Fe),this;if(!P(M))throw new me("Graph.import: invalid argument. Expecting a serialized graph or, alternatively, a Graph instance.");if(M.attributes){if(!P(M.attributes))throw new me("Graph.import: invalid attributes. Expecting a plain object.");Fe?this.mergeAttributes(M.attributes):this.replaceAttributes(M.attributes)}if(M.nodes){if(we=M.nodes,!Array.isArray(we))throw new me("Graph.import: invalid nodes. Expecting an array.");for(k=0,J=we.length;kJ)){var Ot=new Set;Ot.add(k.undirected[nt]),k.undirected[nt]=Ot,M._nodes.get(nt).undirected[J]=Ot}})),this;var M},re.clearIndex=function(){return this._nodes.forEach(function(M){void 0!==M.in&&(M.in={},M.out={}),void 0!==M.undirected&&(M.undirected={})}),this},re.toJSON=function(){return this.export()},re.toString=function(){return"[object Graph]"},re.inspect=function(){var M=this,k={};this._nodes.forEach(function(Ot,We){k[We]=Ot.attributes});var J={},we={};this._edges.forEach(function(Ot,We){var Wt=Ot.undirected?"--":"->",xt="",vn="(".concat(Ot.source.key,")").concat(Wt,"(").concat(Ot.target.key,")");Ot.generatedKey?M.multi&&(void 0===we[vn]?we[vn]=0:we[vn]++,xt+="".concat(we[vn],". ")):xt+="[".concat(We,"]: "),J[xt+=vn]=Ot.attributes});var Fe={};for(var nt in this)this.hasOwnProperty(nt)&&!zn.has(nt)&&"function"!=typeof this[nt]&&(Fe[nt]=this[nt]);return Fe.attributes=this._attributes,Fe.nodes=k,Fe.edges=J,z(Fe,"constructor",this.constructor),Fe},fe}(A.exports.EventEmitter);"undefined"!=typeof Symbol&&(Tn.prototype[Symbol.for("nodejs.util.inspect.custom")]=Tn.prototype.inspect),[{name:function(ie){return"".concat(ie,"Edge")},generateKey:!0},{name:function(ie){return"".concat(ie,"DirectedEdge")},generateKey:!0,type:"directed"},{name:function(ie){return"".concat(ie,"UndirectedEdge")},generateKey:!0,type:"undirected"},{name:function(ie){return"".concat(ie,"EdgeWithKey")}},{name:function(ie){return"".concat(ie,"DirectedEdgeWithKey")},type:"directed"},{name:function(ie){return"".concat(ie,"UndirectedEdgeWithKey")},type:"undirected"}].forEach(function(ie){["add","merge","update"].forEach(function(fe){var re=ie.name(fe),M="add"===fe?bn:$n;Tn.prototype[re]=ie.generateKey?function(k,J,we){return M(this,re,!0,"undirected"===(ie.type||this.type),null,k,J,we,"update"===fe)}:function(k,J,we,Fe){return M(this,re,!1,"undirected"===(ie.type||this.type),k,J,we,Fe,"update"===fe)}})}),"undefined"!=typeof Symbol&&(Tn.prototype[Symbol.iterator]=Tn.prototype.adjacency),ie=Tn,Ue.forEach(function(fe){var re=fe.name,M=fe.attacher;M(ie,re("Edge"),"mixed"),M(ie,re("DirectedEdge"),"directed"),M(ie,re("UndirectedEdge"),"undirected")}),function(ie){Me.forEach(function(fe){var M,k,J,we;J=(M=fe).type,we=M.direction,ie.prototype[k=M.name]=function(Fe,nt){if("mixed"!==J&&"mixed"!==this.type&&J!==this.type)return[];if(!arguments.length)return Re(this,J);if(1===arguments.length){var Ot=this._nodes.get(Fe=""+Fe);if(void 0===Ot)throw new ne("Graph.".concat(k,': could not find the "').concat(Fe,'" node in the graph.'));return On(this.multi,"mixed"===J?this.type:J,we,Ot)}if(2===arguments.length){nt=""+nt;var We=this._nodes.get(Fe=""+Fe);if(!We)throw new ne("Graph.".concat(k,': could not find the "').concat(Fe,'" source node in the graph.'));if(!this._nodes.has(nt))throw new ne("Graph.".concat(k,': could not find the "').concat(nt,'" target node in the graph.'));return wi(J,this.multi,we,We,nt)}throw new me("Graph.".concat(k,": too many arguments (expecting 0, 1 or 2 and got ").concat(arguments.length,")."))},function(re,M){var k=M.name,J=M.type,we=M.direction,Fe="forEach"+k[0].toUpperCase()+k.slice(1,-1);re.prototype[Fe]=function(nt,Ot,We){if("mixed"===J||"mixed"===this.type||J===this.type){if(1===arguments.length)return Qe(this,J,We=nt);if(2===arguments.length){We=Ot;var Wt=this._nodes.get(nt=""+nt);if(void 0===Wt)throw new ne("Graph.".concat(Fe,': could not find the "').concat(nt,'" node in the graph.'));return kn(this.multi,"mixed"===J?this.type:J,we,Wt,We)}if(3===arguments.length){Ot=""+Ot;var xt=this._nodes.get(nt=""+nt);if(!xt)throw new ne("Graph.".concat(Fe,': could not find the "').concat(nt,'" source node in the graph.'));if(!this._nodes.has(Ot))throw new ne("Graph.".concat(Fe,': could not find the "').concat(Ot,'" target node in the graph.'));return Xr(J,this.multi,we,xt,Ot,We)}throw new me("Graph.".concat(Fe,": too many arguments (expecting 1, 2 or 3 and got ").concat(arguments.length,")."))}}}(ie,fe),function(re,M){var k=M.name,J=M.type,we=M.direction,Fe="forEach"+k[0].toUpperCase()+k.slice(1,-1)+"Until";re.prototype[Fe]=function(nt,Ot,We){if("mixed"===J||"mixed"===this.type||J===this.type){if(1===arguments.length)return St(this,J,We=nt);if(2===arguments.length){We=Ot;var Wt=this._nodes.get(nt=""+nt);if(void 0===Wt)throw new ne("Graph.".concat(Fe,': could not find the "').concat(nt,'" node in the graph.'));return Yn(this.multi,"mixed"===J?this.type:J,we,Wt,We)}if(3===arguments.length){Ot=""+Ot;var xt=this._nodes.get(nt=""+nt);if(!xt)throw new ne("Graph.".concat(Fe,': could not find the "').concat(nt,'" source node in the graph.'));if(!this._nodes.has(Ot))throw new ne("Graph.".concat(Fe,': could not find the "').concat(Ot,'" target node in the graph.'));return Ls(J,this.multi,we,xt,Ot,We)}throw new me("Graph.".concat(Fe,": too many arguments (expecting 1, 2 or 3 and got ").concat(arguments.length,")."))}}}(ie,fe),function(re,M){var J=M.type,we=M.direction,Fe=M.name.slice(0,-1)+"Entries";re.prototype[Fe]=function(nt,Ot){if("mixed"!==J&&"mixed"!==this.type&&J!==this.type)return se.empty();if(!arguments.length)return Nt(this,J);if(1===arguments.length){var We=this._nodes.get(nt=""+nt);if(!We)throw new ne("Graph.".concat(Fe,': could not find the "').concat(nt,'" node in the graph.'));return Ti(J,we,We)}if(2===arguments.length){Ot=""+Ot;var Wt=this._nodes.get(nt=""+nt);if(!Wt)throw new ne("Graph.".concat(Fe,': could not find the "').concat(nt,'" source node in the graph.'));if(!this._nodes.has(Ot))throw new ne("Graph.".concat(Fe,': could not find the "').concat(Ot,'" target node in the graph.'));return gs(J,we,Wt,Ot)}throw new me("Graph.".concat(Fe,": too many arguments (expecting 0, 1 or 2 and got ").concat(arguments.length,")."))}}(ie,fe)})}(Tn),function(ie){Bs.forEach(function(fe){var M,k,J,we;J=(M=fe).type,we=M.direction,ie.prototype[k=M.name]=function(Fe){if("mixed"!==J&&"mixed"!==this.type&&J!==this.type)return[];if(2===arguments.length){var nt=""+arguments[0],Ot=""+arguments[1];if(!this._nodes.has(nt))throw new ne("Graph.".concat(k,': could not find the "').concat(nt,'" node in the graph.'));if(!this._nodes.has(Ot))throw new ne("Graph.".concat(k,': could not find the "').concat(Ot,'" node in the graph.'));return lt(this,J,we,nt,Ot)}if(1===arguments.length){var We=this._nodes.get(Fe=""+Fe);if(void 0===We)throw new ne("Graph.".concat(k,': could not find the "').concat(Fe,'" node in the graph.'));return el("mixed"===J?this.type:J,we,We)}throw new me("Graph.".concat(k,": invalid number of arguments (expecting 1 or 2 and got ").concat(arguments.length,")."))},function(ie,fe){var re=fe.name,M=fe.type,k=fe.direction,J="forEach"+re[0].toUpperCase()+re.slice(1,-1);ie.prototype[J]=function(we,Fe){if("mixed"===M||"mixed"===this.type||M===this.type){var nt=this._nodes.get(we=""+we);if(void 0===nt)throw new ne("Graph.".concat(J,': could not find the "').concat(we,'" node in the graph.'));!function(Ot,We,Wt,xt){if("mixed"!==Ot){if("undirected"===Ot)return kl(Wt,Wt.undirected,xt);if("string"==typeof We)return kl(Wt,Wt[We],xt)}var vn=new Set;"undirected"!==Ot&&("out"!==We&&Sa(vn,Wt,Wt.in,xt),"in"!==We&&Sa(vn,Wt,Wt.out,xt)),"directed"!==Ot&&Sa(vn,Wt,Wt.undirected,xt)}("mixed"===M?this.type:M,k,nt,Fe)}}}(ie,fe),function(ie,fe){var re=fe.name,M=fe.type,k=fe.direction,J="forEach"+re[0].toUpperCase()+re.slice(1,-1)+"Until";ie.prototype[J]=function(we,Fe){if("mixed"===M||"mixed"===this.type||M===this.type){var nt=this._nodes.get(we=""+we);if(void 0===nt)throw new ne("Graph.".concat(J,': could not find the "').concat(we,'" node in the graph.'));!function(Ot,We,Wt,xt){if("mixed"!==Ot){if("undirected"===Ot)return Es(Wt,Wt.undirected,xt);if("string"==typeof We)return Es(Wt,Wt[We],xt)}var vn=new Set;"undirected"!==Ot&&("out"!==We&&Jt(vn,Wt,Wt.in,xt)||"in"!==We&&Jt(vn,Wt,Wt.out,xt))||"directed"===Ot||Jt(vn,Wt,Wt.undirected,xt)}("mixed"===M?this.type:M,k,nt,Fe)}}}(ie,fe),function(ie,fe){var M=fe.type,k=fe.direction,J=fe.name.slice(0,-1)+"Entries";ie.prototype[J]=function(we){if("mixed"!==M&&"mixed"!==this.type&&M!==this.type)return se.empty();var Fe=this._nodes.get(we=""+we);if(void 0===Fe)throw new ne("Graph.".concat(J,': could not find the "').concat(we,'" node in the graph.'));return function(nt,Ot,We){if("mixed"!==nt){if("undirected"===nt)return tl(We,We.undirected);if("string"==typeof Ot)return tl(We,We[Ot])}var Wt=se.empty(),xt=new Set;return"undirected"!==nt&&("out"!==Ot&&(Wt=Ke(Wt,rt(xt,We,We.in))),"in"!==Ot&&(Wt=Ke(Wt,rt(xt,We,We.out)))),"directed"!==nt&&(Wt=Ke(Wt,rt(xt,We,We.undirected))),Wt}("mixed"===M?this.type:M,k,Fe)}}(ie,fe)})}(Tn);var lr=function(ie){function fe(re){var M=he({type:"directed"},re);if("multi"in M&&!1!==M.multi)throw new me("DirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if("directed"!==M.type)throw new me('DirectedGraph.from: inconsistent "'+M.type+'" type in given options!');return ie.call(this,M)||this}return Je(fe,ie),fe}(Tn),cr=function(ie){function fe(re){var M=he({type:"undirected"},re);if("multi"in M&&!1!==M.multi)throw new me("UndirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if("undirected"!==M.type)throw new me('UndirectedGraph.from: inconsistent "'+M.type+'" type in given options!');return ie.call(this,M)||this}return Je(fe,ie),fe}(Tn),Xn=function(ie){function fe(re){var M=he({multi:!0},re);if("multi"in M&&!0!==M.multi)throw new me("MultiGraph.from: inconsistent indication that the graph should be simple in given options!");return ie.call(this,M)||this}return Je(fe,ie),fe}(Tn),$i=function(ie){function fe(re){var M=he({type:"directed",multi:!0},re);if("multi"in M&&!0!==M.multi)throw new me("MultiDirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if("directed"!==M.type)throw new me('MultiDirectedGraph.from: inconsistent "'+M.type+'" type in given options!');return ie.call(this,M)||this}return Je(fe,ie),fe}(Tn),xa=function(ie){function fe(re){var M=he({type:"undirected",multi:!0},re);if("multi"in M&&!0!==M.multi)throw new me("MultiUndirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if("undirected"!==M.type)throw new me('MultiUndirectedGraph.from: inconsistent "'+M.type+'" type in given options!');return ie.call(this,M)||this}return Je(fe,ie),fe}(Tn);function Zr(ie){ie.from=function(fe,re){var M=he({},fe.options,re),k=new ie(M);return k.import(fe),k}}return Zr(Tn),Zr(lr),Zr(cr),Zr(Xn),Zr($i),Zr(xa),Tn.Graph=Tn,Tn.DirectedGraph=lr,Tn.UndirectedGraph=cr,Tn.MultiGraph=Xn,Tn.MultiDirectedGraph=$i,Tn.MultiUndirectedGraph=xa,Tn.InvalidArgumentsGraphError=me,Tn.NotFoundGraphError=ne,Tn.UsageGraphError=_e,Tn}()},524:(Ut,it,Je)=>{var yt;!function(ee,Tt,dt,Y){"use strict";var A,Se=["","webkit","Moz","MS","ms","o"],he=Tt.createElement("div"),j=Math.round,P=Math.abs,Q=Date.now;function z(ye,De,He){return setTimeout(T(ye,He),De)}function v(ye,De,He){return!!Array.isArray(ye)&&(x(ye,He[De],He),!0)}function x(ye,De,He){var bt;if(ye)if(ye.forEach)ye.forEach(De,He);else if(ye.length!==Y)for(bt=0;bt\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",li=ee.console&&(ee.console.warn||ee.console.log);return li&&li.call(ee.console,bt,Yt),ye.apply(this,arguments)}}A="function"!=typeof Object.assign?function(De){if(De===Y||null===De)throw new TypeError("Cannot convert undefined or null to object");for(var He=Object(De),bt=1;bt-1}function X(ye){return ye.trim().split(/\s+/g)}function E(ye,De,He){if(ye.indexOf&&!He)return ye.indexOf(De);for(var bt=0;btxs[De]}):bt.sort()),bt}function oe(ye,De){for(var He,bt,Gt=De[0].toUpperCase()+De.slice(1),Yt=0;Yt1&&!He.firstMultiple?He.firstMultiple=St(De):1===Gt&&(He.firstMultiple=!1);var Yt=He.firstInput,li=He.firstMultiple,Vr=li?li.center:Yt.center,es=De.center=Nt(bt);De.timeStamp=Q(),De.deltaTime=De.timeStamp-Yt.timeStamp,De.angle=Ti(Vr,es),De.distance=Yn(Vr,es),function(ye,De){var He=De.center,bt=ye.offsetDelta||{},Gt=ye.prevDelta||{},Yt=ye.prevInput||{};(1===De.eventType||4===Yt.eventType)&&(Gt=ye.prevDelta={x:Yt.deltaX||0,y:Yt.deltaY||0},bt=ye.offsetDelta={x:He.x,y:He.y}),De.deltaX=Gt.x+(He.x-bt.x),De.deltaY=Gt.y+(He.y-bt.y)}(He,De),De.offsetDirection=kn(De.deltaX,De.deltaY);var xs=On(De.deltaTime,De.deltaX,De.deltaY);De.overallVelocityX=xs.x,De.overallVelocityY=xs.y,De.overallVelocity=P(xs.x)>P(xs.y)?xs.x:xs.y,De.scale=li?function(ye,De){return Yn(De[0],De[1],pt)/Yn(ye[0],ye[1],pt)}(li.pointers,bt):1,De.rotation=li?function(ye,De){return Ti(De[1],De[0],pt)+Ti(ye[1],ye[0],pt)}(li.pointers,bt):0,De.maxPointers=He.prevInput?De.pointers.length>He.prevInput.maxPointers?De.pointers.length:He.prevInput.maxPointers:De.pointers.length,function(ye,De){var Gt,Yt,li,Vr,He=ye.lastInterval||De,bt=De.timeStamp-He.timeStamp;if(8!=De.eventType&&(bt>25||He.velocity===Y)){var es=De.deltaX-He.deltaX,xs=De.deltaY-He.deltaY,Qn=On(bt,es,xs);Yt=Qn.x,li=Qn.y,Gt=P(Qn.x)>P(Qn.y)?Qn.x:Qn.y,Vr=kn(es,xs),ye.lastInterval=De}else Gt=He.velocity,Yt=He.velocityX,li=He.velocityY,Vr=He.direction;De.velocity=Gt,De.velocityX=Yt,De.velocityY=li,De.direction=Vr}(He,De);var Qn=ye.element;D(De.srcEvent.target,Qn)&&(Qn=De.srcEvent.target),De.target=Qn}(ye,He),ye.emit("hammer.input",He),ye.recognize(He),ye.session.prevInput=He}function St(ye){for(var De=[],He=0;He=P(De)?ye<0?2:4:De<0?8:16}function Yn(ye,De,He){He||(He=_t);var bt=De[He[0]]-ye[He[0]],Gt=De[He[1]]-ye[He[1]];return Math.sqrt(bt*bt+Gt*Gt)}function Ti(ye,De,He){return He||(He=_t),180*Math.atan2(De[He[1]]-ye[He[1]],De[He[0]]-ye[He[0]])/Math.PI}ve.prototype={handler:function(){},init:function(){this.evEl&&K(this.element,this.evEl,this.domHandler),this.evTarget&&K(this.target,this.evTarget,this.domHandler),this.evWin&&K(Ce(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&ce(this.element,this.evEl,this.domHandler),this.evTarget&&ce(this.target,this.evTarget,this.domHandler),this.evWin&&ce(Ce(this.element),this.evWin,this.domHandler)}};var Ls={mousedown:1,mousemove:2,mouseup:4},gs="mousedown",Bs="mousemove mouseup";function Qr(){this.evEl=gs,this.evWin=Bs,this.pressed=!1,ve.apply(this,arguments)}S(Qr,ve,{handler:function(De){var He=Ls[De.type];1&He&&0===De.button&&(this.pressed=!0),2&He&&1!==De.which&&(He=4),this.pressed&&(4&He&&(this.pressed=!1),this.callback(this.manager,He,{pointers:[De],changedPointers:[De],pointerType:Xe,srcEvent:De}))}});var el={pointerdown:1,pointermove:2,pointerup:4,pointercancel:8,pointerout:8},kl={2:Ge,3:"pen",4:Xe,5:"kinect"},Sa="pointerdown",Es="pointermove pointerup pointercancel";function Jt(){this.evEl=Sa,this.evWin=Es,ve.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}ee.MSPointerEvent&&!ee.PointerEvent&&(Sa="MSPointerDown",Es="MSPointerMove MSPointerUp MSPointerCancel"),S(Jt,ve,{handler:function(De){var He=this.store,bt=!1,Gt=De.type.toLowerCase().replace("ms",""),Yt=el[Gt],li=kl[De.pointerType]||De.pointerType,Vr=li==Ge,es=E(He,De.pointerId,"pointerId");1&Yt&&(0===De.button||Vr)?es<0&&(He.push(De),es=He.length-1):12&Yt&&(bt=!0),!(es<0)&&(He[es]=De,this.callback(this.manager,Yt,{pointers:He,changedPointers:[De],pointerType:li,srcEvent:De}),bt&&He.splice(es,1))}});var tl={touchstart:1,touchmove:2,touchend:4,touchcancel:8},rt="touchstart",lt="touchstart touchmove touchend touchcancel";function ht(){this.evTarget=rt,this.evWin=lt,this.started=!1,ve.apply(this,arguments)}function ge(ye,De){var He=$(ye.touches),bt=$(ye.changedTouches);return 12&De&&(He=Z(He.concat(bt),"identifier",!0)),[He,bt]}S(ht,ve,{handler:function(De){var He=tl[De.type];if(1===He&&(this.started=!0),this.started){var bt=ge.call(this,De,He);12&He&&bt[0].length-bt[1].length==0&&(this.started=!1),this.callback(this.manager,He,{pointers:bt[0],changedPointers:bt[1],pointerType:Ge,srcEvent:De})}}});var be={touchstart:1,touchmove:2,touchend:4,touchcancel:8},Le="touchstart touchmove touchend touchcancel";function ut(){this.evTarget=Le,this.targetIds={},ve.apply(this,arguments)}function Ze(ye,De){var He=$(ye.touches),bt=this.targetIds;if(3&De&&1===He.length)return bt[He[0].identifier]=!0,[He,He];var Gt,Yt,li=$(ye.changedTouches),Vr=[],es=this.target;if(Yt=He.filter(function(xs){return D(xs.target,es)}),1===De)for(Gt=0;Gt-1&&bt.splice(Yt,1)},2500)}}function ai(ye){for(var De=ye.srcEvent.clientX,He=ye.srcEvent.clientY,bt=0;bt-1&&this.requireFail.splice(De,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(ye){return!!this.simultaneous[ye.id]},emit:function(ye){var De=this,He=this.state;function bt(Gt){De.manager.emit(Gt,ye)}He<8&&bt(De.options.event+We(He)),bt(De.options.event),ye.additionalEvent&&bt(ye.additionalEvent),He>=8&&bt(De.options.event+We(He))},tryEmit:function(ye){if(this.canEmit())return this.emit(ye);this.state=32},canEmit:function(){for(var ye=0;yeDe.threshold&&Gt&De.direction},attrTest:function(ye){return vn.prototype.attrTest.call(this,ye)&&(2&this.state||!(2&this.state)&&this.directionTest(ye))},emit:function(ye){this.pX=ye.deltaX,this.pY=ye.deltaY;var De=Wt(ye.direction);De&&(ye.additionalEvent=this.options.event+De),this._super.emit.call(this,ye)}}),S(Jr,vn,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[cr]},attrTest:function(ye){return this._super.attrTest.call(this,ye)&&(Math.abs(ye.scale-1)>this.options.threshold||2&this.state)},emit:function(ye){1!==ye.scale&&(ye.additionalEvent=this.options.event+(ye.scale<1?"in":"out")),this._super.emit.call(this,ye)}}),S(Qs,Ot,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return["auto"]},process:function(ye){var De=this.options,He=ye.pointers.length===De.pointers,bt=ye.distanceDe.time;if(this._input=ye,!bt||!He||12&ye.eventType&&!Gt)this.reset();else if(1&ye.eventType)this.reset(),this._timer=z(function(){this.state=8,this.tryEmit()},De.time,this);else if(4&ye.eventType)return 8;return 32},reset:function(){clearTimeout(this._timer)},emit:function(ye){8===this.state&&(ye&&4&ye.eventType?this.manager.emit(this.options.event+"up",ye):(this._input.timeStamp=Q(),this.manager.emit(this.options.event,this._input)))}}),S(Ll,vn,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[cr]},attrTest:function(ye){return this._super.attrTest.call(this,ye)&&(Math.abs(ye.rotation)>this.options.threshold||2&this.state)}}),S(po,vn,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:30,pointers:1},getTouchAction:function(){return Ss.prototype.getTouchAction.call(this)},attrTest:function(ye){var He,De=this.options.direction;return 30&De?He=ye.overallVelocity:6&De?He=ye.overallVelocityX:24&De&&(He=ye.overallVelocityY),this._super.attrTest.call(this,ye)&&De&ye.offsetDirection&&ye.distance>this.options.threshold&&ye.maxPointers==this.options.pointers&&P(He)>this.options.velocity&&4&ye.eventType},emit:function(ye){var De=Wt(ye.offsetDirection);De&&this.manager.emit(this.options.event+De,ye),this.manager.emit(this.options.event,ye)}}),S(jr,Ot,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[lr]},process:function(ye){var De=this.options,He=ye.pointers.length===De.pointers,bt=ye.distance"']/g,Es=RegExp(kl.source),Jt=RegExp(Sa.source),tl=/<%-([\s\S]+?)%>/g,rt=/<%([\s\S]+?)%>/g,lt=/<%=([\s\S]+?)%>/g,ht=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ge=/^\w*$/,be=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Le=/[\\^$.*+?()[\]{}|]/g,ut=RegExp(Le.source),Ze=/^\s+/,At=/\s/,Mt=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Dt=/\{\n\/\* \[wrapped with (.+)\] \*/,Xt=/,? & /,zn=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ai=/[()=,{}\[\]\/\s]/,Nn=/\\(\\)?/g,bn=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,$n=/\w*$/,Tn=/^[-+]0x[0-9a-f]+$/i,lr=/^0b[01]+$/i,cr=/^\[object .+?Constructor\]$/,Xn=/^0o[0-7]+$/i,$i=/^(?:0|[1-9]\d*)$/,xa=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Zr=/($^)/,ie=/['\n\r\u2028\u2029\\]/g,fe="\\ud800-\\udfff",J="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",we="\\u2700-\\u27bf",Fe="a-z\\xdf-\\xf6\\xf8-\\xff",xt="A-Z\\xc0-\\xd6\\xd8-\\xde",vn="\\ufe0e\\ufe0f",Ss="\\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",Qs="["+fe+"]",Ll="["+Ss+"]",po="["+J+"]",jr="\\d+",js="["+we+"]",xc="["+Fe+"]",Sn="[^"+fe+Ss+jr+we+Fe+xt+"]",go="\\ud83c[\\udffb-\\udfff]",Ca="[^"+fe+"]",wd="(?:\\ud83c[\\udde6-\\uddff]){2}",ye="[\\ud800-\\udbff][\\udc00-\\udfff]",De="["+xt+"]",bt="(?:"+xc+"|"+Sn+")",Gt="(?:"+De+"|"+Sn+")",Yt="(?:['\u2019](?:d|ll|m|re|s|t|ve))?",li="(?:['\u2019](?:D|LL|M|RE|S|T|VE))?",Vr="(?:"+po+"|"+go+")?",es="["+vn+"]?",A1=es+Vr+"(?:\\u200d(?:"+[Ca,wd,ye].join("|")+")"+es+Vr+")*",Ed="(?:"+[js,wd,ye].join("|")+")"+A1,tr="(?:"+[Ca+po+"?",po,wd,ye,Qs].join("|")+")",fp=RegExp("['\u2019]","g"),Jm=RegExp(po,"g"),Dh=RegExp(go+"(?="+go+")|"+tr+A1,"g"),sv=RegExp([De+"?"+xc+"+"+Yt+"(?="+[Ll,De,"$"].join("|")+")",Gt+"+"+li+"(?="+[Ll,De+bt,"$"].join("|")+")",De+"?"+bt+"+"+Yt,De+"+"+li,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",jr,Ed].join("|"),"g"),T1=RegExp("[\\u200d"+fe+J+vn+"]"),jl=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Ih=["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"],M1=-1,ln={};ln[Nt]=ln[On]=ln[kn]=ln[Yn]=ln[Ti]=ln[wi]=ln[Xr]=ln[Ls]=ln[gs]=!0,ln[Xe]=ln[tt]=ln[Qe]=ln[Ue]=ln[St]=ln[ke]=ln[Me]=ln[Ve]=ln[Ne]=ln[q]=ln[pe]=ln[_t]=ln[pt]=ln[ve]=ln[B]=!1;var ur={};ur[Xe]=ur[tt]=ur[Qe]=ur[St]=ur[Ue]=ur[ke]=ur[Nt]=ur[On]=ur[kn]=ur[Yn]=ur[Ti]=ur[Ne]=ur[q]=ur[pe]=ur[_t]=ur[pt]=ur[ve]=ur[L]=ur[wi]=ur[Xr]=ur[Ls]=ur[gs]=!0,ur[Me]=ur[Ve]=ur[B]=!1;var on={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},D1=parseFloat,cv=parseInt,Rt="object"==typeof global&&global&&global.Object===Object&&global,Vs="object"==typeof self&&self&&self.Object===Object&&self,Vi=Rt||Vs||Function("return this")(),Vl=it&&!it.nodeType&&it,Aa=Vl&&Ut&&!Ut.nodeType&&Ut,Oo=Aa&&Aa.exports===Vl,e_=Oo&&Rt.process,Sr=function(){try{return Aa&&Aa.require&&Aa.require("util").types||e_&&e_.binding&&e_.binding("util")}catch(It){}}(),nn=Sr&&Sr.isArrayBuffer,hi=Sr&&Sr.isDate,pr=Sr&&Sr.isMap,mo=Sr&&Sr.isRegExp,Cc=Sr&&Sr.isSet,as=Sr&&Sr.isTypedArray;function ls(at,It,Et){switch(Et.length){case 0:return at.call(It);case 1:return at.call(It,Et[0]);case 2:return at.call(It,Et[0],Et[1]);case 3:return at.call(It,Et[0],Et[1],Et[2])}return at.apply(It,Et)}function Ur(at,It,Et,hn){for(var Dn=-1,Li=null==at?0:at.length;++Dn-1}function Oh(at,It,Et){for(var hn=-1,Dn=null==at?0:at.length;++hn-1;);return Et}function N1(at,It){for(var Et=at.length;Et--&&nl(It,at[Et],0)>-1;);return Et}function c2(at,It){for(var Et=at.length,hn=0;Et--;)at[Et]===It&&++hn;return hn}var u2=Qo({\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"}),d2=Qo({"&":"&","<":"<",">":">",'"':""","'":"'"});function h2(at){return"\\"+on[at]}function Ph(at){return T1.test(at)}function dv(at){var It=-1,Et=Array(at.size);return at.forEach(function(hn,Dn){Et[++It]=[Dn,hn]}),Et}function P1(at,It){return function(Et){return at(It(Et))}}function yu(at,It){for(var Et=-1,hn=at.length,Dn=0,Li=[];++Et",""":'"',"'":"'"}),kh=function at(It){var d,Et=(It=null==It?Vi:kh.defaults(Vi.Object(),It,kh.pick(Vi,Ih))).Array,hn=It.Date,Dn=It.Error,Li=It.Function,ts=It.Math,Ki=It.Object,a_=It.RegExp,l_=It.String,Da=It.TypeError,gr=Et.prototype,bu=Ki.prototype,gp=It["__core-js_shared__"],xr=Li.prototype.toString,Xi=bu.hasOwnProperty,y2=0,Lh=(d=/[^.]+$/.exec(gp&&gp.keys&&gp.keys.IE_PROTO||""))?"Symbol(src)_1."+d:"",Zs=bu.toString,L1=xr.call(Ki),c_=Vi._,Md=a_("^"+xr.call(Xi).replace(Le,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),zs=Oo?It.Buffer:ee,zl=It.Symbol,Dd=It.Uint8Array,pv=zs?zs.allocUnsafe:ee,Ia=P1(Ki.getPrototypeOf,Ki),u_=Ki.create,mp=bu.propertyIsEnumerable,Bn=gr.splice,B1=zl?zl.isConcatSpreadable:ee,Bh=zl?zl.iterator:ee,vu=zl?zl.toStringTag:ee,_p=function(){try{var d=Lc(Ki,"defineProperty");return d({},"",{}),d}catch(f){}}(),gv=It.clearTimeout!==Vi.clearTimeout&&It.clearTimeout,j1=hn&&hn.now!==Vi.Date.now&&hn.now,V1=It.setTimeout!==Vi.setTimeout&&It.setTimeout,jt=ts.ceil,Ei=ts.floor,Cr=Ki.getOwnPropertySymbols,cs=zs?zs.isBuffer:ee,d_=It.isFinite,jh=gr.join,rl=P1(Ki.keys,Ki),Hr=ts.max,ms=ts.min,b2=hn.now,U1=It.parseInt,Vh=ts.random,yp=gr.reverse,As=Lc(It,"DataView"),_o=Lc(It,"Map"),bp=Lc(It,"Promise"),Oa=Lc(It,"Set"),No=Lc(It,"WeakMap"),Uh=Lc(Ki,"create"),zh=No&&new No,Id={},z1=Ru(As),h_=Ru(_o),f_=Ru(bp),mv=Ru(Oa),p_=Ru(No),vp=zl?zl.prototype:ee,Od=vp?vp.valueOf:ee,Hh=vp?vp.toString:ee;function Ee(d){if(Mr(d)&&!Rn(d)&&!(d instanceof fi)){if(d instanceof Po)return d;if(Xi.call(d,"__wrapped__"))return nf(d)}return new Po(d)}var wu=function(){function d(){}return function(f){if(!Tr(f))return{};if(u_)return u_(f);d.prototype=f;var _=new d;return d.prototype=ee,_}}();function Gh(){}function Po(d,f){this.__wrapped__=d,this.__actions__=[],this.__chain__=!!f,this.__index__=0,this.__values__=ee}function fi(d){this.__wrapped__=d,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=_e,this.__views__=[]}function yo(d){var f=-1,_=null==d?0:d.length;for(this.clear();++f<_;){var F=d[f];this.set(F[0],F[1])}}function Hl(d){var f=-1,_=null==d?0:d.length;for(this.clear();++f<_;){var F=d[f];this.set(F[0],F[1])}}function sl(d){var f=-1,_=null==d?0:d.length;for(this.clear();++f<_;){var F=d[f];this.set(F[0],F[1])}}function Ra(d){var f=-1,_=null==d?0:d.length;for(this.__data__=new sl;++f<_;)this.add(d[f])}function Na(d){var f=this.__data__=new Hl(d);this.size=f.size}function Wh(d,f){var _=Rn(d),F=!_&&pl(d),ae=!_&&!F&&gl(d),Te=!_&&!F&&!ae&&cf(d),ze=_||F||ae||Te,qe=ze?Td(d.length,l_):[],ct=qe.length;for(var kt in d)(f||Xi.call(d,kt))&&(!ze||!("length"==kt||ae&&("offset"==kt||"parent"==kt)||Te&&("buffer"==kt||"byteLength"==kt||"byteOffset"==kt)||Bo(kt,ct)))&&qe.push(kt);return qe}function y_(d){var f=d.length;return f?d[Gl(0,f-1)]:ee}function vv(d,f){return Wd(eo(d),Eu(f,0,d.length))}function Rd(d){return Wd(eo(d))}function b_(d,f,_){(_!==ee&&!In(d[f],_)||_===ee&&!(f in d))&&al(d,f,_)}function ol(d,f,_){var F=d[f];(!Xi.call(d,f)||!In(F,_)||_===ee&&!(f in d))&&al(d,f,_)}function Nd(d,f){for(var _=d.length;_--;)if(In(d[_][0],f))return _;return-1}function Cp(d,f,_,F){return Ic(d,function(ae,Te,ze){f(F,ae,_(ae),ze)}),F}function Z1(d,f){return d&&Fa(f,Os(f),d)}function al(d,f,_){"__proto__"==f&&_p?_p(d,f,{configurable:!0,enumerable:!0,value:_,writable:!0}):d[f]=_}function v_(d,f){for(var _=-1,F=f.length,ae=Et(F),Te=null==d;++_=f?d:f)),d}function Hs(d,f,_,F,ae,Te){var ze,qe=1&f,ct=2&f,kt=4&f;if(_&&(ze=ae?_(d,F,ae,Te):_(d)),ze!==ee)return ze;if(!Tr(d))return d;var Lt=Rn(d);if(Lt){if(ze=function(d){var f=d.length,_=new d.constructor(f);return f&&"string"==typeof d[0]&&Xi.call(d,"index")&&(_.index=d.index,_.input=d.input),_}(d),!qe)return eo(d,ze)}else{var zt=$s(d),en=zt==Ve||zt==$e;if(gl(d))return Np(d,qe);if(zt==pe||zt==Xe||en&&!ae){if(ze=ct||en?{}:Hv(d),!qe)return ct?function(d,f){return Fa(d,Vv(d),f)}(d,function(d,f){return d&&Fa(f,no(f),d)}(ze,d)):function(d,f){return Fa(d,k_(d),f)}(d,Z1(ze,d))}else{if(!ur[zt])return ae?d:{};ze=function(d,f,_){var F=d.constructor;switch(f){case Qe:return Mu(d);case Ue:case ke:return new F(+d);case St:return function(d,f){var _=f?Mu(d.buffer):d.buffer;return new d.constructor(_,d.byteOffset,d.byteLength)}(d,_);case Nt:case On:case kn:case Yn:case Ti:case wi:case Xr:case Ls:case gs:return O_(d,_);case Ne:return new F;case q:case ve:return new F(d);case _t:return function(d){var f=new d.constructor(d.source,$n.exec(d));return f.lastIndex=d.lastIndex,f}(d);case pt:return new F;case L:return function(d){return Od?Ki(Od.call(d)):{}}(d)}}(d,zt,qe)}}Te||(Te=new Na);var wn=Te.get(d);if(wn)return wn;Te.set(d,ze),yT(d)?d.forEach(function(jn){ze.add(Hs(jn,f,_,jn,d,Te))}):pT(d)&&d.forEach(function(jn,mi){ze.set(mi,Hs(jn,f,_,mi,d,Te))});var gi=Lt?ee:(kt?ct?P_:Yl:ct?no:Os)(d);return Us(gi||d,function(jn,mi){gi&&(jn=d[mi=jn]),ol(ze,mi,Hs(jn,f,_,mi,d,Te))}),ze}function Ap(d,f,_){var F=_.length;if(null==d)return!F;for(d=Ki(d);F--;){var ae=_[F],ze=d[ae];if(ze===ee&&!(ae in d)||!(0,f[ae])(ze))return!1}return!0}function qh(d,f,_){if("function"!=typeof d)throw new Da(Se);return ef(function(){d.apply(ee,_)},f)}function Dc(d,f,_,F){var ae=-1,Te=Ul,ze=!0,qe=d.length,ct=[],kt=f.length;if(!qe)return ct;_&&(f=Yi(f,Jo(_))),F?(Te=Oh,ze=!1):f.length>=200&&(Te=Nh,ze=!1,f=new Ra(f));e:for(;++ae-1},Hl.prototype.set=function(d,f){var _=this.__data__,F=Nd(_,d);return F<0?(++this.size,_.push([d,f])):_[F][1]=f,this},sl.prototype.clear=function(){this.size=0,this.__data__={hash:new yo,map:new(_o||Hl),string:new yo}},sl.prototype.delete=function(d){var f=Gs(this,d).delete(d);return this.size-=f?1:0,f},sl.prototype.get=function(d){return Gs(this,d).get(d)},sl.prototype.has=function(d){return Gs(this,d).has(d)},sl.prototype.set=function(d,f){var _=Gs(this,d),F=_.size;return _.set(d,f),this.size+=_.size==F?0:1,this},Ra.prototype.add=Ra.prototype.push=function(d){return this.__data__.set(d,W),this},Ra.prototype.has=function(d){return this.__data__.has(d)},Na.prototype.clear=function(){this.__data__=new Hl,this.size=0},Na.prototype.delete=function(d){var f=this.__data__,_=f.delete(d);return this.size=f.size,_},Na.prototype.get=function(d){return this.__data__.get(d)},Na.prototype.has=function(d){return this.__data__.has(d)},Na.prototype.set=function(d,f){var _=this.__data__;if(_ instanceof Hl){var F=_.__data__;if(!_o||F.length<199)return F.push([d,f]),this.size=++_.size,this;_=this.__data__=new sl(F)}return _.set(d,f),this.size=_.size,this};var Ic=ul(ll),E_=ul(Tp,!0);function Ev(d,f){var _=!0;return Ic(d,function(F,ae,Te){return _=!!f(F,ae,Te)}),_}function Yh(d,f,_){for(var F=-1,ae=d.length;++F0&&_(qe)?f>1?Ts(qe,f-1,_,F,ae):zr(ae,qe):F||(ae[ae.length]=qe)}return ae}var Pd=Ov(),Fd=Ov(!0);function ll(d,f){return d&&Pd(d,f,Os)}function Tp(d,f){return d&&Fd(d,f,Os)}function Kh(d,f){return Ta(f,function(_){return la(d[_])})}function ea(d,f){for(var _=0,F=(f=Pc(f,d)).length;null!=d&&_f}function kd(d,f){return null!=d&&Xi.call(d,f)}function Ld(d,f){return null!=d&&f in Ki(d)}function Su(d,f,_){for(var F=_?Oh:Ul,ae=d[0].length,Te=d.length,ze=Te,qe=Et(Te),ct=1/0,kt=[];ze--;){var Lt=d[ze];ze&&f&&(Lt=Yi(Lt,Jo(f))),ct=ms(Lt.length,ct),qe[ze]=!_&&(f||ae>=120&&Lt.length>=120)?new Ra(ze&&Lt):ee}Lt=d[0];var zt=-1,en=qe[0];e:for(;++zt=qe?ct:ct*("desc"==_[F]?-1:1)}return d.index-f.index}(Te,ze,_)});Et--;)at[Et]=at[Et].value;return at}(iA(d,function(Te,ze,qe){return{criteria:Yi(f,function(kt){return kt(Te)}),index:++F,value:Te}}))}function Tv(d,f,_){for(var F=-1,ae=f.length,Te={};++F-1;)qe!==d&&Bn.call(qe,ct,1),Bn.call(d,ct,1);return d}function Qh(d,f){for(var _=d?f.length:0,F=_-1;_--;){var ae=f[_];if(_==F||ae!==Te){var Te=ae;Bo(ae)?Bn.call(d,ae,1):Cu(d,ae)}}return d}function Gl(d,f){return d+Ei(Vh()*(f-d+1))}function Dp(d,f){var _="";if(!d||f<1||f>Ce)return _;do{f%2&&(_+=d),(f=Ei(f/2))&&(d+=d)}while(f);return _}function pi(d,f){return Hp(bA(d,f,io),d+"")}function sA(d){return y_(th(d))}function M2(d,f){var _=th(d);return Wd(_,Eu(f,0,_.length))}function Ip(d,f,_,F){if(!Tr(d))return d;for(var ae=-1,Te=(f=Pc(f,d)).length,ze=Te-1,qe=d;null!=qe&&++aeae?0:ae+f),(_=_>ae?ae:_)<0&&(_+=ae),ae=f>_?0:_-f>>>0,f>>>=0;for(var Te=Et(ae);++F>>1,ze=d[Te];null!==ze&&!ca(ze)&&(_?ze<=f:ze=200){var kt=f?null:N_(d);if(kt)return r_(kt);ze=!1,ae=Nh,ct=new Ra}else ct=f?[]:qe;e:for(;++F=F?d:Ds(d,f,_)}var lA=gv||function(d){return Vi.clearTimeout(d)};function Np(d,f){if(f)return d.slice();var _=d.length,F=pv?pv(_):new d.constructor(_);return d.copy(F),F}function Mu(d){var f=new d.constructor(d.byteLength);return new Dd(f).set(new Dd(d)),f}function O_(d,f){var _=f?Mu(d.buffer):d.buffer;return new d.constructor(_,d.byteOffset,d.length)}function Fc(d,f){if(d!==f){var _=d!==ee,F=null===d,ae=d==d,Te=ca(d),ze=f!==ee,qe=null===f,ct=f==f,kt=ca(f);if(!qe&&!kt&&!Te&&d>f||Te&&ze&&ct&&!qe&&!kt||F&&ze&&ct||!_&&ct||!ae)return 1;if(!F&&!Te&&!kt&&d1?_[ae-1]:ee,ze=ae>2?_[2]:ee;for(Te=d.length>3&&"function"==typeof Te?(ae--,Te):ee,ze&&Ws(_[0],_[1],ze)&&(Te=ae<3?ee:Te,ae=1),f=Ki(f);++F-1?ae[Te?f[ze]:ze]:ee}}function Iu(d){return dl(function(f){var _=f.length,F=_,ae=Po.prototype.thru;for(d&&f.reverse();F--;){var Te=f[F];if("function"!=typeof Te)throw new Da(Se);if(ae&&!ze&&"wrapper"==Vp(Te))var ze=new Po([],!0)}for(F=ze?F:_;++F<_;){var qe=Vp(Te=f[F]),ct="wrapper"==qe?F_(Te):ee;ze=ct&&Up(ct[0])&&424==ct[1]&&!ct[4].length&&1==ct[9]?ze[Vp(ct[0])].apply(ze,ct[3]):1==Te.length&&Up(Te)?ze[qe]():ze.thru(Te)}return function(){var kt=arguments,Lt=kt[0];if(ze&&1==kt.length&&Rn(Lt))return ze.plant(Lt).value();for(var zt=0,en=_?f[zt].apply(this,kt):Lt;++zt<_;)en=f[zt].call(this,en);return en}})}function kc(d,f,_,F,ae,Te,ze,qe,ct,kt){var Lt=f&K,zt=1&f,en=2&f,wn=24&f,Ln=512&f,gi=en?ee:Hd(d);return function jn(){for(var mi=arguments.length,Mi=Et(mi),wo=mi;wo--;)Mi[wo]=arguments[wo];if(wn)var qs=$d(jn),ua=c2(Mi,qs);if(F&&(Mi=Ud(Mi,F,ae,wn)),Te&&(Mi=Iv(Mi,Te,ze,wn)),mi-=ua,wn&&mi1&&Mi.reverse(),Lt&&ctqe))return!1;var kt=Te.get(d),Lt=Te.get(f);if(kt&&Lt)return kt==f&&Lt==d;var zt=-1,en=!0,wn=2&_?new Ra:ee;for(Te.set(d,f),Te.set(f,d);++zt-1&&d%1==0&&d1?"& ":"")+f[F],f=f.join(_>2?", ":" "),d.replace(Mt,"{\n/* [wrapped with "+f+"] */\n")}(F,function(d,f){return Us(st,function(_){var F="_."+_[0];f&_[1]&&!Ul(d,F)&&d.push(F)}),d.sort()}(function(d){var f=d.match(Dt);return f?f[1].split(Xt):[]}(F),_)))}function z_(d){var f=0,_=0;return function(){var F=b2(),ae=16-(F-_);if(_=F,ae>0){if(++f>=800)return arguments[0]}else f=0;return d.apply(ee,arguments)}}function Wd(d,f){var _=-1,F=d.length,ae=F-1;for(f=f===ee?F:f;++_1?d[f-1]:ee;return _="function"==typeof _?(d.pop(),_):ee,GA(d,_)});function Z_(d){var f=Ee(d);return f.__chain__=!0,f}function Yd(d,f){return f(d)}var J_=dl(function(d){var f=d.length,_=f?d[0]:0,F=this.__wrapped__,ae=function(Te){return v_(Te,d)};return!(f>1||this.__actions__.length)&&F instanceof fi&&Bo(_)?((F=F.slice(_,+_+(f?1:0))).__actions__.push({func:Yd,args:[ae],thisArg:ee}),new Po(F,this.__chain__).thru(function(Te){return f&&!Te.length&&Te.push(ee),Te})):this.thru(ae)}),qA=ns(function(d,f,_){Xi.call(d,_)?++d[_]:al(d,_,1)}),XA=Nv(G_),QA=Nv($_);function iy(d,f){return(Rn(d)?Us:Ic)(d,Fn(f,3))}function Wp(d,f){return(Rn(d)?Sd:E_)(d,Fn(f,3))}var JA=ns(function(d,f,_){Xi.call(d,_)?d[_].push(f):al(d,_,[f])}),dw=pi(function(d,f,_){var F=-1,ae="function"==typeof f,Te=bo(d)?Et(d.length):[];return Ic(d,function(ze){Te[++F]=ae?ls(f,ze,_):Pa(ze,f,_)}),Te}),hw=ns(function(d,f,_){al(d,_,f)});function fl(d,f){return(Rn(d)?Yi:iA)(d,Fn(f,3))}var pw=ns(function(d,f,_){d[_?0:1].push(f)},function(){return[[],[]]}),Yp=pi(function(d,f){if(null==d)return[];var _=f.length;return _>1&&Ws(d,f[0],f[1])?f=[]:_>2&&Ws(f[0],f[1],f[2])&&(f=[f[0]]),Xh(d,Ts(f,1),[])}),Nu=j1||function(){return Vi.Date.now()};function Kp(d,f,_){return f=_?ee:f,ql(d,K,ee,ee,ee,ee,f=d&&null==f?d.length:f)}function sy(d,f){var _;if("function"!=typeof f)throw new Da(Se);return d=Jn(d),function(){return--d>0&&(_=f.apply(this,arguments)),d<=1&&(f=ee),_}}var af=pi(function(d,f,_){var F=1;if(_.length){var ae=yu(_,$d(af));F|=V}return ql(d,F,f,_,ae)}),Xd=pi(function(d,f,_){var F=3;if(_.length){var ae=yu(_,$d(Xd));F|=V}return ql(f,F,d,_,ae)});function ww(d,f,_){var F,ae,Te,ze,qe,ct,kt=0,Lt=!1,zt=!1,en=!0;if("function"!=typeof d)throw new Da(Se);function wn(Hi){var yl=F,Uc=ae;return F=ae=ee,kt=Hi,ze=d.apply(Uc,yl)}function Ln(Hi){return kt=Hi,qe=ef(mi,f),Lt?wn(Hi):ze}function jn(Hi){var yl=Hi-ct;return ct===ee||yl>=f||yl<0||zt&&Hi-kt>=Te}function mi(){var Hi=Nu();if(jn(Hi))return Mi(Hi);qe=ef(mi,function(Hi){var lM=f-(Hi-ct);return zt?ms(lM,Te-(Hi-kt)):lM}(Hi))}function Mi(Hi){return qe=ee,en&&F?wn(Hi):(F=ae=ee,ze)}function ua(){var Hi=Nu(),yl=jn(Hi);if(F=arguments,ae=this,ct=Hi,yl){if(qe===ee)return Ln(ct);if(zt)return lA(qe),qe=ef(mi,f),wn(ct)}return qe===ee&&(qe=ef(mi,f)),ze}return f=vo(f)||0,Tr(_)&&(Lt=!!_.leading,Te=(zt="maxWait"in _)?Hr(vo(_.maxWait)||0,f):Te,en="trailing"in _?!!_.trailing:en),ua.cancel=function(){qe!==ee&&lA(qe),kt=0,F=ct=ae=qe=ee},ua.flush=function(){return qe===ee?ze:Mi(Nu())},ua}var iT=pi(function(d,f){return qh(d,1,f)}),Ew=pi(function(d,f,_){return qh(d,vo(f)||0,_)});function lf(d,f){if("function"!=typeof d||null!=f&&"function"!=typeof f)throw new Da(Se);var _=function(){var F=arguments,ae=f?f.apply(this,F):F[0],Te=_.cache;if(Te.has(ae))return Te.get(ae);var ze=d.apply(this,F);return _.cache=Te.set(ae,ze)||Te,ze};return _.cache=new(lf.Cache||sl),_}function ly(d){if("function"!=typeof d)throw new Da(Se);return function(){var f=arguments;switch(f.length){case 0:return!d.call(this);case 1:return!d.call(this,f[0]);case 2:return!d.call(this,f[0],f[1]);case 3:return!d.call(this,f[0],f[1],f[2])}return!d.apply(this,f)}}lf.Cache=sl;var rT=aA(function(d,f){var _=(f=1==f.length&&Rn(f[0])?Yi(f[0],Jo(Fn())):Yi(Ts(f,1),Jo(Fn()))).length;return pi(function(F){for(var ae=-1,Te=ms(F.length,_);++ae=f}),pl=J1(function(){return arguments}())?J1:function(d){return Mr(d)&&Xi.call(d,"callee")&&!mp.call(d,"callee")},Rn=Et.isArray,Mw=nn?Jo(nn):function(d){return Mr(d)&&Ms(d)==Qe};function bo(d){return null!=d&&uy(d.length)&&!la(d)}function Ar(d){return Mr(d)&&bo(d)}var gl=cs||Ny,Dw=hi?Jo(hi):function(d){return Mr(d)&&Ms(d)==ke};function La(d){if(!Mr(d))return!1;var f=Ms(d);return f==Me||"[object DOMException]"==f||"string"==typeof d.message&&"string"==typeof d.name&&!Jp(d)}function la(d){if(!Tr(d))return!1;var f=Ms(d);return f==Ve||f==$e||"[object AsyncFunction]"==f||"[object Proxy]"==f}function Zp(d){return"number"==typeof d&&d==Jn(d)}function uy(d){return"number"==typeof d&&d>-1&&d%1==0&&d<=Ce}function Tr(d){var f=typeof d;return null!=d&&("object"==f||"function"==f)}function Mr(d){return null!=d&&"object"==typeof d}var pT=pr?Jo(pr):function(d){return Mr(d)&&$s(d)==Ne};function _T(d){return"number"==typeof d||Mr(d)&&Ms(d)==q}function Jp(d){if(!Mr(d)||Ms(d)!=pe)return!1;var f=Ia(d);if(null===f)return!0;var _=Xi.call(f,"constructor")&&f.constructor;return"function"==typeof _&&_ instanceof _&&xr.call(_)==L1}var Nw=mo?Jo(mo):function(d){return Mr(d)&&Ms(d)==_t},yT=Cc?Jo(Cc):function(d){return Mr(d)&&$s(d)==pt};function hy(d){return"string"==typeof d||!Rn(d)&&Mr(d)&&Ms(d)==ve}function ca(d){return"symbol"==typeof d||Mr(d)&&Ms(d)==L}var cf=as?Jo(as):function(d){return Mr(d)&&uy(d.length)&&!!ln[Ms(d)]},Bc=Lp(Av),fy=Lp(function(d,f){return d<=f});function Pw(d){if(!d)return[];if(bo(d))return hy(d)?il(d):eo(d);if(Bh&&d[Bh])return function(at){for(var It,Et=[];!(It=at.next()).done;)Et.push(It.value);return Et}(d[Bh]());var f=$s(d);return(f==Ne?dv:f==pt?r_:th)(d)}function ml(d){return d?(d=vo(d))===te||d===-te?17976931348623157e292*(d<0?-1:1):d==d?d:0:0===d?d:0}function Jn(d){var f=ml(d),_=f%1;return f==f?_?f-_:f:0}function py(d){return d?Eu(Jn(d),0,_e):0}function vo(d){if("number"==typeof d)return d;if(ca(d))return NaN;if(Tr(d)){var f="function"==typeof d.valueOf?d.valueOf():d;d=Tr(f)?f+"":f}if("string"!=typeof d)return 0===d?d:+d;d=uv(d);var _=lr.test(d);return _||Xn.test(d)?cv(d.slice(2),_?2:8):Tn.test(d)?NaN:+d}function Fw(d){return Fa(d,no(d))}function zi(d){return null==d?"":Lo(d)}var bT=$l(function(d,f){if(zp(f)||bo(f))Fa(f,Os(f),d);else for(var _ in f)Xi.call(f,_)&&ol(d,_,f[_])}),vT=$l(function(d,f){Fa(f,no(f),d)}),Qd=$l(function(d,f,_,F){Fa(f,no(f),d,F)}),wT=$l(function(d,f,_,F){Fa(f,Os(f),d,F)}),kw=dl(v_),ST=pi(function(d,f){d=Ki(d);var _=-1,F=f.length,ae=F>2?f[2]:ee;for(ae&&Ws(f[0],f[1],ae)&&(F=1);++_1),Te}),Fa(d,P_(d),_),F&&(_=Hs(_,7,Bp));for(var ae=f.length;ae--;)Cu(_,f[ae]);return _}),MT=dl(function(d,f){return null==d?{}:function(d,f){return Tv(d,f,function(_,F){return eg(d,F)})}(d,f)});function Hw(d,f){if(null==d)return{};var _=Yi(P_(d),function(F){return[F]});return f=Fn(f),Tv(d,_,function(F,ae){return f(F,ae[0])})}var DT=Ou(Os),$w=Ou(no);function th(d){return null==d?[]:i_(d,Os(d))}var PT=Wl(function(d,f,_){return f=f.toLowerCase(),d+(_?yy(f):f)});function yy(d){return ig(zi(d).toLowerCase())}function by(d){return(d=zi(d))&&d.replace(xa,u2).replace(Jm,"")}var kT=Wl(function(d,f,_){return d+(_?"-":"")+f.toLowerCase()}),LT=Wl(function(d,f,_){return d+(_?" ":"")+f.toLowerCase()}),K2=Pp("toLowerCase"),zT=Wl(function(d,f,_){return d+(_?"_":"")+f.toLowerCase()}),Ey=Wl(function(d,f,_){return d+(_?" ":"")+ig(f)}),Qw=Wl(function(d,f,_){return d+(_?" ":"")+f.toUpperCase()}),ig=Pp("toUpperCase");function Ay(d,f,_){return d=zi(d),(f=_?ee:f)===ee?function(at){return jl.test(at)}(d)?function(at){return at.match(sv)||[]}(d):function(at){return at.match(zn)||[]}(d):d.match(f)||[]}var Ty=pi(function(d,f){try{return ls(d,ee,f)}catch(_){return La(_)?_:new Dn(_)}}),Zw=dl(function(d,f){return Us(f,function(_){_=ni(_),al(d,_,af(d[_],d))}),d});function My(d){return function(){return d}}var Q2=Iu(),Pu=Iu(!0);function io(d){return d}function Fu(d){return nA("function"==typeof d?d:Hs(d,1))}var Dy=pi(function(d,f){return function(_){return Pa(_,d,f)}}),Jw=pi(function(d,f){return function(_){return Pa(d,_,f)}});function Iy(d,f,_){var F=Os(f),ae=Kh(f,F);null==_&&(!Tr(f)||!ae.length&&F.length)&&(_=f,f=d,d=this,ae=Kh(f,Os(f)));var Te=!(Tr(_)&&"chain"in _&&!_.chain),ze=la(d);return Us(ae,function(qe){var ct=f[qe];d[qe]=ct,ze&&(d.prototype[qe]=function(){var kt=this.__chain__;if(Te||kt){var Lt=d(this.__wrapped__),zt=Lt.__actions__=eo(this.__actions__);return zt.push({func:ct,args:arguments,thisArg:d}),Lt.__chain__=kt,Lt}return ct.apply(d,zr([this.value()],arguments))})}),d}function Oy(){}var XT=Fp(Yi),QT=Fp(ti),tE=Fp(Ro);function ku(d){return ra(d)?t_(ni(d)):function(d){return function(f){return ea(f,d)}}(d)}var ZT=Fv(),JT=Fv(!0);function Vc(){return[]}function Ny(){return!1}var Wn=R_(function(d,f){return d+f},0),Py=Gd("ceil"),J2=R_(function(d,f){return d/f},1),Ql=Gd("floor"),sE=R_(function(d,f){return d*f},1),oE=Gd("round"),aE=R_(function(d,f){return d-f},0);return Ee.after=function(d,f){if("function"!=typeof f)throw new Da(Se);return d=Jn(d),function(){if(--d<1)return f.apply(this,arguments)}},Ee.ary=Kp,Ee.assign=bT,Ee.assignIn=vT,Ee.assignInWith=Qd,Ee.assignWith=wT,Ee.at=kw,Ee.before=sy,Ee.bind=af,Ee.bindAll=Zw,Ee.bindKey=Xd,Ee.castArray=function(){if(!arguments.length)return[];var d=arguments[0];return Rn(d)?d:[d]},Ee.chain=Z_,Ee.chunk=function(d,f,_){f=(_?Ws(d,f,_):f===ee)?1:Hr(Jn(f),0);var F=null==d?0:d.length;if(!F||f<1)return[];for(var ae=0,Te=0,ze=Et(jt(F/f));aeae?0:ae+_),(F=F===ee||F>ae?ae:Jn(F))<0&&(F+=ae),F=_>F?0:py(F);_>>0)?(d=zi(d))&&("string"==typeof f||null!=f&&!Nw(f))&&!(f=Lo(f))&&Ph(d)?cl(il(d),0,_):d.split(f,_):[]},Ee.spread=function(d,f){if("function"!=typeof d)throw new Da(Se);return f=null==f?0:Hr(Jn(f),0),pi(function(_){var F=_[f],ae=cl(_,0,f);return F&&zr(ae,F),ls(d,this,ae)})},Ee.tail=function(d){var f=null==d?0:d.length;return f?Ds(d,1,f):[]},Ee.take=function(d,f,_){return d&&d.length?Ds(d,0,(f=_||f===ee?1:Jn(f))<0?0:f):[]},Ee.takeRight=function(d,f,_){var F=null==d?0:d.length;return F?Ds(d,(f=F-(f=_||f===ee?1:Jn(f)))<0?0:f,F):[]},Ee.takeRightWhile=function(d,f){return d&&d.length?Au(d,Fn(f,3),!1,!0):[]},Ee.takeWhile=function(d,f){return d&&d.length?Au(d,Fn(f,3)):[]},Ee.tap=function(d,f){return f(d),d},Ee.throttle=function(d,f,_){var F=!0,ae=!0;if("function"!=typeof d)throw new Da(Se);return Tr(_)&&(F="leading"in _?!!_.leading:F,ae="trailing"in _?!!_.trailing:ae),ww(d,f,{leading:F,maxWait:f,trailing:ae})},Ee.thru=Yd,Ee.toArray=Pw,Ee.toPairs=DT,Ee.toPairsIn=$w,Ee.toPath=function(d){return Rn(d)?Yi(d,ni):ca(d)?[d]:eo(qv(zi(d)))},Ee.toPlainObject=Fw,Ee.transform=function(d,f,_){var F=Rn(d),ae=F||gl(d)||cf(d);if(f=Fn(f,4),null==_){var Te=d&&d.constructor;_=ae?F?new Te:[]:Tr(d)&&la(Te)?wu(Ia(d)):{}}return(ae?Us:ll)(d,function(ze,qe,ct){return f(_,ze,qe,ct)}),_},Ee.unary=function(d){return Kp(d,1)},Ee.union=iw,Ee.unionBy=UA,Ee.unionWith=zA,Ee.uniq=function(d){return d&&d.length?Rc(d):[]},Ee.uniqBy=function(d,f){return d&&d.length?Rc(d,Fn(f,2)):[]},Ee.uniqWith=function(d,f){return f="function"==typeof f?f:ee,d&&d.length?Rc(d,ee,f):[]},Ee.unset=function(d,f){return null==d||Cu(d,f)},Ee.unzip=rw,Ee.unzipWith=GA,Ee.update=function(d,f,_){return null==d?d:Op(d,f,I_(_))},Ee.updateWith=function(d,f,_,F){return F="function"==typeof F?F:ee,null==d?d:Op(d,f,I_(_),F)},Ee.values=th,Ee.valuesIn=function(d){return null==d?[]:i_(d,no(d))},Ee.without=sw,Ee.words=Ay,Ee.wrap=function(d,f){return Xp(I_(f),d)},Ee.xor=B2,Ee.xorBy=jo,Ee.xorWith=X_,Ee.zip=Q_,Ee.zipObject=function(d,f){return Rp(d||[],f||[],ol)},Ee.zipObjectDeep=function(d,f){return Rp(d||[],f||[],Ip)},Ee.zipWith=of,Ee.entries=DT,Ee.entriesIn=$w,Ee.extend=vT,Ee.extendWith=Qd,Iy(Ee,Ee),Ee.add=Wn,Ee.attempt=Ty,Ee.camelCase=PT,Ee.capitalize=yy,Ee.ceil=Py,Ee.clamp=function(d,f,_){return _===ee&&(_=f,f=ee),_!==ee&&(_=(_=vo(_))==_?_:0),f!==ee&&(f=(f=vo(f))==f?f:0),Eu(vo(d),f,_)},Ee.clone=function(d){return Hs(d,4)},Ee.cloneDeep=function(d){return Hs(d,5)},Ee.cloneDeepWith=function(d,f){return Hs(d,5,f="function"==typeof f?f:ee)},Ee.cloneWith=function(d,f){return Hs(d,4,f="function"==typeof f?f:ee)},Ee.conformsTo=function(d,f){return null==f||Ap(d,f,Os(f))},Ee.deburr=by,Ee.defaultTo=function(d,f){return null==d||d!=d?f:d},Ee.divide=J2,Ee.endsWith=function(d,f,_){d=zi(d),f=Lo(f);var F=d.length,ae=_=_===ee?F:Eu(Jn(_),0,F);return(_-=f.length)>=0&&d.slice(_,ae)==f},Ee.eq=In,Ee.escape=function(d){return(d=zi(d))&&Jt.test(d)?d.replace(Sa,d2):d},Ee.escapeRegExp=function(d){return(d=zi(d))&&ut.test(d)?d.replace(Le,"\\$&"):d},Ee.every=function(d,f,_){var F=Rn(d)?ti:Ev;return _&&Ws(d,f,_)&&(f=ee),F(d,Fn(f,3))},Ee.find=XA,Ee.findIndex=G_,Ee.findKey=function(d,f){return Rh(d,Fn(f,3),ll)},Ee.findLast=QA,Ee.findLastIndex=$_,Ee.findLastKey=function(d,f){return Rh(d,Fn(f,3),Tp)},Ee.floor=Ql,Ee.forEach=iy,Ee.forEachRight=Wp,Ee.forIn=function(d,f){return null==d?d:Pd(d,Fn(f,3),no)},Ee.forInRight=function(d,f){return null==d?d:Fd(d,Fn(f,3),no)},Ee.forOwn=function(d,f){return d&&ll(d,Fn(f,3))},Ee.forOwnRight=function(d,f){return d&&Tp(d,Fn(f,3))},Ee.get=hf,Ee.gt=Zt,Ee.gte=Tw,Ee.has=function(d,f){return null!=d&&zv(d,f,kd)},Ee.hasIn=eg,Ee.head=Kv,Ee.identity=io,Ee.includes=function(d,f,_,F){d=bo(d)?d:th(d),_=_&&!F?Jn(_):0;var ae=d.length;return _<0&&(_=Hr(ae+_,0)),hy(d)?_<=ae&&d.indexOf(f,_)>-1:!!ae&&nl(d,f,_)>-1},Ee.indexOf=function(d,f,_){var F=null==d?0:d.length;if(!F)return-1;var ae=null==_?0:Jn(_);return ae<0&&(ae=Hr(F+ae,0)),nl(d,f,ae)},Ee.inRange=function(d,f,_){return f=ml(f),_===ee?(_=f,f=0):_=ml(_),function(d,f,_){return d>=ms(f,_)&&d=-Ce&&d<=Ce},Ee.isSet=yT,Ee.isString=hy,Ee.isSymbol=ca,Ee.isTypedArray=cf,Ee.isUndefined=function(d){return d===ee},Ee.isWeakMap=function(d){return Mr(d)&&$s(d)==B},Ee.isWeakSet=function(d){return Mr(d)&&"[object WeakSet]"==Ms(d)},Ee.join=function(d,f){return null==d?"":jh.call(d,f)},Ee.kebabCase=kT,Ee.last=sa,Ee.lastIndexOf=function(d,f,_){var F=null==d?0:d.length;if(!F)return-1;var ae=F;return _!==ee&&(ae=(ae=Jn(_))<0?Hr(F+ae,0):ms(ae,F-1)),f==f?function(at,It,Et){for(var hn=Et+1;hn--;)if(at[hn]===It)return hn;return hn}(d,f,ae):Cd(d,Ac,ae,!0)},Ee.lowerCase=LT,Ee.lowerFirst=K2,Ee.lt=Bc,Ee.lte=fy,Ee.max=function(d){return d&&d.length?Yh(d,io,Fo):ee},Ee.maxBy=function(d,f){return d&&d.length?Yh(d,Fn(f,2),Fo):ee},Ee.mean=function(d){return Cs(d,io)},Ee.meanBy=function(d,f){return Cs(d,Fn(f,2))},Ee.min=function(d){return d&&d.length?Yh(d,io,Av):ee},Ee.minBy=function(d,f){return d&&d.length?Yh(d,Fn(f,2),Av):ee},Ee.stubArray=Vc,Ee.stubFalse=Ny,Ee.stubObject=function(){return{}},Ee.stubString=function(){return""},Ee.stubTrue=function(){return!0},Ee.multiply=sE,Ee.nth=function(d,f){return d&&d.length?xu(d,Jn(f)):ee},Ee.noConflict=function(){return Vi._===this&&(Vi._=c_),this},Ee.noop=Oy,Ee.now=Nu,Ee.pad=function(d,f,_){d=zi(d);var F=(f=Jn(f))?Fh(d):0;if(!f||F>=f)return d;var ae=(f-F)/2;return kp(Ei(ae),_)+d+kp(jt(ae),_)},Ee.padEnd=function(d,f,_){d=zi(d);var F=(f=Jn(f))?Fh(d):0;return f&&Ff){var F=d;d=f,f=F}if(_||d%1||f%1){var ae=Vh();return ms(d+ae*(f-d+D1("1e-"+((ae+"").length-1))),f)}return Gl(d,f)},Ee.reduce=function(d,f,_){var F=Rn(d)?_u:Zo,ae=arguments.length<3;return F(d,Fn(f,4),_,ae,Ic)},Ee.reduceRight=function(d,f,_){var F=Rn(d)?xd:Zo,ae=arguments.length<3;return F(d,Fn(f,4),_,ae,E_)},Ee.repeat=function(d,f,_){return f=(_?Ws(d,f,_):f===ee)?1:Jn(f),Dp(zi(d),f)},Ee.replace=function(){var d=arguments,f=zi(d[0]);return d.length<3?f:f.replace(d[1],d[2])},Ee.result=function(d,f,_){var F=-1,ae=(f=Pc(f,d)).length;for(ae||(ae=1,d=ee);++FCe)return[];var _=_e,F=ms(d,_e);f=Fn(f),d-=_e;for(var ae=Td(F,f);++_=Te)return d;var qe=_-Fh(F);if(qe<1)return F;var ct=ze?cl(ze,0,qe).join(""):d.slice(0,qe);if(ae===ee)return ct+F;if(ze&&(qe+=ct.length-qe),Nw(ae)){if(d.slice(qe).search(ae)){var kt,Lt=ct;for(ae.global||(ae=a_(ae.source,zi($n.exec(ae))+"g")),ae.lastIndex=0;kt=ae.exec(Lt);)var zt=kt.index;ct=ct.slice(0,zt===ee?qe:zt)}}else if(d.indexOf(Lo(ae),qe)!=qe){var en=ct.lastIndexOf(ae);en>-1&&(ct=ct.slice(0,en))}return ct+F},Ee.unescape=function(d){return(d=zi(d))&&Es.test(d)?d.replace(kl,o_):d},Ee.uniqueId=function(d){var f=++y2;return zi(d)+f},Ee.upperCase=Qw,Ee.upperFirst=ig,Ee.each=iy,Ee.eachRight=Wp,Ee.first=Kv,Iy(Ee,function(){var d={};return ll(Ee,function(f,_){Xi.call(Ee.prototype,_)||(d[_]=f)}),d}(),{chain:!1}),Ee.VERSION="4.17.21",Us(["bind","bindKey","curry","curryRight","partial","partialRight"],function(d){Ee[d].placeholder=Ee}),Us(["drop","take"],function(d,f){fi.prototype[d]=function(_){_=_===ee?1:Hr(Jn(_),0);var F=this.__filtered__&&!f?new fi(this):this.clone();return F.__filtered__?F.__takeCount__=ms(_,F.__takeCount__):F.__views__.push({size:ms(_,_e),type:d+(F.__dir__<0?"Right":"")}),F},fi.prototype[d+"Right"]=function(_){return this.reverse()[d](_).reverse()}}),Us(["filter","map","takeWhile"],function(d,f){var _=f+1,F=1==_||3==_;fi.prototype[d]=function(ae){var Te=this.clone();return Te.__iteratees__.push({iteratee:Fn(ae,3),type:_}),Te.__filtered__=Te.__filtered__||F,Te}}),Us(["head","last"],function(d,f){var _="take"+(f?"Right":"");fi.prototype[d]=function(){return this[_](1).value()[0]}}),Us(["initial","tail"],function(d,f){var _="drop"+(f?"":"Right");fi.prototype[d]=function(){return this.__filtered__?new fi(this):this[_](1)}}),fi.prototype.compact=function(){return this.filter(io)},fi.prototype.find=function(d){return this.filter(d).head()},fi.prototype.findLast=function(d){return this.reverse().find(d)},fi.prototype.invokeMap=pi(function(d,f){return"function"==typeof d?new fi(this):this.map(function(_){return Pa(_,d,f)})}),fi.prototype.reject=function(d){return this.filter(ly(Fn(d)))},fi.prototype.slice=function(d,f){d=Jn(d);var _=this;return _.__filtered__&&(d>0||f<0)?new fi(_):(d<0?_=_.takeRight(-d):d&&(_=_.drop(d)),f!==ee&&(_=(f=Jn(f))<0?_.dropRight(-f):_.take(f-d)),_)},fi.prototype.takeRightWhile=function(d){return this.reverse().takeWhile(d).reverse()},fi.prototype.toArray=function(){return this.take(_e)},ll(fi.prototype,function(d,f){var _=/^(?:filter|find|map|reject)|While$/.test(f),F=/^(?:head|last)$/.test(f),ae=Ee[F?"take"+("last"==f?"Right":""):f],Te=F||/^find/.test(f);!ae||(Ee.prototype[f]=function(){var ze=this.__wrapped__,qe=F?[1]:arguments,ct=ze instanceof fi,kt=qe[0],Lt=ct||Rn(ze),zt=function(mi){var Mi=ae.apply(Ee,zr([mi],qe));return F&&en?Mi[0]:Mi};Lt&&_&&"function"==typeof kt&&1!=kt.length&&(ct=Lt=!1);var en=this.__chain__,wn=!!this.__actions__.length,Ln=Te&&!en,gi=ct&&!wn;if(!Te&&Lt){ze=gi?ze:new fi(this);var jn=d.apply(ze,qe);return jn.__actions__.push({func:Yd,args:[zt],thisArg:ee}),new Po(jn,en)}return Ln&&gi?d.apply(this,qe):(jn=this.thru(zt),Ln?F?jn.value()[0]:jn.value():jn)})}),Us(["pop","push","shift","sort","splice","unshift"],function(d){var f=gr[d],_=/^(?:push|sort|unshift)$/.test(d)?"tap":"thru",F=/^(?:pop|shift)$/.test(d);Ee.prototype[d]=function(){var ae=arguments;if(F&&!this.__chain__){var Te=this.value();return f.apply(Rn(Te)?Te:[],ae)}return this[_](function(ze){return f.apply(Rn(ze)?ze:[],ae)})}}),ll(fi.prototype,function(d,f){var _=Ee[f];if(_){var F=_.name+"";Xi.call(Id,F)||(Id[F]=[]),Id[F].push({name:f,func:_})}}),Id[kc(ee,2).name]=[{name:"wrapper",func:ee}],fi.prototype.clone=function(){var d=new fi(this.__wrapped__);return d.__actions__=eo(this.__actions__),d.__dir__=this.__dir__,d.__filtered__=this.__filtered__,d.__iteratees__=eo(this.__iteratees__),d.__takeCount__=this.__takeCount__,d.__views__=eo(this.__views__),d},fi.prototype.reverse=function(){if(this.__filtered__){var d=new fi(this);d.__dir__=-1,d.__filtered__=!0}else(d=this.clone()).__dir__*=-1;return d},fi.prototype.value=function(){var d=this.__wrapped__.value(),f=this.__dir__,_=Rn(d),F=f<0,ae=_?d.length:0,Te=function(d,f,_){for(var F=-1,ae=_.length;++F=this.__values__.length;return{done:d,value:d?ee:this.__values__[this.__index__++]}},Ee.prototype.plant=function(d){for(var f,_=this;_ instanceof Gh;){var F=nf(_);F.__index__=0,F.__values__=ee,f?ae.__wrapped__=F:f=F;var ae=F;_=_.__wrapped__}return ae.__wrapped__=d,f},Ee.prototype.reverse=function(){var d=this.__wrapped__;if(d instanceof fi){var f=d;return this.__actions__.length&&(f=new fi(this)),(f=f.reverse()).__actions__.push({func:Yd,args:[K_],thisArg:ee}),new Po(f,this.__chain__)}return this.thru(K_)},Ee.prototype.toJSON=Ee.prototype.valueOf=Ee.prototype.value=function(){return oA(this.__wrapped__,this.__actions__)},Ee.prototype.first=Ee.prototype.head,Bh&&(Ee.prototype[Bh]=function(){return this}),Ee}();Vi._=kh,(yt=function(){return kh}.call(it,Je,it,Ut))!==ee&&(Ut.exports=yt)}.call(this)},478:function(Ut){Ut.exports=function(){"use strict";function it(rt,lt){for(var ht=0;htrt.length)&&(lt=rt.length);for(var ht=0,ge=new Array(lt);ht=rt.length?{done:!0}:{done:!1,value:rt[ge++]}}}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 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}}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:Y,changeDefaults:function(rt){dt.exports.defaults=rt}};var he=/[&<>"']/,W=/[&<>"']/g,j=/[<>"']|&(?!#?\w+;)/,P=/[<>"']|&(?!#?\w+;)/g,Q={"&":"&","<":"<",">":">",'"':""","'":"'"},z=function(lt){return Q[lt]};var x=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function O(rt){return rt.replace(x,function(lt,ht){return"colon"===(ht=ht.toLowerCase())?":":"#"===ht.charAt(0)?"x"===ht.charAt(1)?String.fromCharCode(parseInt(ht.substring(2),16)):String.fromCharCode(+ht.substring(1)):""})}var A=/(^|[^\[])\^/g;var y=/[^\w:]/g,S=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;var V={},R=/^[^:]+:\/*[^/]*$/,K=/^([^:]+:)[\s\S]*$/,ce=/^([^:]+:\/*[^/]*)[\s\S]*$/;function D(rt,lt){V[" "+rt]||(V[" "+rt]=R.test(rt)?rt+"/":$(rt,"/",!0));var ht=-1===(rt=V[" "+rt]).indexOf(":");return"//"===lt.substring(0,2)?ht?lt:rt.replace(K,"$1")+lt:"/"===lt.charAt(0)?ht?lt:rt.replace(ce,"$1")+lt:rt+lt}function $(rt,lt,ht){var ge=rt.length;if(0===ge)return"";for(var be=0;be1;)1<&&(ht+=rt),lt>>=1,rt+=rt;return ht+rt},Ce=dt.exports.defaults,me=$,ne=function(rt,lt){var ge=rt.replace(/\|/g,function(Le,ut,Ze){for(var At=!1,Mt=ut;--Mt>=0&&"\\"===Ze[Mt];)At=!At;return At?"|":" |"}).split(/ \|/),be=0;if(ge.length>lt)ge.splice(lt);else for(;ge.length1?{type:"space",raw:be[0]}:{raw:"\n"}},lt.code=function(ge){var be=this.rules.block.code.exec(ge);if(be){var Le=be[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:be[0],codeBlockStyle:"indented",text:this.options.pedantic?Le:me(Le,"\n")}}},lt.fences=function(ge){var be=this.rules.block.fences.exec(ge);if(be){var Le=be[0],ut=function(rt,lt){var ht=rt.match(/^(\s+)(?:```)/);if(null===ht)return lt;var ge=ht[1];return lt.split("\n").map(function(be){var Le=be.match(/^\s+/);return null===Le?be:Le[0].length>=ge.length?be.slice(ge.length):be}).join("\n")}(Le,be[3]||"");return{type:"code",raw:Le,lang:be[2]?be[2].trim():be[2],text:ut}}},lt.heading=function(ge){var be=this.rules.block.heading.exec(ge);if(be){var Le=be[2].trim();if(/#$/.test(Le)){var ut=me(Le,"#");(this.options.pedantic||!ut||/ $/.test(ut))&&(Le=ut.trim())}return{type:"heading",raw:be[0],depth:be[1].length,text:Le}}},lt.nptable=function(ge){var be=this.rules.block.nptable.exec(ge);if(be){var Le={type:"table",header:ne(be[1].replace(/^ *| *\| *$/g,"")),align:be[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:be[3]?be[3].replace(/\n$/,"").split("\n"):[],raw:be[0]};if(Le.header.length===Le.align.length){var Ze,ut=Le.align.length;for(Ze=0;Ze ?/gm,"");return{type:"blockquote",raw:be[0],text:Le}}},lt.list=function(ge){var be=this.rules.block.list.exec(ge);if(be){var Xt,zn,ai,Nn,bn,$n,Tn,lr,cr,Le=be[0],ut=be[2],Ze=ut.length>1,At={type:"list",raw:Le,ordered:Ze,start:Ze?+ut.slice(0,-1):"",loose:!1,items:[]},Mt=be[0].match(this.rules.block.item),Dt=!1,Xn=Mt.length;ai=this.rules.block.listItemStart.exec(Mt[0]);for(var $i=0;$iai[1].length:Nn[1].length>=ai[0].length||Nn[1].length>3){Mt.splice($i,2,Mt[$i]+(!this.options.pedantic&&Nn[1].length/i.test(ut[0])&&(be=!1),!Le&&/^<(pre|code|kbd|script)(\s|>)/i.test(ut[0])?Le=!0:Le&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(ut[0])&&(Le=!1),{type:this.options.sanitize?"text":"html",raw:ut[0],inLink:be,inRawBlock:Le,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ut[0]):_e(ut[0]):ut[0]}},lt.link=function(ge){var be=this.rules.inline.link.exec(ge);if(be){var Le=be[2].trim();if(!this.options.pedantic&&/^$/.test(Le))return;var ut=me(Le.slice(0,-1),"\\");if((Le.length-ut.length)%2==0)return}else{var Ze=Ie(be[2],"()");if(Ze>-1){var Mt=(0===be[0].indexOf("!")?5:4)+be[1].length+Ze;be[2]=be[2].substring(0,Ze),be[0]=be[0].substring(0,Mt).trim(),be[3]=""}}var Dt=be[2],Xt="";if(this.options.pedantic){var zn=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Dt);zn&&(Dt=zn[1],Xt=zn[3])}else Xt=be[3]?be[3].slice(1,-1):"";return Dt=Dt.trim(),/^$/.test(Le)?Dt.slice(1):Dt.slice(1,-1)),Ge(be,{href:Dt&&Dt.replace(this.rules.inline._escapes,"$1"),title:Xt&&Xt.replace(this.rules.inline._escapes,"$1")},be[0])}},lt.reflink=function(ge,be){var Le;if((Le=this.rules.inline.reflink.exec(ge))||(Le=this.rules.inline.nolink.exec(ge))){var ut=(Le[2]||Le[1]).replace(/\s+/g," ");if(!(ut=be[ut.toLowerCase()])||!ut.href){var Ze=Le[0].charAt(0);return{type:"text",raw:Ze,text:Ze}}return Ge(Le,ut,Le[0])}},lt.emStrong=function(ge,be,Le){void 0===Le&&(Le="");var ut=this.rules.inline.emStrong.lDelim.exec(ge);if(ut&&(!ut[3]||!Le.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 Ze=ut[1]||ut[2]||"";if(!Ze||Ze&&(""===Le||this.rules.inline.punctuation.exec(Le))){var Mt,Dt,At=ut[0].length-1,Xt=At,zn=0,ai="*"===ut[0][0]?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(ai.lastIndex=0,be=be.slice(-1*ge.length+At);null!=(ut=ai.exec(be));)if(Mt=ut[1]||ut[2]||ut[3]||ut[4]||ut[5]||ut[6]){if(Dt=Mt.length,ut[3]||ut[4]){Xt+=Dt;continue}if((ut[5]||ut[6])&&At%3&&!((At+Dt)%3)){zn+=Dt;continue}if(!((Xt-=Dt)>0))return Dt=Math.min(Dt,Dt+Xt+zn),Math.min(At,Dt)%2?{type:"em",raw:ge.slice(0,At+ut.index+Dt+1),text:ge.slice(1,At+ut.index+Dt)}:{type:"strong",raw:ge.slice(0,At+ut.index+Dt+1),text:ge.slice(2,At+ut.index+Dt-1)}}}}},lt.codespan=function(ge){var be=this.rules.inline.code.exec(ge);if(be){var Le=be[2].replace(/\n/g," "),ut=/[^ ]/.test(Le),Ze=/^ /.test(Le)&&/ $/.test(Le);return ut&&Ze&&(Le=Le.substring(1,Le.length-1)),Le=_e(Le,!0),{type:"codespan",raw:be[0],text:Le}}},lt.br=function(ge){var be=this.rules.inline.br.exec(ge);if(be)return{type:"br",raw:be[0]}},lt.del=function(ge){var be=this.rules.inline.del.exec(ge);if(be)return{type:"del",raw:be[0],text:be[2]}},lt.autolink=function(ge,be){var ut,Ze,Le=this.rules.inline.autolink.exec(ge);if(Le)return Ze="@"===Le[2]?"mailto:"+(ut=_e(this.options.mangle?be(Le[1]):Le[1])):ut=_e(Le[1]),{type:"link",raw:Le[0],text:ut,href:Ze,tokens:[{type:"text",raw:ut,text:ut}]}},lt.url=function(ge,be){var Le;if(Le=this.rules.inline.url.exec(ge)){var ut,Ze;if("@"===Le[2])Ze="mailto:"+(ut=_e(this.options.mangle?be(Le[0]):Le[0]));else{var At;do{At=Le[0],Le[0]=this.rules.inline._backpedal.exec(Le[0])[0]}while(At!==Le[0]);ut=_e(Le[0]),Ze="www."===Le[1]?"http://"+ut:ut}return{type:"link",raw:Le[0],text:ut,href:Ze,tokens:[{type:"text",raw:ut,text:ut}]}}},lt.inlineText=function(ge,be,Le){var Ze,ut=this.rules.inline.text.exec(ge);if(ut)return Ze=be?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ut[0]):_e(ut[0]):ut[0]:_e(this.options.smartypants?Le(ut[0]):ut[0]),{type:"text",raw:ut[0],text:Ze}},rt}(),tt=te_noopTest,Ye=te_edit,Ue=te_merge,ke={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:tt,table:tt,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?'|\([^()]*\))/};ke.def=Ye(ke.def).replace("label",ke._label).replace("title",ke._title).getRegex(),ke.bullet=/(?:[*+-]|\d{1,9}[.)])/,ke.item=/^( *)(bull) ?[^\n]*(?:\n(?! *bull ?)[^\n]*)*/,ke.item=Ye(ke.item,"gm").replace(/bull/g,ke.bullet).getRegex(),ke.listItemStart=Ye(/^( *)(bull) */).replace("bull",ke.bullet).getRegex(),ke.list=Ye(ke.list).replace(/bull/g,ke.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+ke.def.source+")").getRegex(),ke._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",ke._comment=/|$)/,ke.html=Ye(ke.html,"i").replace("comment",ke._comment).replace("tag",ke._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ke.paragraph=Ye(ke._paragraph).replace("hr",ke.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",ke._tag).getRegex(),ke.blockquote=Ye(ke.blockquote).replace("paragraph",ke.paragraph).getRegex(),ke.normal=Ue({},ke),ke.gfm=Ue({},ke.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*|$)"}),ke.gfm.nptable=Ye(ke.gfm.nptable).replace("hr",ke.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",ke._tag).getRegex(),ke.gfm.table=Ye(ke.gfm.table).replace("hr",ke.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",ke._tag).getRegex(),ke.pedantic=Ue({},ke.normal,{html:Ye("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",ke._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:tt,paragraph:Ye(ke.normal._paragraph).replace("hr",ke.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",ke.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var Ke={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:tt,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:tt,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~"};Ke.punctuation=Ye(Ke.punctuation).replace(/punctuation/g,Ke._punctuation).getRegex(),Ke.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,Ke.escapedEmSt=/\\\*|\\_/g,Ke._comment=Ye(ke._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),Ke.emStrong.lDelim=Ye(Ke.emStrong.lDelim).replace(/punct/g,Ke._punctuation).getRegex(),Ke.emStrong.rDelimAst=Ye(Ke.emStrong.rDelimAst,"g").replace(/punct/g,Ke._punctuation).getRegex(),Ke.emStrong.rDelimUnd=Ye(Ke.emStrong.rDelimUnd,"g").replace(/punct/g,Ke._punctuation).getRegex(),Ke._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,Ke._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,Ke._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])?)+(?![-_])/,Ke.autolink=Ye(Ke.autolink).replace("scheme",Ke._scheme).replace("email",Ke._email).getRegex(),Ke._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,Ke.tag=Ye(Ke.tag).replace("comment",Ke._comment).replace("attribute",Ke._attribute).getRegex(),Ke._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Ke._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,Ke._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,Ke.link=Ye(Ke.link).replace("label",Ke._label).replace("href",Ke._href).replace("title",Ke._title).getRegex(),Ke.reflink=Ye(Ke.reflink).replace("label",Ke._label).getRegex(),Ke.reflinkSearch=Ye(Ke.reflinkSearch,"g").replace("reflink",Ke.reflink).replace("nolink",Ke.nolink).getRegex(),Ke.normal=Ue({},Ke),Ke.pedantic=Ue({},Ke.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",Ke._label).getRegex(),reflink:Ye(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Ke._label).getRegex()}),Ke.gfm=Ue({},Ke.normal,{escape:Ye(Ke.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&&(ge="x"+ge.toString(16)),lt+="&#"+ge+";";return lt}var je=function(){function rt(ht){this.tokens=[],this.tokens.links=Object.create(null),this.options=ht||$e,this.options.tokenizer=this.options.tokenizer||new Ve,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var ge={block:Ne.normal,inline:q.normal};this.options.pedantic?(ge.block=Ne.pedantic,ge.inline=q.pedantic):this.options.gfm&&(ge.block=Ne.gfm,ge.inline=this.options.breaks?q.breaks:q.gfm),this.tokenizer.rules=ge}rt.lex=function(ge,be){return new rt(be).lex(ge)},rt.lexInline=function(ge,be){return new rt(be).inlineTokens(ge)};var lt=rt.prototype;return lt.lex=function(ge){return ge=ge.replace(/\r\n|\r/g,"\n").replace(/\t/g," "),this.blockTokens(ge,this.tokens,!0),this.inline(this.tokens),this.tokens},lt.blockTokens=function(ge,be,Le){var Ze,At,Mt,Dt,Xt,zn,ut=this;for(void 0===be&&(be=[]),void 0===Le&&(Le=!0),this.options.pedantic&&(ge=ge.replace(/^ +$/gm,""));ge;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(function(Nn){return!!(Ze=Nn.call(ut,ge,be))&&(ge=ge.substring(Ze.raw.length),be.push(Ze),!0)}))){if(Ze=this.tokenizer.space(ge)){ge=ge.substring(Ze.raw.length),Ze.type&&be.push(Ze);continue}if(Ze=this.tokenizer.code(ge)){ge=ge.substring(Ze.raw.length),(Dt=be[be.length-1])&&"paragraph"===Dt.type?(Dt.raw+="\n"+Ze.raw,Dt.text+="\n"+Ze.text):be.push(Ze);continue}if(Ze=this.tokenizer.fences(ge)){ge=ge.substring(Ze.raw.length),be.push(Ze);continue}if(Ze=this.tokenizer.heading(ge)){ge=ge.substring(Ze.raw.length),be.push(Ze);continue}if(Ze=this.tokenizer.nptable(ge)){ge=ge.substring(Ze.raw.length),be.push(Ze);continue}if(Ze=this.tokenizer.hr(ge)){ge=ge.substring(Ze.raw.length),be.push(Ze);continue}if(Ze=this.tokenizer.blockquote(ge)){ge=ge.substring(Ze.raw.length),Ze.tokens=this.blockTokens(Ze.text,[],Le),be.push(Ze);continue}if(Ze=this.tokenizer.list(ge)){for(ge=ge.substring(Ze.raw.length),Mt=Ze.items.length,At=0;At=0&&(Nn=Math.min(Nn,$n))}),Nn<1/0&&Nn>=0&&(Xt=ge.substring(0,Nn+1))}(),Le&&(Ze=this.tokenizer.paragraph(Xt))){Dt=be[be.length-1],zn&&"paragraph"===Dt.type?(Dt.raw+="\n"+Ze.raw,Dt.text+="\n"+Ze.text):be.push(Ze),zn=Xt.length!==ge.length,ge=ge.substring(Ze.raw.length);continue}if(Ze=this.tokenizer.text(ge)){ge=ge.substring(Ze.raw.length),(Dt=be[be.length-1])&&"text"===Dt.type?(Dt.raw+="\n"+Ze.raw,Dt.text+="\n"+Ze.text):be.push(Ze);continue}if(ge){var ai="Infinite loop on byte: "+ge.charCodeAt(0);if(this.options.silent){console.error(ai);break}throw new Error(ai)}}return be},lt.inline=function(ge){var be,Le,ut,Ze,At,Mt,Dt=ge.length;for(be=0;be0)for(;null!=(zn=this.tokenizer.rules.inline.reflinkSearch.exec(Xt));)bn.includes(zn[0].slice(zn[0].lastIndexOf("[")+1,-1))&&(Xt=Xt.slice(0,zn.index)+"["+G("a",zn[0].length-2)+"]"+Xt.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(zn=this.tokenizer.rules.inline.blockSkip.exec(Xt));)Xt=Xt.slice(0,zn.index)+"["+G("a",zn[0].length-2)+"]"+Xt.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(zn=this.tokenizer.rules.inline.escapedEmSt.exec(Xt));)Xt=Xt.slice(0,zn.index)+"++"+Xt.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;ge;)if(ai||(Nn=""),ai=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(function(Tn){return!!(At=Tn.call(Ze,ge,be))&&(ge=ge.substring(At.raw.length),be.push(At),!0)}))){if(At=this.tokenizer.escape(ge)){ge=ge.substring(At.raw.length),be.push(At);continue}if(At=this.tokenizer.tag(ge,Le,ut)){ge=ge.substring(At.raw.length),Le=At.inLink,ut=At.inRawBlock,(Mt=be[be.length-1])&&"text"===At.type&&"text"===Mt.type?(Mt.raw+=At.raw,Mt.text+=At.text):be.push(At);continue}if(At=this.tokenizer.link(ge)){ge=ge.substring(At.raw.length),"link"===At.type&&(At.tokens=this.inlineTokens(At.text,[],!0,ut)),be.push(At);continue}if(At=this.tokenizer.reflink(ge,this.tokens.links)){ge=ge.substring(At.raw.length),Mt=be[be.length-1],"link"===At.type?(At.tokens=this.inlineTokens(At.text,[],!0,ut),be.push(At)):Mt&&"text"===At.type&&"text"===Mt.type?(Mt.raw+=At.raw,Mt.text+=At.text):be.push(At);continue}if(At=this.tokenizer.emStrong(ge,Xt,Nn)){ge=ge.substring(At.raw.length),At.tokens=this.inlineTokens(At.text,[],Le,ut),be.push(At);continue}if(At=this.tokenizer.codespan(ge)){ge=ge.substring(At.raw.length),be.push(At);continue}if(At=this.tokenizer.br(ge)){ge=ge.substring(At.raw.length),be.push(At);continue}if(At=this.tokenizer.del(ge)){ge=ge.substring(At.raw.length),At.tokens=this.inlineTokens(At.text,[],Le,ut),be.push(At);continue}if(At=this.tokenizer.autolink(ge,ue)){ge=ge.substring(At.raw.length),be.push(At);continue}if(!Le&&(At=this.tokenizer.url(ge,ue))){ge=ge.substring(At.raw.length),be.push(At);continue}if(Dt=ge,this.options.extensions&&this.options.extensions.startInline&&function(){var Tn=1/0,lr=ge.slice(1),cr=void 0;Ze.options.extensions.startInline.forEach(function(Xn){"number"==typeof(cr=Xn.call(this,lr))&&cr>=0&&(Tn=Math.min(Tn,cr))}),Tn<1/0&&Tn>=0&&(Dt=ge.substring(0,Tn+1))}(),At=this.tokenizer.inlineText(Dt,ut,pe)){ge=ge.substring(At.raw.length),"_"!==At.raw.slice(-1)&&(Nn=At.raw.slice(-1)),ai=!0,(Mt=be[be.length-1])&&"text"===Mt.type?(Mt.raw+=At.raw,Mt.text+=At.text):be.push(At);continue}if(ge){var $n="Infinite loop on byte: "+ge.charCodeAt(0);if(this.options.silent){console.error($n);break}throw new Error($n)}}return be},function(rt,lt,ht){lt&&it(rt.prototype,lt),ht&&it(rt,ht)}(rt,null,[{key:"rules",get:function(){return{block:Ne,inline:q}}}]),rt}(),_t=dt.exports.defaults,pt=te_cleanUrl,ve=te_escape,L=function(){function rt(ht){this.options=ht||_t}var lt=rt.prototype;return lt.code=function(ge,be,Le){var ut=(be||"").match(/\S*/)[0];if(this.options.highlight){var Ze=this.options.highlight(ge,ut);null!=Ze&&Ze!==ge&&(Le=!0,ge=Ze)}return ge=ge.replace(/\n$/,"")+"\n",ut?'
    '+(Le?ge:ve(ge,!0))+"
    \n":"
    "+(Le?ge:ve(ge,!0))+"
    \n"},lt.blockquote=function(ge){return"
    \n"+ge+"
    \n"},lt.html=function(ge){return ge},lt.heading=function(ge,be,Le,ut){return this.options.headerIds?"'+ge+"\n":""+ge+"\n"},lt.hr=function(){return this.options.xhtml?"
    \n":"
    \n"},lt.list=function(ge,be,Le){var ut=be?"ol":"ul";return"<"+ut+(be&&1!==Le?' start="'+Le+'"':"")+">\n"+ge+"\n"},lt.listitem=function(ge){return"
  • "+ge+"
  • \n"},lt.checkbox=function(ge){return" "},lt.paragraph=function(ge){return"

    "+ge+"

    \n"},lt.table=function(ge,be){return be&&(be=""+be+""),"\n\n"+ge+"\n"+be+"
    \n"},lt.tablerow=function(ge){return"\n"+ge+"\n"},lt.tablecell=function(ge,be){var Le=be.header?"th":"td";return(be.align?"<"+Le+' align="'+be.align+'">':"<"+Le+">")+ge+"\n"},lt.strong=function(ge){return""+ge+""},lt.em=function(ge){return""+ge+""},lt.codespan=function(ge){return""+ge+""},lt.br=function(){return this.options.xhtml?"
    ":"
    "},lt.del=function(ge){return""+ge+""},lt.link=function(ge,be,Le){if(null===(ge=pt(this.options.sanitize,this.options.baseUrl,ge)))return Le;var ut='"+Le+""},lt.image=function(ge,be,Le){if(null===(ge=pt(this.options.sanitize,this.options.baseUrl,ge)))return Le;var ut=''+Le+'":">")},lt.text=function(ge){return ge},rt}(),N=function(){function rt(){}var lt=rt.prototype;return lt.strong=function(ge){return ge},lt.em=function(ge){return ge},lt.codespan=function(ge){return ge},lt.del=function(ge){return ge},lt.html=function(ge){return ge},lt.text=function(ge){return ge},lt.link=function(ge,be,Le){return""+Le},lt.image=function(ge,be,Le){return""+Le},lt.br=function(){return""},rt}(),B=function(){function rt(){this.seen={}}var lt=rt.prototype;return lt.serialize=function(ge){return ge.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")},lt.getNextSafeSlug=function(ge,be){var Le=ge,ut=0;if(this.seen.hasOwnProperty(Le)){ut=this.seen[ge];do{Le=ge+"-"+ ++ut}while(this.seen.hasOwnProperty(Le))}return be||(this.seen[ge]=ut,this.seen[Le]=0),Le},lt.slug=function(ge,be){void 0===be&&(be={});var Le=this.serialize(ge);return this.getNextSafeSlug(Le,be.dryrun)},rt}(),Re=L,Qe=N,St=B,Nt=dt.exports.defaults,On=te_unescape,Yn=je,Ti=function(){function rt(ht){this.options=ht||Nt,this.options.renderer=this.options.renderer||new Re,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Qe,this.slugger=new St}rt.parse=function(ge,be){return new rt(be).parse(ge)},rt.parseInline=function(ge,be){return new rt(be).parseInline(ge)};var lt=rt.prototype;return lt.parse=function(ge,be){void 0===be&&(be=!0);var ut,Ze,At,Mt,Dt,Xt,zn,ai,Nn,bn,$n,Tn,lr,cr,Xn,$i,xa,Zr,ie,Le="",fe=ge.length;for(ut=0;ut0&&"text"===Xn.tokens[0].type?(Xn.tokens[0].text=Zr+" "+Xn.tokens[0].text,Xn.tokens[0].tokens&&Xn.tokens[0].tokens.length>0&&"text"===Xn.tokens[0].tokens[0].type&&(Xn.tokens[0].tokens[0].text=Zr+" "+Xn.tokens[0].tokens[0].text)):Xn.tokens.unshift({type:"text",text:Zr}):cr+=Zr),cr+=this.parse(Xn.tokens,lr),Nn+=this.renderer.listitem(cr,xa,$i);Le+=this.renderer.list(Nn,$n,Tn);continue;case"html":Le+=this.renderer.html(bn.text);continue;case"paragraph":Le+=this.renderer.paragraph(this.parseInline(bn.tokens));continue;case"text":for(Nn=bn.tokens?this.parseInline(bn.tokens):bn.text;ut+1An error occurred:

    "+el(At.message+"",!0)+"
    ";throw At}}return Jt.options=Jt.setOptions=function(rt){return Bs(Jt.defaults,rt),Sa(Jt.defaults),Jt},Jt.getDefaults=kl,Jt.defaults=Es,Jt.use=function(){for(var rt=this,lt=arguments.length,ht=new Array(lt),ge=0;geAn error occurred:

    "+el(ge.message+"",!0)+"
    ";throw ge}},Jt.Parser=Ti,Jt.parser=Ti.parse,Jt.Renderer=Xr,Jt.TextRenderer=Ls,Jt.Lexer=Yn,Jt.lexer=Yn.lex,Jt.Tokenizer=wi,Jt.Slugger=gs,Jt.parse=Jt,Jt}()},369:(Ut,it,Je)=>{var yt=Je(284),ee=Je(830);function Tt(){this.clear()}Tt.prototype.clear=function(){this.items=[],this.offset=0,this.size=0},Tt.prototype.enqueue=function(dt){return this.items.push(dt),++this.size},Tt.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}},Tt.prototype.peek=function(){if(this.size)return this.items[this.offset]},Tt.prototype.forEach=function(dt,Y){Y=arguments.length>1?Y:this;for(var Se=this.offset,he=0,W=this.items.length;Se=dt.length)return{done:!0};var Se=dt[Y];return Y++,{value:Se,done:!1}})},Tt.prototype.entries=function(){var dt=this.items,Y=this.offset,Se=0;return new yt(function(){if(Y>=dt.length)return{done:!0};var he=dt[Y];return Y++,{value:[Se++,he],done:!1}})},"undefined"!=typeof Symbol&&(Tt.prototype[Symbol.iterator]=Tt.prototype.values),Tt.prototype.toString=function(){return this.toArray().join(",")},Tt.prototype.toJSON=function(){return this.toArray()},Tt.prototype.inspect=function(){var dt=this.toArray();return Object.defineProperty(dt,"constructor",{value:Tt,enumerable:!1}),dt},"undefined"!=typeof Symbol&&(Tt.prototype[Symbol.for("nodejs.util.inspect.custom")]=Tt.prototype.inspect),Tt.from=function(dt){var Y=new Tt;return ee(dt,function(Se){Y.enqueue(Se)}),Y},Tt.of=function(){return Tt.from(arguments)},Ut.exports=Tt},830:Ut=>{var it="undefined"!=typeof ArrayBuffer,Je="undefined"!=typeof Symbol;function yt(ee,Tt){var dt,Y,Se,he,W;if(!ee)throw new Error("obliterator/forEach: invalid iterable.");if("function"!=typeof Tt)throw new Error("obliterator/forEach: expecting a callback.");if(Array.isArray(ee)||it&&ArrayBuffer.isView(ee)||"string"==typeof ee||"[object Arguments]"===ee.toString())for(Se=0,he=ee.length;Se{function it(Je){Object.defineProperty(this,"_next",{writable:!1,enumerable:!1,value:Je}),this.done=!1}it.prototype.next=function(){if(this.done)return{done:!0};var Je=this._next();return Je.done&&(this.done=!0),Je},"undefined"!=typeof Symbol&&(it.prototype[Symbol.iterator]=function(){return this}),it.of=function(){var Je=arguments,yt=Je.length,ee=0;return new it(function(){return ee>=yt?{done:!0}:{done:!1,value:Je[ee++]}})},it.empty=function(){var Je=new it(null);return Je.done=!0,Je},it.is=function(Je){return Je instanceof it||"object"==typeof Je&&null!==Je&&"function"==typeof Je.next},Ut.exports=it},310:(Ut,it,Je)=>{"use strict";var yt=Je(948);Object.defineProperty(it,"__esModule",{value:!0}),it.isMobile=function(){return void 0!==ee.window.orientation},it.default=function(he){if(!he&&!(0,Tt.default)())return"Node";if((0,dt.default)(he))return"Electron";var W="undefined"!=typeof navigator?navigator:{},j=he||W.userAgent||"";if(j.indexOf("Edge")>-1)return"Edge";var P=-1!==j.indexOf("MSIE "),Q=-1!==j.indexOf("Trident/");return P||Q?"IE":ee.window.chrome?"Chrome":ee.window.safari?"Safari":ee.window.mozInnerScreenX?"Firefox":"Unknown"};var ee=Je(151),Tt=yt(Je(602)),dt=yt(Je(344))},151:(Ut,it,Je)=>{"use strict";var yt=Je(948);Object.defineProperty(it,"__esModule",{value:!0}),it.console=it.process=it.document=it.global=it.window=it.self=void 0;var ee=yt(Je(321)),Tt={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,ee.default)(process))&&process};it.self=Tt.self||Tt.window||Tt.global,it.window=Tt.window||Tt.self||Tt.global,it.global=Tt.global||Tt.self||Tt.window,it.document=Tt.document||{},it.process=Tt.process||{};var j=console;it.console=j},761:(Ut,it,Je)=>{"use strict";var ee=Je(948),Tt=Je(321);Object.defineProperty(it,"CO",{enumerable:!0,get:function(){return dt.global}}),Object.defineProperty(it,"qs",{enumerable:!0,get:function(){return Se.default}});var dt=Je(151),Se=(j(Je(602)),j(Je(310)));ee(Je(344));function W(P){if("function"!=typeof WeakMap)return null;var Q=new WeakMap,z=new WeakMap;return(W=function(x){return x?z:Q})(P)}function j(P,Q){if(!Q&&P&&P.__esModule)return P;if(null===P||"object"!==Tt(P)&&"function"!=typeof P)return{default:P};var z=W(Q);if(z&&z.has(P))return z.get(P);var v={},x=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var O in P)if("default"!==O&&Object.prototype.hasOwnProperty.call(P,O)){var A=x?Object.getOwnPropertyDescriptor(P,O):null;A&&(A.get||A.set)?Object.defineProperty(v,O,A):v[O]=P[O]}return v.default=P,z&&z.set(P,v),v}},602:(Ut,it,Je)=>{"use strict";var yt=Je(948);Object.defineProperty(it,"__esModule",{value:!0}),it.default=dt,it.isBrowserMainThread=function(){return dt()&&"undefined"!=typeof document};var ee=yt(Je(321)),Tt=yt(Je(344));function dt(){return!("object"===("undefined"==typeof process?"undefined":(0,ee.default)(process))&&"[object process]"===String(process)&&!process.browser)||(0,Tt.default)()}},344:(Ut,it,Je)=>{"use strict";var yt=Je(948);Object.defineProperty(it,"__esModule",{value:!0}),it.default=function(dt){if("undefined"!=typeof window&&"object"===(0,ee.default)(window.process)&&"renderer"===window.process.type||"undefined"!=typeof process&&"object"===(0,ee.default)(process.versions)&&Boolean(process.versions.electron))return!0;var Y="object"===("undefined"==typeof navigator?"undefined":(0,ee.default)(navigator))&&"string"==typeof navigator.userAgent&&navigator.userAgent,Se=dt||Y;return!!(Se&&Se.indexOf("Electron")>=0)};var ee=yt(Je(321))},991:function(Ut,it,Je){"use strict";var yt=this&&this.__createBinding||(Object.create?function(Tt,dt,Y,Se){void 0===Se&&(Se=Y),Object.defineProperty(Tt,Se,{enumerable:!0,get:function(){return dt[Y]}})}:function(Tt,dt,Y,Se){void 0===Se&&(Se=Y),Tt[Se]=dt[Y]}),ee=this&&this.__exportStar||function(Tt,dt){for(var Y in Tt)"default"!==Y&&!Object.prototype.hasOwnProperty.call(dt,Y)&&yt(dt,Tt,Y)};Object.defineProperty(it,"__esModule",{value:!0}),ee(Je(180),it),ee(Je(103),it),ee(Je(965),it),ee(Je(595),it),ee(Je(417),it),ee(Je(451),it),ee(Je(735),it)},180:(Ut,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.BlankNode=void 0,it.BlankNode=class{constructor(ee){this.termType="BlankNode",this.value=ee}equals(ee){return!!ee&&"BlankNode"===ee.termType&&ee.value===this.value}}},103:(Ut,it,Je)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.DataFactory=void 0;const yt=Je(180),ee=Je(965),Tt=Je(595),dt=Je(417),Y=Je(451),Se=Je(735);let he=0;it.DataFactory=class{constructor(P){this.blankNodeCounter=0,this.blankNodePrefix=(P=P||{}).blankNodePrefix||`df_${he++}_`}namedNode(P){return new dt.NamedNode(P)}blankNode(P){return new yt.BlankNode(P||`${this.blankNodePrefix}${this.blankNodeCounter++}`)}literal(P,Q){return new Tt.Literal(P,Q)}variable(P){return new Se.Variable(P)}defaultGraph(){return ee.DefaultGraph.INSTANCE}quad(P,Q,z,v){return new Y.Quad(P,Q,z,v||this.defaultGraph())}fromTerm(P){switch(P.termType){case"NamedNode":return this.namedNode(P.value);case"BlankNode":return this.blankNode(P.value);case"Literal":return P.language?this.literal(P.value,P.language):P.datatype.equals(Tt.Literal.XSD_STRING)?this.literal(P.value):this.literal(P.value,this.fromTerm(P.datatype));case"Variable":return this.variable(P.value);case"DefaultGraph":return this.defaultGraph();case"Quad":return this.quad(this.fromTerm(P.subject),this.fromTerm(P.predicate),this.fromTerm(P.object),this.fromTerm(P.graph))}}fromQuad(P){return this.fromTerm(P)}resetBlankNodeCounter(){this.blankNodeCounter=0}}},965:(Ut,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.DefaultGraph=void 0;class Je{constructor(){this.termType="DefaultGraph",this.value=""}equals(ee){return!!ee&&"DefaultGraph"===ee.termType}}it.DefaultGraph=Je,Je.INSTANCE=new Je},595:(Ut,it,Je)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.Literal=void 0;const yt=Je(417);class ee{constructor(dt,Y){this.termType="Literal",this.value=dt,"string"==typeof Y?(this.language=Y,this.datatype=ee.RDF_LANGUAGE_STRING):Y?(this.language="",this.datatype=Y):(this.language="",this.datatype=ee.XSD_STRING)}equals(dt){return!!dt&&"Literal"===dt.termType&&dt.value===this.value&&dt.language===this.language&&dt.datatype.equals(this.datatype)}}it.Literal=ee,ee.RDF_LANGUAGE_STRING=new yt.NamedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),ee.XSD_STRING=new yt.NamedNode("http://www.w3.org/2001/XMLSchema#string")},417:(Ut,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.NamedNode=void 0,it.NamedNode=class{constructor(ee){this.termType="NamedNode",this.value=ee}equals(ee){return!!ee&&"NamedNode"===ee.termType&&ee.value===this.value}}},451:(Ut,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.Quad=void 0,it.Quad=class{constructor(ee,Tt,dt,Y){this.termType="Quad",this.value="",this.subject=ee,this.predicate=Tt,this.object=dt,this.graph=Y}equals(ee){return!!ee&&("Quad"===ee.termType||!ee.termType)&&this.subject.equals(ee.subject)&&this.predicate.equals(ee.predicate)&&this.object.equals(ee.object)&&this.graph.equals(ee.graph)}}},735:(Ut,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.Variable=void 0,it.Variable=class{constructor(ee){this.termType="Variable",this.value=ee}equals(ee){return!!ee&&"Variable"===ee.termType&&ee.value===this.value}}},609:function(Ut,it,Je){"use strict";var yt=this&&this.__createBinding||(Object.create?function(v,x,O,A){void 0===A&&(A=O),Object.defineProperty(v,A,{enumerable:!0,get:function(){return x[O]}})}:function(v,x,O,A){void 0===A&&(A=O),v[A]=x[O]}),ee=this&&this.__exportStar||function(v,x){for(var O in v)"default"!==O&&!Object.prototype.hasOwnProperty.call(x,O)&&yt(x,v,O)};Object.defineProperty(it,"__esModule",{value:!0}),it.getSupportedJavaScriptPrimitives=it.getSupportedRdfDatatypes=it.getTermRaw=it.toRdf=it.fromRdf=void 0;const Tt=Je(991),dt=Je(938),Y=Je(60);ee(Je(938),it),ee(Je(871),it),ee(Je(60),it);const Se=new Tt.DataFactory,he=new Y.Translator;function W(v,x){return he.fromRdf(v,x)}he.registerHandler(new dt.TypeHandlerString,dt.TypeHandlerString.TYPES.map(v=>Se.namedNode(v)),["string"]),he.registerHandler(new dt.TypeHandlerBoolean,[dt.TypeHandlerBoolean.TYPE].map(v=>Se.namedNode(v)),["boolean"]),he.registerHandler(new dt.TypeHandlerNumberDouble,dt.TypeHandlerNumberDouble.TYPES.map(v=>Se.namedNode(v)),["number"]),he.registerHandler(new dt.TypeHandlerNumberInteger,dt.TypeHandlerNumberInteger.TYPES.map(v=>Se.namedNode(v)),["number"]),he.registerHandler(new dt.TypeHandlerDate,dt.TypeHandlerDate.TYPES.map(v=>Se.namedNode(v)),["object"]),it.fromRdf=W,it.toRdf=function(v,x){return x&&"namedNode"in x&&(x={dataFactory:x}),(x=x||{})&&!x.dataFactory&&(x.dataFactory=Se),he.toRdf(v,x)},it.getTermRaw=function(v,x){return"Literal"===v.termType?W(v,x):v.value},it.getSupportedRdfDatatypes=function(){return he.getSupportedRdfDatatypes()},it.getSupportedJavaScriptPrimitives=function(){return he.getSupportedJavaScriptPrimitives()}},871:(Ut,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0})},60:(Ut,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(ee){throw new Error(`Invalid RDF ${ee.datatype.value} value: '${ee.value}'`)}registerHandler(ee,Tt,dt){for(const Y of Tt)this.supportedRdfDatatypes.push(Y),this.fromRdfHandlers[Y.value]=ee;for(const Y of dt){let Se=this.toRdfHandlers[Y];Se||(this.toRdfHandlers[Y]=Se=[]),Se.push(ee)}}fromRdf(ee,Tt){const dt=this.fromRdfHandlers[ee.datatype.value];return dt?dt.fromRdf(ee,Tt):ee.value}toRdf(ee,Tt){const dt=this.toRdfHandlers[typeof ee];if(dt)for(const Y of dt){const Se=Y.toRdf(ee,Tt);if(Se)return Se}throw new Error(`Invalid JavaScript value: '${ee}'`)}getSupportedRdfDatatypes(){return this.supportedRdfDatatypes}getSupportedJavaScriptPrimitives(){return Object.keys(this.toRdfHandlers)}}},727:(Ut,it,Je)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.TypeHandlerBoolean=void 0;const yt=Je(60);class ee{fromRdf(dt,Y){switch(dt.value){case"true":return!0;case"false":return!1;case"1":return!0;case"0":return!1}return Y&&yt.Translator.incorrectRdfDataType(dt),!1}toRdf(dt,{datatype:Y,dataFactory:Se}){return Se.literal(dt?"true":"false",Y||Se.namedNode(ee.TYPE))}}it.TypeHandlerBoolean=ee,ee.TYPE="http://www.w3.org/2001/XMLSchema#boolean"},525:(Ut,it,Je)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.TypeHandlerDate=void 0;const yt=Je(60);class ee{fromRdf(dt,Y){switch(Y&&!dt.value.match(ee.VALIDATORS[dt.datatype.value.substr(33,dt.datatype.value.length)])&&yt.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 Se=dt.value.split("-");return new Date(0,parseInt(Se[0],10)-1,parseInt(Se[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:Y,dataFactory:Se}){if(Y=Y||Se.namedNode(ee.TYPES[0]),!(dt instanceof Date))return null;const he=dt;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 Se.literal(W,Y)}}it.TypeHandlerDate=ee,ee.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"],ee.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:(Ut,it,Je)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.TypeHandlerNumberDouble=void 0;const yt=Je(60);class ee{fromRdf(dt,Y){const Se=parseFloat(dt.value);return Y&&isNaN(Se)&&yt.Translator.incorrectRdfDataType(dt),Se}toRdf(dt,{datatype:Y,dataFactory:Se}){return Y=Y||Se.namedNode(ee.TYPES[0]),isNaN(dt)?Se.literal("NaN",Y):isFinite(dt)?dt%1==0?null:Se.literal(dt.toExponential(15).replace(/(\d)0*e\+?/,"$1E"),Y):Se.literal(dt>0?"INF":"-INF",Y)}}it.TypeHandlerNumberDouble=ee,ee.TYPES=["http://www.w3.org/2001/XMLSchema#double","http://www.w3.org/2001/XMLSchema#decimal","http://www.w3.org/2001/XMLSchema#float"]},750:(Ut,it,Je)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.TypeHandlerNumberInteger=void 0;const yt=Je(60);class ee{fromRdf(dt,Y){const Se=parseInt(dt.value,10);return Y&&(isNaN(Se)||dt.value.indexOf(".")>=0)&&yt.Translator.incorrectRdfDataType(dt),Se}toRdf(dt,{datatype:Y,dataFactory:Se}){return Se.literal(String(dt),Y||Se.namedNode(dt<=ee.MAX_INT&&dt>=ee.MIN_INT?ee.TYPES[0]:ee.TYPES[1]))}}it.TypeHandlerNumberInteger=ee,ee.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"],ee.MAX_INT=2147483647,ee.MIN_INT=-2147483648},608:(Ut,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.TypeHandlerString=void 0;class Je{fromRdf(ee){return ee.value}toRdf(ee,{datatype:Tt,dataFactory:dt}){return dt.literal(ee,Tt)}}it.TypeHandlerString=Je,Je.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(Ut,it,Je){"use strict";var yt=this&&this.__createBinding||(Object.create?function(Tt,dt,Y,Se){void 0===Se&&(Se=Y),Object.defineProperty(Tt,Se,{enumerable:!0,get:function(){return dt[Y]}})}:function(Tt,dt,Y,Se){void 0===Se&&(Se=Y),Tt[Se]=dt[Y]}),ee=this&&this.__exportStar||function(Tt,dt){for(var Y in Tt)"default"!==Y&&!Object.prototype.hasOwnProperty.call(dt,Y)&&yt(dt,Tt,Y)};Object.defineProperty(it,"__esModule",{value:!0}),ee(Je(727),it),ee(Je(525),it),ee(Je(554),it),ee(Je(750),it),ee(Je(608),it)},303:(Ut,it,Je)=>{"use strict";var yt={};Je.r(yt),Je.d(yt,{decode:()=>Xme,encode:()=>Qme});var ee={};Je.r(ee),Je.d(ee,{decode:()=>n_e,encode:()=>i_e});var Tt={};Je.r(Tt),Je.d(Tt,{decode:()=>r_e,encode:()=>s_e});var dt={};function Y(n){return"function"==typeof n}Je.r(dt),Je.d(dt,{decode:()=>o_e,encode:()=>a_e});let Se=!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 Se&&console.log("RxJS: Back to a better error behavior. Thank you. <3");Se=n},get useDeprecatedSynchronousErrorHandling(){return Se}};function W(n){setTimeout(()=>{throw n},0)}const j={closed:!0,next(n){},error(n){if(he.useDeprecatedSynchronousErrorHandling)throw n;W(n)},complete(){}},P=Array.isArray||(n=>n&&"number"==typeof n.length);function Q(n){return null!==n&&"object"==typeof n}const v=(()=>{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 x{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 x)t.remove(this);else if(null!==t)for(let o=0;oe.concat(t instanceof v?t.errors:t),[])}x.EMPTY=((n=new x).closed=!0,n);const A="function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random();class y extends x{constructor(e,t,i){switch(super(),this.syncErrorValue=null,this.syncErrorThrown=!1,this.syncErrorThrowable=!1,this.isStopped=!1,arguments.length){case 0:this.destination=j;break;case 1:if(!e){this.destination=j;break}if("object"==typeof e){e instanceof y?(this.syncErrorThrowable=e.syncErrorThrowable,this.destination=e,e.add(this)):(this.syncErrorThrowable=!0,this.destination=new S(this,e));break}default:this.syncErrorThrowable=!0,this.destination=new S(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 S 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!==j&&(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 R="function"==typeof Symbol&&Symbol.observable||"@@observable";function K(n){return n}function ce(...n){return D(n)}function D(n){return 0===n.length?K:1===n.length?n[0]:function(t){return n.reduce((i,r)=>r(i),t)}}let I=(()=>{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(j)}(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=X(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)}[R](){return this}pipe(...t){return 0===t.length?this:D(t)(this)}toPromise(t){return new(t=X(t))((i,r)=>{let s;this.subscribe(o=>s=o,o=>r(o),()=>i(s))})}}return n.create=e=>new n(e),n})();function X(n){if(n||(n=he.Promise||Promise),!n)throw new Error("no Promise impl found");return n}const $=(()=>{function n(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return n.prototype=Object.create(Error.prototype),n})();class Z extends x{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 oe extends y{constructor(e){super(e),this.destination=e}}let se=(()=>{class n extends I{constructor(){super(),this.observers=[],this.closed=!1,this.isStopped=!1,this.hasError=!1,this.thrownError=null}[A](){return new oe(this)}lift(t){const i=new te(this,this);return i.operator=t,i}next(t){if(this.closed)throw new $;if(!this.isStopped){const{observers:i}=this,r=i.length,s=i.slice();for(let o=0;onew te(e,t),n})();class te extends se{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):x.EMPTY}}function Ce(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 ne(n,e))}}class ne{constructor(e,t){this.project=e,this.thisArg=t}call(e,t){return t.subscribe(new _e(e,this.project,this.thisArg))}}class _e 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 Ie=n=>e=>{for(let t=0,i=n.length;tn&&"number"==typeof n.length&&"function"!=typeof n;function Ke(n){return!!n&&"function"!=typeof n.subscribe&&"function"==typeof n.then}const Me=n=>{if(n&&"function"==typeof n[R])return(n=>e=>{const t=n[R]();if("function"!=typeof t.subscribe)throw new TypeError("Provided object does not correctly implement Symbol.observable");return t.subscribe(e)})(n);if(ke(n))return Ie(n);if(Ke(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[Xe])return(n=>e=>{const t=n[Xe]();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 ${Q(n)?"an invalid object":`'${n}'`} where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.`;throw new TypeError(t)}};function Ne(n,e){return new I(t=>{const i=new x;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 je(n,e){return e?function(n,e){if(null!=n){if(function(n){return n&&"function"==typeof n[R]}(n))return function(n,e){return new I(t=>{const i=new x;return i.add(e.schedule(()=>{const r=n[R]();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(Ke(n))return function(n,e){return new I(t=>{const i=new x;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(ke(n))return Ne(n,e);if(function(n){return n&&"function"==typeof n[Xe]}(n)||"string"==typeof n)return function(n,e){if(!n)throw new Error("Iterable cannot be null");return new I(t=>{const i=new x;let r;return i.add(()=>{r&&"function"==typeof r.return&&r.return()}),i.add(e.schedule(()=>{r=n[Xe](),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 I?n:new I(Me(n))}class _t 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 ve extends y{notifyNext(e){this.destination.next(e)}notifyError(e){this.destination.error(e)}notifyComplete(){this.destination.complete()}}function N(n,e){if(e.closed)return;if(n instanceof I)return n.subscribe(e);let t;try{t=Me(n)(e)}catch(i){e.error(i)}return t}function B(n,e,t=Number.POSITIVE_INFINITY){return"function"==typeof e?i=>i.pipe(B((r,s)=>je(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 Qe(e,this.project,this.concurrent))}}class Qe extends ve{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 Nt(n=Number.POSITIVE_INFINITY){return B(K,n)}function On(n,e){return e?Ne(n,e):new I(Ie(n))}function kn(...n){let e=Number.POSITIVE_INFINITY,t=null,i=n[n.length-1];return Ce(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 I?n[0]:Nt(e)(On(n,t))}function Yn(){return function(e){return e.lift(new Ti(e))}}class Ti{constructor(e){this.connectable=e}call(e,t){const{connectable:i}=this;i._refCount++;const r=new wi(e,i),s=t.subscribe(r);return r.closed||(r.connection=i.connect()),s}}class wi 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 Xr extends I{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 x,e.add(this.source.subscribe(new gs(this.getSubject(),this))),e.closed&&(this._connection=null,e=x.EMPTY)),e}refCount(){return Yn()(this)}}const Ls=(()=>{const n=Xr.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 gs extends oe{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()}}}function el(n,e){return function(i){let r;if(r="function"==typeof n?n:function(){return n},"function"==typeof e)return i.lift(new kl(r,e));const s=Object.create(i,Ls);return s.source=i,s.subjectFactory=r,s}}class kl{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 Sa(){return new se}function Es(){return n=>Yn()(el(Sa)(n))}function Jt(n){for(let e in n)if(n[e]===Jt)return e;throw Error("Could not find renamed property on target object.")}function tl(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 lt(n,e){return null==n||""===n?null===e?"":e:null==e||""===e?n:n+" "+e}const ht=Jt({__forward_ref__:Jt});function ge(n){return n.__forward_ref__=ge,n.toString=function(){return rt(this())},n}function be(n){return Le(n)?n():n}function Le(n){return"function"==typeof n&&n.hasOwnProperty(ht)&&n.__forward_ref__===ge}class Ze extends Error{constructor(e,t){super(function(n,e){return`${n?`NG0${n}: `:""}${e}`}(e,t)),this.code=e}}function Dt(n){return"string"==typeof n?n:null==n?"":String(n)}function Xt(n){return"function"==typeof n?n.name||n.toString():"object"==typeof n&&null!=n&&"function"==typeof n.type?n.type.name||n.type.toString():Dt(n)}function bn(n,e){const t=e?` in ${e}`:"";throw new Ze("201",`No provider for ${Xt(n)} found${t}`)}function J(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 xt(n){return{providers:n.providers||[],imports:n.imports||[]}}function vn(n){return Ss(n,po)||Ss(n,js)}function Ss(n,e){return n.hasOwnProperty(e)?n[e]:null}function Ll(n){return n&&(n.hasOwnProperty(jr)||n.hasOwnProperty(xc))?n[jr]:null}const po=Jt({\u0275prov:Jt}),jr=Jt({\u0275inj:Jt}),js=Jt({ngInjectableDef:Jt}),xc=Jt({ngInjectorDef:Jt});var Sn=(()=>((Sn=Sn||{})[Sn.Default=0]="Default",Sn[Sn.Host=1]="Host",Sn[Sn.Self=2]="Self",Sn[Sn.SkipSelf=4]="SkipSelf",Sn[Sn.Optional=8]="Optional",Sn))();let go;function Ca(n){const e=go;return go=n,e}function wd(n,e,t){const i=vn(n);return i&&"root"==i.providedIn?void 0===i.value?i.value=i.factory():i.value:t&Sn.Optional?null:void 0!==e?e:void bn(rt(n),"Injector")}function De(n){return{toString:n}.toString()}var He=(()=>((He=He||{})[He.OnPush=0]="OnPush",He[He.Default=1]="Default",He))(),Yt=(()=>((Yt=Yt||{})[Yt.Emulated=0]="Emulated",Yt[Yt.None=2]="None",Yt[Yt.ShadowDom=3]="ShadowDom",Yt))();const li="undefined"!=typeof globalThis&&globalThis,Vr="undefined"!=typeof window&&window,es="undefined"!=typeof self&&"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&self,xs="undefined"!=typeof global&&global,Qn=li||xs||Vr||es,Ed={},tr=[],fp=Jt({\u0275cmp:Jt}),Jm=Jt({\u0275dir:Jt}),Dh=Jt({\u0275pipe:Jt}),sv=Jt({\u0275mod:Jt}),T1=Jt({\u0275loc:Jt}),jl=Jt({\u0275fac:Jt}),Ih=Jt({__NG_ELEMENT_ID__:Jt});let M1=0;function ln(n){return De(()=>{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||tr,viewQuery:n.viewQuery||null,features:n.features||null,data:n.data||{},encapsulation:n.encapsulation||Yt.Emulated,id:"c",styles:n.styles||tr,_:null,setInput:null,schemas:n.schemas||null,tView:null},r=n.directives,s=n.features,o=n.pipes;return i.id+=M1++,i.inputs=cv(n.inputs,t),i.outputs=cv(n.outputs),s&&s.forEach(a=>a(i)),i.directiveDefs=r?()=>("function"==typeof r?r():r).map(ov):null,i.pipeDefs=o?()=>("function"==typeof o?o():o).map(av):null,i})}function ov(n){return Vi(n)||function(n){return n[Jm]||null}(n)}function av(n){return function(n){return n[Dh]||null}(n)}const lv={};function on(n){return De(()=>{const e={type:n.type,bootstrap:n.bootstrap||tr,declarations:n.declarations||tr,imports:n.imports||tr,exports:n.exports||tr,transitiveCompileScopes:null,schemas:n.schemas||null,id:n.id||null};return null!=n.id&&(lv[n.id]=n.type),e})}function cv(n,e){if(null==n)return Ed;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 Rt=ln;function Vs(n){return{type:n.type,name:n.name,factory:null,pure:!1!==n.pure,onDestroy:n.type.prototype.ngOnDestroy||null}}function Vi(n){return n[fp]||null}function Oo(n,e){const t=n[sv]||null;if(!t&&!0===e)throw new Error(`Type ${rt(n)} does not have '\u0275mod' property.`);return t}function Qo(n){return Array.isArray(n)&&"object"==typeof n[1]}function Zo(n){return Array.isArray(n)&&!0===n[1]}function n_(n){return 0!=(8&n.flags)}function Ad(n){return 2==(2&n.flags)}function Td(n){return 1==(1&n.flags)}function Ma(n){return null!==n.template}function uv(n){return 0!=(512&n[2])}function Tc(n,e){return n.hasOwnProperty(jl)?n[jl]:null}class o_{constructor(e,t,i){this.previousValue=e,this.currentValue=t,this.firstChange=i}isFirstChange(){return this.firstChange}}function Ui(){return fv}function fv(n){return n.type.prototype.ngOnChanges&&(n.setInput=k1),F1}function F1(){const n=at(this),e=null==n?void 0:n.current;if(e){const t=n.previous;if(t===Ed)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=at(n)||function(n,e){return n[kh]=e}(n,{previous:Ed,current:null}),s=r.current||(r.current={}),o=r.previous,a=this.declaredInputs[t],l=o[a];s[a]=new o_(l&&l.currentValue,e,o===Ed),n[i]=e}Ui.ngInherit=!0;const kh="__ngSimpleChanges__";function at(n){return n[kh]||null}let Ki;function gr(n){return!!n.listen}const bu={createRenderer:(n,e)=>void 0!==Ki?Ki:"undefined"!=typeof document?document:void 0};function xr(n){for(;Array.isArray(n);)n=n[0];return n}function Lh(n,e){return xr(e[n])}function Zs(n,e){return xr(e[n.index])}function c_(n,e){return n.data[e]}function zs(n,e){const t=e[n];return Qo(t)?t:t[0]}function zl(n){return 4==(4&n[2])}function Dd(n){return 128==(128&n[2])}function Ia(n,e){return null==e?null:n[e]}function u_(n){n[18]=0}function mp(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 Bn={lFrame:wu(null),bindingsEnabled:!0,isInCheckNoChangesMode:!1};function gv(){return Bn.bindingsEnabled}function jt(){return Bn.lFrame.lView}function Ei(){return Bn.lFrame.tView}function Cr(n){return Bn.lFrame.contextLView=n,n[8]}function cs(){let n=d_();for(;null!==n&&64===n.type;)n=n.parent;return n}function d_(){return Bn.lFrame.currentTNode}function rl(n,e){const t=Bn.lFrame;t.currentTNode=n,t.isParent=e}function Hr(){return Bn.lFrame.isParent}function ms(){Bn.lFrame.isParent=!1}function Vh(){return Bn.isInCheckNoChangesMode}function yp(n){Bn.isInCheckNoChangesMode=n}function Oa(){return Bn.lFrame.bindingIndex++}function No(n){const e=Bn.lFrame,t=e.bindingIndex;return e.bindingIndex=e.bindingIndex+n,t}function Id(n,e){const t=Bn.lFrame;t.bindingIndex=t.bindingRootIndex=n,h_(e)}function h_(n){Bn.lFrame.currentDirectiveIndex=n}function f_(n){const e=Bn.lFrame.currentDirectiveIndex;return-1===e?null:n[e]}function mv(){return Bn.lFrame.currentQueryIndex}function p_(n){Bn.lFrame.currentQueryIndex=n}function vp(n){const e=n[1];return 2===e.type?e.declTNode:1===e.type?n[6]:null}function Od(n,e,t){if(t&Sn.SkipSelf){let r=e,s=n;for(;!(r=r.parent,null!==r||t&Sn.Host||(r=vp(s),null===r||(s=s[15],10&r.type))););if(null===r)return!1;e=r,n=s}const i=Bn.lFrame=Ee();return i.currentTNode=e,i.lView=n,!0}function Hh(n){const e=Ee(),t=n[1];Bn.lFrame=e,e.currentTNode=t.firstChild,e.lView=n,e.tView=t,e.contextLView=n,e.bindingIndex=t.bindingStartIndex,e.inI18n=!1}function Ee(){const n=Bn.lFrame,e=null===n?null:n.child;return null===e?wu(n):e}function wu(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 Gh(){const n=Bn.lFrame;return Bn.lFrame=n.parent,n.currentTNode=null,n.lView=null,n}const Po=Gh;function fi(){const n=Gh();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 Js(){return Bn.lFrame.selectedIndex}function yo(n){Bn.lFrame.selectedIndex=n}function kr(){const n=Bn.lFrame;return c_(n.tView,n.selectedIndex)}function wp(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 $h{constructor(e,t,i){this.factory=e,this.resolving=!1,this.canSeeViewProviders=t,this.injectImpl=i}}function xp(n,e,t){const i=gr(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 Nd=!0;function Cp(n){const e=Nd;return Nd=n,e}let v_=0;function Hs(n,e){const t=Ap(n,e);if(-1!==t)return t;const i=e[1];i.firstCreatePass&&(n.injectorIndex=e.length,w_(i.data,n),w_(e,null),w_(i.blueprint,null));const r=qh(n,e),s=n.injectorIndex;if(vv(r)){const o=Rd(r),a=ol(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 w_(n,e){n.push(0,0,0,0,0,0,0,0,e)}function Ap(n,e){return-1===n.injectorIndex||n.parent&&n.parent.injectorIndex===n.injectorIndex||null===e[n.injectorIndex+8]?-1:n.injectorIndex}function qh(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 Dc(n,e,t){!function(n,e,t){let i;"string"==typeof t?i=t.charCodeAt(0)||0:t.hasOwnProperty(Ih)&&(i=t[Ih]),null==i&&(i=t[Ih]=v_++);const r=255&i;e.data[n+(r>>5)]|=1<=0?255&e:xv:e}(t);if("function"==typeof s){if(!Od(e,n,i))return i&Sn.Host?E_(r,t,i):Ev(e,t,i,r);try{const o=s(i);if(null!=o||i&Sn.Optional)return o;bn(t)}finally{Po()}}else if("number"==typeof s){let o=null,a=Ap(n,e),l=-1,c=i&Sn.Host?e[16][6]:null;for((-1===a||i&Sn.SkipSelf)&&(l=-1===a?qh(n,e):e[a+8],-1!==l&&Kh(i,!1)?(o=e[1],a=Rd(l),e=ol(l,e)):a=-1);-1!==a;){const u=e[1];if(Tp(s,a,u.data)){const h=Ts(a,e,t,o,i,c);if(h!==Sv)return h}l=e[a+8],-1!==l&&Kh(i,e[1].data[a+8]===c)&&Tp(s,a,e)?(o=u,a=Rd(l),e=ol(l,e)):a=-1}}}return Ev(e,t,i,r)}const Sv={};function xv(){return new ea(cs(),jt())}function Ts(n,e,t,i,r,s){const o=e[1],a=o.data[n+8],u=Pd(a,o,t,null==i?Ad(a)&&Nd:i!=o&&0!=(3&a.type),r&Sn.Host&&s===a);return null!==u?Fd(e,o,u,a):Sv}function Pd(n,e,t,i,r){const s=n.providerIndexes,o=e.data,a=1048575&s,l=n.directiveStart,u=s>>20,p=r?a+u:n.directiveEnd;for(let g=i?a:a+u;g=l&&m.type===t)return g}if(r){const g=o[l];if(g&&Ma(g)&&g.type===t)return l}return null}function Fd(n,e,t,i){let r=n[t];const s=e.data;if(function(n){return n instanceof $h}(r)){const o=r;o.resolving&&function(n,e){throw new Ze("200",`Circular dependency in DI detected for ${n}`)}(Xt(s[t]));const a=Cp(o.canSeeViewProviders);o.resolving=!0;const l=o.injectImpl?Ca(o.injectImpl):null;Od(n,i,Sn.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=fv(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&&Ca(l),Cp(a),o.resolving=!1,Po()}}return r}function Tp(n,e,t){return!!(t[e+(n>>5)]&1<{const e=n.prototype.constructor,t=e[jl]||Ms(e),i=Object.prototype;let r=Object.getPrototypeOf(n.prototype).constructor;for(;r&&r!==i;){const s=r[jl]||Ms(r);if(s&&s!==t)return s;r=Object.getPrototypeOf(r)}return s=>new s})}function Ms(n){return Le(n)?()=>{const e=Ms(be(n));return e&&e()}:Tc(n)}function Fo(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{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,u){const h=l.hasOwnProperty(Ld)?l[Ld]:Object.defineProperty(l,Ld,{value:[]})[Ld];for(;h.length<=u;)h.push(null);return(h[u]=h[u]||[]).push(o),l}}return t&&(r.prototype=Object.create(t.prototype)),r.prototype.ngMetadataName=n,r.annotationCls=r,r})}class Ht{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}`}}const xu=Function;function ta(n,e){void 0===e&&(e=n);for(let t=0;tArray.isArray(t)?na(t,e):e(t))}function Qh(n,e,t){e>=n.length?n.push(t):n.splice(e,0,t)}function Gl(n,e){return e>=n.length-1?n.pop():n.splice(e,1)[0]}function Oc(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 M_(n,e){const t=Ds(n,e);if(t>=0)return n[1|t]}function Ds(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(Pc,"\n ")}`}("\n"+n.message,r,t,i),n.ngTokenPath=r,n[Nc]=null,n}const zd=Ud(Pa("Inject",n=>({token:n})),-1),ns=Ud(Pa("Optional"),8),ul=Ud(Pa("SkipSelf"),4);let Gd;function Ou(n){var e;return(null===(e=function(){if(void 0===Gd&&(Gd=null,Qn.trustedTypes))try{Gd=Qn.trustedTypes.createPolicy("angular",{createHTML:n=>n,createScript:n=>n,createScriptURL:n=>n})}catch(n){}return Gd}())||void 0===e?void 0:e.createHTML(n))||n}class Yl{constructor(e){this.changingThisBreaksApplicationSecurity=e}toString(){return`SafeValue must use [property]=binding: ${this.changingThisBreaksApplicationSecurity} (see https://g.co/ng/security#xss)`}}class P_ extends Yl{getTypeName(){return"HTML"}}class F_ extends Yl{getTypeName(){return"Style"}}class Vp extends Yl{getTypeName(){return"Script"}}class $d extends Yl{getTypeName(){return"URL"}}class Fn extends Yl{getTypeName(){return"ResourceURL"}}function Gs(n){return n instanceof Yl?n.changingThisBreaksApplicationSecurity:n}function ia(n,e){const t=Lc(n);if(null!=t&&t!==e){if("ResourceURL"===t&&"URL"===e)return!0;throw new Error(`Required a safe ${e}, got a ${t} (see https://g.co/ng/security#xss)`)}return t===e}function Lc(n){return n instanceof Yl&&n.getTypeName()||null}class zv{constructor(e){this.inertDocumentHelper=e}getInertBodyElement(e){e=""+e;try{const t=(new window.DOMParser).parseFromString(Ou(e),"text/html").body;return null===t?this.inertDocumentHelper.getInertBodyElement(e):(t.removeChild(t.firstChild),t)}catch(t){return null}}}class pA{constructor(e){if(this.defaultDoc=e,this.inertDocument=this.defaultDoc.implementation.createHTMLDocument("sanitization-inert"),null==this.inertDocument.body){const t=this.inertDocument.createElement("html");this.inertDocument.appendChild(t);const i=this.inertDocument.createElement("body");t.appendChild(i)}}getInertBodyElement(e){const t=this.inertDocument.createElement("template");if("content"in t)return t.innerHTML=Ou(e),t;const i=this.inertDocument.createElement("body");return i.innerHTML=Ou(e),this.defaultDoc.documentMode&&this.stripCustomNsAttrs(i),i}stripCustomNsAttrs(e){const t=e.attributes;for(let r=t.length-1;0Bo(e.trim())).join(", ")}function ra(n){const e={};for(const t of n.split(","))e[t]=!0;return e}function Jh(...n){const e={};for(const t of n)for(const i in t)t.hasOwnProperty(i)&&(e[i]=!0);return e}const Up=ra("area,br,col,hr,img,wbr"),Gv=ra("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr"),$v=ra("rp,rt"),L_=Jh(Up,Jh(Gv,ra("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")),Jh($v,ra("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")),Jh($v,Gv)),B_=ra("background,cite,href,itemtype,longdesc,poster,src,xlink:href"),j_=ra("srcset"),V_=Jh(B_,j_,ra("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"),ra("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")),vA=ra("script,style,template");class U_{constructor(){this.sanitizedSomething=!1,this.buf=[]}sanitizeChildren(e){let t=e.firstChild,i=!0;for(;t;)if(t.nodeType===Node.ELEMENT_NODE?i=this.startElement(t):t.nodeType===Node.TEXT_NODE?this.chars(t.nodeValue):this.sanitizedSomething=!0,i&&t.firstChild)t=t.firstChild;else for(;t;){t.nodeType===Node.ELEMENT_NODE&&this.endElement(t);let r=this.checkClobberedElement(t,t.nextSibling);if(r){t=r;break}t=this.checkClobberedElement(t,t.parentNode)}return this.buf.join("")}startElement(e){const t=e.nodeName.toLowerCase();if(!L_.hasOwnProperty(t))return this.sanitizedSomething=!0,!vA.hasOwnProperty(t);this.buf.push("<"),this.buf.push(t);const i=e.attributes;for(let r=0;r"),!0}endElement(e){const t=e.nodeName.toLowerCase();L_.hasOwnProperty(t)&&!Up.hasOwnProperty(t)&&(this.buf.push(""))}chars(e){this.buf.push(Hp(e))}checkClobberedElement(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: ${e.outerHTML}`);return t}}const Wv=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,ef=/([^\#-~ |!])/g;function Hp(n){return n.replace(/&/g,"&").replace(Wv,function(e){return"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";"}).replace(ef,function(e){return"&#"+e.charCodeAt(0)+";"}).replace(//g,">")}let tf;function z_(n,e){let t=null;try{tf=tf||function(n){const e=new pA(n);return function(){try{return!!(new window.DOMParser).parseFromString(Ou(""),"text/html")}catch(n){return!1}}()?new zv(e):e}(n);let i=e?String(e):"";t=tf.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=t.innerHTML,t=tf.getInertBodyElement(i)}while(i!==s);return Ou((new U_).sanitizeChildren(Wd(t)||t))}finally{if(t){const i=Wd(t)||t;for(;i.firstChild;)i.removeChild(i.firstChild)}}}function Wd(n){return"content"in n&&function(n){return n.nodeType===Node.ELEMENT_NODE&&"TEMPLATE"===n.nodeName}(n)?n.content:null}var ni=(()=>((ni=ni||{})[ni.NONE=0]="NONE",ni[ni.HTML=1]="HTML",ni[ni.STYLE=2]="STYLE",ni[ni.SCRIPT=3]="SCRIPT",ni[ni.URL=4]="URL",ni[ni.RESOURCE_URL=5]="RESOURCE_URL",ni))();function nf(n){const e=function(){const n=jt();return n&&n[12]}();return e?e.sanitize(ni.URL,n)||"":ia(n,"URL")?Gs(n):Bo(Dt(n))}const $_="__ngContext__";function Is(n,e){n[$_]=e}function W_(n){const e=function(n){return n[$_]||null}(n);return e?Array.isArray(e)?e:e.lView:null}function Gp(n){return n.ngOriginalError}function NA(n,...e){n.error(...e)}class oa{constructor(){this._console=console}handleError(e){const t=this._findOriginalError(e),i=this._findContext(e),r=function(n){return n&&n.ngErrorLogger||NA}(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(Gp(e)):null}_findOriginalError(e){let t=e&&Gp(e);for(;t&&Gp(t);)t=Gp(t);return t||null}}const iw=(()=>("undefined"!=typeof requestAnimationFrame&&requestAnimationFrame||setTimeout).bind(Qn))();function hl(n){return n instanceof Function?n():n}var jo=(()=>((jo=jo||{})[jo.Important=1]="Important",jo[jo.DashCase=2]="DashCase",jo))();function Q_(n,e){return undefined(n,e)}function of(n){const e=n[3];return Zo(e)?e[3]:e}function Yd(n){return lw(n[13])}function J_(n){return lw(n[4])}function lw(n){for(;null!==n&&!Zo(n);)n=n[4];return n}function Kd(n,e,t,i,r){if(null!=i){let s,o=!1;Zo(i)?s=i:Qo(i)&&(o=!0,i=i[0]);const a=xr(i);0===n&&null!==t?null==r?fw(e,t,a):fl(e,t,a,r||null,!0):1===n&&null!==t?fl(e,t,a,r||null,!0):2===n?function(n,e,t){const i=qp(n,e);i&&function(n,e,t,i){gr(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!==xr(t)&&Kd(e,n,i,s,r);for(let a=10;a0&&(n[t-1][4]=i[4]);const s=Gl(n,10+e);!function(n,e){Xd(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 iy(n,e){if(!(256&e[2])){const t=e[11];gr(t)&&t.destroyNode&&Xd(n,e,t,3,null,null),function(n){let e=n[13];if(!e)return Wp(n[1],n);for(;e;){let t=null;if(Qo(e))t=e[13];else{const i=e[10];i&&(t=i)}if(!t){for(;e&&!e[4]&&e!==n;)Qo(e)&&Wp(e[1],e),e=e[3];null===e&&(e=n),Qo(e)&&Wp(e[1],e),t=e&&e[4]}e=t}}(e)}}function Wp(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[h+1].toLowerCase();const g=8&i?p:null;if(g&&-1!==lf(g,c,0)||2&i&&c!==p){if(ka(i))return!1;o=!0}}}}else{if(!o&&!ka(i)&&!ka(l))return!1;if(o&&ka(l))continue;o=!1,i=l|1&i}}return ka(i)||o}function ka(n){return 0==(1&n)}function oT(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&&!ka(o)&&(e+=Aw(s,r),r=""),i=o,s=s||!ka(i);t++}return""!==r&&(e+=Aw(s,r)),e}const In={};function Zt(n){Tw(Ei(),jt(),Js()+n,Vh())}function Tw(n,e,t,i){if(!i)if(3==(3&e[2])){const s=n.preOrderCheckHooks;null!==s&&Ep(e,s,t)}else{const s=n.preOrderHooks;null!==s&&Sp(e,s,0,t)}yo(t)}function pl(n,e){return n<<17|e<<2}function Rn(n){return n>>17&32767}function Ar(n){return 2|n}function Kl(n){return(131068&n)>>2}function gl(n,e){return-131069&n|e<<2}function cy(n){return 1|n}function kw(n,e){const t=n.contentQueries;if(null!==t)for(let i=0;i20&&Tw(n,e,20,Vh()),t(i,r)}finally{yo(s)}}function hf(n,e,t){!gv()||(function(n,e,t,i){const r=t.directiveStart,s=t.directiveEnd;n.firstCreatePass||Hs(t,e),Is(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 qw(n,e){null!==n.hostBindings&&n.hostBindings(1,e)}function Yw(n,e){e.flags|=2,(n.components||(n.components=[])).push(e.index)}function PT(n,e,t){if(t){if(e.exportAs)for(let i=0;i0&&wy(t)}}function wy(n){for(let i=Yd(n);null!==i;i=J_(i))for(let r=10;r0&&wy(s)}const t=n[1].components;if(null!==t)for(let i=0;i0&&wy(r)}}function UT(n,e){const t=zs(e,n),i=t[1];(function(n,e){for(let t=e.length;tPromise.resolve(null))();function Qw(n){return n[7]||(n[7]=[])}function ig(n){return n.cleanup||(n.cleanup=[])}function Ay(n,e,t){return(null===n||Ma(n))&&(t=function(n){for(;Array.isArray(n);){if("object"==typeof n[1])return n;n=n[0]}return null}(t[e.index])),t[11]}function Ty(n,e){const t=n[9],i=t?t.get(oa,null):null;i&&i.handleError(e)}function Zw(n,e,t,i,r){for(let s=0;sthis.processProvider(a,e,t)),na([e],a=>this.processInjectorType(a,[],s)),this.records.set(Pu,ku(void 0,this));const o=this.records.get(Fu);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=Tu,i=Sn.Default){this.assertNotDestroyed();const r=Vd(this),s=Ca(void 0);try{if(!(i&Sn.SkipSelf)){let a=this.records.get(e);if(void 0===a){const l=function(n){return"function"==typeof n||"object"==typeof n&&n instanceof Ht}(e)&&vn(e);a=l&&this.injectableDefInScope(l)?ku(Ry(e),ff):null,this.records.set(e,a)}if(null!=a)return this.hydrate(e,a)}return(i&Sn.Self?Jw():this.parent).get(e,t=i&Sn.Optional&&t===Tu?null:t)}catch(o){if("NullInjectorError"===o.name){if((o[Nc]=o[Nc]||[]).unshift(rt(e)),r)throw o;return eo(o,e,"R3InjectorError",this.source)}throw o}finally{Ca(s),Vd(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=be(e)))return!1;let r=Ll(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=Ll(s)),null==r)return!1;if(null!=r.imports&&!a){let u;i.push(o);try{na(r.imports,h=>{this.processInjectorType(h,t,i)&&(void 0===u&&(u=[]),u.push(h))})}finally{}if(void 0!==u)for(let h=0;hthis.processProvider(m,p,g||tr))}}this.injectorDefTypes.add(o);const l=Tc(o)||(()=>new o);this.records.set(o,ku(l,ff));const c=r.providers;if(null!=c&&!a){const u=e;na(c,h=>this.processProvider(h,u,c))}return void 0!==s&&void 0!==e.providers}processProvider(e,t,i){let r=Vc(e=be(e))?e:be(e&&e.provide);const s=function(n,e,t){return nE(n)?ku(void 0,n.useValue):ku(tE(n),ff)}(e);if(Vc(e)||!0!==e.multi)this.records.get(r);else{let o=this.records.get(r);o||(o=ku(void 0,ff,!0),o.factory=()=>Du(o.multi),this.records.set(r,o)),r=e,o.multi.push(e)}this.records.set(r,s)}hydrate(e,t){return t.value===ff&&(t.value=KT,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=be(e.providedIn);return"string"==typeof t?"any"===t||t===this.scope:this.injectorDefTypes.has(t)}}function Ry(n){const e=vn(n),t=null!==e?e.factory:Tc(n);if(null!==t)return t;if(n instanceof Ht)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=Oc(e,"?");throw new Error(`Can't resolve all parameters for ${rt(n)}: (${i.join(", ")}).`)}const t=function(n){const e=n&&(n[po]||n[js]);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 tE(n,e,t){let i;if(Vc(n)){const r=be(n);return Tc(r)||Ry(r)}if(nE(n))i=()=>be(n.useValue);else if(function(n){return!(!n||!n.useFactory)}(n))i=()=>n.useFactory(...Du(n.deps||[]));else if(function(n){return!(!n||!n.useExisting)}(n))i=()=>Oe(be(n.useExisting));else{const r=be(n&&(n.useClass||n.provide));if(!function(n){return!!n.deps}(n))return Tc(r)||Ry(r);i=()=>new r(...Du(n.deps))}return i}function ku(n,e,t=!1){return{factory:n,value:e,multi:t?[]:void 0}}function nE(n){return null!==n&&"object"==typeof n&&Np in n}function Vc(n){return"function"==typeof n}const iE=function(n,e,t){return function(n,e=null,t=null,i){const r=eE(n,e,t,i);return r._resolveInjectorDefTypes(),r}({name:t},e,n,t)};class Wn{static create(e,t){return Array.isArray(e)?iE(e,t,""):iE(e.providers,e.parent,e.name||"")}}function Gq(n,e){wp(W_(n)[1],cs())}function An(n){let e=function(n){return Object.getPrototypeOf(n.prototype).constructor}(n.type),t=!0;const i=[n];for(;e;){let r;if(Ma(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=cM(n.inputs),o.declaredInputs=cM(n.declaredInputs),o.outputs=cM(n.outputs);const a=r.hostBindings;a&&Yq(n,a);const l=r.viewQuery,c=r.contentQueries;if(l&&Wq(n,l),c&&qq(n,c),tl(n.inputs,r.inputs),tl(n.declaredInputs,r.declaredInputs),tl(n.outputs,r.outputs),Ma(r)&&r.data.animation){const u=n.data;u.animation=(u.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=Wh(r.hostAttrs,t=Wh(t,r.hostAttrs))}}(i)}function cM(n){return n===Ed?{}:n===tr?[]:n}function Wq(n,e){const t=n.viewQuery;n.viewQuery=t?(i,r)=>{e(i,r),t(i,r)}:e}function qq(n,e){const t=n.contentQueries;n.contentQueries=t?(i,r,s)=>{e(i,r,s),t(i,r,s)}:e}function Yq(n,e){const t=n.hostBindings;n.hostBindings=t?(i,r)=>{e(i,r),t(i,r)}:e}Wn.THROW_IF_NOT_FOUND=Tu,Wn.NULL=new io,Wn.\u0275prov=We({token:Wn,providedIn:"any",factory:()=>Oe(Pu)}),Wn.__NG_ELEMENT_ID__=-1;let lE=null;function sg(){if(!lE){const n=Qn.Symbol;if(n&&n.iterator)lE=n.iterator;else{const e=Object.getOwnPropertyNames(Map.prototype);for(let t=0;ta(xr(Ae[i.index])):i.index;if(gr(t)){let Ae=null;if(!a&&l&&(Ae=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!==Ae)(Ae.__ngLastListenerFn__||Ae).__ngNextListenerFn__=s,Ae.__ngLastListenerFn__=s,g=!1;else{s=mM(i,e,h,s,!1);const Pe=t.listen(H,r,s);p.push(s,Pe),u&&u.push(r,de,U,U+1)}}else s=mM(i,e,h,s,!0),H.addEventListener(r,s,o),p.push(s),u&&u.push(r,de,U,o)}else s=mM(i,e,h,s,!1);const m=i.outputs;let w;if(g&&null!==m&&(w=m[r])){const C=w.length;if(C)for(let H=0;H0;)e=e[15],n--;return e}(n,Bn.lFrame.contextLView))[8]}(n)}function MY(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 Rs={textEnd:0,key:0,keyEnd:0,value:0,valueEnd:0};function jk(n){return n.substring(Rs.key,Rs.keyEnd)}function Vk(n,e){const t=Rs.textEnd;return t===e?-1:(e=Rs.keyEnd=function(n,e,t){for(;e32;)e++;return e}(n,Rs.key=e,t),bg(n,e,t))}function bg(n,e,t){for(;e=0;t=Vk(e,t))ko(n,jk(e),!0)}function ec(n,e,t,i){const r=jt(),s=Ei(),o=No(2);s.firstUpdatePass&&Wk(s,n,o,i),e!==In&&Eo(r,o,e)&&Yk(s,s.data[Js()],r,r[11],n,r[o+1]=function(n,e){return null==n||("string"==typeof e?n+=e:"object"==typeof n&&(n=rt(Gs(n)))),n}(e,t),i,o)}function $k(n,e){return e>=n.expandoStartIndex}function Wk(n,e,t,i){const r=n.data;if(null===r[t+1]){const s=r[Js()],o=$k(n,t);Xk(s,i)&&null===e&&!o&&(e=!1),e=function(n,e,t,i){const r=f_(n);let s=i?e.residualClasses:e.residualStyles;if(null===r)0===(i?e.classBindings:e.styleBindings)&&(t=Vy(t=yM(null,n,e,t,i),e.attrs,i),s=null);else{const o=e.directiveStylingLast;if(-1===o||n[o]!==r)if(t=yM(r,n,e,t,i),null===s){let l=function(n,e,t){const i=t?e.classBindings:e.styleBindings;if(0!==Kl(i))return n[Rn(i)]}(n,e,i);void 0!==l&&Array.isArray(l)&&(l=yM(null,n,e,l[1],i),l=Vy(l,e.attrs,i),function(n,e,t,i){n[Rn(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 u=t;if(r)if(0!==l){const p=Rn(n[a+1]);n[i+1]=pl(p,a),0!==p&&(n[p+1]=gl(n[p+1],i)),n[a+1]=function(n,e){return 131071&n|e<<17}(n[a+1],i)}else n[i+1]=pl(a,0),0!==a&&(n[a+1]=gl(n[a+1],i)),a=i;else n[i+1]=pl(l,0),0===a?a=i:n[l+1]=gl(n[l+1],i),l=i;c&&(n[i+1]=Ar(n[i+1])),Bk(n,u,i,!0),Bk(n,u,i,!1),function(n,e,t,i,r){const s=r?n.residualClasses:n.residualStyles;null!=s&&"string"==typeof e&&Ds(s,e)>=0&&(t[i+1]=cy(t[i+1]))}(e,u,n,i,s),o=pl(a,l),s?e.classBindings=o:e.styleBindings=o}(r,s,e,t,o,i)}}function yM(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),u=c?l[1]:l,h=null===u;let p=t[r+1];p===In&&(p=h?tr:void 0);let g=h?M_(p,i):u===i?p:void 0;if(c&&!gE(g)&&(g=M_(l,i)),gE(g)&&(a=g,o))return a;const m=n[r+1];r=o?Rn(m):Kl(m)}if(null!==e){let l=s?e.residualClasses:e.residualStyles;null!=l&&(a=M_(l,i))}return a}function gE(n){return void 0!==n}function Xk(n,e){return 0!=(n.flags&(e?16:32))}function Oi(n,e=""){const t=jt(),i=Ei(),r=n+20,s=i.firstCreatePass?Zd(i,r,1,e,null):i.data[r],o=t[r]=function(n,e){return gr(n)?n.createText(e):n.createTextNode(e)}(t[11],e);Yp(i,t,o,s),rl(s,!1)}function da(n){return ha("",n,""),da}function ha(n,e,t){const i=jt(),r=ag(i,n,e,t);return r!==In&&Xl(i,Js(),r),ha}function Lu(n,e,t){const i=jt();return Eo(i,Oa(),e)&&Vo(Ei(),kr(),i,n,e,i[11],t,!0),Lu}function mE(n,e,t){const i=jt();if(Eo(i,Oa(),e)){const s=Ei(),o=kr();Vo(s,o,i,n,e,Ay(f_(s.data),o,i),t,!0)}return mE}const gf=void 0;var dK=["en",[["a","p"],["AM","PM"],gf],[["AM","PM"],gf,gf],[["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"]],gf,[["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"]],gf,[["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}",gf,"{1} 'at' {0}",gf],[".",",",";","%","+","-","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 vg={};function pL(n){return n in vg||(vg[n]=Qn.ng&&Qn.ng.common&&Qn.ng.common.locales&&Qn.ng.common.locales[n]),vg[n]}var cn=(()=>((cn=cn||{})[cn.LocaleId=0]="LocaleId",cn[cn.DayPeriodsFormat=1]="DayPeriodsFormat",cn[cn.DayPeriodsStandalone=2]="DayPeriodsStandalone",cn[cn.DaysFormat=3]="DaysFormat",cn[cn.DaysStandalone=4]="DaysStandalone",cn[cn.MonthsFormat=5]="MonthsFormat",cn[cn.MonthsStandalone=6]="MonthsStandalone",cn[cn.Eras=7]="Eras",cn[cn.FirstDayOfWeek=8]="FirstDayOfWeek",cn[cn.WeekendRange=9]="WeekendRange",cn[cn.DateFormat=10]="DateFormat",cn[cn.TimeFormat=11]="TimeFormat",cn[cn.DateTimeFormat=12]="DateTimeFormat",cn[cn.NumberSymbols=13]="NumberSymbols",cn[cn.NumberFormats=14]="NumberFormats",cn[cn.CurrencyCode=15]="CurrencyCode",cn[cn.CurrencySymbol=16]="CurrencySymbol",cn[cn.CurrencyName=17]="CurrencyName",cn[cn.Currencies=18]="Currencies",cn[cn.Directionality=19]="Directionality",cn[cn.PluralCase=20]="PluralCase",cn[cn.ExtraData=21]="ExtraData",cn))();const _E="en-US";let gL=_E;function vM(n){J(n,"Expected localeId to be defined"),"string"==typeof n&&(gL=n.toLowerCase().replace(/_/g,"-"))}function SM(n,e,t,i,r){if(n=be(n),Array.isArray(n))for(let s=0;s>20;if(Vc(n)||!n.multi){const g=new $h(l,r,xe),m=CM(a,e,r?u:u+p,h);-1===m?(Dc(Hs(c,o),s,a),xM(s,n,e.length),e.push(a),c.directiveStart++,c.directiveEnd++,r&&(c.providerIndexes+=1048576),t.push(g),o.push(g)):(t[m]=g,o[m]=g)}else{const g=CM(a,e,u+p,h),m=CM(a,e,u,u+p),w=g>=0&&t[g],C=m>=0&&t[m];if(r&&!C||!r&&!w){Dc(Hs(c,o),s,a);const H=function(n,e,t,i,r){const s=new $h(n,t,xe);return s.multi=[],s.index=e,s.componentProviders=0,jL(s,r,i&&!t),s}(r?lX:aX,t.length,r,i,l);!r&&C&&(t[m].providerFactory=H),xM(s,n,e.length,0),e.push(a),c.directiveStart++,c.directiveEnd++,r&&(c.providerIndexes+=1048576),t.push(H),o.push(H)}else xM(s,n,g>-1?g:m,jL(t[r?m:g],l,!r&&i));!r&&i&&C&&t[m].componentProviders++}}}function xM(n,e,t,i){const r=Vc(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 jL(n,e,t){return t&&n.componentProviders++,n.multi.push(e)-1}function CM(n,e,t,i){for(let r=t;r{t.providersResolver=(i,r)=>function(n,e,t){const i=Ei();if(i.firstCreatePass){const r=Ma(n);SM(t,i.data,i.blueprint,r,!0),SM(e,i.data,i.blueprint,r,!1)}}(i,r?r(n):n,e)}}class VL{}const zL="ngComponent";class dX{resolveComponentFactory(e){throw function(n){const e=Error(`No component factory found for ${rt(n)}. Did you add it to @NgModule.entryComponents?`);return e[zL]=n,e}(e)}}class wl{}function EE(...n){}function Eg(n,e){return new En(Zs(n,e))}wl.NULL=new dX;const pX=function(){return Eg(cs(),jt())};let En=(()=>{class n{constructor(t){this.nativeElement=t}}return n.__NG_ELEMENT_ID__=pX,n})();function HL(n){return n instanceof En?n.nativeElement:n}class mf{}let MM=(()=>{class n{}return n.\u0275prov=We({token:n,providedIn:"root",factory:()=>null}),n})();class ju{constructor(e){this.full=e,this.major=e.split(".")[0],this.minor=e.split(".")[1],this.patch=e.split(".").slice(2).join(".")}}const GL=new ju("12.2.5");class $L{constructor(){}supports(e){return Ly(e)}create(e){return new vX(e)}}const bX=(n,e)=>e;class vX{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||bX}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 wX(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 WL),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 WL),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 wX{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 EX{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 WL{constructor(){this.map=new Map}put(e){const t=e.trackById;let i=this.map.get(t);i||(i=new EX,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 qL(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 xX(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 xX{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 KL(){return new Sg([new $L])}let Sg=(()=>{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||KL()),deps:[[n,new ul,new ns]]}}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:KL}),n})();function XL(){return new xg([new YL])}let xg=(()=>{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||XL()),deps:[[n,new ul,new ns]]}}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:XL}),n})();function SE(n,e,t,i,r=!1){for(;null!==t;){const s=e[t.index];if(null!==s&&i.push(xr(s)),Zo(s))for(let a=10;a-1&&(ny(e,i),Gl(t,i))}this._attachedToViewContainer=!1}iy(this._lView[1],this._lView)}onDestroy(e){Vw(this._lView[1],this._lView,null,e)}markForCheck(){Ey(this._cdRefInjectingView||this._lView)}detach(){this._lView[2]&=-129}reattach(){this._lView[2]|=128}detectChanges(){xy(this._lView[1],this._lView,this.context)}checkNoChanges(){!function(n,e,t){yp(!0);try{xy(n,e,t)}finally{yp(!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){Xd(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 AX extends $y{constructor(e){super(e),this._view=e}detectChanges(){Xw(this._view)}checkNoChanges(){!function(n){yp(!0);try{Xw(n)}finally{yp(!1)}}(this._view)}get context(){return null}}const MX=function(n){return function(n,e,t){if(Ad(n)&&!t){const i=zs(n.index,e);return new $y(i,i)}return 47&n.type?new $y(e[16],e):null}(cs(),jt(),16==(16&n))};let Dr=(()=>{class n{}return n.__NG_ELEMENT_ID__=MX,n})();const OX=[new YL],NX=new Sg([new $L]),PX=new xg(OX),kX=function(){return xE(cs(),jt())};let zo=(()=>{class n{}return n.__NG_ELEMENT_ID__=kX,n})();const LX=zo,BX=class extends LX{constructor(e,t,i){super(),this._declarationLView=e,this._declarationTContainer=t,this.elementRef=i}createEmbeddedView(e){const t=this._declarationTContainer.tViews,i=uf(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)),df(t,i,e),new $y(i)}};function xE(n,e){return 4&n.type?new BX(e,n,Eg(n,e)):null}class $c{}const UX=function(){return e3(cs(),jt())};let Ns=(()=>{class n{}return n.__NG_ELEMENT_ID__=UX,n})();const HX=Ns,ZL=class extends HX{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 ea(this._hostTNode,this._hostLView)}get parentInjector(){const e=qh(this._hostTNode,this._hostLView);if(vv(e)){const t=ol(e,this._hostLView),i=Rd(e);return new ea(t[1].data[i+8],t)}return new ea(null,this._hostLView)}clear(){for(;this.length>0;)this.remove(this.length-1)}get(e){const t=JL(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($c,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 Zo(n[3])}(i)){const u=this.indexOf(e);if(-1!==u)this.detach(u);else{const h=i[3],p=new ZL(h,h[6],h[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),iiw});class S3 extends VL{constructor(e,t){super(),this.componentDef=e,this.ngModule=t,this.componentType=e.type,this.selector=function(n){return n.map(dT).join(",")}(e.selectors),this.ngContentSelectors=e.ngContentSelectors?e.ngContentSelectors:[],this.isBoundToModule=!!t}get inputs(){return E3(this.componentDef.inputs)}get outputs(){return E3(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,Mg,r);return s!==Mg||i===Mg?s:e.get(t,i,r)}}}(e,r.injector):e,o=s.get(mf,bu),a=s.get(MM,null),l=o.createRenderer(null,this.componentDef),c=this.componentDef.selectors[0][0]||"div",u=i?function(n,e,t){if(gr(n))return n.selectRootElement(e,t===Yt.ShadowDom);let i="string"==typeof e?n.querySelector(e):e;return i.textContent="",i}(l,i,this.componentDef.encapsulation):ty(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)),h=this.componentDef.onPush?576:528,p=function(n,e){return{components:[],scheduler:n||iw,clean:WT,playerHandler:e||null,flags:0}}(),g=tg(0,null,null,1,0,null,null,null,null,null),m=uf(null,g,p,h,null,null,o,l,a,s);let w,C;Hh(m);try{const H=function(n,e,t,i,r,s){const o=t[1];t[20]=n;const l=Zd(o,20,2,"#host",null),c=l.mergedAttrs=e.hostAttrs;null!==c&&(rg(l,c,!0),null!==n&&(xp(r,n,c),null!==l.classes&&ay(r,n,l.classes),null!==l.styles&&Ew(r,n,l.styles)));const u=i.createRenderer(n,e),h=uf(t,eg(e),null,e.onPush?64:16,t[20],l,i,u,s||null,null);return o.firstCreatePass&&(Dc(Hs(l,t),o,e.type),Yw(o,l),yy(l,t.length,1)),ng(t,h),t[20]=h}(u,this.componentDef,m,o,l);if(u)if(i)xp(l,u,["ng-version",GL.full]);else{const{attrs:U,classes:de}=function(n){const e=[],t=[];let i=1,r=2;for(;i0&&ay(l,u,de.join(" "))}if(C=c_(g,20),void 0!==t){const U=C.projection=[];for(let de=0;del(o,e)),e.contentQueries){const l=cs();e.contentQueries(1,o,l.directiveStart)}const a=cs();return!s.firstCreatePass||null===e.hostBindings&&null===e.hostAttrs||(yo(a.index),Ww(t[1],a,0,a.directiveStart,a.directiveEnd,e),qw(e,o)),o}(H,this.componentDef,m,p,[Gq]),df(g,m,null)}finally{fi()}return new zQ(this.componentType,w,Eg(C,m),m,C)}}class zQ 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 AX(r),this.componentType=e}get injector(){return new ea(this._tNode,this._rootLView)}destroy(){this.hostView.destroy()}onDestroy(e){this.hostView.onDestroy(e)}}const Dg=new Map;class $Q extends $c{constructor(e,t){super(),this._parent=t,this._bootstrapComponents=[],this.injector=this,this.destroyCbs=[],this.componentFactoryResolver=new w3(this);const i=Oo(e),r=function(n){return n[T1]||null}(e);r&&vM(r),this._bootstrapComponents=hl(i.bootstrap),this._r3Injector=eE(e,t,[{provide:$c,useValue:this},{provide:wl,useValue:this.componentFactoryResolver}],rt(e)),this._r3Injector._resolveInjectorDefTypes(),this.instance=this.get(e)}get(e,t=Wn.THROW_IF_NOT_FOUND,i=Sn.Default){return e===Wn||e===$c||e===Pu?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 zM extends class{}{constructor(e){super(),this.moduleType=e,null!==Oo(e)&&function(n){const e=new Set;!function t(i){const r=Oo(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,Dg.get(s),i),Dg.set(s,i));const o=hl(r.imports);for(const a of o)e.has(a)||(e.add(a),t(a))}(n)}(e)}create(e){return new $Q(this.moduleType,e)}}function T3(n,e,t,i,r,s){const o=e+t;return Eo(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===In?void 0:t}(n,o+1)}function xl(n,e){const t=Ei();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 Ze("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=Tc(i.type)),o=Ca(xe);try{const a=Cp(!1),l=s();return Cp(a),function(n,e,t,i){t>=n.data.length&&(n.data[t]=null,n.blueprint[t]=null),e[t]=i}(t,jt(),r,l),l}finally{Ca(o)}}function Vu(n,e,t){const i=n+20,r=jt(),s=function(n,e){return n[e]}(r,i);return function(n,e){Zl.isWrapped(e)&&(e=Zl.unwrap(e),n[Bn.lFrame.bindingIndex]=In);return e}(r,function(n,e){return n[1].data[e].pure}(r,i)?T3(r,function(){const n=Bn.lFrame;let e=n.bindingRootIndex;return-1===e&&(e=n.bindingRootIndex=n.tView.bindingStartIndex),e}(),e,s.transform,t,s):s.transform(t))}function HM(n){return e=>{setTimeout(n,void 0,e)}}const sn=class extends se{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 h=e;a=null===(r=h.next)||void 0===r?void 0:r.bind(h),l=null===(s=h.error)||void 0===s?void 0:s.bind(h),c=null===(o=h.complete)||void 0===o?void 0:o.bind(h)}this.__isAsync&&(l=HM(l),a&&(a=HM(a)),c&&(c=HM(c)));const u=super.subscribe({next:a,error:l,complete:c});return e instanceof x&&e.add(u),u}};function oZ(){return this._results[sg()]()}class bf{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=sg(),i=bf.prototype;i[t]||(i[t]=oZ)}get changes(){return this._changes||(this._changes=new sn)}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=ta(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],u=e[-l];for(let h=10;h{class n{constructor(t){this.appInits=t,this.resolve=EE,this.reject=EE,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)(Oe(vf,8))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const r0=new Ht("AppId"),zZ={provide:r0,useFactory:function(){return`${eD()}${eD()}${eD()}`},deps:[]};function eD(){return String.fromCharCode(97+Math.floor(25*Math.random()))}const eB=new Ht("Platform Initializer"),Wc=new Ht("Platform ID"),RE=new Ht("appBootstrapListener");let NE=(()=>{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 Uu=new Ht("LocaleId"),tB=new Ht("DefaultCurrencyCode");class GZ{constructor(e,t){this.ngModuleFactory=e,this.componentFactories=t}}const tD=function(n){return new zM(n)},$Z=tD,WZ=function(n){return Promise.resolve(tD(n))},nB=function(n){const e=tD(n),i=hl(Oo(n).declarations).reduce((r,s)=>{const o=Vi(s);return o&&r.push(new S3(o)),r},[]);return new GZ(e,i)},qZ=nB,YZ=function(n){return Promise.resolve(nB(n))};let wf=(()=>{class n{constructor(){this.compileModuleSync=$Z,this.compileModuleAsync=WZ,this.compileModuleAndAllComponentsSync=qZ,this.compileModuleAndAllComponentsAsync=YZ}clearCache(){}clearCacheFor(t){}getModuleId(t){}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const iB=new Ht("compilerOptions"),XZ=(()=>Promise.resolve(0))();function nD(n){"undefined"==typeof Zone?XZ.then(()=>{n&&n.apply(null,null)}):Zone.current.scheduleMicroTask("scheduleMicrotask",n)}class gn{constructor({enableLongStackTrace:e=!1,shouldCoalesceEventChangeDetection:t=!1,shouldCoalesceRunChangeDetection:i=!1}){if(this.hasPendingMacrotasks=!1,this.hasPendingMicrotasks=!1,this.isStable=!0,this.onUnstable=new sn(!1),this.onMicrotaskEmpty=new sn(!1),this.onStable=new sn(!1),this.onError=new sn(!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=Qn.requestAnimationFrame,e=Qn.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(Qn,()=>{n.fakeTopEventTask||(n.fakeTopEventTask=Zone.root.scheduleEventTask("fakeTopEventTask",()=>{n.lastRequestAnimationFrameId=-1,rD(n),n.isCheckStableRunning=!0,iD(n),n.isCheckStableRunning=!1},void 0,()=>{},()=>{})),n.fakeTopEventTask.invoke()}),rD(n))}(n)};n._inner=n._inner.fork({name:"angular",properties:{isAngularZone:!0},onInvokeTask:(t,i,r,s,o,a)=>{try{return rB(n),t.invokeTask(r,s,o,a)}finally{(n.shouldCoalesceEventChangeDetection&&"eventTask"===s.type||n.shouldCoalesceRunChangeDetection)&&e(),sB(n)}},onInvoke:(t,i,r,s,o,a,l)=>{try{return rB(n),t.invoke(r,s,o,a,l)}finally{n.shouldCoalesceRunChangeDetection&&e(),sB(n)}},onHasTask:(t,i,r,s)=>{t.hasTask(r,s),i===r&&("microTask"==s.change?(n._hasPendingMicrotasks=s.microTask,rD(n),iD(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(!gn.isInAngularZone())throw new Error("Expected to be in Angular Zone, but it is not!")}static assertNotInAngularZone(){if(gn.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,ZZ,EE,EE);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 ZZ={};function iD(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 rD(n){n.hasPendingMicrotasks=!!(n._hasPendingMicrotasks||(n.shouldCoalesceEventChangeDetection||n.shouldCoalesceRunChangeDetection)&&-1!==n.lastRequestAnimationFrameId)}function rB(n){n._nesting++,n.isStable&&(n.isStable=!1,n.onUnstable.emit(null))}function sB(n){n._nesting--,iD(n)}class tJ{constructor(){this.hasPendingMicrotasks=!1,this.hasPendingMacrotasks=!1,this.isStable=!0,this.onUnstable=new sn,this.onMicrotaskEmpty=new sn,this.onStable=new sn,this.onError=new sn}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 sD=(()=>{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:()=>{gn.assertNotInAngularZone(),nD(()=>{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())nD(()=>{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)(Oe(gn))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),oB=(()=>{class n{constructor(){this._applications=new Map,oD.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 oD.findTestabilityInTree(this,t,i)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();class nJ{addToWindow(e){}findTestabilityInTree(e,t,i){return null}}let oD=new nJ,aB=!0,lB=!1;function Ba(){return lB=!0,aB}let rc;const cB=new Ht("AllowMultipleToken");function uB(n,e,t=[]){const i=`Platform: ${e}`,r=new Ht(i);return(s=[])=>{let o=lD();if(!o||o.injector.get(cB,!1))if(n)n(t.concat(s).concat({provide:r,useValue:!0}));else{const a=t.concat(s).concat({provide:r,useValue:!0},{provide:Fu,useValue:"platform"});!function(n){if(rc&&!rc.destroyed&&!rc.injector.get(cB,!1))throw new Error("There can be only one platform. Destroy the previous one to create a new one.");rc=n.get(dB);const e=n.get(eB,null);e&&e.forEach(t=>t())}(Wn.create({providers:a,name:i}))}return function(n){const e=lD();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 lD(){return rc&&!rc.destroyed?rc:null}let dB=(()=>{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 tJ:("zone.js"===n?void 0:n)||new gn({enableLongStackTrace:Ba(),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:gn,useValue:a}];return a.run(()=>{const c=Wn.create({providers:l,parent:this.injector,name:t.moduleType.name}),u=t.create(c),h=u.injector.get(oa,null);if(!h)throw new Error("No ErrorHandler. Is platform module (BrowserModule) included?");return a.runOutsideAngular(()=>{const p=a.onError.subscribe({next:g=>{h.handleError(g)}});u.onDestroy(()=>{cD(this._modules,u),p.unsubscribe()})}),function(n,e,t){try{const i=t();return yg(i)?i.catch(r=>{throw e.runOutsideAngular(()=>n.handleError(r)),r}):i}catch(i){throw e.runOutsideAngular(()=>n.handleError(i)),i}}(h,a,()=>{const p=u.injector.get(Og);return p.runInitializers(),p.donePromise.then(()=>(vM(u.injector.get(Uu,_E)||_E),this._moduleDoBootstrap(u),u))})})}bootstrapModule(t,i=[]){const r=hB({},i);return function(n,e,t){const i=new zM(t);return Promise.resolve(i)}(0,0,t).then(s=>this.bootstrapModuleFactory(s,r))}_moduleDoBootstrap(t){const i=t.injector.get(ih);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)(Oe(Wn))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();function hB(n,e){return Array.isArray(e)?e.reduce(hB,n):Object.assign(Object.assign({},n),e)}let ih=(()=>{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 I(c=>{this._stable=this._zone.isStable&&!this._zone.hasPendingMacrotasks&&!this._zone.hasPendingMicrotasks,this._zone.runOutsideAngular(()=>{c.next(this._stable),c.complete()})}),l=new I(c=>{let u;this._zone.runOutsideAngular(()=>{u=this._zone.onStable.subscribe(()=>{gn.assertNotInAngularZone(),nD(()=>{!this._stable&&!this._zone.hasPendingMacrotasks&&!this._zone.hasPendingMicrotasks&&(this._stable=!0,c.next(!0))})})});const h=this._zone.onUnstable.subscribe(()=>{gn.assertInAngularZone(),this._stable&&(this._stable=!1,this._zone.runOutsideAngular(()=>{c.next(!1)}))});return()=>{u.unsubscribe(),h.unsubscribe()}});this.isStable=kn(a,l.pipe(Es()))}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 VL?t:this._componentFactoryResolver.resolveComponentFactory(t),this.componentTypes.push(r.componentType);const s=function(n){return n.isBoundToModule}(r)?void 0:this._injector.get($c),a=r.create(Wn.NULL,[],i||r.selector,s),l=a.location.nativeElement,c=a.injector.get(sD,null),u=c&&a.injector.get(oB);return c&&u&&u.registerApplication(l,c),a.onDestroy(()=>{this.detachView(a.hostView),cD(this.components,a),u&&u.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;cD(this._views,i),i.detachFromAppRef()}_loadComponent(t){this.attachView(t.hostView),this.tick(),this.components.push(t),this._injector.get(RE,[]).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)(Oe(gn),Oe(Wn),Oe(oa),Oe(wl),Oe(Og))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();function cD(n,e){const t=n.indexOf(e);t>-1&&n.splice(t,1)}const DJ=uB(null,"core",[{provide:Wc,useValue:"unknown"},{provide:dB,deps:[Wn]},{provide:oB,deps:[]},{provide:NE,deps:[]}]),PJ=[{provide:ih,useClass:ih,deps:[gn,Wn,oa,wl,Og]},{provide:jQ,deps:[gn],useFactory:function(n){let e=[];return n.onStable.subscribe(()=>{for(;e.length;)e.pop()()}),function(t){e.push(t)}}},{provide:Og,useClass:Og,deps:[[new ns,vf]]},{provide:wf,useClass:wf,deps:[]},zZ,{provide:Sg,useFactory:function(){return NX},deps:[]},{provide:xg,useFactory:function(){return PX},deps:[]},{provide:Uu,useFactory:function(n){return vM(n=n||"undefined"!=typeof $localize&&$localize.locale||_E),n},deps:[[new zd(Uu),new ns,new ul]]},{provide:tB,useValue:"USD"}];let kJ=(()=>{class n{constructor(t){}}return n.\u0275fac=function(t){return new(t||n)(Oe(ih))},n.\u0275mod=on({type:n}),n.\u0275inj=xt({providers:PJ}),n})(),GE=null;function qc(){return GE}const pn=new Ht("DocumentToken");let xf=(()=>{class n{historyGo(t){throw new Error("Not implemented")}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({factory:Fee,token:n,providedIn:"platform"}),n})();function Fee(){return Oe(VB)}let VB=(()=>{class n extends xf{constructor(t){super(),this._doc=t,this._init()}_init(){this.location=window.location,this._history=window.history}getBaseHrefFromDOM(){return qc().getBaseHref(this._doc)}onPopState(t){const i=qc().getGlobalEventTarget(this._doc,"window");return i.addEventListener("popstate",t,!1),()=>i.removeEventListener("popstate",t)}onHashChange(t){const i=qc().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){UB()?this._history.pushState(t,i,r):this.location.hash=r}replaceState(t,i,r){UB()?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)(Oe(pn))},n.\u0275prov=We({factory:Lee,token:n,providedIn:"platform"}),n})();function UB(){return!!window.history.pushState}function Lee(){return new VB(Oe(pn))}function xD(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}function zB(n){const e=n.match(/#|\?|$/),t=e&&e.index||n.length;return n.slice(0,t-("/"===n[t-1]?1:0))+n.slice(t)}function Hu(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:Bee,token:n,providedIn:"root"}),n})();function Bee(n){const e=Oe(pn).location;return new HB(Oe(xf),e&&e.origin||"")}const CD=new Ht("appBaseHref");let HB=(()=>{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 xD(this._baseHref,t)}path(t=!1){const i=this._platformLocation.pathname+Hu(this._platformLocation.search),r=this._platformLocation.hash;return r&&t?`${i}${r}`:i}pushState(t,i,r,s){const o=this.prepareExternalUrl(r+Hu(s));this._platformLocation.pushState(t,i,o)}replaceState(t,i,r,s){const o=this.prepareExternalUrl(r+Hu(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)(Oe(xf),Oe(CD,8))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),Pg=(()=>{class n{constructor(t,i){this._subject=new sn,this._urlChangeListeners=[],this._platformStrategy=t;const r=this._platformStrategy.getBaseHref();this._platformLocation=i,this._baseHref=zB(GB(r)),this._platformStrategy.onPopState(s=>{this._subject.emit({url:this.path(!0),pop:!0,state:s.state,type:s.type})})}path(t=!1){return this.normalize(this._platformStrategy.path(t))}getState(){return this._platformLocation.getState()}isCurrentPathEqualTo(t,i=""){return this.path()==this.normalize(t+Hu(i))}normalize(t){return n.stripTrailingSlash(function(n,e){return n&&e.startsWith(n)?e.substring(n.length):e}(this._baseHref,GB(t)))}prepareExternalUrl(t){return t&&"/"!==t[0]&&(t="/"+t),this._platformStrategy.prepareExternalUrl(t)}go(t,i="",r=null){this._platformStrategy.pushState(r,"",t,i),this._notifyUrlChangeListeners(this.prepareExternalUrl(t+Hu(i)),r)}replaceState(t,i="",r=null){this._platformStrategy.replaceState(r,"",t,i),this._notifyUrlChangeListeners(this.prepareExternalUrl(t+Hu(i)),r)}forward(){this._platformStrategy.forward()}back(){this._platformStrategy.back()}historyGo(t=0){var i,r;null===(r=(i=this._platformStrategy).historyGo)||void 0===r||r.call(i,t)}onUrlChange(t){this._urlChangeListeners.push(t),this._urlChangeSubscription||(this._urlChangeSubscription=this.subscribe(i=>{this._notifyUrlChangeListeners(i.url,i.state)}))}_notifyUrlChangeListeners(t="",i){this._urlChangeListeners.forEach(r=>r(t,i))}subscribe(t,i,r){return this._subject.subscribe({next:t,error:i,complete:r})}}return n.\u0275fac=function(t){return new(t||n)(Oe(Cf),Oe(xf))},n.normalizeQueryParams=Hu,n.joinWithSlash=xD,n.stripTrailingSlash=zB,n.\u0275prov=We({factory:Vee,token:n,providedIn:"root"}),n})();function Vee(){return new Pg(Oe(Cf),Oe(xf))}function GB(n){return n.replace(/\/index.html$/,"")}var _s=(()=>((_s=_s||{})[_s.Zero=0]="Zero",_s[_s.One=1]="One",_s[_s.Two=2]="Two",_s[_s.Few=3]="Few",_s[_s.Many=4]="Many",_s[_s.Other=5]="Other",_s))();const Yee=function(n){return function(n){const e=function(n){return n.toLowerCase().replace(/_/g,"-")}(n);let t=pL(e);if(t)return t;const i=e.split("-")[0];if(t=pL(i),t)return t;if("en"===i)return dK;throw new Error(`Missing locale data for the locale "${n}".`)}(n)[cn.PluralCase]};class eS{}let Ste=(()=>{class n extends eS{constructor(t){super(),this.locale=t}getPluralCategory(t,i){switch(Yee(i||this.locale)(t)){case _s.Zero:return"zero";case _s.One:return"one";case _s.Two:return"two";case _s.Few:return"few";case _s.Many:return"many";default:return"other"}}}return n.\u0275fac=function(t){return new(t||n)(Oe(Uu))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();class Cte{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 Af=(()=>{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 Cte(null,this._ngForOf,-1,-1),null===o?void 0:o),l=new ej(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 ej(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)(xe(Ns),xe(zo),xe(Sg))},n.\u0275dir=Rt({type:n,selectors:[["","ngFor","","ngForOf",""]],inputs:{ngForOf:"ngForOf",ngForTrackBy:"ngForTrackBy",ngForTemplate:"ngForTemplate"}}),n})();class ej{constructor(e,t){this.record=e,this.view=t}}let lc=(()=>{class n{constructor(t,i){this._viewContainer=t,this._context=new Tte,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){tj("ngIfThen",t),this._thenTemplateRef=t,this._thenViewRef=null,this._updateView()}set ngIfElse(t){tj("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)(xe(Ns),xe(zo))},n.\u0275dir=Rt({type:n,selectors:[["","ngIf",""]],inputs:{ngIf:"ngIf",ngIfThen:"ngIfThen",ngIfElse:"ngIfElse"}}),n})();class Tte{constructor(){this.$implicit=null,this.ngIf=null}}function tj(n,e){if(e&&!e.createEmbeddedView)throw new Error(`${n} must be a TemplateRef, but received '${rt(e)}'.`)}class Ote{createSubscription(e,t){return e.subscribe({next:t,error:i=>{throw i}})}dispose(e){e.unsubscribe()}onDestroy(e){e.unsubscribe()}}class Rte{createSubscription(e,t){return e.then(t,i=>{throw i})}dispose(e){}onDestroy(e){}}const Nte=new Rte,Pte=new Ote;let h0=(()=>{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(yg(t))return Nte;if(Tk(t))return Pte;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)(xe(Dr,16))},n.\u0275pipe=Vs({name:"async",type:n,pure:!1}),n})(),qr=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=on({type:n}),n.\u0275inj=xt({providers:[{provide:eS,useClass:Ste}]}),n})();const lj="browser";function Tf(n){return n===lj}class BD extends class extends class{}{constructor(){super(...arguments),this.supportsDOMEvents=!0}}{static makeCurrent(){!function(n){GE||(GE=n)}(new BD)}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=(f0=f0||document.querySelector("base"),f0?f0.getAttribute("href"):null);return null==t?null:function(n){nS=nS||document.createElement("a"),nS.setAttribute("href",n);const e=nS.pathname;return"/"===e.charAt(0)?e:`/${e}`}(t)}resetBaseElement(){f0=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 nS,f0=null;const hj=new Ht("TRANSITION_ID"),rne=[{provide:vf,useFactory:function(n,e,t){return()=>{t.get(Og).donePromise.then(()=>{const i=qc(),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},Qn.getAllAngularTestabilities=()=>e.getAllTestabilities(),Qn.getAllAngularRootElements=()=>e.getAllRootElements(),Qn.frameworkStabilizers||(Qn.frameworkStabilizers=[]),Qn.frameworkStabilizers.push(i=>{const r=Qn.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?qc().isShadowRoot(t)?this.findTestabilityInTree(e,t.host,!0):this.findTestabilityInTree(e,t.parentElement,!0):null}}let sne=(()=>{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 p0=new Ht("EventManagerPlugins");let rS=(()=>{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})(),g0=(()=>{class n extends pj{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(gj),this._hostNodes.delete(t)}onStylesAdded(t){this._hostNodes.forEach((i,r)=>{this._addStylesToHost(t,r,i)})}ngOnDestroy(){this._hostNodes.forEach(t=>t.forEach(gj))}}return n.\u0275fac=function(t){return new(t||n)(Oe(pn))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();function gj(n){qc().remove(n)}const UD={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/"},zD=/%COMP%/g;function sS(n,e,t){for(let i=0;i{if("__ngUnwrap__"===e)return n;!1===n(e)&&(e.preventDefault(),e.returnValue=!1)}}let oS=(()=>{class n{constructor(t,i,r){this.eventManager=t,this.sharedStylesHost=i,this.appId=r,this.rendererByCompId=new Map,this.defaultRenderer=new HD(t)}createRenderer(t,i){if(!t||!i)return this.defaultRenderer;switch(i.encapsulation){case Yt.Emulated:{let r=this.rendererByCompId.get(i.id);return r||(r=new vne(this.eventManager,this.sharedStylesHost,i,this.appId),this.rendererByCompId.set(i.id,r)),r.applyToHost(t),r}case 1:case Yt.ShadowDom:return new wne(this.eventManager,this.sharedStylesHost,t,i);default:if(!this.rendererByCompId.has(i.id)){const r=sS(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)(Oe(rS),Oe(g0),Oe(r0))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();class HD{constructor(e){this.eventManager=e,this.data=Object.create(null)}destroy(){}createElement(e,t){return t?document.createElementNS(UD[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=UD[r];s?e.setAttributeNS(s,t,i):e.setAttribute(t,i)}else e.setAttribute(t,i)}removeAttribute(e,t,i){if(i){const r=UD[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&(jo.DashCase|jo.Important)?e.style.setProperty(t,i,r&jo.Important?"important":""):e.style[t]=i}removeStyle(e,t,i){i&jo.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,yj(i)):this.eventManager.addEventListener(e,t,yj(i))}}class vne extends HD{constructor(e,t,i,r){super(e),this.component=i;const s=sS(r+"-"+i.id,i.styles,[]);t.addStyles(s),this.contentAttr=function(n){return"_ngcontent-%COMP%".replace(zD,n)}(r+"-"+i.id),this.hostAttr=function(n){return"_nghost-%COMP%".replace(zD,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 wne extends HD{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=sS(r.id,r.styles,[]);for(let o=0;o{class n extends VD{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)(Oe(pn))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const wj=["alt","control","meta","shift"],Dne={"\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"},Ej={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"},Ine={alt:n=>n.altKey,control:n=>n.ctrlKey,meta:n=>n.metaKey,shift:n=>n.shiftKey};let One=(()=>{class n extends VD{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(()=>qc().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(wj.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&&Ej.hasOwnProperty(e)&&(e=Ej[e]))}return Dne[e]||e}(t);return r=r.toLowerCase()," "===r?r="space":"."===r&&(r="dot"),wj.forEach(s=>{s!=r&&Ine[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)(Oe(pn))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),Mf=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({factory:function(){return Oe($D)},token:n,providedIn:"root"}),n})(),$D=(()=>{class n extends Mf{constructor(t){super(),this._doc=t}sanitize(t,i){if(null==i)return null;switch(t){case ni.NONE:return i;case ni.HTML:return ia(i,"HTML")?Gs(i):z_(this._doc,String(i)).toString();case ni.STYLE:return ia(i,"Style")?Gs(i):i;case ni.SCRIPT:if(ia(i,"Script"))return Gs(i);throw new Error("unsafe value used in a script context");case ni.URL:return Lc(i),ia(i,"URL")?Gs(i):Bo(String(i));case ni.RESOURCE_URL:if(ia(i,"ResourceURL"))return Gs(i);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(n){return new P_(n)}(t)}bypassSecurityTrustStyle(t){return function(n){return new F_(n)}(t)}bypassSecurityTrustScript(t){return function(n){return new Vp(n)}(t)}bypassSecurityTrustUrl(t){return function(n){return new $d(n)}(t)}bypassSecurityTrustResourceUrl(t){return function(n){return new Fn(n)}(t)}}return n.\u0275fac=function(t){return new(t||n)(Oe(pn))},n.\u0275prov=We({factory:function(){return function(n){return new $D(n.get(pn))}(Oe(Pu))},token:n,providedIn:"root"}),n})();const jne=uB(DJ,"browser",[{provide:Wc,useValue:lj},{provide:eB,useValue:function(){BD.makeCurrent(),jD.init()},multi:!0},{provide:pn,useFactory:function(){return function(n){Ki=n}(document),document},deps:[]}]),Vne=[[],{provide:Fu,useValue:"root"},{provide:oa,useFactory:function(){return new oa},deps:[]},{provide:p0,useClass:Ene,multi:!0,deps:[pn,gn,Wc]},{provide:p0,useClass:One,multi:!0,deps:[pn]},[],{provide:oS,useClass:oS,deps:[rS,g0,r0]},{provide:mf,useExisting:oS},{provide:pj,useExisting:g0},{provide:g0,useClass:g0,deps:[pn]},{provide:sD,useClass:sD,deps:[gn]},{provide:rS,useClass:rS,deps:[p0,gn]},{provide:class{},useClass:sne,deps:[]},[]];let WD=(()=>{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:r0,useValue:t.appId},{provide:hj,useExisting:r0},rne]}}}return n.\u0275fac=function(t){return new(t||n)(Oe(n,12))},n.\u0275mod=on({type:n}),n.\u0275inj=xt({providers:Vne,imports:[qr,kJ]}),n})();"undefined"!=typeof window&&window;class Yne extends x{constructor(e,t){super()}schedule(e,t=0){return this}}class aS extends Yne{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 xj=(()=>{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 uc extends xj{constructor(e,t=xj.now){super(e,()=>uc.delegate&&uc.delegate!==this?uc.delegate.now():t()),this.actions=[],this.active=!1,this.scheduled=void 0}schedule(e,t=0,i){return uc.delegate&&uc.delegate!==this?uc.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 Qne=new class extends uc{}(class extends aS{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)}}),Yc=new I(n=>n.complete());function lS(n){return n?function(n){return new I(e=>n.schedule(()=>e.complete()))}(n):Yc}function fn(...n){let e=n[n.length-1];return Ce(e)?(n.pop(),Ne(n,e)):On(n)}function Fg(n,e){return new I(e?t=>e.schedule(Jne,0,{error:n,subscriber:t}):t=>t.error(n))}function Jne({error:n,subscriber:e}){e.error(n)}class pa{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 fn(this.value);case"E":return Fg(this.error);case"C":return lS()}throw new Error("unexpected notification kind value")}static createNext(e){return void 0!==e?new pa("N",e):pa.undefinedValueNotification}static createError(e){return new pa("E",void 0,e)}static createComplete(){return pa.completeNotification}}pa.completeNotification=new pa("C"),pa.undefinedValueNotification=new pa("N",void 0);class cS 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(cS.dispatch,this.delay,new tie(e,this.destination)))}_next(e){this.scheduleMessage(pa.createNext(e))}_error(e){this.scheduleMessage(pa.createError(e)),this.unsubscribe()}_complete(){this.scheduleMessage(pa.createComplete()),this.unsubscribe()}}class tie{constructor(e,t){this.notification=e,this.destination=t}}class kg extends se{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 nie(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 $;if(this.isStopped||this.hasError?o=x.EMPTY:(this.observers.push(e),o=new Z(this,e)),r&&e.add(e=new cS(e,r)),t)for(let a=0;at&&(o=Math.max(o,s-t)),o>0&&r.splice(0,o),r}}class nie{constructor(e,t){this.time=e,this.value=t}}function Ir(n,e){return"function"==typeof e?t=>t.pipe(Ir((i,r)=>je(n(i,r)).pipe(me((s,o)=>e(i,s,r,o))))):t=>t.lift(new iie(n))}class iie{constructor(e){this.project=e}call(e,t){return t.subscribe(new rie(e,this.project))}}class rie extends ve{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 _t(this),r=this.destination;r.add(i),this.innerSubscription=N(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 uS={schedule(n,e){const t=setTimeout(n,e);return()=>clearTimeout(t)},scheduleBeforeRender(n){if("undefined"==typeof window)return uS.schedule(n,0);if(void 0===window.requestAnimationFrame)return uS.schedule(n,16);const e=window.requestAnimationFrame(n);return()=>window.cancelAnimationFrame(e)}};let YD;function pie(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(!YD){const t=Element.prototype;YD=t.matches||t.matchesSelector||t.mozMatchesSelector||t.msMatchesSelector||t.oMatchesSelector||t.webkitMatchesSelector}return n.nodeType===Node.ELEMENT_NODE&&YD.call(n,e)}(n,r)||(i=s,0))),i}class mie{constructor(e,t){this.componentFactory=t.get(wl).resolveComponentFactory(e)}create(e){return new _ie(this.componentFactory,e)}}class _ie{constructor(e,t){this.componentFactory=e,this.injector=t,this.eventEmitters=new kg(1),this.events=this.eventEmitters.pipe(Ir(i=>kn(...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(gn),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=uS.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=Wn.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=uS.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 o_(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 yie extends HTMLElement{constructor(){super(...arguments),this.ngElementEventsSubscription=null}}const vie={initialConfig:{},parse:{},rename:{}};class wie{constructor(e,t){this.configState=e,this.storedChanges={},this.options=Object.assign(Object.assign({},vie),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,u=null!==(s=o[e])&&void 0!==s?s:o[l];if(null==c)delete i[l];else if(u)try{i[l]=u(c)}catch(h){console.warn(`Failed to parse ${e} = ${c}`,h.message)}else i[l]=c}}let Eie=(()=>{class n{constructor(t,i,r={}){this.configState=t,this.cdr=i,this.options=r,this.initialized=!1,this.configManager=new wie(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=Rt({type:n,features:[Ui]}),n})();var KD;const m0={production:!0,disableDbWorker:!0,acceptableViewerDomains:["https://portal.hubmapconsortium.org","https://portal.test.hubmapconsortium.org"],dbOptions:{ccfOwlUrl:"https://ccf-api.hubmapconsortium.org/v1/ccf.owl.n3store.json",ccfContextUrl:"https://hubmapconsortium.github.io/ccf-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/v3/entities/search",hubmapAssetsUrl:"https://assets.hubmapconsortium.org",hubmapToken:null!==(KD=localStorage.getItem("HUBMAP_TOKEN"))&&void 0!==KD?KD:""},googleAnalyticsToken:"portal.hubmapconsortium.org"===window.location.hostname?"G-1WRJHN9FM6":"G-J9HWV9QPJ4"};function rr(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 Aj(n,e){return function(t,i){e(t,i,n)}}function dc(n,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(n,e)}function Fi(n,e,t,i){return new(t||(t=Promise))(function(s,o){function a(u){try{c(i.next(u))}catch(h){o(h)}}function l(u){try{c(i.throw(u))}catch(h){o(h)}}function c(u){u.done?s(u.value):function(s){return s instanceof t?s:new t(function(o){o(s)})}(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})}function Dj(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 QD(){return!("object"==typeof process&&"[object process]"===String(process)&&!process.browser)||Dj()}const Ij="undefined"!=typeof __VERSION__?__VERSION__:"untranspiled source",hS=QD();class Aie{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 ZD(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 Oj={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 Rj(n){return"string"==typeof n?Oj[n.toUpperCase()]||Oj.WHITE:n}function fS(n,e){if(!n)throw new Error(e||"Assertion failed")}const hc={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},_0=hc.window||hc.self||hc.global,Nj=hc.process||{};function Lg(){let n;if(hS&&_0.performance)n=_0.performance.now();else if(Nj.hrtime){const e=Nj.hrtime();n=1e3*e[0]+e[1]/1e6}else n=Date.now();return n}console;const Bg={debug:hS&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},Nie={enabled:!0,level:0};function Tl(){}const Pj={},Fj={once:!0};function Pie(n){for(const e in n)for(const t in n[e])return t||"untitled";return"empty"}let JD=(()=>{class n{constructor({id:t}={id:""}){this.id=t,this.VERSION=Ij,this._startTs=Lg(),this._deltaTs=Lg(),this.LOG_THROTTLE_TIMEOUT=0,this._storage=new Aie("__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((Lg()-this._startTs).toPrecision(10))}getDelta(){return Number((Lg()-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){fS(t,i)}warn(t){return this._getLogFunction(0,t,Bg.warn,arguments,Fj)}error(t){return this._getLogFunction(0,t,Bg.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,Bg.log,arguments,{time:!0,once:!0})}log(t,i){return this._getLogFunction(t,i,Bg.debug,arguments)}info(t,i){return this._getLogFunction(t,i,console.info,arguments)}once(t,i){return this._getLogFunction(t,i,Bg.debug||Bg.info,arguments,Fj)}table(t,i,r){return i?this._getLogFunction(t,i,console.table||Tl,r&&[r],{tag:Pie(i)}):Tl}image({logLevel:t,priority:i,image:r,message:s="",scale:o=1}){return this._shouldLog(t||i)?hS?function({image:n,message:e="",scale:t=1}){if("string"==typeof n){const r=new Image;return r.onload=()=>{const s=ZD(r,e,t);console.log(...s)},r.src=n,Tl}const i=n.nodeName||"";if("img"===i.toLowerCase())return console.log(...ZD(n,e,t)),Tl;if("canvas"===i.toLowerCase()){const r=new Image;return r.onload=()=>console.log(...ZD(r,e,t)),r.src=n.toDataURL(),Tl}return Tl}({image:r,message:s,scale:o}):function({image:n,message:e="",scale:t=1}){let i=null;try{i=Je(307)}catch(r){}return i?()=>i(n,{fit:"box",width:"".concat(Math.round(80*t),"%")}).then(r=>console.log(r)):Tl}({image:r,message:s,scale:o}):Tl}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||Tl)}group(t,i,r={collapsed:!1}){r=Lj({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||Tl)}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()>=kj(t)}_getLogFunction(t,i,r,s=[],o){if(this._shouldLog(t)){o=Lj({logLevel:t,message:i,args:s,opts:o}),fS(r=r||o.method),o.total=this.getTotal(),o.delta=this.getDelta(),this._deltaTs=Lg();const a=o.tag||o.message;if(o.once){if(Pj[a])return Tl;Pj[a]=Lg()}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!hS&&"string"==typeof n&&(e&&(e=Rj(e),n="\x1b[".concat(e,"m").concat(n,"\x1b[39m")),t&&(e=Rj(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 Tl}}return n.VERSION=Ij,n})();function kj(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 fS(Number.isFinite(e)&&e>=0),e}function Lj(n){const{logLevel:e,message:t}=n;n.logLevel=kj(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 fS("string"===r||"object"===r),Object.assign(n,n.opts)}const Ri=new JD({id:"deck"}),ji={DEFAULT:-1,LNGLAT:1,METER_OFFSETS:2,LNGLAT_OFFSETS:3,CARTESIAN:0};Object.defineProperty(ji,"IDENTITY",{get:()=>Ri.deprecated("COORDINATE_SYSTEM.IDENTITY","COORDINATE_SYSTEM.CARTESIAN")()||0});const Kc={WEB_MERCATOR:1,GLOBE:2,WEB_MERCATOR_AUTO_OFFSET:4,IDENTITY:0},Bj={click:{handler:"onClick"},panstart:{handler:"onDragStart"},panmove:{handler:"onDrag"},panend:{handler:"onDragEnd"}},mn=new JD({id:"luma.gl"});function $o(n,e){if(!n)throw new Error(e||"luma.gl: assertion failed.")}function pS(n){return"undefined"!=typeof WebGLRenderingContext&&n instanceof WebGLRenderingContext||"undefined"!=typeof WebGL2RenderingContext&&n instanceof WebGL2RenderingContext||Boolean(n&&Number.isFinite(n._version))}function Si(n){return"undefined"!=typeof WebGL2RenderingContext&&n instanceof WebGL2RenderingContext||Boolean(n&&2===n._version)}function gS(n){return $o(pS(n),"Invalid WebGLRenderingContext"),n}function Co(n){return $o(Si(n),"Requires WebGL2"),n}const y0={};const b0=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{globalThis.console&&globalThis.console.log&&globalThis.console.log("OESVertexArrayObject emulation library context restored"),t.reset_()},!0),this.reset_()};Df.prototype.VERTEX_ARRAY_BINDING_OES=34229,Df.prototype.reset_=function(){if(void 0!==this.vertexArrayObjects)for(let i=0;iSi(n)?void 0:0,tre={3074:n=>Si(n)?void 0:36064,35723:n=>Si(n)?void 0:4352,35977:br,32937:br,36795:(n,e)=>{const t=Si(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(Uj);return e(t&&t.UNMASKED_VENDOR_WEBGL||7936)},37446:(n,e)=>{const t=n.getExtension(Uj);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:br,35071:br,37447:br,36063:(n,e)=>{if(!Si(n)){const t=n.getExtension(Vj);return t?e(t.MAX_COLOR_ATTACHMENTS_WEBGL):0}},35379:br,35374:br,35377:br,34852:n=>{if(!Si(n)){const e=n.getExtension(Vj);return e?e.MAX_DRAW_BUFFERS_WEBGL:0}},36203:n=>n.getExtension(jj)?2147483647:65535,33001:n=>n.getExtension(jj)?16777216:65535,33e3:n=>16777216,37157:br,35373:br,35657:br,36183:br,37137:br,34045:br,35978:br,35979:br,35968:br,35376:br,35375:br,35659:br,37154:br,35371:br,35658:br,35076:br,35077:br,35380:br},zj="ANGLE_instanced_arrays",Hj={OES_vertex_array_object:{meta:{suffix:"OES"},createVertexArray:()=>{$o(!1,"VertexArray requires WebGL2 or OES_vertex_array_object extension")},deleteVertexArray:()=>{},bindVertexArray:()=>{},isVertexArray:()=>!1},[zj]:{meta:{suffix:"ANGLE"},vertexAttribDivisor(n,e){$o(0===e,"WebGL instanced rendering not supported")},drawElementsInstanced:()=>{},drawArraysInstanced:()=>{}},WEBGL_draw_buffers:{meta:{suffix:"WEBGL"},drawBuffers:()=>{$o(!1)}},EXT_disjoint_timer_query:{meta:{suffix:"EXT"},createQuery:()=>{$o(!1)},deleteQuery:()=>{$o(!1)},beginQuery:()=>{$o(!1)},endQuery:()=>{},getQuery(n,e){return this.getQueryObject(n,e)},getQueryParameter(n,e){return this.getQueryObject(n,e)},getQueryObject:()=>{}}},eI={readBuffer:(n,e,t)=>{Si(n)&&e(t)},getVertexAttrib:(n,e,t,i)=>{const{webgl2:r,ext:s}=function(n,e){return{webgl2:Si(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(!Si(n))switch(i){case 35967:return 35981;case 35971:case 35382:return 0}return e(t,i)},getInternalformatParameter:(n,e,t,i,r)=>{if(!Si(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=tre[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 fre(n,{extension:e,target:t,target2:i}){const r=Hj[e];$o(r);const{meta:s={}}=r,{suffix:o=""}=s,a=n.getExtension(e);for(const l of Object.keys(r)){const c=`${l}${o}`;let u=null;"meta"===l||"function"==typeof n[l]||(a&&"function"==typeof a[c]?u=(...h)=>a[c](...h):"function"==typeof r[l]&&(u=r[l].bind(t))),u&&(t[l]=u,i[l]=u)}}globalThis.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 Df(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&&fre(n,{extension:t,target:n.luma,target2:n})}(n,Hj),function(n,{target:e,target2:t}){Object.keys(eI).forEach(i=>{if("function"==typeof eI[i]){const r=n[i]?n[i].bind(n):()=>{},s=eI[i].bind(null,n,r);e[i]=s,t[i]=s}})}(n,{target:e,target2:n}),e.polyfilled=!0),n};const tI={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},oh=(n,e,t)=>e?n.enable(t):n.disable(t),Gj=(n,e,t)=>n.hint(t,e),ja=(n,e,t)=>n.pixelStorei(t,e);function v0(n){return Array.isArray(n)||ArrayBuffer.isView(n)}const mre={3042:oh,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:oh,2885:(n,e)=>n.cullFace(e),2929:oh,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:oh,35723:Gj,36006:(n,e)=>{const t=Si(n)?36009:36160;return n.bindFramebuffer(t,e)},2886:(n,e)=>n.frontFace(e),33170:Gj,2849:(n,e)=>n.lineWidth(e),32823:oh,32824:"polygonOffset",10752:"polygonOffset",35977:oh,32938:"sampleCoverage",32939:"sampleCoverage",3089:oh,3088:(n,e)=>n.scissor(...e),2960:oh,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:ja,3317:ja,37440:ja,37441:ja,37443:ja,3330:ja,3332:ja,3331:ja,36010:(n,e)=>n.bindFramebuffer(36008,e),3314:ja,32878:ja,3316:ja,3315:ja,32877:ja,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=v0(e)?e:[e,e],n.blendEquationSeparate(...e)},blendFunc:(n,e)=>{e=v0(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=v0(e)?e:[e,e];const[t,i]=e;n.stencilMaskSeparate(1028,t),n.stencilMaskSeparate(1029,i)},stencilFunc:(n,e)=>{e=v0(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=v0(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 os(n,e,t){return void 0!==e[n]?e[n]:t[n]}const _re={blendEquation:(n,e,t)=>n.blendEquationSeparate(os(32777,e,t),os(34877,e,t)),blendFunc:(n,e,t)=>n.blendFuncSeparate(os(32969,e,t),os(32968,e,t),os(32971,e,t),os(32970,e,t)),polygonOffset:(n,e,t)=>n.polygonOffset(os(32824,e,t),os(10752,e,t)),sampleCoverage:(n,e,t)=>n.sampleCoverage(os(32938,e,t),os(32939,e,t)),stencilFuncFront:(n,e,t)=>n.stencilFuncSeparate(1028,os(2962,e,t),os(2967,e,t),os(2963,e,t)),stencilFuncBack:(n,e,t)=>n.stencilFuncSeparate(1029,os(34816,e,t),os(36003,e,t),os(36004,e,t)),stencilOpFront:(n,e,t)=>n.stencilOpSeparate(1028,os(2964,e,t),os(2965,e,t),os(2966,e,t)),stencilOpBack:(n,e,t)=>n.stencilOpSeparate(1029,os(34817,e,t),os(34818,e,t),os(34819,e,t))},$j={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]})},Xc=(n,e)=>n.isEnabled(e),Wj={3042:Xc,2884:Xc,2929:Xc,3024:Xc,32823:Xc,32926:Xc,32928:Xc,3089:Xc,2960:Xc,35977:Xc};function qj(n){for(const e in n)return!1;return!0}function yre(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||tI)){const r=e,s=Wj[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=Wj[r];i[r]=s?s(n,Number(r)):n.getParameter(Number(r))}return i}(e):Object.assign({},tI),this.log=i,this._updateCache=this._updateCache.bind(this),Object.seal(this)}push(e={}){this.stateStack.push({})}pop(){$o(this.stateStack.length>0),$u(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){$o(void 0!==s);const o=e[s],a=this.cache[s];yre(o,a)||(t=!0,i=a,r&&!(s in r)&&(r[s]=a),this.cache[s]=o)}return{valueChanged:t,oldValue:i}}}function Kj(n,e={}){const{enable:t=!0,copyState:i}=e;if($o(void 0!==i),!n.state){const{polyfillContext:r}=globalThis;r&&r(n),n.state=new wre(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 s in $j)bre(n,s,$j[s]);Yj(n,"getParameter"),Yj(n,"isEnabled")}return n.state.enable=t,n}function Xj(n){$o(n.state),n.state.pop()}function $u(n,e){if($o(pS(n),"setParameters requires a WebGL context"),qj(e))return;const t={};for(const r in e){const s=Number(r),o=mre[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)_re[r](n,e,i)}function fc(n,e,t){if(qj(e))return t(n);const{nocatch:i=!0}=e;let r;if(function(n){n.state||Kj(n,{copyState:!1}),n.state.push()}(n),$u(n,e),i)r=t(n),Xj(n);else try{r=t(n)}finally{Xj(n)}return r}function mS(){return!("object"==typeof process&&"[object process]"===String(process)&&!process.browser)||function(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;return!!(e&&e.indexOf("Electron")>=0)}()}function jg(n){const{luma:e}=n;if(n.canvas&&e){const{clientWidth:t}=e.canvasSizeInfo;return t?n.drawingBufferWidth/t:1}return 1}function nI(n,e,t=!0){return function(n,e,t,i,r){const s=Qj(n[0],e,t);let o=Zj(n[1],e,i,r),a=Qj(n[0]+1,e,t);const l=a===t-1?a:a-1;let c;return a=Zj(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,jg(n),n.drawingBufferWidth,n.drawingBufferHeight,t)}function Qj(n,e,t){return Math.min(Math.round(n*e),t-1)}function Zj(n,e,t,i){return i?Math.max(0,t-1-Math.round(n*e)):Math.min(Math.round(n*e),t-1)}const iI=mS(),Mre=iI&&"undefined"!=typeof document,Jj={webgl2:!0,webgl1:!0,throwOnError:!0,manageState:!0,canvas:null,debug:!1,width:800,height:600};function eV(n={}){$o(iI,"createGLContext only available in the browser.\nCreate your own headless context or use 'createHeadlessContext' from @luma.gl/test-utils"),n=Object.assign({},Jj,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?(Mre&&"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=rI(r,n),function(n){const e=Si(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);mn.info(1,`${e}${n.debug?" debug":""} context ${t?`(${t.vendor},${t.renderer})`:""}`)()}(r),r):null}function rI(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({},Jj,e);const{manageState:t,debug:i}=e;return t&&Kj(n,{copyState:!1,log:(...r)=>mn.log(1,...r)()}),iI&&i&&(globalThis.makeDebugContext?(n=globalThis.makeDebugContext(n,e),mn.level=Math.max(mn.level,1)):mn.warn('WebGL debug mode not activated. import "@luma.gl/debug" to enable.')()),n._instrumented=!0,n}function tV(){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 nV{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=tV(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(tV()-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 sI{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 nV?e:new nV(t,i)),this.stats[t]}}const w0="8.5.12",If=new class{constructor(){this.stats=new Map}get(e){return this.stats.has(e)||this.stats.set(e,new sI({id:e})),this.stats.get(e)}};if(globalThis.luma&&globalThis.luma.VERSION!==w0)throw new Error(`luma.gl - multiple VERSIONs detected: ${globalThis.luma.VERSION} vs ${w0}`);function tn(n,e){if(!n)throw new Error(e||"luma.gl: assertion failed.")}function oI(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 ah(n,e){e=Number(e);for(const t in n)if(n[t]===e)return`GL.${t}`;return String(e)}globalThis.luma||(mS()&&mn.log(1,`luma.gl ${w0} - set luma.log.level=1 (or higher) to trace rendering`)(),globalThis.luma=globalThis.luma||{VERSION:w0,version:w0,log:mn,stats:If,globals:{modules:{},nodeIO:{}}}),globalThis;const aI={};function ga(n="id"){return aI[n]=aI[n]||1,`${n}-${aI[n]++}`}function iV(n){return tn("number"==typeof n,"Input must be a number"),n&&0==(n&n-1)}function Vg(n){let e=!0;for(const t in n){e=!1;break}return e}function rV(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 mn.removed(`Calling removed method ${e}.${o}: `,r)(),new Error(o)})})}const Ug="Resource subclass must define virtual methods";class Wu{get[Symbol.toStringTag](){return"Resource"}constructor(e,t={}){gS(e);const{id:i,userData:r={}}=t;this.gl=e,this.gl2=e,this.id=i||ga(this[Symbol.toStringTag]),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[Symbol.toStringTag]||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=oI(this.gl,e));const r=(this.constructor.PARAMETERS||{})[e];if(r){const s=Si(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=Si(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 h=i?ah(this.gl,l):l;o[h]=this.getParameter(l,e),i&&"GLenum"===c.type&&(o[h]=ah(this.gl,o[h]))}}return o}setParameter(e,t){tn(e=oI(this.gl,e));const r=(this.constructor.PARAMETERS||{})[e];if(r){const s=Si(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=oI(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 rV(this,e,t,i)}initialize(e){}_createHandle(){throw new Error(Ug)}_deleteHandle(){throw new Error(Ug)}_bindHandle(e){throw new Error(Ug)}_getOptsFromHandle(){throw new Error(Ug)}_getParameter(e,t){throw new Error(Ug)}_setParameter(e,t){throw new Error(Ug)}_context(){return this.gl.luma=this.gl.luma||{},this.gl.luma}_addStats(){const e=this[Symbol.toStringTag],t=If.get("Resource Counts");t.get("Resources Created").incrementCount(),t.get(`${e}s Created`).incrementCount(),t.get(`${e}s Active`).incrementCount()}_removeStats(){const e=this[Symbol.toStringTag];If.get("Resource Counts").get(`${e}s Active`).decrementCount()}_trackAllocatedMemory(e,t=this[Symbol.toStringTag]){const i=If.get("Memory Usage");i.get("GPU Memory").addCount(e),i.get(`${t} Memory`).addCount(e),this.byteLength=e}_trackDeallocatedMemory(e=this[Symbol.toStringTag]){const t=If.get("Memory Usage");t.get("GPU Memory").subtractCount(this.byteLength),t.get(`${e} Memory`).subtractCount(this.byteLength),this.byteLength=0}}function lI(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 E0(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 Vre({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 ma.getBytesPerElement(this)}get BYTES_PER_VERTEX(){return ma.getBytesPerVertex(this)}_assign(e={}){return void 0!==(e=cI("Accessor",e,zre)).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 oV={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:oV},Gre={removedProps:oV};class hr extends Wu{get[Symbol.toStringTag](){return"Buffer"}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/ma.getBytesPerElement(e))}getVertexCount(e=this.accessor){return Math.round(this.byteLength/ma.getBytesPerVertex(e))}initialize(e={}){return ArrayBuffer.isView(e)&&(e={data:e}),Number.isFinite(e)&&(e={byteLength:e}),e=cI("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=cI("Buffer",e,Gre))&&this.setAccessor(e.accessor),this}setAccessor(e){return delete(e=Object.assign({},e)).buffer,this.accessor=new ma(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?(Co(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 Co(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}={}){Co(this.gl);const s=E0(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 u=Math.min(o,l);return tn((r=r||u)<=u),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=lI(e);return tn(s),this.setAccessor(new ma(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/E0(this.accessor.type||5126,{clamped:!1}).BYTES_PER_ELEMENT;return this.getElementCount()-i}_inferType(e){this.accessor.type||this.setAccessor(new ma(this.accessor,{type:lI(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 mn.deprecated("Buffer.type","Buffer.accessor.type")(),this.accessor.type}get bytes(){return mn.deprecated("Buffer.bytes","Buffer.byteLength")(),this.byteLength}setByteLength(e){return mn.deprecated("setByteLength","reallocate")(),this.reallocate(e)}updateAccessor(e){return mn.deprecated("updateAccessor(...)","setAccessor(new Accessor(buffer.accessor, ...)")(),this.accessor=new ma(this.accessor,e),this}}const uI={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}},aV={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},lV={5126:4,5125:4,5124:4,5123:2,5122:2,5131:2,5120:1,5121:1},qre=[9729,9728],cV=globalThis.WebGLBuffer||function(){};class Of extends Wu{get[Symbol.toStringTag](){return"Texture"}static isSupported(e,t={}){const{format:i,linearFiltering:r}=t;let s=!0;return i&&(s=s&&function(n,e){const t=uI[e];if(!t)return!1;if(void 0===t.gl1&&void 0===t.gl2)return!0;const i=Si(n)&&t.gl2||t.gl1;return"string"==typeof i?n.getExtension(i):i}(e,i),s=s&&(!r||function(n,e){const t=uI[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=ga("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(U=>this.initialize(Object.assign({},e,{pixels:U,data:U}))),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:u}=e;t||(t=r);let{width:h,height:p,dataFormat:g,type:m,compressed:w=!1,mipmaps:C=!0}=e;const{depth:H=0}=e;return({width:h,height:p,compressed:w,dataFormat:g,type:m}=this._deduceParameters({format:s,type:m,dataFormat:g,compressed:w,data:t,width:h,height:p})),this.width=h,this.height=p,this.depth=H,this.format=s,this.type=m,this.dataFormat=g,this.border=o,this.textureUnit=u,Number.isFinite(this.textureUnit)&&(this.gl.activeTexture(33984+this.textureUnit),this.gl.bindTexture(this.target,this.handle)),C&&this._isNPOT()&&(mn.warn(`texture: ${this} is Non-Power-Of-Two, disabling mipmaping`)(),C=!1,this._updateForNPOT(l)),this.mipmaps=C,this.setImageData({data:t,width:h,height:p,depth:H,format:s,type:m,dataFormat:g,border:o,mipmaps:C,parameters:c,compressed:w}),C&&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:u=this.type,width:h=this.width,height:p=this.height,dataFormat:g=this.dataFormat,compressed:m=!1}=e;c||(c=i),({type:u,dataFormat:g,compressed:m,width:h,height:p}=this._deduceParameters({format:s,type:u,dataFormat:g,compressed:m,data:c,width:h,height:p}));const{gl:w}=this;w.bindTexture(this.target,this.handle);let C=null;({data:c,dataType:C}=this._getDataType({data:c,compressed:m}));let H,U=0;return fc(this.gl,l,()=>{switch(C){case"null":w.texImage2D(t,r,s,h,p,o,g,u,c);break;case"typed-array":w.texImage2D(t,r,s,h,p,o,g,u,c,a);break;case"buffer":H=Co(w),H.bindBuffer(35052,c.handle||c),H.texImage2D(t,r,s,h,p,o,g,u,a),H.bindBuffer(35052,null);break;case"browser-object":Si(w)?w.texImage2D(t,r,s,h,p,o,g,u,c):w.texImage2D(t,r,s,g,u,c);break;case"compressed":for(const[de,Ae]of c.entries())w.compressedTexImage2D(t,de,Ae.format,Ae.width,Ae.height,o,Ae.data),U+=Ae.levelSize;break;default:tn(!1,"Unknown image data type")}}),this._trackAllocatedMemory("compressed"===C?U:c&&c.byteLength?c.byteLength:this.width*this.height*(aV[this.dataFormat]||4)*(lV[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:u=this.type,dataFormat:h=this.dataFormat,compressed:p=!1,offset:g=0,border:m=this.border,parameters:w={}}){if(({type:u,dataFormat:h,compressed:p,width:o,height:a}=this._deduceParameters({format:c,type:u,dataFormat:h,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 C=i;i=C.data,o=C.shape[0],a=C.shape[1]}i instanceof hr&&(i=i.handle),this.gl.bindTexture(this.target,this.handle),fc(this.gl,w,()=>{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,h,u,null);else if(ArrayBuffer.isView(i))this.gl.texSubImage2D(e,l,r,s,o,a,h,u,i,g);else if(i instanceof cV){const C=Co(this.gl);C.bindBuffer(35052,i),C.texSubImage2D(e,l,r,s,o,a,h,u,g),C.bindBuffer(35052,null)}else Si(this.gl)?Co(this.gl).texSubImage2D(e,l,r,s,o,a,h,u,i):this.gl.texSubImage2D(e,l,r,s,h,u,i)}),this.gl.bindTexture(this.target,null)}copyFramebuffer(e={}){return mn.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 hr?{data:e.handle,dataType:"buffer"}:e instanceof cV?{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=uI[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!(Si(this.gl)||!this.width||!this.height||iV(this.width)&&iV(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===qre.indexOf(t)&&(t=9729);break;case 10242:case 10243:33071!==t&&(t=33071)}return t}}function Yre(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 _a extends Of{get[Symbol.toStringTag](){return"Texture2D"}static isSupported(e,t){return Of.isSupported(e,t)}constructor(e,t={}){gS(e),(t instanceof Promise||"string"==typeof t)&&(t={data:t}),"string"==typeof t.data&&(t=Object.assign({},t,{data:Yre(t.data)})),super(e,Object.assign({},t,{target:3553})),this.initialize(t),Object.seal(this)}}const Rf="EXT_color_buffer_float",uV={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:Rf,bpp:2},33327:{gl2:Rf,bpp:4},34842:{gl2:Rf,bpp:8},33326:{gl2:Rf,bpp:4},33328:{gl2:Rf,bpp:8},34836:{gl2:Rf,bpp:16},35898:{gl2:Rf,bpp:4}};class zg extends Wu{get[Symbol.toStringTag](){return"Renderbuffer"}static isSupported(e,{format:t}={format:null}){return!t||function(n,e,t){const i=t[e];if(!i)return!1;const r=Si(n)&&i.gl2||i.gl1;return"string"==typeof r?n.getExtension(r):r}(e,t,uV)}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&&Si(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)*uV[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 gV="clear: bad arguments";function hI(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,gV),fc(n,s,()=>{n.clear(o)})}function mV(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 oi(n){return function(){var e=this,t=arguments;return new Promise(function(i,r){var s=n.apply(e,t);function o(l){mV(s,i,r,o,a,"next",l)}function a(l){mV(s,i,r,o,a,"throw",l)}o(void 0)})}}const fI=[34069,34070,34071,34072,34073,34074];let tse=(()=>{class n extends Of{get[Symbol.toStringTag](){return"TextureCube"}constructor(t,i={}){gS(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 oi(function*(){const{gl:u}=c,h=r||s,p=yield Promise.all(fI.map(g=>{const m=h[g];return Promise.all(Array.isArray(m)?m:[m])}));c.bind(),fI.forEach((g,m)=>{p[m].length>1&&!1!==c.opts.mipmaps&&mn.warn(`${c.id} has mipmap and multiple LODs.`)(),p[m].forEach((w,C)=>{t&&i?u.texImage2D(g,C,a,t,i,o,a,l,w):u.texImage2D(g,C,a,a,l,w)})}),c.unbind()})()}setImageDataForFace(t){const{face:i,width:r,height:s,pixels:o,data:a,border:l=0,format:c=6408,type:u=5121}=t,{gl:h}=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?h.texImage2D(i,0,c,r,s,l,c,u,p):h.texImage2D(i,0,c,c,u,p),this}}return n.FACES=fI,n})();class nse extends Of{get[Symbol.toStringTag](){return"Texture3D"}static isSupported(e){return Si(e)}constructor(e,t={}){Co(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:u,parameters:h={}}){return this._trackDeallocatedMemory("Texture"),this.gl.bindTexture(this.target,this.handle),fc(this.gl,h,()=>{ArrayBuffer.isView(u)&&this.gl.texImage3D(this.target,e,t,i,r,s,o,a,l,u),u instanceof hr&&(this.gl.bindBuffer(35052,u.handle),this.gl.texImage3D(this.target,e,t,i,r,s,o,a,l,c))}),this._trackAllocatedMemory(u&&u.byteLength?u.byteLength:this.width*this.height*this.depth*(aV[this.dataFormat]||4)*(lV[this.type]||1),"Texture"),this.loaded=!0,this}}function _V(n,e){tn(n instanceof _a||n instanceof tse||n instanceof nse);const t=n.constructor,{gl:i,width:r,height:s,format:o,type:a,dataFormat:l,border:c,mipmaps:u}=n;return new t(i,Object.assign({width:r,height:s,format:o,type:a,dataFormat:l,border:c,mipmaps:u},e))}function ise(n,e){const{gl:t,width:i,height:r,id:s}=n;return new Fs(t,Object.assign({},e,{id:`framebuffer-for-${s}`,width:i,height:r,attachments:{36064:n}}))}function _S(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:u,deleteFramebuffer:h}=S0(n);tn(u);const{gl:p,handle:g,attachments:m}=u;a=a||u.width,l=l||u.height,36064===s&&null===g&&(s=1028),tn(m[s]),c=c||m[s].type,o=function(n,e,t,i,r){if(n)return n;return new(E0(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||lI(o);const w=p.bindFramebuffer(36160,g);return p.readPixels(t,i,a,l,r,c,o),p.bindFramebuffer(36160,w||null),h&&u.delete(),o}function pI(n,{sourceAttachment:e=36064,targetMaxHeight:t=Number.MAX_SAFE_INTEGER}={}){let i=_S(n,{sourceAttachment:e}),{width:r,height:s}=n;for(;s>t;)({data:i,width:r,height:s}=Vre({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 u in i){const h=i[u];(Array.isArray(h)?h[0]:h).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&&mn.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 zg)this._attachRenderbuffer({attachment:a,renderbuffer:c});else if(Array.isArray(l)){const[u,h=0,p=0]=l;c=u,this._attachTexture({attachment:a,texture:u,layer:h,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(Fs.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)&&hI(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]}={}){Co(n),fc(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,gV)}})}(this.gl,{drawBuffer:l,value:a})}),this.gl.bindFramebuffer(36160,o||null),this}readPixels(e={}){return mn.error("Framebuffer.readPixels() is no logner supported, use readPixelsToArray(framebuffer)")(),null}readPixelsToBuffer(e={}){return mn.error("Framebuffer.readPixelsToBuffer()is no logner supported, use readPixelsToBuffer(framebuffer)")(),null}copyToDataUrl(e={}){return mn.error("Framebuffer.copyToDataUrl() is no logner supported, use copyToDataUrl(framebuffer)")(),null}copyToImage(e={}){return mn.error("Framebuffer.copyToImage() is no logner supported, use copyToImage(framebuffer)")(),null}copyToTexture(e={}){return mn.error("Framebuffer.copyToTexture({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null}blit(e={}){return mn.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=Co(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=ah(this.gl,r)),r}getAttachmentParameters(e=36064,t,i=this.constructor.ATTACHMENT_PARAMETERS||[]){const r={};for(const s of i)r[t?ah(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?ah(this.gl,s):s]=this.getAttachmentParameters(s,e)}return i}show(){return"undefined"!=typeof window&&window.open(pI(this),"luma-debug-texture"),this}log(e=0,t=""){if(e>mn.level||"undefined"==typeof window)return this;t=t||`Framebuffer ${this.id}`;const i=pI(this,{targetMaxHeight:100});return mn.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 _a(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 zg(this.gl,{id:`${this.id}-depth-stencil`,format:35056,width:r,height:111}),this.ownResources.push(o[33306])):t?(o=o||{},o[36096]=new zg(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 zg?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:Co(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 Si(n)?n:null}(this.gl);t?t.readBuffer(e):tn(36064===e||1029===e,yV),this.readBuffer=e}_setDrawBuffers(e){const{gl:t}=this,i=Co(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]),yV)}this.drawBuffers=e}_getAttachmentParameterFallback(e){const t=function(n){n.luma=n.luma||{},n.luma.caps=n.luma.caps||{};for(const e in bV)void 0===n.luma.caps[e]&&(n.luma.caps[e]=wV(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)}}Fs.ATTACHMENT_PARAMETERS=[36049,36048,33296,33298,33299,33300,33301,33302,33303];const bV={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 _a(n,{format:6408,type:5126,dataFormat:6408}),t=new Fs(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 gI(n,e){return vV(n,e)}function vV(n,e){return(e=Array.isArray(e)?e:[e]).every(t=>wV(n,t))}function wV(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=bV[e];let i;tn(t,e);const r=Si(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]||mn.log(2,`Feature: ${e} not supported`)(),n.luma.caps[e]}class mI{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()}},gse=1/Math.PI*180,mse=1/180*Math.PI,Or={};function yse(n,{precision:e=Or.precision||4}={}){return n=function(n){return Math.round(n/Or.EPSILON)*Or.EPSILON}(n),`${parseFloat(n.toPrecision(e))}`}function lh(n){return Array.isArray(n)||ArrayBuffer.isView(n)&&!(n instanceof DataView)}function qu(n,e,t){if(lh(n)){t=t||function(n){return n.clone?n.clone():new Array(n.length)}(n);for(let i=0;it*mse,void 0)}(n)}function vse(n){return function(n,e){return qu(n,t=>t*gse,void 0)}(n)}function Va(n,e,t){return qu(n,i=>Math.max(e,Math.min(t,i)))}function yS(n,e,t){return lh(n)?n.map((i,r)=>yS(i,e[r],t)):t*e+(1-t)*n}function C0(n,e,t){const i=Or.EPSILON;t&&(Or.EPSILON=t);try{if(n===e)return!0;if(lh(n)&&lh(e)){if(n.length!==e.length)return!1;for(let r=0;r0?", ":"")+yse(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&&(LV.length=n.length,i=LV):i=kV,(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 BV(n){return n&&n[Symbol.asyncIterator]}function EI(n,e=(()=>!0)){return Array.isArray(n)?jV(n,e,[]):e(n)?[n]:[]}function jV(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 VV(n,e){return n?(Number.isFinite(n)&&(n={duration:n}),n.type=n.type||"interpolation",ot(ot(ot({},qse[n.type]),e),n)):null}function UV(n,e){return e.getBuffer()?[e.getBuffer(),{divisor:0,size:e.size,normalized:e.settings.normalized}]:e.value}function zV(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 HV(n){n.push(n.shift())}function xI(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 GV({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,u=r&&c,h=xI(t,e),p=t.state.constant;if(!u&&i>=h)return;const g=p?t.value:t.getBuffer().getData({srcByteOffset:l});if(t.settings.normalized&&!p){const H=s;s=(U,de)=>t._normalizeConstant(H(U,de))}const m=p?(H,U)=>s(g,U):(H,U)=>s(g.subarray(H,H+a),U),w=n.getData({length:i}),C=new Float32Array(h);(function({source:n,target:e,size:t,getData:i,sourceStartIndices:r,targetStartIndices:s}){if(!Array.isArray(s))return SI({source:n,target:e,size:t,getData:i}),e;let o=0,a=0;const l=i&&((u,h)=>i(u+a,h)),c=Math.min(r.length,s.length);for(let u=1;u(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===SS||(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=SS}clearNeedsUpdate(){this.state.needsUpdate=!1,this.state.updateRanges=Gse}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!==SS}),!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,u]of s)o.call(r,this,{data:t,startRow:c,endRow:u,props:i,numInstances:e});if(this.value)if(this.constant||this.buffer.byteLength{if(!r){const C=h*a+l;for(let H=0;Hu?c.set(de,w):(e._normalizeValue(de,H.target,0),Hse({target:c,source:H.target,start:w,count:Ae}));w+=Ae*u}else e._normalizeValue(de,c,w),w+=u}}_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 AI={};function To(n){Ri.level>0&&AI[n]&&AI[n].call(...arguments)}function Ua(n,e){if(!n)throw new Error(e||"shadertools: assertion failed.")}const $V="out vec4 transform_output;\nvoid main() {\n transform_output = vec4(0);\n}",Xse=`#version 300 es\n${$V}`;function WV(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 qV(n={}){const{version:e=100,input:t,inputType:i,output:r}=n;if(!t)return 300===e?Xse:e>300?`#version ${e}\n${$V}`:"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 Ua(!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 YV extends Wu{get[Symbol.toStringTag](){return"TransformFeedback"}static isSupported(e){return Si(e)}constructor(e,t={}){Co(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,Vg(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,mn.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 hr?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 eoe{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 hr?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(Si(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 YV(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 hr)}return{sourceBuffers:t,feedbackBuffers:i}}_createNewBuffer(e,t){const i=new hr(this.gl,t);return this.resources[e]&&this.resources[e].delete(),this.resources[e]=i,i}_getNextIndex(){return(this.currentIndex+1)%2}}function KV(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 D0="vs",ioe={[D0]:"#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"},xS="__LUMA_INJECT_DECLARATIONS__",XV=/void\s+main\s*\([^)]*\)\s*\{\n?/,QV=/}\n?[^{}]*$/,MI=[];function ZV(n,e,t,i=!1){const r=e===D0;for(const s in t){const o=t[s];o.sort((l,c)=>l.order-c.order),MI.length=o.length;for(let l=0,c=o.length;ll+a));break;case"vs:#main-end":r&&(n=n.replace(QV,l=>a+l));break;case"fs:#decl":r||(n=n.replace(xS,a));break;case"fs:#main-start":r||(n=n.replace(XV,l=>l+a));break;case"fs:#main-end":r||(n=n.replace(QV,l=>a+l));break;default:n=n.replace(s,l=>l+a)}}return n=n.replace(xS,""),i&&(n=n.replace(/\}\s*$/,s=>s+ioe[e])),n}function DI(n){const e={};return Ua(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 roe={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},CS="transform_uSize_",JV="transform_position";const hoe={10241:9728,10240:9728,10242:33071,10243:33071};class poe{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 h in this.samplerTextureMap)a[h]=i[this.samplerTextureMap[h]];this._setSourceTextureParameters();const u=function({sourceTextureMap:n,targetTextureVarying:e,targetTexture:t}){const i={};let r,s;e&&(({width:r,height:s}=t),i[`${CS}${e}`]=[r,s]);for(const o in n)({width:r,height:s}=n[o]),i[`${CS}${o}`]=[r,s];return i}({sourceTextureMap:i,targetTextureVarying:this.targetTextureVarying,targetTexture:s});Object.assign(a,u)}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=_S(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 Ua(!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 hr(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 Fs(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(hoe)}_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=_V(e,{parameters:{10241:9728,10240:9728,10242:33071,10243:33071},pixelStore:{37440:!1}});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 u=l.split("\n"),h=u.slice();if(u.forEach((p,g,m)=>{if(s>0){const w=function(n,e){const t={},i=function(n){return WV(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=`${CS}${n}`;return{samplerName:e,sizeName:t,uniformDeclerations:` uniform sampler2D ${e};\n uniform vec2 ${t};`}}(s),h=` ${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 Ua(!1),null}}(r)};\n`;return t[a]=s,{updatedLine:o,inject:{"vs:#decl":c,"vs:#main-start":h},samplerTextureMap:t}}return null}(p,e);if(w){const{updatedLine:C,inject:H}=w;h[g]=C,c=DI([c,H]),Object.assign(a,w.samplerTextureMap),s--}}t&&!o&&(o=function(n,e){const t=WV(n,["varying","out"]);return t&&t.name===e?t.type:null}(p,t))}),t){tn(i);const p=`${CS}${t}`;c=DI([c,{"vs:#decl":`uniform vec2 ${p};\n`,"vs:#main-start":` vec2 ${JV} = transform_getPos(${p});\n gl_Position = vec4(${JV}, 0, 1.);\n`}])}l=h.join("\n")}return{vs:l,targetTextureType:o,inject:c,samplerTextureMap:a}}({vs:e.vs,sourceTextureMap:t,targetTextureVarying:this.targetTextureVarying,targetTexture:i}),c=DI([e.inject||{},a]);return this.targetTextureType=o,this.samplerTextureMap=l,{vs:r,fs:e._fs||qV({version:KV(r),input:this.targetTextureVarying,inputType:o,output:"transform_output"}),modules:this.hasSourceTextures||this.targetTextureVarying?[roe].concat(e.modules||[]):e.modules,uniforms:s,inject:c}}}const II={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 moe(n){let e=eU(n);return"object"===e?n?"type"in n?Object.assign({},n,II[n.type]):"value"in n?(e=eU(n.value),Object.assign({type:e},n,II[e])):{type:"object",value:n}:{type:"object",value:null}:Object.assign({type:e,value:n},II[e])}function eU(n){return Array.isArray(n)||ArrayBuffer.isView(n)?"array":typeof n}class OI{constructor({name:e,vs:t,fs:i,dependencies:r=[],uniforms:s,getUniforms:o,deprecations:a=[],defines:l={},inject:c={},vertexShader:u,fragmentShader:h}){Ua("string"==typeof e),this.name=e,this.vs=t||u,this.fs=i||h,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=moe(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:Ua(!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&&Ua(s.validate(e[r],s),`${this.name}: invalid ${r}`),t[r]=e[r]):t[r]=s.value}return t}}function voe(n){return function(n){const e={},t={};return RI({modules:n,level:0,moduleMap:e,moduleDepth:t}),Object.keys(t).sort((i,r)=>t[r]-t[i]).map(i=>e[i])}(nU(n))}function RI({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 OI||(Ua("string"!=typeof t,`Shader module use by name is deprecated. Import shader module '${t}' and use it directly.`),Ua(t.name,"shader module has no name"),(t=new OI(t)).dependencies=nU(t.dependencies)),t))}const NI={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]},Nf={};function Moe(n,e){return n.match(/NVIDIA/i)||e.match(/NVIDIA/i)?"NVIDIA":n.match(/INTEL/i)||e.match(/INTEL/i)?"INTEL":n.match(/AMD/i)||e.match(/AMD/i)||n.match(/ATI/i)||e.match(/ATI/i)?"AMD":"UNKNOWN GPU"}Object.keys(NI).forEach(n=>{Nf[n]=n});const PI={};function iU(n,e,t={}){const i=NI[e];if(Ua(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 PI)return PI[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),PI[e]=l,l}function AS(n,e){return(e=Array.isArray(e)?e:[e]).every(t=>function(n,e){const t=NI[e];Ua(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 Ua(!1===r||!0===r),r}(n,t))}function Gg(n){return new RegExp(`\\b${n}[ \\t]+(\\w+[ \\t]+\\w+(\\[\\w+\\])?;)`,"g")}const rU=[[/^(#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("]],Roe=[...rU,[Gg("attribute"),"in $1"],[Gg("varying"),"out $1"]],Noe=[...rU,[Gg("varying"),"in $1"]],sU=[[/^#version[ \t]+300[ \t]+es/,"#version 100"],[/\btexture(2D|2DProj|Cube)Lod\(/g,"texture$1LodEXT("],[/\btexture\(/g,"texture2D("],[/\btextureLod\(/g,"texture2DLodEXT("]],Poe=[...sU,[Gg("in"),"attribute $1"],[Gg("out"),"varying $1"]],Foe=[...sU,[Gg("in"),"varying $1"]],FI="gl_FragColor",kI=/\bout[ \t]+vec4[ \t]+(\w+)[ \t]*;\n?/,koe=/void\s+main\s*\([^)]*\)\s*\{\n?/;function TS(n,e){for(const[t,i]of e)n=n.replace(t,i);return n}const Voe=`\n\n${xS}\n\n`,oU={[D0]:"vertex",fs:"fragment"};function aU(n,{id:e,source:t,type:i,modules:r,defines:s={},hookFunctions:o=[],inject:a={},transpileToGLSL100:l=!1,prologue:c=!0,log:u}){Ua("string"==typeof t,"shader source must be a string");const h=i===D0,p=t.split("\n");let g=100,m="",w=t;0===p[0].indexOf("#version ")?(g=300,m=p[0],w=p.slice(1).join("\n")):m=`#version ${g}`;const C={};r.forEach(Be=>{Object.assign(C,Be.getDefines())}),Object.assign(C,s);let H=c?`${m}\n${function({id:n,source:e,type:t}){return n&&"string"==typeof n&&-1===e.indexOf("SHADER_NAME")?`\n#define SHADER_NAME ${n}_${oU[t]}\n\n`:""}({id:e,source:t,type:i})}\n${function({type:n}){return`\n#define SHADER_TYPE_${oU[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:Moe(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// 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"}}(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 AS(n,Nf.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"),AS(n,Nf.GLSL_DERIVATIVES)&&iU(n,Nf.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"),AS(n,Nf.GLSL_FRAG_DATA)&&iU(n,Nf.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"),AS(n,Nf.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}(C)}\n${h?"":"precision highp float;\n\n"}\n`:`${m}\n`;const U=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),de={},Ae={},Pe={};for(const Be in a){const et="string"==typeof a[Be]?{injection:a[Be],order:0}:a[Be],wt=Be.match(/^(v|f)s:(#)?([\w-]+)$/);if(wt){const Ct=wt[3];wt[2]?"decl"===Ct?Ae[Be]=[et]:Pe[Be]=[et]:de[Be]=[et]}else Pe[Be]=[et]}for(const Be of r){u&&Be.checkDeprecations(w,u),H+=Be.getModuleSource(i,g);const wt=Be.injections[i];for(const vt in wt){const Ct=vt.match(/^(v|f)s:#([\w-]+)$/);if(Ct){const $t="decl"===Ct[2]?Ae:Pe;$t[vt]=$t[vt]||[],$t[vt].push(wt[vt])}else de[vt]=de[vt]||[],de[vt].push(wt[vt])}}return H+=Voe,H=ZV(H,i,Ae),H+=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}(U[i],de),H+=w,H=ZV(H,i,Pe),H=function(n,e,t){switch(e){case 300:return t?TS(n,Roe):function(n){const e=(n=TS(n,Noe)).match(kI);if(e){const t=e[1];n=n.replace(new RegExp(`\\b${FI}\\b`,"g"),t)}else{const t="fragmentColor";n=n.replace(koe,i=>`out vec4 ${t};\n${i}`).replace(new RegExp(`\\b${FI}\\b`,"g"),t)}return n}(n);case 100:return t?TS(n,Poe):function(n){const e=(n=TS(n,Foe)).match(kI);if(e){const t=e[1];n=n.replace(kI,"").replace(new RegExp(`\\b${t}\\b`,"g"),FI)}return n}(n);default:throw new Error(`unknown GLSL version ${e}`)}}(H,l?100:g,h),H}function Hoe(n){return function(t){const i={};for(const r of n){const s=r.getUniforms(t,i);Object.assign(i,s)}return i}}const Koe={5126:Rr.bind(null,"uniform1fv",za,1,Mo),35664:Rr.bind(null,"uniform2fv",za,2,Mo),35665:Rr.bind(null,"uniform3fv",za,3,Mo),35666:Rr.bind(null,"uniform4fv",za,4,Mo),5124:Rr.bind(null,"uniform1iv",ch,1,Mo),35667:Rr.bind(null,"uniform2iv",ch,2,Mo),35668:Rr.bind(null,"uniform3iv",ch,3,Mo),35669:Rr.bind(null,"uniform4iv",ch,4,Mo),35670:Rr.bind(null,"uniform1iv",ch,1,Mo),35671:Rr.bind(null,"uniform2iv",ch,2,Mo),35672:Rr.bind(null,"uniform3iv",ch,3,Mo),35673:Rr.bind(null,"uniform4iv",ch,4,Mo),35674:Rr.bind(null,"uniformMatrix2fv",za,4,Ku),35675:Rr.bind(null,"uniformMatrix3fv",za,9,Ku),35676:Rr.bind(null,"uniformMatrix4fv",za,16,Ku),35678:ro,35680:ro,5125:Rr.bind(null,"uniform1uiv",MS,1,Mo),36294:Rr.bind(null,"uniform2uiv",MS,2,Mo),36295:Rr.bind(null,"uniform3uiv",MS,3,Mo),36296:Rr.bind(null,"uniform4uiv",MS,4,Mo),35685:Rr.bind(null,"uniformMatrix2x3fv",za,6,Ku),35686:Rr.bind(null,"uniformMatrix2x4fv",za,8,Ku),35687:Rr.bind(null,"uniformMatrix3x2fv",za,6,Ku),35688:Rr.bind(null,"uniformMatrix3x4fv",za,12,Ku),35689:Rr.bind(null,"uniformMatrix4x2fv",za,8,Ku),35690:Rr.bind(null,"uniformMatrix4x3fv",za,12,Ku),35678:ro,35680:ro,35679:ro,35682:ro,36289:ro,36292:ro,36293:ro,36298:ro,36299:ro,36300:ro,36303:ro,36306:ro,36307:ro,36308:ro,36311:ro},Xoe={},Qoe={},Zoe={},lU=[0];function LI(n,e,t,i){1===e&&"boolean"==typeof n&&(n=n?1:0),Number.isFinite(n)&&(lU[0]=n,n=lU);const r=n.length;if(r%e&&mn.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 Rr(n,e,t,i){let r=null,s=null;return(o,a,l)=>{const c=e(l,t),u=c.length;let h=!1;if(null===r)r=new Float32Array(u),s=u,h=!0;else{tn(s===u,"Uniform length cannot change.");for(let p=0;p{const a=String(o+e);return hU(a,r-a.length)+t+s})}(e);return{shaderName:l,errors:dU(s,c),warnings:dU(o,c)}}(i,this.source,this.shaderType,this.id);throw mn.error(`GLSL compilation errors in ${r}\n${s}`)(),mn.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 BI extends I0{get[Symbol.toStringTag](){return"VertexShader"}constructor(e,t){"string"==typeof t&&(t={source:t}),super(e,Object.assign({},t,{shaderType:35633}))}_createHandle(){return this.gl.createShader(35633)}}class jI extends I0{get[Symbol.toStringTag](){return"FragmentShader"}constructor(e,t){"string"==typeof t&&(t={source:t}),super(e,Object.assign({},t,{shaderType:35632}))}_createHandle(){return this.gl.createShader(35632)}}const ks=5126,O0=5124,R0=5125,VI={[ks]:[ks,1,"float"],35664:[ks,2,"vec2"],35665:[ks,3,"vec3"],35666:[ks,4,"vec4"],[O0]:[O0,1,"int"],35667:[O0,2,"ivec2"],35668:[O0,3,"ivec3"],35669:[O0,4,"ivec4"],[R0]:[R0,1,"uint"],36294:[R0,2,"uvec2"],36295:[R0,3,"uvec3"],36296:[R0,4,"uvec4"],35670:[ks,1,"bool"],35671:[ks,2,"bvec2"],35672:[ks,3,"bvec3"],35673:[ks,4,"bvec4"],35674:[ks,8,"mat2"],35685:[ks,8,"mat2x3"],35686:[ks,8,"mat2x4"],35675:[ks,12,"mat3"],35687:[ks,12,"mat3x2"],35688:[ks,12,"mat3x4"],35676:[ks,16,"mat4"],35689:[ks,16,"mat4x2"],35690:[ks,16,"mat4x3"]};function yU(n){const e=VI[n];if(!e)return null;const[t,i]=e;return{type:t,components:i}}function bU(n,e){switch(n){case 5120:case 5121:case 5122:case 5123:n=ks}for(const t in VI){const[i,r,s]=VI[t];if(i===n&&r===e)return{glType:t,name:s}}return null}class kae{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(!Si(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}=yU(i),a={type:s,size:r*o};this._inferProperties(e,t,a);const l={location:e,name:t,accessor:new ma(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}=yU(i),l={location:e,name:t,accessor:new ma({type:s,size:r*o})};this.varyingInfos.push(l),this.varyingInfosByName[l.name]=l}}const Lae=35981,Bae=["setVertexArray","setAttributes","setBuffers","unsetBuffers","use","getUniformCount","getUniformInfo","getUniformLocation","getUniformValue","getVarying","getFragDataLocation","getAttachedShaders","getAttributeCount","getAttributeLocation","getAttributeInfo"];class wU extends Wu{get[Symbol.toStringTag](){return"Program"}constructor(e,t={}){super(e,t),this.stubRemovedMethods("Program","v6.0",Bae),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=Lae}=e;return this.hash=t||"",this.vs="string"==typeof i?new BI(this.gl,{id:`${e.id}-vs`,source:i}):i,this.fs="string"==typeof r?new jI(this.gl,{id:`${e.id}-fs`,source:r}):r,tn(this.vs instanceof BI),tn(this.fs instanceof jI),this.uniforms={},this._textureUniforms={},s&&s.length>0&&(Co(this.gl),this.varyings=s,this.gl2.transformFeedbackVaryings(this.handle,s,o)),this._compileAndLink(),this._readUniformLocationsFromLinkedProgram(),this.configuration=new kae(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:u=c>0,vertexArray:h=null,transformFeedback:p,framebuffer:g,parameters:m={},uniforms:w,samplers:C}){if((w||C)&&(mn.deprecated("Program.draw({uniforms})","Program.setUniforms(uniforms)")(),this.setUniforms(w||{})),mn.priority>=e){const H=g?g.id:"default",U=`mode=${ah(this.gl,t)} verts=${i} instances=${c} indexType=${ah(this.gl,l)} isInstanced=${u} isIndexed=${a} Framebuffer=${H}`;mn.log(e,U)()}return tn(h),this.gl.useProgram(this.handle),!(!this._areTexturesRenderable()||0===i||u&&0===c||(h.bindForDraw(i,c,()=>{if(void 0!==g&&(m=Object.assign({},m,{framebuffer:g})),p){const H=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(H)}this._bindTextures(),fc(this.gl,m,()=>{a&&u?this.gl2.drawElementsInstanced(t,i,l,r,c):a&&Si(this.gl)&&!isNaN(s)&&!isNaN(o)?this.gl2.drawRangeElements(t,s,o,i,l,r):a?this.gl.drawElements(t,i,l,r):u?this.gl2.drawArraysInstanced(t,r,i,c):this.gl.drawArrays(t,r,i)}),p&&p.end()}),0))}setUniforms(e={}){mn.priority>=2&&function(n,e,t){for(const i in n){const r=n[i];if((!t||Boolean(t[i]))&&!tae(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 Fs&&(s=s.texture),s instanceof Of)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)&&nae(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 BI({handle:r});break;case 35632:i.fs=new jI({handle:r})}return i}_getParameter(e){return this.gl.getProgramParameter(this.handle,e)}_setId(e){if(!e){const t=this._getName();this.id=ga(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),mn.time(4,`linkProgram for ${this._getName()}`)(),e.linkProgram(this.handle),mn.timeEnd(4,`linkProgram for ${this._getName()}`)(),e.debug||mn.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),u=this._getHash(t),h=this._getHash(i),p=c.map(de=>this._getHash(de.name)).sort(),g=o.map(de=>this._getHash(de)),m=Object.keys(r).sort(),w=Object.keys(s).sort(),C=[],H=[];for(const de of m)C.push(this._getHash(de)),C.push(this._getHash(r[de]));for(const de of w)H.push(this._getHash(de)),H.push(this._getHash(s[de]));const U=`${u}/${h}D${C.join("/")}M${p.join("/")}I${H.join("/")}V${g.join("/")}H${this.stateHash}B${a}${l?"T":""}`;if(!this._programCache[U]){const de=function(n,e){const{vs:t,fs:i}=e,r=voe(e.modules||[]);return{gl:n,vs:aU(n,Object.assign({},e,{source:t,type:D0,modules:r})),fs:aU(n,Object.assign({},e,{source:i,type:"fs",modules:r})),getUniforms:Hoe(r)}}(this.gl,{vs:t,fs:i,modules:c,inject:s,defines:r,hookFunctions:this._hookFunctions,transpileToGLSL100:l});this._programCache[U]=new wU(this.gl,{hash:U,vs:de.vs,fs:de.fs,varyings:o,bufferMode:a}),this._getUniforms[U]=de.getUniforms||(Ae=>{}),this._useCounts[U]=0}return this._useCounts[U]++,this._programCache[U]}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":_0.chrome?"Chrome":_0.safari?"Safari":_0.mozInnerScreenX?"Firefox":"Unknown"}()}static getDefaultArray(e){return e.luma=e.luma||{},e.luma.defaultVertexArray||(e.luma.defaultVertexArray=new Ha(e,{handle:null,isDefaultArray:!0})),e.luma.defaultVertexArray}static getMaxAttributes(e){return Ha.MAX_ATTRIBUTES=Ha.MAX_ATTRIBUTES||e.getParameter(34921),Ha.MAX_ATTRIBUTES}static setConstant(e,t,i){switch(i.constructor){case Float32Array:Ha._setConstantFloatArray(e,t,i);break;case Int32Array:Ha._setConstantIntArray(e,t,i);break;case Uint32Array:Ha._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 Ha.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:u}=i,{gl:h,gl2:p}=this;return e=Number(e),this.bind(()=>{h.bindBuffer(34962,t.handle),c?(tn(Si(h)),p.vertexAttribIPointer(e,r,s,o,a)):h.vertexAttribPointer(e,r,s,l,o,a),h.enableVertexAttribArray(e),p.vertexAttribDivisor(e,u||0)}),this}enable(e,t=!0){return!t&&0===e&&!Ha.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 hr(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(!OS||OS.byteLength{switch(e){case 34373:return this.gl.getVertexAttribOffset(t,e);default:return this.gl.getVertexAttrib(t,e)}})}}const $ae=/^(.+)__LOCATION_([0-9]+)$/,Wae=["setBuffers","setGeneric","clearBindings","setLocations","setGenericValues","setDivisor","enable","disable"];class qae{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 Ha(e),rV(this,"VertexArray","v6.0",Wae),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 hr(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,mn.once(3,()=>`unused value ${e} in ${this.id}`)(),s;const l=this._getAttributeInfo(a||o);if(!l)return s;const u=ma.resolve(l.accessor,this.accessors[o]||{},i,r),{size:h,type:p}=u;return tn(Number.isFinite(h)&&Number.isFinite(p)),{location:o,accessor:u}}_getAttributeInfo(e){return this.configuration&&this.configuration.getAttributeInfo(e)}_getAttributeIndex(e){const t=Number(e);if(Number.isFinite(t))return{location:t};const i=$ae.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 hr)this.setBuffer(e,t);else if(Array.isArray(t)&&t.length&&t[0]instanceof hr)this.setBuffer(e,t[0],t[1]);else if(ArrayBuffer.isView(t)||Array.isArray(t))this.setConstant(e,t);else{if(!(t.buffer instanceof hr))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 hr){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 mn.deprecated("setElements","setElementBuffer")(),this.setElementBuffer(e,t)}}function P0(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+=P0(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 EU(n,e,t,i){const{gl:r}=n;if(!e)return{[i]:"null","Format ":"N/A"};let c,u,h,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 hr){const p=e,{data:g,changed:m}=p.getDebugData();let w;return u=m?"*":"",h=g,l=p.byteLength,a=l/g.BYTES_PER_ELEMENT/o,t?w=`${t.divisor>0?"I ":"P "} ${a} (x${o}=${l} bytes ${ah(r,s)})`:(c=!0,w=`${l} bytes`),{[i]:`${u}${P0(h,{size:o,isInteger:c})}`,"Format ":w}}return h=e,o=e.length,s=String(e.constructor.name).replace("Array",""),c=-1!==s.indexOf("nt"),{[i]:`${P0(h,{size:o,isInteger:c})} (constant)`,"Format ":`${o}x${s} (constant)`}}function Xae(n,e){const{type:t,size:i}=e,r=bU(t,i);return r?`${n} (${r.name})`:n}function SU({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)&&UI({table:a,header:n,uniforms:t,uniformName:p,undefinedOnly:i})&&c++;for(const p of l)p.match(s)&&UI({table:a,header:n,uniforms:t,uniformName:p,undefinedOnly:i})&&c++;for(const p of l)a[p]||UI({table:a,header:n,uniforms:t,uniformName:p,undefinedOnly:i})&&c++;let u=0;const h={};if(!i)for(const p in t){const g=t[p];a[p]||(u++,h[p]={Type:`NOT USED: ${g}`,[n]:P0(g)})}return{table:a,count:c,unusedTable:h,unusedCount:u}}function UI({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?P0(s):"N/A","Uniform Type":o?s:"NOT PROVIDED"},0))}function xU(n){const{type:e,size:t}=n.accessor,i=bU(e,t);return i?`${i.name} ${n.name}`:n.name}const Jae={POSITION:"positions",NORMAL:"normals",COLOR_0:"colors",TEXCOORD_0:"texCoords",TEXCOORD_1:"texCoords1",TEXCOORD_2:"texCoords2"};function tle(n,e){const{attributeMap:t=Jae}=e||{};return t&&t[n]||n}function nle(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 CU=()=>{},sle={};class Yg{constructor(e,t={}){const{id:i=ga("model")}=t;tn(pS(e)),this.id=i,this.gl=e,this.id=t.id||ga("Model"),this.lastLogTime=0,this.animated=!1,this.initialize(t)}initialize(e){this.props={},this.programManager=e.programManager||N0.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:u}=e;this.programProps={program:t,vs:i,fs:r,modules:s,defines:o,inject:a,varyings:l,bufferMode:c,transpileToGLSL100:u},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:u}=e;this.programProps={program:t,vs:i,fs:r,modules:s,defines:o,inject:a,varyings:l,bufferMode:c,transpileToGLSL100:u},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=tle(s,undefined);if("indices"===s)r=o;else if(o.constant)i[a]=o.value;else{const l=o.value,c=ot({},o);delete c.value,i[a]=[new hr(n,l),c],nle(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 hr(n,{data:s,target:34963}),o]}return i}(this.gl,e),this.vertexArray.setAttributes(this.geometryBuffers),this}setAttributes(e={}){if(Vg(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 hI(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),mn.priority>=2&&(c=this._logDrawCallStart(2));const u=this.vertexArray.getDrawParams(),{isIndexed:h=u.isIndexed,indexType:p=u.indexType,indexOffset:g=u.indexOffset,vertexArrayInstanced:m=u.isInstanced}=this.props;m&&!this.isInstanced&&mn.warn("Found instanced attributes on non-instanced model",this.id)();const{isInstanced:w,instanceCount:C}=this,{onBeforeRender:H=CU,onAfterRender:U=CU}=this.props;H(),this.program.setUniforms(this.uniforms);const de=this.program.draw(Object.assign(sle,e,{logPriority:c,uniforms:null,framebuffer:i,parameters:a,drawMode:this.getDrawMode(),vertexCount:this.getVertexCount(),vertexArray:l,transformFeedback:o,isIndexed:h,indexType:p,isInstanced:w,instanceCount:C,offset:h?g:0}));return U(),mn.priority>=2&&this._logDrawCallEnd(c,l,i),de}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 mn.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:u}=this.programProps;t=this.programManager.get({vs:i,fs:r,modules:s,inject:o,defines:a,varyings:l,bufferMode:c,transpileToGLSL100:u}),this.program&&this._managedProgram&&this.programManager.release(this.program),this._programManagerState=this.programManager.stateHash,this._managedProgram=!0}tn(t instanceof wU,"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 qae(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 hr&&t.delete()}}_setAnimationProps(e){this.animated&&tn(e,"Model.draw(): animated uniforms but no animationProps")}_setFeedbackBuffers(e={}){if(Vg(e))return this;const{gl:t}=this.program;return this.transformFeedback=this.transformFeedback||new YV(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:mn.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=EU(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}: ${Xae(s.name,a)}`),t[o]=EU(n,i[r],a,e)}}return t}({vertexArray:t,header:`${this.id} attributes`,attributes:this._attributes}),{table:o,unusedTable:a,unusedCount:l}=SU({header:`${this.id} uniforms`,program:this.program,uniforms:Object.assign({},this.program.uniforms,i)}),{table:c,count:u}=SU({header:`${this.id} uniforms`,program:this.program,uniforms:Object.assign({},this.program.uniforms,i),undefinedOnly:!0});u>0&&mn.log("MISSING UNIFORMS",Object.keys(c))(),l>0&&mn.log("UNUSED UNIFORMS",Object.keys(a))();const h=function(n){const e={},t=`Accessors for ${n.id}`;for(const i of n.attributeInfos)i&&(e[`in ${xU(i)}`]={[t]:JSON.stringify(i.accessor)});for(const i of n.varyingInfos)i&&(e[`out ${xU(i)}`]={[t]:JSON.stringify(i.accessor)});return e}(this.vertexArray.configuration);mn.table(e,s)(),mn.table(e,o)(),mn.table(e+1,h)(),r&&r.log({logLevel:2,message:`Rendered to ${r.id}`}),mn.groupEnd(2,`>>> DRAWING MODEL ${this.id}`)()}}class zI{static isSupported(e){return Si(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 Yg(t,Object.assign({},e,{fs:e.fs||qV({version:KV(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!(Vg(n.feedbackBuffers)&&Vg(n.feedbackMap)&&!(n.varyings&&n.varyings.length>0))})(t)&&(this.bufferTransform=new eoe(e,t)),function(n){return!(Vg(n._sourceTextures)&&!n._targetTexture&&!n._targetTextureVarying)}(t)&&(this.textureTransform=new poe(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 RS(){}const lle={onStart:RS,onUpdate:RS,onInterrupt:RS,onEnd:RS};class F0{constructor(e){this._inProgress=!1,this._handle=null,this.timeline=e,this.settings={}}get inProgress(){return this._inProgress}start(e){this.cancel(),this.settings=ot(ot({},lle),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 mle={interpolation:class{constructor({gl:e,attribute:t,timeline:i}){this.gl=e,this.type="interpolation",this.transition=new F0(i),this.attribute=t,this.attributeInTransition=new CI(e,t.settings),this.currentStartIndices=t.startIndices,this.currentLength=0,this.transform=function(n,e){const t=zV(e.size);return new zI(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 hr(e,r),new hr(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;HV(r);const o={numInstances:t,attribute:s,fromLength:this.currentLength,fromStartIndices:this.currentStartIndices,getData:e.enter};for(const a of r)GV(ot({buffer:a},o));this.currentStartIndices=s.startIndices,this.currentLength=xI(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:UV(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 F0(i),this.attribute=t,this.attributeInTransition=new CI(e,Cn(ot({},t.settings),{normalized:!1})),this.currentStartIndices=t.startIndices,this.currentLength=0,this.texture=function(n){return new _a(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 Fs(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=zV(e.size);return new zI(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 hr(e,r),new hr(e,r),new hr(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)GV(ot({buffer:a},o));this.currentStartIndices=s.startIndices,this.currentLength=xI(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:UV(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]}}),HV(e),this.attributeInTransition.update({buffer:e[1],value:this.attribute.value}),_S(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 _le{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=zI.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 Ri.warn("WebGL2 not supported by this browser. Transition for ".concat(e," is disabled."))();r&&this._removeTransition(e);const o=mle[i.type];o?this.transitions[e]=new o({attribute:t,timeline:this.timeline,gl:this.gl}):(Ri.error("unsupported transition type '".concat(i.type,"'"))(),s=!1)}(s||t.needsRedraw())&&(this.needsRedraw=!0,this.transitions[e].start(i,this.numInstances))}}const AU="attributeManager.invalidate";class Sle{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 _le(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;To("attribute.updateStart",t),t.allocate(i)&&To("attribute.allocate",t,i),t.updateBuffer(e)&&(this.needsRedraw=!0,To("attribute.updateEnd",t,i))}}function MU(n,e,t,i,r){const s=e-n;return(t-e)*r+-s*i+s+e}function DU(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=VV(r)))return;const o=Tle[r.type];if(!o)return void Ri.error("unsupported transition type '".concat(r.type,"'"))();const a=new o(this.timeline);a.start(Cn(ot({},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 NS={COMPONENT:Symbol.for("component"),ASYNC_DEFAULTS:Symbol.for("asyncPropDefaults"),ASYNC_ORIGINAL:Symbol.for("asyncPropOriginal"),ASYNC_RESOLVED:Symbol.for("asyncPropResolved")},{COMPONENT:Dle}=NS;function Rle(n,e){if(!n.transitions)return null;const t={},i=GI(n);for(const r in n.transitions){const s=i[r],o=s&&s.type;("number"===o||"color"===o||"array"===o)&&HI(n[r],e[r],s)&&(t[r]=!0)}return t}function IU({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=HI(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=HI(n[s],e[s],i[s]);if(o)return"".concat(r,".").concat(s," ").concat(o)}}return null}function HI(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 Fle(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(!Ule(i[r],e[r])){t=n(i),e=i;break}return t}}function zle(n,e){if(!e)return n;const t=ot(ot({},n),e);if("defines"in e&&(t.defines=ot(ot({},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=ot({},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 $I(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],u=e[8],h=e[9],p=e[10],g=e[11],m=e[12],w=e[13],C=e[14],H=e[15],U=t*a-i*o,de=t*l-r*o,Ae=t*c-s*o,Pe=i*l-r*a,Be=i*c-s*a,et=r*c-s*l,wt=u*w-h*m,vt=u*C-p*m,Ct=u*H-g*m,Bt=h*C-p*w,$t=h*H-g*w,gt=p*H-g*C,mt=U*gt-de*$t+Ae*Bt+Pe*Ct-Be*vt+et*wt;return mt?(n[0]=(a*gt-l*$t+c*Bt)*(mt=1/mt),n[1]=(r*$t-i*gt-s*Bt)*mt,n[2]=(w*et-C*Be+H*Pe)*mt,n[3]=(p*Be-h*et-g*Pe)*mt,n[4]=(l*Ct-o*gt-c*vt)*mt,n[5]=(t*gt-r*Ct+s*vt)*mt,n[6]=(C*Ae-m*et-H*de)*mt,n[7]=(u*et-p*Ae+g*de)*mt,n[8]=(o*$t-a*Ct+c*wt)*mt,n[9]=(i*Ct-t*$t-s*wt)*mt,n[10]=(m*Be-w*Ae+H*U)*mt,n[11]=(h*Ae-u*Be-g*U)*mt,n[12]=(a*vt-o*Bt-l*wt)*mt,n[13]=(t*Bt-i*vt+r*wt)*mt,n[14]=(w*de-m*Pe-C*U)*mt,n[15]=(u*Pe-h*de+p*U)*mt,n):null}function Pf(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],u=e[7],h=e[8],p=e[9],g=e[10],m=e[11],w=e[12],C=e[13],H=e[14],U=e[15],de=t[0],Ae=t[1],Pe=t[2],Be=t[3];return n[0]=de*i+Ae*a+Pe*h+Be*w,n[1]=de*r+Ae*l+Pe*p+Be*C,n[2]=de*s+Ae*c+Pe*g+Be*H,n[3]=de*o+Ae*u+Pe*m+Be*U,n[4]=(de=t[4])*i+(Ae=t[5])*a+(Pe=t[6])*h+(Be=t[7])*w,n[5]=de*r+Ae*l+Pe*p+Be*C,n[6]=de*s+Ae*c+Pe*g+Be*H,n[7]=de*o+Ae*u+Pe*m+Be*U,n[8]=(de=t[8])*i+(Ae=t[9])*a+(Pe=t[10])*h+(Be=t[11])*w,n[9]=de*r+Ae*l+Pe*p+Be*C,n[10]=de*s+Ae*c+Pe*g+Be*H,n[11]=de*o+Ae*u+Pe*m+Be*U,n[12]=(de=t[12])*i+(Ae=t[13])*a+(Pe=t[14])*h+(Be=t[15])*w,n[13]=de*r+Ae*l+Pe*p+Be*C,n[14]=de*s+Ae*c+Pe*g+Be*H,n[15]=de*o+Ae*u+Pe*m+Be*U,n}function FS(n,e,t){var o,a,l,c,u,h,p,g,m,w,C,H,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],u=e[4],h=e[5],p=e[6],g=e[7],m=e[8],w=e[9],C=e[10],H=e[11],n[0]=o=e[0],n[1]=a,n[2]=l,n[3]=c,n[4]=u,n[5]=h,n[6]=p,n[7]=g,n[8]=m,n[9]=w,n[10]=C,n[11]=H,n[12]=o*i+u*r+m*s+e[12],n[13]=a*i+h*r+w*s+e[13],n[14]=l*i+p*r+C*s+e[14],n[15]=c*i+g*r+H*s+e[15]),n}function kS(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 RU(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],u=e[9],h=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+u*i,n[6]=a*r+h*i,n[7]=l*r+p*i,n[8]=c*r-s*i,n[9]=u*r-o*i,n[10]=h*r-a*i,n[11]=p*r-l*i,n}function NU(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],u=e[5],h=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+u*i,n[2]=a*r+h*i,n[3]=l*r+p*i,n[4]=c*r-s*i,n[5]=u*r-o*i,n[6]=h*r-a*i,n[7]=p*r-l*i,n}function FU(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 LS(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 kU(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],u=c*i+a*s-l*r,h=c*r+l*i-o*s,p=c*s+o*r-a*i,g=-o*i-a*r-l*s;return n[0]=u*c+g*-o+h*-l-p*-a,n[1]=h*c+g*-a+p*-o-u*-l,n[2]=p*c+g*-l+u*-a-h*-o,n[3]=e[3],n}!function(){var n=new ya(4);ya!=Float32Array&&(n[0]=0,n[1]=0,n[2]=0,n[3]=0)}();const LU=[0,0,0,0],fce=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0],pce=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],gce=[0,0,0],mce=[0,0,0],_ce=PS(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=LU,l=LU,c=n.cameraPosition;const{geospatialOrigin:u,shaderCoordinateOrigin:h,offsetMode:p}=BU(n,e,t);return p&&(l=n.projectPosition(u||h),c=[c[0]-l[0],c[1]-l[1],c[2]-l[2]],l[3]=1,a=LS([],l,o),s=i||s,o=Pf([],r,s),o=Pf([],o,fce)),{viewMatrix:s,viewProjectionMatrix:o,projectionCenter:a,originCommon:l,cameraPosCommon:c,shaderCoordinateOrigin:h,geospatialOrigin:u}}(n,t,i),u=n.getDistanceScales(),h=[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:h,project_uDevicePixelRatio:e,project_uFocalDistance:p,project_uCommonUnitsPerMeter:u.unitsPerMeter,project_uCommonUnitsPerWorldUnit:u.unitsPerMeter,project_uCommonUnitsPerWorldUnit2:gce,project_uScale:n.scale,project_uViewProjectionMatrix:s,project_uCameraPosition:a};if(c){const m=n.getDistanceScales(c);switch(t){case ji.METER_OFFSETS:g.project_uCommonUnitsPerWorldUnit=m.unitsPerMeter,g.project_uCommonUnitsPerWorldUnit2=m.unitsPerMeter2;break;case ji.LNGLAT:case ji.LNGLAT_OFFSETS:g.project_uCommonUnitsPerWorldUnit=m.unitsPerDegree,g.project_uCommonUnitsPerWorldUnit2=m.unitsPerDegree2;break;case ji.CARTESIAN:g.project_uCommonUnitsPerWorldUnit=[1,1,m.unitsPerMeter[2]],g.project_uCommonUnitsPerWorldUnit2=[0,0,m.unitsPerMeter2[2]]}}return g});function BU(n,e,t=mce){let r,i=t,s=!0;switch(r=e===ji.LNGLAT_OFFSETS||e===ji.METER_OFFSETS?t:n.isGeospatial?[Math.fround(n.longitude),Math.fround(n.latitude),0]:null,n.projectionMode){case Kc.WEB_MERCATOR:(e===ji.LNGLAT||e===ji.CARTESIAN)&&(s=!1);break;case Kc.WEB_MERCATOR_AUTO_OFFSET:e===ji.LNGLAT?i=r:e===ji.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 wce extends bS{get ELEMENTS(){return Yu(!1),0}get RANK(){return Yu(!1),0}toString(){let e="[";if(Or.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 qn).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 function(n,e,t,i,r){var o,s=1/Math.tan(e/2);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)}(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],u=n[9],h=n[10],p=n[11],g=n[12],m=n[13],w=n[14],C=n[15];return(e*o-t*s)*(h*C-p*w)-(e*a-i*s)*(u*C-p*m)+(e*l-r*s)*(u*w-h*m)+(t*a-i*o)*(c*C-p*g)-(t*l-r*o)*(c*w-h*g)+(i*l-r*a)*(c*m-u*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 $I(this,this),this.check()}multiplyLeft(e){return Pf(this,e,this),this.check()}multiplyRight(e){return Pf(this,this,e),this.check()}rotateX(e){return RU(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],u=e[9],h=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-u*i,n[2]=a*r-h*i,n[3]=l*r-p*i,n[8]=s*i+c*r,n[9]=o*i+u*r,n[10]=a*i+h*r,n[11]=l*i+p*r}(this,this,e),this.check()}rotateZ(e){return NU(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,u,h,p,g,m,w,C,H,U,de,Ae,Pe,Be,et,wt,vt,Ct,Bt,$t,gt,mt,Vt,r=i[0],s=i[1],o=i[2],a=Math.hypot(r,s,o);at?t:n}const WI=Math.log2||function(n){return Math.log(n)*Math.LOG2E};function Xu(n,e){if(!n)throw new Error(e||"@math.gl/web-mercator: assertion failed.")}const gc=Math.PI,GU=gc/4,mc=gc/180,qI=180/gc,YI=4003e4,jS=85.051129;function VS([n,e]){return Xu(Number.isFinite(n)),Xu(Number.isFinite(e)&&e>=-90&&e<=90,"invalid latitude"),[512*(n*mc+gc)/(2*gc),512*(gc+Math.log(Math.tan(GU+e*mc*.5)))/(2*gc)]}function Zg([n,e]){const t=n/512*(2*gc)-gc,i=2*(Math.atan(Math.exp(e/512*(2*gc)-gc))-GU);return[t*qI,i*qI]}function KI({latitude:n,longitude:e,highPrecision:t=!1}){Xu(Number.isFinite(n)&&Number.isFinite(e));const i={},s=Math.cos(n*mc),o=512/360,a=o/s,l=512/YI/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=mc*Math.tan(n*mc)/s,h=512/YI*c,p=h/a*l;i.unitsPerDegree2=[0,o*c/2,h],i.unitsPerMeter2=[p,0,p]}return i}function $U(n,e){const[t,i,r]=n,[s,o,a]=e,{unitsPerMeter:l,unitsPerMeter2:c}=KI({longitude:t,latitude:i,highPrecision:!0}),u=VS(n);u[0]+=s*(l[0]+c[0]*o),u[1]+=o*(l[1]+c[1]*o);const h=Zg(u),p=(r||0)+(a||0);return Number.isFinite(r)||Number.isFinite(a)?[h[0],h[1],p]:h}function qU(n){return 2*Math.atan(.5/n)*qI}function YU(n,e){const[t,i,r=0]=n;return Xu(Number.isFinite(t)&&Number.isFinite(i)&&Number.isFinite(r)),Qg(e,[t,i,r,1])}function L0(n,e,t=0){const[i,r,s]=n;if(Xu(Number.isFinite(i)&&Number.isFinite(r),"invalid pixel coordinate"),Number.isFinite(s))return Qg(e,[i,r,s,1]);const o=Qg(e,[i,r,0,1]),a=Qg(e,[i,r,1,1]),l=o[2],c=a[2];return VU([],o,a,l===c?0:((t||0)-l)/(c-l))}const KU=Math.PI/180;function XU(n,e,t){const{pixelUnprojectionMatrix:i}=n,r=Qg(i,[e,0,1,1]),s=Qg(i,[e,n.height,1,1]),c=Zg(VU([],r,s,(t*n.distanceScales.unitsPerMeter[2]-r[2])/(s[2]-r[2])));return c[2]=t,c}const Bce=Math.PI/180,jce=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],QI=[0,0,0],Uce={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&&C0(t.projectionMatrix,this.projectionMatrix)&&C0(t.viewMatrix,this.viewMatrix))}project(t,{topLeft:i=!0}={}){const s=YU(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,u=L0([s,i?o:this.height-o,a],this.pixelUnprojectionMatrix,r&&r*this.distanceScales.unitsPerMeter[2]),[h,p,g]=this.unprojectPosition(u);return Number.isFinite(a)?[h,p,g]:Number.isFinite(r)?[h,p,r]:[h,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?VS(t):t}unprojectFlat(t){return this.isGeospatial?Zg(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?KI({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:u=!1,repeat:h=!1,worldOffset:p=0}=t;let{width:g,height:m,altitude:w=1.5}=t;const C=Math.pow(2,s);g=g||1,m=m||1,w=Math.max(.75,w);const{fov:H,aspect:U,focalDistance:de,near:Ae,far:Pe}=function({width:n,height:e,fovy:t=qU(1.5),altitude:i,pitch:r=0,nearZMultiplier:s=1,farZMultiplier:o=1}){void 0!==i&&(t=qU(i));const a=.5*t*mc,l=function(n){return.5/Math.tan(.5*n*mc)}(t),c=r*mc,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:n/e,focalDistance:l,near:s,far:(Math.sin(c)*u+l)*o}}({width:g,height:m,pitch:o,altitude:w,nearZMultiplier:l,farZMultiplier:c});let Be=function({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 FS(o,o,[0,0,-i]),RU(o,o,-e*mc),NU(o,o,t*mc),kS(o,o,[r/=n,r,r]),s&&FS(o,o,function(n,e){return n[0]=-e[0],n[1]=-e[1],n[2]=-e[2],n}([],s)),o}({height:m,pitch:o,bearing:a,scale:C,altitude:w});p&&(Be=(new qn).translate([512*p,0,0]).multiplyLeft(Be)),super(Cn(ot({},t),{width:g,height:m,viewMatrix:Be,longitude:r,latitude:i,zoom:s,orthographic:u,fovyRadians:H,aspect:U,focalDistance:de,near:Ae,far:Pe})),this.latitude=i,this.longitude=r,this.zoom=s,this.pitch=o,this.bearing=a,this.altitude=w,this.orthographic=u,this._subViewports=h?[]: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(Cn(ot({},this),{worldOffset:s})):this;this._subViewports.push(o)}}return this._subViewports}addMetersToLngLat(t,i){return $U(t,i)}panByPosition(t,i){const r=L0(i,this.pixelUnprojectionMatrix),o=BS([],this.projectFlat(t),jU([],r)),a=BS([],this.center,o),[l,c]=this.unprojectFlat(a);return{longitude:l,latitude:c}}getBounds(t={}){const i=function(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*KU:Math.atan(.5/n.altitude))>(90-n.pitch)*KU-.01?(l=XU(n,0,e),c=XU(n,t,e)):(l=r([0,0],s),c=r([t,0],s)),[o,a,c,l]}(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}=function({width:n,height:e,bounds:t,minExtent:i=0,maxZoom:r=24,padding:s=0,offset:o=[0,0]}){const[[a,l],[c,u]]=t;Number.isFinite(s)?s={top:s,bottom:s,left:s,right:s}:Xu(Number.isFinite(s.top)&&Number.isFinite(s.bottom)&&Number.isFinite(s.left)&&Number.isFinite(s.right));const h=VS([a,HU(u,-jS,jS)]),p=VS([c,HU(l,-jS,jS)]),g=[Math.max(Math.abs(p[0]-h[0]),i),Math.max(Math.abs(p[1]-h[1]),i)],m=[n-s.left-s.right-2*Math.abs(o[0]),e-s.top-s.bottom-2*Math.abs(o[1])];Xu(m[0]>0&&m[1]>0);const w=m[0]/g[0],C=m[1]/g[1],Ae=Zg([(p[0]+h[0])/2+(s.right-s.left)/2/w,(p[1]+h[1])/2+(s.bottom-s.top)/2/C]),Pe=Math.min(r,WI(Math.abs(Math.min(w,C))));return Xu(Number.isFinite(Pe)),{longitude:Ae[0],latitude:Ae[1],zoom:Pe}}(ot({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 ZI(n,e,t=!1){const i=e.projectPosition(n);if(t&&e instanceof tz){const[r,s,o=0]=n,a=e.getDistanceScales([r,s]);i[2]=o*a.unitsPerMeter[2]}return i}function nz(n,{viewport:e,modelMatrix:t,coordinateSystem:i,coordinateOrigin:r,offsetMode:s}){let[o,a,l=0]=n;switch(t&&([o,a,l]=LS([],[o,a,l,1],t)),i){case ji.LNGLAT:return ZI([o,a,l],e,s);case ji.LNGLAT_OFFSETS:return ZI([o+r[0],a+r[1],l+(r[2]||0)],e,s);case ji.METER_OFFSETS:return ZI($U(r,[o,a,l]),e,s);case ji.CARTESIAN:default:return e.isGeospatial?[o+r[0],a+r[1],l+r[2]]:e.projectPosition([o,a,l])}}const Gce={10241:9987,10240:9729,10242:33071,10243:33071},JI={},qce={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||j0(n)&&(3===n.length||4===n.length),equal:(n,e,t)=>eO(n,e)},accessor:{validate(n,e){const t=US(n);return"function"===t||t===US(e.value)},equal:(n,e,t)=>"function"==typeof e||eO(n,e)},array:{validate:(n,e)=>e.optional&&!n||j0(n),equal:(n,e,t)=>t.compare?eO(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 _a)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 _a(t,Cn(ot({},e),{parameters:ot(ot(ot({},Gce),i),n.props.textureParameters)}));return JI[r.id]=!0,r}(t,n),release:n=>{!function(n){!n||!(n instanceof _a)||JI[n.id]&&(n.delete(),delete JI[n.id])}(n)}}};function eO(n,e){if(n===e)return!0;if(!j0(n)||!j0(e))return!1;const t=n.length;if(t!==e.length)return!1;for(let i=0;i{},this.oldProps=oue,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[rue]||{},i=e[iue]||e,r=e[sue]||{};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(BV(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 oi(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 h,c=!0,u=!1;try{for(var g,m,p=nO(t);c=(g=yield p.next()).done,m=yield g.value,!c;c=!0){const C=m,{dataTransform:H}=i.component?i.component.props:{};a=H?H(C,a):a.concat(C),Object.defineProperty(a,"__diff",{enumerable:!1,value:[{startRow:l,endRow:a.length}]}),l=a.length,i._setAsyncPropValue(e,a,o)}}catch(C){u=!0,h=C}finally{try{!c&&null!=p.return&&(yield p.return())}finally{if(u)throw h}}const w=null===(r=i.layer)||void 0===r?void 0:r.props.onDataLoad;w&&w(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:oz,ASYNC_RESOLVED:az,ASYNC_DEFAULTS:aue}=NS,lue={};let cue=0,uue=(()=>{class n{constructor(){this.props=Xce.apply(this,arguments),this.id=this.props.id,this.count=cue++,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[aue])s in i[az]?r[s]=i[az][s]:s in i[oz]&&(r[s]=i[oz][s]);return new this.constructor(ot(ot(ot({},i),r),t))}get stats(){return this.internalState.stats}_initState(){this.internalState=new sz({})}}return n.componentName="Component",n.defaultProps=lue,n})();class due extends sz{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 _c=n=>"function"==typeof n,uh=n=>null!==n&&"object"==typeof n,cz=n=>uh(n)&&n.constructor==={}.constructor,hue=n=>n&&"function"==typeof n[Symbol.iterator],fue=n=>n&&"function"==typeof n[Symbol.asyncIterator],U0=n=>"undefined"!=typeof Response&&n instanceof Response||n&&n.arrayBuffer&&n.text&&n.json,em=n=>"undefined"!=typeof Blob&&n instanceof Blob,uz=n=>(n=>"undefined"!=typeof ReadableStream&&n instanceof ReadableStream||uh(n)&&_c(n.tee)&&_c(n.cancel)&&_c(n.getReader))(n)||(n=>uh(n)&&_c(n.read)&&_c(n.pipe)&&(n=>"boolean"==typeof n)(n.readable))(n);function Ff(n,e){if(!n)throw new Error(e||"loader assertion failed.")}function iO(n){var e;return!!n&&(Array.isArray(n)&&(n=n[0]),Array.isArray(null===(e=n)||void 0===e?void 0:e.extensions))}function rO(n){var e,t;let i;return Ff(n,"null loader"),Ff(iO(n),"invalid loader"),Array.isArray(n)&&(i=n[1],n=Cn(ot({},n=n[0]),{options:ot(ot({},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 Zc={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},sO=Zc.global||Zc.self||Zc.window||{},bue="object"!=typeof process||"[object process]"!==String(process)||process.browser,dz="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version);dz&&parseFloat(dz[1]);const aO={};function vue(n){for(const e in aO)n.startsWith(e)&&(n=n.replace(e,aO[e]));return!n.startsWith("http://")&&!n.startsWith("https://")&&(n=`${n}`),n}const wue=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,Eue=/^([-\w.]+\/[-\w.+]+)/;function Sue(n){const e=Eue.exec(n);return e?e[1]:n}function hz(n){const e=wue.exec(n);return e?e[1]:""}const xue=/\?.*/;function $S(n){if(U0(n)){const e=lO(n.url||"");return{url:e,type:Sue(n.headers.get("content-type")||"")||hz(e)}}return em(n)?{url:lO(n.name||""),type:n.type||""}:"string"==typeof n?{url:lO(n),type:hz(n)}:{url:"",type:""}}function Cue(n){return U0(n)?n.headers["content-length"]||-1:em(n)?n.size:"string"==typeof n?n.length:n instanceof ArrayBuffer||ArrayBuffer.isView(n)?n.byteLength:-1}function lO(n){return n.replace(xue,"")}function fz(n){return cO.apply(this,arguments)}function cO(){return(cO=oi(function*(n){if(U0(n))return n;const e={},t=Cue(n);t>=0&&(e["content-length"]=String(t));const{url:i,type:r}=$S(n);r&&(e["content-type"]=r);const s=yield Mue(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 Aue(n){return uO.apply(this,arguments)}function uO(){return(uO=oi(function*(n){if(!n.ok){const e=yield Tue(n);throw new Error(e)}})).apply(this,arguments)}function Tue(n){return dO.apply(this,arguments)}function dO(){return(dO=oi(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 Mue(n){return hO.apply(this,arguments)}function hO(){return(hO=oi(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,${Due(n.slice(0,5))}`:null})).apply(this,arguments)}function Due(n){let e="";const t=new Uint8Array(n);for(let i=0;i{}}info(){return()=>{}}warn(){return()=>{}}error(){return()=>{}}}const mz={fetch:null,mimeType:void 0,nothrow:!1,log:new class{constructor(){Kn(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:[]},Rue={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 pO(){sO.loaders=sO.loaders||{};const{loaders:n}=sO;return n._state=n._state||{},n._state}const gO=()=>{const n=pO();return n.globalOptions=n.globalOptions||ot({},mz),n.globalOptions};function Nue(n,e,t,i){return t=t||[],function(n,e){yz(n,null,mz,Rue,e);for(const t of e)yz(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=ot({},n.options||{});return function(n,e){e&&!("baseUri"in n)&&(n.baseUri=e)}(r,t),null===r.log&&(r.log=new Iue),vz(r,gO()),vz(r,e),r}(e,n,i)}function _z(n,e){const t=gO(),i=n||t;return"function"==typeof i.fetch?i.fetch:uh(i.fetch)?r=>pz(r,i):null!=e&&e.fetch?null==e?void 0:e.fetch:pz}function yz(n,e,t,i,r){const s=e||"Top level",o=e?`${e}.`:"";for(const a in n){const l=!e&&uh(n[a]),c="baseUri"===a&&!e,u="workerUrl"===a&&e;if(!(a in t)&&!c&&!u)if(a in i)gz.warn(`${s} loader option '${o}${a}' no longer supported, use '${i[a]}'`)();else if(!l){const h=Fue(a,r);gz.warn(`${s} loader option '${o}${a}' not recognized. ${h}`)()}}}function Fue(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 vz(n,e){for(const t in e)t in e&&(n[t]=cz(e[t])&&cz(n[t])?ot(ot({},n[t]),e[t]):e[t])}function Jc(n,e){if(!n)throw new Error(e||"loaders.gl assertion failed.")}function Bue(n,e="3.0.12"){return Jc(n,"no worker provided"),!(!e||!n.version)}const eu={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},jue=eu.global||eu.self||eu.window||{},mO="object"!=typeof process||"[object process]"!==String(process)||process.browser,_O="function"==typeof importScripts,Vue="undefined"!=typeof window&&void 0!==window.orientation,wz="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version),yO=(wz&&parseFloat(wz[1]),new Map);function Ez(n){const e=new Blob([n],{type:"application/javascript"});return URL.createObjectURL(e)}function Sz(n,e=!0,t){const i=t||new Set;if(n)if(xz(n))i.add(n);else if(xz(n.buffer))i.add(n.buffer);else if(!ArrayBuffer.isView(n)&&e&&"object"==typeof n)for(const r in n)Sz(n[r],e,i);return void 0===t?Array.from(i):[]}function xz(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 bO=()=>{};class Cz{static isSupported(){return"undefined"!=typeof Worker}constructor(e){Kn(this,"name",void 0),Kn(this,"source",void 0),Kn(this,"url",void 0),Kn(this,"terminated",!1),Kn(this,"worker",void 0),Kn(this,"onMessage",void 0),Kn(this,"onError",void 0),Kn(this,"_loadableURL","");const{name:t,source:i,url:r}=e;Jc(i||r),this.name=t,this.source=i,this.url=r,this.onMessage=bO,this.onError=s=>console.log(s),this.worker=this._createBrowserWorker()}destroy(){this.onMessage=bO,this.onError=bO,this.worker.terminate(),this.terminated=!0}get isRunning(){return Boolean(this.onMessage)}postMessage(e,t){t=t||Sz(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){Jc(n.source&&!n.url||!n.source&&n.url);let e=yO.get(n.source||n.url);return e||(n.url&&(e=function(n){return n.startsWith("http")?Ez(function(n){return`try {\n importScripts('${n}');\n} catch (error) {\n console.error(error);\n throw error;\n}`}(n)):n}(n.url),yO.set(n.url,e)),n.source&&(e=Ez(n.source),yO.set(n.source,e))),Jc(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 Gue{constructor(e,t){Kn(this,"name",void 0),Kn(this,"workerThread",void 0),Kn(this,"isRunning",void 0),Kn(this,"result",void 0),Kn(this,"_resolve",void 0),Kn(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){Jc(this.isRunning),this.isRunning=!1,this._resolve(e)}error(e){Jc(this.isRunning),this.isRunning=!1,this._reject(e)}}class $ue{constructor(e){Kn(this,"name","unnamed"),Kn(this,"source",void 0),Kn(this,"url",void 0),Kn(this,"maxConcurrency",1),Kn(this,"maxMobileConcurrency",1),Kn(this,"onDebug",()=>{}),Kn(this,"reuseWorkers",!0),Kn(this,"props",{}),Kn(this,"jobQueue",[]),Kn(this,"idleQueue",[]),Kn(this,"count",0),Kn(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=ot(ot({},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 oi(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 oi(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 Gue(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 Qu{static isSupported(){return Cz.isSupported()}static getWorkerFarm(e={}){return Qu._workerFarm=Qu._workerFarm||new Qu({}),Qu._workerFarm.setProps(e),Qu._workerFarm}constructor(e){Kn(this,"props",void 0),Kn(this,"workerPools",new Map),this.props=ot({},Wue),this.setProps(e),this.workerPools=new Map}destroy(){for(const e of this.workerPools.values())e.destroy()}setProps(e){this.props=ot(ot({},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 $ue({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 Yue(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 Jc(r),r}function Kue(n,e){return!!Qu.isSupported()&&n.worker&&(null==e?void 0:e.worker)}function Xue(n,e,t,i,r){return vO.apply(this,arguments)}function vO(){return(vO=oi(function*(n,e,t,i,r){const s=n.id,o=Yue(n,t),l=Qu.getWorkerFarm(t).getWorkerPool({name:s,url:o});t=JSON.parse(JSON.stringify(t));const c=yield l.startJob("process-on-worker",Que.bind(null,r));return c.postMessage("process",{input:e,options:t}),yield(yield c.result).result})).apply(this,arguments)}function Que(n,e,t,i){return wO.apply(this,arguments)}function wO(){return(wO=oi(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)}Kn(Qu,"_workerFarm",void 0);var Tz=Je(521);function Mz(n){if(function(n){return n&&"object"==typeof n&&n.isBuffer}(n)&&(n=function(n){return Tz.toArrayBuffer?Tz.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 tde(...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 Dz(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 nde(n){return SO.apply(this,arguments)}function SO(){return(SO=oi(function*(n){const e=[];var r,t=!0,i=!1;try{for(var o,a,s=nO(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 tde(...e)})).apply(this,arguments)}const sde=262144;function Iz(n){this.wrapped=n}function z0(n){return new Iz(n)}function H0(n){var e,t;function r(o,a){try{var l=n[o](a),c=l.value,u=c instanceof Iz;Promise.resolve(u?c.wrapped:c).then(function(h){u?r("return"===o?"return":"next",h):s(l.done?"return":"normal",h)},function(h){r("throw",h)})}catch(h){s("throw",h)}}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 u={key:o,arg:a,resolve:l,reject:c,next:null};t?t=t.next=u:(e=t=u,r(o,a))})},"function"!=typeof n.return&&(this.return=void 0)}function CO(n){return function(){return new H0(n.apply(this,arguments))}}function AO(){return(AO=CO(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(DO)}function fde(n,e,t){return IO.apply(this,arguments)}function IO(){return(IO=oi(function*(n,e,t){const i=n instanceof ArrayBuffer||ArrayBuffer.isView(n);if("string"==typeof n||i)return hde(n,e);if(em(n)&&(n=yield fz(n)),U0(n)){const r=n;return yield Aue(r),e.binary?yield r.arrayBuffer():yield r.text()}if(uz(n)&&(n=dde(n,t)),hue(n)||fue(n))return nde(n);throw new Error(DO)})).apply(this,arguments)}function gde(n,e,t=null){if(t)return t;const i=ot({fetch:_z(e,n)},n);return Array.isArray(i.loaders)||(i.loaders=null),i}function mde(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 Rz=()=>{const n=pO();return n.loaderRegistry=n.loaderRegistry||[],n.loaderRegistry};function Nz(n){const e=Rz();n=Array.isArray(n)?n:[n];for(const t of n){const i=rO(t);e.find(r=>i===r)||e.unshift(i)}}const yde=/\.([^.]+)$/;function bde(n){return NO.apply(this,arguments)}function NO(){return(NO=oi(function*(n,e=[],t,i){if(!Fz(n))return null;let r=Pz(n,e,Cn(ot({},t),{nothrow:!0}),i);if(r)return r;if(em(n)&&(r=Pz(n=yield n.slice(0,10).arrayBuffer(),e,t,i)),!(r||null!=t&&t.nothrow))throw new Error(kz(n));return r})).apply(this,arguments)}function Pz(n,e=[],t,i){if(!Fz(n))return null;if(e&&!Array.isArray(e))return rO(e);let r=[];e&&(r=r.concat(e)),null!=t&&t.ignoreRegisteredLoaders||r.push(...Rz()),function(n){for(const e of n)rO(e)}(r);const s=function(n,e,t,i){const{url:r,type:s}=$S(n),o=r||(null==i?void 0:i.url);let a=null;return null!=t&&t.mimeType&&(a=PO(e,null==t?void 0:t.mimeType)),a=a||function(n,e){const t=e&&yde.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||PO(e,s),a=a||function(n,e){if(!e)return null;for(const t of n)if("string"==typeof e){if(Cde(e,t))return t}else if(ArrayBuffer.isView(e)){if(Lz(e.buffer,e.byteOffset,t))return t}else if(e instanceof ArrayBuffer&&Lz(e,0,t))return t;return null}(e,n),a=a||PO(e,null==t?void 0:t.fallbackMimeType),a}(n,r,t,i);if(!(s||null!=t&&t.nothrow))throw new Error(kz(n));return s}function Fz(n){return!(n instanceof Response&&204===n.status)}function kz(n){const{url:e,type:t}=$S(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)?FO(n.buffer,n.byteOffset,e):n instanceof ArrayBuffer?FO(n,0,e):""}(n)}", contentType: "${t}"`),e&&(i+=` url: ${e}`),i}function PO(n,e){for(const t of n)if(t.mimeTypes&&t.mimeTypes.includes(e)||e===`application/x.${t.id}`)return t;return null}function Cde(n,e){return e.testText?e.testText(n):(Array.isArray(e.tests)?e.tests:[e.tests]).some(i=>n.startsWith(i))}function Lz(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 tu=new Uint8ClampedArray(0);const kde={data:{type:"data",value:Pde,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=Cn(ot({},r),{fetch:Cn(ot({},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:G0(n,i),persistent:!1}),l=!0),l?o.subscribe({resourceId:n,onChange:c=>t.internalState.reloadAsyncProp(e,c),consumerId:t.id,requestId:e}):G0(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:ji.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 $0=(()=>{class n extends uue{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=nz(t,{viewport:i,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem}),[s,o,a]=YU(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=ot({},n);let{coordinateSystem:t}=n;const{viewport:i,coordinateOrigin:r,fromCoordinateSystem:s,fromCoordinateOrigin:o}=n;return t===ji.DEFAULT&&(t=i.isGeospatial?ji.LNGLAT:ji.CARTESIAN),void 0===s&&(e.fromCoordinateSystem=t),void 0===o&&(e.fromCoordinateOrigin=r),e.coordinateSystem=t,e}(e),{geospatialOrigin:l,shaderCoordinateOrigin:c,offsetMode:u}=BU(t,i,r),h=nz(n,{viewport:t,modelMatrix:s,coordinateSystem:o,coordinateOrigin:a,offsetMode:u});u&&function(n,e,t){n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2]}(h,h,t.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===ji.DEFAULT||t===ji.LNGLAT||t===ji.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){pc(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=zle(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 u of c)o.invalidateAll(u);else o.invalidateAll()}const l=i.highlightedObjectIndex>=0||i.pickable;if((t.highlightedObjectIndex>=0||t.pickable)!==l&&o){const{pickingColors:c,instancePickingColors:u}=o.attributes,h=c||u;h&&(l&&h.constant&&(h.constant=!1,o.invalidate(h.id)),!h.value&&!l&&(h.constant=!0,h.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||!Fde({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(tu.length/3);if(this.internalState.usesPickingColorCache=!0,rBz&&Ri.warn("Layer has too many data objects. Picking might not be able to distinguish all objects.")(),tu=x0.allocate(tu,i,{size:3,copy:!0,maxCount:Math.max(i,Bz)});const s=Math.floor(tu.length/3),o=[];for(let a=r;a{const c={moduleParameters:t,uniforms:i,parameters:r,context:this.context};for(const u of this.props.extensions)u.draw.call(this,c,u);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&&To("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=IU({newProps:n,oldProps:e,propTypes:GI(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&&OU(n,e,"all"))return{all:!0};const t={};let i=!1;for(const r in n.updateTriggers)"all"!==r&&OU(n,e,r)&&(t[r]=!0,i=t);return i}(n,e)),{dataChanged:i,propsChanged:t,updateTriggersChanged:r,extensionsChanged:Fle(n,e),transitionsChanged:Rle(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=GI(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 Sle(this.context.gl,{id:this.props.id,stats:this.context.stats,timeline:this.context.timeline})}_initState(){pc(!this.internalState&&!this.state),pc(isFinite(this.props.coordinateSystem));const t=this._getAttributeManager();t&&t.addInstanced({instancePickingColors:{type:5121,size:3,noAlloc:!0,update:this.calculateInstancePickingColors}}),this.internalState=new due({attributeManager:t,layer:this}),this.clearChangeFlags(),this.state={},Object.defineProperty(this.state,"attributeManager",{get:()=>(Ri.deprecated("layer.state.attributeManager","layer.getAttributeManager()"),t)}),this.internalState.layer=this,this.internalState.uniformTransitions=new Mle(this.context.timeline),this.internalState.onAsyncPropUpdated=this._onAsyncPropUpdated.bind(this),this.internalState.setAsyncProps(this.props)}_transferState(t){To("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=kde,n})(),jz=(()=>{class n extends $0{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:u,coordinateSystem:h,coordinateOrigin:p,wrapLongitude:g,positionFormat:m,modelMatrix:w,extensions:C,fetch:H,_subLayerProps:U}=this.props,de={opacity:i,pickable:r,visible:s,parameters:o,getPolygonOffset:a,highlightedObjectIndex:l,autoHighlight:c,highlightColor:u,coordinateSystem:h,coordinateOrigin:p,wrapLongitude:g,positionFormat:m,modelMatrix:w,extensions:C,fetch:H},Ae=U&&U[t.id],Pe=Ae&&Ae.updateTriggers,Be=t.id||"sublayer";if(Ae){const et=this.constructor._propTypes,wt=t.type?t.type._propTypes:{};for(const vt in Ae){const Ct=wt[vt]||et[vt];Ct&&"accessor"===Ct.type&&(Ae[vt]=this.getSubLayerAccessor(Ae[vt]))}}Object.assign(de,t,Ae),de.id="".concat(this.props.id,"-").concat(Be),de.updateTriggers=ot(ot({all:this.props.updateTriggers.all},t.updateTriggers),Pe);for(const et of C){const wt=et.getSubLayerProps.call(this,et);wt&&Object.assign(de,wt,{updateTriggers:Object.assign(de.updateTriggers,wt.updateTriggers)})}return de}_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=EI(t,Boolean),this.internalState.subLayers=t),To("compositeLayer.renderLayers",this,i,t);for(const r of t)r.parent=this}}return n.layerName="CompositeLayer",n})();const Bde=/([0-9]+\.?[0-9]*)(%|px)/;function qS(n){switch(typeof n){case"number":return{position:n,relative:!1};case"string":const e=n.match(Bde);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 YS(n,e){return n.relative?Math.round(n.position*e):n.position}function W0(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)&&W0(i,r)))return!1}return!0}class jO{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:u=1e3,modelMatrix:h=null,viewportInstance:p=null,type:g=Jg}=e;pc(!p||p instanceof Jg),this.viewportInstance=p,this.id=t||this.constructor.displayName||"view",this.type=g,this.props=Cn(ot({},e),{id:this.id,projectionMatrix:a,fovy:l,near:c,far:u,modelMatrix:h}),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):W0(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=ot({},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:YS(this._x,e),y:YS(this._y,t),width:YS(this._width,e),height:YS(this._height,t)}}_getControllerProps(e){let t=this.props.controller;return t?!0===t?e:("function"==typeof t&&(t={type:t}),ot(ot({},e),t)):null}_getViewport(e,t){const{type:i}=this;return new i(ot(ot(ot({},e),this.props),t))}_parseDimensions({x:e,y:t,width:i,height:r}){this._x=qS(e),this._y=qS(t),this._width=qS(i),this._height=qS(r)}}const q0=()=>{},Vz={transitionEasing:n=>n,transitionInterruption:1,onTransitionStart:q0,onTransitionInterrupt:q0,onTransitionEnd:q0};class jde{constructor(e,t={}){this.ControllerState=e,this.props=ot(ot({},Vz),t),this.propsInTransition=null,this.transition=new F0(t.timeline),this.onViewStateChange=t.onViewStateChange||q0,this.onStateChange=t.onStateChange||q0,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=ot(ot({},Vz),e),this.props=e,this._shouldIgnoreViewportChange(i,e))return t;if(this._isTransitionEnabled(e)){const{interruption:r,endProps:s}=this.transition.settings,o=ot(ot({},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(ot(ot({},this.props),c)).getViewportProps(),this.onViewStateChange({viewState:this.propsInTransition,oldViewState:this.props})}}const Uz=["longitude","latitude","zoom","bearing","pitch"],Ude=["longitude","latitude","zoom"];class zz 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)||!C0(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];pc(Number.isFinite(i)||Array.isArray(i),"".concat(t," is required for transition"))})}}{constructor(e={}){super((Array.isArray(e)?e:e.transitionProps)||{compare:Uz,extract:Uz,required:Ude}),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]=yS(e[s]||0,t[s]||0,i);if(t.aroundPosition){const s=this.opts.makeViewport(ot(ot({},t),r));Object.assign(r,s.panByPosition(t.aroundPosition,yS(e.around,t.around,i)))}return r}}const dh={transitionDuration:0},zde={transitionDuration:300,transitionEasing:n=>n,transitionInterruption:1},XS=n=>1-(1-n)*(1-n),tm_WHEEL=["wheel"],tm_PAN=["panstart","panmove","panend"],tm_PINCH=["pinchstart","pinchmove","pinchend"],tm_TRIPLE_PAN=["tripanstart","tripanmove","tripanend"],tm_DOUBLE_TAP=["doubletap"],tm_KEYBOARD=["keydown"];class VO{constructor(e,t={}){this.ControllerState=e,this.controllerState=null,this.controllerStateProps=null,this.eventManager=null,this.transitionManager=new jde(e,Cn(ot({},t),{onViewStateChange:this._onTransition.bind(this),onStateChange:this._setInteractionState.bind(this)}));const i=this.linearTransitionProps;this._transition=i&&Cn(ot({},zde),{transitionInterpolator:new zz({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(ot(ot({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,u=Boolean(this.onViewStateChange);this.toggleEvents(tm_WHEEL,u&&i),this.toggleEvents(tm_PAN,u&&(r||s)),this.toggleEvents(tm_PINCH,u&&(a||l)),this.toggleEvents(tm_TRIPLE_PAN,u&&l),this.toggleEvents(tm_DOUBLE_TAP,u&&o),this.toggleEvents(tm_KEYBOARD,u&&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=ot(ot({},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,dh,{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,dh,{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,Cn(ot({},this._getTransitionProps()),{transitionDuration:t,transitionEasing:XS}),{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,dh,{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,Cn(ot({},this._getTransitionProps()),{transitionDuration:t,transitionEasing:XS}),{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,Cn(ot({},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,dh,{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,dh,{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,Cn(ot({},this._getTransitionProps()),{transitionDuration:t,transitionEasing:XS}),{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,dh,{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,dh,{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,Cn(ot({},this._getTransitionProps({around:r})),{transitionDuration:t,transitionEasing:XS}),{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?Cn(ot({},t),{transitionInterpolator:new zz(Cn(ot({},e),{transitionProps:this.linearTransitionProps,makeViewport:this.controllerState.makeViewport}))}):t:dh}}class Hz{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 hh_target=[0,0,0];class QS extends Hz{constructor({makeViewport:e,width:t,height:i,rotationX:r=0,rotationOrbit:s=0,target:o=hh_target,zoom:a=0,minRotationX:l=-90,maxRotationX:c=90,minZoom:u=-(1/0),maxZoom:h=Infinity,startPanPosition:p,startRotatePos:g,startRotationX:m,startRotationOrbit:w,startZoomPosition:C,startZoom:H}){super({width:t,height:i,rotationX:r,rotationOrbit:s,target:o,zoom:a,minRotationX:l,maxRotationX:c,minZoom:u,maxZoom:h}),this._state={startPanPosition:p,startRotatePos:g,startRotationX:m,startRotationOrbit:w,startZoomPosition:C,startZoom:H},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 u=(e[0]-r[0])/a;(s<-90||s>90)&&(u*=-1),c={rotationX:s+(e[1]-r[1])/l*180,rotationOrbit:o+180*u}}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=ot({},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(Cn(ot({},this._viewportProps),{zoom:a}));return this._getUpdatedState(ot({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),Va(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 QS(ot(ot(ot({},this._viewportProps),this._state),e))}_applyConstraints(e){const{maxZoom:t,minZoom:i,zoom:r,maxRotationX:s,minRotationX:o,rotationOrbit:a}=e;return e.zoom=Va(r,i,t),e.rotationX=Va(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 Gde extends VO{constructor(e){super(QS,e)}get linearTransitionProps(){return["target","zoom","rotationX","rotationOrbit"]}}class $de extends VO{constructor(e){e.dragMode=e.dragMode||"pan",super(QS,e)}_onPanRotate(e){return!1}get linearTransitionProps(){return["target","zoom"]}}const Wde=(new qn).lookAt({eye:[0,0,1]});function qde({width:n,height:e,near:t,far:i}){return n=n||1,e=e||1,(new qn).ortho({left:-n/2,right:n/2,bottom:-e/2,top:e/2,near:t,far:i})}class Yde 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(Cn(ot({},e),{longitude:null,position:a,viewMatrix:Wde.clone().scale([c,c*(l?-1:1),c]),projectionMatrix:qde({width:t,height:i,near:r,far:s}),zoom:o}))}panByPosition(e,t){const r=BS([],e,jU([],L0(t,this.pixelUnprojectionMatrix)));return{target:BS([],this.center,r)}}}let Kde=(()=>{class n extends jO{constructor(t){super(Cn(ot({},t),{type:Yde}))}get controller(){return this._getControllerProps({type:$de})}}return n.displayName="OrthographicView",n})();const ZS=Math.PI/180;function Xde({height:n,fovy:e,orbitAxis:t,rotationX:i,rotationOrbit:r,zoom:s}){const o=.5/Math.tan(e*ZS/2),a="Z"===t?[0,0,1]:[0,1,0],l="Z"===t?[0,-o,0]:[0,0,o],c=(new qn).lookAt({eye:l,up:a});c.rotateX(i*ZS),"Z"===t?c.rotateZ(r*ZS):c.rotateY(r*ZS);const u=Math.pow(2,s)/(n||1);return c.scale(u),c}class Qde 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(Cn(ot({},e),{longitude:null,viewMatrix:Xde({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]=L0([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 Zde=(()=>{class n extends jO{constructor(t={}){const{orbitAxis:i="Z"}=t;super(Cn(ot({},t),{orbitAxis:i,type:Qde}))}get controller(){return this._getControllerProps({type:Gde})}}return n.displayName="OrbitView",n})();const Jde=[255,255,255],ehe=1;let the=0;class Gz{constructor(e={}){const{color:t=Jde}=e,{intensity:i=ehe}=e;this.id=e.id||"ambient-".concat(the++),this.color=t,this.intensity=i,this.type="ambient"}}const nhe=[255,255,255],ihe=1,rhe=[0,0,-1];let she=0;class $z{constructor(e={}){const{color:t=nhe}=e,{intensity:i=ihe}=e,{direction:r=rhe}=e,{_shadow:s=!1}=e;this.id=e.id||"directional-".concat(she++),this.color=t,this.intensity=i,this.type="directional",this.direction=new Ao(r).normalize().toArray(),this.shadow=s}getProjectedLight(){return this}}class Wz{constructor(e={}){const{id:t="effect"}=e;this.id=t,this.props=ot({},e)}preRender(){}getModuleParameters(){}cleanup(){}}class UO extends class{constructor(e,t={}){const{id:i="pass"}=t;this.id=i,this.gl=e,this.props=ot({},t)}setProps(e){Object.assign(this.props,e)}render(){}cleanup(){}}{render(e){return $u(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){$u(n,{viewport:[0,0,n.drawingBufferWidth,n.drawingBufferHeight]}),n.clear(16640)}(o);const a=[];for(const l of t){const c=l.viewport||l,u=i&&i[c.id];r(c);const h=this._getDrawLayerParams(c,e);e.view=u;const p=c.subViewports||[c];for(const g of p){e.viewport=g;const m=this._drawLayersInViewport(o,e,h);a.push(m)}}return a}_getDrawLayerParams(e,{layers:t,pass:i,layerFilter:r,effects:s,moduleParameters:o}){const a=[],l=qz(),c={viewport:e,isPicking:i.startsWith("picking"),renderPass:i};for(let u=0;uhI(e,c))}const l={totalCount:t.length,visibleCount:0,compositeCount:0,pickableCount:0};$u(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 u=t[l]=t[l]||qz(e[l],e);c=u(r,s),t[a]=u}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 che extends UO{constructor(e,t){super(e,t),this.shadowMap=new _a(e,{width:1,height:1,parameters:{10241:9729,10240:9729,10242:33071,10243:33071}}),this.depthBuffer=new zg(e,{format:33189,width:1,height:1}),this.fbo=new Fs(e,{id:"shadowmap",width:1,height:1,attachments:{36064:this.shadowMap,36096:this.depthBuffer}})}render(e){const t=this.fbo;fc(this.gl,{depthRange:[0,1],depthTest:!0,blend:!1,clearColor:[1,1,1,1]},()=>{const i=e.viewports[0],r=jg(this.gl),s=i.width*r,o=i.height*r;(s!==t.width||o!==t.height)&&t.resize({width:s,height:o}),super.render(Cn(ot({},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 dhe=Object.keys(ji).map(n=>"const int COORDINATE_SYSTEM_".concat(n," = ").concat(ji[n],";")).join(""),hhe=Object.keys(Kc).map(n=>"const int PROJECTION_MODE_".concat(n," = ").concat(Kc[n],";")).join(""),fhe="".concat(dhe,"\n").concat(hhe,"\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"),phe={},zO={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:fhe,getUniforms:function(n=phe){return n.viewport?function({viewport:n,devicePixelRatio:e=1,modelMatrix:t=null,coordinateSystem:i=ji.DEFAULT,coordinateOrigin:r,autoWrapLongitude:s=!1}={}){i===ji.DEFAULT&&(i=n.isGeospatial?ji.LNGLAT:ji.CARTESIAN);const o=_ce({viewport:n,devicePixelRatio:e,coordinateSystem:i,coordinateOrigin:r});return o.project_uWrapLongitude=s,o.project_uModelMatrix=t||pce,o}(n):{}}},yhe=PS(function({viewport:n,center:e}){return new qn(n.viewProjectionMatrix).invert().transform(e)}),bhe=PS(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=L0([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 Ao(n.center).negate()),l=s.map(u=>a.transform(u)),c=(new qn).ortho({left:Math.min(...l.map(u=>u[0])),right:Math.max(...l.map(u=>u[0])),bottom:Math.min(...l.map(u=>u[1])),top:Math.max(...l.map(u=>u[1])),near:Math.min(...l.map(u=>-u[2])),far:Math.max(...l.map(u=>-u[2]))});t.push(c.multiplyRight(o))}return t}),vhe=[0,0,0,1],whe=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0],HO={name:"shadow",dependencies:[zO],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||vhe,shadow_uLightId:n.shadowLightId||0,shadow_uLightCount:n.shadowMatrices.length},i=yhe({viewport:n.viewport,center:e.project_uCenter}),r=[],s=bhe({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{}}},Ahe={color:[255,255,255],intensity:1},Yz=[{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 GO extends Wz{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=N0.getDefaultProgramManager(e),HO&&this.programManager.addDefaultModule(HO)),this.dummyShadowMap||(this.dummyShadowMap=new _a(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(HO),this.programManager=null)}_createLightMatrix(){const e=[];for(const t of this.directionalLights){const i=(new qn).lookAt({eye:new Ao(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=Dhe++;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 Ihe{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=G0(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 Ohe{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 Ihe(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 Rhe=[{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"},zO],Nhe=["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 Phe(n){const e=N0.getDefaultProgramManager(n);for(const t of Rhe)e.addDefaultModule(t);for(const t of Nhe)e.addShaderHook(t);return e}const Lhe=Object.seal({layerManager:null,resourceManager:null,deck:null,gl:null,stats:null,shaderCache:null,pickingFBO:null,mousePosition:null,userData:{}});class Bhe{constructor(e,{deck:t,stats:i,viewport:r,timeline:s}={}){this.lastRenderedLayers=[],this.layers=[],this.resourceManager=new Ohe({gl:e,protocol:"deck://"}),this.context=Cn(ot({},Lhe),{layerManager:this,gl:e,deck:t,programManager:e&&Phe(e),stats:i||new sI({id:"deck.gl"}),viewport:r||new Jg({id:"DEFAULT-INITIAL-VIEWPORT"}),timeline:s||new Kz,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){To("layerManager.setLayers",this,t,e),this.lastRenderedLayers=e,e=EI(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 To("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]?Ri.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&&Ri.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 jhe{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=EI(e,Boolean),this._diffViews(e,this.views)&&this.setNeedsUpdate("views changed"),this.views=e}_setViewState(e){e?(!W0(e,this.viewState)&&this.setNeedsUpdate("viewState changed"),this.viewState=e):Ri.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)(ot({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=Cn(ot(ot(ot({},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 u=r[a.id];a.controller&&!u&&(s=!0),(s||!a.controller)&&u&&(u.finalize(),u=null),this.controllers[a.id]=this._updateController(a,l,c,u),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 Uhe extends Hz{constructor({makeViewport:e,width:t,height:i,latitude:r,longitude:s,zoom:o,bearing:a=0,pitch:l=0,altitude:c=1.5,maxZoom:u=20,minZoom:h=0,maxPitch:p=60,minPitch:g=0,startPanLngLat:m,startZoomLngLat:w,startRotatePos:C,startBearing:H,startPitch:U,startZoom:de,normalize:Ae}={}){pc(Number.isFinite(s)),pc(Number.isFinite(r)),pc(Number.isFinite(o)),super({width:t,height:i,latitude:r,longitude:s,zoom:o,bearing:a,pitch:l,altitude:c,maxZoom:u,minZoom:h,maxPitch:p,minPitch:g,normalize:Ae}),this._state={startPanLngLat:m,startZoomLngLat:w,startRotatePos:C,startBearing:H,startPitch:U,startZoom:de},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(Cn(ot({},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(Cn(ot({},this._viewportProps),{zoom:o}));return this._getUpdatedState(ot({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=ot({},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(ot(ot(ot({makeViewport:this.makeViewport},this._viewportProps),this._state),e))}_applyConstraints(e){const{maxZoom:t,minZoom:i,zoom:r}=e;e.zoom=Va(r,i,t);const{maxPitch:s,minPitch:o,pitch:a}=e;e.pitch=Va(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=zU(t+180,360)-180),(o<-180||o>180)&&(o=zU(o+180,360)-180);const a=WI(e/512);if(r<=a)r=a,i=0;else{const l=e/2/Math.pow(2,r),c=Zg([0,l])[1];if(iu&&(i=u)}}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 Va(t+Math.log2(e),r,i)}_calculateNewPitchAndBearing({deltaScaleX:e,deltaScaleY:t,startBearing:i,startPitch:r}){t=Va(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 u=0;return r>0?Math.abs(l-o)>5&&(u=r/(o-l)*1.2):r<0&&o>5&&(u=1-s/o),u=Math.min(1,Math.max(-1,u)),{deltaScaleX:c,deltaScaleY:u}}}class zhe extends VO{constructor(e){e.dragMode=e.dragMode||"pan",super(Uhe,e)}setProps(e){const t=this.controllerStateProps;super.setProps(e),(!t||t.height!==e.height)&&this.updateViewport(new this.ControllerState(ot(ot({makeViewport:this.makeViewport},this.controllerStateProps),this._state)))}get linearTransitionProps(){return["longitude","latitude","zoom","bearing","pitch"]}}let Hhe=(()=>{class n extends jO{constructor(t){super(Cn(ot({},t),{type:tz}))}get controller(){return this._getControllerProps({type:zhe})}}return n.displayName="MapView",n})();const Ghe=new GO;class $he{constructor(){this.effects=[],this._internalEffects=[],this._needsRedraw="Initial render",this.setEffects()}setProps(e){"effects"in e&&(e.effects.length!==this.effects.length||!W0(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 GO)||this._internalEffects.push(Ghe)}}class Whe extends UO{}const Qz={blendFunc:[1,0,32771,0],blendEquation:32774};class Zz extends UO{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:u},pass:h="picking",redrawReason:p,pickZ:g}){const m=this.gl;return this.pickZ=g,fc(m,Cn(ot({scissorTest:!0,scissor:[a,l,c,u],clearColor:[0,0,0,0],depthMask:!0,depthTest:!0,depthRange:[0,1],colorMask:[!0,!0,!0,!0]},Qz),{blend:!g}),()=>{super.render({target:o,layers:e,layerFilter:t,views:i,viewports:r,onViewportActive:s,pass:h,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}:Cn(ot({},Qz),{blend:!0,blendColor:[0,0,0,this.useAlpha?(t+1)/255:1]});return ot(ot({},e.props.parameters),i)}}class Yhe{constructor(e){this.gl=e,this.layerFilter=null,this.drawPickingColors=!1,this.drawLayersPass=new Whe(e),this.pickLayersPass=new Zz(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||Fs.getDefaultFramebuffer(this.gl),this._preRender(e.effects,e);const i=this.lastPostProcessEffect?this.renderBuffers[0]:e.target,r=t.render(Cn(ot({},e),{target:i}));this._postRender(e.effects,e),this.renderCount++,To("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 Fs(this.gl),new Fs(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 Khe={pickedColor:null,pickedLayer:null,pickedObjectIndex:-1};function Xhe({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 u=r*r,h=-1,p=0;for(let g=0;gu)p+=4*l;else for(let C=0;C=0){const U=C+o-t,de=U*U+w;de<=u&&(u=de,h=p)}p+=4}}if(h>=0){const g=n[h+3]-1,m=n.slice(h,h+4),w=e[g];if(w){const C=w.decodePickingColor(m),H=Math.floor(h/4/l);return{pickedColor:m,pickedLayer:w,pickedObjectIndex:C,pickedX:o+(h/4-H*l),pickedY:a+H}}Ri.error("Picked non-existent layer. Is picking buffer corrupt?")()}}return Khe}function Jz({pickInfo:n,mode:e,viewports:t,layerFilter:i,pixelRatio:r,x:s,y:o,z:a}){const l=n&&n.pickedLayer,u=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)}))),h=u&&u.unproject([s-u.x,o-u.y],{targetZ:a});return{color:null,layer:null,viewport:u,index:-1,picked:!1,x:s,y:o,pixel:[s,o],coordinate:h,devicePixel:n&&[n.pickedX,n.pickedY],pixelRatio:r}}function Zhe(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 h=t.index,p=t.layerId,g=o&&o.props.id;if(g!==p||a!==h){if(g!==p){const m=r.find(w=>w.props.id===p);m&&l.unshift(m)}t.layerId=g,t.index=a,t.info=null}}const c=Jz(n),u=new Map;return u.set(null,c),l.forEach(h=>{let p=ot({},c);h===o&&(p.color=s,p.index=a,p.picked=!0),p=e4({layer:h,info:p,mode:i}),h===o&&"hover"===i&&(t.info=p),u.set(p.layer.id,p),"hover"===i&&p.layer.updateAutoHighlight(p)}),u}function e4({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 efe{constructor(e){this.gl=e,this.pickingFBO=null,this.pickLayersPass=new Zz(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],u=c&&c.unproject([e-c.x,t-c.y]),h={x:e,y:t,viewport:c,coordinate:u,layer:l};return l?ot(ot({},s),h):Object.assign(h,{color:null,object:null,index:-1})}_resizeBuffer(){const{gl:e}=this;return this.pickingFBO||(this.pickingFBO=new Fs(e),Fs.isSupported(e,{colorBufferFloat:!0})&&(this.depthFBO=new Fs(e),this.depthFBO.attach({36064:new _a(e,{format:Si(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?(Ri.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:u}){if(!(e=this._getPickable(e)))return{result:[],emptyInfo:Jz({viewports:i,x:r,y:s})};this._resizeBuffer();const h=jg(this.gl),p=nI(this.gl,[r,s],!0),g=[p.x+Math.floor(p.width/2),p.y+Math.floor(p.height/2)],m=Math.round(o*h),{width:w,height:C}=this.pickingFBO,H=this._getPickingRect({deviceX:g[0],deviceY:g[1],deviceRadius:m,deviceWidth:w,deviceHeight:C});let U;const de=[],Ae={};for(let Pe=0;Pe=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)}):Ri.error("Picked non-existent layer. Is picking buffer corrupt?")()}}}return Array.from(t.values())}({pickedColors:this._drawAndSample({layers:e,views:t,viewports:i,onViewportActive:u,deviceRect:{x:g,y:H,width:w.x+w.width-g,height:m-H},pass:"picking:".concat(l),redrawReason:l}),layers:e}),Pe=new Map,Be=Number.isFinite(c);for(let et=0;et=c);et++){const wt=Ae[et];let vt={color:wt.pickedColor,layer:null,index:wt.pickedObjectIndex,picked:!0,x:r,y:s,width:o,height:a,pixelRatio:h};vt=e4({layer:wt.pickedLayer,info:vt,mode:l}),Pe.has(vt.object)||Pe.set(vt.object,vt)}return Array.from(Pe.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:u,y:h,width:p,height:g}=s,m=new(l?Float32Array:Uint8Array)(p*g*4);return _S(c,{sourceX:u,sourceY:h,sourceWidth:p,sourceHeight:g,target:m}),m}_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 tfe={zIndex:1,position:"absolute",pointerEvents:"none",color:"#a0a7b4",backgroundColor:"#29323c",padding:"10px",top:0,left:0,display:"none"};class nfe{constructor(e){const t=e.parentElement;t&&(this.el=document.createElement("div"),this.el.className="deck-tooltip",Object.assign(this.el.style,tfe),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 t4(n,e){if(!n)throw new Error(e)}const nu={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},n4=nu.global||nu.self||nu.window,rfe="object"!=typeof process||"[object process]"!==String(process)||process.browser,i4="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version),{_parseImageNode:sfe}=(i4&&parseFloat(i4[1]),n4),$O="undefined"!=typeof Image,WO="undefined"!=typeof ImageBitmap,ofe=Boolean(sfe),qO=!!rfe||ofe;function r4(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 s4(n){switch(r4(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 cfe=/^data:image\/svg\+xml/,ufe=/\.svg((\?|#).*)?$/;function YO(n){return n&&(cfe.test(n)||ufe.test(n))}function dfe(n,e){if(YO(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 a4(n,e)}function a4(n,e){if(YO(e))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(n)])}function l4(n,e,t){return KO.apply(this,arguments)}function KO(){return(KO=oi(function*(n,e,t){const i=dfe(n,t),r=self.URL||self.webkitURL,s="string"!=typeof i&&r.createObjectURL(i);try{return yield hfe(s||i,e)}finally{s&&r.revokeObjectURL(s)}})).apply(this,arguments)}function hfe(n,e){return XO.apply(this,arguments)}function XO(){return(XO=oi(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 ffe={};let c4=!0;function pfe(n,e,t){return QO.apply(this,arguments)}function QO(){return(QO=oi(function*(n,e,t){let i;i=YO(t)?yield l4(n,e,t):a4(n,t);const r=e&&e.imagebitmap;return yield gfe(i,r)})).apply(this,arguments)}function gfe(n){return ZO.apply(this,arguments)}function ZO(){return(ZO=oi(function*(n,e=null){if((mfe(e)||!c4)&&(e=null),e)try{return yield createImageBitmap(n,e)}catch(t){console.warn(t),c4=!1}return yield createImageBitmap(n)})).apply(this,arguments)}function mfe(n){for(const e in n||ffe)return!1;return!0}const iu=!1,Y0=!0;function JO(n){const e=K0(n);return function(n){const e=K0(n);return e.byteLength>=24&&2303741511===e.getUint32(0,iu)?{mimeType:"image/png",width:e.getUint32(16,iu),height:e.getUint32(20,iu)}:null}(e)||function(n){const e=K0(n);if(!(e.byteLength>=3&&65496===e.getUint16(0,iu)&&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,iu)?{mimeType:"image/gif",width:e.getUint16(6,Y0),height:e.getUint16(8,Y0)}:null}(e)||function(n){const e=K0(n);return e.byteLength>=14&&16973===e.getUint16(0,iu)&&e.getUint32(2,Y0)===e.byteLength?{mimeType:"image/bmp",width:e.getUint32(18,Y0),height:e.getUint32(22,Y0)}:null}(e)}function K0(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 Efe(n,e){const{mimeType:t}=JO(n)||{},{_parseImageNode:i}=n4;return t4(i),i(n,t,e)}function eR(){return(eR=oi(function*(n,e,t){const r=((e=e||{}).image||{}).type||"auto",{url:s}=t||{};let a;switch(xfe(r)){case"imagebitmap":a=yield pfe(n,e,s);break;case"image":a=yield l4(n,e,s);break;case"data":a=yield Efe(n,e);break;default:t4(!1)}return"data"===r&&(a=s4(a)),a})).apply(this,arguments)}function xfe(n){switch(n){case"auto":case"data":return function(){if(WO)return"imagebitmap";if($O)return"image";if(qO)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}();default:return function(n){switch(n){case"auto":return WO||$O||qO;case"imagebitmap":return WO;case"image":return $O;case"data":return qO;default:throw new Error(`@loaders.gl/images: image ${n} not supported in this environment`)}}(n),n}}const tR={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 eR.apply(this,arguments)},tests:[n=>Boolean(JO(new DataView(n)))],options:{image:{type:"auto",decode:!0}}};var nm=Je(761);const Afe={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},X0="8.5.8",JS=nm.CO.deck&&nm.CO.deck.VERSION;if(JS&&JS!==X0)throw new Error("deck.gl - multiple versions detected: ".concat(JS," vs ").concat(X0));JS||(Ri.log(1,"deck.gl ".concat(X0))(),nm.CO.deck=Object.assign(nm.CO.deck||{},{VERSION:X0,version:X0,log:Ri,_registerLoggers:function(n){AI=n}}),Nz([Afe,[tR,{imagebitmap:{premultiplyAlpha:"none"}}]]));const Tfe=nm.CO.deck;class ex extends Wu{get[Symbol.toStringTag](){return"Query"}static isSupported(e,t=[]){const i=Si(e),r=vV(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 ex.isSupported(this.gl)?this.gl2.createQuery():null}_deleteHandle(){this.gl2.deleteQuery(this.handle)}}const u4=mS()&&"undefined"!=typeof document;let Lfe=0;class Bfe{constructor(e={}){const{onCreateContext:t=(C=>eV(C)),onAddHTML:i=null,onInitialize:r=(()=>{}),onRender:s=(()=>{}),onFinalize:o=(()=>{}),onError:a,gl:l=null,glOptions:c={},debug:u=!1,createFramebuffer:h=!1,autoResizeViewport:p=!0,autoResizeDrawingBuffer:g=!0,stats:m=If.get("animation-loop-"+Lfe++)}=e;let{useDevicePixels:w=!0}=e;"useDevicePixelRatio"in e&&(mn.deprecated("useDevicePixelRatio","useDevicePixels")(),w=e.useDevicePixelRatio),this.props={onCreateContext:t,onAddHTML:i,onInitialize:r,onRender:s,onFinalize:o,onError:a,gl:l,glOptions:c,debug:u,createFramebuffer:h},this.gl=l,this.needsRedraw=null,this.timeline=null,this.stats=m,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:w}),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=ex.isSupported(this.gl,["timers"])?new ex(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 oi(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 mn.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=u4?new Promise((e,t)=>{u4&&"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?rI(this.props.gl,e):this.onCreateContext(e),!pS(this.gl))throw new Error("AnimationLoop.onCreateContext - illegal context returned");(function(n){$u(n,tI)})(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)&&(mn.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)&&(mn.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 Fs(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 jfe=Je(524),tx=Je.n(jfe);const Vfe={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}))}}(tx().MouseInput);const Gfe=tx().Manager,ru=tx(),$fe=ru?[[ru.Pan,{event:"tripan",pointers:3,threshold:0,enable:!1}],[ru.Rotate,{enable:!1}],[ru.Pinch,{enable:!1}],[ru.Swipe,{enable:!1}],[ru.Pan,{threshold:0,enable:!1}],[ru.Press,{enable:!1}],[ru.Tap,{event:"doubletap",taps:2,enable:!1}],[ru.Tap,{event:"anytap",enable:!1}],[ru.Tap,{enable:!1}]]:null,f4={tripan:["rotate","pinch","pan"],rotate:["pinch"],pinch:["pan"],pan:["press","doubletap","anytap","tap"],doubletap:["anytap"],anytap:["tap"]},Wfe={doubletap:["tap"]},qfe={pointerdown:"pointerdown",pointermove:"pointermove",pointerup:"pointerup",touchstart:"pointerdown",touchmove:"pointermove",touchend:"pointerup",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup"},iR={KEY_EVENTS:["keydown","keyup"],MOUSE_EVENTS:["mousedown","mousemove","mouseup","mouseover","mouseout","mouseleave"],WHEEL_EVENTS:["wheel","mousewheel"]},Yfe={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"},p4={click:"tap",anyclick:"anytap",dblclick:"doubletap",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup",mouseover:"pointerover",mouseout:"pointerout",mouseleave:"pointerleave"},Kfe="undefined"!=typeof navigator&&navigator.userAgent?navigator.userAgent.toLowerCase():"",im="undefined"!=typeof window?window:global;"undefined"!=typeof global?global:window,"undefined"!=typeof document&&document;let g4=!1;try{const n={get passive(){return g4=!0,!0}};im.addEventListener("test",n,n),im.removeEventListener("test",n,n)}catch(n){}const Xfe=-1!==Kfe.indexOf("firefox"),{WHEEL_EVENTS:Qfe}=iR,_4=4.000244140625;class epe{constructor(e,t,i={}){this.element=e,this.callback=t,this.options=Object.assign({enable:!0},i),this.events=Qfe.concat(i.events||[]),this.handleEvent=this.handleEvent.bind(this),this.events.forEach(r=>e.addEventListener(r,this.handleEvent,!!g4&&{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;im.WheelEvent&&(Xfe&&e.deltaMode===im.WheelEvent.DOM_DELTA_PIXEL&&(t/=im.devicePixelRatio),e.deltaMode===im.WheelEvent.DOM_DELTA_LINE&&(t*=40));const i={x:e.clientX,y:e.clientY};0!==t&&t%_4==0&&(t=Math.floor(t/_4)),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:tpe}=iR,y4="pointermove",b4="pointerover",v4="pointerout",w4="pointerleave";class npe{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=tpe.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===y4&&(this.enableMoveEvent=t),e===b4&&(this.enableOverEvent=t),e===v4&&(this.enableOutEvent=t),e===w4&&(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:b4,srcEvent:e,pointerType:"mouse",target:e.target})}handleOutEvent(e){this.enableOutEvent&&"mouseout"===e.type&&this.callback({type:v4,srcEvent:e,pointerType:"mouse",target:e.target})}handleLeaveEvent(e){this.enableLeaveEvent&&"mouseleave"===e.type&&this.callback({type:w4,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:y4,srcEvent:e,pointerType:"mouse",target:e.target});break;case"mouseup":this.pressed=!1}}}const{KEY_EVENTS:ipe}=iR,E4="keydown";class rpe{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=ipe.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===E4&&(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:E4,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 x4="contextmenu";class spe{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===x4&&(this.options.enable=t)}handleEvent(e){!this.options.enable||this.callback({type:x4,center:{x:e.clientX,y:e.clientY},srcEvent:e,pointerType:"mouse",target:e.target})}}const ope={pointerdown:1,pointermove:2,pointerup:4,mousedown:1,mousemove:2,mouseup:4},C4={srcElement:"root",priority:0};class ype{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({},C4,i):C4;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 u=l.length-1;for(;u>=0&&!(l[u].priority>=c.priority);)u--;l.splice(u+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&&f4[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 epe(e,this._onOtherEvent,{enable:!1}),this.moveInput=new npe(e,this._onOtherEvent,{enable:!1}),this.keyInput=new rpe(e,this._onOtherEvent,{enable:!1,tabIndex:t.tabIndex}),this.contextmenuInput=new spe(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=Wfe[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 u in e)this._addEventHandler(u,e[u],i,r,s);return}const{manager:o,events:a}=this,l=p4[e]||e;let c=a.get(l);c||(c=new ype(this),a.set(l,c),c.recognizerName=Yfe[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(p4[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=qfe[t.type];i&&this.manager.emit(i,e)}_onOtherEvent(e){this.manager.emit(e.type,e)}}function Lf(){}const A4={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:Lf,onResize:Lf,onViewStateChange:Lf,onInteractionStateChange:Lf,onBeforeRender:Lf,onAfterRender:Lf,onLoad:Lf,onError:(n,e)=>Ri.error(n)(),_onMetrics:null,getCursor:({isDragging:n})=>n?"grabbing":"grab",debug:!1,drawPickingColors:!1};class ix{constructor(e){e=ot(ot({},A4),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&&Ri.warn("View state tracking is disabled. Use either `initialViewState` for auto update or `viewState` for manual update.")(),"IE"===(0,nm.qs)()&&Ri.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 sI({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&&x0.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&&Ri.removed("onLayerHover","onHover")(),"onLayerClick"in e&&Ri.removed("onLayerClick","onClick")(),e.initialViewState&&!W0(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](ot({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),pc(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:u,autoResizeDrawingBuffer:h}=e;return new Bfe({width:t,height:i,useDevicePixels:u,autoResizeDrawingBuffer:h,autoResizeViewport:!1,gl:r,onCreateContext:p=>eV(Cn(ot(ot({},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 Hhe({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,rI(e,{enable:!0,copyState:!0})),this.tooltip=new nfe(this.canvas),$u(e,{blend:!0,blendFunc:[770,771,1,771],polygonOffsetFill:!0,depthTest:!0,depthFunc:515}),this.props.onWebGLInitialized(e);const t=new Kz;t.play(),this.animationLoop.attachTimeline(t),this.eventManager=new vpe(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 Bj)this.eventManager.on(r,this._onEvent);this.viewManager=new jhe({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 Bhe(e,{deck:this,stats:this.stats,viewport:i,timeline:t}),this.effectManager=new $he,this.deckRenderer=new Yhe(e),this.deckPicker=new efe(e),this.setProps(this.props),this._updateCanvasSize(),this.props.onLoad()}_drawLayers(e,t){const{gl:i}=this.layerManager.context;$u(i,this.props.parameters),this.props.onBeforeRender({gl:i}),this.deckRenderer.renderLayers(ot({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(),Ri.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=Cn(ot({},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=Bj[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=If.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}}ix.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(Wz)),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}},ix.defaultProps=A4,ix.VERSION=Tfe.VERSION;const rx={name:"project32",dependencies:[zO],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"},xpe={pickingSelectedColor:null,pickingHighlightColor:new Uint8Array([0,255,255,255]),pickingActive:!1,pickingAttribute:!1},sx=ot({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=xpe){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}}),T4={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6};class fh{static get DRAW_MODE(){return T4}constructor(e={}){const{id:t=ga("geometry"),drawMode:i=T4.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?ot({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 M4=()=>{},Ipe={10241:9987,10240:9729,10242:33071,10243:33071};function Ope(n){return Math.pow(2,Math.ceil(Math.log2(n)))}function Rpe(n,e,t,i){return t===e.width&&i===e.height?e:(n.canvas.height=i,n.canvas.width=t,n.clearRect(0,0,n.canvas.width,n.canvas.height),n.drawImage(e,0,0,e.width,e.height,0,0,t,i),n.canvas)}function Q0(n){return n&&(n.id||n.url)}function D4(n,e,t){for(let i=0;i0){const{mapping:i,xOffset:r,yOffset:s,rowHeight:o,canvasHeight:a}=function({icons:n,buffer:e,mapping:t={},xOffset:i=0,yOffset:r=0,rowHeight:s=0,canvasWidth:o}){let a=[];for(let l=0;lo&&(D4(t,a,r),i=0,r=s+r+e,s=0,a=[]),a.push({icon:c,xOffset:i}),i=i+p+e,s=Math.max(s,h)}}return a.length>0&&D4(t,a,r),{mapping:t,rowHeight:s,xOffset:i,yOffset:r,canvasWidth:o,canvasHeight:Ope(s+r+e)}}({icons:t,buffer:this._buffer,canvasWidth:this._canvasWidth,mapping:this._mapping,rowHeight:this._rowHeight,xOffset:this._xOffset,yOffset:this._yOffset});this._rowHeight=o,this._mapping=i,this._xOffset=r,this._yOffset=s,this._canvasHeight=a,this._texture||(this._texture=new _a(this.gl,{width:this._canvasWidth,height:this._canvasHeight,parameters:Ipe})),this._texture.height!==this._canvasHeight&&(this._texture=function(n,e,t,i){const r=e.width,s=e.height,o=_V(e,{width:t,height:i});return function(n,e,t={}){const{sourceX:i=0,sourceY:r=0,targetMipmaplevel:s=0,targetInternalFormat:o=6408}=t;let{targetX:a,targetY:l,targetZ:c,width:u,height:h}=t;const{framebuffer:p,deleteFramebuffer:g}=S0(n);tn(p);const{gl:m,handle:w}=p,C=void 0!==a||void 0!==l||void 0!==c;a=a||0,l=l||0,c=c||0;const H=m.bindFramebuffer(36160,w);tn(e);let U=null;if(e instanceof Of&&(U=e,u=Number.isFinite(u)?u:U.width,h=Number.isFinite(h)?h:U.height,U.bind(0),e=U.target),C)switch(e){case 3553:case 34067:m.copyTexSubImage2D(e,s,a,l,i,r,u,h);break;case 35866:case 32879:Co(m).copyTexSubImage3D(e,s,a,l,c,i,r,u,h)}else m.copyTexImage2D(e,s,o,i,r,u,h,0);U&&U.unbind(),m.bindFramebuffer(36160,H||null),g&&p.delete()}(e,o,{targetY:0,width:r,height:s}),e.delete(),o}(0,this._texture,this._canvasWidth,this._canvasHeight)),this.onUpdate(),this._loadIcons(t)}}_loadIcons(e){const t=this._canvas.getContext("2d");for(const i of e)this._pendingCount++,G0(i.url,tR,this._loadOptions).then(r=>{const s=Q0(i),{x:o,y:a,width:l,height:c}=this._mapping[s],u=Rpe(t,r,l,c);this._texture.setSubImageData({data:u,x:o,y:a,width:l,height:c}),this._texture.generateMipmap(),this.onUpdate()}).catch(r=>{this.onError({url:i.url,source:i.source,sourceIndex:i.sourceIndex,loadOptions:this._loadOptions,error:r})}).finally(()=>{this._pendingCount--})}}const I4=[0,0,0,255],Lpe={iconAtlas:{type:"image",value:null,async:!0},iconMapping:{type:"object",value:{},async:!0},sizeScale:{type:"number",value:1,min:0},billboard:!0,sizeUnits:"pixels",sizeMinPixels:{type:"number",min:0,value:0},sizeMaxPixels:{type:"number",min:0,value:Number.MAX_SAFE_INTEGER},alphaCutoff:{type:"number",value:.05,min:0,max:1},getPosition:{type:"accessor",value:n=>n.position},getIcon:{type:"accessor",value:n=>n.icon},getColor:{type:"accessor",value:I4},getSize:{type:"accessor",value:1},getAngle:{type:"accessor",value:0},getPixelOffset:{type:"accessor",value:[0,0]},onIconError:{type:"function",value:null,compare:!1,optional:!0}};let Bpe=(()=>{class n extends $0{getShaders(){return super.getShaders({vs:"#define SHADER_NAME icon-layer-vertex-shader\n\nattribute vec2 positions;\n\nattribute vec3 instancePositions;\nattribute vec3 instancePositions64Low;\nattribute float instanceSizes;\nattribute float instanceAngles;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\nattribute vec4 instanceIconFrames;\nattribute float instanceColorModes;\nattribute vec2 instanceOffsets;\nattribute vec2 instancePixelOffset;\n\nuniform float sizeScale;\nuniform vec2 iconsTextureDim;\nuniform float sizeMinPixels;\nuniform float sizeMaxPixels;\nuniform bool billboard;\n\nvarying float vColorMode;\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\nvarying vec2 uv;\n\nvec2 rotate_by_angle(vec2 vertex, float angle) {\n float angle_radian = angle * PI / 180.0;\n float cos_angle = cos(angle_radian);\n float sin_angle = sin(angle_radian);\n mat2 rotationMatrix = mat2(cos_angle, -sin_angle, sin_angle, cos_angle);\n return rotationMatrix * vertex;\n}\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n geometry.uv = positions;\n geometry.pickingColor = instancePickingColors;\n uv = positions;\n\n vec2 iconSize = instanceIconFrames.zw;\n float sizePixels = clamp(\n project_size_to_pixel(instanceSizes * sizeScale), \n sizeMinPixels, sizeMaxPixels\n );\n float instanceScale = iconSize.y == 0.0 ? 0.0 : sizePixels / iconSize.y;\n vec2 pixelOffset = positions / 2.0 * iconSize + instanceOffsets;\n pixelOffset = rotate_by_angle(pixelOffset, instanceAngles) * instanceScale;\n pixelOffset += instancePixelOffset;\n pixelOffset.y *= -1.0;\n\n if (billboard) {\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, vec3(0.0), geometry.position);\n vec3 offset = vec3(pixelOffset, 0.0);\n DECKGL_FILTER_SIZE(offset, geometry);\n gl_Position.xy += project_pixel_size_to_clipspace(offset.xy);\n\n } else {\n vec3 offset_common = vec3(project_pixel_size(pixelOffset), 0.0);\n DECKGL_FILTER_SIZE(offset_common, geometry);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, offset_common, geometry.position); \n }\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n vTextureCoords = mix(\n instanceIconFrames.xy,\n instanceIconFrames.xy + iconSize,\n (positions.xy + 1.0) / 2.0\n ) / iconsTextureDim;\n\n vColor = instanceColors;\n DECKGL_FILTER_COLOR(vColor, geometry);\n\n vColorMode = instanceColorModes;\n}\n",fs:"#define SHADER_NAME icon-layer-fragment-shader\n\nprecision highp float;\n\nuniform float opacity;\nuniform sampler2D iconsTexture;\nuniform float alphaCutoff;\n\nvarying float vColorMode;\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\nvarying vec2 uv;\n\nvoid main(void) {\n geometry.uv = uv;\n\n vec4 texColor = texture2D(iconsTexture, vTextureCoords);\n vec3 color = mix(texColor.rgb, vColor.rgb, vColorMode);\n float a = texColor.a * opacity * vColor.a;\n\n if (a < alphaCutoff) {\n discard;\n }\n\n gl_FragColor = vec4(color, a);\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:[rx,sx]})}initializeState(){this.state={iconManager:new kpe(this.context.gl,{onUpdate:this._onUpdate.bind(this),onError:this._onError.bind(this)})},this.getAttributeManager().addInstanced({instancePositions:{size:3,type:5130,fp64:this.use64bitPositions(),transition:!0,accessor:"getPosition"},instanceSizes:{size:1,transition:!0,accessor:"getSize",defaultValue:1},instanceOffsets:{size:2,accessor:"getIcon",transform:this.getInstanceOffset},instanceIconFrames:{size:4,accessor:"getIcon",transform:this.getInstanceIconFrame},instanceColorModes:{size:1,type:5121,accessor:"getIcon",transform:this.getInstanceColorMode},instanceColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:!0,accessor:"getColor",defaultValue:I4},instanceAngles:{size:1,transition:!0,accessor:"getAngle"},instancePixelOffset:{size:2,transition:!0,accessor:"getPixelOffset"}})}updateState({oldProps:t,props:i,changeFlags:r}){super.updateState({props:i,oldProps:t,changeFlags:r});const s=this.getAttributeManager(),{iconAtlas:o,iconMapping:a,data:l,getIcon:c}=i,{iconManager:u}=this.state;u.setProps({loadOptions:i.loadOptions});let h=!1;if(o||this.internalState.isAsyncPropLoading("iconAtlas")?(t.iconAtlas!==i.iconAtlas&&u.setProps({iconAtlas:o,autoPacking:!1}),t.iconMapping!==i.iconMapping&&(u.setProps({iconMapping:a}),h=!0)):u.setProps({autoPacking:!0}),(r.dataChanged||r.updateTriggersChanged&&(r.updateTriggersChanged.all||r.updateTriggersChanged.getIcon))&&u.setProps({data:l,getIcon:c}),h&&(s.invalidate("instanceOffsets"),s.invalidate("instanceIconFrames"),s.invalidate("instanceColorModes")),r.extensionsChanged){var g;const{gl:m}=this.context;null===(g=this.state.model)||void 0===g||g.delete(),this.state.model=this._getModel(m),s.invalidateAll()}}get isLoaded(){return super.isLoaded&&this.state.iconManager.isLoaded}finalizeState(){super.finalizeState(),this.state.iconManager.finalize()}draw({uniforms:t}){const{sizeScale:i,sizeMinPixels:r,sizeMaxPixels:s,sizeUnits:o,billboard:a,alphaCutoff:l}=this.props,{iconManager:c}=this.state,{viewport:u}=this.context,h=c.getTexture();h&&this.state.model.setUniforms(t).setUniforms({iconsTexture:h,iconsTextureDim:[h.width,h.height],sizeScale:i*("pixels"===o?u.metersPerPixel:1),sizeMinPixels:r,sizeMaxPixels:s,billboard:a,alphaCutoff:l}).draw()}_getModel(t){return new Yg(t,Cn(ot({},this.getShaders()),{id:this.props.id,geometry:new fh({drawMode:6,attributes:{positions:{size:2,value:new Float32Array([-1,-1,-1,1,1,1,1,-1])}}}),isInstanced:!0}))}_onUpdate(){this.setNeedsRedraw()}_onError(t){const{onIconError:i}=this.getCurrentLayer().props;i?i(t):Ri.error(t.error)()}getInstanceOffset(t){const i=this.state.iconManager.getIconMapping(t);return[i.width/2-i.anchorX||0,i.height/2-i.anchorY||0]}getInstanceColorMode(t){return this.state.iconManager.getIconMapping(t).mask?1:0}getInstanceIconFrame(t){const i=this.state.iconManager.getIconMapping(t);return[i.x||0,i.y||0,i.width||0,i.height||0]}}return n.layerName="IconLayer",n.defaultProps=Lpe,n})();const R4=[],Vpe={getIconOffsets:{type:"accessor",value:n=>n.offsets},alphaCutoff:.001,smoothing:.1,outlineWidth:0,outlineColor:{type:"color",value:[0,0,0,255]}};let Upe=(()=>{class n extends Bpe{getShaders(){return Cn(ot({},super.getShaders()),{fs:"#define SHADER_NAME multi-icon-layer-fragment-shader\n\nprecision highp float;\n\nuniform float opacity;\nuniform sampler2D iconsTexture;\nuniform float gamma;\nuniform bool sdf;\nuniform float alphaCutoff;\nuniform float buffer;\nuniform float outlineBuffer;\nuniform vec4 outlineColor;\n\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\nvarying vec2 uv;\n\nvoid main(void) {\n geometry.uv = uv;\n\n if (!picking_uActive) {\n float alpha = texture2D(iconsTexture, vTextureCoords).a;\n vec4 color = vColor;\n if (sdf) {\n float distance = alpha;\n alpha = smoothstep(buffer - gamma, buffer + gamma, distance);\n\n if (outlineBuffer > 0.0) {\n float inFill = alpha;\n float inBorder = smoothstep(outlineBuffer - gamma, outlineBuffer + gamma, distance);\n color = mix(outlineColor, vColor, inFill);\n alpha = inBorder;\n }\n }\n float a = alpha * color.a;\n \n if (a < alphaCutoff) {\n discard;\n }\n\n gl_FragColor = vec4(color.rgb, a * opacity);\n }\n\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n"})}initializeState(){super.initializeState(),this.getAttributeManager().addInstanced({instanceOffsets:{size:2,accessor:"getIconOffsets"},instancePickingColors:{type:5121,size:3,accessor:(i,{index:r,target:s})=>this.encodePickingColor(r,s)}})}updateState(t){super.updateState(t);const{props:i,oldProps:r}=t;let{outlineColor:s}=i;s!==r.outlineColor&&(s=s.map(o=>o/255),s[3]=Number.isFinite(s[3])?s[3]:1,this.setState({outlineColor:s})),!i.sdf&&i.outlineWidth&&Ri.warn("".concat(this.id,": fontSettings.sdf is required to render outline"))()}draw(t){const{sdf:i,smoothing:r,outlineWidth:s}=this.props,{outlineColor:o}=this.state;t.uniforms=Cn(ot({},t.uniforms),{buffer:.75,outlineBuffer:s?Math.max(r,.75*(1-s)):-1,gamma:r,sdf:Boolean(i),outlineColor:o}),super.draw(t)}getInstanceOffset(t){return t?Array.from(t).map(i=>super.getInstanceOffset(i)):R4}getInstanceColorMode(t){return 1}getInstanceIconFrame(t){return t?Array.from(t).map(i=>super.getInstanceIconFrame(i)):R4}}return n.layerName="MultiIconLayer",n.defaultProps=Vpe,n})();var zpe=Je(2),Hpe=Je.n(zpe);const $pe=[];function Wpe(n){return Math.pow(2,Math.ceil(Math.log2(n)))}function N4(n,e,t,i){let r=0;for(let s=e;si&&(oa){let h=N4(n,a,l,r);c+h>i&&(oi&&(h=P4(n,a,l,i,r,s),o=s[s.length-1])),a=l,c+=h}}(n,r,s,t,i,o),o}function Xpe(n,e,t,i,r,s){let o=0,a=0;for(let l=e;l0,u=[0,0],h=[];let p=0,g=0,m=0;for(let w=0;w<=s;w++){const C=n[w];if(("\n"===C||w===s)&&(m=w),m>g){const H=c?Kpe(n,t,i,r,g,m):$pe;for(let U=0;U<=H.length;U++){const de=0===U?g:H[U-1],Ae=Ui===e);t>=0&&this._order.splice(t,1)}_appendOrder(e){this._order.push(e)}}(3),nge=["fontFamily","fontWeight","characterSet","fontSize","sdf","buffer","cutoff","radius"];function rge(n,e){for(let t=0;t{o in e&&(this.props[o]=e[o])});const t=this._key;this._key=this._getKey();const i=function(n,e){const t=oR.get(n);if(!t)return e;const i=[];let s=Object.keys(t.mapping);s=new Set(s);let o=e;return o instanceof Array&&(o=new Set(o)),o.forEach(a=>{s.has(a)||i.push(a)}),i}(this._key,this.props.characterSet),r=oR.get(this._key);if(r&&0===i.length)return void(this._key!==t&&(this._atlas=r));const s=this._generateFontAtlas(this._key,i,r);this._atlas=s,oR.set(this._key,s)}_generateFontAtlas(e,t,i){const{fontFamily:r,fontWeight:s,fontSize:o,buffer:a,sdf:l,radius:c,cutoff:u}=this.props;let h=i&&i.data;h||(h=document.createElement("canvas"),h.width=1024);const p=h.getContext("2d");$4(p,r,o,s);const{mapping:g,canvasHeight:m,xOffset:w,yOffset:C}=function({characterSet:n,getFontWidth:e,fontHeight:t,buffer:i,maxCanvasWidth:r,mapping:s={},xOffset:o=0,yOffset:a=0}){let l=0,c=o,u=0;for(const p of n)if(!s[p]){const g=e(p,u++);c+g+2*i>r&&(c=0,l++),s[p]={x:c+i,y:a+l*(t+2*i)+i,width:g,height:t},c+=g+2*i}const h=t+2*i;return{mapping:s,xOffset:c,yOffset:a+l*h,canvasHeight:Wpe(a+(l+1)*h)}}(ot({getFontWidth:H=>p.measureText(H).width,fontHeight:1.2*o,buffer:a,characterSet:t,maxCanvasWidth:1024},i&&{mapping:i.mapping,xOffset:i.xOffset,yOffset:i.yOffset}));if(h.height!==m){const H=p.getImageData(0,0,h.width,h.height);h.height=m,p.putImageData(H,0,0)}if($4(p,r,o,s),l){const H=new(Hpe())(o,a,c,u,r,s),U=p.getImageData(0,0,H.size,H.size);for(const de of t)rge(H.draw(de),U),p.putImageData(U,g[de].x-a,g[de].y+a)}else for(const H of t)p.fillText(H,g[H].x,g[H].y+.9*o);return{xOffset:w,yOffset:C,mapping:g,data:h,width:h.width,height:h.height}}_getKey(){const{fontFamily:e,fontWeight:t,fontSize:i,buffer:r,sdf:s,radius:o,cutoff:a}=this.props;return s?"".concat(e," ").concat(t," ").concat(i," ").concat(r," ").concat(o," ").concat(a):"".concat(e," ").concat(t," ").concat(i," ").concat(r)}}const lge={billboard:!0,sizeScale:1,sizeUnits:"pixels",sizeMinPixels:0,sizeMaxPixels:Number.MAX_SAFE_INTEGER,padding:{type:"array",value:[0,0,0,0]},getPosition:{type:"accessor",value:n=>n.position},getSize:{type:"accessor",value:1},getAngle:{type:"accessor",value:0},getPixelOffset:{type:"accessor",value:[0,0]},getBoundingRect:{type:"accessor",value:[0,0,0,0]},getFillColor:{type:"accessor",value:[0,0,0,255]},getLineColor:{type:"accessor",value:[0,0,0,255]},getLineWidth:{type:"accessor",value:1}};let cge=(()=>{class n extends $0{getShaders(){return super.getShaders({vs:"#define SHADER_NAME text-background-layer-vertex-shader\n\nattribute vec2 positions;\n\nattribute vec3 instancePositions;\nattribute vec3 instancePositions64Low;\nattribute vec4 instanceRects;\nattribute float instanceSizes;\nattribute float instanceAngles;\nattribute vec2 instancePixelOffsets;\nattribute float instanceLineWidths;\nattribute vec4 instanceFillColors;\nattribute vec4 instanceLineColors;\nattribute vec3 instancePickingColors;\n\nuniform bool billboard;\nuniform float opacity;\nuniform float sizeScale;\nuniform float sizeMinPixels;\nuniform float sizeMaxPixels;\nuniform vec4 padding;\n\nvarying vec4 vFillColor;\nvarying vec4 vLineColor;\nvarying float vLineWidth;\nvarying vec2 uv;\nvarying vec2 dimensions;\n\nvec2 rotate_by_angle(vec2 vertex, float angle) {\n float angle_radian = radians(angle);\n float cos_angle = cos(angle_radian);\n float sin_angle = sin(angle_radian);\n mat2 rotationMatrix = mat2(cos_angle, -sin_angle, sin_angle, cos_angle);\n return rotationMatrix * vertex;\n}\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n geometry.uv = positions;\n geometry.pickingColor = instancePickingColors;\n uv = positions;\n vLineWidth = instanceLineWidths;\n float sizePixels = clamp(\n project_size_to_pixel(instanceSizes * sizeScale),\n sizeMinPixels, sizeMaxPixels\n );\n\n dimensions = instanceRects.zw * sizePixels + padding.xy + padding.zw;\n\n vec2 pixelOffset = (positions * instanceRects.zw + instanceRects.xy) * sizePixels + mix(-padding.xy, padding.zw, positions);\n pixelOffset = rotate_by_angle(pixelOffset, instanceAngles);\n pixelOffset += instancePixelOffsets;\n pixelOffset.y *= -1.0;\n\n if (billboard) {\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, vec3(0.0), geometry.position);\n vec3 offset = vec3(pixelOffset, 0.0);\n DECKGL_FILTER_SIZE(offset, geometry);\n gl_Position.xy += project_pixel_size_to_clipspace(offset.xy);\n } else {\n vec3 offset_common = vec3(project_pixel_size(pixelOffset), 0.0);\n DECKGL_FILTER_SIZE(offset_common, geometry);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, offset_common, geometry.position);\n }\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n vFillColor = vec4(instanceFillColors.rgb, instanceFillColors.a * opacity);\n DECKGL_FILTER_COLOR(vFillColor, geometry);\n vLineColor = vec4(instanceLineColors.rgb, instanceLineColors.a * opacity);\n DECKGL_FILTER_COLOR(vLineColor, geometry);\n}\n",fs:"#define SHADER_NAME text-background-layer-fragment-shader\n\nprecision highp float;\n\nuniform bool stroked;\n\nvarying vec4 vFillColor;\nvarying vec4 vLineColor;\nvarying float vLineWidth;\nvarying vec2 uv;\nvarying vec2 dimensions;\n\nvoid main(void) {\n geometry.uv = uv;\n\n vec2 pixelPosition = uv * dimensions;\n if (stroked) {\n float distToEdge = min(\n min(pixelPosition.x, dimensions.x - pixelPosition.x),\n min(pixelPosition.y, dimensions.y - pixelPosition.y)\n );\n float isBorder = smoothedge(distToEdge, vLineWidth);\n gl_FragColor = mix(vFillColor, vLineColor, isBorder);\n } else {\n gl_FragColor = vFillColor;\n }\n\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:[rx,sx]})}initializeState(){this.getAttributeManager().addInstanced({instancePositions:{size:3,type:5130,fp64:this.use64bitPositions(),transition:!0,accessor:"getPosition"},instanceSizes:{size:1,transition:!0,accessor:"getSize",defaultValue:1},instanceAngles:{size:1,transition:!0,accessor:"getAngle"},instanceRects:{size:4,accessor:"getBoundingRect"},instancePixelOffsets:{size:2,transition:!0,accessor:"getPixelOffset"},instanceFillColors:{size:4,transition:!0,normalized:!0,type:5121,accessor:"getFillColor",defaultValue:[0,0,0,255]},instanceLineColors:{size:4,transition:!0,normalized:!0,type:5121,accessor:"getLineColor",defaultValue:[0,0,0,255]},instanceLineWidths:{size:1,transition:!0,accessor:"getLineWidth",defaultValue:1}})}updateState({props:t,oldProps:i,changeFlags:r}){if(super.updateState({props:t,oldProps:i,changeFlags:r}),r.extensionsChanged){var s;const{gl:o}=this.context;null===(s=this.state.model)||void 0===s||s.delete(),this.state.model=this._getModel(o),this.getAttributeManager().invalidateAll()}}draw({uniforms:t}){const{viewport:i}=this.context,{billboard:r,sizeScale:s,sizeUnits:o,sizeMinPixels:a,sizeMaxPixels:l,getLineWidth:c}=this.props;let{padding:u}=this.props;const h="pixels"===o?i.metersPerPixel:1;u.length<4&&(u=[u[0],u[1],u[0],u[1]]),this.state.model.setUniforms(t).setUniforms({billboard:r,stroked:Boolean(c),padding:u,sizeScale:s*h,sizeMinPixels:a,sizeMaxPixels:l}).draw()}_getModel(t){return new Yg(t,Cn(ot({},this.getShaders()),{id:this.props.id,geometry:new fh({drawMode:6,vertexCount:4,attributes:{positions:{size:2,value:new Float32Array([0,0,1,0,1,1,0,1])}}}),isInstanced:!0}))}}return n.layerName="TextBackgroundLayer",n.defaultProps=lge,n})();const W4={fontSize:64,buffer:4,sdf:!1,radius:12,cutoff:.25,smoothing:.1},q4={start:1,middle:0,end:-1},Y4={top:1,center:0,bottom:-1},aR=[0,0,0,255],dge=["fontSize","buffer","sdf","radius","cutoff"],hge={billboard:!0,sizeScale:1,sizeUnits:"pixels",sizeMinPixels:0,sizeMaxPixels:Number.MAX_SAFE_INTEGER,background:!1,getBackgroundColor:{type:"accessor",value:[255,255,255,255]},getBorderColor:{type:"accessor",value:aR},getBorderWidth:{type:"accessor",value:0},backgroundPadding:{type:"array",value:[0,0,0,0]},characterSet:{type:"object",value:k4},fontFamily:L4,fontWeight:"normal",lineHeight:1,outlineWidth:{type:"number",value:0,min:0},outlineColor:{type:"color",value:aR},fontSettings:{},wordBreak:"break-word",maxWidth:{type:"number",value:-1},getText:{type:"accessor",value:n=>n.text},getPosition:{type:"accessor",value:n=>n.position},getColor:{type:"accessor",value:aR},getSize:{type:"accessor",value:32},getAngle:{type:"accessor",value:0},getTextAnchor:{type:"accessor",value:"middle"},getAlignmentBaseline:{type:"accessor",value:"center"},getPixelOffset:{type:"accessor",value:[0,0]},backgroundColor:{deprecatedFor:["background","getBackgroundColor"]}};let fge=(()=>{class n extends jz{initializeState(){this.state={styleVersion:0,fontAtlasManager:new sge}}updateState({props:t,oldProps:i,changeFlags:r}){const o=this.state.characterSet;(r.dataChanged||r.updateTriggersChanged&&(r.updateTriggersChanged.all||r.updateTriggersChanged.getText))&&this._updateText();const a=o!==this.state.characterSet||this._fontChanged(i,t);a&&this._updateFontAtlas(i,t),(a||t.lineHeight!==i.lineHeight||t.wordBreak!==i.wordBreak||t.maxWidth!==i.maxWidth)&&this.setState({styleVersion:this.state.styleVersion+1})}getPickingInfo({info:t}){return t.object=t.index>=0?this.props.data[t.index]:null,t}_updateFontAtlas(t,i){const{fontSettings:r,fontFamily:s,fontWeight:o}=i,{fontAtlasManager:a,characterSet:l}=this.state;a.setProps(Cn(ot(ot({},W4),r),{characterSet:l,fontFamily:s,fontWeight:o}))}_fontChanged(t,i){if(t.fontFamily!==i.fontFamily||t.fontWeight!==i.fontWeight)return!0;if(t.fontSettings===i.fontSettings)return!1;const r=t.fontSettings||{},s=i.fontSettings||{};return dge.some(o=>r[o]!==s[o])}_updateText(){const{data:t,characterSet:i}=this.props,r=t.attributes&&t.attributes.getText;let a,{getText:s}=this.props,{startIndices:o}=t;const l="auto"===i&&new Set;if(r&&o){const{texts:c,characterCount:u}=function({value:n,length:e,stride:t,offset:i,startIndices:r,characterSet:s}){const o=n.BYTES_PER_ELEMENT,a=t?t/o:1,l=i?i/o:0,c=r[e]||Math.ceil((n.length-l)/a),u=s&&new Set,h=new Array(e);let p=n;if(a>1||l>0){p=new n.constructor(c);for(let g=0;gc[p]}else{const{iterable:c,objectInfo:u}=ES(t);o=[0],a=0;for(const h of c){u.index++;const p=Array.from(s(h,u)||"");l&&p.forEach(l.add,l),a+=p.length,o.push(a)}}this.setState({getText:s,startIndices:o,numInstances:a,characterSet:l||i})}getBoundingRect(t,i){const r=this.state.fontAtlasManager.mapping,{getText:s}=this.state,{wordBreak:o,maxWidth:a,lineHeight:l,getTextAnchor:c,getAlignmentBaseline:u}=this.props,h=s(t,i)||"",{size:[p,g]}=F4(h,l,o,a,r);return[(q4["function"==typeof c?c(t,i):c]-1)*p/2,(Y4["function"==typeof u?u(t,i):u]-1)*g/2,p,g]}getIconOffsets(t,i){const r=this.state.fontAtlasManager.mapping,{getText:s}=this.state,{wordBreak:o,maxWidth:a,lineHeight:l,getTextAnchor:c,getAlignmentBaseline:u}=this.props,h=s(t,i)||"",{x:p,y:g,rowWidth:m,size:[w,C]}=F4(h,l,o,a,r),H=q4["function"==typeof c?c(t,i):c],U=Y4["function"==typeof u?u(t,i):u],de=p.length,Ae=new Array(2*de);let Pe=0;for(let Be=0;Bet*e/255)}const cR={name:"lights",vs:K4,fs:K4,getUniforms:function X4(n=pge){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?lR(n):[0,0,0],e.forEach((r,s)=>{i[`lighting_uPointLight[${s}].color`]=lR(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`]=lR(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 X4({lightSources:e})}return{}},defines:{MAX_LIGHTS:3}},mge={};const yge={name:"phong-lighting",dependencies:[cR],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=mge){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}}},uR=Math.PI/180,ox=new Float32Array(16),J4=new Float32Array(12);function e5(n,e,t){const i=e[0]*uR,r=e[1]*uR,s=e[2]*uR,o=Math.sin(s),a=Math.sin(i),l=Math.sin(r),c=Math.cos(s),u=Math.cos(i),h=Math.cos(r),p=t[0],g=t[1],m=t[2];n[0]=p*h*u,n[1]=p*l*u,n[2]=p*-a,n[3]=g*(-l*c+h*a*o),n[4]=g*(h*c+l*a*o),n[5]=g*u*o,n[6]=m*(l*o+h*a*c),n[7]=m*(-h*o+l*a*c),n[8]=m*u*c}function t5(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 n5={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,u=Array.isArray(s),h=Array.isArray(r),p=Array.isArray(o),g=c||!l&&Boolean(a(i[0]));n.constant=g?c:h&&u&&p;const m=n.value;if(n.constant){let w;g?(ox.set(a),w=t5(ox)):(w=J4,e5(w,r,s),w.set(o,9)),n.value=new Float32Array(w)}else{let w=e*n.size;const{iterable:C,objectInfo:H}=ES(i,e,t);for(const U of C){let de;H.index++,g?(ox.set(c?a:a(U,H)),de=t5(ox)):(de=J4,e5(de,h?r:r(U,H),u?s:s(U,H)),de.set(p?o:o(U,H),9)),m[w++]=de[0],m[w++]=de[1],m[w++]=de[2],m[w++]=de[3],m[w++]=de[4],m[w++]=de[5],m[w++]=de[6],m[w++]=de[7],m[w++]=de[8],m[w++]=de[9],m[w++]=de[10],m[w++]=de[11]}}}};function i5(n,e){return e===ji.CARTESIAN||e===ji.METER_OFFSETS||e===ji.DEFAULT&&!n.isGeospatial}function r5(n,e){(n.COLOR_0||n.colors)&&e||(n.colors={constant:!0,value:new Float32Array([1,1,1])}),Ri.assert(n.positions||n.POSITION,'no "postions" or "POSITION" attribute in mesh')}function wge(n,e){if(n.attributes)return r5(n.attributes,e),n instanceof fh?n:new fh(n);if(n.positions||n.POSITION)return r5(n,e),new fh({attributes:n});throw Error("Invalid mesh")}const Ege={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 Sge=(()=>{class n extends $0{getShaders(){const t=!Si(this.context.gl),i={};return gI(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:[rx,yge,sx],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:n5}),this.setState({emptyTexture:new _a(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||i5(i,s),flatShading:!this.state.hasNormals}).draw()}getModel(t){const i=new Yg(this.context.gl,Cn(ot({},this.getShaders()),{id:this.props.id,geometry:wge(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=Ege,n})();const s5={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:[cR]};class rm{constructor(e={}){const{id:t}=e;this.id=t||ga(this.constructor.name),this.display=!0,this.position=new Ao,this.rotation=new Ao,this.scale=new Ao(1,1,1),this.matrix=new qn,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 qn(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 Z0 extends rm{constructor(e={}){e=Array.isArray(e)?{children:e}:e;const{children:t=[]}=e;mn.assert(t.every(i=>i instanceof rm),"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 qn}={}){const i=new qn(t).multiplyRight(this.matrix);for(const r of this.children)r instanceof Z0?r.traverse(e,{worldMatrix:i}):e(r,{worldMatrix:i})}}function o5(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],u=e[7],h=e[8],p=t[0],g=t[1],m=t[2],w=t[3],C=t[4],H=t[5],U=t[6],de=t[7],Ae=t[8];return n[0]=p*i+g*o+m*c,n[1]=p*r+g*a+m*u,n[2]=p*s+g*l+m*h,n[3]=w*i+C*o+H*c,n[4]=w*r+C*a+H*u,n[5]=w*s+C*l+H*h,n[6]=U*i+de*o+Ae*c,n[7]=U*r+de*a+Ae*u,n[8]=U*s+de*l+Ae*h,n}function a5(n,e,t){var i=t[0],r=t[1];return n[0]=i*e[0],n[1]=i*e[1],n[2]=i*e[2],n[3]=r*e[3],n[4]=r*e[4],n[5]=r*e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n}function l5(){var n=new ya(4);return ya!=Float32Array&&(n[0]=0,n[1]=0,n[2]=0),n[3]=1,n}function c5(n){return n[0]=0,n[1]=0,n[2]=0,n[3]=1,n}function dR(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 ax(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],u=t[3];return n[0]=i*u+o*a+r*c-s*l,n[1]=r*u+o*l+s*a-i*c,n[2]=s*u+o*c+i*l-r*a,n[3]=o*u-i*a-r*l-s*c,n}function u5(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);return n[0]=i*l+o*a,n[1]=r*l+s*a,n[2]=s*l-r*a,n[3]=o*l-i*a,n}function d5(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);return n[0]=i*l-s*a,n[1]=r*l+o*a,n[2]=s*l+i*a,n[3]=o*l-r*a,n}function h5(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);return n[0]=i*l+r*a,n[1]=r*l-i*a,n[2]=s*l+o*a,n[3]=o*l-s*a,n}function f5(n,e){var t=e[0],i=e[1],r=e[2];return n[0]=t,n[1]=i,n[2]=r,n[3]=Math.sqrt(Math.abs(1-t*t-i*i-r*r)),n}function J0(n,e,t,i){var p,g,m,w,C,r=e[0],s=e[1],o=e[2],a=e[3],l=t[0],c=t[1],u=t[2],h=t[3];return(g=r*l+s*c+o*u+a*h)<0&&(g=-g,l=-l,c=-c,u=-u,h=-h),1-g>Qc?(p=Math.acos(g),m=Math.sin(p),w=Math.sin((1-i)*p)/m,C=Math.sin(i*p)/m):(w=1-i,C=i),n[0]=w*r+C*l,n[1]=w*s+C*c,n[2]=w*o+C*u,n[3]=w*a+C*h,n}function p5(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;return n[0]=-t*a,n[1]=-i*a,n[2]=-r*a,n[3]=s*a,n}function g5(n,e){return n[0]=-e[0],n[1]=-e[1],n[2]=-e[2],n[3]=e[3],n}function hR(n,e){var i,t=e[0]+e[4]+e[8];if(t>0)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}return n}var m5=function(n,e,t){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n},fR=FU,pR=function(n,e){return n[0]*e[0]+n[1]*e[1]+n[2]*e[2]+n[3]*e[3]},_5=function(n,e,t,i){var r=e[0],s=e[1],o=e[2],a=e[3];return 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),n},y5=function(n){return Math.hypot(n[0],n[1],n[2],n[3])},b5=function(n){var e=n[0],t=n[1],i=n[2],r=n[3];return e*e+t*t+i*i+r*r},w5=function(){var n=xV(),e=CV(1,0,0),t=CV(0,1,0);return function(i,r,s){var o=AV(r,s);return o<-.999999?(A0(n,e,r),function(n){return Math.hypot(n[0],n[1],n[2])}(n)<1e-6&&A0(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),dR(i,n,Math.PI),i):o>.999999?(i[0]=0,i[1]=0,i[2]=0,i[3]=1,i):(A0(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))}}();l5(),l5(),function(){var n=new ya(9);ya!=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 Nge=[0,0,0,1];class gR extends bS{constructor(e=0,t=0,i=0,r=1){super(-0,-0,-0,-0),Array.isArray(e)&&1===arguments.length?this.copy(e):this.set(e,t,i,r)}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this.check()}set(e,t,i,r){return this[0]=e,this[1]=t,this[2]=i,this[3]=r,this.check()}fromMatrix3(e){return hR(this,e),this.check()}identity(){return c5(this),this.check()}fromAxisRotation(e,t){return dR(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]=sr(e)}get y(){return this[1]}set y(e){this[1]=sr(e)}get z(){return this[2]}set z(e){this[2]=sr(e)}get w(){return this[3]}set w(e){this[3]=sr(e)}len(){return y5(this)}lengthSquared(){return b5(this)}dot(e,t){if(void 0!==t)throw new Error("Quaternion.dot only takes one argument");return pR(this,e)}rotationTo(e,t){return w5(this,e,t),this.check()}add(e,t){if(void 0!==t)throw new Error("Quaternion.add only takes one argument");return m5(this,this,e),this.check()}calculateW(){return f5(this,this),this.check()}conjugate(){return g5(this,this),this.check()}invert(){return p5(this,this),this.check()}lerp(e,t,i){return _5(this,e,t,i),this.check()}multiplyRight(e,t){return Yu(!t),ax(this,this,e),this.check()}multiplyLeft(e,t){return Yu(!t),ax(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 u5(this,this,e),this.check()}rotateY(e){return d5(this,this,e),this.check()}rotateZ(e){return h5(this,this,e),this.check()}scale(e){return fR(this,this,e),this.check()}slerp(e,t,i){switch(arguments.length){case 1:({start:e=Nge,target:t,ratio:i}=arguments[0]);break;case 2:[t,i]=arguments,e=this}return J0(this,e,t,i),this.check()}transformVector4(e,t=e){return kU(t,e,this),vS(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)}}const Pge={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Fge={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function E5(n){if(!n._animation){const e=Fge[n.componentType],t=Pge[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;l{(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:mn.warn(`Bad animation path ${s}`)()}tn(r[s].length===i[c].length);const u=e[c],h=e[l];switch(t){case"STEP":!function(n,e,t){for(let i=0;iu&&function(n,e,t,i,r){if("rotation"===e){mR.slerp({start:t,target:i,ratio:r});for(let s=0;su&&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:E5(e.accessors[a]),interpolation:l,output:E5(e.accessors[c])})),o=t.channels.map(({sampler:a,target:l})=>({sampler:s[a],target:e.nodes[l.node],path:l.path}));return new zge({name:r,channels:o})})}animate(e){this.setTime(e)}setTime(e){this.animations.forEach(t=>t.animate(e))}getAnimations(){return this.animations}}class Gge extends rm{constructor(e,t={}){super(t),this.onBeforeRender=null,this.AfterRender=null,e instanceof Yg?(this.model=e,this._setModelNodeProps(t)):this.model=new Yg(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 $ge{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},gI(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 _a(this.gl,ot({id:e.name||e.id,parameters:ot(ot({},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&&(mn.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 S5(n,e){return Si(n)?`#version 300 es\n${e}`:e}const Kge={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Xge={modelOptions:{},pbrDebug:!1,imageBasedLightingEnvironment:null,lights:!0,useTangents:!1};class Qge{constructor(e,t={}){this.gl=e,this.options=Object.assign({},Xge,t)}instantiate(e){return this.gltf=e,(e.scenes||[]).map(i=>this.createScene(i))}createAnimator(){return Array.isArray(this.gltf.animations)?new Hge(this.gltf):null}createScene(e){const i=(e.nodes||[]).map(s=>this.createNode(s));return new Z0({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 Z0({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 qn).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 Z0({id:e.name||e.id,children:i});e._mesh=r}return e._mesh}getVertexCount(e){mn.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 $ge(n,e);mn.info(4,"createGLTFModel defines: ",a.defines)();const l=[];l.push(...a.generatedTextures),l.push(...Object.values(s).map(u=>u.buffer));const c=new Gge(n,Object.assign({id:t,drawMode:i,vertexCount:r,modules:[s5],defines:a.defines,parameters:a.parameters,vs:S5(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:S5(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))),mn.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 hr(this.gl,{id:`from-${i.id}`,data:i.data||e.value,target:t})),i.lumaBuffers[t]}createAccessor(e,t){return new ma({buffer:t,offset:e.byteOffset||0,stride:e.bufferView.byteStride||0,type:e.componentType,size:Kge[e.type]})}createSampler(e){return e}needsPOT(){return!1}}function x5(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 sm(i,this.metadata)}selectAt(...e){const t=e.map(i=>this.fields[i]).filter(Boolean);return new sm(t,this.metadata)}assign(e){let t,i=this.metadata;if(e instanceof sm){const o=e;t=o.fields,i=M5(M5(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 sm(s,i)}}function M5(n,e){return new Map([...n||new Map,...e||new Map])}let Lr,D5,I5,O5,R5,N5,P5,F5;!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"}(Lr||(Lr={}));class _R{static isNull(e){return e&&e.typeId===Lr.Null}static isInt(e){return e&&e.typeId===Lr.Int}static isFloat(e){return e&&e.typeId===Lr.Float}static isBinary(e){return e&&e.typeId===Lr.Binary}static isUtf8(e){return e&&e.typeId===Lr.Utf8}static isBool(e){return e&&e.typeId===Lr.Bool}static isDecimal(e){return e&&e.typeId===Lr.Decimal}static isDate(e){return e&&e.typeId===Lr.Date}static isTime(e){return e&&e.typeId===Lr.Time}static isTimestamp(e){return e&&e.typeId===Lr.Timestamp}static isInterval(e){return e&&e.typeId===Lr.Interval}static isList(e){return e&&e.typeId===Lr.List}static isStruct(e){return e&&e.typeId===Lr.Struct}static isUnion(e){return e&&e.typeId===Lr.Union}static isFixedSizeBinary(e){return e&&e.typeId===Lr.FixedSizeBinary}static isFixedSizeList(e){return e&&e.typeId===Lr.FixedSizeList}static isMap(e){return e&&e.typeId===Lr.Map}static isDictionary(e){return e&&e.typeId===Lr.Dictionary}get typeId(){return Lr.NONE}compareTo(e){return this===e}}Symbol,Symbol,D5=Symbol.toStringTag;class om extends _R{constructor(e,t){super(),Kn(this,"isSigned",void 0),Kn(this,"bitWidth",void 0),this.isSigned=e,this.bitWidth=t}get typeId(){return Lr.Int}get[D5](){return"Int"}toString(){return`${this.isSigned?"I":"Ui"}nt${this.bitWidth}`}}class ame extends om{constructor(){super(!0,8)}}class lme extends om{constructor(){super(!0,16)}}class cme extends om{constructor(){super(!0,32)}}class ume extends om{constructor(){super(!1,8)}}class dme extends om{constructor(){super(!1,16)}}class hme extends om{constructor(){super(!1,32)}}I5=Symbol.toStringTag;class k5 extends _R{constructor(e){super(),Kn(this,"precision",void 0),this.precision=e}get typeId(){return Lr.Float}get[I5](){return"Float"}toString(){return`Float${this.precision}`}}class fme extends k5{constructor(){super(32)}}class pme extends k5{constructor(){super(64)}}Symbol,Symbol,O5=Symbol.toStringTag,R5=Symbol.toStringTag,N5=Symbol.toStringTag,P5=Symbol.toStringTag,F5=Symbol.toStringTag;class gme extends _R{constructor(e,t){super(),Kn(this,"listSize",void 0),Kn(this,"children",void 0),this.listSize=e,this.children=[t]}get typeId(){return Lr.FixedSizeList}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get[F5](){return"FixedSizeList"}toString(){return`FixedSizeList[${this.listSize}]<${this.valueType}>`}}class lx{constructor(e,t,i=!1,r=new Map){Kn(this,"name",void 0),Kn(this,"type",void 0),Kn(this,"nullable",void 0),Kn(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 lx(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 L5(n,e,t){const i=t?B5(t.metadata):void 0,r=function(n){switch(n.constructor){case Int8Array:return new ame;case Uint8Array:return new ume;case Int16Array:return new lme;case Uint16Array:return new dme;case Int32Array:return new cme;case Uint32Array:return new hme;case Float32Array:return new fme;case Float64Array:return new pme;default:throw new Error("array type not supported")}}(e.value);return new lx(n,new gme(e.size,new lx("value",r)),!1,i)}function B5(n){const e=new Map;for(const t in n)e.set(`${t}.string`,JSON.stringify(n[t]));return e}const j5={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},bme={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array};class wme{constructor(e){Kn(this,"draco",void 0),Kn(this,"decoder",void 0),Kn(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?u:r,s=h>s?h:s,o=p>o?p:o}return[[e,t,i],[r,s,o]]}(l.attributes),u=function(n,e,t){const i=B5(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=L5(o,n[o],s[o]);r.push(l)}if(t){const o=L5("indices",t);r.push(o)}return new sm(r,i)}(l.attributes,a,l.indices);return Cn(ot({loader:"draco",loaderData:a,header:{vertexCount:s.num_points(),boundingBox:c}},l),{schema:u})}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 cx=Je(125);const wR={};function ER(n){return SR.apply(this,arguments)}function SR(){return(SR=oi(function*(n,e=null,t={}){return e&&(n=Ame(n,e,t)),wR[n]=wR[n]||Tme(n),yield wR[n]})).apply(this,arguments)}function Ame(n,e,t){if(n.startsWith("http"))return n;const i=t.modules||{};return i[n]?i[n]:mO?t.CDN?(Jc(t.CDN.startsWith("http")),`${t.CDN}/${e}@3.0.12/dist/libs/${n}`):_O?`../src/libs/${n}`:`modules/${e}/src/libs/${n}`:`modules/${e}/dist/libs/${n}`}function Tme(n){return xR.apply(this,arguments)}function xR(){return(xR=oi(function*(n){return n.endsWith("wasm")?yield(yield fetch(n)).arrayBuffer():mO?_O?importScripts(n):Mme(yield(yield fetch(n)).text(),n):cx.requireFromFile&&(yield cx.requireFromFile(n))})).apply(this,arguments)}function Mme(n,e){if(!mO)return cx.requireFromString&&cx.requireFromString(n,e);if(_O)return eval.call(jue,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 Dme="https://www.gstatic.com/draco/versioned/decoders/1.4.1/draco_decoder.js",Ime="https://www.gstatic.com/draco/versioned/decoders/1.4.1/draco_wasm_wrapper.js",Ome="https://www.gstatic.com/draco/versioned/decoders/1.4.1/draco_decoder.wasm";let eb;function Nme(n){return CR.apply(this,arguments)}function CR(){return(CR=oi(function*(n){const e=n.modules||{};return eb=e.draco3d?eb||e.draco3d.createDecoderModule({}).then(t=>({draco:t})):eb||Pme(n),yield eb})).apply(this,arguments)}function Pme(n){return TR.apply(this,arguments)}function TR(){return(TR=oi(function*(n){let e,t;switch(n.draco&&n.draco.decoderType){case"js":e=yield ER(Dme,"draco",n);break;case"wasm":default:[e,t]=yield Promise.all([yield ER(Ime,"draco",n),yield ER(Ome,"draco",n)])}return e=e||globalThis.DracoDecoderModule,yield Fme(e,t)})).apply(this,arguments)}function Fme(n,e){const t={};return e&&(t.wasmBinary=e),new Promise(i=>{n(Cn(ot({},t),{onModuleLoaded:r=>i({draco:r})}))})}const DR=Cn(ot({},T5),{parse:function(n,e){return IR.apply(this,arguments)}});function IR(){return(IR=oi(function*(n,e){const{draco:t}=yield Nme(e),i=new wme(t);try{return i.parseSync(n,null==e?void 0:e.draco)}finally{i.destroy()}})).apply(this,arguments)}function nb(n,e){return Ff(n>=0),Ff(e>0),n+(e-1)&~(e-1)}function Bme(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+nb(i.byteLength,4)}const V5=["SCALAR","VEC2","VEC3","VEC4"],jme=[[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Uint32Array,5125],[Float32Array,5126],[Float64Array,5130]],Vme=new Map(jme),Ume={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},zme={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},Hme={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function U5(n){return V5[n-1]||V5[0]}function z5(n){const e=Vme.get(n.constructor);if(!e)throw new Error("Illegal typed array");return e}function H5(n,e){const t=Hme[n.componentType],i=Ume[n.type],s=n.count*i,o=n.count*i*zme[n.componentType];return Ga(o>=0&&o<=e.byteLength),{ArrayType:t,length:s,byteLength:o}}const Gme={asset:{version:"2.0",generator:"loaders.gl"},buffers:[]};class gh{constructor(e){Kn(this,"gltf",void 0),Kn(this,"sourceBuffers",void 0),Kn(this,"byteLength",void 0),this.gltf=e||{json:ot({},Gme),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 Ga(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}=H5(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 Ga(t),this.json.extensions=this.json.extensions||{},this.json.extensions[e]=t,this.registerUsedExtension(e),t}addRequiredExtension(e,t={}){return Ga(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=JO(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;Ga(Number.isFinite(t)),this.sourceBuffers=this.sourceBuffers||[],this.sourceBuffers.push(e);const i={buffer:0,byteOffset:this.byteLength,byteLength:t};return this.byteLength+=nb(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:U5(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:z5(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=Bme(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*t_e(n){for(const e of n.json.meshes||[])for(const t of e.primitives)yield t}function n_e(n){return NR.apply(this,arguments)}function NR(){return(NR=oi(function*(n){const e=new gh(n),{json:t}=e;e.removeExtension(dx);for(const i of t.materials||[])i.extensions&&i.extensions.KHR_materials_unlit&&(i.unlit=!0),e.removeObjectExtension(i,dx)})).apply(this,arguments)}function i_e(n){const e=new gh(n),{json:t}=e;if(e.materials)for(const i of t.materials||[])i.unlit&&(delete i.unlit,e.addObjectExtension(i,dx,{}),e.addExtension(dx))}function r_e(n){return PR.apply(this,arguments)}function PR(){return(PR=oi(function*(n){const e=new gh(n),{json:t}=e,i=e.getExtension(am);i&&(e.json.lights=i.lights,e.removeExtension(am));for(const r of t.nodes||[]){const s=e.getObjectExtension(r,am);s&&(r.light=s.light),e.removeObjectExtension(r,am)}})).apply(this,arguments)}function s_e(n){return FR.apply(this,arguments)}function FR(){return(FR=oi(function*(n){const e=new gh(n),{json:t}=e;if(t.lights){const i=e.addExtension(am);Ga(!i.lights),i.lights=t.lights,delete t.lights}if(e.json.lights){for(const i of e.json.lights)e.addObjectExtension(i.node,am,i);delete e.json.lights}})).apply(this,arguments)}function o_e(n){return kR.apply(this,arguments)}function kR(){return(kR=oi(function*(n){const e=new gh(n),{json:t}=e,i=e.getExtension(hx);if(i){const r=l_e(i,e);for(const s of t.materials||[]){const o=e.getObjectExtension(s,hx);o&&(s.technique=Object.assign({},o,r[o.technique]),s.technique.values=c_e(s.technique,e)),e.removeObjectExtension(s,hx)}e.removeExtension(hx)}})).apply(this,arguments)}function a_e(n,e){return LR.apply(this,arguments)}function LR(){return(LR=oi(function*(n,e){})).apply(this,arguments)}function l_e(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 c_e(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 W5={KHR_draco_mesh_compression:yt,KHR_materials_unlit:ee,KHR_lights_punctual:Tt,KHR_techniques_webgl:dt};function u_e(n){return BR.apply(this,arguments)}function BR(){return(BR=oi(function*(n,e={},t){for(const r in W5){var i;const s=(null==e||null===(i=e.gltf)||void 0===i?void 0:i.excludeExtensions)||{};r in s&&!s[r]||(yield W5[r].decode(n,e,t))}})).apply(this,arguments)}const q5={accessors:"accessor",animations:"animation",buffers:"buffer",bufferViews:"bufferView",images:"image",materials:"material",meshes:"mesh",nodes:"node",samplers:"sampler",scenes:"scene",skins:"skin",textures:"texture"},h_e={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 f_e{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 gh(n),{json:t}=e;for(const i of t.images||[]){const r=e.removeObjectExtension(i,G5);r&&Object.assign(i,r)}t.buffers&&t.buffers[0]&&delete t.buffers[0].uri,e.removeExtension(G5)}(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 q5)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 q5)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=h_e[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 p_e(n,e={}){return(new f_e).normalize(n,e)}const g_e={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},m_e={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},Ml={TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,REPEAT:10497,LINEAR:9729,NEAREST_MIPMAP_LINEAR:9986},__e={magFilter:Ml.TEXTURE_MAG_FILTER,minFilter:Ml.TEXTURE_MIN_FILTER,wrapS:Ml.TEXTURE_WRAP_S,wrapT:Ml.TEXTURE_WRAP_T},y_e={[Ml.TEXTURE_MAG_FILTER]:Ml.LINEAR,[Ml.TEXTURE_MIN_FILTER]:Ml.NEAREST_MIPMAP_LINEAR,[Ml.TEXTURE_WRAP_S]:Ml.REPEAT,[Ml.TEXTURE_WRAP_]:Ml.REPEAT};class w_e{postProcess(e,t={}){const{json:i,buffers:r=[],images:s=[],baseUri:o=""}=e;return Ga(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=ot({},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=ot({},e.normalTexture),e.normalTexture.texture=this.getTexture(e.normalTexture.index)),e.occlusionTexture&&(e.occlustionTexture=ot({},e.occlustionTexture),e.occlusionTexture.texture=this.getTexture(e.occlusionTexture.index)),e.emissiveTexture&&(e.emmisiveTexture=ot({},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=ot({},e.pbrMetallicRoughness);const i=e.pbrMetallicRoughness;i.baseColorTexture&&(i.baseColorTexture=ot({},i.baseColorTexture),i.baseColorTexture.texture=this.getTexture(i.baseColorTexture.index)),i.metallicRoughnessTexture&&(i.metallicRoughnessTexture=ot({},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 m_e[n]}(e.componentType),e.components=function(n){return g_e[n]}(e.type),e.bytesPerElement=e.bytesPerComponent*e.components,e.bufferView){const i=e.bufferView.buffer,{ArrayType:r,byteLength:s}=H5(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):y_e,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 __e[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 E_e(n,e){return(new w_e).postProcess(n,e)}const Y5=1735152710,lm=!0;function VR(n,e,t,i){const r=new Uint8Array(e.buffer,t,i),o=new TextDecoder("utf8").decode(r);return n.json=JSON.parse(o),nb(i,4)}function UR(n,e,t,i){return n.header.hasBinChunk=!0,n.binChunks.push({byteOffset:t,byteLength:i,arrayBuffer:e.buffer}),nb(i,4)}function P_e(n,e){return zR.apply(this,arguments)}function zR(){return(zR=oi(function*(n,e,t=0,i,r){var s,o,a,l;F_e(n,e,t,i),p_e(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 k_e(n,i,r)),null!=i&&null!==(a=i.gltf)&&void 0!==a&&a.loadImages){const h=L_e(n,i,r);c.push(h)}const u=u_e(n,i,r);return c.push(u),yield Promise.all(c),null!=i&&null!==(l=i.gltf)&&void 0!==l&&l.postProcess?E_e(n,i):n})).apply(this,arguments)}function F_e(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=Y5}=t,s=i.getUint32(e,!1);return s===r||s===Y5}(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)?x5(n.buffer,n.byteOffset,e):n instanceof ArrayBuffer?x5(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,lm),a=r.getUint32(t+8,lm);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){Ff(n.header.byteLength>20);const i=e.getUint32(t+0,lm),r=e.getUint32(t+4,lm);return t+=8,Ff(0===r),VR(n,e,t,i),(t+=i)+UR(n,e,t,n.header.byteLength)}(n,r,t);case 2:return function(n,e,t,i){return Ff(n.header.byteLength>20),function(n,e,t,i){for(;t+8<=n.header.byteLength;){const r=e.getUint32(t+0,lm),s=e.getUint32(t+4,lm);switch(t+=8,s){case 1313821514:VR(n,e,t,r);break;case 5130562:UR(n,e,t,r);break;case 0:i.strict||VR(n,e,t,r);break;case 1:i.strict||UR(n,e,t,r)}t+=nb(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),Ga("glTF"===o.type,`Invalid GLB magic string ${o.type}`),n._glb=o,n.json=o.json}else Ga(!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 k_e(n,e,t){return HR.apply(this,arguments)}function HR(){return(HR=oi(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 U_e(()=>e.some(t=>!t.loaded))})).apply(this,arguments)}function U_e(n){return YR.apply(this,arguments)}function YR(){return(YR=oi(function*(n){for(;n();)yield new Promise(e=>requestAnimationFrame(e))})).apply(this,arguments)}const K5=[255,255,255,255],G_e={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:K5},_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:[cm]};let $_e=(()=>{class n extends $0{getShaders(){const t=[rx,sx];return"pbr"===this.props._lighting&&t.push(s5),{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:K5,transition:!0},instanceModelMatrix:n5})}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 rm)r={scenes:[t.scenegraph]};else if(t.scenegraph&&!t.scenegraph.gltf){const l=t.scenegraph,c=function(n,e,t){const i=new Qge(n,t);return{scenes:i.instantiate(e),animator:i.createAnimator()}}(i,l,this._getModelOptions());r=ot({gltf:l},c),function(n){return qR.apply(this,arguments)}(c).then(()=>this.setNeedsRedraw())}else t.scenegraph&&(Ri.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 rm?(this._deleteScenegraph(),this._applyAllAttributes(o),this._applyAnimationsProp(o,a,t._animations),this.setState({scenegraph:o,animator:a})):null!==o&&Ri.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):Ri.warn("animation ".concat(o," not found"))()}})}_deleteScenegraph(){const{scenegraph:t}=this.state;t instanceof rm&&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:ot({isInstanced:!0,transpileToGLSL100:!Si(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:u}=this.props,h=this.getNumInstances();this.state.scenegraph.traverse((p,{worldMatrix:g})=>{p.model.setInstanceCount(h),p.updateModuleSettings(t),p.draw({parameters:i,uniforms:{sizeScale:o,opacity:c,sizeMinPixels:a,sizeMaxPixels:l,composeModelMatrix:i5(s,u),sceneModelMatrix:g,u_Camera:p.model.getUniforms().project_uCameraPosition}})})}}return n.layerName="ScenegraphLayer",n.defaultProps=G_e,n})();class W_e extends fh{constructor(e={}){const{id:t=ga("sphere-geometry")}=e,{indices:i,attributes:r}=function(n){const{nlat:e=10,nlong:t=10}=n;let{radius:i=1}=n;const o=Math.PI-0,c=2*Math.PI-0,u=(e+1)*(t+1);if("number"==typeof i){const H=i;i=(U,de,Ae,Pe,Be)=>H}const h=new Float32Array(3*u),p=new Float32Array(3*u),g=new Float32Array(2*u),w=new(u>65535?Uint32Array:Uint16Array)(e*t*6);for(let H=0;H<=e;H++)for(let U=0;U<=t;U++){const de=U/t,Ae=H/e,Pe=U+H*(t+1),Be=2*Pe,et=3*Pe,wt=c*de,vt=o*Ae,Ct=Math.sin(wt),Bt=Math.cos(wt),$t=Math.sin(vt),mt=Bt*$t,Vt=Math.cos(vt),ft=Ct*$t,qt=i(mt,Vt,ft,de,Ae);h[et+0]=qt*mt,h[et+1]=qt*Vt,h[et+2]=qt*ft,p[et+0]=mt,p[et+1]=Vt,p[et+2]=ft,g[Be+0]=de,g[Be+1]=1-Ae}const C=t+1;for(let H=0;Hs?(gt=i,$t=1,mt=t):mt=e+Bt/s*(t-e),(-2===Bt||Bt===s+2)&&(mt=0,$t=0),gt-=i/2;for(let Vt=0;Vts?0:ft*w,et[vt+Pe[1]]=Bt<0?-1:Bt>s?1:C,et[vt+Pe[2]]=Bt<0||Bt>s?0:qt*w,wt[Ct+0]=Vt/r,wt[Ct+1]=$t,Ct+=2,vt+=3}}for(let Bt=0;Bt0){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=sye,s=1/i;r.set(this.x*s,this.y*s,this.z*s);const o=oye;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(Q5),Q5.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 sye=new le,oye=new le,Q5=new le;class mr{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,u=this.upperBound;e.copy(c),t.set(u.x,c.y,c.z),i.set(u.x,u.y,c.z),r.set(c.x,u.y,u.z),s.set(u.x,c.y,u.z),o.set(c.x,u.y,c.z),a.set(c.x,c.y,u.z),l.copy(u)}toLocalFrame(e,t){const i=J5;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=J5;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,u=(this.upperBound.y-i.y)*s,h=(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,u)),Math.min(h,p)),m=Math.min(Math.min(Math.max(a,l),Math.max(c,u)),Math.max(h,p));return!(m<0||g>m)}}const Z5=new le,J5=[new le,new le,new le,new le,new le,new le,new le,new le];class hs{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=lye;e.tangents(i,cye),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(Er(e.length(),2)*Er(t.length(),2))+e.dot(t),this.normalize()}return this}mult(e,t=new hs){const i=this.x,r=this.y,s=this.z,o=this.w,a=e.x,l=e.y,c=e.z,u=e.w;return t.x=i*u+o*a+r*c-s*l,t.y=r*u+o*l+s*a-i*c,t.z=s*u+o*c+i*l-r*a,t.w=o*u-i*a-r*l-s*c,t}inverse(e=new hs){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 hs){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,u=c*i+a*s-l*r,h=c*r+l*i-o*s,p=c*s+o*r-a*i,g=-o*i-a*r-l*s;return t.x=u*c+g*-o+h*-l-p*-a,t.y=h*c+g*-a+p*-o-u*-l,t.z=p*c+g*-l+u*-a-h*-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 u=o*a+l*c;if(u>.499&&(i=2*Math.atan2(o,c),r=Math.PI/2,s=0),u<-.499&&(i=-2*Math.atan2(o,c),r=-Math.PI/2,s=0),void 0===i){const h=o*o,g=l*l;i=Math.atan2(2*a*c-2*o*l,1-a*a*2-2*g),r=Math.asin(2*u),s=Math.atan2(2*o*c-2*a*l,1-2*h-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),u=Math.sin(i/2);return"XYZ"===r?(this.x=l*o*a+s*c*u,this.y=s*c*a-l*o*u,this.z=s*o*u+l*c*a,this.w=s*o*a-l*c*u):"YXZ"===r?(this.x=l*o*a+s*c*u,this.y=s*c*a-l*o*u,this.z=s*o*u-l*c*a,this.w=s*o*a+l*c*u):"ZXY"===r?(this.x=l*o*a-s*c*u,this.y=s*c*a+l*o*u,this.z=s*o*u+l*c*a,this.w=s*o*a-l*c*u):"ZYX"===r?(this.x=l*o*a-s*c*u,this.y=s*c*a+l*o*u,this.z=s*o*u-l*c*a,this.w=s*o*a+l*c*u):"YZX"===r?(this.x=l*o*a+s*c*u,this.y=s*c*a+l*o*u,this.z=s*o*u-l*c*a,this.w=s*o*a-l*c*u):"XZY"===r&&(this.x=l*o*a-s*c*u,this.y=s*c*a-l*o*u,this.z=s*o*u+l*c*a,this.w=s*o*a+l*c*u),this}clone(){return new hs(this.x,this.y,this.z,this.w)}slerp(e,t,i=new hs){const r=this.x,s=this.y,o=this.z,a=this.w;let p,g,m,w,C,l=e.x,c=e.y,u=e.z,h=e.w;return g=r*l+s*c+o*u+a*h,g<0&&(g=-g,l=-l,c=-c,u=-u,h=-h),1-g>1e-6?(p=Math.acos(g),m=Math.sin(p),w=Math.sin((1-t)*p)/m,C=Math.sin(t*p)/m):(w=1-t,C=t),i.x=w*r+C*l,i.y=w*s+C*c,i.z=w*o+C*u,i.w=w*a+C*h,i}integrate(e,t,i,r=new hs){const s=e.x*i.x,o=e.y*i.y,a=e.z*i.z,l=this.x,c=this.y,u=this.z,h=this.w,p=.5*t;return r.x+=p*(s*h+o*u-a*c),r.y+=p*(o*h+a*l-s*u),r.z+=p*(a*h+s*c-o*l),r.w+=p*(-s*l-o*c-a*u),r}}const lye=new le,cye=new le,uye={SPHERE:1,PLANE:2,BOX:4,COMPOUND:8,CONVEXPOLYHEDRON:16,HEIGHTFIELD:32,PARTICLE:64,CYLINDER:128,TRIMESH:256};let _n=(()=>{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=uye,n})();class Gi{constructor(e={}){this.position=void 0,this.quaternion=void 0,this.position=new le,this.quaternion=new hs,e.position&&this.position.copy(e.position),e.quaternion&&this.quaternion.copy(e.quaternion)}pointToLocal(e,t){return Gi.pointToLocalFrame(this.position,this.quaternion,e,t)}pointToWorld(e,t){return Gi.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(t8),t8.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 t8=new hs;class Bf extends _n{constructor(e={}){const{vertices:t=[],faces:i=[],normals:r=[],axes:s,boundingSphereRadius:o}=e;super({type:_n.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 u=!1;for(let h=0;h!==i.length;h++)if(i[h].almostEquals(r)||i[h].almostEquals(r)){u=!0;break}u||i.push(r.clone())}}}computeNormals(){this.faceNormals.length=this.faces.length;for(let e=0;ep&&(p=w,h=m)}const g=[];for(let m=0;m=0&&this.clipFaceAgainstHull(o,e,t,g,a,l,c)}findSeparatingAxis(e,t,i,r,s,o,a,l){const c=new le,u=new le,h=new le,p=new le,g=new le,m=new le;let w=Number.MAX_VALUE;const C=this;if(C.uniqueAxes)for(let H=0;H!==C.uniqueAxes.length;H++){i.vmult(C.uniqueAxes[H],c);const U=C.testSepAxis(c,e,t,i,r,s);if(!1===U)return!1;U0&&o.negate(o),!0}testSepAxis(e,t,i,r,s,o){Bf.project(this,e,i,r,KR),Bf.project(t,e,s,o,XR);const l=KR[0],c=KR[1],u=XR[0],h=XR[1];if(l0?1/t:0,this.material=e.material||null,this.linearDamping="number"==typeof e.linearDamping?e.linearDamping:.01,this.type=t<=0?yn.STATIC:yn.DYNAMIC,typeof e.type==typeof yn.STATIC&&(this.type=e.type),this.allowSleep=void 0===e.allowSleep||e.allowSleep,this.sleepState=yn.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 hs,this.initQuaternion=new hs,this.previousQuaternion=new hs,this.interpolatedQuaternion=new hs,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 su,this.invMassSolve=0,this.invInertiaSolve=new le,this.invInertiaWorldSolve=new su,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 mr,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=yn.AWAKE,this.wakeUpAfterNarrowphase=!1,e===yn.SLEEPING&&this.dispatchEvent(yn.wakeupEvent)}sleep(){this.sleepState=yn.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=Er(this.sleepSpeedLimit,2);t===yn.AWAKE&&ir?this.wakeUp():t===yn.SLEEPY&&e-this.timeLastSleepy>this.sleepTimeLimit&&(this.sleep(),this.dispatchEvent(yn.sleepEvent))}}updateSolveMassProperties(){this.sleepState===yn.SLEEPING||this.type===yn.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 hs;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=fye,o=pye,a=this.quaternion,l=this.aabb,c=gye;for(let u=0;u!==r;u++){const h=e[u];a.vmult(t[u],s),s.vadd(this.position,s),a.mult(i[u],o),h.calculateWorldAABB(s,o,c.lowerBound,c.upperBound),0===u?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=mye,r=_ye;i.setRotationFromQuaternion(this.quaternion),i.transpose(r),i.scale(t,i),i.mmult(r,this.invInertiaWorld)}}applyForce(e,t=new le){if(this.type!==yn.DYNAMIC)return;this.sleepState===yn.SLEEPING&&this.wakeUp();const i=yye;t.cross(e,i),this.force.vadd(e,this.force),this.torque.vadd(i,this.torque)}applyLocalForce(e,t=new le){if(this.type!==yn.DYNAMIC)return;const i=bye,r=vye;this.vectorToWorldFrame(e,i),this.vectorToWorldFrame(t,r),this.applyForce(i,r)}applyTorque(e){this.type===yn.DYNAMIC&&(this.sleepState===yn.SLEEPING&&this.wakeUp(),this.torque.vadd(e,this.torque))}applyImpulse(e,t=new le){if(this.type!==yn.DYNAMIC)return;this.sleepState===yn.SLEEPING&&this.wakeUp();const i=t,r=wye;r.copy(e),r.scale(this.invMass,r),this.velocity.vadd(r,this.velocity);const s=Eye;i.cross(e,s),this.invInertiaWorld.vmult(s,s),this.angularVelocity.vadd(s,this.angularVelocity)}applyLocalImpulse(e,t=new le){if(this.type!==yn.DYNAMIC)return;const i=Sye,r=xye;this.vectorToWorldFrame(e,i),this.vectorToWorldFrame(t,r),this.applyImpulse(i,r)}updateMassProperties(){const e=Cye;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),px.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!==yn.DYNAMIC&&this.type!==yn.KINEMATIC||this.sleepState===yn.SLEEPING)return;const r=this.velocity,s=this.angularVelocity,o=this.position,a=this.force,l=this.torque,c=this.quaternion,h=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 m=h.elements,w=this.angularFactor,C=l.x*w.x,H=l.y*w.y,U=l.z*w.z;s.x+=e*(m[0]*C+m[1]*H+m[2]*U),s.y+=e*(m[3]*C+m[4]*H+m[5]*U),s.z+=e*(m[6]*C+m[7]*H+m[8]*U),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()}}yn.idCounter=0,yn.COLLIDE_EVENT_NAME="collide",yn.DYNAMIC=1,yn.STATIC=2,yn.KINEMATIC=4,yn.AWAKE=0,yn.SLEEPY=1,yn.SLEEPING=2,yn.wakeupEvent={type:"wakeup"},yn.sleepyEvent={type:"sleepy"},yn.sleepEvent={type:"sleep"};const fye=new le,pye=new hs,gye=new mr,mye=new su,_ye=new su,yye=new le,bye=new le,vye=new le,wye=new le,Eye=new le,Sye=new le,xye=new le,Cye=new le;new le,new le;class gx{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 n8,i8,r8,s8,o8,a8,l8;n8=_n.types.SPHERE,i8=_n.types.PLANE,r8=_n.types.BOX,s8=_n.types.CYLINDER,o8=_n.types.CONVEXPOLYHEDRON,a8=_n.types.HEIGHTFIELD,l8=_n.types.TRIMESH;class bs{get[n8](){return this._intersectSphere}get[i8](){return this._intersectPlane}get[r8](){return this._intersectBox}get[s8](){return this._intersectConvex}get[o8](){return this._intersectConvex}get[a8](){return this._intersectHeightfield}get[l8](){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=bs.ANY,this.result=new gx,this.hasHit=!1,this.callback=i=>{}}intersectWorld(e,t){return this.mode=t.mode||bs.ANY,this.result=t.result||new gx,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(c8),eN.length=0,e.broadphase.aabbQuery(e,c8,eN),this.intersectBodies(eN),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=Rye,s=Nye;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 u=new le;o.vsub(i,u);const h=u.dot(c);if(a.vsub(i,u),h*u.dot(c)>0||o.distanceTo(a)=0&&w<=1&&(o.lerp(a,w,g),g.vsub(i,m),m.normalize(),this.reportIntersection(m,g,s,r,-1)),this.result.shouldStop)return;C>=0&&C<=1&&(o.lerp(a,C,g),g.vsub(i,m),m.normalize(),this.reportIntersection(m,g,s,r,-1))}}_intersectConvex(e,t,i,r,s,o){const a=Bye,l=d8,c=o&&o.faceList||null,u=e.faces,h=e.vertices,p=e.faceNormals,g=this.direction,m=this.from,C=m.distanceTo(this.to),H=c?c.length:u.length,U=this.result;for(let de=0;!U.shouldStop&&deC||this.reportIntersection(a,ba,s,r,Ae)}}}}_intersectTrimesh(e,t,i,r,s,o){const a=jye,l=$ye,c=Wye,u=d8,h=Vye,p=Uye,g=zye,m=Gye,w=Hye,C=e.indices,H=this.from,U=this.to,de=this.direction;c.position.copy(i),c.quaternion.copy(t),Gi.vectorToLocalFrame(i,t,de,h),Gi.pointToLocalFrame(i,t,H,p),Gi.pointToLocalFrame(i,t,U,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,h),h.normalize();const Ae=p.distanceSquared(g);e.tree.rayQuery(this,c,l);for(let Pe=0,Be=l.length;!this.result.shouldStop&&Pe!==Be;Pe++){const et=l[Pe];e.getNormal(et,a),e.getVertex(C[3*et],yc),yc.vsub(p,u);const wt=h.dot(a),vt=a.dot(u)/wt;if(vt<0)continue;h.scale(vt,ba),ba.vadd(p,ba),e.getVertex(C[3*et+1],au),e.getVertex(C[3*et+2],lu);const Ct=ba.distanceSquared(p);!bs.pointInTriangle(ba,au,yc,lu)&&!bs.pointInTriangle(ba,yc,au,lu)||Ct>Ae||(Gi.vectorToWorldFrame(t,a,w),Gi.pointToWorldFrame(i,t,ba,m),this.reportIntersection(w,m,s,r,et))}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 bs.ALL:this.hasHit=!0,c.set(o,a,e,t,i,r,l),c.hasHit=!0,this.callback(c);break;case bs.CLOSEST:(l=0&&(h=s*c-o*a)>=0&&u+hDate.now()-n}var Hf=Je(517);class Br extends se{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 $;return this._value}next(e){super.next(this._value=e)}}function fm(n,e,t){e||(e=new qn(qn.IDENTITY));const i=new qn(qn.IDENTITY);if(!n)return!0;if(n.matrix)i.copy(n.matrix);else{if(i.identity(),n.translation&&i.translate(n.translation),n.rotation){const s=new qn(qn.IDENTITY).fromQuaternion(n.rotation);i.multiplyRight(s)}n.scale&&i.scale(n.scale)}const r=new qn(e).multiplyRight(i);if(!1===t(n,r,e))return!1;for(const s of n.nodes||n.children||[])if(!1===fm(s,r,t))return!1;return!0}function n6(){Nz([T5,cm])}function i6(n,e){var t;const i=null===(t=e.nodes)||void 0===t?void 0:t.find(r=>r.name===n);if(i){let r=!1;for(const s of e.scenes)r||fm(s,new qn(qn.IDENTITY),(o,a)=>o!==i||(o.matrix=a,o.translation=void 0,o.rotation=void 0,o.scale=void 0,r=!0,!1));return e.scene={id:n,name:n,nodes:[i]},e.scenes=[e.scene],{scene:e.scene,scenes:e.scenes}}return e}function rN(n,e){return Fi(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 WS(i,cm,{DracoLoader:DR,gltf:{decompressMeshes:!0,postProcess:!0}});return r.nodes||console.log("WARNING: Empty Scene",t,r),i6(n.scenegraphNode,r)})}function qve(n,e){return Fi(this,void 0,void 0,function*(){return i6(n,yield e)})}function sN(n,e,t){if(e&&0!==e.length){let i;switch(t.geometry){case"sphere":i=new W_e;break;case"cone":i=new X_e;break;case"cylinder":i=new Q_e;break;case"cube":default:i=new iye}return new Sge(Object.assign({id:n,pickable:!0,autoHighlight:!1,highlightColor:[30,136,229,255],coordinateSystem:ji.CARTESIAN,data:e,mesh:i,wireframe:!1,getTransformMatrix:r=>r.transformMatrix,getColor:r=>r.color||[255,255,255,229.5]},t))}}function r6(n,e,t){if(e&&0!==e.length)return new fge(Object.assign({id:n,pickable:!0,data:e.map(i=>Object.assign(Object.assign({},i),{position:new qn(i.transformMatrix).getTranslation()})),getText:i=>i.text,getPosition:i=>i.position,getColor:i=>i.color},t))}let Kve=(()=>{class n extends jz{initializeState(){const{data:t}=this.props;this.setState({data:null!=t?t:[],zoomOpacity:.8,doCollisions:!1}),n6()}renderLayers(){var t,i;const r=this.state,s={sphere:[],cone:[],cylinder:[],cube:[],text:[],wireframe:[],scenegraph:[]};for(const l of r.data){const c=null!==(t=l.geometry)&&void 0!==t?t:"cube";l.scenegraph?s.scenegraph.push(l):void 0!==s[c]&&s[c].push(l)}const o={};for(const l of s.scenegraph)l.scenegraph&&l.scenegraphNode&&!Object.prototype.hasOwnProperty.call(o,l.scenegraph)&&(o[l.scenegraph]=rN({scenegraph:l.scenegraph},n.gltfCache));const a=[];for(const[l,c]of Object.entries(s))if("scenegraph"===l)for(const u of c)a.push(new $_e({id:"models-"+u["@id"],opacity:u.zoomBasedOpacity?r.zoomOpacity:void 0!==u.opacity?u.opacity:1,pickable:!u.unpickable,coordinateSystem:ji.CARTESIAN,data:[u],scenegraph:u.scenegraphNode?qve(u.scenegraphNode,o[u.scenegraph]):u.scenegraph,_lighting:u._lighting,getTransformMatrix:u.transformMatrix,getColor:null!==(i=u.color)&&void 0!==i?i:[0,255,0,127.5],parameters:{depthMask:!u.zoomBasedOpacity&&(void 0===u.opacity||1===u.opacity)}}));else"text"===l?(a.push(r6("text",c.filter(u=>u.unpickable),{pickable:!1})),a.push(r6("textPickable",c.filter(u=>!u.unpickable),{pickable:!0}))):"wireframe"===l?a.push(sN(l,c,{wireframe:!0,pickable:!1,geometry:l})):(a.push(sN(l,c.filter(u=>u.unpickable),{wireframe:!1,pickable:!1,geometry:l})),a.push(sN(`${l}Pickable`,c.filter(u=>!u.unpickable),{wireframe:!1,pickable:!0,geometry:l})));return r.doCollisions&&function(n){Fi(this,void 0,void 0,function*(){console.log("Starting Collisioning");const e=n.filter(o=>!o.scenegraph&&"wireframe"!==o.geometry).map(o=>{const a=new qn(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 mr({lowerBound:new le(...l.map((u,h)=>Math.min(u,c[h]))),upperBound:new le(...c.map((u,h)=>Math.max(u,l[h])))})}}),t=[];for(const o of n.filter(a=>!!a.scenegraph)){const a=yield G0(o.scenegraph,cm,{DracoLoader:DR,decompress:!0,postProcess:!0});for(const l of a.scenes)fm(l,new qn(o.transformMatrix),(c,u)=>{if(c.mesh&&c.mesh.primitives&&c.mesh.primitives.length>0)for(const h of c.mesh.primitives)if(h.attributes.POSITION&&h.attributes.POSITION.min){const p=u.transformAsPoint(h.attributes.POSITION.min,[]),g=u.transformAsPoint(h.attributes.POSITION.max,[]);t.push({"@id":o["@id"],name:c.name,entityId:o.entityId,bbox:new mr({lowerBound:new le(...p.map((m,w)=>Math.min(m,g[w]))),upperBound:new le(...g.map((m,w)=>Math.max(m,p[w])))}),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})}(r.data),a.filter(l=>!!l)}getPickingInfo(t){return t.info}}return n.layerName="BodyUILayer",n.gltfCache={},n})();function s6(n,e=[]){for(const t of n.nodes||n.children||[])e.push(t.name),s6(t,e);return e}let Qve=(()=>{class n{constructor(t){var i,r,s,o,a;this.deckProps=t,this.bodyUILayer=new Kve({}),this.nodeClickSubject=new se,this.nodeHoverStartSubject=new se,this.nodeHoverStopSubject=new se,this.sceneRotationSubject=new Br([0,0]),this.nodeDragStartSubject=new se,this.nodeDragSubject=new se,this.nodeDragEndSubject=new se,this.nodeClick$=this.nodeClickSubject.pipe(Es()),this.nodeHoverStart$=this.nodeHoverStartSubject.pipe(Es()),this.nodeHoverStop$=this.nodeHoverStopSubject.pipe(Es()),this.sceneRotation$=this.sceneRotationSubject.pipe(Es()),this.nodeDragStart$=this.nodeDragStartSubject.pipe(Es()),this.nodeDrag$=this.nodeDragSubject.pipe(Es()),this.nodeDragEnd$=this.nodeDragEndSubject.pipe(Es());const l=Object.assign(Object.assign({},t),{views:["orthographic"===t.camera?new Kde({flipY:!1,near:-1e3}):new Zde({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 u;return null!==(u=this.cursor)&&void 0!==u?u:c.isDragging?"grabbing":"grab"}});t.legacyLighting&&(l.effects=[new GO({ambientLight:new Gz({color:[255,255,255],intensity:10})})]),this.deck=new ix(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 Fi(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 qn([.076,0,0,0,0,.076,16875389974302382e-33,0,0,-16875389974302382e-33,.076,0,.49,.034,.11,1]);(function(n,e,t,i){return Fi(this,void 0,void 0,function*(){n6();const r=yield rN({scenegraph:n,scenegraphNode:"VHF_Kidney_L_Low1"},undefined),s={},o=[];for(const a of r.scenes)fm(a,e=new qn(e||qn.IDENTITY),(l,c)=>{const u={"@id":l.name||l.id,"@type":"ProcessedNode",transformMatrix:new qn(c),geometry:"wireframe",node:l};if(o.push({"@id":`GLTF:${u["@id"]}`,"@type":"GLTFNode",scenegraph:n,scenegraphNode:u["@id"],transformMatrix:new qn(e||qn.IDENTITY),tooltip:l.name||l.id,color:[255,255,255,255],_lighting:"pbr",zoomBasedOpacity:!0,node:l}),l.mesh&&l.mesh.primitives&&l.mesh.primitives.length>0)for(const h of l.mesh.primitives)if(h.attributes.POSITION&&h.attributes.POSITION.min){const p=c.transformAsPoint(h.attributes.POSITION.min,[]),g=c.transformAsPoint(h.attributes.POSITION.max,[]);u.bbox=new mr({lowerBound:new le(...p.map((m,w)=>Math.min(m,g[w]))),upperBound:new le(...g.map((m,w)=>Math.max(m,p[w])))})}return s[u["@id"]]=u,!0});for(const a of Object.values(s).filter(l=>!l.bbox)){for(const l of s6(a.node).map(c=>s[c]).filter(c=>c.bbox))a.bbox?a.bbox.extend(l.bbox):a.bbox=l.bbox.clone();a.bbox||delete s[a["@id"]]}for(const a of Object.values(s)){const l=a.bbox.lowerBound,h=(a.size=a.bbox.upperBound.clone().vsub(l)).clone().vmul(new le(.5,.5,.5)),p=a.center=l.clone().vadd(h);a.transformMatrix=new qn(qn.IDENTITY).translate(p.toArray()).scale(h.toArray())}for(const a of o)s[a["@id"]]=a;return s})})(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 qn(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 rr([Hf.ZP],n.prototype,"_onHover",null),rr([Hf.ZP],n.prototype,"_onClick",null),rr([Hf.ZP],n.prototype,"_onViewStateChange",null),rr([Hf.ZP],n.prototype,"_onDragStart",null),rr([Hf.ZP],n.prototype,"_onDrag",null),rr([Hf.ZP],n.prototype,"_onDragEnd",null),n})();function Zve(n,e){return n===e}function Jve(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 oN=(()=>{class n{constructor(){this.bootstrap$=new kg(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 aN=new Ht("INITIAL_STATE_TOKEN");let nwe=(()=>{class n{static set(t){this.value=t}static pop(){const t=this.value;return this.value={},t}}return n.value={},n})();const o6=new Ht("Internals.StateContextFactory"),a6=new Ht("Internals.StateFactory");function ub(...n){if(1===n.length){const e=n[0];if(P(e))return Cx(e,null);if(Q(e)&&Object.getPrototypeOf(e)===Object.prototype){const t=Object.keys(e);return Cx(t.map(i=>e[i]),t)}}if("function"==typeof n[n.length-1]){const e=n.pop();return Cx(n=1===n.length&&P(n[0])?n[0]:n,null).pipe(me(t=>e(...t)))}return Cx(n,null)}function Cx(n,e){return new I(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]=u},error:u=>t.error(u),complete:()=>{s++,(s===i||!c)&&(o===i&&t.next(e?e.reduce((u,h,p)=>(u[h]=r[p],u),{}):r),t.complete())}}))}})}function Qi(n,e){return function(i){return i.lift(new iwe(n,e))}}class iwe{constructor(e,t){this.predicate=e,this.thisArg=t}call(e,t){return t.subscribe(new rwe(e,this.predicate,this.thisArg))}}class rwe 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 $a(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(u){let h;s++,!r||a?(a=!1,r=new kg(n,e,i),h=r.subscribe(this),o=u.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)):h=r.subscribe(this),this.add(()=>{s--,h.unsubscribe(),h=void 0,o&&!l&&t&&0===s&&(o.unsubscribe(),o=void 0,r=void 0)})}}(i))}const l6=(()=>{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 Wi(n){return e=>0===n?lS():e.lift(new owe(n))}class owe{constructor(e){if(this.total=e,this.total<0)throw new l6}call(e,t){return t.subscribe(new awe(e,this.total))}}class awe 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 c6(n,e){return e?t=>t.pipe(c6((i,r)=>je(n(i,r)).pipe(me((s,o)=>e(i,s,r,o))))):t=>t.lift(new lwe(n))}class lwe{constructor(e){this.project=e}call(e,t){return t.subscribe(new cwe(e,this.project))}}class cwe extends ve{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 _t(this),i=this.destination;i.add(t);const r=N(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 Ax(n=null){return e=>e.lift(new uwe(n))}class uwe{constructor(e){this.defaultValue=e}call(e,t){return t.subscribe(new dwe(e,this.defaultValue))}}class dwe 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 bc(n){return function(t){const i=new hwe(n),r=t.lift(i);return i.caught=r}}class hwe{constructor(e){this.selector=e}call(e,t){return t.subscribe(new fwe(e,this.selector,this.caught))}}class fwe extends ve{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 _t(this);this.add(i);const r=N(t,i);r!==i&&this.add(r)}}}function _r(n){return e=>e.lift(new pwe(n))}class pwe{constructor(e){this.notifier=e}call(e,t){const i=new gwe(e),r=N(this.notifier,new _t(i));return r&&!i.seenValue?(i.add(r),t.subscribe(i)):i}}class gwe extends ve{constructor(e){super(e),this.seenValue=!1}notifyNext(){this.seenValue=!0,this.complete()}notifyComplete(){}}function _h(){}function Yr(n,e,t){return function(r){return r.lift(new mwe(n,e,t))}}class mwe{constructor(e,t,i){this.nextOrObserver=e,this.error=t,this.complete=i}call(e,t){return t.subscribe(new _we(e,this.nextOrObserver,this.error,this.complete))}}class _we extends y{constructor(e,t,i,r){super(e),this._tapNext=_h,this._tapError=_h,this._tapComplete=_h,this._tapError=i||_h,this._tapComplete=r||_h,Y(t)?(this._context=this,this._tapNext=t):t&&(this._context=t,this._tapNext=t.next||_h,this._tapError=t.error||_h,this._tapComplete=t.complete||_h)}_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 rd(n,e){return t=>t.lift(new ywe(n,e))}class ywe{constructor(e,t){this.compare=e,this.keySelector=t}call(e,t){return t.subscribe(new bwe(e,this.compare,this.keySelector))}}class bwe 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 Wa={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 u6=(()=>{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 gn.isInAngularZone()?t():this._ngZone.run(t)}runOutsideAngular(t){return gn.isInAngularZone()?this._ngZone.runOutsideAngular(t):t()}verifyZoneIsNotNooped(t){t instanceof gn||console.warn(Wa.ZONE_WARNING())}}return n.\u0275fac=function(t){return new(t||n)(Oe(gn),Oe(Wc))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const d6=new Ht("ROOT_STATE_TOKEN"),h6=new Ht("FEATURE_STATE_TOKEN"),f6=new Ht("NGXS_PLUGINS"),p6=new Ht("NG_TEST_MODE"),g6=new Ht("NG_DEV_MODE"),sd="NGXS_META",m6="NGXS_OPTIONS_META",lN="NGXS_SELECTOR_META";let Gf=(()=>{class n{constructor(){this.defaultsState={},this.selectorOptions={injectContainerState:!0,suppressErrors:!0},this.compatibility={strictContentSecurityPolicy:!1},this.executionStrategy=u6}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();class vwe{constructor(e,t,i){this.previousValue=e,this.currentValue=t,this.firstChange=i}}const _6=new Ht("NGXS_EXECUTION_STRATEGY");function $f(n){return n.constructor&&n.constructor.type?n.constructor.type:n.type}const y6=(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},Tx=(n,e)=>e.split(".").reduce((t,i)=>t&&t[i],n),cN=n=>n&&"object"==typeof n&&!Array.isArray(n),uN=(n,...e)=>{if(!e.length)return n;const t=e.shift();if(cN(n)&&cN(t))for(const i in t)cN(t[i])?(n[i]||Object.assign(n,{[i]:{}}),uN(n[i],t[i])):Object.assign(n,{[i]:t[i]});return uN(n,...e)};function dN(n){if(!n.hasOwnProperty(sd)){const e={name:null,actions:{},defaults:{},path:null,makeRootSelector:t=>t.getStateGetter(e.name),children:[]};Object.defineProperty(n,sd,{value:e})}return db(n)}function db(n){return n[sd]}function fN(n){return n[lN]}function b6(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(e[$f(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 Qi(t=>{const i=$f(t.action);return n[i]&&(!e||e[t.status])})}(i,r),t())}}(n,["DISPATCHED"])}function Owe(){return me(n=>n.action)}function Mx(n){return e=>new I(t=>e.subscribe({next(i){n.leave(()=>t.next(i))},error(i){n.leave(()=>t.error(i))},complete(){n.leave(()=>t.complete())}}))}let Dx=(()=>{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)(Oe(_6))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();class Pwe extends se{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 Ix=(()=>{class n extends Pwe{}return n.\u0275fac=function(){let e;return function(i){return(e||(e=nr(n)))(i||n)}}(),n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),Fwe=(()=>{class n extends I{constructor(t,i){super(r=>{const s=t.pipe(Mx(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)(Oe(Ix),Oe(Dx))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const w6=n=>(...e)=>n.shift()(...e,(...i)=>w6(n)(...i));let Ox=(()=>{class n extends Br{constructor(){super({})}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),pN=(()=>{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)(Oe(n,12),Oe(f6,8))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),gN=(()=>{class n extends se{}return n.\u0275fac=function(){let e;return function(i){return(e||(e=nr(n)))(i||n)}}(),n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),E6=(()=>{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(oa),this._errorHandler.handleError(r)}catch(s){}})}),i.pipe(Mx(this._ngxsExecutionStrategy))}dispatchByEvents(t){return Array.isArray(t)?0===t.length?fn(this._stateStream.getValue()):ub(t.map(i=>this.dispatchSingle(i))):this.dispatchSingle(t)}dispatchSingle(t){if(!$f(t))return Fg(new Error(`This action doesn't have a type property: ${t.constructor.name}`));const r=this._stateStream.getValue();return w6([...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($a())}getActionResultStream(t){return this._actionResults.pipe(Qi(i=>i.action===t&&"DISPATCHED"!==i.status),Wi(1),$a())}createDispatchObservable(t){return t.pipe(c6(i=>{switch(i.status){case"SUCCESSFUL":return fn(this._stateStream.getValue());case"ERRORED":return Fg(i.error);default:return Yc}})).pipe($a())}}return n.\u0275fac=function(t){return new(t||n)(Oe(Wn),Oe(Ix),Oe(gN),Oe(pN),Oe(Ox),Oe(Dx))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const S6=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])&&S6(n[i])}),n};let x6=(()=>{class n{constructor(t,i){this.isDevMode=t,this.isTestMode=i}}return n.\u0275fac=function(t){return new(t||n)(Oe(g6),Oe(p6))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),C6=(()=>{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(Wa.INCORRECT_PRODUCTION()):this.isIncorrectDevelopment&&console.warn(Wa.INCORRECT_DEVELOPMENT()))}}return n.\u0275fac=function(t){return new(t||n)(Oe(x6),Oe(Gf))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),gm=(()=>{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=S6(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)(Oe(Ox),Oe(E6),Oe(Gf),Oe(C6))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),Rx=(()=>{class n{constructor(t){this._internalStateOperations=t}createStateContext(t){const i=this._internalStateOperations.getRootStateOperations();function r(l){return Tx(l,t.path)}function s(l,c){const u=y6(l,t.path,c),h=t.instance;if(h.ngxsOnChanges){const p=v6(t,{currentAppState:l,newAppState:u});h.ngxsOnChanges(p)}return i.setState(u),u}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(Wa.PATCHING_ARRAY());if("object"!=typeof n)throw new Error(Wa.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)(Oe(gm))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();class Nx{static stateNameErrorMessage(e){return Wa.STATE_NAME(e)}static checkCorrectStateName(e){if(!e)throw new Error(Wa.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(Wa.STATE_UNIQUE(r,e.name,s.name));return r}static getValidStateMeta(e){const t=db(e);if(!t)throw new Error(Wa.STATE_DECORATOR());return t}}Nx.stateNameRegex=new RegExp("^[a-zA-Z0-9_]+$");let mm=(()=>{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=xx(()=>{const c=this;function u(p){const g=c.statePaths[p];return g?b6(g.split("."),c._config):null}return this._parentFactory?this._parentFactory.getRuntimeSelectorContext():{getStateGetter(p){let g=u(p);return g||((...m)=>(g||(g=u(p)),g?g(...m):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(Nx.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[sd].name};return n.reduce((t,i)=>{const{name:r,children:s}=i[sd];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[sd].name]=t,e),{})}(i),l=[];for(const c of s){const u=a[c],h=o[c],p=u[sd];this.addRuntimeInfoToMeta(p,h);const g={name:c,path:h,isInitialised:!1,actions:p.actions,instance:this._injector.get(u),defaults:n.cloneDefaults(p.defaults)};this.hasBeenMountedAndBootstrapped(c,h)||l.push(g),this.states.push(g)}return l}addAndReturnDefaults(t){const r=this.add(t||[]);return{defaults:r.reduce((o,a)=>y6(o,a.path,a.defaults),{}),states:r}}connectActionHandlers(){null===this._actionsSubscription&&(this._actionsSubscription=this._actions.pipe(Qi(t=>"DISPATCHED"===t.status),B(({action:t})=>this.invokeActions(this._actions,t).pipe(me(()=>({action:t,status:"SUCCESSFUL"})),Ax({action:t,status:"CANCELED"}),bc(i=>fn({action:t,status:"ERRORED",error:i}))))).subscribe(t=>this._actionResults.next(t)))}invokeActions(t,i){const r=$f(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 u=o.instance[l.fn](c,i);u instanceof Promise&&(u=je(u)),u instanceof I?(u=u.pipe(Ax({})),l.options.cancelUncompleted&&(u=u.pipe(_r(t.pipe(Mwe(i)))))):u=fn({}).pipe($a()),s.push(u)}catch(u){s.push(Fg(u))}}}return s.length||s.push(fn({})),ub(s)}addToStatesMap(t){const i=[],r=this.statesByName;for(const s of t){const o=Nx.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!==Tx(this._initialState,i);return this.statesByName[t]&&r}}return n.\u0275fac=function(t){return new(t||n)(Oe(Wn),Oe(Gf),Oe(n,12),Oe(Ix),Oe(gN),Oe(Rx),Oe(aN,8))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),mN=(()=>{class n{constructor(t,i,r){this.internalStateOperations=t,this.stateContextFactory=i,this.bootstrapper=r}ngxsBootstrap(t,i){this.internalStateOperations.getRootStateOperations().dispatch(t).pipe(Qi(()=>!!i),Yr(()=>this.invokeInit(i.states)),B(()=>this.bootstrapper.appBootstrapped$),Qi(r=>!!r)).subscribe(()=>this.invokeBootstrap(i.states))}invokeInit(t){for(const i of t){const r=i.instance;if(r.ngxsOnChanges){const a=v6(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)(Oe(gm),Oe(Rx),Oe(oN))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const Px_getOptions=n=>n&&n.NGXS_SELECTOR_OPTIONS_META||{};function Lwe(n,e,t){const i=t&&t.containerClass,s=xx(function(...c){const u=e.apply(i,c);return u instanceof Function?xx.apply(null,[u]):u});Object.setPrototypeOf(s,e);const o=function(n,e){const t=function(n){return n.hasOwnProperty(lN)||Object.defineProperty(n,lN,{value:{makeRootSelector:null,originalFn:null,containerClass:null,selectorName:null,getSelectorOptions:()=>({})}}),fN(n)}(n);t.originalFn=n;let i=()=>({});e&&(t.containerClass=e.containerClass,t.selectorName=e.selectorName,i=e.getSelectorOptions||i);const r=Object.assign({},t);return t.getSelectorOptions=()=>function(n,e){return Object.assign({},Px_getOptions(n.containerClass)||{},Px_getOptions(n.originalFn)||{},n.getSelectorOptions()||{},e)}(r,i()),t}(e,t);return o.makeRootSelector=l=>{const{argumentSelectorFunctions:c,selectorOptions:u}=function(n,e,t=[]){const i=e.getSelectorOptions(),r=n.getSelectorOptions(i);return{selectorOptions:r,argumentSelectorFunctions:function(n=[],e,t){const i=[];return t&&(0===n.length||e.injectContainerState)&&db(t)&&i.push(t),n&&i.push(...n),i}(t,r,e.containerClass).map(a=>T6(a)(n))}}(l,o,n);return function(p){const g=c.map(m=>m(p));try{return s(...g)}catch(m){if(m instanceof TypeError&&u.suppressErrors)return;throw m}}},s}function T6(n){const e=fN(n)||db(n);return e&&e.makeRootSelector||(()=>n)}let cu=(()=>{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),bc(r=>{const{suppressErrors:s}=this._config.selectorOptions;return r instanceof TypeError&&s?fn(void 0):Fg(r)}),rd(),Mx(this._internalExecutionStrategy))}selectOnce(t){return this.select(t).pipe(Wi(1))}selectSnapshot(t){return this.getStoreBoundSelectorFn(t)(this._stateStream.getValue())}subscribe(t){return this._stateStream.pipe(Mx(this._internalExecutionStrategy)).subscribe(t)}snapshot(){return this._internalStateOperations.getRootStateOperations().getState()}reset(t){return this._internalStateOperations.getRootStateOperations().setState(t)}getStoreBoundSelectorFn(t){return T6(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)(Oe(Ox),Oe(gm),Oe(Gf),Oe(Dx),Oe(mm),Oe(aN,8))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),hb=(()=>{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)(Oe(cu),Oe(Gf))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n.store=null,n.config=null,n})();class zwe{static get type(){return"@@INIT"}}class Hwe{constructor(e){this.addedStates=e}static get type(){return"@@UPDATE_STATE"}}const Fx=new kg(1);let $we=(()=>{class n{constructor(t,i,r,s,o=[],a){!function(){try{const n=window.ng,t=!(n.probe&&n.coreTokens)&&Ba();Fx.next(t)}catch(n){Fx.next(!1)}finally{Fx.complete()}}();const l=t.addAndReturnDefaults(o);i.setStateToTheCurrentWithNew(l),t.connectActionHandlers(),a.ngxsBootstrap(new zwe,l)}}return n.\u0275fac=function(t){return new(t||n)(Oe(mm),Oe(gm),Oe(cu),Oe(hb),Oe(d6,8),Oe(mN))},n.\u0275mod=on({type:n}),n.\u0275inj=xt({}),n})(),Wwe=(()=>{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 Hwe(l.defaults),l))}static flattenStates(t=[]){return t.reduce((i,r)=>i.concat(r),[])}}return n.\u0275fac=function(t){return new(t||n)(Oe(cu),Oe(gm),Oe(mm),Oe(h6,8),Oe(mN))},n.\u0275mod=on({type:n}),n.\u0275inj=xt({}),n})();class Wo{static forRoot(e=[],t={}){return{ngModule:$we,providers:[mm,Rx,Fwe,Ix,oN,C6,x6,mN,E6,gN,gm,Dx,cu,Ox,hb,pN,...e,...Wo.ngxsTokenProviders(e,t)]}}static forFeature(e=[]){return{ngModule:Wwe,providers:[mm,pN,...e,{provide:h6,multi:!0,useValue:e}]}}static ngxsTokenProviders(e,t){return[{provide:p6,useValue:twe},{provide:g6,useValue:Ba},{provide:_6,useClass:t.executionStrategy||u6},{provide:d6,useValue:e},{provide:Wo.ROOT_OPTIONS,useValue:t},{provide:Gf,useFactory:Wo.ngxsConfigFactory,deps:[Wo.ROOT_OPTIONS]},{provide:RE,useFactory:Wo.appBootstrapListenerFactory,multi:!0,deps:[oN]},{provide:aN,useFactory:Wo.getInitialState},{provide:o6,useExisting:Rx},{provide:a6,useExisting:mm}]}static ngxsConfigFactory(e){return uN(new Gf,e)}static appBootstrapListenerFactory(e){return()=>e.bootstrap()}static getInitialState(){return nwe.pop()}}function _N(n,e){return(t,i)=>{if(t.hasOwnProperty("prototype"))throw new Error(Wa.ACTION_DECORATOR());const s=dN(t.constructor);Array.isArray(n)||(n=[n]);for(const o of n){const a=o.type;s.actions[a]||(s.actions[a]=[]),s.actions[a].push({fn:i,options:e||{},type:a})}}}function M6(n){return i=>{!function(n){Fx.subscribe(e=>{e&&(n.\u0275prov||console.warn(Wa.UNDECORATED_STATE_IN_IVY(n.name)))})}(i);const r=i,s=dN(r),o=Object.getPrototypeOf(r),a=function(i){return Object.assign({},i[m6]||{},n)}(o);(function(i){const{meta:r,inheritedStateClass:s,optionsWithInheritance:o}=i,{children:a,defaults:l,name:c}=o,u="string"==typeof c?c:c&&c.getName()||null;Nx.checkCorrectStateName(u),s.hasOwnProperty(sd)&&(r.actions=Object.assign({},r.actions,(s[sd]||{}).actions)),r.children=a,r.defaults=l,r.name=u})({meta:s,inheritedStateClass:o,optionsWithInheritance:a}),r[m6]=a}}function kx(n,...e){return function(t,i){const r=i.toString(),s=`__${r}__selector`,o=function(n,e,t=[]){return"string"==typeof(e=e||function(n){const e=n.length-1;return 36===n.charCodeAt(e)?n.slice(0,e):n}(n))?b6(t.length?[e,...t]:e.split("."),hb.config):e}(r,n,e);Object.defineProperties(t,{[s]:{writable:!0,enumerable:!1,configurable:!0},[r]:{enumerable:!0,configurable:!0,get(){return this[s]||(this[s]=function(n){if(!hb.store)throw new Error(Wa.SELECT_FACTORY_NOT_CONNECTED());return hb.store.select(n)}(o))}}})}}function _m(n){return(e,t,i)=>{if(!i||null===i.value)throw new Error(Wa.SELECTOR_DECORATOR());const s=i.value,o=Lwe(n,s,{containerClass:e,selectorName:t.toString(),getSelectorOptions:()=>({})}),a={configurable:!0,get:()=>o};return a.originalFn=s,a}}function Dl(n,...e){return e.length?e.some(t=>n[t]):n.altKey||n.shiftKey||n.ctrlKey||n.metaKey}Wo.\u0275fac=function(e){return new(e||Wo)},Wo.\u0275mod=on({type:Wo}),Wo.\u0275inj=xt({}),Wo.ROOT_OPTIONS=new Ht("ROOT_OPTIONS");const Kx=new uc(aS);class iSe{constructor(e){this.total=e}call(e,t){return t.subscribe(new rSe(e,this.total))}}class rSe extends y{constructor(e,t){super(e),this.total=t,this.count=0}_next(e){++this.count>this.total&&this.destination.next(e)}}function xi(n){return null!=n&&"false"!=`${n}`}function Xx(n){return Array.isArray(n)?n:[n]}function vs(n){return null==n?"":"string"==typeof n?n:`${n}px`}function ad(n){return n instanceof En?n.nativeElement:n}let zN;try{zN="undefined"!=typeof Intl&&Intl.v8BreakIterator}catch(n){zN=!1}let Eb,qf,HN,Zi=(()=>{class n{constructor(t){this._platformId=t,this.isBrowser=this._platformId?Tf(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&&!zN)&&"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)(Oe(Wc))},n.\u0275prov=We({factory:function(){return new n(Oe(Wc))},token:n,providedIn:"root"}),n})();function vm(n){return function(){if(null==Eb&&"undefined"!=typeof window)try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:()=>Eb=!0}))}finally{Eb=Eb||!1}return Eb}()?n:!!n.capture}function LH(){if(null==qf){if("object"!=typeof document||!document||"function"!=typeof Element||!Element)return qf=!1,qf;if("scrollBehavior"in document.documentElement.style)qf=!0;else{const n=Element.prototype.scrollTo;qf=!!n&&!/\{\s*\[native code\]\s*\}/.test(n.toString())}}return qf}function Zx(){let n="undefined"!=typeof document&&document?document.activeElement:null;for(;n&&n.shadowRoot;){const e=n.shadowRoot.activeElement;if(e===n)break;n=e}return n}function Yf(n){return n.composedPath?n.composedPath()[0]:n.target}let qH=(()=>{class n{constructor(t){this._platform=t}isDisabled(t){return t.hasAttribute("disabled")}isVisible(t){return function(n){return!!(n.offsetWidth||n.offsetHeight||"function"==typeof n.getClientRects&&n.getClientRects().length)}(t)&&"visible"===getComputedStyle(t).visibility}isTabbable(t){if(!this._platform.isBrowser)return!1;const i=function(n){try{return n.frameElement}catch(e){return null}}(function(n){return n.ownerDocument&&n.ownerDocument.defaultView||window}(t));if(i&&(-1===KH(i)||!this.isVisible(i)))return!1;let r=t.nodeName.toLowerCase(),s=KH(t);return t.hasAttribute("contenteditable")?-1!==s:!("iframe"===r||"object"===r||this._platform.WEBKIT&&this._platform.IOS&&!function(n){let e=n.nodeName.toLowerCase(),t="input"===e&&n.type;return"text"===t||"password"===t||"select"===e||"textarea"===e}(t))&&("audio"===r?!!t.hasAttribute("controls")&&-1!==s:"video"===r?-1!==s&&(null!==s||this._platform.FIREFOX||t.hasAttribute("controls")):t.tabIndex>=0)}isFocusable(t,i){return function(n){return!function(n){return function(n){return"input"==n.nodeName.toLowerCase()}(n)&&"hidden"==n.type}(n)&&(function(n){let e=n.nodeName.toLowerCase();return"input"===e||"select"===e||"button"===e||"textarea"===e}(n)||function(n){return function(n){return"a"==n.nodeName.toLowerCase()}(n)&&n.hasAttribute("href")}(n)||n.hasAttribute("contenteditable")||YH(n))}(t)&&!this.isDisabled(t)&&((null==i?void 0:i.ignoreVisibility)||this.isVisible(t))}}return n.\u0275fac=function(t){return new(t||n)(Oe(Zi))},n.\u0275prov=We({factory:function(){return new n(Oe(Zi))},token:n,providedIn:"root"}),n})();function YH(n){if(!n.hasAttribute("tabindex")||void 0===n.tabIndex)return!1;let e=n.getAttribute("tabindex");return"-32768"!=e&&!(!e||isNaN(parseInt(e,10)))}function KH(n){if(!YH(n))return null;const e=parseInt(n.getAttribute("tabindex")||"",10);return isNaN(e)?-1:e}class xSe{constructor(e,t,i,r,s=!1){this._element=e,this._checker=t,this._ngZone=i,this._document=r,this._hasAttached=!1,this.startAnchorListener=()=>this.focusLastTabbableElement(),this.endAnchorListener=()=>this.focusFirstTabbableElement(),this._enabled=!0,s||this.attachAnchors()}get enabled(){return this._enabled}set enabled(e){this._enabled=e,this._startAnchor&&this._endAnchor&&(this._toggleAnchorTabIndex(e,this._startAnchor),this._toggleAnchorTabIndex(e,this._endAnchor))}destroy(){const 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}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(e){return new Promise(t=>{this._executeOnStable(()=>t(this.focusInitialElement(e)))})}focusFirstTabbableElementWhenReady(e){return new Promise(t=>{this._executeOnStable(()=>t(this.focusFirstTabbableElement(e)))})}focusLastTabbableElementWhenReady(e){return new Promise(t=>{this._executeOnStable(()=>t(this.focusLastTabbableElement(e)))})}_getRegionBoundary(e){let t=this._element.querySelectorAll(`[cdk-focus-region-${e}], [cdkFocusRegion${e}], [cdk-focus-${e}]`);for(let i=0;i=0;i--){let r=t[i].nodeType===this._document.ELEMENT_NODE?this._getLastTabbableElement(t[i]):null;if(r)return r}return null}_createAnchor(){const 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}_toggleAnchorTabIndex(e,t){e?t.setAttribute("tabindex","0"):t.removeAttribute("tabindex")}toggleAnchors(e){this._startAnchor&&this._endAnchor&&(this._toggleAnchorTabIndex(e,this._startAnchor),this._toggleAnchorTabIndex(e,this._endAnchor))}_executeOnStable(e){this._ngZone.isStable?e():this._ngZone.onStable.pipe(Wi(1)).subscribe(e)}}let XH=(()=>{class n{constructor(t,i,r){this._checker=t,this._ngZone=i,this._document=r}create(t,i=!1){return new xSe(t,this._checker,this._ngZone,this._document,i)}}return n.\u0275fac=function(t){return new(t||n)(Oe(qH),Oe(gn),Oe(pn))},n.\u0275prov=We({factory:function(){return new n(Oe(qH),Oe(gn),Oe(pn))},token:n,providedIn:"root"}),n})();"undefined"!=typeof Element&∈const JH=new Ht("cdk-input-modality-detector-options"),DSe={ignoreKeys:[18,17,224,91,16]},wm=vm({passive:!0,capture:!0});let tG=(()=>{class n{constructor(t,i,r,s){this._platform=t,this._mostRecentTarget=null,this._modality=new Br(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=Yf(o))},this._onMousedown=o=>{Date.now()-this._lastTouchMs<650||(this._modality.next(function(n){return 0===n.offsetX&&0===n.offsetY}(o)?"keyboard":"mouse"),this._mostRecentTarget=Yf(o))},this._onTouchstart=o=>{!function(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)}(o)?(this._lastTouchMs=Date.now(),this._modality.next("touch"),this._mostRecentTarget=Yf(o)):this._modality.next("keyboard")},this._options=Object.assign(Object.assign({},DSe),s),this.modalityDetected=this._modality.pipe(function(n){return e=>e.lift(new iSe(n))}(1)),this.modalityChanged=this.modalityDetected.pipe(rd()),t.isBrowser&&i.runOutsideAngular(()=>{r.addEventListener("keydown",this._onKeydown,wm),r.addEventListener("mousedown",this._onMousedown,wm),r.addEventListener("touchstart",this._onTouchstart,wm)})}get mostRecentModality(){return this._modality.value}ngOnDestroy(){!this._platform.isBrowser||(document.removeEventListener("keydown",this._onKeydown,wm),document.removeEventListener("mousedown",this._onMousedown,wm),document.removeEventListener("touchstart",this._onTouchstart,wm))}}return n.\u0275fac=function(t){return new(t||n)(Oe(Zi),Oe(gn),Oe(pn),Oe(JH,8))},n.\u0275prov=We({factory:function(){return new n(Oe(Zi),Oe(gn),Oe(pn),Oe(JH,8))},token:n,providedIn:"root"}),n})();const rG=new Ht("cdk-focus-monitor-default-options"),tC=vm({passive:!0,capture:!0});let du=(()=>{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 se,this._rootNodeFocusAndBlurListener=a=>{const l=Yf(a),c="focus"===a.type?this._onFocus:this._onBlur;for(let u=l;u;u=u.parentElement)c.call(this,a,u)},this._document=s,this._detectionMode=(null==o?void 0:o.detectionMode)||0}monitor(t,i=!1){const r=ad(t);if(!this._platform.isBrowser||1!==r.nodeType)return fn(null);const s=function(n){if(function(){if(null==HN){const n="undefined"!=typeof document?document.head:null;HN=!(!n||!n.createShadowRoot&&!n.attachShadow)}return HN}()){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 se,rootNode:s};return this._elementInfo.set(r,a),this._registerGlobalListeners(a),a.subject}stopMonitoring(t){const i=ad(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=ad(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=Yf(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,tC),i.addEventListener("blur",this._rootNodeFocusAndBlurListener,tC)}),this._rootNodeFocusListenerCount.set(i,r+1),1==++this._monitoredElementCount&&(this._ngZone.runOutsideAngular(()=>{this._getWindow().addEventListener("focus",this._windowFocusListener)}),this._inputModalityDetector.modalityDetected.pipe(_r(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,tC),i.removeEventListener("blur",this._rootNodeFocusAndBlurListener,tC),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)(Oe(gn),Oe(Zi),Oe(tG),Oe(pn,8),Oe(rG,8))},n.\u0275prov=We({factory:function(){return new n(Oe(gn),Oe(Zi),Oe(tG),Oe(pn,8),Oe(rG,8))},token:n,providedIn:"root"}),n})();const lG=new Ht("cdk-dir-doc",{providedIn:"root",factory:function(){return Fc(pn)}});let Il=(()=>{class n{constructor(t){if(this.value="ltr",this.change=new sn,t){const r=t.documentElement?t.documentElement.dir:null,s=(t.body?t.body.dir:null)||r;this.value="ltr"===s||"rtl"===s?s:"ltr"}}ngOnDestroy(){this.change.complete()}}return n.\u0275fac=function(t){return new(t||n)(Oe(lG,8))},n.\u0275prov=We({factory:function(){return new n(Oe(lG,8))},token:n,providedIn:"root"}),n})();function nC(...n){return Nt(1)(fn(...n))}function ao(...n){const e=n[n.length-1];return Ce(e)?(n.pop(),t=>nC(n,t,e)):t=>nC(n,t)}function Em(n,e){return{type:7,name:n,definitions:e,options:{}}}function cd(n,e=null){return{type:4,styles:e,timings:n}}function fs(n){return{type:6,styles:n,offset:null}}function vc(n,e,t){return{type:0,name:n,styles:e,options:t}}function ud(n,e,t=null){return{type:1,expr:n,animation:e,options:t}}function hG(n){Promise.resolve(null).then(n)}class Sm{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(){hG(()=>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 pG(){return"undefined"!=typeof window&&void 0!==window.document}function KN(){return"undefined"!=typeof process&&"[object process]"==={}.toString.call(process)}let JN=(n,e)=>!1,eP=(n,e)=>!1,_G=(n,e,t)=>[];const yG=KN();(yG||"undefined"!=typeof Element)&&(JN=pG()?(n,e)=>{for(;e&&e!==document.documentElement;){if(e===n)return!0;e=e.parentNode||e.host}return!1}:(n,e)=>n.contains(e),eP=(()=>{if(yG||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]):eP}})(),_G=(n,e,t)=>{let i=[];if(t){const r=n.querySelectorAll(e);for(let s=0;s{class n{validateStyleProperty(t){return tP(t)}matchesElement(t,i){return nP(t,i)}containsElement(t,i){return iP(t,i)}query(t,i,r){return rP(t,i,r)}computeStyle(t,i,r){return r||""}animate(t,i,r,s,o,a=[],l){return new Sm(r,s)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();class iC{}iC.NOOP=new wG;function CG(n,e,t){return t?e+":"+t+";":""}function AG(n){let e="";for(let t=0;t{const r=cP(i);t&&!t.hasOwnProperty(i)&&(t[i]=n.style[r]),n.style[r]=e[i]}),KN()&&AG(n))}function Qf(n,e){n.style&&(Object.keys(e).forEach(t=>{const i=cP(t);n.style[i]=""}),KN()&&AG(n))}const HSe=/-+([a-z0-9])/g;function cP(n){return n.replace(HSe,(...e)=>e[1].toUpperCase())}function GSe(n){return n.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}class Am{constructor(e,t,i){this._element=e,this._startStyles=t,this._endStyles=i,this._state=0;let r=Am.initialStylesByElement.get(e);r||Am.initialStylesByElement.set(e,r={}),this._initialStyles=r}start(){this._state<1&&(this._startStyles&&hu(this._element,this._startStyles,this._initialStyles),this._state=1)}finish(){this.start(),this._state<2&&(hu(this._element,this._initialStyles),this._endStyles&&(hu(this._element,this._endStyles),this._endStyles=null),this._state=1)}destroy(){this.finish(),this._state<3&&(Am.initialStylesByElement.delete(this._element),this._startStyles&&(Qf(this._element,this._startStyles),this._endStyles=null),this._endStyles&&(Qf(this._element,this._endStyles),this._endStyles=null),hu(this._element,this._initialStyles),this._state=3)}}Am.initialStylesByElement=new WeakMap;const Nl=new Ht("AnimationModuleType");function Mb(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 xP(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?function(n,e=0){return function(n){return!isNaN(parseFloat(n))&&!isNaN(Number(n))}(n)?Number(n):e}(t):this.defaultTabIndex}}}let ep;try{ep="undefined"!=typeof Intl}catch(n){ep=!1}function hd(n,e,t,i){return Y(t)&&(i=t,t=void 0),i?hd(n,e,t).pipe(me(r=>P(r)?i(...r):i(r))):new I(r=>{x$(n,e,function(o){r.next(arguments.length>1?Array.prototype.slice.call(arguments):o)},r,t)})}function x$(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;o0?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 zCe=1;const HCe=Promise.resolve(),xC={};function C$(n){return n in xC&&(delete xC[n],!0)}const A$={setImmediate(n){const e=zCe++;return xC[e]=!0,HCe.then(()=>C$(e)&&n()),e},clearImmediate(n){C$(n)}};new class extends uc{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=A$.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&&(A$.clearImmediate(t),e.scheduled=void 0)}});function Tm(n){return!!n&&(n instanceof I||"function"==typeof n.lift&&"function"==typeof n.subscribe)}class YCe{constructor(e){this.durationSelector=e}call(e,t){return t.subscribe(new KCe(e,this.durationSelector))}}class KCe extends ve{constructor(e,t){super(e),this.durationSelector=t,this.hasValue=!1}_next(e){if(this.value=e,this.hasValue=!0,!this.throttled){let t;try{const{durationSelector:r}=this;t=r(e)}catch(r){return this.destination.error(r)}const i=N(t,new _t(this));!i||i.closed?this.clearThrottle():this.add(this.throttled=i)}}clearThrottle(){const{value:e,hasValue:t,throttled:i}=this;i&&(this.remove(i),this.throttled=void 0,i.unsubscribe()),t&&(this.value=void 0,this.hasValue=!1,this.destination.next(e))}notifyNext(){this.clearThrottle()}notifyComplete(){this.clearThrottle()}}function T$(n){return!P(n)&&n-parseFloat(n)+1>=0}function QCe(n){const{index:e,period:t,subscriber:i}=n;if(i.next(e),!i.closed){if(-1===t)return i.complete();n.index=e+1,this.schedule(n,t)}}function CC(n,e=Kx){return function(n){return function(t){return t.lift(new YCe(n))}}(()=>function(n=0,e,t){let i=-1;return T$(e)?i=Number(e)<1?1:Number(e):Ce(e)&&(t=e),Ce(t)||(t=Kx),new I(r=>{const s=T$(n)?n:+n-t.now();return t.schedule(QCe,s,{index:0,period:i,subscriber:r})})}(n,e))}let D$=(()=>{class n{constructor(){this._listeners=[]}notify(t,i){for(let r of this._listeners)r(t,i)}listen(t){return this._listeners.push(t),()=>{this._listeners=this._listeners.filter(i=>t!==i)}}ngOnDestroy(){this._listeners=[]}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({factory:function(){return new n},token:n,providedIn:"root"}),n})(),Mm=(()=>{class n{constructor(t,i,r){this._ngZone=t,this._platform=i,this._scrolled=new se,this._globalSubscription=null,this._scrolledCount=0,this.scrollContainers=new Map,this._document=r}register(t){this.scrollContainers.has(t)||this.scrollContainers.set(t,t.elementScrolled().subscribe(()=>this._scrolled.next(t)))}deregister(t){const i=this.scrollContainers.get(t);i&&(i.unsubscribe(),this.scrollContainers.delete(t))}scrolled(t=20){return this._platform.isBrowser?new I(i=>{this._globalSubscription||this._addGlobalListener();const r=t>0?this._scrolled.pipe(CC(t)).subscribe(i):this._scrolled.subscribe(i);return this._scrolledCount++,()=>{r.unsubscribe(),this._scrolledCount--,this._scrolledCount||this._removeGlobalListener()}}):fn()}ngOnDestroy(){this._removeGlobalListener(),this.scrollContainers.forEach((t,i)=>this.deregister(i)),this._scrolled.complete()}ancestorScrolled(t,i){const r=this.getAncestorScrollContainers(t);return this.scrolled(i).pipe(Qi(s=>!s||r.indexOf(s)>-1))}getAncestorScrollContainers(t){const i=[];return this.scrollContainers.forEach((r,s)=>{this._scrollableContainsElement(s,t)&&i.push(s)}),i}_getWindow(){return this._document.defaultView||window}_scrollableContainsElement(t,i){let r=ad(i),s=t.getElementRef().nativeElement;do{if(r==s)return!0}while(r=r.parentElement);return!1}_addGlobalListener(){this._globalSubscription=this._ngZone.runOutsideAngular(()=>hd(this._getWindow().document,"scroll").subscribe(()=>this._scrolled.next()))}_removeGlobalListener(){this._globalSubscription&&(this._globalSubscription.unsubscribe(),this._globalSubscription=null)}}return n.\u0275fac=function(t){return new(t||n)(Oe(gn),Oe(Zi),Oe(pn,8))},n.\u0275prov=We({factory:function(){return new n(Oe(gn),Oe(Zi),Oe(pn,8))},token:n,providedIn:"root"}),n})(),Dm=(()=>{class n{constructor(t,i,r){this._platform=t,this._change=new se,this._changeListener=s=>{this._change.next(s)},this._document=r,i.runOutsideAngular(()=>{if(t.isBrowser){const s=this._getWindow();s.addEventListener("resize",this._changeListener),s.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:i,height:r}=this.getViewportSize();return{top:t.top,left:t.left,bottom:t.top+r,right:t.left+i,height:r,width:i}}getViewportScrollPosition(){if(!this._platform.isBrowser)return{top:0,left:0};const t=this._document,i=this._getWindow(),r=t.documentElement,s=r.getBoundingClientRect();return{top:-s.top||t.body.scrollTop||i.scrollY||r.scrollTop||0,left:-s.left||t.body.scrollLeft||i.scrollX||r.scrollLeft||0}}change(t=20){return t>0?this._change.pipe(CC(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 n.\u0275fac=function(t){return new(t||n)(Oe(Zi),Oe(gn),Oe(pn,8))},n.\u0275prov=We({factory:function(){return new n(Oe(Zi),Oe(gn),Oe(pn,8))},token:n,providedIn:"root"}),n})();class DP{attach(e){return this._attachedHost=e,e.attach(this)}detach(){let e=this._attachedHost;null!=e&&(this._attachedHost=null,e.detach())}get isAttached(){return null!=this._attachedHost}setAttachedHost(e){this._attachedHost=e}}class TC extends DP{constructor(e,t,i,r){super(),this.component=e,this.viewContainerRef=t,this.injector=i,this.componentFactoryResolver=r}}class Im extends DP{constructor(e,t,i){super(),this.templateRef=e,this.viewContainerRef=t,this.context=i}get origin(){return this.templateRef.elementRef}attach(e,t=this.context){return this.context=t,super.attach(e)}detach(){return this.context=void 0,super.detach()}}class p1e extends DP{constructor(e){super(),this.element=e instanceof En?e.nativeElement:e}}class MC{constructor(){this._isDisposed=!1,this.attachDomPortal=null}hasAttached(){return!!this._attachedPortal}attach(e){return e instanceof TC?(this._attachedPortal=e,this.attachComponentPortal(e)):e instanceof Im?(this._attachedPortal=e,this.attachTemplatePortal(e)):this.attachDomPortal&&e instanceof p1e?(this._attachedPortal=e,this.attachDomPortal(e)):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(e){this._disposeFn=e}_invokeDisposeFn(){this._disposeFn&&(this._disposeFn(),this._disposeFn=null)}}class g1e extends MC{constructor(e,t,i,r,s){super(),this.outletElement=e,this._componentFactoryResolver=t,this._appRef=i,this._defaultInjector=r,this.attachDomPortal=o=>{const a=o.element,l=this._document.createComment("dom-portal");a.parentNode.insertBefore(l,a),this.outletElement.appendChild(a),this._attachedPortal=o,super.setDisposeFn(()=>{l.parentNode&&l.parentNode.replaceChild(a,l)})},this._document=s}attachComponentPortal(e){const i=(e.componentFactoryResolver||this._componentFactoryResolver).resolveComponentFactory(e.component);let r;return e.viewContainerRef?(r=e.viewContainerRef.createComponent(i,e.viewContainerRef.length,e.injector||e.viewContainerRef.injector),this.setDisposeFn(()=>r.destroy())):(r=i.create(e.injector||this._defaultInjector),this._appRef.attachView(r.hostView),this.setDisposeFn(()=>{this._appRef.detachView(r.hostView),r.destroy()})),this.outletElement.appendChild(this._getComponentRootNode(r)),this._attachedPortal=e,r}attachTemplatePortal(e){let t=e.viewContainerRef,i=t.createEmbeddedView(e.templateRef,e.context);return i.rootNodes.forEach(r=>this.outletElement.appendChild(r)),i.detectChanges(),this.setDisposeFn(()=>{let r=t.indexOf(i);-1!==r&&t.remove(r)}),this._attachedPortal=e,i}dispose(){super.dispose(),null!=this.outletElement.parentNode&&this.outletElement.parentNode.removeChild(this.outletElement)}_getComponentRootNode(e){return e.hostView.rootNodes[0]}}let tp=(()=>{class n extends MC{constructor(t,i,r){super(),this._componentFactoryResolver=t,this._viewContainerRef=i,this._isInitialized=!1,this.attached=new sn,this.attachDomPortal=s=>{const o=s.element,a=this._document.createComment("dom-portal");s.setAttachedHost(this),o.parentNode.insertBefore(a,o),this._getRootNode().appendChild(o),this._attachedPortal=s,super.setDisposeFn(()=>{a.parentNode&&a.parentNode.replaceChild(o,a)})},this._document=r}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 i=null!=t.viewContainerRef?t.viewContainerRef:this._viewContainerRef,s=(t.componentFactoryResolver||this._componentFactoryResolver).resolveComponentFactory(t.component),o=i.createComponent(s,i.length,t.injector||i.injector);return i!==this._viewContainerRef&&this._getRootNode().appendChild(o.hostView.rootNodes[0]),super.setDisposeFn(()=>o.destroy()),this._attachedPortal=t,this._attachedRef=o,this.attached.emit(o),o}attachTemplatePortal(t){t.setAttachedHost(this);const i=this._viewContainerRef.createEmbeddedView(t.templateRef,t.context);return super.setDisposeFn(()=>this._viewContainerRef.clear()),this._attachedPortal=t,this._attachedRef=i,this.attached.emit(i),i}_getRootNode(){const t=this._viewContainerRef.element.nativeElement;return t.nodeType===t.ELEMENT_NODE?t:t.parentNode}}return n.\u0275fac=function(t){return new(t||n)(xe(wl),xe(Ns),xe(pn))},n.\u0275dir=Rt({type:n,selectors:[["","cdkPortalOutlet",""]],inputs:{portal:["cdkPortalOutlet","portal"]},outputs:{attached:"attached"},exportAs:["cdkPortalOutlet"],features:[An]}),n})();const k$=LH();class b1e{constructor(e,t){this._viewportRuler=e,this._previousHTMLStyles={top:"",left:""},this._isEnabled=!1,this._document=t}attach(){}enable(){if(this._canBeEnabled()){const e=this._document.documentElement;this._previousScrollPosition=this._viewportRuler.getViewportScrollPosition(),this._previousHTMLStyles.left=e.style.left||"",this._previousHTMLStyles.top=e.style.top||"",e.style.left=vs(-this._previousScrollPosition.left),e.style.top=vs(-this._previousScrollPosition.top),e.classList.add("cdk-global-scrollblock"),this._isEnabled=!0}}disable(){if(this._isEnabled){const e=this._document.documentElement,i=e.style,r=this._document.body.style,s=i.scrollBehavior||"",o=r.scrollBehavior||"";this._isEnabled=!1,i.left=this._previousHTMLStyles.left,i.top=this._previousHTMLStyles.top,e.classList.remove("cdk-global-scrollblock"),k$&&(i.scrollBehavior=r.scrollBehavior="auto"),window.scroll(this._previousScrollPosition.left,this._previousScrollPosition.top),k$&&(i.scrollBehavior=s,r.scrollBehavior=o)}}_canBeEnabled(){if(this._document.documentElement.classList.contains("cdk-global-scrollblock")||this._isEnabled)return!1;const t=this._document.body,i=this._viewportRuler.getViewportSize();return t.scrollHeight>i.height||t.scrollWidth>i.width}}class v1e{constructor(e,t,i,r){this._scrollDispatcher=e,this._ngZone=t,this._viewportRuler=i,this._config=r,this._scrollSubscription=null,this._detach=()=>{this.disable(),this._overlayRef.hasAttached()&&this._ngZone.run(()=>this._overlayRef.detach())}}attach(e){this._overlayRef=e}enable(){if(this._scrollSubscription)return;const e=this._scrollDispatcher.scrolled(0);this._config&&this._config.threshold&&this._config.threshold>1?(this._initialScrollPosition=this._viewportRuler.getViewportScrollPosition().top,this._scrollSubscription=e.subscribe(()=>{const t=this._viewportRuler.getViewportScrollPosition().top;Math.abs(t-this._initialScrollPosition)>this._config.threshold?this._detach():this._overlayRef.updatePosition()})):this._scrollSubscription=e.subscribe(this._detach)}disable(){this._scrollSubscription&&(this._scrollSubscription.unsubscribe(),this._scrollSubscription=null)}detach(){this.disable(),this._overlayRef=null}}class L${enable(){}disable(){}attach(){}}function IP(n,e){return e.some(t=>n.bottomt.bottom||n.rightt.right)}function B$(n,e){return e.some(t=>n.topt.bottom||n.leftt.right)}class w1e{constructor(e,t,i,r){this._scrollDispatcher=e,this._viewportRuler=t,this._ngZone=i,this._config=r,this._scrollSubscription=null}attach(e){this._overlayRef=e}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:i,height:r}=this._viewportRuler.getViewportSize();IP(t,[{width:i,height:r,bottom:r,right:i,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 E1e=(()=>{class n{constructor(t,i,r,s){this._scrollDispatcher=t,this._viewportRuler=i,this._ngZone=r,this.noop=()=>new L$,this.close=o=>new v1e(this._scrollDispatcher,this._ngZone,this._viewportRuler,o),this.block=()=>new b1e(this._viewportRuler,this._document),this.reposition=o=>new w1e(this._scrollDispatcher,this._viewportRuler,this._ngZone,o),this._document=s}}return n.\u0275fac=function(t){return new(t||n)(Oe(Mm),Oe(Dm),Oe(gn),Oe(pn))},n.\u0275prov=We({factory:function(){return new n(Oe(Mm),Oe(Dm),Oe(gn),Oe(pn))},token:n,providedIn:"root"}),n})();class IC{constructor(e){if(this.scrollStrategy=new L$,this.panelClass="",this.hasBackdrop=!1,this.backdropClass="cdk-overlay-dark-backdrop",this.disposeOnNavigation=!1,e){const t=Object.keys(e);for(const i of t)void 0!==e[i]&&(this[i]=e[i])}}}class S1e{constructor(e,t,i,r,s){this.offsetX=i,this.offsetY=r,this.panelClass=s,this.originX=e.originX,this.originY=e.originY,this.overlayX=t.overlayX,this.overlayY=t.overlayY}}class x1e{constructor(e,t){this.connectionPair=e,this.scrollableViewProperties=t}}let j$=(()=>{class n{constructor(t){this._attachedOverlays=[],this._document=t}ngOnDestroy(){this.detach()}add(t){this.remove(t),this._attachedOverlays.push(t)}remove(t){const i=this._attachedOverlays.indexOf(t);i>-1&&this._attachedOverlays.splice(i,1),0===this._attachedOverlays.length&&this.detach()}}return n.\u0275fac=function(t){return new(t||n)(Oe(pn))},n.\u0275prov=We({factory:function(){return new n(Oe(pn))},token:n,providedIn:"root"}),n})(),C1e=(()=>{class n extends j${constructor(t){super(t),this._keydownListener=i=>{const r=this._attachedOverlays;for(let s=r.length-1;s>-1;s--)if(r[s]._keydownEvents.observers.length>0){r[s]._keydownEvents.next(i);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 n.\u0275fac=function(t){return new(t||n)(Oe(pn))},n.\u0275prov=We({factory:function(){return new n(Oe(pn))},token:n,providedIn:"root"}),n})(),A1e=(()=>{class n extends j${constructor(t,i){super(t),this._platform=i,this._cursorStyleIsSet=!1,this._clickListener=r=>{const s=Yf(r),o=this._attachedOverlays.slice();for(let a=o.length-1;a>-1;a--){const l=o[a];if(!(l._outsidePointerEvents.observers.length<1)&&l.hasAttached()){if(l.overlayElement.contains(s))break;l._outsidePointerEvents.next(r)}}}}add(t){if(super.add(t),!this._isAttached){const i=this._document.body;i.addEventListener("click",this._clickListener,!0),i.addEventListener("auxclick",this._clickListener,!0),i.addEventListener("contextmenu",this._clickListener,!0),this._platform.IOS&&!this._cursorStyleIsSet&&(this._cursorOriginalValue=i.style.cursor,i.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 n.\u0275fac=function(t){return new(t||n)(Oe(pn),Oe(Zi))},n.\u0275prov=We({factory:function(){return new n(Oe(pn),Oe(Zi))},token:n,providedIn:"root"}),n})();const Sh="undefined"!=typeof window?window:{},V$=void 0!==Sh.__karma__&&!!Sh.__karma__||void 0!==Sh.jasmine&&!!Sh.jasmine||void 0!==Sh.jest&&!!Sh.jest||void 0!==Sh.Mocha&&!!Sh.Mocha;let Ob=(()=>{class n{constructor(t,i){this._platform=i,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||V$){const r=this._document.querySelectorAll(`.${t}[platform="server"], .${t}[platform="test"]`);for(let s=0;sthis._backdropClick.next(u),this._keydownEvents=new se,this._outsidePointerEvents=new se,r.scrollStrategy&&(this._scrollStrategy=r.scrollStrategy,this._scrollStrategy.attach(this)),this._positionStrategy=r.positionStrategy}get overlayElement(){return this._pane}get backdropElement(){return this._backdropElement}get hostElement(){return this._host}attach(e){let t=this._portalOutlet.attach(e);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(Wi(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),t}detach(){if(!this.hasAttached())return;this.detachBackdrop(),this._togglePointerEvents(!1),this._positionStrategy&&this._positionStrategy.detach&&this._positionStrategy.detach(),this._scrollStrategy&&this._scrollStrategy.disable();const e=this._portalOutlet.detach();return this._detachments.next(),this._keyboardDispatcher.remove(this),this._detachContentWhenStable(),this._locationChanges.unsubscribe(),this._outsideClickDispatcher.remove(this),e}dispose(){const e=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,e&&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(e){e!==this._positionStrategy&&(this._positionStrategy&&this._positionStrategy.dispose(),this._positionStrategy=e,this.hasAttached()&&(e.attach(this),this.updatePosition()))}updateSize(e){this._config=Object.assign(Object.assign({},this._config),e),this._updateElementSize()}setDirection(e){this._config=Object.assign(Object.assign({},this._config),{direction:e}),this._updateElementDirection()}addPanelClass(e){this._pane&&this._toggleClasses(this._pane,e,!0)}removePanelClass(e){this._pane&&this._toggleClasses(this._pane,e,!1)}getDirection(){const e=this._config.direction;return e?"string"==typeof e?e:e.value:"ltr"}updateScrollStrategy(e){e!==this._scrollStrategy&&(this._disposeScrollStrategy(),this._scrollStrategy=e,this.hasAttached()&&(e.attach(this),e.enable()))}_updateElementDirection(){this._host.setAttribute("dir",this.getDirection())}_updateElementSize(){if(!this._pane)return;const e=this._pane.style;e.width=vs(this._config.width),e.height=vs(this._config.height),e.minWidth=vs(this._config.minWidth),e.minHeight=vs(this._config.minHeight),e.maxWidth=vs(this._config.maxWidth),e.maxHeight=vs(this._config.maxHeight)}_togglePointerEvents(e){this._pane.style.pointerEvents=e?"":"none"}_attachBackdrop(){const e="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(e)})}):this._backdropElement.classList.add(e)}_updateStackingOrder(){this._host.nextSibling&&this._host.parentNode.appendChild(this._host)}detachBackdrop(){let e=this._backdropElement;if(!e)return;let t,i=()=>{e&&(e.removeEventListener("click",this._backdropClickHandler),e.removeEventListener("transitionend",i),e.parentNode&&e.parentNode.removeChild(e)),this._backdropElement==e&&(this._backdropElement=null),this._config.backdropClass&&this._toggleClasses(e,this._config.backdropClass,!1),clearTimeout(t)};e.classList.remove("cdk-overlay-backdrop-showing"),this._ngZone.runOutsideAngular(()=>{e.addEventListener("transitionend",i)}),e.style.pointerEvents="none",t=this._ngZone.runOutsideAngular(()=>setTimeout(i,500))}_toggleClasses(e,t,i){const r=e.classList;Xx(t).forEach(s=>{s&&(i?r.add(s):r.remove(s))})}_detachContentWhenStable(){this._ngZone.runOutsideAngular(()=>{const e=this._ngZone.onStable.pipe(_r(kn(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)),e.unsubscribe())})})}_disposeScrollStrategy(){const e=this._scrollStrategy;e&&(e.disable(),e.detach&&e.detach())}}const U$="cdk-overlay-connected-position-bounding-box",M1e=/([A-Za-z%]+)$/;class z${constructor(e,t,i,r,s){this._viewportRuler=t,this._document=i,this._platform=r,this._overlayContainer=s,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 se,this._resizeSubscription=x.EMPTY,this._offsetX=0,this._offsetY=0,this._appliedPanelClasses=[],this.positionChanges=this._positionChanges,this.setOrigin(e)}get positions(){return this._preferredPositions}attach(e){this._validatePositions(),e.hostElement.classList.add(U$),this._overlayRef=e,this._boundingBox=e.hostElement,this._pane=e.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 e=this._originRect,t=this._overlayRect,i=this._viewportRect,r=[];let s;for(let o of this._preferredPositions){let a=this._getOriginPoint(e,o),l=this._getOverlayPoint(a,t,o),c=this._getOverlayFit(l,t,i,o);if(c.isCompletelyWithinViewport)return this._isPushed=!1,void this._applyPosition(o,a);this._canFitWithFlexibleDimensions(c,l,i)?r.push({position:o,origin:a,overlayRect:t,boundingBoxRect:this._calculateBoundingBoxRect(a,o)}):(!s||s.overlayFit.visibleAreaa&&(a=c,o=l)}return this._isPushed=!1,void this._applyPosition(o.position,o.origin)}if(this._canPush)return this._isPushed=!0,void this._applyPosition(s.position,s.originPoint);this._applyPosition(s.position,s.originPoint)}detach(){this._clearPanelClasses(),this._lastPosition=null,this._previousPushAmount=null,this._resizeSubscription.unsubscribe()}dispose(){this._isDisposed||(this._boundingBox&&np(this._boundingBox.style,{top:"",left:"",right:"",bottom:"",height:"",width:"",alignItems:"",justifyContent:""}),this._pane&&this._resetOverlayElementStyles(),this._overlayRef&&this._overlayRef.hostElement.classList.remove(U$),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 e=this._lastPosition||this._preferredPositions[0],t=this._getOriginPoint(this._originRect,e);this._applyPosition(e,t)}}withScrollableContainers(e){return this._scrollables=e,this}withPositions(e){return this._preferredPositions=e,-1===e.indexOf(this._lastPosition)&&(this._lastPosition=null),this._validatePositions(),this}withViewportMargin(e){return this._viewportMargin=e,this}withFlexibleDimensions(e=!0){return this._hasFlexibleDimensions=e,this}withGrowAfterOpen(e=!0){return this._growAfterOpen=e,this}withPush(e=!0){return this._canPush=e,this}withLockedPosition(e=!0){return this._positionLocked=e,this}setOrigin(e){return this._origin=e,this}withDefaultOffsetX(e){return this._offsetX=e,this}withDefaultOffsetY(e){return this._offsetY=e,this}withTransformOriginOn(e){return this._transformOriginSelector=e,this}_getOriginPoint(e,t){let i,r;if("center"==t.originX)i=e.left+e.width/2;else{const s=this._isRtl()?e.right:e.left,o=this._isRtl()?e.left:e.right;i="start"==t.originX?s:o}return r="center"==t.originY?e.top+e.height/2:"top"==t.originY?e.top:e.bottom,{x:i,y:r}}_getOverlayPoint(e,t,i){let r,s;return r="center"==i.overlayX?-t.width/2:"start"===i.overlayX?this._isRtl()?-t.width:0:this._isRtl()?0:-t.width,s="center"==i.overlayY?-t.height/2:"top"==i.overlayY?0:-t.height,{x:e.x+r,y:e.y+s}}_getOverlayFit(e,t,i,r){const s=G$(t);let{x:o,y:a}=e,l=this._getOffset(r,"x"),c=this._getOffset(r,"y");l&&(o+=l),c&&(a+=c);let p=0-a,g=a+s.height-i.height,m=this._subtractOverflows(s.width,0-o,o+s.width-i.width),w=this._subtractOverflows(s.height,p,g),C=m*w;return{visibleArea:C,isCompletelyWithinViewport:s.width*s.height===C,fitsInViewportVertically:w===s.height,fitsInViewportHorizontally:m==s.width}}_canFitWithFlexibleDimensions(e,t,i){if(this._hasFlexibleDimensions){const r=i.bottom-t.y,s=i.right-t.x,o=H$(this._overlayRef.getConfig().minHeight),a=H$(this._overlayRef.getConfig().minWidth),c=e.fitsInViewportHorizontally||null!=a&&a<=s;return(e.fitsInViewportVertically||null!=o&&o<=r)&&c}return!1}_pushOverlayOnScreen(e,t,i){if(this._previousPushAmount&&this._positionLocked)return{x:e.x+this._previousPushAmount.x,y:e.y+this._previousPushAmount.y};const r=G$(t),s=this._viewportRect,o=Math.max(e.x+r.width-s.width,0),a=Math.max(e.y+r.height-s.height,0),l=Math.max(s.top-i.top-e.y,0),c=Math.max(s.left-i.left-e.x,0);let u=0,h=0;return u=r.width<=s.width?c||-o:e.xm&&!this._isInitialRender&&!this._growAfterOpen&&(o=e.y-m/2)}if("end"===t.overlayX&&!r||"start"===t.overlayX&&r)p=i.width-e.x+this._viewportMargin,u=e.x-this._viewportMargin;else if("start"===t.overlayX&&!r||"end"===t.overlayX&&r)h=e.x,u=i.right-e.x;else{const g=Math.min(i.right-e.x+i.left,e.x),m=this._lastBoundingBoxSize.width;u=2*g,h=e.x-g,u>m&&!this._isInitialRender&&!this._growAfterOpen&&(h=e.x-m/2)}return{top:o,left:h,bottom:a,right:p,width:u,height:s}}_setBoundingBoxStyles(e,t){const i=this._calculateBoundingBoxRect(e,t);!this._isInitialRender&&!this._growAfterOpen&&(i.height=Math.min(i.height,this._lastBoundingBoxSize.height),i.width=Math.min(i.width,this._lastBoundingBoxSize.width));const r={};if(this._hasExactPosition())r.top=r.left="0",r.bottom=r.right=r.maxHeight=r.maxWidth="",r.width=r.height="100%";else{const s=this._overlayRef.getConfig().maxHeight,o=this._overlayRef.getConfig().maxWidth;r.height=vs(i.height),r.top=vs(i.top),r.bottom=vs(i.bottom),r.width=vs(i.width),r.left=vs(i.left),r.right=vs(i.right),r.alignItems="center"===t.overlayX?"center":"end"===t.overlayX?"flex-end":"flex-start",r.justifyContent="center"===t.overlayY?"center":"bottom"===t.overlayY?"flex-end":"flex-start",s&&(r.maxHeight=vs(s)),o&&(r.maxWidth=vs(o))}this._lastBoundingBoxSize=i,np(this._boundingBox.style,r)}_resetBoundingBoxStyles(){np(this._boundingBox.style,{top:"0",left:"0",right:"0",bottom:"0",height:"",width:"",alignItems:"",justifyContent:""})}_resetOverlayElementStyles(){np(this._pane.style,{top:"",left:"",bottom:"",right:"",position:"",transform:""})}_setOverlayElementStyles(e,t){const i={},r=this._hasExactPosition(),s=this._hasFlexibleDimensions,o=this._overlayRef.getConfig();if(r){const u=this._viewportRuler.getViewportScrollPosition();np(i,this._getExactOverlayY(t,e,u)),np(i,this._getExactOverlayX(t,e,u))}else i.position="static";let a="",l=this._getOffset(t,"x"),c=this._getOffset(t,"y");l&&(a+=`translateX(${l}px) `),c&&(a+=`translateY(${c}px)`),i.transform=a.trim(),o.maxHeight&&(r?i.maxHeight=vs(o.maxHeight):s&&(i.maxHeight="")),o.maxWidth&&(r?i.maxWidth=vs(o.maxWidth):s&&(i.maxWidth="")),np(this._pane.style,i)}_getExactOverlayY(e,t,i){let r={top:"",bottom:""},s=this._getOverlayPoint(t,this._overlayRect,e);this._isPushed&&(s=this._pushOverlayOnScreen(s,this._overlayRect,i));let o=this._overlayContainer.getContainerElement().getBoundingClientRect().top;return s.y-=o,"bottom"===e.overlayY?r.bottom=this._document.documentElement.clientHeight-(s.y+this._overlayRect.height)+"px":r.top=vs(s.y),r}_getExactOverlayX(e,t,i){let o,r={left:"",right:""},s=this._getOverlayPoint(t,this._overlayRect,e);return this._isPushed&&(s=this._pushOverlayOnScreen(s,this._overlayRect,i)),o=this._isRtl()?"end"===e.overlayX?"left":"right":"end"===e.overlayX?"right":"left","right"===o?r.right=this._document.documentElement.clientWidth-(s.x+this._overlayRect.width)+"px":r.left=vs(s.x),r}_getScrollVisibility(){const e=this._getOriginRect(),t=this._pane.getBoundingClientRect(),i=this._scrollables.map(r=>r.getElementRef().nativeElement.getBoundingClientRect());return{isOriginClipped:B$(e,i),isOriginOutsideView:IP(e,i),isOverlayClipped:B$(t,i),isOverlayOutsideView:IP(t,i)}}_subtractOverflows(e,...t){return t.reduce((i,r)=>i-Math.max(r,0),e)}_getNarrowedViewportRect(){const e=this._document.documentElement.clientWidth,t=this._document.documentElement.clientHeight,i=this._viewportRuler.getViewportScrollPosition();return{top:i.top+this._viewportMargin,left:i.left+this._viewportMargin,right:i.left+e-this._viewportMargin,bottom:i.top+t-this._viewportMargin,width:e-2*this._viewportMargin,height:t-2*this._viewportMargin}}_isRtl(){return"rtl"===this._overlayRef.getDirection()}_hasExactPosition(){return!this._hasFlexibleDimensions||this._isPushed}_getOffset(e,t){return"x"===t?null==e.offsetX?this._offsetX:e.offsetX:null==e.offsetY?this._offsetY:e.offsetY}_validatePositions(){}_addPanelClasses(e){this._pane&&Xx(e).forEach(t=>{""!==t&&-1===this._appliedPanelClasses.indexOf(t)&&(this._appliedPanelClasses.push(t),this._pane.classList.add(t))})}_clearPanelClasses(){this._pane&&(this._appliedPanelClasses.forEach(e=>{this._pane.classList.remove(e)}),this._appliedPanelClasses=[])}_getOriginRect(){const e=this._origin;if(e instanceof En)return e.nativeElement.getBoundingClientRect();if(e instanceof Element)return e.getBoundingClientRect();const t=e.width||0,i=e.height||0;return{top:e.y,bottom:e.y+i,left:e.x,right:e.x+t,height:i,width:t}}}function np(n,e){for(let t in e)e.hasOwnProperty(t)&&(n[t]=e[t]);return n}function H$(n){if("number"!=typeof n&&null!=n){const[e,t]=n.split(M1e);return t&&"px"!==t?null:parseFloat(e)}return n||null}function G$(n){return{top:Math.floor(n.top),right:Math.floor(n.right),bottom:Math.floor(n.bottom),left:Math.floor(n.left),width:Math.floor(n.width),height:Math.floor(n.height)}}class D1e{constructor(e,t,i,r,s,o,a){this._preferredPositions=[],this._positionStrategy=new z$(i,r,s,o,a).withFlexibleDimensions(!1).withPush(!1).withViewportMargin(0),this.withFallbackPosition(e,t),this.onPositionChange=this._positionStrategy.positionChanges}get positions(){return this._preferredPositions}attach(e){this._overlayRef=e,this._positionStrategy.attach(e),this._direction&&(e.setDirection(this._direction),this._direction=null)}dispose(){this._positionStrategy.dispose()}detach(){this._positionStrategy.detach()}apply(){this._positionStrategy.apply()}recalculateLastPosition(){this._positionStrategy.reapplyLastPosition()}withScrollableContainers(e){this._positionStrategy.withScrollableContainers(e)}withFallbackPosition(e,t,i,r){const s=new S1e(e,t,i,r);return this._preferredPositions.push(s),this._positionStrategy.withPositions(this._preferredPositions),this}withDirection(e){return this._overlayRef?this._overlayRef.setDirection(e):this._direction=e,this}withOffsetX(e){return this._positionStrategy.withDefaultOffsetX(e),this}withOffsetY(e){return this._positionStrategy.withDefaultOffsetY(e),this}withLockedPosition(e){return this._positionStrategy.withLockedPosition(e),this}withPositions(e){return this._preferredPositions=e.slice(),this._positionStrategy.withPositions(this._preferredPositions),this}setOrigin(e){return this._positionStrategy.setOrigin(e),this}}const W$="cdk-global-overlay-wrapper";class I1e{constructor(){this._cssPosition="static",this._topOffset="",this._bottomOffset="",this._leftOffset="",this._rightOffset="",this._alignItems="",this._justifyContent="",this._width="",this._height=""}attach(e){const t=e.getConfig();this._overlayRef=e,this._width&&!t.width&&e.updateSize({width:this._width}),this._height&&!t.height&&e.updateSize({height:this._height}),e.hostElement.classList.add(W$),this._isDisposed=!1}top(e=""){return this._bottomOffset="",this._topOffset=e,this._alignItems="flex-start",this}left(e=""){return this._rightOffset="",this._leftOffset=e,this._justifyContent="flex-start",this}bottom(e=""){return this._topOffset="",this._bottomOffset=e,this._alignItems="flex-end",this}right(e=""){return this._leftOffset="",this._rightOffset=e,this._justifyContent="flex-end",this}width(e=""){return this._overlayRef?this._overlayRef.updateSize({width:e}):this._width=e,this}height(e=""){return this._overlayRef?this._overlayRef.updateSize({height:e}):this._height=e,this}centerHorizontally(e=""){return this.left(e),this._justifyContent="center",this}centerVertically(e=""){return this.top(e),this._alignItems="center",this}apply(){if(!this._overlayRef||!this._overlayRef.hasAttached())return;const e=this._overlayRef.overlayElement.style,t=this._overlayRef.hostElement.style,i=this._overlayRef.getConfig(),{width:r,height:s,maxWidth:o,maxHeight:a}=i,l=!("100%"!==r&&"100vw"!==r||o&&"100%"!==o&&"100vw"!==o),c=!("100%"!==s&&"100vh"!==s||a&&"100%"!==a&&"100vh"!==a);e.position=this._cssPosition,e.marginLeft=l?"0":this._leftOffset,e.marginTop=c?"0":this._topOffset,e.marginBottom=this._bottomOffset,e.marginRight=this._rightOffset,l?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=c?"flex-start":this._alignItems}dispose(){if(this._isDisposed||!this._overlayRef)return;const e=this._overlayRef.overlayElement.style,t=this._overlayRef.hostElement,i=t.style;t.classList.remove(W$),i.justifyContent=i.alignItems=e.marginTop=e.marginBottom=e.marginLeft=e.marginRight=e.position="",this._overlayRef=null,this._isDisposed=!0}}let O1e=(()=>{class n{constructor(t,i,r,s){this._viewportRuler=t,this._document=i,this._platform=r,this._overlayContainer=s}global(){return new I1e}connectedTo(t,i,r){return new D1e(i,r,t,this._viewportRuler,this._document,this._platform,this._overlayContainer)}flexibleConnectedTo(t){return new z$(t,this._viewportRuler,this._document,this._platform,this._overlayContainer)}}return n.\u0275fac=function(t){return new(t||n)(Oe(Dm),Oe(pn),Oe(Zi),Oe(Ob))},n.\u0275prov=We({factory:function(){return new n(Oe(Dm),Oe(pn),Oe(Zi),Oe(Ob))},token:n,providedIn:"root"}),n})(),R1e=0,wc=(()=>{class n{constructor(t,i,r,s,o,a,l,c,u,h,p){this.scrollStrategies=t,this._overlayContainer=i,this._componentFactoryResolver=r,this._positionBuilder=s,this._keyboardDispatcher=o,this._injector=a,this._ngZone=l,this._document=c,this._directionality=u,this._location=h,this._outsideClickDispatcher=p}create(t){const i=this._createHostElement(),r=this._createPaneElement(i),s=this._createPortalOutlet(r),o=new IC(t);return o.direction=o.direction||this._directionality.value,new T1e(s,i,r,o,this._ngZone,this._keyboardDispatcher,this._document,this._location,this._outsideClickDispatcher)}position(){return this._positionBuilder}_createPaneElement(t){const i=this._document.createElement("div");return i.id="cdk-overlay-"+R1e++,i.classList.add("cdk-overlay-pane"),t.appendChild(i),i}_createHostElement(){const t=this._document.createElement("div");return this._overlayContainer.getContainerElement().appendChild(t),t}_createPortalOutlet(t){return this._appRef||(this._appRef=this._injector.get(ih)),new g1e(t,this._componentFactoryResolver,this._appRef,this._injector,this._document)}}return n.\u0275fac=function(t){return new(t||n)(Oe(E1e),Oe(Ob),Oe(wl),Oe(O1e),Oe(C1e),Oe(Wn),Oe(gn),Oe(pn),Oe(Il),Oe(Pg),Oe(A1e))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();function a7(...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{this.headers=new Map,e.split("\n").forEach(t=>{const i=t.indexOf(":");if(i>0){const r=t.slice(0,i),s=r.toLowerCase(),o=t.slice(i+1).trim();this.maybeSetNormalizedName(r,s),this.headers.has(s)?this.headers.get(s).push(o):this.headers.set(s,[o])}})}:()=>{this.headers=new Map,Object.keys(e).forEach(t=>{let i=e[t];const r=t.toLowerCase();"string"==typeof i&&(i=[i]),i.length>0&&(this.headers.set(r,i),this.maybeSetNormalizedName(t,r))})}:this.headers=new Map}has(e){return this.init(),this.headers.has(e.toLowerCase())}get(e){this.init();const t=this.headers.get(e.toLowerCase());return t&&t.length>0?t[0]:null}keys(){return this.init(),Array.from(this.normalizedNames.values())}getAll(e){return this.init(),this.headers.get(e.toLowerCase())||null}append(e,t){return this.clone({name:e,value:t,op:"a"})}set(e,t){return this.clone({name:e,value:t,op:"s"})}delete(e,t){return this.clone({name:e,value:t,op:"d"})}maybeSetNormalizedName(e,t){this.normalizedNames.has(t)||this.normalizedNames.set(t,e)}init(){this.lazyInit&&(this.lazyInit instanceof fd?this.copyFrom(this.lazyInit):this.lazyInit(),this.lazyInit=null,this.lazyUpdate&&(this.lazyUpdate.forEach(e=>this.applyUpdate(e)),this.lazyUpdate=null))}copyFrom(e){e.init(),Array.from(e.headers.keys()).forEach(t=>{this.headers.set(t,e.headers.get(t)),this.normalizedNames.set(t,e.normalizedNames.get(t))})}clone(e){const t=new fd;return t.lazyInit=this.lazyInit&&this.lazyInit instanceof fd?this.lazyInit:this,t.lazyUpdate=(this.lazyUpdate||[]).concat([e]),t}applyUpdate(e){const t=e.name.toLowerCase();switch(e.op){case"a":case"s":let i=e.value;if("string"==typeof i&&(i=[i]),0===i.length)return;this.maybeSetNormalizedName(e.name,t);const r=("a"===e.op?this.headers.get(t):void 0)||[];r.push(...i),this.headers.set(t,r);break;case"d":const s=e.value;if(s){let o=this.headers.get(t);if(!o)return;o=o.filter(a=>-1===s.indexOf(a)),0===o.length?(this.headers.delete(t),this.normalizedNames.delete(t)):this.headers.set(t,o)}else this.headers.delete(t),this.normalizedNames.delete(t)}}forEach(e){this.init(),Array.from(this.normalizedNames.keys()).forEach(t=>e(this.normalizedNames.get(t),this.headers.get(t)))}}class iTe{encodeKey(e){return w7(e)}encodeValue(e){return w7(e)}decodeKey(e){return decodeURIComponent(e)}decodeValue(e){return decodeURIComponent(e)}}const sTe=/%(\d[a-f0-9])/gi,oTe={40:"@","3A":":",24:"$","2C":",","3B":";","2B":"+","3D":"=","3F":"?","2F":"/"};function w7(n){return encodeURIComponent(n).replace(sTe,(e,t)=>{var i;return null!==(i=oTe[t])&&void 0!==i?i:e})}function E7(n){return`${n}`}class xh{constructor(e={}){if(this.updates=null,this.cloneFrom=null,this.encoder=e.encoder||new iTe,e.fromString){if(e.fromObject)throw new Error("Cannot specify both fromString and fromObject.");this.map=function(n,e){const t=new Map;return n.length>0&&n.replace(/^\?/,"").split("&").forEach(r=>{const s=r.indexOf("="),[o,a]=-1==s?[e.decodeKey(r),""]:[e.decodeKey(r.slice(0,s)),e.decodeValue(r.slice(s+1))],l=t.get(o)||[];l.push(a),t.set(o,l)}),t}(e.fromString,this.encoder)}else e.fromObject?(this.map=new Map,Object.keys(e.fromObject).forEach(t=>{const i=e.fromObject[t];this.map.set(t,Array.isArray(i)?i:[i])})):this.map=null}has(e){return this.init(),this.map.has(e)}get(e){this.init();const t=this.map.get(e);return t?t[0]:null}getAll(e){return this.init(),this.map.get(e)||null}keys(){return this.init(),Array.from(this.map.keys())}append(e,t){return this.clone({param:e,value:t,op:"a"})}appendAll(e){const t=[];return Object.keys(e).forEach(i=>{const r=e[i];Array.isArray(r)?r.forEach(s=>{t.push({param:i,value:s,op:"a"})}):t.push({param:i,value:r,op:"a"})}),this.clone(t)}set(e,t){return this.clone({param:e,value:t,op:"s"})}delete(e,t){return this.clone({param:e,value:t,op:"d"})}toString(){return this.init(),this.keys().map(e=>{const t=this.encoder.encodeKey(e);return this.map.get(e).map(i=>t+"="+this.encoder.encodeValue(i)).join("&")}).filter(e=>""!==e).join("&")}clone(e){const t=new xh({encoder:this.encoder});return t.cloneFrom=this.cloneFrom||this,t.updates=(this.updates||[]).concat(e),t}init(){null===this.map&&(this.map=new Map),null!==this.cloneFrom&&(this.cloneFrom.init(),this.cloneFrom.keys().forEach(e=>this.map.set(e,this.cloneFrom.map.get(e))),this.updates.forEach(e=>{switch(e.op){case"a":case"s":const t=("a"===e.op?this.map.get(e.param):void 0)||[];t.push(E7(e.value)),this.map.set(e.param,t);break;case"d":if(void 0===e.value){this.map.delete(e.param);break}{let i=this.map.get(e.param)||[];const r=i.indexOf(E7(e.value));-1!==r&&i.splice(r,1),i.length>0?this.map.set(e.param,i):this.map.delete(e.param)}}}),this.cloneFrom=this.updates=null)}}class aTe{constructor(){this.map=new Map}set(e,t){return this.map.set(e,t),this}get(e){return this.map.has(e)||this.map.set(e,e.defaultValue()),this.map.get(e)}delete(e){return this.map.delete(e),this}keys(){return this.map.keys()}}function S7(n){return"undefined"!=typeof ArrayBuffer&&n instanceof ArrayBuffer}function x7(n){return"undefined"!=typeof Blob&&n instanceof Blob}function C7(n){return"undefined"!=typeof FormData&&n instanceof FormData}class Rb{constructor(e,t,i,r){let s;if(this.url=t,this.body=null,this.reportProgress=!1,this.withCredentials=!1,this.responseType="json",this.method=e.toUpperCase(),function(n){switch(n){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,s=r):s=i,s&&(this.reportProgress=!!s.reportProgress,this.withCredentials=!!s.withCredentials,s.responseType&&(this.responseType=s.responseType),s.headers&&(this.headers=s.headers),s.context&&(this.context=s.context),s.params&&(this.params=s.params)),this.headers||(this.headers=new fd),this.context||(this.context=new aTe),this.params){const o=this.params.toString();if(0===o.length)this.urlWithParams=t;else{const a=t.indexOf("?");this.urlWithParams=t+(-1===a?"?":ap.set(g,e.setHeaders[g]),c)),e.setParams&&(u=Object.keys(e.setParams).reduce((p,g)=>p.set(g,e.setParams[g]),u)),new Rb(i,r,o,{params:u,headers:c,context:h,reportProgress:l,responseType:s,withCredentials:a})}}var ws=(()=>((ws=ws||{})[ws.Sent=0]="Sent",ws[ws.UploadProgress=1]="UploadProgress",ws[ws.ResponseHeader=2]="ResponseHeader",ws[ws.DownloadProgress=3]="DownloadProgress",ws[ws.Response=4]="Response",ws[ws.User=5]="User",ws))();class RC extends class{constructor(e,t=200,i="OK"){this.headers=e.headers||new fd,this.status=void 0!==e.status?e.status:t,this.statusText=e.statusText||i,this.url=e.url||null,this.ok=this.status>=200&&this.status<300}}{constructor(e={}){super(e),this.type=ws.Response,this.body=void 0!==e.body?e.body:null}clone(e={}){return new RC({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})}}function LP(n,e){return{body:e,headers:n.headers,context:n.context,observe:n.observe,params:n.params,reportProgress:n.reportProgress,responseType:n.responseType,withCredentials:n.withCredentials}}let ip=(()=>{class n{constructor(t){this.handler=t}request(t,i,r={}){let s;if(t instanceof Rb)s=t;else{let l,c;l=r.headers instanceof fd?r.headers:new fd(r.headers),r.params&&(c=r.params instanceof xh?r.params:new xh({fromObject:r.params})),s=new Rb(t,i,void 0!==r.body?r.body:null,{headers:l,context:r.context,params:c,reportProgress:r.reportProgress,responseType:r.responseType||"json",withCredentials:r.withCredentials})}const o=fn(s).pipe(function(n,e){return B(n,e,1)}(l=>this.handler.handle(l)));if(t instanceof Rb||"events"===r.observe)return o;const a=o.pipe(Qi(l=>l instanceof RC));switch(r.observe||"body"){case"body":switch(s.responseType){case"arraybuffer":return a.pipe(me(l=>{if(null!==l.body&&!(l.body instanceof ArrayBuffer))throw new Error("Response is not an ArrayBuffer.");return l.body}));case"blob":return a.pipe(me(l=>{if(null!==l.body&&!(l.body instanceof Blob))throw new Error("Response is not a Blob.");return l.body}));case"text":return a.pipe(me(l=>{if(null!==l.body&&"string"!=typeof l.body)throw new Error("Response is not a string.");return l.body}));case"json":default:return a.pipe(me(l=>l.body))}case"response":return a;default:throw new Error(`Unreachable: unhandled observe type ${r.observe}}`)}}delete(t,i={}){return this.request("DELETE",t,i)}get(t,i={}){return this.request("GET",t,i)}head(t,i={}){return this.request("HEAD",t,i)}jsonp(t,i){return this.request("JSONP",t,{params:(new xh).append(i,"JSONP_CALLBACK"),observe:"body",responseType:"json"})}options(t,i={}){return this.request("OPTIONS",t,i)}patch(t,i,r={}){return this.request("PATCH",t,LP(r,i))}post(t,i,r={}){return this.request("POST",t,LP(r,i))}put(t,i,r={}){return this.request("PUT",t,LP(r,i))}}return n.\u0275fac=function(t){return new(t||n)(Oe(b7))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const _Te=["*"];function O7(n){return Error(`Unable to find icon with the name "${n}"`)}function R7(n){return Error(`The URL provided to MatIconRegistry was not trusted as a resource URL via Angular's DomSanitizer. Attempted URL was "${n}".`)}function N7(n){return Error(`The literal provided to MatIconRegistry was not trusted as safe HTML by Angular's DomSanitizer. Attempted literal was "${n}".`)}class rp{constructor(e,t,i){this.url=e,this.svgText=t,this.options=i}}let NC=(()=>{class n{constructor(t,i,r,s){this._httpClient=t,this._sanitizer=i,this._errorHandler=s,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=r}addSvgIcon(t,i,r){return this.addSvgIconInNamespace("",t,i,r)}addSvgIconLiteral(t,i,r){return this.addSvgIconLiteralInNamespace("",t,i,r)}addSvgIconInNamespace(t,i,r,s){return this._addSvgIconConfig(t,i,new rp(r,null,s))}addSvgIconResolver(t){return this._resolvers.push(t),this}addSvgIconLiteralInNamespace(t,i,r,s){const o=this._sanitizer.sanitize(ni.HTML,r);if(!o)throw N7(r);return this._addSvgIconConfig(t,i,new rp("",o,s))}addSvgIconSet(t,i){return this.addSvgIconSetInNamespace("",t,i)}addSvgIconSetLiteral(t,i){return this.addSvgIconSetLiteralInNamespace("",t,i)}addSvgIconSetInNamespace(t,i,r){return this._addSvgIconSetConfig(t,new rp(i,null,r))}addSvgIconSetLiteralInNamespace(t,i,r){const s=this._sanitizer.sanitize(ni.HTML,i);if(!s)throw N7(i);return this._addSvgIconSetConfig(t,new rp("",s,r))}registerFontClassAlias(t,i=t){return this._fontCssClassesByAlias.set(t,i),this}classNameForFontAlias(t){return this._fontCssClassesByAlias.get(t)||t}setDefaultFontSetClass(t){return this._defaultFontSetClass=t,this}getDefaultFontSetClass(){return this._defaultFontSetClass}getSvgIconFromUrl(t){const i=this._sanitizer.sanitize(ni.RESOURCE_URL,t);if(!i)throw R7(t);const r=this._cachedIconsByUrl.get(i);return r?fn(PC(r)):this._loadSvgIconFromConfig(new rp(t,null)).pipe(Yr(s=>this._cachedIconsByUrl.set(i,s)),me(s=>PC(s)))}getNamedSvgIcon(t,i=""){const r=P7(i,t);let s=this._svgIconConfigs.get(r);if(s)return this._getSvgFromConfig(s);if(s=this._getIconConfigFromResolvers(i,t),s)return this._svgIconConfigs.set(r,s),this._getSvgFromConfig(s);const o=this._iconSetConfigs.get(i);return o?this._getSvgFromIconSetConfigs(t,o):Fg(O7(r))}ngOnDestroy(){this._resolvers=[],this._svgIconConfigs.clear(),this._iconSetConfigs.clear(),this._cachedIconsByUrl.clear()}_getSvgFromConfig(t){return t.svgText?fn(PC(this._svgElementFromConfig(t))):this._loadSvgIconFromConfig(t).pipe(me(i=>PC(i)))}_getSvgFromIconSetConfigs(t,i){const r=this._extractIconWithNameFromAnySet(t,i);return r?fn(r):ub(i.filter(o=>!o.svgText).map(o=>this._loadSvgIconSetFromConfig(o).pipe(bc(a=>{const c=`Loading icon set URL: ${this._sanitizer.sanitize(ni.RESOURCE_URL,o.url)} failed: ${a.message}`;return this._errorHandler.handleError(new Error(c)),fn(null)})))).pipe(me(()=>{const o=this._extractIconWithNameFromAnySet(t,i);if(!o)throw O7(t);return o}))}_extractIconWithNameFromAnySet(t,i){for(let r=i.length-1;r>=0;r--){const s=i[r];if(s.svgText&&s.svgText.indexOf(t)>-1){const o=this._svgElementFromConfig(s),a=this._extractSvgIconFromSet(o,t,s.options);if(a)return a}}return null}_loadSvgIconFromConfig(t){return this._fetchIcon(t).pipe(Yr(i=>t.svgText=i),me(()=>this._svgElementFromConfig(t)))}_loadSvgIconSetFromConfig(t){return t.svgText?fn(null):this._fetchIcon(t).pipe(Yr(i=>t.svgText=i))}_extractSvgIconFromSet(t,i,r){const s=t.querySelector(`[id="${i}"]`);if(!s)return null;const o=s.cloneNode(!0);if(o.removeAttribute("id"),"svg"===o.nodeName.toLowerCase())return this._setSvgAttributes(o,r);if("symbol"===o.nodeName.toLowerCase())return this._setSvgAttributes(this._toSvgElement(o),r);const a=this._svgElementFromString("");return a.appendChild(o),this._setSvgAttributes(a,r)}_svgElementFromString(t){const i=this._document.createElement("DIV");i.innerHTML=t;const r=i.querySelector("svg");if(!r)throw Error(" tag not found");return r}_toSvgElement(t){const i=this._svgElementFromString(""),r=t.attributes;for(let s=0;se.lift(new tTe(n))}(()=>this._inProgressUrlFetches.delete(a)),Es());return this._inProgressUrlFetches.set(a,c),c}_addSvgIconConfig(t,i,r){return this._svgIconConfigs.set(P7(t,i),r),this}_addSvgIconSetConfig(t,i){const r=this._iconSetConfigs.get(t);return r?r.push(i):this._iconSetConfigs.set(t,[i]),this}_svgElementFromConfig(t){if(!t.svgElement){const i=this._svgElementFromString(t.svgText);this._setSvgAttributes(i,t.options),t.svgElement=i}return t.svgElement}_getIconConfigFromResolvers(t,i){for(let r=0;re?e.pathname+e.search:""}}}),F7=["clip-path","color-profile","src","cursor","fill","filter","marker","marker-start","marker-mid","marker-end","mask","stroke"],CTe=F7.map(n=>`[${n}]`).join(", "),ATe=/^url\(['"]?#(.*?)['"]?\)$/;let Nm=(()=>{class n extends wTe{constructor(t,i,r,s,o){super(t),this._iconRegistry=i,this._location=s,this._errorHandler=o,this._inline=!1,this._currentIconFetch=x.EMPTY,r||t.nativeElement.setAttribute("aria-hidden","true")}get inline(){return this._inline}set inline(t){this._inline=xi(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 i=this._cleanupFontValue(t);i!==this._fontSet&&(this._fontSet=i,this._updateFontIconClasses())}get fontIcon(){return this._fontIcon}set fontIcon(t){const i=this._cleanupFontValue(t);i!==this._fontIcon&&(this._fontIcon=i,this._updateFontIconClasses())}_splitIconName(t){if(!t)return["",""];const i=t.split(":");switch(i.length){case 1:return["",i[0]];case 2:return i;default:throw Error(`Invalid icon name: "${t}"`)}}ngOnInit(){this._updateFontIconClasses()}ngAfterViewChecked(){const t=this._elementsWithExternalReferences;if(t&&t.size){const i=this._location.getPathname();i!==this._previousPath&&(this._previousPath=i,this._prependPathToReferences(i))}}ngOnDestroy(){this._currentIconFetch.unsubscribe(),this._elementsWithExternalReferences&&this._elementsWithExternalReferences.clear()}_usingFontIcon(){return!this.svgIcon}_setSvgElement(t){this._clearSvgElement();const i=t.querySelectorAll("style");for(let s=0;s{r.forEach(o=>{s.setAttribute(o.name,`url('${t}#${o.value}')`)})})}_cacheChildrenWithExternalReferences(t){const i=t.querySelectorAll(CTe),r=this._elementsWithExternalReferences=this._elementsWithExternalReferences||new Map;for(let s=0;s{const a=i[s],l=a.getAttribute(o),c=l?l.match(ATe):null;if(c){let u=r.get(a);u||(u=[],r.set(a,u)),u.push({name:o,value:c[1]})}})}_updateSvgIcon(t){if(this._svgNamespace=null,this._svgName=null,this._currentIconFetch.unsubscribe(),t){const[i,r]=this._splitIconName(t);i&&(this._svgNamespace=i),r&&(this._svgName=r),this._currentIconFetch=this._iconRegistry.getNamedSvgIcon(r,i).pipe(Wi(1)).subscribe(s=>this._setSvgElement(s),s=>{this._errorHandler.handleError(new Error(`Error retrieving icon ${i}:${r}! ${s.message}`))})}}}return n.\u0275fac=function(t){return new(t||n)(xe(En),xe(NC),Fo("aria-hidden"),xe(ETe),xe(oa))},n.\u0275cmp=ln({type:n,selectors:[["mat-icon"]],hostAttrs:["role","img",1,"mat-icon","notranslate"],hostVars:7,hostBindings:function(t,i){2&t&&(Bi("data-mat-icon-type",i._usingFontIcon()?"font":"svg")("data-mat-icon-name",i._svgName||i.fontIcon)("data-mat-icon-namespace",i._svgNamespace||i.fontSet),vi("mat-icon-inline",i.inline)("mat-icon-no-color","primary"!==i.color&&"accent"!==i.color&&"warn"!==i.color))},inputs:{color:"color",inline:"inline",svgIcon:"svgIcon",fontSet:"fontSet",fontIcon:"fontIcon"},exportAs:["matIcon"],features:[An],ngContentSelectors:_Te,decls:1,vars:0,template:function(t,i){1&t&&(is(),si(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}),n})();function LTe(n,e){}class zP{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 BTe={dialogContainer:Em("dialogContainer",[vc("void, exit",fs({opacity:0,transform:"scale(0.7)"})),vc("enter",fs({transform:"none"})),ud("* => enter",cd("150ms cubic-bezier(0, 0, 0.2, 1)",fs({transform:"none",opacity:1}))),ud("* => void, * => exit",cd("75ms cubic-bezier(0.4, 0.0, 0.2, 1)",fs({opacity:0})))])};let jTe=(()=>{class n extends MC{constructor(t,i,r,s,o,a){super(),this._elementRef=t,this._focusTrapFactory=i,this._changeDetectorRef=r,this._config=o,this._focusMonitor=a,this._animationStateChanged=new sn,this._elementFocusedBeforeDialogWasOpened=null,this._closeInteractionType=null,this.attachDomPortal=l=>(this._portalOutlet.hasAttached(),this._portalOutlet.attachDomPortal(l)),this._ariaLabelledBy=o.ariaLabelledBy||null,this._document=s}_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 i=Zx(),r=this._elementRef.nativeElement;(!i||i===this._document.body||i===r||r.contains(i))&&(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=Zx())}_focusDialogContainer(){this._elementRef.nativeElement.focus&&this._elementRef.nativeElement.focus()}_containsFocus(){const t=this._elementRef.nativeElement,i=Zx();return t===i||t.contains(i)}}return n.\u0275fac=function(t){return new(t||n)(xe(En),xe(XH),xe(Dr),xe(pn,8),xe(zP),xe(du))},n.\u0275dir=Rt({type:n,viewQuery:function(t,i){if(1&t&&ss(tp,7),2&t){let r;ii(r=ri())&&(i._portalOutlet=r.first)}},features:[An]}),n})(),VTe=(()=>{class n extends jTe{constructor(){super(...arguments),this._state="enter"}_onAnimationDone({toState:t,totalTime:i}){"enter"===t?(this._trapFocus(),this._animationStateChanged.next({state:"opened",totalTime:i})):"exit"===t&&(this._restoreFocus(),this._animationStateChanged.next({state:"closed",totalTime:i}))}_onAnimationStart({toState:t,totalTime:i}){"enter"===t?this._animationStateChanged.next({state:"opening",totalTime:i}):("exit"===t||"void"===t)&&this._animationStateChanged.next({state:"closing",totalTime:i})}_startExitAnimation(){this._state="exit",this._changeDetectorRef.markForCheck()}}return n.\u0275fac=function(){let e;return function(i){return(e||(e=nr(n)))(i||n)}}(),n.\u0275cmp=ln({type:n,selectors:[["mat-dialog-container"]],hostAttrs:["tabindex","-1","aria-modal","true",1,"mat-dialog-container"],hostVars:6,hostBindings:function(t,i){1&t&&fE("@dialogContainer.start",function(s){return i._onAnimationStart(s)})("@dialogContainer.done",function(s){return i._onAnimationDone(s)}),2&t&&(Lu("id",i._id),Bi("role",i._config.role)("aria-labelledby",i._config.ariaLabel?null:i._ariaLabelledBy)("aria-label",i._config.ariaLabel)("aria-describedby",i._config.ariaDescribedBy||null),mE("@dialogContainer",i._state))},features:[An],decls:1,vars:0,consts:[["cdkPortalOutlet",""]],template:function(t,i){1&t&&Di(0,LTe,0,0,"ng-template",0)},directives:[tp],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:[BTe.dialogContainer]}}),n})(),UTe=0;class FC{constructor(e,t,i="mat-dialog-"+UTe++){this._overlayRef=e,this._containerInstance=t,this.id=i,this.disableClose=this._containerInstance._config.disableClose,this._afterOpened=new se,this._afterClosed=new se,this._beforeClosed=new se,this._state=0,t._id=i,t._animationStateChanged.pipe(Qi(r=>"opened"===r.state),Wi(1)).subscribe(()=>{this._afterOpened.next(),this._afterOpened.complete()}),t._animationStateChanged.pipe(Qi(r=>"closed"===r.state),Wi(1)).subscribe(()=>{clearTimeout(this._closeFallbackTimeout),this._finishDialogClose()}),e.detachments().subscribe(()=>{this._beforeClosed.next(this._result),this._beforeClosed.complete(),this._afterClosed.next(this._result),this._afterClosed.complete(),this.componentInstance=null,this._overlayRef.dispose()}),e.keydownEvents().pipe(Qi(r=>27===r.keyCode&&!this.disableClose&&!Dl(r))).subscribe(r=>{r.preventDefault(),HP(this,"keyboard")}),e.backdropClick().subscribe(()=>{this.disableClose?this._containerInstance._recaptureFocus():HP(this,"mouse")})}close(e){this._result=e,this._containerInstance._animationStateChanged.pipe(Qi(t=>"closing"===t.state),Wi(1)).subscribe(t=>{this._beforeClosed.next(e),this._beforeClosed.complete(),this._overlayRef.detachBackdrop(),this._closeFallbackTimeout=setTimeout(()=>this._finishDialogClose(),t.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(e){let 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}updateSize(e="",t=""){return this._overlayRef.updateSize({width:e,height:t}),this._overlayRef.updatePosition(),this}addPanelClass(e){return this._overlayRef.addPanelClass(e),this}removePanelClass(e){return this._overlayRef.removePanelClass(e),this}getState(){return this._state}_finishDialogClose(){this._state=2,this._overlayRef.dispose()}_getPositionStrategy(){return this._overlayRef.getConfig().positionStrategy}}function HP(n,e,t){return void 0!==n._containerInstance&&(n._containerInstance._closeInteractionType=e),n.close(t)}const B7=new Ht("MatDialogData"),zTe=new Ht("mat-dialog-default-options"),j7=new Ht("mat-dialog-scroll-strategy");let $Te=(()=>{class n{constructor(t,i,r,s,o,a,l,c,u){this._overlay=t,this._injector=i,this._defaultOptions=r,this._parentDialog=s,this._overlayContainer=o,this._dialogRefConstructor=l,this._dialogContainerType=c,this._dialogDataToken=u,this._openDialogsAtThisLevel=[],this._afterAllClosedAtThisLevel=new se,this._afterOpenedAtThisLevel=new se,this._ariaHiddenElements=new Map,this.afterAllClosed=function(n){return new I(e=>{let t;try{t=n()}catch(r){return void e.error(r)}return(t?je(t):lS()).subscribe(e)})}(()=>this.openDialogs.length?this._getAfterAllClosed():this._getAfterAllClosed().pipe(ao(void 0))),this._scrollStrategy=a}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,i){(i=function(n,e){return Object.assign(Object.assign({},e),n)}(i,this._defaultOptions||new zP)).id&&this.getDialogById(i.id);const r=this._createOverlay(i),s=this._attachDialogContainer(r,i),o=this._attachDialogContent(t,s,r,i);return this.openDialogs.length||this._hideNonDialogContentFromAssistiveTechnology(),this.openDialogs.push(o),o.afterClosed().subscribe(()=>this._removeOpenDialog(o)),this.afterOpened.next(o),s._initializeWithAttachedContent(),o}closeAll(){this._closeDialogs(this.openDialogs)}getDialogById(t){return this.openDialogs.find(i=>i.id===t)}ngOnDestroy(){this._closeDialogs(this._openDialogsAtThisLevel),this._afterAllClosedAtThisLevel.complete(),this._afterOpenedAtThisLevel.complete()}_createOverlay(t){const i=this._getOverlayConfig(t);return this._overlay.create(i)}_getOverlayConfig(t){const i=new IC({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&&(i.backdropClass=t.backdropClass),i}_attachDialogContainer(t,i){const s=Wn.create({parent:i&&i.viewContainerRef&&i.viewContainerRef.injector||this._injector,providers:[{provide:zP,useValue:i}]}),o=new TC(this._dialogContainerType,i.viewContainerRef,s,i.componentFactoryResolver);return t.attach(o).instance}_attachDialogContent(t,i,r,s){const o=new this._dialogRefConstructor(r,i,s.id);if(t instanceof zo)i.attachTemplatePortal(new Im(t,null,{$implicit:s.data,dialogRef:o}));else{const a=this._createInjector(s,o,i),l=i.attachComponentPortal(new TC(t,s.viewContainerRef,a));o.componentInstance=l.instance}return o.updateSize(s.width,s.height).updatePosition(s.position),o}_createInjector(t,i,r){const s=t&&t.viewContainerRef&&t.viewContainerRef.injector,o=[{provide:this._dialogContainerType,useValue:r},{provide:this._dialogDataToken,useValue:t.data},{provide:this._dialogRefConstructor,useValue:i}];return t.direction&&(!s||!s.get(Il,null,Sn.Optional))&&o.push({provide:Il,useValue:{value:t.direction,change:fn()}}),Wn.create({parent:s||this._injector,providers:o})}_removeOpenDialog(t){const i=this.openDialogs.indexOf(t);i>-1&&(this.openDialogs.splice(i,1),this.openDialogs.length||(this._ariaHiddenElements.forEach((r,s)=>{r?s.setAttribute("aria-hidden",r):s.removeAttribute("aria-hidden")}),this._ariaHiddenElements.clear(),this._getAfterAllClosed().next()))}_hideNonDialogContentFromAssistiveTechnology(){const t=this._overlayContainer.getContainerElement();if(t.parentElement){const i=t.parentElement.children;for(let r=i.length-1;r>-1;r--){let s=i[r];s!==t&&"SCRIPT"!==s.nodeName&&"STYLE"!==s.nodeName&&!s.hasAttribute("aria-live")&&(this._ariaHiddenElements.set(s,s.getAttribute("aria-hidden")),s.setAttribute("aria-hidden","true"))}}}_closeDialogs(t){let i=t.length;for(;i--;)t[i].close()}}return n.\u0275fac=function(t){return new(t||n)(xe(wc),xe(Wn),xe(void 0),xe(void 0),xe(Ob),xe(void 0),xe(xu),xe(xu),xe(Ht))},n.\u0275dir=Rt({type:n}),n})(),Pb=(()=>{class n extends $Te{constructor(t,i,r,s,o,a,l){super(t,i,s,a,l,o,FC,VTe,B7)}}return n.\u0275fac=function(t){return new(t||n)(Oe(wc),Oe(Wn),Oe(Pg,8),Oe(zTe,8),Oe(j7),Oe(n,12),Oe(Ob))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),qTe=0,V7=(()=>{class n{constructor(t,i,r){this._dialogRef=t,this._elementRef=i,this._dialog=r,this.id="mat-dialog-title-"+qTe++}ngOnInit(){this._dialogRef||(this._dialogRef=function(n,e){let t=n.nativeElement.parentElement;for(;t&&!t.classList.contains("mat-dialog-container");)t=t.parentElement;return t?e.find(i=>i.id===t.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 n.\u0275fac=function(t){return new(t||n)(xe(FC,8),xe(En),xe(Pb))},n.\u0275dir=Rt({type:n,selectors:[["","mat-dialog-title",""],["","matDialogTitle",""]],hostAttrs:[1,"mat-dialog-title"],hostVars:1,hostBindings:function(t,i){2&t&&Lu("id",i.id)},inputs:{id:"id"},exportAs:["matDialogTitle"]}),n})(),U7=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275dir=Rt({type:n,selectors:[["","mat-dialog-content",""],["mat-dialog-content"],["","matDialogContent",""]],hostAttrs:[1,"mat-dialog-content"]}),n})();const $P=new Ht("CdkAccordion");let XTe=0,ZTe=(()=>{class n{constructor(t,i,r){this.accordion=t,this._changeDetectorRef=i,this._expansionDispatcher=r,this._openCloseAllSubscription=x.EMPTY,this.closed=new sn,this.opened=new sn,this.destroyed=new sn,this.expandedChange=new sn,this.id="cdk-accordion-child-"+XTe++,this._expanded=!1,this._disabled=!1,this._removeUniqueSelectionListener=()=>{},this._removeUniqueSelectionListener=r.listen((s,o)=>{this.accordion&&!this.accordion.multi&&this.accordion.id===o&&this.id!==s&&(this.expanded=!1)}),this.accordion&&(this._openCloseAllSubscription=this._subscribeToOpenCloseAllActions())}get expanded(){return this._expanded}set expanded(t){t=xi(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=xi(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 n.\u0275fac=function(t){return new(t||n)(xe($P,12),xe(Dr),xe(D$))},n.\u0275dir=Rt({type:n,selectors:[["cdk-accordion-item"],["","cdkAccordionItem",""]],inputs:{expanded:"expanded",disabled:"disabled"},outputs:{closed:"closed",opened:"opened",destroyed:"destroyed",expandedChange:"expandedChange"},exportAs:["cdkAccordionItem"],features:[Hn([{provide:$P,useValue:void 0}])]}),n})();const eMe=["body"];function tMe(n,e){}const nMe=[[["mat-expansion-panel-header"]],"*",[["mat-action-row"]]],iMe=["mat-expansion-panel-header","*","mat-action-row"];function rMe(n,e){1&n&&bi(0,"span",2),2&n&&rn("@indicatorRotate",ci()._getExpandedState())}const sMe=[[["mat-panel-title"]],[["mat-panel-description"]],"*"],oMe=["mat-panel-title","mat-panel-description","*"],WP=new Ht("MAT_ACCORDION"),H7="225ms cubic-bezier(0.4,0.0,0.2,1)",G7={indicatorRotate:Em("indicatorRotate",[vc("collapsed, void",fs({transform:"rotate(0deg)"})),vc("expanded",fs({transform:"rotate(180deg)"})),ud("expanded <=> collapsed, void => collapsed",cd(H7))]),bodyExpansion:Em("bodyExpansion",[vc("collapsed, void",fs({height:"0px",visibility:"hidden"})),vc("expanded",fs({height:"*",visibility:"visible"})),ud("expanded <=> collapsed, void => collapsed",cd(H7))])};let aMe=(()=>{class n{constructor(t){this._template=t}}return n.\u0275fac=function(t){return new(t||n)(xe(zo))},n.\u0275dir=Rt({type:n,selectors:[["ng-template","matExpansionPanelContent",""]]}),n})(),lMe=0;const $7=new Ht("MAT_EXPANSION_PANEL_DEFAULT_OPTIONS");let W7=(()=>{class n extends ZTe{constructor(t,i,r,s,o,a,l){super(t,i,r),this._viewContainerRef=s,this._animationMode=a,this._hideToggle=!1,this.afterExpand=new sn,this.afterCollapse=new sn,this._inputChanges=new se,this._headerId="mat-expansion-panel-header-"+lMe++,this._bodyAnimationDone=new se,this.accordion=t,this._document=o,this._bodyAnimationDone.pipe(rd((c,u)=>c.fromState===u.fromState&&c.toState===u.toState)).subscribe(c=>{"void"!==c.fromState&&("expanded"===c.toState?this.afterExpand.emit():"collapsed"===c.toState&&this.afterCollapse.emit())}),l&&(this.hideToggle=l.hideToggle)}get hideToggle(){return this._hideToggle||this.accordion&&this.accordion.hideToggle}set hideToggle(t){this._hideToggle=xi(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(ao(null),Qi(()=>this.expanded&&!this._portal),Wi(1)).subscribe(()=>{this._portal=new Im(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,i=this._body.nativeElement;return t===i||i.contains(t)}return!1}}return n.\u0275fac=function(t){return new(t||n)(xe(WP,12),xe(Dr),xe(D$),xe(Ns),xe(pn),xe(Nl,8),xe($7,8))},n.\u0275cmp=ln({type:n,selectors:[["mat-expansion-panel"]],contentQueries:function(t,i,r){if(1&t&&function(n,e,t,i){const r=Ei();if(r.firstCreatePass){const s=cs();F3(r,new R3(e,t,i),s.index),function(n,e){const t=n.contentQueries||(n.contentQueries=[]);e!==(t.length?t[t.length-1]:-1)&&t.push(n.queries.length-1,e)}(r,n),2==(2&t)&&(r.staticContentQueries=!0)}P3(r,jt(),t)}(r,aMe,5),2&t){let s;ii(s=ri())&&(i._lazyContent=s.first)}},viewQuery:function(t,i){if(1&t&&ss(eMe,5),2&t){let r;ii(r=ri())&&(i._body=r.first)}},hostAttrs:[1,"mat-expansion-panel"],hostVars:6,hostBindings:function(t,i){2&t&&vi("mat-expanded",i.expanded)("_mat-animation-noopable","NoopAnimations"===i._animationMode)("mat-expansion-panel-spacing",i._hasSpacing())},inputs:{disabled:"disabled",expanded:"expanded",hideToggle:"hideToggle",togglePosition:"togglePosition"},outputs:{opened:"opened",closed:"closed",expandedChange:"expandedChange",afterExpand:"afterExpand",afterCollapse:"afterCollapse"},exportAs:["matExpansionPanel"],features:[Hn([{provide:WP,useValue:void 0}]),An,Ui],ngContentSelectors:iMe,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,i){1&t&&(is(nMe),si(0),Pt(1,"div",0,1),Un("@bodyExpansion.done",function(s){return i._bodyAnimationDone.next(s)}),Pt(3,"div",2),si(4,1),Di(5,tMe,0,0,"ng-template",3),Ft(),si(6,2),Ft()),2&t&&(Zt(1),rn("@bodyExpansion",i._getExpandedState())("id",i.id),Bi("aria-labelledby",i._headerId),Zt(4),rn("cdkPortalOutlet",i._portal))},directives:[tp],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:[G7.bodyExpansion]},changeDetection:0}),n})();class uMe{}const dMe=xP(uMe);let q7=(()=>{class n extends dMe{constructor(t,i,r,s,o,a,l){super(),this.panel=t,this._element=i,this._focusMonitor=r,this._changeDetectorRef=s,this._animationMode=a,this._parentChangeSubscription=x.EMPTY;const c=t.accordion?t.accordion._stateChanges.pipe(Qi(u=>!(!u.hideToggle&&!u.togglePosition))):Yc;this.tabIndex=parseInt(l||"")||0,this._parentChangeSubscription=kn(t.opened,t.closed,c,t._inputChanges.pipe(Qi(u=>!!(u.hideToggle||u.disabled||u.togglePosition)))).subscribe(()=>this._changeDetectorRef.markForCheck()),t.closed.pipe(Qi(()=>t._containsFocus())).subscribe(()=>r.focusVia(i,"program")),o&&(this.expandedHeight=o.expandedHeight,this.collapsedHeight=o.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:Dl(t)||(t.preventDefault(),this._toggle());break;default:return void(this.panel.accordion&&this.panel.accordion._handleHeaderKeydown(t))}}focus(t,i){t?this._focusMonitor.focusVia(this._element,t,i):this._element.nativeElement.focus(i)}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 n.\u0275fac=function(t){return new(t||n)(xe(W7,1),xe(En),xe(du),xe(Dr),xe($7,8),xe(Nl,8),Fo("tabindex"))},n.\u0275cmp=ln({type:n,selectors:[["mat-expansion-panel-header"]],hostAttrs:["role","button",1,"mat-expansion-panel-header","mat-focus-indicator"],hostVars:15,hostBindings:function(t,i){1&t&&Un("click",function(){return i._toggle()})("keydown",function(s){return i._keydown(s)}),2&t&&(Bi("id",i.panel._headerId)("tabindex",i.tabIndex)("aria-controls",i._getPanelId())("aria-expanded",i._isExpanded())("aria-disabled",i.panel.disabled),jy("height",i._getHeaderHeight()),vi("mat-expanded",i._isExpanded())("mat-expansion-toggle-indicator-after","after"===i._getTogglePosition())("mat-expansion-toggle-indicator-before","before"===i._getTogglePosition())("_mat-animation-noopable","NoopAnimations"===i._animationMode))},inputs:{tabIndex:"tabIndex",expandedHeight:"expandedHeight",collapsedHeight:"collapsedHeight"},features:[An],ngContentSelectors:oMe,decls:5,vars:1,consts:[[1,"mat-content"],["class","mat-expansion-indicator",4,"ngIf"],[1,"mat-expansion-indicator"]],template:function(t,i){1&t&&(is(sMe),Pt(0,"span",0),si(1),si(2,1),si(3,2),Ft(),Di(4,rMe,1,1,"span",1)),2&t&&(Zt(4),rn("ngIf",i._showToggle()))},directives:[lc],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:[G7.indicatorRotate]},changeDetection:0}),n})();var Y7=Je(478);Object.create(Error.prototype);const mMe=["*"];var LC=(()=>(function(n){n.LineHighlight="line-highlight",n.LineNumbers="line-numbers"}(LC||(LC={})),LC))();class yMe{}const X7=new Ht("SECURITY_CONTEXT");let qP=(()=>{class n{constructor(t,i,r,s,o){this.platform=t,this.securityContext=i,this.http=r,this.sanitizer=o,this.initialMarkedOptions={renderer:new Y7.Renderer},this.options=s}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,i=!1,r=!1,s=this.options){const o=this.trimIndentation(t),a=i?this.decodeHtml(o):o,l=r?this.renderEmoji(a):a,c=Y7.parse(l,s);return this.sanitizer.sanitize(this.securityContext,c)||""}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(me(i=>this.handleExtension(t,i)))}highlight(t){if(Tf(this.platform)&&"undefined"!=typeof Prism){t||(t=document);const i=t.querySelectorAll('pre code:not([class*="language-"])');Array.prototype.forEach.call(i,r=>r.classList.add("language-none")),Prism.highlightAllUnder(t)}}renderKatex(t,i){if(!Tf(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,(r,s)=>katex.renderToString(s,i))}decodeHtml(t){if(!Tf(this.platform))return t;const i=document.createElement("textarea");return i.innerHTML=t,i.value}handleExtension(t,i){const r=t?t.split("?")[0].split(".").splice(-1).join():"";return"md"!==r?"```"+r+"\n"+i+"\n```":i}renderEmoji(t){if(!Tf(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 i;return t.split("\n").map(r=>{let s=i;return r.length>0&&(s=isNaN(s)?r.search(/\S|$/):Math.min(r.search(/\S|$/),s)),isNaN(i)&&(i=s),s?r.substring(s):r}).join("\n")}}return n.\u0275fac=function(t){return new(t||n)(Oe(Wc),Oe(X7),Oe(ip,8),Oe(yMe,8),Oe(Mf))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),Q7=(()=>{class n{constructor(t,i){this.element=t,this.markdownService=i,this.error=new sn,this.load=new sn,this.ready=new sn,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,i=!1){let r=this.markdownService.compile(t,i,this.emoji);r=this.katex?this.markdownService.renderKatex(r,this.katexOptions):r,this.element.nativeElement.innerHTML=r,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,LC.LineNumbers),this.setPluginOptions(this.element.nativeElement,{dataStart:this.start}))}setPluginClass(t,i){const r=t.querySelectorAll("pre");for(let s=0;s{const a=i[o];if(a){const l=this.toLispCase(o);r.item(s).setAttribute(l,a.toString())}})}toLispCase(t){const i=t.match(/([A-Z])/g);if(!i)return t;let r=t.toString();for(let s=0,o=i.length;sP(i)?t(...i):t(i))):new I(i=>{const r=(...o)=>i.next(1===o.length?o[0]:o);let s;try{s=n(r)}catch(o){return void i.error(o)}if(Y(e))return()=>e(r,s)})}function YP(...n){return e=>{let t;return"function"==typeof n[n.length-1]&&(t=n.pop()),e.lift(new CMe(n,t))}}class CMe{constructor(e,t){this.observables=e,this.project=t}call(e,t){return t.subscribe(new AMe(e,this.observables,this.project))}}class AMe extends l7{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)}}class TMe{constructor(e,t,i=!1){this.accumulator=e,this.seed=t,this.hasSeed=i}call(e,t){return t.subscribe(new MMe(e,this.accumulator,this.seed,this.hasSeed))}}class MMe extends y{constructor(e,t,i,r){super(e),this.accumulator=t,this._seed=i,this.hasSeed=r,this.index=0}get seed(){return this._seed}set seed(e){this.hasSeed=!0,this._seed=e}_next(e){if(this.hasSeed)return this._tryNext(e);this.seed=e,this.destination.next(e)}_tryNext(e){const t=this.index++;let i;try{i=this.accumulator(this.seed,e,t)}catch(r){this.destination.error(r)}this.seed=i,this.destination.next(i)}}class OMe{constructor(e){this.predicate=e}call(e,t){return t.subscribe(new RMe(e,this.predicate))}}class RMe extends y{constructor(e,t){super(e),this.predicate=t,this.skipping=!0,this.index=0}_next(e){const t=this.destination;this.skipping&&this.tryCallPredicate(e),this.skipping||t.next(e)}tryCallPredicate(e){try{const t=this.predicate(e,this.index++);this.skipping=Boolean(t)}catch(t){this.destination.error(t)}}}const NMe=["youtubeContainer"];let tW=(()=>{class n{constructor(t,i){this._ngZone=t,this._youtubeContainer=new se,this._destroyed=new se,this._playerChanges=new Br(void 0),this._videoId=new Br(void 0),this._height=new Br(390),this._width=new Br(640),this._startSeconds=new Br(void 0),this._endSeconds=new Br(void 0),this._suggestedQuality=new Br(void 0),this._playerVars=new Br(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=Tf(i)}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=fn(!0);if(!window.YT||!window.YT.Player){const r=new se;this._existingApiReadyCallback=window.onYouTubeIframeAPIReady,window.onYouTubeIframeAPIReady=()=>{this._existingApiReadyCallback&&this._existingApiReadyCallback(),this._ngZone.run(()=>r.next(!0))},t=r.pipe(Wi(1),ao(!1))}const i=function(n,e,t,i,r,s,o){const a=Yo([e,s]).pipe(YP(Yo([i,r])),me(([l,c])=>{const[u,h]=l,[p,g]=c;return u?{videoId:u,playerVars:h,width:p,height:g}:void 0}));return Yo([n,a,fn(o)]).pipe(function(n){return ce(function(...n){let e=null;return"function"==typeof n[n.length-1]&&(e=n.pop()),1===n.length&&P(n[0])&&(n=n[0].slice()),t=>t.lift.call(je([t,...n]),new d7(e))}(n),function(n){return e=>e.lift(new OMe(n))}(([e,t])=>!t),me(([e])=>e))}(t),function(n,e){let t=!1;return arguments.length>=2&&(t=!0),function(r){return r.lift(new TMe(n,e,t))}}(jMe,void 0),rd())}(this._youtubeContainer,this._videoId,t,this._width,this._height,this._playerVars,this._ngZone).pipe(Yr(r=>{this._playerChanges.next(r)}),B(e=>e?nW(e)?fn(e):new I(t=>{let i=!1,r=!1;const s=o=>{r=!0,i||(o.target.removeEventListener("onReady",s),t.next(o.target))};return e.addEventListener("onReady",s),()=>{i=!0,r||(r=>{nW(r)||r.destroy()})(e)}}).pipe(Wi(1),ao(void 0)):fn(void 0)),_r(this._destroyed),el(new se));i.subscribe(r=>{this._player=r,r&&this._pendingPlayerState&&this._initializePlayer(r,this._pendingPlayerState),this._pendingPlayerState=void 0}),function(n,e,t){Yo([n,e,t]).subscribe(([i,r,s])=>i&&i.setSize(r,s))}(i,this._width,this._height),function(n,e){Yo([n,e]).subscribe(([t,i])=>t&&i&&t.setPlaybackQuality(i))}(i,this._suggestedQuality),function(n,e,t,i,r,s){const o=Yo([t,i]).pipe(me(([u,h])=>({startSeconds:u,endSeconds:h}))),a=o.pipe(XP(n,u=>!!u&&!function(n){const e=n.getPlayerState();return e!==YT.PlayerState.UNSTARTED&&e!==YT.PlayerState.CUED}(u))),l=e.pipe(XP(n,(u,h)=>!!u&&u.videoId!==h));kn(n.pipe(XP(Yo([e,o]),([u,h],p)=>!(!p||u==p.videoId&&!h.startSeconds&&!h.endSeconds))),l,a).pipe(YP(Yo([n,e,o,r])),me(([u,h])=>h),_r(s)).subscribe(([u,h,p,g])=>{!h||!u||(u.videoId=h,u.cueVideoById(Object.assign({videoId:h,suggestedQuality:g},p)))})}(i,this._videoId,this._startSeconds,this._endSeconds,this._suggestedQuality,this._destroyed),i.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,i){this._player?this._player.seekTo(t,i):this._getPendingState().seek={seconds:t,allowSeekAhead:i}}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,i){const{playbackState:r,playbackRate:s,volume:o,muted:a,seek:l}=i;switch(r){case YT.PlayerState.PLAYING:t.playVideo();break;case YT.PlayerState.PAUSED:t.pauseVideo();break;case YT.PlayerState.CUED:t.stopVideo()}null!=s&&t.setPlaybackRate(s),null!=o&&t.setVolume(o),null!=a&&(a?t.mute():t.unMute()),null!=l&&t.seekTo(l.seconds,l.allowSeekAhead)}_getLazyEmitter(t){return this._playerChanges.pipe(Ir(i=>i?Z7(r=>{i.addEventListener(t,r)},r=>{try{i.removeEventListener&&i.removeEventListener(t,r)}catch(s){}}):fn()),i=>new I(r=>i.subscribe({next:s=>this._ngZone.run(()=>r.next(s)),error:s=>r.error(s),complete:()=>r.complete()})),_r(this._destroyed))}}return n.\u0275fac=function(t){return new(t||n)(xe(gn),xe(Wc))},n.\u0275cmp=ln({type:n,selectors:[["youtube-player"]],viewQuery:function(t,i){if(1&t&&ss(NMe,5),2&t){let r;ii(r=ri())&&(i.youtubeContainer=r.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,i){1&t&&bi(0,"div",null,0)},encapsulation:2,changeDetection:0}),n})();function jMe(n,[e,t,i]){if(n&&t&&n.playerVars!==t.playerVars)n.destroy();else{if(!t)return void(n&&n.destroy());if(n)return n}const r=i.runOutsideAngular(()=>new YT.Player(e,t));return r.videoId=t.videoId,r.playerVars=t.playerVars,r}function nW(n){return"getPlayerStatus"in n}function XP(n,e){return ce(YP(n),Qi(([t,i])=>e(i,t)),me(([t])=>t))}let KMe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275dir=Rt({type:n,selectors:[["","mat-card-sm-image",""],["","matCardImageSmall",""]],hostAttrs:[1,"mat-card-sm-image"]}),n})();function kb(n){return!0===n}function Xa(n){return null==n}function Qa(n){return!Xa(n)}function QP(n){return Boolean(n)}function oW(n){return Xa(n)?n:JSON.parse(JSON.stringify(n))}const jC=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])&&jC(n[o])}),n};function aW(n){return Qa(n)&&"object"==typeof n&&function(n){return"[object Object]"===Object.prototype.toString.call(n)}(n)}const uW="NGXS_DATA_META",JP="NGXS_META",dW="NGXS_ARGUMENT_REGISTRY_META";let hW=(()=>{class n{constructor(t){this.sequence$=new Br(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)(Oe(cu,8))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();function Lb(n){return n[uW]}let Za=(()=>{class n{constructor(t,i,r){n.store=t.get(cu),n.ngZone=t.get(gn),n.factory=i,n.context=r,n.computed=t.get(hW)}}return n.store=null,n.computed=null,n.context=null,n.factory=null,n.ngZone=null,n.\u0275fac=function(t){return new(t||n)(Oe(Wn),Oe(a6),Oe(o6))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();class ps{constructor(){ps.statesCachedMeta.clear()}static createStateContext(e){return Za.context.createStateContext(e)}static ensureMappedState(e){if(Xa(Za.factory)||Xa(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(Qa(e.name)?ps.statesCachedMeta.get(e.name):null)||ps.ensureMeta(e)}static getRepositoryByInstance(e){var t;const r=null!==(t=Lb(ps.getStateClassByInstance(e)))&&void 0!==t?t:null;if(Xa(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=ps.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=ps.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=Qa(e.name)?null===(t=Za.factory.states)||void 0===t?void 0:t.find(r=>r.name===e.name):null;return Qa(i)&&Qa(e.name)&&ps.statesCachedMeta.set(e.name,i),i}}ps.statesCachedMeta=new Map,ps.\u0275fac=function(e){return new(e||ps)},ps.\u0275prov=We({token:ps,factory:ps.\u0275fac}),new kg(1);class mDe extends Error{constructor(e){super(`Child states can only be added to an object. Cannot convert ${Qa(null==e?void 0:e.constructor)?e.constructor.name:e} to PlainObject`)}}function fW(n){var e;return null!==(e=n.NGXS_OPTIONS_META)&&void 0!==e?e:{name:""}}function pW(n){var e;const t=fW(n),i=null!==(e=t.children)&&void 0!==e?e:[],s=oW(void 0===t.defaults?{}:t.defaults);if(i.length){if(aW(s))return function(n,e){return e.reduce((t,i)=>{const r=fW(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()]=pW(i),t},null!=n?n:{})}(s,i);throw new mDe(s)}return s}function mW(n){var e;return null!==(e=n.__NGXS_COMPUTED_OPTION__)&&void 0!==e?e:null}function _W(){var n,e;return null!==(e=null===(n=null==Za?void 0:Za.computed)||void 0===n?void 0:n.sequenceValue)&&void 0!==e?e:0}function vDe(n){let e=!1;return Tm(n)&&(e=!0),e}function eF(n){return n[dW]}class wDe extends Error{constructor(e,t){super(`An argument with the name '${e}' already exists in the method '${t}'`)}}class EDe{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(QP(this.argumentMap.has(e))||QP(this.payloadMap.has(e)))throw new wDe(e,t)}}function MDe(n){return{enumerable:!0,configurable:!0,get(){const e=Lb(n),t=ps.ensureMappedState(e.stateMeta);return ps.createStateContext(t)}}}function yW(){return(n,e,t)=>{!function(n,e){if(!function(n,e){var t;let i=n,r=!1;if(aW(i))for(;null!==i;){if(kb(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 Xa(mW(n))&&Object.defineProperties(n,{__NGXS_COMPUTED_OPTION__:{enumerable:!0,configurable:!0,value:new WeakMap}}),mW(n)}(this),o=null==s?void 0:s.get(i);if(kb(null==o?void 0:o.isObservable))return null==o?void 0:o.value;if(Xa(o)||o.sequenceId!==_W()){s.delete(i);const l=i.apply(this,r);return s.set(i,{value:l,sequenceId:_W(),isObservable:vDe(l)}),l}return o.value},t}}const PDe={cancelUncompleted:!0,insideZone:!1};function tF(n=PDe){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=ps.getRepositoryByInstance(a),u=c.operations;let h=u[s];const p=c.stateMeta,g=eF(r);if(Xa(h)){const U=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),de=function(n){const{statePath:e,argumentsNames:t,methodName:i,argumentRegistry:r}=n;let s="";for(let o=0;o{var U;return kb(n.insideZone)?null===(U=Za.ngZone)||void 0===U||U.run(()=>{l=r.apply(a,o)}):l=r.apply(a,o),Tm(l)?fn(null).pipe(me(()=>l)):l};const C=ps.createAction(h,o,g),H=Za.store.dispatch(C);return Tm(l)?function(n,e){return ub([n,e]).pipe(me(t=>t.pop()))}(H,l):l},i}}function bW(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 Xa(eF(t))&&Object.defineProperties(t,{[dW]:{enumerable:!0,configurable:!0,value:new EDe}}),eF(t)})(e,t).createPayloadType(r,t,i)}}function kDe(){return n=>{const e=function(n){if(function(n){return!QP(n)}(n.hasOwnProperty(JP))){const e={name:null,actions:{},defaults:{},path:null,makeRootSelector:t=>t.getStateGetter(e.name),children:[]};Object.defineProperty(n,JP,{value:e})}return function(n){var e;return null===(e=n)||void 0===e?void 0:e[JP]}(n)}(n);if(Xa(e.name))throw new Error("@StateRepository should be add before decorator @State");!function(n,e){(function(n){var e;const t=null!==(e=Lb(n))&&void 0!==e?e:null;return(Xa(t)||(null==t?void 0:t.stateClass)!==n)&&function(n){Object.defineProperty(n,uW,{writable:!0,configurable:!0,enumerable:!0,value:{stateMeta:null,operations:{},stateClass:n}})}(n),Lb(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:()=>oW(t)},context:MDe(n)})}(n,e,pW(n)),function(n){var e,t;const i=Lb(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(Qa(r)){const s=`__${r}__selector`;Object.defineProperties(n.prototype,{[s]:{writable:!0,enumerable:!1,configurable:!0},state$:{enumerable:!0,configurable:!0,get(){if(Qa(this[s]))return this[s];if(Xa(Za.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]=Za.store.select(n).pipe(me(o=>Ba()?jC(o):o),$a({refCount:!0,bufferSize:1})),this[s]}}})}}(n)}}let BDe=(()=>{class n{constructor(){this.browserStorageEvents$=new se,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})(),jDe=(()=>{class n extends BDe{get snapshot(){return function(n){return Ba()?jC(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:()=>Ba()?jC(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=nr(n)))(i||n)}}(),n.\u0275prov=We({token:n,factory:n.\u0275fac}),rr([yW(),dc("design:type",Object),dc("design:paramtypes",[])],n.prototype,"snapshot",null),rr([tF(),Aj(0,bW("patchValue")),dc("design:type",Function),dc("design:paramtypes",[Object]),dc("design:returntype",void 0)],n.prototype,"patchState",null),rr([tF(),Aj(0,bW("stateValue")),dc("design:type",Function),dc("design:paramtypes",[Object]),dc("design:returntype",void 0)],n.prototype,"setState",null),rr([tF(),dc("design:type",Function),dc("design:paramtypes",[]),dc("design:returntype",void 0)],n.prototype,"reset",null),n})();const jm=new Ht("ngx-google-analytics-settings",{factory:()=>({trackingCode:"",enableTracing:!1})}),xF=new Ht("ngx-window",{providedIn:"root",factory:()=>function(n){return Tf(n)?window:null}(Fc(Wc))}),ZOe=new Ht("ngx-data-layer",{providedIn:"root",factory:()=>function(n){return n?n.dataLayer=n.dataLayer||[]:null}(Fc(xF))}),CF=new Ht("ngx-gtag-fn",{providedIn:"root",factory:()=>function(n,e){return n?n.gtag=n.gtag||function(){e.push(arguments)}:null}(Fc(xF),Fc(ZOe))});let AF=(()=>{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||Ba())&&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)(Oe(jm),Oe(pn),Oe(CF))},n.\u0275prov=We({factory:function(){return new n(Oe(jm),Oe(pn),Oe(CF))},token:n,providedIn:"root"}),n})();new Ht("ngx-google-analytics-routing-settings",{factory:()=>({})}),new Ht("Key under which consent is stored",{providedIn:"root",factory:()=>"ALLOW_TELEMETRY"});class M9 extends Error{constructor(){super(...arguments),this.message="NgxsDispatchPluginModule is not imported"}}function bRe(){throw new M9}function vRe(){throw new M9}function DF(n,e,t){e.run(()=>n.dispatch(t))}function SRe(n,e,t,i){return yg(t)?function(n,e,t){return t.then(i=>(DF(n,e,i),i))}(n,e,t):Tm(t)?function(n,e,t,i){return null!==i&&(t=t.pipe(_r(i.cancelUncompleted$))),t.subscribe({next:r=>DF(n,e,r)}),t}(n,e,t,i):(DF(n,e,t),t)}class xRe{constructor(){this.cancelUncompleted$=new se}cancelPreviousAction(){this.cancelUncompleted$.next()}}const IF="\u0275fac",D9=Symbol("InjectorInstance"),I9=Symbol("FactoryHasBeenDecorated");function O9(n,e){const t=n[D9];return t?t.get(e):null}const TRe={cancelUncompleted:!1};function R9(n=TRe){return(e,t,i)=>{let r;const s=function(n){return n?new xRe:null}(n.cancelUncompleted);function o(){null!==s&&s.cancelPreviousAction();const a=O9(this,cu)||bRe(),l=O9(this,gn)||vRe(),c=r.apply(this,arguments);return l.runOutsideAngular(()=>SRe(a,l,c,s))}"function"==typeof(null==i?void 0:i.value)?(r=i.value,i.value=o):Object.defineProperty(e,t,{set:a=>r=a,get:()=>o}),function(n){if(I9 in n.constructor.prototype)return;const e=n.constructor;"function"==typeof e[IF]&&function(n){const e=n[IF];if("function"!=typeof e)return;const t=n.\u0275prov||n.\u0275pipe||n.\u0275cmp||n.\u0275dir,i=()=>{const r=e();return r[D9]=xe(Pu),r};t&&(t.factory=i),Object.defineProperty(n,IF,{get:()=>i})}(e),n.constructor.prototype[I9]=!0}(e)}}const tNe=["bodyCanvas"];let nNe=(()=>{class n{constructor(){this.clsName="ccf-body-ui",this.rotationChange=new sn,this.nodeDrag=new sn,this.nodeClick=new sn,this.nodeHoverStart=new sn,this.nodeHoverStop=new sn,this.initialized=new sn,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 Fi(this,void 0,void 0,function*(){const i=this.bodyCanvas.nativeElement,r=new Qve({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.target&&this.bodyUI.setTarget(this.target),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))],this.initialized.emit()})}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=ln({type:n,selectors:[["ccf-body-ui"]],viewQuery:function(t,i){if(1&t&&ss(tNe,5,En),2&t){let r;ii(r=ri())&&(i.bodyCanvas=r.first)}},hostVars:2,hostBindings:function(t,i){2&t&&vl(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",initialized:"initialized"},decls:2,vars:0,consts:[[1,"body-ui"],["bodyCanvas",""]],template:function(t,i){1&t&&bi(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})(),iNe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=on({type:n}),n.\u0275inj=xt({imports:[[qr]]}),n})();function ENe(n,e){if(1&n&&(Pt(0,"div",16),bi(1,"youtube-player",17),Ft()),2&n){const t=ci(3);Zt(1),pE("videoId",t.videoID)}}function SNe(n,e){if(1&n&&(Pt(0,"mat-expansion-panel",11),Pt(1,"mat-expansion-panel-header"),Pt(2,"h2",12),Oi(3),Ft(),Ft(),Pt(4,"div",13),bi(5,"markdown",14),Di(6,ENe,2,1,"div",15),Ft(),Ft()),2&n){const t=ci(),i=t.index,r=t.$implicit;rn("expanded",0===i),Zt(3),da(r.title),Zt(2),vi("first",0===i),rn("data",r.content),Zt(1),rn("ngIf",0===i)}}function xNe(n,e){if(1&n&&(Pt(0,"div",9),Di(1,SNe,7,6,"mat-expansion-panel",10),Ft()),2&n){const t=e.$implicit;Zt(1),rn("ngIf",t)}}new Ht("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:brain",organ:"Brain",name:"Brain",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000955"},{disabled:!0,src:"app:lymph-nodes",organ:"Lymph Node",name:"Lymph Node",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000029"},{src:"app:lymph-nodes",organ:"Lymph Node",name:"Lymph Node",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002509"},{disabled:!0,src:"app:eye",organ:"Eye",name:"Eye, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000970"},{src:"app:eye",organ:"Eye",name:"Eye, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0004548"},{src:"app:eye",organ:"Eye",name:"Eye, R",side:"right",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0004549"},{disabled:!0,src:"app:fallopian-tube-left",organ:"Fallopian Tube",name:"Fallopian Tube, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0003889"},{src:"app:fallopian-tube-left",organ:"Fallopian Tube",name:"Fallopian Tube, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0001303"},{src:"app:fallopian-tube-right",organ:"Fallopian Tube",name:"Fallopian Tube, R",side:"right",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0001302"},{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, L",side:"left",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"},{disabled:!0,src:"app:knee",organ:"Knee",name:"Knee, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001465"},{src:"app:knee",organ:"Knee",name:"Knee, L",side:"left",hasSex:!0,id:"http://purl.org/sig/ont/fma/fma24978"},{src:"app:knee",organ:"Knee",name:"Knee, R",side:"right",hasSex:!0,id:"http://purl.org/sig/ont/fma/fma24977"},{src:"app:liver",organ:"Liver",name:"Liver",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002107"},{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"},{disabled:!0,src:"app:mammary-gland",organ:"Mammary Gland",name:"Mammary Gland, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0001911"},{src:"app:mammary-gland",organ:"Mammary Gland",name:"Mammary Gland, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.org/sig/ont/fma/fma57991"},{src:"app:mammary-gland",organ:"Mammary Gland",name:"Mammary Gland, R",side:"right",hasSex:!1,sex:"female",id:"http://purl.org/sig/ont/fma/fma57987"},{disabled:!0,src:"app:ovary-left",organ:"Ovary",name:"Ovary, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0000992"},{src:"app:ovary-left",organ:"Ovary",name:"Ovary, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.org/sig/ont/fma/fma7214"},{src:"app:ovary-right",organ:"Ovary",name:"Ovary, R",side:"right",hasSex:!1,sex:"female",id:"http://purl.org/sig/ont/fma/fma7213"},{src:"app:pancreas",organ:"Pancreas",name:"Pancreas",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001264"},{src:"app:pelvis-f",organ:"Pelvis",name:"Pelvis",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001270"},{src:"app:placenta",organ:"Placenta",name:"Placenta",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0001987"},{src:"app:prostate",organ:"Prostate",name:"Prostate",hasSex:!1,sex:"male",id:"http://purl.obolibrary.org/obo/UBERON_0002367",disabled:!0},{src:"app:prostate",organ:"Prostate",name:"Prostate",hasSex:!1,sex:"male",id:"http://purl.obolibrary.org/obo/UBERON_0000079"},{src:"app:small-intestine",organ:"Small Intestine",name:"Small Intestine",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002108"},{src:"app:large-intestine",organ:"Large Intestine",name:"Large Intestine",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000059"},{src:"app:spinal-cord",organ:"Spinal Cord",name:"Spinal Cord",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002240"},{src:"app:spleen",organ:"Spleen",name:"Spleen",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002106"},{src:"app:thymus",organ:"Thymus",name:"Thymus",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002370"},{disabled:!0,src:"app:ureter-left",organ:"Ureter",name:"Ureter, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000056"},{src:"app:ureter-left",organ:"Ureter",name:"Ureter, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001223"},{src:"app:ureter-right",organ:"Ureter",name:"Ureter, R",side:"right",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001222"},{src:"app:bladder",organ:"Urinary Bladder",name:"Urinary Bladder",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001255"},{src:"app:uterus",organ:"Uterus",name:"Uterus",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0000995"},{src:"app:vasculature-thick",organ:"Blood Vasculature",name:"Blood Vasculature",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0004537"},{disabled:!0,src:"app:vasculature-thick",organ:"Blood Vasculature",name:"Blood Vasculature",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002049"}].sort((n,e)=>n.name.localeCompare(e.name)).filter(n=>!0!==n.disabled);let G9=(()=>{class n{constructor(t,i){this.dialogRef=t,this.data=i,this.documentationContents=i.content||[],this.infoTitle=i.title||"",this.videoID=i.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 n.\u0275fac=function(t){return new(t||n)(xe(FC),xe(B7))},n.\u0275cmp=ln({type:n,selectors:[["ccf-info-dialog"]],decls:11,vars:2,consts:[[1,"rui-about","wrapper"],[1,"container"],[1,"content"],[1,"header"],["mat-dialog-title","",1,"title"],[1,"close"],[1,"material-icons","close-icon",3,"click"],[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,i){1&t&&(Pt(0,"div",0),Pt(1,"div",1),Pt(2,"div",2),Pt(3,"div",3),Pt(4,"h2",4),Oi(5),Ft(),Pt(6,"div",5),Pt(7,"mat-icon",6),Un("click",function(){return i.close()}),Oi(8,"clear"),Ft(),Ft(),Ft(),Pt(9,"mat-dialog-content",7),Di(10,xNe,2,1,"div",8),Ft(),Ft(),Ft(),Ft()),2&t&&(Zt(5),da(i.infoTitle),Zt(5),rn("ngForOf",i.documentationContents))},directives:[V7,Nm,U7,Af,lc,W7,q7,Q7,tW],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%] .content[_ngcontent-%COMP%] .header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;height:3rem;margin-bottom:2.25rem;position:relative}.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%]{cursor:pointer;height:3rem;width:3rem;line-height:3rem;text-align:center;transition:.6s}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-size:1.5rem;margin:0 auto;line-height:3rem;height:3rem;justify-self:center;display:flex}.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;display:flex}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .dialog-content[_ngcontent-%COMP%] .variable-binding.first[_ngcontent-%COMP%]{padding-right:1rem;width:73%}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .dialog-content[_ngcontent-%COMP%] .variable-binding[_ngcontent-%COMP%] ul{margin:0}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .dialog-content[_ngcontent-%COMP%] .variable-binding[_ngcontent-%COMP%] img{margin-left:1rem;float:right}.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%}"]}),n})(),$9=(()=>{class n{constructor(t){this.http=t,this.panelContent=new Br({content:[],infoTitle:"",videoID:""})}updateData(t,i,r){this.http.get(t,{responseType:"text"}).subscribe(s=>{const o={content:this.parseMarkdown(s),infoTitle:r,videoID:i};this.panelContent.next(o)})}parseMarkdown(t){const i=[],r=t.split("# ");for(const s of r)if(s.length){const o=s.includes("\n\n")?"\n\n":"\r\n\r\n",a=s.split(o);i.push({title:a[0],content:a.splice(1).join(o)})}return i}}return n.\u0275fac=function(t){return new(t||n)(Oe(ip))},n.\u0275prov=We({token:n,factory:n.\u0275fac,providedIn:"root"}),n})(),ANe=(()=>{class n{constructor(){this.clsName="ccf-call-to-action",this.callToActionClicked=new sn,this.closeClicked=new sn}close(){this.closeClicked.emit()}onDialogButtonClick(){this.callToActionClicked.emit()}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=ln({type:n,selectors:[["ccf-call-to-action"]],hostVars:2,hostBindings:function(t,i){2&t&&vl(i.clsName)},inputs:{infoTitle:"infoTitle",imageUrl:"imageUrl",message:"message",callToAction:"callToAction"},outputs:{callToActionClicked:"callToActionClicked",closeClicked:"closeClicked"},decls:13,vars:4,consts:[[1,"rui-about","wrapper"],[1,"container"],[1,"content"],[1,"first-row"],["mat-dialog-title","",1,"title"],[1,"cta-mat-icon","material-icons","close-icon",3,"click"],["mat-card-sm-image","","alt","preview","layout-fill","",1,"cta-image",3,"src"],[1,"mat-typography","dialog-content"],[1,"message"],["mat-button","",1,"mat-button",3,"text","click"]],template:function(t,i){1&t&&(Pt(0,"div",0),Pt(1,"div",1),Pt(2,"div",2),Pt(3,"div",3),Pt(4,"p",4),Oi(5),Ft(),Pt(6,"mat-icon",5),Un("click",function(){return i.close()}),Oi(7,"clear"),Ft(),Ft(),bi(8,"img",6),Pt(9,"mat-dialog-content",7),Pt(10,"div",8),Oi(11),Ft(),Pt(12,"a",9),Un("click",function(){return i.onDialogButtonClick()}),Ft(),Ft(),Ft(),Ft(),Ft()),2&t&&(Zt(5),da(i.infoTitle),Zt(3),rn("src",i.imageUrl,nf),Zt(3),ha(" ",i.message,""),Zt(1),rn("text",i.callToAction))},directives:[V7,Nm,KMe,U7],styles:["[_nghost-%COMP%] .content[_ngcontent-%COMP%]{display:block;align-content:center;padding-left:1.6rem;padding-right:1.6rem;border-radius:.25rem}[_nghost-%COMP%] .info-button-wrapper[_ngcontent-%COMP%]{border-radius:.25rem;padding:.6rem;transition:.6s}[_nghost-%COMP%] .info-button-wrapper[_ngcontent-%COMP%] .ccf-info-button[_ngcontent-%COMP%]{cursor:pointer;transition:color .6s;font-size:1.2rem;vertical-align:sub}[_nghost-%COMP%] .first-row[_ngcontent-%COMP%]{display:flex;width:100%;line-height:.9rem}[_nghost-%COMP%] .first-row[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{padding-right:7rem;padding-left:.2rem;font-size:.875rem;padding-top:.75rem}[_nghost-%COMP%] .first-row[_ngcontent-%COMP%] .cta-mat-icon[_ngcontent-%COMP%]{height:30%;line-height:3.4rem}[_nghost-%COMP%] .message[_ngcontent-%COMP%]{padding:.5rem}[_nghost-%COMP%] .cta-image[_ngcontent-%COMP%]{align-self:center;-o-object-fit:cover;object-fit:cover;width:100%;border-radius:.25rem}[_nghost-%COMP%] .mat-button[_ngcontent-%COMP%]{background-color:#444a65;font-size:.75rem;position:relative;margin-bottom:1rem;width:100%;height:2rem;color:#fff}"],changeDetection:0}),n})(),Yb=(()=>{let n=class extends jDe{constructor(){super(...arguments),this.optionCache=new Map}get config$(){return this.state$.pipe(Qi(n=>null!=n),$a(1))}setConfig(t){this.setState(t)}patchConfig(t){this.patchState(t)}getProperty(t){return this.config$.pipe(a7(...t),rd(),$a(1))}getOption(...t){const i=this.getPathKey(t);if(this.optionCache.has(i))return this.optionCache.get(i);const r=this.config$.pipe(a7(...t),rd(),$a(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=nr(n)))(i||n)}}(),n.\u0275prov=We({token:n,factory:n.\u0275fac}),rr([yW()],n.prototype,"config$",null),n=rr([kDe(),M6({name:"globalConfig",defaults:null})],n),n})();!function(){const n=localStorage.getItem("ALLOW_TELEMETRY");null===n||n.toLowerCase()}(),new se;let PF=(()=>{class n{}return n.type="[CallToAction] Learn More",n})(),FF=(()=>{class n{}return n.type="[CallToAction] Open Dialog",n})(),kF=(()=>{class n{}return n.type="[CallToAction] Close Dialog",n})();var LF;class wa{get length(){var e,t;return null!==(t=null===(e=wa.storage)||void 0===e?void 0:e.length)&&void 0!==t?t:0}key(e){var t,i;return null!==(i=null===(t=wa.storage)||void 0===t?void 0:t.key(e))&&void 0!==i?i:null}getItem(e,t){var i,r,s;return null!==(s=null!==(r=null===(i=wa.storage)||void 0===i?void 0:i.getItem(e))&&void 0!==r?r:t)&&void 0!==s?s:null}setItem(e,t){var i;try{return null===(i=wa.storage)||void 0===i||i.setItem(e,t),!0}catch(r){return!1}}removeItem(e){var t;null===(t=wa.storage)||void 0===t||t.removeItem(e)}clear(){var e;null===(e=wa.storage)||void 0===e||e.clear()}}wa.storage=(()=>{let n;try{n=window.localStorage;const e="__storage_test__";return n.setItem(e,e),n.removeItem(e),n}catch(e){return e instanceof DOMException&&(22===e.code||1014===e.code||"QuotaExceededError"===e.name||"NS_ERROR_DOM_QUOTA_REACHED"===e.name)&&n&&0!==n.length?n:void 0}})(),wa.\u0275fac=function(e){return new(e||wa)},wa.\u0275prov=We({token:wa,factory:wa.\u0275fac,providedIn:"root"});const Y9="callToActionPopupShown";let Do=LF=class{constructor(e,t,i,r,s){this.dialog=e,this.ga=t,this.storage=i,this.infoService=r,this.http=s}static ctaDatePassed(e,t=Date.now){return+t()>+new Date(e)}ngxsOnInit(e){const{expirationDate:t,popupShown:i}=e.getState(),r=this.storage.getItem(Y9,`${i}`),s=LF.ctaDatePassed(t);"true"!==r&&!s&&e.dispatch(new FF)}getDialogData(){return this.http.get("assets/docs/SPATIAL_SEARCH_README.md",{responseType:"text"}).pipe(me(e=>this.infoService.parseMarkdown(e)))}launchLearnMore(e){this.dialog.open(G9,{autoFocus:!1,panelClass:"modal-animated",width:"72rem",data:{title:"Spatial Search",content:e,videoID:"UfxMpzatowE"}})}learnMore(e){return this.dialog.closeAll(),this.ga.event("open_learn_more","call_to_action"),this.getDialogData().pipe(Yr(t=>this.launchLearnMore(t)))}open(e){this.dialog.open(NNe,{autoFocus:!1,panelClass:"modal-animated",width:"30.75rem",height:"36.688rem"}),this.ga.event("open","call_to_action"),this.storage.setItem(Y9,"true"),e.patchState({popupShown:!0})}close(e){this.dialog.closeAll(),this.ga.event("close","call_to_action")}};Do.\u0275fac=function(e){return new(e||Do)(Oe(Pb),Oe(AF),Oe(wa),Oe($9),Oe(ip))},Do.\u0275prov=We({token:Do,factory:Do.\u0275fac}),rr([_N(PF)],Do.prototype,"learnMore",null),rr([_N(FF)],Do.prototype,"open",null),rr([_N(kF)],Do.prototype,"close",null),Do=LF=rr([M6({name:"callToAction",defaults:{title:"New to the Exploration User Interface",message:"Spatial Search has arrived!",callToAction:"Learn More",imageUrl:"assets/images/spatial_search.gif",expirationDate:"Dec 1, 2022",popupShown:!1}})],Do);let o1=(()=>{class n{static title(t){return t.title}static message(t){return t.message}static callToAction(t){return t.callToAction}static imageUrl(t){return t.imageUrl}static expirationDate(t){return t.expirationDate}static popupShown(t){return t.popupShown}}return rr([_m([Do])],n,"title",null),rr([_m([Do])],n,"message",null),rr([_m([Do])],n,"callToAction",null),rr([_m([Do])],n,"imageUrl",null),rr([_m([Do])],n,"expirationDate",null),rr([_m([Do])],n,"popupShown",null),n})(),NNe=(()=>{class n{constructor(){this.close=()=>new kF,this.learnMore=()=>new PF}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=ln({type:n,selectors:[["ccf-call-to-action-behavior"]],decls:5,vars:12,consts:[[3,"infoTitle","message","callToAction","imageUrl","callToActionClicked","closeClicked"]],template:function(t,i){1&t&&(Pt(0,"ccf-call-to-action",0),Un("callToActionClicked",function(){return i.learnMore()})("closeClicked",function(){return i.close()}),xl(1,"async"),xl(2,"async"),xl(3,"async"),xl(4,"async"),Ft()),2&t&&rn("infoTitle",Vu(1,4,i.title$))("message",Vu(2,6,i.message$))("callToAction",Vu(3,8,i.callToAction$))("imageUrl",Vu(4,10,i.imageUrl$))},directives:[ANe],pipes:[h0],styles:[""],changeDetection:0}),rr([kx(o1.title)],n.prototype,"title$",void 0),rr([kx(o1.message)],n.prototype,"message$",void 0),rr([kx(o1.callToAction)],n.prototype,"callToAction$",void 0),rr([kx(o1.imageUrl)],n.prototype,"imageUrl$",void 0),rr([R9()],n.prototype,"close",void 0),rr([R9()],n.prototype,"learnMore",void 0),n})();const K9="http://purl.org/ccf/latest/ccf-entity.owl#has_spatial_entity",BNe=[173,255,47,229.5];var xn=Je(440),HNe=Je(698),GNe=Je(445),$Ne=Je.n(GNe),fr=Je(815),Kb=Je(609);const or=xn.Util.prefixes({base:"http://purl.org/ccf/latest/ccf.owl#",ccf:"http://purl.org/ccf/",fma:"http://purl.org/sig/ont/fma/fma",obo:"http://purl.obolibrary.org/obo/",uberon:"http://purl.obolibrary.org/obo/UBERON_",cl:"http://purl.obolibrary.org/obo/CL_",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/",dcterms:"http://purl.org/dc/terms/"},xn.DataFactory),un=(or("rdf"),or("rdf")("type"),or("rdfs"),or("rdfs")("label"),or("rdfs")("comment"),or("rdfs")("isDefinedBy"),or("rdfs")("seeAlso"),or("ccf")),co_label=(or("ccf")("has_registration_location"),or("rdfs")("label")),co_description=or("rdfs")("comment"),co_link=un("url"),co_providerName=(un("sex"),un("age"),un("bmi"),xn.DataFactory.literal("Male"),xn.DataFactory.literal("Female"),un("consortium_name"),un("tissue_provider_name")),co_donor=(un("tissue_provider_uuid"),un("comes_from")),co_sections=un("subdivided_into_sections"),co_datasets=un("generates_dataset"),co_sampleType=un("sample_type"),co_sectionCount=(xn.DataFactory.literal("Tissue Block"),xn.DataFactory.literal("Tissue Section"),xn.DataFactory.literal("Non-standard"),un("section_count")),co_sectionSize=un("section_size"),co_sectionUnits=un("section_size_unit"),co_sectionNumber=un("section_number"),co_spatialEntity=un("has_registration_location"),co_technology=(un("has_ontology_term"),un("has_cell_type_term"),un("technology")),co_thumbnail=un("thumbnail"),md={x:un,base:or("base"),ontologyNode:{label:un("ccf_pref_label"),parent:un("ccf_part_of"),children:un("ccf_part_of"),rui_rank:un("rui_rank"),synonymLabels:xn.DataFactory.namedNode("http://www.geneontology.org/formats/oboInOwl#hasExactSynonym")},asctb:{part_of:un("ccf_part_of"),ct_is_a:un("ccf_ct_isa"),located_in:un("ccf_located_in"),characterizes:un("ccf_characterizes")},spatial:{Female:or("base")("VHFemale"),Male:or("base")("VHMale"),BothSexes:or("base")("VHBothSexes"),FemaleOrgans:or("base")("VHFemaleOrgans"),MaleOrgans:or("base")("VHMaleOrgans")},SpatialObjectReference:un("spatial_object_reference"),SpatialEntity:un("spatial_entity"),SpatialPlacement:un("spatial_placement"),spatialObjectReference:{file:un("file_url"),file_format:un("file_format"),file_subpath:un("file_subpath")},extractionSet:{label:or("rdfs")("label"),rui_rank:un("rui_rank")},spatialEntity:{label:or("rdfs")("label"),description:or("rdfs")("comment"),creator:or("dcterms")("creator"),creator_first_name:un("creator_first_name"),creator_last_name:un("creator_last_name"),creator_orcid:un("creator_orcid"),creation_date:or("dcterms")("created"),updated_date:un("updated_date"),ccf_annotations:un("collides_with"),representation_of:un("representation_of"),reference_organ:un("has_reference_organ"),extraction_set_for:un("extraction_set_for"),extraction_set:un("has_extraction_set"),sex:un("organ_owner_sex"),side:un("organ_side"),rui_rank:un("rui_rank"),slice_thickness:un("slice_thickness"),slice_count:un("slice_count"),x_dimension:un("x_dimension"),y_dimension:un("y_dimension"),z_dimension:un("z_dimension"),dimension_units:un("dimension_unit"),object:un("has_object_reference")},spatialPlacement:{source:un("placement_for"),target:un("placement_relative_to"),placement_date:or("dcterms")("created"),x_scaling:un("x_scaling"),y_scaling:un("y_scaling"),z_scaling:un("z_scaling"),scaling_units:un("scaling_unit"),x_rotation:un("x_rotation"),y_rotation:un("y_rotation"),z_rotation:un("z_rotation"),w_rotation:un("theta_rotation"),rotation_order:un("rotation_order"),rotation_units:un("rotation_unit"),x_translation:un("x_translation"),y_translation:un("y_translation"),z_translation:un("z_translation"),translation_units:un("translation_unit")}},ui={x:or("uberon"),body:or("uberon")("0013702")},YNe={x:or("cl"),cell:or("cl")("0000000")},Xb={x:or("fma")},X9=(or("lmha"),{body:ui.body,cell:YNe.cell,respiratory_system:ui.x("0001004"),colon:ui.x("0001155"),left_lung:ui.x("0002168"),right_lung:ui.x("0002167"),left_bronchus:ui.x("0002178"),right_bronchus:ui.x("0002177"),kidney:ui.x("0002113"),ureter:ui.x("0000056"),eye:ui.x("0000970"),fallopian_tube:ui.x("0003889"),knee:ui.x("0001465"),ovary:ui.x("0000992"),trachea:ui.x("0003126"),aorta:ui.x("0000947"),blood:ui.x("0000178"),bone_marrow:ui.x("0002371"),male_reproductive_system:ui.x("0000079"),lymph_node:ui.x("0000029"),blood_vasculature:ui.x("0004537"),brain:ui.x("0000955"),eye_left:ui.x("0004548"),eye_right:Xb.x("54449"),fallopian_tube_left:ui.x("0001303"),fallopian_tube_right:ui.x("0001302"),heart:ui.x("0000948"),kidney_left:ui.x("0004538"),kidney_right:ui.x("0004539"),knee_left:Xb.x("24978"),knee_right:Xb.x("24977"),large_intestine:ui.x("0000059"),liver:ui.x("0002107"),lungs:ui.x("0002048"),mesenteric_lymph_node:ui.x("0002509"),ovary_left:Xb.x("7214"),ovary_right:Xb.x("7213"),pancreas:ui.x("0001264"),pelvis:ui.x("0001270"),prostate_gland:ui.x("0002367"),skin:ui.x("0002097"),small_intestine:ui.x("0002108"),spleen:ui.x("0002106"),thymus:ui.x("0002370"),ureter_left:ui.x("0001223"),ureter_right:ui.x("0001222"),urinary_bladder:ui.x("0001255"),uterus:ui.x("0000995")});function BF(n){const e={};return Object.entries(n).forEach(([t,i])=>{e[i.id]=t}),e}BF(md.spatialObjectReference),BF(md.spatialEntity),BF(md.spatialPlacement),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"]);const zm=Object.freeze({OUTSIDE:-1,INTERSECTING:0,INSIDE:1}),Pr=(Math,Math,{});function cPe(n,{precision:e=Pr.precision||4}={}){return n=function(n){return Math.round(n/Pr.EPSILON)*Pr.EPSILON}(n),"".concat(parseFloat(n.toPrecision(e)))}function Ah(n){return Array.isArray(n)||ArrayBuffer.isView(n)&&!(n instanceof DataView)}function Zb(n,e,t){const i=Pr.EPSILON;t&&(Pr.EPSILON=t);try{if(n===e)return!0;if(Ah(n)&&Ah(e)){if(n.length!==e.length)return!1;for(let r=0;r0?", ":"")+cPe(this[i],e);return"".concat(e.printTypes?this.constructor.name:"","[").concat(t,"]")}equals(e){if(!e||this.length!==e.length)return!1;for(let t=0;t=0&&e=0&&e=a+s)return this.clone();if(s>=a+i)return e.clone();const l=.5*(i+a+s);return oq.copy(o).scale((-i+l)/a).add(t),this.center.copy(oq),this.radius=l,this}expand(e){const t=(e=Jb.from(e)).subtract(this.center).magnitude();return t>this.radius&&(this.radius=t),this}transform(e){this.center.transform(e);const t=function(n,e){var s=e[4],o=e[5],a=e[6],l=e[8],c=e[9],u=e[10];return n[0]=Math.hypot(e[0],e[1],e[2]),n[1]=Math.hypot(s,o,a),n[2]=Math.hypot(l,c,u),n}(Jb,e);return this.radius=Math.max(t[0],Math.max(t[1],t[2]))*this.radius,this}distanceSquaredTo(e){const t=this.distanceTo(e);return t*t}distanceTo(e){const t=(e=Jb.from(e)).subtract(this.center);return Math.max(0,t.len()-this.radius)}intersectPlane(e){const i=this.radius,s=e.normal.dot(this.center)+e.distance;return s<-i?zm.OUTSIDE:s0?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 u5(this,this,e),this.check()}rotateY(e){return d5(this,this,e),this.check()}rotateZ(e){return h5(this,this,e),this.check()}scale(e){return fR(this,this,e),this.check()}slerp(e,t,i){switch(arguments.length){case 1:({start:e=CPe,target:t,ratio:i}=arguments[0]);break;case 2:[t,i]=arguments,e=this}return J0(this,e,t,i),this.check()}transformVector4(e,t=e){return kU(t,e,this),tq(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)}}const APe=new Pn,TPe=new Pn,c1=new Pn,u1=new Pn,d1=new Pn,MPe=new Pn,DPe=new Pn;class GF{constructor(e=[0,0,0],t=[0,0,0,0,0,0,0,0,0]){this.center=(new Pn).from(e),this.halfAxes=new Xo(t)}get halfSize(){const e=this.halfAxes.getColumn(0),t=this.halfAxes.getColumn(1),i=this.halfAxes.getColumn(2);return[new Pn(e).len(),new Pn(t).len(),new Pn(i).len()]}get quaternion(){const e=this.halfAxes.getColumn(0),t=this.halfAxes.getColumn(1),i=this.halfAxes.getColumn(2),r=new Pn(e).normalize(),s=new Pn(t).normalize(),o=new Pn(i).normalize();return(new lq).fromMatrix3(new Xo([...r,...s,...o]))}fromCenterHalfSizeQuaternion(e,t,i){const r=new lq(i),s=(new Xo).fromQuaternion(r);return s[0]=s[0]*t[0],s[1]=s[1]*t[0],s[2]=s[2]*t[0],s[3]=s[3]*t[1],s[4]=s[4]*t[1],s[5]=s[5]*t[1],s[6]=s[6]*t[2],s[7]=s[7]*t[2],s[8]=s[8]*t[2],this.center=(new Pn).from(e),this.halfAxes=s,this}clone(){return new GF(this.center,this.halfAxes)}equals(e){return this===e||Boolean(e)&&this.center.equals(e.center)&&this.halfAxes.equals(e.halfAxes)}getBoundingSphere(e=new HF){const t=this.halfAxes,i=t.getColumn(0,c1),r=t.getColumn(1,u1),s=t.getColumn(2,d1),o=APe.copy(i).add(r).add(s);return e.center.copy(this.center),e.radius=o.magnitude(),e}intersectPlane(e){const t=this.center,i=e.normal,r=this.halfAxes,s=i.x,o=i.y,a=i.z,l=Math.abs(s*r[0]+o*r[1]+a*r[2])+Math.abs(s*r[3]+o*r[4]+a*r[5])+Math.abs(s*r[6]+o*r[7]+a*r[8]),c=i.dot(t)+e.distance;return c<=-l?zm.OUTSIDE:c>=l?zm.INSIDE:zm.INTERSECTING}distanceTo(e){return Math.sqrt(this.distanceSquaredTo(e))}distanceSquaredTo(e){const t=TPe.from(e).subtract(this.center),i=this.halfAxes,r=i.getColumn(0,c1),s=i.getColumn(1,u1),o=i.getColumn(2,d1),a=r.magnitude(),l=s.magnitude(),c=o.magnitude();r.normalize(),s.normalize(),o.normalize();let h,u=0;return h=Math.abs(t.dot(r))-a,h>0&&(u+=h*h),h=Math.abs(t.dot(s))-l,h>0&&(u+=h*h),h=Math.abs(t.dot(o))-c,h>0&&(u+=h*h),u}computePlaneDistances(e,t,i=[-0,-0]){let r=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY;const o=this.center,a=this.halfAxes,l=a.getColumn(0,c1),c=a.getColumn(1,u1),u=a.getColumn(2,d1),h=MPe.copy(l).add(c).add(u).add(o),p=DPe.copy(h).subtract(e);let g=t.dot(p);return r=Math.min(g,r),s=Math.max(g,s),h.copy(o).add(l).add(c).subtract(u),p.copy(h).subtract(e),g=t.dot(p),r=Math.min(g,r),s=Math.max(g,s),h.copy(o).add(l).subtract(c).add(u),p.copy(h).subtract(e),g=t.dot(p),r=Math.min(g,r),s=Math.max(g,s),h.copy(o).add(l).subtract(c).subtract(u),p.copy(h).subtract(e),g=t.dot(p),r=Math.min(g,r),s=Math.max(g,s),o.copy(h).subtract(l).add(c).add(u),p.copy(h).subtract(e),g=t.dot(p),r=Math.min(g,r),s=Math.max(g,s),o.copy(h).subtract(l).add(c).subtract(u),p.copy(h).subtract(e),g=t.dot(p),r=Math.min(g,r),s=Math.max(g,s),o.copy(h).subtract(l).subtract(c).add(u),p.copy(h).subtract(e),g=t.dot(p),r=Math.min(g,r),s=Math.max(g,s),o.copy(h).subtract(l).subtract(c).subtract(u),p.copy(h).subtract(e),g=t.dot(p),r=Math.min(g,r),s=Math.max(g,s),i[0]=r,i[1]=s,i}transform(e){this.center.transformAsPoint(e);const t=this.halfAxes.getColumn(0,c1);t.transformAsPoint(e);const i=this.halfAxes.getColumn(1,u1);i.transformAsPoint(e);const r=this.halfAxes.getColumn(2,d1);return r.transformAsPoint(e),this.halfAxes=new Xo([...t,...i,...r]),this}getTransform(){throw new Error("not implemented")}}const cq=new Pn,uq=new Pn;class $F{constructor(e=[0,0,1],t=0){this.normal=new Pn,this.distance=-0,this.fromNormalDistance(e,t)}fromNormalDistance(e,t){return Ec(Number.isFinite(t)),this.normal.from(e).normalize(),this.distance=t,this}fromPointNormal(e,t){e=cq.from(e),this.normal.from(t).normalize();const i=-this.normal.dot(e);return this.distance=i,this}fromCoefficients(e,t,i,r){return this.normal.set(e,t,i),Ec(Zb(this.normal.len(),1)),this.distance=r,this}clone(e){return new $F(this.normal,this.distance)}equals(e){return Zb(this.distance,e.distance)&&Zb(this.normal,e.normal)}getPointDistance(e){return this.normal.dot(e)+this.distance}transform(e){const t=uq.copy(this.normal).transformAsVector(e).normalize(),i=this.normal.scale(-this.distance).transform(e);return this.fromPointNormal(i,t)}projectPointOntoPlane(e,t=[0,0,0]){e=cq.from(e);const i=this.getPointDistance(e),r=uq.copy(this.normal).scale(i);return e.subtract(r).to(t)}}function bFe(n,e,t){const i={"@id":e,"@type":"OntologyTreeNode",id:e,parent:"",children:[],synonymLabels:[],label:""},r={[md.ontologyNode.label.id]:"label",[t]:"parent",[md.ontologyNode.synonymLabels.id]:"synonymLabels"};for(const[s,o]of function*(n,e,t){for(const[i,r]of Object.entries(t))for(const s of(0,xn.readQuads)(n,e,i,null,null)){const o="Literal"===s.object.termType?(0,Kb.fromRdf)(s.object):s.object.id;yield[r,o]}}(n,e,r))"synonymLabels"===s?i.synonymLabels.push(o):i[s]=o;return i.children=n.getSubjects(t,e,null).map(s=>s.id),i}function mq(n,e,t,i){const r={root:e,nodes:{}},s=new Set;for(const a of(0,xn.readQuads)(n,null,i,null,null))s.add(a.subject.id),s.add(a.object.id);for(const a of s)r.nodes[a]=bFe(n,a,i);r.nodes[e]||(r.nodes[e]={"@id":e,"@type":"OntologyTreeNode",id:e,label:t,children:[],synonymLabels:[]});const o=n.getSubjects(i,e,null).map(a=>a.id).sort((a,l)=>r.nodes[a].label.localeCompare(r.nodes[l].label));return r.nodes[e].children=o,_q(r),r}function _q(n,e,t=new Set){const i=n.nodes[null!=e?e:n.root];if(i){i.children=i.children.filter(r=>!t.has(r)),i.children.forEach(r=>t.add(r));for(const r of i.children)_q(n,r,t),n.nodes[r]&&(n.nodes[r].parent=i["@id"])}}new Pn([1,0,0]),new Pn([0,1,0]),new Pn([0,0,1]),new Pn,new Pn,new $F(new Pn(1,0,0),0),new Pn,new Pn,new Pn,new Pn,new Pn,new Pn,new Pn,new Pn,new Pn,new Pn,new Pn,new Pn,new Pn,new Pn,new Pn,new Pn,new Pn,Math,new Xo,new Xo,new Xo,new Xo,new Xo,new Pn,new Pn,new Pn,new Pn,new Pn,new Xo,new Xo,new Xo,(0,fr.memoize)(function(n){const e=mq(n,X9.body.id,"body",md.asctb.part_of.id);return e.nodes[X9.body.id].children=["http://purl.obolibrary.org/obo/UBERON_0000955","http://purl.obolibrary.org/obo/UBERON_0000029","http://purl.obolibrary.org/obo/UBERON_0000970","http://purl.obolibrary.org/obo/UBERON_0003889","http://purl.obolibrary.org/obo/UBERON_0000948","http://purl.obolibrary.org/obo/UBERON_0002113","http://purl.obolibrary.org/obo/UBERON_0001465","http://purl.obolibrary.org/obo/UBERON_0002107","http://purl.obolibrary.org/obo/UBERON_0002048","http://purl.obolibrary.org/obo/UBERON_0001911","http://purl.obolibrary.org/obo/UBERON_0000992","http://purl.obolibrary.org/obo/UBERON_0001264","http://purl.obolibrary.org/obo/UBERON_0001270","http://purl.obolibrary.org/obo/UBERON_0001987","http://purl.obolibrary.org/obo/UBERON_0002367","http://purl.obolibrary.org/obo/UBERON_0002097","http://purl.obolibrary.org/obo/UBERON_0002108","http://purl.obolibrary.org/obo/UBERON_0002240","http://purl.obolibrary.org/obo/UBERON_0000059","http://purl.obolibrary.org/obo/UBERON_0002106","http://purl.obolibrary.org/obo/UBERON_0002370","http://purl.obolibrary.org/obo/UBERON_0000056","http://purl.obolibrary.org/obo/UBERON_0001255","http://purl.obolibrary.org/obo/UBERON_0000995","http://purl.obolibrary.org/obo/UBERON_0004537"].filter(t=>t in e.nodes),e},()=>"");const p1={[co_label.id]:"label",[co_description.id]:"description",[co_link.id]:"link"};Object.assign(Object.assign({},p1),{[co_providerName.id]:"providerName"}),Object.assign(Object.assign({},p1),{[co_technology.id]:"technology",[co_thumbnail.id]:"thumbnail"}),Object.assign(Object.assign({},p1),{[co_sampleType.id]:"sampleType",[co_sectionNumber.id]:"sectionNumber",[co_datasets.id]:"datasets"}),Object.assign(Object.assign({},p1),{[co_sampleType.id]:"sampleType",[co_sectionCount.id]:"sectionCount",[co_sectionSize.id]:"sectionSize",[co_sectionUnits.id]:"sectionUnits",[co_donor.id]:"donor",[co_spatialEntity.id]:"spatialEntityId",[co_sections.id]:"sections",[co_datasets.id]:"datasets"});const 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"};function mu(n){return new Promise((e,t)=>{n.oncomplete=n.onsuccess=()=>e(n.result),n.onabort=n.onerror=()=>t(n.error)})}let ZF;function Sc(){return ZF||(ZF=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),mu(i)});return(i,r)=>t.then(s=>r(s.transaction(e,i).objectStore(e)))}(0,"keyval")),ZF}function vq(n,e=Sc()){return e("readonly",t=>mu(t.get(n)))}const g1="Unknown Euler angle order",$m=.99999;class Ji extends bS{static get ZYX(){return 0}static get YXZ(){return 1}static get XZY(){return 2}static get ZXY(){return 3}static get YZX(){return 4}static get XYZ(){return 5}static get RollPitchYaw(){return 0}static get DefaultOrder(){return Ji.ZYX}static get RotationOrders(){return["ZYX","YXZ","XZY","ZXY","YZX","XYZ"]}static rotationOrder(e){return Ji.RotationOrders[e]}get ELEMENTS(){return 4}constructor(e=0,t=0,i=0,r=Ji.DefaultOrder){super(-0,-0,-0,-0),arguments.length>0&&Array.isArray(arguments[0])?this.fromVector3(...arguments):this.set(e,t,i,r)}fromQuaternion(e){const[t,i,r,s]=e,o=i*i,a=-2*(o+r*r)+1,l=2*(t*i+s*r);let c=-2*(t*r-s*i);c=c>1?1:c,c=c<-1?-1:c;const p=Math.atan2(2*(i*r+s*t),-2*(t*t+o)+1),g=Math.asin(c),m=Math.atan2(l,a);return new Ji(p,g,m,Ji.RollPitchYaw)}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=Number.isFinite(e[3])||this.order,this.check()}set(e=0,t=0,i=0,r){return this[0]=e,this[1]=t,this[2]=i,this[3]=Number.isFinite(r)?r:this[3],this.check()}validate(){return function(n){return n>=0&&n<6}(this[3])&&Number.isFinite(this[0])&&Number.isFinite(this[1])&&Number.isFinite(this[2])}toArray(e=[],t=0){return e[t]=this[0],e[t+1]=this[1],e[t+2]=this[2],e}toArray4(e=[],t=0){return e[t]=this[0],e[t+1]=this[1],e[t+2]=this[2],e[t+3]=this[3],e}toVector3(e=[-0,-0,-0]){return e[0]=this[0],e[1]=this[1],e[2]=this[2],e}get x(){return this[0]}set x(e){this[0]=sr(e)}get y(){return this[1]}set y(e){this[1]=sr(e)}get z(){return this[2]}set z(e){this[2]=sr(e)}get alpha(){return this[0]}set alpha(e){this[0]=sr(e)}get beta(){return this[1]}set beta(e){this[1]=sr(e)}get gamma(){return this[2]}set gamma(e){this[2]=sr(e)}get phi(){return this[0]}set phi(e){this[0]=sr(e)}get theta(){return this[1]}set theta(e){this[1]=sr(e)}get psi(){return this[2]}set psi(e){this[2]=sr(e)}get roll(){return this[0]}set roll(e){this[0]=sr(e)}get pitch(){return this[1]}set pitch(e){this[1]=sr(e)}get yaw(){return this[2]}set yaw(e){this[2]=sr(e)}get order(){return this[3]}set order(e){this[3]=function(n){if(n<0&&n>=6)throw new Error(g1);return n}(e)}fromVector3(e,t){return this.set(e[0],e[1],e[2],Number.isFinite(t)?t:this[3])}fromArray(e,t=0){return this[0]=e[0+t],this[1]=e[1+t],this[2]=e[2+t],void 0!==e[3]&&(this[3]=e[3]),this.check()}fromRollPitchYaw(e,t,i){return this.set(e,t,i,Ji.ZYX)}fromRotationMatrix(e,t=Ji.DefaultOrder){return this._fromRotationMatrix(e,t),this.check()}getRotationMatrix(e){return this._getRotationMatrix(e)}getQuaternion(){const e=new gR;switch(this[4]){case Ji.XYZ:return e.rotateX(this[0]).rotateY(this[1]).rotateZ(this[2]);case Ji.YXZ:return e.rotateY(this[0]).rotateX(this[1]).rotateZ(this[2]);case Ji.ZXY:return e.rotateZ(this[0]).rotateX(this[1]).rotateY(this[2]);case Ji.ZYX:return e.rotateZ(this[0]).rotateY(this[1]).rotateX(this[2]);case Ji.YZX:return e.rotateY(this[0]).rotateZ(this[1]).rotateX(this[2]);case Ji.XZY:return e.rotateX(this[0]).rotateZ(this[1]).rotateY(this[2]);default:throw new Error(g1)}}_fromRotationMatrix(e,t=Ji.DefaultOrder){const i=e.elements,r=i[0],s=i[4],o=i[8],a=i[1],l=i[5],c=i[9],u=i[2],h=i[6],p=i[10];switch(t=t||this[3]){case Ji.XYZ:this[1]=Math.asin(Va(o,-1,1)),Math.abs(o)<$m?(this[0]=Math.atan2(-c,p),this[2]=Math.atan2(-s,r)):(this[0]=Math.atan2(h,l),this[2]=0);break;case Ji.YXZ:this[0]=Math.asin(-Va(c,-1,1)),Math.abs(c)<$m?(this[1]=Math.atan2(o,p),this[2]=Math.atan2(a,l)):(this[1]=Math.atan2(-u,r),this[2]=0);break;case Ji.ZXY:this[0]=Math.asin(Va(h,-1,1)),Math.abs(h)<$m?(this[1]=Math.atan2(-u,p),this[2]=Math.atan2(-s,l)):(this[1]=0,this[2]=Math.atan2(a,r));break;case Ji.ZYX:this[1]=Math.asin(-Va(u,-1,1)),Math.abs(u)<$m?(this[0]=Math.atan2(h,p),this[2]=Math.atan2(a,r)):(this[0]=0,this[2]=Math.atan2(-s,l));break;case Ji.YZX:this[2]=Math.asin(Va(a,-1,1)),Math.abs(a)<$m?(this[0]=Math.atan2(-c,l),this[1]=Math.atan2(-u,r)):(this[0]=0,this[1]=Math.atan2(o,p));break;case Ji.XZY:this[2]=Math.asin(-Va(s,-1,1)),Math.abs(s)<$m?(this[0]=Math.atan2(h,l),this[1]=Math.atan2(o,r)):(this[0]=Math.atan2(-c,p),this[1]=0);break;default:throw new Error(g1)}return this[3]=t,this}_getRotationMatrix(e){const t=e||[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],i=this.x,r=this.y,s=this.z,o=Math.cos(i),a=Math.cos(r),l=Math.cos(s),c=Math.sin(i),u=Math.sin(r),h=Math.sin(s);switch(this[3]){case Ji.XYZ:{const p=o*l,g=o*h,m=c*l,w=c*h;t[0]=a*l,t[4]=-a*h,t[8]=u,t[1]=g+m*u,t[5]=p-w*u,t[9]=-c*a,t[2]=w-p*u,t[6]=m+g*u,t[10]=o*a;break}case Ji.YXZ:{const p=a*l,g=a*h,m=u*l,w=u*h;t[0]=p+w*c,t[4]=m*c-g,t[8]=o*u,t[1]=o*h,t[5]=o*l,t[9]=-c,t[2]=g*c-m,t[6]=w+p*c,t[10]=o*a;break}case Ji.ZXY:{const p=a*l,g=a*h,m=u*l,w=u*h;t[0]=p-w*c,t[4]=-o*h,t[8]=m+g*c,t[1]=g+m*c,t[5]=o*l,t[9]=w-p*c,t[2]=-o*u,t[6]=c,t[10]=o*a;break}case Ji.ZYX:{const p=o*l,g=o*h,m=c*l,w=c*h;t[0]=a*l,t[4]=m*u-g,t[8]=p*u+w,t[1]=a*h,t[5]=w*u+p,t[9]=g*u-m,t[2]=-u,t[6]=c*a,t[10]=o*a;break}case Ji.YZX:{const p=o*a,g=o*u,m=c*a,w=c*u;t[0]=a*l,t[4]=w-p*h,t[8]=m*h+g,t[1]=h,t[5]=o*l,t[9]=-c*l,t[2]=-u*l,t[6]=g*h+m,t[10]=p-w*h;break}case Ji.XZY:{const p=o*a,g=o*u,m=c*a,w=c*u;t[0]=a*l,t[4]=-h,t[8]=u*l,t[1]=p*h+w,t[5]=o*l,t[9]=g*h-m,t[2]=m*h-g,t[6]=c*l,t[10]=w*h+p;break}default:throw new Error(g1)}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}toQuaternion(){const e=Math.cos(.5*this.yaw),t=Math.sin(.5*this.yaw),i=Math.cos(.5*this.roll),r=Math.sin(.5*this.roll),s=Math.cos(.5*this.pitch),o=Math.sin(.5*this.pitch);return new gR(e*r*s-t*i*o,e*i*o+t*r*s,t*i*s-e*r*o,e*i*s+t*r*o)}}var m1,FFe=new Uint8Array(16);function kFe(){if(!m1&&!(m1="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return m1(FFe)}const LFe=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,jFe=function(n){return"string"==typeof n&&LFe.test(n)};for(var ho=[],e2=0;e2<256;++e2)ho.push((e2+256).toString(16).substr(1));const HFe=function(n,e,t){var i=(n=n||{}).random||(n.rng||kFe)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,e){t=t||0;for(var r=0;r<16;++r)e[t+r]=i[r];return e}return function(n){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,t=(ho[n[e+0]]+ho[n[e+1]]+ho[n[e+2]]+ho[n[e+3]]+"-"+ho[n[e+4]]+ho[n[e+5]]+"-"+ho[n[e+6]]+ho[n[e+7]]+"-"+ho[n[e+8]]+ho[n[e+9]]+"-"+ho[n[e+10]]+ho[n[e+11]]+ho[n[e+12]]+ho[n[e+13]]+ho[n[e+14]]+ho[n[e+15]]).toLowerCase();if(!jFe(t))throw TypeError("Stringified UUID is invalid");return t}(i)};function*t2(n,e,t){for(const[i,r]of Object.entries(t))for(const s of(0,xn.readQuads)(n,e,i,null,null)){const o="Literal"===s.object.termType?(0,Kb.fromRdf)(s.object):s.object.id;yield[r,o]}}function dp(n,e,t,i){const r={"@id":e,"@type":t};for(const[s,o]of Object.entries(i))for(const a of(0,xn.readQuads)(n,r["@id"],s,null,null)){const l="Literal"===a.object.termType?(0,Kb.fromRdf)(a.object):a.object.id;r[o]=l}return r}const ar=xn.Util.prefixes({base:"http://purl.org/ccf/latest/ccf.owl#",ccf:"http://purl.org/ccf/",fma:"http://purl.org/sig/ont/fma/fma",obo:"http://purl.obolibrary.org/obo/",uberon:"http://purl.obolibrary.org/obo/UBERON_",cl:"http://purl.obolibrary.org/obo/CL_",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/",dcterms:"http://purl.org/dc/terms/"},xn.DataFactory),wq={x:ar("rdf"),type:ar("rdf")("type")},dn=(ar("rdfs"),ar("rdfs")("label"),ar("rdfs")("comment"),ar("rdfs")("isDefinedBy"),ar("rdfs")("seeAlso"),ar("ccf")),yi={id:ar("ccf")("has_registration_location"),label:ar("rdfs")("label"),description:ar("rdfs")("comment"),link:dn("url"),sex:dn("sex"),age:dn("age"),bmi:dn("bmi"),Male:xn.DataFactory.literal("Male"),Female:xn.DataFactory.literal("Female"),consortiumName:dn("consortium_name"),providerName:dn("tissue_provider_name"),providerUUID:dn("tissue_provider_uuid"),donor:dn("comes_from"),sections:dn("subdivided_into_sections"),datasets:dn("generates_dataset"),sampleType:dn("sample_type"),TissueBlock:xn.DataFactory.literal("Tissue Block"),TissueSection:xn.DataFactory.literal("Tissue Section"),NonStandard:xn.DataFactory.literal("Non-standard"),sectionCount:dn("section_count"),sectionSize:dn("section_size"),sectionUnits:dn("section_size_unit"),sectionNumber:dn("section_number"),spatialEntity:dn("has_registration_location"),ontologyTerms:dn("has_ontology_term"),cellTypeTerms:dn("has_cell_type_term"),technology:dn("technology"),thumbnail:dn("thumbnail")},ki={x:dn,base:ar("base"),ontologyNode:{label:dn("ccf_pref_label"),parent:dn("ccf_part_of"),children:dn("ccf_part_of"),rui_rank:dn("rui_rank"),synonymLabels:xn.DataFactory.namedNode("http://www.geneontology.org/formats/oboInOwl#hasExactSynonym")},asctb:{part_of:dn("ccf_part_of"),ct_is_a:dn("ccf_ct_isa"),located_in:dn("ccf_located_in"),characterizes:dn("ccf_characterizes")},spatial:{Female:ar("base")("VHFemale"),Male:ar("base")("VHMale"),BothSexes:ar("base")("VHBothSexes"),FemaleOrgans:ar("base")("VHFemaleOrgans"),MaleOrgans:ar("base")("VHMaleOrgans")},SpatialObjectReference:dn("spatial_object_reference"),SpatialEntity:dn("spatial_entity"),SpatialPlacement:dn("spatial_placement"),spatialObjectReference:{file:dn("file_url"),file_format:dn("file_format"),file_subpath:dn("file_subpath")},extractionSet:{label:ar("rdfs")("label"),rui_rank:dn("rui_rank")},spatialEntity:{label:ar("rdfs")("label"),description:ar("rdfs")("comment"),creator:ar("dcterms")("creator"),creator_first_name:dn("creator_first_name"),creator_last_name:dn("creator_last_name"),creator_orcid:dn("creator_orcid"),creation_date:ar("dcterms")("created"),updated_date:dn("updated_date"),ccf_annotations:dn("collides_with"),representation_of:dn("representation_of"),reference_organ:dn("has_reference_organ"),extraction_set_for:dn("extraction_set_for"),extraction_set:dn("has_extraction_set"),sex:dn("organ_owner_sex"),side:dn("organ_side"),rui_rank:dn("rui_rank"),slice_thickness:dn("slice_thickness"),slice_count:dn("slice_count"),x_dimension:dn("x_dimension"),y_dimension:dn("y_dimension"),z_dimension:dn("z_dimension"),dimension_units:dn("dimension_unit"),object:dn("has_object_reference")},spatialPlacement:{source:dn("placement_for"),target:dn("placement_relative_to"),placement_date:ar("dcterms")("created"),x_scaling:dn("x_scaling"),y_scaling:dn("y_scaling"),z_scaling:dn("z_scaling"),scaling_units:dn("scaling_unit"),x_rotation:dn("x_rotation"),y_rotation:dn("y_rotation"),z_rotation:dn("z_rotation"),w_rotation:dn("theta_rotation"),rotation_order:dn("rotation_order"),rotation_units:dn("rotation_unit"),x_translation:dn("x_translation"),y_translation:dn("y_translation"),z_translation:dn("z_translation"),translation_units:dn("translation_unit")}},di={x:ar("uberon"),body:ar("uberon")("0013702")},$Fe={x:ar("cl"),cell:ar("cl")("0000000")},nv={x:ar("fma")},bd=(ar("lmha"),{body:di.body,cell:$Fe.cell,respiratory_system:di.x("0001004"),colon:di.x("0001155"),left_lung:di.x("0002168"),right_lung:di.x("0002167"),left_bronchus:di.x("0002178"),right_bronchus:di.x("0002177"),kidney:di.x("0002113"),ureter:di.x("0000056"),eye:di.x("0000970"),fallopian_tube:di.x("0003889"),knee:di.x("0001465"),ovary:di.x("0000992"),trachea:di.x("0003126"),aorta:di.x("0000947"),blood:di.x("0000178"),bone_marrow:di.x("0002371"),male_reproductive_system:di.x("0000079"),lymph_node:di.x("0000029"),blood_vasculature:di.x("0004537"),brain:di.x("0000955"),eye_left:di.x("0004548"),eye_right:nv.x("54449"),fallopian_tube_left:di.x("0001303"),fallopian_tube_right:di.x("0001302"),heart:di.x("0000948"),kidney_left:di.x("0004538"),kidney_right:di.x("0004539"),knee_left:nv.x("24978"),knee_right:nv.x("24977"),large_intestine:di.x("0000059"),liver:di.x("0002107"),lungs:di.x("0002048"),mesenteric_lymph_node:di.x("0002509"),ovary_left:nv.x("7214"),ovary_right:nv.x("7213"),pancreas:di.x("0001264"),pelvis:di.x("0001270"),prostate_gland:di.x("0002367"),skin:di.x("0002097"),small_intestine:di.x("0002108"),spleen:di.x("0002106"),thymus:di.x("0002370"),ureter_left:di.x("0001223"),ureter_right:di.x("0001222"),urinary_bladder:di.x("0001255"),uterus:di.x("0000995")});function n2(n){const e={};return Object.entries(n).forEach(([t,i])=>{e[i.id]=t}),e}const _1={spatialObjectReference:n2(ki.spatialObjectReference),spatialEntity:n2(ki.spatialEntity),spatialPlacement:n2(ki.spatialPlacement)};function Eq(n,e){const t=dp(n,e,"ExtractionSet",_1.spatialEntity);return t.extractionSites=(0,fr.sortBy)(n.getSubjects(ki.spatialEntity.extraction_set,e,null).map(i=>hp(n,i.id)),["rui_rank"]),t}function hp(n,e){const t=dp(n,e,"SpatialEntity",_1.spatialEntity);return t.object&&(t.object=function(n,e){return dp(n,e,"SpatialObjectReference",_1.spatialObjectReference)}(n,t.object)),t.ccf_annotations&&(t.ccf_annotations=n.getObjects(e,ki.spatialEntity.ccf_annotations,null).map(i=>i.id)),n.forSubjects(i=>t.entityId=i.id,yi.spatialEntity,e,null),t}function XFe(n,e){const t=dp(n,e,"SpatialPlacement",_1.spatialPlacement);return t.source&&(t.source=hp(n,t.source)),t.target&&(t.target=hp(n,t.target)),t}function Sq(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(EV),o=[t.x_scaling,t.y_scaling,t.z_scaling];return n.translate(r).rotateXYZ(s).scale(o)}class xq{constructor(e){this.db=e,this.createGraph()}createGraph(){this.graph=new HNe.DirectedGraph;const e=this.db.store;e.forSubjects(i=>{this.addNode(i.id,"SpatialObjectReference")},wq.type,ki.SpatialObjectReference,null),e.forSubjects(i=>{this.addNode(i.id,"SpatialEntity")},wq.type,ki.SpatialEntity,null);const t={};for(const i of(0,xn.readQuads)(e,null,ki.spatialPlacement.source,null,null))t[i.subject.id]=i.object.id;for(const i of(0,xn.readQuads)(e,null,ki.spatialPlacement.target,null,null)){const r=t[i.subject.id];r&&this.addEdge(i.subject.id,r,i.object.id,"SpatialPlacement")}}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 qn(qn.IDENTITY);if(!this.graph.hasNode(e)||!this.graph.hasNode(t))return;const i=this.db.store,r=new qn(qn.IDENTITY),s=$Ne()(this.graph,e,t);if(s&&s.length>0){s.reverse();let o="";for(const a of s)o&&Sq(r,XFe(i,this.graph.getEdgeAttribute(a,o,"id"))),o=a;return r}}getSpatialPlacement(e,t){const i=this.graph.hasNode(e["@id"])?e["@id"]:void 0,r=(0,fr.get)(e,"placement[0]",(0,fr.get)(e,"placement",void 0));let s;if(r&&this.graph.hasNode(r.target)?(s=this.getTransformationMatrix(r.target,t),s&&(s=Sq(s,r))):i&&(s=this.getTransformationMatrix(i,t)),s){const o=(new Ji).fromRotationMatrix(s,Ji.XYZ),a=s.getTranslation().map(u=>1e3*u),l=o.toVector3().map(vse),c=s.getScale().map(u=>u<1&&u>.999999?1:u);return{"@context":"https://hubmapconsortium.github.io/hubmap-ontology/ccf-context.jsonld","@id":`http://purl.org/ccf/1.5/${HFe()}_placement`,"@type":"SpatialPlacement",source:e["@id"],target:t,placement_date:(new Date).toISOString().split("T")[0],x_scaling:c[0],y_scaling:c[1],z_scaling:c[2],scaling_units:"ratio",x_rotation:l[0],y_rotation:l[1],z_rotation:l[2],rotation_order:"XYZ",rotation_units:"degree",x_translation:a[0],y_translation:a[1],z_translation:a[2],translation_units:"millimeter"}}}}class Cq{constructor(e){this.db=e}getSpatialEntity(e){return hp(this.db.store,e)}getExtractionSets(e){return function(n,e){return(0,fr.sortBy)(n.getSubjects(ki.spatialEntity.extraction_set_for,e,null).map(t=>Eq(n,t.id)),["rui_rank"])}(this.db.store,e)}getExtractionSet(e){return Eq(this.db.store,e)}getAnatomicalStructures(e){return function(n,e){return(0,fr.sortBy)(n.getSubjects(ki.spatialEntity.reference_organ,e,null).map(t=>hp(n,t.id)).filter(t=>t["@id"]!==e),["rui_rank"])}(this.db.store,e)}getReferenceOrgans(){return function(n){const e=[];return n.forEach(t=>{t.subject.id===t.object.id&&e.push(hp(n,t.subject.id))},null,ki.spatialEntity.reference_organ,null,null),(0,fr.sortBy)(e,["rui_rank"])}(this.db.store)}getReferenceBody(e){let t;switch(null==e?void 0:e.sex){case"Male":t=ki.spatial.Male.id;break;case"Female":t=ki.spatial.Female.id;break;case"Both":default:t=ki.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),i=[];let r=[...this.getReferenceOrganSets(e).map(s=>{const o="http://purl.obolibrary.org/obo/UBERON_0002097"===s.representation_of,a=this.getSceneNode(s,t,{color:[255,255,255,255],opacity:o?.5:.2,unpickable:!0,_lighting:"pbr",zoomBasedOpacity:!o});return o&&a?void i.push(a):a})];return i.length>0&&(r=[...i,...r]),(null==e?void 0:e.debug)&&(r=r.concat([this.getSceneNode(this.getSpatialEntity(ki.base("VHRightKidney").id),t,{color:[0,0,255,127.5],geometry:"wireframe"}),this.getSceneNode(this.getSpatialEntity(ki.base("VHLeftKidney").id),t,{color:[255,0,0,127.5],geometry:"wireframe"}),this.getSceneNode(this.getSpatialEntity(ki.base("VHSpleenCC1").id),t,{color:[0,255,0,127.5],geometry:"wireframe"}),this.getSceneNode(this.getSpatialEntity(ki.base("VHSpleenCC2").id),t,{color:[0,255,0,127.5],geometry:"wireframe"}),this.getSceneNode(this.getSpatialEntity(ki.base("VHSpleenCC3").id),t,{color:[0,255,0,127.5],geometry:"wireframe"})])),r.filter(s=>void 0!==s)}getReferenceOrganScene(e,t){var i,r;const s=void 0!==(null==t?void 0:t.sex)&&"both"!==(null===(i=null==t?void 0:t.sex)||void 0===i?void 0:i.toLowerCase()),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"}),u=(null!==(r=this.db.getSpatialEntities(t))&&void 0!==r?r:[]).map(h=>this.getSceneNode(h,a,{color:[255,255,255,229.5]}));return[c].concat(u).filter(h=>void 0!==h)}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 u=this.db.graph.getTransformationMatrix(l&&e.object?e.object["@id"]:e["@id"],t["@id"]);if(u){if(l)u=new qn(qn.IDENTITY).rotateX(EV(90)).multiplyLeft(u);else{let h;switch(e.dimension_units){case"centimeter":h=.01;break;case"millimeter":h=.001;break;case"meter":default:h=1}const p=[e.x_dimension,e.y_dimension,e.z_dimension].map(g=>g*h/2);u.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:u,tooltip:e.label},i)}}getScene(e){return[...this.getReferenceSceneNodes(e),...this.getEntitySceneNodes(e)]}}const y1="https://entity.api.hubmapconsortium.org/entities/",Aq=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"]),ZFe={"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"},Wm={"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","5c106f29-ea2d-11e9-85e8-0efb3ba9a670":"RTI-General Electric","301615f9-c870-11eb-a8dc-35ce3d8786fe":"TMC-UConn"},Tq={"@base":"http://purl.org/ccf/latest/ccf-entity.owl#","@vocab":"http://purl.org/ccf/latest/ccf-entity.owl#",ccf:"http://purl.org/ccf/",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"},cellTypeTerms:{"@id":"has_cell_type_term","@type":"@id"},thumbnail:{"@id":"has_thumbnail"}};class t2e{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||[],u=(this.data.ancestors||[]).find(Be=>"Donor"===Be.entity_type);this.donor=this.getDonor(u,i);const h=this.getRuiLocation(e,this.donor);h?this.rui_location=h:this.bad=!0,Wm[e.group_uuid]||(Wm[e.group_uuid]=e.group_name);const p=new Date(e.last_modified_timestamp).toLocaleDateString(),g=Wm[e.group_uuid]||e.group_name,m=e.created_by_user_displayname;this["@id"]=y1+e.uuid,this.label=`Registered ${p}, ${m}, ${g}`,this.link=`${i}browse/sample/${e.uuid}`;const w={},C=[];this.sections=C;const H=[];this.datasets=H;for(const Be of c.filter(et=>"Sample"===et.entity_type)){const et=this.getSection(Be,e,i);w[Be.submission_id]=et,C.push(et),et.section_number=null!==(s=et.section_number)&&void 0!==s?s:C.length}for(const Be of c)if("Dataset"===Be.entity_type){const et=this.getDataset(Be,t,i,r),wt=(0,fr.get)(Be,["ingest_metadata","metadata","tissue_id"]);w[wt]?null===(o=w[wt].datasets)||void 0===o||o.push(et):H.push(et)}const U=null!=h?h:{},de=`${U.x_dimension} x ${U.y_dimension} x ${U.z_dimension} ${U.dimension_units}`;this.section_count=U.slice_count||C.length;const Ae=parseFloat((U.slice_thickness||(U.z_dimension||0)/Math.max(this.section_count,1)).toFixed(1));this.section_size=Ae;const Pe=U.dimension_units||"millimeter";this.section_units=Pe,this.description=`${de}, ${Ae} ${Pe}, ${e.specimen_type}, ${this.section_count} Sections`,C.forEach((Be,et)=>{Be.description=`${U.x_dimension} x ${U.y_dimension} x ${Ae} ${Pe}, ${Ae} ${Pe}, ${Be.description}`,Be.section_number=et+1})}getSection(e,t,i){const r=new Date(e.last_modified_timestamp).toLocaleDateString();return{"@id":y1+e.uuid,"@type":"Sample",label:`Registered ${r}, ${e.created_by_user_displayname}, ${Wm[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=Wm[e.group_uuid]||e.group_name,l=e.created_by_user_displayname,c=[...e.data_types,(0,fr.get)(e,["ingest_metadata","metadata","assay_type"],"")],u=c.join("|").toLowerCase();let h,p="assets/icons/ico-unknown.svg";return-1!==u.indexOf("10x")?(h="10x",p="assets/icons/ico-bulk-10x.svg"):-1!==u.indexOf("af")?(h="AF",p="assets/icons/ico-spatial-af.svg"):-1!==u.indexOf("codex")?(h="CODEX",p="assets/icons/ico-spatial-codex.svg"):-1!==u.indexOf("imc")?(h="IMC",p="assets/icons/ico-spatial-imc.svg"):-1!==u.indexOf("lc")&&-1===u.indexOf("af")?(h="LC",p="assets/icons/ico-bulk-lc.svg"):h=-1!==u.indexOf("maldi")?"MALDI":-1!==u.indexOf("pas")?"PAS":"OTHER",p=null!==(s=this.getDatasetThumbnail(e,t,r))&&void 0!==s?s:p,{"@id":y1+e.uuid,"@type":"Dataset",label:`Registered ${o}, ${l}, ${a}`,description:`Data/Assay Types: ${c.join(", ")}`,link:`${i}browse/dataset/${e.uuid}`,technology:h,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,fr.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=>Aq.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(Aq.has(s))return`assets/thumbnails/TMC-Vanderbilt/DR1/${s}`}}else if("07a29e4c-ed43-11e8-b56a-0e8017bdda58"===e.group_uuid){const r=ZFe[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,fr.toNumber)(s[1]));for(const p of(0,fr.get)(e,"metadata.organ_donor_data",(0,fr.get)(e,"metadata.living_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,fr.toNumber)(p.data_value):"Body mass index"===p.preferred_term&&(a=(0,fr.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(),u=Wm[e.group_uuid]||e.group_name;return{"@id":y1+e.uuid,"@type":"Donor",label:l,description:`Entered ${c}, ${e.created_by_user_displayname}, ${u}`,link:`${t}browse/donor/${e.uuid}`,age:o,sex:r,bmi:a,consortium_name:"HuBMAP",provider_name:u,provider_uuid:e.group_uuid,samples:[]}}getRuiLocation(e,t){var i;let r,s=e.rui_location;if(s&&("string"==typeof s&&(s=JSON.parse(s)),s.alignment_id?console.log("Detected a deprecated rui_location",e.uuid):s["@id"]&&(r=s)),r){const o=null!==(i=(0,fr.get)(r,["placement","target"]))&&void 0!==i?i:"";o.startsWith("http://purl.org/ccf/latest/ccf.owl#VHSpleenCC")?(0,fr.set)(r,["placement","target"],o.replace("#VHSpleenCC","Male"===t.sex?"#VHMSpleenCC":"#VHFSpleenCC")):("http://purl.org/ccf/latest/ccf.owl#VHLeftKidney"===o||"http://purl.org/ccf/latest/ccf.owl#VHRightKidney"===o)&&(0,fr.set)(r,["placement","target"],"Male"===t.sex?o.replace("#VH","#VHM")+"_Patch":o.replace("#VH","#VHF")+"_Patch")}return r}getTissueBlock(){return(0,fr.omit)(Object.assign({},this),["data","bad","donor"])}toJsonLd(){return Object.assign(Object.assign({},this.donor),{samples:[this.getTissueBlock()]})}}const i2e=["uuid","entity_type","group_uuid","group_name","last_modified_timestamp","created_by_user_displayname","ancestors.entity_type","ancestors.description","ancestors.metadata.organ_donor_data.preferred_term","ancestors.metadata.organ_donor_data.data_value","ancestors.metadata.living_donor_data.preferred_term","ancestors.metadata.living_donor_data.data_value","ancestors.last_modified_timestamp","ancestors.group_uuid","ancestors.group_name","ancestors.created_by_user_displayname","ancestors.uuid","descendants.entity_type","descendants.ingest_metadata.metadata.tissue_id","descendants.last_modified_timestamp","descendants.group_uuid","descendants.group_name","descendants.created_by_user_displayname","descendants.uuid","descendants.data_types","descendants.ingest_metadata.metadata.assay_type","descendants.thumbnail_file","descendants.metadata.files.rel_path","rui_location","specimen_type"],r2e={exists:{field:"rui_location"}};function Mq(n,e,t){return JSON.stringify({version:!0,from:n,size:e,stored_fields:["*"],script_fields:{},docvalue_fields:[],query:null!=t?t:r2e,_source:{includes:i2e}})}function r2(n,e){return Fi(this,void 0,void 0,function*(){try{const t=yield fetch(n,e);return t.ok?yield t.json():void 0}catch(t){return}})}function Dq(n,e,t,i,r="",s=""){return Fi(this,void 0,void 0,function*(){let o;if("static"===e?o=yield r2(n):"search-api"===e&&(o=yield function(n,e,t){return Fi(this,void 0,void 0,function*(){const i=250,r=function(n){const e=new Headers;return e.append("Content-type","application/json"),n&&e.append("Authorization",`Bearer ${n}`),e}(e),s=Mq(0,i,t),o=yield r2(n,{method:"POST",headers:r,body:s});if(!o)return;const a=o.hits.total.value;if(a<=i)return o;const l=[];for(let h=i;h!h))return;const u=c.map(h=>h.hits.hits);return Object.assign(Object.assign({},o),{hits:Object.assign(Object.assign({},o.hits),{hits:o.hits.hits.concat(...u)})})})}(n,i,t)),o)return function(n,e="",t="",i,r=!1){const o={},a=(0,fr.get)(n,"hits.hits",[]).map(c=>(0,fr.get)(c,"_source",{})).sort((c,u)=>c.uuid.localeCompare(u.uuid)).map(c=>new t2e(c,e,t,i).toJsonLd());for(const c of a){const u=c["@id"];o[u]?o[u].samples.push(c.samples[0]):o[u]=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":Tq},c)))),{"@context":Tq,"@graph":l}}(o,r,s,i);console.warn(`Unable to load ${n} as HuBMAP Data`)})}function iv(n,e,t){const i=new Set;for(const r of e)for(const s of(0,xn.readQuads)(n,r,t,null,null))i.add(s.object.id);return i}const u2e={[ki.spatialEntity.x_dimension.id]:"x",[ki.spatialEntity.y_dimension.id]:"y",[ki.spatialEntity.z_dimension.id]:"z"};function h2e(n,e,t,i){const r=e.getTransformationMatrix(t,i);let s;if(r){const o=r.getTranslation(),a=function(n,e){const t=dp(n,e,"Dimensions",u2e);return[t.x,t.y,t.z]}(n,t).map(c=>c/1e3/2),l=(new Ji).fromRotationMatrix(r,Ji.XYZ).toQuaternion().normalize().calculateW();s=(new GF).fromCenterHalfSizeQuaternion(o,a,l)}return s}function f2e(n,e,t,i){const{x:r,y:s,z:o,radius:a,target:l}=i,c=new Set,u=a/1e3*(a/1e3);for(const h of t){const p=h2e(n,e,h,l);p&&p.distanceSquaredTo([r,s,o].map(m=>m/1e3))<=u&&c.add(h)}return c}function b1(n,e,t){var i,r;const s=new Map,o=new Set;for(const c of e)for(const u of(0,xn.readQuads)(n,c,yi.donor,null,null))o.add(u.object.id),s.has(u.object.id)?null===(i=s.get(u.object.id))||void 0===i||i.push(c):s.set(u.object.id,[c]);const a=t(o),l=new Set;for(const c of a)for(const u of null!==(r=s.get(c))&&void 0!==r?r:[])l.add(u);return l}function s2(n,e,t){var i,r;const s=new Map,o=new Set;for(const c of e)for(const u of(0,xn.readQuads)(n,c,yi.spatialEntity,null,null))o.add(u.object.id),s.has(u.object.id)?null===(i=s.get(u.object.id))||void 0===i||i.push(c):s.set(u.object.id,[c]);const a=t(o),l=new Set;for(const c of a)for(const u of null!==(r=s.get(c))&&void 0!==r?r:[])l.add(u);return l}function rv(n,e){return function(t){n.has(t.id)&&e.add(t.id)}}function Iq(n,e,t){const i=new Set;for(const r of t){const s=xn.DataFactory.namedNode(r);n.forSubjects(rv(e,i),ki.spatialEntity.ccf_annotations,s,null)}return i}function Oq(n,e){const t=function(n,e){const t=new Map;for(const i of n)for(const r of(0,xn.readQuads)(e,i,yi.spatialEntity,null,null))t.has(r.object.id)?t.get(r.object.id).add(i):t.set(r.object.id,new Set([i]));return t}(n,e),i=new Map;for(const r of t.keys()){const s=t.get(r);for(const o of(0,xn.readQuads)(e,r,ki.spatialEntity.ccf_annotations,null,null))if(i.has(o.object.id)){const a=i.get(o.object.id);s.forEach(l=>a.add(l))}else i.set(o.object.id,new Set(s))}return i}function M2e(n,e,t){const i={"@id":e,"@type":"OntologyTreeNode",id:e,parent:"",children:[],synonymLabels:[],label:""},r={[ki.ontologyNode.label.id]:"label",[t]:"parent",[ki.ontologyNode.synonymLabels.id]:"synonymLabels"};for(const[s,o]of t2(n,e,r))"synonymLabels"===s?i.synonymLabels.push(o):i[s]=o;return i.children=n.getSubjects(t,e,null).map(s=>s.id),i}function Rq(n,e,t,i){const r={root:e,nodes:{}},s=new Set;for(const a of(0,xn.readQuads)(n,null,i,null,null))s.add(a.subject.id),s.add(a.object.id);for(const a of s)r.nodes[a]=M2e(n,a,i);r.nodes[e]||(r.nodes[e]={"@id":e,"@type":"OntologyTreeNode",id:e,label:t,children:[],synonymLabels:[]});const o=n.getSubjects(i,e,null).map(a=>a.id).sort((a,l)=>r.nodes[a].label.localeCompare(r.nodes[l].label));return r.nodes[e].children=o,Nq(r),r}function Nq(n,e,t=new Set){const i=n.nodes[null!=e?e:n.root];if(i){i.children=i.children.filter(r=>!t.has(r)),i.children.forEach(r=>t.add(r));for(const r of i.children)Nq(n,r,t),n.nodes[r]&&(n.nodes[r].parent=i["@id"])}}const Pq=(0,fr.memoize)(function(n){const e=Rq(n,bd.body.id,"body",ki.asctb.part_of.id);return e.nodes[bd.body.id].children=["http://purl.obolibrary.org/obo/UBERON_0000955","http://purl.obolibrary.org/obo/UBERON_0000029","http://purl.obolibrary.org/obo/UBERON_0000970","http://purl.obolibrary.org/obo/UBERON_0003889","http://purl.obolibrary.org/obo/UBERON_0000948","http://purl.obolibrary.org/obo/UBERON_0002113","http://purl.obolibrary.org/obo/UBERON_0001465","http://purl.obolibrary.org/obo/UBERON_0002107","http://purl.obolibrary.org/obo/UBERON_0002048","http://purl.obolibrary.org/obo/UBERON_0001911","http://purl.obolibrary.org/obo/UBERON_0000992","http://purl.obolibrary.org/obo/UBERON_0001264","http://purl.obolibrary.org/obo/UBERON_0001270","http://purl.obolibrary.org/obo/UBERON_0001987","http://purl.obolibrary.org/obo/UBERON_0002367","http://purl.obolibrary.org/obo/UBERON_0002097","http://purl.obolibrary.org/obo/UBERON_0002108","http://purl.obolibrary.org/obo/UBERON_0002240","http://purl.obolibrary.org/obo/UBERON_0000059","http://purl.obolibrary.org/obo/UBERON_0002106","http://purl.obolibrary.org/obo/UBERON_0002370","http://purl.obolibrary.org/obo/UBERON_0000056","http://purl.obolibrary.org/obo/UBERON_0001255","http://purl.obolibrary.org/obo/UBERON_0000995","http://purl.obolibrary.org/obo/UBERON_0004537"].filter(t=>t in e.nodes),e},()=>""),v1={[yi.label.id]:"label",[yi.description.id]:"description",[yi.link.id]:"link"},O2e=Object.assign(Object.assign({},v1),{[yi.providerName.id]:"providerName"}),R2e=Object.assign(Object.assign({},v1),{[yi.technology.id]:"technology",[yi.thumbnail.id]:"thumbnail"}),N2e=Object.assign(Object.assign({},v1),{[yi.sampleType.id]:"sampleType",[yi.sectionNumber.id]:"sectionNumber",[yi.datasets.id]:"datasets"}),P2e=Object.assign(Object.assign({},v1),{[yi.sampleType.id]:"sampleType",[yi.sectionCount.id]:"sectionCount",[yi.sectionSize.id]:"sectionSize",[yi.sectionUnits.id]:"sectionUnits",[yi.donor.id]:"donor",[yi.spatialEntity.id]:"spatialEntityId",[yi.sections.id]:"sections",[yi.datasets.id]:"datasets"});function F2e(n,e){return dp(n,e,"Donor",O2e)}function Fq(n,e){return dp(n,e,"Dataset",R2e)}function k2e(n,e){const t={"@id":e,"@type":"Sample",datasets:[]};for(const[i,r]of t2(n,e,N2e))if("datasets"===i){const s=Fq(n,r);t[i].push(s)}else t[i]=r;return t}class B2e{constructor(e){this.database=e,this.connect()}toJson(){return{status:this.status,message:this.message,checkback:"Ready"===this.status||"Error"===this.status?36e5:2e3,loadTime:this.loadTime}}connect(){this.status="Loading",this.message="Loading database";const e=Date.now();return this.database.connect().then(t=>Fi(this,void 0,void 0,function*(){t?(this.message="Building scene",yield this.database.getScene(),this.message="Building tissue block results",yield this.database.getTissueBlockResults(),this.message="Aggregating results",yield this.database.getAggregateResults(),this.status="Ready",this.message="Database successfully loaded"):(this.status="Error",this.message="Unknown error while loading database")})).catch(t=>{var i;this.status="Error",this.message=null!==(i=null==t?void 0:t.message)&&void 0!==i?i:"Unknown error while loading database"}).finally(()=>{this.loadTime=Date.now()-e})}}const j2e={"@context":{"@base":"http://purl.org/ccf/","@vocab":"http://purl.org/ccf/",ccf:"http://purl.org/ccf/",rdfs:"http://www.w3.org/2000/01/rdf-schema#",dcterms:"http://purl.org/dc/terms/",label:"rdfs:label",description:"rdfs:comment",link:"ccf:url",sex:"ccf:sex",age:"ccf:age",bmi:"ccf:bmi",consortium_name:"ccf:consortium_name",provider_name:"ccf:tissue_provider_name",provider_uuid:"ccf:tissue_provider_uuid",donor:{"@id":"ccf:comes_from","@type":"@id"},samples:{"@reverse":"donor"},sections:{"@id":"ccf:subdivided_into_sections","@type":"@id"},datasets:{"@id":"ccf:generates_dataset","@type":"@id"},sample_type:"ccf:sample_type",section_count:"ccf:section_count",section_size:"ccf:section_size",section_units:"ccf:section_size_unit",section_number:"ccf:section_number",rui_location:{"@id":"ccf:has_registration_location","@type":"@id"},ccf_annotations:{"@id":"ccf:collides_with","@type":"@id","@container":"@set"},representation_of:{"@id":"ccf:representation_of","@type":"@id"},reference_organ:{"@id":"ccf:has_reference_organ","@type":"@id"},extraction_set_for:{"@id":"ccf:extraction_set_for","@type":"@id"},extraction_set:{"@id":"ccf:has_extraction_set","@type":"@id"},organ_owner_sex:"ccf:organ_owner_sex",side:"ccf:organ_side",rui_rank:"ccf:rui_rank",slice_thickness:"ccf:slice_thickness",slice_count:"ccf:slice_count",object:{"@id":"ccf:has_object_reference","@type":"@id"},creation_date:"dcterms:created",updated_date:"ccf:updated_date",creator:"dcterms:creator",creator_first_name:"ccf:creator_first_name",creator_last_name:"ccf:creator_last_name",placement:{"@reverse":"ccf:placement_for"},placement_date:"dcterms:created",rotation_order:"ccf:rotation_order",dimension_units:"ccf:dimension_unit",rotation_units:"ccf:rotation_unit",scaling_units:"ccf:scaling_unit",translation_units:"ccf:translation_unit",source:{"@id":"ccf:placement_for","@type":"@id"},target:{"@id":"ccf:placement_relative_to","@type":"@id"},x_rotation:"ccf:x_rotation",y_rotation:"ccf:y_rotation",z_rotation:"ccf:z_rotation",x_scaling:"ccf:x_scaling",y_scaling:"ccf:y_scaling",z_scaling:"ccf:z_scaling",x_translation:"ccf:x_translation",y_translation:"ccf:y_translation",z_translation:"ccf:z_translation",x_dimension:"ccf:x_dimension",y_dimension:"ccf:y_dimension",z_dimension:"ccf:z_dimension",ontology_terms:{"@id":"ccf:has_ontology_term","@type":"@id"},technology:"ccf:technology",thumbnail:"ccf:thumbnail",file:"ccf:file_url",file_format:"ccf:file_format",file_subpath:"ccf:file_subpath"}};function o2(n){return JSON.parse(n,(e,t)=>"ccf_annotations"===e&&Array.isArray(t)?t.map(i=>(null==i?void 0:i.startsWith("http://purl.obolibrary.org/obo/FMA_"))?i.replace("http://purl.obolibrary.org/obo/FMA_","http://purl.org/sig/ont/fma/fma"):i):"@context"!==e||!t||"https://hubmapconsortium.github.io/hubmap-ontology/ccf-entity-context.jsonld"!==t&&"https://hubmapconsortium.github.io/hubmap-ontology/ccf-context.jsonld"!==t&&"https://hubmapconsortium.github.io/ccf-ontology/ccf-context.jsonld"!==t&&"http://purl.org/ccf/latest/ccf-entity.owl#"!==t["@base"]?t:j2e)}const U2e={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 z2e{constructor(e=U2e){this.options=e,this.store=new xn.Store(void 0,{factory:xn.DataFactory}),this.graph=new xq(this),this.scene=new Cq(this)}connect(e,t=!1){return Fi(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 Fi(this,void 0,void 0,function*(){const e=(new Date).getTime(),t="ccf-database.last_modified",i="ccf-database",r=yield vq(t).catch(()=>{});let s;r&&e-new Date(+r).getTime()>36e5?yield function(n,e=Sc()){return e("readwrite",t=>(n.forEach(i=>t.delete(i)),mu(t.transaction)))}([i,t]).catch(()=>{}):s=yield vq(i).catch(()=>{}),s?yield this.deserialize(s):(yield this.doConnect(),function(n,e=Sc()){return e("readwrite",t=>(n.forEach(i=>t.put(i[1],i[0])),mu(t.transaction)))}([[i,this.serialize()],[t,""+e]]).catch(()=>{}))})}doConnect(){var e,t;return Fi(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.startsWith("{"))this.store=(0,xn.deserializeN3Store)(s,xn.DataFactory);else 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,xn.deserializeN3Store)(o,xn.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(Dq(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 Fi(this,void 0,void 0,function*(){const i=null!=t?t:this.store;return yield Promise.all(e.map(r=>Fi(this,void 0,void 0,function*(){"string"==typeof r?(r.startsWith("http")||r.startsWith("assets/"))&&r.includes("jsonld")?(r=o2(r=yield fetch(r).then(s=>s.text())),yield(0,xn.addJsonLdToStore)(r,i)):r.endsWith("n3")?yield(0,xn.addN3ToStore)(r,i):r.endsWith("rdf")||r.endsWith("owl")||r.endsWith("xml")?yield(0,xn.addRdfXmlToStore)(r,i):(r=o2(r),yield(0,xn.addJsonLdToStore)(r,i)):(r=o2(JSON.stringify(r)),yield(0,xn.addJsonLdToStore)(r,i))}))),this})}synchronize(){return Fi(this,void 0,void 0,function*(){return yield new Promise(e=>{setTimeout(e,500)}),this.graph.createGraph(),function(n){var e,t,i;const r=Pq(n),s=new Map;for(const{subject:o,object:a}of(0,xn.readQuads)(n,null,ki.spatialEntity.representation_of,null,null)){const l=new Set([a.id]);let c=null===(e=r.nodes[a.id])||void 0===e?void 0:e.parent;for(;c&&!l.has(c);)l.add(c),c=null===(t=r.nodes[c])||void 0===t?void 0:t.parent;s.set(o.id,[...l].map(u=>xn.DataFactory.namedNode(u)))}for(const{object:o}of(0,xn.readQuads)(n,null,yi.spatialEntity,null,null))for(const{subject:a}of(0,xn.readQuads)(n,null,ki.spatialPlacement.source,o,null))for(const{object:l}of(0,xn.readQuads)(n,a,ki.spatialPlacement.target,null,null))for(const c of null!==(i=s.get(l.id))&&void 0!==i?i:[])n.addQuad(xn.DataFactory.namedNode(o.id),ki.spatialEntity.ccf_annotations,c)}(this.store),this})}serialize(){return(0,xn.serializeN3Store)(this.store)}deserialize(e){return Fi(this,void 0,void 0,function*(){this.store=(0,xn.deserializeN3Store)(e,xn.DataFactory),this.graph=new xq(this),this.scene=new Cq(this),yield new Promise(t=>{setTimeout(t,10)})})}getIds(e={}){return function(n,e,t){var i,r,s,o,a,l,c;let u=function(n){const e=new Set;return n.forSubjects(t=>e.add(t.id),yi.spatialEntity,null,null),e}(n);if(u.size>0&&(u=function(n,e,t=!0){const i=new Set;if(n.forSubjects(rv(e,i),yi.spatialEntity,null,null),!t){const r=new Set;return e.forEach(s=>i.has(s)?void 0:r.add(s)),r}return i}(n,u)),u.size>0&&("Male"===t.sex||"Female"===t.sex)){const h=t.sex;u=b1(n,u,p=>function(n,e,t){const i=new Set;return n.forSubjects(rv(e,i),yi.sex,yi[t],null),i}(n,p,h))}if(u.size>0&&(null===(i=t.tmc)||void 0===i?void 0:i.length)>0&&(u=b1(n,u,h=>function(n,e,t){const i=new Set;for(const r of t){const s=xn.DataFactory.literal(r);n.forSubjects(rv(e,i),yi.providerName,s,null)}return i}(n,h,t.tmc))),u.size>0&&(null===(r=t.technologies)||void 0===r?void 0:r.length)>0&&(u=function(n,e,t){var i,r;const s=new Map,o=new Set,a=new Set(e);for(const u of e)for(const h of(0,xn.readQuads)(n,u,yi.sections,null,null))a.add(h.object.id);for(const u of a)for(const h of(0,xn.readQuads)(n,u,yi.datasets,null,null))o.add(h.object.id),s.has(h.object.id)?null===(i=s.get(h.object.id))||void 0===i||i.push(u):s.set(h.object.id,[u]);const l=t(o),c=new Set;for(const u of l)for(const h of null!==(r=s.get(u))&&void 0!==r?r:[])c.add(h);return c}(n,u,h=>function(n,e,t){const i=new Set;for(const r of t){const s=xn.DataFactory.literal(r);n.forSubjects(rv(e,i),yi.technology,s,null)}return i}(n,h,t.technologies))),u.size>0&&(null===(s=t.spatialSearches)||void 0===s?void 0:s.length)>0&&(u=s2(n,u,h=>function(n,e,t,i){const r=new Set;for(const s of i)f2e(n,e,t,s).forEach(a=>r.add(a));return r}(n,e,h,t.spatialSearches))),u.size>0&&(null===(o=t.ontologyTerms)||void 0===o?void 0:o.length)>0){const h=t.ontologyTerms;-1===h.indexOf(bd.body.id)&&(u=s2(n,u,p=>Iq(n,p,h)))}if(u.size>0&&(null===(a=t.cellTypeTerms)||void 0===a?void 0:a.length)>0){const h=t.cellTypeTerms;-1===h.indexOf(bd.cell.id)&&(u=s2(n,u,p=>function(n,e,t){const i=new Set;for(const r of t)n.forObjects(s=>{i.add(s.id)},r,ki.asctb.located_in,null),r===bd.cell.id&&i.add(bd.body.id);return Iq(n,e,[...i])}(n,p,h)))}if(u.size>0&&2===(null===(l=t.ageRange)||void 0===l?void 0:l.length)&&(0,fr.isFinite)(t.ageRange[0])&&(0,fr.isFinite)(t.ageRange[1])){const h=Math.max(...t.ageRange),p=Math.min(...t.ageRange);1===p&&110===h||(u=b1(n,u,g=>function(n,e,t,i){const r=new Set;for(const s of e)for(const o of(0,xn.readQuads)(n,s,yi.age,null,null)){const a=(0,Kb.fromRdf)(o.object);a>=t&&a<=i&&r.add(s)}return r}(n,g,p,h)))}if(u.size>0&&2===(null===(c=t.bmiRange)||void 0===c?void 0:c.length)&&(0,fr.isFinite)(t.bmiRange[0])&&(0,fr.isFinite)(t.bmiRange[1])){const h=Math.max(...t.bmiRange),p=Math.min(...t.bmiRange);13===p&&83===h||(u=b1(n,u,g=>function(n,e,t,i){const r=new Set;for(const s of e)for(const o of(0,xn.readQuads)(n,s,yi.bmi,null,null)){const a=(0,Kb.fromRdf)(o.object);a>=t&&a<=i&&r.add(s)}return r}(n,g,p,h)))}return u}(this.store,this.graph,e)}get(e){return this.store.getQuads(xn.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=>function(n,e){const t=n.getObjects(xn.DataFactory.namedNode(e),yi.spatialEntity,null);if(t.length>0)return hp(n,t[0].id)}(this.store,t))}getDatabaseStatus(){return Fi(this,void 0,void 0,function*(){return this.status||(this.status=new B2e(this)),this.status.toJson()})}getDatasetTechnologyNames(){return Fi(this,void 0,void 0,function*(){return function(n){const e=new Set;for(const t of(0,xn.readQuads)(n,null,yi.technology,null,null))e.add(t.object.value);return Array.from(e).sort()}(this.store)})}getProviderNames(){return Fi(this,void 0,void 0,function*(){return function(n){const e=new Set;for(const t of(0,xn.readQuads)(n,null,yi.providerName,null,null))e.add(t.object.value);return Array.from(e).sort()}(this.store)})}getTissueBlockResults(e){return Fi(this,void 0,void 0,function*(){return e=Object.assign(Object.assign({},e),{hasSpatialEntity:!0}),[...this.getIds(e)].map(t=>function(n,e){const t={"@id":e,"@type":"Sample",sections:[],datasets:[]};for(const[i,r]of t2(n,e,P2e))if("sections"===i){const s=k2e(n,r);t[i].push(s)}else if("datasets"===i){const s=Fq(n,r);t[i].push(s)}else t[i]="donor"===i?F2e(n,r):r;return t}(this.store,t))})}getAggregateResults(e){return Fi(this,void 0,void 0,function*(){return function(n,e){const t=iv(e,n,yi.donor.id),i=iv(e,t,yi.providerUUID.id),r=new Set;for(const l of n)for(const c of(0,xn.readQuads)(e,l,yi.spatialEntity,null,null))r.add(c.subject.id);const s=iv(e,r,yi.sections.id),o=new Set([...iv(e,r,yi.datasets.id),...iv(e,s,yi.datasets.id)]);return 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 Fi(this,void 0,void 0,function*(){return function(n,e){const t={};return Oq(n,e).forEach((r,s)=>{t[s]=r.size}),t}(this.getIds(e),this.store)})}getCellTypeTermOccurences(e){return Fi(this,void 0,void 0,function*(){return function(n,e){var t,i;const r=Oq(n,e),s=new Map;for(const a of r.keys()){const l=r.get(a);for(const c of(0,xn.readQuads)(e,null,ki.asctb.located_in,a,null)){const u=c.subject.id;if(s.has(u)){const h=s.get(u);l.forEach(p=>h.add(p))}else s.set(u,new Set(l))}}const o={};return s.forEach((a,l)=>{o[l]=a.size}),o[bd.cell.id]=null!==(i=null===(t=r.get(bd.body.id))||void 0===t?void 0:t.size)&&void 0!==i?i:0,o}(this.getIds(e),this.store)})}getOntologyTreeModel(){return Fi(this,void 0,void 0,function*(){return Pq(this.store)})}getCellTypeTreeModel(){return Fi(this,void 0,void 0,function*(){return function(n){return Rq(n,bd.cell.id,"cell",ki.asctb.ct_is_a.id)}(this.store)})}getReferenceOrgans(){return Fi(this,void 0,void 0,function*(){return this.scene.getReferenceOrgans()})}getScene(e){return Fi(this,void 0,void 0,function*(){return this.graph.createGraph(),this.scene.getScene(e)})}getReferenceOrganScene(e,t){return Fi(this,void 0,void 0,function*(){return this.graph.createGraph(),this.scene.getReferenceOrganScene(e,t)})}getSpatialPlacement(e,t){return Fi(this,void 0,void 0,function*(){return this.graph.getSpatialPlacement(e,t)})}}function W2e(n,e){return n===e}let q2e=(()=>{class n{constructor(t,i){this.locator=t,this.globalConfig=i,this.subscriptions=new x,this.dataSource=i.getOption("data").pipe(me(r=>Object.assign(Object.assign({},bq),{dataSources:r})),Qi(r=>Object.keys(r).length>0),me(r=>r),rd(W2e),Ir(r=>function(n,e){return new I(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?je(r):Yc).subscribe(t);return()=>{o.unsubscribe(),i&&i.unsubscribe()}})}(()=>this.createDataSource(),s=>this.connectDataSource(s.source,r))),$a(1)),this.subscriptions.add(this.dataSource.subscribe())}ngOnDestroy(){this.subscriptions.unsubscribe()}getTissueBlockResults(t){return this.dataSource.pipe(Ir(i=>i.getTissueBlockResults(t)),Wi(1))}getAggregateResults(t){return this.dataSource.pipe(Ir(i=>i.getAggregateResults(t)),Wi(1))}getOntologyTermOccurences(t){return this.dataSource.pipe(Ir(i=>i.getOntologyTermOccurences(t)),Wi(1))}getCellTypeTermOccurences(t){return this.dataSource.pipe(Ir(i=>i.getCellTypeTermOccurences(t)),Wi(1))}getOntologyTreeModel(){return this.dataSource.pipe(Ir(t=>t.getOntologyTreeModel()),Wi(1))}getCellTypeTreeModel(){return this.dataSource.pipe(Ir(t=>t.getCellTypeTreeModel()),Wi(1))}getReferenceOrgans(){return this.dataSource.pipe(Ir(t=>t.getReferenceOrgans()),Wi(1))}getScene(t){return this.dataSource.pipe(Ir(i=>i.getScene(t)),Wi(1))}getOrganScene(t,i){return this.dataSource.pipe(Ir(r=>r.getReferenceOrganScene(t,i)),Wi(1))}createDataSource(){return{source:new z2e,unsubscribe:()=>{}}}connectDataSource(t,i){return Fi(this,void 0,void 0,function*(){const r=(new Date).getTime();return yield t.connect(i,!1),m0.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)(Oe(Cf),Oe(Yb))},n.\u0275prov=We({token:n,factory:n.\u0275fac,providedIn:"root"}),n})(),Y2e=(()=>{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$=Yo([this.data$,this.referenceOrgans$,this.source.dataSource]).pipe(Ir(([r,s,o])=>this.chooseScene(r,s))),this.organs$=this.configState.getOption("data").pipe(me(r=>this.selectOrgans(r)),$a(1)),this.filteredOrgans$=Yo([this.organs$,this.referenceOrgans$]).pipe(me(([r,s])=>this.getNeededReferenceOrgans(s,r)),$a(1)),this.filteredScene$=Yo([this.scene$,this.organs$,this.referenceOrgans$]).pipe(me(([r,s,o])=>this.filterSceneNodes(r,s,o)),function(n,e){const t=n.pipe(ao(""));return i=>Yo([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$,BNe),function(n){const e=n.pipe(ao(""));return t=>Yo([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$),$a(1))}chooseScene(t,i){var r;const s=null!==(r=null==t?void 0:t.map(a=>{const l=a[K9];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 fn([])}selectOrgans(t){const r=(null!=t?t:[]).map(s=>s[K9].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)(Oe(Yb),Oe(q2e))},n.\u0275prov=We({token:n,factory:n.\u0275fac,providedIn:"root"}),n})();const K2e=["bodyUI"];let X2e=(()=>{class n{constructor(t,i,r){this.configState=t,this.sceneSource=i,this.cdr=r,this.onMouseEnter=new sn,this.onMouseLeave=new sn,this.onClick=new sn,this.data$=this.configState.getOption("data"),this.organs$=this.sceneSource.filteredOrgans$,this.scene$=this.sceneSource.filteredScene$.pipe(Yr(s=>this.reset()))}reset(){var t,i;return Fi(this,void 0,void 0,function*(){const{bodyUI:r}=this;yield new Promise(a=>setTimeout(a,200));const s=yield this.organs$.pipe(Wi(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)(xe(Yb),xe(Y2e),xe(Dr))},n.\u0275cmp=ln({type:n,selectors:[["ccf-root"]],viewQuery:function(t,i){if(1&t&&ss(K2e,7),2&t){let r;ii(r=ri())&&(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&&(Pt(0,"ccf-body-ui",0,1),Un("nodeClick",function(s){return i.onClick.emit(s)})("nodeHoverStart",function(s){return i.onMouseEnter.emit(s)})("nodeHoverStop",function(s){return i.onMouseLeave.emit(s)}),xl(2,"async"),Ft()),2&t&&rn("scene",Vu(2,2,i.scene$))("interactive",!0)},directives:[nNe],pipes:[h0],styles:[".body-ui[_ngcontent-%COMP%]{height:100%;width:100%}"],changeDetection:0}),n})();function Q2e(n,e){if(1&n){const t=jt();Pt(0,"ccf-root",1),Un("onMouseEnter",function(r){return Cr(t),ci().onMouseEnter.emit(r)})("onMouseLeave",function(r){return Cr(t),ci().onMouseLeave.emit(r)})("onClick",function(r){return Cr(t),ci().onClick.emit(r)}),Ft()}}function Z2e(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 J2e=(()=>{class n extends Eie{constructor(t,i){super(t,i,{initialDelay:10,initialConfig:Object.assign(Object.assign({},m0.dbOptions),globalThis.dbOptions),parse:{data:Z2e}}),this.onMouseEnter=new sn,this.onMouseLeave=new sn,this.onClick=new sn}}return n.\u0275fac=function(t){return new(t||n)(xe(Yb),xe(Dr))},n.\u0275cmp=ln({type:n,selectors:[["ccf-root-wc"]],inputs:{data:"data",highlightID:"highlightID",zoomToID:"zoomToID"},outputs:{onMouseEnter:"onMouseEnter",onMouseLeave:"onMouseLeave",onClick:"onClick"},features:[An],decls:1,vars:1,consts:[[3,"onMouseEnter","onMouseLeave","onClick",4,"ngIf"],[3,"onMouseEnter","onMouseLeave","onClick"]],template:function(t,i){1&t&&Di(0,Q2e,1,0,"ccf-root",0),2&t&&rn("ngIf",i.initialized)},directives:[lc,X2e],encapsulation:2,changeDetection:0}),n})(),eke=(()=>{class n{constructor(t,i){this.accessor=t,this.injector=i}static forRoot(t=[]){return{ngModule:n,providers:[ps,Za,hW,...t]}}}return n.\u0275fac=function(t){return new(t||n)(Oe(ps,2),Oe(Za,2))},n.\u0275mod=on({type:n}),n.\u0275inj=xt({}),n})();const x1=(n,e)=>((n,e)=>new Array(e+1).join("0"))(0,e-n.toString().length)+n;class ike{constructor(e,t,i){this.action=e,this.store=t,this.logWriter=i}dispatched(e){const t=$f(this.action),i=function(n){return x1(n.getHours(),2)+":"+x1(n.getMinutes(),2)+":"+x1(n.getSeconds(),2)+"."+x1(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 rke{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 kq=new Ht("NGXS_LOGGER_PLUGIN_OPTIONS");let ske=(()=>{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 rke(this._options),this._store=this._store||this._injector.get(cu);const s=new ike(i,this._store,this._logWriter);return s.dispatched(t),r(t,i).pipe(Yr(o=>{s.completed(o)}),bc(o=>{throw s.errored(o),o}))}}return n.\u0275fac=function(t){return new(t||n)(Oe(kq),Oe(Wn))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const Lq=new Ht("LOGGER_USER_OPTIONS");function oke(n){return Object.assign({},{logger:console,collapsed:!1,disabled:!1,filter:()=>!0},n)}let ake=(()=>{class n{static forRoot(t){return{ngModule:n,providers:[{provide:f6,useClass:ske,multi:!0},{provide:Lq,useValue:t},{provide:kq,useFactory:oke,deps:[Lq]}]}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=on({type:n}),n.\u0275inj=xt({}),n})();const lke=[Yb];let cke=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=on({type:n}),n.\u0275inj=xt({imports:[[eke.forRoot(),Wo.forRoot(lke,{developmentMode:!m0.production}),ake.forRoot({disabled:m0.production})]]}),n})(),uke=(()=>{class n{constructor(t){this.injector=t}ngDoBootstrap(){const t=function(n,e){const t=function(n,e){return e.get(wl).resolveComponentFactory(n).inputs}(n,e.injector),i=e.strategyFactory||new mie(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 yie{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,u){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}(J2e,{injector:this.injector});customElements.define("ccf-body-ui-wc",t)}}return n.\u0275fac=function(t){return new(t||n)(Oe(Wn))},n.\u0275mod=on({type:n}),n.\u0275inj=xt({providers:[],imports:[[WD,cke,iNe]]}),n})();m0.production&&function(){if(lB)throw new Error("Cannot enable prod mode after platform setup.");aB=!1}(),jne().bootstrapModule(uke).catch(n=>console.error(n))},52:Ut=>{function it(yt,ee,Tt,dt,Y,Se,he){try{var W=yt[Se](he),j=W.value}catch(P){return void Tt(P)}W.done?ee(j):Promise.resolve(j).then(dt,Y)}Ut.exports=function(yt){return function(){var ee=this,Tt=arguments;return new Promise(function(dt,Y){var Se=yt.apply(ee,Tt);function he(j){it(Se,dt,Y,he,W,"next",j)}function W(j){it(Se,dt,Y,he,W,"throw",j)}he(void 0)})}},Ut.exports.default=Ut.exports,Ut.exports.__esModule=!0},948:Ut=>{Ut.exports=function(Je){return Je&&Je.__esModule?Je:{default:Je}},Ut.exports.default=Ut.exports,Ut.exports.__esModule=!0},321:Ut=>{function it(Je){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(Ut.exports=it=function(ee){return typeof ee},Ut.exports.default=Ut.exports,Ut.exports.__esModule=!0):(Ut.exports=it=function(ee){return ee&&"function"==typeof Symbol&&ee.constructor===Symbol&&ee!==Symbol.prototype?"symbol":typeof ee},Ut.exports.default=Ut.exports,Ut.exports.__esModule=!0),it(Je)}Ut.exports=it,Ut.exports.default=Ut.exports,Ut.exports.__esModule=!0},380:Ut=>{function it(Je){return Promise.resolve().then(()=>{var yt=new Error("Cannot find module '"+Je+"'");throw yt.code="MODULE_NOT_FOUND",yt})}it.keys=()=>[],it.resolve=it,it.id=380,Ut.exports=it},521:()=>{},125:()=>{},307:()=>{}},Ut=>{Ut(Ut.s=303)}]); \ No newline at end of file diff --git a/body-ui/wc.js b/body-ui/wc.js index 2baa8887e..b6f7758fb 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 dke=Object.defineProperty,hke=Object.defineProperties,fke=Object.getOwnPropertyDescriptors,C1=Object.getOwnPropertySymbols,jq=Object.prototype.hasOwnProperty,Vq=Object.prototype.propertyIsEnumerable,Er=Math.pow,Uq=(Ut,it,Je)=>it in Ut?dke(Ut,it,{enumerable:!0,configurable:!0,writable:!0,value:Je}):Ut[it]=Je,ot=(Ut,it)=>{for(var Je in it||(it={}))jq.call(it,Je)&&Uq(Ut,Je,it[Je]);if(C1)for(var Je of C1(it))Vq.call(it,Je)&&Uq(Ut,Je,it[Je]);return Ut},Cn=(Ut,it)=>hke(Ut,fke(it)),zq=(Ut,it)=>{var Je={};for(var yt in Ut)jq.call(Ut,yt)&&it.indexOf(yt)<0&&(Je[yt]=Ut[yt]);if(null!=Ut&&C1)for(var yt of C1(Ut))it.indexOf(yt)<0&&Vq.call(Ut,yt)&&(Je[yt]=Ut[yt]);return Je};(self.webpackChunkccf_ui=self.webpackChunkccf_ui||[]).push([[179],{440:(Ut,it,Je)=>{var yt=Je(52).default;Ut.exports=function Y(Se,he,W){function j(z,v){if(!he[z]){if(!Se[z]){if(P)return P(z,!0);var O=new Error("Cannot find module '"+z+"'");throw O.code="MODULE_NOT_FOUND",O}var A=he[z]={exports:{}};Se[z][0].call(A.exports,function(b){return j(Se[z][1][b]||b)},A,A.exports,Y,Se,he,W)}return he[z].exports}for(var P=void 0,Q=0;Q0&&G[G.length-1])&&(6===_t[0]||2===_t[0])){$e=0;continue}if(3===_t[0]&&(!G||_t[1]>G[0]&&_t[1]0?ce-4:ce;for($=0;$>16&255,I[X++]=R>>8&255,I[X++]=255&R;return 2===D&&(R=j[V.charCodeAt($)]<<2|j[V.charCodeAt($+1)]>>4,I[X++]=255&R),1===D&&(R=j[V.charCodeAt($)]<<10|j[V.charCodeAt($+1)]<<4|j[V.charCodeAt($+2)]>>2,I[X++]=R>>8&255,I[X++]=255&R),I},he.fromByteArray=function(V){for(var R,K=V.length,ce=K%3,D=[],I=16383,X=0,E=K-ce;XE?E:X+I));return 1===ce?D.push(W[(R=V[K-1])>>2]+W[R<<4&63]+"=="):2===ce&&D.push(W[(R=(V[K-2]<<8)+V[K-1])>>10]+W[R>>4&63]+W[R<<2&63]+"="),D.join("")};for(var W=[],j=[],P="undefined"!=typeof Uint8Array?Uint8Array:Array,Q="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",z=0,v=Q.length;z0)throw new Error("Invalid string. Length must be a multiple of 4");var K=V.indexOf("=");return-1===K&&(K=R),[K,K===R?0:4-K%4]}function y(V){return W[V>>18&63]+W[V>>12&63]+W[V>>6&63]+W[63&V]}function S(V,R,K){for(var D=[],I=R;I>5==6?2:D>>4==14?3:D>>3==30?4:D>>6==2?-1:-2}function A(D){var I=this.lastTotal-this.lastNeed,X=function(D,I,X){if(128!=(192&I[0]))return D.lastNeed=0,"\ufffd";if(D.lastNeed>1&&I.length>1){if(128!=(192&I[1]))return D.lastNeed=1,"\ufffd";if(D.lastNeed>2&&I.length>2&&128!=(192&I[2]))return D.lastNeed=2,"\ufffd"}}(this,D);return void 0!==X?X:this.lastNeed<=D.length?(D.copy(this.lastChar,I,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(D.copy(this.lastChar,I,0,D.length),void(this.lastNeed-=D.length))}function S(D,I){if((D.length-I)%2==0){var X=D.toString("utf16le",I);if(X){var E=X.charCodeAt(X.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],X.slice(0,-1)}return X}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=D[D.length-1],D.toString("utf16le",I,D.length-1)}function T(D){var I=D&&D.length?this.write(D):"";return this.lastNeed?I+this.lastChar.toString("utf16le",0,this.lastTotal-this.lastNeed):I}function V(D,I){var X=(D.length-I)%3;return 0===X?D.toString("base64",I):(this.lastNeed=3-X,this.lastTotal=3,1===X?this.lastChar[0]=D[D.length-1]:(this.lastChar[0]=D[D.length-2],this.lastChar[1]=D[D.length-1]),D.toString("base64",I,D.length-X))}function R(D){var I=D&&D.length?this.write(D):"";return this.lastNeed?I+this.lastChar.toString("base64",0,3-this.lastNeed):I}function K(D){return D.toString(this.encoding)}function ce(D){return D&&D.length?this.write(D):""}he.StringDecoder=z,z.prototype.write=function(D){if(0===D.length)return"";var I,X;if(this.lastNeed){if(void 0===(I=this.fillLast(D)))return"";X=this.lastNeed,this.lastNeed=0}else X=0;return X=0?($>0&&(D.lastNeed=$-1),$):--E=0?($>0&&(D.lastNeed=$-2),$):--E=0?($>0&&(2===$?$=0:D.lastNeed=$-3),$):0}(this,D,I);if(!this.lastNeed)return D.toString("utf8",I);this.lastTotal=X;var E=D.length-(X-this.lastNeed);return D.copy(this.lastChar,0,E),D.toString("utf8",I,E)},z.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(Y,Se,he){(function(W){(function(){"use strict";var j=Y("base64-js"),P=Y("ieee754");he.Buffer=x,he.SlowBuffer=function(L){return+L!=L&&(L=0),x.alloc(+L)},he.INSPECT_MAX_BYTES=50;var Q=2147483647;function v(L){if(L>Q)throw new RangeError('The value "'+L+'" is invalid for option "size"');var N=new Uint8Array(L);return N.__proto__=x.prototype,N}function x(L,N,B){if("number"==typeof L){if("string"==typeof N)throw new TypeError('The "string" argument must be of type string. Received type number');return y(L)}return O(L,N,B)}function O(L,N,B){if("string"==typeof L)return function(L,N){if(("string"!=typeof N||""===N)&&(N="utf8"),!x.isEncoding(N))throw new TypeError("Unknown encoding: "+N);var B=0|D(L,N),Re=v(B),Qe=Re.write(L,N);return Qe!==B&&(Re=Re.slice(0,Qe)),Re}(L,N);if(ArrayBuffer.isView(L))return T(L);if(null==L)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof L);if(pt(L,ArrayBuffer)||L&&pt(L.buffer,ArrayBuffer))return function(L,N,B){if(N<0||L.byteLength=Q)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Q.toString(16)+" bytes");return 0|L}function D(L,N){if(x.isBuffer(L))return L.length;if(ArrayBuffer.isView(L)||pt(L,ArrayBuffer))return L.byteLength;if("string"!=typeof L)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof L);var B=L.length,Re=arguments.length>2&&!0===arguments[2];if(!Re&&0===B)return 0;for(var Qe=!1;;)switch(N){case"ascii":case"latin1":case"binary":return B;case"utf8":case"utf-8":return G(L).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*B;case"hex":return B>>>1;case"base64":return je(L).length;default:if(Qe)return Re?-1:G(L).length;N=(""+N).toLowerCase(),Qe=!0}}function I(L,N,B){var Re=!1;if((void 0===N||N<0)&&(N=0),N>this.length||((void 0===B||B>this.length)&&(B=this.length),B<=0)||(B>>>=0)<=(N>>>=0))return"";for(L||(L="utf8");;)switch(L){case"hex":return tt(this,N,B);case"utf8":case"utf-8":return _e(this,N,B);case"ascii":return st(this,N,B);case"latin1":case"binary":return Xe(this,N,B);case"base64":return ne(this,N,B);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ye(this,N,B);default:if(Re)throw new TypeError("Unknown encoding: "+L);L=(L+"").toLowerCase(),Re=!0}}function X(L,N,B){var Re=L[N];L[N]=L[B],L[B]=Re}function E(L,N,B,Re,Qe){if(0===L.length)return-1;if("string"==typeof B?(Re=B,B=0):B>2147483647?B=2147483647:B<-2147483648&&(B=-2147483648),ve(B=+B)&&(B=Qe?0:L.length-1),B<0&&(B=L.length+B),B>=L.length){if(Qe)return-1;B=L.length-1}else if(B<0){if(!Qe)return-1;B=0}if("string"==typeof N&&(N=x.from(N,Re)),x.isBuffer(N))return 0===N.length?-1:$(L,N,B,Re,Qe);if("number"==typeof N)return N&=255,"function"==typeof Uint8Array.prototype.indexOf?Qe?Uint8Array.prototype.indexOf.call(L,N,B):Uint8Array.prototype.lastIndexOf.call(L,N,B):$(L,[N],B,Re,Qe);throw new TypeError("val must be string, number or Buffer")}function $(L,N,B,Re,Qe){var Yn,St=1,Nt=L.length,On=N.length;if(void 0!==Re&&("ucs2"===(Re=String(Re).toLowerCase())||"ucs-2"===Re||"utf16le"===Re||"utf-16le"===Re)){if(L.length<2||N.length<2)return-1;St=2,Nt/=2,On/=2,B/=2}function kn(Ls,gs){return 1===St?Ls[gs]:Ls.readUInt16BE(gs*St)}if(Qe){var Ti=-1;for(Yn=B;YnNt&&(B=Nt-On),Yn=B;Yn>=0;Yn--){for(var wi=!0,Xr=0;XrQe&&(Re=Qe):Re=Qe;var St=N.length;Re>St/2&&(Re=St/2);for(var Nt=0;Nt>8,St.push(B%256),St.push(Re);return St}(N,L.length-B),L,B,Re)}function ne(L,N,B){return j.fromByteArray(0===N&&B===L.length?L:L.slice(N,B))}function _e(L,N,B){B=Math.min(L.length,B);for(var Re=[],Qe=N;Qe239?4:St>223?3:St>191?2:1;if(Qe+On<=B)switch(On){case 1:St<128&&(Nt=St);break;case 2:128==(192&(kn=L[Qe+1]))&&(wi=(31&St)<<6|63&kn)>127&&(Nt=wi);break;case 3:Yn=L[Qe+2],128==(192&(kn=L[Qe+1]))&&128==(192&Yn)&&(wi=(15&St)<<12|(63&kn)<<6|63&Yn)>2047&&(wi<55296||wi>57343)&&(Nt=wi);break;case 4:Yn=L[Qe+2],Ti=L[Qe+3],128==(192&(kn=L[Qe+1]))&&128==(192&Yn)&&128==(192&Ti)&&(wi=(15&St)<<18|(63&kn)<<12|(63&Yn)<<6|63&Ti)>65535&&wi<1114112&&(Nt=wi)}null===Nt?(Nt=65533,On=1):Nt>65535&&(Re.push((Nt-=65536)>>>10&1023|55296),Nt=56320|1023&Nt),Re.push(Nt),Qe+=On}return function(L){var N=L.length;if(N<=4096)return String.fromCharCode.apply(String,L);for(var B="",Re=0;ReB&&(N+=" ... "),""},x.prototype.compare=function(N,B,Re,Qe,St){if(pt(N,Uint8Array)&&(N=x.from(N,N.offset,N.byteLength)),!x.isBuffer(N))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof N);if(void 0===B&&(B=0),void 0===Re&&(Re=N?N.length:0),void 0===Qe&&(Qe=0),void 0===St&&(St=this.length),B<0||Re>N.length||Qe<0||St>this.length)throw new RangeError("out of range index");if(Qe>=St&&B>=Re)return 0;if(Qe>=St)return-1;if(B>=Re)return 1;if(this===N)return 0;for(var Nt=(St>>>=0)-(Qe>>>=0),On=(Re>>>=0)-(B>>>=0),kn=Math.min(Nt,On),Yn=this.slice(Qe,St),Ti=N.slice(B,Re),wi=0;wi>>=0,isFinite(Re)?(Re>>>=0,void 0===Qe&&(Qe="utf8")):(Qe=Re,Re=void 0)}var St=this.length-B;if((void 0===Re||Re>St)&&(Re=St),N.length>0&&(Re<0||B<0)||B>this.length)throw new RangeError("Attempt to write outside buffer bounds");Qe||(Qe="utf8");for(var Nt=!1;;)switch(Qe){case"hex":return Z(this,N,B,Re);case"utf8":case"utf-8":return oe(this,N,B,Re);case"ascii":return se(this,N,B,Re);case"latin1":case"binary":return te(this,N,B,Re);case"base64":return Ce(this,N,B,Re);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return me(this,N,B,Re);default:if(Nt)throw new TypeError("Unknown encoding: "+Qe);Qe=(""+Qe).toLowerCase(),Nt=!0}},x.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function st(L,N,B){var Re="";B=Math.min(L.length,B);for(var Qe=N;QeRe)&&(B=Re);for(var Qe="",St=N;StB)throw new RangeError("Trying to access beyond buffer length")}function ke(L,N,B,Re,Qe,St){if(!x.isBuffer(L))throw new TypeError('"buffer" argument must be a Buffer instance');if(N>Qe||NL.length)throw new RangeError("Index out of range")}function Ke(L,N,B,Re,Qe,St){if(B+Re>L.length)throw new RangeError("Index out of range");if(B<0)throw new RangeError("Index out of range")}function Me(L,N,B,Re,Qe){return N=+N,B>>>=0,Qe||Ke(L,0,B,4),P.write(L,N,B,Re,23,4),B+4}function Ve(L,N,B,Re,Qe){return N=+N,B>>>=0,Qe||Ke(L,0,B,8),P.write(L,N,B,Re,52,8),B+8}x.prototype.slice=function(N,B){var Re=this.length;(N=~~N)<0?(N+=Re)<0&&(N=0):N>Re&&(N=Re),(B=void 0===B?Re:~~B)<0?(B+=Re)<0&&(B=0):B>Re&&(B=Re),B>>=0,B>>>=0,Re||Ue(N,B,this.length);for(var Qe=this[N],St=1,Nt=0;++Nt>>=0,B>>>=0,Re||Ue(N,B,this.length);for(var Qe=this[N+--B],St=1;B>0&&(St*=256);)Qe+=this[N+--B]*St;return Qe},x.prototype.readUInt8=function(N,B){return N>>>=0,B||Ue(N,1,this.length),this[N]},x.prototype.readUInt16LE=function(N,B){return N>>>=0,B||Ue(N,2,this.length),this[N]|this[N+1]<<8},x.prototype.readUInt16BE=function(N,B){return N>>>=0,B||Ue(N,2,this.length),this[N]<<8|this[N+1]},x.prototype.readUInt32LE=function(N,B){return N>>>=0,B||Ue(N,4,this.length),(this[N]|this[N+1]<<8|this[N+2]<<16)+16777216*this[N+3]},x.prototype.readUInt32BE=function(N,B){return N>>>=0,B||Ue(N,4,this.length),16777216*this[N]+(this[N+1]<<16|this[N+2]<<8|this[N+3])},x.prototype.readIntLE=function(N,B,Re){N>>>=0,B>>>=0,Re||Ue(N,B,this.length);for(var Qe=this[N],St=1,Nt=0;++Nt=(St*=128)&&(Qe-=Math.pow(2,8*B)),Qe},x.prototype.readIntBE=function(N,B,Re){N>>>=0,B>>>=0,Re||Ue(N,B,this.length);for(var Qe=B,St=1,Nt=this[N+--Qe];Qe>0&&(St*=256);)Nt+=this[N+--Qe]*St;return Nt>=(St*=128)&&(Nt-=Math.pow(2,8*B)),Nt},x.prototype.readInt8=function(N,B){return N>>>=0,B||Ue(N,1,this.length),128&this[N]?-1*(255-this[N]+1):this[N]},x.prototype.readInt16LE=function(N,B){N>>>=0,B||Ue(N,2,this.length);var Re=this[N]|this[N+1]<<8;return 32768&Re?4294901760|Re:Re},x.prototype.readInt16BE=function(N,B){N>>>=0,B||Ue(N,2,this.length);var Re=this[N+1]|this[N]<<8;return 32768&Re?4294901760|Re:Re},x.prototype.readInt32LE=function(N,B){return N>>>=0,B||Ue(N,4,this.length),this[N]|this[N+1]<<8|this[N+2]<<16|this[N+3]<<24},x.prototype.readInt32BE=function(N,B){return N>>>=0,B||Ue(N,4,this.length),this[N]<<24|this[N+1]<<16|this[N+2]<<8|this[N+3]},x.prototype.readFloatLE=function(N,B){return N>>>=0,B||Ue(N,4,this.length),P.read(this,N,!0,23,4)},x.prototype.readFloatBE=function(N,B){return N>>>=0,B||Ue(N,4,this.length),P.read(this,N,!1,23,4)},x.prototype.readDoubleLE=function(N,B){return N>>>=0,B||Ue(N,8,this.length),P.read(this,N,!0,52,8)},x.prototype.readDoubleBE=function(N,B){return N>>>=0,B||Ue(N,8,this.length),P.read(this,N,!1,52,8)},x.prototype.writeUIntLE=function(N,B,Re,Qe){N=+N,B>>>=0,Re>>>=0,Qe||ke(this,N,B,Re,Math.pow(2,8*Re)-1,0);var Nt=1,On=0;for(this[B]=255&N;++On>>=0,Re>>>=0,Qe||ke(this,N,B,Re,Math.pow(2,8*Re)-1,0);var Nt=Re-1,On=1;for(this[B+Nt]=255&N;--Nt>=0&&(On*=256);)this[B+Nt]=N/On&255;return B+Re},x.prototype.writeUInt8=function(N,B,Re){return N=+N,B>>>=0,Re||ke(this,N,B,1,255,0),this[B]=255&N,B+1},x.prototype.writeUInt16LE=function(N,B,Re){return N=+N,B>>>=0,Re||ke(this,N,B,2,65535,0),this[B]=255&N,this[B+1]=N>>>8,B+2},x.prototype.writeUInt16BE=function(N,B,Re){return N=+N,B>>>=0,Re||ke(this,N,B,2,65535,0),this[B]=N>>>8,this[B+1]=255&N,B+2},x.prototype.writeUInt32LE=function(N,B,Re){return N=+N,B>>>=0,Re||ke(this,N,B,4,4294967295,0),this[B+3]=N>>>24,this[B+2]=N>>>16,this[B+1]=N>>>8,this[B]=255&N,B+4},x.prototype.writeUInt32BE=function(N,B,Re){return N=+N,B>>>=0,Re||ke(this,N,B,4,4294967295,0),this[B]=N>>>24,this[B+1]=N>>>16,this[B+2]=N>>>8,this[B+3]=255&N,B+4},x.prototype.writeIntLE=function(N,B,Re,Qe){if(N=+N,B>>>=0,!Qe){var St=Math.pow(2,8*Re-1);ke(this,N,B,Re,St-1,-St)}var Nt=0,On=1,kn=0;for(this[B]=255&N;++Nt>0)-kn&255;return B+Re},x.prototype.writeIntBE=function(N,B,Re,Qe){if(N=+N,B>>>=0,!Qe){var St=Math.pow(2,8*Re-1);ke(this,N,B,Re,St-1,-St)}var Nt=Re-1,On=1,kn=0;for(this[B+Nt]=255&N;--Nt>=0&&(On*=256);)N<0&&0===kn&&0!==this[B+Nt+1]&&(kn=1),this[B+Nt]=(N/On>>0)-kn&255;return B+Re},x.prototype.writeInt8=function(N,B,Re){return N=+N,B>>>=0,Re||ke(this,N,B,1,127,-128),N<0&&(N=255+N+1),this[B]=255&N,B+1},x.prototype.writeInt16LE=function(N,B,Re){return N=+N,B>>>=0,Re||ke(this,N,B,2,32767,-32768),this[B]=255&N,this[B+1]=N>>>8,B+2},x.prototype.writeInt16BE=function(N,B,Re){return N=+N,B>>>=0,Re||ke(this,N,B,2,32767,-32768),this[B]=N>>>8,this[B+1]=255&N,B+2},x.prototype.writeInt32LE=function(N,B,Re){return N=+N,B>>>=0,Re||ke(this,N,B,4,2147483647,-2147483648),this[B]=255&N,this[B+1]=N>>>8,this[B+2]=N>>>16,this[B+3]=N>>>24,B+4},x.prototype.writeInt32BE=function(N,B,Re){return N=+N,B>>>=0,Re||ke(this,N,B,4,2147483647,-2147483648),N<0&&(N=4294967295+N+1),this[B]=N>>>24,this[B+1]=N>>>16,this[B+2]=N>>>8,this[B+3]=255&N,B+4},x.prototype.writeFloatLE=function(N,B,Re){return Me(this,N,B,!0,Re)},x.prototype.writeFloatBE=function(N,B,Re){return Me(this,N,B,!1,Re)},x.prototype.writeDoubleLE=function(N,B,Re){return Ve(this,N,B,!0,Re)},x.prototype.writeDoubleBE=function(N,B,Re){return Ve(this,N,B,!1,Re)},x.prototype.copy=function(N,B,Re,Qe){if(!x.isBuffer(N))throw new TypeError("argument should be a Buffer");if(Re||(Re=0),!Qe&&0!==Qe&&(Qe=this.length),B>=N.length&&(B=N.length),B||(B=0),Qe>0&&Qe=this.length)throw new RangeError("Index out of range");if(Qe<0)throw new RangeError("sourceEnd out of bounds");Qe>this.length&&(Qe=this.length),N.length-B=0;--Nt)N[Nt+B]=this[Nt+Re];else Uint8Array.prototype.set.call(N,this.subarray(Re,Qe),B);return St},x.prototype.fill=function(N,B,Re,Qe){if("string"==typeof N){if("string"==typeof B?(Qe=B,B=0,Re=this.length):"string"==typeof Re&&(Qe=Re,Re=this.length),void 0!==Qe&&"string"!=typeof Qe)throw new TypeError("encoding must be a string");if("string"==typeof Qe&&!x.isEncoding(Qe))throw new TypeError("Unknown encoding: "+Qe);if(1===N.length){var St=N.charCodeAt(0);("utf8"===Qe&&St<128||"latin1"===Qe)&&(N=St)}}else"number"==typeof N&&(N&=255);if(B<0||this.length>>=0,Re=void 0===Re?this.length:Re>>>0,N||(N=0),"number"==typeof N)for(Nt=B;Nt55295&&B<57344){if(!Qe){if(B>56319){(N-=3)>-1&&St.push(239,191,189);continue}if(Nt+1===Re){(N-=3)>-1&&St.push(239,191,189);continue}Qe=B;continue}if(B<56320){(N-=3)>-1&&St.push(239,191,189),Qe=B;continue}B=65536+(Qe-55296<<10|B-56320)}else Qe&&(N-=3)>-1&&St.push(239,191,189);if(Qe=null,B<128){if((N-=1)<0)break;St.push(B)}else if(B<2048){if((N-=2)<0)break;St.push(B>>6|192,63&B|128)}else if(B<65536){if((N-=3)<0)break;St.push(B>>12|224,B>>6&63|128,63&B|128)}else{if(!(B<1114112))throw new Error("Invalid code point");if((N-=4)<0)break;St.push(B>>18|240,B>>12&63|128,B>>6&63|128,63&B|128)}}return St}function je(L){return j.toByteArray(function(L){if((L=(L=L.split("=")[0]).trim().replace($e,"")).length<2)return"";for(;L.length%4!=0;)L+="=";return L}(L))}function _t(L,N,B,Re){for(var Qe=0;Qe=N.length||Qe>=L.length);++Qe)N[Qe+B]=L[Qe];return Qe}function pt(L,N){return L instanceof N||null!=L&&null!=L.constructor&&null!=L.constructor.name&&L.constructor.name===N.name}function ve(L){return L!=L}}).call(this)}).call(this,Y("buffer").Buffer)},{"base64-js":2,buffer:6,ieee754:9}],7:[function(Y,Se,he){"use strict";Se.exports=function W(j){return null===j||"object"!=typeof j||null!=j.toJSON?JSON.stringify(j):Array.isArray(j)?"["+j.reduce((P,Q,z)=>P+(0===z?"":",")+W(void 0===Q||"symbol"==typeof Q?null:Q),"")+"]":"{"+Object.keys(j).sort().reduce((P,Q,z)=>void 0===j[Q]||"symbol"==typeof j[Q]?P:P+(0===P.length?"":",")+W(Q)+":"+W(j[Q]),"")+"}"}},{}],8:[function(Y,Se,he){"use strict";var P,W="object"==typeof Reflect?Reflect:null,j=W&&"function"==typeof W.apply?W.apply:function($,Z,oe){return Function.prototype.apply.call($,Z,oe)};P=W&&"function"==typeof W.ownKeys?W.ownKeys:Object.getOwnPropertySymbols?function($){return Object.getOwnPropertyNames($).concat(Object.getOwnPropertySymbols($))}:function($){return Object.getOwnPropertyNames($)};var z=Number.isNaN||function($){return $!=$};function v(){v.init.call(this)}Se.exports=v,Se.exports.once=function(E,$){return new Promise(function(Z,oe){function se(Ce){E.removeListener($,te),oe(Ce)}function te(){"function"==typeof E.removeListener&&E.removeListener("error",se),Z([].slice.call(arguments))}X(E,$,te,{once:!0}),"error"!==$&&function(E,$,Z){"function"==typeof E.on&&X(E,"error",$,Z)}(E,se,{once:!0})})},v.EventEmitter=v,v.prototype._events=void 0,v.prototype._eventsCount=0,v.prototype._maxListeners=void 0;var x=10;function O(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?v.defaultMaxListeners:E._maxListeners}function b(E,$,Z,oe){var se,te,Ce;if(O(Z),void 0===(te=E._events)?(te=E._events=Object.create(null),E._eventsCount=0):(void 0!==te.newListener&&(E.emit("newListener",$,Z.listener?Z.listener:Z),te=E._events),Ce=te[$]),void 0===Ce)Ce=te[$]=Z,++E._eventsCount;else if("function"==typeof Ce?Ce=te[$]=oe?[Z,Ce]:[Ce,Z]:oe?Ce.unshift(Z):Ce.push(Z),(se=A(E))>0&&Ce.length>se&&!Ce.warned){Ce.warned=!0;var me=new Error("Possible EventEmitter memory leak detected. "+Ce.length+" "+String($)+" listeners added. Use emitter.setMaxListeners() to increase limit");me.name="MaxListenersExceededWarning",me.emitter=E,me.type=$,me.count=Ce.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 S(E,$,Z){var oe={fired:!1,wrapFn:void 0,target:E,type:$,listener:Z},se=y.bind(oe);return se.listener=Z,oe.wrapFn=se,se}function T(E,$,Z){var oe=E._events;if(void 0===oe)return[];var se=oe[$];return void 0===se?[]:"function"==typeof se?Z?[se.listener||se]:[se]:Z?function(E){for(var $=new Array(E.length),Z=0;Z<$.length;++Z)$[Z]=E[Z].listener||E[Z];return $}(se):R(se,se.length)}function V(E){var $=this._events;if(void 0!==$){var Z=$[E];if("function"==typeof Z)return 1;if(void 0!==Z)return Z.length}return 0}function R(E,$){for(var Z=new Array($),oe=0;oe<$;++oe)Z[oe]=E[oe];return Z}function X(E,$,Z,oe){if("function"==typeof E.on)oe.once?E.once($,Z):E.on($,Z);else{if("function"!=typeof E.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof E);E.addEventListener($,function se(te){oe.once&&E.removeEventListener($,se),Z(te)})}}Object.defineProperty(v,"defaultMaxListeners",{enumerable:!0,get:function(){return x},set:function(E){if("number"!=typeof E||E<0||z(E))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+E+".");x=E}}),v.init=function(){(void 0===this._events||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},v.prototype.setMaxListeners=function($){if("number"!=typeof $||$<0||z($))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+$+".");return this._maxListeners=$,this},v.prototype.getMaxListeners=function(){return A(this)},v.prototype.emit=function($){for(var Z=[],oe=1;oe0&&(Ce=Z[0]),Ce instanceof Error)throw Ce;var me=new Error("Unhandled error."+(Ce?" ("+Ce.message+")":""));throw me.context=Ce,me}var ne=te[$];if(void 0===ne)return!1;if("function"==typeof ne)j(ne,this,Z);else{var _e=ne.length,Ie=R(ne,_e);for(oe=0;oe<_e;++oe)j(Ie[oe],this,Z)}return!0},v.prototype.on=v.prototype.addListener=function($,Z){return b(this,$,Z,!1)},v.prototype.prependListener=function($,Z){return b(this,$,Z,!0)},v.prototype.once=function($,Z){return O(Z),this.on($,S(this,$,Z)),this},v.prototype.prependOnceListener=function($,Z){return O(Z),this.prependListener($,S(this,$,Z)),this},v.prototype.off=v.prototype.removeListener=function($,Z){var oe,se,te,Ce,me;if(O(Z),void 0===(se=this._events))return this;if(void 0===(oe=se[$]))return this;if(oe===Z||oe.listener===Z)0==--this._eventsCount?this._events=Object.create(null):(delete se[$],se.removeListener&&this.emit("removeListener",$,oe.listener||Z));else if("function"!=typeof oe){for(te=-1,Ce=oe.length-1;Ce>=0;Ce--)if(oe[Ce]===Z||oe[Ce].listener===Z){me=oe[Ce].listener,te=Ce;break}if(te<0)return this;0===te?oe.shift():function(E,$){for(;$+1=0;se--)this.removeListener($,Z[se]);return this},v.prototype.listeners=function($){return T(this,$,!0)},v.prototype.rawListeners=function($){return T(this,$,!1)},v.listenerCount=function(E,$){return"function"==typeof E.listenerCount?E.listenerCount($):V.call(E,$)},v.prototype.listenerCount=V,v.prototype.eventNames=function(){return this._eventsCount>0?P(this._events):[]}},{}],9:[function(Y,Se,he){he.read=function(W,j,P,Q,z){var v,x,O=8*z-Q-1,A=(1<>1,y=-7,S=P?z-1:0,T=P?-1:1,V=W[j+S];for(S+=T,v=V&(1<<-y)-1,V>>=-y,y+=O;y>0;v=256*v+W[j+S],S+=T,y-=8);for(x=v&(1<<-y)-1,v>>=-y,y+=Q;y>0;x=256*x+W[j+S],S+=T,y-=8);if(0===v)v=1-b;else{if(v===A)return x?NaN:1/0*(V?-1:1);x+=Math.pow(2,Q),v-=b}return(V?-1:1)*x*Math.pow(2,v-Q)},he.write=function(W,j,P,Q,z,v){var x,O,A,b=8*v-z-1,y=(1<>1,T=23===z?Math.pow(2,-24)-Math.pow(2,-77):0,V=Q?0:v-1,R=Q?1:-1,K=j<0||0===j&&1/j<0?1:0;for(j=Math.abs(j),isNaN(j)||j===1/0?(O=isNaN(j)?1:0,x=y):(x=Math.floor(Math.log(j)/Math.LN2),j*(A=Math.pow(2,-x))<1&&(x--,A*=2),(j+=x+S>=1?T/A:T*Math.pow(2,1-S))*A>=2&&(x++,A/=2),x+S>=y?(O=0,x=y):x+S>=1?(O=(j*A-1)*Math.pow(2,z),x+=S):(O=j*Math.pow(2,S-1)*Math.pow(2,z),x=0));z>=8;W[P+V]=255&O,V+=R,O/=256,z-=8);for(x=x<0;W[P+V]=255&x,V+=R,x/=256,b-=8);W[P+V-R]|=128*K}},{}],10:[function(Y,Se,he){Se.exports="function"==typeof Object.create?function(j,P){P&&(j.super_=P,j.prototype=Object.create(P.prototype,{constructor:{value:j,enumerable:!1,writable:!0,configurable:!0}}))}:function(j,P){if(P){j.super_=P;var Q=function(){};Q.prototype=P.prototype,j.prototype=new Q,j.prototype.constructor=j}}},{}],11:[function(Y,Se,he){"use strict";const{isArray:W,isObject:j,isString:P}=Y("./types"),{asArray:Q}=Y("./util"),{prependBase:z}=Y("./url"),v=Y("./JsonLdError"),x=Y("./ResolvedContext");function A(y){throw new v("Invalid JSON-LD syntax; @context must be an object.","jsonld.SyntaxError",{code:"invalid local context",context:y})}function b({context:y,base:S}){if(!y)return;const T=y["@context"];if(P(T))y["@context"]=z(S,T);else if(W(T))for(let V=0;V10)throw new v("Maximum number of @context URLs exceeded.","jsonld.ContextUrlError",{code:"json-ld-1.0"===S.processingMode?"loading remote context failed":"context overflow",max:10});if(R.has(T))throw new v("Cyclical @context URLs detected.","jsonld.ContextUrlError",{code:"json-ld-1.0"===S.processingMode?"recursive context inclusion":"context overflow",url:T});let K,ce;R.add(T);try{ce=yield V(T),K=ce.document||null,P(K)&&(K=JSON.parse(K))}catch(D){throw new v("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:D})}if(!j(K))throw new v("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 K="@context"in K?{"@context":K["@context"]}:{"@context":{}},ce.contextUrl&&(W(K["@context"])||(K["@context"]=[K["@context"]]),K["@context"].push(ce.contextUrl)),{context:K,remoteDoc:ce}})()}}},{"./JsonLdError":12,"./ResolvedContext":16,"./types":30,"./url":31,"./util":32}],12:[function(Y,Se,he){"use strict";Se.exports=class extends Error{constructor(j="An unspecified JSON-LD error occurred.",P="jsonld.Error",Q={}){super(j),this.name=P,this.message=j,this.details=Q}}},{}],13:[function(Y,Se,he){"use strict";Se.exports=W=>{class j{toString(){return"[object JsonLdProcessor]"}}return Object.defineProperty(j,"prototype",{writable:!1,enumerable:!1}),Object.defineProperty(j.prototype,"constructor",{writable:!0,enumerable:!1,configurable:!0,value:j}),j.compact=function(P,Q){return arguments.length<2?Promise.reject(new TypeError("Could not compact, too few arguments.")):W.compact(P,Q)},j.expand=function(P){return arguments.length<1?Promise.reject(new TypeError("Could not expand, too few arguments.")):W.expand(P)},j.flatten=function(P){return arguments.length<1?Promise.reject(new TypeError("Could not flatten, too few arguments.")):W.flatten(P)},j}},{}],14:[function(Y,Se,he){"use strict";Se.exports=Y("rdf-canonize").NQuads},{"rdf-canonize":46}],15:[function(Y,Se,he){"use strict";Se.exports=class{constructor(){this._requests={}}wrapLoader(j){const P=this;return P._loader=j,function(){return P.add.apply(P,arguments)}}add(j){var P=this;return yt(function*(){let Q=P._requests[j];if(Q)return Promise.resolve(Q);Q=P._requests[j]=P._loader(j);try{return yield Q}finally{delete P._requests[j]}})()}}},{}],16:[function(Y,Se,he){"use strict";const W=Y("lru-cache");Se.exports=class{constructor({document:Q}){this.document=Q,this.cache=new W({max:10})}getProcessed(Q){return this.cache.get(Q)}setProcessed(Q,z){this.cache.set(Q,z)}}},{"lru-cache":33}],17:[function(Y,Se,he){"use strict";const W=Y("./JsonLdError"),{isArray:j,isObject:P,isString:Q,isUndefined:z}=Y("./types"),{isList:v,isValue:x,isGraph:O,isSimpleGraph:A,isSubjectReference:b}=Y("./graphTypes"),{expandIri:y,getContextValue:S,isKeyword:T,process:V,processingMode:R}=Y("./context"),{removeBase:K,prependBase:ce}=Y("./url"),{addValue:D,asArray:I,compareShortestLeast:X}=Y("./util"),E={};function Z(oe,se,te){if("@nest"!==y(oe,se,{vocab:!0},te))throw new W("JSON-LD compact error; nested property must have an @nest value resolving to @nest.","jsonld.SyntaxError",{code:"invalid @nest value"})}Se.exports=E,E.compact=function(){var oe=yt(function*({activeCtx:se,activeProperty:te=null,element:Ce,options:me={},compactionMap:ne=(()=>{})}){if(j(Ce)){let Ie=[];for(let Ge=0;Ge1&&(tt=Array.from(tt).sort());const Ye=se;for(const ke of tt){const Ke=E.compactIri({activeCtx:Ye,iri:ke,relativeTo:{vocab:!0}}),Me=S(st,Ke,"@context");z(Me)||(se=yield V({activeCtx:se,localCtx:Me,options:me,propagate:!1}))}const Ue=Object.keys(Ce).sort();for(const ke of Ue){const Ke=Ce[ke];if("@id"!==ke)if("@type"!==ke)if("@reverse"!==ke)if("@preserve"!==ke)if("@index"!==ke)if("@graph"!==ke&&"@list"!==ke&&"@included"!==ke&&T(ke)){const Me=E.compactIri({activeCtx:se,iri:ke,relativeTo:{vocab:!0}});D(Ge,Me,Ke)}else{if(!j(Ke))throw new W("JSON-LD expansion error; expanded value must be an array.","jsonld.SyntaxError");if(0===Ke.length){const Me=E.compactIri({activeCtx:se,iri:ke,value:Ke,relativeTo:{vocab:!0},reverse:Ie}),Ve=se.mappings.has(Me)?se.mappings.get(Me)["@nest"]:null;let $e=Ge;Ve&&(Z(se,Ve,me),P(Ge[Ve])||(Ge[Ve]={}),$e=Ge[Ve]),D($e,Me,Ke,{propertyIsArray:!0})}for(const Me of Ke){const Ve=E.compactIri({activeCtx:se,iri:ke,value:Me,relativeTo:{vocab:!0},reverse:Ie}),$e=se.mappings.has(Ve)?se.mappings.get(Ve)["@nest"]:null;let Ne=Ge;$e&&(Z(se,$e,me),P(Ge[$e])||(Ge[$e]={}),Ne=Ge[$e]);const q=S(se,Ve,"@container")||[],G=O(Me),pe=v(Me);let ue;pe?ue=Me["@list"]:G&&(ue=Me["@graph"]);let je=yield E.compact({activeCtx:se,activeProperty:Ve,element:pe||G?ue:Me,options:me,compactionMap:ne});if(pe){if(j(je)||(je=[je]),q.includes("@list")){D(Ne,Ve,je,{valueIsArray:!0,allowDuplicate:!0});continue}je={[E.compactIri({activeCtx:se,iri:"@list",relativeTo:{vocab:!0}})]:je},"@index"in Me&&(je[E.compactIri({activeCtx:se,iri:"@index",relativeTo:{vocab:!0}})]=Me["@index"])}if(G)if(q.includes("@graph")&&(q.includes("@id")||q.includes("@index")&&A(Me))){let _t;Ne.hasOwnProperty(Ve)?_t=Ne[Ve]:Ne[Ve]=_t={};const pt=(q.includes("@id")?Me["@id"]:Me["@index"])||E.compactIri({activeCtx:se,iri:"@none",relativeTo:{vocab:!0}});D(_t,pt,je,{propertyIsArray:!me.compactArrays||q.includes("@set")})}else q.includes("@graph")&&A(Me)?(j(je)&&je.length>1&&(je={"@included":je}),D(Ne,Ve,je,{propertyIsArray:!me.compactArrays||q.includes("@set")})):(j(je)&&1===je.length&&me.compactArrays&&(je=je[0]),je={[E.compactIri({activeCtx:se,iri:"@graph",relativeTo:{vocab:!0}})]:je},"@id"in Me&&(je[E.compactIri({activeCtx:se,iri:"@id",relativeTo:{vocab:!0}})]=Me["@id"]),"@index"in Me&&(je[E.compactIri({activeCtx:se,iri:"@index",relativeTo:{vocab:!0}})]=Me["@index"]),D(Ne,Ve,je,{propertyIsArray:!me.compactArrays||q.includes("@set")}));else if(q.includes("@language")||q.includes("@index")||q.includes("@id")||q.includes("@type")){let _t,pt;if(Ne.hasOwnProperty(Ve)?_t=Ne[Ve]:Ne[Ve]=_t={},q.includes("@language"))x(je)&&(je=je["@value"]),pt=Me["@language"];else if(q.includes("@index")){const ve=S(se,Ve,"@index")||"@index",L=E.compactIri({activeCtx:se,iri:ve,relativeTo:{vocab:!0}});if("@index"===ve)pt=Me["@index"],delete je[L];else{let N;if([pt,...N]=I(je[ve]||[]),Q(pt))switch(N.length){case 0:delete je[ve];break;case 1:je[ve]=N[0];break;default:je[ve]=N}else pt=null}}else if(q.includes("@id")){const ve=E.compactIri({activeCtx:se,iri:"@id",relativeTo:{vocab:!0}});pt=je[ve],delete je[ve]}else if(q.includes("@type")){const ve=E.compactIri({activeCtx:se,iri:"@type",relativeTo:{vocab:!0}});let L;switch([pt,...L]=I(je[ve]||[]),L.length){case 0:delete je[ve];break;case 1:je[ve]=L[0];break;default:je[ve]=L}1===Object.keys(je).length&&"@id"in Me&&(je=yield E.compact({activeCtx:se,activeProperty:Ve,element:{"@id":Me["@id"]},options:me,compactionMap:ne}))}pt||(pt=E.compactIri({activeCtx:se,iri:"@none",relativeTo:{vocab:!0}})),D(_t,pt,je,{propertyIsArray:q.includes("@set")})}else{const _t=!me.compactArrays||q.includes("@set")||q.includes("@list")||j(je)&&0===je.length||"@list"===ke||"@graph"===ke;D(Ne,Ve,je,{propertyIsArray:_t})}}}else{if((S(se,te,"@container")||[]).includes("@index"))continue;const Ve=E.compactIri({activeCtx:se,iri:ke,relativeTo:{vocab:!0}});D(Ge,Ve,Ke)}else{const Me=yield E.compact({activeCtx:se,activeProperty:te,element:Ke,options:me,compactionMap:ne});j(Me)&&0===Me.length||D(Ge,ke,Me)}else{const Me=yield E.compact({activeCtx:se,activeProperty:"@reverse",element:Ke,options:me,compactionMap:ne});for(const Ve in Me)if(se.mappings.has(Ve)&&se.mappings.get(Ve).reverse){const $e=Me[Ve],q=(S(se,Ve,"@container")||[]).includes("@set")||!me.compactArrays;D(Ge,Ve,$e,{propertyIsArray:q}),delete Me[Ve]}if(Object.keys(Me).length>0){const Ve=E.compactIri({activeCtx:se,iri:ke,relativeTo:{vocab:!0}});D(Ge,Ve,Me)}}else{let Me=I(Ke).map(G=>E.compactIri({activeCtx:st,iri:G,relativeTo:{vocab:!0}}));1===Me.length&&(Me=Me[0]);const Ve=E.compactIri({activeCtx:se,iri:"@type",relativeTo:{vocab:!0}}),q=(S(se,Ve,"@container")||[]).includes("@set")&&R(se,1.1)||j(Me)&&0===Ke.length;D(Ge,Ve,Me,{propertyIsArray:q})}else{let Me=I(Ke).map($e=>E.compactIri({activeCtx:se,iri:$e,relativeTo:{vocab:!1},base:me.base}));1===Me.length&&(Me=Me[0]),Ge[E.compactIri({activeCtx:se,iri:"@id",relativeTo:{vocab:!0}})]=Me}}return Ge}return Ce});return function(se){return oe.apply(this,arguments)}}(),E.compactIri=({activeCtx:oe,iri:se,value:te=null,relativeTo:Ce={vocab:!1},reverse:me=!1,base:ne=null})=>{if(null===se)return se;oe.isPropertyTermScoped&&oe.previousContext&&(oe=oe.previousContext);const _e=oe.getInverse();if(T(se)&&se in _e&&"@none"in _e[se]&&"@type"in _e[se]["@none"]&&"@none"in _e[se]["@none"]["@type"])return _e[se]["@none"]["@type"]["@none"];if(Ce.vocab&&se in _e){const tt=oe["@language"]||"@none",Ye=[];P(te)&&"@index"in te&&!("@graph"in te)&&Ye.push("@index","@index@set"),P(te)&&"@preserve"in te&&(te=te["@preserve"][0]),O(te)?("@index"in te&&Ye.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in te&&Ye.push("@graph@id","@graph@id@set"),Ye.push("@graph","@graph@set","@set"),"@index"in te||Ye.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in te||Ye.push("@graph@id","@graph@id@set")):P(te)&&!x(te)&&Ye.push("@id","@id@set","@type","@set@type");let Ue="@language",ke="@null";if(me)Ue="@type",ke="@reverse",Ye.push("@set");else if(v(te)){"@index"in te||Ye.push("@list");const Me=te["@list"];if(0===Me.length)Ue="@any",ke="@none";else{let Ve=0===Me.length?tt:null,$e=null;for(let Ne=0;Nest.includes("_"));Ge&&_e.push(Ge.replace(/^[^_]+_/,"_"))}_e.push("@none");const Ie=oe.inverse[se];for(const Ge of Ce){if(!(Ge in Ie))continue;const st=Ie[Ge][me];for(const Xe of _e)if(Xe in st)return st[Xe]}return null}(oe,se,te,Ye,Ue,ke);if(null!==Ke)return Ke}if(Ce.vocab&&"@vocab"in oe){const tt=oe["@vocab"];if(0===se.indexOf(tt)&&se!==tt){const Ye=se.substr(tt.length);if(!oe.mappings.has(Ye))return Ye}}let Ie=null;const Ge=[];let st=oe.fastCurieMap;const Xe=se.length-1;for(let tt=0;tt=0;--tt){const Ye=Ge[tt],Ue=Ye.terms;for(const ke of Ue){const Ke=ke+":"+se.substr(Ye.iri.length);oe.mappings.get(ke)._prefix&&(!oe.mappings.has(Ke)||null===te&&oe.mappings.get(Ke)["@id"]===se)&&(null===Ie||X(Ke,Ie)<0)&&(Ie=Ke)}}if(null!==Ie)return Ie;for(const[tt,Ye]of oe.mappings)if(Ye&&Ye._prefix&&se.startsWith(tt+":"))throw new W(`Absolute IRI "${se}" confused with prefix "${tt}".`,"jsonld.SyntaxError",{code:"IRI confused with prefix",context:oe});return Ce.vocab?se:"@base"in oe?oe["@base"]?K(ce(ne,oe["@base"]),se):se:K(ne,se)},E.compactValue=({activeCtx:oe,activeProperty:se,value:te,options:Ce})=>{if(x(te)){const Ie=S(oe,se,"@type"),Ge=S(oe,se,"@language"),st=S(oe,se,"@direction"),Xe=S(oe,se,"@container")||[],tt="@index"in te&&!Xe.includes("@index");if(!tt&&"@none"!==Ie&&(te["@type"]===Ie||"@language"in te&&te["@language"]===Ge&&"@direction"in te&&te["@direction"]===st||"@language"in te&&te["@language"]===Ge||"@direction"in te&&te["@direction"]===st))return te["@value"];const Ye=Object.keys(te).length,Ue=1===Ye||2===Ye&&"@index"in te&&!tt,ke="@language"in oe,Ke=Q(te["@value"]),Me=oe.mappings.has(se)&&null===oe.mappings.get(se)["@language"];if(Ue&&"@none"!==Ie&&(!ke||!Ke||Me))return te["@value"];const Ve={};return tt&&(Ve[E.compactIri({activeCtx:oe,iri:"@index",relativeTo:{vocab:!0}})]=te["@index"]),"@type"in te?Ve[E.compactIri({activeCtx:oe,iri:"@type",relativeTo:{vocab:!0}})]=E.compactIri({activeCtx:oe,iri:te["@type"],relativeTo:{vocab:!0}}):"@language"in te&&(Ve[E.compactIri({activeCtx:oe,iri:"@language",relativeTo:{vocab:!0}})]=te["@language"]),"@direction"in te&&(Ve[E.compactIri({activeCtx:oe,iri:"@direction",relativeTo:{vocab:!0}})]=te["@direction"]),Ve[E.compactIri({activeCtx:oe,iri:"@value",relativeTo:{vocab:!0}})]=te["@value"],Ve}const me=y(oe,se,{vocab:!0},Ce),ne=S(oe,se,"@type"),_e=E.compactIri({activeCtx:oe,iri:te["@id"],relativeTo:{vocab:"@vocab"===ne},base:Ce.base});return"@id"===ne||"@vocab"===ne||"@graph"===me?_e:{[E.compactIri({activeCtx:oe,iri:"@id",relativeTo:{vocab:!0}})]:_e}}},{"./JsonLdError":12,"./context":19,"./graphTypes":25,"./types":30,"./url":31,"./util":32}],18:[function(Y,Se,he){"use strict";const W="http://www.w3.org/1999/02/22-rdf-syntax-ns#",j="http://www.w3.org/2001/XMLSchema#";Se.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:j,XSD_BOOLEAN:j+"boolean",XSD_DOUBLE:j+"double",XSD_INTEGER:j+"integer",XSD_STRING:j+"string"}},{}],19:[function(Y,Se,he){"use strict";const W=Y("./util"),j=Y("./JsonLdError"),{isArray:P,isObject:Q,isString:z,isUndefined:v}=Y("./types"),{isAbsolute:x,isRelative:O,prependBase:A}=Y("./url"),{asArray:b,compareShortestLeast:y}=Y("./util"),S=new Map,V=/^@[a-zA-Z]+$/,R={};function K(D,I,X,E,$,Z){if(null===I||!z(I)||R.isKeyword(I))return I;if(I.match(V))return null;if(E&&E.hasOwnProperty(I)&&!0!==$.get(I)&&R.createTermDefinition({activeCtx:D,localCtx:E,term:I,defined:$,options:Z}),(X=X||{}).vocab){const se=D.mappings.get(I);if(null===se)return null;if(Q(se)&&"@id"in se)return se["@id"]}const oe=I.indexOf(":");if(oe>0){const se=I.substr(0,oe),te=I.substr(oe+1);if("_"===se||0===te.indexOf("//"))return I;E&&E.hasOwnProperty(se)&&R.createTermDefinition({activeCtx:D,localCtx:E,term:se,defined:$,options:Z});const Ce=D.mappings.get(se);if(Ce&&Ce._prefix)return Ce["@id"]+te;if(x(I))return I}if(X.vocab&&"@vocab"in D)return D["@vocab"]+I;if(X.base&&"@base"in D){if(D["@base"])return A(A(Z.base,D["@base"]),I)}else if(X.base)return A(Z.base,I);return I}function ce(D,I){if(!D||"object"!=typeof D||!I||"object"!=typeof I)return D===I;const X=Array.isArray(D);if(X!==Array.isArray(I))return!1;if(X){if(D.length!==I.length)return!1;for(let Z=0;Z{if(E.has(X)){if(E.get(X))return;throw new j("Cyclical context definition detected.","jsonld.CyclicalContext",{code:"cyclic IRI mapping",context:I,term:X})}let oe;if(E.set(X,!1),I.hasOwnProperty(X)&&(oe=I[X]),"@type"===X&&Q(oe)&&"@set"===(oe["@container"]||"@set")&&R.processingMode(D,1.1)){const Ie=["@container","@id","@protected"],Ge=Object.keys(oe);if(0===Ge.length||Ge.some(st=>!Ie.includes(st)))throw new j("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:I,term:X})}else{if(R.isKeyword(X))throw new j("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:I,term:X});if(X.match(V))return void console.warn('WARNING: terms beginning with "@" are reserved for future use and ignored',{term:X});if(""===X)throw new j("Invalid JSON-LD syntax; a term cannot be an empty string.","jsonld.SyntaxError",{code:"invalid term definition",context:I})}const se=D.mappings.get(X);D.mappings.has(X)&&D.mappings.delete(X);let te=!1;if((z(oe)||null===oe)&&(te=!0,oe={"@id":oe}),!Q(oe))throw new j("Invalid JSON-LD syntax; @context term values must be strings or objects.","jsonld.SyntaxError",{code:"invalid term definition",context:I});const Ce={};D.mappings.set(X,Ce),Ce.reverse=!1;const me=["@container","@id","@language","@reverse","@type"];R.processingMode(D,1.1)&&me.push("@context","@direction","@index","@nest","@prefix","@protected");for(const Ie in oe)if(!me.includes(Ie))throw new j("Invalid JSON-LD syntax; a term definition must not contain "+Ie,"jsonld.SyntaxError",{code:"invalid term definition",context:I});const ne=X.indexOf(":");if(Ce._termHasColon=ne>0,"@reverse"in oe){if("@id"in oe)throw new j("Invalid JSON-LD syntax; a @reverse term definition must not contain @id.","jsonld.SyntaxError",{code:"invalid reverse property",context:I});if("@nest"in oe)throw new j("Invalid JSON-LD syntax; a @reverse term definition must not contain @nest.","jsonld.SyntaxError",{code:"invalid reverse property",context:I});const Ie=oe["@reverse"];if(!z(Ie))throw new j("Invalid JSON-LD syntax; a @context @reverse value must be a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:I});if(!R.isKeyword(Ie)&&Ie.match(V))return console.warn('WARNING: values beginning with "@" are reserved for future use and ignored',{reverse:Ie}),void(se?D.mappings.set(X,se):D.mappings.delete(X));const Ge=K(D,Ie,{vocab:!0,base:!1},I,E,$);if(!x(Ge))throw new j("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});Ce["@id"]=Ge,Ce.reverse=!0}else if("@id"in oe){let Ie=oe["@id"];if(Ie&&!z(Ie))throw new j("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===Ie)Ce["@id"]=null;else{if(!R.isKeyword(Ie)&&Ie.match(V))return console.warn('WARNING: values beginning with "@" are reserved for future use and ignored',{id:Ie}),void(se?D.mappings.set(X,se):D.mappings.delete(X));if(Ie!==X){if(Ie=K(D,Ie,{vocab:!0,base:!1},I,E,$),!x(Ie)&&!R.isKeyword(Ie))throw new j("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(X.match(/(?::[^:])|\//)&&K(D,X,{vocab:!0,base:!1},I,new Map(E).set(X,!0),$)!==Ie)throw new j("Invalid JSON-LD syntax; term in form of IRI must expand to definition.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:I});Ce["@id"]=Ie,Ce._prefix=te&&!Ce._termHasColon&&Ie.match(/[:\/\?#\[\]@]$/)}}}if(!("@id"in Ce))if(Ce._termHasColon){const Ie=X.substr(0,ne);if(I.hasOwnProperty(Ie)&&R.createTermDefinition({activeCtx:D,localCtx:I,term:Ie,defined:E,options:$}),D.mappings.has(Ie)){const Ge=X.substr(ne+1);Ce["@id"]=D.mappings.get(Ie)["@id"]+Ge}else Ce["@id"]=X}else if("@type"===X)Ce["@id"]=X;else{if(!("@vocab"in D))throw new j("Invalid JSON-LD syntax; @context terms must define an @id.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:I,term:X});Ce["@id"]=D["@vocab"]+X}if((!0===oe["@protected"]||!0===E.get("@protected")&&!1!==oe["@protected"])&&(D.protected[X]=!0,Ce.protected=!0),E.set(X,!0),"@type"in oe){let Ie=oe["@type"];if(!z(Ie))throw new j("Invalid JSON-LD syntax; an @context @type value must be a string.","jsonld.SyntaxError",{code:"invalid type mapping",context:I});if("@json"===Ie||"@none"===Ie){if(R.processingMode(D,1))throw new j(`Invalid JSON-LD syntax; an @context @type value must not be "${Ie}" in JSON-LD 1.0 mode.`,"jsonld.SyntaxError",{code:"invalid type mapping",context:I})}else if("@id"!==Ie&&"@vocab"!==Ie){if(Ie=K(D,Ie,{vocab:!0,base:!1},I,E,$),!x(Ie))throw new j("Invalid JSON-LD syntax; an @context @type value must be an absolute IRI.","jsonld.SyntaxError",{code:"invalid type mapping",context:I});if(0===Ie.indexOf("_:"))throw new j("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})}Ce["@type"]=Ie}if("@container"in oe){const Ie=z(oe["@container"])?[oe["@container"]]:oe["@container"]||[],Ge=["@list","@set","@index","@language"];let st=!0;const Xe=Ie.includes("@set");if(R.processingMode(D,1.1)){if(Ge.push("@graph","@id","@type"),Ie.includes("@list")){if(1!==Ie.length)throw new j("Invalid JSON-LD syntax; @context @container with @list must have no other values","jsonld.SyntaxError",{code:"invalid container mapping",context:I})}else if(Ie.includes("@graph")){if(Ie.some(tt=>"@graph"!==tt&&"@id"!==tt&&"@index"!==tt&&"@set"!==tt))throw new j("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 st&=Ie.length<=(Xe?2:1);if(Ie.includes("@type")&&(Ce["@type"]=Ce["@type"]||"@id",!["@id","@vocab"].includes(Ce["@type"])))throw new j("Invalid JSON-LD syntax; container: @type requires @type to be @id or @vocab.","jsonld.SyntaxError",{code:"invalid type mapping",context:I})}else st&=!P(oe["@container"]),st&=Ie.length<=1;if(st&=Ie.every(tt=>Ge.includes(tt)),st&=!(Xe&&Ie.includes("@list")),!st)throw new j("Invalid JSON-LD syntax; @context @container value must be one of the following: "+Ge.join(", "),"jsonld.SyntaxError",{code:"invalid container mapping",context:I});if(Ce.reverse&&!Ie.every(tt=>["@index","@set"].includes(tt)))throw new j("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});Ce["@container"]=Ie}if("@index"in oe){if(!("@container"in oe)||!Ce["@container"].includes("@index"))throw new j(`Invalid JSON-LD syntax; @index without @index in @container: "${oe["@index"]}" on term "${X}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:I});if(!z(oe["@index"])||0===oe["@index"].indexOf("@"))throw new j(`Invalid JSON-LD syntax; @index must expand to an IRI: "${oe["@index"]}" on term "${X}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:I});Ce["@index"]=oe["@index"]}if("@context"in oe&&(Ce["@context"]=oe["@context"]),"@language"in oe&&!("@type"in oe)){let Ie=oe["@language"];if(null!==Ie&&!z(Ie))throw new j("Invalid JSON-LD syntax; @context @language value must be a string or null.","jsonld.SyntaxError",{code:"invalid language mapping",context:I});null!==Ie&&(Ie=Ie.toLowerCase()),Ce["@language"]=Ie}if("@prefix"in oe){if(X.match(/:|\//))throw new j("Invalid JSON-LD syntax; @context @prefix used on a compact IRI term","jsonld.SyntaxError",{code:"invalid term definition",context:I});if(R.isKeyword(Ce["@id"]))throw new j("Invalid JSON-LD syntax; keywords may not be used as prefixes","jsonld.SyntaxError",{code:"invalid term definition",context:I});if("boolean"!=typeof oe["@prefix"])throw new j("Invalid JSON-LD syntax; @context value for @prefix must be boolean","jsonld.SyntaxError",{code:"invalid @prefix value",context:I});Ce._prefix=!0===oe["@prefix"]}if("@direction"in oe){const Ie=oe["@direction"];if(null!==Ie&&"ltr"!==Ie&&"rtl"!==Ie)throw new j('Invalid JSON-LD syntax; @direction value must be null, "ltr", or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",context:I});Ce["@direction"]=Ie}if("@nest"in oe){const Ie=oe["@nest"];if(!z(Ie)||"@nest"!==Ie&&0===Ie.indexOf("@"))throw new j("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});Ce["@nest"]=Ie}const _e=Ce["@id"];if("@context"===_e||"@preserve"===_e)throw new j("Invalid JSON-LD syntax; @context and @preserve cannot be aliased.","jsonld.SyntaxError",{code:"invalid keyword alias",context:I});if(se&&se.protected&&!Z&&(D.protected[X]=!0,Ce.protected=!0,!ce(se,Ce))){const Ie=$&&$.protectedMode||"error";if("error"===Ie)throw new j(`Invalid JSON-LD syntax; tried to redefine "${X}" which is a protected term.`,"jsonld.SyntaxError",{code:"protected term redefinition",context:I,term:X});if("warn"===Ie)return void console.warn("WARNING: protected term redefinition",{term:X});throw new j("Invalid protectedMode.","jsonld.SyntaxError",{code:"invalid protected mode",context:I,term:X,protectedMode:Ie})}},R.expandIri=(D,I,X,E)=>K(D,I,X,void 0,void 0,E),R.getInitialContext=D=>{const I=JSON.stringify({processingMode:D.processingMode}),X=S.get(I);if(X)return X;const E={processingMode:D.processingMode,mappings:new Map,inverse:null,getInverse:function(){const Ce=this;if(Ce.inverse)return Ce.inverse;const me=Ce.inverse={},ne=Ce.fastCurieMap={},_e={},Ie=(Ce["@language"]||"@none").toLowerCase(),Ge=Ce["@direction"],st=Ce.mappings,Xe=[...st.keys()].sort(y);for(const tt of Xe){const Ye=st.get(tt);if(null===Ye)continue;let Ue=Ye["@container"]||"@none";if(Ue=[].concat(Ue).sort().join(""),null===Ye["@id"])continue;const ke=b(Ye["@id"]);for(const Ke of ke){let Me=me[Ke];const Ve=R.isKeyword(Ke);if(Me)!Ve&&!Ye._termHasColon&&_e[Ke].push(tt);else if(me[Ke]=Me={},!Ve&&!Ye._termHasColon){_e[Ke]=[tt];const $e={iri:Ke,terms:_e[Ke]};Ke[0]in ne?ne[Ke[0]].push($e):ne[Ke[0]]=[$e]}if(Me[Ue]||(Me[Ue]={"@language":{},"@type":{},"@any":{}}),Me=Me[Ue],oe(tt,Me["@any"],"@none"),Ye.reverse)oe(tt,Me["@type"],"@reverse");else if("@none"===Ye["@type"])oe(tt,Me["@any"],"@none"),oe(tt,Me["@language"],"@none"),oe(tt,Me["@type"],"@none");else if("@type"in Ye)oe(tt,Me["@type"],Ye["@type"]);else if("@language"in Ye&&"@direction"in Ye){const $e=Ye["@language"],Ne=Ye["@direction"];oe(tt,Me["@language"],$e&&Ne?`${$e}_${Ne}`.toLowerCase():$e?$e.toLowerCase():Ne?`_${Ne}`:"@null")}else"@language"in Ye?oe(tt,Me["@language"],(Ye["@language"]||"@null").toLowerCase()):"@direction"in Ye?oe(tt,Me["@language"],Ye["@direction"]?`_${Ye["@direction"]}`:"@none"):Ge?(oe(tt,Me["@language"],`_${Ge}`),oe(tt,Me["@language"],"@none"),oe(tt,Me["@type"],"@none")):(oe(tt,Me["@language"],Ie),oe(tt,Me["@language"],"@none"),oe(tt,Me["@type"],"@none"))}}for(const tt in ne)Z(ne,tt,1);return me},clone:function(){const Ce={};return Ce.mappings=W.clone(this.mappings),Ce.clone=this.clone,Ce.inverse=null,Ce.getInverse=this.getInverse,Ce.protected=W.clone(this.protected),this.previousContext&&(Ce.previousContext=this.previousContext.clone()),Ce.revertToPreviousContext=this.revertToPreviousContext,"@base"in this&&(Ce["@base"]=this["@base"]),"@language"in this&&(Ce["@language"]=this["@language"]),"@vocab"in this&&(Ce["@vocab"]=this["@vocab"]),Ce},revertToPreviousContext:function(){return this.previousContext?this.previousContext.clone():this},protected:{}};return 1e4===S.size&&S.clear(),S.set(I,E),E;function Z(Ce,me,ne){const _e=Ce[me],Ie=Ce[me]={};let Ge,st;for(const Xe of _e)Ge=Xe.iri,st=ne>=Ge.length?"":Ge[ne],st in Ie?Ie[st].push(Xe):Ie[st]=[Xe];for(const Xe in Ie)""!==Xe&&Z(Ie,Xe,ne+1)}function oe(Ce,me,ne){me.hasOwnProperty(ne)||(me[ne]=Ce)}},R.getContextValue=(D,I,X)=>{if(null===I)return"@context"===X?void 0:null;if(D.mappings.has(I)){const E=D.mappings.get(I);if(v(X))return E;if(E.hasOwnProperty(X))return E[X]}return"@language"===X&&X in D||"@direction"===X&&X in D?D[X]:"@context"!==X?null:void 0},R.processingMode=(D,I)=>I.toString()>="1.1"?!D.processingMode||D.processingMode>="json-ld-"+I.toString():"json-ld-1.0"===D.processingMode,R.isKeyword=D=>{if(!z(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(Y,Se,he){"use strict";const{parseLinkHeader:W,buildHeaders:j}=Y("../util"),{LINK_HEADER_CONTEXT:P}=Y("../constants"),Q=Y("../JsonLdError"),z=Y("../RequestQueue"),{prependBase:v}=Y("../url"),x=/(^|(\r\n))link:/i;function O(A,b,y){const S=new(A=A||XMLHttpRequest);return new Promise((T,V)=>{S.onload=()=>T(S),S.onerror=R=>V(R),S.open("GET",b,!0);for(const R in y)S.setRequestHeader(R,y[R]);S.send()})}Se.exports=({secure:A,headers:b={},xhr:y}={headers:{}})=>{return b=j(b),(new z).wrapLoader(T);function T(R){return V.apply(this,arguments)}function V(){return(V=yt(function*(R){if(0!==R.indexOf("http:")&&0!==R.indexOf("https:"))throw new Q('URL could not be dereferenced; only "http" and "https" URLs are supported.',"jsonld.InvalidUrl",{code:"loading document failed",url:R});if(A&&0!==R.indexOf("https"))throw new Q('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 K;try{K=yield O(y,R,b)}catch(E){throw new Q("URL could not be dereferenced, an error occurred.","jsonld.LoadDocumentError",{code:"loading document failed",url:R,cause:E})}if(K.status>=400)throw new Q("URL could not be dereferenced: "+K.statusText,"jsonld.LoadDocumentError",{code:"loading document failed",url:R,httpStatusCode:K.status});let ce={contextUrl:null,documentUrl:R,document:K.response},D=null;const I=K.getResponseHeader("Content-Type");let X;if(x.test(K.getAllResponseHeaders())&&(X=K.getResponseHeader("Link")),X&&"application/ld+json"!==I){const E=W(X),$=E[P];if(Array.isArray($))throw new Q("URL could not be dereferenced, it has more than one associated HTTP Link Header.","jsonld.InvalidUrl",{code:"multiple context link headers",url:R});$&&(ce.contextUrl=$.target),D=E.alternate,D&&"application/ld+json"==D.type&&!(I||"").match(/^application\/(\w*\+)?json$/)&&(ce=yield T(v(R,D.target)))}return ce})).apply(this,arguments)}}},{"../JsonLdError":12,"../RequestQueue":15,"../constants":18,"../url":31,"../util":32}],21:[function(Y,Se,he){"use strict";const W=Y("./JsonLdError"),{isArray:j,isObject:P,isEmptyObject:Q,isString:z,isUndefined:v}=Y("./types"),{isList:x,isValue:O,isGraph:A,isSubject:b}=Y("./graphTypes"),{expandIri:y,getContextValue:S,isKeyword:T,process:V,processingMode:R}=Y("./context"),{isAbsolute:K}=Y("./url"),{addValue:ce,asArray:D,getValues:I,validateTypeValue:X}=Y("./util"),E={};Se.exports=E;const $=/^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$/;function Z(ne){return oe.apply(this,arguments)}function oe(){return(oe=yt(function*({activeCtx:ne,activeProperty:_e,expandedActiveProperty:Ie,element:Ge,expandedParent:st,options:Xe={},insideList:tt,typeKey:Ye,typeScopedContext:Ue,expansionMap:ke}){const Ke=Object.keys(Ge).sort(),Me=[];let Ve;const $e=Ge[Ye]&&"@json"===y(ne,j(Ge[Ye])?Ge[Ye][0]:Ge[Ye],{vocab:!0},Xe);for(const Ne of Ke){let G,q=Ge[Ne];if("@context"===Ne)continue;let pe=y(ne,Ne,{vocab:!0},Xe);if((null===pe||!K(pe)&&!T(pe))&&(pe=ke({unmappedProperty:Ne,activeCtx:ne,activeProperty:_e,parent:Ge,options:Xe,insideList:tt,value:q,expandedParent:st}),void 0===pe))continue;if(T(pe)){if("@reverse"===Ie)throw new W("Invalid JSON-LD syntax; a keyword cannot be used as a @reverse property.","jsonld.SyntaxError",{code:"invalid reverse property map",value:q});if(pe in st&&"@included"!==pe&&"@type"!==pe)throw new W("Invalid JSON-LD syntax; colliding keywords detected.","jsonld.SyntaxError",{code:"colliding keywords",keyword:pe})}if("@id"===pe){if(!z(q)){if(!Xe.isFrame)throw new W('Invalid JSON-LD syntax; "@id" value must a string.',"jsonld.SyntaxError",{code:"invalid @id value",value:q});if(P(q)){if(!Q(q))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:q})}else{if(!j(q))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:q});if(!q.every(pt=>z(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:q})}}ce(st,"@id",D(q).map(pt=>z(pt)?y(ne,pt,{base:!0},Xe):pt),{propertyIsArray:Xe.isFrame});continue}if("@type"===pe){P(q)&&(q=Object.fromEntries(Object.entries(q).map(([pt,ve])=>[y(Ue,pt,{vocab:!0}),D(ve).map(L=>y(Ue,L,{base:!0,vocab:!0}))]))),X(q,Xe.isFrame),ce(st,"@type",D(q).map(pt=>z(pt)?y(Ue,pt,{base:!0,vocab:!0},Xe):pt),{propertyIsArray:Xe.isFrame});continue}if("@included"===pe&&R(ne,1.1)){const pt=D(yield E.expand({activeCtx:ne,activeProperty:_e,element:q,options:Xe,expansionMap:ke}));if(!pt.every(ve=>b(ve)))throw new W("Invalid JSON-LD syntax; values of @included must expand to node objects.","jsonld.SyntaxError",{code:"invalid @included value",value:q});ce(st,"@included",pt,{propertyIsArray:!0});continue}if("@graph"===pe&&!P(q)&&!j(q))throw new W('Invalid JSON-LD syntax; "@graph" value must not be an object or an array.',"jsonld.SyntaxError",{code:"invalid @graph value",value:q});if("@value"===pe){Ve=q,$e&&R(ne,1.1)?st["@value"]=q:ce(st,"@value",q,{propertyIsArray:Xe.isFrame});continue}if("@language"===pe){if(null===q)continue;if(!z(q)&&!Xe.isFrame)throw new W('Invalid JSON-LD syntax; "@language" value must be a string.',"jsonld.SyntaxError",{code:"invalid language-tagged string",value:q});q=D(q).map(pt=>z(pt)?pt.toLowerCase():pt);for(const pt of q)z(pt)&&!pt.match($)&&console.warn(`@language must be valid BCP47: ${pt}`);ce(st,"@language",q,{propertyIsArray:Xe.isFrame});continue}if("@direction"===pe){if(!z(q)&&!Xe.isFrame)throw new W('Invalid JSON-LD syntax; "@direction" value must be a string.',"jsonld.SyntaxError",{code:"invalid base direction",value:q});q=D(q);for(const pt of q)if(z(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:q});ce(st,"@direction",q,{propertyIsArray:Xe.isFrame});continue}if("@index"===pe){if(!z(q))throw new W('Invalid JSON-LD syntax; "@index" value must be a string.',"jsonld.SyntaxError",{code:"invalid @index value",value:q});ce(st,"@index",q);continue}if("@reverse"===pe){if(!P(q))throw new W('Invalid JSON-LD syntax; "@reverse" value must be an object.',"jsonld.SyntaxError",{code:"invalid @reverse value",value:q});if(G=yield E.expand({activeCtx:ne,activeProperty:"@reverse",element:q,options:Xe,expansionMap:ke}),"@reverse"in G)for(const ve in G["@reverse"])ce(st,ve,G["@reverse"][ve],{propertyIsArray:!0});let pt=st["@reverse"]||null;for(const ve in G){if("@reverse"===ve)continue;null===pt&&(pt=st["@reverse"]={}),ce(pt,ve,[],{propertyIsArray:!0});const L=G[ve];for(let N=0;N"@id"===pt||"@index"===pt)&&(G=D(G).map(pt=>({"@graph":D(pt)}))),ue.mappings.has(Ne)&&ue.mappings.get(Ne).reverse){const pt=st["@reverse"]=st["@reverse"]||{};G=D(G);for(let ve=0;ve"@value"===y(ne,pe,{vocab:!0},Xe)))throw new W("Invalid JSON-LD syntax; nested value must be a node object.","jsonld.SyntaxError",{code:"invalid @nest value",value:G});yield Z({activeCtx:ne,activeProperty:_e,expandedActiveProperty:Ie,element:G,expandedParent:st,options:Xe,insideList:tt,typeScopedContext:Ue,typeKey:Ye,expansionMap:ke})}}})).apply(this,arguments)}function se({activeCtx:ne,activeProperty:_e,value:Ie,options:Ge}){if(null==Ie)return null;const st=y(ne,_e,{vocab:!0},Ge);if("@id"===st)return y(ne,Ie,{base:!0},Ge);if("@type"===st)return y(ne,Ie,{vocab:!0,base:!0},Ge);const Xe=S(ne,_e,"@type");if(("@id"===Xe||"@graph"===st)&&z(Ie))return{"@id":y(ne,Ie,{base:!0},Ge)};if("@vocab"===Xe&&z(Ie))return{"@id":y(ne,Ie,{vocab:!0,base:!0},Ge)};if(T(st))return Ie;const tt={};if(Xe&&!["@id","@vocab","@none"].includes(Xe))tt["@type"]=Xe;else if(z(Ie)){const Ye=S(ne,_e,"@language");null!==Ye&&(tt["@language"]=Ye);const Ue=S(ne,_e,"@direction");null!==Ue&&(tt["@direction"]=Ue)}return["boolean","number","string"].includes(typeof Ie)||(Ie=Ie.toString()),tt["@value"]=Ie,tt}function te(ne,_e,Ie,Ge){const st=[],Xe=Object.keys(_e).sort();for(const tt of Xe){const Ye=y(ne,tt,{vocab:!0},Ge);let Ue=_e[tt];j(Ue)||(Ue=[Ue]);for(const ke of Ue){if(null===ke)continue;if(!z(ke))throw new W("Invalid JSON-LD syntax; language map values must be strings.","jsonld.SyntaxError",{code:"invalid language map value",languageMap:_e});const Ke={"@value":ke};"@none"!==Ye&&(Ke["@language"]=tt.toLowerCase()),Ie&&(Ke["@direction"]=Ie),st.push(Ke)}}return st}function Ce(ne){return me.apply(this,arguments)}function me(){return(me=yt(function*({activeCtx:ne,options:_e,activeProperty:Ie,value:Ge,expansionMap:st,asGraph:Xe,indexKey:tt,propertyIndex:Ye}){const Ue=[],ke=Object.keys(Ge).sort(),Ke="@type"===tt;for(let Me of ke){if(Ke){const Ne=S(ne,Me,"@context");v(Ne)||(ne=yield V({activeCtx:ne,localCtx:Ne,propagate:!1,options:_e}))}let $e,Ve=Ge[Me];j(Ve)||(Ve=[Ve]),Ve=yield E.expand({activeCtx:ne,activeProperty:Ie,element:Ve,options:_e,insideList:!1,insideIndex:!0,expansionMap:st}),$e=Ye?"@none"===Me?"@none":se({activeCtx:ne,activeProperty:tt,value:Me,options:_e}):y(ne,Me,{vocab:!0},_e),"@id"===tt?Me=y(ne,Me,{base:!0},_e):Ke&&(Me=$e);for(let Ne of Ve){if(Xe&&!A(Ne)&&(Ne={"@graph":[Ne]}),"@type"===tt)"@none"===$e||(Ne["@type"]=Ne["@type"]?[Me].concat(Ne["@type"]):[Me]);else{if(O(Ne)&&!["@language","@type","@index"].includes(tt))throw new W(`Invalid JSON-LD syntax; Attempt to add illegal key to value object: "${tt}".`,"jsonld.SyntaxError",{code:"invalid value object",value:Ne});Ye?"@none"!==$e&&ce(Ne,Ye,$e,{propertyIsArray:!0,prependValue:!0}):"@none"!==$e&&!(tt in Ne)&&(Ne[tt]=Me)}Ue.push(Ne)}}return Ue})).apply(this,arguments)}E.expand=function(){var ne=yt(function*({activeCtx:_e,activeProperty:Ie=null,element:Ge,options:st={},insideList:Xe=!1,insideIndex:tt=!1,typeScopedContext:Ye=null,expansionMap:Ue=(()=>{})}){if(null==Ge)return null;if("@default"===Ie&&(st=Object.assign({},st,{isFrame:!1})),!j(Ge)&&!P(Ge)){if(!Xe&&(null===Ie||"@graph"===y(_e,Ie,{vocab:!0},st))){const G=yield Ue({unmappedValue:Ge,activeCtx:_e,activeProperty:Ie,options:st,insideList:Xe});return void 0===G?null:G}return se({activeCtx:_e,activeProperty:Ie,value:Ge,options:st})}if(j(Ge)){let G=[];const pe=S(_e,Ie,"@container")||[];Xe=Xe||pe.includes("@list");for(let ue=0;ue1?ue.slice().sort():ue:[ue];for(const _t of je){const pt=S(Ye,_t,"@context");v(pt)||(_e=yield V({activeCtx:_e,localCtx:pt,options:st,propagate:!1}))}}let Ne={};yield Z({activeCtx:_e,activeProperty:Ie,expandedActiveProperty:ke,element:Ge,expandedParent:Ne,options:st,insideList:Xe,typeKey:$e,typeScopedContext:Ye,expansionMap:Ue}),Me=Object.keys(Ne);let q=Me.length;if("@value"in Ne){if("@type"in Ne&&("@language"in Ne||"@direction"in Ne))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:Ne});let G=q-1;if("@type"in Ne&&(G-=1),"@index"in Ne&&(G-=1),"@language"in Ne&&(G-=1),"@direction"in Ne&&(G-=1),0!==G)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:Ne});const pe=null===Ne["@value"]?[]:D(Ne["@value"]),ue=I(Ne,"@type");if(!R(_e,1.1)||!ue.includes("@json")||1!==ue.length)if(0===pe.length){const je=yield Ue({unmappedValue:Ne,activeCtx:_e,activeProperty:Ie,element:Ge,options:st,insideList:Xe});Ne=void 0!==je?je:null}else{if(!pe.every(je=>z(je)||Q(je))&&"@language"in Ne)throw new W("Invalid JSON-LD syntax; only strings may be language-tagged.","jsonld.SyntaxError",{code:"invalid language-tagged value",element:Ne});if(!ue.every(je=>K(je)&&!(z(je)&&0===je.indexOf("_:"))||Q(je)))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:Ne})}}else if("@type"in Ne&&!j(Ne["@type"]))Ne["@type"]=[Ne["@type"]];else if("@set"in Ne||"@list"in Ne){if(q>1&&(2!==q||!("@index"in Ne)))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:Ne});"@set"in Ne&&(Ne=Ne["@set"],Me=Object.keys(Ne),q=Me.length)}else if(1===q&&"@language"in Ne){const G=yield Ue(Ne,{unmappedValue:Ne,activeCtx:_e,activeProperty:Ie,element:Ge,options:st,insideList:Xe});Ne=void 0!==G?G:null}if(P(Ne)&&!st.keepFreeFloatingNodes&&!Xe&&(null===Ie||"@graph"===ke)&&(0===q||"@value"in Ne||"@list"in Ne||1===q&&"@id"in Ne)){const G=yield Ue({unmappedValue:Ne,activeCtx:_e,activeProperty:Ie,element:Ge,options:st,insideList:Xe});Ne=void 0!==G?G:null}return Ne});return function(_e){return ne.apply(this,arguments)}}()},{"./JsonLdError":12,"./context":19,"./graphTypes":25,"./types":30,"./url":31,"./util":32}],22:[function(Y,Se,he){"use strict";const{isSubjectReference:W}=Y("./graphTypes"),{createMergedNodeMap:j}=Y("./nodeMap"),P={};Se.exports=P,P.flatten=Q=>{const z=j(Q),v=[],x=Object.keys(z).sort();for(let O=0;O=0;--oe){const se=Z[oe];if(se.graph===$&&se.subject["@id"]===E["@id"])return!0}return!1}function S(E,$,Z){const oe="@"+Z;let se=oe in E?E[oe][0]:$[Z];if("embed"===Z)if(!0===se)se="@once";else if(!1===se)se="@never";else if("@always"!==se&&"@never"!==se&&"@link"!==se&&"@first"!==se&&"@last"!==se&&"@once"!==se)throw new v("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:E});return se}function T(E){if(!P.isArray(E)||1!==E.length||!P.isObject(E[0]))throw new v("Invalid JSON-LD syntax; a JSON-LD frame must be a single object.","jsonld.SyntaxError",{frame:E});if("@id"in E[0])for(const $ of Q.asArray(E[0]["@id"]))if(!P.isObject($)&&!z.isAbsolute($)||P.isString($)&&0===$.indexOf("_:"))throw new v("Invalid JSON-LD syntax; invalid @id in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:E});if("@type"in E[0])for(const $ of Q.asArray(E[0]["@type"]))if(!P.isObject($)&&!z.isAbsolute($)||P.isString($)&&0===$.indexOf("_:"))throw new v("Invalid JSON-LD syntax; invalid @type in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:E})}function R(E,$,Z,oe){let se=!0,te=!1;for(const Ce in Z){let me=!1;const ne=Q.getValues($,Ce),_e=0===Q.getValues(Z,Ce).length;if("@id"===Ce){if(P.isEmptyObject(Z["@id"][0]||{})?me=!0:Z["@id"].length>=0&&(me=Z["@id"].includes(ne[0])),!oe.requireAll)return me}else if("@type"===Ce){if(se=!1,_e){if(ne.length>0)return!1;me=!0}else if(1===Z["@type"].length&&P.isEmptyObject(Z["@type"][0]))me=ne.length>0;else for(const Ie of Z["@type"])me=!(!P.isObject(Ie)||!("@default"in Ie))||me||ne.some(Ge=>Ge===Ie);if(!oe.requireAll)return me}else{if(W(Ce))continue;{const Ie=Q.getValues(Z,Ce)[0];let Ge=!1;if(Ie&&(T([Ie]),Ge="@default"in Ie),se=!1,0===ne.length&&Ge)continue;if(ne.length>0&&_e)return!1;if(void 0===Ie){if(ne.length>0)return!1;me=!0}else if(j.isList(Ie)){const st=Ie["@list"][0];if(j.isList(ne[0])){const Xe=ne[0]["@list"];j.isValue(st)?me=Xe.some(tt=>X(st,tt)):(j.isSubject(st)||j.isSubjectReference(st))&&(me=Xe.some(tt=>I(E,st,tt,oe)))}}else me=j.isValue(Ie)?ne.some(st=>X(Ie,st)):j.isSubjectReference(Ie)?ne.some(st=>I(E,Ie,st,oe)):!!P.isObject(Ie)&&ne.length>0}}if(!me&&oe.requireAll)return!1;te=te||me}return se||te}function K(E,$){const Z=E.uniqueEmbeds[E.graph],oe=Z[$],se=oe.parent,te=oe.property,Ce={"@id":$};if(P.isArray(se)){for(let ne=0;ne{const _e=Object.keys(Z);for(const Ie of _e)Ie in Z&&P.isObject(Z[Ie].parent)&&Z[Ie].parent["@id"]===ne&&(delete Z[Ie],me(Ie))};me($)}function ce(E,$){if(P.isArray(E))return E.map(Z=>ce(Z,$));if(P.isObject(E)){if("@preserve"in E)return E["@preserve"][0];if(j.isValue(E))return E;if(j.isList(E))return E["@list"]=ce(E["@list"],$),E;if("@id"in E){const Z=E["@id"];if($.link.hasOwnProperty(Z)){const oe=$.link[Z].indexOf(E);if(-1!==oe)return $.link[Z][oe];$.link[Z].push(E)}else $.link[Z]=[E]}for(const Z in E)"@id"===Z&&$.bnodesToClear.includes(E[Z])?delete E["@id"]:E[Z]=ce(E[Z],$)}return E}function D(E,$,Z){P.isObject(E)?Q.addValue(E,$,Z,{propertyIsArray:!0}):E.push(Z)}function I(E,$,Z,oe){if(!("@id"in Z))return!1;const se=E.subjects[Z["@id"]];return se&&R(E,se,$,oe)}function X(E,$){const Z=$["@value"],oe=$["@type"],se=$["@language"],te=E["@value"]?P.isArray(E["@value"])?E["@value"]:[E["@value"]]:[],Ce=E["@type"]?P.isArray(E["@type"])?E["@type"]:[E["@type"]]:[],me=E["@language"]?P.isArray(E["@language"])?E["@language"]:[E["@language"]]:[];return 0===te.length&&0===Ce.length&&0===me.length||!(!te.includes(Z)&&!P.isEmptyObject(te[0])||!(!oe&&0===Ce.length||Ce.includes(oe)||oe&&P.isEmptyObject(Ce[0]))||!(!se&&0===me.length||me.includes(se)||se&&P.isEmptyObject(me[0])))}Se.exports=A,A.frameMergedOrDefault=(E,$,Z)=>{const oe={options:Z,embedded:!1,graph:"@default",graphMap:{"@default":{}},subjectStack:[],link:{},bnodeMap:{}},se=new Q.IdentifierIssuer("_:b");x(E,oe.graphMap,"@default",se),Z.merged&&(oe.graphMap["@merged"]=O(oe.graphMap),oe.graph="@merged"),oe.subjects=oe.graphMap[oe.graph];const te=[];return A.frame(oe,Object.keys(oe.subjects).sort(),$,te),Z.pruneBlankNodeIdentifiers&&(Z.bnodesToClear=Object.keys(oe.bnodeMap).filter(Ce=>1===oe.bnodeMap[Ce].length)),Z.link={},ce(te,Z)},A.frame=(E,$,Z,oe,se=null)=>{T(Z);const te=E.options,Ce={embed:S(Z=Z[0],te,"embed"),explicit:S(Z,te,"explicit"),requireAll:S(Z,te,"requireAll")};E.link.hasOwnProperty(E.graph)||(E.link[E.graph]={});const me=E.link[E.graph],ne=function(E,$,Z,oe){const se={};for(const te of $){const Ce=E.graphMap[E.graph][te];R(E,Ce,Z,oe)&&(se[te]=Ce)}return se}(E,$,Z,Ce),_e=Object.keys(ne).sort();for(const Ie of _e){const Ge=ne[Ie];if(null===se?E.uniqueEmbeds={[E.graph]:{}}:E.uniqueEmbeds[E.graph]=E.uniqueEmbeds[E.graph]||{},"@link"===Ce.embed&&Ie in me){D(oe,se,me[Ie]);continue}const st={"@id":Ie};if(0===Ie.indexOf("_:")&&Q.addValue(E.bnodeMap,Ie,st,{propertyIsArray:!0}),me[Ie]=st,("@first"===Ce.embed||"@last"===Ce.embed)&&E.is11)throw new v("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:Z});if(E.embedded||!E.uniqueEmbeds[E.graph].hasOwnProperty(Ie)){if(E.embedded&&("@never"===Ce.embed||y(Ge,E.graph,E.subjectStack))){D(oe,se,st);continue}if(E.embedded&&("@first"==Ce.embed||"@once"==Ce.embed)&&E.uniqueEmbeds[E.graph].hasOwnProperty(Ie)){D(oe,se,st);continue}if("@last"===Ce.embed&&Ie in E.uniqueEmbeds[E.graph]&&K(E,Ie),E.uniqueEmbeds[E.graph][Ie]={parent:oe,property:se},E.subjectStack.push({subject:Ge,graph:E.graph}),Ie in E.graphMap){let Xe=!1,tt=null;"@graph"in Z?(tt=Z["@graph"][0],Xe=!("@merged"===Ie||"@default"===Ie),P.isObject(tt)||(tt={})):(Xe="@merged"!==E.graph,tt={}),Xe&&A.frame(Cn(ot({},E),{graph:Ie,embedded:!1}),Object.keys(E.graphMap[Ie]).sort(),[tt],st,"@graph")}"@included"in Z&&A.frame(Cn(ot({},E),{embedded:!1}),$,Z["@included"],st,"@included");for(const Xe of Object.keys(Ge).sort())if(W(Xe)){if(st[Xe]=Q.clone(Ge[Xe]),"@type"===Xe)for(const tt of Ge["@type"])0===tt.indexOf("_:")&&Q.addValue(E.bnodeMap,tt,st,{propertyIsArray:!0})}else if(!Ce.explicit||Xe in Z)for(const tt of Ge[Xe]){const Ye=Xe in Z?Z[Xe]:b(Ce);if(j.isList(tt)){const Ue=Z[Xe]&&Z[Xe][0]&&Z[Xe][0]["@list"]?Z[Xe][0]["@list"]:b(Ce),ke={"@list":[]};D(st,Xe,ke);const Ke=tt["@list"];for(const Me of Ke)j.isSubjectReference(Me)?A.frame(Cn(ot({},E),{embedded:!0}),[Me["@id"]],Ue,ke,"@list"):D(ke,"@list",Q.clone(Me))}else j.isSubjectReference(tt)?A.frame(Cn(ot({},E),{embedded:!0}),[tt["@id"]],Ye,st,Xe):X(Ye[0],tt)&&D(st,Xe,Q.clone(tt))}for(const Xe of Object.keys(Z).sort()){if("@type"===Xe){if(!P.isObject(Z[Xe][0])||!("@default"in Z[Xe][0]))continue}else if(W(Xe))continue;const tt=Z[Xe][0]||{};if(!S(tt,te,"omitDefault")&&!(Xe in st)){let Ue="@null";"@default"in tt&&(Ue=Q.clone(tt["@default"])),P.isArray(Ue)||(Ue=[Ue]),st[Xe]=[{"@preserve":Ue}]}}for(const Xe of Object.keys(Z["@reverse"]||{}).sort()){const tt=Z["@reverse"][Xe];for(const Ye of Object.keys(E.subjects))Q.getValues(E.subjects[Ye],Xe).some(ke=>ke["@id"]===Ie)&&(st["@reverse"]=st["@reverse"]||{},Q.addValue(st["@reverse"],Xe,[],{propertyIsArray:!0}),A.frame(Cn(ot({},E),{embedded:!0}),[Ye],tt,st["@reverse"][Xe],se))}D(oe,se,st),E.subjectStack.pop()}}},A.cleanupNull=(E,$)=>{if(P.isArray(E))return E.map(oe=>A.cleanupNull(oe,$)).filter(oe=>oe);if("@null"===E)return null;if(P.isObject(E)){if("@id"in E){const Z=E["@id"];if($.link.hasOwnProperty(Z)){const oe=$.link[Z].indexOf(E);if(-1!==oe)return $.link[Z][oe];$.link[Z].push(E)}else $.link[Z]=[E]}for(const Z in E)E[Z]=A.cleanupNull(E[Z],$)}return E}},{"./JsonLdError":12,"./context":19,"./graphTypes":25,"./nodeMap":27,"./types":30,"./url":31,"./util":32}],24:[function(Y,Se,he){"use strict";const W=Y("./JsonLdError"),j=Y("./graphTypes"),P=Y("./types"),Q=Y("./util"),{RDF_LIST:z,RDF_FIRST:v,RDF_REST:x,RDF_NIL:O,RDF_TYPE:A,RDF_JSON_LITERAL:b,XSD_BOOLEAN:y,XSD_DOUBLE:S,XSD_INTEGER:T,XSD_STRING:V}=Y("./constants"),R=/^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$/,K={};function ce(D,I,X){if(D.termType.endsWith("Node"))return{"@id":D.value};const E={"@value":D.value};if(D.language)E["@language"]=D.language;else{let $=D.datatype.value;if($||($=V),$===b){$="@json";try{E["@value"]=JSON.parse(E["@value"])}catch(Z){throw new W("JSON literal could not be parsed.","jsonld.InvalidJsonLiteral",{code:"invalid JSON literal",value:E["@value"],cause:Z})}}if(I){if($===y)"true"===E["@value"]?E["@value"]=!0:"false"===E["@value"]&&(E["@value"]=!1);else if(P.isNumeric(E["@value"]))if($===T){const Z=parseInt(E["@value"],10);Z.toFixed(0)===E["@value"]&&(E["@value"]=Z)}else $===S&&(E["@value"]=parseFloat(E["@value"]));[y,T,S,V].includes($)||(E["@type"]=$)}else if("i18n-datatype"===X&&$.startsWith("https://www.w3.org/ns/i18n#")){const[,Z,oe]=$.split(/[#_]/);Z.length>0&&(E["@language"]=Z,Z.match(R)||console.warn(`@language must be valid BCP47: ${Z}`)),E["@direction"]=oe}else $!==V&&(E["@type"]=$)}return E}Se.exports=K,K.fromRDF=function(){var D=yt(function*(I,{useRdfType:X=!1,useNativeTypes:E=!1,rdfDirection:$=null}){const Z={},oe={"@default":Z},se={};for(const me of I){const ne="DefaultGraph"===me.graph.termType?"@default":me.graph.value;ne in oe||(oe[ne]={}),"@default"!==ne&&!(ne in Z)&&(Z[ne]={"@id":ne});const _e=oe[ne],Ie=me.subject.value,Ge=me.predicate.value,st=me.object;Ie in _e||(_e[Ie]={"@id":Ie});const Xe=_e[Ie],tt=st.termType.endsWith("Node");if(tt&&!(st.value in _e)&&(_e[st.value]={"@id":st.value}),Ge===A&&!X&&tt){Q.addValue(Xe,"@type",st.value,{propertyIsArray:!0});continue}const Ye=ce(st,E,$);if(Q.addValue(Xe,Ge,Ye,{propertyIsArray:!0}),tt)if(st.value===O){const Ue=_e[st.value];"usages"in Ue||(Ue.usages=[]),Ue.usages.push({node:Xe,property:Ge,value:Ye})}else se[st.value]=!(st.value in se)&&{node:Xe,property:Ge,value:Ye}}for(const me in oe){const ne=oe[me];if(!(O in ne))continue;const _e=ne[O];if(_e.usages){for(let Ie of _e.usages){let Ge=Ie.node,st=Ie.property,Xe=Ie.value;const tt=[],Ye=[];let Ue=Object.keys(Ge).length;for(;st===x&&P.isObject(se[Ge["@id"]])&&P.isArray(Ge[v])&&1===Ge[v].length&&P.isArray(Ge[x])&&1===Ge[x].length&&(3===Ue||4===Ue&&P.isArray(Ge["@type"])&&1===Ge["@type"].length&&Ge["@type"][0]===z)&&(tt.push(Ge[v][0]),Ye.push(Ge["@id"]),Ie=se[Ge["@id"]],Ge=Ie.node,st=Ie.property,Xe=Ie.value,Ue=Object.keys(Ge).length,j.isBlankNode(Ge)););delete Xe["@id"],Xe["@list"]=tt.reverse();for(const ke of Ye)delete ne[ke]}delete _e.usages}}const te=[],Ce=Object.keys(Z).sort();for(const me of Ce){const ne=Z[me];if(me in oe){const _e=ne["@graph"]=[],Ie=oe[me],Ge=Object.keys(Ie).sort();for(const st of Ge){const Xe=Ie[st];j.isSubjectReference(Xe)||_e.push(Xe)}}j.isSubjectReference(ne)||te.push(ne)}return te});return function(I,X){return D.apply(this,arguments)}}()},{"./JsonLdError":12,"./constants":18,"./graphTypes":25,"./types":30,"./util":32}],25:[function(Y,Se,he){"use strict";const W=Y("./types"),j={};Se.exports=j,j.isSubject=P=>!(!W.isObject(P)||"@value"in P||"@set"in P||"@list"in P)&&(Object.keys(P).length>1||!("@id"in P)),j.isSubjectReference=P=>W.isObject(P)&&1===Object.keys(P).length&&"@id"in P,j.isValue=P=>W.isObject(P)&&"@value"in P,j.isList=P=>W.isObject(P)&&"@list"in P,j.isGraph=P=>W.isObject(P)&&"@graph"in P&&1===Object.keys(P).filter(Q=>"@id"!==Q&&"@index"!==Q).length,j.isSimpleGraph=P=>j.isGraph(P)&&!("@id"in P),j.isBlankNode=P=>!!W.isObject(P)&&("@id"in P?0===P["@id"].indexOf("_:"):0===Object.keys(P).length||!("@value"in P||"@set"in P||"@list"in P))},{"./types":30}],26:[function(Y,Se,he){const W=Y("rdf-canonize"),j=Y("./platform"),P=Y("./util"),Q=Y("./ContextResolver"),z=P.IdentifierIssuer,v=Y("./JsonLdError"),x=Y("lru-cache"),O=Y("./NQuads"),{expand:A}=Y("./expand"),{flatten:b}=Y("./flatten"),{fromRDF:y}=Y("./fromRdf"),{toRDF:S}=Y("./toRdf"),{frameMergedOrDefault:T,cleanupNull:V}=Y("./frame"),{isArray:R,isObject:K,isString:ce}=Y("./types"),{isSubjectReference:D}=Y("./graphTypes"),{expandIri:I,getInitialContext:X,process:E,processingMode:$}=Y("./context"),{compact:Z,compactIri:oe}=Y("./compact"),{createNodeMap:se,createMergedNodeMap:te,mergeNodeMaps:Ce}=Y("./nodeMap"),me=function(_e){const Ie={},st=new x({max:100});function Xe(tt,ke){var Ke=ke,{documentLoader:Ye=_e.documentLoader}=Ke,Ue=zq(Ke,["documentLoader"]);return Object.assign({},{documentLoader:Ye},Ue,tt)}return _e.compact=function(){var tt=yt(function*(Ye,Ue,ke){if(arguments.length<2)throw new TypeError("Could not compact, too few arguments.");if(null===Ue)throw new v("The compaction context must not be null.","jsonld.CompactError",{code:"invalid local context"});if(null===Ye)return null;let Ke;(ke=Xe(ke,{base:ce(Ye)?Ye:"",compactArrays:!0,compactToRelative:!0,graph:!1,skipExpansion:!1,link:!1,issuer:new z("_:b"),contextResolver:new Q({sharedCache:st})})).link&&(ke.skipExpansion=!0),ke.compactToRelative||delete ke.base,Ke=ke.skipExpansion?Ye:yield _e.expand(Ye,ke);const Me=yield _e.processContext(X(ke),Ue,ke);let Ve=yield Z({activeCtx:Me,element:Ke,options:ke,compactionMap:ke.compactionMap});ke.compactArrays&&!ke.graph&&R(Ve)?1===Ve.length?Ve=Ve[0]:0===Ve.length&&(Ve={}):ke.graph&&K(Ve)&&(Ve=[Ve]),K(Ue)&&"@context"in Ue&&(Ue=Ue["@context"]),Ue=P.clone(Ue),R(Ue)||(Ue=[Ue]);const $e=Ue;Ue=[];for(let q=0;q<$e.length;++q)(!K($e[q])||Object.keys($e[q]).length>0)&&Ue.push($e[q]);const Ne=Ue.length>0;if(1===Ue.length&&(Ue=Ue[0]),R(Ve)){const q=oe({activeCtx:Me,iri:"@graph",relativeTo:{vocab:!0}}),G=Ve;Ve={},Ne&&(Ve["@context"]=Ue),Ve[q]=G}else if(K(Ve)&&Ne){const q=Ve;Ve={"@context":Ue};for(const G in q)Ve[G]=q[G]}return Ve});return function(Ye,Ue,ke){return tt.apply(this,arguments)}}(),_e.expand=function(){var tt=yt(function*(Ye,Ue){if(arguments.length<1)throw new TypeError("Could not expand, too few arguments.");!1===(Ue=Xe(Ue,{keepFreeFloatingNodes:!1,contextResolver:new Q({sharedCache:st})})).expansionMap&&(Ue.expansionMap=void 0);const ke={},Ke=[];if("expandContext"in Ue){const Ne=P.clone(Ue.expandContext);ke.expandContext=K(Ne)&&"@context"in Ne?Ne:{"@context":Ne},Ke.push(ke.expandContext)}let Me;if(ce(Ye)){const Ne=yield _e.get(Ye,Ue);Me=Ne.documentUrl,ke.input=Ne.document,Ne.contextUrl&&(ke.remoteContext={"@context":Ne.contextUrl},Ke.push(ke.remoteContext))}else ke.input=P.clone(Ye);"base"in Ue||(Ue.base=Me||"");let Ve=X(Ue);for(const Ne of Ke)Ve=yield E({activeCtx:Ve,localCtx:Ne,options:Ue});let $e=yield A({activeCtx:Ve,element:ke.input,options:Ue,expansionMap:Ue.expansionMap});return K($e)&&"@graph"in $e&&1===Object.keys($e).length?$e=$e["@graph"]:null===$e&&($e=[]),R($e)||($e=[$e]),$e});return function(Ye,Ue){return tt.apply(this,arguments)}}(),_e.flatten=function(){var tt=yt(function*(Ye,Ue,ke){if(arguments.length<1)return new TypeError("Could not flatten, too few arguments.");Ue="function"==typeof Ue?null:Ue||null,ke=Xe(ke,{base:ce(Ye)?Ye:"",contextResolver:new Q({sharedCache:st})});const Ke=yield _e.expand(Ye,ke),Me=b(Ke);return null===Ue?Me:(ke.graph=!0,ke.skipExpansion=!0,yield _e.compact(Me,Ue,ke))});return function(Ye,Ue,ke){return tt.apply(this,arguments)}}(),_e.frame=function(){var tt=yt(function*(Ye,Ue,ke){if(arguments.length<2)throw new TypeError("Could not frame, too few arguments.");if(ke=Xe(ke,{base:ce(Ye)?Ye:"",embed:"@once",explicit:!1,requireAll:!1,omitDefault:!1,bnodesToClear:[],contextResolver:new Q({sharedCache:st})}),ce(Ue)){const ue=yield _e.get(Ue,ke);if(Ue=ue.document,ue.contextUrl){let je=Ue["@context"];je?R(je)?je.push(ue.contextUrl):je=[je,ue.contextUrl]:je=ue.contextUrl,Ue["@context"]=je}}const Ke=Ue&&Ue["@context"]||{},Me=yield _e.processContext(X(ke),Ke,ke);ke.hasOwnProperty("omitGraph")||(ke.omitGraph=$(Me,1.1)),ke.hasOwnProperty("pruneBlankNodeIdentifiers")||(ke.pruneBlankNodeIdentifiers=$(Me,1.1));const Ve=yield _e.expand(Ye,ke),$e=ot({},ke);$e.isFrame=!0,$e.keepFreeFloatingNodes=!0;const Ne=yield _e.expand(Ue,$e),q=Object.keys(Ue).map(ue=>I(Me,ue,{vocab:!0}));$e.merged=!q.includes("@graph"),$e.is11=$(Me,1.1);const G=T(Ve,Ne,$e);$e.graph=!ke.omitGraph,$e.skipExpansion=!0,$e.link={},$e.framing=!0;let pe=yield _e.compact(G,Ke,$e);return $e.link={},pe=V(pe,$e),pe});return function(Ye,Ue,ke){return tt.apply(this,arguments)}}(),_e.link=function(){var tt=yt(function*(Ye,Ue,ke){const Ke={};return Ue&&(Ke["@context"]=Ue),Ke["@embed"]="@link",_e.frame(Ye,Ke,ke)});return function(Ye,Ue,ke){return tt.apply(this,arguments)}}(),_e.normalize=_e.canonize=function(){var tt=yt(function*(Ye,Ue){if(arguments.length<1)throw new TypeError("Could not canonize, too few arguments.");if("inputFormat"in(Ue=Xe(Ue,{base:ce(Ye)?Ye:"",algorithm:"URDNA2015",skipExpansion:!1,contextResolver:new Q({sharedCache:st})}))){if("application/n-quads"!==Ue.inputFormat&&"application/nquads"!==Ue.inputFormat)throw new v("Unknown canonicalization input format.","jsonld.CanonizeError");const Me=O.parse(Ye);return W.canonize(Me,Ue)}const ke=ot({},Ue);delete ke.format,ke.produceGeneralizedRdf=!1;const Ke=yield _e.toRDF(Ye,ke);return W.canonize(Ke,Ue)});return function(Ye,Ue){return tt.apply(this,arguments)}}(),_e.fromRDF=function(){var tt=yt(function*(Ye,Ue){if(arguments.length<1)throw new TypeError("Could not convert from RDF, too few arguments.");Ue=Xe(Ue,{format:ce(Ye)?"application/n-quads":void 0});const{format:ke}=Ue;let{rdfParser:Ke}=Ue;if(ke){if(Ke=Ke||Ie[ke],!Ke)throw new v("Unknown input format.","jsonld.UnknownFormat",{format:ke})}else Ke=()=>Ye;const Me=yield Ke(Ye);return y(Me,Ue)});return function(Ye,Ue){return tt.apply(this,arguments)}}(),_e.toRDF=function(){var tt=yt(function*(Ye,Ue){if(arguments.length<1)throw new TypeError("Could not convert to RDF, too few arguments.");let ke;ke=(Ue=Xe(Ue,{base:ce(Ye)?Ye:"",skipExpansion:!1,contextResolver:new Q({sharedCache:st})})).skipExpansion?Ye:yield _e.expand(Ye,Ue);const Ke=S(ke,Ue);if(Ue.format){if("application/n-quads"===Ue.format||"application/nquads"===Ue.format)return O.serialize(Ke);throw new v("Unknown output format.","jsonld.UnknownFormat",{format:Ue.format})}return Ke});return function(Ye,Ue){return tt.apply(this,arguments)}}(),_e.createNodeMap=function(){var tt=yt(function*(Ye,Ue){if(arguments.length<1)throw new TypeError("Could not create node map, too few arguments.");Ue=Xe(Ue,{base:ce(Ye)?Ye:"",contextResolver:new Q({sharedCache:st})});const ke=yield _e.expand(Ye,Ue);return te(ke,Ue)});return function(Ye,Ue){return tt.apply(this,arguments)}}(),_e.merge=function(){var tt=yt(function*(Ye,Ue,ke){if(arguments.length<1)throw new TypeError("Could not merge, too few arguments.");if(!R(Ye))throw new TypeError('Could not merge, "docs" must be an array.');Ue="function"==typeof Ue?null:Ue||null,ke=Xe(ke,{contextResolver:new Q({sharedCache:st})});const Ke=yield Promise.all(Ye.map(ue=>{const je=ot({},ke);return _e.expand(ue,je)}));let Me=!0;"mergeNodes"in ke&&(Me=ke.mergeNodes);const Ve=ke.issuer||new z("_:b"),$e={"@default":{}};for(let ue=0;ue_e._documentLoader,set:tt=>_e._documentLoader=tt}),_e.documentLoader=function(){var tt=yt(function*(Ye){throw new v("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 tt.apply(this,arguments)}}(),_e.get=function(){var tt=yt(function*(Ye,Ue){let ke;ke="function"==typeof Ue.documentLoader?Ue.documentLoader:_e.documentLoader;const Ke=yield ke(Ye);try{if(!Ke.document)throw new v("No remote document found at the given URL.","jsonld.NullRemoteDocument");ce(Ke.document)&&(Ke.document=JSON.parse(Ke.document))}catch(Me){throw new v("Could not retrieve a JSON-LD document from the URL.","jsonld.LoadDocumentError",{code:"loading document failed",cause:Me,remoteDoc:Ke})}return Ke});return function(Ye,Ue){return tt.apply(this,arguments)}}(),_e.processContext=function(){var tt=yt(function*(Ye,Ue,ke){return ke=Xe(ke,{base:"",contextResolver:new Q({sharedCache:st})}),null===Ue?X(ke):(Ue=P.clone(Ue),K(Ue)&&"@context"in Ue||(Ue={"@context":Ue}),E({activeCtx:Ye,localCtx:Ue,options:ke}))});return function(Ye,Ue,ke){return tt.apply(this,arguments)}}(),_e.getContextValue=Y("./context").getContextValue,_e.documentLoaders={},_e.useDocumentLoader=function(tt){if(!(tt in _e.documentLoaders))throw new v('Unknown document loader type: "'+tt+'"',"jsonld.UnknownDocumentLoader",{type:tt});_e.documentLoader=_e.documentLoaders[tt].apply(_e,Array.prototype.slice.call(arguments,1))},_e.registerRDFParser=function(tt,Ye){Ie[tt]=Ye},_e.unregisterRDFParser=function(tt){delete Ie[tt]},_e.registerRDFParser("application/n-quads",O.parse),_e.registerRDFParser("application/nquads",O.parse),_e.url=Y("./url"),_e.util=P,Object.assign(_e,P),_e.promises=_e,_e.RequestQueue=Y("./RequestQueue"),_e.JsonLdProcessor=Y("./JsonLdProcessor")(_e),j.setupGlobals(_e),j.setupDocumentLoaders(_e),_e},ne=function(){return me(function(){return ne()})};me(ne),Se.exports=ne},{"./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,Se,he){"use strict";const{isKeyword:W}=Y("./context"),j=Y("./graphTypes"),P=Y("./types"),Q=Y("./util"),z=Y("./JsonLdError"),v={};Se.exports=v,v.createMergedNodeMap=(x,O)=>{const A=(O=O||{}).issuer||new Q.IdentifierIssuer("_:b"),b={"@default":{}};return v.createNodeMap(x,b,"@default",A),v.mergeNodeMaps(b)},v.createNodeMap=(x,O,A,b,y,S)=>{if(P.isArray(x)){for(const K of x)v.createNodeMap(K,O,A,b,void 0,S);return}if(!P.isObject(x))return void(S&&S.push(x));if(j.isValue(x)){if("@type"in x){let K=x["@type"];0===K.indexOf("_:")&&(x["@type"]=K=b.getId(K))}return void(S&&S.push(x))}if(S&&j.isList(x)){const K=[];return v.createNodeMap(x["@list"],O,A,b,y,K),void S.push({"@list":K})}if("@type"in x){const K=x["@type"];for(const ce of K)0===ce.indexOf("_:")&&b.getId(ce)}P.isUndefined(y)&&(y=j.isBlankNode(x)?b.getId(x["@id"]):x["@id"]),S&&S.push({"@id":y});const T=O[A],V=T[y]=T[y]||{};V["@id"]=y;const R=Object.keys(x).sort();for(let K of R){if("@id"===K)continue;if("@reverse"===K){const D={"@id":y},I=x["@reverse"];for(const X in I){const E=I[X];for(const $ of E){let Z=$["@id"];j.isBlankNode($)&&(Z=b.getId(Z)),v.createNodeMap($,O,A,b,Z),Q.addValue(T[Z],X,D,{propertyIsArray:!0,allowDuplicate:!1})}}continue}if("@graph"===K){y in O||(O[y]={}),v.createNodeMap(x[K],O,y,b);continue}if("@included"===K){v.createNodeMap(x[K],O,A,b);continue}if("@type"!==K&&W(K)){if("@index"===K&&K in V&&(x[K]!==V[K]||x[K]["@id"]!==V[K]["@id"]))throw new z("Invalid JSON-LD syntax; conflicting @index property detected.","jsonld.SyntaxError",{code:"conflicting indexes",subject:V});V[K]=x[K];continue}const ce=x[K];if(0===K.indexOf("_:")&&(K=b.getId(K)),0!==ce.length)for(let D of ce)if("@type"===K&&(D=0===D.indexOf("_:")?b.getId(D):D),j.isSubject(D)||j.isSubjectReference(D)){if("@id"in D&&!D["@id"])continue;const I=j.isBlankNode(D)?b.getId(D["@id"]):D["@id"];Q.addValue(V,K,{"@id":I},{propertyIsArray:!0,allowDuplicate:!1}),v.createNodeMap(D,O,A,b,I)}else if(j.isValue(D))Q.addValue(V,K,D,{propertyIsArray:!0,allowDuplicate:!1});else if(j.isList(D)){const I=[];v.createNodeMap(D["@list"],O,A,b,y,I),D={"@list":I},Q.addValue(V,K,D,{propertyIsArray:!0,allowDuplicate:!1})}else v.createNodeMap(D,O,A,b,y),Q.addValue(V,K,D,{propertyIsArray:!0,allowDuplicate:!1});else Q.addValue(V,K,[],{propertyIsArray:!0})}},v.mergeNodeMapGraphs=x=>{const O={};for(const A of Object.keys(x).sort())for(const b of Object.keys(x[A]).sort()){const y=x[A][b];b in O||(O[b]={"@id":b});const S=O[b];for(const T of Object.keys(y).sort())if(W(T)&&"@type"!==T)S[T]=Q.clone(y[T]);else for(const V of y[T])Q.addValue(S,T,Q.clone(V),{propertyIsArray:!0,allowDuplicate:!1})}return O},v.mergeNodeMaps=x=>{const O=x["@default"],A=Object.keys(x).sort();for(const b of A){if("@default"===b)continue;const y=x[b];let S=O[b];S?"@graph"in S||(S["@graph"]=[]):O[b]=S={"@id":b,"@graph":[]};const T=S["@graph"];for(const V of Object.keys(y).sort()){const R=y[V];j.isSubjectReference(R)||T.push(R)}}return O}},{"./JsonLdError":12,"./context":19,"./graphTypes":25,"./types":30,"./util":32}],28:[function(Y,Se,he){"use strict";const W=Y("./documentLoaders/xhr"),j={};Se.exports=j,j.setupDocumentLoaders=function(P){"undefined"!=typeof XMLHttpRequest&&(P.documentLoaders.xhr=W,P.useDocumentLoader("xhr"))},j.setupGlobals=function(P){void 0===globalThis.JsonLdProcessor&&Object.defineProperty(globalThis,"JsonLdProcessor",{writable:!0,enumerable:!1,configurable:!0,value:P.JsonLdProcessor})}},{"./documentLoaders/xhr":20}],29:[function(Y,Se,he){"use strict";const{createNodeMap:W}=Y("./nodeMap"),{isKeyword:j}=Y("./context"),P=Y("./graphTypes"),Q=Y("canonicalize"),z=Y("./types"),v=Y("./util"),{RDF_FIRST:x,RDF_REST:O,RDF_NIL:A,RDF_TYPE:b,RDF_JSON_LITERAL:y,RDF_LANGSTRING:S,XSD_BOOLEAN:T,XSD_DOUBLE:V,XSD_INTEGER:R,XSD_STRING:K}=Y("./constants"),{isAbsolute:ce}=Y("./url"),D={};function I($,Z,oe,se,te){const Ce=Object.keys(Z).sort();for(const me of Ce){const ne=Z[me],_e=Object.keys(ne).sort();for(let Ie of _e){const Ge=ne[Ie];if("@type"===Ie)Ie=b;else if(j(Ie))continue;for(const st of Ge){const Xe={termType:me.startsWith("_:")?"BlankNode":"NamedNode",value:me};if(!ce(me))continue;const tt={termType:Ie.startsWith("_:")?"BlankNode":"NamedNode",value:Ie};if(!ce(Ie)||"BlankNode"===tt.termType&&!te.produceGeneralizedRdf)continue;const Ye=E(st,se,$,oe,te.rdfDirection);Ye&&$.push({subject:Xe,predicate:tt,object:Ye,graph:oe})}}}}function E($,Z,oe,se,te){const Ce={};if(P.isValue($)){Ce.termType="Literal",Ce.value=void 0,Ce.datatype={termType:"NamedNode"};let me=$["@value"];const ne=$["@type"]||null;"@json"===ne?(Ce.value=Q(me),Ce.datatype.value=y):z.isBoolean(me)?(Ce.value=me.toString(),Ce.datatype.value=ne||T):z.isDouble(me)||ne===V?(z.isDouble(me)||(me=parseFloat(me)),Ce.value=me.toExponential(15).replace(/(\d)0*e\+?/,"$1E"),Ce.datatype.value=ne||V):z.isNumber(me)?(Ce.value=me.toFixed(0),Ce.datatype.value=ne||R):"i18n-datatype"===te&&"@direction"in $?(Ce.datatype.value="https://www.w3.org/ns/i18n#"+($["@language"]||"")+`_${$["@direction"]}`,Ce.value=me):"@language"in $?(Ce.value=me,Ce.datatype.value=ne||S,Ce.language=$["@language"]):(Ce.value=me,Ce.datatype.value=ne||K)}else if(P.isList($)){const me=function($,Z,oe,se,te){const Ce={termType:"NamedNode",value:x},me={termType:"NamedNode",value:O},ne={termType:"NamedNode",value:A},_e=$.pop(),Ie=_e?{termType:"BlankNode",value:Z.getId()}:ne;let Ge=Ie;for(const st of $){const Xe=E(st,Z,oe,se,te),tt={termType:"BlankNode",value:Z.getId()};oe.push({subject:Ge,predicate:Ce,object:Xe,graph:se}),oe.push({subject:Ge,predicate:me,object:tt,graph:se}),Ge=tt}if(_e){const st=E(_e,Z,oe,se,te);oe.push({subject:Ge,predicate:Ce,object:st,graph:se}),oe.push({subject:Ge,predicate:me,object:ne,graph:se})}return Ie}($["@list"],Z,oe,se,te);Ce.termType=me.termType,Ce.value=me.value}else{const me=z.isObject($)?$["@id"]:$;Ce.termType=me.startsWith("_:")?"BlankNode":"NamedNode",Ce.value=me}return"NamedNode"!==Ce.termType||ce(Ce.value)?Ce:null}Se.exports=D,D.toRDF=($,Z)=>{const oe=new v.IdentifierIssuer("_:b"),se={"@default":{}};W($,se,"@default",oe);const te=[],Ce=Object.keys(se).sort();for(const me of Ce){let ne;if("@default"===me)ne={termType:"DefaultGraph",value:""};else{if(!ce(me))continue;ne=me.startsWith("_:")?{termType:"BlankNode"}:{termType:"NamedNode"},ne.value=me}I(te,se[me],ne,oe,Z)}return te}},{"./constants":18,"./context":19,"./graphTypes":25,"./nodeMap":27,"./types":30,"./url":31,"./util":32,canonicalize:7}],30:[function(Y,Se,he){"use strict";const W={};Se.exports=W,W.isArray=Array.isArray,W.isBoolean=j=>"boolean"==typeof j||"[object Boolean]"===Object.prototype.toString.call(j),W.isDouble=j=>W.isNumber(j)&&(-1!==String(j).indexOf(".")||Math.abs(j)>=1e21),W.isEmptyObject=j=>W.isObject(j)&&0===Object.keys(j).length,W.isNumber=j=>"number"==typeof j||"[object Number]"===Object.prototype.toString.call(j),W.isNumeric=j=>!isNaN(parseFloat(j))&&isFinite(j),W.isObject=j=>"[object Object]"===Object.prototype.toString.call(j),W.isString=j=>"string"==typeof j||"[object String]"===Object.prototype.toString.call(j),W.isUndefined=j=>void 0===j},{}],31:[function(Y,Se,he){"use strict";const W=Y("./types"),j={};Se.exports=j,j.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*))?))?(?:(((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/}},j.parse=(Q,z)=>{const v={},x=j.parsers[z||"full"],O=x.regex.exec(Q);let A=x.keys.length;for(;A--;)v[x.keys[A]]=void 0===O[A]?null:O[A];return("https"===v.scheme&&"443"===v.port||"http"===v.scheme&&"80"===v.port)&&(v.href=v.href.replace(":"+v.port,""),v.authority=v.authority.replace(":"+v.port,""),v.port=null),v.normalizedPath=j.removeDotSegments(v.path),v},j.prependBase=(Q,z)=>{if(null===Q||j.isAbsolute(z))return z;(!Q||W.isString(Q))&&(Q=j.parse(Q||""));const v=j.parse(z),x={protocol:Q.protocol||""};if(null!==v.authority)x.authority=v.authority,x.path=v.path,x.query=v.query;else if(x.authority=Q.authority,""===v.path)x.path=Q.path,x.query=null!==v.query?v.query:Q.query;else{if(0===v.path.indexOf("/"))x.path=v.path;else{let A=Q.path;A=A.substr(0,A.lastIndexOf("/")+1),(A.length>0||Q.authority)&&"/"!==A.substr(-1)&&(A+="/"),A+=v.path,x.path=A}x.query=v.query}""!==v.path&&(x.path=j.removeDotSegments(x.path));let O=x.protocol;return null!==x.authority&&(O+="//"+x.authority),O+=x.path,null!==x.query&&(O+="?"+x.query),null!==v.fragment&&(O+="#"+v.fragment),""===O&&(O="./"),O},j.removeBase=(Q,z)=>{if(null===Q)return z;(!Q||W.isString(Q))&&(Q=j.parse(Q||""));let v="";if(""!==Q.href?v+=(Q.protocol||"")+"//"+(Q.authority||""):z.indexOf("//")&&(v+="//"),0!==z.indexOf(v))return z;const x=j.parse(z.substr(v.length)),O=Q.normalizedPath.split("/"),A=x.normalizedPath.split("/"),b=x.fragment||x.query?0:1;for(;O.length>0&&A.length>b&&O[0]===A[0];)O.shift(),A.shift();let y="";if(O.length>0){O.pop();for(let S=0;S{if(0===Q.length)return"";const z=Q.split("/"),v=[];for(;z.length>0;){const x=z.shift(),O=0===z.length;"."!==x?".."!==x?v.push(x):(v.pop(),O&&v.push("")):O&&v.push("")}return"/"===Q[0]&&v.length>0&&""!==v[0]&&v.unshift(""),1===v.length&&""===v[0]?"/":v.join("/")};const P=/^([A-Za-z][A-Za-z0-9+-.]*|_):[^\s]*$/;j.isAbsolute=Q=>W.isString(Q)&&P.test(Q),j.isRelative=Q=>W.isString(Q)},{"./types":30}],32:[function(Y,Se,he){"use strict";const W=Y("./graphTypes"),j=Y("./types"),P=Y("rdf-canonize").IdentifierIssuer,Q=Y("./JsonLdError"),z=/(?:<[^>]*?>|"[^"]*?"|[^,])+/g,v=/\s*<([^>]*?)>\s*(?:;\s*(.*))?/,x=/(.*?)=(?:(?:"([^"]*?)")|([^"]*?))\s*(?:(?:;\s*)|$)/g,O_headers={accept:"application/ld+json, application/json"},A={};function b(y,S){if(j.isArray(S))for(let T=0;T{if(Object.keys(y).some(T=>"accept"===T.toLowerCase()))throw new RangeError('Accept header may not be specified; only "'+O_headers.accept+'" is supported.');return Object.assign({Accept:O_headers.accept},y)},A.parseLinkHeader=y=>{const S={},T=y.match(z);for(let V=0;V{if(!(j.isString(y)||j.isArray(y)&&y.every(T=>j.isString(T)))){if(S&&j.isObject(y))switch(Object.keys(y).length){case 0:return;case 1:if("@default"in y&&A.asArray(y["@default"]).every(T=>j.isString(T)))return}throw new Q('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,S)=>{if(y.hasOwnProperty(S)){const T=y[S];return!j.isArray(T)||T.length>0}return!1},A.hasValue=(y,S,T)=>{if(A.hasProperty(y,S)){let V=y[S];const R=W.isList(V);if(j.isArray(V)||R){R&&(V=V["@list"]);for(let K=0;K{if("propertyIsArray"in(V=V||{})||(V.propertyIsArray=!1),"valueIsArray"in V||(V.valueIsArray=!1),"allowDuplicate"in V||(V.allowDuplicate=!0),"prependValue"in V||(V.prependValue=!1),V.valueIsArray)y[S]=T;else if(j.isArray(T)){0===T.length&&V.propertyIsArray&&!y.hasOwnProperty(S)&&(y[S]=[]),V.prependValue&&(T=T.concat(y[S]),y[S]=[]);for(let R=0;R[].concat(y[S]||[]),A.removeProperty=(y,S)=>{delete y[S]},A.removeValue=(y,S,T,V)=>{"propertyIsArray"in(V=V||{})||(V.propertyIsArray=!1);const R=A.getValues(y,S).filter(K=>!A.compareValues(K,T));0===R.length?A.removeProperty(y,S):y[S]=1!==R.length||V.propertyIsArray?R:R[0]},A.relabelBlankNodes=(y,S)=>b((S=S||{}).issuer||new P("_:b"),y),A.compareValues=(y,S)=>!!(y===S||W.isValue(y)&&W.isValue(S)&&y["@value"]===S["@value"]&&y["@type"]===S["@type"]&&y["@language"]===S["@language"]&&y["@index"]===S["@index"])||!!(j.isObject(y)&&"@id"in y&&j.isObject(S)&&"@id"in S)&&y["@id"]===S["@id"],A.compareShortestLeast=(y,S)=>y.length1;const V=(X,E,$)=>{const Z=X[b].get(E);if(Z){const oe=Z.value;if(R(X,oe)){if(ce(X,Z),!X[z])return}else $&&(X[y]&&(Z.value.now=Date.now()),X[A].unshiftNode(Z));return oe.value}},R=(X,E)=>{if(!E||!E.maxAge&&!X[v])return!1;const $=Date.now()-E.now;return E.maxAge?$>E.maxAge:X[v]&&$>X[v]},K=X=>{if(X[P]>X[j])for(let E=X[A].tail;X[P]>X[j]&&null!==E;){const $=E.prev;ce(X,E),E=$}},ce=(X,E)=>{if(E){const $=E.value;X[x]&&X[x]($.key,$.value),X[P]-=$.length,X[b].delete($.key),X[A].removeNode(E)}};class D{constructor(E,$,Z,oe,se){this.key=E,this.value=$,this.length=Z,this.now=oe,this.maxAge=se||0}}const I=(X,E,$,Z)=>{let oe=$.value;R(X,oe)&&(ce(X,$),X[z]||(oe=void 0)),oe&&E.call(Z,oe.value,oe.key,X)};Se.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[j]=E.max||1/0;const Z=E.length||S;if(this[Q]="function"!=typeof Z?S:Z,this[z]=E.stale||!1,E.maxAge&&"number"!=typeof E.maxAge)throw new TypeError("maxAge must be a number");this[v]=E.maxAge||0,this[x]=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[j]=E||1/0,K(this)}get max(){return this[j]}set allowStale(E){this[z]=!!E}get allowStale(){return this[z]}set maxAge(E){if("number"!=typeof E)throw new TypeError("maxAge must be a non-negative number");this[v]=E,K(this)}get maxAge(){return this[v]}set lengthCalculator(E){"function"!=typeof E&&(E=S),E!==this[Q]&&(this[Q]=E,this[P]=0,this[A].forEach($=>{$.length=this[Q]($.value,$.key),this[P]+=$.length})),K(this)}get lengthCalculator(){return this[Q]}get length(){return this[P]}get itemCount(){return this[A].length}rforEach(E,$){$=$||this;for(let Z=this[A].tail;null!==Z;){const oe=Z.prev;I(this,E,Z,$),Z=oe}}forEach(E,$){$=$||this;for(let Z=this[A].head;null!==Z;){const oe=Z.next;I(this,E,Z,$),Z=oe}}keys(){return this[A].toArray().map(E=>E.key)}values(){return this[A].toArray().map(E=>E.value)}reset(){this[x]&&this[A]&&this[A].length&&this[A].forEach(E=>this[x](E.key,E.value)),this[b]=new Map,this[A]=new W,this[P]=0}dump(){return this[A].map(E=>!R(this,E)&&{k:E.key,v:E.value,e:E.now+(E.maxAge||0)}).toArray().filter(E=>E)}dumpLru(){return this[A]}set(E,$,Z){if((Z=Z||this[v])&&"number"!=typeof Z)throw new TypeError("maxAge must be a number");const oe=Z?Date.now():0,se=this[Q]($,E);if(this[b].has(E)){if(se>this[j])return ce(this,this[b].get(E)),!1;const me=this[b].get(E).value;return this[x]&&(this[O]||this[x](E,me.value)),me.now=oe,me.maxAge=Z,me.value=$,this[P]+=se-me.length,me.length=se,this.get(E),K(this),!0}const te=new D(E,$,se,oe,Z);return te.length>this[j]?(this[x]&&this[x](E,$),!1):(this[P]+=te.length,this[A].unshift(te),this[b].set(E,this[A].head),K(this),!0)}has(E){if(!this[b].has(E))return!1;const $=this[b].get(E).value;return!R(this,$)}get(E){return V(this,E,!0)}peek(E){return V(this,E,!1)}pop(){const E=this[A].tail;return E?(ce(this,E),E.value):null}del(E){ce(this,this[b].get(E))}load(E){this.reset();const $=Date.now();for(let Z=E.length-1;Z>=0;Z--){const oe=E[Z],se=oe.e||0;if(0===se)this.set(oe.k,oe.v);else{const te=se-$;te>0&&this.set(oe.k,oe.v,te)}}}prune(){this[b].forEach((E,$)=>V(this,$,!1))}}},{yallist:92}],34:[function(Y,Se,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#",j="http://www.w3.org/2001/XMLSchema#",P="http://www.w3.org/2000/10/swap/";he.default={xsd:{decimal:`${j}decimal`,boolean:`${j}boolean`,double:`${j}double`,integer:`${j}integer`,string:`${j}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:`${P}reify#forSome`,forAll:`${P}reify#forAll`},log:{implies:`${P}log#implies`}}},{}],35:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.default=he.Variable=he.Triple=he.Term=he.Quad=he.NamedNode=he.Literal=he.DefaultGraph=he.BlankNode=void 0,he.escapeQuotes=E,he.termFromId=function D(ne,_e){if(_e=_e||b,!ne)return _e.defaultGraph();switch(ne[0]){case"?":return _e.variable(ne.substr(1));case"_":return _e.blankNode(ne.substr(2));case'"':if(_e===b)return new V(ne);if('"'===ne[ne.length-1])return _e.literal(ne.substr(1,ne.length-2));const Ie=ne.lastIndexOf('"',ne.length-1);return _e.literal(ne.substr(1,Ie-1),"@"===ne[Ie+1]?ne.substr(Ie+2):_e.namedNode(ne.substr(Ie+3)));case"<":const Ge=A.exec(ne);return _e.quad(D($(Ge[1]),_e),D($(Ge[2]),_e),D($(Ge[3]),_e),Ge[4]&&D($(Ge[4]),_e));default:return _e.namedNode(ne)}},he.termToId=function I(ne){if("string"==typeof ne)return ne;if(ne instanceof S&&"Quad"!==ne.termType)return ne.id;if(!ne)return v.id;switch(ne.termType){case"NamedNode":return ne.value;case"BlankNode":return`_:${ne.value}`;case"Variable":return`?${ne.value}`;case"DefaultGraph":return"";case"Literal":return`"${ne.value}"${ne.language?`@${ne.language}`:ne.datatype&&ne.datatype.value!==z.string?`^^${ne.datatype.value}`:""}`;case"Quad":return`<<${E(I(ne.subject))} ${E(I(ne.predicate))} ${E(I(ne.object))}${(0,j.isDefaultGraph)(ne.graph)?"":` ${I(ne.graph)}`}>>`;default:throw new Error(`Unexpected termType: ${ne.termType}`)}},he.unescapeQuotes=$;var ne,W=(ne=Y("./IRIs"))&&ne.__esModule?ne:{default:ne},j=Y("./N3Util");const{rdf:Q,xsd:z}=W.default;let v,x=0;const O=/^"(.*".*)(?="[^"]*$)/,A=/^<<("(?:""|[^"])*"[^ ]*|[^ ]+) ("(?:""|[^"])*"[^ ]*|[^ ]+) ("(?:""|[^"])*"[^ ]*|[^ ]+) ?("(?:""|[^"])*"[^ ]*|[^ ]+)?>>$/,b={namedNode:function(ne){return new T(ne)},blankNode:function(ne){return new R(ne||"n3-"+x++)},variable:function(ne){return new K(ne)},literal:function(ne,_e){if("string"==typeof _e)return new V(`"${ne}"@${_e.toLowerCase()}`);let Ie=_e?_e.value:"";return""===Ie&&("boolean"==typeof ne?Ie=z.boolean:"number"==typeof ne&&(Number.isFinite(ne)?Ie=Number.isInteger(ne)?z.integer:z.double:(Ie=z.double,Number.isNaN(ne)||(ne=ne>0?"INF":"-INF")))),new V(""===Ie||Ie===z.string?`"${ne}"`:`"${ne}"^^${Ie}`)},defaultGraph:function(){return v},quad:me,triple:me};he.default=b;class S{constructor(_e){this.id=_e}get value(){return this.id}equals(_e){return _e instanceof S?this.id===_e.id:!!_e&&this.termType===_e.termType&&this.value===_e.value}hashCode(){return 0}toJSON(){return{termType:this.termType,value:this.value}}}he.Term=S;class T extends S{get termType(){return"NamedNode"}}he.NamedNode=T;class V extends S{get termType(){return"Literal"}get value(){return this.id.substring(1,this.id.lastIndexOf('"'))}get language(){const _e=this.id;let Ie=_e.lastIndexOf('"')+1;return Ie<_e.length&&"@"===_e[Ie++]?_e.substr(Ie).toLowerCase():""}get datatype(){return new T(this.datatypeString)}get datatypeString(){const _e=this.id,Ie=_e.lastIndexOf('"')+1,Ge=Ie<_e.length?_e[Ie]:"";return"^"===Ge?_e.substr(Ie+2):"@"!==Ge?z.string:Q.langString}equals(_e){return _e instanceof V?this.id===_e.id:!!_e&&!!_e.datatype&&this.termType===_e.termType&&this.value===_e.value&&this.language===_e.language&&this.datatype.value===_e.datatype.value}toJSON(){return{termType:this.termType,value:this.value,language:this.language,datatype:{termType:"NamedNode",value:this.datatypeString}}}}he.Literal=V;class R extends S{constructor(_e){super(`_:${_e}`)}get termType(){return"BlankNode"}get value(){return this.id.substr(2)}}he.BlankNode=R;class K extends S{constructor(_e){super(`?${_e}`)}get termType(){return"Variable"}get value(){return this.id.substr(1)}}he.Variable=K;class ce extends S{constructor(){return super(""),v||this}get termType(){return"DefaultGraph"}equals(_e){return this===_e||!!_e&&this.termType===_e.termType}}he.DefaultGraph=ce,v=new ce;class X extends S{constructor(_e,Ie,Ge,st){super(""),this._subject=_e,this._predicate=Ie,this._object=Ge,this._graph=st||v}get termType(){return"Quad"}get subject(){return this._subject}get predicate(){return this._predicate}get object(){return this._object}get graph(){return this._graph}toJSON(){return{termType:this.termType,subject:this._subject.toJSON(),predicate:this._predicate.toJSON(),object:this._object.toJSON(),graph:this._graph.toJSON()}}equals(_e){return!!_e&&this._subject.equals(_e.subject)&&this._predicate.equals(_e.predicate)&&this._object.equals(_e.object)&&this._graph.equals(_e.graph)}}function E(ne){return ne.replace(O,(_e,Ie)=>`"${Ie.replace(/"/g,'""')}`)}function $(ne){return ne.replace(O,(_e,Ie)=>`"${Ie.replace(/""/g,'"')}`)}function me(ne,_e,Ie,Ge){return new X(ne,_e,Ie,Ge)}he.Triple=he.Quad=X},{"./IRIs":34,"./N3Util":41}],36:[function(Y,Se,he){(function(W){(function(){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.default=void 0;var j=Q(Y("./IRIs")),P=Q(Y("queue-microtask"));function Q(S){return S&&S.__esModule?S:{default:S}}const{xsd:z}=j.default,v=/\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{8})|\\([^])/g,x={"\\":"\\","'":"'",'"':'"',n:"\n",r:"\r",t:"\t",f:"\f",b:"\b",_:"_","~":"~",".":".","-":"-","!":"!",$:"$","&":"&","(":"(",")":")","*":"*","+":"+",",":",",";":";","=":"=","/":"/","?":"?","#":"#","@":"@","%":"%"},O=/[\x00-\x20<>\\"\{\}\|\^\`]/,A={_iri:!0,_unescapedIri:!0,_simpleQuotedString:!0,_langcode:!0,_blank:!0,_newline:!0,_comment:!0,_whitespace:!0,_endOfFile:!0},b=/$0^/;he.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 V in this)!(V in A)&&this[V]instanceof RegExp&&(this[V]=b)}else this._n3Mode=!1!==T.n3;this._comments=!!T.comments,this._literalClosingPos=0}_tokenizeToEnd(T,V){let R=this._input,K=R.length;for(;;){let I,X;for(;I=this._newline.exec(R);)this._comments&&(X=this._comment.exec(I[0]))&&ce("comment",X[1],"",this._line,I[0].length),R=R.substr(I[0].length,R.length),K=R.length,this._line++;if(!I&&(I=this._whitespace.exec(R))&&(R=R.substr(I[0].length,R.length)),this._endOfFile.test(R))return V&&(this._comments&&(X=this._comment.exec(R))&&ce("comment",X[1],"",this._line,R.length),R=null,ce("eof","","",this._line,0)),this._input=R;const E=this._line,$=R[0];let Z="",oe="",se="",te=null,Ce=0,me=!1;switch($){case"^":if(R.length<3)break;if("^"!==R[1]){this._n3Mode&&(Ce=1,Z="^");break}if(this._previousMarker="^^",R=R.substr(2),"<"!==R[0]){me=!0;break}case"<":if(te=this._unescapedIri.exec(R))Z="IRI",oe=te[1];else if(te=this._iri.exec(R)){if(oe=this._unescape(te[1]),null===oe||O.test(oe))return D(this);Z="IRI"}else R.length>1&&"<"===R[1]?(Z="<<",Ce=2):this._n3Mode&&R.length>1&&"="===R[1]&&(Z="inverse",Ce=2,oe=">");break;case">":R.length>1&&">"===R[1]&&(Z=">>",Ce=2);break;case"_":((te=this._blank.exec(R))||V&&(te=this._blank.exec(`${R} `)))&&(Z="blank",se="_",oe=te[1]);break;case'"':if(te=this._simpleQuotedString.exec(R))oe=te[1];else if(({value:oe,matchLength:Ce}=this._parseLiteral(R)),null===oe)return D(this);(null!==te||0!==Ce)&&(Z="literal",this._literalClosingPos=0);break;case"'":if(!this._lineMode){if(te=this._simpleApostropheString.exec(R))oe=te[1];else if(({value:oe,matchLength:Ce}=this._parseLiteral(R)),null===oe)return D(this);(null!==te||0!==Ce)&&(Z="literal",this._literalClosingPos=0)}break;case"?":this._n3Mode&&(te=this._variable.exec(R))&&(Z="var",oe=te[0]);break;case"@":"literal"===this._previousMarker&&(te=this._langcode.exec(R))?(Z="langcode",oe=te[1]):(te=this._keyword.exec(R))&&(Z=te[0]);break;case".":if(1===R.length?V:R[1]<"0"||R[1]>"9"){Z=".",Ce=1;break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"+":case"-":(te=this._number.exec(R)||V&&(te=this._number.exec(`${R} `)))&&(Z="literal",oe=te[0],se="string"==typeof te[1]?z.double:"string"==typeof te[2]?z.decimal:z.integer);break;case"B":case"b":case"p":case"P":case"G":case"g":(te=this._sparqlKeyword.exec(R))?Z=te[0].toUpperCase():me=!0;break;case"f":case"t":(te=this._boolean.exec(R))?(Z="literal",oe=te[0],se=z.boolean):me=!0;break;case"a":(te=this._shortPredicates.exec(R))?(Z="abbreviation",oe="a"):me=!0;break;case"=":this._n3Mode&&R.length>1&&(Z="abbreviation",">"!==R[1]?(Ce=1,oe="="):(Ce=2,oe=">"));break;case"!":if(!this._n3Mode)break;case",":case";":case"[":case"]":case"(":case")":case"{":case"}":this._lineMode||(Ce=1,Z=$);break;default:me=!0}if(me&&("@prefix"!==this._previousMarker&&"PREFIX"!==this._previousMarker||!(te=this._prefix.exec(R))?((te=this._prefixed.exec(R))||V&&(te=this._prefixed.exec(`${R} `)))&&(Z="prefixed",se=te[1]||"",oe=this._unescape(te[2])):(Z="prefix",oe=te[1]||"")),"^^"===this._previousMarker)switch(Z){case"prefixed":Z="type";break;case"IRI":Z="typeIRI";break;default:Z=""}if(!Z)return V||!/^'''|^"""/.test(R)&&/\n|\r/.test(R)?D(this):this._input=R;const ne=Ce||te[0].length,_e=ce(Z,oe,se,E,ne);this.previousToken=_e,this._previousMarker=Z,R=R.substr(ne,R.length)}function ce(I,X,E,$,Z){const oe=R?K-R.length:K,te={type:I,value:X,prefix:E,line:$,start:oe,end:oe+Z};return T(null,te),te}function D(I){T(I._syntaxError(/^\S*/.exec(R)[0]))}}_unescape(T){let V=!1;const R=T.replace(v,(K,ce,D,I)=>{if("string"==typeof ce)return String.fromCharCode(Number.parseInt(ce,16));if("string"==typeof D){let X=Number.parseInt(D,16);return X<=65535?String.fromCharCode(Number.parseInt(D,16)):String.fromCharCode(55296+((X-=65536)>>10),56320+(1023&X))}return I in x?x[I]:(V=!0,"")});return V?null:R}_parseLiteral(T){if(T.length>=3){const V=T.match(/^(?:"""|"|'''|'|)/)[0],R=V.length;let K=Math.max(this._literalClosingPos,R);for(;(K=T.indexOf(V,K))>0;){let ce=0;for(;"\\"===T[K-ce-1];)ce++;if(ce%2==0){const D=T.substring(R,K),I=D.split(/\r\n|\r|\n/).length-1,X=K+R;if(1===R&&0!==I||3===R&&this._lineMode)break;return this._line+=I,{value:this._unescape(D),matchLength:X}}K++}this._literalClosingPos=T.length-R+1}return{value:"",matchLength:0}}_syntaxError(T){this._input=null;const V=new Error(`Unexpected "${T}" on line ${this._line}.`);return V.context={token:void 0,line:this._line,previousToken:this.previousToken},V}_readStartingBom(T){return T.startsWith("\ufeff")?T.substr(1):T}tokenize(T,V){if(this._line=1,"string"==typeof T){if(this._input=this._readStartingBom(T),"function"!=typeof V){const R=[];let K;if(this._tokenizeToEnd((ce,D)=>ce?K=ce:R.push(D),!0),K)throw K;return R}(0,P.default)(()=>this._tokenizeToEnd(V,!0))}else this._pendingBuffer=null,"function"==typeof T.setEncoding&&T.setEncoding("utf8"),T.on("data",R=>{null!==this._input&&0!==R.length&&(this._pendingBuffer&&(R=W.concat([this._pendingBuffer,R]),this._pendingBuffer=null),128&R[R.length-1]?this._pendingBuffer=R:(void 0===this._input?this._input=this._readStartingBom("string"==typeof R?R:R.toString()):this._input+=R,this._tokenizeToEnd(V,!1)))}),T.on("end",()=>{"string"==typeof this._input&&this._tokenizeToEnd(V,!0)}),T.on("error",V)}}}).call(this)}).call(this,Y("buffer").Buffer)},{"./IRIs":34,buffer:6,"queue-microtask":45}],37:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.default=void 0;var W=Q(Y("./N3Lexer")),j=Q(Y("./N3DataFactory")),P=Q(Y("./IRIs"));function Q(A){return A&&A.__esModule?A:{default:A}}let z=0;class v{constructor(b){this._contextStack=[],this._graph=null,this._setBase((b=b||{}).baseIRI),b.factory&&O(this,b.factory);const y="string"==typeof b.format?b.format.match(/\w*$/)[0].toLowerCase():"",S=/turtle/.test(y),T=/trig/.test(y),V=/triple/.test(y),R=/quad/.test(y),K=this._n3Mode=/n3/.test(y),ce=V||R;(this._supportsNamedGraphs=!(S||K))||(this._readPredicateOrNamedGraph=this._readPredicate),this._supportsQuads=!(S||T||V||K),this._supportsRDFStar=""===y||/star|\*$/.test(y),ce&&(this._resolveRelativeIRI=D=>null),this._blankNodePrefix="string"!=typeof b.blankNodePrefix?"":b.blankNodePrefix.replace(/^(?!_:)/,"_:"),this._lexer=b.lexer||new W.default({lineMode:ce,n3:K}),this._explicitQuantifiers=!!b.explicitQuantifiers}static _resetBlankNodePrefix(){z=0}_setBase(b){if(b){const y=b.indexOf("#");y>=0&&(b=b.substr(0,y)),this._base=b,this._basePath=b.indexOf("/")<0?b:b.replace(/[^\/?]*(?:\?.*)?$/,""),b=b.match(/^(?:([a-z][a-z0-9+.-]*:))?(?:\/\/[^\/]*)?/i),this._baseRoot=b[0],this._baseScheme=b[1]}else this._base="",this._basePath=""}_saveContext(b,y,S,T,V){const R=this._n3Mode;this._contextStack.push({subject:S,predicate:T,object:V,graph:y,type:b,inverse:!!R&&this._inversePredicate,blankPrefix:R?this._prefixes._:"",quantified:R?this._quantified:null}),R&&(this._inversePredicate=!1,this._prefixes._=this._graph?`${this._graph.id.substr(2)}.`:".",this._quantified=Object.create(this._quantified))}_restoreContext(){const b=this._contextStack.pop(),y=this._n3Mode;this._subject=b.subject,this._predicate=b.predicate,this._object=b.object,this._graph=b.graph,y&&(this._inversePredicate=b.inverse,this._prefixes._=b.blankPrefix,this._quantified=b.quantified)}_readInTopContext(b){switch(b.type){case"eof":return null!==this._graph?this._error("Unclosed graph",b):(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(b)}}_readEntity(b,y){let S;switch(b.type){case"IRI":case"typeIRI":const T=this._resolveIRI(b.value);if(null===T)return this._error("Invalid IRI",b);S=this._namedNode(T);break;case"type":case"prefixed":const V=this._prefixes[b.prefix];if(void 0===V)return this._error(`Undefined prefix "${b.prefix}:"`,b);S=this._namedNode(V+b.value);break;case"blank":S=this._blankNode(this._prefixes[b.prefix]+b.value);break;case"var":S=this._variable(b.value.substr(1));break;default:return this._error(`Expected entity but got ${b.type}`,b)}return!y&&this._n3Mode&&S.id in this._quantified&&(S=this._quantified[S.id]),S}_readSubject(b){switch(this._predicate=null,b.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",b);case"}":return this._readPunctuation(b);case"@forSome":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORSOME,this._quantifier=this._blankNode,this._readQuantifierList):this._error('Unexpected "@forSome"',b);case"@forAll":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORALL,this._quantifier=this._variable,this._readQuantifierList):this._error('Unexpected "@forAll"',b);case"literal":if(!this._n3Mode)return this._error("Unexpected literal",b);if(0===b.prefix.length)return this._literalValue=b.value,this._completeSubjectLiteral;this._subject=this._literal(b.value,this._namedNode(b.prefix));break;case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,null,null,null),this._graph=null,this._readSubject):this._error("Unexpected RDF* syntax",b);default:if(void 0===(this._subject=this._readEntity(b)))return;if(this._n3Mode)return this._getPathReader(this._readPredicateOrNamedGraph)}return this._readPredicateOrNamedGraph}_readPredicate(b){const y=b.type;switch(y){case"inverse":this._inversePredicate=!0;case"abbreviation":this._predicate=this.ABBREVIATIONS[b.value];break;case".":case"]":case"}":return null===this._predicate?this._error(`Unexpected ${y}`,b):(this._subject=null,"]"===y?this._readBlankNodeTail(b):this._readPunctuation(b));case";":return null!==this._predicate?this._readPredicate:this._error("Expected predicate but got ;",b);case"[":if(this._n3Mode)return this._saveContext("blank",this._graph,this._subject,this._subject=this._blankNode(),null),this._readBlankNodeHead;case"blank":if(!this._n3Mode)return this._error("Disallowed blank node as predicate",b);default:if(void 0===(this._predicate=this._readEntity(b)))return}return this._readObject}_readObject(b){switch(b.type){case"literal":if(0===b.prefix.length)return this._literalValue=b.value,this._readDataTypeOrLang;this._object=this._literal(b.value,this._namedNode(b.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",b);case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,this._subject,this._predicate,null),this._graph=null,this._readSubject):this._error("Unexpected RDF* syntax",b);default:if(void 0===(this._object=this._readEntity(b)))return;if(this._n3Mode)return this._getPathReader(this._getContextEndReader())}return this._getContextEndReader()}_readPredicateOrNamedGraph(b){return"{"===b.type?this._readGraph(b):this._readPredicate(b)}_readGraph(b){return"{"!==b.type?this._error(`Expected graph but got ${b.type}`,b):(this._graph=this._subject,this._subject=null,this._readSubject)}_readBlankNodeHead(b){return"]"===b.type?(this._subject=null,this._readBlankNodeTail(b)):(this._predicate=null,this._readPredicate(b))}_readBlankNodeTail(b){if("]"!==b.type)return this._readBlankNodePunctuation(b);null!==this._subject&&this._emit(this._subject,this._predicate,this._object,this._graph);const y=null===this._predicate;return this._restoreContext(),null!==this._object?this._getContextEndReader():null!==this._predicate?this._readObject:y?this._readPredicateOrNamedGraph:this._readPredicateAfterBlank}_readPredicateAfterBlank(b){switch(b.type){case".":case"}":return this._subject=null,this._readPunctuation(b);default:return this._readPredicate(b)}}_readListItem(b){let y=null,S=null,T=this._readListItem;const V=this._subject,R=this._contextStack,K=R[R.length-1];switch(b.type){case"[":this._saveContext("blank",this._graph,S=this._blankNode(),this.RDF_FIRST,this._subject=y=this._blankNode()),T=this._readBlankNodeHead;break;case"(":this._saveContext("list",this._graph,S=this._blankNode(),this.RDF_FIRST,this.RDF_NIL),this._subject=null;break;case")":if(this._restoreContext(),0!==R.length&&"list"===R[R.length-1].type&&this._emit(this._subject,this._predicate,this._object,this._graph),null===this._predicate){if(T=this._readPredicate,this._subject===this.RDF_NIL)return T}else if(T=this._getContextEndReader(),this._object===this.RDF_NIL)return T;S=this.RDF_NIL;break;case"literal":0===b.prefix.length?(this._literalValue=b.value,T=this._readListItemDataTypeOrLang):(y=this._literal(b.value,this._namedNode(b.prefix)),T=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",b);default:if(void 0===(y=this._readEntity(b)))return}if(null===S&&(this._subject=S=this._blankNode()),null===V?null===K.predicate?K.subject=S:K.object=S:this._emit(V,this.RDF_REST,S,this._graph),null!==y){if(this._n3Mode&&("IRI"===b.type||"prefixed"===b.type))return this._saveContext("item",this._graph,S,this.RDF_FIRST,y),this._subject=y,this._predicate=null,this._getPathReader(this._readListItem);this._emit(S,this.RDF_FIRST,y,this._graph)}return T}_readDataTypeOrLang(b){return this._completeObjectLiteral(b,!1)}_readListItemDataTypeOrLang(b){return this._completeObjectLiteral(b,!0)}_completeLiteral(b){let y=this._literal(this._literalValue);switch(b.type){case"type":case"typeIRI":const S=this._readEntity(b);if(void 0===S)return;y=this._literal(this._literalValue,S),b=null;break;case"langcode":y=this._literal(this._literalValue,b.value),b=null}return{token:b,literal:y}}_completeSubjectLiteral(b){return this._subject=this._completeLiteral(b).literal,this._readPredicateOrNamedGraph}_completeObjectLiteral(b,y){const S=this._completeLiteral(b);if(S)return this._object=S.literal,y&&this._emit(this._subject,this.RDF_FIRST,this._object,this._graph),null===S.token?this._getContextEndReader():(this._readCallback=this._getContextEndReader(),this._readCallback(S.token))}_readFormulaTail(b){return"}"!==b.type?this._readPunctuation(b):(null!==this._subject&&this._emit(this._subject,this._predicate,this._object,this._graph),this._restoreContext(),null===this._object?this._readPredicate:this._getContextEndReader())}_readPunctuation(b){let y,S=this._graph;const T=this._subject,V=this._inversePredicate;switch(b.type){case"}":if(null===this._graph)return this._error("Unexpected graph closing",b);if(this._n3Mode)return this._readFormulaTail(b);this._graph=null;case".":this._subject=null,y=this._contextStack.length?this._readSubject:this._readInTopContext,V&&(this._inversePredicate=!1);break;case";":y=this._readPredicate;break;case",":y=this._readObject;break;default:if(this._supportsQuads&&null===this._graph&&void 0!==(S=this._readEntity(b))){y=this._readQuadPunctuation;break}return this._error(`Expected punctuation to follow "${this._object.id}"`,b)}if(null!==T){const R=this._predicate,K=this._object;V?this._emit(K,R,T,S):this._emit(T,R,K,S)}return y}_readBlankNodePunctuation(b){let y;switch(b.type){case";":y=this._readPredicate;break;case",":y=this._readObject;break;default:return this._error(`Expected punctuation to follow "${this._object.id}"`,b)}return this._emit(this._subject,this._predicate,this._object,this._graph),y}_readQuadPunctuation(b){return"."!==b.type?this._error("Expected dot to follow quad",b):this._readInTopContext}_readPrefix(b){return"prefix"!==b.type?this._error("Expected prefix to follow @prefix",b):(this._prefix=b.value,this._readPrefixIRI)}_readPrefixIRI(b){if("IRI"!==b.type)return this._error(`Expected IRI to follow prefix "${this._prefix}:"`,b);const y=this._readEntity(b);return this._prefixes[this._prefix]=y.value,this._prefixCallback(this._prefix,y),this._readDeclarationPunctuation}_readBaseIRI(b){const y="IRI"===b.type&&this._resolveIRI(b.value);return y?(this._setBase(y),this._readDeclarationPunctuation):this._error("Expected valid IRI to follow base declaration",b)}_readNamedGraphLabel(b){switch(b.type){case"IRI":case"blank":case"prefixed":return this._readSubject(b),this._readGraph;case"[":return this._readNamedGraphBlankLabel;default:return this._error("Invalid graph label",b)}}_readNamedGraphBlankLabel(b){return"]"!==b.type?this._error("Invalid graph label",b):(this._subject=this._blankNode(),this._readGraph)}_readDeclarationPunctuation(b){return this._sparqlStyle?(this._sparqlStyle=!1,this._readInTopContext(b)):"."!==b.type?this._error("Expected declaration to end with a dot",b):this._readInTopContext}_readQuantifierList(b){let y;switch(b.type){case"IRI":case"prefixed":if(void 0!==(y=this._readEntity(b,!0)))break;default:return this._error(`Unexpected ${b.type}`,b)}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(b){return","===b.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(b))}_getPathReader(b){return this._afterPath=b,this._readPath}_readPath(b){switch(b.type){case"!":return this._readForwardPath;case"^":return this._readBackwardPath;default:const y=this._contextStack,S=y.length&&y[y.length-1];if(S&&"item"===S.type){const T=this._subject;this._restoreContext(),this._emit(this._subject,this.RDF_FIRST,T,this._graph)}return this._afterPath(b)}}_readForwardPath(b){let y,S;const T=this._blankNode();if(void 0!==(S=this._readEntity(b)))return null===this._predicate?(y=this._subject,this._subject=T):(y=this._object,this._object=T),this._emit(y,S,T,this._graph),this._readPath}_readBackwardPath(b){const y=this._blankNode();let S,T;if(void 0!==(S=this._readEntity(b)))return null===this._predicate?(T=this._subject,this._subject=y):(T=this._object,this._object=y),this._emit(y,S,T,this._graph),this._readPath}_readRDFStarTailOrGraph(b){return">>"!==b.type?this._supportsQuads&&null===this._graph&&void 0!==(this._graph=this._readEntity(b))?this._readRDFStarTail:this._error(`Expected >> to follow "${this._object.id}"`,b):this._readRDFStarTail(b)}_readRDFStarTail(b){if(">>"!==b.type)return this._error(`Expected >> but got ${b.type}`,b);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 b=this._contextStack;if(!b.length)return this._readPunctuation;switch(b[b.length-1].type){case"blank":return this._readBlankNodeTail;case"list":return this._readListItem;case"formula":return this._readFormulaTail;case"<<":return this._readRDFStarTailOrGraph}}_emit(b,y,S,T){this._callback(null,this._quad(b,y,S,T||this.DEFAULTGRAPH))}_error(b,y){const S=new Error(`${b} on line ${y.line}.`);S.context={token:y,line:y.line,previousToken:this._lexer.previousToken},this._callback(S),this._callback=x}_resolveIRI(b){return/^[a-z][a-z0-9+.-]*:/i.test(b)?b:this._resolveRelativeIRI(b)}_resolveRelativeIRI(b){if(!b.length)return this._base;switch(b[0]){case"#":return this._base+b;case"?":return this._base.replace(/(?:\?.*)?$/,b);case"/":return("/"===b[1]?this._baseScheme:this._baseRoot)+this._removeDotSegments(b);default:return/^[^/:]*:/.test(b)?null:this._removeDotSegments(this._basePath+b)}}_removeDotSegments(b){if(!/(^|\/)\.\.?($|[/#?])/.test(b))return b;const y=b.length;let S="",T=-1,V=-1,R=0,K="/";for(;T=V&&(S=S.substr(0,R)),"/"!==K)return`${S}/${b.substr(T+1)}`;R=T+1}}}K=b[++T]}return S+b.substring(R)}parse(b,y,S){if(this._readCallback=this._readInTopContext,this._sparqlStyle=!1,this._prefixes=Object.create(null),this._prefixes._=this._blankNodePrefix?this._blankNodePrefix.substr(2):`b${z++}_`,this._prefixCallback=S||x,this._inversePredicate=!1,this._quantified=Object.create(null),!y){const T=[];let V;if(this._callback=(R,K)=>{R?V=R:K&&T.push(K)},this._lexer.tokenize(b).every(R=>this._readCallback=this._readCallback(R)),V)throw V;return T}this._callback=y,this._lexer.tokenize(b,(T,V)=>{null!==T?(this._callback(T),this._callback=x):this._readCallback&&(this._readCallback=this._readCallback(V))})}}function x(){}function O(A,b){const y=b.namedNode;A._namedNode=y,A._blankNode=b.blankNode,A._literal=b.literal,A._variable=b.variable,A._quad=b.quad,A.DEFAULTGRAPH=b.defaultGraph(),A.RDF_FIRST=y(P.default.rdf.first),A.RDF_REST=y(P.default.rdf.rest),A.RDF_NIL=y(P.default.rdf.nil),A.N3_FORALL=y(P.default.r.forAll),A.N3_FORSOME=y(P.default.r.forSome),A.ABBREVIATIONS={a:y(P.default.rdf.type),"=":y(P.default.owl.sameAs),">":y(P.default.log.implies)},A.QUANTIFIERS_GRAPH=y("urn:n3:quantifiers")}he.default=v,O(v.prototype,j.default)},{"./IRIs":34,"./N3DataFactory":35,"./N3Lexer":36}],38:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.default=void 0;var b,W=function(b,y){if(!y&&b&&b.__esModule)return b;if(null===b||"object"!=typeof b&&"function"!=typeof b)return{default:b};var S=z(y);if(S&&S.has(b))return S.get(b);var T={},V=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var R in b)if("default"!==R&&Object.prototype.hasOwnProperty.call(b,R)){var K=V?Object.getOwnPropertyDescriptor(b,R):null;K&&(K.get||K.set)?Object.defineProperty(T,R,K):T[R]=b[R]}return T.default=b,S&&S.set(b,T),T}(Y("./N3DataFactory")),j=Y("readable-stream"),P=(b=Y("./IRIs"))&&b.__esModule?b:{default:b};function z(b){if("function"!=typeof WeakMap)return null;var y=new WeakMap,S=new WeakMap;return(z=function(T){return T?S:y})(b)}class x{constructor(y,S){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,!S&&y&&!y[0]&&(S=y,y=null),this._factory=(S=S||{}).factory||W.default,y&&this.addQuads(y)}get size(){let y=this._size;if(null!==y)return y;y=0;const S=this._graphs;let T,V;for(const R in S)for(const K in T=S[R].subjects)for(const ce in V=T[K])y+=Object.keys(V[ce]).length;return this._size=y}_addToIndex(y,S,T,V){const R=y[S]||(y[S]={}),K=R[T]||(R[T]={}),ce=V in K;return ce||(K[V]=null),!ce}_removeFromIndex(y,S,T,V){const R=y[S],K=R[T];delete K[V];for(const ce in K)return;delete R[T];for(const ce in R)return;delete y[S]}*_findInIndex(y,S,T,V,R,K,ce,D){let I,X,E;const Z=!S+!T+!V>1?Object.keys(this._ids):this._entities,oe=(0,W.termFromId)(D,this._factory);S&&((I=y,y={})[S]=I[S]);for(const se in y){const te=Z[se];if(X=y[se]){T&&((I=X,X={})[T]=I[T]);for(const Ce in X){const me=Z[Ce];if(E=X[Ce]){const ne=V?V in E?[V]:[]:Object.keys(E);for(let _e=0;_e{T in S||(S[T]=!0,y((0,W.termFromId)(this._entities[T],this._factory)))}}add(y){return this.addQuad(y),this}addQuad(y,S,T,V){S||(V=y.graph,T=y.object,S=y.predicate,y=y.subject),y=(0,W.termToId)(y),S=(0,W.termToId)(S),T=(0,W.termToId)(T),V=(0,W.termToId)(V);let R=this._graphs[V];R||(R=this._graphs[V]={subjects:{},predicates:{},objects:{}},Object.freeze(R));const K=this._ids,ce=this._entities;y=K[y]||(K[ce[++this._id]=y]=this._id),S=K[S]||(K[ce[++this._id]=S]=this._id),T=K[T]||(K[ce[++this._id]=T]=this._id);const D=this._addToIndex(R.subjects,y,S,T);return this._addToIndex(R.predicates,S,T,y),this._addToIndex(R.objects,T,y,S),this._size=null,D}addQuads(y){for(let S=0;S{this.addQuad(S)}),y}removeQuad(y,S,T,V){S||(V=y.graph,T=y.object,S=y.predicate,y=y.subject),y=(0,W.termToId)(y),S=(0,W.termToId)(S),T=(0,W.termToId)(T),V=(0,W.termToId)(V);const R=this._ids,K=this._graphs;let ce,D,I;if(!((y=R[y])&&(S=R[S])&&(T=R[T])&&(ce=K[V])&&(D=ce.subjects[y])&&(I=D[S])&&T in I))return!1;for(y in this._removeFromIndex(ce.subjects,y,S,T),this._removeFromIndex(ce.predicates,S,T,y),this._removeFromIndex(ce.objects,T,y,S),null!==this._size&&this._size--,ce.subjects)return!0;return delete K[V],!0}removeQuads(y){for(let S=0;S{this.removeQuad(S)}),y}removeMatches(y,S,T,V){const R=new j.Readable({objectMode:!0});return R._read=()=>{for(const K of this.readQuads(y,S,T,V))R.push(K);R.push(null)},this.remove(R)}deleteGraph(y){return this.removeMatches(null,null,null,y)}getQuads(y,S,T,V){return[...this.readQuads(y,S,T,V)]}*readQuads(y,S,T,V){y=y&&(0,W.termToId)(y),S=S&&(0,W.termToId)(S),T=T&&(0,W.termToId)(T),V=V&&(0,W.termToId)(V);const R=this._getGraphs(V),K=this._ids;let ce,D,I,X;if(!(O(y)&&!(D=K[y])||O(S)&&!(I=K[S])||O(T)&&!(X=K[T])))for(const E in R)(ce=R[E])&&(D?X?yield*this._findInIndex(ce.objects,X,D,I,"object","subject","predicate",E,null,!0):yield*this._findInIndex(ce.subjects,D,I,null,"subject","predicate","object",E,null,!0):I?yield*this._findInIndex(ce.predicates,I,X,null,"predicate","object","subject",E,null,!0):X?yield*this._findInIndex(ce.objects,X,null,null,"object","subject","predicate",E,null,!0):yield*this._findInIndex(ce.subjects,null,null,null,"subject","predicate","object",E,null,!0))}match(y,S,T,V){return new A(this,y,S,T,V)}countQuads(y,S,T,V){y=y&&(0,W.termToId)(y),S=S&&(0,W.termToId)(S),T=T&&(0,W.termToId)(T),V=V&&(0,W.termToId)(V);const R=this._getGraphs(V),K=this._ids;let D,I,X,E,ce=0;if(O(y)&&!(I=K[y])||O(S)&&!(X=K[S])||O(T)&&!(E=K[T]))return 0;for(const $ in R)(D=R[$])&&(ce+=y?T?this._countInIndex(D.objects,E,I,X):this._countInIndex(D.subjects,I,X,E):S?this._countInIndex(D.predicates,X,E,I):this._countInIndex(D.objects,E,I,X));return ce}forEach(y,S,T,V,R){this.some(K=>(y(K),!1),S,T,V,R)}every(y,S,T,V,R){let K=!1;const ce=!this.some(D=>(K=!0,!y(D)),S,T,V,R);return K&&ce}some(y,S,T,V,R){for(const K of this.readQuads(S,T,V,R))if(y(K))return!0;return!1}getSubjects(y,S,T){const V=[];return this.forSubjects(R=>{V.push(R)},y,S,T),V}forSubjects(y,S,T,V){S=S&&(0,W.termToId)(S),T=T&&(0,W.termToId)(T),V=V&&(0,W.termToId)(V);const R=this._ids,K=this._getGraphs(V);let ce,D,I;if(y=this._uniqueEntities(y),!(O(S)&&!(D=R[S])||O(T)&&!(I=R[T])))for(V in K)(ce=K[V])&&(D?I?this._loopBy2Keys(ce.predicates,D,I,y):this._loopByKey1(ce.subjects,D,y):I?this._loopByKey0(ce.objects,I,y):this._loop(ce.subjects,y))}getPredicates(y,S,T){const V=[];return this.forPredicates(R=>{V.push(R)},y,S,T),V}forPredicates(y,S,T,V){S=S&&(0,W.termToId)(S),T=T&&(0,W.termToId)(T),V=V&&(0,W.termToId)(V);const R=this._ids,K=this._getGraphs(V);let ce,D,I;if(y=this._uniqueEntities(y),!(O(S)&&!(D=R[S])||O(T)&&!(I=R[T])))for(V in K)(ce=K[V])&&(D?I?this._loopBy2Keys(ce.objects,I,D,y):this._loopByKey0(ce.subjects,D,y):I?this._loopByKey1(ce.predicates,I,y):this._loop(ce.predicates,y))}getObjects(y,S,T){const V=[];return this.forObjects(R=>{V.push(R)},y,S,T),V}forObjects(y,S,T,V){S=S&&(0,W.termToId)(S),T=T&&(0,W.termToId)(T),V=V&&(0,W.termToId)(V);const R=this._ids,K=this._getGraphs(V);let ce,D,I;if(y=this._uniqueEntities(y),!(O(S)&&!(D=R[S])||O(T)&&!(I=R[T])))for(V in K)(ce=K[V])&&(D?I?this._loopBy2Keys(ce.subjects,D,I,y):this._loopByKey1(ce.objects,D,y):I?this._loopByKey0(ce.predicates,I,y):this._loop(ce.objects,y))}getGraphs(y,S,T){const V=[];return this.forGraphs(R=>{V.push(R)},y,S,T),V}forGraphs(y,S,T,V){for(const R in this._graphs)this.some(K=>(y(K.graph),!0),S,T,V,R)}createBlankNode(y){let S,T;if(y)for(S=y=`_:${y}`,T=1;this._ids[S];)S=y+T++;else do{S="_:b"+this._blankNodeIndex++}while(this._ids[S]);return this._ids[S]=++this._id,this._entities[this._id]=S,this._factory.blankNode(S.substr(2))}extractLists({remove:y=!1,ignoreErrors:S=!1}={}){const T={},V=S?()=>!0:(ce,D)=>{throw new Error(`${ce.value} ${D}`)},R=this.getQuads(null,P.default.rdf.rest,P.default.rdf.nil,null),K=y?[...R]:[];return R.forEach(ce=>{const D=[];let X,E,I=!1;const $=ce.graph;let Z=ce.subject;for(;Z&&!I;){const oe=this.getQuads(null,null,Z,null),se=this.getQuads(Z,null,null,null);let te,Ce=null,me=null,ne=null;for(let _e=0;_e{switch(b){case"data":O=y;break;case"end":A=y}}},(b,y)=>{b&&this.emit("error",b)||y&&this.push(y)},(b,y)=>{this.emit("prefix",b,y)}),this._transform=(b,y,S)=>{O(b),S()},this._flush=b=>{A(),b()}}import(v){return v.on("data",x=>{this.write(x)}),v.on("end",()=>{this.end()}),v.on("error",x=>{this.emit("error",x)}),this}}},{"./N3Parser":37,"readable-stream":81}],40:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.default=void 0;var z,W=Y("readable-stream"),j=(z=Y("./N3Writer"))&&z.__esModule?z:{default:z};he.default=class extends W.Transform{constructor(v){super({encoding:"utf8",writableObjectMode:!0});const x=this._writer=new j.default({write:(O,A,b)=>{this.push(O),b&&b()},end:O=>{this.push(null),O&&O()}},v);this._transform=(O,A,b)=>{x.addQuad(O,b)},this._flush=O=>{x.end(O)}}import(v){return v.on("data",x=>{this.write(x)}),v.on("end",()=>{this.end()}),v.on("error",x=>{this.emit("error",x)}),v.on("prefix",(x,O)=>{this._writer.addPrefix(x,O)}),this}}},{"./N3Writer":42,"readable-stream":81}],41:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.inDefaultGraph=function(y){return x(y.graph)},he.isBlankNode=function(y){return!!y&&"BlankNode"===y.termType},he.isDefaultGraph=x,he.isLiteral=function(y){return!!y&&"Literal"===y.termType},he.isNamedNode=function(y){return!!y&&"NamedNode"===y.termType},he.isVariable=function(y){return!!y&&"Variable"===y.termType},he.prefix=function(y,S){return b({"":y.value||y},S)("")},he.prefixes=b;var y,W=(y=Y("./N3DataFactory"))&&y.__esModule?y:{default:y};function x(y){return!!y&&"DefaultGraph"===y.termType}function b(y,S){const T=Object.create(null);for(const R in y)V(R,y[R]);function V(R,K){if("string"==typeof K){const ce=Object.create(null);T[R]=D=>ce[D]||(ce[D]=S.namedNode(K+D))}else if(!(R in T))throw new Error(`Unknown prefix: ${R}`);return T[R]}return S=S||W.default,V}},{"./N3DataFactory":35}],42:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.default=void 0;var ce,W=(ce=Y("./IRIs"))&&ce.__esModule?ce:{default:ce},j=function(ce,D){if(!D&&ce&&ce.__esModule)return ce;if(null===ce||"object"!=typeof ce&&"function"!=typeof ce)return{default:ce};var I=Q(D);if(I&&I.has(ce))return I.get(ce);var X={},E=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var $ in ce)if("default"!==$&&Object.prototype.hasOwnProperty.call(ce,$)){var Z=E?Object.getOwnPropertyDescriptor(ce,$):null;Z&&(Z.get||Z.set)?Object.defineProperty(X,$,Z):X[$]=ce[$]}return X.default=ce,I&&I.set(ce,X),X}(Y("./N3DataFactory")),P=Y("./N3Util");function Q(ce){if("function"!=typeof WeakMap)return null;var D=new WeakMap,I=new WeakMap;return(Q=function(X){return X?I:D})(ce)}const x=j.default.defaultGraph(),{rdf:O,xsd:A}=W.default,b=/["\\\t\n\r\b\f\u0000-\u0019\ud800-\udbff]/,y=/["\\\t\n\r\b\f\u0000-\u0019]|[\ud800-\udbff][\udc00-\udfff]/g,S={"\\":"\\\\",'"':'\\"',"\t":"\\t","\n":"\\n","\r":"\\r","\b":"\\b","\f":"\\f"};class T extends j.Term{equals(){return!1}}function R(ce){let D=S[ce];return void 0===D&&(1===ce.length?(D=ce.charCodeAt(0).toString(16),D="\\u0000".substr(0,6-D.length)+D):(D=(1024*(ce.charCodeAt(0)-55296)+ce.charCodeAt(1)+9216).toString(16),D="\\U00000000".substr(0,10-D.length)+D)),D}function K(ce){return ce.replace(/[\]\/\(\)\*\+\?\.\\\$]/g,"\\$&")}he.default=class{constructor(D,I){if(this._prefixRegex=/$0^/,D&&"function"!=typeof D.write&&(I=D,D=null),this._lists=(I=I||{}).lists,D)this._outputStream=D,this._endStream=void 0===I.end||!!I.end;else{let X="";this._outputStream={write(E,$,Z){X+=E,Z&&Z()},end:E=>{E&&E(null,X)}},this._endStream=!0}this._subject=null,/triple|quad/i.test(I.format)?(this._lineMode=!0,this._writeQuad=this._writeQuadLine):(this._lineMode=!1,this._graph=x,this._prefixIRIs=Object.create(null),I.prefixes&&this.addPrefixes(I.prefixes),I.baseIRI&&(this._baseMatcher=new RegExp(`^${K(I.baseIRI)}${I.baseIRI.endsWith("/")?"":"[#?]"}`),this._baseLength=I.baseIRI.length))}get _inDefaultGraph(){return x.equals(this._graph)}_write(D,I){this._outputStream.write(D,"utf8",I)}_writeQuad(D,I,X,E,$){try{E.equals(this._graph)||(this._write((null===this._subject?"":this._inDefaultGraph?".\n":"\n}\n")+(x.equals(E)?"":`${this._encodeIriOrBlank(E)} {\n`)),this._graph=E,this._subject=null),D.equals(this._subject)?I.equals(this._predicate)?this._write(`, ${this._encodeObject(X)}`,$):this._write(`;\n ${this._encodePredicate(this._predicate=I)} ${this._encodeObject(X)}`,$):this._write(`${(null===this._subject?"":".\n")+this._encodeSubject(this._subject=D)} ${this._encodePredicate(this._predicate=I)} ${this._encodeObject(X)}`,$)}catch(Z){$&&$(Z)}}_writeQuadLine(D,I,X,E,$){delete this._prefixMatch,this._write(this.quadToString(D,I,X,E),$)}quadToString(D,I,X,E){return`${this._encodeSubject(D)} ${this._encodeIriOrBlank(I)} ${this._encodeObject(X)}${E&&E.value?` ${this._encodeIriOrBlank(E)} .\n`:" .\n"}`}quadsToString(D){return D.map(I=>this.quadToString(I.subject,I.predicate,I.object,I.graph)).join("")}_encodeSubject(D){return"Quad"===D.termType?this._encodeQuad(D):this._encodeIriOrBlank(D)}_encodeIriOrBlank(D){if("NamedNode"!==D.termType)return this._lists&&D.value in this._lists&&(D=this.list(this._lists[D.value])),"id"in D?D.id:`_:${D.value}`;let I=D.value;this._baseMatcher&&this._baseMatcher.test(I)&&(I=I.substr(this._baseLength)),b.test(I)&&(I=I.replace(y,R));const X=this._prefixRegex.exec(I);return X?X[1]?this._prefixIRIs[X[1]]+X[2]:I:`<${I}>`}_encodeLiteral(D){let I=D.value;if(b.test(I)&&(I=I.replace(y,R)),D.language)return`"${I}"@${D.language}`;if(this._lineMode){if(D.datatype.value===A.string)return`"${I}"`}else switch(D.datatype.value){case A.string:return`"${I}"`;case A.boolean:if("true"===I||"false"===I)return I;break;case A.integer:if(/^[+-]?\d+$/.test(I))return I;break;case A.decimal:if(/^[+-]?\d*\.\d+$/.test(I))return I;break;case A.double:if(/^[+-]?(?:\d+\.\d*|\.?\d+)[eE][+-]?\d+$/.test(I))return I}return`"${I}"^^${this._encodeIriOrBlank(D.datatype)}`}_encodePredicate(D){return D.value===O.type?"a":this._encodeIriOrBlank(D)}_encodeObject(D){switch(D.termType){case"Quad":return this._encodeQuad(D);case"Literal":return this._encodeLiteral(D);default:return this._encodeIriOrBlank(D)}}_encodeQuad({subject:D,predicate:I,object:X,graph:E}){return`<<${this._encodeSubject(D)} ${this._encodePredicate(I)} ${this._encodeObject(X)}${(0,P.isDefaultGraph)(E)?"":` ${this._encodeIriOrBlank(E)}`}>>`}_blockedWrite(){throw new Error("Cannot write because the writer has been closed.")}addQuad(D,I,X,E,$){void 0===X?this._writeQuad(D.subject,D.predicate,D.object,D.graph,I):"function"==typeof E?this._writeQuad(D,I,X,x,E):this._writeQuad(D,I,X,E||x,$)}addQuads(D){for(let I=0;I.\n`)}if(X){let E="",$="";for(const Z in this._prefixIRIs)E+=E?`|${Z}`:Z,$+=($?"|":"")+this._prefixIRIs[Z];E=K(E),this._prefixRegex=new RegExp(`^(?:${$})[^/]*$|^(${E})([a-zA-Z][\\-_a-zA-Z0-9]*)$`)}this._write(X?"\n":"",I)}blank(D,I){let E,$,X=D;switch(void 0===D?X=[]:D.termType?X=[{predicate:D,object:I}]:"length"in D||(X=[D]),$=X.length){case 0:return new T("[]");case 1:if(E=X[0],!(E.object instanceof T))return new T(`[ ${this._encodePredicate(E.predicate)} ${this._encodeObject(E.object)} ]`);default:let Z="[";for(let oe=0;oe<$;oe++)E=X[oe],E.predicate.equals(D)?Z+=`, ${this._encodeObject(E.object)}`:(Z+=`${(oe?";\n ":"\n ")+this._encodePredicate(E.predicate)} ${this._encodeObject(E.object)}`,D=E.predicate);return new T(`${Z}\n]`)}}list(D){const I=D&&D.length||0,X=new Array(I);for(let E=0;E{I=null,D(X,E)});if(this._endStream)try{return this._outputStream.end(I)}catch(X){}I&&I()}}},{"./IRIs":34,"./N3DataFactory":35,"./N3Util":41}],43:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),Object.defineProperty(he,"BlankNode",{enumerable:!0,get:function(){return O.BlankNode}}),Object.defineProperty(he,"DataFactory",{enumerable:!0,get:function(){return O.default}}),Object.defineProperty(he,"DefaultGraph",{enumerable:!0,get:function(){return O.DefaultGraph}}),Object.defineProperty(he,"Lexer",{enumerable:!0,get:function(){return W.default}}),Object.defineProperty(he,"Literal",{enumerable:!0,get:function(){return O.Literal}}),Object.defineProperty(he,"NamedNode",{enumerable:!0,get:function(){return O.NamedNode}}),Object.defineProperty(he,"Parser",{enumerable:!0,get:function(){return j.default}}),Object.defineProperty(he,"Quad",{enumerable:!0,get:function(){return O.Quad}}),Object.defineProperty(he,"Store",{enumerable:!0,get:function(){return Q.default}}),Object.defineProperty(he,"StreamParser",{enumerable:!0,get:function(){return z.default}}),Object.defineProperty(he,"StreamWriter",{enumerable:!0,get:function(){return v.default}}),Object.defineProperty(he,"Term",{enumerable:!0,get:function(){return O.Term}}),Object.defineProperty(he,"Triple",{enumerable:!0,get:function(){return O.Triple}}),he.Util=void 0,Object.defineProperty(he,"Variable",{enumerable:!0,get:function(){return O.Variable}}),Object.defineProperty(he,"Writer",{enumerable:!0,get:function(){return P.default}}),he.default=void 0,Object.defineProperty(he,"termFromId",{enumerable:!0,get:function(){return O.termFromId}}),Object.defineProperty(he,"termToId",{enumerable:!0,get:function(){return O.termToId}});var W=y(Y("./N3Lexer")),j=y(Y("./N3Parser")),P=y(Y("./N3Writer")),Q=y(Y("./N3Store")),z=y(Y("./N3StreamParser")),v=y(Y("./N3StreamWriter")),x=b(Y("./N3Util"));he.Util=x;var O=b(Y("./N3DataFactory"));function A(T){if("function"!=typeof WeakMap)return null;var V=new WeakMap,R=new WeakMap;return(A=function(K){return K?R:V})(T)}function b(T,V){if(!V&&T&&T.__esModule)return T;if(null===T||"object"!=typeof T&&"function"!=typeof T)return{default:T};var R=A(V);if(R&&R.has(T))return R.get(T);var K={},ce=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var D in T)if("default"!==D&&Object.prototype.hasOwnProperty.call(T,D)){var I=ce?Object.getOwnPropertyDescriptor(T,D):null;I&&(I.get||I.set)?Object.defineProperty(K,D,I):K[D]=T[D]}return K.default=T,R&&R.set(T,K),K}function y(T){return T&&T.__esModule?T:{default:T}}he.default={Lexer:W.default,Parser:j.default,Writer:P.default,Store:Q.default,StreamParser:z.default,StreamWriter:v.default,Util:x,DataFactory:O.default,Term:O.Term,NamedNode:O.NamedNode,Literal:O.Literal,BlankNode:O.BlankNode,Variable:O.Variable,DefaultGraph:O.DefaultGraph,Quad:O.Quad,Triple:O.Triple,termFromId:O.termFromId,termToId:O.termToId}},{"./N3DataFactory":35,"./N3Lexer":36,"./N3Parser":37,"./N3Store":38,"./N3StreamParser":39,"./N3StreamWriter":40,"./N3Util":41,"./N3Writer":42}],44:[function(Y,Se,he){var j,P,W=Se.exports={};function Q(){throw new Error("setTimeout has not been defined")}function z(){throw new Error("clearTimeout has not been defined")}function v(K){if(j===setTimeout)return setTimeout(K,0);if((j===Q||!j)&&setTimeout)return j=setTimeout,setTimeout(K,0);try{return j(K,0)}catch(ce){try{return j.call(null,K,0)}catch(D){return j.call(this,K,0)}}}!function(){try{j="function"==typeof setTimeout?setTimeout:Q}catch(K){j=Q}try{P="function"==typeof clearTimeout?clearTimeout:z}catch(K){P=z}}();var b,O=[],A=!1,y=-1;function S(){!A||!b||(A=!1,b.length?O=b.concat(O):y=-1,O.length&&T())}function T(){if(!A){var K=v(S);A=!0;for(var ce=O.length;ce;){for(b=O,O=[];++y1)for(var D=1;D(j||(j=Promise.resolve())).then(P).catch(Q=>setTimeout(()=>{throw Q},0))}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],46:[function(Y,Se,he){Se.exports=Y("./lib")},{"./lib":55}],47:[function(Y,Se,he){"use strict";Se.exports=class Hq{constructor(j,P=new Map,Q=0){this.prefix=j,this._existing=P,this.counter=Q}clone(){const{prefix:j,_existing:P,counter:Q}=this;return new Hq(j,new Map(P),Q)}getId(j){const P=j&&this._existing.get(j);if(P)return P;const Q=this.prefix+this.counter;return this.counter++,j&&this._existing.set(j,Q),Q}hasId(j){return this._existing.has(j)}getOldIds(){return[...this._existing.keys()]}}},{}],48:[function(Y,Se,he){"use strict";Y("setimmediate");const W=self.crypto||self.msCrypto;Se.exports=class{constructor(P){if(!W||!W.subtle)throw new Error("crypto.subtle not found.");if("sha256"===P)this.algorithm={name:"SHA-256"};else{if("sha1"!==P)throw new Error(`Unsupport algorithm "${P}".`);this.algorithm={name:"SHA-1"}}this._content=""}update(P){this._content+=P}digest(){var P=this;return yt(function*(){const Q=(new TextEncoder).encode(P._content),z=new Uint8Array(yield W.subtle.digest(P.algorithm,Q));let v="";for(let x=0;x]*)>)|(_:(?:[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]*$'),Se.exports=class a2{static parse(K){const ce=[],D={},I=K.split(A.eoln);let X=0;for(const E of I){if(X++,A.empty.test(E))continue;const $=E.match(A.quad);if(null===$)throw new Error("N-Quads parse error on line "+X+".");const Z={subject:null,predicate:null,object:null,graph:null};if(Z.subject=void 0!==$[1]?{termType:z,value:$[1]}:{termType:v,value:$[2]},Z.predicate={termType:z,value:$[3]},void 0!==$[4]?Z.object={termType:z,value:$[4]}:void 0!==$[5]?Z.object={termType:v,value:$[5]}:(Z.object={termType:x,value:void 0,datatype:{termType:z}},void 0!==$[7]?Z.object.datatype.value=$[7]:void 0!==$[8]?(Z.object.datatype.value=P,Z.object.language=$[8]):Z.object.datatype.value=Q,Z.object.value=$[6].replace(T,function(K,ce,D,I){if(ce)switch(ce){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(I)throw new Error("Unsupported U escape")})),Z.graph=void 0!==$[9]?{termType:z,value:$[9]}:void 0!==$[10]?{termType:v,value:$[10]}:{termType:O,value:""},Z.graph.value in D){let oe=!0;const se=D[Z.graph.value];for(const te of se)if(b(te,Z)){oe=!1;break}oe&&(se.push(Z),ce.push(Z))}else D[Z.graph.value]=[Z],ce.push(Z)}return ce}static serialize(K){Array.isArray(K)||(K=a2.legacyDatasetToQuads(K));const ce=[];for(const D of K)ce.push(a2.serializeQuad(D));return ce.sort().join("")}static serializeQuad(K){const ce=K.subject,I=K.object,X=K.graph;let E="";return E+=ce.termType===z?`<${ce.value}>`:`${ce.value}`,E+=` <${K.predicate.value}> `,I.termType===z?E+=`<${I.value}>`:I.termType===v?E+=I.value:(E+=`"${R=I.value,R.replace(y,function(K){switch(K){case'"':return'\\"';case"\\":return"\\\\";case"\n":return"\\n";case"\r":return"\\r"}})}"`,I.datatype.value===P?I.language&&(E+=`@${I.language}`):I.datatype.value!==Q&&(E+=`^^<${I.datatype.value}>`)),X.termType===z?E+=` <${X.value}>`:X.termType===v&&(E+=` ${X.value}`),E+=" .\n",E;var R}static legacyDatasetToQuads(K){const ce=[],D={"blank node":v,IRI:z,literal:x};for(const I in K)K[I].forEach(E=>{const $={};for(const Z in E){const oe=E[Z],se={termType:D[oe.type],value:oe.value};se.termType===x&&(se.datatype={termType:z},"datatype"in oe&&(se.datatype.value=oe.datatype),"language"in oe?("datatype"in oe||(se.datatype.value=P),se.language=oe.language):"datatype"in oe||(se.datatype.value=Q)),$[Z]=se}$.graph="@default"===I?{termType:O,value:""}:{termType:I.startsWith("_:")?v:z,value:I},ce.push($)});return ce}};const y=/["\\\n\r]/g;const T=/(?:\\([tbnrf"'\\]))|(?:\\u([0-9A-Fa-f]{4}))|(?:\\U([0-9A-Fa-f]{8}))/g},{}],50:[function(Y,Se,he){"use strict";Se.exports=class{constructor(j){this.current=j.sort(),this.done=!1,this.dir=new Map;for(let P=0;Pz)&&(b&&O>0&&A>j[O-1]||!b&&Oj[O+1])&&(z=A,v=O)}if(null===z)this.done=!0;else{const O=P.get(z)?v-1:v+1;j[v]=j[O],j[O]=z;for(const A of j)A>z&&P.set(A,!P.get(A))}return Q}}},{}],51:[function(Y,Se,he){(function(W){(function(){"use strict";const j=Y("./IdentifierIssuer"),P=Y("./MessageDigest"),Q=Y("./Permuter"),z=Y("./NQuads");function v(x,O){return x.hashO.hash?1:0}Se.exports=class{constructor(){this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new j("_:c14n"),this.hashAlgorithm="sha256",this.quads=null}main(O){var A=this;return yt(function*(){A.quads=O;for(const K of O)A._addBlankNodeQuadInfo({quad:K,component:K.subject}),A._addBlankNodeQuadInfo({quad:K,component:K.object}),A._addBlankNodeQuadInfo({quad:K,component:K.graph});const b=new Map,y=[...A.blankNodeInfo.keys()];let S=0;for(const K of y)++S%100==0&&(yield A._yield()),yield A._hashAndTrackBlankNode({id:K,hashToBlankNodes:b});const T=[...b.keys()].sort(),V=[];for(const K of T){const ce=b.get(K);ce.length>1?V.push(ce):A.canonicalIssuer.getId(ce[0])}for(const K of V){const ce=[];for(const D of K){if(A.canonicalIssuer.hasId(D))continue;const I=new j("_:b");I.getId(D);const X=yield A.hashNDegreeQuads(D,I);ce.push(X)}ce.sort(v);for(const D of ce){const I=D.issuer.getOldIds();for(const X of I)A.canonicalIssuer.getId(X)}}const R=[];for(const K of A.quads){const ce=ot({},K);ce.subject=A._useCanonicalId({component:ce.subject}),ce.object=A._useCanonicalId({component:ce.object}),ce.graph=A._useCanonicalId({component:ce.graph}),R.push(z.serializeQuad(ce))}return R.sort(),R.join("")})()}hashFirstDegreeQuads(O){var A=this;return yt(function*(){const b=[],y=A.blankNodeInfo.get(O),S=y.quads;for(const V of S){const R={subject:null,predicate:V.predicate,object:null,graph:null};R.subject=A.modifyFirstDegreeComponent(O,V.subject,"subject"),R.object=A.modifyFirstDegreeComponent(O,V.object,"object"),R.graph=A.modifyFirstDegreeComponent(O,V.graph,"graph"),b.push(z.serializeQuad(R))}b.sort();const T=new P(A.hashAlgorithm);for(const V of b)T.update(V);return y.hash=yield T.digest(),y.hash})()}hashRelatedBlankNode(O,A,b,y){var S=this;return yt(function*(){let T;T=S.canonicalIssuer.hasId(O)?S.canonicalIssuer.getId(O):b.hasId(O)?b.getId(O):S.blankNodeInfo.get(O).hash;const V=new P(S.hashAlgorithm);return V.update(y),"g"!==y&&V.update(S.getRelatedPredicate(A)),V.update(T),V.digest()})()}hashNDegreeQuads(O,A){var b=this;return yt(function*(){const y=new P(b.hashAlgorithm),S=yield b.createHashToRelated(O,A),T=[...S.keys()].sort();for(const V of T){y.update(V);let K,R="";const ce=new Q(S.get(V));let D=0;for(;ce.hasNext();){const I=ce.next();++D%3==0&&(yield b._yield());let X=A.clone(),E="";const $=[];let Z=!1;for(const oe of I)if(b.canonicalIssuer.hasId(oe)?E+=b.canonicalIssuer.getId(oe):(X.hasId(oe)||$.push(oe),E+=X.getId(oe)),0!==R.length&&E>R){Z=!0;break}if(!Z){for(const oe of $){const se=yield b.hashNDegreeQuads(oe,X);if(E+=X.getId(oe),E+=`<${se.hash}>`,X=se.issuer,0!==R.length&&E>R){Z=!0;break}}Z||(0===R.length||E`}createHashToRelated(O,A){var b=this;return yt(function*(){const y=new Map,S=b.blankNodeInfo.get(O).quads;let T=0;for(const V of S)++T%100==0&&(yield b._yield()),yield Promise.all([b._addRelatedBlankNodeHash({quad:V,component:V.subject,position:"s",id:O,issuer:A,hashToRelated:y}),b._addRelatedBlankNodeHash({quad:V,component:V.object,position:"o",id:O,issuer:A,hashToRelated:y}),b._addRelatedBlankNodeHash({quad:V,component:V.graph,position:"g",id:O,issuer:A,hashToRelated:y})]);return y})()}_hashAndTrackBlankNode({id:O,hashToBlankNodes:A}){var b=this;return yt(function*(){const y=yield b.hashFirstDegreeQuads(O),S=A.get(y);S?S.push(O):A.set(y,[O])})()}_addBlankNodeQuadInfo({quad:O,component:A}){if("BlankNode"!==A.termType)return;const b=A.value,y=this.blankNodeInfo.get(b);y?y.quads.add(O):this.blankNodeInfo.set(b,{quads:new Set([O]),hash:null})}_addRelatedBlankNodeHash({quad:O,component:A,position:b,id:y,issuer:S,hashToRelated:T}){var V=this;return yt(function*(){if("BlankNode"!==A.termType||A.value===y)return;const R=A.value,K=yield V.hashRelatedBlankNode(R,O,S,b),ce=T.get(K);ce?ce.push(R):T.set(K,[R])})()}_useCanonicalId({component:O}){return"BlankNode"!==O.termType||O.value.startsWith(this.canonicalIssuer.prefix)?O:{termType:"BlankNode",value:this.canonicalIssuer.getId(O.value)}}_yield(){return yt(function*(){return new Promise(O=>W(O))})()}}}).call(this)}).call(this,Y("timers").setImmediate)},{"./IdentifierIssuer":47,"./MessageDigest":48,"./NQuads":49,"./Permuter":50,timers:89}],52:[function(Y,Se,he){"use strict";const W=Y("./IdentifierIssuer"),j=Y("./MessageDigest"),P=Y("./Permuter"),Q=Y("./NQuads");function z(v,x){return v.hashx.hash?1:0}Se.exports=class{constructor(){this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new W("_:c14n"),this.hashAlgorithm="sha256",this.quads=null}main(x){this.quads=x;for(const T of x)this._addBlankNodeQuadInfo({quad:T,component:T.subject}),this._addBlankNodeQuadInfo({quad:T,component:T.object}),this._addBlankNodeQuadInfo({quad:T,component:T.graph});const O=new Map,A=[...this.blankNodeInfo.keys()];for(const T of A)this._hashAndTrackBlankNode({id:T,hashToBlankNodes:O});const b=[...O.keys()].sort(),y=[];for(const T of b){const V=O.get(T);V.length>1?y.push(V):this.canonicalIssuer.getId(V[0])}for(const T of y){const V=[];for(const R of T){if(this.canonicalIssuer.hasId(R))continue;const K=new W("_:b");K.getId(R);const ce=this.hashNDegreeQuads(R,K);V.push(ce)}V.sort(z);for(const R of V){const K=R.issuer.getOldIds();for(const ce of K)this.canonicalIssuer.getId(ce)}}const S=[];for(const T of this.quads){const V=ot({},T);V.subject=this._useCanonicalId({component:V.subject}),V.object=this._useCanonicalId({component:V.object}),V.graph=this._useCanonicalId({component:V.graph}),S.push(Q.serializeQuad(V))}return S.sort(),S.join("")}hashFirstDegreeQuads(x){const O=[],A=this.blankNodeInfo.get(x),b=A.quads;for(const S of b){const T={subject:null,predicate:S.predicate,object:null,graph:null};T.subject=this.modifyFirstDegreeComponent(x,S.subject,"subject"),T.object=this.modifyFirstDegreeComponent(x,S.object,"object"),T.graph=this.modifyFirstDegreeComponent(x,S.graph,"graph"),O.push(Q.serializeQuad(T))}O.sort();const y=new j(this.hashAlgorithm);for(const S of O)y.update(S);return A.hash=y.digest(),A.hash}hashRelatedBlankNode(x,O,A,b){let y;y=this.canonicalIssuer.hasId(x)?this.canonicalIssuer.getId(x):A.hasId(x)?A.getId(x):this.blankNodeInfo.get(x).hash;const S=new j(this.hashAlgorithm);return S.update(b),"g"!==b&&S.update(this.getRelatedPredicate(O)),S.update(y),S.digest()}hashNDegreeQuads(x,O){const A=new j(this.hashAlgorithm),b=this.createHashToRelated(x,O),y=[...b.keys()].sort();for(const S of y){A.update(S);let V,T="";const R=new P(b.get(S));for(;R.hasNext();){const K=R.next();let ce=O.clone(),D="";const I=[];let X=!1;for(const E of K)if(this.canonicalIssuer.hasId(E)?D+=this.canonicalIssuer.getId(E):(ce.hasId(E)||I.push(E),D+=ce.getId(E)),0!==T.length&&D>T){X=!0;break}if(!X){for(const E of I){const $=this.hashNDegreeQuads(E,ce);if(D+=ce.getId(E),D+=`<${$.hash}>`,ce=$.issuer,0!==T.length&&D>T){X=!0;break}}X||(0===T.length||D`}createHashToRelated(x,O){const A=new Map,b=this.blankNodeInfo.get(x).quads;for(const y of b)this._addRelatedBlankNodeHash({quad:y,component:y.subject,position:"s",id:x,issuer:O,hashToRelated:A}),this._addRelatedBlankNodeHash({quad:y,component:y.object,position:"o",id:x,issuer:O,hashToRelated:A}),this._addRelatedBlankNodeHash({quad:y,component:y.graph,position:"g",id:x,issuer:O,hashToRelated:A});return A}_hashAndTrackBlankNode({id:x,hashToBlankNodes:O}){const A=this.hashFirstDegreeQuads(x),b=O.get(A);b?b.push(x):O.set(A,[x])}_addBlankNodeQuadInfo({quad:x,component:O}){if("BlankNode"!==O.termType)return;const A=O.value,b=this.blankNodeInfo.get(A);b?b.quads.add(x):this.blankNodeInfo.set(A,{quads:new Set([x]),hash:null})}_addRelatedBlankNodeHash({quad:x,component:O,position:A,id:b,issuer:y,hashToRelated:S}){if("BlankNode"!==O.termType||O.value===b)return;const T=O.value,V=this.hashRelatedBlankNode(T,x,y,A),R=S.get(V);R?R.push(T):S.set(V,[T])}_useCanonicalId({component:x}){return"BlankNode"!==x.termType||x.value.startsWith(this.canonicalIssuer.prefix)?x:{termType:"BlankNode",value:this.canonicalIssuer.getId(x.value)}}}},{"./IdentifierIssuer":47,"./MessageDigest":48,"./NQuads":49,"./Permuter":50}],53:[function(Y,Se,he){"use strict";const W=Y("./URDNA2015");Se.exports=class extends W{constructor(){super(),this.name="URGNA2012",this.hashAlgorithm="sha1"}modifyFirstDegreeComponent(P,Q,z){return"BlankNode"!==Q.termType?Q:"graph"===z?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:Q.value===P?"_:a":"_:z"}}getRelatedPredicate(P){return P.predicate.value}createHashToRelated(P,Q){var z=this;return yt(function*(){const v=new Map,x=z.blankNodeInfo.get(P).quads;let O=0;for(const A of x){let b,y;if("BlankNode"===A.subject.termType&&A.subject.value!==P)y=A.subject.value,b="p";else{if("BlankNode"!==A.object.termType||A.object.value===P)continue;y=A.object.value,b="r"}++O%100==0&&(yield z._yield());const S=yield z.hashRelatedBlankNode(y,A,Q,b),T=v.get(S);T?T.push(y):v.set(S,[y])}return v})()}}},{"./URDNA2015":51}],54:[function(Y,Se,he){"use strict";const W=Y("./URDNA2015Sync");Se.exports=class extends W{constructor(){super(),this.name="URGNA2012",this.hashAlgorithm="sha1"}modifyFirstDegreeComponent(P,Q,z){return"BlankNode"!==Q.termType?Q:"graph"===z?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:Q.value===P?"_:a":"_:z"}}getRelatedPredicate(P){return P.predicate.value}createHashToRelated(P,Q){const z=new Map,v=this.blankNodeInfo.get(P).quads;for(const x of v){let O,A;if("BlankNode"===x.subject.termType&&x.subject.value!==P)A=x.subject.value,O="p";else{if("BlankNode"!==x.object.termType||x.object.value===P)continue;A=x.object.value,O="r"}const b=this.hashRelatedBlankNode(A,x,Q,O),y=z.get(b);y?y.push(A):z.set(b,[A])}return z}}},{"./URDNA2015Sync":52}],55:[function(Y,Se,he){"use strict";const W=Y("./URDNA2015"),j=Y("./URGNA2012"),P=Y("./URDNA2015Sync"),Q=Y("./URGNA2012Sync");let z;try{z=Y("rdf-canonize-native")}catch(x){}const v={};Se.exports=v,v.NQuads=Y("./NQuads"),v.IdentifierIssuer=Y("./IdentifierIssuer"),v._rdfCanonizeNative=function(x){return x&&(z=x),z},v.canonize=function(){var x=yt(function*(O,A){if(Array.isArray(O)||(O=v.NQuads.legacyDatasetToQuads(O)),A.useNative){if(!z)throw new Error("rdf-canonize-native not available");return new Promise((b,y)=>z.canonize(O,A,(S,T)=>S?y(S):b(T)))}if("URDNA2015"===A.algorithm)return new W(A).main(O);if("URGNA2012"===A.algorithm)return new j(A).main(O);throw"algorithm"in A?new Error("Invalid RDF Dataset Canonicalization algorithm: "+A.algorithm):new Error("No RDF Dataset Canonicalization algorithm specified.")});return function(O,A){return x.apply(this,arguments)}}(),v._canonizeSync=function(x,O){if(Array.isArray(x)||(x=v.NQuads.legacyDatasetToQuads(x)),O.useNative){if(z)return z.canonizeSync(x,O);throw new Error("rdf-canonize-native not available")}if("URDNA2015"===O.algorithm)return new P(O).main(x);if("URGNA2012"===O.algorithm)return new Q(O).main(x);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(Y,Se,he){"use strict";var W=this&&this.__createBinding||(Object.create?function(P,Q,z,v){void 0===v&&(v=z),Object.defineProperty(P,v,{enumerable:!0,get:function(){return Q[z]}})}:function(P,Q,z,v){void 0===v&&(v=z),P[v]=Q[z]}),j=this&&this.__exportStar||function(P,Q){for(var z in P)"default"!==z&&!Object.prototype.hasOwnProperty.call(Q,z)&&W(Q,P,z)};Object.defineProperty(he,"__esModule",{value:!0}),j(Y("./lib/BlankNode"),he),j(Y("./lib/DataFactory"),he),j(Y("./lib/DefaultGraph"),he),j(Y("./lib/Literal"),he),j(Y("./lib/NamedNode"),he),j(Y("./lib/Quad"),he),j(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,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.BlankNode=void 0;he.BlankNode=class{constructor(P){this.termType="BlankNode",this.value=P}equals(P){return!!P&&"BlankNode"===P.termType&&P.value===this.value}}},{}],58:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.DataFactory=void 0;const W=Y("./BlankNode"),j=Y("./DefaultGraph"),P=Y("./Literal"),Q=Y("./NamedNode"),z=Y("./Quad"),v=Y("./Variable");let x=0;he.DataFactory=class{constructor(b){this.blankNodeCounter=0,this.blankNodePrefix=(b=b||{}).blankNodePrefix||`df_${x++}_`}namedNode(b){return new Q.NamedNode(b)}blankNode(b){return new W.BlankNode(b||`${this.blankNodePrefix}${this.blankNodeCounter++}`)}literal(b,y){return new P.Literal(b,y)}variable(b){return new v.Variable(b)}defaultGraph(){return j.DefaultGraph.INSTANCE}quad(b,y,S,T){return new z.Quad(b,y,S,T||this.defaultGraph())}fromTerm(b){switch(b.termType){case"NamedNode":return this.namedNode(b.value);case"BlankNode":return this.blankNode(b.value);case"Literal":return b.language?this.literal(b.value,b.language):b.datatype.equals(P.Literal.XSD_STRING)?this.literal(b.value):this.literal(b.value,this.fromTerm(b.datatype));case"Variable":return this.variable(b.value);case"DefaultGraph":return this.defaultGraph();case"Quad":return this.quad(this.fromTerm(b.subject),this.fromTerm(b.predicate),this.fromTerm(b.object),this.fromTerm(b.graph))}}fromQuad(b){return this.fromTerm(b)}resetBlankNodeCounter(){this.blankNodeCounter=0}}},{"./BlankNode":57,"./DefaultGraph":59,"./Literal":60,"./NamedNode":61,"./Quad":62,"./Variable":63}],59:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.DefaultGraph=void 0;class W{constructor(){this.termType="DefaultGraph",this.value=""}equals(P){return!!P&&"DefaultGraph"===P.termType}}he.DefaultGraph=W,W.INSTANCE=new W},{}],60:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.Literal=void 0;const W=Y("./NamedNode");class j{constructor(Q,z){this.termType="Literal",this.value=Q,"string"==typeof z?(this.language=z,this.datatype=j.RDF_LANGUAGE_STRING):z?(this.language="",this.datatype=z):(this.language="",this.datatype=j.XSD_STRING)}equals(Q){return!!Q&&"Literal"===Q.termType&&Q.value===this.value&&Q.language===this.language&&Q.datatype.equals(this.datatype)}}he.Literal=j,j.RDF_LANGUAGE_STRING=new W.NamedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),j.XSD_STRING=new W.NamedNode("http://www.w3.org/2001/XMLSchema#string")},{"./NamedNode":61}],61:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.NamedNode=void 0;he.NamedNode=class{constructor(P){this.termType="NamedNode",this.value=P}equals(P){return!!P&&"NamedNode"===P.termType&&P.value===this.value}}},{}],62:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.Quad=void 0;he.Quad=class{constructor(P,Q,z,v){this.termType="Quad",this.value="",this.subject=P,this.predicate=Q,this.object=z,this.graph=v}equals(P){return!!P&&("Quad"===P.termType||!P.termType)&&this.subject.equals(P.subject)&&this.predicate.equals(P.predicate)&&this.object.equals(P.object)&&this.graph.equals(P.graph)}}},{}],63:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.Variable=void 0;he.Variable=class{constructor(P){this.termType="Variable",this.value=P}equals(P){return!!P&&"Variable"===P.termType&&P.value===this.value}}},{}],64:[function(Y,Se,he){"use strict";var W=this&&this.__createBinding||(Object.create?function(P,Q,z,v){void 0===v&&(v=z),Object.defineProperty(P,v,{enumerable:!0,get:function(){return Q[z]}})}:function(P,Q,z,v){void 0===v&&(v=z),P[v]=Q[z]}),j=this&&this.__exportStar||function(P,Q){for(var z in P)"default"!==z&&!Object.prototype.hasOwnProperty.call(Q,z)&&W(Q,P,z)};Object.defineProperty(he,"__esModule",{value:!0}),j(Y("./lib/RdfXmlParser"),he)},{"./lib/RdfXmlParser":66}],65:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.ParseError=void 0;class W extends Error{constructor(P,Q){const z=P.saxStream._parser;super(P.trackPosition?`Line ${z.line+1} column ${z.column+1}: ${Q}`:Q)}}he.ParseError=W},{}],66:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.ParseType=he.RdfXmlParser=void 0;const W=Y("relative-to-absolute-iri"),j=Y("sax"),P=Y("stream"),Q=Y("./ParseError"),z=Y("rdf-data-factory");class v extends P.Transform{constructor(A){super({readableObjectMode:!0}),this.activeTagStack=[],this.nodeIds={},A&&(Object.assign(this,A),this.options=A),this.dataFactory||(this.dataFactory=new z.DataFactory),this.baseIRI||(this.baseIRI=""),this.defaultGraph||(this.defaultGraph=this.dataFactory.defaultGraph()),this.saxStream=j.createStream(this.strict,{xmlns:!1,position:this.trackPosition}),this.strict||(this.saxStream._parser.looseCase="toString"),this.attachSaxListeners()}static parseNamespace(A,b){const y={};let S=!1;for(const V in A.attributes)V.startsWith("xmlns")&&(5===V.length?(S=!0,y[""]=A.attributes[V]):":"===V.charAt(5)&&(S=!0,y[V.substr(6)]=A.attributes[V]));const T=b&&b.ns?b.ns:[v.DEFAULT_NS];return S?T.concat([y]):T}static expandPrefixedTerm(A,b,y){const S=A.indexOf(":");let T,V;S>=0?(T=A.substr(0,S),V=A.substr(S+1)):(T="",V=A);let R=null,K=null;for(let ce=b.length-1;ce>=0;ce--){const D=b[ce][T];if(D){R=D;break}K||(K=b[ce][""])}if(!R){if(T&&"xmlns"!==T)throw new Q.ParseError(y,`The prefix '${T}' in term '${A}' was not bound.`);R=K||""}return{prefix:T,local:V,uri:R}}static isValidIri(A){return v.IRI_REGEX.test(A)}import(A){const b=new P.PassThrough({readableObjectMode:!0});A.on("error",S=>y.emit("error",S)),A.on("data",S=>b.push(S)),A.on("end",()=>b.push(null));const y=b.pipe(new v(this.options));return y}_transform(A,b,y){try{this.saxStream.write(A,b)}catch(S){return y(S)}y()}newParseError(A){return new Q.ParseError(this,A)}valueToUri(A,b){return this.uriToNamedNode(W.resolve(A,b.baseIRI))}uriToNamedNode(A){if(!v.isValidIri(A))throw this.newParseError(`Invalid URI: ${A}`);return this.dataFactory.namedNode(A)}validateNcname(A){if(!v.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 b=this.activeTagStack.length?this.activeTagStack[this.activeTagStack.length-1]:null;let y=x.RESOURCE;if(b&&(b.hadChildren=!0,y=b.childrenParseType),b&&b.childrenStringTags){const T=A.name;let V="";for(const D in A.attributes)V+=` ${D}="${A.attributes[D]}"`;b.childrenStringTags.push(`<${T}${V}>`);const ce={childrenStringTags:b.childrenStringTags};return ce.childrenStringEmitClosingTag=``,void this.activeTagStack.push(ce)}const S={};b?(S.language=b.language,S.baseIRI=b.baseIRI):S.baseIRI=this.baseIRI,this.activeTagStack.push(S),S.ns=v.parseNamespace(A,b),y===x.RESOURCE?this.onTagResource(A,S,b,!b):this.onTagProperty(A,S,b)}onTagResource(A,b,y,S){const T=v.expandPrefixedTerm(A.name,b.ns,this);b.childrenParseType=x.PROPERTY;let V=!0;if(T.uri===v.RDF){if(!S&&v.FORBIDDEN_NODE_ELEMENTS.indexOf(T.local)>=0)throw this.newParseError(`Illegal node element name: ${T.local}`);switch(T.local){case"RDF":b.childrenParseType=x.RESOURCE;case"Description":V=!1}}const R=[],K=[];let ce=null,D=!1,I=!1,X=null;for(const E in A.attributes){const $=A.attributes[E],Z=v.expandPrefixedTerm(E,b.ns,this);if(y&&Z.uri===v.RDF)switch(Z.local){case"about":if(ce)throw this.newParseError(`Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ${$} and ${ce} where found.`);ce=$;continue;case"ID":if(ce)throw this.newParseError(`Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ${$} and ${ce} where found.`);this.validateNcname($),ce="#"+$,D=!0;continue;case"nodeID":if(ce)throw this.newParseError(`Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ${$} and ${ce} where found.`);this.validateNcname($),ce=$,I=!0;continue;case"bagID":throw this.newParseError("rdf:bagID is not supported.");case"type":X=$;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(Z.uri===v.XML){if("lang"===Z.local){b.language=""===$?null:$.toLowerCase();continue}if("base"===Z.local){b.baseIRI=W.resolve($,b.baseIRI);continue}}"xml"!==Z.prefix&&Z.uri&&(R.push(this.uriToNamedNode(Z.uri+Z.local)),K.push($))}if(null!==ce&&(b.subject=I?this.dataFactory.blankNode(ce):this.valueToUri(ce,b),D&&this.claimNodeId(b.subject)),b.subject||(b.subject=this.dataFactory.blankNode()),V){const E=this.uriToNamedNode(T.uri+T.local);this.emitTriple(b.subject,this.dataFactory.namedNode(v.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(v.RDF+"first"),b.subject,b.reifiedStatementId),y.childrenCollectionSubject=E,y.childrenCollectionPredicate=this.dataFactory.namedNode(v.RDF+"rest")}else{this.emitTriple(y.subject,y.predicate,b.subject,y.reifiedStatementId);for(let E=0;E=0)throw this.newParseError(`Illegal property element name: ${S.local}`);b.predicateSubPredicates=[],b.predicateSubObjects=[];let T=!1,V=!1,R=null,K=!0;const ce=[],D=[];for(const I in A.attributes){const X=A.attributes[I],E=v.expandPrefixedTerm(I,b.ns,this);if(E.uri===v.RDF)switch(E.local){case"resource":if(R)throw this.newParseError(`Found both rdf:resource (${X}) and rdf:nodeID (${R}).`);if(T)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:resource (${X})`);b.hadChildren=!0,R=X,K=!1;continue;case"datatype":if(V)throw this.newParseError(`Found both non-rdf:* property attributes and rdf:datatype (${X}).`);if(T)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:datatype (${X})`);b.datatype=this.valueToUri(X,b);continue;case"nodeID":if(V)throw this.newParseError(`Found both non-rdf:* property attributes and rdf:nodeID (${X}).`);if(b.hadChildren)throw this.newParseError(`Found both rdf:resource and rdf:nodeID (${X}).`);if(T)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:nodeID (${X})`);this.validateNcname(X),b.hadChildren=!0,R=X,K=!0;continue;case"bagID":throw this.newParseError("rdf:bagID is not supported.");case"parseType":if(V)throw this.newParseError("rdf:parseType is not allowed when non-rdf:* property attributes are present");if(b.datatype)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:datatype (${b.datatype.value})`);if(R)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:nodeID or rdf:resource (${R})`);if("Resource"===X){T=!0,b.childrenParseType=x.PROPERTY;const $=this.dataFactory.blankNode();this.emitTriple(b.subject,b.predicate,$,b.reifiedStatementId),b.subject=$,b.predicate=null}else"Collection"===X?(T=!0,b.hadChildren=!0,b.childrenCollectionSubject=b.subject,b.childrenCollectionPredicate=b.predicate,K=!1):"Literal"===X&&(T=!0,b.childrenTagsToString=!0,b.childrenStringTags=[]);continue;case"ID":this.validateNcname(X),b.reifiedStatementId=this.valueToUri("#"+X,b),this.claimNodeId(b.reifiedStatementId);continue}else if(E.uri===v.XML&&"lang"===E.local){b.language=""===X?null:X.toLowerCase();continue}if("xml"!==E.prefix&&"xmlns"!==E.prefix&&E.uri){if(T||b.datatype)throw this.newParseError(`Found illegal rdf:* properties on property element with attribute: ${X}`);b.hadChildren=!0,V=!0,ce.push(this.uriToNamedNode(E.uri+E.local)),D.push(this.dataFactory.literal(X,b.datatype||b.language))}}if(null!==R){const I=b.subject;b.subject=K?this.dataFactory.blankNode(R):this.valueToUri(R,b),this.emitTriple(I,b.predicate,b.subject,b.reifiedStatementId);for(let X=0;X/g,(b,y,S)=>(this.saxStream._parser.ENTITIES[y]=S,""))}}var x,O;he.RdfXmlParser=v,v.IRI_REGEX=/^([A-Za-z][A-Za-z0-9+-.]*):[^ "<>{}|\\\[\]`]*$/,v.MIME_TYPE="application/rdf+xml",v.RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#",v.XML="http://www.w3.org/XML/1998/namespace",v.XMLNS="http://www.w3.org/2000/xmlns/",v.DEFAULT_NS={xml:v.XML},v.FORBIDDEN_NODE_ELEMENTS=["RDF","ID","about","bagID","parseType","resource","nodeID","li","aboutEach","aboutEachPrefix"],v.FORBIDDEN_PROPERTY_ELEMENTS=["Description","RDF","ID","about","bagID","parseType","resource","nodeID","aboutEach","aboutEachPrefix"],v.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=x=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(Y,Se,he){"use strict";var j={};function P(O,A,b){b||(b=Error);var S=function(T){function V(R,K,ce){return T.call(this,function(T,V,R){return"string"==typeof A?A:A(T,V,R)}(R,K,ce))||this}return function(O,A){O.prototype=Object.create(A.prototype),O.prototype.constructor=O,O.__proto__=A}(V,T),V}(b);S.prototype.name=b.name,S.prototype.code=O,j[O]=S}function Q(O,A){if(Array.isArray(O)){var b=O.length;return O=O.map(function(y){return String(y)}),b>2?"one of ".concat(A," ").concat(O.slice(0,b-1).join(", "),", or ")+O[b-1]:2===b?"one of ".concat(A," ").concat(O[0]," or ").concat(O[1]):"of ".concat(A," ").concat(O[0])}return"of ".concat(A," ").concat(String(O))}P("ERR_INVALID_OPT_VALUE",function(O,A){return'The value "'+A+'" is invalid for option "'+O+'"'},TypeError),P("ERR_INVALID_ARG_TYPE",function(O,A,b){var y,S;if("string"==typeof A&&function(O,A,b){return O.substr(!b||b<0?0:+b,A.length)===A}(A,"not ")?(y="must not be",A=A.replace(/^not /,"")):y="must be",function(O,A,b){return(void 0===b||b>O.length)&&(b=O.length),O.substring(b-A.length,b)===A}(O," argument"))S="The ".concat(O," ").concat(y," ").concat(Q(A,"type"));else{var T=function(O,A,b){return"number"!=typeof b&&(b=0),!(b+A.length>O.length)&&-1!==O.indexOf(A,b)}(O,".")?"property":"argument";S='The "'.concat(O,'" ').concat(T," ").concat(y," ").concat(Q(A,"type"))}return S+". Received type ".concat(typeof b)},TypeError),P("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),P("ERR_METHOD_NOT_IMPLEMENTED",function(O){return"The "+O+" method is not implemented"}),P("ERR_STREAM_PREMATURE_CLOSE","Premature close"),P("ERR_STREAM_DESTROYED",function(O){return"Cannot call "+O+" after a stream was destroyed"}),P("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),P("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),P("ERR_STREAM_WRITE_AFTER_END","write after end"),P("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),P("ERR_UNKNOWN_ENCODING",function(O){return"Unknown encoding: "+O},TypeError),P("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),Se.exports.codes=j},{}],68:[function(Y,Se,he){(function(W){(function(){"use strict";var j=Object.keys||function(y){var S=[];for(var T in y)S.push(T);return S};Se.exports=O;var P=Y("./_stream_readable"),Q=Y("./_stream_writable");Y("inherits")(O,P);for(var z=j(Q.prototype),v=0;v0)if("string"!=typeof L&&!Qe.objectMode&&Object.getPrototypeOf(L)!==x.prototype&&(L=function(ve){return x.from(ve)}(L)),B)Qe.endEmitted?se(ve,new E):Ie(ve,Qe,L,!0);else if(Qe.ended)se(ve,new I);else{if(Qe.destroyed)return!1;Qe.reading=!1,Qe.decoder&&!N?(L=Qe.decoder.write(L),Qe.objectMode||0!==L.length?Ie(ve,Qe,L,!1):Ke(ve,Qe)):Ie(ve,Qe,L,!1)}else B||(Qe.reading=!1,Ke(ve,Qe));return!Qe.ended&&(Qe.lengthL.highWaterMark&&(L.highWaterMark=function(ve){return ve>=st?ve=st:(ve--,ve|=ve>>>1,ve|=ve>>>2,ve|=ve>>>4,ve|=ve>>>8,ve|=ve>>>16,ve++),ve}(ve)),ve<=L.length?ve:L.ended?L.length:(L.needReadable=!0,0))}function Ue(ve){var L=ve._readableState;S("emitReadable",L.needReadable,L.emittedReadable),L.needReadable=!1,L.emittedReadable||(S("emitReadable",L.flowing),L.emittedReadable=!0,W.nextTick(ke,ve))}function ke(ve){var L=ve._readableState;S("emitReadable_",L.destroyed,L.length,L.ended),!L.destroyed&&(L.length||L.ended)&&(ve.emit("readable"),L.emittedReadable=!1),L.needReadable=!L.flowing&&!L.ended&&L.length<=L.highWaterMark,pe(ve)}function Ke(ve,L){L.readingMore||(L.readingMore=!0,W.nextTick(Me,ve,L))}function Me(ve,L){for(;!L.reading&&!L.ended&&(L.length0,L.resumeScheduled&&!L.paused?L.flowing=!0:ve.listenerCount("data")>0&&ve.resume()}function Ne(ve){S("readable nexttick read 0"),ve.read(0)}function G(ve,L){S("resume",L.reading),L.reading||ve.read(0),L.resumeScheduled=!1,ve.emit("resume"),pe(ve),L.flowing&&!L.reading&&ve.read(0)}function pe(ve){var L=ve._readableState;for(S("flow",L.flowing);L.flowing&&null!==ve.read(););}function ue(ve,L){return 0===L.length?null:(L.objectMode?N=L.buffer.shift():!ve||ve>=L.length?(N=L.decoder?L.buffer.join(""):1===L.buffer.length?L.buffer.first():L.buffer.concat(L.length),L.buffer.clear()):N=L.buffer.consume(ve,L.decoder),N);var N}function je(ve){var L=ve._readableState;S("endReadable",L.endEmitted),L.endEmitted||(L.ended=!0,W.nextTick(_t,L,ve))}function _t(ve,L){if(S("endReadableNT",ve.endEmitted,ve.length),!ve.endEmitted&&0===ve.length&&(ve.endEmitted=!0,L.readable=!1,L.emit("end"),ve.autoDestroy)){var N=L._writableState;(!N||N.autoDestroy&&N.finished)&&L.destroy()}}function pt(ve,L){for(var N=0,B=ve.length;N=L.highWaterMark:L.length>0)||L.ended))return S("read: emitReadable",L.length,L.ended),0===L.length&&L.ended?je(this):Ue(this),null;if(0===(ve=tt(ve,L))&&L.ended)return 0===L.length&&je(this),null;var Re,B=L.needReadable;return S("need readable",B),(0===L.length||L.length-ve0?ue(ve,L):null)?(L.needReadable=L.length<=L.highWaterMark,ve=0):(L.length-=ve,L.awaitDrain=0),0===L.length&&(L.ended||(L.needReadable=!0),N!==ve&&L.ended&&je(this)),null!==Re&&this.emit("data",Re),Re},ne.prototype._read=function(ve){se(this,new X("_read()"))},ne.prototype.pipe=function(ve,L){var N=this,B=this._readableState;switch(B.pipesCount){case 0:B.pipes=ve;break;case 1:B.pipes=[B.pipes,ve];break;default:B.pipes.push(ve)}B.pipesCount+=1,S("pipe count=%d opts=%j",B.pipesCount,L);var Qe=L&&!1===L.end||ve===W.stdout||ve===W.stderr?gs:Nt;function St(Bs,Qr){S("onunpipe"),Bs===N&&Qr&&!1===Qr.hasUnpiped&&(Qr.hasUnpiped=!0,S("cleanup"),ve.removeListener("close",Xr),ve.removeListener("finish",Ls),ve.removeListener("drain",On),ve.removeListener("error",wi),ve.removeListener("unpipe",St),N.removeListener("end",Nt),N.removeListener("end",gs),N.removeListener("data",Ti),kn=!0,B.awaitDrain&&(!ve._writableState||ve._writableState.needDrain)&&On())}function Nt(){S("onend"),ve.end()}B.endEmitted?W.nextTick(Qe):N.once("end",Qe),ve.on("unpipe",St);var On=function(ve){return function(){var N=ve._readableState;S("pipeOnDrain",N.awaitDrain),N.awaitDrain&&N.awaitDrain--,0===N.awaitDrain&&z(ve,"data")&&(N.flowing=!0,pe(ve))}}(N);ve.on("drain",On);var kn=!1;function Ti(Bs){S("ondata");var Qr=ve.write(Bs);S("dest.write",Qr),!1===Qr&&((1===B.pipesCount&&B.pipes===ve||B.pipesCount>1&&-1!==pt(B.pipes,ve))&&!kn&&(S("false write response, pause",B.awaitDrain),B.awaitDrain++),N.pause())}function wi(Bs){S("onerror",Bs),gs(),ve.removeListener("error",wi),0===z(ve,"error")&&se(ve,Bs)}function Xr(){ve.removeListener("finish",Ls),gs()}function Ls(){S("onfinish"),ve.removeListener("close",Xr),gs()}function gs(){S("unpipe"),N.unpipe(ve)}return N.on("data",Ti),function(ve,L,N){if("function"==typeof ve.prependListener)return ve.prependListener(L,N);ve._events&&ve._events[L]?Array.isArray(ve._events[L])?ve._events[L].unshift(N):ve._events[L]=[N,ve._events[L]]:ve.on(L,N)}(ve,"error",wi),ve.once("close",Xr),ve.once("finish",Ls),ve.emit("pipe",N),B.flowing||(S("pipe resume"),N.resume()),ve},ne.prototype.unpipe=function(ve){var L=this._readableState,N={hasUnpiped:!1};if(0===L.pipesCount)return this;if(1===L.pipesCount)return ve&&ve!==L.pipes||(ve||(ve=L.pipes),L.pipes=null,L.pipesCount=0,L.flowing=!1,ve&&ve.emit("unpipe",this,N)),this;if(!ve){var B=L.pipes,Re=L.pipesCount;L.pipes=null,L.pipesCount=0,L.flowing=!1;for(var Qe=0;Qe0,!1!==B.flowing&&this.resume()):"readable"===ve&&!B.endEmitted&&!B.readableListening&&(B.readableListening=B.needReadable=!0,B.flowing=!1,B.emittedReadable=!1,S("on readable",B.length,B.reading),B.length?Ue(this):B.reading||W.nextTick(Ne,this)),N},ne.prototype.removeListener=function(ve,L){var N=v.prototype.removeListener.call(this,ve,L);return"readable"===ve&&W.nextTick($e,this),N},ne.prototype.removeAllListeners=function(ve){var L=v.prototype.removeAllListeners.apply(this,arguments);return("readable"===ve||void 0===ve)&&W.nextTick($e,this),L},ne.prototype.resume=function(){var ve=this._readableState;return ve.flowing||(S("resume"),ve.flowing=!ve.readableListening,function(ve,L){L.resumeScheduled||(L.resumeScheduled=!0,W.nextTick(G,ve,L))}(this,ve)),ve.paused=!1,this},ne.prototype.pause=function(){return S("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(S("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},ne.prototype.wrap=function(ve){var L=this,N=this._readableState,B=!1;for(var Re in ve.on("end",function(){if(S("wrapped end"),N.decoder&&!N.ended){var St=N.decoder.end();St&&St.length&&L.push(St)}L.push(null)}),ve.on("data",function(St){S("wrapped data"),N.decoder&&(St=N.decoder.write(St)),N.objectMode&&null==St||!(N.objectMode||St&&St.length)||L.push(St)||(B=!0,ve.pause())}),ve)void 0===this[Re]&&"function"==typeof ve[Re]&&(this[Re]=function(Nt){return function(){return ve[Nt].apply(ve,arguments)}}(Re));for(var Qe=0;Qe-1))throw new Z(ue);return this._writableState.defaultEncoding=ue,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(pe,ue,je){je(new ce("_write()"))},me.prototype._writev=null,me.prototype.end=function(pe,ue,je){var _t=this._writableState;return"function"==typeof pe?(je=pe,pe=null,ue=null):"function"==typeof ue&&(je=ue,ue=null),null!=pe&&this.write(pe,ue),_t.corked&&(_t.corked=1,this.uncork()),_t.ending||function(pe,ue,je){ue.ending=!0,Ne(pe,ue),je&&(ue.finished?W.nextTick(je):pe.once("finish",je)),ue.ended=!0,pe.writable=!1}(this,_t,je),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(ue){!this._writableState||(this._writableState.destroyed=ue)}}),me.prototype.destroy=S.destroy,me.prototype._undestroy=S.undestroy,me.prototype._destroy=function(pe,ue){ue(pe)}}).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,Se,he){(function(W){(function(){"use strict";var j;function P(I,X,E){return X in I?Object.defineProperty(I,X,{value:E,enumerable:!0,configurable:!0,writable:!0}):I[X]=E,I}var Q=Y("./end-of-stream"),z=Symbol("lastResolve"),v=Symbol("lastReject"),x=Symbol("error"),O=Symbol("ended"),A=Symbol("lastPromise"),b=Symbol("handlePromise"),y=Symbol("stream");function S(I,X){return{value:I,done:X}}function T(I){var X=I[z];if(null!==X){var E=I[y].read();null!==E&&(I[A]=null,I[z]=null,I[v]=null,X(S(E,!1)))}}function V(I){W.nextTick(T,I)}var K=Object.getPrototypeOf(function(){}),ce=Object.setPrototypeOf((P(j={get stream(){return this[y]},next:function(){var X=this,E=this[x];if(null!==E)return Promise.reject(E);if(this[O])return Promise.resolve(S(void 0,!0));if(this[y].destroyed)return new Promise(function(se,te){W.nextTick(function(){X[x]?te(X[x]):se(S(void 0,!0))})});var Z,$=this[A];if($)Z=new Promise(function(I,X){return function(E,$){I.then(function(){X[O]?E(S(void 0,!0)):X[b](E,$)},$)}}($,this));else{var oe=this[y].read();if(null!==oe)return Promise.resolve(S(oe,!1));Z=new Promise(this[b])}return this[A]=Z,Z}},Symbol.asyncIterator,function(){return this}),P(j,"return",function(){var X=this;return new Promise(function(E,$){X[y].destroy(null,function(Z){Z?$(Z):E(S(void 0,!0))})})}),j),K);Se.exports=function(X){var E,$=Object.create(ce,(P(E={},y,{value:X,writable:!0}),P(E,z,{value:null,writable:!0}),P(E,v,{value:null,writable:!0}),P(E,x,{value:null,writable:!0}),P(E,O,{value:X._readableState.endEmitted,writable:!0}),P(E,b,{value:function(oe,se){var te=$[y].read();te?($[A]=null,$[z]=null,$[v]=null,oe(S(te,!1))):($[z]=oe,$[v]=se)},writable:!0}),E));return $[A]=null,Q(X,function(Z){if(Z&&"ERR_STREAM_PREMATURE_CLOSE"!==Z.code){var oe=$[v];return null!==oe&&($[A]=null,$[z]=null,$[v]=null,oe(Z)),void($[x]=Z)}var se=$[z];null!==se&&($[A]=null,$[z]=null,$[v]=null,se(S(void 0,!0))),$[O]=!0}),X.on("readable",V.bind(null,$)),$}}).call(this)}).call(this,Y("_process"))},{"./end-of-stream":76,_process:44}],74:[function(Y,Se,he){"use strict";function W(T,V){var R=Object.keys(T);if(Object.getOwnPropertySymbols){var K=Object.getOwnPropertySymbols(T);V&&(K=K.filter(function(ce){return Object.getOwnPropertyDescriptor(T,ce).enumerable})),R.push.apply(R,K)}return R}function P(T,V,R){return V in T?Object.defineProperty(T,V,{value:R,enumerable:!0,configurable:!0,writable:!0}):T[V]=R,T}function z(T,V){for(var R=0;R0?this.tail.next=K:this.head=K,this.tail=K,++this.length}},{key:"unshift",value:function(R){var K={data:R,next:this.head};0===this.length&&(this.tail=K),this.head=K,++this.length}},{key:"shift",value:function(){if(0!==this.length){var R=this.head.data;return this.head=1===this.length?this.tail=null:this.head.next,--this.length,R}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(R){if(0===this.length)return"";for(var K=this.head,ce=""+K.data;K=K.next;)ce+=R+K.data;return ce}},{key:"concat",value:function(R){if(0===this.length)return O.alloc(0);for(var K=O.allocUnsafe(R>>>0),ce=this.head,D=0;ce;)S(ce.data,K,D),D+=ce.data.length,ce=ce.next;return K}},{key:"consume",value:function(R,K){var ce;return RI.length?I.length:R;if(D+=X===I.length?I:I.slice(0,R),0==(R-=X)){X===I.length?(++ce,this.head=K.next?K.next:this.tail=null):(this.head=K,K.data=I.slice(X));break}++ce}return this.length-=ce,D}},{key:"_getBuffer",value:function(R){var K=O.allocUnsafe(R),ce=this.head,D=1;for(ce.data.copy(K),R-=ce.data.length;ce=ce.next;){var I=ce.data,X=R>I.length?I.length:R;if(I.copy(K,K.length-R,0,X),0==(R-=X)){X===I.length?(++D,this.head=ce.next?ce.next:this.tail=null):(this.head=ce,ce.data=I.slice(X));break}++D}return this.length-=D,K}},{key:y,value:function(R,K){return b(this,function(T){for(var V=1;V0,function(Z){ce||(ce=Z),Z&&D.forEach(A),!E&&(D.forEach(A),K(ce))})});return V.reduce(b)}},{"../../../errors":67,"./end-of-stream":76}],79:[function(Y,Se,he){"use strict";var W=Y("../../../errors").codes.ERR_INVALID_OPT_VALUE;Se.exports={getHighWaterMark:function(Q,z,v,x){var O=function(Q,z,v){return null!=Q.highWaterMark?Q.highWaterMark:z?Q[v]:null}(z,x,v);if(null!=O){if(!isFinite(O)||Math.floor(O)!==O||O<0)throw new W(x?v:"highWaterMark",O);return Math.floor(O)}return Q.objectMode?16:16384}}},{"../../../errors":67}],80:[function(Y,Se,he){Se.exports=Y("events").EventEmitter},{events:8}],81:[function(Y,Se,he){(he=Se.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,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),function(j){for(var P in j)he.hasOwnProperty(P)||(he[P]=j[P])}(Y("./lib/Resolve"))},{"./lib/Resolve":83}],83:[function(Y,Se,he){"use strict";function j(z){const v=[];let x=0;for(;xO.join("")).join("/")}function P(z,v){let x=v+1;v>=0?"/"===z[v+1]&&"/"===z[v+2]&&(x=v+3):"/"===z[0]&&"/"===z[1]&&(x=2);const O=z.indexOf("/",x);return O<0?z:z.substr(0,O)+j(z.substr(O))}function Q(z){return!z||"#"===z||"?"===z||"/"===z}Object.defineProperty(he,"__esModule",{value:!0}),he.resolve=function(z,v){const x=(v=v||"").indexOf("#");if(x>0&&(v=v.substr(0,x)),!z.length){if(v.indexOf(":")<0)throw new Error(`Found invalid baseIRI '${v}' for value '${z}'`);return v}if(z.startsWith("?")){const V=v.indexOf("?");return V>0&&(v=v.substr(0,V)),v+z}if(z.startsWith("#"))return v+z;if(!v.length){const V=z.indexOf(":");if(V<0)throw new Error(`Found invalid relative IRI '${z}' for a missing baseIRI`);return P(z,V)}const O=z.indexOf(":");if(O>=0)return P(z,O);const A=v.indexOf(":");if(A<0)throw new Error(`Found invalid baseIRI '${v}' for value '${z}'`);const b=v.substr(0,A+1);if(0===z.indexOf("//"))return b+P(z,O);let y;if(v.indexOf("//",A)===A+1){if(y=v.indexOf("/",A+3),y<0)return v.length>A+3?v+"/"+P(z,O):b+P(z,O)}else if(y=v.indexOf("/",A+1),y<0)return b+P(z,O);if(0===z.indexOf("/"))return v.substr(0,y)+j(z);let S=v.substr(y);const T=S.lastIndexOf("/");return T>=0&&T"===ue?(ne(G,"onsgmldeclaration",G.sgmlDecl),G.sgmlDecl="",G.state=te.TEXT):($(ue)&&(G.state=te.SGML_DECL_QUOTED),G.sgmlDecl+=ue);continue;case te.SGML_DECL_QUOTED:ue===G.q&&(G.state=te.SGML_DECL,G.q=""),G.sgmlDecl+=ue;continue;case te.DOCTYPE:">"===ue?(G.state=te.TEXT,ne(G,"ondoctype",G.doctype),G.doctype=!0):(G.doctype+=ue,"["===ue?G.state=te.DOCTYPE_DTD:$(ue)&&(G.state=te.DOCTYPE_QUOTED,G.q=ue));continue;case te.DOCTYPE_QUOTED:G.doctype+=ue,ue===G.q&&(G.q="",G.state=te.DOCTYPE);continue;case te.DOCTYPE_DTD:G.doctype+=ue,"]"===ue?G.state=te.DOCTYPE:$(ue)&&(G.state=te.DOCTYPE_DTD_QUOTED,G.q=ue);continue;case te.DOCTYPE_DTD_QUOTED:G.doctype+=ue,ue===G.q&&(G.state=te.DOCTYPE_DTD,G.q="");continue;case te.COMMENT:"-"===ue?G.state=te.COMMENT_ENDING:G.comment+=ue;continue;case te.COMMENT_ENDING:"-"===ue?(G.state=te.COMMENT_ENDED,G.comment=Ie(G.opt,G.comment),G.comment&&ne(G,"oncomment",G.comment),G.comment=""):(G.comment+="-"+ue,G.state=te.COMMENT);continue;case te.COMMENT_ENDED:">"!==ue?(Xe(G,"Malformed comment"),G.comment+="--"+ue,G.state=te.COMMENT):G.state=te.TEXT;continue;case te.CDATA:"]"===ue?G.state=te.CDATA_ENDING:G.cdata+=ue;continue;case te.CDATA_ENDING:"]"===ue?G.state=te.CDATA_ENDING_2:(G.cdata+="]"+ue,G.state=te.CDATA);continue;case te.CDATA_ENDING_2:">"===ue?(G.cdata&&ne(G,"oncdata",G.cdata),ne(G,"onclosecdata"),G.cdata="",G.state=te.TEXT):"]"===ue?G.cdata+="]":(G.cdata+="]]"+ue,G.state=te.CDATA);continue;case te.PROC_INST:"?"===ue?G.state=te.PROC_INST_ENDING:E(ue)?G.state=te.PROC_INST_BODY:G.procInstName+=ue;continue;case te.PROC_INST_BODY:if(!G.procInstBody&&E(ue))continue;"?"===ue?G.state=te.PROC_INST_ENDING:G.procInstBody+=ue;continue;case te.PROC_INST_ENDING:">"===ue?(ne(G,"onprocessinginstruction",{name:G.procInstName,body:G.procInstBody}),G.procInstName=G.procInstBody="",G.state=te.TEXT):(G.procInstBody+="?"+ue,G.state=te.PROC_INST_BODY);continue;case te.OPEN_TAG:oe(D,ue)?G.tagName+=ue:(tt(G),">"===ue?ke(G):"/"===ue?G.state=te.OPEN_TAG_SLASH:(E(ue)||Xe(G,"Invalid character in tag name"),G.state=te.ATTRIB));continue;case te.OPEN_TAG_SLASH:">"===ue?(ke(G,!0),Ke(G)):(Xe(G,"Forward-slash in opening tag not followed by >"),G.state=te.ATTRIB);continue;case te.ATTRIB:if(E(ue))continue;">"===ue?ke(G):"/"===ue?G.state=te.OPEN_TAG_SLASH:oe(ce,ue)?(G.attribName=ue,G.attribValue="",G.state=te.ATTRIB_NAME):Xe(G,"Invalid attribute name");continue;case te.ATTRIB_NAME:"="===ue?G.state=te.ATTRIB_VALUE:">"===ue?(Xe(G,"Attribute without value"),G.attribValue=G.attribName,Ue(G),ke(G)):E(ue)?G.state=te.ATTRIB_NAME_SAW_WHITE:oe(D,ue)?G.attribName+=ue:Xe(G,"Invalid attribute name");continue;case te.ATTRIB_NAME_SAW_WHITE:if("="===ue)G.state=te.ATTRIB_VALUE;else{if(E(ue))continue;Xe(G,"Attribute without value"),G.tag.attributes[G.attribName]="",G.attribValue="",ne(G,"onattribute",{name:G.attribName,value:""}),G.attribName="",">"===ue?ke(G):oe(ce,ue)?(G.attribName=ue,G.state=te.ATTRIB_NAME):(Xe(G,"Invalid attribute name"),G.state=te.ATTRIB)}continue;case te.ATTRIB_VALUE:if(E(ue))continue;$(ue)?(G.q=ue,G.state=te.ATTRIB_VALUE_QUOTED):(Xe(G,"Unquoted attribute value"),G.state=te.ATTRIB_VALUE_UNQUOTED,G.attribValue=ue);continue;case te.ATTRIB_VALUE_QUOTED:if(ue!==G.q){"&"===ue?G.state=te.ATTRIB_VALUE_ENTITY_Q:G.attribValue+=ue;continue}Ue(G),G.q="",G.state=te.ATTRIB_VALUE_CLOSED;continue;case te.ATTRIB_VALUE_CLOSED:E(ue)?G.state=te.ATTRIB:">"===ue?ke(G):"/"===ue?G.state=te.OPEN_TAG_SLASH:oe(ce,ue)?(Xe(G,"No whitespace between attributes"),G.attribName=ue,G.attribValue="",G.state=te.ATTRIB_NAME):Xe(G,"Invalid attribute name");continue;case te.ATTRIB_VALUE_UNQUOTED:if(!Z(ue)){"&"===ue?G.state=te.ATTRIB_VALUE_ENTITY_U:G.attribValue+=ue;continue}Ue(G),">"===ue?ke(G):G.state=te.ATTRIB;continue;case te.CLOSE_TAG:if(G.tagName)">"===ue?Ke(G):oe(D,ue)?G.tagName+=ue:G.script?(G.script+=""===ue?Ke(G):Xe(G,"Invalid characters in closing tag");continue;case te.TEXT_ENTITY:case te.ATTRIB_VALUE_ENTITY_Q:case te.ATTRIB_VALUE_ENTITY_U:var pt,ve;switch(G.state){case te.TEXT_ENTITY:pt=te.TEXT,ve="textNode";break;case te.ATTRIB_VALUE_ENTITY_Q:pt=te.ATTRIB_VALUE_QUOTED,ve="attribValue";break;case te.ATTRIB_VALUE_ENTITY_U:pt=te.ATTRIB_VALUE_UNQUOTED,ve="attribValue"}";"===ue?(G[ve]+=Me(G),G.entity="",G.state=pt):oe(G.entity.length?X:I,ue)?G.entity+=ue:(Xe(G,"Invalid character in entity name"),G[ve]+="&"+G.entity+ue,G.entity="",G.state=pt);continue;default:throw new Error(G,"Unknown state: "+G.state)}return G.position>=G.bufferCheckPosition&&function(q){for(var G=Math.max(j.MAX_BUFFER_LENGTH,10),pe=0,ue=0,je=P.length;ueG)switch(P[ue]){case"textNode":_e(q);break;case"cdata":ne(q,"oncdata",q.cdata),q.cdata="";break;case"script":ne(q,"onscript",q.script),q.script="";break;default:Ge(q,"Max buffer length exceeded: "+P[ue])}pe=Math.max(pe,_t)}q.bufferCheckPosition=j.MAX_BUFFER_LENGTH-pe+q.position}(G),G},resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){!function(q){_e(q),""!==q.cdata&&(ne(q,"oncdata",q.cdata),q.cdata=""),""!==q.script&&(ne(q,"onscript",q.script),q.script="")}(this)}};try{O=Y("stream").Stream}catch(q){O=function(){}}var A=j.EVENTS.filter(function(q){return"error"!==q&&"end"!==q});function y(q,G){if(!(this instanceof y))return new y(q,G);O.apply(this),this._parser=new Q(q,G),this.writable=!0,this.readable=!0;var pe=this;this._parser.onend=function(){pe.emit("end")},this._parser.onerror=function(ue){pe.emit("error",ue),pe._parser.error=null},this._decoder=null,A.forEach(function(ue){Object.defineProperty(pe,"on"+ue,{get:function(){return pe._parser["on"+ue]},set:function(je){if(!je)return pe.removeAllListeners(ue),pe._parser["on"+ue]=je,je;pe.on(ue,je)},enumerable:!0,configurable:!1})})}(y.prototype=Object.create(O.prototype,{constructor:{value:y}})).write=function(q){if("function"==typeof W&&"function"==typeof W.isBuffer&&W.isBuffer(q)){if(!this._decoder){var G=Y("string_decoder").StringDecoder;this._decoder=new G("utf8")}q=this._decoder.write(q)}return this._parser.write(q.toString()),this.emit("data",q),!0},y.prototype.end=function(q){return q&&q.length&&this.write(q),this._parser.end(),!0},y.prototype.on=function(q,G){var pe=this;return!pe._parser["on"+q]&&-1!==A.indexOf(q)&&(pe._parser["on"+q]=function(){var ue=1===arguments.length?[arguments[0]]:Array.apply(null,arguments);ue.splice(0,0,q),pe.emit.apply(pe,ue)}),O.prototype.on.call(pe,q,G)};var V="http://www.w3.org/XML/1998/namespace",R="http://www.w3.org/2000/xmlns/",K={xml:V,xmlns:R},ce=/[:_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-]/,I=/[#:_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]/,X=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;function E(q){return" "===q||"\n"===q||"\r"===q||"\t"===q}function $(q){return'"'===q||"'"===q}function Z(q){return">"===q||E(q)}function oe(q,G){return q.test(G)}function se(q,G){return!oe(q,G)}var q,G,pe,te=0;for(var Ce in j.STATE={BEGIN:te++,BEGIN_WHITESPACE:te++,TEXT:te++,TEXT_ENTITY:te++,OPEN_WAKA:te++,SGML_DECL:te++,SGML_DECL_QUOTED:te++,DOCTYPE:te++,DOCTYPE_QUOTED:te++,DOCTYPE_DTD:te++,DOCTYPE_DTD_QUOTED:te++,COMMENT_STARTING:te++,COMMENT:te++,COMMENT_ENDING:te++,COMMENT_ENDED:te++,CDATA:te++,CDATA_ENDING:te++,CDATA_ENDING_2:te++,PROC_INST:te++,PROC_INST_BODY:te++,PROC_INST_ENDING:te++,OPEN_TAG:te++,OPEN_TAG_SLASH:te++,ATTRIB:te++,ATTRIB_NAME:te++,ATTRIB_NAME_SAW_WHITE:te++,ATTRIB_VALUE:te++,ATTRIB_VALUE_QUOTED:te++,ATTRIB_VALUE_CLOSED:te++,ATTRIB_VALUE_UNQUOTED:te++,ATTRIB_VALUE_ENTITY_Q:te++,ATTRIB_VALUE_ENTITY_U:te++,CLOSE_TAG:te++,CLOSE_TAG_SAW_WHITE:te++,SCRIPT:te++,SCRIPT_ENDING:te++},j.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},j.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(j.ENTITIES).forEach(function(q){var G=j.ENTITIES[q],pe="number"==typeof G?String.fromCharCode(G):G;j.ENTITIES[q]=pe}),j.STATE)j.STATE[j.STATE[Ce]]=Ce;function me(q,G,pe){q[G]&&q[G](pe)}function ne(q,G,pe){q.textNode&&_e(q),me(q,G,pe)}function _e(q){q.textNode=Ie(q.opt,q.textNode),q.textNode&&me(q,"ontext",q.textNode),q.textNode=""}function Ie(q,G){return q.trim&&(G=G.trim()),q.normalize&&(G=G.replace(/\s+/g," ")),G}function Ge(q,G){return _e(q),q.trackPosition&&(G+="\nLine: "+q.line+"\nColumn: "+q.column+"\nChar: "+q.c),G=new Error(G),q.error=G,me(q,"onerror",G),q}function st(q){return q.sawRoot&&!q.closedRoot&&Xe(q,"Unclosed root tag"),q.state!==te.BEGIN&&q.state!==te.BEGIN_WHITESPACE&&q.state!==te.TEXT&&Ge(q,"Unexpected end"),_e(q),q.c="",q.closed=!0,me(q,"onend"),Q.call(q,q.strict,q.opt),q}function Xe(q,G){if("object"!=typeof q||!(q instanceof Q))throw new Error("bad call to strictFail");q.strict&&Ge(q,G)}function tt(q){q.strict||(q.tagName=q.tagName[q.looseCase]());var G=q.tags[q.tags.length-1]||q,pe=q.tag={name:q.tagName,attributes:{}};q.opt.xmlns&&(pe.ns=G.ns),q.attribList.length=0,ne(q,"onopentagstart",pe)}function Ye(q,G){var ue=q.indexOf(":")<0?["",q]:q.split(":"),je=ue[0],_t=ue[1];return G&&"xmlns"===q&&(je="xmlns",_t=""),{prefix:je,local:_t}}function Ue(q){if(q.strict||(q.attribName=q.attribName[q.looseCase]()),-1!==q.attribList.indexOf(q.attribName)||q.tag.attributes.hasOwnProperty(q.attribName))q.attribName=q.attribValue="";else{if(q.opt.xmlns){var G=Ye(q.attribName,!0),ue=G.local;if("xmlns"===G.prefix)if("xml"===ue&&q.attribValue!==V)Xe(q,"xml: prefix must be bound to "+V+"\nActual: "+q.attribValue);else if("xmlns"===ue&&q.attribValue!==R)Xe(q,"xmlns: prefix must be bound to "+R+"\nActual: "+q.attribValue);else{var je=q.tag,_t=q.tags[q.tags.length-1]||q;je.ns===_t.ns&&(je.ns=Object.create(_t.ns)),je.ns[ue]=q.attribValue}q.attribList.push([q.attribName,q.attribValue])}else q.tag.attributes[q.attribName]=q.attribValue,ne(q,"onattribute",{name:q.attribName,value:q.attribValue});q.attribName=q.attribValue=""}}function ke(q,G){if(q.opt.xmlns){var pe=q.tag,ue=Ye(q.tagName);pe.prefix=ue.prefix,pe.local=ue.local,pe.uri=pe.ns[ue.prefix]||"",pe.prefix&&!pe.uri&&(Xe(q,"Unbound namespace prefix: "+JSON.stringify(q.tagName)),pe.uri=ue.prefix),pe.ns&&(q.tags[q.tags.length-1]||q).ns!==pe.ns&&Object.keys(pe.ns).forEach(function(On){ne(q,"onopennamespace",{prefix:On,uri:pe.ns[On]})});for(var _t=0,pt=q.attribList.length;_t",q.tagName="",void(q.state=te.SCRIPT);ne(q,"onscript",q.script),q.script=""}var G=q.tags.length,pe=q.tagName;q.strict||(pe=pe[q.looseCase]());for(var ue=pe;G--&&q.tags[G].name!==ue;)Xe(q,"Unexpected close tag");if(G<0)return Xe(q,"Unmatched closing tag: "+q.tagName),q.textNode+="",void(q.state=te.TEXT);q.tagName=pe;for(var _t=q.tags.length;_t-- >G;){var pt=q.tag=q.tags.pop();q.tagName=q.tag.name,ne(q,"onclosetag",q.tagName);var ve={};for(var L in pt.ns)ve[L]=pt.ns[L];q.opt.xmlns&&pt.ns!==(q.tags[q.tags.length-1]||q).ns&&Object.keys(pt.ns).forEach(function(B){ne(q,"onclosenamespace",{prefix:B,uri:pt.ns[B]})})}0===G&&(q.closedRoot=!0),q.tagName=q.attribValue=q.attribName="",q.attribList.length=0,q.state=te.TEXT}function Me(q){var ue,G=q.entity,pe=G.toLowerCase(),je="";return q.ENTITIES[G]?q.ENTITIES[G]:q.ENTITIES[pe]?q.ENTITIES[pe]:("#"===(G=pe).charAt(0)&&("x"===G.charAt(1)?(G=G.slice(2),je=(ue=parseInt(G,16)).toString(16)):(G=G.slice(1),je=(ue=parseInt(G,10)).toString(10))),G=G.replace(/^0+/,""),isNaN(ue)||je.toLowerCase()!==G?(Xe(q,"Invalid character entity"),"&"+q.entity+";"):String.fromCodePoint(ue))}function Ve(q,G){"<"===G?(q.state=te.OPEN_WAKA,q.startTagPosition=q.position):E(G)||(Xe(q,"Non-whitespace before first tag."),q.textNode=G,q.state=te.TEXT)}function $e(q,G){var pe="";return G1114111||G(B)!==B)throw RangeError("Invalid code point: "+B);B<=65535?je.push(B):je.push(55296+((B-=65536)>>10),B%1024+56320),(ve+1===L||je.length>ue)&&(N+=q.apply(null,je),je.length=0)}return N},Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:pe,configurable:!0,writable:!0}):String.fromCodePoint=pe)}(void 0===he?this.sax={}:he)}).call(this)}).call(this,Y("buffer").Buffer)},{buffer:6,stream:87,string_decoder:5}],86:[function(Y,Se,he){(function(W,j){(function(){!function(P,Q){"use strict";if(!P.setImmediate){var A,z=1,v={},x=!1,O=P.document,X=Object.getPrototypeOf&&Object.getPrototypeOf(P);X=X&&X.setTimeout?X:P,"[object process]"==={}.toString.call(P.process)?A=function(E){W.nextTick(function(){T(E)})}:function(){if(P.postMessage&&!P.importScripts){var E=!0,$=P.onmessage;return P.onmessage=function(){E=!1},P.postMessage("","*"),P.onmessage=$,E}}()?(E="setImmediate$"+Math.random()+"$",$=function(Z){Z.source===P&&"string"==typeof Z.data&&0===Z.data.indexOf(E)&&T(+Z.data.slice(E.length))},P.addEventListener?P.addEventListener("message",$,!1):P.attachEvent("onmessage",$),A=function(Z){P.postMessage(E+Z,"*")}):P.MessageChannel?function(){var E=new MessageChannel;E.port1.onmessage=function($){T($.data)},A=function($){E.port2.postMessage($)}}():O&&"onreadystatechange"in O.createElement("script")?function(){var E=O.documentElement;A=function($){var Z=O.createElement("script");Z.onreadystatechange=function(){T($),Z.onreadystatechange=null,E.removeChild(Z),Z=null},E.appendChild(Z)}}():A=function(E){setTimeout(T,0,E)},X.setImmediate=function(E){"function"!=typeof E&&(E=new Function(""+E));for(var $=new Array(arguments.length-1),Z=0;Z<$.length;Z++)$[Z]=arguments[Z+1];return v[z]={callback:E,args:$},A(z),z++},X.clearImmediate=y}var E,$;function y(E){delete v[E]}function T(E){if(x)setTimeout(T,0,E);else{var $=v[E];if($){x=!0;try{!function(E){var $=E.callback,Z=E.args;switch(Z.length){case 0:$();break;case 1:$(Z[0]);break;case 2:$(Z[0],Z[1]);break;case 3:$(Z[0],Z[1],Z[2]);break;default:$.apply(void 0,Z)}}($)}finally{y(E),x=!1}}}}}("undefined"==typeof self?void 0===j?this:j:self)}).call(this)}).call(this,Y("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:44}],87:[function(Y,Se,he){Se.exports=P;var W=Y("events").EventEmitter;function P(){W.call(this)}Y("inherits")(P,W),P.Readable=Y("readable-stream/lib/_stream_readable.js"),P.Writable=Y("readable-stream/lib/_stream_writable.js"),P.Duplex=Y("readable-stream/lib/_stream_duplex.js"),P.Transform=Y("readable-stream/lib/_stream_transform.js"),P.PassThrough=Y("readable-stream/lib/_stream_passthrough.js"),P.finished=Y("readable-stream/lib/internal/streams/end-of-stream.js"),P.pipeline=Y("readable-stream/lib/internal/streams/pipeline.js"),P.Stream=P,P.prototype.pipe=function(Q,z){var v=this;function x(V){Q.writable&&!1===Q.write(V)&&v.pause&&v.pause()}function O(){v.readable&&v.resume&&v.resume()}v.on("data",x),Q.on("drain",O),!Q._isStdio&&(!z||!1!==z.end)&&(v.on("end",b),v.on("close",y));var A=!1;function b(){A||(A=!0,Q.end())}function y(){A||(A=!0,"function"==typeof Q.destroy&&Q.destroy())}function S(V){if(T(),0===W.listenerCount(this,"error"))throw V}function T(){v.removeListener("data",x),Q.removeListener("drain",O),v.removeListener("end",b),v.removeListener("close",y),v.removeListener("error",S),Q.removeListener("error",S),v.removeListener("end",T),v.removeListener("close",T),Q.removeListener("close",T)}return v.on("error",S),Q.on("error",S),v.on("end",T),v.on("close",T),Q.on("close",T),Q.emit("pipe",v),Q}},{events:8,inherits:10,"readable-stream/lib/_stream_duplex.js":68,"readable-stream/lib/_stream_passthrough.js":69,"readable-stream/lib/_stream_readable.js":70,"readable-stream/lib/_stream_transform.js":71,"readable-stream/lib/_stream_writable.js":72,"readable-stream/lib/internal/streams/end-of-stream.js":76,"readable-stream/lib/internal/streams/pipeline.js":78}],88:[function(Y,Se,he){arguments[4][5][0].apply(he,arguments)},{dup:5,"safe-buffer":84}],89:[function(Y,Se,he){(function(W,j){(function(){var P=Y("process/browser.js").nextTick,Q=Function.prototype.apply,z=Array.prototype.slice,v={},x=0;function O(A,b){this._id=A,this._clearFn=b}he.setTimeout=function(){return new O(Q.call(setTimeout,window,arguments),clearTimeout)},he.setInterval=function(){return new O(Q.call(setInterval,window,arguments),clearInterval)},he.clearTimeout=he.clearInterval=function(A){A.close()},O.prototype.unref=O.prototype.ref=function(){},O.prototype.close=function(){this._clearFn.call(window,this._id)},he.enroll=function(A,b){clearTimeout(A._idleTimeoutId),A._idleTimeout=b},he.unenroll=function(A){clearTimeout(A._idleTimeoutId),A._idleTimeout=-1},he._unrefActive=he.active=function(A){clearTimeout(A._idleTimeoutId);var b=A._idleTimeout;b>=0&&(A._idleTimeoutId=setTimeout(function(){A._onTimeout&&A._onTimeout()},b))},he.setImmediate="function"==typeof W?W:function(A){var b=x++,y=!(arguments.length<2)&&z.call(arguments,1);return v[b]=!0,P(function(){v[b]&&(y?A.apply(null,y):A.call(null),he.clearImmediate(b))}),b},he.clearImmediate="function"==typeof j?j:function(A){delete v[A]}}).call(this)}).call(this,Y("timers").setImmediate,Y("timers").clearImmediate)},{"process/browser.js":44,timers:89}],90:[function(Y,Se,he){(function(W){(function(){function P(Q){try{if(!W.localStorage)return!1}catch(v){return!1}var z=W.localStorage[Q];return null!=z&&"true"===String(z).toLowerCase()}Se.exports=function(Q,z){if(P("noDeprecation"))return Q;var v=!1;return function(){if(!v){if(P("throwDeprecation"))throw new Error(z);P("traceDeprecation")?console.trace(z):console.warn(z),v=!0}return Q.apply(this,arguments)}}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],91:[function(Y,Se,he){"use strict";Se.exports=function(W){W.prototype[Symbol.iterator]=function*(){for(let j=this.head;j;j=j.next)yield j.value}}},{}],92:[function(Y,Se,he){"use strict";function W(v){var x=this;if(x instanceof W||(x=new W),x.tail=null,x.head=null,x.length=0,v&&"function"==typeof v.forEach)v.forEach(function(b){x.push(b)});else if(arguments.length>0)for(var O=0,A=arguments.length;O1)O=x;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");A=this.head.next,O=this.head.value}for(var b=0;null!==A;b++)O=v(O,A.value,b),A=A.next;return O},W.prototype.reduceReverse=function(v,x){var O,A=this.tail;if(arguments.length>1)O=x;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");A=this.tail.prev,O=this.tail.value}for(var b=this.length-1;null!==A;b--)O=v(O,A.value,b),A=A.prev;return O},W.prototype.toArray=function(){for(var v=new Array(this.length),x=0,O=this.head;null!==O;x++)v[x]=O.value,O=O.next;return v},W.prototype.toArrayReverse=function(){for(var v=new Array(this.length),x=0,O=this.tail;null!==O;x++)v[x]=O.value,O=O.prev;return v},W.prototype.slice=function(v,x){(x=x||this.length)<0&&(x+=this.length),(v=v||0)<0&&(v+=this.length);var O=new W;if(xthis.length&&(x=this.length);for(var A=0,b=this.head;null!==b&&Athis.length&&(x=this.length);for(var A=this.length,b=this.tail;null!==b&&A>x;A--)b=b.prev;for(;null!==b&&A>v;A--,b=b.prev)O.push(b.value);return O},W.prototype.splice=function(v,x,...O){v>this.length&&(v=this.length-1),v<0&&(v=this.length+v);for(var A=0,b=this.head;null!==b&&A{"use strict";Ut.exports=Je,Ut.exports.default=Je;var it=1e20;function Je(Y,Se,he,W,j,P){this.fontSize=Y||24,this.buffer=void 0===Se?3:Se,this.cutoff=W||.25,this.fontFamily=j||"sans-serif",this.fontWeight=P||"normal",this.radius=he||8;var Q=this.size=this.fontSize+2*this.buffer,z=Q+2*this.buffer;this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=Q,this.ctx=this.canvas.getContext("2d"),this.ctx.font=this.fontWeight+" "+this.fontSize+"px "+this.fontFamily,this.ctx.textAlign="left",this.ctx.fillStyle="black",this.gridOuter=new Float64Array(z*z),this.gridInner=new Float64Array(z*z),this.f=new Float64Array(z),this.z=new Float64Array(z+1),this.v=new Uint16Array(z),this.useMetrics=void 0!==this.ctx.measureText("A").actualBoundingBoxLeft,this.middle=Math.round(Q/2*(navigator.userAgent.indexOf("Gecko/")>=0?1.2:1))}function Tt(Y,Se,he,W,j,P){for(var Q=0;Q-1);P[++v]=z,Q[v]=x,Q[v+1]=it}for(z=0,v=0;z{Ut.exports=function(Je,yt){var ee=yt.length;if(0!==ee){var Tt=Je.length;Je.length+=ee;for(var dt=0;dt{"use strict";var yt=(()=>{return(Tt=yt||(yt={})).typeOfFunction="function",Tt.boolTrue=!0,yt;var Tt})();function ee(Tt,dt,Y){if(!Y||typeof Y.value!==yt.typeOfFunction)throw new TypeError("Only methods can be decorated with @bind. <"+dt+"> is not a method!");return{configurable:yt.boolTrue,get:function(){var Se=Y.value.bind(this);return Object.defineProperty(this,dt,{value:Se,configurable:yt.boolTrue,writable:yt.boolTrue}),Se}}}it.ak=ee,it.ZP=ee},266:(Ut,it,Je)=>{Ut.exports={ResizeSensor:Je(835),ElementQueries:Je(845)}},845:function(Ut,it,Je){"use strict";var yt,ee,Tt;"undefined"!=typeof window&&window,ee=[Je(835)],void 0!==(Tt="function"==typeof(yt=function(dt){var Y=function(){var he,W={},j=[];function P(D){D||(D=document.documentElement);var I=window.getComputedStyle(D,null).fontSize;return parseFloat(I)||16}function z(D,I){var X=I.split(/\d/),E=X[X.length-1];switch(I=parseFloat(I),E){case"px":return I;case"em":return I*P(D);case"rem":return I*P();case"vw":return I*document.documentElement.clientWidth/100;case"vh":return I*document.documentElement.clientHeight/100;case"vmin":case"vmax":var $=document.documentElement.clientWidth/100,Z=document.documentElement.clientHeight/100;return I*(0,Math["vmin"===E?"min":"max"])($,Z);default:return I}}function v(D,I){this.element=D;var X,E,$,Z,oe,se,te,Ce,me=["min-width","min-height","max-width","max-height"];this.call=function(){for(X in $=function(D){if(!D.getBoundingClientRect)return{width:D.offsetWidth,height:D.offsetHeight};var I=D.getBoundingClientRect();return{width:Math.round(I.width),height:Math.round(I.height)}}(this.element),se={},W[I])!W[I].hasOwnProperty(X)||(Z=z(this.element,(E=W[I][X]).value),oe="width"===E.property?$.width:$.height,te="","min"===E.mode&&oe>=Z&&(te+=E.value),"max"===E.mode&&oe<=Z&&(te+=E.value),se[Ce=E.mode+"-"+E.property]||(se[Ce]=""),te&&-1===(" "+se[Ce]+" ").indexOf(" "+te+" ")&&(se[Ce]+=" "+te));for(var ne in me)!me.hasOwnProperty(ne)||(se[me[ne]]?this.element.setAttribute(me[ne],se[me[ne]].substr(1)):this.element.removeAttribute(me[ne]))}}function x(D,I){D.elementQueriesSetupInformation||(D.elementQueriesSetupInformation=new v(D,I)),D.elementQueriesSensor||(D.elementQueriesSensor=new dt(D,function(){D.elementQueriesSetupInformation.call()}))}function O(D,I,X,E){if(void 0===W[D]){W[D]=[];var $=j.length;he.innerHTML+="\n"+D+" {animation: 0.1s element-queries;}",he.innerHTML+="\n"+D+" > .resize-sensor {min-width: "+$+"px;}",j.push(D)}W[D].push({mode:I,property:X,value:E})}function A(D){var I;if(document.querySelectorAll&&(I=D?D.querySelectorAll.bind(D):document.querySelectorAll.bind(document)),!I&&"undefined"!=typeof $$&&(I=$$),!I&&"undefined"!=typeof jQuery&&(I=jQuery),!I)throw"No document.querySelectorAll, jQuery or Mootools's $$ found.";return I}function y(D){var I=[],X=[],E=[],$=0,Z=-1,oe=[];for(var se in D.children)if(D.children.hasOwnProperty(se)&&D.children[se].tagName&&"img"===D.children[se].tagName.toLowerCase()){I.push(D.children[se]);var te=D.children[se].getAttribute("min-width")||D.children[se].getAttribute("data-min-width"),Ce=D.children[se].getAttribute("data-src")||D.children[se].getAttribute("url");E.push(Ce),X.push({minWidth:te}),te?D.children[se].style.display="none":($=I.length-1,D.children[se].style.display="block")}function ne(){var Ie,_e=!1;for(Ie in I)!I.hasOwnProperty(Ie)||X[Ie].minWidth&&D.offsetWidth>X[Ie].minWidth&&(_e=Ie);if(_e||(_e=$),Z!==_e)if(oe[_e])I[Z].style.display="none",I[_e].style.display="block",Z=_e;else{var Ge=new Image;Ge.onload=function(){I[_e].src=E[_e],I[Z].style.display="none",I[_e].style.display="block",oe[_e]=!0,Z=_e},Ge.src=E[_e]}else I[_e].src=E[_e]}Z=$,D.resizeSensorInstance=new dt(D,ne),ne()}var T=/,?[\s\t]*([^,\n]*?)((?:\[[\s\t]*?(?:min|max)-(?:width|height)[\s\t]*?[~$\^]?=[\s\t]*?"[^"]*?"[\s\t]*?])+)([^,\n\s\{]*)/gim,V=/\[[\s\t]*?(min|max)-(width|height)[\s\t]*?[~$\^]?=[\s\t]*?"([^"]*?)"[\s\t]*?]/gim;function R(D){var I,X,E,$;for(D=D.replace(/'/g,'"');null!==(I=T.exec(D));)for(X=I[1]+I[3],E=I[2];null!==($=V.exec(E));)O(X,$[1],$[2],$[3])}function K(D){var I="";if(D)if("string"==typeof D)(-1!==(D=D.toLowerCase()).indexOf("min-width")||-1!==D.indexOf("max-width"))&&R(D);else for(var X=0,E=D.length;X 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),ce=!0);for(var I=0,X=document.styleSheets.length;I{var yt=Je(910),ee=Je(369),Tt=Je(322);function dt(Q,z,v){if(!yt(Q))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(!Q.hasNode(z))throw new Error('graphology-shortest-path: the "'+z+'" source node does not exist in the given graph.');if(!Q.hasNode(v))throw new Error('graphology-shortest-path: the "'+v+'" target node does not exist in the given graph.');if((z=""+z)==(v=""+v))return[z];var x=Q.inboundNeighbors.bind(Q),O=Q.outboundNeighbors.bind(Q),A={},b={};A[z]=null,b[v]=null;var T,V,R,K,ce,D,I,X,y=[z],S=[v],E=!1;e:for(;y.length&&S.length;)if(y.length<=S.length){for(T=y,y=[],ce=0,I=T.length;ce{Ut.exports=function(Je){return null!==Je&&"object"==typeof Je&&"function"==typeof Je.addUndirectedEdgeWithKey&&"function"==typeof Je.dropNode&&"boolean"==typeof Je.multi}},698:function(Ut){Ut.exports=function(){"use strict";function it(ie){return(it="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(fe){return typeof fe}:function(fe){return fe&&"function"==typeof Symbol&&fe.constructor===Symbol&&fe!==Symbol.prototype?"symbol":typeof fe})(ie)}function Je(ie,fe){ie.prototype=Object.create(fe.prototype),ie.prototype.constructor=ie,ee(ie,fe)}function yt(ie){return(yt=Object.setPrototypeOf?Object.getPrototypeOf:function(fe){return fe.__proto__||Object.getPrototypeOf(fe)})(ie)}function ee(ie,fe){return(ee=Object.setPrototypeOf||function(re,M){return re.__proto__=M,re})(ie,fe)}function Tt(){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(ie){return!1}}function dt(ie,fe,re){return(dt=Tt()?Reflect.construct:function(M,k,J){var we=[null];we.push.apply(we,k);var Fe=new(Function.bind.apply(M,we));return J&&ee(Fe,J.prototype),Fe}).apply(null,arguments)}function Y(ie){var fe="function"==typeof Map?new Map:void 0;return(Y=function(re){if(null===re||-1===Function.toString.call(re).indexOf("[native code]"))return re;if("function"!=typeof re)throw new TypeError("Super expression must either be null or a function");if(void 0!==fe){if(fe.has(re))return fe.get(re);fe.set(re,k)}function k(){return dt(re,arguments,yt(this).constructor)}return k.prototype=Object.create(re.prototype,{constructor:{value:k,enumerable:!1,writable:!0,configurable:!0}}),ee(k,re)})(ie)}function Se(ie){if(void 0===ie)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return ie}var he=function(){for(var ie=arguments[0],fe=1,re=arguments.length;fe0&&we.length>k&&!we.warned){we.warned=!0;var nt=new Error("Possible EventEmitter memory leak detected. "+we.length+" "+String(fe)+" listeners added. Use emitter.setMaxListeners() to increase limit");nt.name="MaxListenersExceededWarning",nt.emitter=ie,nt.type=fe,nt.count=we.length,console&&console.warn&&console.warn(nt)}return ie}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 I(ie,fe,re){var M={fired:!1,wrapFn:void 0,target:ie,type:fe,listener:re},k=D.bind(M);return k.listener=re,M.wrapFn=k,k}function X(ie,fe,re){var M=ie._events;if(void 0===M)return[];var k=M[fe];return void 0===k?[]:"function"==typeof k?re?[k.listener||k]:[k]:re?function(J){for(var we=new Array(J.length),Fe=0;Fe0&&(J=fe[0]),J instanceof Error)throw J;var we=new Error("Unhandled error."+(J?" ("+J.message+")":""));throw we.context=J,we}var Fe=k[ie];if(void 0===Fe)return!1;if("function"==typeof Fe)y(Fe,this,fe);else{var nt=Fe.length,Ot=$(Fe,nt);for(re=0;re=0;J--)if(re[J]===fe||re[J].listener===fe){we=re[J].listener,k=J;break}if(k<0)return this;0===k?re.shift():function(Fe,nt){for(;nt+1=0;M--)this.removeListener(ie,fe[M]);return this},T.prototype.listeners=function(ie){return X(this,ie,!0)},T.prototype.rawListeners=function(ie){return X(this,ie,!1)},T.listenerCount=function(ie,fe){return"function"==typeof ie.listenerCount?ie.listenerCount(fe):E.call(ie,fe)},T.prototype.listenerCount=E,T.prototype.eventNames=function(){return this._eventsCount>0?O(this._events):[]},oe.prototype.next=function(){if(this.done)return{done:!0};var ie=this._next();return ie.done&&(this.done=!0),ie},"undefined"!=typeof Symbol&&(oe.prototype[Symbol.iterator]=function(){return this}),oe.of=function(){var ie=arguments,fe=ie.length,re=0;return new oe(function(){return re>=fe?{done:!0}:{done:!1,value:ie[re++]}})},oe.empty=function(){var ie=new oe(null);return ie.done=!0,ie},oe.is=function(ie){return ie instanceof oe||"object"==typeof ie&&null!==ie&&"function"==typeof ie.next};var se=oe,te=function(ie,fe){for(var re,M=arguments.length>1?fe:1/0,k=M!==1/0?new Array(M):[],J=0;;){if(J===M)return k;if((re=ie.next()).done)return J!==fe?k.slice(0,J):k;k[J++]=re.value}},Ce=function(ie){function fe(re,M){var k;return(k=ie.call(this)||this).name="GraphError",k.message=re||"",k.data=M||{},k}return Je(fe,ie),fe}(Y(Error)),me=function(ie){function fe(re,M){var k;return(k=ie.call(this,re,M)||this).name="InvalidArgumentsGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(Se(k),fe.prototype.constructor),k}return Je(fe,ie),fe}(Ce),ne=function(ie){function fe(re,M){var k;return(k=ie.call(this,re,M)||this).name="NotFoundGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(Se(k),fe.prototype.constructor),k}return Je(fe,ie),fe}(Ce),_e=function(ie){function fe(re,M){var k;return(k=ie.call(this,re,M)||this).name="UsageGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(Se(k),fe.prototype.constructor),k}return Je(fe,ie),fe}(Ce);function Ie(ie,fe){this.key=ie,this.attributes=fe,this.inDegree=0,this.outDegree=0,this.undirectedDegree=0,this.directedSelfLoops=0,this.undirectedSelfLoops=0,this.in={},this.out={},this.undirected={}}function Ge(ie,fe){this.key=ie,this.attributes=fe,this.inDegree=0,this.outDegree=0,this.directedSelfLoops=0,this.in={},this.out={}}function st(ie,fe){this.key=ie,this.attributes=fe,this.undirectedDegree=0,this.undirectedSelfLoops=0,this.undirected={}}function Xe(ie,fe,re,M,k,J){this.key=fe,this.attributes=J,this.undirected=ie,this.source=M,this.target=k,this.generatedKey=re}function tt(ie,fe,re,M,k,J,we){var Fe,nt,Ot="out",We="in";if(fe&&(Ot=We="undirected"),ie.multi){if(void 0===(nt=(Fe=J[Ot])[k])&&(nt=new Set,Fe[k]=nt),nt.add(re),M===k&&fe)return;void 0===(Fe=we[We])[M]&&(Fe[M]=nt)}else{if(J[Ot][k]=re,M===k&&fe)return;we[We][M]=re}}function Ye(ie,fe,re){var M=ie.multi,k=re.source,J=re.target,we=k.key,Fe=J.key,nt=k[fe?"undirected":"out"],Ot=fe?"undirected":"in";if(Fe in nt)if(M){var We=nt[Fe];1===We.size?(delete nt[Fe],delete J[Ot][we]):We.delete(re)}else delete nt[Fe];M||delete J[Ot][we]}Ge.prototype.upgradeToMixed=function(){this.undirectedDegree=0,this.undirectedSelfLoops=0,this.undirected={}},st.prototype.upgradeToMixed=function(){this.inDegree=0,this.outDegree=0,this.directedSelfLoops=0,this.in={},this.out={}};var Ue=[{name:function(ie){return"get".concat(ie,"Attribute")},attacher:function(ie,fe,re){ie.prototype[fe]=function(M,k){var J;if("mixed"!==this.type&&"mixed"!==re&&re!==this.type)throw new _e("Graph.".concat(fe,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new _e("Graph.".concat(fe,": 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=""+M,Fe=""+k;if(k=arguments[2],!(J=W(this,we,Fe,re)))throw new ne("Graph.".concat(fe,': could not find an edge for the given path ("').concat(we,'" - "').concat(Fe,'").'))}else if(!(J=this._edges.get(M=""+M)))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" edge in the graph.'));if("mixed"!==re&&J.undirected!==("undirected"===re))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" ').concat(re," edge in the graph."));return J.attributes[k]}}},{name:function(ie){return"get".concat(ie,"Attributes")},attacher:function(ie,fe,re){ie.prototype[fe]=function(M){var k;if("mixed"!==this.type&&"mixed"!==re&&re!==this.type)throw new _e("Graph.".concat(fe,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>1){if(this.multi)throw new _e("Graph.".concat(fe,": 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 J=""+M,we=""+arguments[1];if(!(k=W(this,J,we,re)))throw new ne("Graph.".concat(fe,': could not find an edge for the given path ("').concat(J,'" - "').concat(we,'").'))}else if(!(k=this._edges.get(M=""+M)))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" edge in the graph.'));if("mixed"!==re&&k.undirected!==("undirected"===re))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" ').concat(re," edge in the graph."));return k.attributes}}},{name:function(ie){return"has".concat(ie,"Attribute")},attacher:function(ie,fe,re){ie.prototype[fe]=function(M,k){var J;if("mixed"!==this.type&&"mixed"!==re&&re!==this.type)throw new _e("Graph.".concat(fe,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new _e("Graph.".concat(fe,": 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=""+M,Fe=""+k;if(k=arguments[2],!(J=W(this,we,Fe,re)))throw new ne("Graph.".concat(fe,': could not find an edge for the given path ("').concat(we,'" - "').concat(Fe,'").'))}else if(!(J=this._edges.get(M=""+M)))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" edge in the graph.'));if("mixed"!==re&&J.undirected!==("undirected"===re))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" ').concat(re," edge in the graph."));return J.attributes.hasOwnProperty(k)}}},{name:function(ie){return"set".concat(ie,"Attribute")},attacher:function(ie,fe,re){ie.prototype[fe]=function(M,k,J){var we;if("mixed"!==this.type&&"mixed"!==re&&re!==this.type)throw new _e("Graph.".concat(fe,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>3){if(this.multi)throw new _e("Graph.".concat(fe,": 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=""+M,nt=""+k;if(k=arguments[2],J=arguments[3],!(we=W(this,Fe,nt,re)))throw new ne("Graph.".concat(fe,': could not find an edge for the given path ("').concat(Fe,'" - "').concat(nt,'").'))}else if(!(we=this._edges.get(M=""+M)))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" edge in the graph.'));if("mixed"!==re&&we.undirected!==("undirected"===re))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" ').concat(re," edge in the graph."));return we.attributes[k]=J,this.emit("edgeAttributesUpdated",{key:we.key,type:"set",attributes:we.attributes,name:k}),this}}},{name:function(ie){return"update".concat(ie,"Attribute")},attacher:function(ie,fe,re){ie.prototype[fe]=function(M,k,J){var we;if("mixed"!==this.type&&"mixed"!==re&&re!==this.type)throw new _e("Graph.".concat(fe,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>3){if(this.multi)throw new _e("Graph.".concat(fe,": 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=""+M,nt=""+k;if(k=arguments[2],J=arguments[3],!(we=W(this,Fe,nt,re)))throw new ne("Graph.".concat(fe,': could not find an edge for the given path ("').concat(Fe,'" - "').concat(nt,'").'))}else if(!(we=this._edges.get(M=""+M)))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" edge in the graph.'));if("function"!=typeof J)throw new me("Graph.".concat(fe,": updater should be a function."));if("mixed"!==re&&we.undirected!==("undirected"===re))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" ').concat(re," edge in the graph."));return we.attributes[k]=J(we.attributes[k]),this.emit("edgeAttributesUpdated",{key:we.key,type:"set",attributes:we.attributes,name:k}),this}}},{name:function(ie){return"remove".concat(ie,"Attribute")},attacher:function(ie,fe,re){ie.prototype[fe]=function(M,k){var J;if("mixed"!==this.type&&"mixed"!==re&&re!==this.type)throw new _e("Graph.".concat(fe,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new _e("Graph.".concat(fe,": 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=""+M,Fe=""+k;if(k=arguments[2],!(J=W(this,we,Fe,re)))throw new ne("Graph.".concat(fe,': could not find an edge for the given path ("').concat(we,'" - "').concat(Fe,'").'))}else if(!(J=this._edges.get(M=""+M)))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" edge in the graph.'));if("mixed"!==re&&J.undirected!==("undirected"===re))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" ').concat(re," edge in the graph."));return delete J.attributes[k],this.emit("edgeAttributesUpdated",{key:J.key,type:"remove",attributes:J.attributes,name:k}),this}}},{name:function(ie){return"replace".concat(ie,"Attributes")},attacher:function(ie,fe,re){ie.prototype[fe]=function(M,k){var J;if("mixed"!==this.type&&"mixed"!==re&&re!==this.type)throw new _e("Graph.".concat(fe,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new _e("Graph.".concat(fe,": 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=""+M,Fe=""+k;if(k=arguments[2],!(J=W(this,we,Fe,re)))throw new ne("Graph.".concat(fe,': could not find an edge for the given path ("').concat(we,'" - "').concat(Fe,'").'))}else if(!(J=this._edges.get(M=""+M)))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" edge in the graph.'));if(!P(k))throw new me("Graph.".concat(fe,": provided attributes are not a plain object."));if("mixed"!==re&&J.undirected!==("undirected"===re))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" ').concat(re," edge in the graph."));return J.attributes=k,this.emit("edgeAttributesUpdated",{key:J.key,type:"replace",attributes:J.attributes}),this}}},{name:function(ie){return"merge".concat(ie,"Attributes")},attacher:function(ie,fe,re){ie.prototype[fe]=function(M,k){var J;if("mixed"!==this.type&&"mixed"!==re&&re!==this.type)throw new _e("Graph.".concat(fe,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new _e("Graph.".concat(fe,": 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=""+M,Fe=""+k;if(k=arguments[2],!(J=W(this,we,Fe,re)))throw new ne("Graph.".concat(fe,': could not find an edge for the given path ("').concat(we,'" - "').concat(Fe,'").'))}else if(!(J=this._edges.get(M=""+M)))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" edge in the graph.'));if(!P(k))throw new me("Graph.".concat(fe,": provided attributes are not a plain object."));if("mixed"!==re&&J.undirected!==("undirected"===re))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" ').concat(re," edge in the graph."));return he(J.attributes,k),this.emit("edgeAttributesUpdated",{key:J.key,type:"merge",attributes:J.attributes,data:k}),this}}}],ke=se,Ke=function(){var ie,fe=arguments,re=-1;return new ke(function M(){if(!ie){if(++re>=fe.length)return{done:!0};ie=fe[re]}var k=ie.next();return k.done?(ie=null,M()):k})},Me=[{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 Ve(ie,fe){for(var re in fe)ie.push(fe[re].key)}function $e(ie,fe){for(var re in fe)fe[re].forEach(function(M){return ie.push(M.key)})}function Ne(ie,fe,re){for(var M in ie)if(M!==re){var k=ie[M];fe(k.key,k.attributes,k.source.key,k.target.key,k.source.attributes,k.target.attributes,k.undirected,k.generatedKey)}}function q(ie,fe,re){for(var M in ie)M!==re&&ie[M].forEach(function(k){return fe(k.key,k.attributes,k.source.key,k.target.key,k.source.attributes,k.target.attributes,k.undirected,k.generatedKey)})}function G(ie,fe,re){for(var M in ie)if(M!==re){var k=ie[M];if(fe(k.key,k.attributes,k.source.key,k.target.key,k.source.attributes,k.target.attributes,k.undirected,k.generatedKey))return!0}return!1}function pe(ie,fe,re){var M,k,J,we,Fe;for(var nt in ie)if(nt!==re)for(M=ie[nt].values();!0!==(k=M.next()).done;)if(we=(J=k.value).source,fe(J.key,J.attributes,we.key,(Fe=J.target).key,we.attributes,Fe.attributes,J.undirected,J.generatedKey))return!0;return!1}function ue(ie,fe){var re=Object.keys(ie),M=re.length,k=null,J=0;return new se(function we(){var Fe;if(k){var nt=k.next();if(nt.done)return k=null,J++,we();Fe=nt.value}else{if(J>=M)return{done:!0};var Ot=re[J];if(Ot===fe)return J++,we();if((Fe=ie[Ot])instanceof Set)return k=Fe.values(),we();J++}return{done:!1,value:[Fe.key,Fe.attributes,Fe.source.key,Fe.target.key,Fe.source.attributes,Fe.target.attributes]}})}function je(ie,fe,re){var M=fe[re];M&&ie.push(M.key)}function _t(ie,fe,re){var M=fe[re];M&&M.forEach(function(k){return ie.push(k.key)})}function pt(ie,fe,re){var M=ie[fe];if(M){var k=M.source,J=M.target;re(M.key,M.attributes,k.key,J.key,k.attributes,J.attributes,M.undirected,M.generatedKey)}}function ve(ie,fe,re){var M=ie[fe];M&&M.forEach(function(k){return re(k.key,k.attributes,k.source.key,k.target.key,k.source.attributes,k.target.attributes,k.undirected,k.generatedKey)})}function L(ie,fe,re){var M=ie[fe];if(M){var k=M.source,J=M.target;return re(M.key,M.attributes,k.key,J.key,k.attributes,J.attributes,M.undirected,M.generatedKey)}}function N(ie,fe,re){var M=ie[fe];if(M){for(var k,J,we=M.values();!0!==(k=we.next()).done;)if(re((J=k.value).key,J.attributes,J.source.key,J.target.key,J.source.attributes,J.target.attributes,J.undirected,J.generatedKey))return!0;return!1}}function B(ie,fe){var re=ie[fe];if(re instanceof Set){var M=re.values();return new se(function(){var k=M.next();if(k.done)return k;var J=k.value;return{done:!1,value:[J.key,J.attributes,J.source.key,J.target.key,J.source.attributes,J.target.attributes]}})}return se.of([re.key,re.attributes,re.source.key,re.target.key,re.source.attributes,re.target.attributes])}function Re(ie,fe){if(0===ie.size)return[];if("mixed"===fe||fe===ie.type)return"function"==typeof Array.from?Array.from(ie._edges.keys()):te(ie._edges.keys(),ie._edges.size);for(var re,M,J=new Array("undirected"===fe?ie.undirectedSize:ie.directedSize),we="undirected"===fe,Fe=ie._edges.values(),nt=0;!0!==(re=Fe.next()).done;)(M=re.value).undirected===we&&(J[nt++]=M.key);return J}function Qe(ie,fe,re){if(0!==ie.size)for(var M,k,J="mixed"!==fe&&fe!==ie.type,we="undirected"===fe,Fe=ie._edges.values();!0!==(M=Fe.next()).done;)if(k=M.value,!J||k.undirected===we){var Wt=k.source,xt=k.target;re(k.key,k.attributes,Wt.key,xt.key,Wt.attributes,xt.attributes,k.undirected,k.generatedKey)}}function St(ie,fe,re){if(0!==ie.size)for(var M,k,J="mixed"!==fe&&fe!==ie.type,we="undirected"===fe,Fe=ie._edges.values();!0!==(M=Fe.next()).done;)if(k=M.value,!J||k.undirected===we){var Wt=k.source,xt=k.target;if(re(k.key,k.attributes,Wt.key,xt.key,Wt.attributes,xt.attributes,k.undirected,k.generatedKey))break}}function Nt(ie,fe){if(0===ie.size)return se.empty();var re="mixed"!==fe&&fe!==ie.type,M="undirected"===fe,k=ie._edges.values();return new se(function(){for(var J,we;;){if((J=k.next()).done)return J;if(we=J.value,!re||we.undirected===M)break}return{value:[we.key,we.attributes,we.source.key,we.target.key,we.source.attributes,we.target.attributes],done:!1}})}function On(ie,fe,re,M){var k=[],J=ie?$e:Ve;return"undirected"!==fe&&("out"!==re&&J(k,M.in),"in"!==re&&J(k,M.out),!re&&M.directedSelfLoops>0&&k.splice(k.lastIndexOf(M.key),1)),"directed"!==fe&&J(k,M.undirected),k}function kn(ie,fe,re,M,k){var J=ie?q:Ne;"undirected"!==fe&&("out"!==re&&J(M.in,k),"in"!==re&&J(M.out,k,re?null:M.key)),"directed"!==fe&&J(M.undirected,k)}function Yn(ie,fe,re,M,k){var J=ie?pe:G;"undirected"!==fe&&("out"!==re&&J(M.in,k)||"in"!==re&&J(M.out,k,re?null:M.key))||"directed"===fe||J(M.undirected,k)}function Ti(ie,fe,re){var M=se.empty();return"undirected"!==ie&&("out"!==fe&&void 0!==re.in&&(M=Ke(M,ue(re.in))),"in"!==fe&&void 0!==re.out&&(M=Ke(M,ue(re.out,fe?null:re.key)))),"directed"!==ie&&void 0!==re.undirected&&(M=Ke(M,ue(re.undirected))),M}function wi(ie,fe,re,M,k){var J=fe?_t:je,we=[];return"undirected"!==ie&&(void 0!==M.in&&"out"!==re&&J(we,M.in,k),void 0!==M.out&&"in"!==re&&J(we,M.out,k),!re&&M.directedSelfLoops>0&&we.splice(we.lastIndexOf(M.key),1)),"directed"!==ie&&void 0!==M.undirected&&J(we,M.undirected,k),we}function Xr(ie,fe,re,M,k,J){var we=fe?ve:pt;"undirected"!==ie&&(void 0!==M.in&&"out"!==re&&we(M.in,k,J),M.key!==k&&void 0!==M.out&&"in"!==re&&we(M.out,k,J)),"directed"!==ie&&void 0!==M.undirected&&we(M.undirected,k,J)}function Ls(ie,fe,re,M,k,J){var we=fe?N:L;"undirected"!==ie&&(void 0!==M.in&&"out"!==re&&we(M.in,k,J)||M.key!==k&&void 0!==M.out&&"in"!==re&&we(M.out,k,J,re?null:M.key))||"directed"===ie||void 0===M.undirected||we(M.undirected,k,J)}function gs(ie,fe,re,M){var k=se.empty();return"undirected"!==ie&&(void 0!==re.in&&"out"!==fe&&M in re.in&&(k=Ke(k,B(re.in,M))),void 0!==re.out&&"in"!==fe&&M in re.out&&(k=Ke(k,B(re.out,M)))),"directed"!==ie&&void 0!==re.undirected&&M in re.undirected&&(k=Ke(k,B(re.undirected,M))),k}var Bs=[{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 Qr(ie,fe){if(void 0!==fe)for(var re in fe)ie.add(re)}function el(ie,fe,re){if("mixed"!==ie){if("undirected"===ie)return Object.keys(re.undirected);if("string"==typeof fe)return Object.keys(re[fe])}var M=new Set;return"undirected"!==ie&&("out"!==fe&&Qr(M,re.in),"in"!==fe&&Qr(M,re.out)),"directed"!==ie&&Qr(M,re.undirected),te(M.values(),M.size)}function kl(ie,fe,re){for(var M in fe){var k=fe[M];k instanceof Set&&(k=k.values().next().value);var J=k.source,Fe=J===ie?k.target:J;re(Fe.key,Fe.attributes)}}function Sa(ie,fe,re,M){for(var k in re){var J=re[k];J instanceof Set&&(J=J.values().next().value);var we=J.source,nt=we===fe?J.target:we;ie.has(nt.key)||(ie.add(nt.key),M(nt.key,nt.attributes))}}function Es(ie,fe,re){for(var M in fe){var k=fe[M];k instanceof Set&&(k=k.values().next().value);var J=k.source,Fe=J===ie?k.target:J;if(re(Fe.key,Fe.attributes))return!0}return!1}function Jt(ie,fe,re,M){for(var k in re){var J=re[k];J instanceof Set&&(J=J.values().next().value);var we=J.source,nt=we===fe?J.target:we;if(!ie.has(nt.key)&&(ie.add(nt.key),M(nt.key,nt.attributes)))return!0}return!1}function tl(ie,fe){var re=Object.keys(fe),M=re.length,k=0;return new se(function(){if(k>=M)return{done:!0};var J=fe[re[k++]];J instanceof Set&&(J=J.values().next().value);var we=J.source,nt=we===ie?J.target:we;return{done:!1,value:[nt.key,nt.attributes]}})}function rt(ie,fe,re){var M=Object.keys(re),k=M.length,J=0;return new se(function we(){if(J>=k)return{done:!0};var Fe=re[M[J++]];Fe instanceof Set&&(Fe=Fe.values().next().value);var nt=Fe.source,We=nt===fe?Fe.target:nt;return ie.has(We.key)?we():(ie.add(We.key),{done:!1,value:[We.key,We.attributes]})})}function lt(ie,fe,re,M,k){var J=ie._nodes.get(M);if("undirected"!==fe){if("out"!==re&&void 0!==J.in)for(var we in J.in)if(we===k)return!0;if("in"!==re&&void 0!==J.out)for(var Fe in J.out)if(Fe===k)return!0}if("directed"!==fe&&void 0!==J.undirected)for(var nt in J.undirected)if(nt===k)return!0;return!1}function Le(ie,fe,re){for(var M,k,J,we,Fe,nt,Ot,We=fe._nodes.values(),Wt=fe.type;!0!==(M=We.next()).done;){if(k=M.value,"undirected"!==Wt)for(J in we=k.out)if(nt=(Fe=we[J]).target,Ot=re(k.key,nt.key,k.attributes,nt.attributes,Fe.key,Fe.attributes,Fe.undirected,Fe.generatedKey),ie&&Ot)return;if("directed"!==Wt)for(J in we=k.undirected)if((nt=(Fe=we[J]).target).key!==J&&(nt=Fe.source),Ot=re(k.key,nt.key,k.attributes,nt.attributes,Fe.key,Fe.attributes,Fe.undirected,Fe.generatedKey),ie&&Ot)return}}function ut(ie,fe,re){for(var M,k,J,we,Fe,nt,Ot,We,Wt,xt=fe._nodes.values(),vn=fe.type;!0!==(M=xt.next()).done;){if(k=M.value,"undirected"!==vn)for(J in nt=k.out)for(we=nt[J].values();!0!==(Fe=we.next()).done;)if(We=(Ot=Fe.value).target,Wt=re(k.key,We.key,k.attributes,We.attributes,Ot.key,Ot.attributes,Ot.undirected,Ot.generatedKey),ie&&Wt)return;if("directed"!==vn)for(J in nt=k.undirected)for(we=nt[J].values();!0!==(Fe=we.next()).done;)if((We=(Ot=Fe.value).target).key!==J&&(We=Ot.source),Wt=re(k.key,We.key,k.attributes,We.attributes,Ot.key,Ot.attributes,Ot.undirected,Ot.generatedKey),ie&&Wt)return}}function Ze(ie,fe){var re={key:ie};return Q(fe.attributes)||(re.attributes=he({},fe.attributes)),re}function At(ie,fe){var re={source:fe.source.key,target:fe.target.key};return fe.generatedKey||(re.key=ie),Q(fe.attributes)||(re.attributes=he({},fe.attributes)),fe.undirected&&(re.undirected=!0),re}function Mt(ie){return P(ie)?"key"in ie?!("attributes"in ie)||P(ie.attributes)&&null!==ie.attributes?null:"invalid-attributes":"no-key":"not-object"}function Dt(ie){return P(ie)?"source"in ie?"target"in ie?!("attributes"in ie)||P(ie.attributes)&&null!==ie.attributes?"undirected"in ie&&"boolean"!=typeof ie.undirected?"invalid-undirected":null:"invalid-attributes":"no-target":"no-source":"not-object"}var Xt=new Set(["directed","undirected","mixed"]),zn=new Set(["domain","_events","_eventsCount","_maxListeners"]),ai={allowSelfLoops:!0,edgeKeyGenerator:null,multi:!1,type:"mixed"};function Nn(ie,fe,re){var M=new ie.NodeDataClass(fe,re);return ie._nodes.set(fe,M),ie.emit("nodeAdded",{key:fe,attributes:re}),M}function bn(ie,fe,re,M,k,J,we,Fe){if(!M&&"undirected"===ie.type)throw new _e("Graph.".concat(fe,": you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead."));if(M&&"directed"===ie.type)throw new _e("Graph.".concat(fe,": you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead."));if(Fe&&!P(Fe))throw new me("Graph.".concat(fe,': invalid attributes. Expecting an object but got "').concat(Fe,'"'));if(J=""+J,we=""+we,Fe=Fe||{},!ie.allowSelfLoops&&J===we)throw new _e("Graph.".concat(fe,': source & target are the same ("').concat(J,"\"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false."));var nt=ie._nodes.get(J),Ot=ie._nodes.get(we);if(!nt)throw new ne("Graph.".concat(fe,': source node "').concat(J,'" not found.'));if(!Ot)throw new ne("Graph.".concat(fe,': target node "').concat(we,'" not found.'));var We={key:null,undirected:M,source:J,target:we,attributes:Fe};if(re&&(k=ie._edgeKeyGenerator(We)),ie._edges.has(k=""+k))throw new _e("Graph.".concat(fe,': the "').concat(k,'" edge already exists in the graph.'));if(!ie.multi&&(M?void 0!==nt.undirected[we]:void 0!==nt.out[we]))throw new _e("Graph.".concat(fe,': an edge linking "').concat(J,'" 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 Wt=new Xe(M,k,re,nt,Ot,Fe);return ie._edges.set(k,Wt),J===we?M?(nt.undirectedSelfLoops++,ie._undirectedSelfLoopCount++):(nt.directedSelfLoops++,ie._directedSelfLoopCount++):M?(nt.undirectedDegree++,Ot.undirectedDegree++):(nt.outDegree++,Ot.inDegree++),tt(ie,M,Wt,J,we,nt,Ot),M?ie._undirectedSize++:ie._directedSize++,We.key=k,ie.emit("edgeAdded",We),k}function $n(ie,fe,re,M,k,J,we,Fe,nt){if(!M&&"undirected"===ie.type)throw new _e("Graph.".concat(fe,": you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead."));if(M&&"directed"===ie.type)throw new _e("Graph.".concat(fe,": you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead."));if(Fe)if(nt){if("function"!=typeof Fe)throw new me("Graph.".concat(fe,': invalid updater function. Expecting a function but got "').concat(Fe,'"'))}else if(!P(Fe))throw new me("Graph.".concat(fe,': invalid attributes. Expecting an object but got "').concat(Fe,'"'));var Ot;if(J=""+J,we=""+we,nt&&(Ot=Fe,Fe=void 0),!ie.allowSelfLoops&&J===we)throw new _e("Graph.".concat(fe,': source & target are the same ("').concat(J,"\"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false."));var We,Wt,xt=ie._nodes.get(J),vn=ie._nodes.get(we);if(!re&&(We=ie._edges.get(k))){if(We.source.key!==J||We.target.key!==we||M&&(We.source.key!==we||We.target.key!==J))throw new _e("Graph.".concat(fe,': inconsistency detected when attempting to merge the "').concat(k,'" edge with "').concat(J,'" source & "').concat(we,'" target vs. ("').concat(We.source.key,'", "').concat(We.target.key,'").'));Wt=We}if(Wt||ie.multi||!xt||(Wt=M?xt.undirected[we]:xt.out[we]),Wt)return(nt?Ot:Fe)?(nt?(Wt.attributes=Ot(Wt.attributes),ie.emit("edgeAttributesUpdated",{type:"replace",key:Wt.key,attributes:Wt.attributes})):(he(Wt.attributes,Fe),ie.emit("edgeAttributesUpdated",{type:"merge",key:Wt.key,attributes:Wt.attributes,data:Fe})),Wt.key):Wt.key;Fe=Fe||{},nt&&Ot&&(Fe=Ot(Fe));var Jr={key:null,undirected:M,source:J,target:we,attributes:Fe};if(re&&(k=ie._edgeKeyGenerator(Jr)),ie._edges.has(k=""+k))throw new _e("Graph.".concat(fe,': the "').concat(k,'" edge already exists in the graph.'));return xt||(xt=Nn(ie,J,{}),J===we&&(vn=xt)),vn||(vn=Nn(ie,we,{})),We=new Xe(M,k,re,xt,vn,Fe),ie._edges.set(k,We),J===we?M?(xt.undirectedSelfLoops++,ie._undirectedSelfLoopCount++):(xt.directedSelfLoops++,ie._directedSelfLoopCount++):M?(xt.undirectedDegree++,vn.undirectedDegree++):(xt.outDegree++,vn.inDegree++),tt(ie,M,We,J,we,xt,vn),M?ie._undirectedSize++:ie._directedSize++,Jr.key=k,ie.emit("edgeAdded",Jr),k}var ie,Tn=function(ie){function fe(M){var k;if(k=ie.call(this)||this,(M=he({},ai,M)).edgeKeyGenerator&&"function"!=typeof M.edgeKeyGenerator)throw new me("Graph.constructor: invalid 'edgeKeyGenerator' option. Expecting a function but got \"".concat(M.edgeKeyGenerator,'".'));if("boolean"!=typeof M.multi)throw new me("Graph.constructor: invalid 'multi' option. Expecting a boolean but got \"".concat(M.multi,'".'));if(!Xt.has(M.type))throw new me('Graph.constructor: invalid \'type\' option. Should be one of "mixed", "directed" or "undirected" but got "'.concat(M.type,'".'));if("boolean"!=typeof M.allowSelfLoops)throw new me("Graph.constructor: invalid 'allowSelfLoops' option. Expecting a boolean but got \"".concat(M.allowSelfLoops,'".'));var J,we="mixed"===M.type?Ie:"directed"===M.type?Ge:st;return z(Se(k),"NodeDataClass",we),z(Se(k),"_attributes",{}),z(Se(k),"_nodes",new Map),z(Se(k),"_edges",new Map),z(Se(k),"_directedSize",0),z(Se(k),"_undirectedSize",0),z(Se(k),"_directedSelfLoopCount",0),z(Se(k),"_undirectedSelfLoopCount",0),z(Se(k),"_edgeKeyGenerator",M.edgeKeyGenerator||(J=0,function(){return J++})),z(Se(k),"_options",M),zn.forEach(function(Fe){return z(Se(k),Fe,k[Fe])}),v(Se(k),"order",function(){return k._nodes.size}),v(Se(k),"size",function(){return k._edges.size}),v(Se(k),"directedSize",function(){return k._directedSize}),v(Se(k),"undirectedSize",function(){return k._undirectedSize}),v(Se(k),"selfLoopCount",function(){return k._directedSelfLoopCount+k._undirectedSelfLoopCount}),v(Se(k),"directedSelfLoopCount",function(){return k._directedSelfLoopCount}),v(Se(k),"undirectedSelfLoopCount",function(){return k._undirectedSelfLoopCount}),v(Se(k),"multi",k._options.multi),v(Se(k),"type",k._options.type),v(Se(k),"allowSelfLoops",k._options.allowSelfLoops),v(Se(k),"implementation",function(){return"graphology"}),k}Je(fe,ie);var re=fe.prototype;return re.hasNode=function(M){return this._nodes.has(""+M)},re.hasDirectedEdge=function(M,k){if("undirected"===this.type)return!1;if(1===arguments.length){var we=this._edges.get(""+M);return!!we&&!we.undirected}if(2===arguments.length){k=""+k;var Fe=this._nodes.get(M=""+M);if(!Fe)return!1;var nt=Fe.out[k];return!(!nt||this.multi&&!nt.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."))},re.hasUndirectedEdge=function(M,k){if("directed"===this.type)return!1;if(1===arguments.length){var we=this._edges.get(""+M);return!!we&&we.undirected}if(2===arguments.length){k=""+k;var Fe=this._nodes.get(M=""+M);if(!Fe)return!1;var nt=Fe.undirected[k];return!(!nt||this.multi&&!nt.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."))},re.hasEdge=function(M,k){if(1===arguments.length)return this._edges.has(""+M);if(2===arguments.length){k=""+k;var we=this._nodes.get(M=""+M);if(!we)return!1;var Fe=void 0!==we.out&&we.out[k];return Fe||(Fe=void 0!==we.undirected&&we.undirected[k]),!(!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."))},re.directedEdge=function(M,k){if("undirected"!==this.type){if(M=""+M,k=""+k,this.multi)throw new _e("Graph.directedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.directedEdges instead.");var J=this._nodes.get(M);if(!J)throw new ne('Graph.directedEdge: could not find the "'.concat(M,'" source node in the graph.'));if(!this._nodes.has(k))throw new ne('Graph.directedEdge: could not find the "'.concat(k,'" target node in the graph.'));var we=J.out&&J.out[k]||void 0;return we?we.key:void 0}},re.undirectedEdge=function(M,k){if("directed"!==this.type){if(M=""+M,k=""+k,this.multi)throw new _e("Graph.undirectedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.undirectedEdges instead.");var J=this._nodes.get(M);if(!J)throw new ne('Graph.undirectedEdge: could not find the "'.concat(M,'" source node in the graph.'));if(!this._nodes.has(k))throw new ne('Graph.undirectedEdge: could not find the "'.concat(k,'" target node in the graph.'));var we=J.undirected&&J.undirected[k]||void 0;return we?we.key:void 0}},re.edge=function(M,k){if(this.multi)throw new _e("Graph.edge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.edges instead.");k=""+k;var J=this._nodes.get(M=""+M);if(!J)throw new ne('Graph.edge: could not find the "'.concat(M,'" source node in the graph.'));if(!this._nodes.has(k))throw new ne('Graph.edge: could not find the "'.concat(k,'" target node in the graph.'));var we=J.out&&J.out[k]||J.undirected&&J.undirected[k]||void 0;if(we)return we.key},re.inDegree=function(M){var k=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof k)throw new me('Graph.inDegree: Expecting a boolean but got "'.concat(k,'" for the second parameter (allowing self-loops to be counted).'));var J=this._nodes.get(M=""+M);if(!J)throw new ne('Graph.inDegree: could not find the "'.concat(M,'" node in the graph.'));return"undirected"===this.type?0:J.inDegree+(k?J.directedSelfLoops:0)},re.outDegree=function(M){var k=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof k)throw new me('Graph.outDegree: Expecting a boolean but got "'.concat(k,'" for the second parameter (allowing self-loops to be counted).'));var J=this._nodes.get(M=""+M);if(!J)throw new ne('Graph.outDegree: could not find the "'.concat(M,'" node in the graph.'));return"undirected"===this.type?0:J.outDegree+(k?J.directedSelfLoops:0)},re.directedDegree=function(M){var k=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof k)throw new me('Graph.directedDegree: Expecting a boolean but got "'.concat(k,'" for the second parameter (allowing self-loops to be counted).'));var J=this._nodes.get(M=""+M);if(!J)throw new ne('Graph.directedDegree: could not find the "'.concat(M,'" node in the graph.'));if("undirected"===this.type)return 0;var we=k?J.directedSelfLoops:0;return J.inDegree+we+(J.outDegree+we)},re.undirectedDegree=function(M){var k=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof k)throw new me('Graph.undirectedDegree: Expecting a boolean but got "'.concat(k,'" for the second parameter (allowing self-loops to be counted).'));var J=this._nodes.get(M=""+M);if(!J)throw new ne('Graph.undirectedDegree: could not find the "'.concat(M,'" node in the graph.'));return"directed"===this.type?0:J.undirectedDegree+2*(k?J.undirectedSelfLoops:0)},re.degree=function(M){var k=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof k)throw new me('Graph.degree: Expecting a boolean but got "'.concat(k,'" for the second parameter (allowing self-loops to be counted).'));var J=this._nodes.get(M=""+M);if(!J)throw new ne('Graph.degree: could not find the "'.concat(M,'" node in the graph.'));var we=0,Fe=0;return"directed"!==this.type&&(k&&(Fe=J.undirectedSelfLoops),we+=J.undirectedDegree+2*Fe),"undirected"!==this.type&&(k&&(Fe=J.directedSelfLoops),we+=J.inDegree+J.outDegree+2*Fe),we},re.source=function(M){var k=this._edges.get(M=""+M);if(!k)throw new ne('Graph.source: could not find the "'.concat(M,'" edge in the graph.'));return k.source.key},re.target=function(M){var k=this._edges.get(M=""+M);if(!k)throw new ne('Graph.target: could not find the "'.concat(M,'" edge in the graph.'));return k.target.key},re.extremities=function(M){var k=this._edges.get(M=""+M);if(!k)throw new ne('Graph.extremities: could not find the "'.concat(M,'" edge in the graph.'));return[k.source.key,k.target.key]},re.opposite=function(M,k){M=""+M;var J=this._edges.get(k=""+k);if(!J)throw new ne('Graph.opposite: could not find the "'.concat(k,'" edge in the graph.'));var we=J.source.key,Fe=J.target.key;if(M!==we&&M!==Fe)throw new ne('Graph.opposite: the "'.concat(M,'" node is not attached to the "').concat(k,'" edge (').concat(we,", ").concat(Fe,")."));return M===we?Fe:we},re.hasExtremity=function(M,k){k=""+k;var J=this._edges.get(M=""+M);if(!J)throw new ne('Graph.hasExtremity: could not find the "'.concat(M,'" edge in the graph.'));return J.source.key===k||J.target.key===k},re.isUndirected=function(M){var k=this._edges.get(M=""+M);if(!k)throw new ne('Graph.isUndirected: could not find the "'.concat(M,'" edge in the graph.'));return k.undirected},re.isDirected=function(M){var k=this._edges.get(M=""+M);if(!k)throw new ne('Graph.isDirected: could not find the "'.concat(M,'" edge in the graph.'));return!k.undirected},re.isSelfLoop=function(M){var k=this._edges.get(M=""+M);if(!k)throw new ne('Graph.isSelfLoop: could not find the "'.concat(M,'" edge in the graph.'));return k.source===k.target},re.hasGeneratedKey=function(M){var k=this._edges.get(M=""+M);if(!k)throw new ne('Graph.hasGeneratedKey: could not find the "'.concat(M,'" edge in the graph.'));return k.generatedKey},re.addNode=function(M,k){return function(J,we,Fe){if(Fe&&!P(Fe))throw new me('Graph.addNode: invalid attributes. Expecting an object but got "'.concat(Fe,'"'));if(Fe=Fe||{},J._nodes.has(we=""+we))throw new _e('Graph.addNode: the "'.concat(we,'" node already exist in the graph.'));var nt=new J.NodeDataClass(we,Fe);return J._nodes.set(we,nt),J.emit("nodeAdded",{key:we,attributes:Fe}),nt}(this,M,k).key},re.mergeNode=function(M,k){if(k&&!P(k))throw new me('Graph.mergeNode: invalid attributes. Expecting an object but got "'.concat(k,'"'));k=k||{};var J=this._nodes.get(M=""+M);return J?(k&&(he(J.attributes,k),this.emit("nodeAttributesUpdated",{type:"merge",key:M,attributes:J.attributes,data:k})),M):(J=new this.NodeDataClass(M,k),this._nodes.set(M,J),this.emit("nodeAdded",{key:M,attributes:k}),M)},re.updateNode=function(M,k){if(k&&"function"!=typeof k)throw new me('Graph.updateNode: invalid updater function. Expecting a function but got "'.concat(k,'"'));var J=this._nodes.get(M=""+M);if(J)return k&&(J.attributes=k(J.attributes),this.emit("nodeAttributesUpdated",{type:"replace",key:M,attributes:J.attributes})),M;var Fe=k?k({}):{};return J=new this.NodeDataClass(M,Fe),this._nodes.set(M,J),this.emit("nodeAdded",{key:M,attributes:Fe}),M},re.dropNode=function(M){var k=this,J=this._nodes.get(M=""+M);if(!J)throw new ne('Graph.dropNode: could not find the "'.concat(M,'" node in the graph.'));this.forEachEdge(M,function(we){k.dropEdge(we)}),this._nodes.delete(M),this.emit("nodeDropped",{key:M,attributes:J.attributes})},re.dropEdge=function(M){var k;if(arguments.length>1){var J=""+arguments[0],we=""+arguments[1];if(!(k=W(this,J,we,this.type)))throw new ne('Graph.dropEdge: could not find the "'.concat(J,'" -> "').concat(we,'" edge in the graph.'))}else if(!(k=this._edges.get(M=""+M)))throw new ne('Graph.dropEdge: could not find the "'.concat(M,'" edge in the graph.'));this._edges.delete(k.key);var nt=k.source,Ot=k.target,We=k.attributes,Wt=k.undirected;return nt===Ot?Wt?(nt.undirectedSelfLoops--,this._undirectedSelfLoopCount--):(nt.directedSelfLoops--,this._directedSelfLoopCount--):Wt?(nt.undirectedDegree--,Ot.undirectedDegree--):(nt.outDegree--,Ot.inDegree--),Ye(this,Wt,k),Wt?this._undirectedSize--:this._directedSize--,this.emit("edgeDropped",{key:M,attributes:We,source:nt.key,target:Ot.key,undirected:Wt}),this},re.clear=function(){this._edges.clear(),this._nodes.clear(),this.emit("cleared")},re.clearEdges=function(){this._edges.clear(),this.clearIndex(),this.emit("edgesCleared")},re.getAttribute=function(M){return this._attributes[M]},re.getAttributes=function(){return this._attributes},re.hasAttribute=function(M){return this._attributes.hasOwnProperty(M)},re.setAttribute=function(M,k){return this._attributes[M]=k,this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:M}),this},re.updateAttribute=function(M,k){if("function"!=typeof k)throw new me("Graph.updateAttribute: updater should be a function.");return this._attributes[M]=k(this._attributes[M]),this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:M}),this},re.removeAttribute=function(M){return delete this._attributes[M],this.emit("attributesUpdated",{type:"remove",attributes:this._attributes,name:M}),this},re.replaceAttributes=function(M){if(!P(M))throw new me("Graph.replaceAttributes: provided attributes are not a plain object.");return this._attributes=M,this.emit("attributesUpdated",{type:"replace",attributes:this._attributes}),this},re.mergeAttributes=function(M){if(!P(M))throw new me("Graph.mergeAttributes: provided attributes are not a plain object.");return he(this._attributes,M),this.emit("attributesUpdated",{type:"merge",attributes:this._attributes,data:M}),this},re.getNodeAttribute=function(M,k){var J=this._nodes.get(M=""+M);if(!J)throw new ne('Graph.getNodeAttribute: could not find the "'.concat(M,'" node in the graph.'));return J.attributes[k]},re.getNodeAttributes=function(M){var k=this._nodes.get(M=""+M);if(!k)throw new ne('Graph.getNodeAttributes: could not find the "'.concat(M,'" node in the graph.'));return k.attributes},re.hasNodeAttribute=function(M,k){var J=this._nodes.get(M=""+M);if(!J)throw new ne('Graph.hasNodeAttribute: could not find the "'.concat(M,'" node in the graph.'));return J.attributes.hasOwnProperty(k)},re.setNodeAttribute=function(M,k,J){var we=this._nodes.get(M=""+M);if(!we)throw new ne('Graph.setNodeAttribute: could not find the "'.concat(M,'" 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[k]=J,this.emit("nodeAttributesUpdated",{key:M,type:"set",attributes:we.attributes,name:k}),this},re.updateNodeAttribute=function(M,k,J){var we=this._nodes.get(M=""+M);if(!we)throw new ne('Graph.updateNodeAttribute: could not find the "'.concat(M,'" 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 J)throw new me("Graph.updateAttribute: updater should be a function.");var Fe=we.attributes,nt=J(Fe[k]);return Fe[k]=nt,this.emit("nodeAttributesUpdated",{key:M,type:"set",attributes:we.attributes,name:k}),this},re.removeNodeAttribute=function(M,k){var J=this._nodes.get(M=""+M);if(!J)throw new ne('Graph.hasNodeAttribute: could not find the "'.concat(M,'" node in the graph.'));return delete J.attributes[k],this.emit("nodeAttributesUpdated",{key:M,type:"remove",attributes:J.attributes,name:k}),this},re.replaceNodeAttributes=function(M,k){var J=this._nodes.get(M=""+M);if(!J)throw new ne('Graph.replaceNodeAttributes: could not find the "'.concat(M,'" node in the graph.'));if(!P(k))throw new me("Graph.replaceNodeAttributes: provided attributes are not a plain object.");return J.attributes=k,this.emit("nodeAttributesUpdated",{key:M,type:"replace",attributes:J.attributes}),this},re.mergeNodeAttributes=function(M,k){var J=this._nodes.get(M=""+M);if(!J)throw new ne('Graph.mergeNodeAttributes: could not find the "'.concat(M,'" node in the graph.'));if(!P(k))throw new me("Graph.mergeNodeAttributes: provided attributes are not a plain object.");return he(J.attributes,k),this.emit("nodeAttributesUpdated",{key:M,type:"merge",attributes:J.attributes,data:k}),this},re.updateEachNodeAttributes=function(M,k){if("function"!=typeof M)throw new me("Graph.updateEachNodeAttributes: expecting an updater function.");if(k&&!x(k))throw new me("Graph.updateEachNodeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");for(var J,we,Fe=this._nodes.values();!0!==(J=Fe.next()).done;)(we=J.value).attributes=M(we.key,we.attributes);this.emit("eachNodeAttributesUpdated",{hints:k||null})},re.updateEachEdgeAttributes=function(M,k){if("function"!=typeof M)throw new me("Graph.updateEachEdgeAttributes: expecting an updater function.");if(k&&!x(k))throw new me("Graph.updateEachEdgeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");for(var J,we,Fe=this._edges.values();!0!==(J=Fe.next()).done;)(we=J.value).attributes=M(we.key,we.attributes);this.emit("eachEdgeAttributesUpdated",{hints:k||null})},re.forEach=function(M){if("function"!=typeof M)throw new me("Graph.forEach: expecting a callback.");this.multi?ut(!1,this,M):Le(!1,this,M)},re.forEachUntil=function(M){if("function"!=typeof M)throw new me("Graph.forEach: expecting a callback.");this.multi?ut(!0,this,M):Le(!0,this,M)},re.adjacency=function(){return this.multi?(nt=(M=this)._nodes.values(),Ot=M.type,We="outer",Wt=null,new se(function xt(){var vn;if("outer"===We)return!0===(vn=nt.next()).done?vn:(k=vn.value,We="directed",xt());if("directed"===We)return"undirected"===Ot?(We="undirected",xt()):(we=k.out,J=Object.keys(k.out),Fe=0,We="inner-directed",xt());if("undirected"===We){if("directed"===Ot)return We="outer",xt();we=k.undirected,J=Object.keys(k.undirected),Fe=0,We="inner-undirected"}if(!Wt&&Fe>=J.length)return We="inner-undirected"===We?"outer":"undirected",xt();if(!Wt){var Ss=J[Fe++];return Wt=we[Ss].values(),xt()}if((vn=Wt.next()).done)return Wt=null,xt();var Jr=vn.value,Qs=Jr.target;return"inner-undirected"===We&&Qs.key===k.key&&(Qs=Jr.source),{done:!1,value:[k.key,Qs.key,k.attributes,Qs.attributes,Jr.key,Jr.attributes]}})):(Ll=(xt=this)._nodes.values(),po=xt.type,jr="outer",new se(function js(){var xc;if("outer"===jr)return!0===(xc=Ll.next()).done?xc:(vn=xc.value,jr="directed",js());if("directed"===jr)return"undirected"===po?(jr="undirected",js()):(Jr=vn.out,Ss=Object.keys(vn.out),Qs=0,jr="inner-directed",js());if("undirected"===jr){if("directed"===po)return jr="outer",js();Jr=vn.undirected,Ss=Object.keys(vn.undirected),Qs=0,jr="inner-undirected"}if(Qs>=Ss.length)return jr="inner-undirected"===jr?"outer":"undirected",js();var Sn=Ss[Qs++],go=Jr[Sn],Bl=go.target;return"inner-undirected"===jr&&Bl.key===vn.key&&(Bl=go.source),{done:!1,value:[vn.key,Bl.key,vn.attributes,Bl.attributes,go.key,go.attributes]}}));var xt,vn,Ss,Jr,Qs,Ll,po,jr,M,k,J,we,Fe,nt,Ot,We,Wt},re.nodes=function(){return"function"==typeof Array.from?Array.from(this._nodes.keys()):te(this._nodes.keys(),this._nodes.size)},re.forEachNode=function(M){if("function"!=typeof M)throw new me("Graph.forEachNode: expecting a callback.");this._nodes.forEach(function(k,J){M(J,k.attributes)})},re.forEachNodeUntil=function(M){if("function"!=typeof M)throw new me("Graph.forEachNode: expecting a callback.");for(var k,J,we=this._nodes.values();!0!==(k=we.next())&&!M((J=k.value).key,J.attributes););},re.nodeEntries=function(){var M=this._nodes.values();return new se(function(){var k=M.next();if(k.done)return k;var J=k.value;return{value:[J.key,J.attributes],done:!1}})},re.exportNode=function(M){var k=this._nodes.get(M=""+M);if(!k)throw new ne('Graph.exportNode: could not find the "'.concat(M,'" node in the graph.'));return Ze(M,k)},re.exportEdge=function(M){var k=this._edges.get(M=""+M);if(!k)throw new ne('Graph.exportEdge: could not find the "'.concat(M,'" edge in the graph.'));return At(M,k)},re.export=function(){var M=new Array(this._nodes.size),k=0;this._nodes.forEach(function(we,Fe){M[k++]=Ze(Fe,we)});var J=new Array(this._edges.size);return k=0,this._edges.forEach(function(we,Fe){J[k++]=At(Fe,we)}),{attributes:this.getAttributes(),nodes:M,edges:J,options:{type:this.type,multi:this.multi,allowSelfLoops:this.allowSelfLoops}}},re.importNode=function(M){var k=arguments.length>1&&void 0!==arguments[1]&&arguments[1],J=Mt(M);if(J){if("not-object"===J)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"===J)throw new me("Graph.importNode: no key provided.");if("invalid-attributes"===J)throw new me("Graph.importNode: invalid attributes. Attributes should be a plain object, null or omitted.")}var we=M.key,Fe=M.attributes,nt=void 0===Fe?{}:Fe;return k?this.mergeNode(we,nt):this.addNode(we,nt),this},re.importEdge=function(M){var k=arguments.length>1&&void 0!==arguments[1]&&arguments[1],J=Dt(M);if(J){if("not-object"===J)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"===J)throw new me("Graph.importEdge: missing souce.");if("no-target"===J)throw new me("Graph.importEdge: missing target.");if("invalid-attributes"===J)throw new me("Graph.importEdge: invalid attributes. Attributes should be a plain object, null or omitted.");if("invalid-undirected"===J)throw new me("Graph.importEdge: invalid undirected. Undirected should be boolean or omitted.")}var we=M.source,Fe=M.target,nt=M.attributes,Ot=void 0===nt?{}:nt,We=M.undirected,Wt=void 0!==We&&We;return"key"in M?(k?Wt?this.mergeUndirectedEdgeWithKey:this.mergeDirectedEdgeWithKey:Wt?this.addUndirectedEdgeWithKey:this.addDirectedEdgeWithKey).call(this,M.key,we,Fe,Ot):(k?Wt?this.mergeUndirectedEdge:this.mergeDirectedEdge:Wt?this.addUndirectedEdge:this.addDirectedEdge).call(this,we,Fe,Ot),this},re.import=function(M){var k,J,we,Fe=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(j(M))return this.import(M.export(),Fe),this;if(!P(M))throw new me("Graph.import: invalid argument. Expecting a serialized graph or, alternatively, a Graph instance.");if(M.attributes){if(!P(M.attributes))throw new me("Graph.import: invalid attributes. Expecting a plain object.");Fe?this.mergeAttributes(M.attributes):this.replaceAttributes(M.attributes)}if(M.nodes){if(we=M.nodes,!Array.isArray(we))throw new me("Graph.import: invalid nodes. Expecting an array.");for(k=0,J=we.length;kJ)){var Ot=new Set;Ot.add(k.undirected[nt]),k.undirected[nt]=Ot,M._nodes.get(nt).undirected[J]=Ot}})),this;var M},re.clearIndex=function(){return this._nodes.forEach(function(M){void 0!==M.in&&(M.in={},M.out={}),void 0!==M.undirected&&(M.undirected={})}),this},re.toJSON=function(){return this.export()},re.toString=function(){return"[object Graph]"},re.inspect=function(){var M=this,k={};this._nodes.forEach(function(Ot,We){k[We]=Ot.attributes});var J={},we={};this._edges.forEach(function(Ot,We){var Wt=Ot.undirected?"--":"->",xt="",vn="(".concat(Ot.source.key,")").concat(Wt,"(").concat(Ot.target.key,")");Ot.generatedKey?M.multi&&(void 0===we[vn]?we[vn]=0:we[vn]++,xt+="".concat(we[vn],". ")):xt+="[".concat(We,"]: "),J[xt+=vn]=Ot.attributes});var Fe={};for(var nt in this)this.hasOwnProperty(nt)&&!zn.has(nt)&&"function"!=typeof this[nt]&&(Fe[nt]=this[nt]);return Fe.attributes=this._attributes,Fe.nodes=k,Fe.edges=J,z(Fe,"constructor",this.constructor),Fe},fe}(A.exports.EventEmitter);"undefined"!=typeof Symbol&&(Tn.prototype[Symbol.for("nodejs.util.inspect.custom")]=Tn.prototype.inspect),[{name:function(ie){return"".concat(ie,"Edge")},generateKey:!0},{name:function(ie){return"".concat(ie,"DirectedEdge")},generateKey:!0,type:"directed"},{name:function(ie){return"".concat(ie,"UndirectedEdge")},generateKey:!0,type:"undirected"},{name:function(ie){return"".concat(ie,"EdgeWithKey")}},{name:function(ie){return"".concat(ie,"DirectedEdgeWithKey")},type:"directed"},{name:function(ie){return"".concat(ie,"UndirectedEdgeWithKey")},type:"undirected"}].forEach(function(ie){["add","merge","update"].forEach(function(fe){var re=ie.name(fe),M="add"===fe?bn:$n;Tn.prototype[re]=ie.generateKey?function(k,J,we){return M(this,re,!0,"undirected"===(ie.type||this.type),null,k,J,we,"update"===fe)}:function(k,J,we,Fe){return M(this,re,!1,"undirected"===(ie.type||this.type),k,J,we,Fe,"update"===fe)}})}),"undefined"!=typeof Symbol&&(Tn.prototype[Symbol.iterator]=Tn.prototype.adjacency),ie=Tn,Ue.forEach(function(fe){var re=fe.name,M=fe.attacher;M(ie,re("Edge"),"mixed"),M(ie,re("DirectedEdge"),"directed"),M(ie,re("UndirectedEdge"),"undirected")}),function(ie){Me.forEach(function(fe){var M,k,J,we;J=(M=fe).type,we=M.direction,ie.prototype[k=M.name]=function(Fe,nt){if("mixed"!==J&&"mixed"!==this.type&&J!==this.type)return[];if(!arguments.length)return Re(this,J);if(1===arguments.length){var Ot=this._nodes.get(Fe=""+Fe);if(void 0===Ot)throw new ne("Graph.".concat(k,': could not find the "').concat(Fe,'" node in the graph.'));return On(this.multi,"mixed"===J?this.type:J,we,Ot)}if(2===arguments.length){nt=""+nt;var We=this._nodes.get(Fe=""+Fe);if(!We)throw new ne("Graph.".concat(k,': could not find the "').concat(Fe,'" source node in the graph.'));if(!this._nodes.has(nt))throw new ne("Graph.".concat(k,': could not find the "').concat(nt,'" target node in the graph.'));return wi(J,this.multi,we,We,nt)}throw new me("Graph.".concat(k,": too many arguments (expecting 0, 1 or 2 and got ").concat(arguments.length,")."))},function(re,M){var k=M.name,J=M.type,we=M.direction,Fe="forEach"+k[0].toUpperCase()+k.slice(1,-1);re.prototype[Fe]=function(nt,Ot,We){if("mixed"===J||"mixed"===this.type||J===this.type){if(1===arguments.length)return Qe(this,J,We=nt);if(2===arguments.length){We=Ot;var Wt=this._nodes.get(nt=""+nt);if(void 0===Wt)throw new ne("Graph.".concat(Fe,': could not find the "').concat(nt,'" node in the graph.'));return kn(this.multi,"mixed"===J?this.type:J,we,Wt,We)}if(3===arguments.length){Ot=""+Ot;var xt=this._nodes.get(nt=""+nt);if(!xt)throw new ne("Graph.".concat(Fe,': could not find the "').concat(nt,'" source node in the graph.'));if(!this._nodes.has(Ot))throw new ne("Graph.".concat(Fe,': could not find the "').concat(Ot,'" target node in the graph.'));return Xr(J,this.multi,we,xt,Ot,We)}throw new me("Graph.".concat(Fe,": too many arguments (expecting 1, 2 or 3 and got ").concat(arguments.length,")."))}}}(ie,fe),function(re,M){var k=M.name,J=M.type,we=M.direction,Fe="forEach"+k[0].toUpperCase()+k.slice(1,-1)+"Until";re.prototype[Fe]=function(nt,Ot,We){if("mixed"===J||"mixed"===this.type||J===this.type){if(1===arguments.length)return St(this,J,We=nt);if(2===arguments.length){We=Ot;var Wt=this._nodes.get(nt=""+nt);if(void 0===Wt)throw new ne("Graph.".concat(Fe,': could not find the "').concat(nt,'" node in the graph.'));return Yn(this.multi,"mixed"===J?this.type:J,we,Wt,We)}if(3===arguments.length){Ot=""+Ot;var xt=this._nodes.get(nt=""+nt);if(!xt)throw new ne("Graph.".concat(Fe,': could not find the "').concat(nt,'" source node in the graph.'));if(!this._nodes.has(Ot))throw new ne("Graph.".concat(Fe,': could not find the "').concat(Ot,'" target node in the graph.'));return Ls(J,this.multi,we,xt,Ot,We)}throw new me("Graph.".concat(Fe,": too many arguments (expecting 1, 2 or 3 and got ").concat(arguments.length,")."))}}}(ie,fe),function(re,M){var J=M.type,we=M.direction,Fe=M.name.slice(0,-1)+"Entries";re.prototype[Fe]=function(nt,Ot){if("mixed"!==J&&"mixed"!==this.type&&J!==this.type)return se.empty();if(!arguments.length)return Nt(this,J);if(1===arguments.length){var We=this._nodes.get(nt=""+nt);if(!We)throw new ne("Graph.".concat(Fe,': could not find the "').concat(nt,'" node in the graph.'));return Ti(J,we,We)}if(2===arguments.length){Ot=""+Ot;var Wt=this._nodes.get(nt=""+nt);if(!Wt)throw new ne("Graph.".concat(Fe,': could not find the "').concat(nt,'" source node in the graph.'));if(!this._nodes.has(Ot))throw new ne("Graph.".concat(Fe,': could not find the "').concat(Ot,'" target node in the graph.'));return gs(J,we,Wt,Ot)}throw new me("Graph.".concat(Fe,": too many arguments (expecting 0, 1 or 2 and got ").concat(arguments.length,")."))}}(ie,fe)})}(Tn),function(ie){Bs.forEach(function(fe){var M,k,J,we;J=(M=fe).type,we=M.direction,ie.prototype[k=M.name]=function(Fe){if("mixed"!==J&&"mixed"!==this.type&&J!==this.type)return[];if(2===arguments.length){var nt=""+arguments[0],Ot=""+arguments[1];if(!this._nodes.has(nt))throw new ne("Graph.".concat(k,': could not find the "').concat(nt,'" node in the graph.'));if(!this._nodes.has(Ot))throw new ne("Graph.".concat(k,': could not find the "').concat(Ot,'" node in the graph.'));return lt(this,J,we,nt,Ot)}if(1===arguments.length){var We=this._nodes.get(Fe=""+Fe);if(void 0===We)throw new ne("Graph.".concat(k,': could not find the "').concat(Fe,'" node in the graph.'));return el("mixed"===J?this.type:J,we,We)}throw new me("Graph.".concat(k,": invalid number of arguments (expecting 1 or 2 and got ").concat(arguments.length,")."))},function(ie,fe){var re=fe.name,M=fe.type,k=fe.direction,J="forEach"+re[0].toUpperCase()+re.slice(1,-1);ie.prototype[J]=function(we,Fe){if("mixed"===M||"mixed"===this.type||M===this.type){var nt=this._nodes.get(we=""+we);if(void 0===nt)throw new ne("Graph.".concat(J,': could not find the "').concat(we,'" node in the graph.'));!function(Ot,We,Wt,xt){if("mixed"!==Ot){if("undirected"===Ot)return kl(Wt,Wt.undirected,xt);if("string"==typeof We)return kl(Wt,Wt[We],xt)}var vn=new Set;"undirected"!==Ot&&("out"!==We&&Sa(vn,Wt,Wt.in,xt),"in"!==We&&Sa(vn,Wt,Wt.out,xt)),"directed"!==Ot&&Sa(vn,Wt,Wt.undirected,xt)}("mixed"===M?this.type:M,k,nt,Fe)}}}(ie,fe),function(ie,fe){var re=fe.name,M=fe.type,k=fe.direction,J="forEach"+re[0].toUpperCase()+re.slice(1,-1)+"Until";ie.prototype[J]=function(we,Fe){if("mixed"===M||"mixed"===this.type||M===this.type){var nt=this._nodes.get(we=""+we);if(void 0===nt)throw new ne("Graph.".concat(J,': could not find the "').concat(we,'" node in the graph.'));!function(Ot,We,Wt,xt){if("mixed"!==Ot){if("undirected"===Ot)return Es(Wt,Wt.undirected,xt);if("string"==typeof We)return Es(Wt,Wt[We],xt)}var vn=new Set;"undirected"!==Ot&&("out"!==We&&Jt(vn,Wt,Wt.in,xt)||"in"!==We&&Jt(vn,Wt,Wt.out,xt))||"directed"===Ot||Jt(vn,Wt,Wt.undirected,xt)}("mixed"===M?this.type:M,k,nt,Fe)}}}(ie,fe),function(ie,fe){var M=fe.type,k=fe.direction,J=fe.name.slice(0,-1)+"Entries";ie.prototype[J]=function(we){if("mixed"!==M&&"mixed"!==this.type&&M!==this.type)return se.empty();var Fe=this._nodes.get(we=""+we);if(void 0===Fe)throw new ne("Graph.".concat(J,': could not find the "').concat(we,'" node in the graph.'));return function(nt,Ot,We){if("mixed"!==nt){if("undirected"===nt)return tl(We,We.undirected);if("string"==typeof Ot)return tl(We,We[Ot])}var Wt=se.empty(),xt=new Set;return"undirected"!==nt&&("out"!==Ot&&(Wt=Ke(Wt,rt(xt,We,We.in))),"in"!==Ot&&(Wt=Ke(Wt,rt(xt,We,We.out)))),"directed"!==nt&&(Wt=Ke(Wt,rt(xt,We,We.undirected))),Wt}("mixed"===M?this.type:M,k,Fe)}}(ie,fe)})}(Tn);var lr=function(ie){function fe(re){var M=he({type:"directed"},re);if("multi"in M&&!1!==M.multi)throw new me("DirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if("directed"!==M.type)throw new me('DirectedGraph.from: inconsistent "'+M.type+'" type in given options!');return ie.call(this,M)||this}return Je(fe,ie),fe}(Tn),cr=function(ie){function fe(re){var M=he({type:"undirected"},re);if("multi"in M&&!1!==M.multi)throw new me("UndirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if("undirected"!==M.type)throw new me('UndirectedGraph.from: inconsistent "'+M.type+'" type in given options!');return ie.call(this,M)||this}return Je(fe,ie),fe}(Tn),Xn=function(ie){function fe(re){var M=he({multi:!0},re);if("multi"in M&&!0!==M.multi)throw new me("MultiGraph.from: inconsistent indication that the graph should be simple in given options!");return ie.call(this,M)||this}return Je(fe,ie),fe}(Tn),$i=function(ie){function fe(re){var M=he({type:"directed",multi:!0},re);if("multi"in M&&!0!==M.multi)throw new me("MultiDirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if("directed"!==M.type)throw new me('MultiDirectedGraph.from: inconsistent "'+M.type+'" type in given options!');return ie.call(this,M)||this}return Je(fe,ie),fe}(Tn),xa=function(ie){function fe(re){var M=he({type:"undirected",multi:!0},re);if("multi"in M&&!0!==M.multi)throw new me("MultiUndirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if("undirected"!==M.type)throw new me('MultiUndirectedGraph.from: inconsistent "'+M.type+'" type in given options!');return ie.call(this,M)||this}return Je(fe,ie),fe}(Tn);function Zr(ie){ie.from=function(fe,re){var M=he({},fe.options,re),k=new ie(M);return k.import(fe),k}}return Zr(Tn),Zr(lr),Zr(cr),Zr(Xn),Zr($i),Zr(xa),Tn.Graph=Tn,Tn.DirectedGraph=lr,Tn.UndirectedGraph=cr,Tn.MultiGraph=Xn,Tn.MultiDirectedGraph=$i,Tn.MultiUndirectedGraph=xa,Tn.InvalidArgumentsGraphError=me,Tn.NotFoundGraphError=ne,Tn.UsageGraphError=_e,Tn}()},524:(Ut,it,Je)=>{var yt;!function(ee,Tt,dt,Y){"use strict";var A,Se=["","webkit","Moz","MS","ms","o"],he=Tt.createElement("div"),j=Math.round,P=Math.abs,Q=Date.now;function z(ye,De,He){return setTimeout(T(ye,He),De)}function v(ye,De,He){return!!Array.isArray(ye)&&(x(ye,He[De],He),!0)}function x(ye,De,He){var bt;if(ye)if(ye.forEach)ye.forEach(De,He);else if(ye.length!==Y)for(bt=0;bt\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",li=ee.console&&(ee.console.warn||ee.console.log);return li&&li.call(ee.console,bt,Yt),ye.apply(this,arguments)}}A="function"!=typeof Object.assign?function(De){if(De===Y||null===De)throw new TypeError("Cannot convert undefined or null to object");for(var He=Object(De),bt=1;bt-1}function X(ye){return ye.trim().split(/\s+/g)}function E(ye,De,He){if(ye.indexOf&&!He)return ye.indexOf(De);for(var bt=0;btxs[De]}):bt.sort()),bt}function oe(ye,De){for(var He,bt,Gt=De[0].toUpperCase()+De.slice(1),Yt=0;Yt1&&!He.firstMultiple?He.firstMultiple=St(De):1===Gt&&(He.firstMultiple=!1);var Yt=He.firstInput,li=He.firstMultiple,Vr=li?li.center:Yt.center,es=De.center=Nt(bt);De.timeStamp=Q(),De.deltaTime=De.timeStamp-Yt.timeStamp,De.angle=Ti(Vr,es),De.distance=Yn(Vr,es),function(ye,De){var He=De.center,bt=ye.offsetDelta||{},Gt=ye.prevDelta||{},Yt=ye.prevInput||{};(1===De.eventType||4===Yt.eventType)&&(Gt=ye.prevDelta={x:Yt.deltaX||0,y:Yt.deltaY||0},bt=ye.offsetDelta={x:He.x,y:He.y}),De.deltaX=Gt.x+(He.x-bt.x),De.deltaY=Gt.y+(He.y-bt.y)}(He,De),De.offsetDirection=kn(De.deltaX,De.deltaY);var xs=On(De.deltaTime,De.deltaX,De.deltaY);De.overallVelocityX=xs.x,De.overallVelocityY=xs.y,De.overallVelocity=P(xs.x)>P(xs.y)?xs.x:xs.y,De.scale=li?function(ye,De){return Yn(De[0],De[1],pt)/Yn(ye[0],ye[1],pt)}(li.pointers,bt):1,De.rotation=li?function(ye,De){return Ti(De[1],De[0],pt)+Ti(ye[1],ye[0],pt)}(li.pointers,bt):0,De.maxPointers=He.prevInput?De.pointers.length>He.prevInput.maxPointers?De.pointers.length:He.prevInput.maxPointers:De.pointers.length,function(ye,De){var Gt,Yt,li,Vr,He=ye.lastInterval||De,bt=De.timeStamp-He.timeStamp;if(8!=De.eventType&&(bt>25||He.velocity===Y)){var es=De.deltaX-He.deltaX,xs=De.deltaY-He.deltaY,Qn=On(bt,es,xs);Yt=Qn.x,li=Qn.y,Gt=P(Qn.x)>P(Qn.y)?Qn.x:Qn.y,Vr=kn(es,xs),ye.lastInterval=De}else Gt=He.velocity,Yt=He.velocityX,li=He.velocityY,Vr=He.direction;De.velocity=Gt,De.velocityX=Yt,De.velocityY=li,De.direction=Vr}(He,De);var Qn=ye.element;D(De.srcEvent.target,Qn)&&(Qn=De.srcEvent.target),De.target=Qn}(ye,He),ye.emit("hammer.input",He),ye.recognize(He),ye.session.prevInput=He}function St(ye){for(var De=[],He=0;He=P(De)?ye<0?2:4:De<0?8:16}function Yn(ye,De,He){He||(He=_t);var bt=De[He[0]]-ye[He[0]],Gt=De[He[1]]-ye[He[1]];return Math.sqrt(bt*bt+Gt*Gt)}function Ti(ye,De,He){return He||(He=_t),180*Math.atan2(De[He[1]]-ye[He[1]],De[He[0]]-ye[He[0]])/Math.PI}ve.prototype={handler:function(){},init:function(){this.evEl&&K(this.element,this.evEl,this.domHandler),this.evTarget&&K(this.target,this.evTarget,this.domHandler),this.evWin&&K(Ce(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&ce(this.element,this.evEl,this.domHandler),this.evTarget&&ce(this.target,this.evTarget,this.domHandler),this.evWin&&ce(Ce(this.element),this.evWin,this.domHandler)}};var Ls={mousedown:1,mousemove:2,mouseup:4},gs="mousedown",Bs="mousemove mouseup";function Qr(){this.evEl=gs,this.evWin=Bs,this.pressed=!1,ve.apply(this,arguments)}S(Qr,ve,{handler:function(De){var He=Ls[De.type];1&He&&0===De.button&&(this.pressed=!0),2&He&&1!==De.which&&(He=4),this.pressed&&(4&He&&(this.pressed=!1),this.callback(this.manager,He,{pointers:[De],changedPointers:[De],pointerType:Xe,srcEvent:De}))}});var el={pointerdown:1,pointermove:2,pointerup:4,pointercancel:8,pointerout:8},kl={2:Ge,3:"pen",4:Xe,5:"kinect"},Sa="pointerdown",Es="pointermove pointerup pointercancel";function Jt(){this.evEl=Sa,this.evWin=Es,ve.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}ee.MSPointerEvent&&!ee.PointerEvent&&(Sa="MSPointerDown",Es="MSPointerMove MSPointerUp MSPointerCancel"),S(Jt,ve,{handler:function(De){var He=this.store,bt=!1,Gt=De.type.toLowerCase().replace("ms",""),Yt=el[Gt],li=kl[De.pointerType]||De.pointerType,Vr=li==Ge,es=E(He,De.pointerId,"pointerId");1&Yt&&(0===De.button||Vr)?es<0&&(He.push(De),es=He.length-1):12&Yt&&(bt=!0),!(es<0)&&(He[es]=De,this.callback(this.manager,Yt,{pointers:He,changedPointers:[De],pointerType:li,srcEvent:De}),bt&&He.splice(es,1))}});var tl={touchstart:1,touchmove:2,touchend:4,touchcancel:8},rt="touchstart",lt="touchstart touchmove touchend touchcancel";function ht(){this.evTarget=rt,this.evWin=lt,this.started=!1,ve.apply(this,arguments)}function ge(ye,De){var He=$(ye.touches),bt=$(ye.changedTouches);return 12&De&&(He=Z(He.concat(bt),"identifier",!0)),[He,bt]}S(ht,ve,{handler:function(De){var He=tl[De.type];if(1===He&&(this.started=!0),this.started){var bt=ge.call(this,De,He);12&He&&bt[0].length-bt[1].length==0&&(this.started=!1),this.callback(this.manager,He,{pointers:bt[0],changedPointers:bt[1],pointerType:Ge,srcEvent:De})}}});var be={touchstart:1,touchmove:2,touchend:4,touchcancel:8},Le="touchstart touchmove touchend touchcancel";function ut(){this.evTarget=Le,this.targetIds={},ve.apply(this,arguments)}function Ze(ye,De){var He=$(ye.touches),bt=this.targetIds;if(3&De&&1===He.length)return bt[He[0].identifier]=!0,[He,He];var Gt,Yt,li=$(ye.changedTouches),Vr=[],es=this.target;if(Yt=He.filter(function(xs){return D(xs.target,es)}),1===De)for(Gt=0;Gt-1&&bt.splice(Yt,1)},2500)}}function ai(ye){for(var De=ye.srcEvent.clientX,He=ye.srcEvent.clientY,bt=0;bt-1&&this.requireFail.splice(De,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(ye){return!!this.simultaneous[ye.id]},emit:function(ye){var De=this,He=this.state;function bt(Gt){De.manager.emit(Gt,ye)}He<8&&bt(De.options.event+We(He)),bt(De.options.event),ye.additionalEvent&&bt(ye.additionalEvent),He>=8&&bt(De.options.event+We(He))},tryEmit:function(ye){if(this.canEmit())return this.emit(ye);this.state=32},canEmit:function(){for(var ye=0;yeDe.threshold&&Gt&De.direction},attrTest:function(ye){return vn.prototype.attrTest.call(this,ye)&&(2&this.state||!(2&this.state)&&this.directionTest(ye))},emit:function(ye){this.pX=ye.deltaX,this.pY=ye.deltaY;var De=Wt(ye.direction);De&&(ye.additionalEvent=this.options.event+De),this._super.emit.call(this,ye)}}),S(Jr,vn,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[cr]},attrTest:function(ye){return this._super.attrTest.call(this,ye)&&(Math.abs(ye.scale-1)>this.options.threshold||2&this.state)},emit:function(ye){1!==ye.scale&&(ye.additionalEvent=this.options.event+(ye.scale<1?"in":"out")),this._super.emit.call(this,ye)}}),S(Qs,Ot,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return["auto"]},process:function(ye){var De=this.options,He=ye.pointers.length===De.pointers,bt=ye.distanceDe.time;if(this._input=ye,!bt||!He||12&ye.eventType&&!Gt)this.reset();else if(1&ye.eventType)this.reset(),this._timer=z(function(){this.state=8,this.tryEmit()},De.time,this);else if(4&ye.eventType)return 8;return 32},reset:function(){clearTimeout(this._timer)},emit:function(ye){8===this.state&&(ye&&4&ye.eventType?this.manager.emit(this.options.event+"up",ye):(this._input.timeStamp=Q(),this.manager.emit(this.options.event,this._input)))}}),S(Ll,vn,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[cr]},attrTest:function(ye){return this._super.attrTest.call(this,ye)&&(Math.abs(ye.rotation)>this.options.threshold||2&this.state)}}),S(po,vn,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:30,pointers:1},getTouchAction:function(){return Ss.prototype.getTouchAction.call(this)},attrTest:function(ye){var He,De=this.options.direction;return 30&De?He=ye.overallVelocity:6&De?He=ye.overallVelocityX:24&De&&(He=ye.overallVelocityY),this._super.attrTest.call(this,ye)&&De&ye.offsetDirection&&ye.distance>this.options.threshold&&ye.maxPointers==this.options.pointers&&P(He)>this.options.velocity&&4&ye.eventType},emit:function(ye){var De=Wt(ye.offsetDirection);De&&this.manager.emit(this.options.event+De,ye),this.manager.emit(this.options.event,ye)}}),S(jr,Ot,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[lr]},process:function(ye){var De=this.options,He=ye.pointers.length===De.pointers,bt=ye.distance"']/g,Es=RegExp(kl.source),Jt=RegExp(Sa.source),tl=/<%-([\s\S]+?)%>/g,rt=/<%([\s\S]+?)%>/g,lt=/<%=([\s\S]+?)%>/g,ht=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ge=/^\w*$/,be=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Le=/[\\^$.*+?()[\]{}|]/g,ut=RegExp(Le.source),Ze=/^\s+/,At=/\s/,Mt=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Dt=/\{\n\/\* \[wrapped with (.+)\] \*/,Xt=/,? & /,zn=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ai=/[()=,{}\[\]\/\s]/,Nn=/\\(\\)?/g,bn=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,$n=/\w*$/,Tn=/^[-+]0x[0-9a-f]+$/i,lr=/^0b[01]+$/i,cr=/^\[object .+?Constructor\]$/,Xn=/^0o[0-7]+$/i,$i=/^(?:0|[1-9]\d*)$/,xa=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Zr=/($^)/,ie=/['\n\r\u2028\u2029\\]/g,fe="\\ud800-\\udfff",J="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",we="\\u2700-\\u27bf",Fe="a-z\\xdf-\\xf6\\xf8-\\xff",xt="A-Z\\xc0-\\xd6\\xd8-\\xde",vn="\\ufe0e\\ufe0f",Ss="\\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",Qs="["+fe+"]",Ll="["+Ss+"]",po="["+J+"]",jr="\\d+",js="["+we+"]",xc="["+Fe+"]",Sn="[^"+fe+Ss+jr+we+Fe+xt+"]",go="\\ud83c[\\udffb-\\udfff]",Ca="[^"+fe+"]",wd="(?:\\ud83c[\\udde6-\\uddff]){2}",ye="[\\ud800-\\udbff][\\udc00-\\udfff]",De="["+xt+"]",bt="(?:"+xc+"|"+Sn+")",Gt="(?:"+De+"|"+Sn+")",Yt="(?:['\u2019](?:d|ll|m|re|s|t|ve))?",li="(?:['\u2019](?:D|LL|M|RE|S|T|VE))?",Vr="(?:"+po+"|"+go+")?",es="["+vn+"]?",A1=es+Vr+"(?:\\u200d(?:"+[Ca,wd,ye].join("|")+")"+es+Vr+")*",Ed="(?:"+[js,wd,ye].join("|")+")"+A1,tr="(?:"+[Ca+po+"?",po,wd,ye,Qs].join("|")+")",fp=RegExp("['\u2019]","g"),Jm=RegExp(po,"g"),Dh=RegExp(go+"(?="+go+")|"+tr+A1,"g"),sv=RegExp([De+"?"+xc+"+"+Yt+"(?="+[Ll,De,"$"].join("|")+")",Gt+"+"+li+"(?="+[Ll,De+bt,"$"].join("|")+")",De+"?"+bt+"+"+Yt,De+"+"+li,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",jr,Ed].join("|"),"g"),T1=RegExp("[\\u200d"+fe+J+vn+"]"),jl=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Ih=["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"],M1=-1,ln={};ln[Nt]=ln[On]=ln[kn]=ln[Yn]=ln[Ti]=ln[wi]=ln[Xr]=ln[Ls]=ln[gs]=!0,ln[Xe]=ln[tt]=ln[Qe]=ln[Ue]=ln[St]=ln[ke]=ln[Me]=ln[Ve]=ln[Ne]=ln[q]=ln[pe]=ln[_t]=ln[pt]=ln[ve]=ln[B]=!1;var ur={};ur[Xe]=ur[tt]=ur[Qe]=ur[St]=ur[Ue]=ur[ke]=ur[Nt]=ur[On]=ur[kn]=ur[Yn]=ur[Ti]=ur[Ne]=ur[q]=ur[pe]=ur[_t]=ur[pt]=ur[ve]=ur[L]=ur[wi]=ur[Xr]=ur[Ls]=ur[gs]=!0,ur[Me]=ur[Ve]=ur[B]=!1;var on={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},D1=parseFloat,cv=parseInt,Rt="object"==typeof global&&global&&global.Object===Object&&global,Vs="object"==typeof self&&self&&self.Object===Object&&self,Vi=Rt||Vs||Function("return this")(),Vl=it&&!it.nodeType&&it,Aa=Vl&&Ut&&!Ut.nodeType&&Ut,Oo=Aa&&Aa.exports===Vl,e_=Oo&&Rt.process,Sr=function(){try{return Aa&&Aa.require&&Aa.require("util").types||e_&&e_.binding&&e_.binding("util")}catch(It){}}(),nn=Sr&&Sr.isArrayBuffer,hi=Sr&&Sr.isDate,pr=Sr&&Sr.isMap,mo=Sr&&Sr.isRegExp,Cc=Sr&&Sr.isSet,as=Sr&&Sr.isTypedArray;function ls(at,It,Et){switch(Et.length){case 0:return at.call(It);case 1:return at.call(It,Et[0]);case 2:return at.call(It,Et[0],Et[1]);case 3:return at.call(It,Et[0],Et[1],Et[2])}return at.apply(It,Et)}function Ur(at,It,Et,hn){for(var Dn=-1,Li=null==at?0:at.length;++Dn-1}function Oh(at,It,Et){for(var hn=-1,Dn=null==at?0:at.length;++hn-1;);return Et}function N1(at,It){for(var Et=at.length;Et--&&nl(It,at[Et],0)>-1;);return Et}function c2(at,It){for(var Et=at.length,hn=0;Et--;)at[Et]===It&&++hn;return hn}var u2=Qo({\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"}),d2=Qo({"&":"&","<":"<",">":">",'"':""","'":"'"});function h2(at){return"\\"+on[at]}function Ph(at){return T1.test(at)}function dv(at){var It=-1,Et=Array(at.size);return at.forEach(function(hn,Dn){Et[++It]=[Dn,hn]}),Et}function P1(at,It){return function(Et){return at(It(Et))}}function yu(at,It){for(var Et=-1,hn=at.length,Dn=0,Li=[];++Et",""":'"',"'":"'"}),kh=function at(It){var d,Et=(It=null==It?Vi:kh.defaults(Vi.Object(),It,kh.pick(Vi,Ih))).Array,hn=It.Date,Dn=It.Error,Li=It.Function,ts=It.Math,Ki=It.Object,a_=It.RegExp,l_=It.String,Da=It.TypeError,gr=Et.prototype,bu=Ki.prototype,gp=It["__core-js_shared__"],xr=Li.prototype.toString,Xi=bu.hasOwnProperty,y2=0,Lh=(d=/[^.]+$/.exec(gp&&gp.keys&&gp.keys.IE_PROTO||""))?"Symbol(src)_1."+d:"",Zs=bu.toString,L1=xr.call(Ki),c_=Vi._,Md=a_("^"+xr.call(Xi).replace(Le,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),zs=Oo?It.Buffer:ee,zl=It.Symbol,Dd=It.Uint8Array,pv=zs?zs.allocUnsafe:ee,Ia=P1(Ki.getPrototypeOf,Ki),u_=Ki.create,mp=bu.propertyIsEnumerable,Bn=gr.splice,B1=zl?zl.isConcatSpreadable:ee,Bh=zl?zl.iterator:ee,vu=zl?zl.toStringTag:ee,_p=function(){try{var d=Lc(Ki,"defineProperty");return d({},"",{}),d}catch(f){}}(),gv=It.clearTimeout!==Vi.clearTimeout&&It.clearTimeout,j1=hn&&hn.now!==Vi.Date.now&&hn.now,V1=It.setTimeout!==Vi.setTimeout&&It.setTimeout,jt=ts.ceil,Ei=ts.floor,Cr=Ki.getOwnPropertySymbols,cs=zs?zs.isBuffer:ee,d_=It.isFinite,jh=gr.join,rl=P1(Ki.keys,Ki),Hr=ts.max,ms=ts.min,b2=hn.now,U1=It.parseInt,Vh=ts.random,yp=gr.reverse,As=Lc(It,"DataView"),_o=Lc(It,"Map"),bp=Lc(It,"Promise"),Oa=Lc(It,"Set"),No=Lc(It,"WeakMap"),Uh=Lc(Ki,"create"),zh=No&&new No,Id={},z1=Ru(As),h_=Ru(_o),f_=Ru(bp),mv=Ru(Oa),p_=Ru(No),vp=zl?zl.prototype:ee,Od=vp?vp.valueOf:ee,Hh=vp?vp.toString:ee;function Ee(d){if(Mr(d)&&!Rn(d)&&!(d instanceof fi)){if(d instanceof Po)return d;if(Xi.call(d,"__wrapped__"))return nf(d)}return new Po(d)}var wu=function(){function d(){}return function(f){if(!Tr(f))return{};if(u_)return u_(f);d.prototype=f;var _=new d;return d.prototype=ee,_}}();function Gh(){}function Po(d,f){this.__wrapped__=d,this.__actions__=[],this.__chain__=!!f,this.__index__=0,this.__values__=ee}function fi(d){this.__wrapped__=d,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=_e,this.__views__=[]}function yo(d){var f=-1,_=null==d?0:d.length;for(this.clear();++f<_;){var F=d[f];this.set(F[0],F[1])}}function Hl(d){var f=-1,_=null==d?0:d.length;for(this.clear();++f<_;){var F=d[f];this.set(F[0],F[1])}}function sl(d){var f=-1,_=null==d?0:d.length;for(this.clear();++f<_;){var F=d[f];this.set(F[0],F[1])}}function Ra(d){var f=-1,_=null==d?0:d.length;for(this.__data__=new sl;++f<_;)this.add(d[f])}function Na(d){var f=this.__data__=new Hl(d);this.size=f.size}function Wh(d,f){var _=Rn(d),F=!_&&pl(d),ae=!_&&!F&&gl(d),Te=!_&&!F&&!ae&&cf(d),ze=_||F||ae||Te,qe=ze?Td(d.length,l_):[],ct=qe.length;for(var kt in d)(f||Xi.call(d,kt))&&(!ze||!("length"==kt||ae&&("offset"==kt||"parent"==kt)||Te&&("buffer"==kt||"byteLength"==kt||"byteOffset"==kt)||Bo(kt,ct)))&&qe.push(kt);return qe}function y_(d){var f=d.length;return f?d[Gl(0,f-1)]:ee}function vv(d,f){return Wd(eo(d),Eu(f,0,d.length))}function Rd(d){return Wd(eo(d))}function b_(d,f,_){(_!==ee&&!In(d[f],_)||_===ee&&!(f in d))&&al(d,f,_)}function ol(d,f,_){var F=d[f];(!Xi.call(d,f)||!In(F,_)||_===ee&&!(f in d))&&al(d,f,_)}function Nd(d,f){for(var _=d.length;_--;)if(In(d[_][0],f))return _;return-1}function Cp(d,f,_,F){return Ic(d,function(ae,Te,ze){f(F,ae,_(ae),ze)}),F}function Z1(d,f){return d&&Fa(f,Os(f),d)}function al(d,f,_){"__proto__"==f&&_p?_p(d,f,{configurable:!0,enumerable:!0,value:_,writable:!0}):d[f]=_}function v_(d,f){for(var _=-1,F=f.length,ae=Et(F),Te=null==d;++_=f?d:f)),d}function Hs(d,f,_,F,ae,Te){var ze,qe=1&f,ct=2&f,kt=4&f;if(_&&(ze=ae?_(d,F,ae,Te):_(d)),ze!==ee)return ze;if(!Tr(d))return d;var Lt=Rn(d);if(Lt){if(ze=function(d){var f=d.length,_=new d.constructor(f);return f&&"string"==typeof d[0]&&Xi.call(d,"index")&&(_.index=d.index,_.input=d.input),_}(d),!qe)return eo(d,ze)}else{var zt=$s(d),en=zt==Ve||zt==$e;if(gl(d))return Np(d,qe);if(zt==pe||zt==Xe||en&&!ae){if(ze=ct||en?{}:Hv(d),!qe)return ct?function(d,f){return Fa(d,Vv(d),f)}(d,function(d,f){return d&&Fa(f,no(f),d)}(ze,d)):function(d,f){return Fa(d,k_(d),f)}(d,Z1(ze,d))}else{if(!ur[zt])return ae?d:{};ze=function(d,f,_){var F=d.constructor;switch(f){case Qe:return Mu(d);case Ue:case ke:return new F(+d);case St:return function(d,f){var _=f?Mu(d.buffer):d.buffer;return new d.constructor(_,d.byteOffset,d.byteLength)}(d,_);case Nt:case On:case kn:case Yn:case Ti:case wi:case Xr:case Ls:case gs:return O_(d,_);case Ne:return new F;case q:case ve:return new F(d);case _t:return function(d){var f=new d.constructor(d.source,$n.exec(d));return f.lastIndex=d.lastIndex,f}(d);case pt:return new F;case L:return function(d){return Od?Ki(Od.call(d)):{}}(d)}}(d,zt,qe)}}Te||(Te=new Na);var wn=Te.get(d);if(wn)return wn;Te.set(d,ze),yT(d)?d.forEach(function(jn){ze.add(Hs(jn,f,_,jn,d,Te))}):pT(d)&&d.forEach(function(jn,mi){ze.set(mi,Hs(jn,f,_,mi,d,Te))});var gi=Lt?ee:(kt?ct?P_:Yl:ct?no:Os)(d);return Us(gi||d,function(jn,mi){gi&&(jn=d[mi=jn]),ol(ze,mi,Hs(jn,f,_,mi,d,Te))}),ze}function Ap(d,f,_){var F=_.length;if(null==d)return!F;for(d=Ki(d);F--;){var ae=_[F],ze=d[ae];if(ze===ee&&!(ae in d)||!(0,f[ae])(ze))return!1}return!0}function qh(d,f,_){if("function"!=typeof d)throw new Da(Se);return ef(function(){d.apply(ee,_)},f)}function Dc(d,f,_,F){var ae=-1,Te=Ul,ze=!0,qe=d.length,ct=[],kt=f.length;if(!qe)return ct;_&&(f=Yi(f,Jo(_))),F?(Te=Oh,ze=!1):f.length>=200&&(Te=Nh,ze=!1,f=new Ra(f));e:for(;++ae-1},Hl.prototype.set=function(d,f){var _=this.__data__,F=Nd(_,d);return F<0?(++this.size,_.push([d,f])):_[F][1]=f,this},sl.prototype.clear=function(){this.size=0,this.__data__={hash:new yo,map:new(_o||Hl),string:new yo}},sl.prototype.delete=function(d){var f=Gs(this,d).delete(d);return this.size-=f?1:0,f},sl.prototype.get=function(d){return Gs(this,d).get(d)},sl.prototype.has=function(d){return Gs(this,d).has(d)},sl.prototype.set=function(d,f){var _=Gs(this,d),F=_.size;return _.set(d,f),this.size+=_.size==F?0:1,this},Ra.prototype.add=Ra.prototype.push=function(d){return this.__data__.set(d,W),this},Ra.prototype.has=function(d){return this.__data__.has(d)},Na.prototype.clear=function(){this.__data__=new Hl,this.size=0},Na.prototype.delete=function(d){var f=this.__data__,_=f.delete(d);return this.size=f.size,_},Na.prototype.get=function(d){return this.__data__.get(d)},Na.prototype.has=function(d){return this.__data__.has(d)},Na.prototype.set=function(d,f){var _=this.__data__;if(_ instanceof Hl){var F=_.__data__;if(!_o||F.length<199)return F.push([d,f]),this.size=++_.size,this;_=this.__data__=new sl(F)}return _.set(d,f),this.size=_.size,this};var Ic=ul(ll),E_=ul(Tp,!0);function Ev(d,f){var _=!0;return Ic(d,function(F,ae,Te){return _=!!f(F,ae,Te)}),_}function Yh(d,f,_){for(var F=-1,ae=d.length;++F0&&_(qe)?f>1?Ts(qe,f-1,_,F,ae):zr(ae,qe):F||(ae[ae.length]=qe)}return ae}var Pd=Ov(),Fd=Ov(!0);function ll(d,f){return d&&Pd(d,f,Os)}function Tp(d,f){return d&&Fd(d,f,Os)}function Kh(d,f){return Ta(f,function(_){return la(d[_])})}function ea(d,f){for(var _=0,F=(f=Pc(f,d)).length;null!=d&&_f}function kd(d,f){return null!=d&&Xi.call(d,f)}function Ld(d,f){return null!=d&&f in Ki(d)}function Su(d,f,_){for(var F=_?Oh:Ul,ae=d[0].length,Te=d.length,ze=Te,qe=Et(Te),ct=1/0,kt=[];ze--;){var Lt=d[ze];ze&&f&&(Lt=Yi(Lt,Jo(f))),ct=ms(Lt.length,ct),qe[ze]=!_&&(f||ae>=120&&Lt.length>=120)?new Ra(ze&&Lt):ee}Lt=d[0];var zt=-1,en=qe[0];e:for(;++zt=qe?ct:ct*("desc"==_[F]?-1:1)}return d.index-f.index}(Te,ze,_)});Et--;)at[Et]=at[Et].value;return at}(iA(d,function(Te,ze,qe){return{criteria:Yi(f,function(kt){return kt(Te)}),index:++F,value:Te}}))}function Tv(d,f,_){for(var F=-1,ae=f.length,Te={};++F-1;)qe!==d&&Bn.call(qe,ct,1),Bn.call(d,ct,1);return d}function Qh(d,f){for(var _=d?f.length:0,F=_-1;_--;){var ae=f[_];if(_==F||ae!==Te){var Te=ae;Bo(ae)?Bn.call(d,ae,1):Cu(d,ae)}}return d}function Gl(d,f){return d+Ei(Vh()*(f-d+1))}function Dp(d,f){var _="";if(!d||f<1||f>Ce)return _;do{f%2&&(_+=d),(f=Ei(f/2))&&(d+=d)}while(f);return _}function pi(d,f){return Hp(bA(d,f,io),d+"")}function sA(d){return y_(th(d))}function M2(d,f){var _=th(d);return Wd(_,Eu(f,0,_.length))}function Ip(d,f,_,F){if(!Tr(d))return d;for(var ae=-1,Te=(f=Pc(f,d)).length,ze=Te-1,qe=d;null!=qe&&++aeae?0:ae+f),(_=_>ae?ae:_)<0&&(_+=ae),ae=f>_?0:_-f>>>0,f>>>=0;for(var Te=Et(ae);++F>>1,ze=d[Te];null!==ze&&!ca(ze)&&(_?ze<=f:ze=200){var kt=f?null:N_(d);if(kt)return r_(kt);ze=!1,ae=Nh,ct=new Ra}else ct=f?[]:qe;e:for(;++F=F?d:Ds(d,f,_)}var lA=gv||function(d){return Vi.clearTimeout(d)};function Np(d,f){if(f)return d.slice();var _=d.length,F=pv?pv(_):new d.constructor(_);return d.copy(F),F}function Mu(d){var f=new d.constructor(d.byteLength);return new Dd(f).set(new Dd(d)),f}function O_(d,f){var _=f?Mu(d.buffer):d.buffer;return new d.constructor(_,d.byteOffset,d.length)}function Fc(d,f){if(d!==f){var _=d!==ee,F=null===d,ae=d==d,Te=ca(d),ze=f!==ee,qe=null===f,ct=f==f,kt=ca(f);if(!qe&&!kt&&!Te&&d>f||Te&&ze&&ct&&!qe&&!kt||F&&ze&&ct||!_&&ct||!ae)return 1;if(!F&&!Te&&!kt&&d1?_[ae-1]:ee,ze=ae>2?_[2]:ee;for(Te=d.length>3&&"function"==typeof Te?(ae--,Te):ee,ze&&Ws(_[0],_[1],ze)&&(Te=ae<3?ee:Te,ae=1),f=Ki(f);++F-1?ae[Te?f[ze]:ze]:ee}}function Iu(d){return dl(function(f){var _=f.length,F=_,ae=Po.prototype.thru;for(d&&f.reverse();F--;){var Te=f[F];if("function"!=typeof Te)throw new Da(Se);if(ae&&!ze&&"wrapper"==Vp(Te))var ze=new Po([],!0)}for(F=ze?F:_;++F<_;){var qe=Vp(Te=f[F]),ct="wrapper"==qe?F_(Te):ee;ze=ct&&Up(ct[0])&&424==ct[1]&&!ct[4].length&&1==ct[9]?ze[Vp(ct[0])].apply(ze,ct[3]):1==Te.length&&Up(Te)?ze[qe]():ze.thru(Te)}return function(){var kt=arguments,Lt=kt[0];if(ze&&1==kt.length&&Rn(Lt))return ze.plant(Lt).value();for(var zt=0,en=_?f[zt].apply(this,kt):Lt;++zt<_;)en=f[zt].call(this,en);return en}})}function kc(d,f,_,F,ae,Te,ze,qe,ct,kt){var Lt=f&K,zt=1&f,en=2&f,wn=24&f,Ln=512&f,gi=en?ee:Hd(d);return function jn(){for(var mi=arguments.length,Mi=Et(mi),wo=mi;wo--;)Mi[wo]=arguments[wo];if(wn)var qs=$d(jn),ua=c2(Mi,qs);if(F&&(Mi=Ud(Mi,F,ae,wn)),Te&&(Mi=Iv(Mi,Te,ze,wn)),mi-=ua,wn&&mi1&&Mi.reverse(),Lt&&ctqe))return!1;var kt=Te.get(d),Lt=Te.get(f);if(kt&&Lt)return kt==f&&Lt==d;var zt=-1,en=!0,wn=2&_?new Ra:ee;for(Te.set(d,f),Te.set(f,d);++zt-1&&d%1==0&&d1?"& ":"")+f[F],f=f.join(_>2?", ":" "),d.replace(Mt,"{\n/* [wrapped with "+f+"] */\n")}(F,function(d,f){return Us(st,function(_){var F="_."+_[0];f&_[1]&&!Ul(d,F)&&d.push(F)}),d.sort()}(function(d){var f=d.match(Dt);return f?f[1].split(Xt):[]}(F),_)))}function z_(d){var f=0,_=0;return function(){var F=b2(),ae=16-(F-_);if(_=F,ae>0){if(++f>=800)return arguments[0]}else f=0;return d.apply(ee,arguments)}}function Wd(d,f){var _=-1,F=d.length,ae=F-1;for(f=f===ee?F:f;++_1?d[f-1]:ee;return _="function"==typeof _?(d.pop(),_):ee,GA(d,_)});function Z_(d){var f=Ee(d);return f.__chain__=!0,f}function Yd(d,f){return f(d)}var J_=dl(function(d){var f=d.length,_=f?d[0]:0,F=this.__wrapped__,ae=function(Te){return v_(Te,d)};return!(f>1||this.__actions__.length)&&F instanceof fi&&Bo(_)?((F=F.slice(_,+_+(f?1:0))).__actions__.push({func:Yd,args:[ae],thisArg:ee}),new Po(F,this.__chain__).thru(function(Te){return f&&!Te.length&&Te.push(ee),Te})):this.thru(ae)}),qA=ns(function(d,f,_){Xi.call(d,_)?++d[_]:al(d,_,1)}),XA=Nv(G_),QA=Nv($_);function iy(d,f){return(Rn(d)?Us:Ic)(d,Fn(f,3))}function Wp(d,f){return(Rn(d)?Sd:E_)(d,Fn(f,3))}var JA=ns(function(d,f,_){Xi.call(d,_)?d[_].push(f):al(d,_,[f])}),dw=pi(function(d,f,_){var F=-1,ae="function"==typeof f,Te=bo(d)?Et(d.length):[];return Ic(d,function(ze){Te[++F]=ae?ls(f,ze,_):Pa(ze,f,_)}),Te}),hw=ns(function(d,f,_){al(d,_,f)});function fl(d,f){return(Rn(d)?Yi:iA)(d,Fn(f,3))}var pw=ns(function(d,f,_){d[_?0:1].push(f)},function(){return[[],[]]}),Yp=pi(function(d,f){if(null==d)return[];var _=f.length;return _>1&&Ws(d,f[0],f[1])?f=[]:_>2&&Ws(f[0],f[1],f[2])&&(f=[f[0]]),Xh(d,Ts(f,1),[])}),Nu=j1||function(){return Vi.Date.now()};function Kp(d,f,_){return f=_?ee:f,ql(d,K,ee,ee,ee,ee,f=d&&null==f?d.length:f)}function sy(d,f){var _;if("function"!=typeof f)throw new Da(Se);return d=Jn(d),function(){return--d>0&&(_=f.apply(this,arguments)),d<=1&&(f=ee),_}}var af=pi(function(d,f,_){var F=1;if(_.length){var ae=yu(_,$d(af));F|=V}return ql(d,F,f,_,ae)}),Xd=pi(function(d,f,_){var F=3;if(_.length){var ae=yu(_,$d(Xd));F|=V}return ql(f,F,d,_,ae)});function ww(d,f,_){var F,ae,Te,ze,qe,ct,kt=0,Lt=!1,zt=!1,en=!0;if("function"!=typeof d)throw new Da(Se);function wn(Hi){var yl=F,Uc=ae;return F=ae=ee,kt=Hi,ze=d.apply(Uc,yl)}function Ln(Hi){return kt=Hi,qe=ef(mi,f),Lt?wn(Hi):ze}function jn(Hi){var yl=Hi-ct;return ct===ee||yl>=f||yl<0||zt&&Hi-kt>=Te}function mi(){var Hi=Nu();if(jn(Hi))return Mi(Hi);qe=ef(mi,function(Hi){var lM=f-(Hi-ct);return zt?ms(lM,Te-(Hi-kt)):lM}(Hi))}function Mi(Hi){return qe=ee,en&&F?wn(Hi):(F=ae=ee,ze)}function ua(){var Hi=Nu(),yl=jn(Hi);if(F=arguments,ae=this,ct=Hi,yl){if(qe===ee)return Ln(ct);if(zt)return lA(qe),qe=ef(mi,f),wn(ct)}return qe===ee&&(qe=ef(mi,f)),ze}return f=vo(f)||0,Tr(_)&&(Lt=!!_.leading,Te=(zt="maxWait"in _)?Hr(vo(_.maxWait)||0,f):Te,en="trailing"in _?!!_.trailing:en),ua.cancel=function(){qe!==ee&&lA(qe),kt=0,F=ct=ae=qe=ee},ua.flush=function(){return qe===ee?ze:Mi(Nu())},ua}var iT=pi(function(d,f){return qh(d,1,f)}),Ew=pi(function(d,f,_){return qh(d,vo(f)||0,_)});function lf(d,f){if("function"!=typeof d||null!=f&&"function"!=typeof f)throw new Da(Se);var _=function(){var F=arguments,ae=f?f.apply(this,F):F[0],Te=_.cache;if(Te.has(ae))return Te.get(ae);var ze=d.apply(this,F);return _.cache=Te.set(ae,ze)||Te,ze};return _.cache=new(lf.Cache||sl),_}function ly(d){if("function"!=typeof d)throw new Da(Se);return function(){var f=arguments;switch(f.length){case 0:return!d.call(this);case 1:return!d.call(this,f[0]);case 2:return!d.call(this,f[0],f[1]);case 3:return!d.call(this,f[0],f[1],f[2])}return!d.apply(this,f)}}lf.Cache=sl;var rT=aA(function(d,f){var _=(f=1==f.length&&Rn(f[0])?Yi(f[0],Jo(Fn())):Yi(Ts(f,1),Jo(Fn()))).length;return pi(function(F){for(var ae=-1,Te=ms(F.length,_);++ae=f}),pl=J1(function(){return arguments}())?J1:function(d){return Mr(d)&&Xi.call(d,"callee")&&!mp.call(d,"callee")},Rn=Et.isArray,Mw=nn?Jo(nn):function(d){return Mr(d)&&Ms(d)==Qe};function bo(d){return null!=d&&uy(d.length)&&!la(d)}function Ar(d){return Mr(d)&&bo(d)}var gl=cs||Ny,Dw=hi?Jo(hi):function(d){return Mr(d)&&Ms(d)==ke};function La(d){if(!Mr(d))return!1;var f=Ms(d);return f==Me||"[object DOMException]"==f||"string"==typeof d.message&&"string"==typeof d.name&&!Jp(d)}function la(d){if(!Tr(d))return!1;var f=Ms(d);return f==Ve||f==$e||"[object AsyncFunction]"==f||"[object Proxy]"==f}function Zp(d){return"number"==typeof d&&d==Jn(d)}function uy(d){return"number"==typeof d&&d>-1&&d%1==0&&d<=Ce}function Tr(d){var f=typeof d;return null!=d&&("object"==f||"function"==f)}function Mr(d){return null!=d&&"object"==typeof d}var pT=pr?Jo(pr):function(d){return Mr(d)&&$s(d)==Ne};function _T(d){return"number"==typeof d||Mr(d)&&Ms(d)==q}function Jp(d){if(!Mr(d)||Ms(d)!=pe)return!1;var f=Ia(d);if(null===f)return!0;var _=Xi.call(f,"constructor")&&f.constructor;return"function"==typeof _&&_ instanceof _&&xr.call(_)==L1}var Nw=mo?Jo(mo):function(d){return Mr(d)&&Ms(d)==_t},yT=Cc?Jo(Cc):function(d){return Mr(d)&&$s(d)==pt};function hy(d){return"string"==typeof d||!Rn(d)&&Mr(d)&&Ms(d)==ve}function ca(d){return"symbol"==typeof d||Mr(d)&&Ms(d)==L}var cf=as?Jo(as):function(d){return Mr(d)&&uy(d.length)&&!!ln[Ms(d)]},Bc=Lp(Av),fy=Lp(function(d,f){return d<=f});function Pw(d){if(!d)return[];if(bo(d))return hy(d)?il(d):eo(d);if(Bh&&d[Bh])return function(at){for(var It,Et=[];!(It=at.next()).done;)Et.push(It.value);return Et}(d[Bh]());var f=$s(d);return(f==Ne?dv:f==pt?r_:th)(d)}function ml(d){return d?(d=vo(d))===te||d===-te?17976931348623157e292*(d<0?-1:1):d==d?d:0:0===d?d:0}function Jn(d){var f=ml(d),_=f%1;return f==f?_?f-_:f:0}function py(d){return d?Eu(Jn(d),0,_e):0}function vo(d){if("number"==typeof d)return d;if(ca(d))return NaN;if(Tr(d)){var f="function"==typeof d.valueOf?d.valueOf():d;d=Tr(f)?f+"":f}if("string"!=typeof d)return 0===d?d:+d;d=uv(d);var _=lr.test(d);return _||Xn.test(d)?cv(d.slice(2),_?2:8):Tn.test(d)?NaN:+d}function Fw(d){return Fa(d,no(d))}function zi(d){return null==d?"":Lo(d)}var bT=$l(function(d,f){if(zp(f)||bo(f))Fa(f,Os(f),d);else for(var _ in f)Xi.call(f,_)&&ol(d,_,f[_])}),vT=$l(function(d,f){Fa(f,no(f),d)}),Qd=$l(function(d,f,_,F){Fa(f,no(f),d,F)}),wT=$l(function(d,f,_,F){Fa(f,Os(f),d,F)}),kw=dl(v_),ST=pi(function(d,f){d=Ki(d);var _=-1,F=f.length,ae=F>2?f[2]:ee;for(ae&&Ws(f[0],f[1],ae)&&(F=1);++_1),Te}),Fa(d,P_(d),_),F&&(_=Hs(_,7,Bp));for(var ae=f.length;ae--;)Cu(_,f[ae]);return _}),MT=dl(function(d,f){return null==d?{}:function(d,f){return Tv(d,f,function(_,F){return eg(d,F)})}(d,f)});function Hw(d,f){if(null==d)return{};var _=Yi(P_(d),function(F){return[F]});return f=Fn(f),Tv(d,_,function(F,ae){return f(F,ae[0])})}var DT=Ou(Os),$w=Ou(no);function th(d){return null==d?[]:i_(d,Os(d))}var PT=Wl(function(d,f,_){return f=f.toLowerCase(),d+(_?yy(f):f)});function yy(d){return ig(zi(d).toLowerCase())}function by(d){return(d=zi(d))&&d.replace(xa,u2).replace(Jm,"")}var kT=Wl(function(d,f,_){return d+(_?"-":"")+f.toLowerCase()}),LT=Wl(function(d,f,_){return d+(_?" ":"")+f.toLowerCase()}),K2=Pp("toLowerCase"),zT=Wl(function(d,f,_){return d+(_?"_":"")+f.toLowerCase()}),Ey=Wl(function(d,f,_){return d+(_?" ":"")+ig(f)}),Qw=Wl(function(d,f,_){return d+(_?" ":"")+f.toUpperCase()}),ig=Pp("toUpperCase");function Ay(d,f,_){return d=zi(d),(f=_?ee:f)===ee?function(at){return jl.test(at)}(d)?function(at){return at.match(sv)||[]}(d):function(at){return at.match(zn)||[]}(d):d.match(f)||[]}var Ty=pi(function(d,f){try{return ls(d,ee,f)}catch(_){return La(_)?_:new Dn(_)}}),Zw=dl(function(d,f){return Us(f,function(_){_=ni(_),al(d,_,af(d[_],d))}),d});function My(d){return function(){return d}}var Q2=Iu(),Pu=Iu(!0);function io(d){return d}function Fu(d){return nA("function"==typeof d?d:Hs(d,1))}var Dy=pi(function(d,f){return function(_){return Pa(_,d,f)}}),Jw=pi(function(d,f){return function(_){return Pa(d,_,f)}});function Iy(d,f,_){var F=Os(f),ae=Kh(f,F);null==_&&(!Tr(f)||!ae.length&&F.length)&&(_=f,f=d,d=this,ae=Kh(f,Os(f)));var Te=!(Tr(_)&&"chain"in _&&!_.chain),ze=la(d);return Us(ae,function(qe){var ct=f[qe];d[qe]=ct,ze&&(d.prototype[qe]=function(){var kt=this.__chain__;if(Te||kt){var Lt=d(this.__wrapped__),zt=Lt.__actions__=eo(this.__actions__);return zt.push({func:ct,args:arguments,thisArg:d}),Lt.__chain__=kt,Lt}return ct.apply(d,zr([this.value()],arguments))})}),d}function Oy(){}var XT=Fp(Yi),QT=Fp(ti),tE=Fp(Ro);function ku(d){return ra(d)?t_(ni(d)):function(d){return function(f){return ea(f,d)}}(d)}var ZT=Fv(),JT=Fv(!0);function Vc(){return[]}function Ny(){return!1}var Wn=R_(function(d,f){return d+f},0),Py=Gd("ceil"),J2=R_(function(d,f){return d/f},1),Ql=Gd("floor"),sE=R_(function(d,f){return d*f},1),oE=Gd("round"),aE=R_(function(d,f){return d-f},0);return Ee.after=function(d,f){if("function"!=typeof f)throw new Da(Se);return d=Jn(d),function(){if(--d<1)return f.apply(this,arguments)}},Ee.ary=Kp,Ee.assign=bT,Ee.assignIn=vT,Ee.assignInWith=Qd,Ee.assignWith=wT,Ee.at=kw,Ee.before=sy,Ee.bind=af,Ee.bindAll=Zw,Ee.bindKey=Xd,Ee.castArray=function(){if(!arguments.length)return[];var d=arguments[0];return Rn(d)?d:[d]},Ee.chain=Z_,Ee.chunk=function(d,f,_){f=(_?Ws(d,f,_):f===ee)?1:Hr(Jn(f),0);var F=null==d?0:d.length;if(!F||f<1)return[];for(var ae=0,Te=0,ze=Et(jt(F/f));aeae?0:ae+_),(F=F===ee||F>ae?ae:Jn(F))<0&&(F+=ae),F=_>F?0:py(F);_>>0)?(d=zi(d))&&("string"==typeof f||null!=f&&!Nw(f))&&!(f=Lo(f))&&Ph(d)?cl(il(d),0,_):d.split(f,_):[]},Ee.spread=function(d,f){if("function"!=typeof d)throw new Da(Se);return f=null==f?0:Hr(Jn(f),0),pi(function(_){var F=_[f],ae=cl(_,0,f);return F&&zr(ae,F),ls(d,this,ae)})},Ee.tail=function(d){var f=null==d?0:d.length;return f?Ds(d,1,f):[]},Ee.take=function(d,f,_){return d&&d.length?Ds(d,0,(f=_||f===ee?1:Jn(f))<0?0:f):[]},Ee.takeRight=function(d,f,_){var F=null==d?0:d.length;return F?Ds(d,(f=F-(f=_||f===ee?1:Jn(f)))<0?0:f,F):[]},Ee.takeRightWhile=function(d,f){return d&&d.length?Au(d,Fn(f,3),!1,!0):[]},Ee.takeWhile=function(d,f){return d&&d.length?Au(d,Fn(f,3)):[]},Ee.tap=function(d,f){return f(d),d},Ee.throttle=function(d,f,_){var F=!0,ae=!0;if("function"!=typeof d)throw new Da(Se);return Tr(_)&&(F="leading"in _?!!_.leading:F,ae="trailing"in _?!!_.trailing:ae),ww(d,f,{leading:F,maxWait:f,trailing:ae})},Ee.thru=Yd,Ee.toArray=Pw,Ee.toPairs=DT,Ee.toPairsIn=$w,Ee.toPath=function(d){return Rn(d)?Yi(d,ni):ca(d)?[d]:eo(qv(zi(d)))},Ee.toPlainObject=Fw,Ee.transform=function(d,f,_){var F=Rn(d),ae=F||gl(d)||cf(d);if(f=Fn(f,4),null==_){var Te=d&&d.constructor;_=ae?F?new Te:[]:Tr(d)&&la(Te)?wu(Ia(d)):{}}return(ae?Us:ll)(d,function(ze,qe,ct){return f(_,ze,qe,ct)}),_},Ee.unary=function(d){return Kp(d,1)},Ee.union=iw,Ee.unionBy=UA,Ee.unionWith=zA,Ee.uniq=function(d){return d&&d.length?Rc(d):[]},Ee.uniqBy=function(d,f){return d&&d.length?Rc(d,Fn(f,2)):[]},Ee.uniqWith=function(d,f){return f="function"==typeof f?f:ee,d&&d.length?Rc(d,ee,f):[]},Ee.unset=function(d,f){return null==d||Cu(d,f)},Ee.unzip=rw,Ee.unzipWith=GA,Ee.update=function(d,f,_){return null==d?d:Op(d,f,I_(_))},Ee.updateWith=function(d,f,_,F){return F="function"==typeof F?F:ee,null==d?d:Op(d,f,I_(_),F)},Ee.values=th,Ee.valuesIn=function(d){return null==d?[]:i_(d,no(d))},Ee.without=sw,Ee.words=Ay,Ee.wrap=function(d,f){return Xp(I_(f),d)},Ee.xor=B2,Ee.xorBy=jo,Ee.xorWith=X_,Ee.zip=Q_,Ee.zipObject=function(d,f){return Rp(d||[],f||[],ol)},Ee.zipObjectDeep=function(d,f){return Rp(d||[],f||[],Ip)},Ee.zipWith=of,Ee.entries=DT,Ee.entriesIn=$w,Ee.extend=vT,Ee.extendWith=Qd,Iy(Ee,Ee),Ee.add=Wn,Ee.attempt=Ty,Ee.camelCase=PT,Ee.capitalize=yy,Ee.ceil=Py,Ee.clamp=function(d,f,_){return _===ee&&(_=f,f=ee),_!==ee&&(_=(_=vo(_))==_?_:0),f!==ee&&(f=(f=vo(f))==f?f:0),Eu(vo(d),f,_)},Ee.clone=function(d){return Hs(d,4)},Ee.cloneDeep=function(d){return Hs(d,5)},Ee.cloneDeepWith=function(d,f){return Hs(d,5,f="function"==typeof f?f:ee)},Ee.cloneWith=function(d,f){return Hs(d,4,f="function"==typeof f?f:ee)},Ee.conformsTo=function(d,f){return null==f||Ap(d,f,Os(f))},Ee.deburr=by,Ee.defaultTo=function(d,f){return null==d||d!=d?f:d},Ee.divide=J2,Ee.endsWith=function(d,f,_){d=zi(d),f=Lo(f);var F=d.length,ae=_=_===ee?F:Eu(Jn(_),0,F);return(_-=f.length)>=0&&d.slice(_,ae)==f},Ee.eq=In,Ee.escape=function(d){return(d=zi(d))&&Jt.test(d)?d.replace(Sa,d2):d},Ee.escapeRegExp=function(d){return(d=zi(d))&&ut.test(d)?d.replace(Le,"\\$&"):d},Ee.every=function(d,f,_){var F=Rn(d)?ti:Ev;return _&&Ws(d,f,_)&&(f=ee),F(d,Fn(f,3))},Ee.find=XA,Ee.findIndex=G_,Ee.findKey=function(d,f){return Rh(d,Fn(f,3),ll)},Ee.findLast=QA,Ee.findLastIndex=$_,Ee.findLastKey=function(d,f){return Rh(d,Fn(f,3),Tp)},Ee.floor=Ql,Ee.forEach=iy,Ee.forEachRight=Wp,Ee.forIn=function(d,f){return null==d?d:Pd(d,Fn(f,3),no)},Ee.forInRight=function(d,f){return null==d?d:Fd(d,Fn(f,3),no)},Ee.forOwn=function(d,f){return d&&ll(d,Fn(f,3))},Ee.forOwnRight=function(d,f){return d&&Tp(d,Fn(f,3))},Ee.get=hf,Ee.gt=Zt,Ee.gte=Tw,Ee.has=function(d,f){return null!=d&&zv(d,f,kd)},Ee.hasIn=eg,Ee.head=Kv,Ee.identity=io,Ee.includes=function(d,f,_,F){d=bo(d)?d:th(d),_=_&&!F?Jn(_):0;var ae=d.length;return _<0&&(_=Hr(ae+_,0)),hy(d)?_<=ae&&d.indexOf(f,_)>-1:!!ae&&nl(d,f,_)>-1},Ee.indexOf=function(d,f,_){var F=null==d?0:d.length;if(!F)return-1;var ae=null==_?0:Jn(_);return ae<0&&(ae=Hr(F+ae,0)),nl(d,f,ae)},Ee.inRange=function(d,f,_){return f=ml(f),_===ee?(_=f,f=0):_=ml(_),function(d,f,_){return d>=ms(f,_)&&d=-Ce&&d<=Ce},Ee.isSet=yT,Ee.isString=hy,Ee.isSymbol=ca,Ee.isTypedArray=cf,Ee.isUndefined=function(d){return d===ee},Ee.isWeakMap=function(d){return Mr(d)&&$s(d)==B},Ee.isWeakSet=function(d){return Mr(d)&&"[object WeakSet]"==Ms(d)},Ee.join=function(d,f){return null==d?"":jh.call(d,f)},Ee.kebabCase=kT,Ee.last=sa,Ee.lastIndexOf=function(d,f,_){var F=null==d?0:d.length;if(!F)return-1;var ae=F;return _!==ee&&(ae=(ae=Jn(_))<0?Hr(F+ae,0):ms(ae,F-1)),f==f?function(at,It,Et){for(var hn=Et+1;hn--;)if(at[hn]===It)return hn;return hn}(d,f,ae):Cd(d,Ac,ae,!0)},Ee.lowerCase=LT,Ee.lowerFirst=K2,Ee.lt=Bc,Ee.lte=fy,Ee.max=function(d){return d&&d.length?Yh(d,io,Fo):ee},Ee.maxBy=function(d,f){return d&&d.length?Yh(d,Fn(f,2),Fo):ee},Ee.mean=function(d){return Cs(d,io)},Ee.meanBy=function(d,f){return Cs(d,Fn(f,2))},Ee.min=function(d){return d&&d.length?Yh(d,io,Av):ee},Ee.minBy=function(d,f){return d&&d.length?Yh(d,Fn(f,2),Av):ee},Ee.stubArray=Vc,Ee.stubFalse=Ny,Ee.stubObject=function(){return{}},Ee.stubString=function(){return""},Ee.stubTrue=function(){return!0},Ee.multiply=sE,Ee.nth=function(d,f){return d&&d.length?xu(d,Jn(f)):ee},Ee.noConflict=function(){return Vi._===this&&(Vi._=c_),this},Ee.noop=Oy,Ee.now=Nu,Ee.pad=function(d,f,_){d=zi(d);var F=(f=Jn(f))?Fh(d):0;if(!f||F>=f)return d;var ae=(f-F)/2;return kp(Ei(ae),_)+d+kp(jt(ae),_)},Ee.padEnd=function(d,f,_){d=zi(d);var F=(f=Jn(f))?Fh(d):0;return f&&Ff){var F=d;d=f,f=F}if(_||d%1||f%1){var ae=Vh();return ms(d+ae*(f-d+D1("1e-"+((ae+"").length-1))),f)}return Gl(d,f)},Ee.reduce=function(d,f,_){var F=Rn(d)?_u:Zo,ae=arguments.length<3;return F(d,Fn(f,4),_,ae,Ic)},Ee.reduceRight=function(d,f,_){var F=Rn(d)?xd:Zo,ae=arguments.length<3;return F(d,Fn(f,4),_,ae,E_)},Ee.repeat=function(d,f,_){return f=(_?Ws(d,f,_):f===ee)?1:Jn(f),Dp(zi(d),f)},Ee.replace=function(){var d=arguments,f=zi(d[0]);return d.length<3?f:f.replace(d[1],d[2])},Ee.result=function(d,f,_){var F=-1,ae=(f=Pc(f,d)).length;for(ae||(ae=1,d=ee);++FCe)return[];var _=_e,F=ms(d,_e);f=Fn(f),d-=_e;for(var ae=Td(F,f);++_=Te)return d;var qe=_-Fh(F);if(qe<1)return F;var ct=ze?cl(ze,0,qe).join(""):d.slice(0,qe);if(ae===ee)return ct+F;if(ze&&(qe+=ct.length-qe),Nw(ae)){if(d.slice(qe).search(ae)){var kt,Lt=ct;for(ae.global||(ae=a_(ae.source,zi($n.exec(ae))+"g")),ae.lastIndex=0;kt=ae.exec(Lt);)var zt=kt.index;ct=ct.slice(0,zt===ee?qe:zt)}}else if(d.indexOf(Lo(ae),qe)!=qe){var en=ct.lastIndexOf(ae);en>-1&&(ct=ct.slice(0,en))}return ct+F},Ee.unescape=function(d){return(d=zi(d))&&Es.test(d)?d.replace(kl,o_):d},Ee.uniqueId=function(d){var f=++y2;return zi(d)+f},Ee.upperCase=Qw,Ee.upperFirst=ig,Ee.each=iy,Ee.eachRight=Wp,Ee.first=Kv,Iy(Ee,function(){var d={};return ll(Ee,function(f,_){Xi.call(Ee.prototype,_)||(d[_]=f)}),d}(),{chain:!1}),Ee.VERSION="4.17.21",Us(["bind","bindKey","curry","curryRight","partial","partialRight"],function(d){Ee[d].placeholder=Ee}),Us(["drop","take"],function(d,f){fi.prototype[d]=function(_){_=_===ee?1:Hr(Jn(_),0);var F=this.__filtered__&&!f?new fi(this):this.clone();return F.__filtered__?F.__takeCount__=ms(_,F.__takeCount__):F.__views__.push({size:ms(_,_e),type:d+(F.__dir__<0?"Right":"")}),F},fi.prototype[d+"Right"]=function(_){return this.reverse()[d](_).reverse()}}),Us(["filter","map","takeWhile"],function(d,f){var _=f+1,F=1==_||3==_;fi.prototype[d]=function(ae){var Te=this.clone();return Te.__iteratees__.push({iteratee:Fn(ae,3),type:_}),Te.__filtered__=Te.__filtered__||F,Te}}),Us(["head","last"],function(d,f){var _="take"+(f?"Right":"");fi.prototype[d]=function(){return this[_](1).value()[0]}}),Us(["initial","tail"],function(d,f){var _="drop"+(f?"":"Right");fi.prototype[d]=function(){return this.__filtered__?new fi(this):this[_](1)}}),fi.prototype.compact=function(){return this.filter(io)},fi.prototype.find=function(d){return this.filter(d).head()},fi.prototype.findLast=function(d){return this.reverse().find(d)},fi.prototype.invokeMap=pi(function(d,f){return"function"==typeof d?new fi(this):this.map(function(_){return Pa(_,d,f)})}),fi.prototype.reject=function(d){return this.filter(ly(Fn(d)))},fi.prototype.slice=function(d,f){d=Jn(d);var _=this;return _.__filtered__&&(d>0||f<0)?new fi(_):(d<0?_=_.takeRight(-d):d&&(_=_.drop(d)),f!==ee&&(_=(f=Jn(f))<0?_.dropRight(-f):_.take(f-d)),_)},fi.prototype.takeRightWhile=function(d){return this.reverse().takeWhile(d).reverse()},fi.prototype.toArray=function(){return this.take(_e)},ll(fi.prototype,function(d,f){var _=/^(?:filter|find|map|reject)|While$/.test(f),F=/^(?:head|last)$/.test(f),ae=Ee[F?"take"+("last"==f?"Right":""):f],Te=F||/^find/.test(f);!ae||(Ee.prototype[f]=function(){var ze=this.__wrapped__,qe=F?[1]:arguments,ct=ze instanceof fi,kt=qe[0],Lt=ct||Rn(ze),zt=function(mi){var Mi=ae.apply(Ee,zr([mi],qe));return F&&en?Mi[0]:Mi};Lt&&_&&"function"==typeof kt&&1!=kt.length&&(ct=Lt=!1);var en=this.__chain__,wn=!!this.__actions__.length,Ln=Te&&!en,gi=ct&&!wn;if(!Te&&Lt){ze=gi?ze:new fi(this);var jn=d.apply(ze,qe);return jn.__actions__.push({func:Yd,args:[zt],thisArg:ee}),new Po(jn,en)}return Ln&&gi?d.apply(this,qe):(jn=this.thru(zt),Ln?F?jn.value()[0]:jn.value():jn)})}),Us(["pop","push","shift","sort","splice","unshift"],function(d){var f=gr[d],_=/^(?:push|sort|unshift)$/.test(d)?"tap":"thru",F=/^(?:pop|shift)$/.test(d);Ee.prototype[d]=function(){var ae=arguments;if(F&&!this.__chain__){var Te=this.value();return f.apply(Rn(Te)?Te:[],ae)}return this[_](function(ze){return f.apply(Rn(ze)?ze:[],ae)})}}),ll(fi.prototype,function(d,f){var _=Ee[f];if(_){var F=_.name+"";Xi.call(Id,F)||(Id[F]=[]),Id[F].push({name:f,func:_})}}),Id[kc(ee,2).name]=[{name:"wrapper",func:ee}],fi.prototype.clone=function(){var d=new fi(this.__wrapped__);return d.__actions__=eo(this.__actions__),d.__dir__=this.__dir__,d.__filtered__=this.__filtered__,d.__iteratees__=eo(this.__iteratees__),d.__takeCount__=this.__takeCount__,d.__views__=eo(this.__views__),d},fi.prototype.reverse=function(){if(this.__filtered__){var d=new fi(this);d.__dir__=-1,d.__filtered__=!0}else(d=this.clone()).__dir__*=-1;return d},fi.prototype.value=function(){var d=this.__wrapped__.value(),f=this.__dir__,_=Rn(d),F=f<0,ae=_?d.length:0,Te=function(d,f,_){for(var F=-1,ae=_.length;++F=this.__values__.length;return{done:d,value:d?ee:this.__values__[this.__index__++]}},Ee.prototype.plant=function(d){for(var f,_=this;_ instanceof Gh;){var F=nf(_);F.__index__=0,F.__values__=ee,f?ae.__wrapped__=F:f=F;var ae=F;_=_.__wrapped__}return ae.__wrapped__=d,f},Ee.prototype.reverse=function(){var d=this.__wrapped__;if(d instanceof fi){var f=d;return this.__actions__.length&&(f=new fi(this)),(f=f.reverse()).__actions__.push({func:Yd,args:[K_],thisArg:ee}),new Po(f,this.__chain__)}return this.thru(K_)},Ee.prototype.toJSON=Ee.prototype.valueOf=Ee.prototype.value=function(){return oA(this.__wrapped__,this.__actions__)},Ee.prototype.first=Ee.prototype.head,Bh&&(Ee.prototype[Bh]=function(){return this}),Ee}();Vi._=kh,(yt=function(){return kh}.call(it,Je,it,Ut))!==ee&&(Ut.exports=yt)}.call(this)},478:function(Ut){Ut.exports=function(){"use strict";function it(rt,lt){for(var ht=0;htrt.length)&&(lt=rt.length);for(var ht=0,ge=new Array(lt);ht=rt.length?{done:!0}:{done:!1,value:rt[ge++]}}}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 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}}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:Y,changeDefaults:function(rt){dt.exports.defaults=rt}};var he=/[&<>"']/,W=/[&<>"']/g,j=/[<>"']|&(?!#?\w+;)/,P=/[<>"']|&(?!#?\w+;)/g,Q={"&":"&","<":"<",">":">",'"':""","'":"'"},z=function(lt){return Q[lt]};var x=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function O(rt){return rt.replace(x,function(lt,ht){return"colon"===(ht=ht.toLowerCase())?":":"#"===ht.charAt(0)?"x"===ht.charAt(1)?String.fromCharCode(parseInt(ht.substring(2),16)):String.fromCharCode(+ht.substring(1)):""})}var A=/(^|[^\[])\^/g;var y=/[^\w:]/g,S=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;var V={},R=/^[^:]+:\/*[^/]*$/,K=/^([^:]+:)[\s\S]*$/,ce=/^([^:]+:\/*[^/]*)[\s\S]*$/;function D(rt,lt){V[" "+rt]||(V[" "+rt]=R.test(rt)?rt+"/":$(rt,"/",!0));var ht=-1===(rt=V[" "+rt]).indexOf(":");return"//"===lt.substring(0,2)?ht?lt:rt.replace(K,"$1")+lt:"/"===lt.charAt(0)?ht?lt:rt.replace(ce,"$1")+lt:rt+lt}function $(rt,lt,ht){var ge=rt.length;if(0===ge)return"";for(var be=0;be1;)1<&&(ht+=rt),lt>>=1,rt+=rt;return ht+rt},Ce=dt.exports.defaults,me=$,ne=function(rt,lt){var ge=rt.replace(/\|/g,function(Le,ut,Ze){for(var At=!1,Mt=ut;--Mt>=0&&"\\"===Ze[Mt];)At=!At;return At?"|":" |"}).split(/ \|/),be=0;if(ge.length>lt)ge.splice(lt);else for(;ge.length1?{type:"space",raw:be[0]}:{raw:"\n"}},lt.code=function(ge){var be=this.rules.block.code.exec(ge);if(be){var Le=be[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:be[0],codeBlockStyle:"indented",text:this.options.pedantic?Le:me(Le,"\n")}}},lt.fences=function(ge){var be=this.rules.block.fences.exec(ge);if(be){var Le=be[0],ut=function(rt,lt){var ht=rt.match(/^(\s+)(?:```)/);if(null===ht)return lt;var ge=ht[1];return lt.split("\n").map(function(be){var Le=be.match(/^\s+/);return null===Le?be:Le[0].length>=ge.length?be.slice(ge.length):be}).join("\n")}(Le,be[3]||"");return{type:"code",raw:Le,lang:be[2]?be[2].trim():be[2],text:ut}}},lt.heading=function(ge){var be=this.rules.block.heading.exec(ge);if(be){var Le=be[2].trim();if(/#$/.test(Le)){var ut=me(Le,"#");(this.options.pedantic||!ut||/ $/.test(ut))&&(Le=ut.trim())}return{type:"heading",raw:be[0],depth:be[1].length,text:Le}}},lt.nptable=function(ge){var be=this.rules.block.nptable.exec(ge);if(be){var Le={type:"table",header:ne(be[1].replace(/^ *| *\| *$/g,"")),align:be[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:be[3]?be[3].replace(/\n$/,"").split("\n"):[],raw:be[0]};if(Le.header.length===Le.align.length){var Ze,ut=Le.align.length;for(Ze=0;Ze ?/gm,"");return{type:"blockquote",raw:be[0],text:Le}}},lt.list=function(ge){var be=this.rules.block.list.exec(ge);if(be){var Xt,zn,ai,Nn,bn,$n,Tn,lr,cr,Le=be[0],ut=be[2],Ze=ut.length>1,At={type:"list",raw:Le,ordered:Ze,start:Ze?+ut.slice(0,-1):"",loose:!1,items:[]},Mt=be[0].match(this.rules.block.item),Dt=!1,Xn=Mt.length;ai=this.rules.block.listItemStart.exec(Mt[0]);for(var $i=0;$iai[1].length:Nn[1].length>=ai[0].length||Nn[1].length>3){Mt.splice($i,2,Mt[$i]+(!this.options.pedantic&&Nn[1].length/i.test(ut[0])&&(be=!1),!Le&&/^<(pre|code|kbd|script)(\s|>)/i.test(ut[0])?Le=!0:Le&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(ut[0])&&(Le=!1),{type:this.options.sanitize?"text":"html",raw:ut[0],inLink:be,inRawBlock:Le,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ut[0]):_e(ut[0]):ut[0]}},lt.link=function(ge){var be=this.rules.inline.link.exec(ge);if(be){var Le=be[2].trim();if(!this.options.pedantic&&/^$/.test(Le))return;var ut=me(Le.slice(0,-1),"\\");if((Le.length-ut.length)%2==0)return}else{var Ze=Ie(be[2],"()");if(Ze>-1){var Mt=(0===be[0].indexOf("!")?5:4)+be[1].length+Ze;be[2]=be[2].substring(0,Ze),be[0]=be[0].substring(0,Mt).trim(),be[3]=""}}var Dt=be[2],Xt="";if(this.options.pedantic){var zn=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Dt);zn&&(Dt=zn[1],Xt=zn[3])}else Xt=be[3]?be[3].slice(1,-1):"";return Dt=Dt.trim(),/^$/.test(Le)?Dt.slice(1):Dt.slice(1,-1)),Ge(be,{href:Dt&&Dt.replace(this.rules.inline._escapes,"$1"),title:Xt&&Xt.replace(this.rules.inline._escapes,"$1")},be[0])}},lt.reflink=function(ge,be){var Le;if((Le=this.rules.inline.reflink.exec(ge))||(Le=this.rules.inline.nolink.exec(ge))){var ut=(Le[2]||Le[1]).replace(/\s+/g," ");if(!(ut=be[ut.toLowerCase()])||!ut.href){var Ze=Le[0].charAt(0);return{type:"text",raw:Ze,text:Ze}}return Ge(Le,ut,Le[0])}},lt.emStrong=function(ge,be,Le){void 0===Le&&(Le="");var ut=this.rules.inline.emStrong.lDelim.exec(ge);if(ut&&(!ut[3]||!Le.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 Ze=ut[1]||ut[2]||"";if(!Ze||Ze&&(""===Le||this.rules.inline.punctuation.exec(Le))){var Mt,Dt,At=ut[0].length-1,Xt=At,zn=0,ai="*"===ut[0][0]?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(ai.lastIndex=0,be=be.slice(-1*ge.length+At);null!=(ut=ai.exec(be));)if(Mt=ut[1]||ut[2]||ut[3]||ut[4]||ut[5]||ut[6]){if(Dt=Mt.length,ut[3]||ut[4]){Xt+=Dt;continue}if((ut[5]||ut[6])&&At%3&&!((At+Dt)%3)){zn+=Dt;continue}if(!((Xt-=Dt)>0))return Dt=Math.min(Dt,Dt+Xt+zn),Math.min(At,Dt)%2?{type:"em",raw:ge.slice(0,At+ut.index+Dt+1),text:ge.slice(1,At+ut.index+Dt)}:{type:"strong",raw:ge.slice(0,At+ut.index+Dt+1),text:ge.slice(2,At+ut.index+Dt-1)}}}}},lt.codespan=function(ge){var be=this.rules.inline.code.exec(ge);if(be){var Le=be[2].replace(/\n/g," "),ut=/[^ ]/.test(Le),Ze=/^ /.test(Le)&&/ $/.test(Le);return ut&&Ze&&(Le=Le.substring(1,Le.length-1)),Le=_e(Le,!0),{type:"codespan",raw:be[0],text:Le}}},lt.br=function(ge){var be=this.rules.inline.br.exec(ge);if(be)return{type:"br",raw:be[0]}},lt.del=function(ge){var be=this.rules.inline.del.exec(ge);if(be)return{type:"del",raw:be[0],text:be[2]}},lt.autolink=function(ge,be){var ut,Ze,Le=this.rules.inline.autolink.exec(ge);if(Le)return Ze="@"===Le[2]?"mailto:"+(ut=_e(this.options.mangle?be(Le[1]):Le[1])):ut=_e(Le[1]),{type:"link",raw:Le[0],text:ut,href:Ze,tokens:[{type:"text",raw:ut,text:ut}]}},lt.url=function(ge,be){var Le;if(Le=this.rules.inline.url.exec(ge)){var ut,Ze;if("@"===Le[2])Ze="mailto:"+(ut=_e(this.options.mangle?be(Le[0]):Le[0]));else{var At;do{At=Le[0],Le[0]=this.rules.inline._backpedal.exec(Le[0])[0]}while(At!==Le[0]);ut=_e(Le[0]),Ze="www."===Le[1]?"http://"+ut:ut}return{type:"link",raw:Le[0],text:ut,href:Ze,tokens:[{type:"text",raw:ut,text:ut}]}}},lt.inlineText=function(ge,be,Le){var Ze,ut=this.rules.inline.text.exec(ge);if(ut)return Ze=be?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ut[0]):_e(ut[0]):ut[0]:_e(this.options.smartypants?Le(ut[0]):ut[0]),{type:"text",raw:ut[0],text:Ze}},rt}(),tt=te_noopTest,Ye=te_edit,Ue=te_merge,ke={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:tt,table:tt,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?'|\([^()]*\))/};ke.def=Ye(ke.def).replace("label",ke._label).replace("title",ke._title).getRegex(),ke.bullet=/(?:[*+-]|\d{1,9}[.)])/,ke.item=/^( *)(bull) ?[^\n]*(?:\n(?! *bull ?)[^\n]*)*/,ke.item=Ye(ke.item,"gm").replace(/bull/g,ke.bullet).getRegex(),ke.listItemStart=Ye(/^( *)(bull) */).replace("bull",ke.bullet).getRegex(),ke.list=Ye(ke.list).replace(/bull/g,ke.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+ke.def.source+")").getRegex(),ke._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",ke._comment=/|$)/,ke.html=Ye(ke.html,"i").replace("comment",ke._comment).replace("tag",ke._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ke.paragraph=Ye(ke._paragraph).replace("hr",ke.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",ke._tag).getRegex(),ke.blockquote=Ye(ke.blockquote).replace("paragraph",ke.paragraph).getRegex(),ke.normal=Ue({},ke),ke.gfm=Ue({},ke.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*|$)"}),ke.gfm.nptable=Ye(ke.gfm.nptable).replace("hr",ke.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",ke._tag).getRegex(),ke.gfm.table=Ye(ke.gfm.table).replace("hr",ke.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",ke._tag).getRegex(),ke.pedantic=Ue({},ke.normal,{html:Ye("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",ke._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:tt,paragraph:Ye(ke.normal._paragraph).replace("hr",ke.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",ke.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var Ke={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:tt,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:tt,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~"};Ke.punctuation=Ye(Ke.punctuation).replace(/punctuation/g,Ke._punctuation).getRegex(),Ke.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,Ke.escapedEmSt=/\\\*|\\_/g,Ke._comment=Ye(ke._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),Ke.emStrong.lDelim=Ye(Ke.emStrong.lDelim).replace(/punct/g,Ke._punctuation).getRegex(),Ke.emStrong.rDelimAst=Ye(Ke.emStrong.rDelimAst,"g").replace(/punct/g,Ke._punctuation).getRegex(),Ke.emStrong.rDelimUnd=Ye(Ke.emStrong.rDelimUnd,"g").replace(/punct/g,Ke._punctuation).getRegex(),Ke._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,Ke._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,Ke._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])?)+(?![-_])/,Ke.autolink=Ye(Ke.autolink).replace("scheme",Ke._scheme).replace("email",Ke._email).getRegex(),Ke._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,Ke.tag=Ye(Ke.tag).replace("comment",Ke._comment).replace("attribute",Ke._attribute).getRegex(),Ke._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Ke._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,Ke._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,Ke.link=Ye(Ke.link).replace("label",Ke._label).replace("href",Ke._href).replace("title",Ke._title).getRegex(),Ke.reflink=Ye(Ke.reflink).replace("label",Ke._label).getRegex(),Ke.reflinkSearch=Ye(Ke.reflinkSearch,"g").replace("reflink",Ke.reflink).replace("nolink",Ke.nolink).getRegex(),Ke.normal=Ue({},Ke),Ke.pedantic=Ue({},Ke.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",Ke._label).getRegex(),reflink:Ye(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Ke._label).getRegex()}),Ke.gfm=Ue({},Ke.normal,{escape:Ye(Ke.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&&(ge="x"+ge.toString(16)),lt+="&#"+ge+";";return lt}var je=function(){function rt(ht){this.tokens=[],this.tokens.links=Object.create(null),this.options=ht||$e,this.options.tokenizer=this.options.tokenizer||new Ve,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var ge={block:Ne.normal,inline:q.normal};this.options.pedantic?(ge.block=Ne.pedantic,ge.inline=q.pedantic):this.options.gfm&&(ge.block=Ne.gfm,ge.inline=this.options.breaks?q.breaks:q.gfm),this.tokenizer.rules=ge}rt.lex=function(ge,be){return new rt(be).lex(ge)},rt.lexInline=function(ge,be){return new rt(be).inlineTokens(ge)};var lt=rt.prototype;return lt.lex=function(ge){return ge=ge.replace(/\r\n|\r/g,"\n").replace(/\t/g," "),this.blockTokens(ge,this.tokens,!0),this.inline(this.tokens),this.tokens},lt.blockTokens=function(ge,be,Le){var Ze,At,Mt,Dt,Xt,zn,ut=this;for(void 0===be&&(be=[]),void 0===Le&&(Le=!0),this.options.pedantic&&(ge=ge.replace(/^ +$/gm,""));ge;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(function(Nn){return!!(Ze=Nn.call(ut,ge,be))&&(ge=ge.substring(Ze.raw.length),be.push(Ze),!0)}))){if(Ze=this.tokenizer.space(ge)){ge=ge.substring(Ze.raw.length),Ze.type&&be.push(Ze);continue}if(Ze=this.tokenizer.code(ge)){ge=ge.substring(Ze.raw.length),(Dt=be[be.length-1])&&"paragraph"===Dt.type?(Dt.raw+="\n"+Ze.raw,Dt.text+="\n"+Ze.text):be.push(Ze);continue}if(Ze=this.tokenizer.fences(ge)){ge=ge.substring(Ze.raw.length),be.push(Ze);continue}if(Ze=this.tokenizer.heading(ge)){ge=ge.substring(Ze.raw.length),be.push(Ze);continue}if(Ze=this.tokenizer.nptable(ge)){ge=ge.substring(Ze.raw.length),be.push(Ze);continue}if(Ze=this.tokenizer.hr(ge)){ge=ge.substring(Ze.raw.length),be.push(Ze);continue}if(Ze=this.tokenizer.blockquote(ge)){ge=ge.substring(Ze.raw.length),Ze.tokens=this.blockTokens(Ze.text,[],Le),be.push(Ze);continue}if(Ze=this.tokenizer.list(ge)){for(ge=ge.substring(Ze.raw.length),Mt=Ze.items.length,At=0;At=0&&(Nn=Math.min(Nn,$n))}),Nn<1/0&&Nn>=0&&(Xt=ge.substring(0,Nn+1))}(),Le&&(Ze=this.tokenizer.paragraph(Xt))){Dt=be[be.length-1],zn&&"paragraph"===Dt.type?(Dt.raw+="\n"+Ze.raw,Dt.text+="\n"+Ze.text):be.push(Ze),zn=Xt.length!==ge.length,ge=ge.substring(Ze.raw.length);continue}if(Ze=this.tokenizer.text(ge)){ge=ge.substring(Ze.raw.length),(Dt=be[be.length-1])&&"text"===Dt.type?(Dt.raw+="\n"+Ze.raw,Dt.text+="\n"+Ze.text):be.push(Ze);continue}if(ge){var ai="Infinite loop on byte: "+ge.charCodeAt(0);if(this.options.silent){console.error(ai);break}throw new Error(ai)}}return be},lt.inline=function(ge){var be,Le,ut,Ze,At,Mt,Dt=ge.length;for(be=0;be0)for(;null!=(zn=this.tokenizer.rules.inline.reflinkSearch.exec(Xt));)bn.includes(zn[0].slice(zn[0].lastIndexOf("[")+1,-1))&&(Xt=Xt.slice(0,zn.index)+"["+G("a",zn[0].length-2)+"]"+Xt.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(zn=this.tokenizer.rules.inline.blockSkip.exec(Xt));)Xt=Xt.slice(0,zn.index)+"["+G("a",zn[0].length-2)+"]"+Xt.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(zn=this.tokenizer.rules.inline.escapedEmSt.exec(Xt));)Xt=Xt.slice(0,zn.index)+"++"+Xt.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;ge;)if(ai||(Nn=""),ai=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(function(Tn){return!!(At=Tn.call(Ze,ge,be))&&(ge=ge.substring(At.raw.length),be.push(At),!0)}))){if(At=this.tokenizer.escape(ge)){ge=ge.substring(At.raw.length),be.push(At);continue}if(At=this.tokenizer.tag(ge,Le,ut)){ge=ge.substring(At.raw.length),Le=At.inLink,ut=At.inRawBlock,(Mt=be[be.length-1])&&"text"===At.type&&"text"===Mt.type?(Mt.raw+=At.raw,Mt.text+=At.text):be.push(At);continue}if(At=this.tokenizer.link(ge)){ge=ge.substring(At.raw.length),"link"===At.type&&(At.tokens=this.inlineTokens(At.text,[],!0,ut)),be.push(At);continue}if(At=this.tokenizer.reflink(ge,this.tokens.links)){ge=ge.substring(At.raw.length),Mt=be[be.length-1],"link"===At.type?(At.tokens=this.inlineTokens(At.text,[],!0,ut),be.push(At)):Mt&&"text"===At.type&&"text"===Mt.type?(Mt.raw+=At.raw,Mt.text+=At.text):be.push(At);continue}if(At=this.tokenizer.emStrong(ge,Xt,Nn)){ge=ge.substring(At.raw.length),At.tokens=this.inlineTokens(At.text,[],Le,ut),be.push(At);continue}if(At=this.tokenizer.codespan(ge)){ge=ge.substring(At.raw.length),be.push(At);continue}if(At=this.tokenizer.br(ge)){ge=ge.substring(At.raw.length),be.push(At);continue}if(At=this.tokenizer.del(ge)){ge=ge.substring(At.raw.length),At.tokens=this.inlineTokens(At.text,[],Le,ut),be.push(At);continue}if(At=this.tokenizer.autolink(ge,ue)){ge=ge.substring(At.raw.length),be.push(At);continue}if(!Le&&(At=this.tokenizer.url(ge,ue))){ge=ge.substring(At.raw.length),be.push(At);continue}if(Dt=ge,this.options.extensions&&this.options.extensions.startInline&&function(){var Tn=1/0,lr=ge.slice(1),cr=void 0;Ze.options.extensions.startInline.forEach(function(Xn){"number"==typeof(cr=Xn.call(this,lr))&&cr>=0&&(Tn=Math.min(Tn,cr))}),Tn<1/0&&Tn>=0&&(Dt=ge.substring(0,Tn+1))}(),At=this.tokenizer.inlineText(Dt,ut,pe)){ge=ge.substring(At.raw.length),"_"!==At.raw.slice(-1)&&(Nn=At.raw.slice(-1)),ai=!0,(Mt=be[be.length-1])&&"text"===Mt.type?(Mt.raw+=At.raw,Mt.text+=At.text):be.push(At);continue}if(ge){var $n="Infinite loop on byte: "+ge.charCodeAt(0);if(this.options.silent){console.error($n);break}throw new Error($n)}}return be},function(rt,lt,ht){lt&&it(rt.prototype,lt),ht&&it(rt,ht)}(rt,null,[{key:"rules",get:function(){return{block:Ne,inline:q}}}]),rt}(),_t=dt.exports.defaults,pt=te_cleanUrl,ve=te_escape,L=function(){function rt(ht){this.options=ht||_t}var lt=rt.prototype;return lt.code=function(ge,be,Le){var ut=(be||"").match(/\S*/)[0];if(this.options.highlight){var Ze=this.options.highlight(ge,ut);null!=Ze&&Ze!==ge&&(Le=!0,ge=Ze)}return ge=ge.replace(/\n$/,"")+"\n",ut?'
    '+(Le?ge:ve(ge,!0))+"
    \n":"
    "+(Le?ge:ve(ge,!0))+"
    \n"},lt.blockquote=function(ge){return"
    \n"+ge+"
    \n"},lt.html=function(ge){return ge},lt.heading=function(ge,be,Le,ut){return this.options.headerIds?"'+ge+"\n":""+ge+"\n"},lt.hr=function(){return this.options.xhtml?"
    \n":"
    \n"},lt.list=function(ge,be,Le){var ut=be?"ol":"ul";return"<"+ut+(be&&1!==Le?' start="'+Le+'"':"")+">\n"+ge+"\n"},lt.listitem=function(ge){return"
  • "+ge+"
  • \n"},lt.checkbox=function(ge){return" "},lt.paragraph=function(ge){return"

    "+ge+"

    \n"},lt.table=function(ge,be){return be&&(be=""+be+""),"\n\n"+ge+"\n"+be+"
    \n"},lt.tablerow=function(ge){return"\n"+ge+"\n"},lt.tablecell=function(ge,be){var Le=be.header?"th":"td";return(be.align?"<"+Le+' align="'+be.align+'">':"<"+Le+">")+ge+"\n"},lt.strong=function(ge){return""+ge+""},lt.em=function(ge){return""+ge+""},lt.codespan=function(ge){return""+ge+""},lt.br=function(){return this.options.xhtml?"
    ":"
    "},lt.del=function(ge){return""+ge+""},lt.link=function(ge,be,Le){if(null===(ge=pt(this.options.sanitize,this.options.baseUrl,ge)))return Le;var ut='"+Le+""},lt.image=function(ge,be,Le){if(null===(ge=pt(this.options.sanitize,this.options.baseUrl,ge)))return Le;var ut=''+Le+'":">")},lt.text=function(ge){return ge},rt}(),N=function(){function rt(){}var lt=rt.prototype;return lt.strong=function(ge){return ge},lt.em=function(ge){return ge},lt.codespan=function(ge){return ge},lt.del=function(ge){return ge},lt.html=function(ge){return ge},lt.text=function(ge){return ge},lt.link=function(ge,be,Le){return""+Le},lt.image=function(ge,be,Le){return""+Le},lt.br=function(){return""},rt}(),B=function(){function rt(){this.seen={}}var lt=rt.prototype;return lt.serialize=function(ge){return ge.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")},lt.getNextSafeSlug=function(ge,be){var Le=ge,ut=0;if(this.seen.hasOwnProperty(Le)){ut=this.seen[ge];do{Le=ge+"-"+ ++ut}while(this.seen.hasOwnProperty(Le))}return be||(this.seen[ge]=ut,this.seen[Le]=0),Le},lt.slug=function(ge,be){void 0===be&&(be={});var Le=this.serialize(ge);return this.getNextSafeSlug(Le,be.dryrun)},rt}(),Re=L,Qe=N,St=B,Nt=dt.exports.defaults,On=te_unescape,Yn=je,Ti=function(){function rt(ht){this.options=ht||Nt,this.options.renderer=this.options.renderer||new Re,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Qe,this.slugger=new St}rt.parse=function(ge,be){return new rt(be).parse(ge)},rt.parseInline=function(ge,be){return new rt(be).parseInline(ge)};var lt=rt.prototype;return lt.parse=function(ge,be){void 0===be&&(be=!0);var ut,Ze,At,Mt,Dt,Xt,zn,ai,Nn,bn,$n,Tn,lr,cr,Xn,$i,xa,Zr,ie,Le="",fe=ge.length;for(ut=0;ut0&&"text"===Xn.tokens[0].type?(Xn.tokens[0].text=Zr+" "+Xn.tokens[0].text,Xn.tokens[0].tokens&&Xn.tokens[0].tokens.length>0&&"text"===Xn.tokens[0].tokens[0].type&&(Xn.tokens[0].tokens[0].text=Zr+" "+Xn.tokens[0].tokens[0].text)):Xn.tokens.unshift({type:"text",text:Zr}):cr+=Zr),cr+=this.parse(Xn.tokens,lr),Nn+=this.renderer.listitem(cr,xa,$i);Le+=this.renderer.list(Nn,$n,Tn);continue;case"html":Le+=this.renderer.html(bn.text);continue;case"paragraph":Le+=this.renderer.paragraph(this.parseInline(bn.tokens));continue;case"text":for(Nn=bn.tokens?this.parseInline(bn.tokens):bn.text;ut+1An error occurred:

    "+el(At.message+"",!0)+"
    ";throw At}}return Jt.options=Jt.setOptions=function(rt){return Bs(Jt.defaults,rt),Sa(Jt.defaults),Jt},Jt.getDefaults=kl,Jt.defaults=Es,Jt.use=function(){for(var rt=this,lt=arguments.length,ht=new Array(lt),ge=0;geAn error occurred:

    "+el(ge.message+"",!0)+"
    ";throw ge}},Jt.Parser=Ti,Jt.parser=Ti.parse,Jt.Renderer=Xr,Jt.TextRenderer=Ls,Jt.Lexer=Yn,Jt.lexer=Yn.lex,Jt.Tokenizer=wi,Jt.Slugger=gs,Jt.parse=Jt,Jt}()},369:(Ut,it,Je)=>{var yt=Je(284),ee=Je(830);function Tt(){this.clear()}Tt.prototype.clear=function(){this.items=[],this.offset=0,this.size=0},Tt.prototype.enqueue=function(dt){return this.items.push(dt),++this.size},Tt.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}},Tt.prototype.peek=function(){if(this.size)return this.items[this.offset]},Tt.prototype.forEach=function(dt,Y){Y=arguments.length>1?Y:this;for(var Se=this.offset,he=0,W=this.items.length;Se=dt.length)return{done:!0};var Se=dt[Y];return Y++,{value:Se,done:!1}})},Tt.prototype.entries=function(){var dt=this.items,Y=this.offset,Se=0;return new yt(function(){if(Y>=dt.length)return{done:!0};var he=dt[Y];return Y++,{value:[Se++,he],done:!1}})},"undefined"!=typeof Symbol&&(Tt.prototype[Symbol.iterator]=Tt.prototype.values),Tt.prototype.toString=function(){return this.toArray().join(",")},Tt.prototype.toJSON=function(){return this.toArray()},Tt.prototype.inspect=function(){var dt=this.toArray();return Object.defineProperty(dt,"constructor",{value:Tt,enumerable:!1}),dt},"undefined"!=typeof Symbol&&(Tt.prototype[Symbol.for("nodejs.util.inspect.custom")]=Tt.prototype.inspect),Tt.from=function(dt){var Y=new Tt;return ee(dt,function(Se){Y.enqueue(Se)}),Y},Tt.of=function(){return Tt.from(arguments)},Ut.exports=Tt},830:Ut=>{var it="undefined"!=typeof ArrayBuffer,Je="undefined"!=typeof Symbol;function yt(ee,Tt){var dt,Y,Se,he,W;if(!ee)throw new Error("obliterator/forEach: invalid iterable.");if("function"!=typeof Tt)throw new Error("obliterator/forEach: expecting a callback.");if(Array.isArray(ee)||it&&ArrayBuffer.isView(ee)||"string"==typeof ee||"[object Arguments]"===ee.toString())for(Se=0,he=ee.length;Se{function it(Je){Object.defineProperty(this,"_next",{writable:!1,enumerable:!1,value:Je}),this.done=!1}it.prototype.next=function(){if(this.done)return{done:!0};var Je=this._next();return Je.done&&(this.done=!0),Je},"undefined"!=typeof Symbol&&(it.prototype[Symbol.iterator]=function(){return this}),it.of=function(){var Je=arguments,yt=Je.length,ee=0;return new it(function(){return ee>=yt?{done:!0}:{done:!1,value:Je[ee++]}})},it.empty=function(){var Je=new it(null);return Je.done=!0,Je},it.is=function(Je){return Je instanceof it||"object"==typeof Je&&null!==Je&&"function"==typeof Je.next},Ut.exports=it},310:(Ut,it,Je)=>{"use strict";var yt=Je(948);Object.defineProperty(it,"__esModule",{value:!0}),it.isMobile=function(){return void 0!==ee.window.orientation},it.default=function(he){if(!he&&!(0,Tt.default)())return"Node";if((0,dt.default)(he))return"Electron";var W="undefined"!=typeof navigator?navigator:{},j=he||W.userAgent||"";if(j.indexOf("Edge")>-1)return"Edge";var P=-1!==j.indexOf("MSIE "),Q=-1!==j.indexOf("Trident/");return P||Q?"IE":ee.window.chrome?"Chrome":ee.window.safari?"Safari":ee.window.mozInnerScreenX?"Firefox":"Unknown"};var ee=Je(151),Tt=yt(Je(602)),dt=yt(Je(344))},151:(Ut,it,Je)=>{"use strict";var yt=Je(948);Object.defineProperty(it,"__esModule",{value:!0}),it.console=it.process=it.document=it.global=it.window=it.self=void 0;var ee=yt(Je(321)),Tt={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,ee.default)(process))&&process};it.self=Tt.self||Tt.window||Tt.global,it.window=Tt.window||Tt.self||Tt.global,it.global=Tt.global||Tt.self||Tt.window,it.document=Tt.document||{},it.process=Tt.process||{};var j=console;it.console=j},761:(Ut,it,Je)=>{"use strict";var ee=Je(948),Tt=Je(321);Object.defineProperty(it,"CO",{enumerable:!0,get:function(){return dt.global}}),Object.defineProperty(it,"qs",{enumerable:!0,get:function(){return Se.default}});var dt=Je(151),Se=(j(Je(602)),j(Je(310)));ee(Je(344));function W(P){if("function"!=typeof WeakMap)return null;var Q=new WeakMap,z=new WeakMap;return(W=function(x){return x?z:Q})(P)}function j(P,Q){if(!Q&&P&&P.__esModule)return P;if(null===P||"object"!==Tt(P)&&"function"!=typeof P)return{default:P};var z=W(Q);if(z&&z.has(P))return z.get(P);var v={},x=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var O in P)if("default"!==O&&Object.prototype.hasOwnProperty.call(P,O)){var A=x?Object.getOwnPropertyDescriptor(P,O):null;A&&(A.get||A.set)?Object.defineProperty(v,O,A):v[O]=P[O]}return v.default=P,z&&z.set(P,v),v}},602:(Ut,it,Je)=>{"use strict";var yt=Je(948);Object.defineProperty(it,"__esModule",{value:!0}),it.default=dt,it.isBrowserMainThread=function(){return dt()&&"undefined"!=typeof document};var ee=yt(Je(321)),Tt=yt(Je(344));function dt(){return!("object"===("undefined"==typeof process?"undefined":(0,ee.default)(process))&&"[object process]"===String(process)&&!process.browser)||(0,Tt.default)()}},344:(Ut,it,Je)=>{"use strict";var yt=Je(948);Object.defineProperty(it,"__esModule",{value:!0}),it.default=function(dt){if("undefined"!=typeof window&&"object"===(0,ee.default)(window.process)&&"renderer"===window.process.type||"undefined"!=typeof process&&"object"===(0,ee.default)(process.versions)&&Boolean(process.versions.electron))return!0;var Y="object"===("undefined"==typeof navigator?"undefined":(0,ee.default)(navigator))&&"string"==typeof navigator.userAgent&&navigator.userAgent,Se=dt||Y;return!!(Se&&Se.indexOf("Electron")>=0)};var ee=yt(Je(321))},991:function(Ut,it,Je){"use strict";var yt=this&&this.__createBinding||(Object.create?function(Tt,dt,Y,Se){void 0===Se&&(Se=Y),Object.defineProperty(Tt,Se,{enumerable:!0,get:function(){return dt[Y]}})}:function(Tt,dt,Y,Se){void 0===Se&&(Se=Y),Tt[Se]=dt[Y]}),ee=this&&this.__exportStar||function(Tt,dt){for(var Y in Tt)"default"!==Y&&!Object.prototype.hasOwnProperty.call(dt,Y)&&yt(dt,Tt,Y)};Object.defineProperty(it,"__esModule",{value:!0}),ee(Je(180),it),ee(Je(103),it),ee(Je(965),it),ee(Je(595),it),ee(Je(417),it),ee(Je(451),it),ee(Je(735),it)},180:(Ut,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.BlankNode=void 0,it.BlankNode=class{constructor(ee){this.termType="BlankNode",this.value=ee}equals(ee){return!!ee&&"BlankNode"===ee.termType&&ee.value===this.value}}},103:(Ut,it,Je)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.DataFactory=void 0;const yt=Je(180),ee=Je(965),Tt=Je(595),dt=Je(417),Y=Je(451),Se=Je(735);let he=0;it.DataFactory=class{constructor(P){this.blankNodeCounter=0,this.blankNodePrefix=(P=P||{}).blankNodePrefix||`df_${he++}_`}namedNode(P){return new dt.NamedNode(P)}blankNode(P){return new yt.BlankNode(P||`${this.blankNodePrefix}${this.blankNodeCounter++}`)}literal(P,Q){return new Tt.Literal(P,Q)}variable(P){return new Se.Variable(P)}defaultGraph(){return ee.DefaultGraph.INSTANCE}quad(P,Q,z,v){return new Y.Quad(P,Q,z,v||this.defaultGraph())}fromTerm(P){switch(P.termType){case"NamedNode":return this.namedNode(P.value);case"BlankNode":return this.blankNode(P.value);case"Literal":return P.language?this.literal(P.value,P.language):P.datatype.equals(Tt.Literal.XSD_STRING)?this.literal(P.value):this.literal(P.value,this.fromTerm(P.datatype));case"Variable":return this.variable(P.value);case"DefaultGraph":return this.defaultGraph();case"Quad":return this.quad(this.fromTerm(P.subject),this.fromTerm(P.predicate),this.fromTerm(P.object),this.fromTerm(P.graph))}}fromQuad(P){return this.fromTerm(P)}resetBlankNodeCounter(){this.blankNodeCounter=0}}},965:(Ut,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.DefaultGraph=void 0;class Je{constructor(){this.termType="DefaultGraph",this.value=""}equals(ee){return!!ee&&"DefaultGraph"===ee.termType}}it.DefaultGraph=Je,Je.INSTANCE=new Je},595:(Ut,it,Je)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.Literal=void 0;const yt=Je(417);class ee{constructor(dt,Y){this.termType="Literal",this.value=dt,"string"==typeof Y?(this.language=Y,this.datatype=ee.RDF_LANGUAGE_STRING):Y?(this.language="",this.datatype=Y):(this.language="",this.datatype=ee.XSD_STRING)}equals(dt){return!!dt&&"Literal"===dt.termType&&dt.value===this.value&&dt.language===this.language&&dt.datatype.equals(this.datatype)}}it.Literal=ee,ee.RDF_LANGUAGE_STRING=new yt.NamedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),ee.XSD_STRING=new yt.NamedNode("http://www.w3.org/2001/XMLSchema#string")},417:(Ut,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.NamedNode=void 0,it.NamedNode=class{constructor(ee){this.termType="NamedNode",this.value=ee}equals(ee){return!!ee&&"NamedNode"===ee.termType&&ee.value===this.value}}},451:(Ut,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.Quad=void 0,it.Quad=class{constructor(ee,Tt,dt,Y){this.termType="Quad",this.value="",this.subject=ee,this.predicate=Tt,this.object=dt,this.graph=Y}equals(ee){return!!ee&&("Quad"===ee.termType||!ee.termType)&&this.subject.equals(ee.subject)&&this.predicate.equals(ee.predicate)&&this.object.equals(ee.object)&&this.graph.equals(ee.graph)}}},735:(Ut,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.Variable=void 0,it.Variable=class{constructor(ee){this.termType="Variable",this.value=ee}equals(ee){return!!ee&&"Variable"===ee.termType&&ee.value===this.value}}},609:function(Ut,it,Je){"use strict";var yt=this&&this.__createBinding||(Object.create?function(v,x,O,A){void 0===A&&(A=O),Object.defineProperty(v,A,{enumerable:!0,get:function(){return x[O]}})}:function(v,x,O,A){void 0===A&&(A=O),v[A]=x[O]}),ee=this&&this.__exportStar||function(v,x){for(var O in v)"default"!==O&&!Object.prototype.hasOwnProperty.call(x,O)&&yt(x,v,O)};Object.defineProperty(it,"__esModule",{value:!0}),it.getSupportedJavaScriptPrimitives=it.getSupportedRdfDatatypes=it.getTermRaw=it.toRdf=it.fromRdf=void 0;const Tt=Je(991),dt=Je(938),Y=Je(60);ee(Je(938),it),ee(Je(871),it),ee(Je(60),it);const Se=new Tt.DataFactory,he=new Y.Translator;function W(v,x){return he.fromRdf(v,x)}he.registerHandler(new dt.TypeHandlerString,dt.TypeHandlerString.TYPES.map(v=>Se.namedNode(v)),["string"]),he.registerHandler(new dt.TypeHandlerBoolean,[dt.TypeHandlerBoolean.TYPE].map(v=>Se.namedNode(v)),["boolean"]),he.registerHandler(new dt.TypeHandlerNumberDouble,dt.TypeHandlerNumberDouble.TYPES.map(v=>Se.namedNode(v)),["number"]),he.registerHandler(new dt.TypeHandlerNumberInteger,dt.TypeHandlerNumberInteger.TYPES.map(v=>Se.namedNode(v)),["number"]),he.registerHandler(new dt.TypeHandlerDate,dt.TypeHandlerDate.TYPES.map(v=>Se.namedNode(v)),["object"]),it.fromRdf=W,it.toRdf=function(v,x){return x&&"namedNode"in x&&(x={dataFactory:x}),(x=x||{})&&!x.dataFactory&&(x.dataFactory=Se),he.toRdf(v,x)},it.getTermRaw=function(v,x){return"Literal"===v.termType?W(v,x):v.value},it.getSupportedRdfDatatypes=function(){return he.getSupportedRdfDatatypes()},it.getSupportedJavaScriptPrimitives=function(){return he.getSupportedJavaScriptPrimitives()}},871:(Ut,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0})},60:(Ut,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(ee){throw new Error(`Invalid RDF ${ee.datatype.value} value: '${ee.value}'`)}registerHandler(ee,Tt,dt){for(const Y of Tt)this.supportedRdfDatatypes.push(Y),this.fromRdfHandlers[Y.value]=ee;for(const Y of dt){let Se=this.toRdfHandlers[Y];Se||(this.toRdfHandlers[Y]=Se=[]),Se.push(ee)}}fromRdf(ee,Tt){const dt=this.fromRdfHandlers[ee.datatype.value];return dt?dt.fromRdf(ee,Tt):ee.value}toRdf(ee,Tt){const dt=this.toRdfHandlers[typeof ee];if(dt)for(const Y of dt){const Se=Y.toRdf(ee,Tt);if(Se)return Se}throw new Error(`Invalid JavaScript value: '${ee}'`)}getSupportedRdfDatatypes(){return this.supportedRdfDatatypes}getSupportedJavaScriptPrimitives(){return Object.keys(this.toRdfHandlers)}}},727:(Ut,it,Je)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.TypeHandlerBoolean=void 0;const yt=Je(60);class ee{fromRdf(dt,Y){switch(dt.value){case"true":return!0;case"false":return!1;case"1":return!0;case"0":return!1}return Y&&yt.Translator.incorrectRdfDataType(dt),!1}toRdf(dt,{datatype:Y,dataFactory:Se}){return Se.literal(dt?"true":"false",Y||Se.namedNode(ee.TYPE))}}it.TypeHandlerBoolean=ee,ee.TYPE="http://www.w3.org/2001/XMLSchema#boolean"},525:(Ut,it,Je)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.TypeHandlerDate=void 0;const yt=Je(60);class ee{fromRdf(dt,Y){switch(Y&&!dt.value.match(ee.VALIDATORS[dt.datatype.value.substr(33,dt.datatype.value.length)])&&yt.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 Se=dt.value.split("-");return new Date(0,parseInt(Se[0],10)-1,parseInt(Se[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:Y,dataFactory:Se}){if(Y=Y||Se.namedNode(ee.TYPES[0]),!(dt instanceof Date))return null;const he=dt;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 Se.literal(W,Y)}}it.TypeHandlerDate=ee,ee.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"],ee.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:(Ut,it,Je)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.TypeHandlerNumberDouble=void 0;const yt=Je(60);class ee{fromRdf(dt,Y){const Se=parseFloat(dt.value);return Y&&isNaN(Se)&&yt.Translator.incorrectRdfDataType(dt),Se}toRdf(dt,{datatype:Y,dataFactory:Se}){return Y=Y||Se.namedNode(ee.TYPES[0]),isNaN(dt)?Se.literal("NaN",Y):isFinite(dt)?dt%1==0?null:Se.literal(dt.toExponential(15).replace(/(\d)0*e\+?/,"$1E"),Y):Se.literal(dt>0?"INF":"-INF",Y)}}it.TypeHandlerNumberDouble=ee,ee.TYPES=["http://www.w3.org/2001/XMLSchema#double","http://www.w3.org/2001/XMLSchema#decimal","http://www.w3.org/2001/XMLSchema#float"]},750:(Ut,it,Je)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.TypeHandlerNumberInteger=void 0;const yt=Je(60);class ee{fromRdf(dt,Y){const Se=parseInt(dt.value,10);return Y&&(isNaN(Se)||dt.value.indexOf(".")>=0)&&yt.Translator.incorrectRdfDataType(dt),Se}toRdf(dt,{datatype:Y,dataFactory:Se}){return Se.literal(String(dt),Y||Se.namedNode(dt<=ee.MAX_INT&&dt>=ee.MIN_INT?ee.TYPES[0]:ee.TYPES[1]))}}it.TypeHandlerNumberInteger=ee,ee.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"],ee.MAX_INT=2147483647,ee.MIN_INT=-2147483648},608:(Ut,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.TypeHandlerString=void 0;class Je{fromRdf(ee){return ee.value}toRdf(ee,{datatype:Tt,dataFactory:dt}){return dt.literal(ee,Tt)}}it.TypeHandlerString=Je,Je.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(Ut,it,Je){"use strict";var yt=this&&this.__createBinding||(Object.create?function(Tt,dt,Y,Se){void 0===Se&&(Se=Y),Object.defineProperty(Tt,Se,{enumerable:!0,get:function(){return dt[Y]}})}:function(Tt,dt,Y,Se){void 0===Se&&(Se=Y),Tt[Se]=dt[Y]}),ee=this&&this.__exportStar||function(Tt,dt){for(var Y in Tt)"default"!==Y&&!Object.prototype.hasOwnProperty.call(dt,Y)&&yt(dt,Tt,Y)};Object.defineProperty(it,"__esModule",{value:!0}),ee(Je(727),it),ee(Je(525),it),ee(Je(554),it),ee(Je(750),it),ee(Je(608),it)},303:(Ut,it,Je)=>{"use strict";var yt={};Je.r(yt),Je.d(yt,{decode:()=>Xme,encode:()=>Qme});var ee={};Je.r(ee),Je.d(ee,{decode:()=>n_e,encode:()=>i_e});var Tt={};Je.r(Tt),Je.d(Tt,{decode:()=>r_e,encode:()=>s_e});var dt={};function Y(n){return"function"==typeof n}Je.r(dt),Je.d(dt,{decode:()=>o_e,encode:()=>a_e});let Se=!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 Se&&console.log("RxJS: Back to a better error behavior. Thank you. <3");Se=n},get useDeprecatedSynchronousErrorHandling(){return Se}};function W(n){setTimeout(()=>{throw n},0)}const j={closed:!0,next(n){},error(n){if(he.useDeprecatedSynchronousErrorHandling)throw n;W(n)},complete(){}},P=Array.isArray||(n=>n&&"number"==typeof n.length);function Q(n){return null!==n&&"object"==typeof n}const v=(()=>{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 x{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 x)t.remove(this);else if(null!==t)for(let o=0;oe.concat(t instanceof v?t.errors:t),[])}x.EMPTY=((n=new x).closed=!0,n);const A="function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random();class y extends x{constructor(e,t,i){switch(super(),this.syncErrorValue=null,this.syncErrorThrown=!1,this.syncErrorThrowable=!1,this.isStopped=!1,arguments.length){case 0:this.destination=j;break;case 1:if(!e){this.destination=j;break}if("object"==typeof e){e instanceof y?(this.syncErrorThrowable=e.syncErrorThrowable,this.destination=e,e.add(this)):(this.syncErrorThrowable=!0,this.destination=new S(this,e));break}default:this.syncErrorThrowable=!0,this.destination=new S(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 S 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!==j&&(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 R="function"==typeof Symbol&&Symbol.observable||"@@observable";function K(n){return n}function ce(...n){return D(n)}function D(n){return 0===n.length?K:1===n.length?n[0]:function(t){return n.reduce((i,r)=>r(i),t)}}let I=(()=>{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(j)}(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=X(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)}[R](){return this}pipe(...t){return 0===t.length?this:D(t)(this)}toPromise(t){return new(t=X(t))((i,r)=>{let s;this.subscribe(o=>s=o,o=>r(o),()=>i(s))})}}return n.create=e=>new n(e),n})();function X(n){if(n||(n=he.Promise||Promise),!n)throw new Error("no Promise impl found");return n}const $=(()=>{function n(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return n.prototype=Object.create(Error.prototype),n})();class Z extends x{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 oe extends y{constructor(e){super(e),this.destination=e}}let se=(()=>{class n extends I{constructor(){super(),this.observers=[],this.closed=!1,this.isStopped=!1,this.hasError=!1,this.thrownError=null}[A](){return new oe(this)}lift(t){const i=new te(this,this);return i.operator=t,i}next(t){if(this.closed)throw new $;if(!this.isStopped){const{observers:i}=this,r=i.length,s=i.slice();for(let o=0;onew te(e,t),n})();class te extends se{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):x.EMPTY}}function Ce(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 ne(n,e))}}class ne{constructor(e,t){this.project=e,this.thisArg=t}call(e,t){return t.subscribe(new _e(e,this.project,this.thisArg))}}class _e 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 Ie=n=>e=>{for(let t=0,i=n.length;tn&&"number"==typeof n.length&&"function"!=typeof n;function Ke(n){return!!n&&"function"!=typeof n.subscribe&&"function"==typeof n.then}const Me=n=>{if(n&&"function"==typeof n[R])return(n=>e=>{const t=n[R]();if("function"!=typeof t.subscribe)throw new TypeError("Provided object does not correctly implement Symbol.observable");return t.subscribe(e)})(n);if(ke(n))return Ie(n);if(Ke(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[Xe])return(n=>e=>{const t=n[Xe]();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 ${Q(n)?"an invalid object":`'${n}'`} where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.`;throw new TypeError(t)}};function Ne(n,e){return new I(t=>{const i=new x;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 je(n,e){return e?function(n,e){if(null!=n){if(function(n){return n&&"function"==typeof n[R]}(n))return function(n,e){return new I(t=>{const i=new x;return i.add(e.schedule(()=>{const r=n[R]();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(Ke(n))return function(n,e){return new I(t=>{const i=new x;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(ke(n))return Ne(n,e);if(function(n){return n&&"function"==typeof n[Xe]}(n)||"string"==typeof n)return function(n,e){if(!n)throw new Error("Iterable cannot be null");return new I(t=>{const i=new x;let r;return i.add(()=>{r&&"function"==typeof r.return&&r.return()}),i.add(e.schedule(()=>{r=n[Xe](),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 I?n:new I(Me(n))}class _t 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 ve extends y{notifyNext(e){this.destination.next(e)}notifyError(e){this.destination.error(e)}notifyComplete(){this.destination.complete()}}function N(n,e){if(e.closed)return;if(n instanceof I)return n.subscribe(e);let t;try{t=Me(n)(e)}catch(i){e.error(i)}return t}function B(n,e,t=Number.POSITIVE_INFINITY){return"function"==typeof e?i=>i.pipe(B((r,s)=>je(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 Qe(e,this.project,this.concurrent))}}class Qe extends ve{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 Nt(n=Number.POSITIVE_INFINITY){return B(K,n)}function On(n,e){return e?Ne(n,e):new I(Ie(n))}function kn(...n){let e=Number.POSITIVE_INFINITY,t=null,i=n[n.length-1];return Ce(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 I?n[0]:Nt(e)(On(n,t))}function Yn(){return function(e){return e.lift(new Ti(e))}}class Ti{constructor(e){this.connectable=e}call(e,t){const{connectable:i}=this;i._refCount++;const r=new wi(e,i),s=t.subscribe(r);return r.closed||(r.connection=i.connect()),s}}class wi 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 Xr extends I{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 x,e.add(this.source.subscribe(new gs(this.getSubject(),this))),e.closed&&(this._connection=null,e=x.EMPTY)),e}refCount(){return Yn()(this)}}const Ls=(()=>{const n=Xr.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 gs extends oe{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()}}}function el(n,e){return function(i){let r;if(r="function"==typeof n?n:function(){return n},"function"==typeof e)return i.lift(new kl(r,e));const s=Object.create(i,Ls);return s.source=i,s.subjectFactory=r,s}}class kl{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 Sa(){return new se}function Es(){return n=>Yn()(el(Sa)(n))}function Jt(n){for(let e in n)if(n[e]===Jt)return e;throw Error("Could not find renamed property on target object.")}function tl(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 lt(n,e){return null==n||""===n?null===e?"":e:null==e||""===e?n:n+" "+e}const ht=Jt({__forward_ref__:Jt});function ge(n){return n.__forward_ref__=ge,n.toString=function(){return rt(this())},n}function be(n){return Le(n)?n():n}function Le(n){return"function"==typeof n&&n.hasOwnProperty(ht)&&n.__forward_ref__===ge}class Ze extends Error{constructor(e,t){super(function(n,e){return`${n?`NG0${n}: `:""}${e}`}(e,t)),this.code=e}}function Dt(n){return"string"==typeof n?n:null==n?"":String(n)}function Xt(n){return"function"==typeof n?n.name||n.toString():"object"==typeof n&&null!=n&&"function"==typeof n.type?n.type.name||n.type.toString():Dt(n)}function bn(n,e){const t=e?` in ${e}`:"";throw new Ze("201",`No provider for ${Xt(n)} found${t}`)}function J(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 xt(n){return{providers:n.providers||[],imports:n.imports||[]}}function vn(n){return Ss(n,po)||Ss(n,js)}function Ss(n,e){return n.hasOwnProperty(e)?n[e]:null}function Ll(n){return n&&(n.hasOwnProperty(jr)||n.hasOwnProperty(xc))?n[jr]:null}const po=Jt({\u0275prov:Jt}),jr=Jt({\u0275inj:Jt}),js=Jt({ngInjectableDef:Jt}),xc=Jt({ngInjectorDef:Jt});var Sn=(()=>((Sn=Sn||{})[Sn.Default=0]="Default",Sn[Sn.Host=1]="Host",Sn[Sn.Self=2]="Self",Sn[Sn.SkipSelf=4]="SkipSelf",Sn[Sn.Optional=8]="Optional",Sn))();let go;function Ca(n){const e=go;return go=n,e}function wd(n,e,t){const i=vn(n);return i&&"root"==i.providedIn?void 0===i.value?i.value=i.factory():i.value:t&Sn.Optional?null:void 0!==e?e:void bn(rt(n),"Injector")}function De(n){return{toString:n}.toString()}var He=(()=>((He=He||{})[He.OnPush=0]="OnPush",He[He.Default=1]="Default",He))(),Yt=(()=>((Yt=Yt||{})[Yt.Emulated=0]="Emulated",Yt[Yt.None=2]="None",Yt[Yt.ShadowDom=3]="ShadowDom",Yt))();const li="undefined"!=typeof globalThis&&globalThis,Vr="undefined"!=typeof window&&window,es="undefined"!=typeof self&&"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&self,xs="undefined"!=typeof global&&global,Qn=li||xs||Vr||es,Ed={},tr=[],fp=Jt({\u0275cmp:Jt}),Jm=Jt({\u0275dir:Jt}),Dh=Jt({\u0275pipe:Jt}),sv=Jt({\u0275mod:Jt}),T1=Jt({\u0275loc:Jt}),jl=Jt({\u0275fac:Jt}),Ih=Jt({__NG_ELEMENT_ID__:Jt});let M1=0;function ln(n){return De(()=>{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||tr,viewQuery:n.viewQuery||null,features:n.features||null,data:n.data||{},encapsulation:n.encapsulation||Yt.Emulated,id:"c",styles:n.styles||tr,_:null,setInput:null,schemas:n.schemas||null,tView:null},r=n.directives,s=n.features,o=n.pipes;return i.id+=M1++,i.inputs=cv(n.inputs,t),i.outputs=cv(n.outputs),s&&s.forEach(a=>a(i)),i.directiveDefs=r?()=>("function"==typeof r?r():r).map(ov):null,i.pipeDefs=o?()=>("function"==typeof o?o():o).map(av):null,i})}function ov(n){return Vi(n)||function(n){return n[Jm]||null}(n)}function av(n){return function(n){return n[Dh]||null}(n)}const lv={};function on(n){return De(()=>{const e={type:n.type,bootstrap:n.bootstrap||tr,declarations:n.declarations||tr,imports:n.imports||tr,exports:n.exports||tr,transitiveCompileScopes:null,schemas:n.schemas||null,id:n.id||null};return null!=n.id&&(lv[n.id]=n.type),e})}function cv(n,e){if(null==n)return Ed;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 Rt=ln;function Vs(n){return{type:n.type,name:n.name,factory:null,pure:!1!==n.pure,onDestroy:n.type.prototype.ngOnDestroy||null}}function Vi(n){return n[fp]||null}function Oo(n,e){const t=n[sv]||null;if(!t&&!0===e)throw new Error(`Type ${rt(n)} does not have '\u0275mod' property.`);return t}function Qo(n){return Array.isArray(n)&&"object"==typeof n[1]}function Zo(n){return Array.isArray(n)&&!0===n[1]}function n_(n){return 0!=(8&n.flags)}function Ad(n){return 2==(2&n.flags)}function Td(n){return 1==(1&n.flags)}function Ma(n){return null!==n.template}function uv(n){return 0!=(512&n[2])}function Tc(n,e){return n.hasOwnProperty(jl)?n[jl]:null}class o_{constructor(e,t,i){this.previousValue=e,this.currentValue=t,this.firstChange=i}isFirstChange(){return this.firstChange}}function Ui(){return fv}function fv(n){return n.type.prototype.ngOnChanges&&(n.setInput=k1),F1}function F1(){const n=at(this),e=null==n?void 0:n.current;if(e){const t=n.previous;if(t===Ed)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=at(n)||function(n,e){return n[kh]=e}(n,{previous:Ed,current:null}),s=r.current||(r.current={}),o=r.previous,a=this.declaredInputs[t],l=o[a];s[a]=new o_(l&&l.currentValue,e,o===Ed),n[i]=e}Ui.ngInherit=!0;const kh="__ngSimpleChanges__";function at(n){return n[kh]||null}let Ki;function gr(n){return!!n.listen}const bu={createRenderer:(n,e)=>void 0!==Ki?Ki:"undefined"!=typeof document?document:void 0};function xr(n){for(;Array.isArray(n);)n=n[0];return n}function Lh(n,e){return xr(e[n])}function Zs(n,e){return xr(e[n.index])}function c_(n,e){return n.data[e]}function zs(n,e){const t=e[n];return Qo(t)?t:t[0]}function zl(n){return 4==(4&n[2])}function Dd(n){return 128==(128&n[2])}function Ia(n,e){return null==e?null:n[e]}function u_(n){n[18]=0}function mp(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 Bn={lFrame:wu(null),bindingsEnabled:!0,isInCheckNoChangesMode:!1};function gv(){return Bn.bindingsEnabled}function jt(){return Bn.lFrame.lView}function Ei(){return Bn.lFrame.tView}function Cr(n){return Bn.lFrame.contextLView=n,n[8]}function cs(){let n=d_();for(;null!==n&&64===n.type;)n=n.parent;return n}function d_(){return Bn.lFrame.currentTNode}function rl(n,e){const t=Bn.lFrame;t.currentTNode=n,t.isParent=e}function Hr(){return Bn.lFrame.isParent}function ms(){Bn.lFrame.isParent=!1}function Vh(){return Bn.isInCheckNoChangesMode}function yp(n){Bn.isInCheckNoChangesMode=n}function Oa(){return Bn.lFrame.bindingIndex++}function No(n){const e=Bn.lFrame,t=e.bindingIndex;return e.bindingIndex=e.bindingIndex+n,t}function Id(n,e){const t=Bn.lFrame;t.bindingIndex=t.bindingRootIndex=n,h_(e)}function h_(n){Bn.lFrame.currentDirectiveIndex=n}function f_(n){const e=Bn.lFrame.currentDirectiveIndex;return-1===e?null:n[e]}function mv(){return Bn.lFrame.currentQueryIndex}function p_(n){Bn.lFrame.currentQueryIndex=n}function vp(n){const e=n[1];return 2===e.type?e.declTNode:1===e.type?n[6]:null}function Od(n,e,t){if(t&Sn.SkipSelf){let r=e,s=n;for(;!(r=r.parent,null!==r||t&Sn.Host||(r=vp(s),null===r||(s=s[15],10&r.type))););if(null===r)return!1;e=r,n=s}const i=Bn.lFrame=Ee();return i.currentTNode=e,i.lView=n,!0}function Hh(n){const e=Ee(),t=n[1];Bn.lFrame=e,e.currentTNode=t.firstChild,e.lView=n,e.tView=t,e.contextLView=n,e.bindingIndex=t.bindingStartIndex,e.inI18n=!1}function Ee(){const n=Bn.lFrame,e=null===n?null:n.child;return null===e?wu(n):e}function wu(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 Gh(){const n=Bn.lFrame;return Bn.lFrame=n.parent,n.currentTNode=null,n.lView=null,n}const Po=Gh;function fi(){const n=Gh();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 Js(){return Bn.lFrame.selectedIndex}function yo(n){Bn.lFrame.selectedIndex=n}function kr(){const n=Bn.lFrame;return c_(n.tView,n.selectedIndex)}function wp(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 $h{constructor(e,t,i){this.factory=e,this.resolving=!1,this.canSeeViewProviders=t,this.injectImpl=i}}function xp(n,e,t){const i=gr(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 Nd=!0;function Cp(n){const e=Nd;return Nd=n,e}let v_=0;function Hs(n,e){const t=Ap(n,e);if(-1!==t)return t;const i=e[1];i.firstCreatePass&&(n.injectorIndex=e.length,w_(i.data,n),w_(e,null),w_(i.blueprint,null));const r=qh(n,e),s=n.injectorIndex;if(vv(r)){const o=Rd(r),a=ol(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 w_(n,e){n.push(0,0,0,0,0,0,0,0,e)}function Ap(n,e){return-1===n.injectorIndex||n.parent&&n.parent.injectorIndex===n.injectorIndex||null===e[n.injectorIndex+8]?-1:n.injectorIndex}function qh(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 Dc(n,e,t){!function(n,e,t){let i;"string"==typeof t?i=t.charCodeAt(0)||0:t.hasOwnProperty(Ih)&&(i=t[Ih]),null==i&&(i=t[Ih]=v_++);const r=255&i;e.data[n+(r>>5)]|=1<=0?255&e:xv:e}(t);if("function"==typeof s){if(!Od(e,n,i))return i&Sn.Host?E_(r,t,i):Ev(e,t,i,r);try{const o=s(i);if(null!=o||i&Sn.Optional)return o;bn(t)}finally{Po()}}else if("number"==typeof s){let o=null,a=Ap(n,e),l=-1,c=i&Sn.Host?e[16][6]:null;for((-1===a||i&Sn.SkipSelf)&&(l=-1===a?qh(n,e):e[a+8],-1!==l&&Kh(i,!1)?(o=e[1],a=Rd(l),e=ol(l,e)):a=-1);-1!==a;){const u=e[1];if(Tp(s,a,u.data)){const h=Ts(a,e,t,o,i,c);if(h!==Sv)return h}l=e[a+8],-1!==l&&Kh(i,e[1].data[a+8]===c)&&Tp(s,a,e)?(o=u,a=Rd(l),e=ol(l,e)):a=-1}}}return Ev(e,t,i,r)}const Sv={};function xv(){return new ea(cs(),jt())}function Ts(n,e,t,i,r,s){const o=e[1],a=o.data[n+8],u=Pd(a,o,t,null==i?Ad(a)&&Nd:i!=o&&0!=(3&a.type),r&Sn.Host&&s===a);return null!==u?Fd(e,o,u,a):Sv}function Pd(n,e,t,i,r){const s=n.providerIndexes,o=e.data,a=1048575&s,l=n.directiveStart,u=s>>20,p=r?a+u:n.directiveEnd;for(let g=i?a:a+u;g=l&&m.type===t)return g}if(r){const g=o[l];if(g&&Ma(g)&&g.type===t)return l}return null}function Fd(n,e,t,i){let r=n[t];const s=e.data;if(function(n){return n instanceof $h}(r)){const o=r;o.resolving&&function(n,e){throw new Ze("200",`Circular dependency in DI detected for ${n}`)}(Xt(s[t]));const a=Cp(o.canSeeViewProviders);o.resolving=!0;const l=o.injectImpl?Ca(o.injectImpl):null;Od(n,i,Sn.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=fv(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&&Ca(l),Cp(a),o.resolving=!1,Po()}}return r}function Tp(n,e,t){return!!(t[e+(n>>5)]&1<{const e=n.prototype.constructor,t=e[jl]||Ms(e),i=Object.prototype;let r=Object.getPrototypeOf(n.prototype).constructor;for(;r&&r!==i;){const s=r[jl]||Ms(r);if(s&&s!==t)return s;r=Object.getPrototypeOf(r)}return s=>new s})}function Ms(n){return Le(n)?()=>{const e=Ms(be(n));return e&&e()}:Tc(n)}function Fo(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{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,u){const h=l.hasOwnProperty(Ld)?l[Ld]:Object.defineProperty(l,Ld,{value:[]})[Ld];for(;h.length<=u;)h.push(null);return(h[u]=h[u]||[]).push(o),l}}return t&&(r.prototype=Object.create(t.prototype)),r.prototype.ngMetadataName=n,r.annotationCls=r,r})}class Ht{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}`}}const xu=Function;function ta(n,e){void 0===e&&(e=n);for(let t=0;tArray.isArray(t)?na(t,e):e(t))}function Qh(n,e,t){e>=n.length?n.push(t):n.splice(e,0,t)}function Gl(n,e){return e>=n.length-1?n.pop():n.splice(e,1)[0]}function Oc(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 M_(n,e){const t=Ds(n,e);if(t>=0)return n[1|t]}function Ds(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(Pc,"\n ")}`}("\n"+n.message,r,t,i),n.ngTokenPath=r,n[Nc]=null,n}const zd=Ud(Pa("Inject",n=>({token:n})),-1),ns=Ud(Pa("Optional"),8),ul=Ud(Pa("SkipSelf"),4);let Gd;function Ou(n){var e;return(null===(e=function(){if(void 0===Gd&&(Gd=null,Qn.trustedTypes))try{Gd=Qn.trustedTypes.createPolicy("angular",{createHTML:n=>n,createScript:n=>n,createScriptURL:n=>n})}catch(n){}return Gd}())||void 0===e?void 0:e.createHTML(n))||n}class Yl{constructor(e){this.changingThisBreaksApplicationSecurity=e}toString(){return`SafeValue must use [property]=binding: ${this.changingThisBreaksApplicationSecurity} (see https://g.co/ng/security#xss)`}}class P_ extends Yl{getTypeName(){return"HTML"}}class F_ extends Yl{getTypeName(){return"Style"}}class Vp extends Yl{getTypeName(){return"Script"}}class $d extends Yl{getTypeName(){return"URL"}}class Fn extends Yl{getTypeName(){return"ResourceURL"}}function Gs(n){return n instanceof Yl?n.changingThisBreaksApplicationSecurity:n}function ia(n,e){const t=Lc(n);if(null!=t&&t!==e){if("ResourceURL"===t&&"URL"===e)return!0;throw new Error(`Required a safe ${e}, got a ${t} (see https://g.co/ng/security#xss)`)}return t===e}function Lc(n){return n instanceof Yl&&n.getTypeName()||null}class zv{constructor(e){this.inertDocumentHelper=e}getInertBodyElement(e){e=""+e;try{const t=(new window.DOMParser).parseFromString(Ou(e),"text/html").body;return null===t?this.inertDocumentHelper.getInertBodyElement(e):(t.removeChild(t.firstChild),t)}catch(t){return null}}}class pA{constructor(e){if(this.defaultDoc=e,this.inertDocument=this.defaultDoc.implementation.createHTMLDocument("sanitization-inert"),null==this.inertDocument.body){const t=this.inertDocument.createElement("html");this.inertDocument.appendChild(t);const i=this.inertDocument.createElement("body");t.appendChild(i)}}getInertBodyElement(e){const t=this.inertDocument.createElement("template");if("content"in t)return t.innerHTML=Ou(e),t;const i=this.inertDocument.createElement("body");return i.innerHTML=Ou(e),this.defaultDoc.documentMode&&this.stripCustomNsAttrs(i),i}stripCustomNsAttrs(e){const t=e.attributes;for(let r=t.length-1;0Bo(e.trim())).join(", ")}function ra(n){const e={};for(const t of n.split(","))e[t]=!0;return e}function Jh(...n){const e={};for(const t of n)for(const i in t)t.hasOwnProperty(i)&&(e[i]=!0);return e}const Up=ra("area,br,col,hr,img,wbr"),Gv=ra("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr"),$v=ra("rp,rt"),L_=Jh(Up,Jh(Gv,ra("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")),Jh($v,ra("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")),Jh($v,Gv)),B_=ra("background,cite,href,itemtype,longdesc,poster,src,xlink:href"),j_=ra("srcset"),V_=Jh(B_,j_,ra("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"),ra("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")),vA=ra("script,style,template");class U_{constructor(){this.sanitizedSomething=!1,this.buf=[]}sanitizeChildren(e){let t=e.firstChild,i=!0;for(;t;)if(t.nodeType===Node.ELEMENT_NODE?i=this.startElement(t):t.nodeType===Node.TEXT_NODE?this.chars(t.nodeValue):this.sanitizedSomething=!0,i&&t.firstChild)t=t.firstChild;else for(;t;){t.nodeType===Node.ELEMENT_NODE&&this.endElement(t);let r=this.checkClobberedElement(t,t.nextSibling);if(r){t=r;break}t=this.checkClobberedElement(t,t.parentNode)}return this.buf.join("")}startElement(e){const t=e.nodeName.toLowerCase();if(!L_.hasOwnProperty(t))return this.sanitizedSomething=!0,!vA.hasOwnProperty(t);this.buf.push("<"),this.buf.push(t);const i=e.attributes;for(let r=0;r"),!0}endElement(e){const t=e.nodeName.toLowerCase();L_.hasOwnProperty(t)&&!Up.hasOwnProperty(t)&&(this.buf.push(""))}chars(e){this.buf.push(Hp(e))}checkClobberedElement(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: ${e.outerHTML}`);return t}}const Wv=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,ef=/([^\#-~ |!])/g;function Hp(n){return n.replace(/&/g,"&").replace(Wv,function(e){return"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";"}).replace(ef,function(e){return"&#"+e.charCodeAt(0)+";"}).replace(//g,">")}let tf;function z_(n,e){let t=null;try{tf=tf||function(n){const e=new pA(n);return function(){try{return!!(new window.DOMParser).parseFromString(Ou(""),"text/html")}catch(n){return!1}}()?new zv(e):e}(n);let i=e?String(e):"";t=tf.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=t.innerHTML,t=tf.getInertBodyElement(i)}while(i!==s);return Ou((new U_).sanitizeChildren(Wd(t)||t))}finally{if(t){const i=Wd(t)||t;for(;i.firstChild;)i.removeChild(i.firstChild)}}}function Wd(n){return"content"in n&&function(n){return n.nodeType===Node.ELEMENT_NODE&&"TEMPLATE"===n.nodeName}(n)?n.content:null}var ni=(()=>((ni=ni||{})[ni.NONE=0]="NONE",ni[ni.HTML=1]="HTML",ni[ni.STYLE=2]="STYLE",ni[ni.SCRIPT=3]="SCRIPT",ni[ni.URL=4]="URL",ni[ni.RESOURCE_URL=5]="RESOURCE_URL",ni))();function nf(n){const e=function(){const n=jt();return n&&n[12]}();return e?e.sanitize(ni.URL,n)||"":ia(n,"URL")?Gs(n):Bo(Dt(n))}const $_="__ngContext__";function Is(n,e){n[$_]=e}function W_(n){const e=function(n){return n[$_]||null}(n);return e?Array.isArray(e)?e:e.lView:null}function Gp(n){return n.ngOriginalError}function NA(n,...e){n.error(...e)}class oa{constructor(){this._console=console}handleError(e){const t=this._findOriginalError(e),i=this._findContext(e),r=function(n){return n&&n.ngErrorLogger||NA}(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(Gp(e)):null}_findOriginalError(e){let t=e&&Gp(e);for(;t&&Gp(t);)t=Gp(t);return t||null}}const iw=(()=>("undefined"!=typeof requestAnimationFrame&&requestAnimationFrame||setTimeout).bind(Qn))();function hl(n){return n instanceof Function?n():n}var jo=(()=>((jo=jo||{})[jo.Important=1]="Important",jo[jo.DashCase=2]="DashCase",jo))();function Q_(n,e){return undefined(n,e)}function of(n){const e=n[3];return Zo(e)?e[3]:e}function Yd(n){return lw(n[13])}function J_(n){return lw(n[4])}function lw(n){for(;null!==n&&!Zo(n);)n=n[4];return n}function Kd(n,e,t,i,r){if(null!=i){let s,o=!1;Zo(i)?s=i:Qo(i)&&(o=!0,i=i[0]);const a=xr(i);0===n&&null!==t?null==r?fw(e,t,a):fl(e,t,a,r||null,!0):1===n&&null!==t?fl(e,t,a,r||null,!0):2===n?function(n,e,t){const i=qp(n,e);i&&function(n,e,t,i){gr(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!==xr(t)&&Kd(e,n,i,s,r);for(let a=10;a0&&(n[t-1][4]=i[4]);const s=Gl(n,10+e);!function(n,e){Xd(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 iy(n,e){if(!(256&e[2])){const t=e[11];gr(t)&&t.destroyNode&&Xd(n,e,t,3,null,null),function(n){let e=n[13];if(!e)return Wp(n[1],n);for(;e;){let t=null;if(Qo(e))t=e[13];else{const i=e[10];i&&(t=i)}if(!t){for(;e&&!e[4]&&e!==n;)Qo(e)&&Wp(e[1],e),e=e[3];null===e&&(e=n),Qo(e)&&Wp(e[1],e),t=e&&e[4]}e=t}}(e)}}function Wp(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[h+1].toLowerCase();const g=8&i?p:null;if(g&&-1!==lf(g,c,0)||2&i&&c!==p){if(ka(i))return!1;o=!0}}}}else{if(!o&&!ka(i)&&!ka(l))return!1;if(o&&ka(l))continue;o=!1,i=l|1&i}}return ka(i)||o}function ka(n){return 0==(1&n)}function oT(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&&!ka(o)&&(e+=Aw(s,r),r=""),i=o,s=s||!ka(i);t++}return""!==r&&(e+=Aw(s,r)),e}const In={};function Zt(n){Tw(Ei(),jt(),Js()+n,Vh())}function Tw(n,e,t,i){if(!i)if(3==(3&e[2])){const s=n.preOrderCheckHooks;null!==s&&Ep(e,s,t)}else{const s=n.preOrderHooks;null!==s&&Sp(e,s,0,t)}yo(t)}function pl(n,e){return n<<17|e<<2}function Rn(n){return n>>17&32767}function Ar(n){return 2|n}function Kl(n){return(131068&n)>>2}function gl(n,e){return-131069&n|e<<2}function cy(n){return 1|n}function kw(n,e){const t=n.contentQueries;if(null!==t)for(let i=0;i20&&Tw(n,e,20,Vh()),t(i,r)}finally{yo(s)}}function hf(n,e,t){!gv()||(function(n,e,t,i){const r=t.directiveStart,s=t.directiveEnd;n.firstCreatePass||Hs(t,e),Is(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 qw(n,e){null!==n.hostBindings&&n.hostBindings(1,e)}function Yw(n,e){e.flags|=2,(n.components||(n.components=[])).push(e.index)}function PT(n,e,t){if(t){if(e.exportAs)for(let i=0;i0&&wy(t)}}function wy(n){for(let i=Yd(n);null!==i;i=J_(i))for(let r=10;r0&&wy(s)}const t=n[1].components;if(null!==t)for(let i=0;i0&&wy(r)}}function UT(n,e){const t=zs(e,n),i=t[1];(function(n,e){for(let t=e.length;tPromise.resolve(null))();function Qw(n){return n[7]||(n[7]=[])}function ig(n){return n.cleanup||(n.cleanup=[])}function Ay(n,e,t){return(null===n||Ma(n))&&(t=function(n){for(;Array.isArray(n);){if("object"==typeof n[1])return n;n=n[0]}return null}(t[e.index])),t[11]}function Ty(n,e){const t=n[9],i=t?t.get(oa,null):null;i&&i.handleError(e)}function Zw(n,e,t,i,r){for(let s=0;sthis.processProvider(a,e,t)),na([e],a=>this.processInjectorType(a,[],s)),this.records.set(Pu,ku(void 0,this));const o=this.records.get(Fu);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=Tu,i=Sn.Default){this.assertNotDestroyed();const r=Vd(this),s=Ca(void 0);try{if(!(i&Sn.SkipSelf)){let a=this.records.get(e);if(void 0===a){const l=function(n){return"function"==typeof n||"object"==typeof n&&n instanceof Ht}(e)&&vn(e);a=l&&this.injectableDefInScope(l)?ku(Ry(e),ff):null,this.records.set(e,a)}if(null!=a)return this.hydrate(e,a)}return(i&Sn.Self?Jw():this.parent).get(e,t=i&Sn.Optional&&t===Tu?null:t)}catch(o){if("NullInjectorError"===o.name){if((o[Nc]=o[Nc]||[]).unshift(rt(e)),r)throw o;return eo(o,e,"R3InjectorError",this.source)}throw o}finally{Ca(s),Vd(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=be(e)))return!1;let r=Ll(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=Ll(s)),null==r)return!1;if(null!=r.imports&&!a){let u;i.push(o);try{na(r.imports,h=>{this.processInjectorType(h,t,i)&&(void 0===u&&(u=[]),u.push(h))})}finally{}if(void 0!==u)for(let h=0;hthis.processProvider(m,p,g||tr))}}this.injectorDefTypes.add(o);const l=Tc(o)||(()=>new o);this.records.set(o,ku(l,ff));const c=r.providers;if(null!=c&&!a){const u=e;na(c,h=>this.processProvider(h,u,c))}return void 0!==s&&void 0!==e.providers}processProvider(e,t,i){let r=Vc(e=be(e))?e:be(e&&e.provide);const s=function(n,e,t){return nE(n)?ku(void 0,n.useValue):ku(tE(n),ff)}(e);if(Vc(e)||!0!==e.multi)this.records.get(r);else{let o=this.records.get(r);o||(o=ku(void 0,ff,!0),o.factory=()=>Du(o.multi),this.records.set(r,o)),r=e,o.multi.push(e)}this.records.set(r,s)}hydrate(e,t){return t.value===ff&&(t.value=KT,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=be(e.providedIn);return"string"==typeof t?"any"===t||t===this.scope:this.injectorDefTypes.has(t)}}function Ry(n){const e=vn(n),t=null!==e?e.factory:Tc(n);if(null!==t)return t;if(n instanceof Ht)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=Oc(e,"?");throw new Error(`Can't resolve all parameters for ${rt(n)}: (${i.join(", ")}).`)}const t=function(n){const e=n&&(n[po]||n[js]);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 tE(n,e,t){let i;if(Vc(n)){const r=be(n);return Tc(r)||Ry(r)}if(nE(n))i=()=>be(n.useValue);else if(function(n){return!(!n||!n.useFactory)}(n))i=()=>n.useFactory(...Du(n.deps||[]));else if(function(n){return!(!n||!n.useExisting)}(n))i=()=>Oe(be(n.useExisting));else{const r=be(n&&(n.useClass||n.provide));if(!function(n){return!!n.deps}(n))return Tc(r)||Ry(r);i=()=>new r(...Du(n.deps))}return i}function ku(n,e,t=!1){return{factory:n,value:e,multi:t?[]:void 0}}function nE(n){return null!==n&&"object"==typeof n&&Np in n}function Vc(n){return"function"==typeof n}const iE=function(n,e,t){return function(n,e=null,t=null,i){const r=eE(n,e,t,i);return r._resolveInjectorDefTypes(),r}({name:t},e,n,t)};class Wn{static create(e,t){return Array.isArray(e)?iE(e,t,""):iE(e.providers,e.parent,e.name||"")}}function Gq(n,e){wp(W_(n)[1],cs())}function An(n){let e=function(n){return Object.getPrototypeOf(n.prototype).constructor}(n.type),t=!0;const i=[n];for(;e;){let r;if(Ma(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=cM(n.inputs),o.declaredInputs=cM(n.declaredInputs),o.outputs=cM(n.outputs);const a=r.hostBindings;a&&Yq(n,a);const l=r.viewQuery,c=r.contentQueries;if(l&&Wq(n,l),c&&qq(n,c),tl(n.inputs,r.inputs),tl(n.declaredInputs,r.declaredInputs),tl(n.outputs,r.outputs),Ma(r)&&r.data.animation){const u=n.data;u.animation=(u.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=Wh(r.hostAttrs,t=Wh(t,r.hostAttrs))}}(i)}function cM(n){return n===Ed?{}:n===tr?[]:n}function Wq(n,e){const t=n.viewQuery;n.viewQuery=t?(i,r)=>{e(i,r),t(i,r)}:e}function qq(n,e){const t=n.contentQueries;n.contentQueries=t?(i,r,s)=>{e(i,r,s),t(i,r,s)}:e}function Yq(n,e){const t=n.hostBindings;n.hostBindings=t?(i,r)=>{e(i,r),t(i,r)}:e}Wn.THROW_IF_NOT_FOUND=Tu,Wn.NULL=new io,Wn.\u0275prov=We({token:Wn,providedIn:"any",factory:()=>Oe(Pu)}),Wn.__NG_ELEMENT_ID__=-1;let lE=null;function sg(){if(!lE){const n=Qn.Symbol;if(n&&n.iterator)lE=n.iterator;else{const e=Object.getOwnPropertyNames(Map.prototype);for(let t=0;ta(xr(Ae[i.index])):i.index;if(gr(t)){let Ae=null;if(!a&&l&&(Ae=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!==Ae)(Ae.__ngLastListenerFn__||Ae).__ngNextListenerFn__=s,Ae.__ngLastListenerFn__=s,g=!1;else{s=mM(i,e,h,s,!1);const Pe=t.listen(H,r,s);p.push(s,Pe),u&&u.push(r,de,U,U+1)}}else s=mM(i,e,h,s,!0),H.addEventListener(r,s,o),p.push(s),u&&u.push(r,de,U,o)}else s=mM(i,e,h,s,!1);const m=i.outputs;let w;if(g&&null!==m&&(w=m[r])){const C=w.length;if(C)for(let H=0;H0;)e=e[15],n--;return e}(n,Bn.lFrame.contextLView))[8]}(n)}function MY(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 Rs={textEnd:0,key:0,keyEnd:0,value:0,valueEnd:0};function jk(n){return n.substring(Rs.key,Rs.keyEnd)}function Vk(n,e){const t=Rs.textEnd;return t===e?-1:(e=Rs.keyEnd=function(n,e,t){for(;e32;)e++;return e}(n,Rs.key=e,t),bg(n,e,t))}function bg(n,e,t){for(;e=0;t=Vk(e,t))ko(n,jk(e),!0)}function ec(n,e,t,i){const r=jt(),s=Ei(),o=No(2);s.firstUpdatePass&&Wk(s,n,o,i),e!==In&&Eo(r,o,e)&&Yk(s,s.data[Js()],r,r[11],n,r[o+1]=function(n,e){return null==n||("string"==typeof e?n+=e:"object"==typeof n&&(n=rt(Gs(n)))),n}(e,t),i,o)}function $k(n,e){return e>=n.expandoStartIndex}function Wk(n,e,t,i){const r=n.data;if(null===r[t+1]){const s=r[Js()],o=$k(n,t);Xk(s,i)&&null===e&&!o&&(e=!1),e=function(n,e,t,i){const r=f_(n);let s=i?e.residualClasses:e.residualStyles;if(null===r)0===(i?e.classBindings:e.styleBindings)&&(t=Vy(t=yM(null,n,e,t,i),e.attrs,i),s=null);else{const o=e.directiveStylingLast;if(-1===o||n[o]!==r)if(t=yM(r,n,e,t,i),null===s){let l=function(n,e,t){const i=t?e.classBindings:e.styleBindings;if(0!==Kl(i))return n[Rn(i)]}(n,e,i);void 0!==l&&Array.isArray(l)&&(l=yM(null,n,e,l[1],i),l=Vy(l,e.attrs,i),function(n,e,t,i){n[Rn(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 u=t;if(r)if(0!==l){const p=Rn(n[a+1]);n[i+1]=pl(p,a),0!==p&&(n[p+1]=gl(n[p+1],i)),n[a+1]=function(n,e){return 131071&n|e<<17}(n[a+1],i)}else n[i+1]=pl(a,0),0!==a&&(n[a+1]=gl(n[a+1],i)),a=i;else n[i+1]=pl(l,0),0===a?a=i:n[l+1]=gl(n[l+1],i),l=i;c&&(n[i+1]=Ar(n[i+1])),Bk(n,u,i,!0),Bk(n,u,i,!1),function(n,e,t,i,r){const s=r?n.residualClasses:n.residualStyles;null!=s&&"string"==typeof e&&Ds(s,e)>=0&&(t[i+1]=cy(t[i+1]))}(e,u,n,i,s),o=pl(a,l),s?e.classBindings=o:e.styleBindings=o}(r,s,e,t,o,i)}}function yM(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),u=c?l[1]:l,h=null===u;let p=t[r+1];p===In&&(p=h?tr:void 0);let g=h?M_(p,i):u===i?p:void 0;if(c&&!gE(g)&&(g=M_(l,i)),gE(g)&&(a=g,o))return a;const m=n[r+1];r=o?Rn(m):Kl(m)}if(null!==e){let l=s?e.residualClasses:e.residualStyles;null!=l&&(a=M_(l,i))}return a}function gE(n){return void 0!==n}function Xk(n,e){return 0!=(n.flags&(e?16:32))}function Oi(n,e=""){const t=jt(),i=Ei(),r=n+20,s=i.firstCreatePass?Zd(i,r,1,e,null):i.data[r],o=t[r]=function(n,e){return gr(n)?n.createText(e):n.createTextNode(e)}(t[11],e);Yp(i,t,o,s),rl(s,!1)}function da(n){return ha("",n,""),da}function ha(n,e,t){const i=jt(),r=ag(i,n,e,t);return r!==In&&Xl(i,Js(),r),ha}function Lu(n,e,t){const i=jt();return Eo(i,Oa(),e)&&Vo(Ei(),kr(),i,n,e,i[11],t,!0),Lu}function mE(n,e,t){const i=jt();if(Eo(i,Oa(),e)){const s=Ei(),o=kr();Vo(s,o,i,n,e,Ay(f_(s.data),o,i),t,!0)}return mE}const gf=void 0;var dK=["en",[["a","p"],["AM","PM"],gf],[["AM","PM"],gf,gf],[["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"]],gf,[["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"]],gf,[["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}",gf,"{1} 'at' {0}",gf],[".",",",";","%","+","-","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 vg={};function pL(n){return n in vg||(vg[n]=Qn.ng&&Qn.ng.common&&Qn.ng.common.locales&&Qn.ng.common.locales[n]),vg[n]}var cn=(()=>((cn=cn||{})[cn.LocaleId=0]="LocaleId",cn[cn.DayPeriodsFormat=1]="DayPeriodsFormat",cn[cn.DayPeriodsStandalone=2]="DayPeriodsStandalone",cn[cn.DaysFormat=3]="DaysFormat",cn[cn.DaysStandalone=4]="DaysStandalone",cn[cn.MonthsFormat=5]="MonthsFormat",cn[cn.MonthsStandalone=6]="MonthsStandalone",cn[cn.Eras=7]="Eras",cn[cn.FirstDayOfWeek=8]="FirstDayOfWeek",cn[cn.WeekendRange=9]="WeekendRange",cn[cn.DateFormat=10]="DateFormat",cn[cn.TimeFormat=11]="TimeFormat",cn[cn.DateTimeFormat=12]="DateTimeFormat",cn[cn.NumberSymbols=13]="NumberSymbols",cn[cn.NumberFormats=14]="NumberFormats",cn[cn.CurrencyCode=15]="CurrencyCode",cn[cn.CurrencySymbol=16]="CurrencySymbol",cn[cn.CurrencyName=17]="CurrencyName",cn[cn.Currencies=18]="Currencies",cn[cn.Directionality=19]="Directionality",cn[cn.PluralCase=20]="PluralCase",cn[cn.ExtraData=21]="ExtraData",cn))();const _E="en-US";let gL=_E;function vM(n){J(n,"Expected localeId to be defined"),"string"==typeof n&&(gL=n.toLowerCase().replace(/_/g,"-"))}function SM(n,e,t,i,r){if(n=be(n),Array.isArray(n))for(let s=0;s>20;if(Vc(n)||!n.multi){const g=new $h(l,r,xe),m=CM(a,e,r?u:u+p,h);-1===m?(Dc(Hs(c,o),s,a),xM(s,n,e.length),e.push(a),c.directiveStart++,c.directiveEnd++,r&&(c.providerIndexes+=1048576),t.push(g),o.push(g)):(t[m]=g,o[m]=g)}else{const g=CM(a,e,u+p,h),m=CM(a,e,u,u+p),w=g>=0&&t[g],C=m>=0&&t[m];if(r&&!C||!r&&!w){Dc(Hs(c,o),s,a);const H=function(n,e,t,i,r){const s=new $h(n,t,xe);return s.multi=[],s.index=e,s.componentProviders=0,jL(s,r,i&&!t),s}(r?lX:aX,t.length,r,i,l);!r&&C&&(t[m].providerFactory=H),xM(s,n,e.length,0),e.push(a),c.directiveStart++,c.directiveEnd++,r&&(c.providerIndexes+=1048576),t.push(H),o.push(H)}else xM(s,n,g>-1?g:m,jL(t[r?m:g],l,!r&&i));!r&&i&&C&&t[m].componentProviders++}}}function xM(n,e,t,i){const r=Vc(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 jL(n,e,t){return t&&n.componentProviders++,n.multi.push(e)-1}function CM(n,e,t,i){for(let r=t;r{t.providersResolver=(i,r)=>function(n,e,t){const i=Ei();if(i.firstCreatePass){const r=Ma(n);SM(t,i.data,i.blueprint,r,!0),SM(e,i.data,i.blueprint,r,!1)}}(i,r?r(n):n,e)}}class VL{}const zL="ngComponent";class dX{resolveComponentFactory(e){throw function(n){const e=Error(`No component factory found for ${rt(n)}. Did you add it to @NgModule.entryComponents?`);return e[zL]=n,e}(e)}}class wl{}function EE(...n){}function Eg(n,e){return new En(Zs(n,e))}wl.NULL=new dX;const pX=function(){return Eg(cs(),jt())};let En=(()=>{class n{constructor(t){this.nativeElement=t}}return n.__NG_ELEMENT_ID__=pX,n})();function HL(n){return n instanceof En?n.nativeElement:n}class mf{}let MM=(()=>{class n{}return n.\u0275prov=We({token:n,providedIn:"root",factory:()=>null}),n})();class ju{constructor(e){this.full=e,this.major=e.split(".")[0],this.minor=e.split(".")[1],this.patch=e.split(".").slice(2).join(".")}}const GL=new ju("12.2.5");class $L{constructor(){}supports(e){return Ly(e)}create(e){return new vX(e)}}const bX=(n,e)=>e;class vX{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||bX}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 wX(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 WL),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 WL),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 wX{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 EX{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 WL{constructor(){this.map=new Map}put(e){const t=e.trackById;let i=this.map.get(t);i||(i=new EX,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 qL(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 xX(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 xX{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 KL(){return new Sg([new $L])}let Sg=(()=>{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||KL()),deps:[[n,new ul,new ns]]}}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:KL}),n})();function XL(){return new xg([new YL])}let xg=(()=>{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||XL()),deps:[[n,new ul,new ns]]}}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:XL}),n})();function SE(n,e,t,i,r=!1){for(;null!==t;){const s=e[t.index];if(null!==s&&i.push(xr(s)),Zo(s))for(let a=10;a-1&&(ny(e,i),Gl(t,i))}this._attachedToViewContainer=!1}iy(this._lView[1],this._lView)}onDestroy(e){Vw(this._lView[1],this._lView,null,e)}markForCheck(){Ey(this._cdRefInjectingView||this._lView)}detach(){this._lView[2]&=-129}reattach(){this._lView[2]|=128}detectChanges(){xy(this._lView[1],this._lView,this.context)}checkNoChanges(){!function(n,e,t){yp(!0);try{xy(n,e,t)}finally{yp(!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){Xd(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 AX extends $y{constructor(e){super(e),this._view=e}detectChanges(){Xw(this._view)}checkNoChanges(){!function(n){yp(!0);try{Xw(n)}finally{yp(!1)}}(this._view)}get context(){return null}}const MX=function(n){return function(n,e,t){if(Ad(n)&&!t){const i=zs(n.index,e);return new $y(i,i)}return 47&n.type?new $y(e[16],e):null}(cs(),jt(),16==(16&n))};let Dr=(()=>{class n{}return n.__NG_ELEMENT_ID__=MX,n})();const OX=[new YL],NX=new Sg([new $L]),PX=new xg(OX),kX=function(){return xE(cs(),jt())};let zo=(()=>{class n{}return n.__NG_ELEMENT_ID__=kX,n})();const LX=zo,BX=class extends LX{constructor(e,t,i){super(),this._declarationLView=e,this._declarationTContainer=t,this.elementRef=i}createEmbeddedView(e){const t=this._declarationTContainer.tViews,i=uf(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)),df(t,i,e),new $y(i)}};function xE(n,e){return 4&n.type?new BX(e,n,Eg(n,e)):null}class $c{}const UX=function(){return e3(cs(),jt())};let Ns=(()=>{class n{}return n.__NG_ELEMENT_ID__=UX,n})();const HX=Ns,ZL=class extends HX{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 ea(this._hostTNode,this._hostLView)}get parentInjector(){const e=qh(this._hostTNode,this._hostLView);if(vv(e)){const t=ol(e,this._hostLView),i=Rd(e);return new ea(t[1].data[i+8],t)}return new ea(null,this._hostLView)}clear(){for(;this.length>0;)this.remove(this.length-1)}get(e){const t=JL(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($c,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 Zo(n[3])}(i)){const u=this.indexOf(e);if(-1!==u)this.detach(u);else{const h=i[3],p=new ZL(h,h[6],h[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),iiw});class S3 extends VL{constructor(e,t){super(),this.componentDef=e,this.ngModule=t,this.componentType=e.type,this.selector=function(n){return n.map(dT).join(",")}(e.selectors),this.ngContentSelectors=e.ngContentSelectors?e.ngContentSelectors:[],this.isBoundToModule=!!t}get inputs(){return E3(this.componentDef.inputs)}get outputs(){return E3(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,Mg,r);return s!==Mg||i===Mg?s:e.get(t,i,r)}}}(e,r.injector):e,o=s.get(mf,bu),a=s.get(MM,null),l=o.createRenderer(null,this.componentDef),c=this.componentDef.selectors[0][0]||"div",u=i?function(n,e,t){if(gr(n))return n.selectRootElement(e,t===Yt.ShadowDom);let i="string"==typeof e?n.querySelector(e):e;return i.textContent="",i}(l,i,this.componentDef.encapsulation):ty(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)),h=this.componentDef.onPush?576:528,p=function(n,e){return{components:[],scheduler:n||iw,clean:WT,playerHandler:e||null,flags:0}}(),g=tg(0,null,null,1,0,null,null,null,null,null),m=uf(null,g,p,h,null,null,o,l,a,s);let w,C;Hh(m);try{const H=function(n,e,t,i,r,s){const o=t[1];t[20]=n;const l=Zd(o,20,2,"#host",null),c=l.mergedAttrs=e.hostAttrs;null!==c&&(rg(l,c,!0),null!==n&&(xp(r,n,c),null!==l.classes&&ay(r,n,l.classes),null!==l.styles&&Ew(r,n,l.styles)));const u=i.createRenderer(n,e),h=uf(t,eg(e),null,e.onPush?64:16,t[20],l,i,u,s||null,null);return o.firstCreatePass&&(Dc(Hs(l,t),o,e.type),Yw(o,l),yy(l,t.length,1)),ng(t,h),t[20]=h}(u,this.componentDef,m,o,l);if(u)if(i)xp(l,u,["ng-version",GL.full]);else{const{attrs:U,classes:de}=function(n){const e=[],t=[];let i=1,r=2;for(;i0&&ay(l,u,de.join(" "))}if(C=c_(g,20),void 0!==t){const U=C.projection=[];for(let de=0;del(o,e)),e.contentQueries){const l=cs();e.contentQueries(1,o,l.directiveStart)}const a=cs();return!s.firstCreatePass||null===e.hostBindings&&null===e.hostAttrs||(yo(a.index),Ww(t[1],a,0,a.directiveStart,a.directiveEnd,e),qw(e,o)),o}(H,this.componentDef,m,p,[Gq]),df(g,m,null)}finally{fi()}return new zQ(this.componentType,w,Eg(C,m),m,C)}}class zQ 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 AX(r),this.componentType=e}get injector(){return new ea(this._tNode,this._rootLView)}destroy(){this.hostView.destroy()}onDestroy(e){this.hostView.onDestroy(e)}}const Dg=new Map;class $Q extends $c{constructor(e,t){super(),this._parent=t,this._bootstrapComponents=[],this.injector=this,this.destroyCbs=[],this.componentFactoryResolver=new w3(this);const i=Oo(e),r=function(n){return n[T1]||null}(e);r&&vM(r),this._bootstrapComponents=hl(i.bootstrap),this._r3Injector=eE(e,t,[{provide:$c,useValue:this},{provide:wl,useValue:this.componentFactoryResolver}],rt(e)),this._r3Injector._resolveInjectorDefTypes(),this.instance=this.get(e)}get(e,t=Wn.THROW_IF_NOT_FOUND,i=Sn.Default){return e===Wn||e===$c||e===Pu?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 zM extends class{}{constructor(e){super(),this.moduleType=e,null!==Oo(e)&&function(n){const e=new Set;!function t(i){const r=Oo(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,Dg.get(s),i),Dg.set(s,i));const o=hl(r.imports);for(const a of o)e.has(a)||(e.add(a),t(a))}(n)}(e)}create(e){return new $Q(this.moduleType,e)}}function T3(n,e,t,i,r,s){const o=e+t;return Eo(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===In?void 0:t}(n,o+1)}function xl(n,e){const t=Ei();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 Ze("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=Tc(i.type)),o=Ca(xe);try{const a=Cp(!1),l=s();return Cp(a),function(n,e,t,i){t>=n.data.length&&(n.data[t]=null,n.blueprint[t]=null),e[t]=i}(t,jt(),r,l),l}finally{Ca(o)}}function Vu(n,e,t){const i=n+20,r=jt(),s=function(n,e){return n[e]}(r,i);return function(n,e){Zl.isWrapped(e)&&(e=Zl.unwrap(e),n[Bn.lFrame.bindingIndex]=In);return e}(r,function(n,e){return n[1].data[e].pure}(r,i)?T3(r,function(){const n=Bn.lFrame;let e=n.bindingRootIndex;return-1===e&&(e=n.bindingRootIndex=n.tView.bindingStartIndex),e}(),e,s.transform,t,s):s.transform(t))}function HM(n){return e=>{setTimeout(n,void 0,e)}}const sn=class extends se{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 h=e;a=null===(r=h.next)||void 0===r?void 0:r.bind(h),l=null===(s=h.error)||void 0===s?void 0:s.bind(h),c=null===(o=h.complete)||void 0===o?void 0:o.bind(h)}this.__isAsync&&(l=HM(l),a&&(a=HM(a)),c&&(c=HM(c)));const u=super.subscribe({next:a,error:l,complete:c});return e instanceof x&&e.add(u),u}};function oZ(){return this._results[sg()]()}class bf{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=sg(),i=bf.prototype;i[t]||(i[t]=oZ)}get changes(){return this._changes||(this._changes=new sn)}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=ta(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],u=e[-l];for(let h=10;h{class n{constructor(t){this.appInits=t,this.resolve=EE,this.reject=EE,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)(Oe(vf,8))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const r0=new Ht("AppId"),zZ={provide:r0,useFactory:function(){return`${eD()}${eD()}${eD()}`},deps:[]};function eD(){return String.fromCharCode(97+Math.floor(25*Math.random()))}const eB=new Ht("Platform Initializer"),Wc=new Ht("Platform ID"),RE=new Ht("appBootstrapListener");let NE=(()=>{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 Uu=new Ht("LocaleId"),tB=new Ht("DefaultCurrencyCode");class GZ{constructor(e,t){this.ngModuleFactory=e,this.componentFactories=t}}const tD=function(n){return new zM(n)},$Z=tD,WZ=function(n){return Promise.resolve(tD(n))},nB=function(n){const e=tD(n),i=hl(Oo(n).declarations).reduce((r,s)=>{const o=Vi(s);return o&&r.push(new S3(o)),r},[]);return new GZ(e,i)},qZ=nB,YZ=function(n){return Promise.resolve(nB(n))};let wf=(()=>{class n{constructor(){this.compileModuleSync=$Z,this.compileModuleAsync=WZ,this.compileModuleAndAllComponentsSync=qZ,this.compileModuleAndAllComponentsAsync=YZ}clearCache(){}clearCacheFor(t){}getModuleId(t){}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const iB=new Ht("compilerOptions"),XZ=(()=>Promise.resolve(0))();function nD(n){"undefined"==typeof Zone?XZ.then(()=>{n&&n.apply(null,null)}):Zone.current.scheduleMicroTask("scheduleMicrotask",n)}class gn{constructor({enableLongStackTrace:e=!1,shouldCoalesceEventChangeDetection:t=!1,shouldCoalesceRunChangeDetection:i=!1}){if(this.hasPendingMacrotasks=!1,this.hasPendingMicrotasks=!1,this.isStable=!0,this.onUnstable=new sn(!1),this.onMicrotaskEmpty=new sn(!1),this.onStable=new sn(!1),this.onError=new sn(!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=Qn.requestAnimationFrame,e=Qn.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(Qn,()=>{n.fakeTopEventTask||(n.fakeTopEventTask=Zone.root.scheduleEventTask("fakeTopEventTask",()=>{n.lastRequestAnimationFrameId=-1,rD(n),n.isCheckStableRunning=!0,iD(n),n.isCheckStableRunning=!1},void 0,()=>{},()=>{})),n.fakeTopEventTask.invoke()}),rD(n))}(n)};n._inner=n._inner.fork({name:"angular",properties:{isAngularZone:!0},onInvokeTask:(t,i,r,s,o,a)=>{try{return rB(n),t.invokeTask(r,s,o,a)}finally{(n.shouldCoalesceEventChangeDetection&&"eventTask"===s.type||n.shouldCoalesceRunChangeDetection)&&e(),sB(n)}},onInvoke:(t,i,r,s,o,a,l)=>{try{return rB(n),t.invoke(r,s,o,a,l)}finally{n.shouldCoalesceRunChangeDetection&&e(),sB(n)}},onHasTask:(t,i,r,s)=>{t.hasTask(r,s),i===r&&("microTask"==s.change?(n._hasPendingMicrotasks=s.microTask,rD(n),iD(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(!gn.isInAngularZone())throw new Error("Expected to be in Angular Zone, but it is not!")}static assertNotInAngularZone(){if(gn.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,ZZ,EE,EE);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 ZZ={};function iD(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 rD(n){n.hasPendingMicrotasks=!!(n._hasPendingMicrotasks||(n.shouldCoalesceEventChangeDetection||n.shouldCoalesceRunChangeDetection)&&-1!==n.lastRequestAnimationFrameId)}function rB(n){n._nesting++,n.isStable&&(n.isStable=!1,n.onUnstable.emit(null))}function sB(n){n._nesting--,iD(n)}class tJ{constructor(){this.hasPendingMicrotasks=!1,this.hasPendingMacrotasks=!1,this.isStable=!0,this.onUnstable=new sn,this.onMicrotaskEmpty=new sn,this.onStable=new sn,this.onError=new sn}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 sD=(()=>{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:()=>{gn.assertNotInAngularZone(),nD(()=>{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())nD(()=>{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)(Oe(gn))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),oB=(()=>{class n{constructor(){this._applications=new Map,oD.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 oD.findTestabilityInTree(this,t,i)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();class nJ{addToWindow(e){}findTestabilityInTree(e,t,i){return null}}let oD=new nJ,aB=!0,lB=!1;function Ba(){return lB=!0,aB}let rc;const cB=new Ht("AllowMultipleToken");function uB(n,e,t=[]){const i=`Platform: ${e}`,r=new Ht(i);return(s=[])=>{let o=lD();if(!o||o.injector.get(cB,!1))if(n)n(t.concat(s).concat({provide:r,useValue:!0}));else{const a=t.concat(s).concat({provide:r,useValue:!0},{provide:Fu,useValue:"platform"});!function(n){if(rc&&!rc.destroyed&&!rc.injector.get(cB,!1))throw new Error("There can be only one platform. Destroy the previous one to create a new one.");rc=n.get(dB);const e=n.get(eB,null);e&&e.forEach(t=>t())}(Wn.create({providers:a,name:i}))}return function(n){const e=lD();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 lD(){return rc&&!rc.destroyed?rc:null}let dB=(()=>{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 tJ:("zone.js"===n?void 0:n)||new gn({enableLongStackTrace:Ba(),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:gn,useValue:a}];return a.run(()=>{const c=Wn.create({providers:l,parent:this.injector,name:t.moduleType.name}),u=t.create(c),h=u.injector.get(oa,null);if(!h)throw new Error("No ErrorHandler. Is platform module (BrowserModule) included?");return a.runOutsideAngular(()=>{const p=a.onError.subscribe({next:g=>{h.handleError(g)}});u.onDestroy(()=>{cD(this._modules,u),p.unsubscribe()})}),function(n,e,t){try{const i=t();return yg(i)?i.catch(r=>{throw e.runOutsideAngular(()=>n.handleError(r)),r}):i}catch(i){throw e.runOutsideAngular(()=>n.handleError(i)),i}}(h,a,()=>{const p=u.injector.get(Og);return p.runInitializers(),p.donePromise.then(()=>(vM(u.injector.get(Uu,_E)||_E),this._moduleDoBootstrap(u),u))})})}bootstrapModule(t,i=[]){const r=hB({},i);return function(n,e,t){const i=new zM(t);return Promise.resolve(i)}(0,0,t).then(s=>this.bootstrapModuleFactory(s,r))}_moduleDoBootstrap(t){const i=t.injector.get(ih);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)(Oe(Wn))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();function hB(n,e){return Array.isArray(e)?e.reduce(hB,n):Object.assign(Object.assign({},n),e)}let ih=(()=>{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 I(c=>{this._stable=this._zone.isStable&&!this._zone.hasPendingMacrotasks&&!this._zone.hasPendingMicrotasks,this._zone.runOutsideAngular(()=>{c.next(this._stable),c.complete()})}),l=new I(c=>{let u;this._zone.runOutsideAngular(()=>{u=this._zone.onStable.subscribe(()=>{gn.assertNotInAngularZone(),nD(()=>{!this._stable&&!this._zone.hasPendingMacrotasks&&!this._zone.hasPendingMicrotasks&&(this._stable=!0,c.next(!0))})})});const h=this._zone.onUnstable.subscribe(()=>{gn.assertInAngularZone(),this._stable&&(this._stable=!1,this._zone.runOutsideAngular(()=>{c.next(!1)}))});return()=>{u.unsubscribe(),h.unsubscribe()}});this.isStable=kn(a,l.pipe(Es()))}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 VL?t:this._componentFactoryResolver.resolveComponentFactory(t),this.componentTypes.push(r.componentType);const s=function(n){return n.isBoundToModule}(r)?void 0:this._injector.get($c),a=r.create(Wn.NULL,[],i||r.selector,s),l=a.location.nativeElement,c=a.injector.get(sD,null),u=c&&a.injector.get(oB);return c&&u&&u.registerApplication(l,c),a.onDestroy(()=>{this.detachView(a.hostView),cD(this.components,a),u&&u.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;cD(this._views,i),i.detachFromAppRef()}_loadComponent(t){this.attachView(t.hostView),this.tick(),this.components.push(t),this._injector.get(RE,[]).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)(Oe(gn),Oe(Wn),Oe(oa),Oe(wl),Oe(Og))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();function cD(n,e){const t=n.indexOf(e);t>-1&&n.splice(t,1)}const DJ=uB(null,"core",[{provide:Wc,useValue:"unknown"},{provide:dB,deps:[Wn]},{provide:oB,deps:[]},{provide:NE,deps:[]}]),PJ=[{provide:ih,useClass:ih,deps:[gn,Wn,oa,wl,Og]},{provide:jQ,deps:[gn],useFactory:function(n){let e=[];return n.onStable.subscribe(()=>{for(;e.length;)e.pop()()}),function(t){e.push(t)}}},{provide:Og,useClass:Og,deps:[[new ns,vf]]},{provide:wf,useClass:wf,deps:[]},zZ,{provide:Sg,useFactory:function(){return NX},deps:[]},{provide:xg,useFactory:function(){return PX},deps:[]},{provide:Uu,useFactory:function(n){return vM(n=n||"undefined"!=typeof $localize&&$localize.locale||_E),n},deps:[[new zd(Uu),new ns,new ul]]},{provide:tB,useValue:"USD"}];let kJ=(()=>{class n{constructor(t){}}return n.\u0275fac=function(t){return new(t||n)(Oe(ih))},n.\u0275mod=on({type:n}),n.\u0275inj=xt({providers:PJ}),n})(),GE=null;function qc(){return GE}const pn=new Ht("DocumentToken");let xf=(()=>{class n{historyGo(t){throw new Error("Not implemented")}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({factory:Fee,token:n,providedIn:"platform"}),n})();function Fee(){return Oe(VB)}let VB=(()=>{class n extends xf{constructor(t){super(),this._doc=t,this._init()}_init(){this.location=window.location,this._history=window.history}getBaseHrefFromDOM(){return qc().getBaseHref(this._doc)}onPopState(t){const i=qc().getGlobalEventTarget(this._doc,"window");return i.addEventListener("popstate",t,!1),()=>i.removeEventListener("popstate",t)}onHashChange(t){const i=qc().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){UB()?this._history.pushState(t,i,r):this.location.hash=r}replaceState(t,i,r){UB()?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)(Oe(pn))},n.\u0275prov=We({factory:Lee,token:n,providedIn:"platform"}),n})();function UB(){return!!window.history.pushState}function Lee(){return new VB(Oe(pn))}function xD(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}function zB(n){const e=n.match(/#|\?|$/),t=e&&e.index||n.length;return n.slice(0,t-("/"===n[t-1]?1:0))+n.slice(t)}function Hu(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:Bee,token:n,providedIn:"root"}),n})();function Bee(n){const e=Oe(pn).location;return new HB(Oe(xf),e&&e.origin||"")}const CD=new Ht("appBaseHref");let HB=(()=>{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 xD(this._baseHref,t)}path(t=!1){const i=this._platformLocation.pathname+Hu(this._platformLocation.search),r=this._platformLocation.hash;return r&&t?`${i}${r}`:i}pushState(t,i,r,s){const o=this.prepareExternalUrl(r+Hu(s));this._platformLocation.pushState(t,i,o)}replaceState(t,i,r,s){const o=this.prepareExternalUrl(r+Hu(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)(Oe(xf),Oe(CD,8))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),Pg=(()=>{class n{constructor(t,i){this._subject=new sn,this._urlChangeListeners=[],this._platformStrategy=t;const r=this._platformStrategy.getBaseHref();this._platformLocation=i,this._baseHref=zB(GB(r)),this._platformStrategy.onPopState(s=>{this._subject.emit({url:this.path(!0),pop:!0,state:s.state,type:s.type})})}path(t=!1){return this.normalize(this._platformStrategy.path(t))}getState(){return this._platformLocation.getState()}isCurrentPathEqualTo(t,i=""){return this.path()==this.normalize(t+Hu(i))}normalize(t){return n.stripTrailingSlash(function(n,e){return n&&e.startsWith(n)?e.substring(n.length):e}(this._baseHref,GB(t)))}prepareExternalUrl(t){return t&&"/"!==t[0]&&(t="/"+t),this._platformStrategy.prepareExternalUrl(t)}go(t,i="",r=null){this._platformStrategy.pushState(r,"",t,i),this._notifyUrlChangeListeners(this.prepareExternalUrl(t+Hu(i)),r)}replaceState(t,i="",r=null){this._platformStrategy.replaceState(r,"",t,i),this._notifyUrlChangeListeners(this.prepareExternalUrl(t+Hu(i)),r)}forward(){this._platformStrategy.forward()}back(){this._platformStrategy.back()}historyGo(t=0){var i,r;null===(r=(i=this._platformStrategy).historyGo)||void 0===r||r.call(i,t)}onUrlChange(t){this._urlChangeListeners.push(t),this._urlChangeSubscription||(this._urlChangeSubscription=this.subscribe(i=>{this._notifyUrlChangeListeners(i.url,i.state)}))}_notifyUrlChangeListeners(t="",i){this._urlChangeListeners.forEach(r=>r(t,i))}subscribe(t,i,r){return this._subject.subscribe({next:t,error:i,complete:r})}}return n.\u0275fac=function(t){return new(t||n)(Oe(Cf),Oe(xf))},n.normalizeQueryParams=Hu,n.joinWithSlash=xD,n.stripTrailingSlash=zB,n.\u0275prov=We({factory:Vee,token:n,providedIn:"root"}),n})();function Vee(){return new Pg(Oe(Cf),Oe(xf))}function GB(n){return n.replace(/\/index.html$/,"")}var _s=(()=>((_s=_s||{})[_s.Zero=0]="Zero",_s[_s.One=1]="One",_s[_s.Two=2]="Two",_s[_s.Few=3]="Few",_s[_s.Many=4]="Many",_s[_s.Other=5]="Other",_s))();const Yee=function(n){return function(n){const e=function(n){return n.toLowerCase().replace(/_/g,"-")}(n);let t=pL(e);if(t)return t;const i=e.split("-")[0];if(t=pL(i),t)return t;if("en"===i)return dK;throw new Error(`Missing locale data for the locale "${n}".`)}(n)[cn.PluralCase]};class eS{}let Ste=(()=>{class n extends eS{constructor(t){super(),this.locale=t}getPluralCategory(t,i){switch(Yee(i||this.locale)(t)){case _s.Zero:return"zero";case _s.One:return"one";case _s.Two:return"two";case _s.Few:return"few";case _s.Many:return"many";default:return"other"}}}return n.\u0275fac=function(t){return new(t||n)(Oe(Uu))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();class Cte{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 Af=(()=>{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 Cte(null,this._ngForOf,-1,-1),null===o?void 0:o),l=new ej(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 ej(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)(xe(Ns),xe(zo),xe(Sg))},n.\u0275dir=Rt({type:n,selectors:[["","ngFor","","ngForOf",""]],inputs:{ngForOf:"ngForOf",ngForTrackBy:"ngForTrackBy",ngForTemplate:"ngForTemplate"}}),n})();class ej{constructor(e,t){this.record=e,this.view=t}}let lc=(()=>{class n{constructor(t,i){this._viewContainer=t,this._context=new Tte,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){tj("ngIfThen",t),this._thenTemplateRef=t,this._thenViewRef=null,this._updateView()}set ngIfElse(t){tj("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)(xe(Ns),xe(zo))},n.\u0275dir=Rt({type:n,selectors:[["","ngIf",""]],inputs:{ngIf:"ngIf",ngIfThen:"ngIfThen",ngIfElse:"ngIfElse"}}),n})();class Tte{constructor(){this.$implicit=null,this.ngIf=null}}function tj(n,e){if(e&&!e.createEmbeddedView)throw new Error(`${n} must be a TemplateRef, but received '${rt(e)}'.`)}class Ote{createSubscription(e,t){return e.subscribe({next:t,error:i=>{throw i}})}dispose(e){e.unsubscribe()}onDestroy(e){e.unsubscribe()}}class Rte{createSubscription(e,t){return e.then(t,i=>{throw i})}dispose(e){}onDestroy(e){}}const Nte=new Rte,Pte=new Ote;let h0=(()=>{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(yg(t))return Nte;if(Tk(t))return Pte;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)(xe(Dr,16))},n.\u0275pipe=Vs({name:"async",type:n,pure:!1}),n})(),qr=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=on({type:n}),n.\u0275inj=xt({providers:[{provide:eS,useClass:Ste}]}),n})();const lj="browser";function Tf(n){return n===lj}class BD extends class extends class{}{constructor(){super(...arguments),this.supportsDOMEvents=!0}}{static makeCurrent(){!function(n){GE||(GE=n)}(new BD)}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=(f0=f0||document.querySelector("base"),f0?f0.getAttribute("href"):null);return null==t?null:function(n){nS=nS||document.createElement("a"),nS.setAttribute("href",n);const e=nS.pathname;return"/"===e.charAt(0)?e:`/${e}`}(t)}resetBaseElement(){f0=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 nS,f0=null;const hj=new Ht("TRANSITION_ID"),rne=[{provide:vf,useFactory:function(n,e,t){return()=>{t.get(Og).donePromise.then(()=>{const i=qc(),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},Qn.getAllAngularTestabilities=()=>e.getAllTestabilities(),Qn.getAllAngularRootElements=()=>e.getAllRootElements(),Qn.frameworkStabilizers||(Qn.frameworkStabilizers=[]),Qn.frameworkStabilizers.push(i=>{const r=Qn.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?qc().isShadowRoot(t)?this.findTestabilityInTree(e,t.host,!0):this.findTestabilityInTree(e,t.parentElement,!0):null}}let sne=(()=>{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 p0=new Ht("EventManagerPlugins");let rS=(()=>{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})(),g0=(()=>{class n extends pj{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(gj),this._hostNodes.delete(t)}onStylesAdded(t){this._hostNodes.forEach((i,r)=>{this._addStylesToHost(t,r,i)})}ngOnDestroy(){this._hostNodes.forEach(t=>t.forEach(gj))}}return n.\u0275fac=function(t){return new(t||n)(Oe(pn))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();function gj(n){qc().remove(n)}const UD={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/"},zD=/%COMP%/g;function sS(n,e,t){for(let i=0;i{if("__ngUnwrap__"===e)return n;!1===n(e)&&(e.preventDefault(),e.returnValue=!1)}}let oS=(()=>{class n{constructor(t,i,r){this.eventManager=t,this.sharedStylesHost=i,this.appId=r,this.rendererByCompId=new Map,this.defaultRenderer=new HD(t)}createRenderer(t,i){if(!t||!i)return this.defaultRenderer;switch(i.encapsulation){case Yt.Emulated:{let r=this.rendererByCompId.get(i.id);return r||(r=new vne(this.eventManager,this.sharedStylesHost,i,this.appId),this.rendererByCompId.set(i.id,r)),r.applyToHost(t),r}case 1:case Yt.ShadowDom:return new wne(this.eventManager,this.sharedStylesHost,t,i);default:if(!this.rendererByCompId.has(i.id)){const r=sS(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)(Oe(rS),Oe(g0),Oe(r0))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();class HD{constructor(e){this.eventManager=e,this.data=Object.create(null)}destroy(){}createElement(e,t){return t?document.createElementNS(UD[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=UD[r];s?e.setAttributeNS(s,t,i):e.setAttribute(t,i)}else e.setAttribute(t,i)}removeAttribute(e,t,i){if(i){const r=UD[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&(jo.DashCase|jo.Important)?e.style.setProperty(t,i,r&jo.Important?"important":""):e.style[t]=i}removeStyle(e,t,i){i&jo.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,yj(i)):this.eventManager.addEventListener(e,t,yj(i))}}class vne extends HD{constructor(e,t,i,r){super(e),this.component=i;const s=sS(r+"-"+i.id,i.styles,[]);t.addStyles(s),this.contentAttr=function(n){return"_ngcontent-%COMP%".replace(zD,n)}(r+"-"+i.id),this.hostAttr=function(n){return"_nghost-%COMP%".replace(zD,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 wne extends HD{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=sS(r.id,r.styles,[]);for(let o=0;o{class n extends VD{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)(Oe(pn))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const wj=["alt","control","meta","shift"],Dne={"\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"},Ej={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"},Ine={alt:n=>n.altKey,control:n=>n.ctrlKey,meta:n=>n.metaKey,shift:n=>n.shiftKey};let One=(()=>{class n extends VD{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(()=>qc().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(wj.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&&Ej.hasOwnProperty(e)&&(e=Ej[e]))}return Dne[e]||e}(t);return r=r.toLowerCase()," "===r?r="space":"."===r&&(r="dot"),wj.forEach(s=>{s!=r&&Ine[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)(Oe(pn))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),Mf=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({factory:function(){return Oe($D)},token:n,providedIn:"root"}),n})(),$D=(()=>{class n extends Mf{constructor(t){super(),this._doc=t}sanitize(t,i){if(null==i)return null;switch(t){case ni.NONE:return i;case ni.HTML:return ia(i,"HTML")?Gs(i):z_(this._doc,String(i)).toString();case ni.STYLE:return ia(i,"Style")?Gs(i):i;case ni.SCRIPT:if(ia(i,"Script"))return Gs(i);throw new Error("unsafe value used in a script context");case ni.URL:return Lc(i),ia(i,"URL")?Gs(i):Bo(String(i));case ni.RESOURCE_URL:if(ia(i,"ResourceURL"))return Gs(i);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(n){return new P_(n)}(t)}bypassSecurityTrustStyle(t){return function(n){return new F_(n)}(t)}bypassSecurityTrustScript(t){return function(n){return new Vp(n)}(t)}bypassSecurityTrustUrl(t){return function(n){return new $d(n)}(t)}bypassSecurityTrustResourceUrl(t){return function(n){return new Fn(n)}(t)}}return n.\u0275fac=function(t){return new(t||n)(Oe(pn))},n.\u0275prov=We({factory:function(){return function(n){return new $D(n.get(pn))}(Oe(Pu))},token:n,providedIn:"root"}),n})();const jne=uB(DJ,"browser",[{provide:Wc,useValue:lj},{provide:eB,useValue:function(){BD.makeCurrent(),jD.init()},multi:!0},{provide:pn,useFactory:function(){return function(n){Ki=n}(document),document},deps:[]}]),Vne=[[],{provide:Fu,useValue:"root"},{provide:oa,useFactory:function(){return new oa},deps:[]},{provide:p0,useClass:Ene,multi:!0,deps:[pn,gn,Wc]},{provide:p0,useClass:One,multi:!0,deps:[pn]},[],{provide:oS,useClass:oS,deps:[rS,g0,r0]},{provide:mf,useExisting:oS},{provide:pj,useExisting:g0},{provide:g0,useClass:g0,deps:[pn]},{provide:sD,useClass:sD,deps:[gn]},{provide:rS,useClass:rS,deps:[p0,gn]},{provide:class{},useClass:sne,deps:[]},[]];let WD=(()=>{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:r0,useValue:t.appId},{provide:hj,useExisting:r0},rne]}}}return n.\u0275fac=function(t){return new(t||n)(Oe(n,12))},n.\u0275mod=on({type:n}),n.\u0275inj=xt({providers:Vne,imports:[qr,kJ]}),n})();"undefined"!=typeof window&&window;class Yne extends x{constructor(e,t){super()}schedule(e,t=0){return this}}class aS extends Yne{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 xj=(()=>{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 uc extends xj{constructor(e,t=xj.now){super(e,()=>uc.delegate&&uc.delegate!==this?uc.delegate.now():t()),this.actions=[],this.active=!1,this.scheduled=void 0}schedule(e,t=0,i){return uc.delegate&&uc.delegate!==this?uc.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 Qne=new class extends uc{}(class extends aS{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)}}),Yc=new I(n=>n.complete());function lS(n){return n?function(n){return new I(e=>n.schedule(()=>e.complete()))}(n):Yc}function fn(...n){let e=n[n.length-1];return Ce(e)?(n.pop(),Ne(n,e)):On(n)}function Fg(n,e){return new I(e?t=>e.schedule(Jne,0,{error:n,subscriber:t}):t=>t.error(n))}function Jne({error:n,subscriber:e}){e.error(n)}class pa{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 fn(this.value);case"E":return Fg(this.error);case"C":return lS()}throw new Error("unexpected notification kind value")}static createNext(e){return void 0!==e?new pa("N",e):pa.undefinedValueNotification}static createError(e){return new pa("E",void 0,e)}static createComplete(){return pa.completeNotification}}pa.completeNotification=new pa("C"),pa.undefinedValueNotification=new pa("N",void 0);class cS 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(cS.dispatch,this.delay,new tie(e,this.destination)))}_next(e){this.scheduleMessage(pa.createNext(e))}_error(e){this.scheduleMessage(pa.createError(e)),this.unsubscribe()}_complete(){this.scheduleMessage(pa.createComplete()),this.unsubscribe()}}class tie{constructor(e,t){this.notification=e,this.destination=t}}class kg extends se{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 nie(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 $;if(this.isStopped||this.hasError?o=x.EMPTY:(this.observers.push(e),o=new Z(this,e)),r&&e.add(e=new cS(e,r)),t)for(let a=0;at&&(o=Math.max(o,s-t)),o>0&&r.splice(0,o),r}}class nie{constructor(e,t){this.time=e,this.value=t}}function Ir(n,e){return"function"==typeof e?t=>t.pipe(Ir((i,r)=>je(n(i,r)).pipe(me((s,o)=>e(i,s,r,o))))):t=>t.lift(new iie(n))}class iie{constructor(e){this.project=e}call(e,t){return t.subscribe(new rie(e,this.project))}}class rie extends ve{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 _t(this),r=this.destination;r.add(i),this.innerSubscription=N(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 uS={schedule(n,e){const t=setTimeout(n,e);return()=>clearTimeout(t)},scheduleBeforeRender(n){if("undefined"==typeof window)return uS.schedule(n,0);if(void 0===window.requestAnimationFrame)return uS.schedule(n,16);const e=window.requestAnimationFrame(n);return()=>window.cancelAnimationFrame(e)}};let YD;function pie(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(!YD){const t=Element.prototype;YD=t.matches||t.matchesSelector||t.mozMatchesSelector||t.msMatchesSelector||t.oMatchesSelector||t.webkitMatchesSelector}return n.nodeType===Node.ELEMENT_NODE&&YD.call(n,e)}(n,r)||(i=s,0))),i}class mie{constructor(e,t){this.componentFactory=t.get(wl).resolveComponentFactory(e)}create(e){return new _ie(this.componentFactory,e)}}class _ie{constructor(e,t){this.componentFactory=e,this.injector=t,this.eventEmitters=new kg(1),this.events=this.eventEmitters.pipe(Ir(i=>kn(...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(gn),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=uS.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=Wn.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=uS.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 o_(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 yie extends HTMLElement{constructor(){super(...arguments),this.ngElementEventsSubscription=null}}const vie={initialConfig:{},parse:{},rename:{}};class wie{constructor(e,t){this.configState=e,this.storedChanges={},this.options=Object.assign(Object.assign({},vie),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,u=null!==(s=o[e])&&void 0!==s?s:o[l];if(null==c)delete i[l];else if(u)try{i[l]=u(c)}catch(h){console.warn(`Failed to parse ${e} = ${c}`,h.message)}else i[l]=c}}let Eie=(()=>{class n{constructor(t,i,r={}){this.configState=t,this.cdr=i,this.options=r,this.initialized=!1,this.configManager=new wie(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=Rt({type:n,features:[Ui]}),n})();var KD;const m0={production:!0,disableDbWorker:!0,acceptableViewerDomains:["https://portal.hubmapconsortium.org","https://portal.test.hubmapconsortium.org"],dbOptions:{ccfOwlUrl:"https://ccf-api.hubmapconsortium.org/v1/ccf.owl.n3store.json",ccfContextUrl:"https://hubmapconsortium.github.io/ccf-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/v3/entities/search",hubmapAssetsUrl:"https://assets.hubmapconsortium.org",hubmapToken:null!==(KD=localStorage.getItem("HUBMAP_TOKEN"))&&void 0!==KD?KD:""},googleAnalyticsToken:"portal.hubmapconsortium.org"===window.location.hostname?"G-1WRJHN9FM6":"G-J9HWV9QPJ4"};function rr(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 Aj(n,e){return function(t,i){e(t,i,n)}}function dc(n,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(n,e)}function Fi(n,e,t,i){return new(t||(t=Promise))(function(s,o){function a(u){try{c(i.next(u))}catch(h){o(h)}}function l(u){try{c(i.throw(u))}catch(h){o(h)}}function c(u){u.done?s(u.value):function(s){return s instanceof t?s:new t(function(o){o(s)})}(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})}function Dj(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 QD(){return!("object"==typeof process&&"[object process]"===String(process)&&!process.browser)||Dj()}const Ij="undefined"!=typeof __VERSION__?__VERSION__:"untranspiled source",hS=QD();class Aie{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 ZD(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 Oj={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 Rj(n){return"string"==typeof n?Oj[n.toUpperCase()]||Oj.WHITE:n}function fS(n,e){if(!n)throw new Error(e||"Assertion failed")}const hc={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},_0=hc.window||hc.self||hc.global,Nj=hc.process||{};function Lg(){let n;if(hS&&_0.performance)n=_0.performance.now();else if(Nj.hrtime){const e=Nj.hrtime();n=1e3*e[0]+e[1]/1e6}else n=Date.now();return n}console;const Bg={debug:hS&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},Nie={enabled:!0,level:0};function Tl(){}const Pj={},Fj={once:!0};function Pie(n){for(const e in n)for(const t in n[e])return t||"untitled";return"empty"}let JD=(()=>{class n{constructor({id:t}={id:""}){this.id=t,this.VERSION=Ij,this._startTs=Lg(),this._deltaTs=Lg(),this.LOG_THROTTLE_TIMEOUT=0,this._storage=new Aie("__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((Lg()-this._startTs).toPrecision(10))}getDelta(){return Number((Lg()-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){fS(t,i)}warn(t){return this._getLogFunction(0,t,Bg.warn,arguments,Fj)}error(t){return this._getLogFunction(0,t,Bg.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,Bg.log,arguments,{time:!0,once:!0})}log(t,i){return this._getLogFunction(t,i,Bg.debug,arguments)}info(t,i){return this._getLogFunction(t,i,console.info,arguments)}once(t,i){return this._getLogFunction(t,i,Bg.debug||Bg.info,arguments,Fj)}table(t,i,r){return i?this._getLogFunction(t,i,console.table||Tl,r&&[r],{tag:Pie(i)}):Tl}image({logLevel:t,priority:i,image:r,message:s="",scale:o=1}){return this._shouldLog(t||i)?hS?function({image:n,message:e="",scale:t=1}){if("string"==typeof n){const r=new Image;return r.onload=()=>{const s=ZD(r,e,t);console.log(...s)},r.src=n,Tl}const i=n.nodeName||"";if("img"===i.toLowerCase())return console.log(...ZD(n,e,t)),Tl;if("canvas"===i.toLowerCase()){const r=new Image;return r.onload=()=>console.log(...ZD(r,e,t)),r.src=n.toDataURL(),Tl}return Tl}({image:r,message:s,scale:o}):function({image:n,message:e="",scale:t=1}){let i=null;try{i=Je(307)}catch(r){}return i?()=>i(n,{fit:"box",width:"".concat(Math.round(80*t),"%")}).then(r=>console.log(r)):Tl}({image:r,message:s,scale:o}):Tl}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||Tl)}group(t,i,r={collapsed:!1}){r=Lj({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||Tl)}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()>=kj(t)}_getLogFunction(t,i,r,s=[],o){if(this._shouldLog(t)){o=Lj({logLevel:t,message:i,args:s,opts:o}),fS(r=r||o.method),o.total=this.getTotal(),o.delta=this.getDelta(),this._deltaTs=Lg();const a=o.tag||o.message;if(o.once){if(Pj[a])return Tl;Pj[a]=Lg()}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!hS&&"string"==typeof n&&(e&&(e=Rj(e),n="\x1b[".concat(e,"m").concat(n,"\x1b[39m")),t&&(e=Rj(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 Tl}}return n.VERSION=Ij,n})();function kj(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 fS(Number.isFinite(e)&&e>=0),e}function Lj(n){const{logLevel:e,message:t}=n;n.logLevel=kj(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 fS("string"===r||"object"===r),Object.assign(n,n.opts)}const Ri=new JD({id:"deck"}),ji={DEFAULT:-1,LNGLAT:1,METER_OFFSETS:2,LNGLAT_OFFSETS:3,CARTESIAN:0};Object.defineProperty(ji,"IDENTITY",{get:()=>Ri.deprecated("COORDINATE_SYSTEM.IDENTITY","COORDINATE_SYSTEM.CARTESIAN")()||0});const Kc={WEB_MERCATOR:1,GLOBE:2,WEB_MERCATOR_AUTO_OFFSET:4,IDENTITY:0},Bj={click:{handler:"onClick"},panstart:{handler:"onDragStart"},panmove:{handler:"onDrag"},panend:{handler:"onDragEnd"}},mn=new JD({id:"luma.gl"});function $o(n,e){if(!n)throw new Error(e||"luma.gl: assertion failed.")}function pS(n){return"undefined"!=typeof WebGLRenderingContext&&n instanceof WebGLRenderingContext||"undefined"!=typeof WebGL2RenderingContext&&n instanceof WebGL2RenderingContext||Boolean(n&&Number.isFinite(n._version))}function Si(n){return"undefined"!=typeof WebGL2RenderingContext&&n instanceof WebGL2RenderingContext||Boolean(n&&2===n._version)}function gS(n){return $o(pS(n),"Invalid WebGLRenderingContext"),n}function Co(n){return $o(Si(n),"Requires WebGL2"),n}const y0={};const b0=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{globalThis.console&&globalThis.console.log&&globalThis.console.log("OESVertexArrayObject emulation library context restored"),t.reset_()},!0),this.reset_()};Df.prototype.VERTEX_ARRAY_BINDING_OES=34229,Df.prototype.reset_=function(){if(void 0!==this.vertexArrayObjects)for(let i=0;iSi(n)?void 0:0,tre={3074:n=>Si(n)?void 0:36064,35723:n=>Si(n)?void 0:4352,35977:br,32937:br,36795:(n,e)=>{const t=Si(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(Uj);return e(t&&t.UNMASKED_VENDOR_WEBGL||7936)},37446:(n,e)=>{const t=n.getExtension(Uj);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:br,35071:br,37447:br,36063:(n,e)=>{if(!Si(n)){const t=n.getExtension(Vj);return t?e(t.MAX_COLOR_ATTACHMENTS_WEBGL):0}},35379:br,35374:br,35377:br,34852:n=>{if(!Si(n)){const e=n.getExtension(Vj);return e?e.MAX_DRAW_BUFFERS_WEBGL:0}},36203:n=>n.getExtension(jj)?2147483647:65535,33001:n=>n.getExtension(jj)?16777216:65535,33e3:n=>16777216,37157:br,35373:br,35657:br,36183:br,37137:br,34045:br,35978:br,35979:br,35968:br,35376:br,35375:br,35659:br,37154:br,35371:br,35658:br,35076:br,35077:br,35380:br},zj="ANGLE_instanced_arrays",Hj={OES_vertex_array_object:{meta:{suffix:"OES"},createVertexArray:()=>{$o(!1,"VertexArray requires WebGL2 or OES_vertex_array_object extension")},deleteVertexArray:()=>{},bindVertexArray:()=>{},isVertexArray:()=>!1},[zj]:{meta:{suffix:"ANGLE"},vertexAttribDivisor(n,e){$o(0===e,"WebGL instanced rendering not supported")},drawElementsInstanced:()=>{},drawArraysInstanced:()=>{}},WEBGL_draw_buffers:{meta:{suffix:"WEBGL"},drawBuffers:()=>{$o(!1)}},EXT_disjoint_timer_query:{meta:{suffix:"EXT"},createQuery:()=>{$o(!1)},deleteQuery:()=>{$o(!1)},beginQuery:()=>{$o(!1)},endQuery:()=>{},getQuery(n,e){return this.getQueryObject(n,e)},getQueryParameter(n,e){return this.getQueryObject(n,e)},getQueryObject:()=>{}}},eI={readBuffer:(n,e,t)=>{Si(n)&&e(t)},getVertexAttrib:(n,e,t,i)=>{const{webgl2:r,ext:s}=function(n,e){return{webgl2:Si(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(!Si(n))switch(i){case 35967:return 35981;case 35971:case 35382:return 0}return e(t,i)},getInternalformatParameter:(n,e,t,i,r)=>{if(!Si(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=tre[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 fre(n,{extension:e,target:t,target2:i}){const r=Hj[e];$o(r);const{meta:s={}}=r,{suffix:o=""}=s,a=n.getExtension(e);for(const l of Object.keys(r)){const c=`${l}${o}`;let u=null;"meta"===l||"function"==typeof n[l]||(a&&"function"==typeof a[c]?u=(...h)=>a[c](...h):"function"==typeof r[l]&&(u=r[l].bind(t))),u&&(t[l]=u,i[l]=u)}}globalThis.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 Df(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&&fre(n,{extension:t,target:n.luma,target2:n})}(n,Hj),function(n,{target:e,target2:t}){Object.keys(eI).forEach(i=>{if("function"==typeof eI[i]){const r=n[i]?n[i].bind(n):()=>{},s=eI[i].bind(null,n,r);e[i]=s,t[i]=s}})}(n,{target:e,target2:n}),e.polyfilled=!0),n};const tI={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},oh=(n,e,t)=>e?n.enable(t):n.disable(t),Gj=(n,e,t)=>n.hint(t,e),ja=(n,e,t)=>n.pixelStorei(t,e);function v0(n){return Array.isArray(n)||ArrayBuffer.isView(n)}const mre={3042:oh,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:oh,2885:(n,e)=>n.cullFace(e),2929:oh,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:oh,35723:Gj,36006:(n,e)=>{const t=Si(n)?36009:36160;return n.bindFramebuffer(t,e)},2886:(n,e)=>n.frontFace(e),33170:Gj,2849:(n,e)=>n.lineWidth(e),32823:oh,32824:"polygonOffset",10752:"polygonOffset",35977:oh,32938:"sampleCoverage",32939:"sampleCoverage",3089:oh,3088:(n,e)=>n.scissor(...e),2960:oh,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:ja,3317:ja,37440:ja,37441:ja,37443:ja,3330:ja,3332:ja,3331:ja,36010:(n,e)=>n.bindFramebuffer(36008,e),3314:ja,32878:ja,3316:ja,3315:ja,32877:ja,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=v0(e)?e:[e,e],n.blendEquationSeparate(...e)},blendFunc:(n,e)=>{e=v0(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=v0(e)?e:[e,e];const[t,i]=e;n.stencilMaskSeparate(1028,t),n.stencilMaskSeparate(1029,i)},stencilFunc:(n,e)=>{e=v0(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=v0(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 os(n,e,t){return void 0!==e[n]?e[n]:t[n]}const _re={blendEquation:(n,e,t)=>n.blendEquationSeparate(os(32777,e,t),os(34877,e,t)),blendFunc:(n,e,t)=>n.blendFuncSeparate(os(32969,e,t),os(32968,e,t),os(32971,e,t),os(32970,e,t)),polygonOffset:(n,e,t)=>n.polygonOffset(os(32824,e,t),os(10752,e,t)),sampleCoverage:(n,e,t)=>n.sampleCoverage(os(32938,e,t),os(32939,e,t)),stencilFuncFront:(n,e,t)=>n.stencilFuncSeparate(1028,os(2962,e,t),os(2967,e,t),os(2963,e,t)),stencilFuncBack:(n,e,t)=>n.stencilFuncSeparate(1029,os(34816,e,t),os(36003,e,t),os(36004,e,t)),stencilOpFront:(n,e,t)=>n.stencilOpSeparate(1028,os(2964,e,t),os(2965,e,t),os(2966,e,t)),stencilOpBack:(n,e,t)=>n.stencilOpSeparate(1029,os(34817,e,t),os(34818,e,t),os(34819,e,t))},$j={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]})},Xc=(n,e)=>n.isEnabled(e),Wj={3042:Xc,2884:Xc,2929:Xc,3024:Xc,32823:Xc,32926:Xc,32928:Xc,3089:Xc,2960:Xc,35977:Xc};function qj(n){for(const e in n)return!1;return!0}function yre(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||tI)){const r=e,s=Wj[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=Wj[r];i[r]=s?s(n,Number(r)):n.getParameter(Number(r))}return i}(e):Object.assign({},tI),this.log=i,this._updateCache=this._updateCache.bind(this),Object.seal(this)}push(e={}){this.stateStack.push({})}pop(){$o(this.stateStack.length>0),$u(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){$o(void 0!==s);const o=e[s],a=this.cache[s];yre(o,a)||(t=!0,i=a,r&&!(s in r)&&(r[s]=a),this.cache[s]=o)}return{valueChanged:t,oldValue:i}}}function Kj(n,e={}){const{enable:t=!0,copyState:i}=e;if($o(void 0!==i),!n.state){const{polyfillContext:r}=globalThis;r&&r(n),n.state=new wre(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 s in $j)bre(n,s,$j[s]);Yj(n,"getParameter"),Yj(n,"isEnabled")}return n.state.enable=t,n}function Xj(n){$o(n.state),n.state.pop()}function $u(n,e){if($o(pS(n),"setParameters requires a WebGL context"),qj(e))return;const t={};for(const r in e){const s=Number(r),o=mre[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)_re[r](n,e,i)}function fc(n,e,t){if(qj(e))return t(n);const{nocatch:i=!0}=e;let r;if(function(n){n.state||Kj(n,{copyState:!1}),n.state.push()}(n),$u(n,e),i)r=t(n),Xj(n);else try{r=t(n)}finally{Xj(n)}return r}function mS(){return!("object"==typeof process&&"[object process]"===String(process)&&!process.browser)||function(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;return!!(e&&e.indexOf("Electron")>=0)}()}function jg(n){const{luma:e}=n;if(n.canvas&&e){const{clientWidth:t}=e.canvasSizeInfo;return t?n.drawingBufferWidth/t:1}return 1}function nI(n,e,t=!0){return function(n,e,t,i,r){const s=Qj(n[0],e,t);let o=Zj(n[1],e,i,r),a=Qj(n[0]+1,e,t);const l=a===t-1?a:a-1;let c;return a=Zj(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,jg(n),n.drawingBufferWidth,n.drawingBufferHeight,t)}function Qj(n,e,t){return Math.min(Math.round(n*e),t-1)}function Zj(n,e,t,i){return i?Math.max(0,t-1-Math.round(n*e)):Math.min(Math.round(n*e),t-1)}const iI=mS(),Mre=iI&&"undefined"!=typeof document,Jj={webgl2:!0,webgl1:!0,throwOnError:!0,manageState:!0,canvas:null,debug:!1,width:800,height:600};function eV(n={}){$o(iI,"createGLContext only available in the browser.\nCreate your own headless context or use 'createHeadlessContext' from @luma.gl/test-utils"),n=Object.assign({},Jj,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?(Mre&&"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=rI(r,n),function(n){const e=Si(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);mn.info(1,`${e}${n.debug?" debug":""} context ${t?`(${t.vendor},${t.renderer})`:""}`)()}(r),r):null}function rI(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({},Jj,e);const{manageState:t,debug:i}=e;return t&&Kj(n,{copyState:!1,log:(...r)=>mn.log(1,...r)()}),iI&&i&&(globalThis.makeDebugContext?(n=globalThis.makeDebugContext(n,e),mn.level=Math.max(mn.level,1)):mn.warn('WebGL debug mode not activated. import "@luma.gl/debug" to enable.')()),n._instrumented=!0,n}function tV(){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 nV{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=tV(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(tV()-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 sI{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 nV?e:new nV(t,i)),this.stats[t]}}const w0="8.5.12",If=new class{constructor(){this.stats=new Map}get(e){return this.stats.has(e)||this.stats.set(e,new sI({id:e})),this.stats.get(e)}};if(globalThis.luma&&globalThis.luma.VERSION!==w0)throw new Error(`luma.gl - multiple VERSIONs detected: ${globalThis.luma.VERSION} vs ${w0}`);function tn(n,e){if(!n)throw new Error(e||"luma.gl: assertion failed.")}function oI(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 ah(n,e){e=Number(e);for(const t in n)if(n[t]===e)return`GL.${t}`;return String(e)}globalThis.luma||(mS()&&mn.log(1,`luma.gl ${w0} - set luma.log.level=1 (or higher) to trace rendering`)(),globalThis.luma=globalThis.luma||{VERSION:w0,version:w0,log:mn,stats:If,globals:{modules:{},nodeIO:{}}}),globalThis;const aI={};function ga(n="id"){return aI[n]=aI[n]||1,`${n}-${aI[n]++}`}function iV(n){return tn("number"==typeof n,"Input must be a number"),n&&0==(n&n-1)}function Vg(n){let e=!0;for(const t in n){e=!1;break}return e}function rV(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 mn.removed(`Calling removed method ${e}.${o}: `,r)(),new Error(o)})})}const Ug="Resource subclass must define virtual methods";class Wu{get[Symbol.toStringTag](){return"Resource"}constructor(e,t={}){gS(e);const{id:i,userData:r={}}=t;this.gl=e,this.gl2=e,this.id=i||ga(this[Symbol.toStringTag]),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[Symbol.toStringTag]||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=oI(this.gl,e));const r=(this.constructor.PARAMETERS||{})[e];if(r){const s=Si(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=Si(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 h=i?ah(this.gl,l):l;o[h]=this.getParameter(l,e),i&&"GLenum"===c.type&&(o[h]=ah(this.gl,o[h]))}}return o}setParameter(e,t){tn(e=oI(this.gl,e));const r=(this.constructor.PARAMETERS||{})[e];if(r){const s=Si(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=oI(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 rV(this,e,t,i)}initialize(e){}_createHandle(){throw new Error(Ug)}_deleteHandle(){throw new Error(Ug)}_bindHandle(e){throw new Error(Ug)}_getOptsFromHandle(){throw new Error(Ug)}_getParameter(e,t){throw new Error(Ug)}_setParameter(e,t){throw new Error(Ug)}_context(){return this.gl.luma=this.gl.luma||{},this.gl.luma}_addStats(){const e=this[Symbol.toStringTag],t=If.get("Resource Counts");t.get("Resources Created").incrementCount(),t.get(`${e}s Created`).incrementCount(),t.get(`${e}s Active`).incrementCount()}_removeStats(){const e=this[Symbol.toStringTag];If.get("Resource Counts").get(`${e}s Active`).decrementCount()}_trackAllocatedMemory(e,t=this[Symbol.toStringTag]){const i=If.get("Memory Usage");i.get("GPU Memory").addCount(e),i.get(`${t} Memory`).addCount(e),this.byteLength=e}_trackDeallocatedMemory(e=this[Symbol.toStringTag]){const t=If.get("Memory Usage");t.get("GPU Memory").subtractCount(this.byteLength),t.get(`${e} Memory`).subtractCount(this.byteLength),this.byteLength=0}}function lI(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 E0(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 Vre({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 ma.getBytesPerElement(this)}get BYTES_PER_VERTEX(){return ma.getBytesPerVertex(this)}_assign(e={}){return void 0!==(e=cI("Accessor",e,zre)).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 oV={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:oV},Gre={removedProps:oV};class hr extends Wu{get[Symbol.toStringTag](){return"Buffer"}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/ma.getBytesPerElement(e))}getVertexCount(e=this.accessor){return Math.round(this.byteLength/ma.getBytesPerVertex(e))}initialize(e={}){return ArrayBuffer.isView(e)&&(e={data:e}),Number.isFinite(e)&&(e={byteLength:e}),e=cI("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=cI("Buffer",e,Gre))&&this.setAccessor(e.accessor),this}setAccessor(e){return delete(e=Object.assign({},e)).buffer,this.accessor=new ma(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?(Co(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 Co(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}={}){Co(this.gl);const s=E0(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 u=Math.min(o,l);return tn((r=r||u)<=u),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=lI(e);return tn(s),this.setAccessor(new ma(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/E0(this.accessor.type||5126,{clamped:!1}).BYTES_PER_ELEMENT;return this.getElementCount()-i}_inferType(e){this.accessor.type||this.setAccessor(new ma(this.accessor,{type:lI(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 mn.deprecated("Buffer.type","Buffer.accessor.type")(),this.accessor.type}get bytes(){return mn.deprecated("Buffer.bytes","Buffer.byteLength")(),this.byteLength}setByteLength(e){return mn.deprecated("setByteLength","reallocate")(),this.reallocate(e)}updateAccessor(e){return mn.deprecated("updateAccessor(...)","setAccessor(new Accessor(buffer.accessor, ...)")(),this.accessor=new ma(this.accessor,e),this}}const uI={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}},aV={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},lV={5126:4,5125:4,5124:4,5123:2,5122:2,5131:2,5120:1,5121:1},qre=[9729,9728],cV=globalThis.WebGLBuffer||function(){};class Of extends Wu{get[Symbol.toStringTag](){return"Texture"}static isSupported(e,t={}){const{format:i,linearFiltering:r}=t;let s=!0;return i&&(s=s&&function(n,e){const t=uI[e];if(!t)return!1;if(void 0===t.gl1&&void 0===t.gl2)return!0;const i=Si(n)&&t.gl2||t.gl1;return"string"==typeof i?n.getExtension(i):i}(e,i),s=s&&(!r||function(n,e){const t=uI[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=ga("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(U=>this.initialize(Object.assign({},e,{pixels:U,data:U}))),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:u}=e;t||(t=r);let{width:h,height:p,dataFormat:g,type:m,compressed:w=!1,mipmaps:C=!0}=e;const{depth:H=0}=e;return({width:h,height:p,compressed:w,dataFormat:g,type:m}=this._deduceParameters({format:s,type:m,dataFormat:g,compressed:w,data:t,width:h,height:p})),this.width=h,this.height=p,this.depth=H,this.format=s,this.type=m,this.dataFormat=g,this.border=o,this.textureUnit=u,Number.isFinite(this.textureUnit)&&(this.gl.activeTexture(33984+this.textureUnit),this.gl.bindTexture(this.target,this.handle)),C&&this._isNPOT()&&(mn.warn(`texture: ${this} is Non-Power-Of-Two, disabling mipmaping`)(),C=!1,this._updateForNPOT(l)),this.mipmaps=C,this.setImageData({data:t,width:h,height:p,depth:H,format:s,type:m,dataFormat:g,border:o,mipmaps:C,parameters:c,compressed:w}),C&&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:u=this.type,width:h=this.width,height:p=this.height,dataFormat:g=this.dataFormat,compressed:m=!1}=e;c||(c=i),({type:u,dataFormat:g,compressed:m,width:h,height:p}=this._deduceParameters({format:s,type:u,dataFormat:g,compressed:m,data:c,width:h,height:p}));const{gl:w}=this;w.bindTexture(this.target,this.handle);let C=null;({data:c,dataType:C}=this._getDataType({data:c,compressed:m}));let H,U=0;return fc(this.gl,l,()=>{switch(C){case"null":w.texImage2D(t,r,s,h,p,o,g,u,c);break;case"typed-array":w.texImage2D(t,r,s,h,p,o,g,u,c,a);break;case"buffer":H=Co(w),H.bindBuffer(35052,c.handle||c),H.texImage2D(t,r,s,h,p,o,g,u,a),H.bindBuffer(35052,null);break;case"browser-object":Si(w)?w.texImage2D(t,r,s,h,p,o,g,u,c):w.texImage2D(t,r,s,g,u,c);break;case"compressed":for(const[de,Ae]of c.entries())w.compressedTexImage2D(t,de,Ae.format,Ae.width,Ae.height,o,Ae.data),U+=Ae.levelSize;break;default:tn(!1,"Unknown image data type")}}),this._trackAllocatedMemory("compressed"===C?U:c&&c.byteLength?c.byteLength:this.width*this.height*(aV[this.dataFormat]||4)*(lV[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:u=this.type,dataFormat:h=this.dataFormat,compressed:p=!1,offset:g=0,border:m=this.border,parameters:w={}}){if(({type:u,dataFormat:h,compressed:p,width:o,height:a}=this._deduceParameters({format:c,type:u,dataFormat:h,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 C=i;i=C.data,o=C.shape[0],a=C.shape[1]}i instanceof hr&&(i=i.handle),this.gl.bindTexture(this.target,this.handle),fc(this.gl,w,()=>{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,h,u,null);else if(ArrayBuffer.isView(i))this.gl.texSubImage2D(e,l,r,s,o,a,h,u,i,g);else if(i instanceof cV){const C=Co(this.gl);C.bindBuffer(35052,i),C.texSubImage2D(e,l,r,s,o,a,h,u,g),C.bindBuffer(35052,null)}else Si(this.gl)?Co(this.gl).texSubImage2D(e,l,r,s,o,a,h,u,i):this.gl.texSubImage2D(e,l,r,s,h,u,i)}),this.gl.bindTexture(this.target,null)}copyFramebuffer(e={}){return mn.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 hr?{data:e.handle,dataType:"buffer"}:e instanceof cV?{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=uI[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!(Si(this.gl)||!this.width||!this.height||iV(this.width)&&iV(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===qre.indexOf(t)&&(t=9729);break;case 10242:case 10243:33071!==t&&(t=33071)}return t}}function Yre(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 _a extends Of{get[Symbol.toStringTag](){return"Texture2D"}static isSupported(e,t){return Of.isSupported(e,t)}constructor(e,t={}){gS(e),(t instanceof Promise||"string"==typeof t)&&(t={data:t}),"string"==typeof t.data&&(t=Object.assign({},t,{data:Yre(t.data)})),super(e,Object.assign({},t,{target:3553})),this.initialize(t),Object.seal(this)}}const Rf="EXT_color_buffer_float",uV={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:Rf,bpp:2},33327:{gl2:Rf,bpp:4},34842:{gl2:Rf,bpp:8},33326:{gl2:Rf,bpp:4},33328:{gl2:Rf,bpp:8},34836:{gl2:Rf,bpp:16},35898:{gl2:Rf,bpp:4}};class zg extends Wu{get[Symbol.toStringTag](){return"Renderbuffer"}static isSupported(e,{format:t}={format:null}){return!t||function(n,e,t){const i=t[e];if(!i)return!1;const r=Si(n)&&i.gl2||i.gl1;return"string"==typeof r?n.getExtension(r):r}(e,t,uV)}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&&Si(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)*uV[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 gV="clear: bad arguments";function hI(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,gV),fc(n,s,()=>{n.clear(o)})}function mV(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 oi(n){return function(){var e=this,t=arguments;return new Promise(function(i,r){var s=n.apply(e,t);function o(l){mV(s,i,r,o,a,"next",l)}function a(l){mV(s,i,r,o,a,"throw",l)}o(void 0)})}}const fI=[34069,34070,34071,34072,34073,34074];let tse=(()=>{class n extends Of{get[Symbol.toStringTag](){return"TextureCube"}constructor(t,i={}){gS(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 oi(function*(){const{gl:u}=c,h=r||s,p=yield Promise.all(fI.map(g=>{const m=h[g];return Promise.all(Array.isArray(m)?m:[m])}));c.bind(),fI.forEach((g,m)=>{p[m].length>1&&!1!==c.opts.mipmaps&&mn.warn(`${c.id} has mipmap and multiple LODs.`)(),p[m].forEach((w,C)=>{t&&i?u.texImage2D(g,C,a,t,i,o,a,l,w):u.texImage2D(g,C,a,a,l,w)})}),c.unbind()})()}setImageDataForFace(t){const{face:i,width:r,height:s,pixels:o,data:a,border:l=0,format:c=6408,type:u=5121}=t,{gl:h}=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?h.texImage2D(i,0,c,r,s,l,c,u,p):h.texImage2D(i,0,c,c,u,p),this}}return n.FACES=fI,n})();class nse extends Of{get[Symbol.toStringTag](){return"Texture3D"}static isSupported(e){return Si(e)}constructor(e,t={}){Co(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:u,parameters:h={}}){return this._trackDeallocatedMemory("Texture"),this.gl.bindTexture(this.target,this.handle),fc(this.gl,h,()=>{ArrayBuffer.isView(u)&&this.gl.texImage3D(this.target,e,t,i,r,s,o,a,l,u),u instanceof hr&&(this.gl.bindBuffer(35052,u.handle),this.gl.texImage3D(this.target,e,t,i,r,s,o,a,l,c))}),this._trackAllocatedMemory(u&&u.byteLength?u.byteLength:this.width*this.height*this.depth*(aV[this.dataFormat]||4)*(lV[this.type]||1),"Texture"),this.loaded=!0,this}}function _V(n,e){tn(n instanceof _a||n instanceof tse||n instanceof nse);const t=n.constructor,{gl:i,width:r,height:s,format:o,type:a,dataFormat:l,border:c,mipmaps:u}=n;return new t(i,Object.assign({width:r,height:s,format:o,type:a,dataFormat:l,border:c,mipmaps:u},e))}function ise(n,e){const{gl:t,width:i,height:r,id:s}=n;return new Fs(t,Object.assign({},e,{id:`framebuffer-for-${s}`,width:i,height:r,attachments:{36064:n}}))}function _S(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:u,deleteFramebuffer:h}=S0(n);tn(u);const{gl:p,handle:g,attachments:m}=u;a=a||u.width,l=l||u.height,36064===s&&null===g&&(s=1028),tn(m[s]),c=c||m[s].type,o=function(n,e,t,i,r){if(n)return n;return new(E0(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||lI(o);const w=p.bindFramebuffer(36160,g);return p.readPixels(t,i,a,l,r,c,o),p.bindFramebuffer(36160,w||null),h&&u.delete(),o}function pI(n,{sourceAttachment:e=36064,targetMaxHeight:t=Number.MAX_SAFE_INTEGER}={}){let i=_S(n,{sourceAttachment:e}),{width:r,height:s}=n;for(;s>t;)({data:i,width:r,height:s}=Vre({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 u in i){const h=i[u];(Array.isArray(h)?h[0]:h).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&&mn.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 zg)this._attachRenderbuffer({attachment:a,renderbuffer:c});else if(Array.isArray(l)){const[u,h=0,p=0]=l;c=u,this._attachTexture({attachment:a,texture:u,layer:h,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(Fs.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)&&hI(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]}={}){Co(n),fc(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,gV)}})}(this.gl,{drawBuffer:l,value:a})}),this.gl.bindFramebuffer(36160,o||null),this}readPixels(e={}){return mn.error("Framebuffer.readPixels() is no logner supported, use readPixelsToArray(framebuffer)")(),null}readPixelsToBuffer(e={}){return mn.error("Framebuffer.readPixelsToBuffer()is no logner supported, use readPixelsToBuffer(framebuffer)")(),null}copyToDataUrl(e={}){return mn.error("Framebuffer.copyToDataUrl() is no logner supported, use copyToDataUrl(framebuffer)")(),null}copyToImage(e={}){return mn.error("Framebuffer.copyToImage() is no logner supported, use copyToImage(framebuffer)")(),null}copyToTexture(e={}){return mn.error("Framebuffer.copyToTexture({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null}blit(e={}){return mn.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=Co(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=ah(this.gl,r)),r}getAttachmentParameters(e=36064,t,i=this.constructor.ATTACHMENT_PARAMETERS||[]){const r={};for(const s of i)r[t?ah(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?ah(this.gl,s):s]=this.getAttachmentParameters(s,e)}return i}show(){return"undefined"!=typeof window&&window.open(pI(this),"luma-debug-texture"),this}log(e=0,t=""){if(e>mn.level||"undefined"==typeof window)return this;t=t||`Framebuffer ${this.id}`;const i=pI(this,{targetMaxHeight:100});return mn.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 _a(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 zg(this.gl,{id:`${this.id}-depth-stencil`,format:35056,width:r,height:111}),this.ownResources.push(o[33306])):t?(o=o||{},o[36096]=new zg(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 zg?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:Co(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 Si(n)?n:null}(this.gl);t?t.readBuffer(e):tn(36064===e||1029===e,yV),this.readBuffer=e}_setDrawBuffers(e){const{gl:t}=this,i=Co(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]),yV)}this.drawBuffers=e}_getAttachmentParameterFallback(e){const t=function(n){n.luma=n.luma||{},n.luma.caps=n.luma.caps||{};for(const e in bV)void 0===n.luma.caps[e]&&(n.luma.caps[e]=wV(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)}}Fs.ATTACHMENT_PARAMETERS=[36049,36048,33296,33298,33299,33300,33301,33302,33303];const bV={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 _a(n,{format:6408,type:5126,dataFormat:6408}),t=new Fs(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 gI(n,e){return vV(n,e)}function vV(n,e){return(e=Array.isArray(e)?e:[e]).every(t=>wV(n,t))}function wV(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=bV[e];let i;tn(t,e);const r=Si(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]||mn.log(2,`Feature: ${e} not supported`)(),n.luma.caps[e]}class mI{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()}},gse=1/Math.PI*180,mse=1/180*Math.PI,Or={};function yse(n,{precision:e=Or.precision||4}={}){return n=function(n){return Math.round(n/Or.EPSILON)*Or.EPSILON}(n),`${parseFloat(n.toPrecision(e))}`}function lh(n){return Array.isArray(n)||ArrayBuffer.isView(n)&&!(n instanceof DataView)}function qu(n,e,t){if(lh(n)){t=t||function(n){return n.clone?n.clone():new Array(n.length)}(n);for(let i=0;it*mse,void 0)}(n)}function vse(n){return function(n,e){return qu(n,t=>t*gse,void 0)}(n)}function Va(n,e,t){return qu(n,i=>Math.max(e,Math.min(t,i)))}function yS(n,e,t){return lh(n)?n.map((i,r)=>yS(i,e[r],t)):t*e+(1-t)*n}function C0(n,e,t){const i=Or.EPSILON;t&&(Or.EPSILON=t);try{if(n===e)return!0;if(lh(n)&&lh(e)){if(n.length!==e.length)return!1;for(let r=0;r0?", ":"")+yse(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&&(LV.length=n.length,i=LV):i=kV,(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 BV(n){return n&&n[Symbol.asyncIterator]}function EI(n,e=(()=>!0)){return Array.isArray(n)?jV(n,e,[]):e(n)?[n]:[]}function jV(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 VV(n,e){return n?(Number.isFinite(n)&&(n={duration:n}),n.type=n.type||"interpolation",ot(ot(ot({},qse[n.type]),e),n)):null}function UV(n,e){return e.getBuffer()?[e.getBuffer(),{divisor:0,size:e.size,normalized:e.settings.normalized}]:e.value}function zV(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 HV(n){n.push(n.shift())}function xI(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 GV({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,u=r&&c,h=xI(t,e),p=t.state.constant;if(!u&&i>=h)return;const g=p?t.value:t.getBuffer().getData({srcByteOffset:l});if(t.settings.normalized&&!p){const H=s;s=(U,de)=>t._normalizeConstant(H(U,de))}const m=p?(H,U)=>s(g,U):(H,U)=>s(g.subarray(H,H+a),U),w=n.getData({length:i}),C=new Float32Array(h);(function({source:n,target:e,size:t,getData:i,sourceStartIndices:r,targetStartIndices:s}){if(!Array.isArray(s))return SI({source:n,target:e,size:t,getData:i}),e;let o=0,a=0;const l=i&&((u,h)=>i(u+a,h)),c=Math.min(r.length,s.length);for(let u=1;u(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===SS||(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=SS}clearNeedsUpdate(){this.state.needsUpdate=!1,this.state.updateRanges=Gse}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!==SS}),!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,u]of s)o.call(r,this,{data:t,startRow:c,endRow:u,props:i,numInstances:e});if(this.value)if(this.constant||this.buffer.byteLength{if(!r){const C=h*a+l;for(let H=0;Hu?c.set(de,w):(e._normalizeValue(de,H.target,0),Hse({target:c,source:H.target,start:w,count:Ae}));w+=Ae*u}else e._normalizeValue(de,c,w),w+=u}}_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 AI={};function To(n){Ri.level>0&&AI[n]&&AI[n].call(...arguments)}function Ua(n,e){if(!n)throw new Error(e||"shadertools: assertion failed.")}const $V="out vec4 transform_output;\nvoid main() {\n transform_output = vec4(0);\n}",Xse=`#version 300 es\n${$V}`;function WV(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 qV(n={}){const{version:e=100,input:t,inputType:i,output:r}=n;if(!t)return 300===e?Xse:e>300?`#version ${e}\n${$V}`:"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 Ua(!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 YV extends Wu{get[Symbol.toStringTag](){return"TransformFeedback"}static isSupported(e){return Si(e)}constructor(e,t={}){Co(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,Vg(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,mn.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 hr?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 eoe{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 hr?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(Si(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 YV(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 hr)}return{sourceBuffers:t,feedbackBuffers:i}}_createNewBuffer(e,t){const i=new hr(this.gl,t);return this.resources[e]&&this.resources[e].delete(),this.resources[e]=i,i}_getNextIndex(){return(this.currentIndex+1)%2}}function KV(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 D0="vs",ioe={[D0]:"#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"},xS="__LUMA_INJECT_DECLARATIONS__",XV=/void\s+main\s*\([^)]*\)\s*\{\n?/,QV=/}\n?[^{}]*$/,MI=[];function ZV(n,e,t,i=!1){const r=e===D0;for(const s in t){const o=t[s];o.sort((l,c)=>l.order-c.order),MI.length=o.length;for(let l=0,c=o.length;ll+a));break;case"vs:#main-end":r&&(n=n.replace(QV,l=>a+l));break;case"fs:#decl":r||(n=n.replace(xS,a));break;case"fs:#main-start":r||(n=n.replace(XV,l=>l+a));break;case"fs:#main-end":r||(n=n.replace(QV,l=>a+l));break;default:n=n.replace(s,l=>l+a)}}return n=n.replace(xS,""),i&&(n=n.replace(/\}\s*$/,s=>s+ioe[e])),n}function DI(n){const e={};return Ua(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 roe={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},CS="transform_uSize_",JV="transform_position";const hoe={10241:9728,10240:9728,10242:33071,10243:33071};class poe{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 h in this.samplerTextureMap)a[h]=i[this.samplerTextureMap[h]];this._setSourceTextureParameters();const u=function({sourceTextureMap:n,targetTextureVarying:e,targetTexture:t}){const i={};let r,s;e&&(({width:r,height:s}=t),i[`${CS}${e}`]=[r,s]);for(const o in n)({width:r,height:s}=n[o]),i[`${CS}${o}`]=[r,s];return i}({sourceTextureMap:i,targetTextureVarying:this.targetTextureVarying,targetTexture:s});Object.assign(a,u)}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=_S(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 Ua(!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 hr(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 Fs(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(hoe)}_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=_V(e,{parameters:{10241:9728,10240:9728,10242:33071,10243:33071},pixelStore:{37440:!1}});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 u=l.split("\n"),h=u.slice();if(u.forEach((p,g,m)=>{if(s>0){const w=function(n,e){const t={},i=function(n){return WV(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=`${CS}${n}`;return{samplerName:e,sizeName:t,uniformDeclerations:` uniform sampler2D ${e};\n uniform vec2 ${t};`}}(s),h=` ${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 Ua(!1),null}}(r)};\n`;return t[a]=s,{updatedLine:o,inject:{"vs:#decl":c,"vs:#main-start":h},samplerTextureMap:t}}return null}(p,e);if(w){const{updatedLine:C,inject:H}=w;h[g]=C,c=DI([c,H]),Object.assign(a,w.samplerTextureMap),s--}}t&&!o&&(o=function(n,e){const t=WV(n,["varying","out"]);return t&&t.name===e?t.type:null}(p,t))}),t){tn(i);const p=`${CS}${t}`;c=DI([c,{"vs:#decl":`uniform vec2 ${p};\n`,"vs:#main-start":` vec2 ${JV} = transform_getPos(${p});\n gl_Position = vec4(${JV}, 0, 1.);\n`}])}l=h.join("\n")}return{vs:l,targetTextureType:o,inject:c,samplerTextureMap:a}}({vs:e.vs,sourceTextureMap:t,targetTextureVarying:this.targetTextureVarying,targetTexture:i}),c=DI([e.inject||{},a]);return this.targetTextureType=o,this.samplerTextureMap=l,{vs:r,fs:e._fs||qV({version:KV(r),input:this.targetTextureVarying,inputType:o,output:"transform_output"}),modules:this.hasSourceTextures||this.targetTextureVarying?[roe].concat(e.modules||[]):e.modules,uniforms:s,inject:c}}}const II={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 moe(n){let e=eU(n);return"object"===e?n?"type"in n?Object.assign({},n,II[n.type]):"value"in n?(e=eU(n.value),Object.assign({type:e},n,II[e])):{type:"object",value:n}:{type:"object",value:null}:Object.assign({type:e,value:n},II[e])}function eU(n){return Array.isArray(n)||ArrayBuffer.isView(n)?"array":typeof n}class OI{constructor({name:e,vs:t,fs:i,dependencies:r=[],uniforms:s,getUniforms:o,deprecations:a=[],defines:l={},inject:c={},vertexShader:u,fragmentShader:h}){Ua("string"==typeof e),this.name=e,this.vs=t||u,this.fs=i||h,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=moe(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:Ua(!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&&Ua(s.validate(e[r],s),`${this.name}: invalid ${r}`),t[r]=e[r]):t[r]=s.value}return t}}function voe(n){return function(n){const e={},t={};return RI({modules:n,level:0,moduleMap:e,moduleDepth:t}),Object.keys(t).sort((i,r)=>t[r]-t[i]).map(i=>e[i])}(nU(n))}function RI({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 OI||(Ua("string"!=typeof t,`Shader module use by name is deprecated. Import shader module '${t}' and use it directly.`),Ua(t.name,"shader module has no name"),(t=new OI(t)).dependencies=nU(t.dependencies)),t))}const NI={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]},Nf={};function Moe(n,e){return n.match(/NVIDIA/i)||e.match(/NVIDIA/i)?"NVIDIA":n.match(/INTEL/i)||e.match(/INTEL/i)?"INTEL":n.match(/AMD/i)||e.match(/AMD/i)||n.match(/ATI/i)||e.match(/ATI/i)?"AMD":"UNKNOWN GPU"}Object.keys(NI).forEach(n=>{Nf[n]=n});const PI={};function iU(n,e,t={}){const i=NI[e];if(Ua(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 PI)return PI[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),PI[e]=l,l}function AS(n,e){return(e=Array.isArray(e)?e:[e]).every(t=>function(n,e){const t=NI[e];Ua(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 Ua(!1===r||!0===r),r}(n,t))}function Gg(n){return new RegExp(`\\b${n}[ \\t]+(\\w+[ \\t]+\\w+(\\[\\w+\\])?;)`,"g")}const rU=[[/^(#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("]],Roe=[...rU,[Gg("attribute"),"in $1"],[Gg("varying"),"out $1"]],Noe=[...rU,[Gg("varying"),"in $1"]],sU=[[/^#version[ \t]+300[ \t]+es/,"#version 100"],[/\btexture(2D|2DProj|Cube)Lod\(/g,"texture$1LodEXT("],[/\btexture\(/g,"texture2D("],[/\btextureLod\(/g,"texture2DLodEXT("]],Poe=[...sU,[Gg("in"),"attribute $1"],[Gg("out"),"varying $1"]],Foe=[...sU,[Gg("in"),"varying $1"]],FI="gl_FragColor",kI=/\bout[ \t]+vec4[ \t]+(\w+)[ \t]*;\n?/,koe=/void\s+main\s*\([^)]*\)\s*\{\n?/;function TS(n,e){for(const[t,i]of e)n=n.replace(t,i);return n}const Voe=`\n\n${xS}\n\n`,oU={[D0]:"vertex",fs:"fragment"};function aU(n,{id:e,source:t,type:i,modules:r,defines:s={},hookFunctions:o=[],inject:a={},transpileToGLSL100:l=!1,prologue:c=!0,log:u}){Ua("string"==typeof t,"shader source must be a string");const h=i===D0,p=t.split("\n");let g=100,m="",w=t;0===p[0].indexOf("#version ")?(g=300,m=p[0],w=p.slice(1).join("\n")):m=`#version ${g}`;const C={};r.forEach(Be=>{Object.assign(C,Be.getDefines())}),Object.assign(C,s);let H=c?`${m}\n${function({id:n,source:e,type:t}){return n&&"string"==typeof n&&-1===e.indexOf("SHADER_NAME")?`\n#define SHADER_NAME ${n}_${oU[t]}\n\n`:""}({id:e,source:t,type:i})}\n${function({type:n}){return`\n#define SHADER_TYPE_${oU[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:Moe(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// 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"}}(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 AS(n,Nf.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"),AS(n,Nf.GLSL_DERIVATIVES)&&iU(n,Nf.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"),AS(n,Nf.GLSL_FRAG_DATA)&&iU(n,Nf.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"),AS(n,Nf.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}(C)}\n${h?"":"precision highp float;\n\n"}\n`:`${m}\n`;const U=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),de={},Ae={},Pe={};for(const Be in a){const et="string"==typeof a[Be]?{injection:a[Be],order:0}:a[Be],wt=Be.match(/^(v|f)s:(#)?([\w-]+)$/);if(wt){const Ct=wt[3];wt[2]?"decl"===Ct?Ae[Be]=[et]:Pe[Be]=[et]:de[Be]=[et]}else Pe[Be]=[et]}for(const Be of r){u&&Be.checkDeprecations(w,u),H+=Be.getModuleSource(i,g);const wt=Be.injections[i];for(const vt in wt){const Ct=vt.match(/^(v|f)s:#([\w-]+)$/);if(Ct){const $t="decl"===Ct[2]?Ae:Pe;$t[vt]=$t[vt]||[],$t[vt].push(wt[vt])}else de[vt]=de[vt]||[],de[vt].push(wt[vt])}}return H+=Voe,H=ZV(H,i,Ae),H+=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}(U[i],de),H+=w,H=ZV(H,i,Pe),H=function(n,e,t){switch(e){case 300:return t?TS(n,Roe):function(n){const e=(n=TS(n,Noe)).match(kI);if(e){const t=e[1];n=n.replace(new RegExp(`\\b${FI}\\b`,"g"),t)}else{const t="fragmentColor";n=n.replace(koe,i=>`out vec4 ${t};\n${i}`).replace(new RegExp(`\\b${FI}\\b`,"g"),t)}return n}(n);case 100:return t?TS(n,Poe):function(n){const e=(n=TS(n,Foe)).match(kI);if(e){const t=e[1];n=n.replace(kI,"").replace(new RegExp(`\\b${t}\\b`,"g"),FI)}return n}(n);default:throw new Error(`unknown GLSL version ${e}`)}}(H,l?100:g,h),H}function Hoe(n){return function(t){const i={};for(const r of n){const s=r.getUniforms(t,i);Object.assign(i,s)}return i}}const Koe={5126:Rr.bind(null,"uniform1fv",za,1,Mo),35664:Rr.bind(null,"uniform2fv",za,2,Mo),35665:Rr.bind(null,"uniform3fv",za,3,Mo),35666:Rr.bind(null,"uniform4fv",za,4,Mo),5124:Rr.bind(null,"uniform1iv",ch,1,Mo),35667:Rr.bind(null,"uniform2iv",ch,2,Mo),35668:Rr.bind(null,"uniform3iv",ch,3,Mo),35669:Rr.bind(null,"uniform4iv",ch,4,Mo),35670:Rr.bind(null,"uniform1iv",ch,1,Mo),35671:Rr.bind(null,"uniform2iv",ch,2,Mo),35672:Rr.bind(null,"uniform3iv",ch,3,Mo),35673:Rr.bind(null,"uniform4iv",ch,4,Mo),35674:Rr.bind(null,"uniformMatrix2fv",za,4,Ku),35675:Rr.bind(null,"uniformMatrix3fv",za,9,Ku),35676:Rr.bind(null,"uniformMatrix4fv",za,16,Ku),35678:ro,35680:ro,5125:Rr.bind(null,"uniform1uiv",MS,1,Mo),36294:Rr.bind(null,"uniform2uiv",MS,2,Mo),36295:Rr.bind(null,"uniform3uiv",MS,3,Mo),36296:Rr.bind(null,"uniform4uiv",MS,4,Mo),35685:Rr.bind(null,"uniformMatrix2x3fv",za,6,Ku),35686:Rr.bind(null,"uniformMatrix2x4fv",za,8,Ku),35687:Rr.bind(null,"uniformMatrix3x2fv",za,6,Ku),35688:Rr.bind(null,"uniformMatrix3x4fv",za,12,Ku),35689:Rr.bind(null,"uniformMatrix4x2fv",za,8,Ku),35690:Rr.bind(null,"uniformMatrix4x3fv",za,12,Ku),35678:ro,35680:ro,35679:ro,35682:ro,36289:ro,36292:ro,36293:ro,36298:ro,36299:ro,36300:ro,36303:ro,36306:ro,36307:ro,36308:ro,36311:ro},Xoe={},Qoe={},Zoe={},lU=[0];function LI(n,e,t,i){1===e&&"boolean"==typeof n&&(n=n?1:0),Number.isFinite(n)&&(lU[0]=n,n=lU);const r=n.length;if(r%e&&mn.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 Rr(n,e,t,i){let r=null,s=null;return(o,a,l)=>{const c=e(l,t),u=c.length;let h=!1;if(null===r)r=new Float32Array(u),s=u,h=!0;else{tn(s===u,"Uniform length cannot change.");for(let p=0;p{const a=String(o+e);return hU(a,r-a.length)+t+s})}(e);return{shaderName:l,errors:dU(s,c),warnings:dU(o,c)}}(i,this.source,this.shaderType,this.id);throw mn.error(`GLSL compilation errors in ${r}\n${s}`)(),mn.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 BI extends I0{get[Symbol.toStringTag](){return"VertexShader"}constructor(e,t){"string"==typeof t&&(t={source:t}),super(e,Object.assign({},t,{shaderType:35633}))}_createHandle(){return this.gl.createShader(35633)}}class jI extends I0{get[Symbol.toStringTag](){return"FragmentShader"}constructor(e,t){"string"==typeof t&&(t={source:t}),super(e,Object.assign({},t,{shaderType:35632}))}_createHandle(){return this.gl.createShader(35632)}}const ks=5126,O0=5124,R0=5125,VI={[ks]:[ks,1,"float"],35664:[ks,2,"vec2"],35665:[ks,3,"vec3"],35666:[ks,4,"vec4"],[O0]:[O0,1,"int"],35667:[O0,2,"ivec2"],35668:[O0,3,"ivec3"],35669:[O0,4,"ivec4"],[R0]:[R0,1,"uint"],36294:[R0,2,"uvec2"],36295:[R0,3,"uvec3"],36296:[R0,4,"uvec4"],35670:[ks,1,"bool"],35671:[ks,2,"bvec2"],35672:[ks,3,"bvec3"],35673:[ks,4,"bvec4"],35674:[ks,8,"mat2"],35685:[ks,8,"mat2x3"],35686:[ks,8,"mat2x4"],35675:[ks,12,"mat3"],35687:[ks,12,"mat3x2"],35688:[ks,12,"mat3x4"],35676:[ks,16,"mat4"],35689:[ks,16,"mat4x2"],35690:[ks,16,"mat4x3"]};function yU(n){const e=VI[n];if(!e)return null;const[t,i]=e;return{type:t,components:i}}function bU(n,e){switch(n){case 5120:case 5121:case 5122:case 5123:n=ks}for(const t in VI){const[i,r,s]=VI[t];if(i===n&&r===e)return{glType:t,name:s}}return null}class kae{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(!Si(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}=yU(i),a={type:s,size:r*o};this._inferProperties(e,t,a);const l={location:e,name:t,accessor:new ma(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}=yU(i),l={location:e,name:t,accessor:new ma({type:s,size:r*o})};this.varyingInfos.push(l),this.varyingInfosByName[l.name]=l}}const Lae=35981,Bae=["setVertexArray","setAttributes","setBuffers","unsetBuffers","use","getUniformCount","getUniformInfo","getUniformLocation","getUniformValue","getVarying","getFragDataLocation","getAttachedShaders","getAttributeCount","getAttributeLocation","getAttributeInfo"];class wU extends Wu{get[Symbol.toStringTag](){return"Program"}constructor(e,t={}){super(e,t),this.stubRemovedMethods("Program","v6.0",Bae),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=Lae}=e;return this.hash=t||"",this.vs="string"==typeof i?new BI(this.gl,{id:`${e.id}-vs`,source:i}):i,this.fs="string"==typeof r?new jI(this.gl,{id:`${e.id}-fs`,source:r}):r,tn(this.vs instanceof BI),tn(this.fs instanceof jI),this.uniforms={},this._textureUniforms={},s&&s.length>0&&(Co(this.gl),this.varyings=s,this.gl2.transformFeedbackVaryings(this.handle,s,o)),this._compileAndLink(),this._readUniformLocationsFromLinkedProgram(),this.configuration=new kae(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:u=c>0,vertexArray:h=null,transformFeedback:p,framebuffer:g,parameters:m={},uniforms:w,samplers:C}){if((w||C)&&(mn.deprecated("Program.draw({uniforms})","Program.setUniforms(uniforms)")(),this.setUniforms(w||{})),mn.priority>=e){const H=g?g.id:"default",U=`mode=${ah(this.gl,t)} verts=${i} instances=${c} indexType=${ah(this.gl,l)} isInstanced=${u} isIndexed=${a} Framebuffer=${H}`;mn.log(e,U)()}return tn(h),this.gl.useProgram(this.handle),!(!this._areTexturesRenderable()||0===i||u&&0===c||(h.bindForDraw(i,c,()=>{if(void 0!==g&&(m=Object.assign({},m,{framebuffer:g})),p){const H=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(H)}this._bindTextures(),fc(this.gl,m,()=>{a&&u?this.gl2.drawElementsInstanced(t,i,l,r,c):a&&Si(this.gl)&&!isNaN(s)&&!isNaN(o)?this.gl2.drawRangeElements(t,s,o,i,l,r):a?this.gl.drawElements(t,i,l,r):u?this.gl2.drawArraysInstanced(t,r,i,c):this.gl.drawArrays(t,r,i)}),p&&p.end()}),0))}setUniforms(e={}){mn.priority>=2&&function(n,e,t){for(const i in n){const r=n[i];if((!t||Boolean(t[i]))&&!tae(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 Fs&&(s=s.texture),s instanceof Of)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)&&nae(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 BI({handle:r});break;case 35632:i.fs=new jI({handle:r})}return i}_getParameter(e){return this.gl.getProgramParameter(this.handle,e)}_setId(e){if(!e){const t=this._getName();this.id=ga(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),mn.time(4,`linkProgram for ${this._getName()}`)(),e.linkProgram(this.handle),mn.timeEnd(4,`linkProgram for ${this._getName()}`)(),e.debug||mn.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),u=this._getHash(t),h=this._getHash(i),p=c.map(de=>this._getHash(de.name)).sort(),g=o.map(de=>this._getHash(de)),m=Object.keys(r).sort(),w=Object.keys(s).sort(),C=[],H=[];for(const de of m)C.push(this._getHash(de)),C.push(this._getHash(r[de]));for(const de of w)H.push(this._getHash(de)),H.push(this._getHash(s[de]));const U=`${u}/${h}D${C.join("/")}M${p.join("/")}I${H.join("/")}V${g.join("/")}H${this.stateHash}B${a}${l?"T":""}`;if(!this._programCache[U]){const de=function(n,e){const{vs:t,fs:i}=e,r=voe(e.modules||[]);return{gl:n,vs:aU(n,Object.assign({},e,{source:t,type:D0,modules:r})),fs:aU(n,Object.assign({},e,{source:i,type:"fs",modules:r})),getUniforms:Hoe(r)}}(this.gl,{vs:t,fs:i,modules:c,inject:s,defines:r,hookFunctions:this._hookFunctions,transpileToGLSL100:l});this._programCache[U]=new wU(this.gl,{hash:U,vs:de.vs,fs:de.fs,varyings:o,bufferMode:a}),this._getUniforms[U]=de.getUniforms||(Ae=>{}),this._useCounts[U]=0}return this._useCounts[U]++,this._programCache[U]}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":_0.chrome?"Chrome":_0.safari?"Safari":_0.mozInnerScreenX?"Firefox":"Unknown"}()}static getDefaultArray(e){return e.luma=e.luma||{},e.luma.defaultVertexArray||(e.luma.defaultVertexArray=new Ha(e,{handle:null,isDefaultArray:!0})),e.luma.defaultVertexArray}static getMaxAttributes(e){return Ha.MAX_ATTRIBUTES=Ha.MAX_ATTRIBUTES||e.getParameter(34921),Ha.MAX_ATTRIBUTES}static setConstant(e,t,i){switch(i.constructor){case Float32Array:Ha._setConstantFloatArray(e,t,i);break;case Int32Array:Ha._setConstantIntArray(e,t,i);break;case Uint32Array:Ha._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 Ha.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:u}=i,{gl:h,gl2:p}=this;return e=Number(e),this.bind(()=>{h.bindBuffer(34962,t.handle),c?(tn(Si(h)),p.vertexAttribIPointer(e,r,s,o,a)):h.vertexAttribPointer(e,r,s,l,o,a),h.enableVertexAttribArray(e),p.vertexAttribDivisor(e,u||0)}),this}enable(e,t=!0){return!t&&0===e&&!Ha.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 hr(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(!OS||OS.byteLength{switch(e){case 34373:return this.gl.getVertexAttribOffset(t,e);default:return this.gl.getVertexAttrib(t,e)}})}}const $ae=/^(.+)__LOCATION_([0-9]+)$/,Wae=["setBuffers","setGeneric","clearBindings","setLocations","setGenericValues","setDivisor","enable","disable"];class qae{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 Ha(e),rV(this,"VertexArray","v6.0",Wae),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 hr(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,mn.once(3,()=>`unused value ${e} in ${this.id}`)(),s;const l=this._getAttributeInfo(a||o);if(!l)return s;const u=ma.resolve(l.accessor,this.accessors[o]||{},i,r),{size:h,type:p}=u;return tn(Number.isFinite(h)&&Number.isFinite(p)),{location:o,accessor:u}}_getAttributeInfo(e){return this.configuration&&this.configuration.getAttributeInfo(e)}_getAttributeIndex(e){const t=Number(e);if(Number.isFinite(t))return{location:t};const i=$ae.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 hr)this.setBuffer(e,t);else if(Array.isArray(t)&&t.length&&t[0]instanceof hr)this.setBuffer(e,t[0],t[1]);else if(ArrayBuffer.isView(t)||Array.isArray(t))this.setConstant(e,t);else{if(!(t.buffer instanceof hr))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 hr){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 mn.deprecated("setElements","setElementBuffer")(),this.setElementBuffer(e,t)}}function P0(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+=P0(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 EU(n,e,t,i){const{gl:r}=n;if(!e)return{[i]:"null","Format ":"N/A"};let c,u,h,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 hr){const p=e,{data:g,changed:m}=p.getDebugData();let w;return u=m?"*":"",h=g,l=p.byteLength,a=l/g.BYTES_PER_ELEMENT/o,t?w=`${t.divisor>0?"I ":"P "} ${a} (x${o}=${l} bytes ${ah(r,s)})`:(c=!0,w=`${l} bytes`),{[i]:`${u}${P0(h,{size:o,isInteger:c})}`,"Format ":w}}return h=e,o=e.length,s=String(e.constructor.name).replace("Array",""),c=-1!==s.indexOf("nt"),{[i]:`${P0(h,{size:o,isInteger:c})} (constant)`,"Format ":`${o}x${s} (constant)`}}function Xae(n,e){const{type:t,size:i}=e,r=bU(t,i);return r?`${n} (${r.name})`:n}function SU({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)&&UI({table:a,header:n,uniforms:t,uniformName:p,undefinedOnly:i})&&c++;for(const p of l)p.match(s)&&UI({table:a,header:n,uniforms:t,uniformName:p,undefinedOnly:i})&&c++;for(const p of l)a[p]||UI({table:a,header:n,uniforms:t,uniformName:p,undefinedOnly:i})&&c++;let u=0;const h={};if(!i)for(const p in t){const g=t[p];a[p]||(u++,h[p]={Type:`NOT USED: ${g}`,[n]:P0(g)})}return{table:a,count:c,unusedTable:h,unusedCount:u}}function UI({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?P0(s):"N/A","Uniform Type":o?s:"NOT PROVIDED"},0))}function xU(n){const{type:e,size:t}=n.accessor,i=bU(e,t);return i?`${i.name} ${n.name}`:n.name}const Jae={POSITION:"positions",NORMAL:"normals",COLOR_0:"colors",TEXCOORD_0:"texCoords",TEXCOORD_1:"texCoords1",TEXCOORD_2:"texCoords2"};function tle(n,e){const{attributeMap:t=Jae}=e||{};return t&&t[n]||n}function nle(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 CU=()=>{},sle={};class Yg{constructor(e,t={}){const{id:i=ga("model")}=t;tn(pS(e)),this.id=i,this.gl=e,this.id=t.id||ga("Model"),this.lastLogTime=0,this.animated=!1,this.initialize(t)}initialize(e){this.props={},this.programManager=e.programManager||N0.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:u}=e;this.programProps={program:t,vs:i,fs:r,modules:s,defines:o,inject:a,varyings:l,bufferMode:c,transpileToGLSL100:u},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:u}=e;this.programProps={program:t,vs:i,fs:r,modules:s,defines:o,inject:a,varyings:l,bufferMode:c,transpileToGLSL100:u},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=tle(s,undefined);if("indices"===s)r=o;else if(o.constant)i[a]=o.value;else{const l=o.value,c=ot({},o);delete c.value,i[a]=[new hr(n,l),c],nle(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 hr(n,{data:s,target:34963}),o]}return i}(this.gl,e),this.vertexArray.setAttributes(this.geometryBuffers),this}setAttributes(e={}){if(Vg(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 hI(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),mn.priority>=2&&(c=this._logDrawCallStart(2));const u=this.vertexArray.getDrawParams(),{isIndexed:h=u.isIndexed,indexType:p=u.indexType,indexOffset:g=u.indexOffset,vertexArrayInstanced:m=u.isInstanced}=this.props;m&&!this.isInstanced&&mn.warn("Found instanced attributes on non-instanced model",this.id)();const{isInstanced:w,instanceCount:C}=this,{onBeforeRender:H=CU,onAfterRender:U=CU}=this.props;H(),this.program.setUniforms(this.uniforms);const de=this.program.draw(Object.assign(sle,e,{logPriority:c,uniforms:null,framebuffer:i,parameters:a,drawMode:this.getDrawMode(),vertexCount:this.getVertexCount(),vertexArray:l,transformFeedback:o,isIndexed:h,indexType:p,isInstanced:w,instanceCount:C,offset:h?g:0}));return U(),mn.priority>=2&&this._logDrawCallEnd(c,l,i),de}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 mn.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:u}=this.programProps;t=this.programManager.get({vs:i,fs:r,modules:s,inject:o,defines:a,varyings:l,bufferMode:c,transpileToGLSL100:u}),this.program&&this._managedProgram&&this.programManager.release(this.program),this._programManagerState=this.programManager.stateHash,this._managedProgram=!0}tn(t instanceof wU,"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 qae(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 hr&&t.delete()}}_setAnimationProps(e){this.animated&&tn(e,"Model.draw(): animated uniforms but no animationProps")}_setFeedbackBuffers(e={}){if(Vg(e))return this;const{gl:t}=this.program;return this.transformFeedback=this.transformFeedback||new YV(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:mn.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=EU(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}: ${Xae(s.name,a)}`),t[o]=EU(n,i[r],a,e)}}return t}({vertexArray:t,header:`${this.id} attributes`,attributes:this._attributes}),{table:o,unusedTable:a,unusedCount:l}=SU({header:`${this.id} uniforms`,program:this.program,uniforms:Object.assign({},this.program.uniforms,i)}),{table:c,count:u}=SU({header:`${this.id} uniforms`,program:this.program,uniforms:Object.assign({},this.program.uniforms,i),undefinedOnly:!0});u>0&&mn.log("MISSING UNIFORMS",Object.keys(c))(),l>0&&mn.log("UNUSED UNIFORMS",Object.keys(a))();const h=function(n){const e={},t=`Accessors for ${n.id}`;for(const i of n.attributeInfos)i&&(e[`in ${xU(i)}`]={[t]:JSON.stringify(i.accessor)});for(const i of n.varyingInfos)i&&(e[`out ${xU(i)}`]={[t]:JSON.stringify(i.accessor)});return e}(this.vertexArray.configuration);mn.table(e,s)(),mn.table(e,o)(),mn.table(e+1,h)(),r&&r.log({logLevel:2,message:`Rendered to ${r.id}`}),mn.groupEnd(2,`>>> DRAWING MODEL ${this.id}`)()}}class zI{static isSupported(e){return Si(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 Yg(t,Object.assign({},e,{fs:e.fs||qV({version:KV(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!(Vg(n.feedbackBuffers)&&Vg(n.feedbackMap)&&!(n.varyings&&n.varyings.length>0))})(t)&&(this.bufferTransform=new eoe(e,t)),function(n){return!(Vg(n._sourceTextures)&&!n._targetTexture&&!n._targetTextureVarying)}(t)&&(this.textureTransform=new poe(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 RS(){}const lle={onStart:RS,onUpdate:RS,onInterrupt:RS,onEnd:RS};class F0{constructor(e){this._inProgress=!1,this._handle=null,this.timeline=e,this.settings={}}get inProgress(){return this._inProgress}start(e){this.cancel(),this.settings=ot(ot({},lle),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 mle={interpolation:class{constructor({gl:e,attribute:t,timeline:i}){this.gl=e,this.type="interpolation",this.transition=new F0(i),this.attribute=t,this.attributeInTransition=new CI(e,t.settings),this.currentStartIndices=t.startIndices,this.currentLength=0,this.transform=function(n,e){const t=zV(e.size);return new zI(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 hr(e,r),new hr(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;HV(r);const o={numInstances:t,attribute:s,fromLength:this.currentLength,fromStartIndices:this.currentStartIndices,getData:e.enter};for(const a of r)GV(ot({buffer:a},o));this.currentStartIndices=s.startIndices,this.currentLength=xI(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:UV(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 F0(i),this.attribute=t,this.attributeInTransition=new CI(e,Cn(ot({},t.settings),{normalized:!1})),this.currentStartIndices=t.startIndices,this.currentLength=0,this.texture=function(n){return new _a(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 Fs(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=zV(e.size);return new zI(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 hr(e,r),new hr(e,r),new hr(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)GV(ot({buffer:a},o));this.currentStartIndices=s.startIndices,this.currentLength=xI(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:UV(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]}}),HV(e),this.attributeInTransition.update({buffer:e[1],value:this.attribute.value}),_S(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 _le{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=zI.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 Ri.warn("WebGL2 not supported by this browser. Transition for ".concat(e," is disabled."))();r&&this._removeTransition(e);const o=mle[i.type];o?this.transitions[e]=new o({attribute:t,timeline:this.timeline,gl:this.gl}):(Ri.error("unsupported transition type '".concat(i.type,"'"))(),s=!1)}(s||t.needsRedraw())&&(this.needsRedraw=!0,this.transitions[e].start(i,this.numInstances))}}const AU="attributeManager.invalidate";class Sle{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 _le(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;To("attribute.updateStart",t),t.allocate(i)&&To("attribute.allocate",t,i),t.updateBuffer(e)&&(this.needsRedraw=!0,To("attribute.updateEnd",t,i))}}function MU(n,e,t,i,r){const s=e-n;return(t-e)*r+-s*i+s+e}function DU(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=VV(r)))return;const o=Tle[r.type];if(!o)return void Ri.error("unsupported transition type '".concat(r.type,"'"))();const a=new o(this.timeline);a.start(Cn(ot({},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 NS={COMPONENT:Symbol.for("component"),ASYNC_DEFAULTS:Symbol.for("asyncPropDefaults"),ASYNC_ORIGINAL:Symbol.for("asyncPropOriginal"),ASYNC_RESOLVED:Symbol.for("asyncPropResolved")},{COMPONENT:Dle}=NS;function Rle(n,e){if(!n.transitions)return null;const t={},i=GI(n);for(const r in n.transitions){const s=i[r],o=s&&s.type;("number"===o||"color"===o||"array"===o)&&HI(n[r],e[r],s)&&(t[r]=!0)}return t}function IU({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=HI(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=HI(n[s],e[s],i[s]);if(o)return"".concat(r,".").concat(s," ").concat(o)}}return null}function HI(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 Fle(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(!Ule(i[r],e[r])){t=n(i),e=i;break}return t}}function zle(n,e){if(!e)return n;const t=ot(ot({},n),e);if("defines"in e&&(t.defines=ot(ot({},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=ot({},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 $I(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],u=e[8],h=e[9],p=e[10],g=e[11],m=e[12],w=e[13],C=e[14],H=e[15],U=t*a-i*o,de=t*l-r*o,Ae=t*c-s*o,Pe=i*l-r*a,Be=i*c-s*a,et=r*c-s*l,wt=u*w-h*m,vt=u*C-p*m,Ct=u*H-g*m,Bt=h*C-p*w,$t=h*H-g*w,gt=p*H-g*C,mt=U*gt-de*$t+Ae*Bt+Pe*Ct-Be*vt+et*wt;return mt?(n[0]=(a*gt-l*$t+c*Bt)*(mt=1/mt),n[1]=(r*$t-i*gt-s*Bt)*mt,n[2]=(w*et-C*Be+H*Pe)*mt,n[3]=(p*Be-h*et-g*Pe)*mt,n[4]=(l*Ct-o*gt-c*vt)*mt,n[5]=(t*gt-r*Ct+s*vt)*mt,n[6]=(C*Ae-m*et-H*de)*mt,n[7]=(u*et-p*Ae+g*de)*mt,n[8]=(o*$t-a*Ct+c*wt)*mt,n[9]=(i*Ct-t*$t-s*wt)*mt,n[10]=(m*Be-w*Ae+H*U)*mt,n[11]=(h*Ae-u*Be-g*U)*mt,n[12]=(a*vt-o*Bt-l*wt)*mt,n[13]=(t*Bt-i*vt+r*wt)*mt,n[14]=(w*de-m*Pe-C*U)*mt,n[15]=(u*Pe-h*de+p*U)*mt,n):null}function Pf(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],u=e[7],h=e[8],p=e[9],g=e[10],m=e[11],w=e[12],C=e[13],H=e[14],U=e[15],de=t[0],Ae=t[1],Pe=t[2],Be=t[3];return n[0]=de*i+Ae*a+Pe*h+Be*w,n[1]=de*r+Ae*l+Pe*p+Be*C,n[2]=de*s+Ae*c+Pe*g+Be*H,n[3]=de*o+Ae*u+Pe*m+Be*U,n[4]=(de=t[4])*i+(Ae=t[5])*a+(Pe=t[6])*h+(Be=t[7])*w,n[5]=de*r+Ae*l+Pe*p+Be*C,n[6]=de*s+Ae*c+Pe*g+Be*H,n[7]=de*o+Ae*u+Pe*m+Be*U,n[8]=(de=t[8])*i+(Ae=t[9])*a+(Pe=t[10])*h+(Be=t[11])*w,n[9]=de*r+Ae*l+Pe*p+Be*C,n[10]=de*s+Ae*c+Pe*g+Be*H,n[11]=de*o+Ae*u+Pe*m+Be*U,n[12]=(de=t[12])*i+(Ae=t[13])*a+(Pe=t[14])*h+(Be=t[15])*w,n[13]=de*r+Ae*l+Pe*p+Be*C,n[14]=de*s+Ae*c+Pe*g+Be*H,n[15]=de*o+Ae*u+Pe*m+Be*U,n}function FS(n,e,t){var o,a,l,c,u,h,p,g,m,w,C,H,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],u=e[4],h=e[5],p=e[6],g=e[7],m=e[8],w=e[9],C=e[10],H=e[11],n[0]=o=e[0],n[1]=a,n[2]=l,n[3]=c,n[4]=u,n[5]=h,n[6]=p,n[7]=g,n[8]=m,n[9]=w,n[10]=C,n[11]=H,n[12]=o*i+u*r+m*s+e[12],n[13]=a*i+h*r+w*s+e[13],n[14]=l*i+p*r+C*s+e[14],n[15]=c*i+g*r+H*s+e[15]),n}function kS(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 RU(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],u=e[9],h=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+u*i,n[6]=a*r+h*i,n[7]=l*r+p*i,n[8]=c*r-s*i,n[9]=u*r-o*i,n[10]=h*r-a*i,n[11]=p*r-l*i,n}function NU(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],u=e[5],h=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+u*i,n[2]=a*r+h*i,n[3]=l*r+p*i,n[4]=c*r-s*i,n[5]=u*r-o*i,n[6]=h*r-a*i,n[7]=p*r-l*i,n}function FU(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 LS(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 kU(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],u=c*i+a*s-l*r,h=c*r+l*i-o*s,p=c*s+o*r-a*i,g=-o*i-a*r-l*s;return n[0]=u*c+g*-o+h*-l-p*-a,n[1]=h*c+g*-a+p*-o-u*-l,n[2]=p*c+g*-l+u*-a-h*-o,n[3]=e[3],n}!function(){var n=new ya(4);ya!=Float32Array&&(n[0]=0,n[1]=0,n[2]=0,n[3]=0)}();const LU=[0,0,0,0],fce=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0],pce=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],gce=[0,0,0],mce=[0,0,0],_ce=PS(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=LU,l=LU,c=n.cameraPosition;const{geospatialOrigin:u,shaderCoordinateOrigin:h,offsetMode:p}=BU(n,e,t);return p&&(l=n.projectPosition(u||h),c=[c[0]-l[0],c[1]-l[1],c[2]-l[2]],l[3]=1,a=LS([],l,o),s=i||s,o=Pf([],r,s),o=Pf([],o,fce)),{viewMatrix:s,viewProjectionMatrix:o,projectionCenter:a,originCommon:l,cameraPosCommon:c,shaderCoordinateOrigin:h,geospatialOrigin:u}}(n,t,i),u=n.getDistanceScales(),h=[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:h,project_uDevicePixelRatio:e,project_uFocalDistance:p,project_uCommonUnitsPerMeter:u.unitsPerMeter,project_uCommonUnitsPerWorldUnit:u.unitsPerMeter,project_uCommonUnitsPerWorldUnit2:gce,project_uScale:n.scale,project_uViewProjectionMatrix:s,project_uCameraPosition:a};if(c){const m=n.getDistanceScales(c);switch(t){case ji.METER_OFFSETS:g.project_uCommonUnitsPerWorldUnit=m.unitsPerMeter,g.project_uCommonUnitsPerWorldUnit2=m.unitsPerMeter2;break;case ji.LNGLAT:case ji.LNGLAT_OFFSETS:g.project_uCommonUnitsPerWorldUnit=m.unitsPerDegree,g.project_uCommonUnitsPerWorldUnit2=m.unitsPerDegree2;break;case ji.CARTESIAN:g.project_uCommonUnitsPerWorldUnit=[1,1,m.unitsPerMeter[2]],g.project_uCommonUnitsPerWorldUnit2=[0,0,m.unitsPerMeter2[2]]}}return g});function BU(n,e,t=mce){let r,i=t,s=!0;switch(r=e===ji.LNGLAT_OFFSETS||e===ji.METER_OFFSETS?t:n.isGeospatial?[Math.fround(n.longitude),Math.fround(n.latitude),0]:null,n.projectionMode){case Kc.WEB_MERCATOR:(e===ji.LNGLAT||e===ji.CARTESIAN)&&(s=!1);break;case Kc.WEB_MERCATOR_AUTO_OFFSET:e===ji.LNGLAT?i=r:e===ji.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 wce extends bS{get ELEMENTS(){return Yu(!1),0}get RANK(){return Yu(!1),0}toString(){let e="[";if(Or.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 qn).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 function(n,e,t,i,r){var o,s=1/Math.tan(e/2);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)}(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],u=n[9],h=n[10],p=n[11],g=n[12],m=n[13],w=n[14],C=n[15];return(e*o-t*s)*(h*C-p*w)-(e*a-i*s)*(u*C-p*m)+(e*l-r*s)*(u*w-h*m)+(t*a-i*o)*(c*C-p*g)-(t*l-r*o)*(c*w-h*g)+(i*l-r*a)*(c*m-u*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 $I(this,this),this.check()}multiplyLeft(e){return Pf(this,e,this),this.check()}multiplyRight(e){return Pf(this,this,e),this.check()}rotateX(e){return RU(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],u=e[9],h=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-u*i,n[2]=a*r-h*i,n[3]=l*r-p*i,n[8]=s*i+c*r,n[9]=o*i+u*r,n[10]=a*i+h*r,n[11]=l*i+p*r}(this,this,e),this.check()}rotateZ(e){return NU(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,u,h,p,g,m,w,C,H,U,de,Ae,Pe,Be,et,wt,vt,Ct,Bt,$t,gt,mt,Vt,r=i[0],s=i[1],o=i[2],a=Math.hypot(r,s,o);at?t:n}const WI=Math.log2||function(n){return Math.log(n)*Math.LOG2E};function Xu(n,e){if(!n)throw new Error(e||"@math.gl/web-mercator: assertion failed.")}const gc=Math.PI,GU=gc/4,mc=gc/180,qI=180/gc,YI=4003e4,jS=85.051129;function VS([n,e]){return Xu(Number.isFinite(n)),Xu(Number.isFinite(e)&&e>=-90&&e<=90,"invalid latitude"),[512*(n*mc+gc)/(2*gc),512*(gc+Math.log(Math.tan(GU+e*mc*.5)))/(2*gc)]}function Zg([n,e]){const t=n/512*(2*gc)-gc,i=2*(Math.atan(Math.exp(e/512*(2*gc)-gc))-GU);return[t*qI,i*qI]}function KI({latitude:n,longitude:e,highPrecision:t=!1}){Xu(Number.isFinite(n)&&Number.isFinite(e));const i={},s=Math.cos(n*mc),o=512/360,a=o/s,l=512/YI/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=mc*Math.tan(n*mc)/s,h=512/YI*c,p=h/a*l;i.unitsPerDegree2=[0,o*c/2,h],i.unitsPerMeter2=[p,0,p]}return i}function $U(n,e){const[t,i,r]=n,[s,o,a]=e,{unitsPerMeter:l,unitsPerMeter2:c}=KI({longitude:t,latitude:i,highPrecision:!0}),u=VS(n);u[0]+=s*(l[0]+c[0]*o),u[1]+=o*(l[1]+c[1]*o);const h=Zg(u),p=(r||0)+(a||0);return Number.isFinite(r)||Number.isFinite(a)?[h[0],h[1],p]:h}function qU(n){return 2*Math.atan(.5/n)*qI}function YU(n,e){const[t,i,r=0]=n;return Xu(Number.isFinite(t)&&Number.isFinite(i)&&Number.isFinite(r)),Qg(e,[t,i,r,1])}function L0(n,e,t=0){const[i,r,s]=n;if(Xu(Number.isFinite(i)&&Number.isFinite(r),"invalid pixel coordinate"),Number.isFinite(s))return Qg(e,[i,r,s,1]);const o=Qg(e,[i,r,0,1]),a=Qg(e,[i,r,1,1]),l=o[2],c=a[2];return VU([],o,a,l===c?0:((t||0)-l)/(c-l))}const KU=Math.PI/180;function XU(n,e,t){const{pixelUnprojectionMatrix:i}=n,r=Qg(i,[e,0,1,1]),s=Qg(i,[e,n.height,1,1]),c=Zg(VU([],r,s,(t*n.distanceScales.unitsPerMeter[2]-r[2])/(s[2]-r[2])));return c[2]=t,c}const Bce=Math.PI/180,jce=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],QI=[0,0,0],Uce={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&&C0(t.projectionMatrix,this.projectionMatrix)&&C0(t.viewMatrix,this.viewMatrix))}project(t,{topLeft:i=!0}={}){const s=YU(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,u=L0([s,i?o:this.height-o,a],this.pixelUnprojectionMatrix,r&&r*this.distanceScales.unitsPerMeter[2]),[h,p,g]=this.unprojectPosition(u);return Number.isFinite(a)?[h,p,g]:Number.isFinite(r)?[h,p,r]:[h,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?VS(t):t}unprojectFlat(t){return this.isGeospatial?Zg(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?KI({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:u=!1,repeat:h=!1,worldOffset:p=0}=t;let{width:g,height:m,altitude:w=1.5}=t;const C=Math.pow(2,s);g=g||1,m=m||1,w=Math.max(.75,w);const{fov:H,aspect:U,focalDistance:de,near:Ae,far:Pe}=function({width:n,height:e,fovy:t=qU(1.5),altitude:i,pitch:r=0,nearZMultiplier:s=1,farZMultiplier:o=1}){void 0!==i&&(t=qU(i));const a=.5*t*mc,l=function(n){return.5/Math.tan(.5*n*mc)}(t),c=r*mc,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:n/e,focalDistance:l,near:s,far:(Math.sin(c)*u+l)*o}}({width:g,height:m,pitch:o,altitude:w,nearZMultiplier:l,farZMultiplier:c});let Be=function({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 FS(o,o,[0,0,-i]),RU(o,o,-e*mc),NU(o,o,t*mc),kS(o,o,[r/=n,r,r]),s&&FS(o,o,function(n,e){return n[0]=-e[0],n[1]=-e[1],n[2]=-e[2],n}([],s)),o}({height:m,pitch:o,bearing:a,scale:C,altitude:w});p&&(Be=(new qn).translate([512*p,0,0]).multiplyLeft(Be)),super(Cn(ot({},t),{width:g,height:m,viewMatrix:Be,longitude:r,latitude:i,zoom:s,orthographic:u,fovyRadians:H,aspect:U,focalDistance:de,near:Ae,far:Pe})),this.latitude=i,this.longitude=r,this.zoom=s,this.pitch=o,this.bearing=a,this.altitude=w,this.orthographic=u,this._subViewports=h?[]: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(Cn(ot({},this),{worldOffset:s})):this;this._subViewports.push(o)}}return this._subViewports}addMetersToLngLat(t,i){return $U(t,i)}panByPosition(t,i){const r=L0(i,this.pixelUnprojectionMatrix),o=BS([],this.projectFlat(t),jU([],r)),a=BS([],this.center,o),[l,c]=this.unprojectFlat(a);return{longitude:l,latitude:c}}getBounds(t={}){const i=function(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*KU:Math.atan(.5/n.altitude))>(90-n.pitch)*KU-.01?(l=XU(n,0,e),c=XU(n,t,e)):(l=r([0,0],s),c=r([t,0],s)),[o,a,c,l]}(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}=function({width:n,height:e,bounds:t,minExtent:i=0,maxZoom:r=24,padding:s=0,offset:o=[0,0]}){const[[a,l],[c,u]]=t;Number.isFinite(s)?s={top:s,bottom:s,left:s,right:s}:Xu(Number.isFinite(s.top)&&Number.isFinite(s.bottom)&&Number.isFinite(s.left)&&Number.isFinite(s.right));const h=VS([a,HU(u,-jS,jS)]),p=VS([c,HU(l,-jS,jS)]),g=[Math.max(Math.abs(p[0]-h[0]),i),Math.max(Math.abs(p[1]-h[1]),i)],m=[n-s.left-s.right-2*Math.abs(o[0]),e-s.top-s.bottom-2*Math.abs(o[1])];Xu(m[0]>0&&m[1]>0);const w=m[0]/g[0],C=m[1]/g[1],Ae=Zg([(p[0]+h[0])/2+(s.right-s.left)/2/w,(p[1]+h[1])/2+(s.bottom-s.top)/2/C]),Pe=Math.min(r,WI(Math.abs(Math.min(w,C))));return Xu(Number.isFinite(Pe)),{longitude:Ae[0],latitude:Ae[1],zoom:Pe}}(ot({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 ZI(n,e,t=!1){const i=e.projectPosition(n);if(t&&e instanceof tz){const[r,s,o=0]=n,a=e.getDistanceScales([r,s]);i[2]=o*a.unitsPerMeter[2]}return i}function nz(n,{viewport:e,modelMatrix:t,coordinateSystem:i,coordinateOrigin:r,offsetMode:s}){let[o,a,l=0]=n;switch(t&&([o,a,l]=LS([],[o,a,l,1],t)),i){case ji.LNGLAT:return ZI([o,a,l],e,s);case ji.LNGLAT_OFFSETS:return ZI([o+r[0],a+r[1],l+(r[2]||0)],e,s);case ji.METER_OFFSETS:return ZI($U(r,[o,a,l]),e,s);case ji.CARTESIAN:default:return e.isGeospatial?[o+r[0],a+r[1],l+r[2]]:e.projectPosition([o,a,l])}}const Gce={10241:9987,10240:9729,10242:33071,10243:33071},JI={},qce={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||j0(n)&&(3===n.length||4===n.length),equal:(n,e,t)=>eO(n,e)},accessor:{validate(n,e){const t=US(n);return"function"===t||t===US(e.value)},equal:(n,e,t)=>"function"==typeof e||eO(n,e)},array:{validate:(n,e)=>e.optional&&!n||j0(n),equal:(n,e,t)=>t.compare?eO(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 _a)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 _a(t,Cn(ot({},e),{parameters:ot(ot(ot({},Gce),i),n.props.textureParameters)}));return JI[r.id]=!0,r}(t,n),release:n=>{!function(n){!n||!(n instanceof _a)||JI[n.id]&&(n.delete(),delete JI[n.id])}(n)}}};function eO(n,e){if(n===e)return!0;if(!j0(n)||!j0(e))return!1;const t=n.length;if(t!==e.length)return!1;for(let i=0;i{},this.oldProps=oue,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[rue]||{},i=e[iue]||e,r=e[sue]||{};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(BV(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 oi(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 h,c=!0,u=!1;try{for(var g,m,p=nO(t);c=(g=yield p.next()).done,m=yield g.value,!c;c=!0){const C=m,{dataTransform:H}=i.component?i.component.props:{};a=H?H(C,a):a.concat(C),Object.defineProperty(a,"__diff",{enumerable:!1,value:[{startRow:l,endRow:a.length}]}),l=a.length,i._setAsyncPropValue(e,a,o)}}catch(C){u=!0,h=C}finally{try{!c&&null!=p.return&&(yield p.return())}finally{if(u)throw h}}const w=null===(r=i.layer)||void 0===r?void 0:r.props.onDataLoad;w&&w(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:oz,ASYNC_RESOLVED:az,ASYNC_DEFAULTS:aue}=NS,lue={};let cue=0,uue=(()=>{class n{constructor(){this.props=Xce.apply(this,arguments),this.id=this.props.id,this.count=cue++,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[aue])s in i[az]?r[s]=i[az][s]:s in i[oz]&&(r[s]=i[oz][s]);return new this.constructor(ot(ot(ot({},i),r),t))}get stats(){return this.internalState.stats}_initState(){this.internalState=new sz({})}}return n.componentName="Component",n.defaultProps=lue,n})();class due extends sz{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 _c=n=>"function"==typeof n,uh=n=>null!==n&&"object"==typeof n,cz=n=>uh(n)&&n.constructor==={}.constructor,hue=n=>n&&"function"==typeof n[Symbol.iterator],fue=n=>n&&"function"==typeof n[Symbol.asyncIterator],U0=n=>"undefined"!=typeof Response&&n instanceof Response||n&&n.arrayBuffer&&n.text&&n.json,em=n=>"undefined"!=typeof Blob&&n instanceof Blob,uz=n=>(n=>"undefined"!=typeof ReadableStream&&n instanceof ReadableStream||uh(n)&&_c(n.tee)&&_c(n.cancel)&&_c(n.getReader))(n)||(n=>uh(n)&&_c(n.read)&&_c(n.pipe)&&(n=>"boolean"==typeof n)(n.readable))(n);function Ff(n,e){if(!n)throw new Error(e||"loader assertion failed.")}function iO(n){var e;return!!n&&(Array.isArray(n)&&(n=n[0]),Array.isArray(null===(e=n)||void 0===e?void 0:e.extensions))}function rO(n){var e,t;let i;return Ff(n,"null loader"),Ff(iO(n),"invalid loader"),Array.isArray(n)&&(i=n[1],n=Cn(ot({},n=n[0]),{options:ot(ot({},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 Zc={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},sO=Zc.global||Zc.self||Zc.window||{},bue="object"!=typeof process||"[object process]"!==String(process)||process.browser,dz="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version);dz&&parseFloat(dz[1]);const aO={};function vue(n){for(const e in aO)n.startsWith(e)&&(n=n.replace(e,aO[e]));return!n.startsWith("http://")&&!n.startsWith("https://")&&(n=`${n}`),n}const wue=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,Eue=/^([-\w.]+\/[-\w.+]+)/;function Sue(n){const e=Eue.exec(n);return e?e[1]:n}function hz(n){const e=wue.exec(n);return e?e[1]:""}const xue=/\?.*/;function $S(n){if(U0(n)){const e=lO(n.url||"");return{url:e,type:Sue(n.headers.get("content-type")||"")||hz(e)}}return em(n)?{url:lO(n.name||""),type:n.type||""}:"string"==typeof n?{url:lO(n),type:hz(n)}:{url:"",type:""}}function Cue(n){return U0(n)?n.headers["content-length"]||-1:em(n)?n.size:"string"==typeof n?n.length:n instanceof ArrayBuffer||ArrayBuffer.isView(n)?n.byteLength:-1}function lO(n){return n.replace(xue,"")}function fz(n){return cO.apply(this,arguments)}function cO(){return(cO=oi(function*(n){if(U0(n))return n;const e={},t=Cue(n);t>=0&&(e["content-length"]=String(t));const{url:i,type:r}=$S(n);r&&(e["content-type"]=r);const s=yield Mue(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 Aue(n){return uO.apply(this,arguments)}function uO(){return(uO=oi(function*(n){if(!n.ok){const e=yield Tue(n);throw new Error(e)}})).apply(this,arguments)}function Tue(n){return dO.apply(this,arguments)}function dO(){return(dO=oi(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 Mue(n){return hO.apply(this,arguments)}function hO(){return(hO=oi(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,${Due(n.slice(0,5))}`:null})).apply(this,arguments)}function Due(n){let e="";const t=new Uint8Array(n);for(let i=0;i{}}info(){return()=>{}}warn(){return()=>{}}error(){return()=>{}}}const mz={fetch:null,mimeType:void 0,nothrow:!1,log:new class{constructor(){Kn(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:[]},Rue={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 pO(){sO.loaders=sO.loaders||{};const{loaders:n}=sO;return n._state=n._state||{},n._state}const gO=()=>{const n=pO();return n.globalOptions=n.globalOptions||ot({},mz),n.globalOptions};function Nue(n,e,t,i){return t=t||[],function(n,e){yz(n,null,mz,Rue,e);for(const t of e)yz(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=ot({},n.options||{});return function(n,e){e&&!("baseUri"in n)&&(n.baseUri=e)}(r,t),null===r.log&&(r.log=new Iue),vz(r,gO()),vz(r,e),r}(e,n,i)}function _z(n,e){const t=gO(),i=n||t;return"function"==typeof i.fetch?i.fetch:uh(i.fetch)?r=>pz(r,i):null!=e&&e.fetch?null==e?void 0:e.fetch:pz}function yz(n,e,t,i,r){const s=e||"Top level",o=e?`${e}.`:"";for(const a in n){const l=!e&&uh(n[a]),c="baseUri"===a&&!e,u="workerUrl"===a&&e;if(!(a in t)&&!c&&!u)if(a in i)gz.warn(`${s} loader option '${o}${a}' no longer supported, use '${i[a]}'`)();else if(!l){const h=Fue(a,r);gz.warn(`${s} loader option '${o}${a}' not recognized. ${h}`)()}}}function Fue(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 vz(n,e){for(const t in e)t in e&&(n[t]=cz(e[t])&&cz(n[t])?ot(ot({},n[t]),e[t]):e[t])}function Jc(n,e){if(!n)throw new Error(e||"loaders.gl assertion failed.")}function Bue(n,e="3.0.12"){return Jc(n,"no worker provided"),!(!e||!n.version)}const eu={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},jue=eu.global||eu.self||eu.window||{},mO="object"!=typeof process||"[object process]"!==String(process)||process.browser,_O="function"==typeof importScripts,Vue="undefined"!=typeof window&&void 0!==window.orientation,wz="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version),yO=(wz&&parseFloat(wz[1]),new Map);function Ez(n){const e=new Blob([n],{type:"application/javascript"});return URL.createObjectURL(e)}function Sz(n,e=!0,t){const i=t||new Set;if(n)if(xz(n))i.add(n);else if(xz(n.buffer))i.add(n.buffer);else if(!ArrayBuffer.isView(n)&&e&&"object"==typeof n)for(const r in n)Sz(n[r],e,i);return void 0===t?Array.from(i):[]}function xz(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 bO=()=>{};class Cz{static isSupported(){return"undefined"!=typeof Worker}constructor(e){Kn(this,"name",void 0),Kn(this,"source",void 0),Kn(this,"url",void 0),Kn(this,"terminated",!1),Kn(this,"worker",void 0),Kn(this,"onMessage",void 0),Kn(this,"onError",void 0),Kn(this,"_loadableURL","");const{name:t,source:i,url:r}=e;Jc(i||r),this.name=t,this.source=i,this.url=r,this.onMessage=bO,this.onError=s=>console.log(s),this.worker=this._createBrowserWorker()}destroy(){this.onMessage=bO,this.onError=bO,this.worker.terminate(),this.terminated=!0}get isRunning(){return Boolean(this.onMessage)}postMessage(e,t){t=t||Sz(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){Jc(n.source&&!n.url||!n.source&&n.url);let e=yO.get(n.source||n.url);return e||(n.url&&(e=function(n){return n.startsWith("http")?Ez(function(n){return`try {\n importScripts('${n}');\n} catch (error) {\n console.error(error);\n throw error;\n}`}(n)):n}(n.url),yO.set(n.url,e)),n.source&&(e=Ez(n.source),yO.set(n.source,e))),Jc(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 Gue{constructor(e,t){Kn(this,"name",void 0),Kn(this,"workerThread",void 0),Kn(this,"isRunning",void 0),Kn(this,"result",void 0),Kn(this,"_resolve",void 0),Kn(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){Jc(this.isRunning),this.isRunning=!1,this._resolve(e)}error(e){Jc(this.isRunning),this.isRunning=!1,this._reject(e)}}class $ue{constructor(e){Kn(this,"name","unnamed"),Kn(this,"source",void 0),Kn(this,"url",void 0),Kn(this,"maxConcurrency",1),Kn(this,"maxMobileConcurrency",1),Kn(this,"onDebug",()=>{}),Kn(this,"reuseWorkers",!0),Kn(this,"props",{}),Kn(this,"jobQueue",[]),Kn(this,"idleQueue",[]),Kn(this,"count",0),Kn(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=ot(ot({},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 oi(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 oi(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 Gue(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 Qu{static isSupported(){return Cz.isSupported()}static getWorkerFarm(e={}){return Qu._workerFarm=Qu._workerFarm||new Qu({}),Qu._workerFarm.setProps(e),Qu._workerFarm}constructor(e){Kn(this,"props",void 0),Kn(this,"workerPools",new Map),this.props=ot({},Wue),this.setProps(e),this.workerPools=new Map}destroy(){for(const e of this.workerPools.values())e.destroy()}setProps(e){this.props=ot(ot({},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 $ue({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 Yue(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 Jc(r),r}function Kue(n,e){return!!Qu.isSupported()&&n.worker&&(null==e?void 0:e.worker)}function Xue(n,e,t,i,r){return vO.apply(this,arguments)}function vO(){return(vO=oi(function*(n,e,t,i,r){const s=n.id,o=Yue(n,t),l=Qu.getWorkerFarm(t).getWorkerPool({name:s,url:o});t=JSON.parse(JSON.stringify(t));const c=yield l.startJob("process-on-worker",Que.bind(null,r));return c.postMessage("process",{input:e,options:t}),yield(yield c.result).result})).apply(this,arguments)}function Que(n,e,t,i){return wO.apply(this,arguments)}function wO(){return(wO=oi(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)}Kn(Qu,"_workerFarm",void 0);var Tz=Je(521);function Mz(n){if(function(n){return n&&"object"==typeof n&&n.isBuffer}(n)&&(n=function(n){return Tz.toArrayBuffer?Tz.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 tde(...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 Dz(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 nde(n){return SO.apply(this,arguments)}function SO(){return(SO=oi(function*(n){const e=[];var r,t=!0,i=!1;try{for(var o,a,s=nO(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 tde(...e)})).apply(this,arguments)}const sde=262144;function Iz(n){this.wrapped=n}function z0(n){return new Iz(n)}function H0(n){var e,t;function r(o,a){try{var l=n[o](a),c=l.value,u=c instanceof Iz;Promise.resolve(u?c.wrapped:c).then(function(h){u?r("return"===o?"return":"next",h):s(l.done?"return":"normal",h)},function(h){r("throw",h)})}catch(h){s("throw",h)}}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 u={key:o,arg:a,resolve:l,reject:c,next:null};t?t=t.next=u:(e=t=u,r(o,a))})},"function"!=typeof n.return&&(this.return=void 0)}function CO(n){return function(){return new H0(n.apply(this,arguments))}}function AO(){return(AO=CO(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(DO)}function fde(n,e,t){return IO.apply(this,arguments)}function IO(){return(IO=oi(function*(n,e,t){const i=n instanceof ArrayBuffer||ArrayBuffer.isView(n);if("string"==typeof n||i)return hde(n,e);if(em(n)&&(n=yield fz(n)),U0(n)){const r=n;return yield Aue(r),e.binary?yield r.arrayBuffer():yield r.text()}if(uz(n)&&(n=dde(n,t)),hue(n)||fue(n))return nde(n);throw new Error(DO)})).apply(this,arguments)}function gde(n,e,t=null){if(t)return t;const i=ot({fetch:_z(e,n)},n);return Array.isArray(i.loaders)||(i.loaders=null),i}function mde(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 Rz=()=>{const n=pO();return n.loaderRegistry=n.loaderRegistry||[],n.loaderRegistry};function Nz(n){const e=Rz();n=Array.isArray(n)?n:[n];for(const t of n){const i=rO(t);e.find(r=>i===r)||e.unshift(i)}}const yde=/\.([^.]+)$/;function bde(n){return NO.apply(this,arguments)}function NO(){return(NO=oi(function*(n,e=[],t,i){if(!Fz(n))return null;let r=Pz(n,e,Cn(ot({},t),{nothrow:!0}),i);if(r)return r;if(em(n)&&(r=Pz(n=yield n.slice(0,10).arrayBuffer(),e,t,i)),!(r||null!=t&&t.nothrow))throw new Error(kz(n));return r})).apply(this,arguments)}function Pz(n,e=[],t,i){if(!Fz(n))return null;if(e&&!Array.isArray(e))return rO(e);let r=[];e&&(r=r.concat(e)),null!=t&&t.ignoreRegisteredLoaders||r.push(...Rz()),function(n){for(const e of n)rO(e)}(r);const s=function(n,e,t,i){const{url:r,type:s}=$S(n),o=r||(null==i?void 0:i.url);let a=null;return null!=t&&t.mimeType&&(a=PO(e,null==t?void 0:t.mimeType)),a=a||function(n,e){const t=e&&yde.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||PO(e,s),a=a||function(n,e){if(!e)return null;for(const t of n)if("string"==typeof e){if(Cde(e,t))return t}else if(ArrayBuffer.isView(e)){if(Lz(e.buffer,e.byteOffset,t))return t}else if(e instanceof ArrayBuffer&&Lz(e,0,t))return t;return null}(e,n),a=a||PO(e,null==t?void 0:t.fallbackMimeType),a}(n,r,t,i);if(!(s||null!=t&&t.nothrow))throw new Error(kz(n));return s}function Fz(n){return!(n instanceof Response&&204===n.status)}function kz(n){const{url:e,type:t}=$S(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)?FO(n.buffer,n.byteOffset,e):n instanceof ArrayBuffer?FO(n,0,e):""}(n)}", contentType: "${t}"`),e&&(i+=` url: ${e}`),i}function PO(n,e){for(const t of n)if(t.mimeTypes&&t.mimeTypes.includes(e)||e===`application/x.${t.id}`)return t;return null}function Cde(n,e){return e.testText?e.testText(n):(Array.isArray(e.tests)?e.tests:[e.tests]).some(i=>n.startsWith(i))}function Lz(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 tu=new Uint8ClampedArray(0);const kde={data:{type:"data",value:Pde,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=Cn(ot({},r),{fetch:Cn(ot({},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:G0(n,i),persistent:!1}),l=!0),l?o.subscribe({resourceId:n,onChange:c=>t.internalState.reloadAsyncProp(e,c),consumerId:t.id,requestId:e}):G0(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:ji.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 $0=(()=>{class n extends uue{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=nz(t,{viewport:i,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem}),[s,o,a]=YU(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=ot({},n);let{coordinateSystem:t}=n;const{viewport:i,coordinateOrigin:r,fromCoordinateSystem:s,fromCoordinateOrigin:o}=n;return t===ji.DEFAULT&&(t=i.isGeospatial?ji.LNGLAT:ji.CARTESIAN),void 0===s&&(e.fromCoordinateSystem=t),void 0===o&&(e.fromCoordinateOrigin=r),e.coordinateSystem=t,e}(e),{geospatialOrigin:l,shaderCoordinateOrigin:c,offsetMode:u}=BU(t,i,r),h=nz(n,{viewport:t,modelMatrix:s,coordinateSystem:o,coordinateOrigin:a,offsetMode:u});u&&function(n,e,t){n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2]}(h,h,t.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===ji.DEFAULT||t===ji.LNGLAT||t===ji.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){pc(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=zle(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 u of c)o.invalidateAll(u);else o.invalidateAll()}const l=i.highlightedObjectIndex>=0||i.pickable;if((t.highlightedObjectIndex>=0||t.pickable)!==l&&o){const{pickingColors:c,instancePickingColors:u}=o.attributes,h=c||u;h&&(l&&h.constant&&(h.constant=!1,o.invalidate(h.id)),!h.value&&!l&&(h.constant=!0,h.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||!Fde({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(tu.length/3);if(this.internalState.usesPickingColorCache=!0,rBz&&Ri.warn("Layer has too many data objects. Picking might not be able to distinguish all objects.")(),tu=x0.allocate(tu,i,{size:3,copy:!0,maxCount:Math.max(i,Bz)});const s=Math.floor(tu.length/3),o=[];for(let a=r;a{const c={moduleParameters:t,uniforms:i,parameters:r,context:this.context};for(const u of this.props.extensions)u.draw.call(this,c,u);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&&To("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=IU({newProps:n,oldProps:e,propTypes:GI(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&&OU(n,e,"all"))return{all:!0};const t={};let i=!1;for(const r in n.updateTriggers)"all"!==r&&OU(n,e,r)&&(t[r]=!0,i=t);return i}(n,e)),{dataChanged:i,propsChanged:t,updateTriggersChanged:r,extensionsChanged:Fle(n,e),transitionsChanged:Rle(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=GI(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 Sle(this.context.gl,{id:this.props.id,stats:this.context.stats,timeline:this.context.timeline})}_initState(){pc(!this.internalState&&!this.state),pc(isFinite(this.props.coordinateSystem));const t=this._getAttributeManager();t&&t.addInstanced({instancePickingColors:{type:5121,size:3,noAlloc:!0,update:this.calculateInstancePickingColors}}),this.internalState=new due({attributeManager:t,layer:this}),this.clearChangeFlags(),this.state={},Object.defineProperty(this.state,"attributeManager",{get:()=>(Ri.deprecated("layer.state.attributeManager","layer.getAttributeManager()"),t)}),this.internalState.layer=this,this.internalState.uniformTransitions=new Mle(this.context.timeline),this.internalState.onAsyncPropUpdated=this._onAsyncPropUpdated.bind(this),this.internalState.setAsyncProps(this.props)}_transferState(t){To("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=kde,n})(),jz=(()=>{class n extends $0{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:u,coordinateSystem:h,coordinateOrigin:p,wrapLongitude:g,positionFormat:m,modelMatrix:w,extensions:C,fetch:H,_subLayerProps:U}=this.props,de={opacity:i,pickable:r,visible:s,parameters:o,getPolygonOffset:a,highlightedObjectIndex:l,autoHighlight:c,highlightColor:u,coordinateSystem:h,coordinateOrigin:p,wrapLongitude:g,positionFormat:m,modelMatrix:w,extensions:C,fetch:H},Ae=U&&U[t.id],Pe=Ae&&Ae.updateTriggers,Be=t.id||"sublayer";if(Ae){const et=this.constructor._propTypes,wt=t.type?t.type._propTypes:{};for(const vt in Ae){const Ct=wt[vt]||et[vt];Ct&&"accessor"===Ct.type&&(Ae[vt]=this.getSubLayerAccessor(Ae[vt]))}}Object.assign(de,t,Ae),de.id="".concat(this.props.id,"-").concat(Be),de.updateTriggers=ot(ot({all:this.props.updateTriggers.all},t.updateTriggers),Pe);for(const et of C){const wt=et.getSubLayerProps.call(this,et);wt&&Object.assign(de,wt,{updateTriggers:Object.assign(de.updateTriggers,wt.updateTriggers)})}return de}_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=EI(t,Boolean),this.internalState.subLayers=t),To("compositeLayer.renderLayers",this,i,t);for(const r of t)r.parent=this}}return n.layerName="CompositeLayer",n})();const Bde=/([0-9]+\.?[0-9]*)(%|px)/;function qS(n){switch(typeof n){case"number":return{position:n,relative:!1};case"string":const e=n.match(Bde);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 YS(n,e){return n.relative?Math.round(n.position*e):n.position}function W0(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)&&W0(i,r)))return!1}return!0}class jO{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:u=1e3,modelMatrix:h=null,viewportInstance:p=null,type:g=Jg}=e;pc(!p||p instanceof Jg),this.viewportInstance=p,this.id=t||this.constructor.displayName||"view",this.type=g,this.props=Cn(ot({},e),{id:this.id,projectionMatrix:a,fovy:l,near:c,far:u,modelMatrix:h}),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):W0(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=ot({},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:YS(this._x,e),y:YS(this._y,t),width:YS(this._width,e),height:YS(this._height,t)}}_getControllerProps(e){let t=this.props.controller;return t?!0===t?e:("function"==typeof t&&(t={type:t}),ot(ot({},e),t)):null}_getViewport(e,t){const{type:i}=this;return new i(ot(ot(ot({},e),this.props),t))}_parseDimensions({x:e,y:t,width:i,height:r}){this._x=qS(e),this._y=qS(t),this._width=qS(i),this._height=qS(r)}}const q0=()=>{},Vz={transitionEasing:n=>n,transitionInterruption:1,onTransitionStart:q0,onTransitionInterrupt:q0,onTransitionEnd:q0};class jde{constructor(e,t={}){this.ControllerState=e,this.props=ot(ot({},Vz),t),this.propsInTransition=null,this.transition=new F0(t.timeline),this.onViewStateChange=t.onViewStateChange||q0,this.onStateChange=t.onStateChange||q0,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=ot(ot({},Vz),e),this.props=e,this._shouldIgnoreViewportChange(i,e))return t;if(this._isTransitionEnabled(e)){const{interruption:r,endProps:s}=this.transition.settings,o=ot(ot({},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(ot(ot({},this.props),c)).getViewportProps(),this.onViewStateChange({viewState:this.propsInTransition,oldViewState:this.props})}}const Uz=["longitude","latitude","zoom","bearing","pitch"],Ude=["longitude","latitude","zoom"];class zz 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)||!C0(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];pc(Number.isFinite(i)||Array.isArray(i),"".concat(t," is required for transition"))})}}{constructor(e={}){super((Array.isArray(e)?e:e.transitionProps)||{compare:Uz,extract:Uz,required:Ude}),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]=yS(e[s]||0,t[s]||0,i);if(t.aroundPosition){const s=this.opts.makeViewport(ot(ot({},t),r));Object.assign(r,s.panByPosition(t.aroundPosition,yS(e.around,t.around,i)))}return r}}const dh={transitionDuration:0},zde={transitionDuration:300,transitionEasing:n=>n,transitionInterruption:1},XS=n=>1-(1-n)*(1-n),tm_WHEEL=["wheel"],tm_PAN=["panstart","panmove","panend"],tm_PINCH=["pinchstart","pinchmove","pinchend"],tm_TRIPLE_PAN=["tripanstart","tripanmove","tripanend"],tm_DOUBLE_TAP=["doubletap"],tm_KEYBOARD=["keydown"];class VO{constructor(e,t={}){this.ControllerState=e,this.controllerState=null,this.controllerStateProps=null,this.eventManager=null,this.transitionManager=new jde(e,Cn(ot({},t),{onViewStateChange:this._onTransition.bind(this),onStateChange:this._setInteractionState.bind(this)}));const i=this.linearTransitionProps;this._transition=i&&Cn(ot({},zde),{transitionInterpolator:new zz({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(ot(ot({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,u=Boolean(this.onViewStateChange);this.toggleEvents(tm_WHEEL,u&&i),this.toggleEvents(tm_PAN,u&&(r||s)),this.toggleEvents(tm_PINCH,u&&(a||l)),this.toggleEvents(tm_TRIPLE_PAN,u&&l),this.toggleEvents(tm_DOUBLE_TAP,u&&o),this.toggleEvents(tm_KEYBOARD,u&&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=ot(ot({},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,dh,{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,dh,{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,Cn(ot({},this._getTransitionProps()),{transitionDuration:t,transitionEasing:XS}),{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,dh,{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,Cn(ot({},this._getTransitionProps()),{transitionDuration:t,transitionEasing:XS}),{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,Cn(ot({},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,dh,{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,dh,{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,Cn(ot({},this._getTransitionProps()),{transitionDuration:t,transitionEasing:XS}),{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,dh,{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,dh,{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,Cn(ot({},this._getTransitionProps({around:r})),{transitionDuration:t,transitionEasing:XS}),{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?Cn(ot({},t),{transitionInterpolator:new zz(Cn(ot({},e),{transitionProps:this.linearTransitionProps,makeViewport:this.controllerState.makeViewport}))}):t:dh}}class Hz{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 hh_target=[0,0,0];class QS extends Hz{constructor({makeViewport:e,width:t,height:i,rotationX:r=0,rotationOrbit:s=0,target:o=hh_target,zoom:a=0,minRotationX:l=-90,maxRotationX:c=90,minZoom:u=-(1/0),maxZoom:h=Infinity,startPanPosition:p,startRotatePos:g,startRotationX:m,startRotationOrbit:w,startZoomPosition:C,startZoom:H}){super({width:t,height:i,rotationX:r,rotationOrbit:s,target:o,zoom:a,minRotationX:l,maxRotationX:c,minZoom:u,maxZoom:h}),this._state={startPanPosition:p,startRotatePos:g,startRotationX:m,startRotationOrbit:w,startZoomPosition:C,startZoom:H},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 u=(e[0]-r[0])/a;(s<-90||s>90)&&(u*=-1),c={rotationX:s+(e[1]-r[1])/l*180,rotationOrbit:o+180*u}}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=ot({},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(Cn(ot({},this._viewportProps),{zoom:a}));return this._getUpdatedState(ot({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),Va(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 QS(ot(ot(ot({},this._viewportProps),this._state),e))}_applyConstraints(e){const{maxZoom:t,minZoom:i,zoom:r,maxRotationX:s,minRotationX:o,rotationOrbit:a}=e;return e.zoom=Va(r,i,t),e.rotationX=Va(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 Gde extends VO{constructor(e){super(QS,e)}get linearTransitionProps(){return["target","zoom","rotationX","rotationOrbit"]}}class $de extends VO{constructor(e){e.dragMode=e.dragMode||"pan",super(QS,e)}_onPanRotate(e){return!1}get linearTransitionProps(){return["target","zoom"]}}const Wde=(new qn).lookAt({eye:[0,0,1]});function qde({width:n,height:e,near:t,far:i}){return n=n||1,e=e||1,(new qn).ortho({left:-n/2,right:n/2,bottom:-e/2,top:e/2,near:t,far:i})}class Yde 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(Cn(ot({},e),{longitude:null,position:a,viewMatrix:Wde.clone().scale([c,c*(l?-1:1),c]),projectionMatrix:qde({width:t,height:i,near:r,far:s}),zoom:o}))}panByPosition(e,t){const r=BS([],e,jU([],L0(t,this.pixelUnprojectionMatrix)));return{target:BS([],this.center,r)}}}let Kde=(()=>{class n extends jO{constructor(t){super(Cn(ot({},t),{type:Yde}))}get controller(){return this._getControllerProps({type:$de})}}return n.displayName="OrthographicView",n})();const ZS=Math.PI/180;function Xde({height:n,fovy:e,orbitAxis:t,rotationX:i,rotationOrbit:r,zoom:s}){const o=.5/Math.tan(e*ZS/2),a="Z"===t?[0,0,1]:[0,1,0],l="Z"===t?[0,-o,0]:[0,0,o],c=(new qn).lookAt({eye:l,up:a});c.rotateX(i*ZS),"Z"===t?c.rotateZ(r*ZS):c.rotateY(r*ZS);const u=Math.pow(2,s)/(n||1);return c.scale(u),c}class Qde 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(Cn(ot({},e),{longitude:null,viewMatrix:Xde({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]=L0([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 Zde=(()=>{class n extends jO{constructor(t={}){const{orbitAxis:i="Z"}=t;super(Cn(ot({},t),{orbitAxis:i,type:Qde}))}get controller(){return this._getControllerProps({type:Gde})}}return n.displayName="OrbitView",n})();const Jde=[255,255,255],ehe=1;let the=0;class Gz{constructor(e={}){const{color:t=Jde}=e,{intensity:i=ehe}=e;this.id=e.id||"ambient-".concat(the++),this.color=t,this.intensity=i,this.type="ambient"}}const nhe=[255,255,255],ihe=1,rhe=[0,0,-1];let she=0;class $z{constructor(e={}){const{color:t=nhe}=e,{intensity:i=ihe}=e,{direction:r=rhe}=e,{_shadow:s=!1}=e;this.id=e.id||"directional-".concat(she++),this.color=t,this.intensity=i,this.type="directional",this.direction=new Ao(r).normalize().toArray(),this.shadow=s}getProjectedLight(){return this}}class Wz{constructor(e={}){const{id:t="effect"}=e;this.id=t,this.props=ot({},e)}preRender(){}getModuleParameters(){}cleanup(){}}class UO extends class{constructor(e,t={}){const{id:i="pass"}=t;this.id=i,this.gl=e,this.props=ot({},t)}setProps(e){Object.assign(this.props,e)}render(){}cleanup(){}}{render(e){return $u(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){$u(n,{viewport:[0,0,n.drawingBufferWidth,n.drawingBufferHeight]}),n.clear(16640)}(o);const a=[];for(const l of t){const c=l.viewport||l,u=i&&i[c.id];r(c);const h=this._getDrawLayerParams(c,e);e.view=u;const p=c.subViewports||[c];for(const g of p){e.viewport=g;const m=this._drawLayersInViewport(o,e,h);a.push(m)}}return a}_getDrawLayerParams(e,{layers:t,pass:i,layerFilter:r,effects:s,moduleParameters:o}){const a=[],l=qz(),c={viewport:e,isPicking:i.startsWith("picking"),renderPass:i};for(let u=0;uhI(e,c))}const l={totalCount:t.length,visibleCount:0,compositeCount:0,pickableCount:0};$u(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 u=t[l]=t[l]||qz(e[l],e);c=u(r,s),t[a]=u}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 che extends UO{constructor(e,t){super(e,t),this.shadowMap=new _a(e,{width:1,height:1,parameters:{10241:9729,10240:9729,10242:33071,10243:33071}}),this.depthBuffer=new zg(e,{format:33189,width:1,height:1}),this.fbo=new Fs(e,{id:"shadowmap",width:1,height:1,attachments:{36064:this.shadowMap,36096:this.depthBuffer}})}render(e){const t=this.fbo;fc(this.gl,{depthRange:[0,1],depthTest:!0,blend:!1,clearColor:[1,1,1,1]},()=>{const i=e.viewports[0],r=jg(this.gl),s=i.width*r,o=i.height*r;(s!==t.width||o!==t.height)&&t.resize({width:s,height:o}),super.render(Cn(ot({},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 dhe=Object.keys(ji).map(n=>"const int COORDINATE_SYSTEM_".concat(n," = ").concat(ji[n],";")).join(""),hhe=Object.keys(Kc).map(n=>"const int PROJECTION_MODE_".concat(n," = ").concat(Kc[n],";")).join(""),fhe="".concat(dhe,"\n").concat(hhe,"\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"),phe={},zO={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:fhe,getUniforms:function(n=phe){return n.viewport?function({viewport:n,devicePixelRatio:e=1,modelMatrix:t=null,coordinateSystem:i=ji.DEFAULT,coordinateOrigin:r,autoWrapLongitude:s=!1}={}){i===ji.DEFAULT&&(i=n.isGeospatial?ji.LNGLAT:ji.CARTESIAN);const o=_ce({viewport:n,devicePixelRatio:e,coordinateSystem:i,coordinateOrigin:r});return o.project_uWrapLongitude=s,o.project_uModelMatrix=t||pce,o}(n):{}}},yhe=PS(function({viewport:n,center:e}){return new qn(n.viewProjectionMatrix).invert().transform(e)}),bhe=PS(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=L0([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 Ao(n.center).negate()),l=s.map(u=>a.transform(u)),c=(new qn).ortho({left:Math.min(...l.map(u=>u[0])),right:Math.max(...l.map(u=>u[0])),bottom:Math.min(...l.map(u=>u[1])),top:Math.max(...l.map(u=>u[1])),near:Math.min(...l.map(u=>-u[2])),far:Math.max(...l.map(u=>-u[2]))});t.push(c.multiplyRight(o))}return t}),vhe=[0,0,0,1],whe=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0],HO={name:"shadow",dependencies:[zO],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||vhe,shadow_uLightId:n.shadowLightId||0,shadow_uLightCount:n.shadowMatrices.length},i=yhe({viewport:n.viewport,center:e.project_uCenter}),r=[],s=bhe({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{}}},Ahe={color:[255,255,255],intensity:1},Yz=[{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 GO extends Wz{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=N0.getDefaultProgramManager(e),HO&&this.programManager.addDefaultModule(HO)),this.dummyShadowMap||(this.dummyShadowMap=new _a(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(HO),this.programManager=null)}_createLightMatrix(){const e=[];for(const t of this.directionalLights){const i=(new qn).lookAt({eye:new Ao(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=Dhe++;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 Ihe{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=G0(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 Ohe{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 Ihe(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 Rhe=[{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"},zO],Nhe=["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 Phe(n){const e=N0.getDefaultProgramManager(n);for(const t of Rhe)e.addDefaultModule(t);for(const t of Nhe)e.addShaderHook(t);return e}const Lhe=Object.seal({layerManager:null,resourceManager:null,deck:null,gl:null,stats:null,shaderCache:null,pickingFBO:null,mousePosition:null,userData:{}});class Bhe{constructor(e,{deck:t,stats:i,viewport:r,timeline:s}={}){this.lastRenderedLayers=[],this.layers=[],this.resourceManager=new Ohe({gl:e,protocol:"deck://"}),this.context=Cn(ot({},Lhe),{layerManager:this,gl:e,deck:t,programManager:e&&Phe(e),stats:i||new sI({id:"deck.gl"}),viewport:r||new Jg({id:"DEFAULT-INITIAL-VIEWPORT"}),timeline:s||new Kz,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){To("layerManager.setLayers",this,t,e),this.lastRenderedLayers=e,e=EI(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 To("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]?Ri.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&&Ri.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 jhe{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=EI(e,Boolean),this._diffViews(e,this.views)&&this.setNeedsUpdate("views changed"),this.views=e}_setViewState(e){e?(!W0(e,this.viewState)&&this.setNeedsUpdate("viewState changed"),this.viewState=e):Ri.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)(ot({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=Cn(ot(ot(ot({},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 u=r[a.id];a.controller&&!u&&(s=!0),(s||!a.controller)&&u&&(u.finalize(),u=null),this.controllers[a.id]=this._updateController(a,l,c,u),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 Uhe extends Hz{constructor({makeViewport:e,width:t,height:i,latitude:r,longitude:s,zoom:o,bearing:a=0,pitch:l=0,altitude:c=1.5,maxZoom:u=20,minZoom:h=0,maxPitch:p=60,minPitch:g=0,startPanLngLat:m,startZoomLngLat:w,startRotatePos:C,startBearing:H,startPitch:U,startZoom:de,normalize:Ae}={}){pc(Number.isFinite(s)),pc(Number.isFinite(r)),pc(Number.isFinite(o)),super({width:t,height:i,latitude:r,longitude:s,zoom:o,bearing:a,pitch:l,altitude:c,maxZoom:u,minZoom:h,maxPitch:p,minPitch:g,normalize:Ae}),this._state={startPanLngLat:m,startZoomLngLat:w,startRotatePos:C,startBearing:H,startPitch:U,startZoom:de},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(Cn(ot({},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(Cn(ot({},this._viewportProps),{zoom:o}));return this._getUpdatedState(ot({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=ot({},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(ot(ot(ot({makeViewport:this.makeViewport},this._viewportProps),this._state),e))}_applyConstraints(e){const{maxZoom:t,minZoom:i,zoom:r}=e;e.zoom=Va(r,i,t);const{maxPitch:s,minPitch:o,pitch:a}=e;e.pitch=Va(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=zU(t+180,360)-180),(o<-180||o>180)&&(o=zU(o+180,360)-180);const a=WI(e/512);if(r<=a)r=a,i=0;else{const l=e/2/Math.pow(2,r),c=Zg([0,l])[1];if(iu&&(i=u)}}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 Va(t+Math.log2(e),r,i)}_calculateNewPitchAndBearing({deltaScaleX:e,deltaScaleY:t,startBearing:i,startPitch:r}){t=Va(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 u=0;return r>0?Math.abs(l-o)>5&&(u=r/(o-l)*1.2):r<0&&o>5&&(u=1-s/o),u=Math.min(1,Math.max(-1,u)),{deltaScaleX:c,deltaScaleY:u}}}class zhe extends VO{constructor(e){e.dragMode=e.dragMode||"pan",super(Uhe,e)}setProps(e){const t=this.controllerStateProps;super.setProps(e),(!t||t.height!==e.height)&&this.updateViewport(new this.ControllerState(ot(ot({makeViewport:this.makeViewport},this.controllerStateProps),this._state)))}get linearTransitionProps(){return["longitude","latitude","zoom","bearing","pitch"]}}let Hhe=(()=>{class n extends jO{constructor(t){super(Cn(ot({},t),{type:tz}))}get controller(){return this._getControllerProps({type:zhe})}}return n.displayName="MapView",n})();const Ghe=new GO;class $he{constructor(){this.effects=[],this._internalEffects=[],this._needsRedraw="Initial render",this.setEffects()}setProps(e){"effects"in e&&(e.effects.length!==this.effects.length||!W0(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 GO)||this._internalEffects.push(Ghe)}}class Whe extends UO{}const Qz={blendFunc:[1,0,32771,0],blendEquation:32774};class Zz extends UO{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:u},pass:h="picking",redrawReason:p,pickZ:g}){const m=this.gl;return this.pickZ=g,fc(m,Cn(ot({scissorTest:!0,scissor:[a,l,c,u],clearColor:[0,0,0,0],depthMask:!0,depthTest:!0,depthRange:[0,1],colorMask:[!0,!0,!0,!0]},Qz),{blend:!g}),()=>{super.render({target:o,layers:e,layerFilter:t,views:i,viewports:r,onViewportActive:s,pass:h,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}:Cn(ot({},Qz),{blend:!0,blendColor:[0,0,0,this.useAlpha?(t+1)/255:1]});return ot(ot({},e.props.parameters),i)}}class Yhe{constructor(e){this.gl=e,this.layerFilter=null,this.drawPickingColors=!1,this.drawLayersPass=new Whe(e),this.pickLayersPass=new Zz(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||Fs.getDefaultFramebuffer(this.gl),this._preRender(e.effects,e);const i=this.lastPostProcessEffect?this.renderBuffers[0]:e.target,r=t.render(Cn(ot({},e),{target:i}));this._postRender(e.effects,e),this.renderCount++,To("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 Fs(this.gl),new Fs(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 Khe={pickedColor:null,pickedLayer:null,pickedObjectIndex:-1};function Xhe({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 u=r*r,h=-1,p=0;for(let g=0;gu)p+=4*l;else for(let C=0;C=0){const U=C+o-t,de=U*U+w;de<=u&&(u=de,h=p)}p+=4}}if(h>=0){const g=n[h+3]-1,m=n.slice(h,h+4),w=e[g];if(w){const C=w.decodePickingColor(m),H=Math.floor(h/4/l);return{pickedColor:m,pickedLayer:w,pickedObjectIndex:C,pickedX:o+(h/4-H*l),pickedY:a+H}}Ri.error("Picked non-existent layer. Is picking buffer corrupt?")()}}return Khe}function Jz({pickInfo:n,mode:e,viewports:t,layerFilter:i,pixelRatio:r,x:s,y:o,z:a}){const l=n&&n.pickedLayer,u=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)}))),h=u&&u.unproject([s-u.x,o-u.y],{targetZ:a});return{color:null,layer:null,viewport:u,index:-1,picked:!1,x:s,y:o,pixel:[s,o],coordinate:h,devicePixel:n&&[n.pickedX,n.pickedY],pixelRatio:r}}function Zhe(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 h=t.index,p=t.layerId,g=o&&o.props.id;if(g!==p||a!==h){if(g!==p){const m=r.find(w=>w.props.id===p);m&&l.unshift(m)}t.layerId=g,t.index=a,t.info=null}}const c=Jz(n),u=new Map;return u.set(null,c),l.forEach(h=>{let p=ot({},c);h===o&&(p.color=s,p.index=a,p.picked=!0),p=e4({layer:h,info:p,mode:i}),h===o&&"hover"===i&&(t.info=p),u.set(p.layer.id,p),"hover"===i&&p.layer.updateAutoHighlight(p)}),u}function e4({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 efe{constructor(e){this.gl=e,this.pickingFBO=null,this.pickLayersPass=new Zz(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],u=c&&c.unproject([e-c.x,t-c.y]),h={x:e,y:t,viewport:c,coordinate:u,layer:l};return l?ot(ot({},s),h):Object.assign(h,{color:null,object:null,index:-1})}_resizeBuffer(){const{gl:e}=this;return this.pickingFBO||(this.pickingFBO=new Fs(e),Fs.isSupported(e,{colorBufferFloat:!0})&&(this.depthFBO=new Fs(e),this.depthFBO.attach({36064:new _a(e,{format:Si(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?(Ri.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:u}){if(!(e=this._getPickable(e)))return{result:[],emptyInfo:Jz({viewports:i,x:r,y:s})};this._resizeBuffer();const h=jg(this.gl),p=nI(this.gl,[r,s],!0),g=[p.x+Math.floor(p.width/2),p.y+Math.floor(p.height/2)],m=Math.round(o*h),{width:w,height:C}=this.pickingFBO,H=this._getPickingRect({deviceX:g[0],deviceY:g[1],deviceRadius:m,deviceWidth:w,deviceHeight:C});let U;const de=[],Ae={};for(let Pe=0;Pe=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)}):Ri.error("Picked non-existent layer. Is picking buffer corrupt?")()}}}return Array.from(t.values())}({pickedColors:this._drawAndSample({layers:e,views:t,viewports:i,onViewportActive:u,deviceRect:{x:g,y:H,width:w.x+w.width-g,height:m-H},pass:"picking:".concat(l),redrawReason:l}),layers:e}),Pe=new Map,Be=Number.isFinite(c);for(let et=0;et=c);et++){const wt=Ae[et];let vt={color:wt.pickedColor,layer:null,index:wt.pickedObjectIndex,picked:!0,x:r,y:s,width:o,height:a,pixelRatio:h};vt=e4({layer:wt.pickedLayer,info:vt,mode:l}),Pe.has(vt.object)||Pe.set(vt.object,vt)}return Array.from(Pe.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:u,y:h,width:p,height:g}=s,m=new(l?Float32Array:Uint8Array)(p*g*4);return _S(c,{sourceX:u,sourceY:h,sourceWidth:p,sourceHeight:g,target:m}),m}_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 tfe={zIndex:1,position:"absolute",pointerEvents:"none",color:"#a0a7b4",backgroundColor:"#29323c",padding:"10px",top:0,left:0,display:"none"};class nfe{constructor(e){const t=e.parentElement;t&&(this.el=document.createElement("div"),this.el.className="deck-tooltip",Object.assign(this.el.style,tfe),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 t4(n,e){if(!n)throw new Error(e)}const nu={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},n4=nu.global||nu.self||nu.window,rfe="object"!=typeof process||"[object process]"!==String(process)||process.browser,i4="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version),{_parseImageNode:sfe}=(i4&&parseFloat(i4[1]),n4),$O="undefined"!=typeof Image,WO="undefined"!=typeof ImageBitmap,ofe=Boolean(sfe),qO=!!rfe||ofe;function r4(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 s4(n){switch(r4(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 cfe=/^data:image\/svg\+xml/,ufe=/\.svg((\?|#).*)?$/;function YO(n){return n&&(cfe.test(n)||ufe.test(n))}function dfe(n,e){if(YO(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 a4(n,e)}function a4(n,e){if(YO(e))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(n)])}function l4(n,e,t){return KO.apply(this,arguments)}function KO(){return(KO=oi(function*(n,e,t){const i=dfe(n,t),r=self.URL||self.webkitURL,s="string"!=typeof i&&r.createObjectURL(i);try{return yield hfe(s||i,e)}finally{s&&r.revokeObjectURL(s)}})).apply(this,arguments)}function hfe(n,e){return XO.apply(this,arguments)}function XO(){return(XO=oi(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 ffe={};let c4=!0;function pfe(n,e,t){return QO.apply(this,arguments)}function QO(){return(QO=oi(function*(n,e,t){let i;i=YO(t)?yield l4(n,e,t):a4(n,t);const r=e&&e.imagebitmap;return yield gfe(i,r)})).apply(this,arguments)}function gfe(n){return ZO.apply(this,arguments)}function ZO(){return(ZO=oi(function*(n,e=null){if((mfe(e)||!c4)&&(e=null),e)try{return yield createImageBitmap(n,e)}catch(t){console.warn(t),c4=!1}return yield createImageBitmap(n)})).apply(this,arguments)}function mfe(n){for(const e in n||ffe)return!1;return!0}const iu=!1,Y0=!0;function JO(n){const e=K0(n);return function(n){const e=K0(n);return e.byteLength>=24&&2303741511===e.getUint32(0,iu)?{mimeType:"image/png",width:e.getUint32(16,iu),height:e.getUint32(20,iu)}:null}(e)||function(n){const e=K0(n);if(!(e.byteLength>=3&&65496===e.getUint16(0,iu)&&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,iu)?{mimeType:"image/gif",width:e.getUint16(6,Y0),height:e.getUint16(8,Y0)}:null}(e)||function(n){const e=K0(n);return e.byteLength>=14&&16973===e.getUint16(0,iu)&&e.getUint32(2,Y0)===e.byteLength?{mimeType:"image/bmp",width:e.getUint32(18,Y0),height:e.getUint32(22,Y0)}:null}(e)}function K0(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 Efe(n,e){const{mimeType:t}=JO(n)||{},{_parseImageNode:i}=n4;return t4(i),i(n,t,e)}function eR(){return(eR=oi(function*(n,e,t){const r=((e=e||{}).image||{}).type||"auto",{url:s}=t||{};let a;switch(xfe(r)){case"imagebitmap":a=yield pfe(n,e,s);break;case"image":a=yield l4(n,e,s);break;case"data":a=yield Efe(n,e);break;default:t4(!1)}return"data"===r&&(a=s4(a)),a})).apply(this,arguments)}function xfe(n){switch(n){case"auto":case"data":return function(){if(WO)return"imagebitmap";if($O)return"image";if(qO)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}();default:return function(n){switch(n){case"auto":return WO||$O||qO;case"imagebitmap":return WO;case"image":return $O;case"data":return qO;default:throw new Error(`@loaders.gl/images: image ${n} not supported in this environment`)}}(n),n}}const tR={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 eR.apply(this,arguments)},tests:[n=>Boolean(JO(new DataView(n)))],options:{image:{type:"auto",decode:!0}}};var nm=Je(761);const Afe={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},X0="8.5.8",JS=nm.CO.deck&&nm.CO.deck.VERSION;if(JS&&JS!==X0)throw new Error("deck.gl - multiple versions detected: ".concat(JS," vs ").concat(X0));JS||(Ri.log(1,"deck.gl ".concat(X0))(),nm.CO.deck=Object.assign(nm.CO.deck||{},{VERSION:X0,version:X0,log:Ri,_registerLoggers:function(n){AI=n}}),Nz([Afe,[tR,{imagebitmap:{premultiplyAlpha:"none"}}]]));const Tfe=nm.CO.deck;class ex extends Wu{get[Symbol.toStringTag](){return"Query"}static isSupported(e,t=[]){const i=Si(e),r=vV(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 ex.isSupported(this.gl)?this.gl2.createQuery():null}_deleteHandle(){this.gl2.deleteQuery(this.handle)}}const u4=mS()&&"undefined"!=typeof document;let Lfe=0;class Bfe{constructor(e={}){const{onCreateContext:t=(C=>eV(C)),onAddHTML:i=null,onInitialize:r=(()=>{}),onRender:s=(()=>{}),onFinalize:o=(()=>{}),onError:a,gl:l=null,glOptions:c={},debug:u=!1,createFramebuffer:h=!1,autoResizeViewport:p=!0,autoResizeDrawingBuffer:g=!0,stats:m=If.get("animation-loop-"+Lfe++)}=e;let{useDevicePixels:w=!0}=e;"useDevicePixelRatio"in e&&(mn.deprecated("useDevicePixelRatio","useDevicePixels")(),w=e.useDevicePixelRatio),this.props={onCreateContext:t,onAddHTML:i,onInitialize:r,onRender:s,onFinalize:o,onError:a,gl:l,glOptions:c,debug:u,createFramebuffer:h},this.gl=l,this.needsRedraw=null,this.timeline=null,this.stats=m,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:w}),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=ex.isSupported(this.gl,["timers"])?new ex(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 oi(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 mn.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=u4?new Promise((e,t)=>{u4&&"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?rI(this.props.gl,e):this.onCreateContext(e),!pS(this.gl))throw new Error("AnimationLoop.onCreateContext - illegal context returned");(function(n){$u(n,tI)})(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)&&(mn.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)&&(mn.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 Fs(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 jfe=Je(524),tx=Je.n(jfe);const Vfe={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}))}}(tx().MouseInput);const Gfe=tx().Manager,ru=tx(),$fe=ru?[[ru.Pan,{event:"tripan",pointers:3,threshold:0,enable:!1}],[ru.Rotate,{enable:!1}],[ru.Pinch,{enable:!1}],[ru.Swipe,{enable:!1}],[ru.Pan,{threshold:0,enable:!1}],[ru.Press,{enable:!1}],[ru.Tap,{event:"doubletap",taps:2,enable:!1}],[ru.Tap,{event:"anytap",enable:!1}],[ru.Tap,{enable:!1}]]:null,f4={tripan:["rotate","pinch","pan"],rotate:["pinch"],pinch:["pan"],pan:["press","doubletap","anytap","tap"],doubletap:["anytap"],anytap:["tap"]},Wfe={doubletap:["tap"]},qfe={pointerdown:"pointerdown",pointermove:"pointermove",pointerup:"pointerup",touchstart:"pointerdown",touchmove:"pointermove",touchend:"pointerup",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup"},iR={KEY_EVENTS:["keydown","keyup"],MOUSE_EVENTS:["mousedown","mousemove","mouseup","mouseover","mouseout","mouseleave"],WHEEL_EVENTS:["wheel","mousewheel"]},Yfe={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"},p4={click:"tap",anyclick:"anytap",dblclick:"doubletap",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup",mouseover:"pointerover",mouseout:"pointerout",mouseleave:"pointerleave"},Kfe="undefined"!=typeof navigator&&navigator.userAgent?navigator.userAgent.toLowerCase():"",im="undefined"!=typeof window?window:global;"undefined"!=typeof global?global:window,"undefined"!=typeof document&&document;let g4=!1;try{const n={get passive(){return g4=!0,!0}};im.addEventListener("test",n,n),im.removeEventListener("test",n,n)}catch(n){}const Xfe=-1!==Kfe.indexOf("firefox"),{WHEEL_EVENTS:Qfe}=iR,_4=4.000244140625;class epe{constructor(e,t,i={}){this.element=e,this.callback=t,this.options=Object.assign({enable:!0},i),this.events=Qfe.concat(i.events||[]),this.handleEvent=this.handleEvent.bind(this),this.events.forEach(r=>e.addEventListener(r,this.handleEvent,!!g4&&{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;im.WheelEvent&&(Xfe&&e.deltaMode===im.WheelEvent.DOM_DELTA_PIXEL&&(t/=im.devicePixelRatio),e.deltaMode===im.WheelEvent.DOM_DELTA_LINE&&(t*=40));const i={x:e.clientX,y:e.clientY};0!==t&&t%_4==0&&(t=Math.floor(t/_4)),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:tpe}=iR,y4="pointermove",b4="pointerover",v4="pointerout",w4="pointerleave";class npe{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=tpe.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===y4&&(this.enableMoveEvent=t),e===b4&&(this.enableOverEvent=t),e===v4&&(this.enableOutEvent=t),e===w4&&(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:b4,srcEvent:e,pointerType:"mouse",target:e.target})}handleOutEvent(e){this.enableOutEvent&&"mouseout"===e.type&&this.callback({type:v4,srcEvent:e,pointerType:"mouse",target:e.target})}handleLeaveEvent(e){this.enableLeaveEvent&&"mouseleave"===e.type&&this.callback({type:w4,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:y4,srcEvent:e,pointerType:"mouse",target:e.target});break;case"mouseup":this.pressed=!1}}}const{KEY_EVENTS:ipe}=iR,E4="keydown";class rpe{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=ipe.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===E4&&(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:E4,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 x4="contextmenu";class spe{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===x4&&(this.options.enable=t)}handleEvent(e){!this.options.enable||this.callback({type:x4,center:{x:e.clientX,y:e.clientY},srcEvent:e,pointerType:"mouse",target:e.target})}}const ope={pointerdown:1,pointermove:2,pointerup:4,mousedown:1,mousemove:2,mouseup:4},C4={srcElement:"root",priority:0};class ype{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({},C4,i):C4;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 u=l.length-1;for(;u>=0&&!(l[u].priority>=c.priority);)u--;l.splice(u+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&&f4[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 epe(e,this._onOtherEvent,{enable:!1}),this.moveInput=new npe(e,this._onOtherEvent,{enable:!1}),this.keyInput=new rpe(e,this._onOtherEvent,{enable:!1,tabIndex:t.tabIndex}),this.contextmenuInput=new spe(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=Wfe[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 u in e)this._addEventHandler(u,e[u],i,r,s);return}const{manager:o,events:a}=this,l=p4[e]||e;let c=a.get(l);c||(c=new ype(this),a.set(l,c),c.recognizerName=Yfe[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(p4[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=qfe[t.type];i&&this.manager.emit(i,e)}_onOtherEvent(e){this.manager.emit(e.type,e)}}function Lf(){}const A4={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:Lf,onResize:Lf,onViewStateChange:Lf,onInteractionStateChange:Lf,onBeforeRender:Lf,onAfterRender:Lf,onLoad:Lf,onError:(n,e)=>Ri.error(n)(),_onMetrics:null,getCursor:({isDragging:n})=>n?"grabbing":"grab",debug:!1,drawPickingColors:!1};class ix{constructor(e){e=ot(ot({},A4),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&&Ri.warn("View state tracking is disabled. Use either `initialViewState` for auto update or `viewState` for manual update.")(),"IE"===(0,nm.qs)()&&Ri.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 sI({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&&x0.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&&Ri.removed("onLayerHover","onHover")(),"onLayerClick"in e&&Ri.removed("onLayerClick","onClick")(),e.initialViewState&&!W0(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](ot({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),pc(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:u,autoResizeDrawingBuffer:h}=e;return new Bfe({width:t,height:i,useDevicePixels:u,autoResizeDrawingBuffer:h,autoResizeViewport:!1,gl:r,onCreateContext:p=>eV(Cn(ot(ot({},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 Hhe({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,rI(e,{enable:!0,copyState:!0})),this.tooltip=new nfe(this.canvas),$u(e,{blend:!0,blendFunc:[770,771,1,771],polygonOffsetFill:!0,depthTest:!0,depthFunc:515}),this.props.onWebGLInitialized(e);const t=new Kz;t.play(),this.animationLoop.attachTimeline(t),this.eventManager=new vpe(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 Bj)this.eventManager.on(r,this._onEvent);this.viewManager=new jhe({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 Bhe(e,{deck:this,stats:this.stats,viewport:i,timeline:t}),this.effectManager=new $he,this.deckRenderer=new Yhe(e),this.deckPicker=new efe(e),this.setProps(this.props),this._updateCanvasSize(),this.props.onLoad()}_drawLayers(e,t){const{gl:i}=this.layerManager.context;$u(i,this.props.parameters),this.props.onBeforeRender({gl:i}),this.deckRenderer.renderLayers(ot({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(),Ri.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=Cn(ot({},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=Bj[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=If.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}}ix.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(Wz)),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}},ix.defaultProps=A4,ix.VERSION=Tfe.VERSION;const rx={name:"project32",dependencies:[zO],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"},xpe={pickingSelectedColor:null,pickingHighlightColor:new Uint8Array([0,255,255,255]),pickingActive:!1,pickingAttribute:!1},sx=ot({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=xpe){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}}),T4={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6};class fh{static get DRAW_MODE(){return T4}constructor(e={}){const{id:t=ga("geometry"),drawMode:i=T4.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?ot({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 M4=()=>{},Ipe={10241:9987,10240:9729,10242:33071,10243:33071};function Ope(n){return Math.pow(2,Math.ceil(Math.log2(n)))}function Rpe(n,e,t,i){return t===e.width&&i===e.height?e:(n.canvas.height=i,n.canvas.width=t,n.clearRect(0,0,n.canvas.width,n.canvas.height),n.drawImage(e,0,0,e.width,e.height,0,0,t,i),n.canvas)}function Q0(n){return n&&(n.id||n.url)}function D4(n,e,t){for(let i=0;i0){const{mapping:i,xOffset:r,yOffset:s,rowHeight:o,canvasHeight:a}=function({icons:n,buffer:e,mapping:t={},xOffset:i=0,yOffset:r=0,rowHeight:s=0,canvasWidth:o}){let a=[];for(let l=0;lo&&(D4(t,a,r),i=0,r=s+r+e,s=0,a=[]),a.push({icon:c,xOffset:i}),i=i+p+e,s=Math.max(s,h)}}return a.length>0&&D4(t,a,r),{mapping:t,rowHeight:s,xOffset:i,yOffset:r,canvasWidth:o,canvasHeight:Ope(s+r+e)}}({icons:t,buffer:this._buffer,canvasWidth:this._canvasWidth,mapping:this._mapping,rowHeight:this._rowHeight,xOffset:this._xOffset,yOffset:this._yOffset});this._rowHeight=o,this._mapping=i,this._xOffset=r,this._yOffset=s,this._canvasHeight=a,this._texture||(this._texture=new _a(this.gl,{width:this._canvasWidth,height:this._canvasHeight,parameters:Ipe})),this._texture.height!==this._canvasHeight&&(this._texture=function(n,e,t,i){const r=e.width,s=e.height,o=_V(e,{width:t,height:i});return function(n,e,t={}){const{sourceX:i=0,sourceY:r=0,targetMipmaplevel:s=0,targetInternalFormat:o=6408}=t;let{targetX:a,targetY:l,targetZ:c,width:u,height:h}=t;const{framebuffer:p,deleteFramebuffer:g}=S0(n);tn(p);const{gl:m,handle:w}=p,C=void 0!==a||void 0!==l||void 0!==c;a=a||0,l=l||0,c=c||0;const H=m.bindFramebuffer(36160,w);tn(e);let U=null;if(e instanceof Of&&(U=e,u=Number.isFinite(u)?u:U.width,h=Number.isFinite(h)?h:U.height,U.bind(0),e=U.target),C)switch(e){case 3553:case 34067:m.copyTexSubImage2D(e,s,a,l,i,r,u,h);break;case 35866:case 32879:Co(m).copyTexSubImage3D(e,s,a,l,c,i,r,u,h)}else m.copyTexImage2D(e,s,o,i,r,u,h,0);U&&U.unbind(),m.bindFramebuffer(36160,H||null),g&&p.delete()}(e,o,{targetY:0,width:r,height:s}),e.delete(),o}(0,this._texture,this._canvasWidth,this._canvasHeight)),this.onUpdate(),this._loadIcons(t)}}_loadIcons(e){const t=this._canvas.getContext("2d");for(const i of e)this._pendingCount++,G0(i.url,tR,this._loadOptions).then(r=>{const s=Q0(i),{x:o,y:a,width:l,height:c}=this._mapping[s],u=Rpe(t,r,l,c);this._texture.setSubImageData({data:u,x:o,y:a,width:l,height:c}),this._texture.generateMipmap(),this.onUpdate()}).catch(r=>{this.onError({url:i.url,source:i.source,sourceIndex:i.sourceIndex,loadOptions:this._loadOptions,error:r})}).finally(()=>{this._pendingCount--})}}const I4=[0,0,0,255],Lpe={iconAtlas:{type:"image",value:null,async:!0},iconMapping:{type:"object",value:{},async:!0},sizeScale:{type:"number",value:1,min:0},billboard:!0,sizeUnits:"pixels",sizeMinPixels:{type:"number",min:0,value:0},sizeMaxPixels:{type:"number",min:0,value:Number.MAX_SAFE_INTEGER},alphaCutoff:{type:"number",value:.05,min:0,max:1},getPosition:{type:"accessor",value:n=>n.position},getIcon:{type:"accessor",value:n=>n.icon},getColor:{type:"accessor",value:I4},getSize:{type:"accessor",value:1},getAngle:{type:"accessor",value:0},getPixelOffset:{type:"accessor",value:[0,0]},onIconError:{type:"function",value:null,compare:!1,optional:!0}};let Bpe=(()=>{class n extends $0{getShaders(){return super.getShaders({vs:"#define SHADER_NAME icon-layer-vertex-shader\n\nattribute vec2 positions;\n\nattribute vec3 instancePositions;\nattribute vec3 instancePositions64Low;\nattribute float instanceSizes;\nattribute float instanceAngles;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\nattribute vec4 instanceIconFrames;\nattribute float instanceColorModes;\nattribute vec2 instanceOffsets;\nattribute vec2 instancePixelOffset;\n\nuniform float sizeScale;\nuniform vec2 iconsTextureDim;\nuniform float sizeMinPixels;\nuniform float sizeMaxPixels;\nuniform bool billboard;\n\nvarying float vColorMode;\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\nvarying vec2 uv;\n\nvec2 rotate_by_angle(vec2 vertex, float angle) {\n float angle_radian = angle * PI / 180.0;\n float cos_angle = cos(angle_radian);\n float sin_angle = sin(angle_radian);\n mat2 rotationMatrix = mat2(cos_angle, -sin_angle, sin_angle, cos_angle);\n return rotationMatrix * vertex;\n}\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n geometry.uv = positions;\n geometry.pickingColor = instancePickingColors;\n uv = positions;\n\n vec2 iconSize = instanceIconFrames.zw;\n float sizePixels = clamp(\n project_size_to_pixel(instanceSizes * sizeScale), \n sizeMinPixels, sizeMaxPixels\n );\n float instanceScale = iconSize.y == 0.0 ? 0.0 : sizePixels / iconSize.y;\n vec2 pixelOffset = positions / 2.0 * iconSize + instanceOffsets;\n pixelOffset = rotate_by_angle(pixelOffset, instanceAngles) * instanceScale;\n pixelOffset += instancePixelOffset;\n pixelOffset.y *= -1.0;\n\n if (billboard) {\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, vec3(0.0), geometry.position);\n vec3 offset = vec3(pixelOffset, 0.0);\n DECKGL_FILTER_SIZE(offset, geometry);\n gl_Position.xy += project_pixel_size_to_clipspace(offset.xy);\n\n } else {\n vec3 offset_common = vec3(project_pixel_size(pixelOffset), 0.0);\n DECKGL_FILTER_SIZE(offset_common, geometry);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, offset_common, geometry.position); \n }\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n vTextureCoords = mix(\n instanceIconFrames.xy,\n instanceIconFrames.xy + iconSize,\n (positions.xy + 1.0) / 2.0\n ) / iconsTextureDim;\n\n vColor = instanceColors;\n DECKGL_FILTER_COLOR(vColor, geometry);\n\n vColorMode = instanceColorModes;\n}\n",fs:"#define SHADER_NAME icon-layer-fragment-shader\n\nprecision highp float;\n\nuniform float opacity;\nuniform sampler2D iconsTexture;\nuniform float alphaCutoff;\n\nvarying float vColorMode;\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\nvarying vec2 uv;\n\nvoid main(void) {\n geometry.uv = uv;\n\n vec4 texColor = texture2D(iconsTexture, vTextureCoords);\n vec3 color = mix(texColor.rgb, vColor.rgb, vColorMode);\n float a = texColor.a * opacity * vColor.a;\n\n if (a < alphaCutoff) {\n discard;\n }\n\n gl_FragColor = vec4(color, a);\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:[rx,sx]})}initializeState(){this.state={iconManager:new kpe(this.context.gl,{onUpdate:this._onUpdate.bind(this),onError:this._onError.bind(this)})},this.getAttributeManager().addInstanced({instancePositions:{size:3,type:5130,fp64:this.use64bitPositions(),transition:!0,accessor:"getPosition"},instanceSizes:{size:1,transition:!0,accessor:"getSize",defaultValue:1},instanceOffsets:{size:2,accessor:"getIcon",transform:this.getInstanceOffset},instanceIconFrames:{size:4,accessor:"getIcon",transform:this.getInstanceIconFrame},instanceColorModes:{size:1,type:5121,accessor:"getIcon",transform:this.getInstanceColorMode},instanceColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:!0,accessor:"getColor",defaultValue:I4},instanceAngles:{size:1,transition:!0,accessor:"getAngle"},instancePixelOffset:{size:2,transition:!0,accessor:"getPixelOffset"}})}updateState({oldProps:t,props:i,changeFlags:r}){super.updateState({props:i,oldProps:t,changeFlags:r});const s=this.getAttributeManager(),{iconAtlas:o,iconMapping:a,data:l,getIcon:c}=i,{iconManager:u}=this.state;u.setProps({loadOptions:i.loadOptions});let h=!1;if(o||this.internalState.isAsyncPropLoading("iconAtlas")?(t.iconAtlas!==i.iconAtlas&&u.setProps({iconAtlas:o,autoPacking:!1}),t.iconMapping!==i.iconMapping&&(u.setProps({iconMapping:a}),h=!0)):u.setProps({autoPacking:!0}),(r.dataChanged||r.updateTriggersChanged&&(r.updateTriggersChanged.all||r.updateTriggersChanged.getIcon))&&u.setProps({data:l,getIcon:c}),h&&(s.invalidate("instanceOffsets"),s.invalidate("instanceIconFrames"),s.invalidate("instanceColorModes")),r.extensionsChanged){var g;const{gl:m}=this.context;null===(g=this.state.model)||void 0===g||g.delete(),this.state.model=this._getModel(m),s.invalidateAll()}}get isLoaded(){return super.isLoaded&&this.state.iconManager.isLoaded}finalizeState(){super.finalizeState(),this.state.iconManager.finalize()}draw({uniforms:t}){const{sizeScale:i,sizeMinPixels:r,sizeMaxPixels:s,sizeUnits:o,billboard:a,alphaCutoff:l}=this.props,{iconManager:c}=this.state,{viewport:u}=this.context,h=c.getTexture();h&&this.state.model.setUniforms(t).setUniforms({iconsTexture:h,iconsTextureDim:[h.width,h.height],sizeScale:i*("pixels"===o?u.metersPerPixel:1),sizeMinPixels:r,sizeMaxPixels:s,billboard:a,alphaCutoff:l}).draw()}_getModel(t){return new Yg(t,Cn(ot({},this.getShaders()),{id:this.props.id,geometry:new fh({drawMode:6,attributes:{positions:{size:2,value:new Float32Array([-1,-1,-1,1,1,1,1,-1])}}}),isInstanced:!0}))}_onUpdate(){this.setNeedsRedraw()}_onError(t){const{onIconError:i}=this.getCurrentLayer().props;i?i(t):Ri.error(t.error)()}getInstanceOffset(t){const i=this.state.iconManager.getIconMapping(t);return[i.width/2-i.anchorX||0,i.height/2-i.anchorY||0]}getInstanceColorMode(t){return this.state.iconManager.getIconMapping(t).mask?1:0}getInstanceIconFrame(t){const i=this.state.iconManager.getIconMapping(t);return[i.x||0,i.y||0,i.width||0,i.height||0]}}return n.layerName="IconLayer",n.defaultProps=Lpe,n})();const R4=[],Vpe={getIconOffsets:{type:"accessor",value:n=>n.offsets},alphaCutoff:.001,smoothing:.1,outlineWidth:0,outlineColor:{type:"color",value:[0,0,0,255]}};let Upe=(()=>{class n extends Bpe{getShaders(){return Cn(ot({},super.getShaders()),{fs:"#define SHADER_NAME multi-icon-layer-fragment-shader\n\nprecision highp float;\n\nuniform float opacity;\nuniform sampler2D iconsTexture;\nuniform float gamma;\nuniform bool sdf;\nuniform float alphaCutoff;\nuniform float buffer;\nuniform float outlineBuffer;\nuniform vec4 outlineColor;\n\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\nvarying vec2 uv;\n\nvoid main(void) {\n geometry.uv = uv;\n\n if (!picking_uActive) {\n float alpha = texture2D(iconsTexture, vTextureCoords).a;\n vec4 color = vColor;\n if (sdf) {\n float distance = alpha;\n alpha = smoothstep(buffer - gamma, buffer + gamma, distance);\n\n if (outlineBuffer > 0.0) {\n float inFill = alpha;\n float inBorder = smoothstep(outlineBuffer - gamma, outlineBuffer + gamma, distance);\n color = mix(outlineColor, vColor, inFill);\n alpha = inBorder;\n }\n }\n float a = alpha * color.a;\n \n if (a < alphaCutoff) {\n discard;\n }\n\n gl_FragColor = vec4(color.rgb, a * opacity);\n }\n\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n"})}initializeState(){super.initializeState(),this.getAttributeManager().addInstanced({instanceOffsets:{size:2,accessor:"getIconOffsets"},instancePickingColors:{type:5121,size:3,accessor:(i,{index:r,target:s})=>this.encodePickingColor(r,s)}})}updateState(t){super.updateState(t);const{props:i,oldProps:r}=t;let{outlineColor:s}=i;s!==r.outlineColor&&(s=s.map(o=>o/255),s[3]=Number.isFinite(s[3])?s[3]:1,this.setState({outlineColor:s})),!i.sdf&&i.outlineWidth&&Ri.warn("".concat(this.id,": fontSettings.sdf is required to render outline"))()}draw(t){const{sdf:i,smoothing:r,outlineWidth:s}=this.props,{outlineColor:o}=this.state;t.uniforms=Cn(ot({},t.uniforms),{buffer:.75,outlineBuffer:s?Math.max(r,.75*(1-s)):-1,gamma:r,sdf:Boolean(i),outlineColor:o}),super.draw(t)}getInstanceOffset(t){return t?Array.from(t).map(i=>super.getInstanceOffset(i)):R4}getInstanceColorMode(t){return 1}getInstanceIconFrame(t){return t?Array.from(t).map(i=>super.getInstanceIconFrame(i)):R4}}return n.layerName="MultiIconLayer",n.defaultProps=Vpe,n})();var zpe=Je(2),Hpe=Je.n(zpe);const $pe=[];function Wpe(n){return Math.pow(2,Math.ceil(Math.log2(n)))}function N4(n,e,t,i){let r=0;for(let s=e;si&&(oa){let h=N4(n,a,l,r);c+h>i&&(oi&&(h=P4(n,a,l,i,r,s),o=s[s.length-1])),a=l,c+=h}}(n,r,s,t,i,o),o}function Xpe(n,e,t,i,r,s){let o=0,a=0;for(let l=e;l0,u=[0,0],h=[];let p=0,g=0,m=0;for(let w=0;w<=s;w++){const C=n[w];if(("\n"===C||w===s)&&(m=w),m>g){const H=c?Kpe(n,t,i,r,g,m):$pe;for(let U=0;U<=H.length;U++){const de=0===U?g:H[U-1],Ae=Ui===e);t>=0&&this._order.splice(t,1)}_appendOrder(e){this._order.push(e)}}(3),nge=["fontFamily","fontWeight","characterSet","fontSize","sdf","buffer","cutoff","radius"];function rge(n,e){for(let t=0;t{o in e&&(this.props[o]=e[o])});const t=this._key;this._key=this._getKey();const i=function(n,e){const t=oR.get(n);if(!t)return e;const i=[];let s=Object.keys(t.mapping);s=new Set(s);let o=e;return o instanceof Array&&(o=new Set(o)),o.forEach(a=>{s.has(a)||i.push(a)}),i}(this._key,this.props.characterSet),r=oR.get(this._key);if(r&&0===i.length)return void(this._key!==t&&(this._atlas=r));const s=this._generateFontAtlas(this._key,i,r);this._atlas=s,oR.set(this._key,s)}_generateFontAtlas(e,t,i){const{fontFamily:r,fontWeight:s,fontSize:o,buffer:a,sdf:l,radius:c,cutoff:u}=this.props;let h=i&&i.data;h||(h=document.createElement("canvas"),h.width=1024);const p=h.getContext("2d");$4(p,r,o,s);const{mapping:g,canvasHeight:m,xOffset:w,yOffset:C}=function({characterSet:n,getFontWidth:e,fontHeight:t,buffer:i,maxCanvasWidth:r,mapping:s={},xOffset:o=0,yOffset:a=0}){let l=0,c=o,u=0;for(const p of n)if(!s[p]){const g=e(p,u++);c+g+2*i>r&&(c=0,l++),s[p]={x:c+i,y:a+l*(t+2*i)+i,width:g,height:t},c+=g+2*i}const h=t+2*i;return{mapping:s,xOffset:c,yOffset:a+l*h,canvasHeight:Wpe(a+(l+1)*h)}}(ot({getFontWidth:H=>p.measureText(H).width,fontHeight:1.2*o,buffer:a,characterSet:t,maxCanvasWidth:1024},i&&{mapping:i.mapping,xOffset:i.xOffset,yOffset:i.yOffset}));if(h.height!==m){const H=p.getImageData(0,0,h.width,h.height);h.height=m,p.putImageData(H,0,0)}if($4(p,r,o,s),l){const H=new(Hpe())(o,a,c,u,r,s),U=p.getImageData(0,0,H.size,H.size);for(const de of t)rge(H.draw(de),U),p.putImageData(U,g[de].x-a,g[de].y+a)}else for(const H of t)p.fillText(H,g[H].x,g[H].y+.9*o);return{xOffset:w,yOffset:C,mapping:g,data:h,width:h.width,height:h.height}}_getKey(){const{fontFamily:e,fontWeight:t,fontSize:i,buffer:r,sdf:s,radius:o,cutoff:a}=this.props;return s?"".concat(e," ").concat(t," ").concat(i," ").concat(r," ").concat(o," ").concat(a):"".concat(e," ").concat(t," ").concat(i," ").concat(r)}}const lge={billboard:!0,sizeScale:1,sizeUnits:"pixels",sizeMinPixels:0,sizeMaxPixels:Number.MAX_SAFE_INTEGER,padding:{type:"array",value:[0,0,0,0]},getPosition:{type:"accessor",value:n=>n.position},getSize:{type:"accessor",value:1},getAngle:{type:"accessor",value:0},getPixelOffset:{type:"accessor",value:[0,0]},getBoundingRect:{type:"accessor",value:[0,0,0,0]},getFillColor:{type:"accessor",value:[0,0,0,255]},getLineColor:{type:"accessor",value:[0,0,0,255]},getLineWidth:{type:"accessor",value:1}};let cge=(()=>{class n extends $0{getShaders(){return super.getShaders({vs:"#define SHADER_NAME text-background-layer-vertex-shader\n\nattribute vec2 positions;\n\nattribute vec3 instancePositions;\nattribute vec3 instancePositions64Low;\nattribute vec4 instanceRects;\nattribute float instanceSizes;\nattribute float instanceAngles;\nattribute vec2 instancePixelOffsets;\nattribute float instanceLineWidths;\nattribute vec4 instanceFillColors;\nattribute vec4 instanceLineColors;\nattribute vec3 instancePickingColors;\n\nuniform bool billboard;\nuniform float opacity;\nuniform float sizeScale;\nuniform float sizeMinPixels;\nuniform float sizeMaxPixels;\nuniform vec4 padding;\n\nvarying vec4 vFillColor;\nvarying vec4 vLineColor;\nvarying float vLineWidth;\nvarying vec2 uv;\nvarying vec2 dimensions;\n\nvec2 rotate_by_angle(vec2 vertex, float angle) {\n float angle_radian = radians(angle);\n float cos_angle = cos(angle_radian);\n float sin_angle = sin(angle_radian);\n mat2 rotationMatrix = mat2(cos_angle, -sin_angle, sin_angle, cos_angle);\n return rotationMatrix * vertex;\n}\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n geometry.uv = positions;\n geometry.pickingColor = instancePickingColors;\n uv = positions;\n vLineWidth = instanceLineWidths;\n float sizePixels = clamp(\n project_size_to_pixel(instanceSizes * sizeScale),\n sizeMinPixels, sizeMaxPixels\n );\n\n dimensions = instanceRects.zw * sizePixels + padding.xy + padding.zw;\n\n vec2 pixelOffset = (positions * instanceRects.zw + instanceRects.xy) * sizePixels + mix(-padding.xy, padding.zw, positions);\n pixelOffset = rotate_by_angle(pixelOffset, instanceAngles);\n pixelOffset += instancePixelOffsets;\n pixelOffset.y *= -1.0;\n\n if (billboard) {\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, vec3(0.0), geometry.position);\n vec3 offset = vec3(pixelOffset, 0.0);\n DECKGL_FILTER_SIZE(offset, geometry);\n gl_Position.xy += project_pixel_size_to_clipspace(offset.xy);\n } else {\n vec3 offset_common = vec3(project_pixel_size(pixelOffset), 0.0);\n DECKGL_FILTER_SIZE(offset_common, geometry);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, offset_common, geometry.position);\n }\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n vFillColor = vec4(instanceFillColors.rgb, instanceFillColors.a * opacity);\n DECKGL_FILTER_COLOR(vFillColor, geometry);\n vLineColor = vec4(instanceLineColors.rgb, instanceLineColors.a * opacity);\n DECKGL_FILTER_COLOR(vLineColor, geometry);\n}\n",fs:"#define SHADER_NAME text-background-layer-fragment-shader\n\nprecision highp float;\n\nuniform bool stroked;\n\nvarying vec4 vFillColor;\nvarying vec4 vLineColor;\nvarying float vLineWidth;\nvarying vec2 uv;\nvarying vec2 dimensions;\n\nvoid main(void) {\n geometry.uv = uv;\n\n vec2 pixelPosition = uv * dimensions;\n if (stroked) {\n float distToEdge = min(\n min(pixelPosition.x, dimensions.x - pixelPosition.x),\n min(pixelPosition.y, dimensions.y - pixelPosition.y)\n );\n float isBorder = smoothedge(distToEdge, vLineWidth);\n gl_FragColor = mix(vFillColor, vLineColor, isBorder);\n } else {\n gl_FragColor = vFillColor;\n }\n\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:[rx,sx]})}initializeState(){this.getAttributeManager().addInstanced({instancePositions:{size:3,type:5130,fp64:this.use64bitPositions(),transition:!0,accessor:"getPosition"},instanceSizes:{size:1,transition:!0,accessor:"getSize",defaultValue:1},instanceAngles:{size:1,transition:!0,accessor:"getAngle"},instanceRects:{size:4,accessor:"getBoundingRect"},instancePixelOffsets:{size:2,transition:!0,accessor:"getPixelOffset"},instanceFillColors:{size:4,transition:!0,normalized:!0,type:5121,accessor:"getFillColor",defaultValue:[0,0,0,255]},instanceLineColors:{size:4,transition:!0,normalized:!0,type:5121,accessor:"getLineColor",defaultValue:[0,0,0,255]},instanceLineWidths:{size:1,transition:!0,accessor:"getLineWidth",defaultValue:1}})}updateState({props:t,oldProps:i,changeFlags:r}){if(super.updateState({props:t,oldProps:i,changeFlags:r}),r.extensionsChanged){var s;const{gl:o}=this.context;null===(s=this.state.model)||void 0===s||s.delete(),this.state.model=this._getModel(o),this.getAttributeManager().invalidateAll()}}draw({uniforms:t}){const{viewport:i}=this.context,{billboard:r,sizeScale:s,sizeUnits:o,sizeMinPixels:a,sizeMaxPixels:l,getLineWidth:c}=this.props;let{padding:u}=this.props;const h="pixels"===o?i.metersPerPixel:1;u.length<4&&(u=[u[0],u[1],u[0],u[1]]),this.state.model.setUniforms(t).setUniforms({billboard:r,stroked:Boolean(c),padding:u,sizeScale:s*h,sizeMinPixels:a,sizeMaxPixels:l}).draw()}_getModel(t){return new Yg(t,Cn(ot({},this.getShaders()),{id:this.props.id,geometry:new fh({drawMode:6,vertexCount:4,attributes:{positions:{size:2,value:new Float32Array([0,0,1,0,1,1,0,1])}}}),isInstanced:!0}))}}return n.layerName="TextBackgroundLayer",n.defaultProps=lge,n})();const W4={fontSize:64,buffer:4,sdf:!1,radius:12,cutoff:.25,smoothing:.1},q4={start:1,middle:0,end:-1},Y4={top:1,center:0,bottom:-1},aR=[0,0,0,255],dge=["fontSize","buffer","sdf","radius","cutoff"],hge={billboard:!0,sizeScale:1,sizeUnits:"pixels",sizeMinPixels:0,sizeMaxPixels:Number.MAX_SAFE_INTEGER,background:!1,getBackgroundColor:{type:"accessor",value:[255,255,255,255]},getBorderColor:{type:"accessor",value:aR},getBorderWidth:{type:"accessor",value:0},backgroundPadding:{type:"array",value:[0,0,0,0]},characterSet:{type:"object",value:k4},fontFamily:L4,fontWeight:"normal",lineHeight:1,outlineWidth:{type:"number",value:0,min:0},outlineColor:{type:"color",value:aR},fontSettings:{},wordBreak:"break-word",maxWidth:{type:"number",value:-1},getText:{type:"accessor",value:n=>n.text},getPosition:{type:"accessor",value:n=>n.position},getColor:{type:"accessor",value:aR},getSize:{type:"accessor",value:32},getAngle:{type:"accessor",value:0},getTextAnchor:{type:"accessor",value:"middle"},getAlignmentBaseline:{type:"accessor",value:"center"},getPixelOffset:{type:"accessor",value:[0,0]},backgroundColor:{deprecatedFor:["background","getBackgroundColor"]}};let fge=(()=>{class n extends jz{initializeState(){this.state={styleVersion:0,fontAtlasManager:new sge}}updateState({props:t,oldProps:i,changeFlags:r}){const o=this.state.characterSet;(r.dataChanged||r.updateTriggersChanged&&(r.updateTriggersChanged.all||r.updateTriggersChanged.getText))&&this._updateText();const a=o!==this.state.characterSet||this._fontChanged(i,t);a&&this._updateFontAtlas(i,t),(a||t.lineHeight!==i.lineHeight||t.wordBreak!==i.wordBreak||t.maxWidth!==i.maxWidth)&&this.setState({styleVersion:this.state.styleVersion+1})}getPickingInfo({info:t}){return t.object=t.index>=0?this.props.data[t.index]:null,t}_updateFontAtlas(t,i){const{fontSettings:r,fontFamily:s,fontWeight:o}=i,{fontAtlasManager:a,characterSet:l}=this.state;a.setProps(Cn(ot(ot({},W4),r),{characterSet:l,fontFamily:s,fontWeight:o}))}_fontChanged(t,i){if(t.fontFamily!==i.fontFamily||t.fontWeight!==i.fontWeight)return!0;if(t.fontSettings===i.fontSettings)return!1;const r=t.fontSettings||{},s=i.fontSettings||{};return dge.some(o=>r[o]!==s[o])}_updateText(){const{data:t,characterSet:i}=this.props,r=t.attributes&&t.attributes.getText;let a,{getText:s}=this.props,{startIndices:o}=t;const l="auto"===i&&new Set;if(r&&o){const{texts:c,characterCount:u}=function({value:n,length:e,stride:t,offset:i,startIndices:r,characterSet:s}){const o=n.BYTES_PER_ELEMENT,a=t?t/o:1,l=i?i/o:0,c=r[e]||Math.ceil((n.length-l)/a),u=s&&new Set,h=new Array(e);let p=n;if(a>1||l>0){p=new n.constructor(c);for(let g=0;gc[p]}else{const{iterable:c,objectInfo:u}=ES(t);o=[0],a=0;for(const h of c){u.index++;const p=Array.from(s(h,u)||"");l&&p.forEach(l.add,l),a+=p.length,o.push(a)}}this.setState({getText:s,startIndices:o,numInstances:a,characterSet:l||i})}getBoundingRect(t,i){const r=this.state.fontAtlasManager.mapping,{getText:s}=this.state,{wordBreak:o,maxWidth:a,lineHeight:l,getTextAnchor:c,getAlignmentBaseline:u}=this.props,h=s(t,i)||"",{size:[p,g]}=F4(h,l,o,a,r);return[(q4["function"==typeof c?c(t,i):c]-1)*p/2,(Y4["function"==typeof u?u(t,i):u]-1)*g/2,p,g]}getIconOffsets(t,i){const r=this.state.fontAtlasManager.mapping,{getText:s}=this.state,{wordBreak:o,maxWidth:a,lineHeight:l,getTextAnchor:c,getAlignmentBaseline:u}=this.props,h=s(t,i)||"",{x:p,y:g,rowWidth:m,size:[w,C]}=F4(h,l,o,a,r),H=q4["function"==typeof c?c(t,i):c],U=Y4["function"==typeof u?u(t,i):u],de=p.length,Ae=new Array(2*de);let Pe=0;for(let Be=0;Bet*e/255)}const cR={name:"lights",vs:K4,fs:K4,getUniforms:function X4(n=pge){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?lR(n):[0,0,0],e.forEach((r,s)=>{i[`lighting_uPointLight[${s}].color`]=lR(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`]=lR(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 X4({lightSources:e})}return{}},defines:{MAX_LIGHTS:3}},mge={};const yge={name:"phong-lighting",dependencies:[cR],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=mge){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}}},uR=Math.PI/180,ox=new Float32Array(16),J4=new Float32Array(12);function e5(n,e,t){const i=e[0]*uR,r=e[1]*uR,s=e[2]*uR,o=Math.sin(s),a=Math.sin(i),l=Math.sin(r),c=Math.cos(s),u=Math.cos(i),h=Math.cos(r),p=t[0],g=t[1],m=t[2];n[0]=p*h*u,n[1]=p*l*u,n[2]=p*-a,n[3]=g*(-l*c+h*a*o),n[4]=g*(h*c+l*a*o),n[5]=g*u*o,n[6]=m*(l*o+h*a*c),n[7]=m*(-h*o+l*a*c),n[8]=m*u*c}function t5(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 n5={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,u=Array.isArray(s),h=Array.isArray(r),p=Array.isArray(o),g=c||!l&&Boolean(a(i[0]));n.constant=g?c:h&&u&&p;const m=n.value;if(n.constant){let w;g?(ox.set(a),w=t5(ox)):(w=J4,e5(w,r,s),w.set(o,9)),n.value=new Float32Array(w)}else{let w=e*n.size;const{iterable:C,objectInfo:H}=ES(i,e,t);for(const U of C){let de;H.index++,g?(ox.set(c?a:a(U,H)),de=t5(ox)):(de=J4,e5(de,h?r:r(U,H),u?s:s(U,H)),de.set(p?o:o(U,H),9)),m[w++]=de[0],m[w++]=de[1],m[w++]=de[2],m[w++]=de[3],m[w++]=de[4],m[w++]=de[5],m[w++]=de[6],m[w++]=de[7],m[w++]=de[8],m[w++]=de[9],m[w++]=de[10],m[w++]=de[11]}}}};function i5(n,e){return e===ji.CARTESIAN||e===ji.METER_OFFSETS||e===ji.DEFAULT&&!n.isGeospatial}function r5(n,e){(n.COLOR_0||n.colors)&&e||(n.colors={constant:!0,value:new Float32Array([1,1,1])}),Ri.assert(n.positions||n.POSITION,'no "postions" or "POSITION" attribute in mesh')}function wge(n,e){if(n.attributes)return r5(n.attributes,e),n instanceof fh?n:new fh(n);if(n.positions||n.POSITION)return r5(n,e),new fh({attributes:n});throw Error("Invalid mesh")}const Ege={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 Sge=(()=>{class n extends $0{getShaders(){const t=!Si(this.context.gl),i={};return gI(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:[rx,yge,sx],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:n5}),this.setState({emptyTexture:new _a(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||i5(i,s),flatShading:!this.state.hasNormals}).draw()}getModel(t){const i=new Yg(this.context.gl,Cn(ot({},this.getShaders()),{id:this.props.id,geometry:wge(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=Ege,n})();const s5={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:[cR]};class rm{constructor(e={}){const{id:t}=e;this.id=t||ga(this.constructor.name),this.display=!0,this.position=new Ao,this.rotation=new Ao,this.scale=new Ao(1,1,1),this.matrix=new qn,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 qn(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 Z0 extends rm{constructor(e={}){e=Array.isArray(e)?{children:e}:e;const{children:t=[]}=e;mn.assert(t.every(i=>i instanceof rm),"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 qn}={}){const i=new qn(t).multiplyRight(this.matrix);for(const r of this.children)r instanceof Z0?r.traverse(e,{worldMatrix:i}):e(r,{worldMatrix:i})}}function o5(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],u=e[7],h=e[8],p=t[0],g=t[1],m=t[2],w=t[3],C=t[4],H=t[5],U=t[6],de=t[7],Ae=t[8];return n[0]=p*i+g*o+m*c,n[1]=p*r+g*a+m*u,n[2]=p*s+g*l+m*h,n[3]=w*i+C*o+H*c,n[4]=w*r+C*a+H*u,n[5]=w*s+C*l+H*h,n[6]=U*i+de*o+Ae*c,n[7]=U*r+de*a+Ae*u,n[8]=U*s+de*l+Ae*h,n}function a5(n,e,t){var i=t[0],r=t[1];return n[0]=i*e[0],n[1]=i*e[1],n[2]=i*e[2],n[3]=r*e[3],n[4]=r*e[4],n[5]=r*e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n}function l5(){var n=new ya(4);return ya!=Float32Array&&(n[0]=0,n[1]=0,n[2]=0),n[3]=1,n}function c5(n){return n[0]=0,n[1]=0,n[2]=0,n[3]=1,n}function dR(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 ax(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],u=t[3];return n[0]=i*u+o*a+r*c-s*l,n[1]=r*u+o*l+s*a-i*c,n[2]=s*u+o*c+i*l-r*a,n[3]=o*u-i*a-r*l-s*c,n}function u5(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);return n[0]=i*l+o*a,n[1]=r*l+s*a,n[2]=s*l-r*a,n[3]=o*l-i*a,n}function d5(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);return n[0]=i*l-s*a,n[1]=r*l+o*a,n[2]=s*l+i*a,n[3]=o*l-r*a,n}function h5(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);return n[0]=i*l+r*a,n[1]=r*l-i*a,n[2]=s*l+o*a,n[3]=o*l-s*a,n}function f5(n,e){var t=e[0],i=e[1],r=e[2];return n[0]=t,n[1]=i,n[2]=r,n[3]=Math.sqrt(Math.abs(1-t*t-i*i-r*r)),n}function J0(n,e,t,i){var p,g,m,w,C,r=e[0],s=e[1],o=e[2],a=e[3],l=t[0],c=t[1],u=t[2],h=t[3];return(g=r*l+s*c+o*u+a*h)<0&&(g=-g,l=-l,c=-c,u=-u,h=-h),1-g>Qc?(p=Math.acos(g),m=Math.sin(p),w=Math.sin((1-i)*p)/m,C=Math.sin(i*p)/m):(w=1-i,C=i),n[0]=w*r+C*l,n[1]=w*s+C*c,n[2]=w*o+C*u,n[3]=w*a+C*h,n}function p5(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;return n[0]=-t*a,n[1]=-i*a,n[2]=-r*a,n[3]=s*a,n}function g5(n,e){return n[0]=-e[0],n[1]=-e[1],n[2]=-e[2],n[3]=e[3],n}function hR(n,e){var i,t=e[0]+e[4]+e[8];if(t>0)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}return n}var m5=function(n,e,t){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n},fR=FU,pR=function(n,e){return n[0]*e[0]+n[1]*e[1]+n[2]*e[2]+n[3]*e[3]},_5=function(n,e,t,i){var r=e[0],s=e[1],o=e[2],a=e[3];return 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),n},y5=function(n){return Math.hypot(n[0],n[1],n[2],n[3])},b5=function(n){var e=n[0],t=n[1],i=n[2],r=n[3];return e*e+t*t+i*i+r*r},w5=function(){var n=xV(),e=CV(1,0,0),t=CV(0,1,0);return function(i,r,s){var o=AV(r,s);return o<-.999999?(A0(n,e,r),function(n){return Math.hypot(n[0],n[1],n[2])}(n)<1e-6&&A0(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),dR(i,n,Math.PI),i):o>.999999?(i[0]=0,i[1]=0,i[2]=0,i[3]=1,i):(A0(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))}}();l5(),l5(),function(){var n=new ya(9);ya!=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 Nge=[0,0,0,1];class gR extends bS{constructor(e=0,t=0,i=0,r=1){super(-0,-0,-0,-0),Array.isArray(e)&&1===arguments.length?this.copy(e):this.set(e,t,i,r)}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this.check()}set(e,t,i,r){return this[0]=e,this[1]=t,this[2]=i,this[3]=r,this.check()}fromMatrix3(e){return hR(this,e),this.check()}identity(){return c5(this),this.check()}fromAxisRotation(e,t){return dR(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]=sr(e)}get y(){return this[1]}set y(e){this[1]=sr(e)}get z(){return this[2]}set z(e){this[2]=sr(e)}get w(){return this[3]}set w(e){this[3]=sr(e)}len(){return y5(this)}lengthSquared(){return b5(this)}dot(e,t){if(void 0!==t)throw new Error("Quaternion.dot only takes one argument");return pR(this,e)}rotationTo(e,t){return w5(this,e,t),this.check()}add(e,t){if(void 0!==t)throw new Error("Quaternion.add only takes one argument");return m5(this,this,e),this.check()}calculateW(){return f5(this,this),this.check()}conjugate(){return g5(this,this),this.check()}invert(){return p5(this,this),this.check()}lerp(e,t,i){return _5(this,e,t,i),this.check()}multiplyRight(e,t){return Yu(!t),ax(this,this,e),this.check()}multiplyLeft(e,t){return Yu(!t),ax(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 u5(this,this,e),this.check()}rotateY(e){return d5(this,this,e),this.check()}rotateZ(e){return h5(this,this,e),this.check()}scale(e){return fR(this,this,e),this.check()}slerp(e,t,i){switch(arguments.length){case 1:({start:e=Nge,target:t,ratio:i}=arguments[0]);break;case 2:[t,i]=arguments,e=this}return J0(this,e,t,i),this.check()}transformVector4(e,t=e){return kU(t,e,this),vS(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)}}const Pge={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Fge={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function E5(n){if(!n._animation){const e=Fge[n.componentType],t=Pge[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;l{(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:mn.warn(`Bad animation path ${s}`)()}tn(r[s].length===i[c].length);const u=e[c],h=e[l];switch(t){case"STEP":!function(n,e,t){for(let i=0;iu&&function(n,e,t,i,r){if("rotation"===e){mR.slerp({start:t,target:i,ratio:r});for(let s=0;su&&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:E5(e.accessors[a]),interpolation:l,output:E5(e.accessors[c])})),o=t.channels.map(({sampler:a,target:l})=>({sampler:s[a],target:e.nodes[l.node],path:l.path}));return new zge({name:r,channels:o})})}animate(e){this.setTime(e)}setTime(e){this.animations.forEach(t=>t.animate(e))}getAnimations(){return this.animations}}class Gge extends rm{constructor(e,t={}){super(t),this.onBeforeRender=null,this.AfterRender=null,e instanceof Yg?(this.model=e,this._setModelNodeProps(t)):this.model=new Yg(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 $ge{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},gI(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 _a(this.gl,ot({id:e.name||e.id,parameters:ot(ot({},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&&(mn.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 S5(n,e){return Si(n)?`#version 300 es\n${e}`:e}const Kge={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Xge={modelOptions:{},pbrDebug:!1,imageBasedLightingEnvironment:null,lights:!0,useTangents:!1};class Qge{constructor(e,t={}){this.gl=e,this.options=Object.assign({},Xge,t)}instantiate(e){return this.gltf=e,(e.scenes||[]).map(i=>this.createScene(i))}createAnimator(){return Array.isArray(this.gltf.animations)?new Hge(this.gltf):null}createScene(e){const i=(e.nodes||[]).map(s=>this.createNode(s));return new Z0({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 Z0({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 qn).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 Z0({id:e.name||e.id,children:i});e._mesh=r}return e._mesh}getVertexCount(e){mn.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 $ge(n,e);mn.info(4,"createGLTFModel defines: ",a.defines)();const l=[];l.push(...a.generatedTextures),l.push(...Object.values(s).map(u=>u.buffer));const c=new Gge(n,Object.assign({id:t,drawMode:i,vertexCount:r,modules:[s5],defines:a.defines,parameters:a.parameters,vs:S5(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:S5(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))),mn.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 hr(this.gl,{id:`from-${i.id}`,data:i.data||e.value,target:t})),i.lumaBuffers[t]}createAccessor(e,t){return new ma({buffer:t,offset:e.byteOffset||0,stride:e.bufferView.byteStride||0,type:e.componentType,size:Kge[e.type]})}createSampler(e){return e}needsPOT(){return!1}}function x5(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 sm(i,this.metadata)}selectAt(...e){const t=e.map(i=>this.fields[i]).filter(Boolean);return new sm(t,this.metadata)}assign(e){let t,i=this.metadata;if(e instanceof sm){const o=e;t=o.fields,i=M5(M5(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 sm(s,i)}}function M5(n,e){return new Map([...n||new Map,...e||new Map])}let Lr,D5,I5,O5,R5,N5,P5,F5;!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"}(Lr||(Lr={}));class _R{static isNull(e){return e&&e.typeId===Lr.Null}static isInt(e){return e&&e.typeId===Lr.Int}static isFloat(e){return e&&e.typeId===Lr.Float}static isBinary(e){return e&&e.typeId===Lr.Binary}static isUtf8(e){return e&&e.typeId===Lr.Utf8}static isBool(e){return e&&e.typeId===Lr.Bool}static isDecimal(e){return e&&e.typeId===Lr.Decimal}static isDate(e){return e&&e.typeId===Lr.Date}static isTime(e){return e&&e.typeId===Lr.Time}static isTimestamp(e){return e&&e.typeId===Lr.Timestamp}static isInterval(e){return e&&e.typeId===Lr.Interval}static isList(e){return e&&e.typeId===Lr.List}static isStruct(e){return e&&e.typeId===Lr.Struct}static isUnion(e){return e&&e.typeId===Lr.Union}static isFixedSizeBinary(e){return e&&e.typeId===Lr.FixedSizeBinary}static isFixedSizeList(e){return e&&e.typeId===Lr.FixedSizeList}static isMap(e){return e&&e.typeId===Lr.Map}static isDictionary(e){return e&&e.typeId===Lr.Dictionary}get typeId(){return Lr.NONE}compareTo(e){return this===e}}Symbol,Symbol,D5=Symbol.toStringTag;class om extends _R{constructor(e,t){super(),Kn(this,"isSigned",void 0),Kn(this,"bitWidth",void 0),this.isSigned=e,this.bitWidth=t}get typeId(){return Lr.Int}get[D5](){return"Int"}toString(){return`${this.isSigned?"I":"Ui"}nt${this.bitWidth}`}}class ame extends om{constructor(){super(!0,8)}}class lme extends om{constructor(){super(!0,16)}}class cme extends om{constructor(){super(!0,32)}}class ume extends om{constructor(){super(!1,8)}}class dme extends om{constructor(){super(!1,16)}}class hme extends om{constructor(){super(!1,32)}}I5=Symbol.toStringTag;class k5 extends _R{constructor(e){super(),Kn(this,"precision",void 0),this.precision=e}get typeId(){return Lr.Float}get[I5](){return"Float"}toString(){return`Float${this.precision}`}}class fme extends k5{constructor(){super(32)}}class pme extends k5{constructor(){super(64)}}Symbol,Symbol,O5=Symbol.toStringTag,R5=Symbol.toStringTag,N5=Symbol.toStringTag,P5=Symbol.toStringTag,F5=Symbol.toStringTag;class gme extends _R{constructor(e,t){super(),Kn(this,"listSize",void 0),Kn(this,"children",void 0),this.listSize=e,this.children=[t]}get typeId(){return Lr.FixedSizeList}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get[F5](){return"FixedSizeList"}toString(){return`FixedSizeList[${this.listSize}]<${this.valueType}>`}}class lx{constructor(e,t,i=!1,r=new Map){Kn(this,"name",void 0),Kn(this,"type",void 0),Kn(this,"nullable",void 0),Kn(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 lx(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 L5(n,e,t){const i=t?B5(t.metadata):void 0,r=function(n){switch(n.constructor){case Int8Array:return new ame;case Uint8Array:return new ume;case Int16Array:return new lme;case Uint16Array:return new dme;case Int32Array:return new cme;case Uint32Array:return new hme;case Float32Array:return new fme;case Float64Array:return new pme;default:throw new Error("array type not supported")}}(e.value);return new lx(n,new gme(e.size,new lx("value",r)),!1,i)}function B5(n){const e=new Map;for(const t in n)e.set(`${t}.string`,JSON.stringify(n[t]));return e}const j5={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},bme={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array};class wme{constructor(e){Kn(this,"draco",void 0),Kn(this,"decoder",void 0),Kn(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?u:r,s=h>s?h:s,o=p>o?p:o}return[[e,t,i],[r,s,o]]}(l.attributes),u=function(n,e,t){const i=B5(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=L5(o,n[o],s[o]);r.push(l)}if(t){const o=L5("indices",t);r.push(o)}return new sm(r,i)}(l.attributes,a,l.indices);return Cn(ot({loader:"draco",loaderData:a,header:{vertexCount:s.num_points(),boundingBox:c}},l),{schema:u})}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 cx=Je(125);const wR={};function ER(n){return SR.apply(this,arguments)}function SR(){return(SR=oi(function*(n,e=null,t={}){return e&&(n=Ame(n,e,t)),wR[n]=wR[n]||Tme(n),yield wR[n]})).apply(this,arguments)}function Ame(n,e,t){if(n.startsWith("http"))return n;const i=t.modules||{};return i[n]?i[n]:mO?t.CDN?(Jc(t.CDN.startsWith("http")),`${t.CDN}/${e}@3.0.12/dist/libs/${n}`):_O?`../src/libs/${n}`:`modules/${e}/src/libs/${n}`:`modules/${e}/dist/libs/${n}`}function Tme(n){return xR.apply(this,arguments)}function xR(){return(xR=oi(function*(n){return n.endsWith("wasm")?yield(yield fetch(n)).arrayBuffer():mO?_O?importScripts(n):Mme(yield(yield fetch(n)).text(),n):cx.requireFromFile&&(yield cx.requireFromFile(n))})).apply(this,arguments)}function Mme(n,e){if(!mO)return cx.requireFromString&&cx.requireFromString(n,e);if(_O)return eval.call(jue,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 Dme="https://www.gstatic.com/draco/versioned/decoders/1.4.1/draco_decoder.js",Ime="https://www.gstatic.com/draco/versioned/decoders/1.4.1/draco_wasm_wrapper.js",Ome="https://www.gstatic.com/draco/versioned/decoders/1.4.1/draco_decoder.wasm";let eb;function Nme(n){return CR.apply(this,arguments)}function CR(){return(CR=oi(function*(n){const e=n.modules||{};return eb=e.draco3d?eb||e.draco3d.createDecoderModule({}).then(t=>({draco:t})):eb||Pme(n),yield eb})).apply(this,arguments)}function Pme(n){return TR.apply(this,arguments)}function TR(){return(TR=oi(function*(n){let e,t;switch(n.draco&&n.draco.decoderType){case"js":e=yield ER(Dme,"draco",n);break;case"wasm":default:[e,t]=yield Promise.all([yield ER(Ime,"draco",n),yield ER(Ome,"draco",n)])}return e=e||globalThis.DracoDecoderModule,yield Fme(e,t)})).apply(this,arguments)}function Fme(n,e){const t={};return e&&(t.wasmBinary=e),new Promise(i=>{n(Cn(ot({},t),{onModuleLoaded:r=>i({draco:r})}))})}const DR=Cn(ot({},T5),{parse:function(n,e){return IR.apply(this,arguments)}});function IR(){return(IR=oi(function*(n,e){const{draco:t}=yield Nme(e),i=new wme(t);try{return i.parseSync(n,null==e?void 0:e.draco)}finally{i.destroy()}})).apply(this,arguments)}function nb(n,e){return Ff(n>=0),Ff(e>0),n+(e-1)&~(e-1)}function Bme(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+nb(i.byteLength,4)}const V5=["SCALAR","VEC2","VEC3","VEC4"],jme=[[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Uint32Array,5125],[Float32Array,5126],[Float64Array,5130]],Vme=new Map(jme),Ume={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},zme={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},Hme={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function U5(n){return V5[n-1]||V5[0]}function z5(n){const e=Vme.get(n.constructor);if(!e)throw new Error("Illegal typed array");return e}function H5(n,e){const t=Hme[n.componentType],i=Ume[n.type],s=n.count*i,o=n.count*i*zme[n.componentType];return Ga(o>=0&&o<=e.byteLength),{ArrayType:t,length:s,byteLength:o}}const Gme={asset:{version:"2.0",generator:"loaders.gl"},buffers:[]};class gh{constructor(e){Kn(this,"gltf",void 0),Kn(this,"sourceBuffers",void 0),Kn(this,"byteLength",void 0),this.gltf=e||{json:ot({},Gme),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 Ga(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}=H5(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 Ga(t),this.json.extensions=this.json.extensions||{},this.json.extensions[e]=t,this.registerUsedExtension(e),t}addRequiredExtension(e,t={}){return Ga(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=JO(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;Ga(Number.isFinite(t)),this.sourceBuffers=this.sourceBuffers||[],this.sourceBuffers.push(e);const i={buffer:0,byteOffset:this.byteLength,byteLength:t};return this.byteLength+=nb(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:U5(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:z5(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=Bme(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*t_e(n){for(const e of n.json.meshes||[])for(const t of e.primitives)yield t}function n_e(n){return NR.apply(this,arguments)}function NR(){return(NR=oi(function*(n){const e=new gh(n),{json:t}=e;e.removeExtension(dx);for(const i of t.materials||[])i.extensions&&i.extensions.KHR_materials_unlit&&(i.unlit=!0),e.removeObjectExtension(i,dx)})).apply(this,arguments)}function i_e(n){const e=new gh(n),{json:t}=e;if(e.materials)for(const i of t.materials||[])i.unlit&&(delete i.unlit,e.addObjectExtension(i,dx,{}),e.addExtension(dx))}function r_e(n){return PR.apply(this,arguments)}function PR(){return(PR=oi(function*(n){const e=new gh(n),{json:t}=e,i=e.getExtension(am);i&&(e.json.lights=i.lights,e.removeExtension(am));for(const r of t.nodes||[]){const s=e.getObjectExtension(r,am);s&&(r.light=s.light),e.removeObjectExtension(r,am)}})).apply(this,arguments)}function s_e(n){return FR.apply(this,arguments)}function FR(){return(FR=oi(function*(n){const e=new gh(n),{json:t}=e;if(t.lights){const i=e.addExtension(am);Ga(!i.lights),i.lights=t.lights,delete t.lights}if(e.json.lights){for(const i of e.json.lights)e.addObjectExtension(i.node,am,i);delete e.json.lights}})).apply(this,arguments)}function o_e(n){return kR.apply(this,arguments)}function kR(){return(kR=oi(function*(n){const e=new gh(n),{json:t}=e,i=e.getExtension(hx);if(i){const r=l_e(i,e);for(const s of t.materials||[]){const o=e.getObjectExtension(s,hx);o&&(s.technique=Object.assign({},o,r[o.technique]),s.technique.values=c_e(s.technique,e)),e.removeObjectExtension(s,hx)}e.removeExtension(hx)}})).apply(this,arguments)}function a_e(n,e){return LR.apply(this,arguments)}function LR(){return(LR=oi(function*(n,e){})).apply(this,arguments)}function l_e(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 c_e(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 W5={KHR_draco_mesh_compression:yt,KHR_materials_unlit:ee,KHR_lights_punctual:Tt,KHR_techniques_webgl:dt};function u_e(n){return BR.apply(this,arguments)}function BR(){return(BR=oi(function*(n,e={},t){for(const r in W5){var i;const s=(null==e||null===(i=e.gltf)||void 0===i?void 0:i.excludeExtensions)||{};r in s&&!s[r]||(yield W5[r].decode(n,e,t))}})).apply(this,arguments)}const q5={accessors:"accessor",animations:"animation",buffers:"buffer",bufferViews:"bufferView",images:"image",materials:"material",meshes:"mesh",nodes:"node",samplers:"sampler",scenes:"scene",skins:"skin",textures:"texture"},h_e={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 f_e{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 gh(n),{json:t}=e;for(const i of t.images||[]){const r=e.removeObjectExtension(i,G5);r&&Object.assign(i,r)}t.buffers&&t.buffers[0]&&delete t.buffers[0].uri,e.removeExtension(G5)}(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 q5)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 q5)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=h_e[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 p_e(n,e={}){return(new f_e).normalize(n,e)}const g_e={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},m_e={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},Ml={TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,REPEAT:10497,LINEAR:9729,NEAREST_MIPMAP_LINEAR:9986},__e={magFilter:Ml.TEXTURE_MAG_FILTER,minFilter:Ml.TEXTURE_MIN_FILTER,wrapS:Ml.TEXTURE_WRAP_S,wrapT:Ml.TEXTURE_WRAP_T},y_e={[Ml.TEXTURE_MAG_FILTER]:Ml.LINEAR,[Ml.TEXTURE_MIN_FILTER]:Ml.NEAREST_MIPMAP_LINEAR,[Ml.TEXTURE_WRAP_S]:Ml.REPEAT,[Ml.TEXTURE_WRAP_]:Ml.REPEAT};class w_e{postProcess(e,t={}){const{json:i,buffers:r=[],images:s=[],baseUri:o=""}=e;return Ga(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=ot({},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=ot({},e.normalTexture),e.normalTexture.texture=this.getTexture(e.normalTexture.index)),e.occlusionTexture&&(e.occlustionTexture=ot({},e.occlustionTexture),e.occlusionTexture.texture=this.getTexture(e.occlusionTexture.index)),e.emissiveTexture&&(e.emmisiveTexture=ot({},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=ot({},e.pbrMetallicRoughness);const i=e.pbrMetallicRoughness;i.baseColorTexture&&(i.baseColorTexture=ot({},i.baseColorTexture),i.baseColorTexture.texture=this.getTexture(i.baseColorTexture.index)),i.metallicRoughnessTexture&&(i.metallicRoughnessTexture=ot({},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 m_e[n]}(e.componentType),e.components=function(n){return g_e[n]}(e.type),e.bytesPerElement=e.bytesPerComponent*e.components,e.bufferView){const i=e.bufferView.buffer,{ArrayType:r,byteLength:s}=H5(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):y_e,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 __e[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 E_e(n,e){return(new w_e).postProcess(n,e)}const Y5=1735152710,lm=!0;function VR(n,e,t,i){const r=new Uint8Array(e.buffer,t,i),o=new TextDecoder("utf8").decode(r);return n.json=JSON.parse(o),nb(i,4)}function UR(n,e,t,i){return n.header.hasBinChunk=!0,n.binChunks.push({byteOffset:t,byteLength:i,arrayBuffer:e.buffer}),nb(i,4)}function P_e(n,e){return zR.apply(this,arguments)}function zR(){return(zR=oi(function*(n,e,t=0,i,r){var s,o,a,l;F_e(n,e,t,i),p_e(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 k_e(n,i,r)),null!=i&&null!==(a=i.gltf)&&void 0!==a&&a.loadImages){const h=L_e(n,i,r);c.push(h)}const u=u_e(n,i,r);return c.push(u),yield Promise.all(c),null!=i&&null!==(l=i.gltf)&&void 0!==l&&l.postProcess?E_e(n,i):n})).apply(this,arguments)}function F_e(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=Y5}=t,s=i.getUint32(e,!1);return s===r||s===Y5}(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)?x5(n.buffer,n.byteOffset,e):n instanceof ArrayBuffer?x5(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,lm),a=r.getUint32(t+8,lm);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){Ff(n.header.byteLength>20);const i=e.getUint32(t+0,lm),r=e.getUint32(t+4,lm);return t+=8,Ff(0===r),VR(n,e,t,i),(t+=i)+UR(n,e,t,n.header.byteLength)}(n,r,t);case 2:return function(n,e,t,i){return Ff(n.header.byteLength>20),function(n,e,t,i){for(;t+8<=n.header.byteLength;){const r=e.getUint32(t+0,lm),s=e.getUint32(t+4,lm);switch(t+=8,s){case 1313821514:VR(n,e,t,r);break;case 5130562:UR(n,e,t,r);break;case 0:i.strict||VR(n,e,t,r);break;case 1:i.strict||UR(n,e,t,r)}t+=nb(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),Ga("glTF"===o.type,`Invalid GLB magic string ${o.type}`),n._glb=o,n.json=o.json}else Ga(!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 k_e(n,e,t){return HR.apply(this,arguments)}function HR(){return(HR=oi(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 U_e(()=>e.some(t=>!t.loaded))})).apply(this,arguments)}function U_e(n){return YR.apply(this,arguments)}function YR(){return(YR=oi(function*(n){for(;n();)yield new Promise(e=>requestAnimationFrame(e))})).apply(this,arguments)}const K5=[255,255,255,255],G_e={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:K5},_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:[cm]};let $_e=(()=>{class n extends $0{getShaders(){const t=[rx,sx];return"pbr"===this.props._lighting&&t.push(s5),{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:K5,transition:!0},instanceModelMatrix:n5})}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 rm)r={scenes:[t.scenegraph]};else if(t.scenegraph&&!t.scenegraph.gltf){const l=t.scenegraph,c=function(n,e,t){const i=new Qge(n,t);return{scenes:i.instantiate(e),animator:i.createAnimator()}}(i,l,this._getModelOptions());r=ot({gltf:l},c),function(n){return qR.apply(this,arguments)}(c).then(()=>this.setNeedsRedraw())}else t.scenegraph&&(Ri.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 rm?(this._deleteScenegraph(),this._applyAllAttributes(o),this._applyAnimationsProp(o,a,t._animations),this.setState({scenegraph:o,animator:a})):null!==o&&Ri.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):Ri.warn("animation ".concat(o," not found"))()}})}_deleteScenegraph(){const{scenegraph:t}=this.state;t instanceof rm&&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:ot({isInstanced:!0,transpileToGLSL100:!Si(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:u}=this.props,h=this.getNumInstances();this.state.scenegraph.traverse((p,{worldMatrix:g})=>{p.model.setInstanceCount(h),p.updateModuleSettings(t),p.draw({parameters:i,uniforms:{sizeScale:o,opacity:c,sizeMinPixels:a,sizeMaxPixels:l,composeModelMatrix:i5(s,u),sceneModelMatrix:g,u_Camera:p.model.getUniforms().project_uCameraPosition}})})}}return n.layerName="ScenegraphLayer",n.defaultProps=G_e,n})();class W_e extends fh{constructor(e={}){const{id:t=ga("sphere-geometry")}=e,{indices:i,attributes:r}=function(n){const{nlat:e=10,nlong:t=10}=n;let{radius:i=1}=n;const o=Math.PI-0,c=2*Math.PI-0,u=(e+1)*(t+1);if("number"==typeof i){const H=i;i=(U,de,Ae,Pe,Be)=>H}const h=new Float32Array(3*u),p=new Float32Array(3*u),g=new Float32Array(2*u),w=new(u>65535?Uint32Array:Uint16Array)(e*t*6);for(let H=0;H<=e;H++)for(let U=0;U<=t;U++){const de=U/t,Ae=H/e,Pe=U+H*(t+1),Be=2*Pe,et=3*Pe,wt=c*de,vt=o*Ae,Ct=Math.sin(wt),Bt=Math.cos(wt),$t=Math.sin(vt),mt=Bt*$t,Vt=Math.cos(vt),ft=Ct*$t,qt=i(mt,Vt,ft,de,Ae);h[et+0]=qt*mt,h[et+1]=qt*Vt,h[et+2]=qt*ft,p[et+0]=mt,p[et+1]=Vt,p[et+2]=ft,g[Be+0]=de,g[Be+1]=1-Ae}const C=t+1;for(let H=0;Hs?(gt=i,$t=1,mt=t):mt=e+Bt/s*(t-e),(-2===Bt||Bt===s+2)&&(mt=0,$t=0),gt-=i/2;for(let Vt=0;Vts?0:ft*w,et[vt+Pe[1]]=Bt<0?-1:Bt>s?1:C,et[vt+Pe[2]]=Bt<0||Bt>s?0:qt*w,wt[Ct+0]=Vt/r,wt[Ct+1]=$t,Ct+=2,vt+=3}}for(let Bt=0;Bt0){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=sye,s=1/i;r.set(this.x*s,this.y*s,this.z*s);const o=oye;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(Q5),Q5.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 sye=new le,oye=new le,Q5=new le;class mr{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,u=this.upperBound;e.copy(c),t.set(u.x,c.y,c.z),i.set(u.x,u.y,c.z),r.set(c.x,u.y,u.z),s.set(u.x,c.y,u.z),o.set(c.x,u.y,c.z),a.set(c.x,c.y,u.z),l.copy(u)}toLocalFrame(e,t){const i=J5;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=J5;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,u=(this.upperBound.y-i.y)*s,h=(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,u)),Math.min(h,p)),m=Math.min(Math.min(Math.max(a,l),Math.max(c,u)),Math.max(h,p));return!(m<0||g>m)}}const Z5=new le,J5=[new le,new le,new le,new le,new le,new le,new le,new le];class hs{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=lye;e.tangents(i,cye),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(Er(e.length(),2)*Er(t.length(),2))+e.dot(t),this.normalize()}return this}mult(e,t=new hs){const i=this.x,r=this.y,s=this.z,o=this.w,a=e.x,l=e.y,c=e.z,u=e.w;return t.x=i*u+o*a+r*c-s*l,t.y=r*u+o*l+s*a-i*c,t.z=s*u+o*c+i*l-r*a,t.w=o*u-i*a-r*l-s*c,t}inverse(e=new hs){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 hs){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,u=c*i+a*s-l*r,h=c*r+l*i-o*s,p=c*s+o*r-a*i,g=-o*i-a*r-l*s;return t.x=u*c+g*-o+h*-l-p*-a,t.y=h*c+g*-a+p*-o-u*-l,t.z=p*c+g*-l+u*-a-h*-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 u=o*a+l*c;if(u>.499&&(i=2*Math.atan2(o,c),r=Math.PI/2,s=0),u<-.499&&(i=-2*Math.atan2(o,c),r=-Math.PI/2,s=0),void 0===i){const h=o*o,g=l*l;i=Math.atan2(2*a*c-2*o*l,1-a*a*2-2*g),r=Math.asin(2*u),s=Math.atan2(2*o*c-2*a*l,1-2*h-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),u=Math.sin(i/2);return"XYZ"===r?(this.x=l*o*a+s*c*u,this.y=s*c*a-l*o*u,this.z=s*o*u+l*c*a,this.w=s*o*a-l*c*u):"YXZ"===r?(this.x=l*o*a+s*c*u,this.y=s*c*a-l*o*u,this.z=s*o*u-l*c*a,this.w=s*o*a+l*c*u):"ZXY"===r?(this.x=l*o*a-s*c*u,this.y=s*c*a+l*o*u,this.z=s*o*u+l*c*a,this.w=s*o*a-l*c*u):"ZYX"===r?(this.x=l*o*a-s*c*u,this.y=s*c*a+l*o*u,this.z=s*o*u-l*c*a,this.w=s*o*a+l*c*u):"YZX"===r?(this.x=l*o*a+s*c*u,this.y=s*c*a+l*o*u,this.z=s*o*u-l*c*a,this.w=s*o*a-l*c*u):"XZY"===r&&(this.x=l*o*a-s*c*u,this.y=s*c*a-l*o*u,this.z=s*o*u+l*c*a,this.w=s*o*a+l*c*u),this}clone(){return new hs(this.x,this.y,this.z,this.w)}slerp(e,t,i=new hs){const r=this.x,s=this.y,o=this.z,a=this.w;let p,g,m,w,C,l=e.x,c=e.y,u=e.z,h=e.w;return g=r*l+s*c+o*u+a*h,g<0&&(g=-g,l=-l,c=-c,u=-u,h=-h),1-g>1e-6?(p=Math.acos(g),m=Math.sin(p),w=Math.sin((1-t)*p)/m,C=Math.sin(t*p)/m):(w=1-t,C=t),i.x=w*r+C*l,i.y=w*s+C*c,i.z=w*o+C*u,i.w=w*a+C*h,i}integrate(e,t,i,r=new hs){const s=e.x*i.x,o=e.y*i.y,a=e.z*i.z,l=this.x,c=this.y,u=this.z,h=this.w,p=.5*t;return r.x+=p*(s*h+o*u-a*c),r.y+=p*(o*h+a*l-s*u),r.z+=p*(a*h+s*c-o*l),r.w+=p*(-s*l-o*c-a*u),r}}const lye=new le,cye=new le,uye={SPHERE:1,PLANE:2,BOX:4,COMPOUND:8,CONVEXPOLYHEDRON:16,HEIGHTFIELD:32,PARTICLE:64,CYLINDER:128,TRIMESH:256};let _n=(()=>{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=uye,n})();class Gi{constructor(e={}){this.position=void 0,this.quaternion=void 0,this.position=new le,this.quaternion=new hs,e.position&&this.position.copy(e.position),e.quaternion&&this.quaternion.copy(e.quaternion)}pointToLocal(e,t){return Gi.pointToLocalFrame(this.position,this.quaternion,e,t)}pointToWorld(e,t){return Gi.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(t8),t8.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 t8=new hs;class Bf extends _n{constructor(e={}){const{vertices:t=[],faces:i=[],normals:r=[],axes:s,boundingSphereRadius:o}=e;super({type:_n.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 u=!1;for(let h=0;h!==i.length;h++)if(i[h].almostEquals(r)||i[h].almostEquals(r)){u=!0;break}u||i.push(r.clone())}}}computeNormals(){this.faceNormals.length=this.faces.length;for(let e=0;ep&&(p=w,h=m)}const g=[];for(let m=0;m=0&&this.clipFaceAgainstHull(o,e,t,g,a,l,c)}findSeparatingAxis(e,t,i,r,s,o,a,l){const c=new le,u=new le,h=new le,p=new le,g=new le,m=new le;let w=Number.MAX_VALUE;const C=this;if(C.uniqueAxes)for(let H=0;H!==C.uniqueAxes.length;H++){i.vmult(C.uniqueAxes[H],c);const U=C.testSepAxis(c,e,t,i,r,s);if(!1===U)return!1;U0&&o.negate(o),!0}testSepAxis(e,t,i,r,s,o){Bf.project(this,e,i,r,KR),Bf.project(t,e,s,o,XR);const l=KR[0],c=KR[1],u=XR[0],h=XR[1];if(l0?1/t:0,this.material=e.material||null,this.linearDamping="number"==typeof e.linearDamping?e.linearDamping:.01,this.type=t<=0?yn.STATIC:yn.DYNAMIC,typeof e.type==typeof yn.STATIC&&(this.type=e.type),this.allowSleep=void 0===e.allowSleep||e.allowSleep,this.sleepState=yn.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 hs,this.initQuaternion=new hs,this.previousQuaternion=new hs,this.interpolatedQuaternion=new hs,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 su,this.invMassSolve=0,this.invInertiaSolve=new le,this.invInertiaWorldSolve=new su,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 mr,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=yn.AWAKE,this.wakeUpAfterNarrowphase=!1,e===yn.SLEEPING&&this.dispatchEvent(yn.wakeupEvent)}sleep(){this.sleepState=yn.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=Er(this.sleepSpeedLimit,2);t===yn.AWAKE&&ir?this.wakeUp():t===yn.SLEEPY&&e-this.timeLastSleepy>this.sleepTimeLimit&&(this.sleep(),this.dispatchEvent(yn.sleepEvent))}}updateSolveMassProperties(){this.sleepState===yn.SLEEPING||this.type===yn.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 hs;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=fye,o=pye,a=this.quaternion,l=this.aabb,c=gye;for(let u=0;u!==r;u++){const h=e[u];a.vmult(t[u],s),s.vadd(this.position,s),a.mult(i[u],o),h.calculateWorldAABB(s,o,c.lowerBound,c.upperBound),0===u?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=mye,r=_ye;i.setRotationFromQuaternion(this.quaternion),i.transpose(r),i.scale(t,i),i.mmult(r,this.invInertiaWorld)}}applyForce(e,t=new le){if(this.type!==yn.DYNAMIC)return;this.sleepState===yn.SLEEPING&&this.wakeUp();const i=yye;t.cross(e,i),this.force.vadd(e,this.force),this.torque.vadd(i,this.torque)}applyLocalForce(e,t=new le){if(this.type!==yn.DYNAMIC)return;const i=bye,r=vye;this.vectorToWorldFrame(e,i),this.vectorToWorldFrame(t,r),this.applyForce(i,r)}applyTorque(e){this.type===yn.DYNAMIC&&(this.sleepState===yn.SLEEPING&&this.wakeUp(),this.torque.vadd(e,this.torque))}applyImpulse(e,t=new le){if(this.type!==yn.DYNAMIC)return;this.sleepState===yn.SLEEPING&&this.wakeUp();const i=t,r=wye;r.copy(e),r.scale(this.invMass,r),this.velocity.vadd(r,this.velocity);const s=Eye;i.cross(e,s),this.invInertiaWorld.vmult(s,s),this.angularVelocity.vadd(s,this.angularVelocity)}applyLocalImpulse(e,t=new le){if(this.type!==yn.DYNAMIC)return;const i=Sye,r=xye;this.vectorToWorldFrame(e,i),this.vectorToWorldFrame(t,r),this.applyImpulse(i,r)}updateMassProperties(){const e=Cye;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),px.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!==yn.DYNAMIC&&this.type!==yn.KINEMATIC||this.sleepState===yn.SLEEPING)return;const r=this.velocity,s=this.angularVelocity,o=this.position,a=this.force,l=this.torque,c=this.quaternion,h=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 m=h.elements,w=this.angularFactor,C=l.x*w.x,H=l.y*w.y,U=l.z*w.z;s.x+=e*(m[0]*C+m[1]*H+m[2]*U),s.y+=e*(m[3]*C+m[4]*H+m[5]*U),s.z+=e*(m[6]*C+m[7]*H+m[8]*U),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()}}yn.idCounter=0,yn.COLLIDE_EVENT_NAME="collide",yn.DYNAMIC=1,yn.STATIC=2,yn.KINEMATIC=4,yn.AWAKE=0,yn.SLEEPY=1,yn.SLEEPING=2,yn.wakeupEvent={type:"wakeup"},yn.sleepyEvent={type:"sleepy"},yn.sleepEvent={type:"sleep"};const fye=new le,pye=new hs,gye=new mr,mye=new su,_ye=new su,yye=new le,bye=new le,vye=new le,wye=new le,Eye=new le,Sye=new le,xye=new le,Cye=new le;new le,new le;class gx{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 n8,i8,r8,s8,o8,a8,l8;n8=_n.types.SPHERE,i8=_n.types.PLANE,r8=_n.types.BOX,s8=_n.types.CYLINDER,o8=_n.types.CONVEXPOLYHEDRON,a8=_n.types.HEIGHTFIELD,l8=_n.types.TRIMESH;class bs{get[n8](){return this._intersectSphere}get[i8](){return this._intersectPlane}get[r8](){return this._intersectBox}get[s8](){return this._intersectConvex}get[o8](){return this._intersectConvex}get[a8](){return this._intersectHeightfield}get[l8](){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=bs.ANY,this.result=new gx,this.hasHit=!1,this.callback=i=>{}}intersectWorld(e,t){return this.mode=t.mode||bs.ANY,this.result=t.result||new gx,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(c8),eN.length=0,e.broadphase.aabbQuery(e,c8,eN),this.intersectBodies(eN),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=Rye,s=Nye;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 u=new le;o.vsub(i,u);const h=u.dot(c);if(a.vsub(i,u),h*u.dot(c)>0||o.distanceTo(a)=0&&w<=1&&(o.lerp(a,w,g),g.vsub(i,m),m.normalize(),this.reportIntersection(m,g,s,r,-1)),this.result.shouldStop)return;C>=0&&C<=1&&(o.lerp(a,C,g),g.vsub(i,m),m.normalize(),this.reportIntersection(m,g,s,r,-1))}}_intersectConvex(e,t,i,r,s,o){const a=Bye,l=d8,c=o&&o.faceList||null,u=e.faces,h=e.vertices,p=e.faceNormals,g=this.direction,m=this.from,C=m.distanceTo(this.to),H=c?c.length:u.length,U=this.result;for(let de=0;!U.shouldStop&&deC||this.reportIntersection(a,ba,s,r,Ae)}}}}_intersectTrimesh(e,t,i,r,s,o){const a=jye,l=$ye,c=Wye,u=d8,h=Vye,p=Uye,g=zye,m=Gye,w=Hye,C=e.indices,H=this.from,U=this.to,de=this.direction;c.position.copy(i),c.quaternion.copy(t),Gi.vectorToLocalFrame(i,t,de,h),Gi.pointToLocalFrame(i,t,H,p),Gi.pointToLocalFrame(i,t,U,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,h),h.normalize();const Ae=p.distanceSquared(g);e.tree.rayQuery(this,c,l);for(let Pe=0,Be=l.length;!this.result.shouldStop&&Pe!==Be;Pe++){const et=l[Pe];e.getNormal(et,a),e.getVertex(C[3*et],yc),yc.vsub(p,u);const wt=h.dot(a),vt=a.dot(u)/wt;if(vt<0)continue;h.scale(vt,ba),ba.vadd(p,ba),e.getVertex(C[3*et+1],au),e.getVertex(C[3*et+2],lu);const Ct=ba.distanceSquared(p);!bs.pointInTriangle(ba,au,yc,lu)&&!bs.pointInTriangle(ba,yc,au,lu)||Ct>Ae||(Gi.vectorToWorldFrame(t,a,w),Gi.pointToWorldFrame(i,t,ba,m),this.reportIntersection(w,m,s,r,et))}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 bs.ALL:this.hasHit=!0,c.set(o,a,e,t,i,r,l),c.hasHit=!0,this.callback(c);break;case bs.CLOSEST:(l=0&&(h=s*c-o*a)>=0&&u+hDate.now()-n}var Hf=Je(517);class Br extends se{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 $;return this._value}next(e){super.next(this._value=e)}}function fm(n,e,t){e||(e=new qn(qn.IDENTITY));const i=new qn(qn.IDENTITY);if(!n)return!0;if(n.matrix)i.copy(n.matrix);else{if(i.identity(),n.translation&&i.translate(n.translation),n.rotation){const s=new qn(qn.IDENTITY).fromQuaternion(n.rotation);i.multiplyRight(s)}n.scale&&i.scale(n.scale)}const r=new qn(e).multiplyRight(i);if(!1===t(n,r,e))return!1;for(const s of n.nodes||n.children||[])if(!1===fm(s,r,t))return!1;return!0}function n6(){Nz([T5,cm])}function i6(n,e){var t;const i=null===(t=e.nodes)||void 0===t?void 0:t.find(r=>r.name===n);if(i){let r=!1;for(const s of e.scenes)r||fm(s,new qn(qn.IDENTITY),(o,a)=>o!==i||(o.matrix=a,o.translation=void 0,o.rotation=void 0,o.scale=void 0,r=!0,!1));return e.scene={id:n,name:n,nodes:[i]},e.scenes=[e.scene],{scene:e.scene,scenes:e.scenes}}return e}function rN(n,e){return Fi(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 WS(i,cm,{DracoLoader:DR,gltf:{decompressMeshes:!0,postProcess:!0}});return r.nodes||console.log("WARNING: Empty Scene",t,r),i6(n.scenegraphNode,r)})}function qve(n,e){return Fi(this,void 0,void 0,function*(){return i6(n,yield e)})}function sN(n,e,t){if(e&&0!==e.length){let i;switch(t.geometry){case"sphere":i=new W_e;break;case"cone":i=new X_e;break;case"cylinder":i=new Q_e;break;case"cube":default:i=new iye}return new Sge(Object.assign({id:n,pickable:!0,autoHighlight:!1,highlightColor:[30,136,229,255],coordinateSystem:ji.CARTESIAN,data:e,mesh:i,wireframe:!1,getTransformMatrix:r=>r.transformMatrix,getColor:r=>r.color||[255,255,255,229.5]},t))}}function r6(n,e,t){if(e&&0!==e.length)return new fge(Object.assign({id:n,pickable:!0,data:e.map(i=>Object.assign(Object.assign({},i),{position:new qn(i.transformMatrix).getTranslation()})),getText:i=>i.text,getPosition:i=>i.position,getColor:i=>i.color},t))}let Kve=(()=>{class n extends jz{initializeState(){const{data:t}=this.props;this.setState({data:null!=t?t:[],zoomOpacity:.8,doCollisions:!1}),n6()}renderLayers(){var t,i;const r=this.state,s={sphere:[],cone:[],cylinder:[],cube:[],text:[],wireframe:[],scenegraph:[]};for(const l of r.data){const c=null!==(t=l.geometry)&&void 0!==t?t:"cube";l.scenegraph?s.scenegraph.push(l):void 0!==s[c]&&s[c].push(l)}const o={};for(const l of s.scenegraph)l.scenegraph&&l.scenegraphNode&&!Object.prototype.hasOwnProperty.call(o,l.scenegraph)&&(o[l.scenegraph]=rN({scenegraph:l.scenegraph},n.gltfCache));const a=[];for(const[l,c]of Object.entries(s))if("scenegraph"===l)for(const u of c)a.push(new $_e({id:"models-"+u["@id"],opacity:u.zoomBasedOpacity?r.zoomOpacity:void 0!==u.opacity?u.opacity:1,pickable:!u.unpickable,coordinateSystem:ji.CARTESIAN,data:[u],scenegraph:u.scenegraphNode?qve(u.scenegraphNode,o[u.scenegraph]):u.scenegraph,_lighting:u._lighting,getTransformMatrix:u.transformMatrix,getColor:null!==(i=u.color)&&void 0!==i?i:[0,255,0,127.5],parameters:{depthMask:!u.zoomBasedOpacity&&(void 0===u.opacity||1===u.opacity)}}));else"text"===l?(a.push(r6("text",c.filter(u=>u.unpickable),{pickable:!1})),a.push(r6("textPickable",c.filter(u=>!u.unpickable),{pickable:!0}))):"wireframe"===l?a.push(sN(l,c,{wireframe:!0,pickable:!1,geometry:l})):(a.push(sN(l,c.filter(u=>u.unpickable),{wireframe:!1,pickable:!1,geometry:l})),a.push(sN(`${l}Pickable`,c.filter(u=>!u.unpickable),{wireframe:!1,pickable:!0,geometry:l})));return r.doCollisions&&function(n){Fi(this,void 0,void 0,function*(){console.log("Starting Collisioning");const e=n.filter(o=>!o.scenegraph&&"wireframe"!==o.geometry).map(o=>{const a=new qn(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 mr({lowerBound:new le(...l.map((u,h)=>Math.min(u,c[h]))),upperBound:new le(...c.map((u,h)=>Math.max(u,l[h])))})}}),t=[];for(const o of n.filter(a=>!!a.scenegraph)){const a=yield G0(o.scenegraph,cm,{DracoLoader:DR,decompress:!0,postProcess:!0});for(const l of a.scenes)fm(l,new qn(o.transformMatrix),(c,u)=>{if(c.mesh&&c.mesh.primitives&&c.mesh.primitives.length>0)for(const h of c.mesh.primitives)if(h.attributes.POSITION&&h.attributes.POSITION.min){const p=u.transformAsPoint(h.attributes.POSITION.min,[]),g=u.transformAsPoint(h.attributes.POSITION.max,[]);t.push({"@id":o["@id"],name:c.name,entityId:o.entityId,bbox:new mr({lowerBound:new le(...p.map((m,w)=>Math.min(m,g[w]))),upperBound:new le(...g.map((m,w)=>Math.max(m,p[w])))}),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})}(r.data),a.filter(l=>!!l)}getPickingInfo(t){return t.info}}return n.layerName="BodyUILayer",n.gltfCache={},n})();function s6(n,e=[]){for(const t of n.nodes||n.children||[])e.push(t.name),s6(t,e);return e}let Qve=(()=>{class n{constructor(t){var i,r,s,o,a;this.deckProps=t,this.bodyUILayer=new Kve({}),this.nodeClickSubject=new se,this.nodeHoverStartSubject=new se,this.nodeHoverStopSubject=new se,this.sceneRotationSubject=new Br([0,0]),this.nodeDragStartSubject=new se,this.nodeDragSubject=new se,this.nodeDragEndSubject=new se,this.nodeClick$=this.nodeClickSubject.pipe(Es()),this.nodeHoverStart$=this.nodeHoverStartSubject.pipe(Es()),this.nodeHoverStop$=this.nodeHoverStopSubject.pipe(Es()),this.sceneRotation$=this.sceneRotationSubject.pipe(Es()),this.nodeDragStart$=this.nodeDragStartSubject.pipe(Es()),this.nodeDrag$=this.nodeDragSubject.pipe(Es()),this.nodeDragEnd$=this.nodeDragEndSubject.pipe(Es());const l=Object.assign(Object.assign({},t),{views:["orthographic"===t.camera?new Kde({flipY:!1,near:-1e3}):new Zde({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 u;return null!==(u=this.cursor)&&void 0!==u?u:c.isDragging?"grabbing":"grab"}});t.legacyLighting&&(l.effects=[new GO({ambientLight:new Gz({color:[255,255,255],intensity:10})})]),this.deck=new ix(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 Fi(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 qn([.076,0,0,0,0,.076,16875389974302382e-33,0,0,-16875389974302382e-33,.076,0,.49,.034,.11,1]);(function(n,e,t){return Fi(this,void 0,void 0,function*(){n6();const i=yield rN({scenegraph:n,scenegraphNode:"VHF_Kidney_L_Low1"}),r={},s=[];for(const o of i.scenes)fm(o,e=new qn(e||qn.IDENTITY),(a,l)=>{const c={"@id":a.name||a.id,"@type":"ProcessedNode",transformMatrix:new qn(l),geometry:"wireframe",node:a};if(s.push({"@id":`GLTF:${c["@id"]}`,"@type":"GLTFNode",scenegraph:n,scenegraphNode:c["@id"],transformMatrix:new qn(e||qn.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 u of a.mesh.primitives)if(u.attributes.POSITION&&u.attributes.POSITION.min){const h=l.transformAsPoint(u.attributes.POSITION.min,[]),p=l.transformAsPoint(u.attributes.POSITION.max,[]);c.bbox=new mr({lowerBound:new le(...h.map((g,m)=>Math.min(g,p[m]))),upperBound:new le(...p.map((g,m)=>Math.max(g,h[m])))})}return r[c["@id"]]=c,!0});for(const o of Object.values(r).filter(a=>!a.bbox)){for(const a of s6(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,u=(o.size=o.bbox.upperBound.clone().vsub(a)).clone().vmul(new le(.5,.5,.5)),h=o.center=a.clone().vadd(u);o.transformMatrix=new qn(qn.IDENTITY).translate(h.toArray()).scale(u.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 qn(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 rr([Hf.ZP],n.prototype,"_onHover",null),rr([Hf.ZP],n.prototype,"_onClick",null),rr([Hf.ZP],n.prototype,"_onViewStateChange",null),rr([Hf.ZP],n.prototype,"_onDragStart",null),rr([Hf.ZP],n.prototype,"_onDrag",null),rr([Hf.ZP],n.prototype,"_onDragEnd",null),n})();function Zve(n,e){return n===e}function Jve(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 oN=(()=>{class n{constructor(){this.bootstrap$=new kg(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 aN=new Ht("INITIAL_STATE_TOKEN");let nwe=(()=>{class n{static set(t){this.value=t}static pop(){const t=this.value;return this.value={},t}}return n.value={},n})();const o6=new Ht("Internals.StateContextFactory"),a6=new Ht("Internals.StateFactory");function ub(...n){if(1===n.length){const e=n[0];if(P(e))return Cx(e,null);if(Q(e)&&Object.getPrototypeOf(e)===Object.prototype){const t=Object.keys(e);return Cx(t.map(i=>e[i]),t)}}if("function"==typeof n[n.length-1]){const e=n.pop();return Cx(n=1===n.length&&P(n[0])?n[0]:n,null).pipe(me(t=>e(...t)))}return Cx(n,null)}function Cx(n,e){return new I(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]=u},error:u=>t.error(u),complete:()=>{s++,(s===i||!c)&&(o===i&&t.next(e?e.reduce((u,h,p)=>(u[h]=r[p],u),{}):r),t.complete())}}))}})}function Qi(n,e){return function(i){return i.lift(new iwe(n,e))}}class iwe{constructor(e,t){this.predicate=e,this.thisArg=t}call(e,t){return t.subscribe(new rwe(e,this.predicate,this.thisArg))}}class rwe 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 $a(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(u){let h;s++,!r||a?(a=!1,r=new kg(n,e,i),h=r.subscribe(this),o=u.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)):h=r.subscribe(this),this.add(()=>{s--,h.unsubscribe(),h=void 0,o&&!l&&t&&0===s&&(o.unsubscribe(),o=void 0,r=void 0)})}}(i))}const l6=(()=>{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 Wi(n){return e=>0===n?lS():e.lift(new owe(n))}class owe{constructor(e){if(this.total=e,this.total<0)throw new l6}call(e,t){return t.subscribe(new awe(e,this.total))}}class awe 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 c6(n,e){return e?t=>t.pipe(c6((i,r)=>je(n(i,r)).pipe(me((s,o)=>e(i,s,r,o))))):t=>t.lift(new lwe(n))}class lwe{constructor(e){this.project=e}call(e,t){return t.subscribe(new cwe(e,this.project))}}class cwe extends ve{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 _t(this),i=this.destination;i.add(t);const r=N(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 Ax(n=null){return e=>e.lift(new uwe(n))}class uwe{constructor(e){this.defaultValue=e}call(e,t){return t.subscribe(new dwe(e,this.defaultValue))}}class dwe 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 bc(n){return function(t){const i=new hwe(n),r=t.lift(i);return i.caught=r}}class hwe{constructor(e){this.selector=e}call(e,t){return t.subscribe(new fwe(e,this.selector,this.caught))}}class fwe extends ve{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 _t(this);this.add(i);const r=N(t,i);r!==i&&this.add(r)}}}function _r(n){return e=>e.lift(new pwe(n))}class pwe{constructor(e){this.notifier=e}call(e,t){const i=new gwe(e),r=N(this.notifier,new _t(i));return r&&!i.seenValue?(i.add(r),t.subscribe(i)):i}}class gwe extends ve{constructor(e){super(e),this.seenValue=!1}notifyNext(){this.seenValue=!0,this.complete()}notifyComplete(){}}function _h(){}function Yr(n,e,t){return function(r){return r.lift(new mwe(n,e,t))}}class mwe{constructor(e,t,i){this.nextOrObserver=e,this.error=t,this.complete=i}call(e,t){return t.subscribe(new _we(e,this.nextOrObserver,this.error,this.complete))}}class _we extends y{constructor(e,t,i,r){super(e),this._tapNext=_h,this._tapError=_h,this._tapComplete=_h,this._tapError=i||_h,this._tapComplete=r||_h,Y(t)?(this._context=this,this._tapNext=t):t&&(this._context=t,this._tapNext=t.next||_h,this._tapError=t.error||_h,this._tapComplete=t.complete||_h)}_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 rd(n,e){return t=>t.lift(new ywe(n,e))}class ywe{constructor(e,t){this.compare=e,this.keySelector=t}call(e,t){return t.subscribe(new bwe(e,this.compare,this.keySelector))}}class bwe 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 Wa={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 u6=(()=>{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 gn.isInAngularZone()?t():this._ngZone.run(t)}runOutsideAngular(t){return gn.isInAngularZone()?this._ngZone.runOutsideAngular(t):t()}verifyZoneIsNotNooped(t){t instanceof gn||console.warn(Wa.ZONE_WARNING())}}return n.\u0275fac=function(t){return new(t||n)(Oe(gn),Oe(Wc))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const d6=new Ht("ROOT_STATE_TOKEN"),h6=new Ht("FEATURE_STATE_TOKEN"),f6=new Ht("NGXS_PLUGINS"),p6=new Ht("NG_TEST_MODE"),g6=new Ht("NG_DEV_MODE"),sd="NGXS_META",m6="NGXS_OPTIONS_META",lN="NGXS_SELECTOR_META";let Gf=(()=>{class n{constructor(){this.defaultsState={},this.selectorOptions={injectContainerState:!0,suppressErrors:!0},this.compatibility={strictContentSecurityPolicy:!1},this.executionStrategy=u6}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();class vwe{constructor(e,t,i){this.previousValue=e,this.currentValue=t,this.firstChange=i}}const _6=new Ht("NGXS_EXECUTION_STRATEGY");function $f(n){return n.constructor&&n.constructor.type?n.constructor.type:n.type}const y6=(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},Tx=(n,e)=>e.split(".").reduce((t,i)=>t&&t[i],n),cN=n=>n&&"object"==typeof n&&!Array.isArray(n),uN=(n,...e)=>{if(!e.length)return n;const t=e.shift();if(cN(n)&&cN(t))for(const i in t)cN(t[i])?(n[i]||Object.assign(n,{[i]:{}}),uN(n[i],t[i])):Object.assign(n,{[i]:t[i]});return uN(n,...e)};function dN(n){if(!n.hasOwnProperty(sd)){const e={name:null,actions:{},defaults:{},path:null,makeRootSelector:t=>t.getStateGetter(e.name),children:[]};Object.defineProperty(n,sd,{value:e})}return db(n)}function db(n){return n[sd]}function fN(n){return n[lN]}function b6(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(e[$f(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 Qi(t=>{const i=$f(t.action);return n[i]&&(!e||e[t.status])})}(i,r),t())}}(n,["DISPATCHED"])}function Owe(){return me(n=>n.action)}function Mx(n){return e=>new I(t=>e.subscribe({next(i){n.leave(()=>t.next(i))},error(i){n.leave(()=>t.error(i))},complete(){n.leave(()=>t.complete())}}))}let Dx=(()=>{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)(Oe(_6))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();class Pwe extends se{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 Ix=(()=>{class n extends Pwe{}return n.\u0275fac=function(){let e;return function(i){return(e||(e=nr(n)))(i||n)}}(),n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),Fwe=(()=>{class n extends I{constructor(t,i){super(r=>{const s=t.pipe(Mx(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)(Oe(Ix),Oe(Dx))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const w6=n=>(...e)=>n.shift()(...e,(...i)=>w6(n)(...i));let Ox=(()=>{class n extends Br{constructor(){super({})}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),pN=(()=>{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)(Oe(n,12),Oe(f6,8))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),gN=(()=>{class n extends se{}return n.\u0275fac=function(){let e;return function(i){return(e||(e=nr(n)))(i||n)}}(),n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),E6=(()=>{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(oa),this._errorHandler.handleError(r)}catch(s){}})}),i.pipe(Mx(this._ngxsExecutionStrategy))}dispatchByEvents(t){return Array.isArray(t)?0===t.length?fn(this._stateStream.getValue()):ub(t.map(i=>this.dispatchSingle(i))):this.dispatchSingle(t)}dispatchSingle(t){if(!$f(t))return Fg(new Error(`This action doesn't have a type property: ${t.constructor.name}`));const r=this._stateStream.getValue();return w6([...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($a())}getActionResultStream(t){return this._actionResults.pipe(Qi(i=>i.action===t&&"DISPATCHED"!==i.status),Wi(1),$a())}createDispatchObservable(t){return t.pipe(c6(i=>{switch(i.status){case"SUCCESSFUL":return fn(this._stateStream.getValue());case"ERRORED":return Fg(i.error);default:return Yc}})).pipe($a())}}return n.\u0275fac=function(t){return new(t||n)(Oe(Wn),Oe(Ix),Oe(gN),Oe(pN),Oe(Ox),Oe(Dx))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const S6=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])&&S6(n[i])}),n};let x6=(()=>{class n{constructor(t,i){this.isDevMode=t,this.isTestMode=i}}return n.\u0275fac=function(t){return new(t||n)(Oe(g6),Oe(p6))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),C6=(()=>{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(Wa.INCORRECT_PRODUCTION()):this.isIncorrectDevelopment&&console.warn(Wa.INCORRECT_DEVELOPMENT()))}}return n.\u0275fac=function(t){return new(t||n)(Oe(x6),Oe(Gf))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),gm=(()=>{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=S6(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)(Oe(Ox),Oe(E6),Oe(Gf),Oe(C6))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),Rx=(()=>{class n{constructor(t){this._internalStateOperations=t}createStateContext(t){const i=this._internalStateOperations.getRootStateOperations();function r(l){return Tx(l,t.path)}function s(l,c){const u=y6(l,t.path,c),h=t.instance;if(h.ngxsOnChanges){const p=v6(t,{currentAppState:l,newAppState:u});h.ngxsOnChanges(p)}return i.setState(u),u}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(Wa.PATCHING_ARRAY());if("object"!=typeof n)throw new Error(Wa.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)(Oe(gm))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();class Nx{static stateNameErrorMessage(e){return Wa.STATE_NAME(e)}static checkCorrectStateName(e){if(!e)throw new Error(Wa.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(Wa.STATE_UNIQUE(r,e.name,s.name));return r}static getValidStateMeta(e){const t=db(e);if(!t)throw new Error(Wa.STATE_DECORATOR());return t}}Nx.stateNameRegex=new RegExp("^[a-zA-Z0-9_]+$");let mm=(()=>{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=xx(()=>{const c=this;function u(p){const g=c.statePaths[p];return g?b6(g.split("."),c._config):null}return this._parentFactory?this._parentFactory.getRuntimeSelectorContext():{getStateGetter(p){let g=u(p);return g||((...m)=>(g||(g=u(p)),g?g(...m):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(Nx.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[sd].name};return n.reduce((t,i)=>{const{name:r,children:s}=i[sd];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[sd].name]=t,e),{})}(i),l=[];for(const c of s){const u=a[c],h=o[c],p=u[sd];this.addRuntimeInfoToMeta(p,h);const g={name:c,path:h,isInitialised:!1,actions:p.actions,instance:this._injector.get(u),defaults:n.cloneDefaults(p.defaults)};this.hasBeenMountedAndBootstrapped(c,h)||l.push(g),this.states.push(g)}return l}addAndReturnDefaults(t){const r=this.add(t||[]);return{defaults:r.reduce((o,a)=>y6(o,a.path,a.defaults),{}),states:r}}connectActionHandlers(){null===this._actionsSubscription&&(this._actionsSubscription=this._actions.pipe(Qi(t=>"DISPATCHED"===t.status),B(({action:t})=>this.invokeActions(this._actions,t).pipe(me(()=>({action:t,status:"SUCCESSFUL"})),Ax({action:t,status:"CANCELED"}),bc(i=>fn({action:t,status:"ERRORED",error:i}))))).subscribe(t=>this._actionResults.next(t)))}invokeActions(t,i){const r=$f(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 u=o.instance[l.fn](c,i);u instanceof Promise&&(u=je(u)),u instanceof I?(u=u.pipe(Ax({})),l.options.cancelUncompleted&&(u=u.pipe(_r(t.pipe(Mwe(i)))))):u=fn({}).pipe($a()),s.push(u)}catch(u){s.push(Fg(u))}}}return s.length||s.push(fn({})),ub(s)}addToStatesMap(t){const i=[],r=this.statesByName;for(const s of t){const o=Nx.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!==Tx(this._initialState,i);return this.statesByName[t]&&r}}return n.\u0275fac=function(t){return new(t||n)(Oe(Wn),Oe(Gf),Oe(n,12),Oe(Ix),Oe(gN),Oe(Rx),Oe(aN,8))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),mN=(()=>{class n{constructor(t,i,r){this.internalStateOperations=t,this.stateContextFactory=i,this.bootstrapper=r}ngxsBootstrap(t,i){this.internalStateOperations.getRootStateOperations().dispatch(t).pipe(Qi(()=>!!i),Yr(()=>this.invokeInit(i.states)),B(()=>this.bootstrapper.appBootstrapped$),Qi(r=>!!r)).subscribe(()=>this.invokeBootstrap(i.states))}invokeInit(t){for(const i of t){const r=i.instance;if(r.ngxsOnChanges){const a=v6(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)(Oe(gm),Oe(Rx),Oe(oN))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const Px_getOptions=n=>n&&n.NGXS_SELECTOR_OPTIONS_META||{};function Lwe(n,e,t){const i=t&&t.containerClass,s=xx(function(...c){const u=e.apply(i,c);return u instanceof Function?xx.apply(null,[u]):u});Object.setPrototypeOf(s,e);const o=function(n,e){const t=function(n){return n.hasOwnProperty(lN)||Object.defineProperty(n,lN,{value:{makeRootSelector:null,originalFn:null,containerClass:null,selectorName:null,getSelectorOptions:()=>({})}}),fN(n)}(n);t.originalFn=n;let i=()=>({});e&&(t.containerClass=e.containerClass,t.selectorName=e.selectorName,i=e.getSelectorOptions||i);const r=Object.assign({},t);return t.getSelectorOptions=()=>function(n,e){return Object.assign({},Px_getOptions(n.containerClass)||{},Px_getOptions(n.originalFn)||{},n.getSelectorOptions()||{},e)}(r,i()),t}(e,t);return o.makeRootSelector=l=>{const{argumentSelectorFunctions:c,selectorOptions:u}=function(n,e,t=[]){const i=e.getSelectorOptions(),r=n.getSelectorOptions(i);return{selectorOptions:r,argumentSelectorFunctions:function(n=[],e,t){const i=[];return t&&(0===n.length||e.injectContainerState)&&db(t)&&i.push(t),n&&i.push(...n),i}(t,r,e.containerClass).map(a=>T6(a)(n))}}(l,o,n);return function(p){const g=c.map(m=>m(p));try{return s(...g)}catch(m){if(m instanceof TypeError&&u.suppressErrors)return;throw m}}},s}function T6(n){const e=fN(n)||db(n);return e&&e.makeRootSelector||(()=>n)}let cu=(()=>{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),bc(r=>{const{suppressErrors:s}=this._config.selectorOptions;return r instanceof TypeError&&s?fn(void 0):Fg(r)}),rd(),Mx(this._internalExecutionStrategy))}selectOnce(t){return this.select(t).pipe(Wi(1))}selectSnapshot(t){return this.getStoreBoundSelectorFn(t)(this._stateStream.getValue())}subscribe(t){return this._stateStream.pipe(Mx(this._internalExecutionStrategy)).subscribe(t)}snapshot(){return this._internalStateOperations.getRootStateOperations().getState()}reset(t){return this._internalStateOperations.getRootStateOperations().setState(t)}getStoreBoundSelectorFn(t){return T6(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)(Oe(Ox),Oe(gm),Oe(Gf),Oe(Dx),Oe(mm),Oe(aN,8))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),hb=(()=>{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)(Oe(cu),Oe(Gf))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n.store=null,n.config=null,n})();class zwe{static get type(){return"@@INIT"}}class Hwe{constructor(e){this.addedStates=e}static get type(){return"@@UPDATE_STATE"}}const Fx=new kg(1);let $we=(()=>{class n{constructor(t,i,r,s,o=[],a){!function(){try{const n=window.ng,t=!(n.probe&&n.coreTokens)&&Ba();Fx.next(t)}catch(n){Fx.next(!1)}finally{Fx.complete()}}();const l=t.addAndReturnDefaults(o);i.setStateToTheCurrentWithNew(l),t.connectActionHandlers(),a.ngxsBootstrap(new zwe,l)}}return n.\u0275fac=function(t){return new(t||n)(Oe(mm),Oe(gm),Oe(cu),Oe(hb),Oe(d6,8),Oe(mN))},n.\u0275mod=on({type:n}),n.\u0275inj=xt({}),n})(),Wwe=(()=>{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 Hwe(l.defaults),l))}static flattenStates(t=[]){return t.reduce((i,r)=>i.concat(r),[])}}return n.\u0275fac=function(t){return new(t||n)(Oe(cu),Oe(gm),Oe(mm),Oe(h6,8),Oe(mN))},n.\u0275mod=on({type:n}),n.\u0275inj=xt({}),n})();class Wo{static forRoot(e=[],t={}){return{ngModule:$we,providers:[mm,Rx,Fwe,Ix,oN,C6,x6,mN,E6,gN,gm,Dx,cu,Ox,hb,pN,...e,...Wo.ngxsTokenProviders(e,t)]}}static forFeature(e=[]){return{ngModule:Wwe,providers:[mm,pN,...e,{provide:h6,multi:!0,useValue:e}]}}static ngxsTokenProviders(e,t){return[{provide:p6,useValue:twe},{provide:g6,useValue:Ba},{provide:_6,useClass:t.executionStrategy||u6},{provide:d6,useValue:e},{provide:Wo.ROOT_OPTIONS,useValue:t},{provide:Gf,useFactory:Wo.ngxsConfigFactory,deps:[Wo.ROOT_OPTIONS]},{provide:RE,useFactory:Wo.appBootstrapListenerFactory,multi:!0,deps:[oN]},{provide:aN,useFactory:Wo.getInitialState},{provide:o6,useExisting:Rx},{provide:a6,useExisting:mm}]}static ngxsConfigFactory(e){return uN(new Gf,e)}static appBootstrapListenerFactory(e){return()=>e.bootstrap()}static getInitialState(){return nwe.pop()}}function _N(n,e){return(t,i)=>{if(t.hasOwnProperty("prototype"))throw new Error(Wa.ACTION_DECORATOR());const s=dN(t.constructor);Array.isArray(n)||(n=[n]);for(const o of n){const a=o.type;s.actions[a]||(s.actions[a]=[]),s.actions[a].push({fn:i,options:e||{},type:a})}}}function M6(n){return i=>{!function(n){Fx.subscribe(e=>{e&&(n.\u0275prov||console.warn(Wa.UNDECORATED_STATE_IN_IVY(n.name)))})}(i);const r=i,s=dN(r),o=Object.getPrototypeOf(r),a=function(i){return Object.assign({},i[m6]||{},n)}(o);(function(i){const{meta:r,inheritedStateClass:s,optionsWithInheritance:o}=i,{children:a,defaults:l,name:c}=o,u="string"==typeof c?c:c&&c.getName()||null;Nx.checkCorrectStateName(u),s.hasOwnProperty(sd)&&(r.actions=Object.assign({},r.actions,(s[sd]||{}).actions)),r.children=a,r.defaults=l,r.name=u})({meta:s,inheritedStateClass:o,optionsWithInheritance:a}),r[m6]=a}}function kx(n,...e){return function(t,i){const r=i.toString(),s=`__${r}__selector`,o=function(n,e,t=[]){return"string"==typeof(e=e||function(n){const e=n.length-1;return 36===n.charCodeAt(e)?n.slice(0,e):n}(n))?b6(t.length?[e,...t]:e.split("."),hb.config):e}(r,n,e);Object.defineProperties(t,{[s]:{writable:!0,enumerable:!1,configurable:!0},[r]:{enumerable:!0,configurable:!0,get(){return this[s]||(this[s]=function(n){if(!hb.store)throw new Error(Wa.SELECT_FACTORY_NOT_CONNECTED());return hb.store.select(n)}(o))}}})}}function _m(n){return(e,t,i)=>{if(!i||null===i.value)throw new Error(Wa.SELECTOR_DECORATOR());const s=i.value,o=Lwe(n,s,{containerClass:e,selectorName:t.toString(),getSelectorOptions:()=>({})}),a={configurable:!0,get:()=>o};return a.originalFn=s,a}}function Dl(n,...e){return e.length?e.some(t=>n[t]):n.altKey||n.shiftKey||n.ctrlKey||n.metaKey}Wo.\u0275fac=function(e){return new(e||Wo)},Wo.\u0275mod=on({type:Wo}),Wo.\u0275inj=xt({}),Wo.ROOT_OPTIONS=new Ht("ROOT_OPTIONS");const Kx=new uc(aS);class iSe{constructor(e){this.total=e}call(e,t){return t.subscribe(new rSe(e,this.total))}}class rSe extends y{constructor(e,t){super(e),this.total=t,this.count=0}_next(e){++this.count>this.total&&this.destination.next(e)}}function xi(n){return null!=n&&"false"!=`${n}`}function Xx(n){return Array.isArray(n)?n:[n]}function vs(n){return null==n?"":"string"==typeof n?n:`${n}px`}function ad(n){return n instanceof En?n.nativeElement:n}let zN;try{zN="undefined"!=typeof Intl&&Intl.v8BreakIterator}catch(n){zN=!1}let Eb,qf,HN,Zi=(()=>{class n{constructor(t){this._platformId=t,this.isBrowser=this._platformId?Tf(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&&!zN)&&"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)(Oe(Wc))},n.\u0275prov=We({factory:function(){return new n(Oe(Wc))},token:n,providedIn:"root"}),n})();function vm(n){return function(){if(null==Eb&&"undefined"!=typeof window)try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:()=>Eb=!0}))}finally{Eb=Eb||!1}return Eb}()?n:!!n.capture}function LH(){if(null==qf){if("object"!=typeof document||!document||"function"!=typeof Element||!Element)return qf=!1,qf;if("scrollBehavior"in document.documentElement.style)qf=!0;else{const n=Element.prototype.scrollTo;qf=!!n&&!/\{\s*\[native code\]\s*\}/.test(n.toString())}}return qf}function Zx(){let n="undefined"!=typeof document&&document?document.activeElement:null;for(;n&&n.shadowRoot;){const e=n.shadowRoot.activeElement;if(e===n)break;n=e}return n}function Yf(n){return n.composedPath?n.composedPath()[0]:n.target}let qH=(()=>{class n{constructor(t){this._platform=t}isDisabled(t){return t.hasAttribute("disabled")}isVisible(t){return function(n){return!!(n.offsetWidth||n.offsetHeight||"function"==typeof n.getClientRects&&n.getClientRects().length)}(t)&&"visible"===getComputedStyle(t).visibility}isTabbable(t){if(!this._platform.isBrowser)return!1;const i=function(n){try{return n.frameElement}catch(e){return null}}(function(n){return n.ownerDocument&&n.ownerDocument.defaultView||window}(t));if(i&&(-1===KH(i)||!this.isVisible(i)))return!1;let r=t.nodeName.toLowerCase(),s=KH(t);return t.hasAttribute("contenteditable")?-1!==s:!("iframe"===r||"object"===r||this._platform.WEBKIT&&this._platform.IOS&&!function(n){let e=n.nodeName.toLowerCase(),t="input"===e&&n.type;return"text"===t||"password"===t||"select"===e||"textarea"===e}(t))&&("audio"===r?!!t.hasAttribute("controls")&&-1!==s:"video"===r?-1!==s&&(null!==s||this._platform.FIREFOX||t.hasAttribute("controls")):t.tabIndex>=0)}isFocusable(t,i){return function(n){return!function(n){return function(n){return"input"==n.nodeName.toLowerCase()}(n)&&"hidden"==n.type}(n)&&(function(n){let e=n.nodeName.toLowerCase();return"input"===e||"select"===e||"button"===e||"textarea"===e}(n)||function(n){return function(n){return"a"==n.nodeName.toLowerCase()}(n)&&n.hasAttribute("href")}(n)||n.hasAttribute("contenteditable")||YH(n))}(t)&&!this.isDisabled(t)&&((null==i?void 0:i.ignoreVisibility)||this.isVisible(t))}}return n.\u0275fac=function(t){return new(t||n)(Oe(Zi))},n.\u0275prov=We({factory:function(){return new n(Oe(Zi))},token:n,providedIn:"root"}),n})();function YH(n){if(!n.hasAttribute("tabindex")||void 0===n.tabIndex)return!1;let e=n.getAttribute("tabindex");return"-32768"!=e&&!(!e||isNaN(parseInt(e,10)))}function KH(n){if(!YH(n))return null;const e=parseInt(n.getAttribute("tabindex")||"",10);return isNaN(e)?-1:e}class xSe{constructor(e,t,i,r,s=!1){this._element=e,this._checker=t,this._ngZone=i,this._document=r,this._hasAttached=!1,this.startAnchorListener=()=>this.focusLastTabbableElement(),this.endAnchorListener=()=>this.focusFirstTabbableElement(),this._enabled=!0,s||this.attachAnchors()}get enabled(){return this._enabled}set enabled(e){this._enabled=e,this._startAnchor&&this._endAnchor&&(this._toggleAnchorTabIndex(e,this._startAnchor),this._toggleAnchorTabIndex(e,this._endAnchor))}destroy(){const 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}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(e){return new Promise(t=>{this._executeOnStable(()=>t(this.focusInitialElement(e)))})}focusFirstTabbableElementWhenReady(e){return new Promise(t=>{this._executeOnStable(()=>t(this.focusFirstTabbableElement(e)))})}focusLastTabbableElementWhenReady(e){return new Promise(t=>{this._executeOnStable(()=>t(this.focusLastTabbableElement(e)))})}_getRegionBoundary(e){let t=this._element.querySelectorAll(`[cdk-focus-region-${e}], [cdkFocusRegion${e}], [cdk-focus-${e}]`);for(let i=0;i=0;i--){let r=t[i].nodeType===this._document.ELEMENT_NODE?this._getLastTabbableElement(t[i]):null;if(r)return r}return null}_createAnchor(){const 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}_toggleAnchorTabIndex(e,t){e?t.setAttribute("tabindex","0"):t.removeAttribute("tabindex")}toggleAnchors(e){this._startAnchor&&this._endAnchor&&(this._toggleAnchorTabIndex(e,this._startAnchor),this._toggleAnchorTabIndex(e,this._endAnchor))}_executeOnStable(e){this._ngZone.isStable?e():this._ngZone.onStable.pipe(Wi(1)).subscribe(e)}}let XH=(()=>{class n{constructor(t,i,r){this._checker=t,this._ngZone=i,this._document=r}create(t,i=!1){return new xSe(t,this._checker,this._ngZone,this._document,i)}}return n.\u0275fac=function(t){return new(t||n)(Oe(qH),Oe(gn),Oe(pn))},n.\u0275prov=We({factory:function(){return new n(Oe(qH),Oe(gn),Oe(pn))},token:n,providedIn:"root"}),n})();"undefined"!=typeof Element&∈const JH=new Ht("cdk-input-modality-detector-options"),DSe={ignoreKeys:[18,17,224,91,16]},wm=vm({passive:!0,capture:!0});let tG=(()=>{class n{constructor(t,i,r,s){this._platform=t,this._mostRecentTarget=null,this._modality=new Br(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=Yf(o))},this._onMousedown=o=>{Date.now()-this._lastTouchMs<650||(this._modality.next(function(n){return 0===n.offsetX&&0===n.offsetY}(o)?"keyboard":"mouse"),this._mostRecentTarget=Yf(o))},this._onTouchstart=o=>{!function(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)}(o)?(this._lastTouchMs=Date.now(),this._modality.next("touch"),this._mostRecentTarget=Yf(o)):this._modality.next("keyboard")},this._options=Object.assign(Object.assign({},DSe),s),this.modalityDetected=this._modality.pipe(function(n){return e=>e.lift(new iSe(n))}(1)),this.modalityChanged=this.modalityDetected.pipe(rd()),t.isBrowser&&i.runOutsideAngular(()=>{r.addEventListener("keydown",this._onKeydown,wm),r.addEventListener("mousedown",this._onMousedown,wm),r.addEventListener("touchstart",this._onTouchstart,wm)})}get mostRecentModality(){return this._modality.value}ngOnDestroy(){!this._platform.isBrowser||(document.removeEventListener("keydown",this._onKeydown,wm),document.removeEventListener("mousedown",this._onMousedown,wm),document.removeEventListener("touchstart",this._onTouchstart,wm))}}return n.\u0275fac=function(t){return new(t||n)(Oe(Zi),Oe(gn),Oe(pn),Oe(JH,8))},n.\u0275prov=We({factory:function(){return new n(Oe(Zi),Oe(gn),Oe(pn),Oe(JH,8))},token:n,providedIn:"root"}),n})();const rG=new Ht("cdk-focus-monitor-default-options"),tC=vm({passive:!0,capture:!0});let du=(()=>{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 se,this._rootNodeFocusAndBlurListener=a=>{const l=Yf(a),c="focus"===a.type?this._onFocus:this._onBlur;for(let u=l;u;u=u.parentElement)c.call(this,a,u)},this._document=s,this._detectionMode=(null==o?void 0:o.detectionMode)||0}monitor(t,i=!1){const r=ad(t);if(!this._platform.isBrowser||1!==r.nodeType)return fn(null);const s=function(n){if(function(){if(null==HN){const n="undefined"!=typeof document?document.head:null;HN=!(!n||!n.createShadowRoot&&!n.attachShadow)}return HN}()){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 se,rootNode:s};return this._elementInfo.set(r,a),this._registerGlobalListeners(a),a.subject}stopMonitoring(t){const i=ad(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=ad(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=Yf(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,tC),i.addEventListener("blur",this._rootNodeFocusAndBlurListener,tC)}),this._rootNodeFocusListenerCount.set(i,r+1),1==++this._monitoredElementCount&&(this._ngZone.runOutsideAngular(()=>{this._getWindow().addEventListener("focus",this._windowFocusListener)}),this._inputModalityDetector.modalityDetected.pipe(_r(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,tC),i.removeEventListener("blur",this._rootNodeFocusAndBlurListener,tC),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)(Oe(gn),Oe(Zi),Oe(tG),Oe(pn,8),Oe(rG,8))},n.\u0275prov=We({factory:function(){return new n(Oe(gn),Oe(Zi),Oe(tG),Oe(pn,8),Oe(rG,8))},token:n,providedIn:"root"}),n})();const lG=new Ht("cdk-dir-doc",{providedIn:"root",factory:function(){return Fc(pn)}});let Il=(()=>{class n{constructor(t){if(this.value="ltr",this.change=new sn,t){const r=t.documentElement?t.documentElement.dir:null,s=(t.body?t.body.dir:null)||r;this.value="ltr"===s||"rtl"===s?s:"ltr"}}ngOnDestroy(){this.change.complete()}}return n.\u0275fac=function(t){return new(t||n)(Oe(lG,8))},n.\u0275prov=We({factory:function(){return new n(Oe(lG,8))},token:n,providedIn:"root"}),n})();function nC(...n){return Nt(1)(fn(...n))}function ao(...n){const e=n[n.length-1];return Ce(e)?(n.pop(),t=>nC(n,t,e)):t=>nC(n,t)}function Em(n,e){return{type:7,name:n,definitions:e,options:{}}}function cd(n,e=null){return{type:4,styles:e,timings:n}}function fs(n){return{type:6,styles:n,offset:null}}function vc(n,e,t){return{type:0,name:n,styles:e,options:t}}function ud(n,e,t=null){return{type:1,expr:n,animation:e,options:t}}function hG(n){Promise.resolve(null).then(n)}class Sm{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(){hG(()=>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 pG(){return"undefined"!=typeof window&&void 0!==window.document}function KN(){return"undefined"!=typeof process&&"[object process]"==={}.toString.call(process)}let JN=(n,e)=>!1,eP=(n,e)=>!1,_G=(n,e,t)=>[];const yG=KN();(yG||"undefined"!=typeof Element)&&(JN=pG()?(n,e)=>{for(;e&&e!==document.documentElement;){if(e===n)return!0;e=e.parentNode||e.host}return!1}:(n,e)=>n.contains(e),eP=(()=>{if(yG||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]):eP}})(),_G=(n,e,t)=>{let i=[];if(t){const r=n.querySelectorAll(e);for(let s=0;s{class n{validateStyleProperty(t){return tP(t)}matchesElement(t,i){return nP(t,i)}containsElement(t,i){return iP(t,i)}query(t,i,r){return rP(t,i,r)}computeStyle(t,i,r){return r||""}animate(t,i,r,s,o,a=[],l){return new Sm(r,s)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();class iC{}iC.NOOP=new wG;function CG(n,e,t){return t?e+":"+t+";":""}function AG(n){let e="";for(let t=0;t{const r=cP(i);t&&!t.hasOwnProperty(i)&&(t[i]=n.style[r]),n.style[r]=e[i]}),KN()&&AG(n))}function Qf(n,e){n.style&&(Object.keys(e).forEach(t=>{const i=cP(t);n.style[i]=""}),KN()&&AG(n))}const HSe=/-+([a-z0-9])/g;function cP(n){return n.replace(HSe,(...e)=>e[1].toUpperCase())}function GSe(n){return n.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}class Am{constructor(e,t,i){this._element=e,this._startStyles=t,this._endStyles=i,this._state=0;let r=Am.initialStylesByElement.get(e);r||Am.initialStylesByElement.set(e,r={}),this._initialStyles=r}start(){this._state<1&&(this._startStyles&&hu(this._element,this._startStyles,this._initialStyles),this._state=1)}finish(){this.start(),this._state<2&&(hu(this._element,this._initialStyles),this._endStyles&&(hu(this._element,this._endStyles),this._endStyles=null),this._state=1)}destroy(){this.finish(),this._state<3&&(Am.initialStylesByElement.delete(this._element),this._startStyles&&(Qf(this._element,this._startStyles),this._endStyles=null),this._endStyles&&(Qf(this._element,this._endStyles),this._endStyles=null),hu(this._element,this._initialStyles),this._state=3)}}Am.initialStylesByElement=new WeakMap;const Nl=new Ht("AnimationModuleType");function Mb(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 xP(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?function(n,e=0){return function(n){return!isNaN(parseFloat(n))&&!isNaN(Number(n))}(n)?Number(n):e}(t):this.defaultTabIndex}}}let ep;try{ep="undefined"!=typeof Intl}catch(n){ep=!1}function hd(n,e,t,i){return Y(t)&&(i=t,t=void 0),i?hd(n,e,t).pipe(me(r=>P(r)?i(...r):i(r))):new I(r=>{x$(n,e,function(o){r.next(arguments.length>1?Array.prototype.slice.call(arguments):o)},r,t)})}function x$(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;o0?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 zCe=1;const HCe=Promise.resolve(),xC={};function C$(n){return n in xC&&(delete xC[n],!0)}const A$={setImmediate(n){const e=zCe++;return xC[e]=!0,HCe.then(()=>C$(e)&&n()),e},clearImmediate(n){C$(n)}};new class extends uc{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=A$.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&&(A$.clearImmediate(t),e.scheduled=void 0)}});function Tm(n){return!!n&&(n instanceof I||"function"==typeof n.lift&&"function"==typeof n.subscribe)}class YCe{constructor(e){this.durationSelector=e}call(e,t){return t.subscribe(new KCe(e,this.durationSelector))}}class KCe extends ve{constructor(e,t){super(e),this.durationSelector=t,this.hasValue=!1}_next(e){if(this.value=e,this.hasValue=!0,!this.throttled){let t;try{const{durationSelector:r}=this;t=r(e)}catch(r){return this.destination.error(r)}const i=N(t,new _t(this));!i||i.closed?this.clearThrottle():this.add(this.throttled=i)}}clearThrottle(){const{value:e,hasValue:t,throttled:i}=this;i&&(this.remove(i),this.throttled=void 0,i.unsubscribe()),t&&(this.value=void 0,this.hasValue=!1,this.destination.next(e))}notifyNext(){this.clearThrottle()}notifyComplete(){this.clearThrottle()}}function T$(n){return!P(n)&&n-parseFloat(n)+1>=0}function QCe(n){const{index:e,period:t,subscriber:i}=n;if(i.next(e),!i.closed){if(-1===t)return i.complete();n.index=e+1,this.schedule(n,t)}}function CC(n,e=Kx){return function(n){return function(t){return t.lift(new YCe(n))}}(()=>function(n=0,e,t){let i=-1;return T$(e)?i=Number(e)<1?1:Number(e):Ce(e)&&(t=e),Ce(t)||(t=Kx),new I(r=>{const s=T$(n)?n:+n-t.now();return t.schedule(QCe,s,{index:0,period:i,subscriber:r})})}(n,e))}let D$=(()=>{class n{constructor(){this._listeners=[]}notify(t,i){for(let r of this._listeners)r(t,i)}listen(t){return this._listeners.push(t),()=>{this._listeners=this._listeners.filter(i=>t!==i)}}ngOnDestroy(){this._listeners=[]}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({factory:function(){return new n},token:n,providedIn:"root"}),n})(),Mm=(()=>{class n{constructor(t,i,r){this._ngZone=t,this._platform=i,this._scrolled=new se,this._globalSubscription=null,this._scrolledCount=0,this.scrollContainers=new Map,this._document=r}register(t){this.scrollContainers.has(t)||this.scrollContainers.set(t,t.elementScrolled().subscribe(()=>this._scrolled.next(t)))}deregister(t){const i=this.scrollContainers.get(t);i&&(i.unsubscribe(),this.scrollContainers.delete(t))}scrolled(t=20){return this._platform.isBrowser?new I(i=>{this._globalSubscription||this._addGlobalListener();const r=t>0?this._scrolled.pipe(CC(t)).subscribe(i):this._scrolled.subscribe(i);return this._scrolledCount++,()=>{r.unsubscribe(),this._scrolledCount--,this._scrolledCount||this._removeGlobalListener()}}):fn()}ngOnDestroy(){this._removeGlobalListener(),this.scrollContainers.forEach((t,i)=>this.deregister(i)),this._scrolled.complete()}ancestorScrolled(t,i){const r=this.getAncestorScrollContainers(t);return this.scrolled(i).pipe(Qi(s=>!s||r.indexOf(s)>-1))}getAncestorScrollContainers(t){const i=[];return this.scrollContainers.forEach((r,s)=>{this._scrollableContainsElement(s,t)&&i.push(s)}),i}_getWindow(){return this._document.defaultView||window}_scrollableContainsElement(t,i){let r=ad(i),s=t.getElementRef().nativeElement;do{if(r==s)return!0}while(r=r.parentElement);return!1}_addGlobalListener(){this._globalSubscription=this._ngZone.runOutsideAngular(()=>hd(this._getWindow().document,"scroll").subscribe(()=>this._scrolled.next()))}_removeGlobalListener(){this._globalSubscription&&(this._globalSubscription.unsubscribe(),this._globalSubscription=null)}}return n.\u0275fac=function(t){return new(t||n)(Oe(gn),Oe(Zi),Oe(pn,8))},n.\u0275prov=We({factory:function(){return new n(Oe(gn),Oe(Zi),Oe(pn,8))},token:n,providedIn:"root"}),n})(),Dm=(()=>{class n{constructor(t,i,r){this._platform=t,this._change=new se,this._changeListener=s=>{this._change.next(s)},this._document=r,i.runOutsideAngular(()=>{if(t.isBrowser){const s=this._getWindow();s.addEventListener("resize",this._changeListener),s.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:i,height:r}=this.getViewportSize();return{top:t.top,left:t.left,bottom:t.top+r,right:t.left+i,height:r,width:i}}getViewportScrollPosition(){if(!this._platform.isBrowser)return{top:0,left:0};const t=this._document,i=this._getWindow(),r=t.documentElement,s=r.getBoundingClientRect();return{top:-s.top||t.body.scrollTop||i.scrollY||r.scrollTop||0,left:-s.left||t.body.scrollLeft||i.scrollX||r.scrollLeft||0}}change(t=20){return t>0?this._change.pipe(CC(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 n.\u0275fac=function(t){return new(t||n)(Oe(Zi),Oe(gn),Oe(pn,8))},n.\u0275prov=We({factory:function(){return new n(Oe(Zi),Oe(gn),Oe(pn,8))},token:n,providedIn:"root"}),n})();class DP{attach(e){return this._attachedHost=e,e.attach(this)}detach(){let e=this._attachedHost;null!=e&&(this._attachedHost=null,e.detach())}get isAttached(){return null!=this._attachedHost}setAttachedHost(e){this._attachedHost=e}}class TC extends DP{constructor(e,t,i,r){super(),this.component=e,this.viewContainerRef=t,this.injector=i,this.componentFactoryResolver=r}}class Im extends DP{constructor(e,t,i){super(),this.templateRef=e,this.viewContainerRef=t,this.context=i}get origin(){return this.templateRef.elementRef}attach(e,t=this.context){return this.context=t,super.attach(e)}detach(){return this.context=void 0,super.detach()}}class p1e extends DP{constructor(e){super(),this.element=e instanceof En?e.nativeElement:e}}class MC{constructor(){this._isDisposed=!1,this.attachDomPortal=null}hasAttached(){return!!this._attachedPortal}attach(e){return e instanceof TC?(this._attachedPortal=e,this.attachComponentPortal(e)):e instanceof Im?(this._attachedPortal=e,this.attachTemplatePortal(e)):this.attachDomPortal&&e instanceof p1e?(this._attachedPortal=e,this.attachDomPortal(e)):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(e){this._disposeFn=e}_invokeDisposeFn(){this._disposeFn&&(this._disposeFn(),this._disposeFn=null)}}class g1e extends MC{constructor(e,t,i,r,s){super(),this.outletElement=e,this._componentFactoryResolver=t,this._appRef=i,this._defaultInjector=r,this.attachDomPortal=o=>{const a=o.element,l=this._document.createComment("dom-portal");a.parentNode.insertBefore(l,a),this.outletElement.appendChild(a),this._attachedPortal=o,super.setDisposeFn(()=>{l.parentNode&&l.parentNode.replaceChild(a,l)})},this._document=s}attachComponentPortal(e){const i=(e.componentFactoryResolver||this._componentFactoryResolver).resolveComponentFactory(e.component);let r;return e.viewContainerRef?(r=e.viewContainerRef.createComponent(i,e.viewContainerRef.length,e.injector||e.viewContainerRef.injector),this.setDisposeFn(()=>r.destroy())):(r=i.create(e.injector||this._defaultInjector),this._appRef.attachView(r.hostView),this.setDisposeFn(()=>{this._appRef.detachView(r.hostView),r.destroy()})),this.outletElement.appendChild(this._getComponentRootNode(r)),this._attachedPortal=e,r}attachTemplatePortal(e){let t=e.viewContainerRef,i=t.createEmbeddedView(e.templateRef,e.context);return i.rootNodes.forEach(r=>this.outletElement.appendChild(r)),i.detectChanges(),this.setDisposeFn(()=>{let r=t.indexOf(i);-1!==r&&t.remove(r)}),this._attachedPortal=e,i}dispose(){super.dispose(),null!=this.outletElement.parentNode&&this.outletElement.parentNode.removeChild(this.outletElement)}_getComponentRootNode(e){return e.hostView.rootNodes[0]}}let tp=(()=>{class n extends MC{constructor(t,i,r){super(),this._componentFactoryResolver=t,this._viewContainerRef=i,this._isInitialized=!1,this.attached=new sn,this.attachDomPortal=s=>{const o=s.element,a=this._document.createComment("dom-portal");s.setAttachedHost(this),o.parentNode.insertBefore(a,o),this._getRootNode().appendChild(o),this._attachedPortal=s,super.setDisposeFn(()=>{a.parentNode&&a.parentNode.replaceChild(o,a)})},this._document=r}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 i=null!=t.viewContainerRef?t.viewContainerRef:this._viewContainerRef,s=(t.componentFactoryResolver||this._componentFactoryResolver).resolveComponentFactory(t.component),o=i.createComponent(s,i.length,t.injector||i.injector);return i!==this._viewContainerRef&&this._getRootNode().appendChild(o.hostView.rootNodes[0]),super.setDisposeFn(()=>o.destroy()),this._attachedPortal=t,this._attachedRef=o,this.attached.emit(o),o}attachTemplatePortal(t){t.setAttachedHost(this);const i=this._viewContainerRef.createEmbeddedView(t.templateRef,t.context);return super.setDisposeFn(()=>this._viewContainerRef.clear()),this._attachedPortal=t,this._attachedRef=i,this.attached.emit(i),i}_getRootNode(){const t=this._viewContainerRef.element.nativeElement;return t.nodeType===t.ELEMENT_NODE?t:t.parentNode}}return n.\u0275fac=function(t){return new(t||n)(xe(wl),xe(Ns),xe(pn))},n.\u0275dir=Rt({type:n,selectors:[["","cdkPortalOutlet",""]],inputs:{portal:["cdkPortalOutlet","portal"]},outputs:{attached:"attached"},exportAs:["cdkPortalOutlet"],features:[An]}),n})();const k$=LH();class b1e{constructor(e,t){this._viewportRuler=e,this._previousHTMLStyles={top:"",left:""},this._isEnabled=!1,this._document=t}attach(){}enable(){if(this._canBeEnabled()){const e=this._document.documentElement;this._previousScrollPosition=this._viewportRuler.getViewportScrollPosition(),this._previousHTMLStyles.left=e.style.left||"",this._previousHTMLStyles.top=e.style.top||"",e.style.left=vs(-this._previousScrollPosition.left),e.style.top=vs(-this._previousScrollPosition.top),e.classList.add("cdk-global-scrollblock"),this._isEnabled=!0}}disable(){if(this._isEnabled){const e=this._document.documentElement,i=e.style,r=this._document.body.style,s=i.scrollBehavior||"",o=r.scrollBehavior||"";this._isEnabled=!1,i.left=this._previousHTMLStyles.left,i.top=this._previousHTMLStyles.top,e.classList.remove("cdk-global-scrollblock"),k$&&(i.scrollBehavior=r.scrollBehavior="auto"),window.scroll(this._previousScrollPosition.left,this._previousScrollPosition.top),k$&&(i.scrollBehavior=s,r.scrollBehavior=o)}}_canBeEnabled(){if(this._document.documentElement.classList.contains("cdk-global-scrollblock")||this._isEnabled)return!1;const t=this._document.body,i=this._viewportRuler.getViewportSize();return t.scrollHeight>i.height||t.scrollWidth>i.width}}class v1e{constructor(e,t,i,r){this._scrollDispatcher=e,this._ngZone=t,this._viewportRuler=i,this._config=r,this._scrollSubscription=null,this._detach=()=>{this.disable(),this._overlayRef.hasAttached()&&this._ngZone.run(()=>this._overlayRef.detach())}}attach(e){this._overlayRef=e}enable(){if(this._scrollSubscription)return;const e=this._scrollDispatcher.scrolled(0);this._config&&this._config.threshold&&this._config.threshold>1?(this._initialScrollPosition=this._viewportRuler.getViewportScrollPosition().top,this._scrollSubscription=e.subscribe(()=>{const t=this._viewportRuler.getViewportScrollPosition().top;Math.abs(t-this._initialScrollPosition)>this._config.threshold?this._detach():this._overlayRef.updatePosition()})):this._scrollSubscription=e.subscribe(this._detach)}disable(){this._scrollSubscription&&(this._scrollSubscription.unsubscribe(),this._scrollSubscription=null)}detach(){this.disable(),this._overlayRef=null}}class L${enable(){}disable(){}attach(){}}function IP(n,e){return e.some(t=>n.bottomt.bottom||n.rightt.right)}function B$(n,e){return e.some(t=>n.topt.bottom||n.leftt.right)}class w1e{constructor(e,t,i,r){this._scrollDispatcher=e,this._viewportRuler=t,this._ngZone=i,this._config=r,this._scrollSubscription=null}attach(e){this._overlayRef=e}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:i,height:r}=this._viewportRuler.getViewportSize();IP(t,[{width:i,height:r,bottom:r,right:i,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 E1e=(()=>{class n{constructor(t,i,r,s){this._scrollDispatcher=t,this._viewportRuler=i,this._ngZone=r,this.noop=()=>new L$,this.close=o=>new v1e(this._scrollDispatcher,this._ngZone,this._viewportRuler,o),this.block=()=>new b1e(this._viewportRuler,this._document),this.reposition=o=>new w1e(this._scrollDispatcher,this._viewportRuler,this._ngZone,o),this._document=s}}return n.\u0275fac=function(t){return new(t||n)(Oe(Mm),Oe(Dm),Oe(gn),Oe(pn))},n.\u0275prov=We({factory:function(){return new n(Oe(Mm),Oe(Dm),Oe(gn),Oe(pn))},token:n,providedIn:"root"}),n})();class IC{constructor(e){if(this.scrollStrategy=new L$,this.panelClass="",this.hasBackdrop=!1,this.backdropClass="cdk-overlay-dark-backdrop",this.disposeOnNavigation=!1,e){const t=Object.keys(e);for(const i of t)void 0!==e[i]&&(this[i]=e[i])}}}class S1e{constructor(e,t,i,r,s){this.offsetX=i,this.offsetY=r,this.panelClass=s,this.originX=e.originX,this.originY=e.originY,this.overlayX=t.overlayX,this.overlayY=t.overlayY}}class x1e{constructor(e,t){this.connectionPair=e,this.scrollableViewProperties=t}}let j$=(()=>{class n{constructor(t){this._attachedOverlays=[],this._document=t}ngOnDestroy(){this.detach()}add(t){this.remove(t),this._attachedOverlays.push(t)}remove(t){const i=this._attachedOverlays.indexOf(t);i>-1&&this._attachedOverlays.splice(i,1),0===this._attachedOverlays.length&&this.detach()}}return n.\u0275fac=function(t){return new(t||n)(Oe(pn))},n.\u0275prov=We({factory:function(){return new n(Oe(pn))},token:n,providedIn:"root"}),n})(),C1e=(()=>{class n extends j${constructor(t){super(t),this._keydownListener=i=>{const r=this._attachedOverlays;for(let s=r.length-1;s>-1;s--)if(r[s]._keydownEvents.observers.length>0){r[s]._keydownEvents.next(i);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 n.\u0275fac=function(t){return new(t||n)(Oe(pn))},n.\u0275prov=We({factory:function(){return new n(Oe(pn))},token:n,providedIn:"root"}),n})(),A1e=(()=>{class n extends j${constructor(t,i){super(t),this._platform=i,this._cursorStyleIsSet=!1,this._clickListener=r=>{const s=Yf(r),o=this._attachedOverlays.slice();for(let a=o.length-1;a>-1;a--){const l=o[a];if(!(l._outsidePointerEvents.observers.length<1)&&l.hasAttached()){if(l.overlayElement.contains(s))break;l._outsidePointerEvents.next(r)}}}}add(t){if(super.add(t),!this._isAttached){const i=this._document.body;i.addEventListener("click",this._clickListener,!0),i.addEventListener("auxclick",this._clickListener,!0),i.addEventListener("contextmenu",this._clickListener,!0),this._platform.IOS&&!this._cursorStyleIsSet&&(this._cursorOriginalValue=i.style.cursor,i.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 n.\u0275fac=function(t){return new(t||n)(Oe(pn),Oe(Zi))},n.\u0275prov=We({factory:function(){return new n(Oe(pn),Oe(Zi))},token:n,providedIn:"root"}),n})();const Sh="undefined"!=typeof window?window:{},V$=void 0!==Sh.__karma__&&!!Sh.__karma__||void 0!==Sh.jasmine&&!!Sh.jasmine||void 0!==Sh.jest&&!!Sh.jest||void 0!==Sh.Mocha&&!!Sh.Mocha;let Ob=(()=>{class n{constructor(t,i){this._platform=i,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||V$){const r=this._document.querySelectorAll(`.${t}[platform="server"], .${t}[platform="test"]`);for(let s=0;sthis._backdropClick.next(u),this._keydownEvents=new se,this._outsidePointerEvents=new se,r.scrollStrategy&&(this._scrollStrategy=r.scrollStrategy,this._scrollStrategy.attach(this)),this._positionStrategy=r.positionStrategy}get overlayElement(){return this._pane}get backdropElement(){return this._backdropElement}get hostElement(){return this._host}attach(e){let t=this._portalOutlet.attach(e);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(Wi(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),t}detach(){if(!this.hasAttached())return;this.detachBackdrop(),this._togglePointerEvents(!1),this._positionStrategy&&this._positionStrategy.detach&&this._positionStrategy.detach(),this._scrollStrategy&&this._scrollStrategy.disable();const e=this._portalOutlet.detach();return this._detachments.next(),this._keyboardDispatcher.remove(this),this._detachContentWhenStable(),this._locationChanges.unsubscribe(),this._outsideClickDispatcher.remove(this),e}dispose(){const e=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,e&&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(e){e!==this._positionStrategy&&(this._positionStrategy&&this._positionStrategy.dispose(),this._positionStrategy=e,this.hasAttached()&&(e.attach(this),this.updatePosition()))}updateSize(e){this._config=Object.assign(Object.assign({},this._config),e),this._updateElementSize()}setDirection(e){this._config=Object.assign(Object.assign({},this._config),{direction:e}),this._updateElementDirection()}addPanelClass(e){this._pane&&this._toggleClasses(this._pane,e,!0)}removePanelClass(e){this._pane&&this._toggleClasses(this._pane,e,!1)}getDirection(){const e=this._config.direction;return e?"string"==typeof e?e:e.value:"ltr"}updateScrollStrategy(e){e!==this._scrollStrategy&&(this._disposeScrollStrategy(),this._scrollStrategy=e,this.hasAttached()&&(e.attach(this),e.enable()))}_updateElementDirection(){this._host.setAttribute("dir",this.getDirection())}_updateElementSize(){if(!this._pane)return;const e=this._pane.style;e.width=vs(this._config.width),e.height=vs(this._config.height),e.minWidth=vs(this._config.minWidth),e.minHeight=vs(this._config.minHeight),e.maxWidth=vs(this._config.maxWidth),e.maxHeight=vs(this._config.maxHeight)}_togglePointerEvents(e){this._pane.style.pointerEvents=e?"":"none"}_attachBackdrop(){const e="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(e)})}):this._backdropElement.classList.add(e)}_updateStackingOrder(){this._host.nextSibling&&this._host.parentNode.appendChild(this._host)}detachBackdrop(){let e=this._backdropElement;if(!e)return;let t,i=()=>{e&&(e.removeEventListener("click",this._backdropClickHandler),e.removeEventListener("transitionend",i),e.parentNode&&e.parentNode.removeChild(e)),this._backdropElement==e&&(this._backdropElement=null),this._config.backdropClass&&this._toggleClasses(e,this._config.backdropClass,!1),clearTimeout(t)};e.classList.remove("cdk-overlay-backdrop-showing"),this._ngZone.runOutsideAngular(()=>{e.addEventListener("transitionend",i)}),e.style.pointerEvents="none",t=this._ngZone.runOutsideAngular(()=>setTimeout(i,500))}_toggleClasses(e,t,i){const r=e.classList;Xx(t).forEach(s=>{s&&(i?r.add(s):r.remove(s))})}_detachContentWhenStable(){this._ngZone.runOutsideAngular(()=>{const e=this._ngZone.onStable.pipe(_r(kn(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)),e.unsubscribe())})})}_disposeScrollStrategy(){const e=this._scrollStrategy;e&&(e.disable(),e.detach&&e.detach())}}const U$="cdk-overlay-connected-position-bounding-box",M1e=/([A-Za-z%]+)$/;class z${constructor(e,t,i,r,s){this._viewportRuler=t,this._document=i,this._platform=r,this._overlayContainer=s,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 se,this._resizeSubscription=x.EMPTY,this._offsetX=0,this._offsetY=0,this._appliedPanelClasses=[],this.positionChanges=this._positionChanges,this.setOrigin(e)}get positions(){return this._preferredPositions}attach(e){this._validatePositions(),e.hostElement.classList.add(U$),this._overlayRef=e,this._boundingBox=e.hostElement,this._pane=e.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 e=this._originRect,t=this._overlayRect,i=this._viewportRect,r=[];let s;for(let o of this._preferredPositions){let a=this._getOriginPoint(e,o),l=this._getOverlayPoint(a,t,o),c=this._getOverlayFit(l,t,i,o);if(c.isCompletelyWithinViewport)return this._isPushed=!1,void this._applyPosition(o,a);this._canFitWithFlexibleDimensions(c,l,i)?r.push({position:o,origin:a,overlayRect:t,boundingBoxRect:this._calculateBoundingBoxRect(a,o)}):(!s||s.overlayFit.visibleAreaa&&(a=c,o=l)}return this._isPushed=!1,void this._applyPosition(o.position,o.origin)}if(this._canPush)return this._isPushed=!0,void this._applyPosition(s.position,s.originPoint);this._applyPosition(s.position,s.originPoint)}detach(){this._clearPanelClasses(),this._lastPosition=null,this._previousPushAmount=null,this._resizeSubscription.unsubscribe()}dispose(){this._isDisposed||(this._boundingBox&&np(this._boundingBox.style,{top:"",left:"",right:"",bottom:"",height:"",width:"",alignItems:"",justifyContent:""}),this._pane&&this._resetOverlayElementStyles(),this._overlayRef&&this._overlayRef.hostElement.classList.remove(U$),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 e=this._lastPosition||this._preferredPositions[0],t=this._getOriginPoint(this._originRect,e);this._applyPosition(e,t)}}withScrollableContainers(e){return this._scrollables=e,this}withPositions(e){return this._preferredPositions=e,-1===e.indexOf(this._lastPosition)&&(this._lastPosition=null),this._validatePositions(),this}withViewportMargin(e){return this._viewportMargin=e,this}withFlexibleDimensions(e=!0){return this._hasFlexibleDimensions=e,this}withGrowAfterOpen(e=!0){return this._growAfterOpen=e,this}withPush(e=!0){return this._canPush=e,this}withLockedPosition(e=!0){return this._positionLocked=e,this}setOrigin(e){return this._origin=e,this}withDefaultOffsetX(e){return this._offsetX=e,this}withDefaultOffsetY(e){return this._offsetY=e,this}withTransformOriginOn(e){return this._transformOriginSelector=e,this}_getOriginPoint(e,t){let i,r;if("center"==t.originX)i=e.left+e.width/2;else{const s=this._isRtl()?e.right:e.left,o=this._isRtl()?e.left:e.right;i="start"==t.originX?s:o}return r="center"==t.originY?e.top+e.height/2:"top"==t.originY?e.top:e.bottom,{x:i,y:r}}_getOverlayPoint(e,t,i){let r,s;return r="center"==i.overlayX?-t.width/2:"start"===i.overlayX?this._isRtl()?-t.width:0:this._isRtl()?0:-t.width,s="center"==i.overlayY?-t.height/2:"top"==i.overlayY?0:-t.height,{x:e.x+r,y:e.y+s}}_getOverlayFit(e,t,i,r){const s=G$(t);let{x:o,y:a}=e,l=this._getOffset(r,"x"),c=this._getOffset(r,"y");l&&(o+=l),c&&(a+=c);let p=0-a,g=a+s.height-i.height,m=this._subtractOverflows(s.width,0-o,o+s.width-i.width),w=this._subtractOverflows(s.height,p,g),C=m*w;return{visibleArea:C,isCompletelyWithinViewport:s.width*s.height===C,fitsInViewportVertically:w===s.height,fitsInViewportHorizontally:m==s.width}}_canFitWithFlexibleDimensions(e,t,i){if(this._hasFlexibleDimensions){const r=i.bottom-t.y,s=i.right-t.x,o=H$(this._overlayRef.getConfig().minHeight),a=H$(this._overlayRef.getConfig().minWidth),c=e.fitsInViewportHorizontally||null!=a&&a<=s;return(e.fitsInViewportVertically||null!=o&&o<=r)&&c}return!1}_pushOverlayOnScreen(e,t,i){if(this._previousPushAmount&&this._positionLocked)return{x:e.x+this._previousPushAmount.x,y:e.y+this._previousPushAmount.y};const r=G$(t),s=this._viewportRect,o=Math.max(e.x+r.width-s.width,0),a=Math.max(e.y+r.height-s.height,0),l=Math.max(s.top-i.top-e.y,0),c=Math.max(s.left-i.left-e.x,0);let u=0,h=0;return u=r.width<=s.width?c||-o:e.xm&&!this._isInitialRender&&!this._growAfterOpen&&(o=e.y-m/2)}if("end"===t.overlayX&&!r||"start"===t.overlayX&&r)p=i.width-e.x+this._viewportMargin,u=e.x-this._viewportMargin;else if("start"===t.overlayX&&!r||"end"===t.overlayX&&r)h=e.x,u=i.right-e.x;else{const g=Math.min(i.right-e.x+i.left,e.x),m=this._lastBoundingBoxSize.width;u=2*g,h=e.x-g,u>m&&!this._isInitialRender&&!this._growAfterOpen&&(h=e.x-m/2)}return{top:o,left:h,bottom:a,right:p,width:u,height:s}}_setBoundingBoxStyles(e,t){const i=this._calculateBoundingBoxRect(e,t);!this._isInitialRender&&!this._growAfterOpen&&(i.height=Math.min(i.height,this._lastBoundingBoxSize.height),i.width=Math.min(i.width,this._lastBoundingBoxSize.width));const r={};if(this._hasExactPosition())r.top=r.left="0",r.bottom=r.right=r.maxHeight=r.maxWidth="",r.width=r.height="100%";else{const s=this._overlayRef.getConfig().maxHeight,o=this._overlayRef.getConfig().maxWidth;r.height=vs(i.height),r.top=vs(i.top),r.bottom=vs(i.bottom),r.width=vs(i.width),r.left=vs(i.left),r.right=vs(i.right),r.alignItems="center"===t.overlayX?"center":"end"===t.overlayX?"flex-end":"flex-start",r.justifyContent="center"===t.overlayY?"center":"bottom"===t.overlayY?"flex-end":"flex-start",s&&(r.maxHeight=vs(s)),o&&(r.maxWidth=vs(o))}this._lastBoundingBoxSize=i,np(this._boundingBox.style,r)}_resetBoundingBoxStyles(){np(this._boundingBox.style,{top:"0",left:"0",right:"0",bottom:"0",height:"",width:"",alignItems:"",justifyContent:""})}_resetOverlayElementStyles(){np(this._pane.style,{top:"",left:"",bottom:"",right:"",position:"",transform:""})}_setOverlayElementStyles(e,t){const i={},r=this._hasExactPosition(),s=this._hasFlexibleDimensions,o=this._overlayRef.getConfig();if(r){const u=this._viewportRuler.getViewportScrollPosition();np(i,this._getExactOverlayY(t,e,u)),np(i,this._getExactOverlayX(t,e,u))}else i.position="static";let a="",l=this._getOffset(t,"x"),c=this._getOffset(t,"y");l&&(a+=`translateX(${l}px) `),c&&(a+=`translateY(${c}px)`),i.transform=a.trim(),o.maxHeight&&(r?i.maxHeight=vs(o.maxHeight):s&&(i.maxHeight="")),o.maxWidth&&(r?i.maxWidth=vs(o.maxWidth):s&&(i.maxWidth="")),np(this._pane.style,i)}_getExactOverlayY(e,t,i){let r={top:"",bottom:""},s=this._getOverlayPoint(t,this._overlayRect,e);this._isPushed&&(s=this._pushOverlayOnScreen(s,this._overlayRect,i));let o=this._overlayContainer.getContainerElement().getBoundingClientRect().top;return s.y-=o,"bottom"===e.overlayY?r.bottom=this._document.documentElement.clientHeight-(s.y+this._overlayRect.height)+"px":r.top=vs(s.y),r}_getExactOverlayX(e,t,i){let o,r={left:"",right:""},s=this._getOverlayPoint(t,this._overlayRect,e);return this._isPushed&&(s=this._pushOverlayOnScreen(s,this._overlayRect,i)),o=this._isRtl()?"end"===e.overlayX?"left":"right":"end"===e.overlayX?"right":"left","right"===o?r.right=this._document.documentElement.clientWidth-(s.x+this._overlayRect.width)+"px":r.left=vs(s.x),r}_getScrollVisibility(){const e=this._getOriginRect(),t=this._pane.getBoundingClientRect(),i=this._scrollables.map(r=>r.getElementRef().nativeElement.getBoundingClientRect());return{isOriginClipped:B$(e,i),isOriginOutsideView:IP(e,i),isOverlayClipped:B$(t,i),isOverlayOutsideView:IP(t,i)}}_subtractOverflows(e,...t){return t.reduce((i,r)=>i-Math.max(r,0),e)}_getNarrowedViewportRect(){const e=this._document.documentElement.clientWidth,t=this._document.documentElement.clientHeight,i=this._viewportRuler.getViewportScrollPosition();return{top:i.top+this._viewportMargin,left:i.left+this._viewportMargin,right:i.left+e-this._viewportMargin,bottom:i.top+t-this._viewportMargin,width:e-2*this._viewportMargin,height:t-2*this._viewportMargin}}_isRtl(){return"rtl"===this._overlayRef.getDirection()}_hasExactPosition(){return!this._hasFlexibleDimensions||this._isPushed}_getOffset(e,t){return"x"===t?null==e.offsetX?this._offsetX:e.offsetX:null==e.offsetY?this._offsetY:e.offsetY}_validatePositions(){}_addPanelClasses(e){this._pane&&Xx(e).forEach(t=>{""!==t&&-1===this._appliedPanelClasses.indexOf(t)&&(this._appliedPanelClasses.push(t),this._pane.classList.add(t))})}_clearPanelClasses(){this._pane&&(this._appliedPanelClasses.forEach(e=>{this._pane.classList.remove(e)}),this._appliedPanelClasses=[])}_getOriginRect(){const e=this._origin;if(e instanceof En)return e.nativeElement.getBoundingClientRect();if(e instanceof Element)return e.getBoundingClientRect();const t=e.width||0,i=e.height||0;return{top:e.y,bottom:e.y+i,left:e.x,right:e.x+t,height:i,width:t}}}function np(n,e){for(let t in e)e.hasOwnProperty(t)&&(n[t]=e[t]);return n}function H$(n){if("number"!=typeof n&&null!=n){const[e,t]=n.split(M1e);return t&&"px"!==t?null:parseFloat(e)}return n||null}function G$(n){return{top:Math.floor(n.top),right:Math.floor(n.right),bottom:Math.floor(n.bottom),left:Math.floor(n.left),width:Math.floor(n.width),height:Math.floor(n.height)}}class D1e{constructor(e,t,i,r,s,o,a){this._preferredPositions=[],this._positionStrategy=new z$(i,r,s,o,a).withFlexibleDimensions(!1).withPush(!1).withViewportMargin(0),this.withFallbackPosition(e,t),this.onPositionChange=this._positionStrategy.positionChanges}get positions(){return this._preferredPositions}attach(e){this._overlayRef=e,this._positionStrategy.attach(e),this._direction&&(e.setDirection(this._direction),this._direction=null)}dispose(){this._positionStrategy.dispose()}detach(){this._positionStrategy.detach()}apply(){this._positionStrategy.apply()}recalculateLastPosition(){this._positionStrategy.reapplyLastPosition()}withScrollableContainers(e){this._positionStrategy.withScrollableContainers(e)}withFallbackPosition(e,t,i,r){const s=new S1e(e,t,i,r);return this._preferredPositions.push(s),this._positionStrategy.withPositions(this._preferredPositions),this}withDirection(e){return this._overlayRef?this._overlayRef.setDirection(e):this._direction=e,this}withOffsetX(e){return this._positionStrategy.withDefaultOffsetX(e),this}withOffsetY(e){return this._positionStrategy.withDefaultOffsetY(e),this}withLockedPosition(e){return this._positionStrategy.withLockedPosition(e),this}withPositions(e){return this._preferredPositions=e.slice(),this._positionStrategy.withPositions(this._preferredPositions),this}setOrigin(e){return this._positionStrategy.setOrigin(e),this}}const W$="cdk-global-overlay-wrapper";class I1e{constructor(){this._cssPosition="static",this._topOffset="",this._bottomOffset="",this._leftOffset="",this._rightOffset="",this._alignItems="",this._justifyContent="",this._width="",this._height=""}attach(e){const t=e.getConfig();this._overlayRef=e,this._width&&!t.width&&e.updateSize({width:this._width}),this._height&&!t.height&&e.updateSize({height:this._height}),e.hostElement.classList.add(W$),this._isDisposed=!1}top(e=""){return this._bottomOffset="",this._topOffset=e,this._alignItems="flex-start",this}left(e=""){return this._rightOffset="",this._leftOffset=e,this._justifyContent="flex-start",this}bottom(e=""){return this._topOffset="",this._bottomOffset=e,this._alignItems="flex-end",this}right(e=""){return this._leftOffset="",this._rightOffset=e,this._justifyContent="flex-end",this}width(e=""){return this._overlayRef?this._overlayRef.updateSize({width:e}):this._width=e,this}height(e=""){return this._overlayRef?this._overlayRef.updateSize({height:e}):this._height=e,this}centerHorizontally(e=""){return this.left(e),this._justifyContent="center",this}centerVertically(e=""){return this.top(e),this._alignItems="center",this}apply(){if(!this._overlayRef||!this._overlayRef.hasAttached())return;const e=this._overlayRef.overlayElement.style,t=this._overlayRef.hostElement.style,i=this._overlayRef.getConfig(),{width:r,height:s,maxWidth:o,maxHeight:a}=i,l=!("100%"!==r&&"100vw"!==r||o&&"100%"!==o&&"100vw"!==o),c=!("100%"!==s&&"100vh"!==s||a&&"100%"!==a&&"100vh"!==a);e.position=this._cssPosition,e.marginLeft=l?"0":this._leftOffset,e.marginTop=c?"0":this._topOffset,e.marginBottom=this._bottomOffset,e.marginRight=this._rightOffset,l?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=c?"flex-start":this._alignItems}dispose(){if(this._isDisposed||!this._overlayRef)return;const e=this._overlayRef.overlayElement.style,t=this._overlayRef.hostElement,i=t.style;t.classList.remove(W$),i.justifyContent=i.alignItems=e.marginTop=e.marginBottom=e.marginLeft=e.marginRight=e.position="",this._overlayRef=null,this._isDisposed=!0}}let O1e=(()=>{class n{constructor(t,i,r,s){this._viewportRuler=t,this._document=i,this._platform=r,this._overlayContainer=s}global(){return new I1e}connectedTo(t,i,r){return new D1e(i,r,t,this._viewportRuler,this._document,this._platform,this._overlayContainer)}flexibleConnectedTo(t){return new z$(t,this._viewportRuler,this._document,this._platform,this._overlayContainer)}}return n.\u0275fac=function(t){return new(t||n)(Oe(Dm),Oe(pn),Oe(Zi),Oe(Ob))},n.\u0275prov=We({factory:function(){return new n(Oe(Dm),Oe(pn),Oe(Zi),Oe(Ob))},token:n,providedIn:"root"}),n})(),R1e=0,wc=(()=>{class n{constructor(t,i,r,s,o,a,l,c,u,h,p){this.scrollStrategies=t,this._overlayContainer=i,this._componentFactoryResolver=r,this._positionBuilder=s,this._keyboardDispatcher=o,this._injector=a,this._ngZone=l,this._document=c,this._directionality=u,this._location=h,this._outsideClickDispatcher=p}create(t){const i=this._createHostElement(),r=this._createPaneElement(i),s=this._createPortalOutlet(r),o=new IC(t);return o.direction=o.direction||this._directionality.value,new T1e(s,i,r,o,this._ngZone,this._keyboardDispatcher,this._document,this._location,this._outsideClickDispatcher)}position(){return this._positionBuilder}_createPaneElement(t){const i=this._document.createElement("div");return i.id="cdk-overlay-"+R1e++,i.classList.add("cdk-overlay-pane"),t.appendChild(i),i}_createHostElement(){const t=this._document.createElement("div");return this._overlayContainer.getContainerElement().appendChild(t),t}_createPortalOutlet(t){return this._appRef||(this._appRef=this._injector.get(ih)),new g1e(t,this._componentFactoryResolver,this._appRef,this._injector,this._document)}}return n.\u0275fac=function(t){return new(t||n)(Oe(E1e),Oe(Ob),Oe(wl),Oe(O1e),Oe(C1e),Oe(Wn),Oe(gn),Oe(pn),Oe(Il),Oe(Pg),Oe(A1e))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();function a7(...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{this.headers=new Map,e.split("\n").forEach(t=>{const i=t.indexOf(":");if(i>0){const r=t.slice(0,i),s=r.toLowerCase(),o=t.slice(i+1).trim();this.maybeSetNormalizedName(r,s),this.headers.has(s)?this.headers.get(s).push(o):this.headers.set(s,[o])}})}:()=>{this.headers=new Map,Object.keys(e).forEach(t=>{let i=e[t];const r=t.toLowerCase();"string"==typeof i&&(i=[i]),i.length>0&&(this.headers.set(r,i),this.maybeSetNormalizedName(t,r))})}:this.headers=new Map}has(e){return this.init(),this.headers.has(e.toLowerCase())}get(e){this.init();const t=this.headers.get(e.toLowerCase());return t&&t.length>0?t[0]:null}keys(){return this.init(),Array.from(this.normalizedNames.values())}getAll(e){return this.init(),this.headers.get(e.toLowerCase())||null}append(e,t){return this.clone({name:e,value:t,op:"a"})}set(e,t){return this.clone({name:e,value:t,op:"s"})}delete(e,t){return this.clone({name:e,value:t,op:"d"})}maybeSetNormalizedName(e,t){this.normalizedNames.has(t)||this.normalizedNames.set(t,e)}init(){this.lazyInit&&(this.lazyInit instanceof fd?this.copyFrom(this.lazyInit):this.lazyInit(),this.lazyInit=null,this.lazyUpdate&&(this.lazyUpdate.forEach(e=>this.applyUpdate(e)),this.lazyUpdate=null))}copyFrom(e){e.init(),Array.from(e.headers.keys()).forEach(t=>{this.headers.set(t,e.headers.get(t)),this.normalizedNames.set(t,e.normalizedNames.get(t))})}clone(e){const t=new fd;return t.lazyInit=this.lazyInit&&this.lazyInit instanceof fd?this.lazyInit:this,t.lazyUpdate=(this.lazyUpdate||[]).concat([e]),t}applyUpdate(e){const t=e.name.toLowerCase();switch(e.op){case"a":case"s":let i=e.value;if("string"==typeof i&&(i=[i]),0===i.length)return;this.maybeSetNormalizedName(e.name,t);const r=("a"===e.op?this.headers.get(t):void 0)||[];r.push(...i),this.headers.set(t,r);break;case"d":const s=e.value;if(s){let o=this.headers.get(t);if(!o)return;o=o.filter(a=>-1===s.indexOf(a)),0===o.length?(this.headers.delete(t),this.normalizedNames.delete(t)):this.headers.set(t,o)}else this.headers.delete(t),this.normalizedNames.delete(t)}}forEach(e){this.init(),Array.from(this.normalizedNames.keys()).forEach(t=>e(this.normalizedNames.get(t),this.headers.get(t)))}}class iTe{encodeKey(e){return w7(e)}encodeValue(e){return w7(e)}decodeKey(e){return decodeURIComponent(e)}decodeValue(e){return decodeURIComponent(e)}}const sTe=/%(\d[a-f0-9])/gi,oTe={40:"@","3A":":",24:"$","2C":",","3B":";","2B":"+","3D":"=","3F":"?","2F":"/"};function w7(n){return encodeURIComponent(n).replace(sTe,(e,t)=>{var i;return null!==(i=oTe[t])&&void 0!==i?i:e})}function E7(n){return`${n}`}class xh{constructor(e={}){if(this.updates=null,this.cloneFrom=null,this.encoder=e.encoder||new iTe,e.fromString){if(e.fromObject)throw new Error("Cannot specify both fromString and fromObject.");this.map=function(n,e){const t=new Map;return n.length>0&&n.replace(/^\?/,"").split("&").forEach(r=>{const s=r.indexOf("="),[o,a]=-1==s?[e.decodeKey(r),""]:[e.decodeKey(r.slice(0,s)),e.decodeValue(r.slice(s+1))],l=t.get(o)||[];l.push(a),t.set(o,l)}),t}(e.fromString,this.encoder)}else e.fromObject?(this.map=new Map,Object.keys(e.fromObject).forEach(t=>{const i=e.fromObject[t];this.map.set(t,Array.isArray(i)?i:[i])})):this.map=null}has(e){return this.init(),this.map.has(e)}get(e){this.init();const t=this.map.get(e);return t?t[0]:null}getAll(e){return this.init(),this.map.get(e)||null}keys(){return this.init(),Array.from(this.map.keys())}append(e,t){return this.clone({param:e,value:t,op:"a"})}appendAll(e){const t=[];return Object.keys(e).forEach(i=>{const r=e[i];Array.isArray(r)?r.forEach(s=>{t.push({param:i,value:s,op:"a"})}):t.push({param:i,value:r,op:"a"})}),this.clone(t)}set(e,t){return this.clone({param:e,value:t,op:"s"})}delete(e,t){return this.clone({param:e,value:t,op:"d"})}toString(){return this.init(),this.keys().map(e=>{const t=this.encoder.encodeKey(e);return this.map.get(e).map(i=>t+"="+this.encoder.encodeValue(i)).join("&")}).filter(e=>""!==e).join("&")}clone(e){const t=new xh({encoder:this.encoder});return t.cloneFrom=this.cloneFrom||this,t.updates=(this.updates||[]).concat(e),t}init(){null===this.map&&(this.map=new Map),null!==this.cloneFrom&&(this.cloneFrom.init(),this.cloneFrom.keys().forEach(e=>this.map.set(e,this.cloneFrom.map.get(e))),this.updates.forEach(e=>{switch(e.op){case"a":case"s":const t=("a"===e.op?this.map.get(e.param):void 0)||[];t.push(E7(e.value)),this.map.set(e.param,t);break;case"d":if(void 0===e.value){this.map.delete(e.param);break}{let i=this.map.get(e.param)||[];const r=i.indexOf(E7(e.value));-1!==r&&i.splice(r,1),i.length>0?this.map.set(e.param,i):this.map.delete(e.param)}}}),this.cloneFrom=this.updates=null)}}class aTe{constructor(){this.map=new Map}set(e,t){return this.map.set(e,t),this}get(e){return this.map.has(e)||this.map.set(e,e.defaultValue()),this.map.get(e)}delete(e){return this.map.delete(e),this}keys(){return this.map.keys()}}function S7(n){return"undefined"!=typeof ArrayBuffer&&n instanceof ArrayBuffer}function x7(n){return"undefined"!=typeof Blob&&n instanceof Blob}function C7(n){return"undefined"!=typeof FormData&&n instanceof FormData}class Rb{constructor(e,t,i,r){let s;if(this.url=t,this.body=null,this.reportProgress=!1,this.withCredentials=!1,this.responseType="json",this.method=e.toUpperCase(),function(n){switch(n){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,s=r):s=i,s&&(this.reportProgress=!!s.reportProgress,this.withCredentials=!!s.withCredentials,s.responseType&&(this.responseType=s.responseType),s.headers&&(this.headers=s.headers),s.context&&(this.context=s.context),s.params&&(this.params=s.params)),this.headers||(this.headers=new fd),this.context||(this.context=new aTe),this.params){const o=this.params.toString();if(0===o.length)this.urlWithParams=t;else{const a=t.indexOf("?");this.urlWithParams=t+(-1===a?"?":ap.set(g,e.setHeaders[g]),c)),e.setParams&&(u=Object.keys(e.setParams).reduce((p,g)=>p.set(g,e.setParams[g]),u)),new Rb(i,r,o,{params:u,headers:c,context:h,reportProgress:l,responseType:s,withCredentials:a})}}var ws=(()=>((ws=ws||{})[ws.Sent=0]="Sent",ws[ws.UploadProgress=1]="UploadProgress",ws[ws.ResponseHeader=2]="ResponseHeader",ws[ws.DownloadProgress=3]="DownloadProgress",ws[ws.Response=4]="Response",ws[ws.User=5]="User",ws))();class RC extends class{constructor(e,t=200,i="OK"){this.headers=e.headers||new fd,this.status=void 0!==e.status?e.status:t,this.statusText=e.statusText||i,this.url=e.url||null,this.ok=this.status>=200&&this.status<300}}{constructor(e={}){super(e),this.type=ws.Response,this.body=void 0!==e.body?e.body:null}clone(e={}){return new RC({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})}}function LP(n,e){return{body:e,headers:n.headers,context:n.context,observe:n.observe,params:n.params,reportProgress:n.reportProgress,responseType:n.responseType,withCredentials:n.withCredentials}}let ip=(()=>{class n{constructor(t){this.handler=t}request(t,i,r={}){let s;if(t instanceof Rb)s=t;else{let l,c;l=r.headers instanceof fd?r.headers:new fd(r.headers),r.params&&(c=r.params instanceof xh?r.params:new xh({fromObject:r.params})),s=new Rb(t,i,void 0!==r.body?r.body:null,{headers:l,context:r.context,params:c,reportProgress:r.reportProgress,responseType:r.responseType||"json",withCredentials:r.withCredentials})}const o=fn(s).pipe(function(n,e){return B(n,e,1)}(l=>this.handler.handle(l)));if(t instanceof Rb||"events"===r.observe)return o;const a=o.pipe(Qi(l=>l instanceof RC));switch(r.observe||"body"){case"body":switch(s.responseType){case"arraybuffer":return a.pipe(me(l=>{if(null!==l.body&&!(l.body instanceof ArrayBuffer))throw new Error("Response is not an ArrayBuffer.");return l.body}));case"blob":return a.pipe(me(l=>{if(null!==l.body&&!(l.body instanceof Blob))throw new Error("Response is not a Blob.");return l.body}));case"text":return a.pipe(me(l=>{if(null!==l.body&&"string"!=typeof l.body)throw new Error("Response is not a string.");return l.body}));case"json":default:return a.pipe(me(l=>l.body))}case"response":return a;default:throw new Error(`Unreachable: unhandled observe type ${r.observe}}`)}}delete(t,i={}){return this.request("DELETE",t,i)}get(t,i={}){return this.request("GET",t,i)}head(t,i={}){return this.request("HEAD",t,i)}jsonp(t,i){return this.request("JSONP",t,{params:(new xh).append(i,"JSONP_CALLBACK"),observe:"body",responseType:"json"})}options(t,i={}){return this.request("OPTIONS",t,i)}patch(t,i,r={}){return this.request("PATCH",t,LP(r,i))}post(t,i,r={}){return this.request("POST",t,LP(r,i))}put(t,i,r={}){return this.request("PUT",t,LP(r,i))}}return n.\u0275fac=function(t){return new(t||n)(Oe(b7))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const _Te=["*"];function O7(n){return Error(`Unable to find icon with the name "${n}"`)}function R7(n){return Error(`The URL provided to MatIconRegistry was not trusted as a resource URL via Angular's DomSanitizer. Attempted URL was "${n}".`)}function N7(n){return Error(`The literal provided to MatIconRegistry was not trusted as safe HTML by Angular's DomSanitizer. Attempted literal was "${n}".`)}class rp{constructor(e,t,i){this.url=e,this.svgText=t,this.options=i}}let NC=(()=>{class n{constructor(t,i,r,s){this._httpClient=t,this._sanitizer=i,this._errorHandler=s,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=r}addSvgIcon(t,i,r){return this.addSvgIconInNamespace("",t,i,r)}addSvgIconLiteral(t,i,r){return this.addSvgIconLiteralInNamespace("",t,i,r)}addSvgIconInNamespace(t,i,r,s){return this._addSvgIconConfig(t,i,new rp(r,null,s))}addSvgIconResolver(t){return this._resolvers.push(t),this}addSvgIconLiteralInNamespace(t,i,r,s){const o=this._sanitizer.sanitize(ni.HTML,r);if(!o)throw N7(r);return this._addSvgIconConfig(t,i,new rp("",o,s))}addSvgIconSet(t,i){return this.addSvgIconSetInNamespace("",t,i)}addSvgIconSetLiteral(t,i){return this.addSvgIconSetLiteralInNamespace("",t,i)}addSvgIconSetInNamespace(t,i,r){return this._addSvgIconSetConfig(t,new rp(i,null,r))}addSvgIconSetLiteralInNamespace(t,i,r){const s=this._sanitizer.sanitize(ni.HTML,i);if(!s)throw N7(i);return this._addSvgIconSetConfig(t,new rp("",s,r))}registerFontClassAlias(t,i=t){return this._fontCssClassesByAlias.set(t,i),this}classNameForFontAlias(t){return this._fontCssClassesByAlias.get(t)||t}setDefaultFontSetClass(t){return this._defaultFontSetClass=t,this}getDefaultFontSetClass(){return this._defaultFontSetClass}getSvgIconFromUrl(t){const i=this._sanitizer.sanitize(ni.RESOURCE_URL,t);if(!i)throw R7(t);const r=this._cachedIconsByUrl.get(i);return r?fn(PC(r)):this._loadSvgIconFromConfig(new rp(t,null)).pipe(Yr(s=>this._cachedIconsByUrl.set(i,s)),me(s=>PC(s)))}getNamedSvgIcon(t,i=""){const r=P7(i,t);let s=this._svgIconConfigs.get(r);if(s)return this._getSvgFromConfig(s);if(s=this._getIconConfigFromResolvers(i,t),s)return this._svgIconConfigs.set(r,s),this._getSvgFromConfig(s);const o=this._iconSetConfigs.get(i);return o?this._getSvgFromIconSetConfigs(t,o):Fg(O7(r))}ngOnDestroy(){this._resolvers=[],this._svgIconConfigs.clear(),this._iconSetConfigs.clear(),this._cachedIconsByUrl.clear()}_getSvgFromConfig(t){return t.svgText?fn(PC(this._svgElementFromConfig(t))):this._loadSvgIconFromConfig(t).pipe(me(i=>PC(i)))}_getSvgFromIconSetConfigs(t,i){const r=this._extractIconWithNameFromAnySet(t,i);return r?fn(r):ub(i.filter(o=>!o.svgText).map(o=>this._loadSvgIconSetFromConfig(o).pipe(bc(a=>{const c=`Loading icon set URL: ${this._sanitizer.sanitize(ni.RESOURCE_URL,o.url)} failed: ${a.message}`;return this._errorHandler.handleError(new Error(c)),fn(null)})))).pipe(me(()=>{const o=this._extractIconWithNameFromAnySet(t,i);if(!o)throw O7(t);return o}))}_extractIconWithNameFromAnySet(t,i){for(let r=i.length-1;r>=0;r--){const s=i[r];if(s.svgText&&s.svgText.indexOf(t)>-1){const o=this._svgElementFromConfig(s),a=this._extractSvgIconFromSet(o,t,s.options);if(a)return a}}return null}_loadSvgIconFromConfig(t){return this._fetchIcon(t).pipe(Yr(i=>t.svgText=i),me(()=>this._svgElementFromConfig(t)))}_loadSvgIconSetFromConfig(t){return t.svgText?fn(null):this._fetchIcon(t).pipe(Yr(i=>t.svgText=i))}_extractSvgIconFromSet(t,i,r){const s=t.querySelector(`[id="${i}"]`);if(!s)return null;const o=s.cloneNode(!0);if(o.removeAttribute("id"),"svg"===o.nodeName.toLowerCase())return this._setSvgAttributes(o,r);if("symbol"===o.nodeName.toLowerCase())return this._setSvgAttributes(this._toSvgElement(o),r);const a=this._svgElementFromString("");return a.appendChild(o),this._setSvgAttributes(a,r)}_svgElementFromString(t){const i=this._document.createElement("DIV");i.innerHTML=t;const r=i.querySelector("svg");if(!r)throw Error(" tag not found");return r}_toSvgElement(t){const i=this._svgElementFromString(""),r=t.attributes;for(let s=0;se.lift(new tTe(n))}(()=>this._inProgressUrlFetches.delete(a)),Es());return this._inProgressUrlFetches.set(a,c),c}_addSvgIconConfig(t,i,r){return this._svgIconConfigs.set(P7(t,i),r),this}_addSvgIconSetConfig(t,i){const r=this._iconSetConfigs.get(t);return r?r.push(i):this._iconSetConfigs.set(t,[i]),this}_svgElementFromConfig(t){if(!t.svgElement){const i=this._svgElementFromString(t.svgText);this._setSvgAttributes(i,t.options),t.svgElement=i}return t.svgElement}_getIconConfigFromResolvers(t,i){for(let r=0;re?e.pathname+e.search:""}}}),F7=["clip-path","color-profile","src","cursor","fill","filter","marker","marker-start","marker-mid","marker-end","mask","stroke"],CTe=F7.map(n=>`[${n}]`).join(", "),ATe=/^url\(['"]?#(.*?)['"]?\)$/;let Nm=(()=>{class n extends wTe{constructor(t,i,r,s,o){super(t),this._iconRegistry=i,this._location=s,this._errorHandler=o,this._inline=!1,this._currentIconFetch=x.EMPTY,r||t.nativeElement.setAttribute("aria-hidden","true")}get inline(){return this._inline}set inline(t){this._inline=xi(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 i=this._cleanupFontValue(t);i!==this._fontSet&&(this._fontSet=i,this._updateFontIconClasses())}get fontIcon(){return this._fontIcon}set fontIcon(t){const i=this._cleanupFontValue(t);i!==this._fontIcon&&(this._fontIcon=i,this._updateFontIconClasses())}_splitIconName(t){if(!t)return["",""];const i=t.split(":");switch(i.length){case 1:return["",i[0]];case 2:return i;default:throw Error(`Invalid icon name: "${t}"`)}}ngOnInit(){this._updateFontIconClasses()}ngAfterViewChecked(){const t=this._elementsWithExternalReferences;if(t&&t.size){const i=this._location.getPathname();i!==this._previousPath&&(this._previousPath=i,this._prependPathToReferences(i))}}ngOnDestroy(){this._currentIconFetch.unsubscribe(),this._elementsWithExternalReferences&&this._elementsWithExternalReferences.clear()}_usingFontIcon(){return!this.svgIcon}_setSvgElement(t){this._clearSvgElement();const i=t.querySelectorAll("style");for(let s=0;s{r.forEach(o=>{s.setAttribute(o.name,`url('${t}#${o.value}')`)})})}_cacheChildrenWithExternalReferences(t){const i=t.querySelectorAll(CTe),r=this._elementsWithExternalReferences=this._elementsWithExternalReferences||new Map;for(let s=0;s{const a=i[s],l=a.getAttribute(o),c=l?l.match(ATe):null;if(c){let u=r.get(a);u||(u=[],r.set(a,u)),u.push({name:o,value:c[1]})}})}_updateSvgIcon(t){if(this._svgNamespace=null,this._svgName=null,this._currentIconFetch.unsubscribe(),t){const[i,r]=this._splitIconName(t);i&&(this._svgNamespace=i),r&&(this._svgName=r),this._currentIconFetch=this._iconRegistry.getNamedSvgIcon(r,i).pipe(Wi(1)).subscribe(s=>this._setSvgElement(s),s=>{this._errorHandler.handleError(new Error(`Error retrieving icon ${i}:${r}! ${s.message}`))})}}}return n.\u0275fac=function(t){return new(t||n)(xe(En),xe(NC),Fo("aria-hidden"),xe(ETe),xe(oa))},n.\u0275cmp=ln({type:n,selectors:[["mat-icon"]],hostAttrs:["role","img",1,"mat-icon","notranslate"],hostVars:7,hostBindings:function(t,i){2&t&&(Bi("data-mat-icon-type",i._usingFontIcon()?"font":"svg")("data-mat-icon-name",i._svgName||i.fontIcon)("data-mat-icon-namespace",i._svgNamespace||i.fontSet),vi("mat-icon-inline",i.inline)("mat-icon-no-color","primary"!==i.color&&"accent"!==i.color&&"warn"!==i.color))},inputs:{color:"color",inline:"inline",svgIcon:"svgIcon",fontSet:"fontSet",fontIcon:"fontIcon"},exportAs:["matIcon"],features:[An],ngContentSelectors:_Te,decls:1,vars:0,template:function(t,i){1&t&&(is(),si(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}),n})();function LTe(n,e){}class zP{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 BTe={dialogContainer:Em("dialogContainer",[vc("void, exit",fs({opacity:0,transform:"scale(0.7)"})),vc("enter",fs({transform:"none"})),ud("* => enter",cd("150ms cubic-bezier(0, 0, 0.2, 1)",fs({transform:"none",opacity:1}))),ud("* => void, * => exit",cd("75ms cubic-bezier(0.4, 0.0, 0.2, 1)",fs({opacity:0})))])};let jTe=(()=>{class n extends MC{constructor(t,i,r,s,o,a){super(),this._elementRef=t,this._focusTrapFactory=i,this._changeDetectorRef=r,this._config=o,this._focusMonitor=a,this._animationStateChanged=new sn,this._elementFocusedBeforeDialogWasOpened=null,this._closeInteractionType=null,this.attachDomPortal=l=>(this._portalOutlet.hasAttached(),this._portalOutlet.attachDomPortal(l)),this._ariaLabelledBy=o.ariaLabelledBy||null,this._document=s}_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 i=Zx(),r=this._elementRef.nativeElement;(!i||i===this._document.body||i===r||r.contains(i))&&(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=Zx())}_focusDialogContainer(){this._elementRef.nativeElement.focus&&this._elementRef.nativeElement.focus()}_containsFocus(){const t=this._elementRef.nativeElement,i=Zx();return t===i||t.contains(i)}}return n.\u0275fac=function(t){return new(t||n)(xe(En),xe(XH),xe(Dr),xe(pn,8),xe(zP),xe(du))},n.\u0275dir=Rt({type:n,viewQuery:function(t,i){if(1&t&&ss(tp,7),2&t){let r;ii(r=ri())&&(i._portalOutlet=r.first)}},features:[An]}),n})(),VTe=(()=>{class n extends jTe{constructor(){super(...arguments),this._state="enter"}_onAnimationDone({toState:t,totalTime:i}){"enter"===t?(this._trapFocus(),this._animationStateChanged.next({state:"opened",totalTime:i})):"exit"===t&&(this._restoreFocus(),this._animationStateChanged.next({state:"closed",totalTime:i}))}_onAnimationStart({toState:t,totalTime:i}){"enter"===t?this._animationStateChanged.next({state:"opening",totalTime:i}):("exit"===t||"void"===t)&&this._animationStateChanged.next({state:"closing",totalTime:i})}_startExitAnimation(){this._state="exit",this._changeDetectorRef.markForCheck()}}return n.\u0275fac=function(){let e;return function(i){return(e||(e=nr(n)))(i||n)}}(),n.\u0275cmp=ln({type:n,selectors:[["mat-dialog-container"]],hostAttrs:["tabindex","-1","aria-modal","true",1,"mat-dialog-container"],hostVars:6,hostBindings:function(t,i){1&t&&fE("@dialogContainer.start",function(s){return i._onAnimationStart(s)})("@dialogContainer.done",function(s){return i._onAnimationDone(s)}),2&t&&(Lu("id",i._id),Bi("role",i._config.role)("aria-labelledby",i._config.ariaLabel?null:i._ariaLabelledBy)("aria-label",i._config.ariaLabel)("aria-describedby",i._config.ariaDescribedBy||null),mE("@dialogContainer",i._state))},features:[An],decls:1,vars:0,consts:[["cdkPortalOutlet",""]],template:function(t,i){1&t&&Di(0,LTe,0,0,"ng-template",0)},directives:[tp],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:[BTe.dialogContainer]}}),n})(),UTe=0;class FC{constructor(e,t,i="mat-dialog-"+UTe++){this._overlayRef=e,this._containerInstance=t,this.id=i,this.disableClose=this._containerInstance._config.disableClose,this._afterOpened=new se,this._afterClosed=new se,this._beforeClosed=new se,this._state=0,t._id=i,t._animationStateChanged.pipe(Qi(r=>"opened"===r.state),Wi(1)).subscribe(()=>{this._afterOpened.next(),this._afterOpened.complete()}),t._animationStateChanged.pipe(Qi(r=>"closed"===r.state),Wi(1)).subscribe(()=>{clearTimeout(this._closeFallbackTimeout),this._finishDialogClose()}),e.detachments().subscribe(()=>{this._beforeClosed.next(this._result),this._beforeClosed.complete(),this._afterClosed.next(this._result),this._afterClosed.complete(),this.componentInstance=null,this._overlayRef.dispose()}),e.keydownEvents().pipe(Qi(r=>27===r.keyCode&&!this.disableClose&&!Dl(r))).subscribe(r=>{r.preventDefault(),HP(this,"keyboard")}),e.backdropClick().subscribe(()=>{this.disableClose?this._containerInstance._recaptureFocus():HP(this,"mouse")})}close(e){this._result=e,this._containerInstance._animationStateChanged.pipe(Qi(t=>"closing"===t.state),Wi(1)).subscribe(t=>{this._beforeClosed.next(e),this._beforeClosed.complete(),this._overlayRef.detachBackdrop(),this._closeFallbackTimeout=setTimeout(()=>this._finishDialogClose(),t.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(e){let 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}updateSize(e="",t=""){return this._overlayRef.updateSize({width:e,height:t}),this._overlayRef.updatePosition(),this}addPanelClass(e){return this._overlayRef.addPanelClass(e),this}removePanelClass(e){return this._overlayRef.removePanelClass(e),this}getState(){return this._state}_finishDialogClose(){this._state=2,this._overlayRef.dispose()}_getPositionStrategy(){return this._overlayRef.getConfig().positionStrategy}}function HP(n,e,t){return void 0!==n._containerInstance&&(n._containerInstance._closeInteractionType=e),n.close(t)}const B7=new Ht("MatDialogData"),zTe=new Ht("mat-dialog-default-options"),j7=new Ht("mat-dialog-scroll-strategy");let $Te=(()=>{class n{constructor(t,i,r,s,o,a,l,c,u){this._overlay=t,this._injector=i,this._defaultOptions=r,this._parentDialog=s,this._overlayContainer=o,this._dialogRefConstructor=l,this._dialogContainerType=c,this._dialogDataToken=u,this._openDialogsAtThisLevel=[],this._afterAllClosedAtThisLevel=new se,this._afterOpenedAtThisLevel=new se,this._ariaHiddenElements=new Map,this.afterAllClosed=function(n){return new I(e=>{let t;try{t=n()}catch(r){return void e.error(r)}return(t?je(t):lS()).subscribe(e)})}(()=>this.openDialogs.length?this._getAfterAllClosed():this._getAfterAllClosed().pipe(ao(void 0))),this._scrollStrategy=a}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,i){(i=function(n,e){return Object.assign(Object.assign({},e),n)}(i,this._defaultOptions||new zP)).id&&this.getDialogById(i.id);const r=this._createOverlay(i),s=this._attachDialogContainer(r,i),o=this._attachDialogContent(t,s,r,i);return this.openDialogs.length||this._hideNonDialogContentFromAssistiveTechnology(),this.openDialogs.push(o),o.afterClosed().subscribe(()=>this._removeOpenDialog(o)),this.afterOpened.next(o),s._initializeWithAttachedContent(),o}closeAll(){this._closeDialogs(this.openDialogs)}getDialogById(t){return this.openDialogs.find(i=>i.id===t)}ngOnDestroy(){this._closeDialogs(this._openDialogsAtThisLevel),this._afterAllClosedAtThisLevel.complete(),this._afterOpenedAtThisLevel.complete()}_createOverlay(t){const i=this._getOverlayConfig(t);return this._overlay.create(i)}_getOverlayConfig(t){const i=new IC({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&&(i.backdropClass=t.backdropClass),i}_attachDialogContainer(t,i){const s=Wn.create({parent:i&&i.viewContainerRef&&i.viewContainerRef.injector||this._injector,providers:[{provide:zP,useValue:i}]}),o=new TC(this._dialogContainerType,i.viewContainerRef,s,i.componentFactoryResolver);return t.attach(o).instance}_attachDialogContent(t,i,r,s){const o=new this._dialogRefConstructor(r,i,s.id);if(t instanceof zo)i.attachTemplatePortal(new Im(t,null,{$implicit:s.data,dialogRef:o}));else{const a=this._createInjector(s,o,i),l=i.attachComponentPortal(new TC(t,s.viewContainerRef,a));o.componentInstance=l.instance}return o.updateSize(s.width,s.height).updatePosition(s.position),o}_createInjector(t,i,r){const s=t&&t.viewContainerRef&&t.viewContainerRef.injector,o=[{provide:this._dialogContainerType,useValue:r},{provide:this._dialogDataToken,useValue:t.data},{provide:this._dialogRefConstructor,useValue:i}];return t.direction&&(!s||!s.get(Il,null,Sn.Optional))&&o.push({provide:Il,useValue:{value:t.direction,change:fn()}}),Wn.create({parent:s||this._injector,providers:o})}_removeOpenDialog(t){const i=this.openDialogs.indexOf(t);i>-1&&(this.openDialogs.splice(i,1),this.openDialogs.length||(this._ariaHiddenElements.forEach((r,s)=>{r?s.setAttribute("aria-hidden",r):s.removeAttribute("aria-hidden")}),this._ariaHiddenElements.clear(),this._getAfterAllClosed().next()))}_hideNonDialogContentFromAssistiveTechnology(){const t=this._overlayContainer.getContainerElement();if(t.parentElement){const i=t.parentElement.children;for(let r=i.length-1;r>-1;r--){let s=i[r];s!==t&&"SCRIPT"!==s.nodeName&&"STYLE"!==s.nodeName&&!s.hasAttribute("aria-live")&&(this._ariaHiddenElements.set(s,s.getAttribute("aria-hidden")),s.setAttribute("aria-hidden","true"))}}}_closeDialogs(t){let i=t.length;for(;i--;)t[i].close()}}return n.\u0275fac=function(t){return new(t||n)(xe(wc),xe(Wn),xe(void 0),xe(void 0),xe(Ob),xe(void 0),xe(xu),xe(xu),xe(Ht))},n.\u0275dir=Rt({type:n}),n})(),Pb=(()=>{class n extends $Te{constructor(t,i,r,s,o,a,l){super(t,i,s,a,l,o,FC,VTe,B7)}}return n.\u0275fac=function(t){return new(t||n)(Oe(wc),Oe(Wn),Oe(Pg,8),Oe(zTe,8),Oe(j7),Oe(n,12),Oe(Ob))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),qTe=0,V7=(()=>{class n{constructor(t,i,r){this._dialogRef=t,this._elementRef=i,this._dialog=r,this.id="mat-dialog-title-"+qTe++}ngOnInit(){this._dialogRef||(this._dialogRef=function(n,e){let t=n.nativeElement.parentElement;for(;t&&!t.classList.contains("mat-dialog-container");)t=t.parentElement;return t?e.find(i=>i.id===t.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 n.\u0275fac=function(t){return new(t||n)(xe(FC,8),xe(En),xe(Pb))},n.\u0275dir=Rt({type:n,selectors:[["","mat-dialog-title",""],["","matDialogTitle",""]],hostAttrs:[1,"mat-dialog-title"],hostVars:1,hostBindings:function(t,i){2&t&&Lu("id",i.id)},inputs:{id:"id"},exportAs:["matDialogTitle"]}),n})(),U7=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275dir=Rt({type:n,selectors:[["","mat-dialog-content",""],["mat-dialog-content"],["","matDialogContent",""]],hostAttrs:[1,"mat-dialog-content"]}),n})();const $P=new Ht("CdkAccordion");let XTe=0,ZTe=(()=>{class n{constructor(t,i,r){this.accordion=t,this._changeDetectorRef=i,this._expansionDispatcher=r,this._openCloseAllSubscription=x.EMPTY,this.closed=new sn,this.opened=new sn,this.destroyed=new sn,this.expandedChange=new sn,this.id="cdk-accordion-child-"+XTe++,this._expanded=!1,this._disabled=!1,this._removeUniqueSelectionListener=()=>{},this._removeUniqueSelectionListener=r.listen((s,o)=>{this.accordion&&!this.accordion.multi&&this.accordion.id===o&&this.id!==s&&(this.expanded=!1)}),this.accordion&&(this._openCloseAllSubscription=this._subscribeToOpenCloseAllActions())}get expanded(){return this._expanded}set expanded(t){t=xi(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=xi(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 n.\u0275fac=function(t){return new(t||n)(xe($P,12),xe(Dr),xe(D$))},n.\u0275dir=Rt({type:n,selectors:[["cdk-accordion-item"],["","cdkAccordionItem",""]],inputs:{expanded:"expanded",disabled:"disabled"},outputs:{closed:"closed",opened:"opened",destroyed:"destroyed",expandedChange:"expandedChange"},exportAs:["cdkAccordionItem"],features:[Hn([{provide:$P,useValue:void 0}])]}),n})();const eMe=["body"];function tMe(n,e){}const nMe=[[["mat-expansion-panel-header"]],"*",[["mat-action-row"]]],iMe=["mat-expansion-panel-header","*","mat-action-row"];function rMe(n,e){1&n&&bi(0,"span",2),2&n&&rn("@indicatorRotate",ci()._getExpandedState())}const sMe=[[["mat-panel-title"]],[["mat-panel-description"]],"*"],oMe=["mat-panel-title","mat-panel-description","*"],WP=new Ht("MAT_ACCORDION"),H7="225ms cubic-bezier(0.4,0.0,0.2,1)",G7={indicatorRotate:Em("indicatorRotate",[vc("collapsed, void",fs({transform:"rotate(0deg)"})),vc("expanded",fs({transform:"rotate(180deg)"})),ud("expanded <=> collapsed, void => collapsed",cd(H7))]),bodyExpansion:Em("bodyExpansion",[vc("collapsed, void",fs({height:"0px",visibility:"hidden"})),vc("expanded",fs({height:"*",visibility:"visible"})),ud("expanded <=> collapsed, void => collapsed",cd(H7))])};let aMe=(()=>{class n{constructor(t){this._template=t}}return n.\u0275fac=function(t){return new(t||n)(xe(zo))},n.\u0275dir=Rt({type:n,selectors:[["ng-template","matExpansionPanelContent",""]]}),n})(),lMe=0;const $7=new Ht("MAT_EXPANSION_PANEL_DEFAULT_OPTIONS");let W7=(()=>{class n extends ZTe{constructor(t,i,r,s,o,a,l){super(t,i,r),this._viewContainerRef=s,this._animationMode=a,this._hideToggle=!1,this.afterExpand=new sn,this.afterCollapse=new sn,this._inputChanges=new se,this._headerId="mat-expansion-panel-header-"+lMe++,this._bodyAnimationDone=new se,this.accordion=t,this._document=o,this._bodyAnimationDone.pipe(rd((c,u)=>c.fromState===u.fromState&&c.toState===u.toState)).subscribe(c=>{"void"!==c.fromState&&("expanded"===c.toState?this.afterExpand.emit():"collapsed"===c.toState&&this.afterCollapse.emit())}),l&&(this.hideToggle=l.hideToggle)}get hideToggle(){return this._hideToggle||this.accordion&&this.accordion.hideToggle}set hideToggle(t){this._hideToggle=xi(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(ao(null),Qi(()=>this.expanded&&!this._portal),Wi(1)).subscribe(()=>{this._portal=new Im(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,i=this._body.nativeElement;return t===i||i.contains(t)}return!1}}return n.\u0275fac=function(t){return new(t||n)(xe(WP,12),xe(Dr),xe(D$),xe(Ns),xe(pn),xe(Nl,8),xe($7,8))},n.\u0275cmp=ln({type:n,selectors:[["mat-expansion-panel"]],contentQueries:function(t,i,r){if(1&t&&function(n,e,t,i){const r=Ei();if(r.firstCreatePass){const s=cs();F3(r,new R3(e,t,i),s.index),function(n,e){const t=n.contentQueries||(n.contentQueries=[]);e!==(t.length?t[t.length-1]:-1)&&t.push(n.queries.length-1,e)}(r,n),2==(2&t)&&(r.staticContentQueries=!0)}P3(r,jt(),t)}(r,aMe,5),2&t){let s;ii(s=ri())&&(i._lazyContent=s.first)}},viewQuery:function(t,i){if(1&t&&ss(eMe,5),2&t){let r;ii(r=ri())&&(i._body=r.first)}},hostAttrs:[1,"mat-expansion-panel"],hostVars:6,hostBindings:function(t,i){2&t&&vi("mat-expanded",i.expanded)("_mat-animation-noopable","NoopAnimations"===i._animationMode)("mat-expansion-panel-spacing",i._hasSpacing())},inputs:{disabled:"disabled",expanded:"expanded",hideToggle:"hideToggle",togglePosition:"togglePosition"},outputs:{opened:"opened",closed:"closed",expandedChange:"expandedChange",afterExpand:"afterExpand",afterCollapse:"afterCollapse"},exportAs:["matExpansionPanel"],features:[Hn([{provide:WP,useValue:void 0}]),An,Ui],ngContentSelectors:iMe,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,i){1&t&&(is(nMe),si(0),Pt(1,"div",0,1),Un("@bodyExpansion.done",function(s){return i._bodyAnimationDone.next(s)}),Pt(3,"div",2),si(4,1),Di(5,tMe,0,0,"ng-template",3),Ft(),si(6,2),Ft()),2&t&&(Zt(1),rn("@bodyExpansion",i._getExpandedState())("id",i.id),Bi("aria-labelledby",i._headerId),Zt(4),rn("cdkPortalOutlet",i._portal))},directives:[tp],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:[G7.bodyExpansion]},changeDetection:0}),n})();class uMe{}const dMe=xP(uMe);let q7=(()=>{class n extends dMe{constructor(t,i,r,s,o,a,l){super(),this.panel=t,this._element=i,this._focusMonitor=r,this._changeDetectorRef=s,this._animationMode=a,this._parentChangeSubscription=x.EMPTY;const c=t.accordion?t.accordion._stateChanges.pipe(Qi(u=>!(!u.hideToggle&&!u.togglePosition))):Yc;this.tabIndex=parseInt(l||"")||0,this._parentChangeSubscription=kn(t.opened,t.closed,c,t._inputChanges.pipe(Qi(u=>!!(u.hideToggle||u.disabled||u.togglePosition)))).subscribe(()=>this._changeDetectorRef.markForCheck()),t.closed.pipe(Qi(()=>t._containsFocus())).subscribe(()=>r.focusVia(i,"program")),o&&(this.expandedHeight=o.expandedHeight,this.collapsedHeight=o.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:Dl(t)||(t.preventDefault(),this._toggle());break;default:return void(this.panel.accordion&&this.panel.accordion._handleHeaderKeydown(t))}}focus(t,i){t?this._focusMonitor.focusVia(this._element,t,i):this._element.nativeElement.focus(i)}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 n.\u0275fac=function(t){return new(t||n)(xe(W7,1),xe(En),xe(du),xe(Dr),xe($7,8),xe(Nl,8),Fo("tabindex"))},n.\u0275cmp=ln({type:n,selectors:[["mat-expansion-panel-header"]],hostAttrs:["role","button",1,"mat-expansion-panel-header","mat-focus-indicator"],hostVars:15,hostBindings:function(t,i){1&t&&Un("click",function(){return i._toggle()})("keydown",function(s){return i._keydown(s)}),2&t&&(Bi("id",i.panel._headerId)("tabindex",i.tabIndex)("aria-controls",i._getPanelId())("aria-expanded",i._isExpanded())("aria-disabled",i.panel.disabled),jy("height",i._getHeaderHeight()),vi("mat-expanded",i._isExpanded())("mat-expansion-toggle-indicator-after","after"===i._getTogglePosition())("mat-expansion-toggle-indicator-before","before"===i._getTogglePosition())("_mat-animation-noopable","NoopAnimations"===i._animationMode))},inputs:{tabIndex:"tabIndex",expandedHeight:"expandedHeight",collapsedHeight:"collapsedHeight"},features:[An],ngContentSelectors:oMe,decls:5,vars:1,consts:[[1,"mat-content"],["class","mat-expansion-indicator",4,"ngIf"],[1,"mat-expansion-indicator"]],template:function(t,i){1&t&&(is(sMe),Pt(0,"span",0),si(1),si(2,1),si(3,2),Ft(),Di(4,rMe,1,1,"span",1)),2&t&&(Zt(4),rn("ngIf",i._showToggle()))},directives:[lc],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:[G7.indicatorRotate]},changeDetection:0}),n})();var Y7=Je(478);Object.create(Error.prototype);const mMe=["*"];var LC=(()=>(function(n){n.LineHighlight="line-highlight",n.LineNumbers="line-numbers"}(LC||(LC={})),LC))();class yMe{}const X7=new Ht("SECURITY_CONTEXT");let qP=(()=>{class n{constructor(t,i,r,s,o){this.platform=t,this.securityContext=i,this.http=r,this.sanitizer=o,this.initialMarkedOptions={renderer:new Y7.Renderer},this.options=s}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,i=!1,r=!1,s=this.options){const o=this.trimIndentation(t),a=i?this.decodeHtml(o):o,l=r?this.renderEmoji(a):a,c=Y7.parse(l,s);return this.sanitizer.sanitize(this.securityContext,c)||""}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(me(i=>this.handleExtension(t,i)))}highlight(t){if(Tf(this.platform)&&"undefined"!=typeof Prism){t||(t=document);const i=t.querySelectorAll('pre code:not([class*="language-"])');Array.prototype.forEach.call(i,r=>r.classList.add("language-none")),Prism.highlightAllUnder(t)}}renderKatex(t,i){if(!Tf(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,(r,s)=>katex.renderToString(s,i))}decodeHtml(t){if(!Tf(this.platform))return t;const i=document.createElement("textarea");return i.innerHTML=t,i.value}handleExtension(t,i){const r=t?t.split("?")[0].split(".").splice(-1).join():"";return"md"!==r?"```"+r+"\n"+i+"\n```":i}renderEmoji(t){if(!Tf(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 i;return t.split("\n").map(r=>{let s=i;return r.length>0&&(s=isNaN(s)?r.search(/\S|$/):Math.min(r.search(/\S|$/),s)),isNaN(i)&&(i=s),s?r.substring(s):r}).join("\n")}}return n.\u0275fac=function(t){return new(t||n)(Oe(Wc),Oe(X7),Oe(ip,8),Oe(yMe,8),Oe(Mf))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),Q7=(()=>{class n{constructor(t,i){this.element=t,this.markdownService=i,this.error=new sn,this.load=new sn,this.ready=new sn,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,i=!1){let r=this.markdownService.compile(t,i,this.emoji);r=this.katex?this.markdownService.renderKatex(r,this.katexOptions):r,this.element.nativeElement.innerHTML=r,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,LC.LineNumbers),this.setPluginOptions(this.element.nativeElement,{dataStart:this.start}))}setPluginClass(t,i){const r=t.querySelectorAll("pre");for(let s=0;s{const a=i[o];if(a){const l=this.toLispCase(o);r.item(s).setAttribute(l,a.toString())}})}toLispCase(t){const i=t.match(/([A-Z])/g);if(!i)return t;let r=t.toString();for(let s=0,o=i.length;sP(i)?t(...i):t(i))):new I(i=>{const r=(...o)=>i.next(1===o.length?o[0]:o);let s;try{s=n(r)}catch(o){return void i.error(o)}if(Y(e))return()=>e(r,s)})}function YP(...n){return e=>{let t;return"function"==typeof n[n.length-1]&&(t=n.pop()),e.lift(new CMe(n,t))}}class CMe{constructor(e,t){this.observables=e,this.project=t}call(e,t){return t.subscribe(new AMe(e,this.observables,this.project))}}class AMe extends l7{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)}}class TMe{constructor(e,t,i=!1){this.accumulator=e,this.seed=t,this.hasSeed=i}call(e,t){return t.subscribe(new MMe(e,this.accumulator,this.seed,this.hasSeed))}}class MMe extends y{constructor(e,t,i,r){super(e),this.accumulator=t,this._seed=i,this.hasSeed=r,this.index=0}get seed(){return this._seed}set seed(e){this.hasSeed=!0,this._seed=e}_next(e){if(this.hasSeed)return this._tryNext(e);this.seed=e,this.destination.next(e)}_tryNext(e){const t=this.index++;let i;try{i=this.accumulator(this.seed,e,t)}catch(r){this.destination.error(r)}this.seed=i,this.destination.next(i)}}class OMe{constructor(e){this.predicate=e}call(e,t){return t.subscribe(new RMe(e,this.predicate))}}class RMe extends y{constructor(e,t){super(e),this.predicate=t,this.skipping=!0,this.index=0}_next(e){const t=this.destination;this.skipping&&this.tryCallPredicate(e),this.skipping||t.next(e)}tryCallPredicate(e){try{const t=this.predicate(e,this.index++);this.skipping=Boolean(t)}catch(t){this.destination.error(t)}}}const NMe=["youtubeContainer"];let tW=(()=>{class n{constructor(t,i){this._ngZone=t,this._youtubeContainer=new se,this._destroyed=new se,this._playerChanges=new Br(void 0),this._videoId=new Br(void 0),this._height=new Br(390),this._width=new Br(640),this._startSeconds=new Br(void 0),this._endSeconds=new Br(void 0),this._suggestedQuality=new Br(void 0),this._playerVars=new Br(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=Tf(i)}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=fn(!0);if(!window.YT||!window.YT.Player){const r=new se;this._existingApiReadyCallback=window.onYouTubeIframeAPIReady,window.onYouTubeIframeAPIReady=()=>{this._existingApiReadyCallback&&this._existingApiReadyCallback(),this._ngZone.run(()=>r.next(!0))},t=r.pipe(Wi(1),ao(!1))}const i=function(n,e,t,i,r,s,o){const a=Yo([e,s]).pipe(YP(Yo([i,r])),me(([l,c])=>{const[u,h]=l,[p,g]=c;return u?{videoId:u,playerVars:h,width:p,height:g}:void 0}));return Yo([n,a,fn(o)]).pipe(function(n){return ce(function(...n){let e=null;return"function"==typeof n[n.length-1]&&(e=n.pop()),1===n.length&&P(n[0])&&(n=n[0].slice()),t=>t.lift.call(je([t,...n]),new d7(e))}(n),function(n){return e=>e.lift(new OMe(n))}(([e,t])=>!t),me(([e])=>e))}(t),function(n,e){let t=!1;return arguments.length>=2&&(t=!0),function(r){return r.lift(new TMe(n,e,t))}}(jMe,void 0),rd())}(this._youtubeContainer,this._videoId,t,this._width,this._height,this._playerVars,this._ngZone).pipe(Yr(r=>{this._playerChanges.next(r)}),B(e=>e?nW(e)?fn(e):new I(t=>{let i=!1,r=!1;const s=o=>{r=!0,i||(o.target.removeEventListener("onReady",s),t.next(o.target))};return e.addEventListener("onReady",s),()=>{i=!0,r||(r=>{nW(r)||r.destroy()})(e)}}).pipe(Wi(1),ao(void 0)):fn(void 0)),_r(this._destroyed),el(new se));i.subscribe(r=>{this._player=r,r&&this._pendingPlayerState&&this._initializePlayer(r,this._pendingPlayerState),this._pendingPlayerState=void 0}),function(n,e,t){Yo([n,e,t]).subscribe(([i,r,s])=>i&&i.setSize(r,s))}(i,this._width,this._height),function(n,e){Yo([n,e]).subscribe(([t,i])=>t&&i&&t.setPlaybackQuality(i))}(i,this._suggestedQuality),function(n,e,t,i,r,s){const o=Yo([t,i]).pipe(me(([u,h])=>({startSeconds:u,endSeconds:h}))),a=o.pipe(XP(n,u=>!!u&&!function(n){const e=n.getPlayerState();return e!==YT.PlayerState.UNSTARTED&&e!==YT.PlayerState.CUED}(u))),l=e.pipe(XP(n,(u,h)=>!!u&&u.videoId!==h));kn(n.pipe(XP(Yo([e,o]),([u,h],p)=>!(!p||u==p.videoId&&!h.startSeconds&&!h.endSeconds))),l,a).pipe(YP(Yo([n,e,o,r])),me(([u,h])=>h),_r(s)).subscribe(([u,h,p,g])=>{!h||!u||(u.videoId=h,u.cueVideoById(Object.assign({videoId:h,suggestedQuality:g},p)))})}(i,this._videoId,this._startSeconds,this._endSeconds,this._suggestedQuality,this._destroyed),i.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,i){this._player?this._player.seekTo(t,i):this._getPendingState().seek={seconds:t,allowSeekAhead:i}}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,i){const{playbackState:r,playbackRate:s,volume:o,muted:a,seek:l}=i;switch(r){case YT.PlayerState.PLAYING:t.playVideo();break;case YT.PlayerState.PAUSED:t.pauseVideo();break;case YT.PlayerState.CUED:t.stopVideo()}null!=s&&t.setPlaybackRate(s),null!=o&&t.setVolume(o),null!=a&&(a?t.mute():t.unMute()),null!=l&&t.seekTo(l.seconds,l.allowSeekAhead)}_getLazyEmitter(t){return this._playerChanges.pipe(Ir(i=>i?Z7(r=>{i.addEventListener(t,r)},r=>{try{i.removeEventListener&&i.removeEventListener(t,r)}catch(s){}}):fn()),i=>new I(r=>i.subscribe({next:s=>this._ngZone.run(()=>r.next(s)),error:s=>r.error(s),complete:()=>r.complete()})),_r(this._destroyed))}}return n.\u0275fac=function(t){return new(t||n)(xe(gn),xe(Wc))},n.\u0275cmp=ln({type:n,selectors:[["youtube-player"]],viewQuery:function(t,i){if(1&t&&ss(NMe,5),2&t){let r;ii(r=ri())&&(i.youtubeContainer=r.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,i){1&t&&bi(0,"div",null,0)},encapsulation:2,changeDetection:0}),n})();function jMe(n,[e,t,i]){if(n&&t&&n.playerVars!==t.playerVars)n.destroy();else{if(!t)return void(n&&n.destroy());if(n)return n}const r=i.runOutsideAngular(()=>new YT.Player(e,t));return r.videoId=t.videoId,r.playerVars=t.playerVars,r}function nW(n){return"getPlayerStatus"in n}function XP(n,e){return ce(YP(n),Qi(([t,i])=>e(i,t)),me(([t])=>t))}let KMe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275dir=Rt({type:n,selectors:[["","mat-card-sm-image",""],["","matCardImageSmall",""]],hostAttrs:[1,"mat-card-sm-image"]}),n})();function kb(n){return!0===n}function Xa(n){return null==n}function Qa(n){return!Xa(n)}function QP(n){return Boolean(n)}function oW(n){return Xa(n)?n:JSON.parse(JSON.stringify(n))}const jC=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])&&jC(n[o])}),n};function aW(n){return Qa(n)&&"object"==typeof n&&function(n){return"[object Object]"===Object.prototype.toString.call(n)}(n)}const uW="NGXS_DATA_META",JP="NGXS_META",dW="NGXS_ARGUMENT_REGISTRY_META";let hW=(()=>{class n{constructor(t){this.sequence$=new Br(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)(Oe(cu,8))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();function Lb(n){return n[uW]}let Za=(()=>{class n{constructor(t,i,r){n.store=t.get(cu),n.ngZone=t.get(gn),n.factory=i,n.context=r,n.computed=t.get(hW)}}return n.store=null,n.computed=null,n.context=null,n.factory=null,n.ngZone=null,n.\u0275fac=function(t){return new(t||n)(Oe(Wn),Oe(a6),Oe(o6))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();class ps{constructor(){ps.statesCachedMeta.clear()}static createStateContext(e){return Za.context.createStateContext(e)}static ensureMappedState(e){if(Xa(Za.factory)||Xa(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(Qa(e.name)?ps.statesCachedMeta.get(e.name):null)||ps.ensureMeta(e)}static getRepositoryByInstance(e){var t;const r=null!==(t=Lb(ps.getStateClassByInstance(e)))&&void 0!==t?t:null;if(Xa(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=ps.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=ps.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=Qa(e.name)?null===(t=Za.factory.states)||void 0===t?void 0:t.find(r=>r.name===e.name):null;return Qa(i)&&Qa(e.name)&&ps.statesCachedMeta.set(e.name,i),i}}ps.statesCachedMeta=new Map,ps.\u0275fac=function(e){return new(e||ps)},ps.\u0275prov=We({token:ps,factory:ps.\u0275fac}),new kg(1);class mDe extends Error{constructor(e){super(`Child states can only be added to an object. Cannot convert ${Qa(null==e?void 0:e.constructor)?e.constructor.name:e} to PlainObject`)}}function fW(n){var e;return null!==(e=n.NGXS_OPTIONS_META)&&void 0!==e?e:{name:""}}function pW(n){var e;const t=fW(n),i=null!==(e=t.children)&&void 0!==e?e:[],s=oW(void 0===t.defaults?{}:t.defaults);if(i.length){if(aW(s))return function(n,e){return e.reduce((t,i)=>{const r=fW(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()]=pW(i),t},null!=n?n:{})}(s,i);throw new mDe(s)}return s}function mW(n){var e;return null!==(e=n.__NGXS_COMPUTED_OPTION__)&&void 0!==e?e:null}function _W(){var n,e;return null!==(e=null===(n=null==Za?void 0:Za.computed)||void 0===n?void 0:n.sequenceValue)&&void 0!==e?e:0}function vDe(n){let e=!1;return Tm(n)&&(e=!0),e}function eF(n){return n[dW]}class wDe extends Error{constructor(e,t){super(`An argument with the name '${e}' already exists in the method '${t}'`)}}class EDe{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(QP(this.argumentMap.has(e))||QP(this.payloadMap.has(e)))throw new wDe(e,t)}}function MDe(n){return{enumerable:!0,configurable:!0,get(){const e=Lb(n),t=ps.ensureMappedState(e.stateMeta);return ps.createStateContext(t)}}}function yW(){return(n,e,t)=>{!function(n,e){if(!function(n,e){var t;let i=n,r=!1;if(aW(i))for(;null!==i;){if(kb(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 Xa(mW(n))&&Object.defineProperties(n,{__NGXS_COMPUTED_OPTION__:{enumerable:!0,configurable:!0,value:new WeakMap}}),mW(n)}(this),o=null==s?void 0:s.get(i);if(kb(null==o?void 0:o.isObservable))return null==o?void 0:o.value;if(Xa(o)||o.sequenceId!==_W()){s.delete(i);const l=i.apply(this,r);return s.set(i,{value:l,sequenceId:_W(),isObservable:vDe(l)}),l}return o.value},t}}const PDe={cancelUncompleted:!0,insideZone:!1};function tF(n=PDe){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=ps.getRepositoryByInstance(a),u=c.operations;let h=u[s];const p=c.stateMeta,g=eF(r);if(Xa(h)){const U=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),de=function(n){const{statePath:e,argumentsNames:t,methodName:i,argumentRegistry:r}=n;let s="";for(let o=0;o{var U;return kb(n.insideZone)?null===(U=Za.ngZone)||void 0===U||U.run(()=>{l=r.apply(a,o)}):l=r.apply(a,o),Tm(l)?fn(null).pipe(me(()=>l)):l};const C=ps.createAction(h,o,g),H=Za.store.dispatch(C);return Tm(l)?function(n,e){return ub([n,e]).pipe(me(t=>t.pop()))}(H,l):l},i}}function bW(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 Xa(eF(t))&&Object.defineProperties(t,{[dW]:{enumerable:!0,configurable:!0,value:new EDe}}),eF(t)})(e,t).createPayloadType(r,t,i)}}function kDe(){return n=>{const e=function(n){if(function(n){return!QP(n)}(n.hasOwnProperty(JP))){const e={name:null,actions:{},defaults:{},path:null,makeRootSelector:t=>t.getStateGetter(e.name),children:[]};Object.defineProperty(n,JP,{value:e})}return function(n){var e;return null===(e=n)||void 0===e?void 0:e[JP]}(n)}(n);if(Xa(e.name))throw new Error("@StateRepository should be add before decorator @State");!function(n,e){(function(n){var e;const t=null!==(e=Lb(n))&&void 0!==e?e:null;return(Xa(t)||(null==t?void 0:t.stateClass)!==n)&&function(n){Object.defineProperty(n,uW,{writable:!0,configurable:!0,enumerable:!0,value:{stateMeta:null,operations:{},stateClass:n}})}(n),Lb(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:()=>oW(t)},context:MDe(n)})}(n,e,pW(n)),function(n){var e,t;const i=Lb(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(Qa(r)){const s=`__${r}__selector`;Object.defineProperties(n.prototype,{[s]:{writable:!0,enumerable:!1,configurable:!0},state$:{enumerable:!0,configurable:!0,get(){if(Qa(this[s]))return this[s];if(Xa(Za.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]=Za.store.select(n).pipe(me(o=>Ba()?jC(o):o),$a({refCount:!0,bufferSize:1})),this[s]}}})}}(n)}}let BDe=(()=>{class n{constructor(){this.browserStorageEvents$=new se,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})(),jDe=(()=>{class n extends BDe{get snapshot(){return function(n){return Ba()?jC(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:()=>Ba()?jC(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=nr(n)))(i||n)}}(),n.\u0275prov=We({token:n,factory:n.\u0275fac}),rr([yW(),dc("design:type",Object),dc("design:paramtypes",[])],n.prototype,"snapshot",null),rr([tF(),Aj(0,bW("patchValue")),dc("design:type",Function),dc("design:paramtypes",[Object]),dc("design:returntype",void 0)],n.prototype,"patchState",null),rr([tF(),Aj(0,bW("stateValue")),dc("design:type",Function),dc("design:paramtypes",[Object]),dc("design:returntype",void 0)],n.prototype,"setState",null),rr([tF(),dc("design:type",Function),dc("design:paramtypes",[]),dc("design:returntype",void 0)],n.prototype,"reset",null),n})();const jm=new Ht("ngx-google-analytics-settings",{factory:()=>({trackingCode:"",enableTracing:!1})}),xF=new Ht("ngx-window",{providedIn:"root",factory:()=>function(n){return Tf(n)?window:null}(Fc(Wc))}),ZOe=new Ht("ngx-data-layer",{providedIn:"root",factory:()=>function(n){return n?n.dataLayer=n.dataLayer||[]:null}(Fc(xF))}),CF=new Ht("ngx-gtag-fn",{providedIn:"root",factory:()=>function(n,e){return n?n.gtag=n.gtag||function(){e.push(arguments)}:null}(Fc(xF),Fc(ZOe))});let AF=(()=>{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||Ba())&&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)(Oe(jm),Oe(pn),Oe(CF))},n.\u0275prov=We({factory:function(){return new n(Oe(jm),Oe(pn),Oe(CF))},token:n,providedIn:"root"}),n})();new Ht("ngx-google-analytics-routing-settings",{factory:()=>({})}),new Ht("Key under which consent is stored",{providedIn:"root",factory:()=>"ALLOW_TELEMETRY"});class M9 extends Error{constructor(){super(...arguments),this.message="NgxsDispatchPluginModule is not imported"}}function bRe(){throw new M9}function vRe(){throw new M9}function DF(n,e,t){e.run(()=>n.dispatch(t))}function SRe(n,e,t,i){return yg(t)?function(n,e,t){return t.then(i=>(DF(n,e,i),i))}(n,e,t):Tm(t)?function(n,e,t,i){return null!==i&&(t=t.pipe(_r(i.cancelUncompleted$))),t.subscribe({next:r=>DF(n,e,r)}),t}(n,e,t,i):(DF(n,e,t),t)}class xRe{constructor(){this.cancelUncompleted$=new se}cancelPreviousAction(){this.cancelUncompleted$.next()}}const IF="\u0275fac",D9=Symbol("InjectorInstance"),I9=Symbol("FactoryHasBeenDecorated");function O9(n,e){const t=n[D9];return t?t.get(e):null}const TRe={cancelUncompleted:!1};function R9(n=TRe){return(e,t,i)=>{let r;const s=function(n){return n?new xRe:null}(n.cancelUncompleted);function o(){null!==s&&s.cancelPreviousAction();const a=O9(this,cu)||bRe(),l=O9(this,gn)||vRe(),c=r.apply(this,arguments);return l.runOutsideAngular(()=>SRe(a,l,c,s))}"function"==typeof(null==i?void 0:i.value)?(r=i.value,i.value=o):Object.defineProperty(e,t,{set:a=>r=a,get:()=>o}),function(n){if(I9 in n.constructor.prototype)return;const e=n.constructor;"function"==typeof e[IF]&&function(n){const e=n[IF];if("function"!=typeof e)return;const t=n.\u0275prov||n.\u0275pipe||n.\u0275cmp||n.\u0275dir,i=()=>{const r=e();return r[D9]=xe(Pu),r};t&&(t.factory=i),Object.defineProperty(n,IF,{get:()=>i})}(e),n.constructor.prototype[I9]=!0}(e)}}const tNe=["bodyCanvas"];let nNe=(()=>{class n{constructor(){this.clsName="ccf-body-ui",this.rotationChange=new sn,this.nodeDrag=new sn,this.nodeClick=new sn,this.nodeHoverStart=new sn,this.nodeHoverStop=new sn,this.initialized=new sn,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 Fi(this,void 0,void 0,function*(){const i=this.bodyCanvas.nativeElement,r=new Qve({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.target&&this.bodyUI.setTarget(this.target),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))],this.initialized.emit()})}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=ln({type:n,selectors:[["ccf-body-ui"]],viewQuery:function(t,i){if(1&t&&ss(tNe,5,En),2&t){let r;ii(r=ri())&&(i.bodyCanvas=r.first)}},hostVars:2,hostBindings:function(t,i){2&t&&vl(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",initialized:"initialized"},decls:2,vars:0,consts:[[1,"body-ui"],["bodyCanvas",""]],template:function(t,i){1&t&&bi(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})(),iNe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=on({type:n}),n.\u0275inj=xt({imports:[[qr]]}),n})();function ENe(n,e){if(1&n&&(Pt(0,"div",16),bi(1,"youtube-player",17),Ft()),2&n){const t=ci(3);Zt(1),pE("videoId",t.videoID)}}function SNe(n,e){if(1&n&&(Pt(0,"mat-expansion-panel",11),Pt(1,"mat-expansion-panel-header"),Pt(2,"h2",12),Oi(3),Ft(),Ft(),Pt(4,"div",13),bi(5,"markdown",14),Di(6,ENe,2,1,"div",15),Ft(),Ft()),2&n){const t=ci(),i=t.index,r=t.$implicit;rn("expanded",0===i),Zt(3),da(r.title),Zt(2),vi("first",0===i),rn("data",r.content),Zt(1),rn("ngIf",0===i)}}function xNe(n,e){if(1&n&&(Pt(0,"div",9),Di(1,SNe,7,6,"mat-expansion-panel",10),Ft()),2&n){const t=e.$implicit;Zt(1),rn("ngIf",t)}}new Ht("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:brain",organ:"Brain",name:"Brain",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000955"},{disabled:!0,src:"app:lymph-nodes",organ:"Lymph Node",name:"Lymph Node",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000029"},{src:"app:lymph-nodes",organ:"Lymph Node",name:"Lymph Node",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002509"},{disabled:!0,src:"app:eye",organ:"Eye",name:"Eye, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000970"},{src:"app:eye",organ:"Eye",name:"Eye, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0004548"},{src:"app:eye",organ:"Eye",name:"Eye, R",side:"right",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0004549"},{disabled:!0,src:"app:fallopian-tube-left",organ:"Fallopian Tube",name:"Fallopian Tube, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0003889"},{src:"app:fallopian-tube-left",organ:"Fallopian Tube",name:"Fallopian Tube, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0001303"},{src:"app:fallopian-tube-right",organ:"Fallopian Tube",name:"Fallopian Tube, R",side:"right",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0001302"},{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, L",side:"left",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"},{disabled:!0,src:"app:knee",organ:"Knee",name:"Knee, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001465"},{src:"app:knee",organ:"Knee",name:"Knee, L",side:"left",hasSex:!0,id:"http://purl.org/sig/ont/fma/fma24978"},{src:"app:knee",organ:"Knee",name:"Knee, R",side:"right",hasSex:!0,id:"http://purl.org/sig/ont/fma/fma24977"},{src:"app:liver",organ:"Liver",name:"Liver",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002107"},{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"},{disabled:!0,src:"app:mammary-gland",organ:"Mammary Gland",name:"Mammary Gland, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0001911"},{src:"app:mammary-gland",organ:"Mammary Gland",name:"Mammary Gland, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.org/sig/ont/fma/fma57991"},{src:"app:mammary-gland",organ:"Mammary Gland",name:"Mammary Gland, R",side:"right",hasSex:!1,sex:"female",id:"http://purl.org/sig/ont/fma/fma57987"},{disabled:!0,src:"app:ovary-left",organ:"Ovary",name:"Ovary, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0000992"},{src:"app:ovary-left",organ:"Ovary",name:"Ovary, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.org/sig/ont/fma/fma7214"},{src:"app:ovary-right",organ:"Ovary",name:"Ovary, R",side:"right",hasSex:!1,sex:"female",id:"http://purl.org/sig/ont/fma/fma7213"},{src:"app:pancreas",organ:"Pancreas",name:"Pancreas",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001264"},{src:"app:pelvis-f",organ:"Pelvis",name:"Pelvis",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001270"},{src:"app:placenta",organ:"Placenta",name:"Placenta",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0001987"},{src:"app:prostate",organ:"Prostate",name:"Prostate",hasSex:!1,sex:"male",id:"http://purl.obolibrary.org/obo/UBERON_0002367",disabled:!0},{src:"app:prostate",organ:"Prostate",name:"Prostate",hasSex:!1,sex:"male",id:"http://purl.obolibrary.org/obo/UBERON_0000079"},{src:"app:small-intestine",organ:"Small Intestine",name:"Small Intestine",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002108"},{src:"app:large-intestine",organ:"Large Intestine",name:"Large Intestine",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000059"},{src:"app:spinal-cord",organ:"Spinal Cord",name:"Spinal Cord",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002240"},{src:"app:spleen",organ:"Spleen",name:"Spleen",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002106"},{src:"app:thymus",organ:"Thymus",name:"Thymus",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002370"},{disabled:!0,src:"app:ureter-left",organ:"Ureter",name:"Ureter, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000056"},{src:"app:ureter-left",organ:"Ureter",name:"Ureter, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001223"},{src:"app:ureter-right",organ:"Ureter",name:"Ureter, R",side:"right",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001222"},{src:"app:bladder",organ:"Urinary Bladder",name:"Urinary Bladder",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001255"},{src:"app:uterus",organ:"Uterus",name:"Uterus",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0000995"},{src:"app:vasculature-thick",organ:"Blood Vasculature",name:"Blood Vasculature",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0004537"},{disabled:!0,src:"app:vasculature-thick",organ:"Blood Vasculature",name:"Blood Vasculature",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002049"}].sort((n,e)=>n.name.localeCompare(e.name)).filter(n=>!0!==n.disabled);let G9=(()=>{class n{constructor(t,i){this.dialogRef=t,this.data=i,this.documentationContents=i.content||[],this.infoTitle=i.title||"",this.videoID=i.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 n.\u0275fac=function(t){return new(t||n)(xe(FC),xe(B7))},n.\u0275cmp=ln({type:n,selectors:[["ccf-info-dialog"]],decls:11,vars:2,consts:[[1,"rui-about","wrapper"],[1,"container"],[1,"content"],[1,"header"],["mat-dialog-title","",1,"title"],[1,"close"],[1,"material-icons","close-icon",3,"click"],[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,i){1&t&&(Pt(0,"div",0),Pt(1,"div",1),Pt(2,"div",2),Pt(3,"div",3),Pt(4,"h2",4),Oi(5),Ft(),Pt(6,"div",5),Pt(7,"mat-icon",6),Un("click",function(){return i.close()}),Oi(8,"clear"),Ft(),Ft(),Ft(),Pt(9,"mat-dialog-content",7),Di(10,xNe,2,1,"div",8),Ft(),Ft(),Ft(),Ft()),2&t&&(Zt(5),da(i.infoTitle),Zt(5),rn("ngForOf",i.documentationContents))},directives:[V7,Nm,U7,Af,lc,W7,q7,Q7,tW],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%] .content[_ngcontent-%COMP%] .header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;height:3rem;margin-bottom:2.25rem;position:relative}.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%]{cursor:pointer;height:3rem;width:3rem;line-height:3rem;text-align:center;transition:.6s}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-size:1.5rem;margin:0 auto;line-height:3rem;height:3rem;justify-self:center;display:flex}.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;display:flex}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .dialog-content[_ngcontent-%COMP%] .variable-binding.first[_ngcontent-%COMP%]{padding-right:1rem;width:73%}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .dialog-content[_ngcontent-%COMP%] .variable-binding[_ngcontent-%COMP%] ul{margin:0}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .dialog-content[_ngcontent-%COMP%] .variable-binding[_ngcontent-%COMP%] img{margin-left:1rem;float:right}.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%}"]}),n})(),$9=(()=>{class n{constructor(t){this.http=t,this.panelContent=new Br({content:[],infoTitle:"",videoID:""})}updateData(t,i,r){this.http.get(t,{responseType:"text"}).subscribe(s=>{const o={content:this.parseMarkdown(s),infoTitle:r,videoID:i};this.panelContent.next(o)})}parseMarkdown(t){const i=[],r=t.split("# ");for(const s of r)if(s.length){const o=s.includes("\n\n")?"\n\n":"\r\n\r\n",a=s.split(o);i.push({title:a[0],content:a.splice(1).join(o)})}return i}}return n.\u0275fac=function(t){return new(t||n)(Oe(ip))},n.\u0275prov=We({token:n,factory:n.\u0275fac,providedIn:"root"}),n})(),ANe=(()=>{class n{constructor(){this.clsName="ccf-call-to-action",this.callToActionClicked=new sn,this.closeClicked=new sn}close(){this.closeClicked.emit()}onDialogButtonClick(){this.callToActionClicked.emit()}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=ln({type:n,selectors:[["ccf-call-to-action"]],hostVars:2,hostBindings:function(t,i){2&t&&vl(i.clsName)},inputs:{infoTitle:"infoTitle",imageUrl:"imageUrl",message:"message",callToAction:"callToAction"},outputs:{callToActionClicked:"callToActionClicked",closeClicked:"closeClicked"},decls:13,vars:4,consts:[[1,"rui-about","wrapper"],[1,"container"],[1,"content"],[1,"first-row"],["mat-dialog-title","",1,"title"],[1,"cta-mat-icon","material-icons","close-icon",3,"click"],["mat-card-sm-image","","alt","preview","layout-fill","",1,"cta-image",3,"src"],[1,"mat-typography","dialog-content"],[1,"message"],["mat-button","",1,"mat-button",3,"text","click"]],template:function(t,i){1&t&&(Pt(0,"div",0),Pt(1,"div",1),Pt(2,"div",2),Pt(3,"div",3),Pt(4,"p",4),Oi(5),Ft(),Pt(6,"mat-icon",5),Un("click",function(){return i.close()}),Oi(7,"clear"),Ft(),Ft(),bi(8,"img",6),Pt(9,"mat-dialog-content",7),Pt(10,"div",8),Oi(11),Ft(),Pt(12,"a",9),Un("click",function(){return i.onDialogButtonClick()}),Ft(),Ft(),Ft(),Ft(),Ft()),2&t&&(Zt(5),da(i.infoTitle),Zt(3),rn("src",i.imageUrl,nf),Zt(3),ha(" ",i.message,""),Zt(1),rn("text",i.callToAction))},directives:[V7,Nm,KMe,U7],styles:["[_nghost-%COMP%] .content[_ngcontent-%COMP%]{display:block;align-content:center;padding-left:1.6rem;padding-right:1.6rem;border-radius:.25rem}[_nghost-%COMP%] .info-button-wrapper[_ngcontent-%COMP%]{border-radius:.25rem;padding:.6rem;transition:.6s}[_nghost-%COMP%] .info-button-wrapper[_ngcontent-%COMP%] .ccf-info-button[_ngcontent-%COMP%]{cursor:pointer;transition:color .6s;font-size:1.2rem;vertical-align:sub}[_nghost-%COMP%] .first-row[_ngcontent-%COMP%]{display:flex;width:100%;line-height:.9rem}[_nghost-%COMP%] .first-row[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{padding-right:7rem;padding-left:.2rem;font-size:.875rem;padding-top:.75rem}[_nghost-%COMP%] .first-row[_ngcontent-%COMP%] .cta-mat-icon[_ngcontent-%COMP%]{height:30%;line-height:3.4rem}[_nghost-%COMP%] .message[_ngcontent-%COMP%]{padding:.5rem}[_nghost-%COMP%] .cta-image[_ngcontent-%COMP%]{align-self:center;-o-object-fit:cover;object-fit:cover;width:100%;border-radius:.25rem}[_nghost-%COMP%] .mat-button[_ngcontent-%COMP%]{background-color:#444a65;font-size:.75rem;position:relative;margin-bottom:1rem;width:100%;height:2rem;color:#fff}"],changeDetection:0}),n})(),Yb=(()=>{let n=class extends jDe{constructor(){super(...arguments),this.optionCache=new Map}get config$(){return this.state$.pipe(Qi(n=>null!=n),$a(1))}setConfig(t){this.setState(t)}patchConfig(t){this.patchState(t)}getProperty(t){return this.config$.pipe(a7(...t),rd(),$a(1))}getOption(...t){const i=this.getPathKey(t);if(this.optionCache.has(i))return this.optionCache.get(i);const r=this.config$.pipe(a7(...t),rd(),$a(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=nr(n)))(i||n)}}(),n.\u0275prov=We({token:n,factory:n.\u0275fac}),rr([yW()],n.prototype,"config$",null),n=rr([kDe(),M6({name:"globalConfig",defaults:null})],n),n})();!function(){const n=localStorage.getItem("ALLOW_TELEMETRY");null===n||n.toLowerCase()}(),new se;let PF=(()=>{class n{}return n.type="[CallToAction] Learn More",n})(),FF=(()=>{class n{}return n.type="[CallToAction] Open Dialog",n})(),kF=(()=>{class n{}return n.type="[CallToAction] Close Dialog",n})();var LF;class wa{get length(){var e,t;return null!==(t=null===(e=wa.storage)||void 0===e?void 0:e.length)&&void 0!==t?t:0}key(e){var t,i;return null!==(i=null===(t=wa.storage)||void 0===t?void 0:t.key(e))&&void 0!==i?i:null}getItem(e,t){var i,r,s;return null!==(s=null!==(r=null===(i=wa.storage)||void 0===i?void 0:i.getItem(e))&&void 0!==r?r:t)&&void 0!==s?s:null}setItem(e,t){var i;try{return null===(i=wa.storage)||void 0===i||i.setItem(e,t),!0}catch(r){return!1}}removeItem(e){var t;null===(t=wa.storage)||void 0===t||t.removeItem(e)}clear(){var e;null===(e=wa.storage)||void 0===e||e.clear()}}wa.storage=(()=>{let n;try{n=window.localStorage;const e="__storage_test__";return n.setItem(e,e),n.removeItem(e),n}catch(e){return e instanceof DOMException&&(22===e.code||1014===e.code||"QuotaExceededError"===e.name||"NS_ERROR_DOM_QUOTA_REACHED"===e.name)&&n&&0!==n.length?n:void 0}})(),wa.\u0275fac=function(e){return new(e||wa)},wa.\u0275prov=We({token:wa,factory:wa.\u0275fac,providedIn:"root"});const Y9="callToActionPopupShown";let Do=LF=class{constructor(e,t,i,r,s){this.dialog=e,this.ga=t,this.storage=i,this.infoService=r,this.http=s}static ctaDatePassed(e,t=Date.now){return+t()>+new Date(e)}ngxsOnInit(e){const{expirationDate:t,popupShown:i}=e.getState(),r=this.storage.getItem(Y9,`${i}`),s=LF.ctaDatePassed(t);"true"!==r&&!s&&e.dispatch(new FF)}getDialogData(){return this.http.get("assets/docs/SPATIAL_SEARCH_README.md",{responseType:"text"}).pipe(me(e=>this.infoService.parseMarkdown(e)))}launchLearnMore(e){this.dialog.open(G9,{autoFocus:!1,panelClass:"modal-animated",width:"72rem",data:{title:"Spatial Search",content:e,videoID:"UfxMpzatowE"}})}learnMore(e){return this.dialog.closeAll(),this.ga.event("open_learn_more","call_to_action"),this.getDialogData().pipe(Yr(t=>this.launchLearnMore(t)))}open(e){this.dialog.open(NNe,{autoFocus:!1,panelClass:"modal-animated",width:"30.75rem",height:"36.688rem"}),this.ga.event("open","call_to_action"),this.storage.setItem(Y9,"true"),e.patchState({popupShown:!0})}close(e){this.dialog.closeAll(),this.ga.event("close","call_to_action")}};Do.\u0275fac=function(e){return new(e||Do)(Oe(Pb),Oe(AF),Oe(wa),Oe($9),Oe(ip))},Do.\u0275prov=We({token:Do,factory:Do.\u0275fac}),rr([_N(PF)],Do.prototype,"learnMore",null),rr([_N(FF)],Do.prototype,"open",null),rr([_N(kF)],Do.prototype,"close",null),Do=LF=rr([M6({name:"callToAction",defaults:{title:"New to the Exploration User Interface",message:"Spatial Search has arrived!",callToAction:"Learn More",imageUrl:"assets/images/spatial_search.gif",expirationDate:"Dec 1, 2022",popupShown:!1}})],Do);let o1=(()=>{class n{static title(t){return t.title}static message(t){return t.message}static callToAction(t){return t.callToAction}static imageUrl(t){return t.imageUrl}static expirationDate(t){return t.expirationDate}static popupShown(t){return t.popupShown}}return rr([_m([Do])],n,"title",null),rr([_m([Do])],n,"message",null),rr([_m([Do])],n,"callToAction",null),rr([_m([Do])],n,"imageUrl",null),rr([_m([Do])],n,"expirationDate",null),rr([_m([Do])],n,"popupShown",null),n})(),NNe=(()=>{class n{constructor(){this.close=()=>new kF,this.learnMore=()=>new PF}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=ln({type:n,selectors:[["ccf-call-to-action-behavior"]],decls:5,vars:12,consts:[[3,"infoTitle","message","callToAction","imageUrl","callToActionClicked","closeClicked"]],template:function(t,i){1&t&&(Pt(0,"ccf-call-to-action",0),Un("callToActionClicked",function(){return i.learnMore()})("closeClicked",function(){return i.close()}),xl(1,"async"),xl(2,"async"),xl(3,"async"),xl(4,"async"),Ft()),2&t&&rn("infoTitle",Vu(1,4,i.title$))("message",Vu(2,6,i.message$))("callToAction",Vu(3,8,i.callToAction$))("imageUrl",Vu(4,10,i.imageUrl$))},directives:[ANe],pipes:[h0],styles:[""],changeDetection:0}),rr([kx(o1.title)],n.prototype,"title$",void 0),rr([kx(o1.message)],n.prototype,"message$",void 0),rr([kx(o1.callToAction)],n.prototype,"callToAction$",void 0),rr([kx(o1.imageUrl)],n.prototype,"imageUrl$",void 0),rr([R9()],n.prototype,"close",void 0),rr([R9()],n.prototype,"learnMore",void 0),n})();const K9="http://purl.org/ccf/latest/ccf-entity.owl#has_spatial_entity",BNe=[173,255,47,229.5];var xn=Je(440),HNe=Je(698),GNe=Je(445),$Ne=Je.n(GNe),fr=Je(815),Kb=Je(609);const or=xn.Util.prefixes({base:"http://purl.org/ccf/latest/ccf.owl#",ccf:"http://purl.org/ccf/",fma:"http://purl.org/sig/ont/fma/fma",obo:"http://purl.obolibrary.org/obo/",uberon:"http://purl.obolibrary.org/obo/UBERON_",cl:"http://purl.obolibrary.org/obo/CL_",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/",dcterms:"http://purl.org/dc/terms/"},xn.DataFactory),un=(or("rdf"),or("rdf")("type"),or("rdfs"),or("rdfs")("label"),or("rdfs")("comment"),or("rdfs")("isDefinedBy"),or("rdfs")("seeAlso"),or("ccf")),co_label=(or("ccf")("has_registration_location"),or("rdfs")("label")),co_description=or("rdfs")("comment"),co_link=un("url"),co_providerName=(un("sex"),un("age"),un("bmi"),xn.DataFactory.literal("Male"),xn.DataFactory.literal("Female"),un("consortium_name"),un("tissue_provider_name")),co_donor=(un("tissue_provider_uuid"),un("comes_from")),co_sections=un("subdivided_into_sections"),co_datasets=un("generates_dataset"),co_sampleType=un("sample_type"),co_sectionCount=(xn.DataFactory.literal("Tissue Block"),xn.DataFactory.literal("Tissue Section"),xn.DataFactory.literal("Non-standard"),un("section_count")),co_sectionSize=un("section_size"),co_sectionUnits=un("section_size_unit"),co_sectionNumber=un("section_number"),co_spatialEntity=un("has_registration_location"),co_technology=(un("has_ontology_term"),un("has_cell_type_term"),un("technology")),co_thumbnail=un("thumbnail"),md={x:un,base:or("base"),ontologyNode:{label:un("ccf_pref_label"),parent:un("ccf_part_of"),children:un("ccf_part_of"),rui_rank:un("rui_rank"),synonymLabels:xn.DataFactory.namedNode("http://www.geneontology.org/formats/oboInOwl#hasExactSynonym")},asctb:{part_of:un("ccf_part_of"),ct_is_a:un("ccf_ct_isa"),located_in:un("ccf_located_in"),characterizes:un("ccf_characterizes")},spatial:{Female:or("base")("VHFemale"),Male:or("base")("VHMale"),BothSexes:or("base")("VHBothSexes"),FemaleOrgans:or("base")("VHFemaleOrgans"),MaleOrgans:or("base")("VHMaleOrgans")},SpatialObjectReference:un("spatial_object_reference"),SpatialEntity:un("spatial_entity"),SpatialPlacement:un("spatial_placement"),spatialObjectReference:{file:un("file_url"),file_format:un("file_format"),file_subpath:un("file_subpath")},extractionSet:{label:or("rdfs")("label"),rui_rank:un("rui_rank")},spatialEntity:{label:or("rdfs")("label"),description:or("rdfs")("comment"),creator:or("dcterms")("creator"),creator_first_name:un("creator_first_name"),creator_last_name:un("creator_last_name"),creator_orcid:un("creator_orcid"),creation_date:or("dcterms")("created"),updated_date:un("updated_date"),ccf_annotations:un("collides_with"),representation_of:un("representation_of"),reference_organ:un("has_reference_organ"),extraction_set_for:un("extraction_set_for"),extraction_set:un("has_extraction_set"),sex:un("organ_owner_sex"),side:un("organ_side"),rui_rank:un("rui_rank"),slice_thickness:un("slice_thickness"),slice_count:un("slice_count"),x_dimension:un("x_dimension"),y_dimension:un("y_dimension"),z_dimension:un("z_dimension"),dimension_units:un("dimension_unit"),object:un("has_object_reference")},spatialPlacement:{source:un("placement_for"),target:un("placement_relative_to"),placement_date:or("dcterms")("created"),x_scaling:un("x_scaling"),y_scaling:un("y_scaling"),z_scaling:un("z_scaling"),scaling_units:un("scaling_unit"),x_rotation:un("x_rotation"),y_rotation:un("y_rotation"),z_rotation:un("z_rotation"),w_rotation:un("theta_rotation"),rotation_order:un("rotation_order"),rotation_units:un("rotation_unit"),x_translation:un("x_translation"),y_translation:un("y_translation"),z_translation:un("z_translation"),translation_units:un("translation_unit")}},ui={x:or("uberon"),body:or("uberon")("0013702")},YNe={x:or("cl"),cell:or("cl")("0000000")},Xb={x:or("fma")},X9=(or("lmha"),{body:ui.body,cell:YNe.cell,respiratory_system:ui.x("0001004"),colon:ui.x("0001155"),left_lung:ui.x("0002168"),right_lung:ui.x("0002167"),left_bronchus:ui.x("0002178"),right_bronchus:ui.x("0002177"),kidney:ui.x("0002113"),ureter:ui.x("0000056"),eye:ui.x("0000970"),fallopian_tube:ui.x("0003889"),knee:ui.x("0001465"),ovary:ui.x("0000992"),trachea:ui.x("0003126"),aorta:ui.x("0000947"),blood:ui.x("0000178"),bone_marrow:ui.x("0002371"),male_reproductive_system:ui.x("0000079"),lymph_node:ui.x("0000029"),blood_vasculature:ui.x("0004537"),brain:ui.x("0000955"),eye_left:ui.x("0004548"),eye_right:Xb.x("54449"),fallopian_tube_left:ui.x("0001303"),fallopian_tube_right:ui.x("0001302"),heart:ui.x("0000948"),kidney_left:ui.x("0004538"),kidney_right:ui.x("0004539"),knee_left:Xb.x("24978"),knee_right:Xb.x("24977"),large_intestine:ui.x("0000059"),liver:ui.x("0002107"),lungs:ui.x("0002048"),mesenteric_lymph_node:ui.x("0002509"),ovary_left:Xb.x("7214"),ovary_right:Xb.x("7213"),pancreas:ui.x("0001264"),pelvis:ui.x("0001270"),prostate_gland:ui.x("0002367"),skin:ui.x("0002097"),small_intestine:ui.x("0002108"),spleen:ui.x("0002106"),thymus:ui.x("0002370"),ureter_left:ui.x("0001223"),ureter_right:ui.x("0001222"),urinary_bladder:ui.x("0001255"),uterus:ui.x("0000995")});function BF(n){const e={};return Object.entries(n).forEach(([t,i])=>{e[i.id]=t}),e}BF(md.spatialObjectReference),BF(md.spatialEntity),BF(md.spatialPlacement),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"]);const zm=Object.freeze({OUTSIDE:-1,INTERSECTING:0,INSIDE:1}),Pr=(Math,Math,{});function cPe(n,{precision:e=Pr.precision||4}={}){return n=function(n){return Math.round(n/Pr.EPSILON)*Pr.EPSILON}(n),"".concat(parseFloat(n.toPrecision(e)))}function Ah(n){return Array.isArray(n)||ArrayBuffer.isView(n)&&!(n instanceof DataView)}function Zb(n,e,t){const i=Pr.EPSILON;t&&(Pr.EPSILON=t);try{if(n===e)return!0;if(Ah(n)&&Ah(e)){if(n.length!==e.length)return!1;for(let r=0;r0?", ":"")+cPe(this[i],e);return"".concat(e.printTypes?this.constructor.name:"","[").concat(t,"]")}equals(e){if(!e||this.length!==e.length)return!1;for(let t=0;t=0&&e=0&&e=a+s)return this.clone();if(s>=a+i)return e.clone();const l=.5*(i+a+s);return oq.copy(o).scale((-i+l)/a).add(t),this.center.copy(oq),this.radius=l,this}expand(e){const t=(e=Jb.from(e)).subtract(this.center).magnitude();return t>this.radius&&(this.radius=t),this}transform(e){this.center.transform(e);const t=function(n,e){var s=e[4],o=e[5],a=e[6],l=e[8],c=e[9],u=e[10];return n[0]=Math.hypot(e[0],e[1],e[2]),n[1]=Math.hypot(s,o,a),n[2]=Math.hypot(l,c,u),n}(Jb,e);return this.radius=Math.max(t[0],Math.max(t[1],t[2]))*this.radius,this}distanceSquaredTo(e){const t=this.distanceTo(e);return t*t}distanceTo(e){const t=(e=Jb.from(e)).subtract(this.center);return Math.max(0,t.len()-this.radius)}intersectPlane(e){const i=this.radius,s=e.normal.dot(this.center)+e.distance;return s<-i?zm.OUTSIDE:s0?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 u5(this,this,e),this.check()}rotateY(e){return d5(this,this,e),this.check()}rotateZ(e){return h5(this,this,e),this.check()}scale(e){return fR(this,this,e),this.check()}slerp(e,t,i){switch(arguments.length){case 1:({start:e=CPe,target:t,ratio:i}=arguments[0]);break;case 2:[t,i]=arguments,e=this}return J0(this,e,t,i),this.check()}transformVector4(e,t=e){return kU(t,e,this),tq(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)}}const APe=new Pn,TPe=new Pn,c1=new Pn,u1=new Pn,d1=new Pn,MPe=new Pn,DPe=new Pn;class GF{constructor(e=[0,0,0],t=[0,0,0,0,0,0,0,0,0]){this.center=(new Pn).from(e),this.halfAxes=new Xo(t)}get halfSize(){const e=this.halfAxes.getColumn(0),t=this.halfAxes.getColumn(1),i=this.halfAxes.getColumn(2);return[new Pn(e).len(),new Pn(t).len(),new Pn(i).len()]}get quaternion(){const e=this.halfAxes.getColumn(0),t=this.halfAxes.getColumn(1),i=this.halfAxes.getColumn(2),r=new Pn(e).normalize(),s=new Pn(t).normalize(),o=new Pn(i).normalize();return(new lq).fromMatrix3(new Xo([...r,...s,...o]))}fromCenterHalfSizeQuaternion(e,t,i){const r=new lq(i),s=(new Xo).fromQuaternion(r);return s[0]=s[0]*t[0],s[1]=s[1]*t[0],s[2]=s[2]*t[0],s[3]=s[3]*t[1],s[4]=s[4]*t[1],s[5]=s[5]*t[1],s[6]=s[6]*t[2],s[7]=s[7]*t[2],s[8]=s[8]*t[2],this.center=(new Pn).from(e),this.halfAxes=s,this}clone(){return new GF(this.center,this.halfAxes)}equals(e){return this===e||Boolean(e)&&this.center.equals(e.center)&&this.halfAxes.equals(e.halfAxes)}getBoundingSphere(e=new HF){const t=this.halfAxes,i=t.getColumn(0,c1),r=t.getColumn(1,u1),s=t.getColumn(2,d1),o=APe.copy(i).add(r).add(s);return e.center.copy(this.center),e.radius=o.magnitude(),e}intersectPlane(e){const t=this.center,i=e.normal,r=this.halfAxes,s=i.x,o=i.y,a=i.z,l=Math.abs(s*r[0]+o*r[1]+a*r[2])+Math.abs(s*r[3]+o*r[4]+a*r[5])+Math.abs(s*r[6]+o*r[7]+a*r[8]),c=i.dot(t)+e.distance;return c<=-l?zm.OUTSIDE:c>=l?zm.INSIDE:zm.INTERSECTING}distanceTo(e){return Math.sqrt(this.distanceSquaredTo(e))}distanceSquaredTo(e){const t=TPe.from(e).subtract(this.center),i=this.halfAxes,r=i.getColumn(0,c1),s=i.getColumn(1,u1),o=i.getColumn(2,d1),a=r.magnitude(),l=s.magnitude(),c=o.magnitude();r.normalize(),s.normalize(),o.normalize();let h,u=0;return h=Math.abs(t.dot(r))-a,h>0&&(u+=h*h),h=Math.abs(t.dot(s))-l,h>0&&(u+=h*h),h=Math.abs(t.dot(o))-c,h>0&&(u+=h*h),u}computePlaneDistances(e,t,i=[-0,-0]){let r=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY;const o=this.center,a=this.halfAxes,l=a.getColumn(0,c1),c=a.getColumn(1,u1),u=a.getColumn(2,d1),h=MPe.copy(l).add(c).add(u).add(o),p=DPe.copy(h).subtract(e);let g=t.dot(p);return r=Math.min(g,r),s=Math.max(g,s),h.copy(o).add(l).add(c).subtract(u),p.copy(h).subtract(e),g=t.dot(p),r=Math.min(g,r),s=Math.max(g,s),h.copy(o).add(l).subtract(c).add(u),p.copy(h).subtract(e),g=t.dot(p),r=Math.min(g,r),s=Math.max(g,s),h.copy(o).add(l).subtract(c).subtract(u),p.copy(h).subtract(e),g=t.dot(p),r=Math.min(g,r),s=Math.max(g,s),o.copy(h).subtract(l).add(c).add(u),p.copy(h).subtract(e),g=t.dot(p),r=Math.min(g,r),s=Math.max(g,s),o.copy(h).subtract(l).add(c).subtract(u),p.copy(h).subtract(e),g=t.dot(p),r=Math.min(g,r),s=Math.max(g,s),o.copy(h).subtract(l).subtract(c).add(u),p.copy(h).subtract(e),g=t.dot(p),r=Math.min(g,r),s=Math.max(g,s),o.copy(h).subtract(l).subtract(c).subtract(u),p.copy(h).subtract(e),g=t.dot(p),r=Math.min(g,r),s=Math.max(g,s),i[0]=r,i[1]=s,i}transform(e){this.center.transformAsPoint(e);const t=this.halfAxes.getColumn(0,c1);t.transformAsPoint(e);const i=this.halfAxes.getColumn(1,u1);i.transformAsPoint(e);const r=this.halfAxes.getColumn(2,d1);return r.transformAsPoint(e),this.halfAxes=new Xo([...t,...i,...r]),this}getTransform(){throw new Error("not implemented")}}const cq=new Pn,uq=new Pn;class $F{constructor(e=[0,0,1],t=0){this.normal=new Pn,this.distance=-0,this.fromNormalDistance(e,t)}fromNormalDistance(e,t){return Ec(Number.isFinite(t)),this.normal.from(e).normalize(),this.distance=t,this}fromPointNormal(e,t){e=cq.from(e),this.normal.from(t).normalize();const i=-this.normal.dot(e);return this.distance=i,this}fromCoefficients(e,t,i,r){return this.normal.set(e,t,i),Ec(Zb(this.normal.len(),1)),this.distance=r,this}clone(e){return new $F(this.normal,this.distance)}equals(e){return Zb(this.distance,e.distance)&&Zb(this.normal,e.normal)}getPointDistance(e){return this.normal.dot(e)+this.distance}transform(e){const t=uq.copy(this.normal).transformAsVector(e).normalize(),i=this.normal.scale(-this.distance).transform(e);return this.fromPointNormal(i,t)}projectPointOntoPlane(e,t=[0,0,0]){e=cq.from(e);const i=this.getPointDistance(e),r=uq.copy(this.normal).scale(i);return e.subtract(r).to(t)}}function bFe(n,e,t){const i={"@id":e,"@type":"OntologyTreeNode",id:e,parent:"",children:[],synonymLabels:[],label:""},r={[md.ontologyNode.label.id]:"label",[t]:"parent",[md.ontologyNode.synonymLabels.id]:"synonymLabels"};for(const[s,o]of function*(n,e,t){for(const[i,r]of Object.entries(t))for(const s of(0,xn.readQuads)(n,e,i,null,null)){const o="Literal"===s.object.termType?(0,Kb.fromRdf)(s.object):s.object.id;yield[r,o]}}(n,e,r))"synonymLabels"===s?i.synonymLabels.push(o):i[s]=o;return i.children=n.getSubjects(t,e,null).map(s=>s.id),i}function mq(n,e,t,i){const r={root:e,nodes:{}},s=new Set;for(const a of(0,xn.readQuads)(n,null,i,null,null))s.add(a.subject.id),s.add(a.object.id);for(const a of s)r.nodes[a]=bFe(n,a,i);r.nodes[e]||(r.nodes[e]={"@id":e,"@type":"OntologyTreeNode",id:e,label:t,children:[],synonymLabels:[]});const o=n.getSubjects(i,e,null).map(a=>a.id).sort((a,l)=>r.nodes[a].label.localeCompare(r.nodes[l].label));return r.nodes[e].children=o,_q(r),r}function _q(n,e,t=new Set){const i=n.nodes[null!=e?e:n.root];if(i){i.children=i.children.filter(r=>!t.has(r)),i.children.forEach(r=>t.add(r));for(const r of i.children)_q(n,r,t),n.nodes[r]&&(n.nodes[r].parent=i["@id"])}}new Pn([1,0,0]),new Pn([0,1,0]),new Pn([0,0,1]),new Pn,new Pn,new $F(new Pn(1,0,0),0),new Pn,new Pn,new Pn,new Pn,new Pn,new Pn,new Pn,new Pn,new Pn,new Pn,new Pn,new Pn,new Pn,new Pn,new Pn,new Pn,new Pn,Math,new Xo,new Xo,new Xo,new Xo,new Xo,new Pn,new Pn,new Pn,new Pn,new Pn,new Xo,new Xo,new Xo,(0,fr.memoize)(function(n){const e=mq(n,X9.body.id,"body",md.asctb.part_of.id);return e.nodes[X9.body.id].children=["http://purl.obolibrary.org/obo/UBERON_0000955","http://purl.obolibrary.org/obo/UBERON_0000029","http://purl.obolibrary.org/obo/UBERON_0000970","http://purl.obolibrary.org/obo/UBERON_0003889","http://purl.obolibrary.org/obo/UBERON_0000948","http://purl.obolibrary.org/obo/UBERON_0002113","http://purl.obolibrary.org/obo/UBERON_0001465","http://purl.obolibrary.org/obo/UBERON_0002107","http://purl.obolibrary.org/obo/UBERON_0002048","http://purl.obolibrary.org/obo/UBERON_0001911","http://purl.obolibrary.org/obo/UBERON_0000992","http://purl.obolibrary.org/obo/UBERON_0001264","http://purl.obolibrary.org/obo/UBERON_0001270","http://purl.obolibrary.org/obo/UBERON_0001987","http://purl.obolibrary.org/obo/UBERON_0002367","http://purl.obolibrary.org/obo/UBERON_0002097","http://purl.obolibrary.org/obo/UBERON_0002108","http://purl.obolibrary.org/obo/UBERON_0002240","http://purl.obolibrary.org/obo/UBERON_0000059","http://purl.obolibrary.org/obo/UBERON_0002106","http://purl.obolibrary.org/obo/UBERON_0002370","http://purl.obolibrary.org/obo/UBERON_0000056","http://purl.obolibrary.org/obo/UBERON_0001255","http://purl.obolibrary.org/obo/UBERON_0000995","http://purl.obolibrary.org/obo/UBERON_0004537"].filter(t=>t in e.nodes),e},()=>"");const p1={[co_label.id]:"label",[co_description.id]:"description",[co_link.id]:"link"};Object.assign(Object.assign({},p1),{[co_providerName.id]:"providerName"}),Object.assign(Object.assign({},p1),{[co_technology.id]:"technology",[co_thumbnail.id]:"thumbnail"}),Object.assign(Object.assign({},p1),{[co_sampleType.id]:"sampleType",[co_sectionNumber.id]:"sectionNumber",[co_datasets.id]:"datasets"}),Object.assign(Object.assign({},p1),{[co_sampleType.id]:"sampleType",[co_sectionCount.id]:"sectionCount",[co_sectionSize.id]:"sectionSize",[co_sectionUnits.id]:"sectionUnits",[co_donor.id]:"donor",[co_spatialEntity.id]:"spatialEntityId",[co_sections.id]:"sections",[co_datasets.id]:"datasets"});const 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"};function mu(n){return new Promise((e,t)=>{n.oncomplete=n.onsuccess=()=>e(n.result),n.onabort=n.onerror=()=>t(n.error)})}let ZF;function Sc(){return ZF||(ZF=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),mu(i)});return(i,r)=>t.then(s=>r(s.transaction(e,i).objectStore(e)))}(0,"keyval")),ZF}function vq(n,e=Sc()){return e("readonly",t=>mu(t.get(n)))}const g1="Unknown Euler angle order",$m=.99999;class Ji extends bS{static get ZYX(){return 0}static get YXZ(){return 1}static get XZY(){return 2}static get ZXY(){return 3}static get YZX(){return 4}static get XYZ(){return 5}static get RollPitchYaw(){return 0}static get DefaultOrder(){return Ji.ZYX}static get RotationOrders(){return["ZYX","YXZ","XZY","ZXY","YZX","XYZ"]}static rotationOrder(e){return Ji.RotationOrders[e]}get ELEMENTS(){return 4}constructor(e=0,t=0,i=0,r=Ji.DefaultOrder){super(-0,-0,-0,-0),arguments.length>0&&Array.isArray(arguments[0])?this.fromVector3(...arguments):this.set(e,t,i,r)}fromQuaternion(e){const[t,i,r,s]=e,o=i*i,a=-2*(o+r*r)+1,l=2*(t*i+s*r);let c=-2*(t*r-s*i);c=c>1?1:c,c=c<-1?-1:c;const p=Math.atan2(2*(i*r+s*t),-2*(t*t+o)+1),g=Math.asin(c),m=Math.atan2(l,a);return new Ji(p,g,m,Ji.RollPitchYaw)}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=Number.isFinite(e[3])||this.order,this.check()}set(e=0,t=0,i=0,r){return this[0]=e,this[1]=t,this[2]=i,this[3]=Number.isFinite(r)?r:this[3],this.check()}validate(){return function(n){return n>=0&&n<6}(this[3])&&Number.isFinite(this[0])&&Number.isFinite(this[1])&&Number.isFinite(this[2])}toArray(e=[],t=0){return e[t]=this[0],e[t+1]=this[1],e[t+2]=this[2],e}toArray4(e=[],t=0){return e[t]=this[0],e[t+1]=this[1],e[t+2]=this[2],e[t+3]=this[3],e}toVector3(e=[-0,-0,-0]){return e[0]=this[0],e[1]=this[1],e[2]=this[2],e}get x(){return this[0]}set x(e){this[0]=sr(e)}get y(){return this[1]}set y(e){this[1]=sr(e)}get z(){return this[2]}set z(e){this[2]=sr(e)}get alpha(){return this[0]}set alpha(e){this[0]=sr(e)}get beta(){return this[1]}set beta(e){this[1]=sr(e)}get gamma(){return this[2]}set gamma(e){this[2]=sr(e)}get phi(){return this[0]}set phi(e){this[0]=sr(e)}get theta(){return this[1]}set theta(e){this[1]=sr(e)}get psi(){return this[2]}set psi(e){this[2]=sr(e)}get roll(){return this[0]}set roll(e){this[0]=sr(e)}get pitch(){return this[1]}set pitch(e){this[1]=sr(e)}get yaw(){return this[2]}set yaw(e){this[2]=sr(e)}get order(){return this[3]}set order(e){this[3]=function(n){if(n<0&&n>=6)throw new Error(g1);return n}(e)}fromVector3(e,t){return this.set(e[0],e[1],e[2],Number.isFinite(t)?t:this[3])}fromArray(e,t=0){return this[0]=e[0+t],this[1]=e[1+t],this[2]=e[2+t],void 0!==e[3]&&(this[3]=e[3]),this.check()}fromRollPitchYaw(e,t,i){return this.set(e,t,i,Ji.ZYX)}fromRotationMatrix(e,t=Ji.DefaultOrder){return this._fromRotationMatrix(e,t),this.check()}getRotationMatrix(e){return this._getRotationMatrix(e)}getQuaternion(){const e=new gR;switch(this[4]){case Ji.XYZ:return e.rotateX(this[0]).rotateY(this[1]).rotateZ(this[2]);case Ji.YXZ:return e.rotateY(this[0]).rotateX(this[1]).rotateZ(this[2]);case Ji.ZXY:return e.rotateZ(this[0]).rotateX(this[1]).rotateY(this[2]);case Ji.ZYX:return e.rotateZ(this[0]).rotateY(this[1]).rotateX(this[2]);case Ji.YZX:return e.rotateY(this[0]).rotateZ(this[1]).rotateX(this[2]);case Ji.XZY:return e.rotateX(this[0]).rotateZ(this[1]).rotateY(this[2]);default:throw new Error(g1)}}_fromRotationMatrix(e,t=Ji.DefaultOrder){const i=e.elements,r=i[0],s=i[4],o=i[8],a=i[1],l=i[5],c=i[9],u=i[2],h=i[6],p=i[10];switch(t=t||this[3]){case Ji.XYZ:this[1]=Math.asin(Va(o,-1,1)),Math.abs(o)<$m?(this[0]=Math.atan2(-c,p),this[2]=Math.atan2(-s,r)):(this[0]=Math.atan2(h,l),this[2]=0);break;case Ji.YXZ:this[0]=Math.asin(-Va(c,-1,1)),Math.abs(c)<$m?(this[1]=Math.atan2(o,p),this[2]=Math.atan2(a,l)):(this[1]=Math.atan2(-u,r),this[2]=0);break;case Ji.ZXY:this[0]=Math.asin(Va(h,-1,1)),Math.abs(h)<$m?(this[1]=Math.atan2(-u,p),this[2]=Math.atan2(-s,l)):(this[1]=0,this[2]=Math.atan2(a,r));break;case Ji.ZYX:this[1]=Math.asin(-Va(u,-1,1)),Math.abs(u)<$m?(this[0]=Math.atan2(h,p),this[2]=Math.atan2(a,r)):(this[0]=0,this[2]=Math.atan2(-s,l));break;case Ji.YZX:this[2]=Math.asin(Va(a,-1,1)),Math.abs(a)<$m?(this[0]=Math.atan2(-c,l),this[1]=Math.atan2(-u,r)):(this[0]=0,this[1]=Math.atan2(o,p));break;case Ji.XZY:this[2]=Math.asin(-Va(s,-1,1)),Math.abs(s)<$m?(this[0]=Math.atan2(h,l),this[1]=Math.atan2(o,r)):(this[0]=Math.atan2(-c,p),this[1]=0);break;default:throw new Error(g1)}return this[3]=t,this}_getRotationMatrix(e){const t=e||[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],i=this.x,r=this.y,s=this.z,o=Math.cos(i),a=Math.cos(r),l=Math.cos(s),c=Math.sin(i),u=Math.sin(r),h=Math.sin(s);switch(this[3]){case Ji.XYZ:{const p=o*l,g=o*h,m=c*l,w=c*h;t[0]=a*l,t[4]=-a*h,t[8]=u,t[1]=g+m*u,t[5]=p-w*u,t[9]=-c*a,t[2]=w-p*u,t[6]=m+g*u,t[10]=o*a;break}case Ji.YXZ:{const p=a*l,g=a*h,m=u*l,w=u*h;t[0]=p+w*c,t[4]=m*c-g,t[8]=o*u,t[1]=o*h,t[5]=o*l,t[9]=-c,t[2]=g*c-m,t[6]=w+p*c,t[10]=o*a;break}case Ji.ZXY:{const p=a*l,g=a*h,m=u*l,w=u*h;t[0]=p-w*c,t[4]=-o*h,t[8]=m+g*c,t[1]=g+m*c,t[5]=o*l,t[9]=w-p*c,t[2]=-o*u,t[6]=c,t[10]=o*a;break}case Ji.ZYX:{const p=o*l,g=o*h,m=c*l,w=c*h;t[0]=a*l,t[4]=m*u-g,t[8]=p*u+w,t[1]=a*h,t[5]=w*u+p,t[9]=g*u-m,t[2]=-u,t[6]=c*a,t[10]=o*a;break}case Ji.YZX:{const p=o*a,g=o*u,m=c*a,w=c*u;t[0]=a*l,t[4]=w-p*h,t[8]=m*h+g,t[1]=h,t[5]=o*l,t[9]=-c*l,t[2]=-u*l,t[6]=g*h+m,t[10]=p-w*h;break}case Ji.XZY:{const p=o*a,g=o*u,m=c*a,w=c*u;t[0]=a*l,t[4]=-h,t[8]=u*l,t[1]=p*h+w,t[5]=o*l,t[9]=g*h-m,t[2]=m*h-g,t[6]=c*l,t[10]=w*h+p;break}default:throw new Error(g1)}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}toQuaternion(){const e=Math.cos(.5*this.yaw),t=Math.sin(.5*this.yaw),i=Math.cos(.5*this.roll),r=Math.sin(.5*this.roll),s=Math.cos(.5*this.pitch),o=Math.sin(.5*this.pitch);return new gR(e*r*s-t*i*o,e*i*o+t*r*s,t*i*s-e*r*o,e*i*s+t*r*o)}}var m1,FFe=new Uint8Array(16);function kFe(){if(!m1&&!(m1="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return m1(FFe)}const LFe=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,jFe=function(n){return"string"==typeof n&&LFe.test(n)};for(var ho=[],e2=0;e2<256;++e2)ho.push((e2+256).toString(16).substr(1));const HFe=function(n,e,t){var i=(n=n||{}).random||(n.rng||kFe)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,e){t=t||0;for(var r=0;r<16;++r)e[t+r]=i[r];return e}return function(n){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,t=(ho[n[e+0]]+ho[n[e+1]]+ho[n[e+2]]+ho[n[e+3]]+"-"+ho[n[e+4]]+ho[n[e+5]]+"-"+ho[n[e+6]]+ho[n[e+7]]+"-"+ho[n[e+8]]+ho[n[e+9]]+"-"+ho[n[e+10]]+ho[n[e+11]]+ho[n[e+12]]+ho[n[e+13]]+ho[n[e+14]]+ho[n[e+15]]).toLowerCase();if(!jFe(t))throw TypeError("Stringified UUID is invalid");return t}(i)};function*t2(n,e,t){for(const[i,r]of Object.entries(t))for(const s of(0,xn.readQuads)(n,e,i,null,null)){const o="Literal"===s.object.termType?(0,Kb.fromRdf)(s.object):s.object.id;yield[r,o]}}function dp(n,e,t,i){const r={"@id":e,"@type":t};for(const[s,o]of Object.entries(i))for(const a of(0,xn.readQuads)(n,r["@id"],s,null,null)){const l="Literal"===a.object.termType?(0,Kb.fromRdf)(a.object):a.object.id;r[o]=l}return r}const ar=xn.Util.prefixes({base:"http://purl.org/ccf/latest/ccf.owl#",ccf:"http://purl.org/ccf/",fma:"http://purl.org/sig/ont/fma/fma",obo:"http://purl.obolibrary.org/obo/",uberon:"http://purl.obolibrary.org/obo/UBERON_",cl:"http://purl.obolibrary.org/obo/CL_",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/",dcterms:"http://purl.org/dc/terms/"},xn.DataFactory),wq={x:ar("rdf"),type:ar("rdf")("type")},dn=(ar("rdfs"),ar("rdfs")("label"),ar("rdfs")("comment"),ar("rdfs")("isDefinedBy"),ar("rdfs")("seeAlso"),ar("ccf")),yi={id:ar("ccf")("has_registration_location"),label:ar("rdfs")("label"),description:ar("rdfs")("comment"),link:dn("url"),sex:dn("sex"),age:dn("age"),bmi:dn("bmi"),Male:xn.DataFactory.literal("Male"),Female:xn.DataFactory.literal("Female"),consortiumName:dn("consortium_name"),providerName:dn("tissue_provider_name"),providerUUID:dn("tissue_provider_uuid"),donor:dn("comes_from"),sections:dn("subdivided_into_sections"),datasets:dn("generates_dataset"),sampleType:dn("sample_type"),TissueBlock:xn.DataFactory.literal("Tissue Block"),TissueSection:xn.DataFactory.literal("Tissue Section"),NonStandard:xn.DataFactory.literal("Non-standard"),sectionCount:dn("section_count"),sectionSize:dn("section_size"),sectionUnits:dn("section_size_unit"),sectionNumber:dn("section_number"),spatialEntity:dn("has_registration_location"),ontologyTerms:dn("has_ontology_term"),cellTypeTerms:dn("has_cell_type_term"),technology:dn("technology"),thumbnail:dn("thumbnail")},ki={x:dn,base:ar("base"),ontologyNode:{label:dn("ccf_pref_label"),parent:dn("ccf_part_of"),children:dn("ccf_part_of"),rui_rank:dn("rui_rank"),synonymLabels:xn.DataFactory.namedNode("http://www.geneontology.org/formats/oboInOwl#hasExactSynonym")},asctb:{part_of:dn("ccf_part_of"),ct_is_a:dn("ccf_ct_isa"),located_in:dn("ccf_located_in"),characterizes:dn("ccf_characterizes")},spatial:{Female:ar("base")("VHFemale"),Male:ar("base")("VHMale"),BothSexes:ar("base")("VHBothSexes"),FemaleOrgans:ar("base")("VHFemaleOrgans"),MaleOrgans:ar("base")("VHMaleOrgans")},SpatialObjectReference:dn("spatial_object_reference"),SpatialEntity:dn("spatial_entity"),SpatialPlacement:dn("spatial_placement"),spatialObjectReference:{file:dn("file_url"),file_format:dn("file_format"),file_subpath:dn("file_subpath")},extractionSet:{label:ar("rdfs")("label"),rui_rank:dn("rui_rank")},spatialEntity:{label:ar("rdfs")("label"),description:ar("rdfs")("comment"),creator:ar("dcterms")("creator"),creator_first_name:dn("creator_first_name"),creator_last_name:dn("creator_last_name"),creator_orcid:dn("creator_orcid"),creation_date:ar("dcterms")("created"),updated_date:dn("updated_date"),ccf_annotations:dn("collides_with"),representation_of:dn("representation_of"),reference_organ:dn("has_reference_organ"),extraction_set_for:dn("extraction_set_for"),extraction_set:dn("has_extraction_set"),sex:dn("organ_owner_sex"),side:dn("organ_side"),rui_rank:dn("rui_rank"),slice_thickness:dn("slice_thickness"),slice_count:dn("slice_count"),x_dimension:dn("x_dimension"),y_dimension:dn("y_dimension"),z_dimension:dn("z_dimension"),dimension_units:dn("dimension_unit"),object:dn("has_object_reference")},spatialPlacement:{source:dn("placement_for"),target:dn("placement_relative_to"),placement_date:ar("dcterms")("created"),x_scaling:dn("x_scaling"),y_scaling:dn("y_scaling"),z_scaling:dn("z_scaling"),scaling_units:dn("scaling_unit"),x_rotation:dn("x_rotation"),y_rotation:dn("y_rotation"),z_rotation:dn("z_rotation"),w_rotation:dn("theta_rotation"),rotation_order:dn("rotation_order"),rotation_units:dn("rotation_unit"),x_translation:dn("x_translation"),y_translation:dn("y_translation"),z_translation:dn("z_translation"),translation_units:dn("translation_unit")}},di={x:ar("uberon"),body:ar("uberon")("0013702")},$Fe={x:ar("cl"),cell:ar("cl")("0000000")},nv={x:ar("fma")},bd=(ar("lmha"),{body:di.body,cell:$Fe.cell,respiratory_system:di.x("0001004"),colon:di.x("0001155"),left_lung:di.x("0002168"),right_lung:di.x("0002167"),left_bronchus:di.x("0002178"),right_bronchus:di.x("0002177"),kidney:di.x("0002113"),ureter:di.x("0000056"),eye:di.x("0000970"),fallopian_tube:di.x("0003889"),knee:di.x("0001465"),ovary:di.x("0000992"),trachea:di.x("0003126"),aorta:di.x("0000947"),blood:di.x("0000178"),bone_marrow:di.x("0002371"),male_reproductive_system:di.x("0000079"),lymph_node:di.x("0000029"),blood_vasculature:di.x("0004537"),brain:di.x("0000955"),eye_left:di.x("0004548"),eye_right:nv.x("54449"),fallopian_tube_left:di.x("0001303"),fallopian_tube_right:di.x("0001302"),heart:di.x("0000948"),kidney_left:di.x("0004538"),kidney_right:di.x("0004539"),knee_left:nv.x("24978"),knee_right:nv.x("24977"),large_intestine:di.x("0000059"),liver:di.x("0002107"),lungs:di.x("0002048"),mesenteric_lymph_node:di.x("0002509"),ovary_left:nv.x("7214"),ovary_right:nv.x("7213"),pancreas:di.x("0001264"),pelvis:di.x("0001270"),prostate_gland:di.x("0002367"),skin:di.x("0002097"),small_intestine:di.x("0002108"),spleen:di.x("0002106"),thymus:di.x("0002370"),ureter_left:di.x("0001223"),ureter_right:di.x("0001222"),urinary_bladder:di.x("0001255"),uterus:di.x("0000995")});function n2(n){const e={};return Object.entries(n).forEach(([t,i])=>{e[i.id]=t}),e}const _1={spatialObjectReference:n2(ki.spatialObjectReference),spatialEntity:n2(ki.spatialEntity),spatialPlacement:n2(ki.spatialPlacement)};function Eq(n,e){const t=dp(n,e,"ExtractionSet",_1.spatialEntity);return t.extractionSites=(0,fr.sortBy)(n.getSubjects(ki.spatialEntity.extraction_set,e,null).map(i=>hp(n,i.id)),["rui_rank"]),t}function hp(n,e){const t=dp(n,e,"SpatialEntity",_1.spatialEntity);return t.object&&(t.object=function(n,e){return dp(n,e,"SpatialObjectReference",_1.spatialObjectReference)}(n,t.object)),t.ccf_annotations&&(t.ccf_annotations=n.getObjects(e,ki.spatialEntity.ccf_annotations,null).map(i=>i.id)),n.forSubjects(i=>t.entityId=i.id,yi.spatialEntity,e,null),t}function XFe(n,e){const t=dp(n,e,"SpatialPlacement",_1.spatialPlacement);return t.source&&(t.source=hp(n,t.source)),t.target&&(t.target=hp(n,t.target)),t}function Sq(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(EV),o=[t.x_scaling,t.y_scaling,t.z_scaling];return n.translate(r).rotateXYZ(s).scale(o)}class xq{constructor(e){this.db=e,this.createGraph()}createGraph(){this.graph=new HNe.DirectedGraph;const e=this.db.store;e.forSubjects(i=>{this.addNode(i.id,"SpatialObjectReference")},wq.type,ki.SpatialObjectReference,null),e.forSubjects(i=>{this.addNode(i.id,"SpatialEntity")},wq.type,ki.SpatialEntity,null);const t={};for(const i of(0,xn.readQuads)(e,null,ki.spatialPlacement.source,null,null))t[i.subject.id]=i.object.id;for(const i of(0,xn.readQuads)(e,null,ki.spatialPlacement.target,null,null)){const r=t[i.subject.id];r&&this.addEdge(i.subject.id,r,i.object.id,"SpatialPlacement")}}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 qn(qn.IDENTITY);if(!this.graph.hasNode(e)||!this.graph.hasNode(t))return;const i=this.db.store,r=new qn(qn.IDENTITY),s=$Ne()(this.graph,e,t);if(s&&s.length>0){s.reverse();let o="";for(const a of s)o&&Sq(r,XFe(i,this.graph.getEdgeAttribute(a,o,"id"))),o=a;return r}}getSpatialPlacement(e,t){const i=this.graph.hasNode(e["@id"])?e["@id"]:void 0,r=(0,fr.get)(e,"placement[0]",(0,fr.get)(e,"placement",void 0));let s;if(r&&this.graph.hasNode(r.target)?(s=this.getTransformationMatrix(r.target,t),s&&(s=Sq(s,r))):i&&(s=this.getTransformationMatrix(i,t)),s){const o=(new Ji).fromRotationMatrix(s,Ji.XYZ),a=s.getTranslation().map(u=>1e3*u),l=o.toVector3().map(vse),c=s.getScale().map(u=>u<1&&u>.999999?1:u);return{"@context":"https://hubmapconsortium.github.io/hubmap-ontology/ccf-context.jsonld","@id":`http://purl.org/ccf/1.5/${HFe()}_placement`,"@type":"SpatialPlacement",source:e["@id"],target:t,placement_date:(new Date).toISOString().split("T")[0],x_scaling:c[0],y_scaling:c[1],z_scaling:c[2],scaling_units:"ratio",x_rotation:l[0],y_rotation:l[1],z_rotation:l[2],rotation_order:"XYZ",rotation_units:"degree",x_translation:a[0],y_translation:a[1],z_translation:a[2],translation_units:"millimeter"}}}}class Cq{constructor(e){this.db=e}getSpatialEntity(e){return hp(this.db.store,e)}getExtractionSets(e){return function(n,e){return(0,fr.sortBy)(n.getSubjects(ki.spatialEntity.extraction_set_for,e,null).map(t=>Eq(n,t.id)),["rui_rank"])}(this.db.store,e)}getExtractionSet(e){return Eq(this.db.store,e)}getAnatomicalStructures(e){return function(n,e){return(0,fr.sortBy)(n.getSubjects(ki.spatialEntity.reference_organ,e,null).map(t=>hp(n,t.id)).filter(t=>t["@id"]!==e),["rui_rank"])}(this.db.store,e)}getReferenceOrgans(){return function(n){const e=[];return n.forEach(t=>{t.subject.id===t.object.id&&e.push(hp(n,t.subject.id))},null,ki.spatialEntity.reference_organ,null,null),(0,fr.sortBy)(e,["rui_rank"])}(this.db.store)}getReferenceBody(e){let t;switch(null==e?void 0:e.sex){case"Male":t=ki.spatial.Male.id;break;case"Female":t=ki.spatial.Female.id;break;case"Both":default:t=ki.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),i=[];let r=[...this.getReferenceOrganSets(e).map(s=>{const o="http://purl.obolibrary.org/obo/UBERON_0002097"===s.representation_of,a=this.getSceneNode(s,t,{color:[255,255,255,255],opacity:o?.5:.2,unpickable:!0,_lighting:"pbr",zoomBasedOpacity:!o});return o&&a?void i.push(a):a})];return i.length>0&&(r=[...i,...r]),(null==e?void 0:e.debug)&&(r=r.concat([this.getSceneNode(this.getSpatialEntity(ki.base("VHRightKidney").id),t,{color:[0,0,255,127.5],geometry:"wireframe"}),this.getSceneNode(this.getSpatialEntity(ki.base("VHLeftKidney").id),t,{color:[255,0,0,127.5],geometry:"wireframe"}),this.getSceneNode(this.getSpatialEntity(ki.base("VHSpleenCC1").id),t,{color:[0,255,0,127.5],geometry:"wireframe"}),this.getSceneNode(this.getSpatialEntity(ki.base("VHSpleenCC2").id),t,{color:[0,255,0,127.5],geometry:"wireframe"}),this.getSceneNode(this.getSpatialEntity(ki.base("VHSpleenCC3").id),t,{color:[0,255,0,127.5],geometry:"wireframe"})])),r.filter(s=>void 0!==s)}getReferenceOrganScene(e,t){var i,r;const s=void 0!==(null==t?void 0:t.sex)&&"both"!==(null===(i=null==t?void 0:t.sex)||void 0===i?void 0:i.toLowerCase()),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"}),u=(null!==(r=this.db.getSpatialEntities(t))&&void 0!==r?r:[]).map(h=>this.getSceneNode(h,a,{color:[255,255,255,229.5]}));return[c].concat(u).filter(h=>void 0!==h)}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 u=this.db.graph.getTransformationMatrix(l&&e.object?e.object["@id"]:e["@id"],t["@id"]);if(u){if(l)u=new qn(qn.IDENTITY).rotateX(EV(90)).multiplyLeft(u);else{let h;switch(e.dimension_units){case"centimeter":h=.01;break;case"millimeter":h=.001;break;case"meter":default:h=1}const p=[e.x_dimension,e.y_dimension,e.z_dimension].map(g=>g*h/2);u.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:u,tooltip:e.label},i)}}getScene(e){return[...this.getReferenceSceneNodes(e),...this.getEntitySceneNodes(e)]}}const y1="https://entity.api.hubmapconsortium.org/entities/",Aq=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"]),ZFe={"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"},Wm={"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","5c106f29-ea2d-11e9-85e8-0efb3ba9a670":"RTI-General Electric","301615f9-c870-11eb-a8dc-35ce3d8786fe":"TMC-UConn"},Tq={"@base":"http://purl.org/ccf/latest/ccf-entity.owl#","@vocab":"http://purl.org/ccf/latest/ccf-entity.owl#",ccf:"http://purl.org/ccf/",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"},cellTypeTerms:{"@id":"has_cell_type_term","@type":"@id"},thumbnail:{"@id":"has_thumbnail"}};class t2e{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||[],u=(this.data.ancestors||[]).find(Be=>"Donor"===Be.entity_type);this.donor=this.getDonor(u,i);const h=this.getRuiLocation(e,this.donor);h?this.rui_location=h:this.bad=!0,Wm[e.group_uuid]||(Wm[e.group_uuid]=e.group_name);const p=new Date(e.last_modified_timestamp).toLocaleDateString(),g=Wm[e.group_uuid]||e.group_name,m=e.created_by_user_displayname;this["@id"]=y1+e.uuid,this.label=`Registered ${p}, ${m}, ${g}`,this.link=`${i}browse/sample/${e.uuid}`;const w={},C=[];this.sections=C;const H=[];this.datasets=H;for(const Be of c.filter(et=>"Sample"===et.entity_type)){const et=this.getSection(Be,e,i);w[Be.submission_id]=et,C.push(et),et.section_number=null!==(s=et.section_number)&&void 0!==s?s:C.length}for(const Be of c)if("Dataset"===Be.entity_type){const et=this.getDataset(Be,t,i,r),wt=(0,fr.get)(Be,["ingest_metadata","metadata","tissue_id"]);w[wt]?null===(o=w[wt].datasets)||void 0===o||o.push(et):H.push(et)}const U=null!=h?h:{},de=`${U.x_dimension} x ${U.y_dimension} x ${U.z_dimension} ${U.dimension_units}`;this.section_count=U.slice_count||C.length;const Ae=parseFloat((U.slice_thickness||(U.z_dimension||0)/Math.max(this.section_count,1)).toFixed(1));this.section_size=Ae;const Pe=U.dimension_units||"millimeter";this.section_units=Pe,this.description=`${de}, ${Ae} ${Pe}, ${e.specimen_type}, ${this.section_count} Sections`,C.forEach((Be,et)=>{Be.description=`${U.x_dimension} x ${U.y_dimension} x ${Ae} ${Pe}, ${Ae} ${Pe}, ${Be.description}`,Be.section_number=et+1})}getSection(e,t,i){const r=new Date(e.last_modified_timestamp).toLocaleDateString();return{"@id":y1+e.uuid,"@type":"Sample",label:`Registered ${r}, ${e.created_by_user_displayname}, ${Wm[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=Wm[e.group_uuid]||e.group_name,l=e.created_by_user_displayname,c=[...e.data_types,(0,fr.get)(e,["ingest_metadata","metadata","assay_type"],"")],u=c.join("|").toLowerCase();let h,p="assets/icons/ico-unknown.svg";return-1!==u.indexOf("10x")?(h="10x",p="assets/icons/ico-bulk-10x.svg"):-1!==u.indexOf("af")?(h="AF",p="assets/icons/ico-spatial-af.svg"):-1!==u.indexOf("codex")?(h="CODEX",p="assets/icons/ico-spatial-codex.svg"):-1!==u.indexOf("imc")?(h="IMC",p="assets/icons/ico-spatial-imc.svg"):-1!==u.indexOf("lc")&&-1===u.indexOf("af")?(h="LC",p="assets/icons/ico-bulk-lc.svg"):h=-1!==u.indexOf("maldi")?"MALDI":-1!==u.indexOf("pas")?"PAS":"OTHER",p=null!==(s=this.getDatasetThumbnail(e,t,r))&&void 0!==s?s:p,{"@id":y1+e.uuid,"@type":"Dataset",label:`Registered ${o}, ${l}, ${a}`,description:`Data/Assay Types: ${c.join(", ")}`,link:`${i}browse/dataset/${e.uuid}`,technology:h,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,fr.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=>Aq.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(Aq.has(s))return`assets/thumbnails/TMC-Vanderbilt/DR1/${s}`}}else if("07a29e4c-ed43-11e8-b56a-0e8017bdda58"===e.group_uuid){const r=ZFe[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,fr.toNumber)(s[1]));for(const p of(0,fr.get)(e,"metadata.organ_donor_data",(0,fr.get)(e,"metadata.living_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,fr.toNumber)(p.data_value):"Body mass index"===p.preferred_term&&(a=(0,fr.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(),u=Wm[e.group_uuid]||e.group_name;return{"@id":y1+e.uuid,"@type":"Donor",label:l,description:`Entered ${c}, ${e.created_by_user_displayname}, ${u}`,link:`${t}browse/donor/${e.uuid}`,age:o,sex:r,bmi:a,consortium_name:"HuBMAP",provider_name:u,provider_uuid:e.group_uuid,samples:[]}}getRuiLocation(e,t){var i;let r,s=e.rui_location;if(s&&("string"==typeof s&&(s=JSON.parse(s)),s.alignment_id?console.log("Detected a deprecated rui_location",e.uuid):s["@id"]&&(r=s)),r){const o=null!==(i=(0,fr.get)(r,["placement","target"]))&&void 0!==i?i:"";o.startsWith("http://purl.org/ccf/latest/ccf.owl#VHSpleenCC")?(0,fr.set)(r,["placement","target"],o.replace("#VHSpleenCC","Male"===t.sex?"#VHMSpleenCC":"#VHFSpleenCC")):("http://purl.org/ccf/latest/ccf.owl#VHLeftKidney"===o||"http://purl.org/ccf/latest/ccf.owl#VHRightKidney"===o)&&(0,fr.set)(r,["placement","target"],"Male"===t.sex?o.replace("#VH","#VHM")+"_Patch":o.replace("#VH","#VHF")+"_Patch")}return r}getTissueBlock(){return(0,fr.omit)(Object.assign({},this),["data","bad","donor"])}toJsonLd(){return Object.assign(Object.assign({},this.donor),{samples:[this.getTissueBlock()]})}}const i2e=["uuid","entity_type","group_uuid","group_name","last_modified_timestamp","created_by_user_displayname","ancestors.entity_type","ancestors.description","ancestors.metadata.organ_donor_data.preferred_term","ancestors.metadata.organ_donor_data.data_value","ancestors.metadata.living_donor_data.preferred_term","ancestors.metadata.living_donor_data.data_value","ancestors.last_modified_timestamp","ancestors.group_uuid","ancestors.group_name","ancestors.created_by_user_displayname","ancestors.uuid","descendants.entity_type","descendants.ingest_metadata.metadata.tissue_id","descendants.last_modified_timestamp","descendants.group_uuid","descendants.group_name","descendants.created_by_user_displayname","descendants.uuid","descendants.data_types","descendants.ingest_metadata.metadata.assay_type","descendants.thumbnail_file","descendants.metadata.files.rel_path","rui_location","specimen_type"],r2e={exists:{field:"rui_location"}};function Mq(n,e,t){return JSON.stringify({version:!0,from:n,size:e,stored_fields:["*"],script_fields:{},docvalue_fields:[],query:null!=t?t:r2e,_source:{includes:i2e}})}function r2(n,e){return Fi(this,void 0,void 0,function*(){try{const t=yield fetch(n,e);return t.ok?yield t.json():void 0}catch(t){return}})}function Dq(n,e,t,i,r="",s=""){return Fi(this,void 0,void 0,function*(){let o;if("static"===e?o=yield r2(n):"search-api"===e&&(o=yield function(n,e,t){return Fi(this,void 0,void 0,function*(){const i=250,r=function(n){const e=new Headers;return e.append("Content-type","application/json"),n&&e.append("Authorization",`Bearer ${n}`),e}(e),s=Mq(0,i,t),o=yield r2(n,{method:"POST",headers:r,body:s});if(!o)return;const a=o.hits.total.value;if(a<=i)return o;const l=[];for(let h=i;h!h))return;const u=c.map(h=>h.hits.hits);return Object.assign(Object.assign({},o),{hits:Object.assign(Object.assign({},o.hits),{hits:o.hits.hits.concat(...u)})})})}(n,i,t)),o)return function(n,e="",t="",i,r=!1){const o={},a=(0,fr.get)(n,"hits.hits",[]).map(c=>(0,fr.get)(c,"_source",{})).sort((c,u)=>c.uuid.localeCompare(u.uuid)).map(c=>new t2e(c,e,t,i).toJsonLd());for(const c of a){const u=c["@id"];o[u]?o[u].samples.push(c.samples[0]):o[u]=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":Tq},c)))),{"@context":Tq,"@graph":l}}(o,r,s,i);console.warn(`Unable to load ${n} as HuBMAP Data`)})}function iv(n,e,t){const i=new Set;for(const r of e)for(const s of(0,xn.readQuads)(n,r,t,null,null))i.add(s.object.id);return i}const u2e={[ki.spatialEntity.x_dimension.id]:"x",[ki.spatialEntity.y_dimension.id]:"y",[ki.spatialEntity.z_dimension.id]:"z"};function h2e(n,e,t,i){const r=e.getTransformationMatrix(t,i);let s;if(r){const o=r.getTranslation(),a=function(n,e){const t=dp(n,e,"Dimensions",u2e);return[t.x,t.y,t.z]}(n,t).map(c=>c/1e3/2),l=(new Ji).fromRotationMatrix(r,Ji.XYZ).toQuaternion().normalize().calculateW();s=(new GF).fromCenterHalfSizeQuaternion(o,a,l)}return s}function f2e(n,e,t,i){const{x:r,y:s,z:o,radius:a,target:l}=i,c=new Set,u=a/1e3*(a/1e3);for(const h of t){const p=h2e(n,e,h,l);p&&p.distanceSquaredTo([r,s,o].map(m=>m/1e3))<=u&&c.add(h)}return c}function b1(n,e,t){var i,r;const s=new Map,o=new Set;for(const c of e)for(const u of(0,xn.readQuads)(n,c,yi.donor,null,null))o.add(u.object.id),s.has(u.object.id)?null===(i=s.get(u.object.id))||void 0===i||i.push(c):s.set(u.object.id,[c]);const a=t(o),l=new Set;for(const c of a)for(const u of null!==(r=s.get(c))&&void 0!==r?r:[])l.add(u);return l}function s2(n,e,t){var i,r;const s=new Map,o=new Set;for(const c of e)for(const u of(0,xn.readQuads)(n,c,yi.spatialEntity,null,null))o.add(u.object.id),s.has(u.object.id)?null===(i=s.get(u.object.id))||void 0===i||i.push(c):s.set(u.object.id,[c]);const a=t(o),l=new Set;for(const c of a)for(const u of null!==(r=s.get(c))&&void 0!==r?r:[])l.add(u);return l}function rv(n,e){return function(t){n.has(t.id)&&e.add(t.id)}}function Iq(n,e,t){const i=new Set;for(const r of t){const s=xn.DataFactory.namedNode(r);n.forSubjects(rv(e,i),ki.spatialEntity.ccf_annotations,s,null)}return i}function Oq(n,e){const t=function(n,e){const t=new Map;for(const i of n)for(const r of(0,xn.readQuads)(e,i,yi.spatialEntity,null,null))t.has(r.object.id)?t.get(r.object.id).add(i):t.set(r.object.id,new Set([i]));return t}(n,e),i=new Map;for(const r of t.keys()){const s=t.get(r);for(const o of(0,xn.readQuads)(e,r,ki.spatialEntity.ccf_annotations,null,null))if(i.has(o.object.id)){const a=i.get(o.object.id);s.forEach(l=>a.add(l))}else i.set(o.object.id,new Set(s))}return i}function M2e(n,e,t){const i={"@id":e,"@type":"OntologyTreeNode",id:e,parent:"",children:[],synonymLabels:[],label:""},r={[ki.ontologyNode.label.id]:"label",[t]:"parent",[ki.ontologyNode.synonymLabels.id]:"synonymLabels"};for(const[s,o]of t2(n,e,r))"synonymLabels"===s?i.synonymLabels.push(o):i[s]=o;return i.children=n.getSubjects(t,e,null).map(s=>s.id),i}function Rq(n,e,t,i){const r={root:e,nodes:{}},s=new Set;for(const a of(0,xn.readQuads)(n,null,i,null,null))s.add(a.subject.id),s.add(a.object.id);for(const a of s)r.nodes[a]=M2e(n,a,i);r.nodes[e]||(r.nodes[e]={"@id":e,"@type":"OntologyTreeNode",id:e,label:t,children:[],synonymLabels:[]});const o=n.getSubjects(i,e,null).map(a=>a.id).sort((a,l)=>r.nodes[a].label.localeCompare(r.nodes[l].label));return r.nodes[e].children=o,Nq(r),r}function Nq(n,e,t=new Set){const i=n.nodes[null!=e?e:n.root];if(i){i.children=i.children.filter(r=>!t.has(r)),i.children.forEach(r=>t.add(r));for(const r of i.children)Nq(n,r,t),n.nodes[r]&&(n.nodes[r].parent=i["@id"])}}const Pq=(0,fr.memoize)(function(n){const e=Rq(n,bd.body.id,"body",ki.asctb.part_of.id);return e.nodes[bd.body.id].children=["http://purl.obolibrary.org/obo/UBERON_0000955","http://purl.obolibrary.org/obo/UBERON_0000029","http://purl.obolibrary.org/obo/UBERON_0000970","http://purl.obolibrary.org/obo/UBERON_0003889","http://purl.obolibrary.org/obo/UBERON_0000948","http://purl.obolibrary.org/obo/UBERON_0002113","http://purl.obolibrary.org/obo/UBERON_0001465","http://purl.obolibrary.org/obo/UBERON_0002107","http://purl.obolibrary.org/obo/UBERON_0002048","http://purl.obolibrary.org/obo/UBERON_0001911","http://purl.obolibrary.org/obo/UBERON_0000992","http://purl.obolibrary.org/obo/UBERON_0001264","http://purl.obolibrary.org/obo/UBERON_0001270","http://purl.obolibrary.org/obo/UBERON_0001987","http://purl.obolibrary.org/obo/UBERON_0002367","http://purl.obolibrary.org/obo/UBERON_0002097","http://purl.obolibrary.org/obo/UBERON_0002108","http://purl.obolibrary.org/obo/UBERON_0002240","http://purl.obolibrary.org/obo/UBERON_0000059","http://purl.obolibrary.org/obo/UBERON_0002106","http://purl.obolibrary.org/obo/UBERON_0002370","http://purl.obolibrary.org/obo/UBERON_0000056","http://purl.obolibrary.org/obo/UBERON_0001255","http://purl.obolibrary.org/obo/UBERON_0000995","http://purl.obolibrary.org/obo/UBERON_0004537"].filter(t=>t in e.nodes),e},()=>""),v1={[yi.label.id]:"label",[yi.description.id]:"description",[yi.link.id]:"link"},O2e=Object.assign(Object.assign({},v1),{[yi.providerName.id]:"providerName"}),R2e=Object.assign(Object.assign({},v1),{[yi.technology.id]:"technology",[yi.thumbnail.id]:"thumbnail"}),N2e=Object.assign(Object.assign({},v1),{[yi.sampleType.id]:"sampleType",[yi.sectionNumber.id]:"sectionNumber",[yi.datasets.id]:"datasets"}),P2e=Object.assign(Object.assign({},v1),{[yi.sampleType.id]:"sampleType",[yi.sectionCount.id]:"sectionCount",[yi.sectionSize.id]:"sectionSize",[yi.sectionUnits.id]:"sectionUnits",[yi.donor.id]:"donor",[yi.spatialEntity.id]:"spatialEntityId",[yi.sections.id]:"sections",[yi.datasets.id]:"datasets"});function F2e(n,e){return dp(n,e,"Donor",O2e)}function Fq(n,e){return dp(n,e,"Dataset",R2e)}function k2e(n,e){const t={"@id":e,"@type":"Sample",datasets:[]};for(const[i,r]of t2(n,e,N2e))if("datasets"===i){const s=Fq(n,r);t[i].push(s)}else t[i]=r;return t}class B2e{constructor(e){this.database=e,this.connect()}toJson(){return{status:this.status,message:this.message,checkback:"Ready"===this.status||"Error"===this.status?36e5:2e3,loadTime:this.loadTime}}connect(){this.status="Loading",this.message="Loading database";const e=Date.now();return this.database.connect().then(t=>Fi(this,void 0,void 0,function*(){t?(this.message="Building scene",yield this.database.getScene(),this.message="Building tissue block results",yield this.database.getTissueBlockResults(),this.message="Aggregating results",yield this.database.getAggregateResults(),this.status="Ready",this.message="Database successfully loaded"):(this.status="Error",this.message="Unknown error while loading database")})).catch(t=>{var i;this.status="Error",this.message=null!==(i=null==t?void 0:t.message)&&void 0!==i?i:"Unknown error while loading database"}).finally(()=>{this.loadTime=Date.now()-e})}}const j2e={"@context":{"@base":"http://purl.org/ccf/","@vocab":"http://purl.org/ccf/",ccf:"http://purl.org/ccf/",rdfs:"http://www.w3.org/2000/01/rdf-schema#",dcterms:"http://purl.org/dc/terms/",label:"rdfs:label",description:"rdfs:comment",link:"ccf:url",sex:"ccf:sex",age:"ccf:age",bmi:"ccf:bmi",consortium_name:"ccf:consortium_name",provider_name:"ccf:tissue_provider_name",provider_uuid:"ccf:tissue_provider_uuid",donor:{"@id":"ccf:comes_from","@type":"@id"},samples:{"@reverse":"donor"},sections:{"@id":"ccf:subdivided_into_sections","@type":"@id"},datasets:{"@id":"ccf:generates_dataset","@type":"@id"},sample_type:"ccf:sample_type",section_count:"ccf:section_count",section_size:"ccf:section_size",section_units:"ccf:section_size_unit",section_number:"ccf:section_number",rui_location:{"@id":"ccf:has_registration_location","@type":"@id"},ccf_annotations:{"@id":"ccf:collides_with","@type":"@id","@container":"@set"},representation_of:{"@id":"ccf:representation_of","@type":"@id"},reference_organ:{"@id":"ccf:has_reference_organ","@type":"@id"},extraction_set_for:{"@id":"ccf:extraction_set_for","@type":"@id"},extraction_set:{"@id":"ccf:has_extraction_set","@type":"@id"},organ_owner_sex:"ccf:organ_owner_sex",side:"ccf:organ_side",rui_rank:"ccf:rui_rank",slice_thickness:"ccf:slice_thickness",slice_count:"ccf:slice_count",object:{"@id":"ccf:has_object_reference","@type":"@id"},creation_date:"dcterms:created",updated_date:"ccf:updated_date",creator:"dcterms:creator",creator_first_name:"ccf:creator_first_name",creator_last_name:"ccf:creator_last_name",placement:{"@reverse":"ccf:placement_for"},placement_date:"dcterms:created",rotation_order:"ccf:rotation_order",dimension_units:"ccf:dimension_unit",rotation_units:"ccf:rotation_unit",scaling_units:"ccf:scaling_unit",translation_units:"ccf:translation_unit",source:{"@id":"ccf:placement_for","@type":"@id"},target:{"@id":"ccf:placement_relative_to","@type":"@id"},x_rotation:"ccf:x_rotation",y_rotation:"ccf:y_rotation",z_rotation:"ccf:z_rotation",x_scaling:"ccf:x_scaling",y_scaling:"ccf:y_scaling",z_scaling:"ccf:z_scaling",x_translation:"ccf:x_translation",y_translation:"ccf:y_translation",z_translation:"ccf:z_translation",x_dimension:"ccf:x_dimension",y_dimension:"ccf:y_dimension",z_dimension:"ccf:z_dimension",ontology_terms:{"@id":"ccf:has_ontology_term","@type":"@id"},technology:"ccf:technology",thumbnail:"ccf:thumbnail",file:"ccf:file_url",file_format:"ccf:file_format",file_subpath:"ccf:file_subpath"}};function o2(n){return JSON.parse(n,(e,t)=>"ccf_annotations"===e&&Array.isArray(t)?t.map(i=>(null==i?void 0:i.startsWith("http://purl.obolibrary.org/obo/FMA_"))?i.replace("http://purl.obolibrary.org/obo/FMA_","http://purl.org/sig/ont/fma/fma"):i):"@context"!==e||!t||"https://hubmapconsortium.github.io/hubmap-ontology/ccf-entity-context.jsonld"!==t&&"https://hubmapconsortium.github.io/hubmap-ontology/ccf-context.jsonld"!==t&&"https://hubmapconsortium.github.io/ccf-ontology/ccf-context.jsonld"!==t&&"http://purl.org/ccf/latest/ccf-entity.owl#"!==t["@base"]?t:j2e)}const U2e={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 z2e{constructor(e=U2e){this.options=e,this.store=new xn.Store(void 0,{factory:xn.DataFactory}),this.graph=new xq(this),this.scene=new Cq(this)}connect(e,t=!1){return Fi(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 Fi(this,void 0,void 0,function*(){const e=(new Date).getTime(),t="ccf-database.last_modified",i="ccf-database",r=yield vq(t).catch(()=>{});let s;r&&e-new Date(+r).getTime()>36e5?yield function(n,e=Sc()){return e("readwrite",t=>(n.forEach(i=>t.delete(i)),mu(t.transaction)))}([i,t]).catch(()=>{}):s=yield vq(i).catch(()=>{}),s?yield this.deserialize(s):(yield this.doConnect(),function(n,e=Sc()){return e("readwrite",t=>(n.forEach(i=>t.put(i[1],i[0])),mu(t.transaction)))}([[i,this.serialize()],[t,""+e]]).catch(()=>{}))})}doConnect(){var e,t;return Fi(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.startsWith("{"))this.store=(0,xn.deserializeN3Store)(s,xn.DataFactory);else 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,xn.deserializeN3Store)(o,xn.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(Dq(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 Fi(this,void 0,void 0,function*(){const i=null!=t?t:this.store;return yield Promise.all(e.map(r=>Fi(this,void 0,void 0,function*(){"string"==typeof r?(r.startsWith("http")||r.startsWith("assets/"))&&r.includes("jsonld")?(r=o2(r=yield fetch(r).then(s=>s.text())),yield(0,xn.addJsonLdToStore)(r,i)):r.endsWith("n3")?yield(0,xn.addN3ToStore)(r,i):r.endsWith("rdf")||r.endsWith("owl")||r.endsWith("xml")?yield(0,xn.addRdfXmlToStore)(r,i):(r=o2(r),yield(0,xn.addJsonLdToStore)(r,i)):(r=o2(JSON.stringify(r)),yield(0,xn.addJsonLdToStore)(r,i))}))),this})}synchronize(){return Fi(this,void 0,void 0,function*(){return yield new Promise(e=>{setTimeout(e,500)}),this.graph.createGraph(),function(n){var e,t,i;const r=Pq(n),s=new Map;for(const{subject:o,object:a}of(0,xn.readQuads)(n,null,ki.spatialEntity.representation_of,null,null)){const l=new Set([a.id]);let c=null===(e=r.nodes[a.id])||void 0===e?void 0:e.parent;for(;c&&!l.has(c);)l.add(c),c=null===(t=r.nodes[c])||void 0===t?void 0:t.parent;s.set(o.id,[...l].map(u=>xn.DataFactory.namedNode(u)))}for(const{object:o}of(0,xn.readQuads)(n,null,yi.spatialEntity,null,null))for(const{subject:a}of(0,xn.readQuads)(n,null,ki.spatialPlacement.source,o,null))for(const{object:l}of(0,xn.readQuads)(n,a,ki.spatialPlacement.target,null,null))for(const c of null!==(i=s.get(l.id))&&void 0!==i?i:[])n.addQuad(xn.DataFactory.namedNode(o.id),ki.spatialEntity.ccf_annotations,c)}(this.store),this})}serialize(){return(0,xn.serializeN3Store)(this.store)}deserialize(e){return Fi(this,void 0,void 0,function*(){this.store=(0,xn.deserializeN3Store)(e,xn.DataFactory),this.graph=new xq(this),this.scene=new Cq(this),yield new Promise(t=>{setTimeout(t,10)})})}getIds(e={}){return function(n,e,t){var i,r,s,o,a,l,c;let u=function(n){const e=new Set;return n.forSubjects(t=>e.add(t.id),yi.spatialEntity,null,null),e}(n);if(u.size>0&&(u=function(n,e,t=!0){const i=new Set;if(n.forSubjects(rv(e,i),yi.spatialEntity,null,null),!t){const r=new Set;return e.forEach(s=>i.has(s)?void 0:r.add(s)),r}return i}(n,u)),u.size>0&&("Male"===t.sex||"Female"===t.sex)){const h=t.sex;u=b1(n,u,p=>function(n,e,t){const i=new Set;return n.forSubjects(rv(e,i),yi.sex,yi[t],null),i}(n,p,h))}if(u.size>0&&(null===(i=t.tmc)||void 0===i?void 0:i.length)>0&&(u=b1(n,u,h=>function(n,e,t){const i=new Set;for(const r of t){const s=xn.DataFactory.literal(r);n.forSubjects(rv(e,i),yi.providerName,s,null)}return i}(n,h,t.tmc))),u.size>0&&(null===(r=t.technologies)||void 0===r?void 0:r.length)>0&&(u=function(n,e,t){var i,r;const s=new Map,o=new Set,a=new Set(e);for(const u of e)for(const h of(0,xn.readQuads)(n,u,yi.sections,null,null))a.add(h.object.id);for(const u of a)for(const h of(0,xn.readQuads)(n,u,yi.datasets,null,null))o.add(h.object.id),s.has(h.object.id)?null===(i=s.get(h.object.id))||void 0===i||i.push(u):s.set(h.object.id,[u]);const l=t(o),c=new Set;for(const u of l)for(const h of null!==(r=s.get(u))&&void 0!==r?r:[])c.add(h);return c}(n,u,h=>function(n,e,t){const i=new Set;for(const r of t){const s=xn.DataFactory.literal(r);n.forSubjects(rv(e,i),yi.technology,s,null)}return i}(n,h,t.technologies))),u.size>0&&(null===(s=t.spatialSearches)||void 0===s?void 0:s.length)>0&&(u=s2(n,u,h=>function(n,e,t,i){const r=new Set;for(const s of i)f2e(n,e,t,s).forEach(a=>r.add(a));return r}(n,e,h,t.spatialSearches))),u.size>0&&(null===(o=t.ontologyTerms)||void 0===o?void 0:o.length)>0){const h=t.ontologyTerms;-1===h.indexOf(bd.body.id)&&(u=s2(n,u,p=>Iq(n,p,h)))}if(u.size>0&&(null===(a=t.cellTypeTerms)||void 0===a?void 0:a.length)>0){const h=t.cellTypeTerms;-1===h.indexOf(bd.cell.id)&&(u=s2(n,u,p=>function(n,e,t){const i=new Set;for(const r of t)n.forObjects(s=>{i.add(s.id)},r,ki.asctb.located_in,null),r===bd.cell.id&&i.add(bd.body.id);return Iq(n,e,[...i])}(n,p,h)))}if(u.size>0&&2===(null===(l=t.ageRange)||void 0===l?void 0:l.length)&&(0,fr.isFinite)(t.ageRange[0])&&(0,fr.isFinite)(t.ageRange[1])){const h=Math.max(...t.ageRange),p=Math.min(...t.ageRange);1===p&&110===h||(u=b1(n,u,g=>function(n,e,t,i){const r=new Set;for(const s of e)for(const o of(0,xn.readQuads)(n,s,yi.age,null,null)){const a=(0,Kb.fromRdf)(o.object);a>=t&&a<=i&&r.add(s)}return r}(n,g,p,h)))}if(u.size>0&&2===(null===(c=t.bmiRange)||void 0===c?void 0:c.length)&&(0,fr.isFinite)(t.bmiRange[0])&&(0,fr.isFinite)(t.bmiRange[1])){const h=Math.max(...t.bmiRange),p=Math.min(...t.bmiRange);13===p&&83===h||(u=b1(n,u,g=>function(n,e,t,i){const r=new Set;for(const s of e)for(const o of(0,xn.readQuads)(n,s,yi.bmi,null,null)){const a=(0,Kb.fromRdf)(o.object);a>=t&&a<=i&&r.add(s)}return r}(n,g,p,h)))}return u}(this.store,this.graph,e)}get(e){return this.store.getQuads(xn.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=>function(n,e){const t=n.getObjects(xn.DataFactory.namedNode(e),yi.spatialEntity,null);if(t.length>0)return hp(n,t[0].id)}(this.store,t))}getDatabaseStatus(){return Fi(this,void 0,void 0,function*(){return this.status||(this.status=new B2e(this)),this.status.toJson()})}getDatasetTechnologyNames(){return Fi(this,void 0,void 0,function*(){return function(n){const e=new Set;for(const t of(0,xn.readQuads)(n,null,yi.technology,null,null))e.add(t.object.value);return Array.from(e).sort()}(this.store)})}getProviderNames(){return Fi(this,void 0,void 0,function*(){return function(n){const e=new Set;for(const t of(0,xn.readQuads)(n,null,yi.providerName,null,null))e.add(t.object.value);return Array.from(e).sort()}(this.store)})}getTissueBlockResults(e){return Fi(this,void 0,void 0,function*(){return e=Object.assign(Object.assign({},e),{hasSpatialEntity:!0}),[...this.getIds(e)].map(t=>function(n,e){const t={"@id":e,"@type":"Sample",sections:[],datasets:[]};for(const[i,r]of t2(n,e,P2e))if("sections"===i){const s=k2e(n,r);t[i].push(s)}else if("datasets"===i){const s=Fq(n,r);t[i].push(s)}else t[i]="donor"===i?F2e(n,r):r;return t}(this.store,t))})}getAggregateResults(e){return Fi(this,void 0,void 0,function*(){return function(n,e){const t=iv(e,n,yi.donor.id),i=iv(e,t,yi.providerUUID.id),r=new Set;for(const l of n)for(const c of(0,xn.readQuads)(e,l,yi.spatialEntity,null,null))r.add(c.subject.id);const s=iv(e,r,yi.sections.id),o=new Set([...iv(e,r,yi.datasets.id),...iv(e,s,yi.datasets.id)]);return 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 Fi(this,void 0,void 0,function*(){return function(n,e){const t={};return Oq(n,e).forEach((r,s)=>{t[s]=r.size}),t}(this.getIds(e),this.store)})}getCellTypeTermOccurences(e){return Fi(this,void 0,void 0,function*(){return function(n,e){var t,i;const r=Oq(n,e),s=new Map;for(const a of r.keys()){const l=r.get(a);for(const c of(0,xn.readQuads)(e,null,ki.asctb.located_in,a,null)){const u=c.subject.id;if(s.has(u)){const h=s.get(u);l.forEach(p=>h.add(p))}else s.set(u,new Set(l))}}const o={};return s.forEach((a,l)=>{o[l]=a.size}),o[bd.cell.id]=null!==(i=null===(t=r.get(bd.body.id))||void 0===t?void 0:t.size)&&void 0!==i?i:0,o}(this.getIds(e),this.store)})}getOntologyTreeModel(){return Fi(this,void 0,void 0,function*(){return Pq(this.store)})}getCellTypeTreeModel(){return Fi(this,void 0,void 0,function*(){return function(n){return Rq(n,bd.cell.id,"cell",ki.asctb.ct_is_a.id)}(this.store)})}getReferenceOrgans(){return Fi(this,void 0,void 0,function*(){return this.scene.getReferenceOrgans()})}getScene(e){return Fi(this,void 0,void 0,function*(){return this.graph.createGraph(),this.scene.getScene(e)})}getReferenceOrganScene(e,t){return Fi(this,void 0,void 0,function*(){return this.graph.createGraph(),this.scene.getReferenceOrganScene(e,t)})}getSpatialPlacement(e,t){return Fi(this,void 0,void 0,function*(){return this.graph.getSpatialPlacement(e,t)})}}function W2e(n,e){return n===e}let q2e=(()=>{class n{constructor(t,i){this.locator=t,this.globalConfig=i,this.subscriptions=new x,this.dataSource=i.getOption("data").pipe(me(r=>Object.assign(Object.assign({},bq),{dataSources:r})),Qi(r=>Object.keys(r).length>0),me(r=>r),rd(W2e),Ir(r=>function(n,e){return new I(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?je(r):Yc).subscribe(t);return()=>{o.unsubscribe(),i&&i.unsubscribe()}})}(()=>this.createDataSource(),s=>this.connectDataSource(s.source,r))),$a(1)),this.subscriptions.add(this.dataSource.subscribe())}ngOnDestroy(){this.subscriptions.unsubscribe()}getTissueBlockResults(t){return this.dataSource.pipe(Ir(i=>i.getTissueBlockResults(t)),Wi(1))}getAggregateResults(t){return this.dataSource.pipe(Ir(i=>i.getAggregateResults(t)),Wi(1))}getOntologyTermOccurences(t){return this.dataSource.pipe(Ir(i=>i.getOntologyTermOccurences(t)),Wi(1))}getCellTypeTermOccurences(t){return this.dataSource.pipe(Ir(i=>i.getCellTypeTermOccurences(t)),Wi(1))}getOntologyTreeModel(){return this.dataSource.pipe(Ir(t=>t.getOntologyTreeModel()),Wi(1))}getCellTypeTreeModel(){return this.dataSource.pipe(Ir(t=>t.getCellTypeTreeModel()),Wi(1))}getReferenceOrgans(){return this.dataSource.pipe(Ir(t=>t.getReferenceOrgans()),Wi(1))}getScene(t){return this.dataSource.pipe(Ir(i=>i.getScene(t)),Wi(1))}getOrganScene(t,i){return this.dataSource.pipe(Ir(r=>r.getReferenceOrganScene(t,i)),Wi(1))}createDataSource(){return{source:new z2e,unsubscribe:()=>{}}}connectDataSource(t,i){return Fi(this,void 0,void 0,function*(){const r=(new Date).getTime();return yield t.connect(i,!1),m0.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)(Oe(Cf),Oe(Yb))},n.\u0275prov=We({token:n,factory:n.\u0275fac,providedIn:"root"}),n})(),Y2e=(()=>{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$=Yo([this.data$,this.referenceOrgans$,this.source.dataSource]).pipe(Ir(([r,s,o])=>this.chooseScene(r,s))),this.organs$=this.configState.getOption("data").pipe(me(r=>this.selectOrgans(r)),$a(1)),this.filteredOrgans$=Yo([this.organs$,this.referenceOrgans$]).pipe(me(([r,s])=>this.getNeededReferenceOrgans(s,r)),$a(1)),this.filteredScene$=Yo([this.scene$,this.organs$,this.referenceOrgans$]).pipe(me(([r,s,o])=>this.filterSceneNodes(r,s,o)),function(n,e){const t=n.pipe(ao(""));return i=>Yo([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$,BNe),function(n){const e=n.pipe(ao(""));return t=>Yo([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$),$a(1))}chooseScene(t,i){var r;const s=null!==(r=null==t?void 0:t.map(a=>{const l=a[K9];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 fn([])}selectOrgans(t){const r=(null!=t?t:[]).map(s=>s[K9].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)(Oe(Yb),Oe(q2e))},n.\u0275prov=We({token:n,factory:n.\u0275fac,providedIn:"root"}),n})();const K2e=["bodyUI"];let X2e=(()=>{class n{constructor(t,i,r){this.configState=t,this.sceneSource=i,this.cdr=r,this.onMouseEnter=new sn,this.onMouseLeave=new sn,this.onClick=new sn,this.data$=this.configState.getOption("data"),this.organs$=this.sceneSource.filteredOrgans$,this.scene$=this.sceneSource.filteredScene$.pipe(Yr(s=>this.reset()))}reset(){var t,i;return Fi(this,void 0,void 0,function*(){const{bodyUI:r}=this;yield new Promise(a=>setTimeout(a,200));const s=yield this.organs$.pipe(Wi(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)(xe(Yb),xe(Y2e),xe(Dr))},n.\u0275cmp=ln({type:n,selectors:[["ccf-root"]],viewQuery:function(t,i){if(1&t&&ss(K2e,7),2&t){let r;ii(r=ri())&&(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&&(Pt(0,"ccf-body-ui",0,1),Un("nodeClick",function(s){return i.onClick.emit(s)})("nodeHoverStart",function(s){return i.onMouseEnter.emit(s)})("nodeHoverStop",function(s){return i.onMouseLeave.emit(s)}),xl(2,"async"),Ft()),2&t&&rn("scene",Vu(2,2,i.scene$))("interactive",!0)},directives:[nNe],pipes:[h0],styles:[".body-ui[_ngcontent-%COMP%]{height:100%;width:100%}"],changeDetection:0}),n})();function Q2e(n,e){if(1&n){const t=jt();Pt(0,"ccf-root",1),Un("onMouseEnter",function(r){return Cr(t),ci().onMouseEnter.emit(r)})("onMouseLeave",function(r){return Cr(t),ci().onMouseLeave.emit(r)})("onClick",function(r){return Cr(t),ci().onClick.emit(r)}),Ft()}}function Z2e(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 J2e=(()=>{class n extends Eie{constructor(t,i){super(t,i,{initialDelay:10,initialConfig:Object.assign(Object.assign({},m0.dbOptions),globalThis.dbOptions),parse:{data:Z2e}}),this.onMouseEnter=new sn,this.onMouseLeave=new sn,this.onClick=new sn}}return n.\u0275fac=function(t){return new(t||n)(xe(Yb),xe(Dr))},n.\u0275cmp=ln({type:n,selectors:[["ccf-root-wc"]],inputs:{data:"data",highlightID:"highlightID",zoomToID:"zoomToID"},outputs:{onMouseEnter:"onMouseEnter",onMouseLeave:"onMouseLeave",onClick:"onClick"},features:[An],decls:1,vars:1,consts:[[3,"onMouseEnter","onMouseLeave","onClick",4,"ngIf"],[3,"onMouseEnter","onMouseLeave","onClick"]],template:function(t,i){1&t&&Di(0,Q2e,1,0,"ccf-root",0),2&t&&rn("ngIf",i.initialized)},directives:[lc,X2e],encapsulation:2,changeDetection:0}),n})(),eke=(()=>{class n{constructor(t,i){this.accessor=t,this.injector=i}static forRoot(t=[]){return{ngModule:n,providers:[ps,Za,hW,...t]}}}return n.\u0275fac=function(t){return new(t||n)(Oe(ps,2),Oe(Za,2))},n.\u0275mod=on({type:n}),n.\u0275inj=xt({}),n})();const x1=(n,e)=>((n,e)=>new Array(e+1).join("0"))(0,e-n.toString().length)+n;class ike{constructor(e,t,i){this.action=e,this.store=t,this.logWriter=i}dispatched(e){const t=$f(this.action),i=function(n){return x1(n.getHours(),2)+":"+x1(n.getMinutes(),2)+":"+x1(n.getSeconds(),2)+"."+x1(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 rke{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 kq=new Ht("NGXS_LOGGER_PLUGIN_OPTIONS");let ske=(()=>{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 rke(this._options),this._store=this._store||this._injector.get(cu);const s=new ike(i,this._store,this._logWriter);return s.dispatched(t),r(t,i).pipe(Yr(o=>{s.completed(o)}),bc(o=>{throw s.errored(o),o}))}}return n.\u0275fac=function(t){return new(t||n)(Oe(kq),Oe(Wn))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const Lq=new Ht("LOGGER_USER_OPTIONS");function oke(n){return Object.assign({},{logger:console,collapsed:!1,disabled:!1,filter:()=>!0},n)}let ake=(()=>{class n{static forRoot(t){return{ngModule:n,providers:[{provide:f6,useClass:ske,multi:!0},{provide:Lq,useValue:t},{provide:kq,useFactory:oke,deps:[Lq]}]}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=on({type:n}),n.\u0275inj=xt({}),n})();const lke=[Yb];let cke=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=on({type:n}),n.\u0275inj=xt({imports:[[eke.forRoot(),Wo.forRoot(lke,{developmentMode:!m0.production}),ake.forRoot({disabled:m0.production})]]}),n})(),uke=(()=>{class n{constructor(t){this.injector=t}ngDoBootstrap(){const t=function(n,e){const t=function(n,e){return e.get(wl).resolveComponentFactory(n).inputs}(n,e.injector),i=e.strategyFactory||new mie(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 yie{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,u){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}(J2e,{injector:this.injector});customElements.define("ccf-body-ui-wc",t)}}return n.\u0275fac=function(t){return new(t||n)(Oe(Wn))},n.\u0275mod=on({type:n}),n.\u0275inj=xt({providers:[],imports:[[WD,cke,iNe]]}),n})();m0.production&&function(){if(lB)throw new Error("Cannot enable prod mode after platform setup.");aB=!1}(),jne().bootstrapModule(uke).catch(n=>console.error(n))},52:Ut=>{function it(yt,ee,Tt,dt,Y,Se,he){try{var W=yt[Se](he),j=W.value}catch(P){return void Tt(P)}W.done?ee(j):Promise.resolve(j).then(dt,Y)}Ut.exports=function(yt){return function(){var ee=this,Tt=arguments;return new Promise(function(dt,Y){var Se=yt.apply(ee,Tt);function he(j){it(Se,dt,Y,he,W,"next",j)}function W(j){it(Se,dt,Y,he,W,"throw",j)}he(void 0)})}},Ut.exports.default=Ut.exports,Ut.exports.__esModule=!0},948:Ut=>{Ut.exports=function(Je){return Je&&Je.__esModule?Je:{default:Je}},Ut.exports.default=Ut.exports,Ut.exports.__esModule=!0},321:Ut=>{function it(Je){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(Ut.exports=it=function(ee){return typeof ee},Ut.exports.default=Ut.exports,Ut.exports.__esModule=!0):(Ut.exports=it=function(ee){return ee&&"function"==typeof Symbol&&ee.constructor===Symbol&&ee!==Symbol.prototype?"symbol":typeof ee},Ut.exports.default=Ut.exports,Ut.exports.__esModule=!0),it(Je)}Ut.exports=it,Ut.exports.default=Ut.exports,Ut.exports.__esModule=!0},380:Ut=>{function it(Je){return Promise.resolve().then(()=>{var yt=new Error("Cannot find module '"+Je+"'");throw yt.code="MODULE_NOT_FOUND",yt})}it.keys=()=>[],it.resolve=it,it.id=380,Ut.exports=it},521:()=>{},125:()=>{},307:()=>{}},Ut=>{Ut(Ut.s=303)}]); \ No newline at end of file +var dke=Object.defineProperty,hke=Object.defineProperties,fke=Object.getOwnPropertyDescriptors,C1=Object.getOwnPropertySymbols,jq=Object.prototype.hasOwnProperty,Vq=Object.prototype.propertyIsEnumerable,Er=Math.pow,Uq=(Ut,it,Je)=>it in Ut?dke(Ut,it,{enumerable:!0,configurable:!0,writable:!0,value:Je}):Ut[it]=Je,ot=(Ut,it)=>{for(var Je in it||(it={}))jq.call(it,Je)&&Uq(Ut,Je,it[Je]);if(C1)for(var Je of C1(it))Vq.call(it,Je)&&Uq(Ut,Je,it[Je]);return Ut},Cn=(Ut,it)=>hke(Ut,fke(it)),zq=(Ut,it)=>{var Je={};for(var yt in Ut)jq.call(Ut,yt)&&it.indexOf(yt)<0&&(Je[yt]=Ut[yt]);if(null!=Ut&&C1)for(var yt of C1(Ut))it.indexOf(yt)<0&&Vq.call(Ut,yt)&&(Je[yt]=Ut[yt]);return Je};(self.webpackChunkccf_ui=self.webpackChunkccf_ui||[]).push([[179],{440:(Ut,it,Je)=>{var yt=Je(52).default;Ut.exports=function Y(Se,he,W){function j(z,v){if(!he[z]){if(!Se[z]){if(P)return P(z,!0);var O=new Error("Cannot find module '"+z+"'");throw O.code="MODULE_NOT_FOUND",O}var A=he[z]={exports:{}};Se[z][0].call(A.exports,function(b){return j(Se[z][1][b]||b)},A,A.exports,Y,Se,he,W)}return he[z].exports}for(var P=void 0,Q=0;Q0&&G[G.length-1])&&(6===_t[0]||2===_t[0])){$e=0;continue}if(3===_t[0]&&(!G||_t[1]>G[0]&&_t[1]0?ce-4:ce;for($=0;$>16&255,I[X++]=R>>8&255,I[X++]=255&R;return 2===D&&(R=j[V.charCodeAt($)]<<2|j[V.charCodeAt($+1)]>>4,I[X++]=255&R),1===D&&(R=j[V.charCodeAt($)]<<10|j[V.charCodeAt($+1)]<<4|j[V.charCodeAt($+2)]>>2,I[X++]=R>>8&255,I[X++]=255&R),I},he.fromByteArray=function(V){for(var R,K=V.length,ce=K%3,D=[],I=16383,X=0,E=K-ce;XE?E:X+I));return 1===ce?D.push(W[(R=V[K-1])>>2]+W[R<<4&63]+"=="):2===ce&&D.push(W[(R=(V[K-2]<<8)+V[K-1])>>10]+W[R>>4&63]+W[R<<2&63]+"="),D.join("")};for(var W=[],j=[],P="undefined"!=typeof Uint8Array?Uint8Array:Array,Q="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",z=0,v=Q.length;z0)throw new Error("Invalid string. Length must be a multiple of 4");var K=V.indexOf("=");return-1===K&&(K=R),[K,K===R?0:4-K%4]}function y(V){return W[V>>18&63]+W[V>>12&63]+W[V>>6&63]+W[63&V]}function S(V,R,K){for(var D=[],I=R;I>5==6?2:D>>4==14?3:D>>3==30?4:D>>6==2?-1:-2}function A(D){var I=this.lastTotal-this.lastNeed,X=function(D,I,X){if(128!=(192&I[0]))return D.lastNeed=0,"\ufffd";if(D.lastNeed>1&&I.length>1){if(128!=(192&I[1]))return D.lastNeed=1,"\ufffd";if(D.lastNeed>2&&I.length>2&&128!=(192&I[2]))return D.lastNeed=2,"\ufffd"}}(this,D);return void 0!==X?X:this.lastNeed<=D.length?(D.copy(this.lastChar,I,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(D.copy(this.lastChar,I,0,D.length),void(this.lastNeed-=D.length))}function S(D,I){if((D.length-I)%2==0){var X=D.toString("utf16le",I);if(X){var E=X.charCodeAt(X.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],X.slice(0,-1)}return X}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=D[D.length-1],D.toString("utf16le",I,D.length-1)}function T(D){var I=D&&D.length?this.write(D):"";return this.lastNeed?I+this.lastChar.toString("utf16le",0,this.lastTotal-this.lastNeed):I}function V(D,I){var X=(D.length-I)%3;return 0===X?D.toString("base64",I):(this.lastNeed=3-X,this.lastTotal=3,1===X?this.lastChar[0]=D[D.length-1]:(this.lastChar[0]=D[D.length-2],this.lastChar[1]=D[D.length-1]),D.toString("base64",I,D.length-X))}function R(D){var I=D&&D.length?this.write(D):"";return this.lastNeed?I+this.lastChar.toString("base64",0,3-this.lastNeed):I}function K(D){return D.toString(this.encoding)}function ce(D){return D&&D.length?this.write(D):""}he.StringDecoder=z,z.prototype.write=function(D){if(0===D.length)return"";var I,X;if(this.lastNeed){if(void 0===(I=this.fillLast(D)))return"";X=this.lastNeed,this.lastNeed=0}else X=0;return X=0?($>0&&(D.lastNeed=$-1),$):--E=0?($>0&&(D.lastNeed=$-2),$):--E=0?($>0&&(2===$?$=0:D.lastNeed=$-3),$):0}(this,D,I);if(!this.lastNeed)return D.toString("utf8",I);this.lastTotal=X;var E=D.length-(X-this.lastNeed);return D.copy(this.lastChar,0,E),D.toString("utf8",I,E)},z.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(Y,Se,he){(function(W){(function(){"use strict";var j=Y("base64-js"),P=Y("ieee754");he.Buffer=x,he.SlowBuffer=function(L){return+L!=L&&(L=0),x.alloc(+L)},he.INSPECT_MAX_BYTES=50;var Q=2147483647;function v(L){if(L>Q)throw new RangeError('The value "'+L+'" is invalid for option "size"');var N=new Uint8Array(L);return N.__proto__=x.prototype,N}function x(L,N,B){if("number"==typeof L){if("string"==typeof N)throw new TypeError('The "string" argument must be of type string. Received type number');return y(L)}return O(L,N,B)}function O(L,N,B){if("string"==typeof L)return function(L,N){if(("string"!=typeof N||""===N)&&(N="utf8"),!x.isEncoding(N))throw new TypeError("Unknown encoding: "+N);var B=0|D(L,N),Re=v(B),Qe=Re.write(L,N);return Qe!==B&&(Re=Re.slice(0,Qe)),Re}(L,N);if(ArrayBuffer.isView(L))return T(L);if(null==L)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof L);if(pt(L,ArrayBuffer)||L&&pt(L.buffer,ArrayBuffer))return function(L,N,B){if(N<0||L.byteLength=Q)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Q.toString(16)+" bytes");return 0|L}function D(L,N){if(x.isBuffer(L))return L.length;if(ArrayBuffer.isView(L)||pt(L,ArrayBuffer))return L.byteLength;if("string"!=typeof L)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof L);var B=L.length,Re=arguments.length>2&&!0===arguments[2];if(!Re&&0===B)return 0;for(var Qe=!1;;)switch(N){case"ascii":case"latin1":case"binary":return B;case"utf8":case"utf-8":return G(L).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*B;case"hex":return B>>>1;case"base64":return je(L).length;default:if(Qe)return Re?-1:G(L).length;N=(""+N).toLowerCase(),Qe=!0}}function I(L,N,B){var Re=!1;if((void 0===N||N<0)&&(N=0),N>this.length||((void 0===B||B>this.length)&&(B=this.length),B<=0)||(B>>>=0)<=(N>>>=0))return"";for(L||(L="utf8");;)switch(L){case"hex":return tt(this,N,B);case"utf8":case"utf-8":return _e(this,N,B);case"ascii":return st(this,N,B);case"latin1":case"binary":return Xe(this,N,B);case"base64":return ne(this,N,B);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ye(this,N,B);default:if(Re)throw new TypeError("Unknown encoding: "+L);L=(L+"").toLowerCase(),Re=!0}}function X(L,N,B){var Re=L[N];L[N]=L[B],L[B]=Re}function E(L,N,B,Re,Qe){if(0===L.length)return-1;if("string"==typeof B?(Re=B,B=0):B>2147483647?B=2147483647:B<-2147483648&&(B=-2147483648),ve(B=+B)&&(B=Qe?0:L.length-1),B<0&&(B=L.length+B),B>=L.length){if(Qe)return-1;B=L.length-1}else if(B<0){if(!Qe)return-1;B=0}if("string"==typeof N&&(N=x.from(N,Re)),x.isBuffer(N))return 0===N.length?-1:$(L,N,B,Re,Qe);if("number"==typeof N)return N&=255,"function"==typeof Uint8Array.prototype.indexOf?Qe?Uint8Array.prototype.indexOf.call(L,N,B):Uint8Array.prototype.lastIndexOf.call(L,N,B):$(L,[N],B,Re,Qe);throw new TypeError("val must be string, number or Buffer")}function $(L,N,B,Re,Qe){var Yn,St=1,Nt=L.length,On=N.length;if(void 0!==Re&&("ucs2"===(Re=String(Re).toLowerCase())||"ucs-2"===Re||"utf16le"===Re||"utf-16le"===Re)){if(L.length<2||N.length<2)return-1;St=2,Nt/=2,On/=2,B/=2}function kn(Ls,gs){return 1===St?Ls[gs]:Ls.readUInt16BE(gs*St)}if(Qe){var Ti=-1;for(Yn=B;YnNt&&(B=Nt-On),Yn=B;Yn>=0;Yn--){for(var wi=!0,Xr=0;XrQe&&(Re=Qe):Re=Qe;var St=N.length;Re>St/2&&(Re=St/2);for(var Nt=0;Nt>8,St.push(B%256),St.push(Re);return St}(N,L.length-B),L,B,Re)}function ne(L,N,B){return j.fromByteArray(0===N&&B===L.length?L:L.slice(N,B))}function _e(L,N,B){B=Math.min(L.length,B);for(var Re=[],Qe=N;Qe239?4:St>223?3:St>191?2:1;if(Qe+On<=B)switch(On){case 1:St<128&&(Nt=St);break;case 2:128==(192&(kn=L[Qe+1]))&&(wi=(31&St)<<6|63&kn)>127&&(Nt=wi);break;case 3:Yn=L[Qe+2],128==(192&(kn=L[Qe+1]))&&128==(192&Yn)&&(wi=(15&St)<<12|(63&kn)<<6|63&Yn)>2047&&(wi<55296||wi>57343)&&(Nt=wi);break;case 4:Yn=L[Qe+2],Ti=L[Qe+3],128==(192&(kn=L[Qe+1]))&&128==(192&Yn)&&128==(192&Ti)&&(wi=(15&St)<<18|(63&kn)<<12|(63&Yn)<<6|63&Ti)>65535&&wi<1114112&&(Nt=wi)}null===Nt?(Nt=65533,On=1):Nt>65535&&(Re.push((Nt-=65536)>>>10&1023|55296),Nt=56320|1023&Nt),Re.push(Nt),Qe+=On}return function(L){var N=L.length;if(N<=4096)return String.fromCharCode.apply(String,L);for(var B="",Re=0;ReB&&(N+=" ... "),""},x.prototype.compare=function(N,B,Re,Qe,St){if(pt(N,Uint8Array)&&(N=x.from(N,N.offset,N.byteLength)),!x.isBuffer(N))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof N);if(void 0===B&&(B=0),void 0===Re&&(Re=N?N.length:0),void 0===Qe&&(Qe=0),void 0===St&&(St=this.length),B<0||Re>N.length||Qe<0||St>this.length)throw new RangeError("out of range index");if(Qe>=St&&B>=Re)return 0;if(Qe>=St)return-1;if(B>=Re)return 1;if(this===N)return 0;for(var Nt=(St>>>=0)-(Qe>>>=0),On=(Re>>>=0)-(B>>>=0),kn=Math.min(Nt,On),Yn=this.slice(Qe,St),Ti=N.slice(B,Re),wi=0;wi>>=0,isFinite(Re)?(Re>>>=0,void 0===Qe&&(Qe="utf8")):(Qe=Re,Re=void 0)}var St=this.length-B;if((void 0===Re||Re>St)&&(Re=St),N.length>0&&(Re<0||B<0)||B>this.length)throw new RangeError("Attempt to write outside buffer bounds");Qe||(Qe="utf8");for(var Nt=!1;;)switch(Qe){case"hex":return Z(this,N,B,Re);case"utf8":case"utf-8":return oe(this,N,B,Re);case"ascii":return se(this,N,B,Re);case"latin1":case"binary":return te(this,N,B,Re);case"base64":return Ce(this,N,B,Re);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return me(this,N,B,Re);default:if(Nt)throw new TypeError("Unknown encoding: "+Qe);Qe=(""+Qe).toLowerCase(),Nt=!0}},x.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function st(L,N,B){var Re="";B=Math.min(L.length,B);for(var Qe=N;QeRe)&&(B=Re);for(var Qe="",St=N;StB)throw new RangeError("Trying to access beyond buffer length")}function ke(L,N,B,Re,Qe,St){if(!x.isBuffer(L))throw new TypeError('"buffer" argument must be a Buffer instance');if(N>Qe||NL.length)throw new RangeError("Index out of range")}function Ke(L,N,B,Re,Qe,St){if(B+Re>L.length)throw new RangeError("Index out of range");if(B<0)throw new RangeError("Index out of range")}function Me(L,N,B,Re,Qe){return N=+N,B>>>=0,Qe||Ke(L,0,B,4),P.write(L,N,B,Re,23,4),B+4}function Ve(L,N,B,Re,Qe){return N=+N,B>>>=0,Qe||Ke(L,0,B,8),P.write(L,N,B,Re,52,8),B+8}x.prototype.slice=function(N,B){var Re=this.length;(N=~~N)<0?(N+=Re)<0&&(N=0):N>Re&&(N=Re),(B=void 0===B?Re:~~B)<0?(B+=Re)<0&&(B=0):B>Re&&(B=Re),B>>=0,B>>>=0,Re||Ue(N,B,this.length);for(var Qe=this[N],St=1,Nt=0;++Nt>>=0,B>>>=0,Re||Ue(N,B,this.length);for(var Qe=this[N+--B],St=1;B>0&&(St*=256);)Qe+=this[N+--B]*St;return Qe},x.prototype.readUInt8=function(N,B){return N>>>=0,B||Ue(N,1,this.length),this[N]},x.prototype.readUInt16LE=function(N,B){return N>>>=0,B||Ue(N,2,this.length),this[N]|this[N+1]<<8},x.prototype.readUInt16BE=function(N,B){return N>>>=0,B||Ue(N,2,this.length),this[N]<<8|this[N+1]},x.prototype.readUInt32LE=function(N,B){return N>>>=0,B||Ue(N,4,this.length),(this[N]|this[N+1]<<8|this[N+2]<<16)+16777216*this[N+3]},x.prototype.readUInt32BE=function(N,B){return N>>>=0,B||Ue(N,4,this.length),16777216*this[N]+(this[N+1]<<16|this[N+2]<<8|this[N+3])},x.prototype.readIntLE=function(N,B,Re){N>>>=0,B>>>=0,Re||Ue(N,B,this.length);for(var Qe=this[N],St=1,Nt=0;++Nt=(St*=128)&&(Qe-=Math.pow(2,8*B)),Qe},x.prototype.readIntBE=function(N,B,Re){N>>>=0,B>>>=0,Re||Ue(N,B,this.length);for(var Qe=B,St=1,Nt=this[N+--Qe];Qe>0&&(St*=256);)Nt+=this[N+--Qe]*St;return Nt>=(St*=128)&&(Nt-=Math.pow(2,8*B)),Nt},x.prototype.readInt8=function(N,B){return N>>>=0,B||Ue(N,1,this.length),128&this[N]?-1*(255-this[N]+1):this[N]},x.prototype.readInt16LE=function(N,B){N>>>=0,B||Ue(N,2,this.length);var Re=this[N]|this[N+1]<<8;return 32768&Re?4294901760|Re:Re},x.prototype.readInt16BE=function(N,B){N>>>=0,B||Ue(N,2,this.length);var Re=this[N+1]|this[N]<<8;return 32768&Re?4294901760|Re:Re},x.prototype.readInt32LE=function(N,B){return N>>>=0,B||Ue(N,4,this.length),this[N]|this[N+1]<<8|this[N+2]<<16|this[N+3]<<24},x.prototype.readInt32BE=function(N,B){return N>>>=0,B||Ue(N,4,this.length),this[N]<<24|this[N+1]<<16|this[N+2]<<8|this[N+3]},x.prototype.readFloatLE=function(N,B){return N>>>=0,B||Ue(N,4,this.length),P.read(this,N,!0,23,4)},x.prototype.readFloatBE=function(N,B){return N>>>=0,B||Ue(N,4,this.length),P.read(this,N,!1,23,4)},x.prototype.readDoubleLE=function(N,B){return N>>>=0,B||Ue(N,8,this.length),P.read(this,N,!0,52,8)},x.prototype.readDoubleBE=function(N,B){return N>>>=0,B||Ue(N,8,this.length),P.read(this,N,!1,52,8)},x.prototype.writeUIntLE=function(N,B,Re,Qe){N=+N,B>>>=0,Re>>>=0,Qe||ke(this,N,B,Re,Math.pow(2,8*Re)-1,0);var Nt=1,On=0;for(this[B]=255&N;++On>>=0,Re>>>=0,Qe||ke(this,N,B,Re,Math.pow(2,8*Re)-1,0);var Nt=Re-1,On=1;for(this[B+Nt]=255&N;--Nt>=0&&(On*=256);)this[B+Nt]=N/On&255;return B+Re},x.prototype.writeUInt8=function(N,B,Re){return N=+N,B>>>=0,Re||ke(this,N,B,1,255,0),this[B]=255&N,B+1},x.prototype.writeUInt16LE=function(N,B,Re){return N=+N,B>>>=0,Re||ke(this,N,B,2,65535,0),this[B]=255&N,this[B+1]=N>>>8,B+2},x.prototype.writeUInt16BE=function(N,B,Re){return N=+N,B>>>=0,Re||ke(this,N,B,2,65535,0),this[B]=N>>>8,this[B+1]=255&N,B+2},x.prototype.writeUInt32LE=function(N,B,Re){return N=+N,B>>>=0,Re||ke(this,N,B,4,4294967295,0),this[B+3]=N>>>24,this[B+2]=N>>>16,this[B+1]=N>>>8,this[B]=255&N,B+4},x.prototype.writeUInt32BE=function(N,B,Re){return N=+N,B>>>=0,Re||ke(this,N,B,4,4294967295,0),this[B]=N>>>24,this[B+1]=N>>>16,this[B+2]=N>>>8,this[B+3]=255&N,B+4},x.prototype.writeIntLE=function(N,B,Re,Qe){if(N=+N,B>>>=0,!Qe){var St=Math.pow(2,8*Re-1);ke(this,N,B,Re,St-1,-St)}var Nt=0,On=1,kn=0;for(this[B]=255&N;++Nt>0)-kn&255;return B+Re},x.prototype.writeIntBE=function(N,B,Re,Qe){if(N=+N,B>>>=0,!Qe){var St=Math.pow(2,8*Re-1);ke(this,N,B,Re,St-1,-St)}var Nt=Re-1,On=1,kn=0;for(this[B+Nt]=255&N;--Nt>=0&&(On*=256);)N<0&&0===kn&&0!==this[B+Nt+1]&&(kn=1),this[B+Nt]=(N/On>>0)-kn&255;return B+Re},x.prototype.writeInt8=function(N,B,Re){return N=+N,B>>>=0,Re||ke(this,N,B,1,127,-128),N<0&&(N=255+N+1),this[B]=255&N,B+1},x.prototype.writeInt16LE=function(N,B,Re){return N=+N,B>>>=0,Re||ke(this,N,B,2,32767,-32768),this[B]=255&N,this[B+1]=N>>>8,B+2},x.prototype.writeInt16BE=function(N,B,Re){return N=+N,B>>>=0,Re||ke(this,N,B,2,32767,-32768),this[B]=N>>>8,this[B+1]=255&N,B+2},x.prototype.writeInt32LE=function(N,B,Re){return N=+N,B>>>=0,Re||ke(this,N,B,4,2147483647,-2147483648),this[B]=255&N,this[B+1]=N>>>8,this[B+2]=N>>>16,this[B+3]=N>>>24,B+4},x.prototype.writeInt32BE=function(N,B,Re){return N=+N,B>>>=0,Re||ke(this,N,B,4,2147483647,-2147483648),N<0&&(N=4294967295+N+1),this[B]=N>>>24,this[B+1]=N>>>16,this[B+2]=N>>>8,this[B+3]=255&N,B+4},x.prototype.writeFloatLE=function(N,B,Re){return Me(this,N,B,!0,Re)},x.prototype.writeFloatBE=function(N,B,Re){return Me(this,N,B,!1,Re)},x.prototype.writeDoubleLE=function(N,B,Re){return Ve(this,N,B,!0,Re)},x.prototype.writeDoubleBE=function(N,B,Re){return Ve(this,N,B,!1,Re)},x.prototype.copy=function(N,B,Re,Qe){if(!x.isBuffer(N))throw new TypeError("argument should be a Buffer");if(Re||(Re=0),!Qe&&0!==Qe&&(Qe=this.length),B>=N.length&&(B=N.length),B||(B=0),Qe>0&&Qe=this.length)throw new RangeError("Index out of range");if(Qe<0)throw new RangeError("sourceEnd out of bounds");Qe>this.length&&(Qe=this.length),N.length-B=0;--Nt)N[Nt+B]=this[Nt+Re];else Uint8Array.prototype.set.call(N,this.subarray(Re,Qe),B);return St},x.prototype.fill=function(N,B,Re,Qe){if("string"==typeof N){if("string"==typeof B?(Qe=B,B=0,Re=this.length):"string"==typeof Re&&(Qe=Re,Re=this.length),void 0!==Qe&&"string"!=typeof Qe)throw new TypeError("encoding must be a string");if("string"==typeof Qe&&!x.isEncoding(Qe))throw new TypeError("Unknown encoding: "+Qe);if(1===N.length){var St=N.charCodeAt(0);("utf8"===Qe&&St<128||"latin1"===Qe)&&(N=St)}}else"number"==typeof N&&(N&=255);if(B<0||this.length>>=0,Re=void 0===Re?this.length:Re>>>0,N||(N=0),"number"==typeof N)for(Nt=B;Nt55295&&B<57344){if(!Qe){if(B>56319){(N-=3)>-1&&St.push(239,191,189);continue}if(Nt+1===Re){(N-=3)>-1&&St.push(239,191,189);continue}Qe=B;continue}if(B<56320){(N-=3)>-1&&St.push(239,191,189),Qe=B;continue}B=65536+(Qe-55296<<10|B-56320)}else Qe&&(N-=3)>-1&&St.push(239,191,189);if(Qe=null,B<128){if((N-=1)<0)break;St.push(B)}else if(B<2048){if((N-=2)<0)break;St.push(B>>6|192,63&B|128)}else if(B<65536){if((N-=3)<0)break;St.push(B>>12|224,B>>6&63|128,63&B|128)}else{if(!(B<1114112))throw new Error("Invalid code point");if((N-=4)<0)break;St.push(B>>18|240,B>>12&63|128,B>>6&63|128,63&B|128)}}return St}function je(L){return j.toByteArray(function(L){if((L=(L=L.split("=")[0]).trim().replace($e,"")).length<2)return"";for(;L.length%4!=0;)L+="=";return L}(L))}function _t(L,N,B,Re){for(var Qe=0;Qe=N.length||Qe>=L.length);++Qe)N[Qe+B]=L[Qe];return Qe}function pt(L,N){return L instanceof N||null!=L&&null!=L.constructor&&null!=L.constructor.name&&L.constructor.name===N.name}function ve(L){return L!=L}}).call(this)}).call(this,Y("buffer").Buffer)},{"base64-js":2,buffer:6,ieee754:9}],7:[function(Y,Se,he){"use strict";Se.exports=function W(j){return null===j||"object"!=typeof j||null!=j.toJSON?JSON.stringify(j):Array.isArray(j)?"["+j.reduce((P,Q,z)=>P+(0===z?"":",")+W(void 0===Q||"symbol"==typeof Q?null:Q),"")+"]":"{"+Object.keys(j).sort().reduce((P,Q,z)=>void 0===j[Q]||"symbol"==typeof j[Q]?P:P+(0===P.length?"":",")+W(Q)+":"+W(j[Q]),"")+"}"}},{}],8:[function(Y,Se,he){"use strict";var P,W="object"==typeof Reflect?Reflect:null,j=W&&"function"==typeof W.apply?W.apply:function($,Z,oe){return Function.prototype.apply.call($,Z,oe)};P=W&&"function"==typeof W.ownKeys?W.ownKeys:Object.getOwnPropertySymbols?function($){return Object.getOwnPropertyNames($).concat(Object.getOwnPropertySymbols($))}:function($){return Object.getOwnPropertyNames($)};var z=Number.isNaN||function($){return $!=$};function v(){v.init.call(this)}Se.exports=v,Se.exports.once=function(E,$){return new Promise(function(Z,oe){function se(Ce){E.removeListener($,te),oe(Ce)}function te(){"function"==typeof E.removeListener&&E.removeListener("error",se),Z([].slice.call(arguments))}X(E,$,te,{once:!0}),"error"!==$&&function(E,$,Z){"function"==typeof E.on&&X(E,"error",$,Z)}(E,se,{once:!0})})},v.EventEmitter=v,v.prototype._events=void 0,v.prototype._eventsCount=0,v.prototype._maxListeners=void 0;var x=10;function O(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?v.defaultMaxListeners:E._maxListeners}function b(E,$,Z,oe){var se,te,Ce;if(O(Z),void 0===(te=E._events)?(te=E._events=Object.create(null),E._eventsCount=0):(void 0!==te.newListener&&(E.emit("newListener",$,Z.listener?Z.listener:Z),te=E._events),Ce=te[$]),void 0===Ce)Ce=te[$]=Z,++E._eventsCount;else if("function"==typeof Ce?Ce=te[$]=oe?[Z,Ce]:[Ce,Z]:oe?Ce.unshift(Z):Ce.push(Z),(se=A(E))>0&&Ce.length>se&&!Ce.warned){Ce.warned=!0;var me=new Error("Possible EventEmitter memory leak detected. "+Ce.length+" "+String($)+" listeners added. Use emitter.setMaxListeners() to increase limit");me.name="MaxListenersExceededWarning",me.emitter=E,me.type=$,me.count=Ce.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 S(E,$,Z){var oe={fired:!1,wrapFn:void 0,target:E,type:$,listener:Z},se=y.bind(oe);return se.listener=Z,oe.wrapFn=se,se}function T(E,$,Z){var oe=E._events;if(void 0===oe)return[];var se=oe[$];return void 0===se?[]:"function"==typeof se?Z?[se.listener||se]:[se]:Z?function(E){for(var $=new Array(E.length),Z=0;Z<$.length;++Z)$[Z]=E[Z].listener||E[Z];return $}(se):R(se,se.length)}function V(E){var $=this._events;if(void 0!==$){var Z=$[E];if("function"==typeof Z)return 1;if(void 0!==Z)return Z.length}return 0}function R(E,$){for(var Z=new Array($),oe=0;oe<$;++oe)Z[oe]=E[oe];return Z}function X(E,$,Z,oe){if("function"==typeof E.on)oe.once?E.once($,Z):E.on($,Z);else{if("function"!=typeof E.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof E);E.addEventListener($,function se(te){oe.once&&E.removeEventListener($,se),Z(te)})}}Object.defineProperty(v,"defaultMaxListeners",{enumerable:!0,get:function(){return x},set:function(E){if("number"!=typeof E||E<0||z(E))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+E+".");x=E}}),v.init=function(){(void 0===this._events||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},v.prototype.setMaxListeners=function($){if("number"!=typeof $||$<0||z($))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+$+".");return this._maxListeners=$,this},v.prototype.getMaxListeners=function(){return A(this)},v.prototype.emit=function($){for(var Z=[],oe=1;oe0&&(Ce=Z[0]),Ce instanceof Error)throw Ce;var me=new Error("Unhandled error."+(Ce?" ("+Ce.message+")":""));throw me.context=Ce,me}var ne=te[$];if(void 0===ne)return!1;if("function"==typeof ne)j(ne,this,Z);else{var _e=ne.length,Ie=R(ne,_e);for(oe=0;oe<_e;++oe)j(Ie[oe],this,Z)}return!0},v.prototype.on=v.prototype.addListener=function($,Z){return b(this,$,Z,!1)},v.prototype.prependListener=function($,Z){return b(this,$,Z,!0)},v.prototype.once=function($,Z){return O(Z),this.on($,S(this,$,Z)),this},v.prototype.prependOnceListener=function($,Z){return O(Z),this.prependListener($,S(this,$,Z)),this},v.prototype.off=v.prototype.removeListener=function($,Z){var oe,se,te,Ce,me;if(O(Z),void 0===(se=this._events))return this;if(void 0===(oe=se[$]))return this;if(oe===Z||oe.listener===Z)0==--this._eventsCount?this._events=Object.create(null):(delete se[$],se.removeListener&&this.emit("removeListener",$,oe.listener||Z));else if("function"!=typeof oe){for(te=-1,Ce=oe.length-1;Ce>=0;Ce--)if(oe[Ce]===Z||oe[Ce].listener===Z){me=oe[Ce].listener,te=Ce;break}if(te<0)return this;0===te?oe.shift():function(E,$){for(;$+1=0;se--)this.removeListener($,Z[se]);return this},v.prototype.listeners=function($){return T(this,$,!0)},v.prototype.rawListeners=function($){return T(this,$,!1)},v.listenerCount=function(E,$){return"function"==typeof E.listenerCount?E.listenerCount($):V.call(E,$)},v.prototype.listenerCount=V,v.prototype.eventNames=function(){return this._eventsCount>0?P(this._events):[]}},{}],9:[function(Y,Se,he){he.read=function(W,j,P,Q,z){var v,x,O=8*z-Q-1,A=(1<>1,y=-7,S=P?z-1:0,T=P?-1:1,V=W[j+S];for(S+=T,v=V&(1<<-y)-1,V>>=-y,y+=O;y>0;v=256*v+W[j+S],S+=T,y-=8);for(x=v&(1<<-y)-1,v>>=-y,y+=Q;y>0;x=256*x+W[j+S],S+=T,y-=8);if(0===v)v=1-b;else{if(v===A)return x?NaN:1/0*(V?-1:1);x+=Math.pow(2,Q),v-=b}return(V?-1:1)*x*Math.pow(2,v-Q)},he.write=function(W,j,P,Q,z,v){var x,O,A,b=8*v-z-1,y=(1<>1,T=23===z?Math.pow(2,-24)-Math.pow(2,-77):0,V=Q?0:v-1,R=Q?1:-1,K=j<0||0===j&&1/j<0?1:0;for(j=Math.abs(j),isNaN(j)||j===1/0?(O=isNaN(j)?1:0,x=y):(x=Math.floor(Math.log(j)/Math.LN2),j*(A=Math.pow(2,-x))<1&&(x--,A*=2),(j+=x+S>=1?T/A:T*Math.pow(2,1-S))*A>=2&&(x++,A/=2),x+S>=y?(O=0,x=y):x+S>=1?(O=(j*A-1)*Math.pow(2,z),x+=S):(O=j*Math.pow(2,S-1)*Math.pow(2,z),x=0));z>=8;W[P+V]=255&O,V+=R,O/=256,z-=8);for(x=x<0;W[P+V]=255&x,V+=R,x/=256,b-=8);W[P+V-R]|=128*K}},{}],10:[function(Y,Se,he){Se.exports="function"==typeof Object.create?function(j,P){P&&(j.super_=P,j.prototype=Object.create(P.prototype,{constructor:{value:j,enumerable:!1,writable:!0,configurable:!0}}))}:function(j,P){if(P){j.super_=P;var Q=function(){};Q.prototype=P.prototype,j.prototype=new Q,j.prototype.constructor=j}}},{}],11:[function(Y,Se,he){"use strict";const{isArray:W,isObject:j,isString:P}=Y("./types"),{asArray:Q}=Y("./util"),{prependBase:z}=Y("./url"),v=Y("./JsonLdError"),x=Y("./ResolvedContext");function A(y){throw new v("Invalid JSON-LD syntax; @context must be an object.","jsonld.SyntaxError",{code:"invalid local context",context:y})}function b({context:y,base:S}){if(!y)return;const T=y["@context"];if(P(T))y["@context"]=z(S,T);else if(W(T))for(let V=0;V10)throw new v("Maximum number of @context URLs exceeded.","jsonld.ContextUrlError",{code:"json-ld-1.0"===S.processingMode?"loading remote context failed":"context overflow",max:10});if(R.has(T))throw new v("Cyclical @context URLs detected.","jsonld.ContextUrlError",{code:"json-ld-1.0"===S.processingMode?"recursive context inclusion":"context overflow",url:T});let K,ce;R.add(T);try{ce=yield V(T),K=ce.document||null,P(K)&&(K=JSON.parse(K))}catch(D){throw new v("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:D})}if(!j(K))throw new v("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 K="@context"in K?{"@context":K["@context"]}:{"@context":{}},ce.contextUrl&&(W(K["@context"])||(K["@context"]=[K["@context"]]),K["@context"].push(ce.contextUrl)),{context:K,remoteDoc:ce}})()}}},{"./JsonLdError":12,"./ResolvedContext":16,"./types":30,"./url":31,"./util":32}],12:[function(Y,Se,he){"use strict";Se.exports=class extends Error{constructor(j="An unspecified JSON-LD error occurred.",P="jsonld.Error",Q={}){super(j),this.name=P,this.message=j,this.details=Q}}},{}],13:[function(Y,Se,he){"use strict";Se.exports=W=>{class j{toString(){return"[object JsonLdProcessor]"}}return Object.defineProperty(j,"prototype",{writable:!1,enumerable:!1}),Object.defineProperty(j.prototype,"constructor",{writable:!0,enumerable:!1,configurable:!0,value:j}),j.compact=function(P,Q){return arguments.length<2?Promise.reject(new TypeError("Could not compact, too few arguments.")):W.compact(P,Q)},j.expand=function(P){return arguments.length<1?Promise.reject(new TypeError("Could not expand, too few arguments.")):W.expand(P)},j.flatten=function(P){return arguments.length<1?Promise.reject(new TypeError("Could not flatten, too few arguments.")):W.flatten(P)},j}},{}],14:[function(Y,Se,he){"use strict";Se.exports=Y("rdf-canonize").NQuads},{"rdf-canonize":46}],15:[function(Y,Se,he){"use strict";Se.exports=class{constructor(){this._requests={}}wrapLoader(j){const P=this;return P._loader=j,function(){return P.add.apply(P,arguments)}}add(j){var P=this;return yt(function*(){let Q=P._requests[j];if(Q)return Promise.resolve(Q);Q=P._requests[j]=P._loader(j);try{return yield Q}finally{delete P._requests[j]}})()}}},{}],16:[function(Y,Se,he){"use strict";const W=Y("lru-cache");Se.exports=class{constructor({document:Q}){this.document=Q,this.cache=new W({max:10})}getProcessed(Q){return this.cache.get(Q)}setProcessed(Q,z){this.cache.set(Q,z)}}},{"lru-cache":33}],17:[function(Y,Se,he){"use strict";const W=Y("./JsonLdError"),{isArray:j,isObject:P,isString:Q,isUndefined:z}=Y("./types"),{isList:v,isValue:x,isGraph:O,isSimpleGraph:A,isSubjectReference:b}=Y("./graphTypes"),{expandIri:y,getContextValue:S,isKeyword:T,process:V,processingMode:R}=Y("./context"),{removeBase:K,prependBase:ce}=Y("./url"),{addValue:D,asArray:I,compareShortestLeast:X}=Y("./util"),E={};function Z(oe,se,te){if("@nest"!==y(oe,se,{vocab:!0},te))throw new W("JSON-LD compact error; nested property must have an @nest value resolving to @nest.","jsonld.SyntaxError",{code:"invalid @nest value"})}Se.exports=E,E.compact=function(){var oe=yt(function*({activeCtx:se,activeProperty:te=null,element:Ce,options:me={},compactionMap:ne=(()=>{})}){if(j(Ce)){let Ie=[];for(let Ge=0;Ge1&&(tt=Array.from(tt).sort());const Ye=se;for(const ke of tt){const Ke=E.compactIri({activeCtx:Ye,iri:ke,relativeTo:{vocab:!0}}),Me=S(st,Ke,"@context");z(Me)||(se=yield V({activeCtx:se,localCtx:Me,options:me,propagate:!1}))}const Ue=Object.keys(Ce).sort();for(const ke of Ue){const Ke=Ce[ke];if("@id"!==ke)if("@type"!==ke)if("@reverse"!==ke)if("@preserve"!==ke)if("@index"!==ke)if("@graph"!==ke&&"@list"!==ke&&"@included"!==ke&&T(ke)){const Me=E.compactIri({activeCtx:se,iri:ke,relativeTo:{vocab:!0}});D(Ge,Me,Ke)}else{if(!j(Ke))throw new W("JSON-LD expansion error; expanded value must be an array.","jsonld.SyntaxError");if(0===Ke.length){const Me=E.compactIri({activeCtx:se,iri:ke,value:Ke,relativeTo:{vocab:!0},reverse:Ie}),Ve=se.mappings.has(Me)?se.mappings.get(Me)["@nest"]:null;let $e=Ge;Ve&&(Z(se,Ve,me),P(Ge[Ve])||(Ge[Ve]={}),$e=Ge[Ve]),D($e,Me,Ke,{propertyIsArray:!0})}for(const Me of Ke){const Ve=E.compactIri({activeCtx:se,iri:ke,value:Me,relativeTo:{vocab:!0},reverse:Ie}),$e=se.mappings.has(Ve)?se.mappings.get(Ve)["@nest"]:null;let Ne=Ge;$e&&(Z(se,$e,me),P(Ge[$e])||(Ge[$e]={}),Ne=Ge[$e]);const q=S(se,Ve,"@container")||[],G=O(Me),pe=v(Me);let ue;pe?ue=Me["@list"]:G&&(ue=Me["@graph"]);let je=yield E.compact({activeCtx:se,activeProperty:Ve,element:pe||G?ue:Me,options:me,compactionMap:ne});if(pe){if(j(je)||(je=[je]),q.includes("@list")){D(Ne,Ve,je,{valueIsArray:!0,allowDuplicate:!0});continue}je={[E.compactIri({activeCtx:se,iri:"@list",relativeTo:{vocab:!0}})]:je},"@index"in Me&&(je[E.compactIri({activeCtx:se,iri:"@index",relativeTo:{vocab:!0}})]=Me["@index"])}if(G)if(q.includes("@graph")&&(q.includes("@id")||q.includes("@index")&&A(Me))){let _t;Ne.hasOwnProperty(Ve)?_t=Ne[Ve]:Ne[Ve]=_t={};const pt=(q.includes("@id")?Me["@id"]:Me["@index"])||E.compactIri({activeCtx:se,iri:"@none",relativeTo:{vocab:!0}});D(_t,pt,je,{propertyIsArray:!me.compactArrays||q.includes("@set")})}else q.includes("@graph")&&A(Me)?(j(je)&&je.length>1&&(je={"@included":je}),D(Ne,Ve,je,{propertyIsArray:!me.compactArrays||q.includes("@set")})):(j(je)&&1===je.length&&me.compactArrays&&(je=je[0]),je={[E.compactIri({activeCtx:se,iri:"@graph",relativeTo:{vocab:!0}})]:je},"@id"in Me&&(je[E.compactIri({activeCtx:se,iri:"@id",relativeTo:{vocab:!0}})]=Me["@id"]),"@index"in Me&&(je[E.compactIri({activeCtx:se,iri:"@index",relativeTo:{vocab:!0}})]=Me["@index"]),D(Ne,Ve,je,{propertyIsArray:!me.compactArrays||q.includes("@set")}));else if(q.includes("@language")||q.includes("@index")||q.includes("@id")||q.includes("@type")){let _t,pt;if(Ne.hasOwnProperty(Ve)?_t=Ne[Ve]:Ne[Ve]=_t={},q.includes("@language"))x(je)&&(je=je["@value"]),pt=Me["@language"];else if(q.includes("@index")){const ve=S(se,Ve,"@index")||"@index",L=E.compactIri({activeCtx:se,iri:ve,relativeTo:{vocab:!0}});if("@index"===ve)pt=Me["@index"],delete je[L];else{let N;if([pt,...N]=I(je[ve]||[]),Q(pt))switch(N.length){case 0:delete je[ve];break;case 1:je[ve]=N[0];break;default:je[ve]=N}else pt=null}}else if(q.includes("@id")){const ve=E.compactIri({activeCtx:se,iri:"@id",relativeTo:{vocab:!0}});pt=je[ve],delete je[ve]}else if(q.includes("@type")){const ve=E.compactIri({activeCtx:se,iri:"@type",relativeTo:{vocab:!0}});let L;switch([pt,...L]=I(je[ve]||[]),L.length){case 0:delete je[ve];break;case 1:je[ve]=L[0];break;default:je[ve]=L}1===Object.keys(je).length&&"@id"in Me&&(je=yield E.compact({activeCtx:se,activeProperty:Ve,element:{"@id":Me["@id"]},options:me,compactionMap:ne}))}pt||(pt=E.compactIri({activeCtx:se,iri:"@none",relativeTo:{vocab:!0}})),D(_t,pt,je,{propertyIsArray:q.includes("@set")})}else{const _t=!me.compactArrays||q.includes("@set")||q.includes("@list")||j(je)&&0===je.length||"@list"===ke||"@graph"===ke;D(Ne,Ve,je,{propertyIsArray:_t})}}}else{if((S(se,te,"@container")||[]).includes("@index"))continue;const Ve=E.compactIri({activeCtx:se,iri:ke,relativeTo:{vocab:!0}});D(Ge,Ve,Ke)}else{const Me=yield E.compact({activeCtx:se,activeProperty:te,element:Ke,options:me,compactionMap:ne});j(Me)&&0===Me.length||D(Ge,ke,Me)}else{const Me=yield E.compact({activeCtx:se,activeProperty:"@reverse",element:Ke,options:me,compactionMap:ne});for(const Ve in Me)if(se.mappings.has(Ve)&&se.mappings.get(Ve).reverse){const $e=Me[Ve],q=(S(se,Ve,"@container")||[]).includes("@set")||!me.compactArrays;D(Ge,Ve,$e,{propertyIsArray:q}),delete Me[Ve]}if(Object.keys(Me).length>0){const Ve=E.compactIri({activeCtx:se,iri:ke,relativeTo:{vocab:!0}});D(Ge,Ve,Me)}}else{let Me=I(Ke).map(G=>E.compactIri({activeCtx:st,iri:G,relativeTo:{vocab:!0}}));1===Me.length&&(Me=Me[0]);const Ve=E.compactIri({activeCtx:se,iri:"@type",relativeTo:{vocab:!0}}),q=(S(se,Ve,"@container")||[]).includes("@set")&&R(se,1.1)||j(Me)&&0===Ke.length;D(Ge,Ve,Me,{propertyIsArray:q})}else{let Me=I(Ke).map($e=>E.compactIri({activeCtx:se,iri:$e,relativeTo:{vocab:!1},base:me.base}));1===Me.length&&(Me=Me[0]),Ge[E.compactIri({activeCtx:se,iri:"@id",relativeTo:{vocab:!0}})]=Me}}return Ge}return Ce});return function(se){return oe.apply(this,arguments)}}(),E.compactIri=({activeCtx:oe,iri:se,value:te=null,relativeTo:Ce={vocab:!1},reverse:me=!1,base:ne=null})=>{if(null===se)return se;oe.isPropertyTermScoped&&oe.previousContext&&(oe=oe.previousContext);const _e=oe.getInverse();if(T(se)&&se in _e&&"@none"in _e[se]&&"@type"in _e[se]["@none"]&&"@none"in _e[se]["@none"]["@type"])return _e[se]["@none"]["@type"]["@none"];if(Ce.vocab&&se in _e){const tt=oe["@language"]||"@none",Ye=[];P(te)&&"@index"in te&&!("@graph"in te)&&Ye.push("@index","@index@set"),P(te)&&"@preserve"in te&&(te=te["@preserve"][0]),O(te)?("@index"in te&&Ye.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in te&&Ye.push("@graph@id","@graph@id@set"),Ye.push("@graph","@graph@set","@set"),"@index"in te||Ye.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in te||Ye.push("@graph@id","@graph@id@set")):P(te)&&!x(te)&&Ye.push("@id","@id@set","@type","@set@type");let Ue="@language",ke="@null";if(me)Ue="@type",ke="@reverse",Ye.push("@set");else if(v(te)){"@index"in te||Ye.push("@list");const Me=te["@list"];if(0===Me.length)Ue="@any",ke="@none";else{let Ve=0===Me.length?tt:null,$e=null;for(let Ne=0;Nest.includes("_"));Ge&&_e.push(Ge.replace(/^[^_]+_/,"_"))}_e.push("@none");const Ie=oe.inverse[se];for(const Ge of Ce){if(!(Ge in Ie))continue;const st=Ie[Ge][me];for(const Xe of _e)if(Xe in st)return st[Xe]}return null}(oe,se,te,Ye,Ue,ke);if(null!==Ke)return Ke}if(Ce.vocab&&"@vocab"in oe){const tt=oe["@vocab"];if(0===se.indexOf(tt)&&se!==tt){const Ye=se.substr(tt.length);if(!oe.mappings.has(Ye))return Ye}}let Ie=null;const Ge=[];let st=oe.fastCurieMap;const Xe=se.length-1;for(let tt=0;tt=0;--tt){const Ye=Ge[tt],Ue=Ye.terms;for(const ke of Ue){const Ke=ke+":"+se.substr(Ye.iri.length);oe.mappings.get(ke)._prefix&&(!oe.mappings.has(Ke)||null===te&&oe.mappings.get(Ke)["@id"]===se)&&(null===Ie||X(Ke,Ie)<0)&&(Ie=Ke)}}if(null!==Ie)return Ie;for(const[tt,Ye]of oe.mappings)if(Ye&&Ye._prefix&&se.startsWith(tt+":"))throw new W(`Absolute IRI "${se}" confused with prefix "${tt}".`,"jsonld.SyntaxError",{code:"IRI confused with prefix",context:oe});return Ce.vocab?se:"@base"in oe?oe["@base"]?K(ce(ne,oe["@base"]),se):se:K(ne,se)},E.compactValue=({activeCtx:oe,activeProperty:se,value:te,options:Ce})=>{if(x(te)){const Ie=S(oe,se,"@type"),Ge=S(oe,se,"@language"),st=S(oe,se,"@direction"),Xe=S(oe,se,"@container")||[],tt="@index"in te&&!Xe.includes("@index");if(!tt&&"@none"!==Ie&&(te["@type"]===Ie||"@language"in te&&te["@language"]===Ge&&"@direction"in te&&te["@direction"]===st||"@language"in te&&te["@language"]===Ge||"@direction"in te&&te["@direction"]===st))return te["@value"];const Ye=Object.keys(te).length,Ue=1===Ye||2===Ye&&"@index"in te&&!tt,ke="@language"in oe,Ke=Q(te["@value"]),Me=oe.mappings.has(se)&&null===oe.mappings.get(se)["@language"];if(Ue&&"@none"!==Ie&&(!ke||!Ke||Me))return te["@value"];const Ve={};return tt&&(Ve[E.compactIri({activeCtx:oe,iri:"@index",relativeTo:{vocab:!0}})]=te["@index"]),"@type"in te?Ve[E.compactIri({activeCtx:oe,iri:"@type",relativeTo:{vocab:!0}})]=E.compactIri({activeCtx:oe,iri:te["@type"],relativeTo:{vocab:!0}}):"@language"in te&&(Ve[E.compactIri({activeCtx:oe,iri:"@language",relativeTo:{vocab:!0}})]=te["@language"]),"@direction"in te&&(Ve[E.compactIri({activeCtx:oe,iri:"@direction",relativeTo:{vocab:!0}})]=te["@direction"]),Ve[E.compactIri({activeCtx:oe,iri:"@value",relativeTo:{vocab:!0}})]=te["@value"],Ve}const me=y(oe,se,{vocab:!0},Ce),ne=S(oe,se,"@type"),_e=E.compactIri({activeCtx:oe,iri:te["@id"],relativeTo:{vocab:"@vocab"===ne},base:Ce.base});return"@id"===ne||"@vocab"===ne||"@graph"===me?_e:{[E.compactIri({activeCtx:oe,iri:"@id",relativeTo:{vocab:!0}})]:_e}}},{"./JsonLdError":12,"./context":19,"./graphTypes":25,"./types":30,"./url":31,"./util":32}],18:[function(Y,Se,he){"use strict";const W="http://www.w3.org/1999/02/22-rdf-syntax-ns#",j="http://www.w3.org/2001/XMLSchema#";Se.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:j,XSD_BOOLEAN:j+"boolean",XSD_DOUBLE:j+"double",XSD_INTEGER:j+"integer",XSD_STRING:j+"string"}},{}],19:[function(Y,Se,he){"use strict";const W=Y("./util"),j=Y("./JsonLdError"),{isArray:P,isObject:Q,isString:z,isUndefined:v}=Y("./types"),{isAbsolute:x,isRelative:O,prependBase:A}=Y("./url"),{asArray:b,compareShortestLeast:y}=Y("./util"),S=new Map,V=/^@[a-zA-Z]+$/,R={};function K(D,I,X,E,$,Z){if(null===I||!z(I)||R.isKeyword(I))return I;if(I.match(V))return null;if(E&&E.hasOwnProperty(I)&&!0!==$.get(I)&&R.createTermDefinition({activeCtx:D,localCtx:E,term:I,defined:$,options:Z}),(X=X||{}).vocab){const se=D.mappings.get(I);if(null===se)return null;if(Q(se)&&"@id"in se)return se["@id"]}const oe=I.indexOf(":");if(oe>0){const se=I.substr(0,oe),te=I.substr(oe+1);if("_"===se||0===te.indexOf("//"))return I;E&&E.hasOwnProperty(se)&&R.createTermDefinition({activeCtx:D,localCtx:E,term:se,defined:$,options:Z});const Ce=D.mappings.get(se);if(Ce&&Ce._prefix)return Ce["@id"]+te;if(x(I))return I}if(X.vocab&&"@vocab"in D)return D["@vocab"]+I;if(X.base&&"@base"in D){if(D["@base"])return A(A(Z.base,D["@base"]),I)}else if(X.base)return A(Z.base,I);return I}function ce(D,I){if(!D||"object"!=typeof D||!I||"object"!=typeof I)return D===I;const X=Array.isArray(D);if(X!==Array.isArray(I))return!1;if(X){if(D.length!==I.length)return!1;for(let Z=0;Z{if(E.has(X)){if(E.get(X))return;throw new j("Cyclical context definition detected.","jsonld.CyclicalContext",{code:"cyclic IRI mapping",context:I,term:X})}let oe;if(E.set(X,!1),I.hasOwnProperty(X)&&(oe=I[X]),"@type"===X&&Q(oe)&&"@set"===(oe["@container"]||"@set")&&R.processingMode(D,1.1)){const Ie=["@container","@id","@protected"],Ge=Object.keys(oe);if(0===Ge.length||Ge.some(st=>!Ie.includes(st)))throw new j("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:I,term:X})}else{if(R.isKeyword(X))throw new j("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:I,term:X});if(X.match(V))return void console.warn('WARNING: terms beginning with "@" are reserved for future use and ignored',{term:X});if(""===X)throw new j("Invalid JSON-LD syntax; a term cannot be an empty string.","jsonld.SyntaxError",{code:"invalid term definition",context:I})}const se=D.mappings.get(X);D.mappings.has(X)&&D.mappings.delete(X);let te=!1;if((z(oe)||null===oe)&&(te=!0,oe={"@id":oe}),!Q(oe))throw new j("Invalid JSON-LD syntax; @context term values must be strings or objects.","jsonld.SyntaxError",{code:"invalid term definition",context:I});const Ce={};D.mappings.set(X,Ce),Ce.reverse=!1;const me=["@container","@id","@language","@reverse","@type"];R.processingMode(D,1.1)&&me.push("@context","@direction","@index","@nest","@prefix","@protected");for(const Ie in oe)if(!me.includes(Ie))throw new j("Invalid JSON-LD syntax; a term definition must not contain "+Ie,"jsonld.SyntaxError",{code:"invalid term definition",context:I});const ne=X.indexOf(":");if(Ce._termHasColon=ne>0,"@reverse"in oe){if("@id"in oe)throw new j("Invalid JSON-LD syntax; a @reverse term definition must not contain @id.","jsonld.SyntaxError",{code:"invalid reverse property",context:I});if("@nest"in oe)throw new j("Invalid JSON-LD syntax; a @reverse term definition must not contain @nest.","jsonld.SyntaxError",{code:"invalid reverse property",context:I});const Ie=oe["@reverse"];if(!z(Ie))throw new j("Invalid JSON-LD syntax; a @context @reverse value must be a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:I});if(!R.isKeyword(Ie)&&Ie.match(V))return console.warn('WARNING: values beginning with "@" are reserved for future use and ignored',{reverse:Ie}),void(se?D.mappings.set(X,se):D.mappings.delete(X));const Ge=K(D,Ie,{vocab:!0,base:!1},I,E,$);if(!x(Ge))throw new j("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});Ce["@id"]=Ge,Ce.reverse=!0}else if("@id"in oe){let Ie=oe["@id"];if(Ie&&!z(Ie))throw new j("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===Ie)Ce["@id"]=null;else{if(!R.isKeyword(Ie)&&Ie.match(V))return console.warn('WARNING: values beginning with "@" are reserved for future use and ignored',{id:Ie}),void(se?D.mappings.set(X,se):D.mappings.delete(X));if(Ie!==X){if(Ie=K(D,Ie,{vocab:!0,base:!1},I,E,$),!x(Ie)&&!R.isKeyword(Ie))throw new j("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(X.match(/(?::[^:])|\//)&&K(D,X,{vocab:!0,base:!1},I,new Map(E).set(X,!0),$)!==Ie)throw new j("Invalid JSON-LD syntax; term in form of IRI must expand to definition.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:I});Ce["@id"]=Ie,Ce._prefix=te&&!Ce._termHasColon&&Ie.match(/[:\/\?#\[\]@]$/)}}}if(!("@id"in Ce))if(Ce._termHasColon){const Ie=X.substr(0,ne);if(I.hasOwnProperty(Ie)&&R.createTermDefinition({activeCtx:D,localCtx:I,term:Ie,defined:E,options:$}),D.mappings.has(Ie)){const Ge=X.substr(ne+1);Ce["@id"]=D.mappings.get(Ie)["@id"]+Ge}else Ce["@id"]=X}else if("@type"===X)Ce["@id"]=X;else{if(!("@vocab"in D))throw new j("Invalid JSON-LD syntax; @context terms must define an @id.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:I,term:X});Ce["@id"]=D["@vocab"]+X}if((!0===oe["@protected"]||!0===E.get("@protected")&&!1!==oe["@protected"])&&(D.protected[X]=!0,Ce.protected=!0),E.set(X,!0),"@type"in oe){let Ie=oe["@type"];if(!z(Ie))throw new j("Invalid JSON-LD syntax; an @context @type value must be a string.","jsonld.SyntaxError",{code:"invalid type mapping",context:I});if("@json"===Ie||"@none"===Ie){if(R.processingMode(D,1))throw new j(`Invalid JSON-LD syntax; an @context @type value must not be "${Ie}" in JSON-LD 1.0 mode.`,"jsonld.SyntaxError",{code:"invalid type mapping",context:I})}else if("@id"!==Ie&&"@vocab"!==Ie){if(Ie=K(D,Ie,{vocab:!0,base:!1},I,E,$),!x(Ie))throw new j("Invalid JSON-LD syntax; an @context @type value must be an absolute IRI.","jsonld.SyntaxError",{code:"invalid type mapping",context:I});if(0===Ie.indexOf("_:"))throw new j("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})}Ce["@type"]=Ie}if("@container"in oe){const Ie=z(oe["@container"])?[oe["@container"]]:oe["@container"]||[],Ge=["@list","@set","@index","@language"];let st=!0;const Xe=Ie.includes("@set");if(R.processingMode(D,1.1)){if(Ge.push("@graph","@id","@type"),Ie.includes("@list")){if(1!==Ie.length)throw new j("Invalid JSON-LD syntax; @context @container with @list must have no other values","jsonld.SyntaxError",{code:"invalid container mapping",context:I})}else if(Ie.includes("@graph")){if(Ie.some(tt=>"@graph"!==tt&&"@id"!==tt&&"@index"!==tt&&"@set"!==tt))throw new j("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 st&=Ie.length<=(Xe?2:1);if(Ie.includes("@type")&&(Ce["@type"]=Ce["@type"]||"@id",!["@id","@vocab"].includes(Ce["@type"])))throw new j("Invalid JSON-LD syntax; container: @type requires @type to be @id or @vocab.","jsonld.SyntaxError",{code:"invalid type mapping",context:I})}else st&=!P(oe["@container"]),st&=Ie.length<=1;if(st&=Ie.every(tt=>Ge.includes(tt)),st&=!(Xe&&Ie.includes("@list")),!st)throw new j("Invalid JSON-LD syntax; @context @container value must be one of the following: "+Ge.join(", "),"jsonld.SyntaxError",{code:"invalid container mapping",context:I});if(Ce.reverse&&!Ie.every(tt=>["@index","@set"].includes(tt)))throw new j("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});Ce["@container"]=Ie}if("@index"in oe){if(!("@container"in oe)||!Ce["@container"].includes("@index"))throw new j(`Invalid JSON-LD syntax; @index without @index in @container: "${oe["@index"]}" on term "${X}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:I});if(!z(oe["@index"])||0===oe["@index"].indexOf("@"))throw new j(`Invalid JSON-LD syntax; @index must expand to an IRI: "${oe["@index"]}" on term "${X}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:I});Ce["@index"]=oe["@index"]}if("@context"in oe&&(Ce["@context"]=oe["@context"]),"@language"in oe&&!("@type"in oe)){let Ie=oe["@language"];if(null!==Ie&&!z(Ie))throw new j("Invalid JSON-LD syntax; @context @language value must be a string or null.","jsonld.SyntaxError",{code:"invalid language mapping",context:I});null!==Ie&&(Ie=Ie.toLowerCase()),Ce["@language"]=Ie}if("@prefix"in oe){if(X.match(/:|\//))throw new j("Invalid JSON-LD syntax; @context @prefix used on a compact IRI term","jsonld.SyntaxError",{code:"invalid term definition",context:I});if(R.isKeyword(Ce["@id"]))throw new j("Invalid JSON-LD syntax; keywords may not be used as prefixes","jsonld.SyntaxError",{code:"invalid term definition",context:I});if("boolean"!=typeof oe["@prefix"])throw new j("Invalid JSON-LD syntax; @context value for @prefix must be boolean","jsonld.SyntaxError",{code:"invalid @prefix value",context:I});Ce._prefix=!0===oe["@prefix"]}if("@direction"in oe){const Ie=oe["@direction"];if(null!==Ie&&"ltr"!==Ie&&"rtl"!==Ie)throw new j('Invalid JSON-LD syntax; @direction value must be null, "ltr", or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",context:I});Ce["@direction"]=Ie}if("@nest"in oe){const Ie=oe["@nest"];if(!z(Ie)||"@nest"!==Ie&&0===Ie.indexOf("@"))throw new j("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});Ce["@nest"]=Ie}const _e=Ce["@id"];if("@context"===_e||"@preserve"===_e)throw new j("Invalid JSON-LD syntax; @context and @preserve cannot be aliased.","jsonld.SyntaxError",{code:"invalid keyword alias",context:I});if(se&&se.protected&&!Z&&(D.protected[X]=!0,Ce.protected=!0,!ce(se,Ce))){const Ie=$&&$.protectedMode||"error";if("error"===Ie)throw new j(`Invalid JSON-LD syntax; tried to redefine "${X}" which is a protected term.`,"jsonld.SyntaxError",{code:"protected term redefinition",context:I,term:X});if("warn"===Ie)return void console.warn("WARNING: protected term redefinition",{term:X});throw new j("Invalid protectedMode.","jsonld.SyntaxError",{code:"invalid protected mode",context:I,term:X,protectedMode:Ie})}},R.expandIri=(D,I,X,E)=>K(D,I,X,void 0,void 0,E),R.getInitialContext=D=>{const I=JSON.stringify({processingMode:D.processingMode}),X=S.get(I);if(X)return X;const E={processingMode:D.processingMode,mappings:new Map,inverse:null,getInverse:function(){const Ce=this;if(Ce.inverse)return Ce.inverse;const me=Ce.inverse={},ne=Ce.fastCurieMap={},_e={},Ie=(Ce["@language"]||"@none").toLowerCase(),Ge=Ce["@direction"],st=Ce.mappings,Xe=[...st.keys()].sort(y);for(const tt of Xe){const Ye=st.get(tt);if(null===Ye)continue;let Ue=Ye["@container"]||"@none";if(Ue=[].concat(Ue).sort().join(""),null===Ye["@id"])continue;const ke=b(Ye["@id"]);for(const Ke of ke){let Me=me[Ke];const Ve=R.isKeyword(Ke);if(Me)!Ve&&!Ye._termHasColon&&_e[Ke].push(tt);else if(me[Ke]=Me={},!Ve&&!Ye._termHasColon){_e[Ke]=[tt];const $e={iri:Ke,terms:_e[Ke]};Ke[0]in ne?ne[Ke[0]].push($e):ne[Ke[0]]=[$e]}if(Me[Ue]||(Me[Ue]={"@language":{},"@type":{},"@any":{}}),Me=Me[Ue],oe(tt,Me["@any"],"@none"),Ye.reverse)oe(tt,Me["@type"],"@reverse");else if("@none"===Ye["@type"])oe(tt,Me["@any"],"@none"),oe(tt,Me["@language"],"@none"),oe(tt,Me["@type"],"@none");else if("@type"in Ye)oe(tt,Me["@type"],Ye["@type"]);else if("@language"in Ye&&"@direction"in Ye){const $e=Ye["@language"],Ne=Ye["@direction"];oe(tt,Me["@language"],$e&&Ne?`${$e}_${Ne}`.toLowerCase():$e?$e.toLowerCase():Ne?`_${Ne}`:"@null")}else"@language"in Ye?oe(tt,Me["@language"],(Ye["@language"]||"@null").toLowerCase()):"@direction"in Ye?oe(tt,Me["@language"],Ye["@direction"]?`_${Ye["@direction"]}`:"@none"):Ge?(oe(tt,Me["@language"],`_${Ge}`),oe(tt,Me["@language"],"@none"),oe(tt,Me["@type"],"@none")):(oe(tt,Me["@language"],Ie),oe(tt,Me["@language"],"@none"),oe(tt,Me["@type"],"@none"))}}for(const tt in ne)Z(ne,tt,1);return me},clone:function(){const Ce={};return Ce.mappings=W.clone(this.mappings),Ce.clone=this.clone,Ce.inverse=null,Ce.getInverse=this.getInverse,Ce.protected=W.clone(this.protected),this.previousContext&&(Ce.previousContext=this.previousContext.clone()),Ce.revertToPreviousContext=this.revertToPreviousContext,"@base"in this&&(Ce["@base"]=this["@base"]),"@language"in this&&(Ce["@language"]=this["@language"]),"@vocab"in this&&(Ce["@vocab"]=this["@vocab"]),Ce},revertToPreviousContext:function(){return this.previousContext?this.previousContext.clone():this},protected:{}};return 1e4===S.size&&S.clear(),S.set(I,E),E;function Z(Ce,me,ne){const _e=Ce[me],Ie=Ce[me]={};let Ge,st;for(const Xe of _e)Ge=Xe.iri,st=ne>=Ge.length?"":Ge[ne],st in Ie?Ie[st].push(Xe):Ie[st]=[Xe];for(const Xe in Ie)""!==Xe&&Z(Ie,Xe,ne+1)}function oe(Ce,me,ne){me.hasOwnProperty(ne)||(me[ne]=Ce)}},R.getContextValue=(D,I,X)=>{if(null===I)return"@context"===X?void 0:null;if(D.mappings.has(I)){const E=D.mappings.get(I);if(v(X))return E;if(E.hasOwnProperty(X))return E[X]}return"@language"===X&&X in D||"@direction"===X&&X in D?D[X]:"@context"!==X?null:void 0},R.processingMode=(D,I)=>I.toString()>="1.1"?!D.processingMode||D.processingMode>="json-ld-"+I.toString():"json-ld-1.0"===D.processingMode,R.isKeyword=D=>{if(!z(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(Y,Se,he){"use strict";const{parseLinkHeader:W,buildHeaders:j}=Y("../util"),{LINK_HEADER_CONTEXT:P}=Y("../constants"),Q=Y("../JsonLdError"),z=Y("../RequestQueue"),{prependBase:v}=Y("../url"),x=/(^|(\r\n))link:/i;function O(A,b,y){const S=new(A=A||XMLHttpRequest);return new Promise((T,V)=>{S.onload=()=>T(S),S.onerror=R=>V(R),S.open("GET",b,!0);for(const R in y)S.setRequestHeader(R,y[R]);S.send()})}Se.exports=({secure:A,headers:b={},xhr:y}={headers:{}})=>{return b=j(b),(new z).wrapLoader(T);function T(R){return V.apply(this,arguments)}function V(){return(V=yt(function*(R){if(0!==R.indexOf("http:")&&0!==R.indexOf("https:"))throw new Q('URL could not be dereferenced; only "http" and "https" URLs are supported.',"jsonld.InvalidUrl",{code:"loading document failed",url:R});if(A&&0!==R.indexOf("https"))throw new Q('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 K;try{K=yield O(y,R,b)}catch(E){throw new Q("URL could not be dereferenced, an error occurred.","jsonld.LoadDocumentError",{code:"loading document failed",url:R,cause:E})}if(K.status>=400)throw new Q("URL could not be dereferenced: "+K.statusText,"jsonld.LoadDocumentError",{code:"loading document failed",url:R,httpStatusCode:K.status});let ce={contextUrl:null,documentUrl:R,document:K.response},D=null;const I=K.getResponseHeader("Content-Type");let X;if(x.test(K.getAllResponseHeaders())&&(X=K.getResponseHeader("Link")),X&&"application/ld+json"!==I){const E=W(X),$=E[P];if(Array.isArray($))throw new Q("URL could not be dereferenced, it has more than one associated HTTP Link Header.","jsonld.InvalidUrl",{code:"multiple context link headers",url:R});$&&(ce.contextUrl=$.target),D=E.alternate,D&&"application/ld+json"==D.type&&!(I||"").match(/^application\/(\w*\+)?json$/)&&(ce=yield T(v(R,D.target)))}return ce})).apply(this,arguments)}}},{"../JsonLdError":12,"../RequestQueue":15,"../constants":18,"../url":31,"../util":32}],21:[function(Y,Se,he){"use strict";const W=Y("./JsonLdError"),{isArray:j,isObject:P,isEmptyObject:Q,isString:z,isUndefined:v}=Y("./types"),{isList:x,isValue:O,isGraph:A,isSubject:b}=Y("./graphTypes"),{expandIri:y,getContextValue:S,isKeyword:T,process:V,processingMode:R}=Y("./context"),{isAbsolute:K}=Y("./url"),{addValue:ce,asArray:D,getValues:I,validateTypeValue:X}=Y("./util"),E={};Se.exports=E;const $=/^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$/;function Z(ne){return oe.apply(this,arguments)}function oe(){return(oe=yt(function*({activeCtx:ne,activeProperty:_e,expandedActiveProperty:Ie,element:Ge,expandedParent:st,options:Xe={},insideList:tt,typeKey:Ye,typeScopedContext:Ue,expansionMap:ke}){const Ke=Object.keys(Ge).sort(),Me=[];let Ve;const $e=Ge[Ye]&&"@json"===y(ne,j(Ge[Ye])?Ge[Ye][0]:Ge[Ye],{vocab:!0},Xe);for(const Ne of Ke){let G,q=Ge[Ne];if("@context"===Ne)continue;let pe=y(ne,Ne,{vocab:!0},Xe);if((null===pe||!K(pe)&&!T(pe))&&(pe=ke({unmappedProperty:Ne,activeCtx:ne,activeProperty:_e,parent:Ge,options:Xe,insideList:tt,value:q,expandedParent:st}),void 0===pe))continue;if(T(pe)){if("@reverse"===Ie)throw new W("Invalid JSON-LD syntax; a keyword cannot be used as a @reverse property.","jsonld.SyntaxError",{code:"invalid reverse property map",value:q});if(pe in st&&"@included"!==pe&&"@type"!==pe)throw new W("Invalid JSON-LD syntax; colliding keywords detected.","jsonld.SyntaxError",{code:"colliding keywords",keyword:pe})}if("@id"===pe){if(!z(q)){if(!Xe.isFrame)throw new W('Invalid JSON-LD syntax; "@id" value must a string.',"jsonld.SyntaxError",{code:"invalid @id value",value:q});if(P(q)){if(!Q(q))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:q})}else{if(!j(q))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:q});if(!q.every(pt=>z(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:q})}}ce(st,"@id",D(q).map(pt=>z(pt)?y(ne,pt,{base:!0},Xe):pt),{propertyIsArray:Xe.isFrame});continue}if("@type"===pe){P(q)&&(q=Object.fromEntries(Object.entries(q).map(([pt,ve])=>[y(Ue,pt,{vocab:!0}),D(ve).map(L=>y(Ue,L,{base:!0,vocab:!0}))]))),X(q,Xe.isFrame),ce(st,"@type",D(q).map(pt=>z(pt)?y(Ue,pt,{base:!0,vocab:!0},Xe):pt),{propertyIsArray:Xe.isFrame});continue}if("@included"===pe&&R(ne,1.1)){const pt=D(yield E.expand({activeCtx:ne,activeProperty:_e,element:q,options:Xe,expansionMap:ke}));if(!pt.every(ve=>b(ve)))throw new W("Invalid JSON-LD syntax; values of @included must expand to node objects.","jsonld.SyntaxError",{code:"invalid @included value",value:q});ce(st,"@included",pt,{propertyIsArray:!0});continue}if("@graph"===pe&&!P(q)&&!j(q))throw new W('Invalid JSON-LD syntax; "@graph" value must not be an object or an array.',"jsonld.SyntaxError",{code:"invalid @graph value",value:q});if("@value"===pe){Ve=q,$e&&R(ne,1.1)?st["@value"]=q:ce(st,"@value",q,{propertyIsArray:Xe.isFrame});continue}if("@language"===pe){if(null===q)continue;if(!z(q)&&!Xe.isFrame)throw new W('Invalid JSON-LD syntax; "@language" value must be a string.',"jsonld.SyntaxError",{code:"invalid language-tagged string",value:q});q=D(q).map(pt=>z(pt)?pt.toLowerCase():pt);for(const pt of q)z(pt)&&!pt.match($)&&console.warn(`@language must be valid BCP47: ${pt}`);ce(st,"@language",q,{propertyIsArray:Xe.isFrame});continue}if("@direction"===pe){if(!z(q)&&!Xe.isFrame)throw new W('Invalid JSON-LD syntax; "@direction" value must be a string.',"jsonld.SyntaxError",{code:"invalid base direction",value:q});q=D(q);for(const pt of q)if(z(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:q});ce(st,"@direction",q,{propertyIsArray:Xe.isFrame});continue}if("@index"===pe){if(!z(q))throw new W('Invalid JSON-LD syntax; "@index" value must be a string.',"jsonld.SyntaxError",{code:"invalid @index value",value:q});ce(st,"@index",q);continue}if("@reverse"===pe){if(!P(q))throw new W('Invalid JSON-LD syntax; "@reverse" value must be an object.',"jsonld.SyntaxError",{code:"invalid @reverse value",value:q});if(G=yield E.expand({activeCtx:ne,activeProperty:"@reverse",element:q,options:Xe,expansionMap:ke}),"@reverse"in G)for(const ve in G["@reverse"])ce(st,ve,G["@reverse"][ve],{propertyIsArray:!0});let pt=st["@reverse"]||null;for(const ve in G){if("@reverse"===ve)continue;null===pt&&(pt=st["@reverse"]={}),ce(pt,ve,[],{propertyIsArray:!0});const L=G[ve];for(let N=0;N"@id"===pt||"@index"===pt)&&(G=D(G).map(pt=>({"@graph":D(pt)}))),ue.mappings.has(Ne)&&ue.mappings.get(Ne).reverse){const pt=st["@reverse"]=st["@reverse"]||{};G=D(G);for(let ve=0;ve"@value"===y(ne,pe,{vocab:!0},Xe)))throw new W("Invalid JSON-LD syntax; nested value must be a node object.","jsonld.SyntaxError",{code:"invalid @nest value",value:G});yield Z({activeCtx:ne,activeProperty:_e,expandedActiveProperty:Ie,element:G,expandedParent:st,options:Xe,insideList:tt,typeScopedContext:Ue,typeKey:Ye,expansionMap:ke})}}})).apply(this,arguments)}function se({activeCtx:ne,activeProperty:_e,value:Ie,options:Ge}){if(null==Ie)return null;const st=y(ne,_e,{vocab:!0},Ge);if("@id"===st)return y(ne,Ie,{base:!0},Ge);if("@type"===st)return y(ne,Ie,{vocab:!0,base:!0},Ge);const Xe=S(ne,_e,"@type");if(("@id"===Xe||"@graph"===st)&&z(Ie))return{"@id":y(ne,Ie,{base:!0},Ge)};if("@vocab"===Xe&&z(Ie))return{"@id":y(ne,Ie,{vocab:!0,base:!0},Ge)};if(T(st))return Ie;const tt={};if(Xe&&!["@id","@vocab","@none"].includes(Xe))tt["@type"]=Xe;else if(z(Ie)){const Ye=S(ne,_e,"@language");null!==Ye&&(tt["@language"]=Ye);const Ue=S(ne,_e,"@direction");null!==Ue&&(tt["@direction"]=Ue)}return["boolean","number","string"].includes(typeof Ie)||(Ie=Ie.toString()),tt["@value"]=Ie,tt}function te(ne,_e,Ie,Ge){const st=[],Xe=Object.keys(_e).sort();for(const tt of Xe){const Ye=y(ne,tt,{vocab:!0},Ge);let Ue=_e[tt];j(Ue)||(Ue=[Ue]);for(const ke of Ue){if(null===ke)continue;if(!z(ke))throw new W("Invalid JSON-LD syntax; language map values must be strings.","jsonld.SyntaxError",{code:"invalid language map value",languageMap:_e});const Ke={"@value":ke};"@none"!==Ye&&(Ke["@language"]=tt.toLowerCase()),Ie&&(Ke["@direction"]=Ie),st.push(Ke)}}return st}function Ce(ne){return me.apply(this,arguments)}function me(){return(me=yt(function*({activeCtx:ne,options:_e,activeProperty:Ie,value:Ge,expansionMap:st,asGraph:Xe,indexKey:tt,propertyIndex:Ye}){const Ue=[],ke=Object.keys(Ge).sort(),Ke="@type"===tt;for(let Me of ke){if(Ke){const Ne=S(ne,Me,"@context");v(Ne)||(ne=yield V({activeCtx:ne,localCtx:Ne,propagate:!1,options:_e}))}let $e,Ve=Ge[Me];j(Ve)||(Ve=[Ve]),Ve=yield E.expand({activeCtx:ne,activeProperty:Ie,element:Ve,options:_e,insideList:!1,insideIndex:!0,expansionMap:st}),$e=Ye?"@none"===Me?"@none":se({activeCtx:ne,activeProperty:tt,value:Me,options:_e}):y(ne,Me,{vocab:!0},_e),"@id"===tt?Me=y(ne,Me,{base:!0},_e):Ke&&(Me=$e);for(let Ne of Ve){if(Xe&&!A(Ne)&&(Ne={"@graph":[Ne]}),"@type"===tt)"@none"===$e||(Ne["@type"]=Ne["@type"]?[Me].concat(Ne["@type"]):[Me]);else{if(O(Ne)&&!["@language","@type","@index"].includes(tt))throw new W(`Invalid JSON-LD syntax; Attempt to add illegal key to value object: "${tt}".`,"jsonld.SyntaxError",{code:"invalid value object",value:Ne});Ye?"@none"!==$e&&ce(Ne,Ye,$e,{propertyIsArray:!0,prependValue:!0}):"@none"!==$e&&!(tt in Ne)&&(Ne[tt]=Me)}Ue.push(Ne)}}return Ue})).apply(this,arguments)}E.expand=function(){var ne=yt(function*({activeCtx:_e,activeProperty:Ie=null,element:Ge,options:st={},insideList:Xe=!1,insideIndex:tt=!1,typeScopedContext:Ye=null,expansionMap:Ue=(()=>{})}){if(null==Ge)return null;if("@default"===Ie&&(st=Object.assign({},st,{isFrame:!1})),!j(Ge)&&!P(Ge)){if(!Xe&&(null===Ie||"@graph"===y(_e,Ie,{vocab:!0},st))){const G=yield Ue({unmappedValue:Ge,activeCtx:_e,activeProperty:Ie,options:st,insideList:Xe});return void 0===G?null:G}return se({activeCtx:_e,activeProperty:Ie,value:Ge,options:st})}if(j(Ge)){let G=[];const pe=S(_e,Ie,"@container")||[];Xe=Xe||pe.includes("@list");for(let ue=0;ue1?ue.slice().sort():ue:[ue];for(const _t of je){const pt=S(Ye,_t,"@context");v(pt)||(_e=yield V({activeCtx:_e,localCtx:pt,options:st,propagate:!1}))}}let Ne={};yield Z({activeCtx:_e,activeProperty:Ie,expandedActiveProperty:ke,element:Ge,expandedParent:Ne,options:st,insideList:Xe,typeKey:$e,typeScopedContext:Ye,expansionMap:Ue}),Me=Object.keys(Ne);let q=Me.length;if("@value"in Ne){if("@type"in Ne&&("@language"in Ne||"@direction"in Ne))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:Ne});let G=q-1;if("@type"in Ne&&(G-=1),"@index"in Ne&&(G-=1),"@language"in Ne&&(G-=1),"@direction"in Ne&&(G-=1),0!==G)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:Ne});const pe=null===Ne["@value"]?[]:D(Ne["@value"]),ue=I(Ne,"@type");if(!R(_e,1.1)||!ue.includes("@json")||1!==ue.length)if(0===pe.length){const je=yield Ue({unmappedValue:Ne,activeCtx:_e,activeProperty:Ie,element:Ge,options:st,insideList:Xe});Ne=void 0!==je?je:null}else{if(!pe.every(je=>z(je)||Q(je))&&"@language"in Ne)throw new W("Invalid JSON-LD syntax; only strings may be language-tagged.","jsonld.SyntaxError",{code:"invalid language-tagged value",element:Ne});if(!ue.every(je=>K(je)&&!(z(je)&&0===je.indexOf("_:"))||Q(je)))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:Ne})}}else if("@type"in Ne&&!j(Ne["@type"]))Ne["@type"]=[Ne["@type"]];else if("@set"in Ne||"@list"in Ne){if(q>1&&(2!==q||!("@index"in Ne)))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:Ne});"@set"in Ne&&(Ne=Ne["@set"],Me=Object.keys(Ne),q=Me.length)}else if(1===q&&"@language"in Ne){const G=yield Ue(Ne,{unmappedValue:Ne,activeCtx:_e,activeProperty:Ie,element:Ge,options:st,insideList:Xe});Ne=void 0!==G?G:null}if(P(Ne)&&!st.keepFreeFloatingNodes&&!Xe&&(null===Ie||"@graph"===ke)&&(0===q||"@value"in Ne||"@list"in Ne||1===q&&"@id"in Ne)){const G=yield Ue({unmappedValue:Ne,activeCtx:_e,activeProperty:Ie,element:Ge,options:st,insideList:Xe});Ne=void 0!==G?G:null}return Ne});return function(_e){return ne.apply(this,arguments)}}()},{"./JsonLdError":12,"./context":19,"./graphTypes":25,"./types":30,"./url":31,"./util":32}],22:[function(Y,Se,he){"use strict";const{isSubjectReference:W}=Y("./graphTypes"),{createMergedNodeMap:j}=Y("./nodeMap"),P={};Se.exports=P,P.flatten=Q=>{const z=j(Q),v=[],x=Object.keys(z).sort();for(let O=0;O=0;--oe){const se=Z[oe];if(se.graph===$&&se.subject["@id"]===E["@id"])return!0}return!1}function S(E,$,Z){const oe="@"+Z;let se=oe in E?E[oe][0]:$[Z];if("embed"===Z)if(!0===se)se="@once";else if(!1===se)se="@never";else if("@always"!==se&&"@never"!==se&&"@link"!==se&&"@first"!==se&&"@last"!==se&&"@once"!==se)throw new v("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:E});return se}function T(E){if(!P.isArray(E)||1!==E.length||!P.isObject(E[0]))throw new v("Invalid JSON-LD syntax; a JSON-LD frame must be a single object.","jsonld.SyntaxError",{frame:E});if("@id"in E[0])for(const $ of Q.asArray(E[0]["@id"]))if(!P.isObject($)&&!z.isAbsolute($)||P.isString($)&&0===$.indexOf("_:"))throw new v("Invalid JSON-LD syntax; invalid @id in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:E});if("@type"in E[0])for(const $ of Q.asArray(E[0]["@type"]))if(!P.isObject($)&&!z.isAbsolute($)||P.isString($)&&0===$.indexOf("_:"))throw new v("Invalid JSON-LD syntax; invalid @type in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:E})}function R(E,$,Z,oe){let se=!0,te=!1;for(const Ce in Z){let me=!1;const ne=Q.getValues($,Ce),_e=0===Q.getValues(Z,Ce).length;if("@id"===Ce){if(P.isEmptyObject(Z["@id"][0]||{})?me=!0:Z["@id"].length>=0&&(me=Z["@id"].includes(ne[0])),!oe.requireAll)return me}else if("@type"===Ce){if(se=!1,_e){if(ne.length>0)return!1;me=!0}else if(1===Z["@type"].length&&P.isEmptyObject(Z["@type"][0]))me=ne.length>0;else for(const Ie of Z["@type"])me=!(!P.isObject(Ie)||!("@default"in Ie))||me||ne.some(Ge=>Ge===Ie);if(!oe.requireAll)return me}else{if(W(Ce))continue;{const Ie=Q.getValues(Z,Ce)[0];let Ge=!1;if(Ie&&(T([Ie]),Ge="@default"in Ie),se=!1,0===ne.length&&Ge)continue;if(ne.length>0&&_e)return!1;if(void 0===Ie){if(ne.length>0)return!1;me=!0}else if(j.isList(Ie)){const st=Ie["@list"][0];if(j.isList(ne[0])){const Xe=ne[0]["@list"];j.isValue(st)?me=Xe.some(tt=>X(st,tt)):(j.isSubject(st)||j.isSubjectReference(st))&&(me=Xe.some(tt=>I(E,st,tt,oe)))}}else me=j.isValue(Ie)?ne.some(st=>X(Ie,st)):j.isSubjectReference(Ie)?ne.some(st=>I(E,Ie,st,oe)):!!P.isObject(Ie)&&ne.length>0}}if(!me&&oe.requireAll)return!1;te=te||me}return se||te}function K(E,$){const Z=E.uniqueEmbeds[E.graph],oe=Z[$],se=oe.parent,te=oe.property,Ce={"@id":$};if(P.isArray(se)){for(let ne=0;ne{const _e=Object.keys(Z);for(const Ie of _e)Ie in Z&&P.isObject(Z[Ie].parent)&&Z[Ie].parent["@id"]===ne&&(delete Z[Ie],me(Ie))};me($)}function ce(E,$){if(P.isArray(E))return E.map(Z=>ce(Z,$));if(P.isObject(E)){if("@preserve"in E)return E["@preserve"][0];if(j.isValue(E))return E;if(j.isList(E))return E["@list"]=ce(E["@list"],$),E;if("@id"in E){const Z=E["@id"];if($.link.hasOwnProperty(Z)){const oe=$.link[Z].indexOf(E);if(-1!==oe)return $.link[Z][oe];$.link[Z].push(E)}else $.link[Z]=[E]}for(const Z in E)"@id"===Z&&$.bnodesToClear.includes(E[Z])?delete E["@id"]:E[Z]=ce(E[Z],$)}return E}function D(E,$,Z){P.isObject(E)?Q.addValue(E,$,Z,{propertyIsArray:!0}):E.push(Z)}function I(E,$,Z,oe){if(!("@id"in Z))return!1;const se=E.subjects[Z["@id"]];return se&&R(E,se,$,oe)}function X(E,$){const Z=$["@value"],oe=$["@type"],se=$["@language"],te=E["@value"]?P.isArray(E["@value"])?E["@value"]:[E["@value"]]:[],Ce=E["@type"]?P.isArray(E["@type"])?E["@type"]:[E["@type"]]:[],me=E["@language"]?P.isArray(E["@language"])?E["@language"]:[E["@language"]]:[];return 0===te.length&&0===Ce.length&&0===me.length||!(!te.includes(Z)&&!P.isEmptyObject(te[0])||!(!oe&&0===Ce.length||Ce.includes(oe)||oe&&P.isEmptyObject(Ce[0]))||!(!se&&0===me.length||me.includes(se)||se&&P.isEmptyObject(me[0])))}Se.exports=A,A.frameMergedOrDefault=(E,$,Z)=>{const oe={options:Z,embedded:!1,graph:"@default",graphMap:{"@default":{}},subjectStack:[],link:{},bnodeMap:{}},se=new Q.IdentifierIssuer("_:b");x(E,oe.graphMap,"@default",se),Z.merged&&(oe.graphMap["@merged"]=O(oe.graphMap),oe.graph="@merged"),oe.subjects=oe.graphMap[oe.graph];const te=[];return A.frame(oe,Object.keys(oe.subjects).sort(),$,te),Z.pruneBlankNodeIdentifiers&&(Z.bnodesToClear=Object.keys(oe.bnodeMap).filter(Ce=>1===oe.bnodeMap[Ce].length)),Z.link={},ce(te,Z)},A.frame=(E,$,Z,oe,se=null)=>{T(Z);const te=E.options,Ce={embed:S(Z=Z[0],te,"embed"),explicit:S(Z,te,"explicit"),requireAll:S(Z,te,"requireAll")};E.link.hasOwnProperty(E.graph)||(E.link[E.graph]={});const me=E.link[E.graph],ne=function(E,$,Z,oe){const se={};for(const te of $){const Ce=E.graphMap[E.graph][te];R(E,Ce,Z,oe)&&(se[te]=Ce)}return se}(E,$,Z,Ce),_e=Object.keys(ne).sort();for(const Ie of _e){const Ge=ne[Ie];if(null===se?E.uniqueEmbeds={[E.graph]:{}}:E.uniqueEmbeds[E.graph]=E.uniqueEmbeds[E.graph]||{},"@link"===Ce.embed&&Ie in me){D(oe,se,me[Ie]);continue}const st={"@id":Ie};if(0===Ie.indexOf("_:")&&Q.addValue(E.bnodeMap,Ie,st,{propertyIsArray:!0}),me[Ie]=st,("@first"===Ce.embed||"@last"===Ce.embed)&&E.is11)throw new v("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:Z});if(E.embedded||!E.uniqueEmbeds[E.graph].hasOwnProperty(Ie)){if(E.embedded&&("@never"===Ce.embed||y(Ge,E.graph,E.subjectStack))){D(oe,se,st);continue}if(E.embedded&&("@first"==Ce.embed||"@once"==Ce.embed)&&E.uniqueEmbeds[E.graph].hasOwnProperty(Ie)){D(oe,se,st);continue}if("@last"===Ce.embed&&Ie in E.uniqueEmbeds[E.graph]&&K(E,Ie),E.uniqueEmbeds[E.graph][Ie]={parent:oe,property:se},E.subjectStack.push({subject:Ge,graph:E.graph}),Ie in E.graphMap){let Xe=!1,tt=null;"@graph"in Z?(tt=Z["@graph"][0],Xe=!("@merged"===Ie||"@default"===Ie),P.isObject(tt)||(tt={})):(Xe="@merged"!==E.graph,tt={}),Xe&&A.frame(Cn(ot({},E),{graph:Ie,embedded:!1}),Object.keys(E.graphMap[Ie]).sort(),[tt],st,"@graph")}"@included"in Z&&A.frame(Cn(ot({},E),{embedded:!1}),$,Z["@included"],st,"@included");for(const Xe of Object.keys(Ge).sort())if(W(Xe)){if(st[Xe]=Q.clone(Ge[Xe]),"@type"===Xe)for(const tt of Ge["@type"])0===tt.indexOf("_:")&&Q.addValue(E.bnodeMap,tt,st,{propertyIsArray:!0})}else if(!Ce.explicit||Xe in Z)for(const tt of Ge[Xe]){const Ye=Xe in Z?Z[Xe]:b(Ce);if(j.isList(tt)){const Ue=Z[Xe]&&Z[Xe][0]&&Z[Xe][0]["@list"]?Z[Xe][0]["@list"]:b(Ce),ke={"@list":[]};D(st,Xe,ke);const Ke=tt["@list"];for(const Me of Ke)j.isSubjectReference(Me)?A.frame(Cn(ot({},E),{embedded:!0}),[Me["@id"]],Ue,ke,"@list"):D(ke,"@list",Q.clone(Me))}else j.isSubjectReference(tt)?A.frame(Cn(ot({},E),{embedded:!0}),[tt["@id"]],Ye,st,Xe):X(Ye[0],tt)&&D(st,Xe,Q.clone(tt))}for(const Xe of Object.keys(Z).sort()){if("@type"===Xe){if(!P.isObject(Z[Xe][0])||!("@default"in Z[Xe][0]))continue}else if(W(Xe))continue;const tt=Z[Xe][0]||{};if(!S(tt,te,"omitDefault")&&!(Xe in st)){let Ue="@null";"@default"in tt&&(Ue=Q.clone(tt["@default"])),P.isArray(Ue)||(Ue=[Ue]),st[Xe]=[{"@preserve":Ue}]}}for(const Xe of Object.keys(Z["@reverse"]||{}).sort()){const tt=Z["@reverse"][Xe];for(const Ye of Object.keys(E.subjects))Q.getValues(E.subjects[Ye],Xe).some(ke=>ke["@id"]===Ie)&&(st["@reverse"]=st["@reverse"]||{},Q.addValue(st["@reverse"],Xe,[],{propertyIsArray:!0}),A.frame(Cn(ot({},E),{embedded:!0}),[Ye],tt,st["@reverse"][Xe],se))}D(oe,se,st),E.subjectStack.pop()}}},A.cleanupNull=(E,$)=>{if(P.isArray(E))return E.map(oe=>A.cleanupNull(oe,$)).filter(oe=>oe);if("@null"===E)return null;if(P.isObject(E)){if("@id"in E){const Z=E["@id"];if($.link.hasOwnProperty(Z)){const oe=$.link[Z].indexOf(E);if(-1!==oe)return $.link[Z][oe];$.link[Z].push(E)}else $.link[Z]=[E]}for(const Z in E)E[Z]=A.cleanupNull(E[Z],$)}return E}},{"./JsonLdError":12,"./context":19,"./graphTypes":25,"./nodeMap":27,"./types":30,"./url":31,"./util":32}],24:[function(Y,Se,he){"use strict";const W=Y("./JsonLdError"),j=Y("./graphTypes"),P=Y("./types"),Q=Y("./util"),{RDF_LIST:z,RDF_FIRST:v,RDF_REST:x,RDF_NIL:O,RDF_TYPE:A,RDF_JSON_LITERAL:b,XSD_BOOLEAN:y,XSD_DOUBLE:S,XSD_INTEGER:T,XSD_STRING:V}=Y("./constants"),R=/^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$/,K={};function ce(D,I,X){if(D.termType.endsWith("Node"))return{"@id":D.value};const E={"@value":D.value};if(D.language)E["@language"]=D.language;else{let $=D.datatype.value;if($||($=V),$===b){$="@json";try{E["@value"]=JSON.parse(E["@value"])}catch(Z){throw new W("JSON literal could not be parsed.","jsonld.InvalidJsonLiteral",{code:"invalid JSON literal",value:E["@value"],cause:Z})}}if(I){if($===y)"true"===E["@value"]?E["@value"]=!0:"false"===E["@value"]&&(E["@value"]=!1);else if(P.isNumeric(E["@value"]))if($===T){const Z=parseInt(E["@value"],10);Z.toFixed(0)===E["@value"]&&(E["@value"]=Z)}else $===S&&(E["@value"]=parseFloat(E["@value"]));[y,T,S,V].includes($)||(E["@type"]=$)}else if("i18n-datatype"===X&&$.startsWith("https://www.w3.org/ns/i18n#")){const[,Z,oe]=$.split(/[#_]/);Z.length>0&&(E["@language"]=Z,Z.match(R)||console.warn(`@language must be valid BCP47: ${Z}`)),E["@direction"]=oe}else $!==V&&(E["@type"]=$)}return E}Se.exports=K,K.fromRDF=function(){var D=yt(function*(I,{useRdfType:X=!1,useNativeTypes:E=!1,rdfDirection:$=null}){const Z={},oe={"@default":Z},se={};for(const me of I){const ne="DefaultGraph"===me.graph.termType?"@default":me.graph.value;ne in oe||(oe[ne]={}),"@default"!==ne&&!(ne in Z)&&(Z[ne]={"@id":ne});const _e=oe[ne],Ie=me.subject.value,Ge=me.predicate.value,st=me.object;Ie in _e||(_e[Ie]={"@id":Ie});const Xe=_e[Ie],tt=st.termType.endsWith("Node");if(tt&&!(st.value in _e)&&(_e[st.value]={"@id":st.value}),Ge===A&&!X&&tt){Q.addValue(Xe,"@type",st.value,{propertyIsArray:!0});continue}const Ye=ce(st,E,$);if(Q.addValue(Xe,Ge,Ye,{propertyIsArray:!0}),tt)if(st.value===O){const Ue=_e[st.value];"usages"in Ue||(Ue.usages=[]),Ue.usages.push({node:Xe,property:Ge,value:Ye})}else se[st.value]=!(st.value in se)&&{node:Xe,property:Ge,value:Ye}}for(const me in oe){const ne=oe[me];if(!(O in ne))continue;const _e=ne[O];if(_e.usages){for(let Ie of _e.usages){let Ge=Ie.node,st=Ie.property,Xe=Ie.value;const tt=[],Ye=[];let Ue=Object.keys(Ge).length;for(;st===x&&P.isObject(se[Ge["@id"]])&&P.isArray(Ge[v])&&1===Ge[v].length&&P.isArray(Ge[x])&&1===Ge[x].length&&(3===Ue||4===Ue&&P.isArray(Ge["@type"])&&1===Ge["@type"].length&&Ge["@type"][0]===z)&&(tt.push(Ge[v][0]),Ye.push(Ge["@id"]),Ie=se[Ge["@id"]],Ge=Ie.node,st=Ie.property,Xe=Ie.value,Ue=Object.keys(Ge).length,j.isBlankNode(Ge)););delete Xe["@id"],Xe["@list"]=tt.reverse();for(const ke of Ye)delete ne[ke]}delete _e.usages}}const te=[],Ce=Object.keys(Z).sort();for(const me of Ce){const ne=Z[me];if(me in oe){const _e=ne["@graph"]=[],Ie=oe[me],Ge=Object.keys(Ie).sort();for(const st of Ge){const Xe=Ie[st];j.isSubjectReference(Xe)||_e.push(Xe)}}j.isSubjectReference(ne)||te.push(ne)}return te});return function(I,X){return D.apply(this,arguments)}}()},{"./JsonLdError":12,"./constants":18,"./graphTypes":25,"./types":30,"./util":32}],25:[function(Y,Se,he){"use strict";const W=Y("./types"),j={};Se.exports=j,j.isSubject=P=>!(!W.isObject(P)||"@value"in P||"@set"in P||"@list"in P)&&(Object.keys(P).length>1||!("@id"in P)),j.isSubjectReference=P=>W.isObject(P)&&1===Object.keys(P).length&&"@id"in P,j.isValue=P=>W.isObject(P)&&"@value"in P,j.isList=P=>W.isObject(P)&&"@list"in P,j.isGraph=P=>W.isObject(P)&&"@graph"in P&&1===Object.keys(P).filter(Q=>"@id"!==Q&&"@index"!==Q).length,j.isSimpleGraph=P=>j.isGraph(P)&&!("@id"in P),j.isBlankNode=P=>!!W.isObject(P)&&("@id"in P?0===P["@id"].indexOf("_:"):0===Object.keys(P).length||!("@value"in P||"@set"in P||"@list"in P))},{"./types":30}],26:[function(Y,Se,he){const W=Y("rdf-canonize"),j=Y("./platform"),P=Y("./util"),Q=Y("./ContextResolver"),z=P.IdentifierIssuer,v=Y("./JsonLdError"),x=Y("lru-cache"),O=Y("./NQuads"),{expand:A}=Y("./expand"),{flatten:b}=Y("./flatten"),{fromRDF:y}=Y("./fromRdf"),{toRDF:S}=Y("./toRdf"),{frameMergedOrDefault:T,cleanupNull:V}=Y("./frame"),{isArray:R,isObject:K,isString:ce}=Y("./types"),{isSubjectReference:D}=Y("./graphTypes"),{expandIri:I,getInitialContext:X,process:E,processingMode:$}=Y("./context"),{compact:Z,compactIri:oe}=Y("./compact"),{createNodeMap:se,createMergedNodeMap:te,mergeNodeMaps:Ce}=Y("./nodeMap"),me=function(_e){const Ie={},st=new x({max:100});function Xe(tt,ke){var Ke=ke,{documentLoader:Ye=_e.documentLoader}=Ke,Ue=zq(Ke,["documentLoader"]);return Object.assign({},{documentLoader:Ye},Ue,tt)}return _e.compact=function(){var tt=yt(function*(Ye,Ue,ke){if(arguments.length<2)throw new TypeError("Could not compact, too few arguments.");if(null===Ue)throw new v("The compaction context must not be null.","jsonld.CompactError",{code:"invalid local context"});if(null===Ye)return null;let Ke;(ke=Xe(ke,{base:ce(Ye)?Ye:"",compactArrays:!0,compactToRelative:!0,graph:!1,skipExpansion:!1,link:!1,issuer:new z("_:b"),contextResolver:new Q({sharedCache:st})})).link&&(ke.skipExpansion=!0),ke.compactToRelative||delete ke.base,Ke=ke.skipExpansion?Ye:yield _e.expand(Ye,ke);const Me=yield _e.processContext(X(ke),Ue,ke);let Ve=yield Z({activeCtx:Me,element:Ke,options:ke,compactionMap:ke.compactionMap});ke.compactArrays&&!ke.graph&&R(Ve)?1===Ve.length?Ve=Ve[0]:0===Ve.length&&(Ve={}):ke.graph&&K(Ve)&&(Ve=[Ve]),K(Ue)&&"@context"in Ue&&(Ue=Ue["@context"]),Ue=P.clone(Ue),R(Ue)||(Ue=[Ue]);const $e=Ue;Ue=[];for(let q=0;q<$e.length;++q)(!K($e[q])||Object.keys($e[q]).length>0)&&Ue.push($e[q]);const Ne=Ue.length>0;if(1===Ue.length&&(Ue=Ue[0]),R(Ve)){const q=oe({activeCtx:Me,iri:"@graph",relativeTo:{vocab:!0}}),G=Ve;Ve={},Ne&&(Ve["@context"]=Ue),Ve[q]=G}else if(K(Ve)&&Ne){const q=Ve;Ve={"@context":Ue};for(const G in q)Ve[G]=q[G]}return Ve});return function(Ye,Ue,ke){return tt.apply(this,arguments)}}(),_e.expand=function(){var tt=yt(function*(Ye,Ue){if(arguments.length<1)throw new TypeError("Could not expand, too few arguments.");!1===(Ue=Xe(Ue,{keepFreeFloatingNodes:!1,contextResolver:new Q({sharedCache:st})})).expansionMap&&(Ue.expansionMap=void 0);const ke={},Ke=[];if("expandContext"in Ue){const Ne=P.clone(Ue.expandContext);ke.expandContext=K(Ne)&&"@context"in Ne?Ne:{"@context":Ne},Ke.push(ke.expandContext)}let Me;if(ce(Ye)){const Ne=yield _e.get(Ye,Ue);Me=Ne.documentUrl,ke.input=Ne.document,Ne.contextUrl&&(ke.remoteContext={"@context":Ne.contextUrl},Ke.push(ke.remoteContext))}else ke.input=P.clone(Ye);"base"in Ue||(Ue.base=Me||"");let Ve=X(Ue);for(const Ne of Ke)Ve=yield E({activeCtx:Ve,localCtx:Ne,options:Ue});let $e=yield A({activeCtx:Ve,element:ke.input,options:Ue,expansionMap:Ue.expansionMap});return K($e)&&"@graph"in $e&&1===Object.keys($e).length?$e=$e["@graph"]:null===$e&&($e=[]),R($e)||($e=[$e]),$e});return function(Ye,Ue){return tt.apply(this,arguments)}}(),_e.flatten=function(){var tt=yt(function*(Ye,Ue,ke){if(arguments.length<1)return new TypeError("Could not flatten, too few arguments.");Ue="function"==typeof Ue?null:Ue||null,ke=Xe(ke,{base:ce(Ye)?Ye:"",contextResolver:new Q({sharedCache:st})});const Ke=yield _e.expand(Ye,ke),Me=b(Ke);return null===Ue?Me:(ke.graph=!0,ke.skipExpansion=!0,yield _e.compact(Me,Ue,ke))});return function(Ye,Ue,ke){return tt.apply(this,arguments)}}(),_e.frame=function(){var tt=yt(function*(Ye,Ue,ke){if(arguments.length<2)throw new TypeError("Could not frame, too few arguments.");if(ke=Xe(ke,{base:ce(Ye)?Ye:"",embed:"@once",explicit:!1,requireAll:!1,omitDefault:!1,bnodesToClear:[],contextResolver:new Q({sharedCache:st})}),ce(Ue)){const ue=yield _e.get(Ue,ke);if(Ue=ue.document,ue.contextUrl){let je=Ue["@context"];je?R(je)?je.push(ue.contextUrl):je=[je,ue.contextUrl]:je=ue.contextUrl,Ue["@context"]=je}}const Ke=Ue&&Ue["@context"]||{},Me=yield _e.processContext(X(ke),Ke,ke);ke.hasOwnProperty("omitGraph")||(ke.omitGraph=$(Me,1.1)),ke.hasOwnProperty("pruneBlankNodeIdentifiers")||(ke.pruneBlankNodeIdentifiers=$(Me,1.1));const Ve=yield _e.expand(Ye,ke),$e=ot({},ke);$e.isFrame=!0,$e.keepFreeFloatingNodes=!0;const Ne=yield _e.expand(Ue,$e),q=Object.keys(Ue).map(ue=>I(Me,ue,{vocab:!0}));$e.merged=!q.includes("@graph"),$e.is11=$(Me,1.1);const G=T(Ve,Ne,$e);$e.graph=!ke.omitGraph,$e.skipExpansion=!0,$e.link={},$e.framing=!0;let pe=yield _e.compact(G,Ke,$e);return $e.link={},pe=V(pe,$e),pe});return function(Ye,Ue,ke){return tt.apply(this,arguments)}}(),_e.link=function(){var tt=yt(function*(Ye,Ue,ke){const Ke={};return Ue&&(Ke["@context"]=Ue),Ke["@embed"]="@link",_e.frame(Ye,Ke,ke)});return function(Ye,Ue,ke){return tt.apply(this,arguments)}}(),_e.normalize=_e.canonize=function(){var tt=yt(function*(Ye,Ue){if(arguments.length<1)throw new TypeError("Could not canonize, too few arguments.");if("inputFormat"in(Ue=Xe(Ue,{base:ce(Ye)?Ye:"",algorithm:"URDNA2015",skipExpansion:!1,contextResolver:new Q({sharedCache:st})}))){if("application/n-quads"!==Ue.inputFormat&&"application/nquads"!==Ue.inputFormat)throw new v("Unknown canonicalization input format.","jsonld.CanonizeError");const Me=O.parse(Ye);return W.canonize(Me,Ue)}const ke=ot({},Ue);delete ke.format,ke.produceGeneralizedRdf=!1;const Ke=yield _e.toRDF(Ye,ke);return W.canonize(Ke,Ue)});return function(Ye,Ue){return tt.apply(this,arguments)}}(),_e.fromRDF=function(){var tt=yt(function*(Ye,Ue){if(arguments.length<1)throw new TypeError("Could not convert from RDF, too few arguments.");Ue=Xe(Ue,{format:ce(Ye)?"application/n-quads":void 0});const{format:ke}=Ue;let{rdfParser:Ke}=Ue;if(ke){if(Ke=Ke||Ie[ke],!Ke)throw new v("Unknown input format.","jsonld.UnknownFormat",{format:ke})}else Ke=()=>Ye;const Me=yield Ke(Ye);return y(Me,Ue)});return function(Ye,Ue){return tt.apply(this,arguments)}}(),_e.toRDF=function(){var tt=yt(function*(Ye,Ue){if(arguments.length<1)throw new TypeError("Could not convert to RDF, too few arguments.");let ke;ke=(Ue=Xe(Ue,{base:ce(Ye)?Ye:"",skipExpansion:!1,contextResolver:new Q({sharedCache:st})})).skipExpansion?Ye:yield _e.expand(Ye,Ue);const Ke=S(ke,Ue);if(Ue.format){if("application/n-quads"===Ue.format||"application/nquads"===Ue.format)return O.serialize(Ke);throw new v("Unknown output format.","jsonld.UnknownFormat",{format:Ue.format})}return Ke});return function(Ye,Ue){return tt.apply(this,arguments)}}(),_e.createNodeMap=function(){var tt=yt(function*(Ye,Ue){if(arguments.length<1)throw new TypeError("Could not create node map, too few arguments.");Ue=Xe(Ue,{base:ce(Ye)?Ye:"",contextResolver:new Q({sharedCache:st})});const ke=yield _e.expand(Ye,Ue);return te(ke,Ue)});return function(Ye,Ue){return tt.apply(this,arguments)}}(),_e.merge=function(){var tt=yt(function*(Ye,Ue,ke){if(arguments.length<1)throw new TypeError("Could not merge, too few arguments.");if(!R(Ye))throw new TypeError('Could not merge, "docs" must be an array.');Ue="function"==typeof Ue?null:Ue||null,ke=Xe(ke,{contextResolver:new Q({sharedCache:st})});const Ke=yield Promise.all(Ye.map(ue=>{const je=ot({},ke);return _e.expand(ue,je)}));let Me=!0;"mergeNodes"in ke&&(Me=ke.mergeNodes);const Ve=ke.issuer||new z("_:b"),$e={"@default":{}};for(let ue=0;ue_e._documentLoader,set:tt=>_e._documentLoader=tt}),_e.documentLoader=function(){var tt=yt(function*(Ye){throw new v("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 tt.apply(this,arguments)}}(),_e.get=function(){var tt=yt(function*(Ye,Ue){let ke;ke="function"==typeof Ue.documentLoader?Ue.documentLoader:_e.documentLoader;const Ke=yield ke(Ye);try{if(!Ke.document)throw new v("No remote document found at the given URL.","jsonld.NullRemoteDocument");ce(Ke.document)&&(Ke.document=JSON.parse(Ke.document))}catch(Me){throw new v("Could not retrieve a JSON-LD document from the URL.","jsonld.LoadDocumentError",{code:"loading document failed",cause:Me,remoteDoc:Ke})}return Ke});return function(Ye,Ue){return tt.apply(this,arguments)}}(),_e.processContext=function(){var tt=yt(function*(Ye,Ue,ke){return ke=Xe(ke,{base:"",contextResolver:new Q({sharedCache:st})}),null===Ue?X(ke):(Ue=P.clone(Ue),K(Ue)&&"@context"in Ue||(Ue={"@context":Ue}),E({activeCtx:Ye,localCtx:Ue,options:ke}))});return function(Ye,Ue,ke){return tt.apply(this,arguments)}}(),_e.getContextValue=Y("./context").getContextValue,_e.documentLoaders={},_e.useDocumentLoader=function(tt){if(!(tt in _e.documentLoaders))throw new v('Unknown document loader type: "'+tt+'"',"jsonld.UnknownDocumentLoader",{type:tt});_e.documentLoader=_e.documentLoaders[tt].apply(_e,Array.prototype.slice.call(arguments,1))},_e.registerRDFParser=function(tt,Ye){Ie[tt]=Ye},_e.unregisterRDFParser=function(tt){delete Ie[tt]},_e.registerRDFParser("application/n-quads",O.parse),_e.registerRDFParser("application/nquads",O.parse),_e.url=Y("./url"),_e.util=P,Object.assign(_e,P),_e.promises=_e,_e.RequestQueue=Y("./RequestQueue"),_e.JsonLdProcessor=Y("./JsonLdProcessor")(_e),j.setupGlobals(_e),j.setupDocumentLoaders(_e),_e},ne=function(){return me(function(){return ne()})};me(ne),Se.exports=ne},{"./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,Se,he){"use strict";const{isKeyword:W}=Y("./context"),j=Y("./graphTypes"),P=Y("./types"),Q=Y("./util"),z=Y("./JsonLdError"),v={};Se.exports=v,v.createMergedNodeMap=(x,O)=>{const A=(O=O||{}).issuer||new Q.IdentifierIssuer("_:b"),b={"@default":{}};return v.createNodeMap(x,b,"@default",A),v.mergeNodeMaps(b)},v.createNodeMap=(x,O,A,b,y,S)=>{if(P.isArray(x)){for(const K of x)v.createNodeMap(K,O,A,b,void 0,S);return}if(!P.isObject(x))return void(S&&S.push(x));if(j.isValue(x)){if("@type"in x){let K=x["@type"];0===K.indexOf("_:")&&(x["@type"]=K=b.getId(K))}return void(S&&S.push(x))}if(S&&j.isList(x)){const K=[];return v.createNodeMap(x["@list"],O,A,b,y,K),void S.push({"@list":K})}if("@type"in x){const K=x["@type"];for(const ce of K)0===ce.indexOf("_:")&&b.getId(ce)}P.isUndefined(y)&&(y=j.isBlankNode(x)?b.getId(x["@id"]):x["@id"]),S&&S.push({"@id":y});const T=O[A],V=T[y]=T[y]||{};V["@id"]=y;const R=Object.keys(x).sort();for(let K of R){if("@id"===K)continue;if("@reverse"===K){const D={"@id":y},I=x["@reverse"];for(const X in I){const E=I[X];for(const $ of E){let Z=$["@id"];j.isBlankNode($)&&(Z=b.getId(Z)),v.createNodeMap($,O,A,b,Z),Q.addValue(T[Z],X,D,{propertyIsArray:!0,allowDuplicate:!1})}}continue}if("@graph"===K){y in O||(O[y]={}),v.createNodeMap(x[K],O,y,b);continue}if("@included"===K){v.createNodeMap(x[K],O,A,b);continue}if("@type"!==K&&W(K)){if("@index"===K&&K in V&&(x[K]!==V[K]||x[K]["@id"]!==V[K]["@id"]))throw new z("Invalid JSON-LD syntax; conflicting @index property detected.","jsonld.SyntaxError",{code:"conflicting indexes",subject:V});V[K]=x[K];continue}const ce=x[K];if(0===K.indexOf("_:")&&(K=b.getId(K)),0!==ce.length)for(let D of ce)if("@type"===K&&(D=0===D.indexOf("_:")?b.getId(D):D),j.isSubject(D)||j.isSubjectReference(D)){if("@id"in D&&!D["@id"])continue;const I=j.isBlankNode(D)?b.getId(D["@id"]):D["@id"];Q.addValue(V,K,{"@id":I},{propertyIsArray:!0,allowDuplicate:!1}),v.createNodeMap(D,O,A,b,I)}else if(j.isValue(D))Q.addValue(V,K,D,{propertyIsArray:!0,allowDuplicate:!1});else if(j.isList(D)){const I=[];v.createNodeMap(D["@list"],O,A,b,y,I),D={"@list":I},Q.addValue(V,K,D,{propertyIsArray:!0,allowDuplicate:!1})}else v.createNodeMap(D,O,A,b,y),Q.addValue(V,K,D,{propertyIsArray:!0,allowDuplicate:!1});else Q.addValue(V,K,[],{propertyIsArray:!0})}},v.mergeNodeMapGraphs=x=>{const O={};for(const A of Object.keys(x).sort())for(const b of Object.keys(x[A]).sort()){const y=x[A][b];b in O||(O[b]={"@id":b});const S=O[b];for(const T of Object.keys(y).sort())if(W(T)&&"@type"!==T)S[T]=Q.clone(y[T]);else for(const V of y[T])Q.addValue(S,T,Q.clone(V),{propertyIsArray:!0,allowDuplicate:!1})}return O},v.mergeNodeMaps=x=>{const O=x["@default"],A=Object.keys(x).sort();for(const b of A){if("@default"===b)continue;const y=x[b];let S=O[b];S?"@graph"in S||(S["@graph"]=[]):O[b]=S={"@id":b,"@graph":[]};const T=S["@graph"];for(const V of Object.keys(y).sort()){const R=y[V];j.isSubjectReference(R)||T.push(R)}}return O}},{"./JsonLdError":12,"./context":19,"./graphTypes":25,"./types":30,"./util":32}],28:[function(Y,Se,he){"use strict";const W=Y("./documentLoaders/xhr"),j={};Se.exports=j,j.setupDocumentLoaders=function(P){"undefined"!=typeof XMLHttpRequest&&(P.documentLoaders.xhr=W,P.useDocumentLoader("xhr"))},j.setupGlobals=function(P){void 0===globalThis.JsonLdProcessor&&Object.defineProperty(globalThis,"JsonLdProcessor",{writable:!0,enumerable:!1,configurable:!0,value:P.JsonLdProcessor})}},{"./documentLoaders/xhr":20}],29:[function(Y,Se,he){"use strict";const{createNodeMap:W}=Y("./nodeMap"),{isKeyword:j}=Y("./context"),P=Y("./graphTypes"),Q=Y("canonicalize"),z=Y("./types"),v=Y("./util"),{RDF_FIRST:x,RDF_REST:O,RDF_NIL:A,RDF_TYPE:b,RDF_JSON_LITERAL:y,RDF_LANGSTRING:S,XSD_BOOLEAN:T,XSD_DOUBLE:V,XSD_INTEGER:R,XSD_STRING:K}=Y("./constants"),{isAbsolute:ce}=Y("./url"),D={};function I($,Z,oe,se,te){const Ce=Object.keys(Z).sort();for(const me of Ce){const ne=Z[me],_e=Object.keys(ne).sort();for(let Ie of _e){const Ge=ne[Ie];if("@type"===Ie)Ie=b;else if(j(Ie))continue;for(const st of Ge){const Xe={termType:me.startsWith("_:")?"BlankNode":"NamedNode",value:me};if(!ce(me))continue;const tt={termType:Ie.startsWith("_:")?"BlankNode":"NamedNode",value:Ie};if(!ce(Ie)||"BlankNode"===tt.termType&&!te.produceGeneralizedRdf)continue;const Ye=E(st,se,$,oe,te.rdfDirection);Ye&&$.push({subject:Xe,predicate:tt,object:Ye,graph:oe})}}}}function E($,Z,oe,se,te){const Ce={};if(P.isValue($)){Ce.termType="Literal",Ce.value=void 0,Ce.datatype={termType:"NamedNode"};let me=$["@value"];const ne=$["@type"]||null;"@json"===ne?(Ce.value=Q(me),Ce.datatype.value=y):z.isBoolean(me)?(Ce.value=me.toString(),Ce.datatype.value=ne||T):z.isDouble(me)||ne===V?(z.isDouble(me)||(me=parseFloat(me)),Ce.value=me.toExponential(15).replace(/(\d)0*e\+?/,"$1E"),Ce.datatype.value=ne||V):z.isNumber(me)?(Ce.value=me.toFixed(0),Ce.datatype.value=ne||R):"i18n-datatype"===te&&"@direction"in $?(Ce.datatype.value="https://www.w3.org/ns/i18n#"+($["@language"]||"")+`_${$["@direction"]}`,Ce.value=me):"@language"in $?(Ce.value=me,Ce.datatype.value=ne||S,Ce.language=$["@language"]):(Ce.value=me,Ce.datatype.value=ne||K)}else if(P.isList($)){const me=function($,Z,oe,se,te){const Ce={termType:"NamedNode",value:x},me={termType:"NamedNode",value:O},ne={termType:"NamedNode",value:A},_e=$.pop(),Ie=_e?{termType:"BlankNode",value:Z.getId()}:ne;let Ge=Ie;for(const st of $){const Xe=E(st,Z,oe,se,te),tt={termType:"BlankNode",value:Z.getId()};oe.push({subject:Ge,predicate:Ce,object:Xe,graph:se}),oe.push({subject:Ge,predicate:me,object:tt,graph:se}),Ge=tt}if(_e){const st=E(_e,Z,oe,se,te);oe.push({subject:Ge,predicate:Ce,object:st,graph:se}),oe.push({subject:Ge,predicate:me,object:ne,graph:se})}return Ie}($["@list"],Z,oe,se,te);Ce.termType=me.termType,Ce.value=me.value}else{const me=z.isObject($)?$["@id"]:$;Ce.termType=me.startsWith("_:")?"BlankNode":"NamedNode",Ce.value=me}return"NamedNode"!==Ce.termType||ce(Ce.value)?Ce:null}Se.exports=D,D.toRDF=($,Z)=>{const oe=new v.IdentifierIssuer("_:b"),se={"@default":{}};W($,se,"@default",oe);const te=[],Ce=Object.keys(se).sort();for(const me of Ce){let ne;if("@default"===me)ne={termType:"DefaultGraph",value:""};else{if(!ce(me))continue;ne=me.startsWith("_:")?{termType:"BlankNode"}:{termType:"NamedNode"},ne.value=me}I(te,se[me],ne,oe,Z)}return te}},{"./constants":18,"./context":19,"./graphTypes":25,"./nodeMap":27,"./types":30,"./url":31,"./util":32,canonicalize:7}],30:[function(Y,Se,he){"use strict";const W={};Se.exports=W,W.isArray=Array.isArray,W.isBoolean=j=>"boolean"==typeof j||"[object Boolean]"===Object.prototype.toString.call(j),W.isDouble=j=>W.isNumber(j)&&(-1!==String(j).indexOf(".")||Math.abs(j)>=1e21),W.isEmptyObject=j=>W.isObject(j)&&0===Object.keys(j).length,W.isNumber=j=>"number"==typeof j||"[object Number]"===Object.prototype.toString.call(j),W.isNumeric=j=>!isNaN(parseFloat(j))&&isFinite(j),W.isObject=j=>"[object Object]"===Object.prototype.toString.call(j),W.isString=j=>"string"==typeof j||"[object String]"===Object.prototype.toString.call(j),W.isUndefined=j=>void 0===j},{}],31:[function(Y,Se,he){"use strict";const W=Y("./types"),j={};Se.exports=j,j.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*))?))?(?:(((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/}},j.parse=(Q,z)=>{const v={},x=j.parsers[z||"full"],O=x.regex.exec(Q);let A=x.keys.length;for(;A--;)v[x.keys[A]]=void 0===O[A]?null:O[A];return("https"===v.scheme&&"443"===v.port||"http"===v.scheme&&"80"===v.port)&&(v.href=v.href.replace(":"+v.port,""),v.authority=v.authority.replace(":"+v.port,""),v.port=null),v.normalizedPath=j.removeDotSegments(v.path),v},j.prependBase=(Q,z)=>{if(null===Q||j.isAbsolute(z))return z;(!Q||W.isString(Q))&&(Q=j.parse(Q||""));const v=j.parse(z),x={protocol:Q.protocol||""};if(null!==v.authority)x.authority=v.authority,x.path=v.path,x.query=v.query;else if(x.authority=Q.authority,""===v.path)x.path=Q.path,x.query=null!==v.query?v.query:Q.query;else{if(0===v.path.indexOf("/"))x.path=v.path;else{let A=Q.path;A=A.substr(0,A.lastIndexOf("/")+1),(A.length>0||Q.authority)&&"/"!==A.substr(-1)&&(A+="/"),A+=v.path,x.path=A}x.query=v.query}""!==v.path&&(x.path=j.removeDotSegments(x.path));let O=x.protocol;return null!==x.authority&&(O+="//"+x.authority),O+=x.path,null!==x.query&&(O+="?"+x.query),null!==v.fragment&&(O+="#"+v.fragment),""===O&&(O="./"),O},j.removeBase=(Q,z)=>{if(null===Q)return z;(!Q||W.isString(Q))&&(Q=j.parse(Q||""));let v="";if(""!==Q.href?v+=(Q.protocol||"")+"//"+(Q.authority||""):z.indexOf("//")&&(v+="//"),0!==z.indexOf(v))return z;const x=j.parse(z.substr(v.length)),O=Q.normalizedPath.split("/"),A=x.normalizedPath.split("/"),b=x.fragment||x.query?0:1;for(;O.length>0&&A.length>b&&O[0]===A[0];)O.shift(),A.shift();let y="";if(O.length>0){O.pop();for(let S=0;S{if(0===Q.length)return"";const z=Q.split("/"),v=[];for(;z.length>0;){const x=z.shift(),O=0===z.length;"."!==x?".."!==x?v.push(x):(v.pop(),O&&v.push("")):O&&v.push("")}return"/"===Q[0]&&v.length>0&&""!==v[0]&&v.unshift(""),1===v.length&&""===v[0]?"/":v.join("/")};const P=/^([A-Za-z][A-Za-z0-9+-.]*|_):[^\s]*$/;j.isAbsolute=Q=>W.isString(Q)&&P.test(Q),j.isRelative=Q=>W.isString(Q)},{"./types":30}],32:[function(Y,Se,he){"use strict";const W=Y("./graphTypes"),j=Y("./types"),P=Y("rdf-canonize").IdentifierIssuer,Q=Y("./JsonLdError"),z=/(?:<[^>]*?>|"[^"]*?"|[^,])+/g,v=/\s*<([^>]*?)>\s*(?:;\s*(.*))?/,x=/(.*?)=(?:(?:"([^"]*?)")|([^"]*?))\s*(?:(?:;\s*)|$)/g,O_headers={accept:"application/ld+json, application/json"},A={};function b(y,S){if(j.isArray(S))for(let T=0;T{if(Object.keys(y).some(T=>"accept"===T.toLowerCase()))throw new RangeError('Accept header may not be specified; only "'+O_headers.accept+'" is supported.');return Object.assign({Accept:O_headers.accept},y)},A.parseLinkHeader=y=>{const S={},T=y.match(z);for(let V=0;V{if(!(j.isString(y)||j.isArray(y)&&y.every(T=>j.isString(T)))){if(S&&j.isObject(y))switch(Object.keys(y).length){case 0:return;case 1:if("@default"in y&&A.asArray(y["@default"]).every(T=>j.isString(T)))return}throw new Q('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,S)=>{if(y.hasOwnProperty(S)){const T=y[S];return!j.isArray(T)||T.length>0}return!1},A.hasValue=(y,S,T)=>{if(A.hasProperty(y,S)){let V=y[S];const R=W.isList(V);if(j.isArray(V)||R){R&&(V=V["@list"]);for(let K=0;K{if("propertyIsArray"in(V=V||{})||(V.propertyIsArray=!1),"valueIsArray"in V||(V.valueIsArray=!1),"allowDuplicate"in V||(V.allowDuplicate=!0),"prependValue"in V||(V.prependValue=!1),V.valueIsArray)y[S]=T;else if(j.isArray(T)){0===T.length&&V.propertyIsArray&&!y.hasOwnProperty(S)&&(y[S]=[]),V.prependValue&&(T=T.concat(y[S]),y[S]=[]);for(let R=0;R[].concat(y[S]||[]),A.removeProperty=(y,S)=>{delete y[S]},A.removeValue=(y,S,T,V)=>{"propertyIsArray"in(V=V||{})||(V.propertyIsArray=!1);const R=A.getValues(y,S).filter(K=>!A.compareValues(K,T));0===R.length?A.removeProperty(y,S):y[S]=1!==R.length||V.propertyIsArray?R:R[0]},A.relabelBlankNodes=(y,S)=>b((S=S||{}).issuer||new P("_:b"),y),A.compareValues=(y,S)=>!!(y===S||W.isValue(y)&&W.isValue(S)&&y["@value"]===S["@value"]&&y["@type"]===S["@type"]&&y["@language"]===S["@language"]&&y["@index"]===S["@index"])||!!(j.isObject(y)&&"@id"in y&&j.isObject(S)&&"@id"in S)&&y["@id"]===S["@id"],A.compareShortestLeast=(y,S)=>y.length1;const V=(X,E,$)=>{const Z=X[b].get(E);if(Z){const oe=Z.value;if(R(X,oe)){if(ce(X,Z),!X[z])return}else $&&(X[y]&&(Z.value.now=Date.now()),X[A].unshiftNode(Z));return oe.value}},R=(X,E)=>{if(!E||!E.maxAge&&!X[v])return!1;const $=Date.now()-E.now;return E.maxAge?$>E.maxAge:X[v]&&$>X[v]},K=X=>{if(X[P]>X[j])for(let E=X[A].tail;X[P]>X[j]&&null!==E;){const $=E.prev;ce(X,E),E=$}},ce=(X,E)=>{if(E){const $=E.value;X[x]&&X[x]($.key,$.value),X[P]-=$.length,X[b].delete($.key),X[A].removeNode(E)}};class D{constructor(E,$,Z,oe,se){this.key=E,this.value=$,this.length=Z,this.now=oe,this.maxAge=se||0}}const I=(X,E,$,Z)=>{let oe=$.value;R(X,oe)&&(ce(X,$),X[z]||(oe=void 0)),oe&&E.call(Z,oe.value,oe.key,X)};Se.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[j]=E.max||1/0;const Z=E.length||S;if(this[Q]="function"!=typeof Z?S:Z,this[z]=E.stale||!1,E.maxAge&&"number"!=typeof E.maxAge)throw new TypeError("maxAge must be a number");this[v]=E.maxAge||0,this[x]=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[j]=E||1/0,K(this)}get max(){return this[j]}set allowStale(E){this[z]=!!E}get allowStale(){return this[z]}set maxAge(E){if("number"!=typeof E)throw new TypeError("maxAge must be a non-negative number");this[v]=E,K(this)}get maxAge(){return this[v]}set lengthCalculator(E){"function"!=typeof E&&(E=S),E!==this[Q]&&(this[Q]=E,this[P]=0,this[A].forEach($=>{$.length=this[Q]($.value,$.key),this[P]+=$.length})),K(this)}get lengthCalculator(){return this[Q]}get length(){return this[P]}get itemCount(){return this[A].length}rforEach(E,$){$=$||this;for(let Z=this[A].tail;null!==Z;){const oe=Z.prev;I(this,E,Z,$),Z=oe}}forEach(E,$){$=$||this;for(let Z=this[A].head;null!==Z;){const oe=Z.next;I(this,E,Z,$),Z=oe}}keys(){return this[A].toArray().map(E=>E.key)}values(){return this[A].toArray().map(E=>E.value)}reset(){this[x]&&this[A]&&this[A].length&&this[A].forEach(E=>this[x](E.key,E.value)),this[b]=new Map,this[A]=new W,this[P]=0}dump(){return this[A].map(E=>!R(this,E)&&{k:E.key,v:E.value,e:E.now+(E.maxAge||0)}).toArray().filter(E=>E)}dumpLru(){return this[A]}set(E,$,Z){if((Z=Z||this[v])&&"number"!=typeof Z)throw new TypeError("maxAge must be a number");const oe=Z?Date.now():0,se=this[Q]($,E);if(this[b].has(E)){if(se>this[j])return ce(this,this[b].get(E)),!1;const me=this[b].get(E).value;return this[x]&&(this[O]||this[x](E,me.value)),me.now=oe,me.maxAge=Z,me.value=$,this[P]+=se-me.length,me.length=se,this.get(E),K(this),!0}const te=new D(E,$,se,oe,Z);return te.length>this[j]?(this[x]&&this[x](E,$),!1):(this[P]+=te.length,this[A].unshift(te),this[b].set(E,this[A].head),K(this),!0)}has(E){if(!this[b].has(E))return!1;const $=this[b].get(E).value;return!R(this,$)}get(E){return V(this,E,!0)}peek(E){return V(this,E,!1)}pop(){const E=this[A].tail;return E?(ce(this,E),E.value):null}del(E){ce(this,this[b].get(E))}load(E){this.reset();const $=Date.now();for(let Z=E.length-1;Z>=0;Z--){const oe=E[Z],se=oe.e||0;if(0===se)this.set(oe.k,oe.v);else{const te=se-$;te>0&&this.set(oe.k,oe.v,te)}}}prune(){this[b].forEach((E,$)=>V(this,$,!1))}}},{yallist:92}],34:[function(Y,Se,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#",j="http://www.w3.org/2001/XMLSchema#",P="http://www.w3.org/2000/10/swap/";he.default={xsd:{decimal:`${j}decimal`,boolean:`${j}boolean`,double:`${j}double`,integer:`${j}integer`,string:`${j}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:`${P}reify#forSome`,forAll:`${P}reify#forAll`},log:{implies:`${P}log#implies`}}},{}],35:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.default=he.Variable=he.Triple=he.Term=he.Quad=he.NamedNode=he.Literal=he.DefaultGraph=he.BlankNode=void 0,he.escapeQuotes=E,he.termFromId=function D(ne,_e){if(_e=_e||b,!ne)return _e.defaultGraph();switch(ne[0]){case"?":return _e.variable(ne.substr(1));case"_":return _e.blankNode(ne.substr(2));case'"':if(_e===b)return new V(ne);if('"'===ne[ne.length-1])return _e.literal(ne.substr(1,ne.length-2));const Ie=ne.lastIndexOf('"',ne.length-1);return _e.literal(ne.substr(1,Ie-1),"@"===ne[Ie+1]?ne.substr(Ie+2):_e.namedNode(ne.substr(Ie+3)));case"<":const Ge=A.exec(ne);return _e.quad(D($(Ge[1]),_e),D($(Ge[2]),_e),D($(Ge[3]),_e),Ge[4]&&D($(Ge[4]),_e));default:return _e.namedNode(ne)}},he.termToId=function I(ne){if("string"==typeof ne)return ne;if(ne instanceof S&&"Quad"!==ne.termType)return ne.id;if(!ne)return v.id;switch(ne.termType){case"NamedNode":return ne.value;case"BlankNode":return`_:${ne.value}`;case"Variable":return`?${ne.value}`;case"DefaultGraph":return"";case"Literal":return`"${ne.value}"${ne.language?`@${ne.language}`:ne.datatype&&ne.datatype.value!==z.string?`^^${ne.datatype.value}`:""}`;case"Quad":return`<<${E(I(ne.subject))} ${E(I(ne.predicate))} ${E(I(ne.object))}${(0,j.isDefaultGraph)(ne.graph)?"":` ${I(ne.graph)}`}>>`;default:throw new Error(`Unexpected termType: ${ne.termType}`)}},he.unescapeQuotes=$;var ne,W=(ne=Y("./IRIs"))&&ne.__esModule?ne:{default:ne},j=Y("./N3Util");const{rdf:Q,xsd:z}=W.default;let v,x=0;const O=/^"(.*".*)(?="[^"]*$)/,A=/^<<("(?:""|[^"])*"[^ ]*|[^ ]+) ("(?:""|[^"])*"[^ ]*|[^ ]+) ("(?:""|[^"])*"[^ ]*|[^ ]+) ?("(?:""|[^"])*"[^ ]*|[^ ]+)?>>$/,b={namedNode:function(ne){return new T(ne)},blankNode:function(ne){return new R(ne||"n3-"+x++)},variable:function(ne){return new K(ne)},literal:function(ne,_e){if("string"==typeof _e)return new V(`"${ne}"@${_e.toLowerCase()}`);let Ie=_e?_e.value:"";return""===Ie&&("boolean"==typeof ne?Ie=z.boolean:"number"==typeof ne&&(Number.isFinite(ne)?Ie=Number.isInteger(ne)?z.integer:z.double:(Ie=z.double,Number.isNaN(ne)||(ne=ne>0?"INF":"-INF")))),new V(""===Ie||Ie===z.string?`"${ne}"`:`"${ne}"^^${Ie}`)},defaultGraph:function(){return v},quad:me,triple:me};he.default=b;class S{constructor(_e){this.id=_e}get value(){return this.id}equals(_e){return _e instanceof S?this.id===_e.id:!!_e&&this.termType===_e.termType&&this.value===_e.value}hashCode(){return 0}toJSON(){return{termType:this.termType,value:this.value}}}he.Term=S;class T extends S{get termType(){return"NamedNode"}}he.NamedNode=T;class V extends S{get termType(){return"Literal"}get value(){return this.id.substring(1,this.id.lastIndexOf('"'))}get language(){const _e=this.id;let Ie=_e.lastIndexOf('"')+1;return Ie<_e.length&&"@"===_e[Ie++]?_e.substr(Ie).toLowerCase():""}get datatype(){return new T(this.datatypeString)}get datatypeString(){const _e=this.id,Ie=_e.lastIndexOf('"')+1,Ge=Ie<_e.length?_e[Ie]:"";return"^"===Ge?_e.substr(Ie+2):"@"!==Ge?z.string:Q.langString}equals(_e){return _e instanceof V?this.id===_e.id:!!_e&&!!_e.datatype&&this.termType===_e.termType&&this.value===_e.value&&this.language===_e.language&&this.datatype.value===_e.datatype.value}toJSON(){return{termType:this.termType,value:this.value,language:this.language,datatype:{termType:"NamedNode",value:this.datatypeString}}}}he.Literal=V;class R extends S{constructor(_e){super(`_:${_e}`)}get termType(){return"BlankNode"}get value(){return this.id.substr(2)}}he.BlankNode=R;class K extends S{constructor(_e){super(`?${_e}`)}get termType(){return"Variable"}get value(){return this.id.substr(1)}}he.Variable=K;class ce extends S{constructor(){return super(""),v||this}get termType(){return"DefaultGraph"}equals(_e){return this===_e||!!_e&&this.termType===_e.termType}}he.DefaultGraph=ce,v=new ce;class X extends S{constructor(_e,Ie,Ge,st){super(""),this._subject=_e,this._predicate=Ie,this._object=Ge,this._graph=st||v}get termType(){return"Quad"}get subject(){return this._subject}get predicate(){return this._predicate}get object(){return this._object}get graph(){return this._graph}toJSON(){return{termType:this.termType,subject:this._subject.toJSON(),predicate:this._predicate.toJSON(),object:this._object.toJSON(),graph:this._graph.toJSON()}}equals(_e){return!!_e&&this._subject.equals(_e.subject)&&this._predicate.equals(_e.predicate)&&this._object.equals(_e.object)&&this._graph.equals(_e.graph)}}function E(ne){return ne.replace(O,(_e,Ie)=>`"${Ie.replace(/"/g,'""')}`)}function $(ne){return ne.replace(O,(_e,Ie)=>`"${Ie.replace(/""/g,'"')}`)}function me(ne,_e,Ie,Ge){return new X(ne,_e,Ie,Ge)}he.Triple=he.Quad=X},{"./IRIs":34,"./N3Util":41}],36:[function(Y,Se,he){(function(W){(function(){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.default=void 0;var j=Q(Y("./IRIs")),P=Q(Y("queue-microtask"));function Q(S){return S&&S.__esModule?S:{default:S}}const{xsd:z}=j.default,v=/\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{8})|\\([^])/g,x={"\\":"\\","'":"'",'"':'"',n:"\n",r:"\r",t:"\t",f:"\f",b:"\b",_:"_","~":"~",".":".","-":"-","!":"!",$:"$","&":"&","(":"(",")":")","*":"*","+":"+",",":",",";":";","=":"=","/":"/","?":"?","#":"#","@":"@","%":"%"},O=/[\x00-\x20<>\\"\{\}\|\^\`]/,A={_iri:!0,_unescapedIri:!0,_simpleQuotedString:!0,_langcode:!0,_blank:!0,_newline:!0,_comment:!0,_whitespace:!0,_endOfFile:!0},b=/$0^/;he.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 V in this)!(V in A)&&this[V]instanceof RegExp&&(this[V]=b)}else this._n3Mode=!1!==T.n3;this._comments=!!T.comments,this._literalClosingPos=0}_tokenizeToEnd(T,V){let R=this._input,K=R.length;for(;;){let I,X;for(;I=this._newline.exec(R);)this._comments&&(X=this._comment.exec(I[0]))&&ce("comment",X[1],"",this._line,I[0].length),R=R.substr(I[0].length,R.length),K=R.length,this._line++;if(!I&&(I=this._whitespace.exec(R))&&(R=R.substr(I[0].length,R.length)),this._endOfFile.test(R))return V&&(this._comments&&(X=this._comment.exec(R))&&ce("comment",X[1],"",this._line,R.length),R=null,ce("eof","","",this._line,0)),this._input=R;const E=this._line,$=R[0];let Z="",oe="",se="",te=null,Ce=0,me=!1;switch($){case"^":if(R.length<3)break;if("^"!==R[1]){this._n3Mode&&(Ce=1,Z="^");break}if(this._previousMarker="^^",R=R.substr(2),"<"!==R[0]){me=!0;break}case"<":if(te=this._unescapedIri.exec(R))Z="IRI",oe=te[1];else if(te=this._iri.exec(R)){if(oe=this._unescape(te[1]),null===oe||O.test(oe))return D(this);Z="IRI"}else R.length>1&&"<"===R[1]?(Z="<<",Ce=2):this._n3Mode&&R.length>1&&"="===R[1]&&(Z="inverse",Ce=2,oe=">");break;case">":R.length>1&&">"===R[1]&&(Z=">>",Ce=2);break;case"_":((te=this._blank.exec(R))||V&&(te=this._blank.exec(`${R} `)))&&(Z="blank",se="_",oe=te[1]);break;case'"':if(te=this._simpleQuotedString.exec(R))oe=te[1];else if(({value:oe,matchLength:Ce}=this._parseLiteral(R)),null===oe)return D(this);(null!==te||0!==Ce)&&(Z="literal",this._literalClosingPos=0);break;case"'":if(!this._lineMode){if(te=this._simpleApostropheString.exec(R))oe=te[1];else if(({value:oe,matchLength:Ce}=this._parseLiteral(R)),null===oe)return D(this);(null!==te||0!==Ce)&&(Z="literal",this._literalClosingPos=0)}break;case"?":this._n3Mode&&(te=this._variable.exec(R))&&(Z="var",oe=te[0]);break;case"@":"literal"===this._previousMarker&&(te=this._langcode.exec(R))?(Z="langcode",oe=te[1]):(te=this._keyword.exec(R))&&(Z=te[0]);break;case".":if(1===R.length?V:R[1]<"0"||R[1]>"9"){Z=".",Ce=1;break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"+":case"-":(te=this._number.exec(R)||V&&(te=this._number.exec(`${R} `)))&&(Z="literal",oe=te[0],se="string"==typeof te[1]?z.double:"string"==typeof te[2]?z.decimal:z.integer);break;case"B":case"b":case"p":case"P":case"G":case"g":(te=this._sparqlKeyword.exec(R))?Z=te[0].toUpperCase():me=!0;break;case"f":case"t":(te=this._boolean.exec(R))?(Z="literal",oe=te[0],se=z.boolean):me=!0;break;case"a":(te=this._shortPredicates.exec(R))?(Z="abbreviation",oe="a"):me=!0;break;case"=":this._n3Mode&&R.length>1&&(Z="abbreviation",">"!==R[1]?(Ce=1,oe="="):(Ce=2,oe=">"));break;case"!":if(!this._n3Mode)break;case",":case";":case"[":case"]":case"(":case")":case"{":case"}":this._lineMode||(Ce=1,Z=$);break;default:me=!0}if(me&&("@prefix"!==this._previousMarker&&"PREFIX"!==this._previousMarker||!(te=this._prefix.exec(R))?((te=this._prefixed.exec(R))||V&&(te=this._prefixed.exec(`${R} `)))&&(Z="prefixed",se=te[1]||"",oe=this._unescape(te[2])):(Z="prefix",oe=te[1]||"")),"^^"===this._previousMarker)switch(Z){case"prefixed":Z="type";break;case"IRI":Z="typeIRI";break;default:Z=""}if(!Z)return V||!/^'''|^"""/.test(R)&&/\n|\r/.test(R)?D(this):this._input=R;const ne=Ce||te[0].length,_e=ce(Z,oe,se,E,ne);this.previousToken=_e,this._previousMarker=Z,R=R.substr(ne,R.length)}function ce(I,X,E,$,Z){const oe=R?K-R.length:K,te={type:I,value:X,prefix:E,line:$,start:oe,end:oe+Z};return T(null,te),te}function D(I){T(I._syntaxError(/^\S*/.exec(R)[0]))}}_unescape(T){let V=!1;const R=T.replace(v,(K,ce,D,I)=>{if("string"==typeof ce)return String.fromCharCode(Number.parseInt(ce,16));if("string"==typeof D){let X=Number.parseInt(D,16);return X<=65535?String.fromCharCode(Number.parseInt(D,16)):String.fromCharCode(55296+((X-=65536)>>10),56320+(1023&X))}return I in x?x[I]:(V=!0,"")});return V?null:R}_parseLiteral(T){if(T.length>=3){const V=T.match(/^(?:"""|"|'''|'|)/)[0],R=V.length;let K=Math.max(this._literalClosingPos,R);for(;(K=T.indexOf(V,K))>0;){let ce=0;for(;"\\"===T[K-ce-1];)ce++;if(ce%2==0){const D=T.substring(R,K),I=D.split(/\r\n|\r|\n/).length-1,X=K+R;if(1===R&&0!==I||3===R&&this._lineMode)break;return this._line+=I,{value:this._unescape(D),matchLength:X}}K++}this._literalClosingPos=T.length-R+1}return{value:"",matchLength:0}}_syntaxError(T){this._input=null;const V=new Error(`Unexpected "${T}" on line ${this._line}.`);return V.context={token:void 0,line:this._line,previousToken:this.previousToken},V}_readStartingBom(T){return T.startsWith("\ufeff")?T.substr(1):T}tokenize(T,V){if(this._line=1,"string"==typeof T){if(this._input=this._readStartingBom(T),"function"!=typeof V){const R=[];let K;if(this._tokenizeToEnd((ce,D)=>ce?K=ce:R.push(D),!0),K)throw K;return R}(0,P.default)(()=>this._tokenizeToEnd(V,!0))}else this._pendingBuffer=null,"function"==typeof T.setEncoding&&T.setEncoding("utf8"),T.on("data",R=>{null!==this._input&&0!==R.length&&(this._pendingBuffer&&(R=W.concat([this._pendingBuffer,R]),this._pendingBuffer=null),128&R[R.length-1]?this._pendingBuffer=R:(void 0===this._input?this._input=this._readStartingBom("string"==typeof R?R:R.toString()):this._input+=R,this._tokenizeToEnd(V,!1)))}),T.on("end",()=>{"string"==typeof this._input&&this._tokenizeToEnd(V,!0)}),T.on("error",V)}}}).call(this)}).call(this,Y("buffer").Buffer)},{"./IRIs":34,buffer:6,"queue-microtask":45}],37:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.default=void 0;var W=Q(Y("./N3Lexer")),j=Q(Y("./N3DataFactory")),P=Q(Y("./IRIs"));function Q(A){return A&&A.__esModule?A:{default:A}}let z=0;class v{constructor(b){this._contextStack=[],this._graph=null,this._setBase((b=b||{}).baseIRI),b.factory&&O(this,b.factory);const y="string"==typeof b.format?b.format.match(/\w*$/)[0].toLowerCase():"",S=/turtle/.test(y),T=/trig/.test(y),V=/triple/.test(y),R=/quad/.test(y),K=this._n3Mode=/n3/.test(y),ce=V||R;(this._supportsNamedGraphs=!(S||K))||(this._readPredicateOrNamedGraph=this._readPredicate),this._supportsQuads=!(S||T||V||K),this._supportsRDFStar=""===y||/star|\*$/.test(y),ce&&(this._resolveRelativeIRI=D=>null),this._blankNodePrefix="string"!=typeof b.blankNodePrefix?"":b.blankNodePrefix.replace(/^(?!_:)/,"_:"),this._lexer=b.lexer||new W.default({lineMode:ce,n3:K}),this._explicitQuantifiers=!!b.explicitQuantifiers}static _resetBlankNodePrefix(){z=0}_setBase(b){if(b){const y=b.indexOf("#");y>=0&&(b=b.substr(0,y)),this._base=b,this._basePath=b.indexOf("/")<0?b:b.replace(/[^\/?]*(?:\?.*)?$/,""),b=b.match(/^(?:([a-z][a-z0-9+.-]*:))?(?:\/\/[^\/]*)?/i),this._baseRoot=b[0],this._baseScheme=b[1]}else this._base="",this._basePath=""}_saveContext(b,y,S,T,V){const R=this._n3Mode;this._contextStack.push({subject:S,predicate:T,object:V,graph:y,type:b,inverse:!!R&&this._inversePredicate,blankPrefix:R?this._prefixes._:"",quantified:R?this._quantified:null}),R&&(this._inversePredicate=!1,this._prefixes._=this._graph?`${this._graph.id.substr(2)}.`:".",this._quantified=Object.create(this._quantified))}_restoreContext(){const b=this._contextStack.pop(),y=this._n3Mode;this._subject=b.subject,this._predicate=b.predicate,this._object=b.object,this._graph=b.graph,y&&(this._inversePredicate=b.inverse,this._prefixes._=b.blankPrefix,this._quantified=b.quantified)}_readInTopContext(b){switch(b.type){case"eof":return null!==this._graph?this._error("Unclosed graph",b):(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(b)}}_readEntity(b,y){let S;switch(b.type){case"IRI":case"typeIRI":const T=this._resolveIRI(b.value);if(null===T)return this._error("Invalid IRI",b);S=this._namedNode(T);break;case"type":case"prefixed":const V=this._prefixes[b.prefix];if(void 0===V)return this._error(`Undefined prefix "${b.prefix}:"`,b);S=this._namedNode(V+b.value);break;case"blank":S=this._blankNode(this._prefixes[b.prefix]+b.value);break;case"var":S=this._variable(b.value.substr(1));break;default:return this._error(`Expected entity but got ${b.type}`,b)}return!y&&this._n3Mode&&S.id in this._quantified&&(S=this._quantified[S.id]),S}_readSubject(b){switch(this._predicate=null,b.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",b);case"}":return this._readPunctuation(b);case"@forSome":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORSOME,this._quantifier=this._blankNode,this._readQuantifierList):this._error('Unexpected "@forSome"',b);case"@forAll":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORALL,this._quantifier=this._variable,this._readQuantifierList):this._error('Unexpected "@forAll"',b);case"literal":if(!this._n3Mode)return this._error("Unexpected literal",b);if(0===b.prefix.length)return this._literalValue=b.value,this._completeSubjectLiteral;this._subject=this._literal(b.value,this._namedNode(b.prefix));break;case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,null,null,null),this._graph=null,this._readSubject):this._error("Unexpected RDF* syntax",b);default:if(void 0===(this._subject=this._readEntity(b)))return;if(this._n3Mode)return this._getPathReader(this._readPredicateOrNamedGraph)}return this._readPredicateOrNamedGraph}_readPredicate(b){const y=b.type;switch(y){case"inverse":this._inversePredicate=!0;case"abbreviation":this._predicate=this.ABBREVIATIONS[b.value];break;case".":case"]":case"}":return null===this._predicate?this._error(`Unexpected ${y}`,b):(this._subject=null,"]"===y?this._readBlankNodeTail(b):this._readPunctuation(b));case";":return null!==this._predicate?this._readPredicate:this._error("Expected predicate but got ;",b);case"[":if(this._n3Mode)return this._saveContext("blank",this._graph,this._subject,this._subject=this._blankNode(),null),this._readBlankNodeHead;case"blank":if(!this._n3Mode)return this._error("Disallowed blank node as predicate",b);default:if(void 0===(this._predicate=this._readEntity(b)))return}return this._readObject}_readObject(b){switch(b.type){case"literal":if(0===b.prefix.length)return this._literalValue=b.value,this._readDataTypeOrLang;this._object=this._literal(b.value,this._namedNode(b.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",b);case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,this._subject,this._predicate,null),this._graph=null,this._readSubject):this._error("Unexpected RDF* syntax",b);default:if(void 0===(this._object=this._readEntity(b)))return;if(this._n3Mode)return this._getPathReader(this._getContextEndReader())}return this._getContextEndReader()}_readPredicateOrNamedGraph(b){return"{"===b.type?this._readGraph(b):this._readPredicate(b)}_readGraph(b){return"{"!==b.type?this._error(`Expected graph but got ${b.type}`,b):(this._graph=this._subject,this._subject=null,this._readSubject)}_readBlankNodeHead(b){return"]"===b.type?(this._subject=null,this._readBlankNodeTail(b)):(this._predicate=null,this._readPredicate(b))}_readBlankNodeTail(b){if("]"!==b.type)return this._readBlankNodePunctuation(b);null!==this._subject&&this._emit(this._subject,this._predicate,this._object,this._graph);const y=null===this._predicate;return this._restoreContext(),null!==this._object?this._getContextEndReader():null!==this._predicate?this._readObject:y?this._readPredicateOrNamedGraph:this._readPredicateAfterBlank}_readPredicateAfterBlank(b){switch(b.type){case".":case"}":return this._subject=null,this._readPunctuation(b);default:return this._readPredicate(b)}}_readListItem(b){let y=null,S=null,T=this._readListItem;const V=this._subject,R=this._contextStack,K=R[R.length-1];switch(b.type){case"[":this._saveContext("blank",this._graph,S=this._blankNode(),this.RDF_FIRST,this._subject=y=this._blankNode()),T=this._readBlankNodeHead;break;case"(":this._saveContext("list",this._graph,S=this._blankNode(),this.RDF_FIRST,this.RDF_NIL),this._subject=null;break;case")":if(this._restoreContext(),0!==R.length&&"list"===R[R.length-1].type&&this._emit(this._subject,this._predicate,this._object,this._graph),null===this._predicate){if(T=this._readPredicate,this._subject===this.RDF_NIL)return T}else if(T=this._getContextEndReader(),this._object===this.RDF_NIL)return T;S=this.RDF_NIL;break;case"literal":0===b.prefix.length?(this._literalValue=b.value,T=this._readListItemDataTypeOrLang):(y=this._literal(b.value,this._namedNode(b.prefix)),T=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",b);default:if(void 0===(y=this._readEntity(b)))return}if(null===S&&(this._subject=S=this._blankNode()),null===V?null===K.predicate?K.subject=S:K.object=S:this._emit(V,this.RDF_REST,S,this._graph),null!==y){if(this._n3Mode&&("IRI"===b.type||"prefixed"===b.type))return this._saveContext("item",this._graph,S,this.RDF_FIRST,y),this._subject=y,this._predicate=null,this._getPathReader(this._readListItem);this._emit(S,this.RDF_FIRST,y,this._graph)}return T}_readDataTypeOrLang(b){return this._completeObjectLiteral(b,!1)}_readListItemDataTypeOrLang(b){return this._completeObjectLiteral(b,!0)}_completeLiteral(b){let y=this._literal(this._literalValue);switch(b.type){case"type":case"typeIRI":const S=this._readEntity(b);if(void 0===S)return;y=this._literal(this._literalValue,S),b=null;break;case"langcode":y=this._literal(this._literalValue,b.value),b=null}return{token:b,literal:y}}_completeSubjectLiteral(b){return this._subject=this._completeLiteral(b).literal,this._readPredicateOrNamedGraph}_completeObjectLiteral(b,y){const S=this._completeLiteral(b);if(S)return this._object=S.literal,y&&this._emit(this._subject,this.RDF_FIRST,this._object,this._graph),null===S.token?this._getContextEndReader():(this._readCallback=this._getContextEndReader(),this._readCallback(S.token))}_readFormulaTail(b){return"}"!==b.type?this._readPunctuation(b):(null!==this._subject&&this._emit(this._subject,this._predicate,this._object,this._graph),this._restoreContext(),null===this._object?this._readPredicate:this._getContextEndReader())}_readPunctuation(b){let y,S=this._graph;const T=this._subject,V=this._inversePredicate;switch(b.type){case"}":if(null===this._graph)return this._error("Unexpected graph closing",b);if(this._n3Mode)return this._readFormulaTail(b);this._graph=null;case".":this._subject=null,y=this._contextStack.length?this._readSubject:this._readInTopContext,V&&(this._inversePredicate=!1);break;case";":y=this._readPredicate;break;case",":y=this._readObject;break;default:if(this._supportsQuads&&null===this._graph&&void 0!==(S=this._readEntity(b))){y=this._readQuadPunctuation;break}return this._error(`Expected punctuation to follow "${this._object.id}"`,b)}if(null!==T){const R=this._predicate,K=this._object;V?this._emit(K,R,T,S):this._emit(T,R,K,S)}return y}_readBlankNodePunctuation(b){let y;switch(b.type){case";":y=this._readPredicate;break;case",":y=this._readObject;break;default:return this._error(`Expected punctuation to follow "${this._object.id}"`,b)}return this._emit(this._subject,this._predicate,this._object,this._graph),y}_readQuadPunctuation(b){return"."!==b.type?this._error("Expected dot to follow quad",b):this._readInTopContext}_readPrefix(b){return"prefix"!==b.type?this._error("Expected prefix to follow @prefix",b):(this._prefix=b.value,this._readPrefixIRI)}_readPrefixIRI(b){if("IRI"!==b.type)return this._error(`Expected IRI to follow prefix "${this._prefix}:"`,b);const y=this._readEntity(b);return this._prefixes[this._prefix]=y.value,this._prefixCallback(this._prefix,y),this._readDeclarationPunctuation}_readBaseIRI(b){const y="IRI"===b.type&&this._resolveIRI(b.value);return y?(this._setBase(y),this._readDeclarationPunctuation):this._error("Expected valid IRI to follow base declaration",b)}_readNamedGraphLabel(b){switch(b.type){case"IRI":case"blank":case"prefixed":return this._readSubject(b),this._readGraph;case"[":return this._readNamedGraphBlankLabel;default:return this._error("Invalid graph label",b)}}_readNamedGraphBlankLabel(b){return"]"!==b.type?this._error("Invalid graph label",b):(this._subject=this._blankNode(),this._readGraph)}_readDeclarationPunctuation(b){return this._sparqlStyle?(this._sparqlStyle=!1,this._readInTopContext(b)):"."!==b.type?this._error("Expected declaration to end with a dot",b):this._readInTopContext}_readQuantifierList(b){let y;switch(b.type){case"IRI":case"prefixed":if(void 0!==(y=this._readEntity(b,!0)))break;default:return this._error(`Unexpected ${b.type}`,b)}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(b){return","===b.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(b))}_getPathReader(b){return this._afterPath=b,this._readPath}_readPath(b){switch(b.type){case"!":return this._readForwardPath;case"^":return this._readBackwardPath;default:const y=this._contextStack,S=y.length&&y[y.length-1];if(S&&"item"===S.type){const T=this._subject;this._restoreContext(),this._emit(this._subject,this.RDF_FIRST,T,this._graph)}return this._afterPath(b)}}_readForwardPath(b){let y,S;const T=this._blankNode();if(void 0!==(S=this._readEntity(b)))return null===this._predicate?(y=this._subject,this._subject=T):(y=this._object,this._object=T),this._emit(y,S,T,this._graph),this._readPath}_readBackwardPath(b){const y=this._blankNode();let S,T;if(void 0!==(S=this._readEntity(b)))return null===this._predicate?(T=this._subject,this._subject=y):(T=this._object,this._object=y),this._emit(y,S,T,this._graph),this._readPath}_readRDFStarTailOrGraph(b){return">>"!==b.type?this._supportsQuads&&null===this._graph&&void 0!==(this._graph=this._readEntity(b))?this._readRDFStarTail:this._error(`Expected >> to follow "${this._object.id}"`,b):this._readRDFStarTail(b)}_readRDFStarTail(b){if(">>"!==b.type)return this._error(`Expected >> but got ${b.type}`,b);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 b=this._contextStack;if(!b.length)return this._readPunctuation;switch(b[b.length-1].type){case"blank":return this._readBlankNodeTail;case"list":return this._readListItem;case"formula":return this._readFormulaTail;case"<<":return this._readRDFStarTailOrGraph}}_emit(b,y,S,T){this._callback(null,this._quad(b,y,S,T||this.DEFAULTGRAPH))}_error(b,y){const S=new Error(`${b} on line ${y.line}.`);S.context={token:y,line:y.line,previousToken:this._lexer.previousToken},this._callback(S),this._callback=x}_resolveIRI(b){return/^[a-z][a-z0-9+.-]*:/i.test(b)?b:this._resolveRelativeIRI(b)}_resolveRelativeIRI(b){if(!b.length)return this._base;switch(b[0]){case"#":return this._base+b;case"?":return this._base.replace(/(?:\?.*)?$/,b);case"/":return("/"===b[1]?this._baseScheme:this._baseRoot)+this._removeDotSegments(b);default:return/^[^/:]*:/.test(b)?null:this._removeDotSegments(this._basePath+b)}}_removeDotSegments(b){if(!/(^|\/)\.\.?($|[/#?])/.test(b))return b;const y=b.length;let S="",T=-1,V=-1,R=0,K="/";for(;T=V&&(S=S.substr(0,R)),"/"!==K)return`${S}/${b.substr(T+1)}`;R=T+1}}}K=b[++T]}return S+b.substring(R)}parse(b,y,S){if(this._readCallback=this._readInTopContext,this._sparqlStyle=!1,this._prefixes=Object.create(null),this._prefixes._=this._blankNodePrefix?this._blankNodePrefix.substr(2):`b${z++}_`,this._prefixCallback=S||x,this._inversePredicate=!1,this._quantified=Object.create(null),!y){const T=[];let V;if(this._callback=(R,K)=>{R?V=R:K&&T.push(K)},this._lexer.tokenize(b).every(R=>this._readCallback=this._readCallback(R)),V)throw V;return T}this._callback=y,this._lexer.tokenize(b,(T,V)=>{null!==T?(this._callback(T),this._callback=x):this._readCallback&&(this._readCallback=this._readCallback(V))})}}function x(){}function O(A,b){const y=b.namedNode;A._namedNode=y,A._blankNode=b.blankNode,A._literal=b.literal,A._variable=b.variable,A._quad=b.quad,A.DEFAULTGRAPH=b.defaultGraph(),A.RDF_FIRST=y(P.default.rdf.first),A.RDF_REST=y(P.default.rdf.rest),A.RDF_NIL=y(P.default.rdf.nil),A.N3_FORALL=y(P.default.r.forAll),A.N3_FORSOME=y(P.default.r.forSome),A.ABBREVIATIONS={a:y(P.default.rdf.type),"=":y(P.default.owl.sameAs),">":y(P.default.log.implies)},A.QUANTIFIERS_GRAPH=y("urn:n3:quantifiers")}he.default=v,O(v.prototype,j.default)},{"./IRIs":34,"./N3DataFactory":35,"./N3Lexer":36}],38:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.default=void 0;var b,W=function(b,y){if(!y&&b&&b.__esModule)return b;if(null===b||"object"!=typeof b&&"function"!=typeof b)return{default:b};var S=z(y);if(S&&S.has(b))return S.get(b);var T={},V=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var R in b)if("default"!==R&&Object.prototype.hasOwnProperty.call(b,R)){var K=V?Object.getOwnPropertyDescriptor(b,R):null;K&&(K.get||K.set)?Object.defineProperty(T,R,K):T[R]=b[R]}return T.default=b,S&&S.set(b,T),T}(Y("./N3DataFactory")),j=Y("readable-stream"),P=(b=Y("./IRIs"))&&b.__esModule?b:{default:b};function z(b){if("function"!=typeof WeakMap)return null;var y=new WeakMap,S=new WeakMap;return(z=function(T){return T?S:y})(b)}class x{constructor(y,S){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,!S&&y&&!y[0]&&(S=y,y=null),this._factory=(S=S||{}).factory||W.default,y&&this.addQuads(y)}get size(){let y=this._size;if(null!==y)return y;y=0;const S=this._graphs;let T,V;for(const R in S)for(const K in T=S[R].subjects)for(const ce in V=T[K])y+=Object.keys(V[ce]).length;return this._size=y}_addToIndex(y,S,T,V){const R=y[S]||(y[S]={}),K=R[T]||(R[T]={}),ce=V in K;return ce||(K[V]=null),!ce}_removeFromIndex(y,S,T,V){const R=y[S],K=R[T];delete K[V];for(const ce in K)return;delete R[T];for(const ce in R)return;delete y[S]}*_findInIndex(y,S,T,V,R,K,ce,D){let I,X,E;const Z=!S+!T+!V>1?Object.keys(this._ids):this._entities,oe=(0,W.termFromId)(D,this._factory);S&&((I=y,y={})[S]=I[S]);for(const se in y){const te=Z[se];if(X=y[se]){T&&((I=X,X={})[T]=I[T]);for(const Ce in X){const me=Z[Ce];if(E=X[Ce]){const ne=V?V in E?[V]:[]:Object.keys(E);for(let _e=0;_e{T in S||(S[T]=!0,y((0,W.termFromId)(this._entities[T],this._factory)))}}add(y){return this.addQuad(y),this}addQuad(y,S,T,V){S||(V=y.graph,T=y.object,S=y.predicate,y=y.subject),y=(0,W.termToId)(y),S=(0,W.termToId)(S),T=(0,W.termToId)(T),V=(0,W.termToId)(V);let R=this._graphs[V];R||(R=this._graphs[V]={subjects:{},predicates:{},objects:{}},Object.freeze(R));const K=this._ids,ce=this._entities;y=K[y]||(K[ce[++this._id]=y]=this._id),S=K[S]||(K[ce[++this._id]=S]=this._id),T=K[T]||(K[ce[++this._id]=T]=this._id);const D=this._addToIndex(R.subjects,y,S,T);return this._addToIndex(R.predicates,S,T,y),this._addToIndex(R.objects,T,y,S),this._size=null,D}addQuads(y){for(let S=0;S{this.addQuad(S)}),y}removeQuad(y,S,T,V){S||(V=y.graph,T=y.object,S=y.predicate,y=y.subject),y=(0,W.termToId)(y),S=(0,W.termToId)(S),T=(0,W.termToId)(T),V=(0,W.termToId)(V);const R=this._ids,K=this._graphs;let ce,D,I;if(!((y=R[y])&&(S=R[S])&&(T=R[T])&&(ce=K[V])&&(D=ce.subjects[y])&&(I=D[S])&&T in I))return!1;for(y in this._removeFromIndex(ce.subjects,y,S,T),this._removeFromIndex(ce.predicates,S,T,y),this._removeFromIndex(ce.objects,T,y,S),null!==this._size&&this._size--,ce.subjects)return!0;return delete K[V],!0}removeQuads(y){for(let S=0;S{this.removeQuad(S)}),y}removeMatches(y,S,T,V){const R=new j.Readable({objectMode:!0});return R._read=()=>{for(const K of this.readQuads(y,S,T,V))R.push(K);R.push(null)},this.remove(R)}deleteGraph(y){return this.removeMatches(null,null,null,y)}getQuads(y,S,T,V){return[...this.readQuads(y,S,T,V)]}*readQuads(y,S,T,V){y=y&&(0,W.termToId)(y),S=S&&(0,W.termToId)(S),T=T&&(0,W.termToId)(T),V=V&&(0,W.termToId)(V);const R=this._getGraphs(V),K=this._ids;let ce,D,I,X;if(!(O(y)&&!(D=K[y])||O(S)&&!(I=K[S])||O(T)&&!(X=K[T])))for(const E in R)(ce=R[E])&&(D?X?yield*this._findInIndex(ce.objects,X,D,I,"object","subject","predicate",E,null,!0):yield*this._findInIndex(ce.subjects,D,I,null,"subject","predicate","object",E,null,!0):I?yield*this._findInIndex(ce.predicates,I,X,null,"predicate","object","subject",E,null,!0):X?yield*this._findInIndex(ce.objects,X,null,null,"object","subject","predicate",E,null,!0):yield*this._findInIndex(ce.subjects,null,null,null,"subject","predicate","object",E,null,!0))}match(y,S,T,V){return new A(this,y,S,T,V)}countQuads(y,S,T,V){y=y&&(0,W.termToId)(y),S=S&&(0,W.termToId)(S),T=T&&(0,W.termToId)(T),V=V&&(0,W.termToId)(V);const R=this._getGraphs(V),K=this._ids;let D,I,X,E,ce=0;if(O(y)&&!(I=K[y])||O(S)&&!(X=K[S])||O(T)&&!(E=K[T]))return 0;for(const $ in R)(D=R[$])&&(ce+=y?T?this._countInIndex(D.objects,E,I,X):this._countInIndex(D.subjects,I,X,E):S?this._countInIndex(D.predicates,X,E,I):this._countInIndex(D.objects,E,I,X));return ce}forEach(y,S,T,V,R){this.some(K=>(y(K),!1),S,T,V,R)}every(y,S,T,V,R){let K=!1;const ce=!this.some(D=>(K=!0,!y(D)),S,T,V,R);return K&&ce}some(y,S,T,V,R){for(const K of this.readQuads(S,T,V,R))if(y(K))return!0;return!1}getSubjects(y,S,T){const V=[];return this.forSubjects(R=>{V.push(R)},y,S,T),V}forSubjects(y,S,T,V){S=S&&(0,W.termToId)(S),T=T&&(0,W.termToId)(T),V=V&&(0,W.termToId)(V);const R=this._ids,K=this._getGraphs(V);let ce,D,I;if(y=this._uniqueEntities(y),!(O(S)&&!(D=R[S])||O(T)&&!(I=R[T])))for(V in K)(ce=K[V])&&(D?I?this._loopBy2Keys(ce.predicates,D,I,y):this._loopByKey1(ce.subjects,D,y):I?this._loopByKey0(ce.objects,I,y):this._loop(ce.subjects,y))}getPredicates(y,S,T){const V=[];return this.forPredicates(R=>{V.push(R)},y,S,T),V}forPredicates(y,S,T,V){S=S&&(0,W.termToId)(S),T=T&&(0,W.termToId)(T),V=V&&(0,W.termToId)(V);const R=this._ids,K=this._getGraphs(V);let ce,D,I;if(y=this._uniqueEntities(y),!(O(S)&&!(D=R[S])||O(T)&&!(I=R[T])))for(V in K)(ce=K[V])&&(D?I?this._loopBy2Keys(ce.objects,I,D,y):this._loopByKey0(ce.subjects,D,y):I?this._loopByKey1(ce.predicates,I,y):this._loop(ce.predicates,y))}getObjects(y,S,T){const V=[];return this.forObjects(R=>{V.push(R)},y,S,T),V}forObjects(y,S,T,V){S=S&&(0,W.termToId)(S),T=T&&(0,W.termToId)(T),V=V&&(0,W.termToId)(V);const R=this._ids,K=this._getGraphs(V);let ce,D,I;if(y=this._uniqueEntities(y),!(O(S)&&!(D=R[S])||O(T)&&!(I=R[T])))for(V in K)(ce=K[V])&&(D?I?this._loopBy2Keys(ce.subjects,D,I,y):this._loopByKey1(ce.objects,D,y):I?this._loopByKey0(ce.predicates,I,y):this._loop(ce.objects,y))}getGraphs(y,S,T){const V=[];return this.forGraphs(R=>{V.push(R)},y,S,T),V}forGraphs(y,S,T,V){for(const R in this._graphs)this.some(K=>(y(K.graph),!0),S,T,V,R)}createBlankNode(y){let S,T;if(y)for(S=y=`_:${y}`,T=1;this._ids[S];)S=y+T++;else do{S="_:b"+this._blankNodeIndex++}while(this._ids[S]);return this._ids[S]=++this._id,this._entities[this._id]=S,this._factory.blankNode(S.substr(2))}extractLists({remove:y=!1,ignoreErrors:S=!1}={}){const T={},V=S?()=>!0:(ce,D)=>{throw new Error(`${ce.value} ${D}`)},R=this.getQuads(null,P.default.rdf.rest,P.default.rdf.nil,null),K=y?[...R]:[];return R.forEach(ce=>{const D=[];let X,E,I=!1;const $=ce.graph;let Z=ce.subject;for(;Z&&!I;){const oe=this.getQuads(null,null,Z,null),se=this.getQuads(Z,null,null,null);let te,Ce=null,me=null,ne=null;for(let _e=0;_e{switch(b){case"data":O=y;break;case"end":A=y}}},(b,y)=>{b&&this.emit("error",b)||y&&this.push(y)},(b,y)=>{this.emit("prefix",b,y)}),this._transform=(b,y,S)=>{O(b),S()},this._flush=b=>{A(),b()}}import(v){return v.on("data",x=>{this.write(x)}),v.on("end",()=>{this.end()}),v.on("error",x=>{this.emit("error",x)}),this}}},{"./N3Parser":37,"readable-stream":81}],40:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.default=void 0;var z,W=Y("readable-stream"),j=(z=Y("./N3Writer"))&&z.__esModule?z:{default:z};he.default=class extends W.Transform{constructor(v){super({encoding:"utf8",writableObjectMode:!0});const x=this._writer=new j.default({write:(O,A,b)=>{this.push(O),b&&b()},end:O=>{this.push(null),O&&O()}},v);this._transform=(O,A,b)=>{x.addQuad(O,b)},this._flush=O=>{x.end(O)}}import(v){return v.on("data",x=>{this.write(x)}),v.on("end",()=>{this.end()}),v.on("error",x=>{this.emit("error",x)}),v.on("prefix",(x,O)=>{this._writer.addPrefix(x,O)}),this}}},{"./N3Writer":42,"readable-stream":81}],41:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.inDefaultGraph=function(y){return x(y.graph)},he.isBlankNode=function(y){return!!y&&"BlankNode"===y.termType},he.isDefaultGraph=x,he.isLiteral=function(y){return!!y&&"Literal"===y.termType},he.isNamedNode=function(y){return!!y&&"NamedNode"===y.termType},he.isVariable=function(y){return!!y&&"Variable"===y.termType},he.prefix=function(y,S){return b({"":y.value||y},S)("")},he.prefixes=b;var y,W=(y=Y("./N3DataFactory"))&&y.__esModule?y:{default:y};function x(y){return!!y&&"DefaultGraph"===y.termType}function b(y,S){const T=Object.create(null);for(const R in y)V(R,y[R]);function V(R,K){if("string"==typeof K){const ce=Object.create(null);T[R]=D=>ce[D]||(ce[D]=S.namedNode(K+D))}else if(!(R in T))throw new Error(`Unknown prefix: ${R}`);return T[R]}return S=S||W.default,V}},{"./N3DataFactory":35}],42:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.default=void 0;var ce,W=(ce=Y("./IRIs"))&&ce.__esModule?ce:{default:ce},j=function(ce,D){if(!D&&ce&&ce.__esModule)return ce;if(null===ce||"object"!=typeof ce&&"function"!=typeof ce)return{default:ce};var I=Q(D);if(I&&I.has(ce))return I.get(ce);var X={},E=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var $ in ce)if("default"!==$&&Object.prototype.hasOwnProperty.call(ce,$)){var Z=E?Object.getOwnPropertyDescriptor(ce,$):null;Z&&(Z.get||Z.set)?Object.defineProperty(X,$,Z):X[$]=ce[$]}return X.default=ce,I&&I.set(ce,X),X}(Y("./N3DataFactory")),P=Y("./N3Util");function Q(ce){if("function"!=typeof WeakMap)return null;var D=new WeakMap,I=new WeakMap;return(Q=function(X){return X?I:D})(ce)}const x=j.default.defaultGraph(),{rdf:O,xsd:A}=W.default,b=/["\\\t\n\r\b\f\u0000-\u0019\ud800-\udbff]/,y=/["\\\t\n\r\b\f\u0000-\u0019]|[\ud800-\udbff][\udc00-\udfff]/g,S={"\\":"\\\\",'"':'\\"',"\t":"\\t","\n":"\\n","\r":"\\r","\b":"\\b","\f":"\\f"};class T extends j.Term{equals(){return!1}}function R(ce){let D=S[ce];return void 0===D&&(1===ce.length?(D=ce.charCodeAt(0).toString(16),D="\\u0000".substr(0,6-D.length)+D):(D=(1024*(ce.charCodeAt(0)-55296)+ce.charCodeAt(1)+9216).toString(16),D="\\U00000000".substr(0,10-D.length)+D)),D}function K(ce){return ce.replace(/[\]\/\(\)\*\+\?\.\\\$]/g,"\\$&")}he.default=class{constructor(D,I){if(this._prefixRegex=/$0^/,D&&"function"!=typeof D.write&&(I=D,D=null),this._lists=(I=I||{}).lists,D)this._outputStream=D,this._endStream=void 0===I.end||!!I.end;else{let X="";this._outputStream={write(E,$,Z){X+=E,Z&&Z()},end:E=>{E&&E(null,X)}},this._endStream=!0}this._subject=null,/triple|quad/i.test(I.format)?(this._lineMode=!0,this._writeQuad=this._writeQuadLine):(this._lineMode=!1,this._graph=x,this._prefixIRIs=Object.create(null),I.prefixes&&this.addPrefixes(I.prefixes),I.baseIRI&&(this._baseMatcher=new RegExp(`^${K(I.baseIRI)}${I.baseIRI.endsWith("/")?"":"[#?]"}`),this._baseLength=I.baseIRI.length))}get _inDefaultGraph(){return x.equals(this._graph)}_write(D,I){this._outputStream.write(D,"utf8",I)}_writeQuad(D,I,X,E,$){try{E.equals(this._graph)||(this._write((null===this._subject?"":this._inDefaultGraph?".\n":"\n}\n")+(x.equals(E)?"":`${this._encodeIriOrBlank(E)} {\n`)),this._graph=E,this._subject=null),D.equals(this._subject)?I.equals(this._predicate)?this._write(`, ${this._encodeObject(X)}`,$):this._write(`;\n ${this._encodePredicate(this._predicate=I)} ${this._encodeObject(X)}`,$):this._write(`${(null===this._subject?"":".\n")+this._encodeSubject(this._subject=D)} ${this._encodePredicate(this._predicate=I)} ${this._encodeObject(X)}`,$)}catch(Z){$&&$(Z)}}_writeQuadLine(D,I,X,E,$){delete this._prefixMatch,this._write(this.quadToString(D,I,X,E),$)}quadToString(D,I,X,E){return`${this._encodeSubject(D)} ${this._encodeIriOrBlank(I)} ${this._encodeObject(X)}${E&&E.value?` ${this._encodeIriOrBlank(E)} .\n`:" .\n"}`}quadsToString(D){return D.map(I=>this.quadToString(I.subject,I.predicate,I.object,I.graph)).join("")}_encodeSubject(D){return"Quad"===D.termType?this._encodeQuad(D):this._encodeIriOrBlank(D)}_encodeIriOrBlank(D){if("NamedNode"!==D.termType)return this._lists&&D.value in this._lists&&(D=this.list(this._lists[D.value])),"id"in D?D.id:`_:${D.value}`;let I=D.value;this._baseMatcher&&this._baseMatcher.test(I)&&(I=I.substr(this._baseLength)),b.test(I)&&(I=I.replace(y,R));const X=this._prefixRegex.exec(I);return X?X[1]?this._prefixIRIs[X[1]]+X[2]:I:`<${I}>`}_encodeLiteral(D){let I=D.value;if(b.test(I)&&(I=I.replace(y,R)),D.language)return`"${I}"@${D.language}`;if(this._lineMode){if(D.datatype.value===A.string)return`"${I}"`}else switch(D.datatype.value){case A.string:return`"${I}"`;case A.boolean:if("true"===I||"false"===I)return I;break;case A.integer:if(/^[+-]?\d+$/.test(I))return I;break;case A.decimal:if(/^[+-]?\d*\.\d+$/.test(I))return I;break;case A.double:if(/^[+-]?(?:\d+\.\d*|\.?\d+)[eE][+-]?\d+$/.test(I))return I}return`"${I}"^^${this._encodeIriOrBlank(D.datatype)}`}_encodePredicate(D){return D.value===O.type?"a":this._encodeIriOrBlank(D)}_encodeObject(D){switch(D.termType){case"Quad":return this._encodeQuad(D);case"Literal":return this._encodeLiteral(D);default:return this._encodeIriOrBlank(D)}}_encodeQuad({subject:D,predicate:I,object:X,graph:E}){return`<<${this._encodeSubject(D)} ${this._encodePredicate(I)} ${this._encodeObject(X)}${(0,P.isDefaultGraph)(E)?"":` ${this._encodeIriOrBlank(E)}`}>>`}_blockedWrite(){throw new Error("Cannot write because the writer has been closed.")}addQuad(D,I,X,E,$){void 0===X?this._writeQuad(D.subject,D.predicate,D.object,D.graph,I):"function"==typeof E?this._writeQuad(D,I,X,x,E):this._writeQuad(D,I,X,E||x,$)}addQuads(D){for(let I=0;I.\n`)}if(X){let E="",$="";for(const Z in this._prefixIRIs)E+=E?`|${Z}`:Z,$+=($?"|":"")+this._prefixIRIs[Z];E=K(E),this._prefixRegex=new RegExp(`^(?:${$})[^/]*$|^(${E})([a-zA-Z][\\-_a-zA-Z0-9]*)$`)}this._write(X?"\n":"",I)}blank(D,I){let E,$,X=D;switch(void 0===D?X=[]:D.termType?X=[{predicate:D,object:I}]:"length"in D||(X=[D]),$=X.length){case 0:return new T("[]");case 1:if(E=X[0],!(E.object instanceof T))return new T(`[ ${this._encodePredicate(E.predicate)} ${this._encodeObject(E.object)} ]`);default:let Z="[";for(let oe=0;oe<$;oe++)E=X[oe],E.predicate.equals(D)?Z+=`, ${this._encodeObject(E.object)}`:(Z+=`${(oe?";\n ":"\n ")+this._encodePredicate(E.predicate)} ${this._encodeObject(E.object)}`,D=E.predicate);return new T(`${Z}\n]`)}}list(D){const I=D&&D.length||0,X=new Array(I);for(let E=0;E{I=null,D(X,E)});if(this._endStream)try{return this._outputStream.end(I)}catch(X){}I&&I()}}},{"./IRIs":34,"./N3DataFactory":35,"./N3Util":41}],43:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),Object.defineProperty(he,"BlankNode",{enumerable:!0,get:function(){return O.BlankNode}}),Object.defineProperty(he,"DataFactory",{enumerable:!0,get:function(){return O.default}}),Object.defineProperty(he,"DefaultGraph",{enumerable:!0,get:function(){return O.DefaultGraph}}),Object.defineProperty(he,"Lexer",{enumerable:!0,get:function(){return W.default}}),Object.defineProperty(he,"Literal",{enumerable:!0,get:function(){return O.Literal}}),Object.defineProperty(he,"NamedNode",{enumerable:!0,get:function(){return O.NamedNode}}),Object.defineProperty(he,"Parser",{enumerable:!0,get:function(){return j.default}}),Object.defineProperty(he,"Quad",{enumerable:!0,get:function(){return O.Quad}}),Object.defineProperty(he,"Store",{enumerable:!0,get:function(){return Q.default}}),Object.defineProperty(he,"StreamParser",{enumerable:!0,get:function(){return z.default}}),Object.defineProperty(he,"StreamWriter",{enumerable:!0,get:function(){return v.default}}),Object.defineProperty(he,"Term",{enumerable:!0,get:function(){return O.Term}}),Object.defineProperty(he,"Triple",{enumerable:!0,get:function(){return O.Triple}}),he.Util=void 0,Object.defineProperty(he,"Variable",{enumerable:!0,get:function(){return O.Variable}}),Object.defineProperty(he,"Writer",{enumerable:!0,get:function(){return P.default}}),he.default=void 0,Object.defineProperty(he,"termFromId",{enumerable:!0,get:function(){return O.termFromId}}),Object.defineProperty(he,"termToId",{enumerable:!0,get:function(){return O.termToId}});var W=y(Y("./N3Lexer")),j=y(Y("./N3Parser")),P=y(Y("./N3Writer")),Q=y(Y("./N3Store")),z=y(Y("./N3StreamParser")),v=y(Y("./N3StreamWriter")),x=b(Y("./N3Util"));he.Util=x;var O=b(Y("./N3DataFactory"));function A(T){if("function"!=typeof WeakMap)return null;var V=new WeakMap,R=new WeakMap;return(A=function(K){return K?R:V})(T)}function b(T,V){if(!V&&T&&T.__esModule)return T;if(null===T||"object"!=typeof T&&"function"!=typeof T)return{default:T};var R=A(V);if(R&&R.has(T))return R.get(T);var K={},ce=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var D in T)if("default"!==D&&Object.prototype.hasOwnProperty.call(T,D)){var I=ce?Object.getOwnPropertyDescriptor(T,D):null;I&&(I.get||I.set)?Object.defineProperty(K,D,I):K[D]=T[D]}return K.default=T,R&&R.set(T,K),K}function y(T){return T&&T.__esModule?T:{default:T}}he.default={Lexer:W.default,Parser:j.default,Writer:P.default,Store:Q.default,StreamParser:z.default,StreamWriter:v.default,Util:x,DataFactory:O.default,Term:O.Term,NamedNode:O.NamedNode,Literal:O.Literal,BlankNode:O.BlankNode,Variable:O.Variable,DefaultGraph:O.DefaultGraph,Quad:O.Quad,Triple:O.Triple,termFromId:O.termFromId,termToId:O.termToId}},{"./N3DataFactory":35,"./N3Lexer":36,"./N3Parser":37,"./N3Store":38,"./N3StreamParser":39,"./N3StreamWriter":40,"./N3Util":41,"./N3Writer":42}],44:[function(Y,Se,he){var j,P,W=Se.exports={};function Q(){throw new Error("setTimeout has not been defined")}function z(){throw new Error("clearTimeout has not been defined")}function v(K){if(j===setTimeout)return setTimeout(K,0);if((j===Q||!j)&&setTimeout)return j=setTimeout,setTimeout(K,0);try{return j(K,0)}catch(ce){try{return j.call(null,K,0)}catch(D){return j.call(this,K,0)}}}!function(){try{j="function"==typeof setTimeout?setTimeout:Q}catch(K){j=Q}try{P="function"==typeof clearTimeout?clearTimeout:z}catch(K){P=z}}();var b,O=[],A=!1,y=-1;function S(){!A||!b||(A=!1,b.length?O=b.concat(O):y=-1,O.length&&T())}function T(){if(!A){var K=v(S);A=!0;for(var ce=O.length;ce;){for(b=O,O=[];++y1)for(var D=1;D(j||(j=Promise.resolve())).then(P).catch(Q=>setTimeout(()=>{throw Q},0))}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],46:[function(Y,Se,he){Se.exports=Y("./lib")},{"./lib":55}],47:[function(Y,Se,he){"use strict";Se.exports=class Hq{constructor(j,P=new Map,Q=0){this.prefix=j,this._existing=P,this.counter=Q}clone(){const{prefix:j,_existing:P,counter:Q}=this;return new Hq(j,new Map(P),Q)}getId(j){const P=j&&this._existing.get(j);if(P)return P;const Q=this.prefix+this.counter;return this.counter++,j&&this._existing.set(j,Q),Q}hasId(j){return this._existing.has(j)}getOldIds(){return[...this._existing.keys()]}}},{}],48:[function(Y,Se,he){"use strict";Y("setimmediate");const W=self.crypto||self.msCrypto;Se.exports=class{constructor(P){if(!W||!W.subtle)throw new Error("crypto.subtle not found.");if("sha256"===P)this.algorithm={name:"SHA-256"};else{if("sha1"!==P)throw new Error(`Unsupport algorithm "${P}".`);this.algorithm={name:"SHA-1"}}this._content=""}update(P){this._content+=P}digest(){var P=this;return yt(function*(){const Q=(new TextEncoder).encode(P._content),z=new Uint8Array(yield W.subtle.digest(P.algorithm,Q));let v="";for(let x=0;x]*)>)|(_:(?:[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]*$'),Se.exports=class a2{static parse(K){const ce=[],D={},I=K.split(A.eoln);let X=0;for(const E of I){if(X++,A.empty.test(E))continue;const $=E.match(A.quad);if(null===$)throw new Error("N-Quads parse error on line "+X+".");const Z={subject:null,predicate:null,object:null,graph:null};if(Z.subject=void 0!==$[1]?{termType:z,value:$[1]}:{termType:v,value:$[2]},Z.predicate={termType:z,value:$[3]},void 0!==$[4]?Z.object={termType:z,value:$[4]}:void 0!==$[5]?Z.object={termType:v,value:$[5]}:(Z.object={termType:x,value:void 0,datatype:{termType:z}},void 0!==$[7]?Z.object.datatype.value=$[7]:void 0!==$[8]?(Z.object.datatype.value=P,Z.object.language=$[8]):Z.object.datatype.value=Q,Z.object.value=$[6].replace(T,function(K,ce,D,I){if(ce)switch(ce){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(I)throw new Error("Unsupported U escape")})),Z.graph=void 0!==$[9]?{termType:z,value:$[9]}:void 0!==$[10]?{termType:v,value:$[10]}:{termType:O,value:""},Z.graph.value in D){let oe=!0;const se=D[Z.graph.value];for(const te of se)if(b(te,Z)){oe=!1;break}oe&&(se.push(Z),ce.push(Z))}else D[Z.graph.value]=[Z],ce.push(Z)}return ce}static serialize(K){Array.isArray(K)||(K=a2.legacyDatasetToQuads(K));const ce=[];for(const D of K)ce.push(a2.serializeQuad(D));return ce.sort().join("")}static serializeQuad(K){const ce=K.subject,I=K.object,X=K.graph;let E="";return E+=ce.termType===z?`<${ce.value}>`:`${ce.value}`,E+=` <${K.predicate.value}> `,I.termType===z?E+=`<${I.value}>`:I.termType===v?E+=I.value:(E+=`"${R=I.value,R.replace(y,function(K){switch(K){case'"':return'\\"';case"\\":return"\\\\";case"\n":return"\\n";case"\r":return"\\r"}})}"`,I.datatype.value===P?I.language&&(E+=`@${I.language}`):I.datatype.value!==Q&&(E+=`^^<${I.datatype.value}>`)),X.termType===z?E+=` <${X.value}>`:X.termType===v&&(E+=` ${X.value}`),E+=" .\n",E;var R}static legacyDatasetToQuads(K){const ce=[],D={"blank node":v,IRI:z,literal:x};for(const I in K)K[I].forEach(E=>{const $={};for(const Z in E){const oe=E[Z],se={termType:D[oe.type],value:oe.value};se.termType===x&&(se.datatype={termType:z},"datatype"in oe&&(se.datatype.value=oe.datatype),"language"in oe?("datatype"in oe||(se.datatype.value=P),se.language=oe.language):"datatype"in oe||(se.datatype.value=Q)),$[Z]=se}$.graph="@default"===I?{termType:O,value:""}:{termType:I.startsWith("_:")?v:z,value:I},ce.push($)});return ce}};const y=/["\\\n\r]/g;const T=/(?:\\([tbnrf"'\\]))|(?:\\u([0-9A-Fa-f]{4}))|(?:\\U([0-9A-Fa-f]{8}))/g},{}],50:[function(Y,Se,he){"use strict";Se.exports=class{constructor(j){this.current=j.sort(),this.done=!1,this.dir=new Map;for(let P=0;Pz)&&(b&&O>0&&A>j[O-1]||!b&&Oj[O+1])&&(z=A,v=O)}if(null===z)this.done=!0;else{const O=P.get(z)?v-1:v+1;j[v]=j[O],j[O]=z;for(const A of j)A>z&&P.set(A,!P.get(A))}return Q}}},{}],51:[function(Y,Se,he){(function(W){(function(){"use strict";const j=Y("./IdentifierIssuer"),P=Y("./MessageDigest"),Q=Y("./Permuter"),z=Y("./NQuads");function v(x,O){return x.hashO.hash?1:0}Se.exports=class{constructor(){this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new j("_:c14n"),this.hashAlgorithm="sha256",this.quads=null}main(O){var A=this;return yt(function*(){A.quads=O;for(const K of O)A._addBlankNodeQuadInfo({quad:K,component:K.subject}),A._addBlankNodeQuadInfo({quad:K,component:K.object}),A._addBlankNodeQuadInfo({quad:K,component:K.graph});const b=new Map,y=[...A.blankNodeInfo.keys()];let S=0;for(const K of y)++S%100==0&&(yield A._yield()),yield A._hashAndTrackBlankNode({id:K,hashToBlankNodes:b});const T=[...b.keys()].sort(),V=[];for(const K of T){const ce=b.get(K);ce.length>1?V.push(ce):A.canonicalIssuer.getId(ce[0])}for(const K of V){const ce=[];for(const D of K){if(A.canonicalIssuer.hasId(D))continue;const I=new j("_:b");I.getId(D);const X=yield A.hashNDegreeQuads(D,I);ce.push(X)}ce.sort(v);for(const D of ce){const I=D.issuer.getOldIds();for(const X of I)A.canonicalIssuer.getId(X)}}const R=[];for(const K of A.quads){const ce=ot({},K);ce.subject=A._useCanonicalId({component:ce.subject}),ce.object=A._useCanonicalId({component:ce.object}),ce.graph=A._useCanonicalId({component:ce.graph}),R.push(z.serializeQuad(ce))}return R.sort(),R.join("")})()}hashFirstDegreeQuads(O){var A=this;return yt(function*(){const b=[],y=A.blankNodeInfo.get(O),S=y.quads;for(const V of S){const R={subject:null,predicate:V.predicate,object:null,graph:null};R.subject=A.modifyFirstDegreeComponent(O,V.subject,"subject"),R.object=A.modifyFirstDegreeComponent(O,V.object,"object"),R.graph=A.modifyFirstDegreeComponent(O,V.graph,"graph"),b.push(z.serializeQuad(R))}b.sort();const T=new P(A.hashAlgorithm);for(const V of b)T.update(V);return y.hash=yield T.digest(),y.hash})()}hashRelatedBlankNode(O,A,b,y){var S=this;return yt(function*(){let T;T=S.canonicalIssuer.hasId(O)?S.canonicalIssuer.getId(O):b.hasId(O)?b.getId(O):S.blankNodeInfo.get(O).hash;const V=new P(S.hashAlgorithm);return V.update(y),"g"!==y&&V.update(S.getRelatedPredicate(A)),V.update(T),V.digest()})()}hashNDegreeQuads(O,A){var b=this;return yt(function*(){const y=new P(b.hashAlgorithm),S=yield b.createHashToRelated(O,A),T=[...S.keys()].sort();for(const V of T){y.update(V);let K,R="";const ce=new Q(S.get(V));let D=0;for(;ce.hasNext();){const I=ce.next();++D%3==0&&(yield b._yield());let X=A.clone(),E="";const $=[];let Z=!1;for(const oe of I)if(b.canonicalIssuer.hasId(oe)?E+=b.canonicalIssuer.getId(oe):(X.hasId(oe)||$.push(oe),E+=X.getId(oe)),0!==R.length&&E>R){Z=!0;break}if(!Z){for(const oe of $){const se=yield b.hashNDegreeQuads(oe,X);if(E+=X.getId(oe),E+=`<${se.hash}>`,X=se.issuer,0!==R.length&&E>R){Z=!0;break}}Z||(0===R.length||E`}createHashToRelated(O,A){var b=this;return yt(function*(){const y=new Map,S=b.blankNodeInfo.get(O).quads;let T=0;for(const V of S)++T%100==0&&(yield b._yield()),yield Promise.all([b._addRelatedBlankNodeHash({quad:V,component:V.subject,position:"s",id:O,issuer:A,hashToRelated:y}),b._addRelatedBlankNodeHash({quad:V,component:V.object,position:"o",id:O,issuer:A,hashToRelated:y}),b._addRelatedBlankNodeHash({quad:V,component:V.graph,position:"g",id:O,issuer:A,hashToRelated:y})]);return y})()}_hashAndTrackBlankNode({id:O,hashToBlankNodes:A}){var b=this;return yt(function*(){const y=yield b.hashFirstDegreeQuads(O),S=A.get(y);S?S.push(O):A.set(y,[O])})()}_addBlankNodeQuadInfo({quad:O,component:A}){if("BlankNode"!==A.termType)return;const b=A.value,y=this.blankNodeInfo.get(b);y?y.quads.add(O):this.blankNodeInfo.set(b,{quads:new Set([O]),hash:null})}_addRelatedBlankNodeHash({quad:O,component:A,position:b,id:y,issuer:S,hashToRelated:T}){var V=this;return yt(function*(){if("BlankNode"!==A.termType||A.value===y)return;const R=A.value,K=yield V.hashRelatedBlankNode(R,O,S,b),ce=T.get(K);ce?ce.push(R):T.set(K,[R])})()}_useCanonicalId({component:O}){return"BlankNode"!==O.termType||O.value.startsWith(this.canonicalIssuer.prefix)?O:{termType:"BlankNode",value:this.canonicalIssuer.getId(O.value)}}_yield(){return yt(function*(){return new Promise(O=>W(O))})()}}}).call(this)}).call(this,Y("timers").setImmediate)},{"./IdentifierIssuer":47,"./MessageDigest":48,"./NQuads":49,"./Permuter":50,timers:89}],52:[function(Y,Se,he){"use strict";const W=Y("./IdentifierIssuer"),j=Y("./MessageDigest"),P=Y("./Permuter"),Q=Y("./NQuads");function z(v,x){return v.hashx.hash?1:0}Se.exports=class{constructor(){this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new W("_:c14n"),this.hashAlgorithm="sha256",this.quads=null}main(x){this.quads=x;for(const T of x)this._addBlankNodeQuadInfo({quad:T,component:T.subject}),this._addBlankNodeQuadInfo({quad:T,component:T.object}),this._addBlankNodeQuadInfo({quad:T,component:T.graph});const O=new Map,A=[...this.blankNodeInfo.keys()];for(const T of A)this._hashAndTrackBlankNode({id:T,hashToBlankNodes:O});const b=[...O.keys()].sort(),y=[];for(const T of b){const V=O.get(T);V.length>1?y.push(V):this.canonicalIssuer.getId(V[0])}for(const T of y){const V=[];for(const R of T){if(this.canonicalIssuer.hasId(R))continue;const K=new W("_:b");K.getId(R);const ce=this.hashNDegreeQuads(R,K);V.push(ce)}V.sort(z);for(const R of V){const K=R.issuer.getOldIds();for(const ce of K)this.canonicalIssuer.getId(ce)}}const S=[];for(const T of this.quads){const V=ot({},T);V.subject=this._useCanonicalId({component:V.subject}),V.object=this._useCanonicalId({component:V.object}),V.graph=this._useCanonicalId({component:V.graph}),S.push(Q.serializeQuad(V))}return S.sort(),S.join("")}hashFirstDegreeQuads(x){const O=[],A=this.blankNodeInfo.get(x),b=A.quads;for(const S of b){const T={subject:null,predicate:S.predicate,object:null,graph:null};T.subject=this.modifyFirstDegreeComponent(x,S.subject,"subject"),T.object=this.modifyFirstDegreeComponent(x,S.object,"object"),T.graph=this.modifyFirstDegreeComponent(x,S.graph,"graph"),O.push(Q.serializeQuad(T))}O.sort();const y=new j(this.hashAlgorithm);for(const S of O)y.update(S);return A.hash=y.digest(),A.hash}hashRelatedBlankNode(x,O,A,b){let y;y=this.canonicalIssuer.hasId(x)?this.canonicalIssuer.getId(x):A.hasId(x)?A.getId(x):this.blankNodeInfo.get(x).hash;const S=new j(this.hashAlgorithm);return S.update(b),"g"!==b&&S.update(this.getRelatedPredicate(O)),S.update(y),S.digest()}hashNDegreeQuads(x,O){const A=new j(this.hashAlgorithm),b=this.createHashToRelated(x,O),y=[...b.keys()].sort();for(const S of y){A.update(S);let V,T="";const R=new P(b.get(S));for(;R.hasNext();){const K=R.next();let ce=O.clone(),D="";const I=[];let X=!1;for(const E of K)if(this.canonicalIssuer.hasId(E)?D+=this.canonicalIssuer.getId(E):(ce.hasId(E)||I.push(E),D+=ce.getId(E)),0!==T.length&&D>T){X=!0;break}if(!X){for(const E of I){const $=this.hashNDegreeQuads(E,ce);if(D+=ce.getId(E),D+=`<${$.hash}>`,ce=$.issuer,0!==T.length&&D>T){X=!0;break}}X||(0===T.length||D`}createHashToRelated(x,O){const A=new Map,b=this.blankNodeInfo.get(x).quads;for(const y of b)this._addRelatedBlankNodeHash({quad:y,component:y.subject,position:"s",id:x,issuer:O,hashToRelated:A}),this._addRelatedBlankNodeHash({quad:y,component:y.object,position:"o",id:x,issuer:O,hashToRelated:A}),this._addRelatedBlankNodeHash({quad:y,component:y.graph,position:"g",id:x,issuer:O,hashToRelated:A});return A}_hashAndTrackBlankNode({id:x,hashToBlankNodes:O}){const A=this.hashFirstDegreeQuads(x),b=O.get(A);b?b.push(x):O.set(A,[x])}_addBlankNodeQuadInfo({quad:x,component:O}){if("BlankNode"!==O.termType)return;const A=O.value,b=this.blankNodeInfo.get(A);b?b.quads.add(x):this.blankNodeInfo.set(A,{quads:new Set([x]),hash:null})}_addRelatedBlankNodeHash({quad:x,component:O,position:A,id:b,issuer:y,hashToRelated:S}){if("BlankNode"!==O.termType||O.value===b)return;const T=O.value,V=this.hashRelatedBlankNode(T,x,y,A),R=S.get(V);R?R.push(T):S.set(V,[T])}_useCanonicalId({component:x}){return"BlankNode"!==x.termType||x.value.startsWith(this.canonicalIssuer.prefix)?x:{termType:"BlankNode",value:this.canonicalIssuer.getId(x.value)}}}},{"./IdentifierIssuer":47,"./MessageDigest":48,"./NQuads":49,"./Permuter":50}],53:[function(Y,Se,he){"use strict";const W=Y("./URDNA2015");Se.exports=class extends W{constructor(){super(),this.name="URGNA2012",this.hashAlgorithm="sha1"}modifyFirstDegreeComponent(P,Q,z){return"BlankNode"!==Q.termType?Q:"graph"===z?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:Q.value===P?"_:a":"_:z"}}getRelatedPredicate(P){return P.predicate.value}createHashToRelated(P,Q){var z=this;return yt(function*(){const v=new Map,x=z.blankNodeInfo.get(P).quads;let O=0;for(const A of x){let b,y;if("BlankNode"===A.subject.termType&&A.subject.value!==P)y=A.subject.value,b="p";else{if("BlankNode"!==A.object.termType||A.object.value===P)continue;y=A.object.value,b="r"}++O%100==0&&(yield z._yield());const S=yield z.hashRelatedBlankNode(y,A,Q,b),T=v.get(S);T?T.push(y):v.set(S,[y])}return v})()}}},{"./URDNA2015":51}],54:[function(Y,Se,he){"use strict";const W=Y("./URDNA2015Sync");Se.exports=class extends W{constructor(){super(),this.name="URGNA2012",this.hashAlgorithm="sha1"}modifyFirstDegreeComponent(P,Q,z){return"BlankNode"!==Q.termType?Q:"graph"===z?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:Q.value===P?"_:a":"_:z"}}getRelatedPredicate(P){return P.predicate.value}createHashToRelated(P,Q){const z=new Map,v=this.blankNodeInfo.get(P).quads;for(const x of v){let O,A;if("BlankNode"===x.subject.termType&&x.subject.value!==P)A=x.subject.value,O="p";else{if("BlankNode"!==x.object.termType||x.object.value===P)continue;A=x.object.value,O="r"}const b=this.hashRelatedBlankNode(A,x,Q,O),y=z.get(b);y?y.push(A):z.set(b,[A])}return z}}},{"./URDNA2015Sync":52}],55:[function(Y,Se,he){"use strict";const W=Y("./URDNA2015"),j=Y("./URGNA2012"),P=Y("./URDNA2015Sync"),Q=Y("./URGNA2012Sync");let z;try{z=Y("rdf-canonize-native")}catch(x){}const v={};Se.exports=v,v.NQuads=Y("./NQuads"),v.IdentifierIssuer=Y("./IdentifierIssuer"),v._rdfCanonizeNative=function(x){return x&&(z=x),z},v.canonize=function(){var x=yt(function*(O,A){if(Array.isArray(O)||(O=v.NQuads.legacyDatasetToQuads(O)),A.useNative){if(!z)throw new Error("rdf-canonize-native not available");return new Promise((b,y)=>z.canonize(O,A,(S,T)=>S?y(S):b(T)))}if("URDNA2015"===A.algorithm)return new W(A).main(O);if("URGNA2012"===A.algorithm)return new j(A).main(O);throw"algorithm"in A?new Error("Invalid RDF Dataset Canonicalization algorithm: "+A.algorithm):new Error("No RDF Dataset Canonicalization algorithm specified.")});return function(O,A){return x.apply(this,arguments)}}(),v._canonizeSync=function(x,O){if(Array.isArray(x)||(x=v.NQuads.legacyDatasetToQuads(x)),O.useNative){if(z)return z.canonizeSync(x,O);throw new Error("rdf-canonize-native not available")}if("URDNA2015"===O.algorithm)return new P(O).main(x);if("URGNA2012"===O.algorithm)return new Q(O).main(x);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(Y,Se,he){"use strict";var W=this&&this.__createBinding||(Object.create?function(P,Q,z,v){void 0===v&&(v=z),Object.defineProperty(P,v,{enumerable:!0,get:function(){return Q[z]}})}:function(P,Q,z,v){void 0===v&&(v=z),P[v]=Q[z]}),j=this&&this.__exportStar||function(P,Q){for(var z in P)"default"!==z&&!Object.prototype.hasOwnProperty.call(Q,z)&&W(Q,P,z)};Object.defineProperty(he,"__esModule",{value:!0}),j(Y("./lib/BlankNode"),he),j(Y("./lib/DataFactory"),he),j(Y("./lib/DefaultGraph"),he),j(Y("./lib/Literal"),he),j(Y("./lib/NamedNode"),he),j(Y("./lib/Quad"),he),j(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,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.BlankNode=void 0;he.BlankNode=class{constructor(P){this.termType="BlankNode",this.value=P}equals(P){return!!P&&"BlankNode"===P.termType&&P.value===this.value}}},{}],58:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.DataFactory=void 0;const W=Y("./BlankNode"),j=Y("./DefaultGraph"),P=Y("./Literal"),Q=Y("./NamedNode"),z=Y("./Quad"),v=Y("./Variable");let x=0;he.DataFactory=class{constructor(b){this.blankNodeCounter=0,this.blankNodePrefix=(b=b||{}).blankNodePrefix||`df_${x++}_`}namedNode(b){return new Q.NamedNode(b)}blankNode(b){return new W.BlankNode(b||`${this.blankNodePrefix}${this.blankNodeCounter++}`)}literal(b,y){return new P.Literal(b,y)}variable(b){return new v.Variable(b)}defaultGraph(){return j.DefaultGraph.INSTANCE}quad(b,y,S,T){return new z.Quad(b,y,S,T||this.defaultGraph())}fromTerm(b){switch(b.termType){case"NamedNode":return this.namedNode(b.value);case"BlankNode":return this.blankNode(b.value);case"Literal":return b.language?this.literal(b.value,b.language):b.datatype.equals(P.Literal.XSD_STRING)?this.literal(b.value):this.literal(b.value,this.fromTerm(b.datatype));case"Variable":return this.variable(b.value);case"DefaultGraph":return this.defaultGraph();case"Quad":return this.quad(this.fromTerm(b.subject),this.fromTerm(b.predicate),this.fromTerm(b.object),this.fromTerm(b.graph))}}fromQuad(b){return this.fromTerm(b)}resetBlankNodeCounter(){this.blankNodeCounter=0}}},{"./BlankNode":57,"./DefaultGraph":59,"./Literal":60,"./NamedNode":61,"./Quad":62,"./Variable":63}],59:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.DefaultGraph=void 0;class W{constructor(){this.termType="DefaultGraph",this.value=""}equals(P){return!!P&&"DefaultGraph"===P.termType}}he.DefaultGraph=W,W.INSTANCE=new W},{}],60:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.Literal=void 0;const W=Y("./NamedNode");class j{constructor(Q,z){this.termType="Literal",this.value=Q,"string"==typeof z?(this.language=z,this.datatype=j.RDF_LANGUAGE_STRING):z?(this.language="",this.datatype=z):(this.language="",this.datatype=j.XSD_STRING)}equals(Q){return!!Q&&"Literal"===Q.termType&&Q.value===this.value&&Q.language===this.language&&Q.datatype.equals(this.datatype)}}he.Literal=j,j.RDF_LANGUAGE_STRING=new W.NamedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),j.XSD_STRING=new W.NamedNode("http://www.w3.org/2001/XMLSchema#string")},{"./NamedNode":61}],61:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.NamedNode=void 0;he.NamedNode=class{constructor(P){this.termType="NamedNode",this.value=P}equals(P){return!!P&&"NamedNode"===P.termType&&P.value===this.value}}},{}],62:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.Quad=void 0;he.Quad=class{constructor(P,Q,z,v){this.termType="Quad",this.value="",this.subject=P,this.predicate=Q,this.object=z,this.graph=v}equals(P){return!!P&&("Quad"===P.termType||!P.termType)&&this.subject.equals(P.subject)&&this.predicate.equals(P.predicate)&&this.object.equals(P.object)&&this.graph.equals(P.graph)}}},{}],63:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.Variable=void 0;he.Variable=class{constructor(P){this.termType="Variable",this.value=P}equals(P){return!!P&&"Variable"===P.termType&&P.value===this.value}}},{}],64:[function(Y,Se,he){"use strict";var W=this&&this.__createBinding||(Object.create?function(P,Q,z,v){void 0===v&&(v=z),Object.defineProperty(P,v,{enumerable:!0,get:function(){return Q[z]}})}:function(P,Q,z,v){void 0===v&&(v=z),P[v]=Q[z]}),j=this&&this.__exportStar||function(P,Q){for(var z in P)"default"!==z&&!Object.prototype.hasOwnProperty.call(Q,z)&&W(Q,P,z)};Object.defineProperty(he,"__esModule",{value:!0}),j(Y("./lib/RdfXmlParser"),he)},{"./lib/RdfXmlParser":66}],65:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.ParseError=void 0;class W extends Error{constructor(P,Q){const z=P.saxStream._parser;super(P.trackPosition?`Line ${z.line+1} column ${z.column+1}: ${Q}`:Q)}}he.ParseError=W},{}],66:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.ParseType=he.RdfXmlParser=void 0;const W=Y("relative-to-absolute-iri"),j=Y("sax"),P=Y("stream"),Q=Y("./ParseError"),z=Y("rdf-data-factory");class v extends P.Transform{constructor(A){super({readableObjectMode:!0}),this.activeTagStack=[],this.nodeIds={},A&&(Object.assign(this,A),this.options=A),this.dataFactory||(this.dataFactory=new z.DataFactory),this.baseIRI||(this.baseIRI=""),this.defaultGraph||(this.defaultGraph=this.dataFactory.defaultGraph()),this.saxStream=j.createStream(this.strict,{xmlns:!1,position:this.trackPosition}),this.strict||(this.saxStream._parser.looseCase="toString"),this.attachSaxListeners()}static parseNamespace(A,b){const y={};let S=!1;for(const V in A.attributes)V.startsWith("xmlns")&&(5===V.length?(S=!0,y[""]=A.attributes[V]):":"===V.charAt(5)&&(S=!0,y[V.substr(6)]=A.attributes[V]));const T=b&&b.ns?b.ns:[v.DEFAULT_NS];return S?T.concat([y]):T}static expandPrefixedTerm(A,b,y){const S=A.indexOf(":");let T,V;S>=0?(T=A.substr(0,S),V=A.substr(S+1)):(T="",V=A);let R=null,K=null;for(let ce=b.length-1;ce>=0;ce--){const D=b[ce][T];if(D){R=D;break}K||(K=b[ce][""])}if(!R){if(T&&"xmlns"!==T)throw new Q.ParseError(y,`The prefix '${T}' in term '${A}' was not bound.`);R=K||""}return{prefix:T,local:V,uri:R}}static isValidIri(A){return v.IRI_REGEX.test(A)}import(A){const b=new P.PassThrough({readableObjectMode:!0});A.on("error",S=>y.emit("error",S)),A.on("data",S=>b.push(S)),A.on("end",()=>b.push(null));const y=b.pipe(new v(this.options));return y}_transform(A,b,y){try{this.saxStream.write(A,b)}catch(S){return y(S)}y()}newParseError(A){return new Q.ParseError(this,A)}valueToUri(A,b){return this.uriToNamedNode(W.resolve(A,b.baseIRI))}uriToNamedNode(A){if(!v.isValidIri(A))throw this.newParseError(`Invalid URI: ${A}`);return this.dataFactory.namedNode(A)}validateNcname(A){if(!v.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 b=this.activeTagStack.length?this.activeTagStack[this.activeTagStack.length-1]:null;let y=x.RESOURCE;if(b&&(b.hadChildren=!0,y=b.childrenParseType),b&&b.childrenStringTags){const T=A.name;let V="";for(const D in A.attributes)V+=` ${D}="${A.attributes[D]}"`;b.childrenStringTags.push(`<${T}${V}>`);const ce={childrenStringTags:b.childrenStringTags};return ce.childrenStringEmitClosingTag=``,void this.activeTagStack.push(ce)}const S={};b?(S.language=b.language,S.baseIRI=b.baseIRI):S.baseIRI=this.baseIRI,this.activeTagStack.push(S),S.ns=v.parseNamespace(A,b),y===x.RESOURCE?this.onTagResource(A,S,b,!b):this.onTagProperty(A,S,b)}onTagResource(A,b,y,S){const T=v.expandPrefixedTerm(A.name,b.ns,this);b.childrenParseType=x.PROPERTY;let V=!0;if(T.uri===v.RDF){if(!S&&v.FORBIDDEN_NODE_ELEMENTS.indexOf(T.local)>=0)throw this.newParseError(`Illegal node element name: ${T.local}`);switch(T.local){case"RDF":b.childrenParseType=x.RESOURCE;case"Description":V=!1}}const R=[],K=[];let ce=null,D=!1,I=!1,X=null;for(const E in A.attributes){const $=A.attributes[E],Z=v.expandPrefixedTerm(E,b.ns,this);if(y&&Z.uri===v.RDF)switch(Z.local){case"about":if(ce)throw this.newParseError(`Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ${$} and ${ce} where found.`);ce=$;continue;case"ID":if(ce)throw this.newParseError(`Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ${$} and ${ce} where found.`);this.validateNcname($),ce="#"+$,D=!0;continue;case"nodeID":if(ce)throw this.newParseError(`Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ${$} and ${ce} where found.`);this.validateNcname($),ce=$,I=!0;continue;case"bagID":throw this.newParseError("rdf:bagID is not supported.");case"type":X=$;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(Z.uri===v.XML){if("lang"===Z.local){b.language=""===$?null:$.toLowerCase();continue}if("base"===Z.local){b.baseIRI=W.resolve($,b.baseIRI);continue}}"xml"!==Z.prefix&&Z.uri&&(R.push(this.uriToNamedNode(Z.uri+Z.local)),K.push($))}if(null!==ce&&(b.subject=I?this.dataFactory.blankNode(ce):this.valueToUri(ce,b),D&&this.claimNodeId(b.subject)),b.subject||(b.subject=this.dataFactory.blankNode()),V){const E=this.uriToNamedNode(T.uri+T.local);this.emitTriple(b.subject,this.dataFactory.namedNode(v.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(v.RDF+"first"),b.subject,b.reifiedStatementId),y.childrenCollectionSubject=E,y.childrenCollectionPredicate=this.dataFactory.namedNode(v.RDF+"rest")}else{this.emitTriple(y.subject,y.predicate,b.subject,y.reifiedStatementId);for(let E=0;E=0)throw this.newParseError(`Illegal property element name: ${S.local}`);b.predicateSubPredicates=[],b.predicateSubObjects=[];let T=!1,V=!1,R=null,K=!0;const ce=[],D=[];for(const I in A.attributes){const X=A.attributes[I],E=v.expandPrefixedTerm(I,b.ns,this);if(E.uri===v.RDF)switch(E.local){case"resource":if(R)throw this.newParseError(`Found both rdf:resource (${X}) and rdf:nodeID (${R}).`);if(T)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:resource (${X})`);b.hadChildren=!0,R=X,K=!1;continue;case"datatype":if(V)throw this.newParseError(`Found both non-rdf:* property attributes and rdf:datatype (${X}).`);if(T)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:datatype (${X})`);b.datatype=this.valueToUri(X,b);continue;case"nodeID":if(V)throw this.newParseError(`Found both non-rdf:* property attributes and rdf:nodeID (${X}).`);if(b.hadChildren)throw this.newParseError(`Found both rdf:resource and rdf:nodeID (${X}).`);if(T)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:nodeID (${X})`);this.validateNcname(X),b.hadChildren=!0,R=X,K=!0;continue;case"bagID":throw this.newParseError("rdf:bagID is not supported.");case"parseType":if(V)throw this.newParseError("rdf:parseType is not allowed when non-rdf:* property attributes are present");if(b.datatype)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:datatype (${b.datatype.value})`);if(R)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:nodeID or rdf:resource (${R})`);if("Resource"===X){T=!0,b.childrenParseType=x.PROPERTY;const $=this.dataFactory.blankNode();this.emitTriple(b.subject,b.predicate,$,b.reifiedStatementId),b.subject=$,b.predicate=null}else"Collection"===X?(T=!0,b.hadChildren=!0,b.childrenCollectionSubject=b.subject,b.childrenCollectionPredicate=b.predicate,K=!1):"Literal"===X&&(T=!0,b.childrenTagsToString=!0,b.childrenStringTags=[]);continue;case"ID":this.validateNcname(X),b.reifiedStatementId=this.valueToUri("#"+X,b),this.claimNodeId(b.reifiedStatementId);continue}else if(E.uri===v.XML&&"lang"===E.local){b.language=""===X?null:X.toLowerCase();continue}if("xml"!==E.prefix&&"xmlns"!==E.prefix&&E.uri){if(T||b.datatype)throw this.newParseError(`Found illegal rdf:* properties on property element with attribute: ${X}`);b.hadChildren=!0,V=!0,ce.push(this.uriToNamedNode(E.uri+E.local)),D.push(this.dataFactory.literal(X,b.datatype||b.language))}}if(null!==R){const I=b.subject;b.subject=K?this.dataFactory.blankNode(R):this.valueToUri(R,b),this.emitTriple(I,b.predicate,b.subject,b.reifiedStatementId);for(let X=0;X/g,(b,y,S)=>(this.saxStream._parser.ENTITIES[y]=S,""))}}var x,O;he.RdfXmlParser=v,v.IRI_REGEX=/^([A-Za-z][A-Za-z0-9+-.]*):[^ "<>{}|\\\[\]`]*$/,v.MIME_TYPE="application/rdf+xml",v.RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#",v.XML="http://www.w3.org/XML/1998/namespace",v.XMLNS="http://www.w3.org/2000/xmlns/",v.DEFAULT_NS={xml:v.XML},v.FORBIDDEN_NODE_ELEMENTS=["RDF","ID","about","bagID","parseType","resource","nodeID","li","aboutEach","aboutEachPrefix"],v.FORBIDDEN_PROPERTY_ELEMENTS=["Description","RDF","ID","about","bagID","parseType","resource","nodeID","aboutEach","aboutEachPrefix"],v.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=x=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(Y,Se,he){"use strict";var j={};function P(O,A,b){b||(b=Error);var S=function(T){function V(R,K,ce){return T.call(this,function(T,V,R){return"string"==typeof A?A:A(T,V,R)}(R,K,ce))||this}return function(O,A){O.prototype=Object.create(A.prototype),O.prototype.constructor=O,O.__proto__=A}(V,T),V}(b);S.prototype.name=b.name,S.prototype.code=O,j[O]=S}function Q(O,A){if(Array.isArray(O)){var b=O.length;return O=O.map(function(y){return String(y)}),b>2?"one of ".concat(A," ").concat(O.slice(0,b-1).join(", "),", or ")+O[b-1]:2===b?"one of ".concat(A," ").concat(O[0]," or ").concat(O[1]):"of ".concat(A," ").concat(O[0])}return"of ".concat(A," ").concat(String(O))}P("ERR_INVALID_OPT_VALUE",function(O,A){return'The value "'+A+'" is invalid for option "'+O+'"'},TypeError),P("ERR_INVALID_ARG_TYPE",function(O,A,b){var y,S;if("string"==typeof A&&function(O,A,b){return O.substr(!b||b<0?0:+b,A.length)===A}(A,"not ")?(y="must not be",A=A.replace(/^not /,"")):y="must be",function(O,A,b){return(void 0===b||b>O.length)&&(b=O.length),O.substring(b-A.length,b)===A}(O," argument"))S="The ".concat(O," ").concat(y," ").concat(Q(A,"type"));else{var T=function(O,A,b){return"number"!=typeof b&&(b=0),!(b+A.length>O.length)&&-1!==O.indexOf(A,b)}(O,".")?"property":"argument";S='The "'.concat(O,'" ').concat(T," ").concat(y," ").concat(Q(A,"type"))}return S+". Received type ".concat(typeof b)},TypeError),P("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),P("ERR_METHOD_NOT_IMPLEMENTED",function(O){return"The "+O+" method is not implemented"}),P("ERR_STREAM_PREMATURE_CLOSE","Premature close"),P("ERR_STREAM_DESTROYED",function(O){return"Cannot call "+O+" after a stream was destroyed"}),P("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),P("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),P("ERR_STREAM_WRITE_AFTER_END","write after end"),P("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),P("ERR_UNKNOWN_ENCODING",function(O){return"Unknown encoding: "+O},TypeError),P("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),Se.exports.codes=j},{}],68:[function(Y,Se,he){(function(W){(function(){"use strict";var j=Object.keys||function(y){var S=[];for(var T in y)S.push(T);return S};Se.exports=O;var P=Y("./_stream_readable"),Q=Y("./_stream_writable");Y("inherits")(O,P);for(var z=j(Q.prototype),v=0;v0)if("string"!=typeof L&&!Qe.objectMode&&Object.getPrototypeOf(L)!==x.prototype&&(L=function(ve){return x.from(ve)}(L)),B)Qe.endEmitted?se(ve,new E):Ie(ve,Qe,L,!0);else if(Qe.ended)se(ve,new I);else{if(Qe.destroyed)return!1;Qe.reading=!1,Qe.decoder&&!N?(L=Qe.decoder.write(L),Qe.objectMode||0!==L.length?Ie(ve,Qe,L,!1):Ke(ve,Qe)):Ie(ve,Qe,L,!1)}else B||(Qe.reading=!1,Ke(ve,Qe));return!Qe.ended&&(Qe.lengthL.highWaterMark&&(L.highWaterMark=function(ve){return ve>=st?ve=st:(ve--,ve|=ve>>>1,ve|=ve>>>2,ve|=ve>>>4,ve|=ve>>>8,ve|=ve>>>16,ve++),ve}(ve)),ve<=L.length?ve:L.ended?L.length:(L.needReadable=!0,0))}function Ue(ve){var L=ve._readableState;S("emitReadable",L.needReadable,L.emittedReadable),L.needReadable=!1,L.emittedReadable||(S("emitReadable",L.flowing),L.emittedReadable=!0,W.nextTick(ke,ve))}function ke(ve){var L=ve._readableState;S("emitReadable_",L.destroyed,L.length,L.ended),!L.destroyed&&(L.length||L.ended)&&(ve.emit("readable"),L.emittedReadable=!1),L.needReadable=!L.flowing&&!L.ended&&L.length<=L.highWaterMark,pe(ve)}function Ke(ve,L){L.readingMore||(L.readingMore=!0,W.nextTick(Me,ve,L))}function Me(ve,L){for(;!L.reading&&!L.ended&&(L.length0,L.resumeScheduled&&!L.paused?L.flowing=!0:ve.listenerCount("data")>0&&ve.resume()}function Ne(ve){S("readable nexttick read 0"),ve.read(0)}function G(ve,L){S("resume",L.reading),L.reading||ve.read(0),L.resumeScheduled=!1,ve.emit("resume"),pe(ve),L.flowing&&!L.reading&&ve.read(0)}function pe(ve){var L=ve._readableState;for(S("flow",L.flowing);L.flowing&&null!==ve.read(););}function ue(ve,L){return 0===L.length?null:(L.objectMode?N=L.buffer.shift():!ve||ve>=L.length?(N=L.decoder?L.buffer.join(""):1===L.buffer.length?L.buffer.first():L.buffer.concat(L.length),L.buffer.clear()):N=L.buffer.consume(ve,L.decoder),N);var N}function je(ve){var L=ve._readableState;S("endReadable",L.endEmitted),L.endEmitted||(L.ended=!0,W.nextTick(_t,L,ve))}function _t(ve,L){if(S("endReadableNT",ve.endEmitted,ve.length),!ve.endEmitted&&0===ve.length&&(ve.endEmitted=!0,L.readable=!1,L.emit("end"),ve.autoDestroy)){var N=L._writableState;(!N||N.autoDestroy&&N.finished)&&L.destroy()}}function pt(ve,L){for(var N=0,B=ve.length;N=L.highWaterMark:L.length>0)||L.ended))return S("read: emitReadable",L.length,L.ended),0===L.length&&L.ended?je(this):Ue(this),null;if(0===(ve=tt(ve,L))&&L.ended)return 0===L.length&&je(this),null;var Re,B=L.needReadable;return S("need readable",B),(0===L.length||L.length-ve0?ue(ve,L):null)?(L.needReadable=L.length<=L.highWaterMark,ve=0):(L.length-=ve,L.awaitDrain=0),0===L.length&&(L.ended||(L.needReadable=!0),N!==ve&&L.ended&&je(this)),null!==Re&&this.emit("data",Re),Re},ne.prototype._read=function(ve){se(this,new X("_read()"))},ne.prototype.pipe=function(ve,L){var N=this,B=this._readableState;switch(B.pipesCount){case 0:B.pipes=ve;break;case 1:B.pipes=[B.pipes,ve];break;default:B.pipes.push(ve)}B.pipesCount+=1,S("pipe count=%d opts=%j",B.pipesCount,L);var Qe=L&&!1===L.end||ve===W.stdout||ve===W.stderr?gs:Nt;function St(Bs,Qr){S("onunpipe"),Bs===N&&Qr&&!1===Qr.hasUnpiped&&(Qr.hasUnpiped=!0,S("cleanup"),ve.removeListener("close",Xr),ve.removeListener("finish",Ls),ve.removeListener("drain",On),ve.removeListener("error",wi),ve.removeListener("unpipe",St),N.removeListener("end",Nt),N.removeListener("end",gs),N.removeListener("data",Ti),kn=!0,B.awaitDrain&&(!ve._writableState||ve._writableState.needDrain)&&On())}function Nt(){S("onend"),ve.end()}B.endEmitted?W.nextTick(Qe):N.once("end",Qe),ve.on("unpipe",St);var On=function(ve){return function(){var N=ve._readableState;S("pipeOnDrain",N.awaitDrain),N.awaitDrain&&N.awaitDrain--,0===N.awaitDrain&&z(ve,"data")&&(N.flowing=!0,pe(ve))}}(N);ve.on("drain",On);var kn=!1;function Ti(Bs){S("ondata");var Qr=ve.write(Bs);S("dest.write",Qr),!1===Qr&&((1===B.pipesCount&&B.pipes===ve||B.pipesCount>1&&-1!==pt(B.pipes,ve))&&!kn&&(S("false write response, pause",B.awaitDrain),B.awaitDrain++),N.pause())}function wi(Bs){S("onerror",Bs),gs(),ve.removeListener("error",wi),0===z(ve,"error")&&se(ve,Bs)}function Xr(){ve.removeListener("finish",Ls),gs()}function Ls(){S("onfinish"),ve.removeListener("close",Xr),gs()}function gs(){S("unpipe"),N.unpipe(ve)}return N.on("data",Ti),function(ve,L,N){if("function"==typeof ve.prependListener)return ve.prependListener(L,N);ve._events&&ve._events[L]?Array.isArray(ve._events[L])?ve._events[L].unshift(N):ve._events[L]=[N,ve._events[L]]:ve.on(L,N)}(ve,"error",wi),ve.once("close",Xr),ve.once("finish",Ls),ve.emit("pipe",N),B.flowing||(S("pipe resume"),N.resume()),ve},ne.prototype.unpipe=function(ve){var L=this._readableState,N={hasUnpiped:!1};if(0===L.pipesCount)return this;if(1===L.pipesCount)return ve&&ve!==L.pipes||(ve||(ve=L.pipes),L.pipes=null,L.pipesCount=0,L.flowing=!1,ve&&ve.emit("unpipe",this,N)),this;if(!ve){var B=L.pipes,Re=L.pipesCount;L.pipes=null,L.pipesCount=0,L.flowing=!1;for(var Qe=0;Qe0,!1!==B.flowing&&this.resume()):"readable"===ve&&!B.endEmitted&&!B.readableListening&&(B.readableListening=B.needReadable=!0,B.flowing=!1,B.emittedReadable=!1,S("on readable",B.length,B.reading),B.length?Ue(this):B.reading||W.nextTick(Ne,this)),N},ne.prototype.removeListener=function(ve,L){var N=v.prototype.removeListener.call(this,ve,L);return"readable"===ve&&W.nextTick($e,this),N},ne.prototype.removeAllListeners=function(ve){var L=v.prototype.removeAllListeners.apply(this,arguments);return("readable"===ve||void 0===ve)&&W.nextTick($e,this),L},ne.prototype.resume=function(){var ve=this._readableState;return ve.flowing||(S("resume"),ve.flowing=!ve.readableListening,function(ve,L){L.resumeScheduled||(L.resumeScheduled=!0,W.nextTick(G,ve,L))}(this,ve)),ve.paused=!1,this},ne.prototype.pause=function(){return S("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(S("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},ne.prototype.wrap=function(ve){var L=this,N=this._readableState,B=!1;for(var Re in ve.on("end",function(){if(S("wrapped end"),N.decoder&&!N.ended){var St=N.decoder.end();St&&St.length&&L.push(St)}L.push(null)}),ve.on("data",function(St){S("wrapped data"),N.decoder&&(St=N.decoder.write(St)),N.objectMode&&null==St||!(N.objectMode||St&&St.length)||L.push(St)||(B=!0,ve.pause())}),ve)void 0===this[Re]&&"function"==typeof ve[Re]&&(this[Re]=function(Nt){return function(){return ve[Nt].apply(ve,arguments)}}(Re));for(var Qe=0;Qe-1))throw new Z(ue);return this._writableState.defaultEncoding=ue,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(pe,ue,je){je(new ce("_write()"))},me.prototype._writev=null,me.prototype.end=function(pe,ue,je){var _t=this._writableState;return"function"==typeof pe?(je=pe,pe=null,ue=null):"function"==typeof ue&&(je=ue,ue=null),null!=pe&&this.write(pe,ue),_t.corked&&(_t.corked=1,this.uncork()),_t.ending||function(pe,ue,je){ue.ending=!0,Ne(pe,ue),je&&(ue.finished?W.nextTick(je):pe.once("finish",je)),ue.ended=!0,pe.writable=!1}(this,_t,je),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(ue){!this._writableState||(this._writableState.destroyed=ue)}}),me.prototype.destroy=S.destroy,me.prototype._undestroy=S.undestroy,me.prototype._destroy=function(pe,ue){ue(pe)}}).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,Se,he){(function(W){(function(){"use strict";var j;function P(I,X,E){return X in I?Object.defineProperty(I,X,{value:E,enumerable:!0,configurable:!0,writable:!0}):I[X]=E,I}var Q=Y("./end-of-stream"),z=Symbol("lastResolve"),v=Symbol("lastReject"),x=Symbol("error"),O=Symbol("ended"),A=Symbol("lastPromise"),b=Symbol("handlePromise"),y=Symbol("stream");function S(I,X){return{value:I,done:X}}function T(I){var X=I[z];if(null!==X){var E=I[y].read();null!==E&&(I[A]=null,I[z]=null,I[v]=null,X(S(E,!1)))}}function V(I){W.nextTick(T,I)}var K=Object.getPrototypeOf(function(){}),ce=Object.setPrototypeOf((P(j={get stream(){return this[y]},next:function(){var X=this,E=this[x];if(null!==E)return Promise.reject(E);if(this[O])return Promise.resolve(S(void 0,!0));if(this[y].destroyed)return new Promise(function(se,te){W.nextTick(function(){X[x]?te(X[x]):se(S(void 0,!0))})});var Z,$=this[A];if($)Z=new Promise(function(I,X){return function(E,$){I.then(function(){X[O]?E(S(void 0,!0)):X[b](E,$)},$)}}($,this));else{var oe=this[y].read();if(null!==oe)return Promise.resolve(S(oe,!1));Z=new Promise(this[b])}return this[A]=Z,Z}},Symbol.asyncIterator,function(){return this}),P(j,"return",function(){var X=this;return new Promise(function(E,$){X[y].destroy(null,function(Z){Z?$(Z):E(S(void 0,!0))})})}),j),K);Se.exports=function(X){var E,$=Object.create(ce,(P(E={},y,{value:X,writable:!0}),P(E,z,{value:null,writable:!0}),P(E,v,{value:null,writable:!0}),P(E,x,{value:null,writable:!0}),P(E,O,{value:X._readableState.endEmitted,writable:!0}),P(E,b,{value:function(oe,se){var te=$[y].read();te?($[A]=null,$[z]=null,$[v]=null,oe(S(te,!1))):($[z]=oe,$[v]=se)},writable:!0}),E));return $[A]=null,Q(X,function(Z){if(Z&&"ERR_STREAM_PREMATURE_CLOSE"!==Z.code){var oe=$[v];return null!==oe&&($[A]=null,$[z]=null,$[v]=null,oe(Z)),void($[x]=Z)}var se=$[z];null!==se&&($[A]=null,$[z]=null,$[v]=null,se(S(void 0,!0))),$[O]=!0}),X.on("readable",V.bind(null,$)),$}}).call(this)}).call(this,Y("_process"))},{"./end-of-stream":76,_process:44}],74:[function(Y,Se,he){"use strict";function W(T,V){var R=Object.keys(T);if(Object.getOwnPropertySymbols){var K=Object.getOwnPropertySymbols(T);V&&(K=K.filter(function(ce){return Object.getOwnPropertyDescriptor(T,ce).enumerable})),R.push.apply(R,K)}return R}function P(T,V,R){return V in T?Object.defineProperty(T,V,{value:R,enumerable:!0,configurable:!0,writable:!0}):T[V]=R,T}function z(T,V){for(var R=0;R0?this.tail.next=K:this.head=K,this.tail=K,++this.length}},{key:"unshift",value:function(R){var K={data:R,next:this.head};0===this.length&&(this.tail=K),this.head=K,++this.length}},{key:"shift",value:function(){if(0!==this.length){var R=this.head.data;return this.head=1===this.length?this.tail=null:this.head.next,--this.length,R}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(R){if(0===this.length)return"";for(var K=this.head,ce=""+K.data;K=K.next;)ce+=R+K.data;return ce}},{key:"concat",value:function(R){if(0===this.length)return O.alloc(0);for(var K=O.allocUnsafe(R>>>0),ce=this.head,D=0;ce;)S(ce.data,K,D),D+=ce.data.length,ce=ce.next;return K}},{key:"consume",value:function(R,K){var ce;return RI.length?I.length:R;if(D+=X===I.length?I:I.slice(0,R),0==(R-=X)){X===I.length?(++ce,this.head=K.next?K.next:this.tail=null):(this.head=K,K.data=I.slice(X));break}++ce}return this.length-=ce,D}},{key:"_getBuffer",value:function(R){var K=O.allocUnsafe(R),ce=this.head,D=1;for(ce.data.copy(K),R-=ce.data.length;ce=ce.next;){var I=ce.data,X=R>I.length?I.length:R;if(I.copy(K,K.length-R,0,X),0==(R-=X)){X===I.length?(++D,this.head=ce.next?ce.next:this.tail=null):(this.head=ce,ce.data=I.slice(X));break}++D}return this.length-=D,K}},{key:y,value:function(R,K){return b(this,function(T){for(var V=1;V0,function(Z){ce||(ce=Z),Z&&D.forEach(A),!E&&(D.forEach(A),K(ce))})});return V.reduce(b)}},{"../../../errors":67,"./end-of-stream":76}],79:[function(Y,Se,he){"use strict";var W=Y("../../../errors").codes.ERR_INVALID_OPT_VALUE;Se.exports={getHighWaterMark:function(Q,z,v,x){var O=function(Q,z,v){return null!=Q.highWaterMark?Q.highWaterMark:z?Q[v]:null}(z,x,v);if(null!=O){if(!isFinite(O)||Math.floor(O)!==O||O<0)throw new W(x?v:"highWaterMark",O);return Math.floor(O)}return Q.objectMode?16:16384}}},{"../../../errors":67}],80:[function(Y,Se,he){Se.exports=Y("events").EventEmitter},{events:8}],81:[function(Y,Se,he){(he=Se.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,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),function(j){for(var P in j)he.hasOwnProperty(P)||(he[P]=j[P])}(Y("./lib/Resolve"))},{"./lib/Resolve":83}],83:[function(Y,Se,he){"use strict";function j(z){const v=[];let x=0;for(;xO.join("")).join("/")}function P(z,v){let x=v+1;v>=0?"/"===z[v+1]&&"/"===z[v+2]&&(x=v+3):"/"===z[0]&&"/"===z[1]&&(x=2);const O=z.indexOf("/",x);return O<0?z:z.substr(0,O)+j(z.substr(O))}function Q(z){return!z||"#"===z||"?"===z||"/"===z}Object.defineProperty(he,"__esModule",{value:!0}),he.resolve=function(z,v){const x=(v=v||"").indexOf("#");if(x>0&&(v=v.substr(0,x)),!z.length){if(v.indexOf(":")<0)throw new Error(`Found invalid baseIRI '${v}' for value '${z}'`);return v}if(z.startsWith("?")){const V=v.indexOf("?");return V>0&&(v=v.substr(0,V)),v+z}if(z.startsWith("#"))return v+z;if(!v.length){const V=z.indexOf(":");if(V<0)throw new Error(`Found invalid relative IRI '${z}' for a missing baseIRI`);return P(z,V)}const O=z.indexOf(":");if(O>=0)return P(z,O);const A=v.indexOf(":");if(A<0)throw new Error(`Found invalid baseIRI '${v}' for value '${z}'`);const b=v.substr(0,A+1);if(0===z.indexOf("//"))return b+P(z,O);let y;if(v.indexOf("//",A)===A+1){if(y=v.indexOf("/",A+3),y<0)return v.length>A+3?v+"/"+P(z,O):b+P(z,O)}else if(y=v.indexOf("/",A+1),y<0)return b+P(z,O);if(0===z.indexOf("/"))return v.substr(0,y)+j(z);let S=v.substr(y);const T=S.lastIndexOf("/");return T>=0&&T"===ue?(ne(G,"onsgmldeclaration",G.sgmlDecl),G.sgmlDecl="",G.state=te.TEXT):($(ue)&&(G.state=te.SGML_DECL_QUOTED),G.sgmlDecl+=ue);continue;case te.SGML_DECL_QUOTED:ue===G.q&&(G.state=te.SGML_DECL,G.q=""),G.sgmlDecl+=ue;continue;case te.DOCTYPE:">"===ue?(G.state=te.TEXT,ne(G,"ondoctype",G.doctype),G.doctype=!0):(G.doctype+=ue,"["===ue?G.state=te.DOCTYPE_DTD:$(ue)&&(G.state=te.DOCTYPE_QUOTED,G.q=ue));continue;case te.DOCTYPE_QUOTED:G.doctype+=ue,ue===G.q&&(G.q="",G.state=te.DOCTYPE);continue;case te.DOCTYPE_DTD:G.doctype+=ue,"]"===ue?G.state=te.DOCTYPE:$(ue)&&(G.state=te.DOCTYPE_DTD_QUOTED,G.q=ue);continue;case te.DOCTYPE_DTD_QUOTED:G.doctype+=ue,ue===G.q&&(G.state=te.DOCTYPE_DTD,G.q="");continue;case te.COMMENT:"-"===ue?G.state=te.COMMENT_ENDING:G.comment+=ue;continue;case te.COMMENT_ENDING:"-"===ue?(G.state=te.COMMENT_ENDED,G.comment=Ie(G.opt,G.comment),G.comment&&ne(G,"oncomment",G.comment),G.comment=""):(G.comment+="-"+ue,G.state=te.COMMENT);continue;case te.COMMENT_ENDED:">"!==ue?(Xe(G,"Malformed comment"),G.comment+="--"+ue,G.state=te.COMMENT):G.state=te.TEXT;continue;case te.CDATA:"]"===ue?G.state=te.CDATA_ENDING:G.cdata+=ue;continue;case te.CDATA_ENDING:"]"===ue?G.state=te.CDATA_ENDING_2:(G.cdata+="]"+ue,G.state=te.CDATA);continue;case te.CDATA_ENDING_2:">"===ue?(G.cdata&&ne(G,"oncdata",G.cdata),ne(G,"onclosecdata"),G.cdata="",G.state=te.TEXT):"]"===ue?G.cdata+="]":(G.cdata+="]]"+ue,G.state=te.CDATA);continue;case te.PROC_INST:"?"===ue?G.state=te.PROC_INST_ENDING:E(ue)?G.state=te.PROC_INST_BODY:G.procInstName+=ue;continue;case te.PROC_INST_BODY:if(!G.procInstBody&&E(ue))continue;"?"===ue?G.state=te.PROC_INST_ENDING:G.procInstBody+=ue;continue;case te.PROC_INST_ENDING:">"===ue?(ne(G,"onprocessinginstruction",{name:G.procInstName,body:G.procInstBody}),G.procInstName=G.procInstBody="",G.state=te.TEXT):(G.procInstBody+="?"+ue,G.state=te.PROC_INST_BODY);continue;case te.OPEN_TAG:oe(D,ue)?G.tagName+=ue:(tt(G),">"===ue?ke(G):"/"===ue?G.state=te.OPEN_TAG_SLASH:(E(ue)||Xe(G,"Invalid character in tag name"),G.state=te.ATTRIB));continue;case te.OPEN_TAG_SLASH:">"===ue?(ke(G,!0),Ke(G)):(Xe(G,"Forward-slash in opening tag not followed by >"),G.state=te.ATTRIB);continue;case te.ATTRIB:if(E(ue))continue;">"===ue?ke(G):"/"===ue?G.state=te.OPEN_TAG_SLASH:oe(ce,ue)?(G.attribName=ue,G.attribValue="",G.state=te.ATTRIB_NAME):Xe(G,"Invalid attribute name");continue;case te.ATTRIB_NAME:"="===ue?G.state=te.ATTRIB_VALUE:">"===ue?(Xe(G,"Attribute without value"),G.attribValue=G.attribName,Ue(G),ke(G)):E(ue)?G.state=te.ATTRIB_NAME_SAW_WHITE:oe(D,ue)?G.attribName+=ue:Xe(G,"Invalid attribute name");continue;case te.ATTRIB_NAME_SAW_WHITE:if("="===ue)G.state=te.ATTRIB_VALUE;else{if(E(ue))continue;Xe(G,"Attribute without value"),G.tag.attributes[G.attribName]="",G.attribValue="",ne(G,"onattribute",{name:G.attribName,value:""}),G.attribName="",">"===ue?ke(G):oe(ce,ue)?(G.attribName=ue,G.state=te.ATTRIB_NAME):(Xe(G,"Invalid attribute name"),G.state=te.ATTRIB)}continue;case te.ATTRIB_VALUE:if(E(ue))continue;$(ue)?(G.q=ue,G.state=te.ATTRIB_VALUE_QUOTED):(Xe(G,"Unquoted attribute value"),G.state=te.ATTRIB_VALUE_UNQUOTED,G.attribValue=ue);continue;case te.ATTRIB_VALUE_QUOTED:if(ue!==G.q){"&"===ue?G.state=te.ATTRIB_VALUE_ENTITY_Q:G.attribValue+=ue;continue}Ue(G),G.q="",G.state=te.ATTRIB_VALUE_CLOSED;continue;case te.ATTRIB_VALUE_CLOSED:E(ue)?G.state=te.ATTRIB:">"===ue?ke(G):"/"===ue?G.state=te.OPEN_TAG_SLASH:oe(ce,ue)?(Xe(G,"No whitespace between attributes"),G.attribName=ue,G.attribValue="",G.state=te.ATTRIB_NAME):Xe(G,"Invalid attribute name");continue;case te.ATTRIB_VALUE_UNQUOTED:if(!Z(ue)){"&"===ue?G.state=te.ATTRIB_VALUE_ENTITY_U:G.attribValue+=ue;continue}Ue(G),">"===ue?ke(G):G.state=te.ATTRIB;continue;case te.CLOSE_TAG:if(G.tagName)">"===ue?Ke(G):oe(D,ue)?G.tagName+=ue:G.script?(G.script+=""===ue?Ke(G):Xe(G,"Invalid characters in closing tag");continue;case te.TEXT_ENTITY:case te.ATTRIB_VALUE_ENTITY_Q:case te.ATTRIB_VALUE_ENTITY_U:var pt,ve;switch(G.state){case te.TEXT_ENTITY:pt=te.TEXT,ve="textNode";break;case te.ATTRIB_VALUE_ENTITY_Q:pt=te.ATTRIB_VALUE_QUOTED,ve="attribValue";break;case te.ATTRIB_VALUE_ENTITY_U:pt=te.ATTRIB_VALUE_UNQUOTED,ve="attribValue"}";"===ue?(G[ve]+=Me(G),G.entity="",G.state=pt):oe(G.entity.length?X:I,ue)?G.entity+=ue:(Xe(G,"Invalid character in entity name"),G[ve]+="&"+G.entity+ue,G.entity="",G.state=pt);continue;default:throw new Error(G,"Unknown state: "+G.state)}return G.position>=G.bufferCheckPosition&&function(q){for(var G=Math.max(j.MAX_BUFFER_LENGTH,10),pe=0,ue=0,je=P.length;ueG)switch(P[ue]){case"textNode":_e(q);break;case"cdata":ne(q,"oncdata",q.cdata),q.cdata="";break;case"script":ne(q,"onscript",q.script),q.script="";break;default:Ge(q,"Max buffer length exceeded: "+P[ue])}pe=Math.max(pe,_t)}q.bufferCheckPosition=j.MAX_BUFFER_LENGTH-pe+q.position}(G),G},resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){!function(q){_e(q),""!==q.cdata&&(ne(q,"oncdata",q.cdata),q.cdata=""),""!==q.script&&(ne(q,"onscript",q.script),q.script="")}(this)}};try{O=Y("stream").Stream}catch(q){O=function(){}}var A=j.EVENTS.filter(function(q){return"error"!==q&&"end"!==q});function y(q,G){if(!(this instanceof y))return new y(q,G);O.apply(this),this._parser=new Q(q,G),this.writable=!0,this.readable=!0;var pe=this;this._parser.onend=function(){pe.emit("end")},this._parser.onerror=function(ue){pe.emit("error",ue),pe._parser.error=null},this._decoder=null,A.forEach(function(ue){Object.defineProperty(pe,"on"+ue,{get:function(){return pe._parser["on"+ue]},set:function(je){if(!je)return pe.removeAllListeners(ue),pe._parser["on"+ue]=je,je;pe.on(ue,je)},enumerable:!0,configurable:!1})})}(y.prototype=Object.create(O.prototype,{constructor:{value:y}})).write=function(q){if("function"==typeof W&&"function"==typeof W.isBuffer&&W.isBuffer(q)){if(!this._decoder){var G=Y("string_decoder").StringDecoder;this._decoder=new G("utf8")}q=this._decoder.write(q)}return this._parser.write(q.toString()),this.emit("data",q),!0},y.prototype.end=function(q){return q&&q.length&&this.write(q),this._parser.end(),!0},y.prototype.on=function(q,G){var pe=this;return!pe._parser["on"+q]&&-1!==A.indexOf(q)&&(pe._parser["on"+q]=function(){var ue=1===arguments.length?[arguments[0]]:Array.apply(null,arguments);ue.splice(0,0,q),pe.emit.apply(pe,ue)}),O.prototype.on.call(pe,q,G)};var V="http://www.w3.org/XML/1998/namespace",R="http://www.w3.org/2000/xmlns/",K={xml:V,xmlns:R},ce=/[:_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-]/,I=/[#:_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]/,X=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;function E(q){return" "===q||"\n"===q||"\r"===q||"\t"===q}function $(q){return'"'===q||"'"===q}function Z(q){return">"===q||E(q)}function oe(q,G){return q.test(G)}function se(q,G){return!oe(q,G)}var q,G,pe,te=0;for(var Ce in j.STATE={BEGIN:te++,BEGIN_WHITESPACE:te++,TEXT:te++,TEXT_ENTITY:te++,OPEN_WAKA:te++,SGML_DECL:te++,SGML_DECL_QUOTED:te++,DOCTYPE:te++,DOCTYPE_QUOTED:te++,DOCTYPE_DTD:te++,DOCTYPE_DTD_QUOTED:te++,COMMENT_STARTING:te++,COMMENT:te++,COMMENT_ENDING:te++,COMMENT_ENDED:te++,CDATA:te++,CDATA_ENDING:te++,CDATA_ENDING_2:te++,PROC_INST:te++,PROC_INST_BODY:te++,PROC_INST_ENDING:te++,OPEN_TAG:te++,OPEN_TAG_SLASH:te++,ATTRIB:te++,ATTRIB_NAME:te++,ATTRIB_NAME_SAW_WHITE:te++,ATTRIB_VALUE:te++,ATTRIB_VALUE_QUOTED:te++,ATTRIB_VALUE_CLOSED:te++,ATTRIB_VALUE_UNQUOTED:te++,ATTRIB_VALUE_ENTITY_Q:te++,ATTRIB_VALUE_ENTITY_U:te++,CLOSE_TAG:te++,CLOSE_TAG_SAW_WHITE:te++,SCRIPT:te++,SCRIPT_ENDING:te++},j.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},j.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(j.ENTITIES).forEach(function(q){var G=j.ENTITIES[q],pe="number"==typeof G?String.fromCharCode(G):G;j.ENTITIES[q]=pe}),j.STATE)j.STATE[j.STATE[Ce]]=Ce;function me(q,G,pe){q[G]&&q[G](pe)}function ne(q,G,pe){q.textNode&&_e(q),me(q,G,pe)}function _e(q){q.textNode=Ie(q.opt,q.textNode),q.textNode&&me(q,"ontext",q.textNode),q.textNode=""}function Ie(q,G){return q.trim&&(G=G.trim()),q.normalize&&(G=G.replace(/\s+/g," ")),G}function Ge(q,G){return _e(q),q.trackPosition&&(G+="\nLine: "+q.line+"\nColumn: "+q.column+"\nChar: "+q.c),G=new Error(G),q.error=G,me(q,"onerror",G),q}function st(q){return q.sawRoot&&!q.closedRoot&&Xe(q,"Unclosed root tag"),q.state!==te.BEGIN&&q.state!==te.BEGIN_WHITESPACE&&q.state!==te.TEXT&&Ge(q,"Unexpected end"),_e(q),q.c="",q.closed=!0,me(q,"onend"),Q.call(q,q.strict,q.opt),q}function Xe(q,G){if("object"!=typeof q||!(q instanceof Q))throw new Error("bad call to strictFail");q.strict&&Ge(q,G)}function tt(q){q.strict||(q.tagName=q.tagName[q.looseCase]());var G=q.tags[q.tags.length-1]||q,pe=q.tag={name:q.tagName,attributes:{}};q.opt.xmlns&&(pe.ns=G.ns),q.attribList.length=0,ne(q,"onopentagstart",pe)}function Ye(q,G){var ue=q.indexOf(":")<0?["",q]:q.split(":"),je=ue[0],_t=ue[1];return G&&"xmlns"===q&&(je="xmlns",_t=""),{prefix:je,local:_t}}function Ue(q){if(q.strict||(q.attribName=q.attribName[q.looseCase]()),-1!==q.attribList.indexOf(q.attribName)||q.tag.attributes.hasOwnProperty(q.attribName))q.attribName=q.attribValue="";else{if(q.opt.xmlns){var G=Ye(q.attribName,!0),ue=G.local;if("xmlns"===G.prefix)if("xml"===ue&&q.attribValue!==V)Xe(q,"xml: prefix must be bound to "+V+"\nActual: "+q.attribValue);else if("xmlns"===ue&&q.attribValue!==R)Xe(q,"xmlns: prefix must be bound to "+R+"\nActual: "+q.attribValue);else{var je=q.tag,_t=q.tags[q.tags.length-1]||q;je.ns===_t.ns&&(je.ns=Object.create(_t.ns)),je.ns[ue]=q.attribValue}q.attribList.push([q.attribName,q.attribValue])}else q.tag.attributes[q.attribName]=q.attribValue,ne(q,"onattribute",{name:q.attribName,value:q.attribValue});q.attribName=q.attribValue=""}}function ke(q,G){if(q.opt.xmlns){var pe=q.tag,ue=Ye(q.tagName);pe.prefix=ue.prefix,pe.local=ue.local,pe.uri=pe.ns[ue.prefix]||"",pe.prefix&&!pe.uri&&(Xe(q,"Unbound namespace prefix: "+JSON.stringify(q.tagName)),pe.uri=ue.prefix),pe.ns&&(q.tags[q.tags.length-1]||q).ns!==pe.ns&&Object.keys(pe.ns).forEach(function(On){ne(q,"onopennamespace",{prefix:On,uri:pe.ns[On]})});for(var _t=0,pt=q.attribList.length;_t",q.tagName="",void(q.state=te.SCRIPT);ne(q,"onscript",q.script),q.script=""}var G=q.tags.length,pe=q.tagName;q.strict||(pe=pe[q.looseCase]());for(var ue=pe;G--&&q.tags[G].name!==ue;)Xe(q,"Unexpected close tag");if(G<0)return Xe(q,"Unmatched closing tag: "+q.tagName),q.textNode+="",void(q.state=te.TEXT);q.tagName=pe;for(var _t=q.tags.length;_t-- >G;){var pt=q.tag=q.tags.pop();q.tagName=q.tag.name,ne(q,"onclosetag",q.tagName);var ve={};for(var L in pt.ns)ve[L]=pt.ns[L];q.opt.xmlns&&pt.ns!==(q.tags[q.tags.length-1]||q).ns&&Object.keys(pt.ns).forEach(function(B){ne(q,"onclosenamespace",{prefix:B,uri:pt.ns[B]})})}0===G&&(q.closedRoot=!0),q.tagName=q.attribValue=q.attribName="",q.attribList.length=0,q.state=te.TEXT}function Me(q){var ue,G=q.entity,pe=G.toLowerCase(),je="";return q.ENTITIES[G]?q.ENTITIES[G]:q.ENTITIES[pe]?q.ENTITIES[pe]:("#"===(G=pe).charAt(0)&&("x"===G.charAt(1)?(G=G.slice(2),je=(ue=parseInt(G,16)).toString(16)):(G=G.slice(1),je=(ue=parseInt(G,10)).toString(10))),G=G.replace(/^0+/,""),isNaN(ue)||je.toLowerCase()!==G?(Xe(q,"Invalid character entity"),"&"+q.entity+";"):String.fromCodePoint(ue))}function Ve(q,G){"<"===G?(q.state=te.OPEN_WAKA,q.startTagPosition=q.position):E(G)||(Xe(q,"Non-whitespace before first tag."),q.textNode=G,q.state=te.TEXT)}function $e(q,G){var pe="";return G1114111||G(B)!==B)throw RangeError("Invalid code point: "+B);B<=65535?je.push(B):je.push(55296+((B-=65536)>>10),B%1024+56320),(ve+1===L||je.length>ue)&&(N+=q.apply(null,je),je.length=0)}return N},Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:pe,configurable:!0,writable:!0}):String.fromCodePoint=pe)}(void 0===he?this.sax={}:he)}).call(this)}).call(this,Y("buffer").Buffer)},{buffer:6,stream:87,string_decoder:5}],86:[function(Y,Se,he){(function(W,j){(function(){!function(P,Q){"use strict";if(!P.setImmediate){var A,z=1,v={},x=!1,O=P.document,X=Object.getPrototypeOf&&Object.getPrototypeOf(P);X=X&&X.setTimeout?X:P,"[object process]"==={}.toString.call(P.process)?A=function(E){W.nextTick(function(){T(E)})}:function(){if(P.postMessage&&!P.importScripts){var E=!0,$=P.onmessage;return P.onmessage=function(){E=!1},P.postMessage("","*"),P.onmessage=$,E}}()?(E="setImmediate$"+Math.random()+"$",$=function(Z){Z.source===P&&"string"==typeof Z.data&&0===Z.data.indexOf(E)&&T(+Z.data.slice(E.length))},P.addEventListener?P.addEventListener("message",$,!1):P.attachEvent("onmessage",$),A=function(Z){P.postMessage(E+Z,"*")}):P.MessageChannel?function(){var E=new MessageChannel;E.port1.onmessage=function($){T($.data)},A=function($){E.port2.postMessage($)}}():O&&"onreadystatechange"in O.createElement("script")?function(){var E=O.documentElement;A=function($){var Z=O.createElement("script");Z.onreadystatechange=function(){T($),Z.onreadystatechange=null,E.removeChild(Z),Z=null},E.appendChild(Z)}}():A=function(E){setTimeout(T,0,E)},X.setImmediate=function(E){"function"!=typeof E&&(E=new Function(""+E));for(var $=new Array(arguments.length-1),Z=0;Z<$.length;Z++)$[Z]=arguments[Z+1];return v[z]={callback:E,args:$},A(z),z++},X.clearImmediate=y}var E,$;function y(E){delete v[E]}function T(E){if(x)setTimeout(T,0,E);else{var $=v[E];if($){x=!0;try{!function(E){var $=E.callback,Z=E.args;switch(Z.length){case 0:$();break;case 1:$(Z[0]);break;case 2:$(Z[0],Z[1]);break;case 3:$(Z[0],Z[1],Z[2]);break;default:$.apply(void 0,Z)}}($)}finally{y(E),x=!1}}}}}("undefined"==typeof self?void 0===j?this:j:self)}).call(this)}).call(this,Y("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:44}],87:[function(Y,Se,he){Se.exports=P;var W=Y("events").EventEmitter;function P(){W.call(this)}Y("inherits")(P,W),P.Readable=Y("readable-stream/lib/_stream_readable.js"),P.Writable=Y("readable-stream/lib/_stream_writable.js"),P.Duplex=Y("readable-stream/lib/_stream_duplex.js"),P.Transform=Y("readable-stream/lib/_stream_transform.js"),P.PassThrough=Y("readable-stream/lib/_stream_passthrough.js"),P.finished=Y("readable-stream/lib/internal/streams/end-of-stream.js"),P.pipeline=Y("readable-stream/lib/internal/streams/pipeline.js"),P.Stream=P,P.prototype.pipe=function(Q,z){var v=this;function x(V){Q.writable&&!1===Q.write(V)&&v.pause&&v.pause()}function O(){v.readable&&v.resume&&v.resume()}v.on("data",x),Q.on("drain",O),!Q._isStdio&&(!z||!1!==z.end)&&(v.on("end",b),v.on("close",y));var A=!1;function b(){A||(A=!0,Q.end())}function y(){A||(A=!0,"function"==typeof Q.destroy&&Q.destroy())}function S(V){if(T(),0===W.listenerCount(this,"error"))throw V}function T(){v.removeListener("data",x),Q.removeListener("drain",O),v.removeListener("end",b),v.removeListener("close",y),v.removeListener("error",S),Q.removeListener("error",S),v.removeListener("end",T),v.removeListener("close",T),Q.removeListener("close",T)}return v.on("error",S),Q.on("error",S),v.on("end",T),v.on("close",T),Q.on("close",T),Q.emit("pipe",v),Q}},{events:8,inherits:10,"readable-stream/lib/_stream_duplex.js":68,"readable-stream/lib/_stream_passthrough.js":69,"readable-stream/lib/_stream_readable.js":70,"readable-stream/lib/_stream_transform.js":71,"readable-stream/lib/_stream_writable.js":72,"readable-stream/lib/internal/streams/end-of-stream.js":76,"readable-stream/lib/internal/streams/pipeline.js":78}],88:[function(Y,Se,he){arguments[4][5][0].apply(he,arguments)},{dup:5,"safe-buffer":84}],89:[function(Y,Se,he){(function(W,j){(function(){var P=Y("process/browser.js").nextTick,Q=Function.prototype.apply,z=Array.prototype.slice,v={},x=0;function O(A,b){this._id=A,this._clearFn=b}he.setTimeout=function(){return new O(Q.call(setTimeout,window,arguments),clearTimeout)},he.setInterval=function(){return new O(Q.call(setInterval,window,arguments),clearInterval)},he.clearTimeout=he.clearInterval=function(A){A.close()},O.prototype.unref=O.prototype.ref=function(){},O.prototype.close=function(){this._clearFn.call(window,this._id)},he.enroll=function(A,b){clearTimeout(A._idleTimeoutId),A._idleTimeout=b},he.unenroll=function(A){clearTimeout(A._idleTimeoutId),A._idleTimeout=-1},he._unrefActive=he.active=function(A){clearTimeout(A._idleTimeoutId);var b=A._idleTimeout;b>=0&&(A._idleTimeoutId=setTimeout(function(){A._onTimeout&&A._onTimeout()},b))},he.setImmediate="function"==typeof W?W:function(A){var b=x++,y=!(arguments.length<2)&&z.call(arguments,1);return v[b]=!0,P(function(){v[b]&&(y?A.apply(null,y):A.call(null),he.clearImmediate(b))}),b},he.clearImmediate="function"==typeof j?j:function(A){delete v[A]}}).call(this)}).call(this,Y("timers").setImmediate,Y("timers").clearImmediate)},{"process/browser.js":44,timers:89}],90:[function(Y,Se,he){(function(W){(function(){function P(Q){try{if(!W.localStorage)return!1}catch(v){return!1}var z=W.localStorage[Q];return null!=z&&"true"===String(z).toLowerCase()}Se.exports=function(Q,z){if(P("noDeprecation"))return Q;var v=!1;return function(){if(!v){if(P("throwDeprecation"))throw new Error(z);P("traceDeprecation")?console.trace(z):console.warn(z),v=!0}return Q.apply(this,arguments)}}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],91:[function(Y,Se,he){"use strict";Se.exports=function(W){W.prototype[Symbol.iterator]=function*(){for(let j=this.head;j;j=j.next)yield j.value}}},{}],92:[function(Y,Se,he){"use strict";function W(v){var x=this;if(x instanceof W||(x=new W),x.tail=null,x.head=null,x.length=0,v&&"function"==typeof v.forEach)v.forEach(function(b){x.push(b)});else if(arguments.length>0)for(var O=0,A=arguments.length;O1)O=x;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");A=this.head.next,O=this.head.value}for(var b=0;null!==A;b++)O=v(O,A.value,b),A=A.next;return O},W.prototype.reduceReverse=function(v,x){var O,A=this.tail;if(arguments.length>1)O=x;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");A=this.tail.prev,O=this.tail.value}for(var b=this.length-1;null!==A;b--)O=v(O,A.value,b),A=A.prev;return O},W.prototype.toArray=function(){for(var v=new Array(this.length),x=0,O=this.head;null!==O;x++)v[x]=O.value,O=O.next;return v},W.prototype.toArrayReverse=function(){for(var v=new Array(this.length),x=0,O=this.tail;null!==O;x++)v[x]=O.value,O=O.prev;return v},W.prototype.slice=function(v,x){(x=x||this.length)<0&&(x+=this.length),(v=v||0)<0&&(v+=this.length);var O=new W;if(xthis.length&&(x=this.length);for(var A=0,b=this.head;null!==b&&Athis.length&&(x=this.length);for(var A=this.length,b=this.tail;null!==b&&A>x;A--)b=b.prev;for(;null!==b&&A>v;A--,b=b.prev)O.push(b.value);return O},W.prototype.splice=function(v,x,...O){v>this.length&&(v=this.length-1),v<0&&(v=this.length+v);for(var A=0,b=this.head;null!==b&&A{"use strict";Ut.exports=Je,Ut.exports.default=Je;var it=1e20;function Je(Y,Se,he,W,j,P){this.fontSize=Y||24,this.buffer=void 0===Se?3:Se,this.cutoff=W||.25,this.fontFamily=j||"sans-serif",this.fontWeight=P||"normal",this.radius=he||8;var Q=this.size=this.fontSize+2*this.buffer,z=Q+2*this.buffer;this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=Q,this.ctx=this.canvas.getContext("2d"),this.ctx.font=this.fontWeight+" "+this.fontSize+"px "+this.fontFamily,this.ctx.textAlign="left",this.ctx.fillStyle="black",this.gridOuter=new Float64Array(z*z),this.gridInner=new Float64Array(z*z),this.f=new Float64Array(z),this.z=new Float64Array(z+1),this.v=new Uint16Array(z),this.useMetrics=void 0!==this.ctx.measureText("A").actualBoundingBoxLeft,this.middle=Math.round(Q/2*(navigator.userAgent.indexOf("Gecko/")>=0?1.2:1))}function Tt(Y,Se,he,W,j,P){for(var Q=0;Q-1);P[++v]=z,Q[v]=x,Q[v+1]=it}for(z=0,v=0;z{Ut.exports=function(Je,yt){var ee=yt.length;if(0!==ee){var Tt=Je.length;Je.length+=ee;for(var dt=0;dt{"use strict";var yt=(()=>{return(Tt=yt||(yt={})).typeOfFunction="function",Tt.boolTrue=!0,yt;var Tt})();function ee(Tt,dt,Y){if(!Y||typeof Y.value!==yt.typeOfFunction)throw new TypeError("Only methods can be decorated with @bind. <"+dt+"> is not a method!");return{configurable:yt.boolTrue,get:function(){var Se=Y.value.bind(this);return Object.defineProperty(this,dt,{value:Se,configurable:yt.boolTrue,writable:yt.boolTrue}),Se}}}it.ak=ee,it.ZP=ee},266:(Ut,it,Je)=>{Ut.exports={ResizeSensor:Je(835),ElementQueries:Je(845)}},845:function(Ut,it,Je){"use strict";var yt,ee,Tt;"undefined"!=typeof window&&window,ee=[Je(835)],void 0!==(Tt="function"==typeof(yt=function(dt){var Y=function(){var he,W={},j=[];function P(D){D||(D=document.documentElement);var I=window.getComputedStyle(D,null).fontSize;return parseFloat(I)||16}function z(D,I){var X=I.split(/\d/),E=X[X.length-1];switch(I=parseFloat(I),E){case"px":return I;case"em":return I*P(D);case"rem":return I*P();case"vw":return I*document.documentElement.clientWidth/100;case"vh":return I*document.documentElement.clientHeight/100;case"vmin":case"vmax":var $=document.documentElement.clientWidth/100,Z=document.documentElement.clientHeight/100;return I*(0,Math["vmin"===E?"min":"max"])($,Z);default:return I}}function v(D,I){this.element=D;var X,E,$,Z,oe,se,te,Ce,me=["min-width","min-height","max-width","max-height"];this.call=function(){for(X in $=function(D){if(!D.getBoundingClientRect)return{width:D.offsetWidth,height:D.offsetHeight};var I=D.getBoundingClientRect();return{width:Math.round(I.width),height:Math.round(I.height)}}(this.element),se={},W[I])!W[I].hasOwnProperty(X)||(Z=z(this.element,(E=W[I][X]).value),oe="width"===E.property?$.width:$.height,te="","min"===E.mode&&oe>=Z&&(te+=E.value),"max"===E.mode&&oe<=Z&&(te+=E.value),se[Ce=E.mode+"-"+E.property]||(se[Ce]=""),te&&-1===(" "+se[Ce]+" ").indexOf(" "+te+" ")&&(se[Ce]+=" "+te));for(var ne in me)!me.hasOwnProperty(ne)||(se[me[ne]]?this.element.setAttribute(me[ne],se[me[ne]].substr(1)):this.element.removeAttribute(me[ne]))}}function x(D,I){D.elementQueriesSetupInformation||(D.elementQueriesSetupInformation=new v(D,I)),D.elementQueriesSensor||(D.elementQueriesSensor=new dt(D,function(){D.elementQueriesSetupInformation.call()}))}function O(D,I,X,E){if(void 0===W[D]){W[D]=[];var $=j.length;he.innerHTML+="\n"+D+" {animation: 0.1s element-queries;}",he.innerHTML+="\n"+D+" > .resize-sensor {min-width: "+$+"px;}",j.push(D)}W[D].push({mode:I,property:X,value:E})}function A(D){var I;if(document.querySelectorAll&&(I=D?D.querySelectorAll.bind(D):document.querySelectorAll.bind(document)),!I&&"undefined"!=typeof $$&&(I=$$),!I&&"undefined"!=typeof jQuery&&(I=jQuery),!I)throw"No document.querySelectorAll, jQuery or Mootools's $$ found.";return I}function y(D){var I=[],X=[],E=[],$=0,Z=-1,oe=[];for(var se in D.children)if(D.children.hasOwnProperty(se)&&D.children[se].tagName&&"img"===D.children[se].tagName.toLowerCase()){I.push(D.children[se]);var te=D.children[se].getAttribute("min-width")||D.children[se].getAttribute("data-min-width"),Ce=D.children[se].getAttribute("data-src")||D.children[se].getAttribute("url");E.push(Ce),X.push({minWidth:te}),te?D.children[se].style.display="none":($=I.length-1,D.children[se].style.display="block")}function ne(){var Ie,_e=!1;for(Ie in I)!I.hasOwnProperty(Ie)||X[Ie].minWidth&&D.offsetWidth>X[Ie].minWidth&&(_e=Ie);if(_e||(_e=$),Z!==_e)if(oe[_e])I[Z].style.display="none",I[_e].style.display="block",Z=_e;else{var Ge=new Image;Ge.onload=function(){I[_e].src=E[_e],I[Z].style.display="none",I[_e].style.display="block",oe[_e]=!0,Z=_e},Ge.src=E[_e]}else I[_e].src=E[_e]}Z=$,D.resizeSensorInstance=new dt(D,ne),ne()}var T=/,?[\s\t]*([^,\n]*?)((?:\[[\s\t]*?(?:min|max)-(?:width|height)[\s\t]*?[~$\^]?=[\s\t]*?"[^"]*?"[\s\t]*?])+)([^,\n\s\{]*)/gim,V=/\[[\s\t]*?(min|max)-(width|height)[\s\t]*?[~$\^]?=[\s\t]*?"([^"]*?)"[\s\t]*?]/gim;function R(D){var I,X,E,$;for(D=D.replace(/'/g,'"');null!==(I=T.exec(D));)for(X=I[1]+I[3],E=I[2];null!==($=V.exec(E));)O(X,$[1],$[2],$[3])}function K(D){var I="";if(D)if("string"==typeof D)(-1!==(D=D.toLowerCase()).indexOf("min-width")||-1!==D.indexOf("max-width"))&&R(D);else for(var X=0,E=D.length;X 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),ce=!0);for(var I=0,X=document.styleSheets.length;I{var yt=Je(910),ee=Je(369),Tt=Je(322);function dt(Q,z,v){if(!yt(Q))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(!Q.hasNode(z))throw new Error('graphology-shortest-path: the "'+z+'" source node does not exist in the given graph.');if(!Q.hasNode(v))throw new Error('graphology-shortest-path: the "'+v+'" target node does not exist in the given graph.');if((z=""+z)==(v=""+v))return[z];var x=Q.inboundNeighbors.bind(Q),O=Q.outboundNeighbors.bind(Q),A={},b={};A[z]=null,b[v]=null;var T,V,R,K,ce,D,I,X,y=[z],S=[v],E=!1;e:for(;y.length&&S.length;)if(y.length<=S.length){for(T=y,y=[],ce=0,I=T.length;ce{Ut.exports=function(Je){return null!==Je&&"object"==typeof Je&&"function"==typeof Je.addUndirectedEdgeWithKey&&"function"==typeof Je.dropNode&&"boolean"==typeof Je.multi}},698:function(Ut){Ut.exports=function(){"use strict";function it(ie){return(it="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(fe){return typeof fe}:function(fe){return fe&&"function"==typeof Symbol&&fe.constructor===Symbol&&fe!==Symbol.prototype?"symbol":typeof fe})(ie)}function Je(ie,fe){ie.prototype=Object.create(fe.prototype),ie.prototype.constructor=ie,ee(ie,fe)}function yt(ie){return(yt=Object.setPrototypeOf?Object.getPrototypeOf:function(fe){return fe.__proto__||Object.getPrototypeOf(fe)})(ie)}function ee(ie,fe){return(ee=Object.setPrototypeOf||function(re,M){return re.__proto__=M,re})(ie,fe)}function Tt(){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(ie){return!1}}function dt(ie,fe,re){return(dt=Tt()?Reflect.construct:function(M,k,J){var we=[null];we.push.apply(we,k);var Fe=new(Function.bind.apply(M,we));return J&&ee(Fe,J.prototype),Fe}).apply(null,arguments)}function Y(ie){var fe="function"==typeof Map?new Map:void 0;return(Y=function(re){if(null===re||-1===Function.toString.call(re).indexOf("[native code]"))return re;if("function"!=typeof re)throw new TypeError("Super expression must either be null or a function");if(void 0!==fe){if(fe.has(re))return fe.get(re);fe.set(re,k)}function k(){return dt(re,arguments,yt(this).constructor)}return k.prototype=Object.create(re.prototype,{constructor:{value:k,enumerable:!1,writable:!0,configurable:!0}}),ee(k,re)})(ie)}function Se(ie){if(void 0===ie)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return ie}var he=function(){for(var ie=arguments[0],fe=1,re=arguments.length;fe0&&we.length>k&&!we.warned){we.warned=!0;var nt=new Error("Possible EventEmitter memory leak detected. "+we.length+" "+String(fe)+" listeners added. Use emitter.setMaxListeners() to increase limit");nt.name="MaxListenersExceededWarning",nt.emitter=ie,nt.type=fe,nt.count=we.length,console&&console.warn&&console.warn(nt)}return ie}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 I(ie,fe,re){var M={fired:!1,wrapFn:void 0,target:ie,type:fe,listener:re},k=D.bind(M);return k.listener=re,M.wrapFn=k,k}function X(ie,fe,re){var M=ie._events;if(void 0===M)return[];var k=M[fe];return void 0===k?[]:"function"==typeof k?re?[k.listener||k]:[k]:re?function(J){for(var we=new Array(J.length),Fe=0;Fe0&&(J=fe[0]),J instanceof Error)throw J;var we=new Error("Unhandled error."+(J?" ("+J.message+")":""));throw we.context=J,we}var Fe=k[ie];if(void 0===Fe)return!1;if("function"==typeof Fe)y(Fe,this,fe);else{var nt=Fe.length,Ot=$(Fe,nt);for(re=0;re=0;J--)if(re[J]===fe||re[J].listener===fe){we=re[J].listener,k=J;break}if(k<0)return this;0===k?re.shift():function(Fe,nt){for(;nt+1=0;M--)this.removeListener(ie,fe[M]);return this},T.prototype.listeners=function(ie){return X(this,ie,!0)},T.prototype.rawListeners=function(ie){return X(this,ie,!1)},T.listenerCount=function(ie,fe){return"function"==typeof ie.listenerCount?ie.listenerCount(fe):E.call(ie,fe)},T.prototype.listenerCount=E,T.prototype.eventNames=function(){return this._eventsCount>0?O(this._events):[]},oe.prototype.next=function(){if(this.done)return{done:!0};var ie=this._next();return ie.done&&(this.done=!0),ie},"undefined"!=typeof Symbol&&(oe.prototype[Symbol.iterator]=function(){return this}),oe.of=function(){var ie=arguments,fe=ie.length,re=0;return new oe(function(){return re>=fe?{done:!0}:{done:!1,value:ie[re++]}})},oe.empty=function(){var ie=new oe(null);return ie.done=!0,ie},oe.is=function(ie){return ie instanceof oe||"object"==typeof ie&&null!==ie&&"function"==typeof ie.next};var se=oe,te=function(ie,fe){for(var re,M=arguments.length>1?fe:1/0,k=M!==1/0?new Array(M):[],J=0;;){if(J===M)return k;if((re=ie.next()).done)return J!==fe?k.slice(0,J):k;k[J++]=re.value}},Ce=function(ie){function fe(re,M){var k;return(k=ie.call(this)||this).name="GraphError",k.message=re||"",k.data=M||{},k}return Je(fe,ie),fe}(Y(Error)),me=function(ie){function fe(re,M){var k;return(k=ie.call(this,re,M)||this).name="InvalidArgumentsGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(Se(k),fe.prototype.constructor),k}return Je(fe,ie),fe}(Ce),ne=function(ie){function fe(re,M){var k;return(k=ie.call(this,re,M)||this).name="NotFoundGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(Se(k),fe.prototype.constructor),k}return Je(fe,ie),fe}(Ce),_e=function(ie){function fe(re,M){var k;return(k=ie.call(this,re,M)||this).name="UsageGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(Se(k),fe.prototype.constructor),k}return Je(fe,ie),fe}(Ce);function Ie(ie,fe){this.key=ie,this.attributes=fe,this.inDegree=0,this.outDegree=0,this.undirectedDegree=0,this.directedSelfLoops=0,this.undirectedSelfLoops=0,this.in={},this.out={},this.undirected={}}function Ge(ie,fe){this.key=ie,this.attributes=fe,this.inDegree=0,this.outDegree=0,this.directedSelfLoops=0,this.in={},this.out={}}function st(ie,fe){this.key=ie,this.attributes=fe,this.undirectedDegree=0,this.undirectedSelfLoops=0,this.undirected={}}function Xe(ie,fe,re,M,k,J){this.key=fe,this.attributes=J,this.undirected=ie,this.source=M,this.target=k,this.generatedKey=re}function tt(ie,fe,re,M,k,J,we){var Fe,nt,Ot="out",We="in";if(fe&&(Ot=We="undirected"),ie.multi){if(void 0===(nt=(Fe=J[Ot])[k])&&(nt=new Set,Fe[k]=nt),nt.add(re),M===k&&fe)return;void 0===(Fe=we[We])[M]&&(Fe[M]=nt)}else{if(J[Ot][k]=re,M===k&&fe)return;we[We][M]=re}}function Ye(ie,fe,re){var M=ie.multi,k=re.source,J=re.target,we=k.key,Fe=J.key,nt=k[fe?"undirected":"out"],Ot=fe?"undirected":"in";if(Fe in nt)if(M){var We=nt[Fe];1===We.size?(delete nt[Fe],delete J[Ot][we]):We.delete(re)}else delete nt[Fe];M||delete J[Ot][we]}Ge.prototype.upgradeToMixed=function(){this.undirectedDegree=0,this.undirectedSelfLoops=0,this.undirected={}},st.prototype.upgradeToMixed=function(){this.inDegree=0,this.outDegree=0,this.directedSelfLoops=0,this.in={},this.out={}};var Ue=[{name:function(ie){return"get".concat(ie,"Attribute")},attacher:function(ie,fe,re){ie.prototype[fe]=function(M,k){var J;if("mixed"!==this.type&&"mixed"!==re&&re!==this.type)throw new _e("Graph.".concat(fe,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new _e("Graph.".concat(fe,": 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=""+M,Fe=""+k;if(k=arguments[2],!(J=W(this,we,Fe,re)))throw new ne("Graph.".concat(fe,': could not find an edge for the given path ("').concat(we,'" - "').concat(Fe,'").'))}else if(!(J=this._edges.get(M=""+M)))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" edge in the graph.'));if("mixed"!==re&&J.undirected!==("undirected"===re))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" ').concat(re," edge in the graph."));return J.attributes[k]}}},{name:function(ie){return"get".concat(ie,"Attributes")},attacher:function(ie,fe,re){ie.prototype[fe]=function(M){var k;if("mixed"!==this.type&&"mixed"!==re&&re!==this.type)throw new _e("Graph.".concat(fe,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>1){if(this.multi)throw new _e("Graph.".concat(fe,": 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 J=""+M,we=""+arguments[1];if(!(k=W(this,J,we,re)))throw new ne("Graph.".concat(fe,': could not find an edge for the given path ("').concat(J,'" - "').concat(we,'").'))}else if(!(k=this._edges.get(M=""+M)))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" edge in the graph.'));if("mixed"!==re&&k.undirected!==("undirected"===re))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" ').concat(re," edge in the graph."));return k.attributes}}},{name:function(ie){return"has".concat(ie,"Attribute")},attacher:function(ie,fe,re){ie.prototype[fe]=function(M,k){var J;if("mixed"!==this.type&&"mixed"!==re&&re!==this.type)throw new _e("Graph.".concat(fe,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new _e("Graph.".concat(fe,": 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=""+M,Fe=""+k;if(k=arguments[2],!(J=W(this,we,Fe,re)))throw new ne("Graph.".concat(fe,': could not find an edge for the given path ("').concat(we,'" - "').concat(Fe,'").'))}else if(!(J=this._edges.get(M=""+M)))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" edge in the graph.'));if("mixed"!==re&&J.undirected!==("undirected"===re))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" ').concat(re," edge in the graph."));return J.attributes.hasOwnProperty(k)}}},{name:function(ie){return"set".concat(ie,"Attribute")},attacher:function(ie,fe,re){ie.prototype[fe]=function(M,k,J){var we;if("mixed"!==this.type&&"mixed"!==re&&re!==this.type)throw new _e("Graph.".concat(fe,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>3){if(this.multi)throw new _e("Graph.".concat(fe,": 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=""+M,nt=""+k;if(k=arguments[2],J=arguments[3],!(we=W(this,Fe,nt,re)))throw new ne("Graph.".concat(fe,': could not find an edge for the given path ("').concat(Fe,'" - "').concat(nt,'").'))}else if(!(we=this._edges.get(M=""+M)))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" edge in the graph.'));if("mixed"!==re&&we.undirected!==("undirected"===re))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" ').concat(re," edge in the graph."));return we.attributes[k]=J,this.emit("edgeAttributesUpdated",{key:we.key,type:"set",attributes:we.attributes,name:k}),this}}},{name:function(ie){return"update".concat(ie,"Attribute")},attacher:function(ie,fe,re){ie.prototype[fe]=function(M,k,J){var we;if("mixed"!==this.type&&"mixed"!==re&&re!==this.type)throw new _e("Graph.".concat(fe,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>3){if(this.multi)throw new _e("Graph.".concat(fe,": 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=""+M,nt=""+k;if(k=arguments[2],J=arguments[3],!(we=W(this,Fe,nt,re)))throw new ne("Graph.".concat(fe,': could not find an edge for the given path ("').concat(Fe,'" - "').concat(nt,'").'))}else if(!(we=this._edges.get(M=""+M)))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" edge in the graph.'));if("function"!=typeof J)throw new me("Graph.".concat(fe,": updater should be a function."));if("mixed"!==re&&we.undirected!==("undirected"===re))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" ').concat(re," edge in the graph."));return we.attributes[k]=J(we.attributes[k]),this.emit("edgeAttributesUpdated",{key:we.key,type:"set",attributes:we.attributes,name:k}),this}}},{name:function(ie){return"remove".concat(ie,"Attribute")},attacher:function(ie,fe,re){ie.prototype[fe]=function(M,k){var J;if("mixed"!==this.type&&"mixed"!==re&&re!==this.type)throw new _e("Graph.".concat(fe,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new _e("Graph.".concat(fe,": 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=""+M,Fe=""+k;if(k=arguments[2],!(J=W(this,we,Fe,re)))throw new ne("Graph.".concat(fe,': could not find an edge for the given path ("').concat(we,'" - "').concat(Fe,'").'))}else if(!(J=this._edges.get(M=""+M)))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" edge in the graph.'));if("mixed"!==re&&J.undirected!==("undirected"===re))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" ').concat(re," edge in the graph."));return delete J.attributes[k],this.emit("edgeAttributesUpdated",{key:J.key,type:"remove",attributes:J.attributes,name:k}),this}}},{name:function(ie){return"replace".concat(ie,"Attributes")},attacher:function(ie,fe,re){ie.prototype[fe]=function(M,k){var J;if("mixed"!==this.type&&"mixed"!==re&&re!==this.type)throw new _e("Graph.".concat(fe,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new _e("Graph.".concat(fe,": 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=""+M,Fe=""+k;if(k=arguments[2],!(J=W(this,we,Fe,re)))throw new ne("Graph.".concat(fe,': could not find an edge for the given path ("').concat(we,'" - "').concat(Fe,'").'))}else if(!(J=this._edges.get(M=""+M)))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" edge in the graph.'));if(!P(k))throw new me("Graph.".concat(fe,": provided attributes are not a plain object."));if("mixed"!==re&&J.undirected!==("undirected"===re))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" ').concat(re," edge in the graph."));return J.attributes=k,this.emit("edgeAttributesUpdated",{key:J.key,type:"replace",attributes:J.attributes}),this}}},{name:function(ie){return"merge".concat(ie,"Attributes")},attacher:function(ie,fe,re){ie.prototype[fe]=function(M,k){var J;if("mixed"!==this.type&&"mixed"!==re&&re!==this.type)throw new _e("Graph.".concat(fe,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new _e("Graph.".concat(fe,": 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=""+M,Fe=""+k;if(k=arguments[2],!(J=W(this,we,Fe,re)))throw new ne("Graph.".concat(fe,': could not find an edge for the given path ("').concat(we,'" - "').concat(Fe,'").'))}else if(!(J=this._edges.get(M=""+M)))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" edge in the graph.'));if(!P(k))throw new me("Graph.".concat(fe,": provided attributes are not a plain object."));if("mixed"!==re&&J.undirected!==("undirected"===re))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" ').concat(re," edge in the graph."));return he(J.attributes,k),this.emit("edgeAttributesUpdated",{key:J.key,type:"merge",attributes:J.attributes,data:k}),this}}}],ke=se,Ke=function(){var ie,fe=arguments,re=-1;return new ke(function M(){if(!ie){if(++re>=fe.length)return{done:!0};ie=fe[re]}var k=ie.next();return k.done?(ie=null,M()):k})},Me=[{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 Ve(ie,fe){for(var re in fe)ie.push(fe[re].key)}function $e(ie,fe){for(var re in fe)fe[re].forEach(function(M){return ie.push(M.key)})}function Ne(ie,fe,re){for(var M in ie)if(M!==re){var k=ie[M];fe(k.key,k.attributes,k.source.key,k.target.key,k.source.attributes,k.target.attributes,k.undirected,k.generatedKey)}}function q(ie,fe,re){for(var M in ie)M!==re&&ie[M].forEach(function(k){return fe(k.key,k.attributes,k.source.key,k.target.key,k.source.attributes,k.target.attributes,k.undirected,k.generatedKey)})}function G(ie,fe,re){for(var M in ie)if(M!==re){var k=ie[M];if(fe(k.key,k.attributes,k.source.key,k.target.key,k.source.attributes,k.target.attributes,k.undirected,k.generatedKey))return!0}return!1}function pe(ie,fe,re){var M,k,J,we,Fe;for(var nt in ie)if(nt!==re)for(M=ie[nt].values();!0!==(k=M.next()).done;)if(we=(J=k.value).source,fe(J.key,J.attributes,we.key,(Fe=J.target).key,we.attributes,Fe.attributes,J.undirected,J.generatedKey))return!0;return!1}function ue(ie,fe){var re=Object.keys(ie),M=re.length,k=null,J=0;return new se(function we(){var Fe;if(k){var nt=k.next();if(nt.done)return k=null,J++,we();Fe=nt.value}else{if(J>=M)return{done:!0};var Ot=re[J];if(Ot===fe)return J++,we();if((Fe=ie[Ot])instanceof Set)return k=Fe.values(),we();J++}return{done:!1,value:[Fe.key,Fe.attributes,Fe.source.key,Fe.target.key,Fe.source.attributes,Fe.target.attributes]}})}function je(ie,fe,re){var M=fe[re];M&&ie.push(M.key)}function _t(ie,fe,re){var M=fe[re];M&&M.forEach(function(k){return ie.push(k.key)})}function pt(ie,fe,re){var M=ie[fe];if(M){var k=M.source,J=M.target;re(M.key,M.attributes,k.key,J.key,k.attributes,J.attributes,M.undirected,M.generatedKey)}}function ve(ie,fe,re){var M=ie[fe];M&&M.forEach(function(k){return re(k.key,k.attributes,k.source.key,k.target.key,k.source.attributes,k.target.attributes,k.undirected,k.generatedKey)})}function L(ie,fe,re){var M=ie[fe];if(M){var k=M.source,J=M.target;return re(M.key,M.attributes,k.key,J.key,k.attributes,J.attributes,M.undirected,M.generatedKey)}}function N(ie,fe,re){var M=ie[fe];if(M){for(var k,J,we=M.values();!0!==(k=we.next()).done;)if(re((J=k.value).key,J.attributes,J.source.key,J.target.key,J.source.attributes,J.target.attributes,J.undirected,J.generatedKey))return!0;return!1}}function B(ie,fe){var re=ie[fe];if(re instanceof Set){var M=re.values();return new se(function(){var k=M.next();if(k.done)return k;var J=k.value;return{done:!1,value:[J.key,J.attributes,J.source.key,J.target.key,J.source.attributes,J.target.attributes]}})}return se.of([re.key,re.attributes,re.source.key,re.target.key,re.source.attributes,re.target.attributes])}function Re(ie,fe){if(0===ie.size)return[];if("mixed"===fe||fe===ie.type)return"function"==typeof Array.from?Array.from(ie._edges.keys()):te(ie._edges.keys(),ie._edges.size);for(var re,M,J=new Array("undirected"===fe?ie.undirectedSize:ie.directedSize),we="undirected"===fe,Fe=ie._edges.values(),nt=0;!0!==(re=Fe.next()).done;)(M=re.value).undirected===we&&(J[nt++]=M.key);return J}function Qe(ie,fe,re){if(0!==ie.size)for(var M,k,J="mixed"!==fe&&fe!==ie.type,we="undirected"===fe,Fe=ie._edges.values();!0!==(M=Fe.next()).done;)if(k=M.value,!J||k.undirected===we){var Wt=k.source,xt=k.target;re(k.key,k.attributes,Wt.key,xt.key,Wt.attributes,xt.attributes,k.undirected,k.generatedKey)}}function St(ie,fe,re){if(0!==ie.size)for(var M,k,J="mixed"!==fe&&fe!==ie.type,we="undirected"===fe,Fe=ie._edges.values();!0!==(M=Fe.next()).done;)if(k=M.value,!J||k.undirected===we){var Wt=k.source,xt=k.target;if(re(k.key,k.attributes,Wt.key,xt.key,Wt.attributes,xt.attributes,k.undirected,k.generatedKey))break}}function Nt(ie,fe){if(0===ie.size)return se.empty();var re="mixed"!==fe&&fe!==ie.type,M="undirected"===fe,k=ie._edges.values();return new se(function(){for(var J,we;;){if((J=k.next()).done)return J;if(we=J.value,!re||we.undirected===M)break}return{value:[we.key,we.attributes,we.source.key,we.target.key,we.source.attributes,we.target.attributes],done:!1}})}function On(ie,fe,re,M){var k=[],J=ie?$e:Ve;return"undirected"!==fe&&("out"!==re&&J(k,M.in),"in"!==re&&J(k,M.out),!re&&M.directedSelfLoops>0&&k.splice(k.lastIndexOf(M.key),1)),"directed"!==fe&&J(k,M.undirected),k}function kn(ie,fe,re,M,k){var J=ie?q:Ne;"undirected"!==fe&&("out"!==re&&J(M.in,k),"in"!==re&&J(M.out,k,re?null:M.key)),"directed"!==fe&&J(M.undirected,k)}function Yn(ie,fe,re,M,k){var J=ie?pe:G;"undirected"!==fe&&("out"!==re&&J(M.in,k)||"in"!==re&&J(M.out,k,re?null:M.key))||"directed"===fe||J(M.undirected,k)}function Ti(ie,fe,re){var M=se.empty();return"undirected"!==ie&&("out"!==fe&&void 0!==re.in&&(M=Ke(M,ue(re.in))),"in"!==fe&&void 0!==re.out&&(M=Ke(M,ue(re.out,fe?null:re.key)))),"directed"!==ie&&void 0!==re.undirected&&(M=Ke(M,ue(re.undirected))),M}function wi(ie,fe,re,M,k){var J=fe?_t:je,we=[];return"undirected"!==ie&&(void 0!==M.in&&"out"!==re&&J(we,M.in,k),void 0!==M.out&&"in"!==re&&J(we,M.out,k),!re&&M.directedSelfLoops>0&&we.splice(we.lastIndexOf(M.key),1)),"directed"!==ie&&void 0!==M.undirected&&J(we,M.undirected,k),we}function Xr(ie,fe,re,M,k,J){var we=fe?ve:pt;"undirected"!==ie&&(void 0!==M.in&&"out"!==re&&we(M.in,k,J),M.key!==k&&void 0!==M.out&&"in"!==re&&we(M.out,k,J)),"directed"!==ie&&void 0!==M.undirected&&we(M.undirected,k,J)}function Ls(ie,fe,re,M,k,J){var we=fe?N:L;"undirected"!==ie&&(void 0!==M.in&&"out"!==re&&we(M.in,k,J)||M.key!==k&&void 0!==M.out&&"in"!==re&&we(M.out,k,J,re?null:M.key))||"directed"===ie||void 0===M.undirected||we(M.undirected,k,J)}function gs(ie,fe,re,M){var k=se.empty();return"undirected"!==ie&&(void 0!==re.in&&"out"!==fe&&M in re.in&&(k=Ke(k,B(re.in,M))),void 0!==re.out&&"in"!==fe&&M in re.out&&(k=Ke(k,B(re.out,M)))),"directed"!==ie&&void 0!==re.undirected&&M in re.undirected&&(k=Ke(k,B(re.undirected,M))),k}var Bs=[{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 Qr(ie,fe){if(void 0!==fe)for(var re in fe)ie.add(re)}function el(ie,fe,re){if("mixed"!==ie){if("undirected"===ie)return Object.keys(re.undirected);if("string"==typeof fe)return Object.keys(re[fe])}var M=new Set;return"undirected"!==ie&&("out"!==fe&&Qr(M,re.in),"in"!==fe&&Qr(M,re.out)),"directed"!==ie&&Qr(M,re.undirected),te(M.values(),M.size)}function kl(ie,fe,re){for(var M in fe){var k=fe[M];k instanceof Set&&(k=k.values().next().value);var J=k.source,Fe=J===ie?k.target:J;re(Fe.key,Fe.attributes)}}function Sa(ie,fe,re,M){for(var k in re){var J=re[k];J instanceof Set&&(J=J.values().next().value);var we=J.source,nt=we===fe?J.target:we;ie.has(nt.key)||(ie.add(nt.key),M(nt.key,nt.attributes))}}function Es(ie,fe,re){for(var M in fe){var k=fe[M];k instanceof Set&&(k=k.values().next().value);var J=k.source,Fe=J===ie?k.target:J;if(re(Fe.key,Fe.attributes))return!0}return!1}function Jt(ie,fe,re,M){for(var k in re){var J=re[k];J instanceof Set&&(J=J.values().next().value);var we=J.source,nt=we===fe?J.target:we;if(!ie.has(nt.key)&&(ie.add(nt.key),M(nt.key,nt.attributes)))return!0}return!1}function tl(ie,fe){var re=Object.keys(fe),M=re.length,k=0;return new se(function(){if(k>=M)return{done:!0};var J=fe[re[k++]];J instanceof Set&&(J=J.values().next().value);var we=J.source,nt=we===ie?J.target:we;return{done:!1,value:[nt.key,nt.attributes]}})}function rt(ie,fe,re){var M=Object.keys(re),k=M.length,J=0;return new se(function we(){if(J>=k)return{done:!0};var Fe=re[M[J++]];Fe instanceof Set&&(Fe=Fe.values().next().value);var nt=Fe.source,We=nt===fe?Fe.target:nt;return ie.has(We.key)?we():(ie.add(We.key),{done:!1,value:[We.key,We.attributes]})})}function lt(ie,fe,re,M,k){var J=ie._nodes.get(M);if("undirected"!==fe){if("out"!==re&&void 0!==J.in)for(var we in J.in)if(we===k)return!0;if("in"!==re&&void 0!==J.out)for(var Fe in J.out)if(Fe===k)return!0}if("directed"!==fe&&void 0!==J.undirected)for(var nt in J.undirected)if(nt===k)return!0;return!1}function Le(ie,fe,re){for(var M,k,J,we,Fe,nt,Ot,We=fe._nodes.values(),Wt=fe.type;!0!==(M=We.next()).done;){if(k=M.value,"undirected"!==Wt)for(J in we=k.out)if(nt=(Fe=we[J]).target,Ot=re(k.key,nt.key,k.attributes,nt.attributes,Fe.key,Fe.attributes,Fe.undirected,Fe.generatedKey),ie&&Ot)return;if("directed"!==Wt)for(J in we=k.undirected)if((nt=(Fe=we[J]).target).key!==J&&(nt=Fe.source),Ot=re(k.key,nt.key,k.attributes,nt.attributes,Fe.key,Fe.attributes,Fe.undirected,Fe.generatedKey),ie&&Ot)return}}function ut(ie,fe,re){for(var M,k,J,we,Fe,nt,Ot,We,Wt,xt=fe._nodes.values(),vn=fe.type;!0!==(M=xt.next()).done;){if(k=M.value,"undirected"!==vn)for(J in nt=k.out)for(we=nt[J].values();!0!==(Fe=we.next()).done;)if(We=(Ot=Fe.value).target,Wt=re(k.key,We.key,k.attributes,We.attributes,Ot.key,Ot.attributes,Ot.undirected,Ot.generatedKey),ie&&Wt)return;if("directed"!==vn)for(J in nt=k.undirected)for(we=nt[J].values();!0!==(Fe=we.next()).done;)if((We=(Ot=Fe.value).target).key!==J&&(We=Ot.source),Wt=re(k.key,We.key,k.attributes,We.attributes,Ot.key,Ot.attributes,Ot.undirected,Ot.generatedKey),ie&&Wt)return}}function Ze(ie,fe){var re={key:ie};return Q(fe.attributes)||(re.attributes=he({},fe.attributes)),re}function At(ie,fe){var re={source:fe.source.key,target:fe.target.key};return fe.generatedKey||(re.key=ie),Q(fe.attributes)||(re.attributes=he({},fe.attributes)),fe.undirected&&(re.undirected=!0),re}function Mt(ie){return P(ie)?"key"in ie?!("attributes"in ie)||P(ie.attributes)&&null!==ie.attributes?null:"invalid-attributes":"no-key":"not-object"}function Dt(ie){return P(ie)?"source"in ie?"target"in ie?!("attributes"in ie)||P(ie.attributes)&&null!==ie.attributes?"undirected"in ie&&"boolean"!=typeof ie.undirected?"invalid-undirected":null:"invalid-attributes":"no-target":"no-source":"not-object"}var Xt=new Set(["directed","undirected","mixed"]),zn=new Set(["domain","_events","_eventsCount","_maxListeners"]),ai={allowSelfLoops:!0,edgeKeyGenerator:null,multi:!1,type:"mixed"};function Nn(ie,fe,re){var M=new ie.NodeDataClass(fe,re);return ie._nodes.set(fe,M),ie.emit("nodeAdded",{key:fe,attributes:re}),M}function bn(ie,fe,re,M,k,J,we,Fe){if(!M&&"undirected"===ie.type)throw new _e("Graph.".concat(fe,": you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead."));if(M&&"directed"===ie.type)throw new _e("Graph.".concat(fe,": you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead."));if(Fe&&!P(Fe))throw new me("Graph.".concat(fe,': invalid attributes. Expecting an object but got "').concat(Fe,'"'));if(J=""+J,we=""+we,Fe=Fe||{},!ie.allowSelfLoops&&J===we)throw new _e("Graph.".concat(fe,': source & target are the same ("').concat(J,"\"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false."));var nt=ie._nodes.get(J),Ot=ie._nodes.get(we);if(!nt)throw new ne("Graph.".concat(fe,': source node "').concat(J,'" not found.'));if(!Ot)throw new ne("Graph.".concat(fe,': target node "').concat(we,'" not found.'));var We={key:null,undirected:M,source:J,target:we,attributes:Fe};if(re&&(k=ie._edgeKeyGenerator(We)),ie._edges.has(k=""+k))throw new _e("Graph.".concat(fe,': the "').concat(k,'" edge already exists in the graph.'));if(!ie.multi&&(M?void 0!==nt.undirected[we]:void 0!==nt.out[we]))throw new _e("Graph.".concat(fe,': an edge linking "').concat(J,'" 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 Wt=new Xe(M,k,re,nt,Ot,Fe);return ie._edges.set(k,Wt),J===we?M?(nt.undirectedSelfLoops++,ie._undirectedSelfLoopCount++):(nt.directedSelfLoops++,ie._directedSelfLoopCount++):M?(nt.undirectedDegree++,Ot.undirectedDegree++):(nt.outDegree++,Ot.inDegree++),tt(ie,M,Wt,J,we,nt,Ot),M?ie._undirectedSize++:ie._directedSize++,We.key=k,ie.emit("edgeAdded",We),k}function $n(ie,fe,re,M,k,J,we,Fe,nt){if(!M&&"undirected"===ie.type)throw new _e("Graph.".concat(fe,": you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead."));if(M&&"directed"===ie.type)throw new _e("Graph.".concat(fe,": you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead."));if(Fe)if(nt){if("function"!=typeof Fe)throw new me("Graph.".concat(fe,': invalid updater function. Expecting a function but got "').concat(Fe,'"'))}else if(!P(Fe))throw new me("Graph.".concat(fe,': invalid attributes. Expecting an object but got "').concat(Fe,'"'));var Ot;if(J=""+J,we=""+we,nt&&(Ot=Fe,Fe=void 0),!ie.allowSelfLoops&&J===we)throw new _e("Graph.".concat(fe,': source & target are the same ("').concat(J,"\"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false."));var We,Wt,xt=ie._nodes.get(J),vn=ie._nodes.get(we);if(!re&&(We=ie._edges.get(k))){if(We.source.key!==J||We.target.key!==we||M&&(We.source.key!==we||We.target.key!==J))throw new _e("Graph.".concat(fe,': inconsistency detected when attempting to merge the "').concat(k,'" edge with "').concat(J,'" source & "').concat(we,'" target vs. ("').concat(We.source.key,'", "').concat(We.target.key,'").'));Wt=We}if(Wt||ie.multi||!xt||(Wt=M?xt.undirected[we]:xt.out[we]),Wt)return(nt?Ot:Fe)?(nt?(Wt.attributes=Ot(Wt.attributes),ie.emit("edgeAttributesUpdated",{type:"replace",key:Wt.key,attributes:Wt.attributes})):(he(Wt.attributes,Fe),ie.emit("edgeAttributesUpdated",{type:"merge",key:Wt.key,attributes:Wt.attributes,data:Fe})),Wt.key):Wt.key;Fe=Fe||{},nt&&Ot&&(Fe=Ot(Fe));var Jr={key:null,undirected:M,source:J,target:we,attributes:Fe};if(re&&(k=ie._edgeKeyGenerator(Jr)),ie._edges.has(k=""+k))throw new _e("Graph.".concat(fe,': the "').concat(k,'" edge already exists in the graph.'));return xt||(xt=Nn(ie,J,{}),J===we&&(vn=xt)),vn||(vn=Nn(ie,we,{})),We=new Xe(M,k,re,xt,vn,Fe),ie._edges.set(k,We),J===we?M?(xt.undirectedSelfLoops++,ie._undirectedSelfLoopCount++):(xt.directedSelfLoops++,ie._directedSelfLoopCount++):M?(xt.undirectedDegree++,vn.undirectedDegree++):(xt.outDegree++,vn.inDegree++),tt(ie,M,We,J,we,xt,vn),M?ie._undirectedSize++:ie._directedSize++,Jr.key=k,ie.emit("edgeAdded",Jr),k}var ie,Tn=function(ie){function fe(M){var k;if(k=ie.call(this)||this,(M=he({},ai,M)).edgeKeyGenerator&&"function"!=typeof M.edgeKeyGenerator)throw new me("Graph.constructor: invalid 'edgeKeyGenerator' option. Expecting a function but got \"".concat(M.edgeKeyGenerator,'".'));if("boolean"!=typeof M.multi)throw new me("Graph.constructor: invalid 'multi' option. Expecting a boolean but got \"".concat(M.multi,'".'));if(!Xt.has(M.type))throw new me('Graph.constructor: invalid \'type\' option. Should be one of "mixed", "directed" or "undirected" but got "'.concat(M.type,'".'));if("boolean"!=typeof M.allowSelfLoops)throw new me("Graph.constructor: invalid 'allowSelfLoops' option. Expecting a boolean but got \"".concat(M.allowSelfLoops,'".'));var J,we="mixed"===M.type?Ie:"directed"===M.type?Ge:st;return z(Se(k),"NodeDataClass",we),z(Se(k),"_attributes",{}),z(Se(k),"_nodes",new Map),z(Se(k),"_edges",new Map),z(Se(k),"_directedSize",0),z(Se(k),"_undirectedSize",0),z(Se(k),"_directedSelfLoopCount",0),z(Se(k),"_undirectedSelfLoopCount",0),z(Se(k),"_edgeKeyGenerator",M.edgeKeyGenerator||(J=0,function(){return J++})),z(Se(k),"_options",M),zn.forEach(function(Fe){return z(Se(k),Fe,k[Fe])}),v(Se(k),"order",function(){return k._nodes.size}),v(Se(k),"size",function(){return k._edges.size}),v(Se(k),"directedSize",function(){return k._directedSize}),v(Se(k),"undirectedSize",function(){return k._undirectedSize}),v(Se(k),"selfLoopCount",function(){return k._directedSelfLoopCount+k._undirectedSelfLoopCount}),v(Se(k),"directedSelfLoopCount",function(){return k._directedSelfLoopCount}),v(Se(k),"undirectedSelfLoopCount",function(){return k._undirectedSelfLoopCount}),v(Se(k),"multi",k._options.multi),v(Se(k),"type",k._options.type),v(Se(k),"allowSelfLoops",k._options.allowSelfLoops),v(Se(k),"implementation",function(){return"graphology"}),k}Je(fe,ie);var re=fe.prototype;return re.hasNode=function(M){return this._nodes.has(""+M)},re.hasDirectedEdge=function(M,k){if("undirected"===this.type)return!1;if(1===arguments.length){var we=this._edges.get(""+M);return!!we&&!we.undirected}if(2===arguments.length){k=""+k;var Fe=this._nodes.get(M=""+M);if(!Fe)return!1;var nt=Fe.out[k];return!(!nt||this.multi&&!nt.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."))},re.hasUndirectedEdge=function(M,k){if("directed"===this.type)return!1;if(1===arguments.length){var we=this._edges.get(""+M);return!!we&&we.undirected}if(2===arguments.length){k=""+k;var Fe=this._nodes.get(M=""+M);if(!Fe)return!1;var nt=Fe.undirected[k];return!(!nt||this.multi&&!nt.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."))},re.hasEdge=function(M,k){if(1===arguments.length)return this._edges.has(""+M);if(2===arguments.length){k=""+k;var we=this._nodes.get(M=""+M);if(!we)return!1;var Fe=void 0!==we.out&&we.out[k];return Fe||(Fe=void 0!==we.undirected&&we.undirected[k]),!(!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."))},re.directedEdge=function(M,k){if("undirected"!==this.type){if(M=""+M,k=""+k,this.multi)throw new _e("Graph.directedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.directedEdges instead.");var J=this._nodes.get(M);if(!J)throw new ne('Graph.directedEdge: could not find the "'.concat(M,'" source node in the graph.'));if(!this._nodes.has(k))throw new ne('Graph.directedEdge: could not find the "'.concat(k,'" target node in the graph.'));var we=J.out&&J.out[k]||void 0;return we?we.key:void 0}},re.undirectedEdge=function(M,k){if("directed"!==this.type){if(M=""+M,k=""+k,this.multi)throw new _e("Graph.undirectedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.undirectedEdges instead.");var J=this._nodes.get(M);if(!J)throw new ne('Graph.undirectedEdge: could not find the "'.concat(M,'" source node in the graph.'));if(!this._nodes.has(k))throw new ne('Graph.undirectedEdge: could not find the "'.concat(k,'" target node in the graph.'));var we=J.undirected&&J.undirected[k]||void 0;return we?we.key:void 0}},re.edge=function(M,k){if(this.multi)throw new _e("Graph.edge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.edges instead.");k=""+k;var J=this._nodes.get(M=""+M);if(!J)throw new ne('Graph.edge: could not find the "'.concat(M,'" source node in the graph.'));if(!this._nodes.has(k))throw new ne('Graph.edge: could not find the "'.concat(k,'" target node in the graph.'));var we=J.out&&J.out[k]||J.undirected&&J.undirected[k]||void 0;if(we)return we.key},re.inDegree=function(M){var k=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof k)throw new me('Graph.inDegree: Expecting a boolean but got "'.concat(k,'" for the second parameter (allowing self-loops to be counted).'));var J=this._nodes.get(M=""+M);if(!J)throw new ne('Graph.inDegree: could not find the "'.concat(M,'" node in the graph.'));return"undirected"===this.type?0:J.inDegree+(k?J.directedSelfLoops:0)},re.outDegree=function(M){var k=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof k)throw new me('Graph.outDegree: Expecting a boolean but got "'.concat(k,'" for the second parameter (allowing self-loops to be counted).'));var J=this._nodes.get(M=""+M);if(!J)throw new ne('Graph.outDegree: could not find the "'.concat(M,'" node in the graph.'));return"undirected"===this.type?0:J.outDegree+(k?J.directedSelfLoops:0)},re.directedDegree=function(M){var k=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof k)throw new me('Graph.directedDegree: Expecting a boolean but got "'.concat(k,'" for the second parameter (allowing self-loops to be counted).'));var J=this._nodes.get(M=""+M);if(!J)throw new ne('Graph.directedDegree: could not find the "'.concat(M,'" node in the graph.'));if("undirected"===this.type)return 0;var we=k?J.directedSelfLoops:0;return J.inDegree+we+(J.outDegree+we)},re.undirectedDegree=function(M){var k=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof k)throw new me('Graph.undirectedDegree: Expecting a boolean but got "'.concat(k,'" for the second parameter (allowing self-loops to be counted).'));var J=this._nodes.get(M=""+M);if(!J)throw new ne('Graph.undirectedDegree: could not find the "'.concat(M,'" node in the graph.'));return"directed"===this.type?0:J.undirectedDegree+2*(k?J.undirectedSelfLoops:0)},re.degree=function(M){var k=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof k)throw new me('Graph.degree: Expecting a boolean but got "'.concat(k,'" for the second parameter (allowing self-loops to be counted).'));var J=this._nodes.get(M=""+M);if(!J)throw new ne('Graph.degree: could not find the "'.concat(M,'" node in the graph.'));var we=0,Fe=0;return"directed"!==this.type&&(k&&(Fe=J.undirectedSelfLoops),we+=J.undirectedDegree+2*Fe),"undirected"!==this.type&&(k&&(Fe=J.directedSelfLoops),we+=J.inDegree+J.outDegree+2*Fe),we},re.source=function(M){var k=this._edges.get(M=""+M);if(!k)throw new ne('Graph.source: could not find the "'.concat(M,'" edge in the graph.'));return k.source.key},re.target=function(M){var k=this._edges.get(M=""+M);if(!k)throw new ne('Graph.target: could not find the "'.concat(M,'" edge in the graph.'));return k.target.key},re.extremities=function(M){var k=this._edges.get(M=""+M);if(!k)throw new ne('Graph.extremities: could not find the "'.concat(M,'" edge in the graph.'));return[k.source.key,k.target.key]},re.opposite=function(M,k){M=""+M;var J=this._edges.get(k=""+k);if(!J)throw new ne('Graph.opposite: could not find the "'.concat(k,'" edge in the graph.'));var we=J.source.key,Fe=J.target.key;if(M!==we&&M!==Fe)throw new ne('Graph.opposite: the "'.concat(M,'" node is not attached to the "').concat(k,'" edge (').concat(we,", ").concat(Fe,")."));return M===we?Fe:we},re.hasExtremity=function(M,k){k=""+k;var J=this._edges.get(M=""+M);if(!J)throw new ne('Graph.hasExtremity: could not find the "'.concat(M,'" edge in the graph.'));return J.source.key===k||J.target.key===k},re.isUndirected=function(M){var k=this._edges.get(M=""+M);if(!k)throw new ne('Graph.isUndirected: could not find the "'.concat(M,'" edge in the graph.'));return k.undirected},re.isDirected=function(M){var k=this._edges.get(M=""+M);if(!k)throw new ne('Graph.isDirected: could not find the "'.concat(M,'" edge in the graph.'));return!k.undirected},re.isSelfLoop=function(M){var k=this._edges.get(M=""+M);if(!k)throw new ne('Graph.isSelfLoop: could not find the "'.concat(M,'" edge in the graph.'));return k.source===k.target},re.hasGeneratedKey=function(M){var k=this._edges.get(M=""+M);if(!k)throw new ne('Graph.hasGeneratedKey: could not find the "'.concat(M,'" edge in the graph.'));return k.generatedKey},re.addNode=function(M,k){return function(J,we,Fe){if(Fe&&!P(Fe))throw new me('Graph.addNode: invalid attributes. Expecting an object but got "'.concat(Fe,'"'));if(Fe=Fe||{},J._nodes.has(we=""+we))throw new _e('Graph.addNode: the "'.concat(we,'" node already exist in the graph.'));var nt=new J.NodeDataClass(we,Fe);return J._nodes.set(we,nt),J.emit("nodeAdded",{key:we,attributes:Fe}),nt}(this,M,k).key},re.mergeNode=function(M,k){if(k&&!P(k))throw new me('Graph.mergeNode: invalid attributes. Expecting an object but got "'.concat(k,'"'));k=k||{};var J=this._nodes.get(M=""+M);return J?(k&&(he(J.attributes,k),this.emit("nodeAttributesUpdated",{type:"merge",key:M,attributes:J.attributes,data:k})),M):(J=new this.NodeDataClass(M,k),this._nodes.set(M,J),this.emit("nodeAdded",{key:M,attributes:k}),M)},re.updateNode=function(M,k){if(k&&"function"!=typeof k)throw new me('Graph.updateNode: invalid updater function. Expecting a function but got "'.concat(k,'"'));var J=this._nodes.get(M=""+M);if(J)return k&&(J.attributes=k(J.attributes),this.emit("nodeAttributesUpdated",{type:"replace",key:M,attributes:J.attributes})),M;var Fe=k?k({}):{};return J=new this.NodeDataClass(M,Fe),this._nodes.set(M,J),this.emit("nodeAdded",{key:M,attributes:Fe}),M},re.dropNode=function(M){var k=this,J=this._nodes.get(M=""+M);if(!J)throw new ne('Graph.dropNode: could not find the "'.concat(M,'" node in the graph.'));this.forEachEdge(M,function(we){k.dropEdge(we)}),this._nodes.delete(M),this.emit("nodeDropped",{key:M,attributes:J.attributes})},re.dropEdge=function(M){var k;if(arguments.length>1){var J=""+arguments[0],we=""+arguments[1];if(!(k=W(this,J,we,this.type)))throw new ne('Graph.dropEdge: could not find the "'.concat(J,'" -> "').concat(we,'" edge in the graph.'))}else if(!(k=this._edges.get(M=""+M)))throw new ne('Graph.dropEdge: could not find the "'.concat(M,'" edge in the graph.'));this._edges.delete(k.key);var nt=k.source,Ot=k.target,We=k.attributes,Wt=k.undirected;return nt===Ot?Wt?(nt.undirectedSelfLoops--,this._undirectedSelfLoopCount--):(nt.directedSelfLoops--,this._directedSelfLoopCount--):Wt?(nt.undirectedDegree--,Ot.undirectedDegree--):(nt.outDegree--,Ot.inDegree--),Ye(this,Wt,k),Wt?this._undirectedSize--:this._directedSize--,this.emit("edgeDropped",{key:M,attributes:We,source:nt.key,target:Ot.key,undirected:Wt}),this},re.clear=function(){this._edges.clear(),this._nodes.clear(),this.emit("cleared")},re.clearEdges=function(){this._edges.clear(),this.clearIndex(),this.emit("edgesCleared")},re.getAttribute=function(M){return this._attributes[M]},re.getAttributes=function(){return this._attributes},re.hasAttribute=function(M){return this._attributes.hasOwnProperty(M)},re.setAttribute=function(M,k){return this._attributes[M]=k,this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:M}),this},re.updateAttribute=function(M,k){if("function"!=typeof k)throw new me("Graph.updateAttribute: updater should be a function.");return this._attributes[M]=k(this._attributes[M]),this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:M}),this},re.removeAttribute=function(M){return delete this._attributes[M],this.emit("attributesUpdated",{type:"remove",attributes:this._attributes,name:M}),this},re.replaceAttributes=function(M){if(!P(M))throw new me("Graph.replaceAttributes: provided attributes are not a plain object.");return this._attributes=M,this.emit("attributesUpdated",{type:"replace",attributes:this._attributes}),this},re.mergeAttributes=function(M){if(!P(M))throw new me("Graph.mergeAttributes: provided attributes are not a plain object.");return he(this._attributes,M),this.emit("attributesUpdated",{type:"merge",attributes:this._attributes,data:M}),this},re.getNodeAttribute=function(M,k){var J=this._nodes.get(M=""+M);if(!J)throw new ne('Graph.getNodeAttribute: could not find the "'.concat(M,'" node in the graph.'));return J.attributes[k]},re.getNodeAttributes=function(M){var k=this._nodes.get(M=""+M);if(!k)throw new ne('Graph.getNodeAttributes: could not find the "'.concat(M,'" node in the graph.'));return k.attributes},re.hasNodeAttribute=function(M,k){var J=this._nodes.get(M=""+M);if(!J)throw new ne('Graph.hasNodeAttribute: could not find the "'.concat(M,'" node in the graph.'));return J.attributes.hasOwnProperty(k)},re.setNodeAttribute=function(M,k,J){var we=this._nodes.get(M=""+M);if(!we)throw new ne('Graph.setNodeAttribute: could not find the "'.concat(M,'" 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[k]=J,this.emit("nodeAttributesUpdated",{key:M,type:"set",attributes:we.attributes,name:k}),this},re.updateNodeAttribute=function(M,k,J){var we=this._nodes.get(M=""+M);if(!we)throw new ne('Graph.updateNodeAttribute: could not find the "'.concat(M,'" 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 J)throw new me("Graph.updateAttribute: updater should be a function.");var Fe=we.attributes,nt=J(Fe[k]);return Fe[k]=nt,this.emit("nodeAttributesUpdated",{key:M,type:"set",attributes:we.attributes,name:k}),this},re.removeNodeAttribute=function(M,k){var J=this._nodes.get(M=""+M);if(!J)throw new ne('Graph.hasNodeAttribute: could not find the "'.concat(M,'" node in the graph.'));return delete J.attributes[k],this.emit("nodeAttributesUpdated",{key:M,type:"remove",attributes:J.attributes,name:k}),this},re.replaceNodeAttributes=function(M,k){var J=this._nodes.get(M=""+M);if(!J)throw new ne('Graph.replaceNodeAttributes: could not find the "'.concat(M,'" node in the graph.'));if(!P(k))throw new me("Graph.replaceNodeAttributes: provided attributes are not a plain object.");return J.attributes=k,this.emit("nodeAttributesUpdated",{key:M,type:"replace",attributes:J.attributes}),this},re.mergeNodeAttributes=function(M,k){var J=this._nodes.get(M=""+M);if(!J)throw new ne('Graph.mergeNodeAttributes: could not find the "'.concat(M,'" node in the graph.'));if(!P(k))throw new me("Graph.mergeNodeAttributes: provided attributes are not a plain object.");return he(J.attributes,k),this.emit("nodeAttributesUpdated",{key:M,type:"merge",attributes:J.attributes,data:k}),this},re.updateEachNodeAttributes=function(M,k){if("function"!=typeof M)throw new me("Graph.updateEachNodeAttributes: expecting an updater function.");if(k&&!x(k))throw new me("Graph.updateEachNodeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");for(var J,we,Fe=this._nodes.values();!0!==(J=Fe.next()).done;)(we=J.value).attributes=M(we.key,we.attributes);this.emit("eachNodeAttributesUpdated",{hints:k||null})},re.updateEachEdgeAttributes=function(M,k){if("function"!=typeof M)throw new me("Graph.updateEachEdgeAttributes: expecting an updater function.");if(k&&!x(k))throw new me("Graph.updateEachEdgeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");for(var J,we,Fe=this._edges.values();!0!==(J=Fe.next()).done;)(we=J.value).attributes=M(we.key,we.attributes);this.emit("eachEdgeAttributesUpdated",{hints:k||null})},re.forEach=function(M){if("function"!=typeof M)throw new me("Graph.forEach: expecting a callback.");this.multi?ut(!1,this,M):Le(!1,this,M)},re.forEachUntil=function(M){if("function"!=typeof M)throw new me("Graph.forEach: expecting a callback.");this.multi?ut(!0,this,M):Le(!0,this,M)},re.adjacency=function(){return this.multi?(nt=(M=this)._nodes.values(),Ot=M.type,We="outer",Wt=null,new se(function xt(){var vn;if("outer"===We)return!0===(vn=nt.next()).done?vn:(k=vn.value,We="directed",xt());if("directed"===We)return"undirected"===Ot?(We="undirected",xt()):(we=k.out,J=Object.keys(k.out),Fe=0,We="inner-directed",xt());if("undirected"===We){if("directed"===Ot)return We="outer",xt();we=k.undirected,J=Object.keys(k.undirected),Fe=0,We="inner-undirected"}if(!Wt&&Fe>=J.length)return We="inner-undirected"===We?"outer":"undirected",xt();if(!Wt){var Ss=J[Fe++];return Wt=we[Ss].values(),xt()}if((vn=Wt.next()).done)return Wt=null,xt();var Jr=vn.value,Qs=Jr.target;return"inner-undirected"===We&&Qs.key===k.key&&(Qs=Jr.source),{done:!1,value:[k.key,Qs.key,k.attributes,Qs.attributes,Jr.key,Jr.attributes]}})):(Ll=(xt=this)._nodes.values(),po=xt.type,jr="outer",new se(function js(){var xc;if("outer"===jr)return!0===(xc=Ll.next()).done?xc:(vn=xc.value,jr="directed",js());if("directed"===jr)return"undirected"===po?(jr="undirected",js()):(Jr=vn.out,Ss=Object.keys(vn.out),Qs=0,jr="inner-directed",js());if("undirected"===jr){if("directed"===po)return jr="outer",js();Jr=vn.undirected,Ss=Object.keys(vn.undirected),Qs=0,jr="inner-undirected"}if(Qs>=Ss.length)return jr="inner-undirected"===jr?"outer":"undirected",js();var Sn=Ss[Qs++],go=Jr[Sn],Bl=go.target;return"inner-undirected"===jr&&Bl.key===vn.key&&(Bl=go.source),{done:!1,value:[vn.key,Bl.key,vn.attributes,Bl.attributes,go.key,go.attributes]}}));var xt,vn,Ss,Jr,Qs,Ll,po,jr,M,k,J,we,Fe,nt,Ot,We,Wt},re.nodes=function(){return"function"==typeof Array.from?Array.from(this._nodes.keys()):te(this._nodes.keys(),this._nodes.size)},re.forEachNode=function(M){if("function"!=typeof M)throw new me("Graph.forEachNode: expecting a callback.");this._nodes.forEach(function(k,J){M(J,k.attributes)})},re.forEachNodeUntil=function(M){if("function"!=typeof M)throw new me("Graph.forEachNode: expecting a callback.");for(var k,J,we=this._nodes.values();!0!==(k=we.next())&&!M((J=k.value).key,J.attributes););},re.nodeEntries=function(){var M=this._nodes.values();return new se(function(){var k=M.next();if(k.done)return k;var J=k.value;return{value:[J.key,J.attributes],done:!1}})},re.exportNode=function(M){var k=this._nodes.get(M=""+M);if(!k)throw new ne('Graph.exportNode: could not find the "'.concat(M,'" node in the graph.'));return Ze(M,k)},re.exportEdge=function(M){var k=this._edges.get(M=""+M);if(!k)throw new ne('Graph.exportEdge: could not find the "'.concat(M,'" edge in the graph.'));return At(M,k)},re.export=function(){var M=new Array(this._nodes.size),k=0;this._nodes.forEach(function(we,Fe){M[k++]=Ze(Fe,we)});var J=new Array(this._edges.size);return k=0,this._edges.forEach(function(we,Fe){J[k++]=At(Fe,we)}),{attributes:this.getAttributes(),nodes:M,edges:J,options:{type:this.type,multi:this.multi,allowSelfLoops:this.allowSelfLoops}}},re.importNode=function(M){var k=arguments.length>1&&void 0!==arguments[1]&&arguments[1],J=Mt(M);if(J){if("not-object"===J)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"===J)throw new me("Graph.importNode: no key provided.");if("invalid-attributes"===J)throw new me("Graph.importNode: invalid attributes. Attributes should be a plain object, null or omitted.")}var we=M.key,Fe=M.attributes,nt=void 0===Fe?{}:Fe;return k?this.mergeNode(we,nt):this.addNode(we,nt),this},re.importEdge=function(M){var k=arguments.length>1&&void 0!==arguments[1]&&arguments[1],J=Dt(M);if(J){if("not-object"===J)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"===J)throw new me("Graph.importEdge: missing souce.");if("no-target"===J)throw new me("Graph.importEdge: missing target.");if("invalid-attributes"===J)throw new me("Graph.importEdge: invalid attributes. Attributes should be a plain object, null or omitted.");if("invalid-undirected"===J)throw new me("Graph.importEdge: invalid undirected. Undirected should be boolean or omitted.")}var we=M.source,Fe=M.target,nt=M.attributes,Ot=void 0===nt?{}:nt,We=M.undirected,Wt=void 0!==We&&We;return"key"in M?(k?Wt?this.mergeUndirectedEdgeWithKey:this.mergeDirectedEdgeWithKey:Wt?this.addUndirectedEdgeWithKey:this.addDirectedEdgeWithKey).call(this,M.key,we,Fe,Ot):(k?Wt?this.mergeUndirectedEdge:this.mergeDirectedEdge:Wt?this.addUndirectedEdge:this.addDirectedEdge).call(this,we,Fe,Ot),this},re.import=function(M){var k,J,we,Fe=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(j(M))return this.import(M.export(),Fe),this;if(!P(M))throw new me("Graph.import: invalid argument. Expecting a serialized graph or, alternatively, a Graph instance.");if(M.attributes){if(!P(M.attributes))throw new me("Graph.import: invalid attributes. Expecting a plain object.");Fe?this.mergeAttributes(M.attributes):this.replaceAttributes(M.attributes)}if(M.nodes){if(we=M.nodes,!Array.isArray(we))throw new me("Graph.import: invalid nodes. Expecting an array.");for(k=0,J=we.length;kJ)){var Ot=new Set;Ot.add(k.undirected[nt]),k.undirected[nt]=Ot,M._nodes.get(nt).undirected[J]=Ot}})),this;var M},re.clearIndex=function(){return this._nodes.forEach(function(M){void 0!==M.in&&(M.in={},M.out={}),void 0!==M.undirected&&(M.undirected={})}),this},re.toJSON=function(){return this.export()},re.toString=function(){return"[object Graph]"},re.inspect=function(){var M=this,k={};this._nodes.forEach(function(Ot,We){k[We]=Ot.attributes});var J={},we={};this._edges.forEach(function(Ot,We){var Wt=Ot.undirected?"--":"->",xt="",vn="(".concat(Ot.source.key,")").concat(Wt,"(").concat(Ot.target.key,")");Ot.generatedKey?M.multi&&(void 0===we[vn]?we[vn]=0:we[vn]++,xt+="".concat(we[vn],". ")):xt+="[".concat(We,"]: "),J[xt+=vn]=Ot.attributes});var Fe={};for(var nt in this)this.hasOwnProperty(nt)&&!zn.has(nt)&&"function"!=typeof this[nt]&&(Fe[nt]=this[nt]);return Fe.attributes=this._attributes,Fe.nodes=k,Fe.edges=J,z(Fe,"constructor",this.constructor),Fe},fe}(A.exports.EventEmitter);"undefined"!=typeof Symbol&&(Tn.prototype[Symbol.for("nodejs.util.inspect.custom")]=Tn.prototype.inspect),[{name:function(ie){return"".concat(ie,"Edge")},generateKey:!0},{name:function(ie){return"".concat(ie,"DirectedEdge")},generateKey:!0,type:"directed"},{name:function(ie){return"".concat(ie,"UndirectedEdge")},generateKey:!0,type:"undirected"},{name:function(ie){return"".concat(ie,"EdgeWithKey")}},{name:function(ie){return"".concat(ie,"DirectedEdgeWithKey")},type:"directed"},{name:function(ie){return"".concat(ie,"UndirectedEdgeWithKey")},type:"undirected"}].forEach(function(ie){["add","merge","update"].forEach(function(fe){var re=ie.name(fe),M="add"===fe?bn:$n;Tn.prototype[re]=ie.generateKey?function(k,J,we){return M(this,re,!0,"undirected"===(ie.type||this.type),null,k,J,we,"update"===fe)}:function(k,J,we,Fe){return M(this,re,!1,"undirected"===(ie.type||this.type),k,J,we,Fe,"update"===fe)}})}),"undefined"!=typeof Symbol&&(Tn.prototype[Symbol.iterator]=Tn.prototype.adjacency),ie=Tn,Ue.forEach(function(fe){var re=fe.name,M=fe.attacher;M(ie,re("Edge"),"mixed"),M(ie,re("DirectedEdge"),"directed"),M(ie,re("UndirectedEdge"),"undirected")}),function(ie){Me.forEach(function(fe){var M,k,J,we;J=(M=fe).type,we=M.direction,ie.prototype[k=M.name]=function(Fe,nt){if("mixed"!==J&&"mixed"!==this.type&&J!==this.type)return[];if(!arguments.length)return Re(this,J);if(1===arguments.length){var Ot=this._nodes.get(Fe=""+Fe);if(void 0===Ot)throw new ne("Graph.".concat(k,': could not find the "').concat(Fe,'" node in the graph.'));return On(this.multi,"mixed"===J?this.type:J,we,Ot)}if(2===arguments.length){nt=""+nt;var We=this._nodes.get(Fe=""+Fe);if(!We)throw new ne("Graph.".concat(k,': could not find the "').concat(Fe,'" source node in the graph.'));if(!this._nodes.has(nt))throw new ne("Graph.".concat(k,': could not find the "').concat(nt,'" target node in the graph.'));return wi(J,this.multi,we,We,nt)}throw new me("Graph.".concat(k,": too many arguments (expecting 0, 1 or 2 and got ").concat(arguments.length,")."))},function(re,M){var k=M.name,J=M.type,we=M.direction,Fe="forEach"+k[0].toUpperCase()+k.slice(1,-1);re.prototype[Fe]=function(nt,Ot,We){if("mixed"===J||"mixed"===this.type||J===this.type){if(1===arguments.length)return Qe(this,J,We=nt);if(2===arguments.length){We=Ot;var Wt=this._nodes.get(nt=""+nt);if(void 0===Wt)throw new ne("Graph.".concat(Fe,': could not find the "').concat(nt,'" node in the graph.'));return kn(this.multi,"mixed"===J?this.type:J,we,Wt,We)}if(3===arguments.length){Ot=""+Ot;var xt=this._nodes.get(nt=""+nt);if(!xt)throw new ne("Graph.".concat(Fe,': could not find the "').concat(nt,'" source node in the graph.'));if(!this._nodes.has(Ot))throw new ne("Graph.".concat(Fe,': could not find the "').concat(Ot,'" target node in the graph.'));return Xr(J,this.multi,we,xt,Ot,We)}throw new me("Graph.".concat(Fe,": too many arguments (expecting 1, 2 or 3 and got ").concat(arguments.length,")."))}}}(ie,fe),function(re,M){var k=M.name,J=M.type,we=M.direction,Fe="forEach"+k[0].toUpperCase()+k.slice(1,-1)+"Until";re.prototype[Fe]=function(nt,Ot,We){if("mixed"===J||"mixed"===this.type||J===this.type){if(1===arguments.length)return St(this,J,We=nt);if(2===arguments.length){We=Ot;var Wt=this._nodes.get(nt=""+nt);if(void 0===Wt)throw new ne("Graph.".concat(Fe,': could not find the "').concat(nt,'" node in the graph.'));return Yn(this.multi,"mixed"===J?this.type:J,we,Wt,We)}if(3===arguments.length){Ot=""+Ot;var xt=this._nodes.get(nt=""+nt);if(!xt)throw new ne("Graph.".concat(Fe,': could not find the "').concat(nt,'" source node in the graph.'));if(!this._nodes.has(Ot))throw new ne("Graph.".concat(Fe,': could not find the "').concat(Ot,'" target node in the graph.'));return Ls(J,this.multi,we,xt,Ot,We)}throw new me("Graph.".concat(Fe,": too many arguments (expecting 1, 2 or 3 and got ").concat(arguments.length,")."))}}}(ie,fe),function(re,M){var J=M.type,we=M.direction,Fe=M.name.slice(0,-1)+"Entries";re.prototype[Fe]=function(nt,Ot){if("mixed"!==J&&"mixed"!==this.type&&J!==this.type)return se.empty();if(!arguments.length)return Nt(this,J);if(1===arguments.length){var We=this._nodes.get(nt=""+nt);if(!We)throw new ne("Graph.".concat(Fe,': could not find the "').concat(nt,'" node in the graph.'));return Ti(J,we,We)}if(2===arguments.length){Ot=""+Ot;var Wt=this._nodes.get(nt=""+nt);if(!Wt)throw new ne("Graph.".concat(Fe,': could not find the "').concat(nt,'" source node in the graph.'));if(!this._nodes.has(Ot))throw new ne("Graph.".concat(Fe,': could not find the "').concat(Ot,'" target node in the graph.'));return gs(J,we,Wt,Ot)}throw new me("Graph.".concat(Fe,": too many arguments (expecting 0, 1 or 2 and got ").concat(arguments.length,")."))}}(ie,fe)})}(Tn),function(ie){Bs.forEach(function(fe){var M,k,J,we;J=(M=fe).type,we=M.direction,ie.prototype[k=M.name]=function(Fe){if("mixed"!==J&&"mixed"!==this.type&&J!==this.type)return[];if(2===arguments.length){var nt=""+arguments[0],Ot=""+arguments[1];if(!this._nodes.has(nt))throw new ne("Graph.".concat(k,': could not find the "').concat(nt,'" node in the graph.'));if(!this._nodes.has(Ot))throw new ne("Graph.".concat(k,': could not find the "').concat(Ot,'" node in the graph.'));return lt(this,J,we,nt,Ot)}if(1===arguments.length){var We=this._nodes.get(Fe=""+Fe);if(void 0===We)throw new ne("Graph.".concat(k,': could not find the "').concat(Fe,'" node in the graph.'));return el("mixed"===J?this.type:J,we,We)}throw new me("Graph.".concat(k,": invalid number of arguments (expecting 1 or 2 and got ").concat(arguments.length,")."))},function(ie,fe){var re=fe.name,M=fe.type,k=fe.direction,J="forEach"+re[0].toUpperCase()+re.slice(1,-1);ie.prototype[J]=function(we,Fe){if("mixed"===M||"mixed"===this.type||M===this.type){var nt=this._nodes.get(we=""+we);if(void 0===nt)throw new ne("Graph.".concat(J,': could not find the "').concat(we,'" node in the graph.'));!function(Ot,We,Wt,xt){if("mixed"!==Ot){if("undirected"===Ot)return kl(Wt,Wt.undirected,xt);if("string"==typeof We)return kl(Wt,Wt[We],xt)}var vn=new Set;"undirected"!==Ot&&("out"!==We&&Sa(vn,Wt,Wt.in,xt),"in"!==We&&Sa(vn,Wt,Wt.out,xt)),"directed"!==Ot&&Sa(vn,Wt,Wt.undirected,xt)}("mixed"===M?this.type:M,k,nt,Fe)}}}(ie,fe),function(ie,fe){var re=fe.name,M=fe.type,k=fe.direction,J="forEach"+re[0].toUpperCase()+re.slice(1,-1)+"Until";ie.prototype[J]=function(we,Fe){if("mixed"===M||"mixed"===this.type||M===this.type){var nt=this._nodes.get(we=""+we);if(void 0===nt)throw new ne("Graph.".concat(J,': could not find the "').concat(we,'" node in the graph.'));!function(Ot,We,Wt,xt){if("mixed"!==Ot){if("undirected"===Ot)return Es(Wt,Wt.undirected,xt);if("string"==typeof We)return Es(Wt,Wt[We],xt)}var vn=new Set;"undirected"!==Ot&&("out"!==We&&Jt(vn,Wt,Wt.in,xt)||"in"!==We&&Jt(vn,Wt,Wt.out,xt))||"directed"===Ot||Jt(vn,Wt,Wt.undirected,xt)}("mixed"===M?this.type:M,k,nt,Fe)}}}(ie,fe),function(ie,fe){var M=fe.type,k=fe.direction,J=fe.name.slice(0,-1)+"Entries";ie.prototype[J]=function(we){if("mixed"!==M&&"mixed"!==this.type&&M!==this.type)return se.empty();var Fe=this._nodes.get(we=""+we);if(void 0===Fe)throw new ne("Graph.".concat(J,': could not find the "').concat(we,'" node in the graph.'));return function(nt,Ot,We){if("mixed"!==nt){if("undirected"===nt)return tl(We,We.undirected);if("string"==typeof Ot)return tl(We,We[Ot])}var Wt=se.empty(),xt=new Set;return"undirected"!==nt&&("out"!==Ot&&(Wt=Ke(Wt,rt(xt,We,We.in))),"in"!==Ot&&(Wt=Ke(Wt,rt(xt,We,We.out)))),"directed"!==nt&&(Wt=Ke(Wt,rt(xt,We,We.undirected))),Wt}("mixed"===M?this.type:M,k,Fe)}}(ie,fe)})}(Tn);var lr=function(ie){function fe(re){var M=he({type:"directed"},re);if("multi"in M&&!1!==M.multi)throw new me("DirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if("directed"!==M.type)throw new me('DirectedGraph.from: inconsistent "'+M.type+'" type in given options!');return ie.call(this,M)||this}return Je(fe,ie),fe}(Tn),cr=function(ie){function fe(re){var M=he({type:"undirected"},re);if("multi"in M&&!1!==M.multi)throw new me("UndirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if("undirected"!==M.type)throw new me('UndirectedGraph.from: inconsistent "'+M.type+'" type in given options!');return ie.call(this,M)||this}return Je(fe,ie),fe}(Tn),Xn=function(ie){function fe(re){var M=he({multi:!0},re);if("multi"in M&&!0!==M.multi)throw new me("MultiGraph.from: inconsistent indication that the graph should be simple in given options!");return ie.call(this,M)||this}return Je(fe,ie),fe}(Tn),$i=function(ie){function fe(re){var M=he({type:"directed",multi:!0},re);if("multi"in M&&!0!==M.multi)throw new me("MultiDirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if("directed"!==M.type)throw new me('MultiDirectedGraph.from: inconsistent "'+M.type+'" type in given options!');return ie.call(this,M)||this}return Je(fe,ie),fe}(Tn),xa=function(ie){function fe(re){var M=he({type:"undirected",multi:!0},re);if("multi"in M&&!0!==M.multi)throw new me("MultiUndirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if("undirected"!==M.type)throw new me('MultiUndirectedGraph.from: inconsistent "'+M.type+'" type in given options!');return ie.call(this,M)||this}return Je(fe,ie),fe}(Tn);function Zr(ie){ie.from=function(fe,re){var M=he({},fe.options,re),k=new ie(M);return k.import(fe),k}}return Zr(Tn),Zr(lr),Zr(cr),Zr(Xn),Zr($i),Zr(xa),Tn.Graph=Tn,Tn.DirectedGraph=lr,Tn.UndirectedGraph=cr,Tn.MultiGraph=Xn,Tn.MultiDirectedGraph=$i,Tn.MultiUndirectedGraph=xa,Tn.InvalidArgumentsGraphError=me,Tn.NotFoundGraphError=ne,Tn.UsageGraphError=_e,Tn}()},524:(Ut,it,Je)=>{var yt;!function(ee,Tt,dt,Y){"use strict";var A,Se=["","webkit","Moz","MS","ms","o"],he=Tt.createElement("div"),j=Math.round,P=Math.abs,Q=Date.now;function z(ye,De,He){return setTimeout(T(ye,He),De)}function v(ye,De,He){return!!Array.isArray(ye)&&(x(ye,He[De],He),!0)}function x(ye,De,He){var bt;if(ye)if(ye.forEach)ye.forEach(De,He);else if(ye.length!==Y)for(bt=0;bt\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",li=ee.console&&(ee.console.warn||ee.console.log);return li&&li.call(ee.console,bt,Yt),ye.apply(this,arguments)}}A="function"!=typeof Object.assign?function(De){if(De===Y||null===De)throw new TypeError("Cannot convert undefined or null to object");for(var He=Object(De),bt=1;bt-1}function X(ye){return ye.trim().split(/\s+/g)}function E(ye,De,He){if(ye.indexOf&&!He)return ye.indexOf(De);for(var bt=0;btxs[De]}):bt.sort()),bt}function oe(ye,De){for(var He,bt,Gt=De[0].toUpperCase()+De.slice(1),Yt=0;Yt1&&!He.firstMultiple?He.firstMultiple=St(De):1===Gt&&(He.firstMultiple=!1);var Yt=He.firstInput,li=He.firstMultiple,Vr=li?li.center:Yt.center,es=De.center=Nt(bt);De.timeStamp=Q(),De.deltaTime=De.timeStamp-Yt.timeStamp,De.angle=Ti(Vr,es),De.distance=Yn(Vr,es),function(ye,De){var He=De.center,bt=ye.offsetDelta||{},Gt=ye.prevDelta||{},Yt=ye.prevInput||{};(1===De.eventType||4===Yt.eventType)&&(Gt=ye.prevDelta={x:Yt.deltaX||0,y:Yt.deltaY||0},bt=ye.offsetDelta={x:He.x,y:He.y}),De.deltaX=Gt.x+(He.x-bt.x),De.deltaY=Gt.y+(He.y-bt.y)}(He,De),De.offsetDirection=kn(De.deltaX,De.deltaY);var xs=On(De.deltaTime,De.deltaX,De.deltaY);De.overallVelocityX=xs.x,De.overallVelocityY=xs.y,De.overallVelocity=P(xs.x)>P(xs.y)?xs.x:xs.y,De.scale=li?function(ye,De){return Yn(De[0],De[1],pt)/Yn(ye[0],ye[1],pt)}(li.pointers,bt):1,De.rotation=li?function(ye,De){return Ti(De[1],De[0],pt)+Ti(ye[1],ye[0],pt)}(li.pointers,bt):0,De.maxPointers=He.prevInput?De.pointers.length>He.prevInput.maxPointers?De.pointers.length:He.prevInput.maxPointers:De.pointers.length,function(ye,De){var Gt,Yt,li,Vr,He=ye.lastInterval||De,bt=De.timeStamp-He.timeStamp;if(8!=De.eventType&&(bt>25||He.velocity===Y)){var es=De.deltaX-He.deltaX,xs=De.deltaY-He.deltaY,Qn=On(bt,es,xs);Yt=Qn.x,li=Qn.y,Gt=P(Qn.x)>P(Qn.y)?Qn.x:Qn.y,Vr=kn(es,xs),ye.lastInterval=De}else Gt=He.velocity,Yt=He.velocityX,li=He.velocityY,Vr=He.direction;De.velocity=Gt,De.velocityX=Yt,De.velocityY=li,De.direction=Vr}(He,De);var Qn=ye.element;D(De.srcEvent.target,Qn)&&(Qn=De.srcEvent.target),De.target=Qn}(ye,He),ye.emit("hammer.input",He),ye.recognize(He),ye.session.prevInput=He}function St(ye){for(var De=[],He=0;He=P(De)?ye<0?2:4:De<0?8:16}function Yn(ye,De,He){He||(He=_t);var bt=De[He[0]]-ye[He[0]],Gt=De[He[1]]-ye[He[1]];return Math.sqrt(bt*bt+Gt*Gt)}function Ti(ye,De,He){return He||(He=_t),180*Math.atan2(De[He[1]]-ye[He[1]],De[He[0]]-ye[He[0]])/Math.PI}ve.prototype={handler:function(){},init:function(){this.evEl&&K(this.element,this.evEl,this.domHandler),this.evTarget&&K(this.target,this.evTarget,this.domHandler),this.evWin&&K(Ce(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&ce(this.element,this.evEl,this.domHandler),this.evTarget&&ce(this.target,this.evTarget,this.domHandler),this.evWin&&ce(Ce(this.element),this.evWin,this.domHandler)}};var Ls={mousedown:1,mousemove:2,mouseup:4},gs="mousedown",Bs="mousemove mouseup";function Qr(){this.evEl=gs,this.evWin=Bs,this.pressed=!1,ve.apply(this,arguments)}S(Qr,ve,{handler:function(De){var He=Ls[De.type];1&He&&0===De.button&&(this.pressed=!0),2&He&&1!==De.which&&(He=4),this.pressed&&(4&He&&(this.pressed=!1),this.callback(this.manager,He,{pointers:[De],changedPointers:[De],pointerType:Xe,srcEvent:De}))}});var el={pointerdown:1,pointermove:2,pointerup:4,pointercancel:8,pointerout:8},kl={2:Ge,3:"pen",4:Xe,5:"kinect"},Sa="pointerdown",Es="pointermove pointerup pointercancel";function Jt(){this.evEl=Sa,this.evWin=Es,ve.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}ee.MSPointerEvent&&!ee.PointerEvent&&(Sa="MSPointerDown",Es="MSPointerMove MSPointerUp MSPointerCancel"),S(Jt,ve,{handler:function(De){var He=this.store,bt=!1,Gt=De.type.toLowerCase().replace("ms",""),Yt=el[Gt],li=kl[De.pointerType]||De.pointerType,Vr=li==Ge,es=E(He,De.pointerId,"pointerId");1&Yt&&(0===De.button||Vr)?es<0&&(He.push(De),es=He.length-1):12&Yt&&(bt=!0),!(es<0)&&(He[es]=De,this.callback(this.manager,Yt,{pointers:He,changedPointers:[De],pointerType:li,srcEvent:De}),bt&&He.splice(es,1))}});var tl={touchstart:1,touchmove:2,touchend:4,touchcancel:8},rt="touchstart",lt="touchstart touchmove touchend touchcancel";function ht(){this.evTarget=rt,this.evWin=lt,this.started=!1,ve.apply(this,arguments)}function ge(ye,De){var He=$(ye.touches),bt=$(ye.changedTouches);return 12&De&&(He=Z(He.concat(bt),"identifier",!0)),[He,bt]}S(ht,ve,{handler:function(De){var He=tl[De.type];if(1===He&&(this.started=!0),this.started){var bt=ge.call(this,De,He);12&He&&bt[0].length-bt[1].length==0&&(this.started=!1),this.callback(this.manager,He,{pointers:bt[0],changedPointers:bt[1],pointerType:Ge,srcEvent:De})}}});var be={touchstart:1,touchmove:2,touchend:4,touchcancel:8},Le="touchstart touchmove touchend touchcancel";function ut(){this.evTarget=Le,this.targetIds={},ve.apply(this,arguments)}function Ze(ye,De){var He=$(ye.touches),bt=this.targetIds;if(3&De&&1===He.length)return bt[He[0].identifier]=!0,[He,He];var Gt,Yt,li=$(ye.changedTouches),Vr=[],es=this.target;if(Yt=He.filter(function(xs){return D(xs.target,es)}),1===De)for(Gt=0;Gt-1&&bt.splice(Yt,1)},2500)}}function ai(ye){for(var De=ye.srcEvent.clientX,He=ye.srcEvent.clientY,bt=0;bt-1&&this.requireFail.splice(De,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(ye){return!!this.simultaneous[ye.id]},emit:function(ye){var De=this,He=this.state;function bt(Gt){De.manager.emit(Gt,ye)}He<8&&bt(De.options.event+We(He)),bt(De.options.event),ye.additionalEvent&&bt(ye.additionalEvent),He>=8&&bt(De.options.event+We(He))},tryEmit:function(ye){if(this.canEmit())return this.emit(ye);this.state=32},canEmit:function(){for(var ye=0;yeDe.threshold&&Gt&De.direction},attrTest:function(ye){return vn.prototype.attrTest.call(this,ye)&&(2&this.state||!(2&this.state)&&this.directionTest(ye))},emit:function(ye){this.pX=ye.deltaX,this.pY=ye.deltaY;var De=Wt(ye.direction);De&&(ye.additionalEvent=this.options.event+De),this._super.emit.call(this,ye)}}),S(Jr,vn,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[cr]},attrTest:function(ye){return this._super.attrTest.call(this,ye)&&(Math.abs(ye.scale-1)>this.options.threshold||2&this.state)},emit:function(ye){1!==ye.scale&&(ye.additionalEvent=this.options.event+(ye.scale<1?"in":"out")),this._super.emit.call(this,ye)}}),S(Qs,Ot,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return["auto"]},process:function(ye){var De=this.options,He=ye.pointers.length===De.pointers,bt=ye.distanceDe.time;if(this._input=ye,!bt||!He||12&ye.eventType&&!Gt)this.reset();else if(1&ye.eventType)this.reset(),this._timer=z(function(){this.state=8,this.tryEmit()},De.time,this);else if(4&ye.eventType)return 8;return 32},reset:function(){clearTimeout(this._timer)},emit:function(ye){8===this.state&&(ye&&4&ye.eventType?this.manager.emit(this.options.event+"up",ye):(this._input.timeStamp=Q(),this.manager.emit(this.options.event,this._input)))}}),S(Ll,vn,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[cr]},attrTest:function(ye){return this._super.attrTest.call(this,ye)&&(Math.abs(ye.rotation)>this.options.threshold||2&this.state)}}),S(po,vn,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:30,pointers:1},getTouchAction:function(){return Ss.prototype.getTouchAction.call(this)},attrTest:function(ye){var He,De=this.options.direction;return 30&De?He=ye.overallVelocity:6&De?He=ye.overallVelocityX:24&De&&(He=ye.overallVelocityY),this._super.attrTest.call(this,ye)&&De&ye.offsetDirection&&ye.distance>this.options.threshold&&ye.maxPointers==this.options.pointers&&P(He)>this.options.velocity&&4&ye.eventType},emit:function(ye){var De=Wt(ye.offsetDirection);De&&this.manager.emit(this.options.event+De,ye),this.manager.emit(this.options.event,ye)}}),S(jr,Ot,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[lr]},process:function(ye){var De=this.options,He=ye.pointers.length===De.pointers,bt=ye.distance"']/g,Es=RegExp(kl.source),Jt=RegExp(Sa.source),tl=/<%-([\s\S]+?)%>/g,rt=/<%([\s\S]+?)%>/g,lt=/<%=([\s\S]+?)%>/g,ht=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ge=/^\w*$/,be=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Le=/[\\^$.*+?()[\]{}|]/g,ut=RegExp(Le.source),Ze=/^\s+/,At=/\s/,Mt=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Dt=/\{\n\/\* \[wrapped with (.+)\] \*/,Xt=/,? & /,zn=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ai=/[()=,{}\[\]\/\s]/,Nn=/\\(\\)?/g,bn=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,$n=/\w*$/,Tn=/^[-+]0x[0-9a-f]+$/i,lr=/^0b[01]+$/i,cr=/^\[object .+?Constructor\]$/,Xn=/^0o[0-7]+$/i,$i=/^(?:0|[1-9]\d*)$/,xa=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Zr=/($^)/,ie=/['\n\r\u2028\u2029\\]/g,fe="\\ud800-\\udfff",J="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",we="\\u2700-\\u27bf",Fe="a-z\\xdf-\\xf6\\xf8-\\xff",xt="A-Z\\xc0-\\xd6\\xd8-\\xde",vn="\\ufe0e\\ufe0f",Ss="\\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",Qs="["+fe+"]",Ll="["+Ss+"]",po="["+J+"]",jr="\\d+",js="["+we+"]",xc="["+Fe+"]",Sn="[^"+fe+Ss+jr+we+Fe+xt+"]",go="\\ud83c[\\udffb-\\udfff]",Ca="[^"+fe+"]",wd="(?:\\ud83c[\\udde6-\\uddff]){2}",ye="[\\ud800-\\udbff][\\udc00-\\udfff]",De="["+xt+"]",bt="(?:"+xc+"|"+Sn+")",Gt="(?:"+De+"|"+Sn+")",Yt="(?:['\u2019](?:d|ll|m|re|s|t|ve))?",li="(?:['\u2019](?:D|LL|M|RE|S|T|VE))?",Vr="(?:"+po+"|"+go+")?",es="["+vn+"]?",A1=es+Vr+"(?:\\u200d(?:"+[Ca,wd,ye].join("|")+")"+es+Vr+")*",Ed="(?:"+[js,wd,ye].join("|")+")"+A1,tr="(?:"+[Ca+po+"?",po,wd,ye,Qs].join("|")+")",fp=RegExp("['\u2019]","g"),Jm=RegExp(po,"g"),Dh=RegExp(go+"(?="+go+")|"+tr+A1,"g"),sv=RegExp([De+"?"+xc+"+"+Yt+"(?="+[Ll,De,"$"].join("|")+")",Gt+"+"+li+"(?="+[Ll,De+bt,"$"].join("|")+")",De+"?"+bt+"+"+Yt,De+"+"+li,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",jr,Ed].join("|"),"g"),T1=RegExp("[\\u200d"+fe+J+vn+"]"),jl=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Ih=["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"],M1=-1,ln={};ln[Nt]=ln[On]=ln[kn]=ln[Yn]=ln[Ti]=ln[wi]=ln[Xr]=ln[Ls]=ln[gs]=!0,ln[Xe]=ln[tt]=ln[Qe]=ln[Ue]=ln[St]=ln[ke]=ln[Me]=ln[Ve]=ln[Ne]=ln[q]=ln[pe]=ln[_t]=ln[pt]=ln[ve]=ln[B]=!1;var ur={};ur[Xe]=ur[tt]=ur[Qe]=ur[St]=ur[Ue]=ur[ke]=ur[Nt]=ur[On]=ur[kn]=ur[Yn]=ur[Ti]=ur[Ne]=ur[q]=ur[pe]=ur[_t]=ur[pt]=ur[ve]=ur[L]=ur[wi]=ur[Xr]=ur[Ls]=ur[gs]=!0,ur[Me]=ur[Ve]=ur[B]=!1;var on={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},D1=parseFloat,cv=parseInt,Rt="object"==typeof global&&global&&global.Object===Object&&global,Vs="object"==typeof self&&self&&self.Object===Object&&self,Vi=Rt||Vs||Function("return this")(),Vl=it&&!it.nodeType&&it,Aa=Vl&&Ut&&!Ut.nodeType&&Ut,Oo=Aa&&Aa.exports===Vl,e_=Oo&&Rt.process,Sr=function(){try{return Aa&&Aa.require&&Aa.require("util").types||e_&&e_.binding&&e_.binding("util")}catch(It){}}(),nn=Sr&&Sr.isArrayBuffer,hi=Sr&&Sr.isDate,pr=Sr&&Sr.isMap,mo=Sr&&Sr.isRegExp,Cc=Sr&&Sr.isSet,as=Sr&&Sr.isTypedArray;function ls(at,It,Et){switch(Et.length){case 0:return at.call(It);case 1:return at.call(It,Et[0]);case 2:return at.call(It,Et[0],Et[1]);case 3:return at.call(It,Et[0],Et[1],Et[2])}return at.apply(It,Et)}function Ur(at,It,Et,hn){for(var Dn=-1,Li=null==at?0:at.length;++Dn-1}function Oh(at,It,Et){for(var hn=-1,Dn=null==at?0:at.length;++hn-1;);return Et}function N1(at,It){for(var Et=at.length;Et--&&nl(It,at[Et],0)>-1;);return Et}function c2(at,It){for(var Et=at.length,hn=0;Et--;)at[Et]===It&&++hn;return hn}var u2=Qo({\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"}),d2=Qo({"&":"&","<":"<",">":">",'"':""","'":"'"});function h2(at){return"\\"+on[at]}function Ph(at){return T1.test(at)}function dv(at){var It=-1,Et=Array(at.size);return at.forEach(function(hn,Dn){Et[++It]=[Dn,hn]}),Et}function P1(at,It){return function(Et){return at(It(Et))}}function yu(at,It){for(var Et=-1,hn=at.length,Dn=0,Li=[];++Et",""":'"',"'":"'"}),kh=function at(It){var d,Et=(It=null==It?Vi:kh.defaults(Vi.Object(),It,kh.pick(Vi,Ih))).Array,hn=It.Date,Dn=It.Error,Li=It.Function,ts=It.Math,Ki=It.Object,a_=It.RegExp,l_=It.String,Da=It.TypeError,gr=Et.prototype,bu=Ki.prototype,gp=It["__core-js_shared__"],xr=Li.prototype.toString,Xi=bu.hasOwnProperty,y2=0,Lh=(d=/[^.]+$/.exec(gp&&gp.keys&&gp.keys.IE_PROTO||""))?"Symbol(src)_1."+d:"",Zs=bu.toString,L1=xr.call(Ki),c_=Vi._,Md=a_("^"+xr.call(Xi).replace(Le,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),zs=Oo?It.Buffer:ee,zl=It.Symbol,Dd=It.Uint8Array,pv=zs?zs.allocUnsafe:ee,Ia=P1(Ki.getPrototypeOf,Ki),u_=Ki.create,mp=bu.propertyIsEnumerable,Bn=gr.splice,B1=zl?zl.isConcatSpreadable:ee,Bh=zl?zl.iterator:ee,vu=zl?zl.toStringTag:ee,_p=function(){try{var d=Lc(Ki,"defineProperty");return d({},"",{}),d}catch(f){}}(),gv=It.clearTimeout!==Vi.clearTimeout&&It.clearTimeout,j1=hn&&hn.now!==Vi.Date.now&&hn.now,V1=It.setTimeout!==Vi.setTimeout&&It.setTimeout,jt=ts.ceil,Ei=ts.floor,Cr=Ki.getOwnPropertySymbols,cs=zs?zs.isBuffer:ee,d_=It.isFinite,jh=gr.join,rl=P1(Ki.keys,Ki),Hr=ts.max,ms=ts.min,b2=hn.now,U1=It.parseInt,Vh=ts.random,yp=gr.reverse,As=Lc(It,"DataView"),_o=Lc(It,"Map"),bp=Lc(It,"Promise"),Oa=Lc(It,"Set"),No=Lc(It,"WeakMap"),Uh=Lc(Ki,"create"),zh=No&&new No,Id={},z1=Ru(As),h_=Ru(_o),f_=Ru(bp),mv=Ru(Oa),p_=Ru(No),vp=zl?zl.prototype:ee,Od=vp?vp.valueOf:ee,Hh=vp?vp.toString:ee;function Ee(d){if(Mr(d)&&!Rn(d)&&!(d instanceof fi)){if(d instanceof Po)return d;if(Xi.call(d,"__wrapped__"))return nf(d)}return new Po(d)}var wu=function(){function d(){}return function(f){if(!Tr(f))return{};if(u_)return u_(f);d.prototype=f;var _=new d;return d.prototype=ee,_}}();function Gh(){}function Po(d,f){this.__wrapped__=d,this.__actions__=[],this.__chain__=!!f,this.__index__=0,this.__values__=ee}function fi(d){this.__wrapped__=d,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=_e,this.__views__=[]}function yo(d){var f=-1,_=null==d?0:d.length;for(this.clear();++f<_;){var F=d[f];this.set(F[0],F[1])}}function Hl(d){var f=-1,_=null==d?0:d.length;for(this.clear();++f<_;){var F=d[f];this.set(F[0],F[1])}}function sl(d){var f=-1,_=null==d?0:d.length;for(this.clear();++f<_;){var F=d[f];this.set(F[0],F[1])}}function Ra(d){var f=-1,_=null==d?0:d.length;for(this.__data__=new sl;++f<_;)this.add(d[f])}function Na(d){var f=this.__data__=new Hl(d);this.size=f.size}function Wh(d,f){var _=Rn(d),F=!_&&pl(d),ae=!_&&!F&&gl(d),Te=!_&&!F&&!ae&&cf(d),ze=_||F||ae||Te,qe=ze?Td(d.length,l_):[],ct=qe.length;for(var kt in d)(f||Xi.call(d,kt))&&(!ze||!("length"==kt||ae&&("offset"==kt||"parent"==kt)||Te&&("buffer"==kt||"byteLength"==kt||"byteOffset"==kt)||Bo(kt,ct)))&&qe.push(kt);return qe}function y_(d){var f=d.length;return f?d[Gl(0,f-1)]:ee}function vv(d,f){return Wd(eo(d),Eu(f,0,d.length))}function Rd(d){return Wd(eo(d))}function b_(d,f,_){(_!==ee&&!In(d[f],_)||_===ee&&!(f in d))&&al(d,f,_)}function ol(d,f,_){var F=d[f];(!Xi.call(d,f)||!In(F,_)||_===ee&&!(f in d))&&al(d,f,_)}function Nd(d,f){for(var _=d.length;_--;)if(In(d[_][0],f))return _;return-1}function Cp(d,f,_,F){return Ic(d,function(ae,Te,ze){f(F,ae,_(ae),ze)}),F}function Z1(d,f){return d&&Fa(f,Os(f),d)}function al(d,f,_){"__proto__"==f&&_p?_p(d,f,{configurable:!0,enumerable:!0,value:_,writable:!0}):d[f]=_}function v_(d,f){for(var _=-1,F=f.length,ae=Et(F),Te=null==d;++_=f?d:f)),d}function Hs(d,f,_,F,ae,Te){var ze,qe=1&f,ct=2&f,kt=4&f;if(_&&(ze=ae?_(d,F,ae,Te):_(d)),ze!==ee)return ze;if(!Tr(d))return d;var Lt=Rn(d);if(Lt){if(ze=function(d){var f=d.length,_=new d.constructor(f);return f&&"string"==typeof d[0]&&Xi.call(d,"index")&&(_.index=d.index,_.input=d.input),_}(d),!qe)return eo(d,ze)}else{var zt=$s(d),en=zt==Ve||zt==$e;if(gl(d))return Np(d,qe);if(zt==pe||zt==Xe||en&&!ae){if(ze=ct||en?{}:Hv(d),!qe)return ct?function(d,f){return Fa(d,Vv(d),f)}(d,function(d,f){return d&&Fa(f,no(f),d)}(ze,d)):function(d,f){return Fa(d,k_(d),f)}(d,Z1(ze,d))}else{if(!ur[zt])return ae?d:{};ze=function(d,f,_){var F=d.constructor;switch(f){case Qe:return Mu(d);case Ue:case ke:return new F(+d);case St:return function(d,f){var _=f?Mu(d.buffer):d.buffer;return new d.constructor(_,d.byteOffset,d.byteLength)}(d,_);case Nt:case On:case kn:case Yn:case Ti:case wi:case Xr:case Ls:case gs:return O_(d,_);case Ne:return new F;case q:case ve:return new F(d);case _t:return function(d){var f=new d.constructor(d.source,$n.exec(d));return f.lastIndex=d.lastIndex,f}(d);case pt:return new F;case L:return function(d){return Od?Ki(Od.call(d)):{}}(d)}}(d,zt,qe)}}Te||(Te=new Na);var wn=Te.get(d);if(wn)return wn;Te.set(d,ze),yT(d)?d.forEach(function(jn){ze.add(Hs(jn,f,_,jn,d,Te))}):pT(d)&&d.forEach(function(jn,mi){ze.set(mi,Hs(jn,f,_,mi,d,Te))});var gi=Lt?ee:(kt?ct?P_:Yl:ct?no:Os)(d);return Us(gi||d,function(jn,mi){gi&&(jn=d[mi=jn]),ol(ze,mi,Hs(jn,f,_,mi,d,Te))}),ze}function Ap(d,f,_){var F=_.length;if(null==d)return!F;for(d=Ki(d);F--;){var ae=_[F],ze=d[ae];if(ze===ee&&!(ae in d)||!(0,f[ae])(ze))return!1}return!0}function qh(d,f,_){if("function"!=typeof d)throw new Da(Se);return ef(function(){d.apply(ee,_)},f)}function Dc(d,f,_,F){var ae=-1,Te=Ul,ze=!0,qe=d.length,ct=[],kt=f.length;if(!qe)return ct;_&&(f=Yi(f,Jo(_))),F?(Te=Oh,ze=!1):f.length>=200&&(Te=Nh,ze=!1,f=new Ra(f));e:for(;++ae-1},Hl.prototype.set=function(d,f){var _=this.__data__,F=Nd(_,d);return F<0?(++this.size,_.push([d,f])):_[F][1]=f,this},sl.prototype.clear=function(){this.size=0,this.__data__={hash:new yo,map:new(_o||Hl),string:new yo}},sl.prototype.delete=function(d){var f=Gs(this,d).delete(d);return this.size-=f?1:0,f},sl.prototype.get=function(d){return Gs(this,d).get(d)},sl.prototype.has=function(d){return Gs(this,d).has(d)},sl.prototype.set=function(d,f){var _=Gs(this,d),F=_.size;return _.set(d,f),this.size+=_.size==F?0:1,this},Ra.prototype.add=Ra.prototype.push=function(d){return this.__data__.set(d,W),this},Ra.prototype.has=function(d){return this.__data__.has(d)},Na.prototype.clear=function(){this.__data__=new Hl,this.size=0},Na.prototype.delete=function(d){var f=this.__data__,_=f.delete(d);return this.size=f.size,_},Na.prototype.get=function(d){return this.__data__.get(d)},Na.prototype.has=function(d){return this.__data__.has(d)},Na.prototype.set=function(d,f){var _=this.__data__;if(_ instanceof Hl){var F=_.__data__;if(!_o||F.length<199)return F.push([d,f]),this.size=++_.size,this;_=this.__data__=new sl(F)}return _.set(d,f),this.size=_.size,this};var Ic=ul(ll),E_=ul(Tp,!0);function Ev(d,f){var _=!0;return Ic(d,function(F,ae,Te){return _=!!f(F,ae,Te)}),_}function Yh(d,f,_){for(var F=-1,ae=d.length;++F0&&_(qe)?f>1?Ts(qe,f-1,_,F,ae):zr(ae,qe):F||(ae[ae.length]=qe)}return ae}var Pd=Ov(),Fd=Ov(!0);function ll(d,f){return d&&Pd(d,f,Os)}function Tp(d,f){return d&&Fd(d,f,Os)}function Kh(d,f){return Ta(f,function(_){return la(d[_])})}function ea(d,f){for(var _=0,F=(f=Pc(f,d)).length;null!=d&&_f}function kd(d,f){return null!=d&&Xi.call(d,f)}function Ld(d,f){return null!=d&&f in Ki(d)}function Su(d,f,_){for(var F=_?Oh:Ul,ae=d[0].length,Te=d.length,ze=Te,qe=Et(Te),ct=1/0,kt=[];ze--;){var Lt=d[ze];ze&&f&&(Lt=Yi(Lt,Jo(f))),ct=ms(Lt.length,ct),qe[ze]=!_&&(f||ae>=120&&Lt.length>=120)?new Ra(ze&&Lt):ee}Lt=d[0];var zt=-1,en=qe[0];e:for(;++zt=qe?ct:ct*("desc"==_[F]?-1:1)}return d.index-f.index}(Te,ze,_)});Et--;)at[Et]=at[Et].value;return at}(iA(d,function(Te,ze,qe){return{criteria:Yi(f,function(kt){return kt(Te)}),index:++F,value:Te}}))}function Tv(d,f,_){for(var F=-1,ae=f.length,Te={};++F-1;)qe!==d&&Bn.call(qe,ct,1),Bn.call(d,ct,1);return d}function Qh(d,f){for(var _=d?f.length:0,F=_-1;_--;){var ae=f[_];if(_==F||ae!==Te){var Te=ae;Bo(ae)?Bn.call(d,ae,1):Cu(d,ae)}}return d}function Gl(d,f){return d+Ei(Vh()*(f-d+1))}function Dp(d,f){var _="";if(!d||f<1||f>Ce)return _;do{f%2&&(_+=d),(f=Ei(f/2))&&(d+=d)}while(f);return _}function pi(d,f){return Hp(bA(d,f,io),d+"")}function sA(d){return y_(th(d))}function M2(d,f){var _=th(d);return Wd(_,Eu(f,0,_.length))}function Ip(d,f,_,F){if(!Tr(d))return d;for(var ae=-1,Te=(f=Pc(f,d)).length,ze=Te-1,qe=d;null!=qe&&++aeae?0:ae+f),(_=_>ae?ae:_)<0&&(_+=ae),ae=f>_?0:_-f>>>0,f>>>=0;for(var Te=Et(ae);++F>>1,ze=d[Te];null!==ze&&!ca(ze)&&(_?ze<=f:ze=200){var kt=f?null:N_(d);if(kt)return r_(kt);ze=!1,ae=Nh,ct=new Ra}else ct=f?[]:qe;e:for(;++F=F?d:Ds(d,f,_)}var lA=gv||function(d){return Vi.clearTimeout(d)};function Np(d,f){if(f)return d.slice();var _=d.length,F=pv?pv(_):new d.constructor(_);return d.copy(F),F}function Mu(d){var f=new d.constructor(d.byteLength);return new Dd(f).set(new Dd(d)),f}function O_(d,f){var _=f?Mu(d.buffer):d.buffer;return new d.constructor(_,d.byteOffset,d.length)}function Fc(d,f){if(d!==f){var _=d!==ee,F=null===d,ae=d==d,Te=ca(d),ze=f!==ee,qe=null===f,ct=f==f,kt=ca(f);if(!qe&&!kt&&!Te&&d>f||Te&&ze&&ct&&!qe&&!kt||F&&ze&&ct||!_&&ct||!ae)return 1;if(!F&&!Te&&!kt&&d1?_[ae-1]:ee,ze=ae>2?_[2]:ee;for(Te=d.length>3&&"function"==typeof Te?(ae--,Te):ee,ze&&Ws(_[0],_[1],ze)&&(Te=ae<3?ee:Te,ae=1),f=Ki(f);++F-1?ae[Te?f[ze]:ze]:ee}}function Iu(d){return dl(function(f){var _=f.length,F=_,ae=Po.prototype.thru;for(d&&f.reverse();F--;){var Te=f[F];if("function"!=typeof Te)throw new Da(Se);if(ae&&!ze&&"wrapper"==Vp(Te))var ze=new Po([],!0)}for(F=ze?F:_;++F<_;){var qe=Vp(Te=f[F]),ct="wrapper"==qe?F_(Te):ee;ze=ct&&Up(ct[0])&&424==ct[1]&&!ct[4].length&&1==ct[9]?ze[Vp(ct[0])].apply(ze,ct[3]):1==Te.length&&Up(Te)?ze[qe]():ze.thru(Te)}return function(){var kt=arguments,Lt=kt[0];if(ze&&1==kt.length&&Rn(Lt))return ze.plant(Lt).value();for(var zt=0,en=_?f[zt].apply(this,kt):Lt;++zt<_;)en=f[zt].call(this,en);return en}})}function kc(d,f,_,F,ae,Te,ze,qe,ct,kt){var Lt=f&K,zt=1&f,en=2&f,wn=24&f,Ln=512&f,gi=en?ee:Hd(d);return function jn(){for(var mi=arguments.length,Mi=Et(mi),wo=mi;wo--;)Mi[wo]=arguments[wo];if(wn)var qs=$d(jn),ua=c2(Mi,qs);if(F&&(Mi=Ud(Mi,F,ae,wn)),Te&&(Mi=Iv(Mi,Te,ze,wn)),mi-=ua,wn&&mi1&&Mi.reverse(),Lt&&ctqe))return!1;var kt=Te.get(d),Lt=Te.get(f);if(kt&&Lt)return kt==f&&Lt==d;var zt=-1,en=!0,wn=2&_?new Ra:ee;for(Te.set(d,f),Te.set(f,d);++zt-1&&d%1==0&&d1?"& ":"")+f[F],f=f.join(_>2?", ":" "),d.replace(Mt,"{\n/* [wrapped with "+f+"] */\n")}(F,function(d,f){return Us(st,function(_){var F="_."+_[0];f&_[1]&&!Ul(d,F)&&d.push(F)}),d.sort()}(function(d){var f=d.match(Dt);return f?f[1].split(Xt):[]}(F),_)))}function z_(d){var f=0,_=0;return function(){var F=b2(),ae=16-(F-_);if(_=F,ae>0){if(++f>=800)return arguments[0]}else f=0;return d.apply(ee,arguments)}}function Wd(d,f){var _=-1,F=d.length,ae=F-1;for(f=f===ee?F:f;++_1?d[f-1]:ee;return _="function"==typeof _?(d.pop(),_):ee,GA(d,_)});function Z_(d){var f=Ee(d);return f.__chain__=!0,f}function Yd(d,f){return f(d)}var J_=dl(function(d){var f=d.length,_=f?d[0]:0,F=this.__wrapped__,ae=function(Te){return v_(Te,d)};return!(f>1||this.__actions__.length)&&F instanceof fi&&Bo(_)?((F=F.slice(_,+_+(f?1:0))).__actions__.push({func:Yd,args:[ae],thisArg:ee}),new Po(F,this.__chain__).thru(function(Te){return f&&!Te.length&&Te.push(ee),Te})):this.thru(ae)}),qA=ns(function(d,f,_){Xi.call(d,_)?++d[_]:al(d,_,1)}),XA=Nv(G_),QA=Nv($_);function iy(d,f){return(Rn(d)?Us:Ic)(d,Fn(f,3))}function Wp(d,f){return(Rn(d)?Sd:E_)(d,Fn(f,3))}var JA=ns(function(d,f,_){Xi.call(d,_)?d[_].push(f):al(d,_,[f])}),dw=pi(function(d,f,_){var F=-1,ae="function"==typeof f,Te=bo(d)?Et(d.length):[];return Ic(d,function(ze){Te[++F]=ae?ls(f,ze,_):Pa(ze,f,_)}),Te}),hw=ns(function(d,f,_){al(d,_,f)});function fl(d,f){return(Rn(d)?Yi:iA)(d,Fn(f,3))}var pw=ns(function(d,f,_){d[_?0:1].push(f)},function(){return[[],[]]}),Yp=pi(function(d,f){if(null==d)return[];var _=f.length;return _>1&&Ws(d,f[0],f[1])?f=[]:_>2&&Ws(f[0],f[1],f[2])&&(f=[f[0]]),Xh(d,Ts(f,1),[])}),Nu=j1||function(){return Vi.Date.now()};function Kp(d,f,_){return f=_?ee:f,ql(d,K,ee,ee,ee,ee,f=d&&null==f?d.length:f)}function sy(d,f){var _;if("function"!=typeof f)throw new Da(Se);return d=Jn(d),function(){return--d>0&&(_=f.apply(this,arguments)),d<=1&&(f=ee),_}}var af=pi(function(d,f,_){var F=1;if(_.length){var ae=yu(_,$d(af));F|=V}return ql(d,F,f,_,ae)}),Xd=pi(function(d,f,_){var F=3;if(_.length){var ae=yu(_,$d(Xd));F|=V}return ql(f,F,d,_,ae)});function ww(d,f,_){var F,ae,Te,ze,qe,ct,kt=0,Lt=!1,zt=!1,en=!0;if("function"!=typeof d)throw new Da(Se);function wn(Hi){var yl=F,Uc=ae;return F=ae=ee,kt=Hi,ze=d.apply(Uc,yl)}function Ln(Hi){return kt=Hi,qe=ef(mi,f),Lt?wn(Hi):ze}function jn(Hi){var yl=Hi-ct;return ct===ee||yl>=f||yl<0||zt&&Hi-kt>=Te}function mi(){var Hi=Nu();if(jn(Hi))return Mi(Hi);qe=ef(mi,function(Hi){var lM=f-(Hi-ct);return zt?ms(lM,Te-(Hi-kt)):lM}(Hi))}function Mi(Hi){return qe=ee,en&&F?wn(Hi):(F=ae=ee,ze)}function ua(){var Hi=Nu(),yl=jn(Hi);if(F=arguments,ae=this,ct=Hi,yl){if(qe===ee)return Ln(ct);if(zt)return lA(qe),qe=ef(mi,f),wn(ct)}return qe===ee&&(qe=ef(mi,f)),ze}return f=vo(f)||0,Tr(_)&&(Lt=!!_.leading,Te=(zt="maxWait"in _)?Hr(vo(_.maxWait)||0,f):Te,en="trailing"in _?!!_.trailing:en),ua.cancel=function(){qe!==ee&&lA(qe),kt=0,F=ct=ae=qe=ee},ua.flush=function(){return qe===ee?ze:Mi(Nu())},ua}var iT=pi(function(d,f){return qh(d,1,f)}),Ew=pi(function(d,f,_){return qh(d,vo(f)||0,_)});function lf(d,f){if("function"!=typeof d||null!=f&&"function"!=typeof f)throw new Da(Se);var _=function(){var F=arguments,ae=f?f.apply(this,F):F[0],Te=_.cache;if(Te.has(ae))return Te.get(ae);var ze=d.apply(this,F);return _.cache=Te.set(ae,ze)||Te,ze};return _.cache=new(lf.Cache||sl),_}function ly(d){if("function"!=typeof d)throw new Da(Se);return function(){var f=arguments;switch(f.length){case 0:return!d.call(this);case 1:return!d.call(this,f[0]);case 2:return!d.call(this,f[0],f[1]);case 3:return!d.call(this,f[0],f[1],f[2])}return!d.apply(this,f)}}lf.Cache=sl;var rT=aA(function(d,f){var _=(f=1==f.length&&Rn(f[0])?Yi(f[0],Jo(Fn())):Yi(Ts(f,1),Jo(Fn()))).length;return pi(function(F){for(var ae=-1,Te=ms(F.length,_);++ae=f}),pl=J1(function(){return arguments}())?J1:function(d){return Mr(d)&&Xi.call(d,"callee")&&!mp.call(d,"callee")},Rn=Et.isArray,Mw=nn?Jo(nn):function(d){return Mr(d)&&Ms(d)==Qe};function bo(d){return null!=d&&uy(d.length)&&!la(d)}function Ar(d){return Mr(d)&&bo(d)}var gl=cs||Ny,Dw=hi?Jo(hi):function(d){return Mr(d)&&Ms(d)==ke};function La(d){if(!Mr(d))return!1;var f=Ms(d);return f==Me||"[object DOMException]"==f||"string"==typeof d.message&&"string"==typeof d.name&&!Jp(d)}function la(d){if(!Tr(d))return!1;var f=Ms(d);return f==Ve||f==$e||"[object AsyncFunction]"==f||"[object Proxy]"==f}function Zp(d){return"number"==typeof d&&d==Jn(d)}function uy(d){return"number"==typeof d&&d>-1&&d%1==0&&d<=Ce}function Tr(d){var f=typeof d;return null!=d&&("object"==f||"function"==f)}function Mr(d){return null!=d&&"object"==typeof d}var pT=pr?Jo(pr):function(d){return Mr(d)&&$s(d)==Ne};function _T(d){return"number"==typeof d||Mr(d)&&Ms(d)==q}function Jp(d){if(!Mr(d)||Ms(d)!=pe)return!1;var f=Ia(d);if(null===f)return!0;var _=Xi.call(f,"constructor")&&f.constructor;return"function"==typeof _&&_ instanceof _&&xr.call(_)==L1}var Nw=mo?Jo(mo):function(d){return Mr(d)&&Ms(d)==_t},yT=Cc?Jo(Cc):function(d){return Mr(d)&&$s(d)==pt};function hy(d){return"string"==typeof d||!Rn(d)&&Mr(d)&&Ms(d)==ve}function ca(d){return"symbol"==typeof d||Mr(d)&&Ms(d)==L}var cf=as?Jo(as):function(d){return Mr(d)&&uy(d.length)&&!!ln[Ms(d)]},Bc=Lp(Av),fy=Lp(function(d,f){return d<=f});function Pw(d){if(!d)return[];if(bo(d))return hy(d)?il(d):eo(d);if(Bh&&d[Bh])return function(at){for(var It,Et=[];!(It=at.next()).done;)Et.push(It.value);return Et}(d[Bh]());var f=$s(d);return(f==Ne?dv:f==pt?r_:th)(d)}function ml(d){return d?(d=vo(d))===te||d===-te?17976931348623157e292*(d<0?-1:1):d==d?d:0:0===d?d:0}function Jn(d){var f=ml(d),_=f%1;return f==f?_?f-_:f:0}function py(d){return d?Eu(Jn(d),0,_e):0}function vo(d){if("number"==typeof d)return d;if(ca(d))return NaN;if(Tr(d)){var f="function"==typeof d.valueOf?d.valueOf():d;d=Tr(f)?f+"":f}if("string"!=typeof d)return 0===d?d:+d;d=uv(d);var _=lr.test(d);return _||Xn.test(d)?cv(d.slice(2),_?2:8):Tn.test(d)?NaN:+d}function Fw(d){return Fa(d,no(d))}function zi(d){return null==d?"":Lo(d)}var bT=$l(function(d,f){if(zp(f)||bo(f))Fa(f,Os(f),d);else for(var _ in f)Xi.call(f,_)&&ol(d,_,f[_])}),vT=$l(function(d,f){Fa(f,no(f),d)}),Qd=$l(function(d,f,_,F){Fa(f,no(f),d,F)}),wT=$l(function(d,f,_,F){Fa(f,Os(f),d,F)}),kw=dl(v_),ST=pi(function(d,f){d=Ki(d);var _=-1,F=f.length,ae=F>2?f[2]:ee;for(ae&&Ws(f[0],f[1],ae)&&(F=1);++_1),Te}),Fa(d,P_(d),_),F&&(_=Hs(_,7,Bp));for(var ae=f.length;ae--;)Cu(_,f[ae]);return _}),MT=dl(function(d,f){return null==d?{}:function(d,f){return Tv(d,f,function(_,F){return eg(d,F)})}(d,f)});function Hw(d,f){if(null==d)return{};var _=Yi(P_(d),function(F){return[F]});return f=Fn(f),Tv(d,_,function(F,ae){return f(F,ae[0])})}var DT=Ou(Os),$w=Ou(no);function th(d){return null==d?[]:i_(d,Os(d))}var PT=Wl(function(d,f,_){return f=f.toLowerCase(),d+(_?yy(f):f)});function yy(d){return ig(zi(d).toLowerCase())}function by(d){return(d=zi(d))&&d.replace(xa,u2).replace(Jm,"")}var kT=Wl(function(d,f,_){return d+(_?"-":"")+f.toLowerCase()}),LT=Wl(function(d,f,_){return d+(_?" ":"")+f.toLowerCase()}),K2=Pp("toLowerCase"),zT=Wl(function(d,f,_){return d+(_?"_":"")+f.toLowerCase()}),Ey=Wl(function(d,f,_){return d+(_?" ":"")+ig(f)}),Qw=Wl(function(d,f,_){return d+(_?" ":"")+f.toUpperCase()}),ig=Pp("toUpperCase");function Ay(d,f,_){return d=zi(d),(f=_?ee:f)===ee?function(at){return jl.test(at)}(d)?function(at){return at.match(sv)||[]}(d):function(at){return at.match(zn)||[]}(d):d.match(f)||[]}var Ty=pi(function(d,f){try{return ls(d,ee,f)}catch(_){return La(_)?_:new Dn(_)}}),Zw=dl(function(d,f){return Us(f,function(_){_=ni(_),al(d,_,af(d[_],d))}),d});function My(d){return function(){return d}}var Q2=Iu(),Pu=Iu(!0);function io(d){return d}function Fu(d){return nA("function"==typeof d?d:Hs(d,1))}var Dy=pi(function(d,f){return function(_){return Pa(_,d,f)}}),Jw=pi(function(d,f){return function(_){return Pa(d,_,f)}});function Iy(d,f,_){var F=Os(f),ae=Kh(f,F);null==_&&(!Tr(f)||!ae.length&&F.length)&&(_=f,f=d,d=this,ae=Kh(f,Os(f)));var Te=!(Tr(_)&&"chain"in _&&!_.chain),ze=la(d);return Us(ae,function(qe){var ct=f[qe];d[qe]=ct,ze&&(d.prototype[qe]=function(){var kt=this.__chain__;if(Te||kt){var Lt=d(this.__wrapped__),zt=Lt.__actions__=eo(this.__actions__);return zt.push({func:ct,args:arguments,thisArg:d}),Lt.__chain__=kt,Lt}return ct.apply(d,zr([this.value()],arguments))})}),d}function Oy(){}var XT=Fp(Yi),QT=Fp(ti),tE=Fp(Ro);function ku(d){return ra(d)?t_(ni(d)):function(d){return function(f){return ea(f,d)}}(d)}var ZT=Fv(),JT=Fv(!0);function Vc(){return[]}function Ny(){return!1}var Wn=R_(function(d,f){return d+f},0),Py=Gd("ceil"),J2=R_(function(d,f){return d/f},1),Ql=Gd("floor"),sE=R_(function(d,f){return d*f},1),oE=Gd("round"),aE=R_(function(d,f){return d-f},0);return Ee.after=function(d,f){if("function"!=typeof f)throw new Da(Se);return d=Jn(d),function(){if(--d<1)return f.apply(this,arguments)}},Ee.ary=Kp,Ee.assign=bT,Ee.assignIn=vT,Ee.assignInWith=Qd,Ee.assignWith=wT,Ee.at=kw,Ee.before=sy,Ee.bind=af,Ee.bindAll=Zw,Ee.bindKey=Xd,Ee.castArray=function(){if(!arguments.length)return[];var d=arguments[0];return Rn(d)?d:[d]},Ee.chain=Z_,Ee.chunk=function(d,f,_){f=(_?Ws(d,f,_):f===ee)?1:Hr(Jn(f),0);var F=null==d?0:d.length;if(!F||f<1)return[];for(var ae=0,Te=0,ze=Et(jt(F/f));aeae?0:ae+_),(F=F===ee||F>ae?ae:Jn(F))<0&&(F+=ae),F=_>F?0:py(F);_>>0)?(d=zi(d))&&("string"==typeof f||null!=f&&!Nw(f))&&!(f=Lo(f))&&Ph(d)?cl(il(d),0,_):d.split(f,_):[]},Ee.spread=function(d,f){if("function"!=typeof d)throw new Da(Se);return f=null==f?0:Hr(Jn(f),0),pi(function(_){var F=_[f],ae=cl(_,0,f);return F&&zr(ae,F),ls(d,this,ae)})},Ee.tail=function(d){var f=null==d?0:d.length;return f?Ds(d,1,f):[]},Ee.take=function(d,f,_){return d&&d.length?Ds(d,0,(f=_||f===ee?1:Jn(f))<0?0:f):[]},Ee.takeRight=function(d,f,_){var F=null==d?0:d.length;return F?Ds(d,(f=F-(f=_||f===ee?1:Jn(f)))<0?0:f,F):[]},Ee.takeRightWhile=function(d,f){return d&&d.length?Au(d,Fn(f,3),!1,!0):[]},Ee.takeWhile=function(d,f){return d&&d.length?Au(d,Fn(f,3)):[]},Ee.tap=function(d,f){return f(d),d},Ee.throttle=function(d,f,_){var F=!0,ae=!0;if("function"!=typeof d)throw new Da(Se);return Tr(_)&&(F="leading"in _?!!_.leading:F,ae="trailing"in _?!!_.trailing:ae),ww(d,f,{leading:F,maxWait:f,trailing:ae})},Ee.thru=Yd,Ee.toArray=Pw,Ee.toPairs=DT,Ee.toPairsIn=$w,Ee.toPath=function(d){return Rn(d)?Yi(d,ni):ca(d)?[d]:eo(qv(zi(d)))},Ee.toPlainObject=Fw,Ee.transform=function(d,f,_){var F=Rn(d),ae=F||gl(d)||cf(d);if(f=Fn(f,4),null==_){var Te=d&&d.constructor;_=ae?F?new Te:[]:Tr(d)&&la(Te)?wu(Ia(d)):{}}return(ae?Us:ll)(d,function(ze,qe,ct){return f(_,ze,qe,ct)}),_},Ee.unary=function(d){return Kp(d,1)},Ee.union=iw,Ee.unionBy=UA,Ee.unionWith=zA,Ee.uniq=function(d){return d&&d.length?Rc(d):[]},Ee.uniqBy=function(d,f){return d&&d.length?Rc(d,Fn(f,2)):[]},Ee.uniqWith=function(d,f){return f="function"==typeof f?f:ee,d&&d.length?Rc(d,ee,f):[]},Ee.unset=function(d,f){return null==d||Cu(d,f)},Ee.unzip=rw,Ee.unzipWith=GA,Ee.update=function(d,f,_){return null==d?d:Op(d,f,I_(_))},Ee.updateWith=function(d,f,_,F){return F="function"==typeof F?F:ee,null==d?d:Op(d,f,I_(_),F)},Ee.values=th,Ee.valuesIn=function(d){return null==d?[]:i_(d,no(d))},Ee.without=sw,Ee.words=Ay,Ee.wrap=function(d,f){return Xp(I_(f),d)},Ee.xor=B2,Ee.xorBy=jo,Ee.xorWith=X_,Ee.zip=Q_,Ee.zipObject=function(d,f){return Rp(d||[],f||[],ol)},Ee.zipObjectDeep=function(d,f){return Rp(d||[],f||[],Ip)},Ee.zipWith=of,Ee.entries=DT,Ee.entriesIn=$w,Ee.extend=vT,Ee.extendWith=Qd,Iy(Ee,Ee),Ee.add=Wn,Ee.attempt=Ty,Ee.camelCase=PT,Ee.capitalize=yy,Ee.ceil=Py,Ee.clamp=function(d,f,_){return _===ee&&(_=f,f=ee),_!==ee&&(_=(_=vo(_))==_?_:0),f!==ee&&(f=(f=vo(f))==f?f:0),Eu(vo(d),f,_)},Ee.clone=function(d){return Hs(d,4)},Ee.cloneDeep=function(d){return Hs(d,5)},Ee.cloneDeepWith=function(d,f){return Hs(d,5,f="function"==typeof f?f:ee)},Ee.cloneWith=function(d,f){return Hs(d,4,f="function"==typeof f?f:ee)},Ee.conformsTo=function(d,f){return null==f||Ap(d,f,Os(f))},Ee.deburr=by,Ee.defaultTo=function(d,f){return null==d||d!=d?f:d},Ee.divide=J2,Ee.endsWith=function(d,f,_){d=zi(d),f=Lo(f);var F=d.length,ae=_=_===ee?F:Eu(Jn(_),0,F);return(_-=f.length)>=0&&d.slice(_,ae)==f},Ee.eq=In,Ee.escape=function(d){return(d=zi(d))&&Jt.test(d)?d.replace(Sa,d2):d},Ee.escapeRegExp=function(d){return(d=zi(d))&&ut.test(d)?d.replace(Le,"\\$&"):d},Ee.every=function(d,f,_){var F=Rn(d)?ti:Ev;return _&&Ws(d,f,_)&&(f=ee),F(d,Fn(f,3))},Ee.find=XA,Ee.findIndex=G_,Ee.findKey=function(d,f){return Rh(d,Fn(f,3),ll)},Ee.findLast=QA,Ee.findLastIndex=$_,Ee.findLastKey=function(d,f){return Rh(d,Fn(f,3),Tp)},Ee.floor=Ql,Ee.forEach=iy,Ee.forEachRight=Wp,Ee.forIn=function(d,f){return null==d?d:Pd(d,Fn(f,3),no)},Ee.forInRight=function(d,f){return null==d?d:Fd(d,Fn(f,3),no)},Ee.forOwn=function(d,f){return d&&ll(d,Fn(f,3))},Ee.forOwnRight=function(d,f){return d&&Tp(d,Fn(f,3))},Ee.get=hf,Ee.gt=Zt,Ee.gte=Tw,Ee.has=function(d,f){return null!=d&&zv(d,f,kd)},Ee.hasIn=eg,Ee.head=Kv,Ee.identity=io,Ee.includes=function(d,f,_,F){d=bo(d)?d:th(d),_=_&&!F?Jn(_):0;var ae=d.length;return _<0&&(_=Hr(ae+_,0)),hy(d)?_<=ae&&d.indexOf(f,_)>-1:!!ae&&nl(d,f,_)>-1},Ee.indexOf=function(d,f,_){var F=null==d?0:d.length;if(!F)return-1;var ae=null==_?0:Jn(_);return ae<0&&(ae=Hr(F+ae,0)),nl(d,f,ae)},Ee.inRange=function(d,f,_){return f=ml(f),_===ee?(_=f,f=0):_=ml(_),function(d,f,_){return d>=ms(f,_)&&d=-Ce&&d<=Ce},Ee.isSet=yT,Ee.isString=hy,Ee.isSymbol=ca,Ee.isTypedArray=cf,Ee.isUndefined=function(d){return d===ee},Ee.isWeakMap=function(d){return Mr(d)&&$s(d)==B},Ee.isWeakSet=function(d){return Mr(d)&&"[object WeakSet]"==Ms(d)},Ee.join=function(d,f){return null==d?"":jh.call(d,f)},Ee.kebabCase=kT,Ee.last=sa,Ee.lastIndexOf=function(d,f,_){var F=null==d?0:d.length;if(!F)return-1;var ae=F;return _!==ee&&(ae=(ae=Jn(_))<0?Hr(F+ae,0):ms(ae,F-1)),f==f?function(at,It,Et){for(var hn=Et+1;hn--;)if(at[hn]===It)return hn;return hn}(d,f,ae):Cd(d,Ac,ae,!0)},Ee.lowerCase=LT,Ee.lowerFirst=K2,Ee.lt=Bc,Ee.lte=fy,Ee.max=function(d){return d&&d.length?Yh(d,io,Fo):ee},Ee.maxBy=function(d,f){return d&&d.length?Yh(d,Fn(f,2),Fo):ee},Ee.mean=function(d){return Cs(d,io)},Ee.meanBy=function(d,f){return Cs(d,Fn(f,2))},Ee.min=function(d){return d&&d.length?Yh(d,io,Av):ee},Ee.minBy=function(d,f){return d&&d.length?Yh(d,Fn(f,2),Av):ee},Ee.stubArray=Vc,Ee.stubFalse=Ny,Ee.stubObject=function(){return{}},Ee.stubString=function(){return""},Ee.stubTrue=function(){return!0},Ee.multiply=sE,Ee.nth=function(d,f){return d&&d.length?xu(d,Jn(f)):ee},Ee.noConflict=function(){return Vi._===this&&(Vi._=c_),this},Ee.noop=Oy,Ee.now=Nu,Ee.pad=function(d,f,_){d=zi(d);var F=(f=Jn(f))?Fh(d):0;if(!f||F>=f)return d;var ae=(f-F)/2;return kp(Ei(ae),_)+d+kp(jt(ae),_)},Ee.padEnd=function(d,f,_){d=zi(d);var F=(f=Jn(f))?Fh(d):0;return f&&Ff){var F=d;d=f,f=F}if(_||d%1||f%1){var ae=Vh();return ms(d+ae*(f-d+D1("1e-"+((ae+"").length-1))),f)}return Gl(d,f)},Ee.reduce=function(d,f,_){var F=Rn(d)?_u:Zo,ae=arguments.length<3;return F(d,Fn(f,4),_,ae,Ic)},Ee.reduceRight=function(d,f,_){var F=Rn(d)?xd:Zo,ae=arguments.length<3;return F(d,Fn(f,4),_,ae,E_)},Ee.repeat=function(d,f,_){return f=(_?Ws(d,f,_):f===ee)?1:Jn(f),Dp(zi(d),f)},Ee.replace=function(){var d=arguments,f=zi(d[0]);return d.length<3?f:f.replace(d[1],d[2])},Ee.result=function(d,f,_){var F=-1,ae=(f=Pc(f,d)).length;for(ae||(ae=1,d=ee);++FCe)return[];var _=_e,F=ms(d,_e);f=Fn(f),d-=_e;for(var ae=Td(F,f);++_=Te)return d;var qe=_-Fh(F);if(qe<1)return F;var ct=ze?cl(ze,0,qe).join(""):d.slice(0,qe);if(ae===ee)return ct+F;if(ze&&(qe+=ct.length-qe),Nw(ae)){if(d.slice(qe).search(ae)){var kt,Lt=ct;for(ae.global||(ae=a_(ae.source,zi($n.exec(ae))+"g")),ae.lastIndex=0;kt=ae.exec(Lt);)var zt=kt.index;ct=ct.slice(0,zt===ee?qe:zt)}}else if(d.indexOf(Lo(ae),qe)!=qe){var en=ct.lastIndexOf(ae);en>-1&&(ct=ct.slice(0,en))}return ct+F},Ee.unescape=function(d){return(d=zi(d))&&Es.test(d)?d.replace(kl,o_):d},Ee.uniqueId=function(d){var f=++y2;return zi(d)+f},Ee.upperCase=Qw,Ee.upperFirst=ig,Ee.each=iy,Ee.eachRight=Wp,Ee.first=Kv,Iy(Ee,function(){var d={};return ll(Ee,function(f,_){Xi.call(Ee.prototype,_)||(d[_]=f)}),d}(),{chain:!1}),Ee.VERSION="4.17.21",Us(["bind","bindKey","curry","curryRight","partial","partialRight"],function(d){Ee[d].placeholder=Ee}),Us(["drop","take"],function(d,f){fi.prototype[d]=function(_){_=_===ee?1:Hr(Jn(_),0);var F=this.__filtered__&&!f?new fi(this):this.clone();return F.__filtered__?F.__takeCount__=ms(_,F.__takeCount__):F.__views__.push({size:ms(_,_e),type:d+(F.__dir__<0?"Right":"")}),F},fi.prototype[d+"Right"]=function(_){return this.reverse()[d](_).reverse()}}),Us(["filter","map","takeWhile"],function(d,f){var _=f+1,F=1==_||3==_;fi.prototype[d]=function(ae){var Te=this.clone();return Te.__iteratees__.push({iteratee:Fn(ae,3),type:_}),Te.__filtered__=Te.__filtered__||F,Te}}),Us(["head","last"],function(d,f){var _="take"+(f?"Right":"");fi.prototype[d]=function(){return this[_](1).value()[0]}}),Us(["initial","tail"],function(d,f){var _="drop"+(f?"":"Right");fi.prototype[d]=function(){return this.__filtered__?new fi(this):this[_](1)}}),fi.prototype.compact=function(){return this.filter(io)},fi.prototype.find=function(d){return this.filter(d).head()},fi.prototype.findLast=function(d){return this.reverse().find(d)},fi.prototype.invokeMap=pi(function(d,f){return"function"==typeof d?new fi(this):this.map(function(_){return Pa(_,d,f)})}),fi.prototype.reject=function(d){return this.filter(ly(Fn(d)))},fi.prototype.slice=function(d,f){d=Jn(d);var _=this;return _.__filtered__&&(d>0||f<0)?new fi(_):(d<0?_=_.takeRight(-d):d&&(_=_.drop(d)),f!==ee&&(_=(f=Jn(f))<0?_.dropRight(-f):_.take(f-d)),_)},fi.prototype.takeRightWhile=function(d){return this.reverse().takeWhile(d).reverse()},fi.prototype.toArray=function(){return this.take(_e)},ll(fi.prototype,function(d,f){var _=/^(?:filter|find|map|reject)|While$/.test(f),F=/^(?:head|last)$/.test(f),ae=Ee[F?"take"+("last"==f?"Right":""):f],Te=F||/^find/.test(f);!ae||(Ee.prototype[f]=function(){var ze=this.__wrapped__,qe=F?[1]:arguments,ct=ze instanceof fi,kt=qe[0],Lt=ct||Rn(ze),zt=function(mi){var Mi=ae.apply(Ee,zr([mi],qe));return F&&en?Mi[0]:Mi};Lt&&_&&"function"==typeof kt&&1!=kt.length&&(ct=Lt=!1);var en=this.__chain__,wn=!!this.__actions__.length,Ln=Te&&!en,gi=ct&&!wn;if(!Te&&Lt){ze=gi?ze:new fi(this);var jn=d.apply(ze,qe);return jn.__actions__.push({func:Yd,args:[zt],thisArg:ee}),new Po(jn,en)}return Ln&&gi?d.apply(this,qe):(jn=this.thru(zt),Ln?F?jn.value()[0]:jn.value():jn)})}),Us(["pop","push","shift","sort","splice","unshift"],function(d){var f=gr[d],_=/^(?:push|sort|unshift)$/.test(d)?"tap":"thru",F=/^(?:pop|shift)$/.test(d);Ee.prototype[d]=function(){var ae=arguments;if(F&&!this.__chain__){var Te=this.value();return f.apply(Rn(Te)?Te:[],ae)}return this[_](function(ze){return f.apply(Rn(ze)?ze:[],ae)})}}),ll(fi.prototype,function(d,f){var _=Ee[f];if(_){var F=_.name+"";Xi.call(Id,F)||(Id[F]=[]),Id[F].push({name:f,func:_})}}),Id[kc(ee,2).name]=[{name:"wrapper",func:ee}],fi.prototype.clone=function(){var d=new fi(this.__wrapped__);return d.__actions__=eo(this.__actions__),d.__dir__=this.__dir__,d.__filtered__=this.__filtered__,d.__iteratees__=eo(this.__iteratees__),d.__takeCount__=this.__takeCount__,d.__views__=eo(this.__views__),d},fi.prototype.reverse=function(){if(this.__filtered__){var d=new fi(this);d.__dir__=-1,d.__filtered__=!0}else(d=this.clone()).__dir__*=-1;return d},fi.prototype.value=function(){var d=this.__wrapped__.value(),f=this.__dir__,_=Rn(d),F=f<0,ae=_?d.length:0,Te=function(d,f,_){for(var F=-1,ae=_.length;++F=this.__values__.length;return{done:d,value:d?ee:this.__values__[this.__index__++]}},Ee.prototype.plant=function(d){for(var f,_=this;_ instanceof Gh;){var F=nf(_);F.__index__=0,F.__values__=ee,f?ae.__wrapped__=F:f=F;var ae=F;_=_.__wrapped__}return ae.__wrapped__=d,f},Ee.prototype.reverse=function(){var d=this.__wrapped__;if(d instanceof fi){var f=d;return this.__actions__.length&&(f=new fi(this)),(f=f.reverse()).__actions__.push({func:Yd,args:[K_],thisArg:ee}),new Po(f,this.__chain__)}return this.thru(K_)},Ee.prototype.toJSON=Ee.prototype.valueOf=Ee.prototype.value=function(){return oA(this.__wrapped__,this.__actions__)},Ee.prototype.first=Ee.prototype.head,Bh&&(Ee.prototype[Bh]=function(){return this}),Ee}();Vi._=kh,(yt=function(){return kh}.call(it,Je,it,Ut))!==ee&&(Ut.exports=yt)}.call(this)},478:function(Ut){Ut.exports=function(){"use strict";function it(rt,lt){for(var ht=0;htrt.length)&&(lt=rt.length);for(var ht=0,ge=new Array(lt);ht=rt.length?{done:!0}:{done:!1,value:rt[ge++]}}}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 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}}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:Y,changeDefaults:function(rt){dt.exports.defaults=rt}};var he=/[&<>"']/,W=/[&<>"']/g,j=/[<>"']|&(?!#?\w+;)/,P=/[<>"']|&(?!#?\w+;)/g,Q={"&":"&","<":"<",">":">",'"':""","'":"'"},z=function(lt){return Q[lt]};var x=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function O(rt){return rt.replace(x,function(lt,ht){return"colon"===(ht=ht.toLowerCase())?":":"#"===ht.charAt(0)?"x"===ht.charAt(1)?String.fromCharCode(parseInt(ht.substring(2),16)):String.fromCharCode(+ht.substring(1)):""})}var A=/(^|[^\[])\^/g;var y=/[^\w:]/g,S=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;var V={},R=/^[^:]+:\/*[^/]*$/,K=/^([^:]+:)[\s\S]*$/,ce=/^([^:]+:\/*[^/]*)[\s\S]*$/;function D(rt,lt){V[" "+rt]||(V[" "+rt]=R.test(rt)?rt+"/":$(rt,"/",!0));var ht=-1===(rt=V[" "+rt]).indexOf(":");return"//"===lt.substring(0,2)?ht?lt:rt.replace(K,"$1")+lt:"/"===lt.charAt(0)?ht?lt:rt.replace(ce,"$1")+lt:rt+lt}function $(rt,lt,ht){var ge=rt.length;if(0===ge)return"";for(var be=0;be1;)1<&&(ht+=rt),lt>>=1,rt+=rt;return ht+rt},Ce=dt.exports.defaults,me=$,ne=function(rt,lt){var ge=rt.replace(/\|/g,function(Le,ut,Ze){for(var At=!1,Mt=ut;--Mt>=0&&"\\"===Ze[Mt];)At=!At;return At?"|":" |"}).split(/ \|/),be=0;if(ge.length>lt)ge.splice(lt);else for(;ge.length1?{type:"space",raw:be[0]}:{raw:"\n"}},lt.code=function(ge){var be=this.rules.block.code.exec(ge);if(be){var Le=be[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:be[0],codeBlockStyle:"indented",text:this.options.pedantic?Le:me(Le,"\n")}}},lt.fences=function(ge){var be=this.rules.block.fences.exec(ge);if(be){var Le=be[0],ut=function(rt,lt){var ht=rt.match(/^(\s+)(?:```)/);if(null===ht)return lt;var ge=ht[1];return lt.split("\n").map(function(be){var Le=be.match(/^\s+/);return null===Le?be:Le[0].length>=ge.length?be.slice(ge.length):be}).join("\n")}(Le,be[3]||"");return{type:"code",raw:Le,lang:be[2]?be[2].trim():be[2],text:ut}}},lt.heading=function(ge){var be=this.rules.block.heading.exec(ge);if(be){var Le=be[2].trim();if(/#$/.test(Le)){var ut=me(Le,"#");(this.options.pedantic||!ut||/ $/.test(ut))&&(Le=ut.trim())}return{type:"heading",raw:be[0],depth:be[1].length,text:Le}}},lt.nptable=function(ge){var be=this.rules.block.nptable.exec(ge);if(be){var Le={type:"table",header:ne(be[1].replace(/^ *| *\| *$/g,"")),align:be[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:be[3]?be[3].replace(/\n$/,"").split("\n"):[],raw:be[0]};if(Le.header.length===Le.align.length){var Ze,ut=Le.align.length;for(Ze=0;Ze ?/gm,"");return{type:"blockquote",raw:be[0],text:Le}}},lt.list=function(ge){var be=this.rules.block.list.exec(ge);if(be){var Xt,zn,ai,Nn,bn,$n,Tn,lr,cr,Le=be[0],ut=be[2],Ze=ut.length>1,At={type:"list",raw:Le,ordered:Ze,start:Ze?+ut.slice(0,-1):"",loose:!1,items:[]},Mt=be[0].match(this.rules.block.item),Dt=!1,Xn=Mt.length;ai=this.rules.block.listItemStart.exec(Mt[0]);for(var $i=0;$iai[1].length:Nn[1].length>=ai[0].length||Nn[1].length>3){Mt.splice($i,2,Mt[$i]+(!this.options.pedantic&&Nn[1].length/i.test(ut[0])&&(be=!1),!Le&&/^<(pre|code|kbd|script)(\s|>)/i.test(ut[0])?Le=!0:Le&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(ut[0])&&(Le=!1),{type:this.options.sanitize?"text":"html",raw:ut[0],inLink:be,inRawBlock:Le,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ut[0]):_e(ut[0]):ut[0]}},lt.link=function(ge){var be=this.rules.inline.link.exec(ge);if(be){var Le=be[2].trim();if(!this.options.pedantic&&/^$/.test(Le))return;var ut=me(Le.slice(0,-1),"\\");if((Le.length-ut.length)%2==0)return}else{var Ze=Ie(be[2],"()");if(Ze>-1){var Mt=(0===be[0].indexOf("!")?5:4)+be[1].length+Ze;be[2]=be[2].substring(0,Ze),be[0]=be[0].substring(0,Mt).trim(),be[3]=""}}var Dt=be[2],Xt="";if(this.options.pedantic){var zn=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Dt);zn&&(Dt=zn[1],Xt=zn[3])}else Xt=be[3]?be[3].slice(1,-1):"";return Dt=Dt.trim(),/^$/.test(Le)?Dt.slice(1):Dt.slice(1,-1)),Ge(be,{href:Dt&&Dt.replace(this.rules.inline._escapes,"$1"),title:Xt&&Xt.replace(this.rules.inline._escapes,"$1")},be[0])}},lt.reflink=function(ge,be){var Le;if((Le=this.rules.inline.reflink.exec(ge))||(Le=this.rules.inline.nolink.exec(ge))){var ut=(Le[2]||Le[1]).replace(/\s+/g," ");if(!(ut=be[ut.toLowerCase()])||!ut.href){var Ze=Le[0].charAt(0);return{type:"text",raw:Ze,text:Ze}}return Ge(Le,ut,Le[0])}},lt.emStrong=function(ge,be,Le){void 0===Le&&(Le="");var ut=this.rules.inline.emStrong.lDelim.exec(ge);if(ut&&(!ut[3]||!Le.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 Ze=ut[1]||ut[2]||"";if(!Ze||Ze&&(""===Le||this.rules.inline.punctuation.exec(Le))){var Mt,Dt,At=ut[0].length-1,Xt=At,zn=0,ai="*"===ut[0][0]?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(ai.lastIndex=0,be=be.slice(-1*ge.length+At);null!=(ut=ai.exec(be));)if(Mt=ut[1]||ut[2]||ut[3]||ut[4]||ut[5]||ut[6]){if(Dt=Mt.length,ut[3]||ut[4]){Xt+=Dt;continue}if((ut[5]||ut[6])&&At%3&&!((At+Dt)%3)){zn+=Dt;continue}if(!((Xt-=Dt)>0))return Dt=Math.min(Dt,Dt+Xt+zn),Math.min(At,Dt)%2?{type:"em",raw:ge.slice(0,At+ut.index+Dt+1),text:ge.slice(1,At+ut.index+Dt)}:{type:"strong",raw:ge.slice(0,At+ut.index+Dt+1),text:ge.slice(2,At+ut.index+Dt-1)}}}}},lt.codespan=function(ge){var be=this.rules.inline.code.exec(ge);if(be){var Le=be[2].replace(/\n/g," "),ut=/[^ ]/.test(Le),Ze=/^ /.test(Le)&&/ $/.test(Le);return ut&&Ze&&(Le=Le.substring(1,Le.length-1)),Le=_e(Le,!0),{type:"codespan",raw:be[0],text:Le}}},lt.br=function(ge){var be=this.rules.inline.br.exec(ge);if(be)return{type:"br",raw:be[0]}},lt.del=function(ge){var be=this.rules.inline.del.exec(ge);if(be)return{type:"del",raw:be[0],text:be[2]}},lt.autolink=function(ge,be){var ut,Ze,Le=this.rules.inline.autolink.exec(ge);if(Le)return Ze="@"===Le[2]?"mailto:"+(ut=_e(this.options.mangle?be(Le[1]):Le[1])):ut=_e(Le[1]),{type:"link",raw:Le[0],text:ut,href:Ze,tokens:[{type:"text",raw:ut,text:ut}]}},lt.url=function(ge,be){var Le;if(Le=this.rules.inline.url.exec(ge)){var ut,Ze;if("@"===Le[2])Ze="mailto:"+(ut=_e(this.options.mangle?be(Le[0]):Le[0]));else{var At;do{At=Le[0],Le[0]=this.rules.inline._backpedal.exec(Le[0])[0]}while(At!==Le[0]);ut=_e(Le[0]),Ze="www."===Le[1]?"http://"+ut:ut}return{type:"link",raw:Le[0],text:ut,href:Ze,tokens:[{type:"text",raw:ut,text:ut}]}}},lt.inlineText=function(ge,be,Le){var Ze,ut=this.rules.inline.text.exec(ge);if(ut)return Ze=be?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ut[0]):_e(ut[0]):ut[0]:_e(this.options.smartypants?Le(ut[0]):ut[0]),{type:"text",raw:ut[0],text:Ze}},rt}(),tt=te_noopTest,Ye=te_edit,Ue=te_merge,ke={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:tt,table:tt,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?'|\([^()]*\))/};ke.def=Ye(ke.def).replace("label",ke._label).replace("title",ke._title).getRegex(),ke.bullet=/(?:[*+-]|\d{1,9}[.)])/,ke.item=/^( *)(bull) ?[^\n]*(?:\n(?! *bull ?)[^\n]*)*/,ke.item=Ye(ke.item,"gm").replace(/bull/g,ke.bullet).getRegex(),ke.listItemStart=Ye(/^( *)(bull) */).replace("bull",ke.bullet).getRegex(),ke.list=Ye(ke.list).replace(/bull/g,ke.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+ke.def.source+")").getRegex(),ke._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",ke._comment=/|$)/,ke.html=Ye(ke.html,"i").replace("comment",ke._comment).replace("tag",ke._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ke.paragraph=Ye(ke._paragraph).replace("hr",ke.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",ke._tag).getRegex(),ke.blockquote=Ye(ke.blockquote).replace("paragraph",ke.paragraph).getRegex(),ke.normal=Ue({},ke),ke.gfm=Ue({},ke.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*|$)"}),ke.gfm.nptable=Ye(ke.gfm.nptable).replace("hr",ke.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",ke._tag).getRegex(),ke.gfm.table=Ye(ke.gfm.table).replace("hr",ke.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",ke._tag).getRegex(),ke.pedantic=Ue({},ke.normal,{html:Ye("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",ke._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:tt,paragraph:Ye(ke.normal._paragraph).replace("hr",ke.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",ke.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var Ke={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:tt,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:tt,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~"};Ke.punctuation=Ye(Ke.punctuation).replace(/punctuation/g,Ke._punctuation).getRegex(),Ke.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,Ke.escapedEmSt=/\\\*|\\_/g,Ke._comment=Ye(ke._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),Ke.emStrong.lDelim=Ye(Ke.emStrong.lDelim).replace(/punct/g,Ke._punctuation).getRegex(),Ke.emStrong.rDelimAst=Ye(Ke.emStrong.rDelimAst,"g").replace(/punct/g,Ke._punctuation).getRegex(),Ke.emStrong.rDelimUnd=Ye(Ke.emStrong.rDelimUnd,"g").replace(/punct/g,Ke._punctuation).getRegex(),Ke._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,Ke._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,Ke._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])?)+(?![-_])/,Ke.autolink=Ye(Ke.autolink).replace("scheme",Ke._scheme).replace("email",Ke._email).getRegex(),Ke._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,Ke.tag=Ye(Ke.tag).replace("comment",Ke._comment).replace("attribute",Ke._attribute).getRegex(),Ke._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Ke._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,Ke._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,Ke.link=Ye(Ke.link).replace("label",Ke._label).replace("href",Ke._href).replace("title",Ke._title).getRegex(),Ke.reflink=Ye(Ke.reflink).replace("label",Ke._label).getRegex(),Ke.reflinkSearch=Ye(Ke.reflinkSearch,"g").replace("reflink",Ke.reflink).replace("nolink",Ke.nolink).getRegex(),Ke.normal=Ue({},Ke),Ke.pedantic=Ue({},Ke.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",Ke._label).getRegex(),reflink:Ye(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Ke._label).getRegex()}),Ke.gfm=Ue({},Ke.normal,{escape:Ye(Ke.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&&(ge="x"+ge.toString(16)),lt+="&#"+ge+";";return lt}var je=function(){function rt(ht){this.tokens=[],this.tokens.links=Object.create(null),this.options=ht||$e,this.options.tokenizer=this.options.tokenizer||new Ve,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var ge={block:Ne.normal,inline:q.normal};this.options.pedantic?(ge.block=Ne.pedantic,ge.inline=q.pedantic):this.options.gfm&&(ge.block=Ne.gfm,ge.inline=this.options.breaks?q.breaks:q.gfm),this.tokenizer.rules=ge}rt.lex=function(ge,be){return new rt(be).lex(ge)},rt.lexInline=function(ge,be){return new rt(be).inlineTokens(ge)};var lt=rt.prototype;return lt.lex=function(ge){return ge=ge.replace(/\r\n|\r/g,"\n").replace(/\t/g," "),this.blockTokens(ge,this.tokens,!0),this.inline(this.tokens),this.tokens},lt.blockTokens=function(ge,be,Le){var Ze,At,Mt,Dt,Xt,zn,ut=this;for(void 0===be&&(be=[]),void 0===Le&&(Le=!0),this.options.pedantic&&(ge=ge.replace(/^ +$/gm,""));ge;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(function(Nn){return!!(Ze=Nn.call(ut,ge,be))&&(ge=ge.substring(Ze.raw.length),be.push(Ze),!0)}))){if(Ze=this.tokenizer.space(ge)){ge=ge.substring(Ze.raw.length),Ze.type&&be.push(Ze);continue}if(Ze=this.tokenizer.code(ge)){ge=ge.substring(Ze.raw.length),(Dt=be[be.length-1])&&"paragraph"===Dt.type?(Dt.raw+="\n"+Ze.raw,Dt.text+="\n"+Ze.text):be.push(Ze);continue}if(Ze=this.tokenizer.fences(ge)){ge=ge.substring(Ze.raw.length),be.push(Ze);continue}if(Ze=this.tokenizer.heading(ge)){ge=ge.substring(Ze.raw.length),be.push(Ze);continue}if(Ze=this.tokenizer.nptable(ge)){ge=ge.substring(Ze.raw.length),be.push(Ze);continue}if(Ze=this.tokenizer.hr(ge)){ge=ge.substring(Ze.raw.length),be.push(Ze);continue}if(Ze=this.tokenizer.blockquote(ge)){ge=ge.substring(Ze.raw.length),Ze.tokens=this.blockTokens(Ze.text,[],Le),be.push(Ze);continue}if(Ze=this.tokenizer.list(ge)){for(ge=ge.substring(Ze.raw.length),Mt=Ze.items.length,At=0;At=0&&(Nn=Math.min(Nn,$n))}),Nn<1/0&&Nn>=0&&(Xt=ge.substring(0,Nn+1))}(),Le&&(Ze=this.tokenizer.paragraph(Xt))){Dt=be[be.length-1],zn&&"paragraph"===Dt.type?(Dt.raw+="\n"+Ze.raw,Dt.text+="\n"+Ze.text):be.push(Ze),zn=Xt.length!==ge.length,ge=ge.substring(Ze.raw.length);continue}if(Ze=this.tokenizer.text(ge)){ge=ge.substring(Ze.raw.length),(Dt=be[be.length-1])&&"text"===Dt.type?(Dt.raw+="\n"+Ze.raw,Dt.text+="\n"+Ze.text):be.push(Ze);continue}if(ge){var ai="Infinite loop on byte: "+ge.charCodeAt(0);if(this.options.silent){console.error(ai);break}throw new Error(ai)}}return be},lt.inline=function(ge){var be,Le,ut,Ze,At,Mt,Dt=ge.length;for(be=0;be0)for(;null!=(zn=this.tokenizer.rules.inline.reflinkSearch.exec(Xt));)bn.includes(zn[0].slice(zn[0].lastIndexOf("[")+1,-1))&&(Xt=Xt.slice(0,zn.index)+"["+G("a",zn[0].length-2)+"]"+Xt.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(zn=this.tokenizer.rules.inline.blockSkip.exec(Xt));)Xt=Xt.slice(0,zn.index)+"["+G("a",zn[0].length-2)+"]"+Xt.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(zn=this.tokenizer.rules.inline.escapedEmSt.exec(Xt));)Xt=Xt.slice(0,zn.index)+"++"+Xt.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;ge;)if(ai||(Nn=""),ai=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(function(Tn){return!!(At=Tn.call(Ze,ge,be))&&(ge=ge.substring(At.raw.length),be.push(At),!0)}))){if(At=this.tokenizer.escape(ge)){ge=ge.substring(At.raw.length),be.push(At);continue}if(At=this.tokenizer.tag(ge,Le,ut)){ge=ge.substring(At.raw.length),Le=At.inLink,ut=At.inRawBlock,(Mt=be[be.length-1])&&"text"===At.type&&"text"===Mt.type?(Mt.raw+=At.raw,Mt.text+=At.text):be.push(At);continue}if(At=this.tokenizer.link(ge)){ge=ge.substring(At.raw.length),"link"===At.type&&(At.tokens=this.inlineTokens(At.text,[],!0,ut)),be.push(At);continue}if(At=this.tokenizer.reflink(ge,this.tokens.links)){ge=ge.substring(At.raw.length),Mt=be[be.length-1],"link"===At.type?(At.tokens=this.inlineTokens(At.text,[],!0,ut),be.push(At)):Mt&&"text"===At.type&&"text"===Mt.type?(Mt.raw+=At.raw,Mt.text+=At.text):be.push(At);continue}if(At=this.tokenizer.emStrong(ge,Xt,Nn)){ge=ge.substring(At.raw.length),At.tokens=this.inlineTokens(At.text,[],Le,ut),be.push(At);continue}if(At=this.tokenizer.codespan(ge)){ge=ge.substring(At.raw.length),be.push(At);continue}if(At=this.tokenizer.br(ge)){ge=ge.substring(At.raw.length),be.push(At);continue}if(At=this.tokenizer.del(ge)){ge=ge.substring(At.raw.length),At.tokens=this.inlineTokens(At.text,[],Le,ut),be.push(At);continue}if(At=this.tokenizer.autolink(ge,ue)){ge=ge.substring(At.raw.length),be.push(At);continue}if(!Le&&(At=this.tokenizer.url(ge,ue))){ge=ge.substring(At.raw.length),be.push(At);continue}if(Dt=ge,this.options.extensions&&this.options.extensions.startInline&&function(){var Tn=1/0,lr=ge.slice(1),cr=void 0;Ze.options.extensions.startInline.forEach(function(Xn){"number"==typeof(cr=Xn.call(this,lr))&&cr>=0&&(Tn=Math.min(Tn,cr))}),Tn<1/0&&Tn>=0&&(Dt=ge.substring(0,Tn+1))}(),At=this.tokenizer.inlineText(Dt,ut,pe)){ge=ge.substring(At.raw.length),"_"!==At.raw.slice(-1)&&(Nn=At.raw.slice(-1)),ai=!0,(Mt=be[be.length-1])&&"text"===Mt.type?(Mt.raw+=At.raw,Mt.text+=At.text):be.push(At);continue}if(ge){var $n="Infinite loop on byte: "+ge.charCodeAt(0);if(this.options.silent){console.error($n);break}throw new Error($n)}}return be},function(rt,lt,ht){lt&&it(rt.prototype,lt),ht&&it(rt,ht)}(rt,null,[{key:"rules",get:function(){return{block:Ne,inline:q}}}]),rt}(),_t=dt.exports.defaults,pt=te_cleanUrl,ve=te_escape,L=function(){function rt(ht){this.options=ht||_t}var lt=rt.prototype;return lt.code=function(ge,be,Le){var ut=(be||"").match(/\S*/)[0];if(this.options.highlight){var Ze=this.options.highlight(ge,ut);null!=Ze&&Ze!==ge&&(Le=!0,ge=Ze)}return ge=ge.replace(/\n$/,"")+"\n",ut?'
    '+(Le?ge:ve(ge,!0))+"
    \n":"
    "+(Le?ge:ve(ge,!0))+"
    \n"},lt.blockquote=function(ge){return"
    \n"+ge+"
    \n"},lt.html=function(ge){return ge},lt.heading=function(ge,be,Le,ut){return this.options.headerIds?"'+ge+"\n":""+ge+"\n"},lt.hr=function(){return this.options.xhtml?"
    \n":"
    \n"},lt.list=function(ge,be,Le){var ut=be?"ol":"ul";return"<"+ut+(be&&1!==Le?' start="'+Le+'"':"")+">\n"+ge+"\n"},lt.listitem=function(ge){return"
  • "+ge+"
  • \n"},lt.checkbox=function(ge){return" "},lt.paragraph=function(ge){return"

    "+ge+"

    \n"},lt.table=function(ge,be){return be&&(be=""+be+""),"\n\n"+ge+"\n"+be+"
    \n"},lt.tablerow=function(ge){return"\n"+ge+"\n"},lt.tablecell=function(ge,be){var Le=be.header?"th":"td";return(be.align?"<"+Le+' align="'+be.align+'">':"<"+Le+">")+ge+"\n"},lt.strong=function(ge){return""+ge+""},lt.em=function(ge){return""+ge+""},lt.codespan=function(ge){return""+ge+""},lt.br=function(){return this.options.xhtml?"
    ":"
    "},lt.del=function(ge){return""+ge+""},lt.link=function(ge,be,Le){if(null===(ge=pt(this.options.sanitize,this.options.baseUrl,ge)))return Le;var ut='"+Le+""},lt.image=function(ge,be,Le){if(null===(ge=pt(this.options.sanitize,this.options.baseUrl,ge)))return Le;var ut=''+Le+'":">")},lt.text=function(ge){return ge},rt}(),N=function(){function rt(){}var lt=rt.prototype;return lt.strong=function(ge){return ge},lt.em=function(ge){return ge},lt.codespan=function(ge){return ge},lt.del=function(ge){return ge},lt.html=function(ge){return ge},lt.text=function(ge){return ge},lt.link=function(ge,be,Le){return""+Le},lt.image=function(ge,be,Le){return""+Le},lt.br=function(){return""},rt}(),B=function(){function rt(){this.seen={}}var lt=rt.prototype;return lt.serialize=function(ge){return ge.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")},lt.getNextSafeSlug=function(ge,be){var Le=ge,ut=0;if(this.seen.hasOwnProperty(Le)){ut=this.seen[ge];do{Le=ge+"-"+ ++ut}while(this.seen.hasOwnProperty(Le))}return be||(this.seen[ge]=ut,this.seen[Le]=0),Le},lt.slug=function(ge,be){void 0===be&&(be={});var Le=this.serialize(ge);return this.getNextSafeSlug(Le,be.dryrun)},rt}(),Re=L,Qe=N,St=B,Nt=dt.exports.defaults,On=te_unescape,Yn=je,Ti=function(){function rt(ht){this.options=ht||Nt,this.options.renderer=this.options.renderer||new Re,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Qe,this.slugger=new St}rt.parse=function(ge,be){return new rt(be).parse(ge)},rt.parseInline=function(ge,be){return new rt(be).parseInline(ge)};var lt=rt.prototype;return lt.parse=function(ge,be){void 0===be&&(be=!0);var ut,Ze,At,Mt,Dt,Xt,zn,ai,Nn,bn,$n,Tn,lr,cr,Xn,$i,xa,Zr,ie,Le="",fe=ge.length;for(ut=0;ut0&&"text"===Xn.tokens[0].type?(Xn.tokens[0].text=Zr+" "+Xn.tokens[0].text,Xn.tokens[0].tokens&&Xn.tokens[0].tokens.length>0&&"text"===Xn.tokens[0].tokens[0].type&&(Xn.tokens[0].tokens[0].text=Zr+" "+Xn.tokens[0].tokens[0].text)):Xn.tokens.unshift({type:"text",text:Zr}):cr+=Zr),cr+=this.parse(Xn.tokens,lr),Nn+=this.renderer.listitem(cr,xa,$i);Le+=this.renderer.list(Nn,$n,Tn);continue;case"html":Le+=this.renderer.html(bn.text);continue;case"paragraph":Le+=this.renderer.paragraph(this.parseInline(bn.tokens));continue;case"text":for(Nn=bn.tokens?this.parseInline(bn.tokens):bn.text;ut+1An error occurred:

    "+el(At.message+"",!0)+"
    ";throw At}}return Jt.options=Jt.setOptions=function(rt){return Bs(Jt.defaults,rt),Sa(Jt.defaults),Jt},Jt.getDefaults=kl,Jt.defaults=Es,Jt.use=function(){for(var rt=this,lt=arguments.length,ht=new Array(lt),ge=0;geAn error occurred:

    "+el(ge.message+"",!0)+"
    ";throw ge}},Jt.Parser=Ti,Jt.parser=Ti.parse,Jt.Renderer=Xr,Jt.TextRenderer=Ls,Jt.Lexer=Yn,Jt.lexer=Yn.lex,Jt.Tokenizer=wi,Jt.Slugger=gs,Jt.parse=Jt,Jt}()},369:(Ut,it,Je)=>{var yt=Je(284),ee=Je(830);function Tt(){this.clear()}Tt.prototype.clear=function(){this.items=[],this.offset=0,this.size=0},Tt.prototype.enqueue=function(dt){return this.items.push(dt),++this.size},Tt.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}},Tt.prototype.peek=function(){if(this.size)return this.items[this.offset]},Tt.prototype.forEach=function(dt,Y){Y=arguments.length>1?Y:this;for(var Se=this.offset,he=0,W=this.items.length;Se=dt.length)return{done:!0};var Se=dt[Y];return Y++,{value:Se,done:!1}})},Tt.prototype.entries=function(){var dt=this.items,Y=this.offset,Se=0;return new yt(function(){if(Y>=dt.length)return{done:!0};var he=dt[Y];return Y++,{value:[Se++,he],done:!1}})},"undefined"!=typeof Symbol&&(Tt.prototype[Symbol.iterator]=Tt.prototype.values),Tt.prototype.toString=function(){return this.toArray().join(",")},Tt.prototype.toJSON=function(){return this.toArray()},Tt.prototype.inspect=function(){var dt=this.toArray();return Object.defineProperty(dt,"constructor",{value:Tt,enumerable:!1}),dt},"undefined"!=typeof Symbol&&(Tt.prototype[Symbol.for("nodejs.util.inspect.custom")]=Tt.prototype.inspect),Tt.from=function(dt){var Y=new Tt;return ee(dt,function(Se){Y.enqueue(Se)}),Y},Tt.of=function(){return Tt.from(arguments)},Ut.exports=Tt},830:Ut=>{var it="undefined"!=typeof ArrayBuffer,Je="undefined"!=typeof Symbol;function yt(ee,Tt){var dt,Y,Se,he,W;if(!ee)throw new Error("obliterator/forEach: invalid iterable.");if("function"!=typeof Tt)throw new Error("obliterator/forEach: expecting a callback.");if(Array.isArray(ee)||it&&ArrayBuffer.isView(ee)||"string"==typeof ee||"[object Arguments]"===ee.toString())for(Se=0,he=ee.length;Se{function it(Je){Object.defineProperty(this,"_next",{writable:!1,enumerable:!1,value:Je}),this.done=!1}it.prototype.next=function(){if(this.done)return{done:!0};var Je=this._next();return Je.done&&(this.done=!0),Je},"undefined"!=typeof Symbol&&(it.prototype[Symbol.iterator]=function(){return this}),it.of=function(){var Je=arguments,yt=Je.length,ee=0;return new it(function(){return ee>=yt?{done:!0}:{done:!1,value:Je[ee++]}})},it.empty=function(){var Je=new it(null);return Je.done=!0,Je},it.is=function(Je){return Je instanceof it||"object"==typeof Je&&null!==Je&&"function"==typeof Je.next},Ut.exports=it},310:(Ut,it,Je)=>{"use strict";var yt=Je(948);Object.defineProperty(it,"__esModule",{value:!0}),it.isMobile=function(){return void 0!==ee.window.orientation},it.default=function(he){if(!he&&!(0,Tt.default)())return"Node";if((0,dt.default)(he))return"Electron";var W="undefined"!=typeof navigator?navigator:{},j=he||W.userAgent||"";if(j.indexOf("Edge")>-1)return"Edge";var P=-1!==j.indexOf("MSIE "),Q=-1!==j.indexOf("Trident/");return P||Q?"IE":ee.window.chrome?"Chrome":ee.window.safari?"Safari":ee.window.mozInnerScreenX?"Firefox":"Unknown"};var ee=Je(151),Tt=yt(Je(602)),dt=yt(Je(344))},151:(Ut,it,Je)=>{"use strict";var yt=Je(948);Object.defineProperty(it,"__esModule",{value:!0}),it.console=it.process=it.document=it.global=it.window=it.self=void 0;var ee=yt(Je(321)),Tt={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,ee.default)(process))&&process};it.self=Tt.self||Tt.window||Tt.global,it.window=Tt.window||Tt.self||Tt.global,it.global=Tt.global||Tt.self||Tt.window,it.document=Tt.document||{},it.process=Tt.process||{};var j=console;it.console=j},761:(Ut,it,Je)=>{"use strict";var ee=Je(948),Tt=Je(321);Object.defineProperty(it,"CO",{enumerable:!0,get:function(){return dt.global}}),Object.defineProperty(it,"qs",{enumerable:!0,get:function(){return Se.default}});var dt=Je(151),Se=(j(Je(602)),j(Je(310)));ee(Je(344));function W(P){if("function"!=typeof WeakMap)return null;var Q=new WeakMap,z=new WeakMap;return(W=function(x){return x?z:Q})(P)}function j(P,Q){if(!Q&&P&&P.__esModule)return P;if(null===P||"object"!==Tt(P)&&"function"!=typeof P)return{default:P};var z=W(Q);if(z&&z.has(P))return z.get(P);var v={},x=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var O in P)if("default"!==O&&Object.prototype.hasOwnProperty.call(P,O)){var A=x?Object.getOwnPropertyDescriptor(P,O):null;A&&(A.get||A.set)?Object.defineProperty(v,O,A):v[O]=P[O]}return v.default=P,z&&z.set(P,v),v}},602:(Ut,it,Je)=>{"use strict";var yt=Je(948);Object.defineProperty(it,"__esModule",{value:!0}),it.default=dt,it.isBrowserMainThread=function(){return dt()&&"undefined"!=typeof document};var ee=yt(Je(321)),Tt=yt(Je(344));function dt(){return!("object"===("undefined"==typeof process?"undefined":(0,ee.default)(process))&&"[object process]"===String(process)&&!process.browser)||(0,Tt.default)()}},344:(Ut,it,Je)=>{"use strict";var yt=Je(948);Object.defineProperty(it,"__esModule",{value:!0}),it.default=function(dt){if("undefined"!=typeof window&&"object"===(0,ee.default)(window.process)&&"renderer"===window.process.type||"undefined"!=typeof process&&"object"===(0,ee.default)(process.versions)&&Boolean(process.versions.electron))return!0;var Y="object"===("undefined"==typeof navigator?"undefined":(0,ee.default)(navigator))&&"string"==typeof navigator.userAgent&&navigator.userAgent,Se=dt||Y;return!!(Se&&Se.indexOf("Electron")>=0)};var ee=yt(Je(321))},991:function(Ut,it,Je){"use strict";var yt=this&&this.__createBinding||(Object.create?function(Tt,dt,Y,Se){void 0===Se&&(Se=Y),Object.defineProperty(Tt,Se,{enumerable:!0,get:function(){return dt[Y]}})}:function(Tt,dt,Y,Se){void 0===Se&&(Se=Y),Tt[Se]=dt[Y]}),ee=this&&this.__exportStar||function(Tt,dt){for(var Y in Tt)"default"!==Y&&!Object.prototype.hasOwnProperty.call(dt,Y)&&yt(dt,Tt,Y)};Object.defineProperty(it,"__esModule",{value:!0}),ee(Je(180),it),ee(Je(103),it),ee(Je(965),it),ee(Je(595),it),ee(Je(417),it),ee(Je(451),it),ee(Je(735),it)},180:(Ut,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.BlankNode=void 0,it.BlankNode=class{constructor(ee){this.termType="BlankNode",this.value=ee}equals(ee){return!!ee&&"BlankNode"===ee.termType&&ee.value===this.value}}},103:(Ut,it,Je)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.DataFactory=void 0;const yt=Je(180),ee=Je(965),Tt=Je(595),dt=Je(417),Y=Je(451),Se=Je(735);let he=0;it.DataFactory=class{constructor(P){this.blankNodeCounter=0,this.blankNodePrefix=(P=P||{}).blankNodePrefix||`df_${he++}_`}namedNode(P){return new dt.NamedNode(P)}blankNode(P){return new yt.BlankNode(P||`${this.blankNodePrefix}${this.blankNodeCounter++}`)}literal(P,Q){return new Tt.Literal(P,Q)}variable(P){return new Se.Variable(P)}defaultGraph(){return ee.DefaultGraph.INSTANCE}quad(P,Q,z,v){return new Y.Quad(P,Q,z,v||this.defaultGraph())}fromTerm(P){switch(P.termType){case"NamedNode":return this.namedNode(P.value);case"BlankNode":return this.blankNode(P.value);case"Literal":return P.language?this.literal(P.value,P.language):P.datatype.equals(Tt.Literal.XSD_STRING)?this.literal(P.value):this.literal(P.value,this.fromTerm(P.datatype));case"Variable":return this.variable(P.value);case"DefaultGraph":return this.defaultGraph();case"Quad":return this.quad(this.fromTerm(P.subject),this.fromTerm(P.predicate),this.fromTerm(P.object),this.fromTerm(P.graph))}}fromQuad(P){return this.fromTerm(P)}resetBlankNodeCounter(){this.blankNodeCounter=0}}},965:(Ut,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.DefaultGraph=void 0;class Je{constructor(){this.termType="DefaultGraph",this.value=""}equals(ee){return!!ee&&"DefaultGraph"===ee.termType}}it.DefaultGraph=Je,Je.INSTANCE=new Je},595:(Ut,it,Je)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.Literal=void 0;const yt=Je(417);class ee{constructor(dt,Y){this.termType="Literal",this.value=dt,"string"==typeof Y?(this.language=Y,this.datatype=ee.RDF_LANGUAGE_STRING):Y?(this.language="",this.datatype=Y):(this.language="",this.datatype=ee.XSD_STRING)}equals(dt){return!!dt&&"Literal"===dt.termType&&dt.value===this.value&&dt.language===this.language&&dt.datatype.equals(this.datatype)}}it.Literal=ee,ee.RDF_LANGUAGE_STRING=new yt.NamedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),ee.XSD_STRING=new yt.NamedNode("http://www.w3.org/2001/XMLSchema#string")},417:(Ut,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.NamedNode=void 0,it.NamedNode=class{constructor(ee){this.termType="NamedNode",this.value=ee}equals(ee){return!!ee&&"NamedNode"===ee.termType&&ee.value===this.value}}},451:(Ut,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.Quad=void 0,it.Quad=class{constructor(ee,Tt,dt,Y){this.termType="Quad",this.value="",this.subject=ee,this.predicate=Tt,this.object=dt,this.graph=Y}equals(ee){return!!ee&&("Quad"===ee.termType||!ee.termType)&&this.subject.equals(ee.subject)&&this.predicate.equals(ee.predicate)&&this.object.equals(ee.object)&&this.graph.equals(ee.graph)}}},735:(Ut,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.Variable=void 0,it.Variable=class{constructor(ee){this.termType="Variable",this.value=ee}equals(ee){return!!ee&&"Variable"===ee.termType&&ee.value===this.value}}},609:function(Ut,it,Je){"use strict";var yt=this&&this.__createBinding||(Object.create?function(v,x,O,A){void 0===A&&(A=O),Object.defineProperty(v,A,{enumerable:!0,get:function(){return x[O]}})}:function(v,x,O,A){void 0===A&&(A=O),v[A]=x[O]}),ee=this&&this.__exportStar||function(v,x){for(var O in v)"default"!==O&&!Object.prototype.hasOwnProperty.call(x,O)&&yt(x,v,O)};Object.defineProperty(it,"__esModule",{value:!0}),it.getSupportedJavaScriptPrimitives=it.getSupportedRdfDatatypes=it.getTermRaw=it.toRdf=it.fromRdf=void 0;const Tt=Je(991),dt=Je(938),Y=Je(60);ee(Je(938),it),ee(Je(871),it),ee(Je(60),it);const Se=new Tt.DataFactory,he=new Y.Translator;function W(v,x){return he.fromRdf(v,x)}he.registerHandler(new dt.TypeHandlerString,dt.TypeHandlerString.TYPES.map(v=>Se.namedNode(v)),["string"]),he.registerHandler(new dt.TypeHandlerBoolean,[dt.TypeHandlerBoolean.TYPE].map(v=>Se.namedNode(v)),["boolean"]),he.registerHandler(new dt.TypeHandlerNumberDouble,dt.TypeHandlerNumberDouble.TYPES.map(v=>Se.namedNode(v)),["number"]),he.registerHandler(new dt.TypeHandlerNumberInteger,dt.TypeHandlerNumberInteger.TYPES.map(v=>Se.namedNode(v)),["number"]),he.registerHandler(new dt.TypeHandlerDate,dt.TypeHandlerDate.TYPES.map(v=>Se.namedNode(v)),["object"]),it.fromRdf=W,it.toRdf=function(v,x){return x&&"namedNode"in x&&(x={dataFactory:x}),(x=x||{})&&!x.dataFactory&&(x.dataFactory=Se),he.toRdf(v,x)},it.getTermRaw=function(v,x){return"Literal"===v.termType?W(v,x):v.value},it.getSupportedRdfDatatypes=function(){return he.getSupportedRdfDatatypes()},it.getSupportedJavaScriptPrimitives=function(){return he.getSupportedJavaScriptPrimitives()}},871:(Ut,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0})},60:(Ut,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(ee){throw new Error(`Invalid RDF ${ee.datatype.value} value: '${ee.value}'`)}registerHandler(ee,Tt,dt){for(const Y of Tt)this.supportedRdfDatatypes.push(Y),this.fromRdfHandlers[Y.value]=ee;for(const Y of dt){let Se=this.toRdfHandlers[Y];Se||(this.toRdfHandlers[Y]=Se=[]),Se.push(ee)}}fromRdf(ee,Tt){const dt=this.fromRdfHandlers[ee.datatype.value];return dt?dt.fromRdf(ee,Tt):ee.value}toRdf(ee,Tt){const dt=this.toRdfHandlers[typeof ee];if(dt)for(const Y of dt){const Se=Y.toRdf(ee,Tt);if(Se)return Se}throw new Error(`Invalid JavaScript value: '${ee}'`)}getSupportedRdfDatatypes(){return this.supportedRdfDatatypes}getSupportedJavaScriptPrimitives(){return Object.keys(this.toRdfHandlers)}}},727:(Ut,it,Je)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.TypeHandlerBoolean=void 0;const yt=Je(60);class ee{fromRdf(dt,Y){switch(dt.value){case"true":return!0;case"false":return!1;case"1":return!0;case"0":return!1}return Y&&yt.Translator.incorrectRdfDataType(dt),!1}toRdf(dt,{datatype:Y,dataFactory:Se}){return Se.literal(dt?"true":"false",Y||Se.namedNode(ee.TYPE))}}it.TypeHandlerBoolean=ee,ee.TYPE="http://www.w3.org/2001/XMLSchema#boolean"},525:(Ut,it,Je)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.TypeHandlerDate=void 0;const yt=Je(60);class ee{fromRdf(dt,Y){switch(Y&&!dt.value.match(ee.VALIDATORS[dt.datatype.value.substr(33,dt.datatype.value.length)])&&yt.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 Se=dt.value.split("-");return new Date(0,parseInt(Se[0],10)-1,parseInt(Se[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:Y,dataFactory:Se}){if(Y=Y||Se.namedNode(ee.TYPES[0]),!(dt instanceof Date))return null;const he=dt;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 Se.literal(W,Y)}}it.TypeHandlerDate=ee,ee.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"],ee.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:(Ut,it,Je)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.TypeHandlerNumberDouble=void 0;const yt=Je(60);class ee{fromRdf(dt,Y){const Se=parseFloat(dt.value);return Y&&isNaN(Se)&&yt.Translator.incorrectRdfDataType(dt),Se}toRdf(dt,{datatype:Y,dataFactory:Se}){return Y=Y||Se.namedNode(ee.TYPES[0]),isNaN(dt)?Se.literal("NaN",Y):isFinite(dt)?dt%1==0?null:Se.literal(dt.toExponential(15).replace(/(\d)0*e\+?/,"$1E"),Y):Se.literal(dt>0?"INF":"-INF",Y)}}it.TypeHandlerNumberDouble=ee,ee.TYPES=["http://www.w3.org/2001/XMLSchema#double","http://www.w3.org/2001/XMLSchema#decimal","http://www.w3.org/2001/XMLSchema#float"]},750:(Ut,it,Je)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.TypeHandlerNumberInteger=void 0;const yt=Je(60);class ee{fromRdf(dt,Y){const Se=parseInt(dt.value,10);return Y&&(isNaN(Se)||dt.value.indexOf(".")>=0)&&yt.Translator.incorrectRdfDataType(dt),Se}toRdf(dt,{datatype:Y,dataFactory:Se}){return Se.literal(String(dt),Y||Se.namedNode(dt<=ee.MAX_INT&&dt>=ee.MIN_INT?ee.TYPES[0]:ee.TYPES[1]))}}it.TypeHandlerNumberInteger=ee,ee.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"],ee.MAX_INT=2147483647,ee.MIN_INT=-2147483648},608:(Ut,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.TypeHandlerString=void 0;class Je{fromRdf(ee){return ee.value}toRdf(ee,{datatype:Tt,dataFactory:dt}){return dt.literal(ee,Tt)}}it.TypeHandlerString=Je,Je.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(Ut,it,Je){"use strict";var yt=this&&this.__createBinding||(Object.create?function(Tt,dt,Y,Se){void 0===Se&&(Se=Y),Object.defineProperty(Tt,Se,{enumerable:!0,get:function(){return dt[Y]}})}:function(Tt,dt,Y,Se){void 0===Se&&(Se=Y),Tt[Se]=dt[Y]}),ee=this&&this.__exportStar||function(Tt,dt){for(var Y in Tt)"default"!==Y&&!Object.prototype.hasOwnProperty.call(dt,Y)&&yt(dt,Tt,Y)};Object.defineProperty(it,"__esModule",{value:!0}),ee(Je(727),it),ee(Je(525),it),ee(Je(554),it),ee(Je(750),it),ee(Je(608),it)},303:(Ut,it,Je)=>{"use strict";var yt={};Je.r(yt),Je.d(yt,{decode:()=>Xme,encode:()=>Qme});var ee={};Je.r(ee),Je.d(ee,{decode:()=>n_e,encode:()=>i_e});var Tt={};Je.r(Tt),Je.d(Tt,{decode:()=>r_e,encode:()=>s_e});var dt={};function Y(n){return"function"==typeof n}Je.r(dt),Je.d(dt,{decode:()=>o_e,encode:()=>a_e});let Se=!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 Se&&console.log("RxJS: Back to a better error behavior. Thank you. <3");Se=n},get useDeprecatedSynchronousErrorHandling(){return Se}};function W(n){setTimeout(()=>{throw n},0)}const j={closed:!0,next(n){},error(n){if(he.useDeprecatedSynchronousErrorHandling)throw n;W(n)},complete(){}},P=Array.isArray||(n=>n&&"number"==typeof n.length);function Q(n){return null!==n&&"object"==typeof n}const v=(()=>{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 x{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 x)t.remove(this);else if(null!==t)for(let o=0;oe.concat(t instanceof v?t.errors:t),[])}x.EMPTY=((n=new x).closed=!0,n);const A="function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random();class y extends x{constructor(e,t,i){switch(super(),this.syncErrorValue=null,this.syncErrorThrown=!1,this.syncErrorThrowable=!1,this.isStopped=!1,arguments.length){case 0:this.destination=j;break;case 1:if(!e){this.destination=j;break}if("object"==typeof e){e instanceof y?(this.syncErrorThrowable=e.syncErrorThrowable,this.destination=e,e.add(this)):(this.syncErrorThrowable=!0,this.destination=new S(this,e));break}default:this.syncErrorThrowable=!0,this.destination=new S(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 S 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!==j&&(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 R="function"==typeof Symbol&&Symbol.observable||"@@observable";function K(n){return n}function ce(...n){return D(n)}function D(n){return 0===n.length?K:1===n.length?n[0]:function(t){return n.reduce((i,r)=>r(i),t)}}let I=(()=>{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(j)}(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=X(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)}[R](){return this}pipe(...t){return 0===t.length?this:D(t)(this)}toPromise(t){return new(t=X(t))((i,r)=>{let s;this.subscribe(o=>s=o,o=>r(o),()=>i(s))})}}return n.create=e=>new n(e),n})();function X(n){if(n||(n=he.Promise||Promise),!n)throw new Error("no Promise impl found");return n}const $=(()=>{function n(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return n.prototype=Object.create(Error.prototype),n})();class Z extends x{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 oe extends y{constructor(e){super(e),this.destination=e}}let se=(()=>{class n extends I{constructor(){super(),this.observers=[],this.closed=!1,this.isStopped=!1,this.hasError=!1,this.thrownError=null}[A](){return new oe(this)}lift(t){const i=new te(this,this);return i.operator=t,i}next(t){if(this.closed)throw new $;if(!this.isStopped){const{observers:i}=this,r=i.length,s=i.slice();for(let o=0;onew te(e,t),n})();class te extends se{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):x.EMPTY}}function Ce(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 ne(n,e))}}class ne{constructor(e,t){this.project=e,this.thisArg=t}call(e,t){return t.subscribe(new _e(e,this.project,this.thisArg))}}class _e 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 Ie=n=>e=>{for(let t=0,i=n.length;tn&&"number"==typeof n.length&&"function"!=typeof n;function Ke(n){return!!n&&"function"!=typeof n.subscribe&&"function"==typeof n.then}const Me=n=>{if(n&&"function"==typeof n[R])return(n=>e=>{const t=n[R]();if("function"!=typeof t.subscribe)throw new TypeError("Provided object does not correctly implement Symbol.observable");return t.subscribe(e)})(n);if(ke(n))return Ie(n);if(Ke(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[Xe])return(n=>e=>{const t=n[Xe]();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 ${Q(n)?"an invalid object":`'${n}'`} where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.`;throw new TypeError(t)}};function Ne(n,e){return new I(t=>{const i=new x;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 je(n,e){return e?function(n,e){if(null!=n){if(function(n){return n&&"function"==typeof n[R]}(n))return function(n,e){return new I(t=>{const i=new x;return i.add(e.schedule(()=>{const r=n[R]();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(Ke(n))return function(n,e){return new I(t=>{const i=new x;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(ke(n))return Ne(n,e);if(function(n){return n&&"function"==typeof n[Xe]}(n)||"string"==typeof n)return function(n,e){if(!n)throw new Error("Iterable cannot be null");return new I(t=>{const i=new x;let r;return i.add(()=>{r&&"function"==typeof r.return&&r.return()}),i.add(e.schedule(()=>{r=n[Xe](),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 I?n:new I(Me(n))}class _t 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 ve extends y{notifyNext(e){this.destination.next(e)}notifyError(e){this.destination.error(e)}notifyComplete(){this.destination.complete()}}function N(n,e){if(e.closed)return;if(n instanceof I)return n.subscribe(e);let t;try{t=Me(n)(e)}catch(i){e.error(i)}return t}function B(n,e,t=Number.POSITIVE_INFINITY){return"function"==typeof e?i=>i.pipe(B((r,s)=>je(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 Qe(e,this.project,this.concurrent))}}class Qe extends ve{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 Nt(n=Number.POSITIVE_INFINITY){return B(K,n)}function On(n,e){return e?Ne(n,e):new I(Ie(n))}function kn(...n){let e=Number.POSITIVE_INFINITY,t=null,i=n[n.length-1];return Ce(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 I?n[0]:Nt(e)(On(n,t))}function Yn(){return function(e){return e.lift(new Ti(e))}}class Ti{constructor(e){this.connectable=e}call(e,t){const{connectable:i}=this;i._refCount++;const r=new wi(e,i),s=t.subscribe(r);return r.closed||(r.connection=i.connect()),s}}class wi 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 Xr extends I{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 x,e.add(this.source.subscribe(new gs(this.getSubject(),this))),e.closed&&(this._connection=null,e=x.EMPTY)),e}refCount(){return Yn()(this)}}const Ls=(()=>{const n=Xr.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 gs extends oe{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()}}}function el(n,e){return function(i){let r;if(r="function"==typeof n?n:function(){return n},"function"==typeof e)return i.lift(new kl(r,e));const s=Object.create(i,Ls);return s.source=i,s.subjectFactory=r,s}}class kl{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 Sa(){return new se}function Es(){return n=>Yn()(el(Sa)(n))}function Jt(n){for(let e in n)if(n[e]===Jt)return e;throw Error("Could not find renamed property on target object.")}function tl(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 lt(n,e){return null==n||""===n?null===e?"":e:null==e||""===e?n:n+" "+e}const ht=Jt({__forward_ref__:Jt});function ge(n){return n.__forward_ref__=ge,n.toString=function(){return rt(this())},n}function be(n){return Le(n)?n():n}function Le(n){return"function"==typeof n&&n.hasOwnProperty(ht)&&n.__forward_ref__===ge}class Ze extends Error{constructor(e,t){super(function(n,e){return`${n?`NG0${n}: `:""}${e}`}(e,t)),this.code=e}}function Dt(n){return"string"==typeof n?n:null==n?"":String(n)}function Xt(n){return"function"==typeof n?n.name||n.toString():"object"==typeof n&&null!=n&&"function"==typeof n.type?n.type.name||n.type.toString():Dt(n)}function bn(n,e){const t=e?` in ${e}`:"";throw new Ze("201",`No provider for ${Xt(n)} found${t}`)}function J(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 xt(n){return{providers:n.providers||[],imports:n.imports||[]}}function vn(n){return Ss(n,po)||Ss(n,js)}function Ss(n,e){return n.hasOwnProperty(e)?n[e]:null}function Ll(n){return n&&(n.hasOwnProperty(jr)||n.hasOwnProperty(xc))?n[jr]:null}const po=Jt({\u0275prov:Jt}),jr=Jt({\u0275inj:Jt}),js=Jt({ngInjectableDef:Jt}),xc=Jt({ngInjectorDef:Jt});var Sn=(()=>((Sn=Sn||{})[Sn.Default=0]="Default",Sn[Sn.Host=1]="Host",Sn[Sn.Self=2]="Self",Sn[Sn.SkipSelf=4]="SkipSelf",Sn[Sn.Optional=8]="Optional",Sn))();let go;function Ca(n){const e=go;return go=n,e}function wd(n,e,t){const i=vn(n);return i&&"root"==i.providedIn?void 0===i.value?i.value=i.factory():i.value:t&Sn.Optional?null:void 0!==e?e:void bn(rt(n),"Injector")}function De(n){return{toString:n}.toString()}var He=(()=>((He=He||{})[He.OnPush=0]="OnPush",He[He.Default=1]="Default",He))(),Yt=(()=>((Yt=Yt||{})[Yt.Emulated=0]="Emulated",Yt[Yt.None=2]="None",Yt[Yt.ShadowDom=3]="ShadowDom",Yt))();const li="undefined"!=typeof globalThis&&globalThis,Vr="undefined"!=typeof window&&window,es="undefined"!=typeof self&&"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&self,xs="undefined"!=typeof global&&global,Qn=li||xs||Vr||es,Ed={},tr=[],fp=Jt({\u0275cmp:Jt}),Jm=Jt({\u0275dir:Jt}),Dh=Jt({\u0275pipe:Jt}),sv=Jt({\u0275mod:Jt}),T1=Jt({\u0275loc:Jt}),jl=Jt({\u0275fac:Jt}),Ih=Jt({__NG_ELEMENT_ID__:Jt});let M1=0;function ln(n){return De(()=>{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||tr,viewQuery:n.viewQuery||null,features:n.features||null,data:n.data||{},encapsulation:n.encapsulation||Yt.Emulated,id:"c",styles:n.styles||tr,_:null,setInput:null,schemas:n.schemas||null,tView:null},r=n.directives,s=n.features,o=n.pipes;return i.id+=M1++,i.inputs=cv(n.inputs,t),i.outputs=cv(n.outputs),s&&s.forEach(a=>a(i)),i.directiveDefs=r?()=>("function"==typeof r?r():r).map(ov):null,i.pipeDefs=o?()=>("function"==typeof o?o():o).map(av):null,i})}function ov(n){return Vi(n)||function(n){return n[Jm]||null}(n)}function av(n){return function(n){return n[Dh]||null}(n)}const lv={};function on(n){return De(()=>{const e={type:n.type,bootstrap:n.bootstrap||tr,declarations:n.declarations||tr,imports:n.imports||tr,exports:n.exports||tr,transitiveCompileScopes:null,schemas:n.schemas||null,id:n.id||null};return null!=n.id&&(lv[n.id]=n.type),e})}function cv(n,e){if(null==n)return Ed;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 Rt=ln;function Vs(n){return{type:n.type,name:n.name,factory:null,pure:!1!==n.pure,onDestroy:n.type.prototype.ngOnDestroy||null}}function Vi(n){return n[fp]||null}function Oo(n,e){const t=n[sv]||null;if(!t&&!0===e)throw new Error(`Type ${rt(n)} does not have '\u0275mod' property.`);return t}function Qo(n){return Array.isArray(n)&&"object"==typeof n[1]}function Zo(n){return Array.isArray(n)&&!0===n[1]}function n_(n){return 0!=(8&n.flags)}function Ad(n){return 2==(2&n.flags)}function Td(n){return 1==(1&n.flags)}function Ma(n){return null!==n.template}function uv(n){return 0!=(512&n[2])}function Tc(n,e){return n.hasOwnProperty(jl)?n[jl]:null}class o_{constructor(e,t,i){this.previousValue=e,this.currentValue=t,this.firstChange=i}isFirstChange(){return this.firstChange}}function Ui(){return fv}function fv(n){return n.type.prototype.ngOnChanges&&(n.setInput=k1),F1}function F1(){const n=at(this),e=null==n?void 0:n.current;if(e){const t=n.previous;if(t===Ed)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=at(n)||function(n,e){return n[kh]=e}(n,{previous:Ed,current:null}),s=r.current||(r.current={}),o=r.previous,a=this.declaredInputs[t],l=o[a];s[a]=new o_(l&&l.currentValue,e,o===Ed),n[i]=e}Ui.ngInherit=!0;const kh="__ngSimpleChanges__";function at(n){return n[kh]||null}let Ki;function gr(n){return!!n.listen}const bu={createRenderer:(n,e)=>void 0!==Ki?Ki:"undefined"!=typeof document?document:void 0};function xr(n){for(;Array.isArray(n);)n=n[0];return n}function Lh(n,e){return xr(e[n])}function Zs(n,e){return xr(e[n.index])}function c_(n,e){return n.data[e]}function zs(n,e){const t=e[n];return Qo(t)?t:t[0]}function zl(n){return 4==(4&n[2])}function Dd(n){return 128==(128&n[2])}function Ia(n,e){return null==e?null:n[e]}function u_(n){n[18]=0}function mp(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 Bn={lFrame:wu(null),bindingsEnabled:!0,isInCheckNoChangesMode:!1};function gv(){return Bn.bindingsEnabled}function jt(){return Bn.lFrame.lView}function Ei(){return Bn.lFrame.tView}function Cr(n){return Bn.lFrame.contextLView=n,n[8]}function cs(){let n=d_();for(;null!==n&&64===n.type;)n=n.parent;return n}function d_(){return Bn.lFrame.currentTNode}function rl(n,e){const t=Bn.lFrame;t.currentTNode=n,t.isParent=e}function Hr(){return Bn.lFrame.isParent}function ms(){Bn.lFrame.isParent=!1}function Vh(){return Bn.isInCheckNoChangesMode}function yp(n){Bn.isInCheckNoChangesMode=n}function Oa(){return Bn.lFrame.bindingIndex++}function No(n){const e=Bn.lFrame,t=e.bindingIndex;return e.bindingIndex=e.bindingIndex+n,t}function Id(n,e){const t=Bn.lFrame;t.bindingIndex=t.bindingRootIndex=n,h_(e)}function h_(n){Bn.lFrame.currentDirectiveIndex=n}function f_(n){const e=Bn.lFrame.currentDirectiveIndex;return-1===e?null:n[e]}function mv(){return Bn.lFrame.currentQueryIndex}function p_(n){Bn.lFrame.currentQueryIndex=n}function vp(n){const e=n[1];return 2===e.type?e.declTNode:1===e.type?n[6]:null}function Od(n,e,t){if(t&Sn.SkipSelf){let r=e,s=n;for(;!(r=r.parent,null!==r||t&Sn.Host||(r=vp(s),null===r||(s=s[15],10&r.type))););if(null===r)return!1;e=r,n=s}const i=Bn.lFrame=Ee();return i.currentTNode=e,i.lView=n,!0}function Hh(n){const e=Ee(),t=n[1];Bn.lFrame=e,e.currentTNode=t.firstChild,e.lView=n,e.tView=t,e.contextLView=n,e.bindingIndex=t.bindingStartIndex,e.inI18n=!1}function Ee(){const n=Bn.lFrame,e=null===n?null:n.child;return null===e?wu(n):e}function wu(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 Gh(){const n=Bn.lFrame;return Bn.lFrame=n.parent,n.currentTNode=null,n.lView=null,n}const Po=Gh;function fi(){const n=Gh();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 Js(){return Bn.lFrame.selectedIndex}function yo(n){Bn.lFrame.selectedIndex=n}function kr(){const n=Bn.lFrame;return c_(n.tView,n.selectedIndex)}function wp(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 $h{constructor(e,t,i){this.factory=e,this.resolving=!1,this.canSeeViewProviders=t,this.injectImpl=i}}function xp(n,e,t){const i=gr(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 Nd=!0;function Cp(n){const e=Nd;return Nd=n,e}let v_=0;function Hs(n,e){const t=Ap(n,e);if(-1!==t)return t;const i=e[1];i.firstCreatePass&&(n.injectorIndex=e.length,w_(i.data,n),w_(e,null),w_(i.blueprint,null));const r=qh(n,e),s=n.injectorIndex;if(vv(r)){const o=Rd(r),a=ol(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 w_(n,e){n.push(0,0,0,0,0,0,0,0,e)}function Ap(n,e){return-1===n.injectorIndex||n.parent&&n.parent.injectorIndex===n.injectorIndex||null===e[n.injectorIndex+8]?-1:n.injectorIndex}function qh(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 Dc(n,e,t){!function(n,e,t){let i;"string"==typeof t?i=t.charCodeAt(0)||0:t.hasOwnProperty(Ih)&&(i=t[Ih]),null==i&&(i=t[Ih]=v_++);const r=255&i;e.data[n+(r>>5)]|=1<=0?255&e:xv:e}(t);if("function"==typeof s){if(!Od(e,n,i))return i&Sn.Host?E_(r,t,i):Ev(e,t,i,r);try{const o=s(i);if(null!=o||i&Sn.Optional)return o;bn(t)}finally{Po()}}else if("number"==typeof s){let o=null,a=Ap(n,e),l=-1,c=i&Sn.Host?e[16][6]:null;for((-1===a||i&Sn.SkipSelf)&&(l=-1===a?qh(n,e):e[a+8],-1!==l&&Kh(i,!1)?(o=e[1],a=Rd(l),e=ol(l,e)):a=-1);-1!==a;){const u=e[1];if(Tp(s,a,u.data)){const h=Ts(a,e,t,o,i,c);if(h!==Sv)return h}l=e[a+8],-1!==l&&Kh(i,e[1].data[a+8]===c)&&Tp(s,a,e)?(o=u,a=Rd(l),e=ol(l,e)):a=-1}}}return Ev(e,t,i,r)}const Sv={};function xv(){return new ea(cs(),jt())}function Ts(n,e,t,i,r,s){const o=e[1],a=o.data[n+8],u=Pd(a,o,t,null==i?Ad(a)&&Nd:i!=o&&0!=(3&a.type),r&Sn.Host&&s===a);return null!==u?Fd(e,o,u,a):Sv}function Pd(n,e,t,i,r){const s=n.providerIndexes,o=e.data,a=1048575&s,l=n.directiveStart,u=s>>20,p=r?a+u:n.directiveEnd;for(let g=i?a:a+u;g=l&&m.type===t)return g}if(r){const g=o[l];if(g&&Ma(g)&&g.type===t)return l}return null}function Fd(n,e,t,i){let r=n[t];const s=e.data;if(function(n){return n instanceof $h}(r)){const o=r;o.resolving&&function(n,e){throw new Ze("200",`Circular dependency in DI detected for ${n}`)}(Xt(s[t]));const a=Cp(o.canSeeViewProviders);o.resolving=!0;const l=o.injectImpl?Ca(o.injectImpl):null;Od(n,i,Sn.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=fv(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&&Ca(l),Cp(a),o.resolving=!1,Po()}}return r}function Tp(n,e,t){return!!(t[e+(n>>5)]&1<{const e=n.prototype.constructor,t=e[jl]||Ms(e),i=Object.prototype;let r=Object.getPrototypeOf(n.prototype).constructor;for(;r&&r!==i;){const s=r[jl]||Ms(r);if(s&&s!==t)return s;r=Object.getPrototypeOf(r)}return s=>new s})}function Ms(n){return Le(n)?()=>{const e=Ms(be(n));return e&&e()}:Tc(n)}function Fo(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{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,u){const h=l.hasOwnProperty(Ld)?l[Ld]:Object.defineProperty(l,Ld,{value:[]})[Ld];for(;h.length<=u;)h.push(null);return(h[u]=h[u]||[]).push(o),l}}return t&&(r.prototype=Object.create(t.prototype)),r.prototype.ngMetadataName=n,r.annotationCls=r,r})}class Ht{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}`}}const xu=Function;function ta(n,e){void 0===e&&(e=n);for(let t=0;tArray.isArray(t)?na(t,e):e(t))}function Qh(n,e,t){e>=n.length?n.push(t):n.splice(e,0,t)}function Gl(n,e){return e>=n.length-1?n.pop():n.splice(e,1)[0]}function Oc(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 M_(n,e){const t=Ds(n,e);if(t>=0)return n[1|t]}function Ds(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(Pc,"\n ")}`}("\n"+n.message,r,t,i),n.ngTokenPath=r,n[Nc]=null,n}const zd=Ud(Pa("Inject",n=>({token:n})),-1),ns=Ud(Pa("Optional"),8),ul=Ud(Pa("SkipSelf"),4);let Gd;function Ou(n){var e;return(null===(e=function(){if(void 0===Gd&&(Gd=null,Qn.trustedTypes))try{Gd=Qn.trustedTypes.createPolicy("angular",{createHTML:n=>n,createScript:n=>n,createScriptURL:n=>n})}catch(n){}return Gd}())||void 0===e?void 0:e.createHTML(n))||n}class Yl{constructor(e){this.changingThisBreaksApplicationSecurity=e}toString(){return`SafeValue must use [property]=binding: ${this.changingThisBreaksApplicationSecurity} (see https://g.co/ng/security#xss)`}}class P_ extends Yl{getTypeName(){return"HTML"}}class F_ extends Yl{getTypeName(){return"Style"}}class Vp extends Yl{getTypeName(){return"Script"}}class $d extends Yl{getTypeName(){return"URL"}}class Fn extends Yl{getTypeName(){return"ResourceURL"}}function Gs(n){return n instanceof Yl?n.changingThisBreaksApplicationSecurity:n}function ia(n,e){const t=Lc(n);if(null!=t&&t!==e){if("ResourceURL"===t&&"URL"===e)return!0;throw new Error(`Required a safe ${e}, got a ${t} (see https://g.co/ng/security#xss)`)}return t===e}function Lc(n){return n instanceof Yl&&n.getTypeName()||null}class zv{constructor(e){this.inertDocumentHelper=e}getInertBodyElement(e){e=""+e;try{const t=(new window.DOMParser).parseFromString(Ou(e),"text/html").body;return null===t?this.inertDocumentHelper.getInertBodyElement(e):(t.removeChild(t.firstChild),t)}catch(t){return null}}}class pA{constructor(e){if(this.defaultDoc=e,this.inertDocument=this.defaultDoc.implementation.createHTMLDocument("sanitization-inert"),null==this.inertDocument.body){const t=this.inertDocument.createElement("html");this.inertDocument.appendChild(t);const i=this.inertDocument.createElement("body");t.appendChild(i)}}getInertBodyElement(e){const t=this.inertDocument.createElement("template");if("content"in t)return t.innerHTML=Ou(e),t;const i=this.inertDocument.createElement("body");return i.innerHTML=Ou(e),this.defaultDoc.documentMode&&this.stripCustomNsAttrs(i),i}stripCustomNsAttrs(e){const t=e.attributes;for(let r=t.length-1;0Bo(e.trim())).join(", ")}function ra(n){const e={};for(const t of n.split(","))e[t]=!0;return e}function Jh(...n){const e={};for(const t of n)for(const i in t)t.hasOwnProperty(i)&&(e[i]=!0);return e}const Up=ra("area,br,col,hr,img,wbr"),Gv=ra("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr"),$v=ra("rp,rt"),L_=Jh(Up,Jh(Gv,ra("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")),Jh($v,ra("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")),Jh($v,Gv)),B_=ra("background,cite,href,itemtype,longdesc,poster,src,xlink:href"),j_=ra("srcset"),V_=Jh(B_,j_,ra("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"),ra("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")),vA=ra("script,style,template");class U_{constructor(){this.sanitizedSomething=!1,this.buf=[]}sanitizeChildren(e){let t=e.firstChild,i=!0;for(;t;)if(t.nodeType===Node.ELEMENT_NODE?i=this.startElement(t):t.nodeType===Node.TEXT_NODE?this.chars(t.nodeValue):this.sanitizedSomething=!0,i&&t.firstChild)t=t.firstChild;else for(;t;){t.nodeType===Node.ELEMENT_NODE&&this.endElement(t);let r=this.checkClobberedElement(t,t.nextSibling);if(r){t=r;break}t=this.checkClobberedElement(t,t.parentNode)}return this.buf.join("")}startElement(e){const t=e.nodeName.toLowerCase();if(!L_.hasOwnProperty(t))return this.sanitizedSomething=!0,!vA.hasOwnProperty(t);this.buf.push("<"),this.buf.push(t);const i=e.attributes;for(let r=0;r"),!0}endElement(e){const t=e.nodeName.toLowerCase();L_.hasOwnProperty(t)&&!Up.hasOwnProperty(t)&&(this.buf.push(""))}chars(e){this.buf.push(Hp(e))}checkClobberedElement(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: ${e.outerHTML}`);return t}}const Wv=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,ef=/([^\#-~ |!])/g;function Hp(n){return n.replace(/&/g,"&").replace(Wv,function(e){return"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";"}).replace(ef,function(e){return"&#"+e.charCodeAt(0)+";"}).replace(//g,">")}let tf;function z_(n,e){let t=null;try{tf=tf||function(n){const e=new pA(n);return function(){try{return!!(new window.DOMParser).parseFromString(Ou(""),"text/html")}catch(n){return!1}}()?new zv(e):e}(n);let i=e?String(e):"";t=tf.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=t.innerHTML,t=tf.getInertBodyElement(i)}while(i!==s);return Ou((new U_).sanitizeChildren(Wd(t)||t))}finally{if(t){const i=Wd(t)||t;for(;i.firstChild;)i.removeChild(i.firstChild)}}}function Wd(n){return"content"in n&&function(n){return n.nodeType===Node.ELEMENT_NODE&&"TEMPLATE"===n.nodeName}(n)?n.content:null}var ni=(()=>((ni=ni||{})[ni.NONE=0]="NONE",ni[ni.HTML=1]="HTML",ni[ni.STYLE=2]="STYLE",ni[ni.SCRIPT=3]="SCRIPT",ni[ni.URL=4]="URL",ni[ni.RESOURCE_URL=5]="RESOURCE_URL",ni))();function nf(n){const e=function(){const n=jt();return n&&n[12]}();return e?e.sanitize(ni.URL,n)||"":ia(n,"URL")?Gs(n):Bo(Dt(n))}const $_="__ngContext__";function Is(n,e){n[$_]=e}function W_(n){const e=function(n){return n[$_]||null}(n);return e?Array.isArray(e)?e:e.lView:null}function Gp(n){return n.ngOriginalError}function NA(n,...e){n.error(...e)}class oa{constructor(){this._console=console}handleError(e){const t=this._findOriginalError(e),i=this._findContext(e),r=function(n){return n&&n.ngErrorLogger||NA}(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(Gp(e)):null}_findOriginalError(e){let t=e&&Gp(e);for(;t&&Gp(t);)t=Gp(t);return t||null}}const iw=(()=>("undefined"!=typeof requestAnimationFrame&&requestAnimationFrame||setTimeout).bind(Qn))();function hl(n){return n instanceof Function?n():n}var jo=(()=>((jo=jo||{})[jo.Important=1]="Important",jo[jo.DashCase=2]="DashCase",jo))();function Q_(n,e){return undefined(n,e)}function of(n){const e=n[3];return Zo(e)?e[3]:e}function Yd(n){return lw(n[13])}function J_(n){return lw(n[4])}function lw(n){for(;null!==n&&!Zo(n);)n=n[4];return n}function Kd(n,e,t,i,r){if(null!=i){let s,o=!1;Zo(i)?s=i:Qo(i)&&(o=!0,i=i[0]);const a=xr(i);0===n&&null!==t?null==r?fw(e,t,a):fl(e,t,a,r||null,!0):1===n&&null!==t?fl(e,t,a,r||null,!0):2===n?function(n,e,t){const i=qp(n,e);i&&function(n,e,t,i){gr(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!==xr(t)&&Kd(e,n,i,s,r);for(let a=10;a0&&(n[t-1][4]=i[4]);const s=Gl(n,10+e);!function(n,e){Xd(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 iy(n,e){if(!(256&e[2])){const t=e[11];gr(t)&&t.destroyNode&&Xd(n,e,t,3,null,null),function(n){let e=n[13];if(!e)return Wp(n[1],n);for(;e;){let t=null;if(Qo(e))t=e[13];else{const i=e[10];i&&(t=i)}if(!t){for(;e&&!e[4]&&e!==n;)Qo(e)&&Wp(e[1],e),e=e[3];null===e&&(e=n),Qo(e)&&Wp(e[1],e),t=e&&e[4]}e=t}}(e)}}function Wp(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[h+1].toLowerCase();const g=8&i?p:null;if(g&&-1!==lf(g,c,0)||2&i&&c!==p){if(ka(i))return!1;o=!0}}}}else{if(!o&&!ka(i)&&!ka(l))return!1;if(o&&ka(l))continue;o=!1,i=l|1&i}}return ka(i)||o}function ka(n){return 0==(1&n)}function oT(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&&!ka(o)&&(e+=Aw(s,r),r=""),i=o,s=s||!ka(i);t++}return""!==r&&(e+=Aw(s,r)),e}const In={};function Zt(n){Tw(Ei(),jt(),Js()+n,Vh())}function Tw(n,e,t,i){if(!i)if(3==(3&e[2])){const s=n.preOrderCheckHooks;null!==s&&Ep(e,s,t)}else{const s=n.preOrderHooks;null!==s&&Sp(e,s,0,t)}yo(t)}function pl(n,e){return n<<17|e<<2}function Rn(n){return n>>17&32767}function Ar(n){return 2|n}function Kl(n){return(131068&n)>>2}function gl(n,e){return-131069&n|e<<2}function cy(n){return 1|n}function kw(n,e){const t=n.contentQueries;if(null!==t)for(let i=0;i20&&Tw(n,e,20,Vh()),t(i,r)}finally{yo(s)}}function hf(n,e,t){!gv()||(function(n,e,t,i){const r=t.directiveStart,s=t.directiveEnd;n.firstCreatePass||Hs(t,e),Is(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 qw(n,e){null!==n.hostBindings&&n.hostBindings(1,e)}function Yw(n,e){e.flags|=2,(n.components||(n.components=[])).push(e.index)}function PT(n,e,t){if(t){if(e.exportAs)for(let i=0;i0&&wy(t)}}function wy(n){for(let i=Yd(n);null!==i;i=J_(i))for(let r=10;r0&&wy(s)}const t=n[1].components;if(null!==t)for(let i=0;i0&&wy(r)}}function UT(n,e){const t=zs(e,n),i=t[1];(function(n,e){for(let t=e.length;tPromise.resolve(null))();function Qw(n){return n[7]||(n[7]=[])}function ig(n){return n.cleanup||(n.cleanup=[])}function Ay(n,e,t){return(null===n||Ma(n))&&(t=function(n){for(;Array.isArray(n);){if("object"==typeof n[1])return n;n=n[0]}return null}(t[e.index])),t[11]}function Ty(n,e){const t=n[9],i=t?t.get(oa,null):null;i&&i.handleError(e)}function Zw(n,e,t,i,r){for(let s=0;sthis.processProvider(a,e,t)),na([e],a=>this.processInjectorType(a,[],s)),this.records.set(Pu,ku(void 0,this));const o=this.records.get(Fu);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=Tu,i=Sn.Default){this.assertNotDestroyed();const r=Vd(this),s=Ca(void 0);try{if(!(i&Sn.SkipSelf)){let a=this.records.get(e);if(void 0===a){const l=function(n){return"function"==typeof n||"object"==typeof n&&n instanceof Ht}(e)&&vn(e);a=l&&this.injectableDefInScope(l)?ku(Ry(e),ff):null,this.records.set(e,a)}if(null!=a)return this.hydrate(e,a)}return(i&Sn.Self?Jw():this.parent).get(e,t=i&Sn.Optional&&t===Tu?null:t)}catch(o){if("NullInjectorError"===o.name){if((o[Nc]=o[Nc]||[]).unshift(rt(e)),r)throw o;return eo(o,e,"R3InjectorError",this.source)}throw o}finally{Ca(s),Vd(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=be(e)))return!1;let r=Ll(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=Ll(s)),null==r)return!1;if(null!=r.imports&&!a){let u;i.push(o);try{na(r.imports,h=>{this.processInjectorType(h,t,i)&&(void 0===u&&(u=[]),u.push(h))})}finally{}if(void 0!==u)for(let h=0;hthis.processProvider(m,p,g||tr))}}this.injectorDefTypes.add(o);const l=Tc(o)||(()=>new o);this.records.set(o,ku(l,ff));const c=r.providers;if(null!=c&&!a){const u=e;na(c,h=>this.processProvider(h,u,c))}return void 0!==s&&void 0!==e.providers}processProvider(e,t,i){let r=Vc(e=be(e))?e:be(e&&e.provide);const s=function(n,e,t){return nE(n)?ku(void 0,n.useValue):ku(tE(n),ff)}(e);if(Vc(e)||!0!==e.multi)this.records.get(r);else{let o=this.records.get(r);o||(o=ku(void 0,ff,!0),o.factory=()=>Du(o.multi),this.records.set(r,o)),r=e,o.multi.push(e)}this.records.set(r,s)}hydrate(e,t){return t.value===ff&&(t.value=KT,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=be(e.providedIn);return"string"==typeof t?"any"===t||t===this.scope:this.injectorDefTypes.has(t)}}function Ry(n){const e=vn(n),t=null!==e?e.factory:Tc(n);if(null!==t)return t;if(n instanceof Ht)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=Oc(e,"?");throw new Error(`Can't resolve all parameters for ${rt(n)}: (${i.join(", ")}).`)}const t=function(n){const e=n&&(n[po]||n[js]);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 tE(n,e,t){let i;if(Vc(n)){const r=be(n);return Tc(r)||Ry(r)}if(nE(n))i=()=>be(n.useValue);else if(function(n){return!(!n||!n.useFactory)}(n))i=()=>n.useFactory(...Du(n.deps||[]));else if(function(n){return!(!n||!n.useExisting)}(n))i=()=>Oe(be(n.useExisting));else{const r=be(n&&(n.useClass||n.provide));if(!function(n){return!!n.deps}(n))return Tc(r)||Ry(r);i=()=>new r(...Du(n.deps))}return i}function ku(n,e,t=!1){return{factory:n,value:e,multi:t?[]:void 0}}function nE(n){return null!==n&&"object"==typeof n&&Np in n}function Vc(n){return"function"==typeof n}const iE=function(n,e,t){return function(n,e=null,t=null,i){const r=eE(n,e,t,i);return r._resolveInjectorDefTypes(),r}({name:t},e,n,t)};class Wn{static create(e,t){return Array.isArray(e)?iE(e,t,""):iE(e.providers,e.parent,e.name||"")}}function Gq(n,e){wp(W_(n)[1],cs())}function An(n){let e=function(n){return Object.getPrototypeOf(n.prototype).constructor}(n.type),t=!0;const i=[n];for(;e;){let r;if(Ma(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=cM(n.inputs),o.declaredInputs=cM(n.declaredInputs),o.outputs=cM(n.outputs);const a=r.hostBindings;a&&Yq(n,a);const l=r.viewQuery,c=r.contentQueries;if(l&&Wq(n,l),c&&qq(n,c),tl(n.inputs,r.inputs),tl(n.declaredInputs,r.declaredInputs),tl(n.outputs,r.outputs),Ma(r)&&r.data.animation){const u=n.data;u.animation=(u.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=Wh(r.hostAttrs,t=Wh(t,r.hostAttrs))}}(i)}function cM(n){return n===Ed?{}:n===tr?[]:n}function Wq(n,e){const t=n.viewQuery;n.viewQuery=t?(i,r)=>{e(i,r),t(i,r)}:e}function qq(n,e){const t=n.contentQueries;n.contentQueries=t?(i,r,s)=>{e(i,r,s),t(i,r,s)}:e}function Yq(n,e){const t=n.hostBindings;n.hostBindings=t?(i,r)=>{e(i,r),t(i,r)}:e}Wn.THROW_IF_NOT_FOUND=Tu,Wn.NULL=new io,Wn.\u0275prov=We({token:Wn,providedIn:"any",factory:()=>Oe(Pu)}),Wn.__NG_ELEMENT_ID__=-1;let lE=null;function sg(){if(!lE){const n=Qn.Symbol;if(n&&n.iterator)lE=n.iterator;else{const e=Object.getOwnPropertyNames(Map.prototype);for(let t=0;ta(xr(Ae[i.index])):i.index;if(gr(t)){let Ae=null;if(!a&&l&&(Ae=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!==Ae)(Ae.__ngLastListenerFn__||Ae).__ngNextListenerFn__=s,Ae.__ngLastListenerFn__=s,g=!1;else{s=mM(i,e,h,s,!1);const Pe=t.listen(H,r,s);p.push(s,Pe),u&&u.push(r,de,U,U+1)}}else s=mM(i,e,h,s,!0),H.addEventListener(r,s,o),p.push(s),u&&u.push(r,de,U,o)}else s=mM(i,e,h,s,!1);const m=i.outputs;let w;if(g&&null!==m&&(w=m[r])){const C=w.length;if(C)for(let H=0;H0;)e=e[15],n--;return e}(n,Bn.lFrame.contextLView))[8]}(n)}function MY(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 Rs={textEnd:0,key:0,keyEnd:0,value:0,valueEnd:0};function jk(n){return n.substring(Rs.key,Rs.keyEnd)}function Vk(n,e){const t=Rs.textEnd;return t===e?-1:(e=Rs.keyEnd=function(n,e,t){for(;e32;)e++;return e}(n,Rs.key=e,t),bg(n,e,t))}function bg(n,e,t){for(;e=0;t=Vk(e,t))ko(n,jk(e),!0)}function ec(n,e,t,i){const r=jt(),s=Ei(),o=No(2);s.firstUpdatePass&&Wk(s,n,o,i),e!==In&&Eo(r,o,e)&&Yk(s,s.data[Js()],r,r[11],n,r[o+1]=function(n,e){return null==n||("string"==typeof e?n+=e:"object"==typeof n&&(n=rt(Gs(n)))),n}(e,t),i,o)}function $k(n,e){return e>=n.expandoStartIndex}function Wk(n,e,t,i){const r=n.data;if(null===r[t+1]){const s=r[Js()],o=$k(n,t);Xk(s,i)&&null===e&&!o&&(e=!1),e=function(n,e,t,i){const r=f_(n);let s=i?e.residualClasses:e.residualStyles;if(null===r)0===(i?e.classBindings:e.styleBindings)&&(t=Vy(t=yM(null,n,e,t,i),e.attrs,i),s=null);else{const o=e.directiveStylingLast;if(-1===o||n[o]!==r)if(t=yM(r,n,e,t,i),null===s){let l=function(n,e,t){const i=t?e.classBindings:e.styleBindings;if(0!==Kl(i))return n[Rn(i)]}(n,e,i);void 0!==l&&Array.isArray(l)&&(l=yM(null,n,e,l[1],i),l=Vy(l,e.attrs,i),function(n,e,t,i){n[Rn(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 u=t;if(r)if(0!==l){const p=Rn(n[a+1]);n[i+1]=pl(p,a),0!==p&&(n[p+1]=gl(n[p+1],i)),n[a+1]=function(n,e){return 131071&n|e<<17}(n[a+1],i)}else n[i+1]=pl(a,0),0!==a&&(n[a+1]=gl(n[a+1],i)),a=i;else n[i+1]=pl(l,0),0===a?a=i:n[l+1]=gl(n[l+1],i),l=i;c&&(n[i+1]=Ar(n[i+1])),Bk(n,u,i,!0),Bk(n,u,i,!1),function(n,e,t,i,r){const s=r?n.residualClasses:n.residualStyles;null!=s&&"string"==typeof e&&Ds(s,e)>=0&&(t[i+1]=cy(t[i+1]))}(e,u,n,i,s),o=pl(a,l),s?e.classBindings=o:e.styleBindings=o}(r,s,e,t,o,i)}}function yM(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),u=c?l[1]:l,h=null===u;let p=t[r+1];p===In&&(p=h?tr:void 0);let g=h?M_(p,i):u===i?p:void 0;if(c&&!gE(g)&&(g=M_(l,i)),gE(g)&&(a=g,o))return a;const m=n[r+1];r=o?Rn(m):Kl(m)}if(null!==e){let l=s?e.residualClasses:e.residualStyles;null!=l&&(a=M_(l,i))}return a}function gE(n){return void 0!==n}function Xk(n,e){return 0!=(n.flags&(e?16:32))}function Oi(n,e=""){const t=jt(),i=Ei(),r=n+20,s=i.firstCreatePass?Zd(i,r,1,e,null):i.data[r],o=t[r]=function(n,e){return gr(n)?n.createText(e):n.createTextNode(e)}(t[11],e);Yp(i,t,o,s),rl(s,!1)}function da(n){return ha("",n,""),da}function ha(n,e,t){const i=jt(),r=ag(i,n,e,t);return r!==In&&Xl(i,Js(),r),ha}function Lu(n,e,t){const i=jt();return Eo(i,Oa(),e)&&Vo(Ei(),kr(),i,n,e,i[11],t,!0),Lu}function mE(n,e,t){const i=jt();if(Eo(i,Oa(),e)){const s=Ei(),o=kr();Vo(s,o,i,n,e,Ay(f_(s.data),o,i),t,!0)}return mE}const gf=void 0;var dK=["en",[["a","p"],["AM","PM"],gf],[["AM","PM"],gf,gf],[["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"]],gf,[["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"]],gf,[["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}",gf,"{1} 'at' {0}",gf],[".",",",";","%","+","-","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 vg={};function pL(n){return n in vg||(vg[n]=Qn.ng&&Qn.ng.common&&Qn.ng.common.locales&&Qn.ng.common.locales[n]),vg[n]}var cn=(()=>((cn=cn||{})[cn.LocaleId=0]="LocaleId",cn[cn.DayPeriodsFormat=1]="DayPeriodsFormat",cn[cn.DayPeriodsStandalone=2]="DayPeriodsStandalone",cn[cn.DaysFormat=3]="DaysFormat",cn[cn.DaysStandalone=4]="DaysStandalone",cn[cn.MonthsFormat=5]="MonthsFormat",cn[cn.MonthsStandalone=6]="MonthsStandalone",cn[cn.Eras=7]="Eras",cn[cn.FirstDayOfWeek=8]="FirstDayOfWeek",cn[cn.WeekendRange=9]="WeekendRange",cn[cn.DateFormat=10]="DateFormat",cn[cn.TimeFormat=11]="TimeFormat",cn[cn.DateTimeFormat=12]="DateTimeFormat",cn[cn.NumberSymbols=13]="NumberSymbols",cn[cn.NumberFormats=14]="NumberFormats",cn[cn.CurrencyCode=15]="CurrencyCode",cn[cn.CurrencySymbol=16]="CurrencySymbol",cn[cn.CurrencyName=17]="CurrencyName",cn[cn.Currencies=18]="Currencies",cn[cn.Directionality=19]="Directionality",cn[cn.PluralCase=20]="PluralCase",cn[cn.ExtraData=21]="ExtraData",cn))();const _E="en-US";let gL=_E;function vM(n){J(n,"Expected localeId to be defined"),"string"==typeof n&&(gL=n.toLowerCase().replace(/_/g,"-"))}function SM(n,e,t,i,r){if(n=be(n),Array.isArray(n))for(let s=0;s>20;if(Vc(n)||!n.multi){const g=new $h(l,r,xe),m=CM(a,e,r?u:u+p,h);-1===m?(Dc(Hs(c,o),s,a),xM(s,n,e.length),e.push(a),c.directiveStart++,c.directiveEnd++,r&&(c.providerIndexes+=1048576),t.push(g),o.push(g)):(t[m]=g,o[m]=g)}else{const g=CM(a,e,u+p,h),m=CM(a,e,u,u+p),w=g>=0&&t[g],C=m>=0&&t[m];if(r&&!C||!r&&!w){Dc(Hs(c,o),s,a);const H=function(n,e,t,i,r){const s=new $h(n,t,xe);return s.multi=[],s.index=e,s.componentProviders=0,jL(s,r,i&&!t),s}(r?lX:aX,t.length,r,i,l);!r&&C&&(t[m].providerFactory=H),xM(s,n,e.length,0),e.push(a),c.directiveStart++,c.directiveEnd++,r&&(c.providerIndexes+=1048576),t.push(H),o.push(H)}else xM(s,n,g>-1?g:m,jL(t[r?m:g],l,!r&&i));!r&&i&&C&&t[m].componentProviders++}}}function xM(n,e,t,i){const r=Vc(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 jL(n,e,t){return t&&n.componentProviders++,n.multi.push(e)-1}function CM(n,e,t,i){for(let r=t;r{t.providersResolver=(i,r)=>function(n,e,t){const i=Ei();if(i.firstCreatePass){const r=Ma(n);SM(t,i.data,i.blueprint,r,!0),SM(e,i.data,i.blueprint,r,!1)}}(i,r?r(n):n,e)}}class VL{}const zL="ngComponent";class dX{resolveComponentFactory(e){throw function(n){const e=Error(`No component factory found for ${rt(n)}. Did you add it to @NgModule.entryComponents?`);return e[zL]=n,e}(e)}}class wl{}function EE(...n){}function Eg(n,e){return new En(Zs(n,e))}wl.NULL=new dX;const pX=function(){return Eg(cs(),jt())};let En=(()=>{class n{constructor(t){this.nativeElement=t}}return n.__NG_ELEMENT_ID__=pX,n})();function HL(n){return n instanceof En?n.nativeElement:n}class mf{}let MM=(()=>{class n{}return n.\u0275prov=We({token:n,providedIn:"root",factory:()=>null}),n})();class ju{constructor(e){this.full=e,this.major=e.split(".")[0],this.minor=e.split(".")[1],this.patch=e.split(".").slice(2).join(".")}}const GL=new ju("12.2.5");class $L{constructor(){}supports(e){return Ly(e)}create(e){return new vX(e)}}const bX=(n,e)=>e;class vX{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||bX}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 wX(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 WL),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 WL),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 wX{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 EX{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 WL{constructor(){this.map=new Map}put(e){const t=e.trackById;let i=this.map.get(t);i||(i=new EX,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 qL(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 xX(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 xX{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 KL(){return new Sg([new $L])}let Sg=(()=>{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||KL()),deps:[[n,new ul,new ns]]}}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:KL}),n})();function XL(){return new xg([new YL])}let xg=(()=>{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||XL()),deps:[[n,new ul,new ns]]}}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:XL}),n})();function SE(n,e,t,i,r=!1){for(;null!==t;){const s=e[t.index];if(null!==s&&i.push(xr(s)),Zo(s))for(let a=10;a-1&&(ny(e,i),Gl(t,i))}this._attachedToViewContainer=!1}iy(this._lView[1],this._lView)}onDestroy(e){Vw(this._lView[1],this._lView,null,e)}markForCheck(){Ey(this._cdRefInjectingView||this._lView)}detach(){this._lView[2]&=-129}reattach(){this._lView[2]|=128}detectChanges(){xy(this._lView[1],this._lView,this.context)}checkNoChanges(){!function(n,e,t){yp(!0);try{xy(n,e,t)}finally{yp(!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){Xd(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 AX extends $y{constructor(e){super(e),this._view=e}detectChanges(){Xw(this._view)}checkNoChanges(){!function(n){yp(!0);try{Xw(n)}finally{yp(!1)}}(this._view)}get context(){return null}}const MX=function(n){return function(n,e,t){if(Ad(n)&&!t){const i=zs(n.index,e);return new $y(i,i)}return 47&n.type?new $y(e[16],e):null}(cs(),jt(),16==(16&n))};let Dr=(()=>{class n{}return n.__NG_ELEMENT_ID__=MX,n})();const OX=[new YL],NX=new Sg([new $L]),PX=new xg(OX),kX=function(){return xE(cs(),jt())};let zo=(()=>{class n{}return n.__NG_ELEMENT_ID__=kX,n})();const LX=zo,BX=class extends LX{constructor(e,t,i){super(),this._declarationLView=e,this._declarationTContainer=t,this.elementRef=i}createEmbeddedView(e){const t=this._declarationTContainer.tViews,i=uf(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)),df(t,i,e),new $y(i)}};function xE(n,e){return 4&n.type?new BX(e,n,Eg(n,e)):null}class $c{}const UX=function(){return e3(cs(),jt())};let Ns=(()=>{class n{}return n.__NG_ELEMENT_ID__=UX,n})();const HX=Ns,ZL=class extends HX{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 ea(this._hostTNode,this._hostLView)}get parentInjector(){const e=qh(this._hostTNode,this._hostLView);if(vv(e)){const t=ol(e,this._hostLView),i=Rd(e);return new ea(t[1].data[i+8],t)}return new ea(null,this._hostLView)}clear(){for(;this.length>0;)this.remove(this.length-1)}get(e){const t=JL(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($c,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 Zo(n[3])}(i)){const u=this.indexOf(e);if(-1!==u)this.detach(u);else{const h=i[3],p=new ZL(h,h[6],h[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),iiw});class S3 extends VL{constructor(e,t){super(),this.componentDef=e,this.ngModule=t,this.componentType=e.type,this.selector=function(n){return n.map(dT).join(",")}(e.selectors),this.ngContentSelectors=e.ngContentSelectors?e.ngContentSelectors:[],this.isBoundToModule=!!t}get inputs(){return E3(this.componentDef.inputs)}get outputs(){return E3(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,Mg,r);return s!==Mg||i===Mg?s:e.get(t,i,r)}}}(e,r.injector):e,o=s.get(mf,bu),a=s.get(MM,null),l=o.createRenderer(null,this.componentDef),c=this.componentDef.selectors[0][0]||"div",u=i?function(n,e,t){if(gr(n))return n.selectRootElement(e,t===Yt.ShadowDom);let i="string"==typeof e?n.querySelector(e):e;return i.textContent="",i}(l,i,this.componentDef.encapsulation):ty(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)),h=this.componentDef.onPush?576:528,p=function(n,e){return{components:[],scheduler:n||iw,clean:WT,playerHandler:e||null,flags:0}}(),g=tg(0,null,null,1,0,null,null,null,null,null),m=uf(null,g,p,h,null,null,o,l,a,s);let w,C;Hh(m);try{const H=function(n,e,t,i,r,s){const o=t[1];t[20]=n;const l=Zd(o,20,2,"#host",null),c=l.mergedAttrs=e.hostAttrs;null!==c&&(rg(l,c,!0),null!==n&&(xp(r,n,c),null!==l.classes&&ay(r,n,l.classes),null!==l.styles&&Ew(r,n,l.styles)));const u=i.createRenderer(n,e),h=uf(t,eg(e),null,e.onPush?64:16,t[20],l,i,u,s||null,null);return o.firstCreatePass&&(Dc(Hs(l,t),o,e.type),Yw(o,l),yy(l,t.length,1)),ng(t,h),t[20]=h}(u,this.componentDef,m,o,l);if(u)if(i)xp(l,u,["ng-version",GL.full]);else{const{attrs:U,classes:de}=function(n){const e=[],t=[];let i=1,r=2;for(;i0&&ay(l,u,de.join(" "))}if(C=c_(g,20),void 0!==t){const U=C.projection=[];for(let de=0;del(o,e)),e.contentQueries){const l=cs();e.contentQueries(1,o,l.directiveStart)}const a=cs();return!s.firstCreatePass||null===e.hostBindings&&null===e.hostAttrs||(yo(a.index),Ww(t[1],a,0,a.directiveStart,a.directiveEnd,e),qw(e,o)),o}(H,this.componentDef,m,p,[Gq]),df(g,m,null)}finally{fi()}return new zQ(this.componentType,w,Eg(C,m),m,C)}}class zQ 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 AX(r),this.componentType=e}get injector(){return new ea(this._tNode,this._rootLView)}destroy(){this.hostView.destroy()}onDestroy(e){this.hostView.onDestroy(e)}}const Dg=new Map;class $Q extends $c{constructor(e,t){super(),this._parent=t,this._bootstrapComponents=[],this.injector=this,this.destroyCbs=[],this.componentFactoryResolver=new w3(this);const i=Oo(e),r=function(n){return n[T1]||null}(e);r&&vM(r),this._bootstrapComponents=hl(i.bootstrap),this._r3Injector=eE(e,t,[{provide:$c,useValue:this},{provide:wl,useValue:this.componentFactoryResolver}],rt(e)),this._r3Injector._resolveInjectorDefTypes(),this.instance=this.get(e)}get(e,t=Wn.THROW_IF_NOT_FOUND,i=Sn.Default){return e===Wn||e===$c||e===Pu?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 zM extends class{}{constructor(e){super(),this.moduleType=e,null!==Oo(e)&&function(n){const e=new Set;!function t(i){const r=Oo(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,Dg.get(s),i),Dg.set(s,i));const o=hl(r.imports);for(const a of o)e.has(a)||(e.add(a),t(a))}(n)}(e)}create(e){return new $Q(this.moduleType,e)}}function T3(n,e,t,i,r,s){const o=e+t;return Eo(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===In?void 0:t}(n,o+1)}function xl(n,e){const t=Ei();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 Ze("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=Tc(i.type)),o=Ca(xe);try{const a=Cp(!1),l=s();return Cp(a),function(n,e,t,i){t>=n.data.length&&(n.data[t]=null,n.blueprint[t]=null),e[t]=i}(t,jt(),r,l),l}finally{Ca(o)}}function Vu(n,e,t){const i=n+20,r=jt(),s=function(n,e){return n[e]}(r,i);return function(n,e){Zl.isWrapped(e)&&(e=Zl.unwrap(e),n[Bn.lFrame.bindingIndex]=In);return e}(r,function(n,e){return n[1].data[e].pure}(r,i)?T3(r,function(){const n=Bn.lFrame;let e=n.bindingRootIndex;return-1===e&&(e=n.bindingRootIndex=n.tView.bindingStartIndex),e}(),e,s.transform,t,s):s.transform(t))}function HM(n){return e=>{setTimeout(n,void 0,e)}}const sn=class extends se{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 h=e;a=null===(r=h.next)||void 0===r?void 0:r.bind(h),l=null===(s=h.error)||void 0===s?void 0:s.bind(h),c=null===(o=h.complete)||void 0===o?void 0:o.bind(h)}this.__isAsync&&(l=HM(l),a&&(a=HM(a)),c&&(c=HM(c)));const u=super.subscribe({next:a,error:l,complete:c});return e instanceof x&&e.add(u),u}};function oZ(){return this._results[sg()]()}class bf{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=sg(),i=bf.prototype;i[t]||(i[t]=oZ)}get changes(){return this._changes||(this._changes=new sn)}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=ta(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],u=e[-l];for(let h=10;h{class n{constructor(t){this.appInits=t,this.resolve=EE,this.reject=EE,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)(Oe(vf,8))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const r0=new Ht("AppId"),zZ={provide:r0,useFactory:function(){return`${eD()}${eD()}${eD()}`},deps:[]};function eD(){return String.fromCharCode(97+Math.floor(25*Math.random()))}const eB=new Ht("Platform Initializer"),Wc=new Ht("Platform ID"),RE=new Ht("appBootstrapListener");let NE=(()=>{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 Uu=new Ht("LocaleId"),tB=new Ht("DefaultCurrencyCode");class GZ{constructor(e,t){this.ngModuleFactory=e,this.componentFactories=t}}const tD=function(n){return new zM(n)},$Z=tD,WZ=function(n){return Promise.resolve(tD(n))},nB=function(n){const e=tD(n),i=hl(Oo(n).declarations).reduce((r,s)=>{const o=Vi(s);return o&&r.push(new S3(o)),r},[]);return new GZ(e,i)},qZ=nB,YZ=function(n){return Promise.resolve(nB(n))};let wf=(()=>{class n{constructor(){this.compileModuleSync=$Z,this.compileModuleAsync=WZ,this.compileModuleAndAllComponentsSync=qZ,this.compileModuleAndAllComponentsAsync=YZ}clearCache(){}clearCacheFor(t){}getModuleId(t){}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const iB=new Ht("compilerOptions"),XZ=(()=>Promise.resolve(0))();function nD(n){"undefined"==typeof Zone?XZ.then(()=>{n&&n.apply(null,null)}):Zone.current.scheduleMicroTask("scheduleMicrotask",n)}class gn{constructor({enableLongStackTrace:e=!1,shouldCoalesceEventChangeDetection:t=!1,shouldCoalesceRunChangeDetection:i=!1}){if(this.hasPendingMacrotasks=!1,this.hasPendingMicrotasks=!1,this.isStable=!0,this.onUnstable=new sn(!1),this.onMicrotaskEmpty=new sn(!1),this.onStable=new sn(!1),this.onError=new sn(!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=Qn.requestAnimationFrame,e=Qn.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(Qn,()=>{n.fakeTopEventTask||(n.fakeTopEventTask=Zone.root.scheduleEventTask("fakeTopEventTask",()=>{n.lastRequestAnimationFrameId=-1,rD(n),n.isCheckStableRunning=!0,iD(n),n.isCheckStableRunning=!1},void 0,()=>{},()=>{})),n.fakeTopEventTask.invoke()}),rD(n))}(n)};n._inner=n._inner.fork({name:"angular",properties:{isAngularZone:!0},onInvokeTask:(t,i,r,s,o,a)=>{try{return rB(n),t.invokeTask(r,s,o,a)}finally{(n.shouldCoalesceEventChangeDetection&&"eventTask"===s.type||n.shouldCoalesceRunChangeDetection)&&e(),sB(n)}},onInvoke:(t,i,r,s,o,a,l)=>{try{return rB(n),t.invoke(r,s,o,a,l)}finally{n.shouldCoalesceRunChangeDetection&&e(),sB(n)}},onHasTask:(t,i,r,s)=>{t.hasTask(r,s),i===r&&("microTask"==s.change?(n._hasPendingMicrotasks=s.microTask,rD(n),iD(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(!gn.isInAngularZone())throw new Error("Expected to be in Angular Zone, but it is not!")}static assertNotInAngularZone(){if(gn.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,ZZ,EE,EE);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 ZZ={};function iD(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 rD(n){n.hasPendingMicrotasks=!!(n._hasPendingMicrotasks||(n.shouldCoalesceEventChangeDetection||n.shouldCoalesceRunChangeDetection)&&-1!==n.lastRequestAnimationFrameId)}function rB(n){n._nesting++,n.isStable&&(n.isStable=!1,n.onUnstable.emit(null))}function sB(n){n._nesting--,iD(n)}class tJ{constructor(){this.hasPendingMicrotasks=!1,this.hasPendingMacrotasks=!1,this.isStable=!0,this.onUnstable=new sn,this.onMicrotaskEmpty=new sn,this.onStable=new sn,this.onError=new sn}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 sD=(()=>{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:()=>{gn.assertNotInAngularZone(),nD(()=>{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())nD(()=>{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)(Oe(gn))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),oB=(()=>{class n{constructor(){this._applications=new Map,oD.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 oD.findTestabilityInTree(this,t,i)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();class nJ{addToWindow(e){}findTestabilityInTree(e,t,i){return null}}let oD=new nJ,aB=!0,lB=!1;function Ba(){return lB=!0,aB}let rc;const cB=new Ht("AllowMultipleToken");function uB(n,e,t=[]){const i=`Platform: ${e}`,r=new Ht(i);return(s=[])=>{let o=lD();if(!o||o.injector.get(cB,!1))if(n)n(t.concat(s).concat({provide:r,useValue:!0}));else{const a=t.concat(s).concat({provide:r,useValue:!0},{provide:Fu,useValue:"platform"});!function(n){if(rc&&!rc.destroyed&&!rc.injector.get(cB,!1))throw new Error("There can be only one platform. Destroy the previous one to create a new one.");rc=n.get(dB);const e=n.get(eB,null);e&&e.forEach(t=>t())}(Wn.create({providers:a,name:i}))}return function(n){const e=lD();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 lD(){return rc&&!rc.destroyed?rc:null}let dB=(()=>{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 tJ:("zone.js"===n?void 0:n)||new gn({enableLongStackTrace:Ba(),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:gn,useValue:a}];return a.run(()=>{const c=Wn.create({providers:l,parent:this.injector,name:t.moduleType.name}),u=t.create(c),h=u.injector.get(oa,null);if(!h)throw new Error("No ErrorHandler. Is platform module (BrowserModule) included?");return a.runOutsideAngular(()=>{const p=a.onError.subscribe({next:g=>{h.handleError(g)}});u.onDestroy(()=>{cD(this._modules,u),p.unsubscribe()})}),function(n,e,t){try{const i=t();return yg(i)?i.catch(r=>{throw e.runOutsideAngular(()=>n.handleError(r)),r}):i}catch(i){throw e.runOutsideAngular(()=>n.handleError(i)),i}}(h,a,()=>{const p=u.injector.get(Og);return p.runInitializers(),p.donePromise.then(()=>(vM(u.injector.get(Uu,_E)||_E),this._moduleDoBootstrap(u),u))})})}bootstrapModule(t,i=[]){const r=hB({},i);return function(n,e,t){const i=new zM(t);return Promise.resolve(i)}(0,0,t).then(s=>this.bootstrapModuleFactory(s,r))}_moduleDoBootstrap(t){const i=t.injector.get(ih);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)(Oe(Wn))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();function hB(n,e){return Array.isArray(e)?e.reduce(hB,n):Object.assign(Object.assign({},n),e)}let ih=(()=>{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 I(c=>{this._stable=this._zone.isStable&&!this._zone.hasPendingMacrotasks&&!this._zone.hasPendingMicrotasks,this._zone.runOutsideAngular(()=>{c.next(this._stable),c.complete()})}),l=new I(c=>{let u;this._zone.runOutsideAngular(()=>{u=this._zone.onStable.subscribe(()=>{gn.assertNotInAngularZone(),nD(()=>{!this._stable&&!this._zone.hasPendingMacrotasks&&!this._zone.hasPendingMicrotasks&&(this._stable=!0,c.next(!0))})})});const h=this._zone.onUnstable.subscribe(()=>{gn.assertInAngularZone(),this._stable&&(this._stable=!1,this._zone.runOutsideAngular(()=>{c.next(!1)}))});return()=>{u.unsubscribe(),h.unsubscribe()}});this.isStable=kn(a,l.pipe(Es()))}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 VL?t:this._componentFactoryResolver.resolveComponentFactory(t),this.componentTypes.push(r.componentType);const s=function(n){return n.isBoundToModule}(r)?void 0:this._injector.get($c),a=r.create(Wn.NULL,[],i||r.selector,s),l=a.location.nativeElement,c=a.injector.get(sD,null),u=c&&a.injector.get(oB);return c&&u&&u.registerApplication(l,c),a.onDestroy(()=>{this.detachView(a.hostView),cD(this.components,a),u&&u.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;cD(this._views,i),i.detachFromAppRef()}_loadComponent(t){this.attachView(t.hostView),this.tick(),this.components.push(t),this._injector.get(RE,[]).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)(Oe(gn),Oe(Wn),Oe(oa),Oe(wl),Oe(Og))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();function cD(n,e){const t=n.indexOf(e);t>-1&&n.splice(t,1)}const DJ=uB(null,"core",[{provide:Wc,useValue:"unknown"},{provide:dB,deps:[Wn]},{provide:oB,deps:[]},{provide:NE,deps:[]}]),PJ=[{provide:ih,useClass:ih,deps:[gn,Wn,oa,wl,Og]},{provide:jQ,deps:[gn],useFactory:function(n){let e=[];return n.onStable.subscribe(()=>{for(;e.length;)e.pop()()}),function(t){e.push(t)}}},{provide:Og,useClass:Og,deps:[[new ns,vf]]},{provide:wf,useClass:wf,deps:[]},zZ,{provide:Sg,useFactory:function(){return NX},deps:[]},{provide:xg,useFactory:function(){return PX},deps:[]},{provide:Uu,useFactory:function(n){return vM(n=n||"undefined"!=typeof $localize&&$localize.locale||_E),n},deps:[[new zd(Uu),new ns,new ul]]},{provide:tB,useValue:"USD"}];let kJ=(()=>{class n{constructor(t){}}return n.\u0275fac=function(t){return new(t||n)(Oe(ih))},n.\u0275mod=on({type:n}),n.\u0275inj=xt({providers:PJ}),n})(),GE=null;function qc(){return GE}const pn=new Ht("DocumentToken");let xf=(()=>{class n{historyGo(t){throw new Error("Not implemented")}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({factory:Fee,token:n,providedIn:"platform"}),n})();function Fee(){return Oe(VB)}let VB=(()=>{class n extends xf{constructor(t){super(),this._doc=t,this._init()}_init(){this.location=window.location,this._history=window.history}getBaseHrefFromDOM(){return qc().getBaseHref(this._doc)}onPopState(t){const i=qc().getGlobalEventTarget(this._doc,"window");return i.addEventListener("popstate",t,!1),()=>i.removeEventListener("popstate",t)}onHashChange(t){const i=qc().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){UB()?this._history.pushState(t,i,r):this.location.hash=r}replaceState(t,i,r){UB()?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)(Oe(pn))},n.\u0275prov=We({factory:Lee,token:n,providedIn:"platform"}),n})();function UB(){return!!window.history.pushState}function Lee(){return new VB(Oe(pn))}function xD(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}function zB(n){const e=n.match(/#|\?|$/),t=e&&e.index||n.length;return n.slice(0,t-("/"===n[t-1]?1:0))+n.slice(t)}function Hu(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:Bee,token:n,providedIn:"root"}),n})();function Bee(n){const e=Oe(pn).location;return new HB(Oe(xf),e&&e.origin||"")}const CD=new Ht("appBaseHref");let HB=(()=>{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 xD(this._baseHref,t)}path(t=!1){const i=this._platformLocation.pathname+Hu(this._platformLocation.search),r=this._platformLocation.hash;return r&&t?`${i}${r}`:i}pushState(t,i,r,s){const o=this.prepareExternalUrl(r+Hu(s));this._platformLocation.pushState(t,i,o)}replaceState(t,i,r,s){const o=this.prepareExternalUrl(r+Hu(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)(Oe(xf),Oe(CD,8))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),Pg=(()=>{class n{constructor(t,i){this._subject=new sn,this._urlChangeListeners=[],this._platformStrategy=t;const r=this._platformStrategy.getBaseHref();this._platformLocation=i,this._baseHref=zB(GB(r)),this._platformStrategy.onPopState(s=>{this._subject.emit({url:this.path(!0),pop:!0,state:s.state,type:s.type})})}path(t=!1){return this.normalize(this._platformStrategy.path(t))}getState(){return this._platformLocation.getState()}isCurrentPathEqualTo(t,i=""){return this.path()==this.normalize(t+Hu(i))}normalize(t){return n.stripTrailingSlash(function(n,e){return n&&e.startsWith(n)?e.substring(n.length):e}(this._baseHref,GB(t)))}prepareExternalUrl(t){return t&&"/"!==t[0]&&(t="/"+t),this._platformStrategy.prepareExternalUrl(t)}go(t,i="",r=null){this._platformStrategy.pushState(r,"",t,i),this._notifyUrlChangeListeners(this.prepareExternalUrl(t+Hu(i)),r)}replaceState(t,i="",r=null){this._platformStrategy.replaceState(r,"",t,i),this._notifyUrlChangeListeners(this.prepareExternalUrl(t+Hu(i)),r)}forward(){this._platformStrategy.forward()}back(){this._platformStrategy.back()}historyGo(t=0){var i,r;null===(r=(i=this._platformStrategy).historyGo)||void 0===r||r.call(i,t)}onUrlChange(t){this._urlChangeListeners.push(t),this._urlChangeSubscription||(this._urlChangeSubscription=this.subscribe(i=>{this._notifyUrlChangeListeners(i.url,i.state)}))}_notifyUrlChangeListeners(t="",i){this._urlChangeListeners.forEach(r=>r(t,i))}subscribe(t,i,r){return this._subject.subscribe({next:t,error:i,complete:r})}}return n.\u0275fac=function(t){return new(t||n)(Oe(Cf),Oe(xf))},n.normalizeQueryParams=Hu,n.joinWithSlash=xD,n.stripTrailingSlash=zB,n.\u0275prov=We({factory:Vee,token:n,providedIn:"root"}),n})();function Vee(){return new Pg(Oe(Cf),Oe(xf))}function GB(n){return n.replace(/\/index.html$/,"")}var _s=(()=>((_s=_s||{})[_s.Zero=0]="Zero",_s[_s.One=1]="One",_s[_s.Two=2]="Two",_s[_s.Few=3]="Few",_s[_s.Many=4]="Many",_s[_s.Other=5]="Other",_s))();const Yee=function(n){return function(n){const e=function(n){return n.toLowerCase().replace(/_/g,"-")}(n);let t=pL(e);if(t)return t;const i=e.split("-")[0];if(t=pL(i),t)return t;if("en"===i)return dK;throw new Error(`Missing locale data for the locale "${n}".`)}(n)[cn.PluralCase]};class eS{}let Ste=(()=>{class n extends eS{constructor(t){super(),this.locale=t}getPluralCategory(t,i){switch(Yee(i||this.locale)(t)){case _s.Zero:return"zero";case _s.One:return"one";case _s.Two:return"two";case _s.Few:return"few";case _s.Many:return"many";default:return"other"}}}return n.\u0275fac=function(t){return new(t||n)(Oe(Uu))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();class Cte{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 Af=(()=>{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 Cte(null,this._ngForOf,-1,-1),null===o?void 0:o),l=new ej(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 ej(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)(xe(Ns),xe(zo),xe(Sg))},n.\u0275dir=Rt({type:n,selectors:[["","ngFor","","ngForOf",""]],inputs:{ngForOf:"ngForOf",ngForTrackBy:"ngForTrackBy",ngForTemplate:"ngForTemplate"}}),n})();class ej{constructor(e,t){this.record=e,this.view=t}}let lc=(()=>{class n{constructor(t,i){this._viewContainer=t,this._context=new Tte,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){tj("ngIfThen",t),this._thenTemplateRef=t,this._thenViewRef=null,this._updateView()}set ngIfElse(t){tj("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)(xe(Ns),xe(zo))},n.\u0275dir=Rt({type:n,selectors:[["","ngIf",""]],inputs:{ngIf:"ngIf",ngIfThen:"ngIfThen",ngIfElse:"ngIfElse"}}),n})();class Tte{constructor(){this.$implicit=null,this.ngIf=null}}function tj(n,e){if(e&&!e.createEmbeddedView)throw new Error(`${n} must be a TemplateRef, but received '${rt(e)}'.`)}class Ote{createSubscription(e,t){return e.subscribe({next:t,error:i=>{throw i}})}dispose(e){e.unsubscribe()}onDestroy(e){e.unsubscribe()}}class Rte{createSubscription(e,t){return e.then(t,i=>{throw i})}dispose(e){}onDestroy(e){}}const Nte=new Rte,Pte=new Ote;let h0=(()=>{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(yg(t))return Nte;if(Tk(t))return Pte;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)(xe(Dr,16))},n.\u0275pipe=Vs({name:"async",type:n,pure:!1}),n})(),qr=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=on({type:n}),n.\u0275inj=xt({providers:[{provide:eS,useClass:Ste}]}),n})();const lj="browser";function Tf(n){return n===lj}class BD extends class extends class{}{constructor(){super(...arguments),this.supportsDOMEvents=!0}}{static makeCurrent(){!function(n){GE||(GE=n)}(new BD)}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=(f0=f0||document.querySelector("base"),f0?f0.getAttribute("href"):null);return null==t?null:function(n){nS=nS||document.createElement("a"),nS.setAttribute("href",n);const e=nS.pathname;return"/"===e.charAt(0)?e:`/${e}`}(t)}resetBaseElement(){f0=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 nS,f0=null;const hj=new Ht("TRANSITION_ID"),rne=[{provide:vf,useFactory:function(n,e,t){return()=>{t.get(Og).donePromise.then(()=>{const i=qc(),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},Qn.getAllAngularTestabilities=()=>e.getAllTestabilities(),Qn.getAllAngularRootElements=()=>e.getAllRootElements(),Qn.frameworkStabilizers||(Qn.frameworkStabilizers=[]),Qn.frameworkStabilizers.push(i=>{const r=Qn.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?qc().isShadowRoot(t)?this.findTestabilityInTree(e,t.host,!0):this.findTestabilityInTree(e,t.parentElement,!0):null}}let sne=(()=>{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 p0=new Ht("EventManagerPlugins");let rS=(()=>{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})(),g0=(()=>{class n extends pj{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(gj),this._hostNodes.delete(t)}onStylesAdded(t){this._hostNodes.forEach((i,r)=>{this._addStylesToHost(t,r,i)})}ngOnDestroy(){this._hostNodes.forEach(t=>t.forEach(gj))}}return n.\u0275fac=function(t){return new(t||n)(Oe(pn))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();function gj(n){qc().remove(n)}const UD={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/"},zD=/%COMP%/g;function sS(n,e,t){for(let i=0;i{if("__ngUnwrap__"===e)return n;!1===n(e)&&(e.preventDefault(),e.returnValue=!1)}}let oS=(()=>{class n{constructor(t,i,r){this.eventManager=t,this.sharedStylesHost=i,this.appId=r,this.rendererByCompId=new Map,this.defaultRenderer=new HD(t)}createRenderer(t,i){if(!t||!i)return this.defaultRenderer;switch(i.encapsulation){case Yt.Emulated:{let r=this.rendererByCompId.get(i.id);return r||(r=new vne(this.eventManager,this.sharedStylesHost,i,this.appId),this.rendererByCompId.set(i.id,r)),r.applyToHost(t),r}case 1:case Yt.ShadowDom:return new wne(this.eventManager,this.sharedStylesHost,t,i);default:if(!this.rendererByCompId.has(i.id)){const r=sS(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)(Oe(rS),Oe(g0),Oe(r0))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();class HD{constructor(e){this.eventManager=e,this.data=Object.create(null)}destroy(){}createElement(e,t){return t?document.createElementNS(UD[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=UD[r];s?e.setAttributeNS(s,t,i):e.setAttribute(t,i)}else e.setAttribute(t,i)}removeAttribute(e,t,i){if(i){const r=UD[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&(jo.DashCase|jo.Important)?e.style.setProperty(t,i,r&jo.Important?"important":""):e.style[t]=i}removeStyle(e,t,i){i&jo.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,yj(i)):this.eventManager.addEventListener(e,t,yj(i))}}class vne extends HD{constructor(e,t,i,r){super(e),this.component=i;const s=sS(r+"-"+i.id,i.styles,[]);t.addStyles(s),this.contentAttr=function(n){return"_ngcontent-%COMP%".replace(zD,n)}(r+"-"+i.id),this.hostAttr=function(n){return"_nghost-%COMP%".replace(zD,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 wne extends HD{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=sS(r.id,r.styles,[]);for(let o=0;o{class n extends VD{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)(Oe(pn))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const wj=["alt","control","meta","shift"],Dne={"\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"},Ej={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"},Ine={alt:n=>n.altKey,control:n=>n.ctrlKey,meta:n=>n.metaKey,shift:n=>n.shiftKey};let One=(()=>{class n extends VD{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(()=>qc().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(wj.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&&Ej.hasOwnProperty(e)&&(e=Ej[e]))}return Dne[e]||e}(t);return r=r.toLowerCase()," "===r?r="space":"."===r&&(r="dot"),wj.forEach(s=>{s!=r&&Ine[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)(Oe(pn))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),Mf=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({factory:function(){return Oe($D)},token:n,providedIn:"root"}),n})(),$D=(()=>{class n extends Mf{constructor(t){super(),this._doc=t}sanitize(t,i){if(null==i)return null;switch(t){case ni.NONE:return i;case ni.HTML:return ia(i,"HTML")?Gs(i):z_(this._doc,String(i)).toString();case ni.STYLE:return ia(i,"Style")?Gs(i):i;case ni.SCRIPT:if(ia(i,"Script"))return Gs(i);throw new Error("unsafe value used in a script context");case ni.URL:return Lc(i),ia(i,"URL")?Gs(i):Bo(String(i));case ni.RESOURCE_URL:if(ia(i,"ResourceURL"))return Gs(i);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(n){return new P_(n)}(t)}bypassSecurityTrustStyle(t){return function(n){return new F_(n)}(t)}bypassSecurityTrustScript(t){return function(n){return new Vp(n)}(t)}bypassSecurityTrustUrl(t){return function(n){return new $d(n)}(t)}bypassSecurityTrustResourceUrl(t){return function(n){return new Fn(n)}(t)}}return n.\u0275fac=function(t){return new(t||n)(Oe(pn))},n.\u0275prov=We({factory:function(){return function(n){return new $D(n.get(pn))}(Oe(Pu))},token:n,providedIn:"root"}),n})();const jne=uB(DJ,"browser",[{provide:Wc,useValue:lj},{provide:eB,useValue:function(){BD.makeCurrent(),jD.init()},multi:!0},{provide:pn,useFactory:function(){return function(n){Ki=n}(document),document},deps:[]}]),Vne=[[],{provide:Fu,useValue:"root"},{provide:oa,useFactory:function(){return new oa},deps:[]},{provide:p0,useClass:Ene,multi:!0,deps:[pn,gn,Wc]},{provide:p0,useClass:One,multi:!0,deps:[pn]},[],{provide:oS,useClass:oS,deps:[rS,g0,r0]},{provide:mf,useExisting:oS},{provide:pj,useExisting:g0},{provide:g0,useClass:g0,deps:[pn]},{provide:sD,useClass:sD,deps:[gn]},{provide:rS,useClass:rS,deps:[p0,gn]},{provide:class{},useClass:sne,deps:[]},[]];let WD=(()=>{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:r0,useValue:t.appId},{provide:hj,useExisting:r0},rne]}}}return n.\u0275fac=function(t){return new(t||n)(Oe(n,12))},n.\u0275mod=on({type:n}),n.\u0275inj=xt({providers:Vne,imports:[qr,kJ]}),n})();"undefined"!=typeof window&&window;class Yne extends x{constructor(e,t){super()}schedule(e,t=0){return this}}class aS extends Yne{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 xj=(()=>{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 uc extends xj{constructor(e,t=xj.now){super(e,()=>uc.delegate&&uc.delegate!==this?uc.delegate.now():t()),this.actions=[],this.active=!1,this.scheduled=void 0}schedule(e,t=0,i){return uc.delegate&&uc.delegate!==this?uc.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 Qne=new class extends uc{}(class extends aS{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)}}),Yc=new I(n=>n.complete());function lS(n){return n?function(n){return new I(e=>n.schedule(()=>e.complete()))}(n):Yc}function fn(...n){let e=n[n.length-1];return Ce(e)?(n.pop(),Ne(n,e)):On(n)}function Fg(n,e){return new I(e?t=>e.schedule(Jne,0,{error:n,subscriber:t}):t=>t.error(n))}function Jne({error:n,subscriber:e}){e.error(n)}class pa{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 fn(this.value);case"E":return Fg(this.error);case"C":return lS()}throw new Error("unexpected notification kind value")}static createNext(e){return void 0!==e?new pa("N",e):pa.undefinedValueNotification}static createError(e){return new pa("E",void 0,e)}static createComplete(){return pa.completeNotification}}pa.completeNotification=new pa("C"),pa.undefinedValueNotification=new pa("N",void 0);class cS 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(cS.dispatch,this.delay,new tie(e,this.destination)))}_next(e){this.scheduleMessage(pa.createNext(e))}_error(e){this.scheduleMessage(pa.createError(e)),this.unsubscribe()}_complete(){this.scheduleMessage(pa.createComplete()),this.unsubscribe()}}class tie{constructor(e,t){this.notification=e,this.destination=t}}class kg extends se{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 nie(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 $;if(this.isStopped||this.hasError?o=x.EMPTY:(this.observers.push(e),o=new Z(this,e)),r&&e.add(e=new cS(e,r)),t)for(let a=0;at&&(o=Math.max(o,s-t)),o>0&&r.splice(0,o),r}}class nie{constructor(e,t){this.time=e,this.value=t}}function Ir(n,e){return"function"==typeof e?t=>t.pipe(Ir((i,r)=>je(n(i,r)).pipe(me((s,o)=>e(i,s,r,o))))):t=>t.lift(new iie(n))}class iie{constructor(e){this.project=e}call(e,t){return t.subscribe(new rie(e,this.project))}}class rie extends ve{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 _t(this),r=this.destination;r.add(i),this.innerSubscription=N(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 uS={schedule(n,e){const t=setTimeout(n,e);return()=>clearTimeout(t)},scheduleBeforeRender(n){if("undefined"==typeof window)return uS.schedule(n,0);if(void 0===window.requestAnimationFrame)return uS.schedule(n,16);const e=window.requestAnimationFrame(n);return()=>window.cancelAnimationFrame(e)}};let YD;function pie(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(!YD){const t=Element.prototype;YD=t.matches||t.matchesSelector||t.mozMatchesSelector||t.msMatchesSelector||t.oMatchesSelector||t.webkitMatchesSelector}return n.nodeType===Node.ELEMENT_NODE&&YD.call(n,e)}(n,r)||(i=s,0))),i}class mie{constructor(e,t){this.componentFactory=t.get(wl).resolveComponentFactory(e)}create(e){return new _ie(this.componentFactory,e)}}class _ie{constructor(e,t){this.componentFactory=e,this.injector=t,this.eventEmitters=new kg(1),this.events=this.eventEmitters.pipe(Ir(i=>kn(...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(gn),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=uS.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=Wn.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=uS.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 o_(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 yie extends HTMLElement{constructor(){super(...arguments),this.ngElementEventsSubscription=null}}const vie={initialConfig:{},parse:{},rename:{}};class wie{constructor(e,t){this.configState=e,this.storedChanges={},this.options=Object.assign(Object.assign({},vie),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,u=null!==(s=o[e])&&void 0!==s?s:o[l];if(null==c)delete i[l];else if(u)try{i[l]=u(c)}catch(h){console.warn(`Failed to parse ${e} = ${c}`,h.message)}else i[l]=c}}let Eie=(()=>{class n{constructor(t,i,r={}){this.configState=t,this.cdr=i,this.options=r,this.initialized=!1,this.configManager=new wie(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=Rt({type:n,features:[Ui]}),n})();var KD;const m0={production:!0,disableDbWorker:!0,acceptableViewerDomains:["https://portal.hubmapconsortium.org","https://portal.test.hubmapconsortium.org"],dbOptions:{ccfOwlUrl:"https://ccf-api.hubmapconsortium.org/v1/ccf.owl.n3store.json",ccfContextUrl:"https://hubmapconsortium.github.io/ccf-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/v3/entities/search",hubmapAssetsUrl:"https://assets.hubmapconsortium.org",hubmapToken:null!==(KD=localStorage.getItem("HUBMAP_TOKEN"))&&void 0!==KD?KD:""},googleAnalyticsToken:"portal.hubmapconsortium.org"===window.location.hostname?"G-1WRJHN9FM6":"G-J9HWV9QPJ4"};function rr(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 Aj(n,e){return function(t,i){e(t,i,n)}}function dc(n,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(n,e)}function Fi(n,e,t,i){return new(t||(t=Promise))(function(s,o){function a(u){try{c(i.next(u))}catch(h){o(h)}}function l(u){try{c(i.throw(u))}catch(h){o(h)}}function c(u){u.done?s(u.value):function(s){return s instanceof t?s:new t(function(o){o(s)})}(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})}function Dj(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 QD(){return!("object"==typeof process&&"[object process]"===String(process)&&!process.browser)||Dj()}const Ij="undefined"!=typeof __VERSION__?__VERSION__:"untranspiled source",hS=QD();class Aie{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 ZD(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 Oj={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 Rj(n){return"string"==typeof n?Oj[n.toUpperCase()]||Oj.WHITE:n}function fS(n,e){if(!n)throw new Error(e||"Assertion failed")}const hc={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},_0=hc.window||hc.self||hc.global,Nj=hc.process||{};function Lg(){let n;if(hS&&_0.performance)n=_0.performance.now();else if(Nj.hrtime){const e=Nj.hrtime();n=1e3*e[0]+e[1]/1e6}else n=Date.now();return n}console;const Bg={debug:hS&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},Nie={enabled:!0,level:0};function Tl(){}const Pj={},Fj={once:!0};function Pie(n){for(const e in n)for(const t in n[e])return t||"untitled";return"empty"}let JD=(()=>{class n{constructor({id:t}={id:""}){this.id=t,this.VERSION=Ij,this._startTs=Lg(),this._deltaTs=Lg(),this.LOG_THROTTLE_TIMEOUT=0,this._storage=new Aie("__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((Lg()-this._startTs).toPrecision(10))}getDelta(){return Number((Lg()-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){fS(t,i)}warn(t){return this._getLogFunction(0,t,Bg.warn,arguments,Fj)}error(t){return this._getLogFunction(0,t,Bg.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,Bg.log,arguments,{time:!0,once:!0})}log(t,i){return this._getLogFunction(t,i,Bg.debug,arguments)}info(t,i){return this._getLogFunction(t,i,console.info,arguments)}once(t,i){return this._getLogFunction(t,i,Bg.debug||Bg.info,arguments,Fj)}table(t,i,r){return i?this._getLogFunction(t,i,console.table||Tl,r&&[r],{tag:Pie(i)}):Tl}image({logLevel:t,priority:i,image:r,message:s="",scale:o=1}){return this._shouldLog(t||i)?hS?function({image:n,message:e="",scale:t=1}){if("string"==typeof n){const r=new Image;return r.onload=()=>{const s=ZD(r,e,t);console.log(...s)},r.src=n,Tl}const i=n.nodeName||"";if("img"===i.toLowerCase())return console.log(...ZD(n,e,t)),Tl;if("canvas"===i.toLowerCase()){const r=new Image;return r.onload=()=>console.log(...ZD(r,e,t)),r.src=n.toDataURL(),Tl}return Tl}({image:r,message:s,scale:o}):function({image:n,message:e="",scale:t=1}){let i=null;try{i=Je(307)}catch(r){}return i?()=>i(n,{fit:"box",width:"".concat(Math.round(80*t),"%")}).then(r=>console.log(r)):Tl}({image:r,message:s,scale:o}):Tl}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||Tl)}group(t,i,r={collapsed:!1}){r=Lj({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||Tl)}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()>=kj(t)}_getLogFunction(t,i,r,s=[],o){if(this._shouldLog(t)){o=Lj({logLevel:t,message:i,args:s,opts:o}),fS(r=r||o.method),o.total=this.getTotal(),o.delta=this.getDelta(),this._deltaTs=Lg();const a=o.tag||o.message;if(o.once){if(Pj[a])return Tl;Pj[a]=Lg()}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!hS&&"string"==typeof n&&(e&&(e=Rj(e),n="\x1b[".concat(e,"m").concat(n,"\x1b[39m")),t&&(e=Rj(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 Tl}}return n.VERSION=Ij,n})();function kj(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 fS(Number.isFinite(e)&&e>=0),e}function Lj(n){const{logLevel:e,message:t}=n;n.logLevel=kj(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 fS("string"===r||"object"===r),Object.assign(n,n.opts)}const Ri=new JD({id:"deck"}),ji={DEFAULT:-1,LNGLAT:1,METER_OFFSETS:2,LNGLAT_OFFSETS:3,CARTESIAN:0};Object.defineProperty(ji,"IDENTITY",{get:()=>Ri.deprecated("COORDINATE_SYSTEM.IDENTITY","COORDINATE_SYSTEM.CARTESIAN")()||0});const Kc={WEB_MERCATOR:1,GLOBE:2,WEB_MERCATOR_AUTO_OFFSET:4,IDENTITY:0},Bj={click:{handler:"onClick"},panstart:{handler:"onDragStart"},panmove:{handler:"onDrag"},panend:{handler:"onDragEnd"}},mn=new JD({id:"luma.gl"});function $o(n,e){if(!n)throw new Error(e||"luma.gl: assertion failed.")}function pS(n){return"undefined"!=typeof WebGLRenderingContext&&n instanceof WebGLRenderingContext||"undefined"!=typeof WebGL2RenderingContext&&n instanceof WebGL2RenderingContext||Boolean(n&&Number.isFinite(n._version))}function Si(n){return"undefined"!=typeof WebGL2RenderingContext&&n instanceof WebGL2RenderingContext||Boolean(n&&2===n._version)}function gS(n){return $o(pS(n),"Invalid WebGLRenderingContext"),n}function Co(n){return $o(Si(n),"Requires WebGL2"),n}const y0={};const b0=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{globalThis.console&&globalThis.console.log&&globalThis.console.log("OESVertexArrayObject emulation library context restored"),t.reset_()},!0),this.reset_()};Df.prototype.VERTEX_ARRAY_BINDING_OES=34229,Df.prototype.reset_=function(){if(void 0!==this.vertexArrayObjects)for(let i=0;iSi(n)?void 0:0,tre={3074:n=>Si(n)?void 0:36064,35723:n=>Si(n)?void 0:4352,35977:br,32937:br,36795:(n,e)=>{const t=Si(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(Uj);return e(t&&t.UNMASKED_VENDOR_WEBGL||7936)},37446:(n,e)=>{const t=n.getExtension(Uj);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:br,35071:br,37447:br,36063:(n,e)=>{if(!Si(n)){const t=n.getExtension(Vj);return t?e(t.MAX_COLOR_ATTACHMENTS_WEBGL):0}},35379:br,35374:br,35377:br,34852:n=>{if(!Si(n)){const e=n.getExtension(Vj);return e?e.MAX_DRAW_BUFFERS_WEBGL:0}},36203:n=>n.getExtension(jj)?2147483647:65535,33001:n=>n.getExtension(jj)?16777216:65535,33e3:n=>16777216,37157:br,35373:br,35657:br,36183:br,37137:br,34045:br,35978:br,35979:br,35968:br,35376:br,35375:br,35659:br,37154:br,35371:br,35658:br,35076:br,35077:br,35380:br},zj="ANGLE_instanced_arrays",Hj={OES_vertex_array_object:{meta:{suffix:"OES"},createVertexArray:()=>{$o(!1,"VertexArray requires WebGL2 or OES_vertex_array_object extension")},deleteVertexArray:()=>{},bindVertexArray:()=>{},isVertexArray:()=>!1},[zj]:{meta:{suffix:"ANGLE"},vertexAttribDivisor(n,e){$o(0===e,"WebGL instanced rendering not supported")},drawElementsInstanced:()=>{},drawArraysInstanced:()=>{}},WEBGL_draw_buffers:{meta:{suffix:"WEBGL"},drawBuffers:()=>{$o(!1)}},EXT_disjoint_timer_query:{meta:{suffix:"EXT"},createQuery:()=>{$o(!1)},deleteQuery:()=>{$o(!1)},beginQuery:()=>{$o(!1)},endQuery:()=>{},getQuery(n,e){return this.getQueryObject(n,e)},getQueryParameter(n,e){return this.getQueryObject(n,e)},getQueryObject:()=>{}}},eI={readBuffer:(n,e,t)=>{Si(n)&&e(t)},getVertexAttrib:(n,e,t,i)=>{const{webgl2:r,ext:s}=function(n,e){return{webgl2:Si(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(!Si(n))switch(i){case 35967:return 35981;case 35971:case 35382:return 0}return e(t,i)},getInternalformatParameter:(n,e,t,i,r)=>{if(!Si(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=tre[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 fre(n,{extension:e,target:t,target2:i}){const r=Hj[e];$o(r);const{meta:s={}}=r,{suffix:o=""}=s,a=n.getExtension(e);for(const l of Object.keys(r)){const c=`${l}${o}`;let u=null;"meta"===l||"function"==typeof n[l]||(a&&"function"==typeof a[c]?u=(...h)=>a[c](...h):"function"==typeof r[l]&&(u=r[l].bind(t))),u&&(t[l]=u,i[l]=u)}}globalThis.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 Df(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&&fre(n,{extension:t,target:n.luma,target2:n})}(n,Hj),function(n,{target:e,target2:t}){Object.keys(eI).forEach(i=>{if("function"==typeof eI[i]){const r=n[i]?n[i].bind(n):()=>{},s=eI[i].bind(null,n,r);e[i]=s,t[i]=s}})}(n,{target:e,target2:n}),e.polyfilled=!0),n};const tI={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},oh=(n,e,t)=>e?n.enable(t):n.disable(t),Gj=(n,e,t)=>n.hint(t,e),ja=(n,e,t)=>n.pixelStorei(t,e);function v0(n){return Array.isArray(n)||ArrayBuffer.isView(n)}const mre={3042:oh,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:oh,2885:(n,e)=>n.cullFace(e),2929:oh,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:oh,35723:Gj,36006:(n,e)=>{const t=Si(n)?36009:36160;return n.bindFramebuffer(t,e)},2886:(n,e)=>n.frontFace(e),33170:Gj,2849:(n,e)=>n.lineWidth(e),32823:oh,32824:"polygonOffset",10752:"polygonOffset",35977:oh,32938:"sampleCoverage",32939:"sampleCoverage",3089:oh,3088:(n,e)=>n.scissor(...e),2960:oh,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:ja,3317:ja,37440:ja,37441:ja,37443:ja,3330:ja,3332:ja,3331:ja,36010:(n,e)=>n.bindFramebuffer(36008,e),3314:ja,32878:ja,3316:ja,3315:ja,32877:ja,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=v0(e)?e:[e,e],n.blendEquationSeparate(...e)},blendFunc:(n,e)=>{e=v0(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=v0(e)?e:[e,e];const[t,i]=e;n.stencilMaskSeparate(1028,t),n.stencilMaskSeparate(1029,i)},stencilFunc:(n,e)=>{e=v0(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=v0(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 os(n,e,t){return void 0!==e[n]?e[n]:t[n]}const _re={blendEquation:(n,e,t)=>n.blendEquationSeparate(os(32777,e,t),os(34877,e,t)),blendFunc:(n,e,t)=>n.blendFuncSeparate(os(32969,e,t),os(32968,e,t),os(32971,e,t),os(32970,e,t)),polygonOffset:(n,e,t)=>n.polygonOffset(os(32824,e,t),os(10752,e,t)),sampleCoverage:(n,e,t)=>n.sampleCoverage(os(32938,e,t),os(32939,e,t)),stencilFuncFront:(n,e,t)=>n.stencilFuncSeparate(1028,os(2962,e,t),os(2967,e,t),os(2963,e,t)),stencilFuncBack:(n,e,t)=>n.stencilFuncSeparate(1029,os(34816,e,t),os(36003,e,t),os(36004,e,t)),stencilOpFront:(n,e,t)=>n.stencilOpSeparate(1028,os(2964,e,t),os(2965,e,t),os(2966,e,t)),stencilOpBack:(n,e,t)=>n.stencilOpSeparate(1029,os(34817,e,t),os(34818,e,t),os(34819,e,t))},$j={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]})},Xc=(n,e)=>n.isEnabled(e),Wj={3042:Xc,2884:Xc,2929:Xc,3024:Xc,32823:Xc,32926:Xc,32928:Xc,3089:Xc,2960:Xc,35977:Xc};function qj(n){for(const e in n)return!1;return!0}function yre(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||tI)){const r=e,s=Wj[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=Wj[r];i[r]=s?s(n,Number(r)):n.getParameter(Number(r))}return i}(e):Object.assign({},tI),this.log=i,this._updateCache=this._updateCache.bind(this),Object.seal(this)}push(e={}){this.stateStack.push({})}pop(){$o(this.stateStack.length>0),$u(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){$o(void 0!==s);const o=e[s],a=this.cache[s];yre(o,a)||(t=!0,i=a,r&&!(s in r)&&(r[s]=a),this.cache[s]=o)}return{valueChanged:t,oldValue:i}}}function Kj(n,e={}){const{enable:t=!0,copyState:i}=e;if($o(void 0!==i),!n.state){const{polyfillContext:r}=globalThis;r&&r(n),n.state=new wre(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 s in $j)bre(n,s,$j[s]);Yj(n,"getParameter"),Yj(n,"isEnabled")}return n.state.enable=t,n}function Xj(n){$o(n.state),n.state.pop()}function $u(n,e){if($o(pS(n),"setParameters requires a WebGL context"),qj(e))return;const t={};for(const r in e){const s=Number(r),o=mre[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)_re[r](n,e,i)}function fc(n,e,t){if(qj(e))return t(n);const{nocatch:i=!0}=e;let r;if(function(n){n.state||Kj(n,{copyState:!1}),n.state.push()}(n),$u(n,e),i)r=t(n),Xj(n);else try{r=t(n)}finally{Xj(n)}return r}function mS(){return!("object"==typeof process&&"[object process]"===String(process)&&!process.browser)||function(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;return!!(e&&e.indexOf("Electron")>=0)}()}function jg(n){const{luma:e}=n;if(n.canvas&&e){const{clientWidth:t}=e.canvasSizeInfo;return t?n.drawingBufferWidth/t:1}return 1}function nI(n,e,t=!0){return function(n,e,t,i,r){const s=Qj(n[0],e,t);let o=Zj(n[1],e,i,r),a=Qj(n[0]+1,e,t);const l=a===t-1?a:a-1;let c;return a=Zj(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,jg(n),n.drawingBufferWidth,n.drawingBufferHeight,t)}function Qj(n,e,t){return Math.min(Math.round(n*e),t-1)}function Zj(n,e,t,i){return i?Math.max(0,t-1-Math.round(n*e)):Math.min(Math.round(n*e),t-1)}const iI=mS(),Mre=iI&&"undefined"!=typeof document,Jj={webgl2:!0,webgl1:!0,throwOnError:!0,manageState:!0,canvas:null,debug:!1,width:800,height:600};function eV(n={}){$o(iI,"createGLContext only available in the browser.\nCreate your own headless context or use 'createHeadlessContext' from @luma.gl/test-utils"),n=Object.assign({},Jj,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?(Mre&&"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=rI(r,n),function(n){const e=Si(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);mn.info(1,`${e}${n.debug?" debug":""} context ${t?`(${t.vendor},${t.renderer})`:""}`)()}(r),r):null}function rI(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({},Jj,e);const{manageState:t,debug:i}=e;return t&&Kj(n,{copyState:!1,log:(...r)=>mn.log(1,...r)()}),iI&&i&&(globalThis.makeDebugContext?(n=globalThis.makeDebugContext(n,e),mn.level=Math.max(mn.level,1)):mn.warn('WebGL debug mode not activated. import "@luma.gl/debug" to enable.')()),n._instrumented=!0,n}function tV(){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 nV{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=tV(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(tV()-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 sI{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 nV?e:new nV(t,i)),this.stats[t]}}const w0="8.5.12",If=new class{constructor(){this.stats=new Map}get(e){return this.stats.has(e)||this.stats.set(e,new sI({id:e})),this.stats.get(e)}};if(globalThis.luma&&globalThis.luma.VERSION!==w0)throw new Error(`luma.gl - multiple VERSIONs detected: ${globalThis.luma.VERSION} vs ${w0}`);function tn(n,e){if(!n)throw new Error(e||"luma.gl: assertion failed.")}function oI(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 ah(n,e){e=Number(e);for(const t in n)if(n[t]===e)return`GL.${t}`;return String(e)}globalThis.luma||(mS()&&mn.log(1,`luma.gl ${w0} - set luma.log.level=1 (or higher) to trace rendering`)(),globalThis.luma=globalThis.luma||{VERSION:w0,version:w0,log:mn,stats:If,globals:{modules:{},nodeIO:{}}}),globalThis;const aI={};function ga(n="id"){return aI[n]=aI[n]||1,`${n}-${aI[n]++}`}function iV(n){return tn("number"==typeof n,"Input must be a number"),n&&0==(n&n-1)}function Vg(n){let e=!0;for(const t in n){e=!1;break}return e}function rV(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 mn.removed(`Calling removed method ${e}.${o}: `,r)(),new Error(o)})})}const Ug="Resource subclass must define virtual methods";class Wu{get[Symbol.toStringTag](){return"Resource"}constructor(e,t={}){gS(e);const{id:i,userData:r={}}=t;this.gl=e,this.gl2=e,this.id=i||ga(this[Symbol.toStringTag]),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[Symbol.toStringTag]||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=oI(this.gl,e));const r=(this.constructor.PARAMETERS||{})[e];if(r){const s=Si(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=Si(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 h=i?ah(this.gl,l):l;o[h]=this.getParameter(l,e),i&&"GLenum"===c.type&&(o[h]=ah(this.gl,o[h]))}}return o}setParameter(e,t){tn(e=oI(this.gl,e));const r=(this.constructor.PARAMETERS||{})[e];if(r){const s=Si(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=oI(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 rV(this,e,t,i)}initialize(e){}_createHandle(){throw new Error(Ug)}_deleteHandle(){throw new Error(Ug)}_bindHandle(e){throw new Error(Ug)}_getOptsFromHandle(){throw new Error(Ug)}_getParameter(e,t){throw new Error(Ug)}_setParameter(e,t){throw new Error(Ug)}_context(){return this.gl.luma=this.gl.luma||{},this.gl.luma}_addStats(){const e=this[Symbol.toStringTag],t=If.get("Resource Counts");t.get("Resources Created").incrementCount(),t.get(`${e}s Created`).incrementCount(),t.get(`${e}s Active`).incrementCount()}_removeStats(){const e=this[Symbol.toStringTag];If.get("Resource Counts").get(`${e}s Active`).decrementCount()}_trackAllocatedMemory(e,t=this[Symbol.toStringTag]){const i=If.get("Memory Usage");i.get("GPU Memory").addCount(e),i.get(`${t} Memory`).addCount(e),this.byteLength=e}_trackDeallocatedMemory(e=this[Symbol.toStringTag]){const t=If.get("Memory Usage");t.get("GPU Memory").subtractCount(this.byteLength),t.get(`${e} Memory`).subtractCount(this.byteLength),this.byteLength=0}}function lI(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 E0(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 Vre({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 ma.getBytesPerElement(this)}get BYTES_PER_VERTEX(){return ma.getBytesPerVertex(this)}_assign(e={}){return void 0!==(e=cI("Accessor",e,zre)).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 oV={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:oV},Gre={removedProps:oV};class hr extends Wu{get[Symbol.toStringTag](){return"Buffer"}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/ma.getBytesPerElement(e))}getVertexCount(e=this.accessor){return Math.round(this.byteLength/ma.getBytesPerVertex(e))}initialize(e={}){return ArrayBuffer.isView(e)&&(e={data:e}),Number.isFinite(e)&&(e={byteLength:e}),e=cI("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=cI("Buffer",e,Gre))&&this.setAccessor(e.accessor),this}setAccessor(e){return delete(e=Object.assign({},e)).buffer,this.accessor=new ma(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?(Co(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 Co(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}={}){Co(this.gl);const s=E0(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 u=Math.min(o,l);return tn((r=r||u)<=u),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=lI(e);return tn(s),this.setAccessor(new ma(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/E0(this.accessor.type||5126,{clamped:!1}).BYTES_PER_ELEMENT;return this.getElementCount()-i}_inferType(e){this.accessor.type||this.setAccessor(new ma(this.accessor,{type:lI(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 mn.deprecated("Buffer.type","Buffer.accessor.type")(),this.accessor.type}get bytes(){return mn.deprecated("Buffer.bytes","Buffer.byteLength")(),this.byteLength}setByteLength(e){return mn.deprecated("setByteLength","reallocate")(),this.reallocate(e)}updateAccessor(e){return mn.deprecated("updateAccessor(...)","setAccessor(new Accessor(buffer.accessor, ...)")(),this.accessor=new ma(this.accessor,e),this}}const uI={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}},aV={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},lV={5126:4,5125:4,5124:4,5123:2,5122:2,5131:2,5120:1,5121:1},qre=[9729,9728],cV=globalThis.WebGLBuffer||function(){};class Of extends Wu{get[Symbol.toStringTag](){return"Texture"}static isSupported(e,t={}){const{format:i,linearFiltering:r}=t;let s=!0;return i&&(s=s&&function(n,e){const t=uI[e];if(!t)return!1;if(void 0===t.gl1&&void 0===t.gl2)return!0;const i=Si(n)&&t.gl2||t.gl1;return"string"==typeof i?n.getExtension(i):i}(e,i),s=s&&(!r||function(n,e){const t=uI[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=ga("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(U=>this.initialize(Object.assign({},e,{pixels:U,data:U}))),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:u}=e;t||(t=r);let{width:h,height:p,dataFormat:g,type:m,compressed:w=!1,mipmaps:C=!0}=e;const{depth:H=0}=e;return({width:h,height:p,compressed:w,dataFormat:g,type:m}=this._deduceParameters({format:s,type:m,dataFormat:g,compressed:w,data:t,width:h,height:p})),this.width=h,this.height=p,this.depth=H,this.format=s,this.type=m,this.dataFormat=g,this.border=o,this.textureUnit=u,Number.isFinite(this.textureUnit)&&(this.gl.activeTexture(33984+this.textureUnit),this.gl.bindTexture(this.target,this.handle)),C&&this._isNPOT()&&(mn.warn(`texture: ${this} is Non-Power-Of-Two, disabling mipmaping`)(),C=!1,this._updateForNPOT(l)),this.mipmaps=C,this.setImageData({data:t,width:h,height:p,depth:H,format:s,type:m,dataFormat:g,border:o,mipmaps:C,parameters:c,compressed:w}),C&&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:u=this.type,width:h=this.width,height:p=this.height,dataFormat:g=this.dataFormat,compressed:m=!1}=e;c||(c=i),({type:u,dataFormat:g,compressed:m,width:h,height:p}=this._deduceParameters({format:s,type:u,dataFormat:g,compressed:m,data:c,width:h,height:p}));const{gl:w}=this;w.bindTexture(this.target,this.handle);let C=null;({data:c,dataType:C}=this._getDataType({data:c,compressed:m}));let H,U=0;return fc(this.gl,l,()=>{switch(C){case"null":w.texImage2D(t,r,s,h,p,o,g,u,c);break;case"typed-array":w.texImage2D(t,r,s,h,p,o,g,u,c,a);break;case"buffer":H=Co(w),H.bindBuffer(35052,c.handle||c),H.texImage2D(t,r,s,h,p,o,g,u,a),H.bindBuffer(35052,null);break;case"browser-object":Si(w)?w.texImage2D(t,r,s,h,p,o,g,u,c):w.texImage2D(t,r,s,g,u,c);break;case"compressed":for(const[de,Ae]of c.entries())w.compressedTexImage2D(t,de,Ae.format,Ae.width,Ae.height,o,Ae.data),U+=Ae.levelSize;break;default:tn(!1,"Unknown image data type")}}),this._trackAllocatedMemory("compressed"===C?U:c&&c.byteLength?c.byteLength:this.width*this.height*(aV[this.dataFormat]||4)*(lV[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:u=this.type,dataFormat:h=this.dataFormat,compressed:p=!1,offset:g=0,border:m=this.border,parameters:w={}}){if(({type:u,dataFormat:h,compressed:p,width:o,height:a}=this._deduceParameters({format:c,type:u,dataFormat:h,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 C=i;i=C.data,o=C.shape[0],a=C.shape[1]}i instanceof hr&&(i=i.handle),this.gl.bindTexture(this.target,this.handle),fc(this.gl,w,()=>{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,h,u,null);else if(ArrayBuffer.isView(i))this.gl.texSubImage2D(e,l,r,s,o,a,h,u,i,g);else if(i instanceof cV){const C=Co(this.gl);C.bindBuffer(35052,i),C.texSubImage2D(e,l,r,s,o,a,h,u,g),C.bindBuffer(35052,null)}else Si(this.gl)?Co(this.gl).texSubImage2D(e,l,r,s,o,a,h,u,i):this.gl.texSubImage2D(e,l,r,s,h,u,i)}),this.gl.bindTexture(this.target,null)}copyFramebuffer(e={}){return mn.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 hr?{data:e.handle,dataType:"buffer"}:e instanceof cV?{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=uI[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!(Si(this.gl)||!this.width||!this.height||iV(this.width)&&iV(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===qre.indexOf(t)&&(t=9729);break;case 10242:case 10243:33071!==t&&(t=33071)}return t}}function Yre(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 _a extends Of{get[Symbol.toStringTag](){return"Texture2D"}static isSupported(e,t){return Of.isSupported(e,t)}constructor(e,t={}){gS(e),(t instanceof Promise||"string"==typeof t)&&(t={data:t}),"string"==typeof t.data&&(t=Object.assign({},t,{data:Yre(t.data)})),super(e,Object.assign({},t,{target:3553})),this.initialize(t),Object.seal(this)}}const Rf="EXT_color_buffer_float",uV={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:Rf,bpp:2},33327:{gl2:Rf,bpp:4},34842:{gl2:Rf,bpp:8},33326:{gl2:Rf,bpp:4},33328:{gl2:Rf,bpp:8},34836:{gl2:Rf,bpp:16},35898:{gl2:Rf,bpp:4}};class zg extends Wu{get[Symbol.toStringTag](){return"Renderbuffer"}static isSupported(e,{format:t}={format:null}){return!t||function(n,e,t){const i=t[e];if(!i)return!1;const r=Si(n)&&i.gl2||i.gl1;return"string"==typeof r?n.getExtension(r):r}(e,t,uV)}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&&Si(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)*uV[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 gV="clear: bad arguments";function hI(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,gV),fc(n,s,()=>{n.clear(o)})}function mV(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 oi(n){return function(){var e=this,t=arguments;return new Promise(function(i,r){var s=n.apply(e,t);function o(l){mV(s,i,r,o,a,"next",l)}function a(l){mV(s,i,r,o,a,"throw",l)}o(void 0)})}}const fI=[34069,34070,34071,34072,34073,34074];let tse=(()=>{class n extends Of{get[Symbol.toStringTag](){return"TextureCube"}constructor(t,i={}){gS(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 oi(function*(){const{gl:u}=c,h=r||s,p=yield Promise.all(fI.map(g=>{const m=h[g];return Promise.all(Array.isArray(m)?m:[m])}));c.bind(),fI.forEach((g,m)=>{p[m].length>1&&!1!==c.opts.mipmaps&&mn.warn(`${c.id} has mipmap and multiple LODs.`)(),p[m].forEach((w,C)=>{t&&i?u.texImage2D(g,C,a,t,i,o,a,l,w):u.texImage2D(g,C,a,a,l,w)})}),c.unbind()})()}setImageDataForFace(t){const{face:i,width:r,height:s,pixels:o,data:a,border:l=0,format:c=6408,type:u=5121}=t,{gl:h}=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?h.texImage2D(i,0,c,r,s,l,c,u,p):h.texImage2D(i,0,c,c,u,p),this}}return n.FACES=fI,n})();class nse extends Of{get[Symbol.toStringTag](){return"Texture3D"}static isSupported(e){return Si(e)}constructor(e,t={}){Co(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:u,parameters:h={}}){return this._trackDeallocatedMemory("Texture"),this.gl.bindTexture(this.target,this.handle),fc(this.gl,h,()=>{ArrayBuffer.isView(u)&&this.gl.texImage3D(this.target,e,t,i,r,s,o,a,l,u),u instanceof hr&&(this.gl.bindBuffer(35052,u.handle),this.gl.texImage3D(this.target,e,t,i,r,s,o,a,l,c))}),this._trackAllocatedMemory(u&&u.byteLength?u.byteLength:this.width*this.height*this.depth*(aV[this.dataFormat]||4)*(lV[this.type]||1),"Texture"),this.loaded=!0,this}}function _V(n,e){tn(n instanceof _a||n instanceof tse||n instanceof nse);const t=n.constructor,{gl:i,width:r,height:s,format:o,type:a,dataFormat:l,border:c,mipmaps:u}=n;return new t(i,Object.assign({width:r,height:s,format:o,type:a,dataFormat:l,border:c,mipmaps:u},e))}function ise(n,e){const{gl:t,width:i,height:r,id:s}=n;return new Fs(t,Object.assign({},e,{id:`framebuffer-for-${s}`,width:i,height:r,attachments:{36064:n}}))}function _S(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:u,deleteFramebuffer:h}=S0(n);tn(u);const{gl:p,handle:g,attachments:m}=u;a=a||u.width,l=l||u.height,36064===s&&null===g&&(s=1028),tn(m[s]),c=c||m[s].type,o=function(n,e,t,i,r){if(n)return n;return new(E0(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||lI(o);const w=p.bindFramebuffer(36160,g);return p.readPixels(t,i,a,l,r,c,o),p.bindFramebuffer(36160,w||null),h&&u.delete(),o}function pI(n,{sourceAttachment:e=36064,targetMaxHeight:t=Number.MAX_SAFE_INTEGER}={}){let i=_S(n,{sourceAttachment:e}),{width:r,height:s}=n;for(;s>t;)({data:i,width:r,height:s}=Vre({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 u in i){const h=i[u];(Array.isArray(h)?h[0]:h).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&&mn.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 zg)this._attachRenderbuffer({attachment:a,renderbuffer:c});else if(Array.isArray(l)){const[u,h=0,p=0]=l;c=u,this._attachTexture({attachment:a,texture:u,layer:h,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(Fs.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)&&hI(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]}={}){Co(n),fc(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,gV)}})}(this.gl,{drawBuffer:l,value:a})}),this.gl.bindFramebuffer(36160,o||null),this}readPixels(e={}){return mn.error("Framebuffer.readPixels() is no logner supported, use readPixelsToArray(framebuffer)")(),null}readPixelsToBuffer(e={}){return mn.error("Framebuffer.readPixelsToBuffer()is no logner supported, use readPixelsToBuffer(framebuffer)")(),null}copyToDataUrl(e={}){return mn.error("Framebuffer.copyToDataUrl() is no logner supported, use copyToDataUrl(framebuffer)")(),null}copyToImage(e={}){return mn.error("Framebuffer.copyToImage() is no logner supported, use copyToImage(framebuffer)")(),null}copyToTexture(e={}){return mn.error("Framebuffer.copyToTexture({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null}blit(e={}){return mn.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=Co(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=ah(this.gl,r)),r}getAttachmentParameters(e=36064,t,i=this.constructor.ATTACHMENT_PARAMETERS||[]){const r={};for(const s of i)r[t?ah(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?ah(this.gl,s):s]=this.getAttachmentParameters(s,e)}return i}show(){return"undefined"!=typeof window&&window.open(pI(this),"luma-debug-texture"),this}log(e=0,t=""){if(e>mn.level||"undefined"==typeof window)return this;t=t||`Framebuffer ${this.id}`;const i=pI(this,{targetMaxHeight:100});return mn.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 _a(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 zg(this.gl,{id:`${this.id}-depth-stencil`,format:35056,width:r,height:111}),this.ownResources.push(o[33306])):t?(o=o||{},o[36096]=new zg(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 zg?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:Co(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 Si(n)?n:null}(this.gl);t?t.readBuffer(e):tn(36064===e||1029===e,yV),this.readBuffer=e}_setDrawBuffers(e){const{gl:t}=this,i=Co(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]),yV)}this.drawBuffers=e}_getAttachmentParameterFallback(e){const t=function(n){n.luma=n.luma||{},n.luma.caps=n.luma.caps||{};for(const e in bV)void 0===n.luma.caps[e]&&(n.luma.caps[e]=wV(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)}}Fs.ATTACHMENT_PARAMETERS=[36049,36048,33296,33298,33299,33300,33301,33302,33303];const bV={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 _a(n,{format:6408,type:5126,dataFormat:6408}),t=new Fs(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 gI(n,e){return vV(n,e)}function vV(n,e){return(e=Array.isArray(e)?e:[e]).every(t=>wV(n,t))}function wV(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=bV[e];let i;tn(t,e);const r=Si(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]||mn.log(2,`Feature: ${e} not supported`)(),n.luma.caps[e]}class mI{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()}},gse=1/Math.PI*180,mse=1/180*Math.PI,Or={};function yse(n,{precision:e=Or.precision||4}={}){return n=function(n){return Math.round(n/Or.EPSILON)*Or.EPSILON}(n),`${parseFloat(n.toPrecision(e))}`}function lh(n){return Array.isArray(n)||ArrayBuffer.isView(n)&&!(n instanceof DataView)}function qu(n,e,t){if(lh(n)){t=t||function(n){return n.clone?n.clone():new Array(n.length)}(n);for(let i=0;it*mse,void 0)}(n)}function vse(n){return function(n,e){return qu(n,t=>t*gse,void 0)}(n)}function Va(n,e,t){return qu(n,i=>Math.max(e,Math.min(t,i)))}function yS(n,e,t){return lh(n)?n.map((i,r)=>yS(i,e[r],t)):t*e+(1-t)*n}function C0(n,e,t){const i=Or.EPSILON;t&&(Or.EPSILON=t);try{if(n===e)return!0;if(lh(n)&&lh(e)){if(n.length!==e.length)return!1;for(let r=0;r0?", ":"")+yse(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&&(LV.length=n.length,i=LV):i=kV,(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 BV(n){return n&&n[Symbol.asyncIterator]}function EI(n,e=(()=>!0)){return Array.isArray(n)?jV(n,e,[]):e(n)?[n]:[]}function jV(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 VV(n,e){return n?(Number.isFinite(n)&&(n={duration:n}),n.type=n.type||"interpolation",ot(ot(ot({},qse[n.type]),e),n)):null}function UV(n,e){return e.getBuffer()?[e.getBuffer(),{divisor:0,size:e.size,normalized:e.settings.normalized}]:e.value}function zV(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 HV(n){n.push(n.shift())}function xI(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 GV({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,u=r&&c,h=xI(t,e),p=t.state.constant;if(!u&&i>=h)return;const g=p?t.value:t.getBuffer().getData({srcByteOffset:l});if(t.settings.normalized&&!p){const H=s;s=(U,de)=>t._normalizeConstant(H(U,de))}const m=p?(H,U)=>s(g,U):(H,U)=>s(g.subarray(H,H+a),U),w=n.getData({length:i}),C=new Float32Array(h);(function({source:n,target:e,size:t,getData:i,sourceStartIndices:r,targetStartIndices:s}){if(!Array.isArray(s))return SI({source:n,target:e,size:t,getData:i}),e;let o=0,a=0;const l=i&&((u,h)=>i(u+a,h)),c=Math.min(r.length,s.length);for(let u=1;u(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===SS||(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=SS}clearNeedsUpdate(){this.state.needsUpdate=!1,this.state.updateRanges=Gse}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!==SS}),!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,u]of s)o.call(r,this,{data:t,startRow:c,endRow:u,props:i,numInstances:e});if(this.value)if(this.constant||this.buffer.byteLength{if(!r){const C=h*a+l;for(let H=0;Hu?c.set(de,w):(e._normalizeValue(de,H.target,0),Hse({target:c,source:H.target,start:w,count:Ae}));w+=Ae*u}else e._normalizeValue(de,c,w),w+=u}}_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 AI={};function To(n){Ri.level>0&&AI[n]&&AI[n].call(...arguments)}function Ua(n,e){if(!n)throw new Error(e||"shadertools: assertion failed.")}const $V="out vec4 transform_output;\nvoid main() {\n transform_output = vec4(0);\n}",Xse=`#version 300 es\n${$V}`;function WV(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 qV(n={}){const{version:e=100,input:t,inputType:i,output:r}=n;if(!t)return 300===e?Xse:e>300?`#version ${e}\n${$V}`:"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 Ua(!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 YV extends Wu{get[Symbol.toStringTag](){return"TransformFeedback"}static isSupported(e){return Si(e)}constructor(e,t={}){Co(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,Vg(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,mn.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 hr?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 eoe{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 hr?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(Si(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 YV(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 hr)}return{sourceBuffers:t,feedbackBuffers:i}}_createNewBuffer(e,t){const i=new hr(this.gl,t);return this.resources[e]&&this.resources[e].delete(),this.resources[e]=i,i}_getNextIndex(){return(this.currentIndex+1)%2}}function KV(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 D0="vs",ioe={[D0]:"#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"},xS="__LUMA_INJECT_DECLARATIONS__",XV=/void\s+main\s*\([^)]*\)\s*\{\n?/,QV=/}\n?[^{}]*$/,MI=[];function ZV(n,e,t,i=!1){const r=e===D0;for(const s in t){const o=t[s];o.sort((l,c)=>l.order-c.order),MI.length=o.length;for(let l=0,c=o.length;ll+a));break;case"vs:#main-end":r&&(n=n.replace(QV,l=>a+l));break;case"fs:#decl":r||(n=n.replace(xS,a));break;case"fs:#main-start":r||(n=n.replace(XV,l=>l+a));break;case"fs:#main-end":r||(n=n.replace(QV,l=>a+l));break;default:n=n.replace(s,l=>l+a)}}return n=n.replace(xS,""),i&&(n=n.replace(/\}\s*$/,s=>s+ioe[e])),n}function DI(n){const e={};return Ua(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 roe={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},CS="transform_uSize_",JV="transform_position";const hoe={10241:9728,10240:9728,10242:33071,10243:33071};class poe{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 h in this.samplerTextureMap)a[h]=i[this.samplerTextureMap[h]];this._setSourceTextureParameters();const u=function({sourceTextureMap:n,targetTextureVarying:e,targetTexture:t}){const i={};let r,s;e&&(({width:r,height:s}=t),i[`${CS}${e}`]=[r,s]);for(const o in n)({width:r,height:s}=n[o]),i[`${CS}${o}`]=[r,s];return i}({sourceTextureMap:i,targetTextureVarying:this.targetTextureVarying,targetTexture:s});Object.assign(a,u)}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=_S(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 Ua(!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 hr(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 Fs(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(hoe)}_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=_V(e,{parameters:{10241:9728,10240:9728,10242:33071,10243:33071},pixelStore:{37440:!1}});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 u=l.split("\n"),h=u.slice();if(u.forEach((p,g,m)=>{if(s>0){const w=function(n,e){const t={},i=function(n){return WV(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=`${CS}${n}`;return{samplerName:e,sizeName:t,uniformDeclerations:` uniform sampler2D ${e};\n uniform vec2 ${t};`}}(s),h=` ${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 Ua(!1),null}}(r)};\n`;return t[a]=s,{updatedLine:o,inject:{"vs:#decl":c,"vs:#main-start":h},samplerTextureMap:t}}return null}(p,e);if(w){const{updatedLine:C,inject:H}=w;h[g]=C,c=DI([c,H]),Object.assign(a,w.samplerTextureMap),s--}}t&&!o&&(o=function(n,e){const t=WV(n,["varying","out"]);return t&&t.name===e?t.type:null}(p,t))}),t){tn(i);const p=`${CS}${t}`;c=DI([c,{"vs:#decl":`uniform vec2 ${p};\n`,"vs:#main-start":` vec2 ${JV} = transform_getPos(${p});\n gl_Position = vec4(${JV}, 0, 1.);\n`}])}l=h.join("\n")}return{vs:l,targetTextureType:o,inject:c,samplerTextureMap:a}}({vs:e.vs,sourceTextureMap:t,targetTextureVarying:this.targetTextureVarying,targetTexture:i}),c=DI([e.inject||{},a]);return this.targetTextureType=o,this.samplerTextureMap=l,{vs:r,fs:e._fs||qV({version:KV(r),input:this.targetTextureVarying,inputType:o,output:"transform_output"}),modules:this.hasSourceTextures||this.targetTextureVarying?[roe].concat(e.modules||[]):e.modules,uniforms:s,inject:c}}}const II={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 moe(n){let e=eU(n);return"object"===e?n?"type"in n?Object.assign({},n,II[n.type]):"value"in n?(e=eU(n.value),Object.assign({type:e},n,II[e])):{type:"object",value:n}:{type:"object",value:null}:Object.assign({type:e,value:n},II[e])}function eU(n){return Array.isArray(n)||ArrayBuffer.isView(n)?"array":typeof n}class OI{constructor({name:e,vs:t,fs:i,dependencies:r=[],uniforms:s,getUniforms:o,deprecations:a=[],defines:l={},inject:c={},vertexShader:u,fragmentShader:h}){Ua("string"==typeof e),this.name=e,this.vs=t||u,this.fs=i||h,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=moe(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:Ua(!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&&Ua(s.validate(e[r],s),`${this.name}: invalid ${r}`),t[r]=e[r]):t[r]=s.value}return t}}function voe(n){return function(n){const e={},t={};return RI({modules:n,level:0,moduleMap:e,moduleDepth:t}),Object.keys(t).sort((i,r)=>t[r]-t[i]).map(i=>e[i])}(nU(n))}function RI({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 OI||(Ua("string"!=typeof t,`Shader module use by name is deprecated. Import shader module '${t}' and use it directly.`),Ua(t.name,"shader module has no name"),(t=new OI(t)).dependencies=nU(t.dependencies)),t))}const NI={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]},Nf={};function Moe(n,e){return n.match(/NVIDIA/i)||e.match(/NVIDIA/i)?"NVIDIA":n.match(/INTEL/i)||e.match(/INTEL/i)?"INTEL":n.match(/AMD/i)||e.match(/AMD/i)||n.match(/ATI/i)||e.match(/ATI/i)?"AMD":"UNKNOWN GPU"}Object.keys(NI).forEach(n=>{Nf[n]=n});const PI={};function iU(n,e,t={}){const i=NI[e];if(Ua(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 PI)return PI[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),PI[e]=l,l}function AS(n,e){return(e=Array.isArray(e)?e:[e]).every(t=>function(n,e){const t=NI[e];Ua(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 Ua(!1===r||!0===r),r}(n,t))}function Gg(n){return new RegExp(`\\b${n}[ \\t]+(\\w+[ \\t]+\\w+(\\[\\w+\\])?;)`,"g")}const rU=[[/^(#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("]],Roe=[...rU,[Gg("attribute"),"in $1"],[Gg("varying"),"out $1"]],Noe=[...rU,[Gg("varying"),"in $1"]],sU=[[/^#version[ \t]+300[ \t]+es/,"#version 100"],[/\btexture(2D|2DProj|Cube)Lod\(/g,"texture$1LodEXT("],[/\btexture\(/g,"texture2D("],[/\btextureLod\(/g,"texture2DLodEXT("]],Poe=[...sU,[Gg("in"),"attribute $1"],[Gg("out"),"varying $1"]],Foe=[...sU,[Gg("in"),"varying $1"]],FI="gl_FragColor",kI=/\bout[ \t]+vec4[ \t]+(\w+)[ \t]*;\n?/,koe=/void\s+main\s*\([^)]*\)\s*\{\n?/;function TS(n,e){for(const[t,i]of e)n=n.replace(t,i);return n}const Voe=`\n\n${xS}\n\n`,oU={[D0]:"vertex",fs:"fragment"};function aU(n,{id:e,source:t,type:i,modules:r,defines:s={},hookFunctions:o=[],inject:a={},transpileToGLSL100:l=!1,prologue:c=!0,log:u}){Ua("string"==typeof t,"shader source must be a string");const h=i===D0,p=t.split("\n");let g=100,m="",w=t;0===p[0].indexOf("#version ")?(g=300,m=p[0],w=p.slice(1).join("\n")):m=`#version ${g}`;const C={};r.forEach(Be=>{Object.assign(C,Be.getDefines())}),Object.assign(C,s);let H=c?`${m}\n${function({id:n,source:e,type:t}){return n&&"string"==typeof n&&-1===e.indexOf("SHADER_NAME")?`\n#define SHADER_NAME ${n}_${oU[t]}\n\n`:""}({id:e,source:t,type:i})}\n${function({type:n}){return`\n#define SHADER_TYPE_${oU[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:Moe(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// 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"}}(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 AS(n,Nf.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"),AS(n,Nf.GLSL_DERIVATIVES)&&iU(n,Nf.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"),AS(n,Nf.GLSL_FRAG_DATA)&&iU(n,Nf.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"),AS(n,Nf.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}(C)}\n${h?"":"precision highp float;\n\n"}\n`:`${m}\n`;const U=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),de={},Ae={},Pe={};for(const Be in a){const et="string"==typeof a[Be]?{injection:a[Be],order:0}:a[Be],wt=Be.match(/^(v|f)s:(#)?([\w-]+)$/);if(wt){const Ct=wt[3];wt[2]?"decl"===Ct?Ae[Be]=[et]:Pe[Be]=[et]:de[Be]=[et]}else Pe[Be]=[et]}for(const Be of r){u&&Be.checkDeprecations(w,u),H+=Be.getModuleSource(i,g);const wt=Be.injections[i];for(const vt in wt){const Ct=vt.match(/^(v|f)s:#([\w-]+)$/);if(Ct){const $t="decl"===Ct[2]?Ae:Pe;$t[vt]=$t[vt]||[],$t[vt].push(wt[vt])}else de[vt]=de[vt]||[],de[vt].push(wt[vt])}}return H+=Voe,H=ZV(H,i,Ae),H+=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}(U[i],de),H+=w,H=ZV(H,i,Pe),H=function(n,e,t){switch(e){case 300:return t?TS(n,Roe):function(n){const e=(n=TS(n,Noe)).match(kI);if(e){const t=e[1];n=n.replace(new RegExp(`\\b${FI}\\b`,"g"),t)}else{const t="fragmentColor";n=n.replace(koe,i=>`out vec4 ${t};\n${i}`).replace(new RegExp(`\\b${FI}\\b`,"g"),t)}return n}(n);case 100:return t?TS(n,Poe):function(n){const e=(n=TS(n,Foe)).match(kI);if(e){const t=e[1];n=n.replace(kI,"").replace(new RegExp(`\\b${t}\\b`,"g"),FI)}return n}(n);default:throw new Error(`unknown GLSL version ${e}`)}}(H,l?100:g,h),H}function Hoe(n){return function(t){const i={};for(const r of n){const s=r.getUniforms(t,i);Object.assign(i,s)}return i}}const Koe={5126:Rr.bind(null,"uniform1fv",za,1,Mo),35664:Rr.bind(null,"uniform2fv",za,2,Mo),35665:Rr.bind(null,"uniform3fv",za,3,Mo),35666:Rr.bind(null,"uniform4fv",za,4,Mo),5124:Rr.bind(null,"uniform1iv",ch,1,Mo),35667:Rr.bind(null,"uniform2iv",ch,2,Mo),35668:Rr.bind(null,"uniform3iv",ch,3,Mo),35669:Rr.bind(null,"uniform4iv",ch,4,Mo),35670:Rr.bind(null,"uniform1iv",ch,1,Mo),35671:Rr.bind(null,"uniform2iv",ch,2,Mo),35672:Rr.bind(null,"uniform3iv",ch,3,Mo),35673:Rr.bind(null,"uniform4iv",ch,4,Mo),35674:Rr.bind(null,"uniformMatrix2fv",za,4,Ku),35675:Rr.bind(null,"uniformMatrix3fv",za,9,Ku),35676:Rr.bind(null,"uniformMatrix4fv",za,16,Ku),35678:ro,35680:ro,5125:Rr.bind(null,"uniform1uiv",MS,1,Mo),36294:Rr.bind(null,"uniform2uiv",MS,2,Mo),36295:Rr.bind(null,"uniform3uiv",MS,3,Mo),36296:Rr.bind(null,"uniform4uiv",MS,4,Mo),35685:Rr.bind(null,"uniformMatrix2x3fv",za,6,Ku),35686:Rr.bind(null,"uniformMatrix2x4fv",za,8,Ku),35687:Rr.bind(null,"uniformMatrix3x2fv",za,6,Ku),35688:Rr.bind(null,"uniformMatrix3x4fv",za,12,Ku),35689:Rr.bind(null,"uniformMatrix4x2fv",za,8,Ku),35690:Rr.bind(null,"uniformMatrix4x3fv",za,12,Ku),35678:ro,35680:ro,35679:ro,35682:ro,36289:ro,36292:ro,36293:ro,36298:ro,36299:ro,36300:ro,36303:ro,36306:ro,36307:ro,36308:ro,36311:ro},Xoe={},Qoe={},Zoe={},lU=[0];function LI(n,e,t,i){1===e&&"boolean"==typeof n&&(n=n?1:0),Number.isFinite(n)&&(lU[0]=n,n=lU);const r=n.length;if(r%e&&mn.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 Rr(n,e,t,i){let r=null,s=null;return(o,a,l)=>{const c=e(l,t),u=c.length;let h=!1;if(null===r)r=new Float32Array(u),s=u,h=!0;else{tn(s===u,"Uniform length cannot change.");for(let p=0;p{const a=String(o+e);return hU(a,r-a.length)+t+s})}(e);return{shaderName:l,errors:dU(s,c),warnings:dU(o,c)}}(i,this.source,this.shaderType,this.id);throw mn.error(`GLSL compilation errors in ${r}\n${s}`)(),mn.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 BI extends I0{get[Symbol.toStringTag](){return"VertexShader"}constructor(e,t){"string"==typeof t&&(t={source:t}),super(e,Object.assign({},t,{shaderType:35633}))}_createHandle(){return this.gl.createShader(35633)}}class jI extends I0{get[Symbol.toStringTag](){return"FragmentShader"}constructor(e,t){"string"==typeof t&&(t={source:t}),super(e,Object.assign({},t,{shaderType:35632}))}_createHandle(){return this.gl.createShader(35632)}}const ks=5126,O0=5124,R0=5125,VI={[ks]:[ks,1,"float"],35664:[ks,2,"vec2"],35665:[ks,3,"vec3"],35666:[ks,4,"vec4"],[O0]:[O0,1,"int"],35667:[O0,2,"ivec2"],35668:[O0,3,"ivec3"],35669:[O0,4,"ivec4"],[R0]:[R0,1,"uint"],36294:[R0,2,"uvec2"],36295:[R0,3,"uvec3"],36296:[R0,4,"uvec4"],35670:[ks,1,"bool"],35671:[ks,2,"bvec2"],35672:[ks,3,"bvec3"],35673:[ks,4,"bvec4"],35674:[ks,8,"mat2"],35685:[ks,8,"mat2x3"],35686:[ks,8,"mat2x4"],35675:[ks,12,"mat3"],35687:[ks,12,"mat3x2"],35688:[ks,12,"mat3x4"],35676:[ks,16,"mat4"],35689:[ks,16,"mat4x2"],35690:[ks,16,"mat4x3"]};function yU(n){const e=VI[n];if(!e)return null;const[t,i]=e;return{type:t,components:i}}function bU(n,e){switch(n){case 5120:case 5121:case 5122:case 5123:n=ks}for(const t in VI){const[i,r,s]=VI[t];if(i===n&&r===e)return{glType:t,name:s}}return null}class kae{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(!Si(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}=yU(i),a={type:s,size:r*o};this._inferProperties(e,t,a);const l={location:e,name:t,accessor:new ma(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}=yU(i),l={location:e,name:t,accessor:new ma({type:s,size:r*o})};this.varyingInfos.push(l),this.varyingInfosByName[l.name]=l}}const Lae=35981,Bae=["setVertexArray","setAttributes","setBuffers","unsetBuffers","use","getUniformCount","getUniformInfo","getUniformLocation","getUniformValue","getVarying","getFragDataLocation","getAttachedShaders","getAttributeCount","getAttributeLocation","getAttributeInfo"];class wU extends Wu{get[Symbol.toStringTag](){return"Program"}constructor(e,t={}){super(e,t),this.stubRemovedMethods("Program","v6.0",Bae),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=Lae}=e;return this.hash=t||"",this.vs="string"==typeof i?new BI(this.gl,{id:`${e.id}-vs`,source:i}):i,this.fs="string"==typeof r?new jI(this.gl,{id:`${e.id}-fs`,source:r}):r,tn(this.vs instanceof BI),tn(this.fs instanceof jI),this.uniforms={},this._textureUniforms={},s&&s.length>0&&(Co(this.gl),this.varyings=s,this.gl2.transformFeedbackVaryings(this.handle,s,o)),this._compileAndLink(),this._readUniformLocationsFromLinkedProgram(),this.configuration=new kae(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:u=c>0,vertexArray:h=null,transformFeedback:p,framebuffer:g,parameters:m={},uniforms:w,samplers:C}){if((w||C)&&(mn.deprecated("Program.draw({uniforms})","Program.setUniforms(uniforms)")(),this.setUniforms(w||{})),mn.priority>=e){const H=g?g.id:"default",U=`mode=${ah(this.gl,t)} verts=${i} instances=${c} indexType=${ah(this.gl,l)} isInstanced=${u} isIndexed=${a} Framebuffer=${H}`;mn.log(e,U)()}return tn(h),this.gl.useProgram(this.handle),!(!this._areTexturesRenderable()||0===i||u&&0===c||(h.bindForDraw(i,c,()=>{if(void 0!==g&&(m=Object.assign({},m,{framebuffer:g})),p){const H=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(H)}this._bindTextures(),fc(this.gl,m,()=>{a&&u?this.gl2.drawElementsInstanced(t,i,l,r,c):a&&Si(this.gl)&&!isNaN(s)&&!isNaN(o)?this.gl2.drawRangeElements(t,s,o,i,l,r):a?this.gl.drawElements(t,i,l,r):u?this.gl2.drawArraysInstanced(t,r,i,c):this.gl.drawArrays(t,r,i)}),p&&p.end()}),0))}setUniforms(e={}){mn.priority>=2&&function(n,e,t){for(const i in n){const r=n[i];if((!t||Boolean(t[i]))&&!tae(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 Fs&&(s=s.texture),s instanceof Of)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)&&nae(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 BI({handle:r});break;case 35632:i.fs=new jI({handle:r})}return i}_getParameter(e){return this.gl.getProgramParameter(this.handle,e)}_setId(e){if(!e){const t=this._getName();this.id=ga(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),mn.time(4,`linkProgram for ${this._getName()}`)(),e.linkProgram(this.handle),mn.timeEnd(4,`linkProgram for ${this._getName()}`)(),e.debug||mn.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),u=this._getHash(t),h=this._getHash(i),p=c.map(de=>this._getHash(de.name)).sort(),g=o.map(de=>this._getHash(de)),m=Object.keys(r).sort(),w=Object.keys(s).sort(),C=[],H=[];for(const de of m)C.push(this._getHash(de)),C.push(this._getHash(r[de]));for(const de of w)H.push(this._getHash(de)),H.push(this._getHash(s[de]));const U=`${u}/${h}D${C.join("/")}M${p.join("/")}I${H.join("/")}V${g.join("/")}H${this.stateHash}B${a}${l?"T":""}`;if(!this._programCache[U]){const de=function(n,e){const{vs:t,fs:i}=e,r=voe(e.modules||[]);return{gl:n,vs:aU(n,Object.assign({},e,{source:t,type:D0,modules:r})),fs:aU(n,Object.assign({},e,{source:i,type:"fs",modules:r})),getUniforms:Hoe(r)}}(this.gl,{vs:t,fs:i,modules:c,inject:s,defines:r,hookFunctions:this._hookFunctions,transpileToGLSL100:l});this._programCache[U]=new wU(this.gl,{hash:U,vs:de.vs,fs:de.fs,varyings:o,bufferMode:a}),this._getUniforms[U]=de.getUniforms||(Ae=>{}),this._useCounts[U]=0}return this._useCounts[U]++,this._programCache[U]}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":_0.chrome?"Chrome":_0.safari?"Safari":_0.mozInnerScreenX?"Firefox":"Unknown"}()}static getDefaultArray(e){return e.luma=e.luma||{},e.luma.defaultVertexArray||(e.luma.defaultVertexArray=new Ha(e,{handle:null,isDefaultArray:!0})),e.luma.defaultVertexArray}static getMaxAttributes(e){return Ha.MAX_ATTRIBUTES=Ha.MAX_ATTRIBUTES||e.getParameter(34921),Ha.MAX_ATTRIBUTES}static setConstant(e,t,i){switch(i.constructor){case Float32Array:Ha._setConstantFloatArray(e,t,i);break;case Int32Array:Ha._setConstantIntArray(e,t,i);break;case Uint32Array:Ha._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 Ha.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:u}=i,{gl:h,gl2:p}=this;return e=Number(e),this.bind(()=>{h.bindBuffer(34962,t.handle),c?(tn(Si(h)),p.vertexAttribIPointer(e,r,s,o,a)):h.vertexAttribPointer(e,r,s,l,o,a),h.enableVertexAttribArray(e),p.vertexAttribDivisor(e,u||0)}),this}enable(e,t=!0){return!t&&0===e&&!Ha.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 hr(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(!OS||OS.byteLength{switch(e){case 34373:return this.gl.getVertexAttribOffset(t,e);default:return this.gl.getVertexAttrib(t,e)}})}}const $ae=/^(.+)__LOCATION_([0-9]+)$/,Wae=["setBuffers","setGeneric","clearBindings","setLocations","setGenericValues","setDivisor","enable","disable"];class qae{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 Ha(e),rV(this,"VertexArray","v6.0",Wae),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 hr(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,mn.once(3,()=>`unused value ${e} in ${this.id}`)(),s;const l=this._getAttributeInfo(a||o);if(!l)return s;const u=ma.resolve(l.accessor,this.accessors[o]||{},i,r),{size:h,type:p}=u;return tn(Number.isFinite(h)&&Number.isFinite(p)),{location:o,accessor:u}}_getAttributeInfo(e){return this.configuration&&this.configuration.getAttributeInfo(e)}_getAttributeIndex(e){const t=Number(e);if(Number.isFinite(t))return{location:t};const i=$ae.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 hr)this.setBuffer(e,t);else if(Array.isArray(t)&&t.length&&t[0]instanceof hr)this.setBuffer(e,t[0],t[1]);else if(ArrayBuffer.isView(t)||Array.isArray(t))this.setConstant(e,t);else{if(!(t.buffer instanceof hr))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 hr){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 mn.deprecated("setElements","setElementBuffer")(),this.setElementBuffer(e,t)}}function P0(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+=P0(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 EU(n,e,t,i){const{gl:r}=n;if(!e)return{[i]:"null","Format ":"N/A"};let c,u,h,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 hr){const p=e,{data:g,changed:m}=p.getDebugData();let w;return u=m?"*":"",h=g,l=p.byteLength,a=l/g.BYTES_PER_ELEMENT/o,t?w=`${t.divisor>0?"I ":"P "} ${a} (x${o}=${l} bytes ${ah(r,s)})`:(c=!0,w=`${l} bytes`),{[i]:`${u}${P0(h,{size:o,isInteger:c})}`,"Format ":w}}return h=e,o=e.length,s=String(e.constructor.name).replace("Array",""),c=-1!==s.indexOf("nt"),{[i]:`${P0(h,{size:o,isInteger:c})} (constant)`,"Format ":`${o}x${s} (constant)`}}function Xae(n,e){const{type:t,size:i}=e,r=bU(t,i);return r?`${n} (${r.name})`:n}function SU({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)&&UI({table:a,header:n,uniforms:t,uniformName:p,undefinedOnly:i})&&c++;for(const p of l)p.match(s)&&UI({table:a,header:n,uniforms:t,uniformName:p,undefinedOnly:i})&&c++;for(const p of l)a[p]||UI({table:a,header:n,uniforms:t,uniformName:p,undefinedOnly:i})&&c++;let u=0;const h={};if(!i)for(const p in t){const g=t[p];a[p]||(u++,h[p]={Type:`NOT USED: ${g}`,[n]:P0(g)})}return{table:a,count:c,unusedTable:h,unusedCount:u}}function UI({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?P0(s):"N/A","Uniform Type":o?s:"NOT PROVIDED"},0))}function xU(n){const{type:e,size:t}=n.accessor,i=bU(e,t);return i?`${i.name} ${n.name}`:n.name}const Jae={POSITION:"positions",NORMAL:"normals",COLOR_0:"colors",TEXCOORD_0:"texCoords",TEXCOORD_1:"texCoords1",TEXCOORD_2:"texCoords2"};function tle(n,e){const{attributeMap:t=Jae}=e||{};return t&&t[n]||n}function nle(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 CU=()=>{},sle={};class Yg{constructor(e,t={}){const{id:i=ga("model")}=t;tn(pS(e)),this.id=i,this.gl=e,this.id=t.id||ga("Model"),this.lastLogTime=0,this.animated=!1,this.initialize(t)}initialize(e){this.props={},this.programManager=e.programManager||N0.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:u}=e;this.programProps={program:t,vs:i,fs:r,modules:s,defines:o,inject:a,varyings:l,bufferMode:c,transpileToGLSL100:u},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:u}=e;this.programProps={program:t,vs:i,fs:r,modules:s,defines:o,inject:a,varyings:l,bufferMode:c,transpileToGLSL100:u},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=tle(s,undefined);if("indices"===s)r=o;else if(o.constant)i[a]=o.value;else{const l=o.value,c=ot({},o);delete c.value,i[a]=[new hr(n,l),c],nle(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 hr(n,{data:s,target:34963}),o]}return i}(this.gl,e),this.vertexArray.setAttributes(this.geometryBuffers),this}setAttributes(e={}){if(Vg(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 hI(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),mn.priority>=2&&(c=this._logDrawCallStart(2));const u=this.vertexArray.getDrawParams(),{isIndexed:h=u.isIndexed,indexType:p=u.indexType,indexOffset:g=u.indexOffset,vertexArrayInstanced:m=u.isInstanced}=this.props;m&&!this.isInstanced&&mn.warn("Found instanced attributes on non-instanced model",this.id)();const{isInstanced:w,instanceCount:C}=this,{onBeforeRender:H=CU,onAfterRender:U=CU}=this.props;H(),this.program.setUniforms(this.uniforms);const de=this.program.draw(Object.assign(sle,e,{logPriority:c,uniforms:null,framebuffer:i,parameters:a,drawMode:this.getDrawMode(),vertexCount:this.getVertexCount(),vertexArray:l,transformFeedback:o,isIndexed:h,indexType:p,isInstanced:w,instanceCount:C,offset:h?g:0}));return U(),mn.priority>=2&&this._logDrawCallEnd(c,l,i),de}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 mn.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:u}=this.programProps;t=this.programManager.get({vs:i,fs:r,modules:s,inject:o,defines:a,varyings:l,bufferMode:c,transpileToGLSL100:u}),this.program&&this._managedProgram&&this.programManager.release(this.program),this._programManagerState=this.programManager.stateHash,this._managedProgram=!0}tn(t instanceof wU,"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 qae(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 hr&&t.delete()}}_setAnimationProps(e){this.animated&&tn(e,"Model.draw(): animated uniforms but no animationProps")}_setFeedbackBuffers(e={}){if(Vg(e))return this;const{gl:t}=this.program;return this.transformFeedback=this.transformFeedback||new YV(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:mn.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=EU(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}: ${Xae(s.name,a)}`),t[o]=EU(n,i[r],a,e)}}return t}({vertexArray:t,header:`${this.id} attributes`,attributes:this._attributes}),{table:o,unusedTable:a,unusedCount:l}=SU({header:`${this.id} uniforms`,program:this.program,uniforms:Object.assign({},this.program.uniforms,i)}),{table:c,count:u}=SU({header:`${this.id} uniforms`,program:this.program,uniforms:Object.assign({},this.program.uniforms,i),undefinedOnly:!0});u>0&&mn.log("MISSING UNIFORMS",Object.keys(c))(),l>0&&mn.log("UNUSED UNIFORMS",Object.keys(a))();const h=function(n){const e={},t=`Accessors for ${n.id}`;for(const i of n.attributeInfos)i&&(e[`in ${xU(i)}`]={[t]:JSON.stringify(i.accessor)});for(const i of n.varyingInfos)i&&(e[`out ${xU(i)}`]={[t]:JSON.stringify(i.accessor)});return e}(this.vertexArray.configuration);mn.table(e,s)(),mn.table(e,o)(),mn.table(e+1,h)(),r&&r.log({logLevel:2,message:`Rendered to ${r.id}`}),mn.groupEnd(2,`>>> DRAWING MODEL ${this.id}`)()}}class zI{static isSupported(e){return Si(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 Yg(t,Object.assign({},e,{fs:e.fs||qV({version:KV(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!(Vg(n.feedbackBuffers)&&Vg(n.feedbackMap)&&!(n.varyings&&n.varyings.length>0))})(t)&&(this.bufferTransform=new eoe(e,t)),function(n){return!(Vg(n._sourceTextures)&&!n._targetTexture&&!n._targetTextureVarying)}(t)&&(this.textureTransform=new poe(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 RS(){}const lle={onStart:RS,onUpdate:RS,onInterrupt:RS,onEnd:RS};class F0{constructor(e){this._inProgress=!1,this._handle=null,this.timeline=e,this.settings={}}get inProgress(){return this._inProgress}start(e){this.cancel(),this.settings=ot(ot({},lle),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 mle={interpolation:class{constructor({gl:e,attribute:t,timeline:i}){this.gl=e,this.type="interpolation",this.transition=new F0(i),this.attribute=t,this.attributeInTransition=new CI(e,t.settings),this.currentStartIndices=t.startIndices,this.currentLength=0,this.transform=function(n,e){const t=zV(e.size);return new zI(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 hr(e,r),new hr(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;HV(r);const o={numInstances:t,attribute:s,fromLength:this.currentLength,fromStartIndices:this.currentStartIndices,getData:e.enter};for(const a of r)GV(ot({buffer:a},o));this.currentStartIndices=s.startIndices,this.currentLength=xI(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:UV(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 F0(i),this.attribute=t,this.attributeInTransition=new CI(e,Cn(ot({},t.settings),{normalized:!1})),this.currentStartIndices=t.startIndices,this.currentLength=0,this.texture=function(n){return new _a(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 Fs(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=zV(e.size);return new zI(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 hr(e,r),new hr(e,r),new hr(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)GV(ot({buffer:a},o));this.currentStartIndices=s.startIndices,this.currentLength=xI(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:UV(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]}}),HV(e),this.attributeInTransition.update({buffer:e[1],value:this.attribute.value}),_S(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 _le{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=zI.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 Ri.warn("WebGL2 not supported by this browser. Transition for ".concat(e," is disabled."))();r&&this._removeTransition(e);const o=mle[i.type];o?this.transitions[e]=new o({attribute:t,timeline:this.timeline,gl:this.gl}):(Ri.error("unsupported transition type '".concat(i.type,"'"))(),s=!1)}(s||t.needsRedraw())&&(this.needsRedraw=!0,this.transitions[e].start(i,this.numInstances))}}const AU="attributeManager.invalidate";class Sle{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 _le(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;To("attribute.updateStart",t),t.allocate(i)&&To("attribute.allocate",t,i),t.updateBuffer(e)&&(this.needsRedraw=!0,To("attribute.updateEnd",t,i))}}function MU(n,e,t,i,r){const s=e-n;return(t-e)*r+-s*i+s+e}function DU(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=VV(r)))return;const o=Tle[r.type];if(!o)return void Ri.error("unsupported transition type '".concat(r.type,"'"))();const a=new o(this.timeline);a.start(Cn(ot({},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 NS={COMPONENT:Symbol.for("component"),ASYNC_DEFAULTS:Symbol.for("asyncPropDefaults"),ASYNC_ORIGINAL:Symbol.for("asyncPropOriginal"),ASYNC_RESOLVED:Symbol.for("asyncPropResolved")},{COMPONENT:Dle}=NS;function Rle(n,e){if(!n.transitions)return null;const t={},i=GI(n);for(const r in n.transitions){const s=i[r],o=s&&s.type;("number"===o||"color"===o||"array"===o)&&HI(n[r],e[r],s)&&(t[r]=!0)}return t}function IU({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=HI(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=HI(n[s],e[s],i[s]);if(o)return"".concat(r,".").concat(s," ").concat(o)}}return null}function HI(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 Fle(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(!Ule(i[r],e[r])){t=n(i),e=i;break}return t}}function zle(n,e){if(!e)return n;const t=ot(ot({},n),e);if("defines"in e&&(t.defines=ot(ot({},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=ot({},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 $I(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],u=e[8],h=e[9],p=e[10],g=e[11],m=e[12],w=e[13],C=e[14],H=e[15],U=t*a-i*o,de=t*l-r*o,Ae=t*c-s*o,Pe=i*l-r*a,Be=i*c-s*a,et=r*c-s*l,wt=u*w-h*m,vt=u*C-p*m,Ct=u*H-g*m,Bt=h*C-p*w,$t=h*H-g*w,gt=p*H-g*C,mt=U*gt-de*$t+Ae*Bt+Pe*Ct-Be*vt+et*wt;return mt?(n[0]=(a*gt-l*$t+c*Bt)*(mt=1/mt),n[1]=(r*$t-i*gt-s*Bt)*mt,n[2]=(w*et-C*Be+H*Pe)*mt,n[3]=(p*Be-h*et-g*Pe)*mt,n[4]=(l*Ct-o*gt-c*vt)*mt,n[5]=(t*gt-r*Ct+s*vt)*mt,n[6]=(C*Ae-m*et-H*de)*mt,n[7]=(u*et-p*Ae+g*de)*mt,n[8]=(o*$t-a*Ct+c*wt)*mt,n[9]=(i*Ct-t*$t-s*wt)*mt,n[10]=(m*Be-w*Ae+H*U)*mt,n[11]=(h*Ae-u*Be-g*U)*mt,n[12]=(a*vt-o*Bt-l*wt)*mt,n[13]=(t*Bt-i*vt+r*wt)*mt,n[14]=(w*de-m*Pe-C*U)*mt,n[15]=(u*Pe-h*de+p*U)*mt,n):null}function Pf(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],u=e[7],h=e[8],p=e[9],g=e[10],m=e[11],w=e[12],C=e[13],H=e[14],U=e[15],de=t[0],Ae=t[1],Pe=t[2],Be=t[3];return n[0]=de*i+Ae*a+Pe*h+Be*w,n[1]=de*r+Ae*l+Pe*p+Be*C,n[2]=de*s+Ae*c+Pe*g+Be*H,n[3]=de*o+Ae*u+Pe*m+Be*U,n[4]=(de=t[4])*i+(Ae=t[5])*a+(Pe=t[6])*h+(Be=t[7])*w,n[5]=de*r+Ae*l+Pe*p+Be*C,n[6]=de*s+Ae*c+Pe*g+Be*H,n[7]=de*o+Ae*u+Pe*m+Be*U,n[8]=(de=t[8])*i+(Ae=t[9])*a+(Pe=t[10])*h+(Be=t[11])*w,n[9]=de*r+Ae*l+Pe*p+Be*C,n[10]=de*s+Ae*c+Pe*g+Be*H,n[11]=de*o+Ae*u+Pe*m+Be*U,n[12]=(de=t[12])*i+(Ae=t[13])*a+(Pe=t[14])*h+(Be=t[15])*w,n[13]=de*r+Ae*l+Pe*p+Be*C,n[14]=de*s+Ae*c+Pe*g+Be*H,n[15]=de*o+Ae*u+Pe*m+Be*U,n}function FS(n,e,t){var o,a,l,c,u,h,p,g,m,w,C,H,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],u=e[4],h=e[5],p=e[6],g=e[7],m=e[8],w=e[9],C=e[10],H=e[11],n[0]=o=e[0],n[1]=a,n[2]=l,n[3]=c,n[4]=u,n[5]=h,n[6]=p,n[7]=g,n[8]=m,n[9]=w,n[10]=C,n[11]=H,n[12]=o*i+u*r+m*s+e[12],n[13]=a*i+h*r+w*s+e[13],n[14]=l*i+p*r+C*s+e[14],n[15]=c*i+g*r+H*s+e[15]),n}function kS(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 RU(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],u=e[9],h=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+u*i,n[6]=a*r+h*i,n[7]=l*r+p*i,n[8]=c*r-s*i,n[9]=u*r-o*i,n[10]=h*r-a*i,n[11]=p*r-l*i,n}function NU(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],u=e[5],h=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+u*i,n[2]=a*r+h*i,n[3]=l*r+p*i,n[4]=c*r-s*i,n[5]=u*r-o*i,n[6]=h*r-a*i,n[7]=p*r-l*i,n}function FU(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 LS(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 kU(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],u=c*i+a*s-l*r,h=c*r+l*i-o*s,p=c*s+o*r-a*i,g=-o*i-a*r-l*s;return n[0]=u*c+g*-o+h*-l-p*-a,n[1]=h*c+g*-a+p*-o-u*-l,n[2]=p*c+g*-l+u*-a-h*-o,n[3]=e[3],n}!function(){var n=new ya(4);ya!=Float32Array&&(n[0]=0,n[1]=0,n[2]=0,n[3]=0)}();const LU=[0,0,0,0],fce=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0],pce=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],gce=[0,0,0],mce=[0,0,0],_ce=PS(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=LU,l=LU,c=n.cameraPosition;const{geospatialOrigin:u,shaderCoordinateOrigin:h,offsetMode:p}=BU(n,e,t);return p&&(l=n.projectPosition(u||h),c=[c[0]-l[0],c[1]-l[1],c[2]-l[2]],l[3]=1,a=LS([],l,o),s=i||s,o=Pf([],r,s),o=Pf([],o,fce)),{viewMatrix:s,viewProjectionMatrix:o,projectionCenter:a,originCommon:l,cameraPosCommon:c,shaderCoordinateOrigin:h,geospatialOrigin:u}}(n,t,i),u=n.getDistanceScales(),h=[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:h,project_uDevicePixelRatio:e,project_uFocalDistance:p,project_uCommonUnitsPerMeter:u.unitsPerMeter,project_uCommonUnitsPerWorldUnit:u.unitsPerMeter,project_uCommonUnitsPerWorldUnit2:gce,project_uScale:n.scale,project_uViewProjectionMatrix:s,project_uCameraPosition:a};if(c){const m=n.getDistanceScales(c);switch(t){case ji.METER_OFFSETS:g.project_uCommonUnitsPerWorldUnit=m.unitsPerMeter,g.project_uCommonUnitsPerWorldUnit2=m.unitsPerMeter2;break;case ji.LNGLAT:case ji.LNGLAT_OFFSETS:g.project_uCommonUnitsPerWorldUnit=m.unitsPerDegree,g.project_uCommonUnitsPerWorldUnit2=m.unitsPerDegree2;break;case ji.CARTESIAN:g.project_uCommonUnitsPerWorldUnit=[1,1,m.unitsPerMeter[2]],g.project_uCommonUnitsPerWorldUnit2=[0,0,m.unitsPerMeter2[2]]}}return g});function BU(n,e,t=mce){let r,i=t,s=!0;switch(r=e===ji.LNGLAT_OFFSETS||e===ji.METER_OFFSETS?t:n.isGeospatial?[Math.fround(n.longitude),Math.fround(n.latitude),0]:null,n.projectionMode){case Kc.WEB_MERCATOR:(e===ji.LNGLAT||e===ji.CARTESIAN)&&(s=!1);break;case Kc.WEB_MERCATOR_AUTO_OFFSET:e===ji.LNGLAT?i=r:e===ji.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 wce extends bS{get ELEMENTS(){return Yu(!1),0}get RANK(){return Yu(!1),0}toString(){let e="[";if(Or.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 qn).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 function(n,e,t,i,r){var o,s=1/Math.tan(e/2);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)}(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],u=n[9],h=n[10],p=n[11],g=n[12],m=n[13],w=n[14],C=n[15];return(e*o-t*s)*(h*C-p*w)-(e*a-i*s)*(u*C-p*m)+(e*l-r*s)*(u*w-h*m)+(t*a-i*o)*(c*C-p*g)-(t*l-r*o)*(c*w-h*g)+(i*l-r*a)*(c*m-u*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 $I(this,this),this.check()}multiplyLeft(e){return Pf(this,e,this),this.check()}multiplyRight(e){return Pf(this,this,e),this.check()}rotateX(e){return RU(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],u=e[9],h=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-u*i,n[2]=a*r-h*i,n[3]=l*r-p*i,n[8]=s*i+c*r,n[9]=o*i+u*r,n[10]=a*i+h*r,n[11]=l*i+p*r}(this,this,e),this.check()}rotateZ(e){return NU(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,u,h,p,g,m,w,C,H,U,de,Ae,Pe,Be,et,wt,vt,Ct,Bt,$t,gt,mt,Vt,r=i[0],s=i[1],o=i[2],a=Math.hypot(r,s,o);at?t:n}const WI=Math.log2||function(n){return Math.log(n)*Math.LOG2E};function Xu(n,e){if(!n)throw new Error(e||"@math.gl/web-mercator: assertion failed.")}const gc=Math.PI,GU=gc/4,mc=gc/180,qI=180/gc,YI=4003e4,jS=85.051129;function VS([n,e]){return Xu(Number.isFinite(n)),Xu(Number.isFinite(e)&&e>=-90&&e<=90,"invalid latitude"),[512*(n*mc+gc)/(2*gc),512*(gc+Math.log(Math.tan(GU+e*mc*.5)))/(2*gc)]}function Zg([n,e]){const t=n/512*(2*gc)-gc,i=2*(Math.atan(Math.exp(e/512*(2*gc)-gc))-GU);return[t*qI,i*qI]}function KI({latitude:n,longitude:e,highPrecision:t=!1}){Xu(Number.isFinite(n)&&Number.isFinite(e));const i={},s=Math.cos(n*mc),o=512/360,a=o/s,l=512/YI/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=mc*Math.tan(n*mc)/s,h=512/YI*c,p=h/a*l;i.unitsPerDegree2=[0,o*c/2,h],i.unitsPerMeter2=[p,0,p]}return i}function $U(n,e){const[t,i,r]=n,[s,o,a]=e,{unitsPerMeter:l,unitsPerMeter2:c}=KI({longitude:t,latitude:i,highPrecision:!0}),u=VS(n);u[0]+=s*(l[0]+c[0]*o),u[1]+=o*(l[1]+c[1]*o);const h=Zg(u),p=(r||0)+(a||0);return Number.isFinite(r)||Number.isFinite(a)?[h[0],h[1],p]:h}function qU(n){return 2*Math.atan(.5/n)*qI}function YU(n,e){const[t,i,r=0]=n;return Xu(Number.isFinite(t)&&Number.isFinite(i)&&Number.isFinite(r)),Qg(e,[t,i,r,1])}function L0(n,e,t=0){const[i,r,s]=n;if(Xu(Number.isFinite(i)&&Number.isFinite(r),"invalid pixel coordinate"),Number.isFinite(s))return Qg(e,[i,r,s,1]);const o=Qg(e,[i,r,0,1]),a=Qg(e,[i,r,1,1]),l=o[2],c=a[2];return VU([],o,a,l===c?0:((t||0)-l)/(c-l))}const KU=Math.PI/180;function XU(n,e,t){const{pixelUnprojectionMatrix:i}=n,r=Qg(i,[e,0,1,1]),s=Qg(i,[e,n.height,1,1]),c=Zg(VU([],r,s,(t*n.distanceScales.unitsPerMeter[2]-r[2])/(s[2]-r[2])));return c[2]=t,c}const Bce=Math.PI/180,jce=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],QI=[0,0,0],Uce={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&&C0(t.projectionMatrix,this.projectionMatrix)&&C0(t.viewMatrix,this.viewMatrix))}project(t,{topLeft:i=!0}={}){const s=YU(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,u=L0([s,i?o:this.height-o,a],this.pixelUnprojectionMatrix,r&&r*this.distanceScales.unitsPerMeter[2]),[h,p,g]=this.unprojectPosition(u);return Number.isFinite(a)?[h,p,g]:Number.isFinite(r)?[h,p,r]:[h,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?VS(t):t}unprojectFlat(t){return this.isGeospatial?Zg(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?KI({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:u=!1,repeat:h=!1,worldOffset:p=0}=t;let{width:g,height:m,altitude:w=1.5}=t;const C=Math.pow(2,s);g=g||1,m=m||1,w=Math.max(.75,w);const{fov:H,aspect:U,focalDistance:de,near:Ae,far:Pe}=function({width:n,height:e,fovy:t=qU(1.5),altitude:i,pitch:r=0,nearZMultiplier:s=1,farZMultiplier:o=1}){void 0!==i&&(t=qU(i));const a=.5*t*mc,l=function(n){return.5/Math.tan(.5*n*mc)}(t),c=r*mc,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:n/e,focalDistance:l,near:s,far:(Math.sin(c)*u+l)*o}}({width:g,height:m,pitch:o,altitude:w,nearZMultiplier:l,farZMultiplier:c});let Be=function({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 FS(o,o,[0,0,-i]),RU(o,o,-e*mc),NU(o,o,t*mc),kS(o,o,[r/=n,r,r]),s&&FS(o,o,function(n,e){return n[0]=-e[0],n[1]=-e[1],n[2]=-e[2],n}([],s)),o}({height:m,pitch:o,bearing:a,scale:C,altitude:w});p&&(Be=(new qn).translate([512*p,0,0]).multiplyLeft(Be)),super(Cn(ot({},t),{width:g,height:m,viewMatrix:Be,longitude:r,latitude:i,zoom:s,orthographic:u,fovyRadians:H,aspect:U,focalDistance:de,near:Ae,far:Pe})),this.latitude=i,this.longitude=r,this.zoom=s,this.pitch=o,this.bearing=a,this.altitude=w,this.orthographic=u,this._subViewports=h?[]: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(Cn(ot({},this),{worldOffset:s})):this;this._subViewports.push(o)}}return this._subViewports}addMetersToLngLat(t,i){return $U(t,i)}panByPosition(t,i){const r=L0(i,this.pixelUnprojectionMatrix),o=BS([],this.projectFlat(t),jU([],r)),a=BS([],this.center,o),[l,c]=this.unprojectFlat(a);return{longitude:l,latitude:c}}getBounds(t={}){const i=function(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*KU:Math.atan(.5/n.altitude))>(90-n.pitch)*KU-.01?(l=XU(n,0,e),c=XU(n,t,e)):(l=r([0,0],s),c=r([t,0],s)),[o,a,c,l]}(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}=function({width:n,height:e,bounds:t,minExtent:i=0,maxZoom:r=24,padding:s=0,offset:o=[0,0]}){const[[a,l],[c,u]]=t;Number.isFinite(s)?s={top:s,bottom:s,left:s,right:s}:Xu(Number.isFinite(s.top)&&Number.isFinite(s.bottom)&&Number.isFinite(s.left)&&Number.isFinite(s.right));const h=VS([a,HU(u,-jS,jS)]),p=VS([c,HU(l,-jS,jS)]),g=[Math.max(Math.abs(p[0]-h[0]),i),Math.max(Math.abs(p[1]-h[1]),i)],m=[n-s.left-s.right-2*Math.abs(o[0]),e-s.top-s.bottom-2*Math.abs(o[1])];Xu(m[0]>0&&m[1]>0);const w=m[0]/g[0],C=m[1]/g[1],Ae=Zg([(p[0]+h[0])/2+(s.right-s.left)/2/w,(p[1]+h[1])/2+(s.bottom-s.top)/2/C]),Pe=Math.min(r,WI(Math.abs(Math.min(w,C))));return Xu(Number.isFinite(Pe)),{longitude:Ae[0],latitude:Ae[1],zoom:Pe}}(ot({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 ZI(n,e,t=!1){const i=e.projectPosition(n);if(t&&e instanceof tz){const[r,s,o=0]=n,a=e.getDistanceScales([r,s]);i[2]=o*a.unitsPerMeter[2]}return i}function nz(n,{viewport:e,modelMatrix:t,coordinateSystem:i,coordinateOrigin:r,offsetMode:s}){let[o,a,l=0]=n;switch(t&&([o,a,l]=LS([],[o,a,l,1],t)),i){case ji.LNGLAT:return ZI([o,a,l],e,s);case ji.LNGLAT_OFFSETS:return ZI([o+r[0],a+r[1],l+(r[2]||0)],e,s);case ji.METER_OFFSETS:return ZI($U(r,[o,a,l]),e,s);case ji.CARTESIAN:default:return e.isGeospatial?[o+r[0],a+r[1],l+r[2]]:e.projectPosition([o,a,l])}}const Gce={10241:9987,10240:9729,10242:33071,10243:33071},JI={},qce={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||j0(n)&&(3===n.length||4===n.length),equal:(n,e,t)=>eO(n,e)},accessor:{validate(n,e){const t=US(n);return"function"===t||t===US(e.value)},equal:(n,e,t)=>"function"==typeof e||eO(n,e)},array:{validate:(n,e)=>e.optional&&!n||j0(n),equal:(n,e,t)=>t.compare?eO(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 _a)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 _a(t,Cn(ot({},e),{parameters:ot(ot(ot({},Gce),i),n.props.textureParameters)}));return JI[r.id]=!0,r}(t,n),release:n=>{!function(n){!n||!(n instanceof _a)||JI[n.id]&&(n.delete(),delete JI[n.id])}(n)}}};function eO(n,e){if(n===e)return!0;if(!j0(n)||!j0(e))return!1;const t=n.length;if(t!==e.length)return!1;for(let i=0;i{},this.oldProps=oue,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[rue]||{},i=e[iue]||e,r=e[sue]||{};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(BV(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 oi(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 h,c=!0,u=!1;try{for(var g,m,p=nO(t);c=(g=yield p.next()).done,m=yield g.value,!c;c=!0){const C=m,{dataTransform:H}=i.component?i.component.props:{};a=H?H(C,a):a.concat(C),Object.defineProperty(a,"__diff",{enumerable:!1,value:[{startRow:l,endRow:a.length}]}),l=a.length,i._setAsyncPropValue(e,a,o)}}catch(C){u=!0,h=C}finally{try{!c&&null!=p.return&&(yield p.return())}finally{if(u)throw h}}const w=null===(r=i.layer)||void 0===r?void 0:r.props.onDataLoad;w&&w(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:oz,ASYNC_RESOLVED:az,ASYNC_DEFAULTS:aue}=NS,lue={};let cue=0,uue=(()=>{class n{constructor(){this.props=Xce.apply(this,arguments),this.id=this.props.id,this.count=cue++,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[aue])s in i[az]?r[s]=i[az][s]:s in i[oz]&&(r[s]=i[oz][s]);return new this.constructor(ot(ot(ot({},i),r),t))}get stats(){return this.internalState.stats}_initState(){this.internalState=new sz({})}}return n.componentName="Component",n.defaultProps=lue,n})();class due extends sz{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 _c=n=>"function"==typeof n,uh=n=>null!==n&&"object"==typeof n,cz=n=>uh(n)&&n.constructor==={}.constructor,hue=n=>n&&"function"==typeof n[Symbol.iterator],fue=n=>n&&"function"==typeof n[Symbol.asyncIterator],U0=n=>"undefined"!=typeof Response&&n instanceof Response||n&&n.arrayBuffer&&n.text&&n.json,em=n=>"undefined"!=typeof Blob&&n instanceof Blob,uz=n=>(n=>"undefined"!=typeof ReadableStream&&n instanceof ReadableStream||uh(n)&&_c(n.tee)&&_c(n.cancel)&&_c(n.getReader))(n)||(n=>uh(n)&&_c(n.read)&&_c(n.pipe)&&(n=>"boolean"==typeof n)(n.readable))(n);function Ff(n,e){if(!n)throw new Error(e||"loader assertion failed.")}function iO(n){var e;return!!n&&(Array.isArray(n)&&(n=n[0]),Array.isArray(null===(e=n)||void 0===e?void 0:e.extensions))}function rO(n){var e,t;let i;return Ff(n,"null loader"),Ff(iO(n),"invalid loader"),Array.isArray(n)&&(i=n[1],n=Cn(ot({},n=n[0]),{options:ot(ot({},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 Zc={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},sO=Zc.global||Zc.self||Zc.window||{},bue="object"!=typeof process||"[object process]"!==String(process)||process.browser,dz="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version);dz&&parseFloat(dz[1]);const aO={};function vue(n){for(const e in aO)n.startsWith(e)&&(n=n.replace(e,aO[e]));return!n.startsWith("http://")&&!n.startsWith("https://")&&(n=`${n}`),n}const wue=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,Eue=/^([-\w.]+\/[-\w.+]+)/;function Sue(n){const e=Eue.exec(n);return e?e[1]:n}function hz(n){const e=wue.exec(n);return e?e[1]:""}const xue=/\?.*/;function $S(n){if(U0(n)){const e=lO(n.url||"");return{url:e,type:Sue(n.headers.get("content-type")||"")||hz(e)}}return em(n)?{url:lO(n.name||""),type:n.type||""}:"string"==typeof n?{url:lO(n),type:hz(n)}:{url:"",type:""}}function Cue(n){return U0(n)?n.headers["content-length"]||-1:em(n)?n.size:"string"==typeof n?n.length:n instanceof ArrayBuffer||ArrayBuffer.isView(n)?n.byteLength:-1}function lO(n){return n.replace(xue,"")}function fz(n){return cO.apply(this,arguments)}function cO(){return(cO=oi(function*(n){if(U0(n))return n;const e={},t=Cue(n);t>=0&&(e["content-length"]=String(t));const{url:i,type:r}=$S(n);r&&(e["content-type"]=r);const s=yield Mue(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 Aue(n){return uO.apply(this,arguments)}function uO(){return(uO=oi(function*(n){if(!n.ok){const e=yield Tue(n);throw new Error(e)}})).apply(this,arguments)}function Tue(n){return dO.apply(this,arguments)}function dO(){return(dO=oi(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 Mue(n){return hO.apply(this,arguments)}function hO(){return(hO=oi(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,${Due(n.slice(0,5))}`:null})).apply(this,arguments)}function Due(n){let e="";const t=new Uint8Array(n);for(let i=0;i{}}info(){return()=>{}}warn(){return()=>{}}error(){return()=>{}}}const mz={fetch:null,mimeType:void 0,nothrow:!1,log:new class{constructor(){Kn(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:[]},Rue={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 pO(){sO.loaders=sO.loaders||{};const{loaders:n}=sO;return n._state=n._state||{},n._state}const gO=()=>{const n=pO();return n.globalOptions=n.globalOptions||ot({},mz),n.globalOptions};function Nue(n,e,t,i){return t=t||[],function(n,e){yz(n,null,mz,Rue,e);for(const t of e)yz(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=ot({},n.options||{});return function(n,e){e&&!("baseUri"in n)&&(n.baseUri=e)}(r,t),null===r.log&&(r.log=new Iue),vz(r,gO()),vz(r,e),r}(e,n,i)}function _z(n,e){const t=gO(),i=n||t;return"function"==typeof i.fetch?i.fetch:uh(i.fetch)?r=>pz(r,i):null!=e&&e.fetch?null==e?void 0:e.fetch:pz}function yz(n,e,t,i,r){const s=e||"Top level",o=e?`${e}.`:"";for(const a in n){const l=!e&&uh(n[a]),c="baseUri"===a&&!e,u="workerUrl"===a&&e;if(!(a in t)&&!c&&!u)if(a in i)gz.warn(`${s} loader option '${o}${a}' no longer supported, use '${i[a]}'`)();else if(!l){const h=Fue(a,r);gz.warn(`${s} loader option '${o}${a}' not recognized. ${h}`)()}}}function Fue(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 vz(n,e){for(const t in e)t in e&&(n[t]=cz(e[t])&&cz(n[t])?ot(ot({},n[t]),e[t]):e[t])}function Jc(n,e){if(!n)throw new Error(e||"loaders.gl assertion failed.")}function Bue(n,e="3.0.12"){return Jc(n,"no worker provided"),!(!e||!n.version)}const eu={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},jue=eu.global||eu.self||eu.window||{},mO="object"!=typeof process||"[object process]"!==String(process)||process.browser,_O="function"==typeof importScripts,Vue="undefined"!=typeof window&&void 0!==window.orientation,wz="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version),yO=(wz&&parseFloat(wz[1]),new Map);function Ez(n){const e=new Blob([n],{type:"application/javascript"});return URL.createObjectURL(e)}function Sz(n,e=!0,t){const i=t||new Set;if(n)if(xz(n))i.add(n);else if(xz(n.buffer))i.add(n.buffer);else if(!ArrayBuffer.isView(n)&&e&&"object"==typeof n)for(const r in n)Sz(n[r],e,i);return void 0===t?Array.from(i):[]}function xz(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 bO=()=>{};class Cz{static isSupported(){return"undefined"!=typeof Worker}constructor(e){Kn(this,"name",void 0),Kn(this,"source",void 0),Kn(this,"url",void 0),Kn(this,"terminated",!1),Kn(this,"worker",void 0),Kn(this,"onMessage",void 0),Kn(this,"onError",void 0),Kn(this,"_loadableURL","");const{name:t,source:i,url:r}=e;Jc(i||r),this.name=t,this.source=i,this.url=r,this.onMessage=bO,this.onError=s=>console.log(s),this.worker=this._createBrowserWorker()}destroy(){this.onMessage=bO,this.onError=bO,this.worker.terminate(),this.terminated=!0}get isRunning(){return Boolean(this.onMessage)}postMessage(e,t){t=t||Sz(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){Jc(n.source&&!n.url||!n.source&&n.url);let e=yO.get(n.source||n.url);return e||(n.url&&(e=function(n){return n.startsWith("http")?Ez(function(n){return`try {\n importScripts('${n}');\n} catch (error) {\n console.error(error);\n throw error;\n}`}(n)):n}(n.url),yO.set(n.url,e)),n.source&&(e=Ez(n.source),yO.set(n.source,e))),Jc(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 Gue{constructor(e,t){Kn(this,"name",void 0),Kn(this,"workerThread",void 0),Kn(this,"isRunning",void 0),Kn(this,"result",void 0),Kn(this,"_resolve",void 0),Kn(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){Jc(this.isRunning),this.isRunning=!1,this._resolve(e)}error(e){Jc(this.isRunning),this.isRunning=!1,this._reject(e)}}class $ue{constructor(e){Kn(this,"name","unnamed"),Kn(this,"source",void 0),Kn(this,"url",void 0),Kn(this,"maxConcurrency",1),Kn(this,"maxMobileConcurrency",1),Kn(this,"onDebug",()=>{}),Kn(this,"reuseWorkers",!0),Kn(this,"props",{}),Kn(this,"jobQueue",[]),Kn(this,"idleQueue",[]),Kn(this,"count",0),Kn(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=ot(ot({},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 oi(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 oi(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 Gue(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 Qu{static isSupported(){return Cz.isSupported()}static getWorkerFarm(e={}){return Qu._workerFarm=Qu._workerFarm||new Qu({}),Qu._workerFarm.setProps(e),Qu._workerFarm}constructor(e){Kn(this,"props",void 0),Kn(this,"workerPools",new Map),this.props=ot({},Wue),this.setProps(e),this.workerPools=new Map}destroy(){for(const e of this.workerPools.values())e.destroy()}setProps(e){this.props=ot(ot({},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 $ue({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 Yue(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 Jc(r),r}function Kue(n,e){return!!Qu.isSupported()&&n.worker&&(null==e?void 0:e.worker)}function Xue(n,e,t,i,r){return vO.apply(this,arguments)}function vO(){return(vO=oi(function*(n,e,t,i,r){const s=n.id,o=Yue(n,t),l=Qu.getWorkerFarm(t).getWorkerPool({name:s,url:o});t=JSON.parse(JSON.stringify(t));const c=yield l.startJob("process-on-worker",Que.bind(null,r));return c.postMessage("process",{input:e,options:t}),yield(yield c.result).result})).apply(this,arguments)}function Que(n,e,t,i){return wO.apply(this,arguments)}function wO(){return(wO=oi(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)}Kn(Qu,"_workerFarm",void 0);var Tz=Je(521);function Mz(n){if(function(n){return n&&"object"==typeof n&&n.isBuffer}(n)&&(n=function(n){return Tz.toArrayBuffer?Tz.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 tde(...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 Dz(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 nde(n){return SO.apply(this,arguments)}function SO(){return(SO=oi(function*(n){const e=[];var r,t=!0,i=!1;try{for(var o,a,s=nO(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 tde(...e)})).apply(this,arguments)}const sde=262144;function Iz(n){this.wrapped=n}function z0(n){return new Iz(n)}function H0(n){var e,t;function r(o,a){try{var l=n[o](a),c=l.value,u=c instanceof Iz;Promise.resolve(u?c.wrapped:c).then(function(h){u?r("return"===o?"return":"next",h):s(l.done?"return":"normal",h)},function(h){r("throw",h)})}catch(h){s("throw",h)}}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 u={key:o,arg:a,resolve:l,reject:c,next:null};t?t=t.next=u:(e=t=u,r(o,a))})},"function"!=typeof n.return&&(this.return=void 0)}function CO(n){return function(){return new H0(n.apply(this,arguments))}}function AO(){return(AO=CO(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(DO)}function fde(n,e,t){return IO.apply(this,arguments)}function IO(){return(IO=oi(function*(n,e,t){const i=n instanceof ArrayBuffer||ArrayBuffer.isView(n);if("string"==typeof n||i)return hde(n,e);if(em(n)&&(n=yield fz(n)),U0(n)){const r=n;return yield Aue(r),e.binary?yield r.arrayBuffer():yield r.text()}if(uz(n)&&(n=dde(n,t)),hue(n)||fue(n))return nde(n);throw new Error(DO)})).apply(this,arguments)}function gde(n,e,t=null){if(t)return t;const i=ot({fetch:_z(e,n)},n);return Array.isArray(i.loaders)||(i.loaders=null),i}function mde(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 Rz=()=>{const n=pO();return n.loaderRegistry=n.loaderRegistry||[],n.loaderRegistry};function Nz(n){const e=Rz();n=Array.isArray(n)?n:[n];for(const t of n){const i=rO(t);e.find(r=>i===r)||e.unshift(i)}}const yde=/\.([^.]+)$/;function bde(n){return NO.apply(this,arguments)}function NO(){return(NO=oi(function*(n,e=[],t,i){if(!Fz(n))return null;let r=Pz(n,e,Cn(ot({},t),{nothrow:!0}),i);if(r)return r;if(em(n)&&(r=Pz(n=yield n.slice(0,10).arrayBuffer(),e,t,i)),!(r||null!=t&&t.nothrow))throw new Error(kz(n));return r})).apply(this,arguments)}function Pz(n,e=[],t,i){if(!Fz(n))return null;if(e&&!Array.isArray(e))return rO(e);let r=[];e&&(r=r.concat(e)),null!=t&&t.ignoreRegisteredLoaders||r.push(...Rz()),function(n){for(const e of n)rO(e)}(r);const s=function(n,e,t,i){const{url:r,type:s}=$S(n),o=r||(null==i?void 0:i.url);let a=null;return null!=t&&t.mimeType&&(a=PO(e,null==t?void 0:t.mimeType)),a=a||function(n,e){const t=e&&yde.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||PO(e,s),a=a||function(n,e){if(!e)return null;for(const t of n)if("string"==typeof e){if(Cde(e,t))return t}else if(ArrayBuffer.isView(e)){if(Lz(e.buffer,e.byteOffset,t))return t}else if(e instanceof ArrayBuffer&&Lz(e,0,t))return t;return null}(e,n),a=a||PO(e,null==t?void 0:t.fallbackMimeType),a}(n,r,t,i);if(!(s||null!=t&&t.nothrow))throw new Error(kz(n));return s}function Fz(n){return!(n instanceof Response&&204===n.status)}function kz(n){const{url:e,type:t}=$S(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)?FO(n.buffer,n.byteOffset,e):n instanceof ArrayBuffer?FO(n,0,e):""}(n)}", contentType: "${t}"`),e&&(i+=` url: ${e}`),i}function PO(n,e){for(const t of n)if(t.mimeTypes&&t.mimeTypes.includes(e)||e===`application/x.${t.id}`)return t;return null}function Cde(n,e){return e.testText?e.testText(n):(Array.isArray(e.tests)?e.tests:[e.tests]).some(i=>n.startsWith(i))}function Lz(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 tu=new Uint8ClampedArray(0);const kde={data:{type:"data",value:Pde,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=Cn(ot({},r),{fetch:Cn(ot({},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:G0(n,i),persistent:!1}),l=!0),l?o.subscribe({resourceId:n,onChange:c=>t.internalState.reloadAsyncProp(e,c),consumerId:t.id,requestId:e}):G0(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:ji.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 $0=(()=>{class n extends uue{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=nz(t,{viewport:i,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem}),[s,o,a]=YU(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=ot({},n);let{coordinateSystem:t}=n;const{viewport:i,coordinateOrigin:r,fromCoordinateSystem:s,fromCoordinateOrigin:o}=n;return t===ji.DEFAULT&&(t=i.isGeospatial?ji.LNGLAT:ji.CARTESIAN),void 0===s&&(e.fromCoordinateSystem=t),void 0===o&&(e.fromCoordinateOrigin=r),e.coordinateSystem=t,e}(e),{geospatialOrigin:l,shaderCoordinateOrigin:c,offsetMode:u}=BU(t,i,r),h=nz(n,{viewport:t,modelMatrix:s,coordinateSystem:o,coordinateOrigin:a,offsetMode:u});u&&function(n,e,t){n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2]}(h,h,t.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===ji.DEFAULT||t===ji.LNGLAT||t===ji.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){pc(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=zle(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 u of c)o.invalidateAll(u);else o.invalidateAll()}const l=i.highlightedObjectIndex>=0||i.pickable;if((t.highlightedObjectIndex>=0||t.pickable)!==l&&o){const{pickingColors:c,instancePickingColors:u}=o.attributes,h=c||u;h&&(l&&h.constant&&(h.constant=!1,o.invalidate(h.id)),!h.value&&!l&&(h.constant=!0,h.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||!Fde({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(tu.length/3);if(this.internalState.usesPickingColorCache=!0,rBz&&Ri.warn("Layer has too many data objects. Picking might not be able to distinguish all objects.")(),tu=x0.allocate(tu,i,{size:3,copy:!0,maxCount:Math.max(i,Bz)});const s=Math.floor(tu.length/3),o=[];for(let a=r;a{const c={moduleParameters:t,uniforms:i,parameters:r,context:this.context};for(const u of this.props.extensions)u.draw.call(this,c,u);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&&To("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=IU({newProps:n,oldProps:e,propTypes:GI(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&&OU(n,e,"all"))return{all:!0};const t={};let i=!1;for(const r in n.updateTriggers)"all"!==r&&OU(n,e,r)&&(t[r]=!0,i=t);return i}(n,e)),{dataChanged:i,propsChanged:t,updateTriggersChanged:r,extensionsChanged:Fle(n,e),transitionsChanged:Rle(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=GI(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 Sle(this.context.gl,{id:this.props.id,stats:this.context.stats,timeline:this.context.timeline})}_initState(){pc(!this.internalState&&!this.state),pc(isFinite(this.props.coordinateSystem));const t=this._getAttributeManager();t&&t.addInstanced({instancePickingColors:{type:5121,size:3,noAlloc:!0,update:this.calculateInstancePickingColors}}),this.internalState=new due({attributeManager:t,layer:this}),this.clearChangeFlags(),this.state={},Object.defineProperty(this.state,"attributeManager",{get:()=>(Ri.deprecated("layer.state.attributeManager","layer.getAttributeManager()"),t)}),this.internalState.layer=this,this.internalState.uniformTransitions=new Mle(this.context.timeline),this.internalState.onAsyncPropUpdated=this._onAsyncPropUpdated.bind(this),this.internalState.setAsyncProps(this.props)}_transferState(t){To("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=kde,n})(),jz=(()=>{class n extends $0{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:u,coordinateSystem:h,coordinateOrigin:p,wrapLongitude:g,positionFormat:m,modelMatrix:w,extensions:C,fetch:H,_subLayerProps:U}=this.props,de={opacity:i,pickable:r,visible:s,parameters:o,getPolygonOffset:a,highlightedObjectIndex:l,autoHighlight:c,highlightColor:u,coordinateSystem:h,coordinateOrigin:p,wrapLongitude:g,positionFormat:m,modelMatrix:w,extensions:C,fetch:H},Ae=U&&U[t.id],Pe=Ae&&Ae.updateTriggers,Be=t.id||"sublayer";if(Ae){const et=this.constructor._propTypes,wt=t.type?t.type._propTypes:{};for(const vt in Ae){const Ct=wt[vt]||et[vt];Ct&&"accessor"===Ct.type&&(Ae[vt]=this.getSubLayerAccessor(Ae[vt]))}}Object.assign(de,t,Ae),de.id="".concat(this.props.id,"-").concat(Be),de.updateTriggers=ot(ot({all:this.props.updateTriggers.all},t.updateTriggers),Pe);for(const et of C){const wt=et.getSubLayerProps.call(this,et);wt&&Object.assign(de,wt,{updateTriggers:Object.assign(de.updateTriggers,wt.updateTriggers)})}return de}_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=EI(t,Boolean),this.internalState.subLayers=t),To("compositeLayer.renderLayers",this,i,t);for(const r of t)r.parent=this}}return n.layerName="CompositeLayer",n})();const Bde=/([0-9]+\.?[0-9]*)(%|px)/;function qS(n){switch(typeof n){case"number":return{position:n,relative:!1};case"string":const e=n.match(Bde);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 YS(n,e){return n.relative?Math.round(n.position*e):n.position}function W0(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)&&W0(i,r)))return!1}return!0}class jO{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:u=1e3,modelMatrix:h=null,viewportInstance:p=null,type:g=Jg}=e;pc(!p||p instanceof Jg),this.viewportInstance=p,this.id=t||this.constructor.displayName||"view",this.type=g,this.props=Cn(ot({},e),{id:this.id,projectionMatrix:a,fovy:l,near:c,far:u,modelMatrix:h}),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):W0(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=ot({},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:YS(this._x,e),y:YS(this._y,t),width:YS(this._width,e),height:YS(this._height,t)}}_getControllerProps(e){let t=this.props.controller;return t?!0===t?e:("function"==typeof t&&(t={type:t}),ot(ot({},e),t)):null}_getViewport(e,t){const{type:i}=this;return new i(ot(ot(ot({},e),this.props),t))}_parseDimensions({x:e,y:t,width:i,height:r}){this._x=qS(e),this._y=qS(t),this._width=qS(i),this._height=qS(r)}}const q0=()=>{},Vz={transitionEasing:n=>n,transitionInterruption:1,onTransitionStart:q0,onTransitionInterrupt:q0,onTransitionEnd:q0};class jde{constructor(e,t={}){this.ControllerState=e,this.props=ot(ot({},Vz),t),this.propsInTransition=null,this.transition=new F0(t.timeline),this.onViewStateChange=t.onViewStateChange||q0,this.onStateChange=t.onStateChange||q0,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=ot(ot({},Vz),e),this.props=e,this._shouldIgnoreViewportChange(i,e))return t;if(this._isTransitionEnabled(e)){const{interruption:r,endProps:s}=this.transition.settings,o=ot(ot({},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(ot(ot({},this.props),c)).getViewportProps(),this.onViewStateChange({viewState:this.propsInTransition,oldViewState:this.props})}}const Uz=["longitude","latitude","zoom","bearing","pitch"],Ude=["longitude","latitude","zoom"];class zz 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)||!C0(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];pc(Number.isFinite(i)||Array.isArray(i),"".concat(t," is required for transition"))})}}{constructor(e={}){super((Array.isArray(e)?e:e.transitionProps)||{compare:Uz,extract:Uz,required:Ude}),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]=yS(e[s]||0,t[s]||0,i);if(t.aroundPosition){const s=this.opts.makeViewport(ot(ot({},t),r));Object.assign(r,s.panByPosition(t.aroundPosition,yS(e.around,t.around,i)))}return r}}const dh={transitionDuration:0},zde={transitionDuration:300,transitionEasing:n=>n,transitionInterruption:1},XS=n=>1-(1-n)*(1-n),tm_WHEEL=["wheel"],tm_PAN=["panstart","panmove","panend"],tm_PINCH=["pinchstart","pinchmove","pinchend"],tm_TRIPLE_PAN=["tripanstart","tripanmove","tripanend"],tm_DOUBLE_TAP=["doubletap"],tm_KEYBOARD=["keydown"];class VO{constructor(e,t={}){this.ControllerState=e,this.controllerState=null,this.controllerStateProps=null,this.eventManager=null,this.transitionManager=new jde(e,Cn(ot({},t),{onViewStateChange:this._onTransition.bind(this),onStateChange:this._setInteractionState.bind(this)}));const i=this.linearTransitionProps;this._transition=i&&Cn(ot({},zde),{transitionInterpolator:new zz({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(ot(ot({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,u=Boolean(this.onViewStateChange);this.toggleEvents(tm_WHEEL,u&&i),this.toggleEvents(tm_PAN,u&&(r||s)),this.toggleEvents(tm_PINCH,u&&(a||l)),this.toggleEvents(tm_TRIPLE_PAN,u&&l),this.toggleEvents(tm_DOUBLE_TAP,u&&o),this.toggleEvents(tm_KEYBOARD,u&&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=ot(ot({},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,dh,{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,dh,{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,Cn(ot({},this._getTransitionProps()),{transitionDuration:t,transitionEasing:XS}),{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,dh,{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,Cn(ot({},this._getTransitionProps()),{transitionDuration:t,transitionEasing:XS}),{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,Cn(ot({},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,dh,{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,dh,{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,Cn(ot({},this._getTransitionProps()),{transitionDuration:t,transitionEasing:XS}),{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,dh,{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,dh,{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,Cn(ot({},this._getTransitionProps({around:r})),{transitionDuration:t,transitionEasing:XS}),{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?Cn(ot({},t),{transitionInterpolator:new zz(Cn(ot({},e),{transitionProps:this.linearTransitionProps,makeViewport:this.controllerState.makeViewport}))}):t:dh}}class Hz{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 hh_target=[0,0,0];class QS extends Hz{constructor({makeViewport:e,width:t,height:i,rotationX:r=0,rotationOrbit:s=0,target:o=hh_target,zoom:a=0,minRotationX:l=-90,maxRotationX:c=90,minZoom:u=-(1/0),maxZoom:h=Infinity,startPanPosition:p,startRotatePos:g,startRotationX:m,startRotationOrbit:w,startZoomPosition:C,startZoom:H}){super({width:t,height:i,rotationX:r,rotationOrbit:s,target:o,zoom:a,minRotationX:l,maxRotationX:c,minZoom:u,maxZoom:h}),this._state={startPanPosition:p,startRotatePos:g,startRotationX:m,startRotationOrbit:w,startZoomPosition:C,startZoom:H},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 u=(e[0]-r[0])/a;(s<-90||s>90)&&(u*=-1),c={rotationX:s+(e[1]-r[1])/l*180,rotationOrbit:o+180*u}}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=ot({},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(Cn(ot({},this._viewportProps),{zoom:a}));return this._getUpdatedState(ot({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),Va(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 QS(ot(ot(ot({},this._viewportProps),this._state),e))}_applyConstraints(e){const{maxZoom:t,minZoom:i,zoom:r,maxRotationX:s,minRotationX:o,rotationOrbit:a}=e;return e.zoom=Va(r,i,t),e.rotationX=Va(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 Gde extends VO{constructor(e){super(QS,e)}get linearTransitionProps(){return["target","zoom","rotationX","rotationOrbit"]}}class $de extends VO{constructor(e){e.dragMode=e.dragMode||"pan",super(QS,e)}_onPanRotate(e){return!1}get linearTransitionProps(){return["target","zoom"]}}const Wde=(new qn).lookAt({eye:[0,0,1]});function qde({width:n,height:e,near:t,far:i}){return n=n||1,e=e||1,(new qn).ortho({left:-n/2,right:n/2,bottom:-e/2,top:e/2,near:t,far:i})}class Yde 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(Cn(ot({},e),{longitude:null,position:a,viewMatrix:Wde.clone().scale([c,c*(l?-1:1),c]),projectionMatrix:qde({width:t,height:i,near:r,far:s}),zoom:o}))}panByPosition(e,t){const r=BS([],e,jU([],L0(t,this.pixelUnprojectionMatrix)));return{target:BS([],this.center,r)}}}let Kde=(()=>{class n extends jO{constructor(t){super(Cn(ot({},t),{type:Yde}))}get controller(){return this._getControllerProps({type:$de})}}return n.displayName="OrthographicView",n})();const ZS=Math.PI/180;function Xde({height:n,fovy:e,orbitAxis:t,rotationX:i,rotationOrbit:r,zoom:s}){const o=.5/Math.tan(e*ZS/2),a="Z"===t?[0,0,1]:[0,1,0],l="Z"===t?[0,-o,0]:[0,0,o],c=(new qn).lookAt({eye:l,up:a});c.rotateX(i*ZS),"Z"===t?c.rotateZ(r*ZS):c.rotateY(r*ZS);const u=Math.pow(2,s)/(n||1);return c.scale(u),c}class Qde 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(Cn(ot({},e),{longitude:null,viewMatrix:Xde({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]=L0([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 Zde=(()=>{class n extends jO{constructor(t={}){const{orbitAxis:i="Z"}=t;super(Cn(ot({},t),{orbitAxis:i,type:Qde}))}get controller(){return this._getControllerProps({type:Gde})}}return n.displayName="OrbitView",n})();const Jde=[255,255,255],ehe=1;let the=0;class Gz{constructor(e={}){const{color:t=Jde}=e,{intensity:i=ehe}=e;this.id=e.id||"ambient-".concat(the++),this.color=t,this.intensity=i,this.type="ambient"}}const nhe=[255,255,255],ihe=1,rhe=[0,0,-1];let she=0;class $z{constructor(e={}){const{color:t=nhe}=e,{intensity:i=ihe}=e,{direction:r=rhe}=e,{_shadow:s=!1}=e;this.id=e.id||"directional-".concat(she++),this.color=t,this.intensity=i,this.type="directional",this.direction=new Ao(r).normalize().toArray(),this.shadow=s}getProjectedLight(){return this}}class Wz{constructor(e={}){const{id:t="effect"}=e;this.id=t,this.props=ot({},e)}preRender(){}getModuleParameters(){}cleanup(){}}class UO extends class{constructor(e,t={}){const{id:i="pass"}=t;this.id=i,this.gl=e,this.props=ot({},t)}setProps(e){Object.assign(this.props,e)}render(){}cleanup(){}}{render(e){return $u(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){$u(n,{viewport:[0,0,n.drawingBufferWidth,n.drawingBufferHeight]}),n.clear(16640)}(o);const a=[];for(const l of t){const c=l.viewport||l,u=i&&i[c.id];r(c);const h=this._getDrawLayerParams(c,e);e.view=u;const p=c.subViewports||[c];for(const g of p){e.viewport=g;const m=this._drawLayersInViewport(o,e,h);a.push(m)}}return a}_getDrawLayerParams(e,{layers:t,pass:i,layerFilter:r,effects:s,moduleParameters:o}){const a=[],l=qz(),c={viewport:e,isPicking:i.startsWith("picking"),renderPass:i};for(let u=0;uhI(e,c))}const l={totalCount:t.length,visibleCount:0,compositeCount:0,pickableCount:0};$u(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 u=t[l]=t[l]||qz(e[l],e);c=u(r,s),t[a]=u}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 che extends UO{constructor(e,t){super(e,t),this.shadowMap=new _a(e,{width:1,height:1,parameters:{10241:9729,10240:9729,10242:33071,10243:33071}}),this.depthBuffer=new zg(e,{format:33189,width:1,height:1}),this.fbo=new Fs(e,{id:"shadowmap",width:1,height:1,attachments:{36064:this.shadowMap,36096:this.depthBuffer}})}render(e){const t=this.fbo;fc(this.gl,{depthRange:[0,1],depthTest:!0,blend:!1,clearColor:[1,1,1,1]},()=>{const i=e.viewports[0],r=jg(this.gl),s=i.width*r,o=i.height*r;(s!==t.width||o!==t.height)&&t.resize({width:s,height:o}),super.render(Cn(ot({},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 dhe=Object.keys(ji).map(n=>"const int COORDINATE_SYSTEM_".concat(n," = ").concat(ji[n],";")).join(""),hhe=Object.keys(Kc).map(n=>"const int PROJECTION_MODE_".concat(n," = ").concat(Kc[n],";")).join(""),fhe="".concat(dhe,"\n").concat(hhe,"\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"),phe={},zO={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:fhe,getUniforms:function(n=phe){return n.viewport?function({viewport:n,devicePixelRatio:e=1,modelMatrix:t=null,coordinateSystem:i=ji.DEFAULT,coordinateOrigin:r,autoWrapLongitude:s=!1}={}){i===ji.DEFAULT&&(i=n.isGeospatial?ji.LNGLAT:ji.CARTESIAN);const o=_ce({viewport:n,devicePixelRatio:e,coordinateSystem:i,coordinateOrigin:r});return o.project_uWrapLongitude=s,o.project_uModelMatrix=t||pce,o}(n):{}}},yhe=PS(function({viewport:n,center:e}){return new qn(n.viewProjectionMatrix).invert().transform(e)}),bhe=PS(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=L0([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 Ao(n.center).negate()),l=s.map(u=>a.transform(u)),c=(new qn).ortho({left:Math.min(...l.map(u=>u[0])),right:Math.max(...l.map(u=>u[0])),bottom:Math.min(...l.map(u=>u[1])),top:Math.max(...l.map(u=>u[1])),near:Math.min(...l.map(u=>-u[2])),far:Math.max(...l.map(u=>-u[2]))});t.push(c.multiplyRight(o))}return t}),vhe=[0,0,0,1],whe=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0],HO={name:"shadow",dependencies:[zO],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||vhe,shadow_uLightId:n.shadowLightId||0,shadow_uLightCount:n.shadowMatrices.length},i=yhe({viewport:n.viewport,center:e.project_uCenter}),r=[],s=bhe({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{}}},Ahe={color:[255,255,255],intensity:1},Yz=[{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 GO extends Wz{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=N0.getDefaultProgramManager(e),HO&&this.programManager.addDefaultModule(HO)),this.dummyShadowMap||(this.dummyShadowMap=new _a(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(HO),this.programManager=null)}_createLightMatrix(){const e=[];for(const t of this.directionalLights){const i=(new qn).lookAt({eye:new Ao(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=Dhe++;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 Ihe{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=G0(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 Ohe{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 Ihe(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 Rhe=[{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"},zO],Nhe=["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 Phe(n){const e=N0.getDefaultProgramManager(n);for(const t of Rhe)e.addDefaultModule(t);for(const t of Nhe)e.addShaderHook(t);return e}const Lhe=Object.seal({layerManager:null,resourceManager:null,deck:null,gl:null,stats:null,shaderCache:null,pickingFBO:null,mousePosition:null,userData:{}});class Bhe{constructor(e,{deck:t,stats:i,viewport:r,timeline:s}={}){this.lastRenderedLayers=[],this.layers=[],this.resourceManager=new Ohe({gl:e,protocol:"deck://"}),this.context=Cn(ot({},Lhe),{layerManager:this,gl:e,deck:t,programManager:e&&Phe(e),stats:i||new sI({id:"deck.gl"}),viewport:r||new Jg({id:"DEFAULT-INITIAL-VIEWPORT"}),timeline:s||new Kz,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){To("layerManager.setLayers",this,t,e),this.lastRenderedLayers=e,e=EI(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 To("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]?Ri.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&&Ri.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 jhe{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=EI(e,Boolean),this._diffViews(e,this.views)&&this.setNeedsUpdate("views changed"),this.views=e}_setViewState(e){e?(!W0(e,this.viewState)&&this.setNeedsUpdate("viewState changed"),this.viewState=e):Ri.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)(ot({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=Cn(ot(ot(ot({},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 u=r[a.id];a.controller&&!u&&(s=!0),(s||!a.controller)&&u&&(u.finalize(),u=null),this.controllers[a.id]=this._updateController(a,l,c,u),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 Uhe extends Hz{constructor({makeViewport:e,width:t,height:i,latitude:r,longitude:s,zoom:o,bearing:a=0,pitch:l=0,altitude:c=1.5,maxZoom:u=20,minZoom:h=0,maxPitch:p=60,minPitch:g=0,startPanLngLat:m,startZoomLngLat:w,startRotatePos:C,startBearing:H,startPitch:U,startZoom:de,normalize:Ae}={}){pc(Number.isFinite(s)),pc(Number.isFinite(r)),pc(Number.isFinite(o)),super({width:t,height:i,latitude:r,longitude:s,zoom:o,bearing:a,pitch:l,altitude:c,maxZoom:u,minZoom:h,maxPitch:p,minPitch:g,normalize:Ae}),this._state={startPanLngLat:m,startZoomLngLat:w,startRotatePos:C,startBearing:H,startPitch:U,startZoom:de},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(Cn(ot({},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(Cn(ot({},this._viewportProps),{zoom:o}));return this._getUpdatedState(ot({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=ot({},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(ot(ot(ot({makeViewport:this.makeViewport},this._viewportProps),this._state),e))}_applyConstraints(e){const{maxZoom:t,minZoom:i,zoom:r}=e;e.zoom=Va(r,i,t);const{maxPitch:s,minPitch:o,pitch:a}=e;e.pitch=Va(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=zU(t+180,360)-180),(o<-180||o>180)&&(o=zU(o+180,360)-180);const a=WI(e/512);if(r<=a)r=a,i=0;else{const l=e/2/Math.pow(2,r),c=Zg([0,l])[1];if(iu&&(i=u)}}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 Va(t+Math.log2(e),r,i)}_calculateNewPitchAndBearing({deltaScaleX:e,deltaScaleY:t,startBearing:i,startPitch:r}){t=Va(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 u=0;return r>0?Math.abs(l-o)>5&&(u=r/(o-l)*1.2):r<0&&o>5&&(u=1-s/o),u=Math.min(1,Math.max(-1,u)),{deltaScaleX:c,deltaScaleY:u}}}class zhe extends VO{constructor(e){e.dragMode=e.dragMode||"pan",super(Uhe,e)}setProps(e){const t=this.controllerStateProps;super.setProps(e),(!t||t.height!==e.height)&&this.updateViewport(new this.ControllerState(ot(ot({makeViewport:this.makeViewport},this.controllerStateProps),this._state)))}get linearTransitionProps(){return["longitude","latitude","zoom","bearing","pitch"]}}let Hhe=(()=>{class n extends jO{constructor(t){super(Cn(ot({},t),{type:tz}))}get controller(){return this._getControllerProps({type:zhe})}}return n.displayName="MapView",n})();const Ghe=new GO;class $he{constructor(){this.effects=[],this._internalEffects=[],this._needsRedraw="Initial render",this.setEffects()}setProps(e){"effects"in e&&(e.effects.length!==this.effects.length||!W0(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 GO)||this._internalEffects.push(Ghe)}}class Whe extends UO{}const Qz={blendFunc:[1,0,32771,0],blendEquation:32774};class Zz extends UO{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:u},pass:h="picking",redrawReason:p,pickZ:g}){const m=this.gl;return this.pickZ=g,fc(m,Cn(ot({scissorTest:!0,scissor:[a,l,c,u],clearColor:[0,0,0,0],depthMask:!0,depthTest:!0,depthRange:[0,1],colorMask:[!0,!0,!0,!0]},Qz),{blend:!g}),()=>{super.render({target:o,layers:e,layerFilter:t,views:i,viewports:r,onViewportActive:s,pass:h,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}:Cn(ot({},Qz),{blend:!0,blendColor:[0,0,0,this.useAlpha?(t+1)/255:1]});return ot(ot({},e.props.parameters),i)}}class Yhe{constructor(e){this.gl=e,this.layerFilter=null,this.drawPickingColors=!1,this.drawLayersPass=new Whe(e),this.pickLayersPass=new Zz(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||Fs.getDefaultFramebuffer(this.gl),this._preRender(e.effects,e);const i=this.lastPostProcessEffect?this.renderBuffers[0]:e.target,r=t.render(Cn(ot({},e),{target:i}));this._postRender(e.effects,e),this.renderCount++,To("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 Fs(this.gl),new Fs(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 Khe={pickedColor:null,pickedLayer:null,pickedObjectIndex:-1};function Xhe({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 u=r*r,h=-1,p=0;for(let g=0;gu)p+=4*l;else for(let C=0;C=0){const U=C+o-t,de=U*U+w;de<=u&&(u=de,h=p)}p+=4}}if(h>=0){const g=n[h+3]-1,m=n.slice(h,h+4),w=e[g];if(w){const C=w.decodePickingColor(m),H=Math.floor(h/4/l);return{pickedColor:m,pickedLayer:w,pickedObjectIndex:C,pickedX:o+(h/4-H*l),pickedY:a+H}}Ri.error("Picked non-existent layer. Is picking buffer corrupt?")()}}return Khe}function Jz({pickInfo:n,mode:e,viewports:t,layerFilter:i,pixelRatio:r,x:s,y:o,z:a}){const l=n&&n.pickedLayer,u=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)}))),h=u&&u.unproject([s-u.x,o-u.y],{targetZ:a});return{color:null,layer:null,viewport:u,index:-1,picked:!1,x:s,y:o,pixel:[s,o],coordinate:h,devicePixel:n&&[n.pickedX,n.pickedY],pixelRatio:r}}function Zhe(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 h=t.index,p=t.layerId,g=o&&o.props.id;if(g!==p||a!==h){if(g!==p){const m=r.find(w=>w.props.id===p);m&&l.unshift(m)}t.layerId=g,t.index=a,t.info=null}}const c=Jz(n),u=new Map;return u.set(null,c),l.forEach(h=>{let p=ot({},c);h===o&&(p.color=s,p.index=a,p.picked=!0),p=e4({layer:h,info:p,mode:i}),h===o&&"hover"===i&&(t.info=p),u.set(p.layer.id,p),"hover"===i&&p.layer.updateAutoHighlight(p)}),u}function e4({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 efe{constructor(e){this.gl=e,this.pickingFBO=null,this.pickLayersPass=new Zz(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],u=c&&c.unproject([e-c.x,t-c.y]),h={x:e,y:t,viewport:c,coordinate:u,layer:l};return l?ot(ot({},s),h):Object.assign(h,{color:null,object:null,index:-1})}_resizeBuffer(){const{gl:e}=this;return this.pickingFBO||(this.pickingFBO=new Fs(e),Fs.isSupported(e,{colorBufferFloat:!0})&&(this.depthFBO=new Fs(e),this.depthFBO.attach({36064:new _a(e,{format:Si(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?(Ri.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:u}){if(!(e=this._getPickable(e)))return{result:[],emptyInfo:Jz({viewports:i,x:r,y:s})};this._resizeBuffer();const h=jg(this.gl),p=nI(this.gl,[r,s],!0),g=[p.x+Math.floor(p.width/2),p.y+Math.floor(p.height/2)],m=Math.round(o*h),{width:w,height:C}=this.pickingFBO,H=this._getPickingRect({deviceX:g[0],deviceY:g[1],deviceRadius:m,deviceWidth:w,deviceHeight:C});let U;const de=[],Ae={};for(let Pe=0;Pe=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)}):Ri.error("Picked non-existent layer. Is picking buffer corrupt?")()}}}return Array.from(t.values())}({pickedColors:this._drawAndSample({layers:e,views:t,viewports:i,onViewportActive:u,deviceRect:{x:g,y:H,width:w.x+w.width-g,height:m-H},pass:"picking:".concat(l),redrawReason:l}),layers:e}),Pe=new Map,Be=Number.isFinite(c);for(let et=0;et=c);et++){const wt=Ae[et];let vt={color:wt.pickedColor,layer:null,index:wt.pickedObjectIndex,picked:!0,x:r,y:s,width:o,height:a,pixelRatio:h};vt=e4({layer:wt.pickedLayer,info:vt,mode:l}),Pe.has(vt.object)||Pe.set(vt.object,vt)}return Array.from(Pe.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:u,y:h,width:p,height:g}=s,m=new(l?Float32Array:Uint8Array)(p*g*4);return _S(c,{sourceX:u,sourceY:h,sourceWidth:p,sourceHeight:g,target:m}),m}_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 tfe={zIndex:1,position:"absolute",pointerEvents:"none",color:"#a0a7b4",backgroundColor:"#29323c",padding:"10px",top:0,left:0,display:"none"};class nfe{constructor(e){const t=e.parentElement;t&&(this.el=document.createElement("div"),this.el.className="deck-tooltip",Object.assign(this.el.style,tfe),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 t4(n,e){if(!n)throw new Error(e)}const nu={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},n4=nu.global||nu.self||nu.window,rfe="object"!=typeof process||"[object process]"!==String(process)||process.browser,i4="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version),{_parseImageNode:sfe}=(i4&&parseFloat(i4[1]),n4),$O="undefined"!=typeof Image,WO="undefined"!=typeof ImageBitmap,ofe=Boolean(sfe),qO=!!rfe||ofe;function r4(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 s4(n){switch(r4(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 cfe=/^data:image\/svg\+xml/,ufe=/\.svg((\?|#).*)?$/;function YO(n){return n&&(cfe.test(n)||ufe.test(n))}function dfe(n,e){if(YO(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 a4(n,e)}function a4(n,e){if(YO(e))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(n)])}function l4(n,e,t){return KO.apply(this,arguments)}function KO(){return(KO=oi(function*(n,e,t){const i=dfe(n,t),r=self.URL||self.webkitURL,s="string"!=typeof i&&r.createObjectURL(i);try{return yield hfe(s||i,e)}finally{s&&r.revokeObjectURL(s)}})).apply(this,arguments)}function hfe(n,e){return XO.apply(this,arguments)}function XO(){return(XO=oi(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 ffe={};let c4=!0;function pfe(n,e,t){return QO.apply(this,arguments)}function QO(){return(QO=oi(function*(n,e,t){let i;i=YO(t)?yield l4(n,e,t):a4(n,t);const r=e&&e.imagebitmap;return yield gfe(i,r)})).apply(this,arguments)}function gfe(n){return ZO.apply(this,arguments)}function ZO(){return(ZO=oi(function*(n,e=null){if((mfe(e)||!c4)&&(e=null),e)try{return yield createImageBitmap(n,e)}catch(t){console.warn(t),c4=!1}return yield createImageBitmap(n)})).apply(this,arguments)}function mfe(n){for(const e in n||ffe)return!1;return!0}const iu=!1,Y0=!0;function JO(n){const e=K0(n);return function(n){const e=K0(n);return e.byteLength>=24&&2303741511===e.getUint32(0,iu)?{mimeType:"image/png",width:e.getUint32(16,iu),height:e.getUint32(20,iu)}:null}(e)||function(n){const e=K0(n);if(!(e.byteLength>=3&&65496===e.getUint16(0,iu)&&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,iu)?{mimeType:"image/gif",width:e.getUint16(6,Y0),height:e.getUint16(8,Y0)}:null}(e)||function(n){const e=K0(n);return e.byteLength>=14&&16973===e.getUint16(0,iu)&&e.getUint32(2,Y0)===e.byteLength?{mimeType:"image/bmp",width:e.getUint32(18,Y0),height:e.getUint32(22,Y0)}:null}(e)}function K0(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 Efe(n,e){const{mimeType:t}=JO(n)||{},{_parseImageNode:i}=n4;return t4(i),i(n,t,e)}function eR(){return(eR=oi(function*(n,e,t){const r=((e=e||{}).image||{}).type||"auto",{url:s}=t||{};let a;switch(xfe(r)){case"imagebitmap":a=yield pfe(n,e,s);break;case"image":a=yield l4(n,e,s);break;case"data":a=yield Efe(n,e);break;default:t4(!1)}return"data"===r&&(a=s4(a)),a})).apply(this,arguments)}function xfe(n){switch(n){case"auto":case"data":return function(){if(WO)return"imagebitmap";if($O)return"image";if(qO)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}();default:return function(n){switch(n){case"auto":return WO||$O||qO;case"imagebitmap":return WO;case"image":return $O;case"data":return qO;default:throw new Error(`@loaders.gl/images: image ${n} not supported in this environment`)}}(n),n}}const tR={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 eR.apply(this,arguments)},tests:[n=>Boolean(JO(new DataView(n)))],options:{image:{type:"auto",decode:!0}}};var nm=Je(761);const Afe={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},X0="8.5.8",JS=nm.CO.deck&&nm.CO.deck.VERSION;if(JS&&JS!==X0)throw new Error("deck.gl - multiple versions detected: ".concat(JS," vs ").concat(X0));JS||(Ri.log(1,"deck.gl ".concat(X0))(),nm.CO.deck=Object.assign(nm.CO.deck||{},{VERSION:X0,version:X0,log:Ri,_registerLoggers:function(n){AI=n}}),Nz([Afe,[tR,{imagebitmap:{premultiplyAlpha:"none"}}]]));const Tfe=nm.CO.deck;class ex extends Wu{get[Symbol.toStringTag](){return"Query"}static isSupported(e,t=[]){const i=Si(e),r=vV(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 ex.isSupported(this.gl)?this.gl2.createQuery():null}_deleteHandle(){this.gl2.deleteQuery(this.handle)}}const u4=mS()&&"undefined"!=typeof document;let Lfe=0;class Bfe{constructor(e={}){const{onCreateContext:t=(C=>eV(C)),onAddHTML:i=null,onInitialize:r=(()=>{}),onRender:s=(()=>{}),onFinalize:o=(()=>{}),onError:a,gl:l=null,glOptions:c={},debug:u=!1,createFramebuffer:h=!1,autoResizeViewport:p=!0,autoResizeDrawingBuffer:g=!0,stats:m=If.get("animation-loop-"+Lfe++)}=e;let{useDevicePixels:w=!0}=e;"useDevicePixelRatio"in e&&(mn.deprecated("useDevicePixelRatio","useDevicePixels")(),w=e.useDevicePixelRatio),this.props={onCreateContext:t,onAddHTML:i,onInitialize:r,onRender:s,onFinalize:o,onError:a,gl:l,glOptions:c,debug:u,createFramebuffer:h},this.gl=l,this.needsRedraw=null,this.timeline=null,this.stats=m,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:w}),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=ex.isSupported(this.gl,["timers"])?new ex(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 oi(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 mn.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=u4?new Promise((e,t)=>{u4&&"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?rI(this.props.gl,e):this.onCreateContext(e),!pS(this.gl))throw new Error("AnimationLoop.onCreateContext - illegal context returned");(function(n){$u(n,tI)})(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)&&(mn.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)&&(mn.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 Fs(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 jfe=Je(524),tx=Je.n(jfe);const Vfe={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}))}}(tx().MouseInput);const Gfe=tx().Manager,ru=tx(),$fe=ru?[[ru.Pan,{event:"tripan",pointers:3,threshold:0,enable:!1}],[ru.Rotate,{enable:!1}],[ru.Pinch,{enable:!1}],[ru.Swipe,{enable:!1}],[ru.Pan,{threshold:0,enable:!1}],[ru.Press,{enable:!1}],[ru.Tap,{event:"doubletap",taps:2,enable:!1}],[ru.Tap,{event:"anytap",enable:!1}],[ru.Tap,{enable:!1}]]:null,f4={tripan:["rotate","pinch","pan"],rotate:["pinch"],pinch:["pan"],pan:["press","doubletap","anytap","tap"],doubletap:["anytap"],anytap:["tap"]},Wfe={doubletap:["tap"]},qfe={pointerdown:"pointerdown",pointermove:"pointermove",pointerup:"pointerup",touchstart:"pointerdown",touchmove:"pointermove",touchend:"pointerup",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup"},iR={KEY_EVENTS:["keydown","keyup"],MOUSE_EVENTS:["mousedown","mousemove","mouseup","mouseover","mouseout","mouseleave"],WHEEL_EVENTS:["wheel","mousewheel"]},Yfe={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"},p4={click:"tap",anyclick:"anytap",dblclick:"doubletap",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup",mouseover:"pointerover",mouseout:"pointerout",mouseleave:"pointerleave"},Kfe="undefined"!=typeof navigator&&navigator.userAgent?navigator.userAgent.toLowerCase():"",im="undefined"!=typeof window?window:global;"undefined"!=typeof global?global:window,"undefined"!=typeof document&&document;let g4=!1;try{const n={get passive(){return g4=!0,!0}};im.addEventListener("test",n,n),im.removeEventListener("test",n,n)}catch(n){}const Xfe=-1!==Kfe.indexOf("firefox"),{WHEEL_EVENTS:Qfe}=iR,_4=4.000244140625;class epe{constructor(e,t,i={}){this.element=e,this.callback=t,this.options=Object.assign({enable:!0},i),this.events=Qfe.concat(i.events||[]),this.handleEvent=this.handleEvent.bind(this),this.events.forEach(r=>e.addEventListener(r,this.handleEvent,!!g4&&{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;im.WheelEvent&&(Xfe&&e.deltaMode===im.WheelEvent.DOM_DELTA_PIXEL&&(t/=im.devicePixelRatio),e.deltaMode===im.WheelEvent.DOM_DELTA_LINE&&(t*=40));const i={x:e.clientX,y:e.clientY};0!==t&&t%_4==0&&(t=Math.floor(t/_4)),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:tpe}=iR,y4="pointermove",b4="pointerover",v4="pointerout",w4="pointerleave";class npe{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=tpe.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===y4&&(this.enableMoveEvent=t),e===b4&&(this.enableOverEvent=t),e===v4&&(this.enableOutEvent=t),e===w4&&(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:b4,srcEvent:e,pointerType:"mouse",target:e.target})}handleOutEvent(e){this.enableOutEvent&&"mouseout"===e.type&&this.callback({type:v4,srcEvent:e,pointerType:"mouse",target:e.target})}handleLeaveEvent(e){this.enableLeaveEvent&&"mouseleave"===e.type&&this.callback({type:w4,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:y4,srcEvent:e,pointerType:"mouse",target:e.target});break;case"mouseup":this.pressed=!1}}}const{KEY_EVENTS:ipe}=iR,E4="keydown";class rpe{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=ipe.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===E4&&(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:E4,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 x4="contextmenu";class spe{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===x4&&(this.options.enable=t)}handleEvent(e){!this.options.enable||this.callback({type:x4,center:{x:e.clientX,y:e.clientY},srcEvent:e,pointerType:"mouse",target:e.target})}}const ope={pointerdown:1,pointermove:2,pointerup:4,mousedown:1,mousemove:2,mouseup:4},C4={srcElement:"root",priority:0};class ype{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({},C4,i):C4;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 u=l.length-1;for(;u>=0&&!(l[u].priority>=c.priority);)u--;l.splice(u+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&&f4[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 epe(e,this._onOtherEvent,{enable:!1}),this.moveInput=new npe(e,this._onOtherEvent,{enable:!1}),this.keyInput=new rpe(e,this._onOtherEvent,{enable:!1,tabIndex:t.tabIndex}),this.contextmenuInput=new spe(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=Wfe[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 u in e)this._addEventHandler(u,e[u],i,r,s);return}const{manager:o,events:a}=this,l=p4[e]||e;let c=a.get(l);c||(c=new ype(this),a.set(l,c),c.recognizerName=Yfe[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(p4[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=qfe[t.type];i&&this.manager.emit(i,e)}_onOtherEvent(e){this.manager.emit(e.type,e)}}function Lf(){}const A4={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:Lf,onResize:Lf,onViewStateChange:Lf,onInteractionStateChange:Lf,onBeforeRender:Lf,onAfterRender:Lf,onLoad:Lf,onError:(n,e)=>Ri.error(n)(),_onMetrics:null,getCursor:({isDragging:n})=>n?"grabbing":"grab",debug:!1,drawPickingColors:!1};class ix{constructor(e){e=ot(ot({},A4),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&&Ri.warn("View state tracking is disabled. Use either `initialViewState` for auto update or `viewState` for manual update.")(),"IE"===(0,nm.qs)()&&Ri.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 sI({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&&x0.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&&Ri.removed("onLayerHover","onHover")(),"onLayerClick"in e&&Ri.removed("onLayerClick","onClick")(),e.initialViewState&&!W0(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](ot({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),pc(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:u,autoResizeDrawingBuffer:h}=e;return new Bfe({width:t,height:i,useDevicePixels:u,autoResizeDrawingBuffer:h,autoResizeViewport:!1,gl:r,onCreateContext:p=>eV(Cn(ot(ot({},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 Hhe({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,rI(e,{enable:!0,copyState:!0})),this.tooltip=new nfe(this.canvas),$u(e,{blend:!0,blendFunc:[770,771,1,771],polygonOffsetFill:!0,depthTest:!0,depthFunc:515}),this.props.onWebGLInitialized(e);const t=new Kz;t.play(),this.animationLoop.attachTimeline(t),this.eventManager=new vpe(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 Bj)this.eventManager.on(r,this._onEvent);this.viewManager=new jhe({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 Bhe(e,{deck:this,stats:this.stats,viewport:i,timeline:t}),this.effectManager=new $he,this.deckRenderer=new Yhe(e),this.deckPicker=new efe(e),this.setProps(this.props),this._updateCanvasSize(),this.props.onLoad()}_drawLayers(e,t){const{gl:i}=this.layerManager.context;$u(i,this.props.parameters),this.props.onBeforeRender({gl:i}),this.deckRenderer.renderLayers(ot({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(),Ri.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=Cn(ot({},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=Bj[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=If.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}}ix.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(Wz)),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}},ix.defaultProps=A4,ix.VERSION=Tfe.VERSION;const rx={name:"project32",dependencies:[zO],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"},xpe={pickingSelectedColor:null,pickingHighlightColor:new Uint8Array([0,255,255,255]),pickingActive:!1,pickingAttribute:!1},sx=ot({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=xpe){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}}),T4={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6};class fh{static get DRAW_MODE(){return T4}constructor(e={}){const{id:t=ga("geometry"),drawMode:i=T4.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?ot({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 M4=()=>{},Ipe={10241:9987,10240:9729,10242:33071,10243:33071};function Ope(n){return Math.pow(2,Math.ceil(Math.log2(n)))}function Rpe(n,e,t,i){return t===e.width&&i===e.height?e:(n.canvas.height=i,n.canvas.width=t,n.clearRect(0,0,n.canvas.width,n.canvas.height),n.drawImage(e,0,0,e.width,e.height,0,0,t,i),n.canvas)}function Q0(n){return n&&(n.id||n.url)}function D4(n,e,t){for(let i=0;i0){const{mapping:i,xOffset:r,yOffset:s,rowHeight:o,canvasHeight:a}=function({icons:n,buffer:e,mapping:t={},xOffset:i=0,yOffset:r=0,rowHeight:s=0,canvasWidth:o}){let a=[];for(let l=0;lo&&(D4(t,a,r),i=0,r=s+r+e,s=0,a=[]),a.push({icon:c,xOffset:i}),i=i+p+e,s=Math.max(s,h)}}return a.length>0&&D4(t,a,r),{mapping:t,rowHeight:s,xOffset:i,yOffset:r,canvasWidth:o,canvasHeight:Ope(s+r+e)}}({icons:t,buffer:this._buffer,canvasWidth:this._canvasWidth,mapping:this._mapping,rowHeight:this._rowHeight,xOffset:this._xOffset,yOffset:this._yOffset});this._rowHeight=o,this._mapping=i,this._xOffset=r,this._yOffset=s,this._canvasHeight=a,this._texture||(this._texture=new _a(this.gl,{width:this._canvasWidth,height:this._canvasHeight,parameters:Ipe})),this._texture.height!==this._canvasHeight&&(this._texture=function(n,e,t,i){const r=e.width,s=e.height,o=_V(e,{width:t,height:i});return function(n,e,t={}){const{sourceX:i=0,sourceY:r=0,targetMipmaplevel:s=0,targetInternalFormat:o=6408}=t;let{targetX:a,targetY:l,targetZ:c,width:u,height:h}=t;const{framebuffer:p,deleteFramebuffer:g}=S0(n);tn(p);const{gl:m,handle:w}=p,C=void 0!==a||void 0!==l||void 0!==c;a=a||0,l=l||0,c=c||0;const H=m.bindFramebuffer(36160,w);tn(e);let U=null;if(e instanceof Of&&(U=e,u=Number.isFinite(u)?u:U.width,h=Number.isFinite(h)?h:U.height,U.bind(0),e=U.target),C)switch(e){case 3553:case 34067:m.copyTexSubImage2D(e,s,a,l,i,r,u,h);break;case 35866:case 32879:Co(m).copyTexSubImage3D(e,s,a,l,c,i,r,u,h)}else m.copyTexImage2D(e,s,o,i,r,u,h,0);U&&U.unbind(),m.bindFramebuffer(36160,H||null),g&&p.delete()}(e,o,{targetY:0,width:r,height:s}),e.delete(),o}(0,this._texture,this._canvasWidth,this._canvasHeight)),this.onUpdate(),this._loadIcons(t)}}_loadIcons(e){const t=this._canvas.getContext("2d");for(const i of e)this._pendingCount++,G0(i.url,tR,this._loadOptions).then(r=>{const s=Q0(i),{x:o,y:a,width:l,height:c}=this._mapping[s],u=Rpe(t,r,l,c);this._texture.setSubImageData({data:u,x:o,y:a,width:l,height:c}),this._texture.generateMipmap(),this.onUpdate()}).catch(r=>{this.onError({url:i.url,source:i.source,sourceIndex:i.sourceIndex,loadOptions:this._loadOptions,error:r})}).finally(()=>{this._pendingCount--})}}const I4=[0,0,0,255],Lpe={iconAtlas:{type:"image",value:null,async:!0},iconMapping:{type:"object",value:{},async:!0},sizeScale:{type:"number",value:1,min:0},billboard:!0,sizeUnits:"pixels",sizeMinPixels:{type:"number",min:0,value:0},sizeMaxPixels:{type:"number",min:0,value:Number.MAX_SAFE_INTEGER},alphaCutoff:{type:"number",value:.05,min:0,max:1},getPosition:{type:"accessor",value:n=>n.position},getIcon:{type:"accessor",value:n=>n.icon},getColor:{type:"accessor",value:I4},getSize:{type:"accessor",value:1},getAngle:{type:"accessor",value:0},getPixelOffset:{type:"accessor",value:[0,0]},onIconError:{type:"function",value:null,compare:!1,optional:!0}};let Bpe=(()=>{class n extends $0{getShaders(){return super.getShaders({vs:"#define SHADER_NAME icon-layer-vertex-shader\n\nattribute vec2 positions;\n\nattribute vec3 instancePositions;\nattribute vec3 instancePositions64Low;\nattribute float instanceSizes;\nattribute float instanceAngles;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\nattribute vec4 instanceIconFrames;\nattribute float instanceColorModes;\nattribute vec2 instanceOffsets;\nattribute vec2 instancePixelOffset;\n\nuniform float sizeScale;\nuniform vec2 iconsTextureDim;\nuniform float sizeMinPixels;\nuniform float sizeMaxPixels;\nuniform bool billboard;\n\nvarying float vColorMode;\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\nvarying vec2 uv;\n\nvec2 rotate_by_angle(vec2 vertex, float angle) {\n float angle_radian = angle * PI / 180.0;\n float cos_angle = cos(angle_radian);\n float sin_angle = sin(angle_radian);\n mat2 rotationMatrix = mat2(cos_angle, -sin_angle, sin_angle, cos_angle);\n return rotationMatrix * vertex;\n}\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n geometry.uv = positions;\n geometry.pickingColor = instancePickingColors;\n uv = positions;\n\n vec2 iconSize = instanceIconFrames.zw;\n float sizePixels = clamp(\n project_size_to_pixel(instanceSizes * sizeScale), \n sizeMinPixels, sizeMaxPixels\n );\n float instanceScale = iconSize.y == 0.0 ? 0.0 : sizePixels / iconSize.y;\n vec2 pixelOffset = positions / 2.0 * iconSize + instanceOffsets;\n pixelOffset = rotate_by_angle(pixelOffset, instanceAngles) * instanceScale;\n pixelOffset += instancePixelOffset;\n pixelOffset.y *= -1.0;\n\n if (billboard) {\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, vec3(0.0), geometry.position);\n vec3 offset = vec3(pixelOffset, 0.0);\n DECKGL_FILTER_SIZE(offset, geometry);\n gl_Position.xy += project_pixel_size_to_clipspace(offset.xy);\n\n } else {\n vec3 offset_common = vec3(project_pixel_size(pixelOffset), 0.0);\n DECKGL_FILTER_SIZE(offset_common, geometry);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, offset_common, geometry.position); \n }\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n vTextureCoords = mix(\n instanceIconFrames.xy,\n instanceIconFrames.xy + iconSize,\n (positions.xy + 1.0) / 2.0\n ) / iconsTextureDim;\n\n vColor = instanceColors;\n DECKGL_FILTER_COLOR(vColor, geometry);\n\n vColorMode = instanceColorModes;\n}\n",fs:"#define SHADER_NAME icon-layer-fragment-shader\n\nprecision highp float;\n\nuniform float opacity;\nuniform sampler2D iconsTexture;\nuniform float alphaCutoff;\n\nvarying float vColorMode;\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\nvarying vec2 uv;\n\nvoid main(void) {\n geometry.uv = uv;\n\n vec4 texColor = texture2D(iconsTexture, vTextureCoords);\n vec3 color = mix(texColor.rgb, vColor.rgb, vColorMode);\n float a = texColor.a * opacity * vColor.a;\n\n if (a < alphaCutoff) {\n discard;\n }\n\n gl_FragColor = vec4(color, a);\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:[rx,sx]})}initializeState(){this.state={iconManager:new kpe(this.context.gl,{onUpdate:this._onUpdate.bind(this),onError:this._onError.bind(this)})},this.getAttributeManager().addInstanced({instancePositions:{size:3,type:5130,fp64:this.use64bitPositions(),transition:!0,accessor:"getPosition"},instanceSizes:{size:1,transition:!0,accessor:"getSize",defaultValue:1},instanceOffsets:{size:2,accessor:"getIcon",transform:this.getInstanceOffset},instanceIconFrames:{size:4,accessor:"getIcon",transform:this.getInstanceIconFrame},instanceColorModes:{size:1,type:5121,accessor:"getIcon",transform:this.getInstanceColorMode},instanceColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:!0,accessor:"getColor",defaultValue:I4},instanceAngles:{size:1,transition:!0,accessor:"getAngle"},instancePixelOffset:{size:2,transition:!0,accessor:"getPixelOffset"}})}updateState({oldProps:t,props:i,changeFlags:r}){super.updateState({props:i,oldProps:t,changeFlags:r});const s=this.getAttributeManager(),{iconAtlas:o,iconMapping:a,data:l,getIcon:c}=i,{iconManager:u}=this.state;u.setProps({loadOptions:i.loadOptions});let h=!1;if(o||this.internalState.isAsyncPropLoading("iconAtlas")?(t.iconAtlas!==i.iconAtlas&&u.setProps({iconAtlas:o,autoPacking:!1}),t.iconMapping!==i.iconMapping&&(u.setProps({iconMapping:a}),h=!0)):u.setProps({autoPacking:!0}),(r.dataChanged||r.updateTriggersChanged&&(r.updateTriggersChanged.all||r.updateTriggersChanged.getIcon))&&u.setProps({data:l,getIcon:c}),h&&(s.invalidate("instanceOffsets"),s.invalidate("instanceIconFrames"),s.invalidate("instanceColorModes")),r.extensionsChanged){var g;const{gl:m}=this.context;null===(g=this.state.model)||void 0===g||g.delete(),this.state.model=this._getModel(m),s.invalidateAll()}}get isLoaded(){return super.isLoaded&&this.state.iconManager.isLoaded}finalizeState(){super.finalizeState(),this.state.iconManager.finalize()}draw({uniforms:t}){const{sizeScale:i,sizeMinPixels:r,sizeMaxPixels:s,sizeUnits:o,billboard:a,alphaCutoff:l}=this.props,{iconManager:c}=this.state,{viewport:u}=this.context,h=c.getTexture();h&&this.state.model.setUniforms(t).setUniforms({iconsTexture:h,iconsTextureDim:[h.width,h.height],sizeScale:i*("pixels"===o?u.metersPerPixel:1),sizeMinPixels:r,sizeMaxPixels:s,billboard:a,alphaCutoff:l}).draw()}_getModel(t){return new Yg(t,Cn(ot({},this.getShaders()),{id:this.props.id,geometry:new fh({drawMode:6,attributes:{positions:{size:2,value:new Float32Array([-1,-1,-1,1,1,1,1,-1])}}}),isInstanced:!0}))}_onUpdate(){this.setNeedsRedraw()}_onError(t){const{onIconError:i}=this.getCurrentLayer().props;i?i(t):Ri.error(t.error)()}getInstanceOffset(t){const i=this.state.iconManager.getIconMapping(t);return[i.width/2-i.anchorX||0,i.height/2-i.anchorY||0]}getInstanceColorMode(t){return this.state.iconManager.getIconMapping(t).mask?1:0}getInstanceIconFrame(t){const i=this.state.iconManager.getIconMapping(t);return[i.x||0,i.y||0,i.width||0,i.height||0]}}return n.layerName="IconLayer",n.defaultProps=Lpe,n})();const R4=[],Vpe={getIconOffsets:{type:"accessor",value:n=>n.offsets},alphaCutoff:.001,smoothing:.1,outlineWidth:0,outlineColor:{type:"color",value:[0,0,0,255]}};let Upe=(()=>{class n extends Bpe{getShaders(){return Cn(ot({},super.getShaders()),{fs:"#define SHADER_NAME multi-icon-layer-fragment-shader\n\nprecision highp float;\n\nuniform float opacity;\nuniform sampler2D iconsTexture;\nuniform float gamma;\nuniform bool sdf;\nuniform float alphaCutoff;\nuniform float buffer;\nuniform float outlineBuffer;\nuniform vec4 outlineColor;\n\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\nvarying vec2 uv;\n\nvoid main(void) {\n geometry.uv = uv;\n\n if (!picking_uActive) {\n float alpha = texture2D(iconsTexture, vTextureCoords).a;\n vec4 color = vColor;\n if (sdf) {\n float distance = alpha;\n alpha = smoothstep(buffer - gamma, buffer + gamma, distance);\n\n if (outlineBuffer > 0.0) {\n float inFill = alpha;\n float inBorder = smoothstep(outlineBuffer - gamma, outlineBuffer + gamma, distance);\n color = mix(outlineColor, vColor, inFill);\n alpha = inBorder;\n }\n }\n float a = alpha * color.a;\n \n if (a < alphaCutoff) {\n discard;\n }\n\n gl_FragColor = vec4(color.rgb, a * opacity);\n }\n\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n"})}initializeState(){super.initializeState(),this.getAttributeManager().addInstanced({instanceOffsets:{size:2,accessor:"getIconOffsets"},instancePickingColors:{type:5121,size:3,accessor:(i,{index:r,target:s})=>this.encodePickingColor(r,s)}})}updateState(t){super.updateState(t);const{props:i,oldProps:r}=t;let{outlineColor:s}=i;s!==r.outlineColor&&(s=s.map(o=>o/255),s[3]=Number.isFinite(s[3])?s[3]:1,this.setState({outlineColor:s})),!i.sdf&&i.outlineWidth&&Ri.warn("".concat(this.id,": fontSettings.sdf is required to render outline"))()}draw(t){const{sdf:i,smoothing:r,outlineWidth:s}=this.props,{outlineColor:o}=this.state;t.uniforms=Cn(ot({},t.uniforms),{buffer:.75,outlineBuffer:s?Math.max(r,.75*(1-s)):-1,gamma:r,sdf:Boolean(i),outlineColor:o}),super.draw(t)}getInstanceOffset(t){return t?Array.from(t).map(i=>super.getInstanceOffset(i)):R4}getInstanceColorMode(t){return 1}getInstanceIconFrame(t){return t?Array.from(t).map(i=>super.getInstanceIconFrame(i)):R4}}return n.layerName="MultiIconLayer",n.defaultProps=Vpe,n})();var zpe=Je(2),Hpe=Je.n(zpe);const $pe=[];function Wpe(n){return Math.pow(2,Math.ceil(Math.log2(n)))}function N4(n,e,t,i){let r=0;for(let s=e;si&&(oa){let h=N4(n,a,l,r);c+h>i&&(oi&&(h=P4(n,a,l,i,r,s),o=s[s.length-1])),a=l,c+=h}}(n,r,s,t,i,o),o}function Xpe(n,e,t,i,r,s){let o=0,a=0;for(let l=e;l0,u=[0,0],h=[];let p=0,g=0,m=0;for(let w=0;w<=s;w++){const C=n[w];if(("\n"===C||w===s)&&(m=w),m>g){const H=c?Kpe(n,t,i,r,g,m):$pe;for(let U=0;U<=H.length;U++){const de=0===U?g:H[U-1],Ae=Ui===e);t>=0&&this._order.splice(t,1)}_appendOrder(e){this._order.push(e)}}(3),nge=["fontFamily","fontWeight","characterSet","fontSize","sdf","buffer","cutoff","radius"];function rge(n,e){for(let t=0;t{o in e&&(this.props[o]=e[o])});const t=this._key;this._key=this._getKey();const i=function(n,e){const t=oR.get(n);if(!t)return e;const i=[];let s=Object.keys(t.mapping);s=new Set(s);let o=e;return o instanceof Array&&(o=new Set(o)),o.forEach(a=>{s.has(a)||i.push(a)}),i}(this._key,this.props.characterSet),r=oR.get(this._key);if(r&&0===i.length)return void(this._key!==t&&(this._atlas=r));const s=this._generateFontAtlas(this._key,i,r);this._atlas=s,oR.set(this._key,s)}_generateFontAtlas(e,t,i){const{fontFamily:r,fontWeight:s,fontSize:o,buffer:a,sdf:l,radius:c,cutoff:u}=this.props;let h=i&&i.data;h||(h=document.createElement("canvas"),h.width=1024);const p=h.getContext("2d");$4(p,r,o,s);const{mapping:g,canvasHeight:m,xOffset:w,yOffset:C}=function({characterSet:n,getFontWidth:e,fontHeight:t,buffer:i,maxCanvasWidth:r,mapping:s={},xOffset:o=0,yOffset:a=0}){let l=0,c=o,u=0;for(const p of n)if(!s[p]){const g=e(p,u++);c+g+2*i>r&&(c=0,l++),s[p]={x:c+i,y:a+l*(t+2*i)+i,width:g,height:t},c+=g+2*i}const h=t+2*i;return{mapping:s,xOffset:c,yOffset:a+l*h,canvasHeight:Wpe(a+(l+1)*h)}}(ot({getFontWidth:H=>p.measureText(H).width,fontHeight:1.2*o,buffer:a,characterSet:t,maxCanvasWidth:1024},i&&{mapping:i.mapping,xOffset:i.xOffset,yOffset:i.yOffset}));if(h.height!==m){const H=p.getImageData(0,0,h.width,h.height);h.height=m,p.putImageData(H,0,0)}if($4(p,r,o,s),l){const H=new(Hpe())(o,a,c,u,r,s),U=p.getImageData(0,0,H.size,H.size);for(const de of t)rge(H.draw(de),U),p.putImageData(U,g[de].x-a,g[de].y+a)}else for(const H of t)p.fillText(H,g[H].x,g[H].y+.9*o);return{xOffset:w,yOffset:C,mapping:g,data:h,width:h.width,height:h.height}}_getKey(){const{fontFamily:e,fontWeight:t,fontSize:i,buffer:r,sdf:s,radius:o,cutoff:a}=this.props;return s?"".concat(e," ").concat(t," ").concat(i," ").concat(r," ").concat(o," ").concat(a):"".concat(e," ").concat(t," ").concat(i," ").concat(r)}}const lge={billboard:!0,sizeScale:1,sizeUnits:"pixels",sizeMinPixels:0,sizeMaxPixels:Number.MAX_SAFE_INTEGER,padding:{type:"array",value:[0,0,0,0]},getPosition:{type:"accessor",value:n=>n.position},getSize:{type:"accessor",value:1},getAngle:{type:"accessor",value:0},getPixelOffset:{type:"accessor",value:[0,0]},getBoundingRect:{type:"accessor",value:[0,0,0,0]},getFillColor:{type:"accessor",value:[0,0,0,255]},getLineColor:{type:"accessor",value:[0,0,0,255]},getLineWidth:{type:"accessor",value:1}};let cge=(()=>{class n extends $0{getShaders(){return super.getShaders({vs:"#define SHADER_NAME text-background-layer-vertex-shader\n\nattribute vec2 positions;\n\nattribute vec3 instancePositions;\nattribute vec3 instancePositions64Low;\nattribute vec4 instanceRects;\nattribute float instanceSizes;\nattribute float instanceAngles;\nattribute vec2 instancePixelOffsets;\nattribute float instanceLineWidths;\nattribute vec4 instanceFillColors;\nattribute vec4 instanceLineColors;\nattribute vec3 instancePickingColors;\n\nuniform bool billboard;\nuniform float opacity;\nuniform float sizeScale;\nuniform float sizeMinPixels;\nuniform float sizeMaxPixels;\nuniform vec4 padding;\n\nvarying vec4 vFillColor;\nvarying vec4 vLineColor;\nvarying float vLineWidth;\nvarying vec2 uv;\nvarying vec2 dimensions;\n\nvec2 rotate_by_angle(vec2 vertex, float angle) {\n float angle_radian = radians(angle);\n float cos_angle = cos(angle_radian);\n float sin_angle = sin(angle_radian);\n mat2 rotationMatrix = mat2(cos_angle, -sin_angle, sin_angle, cos_angle);\n return rotationMatrix * vertex;\n}\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n geometry.uv = positions;\n geometry.pickingColor = instancePickingColors;\n uv = positions;\n vLineWidth = instanceLineWidths;\n float sizePixels = clamp(\n project_size_to_pixel(instanceSizes * sizeScale),\n sizeMinPixels, sizeMaxPixels\n );\n\n dimensions = instanceRects.zw * sizePixels + padding.xy + padding.zw;\n\n vec2 pixelOffset = (positions * instanceRects.zw + instanceRects.xy) * sizePixels + mix(-padding.xy, padding.zw, positions);\n pixelOffset = rotate_by_angle(pixelOffset, instanceAngles);\n pixelOffset += instancePixelOffsets;\n pixelOffset.y *= -1.0;\n\n if (billboard) {\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, vec3(0.0), geometry.position);\n vec3 offset = vec3(pixelOffset, 0.0);\n DECKGL_FILTER_SIZE(offset, geometry);\n gl_Position.xy += project_pixel_size_to_clipspace(offset.xy);\n } else {\n vec3 offset_common = vec3(project_pixel_size(pixelOffset), 0.0);\n DECKGL_FILTER_SIZE(offset_common, geometry);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, offset_common, geometry.position);\n }\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n vFillColor = vec4(instanceFillColors.rgb, instanceFillColors.a * opacity);\n DECKGL_FILTER_COLOR(vFillColor, geometry);\n vLineColor = vec4(instanceLineColors.rgb, instanceLineColors.a * opacity);\n DECKGL_FILTER_COLOR(vLineColor, geometry);\n}\n",fs:"#define SHADER_NAME text-background-layer-fragment-shader\n\nprecision highp float;\n\nuniform bool stroked;\n\nvarying vec4 vFillColor;\nvarying vec4 vLineColor;\nvarying float vLineWidth;\nvarying vec2 uv;\nvarying vec2 dimensions;\n\nvoid main(void) {\n geometry.uv = uv;\n\n vec2 pixelPosition = uv * dimensions;\n if (stroked) {\n float distToEdge = min(\n min(pixelPosition.x, dimensions.x - pixelPosition.x),\n min(pixelPosition.y, dimensions.y - pixelPosition.y)\n );\n float isBorder = smoothedge(distToEdge, vLineWidth);\n gl_FragColor = mix(vFillColor, vLineColor, isBorder);\n } else {\n gl_FragColor = vFillColor;\n }\n\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:[rx,sx]})}initializeState(){this.getAttributeManager().addInstanced({instancePositions:{size:3,type:5130,fp64:this.use64bitPositions(),transition:!0,accessor:"getPosition"},instanceSizes:{size:1,transition:!0,accessor:"getSize",defaultValue:1},instanceAngles:{size:1,transition:!0,accessor:"getAngle"},instanceRects:{size:4,accessor:"getBoundingRect"},instancePixelOffsets:{size:2,transition:!0,accessor:"getPixelOffset"},instanceFillColors:{size:4,transition:!0,normalized:!0,type:5121,accessor:"getFillColor",defaultValue:[0,0,0,255]},instanceLineColors:{size:4,transition:!0,normalized:!0,type:5121,accessor:"getLineColor",defaultValue:[0,0,0,255]},instanceLineWidths:{size:1,transition:!0,accessor:"getLineWidth",defaultValue:1}})}updateState({props:t,oldProps:i,changeFlags:r}){if(super.updateState({props:t,oldProps:i,changeFlags:r}),r.extensionsChanged){var s;const{gl:o}=this.context;null===(s=this.state.model)||void 0===s||s.delete(),this.state.model=this._getModel(o),this.getAttributeManager().invalidateAll()}}draw({uniforms:t}){const{viewport:i}=this.context,{billboard:r,sizeScale:s,sizeUnits:o,sizeMinPixels:a,sizeMaxPixels:l,getLineWidth:c}=this.props;let{padding:u}=this.props;const h="pixels"===o?i.metersPerPixel:1;u.length<4&&(u=[u[0],u[1],u[0],u[1]]),this.state.model.setUniforms(t).setUniforms({billboard:r,stroked:Boolean(c),padding:u,sizeScale:s*h,sizeMinPixels:a,sizeMaxPixels:l}).draw()}_getModel(t){return new Yg(t,Cn(ot({},this.getShaders()),{id:this.props.id,geometry:new fh({drawMode:6,vertexCount:4,attributes:{positions:{size:2,value:new Float32Array([0,0,1,0,1,1,0,1])}}}),isInstanced:!0}))}}return n.layerName="TextBackgroundLayer",n.defaultProps=lge,n})();const W4={fontSize:64,buffer:4,sdf:!1,radius:12,cutoff:.25,smoothing:.1},q4={start:1,middle:0,end:-1},Y4={top:1,center:0,bottom:-1},aR=[0,0,0,255],dge=["fontSize","buffer","sdf","radius","cutoff"],hge={billboard:!0,sizeScale:1,sizeUnits:"pixels",sizeMinPixels:0,sizeMaxPixels:Number.MAX_SAFE_INTEGER,background:!1,getBackgroundColor:{type:"accessor",value:[255,255,255,255]},getBorderColor:{type:"accessor",value:aR},getBorderWidth:{type:"accessor",value:0},backgroundPadding:{type:"array",value:[0,0,0,0]},characterSet:{type:"object",value:k4},fontFamily:L4,fontWeight:"normal",lineHeight:1,outlineWidth:{type:"number",value:0,min:0},outlineColor:{type:"color",value:aR},fontSettings:{},wordBreak:"break-word",maxWidth:{type:"number",value:-1},getText:{type:"accessor",value:n=>n.text},getPosition:{type:"accessor",value:n=>n.position},getColor:{type:"accessor",value:aR},getSize:{type:"accessor",value:32},getAngle:{type:"accessor",value:0},getTextAnchor:{type:"accessor",value:"middle"},getAlignmentBaseline:{type:"accessor",value:"center"},getPixelOffset:{type:"accessor",value:[0,0]},backgroundColor:{deprecatedFor:["background","getBackgroundColor"]}};let fge=(()=>{class n extends jz{initializeState(){this.state={styleVersion:0,fontAtlasManager:new sge}}updateState({props:t,oldProps:i,changeFlags:r}){const o=this.state.characterSet;(r.dataChanged||r.updateTriggersChanged&&(r.updateTriggersChanged.all||r.updateTriggersChanged.getText))&&this._updateText();const a=o!==this.state.characterSet||this._fontChanged(i,t);a&&this._updateFontAtlas(i,t),(a||t.lineHeight!==i.lineHeight||t.wordBreak!==i.wordBreak||t.maxWidth!==i.maxWidth)&&this.setState({styleVersion:this.state.styleVersion+1})}getPickingInfo({info:t}){return t.object=t.index>=0?this.props.data[t.index]:null,t}_updateFontAtlas(t,i){const{fontSettings:r,fontFamily:s,fontWeight:o}=i,{fontAtlasManager:a,characterSet:l}=this.state;a.setProps(Cn(ot(ot({},W4),r),{characterSet:l,fontFamily:s,fontWeight:o}))}_fontChanged(t,i){if(t.fontFamily!==i.fontFamily||t.fontWeight!==i.fontWeight)return!0;if(t.fontSettings===i.fontSettings)return!1;const r=t.fontSettings||{},s=i.fontSettings||{};return dge.some(o=>r[o]!==s[o])}_updateText(){const{data:t,characterSet:i}=this.props,r=t.attributes&&t.attributes.getText;let a,{getText:s}=this.props,{startIndices:o}=t;const l="auto"===i&&new Set;if(r&&o){const{texts:c,characterCount:u}=function({value:n,length:e,stride:t,offset:i,startIndices:r,characterSet:s}){const o=n.BYTES_PER_ELEMENT,a=t?t/o:1,l=i?i/o:0,c=r[e]||Math.ceil((n.length-l)/a),u=s&&new Set,h=new Array(e);let p=n;if(a>1||l>0){p=new n.constructor(c);for(let g=0;gc[p]}else{const{iterable:c,objectInfo:u}=ES(t);o=[0],a=0;for(const h of c){u.index++;const p=Array.from(s(h,u)||"");l&&p.forEach(l.add,l),a+=p.length,o.push(a)}}this.setState({getText:s,startIndices:o,numInstances:a,characterSet:l||i})}getBoundingRect(t,i){const r=this.state.fontAtlasManager.mapping,{getText:s}=this.state,{wordBreak:o,maxWidth:a,lineHeight:l,getTextAnchor:c,getAlignmentBaseline:u}=this.props,h=s(t,i)||"",{size:[p,g]}=F4(h,l,o,a,r);return[(q4["function"==typeof c?c(t,i):c]-1)*p/2,(Y4["function"==typeof u?u(t,i):u]-1)*g/2,p,g]}getIconOffsets(t,i){const r=this.state.fontAtlasManager.mapping,{getText:s}=this.state,{wordBreak:o,maxWidth:a,lineHeight:l,getTextAnchor:c,getAlignmentBaseline:u}=this.props,h=s(t,i)||"",{x:p,y:g,rowWidth:m,size:[w,C]}=F4(h,l,o,a,r),H=q4["function"==typeof c?c(t,i):c],U=Y4["function"==typeof u?u(t,i):u],de=p.length,Ae=new Array(2*de);let Pe=0;for(let Be=0;Bet*e/255)}const cR={name:"lights",vs:K4,fs:K4,getUniforms:function X4(n=pge){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?lR(n):[0,0,0],e.forEach((r,s)=>{i[`lighting_uPointLight[${s}].color`]=lR(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`]=lR(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 X4({lightSources:e})}return{}},defines:{MAX_LIGHTS:3}},mge={};const yge={name:"phong-lighting",dependencies:[cR],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=mge){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}}},uR=Math.PI/180,ox=new Float32Array(16),J4=new Float32Array(12);function e5(n,e,t){const i=e[0]*uR,r=e[1]*uR,s=e[2]*uR,o=Math.sin(s),a=Math.sin(i),l=Math.sin(r),c=Math.cos(s),u=Math.cos(i),h=Math.cos(r),p=t[0],g=t[1],m=t[2];n[0]=p*h*u,n[1]=p*l*u,n[2]=p*-a,n[3]=g*(-l*c+h*a*o),n[4]=g*(h*c+l*a*o),n[5]=g*u*o,n[6]=m*(l*o+h*a*c),n[7]=m*(-h*o+l*a*c),n[8]=m*u*c}function t5(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 n5={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,u=Array.isArray(s),h=Array.isArray(r),p=Array.isArray(o),g=c||!l&&Boolean(a(i[0]));n.constant=g?c:h&&u&&p;const m=n.value;if(n.constant){let w;g?(ox.set(a),w=t5(ox)):(w=J4,e5(w,r,s),w.set(o,9)),n.value=new Float32Array(w)}else{let w=e*n.size;const{iterable:C,objectInfo:H}=ES(i,e,t);for(const U of C){let de;H.index++,g?(ox.set(c?a:a(U,H)),de=t5(ox)):(de=J4,e5(de,h?r:r(U,H),u?s:s(U,H)),de.set(p?o:o(U,H),9)),m[w++]=de[0],m[w++]=de[1],m[w++]=de[2],m[w++]=de[3],m[w++]=de[4],m[w++]=de[5],m[w++]=de[6],m[w++]=de[7],m[w++]=de[8],m[w++]=de[9],m[w++]=de[10],m[w++]=de[11]}}}};function i5(n,e){return e===ji.CARTESIAN||e===ji.METER_OFFSETS||e===ji.DEFAULT&&!n.isGeospatial}function r5(n,e){(n.COLOR_0||n.colors)&&e||(n.colors={constant:!0,value:new Float32Array([1,1,1])}),Ri.assert(n.positions||n.POSITION,'no "postions" or "POSITION" attribute in mesh')}function wge(n,e){if(n.attributes)return r5(n.attributes,e),n instanceof fh?n:new fh(n);if(n.positions||n.POSITION)return r5(n,e),new fh({attributes:n});throw Error("Invalid mesh")}const Ege={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 Sge=(()=>{class n extends $0{getShaders(){const t=!Si(this.context.gl),i={};return gI(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:[rx,yge,sx],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:n5}),this.setState({emptyTexture:new _a(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||i5(i,s),flatShading:!this.state.hasNormals}).draw()}getModel(t){const i=new Yg(this.context.gl,Cn(ot({},this.getShaders()),{id:this.props.id,geometry:wge(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=Ege,n})();const s5={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:[cR]};class rm{constructor(e={}){const{id:t}=e;this.id=t||ga(this.constructor.name),this.display=!0,this.position=new Ao,this.rotation=new Ao,this.scale=new Ao(1,1,1),this.matrix=new qn,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 qn(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 Z0 extends rm{constructor(e={}){e=Array.isArray(e)?{children:e}:e;const{children:t=[]}=e;mn.assert(t.every(i=>i instanceof rm),"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 qn}={}){const i=new qn(t).multiplyRight(this.matrix);for(const r of this.children)r instanceof Z0?r.traverse(e,{worldMatrix:i}):e(r,{worldMatrix:i})}}function o5(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],u=e[7],h=e[8],p=t[0],g=t[1],m=t[2],w=t[3],C=t[4],H=t[5],U=t[6],de=t[7],Ae=t[8];return n[0]=p*i+g*o+m*c,n[1]=p*r+g*a+m*u,n[2]=p*s+g*l+m*h,n[3]=w*i+C*o+H*c,n[4]=w*r+C*a+H*u,n[5]=w*s+C*l+H*h,n[6]=U*i+de*o+Ae*c,n[7]=U*r+de*a+Ae*u,n[8]=U*s+de*l+Ae*h,n}function a5(n,e,t){var i=t[0],r=t[1];return n[0]=i*e[0],n[1]=i*e[1],n[2]=i*e[2],n[3]=r*e[3],n[4]=r*e[4],n[5]=r*e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n}function l5(){var n=new ya(4);return ya!=Float32Array&&(n[0]=0,n[1]=0,n[2]=0),n[3]=1,n}function c5(n){return n[0]=0,n[1]=0,n[2]=0,n[3]=1,n}function dR(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 ax(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],u=t[3];return n[0]=i*u+o*a+r*c-s*l,n[1]=r*u+o*l+s*a-i*c,n[2]=s*u+o*c+i*l-r*a,n[3]=o*u-i*a-r*l-s*c,n}function u5(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);return n[0]=i*l+o*a,n[1]=r*l+s*a,n[2]=s*l-r*a,n[3]=o*l-i*a,n}function d5(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);return n[0]=i*l-s*a,n[1]=r*l+o*a,n[2]=s*l+i*a,n[3]=o*l-r*a,n}function h5(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);return n[0]=i*l+r*a,n[1]=r*l-i*a,n[2]=s*l+o*a,n[3]=o*l-s*a,n}function f5(n,e){var t=e[0],i=e[1],r=e[2];return n[0]=t,n[1]=i,n[2]=r,n[3]=Math.sqrt(Math.abs(1-t*t-i*i-r*r)),n}function J0(n,e,t,i){var p,g,m,w,C,r=e[0],s=e[1],o=e[2],a=e[3],l=t[0],c=t[1],u=t[2],h=t[3];return(g=r*l+s*c+o*u+a*h)<0&&(g=-g,l=-l,c=-c,u=-u,h=-h),1-g>Qc?(p=Math.acos(g),m=Math.sin(p),w=Math.sin((1-i)*p)/m,C=Math.sin(i*p)/m):(w=1-i,C=i),n[0]=w*r+C*l,n[1]=w*s+C*c,n[2]=w*o+C*u,n[3]=w*a+C*h,n}function p5(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;return n[0]=-t*a,n[1]=-i*a,n[2]=-r*a,n[3]=s*a,n}function g5(n,e){return n[0]=-e[0],n[1]=-e[1],n[2]=-e[2],n[3]=e[3],n}function hR(n,e){var i,t=e[0]+e[4]+e[8];if(t>0)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}return n}var m5=function(n,e,t){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n},fR=FU,pR=function(n,e){return n[0]*e[0]+n[1]*e[1]+n[2]*e[2]+n[3]*e[3]},_5=function(n,e,t,i){var r=e[0],s=e[1],o=e[2],a=e[3];return 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),n},y5=function(n){return Math.hypot(n[0],n[1],n[2],n[3])},b5=function(n){var e=n[0],t=n[1],i=n[2],r=n[3];return e*e+t*t+i*i+r*r},w5=function(){var n=xV(),e=CV(1,0,0),t=CV(0,1,0);return function(i,r,s){var o=AV(r,s);return o<-.999999?(A0(n,e,r),function(n){return Math.hypot(n[0],n[1],n[2])}(n)<1e-6&&A0(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),dR(i,n,Math.PI),i):o>.999999?(i[0]=0,i[1]=0,i[2]=0,i[3]=1,i):(A0(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))}}();l5(),l5(),function(){var n=new ya(9);ya!=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 Nge=[0,0,0,1];class gR extends bS{constructor(e=0,t=0,i=0,r=1){super(-0,-0,-0,-0),Array.isArray(e)&&1===arguments.length?this.copy(e):this.set(e,t,i,r)}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this.check()}set(e,t,i,r){return this[0]=e,this[1]=t,this[2]=i,this[3]=r,this.check()}fromMatrix3(e){return hR(this,e),this.check()}identity(){return c5(this),this.check()}fromAxisRotation(e,t){return dR(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]=sr(e)}get y(){return this[1]}set y(e){this[1]=sr(e)}get z(){return this[2]}set z(e){this[2]=sr(e)}get w(){return this[3]}set w(e){this[3]=sr(e)}len(){return y5(this)}lengthSquared(){return b5(this)}dot(e,t){if(void 0!==t)throw new Error("Quaternion.dot only takes one argument");return pR(this,e)}rotationTo(e,t){return w5(this,e,t),this.check()}add(e,t){if(void 0!==t)throw new Error("Quaternion.add only takes one argument");return m5(this,this,e),this.check()}calculateW(){return f5(this,this),this.check()}conjugate(){return g5(this,this),this.check()}invert(){return p5(this,this),this.check()}lerp(e,t,i){return _5(this,e,t,i),this.check()}multiplyRight(e,t){return Yu(!t),ax(this,this,e),this.check()}multiplyLeft(e,t){return Yu(!t),ax(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 u5(this,this,e),this.check()}rotateY(e){return d5(this,this,e),this.check()}rotateZ(e){return h5(this,this,e),this.check()}scale(e){return fR(this,this,e),this.check()}slerp(e,t,i){switch(arguments.length){case 1:({start:e=Nge,target:t,ratio:i}=arguments[0]);break;case 2:[t,i]=arguments,e=this}return J0(this,e,t,i),this.check()}transformVector4(e,t=e){return kU(t,e,this),vS(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)}}const Pge={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Fge={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function E5(n){if(!n._animation){const e=Fge[n.componentType],t=Pge[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;l{(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:mn.warn(`Bad animation path ${s}`)()}tn(r[s].length===i[c].length);const u=e[c],h=e[l];switch(t){case"STEP":!function(n,e,t){for(let i=0;iu&&function(n,e,t,i,r){if("rotation"===e){mR.slerp({start:t,target:i,ratio:r});for(let s=0;su&&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:E5(e.accessors[a]),interpolation:l,output:E5(e.accessors[c])})),o=t.channels.map(({sampler:a,target:l})=>({sampler:s[a],target:e.nodes[l.node],path:l.path}));return new zge({name:r,channels:o})})}animate(e){this.setTime(e)}setTime(e){this.animations.forEach(t=>t.animate(e))}getAnimations(){return this.animations}}class Gge extends rm{constructor(e,t={}){super(t),this.onBeforeRender=null,this.AfterRender=null,e instanceof Yg?(this.model=e,this._setModelNodeProps(t)):this.model=new Yg(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 $ge{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},gI(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 _a(this.gl,ot({id:e.name||e.id,parameters:ot(ot({},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&&(mn.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 S5(n,e){return Si(n)?`#version 300 es\n${e}`:e}const Kge={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Xge={modelOptions:{},pbrDebug:!1,imageBasedLightingEnvironment:null,lights:!0,useTangents:!1};class Qge{constructor(e,t={}){this.gl=e,this.options=Object.assign({},Xge,t)}instantiate(e){return this.gltf=e,(e.scenes||[]).map(i=>this.createScene(i))}createAnimator(){return Array.isArray(this.gltf.animations)?new Hge(this.gltf):null}createScene(e){const i=(e.nodes||[]).map(s=>this.createNode(s));return new Z0({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 Z0({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 qn).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 Z0({id:e.name||e.id,children:i});e._mesh=r}return e._mesh}getVertexCount(e){mn.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 $ge(n,e);mn.info(4,"createGLTFModel defines: ",a.defines)();const l=[];l.push(...a.generatedTextures),l.push(...Object.values(s).map(u=>u.buffer));const c=new Gge(n,Object.assign({id:t,drawMode:i,vertexCount:r,modules:[s5],defines:a.defines,parameters:a.parameters,vs:S5(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:S5(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))),mn.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 hr(this.gl,{id:`from-${i.id}`,data:i.data||e.value,target:t})),i.lumaBuffers[t]}createAccessor(e,t){return new ma({buffer:t,offset:e.byteOffset||0,stride:e.bufferView.byteStride||0,type:e.componentType,size:Kge[e.type]})}createSampler(e){return e}needsPOT(){return!1}}function x5(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 sm(i,this.metadata)}selectAt(...e){const t=e.map(i=>this.fields[i]).filter(Boolean);return new sm(t,this.metadata)}assign(e){let t,i=this.metadata;if(e instanceof sm){const o=e;t=o.fields,i=M5(M5(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 sm(s,i)}}function M5(n,e){return new Map([...n||new Map,...e||new Map])}let Lr,D5,I5,O5,R5,N5,P5,F5;!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"}(Lr||(Lr={}));class _R{static isNull(e){return e&&e.typeId===Lr.Null}static isInt(e){return e&&e.typeId===Lr.Int}static isFloat(e){return e&&e.typeId===Lr.Float}static isBinary(e){return e&&e.typeId===Lr.Binary}static isUtf8(e){return e&&e.typeId===Lr.Utf8}static isBool(e){return e&&e.typeId===Lr.Bool}static isDecimal(e){return e&&e.typeId===Lr.Decimal}static isDate(e){return e&&e.typeId===Lr.Date}static isTime(e){return e&&e.typeId===Lr.Time}static isTimestamp(e){return e&&e.typeId===Lr.Timestamp}static isInterval(e){return e&&e.typeId===Lr.Interval}static isList(e){return e&&e.typeId===Lr.List}static isStruct(e){return e&&e.typeId===Lr.Struct}static isUnion(e){return e&&e.typeId===Lr.Union}static isFixedSizeBinary(e){return e&&e.typeId===Lr.FixedSizeBinary}static isFixedSizeList(e){return e&&e.typeId===Lr.FixedSizeList}static isMap(e){return e&&e.typeId===Lr.Map}static isDictionary(e){return e&&e.typeId===Lr.Dictionary}get typeId(){return Lr.NONE}compareTo(e){return this===e}}Symbol,Symbol,D5=Symbol.toStringTag;class om extends _R{constructor(e,t){super(),Kn(this,"isSigned",void 0),Kn(this,"bitWidth",void 0),this.isSigned=e,this.bitWidth=t}get typeId(){return Lr.Int}get[D5](){return"Int"}toString(){return`${this.isSigned?"I":"Ui"}nt${this.bitWidth}`}}class ame extends om{constructor(){super(!0,8)}}class lme extends om{constructor(){super(!0,16)}}class cme extends om{constructor(){super(!0,32)}}class ume extends om{constructor(){super(!1,8)}}class dme extends om{constructor(){super(!1,16)}}class hme extends om{constructor(){super(!1,32)}}I5=Symbol.toStringTag;class k5 extends _R{constructor(e){super(),Kn(this,"precision",void 0),this.precision=e}get typeId(){return Lr.Float}get[I5](){return"Float"}toString(){return`Float${this.precision}`}}class fme extends k5{constructor(){super(32)}}class pme extends k5{constructor(){super(64)}}Symbol,Symbol,O5=Symbol.toStringTag,R5=Symbol.toStringTag,N5=Symbol.toStringTag,P5=Symbol.toStringTag,F5=Symbol.toStringTag;class gme extends _R{constructor(e,t){super(),Kn(this,"listSize",void 0),Kn(this,"children",void 0),this.listSize=e,this.children=[t]}get typeId(){return Lr.FixedSizeList}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get[F5](){return"FixedSizeList"}toString(){return`FixedSizeList[${this.listSize}]<${this.valueType}>`}}class lx{constructor(e,t,i=!1,r=new Map){Kn(this,"name",void 0),Kn(this,"type",void 0),Kn(this,"nullable",void 0),Kn(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 lx(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 L5(n,e,t){const i=t?B5(t.metadata):void 0,r=function(n){switch(n.constructor){case Int8Array:return new ame;case Uint8Array:return new ume;case Int16Array:return new lme;case Uint16Array:return new dme;case Int32Array:return new cme;case Uint32Array:return new hme;case Float32Array:return new fme;case Float64Array:return new pme;default:throw new Error("array type not supported")}}(e.value);return new lx(n,new gme(e.size,new lx("value",r)),!1,i)}function B5(n){const e=new Map;for(const t in n)e.set(`${t}.string`,JSON.stringify(n[t]));return e}const j5={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},bme={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array};class wme{constructor(e){Kn(this,"draco",void 0),Kn(this,"decoder",void 0),Kn(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?u:r,s=h>s?h:s,o=p>o?p:o}return[[e,t,i],[r,s,o]]}(l.attributes),u=function(n,e,t){const i=B5(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=L5(o,n[o],s[o]);r.push(l)}if(t){const o=L5("indices",t);r.push(o)}return new sm(r,i)}(l.attributes,a,l.indices);return Cn(ot({loader:"draco",loaderData:a,header:{vertexCount:s.num_points(),boundingBox:c}},l),{schema:u})}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 cx=Je(125);const wR={};function ER(n){return SR.apply(this,arguments)}function SR(){return(SR=oi(function*(n,e=null,t={}){return e&&(n=Ame(n,e,t)),wR[n]=wR[n]||Tme(n),yield wR[n]})).apply(this,arguments)}function Ame(n,e,t){if(n.startsWith("http"))return n;const i=t.modules||{};return i[n]?i[n]:mO?t.CDN?(Jc(t.CDN.startsWith("http")),`${t.CDN}/${e}@3.0.12/dist/libs/${n}`):_O?`../src/libs/${n}`:`modules/${e}/src/libs/${n}`:`modules/${e}/dist/libs/${n}`}function Tme(n){return xR.apply(this,arguments)}function xR(){return(xR=oi(function*(n){return n.endsWith("wasm")?yield(yield fetch(n)).arrayBuffer():mO?_O?importScripts(n):Mme(yield(yield fetch(n)).text(),n):cx.requireFromFile&&(yield cx.requireFromFile(n))})).apply(this,arguments)}function Mme(n,e){if(!mO)return cx.requireFromString&&cx.requireFromString(n,e);if(_O)return eval.call(jue,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 Dme="https://www.gstatic.com/draco/versioned/decoders/1.4.1/draco_decoder.js",Ime="https://www.gstatic.com/draco/versioned/decoders/1.4.1/draco_wasm_wrapper.js",Ome="https://www.gstatic.com/draco/versioned/decoders/1.4.1/draco_decoder.wasm";let eb;function Nme(n){return CR.apply(this,arguments)}function CR(){return(CR=oi(function*(n){const e=n.modules||{};return eb=e.draco3d?eb||e.draco3d.createDecoderModule({}).then(t=>({draco:t})):eb||Pme(n),yield eb})).apply(this,arguments)}function Pme(n){return TR.apply(this,arguments)}function TR(){return(TR=oi(function*(n){let e,t;switch(n.draco&&n.draco.decoderType){case"js":e=yield ER(Dme,"draco",n);break;case"wasm":default:[e,t]=yield Promise.all([yield ER(Ime,"draco",n),yield ER(Ome,"draco",n)])}return e=e||globalThis.DracoDecoderModule,yield Fme(e,t)})).apply(this,arguments)}function Fme(n,e){const t={};return e&&(t.wasmBinary=e),new Promise(i=>{n(Cn(ot({},t),{onModuleLoaded:r=>i({draco:r})}))})}const DR=Cn(ot({},T5),{parse:function(n,e){return IR.apply(this,arguments)}});function IR(){return(IR=oi(function*(n,e){const{draco:t}=yield Nme(e),i=new wme(t);try{return i.parseSync(n,null==e?void 0:e.draco)}finally{i.destroy()}})).apply(this,arguments)}function nb(n,e){return Ff(n>=0),Ff(e>0),n+(e-1)&~(e-1)}function Bme(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+nb(i.byteLength,4)}const V5=["SCALAR","VEC2","VEC3","VEC4"],jme=[[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Uint32Array,5125],[Float32Array,5126],[Float64Array,5130]],Vme=new Map(jme),Ume={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},zme={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},Hme={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function U5(n){return V5[n-1]||V5[0]}function z5(n){const e=Vme.get(n.constructor);if(!e)throw new Error("Illegal typed array");return e}function H5(n,e){const t=Hme[n.componentType],i=Ume[n.type],s=n.count*i,o=n.count*i*zme[n.componentType];return Ga(o>=0&&o<=e.byteLength),{ArrayType:t,length:s,byteLength:o}}const Gme={asset:{version:"2.0",generator:"loaders.gl"},buffers:[]};class gh{constructor(e){Kn(this,"gltf",void 0),Kn(this,"sourceBuffers",void 0),Kn(this,"byteLength",void 0),this.gltf=e||{json:ot({},Gme),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 Ga(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}=H5(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 Ga(t),this.json.extensions=this.json.extensions||{},this.json.extensions[e]=t,this.registerUsedExtension(e),t}addRequiredExtension(e,t={}){return Ga(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=JO(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;Ga(Number.isFinite(t)),this.sourceBuffers=this.sourceBuffers||[],this.sourceBuffers.push(e);const i={buffer:0,byteOffset:this.byteLength,byteLength:t};return this.byteLength+=nb(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:U5(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:z5(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=Bme(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*t_e(n){for(const e of n.json.meshes||[])for(const t of e.primitives)yield t}function n_e(n){return NR.apply(this,arguments)}function NR(){return(NR=oi(function*(n){const e=new gh(n),{json:t}=e;e.removeExtension(dx);for(const i of t.materials||[])i.extensions&&i.extensions.KHR_materials_unlit&&(i.unlit=!0),e.removeObjectExtension(i,dx)})).apply(this,arguments)}function i_e(n){const e=new gh(n),{json:t}=e;if(e.materials)for(const i of t.materials||[])i.unlit&&(delete i.unlit,e.addObjectExtension(i,dx,{}),e.addExtension(dx))}function r_e(n){return PR.apply(this,arguments)}function PR(){return(PR=oi(function*(n){const e=new gh(n),{json:t}=e,i=e.getExtension(am);i&&(e.json.lights=i.lights,e.removeExtension(am));for(const r of t.nodes||[]){const s=e.getObjectExtension(r,am);s&&(r.light=s.light),e.removeObjectExtension(r,am)}})).apply(this,arguments)}function s_e(n){return FR.apply(this,arguments)}function FR(){return(FR=oi(function*(n){const e=new gh(n),{json:t}=e;if(t.lights){const i=e.addExtension(am);Ga(!i.lights),i.lights=t.lights,delete t.lights}if(e.json.lights){for(const i of e.json.lights)e.addObjectExtension(i.node,am,i);delete e.json.lights}})).apply(this,arguments)}function o_e(n){return kR.apply(this,arguments)}function kR(){return(kR=oi(function*(n){const e=new gh(n),{json:t}=e,i=e.getExtension(hx);if(i){const r=l_e(i,e);for(const s of t.materials||[]){const o=e.getObjectExtension(s,hx);o&&(s.technique=Object.assign({},o,r[o.technique]),s.technique.values=c_e(s.technique,e)),e.removeObjectExtension(s,hx)}e.removeExtension(hx)}})).apply(this,arguments)}function a_e(n,e){return LR.apply(this,arguments)}function LR(){return(LR=oi(function*(n,e){})).apply(this,arguments)}function l_e(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 c_e(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 W5={KHR_draco_mesh_compression:yt,KHR_materials_unlit:ee,KHR_lights_punctual:Tt,KHR_techniques_webgl:dt};function u_e(n){return BR.apply(this,arguments)}function BR(){return(BR=oi(function*(n,e={},t){for(const r in W5){var i;const s=(null==e||null===(i=e.gltf)||void 0===i?void 0:i.excludeExtensions)||{};r in s&&!s[r]||(yield W5[r].decode(n,e,t))}})).apply(this,arguments)}const q5={accessors:"accessor",animations:"animation",buffers:"buffer",bufferViews:"bufferView",images:"image",materials:"material",meshes:"mesh",nodes:"node",samplers:"sampler",scenes:"scene",skins:"skin",textures:"texture"},h_e={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 f_e{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 gh(n),{json:t}=e;for(const i of t.images||[]){const r=e.removeObjectExtension(i,G5);r&&Object.assign(i,r)}t.buffers&&t.buffers[0]&&delete t.buffers[0].uri,e.removeExtension(G5)}(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 q5)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 q5)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=h_e[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 p_e(n,e={}){return(new f_e).normalize(n,e)}const g_e={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},m_e={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},Ml={TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,REPEAT:10497,LINEAR:9729,NEAREST_MIPMAP_LINEAR:9986},__e={magFilter:Ml.TEXTURE_MAG_FILTER,minFilter:Ml.TEXTURE_MIN_FILTER,wrapS:Ml.TEXTURE_WRAP_S,wrapT:Ml.TEXTURE_WRAP_T},y_e={[Ml.TEXTURE_MAG_FILTER]:Ml.LINEAR,[Ml.TEXTURE_MIN_FILTER]:Ml.NEAREST_MIPMAP_LINEAR,[Ml.TEXTURE_WRAP_S]:Ml.REPEAT,[Ml.TEXTURE_WRAP_]:Ml.REPEAT};class w_e{postProcess(e,t={}){const{json:i,buffers:r=[],images:s=[],baseUri:o=""}=e;return Ga(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=ot({},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=ot({},e.normalTexture),e.normalTexture.texture=this.getTexture(e.normalTexture.index)),e.occlusionTexture&&(e.occlustionTexture=ot({},e.occlustionTexture),e.occlusionTexture.texture=this.getTexture(e.occlusionTexture.index)),e.emissiveTexture&&(e.emmisiveTexture=ot({},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=ot({},e.pbrMetallicRoughness);const i=e.pbrMetallicRoughness;i.baseColorTexture&&(i.baseColorTexture=ot({},i.baseColorTexture),i.baseColorTexture.texture=this.getTexture(i.baseColorTexture.index)),i.metallicRoughnessTexture&&(i.metallicRoughnessTexture=ot({},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 m_e[n]}(e.componentType),e.components=function(n){return g_e[n]}(e.type),e.bytesPerElement=e.bytesPerComponent*e.components,e.bufferView){const i=e.bufferView.buffer,{ArrayType:r,byteLength:s}=H5(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):y_e,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 __e[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 E_e(n,e){return(new w_e).postProcess(n,e)}const Y5=1735152710,lm=!0;function VR(n,e,t,i){const r=new Uint8Array(e.buffer,t,i),o=new TextDecoder("utf8").decode(r);return n.json=JSON.parse(o),nb(i,4)}function UR(n,e,t,i){return n.header.hasBinChunk=!0,n.binChunks.push({byteOffset:t,byteLength:i,arrayBuffer:e.buffer}),nb(i,4)}function P_e(n,e){return zR.apply(this,arguments)}function zR(){return(zR=oi(function*(n,e,t=0,i,r){var s,o,a,l;F_e(n,e,t,i),p_e(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 k_e(n,i,r)),null!=i&&null!==(a=i.gltf)&&void 0!==a&&a.loadImages){const h=L_e(n,i,r);c.push(h)}const u=u_e(n,i,r);return c.push(u),yield Promise.all(c),null!=i&&null!==(l=i.gltf)&&void 0!==l&&l.postProcess?E_e(n,i):n})).apply(this,arguments)}function F_e(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=Y5}=t,s=i.getUint32(e,!1);return s===r||s===Y5}(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)?x5(n.buffer,n.byteOffset,e):n instanceof ArrayBuffer?x5(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,lm),a=r.getUint32(t+8,lm);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){Ff(n.header.byteLength>20);const i=e.getUint32(t+0,lm),r=e.getUint32(t+4,lm);return t+=8,Ff(0===r),VR(n,e,t,i),(t+=i)+UR(n,e,t,n.header.byteLength)}(n,r,t);case 2:return function(n,e,t,i){return Ff(n.header.byteLength>20),function(n,e,t,i){for(;t+8<=n.header.byteLength;){const r=e.getUint32(t+0,lm),s=e.getUint32(t+4,lm);switch(t+=8,s){case 1313821514:VR(n,e,t,r);break;case 5130562:UR(n,e,t,r);break;case 0:i.strict||VR(n,e,t,r);break;case 1:i.strict||UR(n,e,t,r)}t+=nb(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),Ga("glTF"===o.type,`Invalid GLB magic string ${o.type}`),n._glb=o,n.json=o.json}else Ga(!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 k_e(n,e,t){return HR.apply(this,arguments)}function HR(){return(HR=oi(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 U_e(()=>e.some(t=>!t.loaded))})).apply(this,arguments)}function U_e(n){return YR.apply(this,arguments)}function YR(){return(YR=oi(function*(n){for(;n();)yield new Promise(e=>requestAnimationFrame(e))})).apply(this,arguments)}const K5=[255,255,255,255],G_e={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:K5},_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:[cm]};let $_e=(()=>{class n extends $0{getShaders(){const t=[rx,sx];return"pbr"===this.props._lighting&&t.push(s5),{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:K5,transition:!0},instanceModelMatrix:n5})}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 rm)r={scenes:[t.scenegraph]};else if(t.scenegraph&&!t.scenegraph.gltf){const l=t.scenegraph,c=function(n,e,t){const i=new Qge(n,t);return{scenes:i.instantiate(e),animator:i.createAnimator()}}(i,l,this._getModelOptions());r=ot({gltf:l},c),function(n){return qR.apply(this,arguments)}(c).then(()=>this.setNeedsRedraw())}else t.scenegraph&&(Ri.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 rm?(this._deleteScenegraph(),this._applyAllAttributes(o),this._applyAnimationsProp(o,a,t._animations),this.setState({scenegraph:o,animator:a})):null!==o&&Ri.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):Ri.warn("animation ".concat(o," not found"))()}})}_deleteScenegraph(){const{scenegraph:t}=this.state;t instanceof rm&&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:ot({isInstanced:!0,transpileToGLSL100:!Si(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:u}=this.props,h=this.getNumInstances();this.state.scenegraph.traverse((p,{worldMatrix:g})=>{p.model.setInstanceCount(h),p.updateModuleSettings(t),p.draw({parameters:i,uniforms:{sizeScale:o,opacity:c,sizeMinPixels:a,sizeMaxPixels:l,composeModelMatrix:i5(s,u),sceneModelMatrix:g,u_Camera:p.model.getUniforms().project_uCameraPosition}})})}}return n.layerName="ScenegraphLayer",n.defaultProps=G_e,n})();class W_e extends fh{constructor(e={}){const{id:t=ga("sphere-geometry")}=e,{indices:i,attributes:r}=function(n){const{nlat:e=10,nlong:t=10}=n;let{radius:i=1}=n;const o=Math.PI-0,c=2*Math.PI-0,u=(e+1)*(t+1);if("number"==typeof i){const H=i;i=(U,de,Ae,Pe,Be)=>H}const h=new Float32Array(3*u),p=new Float32Array(3*u),g=new Float32Array(2*u),w=new(u>65535?Uint32Array:Uint16Array)(e*t*6);for(let H=0;H<=e;H++)for(let U=0;U<=t;U++){const de=U/t,Ae=H/e,Pe=U+H*(t+1),Be=2*Pe,et=3*Pe,wt=c*de,vt=o*Ae,Ct=Math.sin(wt),Bt=Math.cos(wt),$t=Math.sin(vt),mt=Bt*$t,Vt=Math.cos(vt),ft=Ct*$t,qt=i(mt,Vt,ft,de,Ae);h[et+0]=qt*mt,h[et+1]=qt*Vt,h[et+2]=qt*ft,p[et+0]=mt,p[et+1]=Vt,p[et+2]=ft,g[Be+0]=de,g[Be+1]=1-Ae}const C=t+1;for(let H=0;Hs?(gt=i,$t=1,mt=t):mt=e+Bt/s*(t-e),(-2===Bt||Bt===s+2)&&(mt=0,$t=0),gt-=i/2;for(let Vt=0;Vts?0:ft*w,et[vt+Pe[1]]=Bt<0?-1:Bt>s?1:C,et[vt+Pe[2]]=Bt<0||Bt>s?0:qt*w,wt[Ct+0]=Vt/r,wt[Ct+1]=$t,Ct+=2,vt+=3}}for(let Bt=0;Bt0){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=sye,s=1/i;r.set(this.x*s,this.y*s,this.z*s);const o=oye;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(Q5),Q5.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 sye=new le,oye=new le,Q5=new le;class mr{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,u=this.upperBound;e.copy(c),t.set(u.x,c.y,c.z),i.set(u.x,u.y,c.z),r.set(c.x,u.y,u.z),s.set(u.x,c.y,u.z),o.set(c.x,u.y,c.z),a.set(c.x,c.y,u.z),l.copy(u)}toLocalFrame(e,t){const i=J5;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=J5;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,u=(this.upperBound.y-i.y)*s,h=(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,u)),Math.min(h,p)),m=Math.min(Math.min(Math.max(a,l),Math.max(c,u)),Math.max(h,p));return!(m<0||g>m)}}const Z5=new le,J5=[new le,new le,new le,new le,new le,new le,new le,new le];class hs{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=lye;e.tangents(i,cye),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(Er(e.length(),2)*Er(t.length(),2))+e.dot(t),this.normalize()}return this}mult(e,t=new hs){const i=this.x,r=this.y,s=this.z,o=this.w,a=e.x,l=e.y,c=e.z,u=e.w;return t.x=i*u+o*a+r*c-s*l,t.y=r*u+o*l+s*a-i*c,t.z=s*u+o*c+i*l-r*a,t.w=o*u-i*a-r*l-s*c,t}inverse(e=new hs){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 hs){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,u=c*i+a*s-l*r,h=c*r+l*i-o*s,p=c*s+o*r-a*i,g=-o*i-a*r-l*s;return t.x=u*c+g*-o+h*-l-p*-a,t.y=h*c+g*-a+p*-o-u*-l,t.z=p*c+g*-l+u*-a-h*-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 u=o*a+l*c;if(u>.499&&(i=2*Math.atan2(o,c),r=Math.PI/2,s=0),u<-.499&&(i=-2*Math.atan2(o,c),r=-Math.PI/2,s=0),void 0===i){const h=o*o,g=l*l;i=Math.atan2(2*a*c-2*o*l,1-a*a*2-2*g),r=Math.asin(2*u),s=Math.atan2(2*o*c-2*a*l,1-2*h-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),u=Math.sin(i/2);return"XYZ"===r?(this.x=l*o*a+s*c*u,this.y=s*c*a-l*o*u,this.z=s*o*u+l*c*a,this.w=s*o*a-l*c*u):"YXZ"===r?(this.x=l*o*a+s*c*u,this.y=s*c*a-l*o*u,this.z=s*o*u-l*c*a,this.w=s*o*a+l*c*u):"ZXY"===r?(this.x=l*o*a-s*c*u,this.y=s*c*a+l*o*u,this.z=s*o*u+l*c*a,this.w=s*o*a-l*c*u):"ZYX"===r?(this.x=l*o*a-s*c*u,this.y=s*c*a+l*o*u,this.z=s*o*u-l*c*a,this.w=s*o*a+l*c*u):"YZX"===r?(this.x=l*o*a+s*c*u,this.y=s*c*a+l*o*u,this.z=s*o*u-l*c*a,this.w=s*o*a-l*c*u):"XZY"===r&&(this.x=l*o*a-s*c*u,this.y=s*c*a-l*o*u,this.z=s*o*u+l*c*a,this.w=s*o*a+l*c*u),this}clone(){return new hs(this.x,this.y,this.z,this.w)}slerp(e,t,i=new hs){const r=this.x,s=this.y,o=this.z,a=this.w;let p,g,m,w,C,l=e.x,c=e.y,u=e.z,h=e.w;return g=r*l+s*c+o*u+a*h,g<0&&(g=-g,l=-l,c=-c,u=-u,h=-h),1-g>1e-6?(p=Math.acos(g),m=Math.sin(p),w=Math.sin((1-t)*p)/m,C=Math.sin(t*p)/m):(w=1-t,C=t),i.x=w*r+C*l,i.y=w*s+C*c,i.z=w*o+C*u,i.w=w*a+C*h,i}integrate(e,t,i,r=new hs){const s=e.x*i.x,o=e.y*i.y,a=e.z*i.z,l=this.x,c=this.y,u=this.z,h=this.w,p=.5*t;return r.x+=p*(s*h+o*u-a*c),r.y+=p*(o*h+a*l-s*u),r.z+=p*(a*h+s*c-o*l),r.w+=p*(-s*l-o*c-a*u),r}}const lye=new le,cye=new le,uye={SPHERE:1,PLANE:2,BOX:4,COMPOUND:8,CONVEXPOLYHEDRON:16,HEIGHTFIELD:32,PARTICLE:64,CYLINDER:128,TRIMESH:256};let _n=(()=>{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=uye,n})();class Gi{constructor(e={}){this.position=void 0,this.quaternion=void 0,this.position=new le,this.quaternion=new hs,e.position&&this.position.copy(e.position),e.quaternion&&this.quaternion.copy(e.quaternion)}pointToLocal(e,t){return Gi.pointToLocalFrame(this.position,this.quaternion,e,t)}pointToWorld(e,t){return Gi.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(t8),t8.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 t8=new hs;class Bf extends _n{constructor(e={}){const{vertices:t=[],faces:i=[],normals:r=[],axes:s,boundingSphereRadius:o}=e;super({type:_n.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 u=!1;for(let h=0;h!==i.length;h++)if(i[h].almostEquals(r)||i[h].almostEquals(r)){u=!0;break}u||i.push(r.clone())}}}computeNormals(){this.faceNormals.length=this.faces.length;for(let e=0;ep&&(p=w,h=m)}const g=[];for(let m=0;m=0&&this.clipFaceAgainstHull(o,e,t,g,a,l,c)}findSeparatingAxis(e,t,i,r,s,o,a,l){const c=new le,u=new le,h=new le,p=new le,g=new le,m=new le;let w=Number.MAX_VALUE;const C=this;if(C.uniqueAxes)for(let H=0;H!==C.uniqueAxes.length;H++){i.vmult(C.uniqueAxes[H],c);const U=C.testSepAxis(c,e,t,i,r,s);if(!1===U)return!1;U0&&o.negate(o),!0}testSepAxis(e,t,i,r,s,o){Bf.project(this,e,i,r,KR),Bf.project(t,e,s,o,XR);const l=KR[0],c=KR[1],u=XR[0],h=XR[1];if(l0?1/t:0,this.material=e.material||null,this.linearDamping="number"==typeof e.linearDamping?e.linearDamping:.01,this.type=t<=0?yn.STATIC:yn.DYNAMIC,typeof e.type==typeof yn.STATIC&&(this.type=e.type),this.allowSleep=void 0===e.allowSleep||e.allowSleep,this.sleepState=yn.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 hs,this.initQuaternion=new hs,this.previousQuaternion=new hs,this.interpolatedQuaternion=new hs,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 su,this.invMassSolve=0,this.invInertiaSolve=new le,this.invInertiaWorldSolve=new su,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 mr,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=yn.AWAKE,this.wakeUpAfterNarrowphase=!1,e===yn.SLEEPING&&this.dispatchEvent(yn.wakeupEvent)}sleep(){this.sleepState=yn.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=Er(this.sleepSpeedLimit,2);t===yn.AWAKE&&ir?this.wakeUp():t===yn.SLEEPY&&e-this.timeLastSleepy>this.sleepTimeLimit&&(this.sleep(),this.dispatchEvent(yn.sleepEvent))}}updateSolveMassProperties(){this.sleepState===yn.SLEEPING||this.type===yn.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 hs;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=fye,o=pye,a=this.quaternion,l=this.aabb,c=gye;for(let u=0;u!==r;u++){const h=e[u];a.vmult(t[u],s),s.vadd(this.position,s),a.mult(i[u],o),h.calculateWorldAABB(s,o,c.lowerBound,c.upperBound),0===u?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=mye,r=_ye;i.setRotationFromQuaternion(this.quaternion),i.transpose(r),i.scale(t,i),i.mmult(r,this.invInertiaWorld)}}applyForce(e,t=new le){if(this.type!==yn.DYNAMIC)return;this.sleepState===yn.SLEEPING&&this.wakeUp();const i=yye;t.cross(e,i),this.force.vadd(e,this.force),this.torque.vadd(i,this.torque)}applyLocalForce(e,t=new le){if(this.type!==yn.DYNAMIC)return;const i=bye,r=vye;this.vectorToWorldFrame(e,i),this.vectorToWorldFrame(t,r),this.applyForce(i,r)}applyTorque(e){this.type===yn.DYNAMIC&&(this.sleepState===yn.SLEEPING&&this.wakeUp(),this.torque.vadd(e,this.torque))}applyImpulse(e,t=new le){if(this.type!==yn.DYNAMIC)return;this.sleepState===yn.SLEEPING&&this.wakeUp();const i=t,r=wye;r.copy(e),r.scale(this.invMass,r),this.velocity.vadd(r,this.velocity);const s=Eye;i.cross(e,s),this.invInertiaWorld.vmult(s,s),this.angularVelocity.vadd(s,this.angularVelocity)}applyLocalImpulse(e,t=new le){if(this.type!==yn.DYNAMIC)return;const i=Sye,r=xye;this.vectorToWorldFrame(e,i),this.vectorToWorldFrame(t,r),this.applyImpulse(i,r)}updateMassProperties(){const e=Cye;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),px.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!==yn.DYNAMIC&&this.type!==yn.KINEMATIC||this.sleepState===yn.SLEEPING)return;const r=this.velocity,s=this.angularVelocity,o=this.position,a=this.force,l=this.torque,c=this.quaternion,h=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 m=h.elements,w=this.angularFactor,C=l.x*w.x,H=l.y*w.y,U=l.z*w.z;s.x+=e*(m[0]*C+m[1]*H+m[2]*U),s.y+=e*(m[3]*C+m[4]*H+m[5]*U),s.z+=e*(m[6]*C+m[7]*H+m[8]*U),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()}}yn.idCounter=0,yn.COLLIDE_EVENT_NAME="collide",yn.DYNAMIC=1,yn.STATIC=2,yn.KINEMATIC=4,yn.AWAKE=0,yn.SLEEPY=1,yn.SLEEPING=2,yn.wakeupEvent={type:"wakeup"},yn.sleepyEvent={type:"sleepy"},yn.sleepEvent={type:"sleep"};const fye=new le,pye=new hs,gye=new mr,mye=new su,_ye=new su,yye=new le,bye=new le,vye=new le,wye=new le,Eye=new le,Sye=new le,xye=new le,Cye=new le;new le,new le;class gx{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 n8,i8,r8,s8,o8,a8,l8;n8=_n.types.SPHERE,i8=_n.types.PLANE,r8=_n.types.BOX,s8=_n.types.CYLINDER,o8=_n.types.CONVEXPOLYHEDRON,a8=_n.types.HEIGHTFIELD,l8=_n.types.TRIMESH;class bs{get[n8](){return this._intersectSphere}get[i8](){return this._intersectPlane}get[r8](){return this._intersectBox}get[s8](){return this._intersectConvex}get[o8](){return this._intersectConvex}get[a8](){return this._intersectHeightfield}get[l8](){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=bs.ANY,this.result=new gx,this.hasHit=!1,this.callback=i=>{}}intersectWorld(e,t){return this.mode=t.mode||bs.ANY,this.result=t.result||new gx,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(c8),eN.length=0,e.broadphase.aabbQuery(e,c8,eN),this.intersectBodies(eN),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=Rye,s=Nye;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 u=new le;o.vsub(i,u);const h=u.dot(c);if(a.vsub(i,u),h*u.dot(c)>0||o.distanceTo(a)=0&&w<=1&&(o.lerp(a,w,g),g.vsub(i,m),m.normalize(),this.reportIntersection(m,g,s,r,-1)),this.result.shouldStop)return;C>=0&&C<=1&&(o.lerp(a,C,g),g.vsub(i,m),m.normalize(),this.reportIntersection(m,g,s,r,-1))}}_intersectConvex(e,t,i,r,s,o){const a=Bye,l=d8,c=o&&o.faceList||null,u=e.faces,h=e.vertices,p=e.faceNormals,g=this.direction,m=this.from,C=m.distanceTo(this.to),H=c?c.length:u.length,U=this.result;for(let de=0;!U.shouldStop&&deC||this.reportIntersection(a,ba,s,r,Ae)}}}}_intersectTrimesh(e,t,i,r,s,o){const a=jye,l=$ye,c=Wye,u=d8,h=Vye,p=Uye,g=zye,m=Gye,w=Hye,C=e.indices,H=this.from,U=this.to,de=this.direction;c.position.copy(i),c.quaternion.copy(t),Gi.vectorToLocalFrame(i,t,de,h),Gi.pointToLocalFrame(i,t,H,p),Gi.pointToLocalFrame(i,t,U,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,h),h.normalize();const Ae=p.distanceSquared(g);e.tree.rayQuery(this,c,l);for(let Pe=0,Be=l.length;!this.result.shouldStop&&Pe!==Be;Pe++){const et=l[Pe];e.getNormal(et,a),e.getVertex(C[3*et],yc),yc.vsub(p,u);const wt=h.dot(a),vt=a.dot(u)/wt;if(vt<0)continue;h.scale(vt,ba),ba.vadd(p,ba),e.getVertex(C[3*et+1],au),e.getVertex(C[3*et+2],lu);const Ct=ba.distanceSquared(p);!bs.pointInTriangle(ba,au,yc,lu)&&!bs.pointInTriangle(ba,yc,au,lu)||Ct>Ae||(Gi.vectorToWorldFrame(t,a,w),Gi.pointToWorldFrame(i,t,ba,m),this.reportIntersection(w,m,s,r,et))}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 bs.ALL:this.hasHit=!0,c.set(o,a,e,t,i,r,l),c.hasHit=!0,this.callback(c);break;case bs.CLOSEST:(l=0&&(h=s*c-o*a)>=0&&u+hDate.now()-n}var Hf=Je(517);class Br extends se{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 $;return this._value}next(e){super.next(this._value=e)}}function fm(n,e,t){e||(e=new qn(qn.IDENTITY));const i=new qn(qn.IDENTITY);if(!n)return!0;if(n.matrix)i.copy(n.matrix);else{if(i.identity(),n.translation&&i.translate(n.translation),n.rotation){const s=new qn(qn.IDENTITY).fromQuaternion(n.rotation);i.multiplyRight(s)}n.scale&&i.scale(n.scale)}const r=new qn(e).multiplyRight(i);if(!1===t(n,r,e))return!1;for(const s of n.nodes||n.children||[])if(!1===fm(s,r,t))return!1;return!0}function n6(){Nz([T5,cm])}function i6(n,e){var t;const i=null===(t=e.nodes)||void 0===t?void 0:t.find(r=>r.name===n);if(i){let r=!1;for(const s of e.scenes)r||fm(s,new qn(qn.IDENTITY),(o,a)=>o!==i||(o.matrix=a,o.translation=void 0,o.rotation=void 0,o.scale=void 0,r=!0,!1));return e.scene={id:n,name:n,nodes:[i]},e.scenes=[e.scene],{scene:e.scene,scenes:e.scenes}}return e}function rN(n,e){return Fi(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 WS(i,cm,{DracoLoader:DR,gltf:{decompressMeshes:!0,postProcess:!0}});return r.nodes||console.log("WARNING: Empty Scene",t,r),i6(n.scenegraphNode,r)})}function qve(n,e){return Fi(this,void 0,void 0,function*(){return i6(n,yield e)})}function sN(n,e,t){if(e&&0!==e.length){let i;switch(t.geometry){case"sphere":i=new W_e;break;case"cone":i=new X_e;break;case"cylinder":i=new Q_e;break;case"cube":default:i=new iye}return new Sge(Object.assign({id:n,pickable:!0,autoHighlight:!1,highlightColor:[30,136,229,255],coordinateSystem:ji.CARTESIAN,data:e,mesh:i,wireframe:!1,getTransformMatrix:r=>r.transformMatrix,getColor:r=>r.color||[255,255,255,229.5]},t))}}function r6(n,e,t){if(e&&0!==e.length)return new fge(Object.assign({id:n,pickable:!0,data:e.map(i=>Object.assign(Object.assign({},i),{position:new qn(i.transformMatrix).getTranslation()})),getText:i=>i.text,getPosition:i=>i.position,getColor:i=>i.color},t))}let Kve=(()=>{class n extends jz{initializeState(){const{data:t}=this.props;this.setState({data:null!=t?t:[],zoomOpacity:.8,doCollisions:!1}),n6()}renderLayers(){var t,i;const r=this.state,s={sphere:[],cone:[],cylinder:[],cube:[],text:[],wireframe:[],scenegraph:[]};for(const l of r.data){const c=null!==(t=l.geometry)&&void 0!==t?t:"cube";l.scenegraph?s.scenegraph.push(l):void 0!==s[c]&&s[c].push(l)}const o={};for(const l of s.scenegraph)l.scenegraph&&l.scenegraphNode&&!Object.prototype.hasOwnProperty.call(o,l.scenegraph)&&(o[l.scenegraph]=rN({scenegraph:l.scenegraph},n.gltfCache));const a=[];for(const[l,c]of Object.entries(s))if("scenegraph"===l)for(const u of c)a.push(new $_e({id:"models-"+u["@id"],opacity:u.zoomBasedOpacity?r.zoomOpacity:void 0!==u.opacity?u.opacity:1,pickable:!u.unpickable,coordinateSystem:ji.CARTESIAN,data:[u],scenegraph:u.scenegraphNode?qve(u.scenegraphNode,o[u.scenegraph]):u.scenegraph,_lighting:u._lighting,getTransformMatrix:u.transformMatrix,getColor:null!==(i=u.color)&&void 0!==i?i:[0,255,0,127.5],parameters:{depthMask:!u.zoomBasedOpacity&&(void 0===u.opacity||1===u.opacity)}}));else"text"===l?(a.push(r6("text",c.filter(u=>u.unpickable),{pickable:!1})),a.push(r6("textPickable",c.filter(u=>!u.unpickable),{pickable:!0}))):"wireframe"===l?a.push(sN(l,c,{wireframe:!0,pickable:!1,geometry:l})):(a.push(sN(l,c.filter(u=>u.unpickable),{wireframe:!1,pickable:!1,geometry:l})),a.push(sN(`${l}Pickable`,c.filter(u=>!u.unpickable),{wireframe:!1,pickable:!0,geometry:l})));return r.doCollisions&&function(n){Fi(this,void 0,void 0,function*(){console.log("Starting Collisioning");const e=n.filter(o=>!o.scenegraph&&"wireframe"!==o.geometry).map(o=>{const a=new qn(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 mr({lowerBound:new le(...l.map((u,h)=>Math.min(u,c[h]))),upperBound:new le(...c.map((u,h)=>Math.max(u,l[h])))})}}),t=[];for(const o of n.filter(a=>!!a.scenegraph)){const a=yield G0(o.scenegraph,cm,{DracoLoader:DR,decompress:!0,postProcess:!0});for(const l of a.scenes)fm(l,new qn(o.transformMatrix),(c,u)=>{if(c.mesh&&c.mesh.primitives&&c.mesh.primitives.length>0)for(const h of c.mesh.primitives)if(h.attributes.POSITION&&h.attributes.POSITION.min){const p=u.transformAsPoint(h.attributes.POSITION.min,[]),g=u.transformAsPoint(h.attributes.POSITION.max,[]);t.push({"@id":o["@id"],name:c.name,entityId:o.entityId,bbox:new mr({lowerBound:new le(...p.map((m,w)=>Math.min(m,g[w]))),upperBound:new le(...g.map((m,w)=>Math.max(m,p[w])))}),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})}(r.data),a.filter(l=>!!l)}getPickingInfo(t){return t.info}}return n.layerName="BodyUILayer",n.gltfCache={},n})();function s6(n,e=[]){for(const t of n.nodes||n.children||[])e.push(t.name),s6(t,e);return e}let Qve=(()=>{class n{constructor(t){var i,r,s,o,a;this.deckProps=t,this.bodyUILayer=new Kve({}),this.nodeClickSubject=new se,this.nodeHoverStartSubject=new se,this.nodeHoverStopSubject=new se,this.sceneRotationSubject=new Br([0,0]),this.nodeDragStartSubject=new se,this.nodeDragSubject=new se,this.nodeDragEndSubject=new se,this.nodeClick$=this.nodeClickSubject.pipe(Es()),this.nodeHoverStart$=this.nodeHoverStartSubject.pipe(Es()),this.nodeHoverStop$=this.nodeHoverStopSubject.pipe(Es()),this.sceneRotation$=this.sceneRotationSubject.pipe(Es()),this.nodeDragStart$=this.nodeDragStartSubject.pipe(Es()),this.nodeDrag$=this.nodeDragSubject.pipe(Es()),this.nodeDragEnd$=this.nodeDragEndSubject.pipe(Es());const l=Object.assign(Object.assign({},t),{views:["orthographic"===t.camera?new Kde({flipY:!1,near:-1e3}):new Zde({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 u;return null!==(u=this.cursor)&&void 0!==u?u:c.isDragging?"grabbing":"grab"}});t.legacyLighting&&(l.effects=[new GO({ambientLight:new Gz({color:[255,255,255],intensity:10})})]),this.deck=new ix(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 Fi(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 qn([.076,0,0,0,0,.076,16875389974302382e-33,0,0,-16875389974302382e-33,.076,0,.49,.034,.11,1]);(function(n,e,t,i){return Fi(this,void 0,void 0,function*(){n6();const r=yield rN({scenegraph:n,scenegraphNode:"VHF_Kidney_L_Low1"},undefined),s={},o=[];for(const a of r.scenes)fm(a,e=new qn(e||qn.IDENTITY),(l,c)=>{const u={"@id":l.name||l.id,"@type":"ProcessedNode",transformMatrix:new qn(c),geometry:"wireframe",node:l};if(o.push({"@id":`GLTF:${u["@id"]}`,"@type":"GLTFNode",scenegraph:n,scenegraphNode:u["@id"],transformMatrix:new qn(e||qn.IDENTITY),tooltip:l.name||l.id,color:[255,255,255,255],_lighting:"pbr",zoomBasedOpacity:!0,node:l}),l.mesh&&l.mesh.primitives&&l.mesh.primitives.length>0)for(const h of l.mesh.primitives)if(h.attributes.POSITION&&h.attributes.POSITION.min){const p=c.transformAsPoint(h.attributes.POSITION.min,[]),g=c.transformAsPoint(h.attributes.POSITION.max,[]);u.bbox=new mr({lowerBound:new le(...p.map((m,w)=>Math.min(m,g[w]))),upperBound:new le(...g.map((m,w)=>Math.max(m,p[w])))})}return s[u["@id"]]=u,!0});for(const a of Object.values(s).filter(l=>!l.bbox)){for(const l of s6(a.node).map(c=>s[c]).filter(c=>c.bbox))a.bbox?a.bbox.extend(l.bbox):a.bbox=l.bbox.clone();a.bbox||delete s[a["@id"]]}for(const a of Object.values(s)){const l=a.bbox.lowerBound,h=(a.size=a.bbox.upperBound.clone().vsub(l)).clone().vmul(new le(.5,.5,.5)),p=a.center=l.clone().vadd(h);a.transformMatrix=new qn(qn.IDENTITY).translate(p.toArray()).scale(h.toArray())}for(const a of o)s[a["@id"]]=a;return s})})(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 qn(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 rr([Hf.ZP],n.prototype,"_onHover",null),rr([Hf.ZP],n.prototype,"_onClick",null),rr([Hf.ZP],n.prototype,"_onViewStateChange",null),rr([Hf.ZP],n.prototype,"_onDragStart",null),rr([Hf.ZP],n.prototype,"_onDrag",null),rr([Hf.ZP],n.prototype,"_onDragEnd",null),n})();function Zve(n,e){return n===e}function Jve(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 oN=(()=>{class n{constructor(){this.bootstrap$=new kg(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 aN=new Ht("INITIAL_STATE_TOKEN");let nwe=(()=>{class n{static set(t){this.value=t}static pop(){const t=this.value;return this.value={},t}}return n.value={},n})();const o6=new Ht("Internals.StateContextFactory"),a6=new Ht("Internals.StateFactory");function ub(...n){if(1===n.length){const e=n[0];if(P(e))return Cx(e,null);if(Q(e)&&Object.getPrototypeOf(e)===Object.prototype){const t=Object.keys(e);return Cx(t.map(i=>e[i]),t)}}if("function"==typeof n[n.length-1]){const e=n.pop();return Cx(n=1===n.length&&P(n[0])?n[0]:n,null).pipe(me(t=>e(...t)))}return Cx(n,null)}function Cx(n,e){return new I(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]=u},error:u=>t.error(u),complete:()=>{s++,(s===i||!c)&&(o===i&&t.next(e?e.reduce((u,h,p)=>(u[h]=r[p],u),{}):r),t.complete())}}))}})}function Qi(n,e){return function(i){return i.lift(new iwe(n,e))}}class iwe{constructor(e,t){this.predicate=e,this.thisArg=t}call(e,t){return t.subscribe(new rwe(e,this.predicate,this.thisArg))}}class rwe 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 $a(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(u){let h;s++,!r||a?(a=!1,r=new kg(n,e,i),h=r.subscribe(this),o=u.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)):h=r.subscribe(this),this.add(()=>{s--,h.unsubscribe(),h=void 0,o&&!l&&t&&0===s&&(o.unsubscribe(),o=void 0,r=void 0)})}}(i))}const l6=(()=>{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 Wi(n){return e=>0===n?lS():e.lift(new owe(n))}class owe{constructor(e){if(this.total=e,this.total<0)throw new l6}call(e,t){return t.subscribe(new awe(e,this.total))}}class awe 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 c6(n,e){return e?t=>t.pipe(c6((i,r)=>je(n(i,r)).pipe(me((s,o)=>e(i,s,r,o))))):t=>t.lift(new lwe(n))}class lwe{constructor(e){this.project=e}call(e,t){return t.subscribe(new cwe(e,this.project))}}class cwe extends ve{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 _t(this),i=this.destination;i.add(t);const r=N(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 Ax(n=null){return e=>e.lift(new uwe(n))}class uwe{constructor(e){this.defaultValue=e}call(e,t){return t.subscribe(new dwe(e,this.defaultValue))}}class dwe 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 bc(n){return function(t){const i=new hwe(n),r=t.lift(i);return i.caught=r}}class hwe{constructor(e){this.selector=e}call(e,t){return t.subscribe(new fwe(e,this.selector,this.caught))}}class fwe extends ve{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 _t(this);this.add(i);const r=N(t,i);r!==i&&this.add(r)}}}function _r(n){return e=>e.lift(new pwe(n))}class pwe{constructor(e){this.notifier=e}call(e,t){const i=new gwe(e),r=N(this.notifier,new _t(i));return r&&!i.seenValue?(i.add(r),t.subscribe(i)):i}}class gwe extends ve{constructor(e){super(e),this.seenValue=!1}notifyNext(){this.seenValue=!0,this.complete()}notifyComplete(){}}function _h(){}function Yr(n,e,t){return function(r){return r.lift(new mwe(n,e,t))}}class mwe{constructor(e,t,i){this.nextOrObserver=e,this.error=t,this.complete=i}call(e,t){return t.subscribe(new _we(e,this.nextOrObserver,this.error,this.complete))}}class _we extends y{constructor(e,t,i,r){super(e),this._tapNext=_h,this._tapError=_h,this._tapComplete=_h,this._tapError=i||_h,this._tapComplete=r||_h,Y(t)?(this._context=this,this._tapNext=t):t&&(this._context=t,this._tapNext=t.next||_h,this._tapError=t.error||_h,this._tapComplete=t.complete||_h)}_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 rd(n,e){return t=>t.lift(new ywe(n,e))}class ywe{constructor(e,t){this.compare=e,this.keySelector=t}call(e,t){return t.subscribe(new bwe(e,this.compare,this.keySelector))}}class bwe 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 Wa={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 u6=(()=>{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 gn.isInAngularZone()?t():this._ngZone.run(t)}runOutsideAngular(t){return gn.isInAngularZone()?this._ngZone.runOutsideAngular(t):t()}verifyZoneIsNotNooped(t){t instanceof gn||console.warn(Wa.ZONE_WARNING())}}return n.\u0275fac=function(t){return new(t||n)(Oe(gn),Oe(Wc))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const d6=new Ht("ROOT_STATE_TOKEN"),h6=new Ht("FEATURE_STATE_TOKEN"),f6=new Ht("NGXS_PLUGINS"),p6=new Ht("NG_TEST_MODE"),g6=new Ht("NG_DEV_MODE"),sd="NGXS_META",m6="NGXS_OPTIONS_META",lN="NGXS_SELECTOR_META";let Gf=(()=>{class n{constructor(){this.defaultsState={},this.selectorOptions={injectContainerState:!0,suppressErrors:!0},this.compatibility={strictContentSecurityPolicy:!1},this.executionStrategy=u6}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();class vwe{constructor(e,t,i){this.previousValue=e,this.currentValue=t,this.firstChange=i}}const _6=new Ht("NGXS_EXECUTION_STRATEGY");function $f(n){return n.constructor&&n.constructor.type?n.constructor.type:n.type}const y6=(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},Tx=(n,e)=>e.split(".").reduce((t,i)=>t&&t[i],n),cN=n=>n&&"object"==typeof n&&!Array.isArray(n),uN=(n,...e)=>{if(!e.length)return n;const t=e.shift();if(cN(n)&&cN(t))for(const i in t)cN(t[i])?(n[i]||Object.assign(n,{[i]:{}}),uN(n[i],t[i])):Object.assign(n,{[i]:t[i]});return uN(n,...e)};function dN(n){if(!n.hasOwnProperty(sd)){const e={name:null,actions:{},defaults:{},path:null,makeRootSelector:t=>t.getStateGetter(e.name),children:[]};Object.defineProperty(n,sd,{value:e})}return db(n)}function db(n){return n[sd]}function fN(n){return n[lN]}function b6(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(e[$f(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 Qi(t=>{const i=$f(t.action);return n[i]&&(!e||e[t.status])})}(i,r),t())}}(n,["DISPATCHED"])}function Owe(){return me(n=>n.action)}function Mx(n){return e=>new I(t=>e.subscribe({next(i){n.leave(()=>t.next(i))},error(i){n.leave(()=>t.error(i))},complete(){n.leave(()=>t.complete())}}))}let Dx=(()=>{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)(Oe(_6))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();class Pwe extends se{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 Ix=(()=>{class n extends Pwe{}return n.\u0275fac=function(){let e;return function(i){return(e||(e=nr(n)))(i||n)}}(),n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),Fwe=(()=>{class n extends I{constructor(t,i){super(r=>{const s=t.pipe(Mx(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)(Oe(Ix),Oe(Dx))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const w6=n=>(...e)=>n.shift()(...e,(...i)=>w6(n)(...i));let Ox=(()=>{class n extends Br{constructor(){super({})}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),pN=(()=>{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)(Oe(n,12),Oe(f6,8))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),gN=(()=>{class n extends se{}return n.\u0275fac=function(){let e;return function(i){return(e||(e=nr(n)))(i||n)}}(),n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),E6=(()=>{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(oa),this._errorHandler.handleError(r)}catch(s){}})}),i.pipe(Mx(this._ngxsExecutionStrategy))}dispatchByEvents(t){return Array.isArray(t)?0===t.length?fn(this._stateStream.getValue()):ub(t.map(i=>this.dispatchSingle(i))):this.dispatchSingle(t)}dispatchSingle(t){if(!$f(t))return Fg(new Error(`This action doesn't have a type property: ${t.constructor.name}`));const r=this._stateStream.getValue();return w6([...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($a())}getActionResultStream(t){return this._actionResults.pipe(Qi(i=>i.action===t&&"DISPATCHED"!==i.status),Wi(1),$a())}createDispatchObservable(t){return t.pipe(c6(i=>{switch(i.status){case"SUCCESSFUL":return fn(this._stateStream.getValue());case"ERRORED":return Fg(i.error);default:return Yc}})).pipe($a())}}return n.\u0275fac=function(t){return new(t||n)(Oe(Wn),Oe(Ix),Oe(gN),Oe(pN),Oe(Ox),Oe(Dx))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const S6=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])&&S6(n[i])}),n};let x6=(()=>{class n{constructor(t,i){this.isDevMode=t,this.isTestMode=i}}return n.\u0275fac=function(t){return new(t||n)(Oe(g6),Oe(p6))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),C6=(()=>{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(Wa.INCORRECT_PRODUCTION()):this.isIncorrectDevelopment&&console.warn(Wa.INCORRECT_DEVELOPMENT()))}}return n.\u0275fac=function(t){return new(t||n)(Oe(x6),Oe(Gf))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),gm=(()=>{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=S6(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)(Oe(Ox),Oe(E6),Oe(Gf),Oe(C6))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),Rx=(()=>{class n{constructor(t){this._internalStateOperations=t}createStateContext(t){const i=this._internalStateOperations.getRootStateOperations();function r(l){return Tx(l,t.path)}function s(l,c){const u=y6(l,t.path,c),h=t.instance;if(h.ngxsOnChanges){const p=v6(t,{currentAppState:l,newAppState:u});h.ngxsOnChanges(p)}return i.setState(u),u}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(Wa.PATCHING_ARRAY());if("object"!=typeof n)throw new Error(Wa.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)(Oe(gm))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();class Nx{static stateNameErrorMessage(e){return Wa.STATE_NAME(e)}static checkCorrectStateName(e){if(!e)throw new Error(Wa.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(Wa.STATE_UNIQUE(r,e.name,s.name));return r}static getValidStateMeta(e){const t=db(e);if(!t)throw new Error(Wa.STATE_DECORATOR());return t}}Nx.stateNameRegex=new RegExp("^[a-zA-Z0-9_]+$");let mm=(()=>{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=xx(()=>{const c=this;function u(p){const g=c.statePaths[p];return g?b6(g.split("."),c._config):null}return this._parentFactory?this._parentFactory.getRuntimeSelectorContext():{getStateGetter(p){let g=u(p);return g||((...m)=>(g||(g=u(p)),g?g(...m):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(Nx.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[sd].name};return n.reduce((t,i)=>{const{name:r,children:s}=i[sd];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[sd].name]=t,e),{})}(i),l=[];for(const c of s){const u=a[c],h=o[c],p=u[sd];this.addRuntimeInfoToMeta(p,h);const g={name:c,path:h,isInitialised:!1,actions:p.actions,instance:this._injector.get(u),defaults:n.cloneDefaults(p.defaults)};this.hasBeenMountedAndBootstrapped(c,h)||l.push(g),this.states.push(g)}return l}addAndReturnDefaults(t){const r=this.add(t||[]);return{defaults:r.reduce((o,a)=>y6(o,a.path,a.defaults),{}),states:r}}connectActionHandlers(){null===this._actionsSubscription&&(this._actionsSubscription=this._actions.pipe(Qi(t=>"DISPATCHED"===t.status),B(({action:t})=>this.invokeActions(this._actions,t).pipe(me(()=>({action:t,status:"SUCCESSFUL"})),Ax({action:t,status:"CANCELED"}),bc(i=>fn({action:t,status:"ERRORED",error:i}))))).subscribe(t=>this._actionResults.next(t)))}invokeActions(t,i){const r=$f(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 u=o.instance[l.fn](c,i);u instanceof Promise&&(u=je(u)),u instanceof I?(u=u.pipe(Ax({})),l.options.cancelUncompleted&&(u=u.pipe(_r(t.pipe(Mwe(i)))))):u=fn({}).pipe($a()),s.push(u)}catch(u){s.push(Fg(u))}}}return s.length||s.push(fn({})),ub(s)}addToStatesMap(t){const i=[],r=this.statesByName;for(const s of t){const o=Nx.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!==Tx(this._initialState,i);return this.statesByName[t]&&r}}return n.\u0275fac=function(t){return new(t||n)(Oe(Wn),Oe(Gf),Oe(n,12),Oe(Ix),Oe(gN),Oe(Rx),Oe(aN,8))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),mN=(()=>{class n{constructor(t,i,r){this.internalStateOperations=t,this.stateContextFactory=i,this.bootstrapper=r}ngxsBootstrap(t,i){this.internalStateOperations.getRootStateOperations().dispatch(t).pipe(Qi(()=>!!i),Yr(()=>this.invokeInit(i.states)),B(()=>this.bootstrapper.appBootstrapped$),Qi(r=>!!r)).subscribe(()=>this.invokeBootstrap(i.states))}invokeInit(t){for(const i of t){const r=i.instance;if(r.ngxsOnChanges){const a=v6(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)(Oe(gm),Oe(Rx),Oe(oN))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const Px_getOptions=n=>n&&n.NGXS_SELECTOR_OPTIONS_META||{};function Lwe(n,e,t){const i=t&&t.containerClass,s=xx(function(...c){const u=e.apply(i,c);return u instanceof Function?xx.apply(null,[u]):u});Object.setPrototypeOf(s,e);const o=function(n,e){const t=function(n){return n.hasOwnProperty(lN)||Object.defineProperty(n,lN,{value:{makeRootSelector:null,originalFn:null,containerClass:null,selectorName:null,getSelectorOptions:()=>({})}}),fN(n)}(n);t.originalFn=n;let i=()=>({});e&&(t.containerClass=e.containerClass,t.selectorName=e.selectorName,i=e.getSelectorOptions||i);const r=Object.assign({},t);return t.getSelectorOptions=()=>function(n,e){return Object.assign({},Px_getOptions(n.containerClass)||{},Px_getOptions(n.originalFn)||{},n.getSelectorOptions()||{},e)}(r,i()),t}(e,t);return o.makeRootSelector=l=>{const{argumentSelectorFunctions:c,selectorOptions:u}=function(n,e,t=[]){const i=e.getSelectorOptions(),r=n.getSelectorOptions(i);return{selectorOptions:r,argumentSelectorFunctions:function(n=[],e,t){const i=[];return t&&(0===n.length||e.injectContainerState)&&db(t)&&i.push(t),n&&i.push(...n),i}(t,r,e.containerClass).map(a=>T6(a)(n))}}(l,o,n);return function(p){const g=c.map(m=>m(p));try{return s(...g)}catch(m){if(m instanceof TypeError&&u.suppressErrors)return;throw m}}},s}function T6(n){const e=fN(n)||db(n);return e&&e.makeRootSelector||(()=>n)}let cu=(()=>{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),bc(r=>{const{suppressErrors:s}=this._config.selectorOptions;return r instanceof TypeError&&s?fn(void 0):Fg(r)}),rd(),Mx(this._internalExecutionStrategy))}selectOnce(t){return this.select(t).pipe(Wi(1))}selectSnapshot(t){return this.getStoreBoundSelectorFn(t)(this._stateStream.getValue())}subscribe(t){return this._stateStream.pipe(Mx(this._internalExecutionStrategy)).subscribe(t)}snapshot(){return this._internalStateOperations.getRootStateOperations().getState()}reset(t){return this._internalStateOperations.getRootStateOperations().setState(t)}getStoreBoundSelectorFn(t){return T6(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)(Oe(Ox),Oe(gm),Oe(Gf),Oe(Dx),Oe(mm),Oe(aN,8))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),hb=(()=>{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)(Oe(cu),Oe(Gf))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n.store=null,n.config=null,n})();class zwe{static get type(){return"@@INIT"}}class Hwe{constructor(e){this.addedStates=e}static get type(){return"@@UPDATE_STATE"}}const Fx=new kg(1);let $we=(()=>{class n{constructor(t,i,r,s,o=[],a){!function(){try{const n=window.ng,t=!(n.probe&&n.coreTokens)&&Ba();Fx.next(t)}catch(n){Fx.next(!1)}finally{Fx.complete()}}();const l=t.addAndReturnDefaults(o);i.setStateToTheCurrentWithNew(l),t.connectActionHandlers(),a.ngxsBootstrap(new zwe,l)}}return n.\u0275fac=function(t){return new(t||n)(Oe(mm),Oe(gm),Oe(cu),Oe(hb),Oe(d6,8),Oe(mN))},n.\u0275mod=on({type:n}),n.\u0275inj=xt({}),n})(),Wwe=(()=>{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 Hwe(l.defaults),l))}static flattenStates(t=[]){return t.reduce((i,r)=>i.concat(r),[])}}return n.\u0275fac=function(t){return new(t||n)(Oe(cu),Oe(gm),Oe(mm),Oe(h6,8),Oe(mN))},n.\u0275mod=on({type:n}),n.\u0275inj=xt({}),n})();class Wo{static forRoot(e=[],t={}){return{ngModule:$we,providers:[mm,Rx,Fwe,Ix,oN,C6,x6,mN,E6,gN,gm,Dx,cu,Ox,hb,pN,...e,...Wo.ngxsTokenProviders(e,t)]}}static forFeature(e=[]){return{ngModule:Wwe,providers:[mm,pN,...e,{provide:h6,multi:!0,useValue:e}]}}static ngxsTokenProviders(e,t){return[{provide:p6,useValue:twe},{provide:g6,useValue:Ba},{provide:_6,useClass:t.executionStrategy||u6},{provide:d6,useValue:e},{provide:Wo.ROOT_OPTIONS,useValue:t},{provide:Gf,useFactory:Wo.ngxsConfigFactory,deps:[Wo.ROOT_OPTIONS]},{provide:RE,useFactory:Wo.appBootstrapListenerFactory,multi:!0,deps:[oN]},{provide:aN,useFactory:Wo.getInitialState},{provide:o6,useExisting:Rx},{provide:a6,useExisting:mm}]}static ngxsConfigFactory(e){return uN(new Gf,e)}static appBootstrapListenerFactory(e){return()=>e.bootstrap()}static getInitialState(){return nwe.pop()}}function _N(n,e){return(t,i)=>{if(t.hasOwnProperty("prototype"))throw new Error(Wa.ACTION_DECORATOR());const s=dN(t.constructor);Array.isArray(n)||(n=[n]);for(const o of n){const a=o.type;s.actions[a]||(s.actions[a]=[]),s.actions[a].push({fn:i,options:e||{},type:a})}}}function M6(n){return i=>{!function(n){Fx.subscribe(e=>{e&&(n.\u0275prov||console.warn(Wa.UNDECORATED_STATE_IN_IVY(n.name)))})}(i);const r=i,s=dN(r),o=Object.getPrototypeOf(r),a=function(i){return Object.assign({},i[m6]||{},n)}(o);(function(i){const{meta:r,inheritedStateClass:s,optionsWithInheritance:o}=i,{children:a,defaults:l,name:c}=o,u="string"==typeof c?c:c&&c.getName()||null;Nx.checkCorrectStateName(u),s.hasOwnProperty(sd)&&(r.actions=Object.assign({},r.actions,(s[sd]||{}).actions)),r.children=a,r.defaults=l,r.name=u})({meta:s,inheritedStateClass:o,optionsWithInheritance:a}),r[m6]=a}}function kx(n,...e){return function(t,i){const r=i.toString(),s=`__${r}__selector`,o=function(n,e,t=[]){return"string"==typeof(e=e||function(n){const e=n.length-1;return 36===n.charCodeAt(e)?n.slice(0,e):n}(n))?b6(t.length?[e,...t]:e.split("."),hb.config):e}(r,n,e);Object.defineProperties(t,{[s]:{writable:!0,enumerable:!1,configurable:!0},[r]:{enumerable:!0,configurable:!0,get(){return this[s]||(this[s]=function(n){if(!hb.store)throw new Error(Wa.SELECT_FACTORY_NOT_CONNECTED());return hb.store.select(n)}(o))}}})}}function _m(n){return(e,t,i)=>{if(!i||null===i.value)throw new Error(Wa.SELECTOR_DECORATOR());const s=i.value,o=Lwe(n,s,{containerClass:e,selectorName:t.toString(),getSelectorOptions:()=>({})}),a={configurable:!0,get:()=>o};return a.originalFn=s,a}}function Dl(n,...e){return e.length?e.some(t=>n[t]):n.altKey||n.shiftKey||n.ctrlKey||n.metaKey}Wo.\u0275fac=function(e){return new(e||Wo)},Wo.\u0275mod=on({type:Wo}),Wo.\u0275inj=xt({}),Wo.ROOT_OPTIONS=new Ht("ROOT_OPTIONS");const Kx=new uc(aS);class iSe{constructor(e){this.total=e}call(e,t){return t.subscribe(new rSe(e,this.total))}}class rSe extends y{constructor(e,t){super(e),this.total=t,this.count=0}_next(e){++this.count>this.total&&this.destination.next(e)}}function xi(n){return null!=n&&"false"!=`${n}`}function Xx(n){return Array.isArray(n)?n:[n]}function vs(n){return null==n?"":"string"==typeof n?n:`${n}px`}function ad(n){return n instanceof En?n.nativeElement:n}let zN;try{zN="undefined"!=typeof Intl&&Intl.v8BreakIterator}catch(n){zN=!1}let Eb,qf,HN,Zi=(()=>{class n{constructor(t){this._platformId=t,this.isBrowser=this._platformId?Tf(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&&!zN)&&"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)(Oe(Wc))},n.\u0275prov=We({factory:function(){return new n(Oe(Wc))},token:n,providedIn:"root"}),n})();function vm(n){return function(){if(null==Eb&&"undefined"!=typeof window)try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:()=>Eb=!0}))}finally{Eb=Eb||!1}return Eb}()?n:!!n.capture}function LH(){if(null==qf){if("object"!=typeof document||!document||"function"!=typeof Element||!Element)return qf=!1,qf;if("scrollBehavior"in document.documentElement.style)qf=!0;else{const n=Element.prototype.scrollTo;qf=!!n&&!/\{\s*\[native code\]\s*\}/.test(n.toString())}}return qf}function Zx(){let n="undefined"!=typeof document&&document?document.activeElement:null;for(;n&&n.shadowRoot;){const e=n.shadowRoot.activeElement;if(e===n)break;n=e}return n}function Yf(n){return n.composedPath?n.composedPath()[0]:n.target}let qH=(()=>{class n{constructor(t){this._platform=t}isDisabled(t){return t.hasAttribute("disabled")}isVisible(t){return function(n){return!!(n.offsetWidth||n.offsetHeight||"function"==typeof n.getClientRects&&n.getClientRects().length)}(t)&&"visible"===getComputedStyle(t).visibility}isTabbable(t){if(!this._platform.isBrowser)return!1;const i=function(n){try{return n.frameElement}catch(e){return null}}(function(n){return n.ownerDocument&&n.ownerDocument.defaultView||window}(t));if(i&&(-1===KH(i)||!this.isVisible(i)))return!1;let r=t.nodeName.toLowerCase(),s=KH(t);return t.hasAttribute("contenteditable")?-1!==s:!("iframe"===r||"object"===r||this._platform.WEBKIT&&this._platform.IOS&&!function(n){let e=n.nodeName.toLowerCase(),t="input"===e&&n.type;return"text"===t||"password"===t||"select"===e||"textarea"===e}(t))&&("audio"===r?!!t.hasAttribute("controls")&&-1!==s:"video"===r?-1!==s&&(null!==s||this._platform.FIREFOX||t.hasAttribute("controls")):t.tabIndex>=0)}isFocusable(t,i){return function(n){return!function(n){return function(n){return"input"==n.nodeName.toLowerCase()}(n)&&"hidden"==n.type}(n)&&(function(n){let e=n.nodeName.toLowerCase();return"input"===e||"select"===e||"button"===e||"textarea"===e}(n)||function(n){return function(n){return"a"==n.nodeName.toLowerCase()}(n)&&n.hasAttribute("href")}(n)||n.hasAttribute("contenteditable")||YH(n))}(t)&&!this.isDisabled(t)&&((null==i?void 0:i.ignoreVisibility)||this.isVisible(t))}}return n.\u0275fac=function(t){return new(t||n)(Oe(Zi))},n.\u0275prov=We({factory:function(){return new n(Oe(Zi))},token:n,providedIn:"root"}),n})();function YH(n){if(!n.hasAttribute("tabindex")||void 0===n.tabIndex)return!1;let e=n.getAttribute("tabindex");return"-32768"!=e&&!(!e||isNaN(parseInt(e,10)))}function KH(n){if(!YH(n))return null;const e=parseInt(n.getAttribute("tabindex")||"",10);return isNaN(e)?-1:e}class xSe{constructor(e,t,i,r,s=!1){this._element=e,this._checker=t,this._ngZone=i,this._document=r,this._hasAttached=!1,this.startAnchorListener=()=>this.focusLastTabbableElement(),this.endAnchorListener=()=>this.focusFirstTabbableElement(),this._enabled=!0,s||this.attachAnchors()}get enabled(){return this._enabled}set enabled(e){this._enabled=e,this._startAnchor&&this._endAnchor&&(this._toggleAnchorTabIndex(e,this._startAnchor),this._toggleAnchorTabIndex(e,this._endAnchor))}destroy(){const 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}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(e){return new Promise(t=>{this._executeOnStable(()=>t(this.focusInitialElement(e)))})}focusFirstTabbableElementWhenReady(e){return new Promise(t=>{this._executeOnStable(()=>t(this.focusFirstTabbableElement(e)))})}focusLastTabbableElementWhenReady(e){return new Promise(t=>{this._executeOnStable(()=>t(this.focusLastTabbableElement(e)))})}_getRegionBoundary(e){let t=this._element.querySelectorAll(`[cdk-focus-region-${e}], [cdkFocusRegion${e}], [cdk-focus-${e}]`);for(let i=0;i=0;i--){let r=t[i].nodeType===this._document.ELEMENT_NODE?this._getLastTabbableElement(t[i]):null;if(r)return r}return null}_createAnchor(){const 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}_toggleAnchorTabIndex(e,t){e?t.setAttribute("tabindex","0"):t.removeAttribute("tabindex")}toggleAnchors(e){this._startAnchor&&this._endAnchor&&(this._toggleAnchorTabIndex(e,this._startAnchor),this._toggleAnchorTabIndex(e,this._endAnchor))}_executeOnStable(e){this._ngZone.isStable?e():this._ngZone.onStable.pipe(Wi(1)).subscribe(e)}}let XH=(()=>{class n{constructor(t,i,r){this._checker=t,this._ngZone=i,this._document=r}create(t,i=!1){return new xSe(t,this._checker,this._ngZone,this._document,i)}}return n.\u0275fac=function(t){return new(t||n)(Oe(qH),Oe(gn),Oe(pn))},n.\u0275prov=We({factory:function(){return new n(Oe(qH),Oe(gn),Oe(pn))},token:n,providedIn:"root"}),n})();"undefined"!=typeof Element&∈const JH=new Ht("cdk-input-modality-detector-options"),DSe={ignoreKeys:[18,17,224,91,16]},wm=vm({passive:!0,capture:!0});let tG=(()=>{class n{constructor(t,i,r,s){this._platform=t,this._mostRecentTarget=null,this._modality=new Br(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=Yf(o))},this._onMousedown=o=>{Date.now()-this._lastTouchMs<650||(this._modality.next(function(n){return 0===n.offsetX&&0===n.offsetY}(o)?"keyboard":"mouse"),this._mostRecentTarget=Yf(o))},this._onTouchstart=o=>{!function(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)}(o)?(this._lastTouchMs=Date.now(),this._modality.next("touch"),this._mostRecentTarget=Yf(o)):this._modality.next("keyboard")},this._options=Object.assign(Object.assign({},DSe),s),this.modalityDetected=this._modality.pipe(function(n){return e=>e.lift(new iSe(n))}(1)),this.modalityChanged=this.modalityDetected.pipe(rd()),t.isBrowser&&i.runOutsideAngular(()=>{r.addEventListener("keydown",this._onKeydown,wm),r.addEventListener("mousedown",this._onMousedown,wm),r.addEventListener("touchstart",this._onTouchstart,wm)})}get mostRecentModality(){return this._modality.value}ngOnDestroy(){!this._platform.isBrowser||(document.removeEventListener("keydown",this._onKeydown,wm),document.removeEventListener("mousedown",this._onMousedown,wm),document.removeEventListener("touchstart",this._onTouchstart,wm))}}return n.\u0275fac=function(t){return new(t||n)(Oe(Zi),Oe(gn),Oe(pn),Oe(JH,8))},n.\u0275prov=We({factory:function(){return new n(Oe(Zi),Oe(gn),Oe(pn),Oe(JH,8))},token:n,providedIn:"root"}),n})();const rG=new Ht("cdk-focus-monitor-default-options"),tC=vm({passive:!0,capture:!0});let du=(()=>{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 se,this._rootNodeFocusAndBlurListener=a=>{const l=Yf(a),c="focus"===a.type?this._onFocus:this._onBlur;for(let u=l;u;u=u.parentElement)c.call(this,a,u)},this._document=s,this._detectionMode=(null==o?void 0:o.detectionMode)||0}monitor(t,i=!1){const r=ad(t);if(!this._platform.isBrowser||1!==r.nodeType)return fn(null);const s=function(n){if(function(){if(null==HN){const n="undefined"!=typeof document?document.head:null;HN=!(!n||!n.createShadowRoot&&!n.attachShadow)}return HN}()){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 se,rootNode:s};return this._elementInfo.set(r,a),this._registerGlobalListeners(a),a.subject}stopMonitoring(t){const i=ad(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=ad(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=Yf(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,tC),i.addEventListener("blur",this._rootNodeFocusAndBlurListener,tC)}),this._rootNodeFocusListenerCount.set(i,r+1),1==++this._monitoredElementCount&&(this._ngZone.runOutsideAngular(()=>{this._getWindow().addEventListener("focus",this._windowFocusListener)}),this._inputModalityDetector.modalityDetected.pipe(_r(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,tC),i.removeEventListener("blur",this._rootNodeFocusAndBlurListener,tC),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)(Oe(gn),Oe(Zi),Oe(tG),Oe(pn,8),Oe(rG,8))},n.\u0275prov=We({factory:function(){return new n(Oe(gn),Oe(Zi),Oe(tG),Oe(pn,8),Oe(rG,8))},token:n,providedIn:"root"}),n})();const lG=new Ht("cdk-dir-doc",{providedIn:"root",factory:function(){return Fc(pn)}});let Il=(()=>{class n{constructor(t){if(this.value="ltr",this.change=new sn,t){const r=t.documentElement?t.documentElement.dir:null,s=(t.body?t.body.dir:null)||r;this.value="ltr"===s||"rtl"===s?s:"ltr"}}ngOnDestroy(){this.change.complete()}}return n.\u0275fac=function(t){return new(t||n)(Oe(lG,8))},n.\u0275prov=We({factory:function(){return new n(Oe(lG,8))},token:n,providedIn:"root"}),n})();function nC(...n){return Nt(1)(fn(...n))}function ao(...n){const e=n[n.length-1];return Ce(e)?(n.pop(),t=>nC(n,t,e)):t=>nC(n,t)}function Em(n,e){return{type:7,name:n,definitions:e,options:{}}}function cd(n,e=null){return{type:4,styles:e,timings:n}}function fs(n){return{type:6,styles:n,offset:null}}function vc(n,e,t){return{type:0,name:n,styles:e,options:t}}function ud(n,e,t=null){return{type:1,expr:n,animation:e,options:t}}function hG(n){Promise.resolve(null).then(n)}class Sm{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(){hG(()=>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 pG(){return"undefined"!=typeof window&&void 0!==window.document}function KN(){return"undefined"!=typeof process&&"[object process]"==={}.toString.call(process)}let JN=(n,e)=>!1,eP=(n,e)=>!1,_G=(n,e,t)=>[];const yG=KN();(yG||"undefined"!=typeof Element)&&(JN=pG()?(n,e)=>{for(;e&&e!==document.documentElement;){if(e===n)return!0;e=e.parentNode||e.host}return!1}:(n,e)=>n.contains(e),eP=(()=>{if(yG||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]):eP}})(),_G=(n,e,t)=>{let i=[];if(t){const r=n.querySelectorAll(e);for(let s=0;s{class n{validateStyleProperty(t){return tP(t)}matchesElement(t,i){return nP(t,i)}containsElement(t,i){return iP(t,i)}query(t,i,r){return rP(t,i,r)}computeStyle(t,i,r){return r||""}animate(t,i,r,s,o,a=[],l){return new Sm(r,s)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();class iC{}iC.NOOP=new wG;function CG(n,e,t){return t?e+":"+t+";":""}function AG(n){let e="";for(let t=0;t{const r=cP(i);t&&!t.hasOwnProperty(i)&&(t[i]=n.style[r]),n.style[r]=e[i]}),KN()&&AG(n))}function Qf(n,e){n.style&&(Object.keys(e).forEach(t=>{const i=cP(t);n.style[i]=""}),KN()&&AG(n))}const HSe=/-+([a-z0-9])/g;function cP(n){return n.replace(HSe,(...e)=>e[1].toUpperCase())}function GSe(n){return n.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}class Am{constructor(e,t,i){this._element=e,this._startStyles=t,this._endStyles=i,this._state=0;let r=Am.initialStylesByElement.get(e);r||Am.initialStylesByElement.set(e,r={}),this._initialStyles=r}start(){this._state<1&&(this._startStyles&&hu(this._element,this._startStyles,this._initialStyles),this._state=1)}finish(){this.start(),this._state<2&&(hu(this._element,this._initialStyles),this._endStyles&&(hu(this._element,this._endStyles),this._endStyles=null),this._state=1)}destroy(){this.finish(),this._state<3&&(Am.initialStylesByElement.delete(this._element),this._startStyles&&(Qf(this._element,this._startStyles),this._endStyles=null),this._endStyles&&(Qf(this._element,this._endStyles),this._endStyles=null),hu(this._element,this._initialStyles),this._state=3)}}Am.initialStylesByElement=new WeakMap;const Nl=new Ht("AnimationModuleType");function Mb(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 xP(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?function(n,e=0){return function(n){return!isNaN(parseFloat(n))&&!isNaN(Number(n))}(n)?Number(n):e}(t):this.defaultTabIndex}}}let ep;try{ep="undefined"!=typeof Intl}catch(n){ep=!1}function hd(n,e,t,i){return Y(t)&&(i=t,t=void 0),i?hd(n,e,t).pipe(me(r=>P(r)?i(...r):i(r))):new I(r=>{x$(n,e,function(o){r.next(arguments.length>1?Array.prototype.slice.call(arguments):o)},r,t)})}function x$(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;o0?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 zCe=1;const HCe=Promise.resolve(),xC={};function C$(n){return n in xC&&(delete xC[n],!0)}const A$={setImmediate(n){const e=zCe++;return xC[e]=!0,HCe.then(()=>C$(e)&&n()),e},clearImmediate(n){C$(n)}};new class extends uc{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=A$.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&&(A$.clearImmediate(t),e.scheduled=void 0)}});function Tm(n){return!!n&&(n instanceof I||"function"==typeof n.lift&&"function"==typeof n.subscribe)}class YCe{constructor(e){this.durationSelector=e}call(e,t){return t.subscribe(new KCe(e,this.durationSelector))}}class KCe extends ve{constructor(e,t){super(e),this.durationSelector=t,this.hasValue=!1}_next(e){if(this.value=e,this.hasValue=!0,!this.throttled){let t;try{const{durationSelector:r}=this;t=r(e)}catch(r){return this.destination.error(r)}const i=N(t,new _t(this));!i||i.closed?this.clearThrottle():this.add(this.throttled=i)}}clearThrottle(){const{value:e,hasValue:t,throttled:i}=this;i&&(this.remove(i),this.throttled=void 0,i.unsubscribe()),t&&(this.value=void 0,this.hasValue=!1,this.destination.next(e))}notifyNext(){this.clearThrottle()}notifyComplete(){this.clearThrottle()}}function T$(n){return!P(n)&&n-parseFloat(n)+1>=0}function QCe(n){const{index:e,period:t,subscriber:i}=n;if(i.next(e),!i.closed){if(-1===t)return i.complete();n.index=e+1,this.schedule(n,t)}}function CC(n,e=Kx){return function(n){return function(t){return t.lift(new YCe(n))}}(()=>function(n=0,e,t){let i=-1;return T$(e)?i=Number(e)<1?1:Number(e):Ce(e)&&(t=e),Ce(t)||(t=Kx),new I(r=>{const s=T$(n)?n:+n-t.now();return t.schedule(QCe,s,{index:0,period:i,subscriber:r})})}(n,e))}let D$=(()=>{class n{constructor(){this._listeners=[]}notify(t,i){for(let r of this._listeners)r(t,i)}listen(t){return this._listeners.push(t),()=>{this._listeners=this._listeners.filter(i=>t!==i)}}ngOnDestroy(){this._listeners=[]}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({factory:function(){return new n},token:n,providedIn:"root"}),n})(),Mm=(()=>{class n{constructor(t,i,r){this._ngZone=t,this._platform=i,this._scrolled=new se,this._globalSubscription=null,this._scrolledCount=0,this.scrollContainers=new Map,this._document=r}register(t){this.scrollContainers.has(t)||this.scrollContainers.set(t,t.elementScrolled().subscribe(()=>this._scrolled.next(t)))}deregister(t){const i=this.scrollContainers.get(t);i&&(i.unsubscribe(),this.scrollContainers.delete(t))}scrolled(t=20){return this._platform.isBrowser?new I(i=>{this._globalSubscription||this._addGlobalListener();const r=t>0?this._scrolled.pipe(CC(t)).subscribe(i):this._scrolled.subscribe(i);return this._scrolledCount++,()=>{r.unsubscribe(),this._scrolledCount--,this._scrolledCount||this._removeGlobalListener()}}):fn()}ngOnDestroy(){this._removeGlobalListener(),this.scrollContainers.forEach((t,i)=>this.deregister(i)),this._scrolled.complete()}ancestorScrolled(t,i){const r=this.getAncestorScrollContainers(t);return this.scrolled(i).pipe(Qi(s=>!s||r.indexOf(s)>-1))}getAncestorScrollContainers(t){const i=[];return this.scrollContainers.forEach((r,s)=>{this._scrollableContainsElement(s,t)&&i.push(s)}),i}_getWindow(){return this._document.defaultView||window}_scrollableContainsElement(t,i){let r=ad(i),s=t.getElementRef().nativeElement;do{if(r==s)return!0}while(r=r.parentElement);return!1}_addGlobalListener(){this._globalSubscription=this._ngZone.runOutsideAngular(()=>hd(this._getWindow().document,"scroll").subscribe(()=>this._scrolled.next()))}_removeGlobalListener(){this._globalSubscription&&(this._globalSubscription.unsubscribe(),this._globalSubscription=null)}}return n.\u0275fac=function(t){return new(t||n)(Oe(gn),Oe(Zi),Oe(pn,8))},n.\u0275prov=We({factory:function(){return new n(Oe(gn),Oe(Zi),Oe(pn,8))},token:n,providedIn:"root"}),n})(),Dm=(()=>{class n{constructor(t,i,r){this._platform=t,this._change=new se,this._changeListener=s=>{this._change.next(s)},this._document=r,i.runOutsideAngular(()=>{if(t.isBrowser){const s=this._getWindow();s.addEventListener("resize",this._changeListener),s.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:i,height:r}=this.getViewportSize();return{top:t.top,left:t.left,bottom:t.top+r,right:t.left+i,height:r,width:i}}getViewportScrollPosition(){if(!this._platform.isBrowser)return{top:0,left:0};const t=this._document,i=this._getWindow(),r=t.documentElement,s=r.getBoundingClientRect();return{top:-s.top||t.body.scrollTop||i.scrollY||r.scrollTop||0,left:-s.left||t.body.scrollLeft||i.scrollX||r.scrollLeft||0}}change(t=20){return t>0?this._change.pipe(CC(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 n.\u0275fac=function(t){return new(t||n)(Oe(Zi),Oe(gn),Oe(pn,8))},n.\u0275prov=We({factory:function(){return new n(Oe(Zi),Oe(gn),Oe(pn,8))},token:n,providedIn:"root"}),n})();class DP{attach(e){return this._attachedHost=e,e.attach(this)}detach(){let e=this._attachedHost;null!=e&&(this._attachedHost=null,e.detach())}get isAttached(){return null!=this._attachedHost}setAttachedHost(e){this._attachedHost=e}}class TC extends DP{constructor(e,t,i,r){super(),this.component=e,this.viewContainerRef=t,this.injector=i,this.componentFactoryResolver=r}}class Im extends DP{constructor(e,t,i){super(),this.templateRef=e,this.viewContainerRef=t,this.context=i}get origin(){return this.templateRef.elementRef}attach(e,t=this.context){return this.context=t,super.attach(e)}detach(){return this.context=void 0,super.detach()}}class p1e extends DP{constructor(e){super(),this.element=e instanceof En?e.nativeElement:e}}class MC{constructor(){this._isDisposed=!1,this.attachDomPortal=null}hasAttached(){return!!this._attachedPortal}attach(e){return e instanceof TC?(this._attachedPortal=e,this.attachComponentPortal(e)):e instanceof Im?(this._attachedPortal=e,this.attachTemplatePortal(e)):this.attachDomPortal&&e instanceof p1e?(this._attachedPortal=e,this.attachDomPortal(e)):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(e){this._disposeFn=e}_invokeDisposeFn(){this._disposeFn&&(this._disposeFn(),this._disposeFn=null)}}class g1e extends MC{constructor(e,t,i,r,s){super(),this.outletElement=e,this._componentFactoryResolver=t,this._appRef=i,this._defaultInjector=r,this.attachDomPortal=o=>{const a=o.element,l=this._document.createComment("dom-portal");a.parentNode.insertBefore(l,a),this.outletElement.appendChild(a),this._attachedPortal=o,super.setDisposeFn(()=>{l.parentNode&&l.parentNode.replaceChild(a,l)})},this._document=s}attachComponentPortal(e){const i=(e.componentFactoryResolver||this._componentFactoryResolver).resolveComponentFactory(e.component);let r;return e.viewContainerRef?(r=e.viewContainerRef.createComponent(i,e.viewContainerRef.length,e.injector||e.viewContainerRef.injector),this.setDisposeFn(()=>r.destroy())):(r=i.create(e.injector||this._defaultInjector),this._appRef.attachView(r.hostView),this.setDisposeFn(()=>{this._appRef.detachView(r.hostView),r.destroy()})),this.outletElement.appendChild(this._getComponentRootNode(r)),this._attachedPortal=e,r}attachTemplatePortal(e){let t=e.viewContainerRef,i=t.createEmbeddedView(e.templateRef,e.context);return i.rootNodes.forEach(r=>this.outletElement.appendChild(r)),i.detectChanges(),this.setDisposeFn(()=>{let r=t.indexOf(i);-1!==r&&t.remove(r)}),this._attachedPortal=e,i}dispose(){super.dispose(),null!=this.outletElement.parentNode&&this.outletElement.parentNode.removeChild(this.outletElement)}_getComponentRootNode(e){return e.hostView.rootNodes[0]}}let tp=(()=>{class n extends MC{constructor(t,i,r){super(),this._componentFactoryResolver=t,this._viewContainerRef=i,this._isInitialized=!1,this.attached=new sn,this.attachDomPortal=s=>{const o=s.element,a=this._document.createComment("dom-portal");s.setAttachedHost(this),o.parentNode.insertBefore(a,o),this._getRootNode().appendChild(o),this._attachedPortal=s,super.setDisposeFn(()=>{a.parentNode&&a.parentNode.replaceChild(o,a)})},this._document=r}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 i=null!=t.viewContainerRef?t.viewContainerRef:this._viewContainerRef,s=(t.componentFactoryResolver||this._componentFactoryResolver).resolveComponentFactory(t.component),o=i.createComponent(s,i.length,t.injector||i.injector);return i!==this._viewContainerRef&&this._getRootNode().appendChild(o.hostView.rootNodes[0]),super.setDisposeFn(()=>o.destroy()),this._attachedPortal=t,this._attachedRef=o,this.attached.emit(o),o}attachTemplatePortal(t){t.setAttachedHost(this);const i=this._viewContainerRef.createEmbeddedView(t.templateRef,t.context);return super.setDisposeFn(()=>this._viewContainerRef.clear()),this._attachedPortal=t,this._attachedRef=i,this.attached.emit(i),i}_getRootNode(){const t=this._viewContainerRef.element.nativeElement;return t.nodeType===t.ELEMENT_NODE?t:t.parentNode}}return n.\u0275fac=function(t){return new(t||n)(xe(wl),xe(Ns),xe(pn))},n.\u0275dir=Rt({type:n,selectors:[["","cdkPortalOutlet",""]],inputs:{portal:["cdkPortalOutlet","portal"]},outputs:{attached:"attached"},exportAs:["cdkPortalOutlet"],features:[An]}),n})();const k$=LH();class b1e{constructor(e,t){this._viewportRuler=e,this._previousHTMLStyles={top:"",left:""},this._isEnabled=!1,this._document=t}attach(){}enable(){if(this._canBeEnabled()){const e=this._document.documentElement;this._previousScrollPosition=this._viewportRuler.getViewportScrollPosition(),this._previousHTMLStyles.left=e.style.left||"",this._previousHTMLStyles.top=e.style.top||"",e.style.left=vs(-this._previousScrollPosition.left),e.style.top=vs(-this._previousScrollPosition.top),e.classList.add("cdk-global-scrollblock"),this._isEnabled=!0}}disable(){if(this._isEnabled){const e=this._document.documentElement,i=e.style,r=this._document.body.style,s=i.scrollBehavior||"",o=r.scrollBehavior||"";this._isEnabled=!1,i.left=this._previousHTMLStyles.left,i.top=this._previousHTMLStyles.top,e.classList.remove("cdk-global-scrollblock"),k$&&(i.scrollBehavior=r.scrollBehavior="auto"),window.scroll(this._previousScrollPosition.left,this._previousScrollPosition.top),k$&&(i.scrollBehavior=s,r.scrollBehavior=o)}}_canBeEnabled(){if(this._document.documentElement.classList.contains("cdk-global-scrollblock")||this._isEnabled)return!1;const t=this._document.body,i=this._viewportRuler.getViewportSize();return t.scrollHeight>i.height||t.scrollWidth>i.width}}class v1e{constructor(e,t,i,r){this._scrollDispatcher=e,this._ngZone=t,this._viewportRuler=i,this._config=r,this._scrollSubscription=null,this._detach=()=>{this.disable(),this._overlayRef.hasAttached()&&this._ngZone.run(()=>this._overlayRef.detach())}}attach(e){this._overlayRef=e}enable(){if(this._scrollSubscription)return;const e=this._scrollDispatcher.scrolled(0);this._config&&this._config.threshold&&this._config.threshold>1?(this._initialScrollPosition=this._viewportRuler.getViewportScrollPosition().top,this._scrollSubscription=e.subscribe(()=>{const t=this._viewportRuler.getViewportScrollPosition().top;Math.abs(t-this._initialScrollPosition)>this._config.threshold?this._detach():this._overlayRef.updatePosition()})):this._scrollSubscription=e.subscribe(this._detach)}disable(){this._scrollSubscription&&(this._scrollSubscription.unsubscribe(),this._scrollSubscription=null)}detach(){this.disable(),this._overlayRef=null}}class L${enable(){}disable(){}attach(){}}function IP(n,e){return e.some(t=>n.bottomt.bottom||n.rightt.right)}function B$(n,e){return e.some(t=>n.topt.bottom||n.leftt.right)}class w1e{constructor(e,t,i,r){this._scrollDispatcher=e,this._viewportRuler=t,this._ngZone=i,this._config=r,this._scrollSubscription=null}attach(e){this._overlayRef=e}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:i,height:r}=this._viewportRuler.getViewportSize();IP(t,[{width:i,height:r,bottom:r,right:i,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 E1e=(()=>{class n{constructor(t,i,r,s){this._scrollDispatcher=t,this._viewportRuler=i,this._ngZone=r,this.noop=()=>new L$,this.close=o=>new v1e(this._scrollDispatcher,this._ngZone,this._viewportRuler,o),this.block=()=>new b1e(this._viewportRuler,this._document),this.reposition=o=>new w1e(this._scrollDispatcher,this._viewportRuler,this._ngZone,o),this._document=s}}return n.\u0275fac=function(t){return new(t||n)(Oe(Mm),Oe(Dm),Oe(gn),Oe(pn))},n.\u0275prov=We({factory:function(){return new n(Oe(Mm),Oe(Dm),Oe(gn),Oe(pn))},token:n,providedIn:"root"}),n})();class IC{constructor(e){if(this.scrollStrategy=new L$,this.panelClass="",this.hasBackdrop=!1,this.backdropClass="cdk-overlay-dark-backdrop",this.disposeOnNavigation=!1,e){const t=Object.keys(e);for(const i of t)void 0!==e[i]&&(this[i]=e[i])}}}class S1e{constructor(e,t,i,r,s){this.offsetX=i,this.offsetY=r,this.panelClass=s,this.originX=e.originX,this.originY=e.originY,this.overlayX=t.overlayX,this.overlayY=t.overlayY}}class x1e{constructor(e,t){this.connectionPair=e,this.scrollableViewProperties=t}}let j$=(()=>{class n{constructor(t){this._attachedOverlays=[],this._document=t}ngOnDestroy(){this.detach()}add(t){this.remove(t),this._attachedOverlays.push(t)}remove(t){const i=this._attachedOverlays.indexOf(t);i>-1&&this._attachedOverlays.splice(i,1),0===this._attachedOverlays.length&&this.detach()}}return n.\u0275fac=function(t){return new(t||n)(Oe(pn))},n.\u0275prov=We({factory:function(){return new n(Oe(pn))},token:n,providedIn:"root"}),n})(),C1e=(()=>{class n extends j${constructor(t){super(t),this._keydownListener=i=>{const r=this._attachedOverlays;for(let s=r.length-1;s>-1;s--)if(r[s]._keydownEvents.observers.length>0){r[s]._keydownEvents.next(i);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 n.\u0275fac=function(t){return new(t||n)(Oe(pn))},n.\u0275prov=We({factory:function(){return new n(Oe(pn))},token:n,providedIn:"root"}),n})(),A1e=(()=>{class n extends j${constructor(t,i){super(t),this._platform=i,this._cursorStyleIsSet=!1,this._clickListener=r=>{const s=Yf(r),o=this._attachedOverlays.slice();for(let a=o.length-1;a>-1;a--){const l=o[a];if(!(l._outsidePointerEvents.observers.length<1)&&l.hasAttached()){if(l.overlayElement.contains(s))break;l._outsidePointerEvents.next(r)}}}}add(t){if(super.add(t),!this._isAttached){const i=this._document.body;i.addEventListener("click",this._clickListener,!0),i.addEventListener("auxclick",this._clickListener,!0),i.addEventListener("contextmenu",this._clickListener,!0),this._platform.IOS&&!this._cursorStyleIsSet&&(this._cursorOriginalValue=i.style.cursor,i.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 n.\u0275fac=function(t){return new(t||n)(Oe(pn),Oe(Zi))},n.\u0275prov=We({factory:function(){return new n(Oe(pn),Oe(Zi))},token:n,providedIn:"root"}),n})();const Sh="undefined"!=typeof window?window:{},V$=void 0!==Sh.__karma__&&!!Sh.__karma__||void 0!==Sh.jasmine&&!!Sh.jasmine||void 0!==Sh.jest&&!!Sh.jest||void 0!==Sh.Mocha&&!!Sh.Mocha;let Ob=(()=>{class n{constructor(t,i){this._platform=i,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||V$){const r=this._document.querySelectorAll(`.${t}[platform="server"], .${t}[platform="test"]`);for(let s=0;sthis._backdropClick.next(u),this._keydownEvents=new se,this._outsidePointerEvents=new se,r.scrollStrategy&&(this._scrollStrategy=r.scrollStrategy,this._scrollStrategy.attach(this)),this._positionStrategy=r.positionStrategy}get overlayElement(){return this._pane}get backdropElement(){return this._backdropElement}get hostElement(){return this._host}attach(e){let t=this._portalOutlet.attach(e);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(Wi(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),t}detach(){if(!this.hasAttached())return;this.detachBackdrop(),this._togglePointerEvents(!1),this._positionStrategy&&this._positionStrategy.detach&&this._positionStrategy.detach(),this._scrollStrategy&&this._scrollStrategy.disable();const e=this._portalOutlet.detach();return this._detachments.next(),this._keyboardDispatcher.remove(this),this._detachContentWhenStable(),this._locationChanges.unsubscribe(),this._outsideClickDispatcher.remove(this),e}dispose(){const e=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,e&&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(e){e!==this._positionStrategy&&(this._positionStrategy&&this._positionStrategy.dispose(),this._positionStrategy=e,this.hasAttached()&&(e.attach(this),this.updatePosition()))}updateSize(e){this._config=Object.assign(Object.assign({},this._config),e),this._updateElementSize()}setDirection(e){this._config=Object.assign(Object.assign({},this._config),{direction:e}),this._updateElementDirection()}addPanelClass(e){this._pane&&this._toggleClasses(this._pane,e,!0)}removePanelClass(e){this._pane&&this._toggleClasses(this._pane,e,!1)}getDirection(){const e=this._config.direction;return e?"string"==typeof e?e:e.value:"ltr"}updateScrollStrategy(e){e!==this._scrollStrategy&&(this._disposeScrollStrategy(),this._scrollStrategy=e,this.hasAttached()&&(e.attach(this),e.enable()))}_updateElementDirection(){this._host.setAttribute("dir",this.getDirection())}_updateElementSize(){if(!this._pane)return;const e=this._pane.style;e.width=vs(this._config.width),e.height=vs(this._config.height),e.minWidth=vs(this._config.minWidth),e.minHeight=vs(this._config.minHeight),e.maxWidth=vs(this._config.maxWidth),e.maxHeight=vs(this._config.maxHeight)}_togglePointerEvents(e){this._pane.style.pointerEvents=e?"":"none"}_attachBackdrop(){const e="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(e)})}):this._backdropElement.classList.add(e)}_updateStackingOrder(){this._host.nextSibling&&this._host.parentNode.appendChild(this._host)}detachBackdrop(){let e=this._backdropElement;if(!e)return;let t,i=()=>{e&&(e.removeEventListener("click",this._backdropClickHandler),e.removeEventListener("transitionend",i),e.parentNode&&e.parentNode.removeChild(e)),this._backdropElement==e&&(this._backdropElement=null),this._config.backdropClass&&this._toggleClasses(e,this._config.backdropClass,!1),clearTimeout(t)};e.classList.remove("cdk-overlay-backdrop-showing"),this._ngZone.runOutsideAngular(()=>{e.addEventListener("transitionend",i)}),e.style.pointerEvents="none",t=this._ngZone.runOutsideAngular(()=>setTimeout(i,500))}_toggleClasses(e,t,i){const r=e.classList;Xx(t).forEach(s=>{s&&(i?r.add(s):r.remove(s))})}_detachContentWhenStable(){this._ngZone.runOutsideAngular(()=>{const e=this._ngZone.onStable.pipe(_r(kn(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)),e.unsubscribe())})})}_disposeScrollStrategy(){const e=this._scrollStrategy;e&&(e.disable(),e.detach&&e.detach())}}const U$="cdk-overlay-connected-position-bounding-box",M1e=/([A-Za-z%]+)$/;class z${constructor(e,t,i,r,s){this._viewportRuler=t,this._document=i,this._platform=r,this._overlayContainer=s,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 se,this._resizeSubscription=x.EMPTY,this._offsetX=0,this._offsetY=0,this._appliedPanelClasses=[],this.positionChanges=this._positionChanges,this.setOrigin(e)}get positions(){return this._preferredPositions}attach(e){this._validatePositions(),e.hostElement.classList.add(U$),this._overlayRef=e,this._boundingBox=e.hostElement,this._pane=e.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 e=this._originRect,t=this._overlayRect,i=this._viewportRect,r=[];let s;for(let o of this._preferredPositions){let a=this._getOriginPoint(e,o),l=this._getOverlayPoint(a,t,o),c=this._getOverlayFit(l,t,i,o);if(c.isCompletelyWithinViewport)return this._isPushed=!1,void this._applyPosition(o,a);this._canFitWithFlexibleDimensions(c,l,i)?r.push({position:o,origin:a,overlayRect:t,boundingBoxRect:this._calculateBoundingBoxRect(a,o)}):(!s||s.overlayFit.visibleAreaa&&(a=c,o=l)}return this._isPushed=!1,void this._applyPosition(o.position,o.origin)}if(this._canPush)return this._isPushed=!0,void this._applyPosition(s.position,s.originPoint);this._applyPosition(s.position,s.originPoint)}detach(){this._clearPanelClasses(),this._lastPosition=null,this._previousPushAmount=null,this._resizeSubscription.unsubscribe()}dispose(){this._isDisposed||(this._boundingBox&&np(this._boundingBox.style,{top:"",left:"",right:"",bottom:"",height:"",width:"",alignItems:"",justifyContent:""}),this._pane&&this._resetOverlayElementStyles(),this._overlayRef&&this._overlayRef.hostElement.classList.remove(U$),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 e=this._lastPosition||this._preferredPositions[0],t=this._getOriginPoint(this._originRect,e);this._applyPosition(e,t)}}withScrollableContainers(e){return this._scrollables=e,this}withPositions(e){return this._preferredPositions=e,-1===e.indexOf(this._lastPosition)&&(this._lastPosition=null),this._validatePositions(),this}withViewportMargin(e){return this._viewportMargin=e,this}withFlexibleDimensions(e=!0){return this._hasFlexibleDimensions=e,this}withGrowAfterOpen(e=!0){return this._growAfterOpen=e,this}withPush(e=!0){return this._canPush=e,this}withLockedPosition(e=!0){return this._positionLocked=e,this}setOrigin(e){return this._origin=e,this}withDefaultOffsetX(e){return this._offsetX=e,this}withDefaultOffsetY(e){return this._offsetY=e,this}withTransformOriginOn(e){return this._transformOriginSelector=e,this}_getOriginPoint(e,t){let i,r;if("center"==t.originX)i=e.left+e.width/2;else{const s=this._isRtl()?e.right:e.left,o=this._isRtl()?e.left:e.right;i="start"==t.originX?s:o}return r="center"==t.originY?e.top+e.height/2:"top"==t.originY?e.top:e.bottom,{x:i,y:r}}_getOverlayPoint(e,t,i){let r,s;return r="center"==i.overlayX?-t.width/2:"start"===i.overlayX?this._isRtl()?-t.width:0:this._isRtl()?0:-t.width,s="center"==i.overlayY?-t.height/2:"top"==i.overlayY?0:-t.height,{x:e.x+r,y:e.y+s}}_getOverlayFit(e,t,i,r){const s=G$(t);let{x:o,y:a}=e,l=this._getOffset(r,"x"),c=this._getOffset(r,"y");l&&(o+=l),c&&(a+=c);let p=0-a,g=a+s.height-i.height,m=this._subtractOverflows(s.width,0-o,o+s.width-i.width),w=this._subtractOverflows(s.height,p,g),C=m*w;return{visibleArea:C,isCompletelyWithinViewport:s.width*s.height===C,fitsInViewportVertically:w===s.height,fitsInViewportHorizontally:m==s.width}}_canFitWithFlexibleDimensions(e,t,i){if(this._hasFlexibleDimensions){const r=i.bottom-t.y,s=i.right-t.x,o=H$(this._overlayRef.getConfig().minHeight),a=H$(this._overlayRef.getConfig().minWidth),c=e.fitsInViewportHorizontally||null!=a&&a<=s;return(e.fitsInViewportVertically||null!=o&&o<=r)&&c}return!1}_pushOverlayOnScreen(e,t,i){if(this._previousPushAmount&&this._positionLocked)return{x:e.x+this._previousPushAmount.x,y:e.y+this._previousPushAmount.y};const r=G$(t),s=this._viewportRect,o=Math.max(e.x+r.width-s.width,0),a=Math.max(e.y+r.height-s.height,0),l=Math.max(s.top-i.top-e.y,0),c=Math.max(s.left-i.left-e.x,0);let u=0,h=0;return u=r.width<=s.width?c||-o:e.xm&&!this._isInitialRender&&!this._growAfterOpen&&(o=e.y-m/2)}if("end"===t.overlayX&&!r||"start"===t.overlayX&&r)p=i.width-e.x+this._viewportMargin,u=e.x-this._viewportMargin;else if("start"===t.overlayX&&!r||"end"===t.overlayX&&r)h=e.x,u=i.right-e.x;else{const g=Math.min(i.right-e.x+i.left,e.x),m=this._lastBoundingBoxSize.width;u=2*g,h=e.x-g,u>m&&!this._isInitialRender&&!this._growAfterOpen&&(h=e.x-m/2)}return{top:o,left:h,bottom:a,right:p,width:u,height:s}}_setBoundingBoxStyles(e,t){const i=this._calculateBoundingBoxRect(e,t);!this._isInitialRender&&!this._growAfterOpen&&(i.height=Math.min(i.height,this._lastBoundingBoxSize.height),i.width=Math.min(i.width,this._lastBoundingBoxSize.width));const r={};if(this._hasExactPosition())r.top=r.left="0",r.bottom=r.right=r.maxHeight=r.maxWidth="",r.width=r.height="100%";else{const s=this._overlayRef.getConfig().maxHeight,o=this._overlayRef.getConfig().maxWidth;r.height=vs(i.height),r.top=vs(i.top),r.bottom=vs(i.bottom),r.width=vs(i.width),r.left=vs(i.left),r.right=vs(i.right),r.alignItems="center"===t.overlayX?"center":"end"===t.overlayX?"flex-end":"flex-start",r.justifyContent="center"===t.overlayY?"center":"bottom"===t.overlayY?"flex-end":"flex-start",s&&(r.maxHeight=vs(s)),o&&(r.maxWidth=vs(o))}this._lastBoundingBoxSize=i,np(this._boundingBox.style,r)}_resetBoundingBoxStyles(){np(this._boundingBox.style,{top:"0",left:"0",right:"0",bottom:"0",height:"",width:"",alignItems:"",justifyContent:""})}_resetOverlayElementStyles(){np(this._pane.style,{top:"",left:"",bottom:"",right:"",position:"",transform:""})}_setOverlayElementStyles(e,t){const i={},r=this._hasExactPosition(),s=this._hasFlexibleDimensions,o=this._overlayRef.getConfig();if(r){const u=this._viewportRuler.getViewportScrollPosition();np(i,this._getExactOverlayY(t,e,u)),np(i,this._getExactOverlayX(t,e,u))}else i.position="static";let a="",l=this._getOffset(t,"x"),c=this._getOffset(t,"y");l&&(a+=`translateX(${l}px) `),c&&(a+=`translateY(${c}px)`),i.transform=a.trim(),o.maxHeight&&(r?i.maxHeight=vs(o.maxHeight):s&&(i.maxHeight="")),o.maxWidth&&(r?i.maxWidth=vs(o.maxWidth):s&&(i.maxWidth="")),np(this._pane.style,i)}_getExactOverlayY(e,t,i){let r={top:"",bottom:""},s=this._getOverlayPoint(t,this._overlayRect,e);this._isPushed&&(s=this._pushOverlayOnScreen(s,this._overlayRect,i));let o=this._overlayContainer.getContainerElement().getBoundingClientRect().top;return s.y-=o,"bottom"===e.overlayY?r.bottom=this._document.documentElement.clientHeight-(s.y+this._overlayRect.height)+"px":r.top=vs(s.y),r}_getExactOverlayX(e,t,i){let o,r={left:"",right:""},s=this._getOverlayPoint(t,this._overlayRect,e);return this._isPushed&&(s=this._pushOverlayOnScreen(s,this._overlayRect,i)),o=this._isRtl()?"end"===e.overlayX?"left":"right":"end"===e.overlayX?"right":"left","right"===o?r.right=this._document.documentElement.clientWidth-(s.x+this._overlayRect.width)+"px":r.left=vs(s.x),r}_getScrollVisibility(){const e=this._getOriginRect(),t=this._pane.getBoundingClientRect(),i=this._scrollables.map(r=>r.getElementRef().nativeElement.getBoundingClientRect());return{isOriginClipped:B$(e,i),isOriginOutsideView:IP(e,i),isOverlayClipped:B$(t,i),isOverlayOutsideView:IP(t,i)}}_subtractOverflows(e,...t){return t.reduce((i,r)=>i-Math.max(r,0),e)}_getNarrowedViewportRect(){const e=this._document.documentElement.clientWidth,t=this._document.documentElement.clientHeight,i=this._viewportRuler.getViewportScrollPosition();return{top:i.top+this._viewportMargin,left:i.left+this._viewportMargin,right:i.left+e-this._viewportMargin,bottom:i.top+t-this._viewportMargin,width:e-2*this._viewportMargin,height:t-2*this._viewportMargin}}_isRtl(){return"rtl"===this._overlayRef.getDirection()}_hasExactPosition(){return!this._hasFlexibleDimensions||this._isPushed}_getOffset(e,t){return"x"===t?null==e.offsetX?this._offsetX:e.offsetX:null==e.offsetY?this._offsetY:e.offsetY}_validatePositions(){}_addPanelClasses(e){this._pane&&Xx(e).forEach(t=>{""!==t&&-1===this._appliedPanelClasses.indexOf(t)&&(this._appliedPanelClasses.push(t),this._pane.classList.add(t))})}_clearPanelClasses(){this._pane&&(this._appliedPanelClasses.forEach(e=>{this._pane.classList.remove(e)}),this._appliedPanelClasses=[])}_getOriginRect(){const e=this._origin;if(e instanceof En)return e.nativeElement.getBoundingClientRect();if(e instanceof Element)return e.getBoundingClientRect();const t=e.width||0,i=e.height||0;return{top:e.y,bottom:e.y+i,left:e.x,right:e.x+t,height:i,width:t}}}function np(n,e){for(let t in e)e.hasOwnProperty(t)&&(n[t]=e[t]);return n}function H$(n){if("number"!=typeof n&&null!=n){const[e,t]=n.split(M1e);return t&&"px"!==t?null:parseFloat(e)}return n||null}function G$(n){return{top:Math.floor(n.top),right:Math.floor(n.right),bottom:Math.floor(n.bottom),left:Math.floor(n.left),width:Math.floor(n.width),height:Math.floor(n.height)}}class D1e{constructor(e,t,i,r,s,o,a){this._preferredPositions=[],this._positionStrategy=new z$(i,r,s,o,a).withFlexibleDimensions(!1).withPush(!1).withViewportMargin(0),this.withFallbackPosition(e,t),this.onPositionChange=this._positionStrategy.positionChanges}get positions(){return this._preferredPositions}attach(e){this._overlayRef=e,this._positionStrategy.attach(e),this._direction&&(e.setDirection(this._direction),this._direction=null)}dispose(){this._positionStrategy.dispose()}detach(){this._positionStrategy.detach()}apply(){this._positionStrategy.apply()}recalculateLastPosition(){this._positionStrategy.reapplyLastPosition()}withScrollableContainers(e){this._positionStrategy.withScrollableContainers(e)}withFallbackPosition(e,t,i,r){const s=new S1e(e,t,i,r);return this._preferredPositions.push(s),this._positionStrategy.withPositions(this._preferredPositions),this}withDirection(e){return this._overlayRef?this._overlayRef.setDirection(e):this._direction=e,this}withOffsetX(e){return this._positionStrategy.withDefaultOffsetX(e),this}withOffsetY(e){return this._positionStrategy.withDefaultOffsetY(e),this}withLockedPosition(e){return this._positionStrategy.withLockedPosition(e),this}withPositions(e){return this._preferredPositions=e.slice(),this._positionStrategy.withPositions(this._preferredPositions),this}setOrigin(e){return this._positionStrategy.setOrigin(e),this}}const W$="cdk-global-overlay-wrapper";class I1e{constructor(){this._cssPosition="static",this._topOffset="",this._bottomOffset="",this._leftOffset="",this._rightOffset="",this._alignItems="",this._justifyContent="",this._width="",this._height=""}attach(e){const t=e.getConfig();this._overlayRef=e,this._width&&!t.width&&e.updateSize({width:this._width}),this._height&&!t.height&&e.updateSize({height:this._height}),e.hostElement.classList.add(W$),this._isDisposed=!1}top(e=""){return this._bottomOffset="",this._topOffset=e,this._alignItems="flex-start",this}left(e=""){return this._rightOffset="",this._leftOffset=e,this._justifyContent="flex-start",this}bottom(e=""){return this._topOffset="",this._bottomOffset=e,this._alignItems="flex-end",this}right(e=""){return this._leftOffset="",this._rightOffset=e,this._justifyContent="flex-end",this}width(e=""){return this._overlayRef?this._overlayRef.updateSize({width:e}):this._width=e,this}height(e=""){return this._overlayRef?this._overlayRef.updateSize({height:e}):this._height=e,this}centerHorizontally(e=""){return this.left(e),this._justifyContent="center",this}centerVertically(e=""){return this.top(e),this._alignItems="center",this}apply(){if(!this._overlayRef||!this._overlayRef.hasAttached())return;const e=this._overlayRef.overlayElement.style,t=this._overlayRef.hostElement.style,i=this._overlayRef.getConfig(),{width:r,height:s,maxWidth:o,maxHeight:a}=i,l=!("100%"!==r&&"100vw"!==r||o&&"100%"!==o&&"100vw"!==o),c=!("100%"!==s&&"100vh"!==s||a&&"100%"!==a&&"100vh"!==a);e.position=this._cssPosition,e.marginLeft=l?"0":this._leftOffset,e.marginTop=c?"0":this._topOffset,e.marginBottom=this._bottomOffset,e.marginRight=this._rightOffset,l?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=c?"flex-start":this._alignItems}dispose(){if(this._isDisposed||!this._overlayRef)return;const e=this._overlayRef.overlayElement.style,t=this._overlayRef.hostElement,i=t.style;t.classList.remove(W$),i.justifyContent=i.alignItems=e.marginTop=e.marginBottom=e.marginLeft=e.marginRight=e.position="",this._overlayRef=null,this._isDisposed=!0}}let O1e=(()=>{class n{constructor(t,i,r,s){this._viewportRuler=t,this._document=i,this._platform=r,this._overlayContainer=s}global(){return new I1e}connectedTo(t,i,r){return new D1e(i,r,t,this._viewportRuler,this._document,this._platform,this._overlayContainer)}flexibleConnectedTo(t){return new z$(t,this._viewportRuler,this._document,this._platform,this._overlayContainer)}}return n.\u0275fac=function(t){return new(t||n)(Oe(Dm),Oe(pn),Oe(Zi),Oe(Ob))},n.\u0275prov=We({factory:function(){return new n(Oe(Dm),Oe(pn),Oe(Zi),Oe(Ob))},token:n,providedIn:"root"}),n})(),R1e=0,wc=(()=>{class n{constructor(t,i,r,s,o,a,l,c,u,h,p){this.scrollStrategies=t,this._overlayContainer=i,this._componentFactoryResolver=r,this._positionBuilder=s,this._keyboardDispatcher=o,this._injector=a,this._ngZone=l,this._document=c,this._directionality=u,this._location=h,this._outsideClickDispatcher=p}create(t){const i=this._createHostElement(),r=this._createPaneElement(i),s=this._createPortalOutlet(r),o=new IC(t);return o.direction=o.direction||this._directionality.value,new T1e(s,i,r,o,this._ngZone,this._keyboardDispatcher,this._document,this._location,this._outsideClickDispatcher)}position(){return this._positionBuilder}_createPaneElement(t){const i=this._document.createElement("div");return i.id="cdk-overlay-"+R1e++,i.classList.add("cdk-overlay-pane"),t.appendChild(i),i}_createHostElement(){const t=this._document.createElement("div");return this._overlayContainer.getContainerElement().appendChild(t),t}_createPortalOutlet(t){return this._appRef||(this._appRef=this._injector.get(ih)),new g1e(t,this._componentFactoryResolver,this._appRef,this._injector,this._document)}}return n.\u0275fac=function(t){return new(t||n)(Oe(E1e),Oe(Ob),Oe(wl),Oe(O1e),Oe(C1e),Oe(Wn),Oe(gn),Oe(pn),Oe(Il),Oe(Pg),Oe(A1e))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();function a7(...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{this.headers=new Map,e.split("\n").forEach(t=>{const i=t.indexOf(":");if(i>0){const r=t.slice(0,i),s=r.toLowerCase(),o=t.slice(i+1).trim();this.maybeSetNormalizedName(r,s),this.headers.has(s)?this.headers.get(s).push(o):this.headers.set(s,[o])}})}:()=>{this.headers=new Map,Object.keys(e).forEach(t=>{let i=e[t];const r=t.toLowerCase();"string"==typeof i&&(i=[i]),i.length>0&&(this.headers.set(r,i),this.maybeSetNormalizedName(t,r))})}:this.headers=new Map}has(e){return this.init(),this.headers.has(e.toLowerCase())}get(e){this.init();const t=this.headers.get(e.toLowerCase());return t&&t.length>0?t[0]:null}keys(){return this.init(),Array.from(this.normalizedNames.values())}getAll(e){return this.init(),this.headers.get(e.toLowerCase())||null}append(e,t){return this.clone({name:e,value:t,op:"a"})}set(e,t){return this.clone({name:e,value:t,op:"s"})}delete(e,t){return this.clone({name:e,value:t,op:"d"})}maybeSetNormalizedName(e,t){this.normalizedNames.has(t)||this.normalizedNames.set(t,e)}init(){this.lazyInit&&(this.lazyInit instanceof fd?this.copyFrom(this.lazyInit):this.lazyInit(),this.lazyInit=null,this.lazyUpdate&&(this.lazyUpdate.forEach(e=>this.applyUpdate(e)),this.lazyUpdate=null))}copyFrom(e){e.init(),Array.from(e.headers.keys()).forEach(t=>{this.headers.set(t,e.headers.get(t)),this.normalizedNames.set(t,e.normalizedNames.get(t))})}clone(e){const t=new fd;return t.lazyInit=this.lazyInit&&this.lazyInit instanceof fd?this.lazyInit:this,t.lazyUpdate=(this.lazyUpdate||[]).concat([e]),t}applyUpdate(e){const t=e.name.toLowerCase();switch(e.op){case"a":case"s":let i=e.value;if("string"==typeof i&&(i=[i]),0===i.length)return;this.maybeSetNormalizedName(e.name,t);const r=("a"===e.op?this.headers.get(t):void 0)||[];r.push(...i),this.headers.set(t,r);break;case"d":const s=e.value;if(s){let o=this.headers.get(t);if(!o)return;o=o.filter(a=>-1===s.indexOf(a)),0===o.length?(this.headers.delete(t),this.normalizedNames.delete(t)):this.headers.set(t,o)}else this.headers.delete(t),this.normalizedNames.delete(t)}}forEach(e){this.init(),Array.from(this.normalizedNames.keys()).forEach(t=>e(this.normalizedNames.get(t),this.headers.get(t)))}}class iTe{encodeKey(e){return w7(e)}encodeValue(e){return w7(e)}decodeKey(e){return decodeURIComponent(e)}decodeValue(e){return decodeURIComponent(e)}}const sTe=/%(\d[a-f0-9])/gi,oTe={40:"@","3A":":",24:"$","2C":",","3B":";","2B":"+","3D":"=","3F":"?","2F":"/"};function w7(n){return encodeURIComponent(n).replace(sTe,(e,t)=>{var i;return null!==(i=oTe[t])&&void 0!==i?i:e})}function E7(n){return`${n}`}class xh{constructor(e={}){if(this.updates=null,this.cloneFrom=null,this.encoder=e.encoder||new iTe,e.fromString){if(e.fromObject)throw new Error("Cannot specify both fromString and fromObject.");this.map=function(n,e){const t=new Map;return n.length>0&&n.replace(/^\?/,"").split("&").forEach(r=>{const s=r.indexOf("="),[o,a]=-1==s?[e.decodeKey(r),""]:[e.decodeKey(r.slice(0,s)),e.decodeValue(r.slice(s+1))],l=t.get(o)||[];l.push(a),t.set(o,l)}),t}(e.fromString,this.encoder)}else e.fromObject?(this.map=new Map,Object.keys(e.fromObject).forEach(t=>{const i=e.fromObject[t];this.map.set(t,Array.isArray(i)?i:[i])})):this.map=null}has(e){return this.init(),this.map.has(e)}get(e){this.init();const t=this.map.get(e);return t?t[0]:null}getAll(e){return this.init(),this.map.get(e)||null}keys(){return this.init(),Array.from(this.map.keys())}append(e,t){return this.clone({param:e,value:t,op:"a"})}appendAll(e){const t=[];return Object.keys(e).forEach(i=>{const r=e[i];Array.isArray(r)?r.forEach(s=>{t.push({param:i,value:s,op:"a"})}):t.push({param:i,value:r,op:"a"})}),this.clone(t)}set(e,t){return this.clone({param:e,value:t,op:"s"})}delete(e,t){return this.clone({param:e,value:t,op:"d"})}toString(){return this.init(),this.keys().map(e=>{const t=this.encoder.encodeKey(e);return this.map.get(e).map(i=>t+"="+this.encoder.encodeValue(i)).join("&")}).filter(e=>""!==e).join("&")}clone(e){const t=new xh({encoder:this.encoder});return t.cloneFrom=this.cloneFrom||this,t.updates=(this.updates||[]).concat(e),t}init(){null===this.map&&(this.map=new Map),null!==this.cloneFrom&&(this.cloneFrom.init(),this.cloneFrom.keys().forEach(e=>this.map.set(e,this.cloneFrom.map.get(e))),this.updates.forEach(e=>{switch(e.op){case"a":case"s":const t=("a"===e.op?this.map.get(e.param):void 0)||[];t.push(E7(e.value)),this.map.set(e.param,t);break;case"d":if(void 0===e.value){this.map.delete(e.param);break}{let i=this.map.get(e.param)||[];const r=i.indexOf(E7(e.value));-1!==r&&i.splice(r,1),i.length>0?this.map.set(e.param,i):this.map.delete(e.param)}}}),this.cloneFrom=this.updates=null)}}class aTe{constructor(){this.map=new Map}set(e,t){return this.map.set(e,t),this}get(e){return this.map.has(e)||this.map.set(e,e.defaultValue()),this.map.get(e)}delete(e){return this.map.delete(e),this}keys(){return this.map.keys()}}function S7(n){return"undefined"!=typeof ArrayBuffer&&n instanceof ArrayBuffer}function x7(n){return"undefined"!=typeof Blob&&n instanceof Blob}function C7(n){return"undefined"!=typeof FormData&&n instanceof FormData}class Rb{constructor(e,t,i,r){let s;if(this.url=t,this.body=null,this.reportProgress=!1,this.withCredentials=!1,this.responseType="json",this.method=e.toUpperCase(),function(n){switch(n){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,s=r):s=i,s&&(this.reportProgress=!!s.reportProgress,this.withCredentials=!!s.withCredentials,s.responseType&&(this.responseType=s.responseType),s.headers&&(this.headers=s.headers),s.context&&(this.context=s.context),s.params&&(this.params=s.params)),this.headers||(this.headers=new fd),this.context||(this.context=new aTe),this.params){const o=this.params.toString();if(0===o.length)this.urlWithParams=t;else{const a=t.indexOf("?");this.urlWithParams=t+(-1===a?"?":ap.set(g,e.setHeaders[g]),c)),e.setParams&&(u=Object.keys(e.setParams).reduce((p,g)=>p.set(g,e.setParams[g]),u)),new Rb(i,r,o,{params:u,headers:c,context:h,reportProgress:l,responseType:s,withCredentials:a})}}var ws=(()=>((ws=ws||{})[ws.Sent=0]="Sent",ws[ws.UploadProgress=1]="UploadProgress",ws[ws.ResponseHeader=2]="ResponseHeader",ws[ws.DownloadProgress=3]="DownloadProgress",ws[ws.Response=4]="Response",ws[ws.User=5]="User",ws))();class RC extends class{constructor(e,t=200,i="OK"){this.headers=e.headers||new fd,this.status=void 0!==e.status?e.status:t,this.statusText=e.statusText||i,this.url=e.url||null,this.ok=this.status>=200&&this.status<300}}{constructor(e={}){super(e),this.type=ws.Response,this.body=void 0!==e.body?e.body:null}clone(e={}){return new RC({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})}}function LP(n,e){return{body:e,headers:n.headers,context:n.context,observe:n.observe,params:n.params,reportProgress:n.reportProgress,responseType:n.responseType,withCredentials:n.withCredentials}}let ip=(()=>{class n{constructor(t){this.handler=t}request(t,i,r={}){let s;if(t instanceof Rb)s=t;else{let l,c;l=r.headers instanceof fd?r.headers:new fd(r.headers),r.params&&(c=r.params instanceof xh?r.params:new xh({fromObject:r.params})),s=new Rb(t,i,void 0!==r.body?r.body:null,{headers:l,context:r.context,params:c,reportProgress:r.reportProgress,responseType:r.responseType||"json",withCredentials:r.withCredentials})}const o=fn(s).pipe(function(n,e){return B(n,e,1)}(l=>this.handler.handle(l)));if(t instanceof Rb||"events"===r.observe)return o;const a=o.pipe(Qi(l=>l instanceof RC));switch(r.observe||"body"){case"body":switch(s.responseType){case"arraybuffer":return a.pipe(me(l=>{if(null!==l.body&&!(l.body instanceof ArrayBuffer))throw new Error("Response is not an ArrayBuffer.");return l.body}));case"blob":return a.pipe(me(l=>{if(null!==l.body&&!(l.body instanceof Blob))throw new Error("Response is not a Blob.");return l.body}));case"text":return a.pipe(me(l=>{if(null!==l.body&&"string"!=typeof l.body)throw new Error("Response is not a string.");return l.body}));case"json":default:return a.pipe(me(l=>l.body))}case"response":return a;default:throw new Error(`Unreachable: unhandled observe type ${r.observe}}`)}}delete(t,i={}){return this.request("DELETE",t,i)}get(t,i={}){return this.request("GET",t,i)}head(t,i={}){return this.request("HEAD",t,i)}jsonp(t,i){return this.request("JSONP",t,{params:(new xh).append(i,"JSONP_CALLBACK"),observe:"body",responseType:"json"})}options(t,i={}){return this.request("OPTIONS",t,i)}patch(t,i,r={}){return this.request("PATCH",t,LP(r,i))}post(t,i,r={}){return this.request("POST",t,LP(r,i))}put(t,i,r={}){return this.request("PUT",t,LP(r,i))}}return n.\u0275fac=function(t){return new(t||n)(Oe(b7))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const _Te=["*"];function O7(n){return Error(`Unable to find icon with the name "${n}"`)}function R7(n){return Error(`The URL provided to MatIconRegistry was not trusted as a resource URL via Angular's DomSanitizer. Attempted URL was "${n}".`)}function N7(n){return Error(`The literal provided to MatIconRegistry was not trusted as safe HTML by Angular's DomSanitizer. Attempted literal was "${n}".`)}class rp{constructor(e,t,i){this.url=e,this.svgText=t,this.options=i}}let NC=(()=>{class n{constructor(t,i,r,s){this._httpClient=t,this._sanitizer=i,this._errorHandler=s,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=r}addSvgIcon(t,i,r){return this.addSvgIconInNamespace("",t,i,r)}addSvgIconLiteral(t,i,r){return this.addSvgIconLiteralInNamespace("",t,i,r)}addSvgIconInNamespace(t,i,r,s){return this._addSvgIconConfig(t,i,new rp(r,null,s))}addSvgIconResolver(t){return this._resolvers.push(t),this}addSvgIconLiteralInNamespace(t,i,r,s){const o=this._sanitizer.sanitize(ni.HTML,r);if(!o)throw N7(r);return this._addSvgIconConfig(t,i,new rp("",o,s))}addSvgIconSet(t,i){return this.addSvgIconSetInNamespace("",t,i)}addSvgIconSetLiteral(t,i){return this.addSvgIconSetLiteralInNamespace("",t,i)}addSvgIconSetInNamespace(t,i,r){return this._addSvgIconSetConfig(t,new rp(i,null,r))}addSvgIconSetLiteralInNamespace(t,i,r){const s=this._sanitizer.sanitize(ni.HTML,i);if(!s)throw N7(i);return this._addSvgIconSetConfig(t,new rp("",s,r))}registerFontClassAlias(t,i=t){return this._fontCssClassesByAlias.set(t,i),this}classNameForFontAlias(t){return this._fontCssClassesByAlias.get(t)||t}setDefaultFontSetClass(t){return this._defaultFontSetClass=t,this}getDefaultFontSetClass(){return this._defaultFontSetClass}getSvgIconFromUrl(t){const i=this._sanitizer.sanitize(ni.RESOURCE_URL,t);if(!i)throw R7(t);const r=this._cachedIconsByUrl.get(i);return r?fn(PC(r)):this._loadSvgIconFromConfig(new rp(t,null)).pipe(Yr(s=>this._cachedIconsByUrl.set(i,s)),me(s=>PC(s)))}getNamedSvgIcon(t,i=""){const r=P7(i,t);let s=this._svgIconConfigs.get(r);if(s)return this._getSvgFromConfig(s);if(s=this._getIconConfigFromResolvers(i,t),s)return this._svgIconConfigs.set(r,s),this._getSvgFromConfig(s);const o=this._iconSetConfigs.get(i);return o?this._getSvgFromIconSetConfigs(t,o):Fg(O7(r))}ngOnDestroy(){this._resolvers=[],this._svgIconConfigs.clear(),this._iconSetConfigs.clear(),this._cachedIconsByUrl.clear()}_getSvgFromConfig(t){return t.svgText?fn(PC(this._svgElementFromConfig(t))):this._loadSvgIconFromConfig(t).pipe(me(i=>PC(i)))}_getSvgFromIconSetConfigs(t,i){const r=this._extractIconWithNameFromAnySet(t,i);return r?fn(r):ub(i.filter(o=>!o.svgText).map(o=>this._loadSvgIconSetFromConfig(o).pipe(bc(a=>{const c=`Loading icon set URL: ${this._sanitizer.sanitize(ni.RESOURCE_URL,o.url)} failed: ${a.message}`;return this._errorHandler.handleError(new Error(c)),fn(null)})))).pipe(me(()=>{const o=this._extractIconWithNameFromAnySet(t,i);if(!o)throw O7(t);return o}))}_extractIconWithNameFromAnySet(t,i){for(let r=i.length-1;r>=0;r--){const s=i[r];if(s.svgText&&s.svgText.indexOf(t)>-1){const o=this._svgElementFromConfig(s),a=this._extractSvgIconFromSet(o,t,s.options);if(a)return a}}return null}_loadSvgIconFromConfig(t){return this._fetchIcon(t).pipe(Yr(i=>t.svgText=i),me(()=>this._svgElementFromConfig(t)))}_loadSvgIconSetFromConfig(t){return t.svgText?fn(null):this._fetchIcon(t).pipe(Yr(i=>t.svgText=i))}_extractSvgIconFromSet(t,i,r){const s=t.querySelector(`[id="${i}"]`);if(!s)return null;const o=s.cloneNode(!0);if(o.removeAttribute("id"),"svg"===o.nodeName.toLowerCase())return this._setSvgAttributes(o,r);if("symbol"===o.nodeName.toLowerCase())return this._setSvgAttributes(this._toSvgElement(o),r);const a=this._svgElementFromString("");return a.appendChild(o),this._setSvgAttributes(a,r)}_svgElementFromString(t){const i=this._document.createElement("DIV");i.innerHTML=t;const r=i.querySelector("svg");if(!r)throw Error(" tag not found");return r}_toSvgElement(t){const i=this._svgElementFromString(""),r=t.attributes;for(let s=0;se.lift(new tTe(n))}(()=>this._inProgressUrlFetches.delete(a)),Es());return this._inProgressUrlFetches.set(a,c),c}_addSvgIconConfig(t,i,r){return this._svgIconConfigs.set(P7(t,i),r),this}_addSvgIconSetConfig(t,i){const r=this._iconSetConfigs.get(t);return r?r.push(i):this._iconSetConfigs.set(t,[i]),this}_svgElementFromConfig(t){if(!t.svgElement){const i=this._svgElementFromString(t.svgText);this._setSvgAttributes(i,t.options),t.svgElement=i}return t.svgElement}_getIconConfigFromResolvers(t,i){for(let r=0;re?e.pathname+e.search:""}}}),F7=["clip-path","color-profile","src","cursor","fill","filter","marker","marker-start","marker-mid","marker-end","mask","stroke"],CTe=F7.map(n=>`[${n}]`).join(", "),ATe=/^url\(['"]?#(.*?)['"]?\)$/;let Nm=(()=>{class n extends wTe{constructor(t,i,r,s,o){super(t),this._iconRegistry=i,this._location=s,this._errorHandler=o,this._inline=!1,this._currentIconFetch=x.EMPTY,r||t.nativeElement.setAttribute("aria-hidden","true")}get inline(){return this._inline}set inline(t){this._inline=xi(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 i=this._cleanupFontValue(t);i!==this._fontSet&&(this._fontSet=i,this._updateFontIconClasses())}get fontIcon(){return this._fontIcon}set fontIcon(t){const i=this._cleanupFontValue(t);i!==this._fontIcon&&(this._fontIcon=i,this._updateFontIconClasses())}_splitIconName(t){if(!t)return["",""];const i=t.split(":");switch(i.length){case 1:return["",i[0]];case 2:return i;default:throw Error(`Invalid icon name: "${t}"`)}}ngOnInit(){this._updateFontIconClasses()}ngAfterViewChecked(){const t=this._elementsWithExternalReferences;if(t&&t.size){const i=this._location.getPathname();i!==this._previousPath&&(this._previousPath=i,this._prependPathToReferences(i))}}ngOnDestroy(){this._currentIconFetch.unsubscribe(),this._elementsWithExternalReferences&&this._elementsWithExternalReferences.clear()}_usingFontIcon(){return!this.svgIcon}_setSvgElement(t){this._clearSvgElement();const i=t.querySelectorAll("style");for(let s=0;s{r.forEach(o=>{s.setAttribute(o.name,`url('${t}#${o.value}')`)})})}_cacheChildrenWithExternalReferences(t){const i=t.querySelectorAll(CTe),r=this._elementsWithExternalReferences=this._elementsWithExternalReferences||new Map;for(let s=0;s{const a=i[s],l=a.getAttribute(o),c=l?l.match(ATe):null;if(c){let u=r.get(a);u||(u=[],r.set(a,u)),u.push({name:o,value:c[1]})}})}_updateSvgIcon(t){if(this._svgNamespace=null,this._svgName=null,this._currentIconFetch.unsubscribe(),t){const[i,r]=this._splitIconName(t);i&&(this._svgNamespace=i),r&&(this._svgName=r),this._currentIconFetch=this._iconRegistry.getNamedSvgIcon(r,i).pipe(Wi(1)).subscribe(s=>this._setSvgElement(s),s=>{this._errorHandler.handleError(new Error(`Error retrieving icon ${i}:${r}! ${s.message}`))})}}}return n.\u0275fac=function(t){return new(t||n)(xe(En),xe(NC),Fo("aria-hidden"),xe(ETe),xe(oa))},n.\u0275cmp=ln({type:n,selectors:[["mat-icon"]],hostAttrs:["role","img",1,"mat-icon","notranslate"],hostVars:7,hostBindings:function(t,i){2&t&&(Bi("data-mat-icon-type",i._usingFontIcon()?"font":"svg")("data-mat-icon-name",i._svgName||i.fontIcon)("data-mat-icon-namespace",i._svgNamespace||i.fontSet),vi("mat-icon-inline",i.inline)("mat-icon-no-color","primary"!==i.color&&"accent"!==i.color&&"warn"!==i.color))},inputs:{color:"color",inline:"inline",svgIcon:"svgIcon",fontSet:"fontSet",fontIcon:"fontIcon"},exportAs:["matIcon"],features:[An],ngContentSelectors:_Te,decls:1,vars:0,template:function(t,i){1&t&&(is(),si(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}),n})();function LTe(n,e){}class zP{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 BTe={dialogContainer:Em("dialogContainer",[vc("void, exit",fs({opacity:0,transform:"scale(0.7)"})),vc("enter",fs({transform:"none"})),ud("* => enter",cd("150ms cubic-bezier(0, 0, 0.2, 1)",fs({transform:"none",opacity:1}))),ud("* => void, * => exit",cd("75ms cubic-bezier(0.4, 0.0, 0.2, 1)",fs({opacity:0})))])};let jTe=(()=>{class n extends MC{constructor(t,i,r,s,o,a){super(),this._elementRef=t,this._focusTrapFactory=i,this._changeDetectorRef=r,this._config=o,this._focusMonitor=a,this._animationStateChanged=new sn,this._elementFocusedBeforeDialogWasOpened=null,this._closeInteractionType=null,this.attachDomPortal=l=>(this._portalOutlet.hasAttached(),this._portalOutlet.attachDomPortal(l)),this._ariaLabelledBy=o.ariaLabelledBy||null,this._document=s}_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 i=Zx(),r=this._elementRef.nativeElement;(!i||i===this._document.body||i===r||r.contains(i))&&(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=Zx())}_focusDialogContainer(){this._elementRef.nativeElement.focus&&this._elementRef.nativeElement.focus()}_containsFocus(){const t=this._elementRef.nativeElement,i=Zx();return t===i||t.contains(i)}}return n.\u0275fac=function(t){return new(t||n)(xe(En),xe(XH),xe(Dr),xe(pn,8),xe(zP),xe(du))},n.\u0275dir=Rt({type:n,viewQuery:function(t,i){if(1&t&&ss(tp,7),2&t){let r;ii(r=ri())&&(i._portalOutlet=r.first)}},features:[An]}),n})(),VTe=(()=>{class n extends jTe{constructor(){super(...arguments),this._state="enter"}_onAnimationDone({toState:t,totalTime:i}){"enter"===t?(this._trapFocus(),this._animationStateChanged.next({state:"opened",totalTime:i})):"exit"===t&&(this._restoreFocus(),this._animationStateChanged.next({state:"closed",totalTime:i}))}_onAnimationStart({toState:t,totalTime:i}){"enter"===t?this._animationStateChanged.next({state:"opening",totalTime:i}):("exit"===t||"void"===t)&&this._animationStateChanged.next({state:"closing",totalTime:i})}_startExitAnimation(){this._state="exit",this._changeDetectorRef.markForCheck()}}return n.\u0275fac=function(){let e;return function(i){return(e||(e=nr(n)))(i||n)}}(),n.\u0275cmp=ln({type:n,selectors:[["mat-dialog-container"]],hostAttrs:["tabindex","-1","aria-modal","true",1,"mat-dialog-container"],hostVars:6,hostBindings:function(t,i){1&t&&fE("@dialogContainer.start",function(s){return i._onAnimationStart(s)})("@dialogContainer.done",function(s){return i._onAnimationDone(s)}),2&t&&(Lu("id",i._id),Bi("role",i._config.role)("aria-labelledby",i._config.ariaLabel?null:i._ariaLabelledBy)("aria-label",i._config.ariaLabel)("aria-describedby",i._config.ariaDescribedBy||null),mE("@dialogContainer",i._state))},features:[An],decls:1,vars:0,consts:[["cdkPortalOutlet",""]],template:function(t,i){1&t&&Di(0,LTe,0,0,"ng-template",0)},directives:[tp],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:[BTe.dialogContainer]}}),n})(),UTe=0;class FC{constructor(e,t,i="mat-dialog-"+UTe++){this._overlayRef=e,this._containerInstance=t,this.id=i,this.disableClose=this._containerInstance._config.disableClose,this._afterOpened=new se,this._afterClosed=new se,this._beforeClosed=new se,this._state=0,t._id=i,t._animationStateChanged.pipe(Qi(r=>"opened"===r.state),Wi(1)).subscribe(()=>{this._afterOpened.next(),this._afterOpened.complete()}),t._animationStateChanged.pipe(Qi(r=>"closed"===r.state),Wi(1)).subscribe(()=>{clearTimeout(this._closeFallbackTimeout),this._finishDialogClose()}),e.detachments().subscribe(()=>{this._beforeClosed.next(this._result),this._beforeClosed.complete(),this._afterClosed.next(this._result),this._afterClosed.complete(),this.componentInstance=null,this._overlayRef.dispose()}),e.keydownEvents().pipe(Qi(r=>27===r.keyCode&&!this.disableClose&&!Dl(r))).subscribe(r=>{r.preventDefault(),HP(this,"keyboard")}),e.backdropClick().subscribe(()=>{this.disableClose?this._containerInstance._recaptureFocus():HP(this,"mouse")})}close(e){this._result=e,this._containerInstance._animationStateChanged.pipe(Qi(t=>"closing"===t.state),Wi(1)).subscribe(t=>{this._beforeClosed.next(e),this._beforeClosed.complete(),this._overlayRef.detachBackdrop(),this._closeFallbackTimeout=setTimeout(()=>this._finishDialogClose(),t.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(e){let 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}updateSize(e="",t=""){return this._overlayRef.updateSize({width:e,height:t}),this._overlayRef.updatePosition(),this}addPanelClass(e){return this._overlayRef.addPanelClass(e),this}removePanelClass(e){return this._overlayRef.removePanelClass(e),this}getState(){return this._state}_finishDialogClose(){this._state=2,this._overlayRef.dispose()}_getPositionStrategy(){return this._overlayRef.getConfig().positionStrategy}}function HP(n,e,t){return void 0!==n._containerInstance&&(n._containerInstance._closeInteractionType=e),n.close(t)}const B7=new Ht("MatDialogData"),zTe=new Ht("mat-dialog-default-options"),j7=new Ht("mat-dialog-scroll-strategy");let $Te=(()=>{class n{constructor(t,i,r,s,o,a,l,c,u){this._overlay=t,this._injector=i,this._defaultOptions=r,this._parentDialog=s,this._overlayContainer=o,this._dialogRefConstructor=l,this._dialogContainerType=c,this._dialogDataToken=u,this._openDialogsAtThisLevel=[],this._afterAllClosedAtThisLevel=new se,this._afterOpenedAtThisLevel=new se,this._ariaHiddenElements=new Map,this.afterAllClosed=function(n){return new I(e=>{let t;try{t=n()}catch(r){return void e.error(r)}return(t?je(t):lS()).subscribe(e)})}(()=>this.openDialogs.length?this._getAfterAllClosed():this._getAfterAllClosed().pipe(ao(void 0))),this._scrollStrategy=a}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,i){(i=function(n,e){return Object.assign(Object.assign({},e),n)}(i,this._defaultOptions||new zP)).id&&this.getDialogById(i.id);const r=this._createOverlay(i),s=this._attachDialogContainer(r,i),o=this._attachDialogContent(t,s,r,i);return this.openDialogs.length||this._hideNonDialogContentFromAssistiveTechnology(),this.openDialogs.push(o),o.afterClosed().subscribe(()=>this._removeOpenDialog(o)),this.afterOpened.next(o),s._initializeWithAttachedContent(),o}closeAll(){this._closeDialogs(this.openDialogs)}getDialogById(t){return this.openDialogs.find(i=>i.id===t)}ngOnDestroy(){this._closeDialogs(this._openDialogsAtThisLevel),this._afterAllClosedAtThisLevel.complete(),this._afterOpenedAtThisLevel.complete()}_createOverlay(t){const i=this._getOverlayConfig(t);return this._overlay.create(i)}_getOverlayConfig(t){const i=new IC({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&&(i.backdropClass=t.backdropClass),i}_attachDialogContainer(t,i){const s=Wn.create({parent:i&&i.viewContainerRef&&i.viewContainerRef.injector||this._injector,providers:[{provide:zP,useValue:i}]}),o=new TC(this._dialogContainerType,i.viewContainerRef,s,i.componentFactoryResolver);return t.attach(o).instance}_attachDialogContent(t,i,r,s){const o=new this._dialogRefConstructor(r,i,s.id);if(t instanceof zo)i.attachTemplatePortal(new Im(t,null,{$implicit:s.data,dialogRef:o}));else{const a=this._createInjector(s,o,i),l=i.attachComponentPortal(new TC(t,s.viewContainerRef,a));o.componentInstance=l.instance}return o.updateSize(s.width,s.height).updatePosition(s.position),o}_createInjector(t,i,r){const s=t&&t.viewContainerRef&&t.viewContainerRef.injector,o=[{provide:this._dialogContainerType,useValue:r},{provide:this._dialogDataToken,useValue:t.data},{provide:this._dialogRefConstructor,useValue:i}];return t.direction&&(!s||!s.get(Il,null,Sn.Optional))&&o.push({provide:Il,useValue:{value:t.direction,change:fn()}}),Wn.create({parent:s||this._injector,providers:o})}_removeOpenDialog(t){const i=this.openDialogs.indexOf(t);i>-1&&(this.openDialogs.splice(i,1),this.openDialogs.length||(this._ariaHiddenElements.forEach((r,s)=>{r?s.setAttribute("aria-hidden",r):s.removeAttribute("aria-hidden")}),this._ariaHiddenElements.clear(),this._getAfterAllClosed().next()))}_hideNonDialogContentFromAssistiveTechnology(){const t=this._overlayContainer.getContainerElement();if(t.parentElement){const i=t.parentElement.children;for(let r=i.length-1;r>-1;r--){let s=i[r];s!==t&&"SCRIPT"!==s.nodeName&&"STYLE"!==s.nodeName&&!s.hasAttribute("aria-live")&&(this._ariaHiddenElements.set(s,s.getAttribute("aria-hidden")),s.setAttribute("aria-hidden","true"))}}}_closeDialogs(t){let i=t.length;for(;i--;)t[i].close()}}return n.\u0275fac=function(t){return new(t||n)(xe(wc),xe(Wn),xe(void 0),xe(void 0),xe(Ob),xe(void 0),xe(xu),xe(xu),xe(Ht))},n.\u0275dir=Rt({type:n}),n})(),Pb=(()=>{class n extends $Te{constructor(t,i,r,s,o,a,l){super(t,i,s,a,l,o,FC,VTe,B7)}}return n.\u0275fac=function(t){return new(t||n)(Oe(wc),Oe(Wn),Oe(Pg,8),Oe(zTe,8),Oe(j7),Oe(n,12),Oe(Ob))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),qTe=0,V7=(()=>{class n{constructor(t,i,r){this._dialogRef=t,this._elementRef=i,this._dialog=r,this.id="mat-dialog-title-"+qTe++}ngOnInit(){this._dialogRef||(this._dialogRef=function(n,e){let t=n.nativeElement.parentElement;for(;t&&!t.classList.contains("mat-dialog-container");)t=t.parentElement;return t?e.find(i=>i.id===t.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 n.\u0275fac=function(t){return new(t||n)(xe(FC,8),xe(En),xe(Pb))},n.\u0275dir=Rt({type:n,selectors:[["","mat-dialog-title",""],["","matDialogTitle",""]],hostAttrs:[1,"mat-dialog-title"],hostVars:1,hostBindings:function(t,i){2&t&&Lu("id",i.id)},inputs:{id:"id"},exportAs:["matDialogTitle"]}),n})(),U7=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275dir=Rt({type:n,selectors:[["","mat-dialog-content",""],["mat-dialog-content"],["","matDialogContent",""]],hostAttrs:[1,"mat-dialog-content"]}),n})();const $P=new Ht("CdkAccordion");let XTe=0,ZTe=(()=>{class n{constructor(t,i,r){this.accordion=t,this._changeDetectorRef=i,this._expansionDispatcher=r,this._openCloseAllSubscription=x.EMPTY,this.closed=new sn,this.opened=new sn,this.destroyed=new sn,this.expandedChange=new sn,this.id="cdk-accordion-child-"+XTe++,this._expanded=!1,this._disabled=!1,this._removeUniqueSelectionListener=()=>{},this._removeUniqueSelectionListener=r.listen((s,o)=>{this.accordion&&!this.accordion.multi&&this.accordion.id===o&&this.id!==s&&(this.expanded=!1)}),this.accordion&&(this._openCloseAllSubscription=this._subscribeToOpenCloseAllActions())}get expanded(){return this._expanded}set expanded(t){t=xi(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=xi(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 n.\u0275fac=function(t){return new(t||n)(xe($P,12),xe(Dr),xe(D$))},n.\u0275dir=Rt({type:n,selectors:[["cdk-accordion-item"],["","cdkAccordionItem",""]],inputs:{expanded:"expanded",disabled:"disabled"},outputs:{closed:"closed",opened:"opened",destroyed:"destroyed",expandedChange:"expandedChange"},exportAs:["cdkAccordionItem"],features:[Hn([{provide:$P,useValue:void 0}])]}),n})();const eMe=["body"];function tMe(n,e){}const nMe=[[["mat-expansion-panel-header"]],"*",[["mat-action-row"]]],iMe=["mat-expansion-panel-header","*","mat-action-row"];function rMe(n,e){1&n&&bi(0,"span",2),2&n&&rn("@indicatorRotate",ci()._getExpandedState())}const sMe=[[["mat-panel-title"]],[["mat-panel-description"]],"*"],oMe=["mat-panel-title","mat-panel-description","*"],WP=new Ht("MAT_ACCORDION"),H7="225ms cubic-bezier(0.4,0.0,0.2,1)",G7={indicatorRotate:Em("indicatorRotate",[vc("collapsed, void",fs({transform:"rotate(0deg)"})),vc("expanded",fs({transform:"rotate(180deg)"})),ud("expanded <=> collapsed, void => collapsed",cd(H7))]),bodyExpansion:Em("bodyExpansion",[vc("collapsed, void",fs({height:"0px",visibility:"hidden"})),vc("expanded",fs({height:"*",visibility:"visible"})),ud("expanded <=> collapsed, void => collapsed",cd(H7))])};let aMe=(()=>{class n{constructor(t){this._template=t}}return n.\u0275fac=function(t){return new(t||n)(xe(zo))},n.\u0275dir=Rt({type:n,selectors:[["ng-template","matExpansionPanelContent",""]]}),n})(),lMe=0;const $7=new Ht("MAT_EXPANSION_PANEL_DEFAULT_OPTIONS");let W7=(()=>{class n extends ZTe{constructor(t,i,r,s,o,a,l){super(t,i,r),this._viewContainerRef=s,this._animationMode=a,this._hideToggle=!1,this.afterExpand=new sn,this.afterCollapse=new sn,this._inputChanges=new se,this._headerId="mat-expansion-panel-header-"+lMe++,this._bodyAnimationDone=new se,this.accordion=t,this._document=o,this._bodyAnimationDone.pipe(rd((c,u)=>c.fromState===u.fromState&&c.toState===u.toState)).subscribe(c=>{"void"!==c.fromState&&("expanded"===c.toState?this.afterExpand.emit():"collapsed"===c.toState&&this.afterCollapse.emit())}),l&&(this.hideToggle=l.hideToggle)}get hideToggle(){return this._hideToggle||this.accordion&&this.accordion.hideToggle}set hideToggle(t){this._hideToggle=xi(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(ao(null),Qi(()=>this.expanded&&!this._portal),Wi(1)).subscribe(()=>{this._portal=new Im(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,i=this._body.nativeElement;return t===i||i.contains(t)}return!1}}return n.\u0275fac=function(t){return new(t||n)(xe(WP,12),xe(Dr),xe(D$),xe(Ns),xe(pn),xe(Nl,8),xe($7,8))},n.\u0275cmp=ln({type:n,selectors:[["mat-expansion-panel"]],contentQueries:function(t,i,r){if(1&t&&function(n,e,t,i){const r=Ei();if(r.firstCreatePass){const s=cs();F3(r,new R3(e,t,i),s.index),function(n,e){const t=n.contentQueries||(n.contentQueries=[]);e!==(t.length?t[t.length-1]:-1)&&t.push(n.queries.length-1,e)}(r,n),2==(2&t)&&(r.staticContentQueries=!0)}P3(r,jt(),t)}(r,aMe,5),2&t){let s;ii(s=ri())&&(i._lazyContent=s.first)}},viewQuery:function(t,i){if(1&t&&ss(eMe,5),2&t){let r;ii(r=ri())&&(i._body=r.first)}},hostAttrs:[1,"mat-expansion-panel"],hostVars:6,hostBindings:function(t,i){2&t&&vi("mat-expanded",i.expanded)("_mat-animation-noopable","NoopAnimations"===i._animationMode)("mat-expansion-panel-spacing",i._hasSpacing())},inputs:{disabled:"disabled",expanded:"expanded",hideToggle:"hideToggle",togglePosition:"togglePosition"},outputs:{opened:"opened",closed:"closed",expandedChange:"expandedChange",afterExpand:"afterExpand",afterCollapse:"afterCollapse"},exportAs:["matExpansionPanel"],features:[Hn([{provide:WP,useValue:void 0}]),An,Ui],ngContentSelectors:iMe,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,i){1&t&&(is(nMe),si(0),Pt(1,"div",0,1),Un("@bodyExpansion.done",function(s){return i._bodyAnimationDone.next(s)}),Pt(3,"div",2),si(4,1),Di(5,tMe,0,0,"ng-template",3),Ft(),si(6,2),Ft()),2&t&&(Zt(1),rn("@bodyExpansion",i._getExpandedState())("id",i.id),Bi("aria-labelledby",i._headerId),Zt(4),rn("cdkPortalOutlet",i._portal))},directives:[tp],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:[G7.bodyExpansion]},changeDetection:0}),n})();class uMe{}const dMe=xP(uMe);let q7=(()=>{class n extends dMe{constructor(t,i,r,s,o,a,l){super(),this.panel=t,this._element=i,this._focusMonitor=r,this._changeDetectorRef=s,this._animationMode=a,this._parentChangeSubscription=x.EMPTY;const c=t.accordion?t.accordion._stateChanges.pipe(Qi(u=>!(!u.hideToggle&&!u.togglePosition))):Yc;this.tabIndex=parseInt(l||"")||0,this._parentChangeSubscription=kn(t.opened,t.closed,c,t._inputChanges.pipe(Qi(u=>!!(u.hideToggle||u.disabled||u.togglePosition)))).subscribe(()=>this._changeDetectorRef.markForCheck()),t.closed.pipe(Qi(()=>t._containsFocus())).subscribe(()=>r.focusVia(i,"program")),o&&(this.expandedHeight=o.expandedHeight,this.collapsedHeight=o.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:Dl(t)||(t.preventDefault(),this._toggle());break;default:return void(this.panel.accordion&&this.panel.accordion._handleHeaderKeydown(t))}}focus(t,i){t?this._focusMonitor.focusVia(this._element,t,i):this._element.nativeElement.focus(i)}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 n.\u0275fac=function(t){return new(t||n)(xe(W7,1),xe(En),xe(du),xe(Dr),xe($7,8),xe(Nl,8),Fo("tabindex"))},n.\u0275cmp=ln({type:n,selectors:[["mat-expansion-panel-header"]],hostAttrs:["role","button",1,"mat-expansion-panel-header","mat-focus-indicator"],hostVars:15,hostBindings:function(t,i){1&t&&Un("click",function(){return i._toggle()})("keydown",function(s){return i._keydown(s)}),2&t&&(Bi("id",i.panel._headerId)("tabindex",i.tabIndex)("aria-controls",i._getPanelId())("aria-expanded",i._isExpanded())("aria-disabled",i.panel.disabled),jy("height",i._getHeaderHeight()),vi("mat-expanded",i._isExpanded())("mat-expansion-toggle-indicator-after","after"===i._getTogglePosition())("mat-expansion-toggle-indicator-before","before"===i._getTogglePosition())("_mat-animation-noopable","NoopAnimations"===i._animationMode))},inputs:{tabIndex:"tabIndex",expandedHeight:"expandedHeight",collapsedHeight:"collapsedHeight"},features:[An],ngContentSelectors:oMe,decls:5,vars:1,consts:[[1,"mat-content"],["class","mat-expansion-indicator",4,"ngIf"],[1,"mat-expansion-indicator"]],template:function(t,i){1&t&&(is(sMe),Pt(0,"span",0),si(1),si(2,1),si(3,2),Ft(),Di(4,rMe,1,1,"span",1)),2&t&&(Zt(4),rn("ngIf",i._showToggle()))},directives:[lc],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:[G7.indicatorRotate]},changeDetection:0}),n})();var Y7=Je(478);Object.create(Error.prototype);const mMe=["*"];var LC=(()=>(function(n){n.LineHighlight="line-highlight",n.LineNumbers="line-numbers"}(LC||(LC={})),LC))();class yMe{}const X7=new Ht("SECURITY_CONTEXT");let qP=(()=>{class n{constructor(t,i,r,s,o){this.platform=t,this.securityContext=i,this.http=r,this.sanitizer=o,this.initialMarkedOptions={renderer:new Y7.Renderer},this.options=s}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,i=!1,r=!1,s=this.options){const o=this.trimIndentation(t),a=i?this.decodeHtml(o):o,l=r?this.renderEmoji(a):a,c=Y7.parse(l,s);return this.sanitizer.sanitize(this.securityContext,c)||""}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(me(i=>this.handleExtension(t,i)))}highlight(t){if(Tf(this.platform)&&"undefined"!=typeof Prism){t||(t=document);const i=t.querySelectorAll('pre code:not([class*="language-"])');Array.prototype.forEach.call(i,r=>r.classList.add("language-none")),Prism.highlightAllUnder(t)}}renderKatex(t,i){if(!Tf(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,(r,s)=>katex.renderToString(s,i))}decodeHtml(t){if(!Tf(this.platform))return t;const i=document.createElement("textarea");return i.innerHTML=t,i.value}handleExtension(t,i){const r=t?t.split("?")[0].split(".").splice(-1).join():"";return"md"!==r?"```"+r+"\n"+i+"\n```":i}renderEmoji(t){if(!Tf(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 i;return t.split("\n").map(r=>{let s=i;return r.length>0&&(s=isNaN(s)?r.search(/\S|$/):Math.min(r.search(/\S|$/),s)),isNaN(i)&&(i=s),s?r.substring(s):r}).join("\n")}}return n.\u0275fac=function(t){return new(t||n)(Oe(Wc),Oe(X7),Oe(ip,8),Oe(yMe,8),Oe(Mf))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),Q7=(()=>{class n{constructor(t,i){this.element=t,this.markdownService=i,this.error=new sn,this.load=new sn,this.ready=new sn,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,i=!1){let r=this.markdownService.compile(t,i,this.emoji);r=this.katex?this.markdownService.renderKatex(r,this.katexOptions):r,this.element.nativeElement.innerHTML=r,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,LC.LineNumbers),this.setPluginOptions(this.element.nativeElement,{dataStart:this.start}))}setPluginClass(t,i){const r=t.querySelectorAll("pre");for(let s=0;s{const a=i[o];if(a){const l=this.toLispCase(o);r.item(s).setAttribute(l,a.toString())}})}toLispCase(t){const i=t.match(/([A-Z])/g);if(!i)return t;let r=t.toString();for(let s=0,o=i.length;sP(i)?t(...i):t(i))):new I(i=>{const r=(...o)=>i.next(1===o.length?o[0]:o);let s;try{s=n(r)}catch(o){return void i.error(o)}if(Y(e))return()=>e(r,s)})}function YP(...n){return e=>{let t;return"function"==typeof n[n.length-1]&&(t=n.pop()),e.lift(new CMe(n,t))}}class CMe{constructor(e,t){this.observables=e,this.project=t}call(e,t){return t.subscribe(new AMe(e,this.observables,this.project))}}class AMe extends l7{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)}}class TMe{constructor(e,t,i=!1){this.accumulator=e,this.seed=t,this.hasSeed=i}call(e,t){return t.subscribe(new MMe(e,this.accumulator,this.seed,this.hasSeed))}}class MMe extends y{constructor(e,t,i,r){super(e),this.accumulator=t,this._seed=i,this.hasSeed=r,this.index=0}get seed(){return this._seed}set seed(e){this.hasSeed=!0,this._seed=e}_next(e){if(this.hasSeed)return this._tryNext(e);this.seed=e,this.destination.next(e)}_tryNext(e){const t=this.index++;let i;try{i=this.accumulator(this.seed,e,t)}catch(r){this.destination.error(r)}this.seed=i,this.destination.next(i)}}class OMe{constructor(e){this.predicate=e}call(e,t){return t.subscribe(new RMe(e,this.predicate))}}class RMe extends y{constructor(e,t){super(e),this.predicate=t,this.skipping=!0,this.index=0}_next(e){const t=this.destination;this.skipping&&this.tryCallPredicate(e),this.skipping||t.next(e)}tryCallPredicate(e){try{const t=this.predicate(e,this.index++);this.skipping=Boolean(t)}catch(t){this.destination.error(t)}}}const NMe=["youtubeContainer"];let tW=(()=>{class n{constructor(t,i){this._ngZone=t,this._youtubeContainer=new se,this._destroyed=new se,this._playerChanges=new Br(void 0),this._videoId=new Br(void 0),this._height=new Br(390),this._width=new Br(640),this._startSeconds=new Br(void 0),this._endSeconds=new Br(void 0),this._suggestedQuality=new Br(void 0),this._playerVars=new Br(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=Tf(i)}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=fn(!0);if(!window.YT||!window.YT.Player){const r=new se;this._existingApiReadyCallback=window.onYouTubeIframeAPIReady,window.onYouTubeIframeAPIReady=()=>{this._existingApiReadyCallback&&this._existingApiReadyCallback(),this._ngZone.run(()=>r.next(!0))},t=r.pipe(Wi(1),ao(!1))}const i=function(n,e,t,i,r,s,o){const a=Yo([e,s]).pipe(YP(Yo([i,r])),me(([l,c])=>{const[u,h]=l,[p,g]=c;return u?{videoId:u,playerVars:h,width:p,height:g}:void 0}));return Yo([n,a,fn(o)]).pipe(function(n){return ce(function(...n){let e=null;return"function"==typeof n[n.length-1]&&(e=n.pop()),1===n.length&&P(n[0])&&(n=n[0].slice()),t=>t.lift.call(je([t,...n]),new d7(e))}(n),function(n){return e=>e.lift(new OMe(n))}(([e,t])=>!t),me(([e])=>e))}(t),function(n,e){let t=!1;return arguments.length>=2&&(t=!0),function(r){return r.lift(new TMe(n,e,t))}}(jMe,void 0),rd())}(this._youtubeContainer,this._videoId,t,this._width,this._height,this._playerVars,this._ngZone).pipe(Yr(r=>{this._playerChanges.next(r)}),B(e=>e?nW(e)?fn(e):new I(t=>{let i=!1,r=!1;const s=o=>{r=!0,i||(o.target.removeEventListener("onReady",s),t.next(o.target))};return e.addEventListener("onReady",s),()=>{i=!0,r||(r=>{nW(r)||r.destroy()})(e)}}).pipe(Wi(1),ao(void 0)):fn(void 0)),_r(this._destroyed),el(new se));i.subscribe(r=>{this._player=r,r&&this._pendingPlayerState&&this._initializePlayer(r,this._pendingPlayerState),this._pendingPlayerState=void 0}),function(n,e,t){Yo([n,e,t]).subscribe(([i,r,s])=>i&&i.setSize(r,s))}(i,this._width,this._height),function(n,e){Yo([n,e]).subscribe(([t,i])=>t&&i&&t.setPlaybackQuality(i))}(i,this._suggestedQuality),function(n,e,t,i,r,s){const o=Yo([t,i]).pipe(me(([u,h])=>({startSeconds:u,endSeconds:h}))),a=o.pipe(XP(n,u=>!!u&&!function(n){const e=n.getPlayerState();return e!==YT.PlayerState.UNSTARTED&&e!==YT.PlayerState.CUED}(u))),l=e.pipe(XP(n,(u,h)=>!!u&&u.videoId!==h));kn(n.pipe(XP(Yo([e,o]),([u,h],p)=>!(!p||u==p.videoId&&!h.startSeconds&&!h.endSeconds))),l,a).pipe(YP(Yo([n,e,o,r])),me(([u,h])=>h),_r(s)).subscribe(([u,h,p,g])=>{!h||!u||(u.videoId=h,u.cueVideoById(Object.assign({videoId:h,suggestedQuality:g},p)))})}(i,this._videoId,this._startSeconds,this._endSeconds,this._suggestedQuality,this._destroyed),i.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,i){this._player?this._player.seekTo(t,i):this._getPendingState().seek={seconds:t,allowSeekAhead:i}}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,i){const{playbackState:r,playbackRate:s,volume:o,muted:a,seek:l}=i;switch(r){case YT.PlayerState.PLAYING:t.playVideo();break;case YT.PlayerState.PAUSED:t.pauseVideo();break;case YT.PlayerState.CUED:t.stopVideo()}null!=s&&t.setPlaybackRate(s),null!=o&&t.setVolume(o),null!=a&&(a?t.mute():t.unMute()),null!=l&&t.seekTo(l.seconds,l.allowSeekAhead)}_getLazyEmitter(t){return this._playerChanges.pipe(Ir(i=>i?Z7(r=>{i.addEventListener(t,r)},r=>{try{i.removeEventListener&&i.removeEventListener(t,r)}catch(s){}}):fn()),i=>new I(r=>i.subscribe({next:s=>this._ngZone.run(()=>r.next(s)),error:s=>r.error(s),complete:()=>r.complete()})),_r(this._destroyed))}}return n.\u0275fac=function(t){return new(t||n)(xe(gn),xe(Wc))},n.\u0275cmp=ln({type:n,selectors:[["youtube-player"]],viewQuery:function(t,i){if(1&t&&ss(NMe,5),2&t){let r;ii(r=ri())&&(i.youtubeContainer=r.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,i){1&t&&bi(0,"div",null,0)},encapsulation:2,changeDetection:0}),n})();function jMe(n,[e,t,i]){if(n&&t&&n.playerVars!==t.playerVars)n.destroy();else{if(!t)return void(n&&n.destroy());if(n)return n}const r=i.runOutsideAngular(()=>new YT.Player(e,t));return r.videoId=t.videoId,r.playerVars=t.playerVars,r}function nW(n){return"getPlayerStatus"in n}function XP(n,e){return ce(YP(n),Qi(([t,i])=>e(i,t)),me(([t])=>t))}let KMe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275dir=Rt({type:n,selectors:[["","mat-card-sm-image",""],["","matCardImageSmall",""]],hostAttrs:[1,"mat-card-sm-image"]}),n})();function kb(n){return!0===n}function Xa(n){return null==n}function Qa(n){return!Xa(n)}function QP(n){return Boolean(n)}function oW(n){return Xa(n)?n:JSON.parse(JSON.stringify(n))}const jC=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])&&jC(n[o])}),n};function aW(n){return Qa(n)&&"object"==typeof n&&function(n){return"[object Object]"===Object.prototype.toString.call(n)}(n)}const uW="NGXS_DATA_META",JP="NGXS_META",dW="NGXS_ARGUMENT_REGISTRY_META";let hW=(()=>{class n{constructor(t){this.sequence$=new Br(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)(Oe(cu,8))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();function Lb(n){return n[uW]}let Za=(()=>{class n{constructor(t,i,r){n.store=t.get(cu),n.ngZone=t.get(gn),n.factory=i,n.context=r,n.computed=t.get(hW)}}return n.store=null,n.computed=null,n.context=null,n.factory=null,n.ngZone=null,n.\u0275fac=function(t){return new(t||n)(Oe(Wn),Oe(a6),Oe(o6))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();class ps{constructor(){ps.statesCachedMeta.clear()}static createStateContext(e){return Za.context.createStateContext(e)}static ensureMappedState(e){if(Xa(Za.factory)||Xa(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(Qa(e.name)?ps.statesCachedMeta.get(e.name):null)||ps.ensureMeta(e)}static getRepositoryByInstance(e){var t;const r=null!==(t=Lb(ps.getStateClassByInstance(e)))&&void 0!==t?t:null;if(Xa(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=ps.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=ps.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=Qa(e.name)?null===(t=Za.factory.states)||void 0===t?void 0:t.find(r=>r.name===e.name):null;return Qa(i)&&Qa(e.name)&&ps.statesCachedMeta.set(e.name,i),i}}ps.statesCachedMeta=new Map,ps.\u0275fac=function(e){return new(e||ps)},ps.\u0275prov=We({token:ps,factory:ps.\u0275fac}),new kg(1);class mDe extends Error{constructor(e){super(`Child states can only be added to an object. Cannot convert ${Qa(null==e?void 0:e.constructor)?e.constructor.name:e} to PlainObject`)}}function fW(n){var e;return null!==(e=n.NGXS_OPTIONS_META)&&void 0!==e?e:{name:""}}function pW(n){var e;const t=fW(n),i=null!==(e=t.children)&&void 0!==e?e:[],s=oW(void 0===t.defaults?{}:t.defaults);if(i.length){if(aW(s))return function(n,e){return e.reduce((t,i)=>{const r=fW(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()]=pW(i),t},null!=n?n:{})}(s,i);throw new mDe(s)}return s}function mW(n){var e;return null!==(e=n.__NGXS_COMPUTED_OPTION__)&&void 0!==e?e:null}function _W(){var n,e;return null!==(e=null===(n=null==Za?void 0:Za.computed)||void 0===n?void 0:n.sequenceValue)&&void 0!==e?e:0}function vDe(n){let e=!1;return Tm(n)&&(e=!0),e}function eF(n){return n[dW]}class wDe extends Error{constructor(e,t){super(`An argument with the name '${e}' already exists in the method '${t}'`)}}class EDe{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(QP(this.argumentMap.has(e))||QP(this.payloadMap.has(e)))throw new wDe(e,t)}}function MDe(n){return{enumerable:!0,configurable:!0,get(){const e=Lb(n),t=ps.ensureMappedState(e.stateMeta);return ps.createStateContext(t)}}}function yW(){return(n,e,t)=>{!function(n,e){if(!function(n,e){var t;let i=n,r=!1;if(aW(i))for(;null!==i;){if(kb(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 Xa(mW(n))&&Object.defineProperties(n,{__NGXS_COMPUTED_OPTION__:{enumerable:!0,configurable:!0,value:new WeakMap}}),mW(n)}(this),o=null==s?void 0:s.get(i);if(kb(null==o?void 0:o.isObservable))return null==o?void 0:o.value;if(Xa(o)||o.sequenceId!==_W()){s.delete(i);const l=i.apply(this,r);return s.set(i,{value:l,sequenceId:_W(),isObservable:vDe(l)}),l}return o.value},t}}const PDe={cancelUncompleted:!0,insideZone:!1};function tF(n=PDe){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=ps.getRepositoryByInstance(a),u=c.operations;let h=u[s];const p=c.stateMeta,g=eF(r);if(Xa(h)){const U=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),de=function(n){const{statePath:e,argumentsNames:t,methodName:i,argumentRegistry:r}=n;let s="";for(let o=0;o{var U;return kb(n.insideZone)?null===(U=Za.ngZone)||void 0===U||U.run(()=>{l=r.apply(a,o)}):l=r.apply(a,o),Tm(l)?fn(null).pipe(me(()=>l)):l};const C=ps.createAction(h,o,g),H=Za.store.dispatch(C);return Tm(l)?function(n,e){return ub([n,e]).pipe(me(t=>t.pop()))}(H,l):l},i}}function bW(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 Xa(eF(t))&&Object.defineProperties(t,{[dW]:{enumerable:!0,configurable:!0,value:new EDe}}),eF(t)})(e,t).createPayloadType(r,t,i)}}function kDe(){return n=>{const e=function(n){if(function(n){return!QP(n)}(n.hasOwnProperty(JP))){const e={name:null,actions:{},defaults:{},path:null,makeRootSelector:t=>t.getStateGetter(e.name),children:[]};Object.defineProperty(n,JP,{value:e})}return function(n){var e;return null===(e=n)||void 0===e?void 0:e[JP]}(n)}(n);if(Xa(e.name))throw new Error("@StateRepository should be add before decorator @State");!function(n,e){(function(n){var e;const t=null!==(e=Lb(n))&&void 0!==e?e:null;return(Xa(t)||(null==t?void 0:t.stateClass)!==n)&&function(n){Object.defineProperty(n,uW,{writable:!0,configurable:!0,enumerable:!0,value:{stateMeta:null,operations:{},stateClass:n}})}(n),Lb(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:()=>oW(t)},context:MDe(n)})}(n,e,pW(n)),function(n){var e,t;const i=Lb(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(Qa(r)){const s=`__${r}__selector`;Object.defineProperties(n.prototype,{[s]:{writable:!0,enumerable:!1,configurable:!0},state$:{enumerable:!0,configurable:!0,get(){if(Qa(this[s]))return this[s];if(Xa(Za.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]=Za.store.select(n).pipe(me(o=>Ba()?jC(o):o),$a({refCount:!0,bufferSize:1})),this[s]}}})}}(n)}}let BDe=(()=>{class n{constructor(){this.browserStorageEvents$=new se,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})(),jDe=(()=>{class n extends BDe{get snapshot(){return function(n){return Ba()?jC(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:()=>Ba()?jC(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=nr(n)))(i||n)}}(),n.\u0275prov=We({token:n,factory:n.\u0275fac}),rr([yW(),dc("design:type",Object),dc("design:paramtypes",[])],n.prototype,"snapshot",null),rr([tF(),Aj(0,bW("patchValue")),dc("design:type",Function),dc("design:paramtypes",[Object]),dc("design:returntype",void 0)],n.prototype,"patchState",null),rr([tF(),Aj(0,bW("stateValue")),dc("design:type",Function),dc("design:paramtypes",[Object]),dc("design:returntype",void 0)],n.prototype,"setState",null),rr([tF(),dc("design:type",Function),dc("design:paramtypes",[]),dc("design:returntype",void 0)],n.prototype,"reset",null),n})();const jm=new Ht("ngx-google-analytics-settings",{factory:()=>({trackingCode:"",enableTracing:!1})}),xF=new Ht("ngx-window",{providedIn:"root",factory:()=>function(n){return Tf(n)?window:null}(Fc(Wc))}),ZOe=new Ht("ngx-data-layer",{providedIn:"root",factory:()=>function(n){return n?n.dataLayer=n.dataLayer||[]:null}(Fc(xF))}),CF=new Ht("ngx-gtag-fn",{providedIn:"root",factory:()=>function(n,e){return n?n.gtag=n.gtag||function(){e.push(arguments)}:null}(Fc(xF),Fc(ZOe))});let AF=(()=>{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||Ba())&&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)(Oe(jm),Oe(pn),Oe(CF))},n.\u0275prov=We({factory:function(){return new n(Oe(jm),Oe(pn),Oe(CF))},token:n,providedIn:"root"}),n})();new Ht("ngx-google-analytics-routing-settings",{factory:()=>({})}),new Ht("Key under which consent is stored",{providedIn:"root",factory:()=>"ALLOW_TELEMETRY"});class M9 extends Error{constructor(){super(...arguments),this.message="NgxsDispatchPluginModule is not imported"}}function bRe(){throw new M9}function vRe(){throw new M9}function DF(n,e,t){e.run(()=>n.dispatch(t))}function SRe(n,e,t,i){return yg(t)?function(n,e,t){return t.then(i=>(DF(n,e,i),i))}(n,e,t):Tm(t)?function(n,e,t,i){return null!==i&&(t=t.pipe(_r(i.cancelUncompleted$))),t.subscribe({next:r=>DF(n,e,r)}),t}(n,e,t,i):(DF(n,e,t),t)}class xRe{constructor(){this.cancelUncompleted$=new se}cancelPreviousAction(){this.cancelUncompleted$.next()}}const IF="\u0275fac",D9=Symbol("InjectorInstance"),I9=Symbol("FactoryHasBeenDecorated");function O9(n,e){const t=n[D9];return t?t.get(e):null}const TRe={cancelUncompleted:!1};function R9(n=TRe){return(e,t,i)=>{let r;const s=function(n){return n?new xRe:null}(n.cancelUncompleted);function o(){null!==s&&s.cancelPreviousAction();const a=O9(this,cu)||bRe(),l=O9(this,gn)||vRe(),c=r.apply(this,arguments);return l.runOutsideAngular(()=>SRe(a,l,c,s))}"function"==typeof(null==i?void 0:i.value)?(r=i.value,i.value=o):Object.defineProperty(e,t,{set:a=>r=a,get:()=>o}),function(n){if(I9 in n.constructor.prototype)return;const e=n.constructor;"function"==typeof e[IF]&&function(n){const e=n[IF];if("function"!=typeof e)return;const t=n.\u0275prov||n.\u0275pipe||n.\u0275cmp||n.\u0275dir,i=()=>{const r=e();return r[D9]=xe(Pu),r};t&&(t.factory=i),Object.defineProperty(n,IF,{get:()=>i})}(e),n.constructor.prototype[I9]=!0}(e)}}const tNe=["bodyCanvas"];let nNe=(()=>{class n{constructor(){this.clsName="ccf-body-ui",this.rotationChange=new sn,this.nodeDrag=new sn,this.nodeClick=new sn,this.nodeHoverStart=new sn,this.nodeHoverStop=new sn,this.initialized=new sn,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 Fi(this,void 0,void 0,function*(){const i=this.bodyCanvas.nativeElement,r=new Qve({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.target&&this.bodyUI.setTarget(this.target),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))],this.initialized.emit()})}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=ln({type:n,selectors:[["ccf-body-ui"]],viewQuery:function(t,i){if(1&t&&ss(tNe,5,En),2&t){let r;ii(r=ri())&&(i.bodyCanvas=r.first)}},hostVars:2,hostBindings:function(t,i){2&t&&vl(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",initialized:"initialized"},decls:2,vars:0,consts:[[1,"body-ui"],["bodyCanvas",""]],template:function(t,i){1&t&&bi(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})(),iNe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=on({type:n}),n.\u0275inj=xt({imports:[[qr]]}),n})();function ENe(n,e){if(1&n&&(Pt(0,"div",16),bi(1,"youtube-player",17),Ft()),2&n){const t=ci(3);Zt(1),pE("videoId",t.videoID)}}function SNe(n,e){if(1&n&&(Pt(0,"mat-expansion-panel",11),Pt(1,"mat-expansion-panel-header"),Pt(2,"h2",12),Oi(3),Ft(),Ft(),Pt(4,"div",13),bi(5,"markdown",14),Di(6,ENe,2,1,"div",15),Ft(),Ft()),2&n){const t=ci(),i=t.index,r=t.$implicit;rn("expanded",0===i),Zt(3),da(r.title),Zt(2),vi("first",0===i),rn("data",r.content),Zt(1),rn("ngIf",0===i)}}function xNe(n,e){if(1&n&&(Pt(0,"div",9),Di(1,SNe,7,6,"mat-expansion-panel",10),Ft()),2&n){const t=e.$implicit;Zt(1),rn("ngIf",t)}}new Ht("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:brain",organ:"Brain",name:"Brain",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000955"},{disabled:!0,src:"app:lymph-nodes",organ:"Lymph Node",name:"Lymph Node",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000029"},{src:"app:lymph-nodes",organ:"Lymph Node",name:"Lymph Node",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002509"},{disabled:!0,src:"app:eye",organ:"Eye",name:"Eye, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000970"},{src:"app:eye",organ:"Eye",name:"Eye, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0004548"},{src:"app:eye",organ:"Eye",name:"Eye, R",side:"right",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0004549"},{disabled:!0,src:"app:fallopian-tube-left",organ:"Fallopian Tube",name:"Fallopian Tube, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0003889"},{src:"app:fallopian-tube-left",organ:"Fallopian Tube",name:"Fallopian Tube, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0001303"},{src:"app:fallopian-tube-right",organ:"Fallopian Tube",name:"Fallopian Tube, R",side:"right",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0001302"},{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, L",side:"left",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"},{disabled:!0,src:"app:knee",organ:"Knee",name:"Knee, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001465"},{src:"app:knee",organ:"Knee",name:"Knee, L",side:"left",hasSex:!0,id:"http://purl.org/sig/ont/fma/fma24978"},{src:"app:knee",organ:"Knee",name:"Knee, R",side:"right",hasSex:!0,id:"http://purl.org/sig/ont/fma/fma24977"},{src:"app:liver",organ:"Liver",name:"Liver",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002107"},{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"},{disabled:!0,src:"app:mammary-gland",organ:"Mammary Gland",name:"Mammary Gland, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0001911"},{src:"app:mammary-gland",organ:"Mammary Gland",name:"Mammary Gland, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.org/sig/ont/fma/fma57991"},{src:"app:mammary-gland",organ:"Mammary Gland",name:"Mammary Gland, R",side:"right",hasSex:!1,sex:"female",id:"http://purl.org/sig/ont/fma/fma57987"},{disabled:!0,src:"app:ovary-left",organ:"Ovary",name:"Ovary, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0000992"},{src:"app:ovary-left",organ:"Ovary",name:"Ovary, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.org/sig/ont/fma/fma7214"},{src:"app:ovary-right",organ:"Ovary",name:"Ovary, R",side:"right",hasSex:!1,sex:"female",id:"http://purl.org/sig/ont/fma/fma7213"},{src:"app:pancreas",organ:"Pancreas",name:"Pancreas",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001264"},{src:"app:pelvis-f",organ:"Pelvis",name:"Pelvis",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001270"},{src:"app:placenta",organ:"Placenta",name:"Placenta",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0001987"},{src:"app:prostate",organ:"Prostate",name:"Prostate",hasSex:!1,sex:"male",id:"http://purl.obolibrary.org/obo/UBERON_0002367",disabled:!0},{src:"app:prostate",organ:"Prostate",name:"Prostate",hasSex:!1,sex:"male",id:"http://purl.obolibrary.org/obo/UBERON_0000079"},{src:"app:small-intestine",organ:"Small Intestine",name:"Small Intestine",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002108"},{src:"app:large-intestine",organ:"Large Intestine",name:"Large Intestine",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000059"},{src:"app:spinal-cord",organ:"Spinal Cord",name:"Spinal Cord",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002240"},{src:"app:spleen",organ:"Spleen",name:"Spleen",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002106"},{src:"app:thymus",organ:"Thymus",name:"Thymus",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002370"},{disabled:!0,src:"app:ureter-left",organ:"Ureter",name:"Ureter, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000056"},{src:"app:ureter-left",organ:"Ureter",name:"Ureter, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001223"},{src:"app:ureter-right",organ:"Ureter",name:"Ureter, R",side:"right",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001222"},{src:"app:bladder",organ:"Urinary Bladder",name:"Urinary Bladder",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001255"},{src:"app:uterus",organ:"Uterus",name:"Uterus",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0000995"},{src:"app:vasculature-thick",organ:"Blood Vasculature",name:"Blood Vasculature",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0004537"},{disabled:!0,src:"app:vasculature-thick",organ:"Blood Vasculature",name:"Blood Vasculature",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002049"}].sort((n,e)=>n.name.localeCompare(e.name)).filter(n=>!0!==n.disabled);let G9=(()=>{class n{constructor(t,i){this.dialogRef=t,this.data=i,this.documentationContents=i.content||[],this.infoTitle=i.title||"",this.videoID=i.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 n.\u0275fac=function(t){return new(t||n)(xe(FC),xe(B7))},n.\u0275cmp=ln({type:n,selectors:[["ccf-info-dialog"]],decls:11,vars:2,consts:[[1,"rui-about","wrapper"],[1,"container"],[1,"content"],[1,"header"],["mat-dialog-title","",1,"title"],[1,"close"],[1,"material-icons","close-icon",3,"click"],[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,i){1&t&&(Pt(0,"div",0),Pt(1,"div",1),Pt(2,"div",2),Pt(3,"div",3),Pt(4,"h2",4),Oi(5),Ft(),Pt(6,"div",5),Pt(7,"mat-icon",6),Un("click",function(){return i.close()}),Oi(8,"clear"),Ft(),Ft(),Ft(),Pt(9,"mat-dialog-content",7),Di(10,xNe,2,1,"div",8),Ft(),Ft(),Ft(),Ft()),2&t&&(Zt(5),da(i.infoTitle),Zt(5),rn("ngForOf",i.documentationContents))},directives:[V7,Nm,U7,Af,lc,W7,q7,Q7,tW],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%] .content[_ngcontent-%COMP%] .header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;height:3rem;margin-bottom:2.25rem;position:relative}.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%]{cursor:pointer;height:3rem;width:3rem;line-height:3rem;text-align:center;transition:.6s}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-size:1.5rem;margin:0 auto;line-height:3rem;height:3rem;justify-self:center;display:flex}.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;display:flex}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .dialog-content[_ngcontent-%COMP%] .variable-binding.first[_ngcontent-%COMP%]{padding-right:1rem;width:73%}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .dialog-content[_ngcontent-%COMP%] .variable-binding[_ngcontent-%COMP%] ul{margin:0}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .dialog-content[_ngcontent-%COMP%] .variable-binding[_ngcontent-%COMP%] img{margin-left:1rem;float:right}.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%}"]}),n})(),$9=(()=>{class n{constructor(t){this.http=t,this.panelContent=new Br({content:[],infoTitle:"",videoID:""})}updateData(t,i,r){this.http.get(t,{responseType:"text"}).subscribe(s=>{const o={content:this.parseMarkdown(s),infoTitle:r,videoID:i};this.panelContent.next(o)})}parseMarkdown(t){const i=[],r=t.split("# ");for(const s of r)if(s.length){const o=s.includes("\n\n")?"\n\n":"\r\n\r\n",a=s.split(o);i.push({title:a[0],content:a.splice(1).join(o)})}return i}}return n.\u0275fac=function(t){return new(t||n)(Oe(ip))},n.\u0275prov=We({token:n,factory:n.\u0275fac,providedIn:"root"}),n})(),ANe=(()=>{class n{constructor(){this.clsName="ccf-call-to-action",this.callToActionClicked=new sn,this.closeClicked=new sn}close(){this.closeClicked.emit()}onDialogButtonClick(){this.callToActionClicked.emit()}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=ln({type:n,selectors:[["ccf-call-to-action"]],hostVars:2,hostBindings:function(t,i){2&t&&vl(i.clsName)},inputs:{infoTitle:"infoTitle",imageUrl:"imageUrl",message:"message",callToAction:"callToAction"},outputs:{callToActionClicked:"callToActionClicked",closeClicked:"closeClicked"},decls:13,vars:4,consts:[[1,"rui-about","wrapper"],[1,"container"],[1,"content"],[1,"first-row"],["mat-dialog-title","",1,"title"],[1,"cta-mat-icon","material-icons","close-icon",3,"click"],["mat-card-sm-image","","alt","preview","layout-fill","",1,"cta-image",3,"src"],[1,"mat-typography","dialog-content"],[1,"message"],["mat-button","",1,"mat-button",3,"text","click"]],template:function(t,i){1&t&&(Pt(0,"div",0),Pt(1,"div",1),Pt(2,"div",2),Pt(3,"div",3),Pt(4,"p",4),Oi(5),Ft(),Pt(6,"mat-icon",5),Un("click",function(){return i.close()}),Oi(7,"clear"),Ft(),Ft(),bi(8,"img",6),Pt(9,"mat-dialog-content",7),Pt(10,"div",8),Oi(11),Ft(),Pt(12,"a",9),Un("click",function(){return i.onDialogButtonClick()}),Ft(),Ft(),Ft(),Ft(),Ft()),2&t&&(Zt(5),da(i.infoTitle),Zt(3),rn("src",i.imageUrl,nf),Zt(3),ha(" ",i.message,""),Zt(1),rn("text",i.callToAction))},directives:[V7,Nm,KMe,U7],styles:["[_nghost-%COMP%] .content[_ngcontent-%COMP%]{display:block;align-content:center;padding-left:1.6rem;padding-right:1.6rem;border-radius:.25rem}[_nghost-%COMP%] .info-button-wrapper[_ngcontent-%COMP%]{border-radius:.25rem;padding:.6rem;transition:.6s}[_nghost-%COMP%] .info-button-wrapper[_ngcontent-%COMP%] .ccf-info-button[_ngcontent-%COMP%]{cursor:pointer;transition:color .6s;font-size:1.2rem;vertical-align:sub}[_nghost-%COMP%] .first-row[_ngcontent-%COMP%]{display:flex;width:100%;line-height:.9rem}[_nghost-%COMP%] .first-row[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{padding-right:7rem;padding-left:.2rem;font-size:.875rem;padding-top:.75rem}[_nghost-%COMP%] .first-row[_ngcontent-%COMP%] .cta-mat-icon[_ngcontent-%COMP%]{height:30%;line-height:3.4rem}[_nghost-%COMP%] .message[_ngcontent-%COMP%]{padding:.5rem}[_nghost-%COMP%] .cta-image[_ngcontent-%COMP%]{align-self:center;-o-object-fit:cover;object-fit:cover;width:100%;border-radius:.25rem}[_nghost-%COMP%] .mat-button[_ngcontent-%COMP%]{background-color:#444a65;font-size:.75rem;position:relative;margin-bottom:1rem;width:100%;height:2rem;color:#fff}"],changeDetection:0}),n})(),Yb=(()=>{let n=class extends jDe{constructor(){super(...arguments),this.optionCache=new Map}get config$(){return this.state$.pipe(Qi(n=>null!=n),$a(1))}setConfig(t){this.setState(t)}patchConfig(t){this.patchState(t)}getProperty(t){return this.config$.pipe(a7(...t),rd(),$a(1))}getOption(...t){const i=this.getPathKey(t);if(this.optionCache.has(i))return this.optionCache.get(i);const r=this.config$.pipe(a7(...t),rd(),$a(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=nr(n)))(i||n)}}(),n.\u0275prov=We({token:n,factory:n.\u0275fac}),rr([yW()],n.prototype,"config$",null),n=rr([kDe(),M6({name:"globalConfig",defaults:null})],n),n})();!function(){const n=localStorage.getItem("ALLOW_TELEMETRY");null===n||n.toLowerCase()}(),new se;let PF=(()=>{class n{}return n.type="[CallToAction] Learn More",n})(),FF=(()=>{class n{}return n.type="[CallToAction] Open Dialog",n})(),kF=(()=>{class n{}return n.type="[CallToAction] Close Dialog",n})();var LF;class wa{get length(){var e,t;return null!==(t=null===(e=wa.storage)||void 0===e?void 0:e.length)&&void 0!==t?t:0}key(e){var t,i;return null!==(i=null===(t=wa.storage)||void 0===t?void 0:t.key(e))&&void 0!==i?i:null}getItem(e,t){var i,r,s;return null!==(s=null!==(r=null===(i=wa.storage)||void 0===i?void 0:i.getItem(e))&&void 0!==r?r:t)&&void 0!==s?s:null}setItem(e,t){var i;try{return null===(i=wa.storage)||void 0===i||i.setItem(e,t),!0}catch(r){return!1}}removeItem(e){var t;null===(t=wa.storage)||void 0===t||t.removeItem(e)}clear(){var e;null===(e=wa.storage)||void 0===e||e.clear()}}wa.storage=(()=>{let n;try{n=window.localStorage;const e="__storage_test__";return n.setItem(e,e),n.removeItem(e),n}catch(e){return e instanceof DOMException&&(22===e.code||1014===e.code||"QuotaExceededError"===e.name||"NS_ERROR_DOM_QUOTA_REACHED"===e.name)&&n&&0!==n.length?n:void 0}})(),wa.\u0275fac=function(e){return new(e||wa)},wa.\u0275prov=We({token:wa,factory:wa.\u0275fac,providedIn:"root"});const Y9="callToActionPopupShown";let Do=LF=class{constructor(e,t,i,r,s){this.dialog=e,this.ga=t,this.storage=i,this.infoService=r,this.http=s}static ctaDatePassed(e,t=Date.now){return+t()>+new Date(e)}ngxsOnInit(e){const{expirationDate:t,popupShown:i}=e.getState(),r=this.storage.getItem(Y9,`${i}`),s=LF.ctaDatePassed(t);"true"!==r&&!s&&e.dispatch(new FF)}getDialogData(){return this.http.get("assets/docs/SPATIAL_SEARCH_README.md",{responseType:"text"}).pipe(me(e=>this.infoService.parseMarkdown(e)))}launchLearnMore(e){this.dialog.open(G9,{autoFocus:!1,panelClass:"modal-animated",width:"72rem",data:{title:"Spatial Search",content:e,videoID:"UfxMpzatowE"}})}learnMore(e){return this.dialog.closeAll(),this.ga.event("open_learn_more","call_to_action"),this.getDialogData().pipe(Yr(t=>this.launchLearnMore(t)))}open(e){this.dialog.open(NNe,{autoFocus:!1,panelClass:"modal-animated",width:"30.75rem",height:"36.688rem"}),this.ga.event("open","call_to_action"),this.storage.setItem(Y9,"true"),e.patchState({popupShown:!0})}close(e){this.dialog.closeAll(),this.ga.event("close","call_to_action")}};Do.\u0275fac=function(e){return new(e||Do)(Oe(Pb),Oe(AF),Oe(wa),Oe($9),Oe(ip))},Do.\u0275prov=We({token:Do,factory:Do.\u0275fac}),rr([_N(PF)],Do.prototype,"learnMore",null),rr([_N(FF)],Do.prototype,"open",null),rr([_N(kF)],Do.prototype,"close",null),Do=LF=rr([M6({name:"callToAction",defaults:{title:"New to the Exploration User Interface",message:"Spatial Search has arrived!",callToAction:"Learn More",imageUrl:"assets/images/spatial_search.gif",expirationDate:"Dec 1, 2022",popupShown:!1}})],Do);let o1=(()=>{class n{static title(t){return t.title}static message(t){return t.message}static callToAction(t){return t.callToAction}static imageUrl(t){return t.imageUrl}static expirationDate(t){return t.expirationDate}static popupShown(t){return t.popupShown}}return rr([_m([Do])],n,"title",null),rr([_m([Do])],n,"message",null),rr([_m([Do])],n,"callToAction",null),rr([_m([Do])],n,"imageUrl",null),rr([_m([Do])],n,"expirationDate",null),rr([_m([Do])],n,"popupShown",null),n})(),NNe=(()=>{class n{constructor(){this.close=()=>new kF,this.learnMore=()=>new PF}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=ln({type:n,selectors:[["ccf-call-to-action-behavior"]],decls:5,vars:12,consts:[[3,"infoTitle","message","callToAction","imageUrl","callToActionClicked","closeClicked"]],template:function(t,i){1&t&&(Pt(0,"ccf-call-to-action",0),Un("callToActionClicked",function(){return i.learnMore()})("closeClicked",function(){return i.close()}),xl(1,"async"),xl(2,"async"),xl(3,"async"),xl(4,"async"),Ft()),2&t&&rn("infoTitle",Vu(1,4,i.title$))("message",Vu(2,6,i.message$))("callToAction",Vu(3,8,i.callToAction$))("imageUrl",Vu(4,10,i.imageUrl$))},directives:[ANe],pipes:[h0],styles:[""],changeDetection:0}),rr([kx(o1.title)],n.prototype,"title$",void 0),rr([kx(o1.message)],n.prototype,"message$",void 0),rr([kx(o1.callToAction)],n.prototype,"callToAction$",void 0),rr([kx(o1.imageUrl)],n.prototype,"imageUrl$",void 0),rr([R9()],n.prototype,"close",void 0),rr([R9()],n.prototype,"learnMore",void 0),n})();const K9="http://purl.org/ccf/latest/ccf-entity.owl#has_spatial_entity",BNe=[173,255,47,229.5];var xn=Je(440),HNe=Je(698),GNe=Je(445),$Ne=Je.n(GNe),fr=Je(815),Kb=Je(609);const or=xn.Util.prefixes({base:"http://purl.org/ccf/latest/ccf.owl#",ccf:"http://purl.org/ccf/",fma:"http://purl.org/sig/ont/fma/fma",obo:"http://purl.obolibrary.org/obo/",uberon:"http://purl.obolibrary.org/obo/UBERON_",cl:"http://purl.obolibrary.org/obo/CL_",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/",dcterms:"http://purl.org/dc/terms/"},xn.DataFactory),un=(or("rdf"),or("rdf")("type"),or("rdfs"),or("rdfs")("label"),or("rdfs")("comment"),or("rdfs")("isDefinedBy"),or("rdfs")("seeAlso"),or("ccf")),co_label=(or("ccf")("has_registration_location"),or("rdfs")("label")),co_description=or("rdfs")("comment"),co_link=un("url"),co_providerName=(un("sex"),un("age"),un("bmi"),xn.DataFactory.literal("Male"),xn.DataFactory.literal("Female"),un("consortium_name"),un("tissue_provider_name")),co_donor=(un("tissue_provider_uuid"),un("comes_from")),co_sections=un("subdivided_into_sections"),co_datasets=un("generates_dataset"),co_sampleType=un("sample_type"),co_sectionCount=(xn.DataFactory.literal("Tissue Block"),xn.DataFactory.literal("Tissue Section"),xn.DataFactory.literal("Non-standard"),un("section_count")),co_sectionSize=un("section_size"),co_sectionUnits=un("section_size_unit"),co_sectionNumber=un("section_number"),co_spatialEntity=un("has_registration_location"),co_technology=(un("has_ontology_term"),un("has_cell_type_term"),un("technology")),co_thumbnail=un("thumbnail"),md={x:un,base:or("base"),ontologyNode:{label:un("ccf_pref_label"),parent:un("ccf_part_of"),children:un("ccf_part_of"),rui_rank:un("rui_rank"),synonymLabels:xn.DataFactory.namedNode("http://www.geneontology.org/formats/oboInOwl#hasExactSynonym")},asctb:{part_of:un("ccf_part_of"),ct_is_a:un("ccf_ct_isa"),located_in:un("ccf_located_in"),characterizes:un("ccf_characterizes")},spatial:{Female:or("base")("VHFemale"),Male:or("base")("VHMale"),BothSexes:or("base")("VHBothSexes"),FemaleOrgans:or("base")("VHFemaleOrgans"),MaleOrgans:or("base")("VHMaleOrgans")},SpatialObjectReference:un("spatial_object_reference"),SpatialEntity:un("spatial_entity"),SpatialPlacement:un("spatial_placement"),spatialObjectReference:{file:un("file_url"),file_format:un("file_format"),file_subpath:un("file_subpath")},extractionSet:{label:or("rdfs")("label"),rui_rank:un("rui_rank")},spatialEntity:{label:or("rdfs")("label"),description:or("rdfs")("comment"),creator:or("dcterms")("creator"),creator_first_name:un("creator_first_name"),creator_last_name:un("creator_last_name"),creator_orcid:un("creator_orcid"),creation_date:or("dcterms")("created"),updated_date:un("updated_date"),ccf_annotations:un("collides_with"),representation_of:un("representation_of"),reference_organ:un("has_reference_organ"),extraction_set_for:un("extraction_set_for"),extraction_set:un("has_extraction_set"),sex:un("organ_owner_sex"),side:un("organ_side"),rui_rank:un("rui_rank"),slice_thickness:un("slice_thickness"),slice_count:un("slice_count"),x_dimension:un("x_dimension"),y_dimension:un("y_dimension"),z_dimension:un("z_dimension"),dimension_units:un("dimension_unit"),object:un("has_object_reference")},spatialPlacement:{source:un("placement_for"),target:un("placement_relative_to"),placement_date:or("dcterms")("created"),x_scaling:un("x_scaling"),y_scaling:un("y_scaling"),z_scaling:un("z_scaling"),scaling_units:un("scaling_unit"),x_rotation:un("x_rotation"),y_rotation:un("y_rotation"),z_rotation:un("z_rotation"),w_rotation:un("theta_rotation"),rotation_order:un("rotation_order"),rotation_units:un("rotation_unit"),x_translation:un("x_translation"),y_translation:un("y_translation"),z_translation:un("z_translation"),translation_units:un("translation_unit")}},ui={x:or("uberon"),body:or("uberon")("0013702")},YNe={x:or("cl"),cell:or("cl")("0000000")},Xb={x:or("fma")},X9=(or("lmha"),{body:ui.body,cell:YNe.cell,respiratory_system:ui.x("0001004"),colon:ui.x("0001155"),left_lung:ui.x("0002168"),right_lung:ui.x("0002167"),left_bronchus:ui.x("0002178"),right_bronchus:ui.x("0002177"),kidney:ui.x("0002113"),ureter:ui.x("0000056"),eye:ui.x("0000970"),fallopian_tube:ui.x("0003889"),knee:ui.x("0001465"),ovary:ui.x("0000992"),trachea:ui.x("0003126"),aorta:ui.x("0000947"),blood:ui.x("0000178"),bone_marrow:ui.x("0002371"),male_reproductive_system:ui.x("0000079"),lymph_node:ui.x("0000029"),blood_vasculature:ui.x("0004537"),brain:ui.x("0000955"),eye_left:ui.x("0004548"),eye_right:Xb.x("54449"),fallopian_tube_left:ui.x("0001303"),fallopian_tube_right:ui.x("0001302"),heart:ui.x("0000948"),kidney_left:ui.x("0004538"),kidney_right:ui.x("0004539"),knee_left:Xb.x("24978"),knee_right:Xb.x("24977"),large_intestine:ui.x("0000059"),liver:ui.x("0002107"),lungs:ui.x("0002048"),mesenteric_lymph_node:ui.x("0002509"),ovary_left:Xb.x("7214"),ovary_right:Xb.x("7213"),pancreas:ui.x("0001264"),pelvis:ui.x("0001270"),prostate_gland:ui.x("0002367"),skin:ui.x("0002097"),small_intestine:ui.x("0002108"),spleen:ui.x("0002106"),thymus:ui.x("0002370"),ureter_left:ui.x("0001223"),ureter_right:ui.x("0001222"),urinary_bladder:ui.x("0001255"),uterus:ui.x("0000995")});function BF(n){const e={};return Object.entries(n).forEach(([t,i])=>{e[i.id]=t}),e}BF(md.spatialObjectReference),BF(md.spatialEntity),BF(md.spatialPlacement),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"]);const zm=Object.freeze({OUTSIDE:-1,INTERSECTING:0,INSIDE:1}),Pr=(Math,Math,{});function cPe(n,{precision:e=Pr.precision||4}={}){return n=function(n){return Math.round(n/Pr.EPSILON)*Pr.EPSILON}(n),"".concat(parseFloat(n.toPrecision(e)))}function Ah(n){return Array.isArray(n)||ArrayBuffer.isView(n)&&!(n instanceof DataView)}function Zb(n,e,t){const i=Pr.EPSILON;t&&(Pr.EPSILON=t);try{if(n===e)return!0;if(Ah(n)&&Ah(e)){if(n.length!==e.length)return!1;for(let r=0;r0?", ":"")+cPe(this[i],e);return"".concat(e.printTypes?this.constructor.name:"","[").concat(t,"]")}equals(e){if(!e||this.length!==e.length)return!1;for(let t=0;t=0&&e=0&&e=a+s)return this.clone();if(s>=a+i)return e.clone();const l=.5*(i+a+s);return oq.copy(o).scale((-i+l)/a).add(t),this.center.copy(oq),this.radius=l,this}expand(e){const t=(e=Jb.from(e)).subtract(this.center).magnitude();return t>this.radius&&(this.radius=t),this}transform(e){this.center.transform(e);const t=function(n,e){var s=e[4],o=e[5],a=e[6],l=e[8],c=e[9],u=e[10];return n[0]=Math.hypot(e[0],e[1],e[2]),n[1]=Math.hypot(s,o,a),n[2]=Math.hypot(l,c,u),n}(Jb,e);return this.radius=Math.max(t[0],Math.max(t[1],t[2]))*this.radius,this}distanceSquaredTo(e){const t=this.distanceTo(e);return t*t}distanceTo(e){const t=(e=Jb.from(e)).subtract(this.center);return Math.max(0,t.len()-this.radius)}intersectPlane(e){const i=this.radius,s=e.normal.dot(this.center)+e.distance;return s<-i?zm.OUTSIDE:s0?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 u5(this,this,e),this.check()}rotateY(e){return d5(this,this,e),this.check()}rotateZ(e){return h5(this,this,e),this.check()}scale(e){return fR(this,this,e),this.check()}slerp(e,t,i){switch(arguments.length){case 1:({start:e=CPe,target:t,ratio:i}=arguments[0]);break;case 2:[t,i]=arguments,e=this}return J0(this,e,t,i),this.check()}transformVector4(e,t=e){return kU(t,e,this),tq(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)}}const APe=new Pn,TPe=new Pn,c1=new Pn,u1=new Pn,d1=new Pn,MPe=new Pn,DPe=new Pn;class GF{constructor(e=[0,0,0],t=[0,0,0,0,0,0,0,0,0]){this.center=(new Pn).from(e),this.halfAxes=new Xo(t)}get halfSize(){const e=this.halfAxes.getColumn(0),t=this.halfAxes.getColumn(1),i=this.halfAxes.getColumn(2);return[new Pn(e).len(),new Pn(t).len(),new Pn(i).len()]}get quaternion(){const e=this.halfAxes.getColumn(0),t=this.halfAxes.getColumn(1),i=this.halfAxes.getColumn(2),r=new Pn(e).normalize(),s=new Pn(t).normalize(),o=new Pn(i).normalize();return(new lq).fromMatrix3(new Xo([...r,...s,...o]))}fromCenterHalfSizeQuaternion(e,t,i){const r=new lq(i),s=(new Xo).fromQuaternion(r);return s[0]=s[0]*t[0],s[1]=s[1]*t[0],s[2]=s[2]*t[0],s[3]=s[3]*t[1],s[4]=s[4]*t[1],s[5]=s[5]*t[1],s[6]=s[6]*t[2],s[7]=s[7]*t[2],s[8]=s[8]*t[2],this.center=(new Pn).from(e),this.halfAxes=s,this}clone(){return new GF(this.center,this.halfAxes)}equals(e){return this===e||Boolean(e)&&this.center.equals(e.center)&&this.halfAxes.equals(e.halfAxes)}getBoundingSphere(e=new HF){const t=this.halfAxes,i=t.getColumn(0,c1),r=t.getColumn(1,u1),s=t.getColumn(2,d1),o=APe.copy(i).add(r).add(s);return e.center.copy(this.center),e.radius=o.magnitude(),e}intersectPlane(e){const t=this.center,i=e.normal,r=this.halfAxes,s=i.x,o=i.y,a=i.z,l=Math.abs(s*r[0]+o*r[1]+a*r[2])+Math.abs(s*r[3]+o*r[4]+a*r[5])+Math.abs(s*r[6]+o*r[7]+a*r[8]),c=i.dot(t)+e.distance;return c<=-l?zm.OUTSIDE:c>=l?zm.INSIDE:zm.INTERSECTING}distanceTo(e){return Math.sqrt(this.distanceSquaredTo(e))}distanceSquaredTo(e){const t=TPe.from(e).subtract(this.center),i=this.halfAxes,r=i.getColumn(0,c1),s=i.getColumn(1,u1),o=i.getColumn(2,d1),a=r.magnitude(),l=s.magnitude(),c=o.magnitude();r.normalize(),s.normalize(),o.normalize();let h,u=0;return h=Math.abs(t.dot(r))-a,h>0&&(u+=h*h),h=Math.abs(t.dot(s))-l,h>0&&(u+=h*h),h=Math.abs(t.dot(o))-c,h>0&&(u+=h*h),u}computePlaneDistances(e,t,i=[-0,-0]){let r=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY;const o=this.center,a=this.halfAxes,l=a.getColumn(0,c1),c=a.getColumn(1,u1),u=a.getColumn(2,d1),h=MPe.copy(l).add(c).add(u).add(o),p=DPe.copy(h).subtract(e);let g=t.dot(p);return r=Math.min(g,r),s=Math.max(g,s),h.copy(o).add(l).add(c).subtract(u),p.copy(h).subtract(e),g=t.dot(p),r=Math.min(g,r),s=Math.max(g,s),h.copy(o).add(l).subtract(c).add(u),p.copy(h).subtract(e),g=t.dot(p),r=Math.min(g,r),s=Math.max(g,s),h.copy(o).add(l).subtract(c).subtract(u),p.copy(h).subtract(e),g=t.dot(p),r=Math.min(g,r),s=Math.max(g,s),o.copy(h).subtract(l).add(c).add(u),p.copy(h).subtract(e),g=t.dot(p),r=Math.min(g,r),s=Math.max(g,s),o.copy(h).subtract(l).add(c).subtract(u),p.copy(h).subtract(e),g=t.dot(p),r=Math.min(g,r),s=Math.max(g,s),o.copy(h).subtract(l).subtract(c).add(u),p.copy(h).subtract(e),g=t.dot(p),r=Math.min(g,r),s=Math.max(g,s),o.copy(h).subtract(l).subtract(c).subtract(u),p.copy(h).subtract(e),g=t.dot(p),r=Math.min(g,r),s=Math.max(g,s),i[0]=r,i[1]=s,i}transform(e){this.center.transformAsPoint(e);const t=this.halfAxes.getColumn(0,c1);t.transformAsPoint(e);const i=this.halfAxes.getColumn(1,u1);i.transformAsPoint(e);const r=this.halfAxes.getColumn(2,d1);return r.transformAsPoint(e),this.halfAxes=new Xo([...t,...i,...r]),this}getTransform(){throw new Error("not implemented")}}const cq=new Pn,uq=new Pn;class $F{constructor(e=[0,0,1],t=0){this.normal=new Pn,this.distance=-0,this.fromNormalDistance(e,t)}fromNormalDistance(e,t){return Ec(Number.isFinite(t)),this.normal.from(e).normalize(),this.distance=t,this}fromPointNormal(e,t){e=cq.from(e),this.normal.from(t).normalize();const i=-this.normal.dot(e);return this.distance=i,this}fromCoefficients(e,t,i,r){return this.normal.set(e,t,i),Ec(Zb(this.normal.len(),1)),this.distance=r,this}clone(e){return new $F(this.normal,this.distance)}equals(e){return Zb(this.distance,e.distance)&&Zb(this.normal,e.normal)}getPointDistance(e){return this.normal.dot(e)+this.distance}transform(e){const t=uq.copy(this.normal).transformAsVector(e).normalize(),i=this.normal.scale(-this.distance).transform(e);return this.fromPointNormal(i,t)}projectPointOntoPlane(e,t=[0,0,0]){e=cq.from(e);const i=this.getPointDistance(e),r=uq.copy(this.normal).scale(i);return e.subtract(r).to(t)}}function bFe(n,e,t){const i={"@id":e,"@type":"OntologyTreeNode",id:e,parent:"",children:[],synonymLabels:[],label:""},r={[md.ontologyNode.label.id]:"label",[t]:"parent",[md.ontologyNode.synonymLabels.id]:"synonymLabels"};for(const[s,o]of function*(n,e,t){for(const[i,r]of Object.entries(t))for(const s of(0,xn.readQuads)(n,e,i,null,null)){const o="Literal"===s.object.termType?(0,Kb.fromRdf)(s.object):s.object.id;yield[r,o]}}(n,e,r))"synonymLabels"===s?i.synonymLabels.push(o):i[s]=o;return i.children=n.getSubjects(t,e,null).map(s=>s.id),i}function mq(n,e,t,i){const r={root:e,nodes:{}},s=new Set;for(const a of(0,xn.readQuads)(n,null,i,null,null))s.add(a.subject.id),s.add(a.object.id);for(const a of s)r.nodes[a]=bFe(n,a,i);r.nodes[e]||(r.nodes[e]={"@id":e,"@type":"OntologyTreeNode",id:e,label:t,children:[],synonymLabels:[]});const o=n.getSubjects(i,e,null).map(a=>a.id).sort((a,l)=>r.nodes[a].label.localeCompare(r.nodes[l].label));return r.nodes[e].children=o,_q(r),r}function _q(n,e,t=new Set){const i=n.nodes[null!=e?e:n.root];if(i){i.children=i.children.filter(r=>!t.has(r)),i.children.forEach(r=>t.add(r));for(const r of i.children)_q(n,r,t),n.nodes[r]&&(n.nodes[r].parent=i["@id"])}}new Pn([1,0,0]),new Pn([0,1,0]),new Pn([0,0,1]),new Pn,new Pn,new $F(new Pn(1,0,0),0),new Pn,new Pn,new Pn,new Pn,new Pn,new Pn,new Pn,new Pn,new Pn,new Pn,new Pn,new Pn,new Pn,new Pn,new Pn,new Pn,new Pn,Math,new Xo,new Xo,new Xo,new Xo,new Xo,new Pn,new Pn,new Pn,new Pn,new Pn,new Xo,new Xo,new Xo,(0,fr.memoize)(function(n){const e=mq(n,X9.body.id,"body",md.asctb.part_of.id);return e.nodes[X9.body.id].children=["http://purl.obolibrary.org/obo/UBERON_0000955","http://purl.obolibrary.org/obo/UBERON_0000029","http://purl.obolibrary.org/obo/UBERON_0000970","http://purl.obolibrary.org/obo/UBERON_0003889","http://purl.obolibrary.org/obo/UBERON_0000948","http://purl.obolibrary.org/obo/UBERON_0002113","http://purl.obolibrary.org/obo/UBERON_0001465","http://purl.obolibrary.org/obo/UBERON_0002107","http://purl.obolibrary.org/obo/UBERON_0002048","http://purl.obolibrary.org/obo/UBERON_0001911","http://purl.obolibrary.org/obo/UBERON_0000992","http://purl.obolibrary.org/obo/UBERON_0001264","http://purl.obolibrary.org/obo/UBERON_0001270","http://purl.obolibrary.org/obo/UBERON_0001987","http://purl.obolibrary.org/obo/UBERON_0002367","http://purl.obolibrary.org/obo/UBERON_0002097","http://purl.obolibrary.org/obo/UBERON_0002108","http://purl.obolibrary.org/obo/UBERON_0002240","http://purl.obolibrary.org/obo/UBERON_0000059","http://purl.obolibrary.org/obo/UBERON_0002106","http://purl.obolibrary.org/obo/UBERON_0002370","http://purl.obolibrary.org/obo/UBERON_0000056","http://purl.obolibrary.org/obo/UBERON_0001255","http://purl.obolibrary.org/obo/UBERON_0000995","http://purl.obolibrary.org/obo/UBERON_0004537"].filter(t=>t in e.nodes),e},()=>"");const p1={[co_label.id]:"label",[co_description.id]:"description",[co_link.id]:"link"};Object.assign(Object.assign({},p1),{[co_providerName.id]:"providerName"}),Object.assign(Object.assign({},p1),{[co_technology.id]:"technology",[co_thumbnail.id]:"thumbnail"}),Object.assign(Object.assign({},p1),{[co_sampleType.id]:"sampleType",[co_sectionNumber.id]:"sectionNumber",[co_datasets.id]:"datasets"}),Object.assign(Object.assign({},p1),{[co_sampleType.id]:"sampleType",[co_sectionCount.id]:"sectionCount",[co_sectionSize.id]:"sectionSize",[co_sectionUnits.id]:"sectionUnits",[co_donor.id]:"donor",[co_spatialEntity.id]:"spatialEntityId",[co_sections.id]:"sections",[co_datasets.id]:"datasets"});const 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"};function mu(n){return new Promise((e,t)=>{n.oncomplete=n.onsuccess=()=>e(n.result),n.onabort=n.onerror=()=>t(n.error)})}let ZF;function Sc(){return ZF||(ZF=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),mu(i)});return(i,r)=>t.then(s=>r(s.transaction(e,i).objectStore(e)))}(0,"keyval")),ZF}function vq(n,e=Sc()){return e("readonly",t=>mu(t.get(n)))}const g1="Unknown Euler angle order",$m=.99999;class Ji extends bS{static get ZYX(){return 0}static get YXZ(){return 1}static get XZY(){return 2}static get ZXY(){return 3}static get YZX(){return 4}static get XYZ(){return 5}static get RollPitchYaw(){return 0}static get DefaultOrder(){return Ji.ZYX}static get RotationOrders(){return["ZYX","YXZ","XZY","ZXY","YZX","XYZ"]}static rotationOrder(e){return Ji.RotationOrders[e]}get ELEMENTS(){return 4}constructor(e=0,t=0,i=0,r=Ji.DefaultOrder){super(-0,-0,-0,-0),arguments.length>0&&Array.isArray(arguments[0])?this.fromVector3(...arguments):this.set(e,t,i,r)}fromQuaternion(e){const[t,i,r,s]=e,o=i*i,a=-2*(o+r*r)+1,l=2*(t*i+s*r);let c=-2*(t*r-s*i);c=c>1?1:c,c=c<-1?-1:c;const p=Math.atan2(2*(i*r+s*t),-2*(t*t+o)+1),g=Math.asin(c),m=Math.atan2(l,a);return new Ji(p,g,m,Ji.RollPitchYaw)}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=Number.isFinite(e[3])||this.order,this.check()}set(e=0,t=0,i=0,r){return this[0]=e,this[1]=t,this[2]=i,this[3]=Number.isFinite(r)?r:this[3],this.check()}validate(){return function(n){return n>=0&&n<6}(this[3])&&Number.isFinite(this[0])&&Number.isFinite(this[1])&&Number.isFinite(this[2])}toArray(e=[],t=0){return e[t]=this[0],e[t+1]=this[1],e[t+2]=this[2],e}toArray4(e=[],t=0){return e[t]=this[0],e[t+1]=this[1],e[t+2]=this[2],e[t+3]=this[3],e}toVector3(e=[-0,-0,-0]){return e[0]=this[0],e[1]=this[1],e[2]=this[2],e}get x(){return this[0]}set x(e){this[0]=sr(e)}get y(){return this[1]}set y(e){this[1]=sr(e)}get z(){return this[2]}set z(e){this[2]=sr(e)}get alpha(){return this[0]}set alpha(e){this[0]=sr(e)}get beta(){return this[1]}set beta(e){this[1]=sr(e)}get gamma(){return this[2]}set gamma(e){this[2]=sr(e)}get phi(){return this[0]}set phi(e){this[0]=sr(e)}get theta(){return this[1]}set theta(e){this[1]=sr(e)}get psi(){return this[2]}set psi(e){this[2]=sr(e)}get roll(){return this[0]}set roll(e){this[0]=sr(e)}get pitch(){return this[1]}set pitch(e){this[1]=sr(e)}get yaw(){return this[2]}set yaw(e){this[2]=sr(e)}get order(){return this[3]}set order(e){this[3]=function(n){if(n<0&&n>=6)throw new Error(g1);return n}(e)}fromVector3(e,t){return this.set(e[0],e[1],e[2],Number.isFinite(t)?t:this[3])}fromArray(e,t=0){return this[0]=e[0+t],this[1]=e[1+t],this[2]=e[2+t],void 0!==e[3]&&(this[3]=e[3]),this.check()}fromRollPitchYaw(e,t,i){return this.set(e,t,i,Ji.ZYX)}fromRotationMatrix(e,t=Ji.DefaultOrder){return this._fromRotationMatrix(e,t),this.check()}getRotationMatrix(e){return this._getRotationMatrix(e)}getQuaternion(){const e=new gR;switch(this[4]){case Ji.XYZ:return e.rotateX(this[0]).rotateY(this[1]).rotateZ(this[2]);case Ji.YXZ:return e.rotateY(this[0]).rotateX(this[1]).rotateZ(this[2]);case Ji.ZXY:return e.rotateZ(this[0]).rotateX(this[1]).rotateY(this[2]);case Ji.ZYX:return e.rotateZ(this[0]).rotateY(this[1]).rotateX(this[2]);case Ji.YZX:return e.rotateY(this[0]).rotateZ(this[1]).rotateX(this[2]);case Ji.XZY:return e.rotateX(this[0]).rotateZ(this[1]).rotateY(this[2]);default:throw new Error(g1)}}_fromRotationMatrix(e,t=Ji.DefaultOrder){const i=e.elements,r=i[0],s=i[4],o=i[8],a=i[1],l=i[5],c=i[9],u=i[2],h=i[6],p=i[10];switch(t=t||this[3]){case Ji.XYZ:this[1]=Math.asin(Va(o,-1,1)),Math.abs(o)<$m?(this[0]=Math.atan2(-c,p),this[2]=Math.atan2(-s,r)):(this[0]=Math.atan2(h,l),this[2]=0);break;case Ji.YXZ:this[0]=Math.asin(-Va(c,-1,1)),Math.abs(c)<$m?(this[1]=Math.atan2(o,p),this[2]=Math.atan2(a,l)):(this[1]=Math.atan2(-u,r),this[2]=0);break;case Ji.ZXY:this[0]=Math.asin(Va(h,-1,1)),Math.abs(h)<$m?(this[1]=Math.atan2(-u,p),this[2]=Math.atan2(-s,l)):(this[1]=0,this[2]=Math.atan2(a,r));break;case Ji.ZYX:this[1]=Math.asin(-Va(u,-1,1)),Math.abs(u)<$m?(this[0]=Math.atan2(h,p),this[2]=Math.atan2(a,r)):(this[0]=0,this[2]=Math.atan2(-s,l));break;case Ji.YZX:this[2]=Math.asin(Va(a,-1,1)),Math.abs(a)<$m?(this[0]=Math.atan2(-c,l),this[1]=Math.atan2(-u,r)):(this[0]=0,this[1]=Math.atan2(o,p));break;case Ji.XZY:this[2]=Math.asin(-Va(s,-1,1)),Math.abs(s)<$m?(this[0]=Math.atan2(h,l),this[1]=Math.atan2(o,r)):(this[0]=Math.atan2(-c,p),this[1]=0);break;default:throw new Error(g1)}return this[3]=t,this}_getRotationMatrix(e){const t=e||[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],i=this.x,r=this.y,s=this.z,o=Math.cos(i),a=Math.cos(r),l=Math.cos(s),c=Math.sin(i),u=Math.sin(r),h=Math.sin(s);switch(this[3]){case Ji.XYZ:{const p=o*l,g=o*h,m=c*l,w=c*h;t[0]=a*l,t[4]=-a*h,t[8]=u,t[1]=g+m*u,t[5]=p-w*u,t[9]=-c*a,t[2]=w-p*u,t[6]=m+g*u,t[10]=o*a;break}case Ji.YXZ:{const p=a*l,g=a*h,m=u*l,w=u*h;t[0]=p+w*c,t[4]=m*c-g,t[8]=o*u,t[1]=o*h,t[5]=o*l,t[9]=-c,t[2]=g*c-m,t[6]=w+p*c,t[10]=o*a;break}case Ji.ZXY:{const p=a*l,g=a*h,m=u*l,w=u*h;t[0]=p-w*c,t[4]=-o*h,t[8]=m+g*c,t[1]=g+m*c,t[5]=o*l,t[9]=w-p*c,t[2]=-o*u,t[6]=c,t[10]=o*a;break}case Ji.ZYX:{const p=o*l,g=o*h,m=c*l,w=c*h;t[0]=a*l,t[4]=m*u-g,t[8]=p*u+w,t[1]=a*h,t[5]=w*u+p,t[9]=g*u-m,t[2]=-u,t[6]=c*a,t[10]=o*a;break}case Ji.YZX:{const p=o*a,g=o*u,m=c*a,w=c*u;t[0]=a*l,t[4]=w-p*h,t[8]=m*h+g,t[1]=h,t[5]=o*l,t[9]=-c*l,t[2]=-u*l,t[6]=g*h+m,t[10]=p-w*h;break}case Ji.XZY:{const p=o*a,g=o*u,m=c*a,w=c*u;t[0]=a*l,t[4]=-h,t[8]=u*l,t[1]=p*h+w,t[5]=o*l,t[9]=g*h-m,t[2]=m*h-g,t[6]=c*l,t[10]=w*h+p;break}default:throw new Error(g1)}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}toQuaternion(){const e=Math.cos(.5*this.yaw),t=Math.sin(.5*this.yaw),i=Math.cos(.5*this.roll),r=Math.sin(.5*this.roll),s=Math.cos(.5*this.pitch),o=Math.sin(.5*this.pitch);return new gR(e*r*s-t*i*o,e*i*o+t*r*s,t*i*s-e*r*o,e*i*s+t*r*o)}}var m1,FFe=new Uint8Array(16);function kFe(){if(!m1&&!(m1="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return m1(FFe)}const LFe=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,jFe=function(n){return"string"==typeof n&&LFe.test(n)};for(var ho=[],e2=0;e2<256;++e2)ho.push((e2+256).toString(16).substr(1));const HFe=function(n,e,t){var i=(n=n||{}).random||(n.rng||kFe)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,e){t=t||0;for(var r=0;r<16;++r)e[t+r]=i[r];return e}return function(n){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,t=(ho[n[e+0]]+ho[n[e+1]]+ho[n[e+2]]+ho[n[e+3]]+"-"+ho[n[e+4]]+ho[n[e+5]]+"-"+ho[n[e+6]]+ho[n[e+7]]+"-"+ho[n[e+8]]+ho[n[e+9]]+"-"+ho[n[e+10]]+ho[n[e+11]]+ho[n[e+12]]+ho[n[e+13]]+ho[n[e+14]]+ho[n[e+15]]).toLowerCase();if(!jFe(t))throw TypeError("Stringified UUID is invalid");return t}(i)};function*t2(n,e,t){for(const[i,r]of Object.entries(t))for(const s of(0,xn.readQuads)(n,e,i,null,null)){const o="Literal"===s.object.termType?(0,Kb.fromRdf)(s.object):s.object.id;yield[r,o]}}function dp(n,e,t,i){const r={"@id":e,"@type":t};for(const[s,o]of Object.entries(i))for(const a of(0,xn.readQuads)(n,r["@id"],s,null,null)){const l="Literal"===a.object.termType?(0,Kb.fromRdf)(a.object):a.object.id;r[o]=l}return r}const ar=xn.Util.prefixes({base:"http://purl.org/ccf/latest/ccf.owl#",ccf:"http://purl.org/ccf/",fma:"http://purl.org/sig/ont/fma/fma",obo:"http://purl.obolibrary.org/obo/",uberon:"http://purl.obolibrary.org/obo/UBERON_",cl:"http://purl.obolibrary.org/obo/CL_",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/",dcterms:"http://purl.org/dc/terms/"},xn.DataFactory),wq={x:ar("rdf"),type:ar("rdf")("type")},dn=(ar("rdfs"),ar("rdfs")("label"),ar("rdfs")("comment"),ar("rdfs")("isDefinedBy"),ar("rdfs")("seeAlso"),ar("ccf")),yi={id:ar("ccf")("has_registration_location"),label:ar("rdfs")("label"),description:ar("rdfs")("comment"),link:dn("url"),sex:dn("sex"),age:dn("age"),bmi:dn("bmi"),Male:xn.DataFactory.literal("Male"),Female:xn.DataFactory.literal("Female"),consortiumName:dn("consortium_name"),providerName:dn("tissue_provider_name"),providerUUID:dn("tissue_provider_uuid"),donor:dn("comes_from"),sections:dn("subdivided_into_sections"),datasets:dn("generates_dataset"),sampleType:dn("sample_type"),TissueBlock:xn.DataFactory.literal("Tissue Block"),TissueSection:xn.DataFactory.literal("Tissue Section"),NonStandard:xn.DataFactory.literal("Non-standard"),sectionCount:dn("section_count"),sectionSize:dn("section_size"),sectionUnits:dn("section_size_unit"),sectionNumber:dn("section_number"),spatialEntity:dn("has_registration_location"),ontologyTerms:dn("has_ontology_term"),cellTypeTerms:dn("has_cell_type_term"),technology:dn("technology"),thumbnail:dn("thumbnail")},ki={x:dn,base:ar("base"),ontologyNode:{label:dn("ccf_pref_label"),parent:dn("ccf_part_of"),children:dn("ccf_part_of"),rui_rank:dn("rui_rank"),synonymLabels:xn.DataFactory.namedNode("http://www.geneontology.org/formats/oboInOwl#hasExactSynonym")},asctb:{part_of:dn("ccf_part_of"),ct_is_a:dn("ccf_ct_isa"),located_in:dn("ccf_located_in"),characterizes:dn("ccf_characterizes")},spatial:{Female:ar("base")("VHFemale"),Male:ar("base")("VHMale"),BothSexes:ar("base")("VHBothSexes"),FemaleOrgans:ar("base")("VHFemaleOrgans"),MaleOrgans:ar("base")("VHMaleOrgans")},SpatialObjectReference:dn("spatial_object_reference"),SpatialEntity:dn("spatial_entity"),SpatialPlacement:dn("spatial_placement"),spatialObjectReference:{file:dn("file_url"),file_format:dn("file_format"),file_subpath:dn("file_subpath")},extractionSet:{label:ar("rdfs")("label"),rui_rank:dn("rui_rank")},spatialEntity:{label:ar("rdfs")("label"),description:ar("rdfs")("comment"),creator:ar("dcterms")("creator"),creator_first_name:dn("creator_first_name"),creator_last_name:dn("creator_last_name"),creator_orcid:dn("creator_orcid"),creation_date:ar("dcterms")("created"),updated_date:dn("updated_date"),ccf_annotations:dn("collides_with"),representation_of:dn("representation_of"),reference_organ:dn("has_reference_organ"),extraction_set_for:dn("extraction_set_for"),extraction_set:dn("has_extraction_set"),sex:dn("organ_owner_sex"),side:dn("organ_side"),rui_rank:dn("rui_rank"),slice_thickness:dn("slice_thickness"),slice_count:dn("slice_count"),x_dimension:dn("x_dimension"),y_dimension:dn("y_dimension"),z_dimension:dn("z_dimension"),dimension_units:dn("dimension_unit"),object:dn("has_object_reference")},spatialPlacement:{source:dn("placement_for"),target:dn("placement_relative_to"),placement_date:ar("dcterms")("created"),x_scaling:dn("x_scaling"),y_scaling:dn("y_scaling"),z_scaling:dn("z_scaling"),scaling_units:dn("scaling_unit"),x_rotation:dn("x_rotation"),y_rotation:dn("y_rotation"),z_rotation:dn("z_rotation"),w_rotation:dn("theta_rotation"),rotation_order:dn("rotation_order"),rotation_units:dn("rotation_unit"),x_translation:dn("x_translation"),y_translation:dn("y_translation"),z_translation:dn("z_translation"),translation_units:dn("translation_unit")}},di={x:ar("uberon"),body:ar("uberon")("0013702")},$Fe={x:ar("cl"),cell:ar("cl")("0000000")},nv={x:ar("fma")},bd=(ar("lmha"),{body:di.body,cell:$Fe.cell,respiratory_system:di.x("0001004"),colon:di.x("0001155"),left_lung:di.x("0002168"),right_lung:di.x("0002167"),left_bronchus:di.x("0002178"),right_bronchus:di.x("0002177"),kidney:di.x("0002113"),ureter:di.x("0000056"),eye:di.x("0000970"),fallopian_tube:di.x("0003889"),knee:di.x("0001465"),ovary:di.x("0000992"),trachea:di.x("0003126"),aorta:di.x("0000947"),blood:di.x("0000178"),bone_marrow:di.x("0002371"),male_reproductive_system:di.x("0000079"),lymph_node:di.x("0000029"),blood_vasculature:di.x("0004537"),brain:di.x("0000955"),eye_left:di.x("0004548"),eye_right:nv.x("54449"),fallopian_tube_left:di.x("0001303"),fallopian_tube_right:di.x("0001302"),heart:di.x("0000948"),kidney_left:di.x("0004538"),kidney_right:di.x("0004539"),knee_left:nv.x("24978"),knee_right:nv.x("24977"),large_intestine:di.x("0000059"),liver:di.x("0002107"),lungs:di.x("0002048"),mesenteric_lymph_node:di.x("0002509"),ovary_left:nv.x("7214"),ovary_right:nv.x("7213"),pancreas:di.x("0001264"),pelvis:di.x("0001270"),prostate_gland:di.x("0002367"),skin:di.x("0002097"),small_intestine:di.x("0002108"),spleen:di.x("0002106"),thymus:di.x("0002370"),ureter_left:di.x("0001223"),ureter_right:di.x("0001222"),urinary_bladder:di.x("0001255"),uterus:di.x("0000995")});function n2(n){const e={};return Object.entries(n).forEach(([t,i])=>{e[i.id]=t}),e}const _1={spatialObjectReference:n2(ki.spatialObjectReference),spatialEntity:n2(ki.spatialEntity),spatialPlacement:n2(ki.spatialPlacement)};function Eq(n,e){const t=dp(n,e,"ExtractionSet",_1.spatialEntity);return t.extractionSites=(0,fr.sortBy)(n.getSubjects(ki.spatialEntity.extraction_set,e,null).map(i=>hp(n,i.id)),["rui_rank"]),t}function hp(n,e){const t=dp(n,e,"SpatialEntity",_1.spatialEntity);return t.object&&(t.object=function(n,e){return dp(n,e,"SpatialObjectReference",_1.spatialObjectReference)}(n,t.object)),t.ccf_annotations&&(t.ccf_annotations=n.getObjects(e,ki.spatialEntity.ccf_annotations,null).map(i=>i.id)),n.forSubjects(i=>t.entityId=i.id,yi.spatialEntity,e,null),t}function XFe(n,e){const t=dp(n,e,"SpatialPlacement",_1.spatialPlacement);return t.source&&(t.source=hp(n,t.source)),t.target&&(t.target=hp(n,t.target)),t}function Sq(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(EV),o=[t.x_scaling,t.y_scaling,t.z_scaling];return n.translate(r).rotateXYZ(s).scale(o)}class xq{constructor(e){this.db=e,this.createGraph()}createGraph(){this.graph=new HNe.DirectedGraph;const e=this.db.store;e.forSubjects(i=>{this.addNode(i.id,"SpatialObjectReference")},wq.type,ki.SpatialObjectReference,null),e.forSubjects(i=>{this.addNode(i.id,"SpatialEntity")},wq.type,ki.SpatialEntity,null);const t={};for(const i of(0,xn.readQuads)(e,null,ki.spatialPlacement.source,null,null))t[i.subject.id]=i.object.id;for(const i of(0,xn.readQuads)(e,null,ki.spatialPlacement.target,null,null)){const r=t[i.subject.id];r&&this.addEdge(i.subject.id,r,i.object.id,"SpatialPlacement")}}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 qn(qn.IDENTITY);if(!this.graph.hasNode(e)||!this.graph.hasNode(t))return;const i=this.db.store,r=new qn(qn.IDENTITY),s=$Ne()(this.graph,e,t);if(s&&s.length>0){s.reverse();let o="";for(const a of s)o&&Sq(r,XFe(i,this.graph.getEdgeAttribute(a,o,"id"))),o=a;return r}}getSpatialPlacement(e,t){const i=this.graph.hasNode(e["@id"])?e["@id"]:void 0,r=(0,fr.get)(e,"placement[0]",(0,fr.get)(e,"placement",void 0));let s;if(r&&this.graph.hasNode(r.target)?(s=this.getTransformationMatrix(r.target,t),s&&(s=Sq(s,r))):i&&(s=this.getTransformationMatrix(i,t)),s){const o=(new Ji).fromRotationMatrix(s,Ji.XYZ),a=s.getTranslation().map(u=>1e3*u),l=o.toVector3().map(vse),c=s.getScale().map(u=>u<1&&u>.999999?1:u);return{"@context":"https://hubmapconsortium.github.io/hubmap-ontology/ccf-context.jsonld","@id":`http://purl.org/ccf/1.5/${HFe()}_placement`,"@type":"SpatialPlacement",source:e["@id"],target:t,placement_date:(new Date).toISOString().split("T")[0],x_scaling:c[0],y_scaling:c[1],z_scaling:c[2],scaling_units:"ratio",x_rotation:l[0],y_rotation:l[1],z_rotation:l[2],rotation_order:"XYZ",rotation_units:"degree",x_translation:a[0],y_translation:a[1],z_translation:a[2],translation_units:"millimeter"}}}}class Cq{constructor(e){this.db=e}getSpatialEntity(e){return hp(this.db.store,e)}getExtractionSets(e){return function(n,e){return(0,fr.sortBy)(n.getSubjects(ki.spatialEntity.extraction_set_for,e,null).map(t=>Eq(n,t.id)),["rui_rank"])}(this.db.store,e)}getExtractionSet(e){return Eq(this.db.store,e)}getAnatomicalStructures(e){return function(n,e){return(0,fr.sortBy)(n.getSubjects(ki.spatialEntity.reference_organ,e,null).map(t=>hp(n,t.id)).filter(t=>t["@id"]!==e),["rui_rank"])}(this.db.store,e)}getReferenceOrgans(){return function(n){const e=[];return n.forEach(t=>{t.subject.id===t.object.id&&e.push(hp(n,t.subject.id))},null,ki.spatialEntity.reference_organ,null,null),(0,fr.sortBy)(e,["rui_rank"])}(this.db.store)}getReferenceBody(e){let t;switch(null==e?void 0:e.sex){case"Male":t=ki.spatial.Male.id;break;case"Female":t=ki.spatial.Female.id;break;case"Both":default:t=ki.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),i=[];let r=[...this.getReferenceOrganSets(e).map(s=>{const o="http://purl.obolibrary.org/obo/UBERON_0002097"===s.representation_of,a=this.getSceneNode(s,t,{color:[255,255,255,255],opacity:o?.5:.2,unpickable:!0,_lighting:"pbr",zoomBasedOpacity:!o});return o&&a?void i.push(a):a})];return i.length>0&&(r=[...i,...r]),(null==e?void 0:e.debug)&&(r=r.concat([this.getSceneNode(this.getSpatialEntity(ki.base("VHRightKidney").id),t,{color:[0,0,255,127.5],geometry:"wireframe"}),this.getSceneNode(this.getSpatialEntity(ki.base("VHLeftKidney").id),t,{color:[255,0,0,127.5],geometry:"wireframe"}),this.getSceneNode(this.getSpatialEntity(ki.base("VHSpleenCC1").id),t,{color:[0,255,0,127.5],geometry:"wireframe"}),this.getSceneNode(this.getSpatialEntity(ki.base("VHSpleenCC2").id),t,{color:[0,255,0,127.5],geometry:"wireframe"}),this.getSceneNode(this.getSpatialEntity(ki.base("VHSpleenCC3").id),t,{color:[0,255,0,127.5],geometry:"wireframe"})])),r.filter(s=>void 0!==s)}getReferenceOrganScene(e,t){var i,r;const s=void 0!==(null==t?void 0:t.sex)&&"both"!==(null===(i=null==t?void 0:t.sex)||void 0===i?void 0:i.toLowerCase()),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"}),u=(null!==(r=this.db.getSpatialEntities(t))&&void 0!==r?r:[]).map(h=>this.getSceneNode(h,a,{color:[255,255,255,229.5]}));return[c].concat(u).filter(h=>void 0!==h)}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 u=this.db.graph.getTransformationMatrix(l&&e.object?e.object["@id"]:e["@id"],t["@id"]);if(u){if(l)u=new qn(qn.IDENTITY).rotateX(EV(90)).multiplyLeft(u);else{let h;switch(e.dimension_units){case"centimeter":h=.01;break;case"millimeter":h=.001;break;case"meter":default:h=1}const p=[e.x_dimension,e.y_dimension,e.z_dimension].map(g=>g*h/2);u.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:u,tooltip:e.label},i)}}getScene(e){return[...this.getReferenceSceneNodes(e),...this.getEntitySceneNodes(e)]}}const y1="https://entity.api.hubmapconsortium.org/entities/",Aq=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"]),ZFe={"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"},Wm={"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","5c106f29-ea2d-11e9-85e8-0efb3ba9a670":"RTI-General Electric","301615f9-c870-11eb-a8dc-35ce3d8786fe":"TMC-UConn"},Tq={"@base":"http://purl.org/ccf/latest/ccf-entity.owl#","@vocab":"http://purl.org/ccf/latest/ccf-entity.owl#",ccf:"http://purl.org/ccf/",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"},cellTypeTerms:{"@id":"has_cell_type_term","@type":"@id"},thumbnail:{"@id":"has_thumbnail"}};class t2e{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||[],u=(this.data.ancestors||[]).find(Be=>"Donor"===Be.entity_type);this.donor=this.getDonor(u,i);const h=this.getRuiLocation(e,this.donor);h?this.rui_location=h:this.bad=!0,Wm[e.group_uuid]||(Wm[e.group_uuid]=e.group_name);const p=new Date(e.last_modified_timestamp).toLocaleDateString(),g=Wm[e.group_uuid]||e.group_name,m=e.created_by_user_displayname;this["@id"]=y1+e.uuid,this.label=`Registered ${p}, ${m}, ${g}`,this.link=`${i}browse/sample/${e.uuid}`;const w={},C=[];this.sections=C;const H=[];this.datasets=H;for(const Be of c.filter(et=>"Sample"===et.entity_type)){const et=this.getSection(Be,e,i);w[Be.submission_id]=et,C.push(et),et.section_number=null!==(s=et.section_number)&&void 0!==s?s:C.length}for(const Be of c)if("Dataset"===Be.entity_type){const et=this.getDataset(Be,t,i,r),wt=(0,fr.get)(Be,["ingest_metadata","metadata","tissue_id"]);w[wt]?null===(o=w[wt].datasets)||void 0===o||o.push(et):H.push(et)}const U=null!=h?h:{},de=`${U.x_dimension} x ${U.y_dimension} x ${U.z_dimension} ${U.dimension_units}`;this.section_count=U.slice_count||C.length;const Ae=parseFloat((U.slice_thickness||(U.z_dimension||0)/Math.max(this.section_count,1)).toFixed(1));this.section_size=Ae;const Pe=U.dimension_units||"millimeter";this.section_units=Pe,this.description=`${de}, ${Ae} ${Pe}, ${e.specimen_type}, ${this.section_count} Sections`,C.forEach((Be,et)=>{Be.description=`${U.x_dimension} x ${U.y_dimension} x ${Ae} ${Pe}, ${Ae} ${Pe}, ${Be.description}`,Be.section_number=et+1})}getSection(e,t,i){const r=new Date(e.last_modified_timestamp).toLocaleDateString();return{"@id":y1+e.uuid,"@type":"Sample",label:`Registered ${r}, ${e.created_by_user_displayname}, ${Wm[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=Wm[e.group_uuid]||e.group_name,l=e.created_by_user_displayname,c=[...e.data_types,(0,fr.get)(e,["ingest_metadata","metadata","assay_type"],"")],u=c.join("|").toLowerCase();let h,p="assets/icons/ico-unknown.svg";return-1!==u.indexOf("10x")?(h="10x",p="assets/icons/ico-bulk-10x.svg"):-1!==u.indexOf("af")?(h="AF",p="assets/icons/ico-spatial-af.svg"):-1!==u.indexOf("codex")?(h="CODEX",p="assets/icons/ico-spatial-codex.svg"):-1!==u.indexOf("imc")?(h="IMC",p="assets/icons/ico-spatial-imc.svg"):-1!==u.indexOf("lc")&&-1===u.indexOf("af")?(h="LC",p="assets/icons/ico-bulk-lc.svg"):h=-1!==u.indexOf("maldi")?"MALDI":-1!==u.indexOf("pas")?"PAS":"OTHER",p=null!==(s=this.getDatasetThumbnail(e,t,r))&&void 0!==s?s:p,{"@id":y1+e.uuid,"@type":"Dataset",label:`Registered ${o}, ${l}, ${a}`,description:`Data/Assay Types: ${c.join(", ")}`,link:`${i}browse/dataset/${e.uuid}`,technology:h,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,fr.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=>Aq.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(Aq.has(s))return`assets/thumbnails/TMC-Vanderbilt/DR1/${s}`}}else if("07a29e4c-ed43-11e8-b56a-0e8017bdda58"===e.group_uuid){const r=ZFe[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,fr.toNumber)(s[1]));for(const p of(0,fr.get)(e,"metadata.organ_donor_data",(0,fr.get)(e,"metadata.living_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,fr.toNumber)(p.data_value):"Body mass index"===p.preferred_term&&(a=(0,fr.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(),u=Wm[e.group_uuid]||e.group_name;return{"@id":y1+e.uuid,"@type":"Donor",label:l,description:`Entered ${c}, ${e.created_by_user_displayname}, ${u}`,link:`${t}browse/donor/${e.uuid}`,age:o,sex:r,bmi:a,consortium_name:"HuBMAP",provider_name:u,provider_uuid:e.group_uuid,samples:[]}}getRuiLocation(e,t){var i;let r,s=e.rui_location;if(s&&("string"==typeof s&&(s=JSON.parse(s)),s.alignment_id?console.log("Detected a deprecated rui_location",e.uuid):s["@id"]&&(r=s)),r){const o=null!==(i=(0,fr.get)(r,["placement","target"]))&&void 0!==i?i:"";o.startsWith("http://purl.org/ccf/latest/ccf.owl#VHSpleenCC")?(0,fr.set)(r,["placement","target"],o.replace("#VHSpleenCC","Male"===t.sex?"#VHMSpleenCC":"#VHFSpleenCC")):("http://purl.org/ccf/latest/ccf.owl#VHLeftKidney"===o||"http://purl.org/ccf/latest/ccf.owl#VHRightKidney"===o)&&(0,fr.set)(r,["placement","target"],"Male"===t.sex?o.replace("#VH","#VHM")+"_Patch":o.replace("#VH","#VHF")+"_Patch")}return r}getTissueBlock(){return(0,fr.omit)(Object.assign({},this),["data","bad","donor"])}toJsonLd(){return Object.assign(Object.assign({},this.donor),{samples:[this.getTissueBlock()]})}}const i2e=["uuid","entity_type","group_uuid","group_name","last_modified_timestamp","created_by_user_displayname","ancestors.entity_type","ancestors.description","ancestors.metadata.organ_donor_data.preferred_term","ancestors.metadata.organ_donor_data.data_value","ancestors.metadata.living_donor_data.preferred_term","ancestors.metadata.living_donor_data.data_value","ancestors.last_modified_timestamp","ancestors.group_uuid","ancestors.group_name","ancestors.created_by_user_displayname","ancestors.uuid","descendants.entity_type","descendants.ingest_metadata.metadata.tissue_id","descendants.last_modified_timestamp","descendants.group_uuid","descendants.group_name","descendants.created_by_user_displayname","descendants.uuid","descendants.data_types","descendants.ingest_metadata.metadata.assay_type","descendants.thumbnail_file","descendants.metadata.files.rel_path","rui_location","specimen_type"],r2e={exists:{field:"rui_location"}};function Mq(n,e,t){return JSON.stringify({version:!0,from:n,size:e,stored_fields:["*"],script_fields:{},docvalue_fields:[],query:null!=t?t:r2e,_source:{includes:i2e}})}function r2(n,e){return Fi(this,void 0,void 0,function*(){try{const t=yield fetch(n,e);return t.ok?yield t.json():void 0}catch(t){return}})}function Dq(n,e,t,i,r="",s=""){return Fi(this,void 0,void 0,function*(){let o;if("static"===e?o=yield r2(n):"search-api"===e&&(o=yield function(n,e,t){return Fi(this,void 0,void 0,function*(){const i=250,r=function(n){const e=new Headers;return e.append("Content-type","application/json"),n&&e.append("Authorization",`Bearer ${n}`),e}(e),s=Mq(0,i,t),o=yield r2(n,{method:"POST",headers:r,body:s});if(!o)return;const a=o.hits.total.value;if(a<=i)return o;const l=[];for(let h=i;h!h))return;const u=c.map(h=>h.hits.hits);return Object.assign(Object.assign({},o),{hits:Object.assign(Object.assign({},o.hits),{hits:o.hits.hits.concat(...u)})})})}(n,i,t)),o)return function(n,e="",t="",i,r=!1){const o={},a=(0,fr.get)(n,"hits.hits",[]).map(c=>(0,fr.get)(c,"_source",{})).sort((c,u)=>c.uuid.localeCompare(u.uuid)).map(c=>new t2e(c,e,t,i).toJsonLd());for(const c of a){const u=c["@id"];o[u]?o[u].samples.push(c.samples[0]):o[u]=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":Tq},c)))),{"@context":Tq,"@graph":l}}(o,r,s,i);console.warn(`Unable to load ${n} as HuBMAP Data`)})}function iv(n,e,t){const i=new Set;for(const r of e)for(const s of(0,xn.readQuads)(n,r,t,null,null))i.add(s.object.id);return i}const u2e={[ki.spatialEntity.x_dimension.id]:"x",[ki.spatialEntity.y_dimension.id]:"y",[ki.spatialEntity.z_dimension.id]:"z"};function h2e(n,e,t,i){const r=e.getTransformationMatrix(t,i);let s;if(r){const o=r.getTranslation(),a=function(n,e){const t=dp(n,e,"Dimensions",u2e);return[t.x,t.y,t.z]}(n,t).map(c=>c/1e3/2),l=(new Ji).fromRotationMatrix(r,Ji.XYZ).toQuaternion().normalize().calculateW();s=(new GF).fromCenterHalfSizeQuaternion(o,a,l)}return s}function f2e(n,e,t,i){const{x:r,y:s,z:o,radius:a,target:l}=i,c=new Set,u=a/1e3*(a/1e3);for(const h of t){const p=h2e(n,e,h,l);p&&p.distanceSquaredTo([r,s,o].map(m=>m/1e3))<=u&&c.add(h)}return c}function b1(n,e,t){var i,r;const s=new Map,o=new Set;for(const c of e)for(const u of(0,xn.readQuads)(n,c,yi.donor,null,null))o.add(u.object.id),s.has(u.object.id)?null===(i=s.get(u.object.id))||void 0===i||i.push(c):s.set(u.object.id,[c]);const a=t(o),l=new Set;for(const c of a)for(const u of null!==(r=s.get(c))&&void 0!==r?r:[])l.add(u);return l}function s2(n,e,t){var i,r;const s=new Map,o=new Set;for(const c of e)for(const u of(0,xn.readQuads)(n,c,yi.spatialEntity,null,null))o.add(u.object.id),s.has(u.object.id)?null===(i=s.get(u.object.id))||void 0===i||i.push(c):s.set(u.object.id,[c]);const a=t(o),l=new Set;for(const c of a)for(const u of null!==(r=s.get(c))&&void 0!==r?r:[])l.add(u);return l}function rv(n,e){return function(t){n.has(t.id)&&e.add(t.id)}}function Iq(n,e,t){const i=new Set;for(const r of t){const s=xn.DataFactory.namedNode(r);n.forSubjects(rv(e,i),ki.spatialEntity.ccf_annotations,s,null)}return i}function Oq(n,e){const t=function(n,e){const t=new Map;for(const i of n)for(const r of(0,xn.readQuads)(e,i,yi.spatialEntity,null,null))t.has(r.object.id)?t.get(r.object.id).add(i):t.set(r.object.id,new Set([i]));return t}(n,e),i=new Map;for(const r of t.keys()){const s=t.get(r);for(const o of(0,xn.readQuads)(e,r,ki.spatialEntity.ccf_annotations,null,null))if(i.has(o.object.id)){const a=i.get(o.object.id);s.forEach(l=>a.add(l))}else i.set(o.object.id,new Set(s))}return i}function M2e(n,e,t){const i={"@id":e,"@type":"OntologyTreeNode",id:e,parent:"",children:[],synonymLabels:[],label:""},r={[ki.ontologyNode.label.id]:"label",[t]:"parent",[ki.ontologyNode.synonymLabels.id]:"synonymLabels"};for(const[s,o]of t2(n,e,r))"synonymLabels"===s?i.synonymLabels.push(o):i[s]=o;return i.children=n.getSubjects(t,e,null).map(s=>s.id),i}function Rq(n,e,t,i){const r={root:e,nodes:{}},s=new Set;for(const a of(0,xn.readQuads)(n,null,i,null,null))s.add(a.subject.id),s.add(a.object.id);for(const a of s)r.nodes[a]=M2e(n,a,i);r.nodes[e]||(r.nodes[e]={"@id":e,"@type":"OntologyTreeNode",id:e,label:t,children:[],synonymLabels:[]});const o=n.getSubjects(i,e,null).map(a=>a.id).sort((a,l)=>r.nodes[a].label.localeCompare(r.nodes[l].label));return r.nodes[e].children=o,Nq(r),r}function Nq(n,e,t=new Set){const i=n.nodes[null!=e?e:n.root];if(i){i.children=i.children.filter(r=>!t.has(r)),i.children.forEach(r=>t.add(r));for(const r of i.children)Nq(n,r,t),n.nodes[r]&&(n.nodes[r].parent=i["@id"])}}const Pq=(0,fr.memoize)(function(n){const e=Rq(n,bd.body.id,"body",ki.asctb.part_of.id);return e.nodes[bd.body.id].children=["http://purl.obolibrary.org/obo/UBERON_0000955","http://purl.obolibrary.org/obo/UBERON_0000029","http://purl.obolibrary.org/obo/UBERON_0000970","http://purl.obolibrary.org/obo/UBERON_0003889","http://purl.obolibrary.org/obo/UBERON_0000948","http://purl.obolibrary.org/obo/UBERON_0002113","http://purl.obolibrary.org/obo/UBERON_0001465","http://purl.obolibrary.org/obo/UBERON_0002107","http://purl.obolibrary.org/obo/UBERON_0002048","http://purl.obolibrary.org/obo/UBERON_0001911","http://purl.obolibrary.org/obo/UBERON_0000992","http://purl.obolibrary.org/obo/UBERON_0001264","http://purl.obolibrary.org/obo/UBERON_0001270","http://purl.obolibrary.org/obo/UBERON_0001987","http://purl.obolibrary.org/obo/UBERON_0002367","http://purl.obolibrary.org/obo/UBERON_0002097","http://purl.obolibrary.org/obo/UBERON_0002108","http://purl.obolibrary.org/obo/UBERON_0002240","http://purl.obolibrary.org/obo/UBERON_0000059","http://purl.obolibrary.org/obo/UBERON_0002106","http://purl.obolibrary.org/obo/UBERON_0002370","http://purl.obolibrary.org/obo/UBERON_0000056","http://purl.obolibrary.org/obo/UBERON_0001255","http://purl.obolibrary.org/obo/UBERON_0000995","http://purl.obolibrary.org/obo/UBERON_0004537"].filter(t=>t in e.nodes),e},()=>""),v1={[yi.label.id]:"label",[yi.description.id]:"description",[yi.link.id]:"link"},O2e=Object.assign(Object.assign({},v1),{[yi.providerName.id]:"providerName"}),R2e=Object.assign(Object.assign({},v1),{[yi.technology.id]:"technology",[yi.thumbnail.id]:"thumbnail"}),N2e=Object.assign(Object.assign({},v1),{[yi.sampleType.id]:"sampleType",[yi.sectionNumber.id]:"sectionNumber",[yi.datasets.id]:"datasets"}),P2e=Object.assign(Object.assign({},v1),{[yi.sampleType.id]:"sampleType",[yi.sectionCount.id]:"sectionCount",[yi.sectionSize.id]:"sectionSize",[yi.sectionUnits.id]:"sectionUnits",[yi.donor.id]:"donor",[yi.spatialEntity.id]:"spatialEntityId",[yi.sections.id]:"sections",[yi.datasets.id]:"datasets"});function F2e(n,e){return dp(n,e,"Donor",O2e)}function Fq(n,e){return dp(n,e,"Dataset",R2e)}function k2e(n,e){const t={"@id":e,"@type":"Sample",datasets:[]};for(const[i,r]of t2(n,e,N2e))if("datasets"===i){const s=Fq(n,r);t[i].push(s)}else t[i]=r;return t}class B2e{constructor(e){this.database=e,this.connect()}toJson(){return{status:this.status,message:this.message,checkback:"Ready"===this.status||"Error"===this.status?36e5:2e3,loadTime:this.loadTime}}connect(){this.status="Loading",this.message="Loading database";const e=Date.now();return this.database.connect().then(t=>Fi(this,void 0,void 0,function*(){t?(this.message="Building scene",yield this.database.getScene(),this.message="Building tissue block results",yield this.database.getTissueBlockResults(),this.message="Aggregating results",yield this.database.getAggregateResults(),this.status="Ready",this.message="Database successfully loaded"):(this.status="Error",this.message="Unknown error while loading database")})).catch(t=>{var i;this.status="Error",this.message=null!==(i=null==t?void 0:t.message)&&void 0!==i?i:"Unknown error while loading database"}).finally(()=>{this.loadTime=Date.now()-e})}}const j2e={"@context":{"@base":"http://purl.org/ccf/","@vocab":"http://purl.org/ccf/",ccf:"http://purl.org/ccf/",rdfs:"http://www.w3.org/2000/01/rdf-schema#",dcterms:"http://purl.org/dc/terms/",label:"rdfs:label",description:"rdfs:comment",link:"ccf:url",sex:"ccf:sex",age:"ccf:age",bmi:"ccf:bmi",consortium_name:"ccf:consortium_name",provider_name:"ccf:tissue_provider_name",provider_uuid:"ccf:tissue_provider_uuid",donor:{"@id":"ccf:comes_from","@type":"@id"},samples:{"@reverse":"donor"},sections:{"@id":"ccf:subdivided_into_sections","@type":"@id"},datasets:{"@id":"ccf:generates_dataset","@type":"@id"},sample_type:"ccf:sample_type",section_count:"ccf:section_count",section_size:"ccf:section_size",section_units:"ccf:section_size_unit",section_number:"ccf:section_number",rui_location:{"@id":"ccf:has_registration_location","@type":"@id"},ccf_annotations:{"@id":"ccf:collides_with","@type":"@id","@container":"@set"},representation_of:{"@id":"ccf:representation_of","@type":"@id"},reference_organ:{"@id":"ccf:has_reference_organ","@type":"@id"},extraction_set_for:{"@id":"ccf:extraction_set_for","@type":"@id"},extraction_set:{"@id":"ccf:has_extraction_set","@type":"@id"},organ_owner_sex:"ccf:organ_owner_sex",side:"ccf:organ_side",rui_rank:"ccf:rui_rank",slice_thickness:"ccf:slice_thickness",slice_count:"ccf:slice_count",object:{"@id":"ccf:has_object_reference","@type":"@id"},creation_date:"dcterms:created",updated_date:"ccf:updated_date",creator:"dcterms:creator",creator_first_name:"ccf:creator_first_name",creator_last_name:"ccf:creator_last_name",placement:{"@reverse":"ccf:placement_for"},placement_date:"dcterms:created",rotation_order:"ccf:rotation_order",dimension_units:"ccf:dimension_unit",rotation_units:"ccf:rotation_unit",scaling_units:"ccf:scaling_unit",translation_units:"ccf:translation_unit",source:{"@id":"ccf:placement_for","@type":"@id"},target:{"@id":"ccf:placement_relative_to","@type":"@id"},x_rotation:"ccf:x_rotation",y_rotation:"ccf:y_rotation",z_rotation:"ccf:z_rotation",x_scaling:"ccf:x_scaling",y_scaling:"ccf:y_scaling",z_scaling:"ccf:z_scaling",x_translation:"ccf:x_translation",y_translation:"ccf:y_translation",z_translation:"ccf:z_translation",x_dimension:"ccf:x_dimension",y_dimension:"ccf:y_dimension",z_dimension:"ccf:z_dimension",ontology_terms:{"@id":"ccf:has_ontology_term","@type":"@id"},technology:"ccf:technology",thumbnail:"ccf:thumbnail",file:"ccf:file_url",file_format:"ccf:file_format",file_subpath:"ccf:file_subpath"}};function o2(n){return JSON.parse(n,(e,t)=>"ccf_annotations"===e&&Array.isArray(t)?t.map(i=>(null==i?void 0:i.startsWith("http://purl.obolibrary.org/obo/FMA_"))?i.replace("http://purl.obolibrary.org/obo/FMA_","http://purl.org/sig/ont/fma/fma"):i):"@context"!==e||!t||"https://hubmapconsortium.github.io/hubmap-ontology/ccf-entity-context.jsonld"!==t&&"https://hubmapconsortium.github.io/hubmap-ontology/ccf-context.jsonld"!==t&&"https://hubmapconsortium.github.io/ccf-ontology/ccf-context.jsonld"!==t&&"http://purl.org/ccf/latest/ccf-entity.owl#"!==t["@base"]?t:j2e)}const U2e={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 z2e{constructor(e=U2e){this.options=e,this.store=new xn.Store(void 0,{factory:xn.DataFactory}),this.graph=new xq(this),this.scene=new Cq(this)}connect(e,t=!1){return Fi(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 Fi(this,void 0,void 0,function*(){const e=(new Date).getTime(),t="ccf-database.last_modified",i="ccf-database",r=yield vq(t).catch(()=>{});let s;r&&e-new Date(+r).getTime()>36e5?yield function(n,e=Sc()){return e("readwrite",t=>(n.forEach(i=>t.delete(i)),mu(t.transaction)))}([i,t]).catch(()=>{}):s=yield vq(i).catch(()=>{}),s?yield this.deserialize(s):(yield this.doConnect(),function(n,e=Sc()){return e("readwrite",t=>(n.forEach(i=>t.put(i[1],i[0])),mu(t.transaction)))}([[i,this.serialize()],[t,""+e]]).catch(()=>{}))})}doConnect(){var e,t;return Fi(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.startsWith("{"))this.store=(0,xn.deserializeN3Store)(s,xn.DataFactory);else 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,xn.deserializeN3Store)(o,xn.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(Dq(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 Fi(this,void 0,void 0,function*(){const i=null!=t?t:this.store;return yield Promise.all(e.map(r=>Fi(this,void 0,void 0,function*(){"string"==typeof r?(r.startsWith("http")||r.startsWith("assets/"))&&r.includes("jsonld")?(r=o2(r=yield fetch(r).then(s=>s.text())),yield(0,xn.addJsonLdToStore)(r,i)):r.endsWith("n3")?yield(0,xn.addN3ToStore)(r,i):r.endsWith("rdf")||r.endsWith("owl")||r.endsWith("xml")?yield(0,xn.addRdfXmlToStore)(r,i):(r=o2(r),yield(0,xn.addJsonLdToStore)(r,i)):(r=o2(JSON.stringify(r)),yield(0,xn.addJsonLdToStore)(r,i))}))),this})}synchronize(){return Fi(this,void 0,void 0,function*(){return yield new Promise(e=>{setTimeout(e,500)}),this.graph.createGraph(),function(n){var e,t,i;const r=Pq(n),s=new Map;for(const{subject:o,object:a}of(0,xn.readQuads)(n,null,ki.spatialEntity.representation_of,null,null)){const l=new Set([a.id]);let c=null===(e=r.nodes[a.id])||void 0===e?void 0:e.parent;for(;c&&!l.has(c);)l.add(c),c=null===(t=r.nodes[c])||void 0===t?void 0:t.parent;s.set(o.id,[...l].map(u=>xn.DataFactory.namedNode(u)))}for(const{object:o}of(0,xn.readQuads)(n,null,yi.spatialEntity,null,null))for(const{subject:a}of(0,xn.readQuads)(n,null,ki.spatialPlacement.source,o,null))for(const{object:l}of(0,xn.readQuads)(n,a,ki.spatialPlacement.target,null,null))for(const c of null!==(i=s.get(l.id))&&void 0!==i?i:[])n.addQuad(xn.DataFactory.namedNode(o.id),ki.spatialEntity.ccf_annotations,c)}(this.store),this})}serialize(){return(0,xn.serializeN3Store)(this.store)}deserialize(e){return Fi(this,void 0,void 0,function*(){this.store=(0,xn.deserializeN3Store)(e,xn.DataFactory),this.graph=new xq(this),this.scene=new Cq(this),yield new Promise(t=>{setTimeout(t,10)})})}getIds(e={}){return function(n,e,t){var i,r,s,o,a,l,c;let u=function(n){const e=new Set;return n.forSubjects(t=>e.add(t.id),yi.spatialEntity,null,null),e}(n);if(u.size>0&&(u=function(n,e,t=!0){const i=new Set;if(n.forSubjects(rv(e,i),yi.spatialEntity,null,null),!t){const r=new Set;return e.forEach(s=>i.has(s)?void 0:r.add(s)),r}return i}(n,u)),u.size>0&&("Male"===t.sex||"Female"===t.sex)){const h=t.sex;u=b1(n,u,p=>function(n,e,t){const i=new Set;return n.forSubjects(rv(e,i),yi.sex,yi[t],null),i}(n,p,h))}if(u.size>0&&(null===(i=t.tmc)||void 0===i?void 0:i.length)>0&&(u=b1(n,u,h=>function(n,e,t){const i=new Set;for(const r of t){const s=xn.DataFactory.literal(r);n.forSubjects(rv(e,i),yi.providerName,s,null)}return i}(n,h,t.tmc))),u.size>0&&(null===(r=t.technologies)||void 0===r?void 0:r.length)>0&&(u=function(n,e,t){var i,r;const s=new Map,o=new Set,a=new Set(e);for(const u of e)for(const h of(0,xn.readQuads)(n,u,yi.sections,null,null))a.add(h.object.id);for(const u of a)for(const h of(0,xn.readQuads)(n,u,yi.datasets,null,null))o.add(h.object.id),s.has(h.object.id)?null===(i=s.get(h.object.id))||void 0===i||i.push(u):s.set(h.object.id,[u]);const l=t(o),c=new Set;for(const u of l)for(const h of null!==(r=s.get(u))&&void 0!==r?r:[])c.add(h);return c}(n,u,h=>function(n,e,t){const i=new Set;for(const r of t){const s=xn.DataFactory.literal(r);n.forSubjects(rv(e,i),yi.technology,s,null)}return i}(n,h,t.technologies))),u.size>0&&(null===(s=t.spatialSearches)||void 0===s?void 0:s.length)>0&&(u=s2(n,u,h=>function(n,e,t,i){const r=new Set;for(const s of i)f2e(n,e,t,s).forEach(a=>r.add(a));return r}(n,e,h,t.spatialSearches))),u.size>0&&(null===(o=t.ontologyTerms)||void 0===o?void 0:o.length)>0){const h=t.ontologyTerms;-1===h.indexOf(bd.body.id)&&(u=s2(n,u,p=>Iq(n,p,h)))}if(u.size>0&&(null===(a=t.cellTypeTerms)||void 0===a?void 0:a.length)>0){const h=t.cellTypeTerms;-1===h.indexOf(bd.cell.id)&&(u=s2(n,u,p=>function(n,e,t){const i=new Set;for(const r of t)n.forObjects(s=>{i.add(s.id)},r,ki.asctb.located_in,null),r===bd.cell.id&&i.add(bd.body.id);return Iq(n,e,[...i])}(n,p,h)))}if(u.size>0&&2===(null===(l=t.ageRange)||void 0===l?void 0:l.length)&&(0,fr.isFinite)(t.ageRange[0])&&(0,fr.isFinite)(t.ageRange[1])){const h=Math.max(...t.ageRange),p=Math.min(...t.ageRange);1===p&&110===h||(u=b1(n,u,g=>function(n,e,t,i){const r=new Set;for(const s of e)for(const o of(0,xn.readQuads)(n,s,yi.age,null,null)){const a=(0,Kb.fromRdf)(o.object);a>=t&&a<=i&&r.add(s)}return r}(n,g,p,h)))}if(u.size>0&&2===(null===(c=t.bmiRange)||void 0===c?void 0:c.length)&&(0,fr.isFinite)(t.bmiRange[0])&&(0,fr.isFinite)(t.bmiRange[1])){const h=Math.max(...t.bmiRange),p=Math.min(...t.bmiRange);13===p&&83===h||(u=b1(n,u,g=>function(n,e,t,i){const r=new Set;for(const s of e)for(const o of(0,xn.readQuads)(n,s,yi.bmi,null,null)){const a=(0,Kb.fromRdf)(o.object);a>=t&&a<=i&&r.add(s)}return r}(n,g,p,h)))}return u}(this.store,this.graph,e)}get(e){return this.store.getQuads(xn.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=>function(n,e){const t=n.getObjects(xn.DataFactory.namedNode(e),yi.spatialEntity,null);if(t.length>0)return hp(n,t[0].id)}(this.store,t))}getDatabaseStatus(){return Fi(this,void 0,void 0,function*(){return this.status||(this.status=new B2e(this)),this.status.toJson()})}getDatasetTechnologyNames(){return Fi(this,void 0,void 0,function*(){return function(n){const e=new Set;for(const t of(0,xn.readQuads)(n,null,yi.technology,null,null))e.add(t.object.value);return Array.from(e).sort()}(this.store)})}getProviderNames(){return Fi(this,void 0,void 0,function*(){return function(n){const e=new Set;for(const t of(0,xn.readQuads)(n,null,yi.providerName,null,null))e.add(t.object.value);return Array.from(e).sort()}(this.store)})}getTissueBlockResults(e){return Fi(this,void 0,void 0,function*(){return e=Object.assign(Object.assign({},e),{hasSpatialEntity:!0}),[...this.getIds(e)].map(t=>function(n,e){const t={"@id":e,"@type":"Sample",sections:[],datasets:[]};for(const[i,r]of t2(n,e,P2e))if("sections"===i){const s=k2e(n,r);t[i].push(s)}else if("datasets"===i){const s=Fq(n,r);t[i].push(s)}else t[i]="donor"===i?F2e(n,r):r;return t}(this.store,t))})}getAggregateResults(e){return Fi(this,void 0,void 0,function*(){return function(n,e){const t=iv(e,n,yi.donor.id),i=iv(e,t,yi.providerUUID.id),r=new Set;for(const l of n)for(const c of(0,xn.readQuads)(e,l,yi.spatialEntity,null,null))r.add(c.subject.id);const s=iv(e,r,yi.sections.id),o=new Set([...iv(e,r,yi.datasets.id),...iv(e,s,yi.datasets.id)]);return 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 Fi(this,void 0,void 0,function*(){return function(n,e){const t={};return Oq(n,e).forEach((r,s)=>{t[s]=r.size}),t}(this.getIds(e),this.store)})}getCellTypeTermOccurences(e){return Fi(this,void 0,void 0,function*(){return function(n,e){var t,i;const r=Oq(n,e),s=new Map;for(const a of r.keys()){const l=r.get(a);for(const c of(0,xn.readQuads)(e,null,ki.asctb.located_in,a,null)){const u=c.subject.id;if(s.has(u)){const h=s.get(u);l.forEach(p=>h.add(p))}else s.set(u,new Set(l))}}const o={};return s.forEach((a,l)=>{o[l]=a.size}),o[bd.cell.id]=null!==(i=null===(t=r.get(bd.body.id))||void 0===t?void 0:t.size)&&void 0!==i?i:0,o}(this.getIds(e),this.store)})}getOntologyTreeModel(){return Fi(this,void 0,void 0,function*(){return Pq(this.store)})}getCellTypeTreeModel(){return Fi(this,void 0,void 0,function*(){return function(n){return Rq(n,bd.cell.id,"cell",ki.asctb.ct_is_a.id)}(this.store)})}getReferenceOrgans(){return Fi(this,void 0,void 0,function*(){return this.scene.getReferenceOrgans()})}getScene(e){return Fi(this,void 0,void 0,function*(){return this.graph.createGraph(),this.scene.getScene(e)})}getReferenceOrganScene(e,t){return Fi(this,void 0,void 0,function*(){return this.graph.createGraph(),this.scene.getReferenceOrganScene(e,t)})}getSpatialPlacement(e,t){return Fi(this,void 0,void 0,function*(){return this.graph.getSpatialPlacement(e,t)})}}function W2e(n,e){return n===e}let q2e=(()=>{class n{constructor(t,i){this.locator=t,this.globalConfig=i,this.subscriptions=new x,this.dataSource=i.getOption("data").pipe(me(r=>Object.assign(Object.assign({},bq),{dataSources:r})),Qi(r=>Object.keys(r).length>0),me(r=>r),rd(W2e),Ir(r=>function(n,e){return new I(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?je(r):Yc).subscribe(t);return()=>{o.unsubscribe(),i&&i.unsubscribe()}})}(()=>this.createDataSource(),s=>this.connectDataSource(s.source,r))),$a(1)),this.subscriptions.add(this.dataSource.subscribe())}ngOnDestroy(){this.subscriptions.unsubscribe()}getTissueBlockResults(t){return this.dataSource.pipe(Ir(i=>i.getTissueBlockResults(t)),Wi(1))}getAggregateResults(t){return this.dataSource.pipe(Ir(i=>i.getAggregateResults(t)),Wi(1))}getOntologyTermOccurences(t){return this.dataSource.pipe(Ir(i=>i.getOntologyTermOccurences(t)),Wi(1))}getCellTypeTermOccurences(t){return this.dataSource.pipe(Ir(i=>i.getCellTypeTermOccurences(t)),Wi(1))}getOntologyTreeModel(){return this.dataSource.pipe(Ir(t=>t.getOntologyTreeModel()),Wi(1))}getCellTypeTreeModel(){return this.dataSource.pipe(Ir(t=>t.getCellTypeTreeModel()),Wi(1))}getReferenceOrgans(){return this.dataSource.pipe(Ir(t=>t.getReferenceOrgans()),Wi(1))}getScene(t){return this.dataSource.pipe(Ir(i=>i.getScene(t)),Wi(1))}getOrganScene(t,i){return this.dataSource.pipe(Ir(r=>r.getReferenceOrganScene(t,i)),Wi(1))}createDataSource(){return{source:new z2e,unsubscribe:()=>{}}}connectDataSource(t,i){return Fi(this,void 0,void 0,function*(){const r=(new Date).getTime();return yield t.connect(i,!1),m0.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)(Oe(Cf),Oe(Yb))},n.\u0275prov=We({token:n,factory:n.\u0275fac,providedIn:"root"}),n})(),Y2e=(()=>{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$=Yo([this.data$,this.referenceOrgans$,this.source.dataSource]).pipe(Ir(([r,s,o])=>this.chooseScene(r,s))),this.organs$=this.configState.getOption("data").pipe(me(r=>this.selectOrgans(r)),$a(1)),this.filteredOrgans$=Yo([this.organs$,this.referenceOrgans$]).pipe(me(([r,s])=>this.getNeededReferenceOrgans(s,r)),$a(1)),this.filteredScene$=Yo([this.scene$,this.organs$,this.referenceOrgans$]).pipe(me(([r,s,o])=>this.filterSceneNodes(r,s,o)),function(n,e){const t=n.pipe(ao(""));return i=>Yo([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$,BNe),function(n){const e=n.pipe(ao(""));return t=>Yo([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$),$a(1))}chooseScene(t,i){var r;const s=null!==(r=null==t?void 0:t.map(a=>{const l=a[K9];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 fn([])}selectOrgans(t){const r=(null!=t?t:[]).map(s=>s[K9].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)(Oe(Yb),Oe(q2e))},n.\u0275prov=We({token:n,factory:n.\u0275fac,providedIn:"root"}),n})();const K2e=["bodyUI"];let X2e=(()=>{class n{constructor(t,i,r){this.configState=t,this.sceneSource=i,this.cdr=r,this.onMouseEnter=new sn,this.onMouseLeave=new sn,this.onClick=new sn,this.data$=this.configState.getOption("data"),this.organs$=this.sceneSource.filteredOrgans$,this.scene$=this.sceneSource.filteredScene$.pipe(Yr(s=>this.reset()))}reset(){var t,i;return Fi(this,void 0,void 0,function*(){const{bodyUI:r}=this;yield new Promise(a=>setTimeout(a,200));const s=yield this.organs$.pipe(Wi(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)(xe(Yb),xe(Y2e),xe(Dr))},n.\u0275cmp=ln({type:n,selectors:[["ccf-root"]],viewQuery:function(t,i){if(1&t&&ss(K2e,7),2&t){let r;ii(r=ri())&&(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&&(Pt(0,"ccf-body-ui",0,1),Un("nodeClick",function(s){return i.onClick.emit(s)})("nodeHoverStart",function(s){return i.onMouseEnter.emit(s)})("nodeHoverStop",function(s){return i.onMouseLeave.emit(s)}),xl(2,"async"),Ft()),2&t&&rn("scene",Vu(2,2,i.scene$))("interactive",!0)},directives:[nNe],pipes:[h0],styles:[".body-ui[_ngcontent-%COMP%]{height:100%;width:100%}"],changeDetection:0}),n})();function Q2e(n,e){if(1&n){const t=jt();Pt(0,"ccf-root",1),Un("onMouseEnter",function(r){return Cr(t),ci().onMouseEnter.emit(r)})("onMouseLeave",function(r){return Cr(t),ci().onMouseLeave.emit(r)})("onClick",function(r){return Cr(t),ci().onClick.emit(r)}),Ft()}}function Z2e(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 J2e=(()=>{class n extends Eie{constructor(t,i){super(t,i,{initialDelay:10,initialConfig:Object.assign(Object.assign({},m0.dbOptions),globalThis.dbOptions),parse:{data:Z2e}}),this.onMouseEnter=new sn,this.onMouseLeave=new sn,this.onClick=new sn}}return n.\u0275fac=function(t){return new(t||n)(xe(Yb),xe(Dr))},n.\u0275cmp=ln({type:n,selectors:[["ccf-root-wc"]],inputs:{data:"data",highlightID:"highlightID",zoomToID:"zoomToID"},outputs:{onMouseEnter:"onMouseEnter",onMouseLeave:"onMouseLeave",onClick:"onClick"},features:[An],decls:1,vars:1,consts:[[3,"onMouseEnter","onMouseLeave","onClick",4,"ngIf"],[3,"onMouseEnter","onMouseLeave","onClick"]],template:function(t,i){1&t&&Di(0,Q2e,1,0,"ccf-root",0),2&t&&rn("ngIf",i.initialized)},directives:[lc,X2e],encapsulation:2,changeDetection:0}),n})(),eke=(()=>{class n{constructor(t,i){this.accessor=t,this.injector=i}static forRoot(t=[]){return{ngModule:n,providers:[ps,Za,hW,...t]}}}return n.\u0275fac=function(t){return new(t||n)(Oe(ps,2),Oe(Za,2))},n.\u0275mod=on({type:n}),n.\u0275inj=xt({}),n})();const x1=(n,e)=>((n,e)=>new Array(e+1).join("0"))(0,e-n.toString().length)+n;class ike{constructor(e,t,i){this.action=e,this.store=t,this.logWriter=i}dispatched(e){const t=$f(this.action),i=function(n){return x1(n.getHours(),2)+":"+x1(n.getMinutes(),2)+":"+x1(n.getSeconds(),2)+"."+x1(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 rke{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 kq=new Ht("NGXS_LOGGER_PLUGIN_OPTIONS");let ske=(()=>{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 rke(this._options),this._store=this._store||this._injector.get(cu);const s=new ike(i,this._store,this._logWriter);return s.dispatched(t),r(t,i).pipe(Yr(o=>{s.completed(o)}),bc(o=>{throw s.errored(o),o}))}}return n.\u0275fac=function(t){return new(t||n)(Oe(kq),Oe(Wn))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const Lq=new Ht("LOGGER_USER_OPTIONS");function oke(n){return Object.assign({},{logger:console,collapsed:!1,disabled:!1,filter:()=>!0},n)}let ake=(()=>{class n{static forRoot(t){return{ngModule:n,providers:[{provide:f6,useClass:ske,multi:!0},{provide:Lq,useValue:t},{provide:kq,useFactory:oke,deps:[Lq]}]}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=on({type:n}),n.\u0275inj=xt({}),n})();const lke=[Yb];let cke=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=on({type:n}),n.\u0275inj=xt({imports:[[eke.forRoot(),Wo.forRoot(lke,{developmentMode:!m0.production}),ake.forRoot({disabled:m0.production})]]}),n})(),uke=(()=>{class n{constructor(t){this.injector=t}ngDoBootstrap(){const t=function(n,e){const t=function(n,e){return e.get(wl).resolveComponentFactory(n).inputs}(n,e.injector),i=e.strategyFactory||new mie(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 yie{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,u){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}(J2e,{injector:this.injector});customElements.define("ccf-body-ui-wc",t)}}return n.\u0275fac=function(t){return new(t||n)(Oe(Wn))},n.\u0275mod=on({type:n}),n.\u0275inj=xt({providers:[],imports:[[WD,cke,iNe]]}),n})();m0.production&&function(){if(lB)throw new Error("Cannot enable prod mode after platform setup.");aB=!1}(),jne().bootstrapModule(uke).catch(n=>console.error(n))},52:Ut=>{function it(yt,ee,Tt,dt,Y,Se,he){try{var W=yt[Se](he),j=W.value}catch(P){return void Tt(P)}W.done?ee(j):Promise.resolve(j).then(dt,Y)}Ut.exports=function(yt){return function(){var ee=this,Tt=arguments;return new Promise(function(dt,Y){var Se=yt.apply(ee,Tt);function he(j){it(Se,dt,Y,he,W,"next",j)}function W(j){it(Se,dt,Y,he,W,"throw",j)}he(void 0)})}},Ut.exports.default=Ut.exports,Ut.exports.__esModule=!0},948:Ut=>{Ut.exports=function(Je){return Je&&Je.__esModule?Je:{default:Je}},Ut.exports.default=Ut.exports,Ut.exports.__esModule=!0},321:Ut=>{function it(Je){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(Ut.exports=it=function(ee){return typeof ee},Ut.exports.default=Ut.exports,Ut.exports.__esModule=!0):(Ut.exports=it=function(ee){return ee&&"function"==typeof Symbol&&ee.constructor===Symbol&&ee!==Symbol.prototype?"symbol":typeof ee},Ut.exports.default=Ut.exports,Ut.exports.__esModule=!0),it(Je)}Ut.exports=it,Ut.exports.default=Ut.exports,Ut.exports.__esModule=!0},380:Ut=>{function it(Je){return Promise.resolve().then(()=>{var yt=new Error("Cannot find module '"+Je+"'");throw yt.code="MODULE_NOT_FOUND",yt})}it.keys=()=>[],it.resolve=it,it.id=380,Ut.exports=it},521:()=>{},125:()=>{},307:()=>{}},Ut=>{Ut(Ut.s=303)}]); \ No newline at end of file diff --git a/ccf-body-ui/README.md b/ccf-body-ui/README.md deleted file mode 100644 index ca69c0788..000000000 --- a/ccf-body-ui/README.md +++ /dev/null @@ -1,24 +0,0 @@ -# CcfBodyUi - -This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 9.1.1. - -## Code scaffolding - -Run `ng generate component component-name --project ccf-body-ui` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project ccf-body-ui`. -> Note: Don't forget to add `--project ccf-body-ui` or else it will be added to the default project in your `angular.json` file. - -## Build - -Run `ng build ccf-body-ui` to build the project. The build artifacts will be stored in the `dist/` directory. - -## Publishing - -After building your library with `ng build ccf-body-ui`, go to the dist folder `cd dist/ccf-body-ui` and run `npm publish`. - -## Running unit tests - -Run `ng test ccf-body-ui` to execute the unit tests via [Karma](https://karma-runner.github.io). - -## Further help - -To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md). diff --git a/ccf-body-ui/bundles/ccf-body-ui.umd.js b/ccf-body-ui/bundles/ccf-body-ui.umd.js deleted file mode 100644 index 13d39e1d7..000000000 --- a/ccf-body-ui/bundles/ccf-body-ui.umd.js +++ /dev/null @@ -1,1397 +0,0 @@ -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@deck.gl/core'), require('@deck.gl/layers'), require('@deck.gl/mesh-layers'), require('@luma.gl/core'), require('@math.gl/core'), require('@loaders.gl/core'), require('@loaders.gl/draco'), require('@loaders.gl/gltf'), require('cannon-es'), require('bind-decorator'), require('rxjs'), require('rxjs/operators')) : - typeof define === 'function' && define.amd ? define('ccf-body-ui', ['exports', '@deck.gl/core', '@deck.gl/layers', '@deck.gl/mesh-layers', '@luma.gl/core', '@math.gl/core', '@loaders.gl/core', '@loaders.gl/draco', '@loaders.gl/gltf', 'cannon-es', 'bind-decorator', 'rxjs', 'rxjs/operators'], factory) : - (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global['ccf-body-ui'] = {}, global.core$3, global.layers, global.meshLayers, global.core$2, global.core, global.core$1, global.draco, global.gltf, global.cannonEs, global.bind, global.rxjs, global.rxjs.operators)); -}(this, (function (exports, core$3, layers, meshLayers, core$2, core, core$1, draco, gltf, cannonEs, bind, rxjs, operators) { 'use strict'; - - function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } - - var bind__default = /*#__PURE__*/_interopDefaultLegacy(bind); - - /*! ***************************************************************************** - Copyright (c) Microsoft Corporation. - - Permission to use, copy, modify, and/or distribute this software for any - purpose with or without fee is hereby granted. - - THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH - REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR - OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - PERFORMANCE OF THIS SOFTWARE. - ***************************************************************************** */ - /* global Reflect, Promise */ - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) - if (Object.prototype.hasOwnProperty.call(b, p)) - d[p] = b[p]; }; - return extendStatics(d, b); - }; - function __extends(d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - } - var __assign = function () { - __assign = Object.assign || function __assign(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) - if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return __assign.apply(this, arguments); - }; - function __rest(s, e) { - var t = {}; - for (var p in s) - if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; - } - function __decorate(decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") - r = Reflect.decorate(decorators, target, key, desc); - else - for (var i = decorators.length - 1; i >= 0; i--) - if (d = decorators[i]) - r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - } - function __param(paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); }; - } - function __metadata(metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") - return Reflect.metadata(metadataKey, metadataValue); - } - function __awaiter(thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { - step(generator.next(value)); - } - catch (e) { - reject(e); - } } - function rejected(value) { try { - step(generator["throw"](value)); - } - catch (e) { - reject(e); - } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - } - function __generator(thisArg, body) { - var _ = { label: 0, sent: function () { if (t[0] & 1) - throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) - throw new TypeError("Generator is already executing."); - while (_) - try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) - return t; - if (y = 0, t) - op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: - case 1: - t = op; - break; - case 4: - _.label++; - return { value: op[1], done: false }; - case 5: - _.label++; - y = op[1]; - op = [0]; - continue; - case 7: - op = _.ops.pop(); - _.trys.pop(); - continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { - _ = 0; - continue; - } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { - _.label = op[1]; - break; - } - if (op[0] === 6 && _.label < t[1]) { - _.label = t[1]; - t = op; - break; - } - if (t && _.label < t[2]) { - _.label = t[2]; - _.ops.push(op); - break; - } - if (t[2]) - _.ops.pop(); - _.trys.pop(); - continue; - } - op = body.call(thisArg, _); - } - catch (e) { - op = [6, e]; - y = 0; - } - finally { - f = t = 0; - } - if (op[0] & 5) - throw op[1]; - return { value: op[0] ? op[1] : void 0, done: true }; - } - } - var __createBinding = Object.create ? (function (o, m, k, k2) { - if (k2 === undefined) - k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } }); - }) : (function (o, m, k, k2) { - if (k2 === undefined) - k2 = k; - o[k2] = m[k]; - }); - function __exportStar(m, o) { - for (var p in m) - if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) - __createBinding(o, m, p); - } - function __values(o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) - return m.call(o); - if (o && typeof o.length === "number") - return { - next: function () { - if (o && i >= o.length) - o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); - } - function __read(o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) - return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) - ar.push(r.value); - } - catch (error) { - e = { error: error }; - } - finally { - try { - if (r && !r.done && (m = i["return"])) - m.call(i); - } - finally { - if (e) - throw e.error; - } - } - return ar; - } - /** @deprecated */ - function __spread() { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; - } - /** @deprecated */ - function __spreadArrays() { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) - s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; - } - function __spreadArray(to, from, pack) { - if (pack || arguments.length === 2) - for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) - ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); - } - function __await(v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); - } - function __asyncGenerator(thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) - throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; - function verb(n) { if (g[n]) - i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } - function resume(n, v) { try { - step(g[n](v)); - } - catch (e) { - settle(q[0][3], e); - } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) - resume(q[0][0], q[0][1]); } - } - function __asyncDelegator(o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; - function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; } - } - function __asyncValues(o) { - if (!Symbol.asyncIterator) - throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); } - } - function __makeTemplateObject(cooked, raw) { - if (Object.defineProperty) { - Object.defineProperty(cooked, "raw", { value: raw }); - } - else { - cooked.raw = raw; - } - return cooked; - } - ; - var __setModuleDefault = Object.create ? (function (o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function (o, v) { - o["default"] = v; - }; - function __importStar(mod) { - if (mod && mod.__esModule) - return mod; - var result = {}; - if (mod != null) - for (var k in mod) - if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) - __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; - } - function __importDefault(mod) { - return (mod && mod.__esModule) ? mod : { default: mod }; - } - function __classPrivateFieldGet(receiver, state, kind, f) { - if (kind === "a" && !f) - throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) - throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); - } - function __classPrivateFieldSet(receiver, state, value, kind, f) { - if (kind === "m") - throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) - throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) - throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; - } - - // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types - function traverseScene(scene, worldMatrix, visitor) { - var e_1, _a; - if (!worldMatrix) { - worldMatrix = new core.Matrix4(core.Matrix4.IDENTITY); - } - var matrix = new core.Matrix4(core.Matrix4.IDENTITY); - if (!scene) { - return true; - } - else if (scene.matrix) { - matrix.copy(scene.matrix); - } - else { - matrix.identity(); - if (scene.translation) { - matrix.translate(scene.translation); - } - if (scene.rotation) { - var rotationMatrix = new core.Matrix4(core.Matrix4.IDENTITY).fromQuaternion(scene.rotation); - matrix.multiplyRight(rotationMatrix); - } - if (scene.scale) { - matrix.scale(scene.scale); - } - } - var modelMatrix = new core.Matrix4(worldMatrix).multiplyRight(matrix); - if (visitor(scene, modelMatrix, worldMatrix) === false) { - return false; - } - try { - for (var _b = __values((scene.nodes || scene.children || [])), _c = _b.next(); !_c.done; _c = _b.next()) { - var child = _c.value; - if (traverseScene(child, modelMatrix, visitor) === false) { - return false; - } - } - } - catch (e_1_1) { e_1 = { error: e_1_1 }; } - finally { - try { - if (_c && !_c.done && (_a = _b.return)) _a.call(_b); - } - finally { if (e_1) throw e_1.error; } - } - return true; - } - - function registerGLTFLoaders() { - core$1.registerLoaders([draco.DracoWorkerLoader, gltf.GLTFLoader]); - } - // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types - function deriveScenegraph(scenegraphNodeName, gltf) { - var e_1, _b; - var _a; - var scenegraphNode = (_a = gltf.nodes) === null || _a === void 0 ? void 0 : _a.find(function (n) { return n.name === scenegraphNodeName; }); - if (scenegraphNode) { - var foundNodeInScene_1 = false; - try { - for (var _c = __values(gltf.scenes), _d = _c.next(); !_d.done; _d = _c.next()) { - var scene = _d.value; - if (!foundNodeInScene_1) { - traverseScene(scene, new core.Matrix4(core.Matrix4.IDENTITY), function (child, modelMatrix) { - if (child === scenegraphNode) { - child.matrix = modelMatrix; - child.translation = undefined; - child.rotation = undefined; - child.scale = undefined; - foundNodeInScene_1 = true; - return false; - } - return true; - }); - } - } - } - catch (e_1_1) { e_1 = { error: e_1_1 }; } - finally { - try { - if (_d && !_d.done && (_b = _c.return)) _b.call(_c); - } - finally { if (e_1) throw e_1.error; } - } - gltf.scene = { - id: scenegraphNodeName, - name: scenegraphNodeName, - nodes: [scenegraphNode] - }; - gltf.scenes = [gltf.scene]; - return { scene: gltf.scene, scenes: gltf.scenes }; - } - else { - return gltf; - } - } - // eslint-disable-next-line @typescript-eslint/no-explicit-any - function loadGLTF(model, cache) { - return __awaiter(this, void 0, void 0, function () { - var gltfUrl, gltfPromise, gltf$1; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: - gltfUrl = model.scenegraph; - if (cache) { - gltfPromise = cache[gltfUrl] || (cache[gltfUrl] = fetch(gltfUrl).then(function (r) { return r.blob(); })); - } - else { - gltfPromise = fetch(gltfUrl); - } - return [4 /*yield*/, core$1.parse(gltfPromise, gltf.GLTFLoader, { DracoLoader: draco.DracoLoader, gltf: { decompressMeshes: true, postProcess: true } })]; - case 1: - gltf$1 = _b.sent(); - if (!gltf$1.nodes) { - console.log('WARNING: Empty Scene', gltfUrl, gltf$1); - } - return [2 /*return*/, deriveScenegraph(model.scenegraphNode, gltf$1)]; - } - }); - }); - } - // eslint-disable-next-line @typescript-eslint/no-explicit-any - function loadGLTF2(scenegraphNodeName, gltfPromise) { - return __awaiter(this, void 0, void 0, function () { - var _b, _c; - return __generator(this, function (_d) { - switch (_d.label) { - case 0: - _b = deriveScenegraph; - _c = [scenegraphNodeName]; - return [4 /*yield*/, gltfPromise]; - case 1: return [2 /*return*/, _b.apply(void 0, _c.concat([_d.sent()]))]; - } - }); - }); - } - /* eslint-enable */ - - /* eslint-disable */ - function doCollisions(scene) { - return __awaiter(this, void 0, void 0, function () { - var sourceBoxes, targetBoxes, _loop_1, _a, _b, model, e_1_1, report, sad, sourceBoxes_1, sourceBoxes_1_1, src, hits, targetBoxes_1, targetBoxes_1_1, target, csvReport, report_1, report_1_1, hit, _c, _d, h; - var e_1, _e, e_2, _f, e_3, _g, e_4, _h, e_5, _j; - return __generator(this, function (_k) { - switch (_k.label) { - case 0: - console.log('Starting Collisioning'); - sourceBoxes = scene - .filter(function (d) { return !d.scenegraph && d.geometry !== 'wireframe'; }) - .map(function (model) { - var mat = new core.Matrix4(model.transformMatrix); - var lowerBound = mat.transformAsPoint([-1, -1, -1], []); - var upperBound = mat.transformAsPoint([1, 1, 1], []); - return { - '@id': model['@id'], - name: model.tooltip, - entityId: model.entityId, - bbox: new cannonEs.AABB({ - lowerBound: new (cannonEs.Vec3.bind.apply(cannonEs.Vec3, __spreadArray([void 0], __read(lowerBound.map(function (n, i) { return Math.min(n, upperBound[i]); })))))(), - upperBound: new (cannonEs.Vec3.bind.apply(cannonEs.Vec3, __spreadArray([void 0], __read(upperBound.map(function (n, i) { return Math.max(n, lowerBound[i]); })))))() - }) - }; - }); - targetBoxes = []; - _loop_1 = function (model) { - var gltf$1, _l, _m, gltfScene; - var e_6, _o; - return __generator(this, function (_p) { - switch (_p.label) { - case 0: return [4 /*yield*/, core$1.load(model.scenegraph, gltf.GLTFLoader, { DracoLoader: draco.DracoLoader, decompress: true, postProcess: true })]; - case 1: - gltf$1 = _p.sent(); - try { - for (_l = (e_6 = void 0, __values(gltf$1.scenes)), _m = _l.next(); !_m.done; _m = _l.next()) { - gltfScene = _m.value; - traverseScene(gltfScene, new core.Matrix4(model.transformMatrix), function (node, modelMatrix) { - var e_7, _a; - if (node.mesh && node.mesh.primitives && node.mesh.primitives.length > 0) { - var _loop_2 = function (primitive) { - if (primitive.attributes.POSITION && primitive.attributes.POSITION.min) { - var lowerBound_1 = modelMatrix.transformAsPoint(primitive.attributes.POSITION.min, []); - var upperBound_1 = modelMatrix.transformAsPoint(primitive.attributes.POSITION.max, []); - targetBoxes.push({ - '@id': model['@id'], - name: node.name, - entityId: model.entityId, - bbox: new cannonEs.AABB({ - lowerBound: new (cannonEs.Vec3.bind.apply(cannonEs.Vec3, __spreadArray([void 0], __read(lowerBound_1.map(function (n, i) { return Math.min(n, upperBound_1[i]); })))))(), - upperBound: new (cannonEs.Vec3.bind.apply(cannonEs.Vec3, __spreadArray([void 0], __read(upperBound_1.map(function (n, i) { return Math.max(n, lowerBound_1[i]); })))))() - }), - gltf: gltf$1 - }); - } - }; - try { - for (var _b = (e_7 = void 0, __values(node.mesh.primitives)), _c = _b.next(); !_c.done; _c = _b.next()) { - var primitive = _c.value; - _loop_2(primitive); - } - } - catch (e_7_1) { e_7 = { error: e_7_1 }; } - finally { - try { - if (_c && !_c.done && (_a = _b.return)) _a.call(_b); - } - finally { if (e_7) throw e_7.error; } - } - } - return true; - }); - } - } - catch (e_6_1) { e_6 = { error: e_6_1 }; } - finally { - try { - if (_m && !_m.done && (_o = _l.return)) _o.call(_l); - } - finally { if (e_6) throw e_6.error; } - } - return [2 /*return*/]; - } - }); - }; - _k.label = 1; - case 1: - _k.trys.push([1, 6, 7, 8]); - _a = __values(scene.filter(function (d) { return !!d.scenegraph; })), _b = _a.next(); - _k.label = 2; - case 2: - if (!!_b.done) return [3 /*break*/, 5]; - model = _b.value; - return [5 /*yield**/, _loop_1(model)]; - case 3: - _k.sent(); - _k.label = 4; - case 4: - _b = _a.next(); - return [3 /*break*/, 2]; - case 5: return [3 /*break*/, 8]; - case 6: - e_1_1 = _k.sent(); - e_1 = { error: e_1_1 }; - return [3 /*break*/, 8]; - case 7: - try { - if (_b && !_b.done && (_e = _a.return)) _e.call(_a); - } - finally { if (e_1) throw e_1.error; } - return [7 /*endfinally*/]; - case 8: - report = []; - sad = []; - try { - for (sourceBoxes_1 = __values(sourceBoxes), sourceBoxes_1_1 = sourceBoxes_1.next(); !sourceBoxes_1_1.done; sourceBoxes_1_1 = sourceBoxes_1.next()) { - src = sourceBoxes_1_1.value; - hits = []; - try { - for (targetBoxes_1 = (e_3 = void 0, __values(targetBoxes)), targetBoxes_1_1 = targetBoxes_1.next(); !targetBoxes_1_1.done; targetBoxes_1_1 = targetBoxes_1.next()) { - target = targetBoxes_1_1.value; - if (src.bbox.overlaps(target.bbox)) { - hits.push({ '@id': target['@id'], name: target.name }); - } - } - } - catch (e_3_1) { e_3 = { error: e_3_1 }; } - finally { - try { - if (targetBoxes_1_1 && !targetBoxes_1_1.done && (_g = targetBoxes_1.return)) _g.call(targetBoxes_1); - } - finally { if (e_3) throw e_3.error; } - } - if (hits.length > 0) { - report.push({ - '@id': src.entityId, - name: src.name, - hits: hits - }); - } - else { - sad.push(src); - } - } - } - catch (e_2_1) { e_2 = { error: e_2_1 }; } - finally { - try { - if (sourceBoxes_1_1 && !sourceBoxes_1_1.done && (_f = sourceBoxes_1.return)) _f.call(sourceBoxes_1); - } - finally { if (e_2) throw e_2.error; } - } - console.log({ sourceBoxes: sourceBoxes, targetBoxes: targetBoxes, report: report, sad: sad, maxHits: Math.max.apply(Math, __spreadArray([], __read(report.map(function (r) { return r.hits.length; })))) }); - csvReport = []; - try { - for (report_1 = __values(report), report_1_1 = report_1.next(); !report_1_1.done; report_1_1 = report_1.next()) { - hit = report_1_1.value; - csvReport.push({ - 'Tissue ID': hit['@id'], - 'Tissue Name': hit.name, - 'Hit ID': '', - 'Hit Name': '' - }); - try { - for (_c = (e_5 = void 0, __values(hit.hits)), _d = _c.next(); !_d.done; _d = _c.next()) { - h = _d.value; - csvReport.push({ - 'Tissue ID': hit['@id'], - 'Tissue Name': hit.name, - 'Hit ID': h['@id'], - 'Hit Name': h.name - }); - } - } - catch (e_5_1) { e_5 = { error: e_5_1 }; } - finally { - try { - if (_d && !_d.done && (_j = _c.return)) _j.call(_c); - } - finally { if (e_5) throw e_5.error; } - } - } - } - catch (e_4_1) { e_4 = { error: e_4_1 }; } - finally { - try { - if (report_1_1 && !report_1_1.done && (_h = report_1.return)) _h.call(report_1); - } - finally { if (e_4) throw e_4.error; } - } - console.log(csvReport); - return [2 /*return*/, report]; - } - }); - }); - } - /* eslint-enable */ - - function meshLayer(id, data, options) { - if (!data || data.length === 0) { - return undefined; - } - else { - var mesh = void 0; - switch (options.geometry) { - case 'sphere': - mesh = new core$2.SphereGeometry(); - break; - case 'cone': - mesh = new core$2.ConeGeometry(); - break; - case 'cylinder': - mesh = new core$2.CylinderGeometry(); - break; - case 'cube': - default: - mesh = new core$2.CubeGeometry(); - break; - } - return new meshLayers.SimpleMeshLayer(Object.assign({ - id: id, - pickable: true, - autoHighlight: false, - highlightColor: [30, 136, 229, 255], - coordinateSystem: core$3.COORDINATE_SYSTEM.CARTESIAN, - data: data, - // eslint-disable-next-line @typescript-eslint/no-explicit-any - mesh: mesh, - wireframe: false, - getTransformMatrix: function (d) { return d.transformMatrix; }, - getColor: function (d) { return d.color || [255, 255, 255, 0.9 * 255]; } - }, options)); - } - } - function textLayer(id, data, options) { - if (!data || data.length === 0) { - return undefined; - } - else { - return new layers.TextLayer(Object.assign({ - id: id, - pickable: true, - data: data.map(function (d) { return (Object.assign(Object.assign({}, d), { position: new core.Matrix4(d.transformMatrix).getTranslation() })); }), - getText: function (d) { return d.text; }, - getPosition: function (d) { return d.position; }, - getColor: function (d) { return d.color; } - }, options)); - } - } - var BodyUILayer = /** @class */ (function (_super) { - __extends(BodyUILayer, _super); - function BodyUILayer() { - return _super !== null && _super.apply(this, arguments) || this; - } - BodyUILayer.prototype.initializeState = function () { - var data = this.props.data; - this.setState({ data: data !== null && data !== void 0 ? data : [], zoomOpacity: 0.8, doCollisions: false }); - registerGLTFLoaders(); - }; - BodyUILayer.prototype.renderLayers = function () { - var e_1, _c, e_2, _d, e_3, _e, e_4, _f; - var _a, _b; - var state = this.state; - var geometries = { - 'sphere': [], 'cone': [], 'cylinder': [], 'cube': [], 'text': [], 'wireframe': [], 'scenegraph': [] - }; - try { - for (var _g = __values(state.data), _h = _g.next(); !_h.done; _h = _g.next()) { - var node = _h.value; - var geometry = (_a = node.geometry) !== null && _a !== void 0 ? _a : 'cube'; - if (node.scenegraph) { - geometries.scenegraph.push(node); - } - else if (geometries[geometry] !== undefined) { - geometries[geometry].push(node); - } - } - } - catch (e_1_1) { e_1 = { error: e_1_1 }; } - finally { - try { - if (_h && !_h.done && (_c = _g.return)) _c.call(_g); - } - finally { if (e_1) throw e_1.error; } - } - // eslint-disable-next-line @typescript-eslint/no-explicit-any - var url2gltf = {}; - try { - for (var _j = __values(geometries.scenegraph), _k = _j.next(); !_k.done; _k = _j.next()) { - var m = _k.value; - if (m.scenegraph && m.scenegraphNode && !Object.prototype.hasOwnProperty.call(url2gltf, m.scenegraph)) { - url2gltf[m.scenegraph] = loadGLTF({ scenegraph: m.scenegraph }, BodyUILayer.gltfCache); - } - } - } - catch (e_2_1) { e_2 = { error: e_2_1 }; } - finally { - try { - if (_k && !_k.done && (_d = _j.return)) _d.call(_j); - } - finally { if (e_2) throw e_2.error; } - } - var layers = []; - try { - for (var _l = __values(Object.entries(geometries)), _m = _l.next(); !_m.done; _m = _l.next()) { - var _o = __read(_m.value, 2), geometry = _o[0], nodes = _o[1]; - if (geometry === 'scenegraph') { - try { - for (var nodes_1 = (e_4 = void 0, __values(nodes)), nodes_1_1 = nodes_1.next(); !nodes_1_1.done; nodes_1_1 = nodes_1.next()) { - var model = nodes_1_1.value; - layers.push(new meshLayers.ScenegraphLayer({ - id: 'models-' + model['@id'], - opacity: model.zoomBasedOpacity ? state.zoomOpacity : (model.opacity !== undefined ? model.opacity : 1.0), - pickable: !model.unpickable, - coordinateSystem: core$3.COORDINATE_SYSTEM.CARTESIAN, - data: [model], - scenegraph: model.scenegraphNode ? - loadGLTF2(model.scenegraphNode, url2gltf[model.scenegraph]) : - model.scenegraph, - // eslint-disable-next-line @typescript-eslint/naming-convention - _lighting: model._lighting, - getTransformMatrix: model.transformMatrix, - getColor: (_b = model.color) !== null && _b !== void 0 ? _b : [0, 255, 0, 0.5 * 255], - parameters: { depthMask: !model.zoomBasedOpacity && (model.opacity === undefined || model.opacity === 1) } - })); - } - } - catch (e_4_1) { e_4 = { error: e_4_1 }; } - finally { - try { - if (nodes_1_1 && !nodes_1_1.done && (_f = nodes_1.return)) _f.call(nodes_1); - } - finally { if (e_4) throw e_4.error; } - } - } - else if (geometry === 'text') { - layers.push(textLayer('text', nodes.filter(function (n) { return n.unpickable; }), { pickable: false })); - layers.push(textLayer('textPickable', nodes.filter(function (n) { return !n.unpickable; }), { pickable: true })); - } - else if (geometry === 'wireframe') { - layers.push(meshLayer(geometry, nodes, { wireframe: true, pickable: false, geometry: geometry })); - } - else { - layers.push(meshLayer(geometry, nodes.filter(function (n) { return n.unpickable; }), { wireframe: false, pickable: false, geometry: geometry })); - layers.push(meshLayer(geometry + "Pickable", nodes.filter(function (n) { return !n.unpickable; }), { wireframe: false, pickable: true, geometry: geometry })); - } - } - } - catch (e_3_1) { e_3 = { error: e_3_1 }; } - finally { - try { - if (_m && !_m.done && (_e = _l.return)) _e.call(_l); - } - finally { if (e_3) throw e_3.error; } - } - if (state.doCollisions) { - doCollisions(state.data); - } - return layers.filter(function (l) { return !!l; }); - }; - BodyUILayer.prototype.getPickingInfo = function (e) { - return e.info; - }; - return BodyUILayer; - }(core$3.CompositeLayer)); - BodyUILayer.layerName = 'BodyUILayer'; - BodyUILayer.gltfCache = {}; - - /* eslint-disable */ - function childNames(scene, names) { - var e_1, _a; - if (names === void 0) { names = []; } - try { - for (var _b = __values((scene.nodes || scene.children || [])), _c = _b.next(); !_c.done; _c = _b.next()) { - var child = _c.value; - names.push(child.name); - childNames(child, names); - } - } - catch (e_1_1) { e_1 = { error: e_1_1 }; } - finally { - try { - if (_c && !_c.done && (_a = _b.return)) _a.call(_b); - } - finally { if (e_1) throw e_1.error; } - } - return names; - } - function processSceneNodes(gltfUrl, worldMatrix, scenegraphNode) { - return __awaiter(this, void 0, void 0, function () { - var gltf, nodes, gltfNodes, _a, _b, scene, _c, _d, node, _e, _f, child, _g, _h, node, lb, ub, size, halfSize, center, gltfNodes_1, gltfNodes_1_1, node; - var e_2, _j, e_3, _k, e_4, _l, e_5, _m, e_6, _o; - return __generator(this, function (_p) { - switch (_p.label) { - case 0: - registerGLTFLoaders(); - return [4 /*yield*/, loadGLTF({ scenegraph: gltfUrl, scenegraphNode: scenegraphNode })]; - case 1: - gltf = _p.sent(); - nodes = {}; - gltfNodes = []; - try { - for (_a = __values(gltf.scenes), _b = _a.next(); !_b.done; _b = _a.next()) { - scene = _b.value; - worldMatrix = new core.Matrix4(worldMatrix || core.Matrix4.IDENTITY); - traverseScene(scene, worldMatrix, function (node, modelMatrix) { - var e_7, _a; - var processedNode = { - '@id': (node.name || node.id), - '@type': 'ProcessedNode', - transformMatrix: new core.Matrix4(modelMatrix), - geometry: 'wireframe', - node: node - }; - gltfNodes.push({ - '@id': "GLTF:" + processedNode['@id'], - '@type': 'GLTFNode', - scenegraph: gltfUrl, - scenegraphNode: processedNode['@id'], - transformMatrix: new core.Matrix4(worldMatrix || core.Matrix4.IDENTITY), - tooltip: (node.name || node.id), - color: [255, 255, 255, 255], - _lighting: 'pbr', - zoomBasedOpacity: true, - node: node - }); - if (node.mesh && node.mesh.primitives && node.mesh.primitives.length > 0) { - var _loop_1 = function (primitive) { - if (primitive.attributes.POSITION && primitive.attributes.POSITION.min) { - var lowerBound_1 = modelMatrix.transformAsPoint(primitive.attributes.POSITION.min, []); - var upperBound_1 = modelMatrix.transformAsPoint(primitive.attributes.POSITION.max, []); - processedNode.bbox = new cannonEs.AABB({ - lowerBound: new (cannonEs.Vec3.bind.apply(cannonEs.Vec3, __spreadArray([void 0], __read(lowerBound_1.map(function (n, i) { return Math.min(n, upperBound_1[i]); })))))(), - upperBound: new (cannonEs.Vec3.bind.apply(cannonEs.Vec3, __spreadArray([void 0], __read(upperBound_1.map(function (n, i) { return Math.max(n, lowerBound_1[i]); })))))() - }); - } - }; - try { - for (var _b = (e_7 = void 0, __values(node.mesh.primitives)), _c = _b.next(); !_c.done; _c = _b.next()) { - var primitive = _c.value; - _loop_1(primitive); - } - } - catch (e_7_1) { e_7 = { error: e_7_1 }; } - finally { - try { - if (_c && !_c.done && (_a = _b.return)) _a.call(_b); - } - finally { if (e_7) throw e_7.error; } - } - } - nodes[processedNode['@id']] = processedNode; - return true; - }); - } - } - catch (e_2_1) { e_2 = { error: e_2_1 }; } - finally { - try { - if (_b && !_b.done && (_j = _a.return)) _j.call(_a); - } - finally { if (e_2) throw e_2.error; } - } - try { - for (_c = __values(Object.values(nodes).filter(function (n) { return !n.bbox; })), _d = _c.next(); !_d.done; _d = _c.next()) { - node = _d.value; - try { - for (_e = (e_4 = void 0, __values(childNames(node.node).map(function (n) { return nodes[n]; }).filter(function (n) { return n.bbox; }))), _f = _e.next(); !_f.done; _f = _e.next()) { - child = _f.value; - if (!node.bbox) { - node.bbox = child.bbox.clone(); - } - else { - node.bbox.extend(child.bbox); - } - } - } - catch (e_4_1) { e_4 = { error: e_4_1 }; } - finally { - try { - if (_f && !_f.done && (_l = _e.return)) _l.call(_e); - } - finally { if (e_4) throw e_4.error; } - } - if (!node.bbox) { - delete nodes[node['@id']]; - } - } - } - catch (e_3_1) { e_3 = { error: e_3_1 }; } - finally { - try { - if (_d && !_d.done && (_k = _c.return)) _k.call(_c); - } - finally { if (e_3) throw e_3.error; } - } - try { - for (_g = __values(Object.values(nodes)), _h = _g.next(); !_h.done; _h = _g.next()) { - node = _h.value; - lb = node.bbox.lowerBound; - ub = node.bbox.upperBound; - size = node.size = ub.clone().vsub(lb); - halfSize = size.clone().vmul(new cannonEs.Vec3(0.5, 0.5, 0.5)); - center = node.center = lb.clone().vadd(halfSize); - node.transformMatrix = new core.Matrix4(core.Matrix4.IDENTITY) - .translate(center.toArray()) - .scale(halfSize.toArray()); - } - } - catch (e_5_1) { e_5 = { error: e_5_1 }; } - finally { - try { - if (_h && !_h.done && (_m = _g.return)) _m.call(_g); - } - finally { if (e_5) throw e_5.error; } - } - try { - for (gltfNodes_1 = __values(gltfNodes), gltfNodes_1_1 = gltfNodes_1.next(); !gltfNodes_1_1.done; gltfNodes_1_1 = gltfNodes_1.next()) { - node = gltfNodes_1_1.value; - nodes[node['@id']] = node; - } - } - catch (e_6_1) { e_6 = { error: e_6_1 }; } - finally { - try { - if (gltfNodes_1_1 && !gltfNodes_1_1.done && (_o = gltfNodes_1.return)) _o.call(gltfNodes_1); - } - finally { if (e_6) throw e_6.error; } - } - return [2 /*return*/, nodes]; - } - }); - }); - } - /* eslint-enable */ - - /** - * A convenience wrapper class for the CCF Body UI - */ - var BodyUI = /** @class */ (function () { - function BodyUI(deckProps) { - var _this = this; - var _a, _b, _c, _d, _e; - this.deckProps = deckProps; - this.bodyUILayer = new BodyUILayer({}); - this.nodeClickSubject = new rxjs.Subject(); - this.nodeHoverStartSubject = new rxjs.Subject(); - this.nodeHoverStopSubject = new rxjs.Subject(); - this.sceneRotationSubject = new rxjs.BehaviorSubject([0, 0]); - this.nodeDragStartSubject = new rxjs.Subject(); - this.nodeDragSubject = new rxjs.Subject(); - this.nodeDragEndSubject = new rxjs.Subject(); - this.nodeClick$ = this.nodeClickSubject.pipe(operators.share()); - this.nodeHoverStart$ = this.nodeHoverStartSubject.pipe(operators.share()); - this.nodeHoverStop$ = this.nodeHoverStopSubject.pipe(operators.share()); - this.sceneRotation$ = this.sceneRotationSubject.pipe(operators.share()); - this.nodeDragStart$ = this.nodeDragStartSubject.pipe(operators.share()); - this.nodeDrag$ = this.nodeDragSubject.pipe(operators.share()); - this.nodeDragEnd$ = this.nodeDragEndSubject.pipe(operators.share()); - // eslint-disable-next-line @typescript-eslint/no-explicit-any - var props = Object.assign(Object.assign({}, deckProps), { views: [deckProps.camera === 'orthographic' ? new core$3.OrthographicView({ - flipY: false, - near: -1000 - }) : new core$3.OrbitView({ orbitAxis: 'Y' })], controller: deckProps.interactive !== undefined ? deckProps.interactive : true, 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 _a; return (_a = _this.cursor) !== null && _a !== void 0 ? _a : (e.isDragging ? 'grabbing' : 'grab'); } }); - if (deckProps.legacyLighting) { - // eslint-disable-next-line - props.effects = [ - new core$3.LightingEffect({ - ambientLight: new core$3.AmbientLight({ - color: [255, 255, 255], - intensity: 10.0 - }) - }) - ]; - } - // eslint-disable-next-line - this.deck = new core$3.Deck(props); - this.deck.setProps({ - viewState: { - orbitAxis: 'Y', - minRotationX: (_a = deckProps.minRotationX) !== null && _a !== void 0 ? _a : -15, - maxRotationX: (_b = deckProps.maxRotationX) !== null && _b !== void 0 ? _b : 15, - target: (_c = deckProps.target) !== null && _c !== void 0 ? _c : [0.5, 0.5, 0], - rotationX: 0, - rotationOrbit: (_d = deckProps.rotation) !== null && _d !== void 0 ? _d : 0, - zoom: (_e = deckProps.zoom) !== null && _e !== void 0 ? _e : 9.5, - camera: deckProps.camera - } - }); - if (deckProps.rotation) { - this.sceneRotationSubject.next([deckProps.rotation, 0]); - } - } - BodyUI.prototype.initialize = function () { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_f) { - switch (_f.label) { - case 0: - if (!!this.bodyUILayer.state) return [3 /*break*/, 2]; - // eslint-disable-next-line no-await-in-loop - return [4 /*yield*/, new Promise(function (r) { - setTimeout(r, 200); - })]; - case 1: - // eslint-disable-next-line no-await-in-loop - _f.sent(); - return [3 /*break*/, 0]; - case 2: return [2 /*return*/]; - } - }); - }); - }; - BodyUI.prototype.finalize = function () { - this.deck.finalize(); - }; - BodyUI.prototype.setScene = function (data) { - var e_1, _f; - if ((data === null || data === void 0 ? void 0 : data.length) > 0) { - var zoomOpacity = this.bodyUILayer.state.zoomOpacity; - var didZoom = false; - try { - for (var data_1 = __values(data), data_1_1 = data_1.next(); !data_1_1.done; data_1_1 = data_1.next()) { - var node = data_1_1.value; - if (node.zoomToOnLoad) { - this.zoomTo(node); - didZoom = true; - } - } - } - catch (e_1_1) { e_1 = { error: e_1_1 }; } - finally { - try { - if (data_1_1 && !data_1_1.done && (_f = data_1.return)) _f.call(data_1); - } - finally { if (e_1) throw e_1.error; } - } - zoomOpacity = didZoom ? 0.05 : zoomOpacity; - if (!this.deckProps.debugSceneNodeProcessing) { - this.bodyUILayer.setState({ data: data, zoomOpacity: zoomOpacity }); - } - else { - this.debugSceneNodeProcessing(data, zoomOpacity); - } - } - }; - BodyUI.prototype.debugSceneNodeProcessing = function (data, zoomOpacity) { - var _this = this; - // const gltfUrl = 'https://hubmapconsortium.github.io/ccf-3d-reference-object-library/VH_Male/United/VHM_United_Color.glb'; - var gltfUrl = 'https://hubmapconsortium.github.io/ccf-3d-reference-object-library/VH_Female/United/VHF_United_Color.glb'; - // const gltfUrl = 'https://hubmapconsortium.github.io/hubmap-ontology/objects/VHF_United_v01_060420.glb'; - var gltfTransform = new core.Matrix4([0.076, 0, 0, 0, 0, 0.076, 1.6875389974302382e-17, 0, 0, -1.6875389974302382e-17, 0.076, 0, 0.49, 0.034, 0.11, 1]); - processSceneNodes(gltfUrl, gltfTransform, 'VHF_Kidney_L_Low1').then(function (results) { - console.log('results', results); - console.log('data', data); - // data = Object.values(results); - data = data.concat(Object.values(results)); - data.push({ - '@id': 'TEST', - '@type': 'TEST', - scenegraph: gltfUrl, - scenegraphNode: 'VHF_Kidney_R_Low', - transformMatrix: gltfTransform, - color: [255, 255, 255, 200], - // eslint-disable-next-line @typescript-eslint/naming-convention - _lighting: 'pbr', - zoomBasedOpacity: false - }); - _this.bodyUILayer.setState({ data: data, zoomOpacity: zoomOpacity }); - }); - }; - BodyUI.prototype.zoomTo = function (node) { - var matrix = new core.Matrix4(node.transformMatrix); - this.deck.setProps({ - viewState: Object.assign(Object.assign({}, this.deck.props.viewState), { target: matrix.getTranslation(), rotationX: 0, rotationOrbit: 0, zoom: 11.5 }) - }); - }; - BodyUI.prototype.setRotation = function (value) { - this.deck.setProps({ - viewState: Object.assign(Object.assign({}, this.deck.props.viewState), { rotationOrbit: value }) - }); - }; - BodyUI.prototype.setRotationX = function (value) { - this.deck.setProps({ - viewState: Object.assign(Object.assign({}, this.deck.props.viewState), { rotationX: value }) - }); - }; - BodyUI.prototype.setZoom = function (value) { - this.deck.setProps({ - viewState: Object.assign(Object.assign({}, this.deck.props.viewState), { zoom: value }) - }); - }; - BodyUI.prototype.setTarget = function (value) { - this.deck.setProps({ - viewState: Object.assign(Object.assign({}, this.deck.props.viewState), { target: value }) - }); - }; - BodyUI.prototype.setInteractive = function (value) { - this.deck.setProps({ - controller: value - }); - }; - BodyUI.prototype._onHover = function (e) { - var lastHovered = this.lastHovered; - this.cursor = e.picked ? 'pointer' : undefined; - if (e.picked && e.object && e.object['@id']) { - if (lastHovered !== e.object) { - if (lastHovered) { - this.nodeHoverStopSubject.next(lastHovered); - } - this.lastHovered = e.object; - this.nodeHoverStartSubject.next(e.object); - } - } - else if (lastHovered) { - this.nodeHoverStopSubject.next(lastHovered); - this.lastHovered = undefined; - } - }; - BodyUI.prototype._onClick = function (info, e) { - var _a, _b; - if (info.picked && info.object && info.object['@id']) { - this.nodeClickSubject.next({ node: info.object, ctrlClick: (_b = (_a = e === null || e === void 0 ? void 0 : e.srcEvent) === null || _a === void 0 ? void 0 : _a.ctrlKey) !== null && _b !== void 0 ? _b : undefined }); - } - }; - BodyUI.prototype._onViewStateChange = function (event) { - var _a; - if ((_a = event.interactionState) === null || _a === void 0 ? void 0 : _a.isZooming) { - var currentState = this.bodyUILayer.state; - var zoomOpacity = Math.min(Math.max(1 - (event.viewState.zoom - 8.9) / 2, 0.05), 1.0); - if (currentState.zoomOpacity !== zoomOpacity) { - this.bodyUILayer.setState({ data: currentState.data, zoomOpacity: zoomOpacity }); - } - } - this.deck.setProps({ viewState: Object.assign({}, event.viewState) }); - this.sceneRotationSubject.next([event.viewState.rotationOrbit, event.viewState.rotationX]); - }; - BodyUI.prototype._onDragStart = function (info, e) { - this._dragEvent(info, e, this.nodeDragStartSubject); - }; - BodyUI.prototype._onDrag = function (info, e) { - this._dragEvent(info, e, this.nodeDragSubject); - }; - BodyUI.prototype._onDragEnd = function (info, e) { - this._dragEvent(info, e, this.nodeDragEndSubject); - }; - BodyUI.prototype._dragEvent = function (info, e, subject) { - var _a; - if ((_a = info === null || info === void 0 ? void 0 : info.object) === null || _a === void 0 ? void 0 : _a['@id']) { - subject.next({ node: info.object, info: info, e: e }); - } - }; - return BodyUI; - }()); - __decorate([ - bind__default['default'] - ], BodyUI.prototype, "_onHover", null); - __decorate([ - bind__default['default'] - ], BodyUI.prototype, "_onClick", null); - __decorate([ - bind__default['default'] - ], BodyUI.prototype, "_onViewStateChange", null); - __decorate([ - bind__default['default'] - ], BodyUI.prototype, "_onDragStart", null); - __decorate([ - bind__default['default'] - ], BodyUI.prototype, "_onDrag", null); - __decorate([ - bind__default['default'] - ], BodyUI.prototype, "_onDragEnd", null); - - function simplifyScene(nodes) { - return __awaiter(this, void 0, void 0, function () { - var gltfCache, gltfUrls, gltfUrls_1, gltfUrls_1_1, gltfUrl, _a, _b, e_1_1, newNodes, _loop_1, _c, _d, model; - var e_1, _e, e_2, _f; - return __generator(this, function (_g) { - switch (_g.label) { - case 0: - gltfCache = {}; - gltfUrls = new Set(nodes.map(function (n) { return n.scenegraph; }).filter(function (n) { return !!n; })); - _g.label = 1; - case 1: - _g.trys.push([1, 6, 7, 8]); - gltfUrls_1 = __values(gltfUrls), gltfUrls_1_1 = gltfUrls_1.next(); - _g.label = 2; - case 2: - if (!!gltfUrls_1_1.done) return [3 /*break*/, 5]; - gltfUrl = gltfUrls_1_1.value; - // eslint-disable-next-line no-await-in-loop - _a = gltfCache; - _b = gltfUrl; - return [4 /*yield*/, loadGLTF({ scenegraph: gltfUrl })]; - case 3: - // eslint-disable-next-line no-await-in-loop - _a[_b] = _g.sent(); - _g.label = 4; - case 4: - gltfUrls_1_1 = gltfUrls_1.next(); - return [3 /*break*/, 2]; - case 5: return [3 /*break*/, 8]; - case 6: - e_1_1 = _g.sent(); - e_1 = { error: e_1_1 }; - return [3 /*break*/, 8]; - case 7: - try { - if (gltfUrls_1_1 && !gltfUrls_1_1.done && (_e = gltfUrls_1.return)) _e.call(gltfUrls_1); - } - finally { if (e_1) throw e_1.error; } - return [7 /*endfinally*/]; - case 8: - newNodes = nodes.filter(function (n) { return !n.scenegraph; }); - _loop_1 = function (model) { - var e_3, _h; - var gltf = gltfCache[model.scenegraph]; - var bbox = new cannonEs.AABB(); - var worldMatrix = new core.Matrix4(model.transformMatrix); - /* eslint-disable */ - if (model.scenegraphNode) { - var scenegraphNode_1 = model.scenegraphNode ? gltf.nodes.find(function (n) { return n.name === model.scenegraphNode; }) : undefined; - var foundNodeInScene_1 = false; - try { - for (var _j = (e_3 = void 0, __values(gltf.scenes)), _k = _j.next(); !_k.done; _k = _j.next()) { - var scene = _k.value; - if (!foundNodeInScene_1) { - traverseScene(scene, new core.Matrix4(model.transformMatrix), function (child, modelMatrix) { - if (child === scenegraphNode_1) { - worldMatrix = modelMatrix; - foundNodeInScene_1 = true; - return false; - } - return true; - }); - } - } - } - catch (e_3_1) { e_3 = { error: e_3_1 }; } - finally { - try { - if (_k && !_k.done && (_h = _j.return)) _h.call(_j); - } - finally { if (e_3) throw e_3.error; } - } - gltf.scene = { - id: model.scenegraphNode, - name: model.scenegraphNode, - nodes: [scenegraphNode_1] - }; - } - traverseScene(gltf.scene, worldMatrix, function (node, modelMatrix) { - var e_4, _a; - if (node.mesh && node.mesh.primitives && node.mesh.primitives.length > 0) { - var _loop_2 = function (primitive) { - if (primitive.attributes.POSITION && primitive.attributes.POSITION.min) { - var lowerBound_1 = modelMatrix.transformAsPoint(primitive.attributes.POSITION.min, []); - var upperBound_1 = modelMatrix.transformAsPoint(primitive.attributes.POSITION.max, []); - var innerBbox = new cannonEs.AABB({ - lowerBound: new (cannonEs.Vec3.bind.apply(cannonEs.Vec3, __spreadArray([void 0], __read(lowerBound_1.map(function (n, i) { return Math.min(n, upperBound_1[i]); })))))(), - upperBound: new (cannonEs.Vec3.bind.apply(cannonEs.Vec3, __spreadArray([void 0], __read(upperBound_1.map(function (n, i) { return Math.max(n, lowerBound_1[i]); })))))() - }); - bbox.extend(innerBbox); - } - }; - try { - for (var _b = (e_4 = void 0, __values(node.mesh.primitives)), _c = _b.next(); !_c.done; _c = _b.next()) { - var primitive = _c.value; - _loop_2(primitive); - } - } - catch (e_4_1) { e_4 = { error: e_4_1 }; } - finally { - try { - if (_c && !_c.done && (_a = _b.return)) _a.call(_b); - } - finally { if (e_4) throw e_4.error; } - } - } - return true; - }); - /* eslint-enable */ - var size = bbox.upperBound.clone().vsub(bbox.lowerBound); - var halfSize = size.clone().vmul(new cannonEs.Vec3(0.5, 0.5, 0.5)); - var position = bbox.lowerBound.clone().vadd(halfSize); - var transformMatrix = new core.Matrix4(core.Matrix4.IDENTITY) - .translate(position.toArray()) - .scale(halfSize.toArray()); - var newNode = Object.assign(Object.assign({}, model), { transformMatrix: transformMatrix, geometry: 'wireframe' }); - delete newNode.scenegraph; - delete newNode.scenegraphNode; - newNodes.push(newNode); - }; - try { - for (_c = __values(nodes.filter(function (n) { return n.scenegraph; })), _d = _c.next(); !_d.done; _d = _c.next()) { - model = _d.value; - _loop_1(model); - } - } - catch (e_2_1) { e_2 = { error: e_2_1 }; } - finally { - try { - if (_d && !_d.done && (_f = _c.return)) _f.call(_c); - } - finally { if (e_2) throw e_2.error; } - } - return [2 /*return*/, newNodes]; - } - }); - }); - } - - // Hack to support deck.gl and other typings - - /** - * Generated bundle index. Do not edit. - */ - - exports.BodyUI = BodyUI; - exports.BodyUILayer = BodyUILayer; - exports.deriveScenegraph = deriveScenegraph; - exports.doCollisions = doCollisions; - exports.loadGLTF = loadGLTF; - exports.loadGLTF2 = loadGLTF2; - exports.processSceneNodes = processSceneNodes; - exports.registerGLTFLoaders = registerGLTFLoaders; - exports.simplifyScene = simplifyScene; - exports.traverseScene = traverseScene; - - Object.defineProperty(exports, '__esModule', { value: true }); - -}))); -//# sourceMappingURL=ccf-body-ui.umd.js.map diff --git a/ccf-body-ui/bundles/ccf-body-ui.umd.js.map b/ccf-body-ui/bundles/ccf-body-ui.umd.js.map deleted file mode 100644 index 1c8d54c1b..000000000 --- a/ccf-body-ui/bundles/ccf-body-ui.umd.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ccf-body-ui.umd.js","sources":["../../../node_modules/tslib/tslib.es6.js","../../../projects/ccf-body-ui/src/lib/util/scene-traversal.ts","../../../projects/ccf-body-ui/src/lib/util/load-gltf.ts","../../../projects/ccf-body-ui/src/lib/util/spatial-scene-collider.ts","../../../projects/ccf-body-ui/src/lib/body-ui-layer.ts","../../../projects/ccf-body-ui/src/lib/util/process-scene-nodes.ts","../../../projects/ccf-body-ui/src/lib/body-ui.ts","../../../projects/ccf-body-ui/src/lib/util/simplify-scene.ts","../../../projects/ccf-body-ui/src/public-api.ts","../../../projects/ccf-body-ui/src/ccf-body-ui.ts"],"sourcesContent":["/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n","/* eslint-disable @typescript-eslint/no-unsafe-member-access */\nimport { Matrix4 } from '@math.gl/core';\n\n\nexport type SceneTraversalVisitor = (child, modelMatrix: Matrix4, parentMatrix: Matrix4) => boolean;\n\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nexport function traverseScene(scene, worldMatrix: Matrix4, visitor: SceneTraversalVisitor): boolean {\n if (!worldMatrix) {\n worldMatrix = new Matrix4(Matrix4.IDENTITY);\n }\n const matrix = new Matrix4(Matrix4.IDENTITY);\n if (!scene) {\n return true;\n } else if (scene.matrix) {\n matrix.copy(scene.matrix);\n } else {\n matrix.identity();\n\n if (scene.translation) {\n matrix.translate(scene.translation);\n }\n\n if (scene.rotation) {\n const rotationMatrix = new Matrix4(Matrix4.IDENTITY).fromQuaternion(scene.rotation);\n matrix.multiplyRight(rotationMatrix);\n }\n\n if (scene.scale) {\n matrix.scale(scene.scale);\n }\n }\n const modelMatrix = new Matrix4(worldMatrix).multiplyRight(matrix);\n if (visitor(scene, modelMatrix, worldMatrix) === false) {\n return false;\n }\n for (const child of (scene.nodes || scene.children || [])) {\n if (traverseScene(child, modelMatrix, visitor) === false) {\n return false;\n }\n }\n return true;\n}\n","/* eslint-disable @typescript-eslint/no-unsafe-call */\n/* eslint-disable @typescript-eslint/no-unsafe-member-access */\nimport { parse, registerLoaders } from '@loaders.gl/core';\nimport { DracoLoader, DracoWorkerLoader } from '@loaders.gl/draco';\nimport { GLTFLoader } from '@loaders.gl/gltf';\nimport { Matrix4 } from '@math.gl/core';\n\nimport { SpatialSceneNode } from '../shared/spatial-scene-node';\nimport { traverseScene } from './scene-traversal';\n\n\nexport function registerGLTFLoaders(): void {\n registerLoaders([DracoWorkerLoader, GLTFLoader]);\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types\nexport function deriveScenegraph(scenegraphNodeName: string, gltf: any): any {\n const scenegraphNode = gltf.nodes?.find((n) => n.name === scenegraphNodeName);\n if (scenegraphNode) {\n let foundNodeInScene = false;\n for (const scene of gltf.scenes) {\n if (!foundNodeInScene) {\n traverseScene(scene, new Matrix4(Matrix4.IDENTITY), (child, modelMatrix) => {\n if (child === scenegraphNode) {\n child.matrix = modelMatrix;\n child.translation = undefined;\n child.rotation = undefined;\n child.scale = undefined;\n foundNodeInScene = true;\n return false;\n }\n return true;\n });\n }\n }\n gltf.scene = {\n id: scenegraphNodeName,\n name: scenegraphNodeName,\n nodes: [scenegraphNode]\n };\n gltf.scenes = [gltf.scene];\n\n return { scene: gltf.scene, scenes: gltf.scenes };\n } else {\n return gltf;\n }\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport async function loadGLTF(model: SpatialSceneNode, cache?: { [url: string]: Promise }): Promise {\n const gltfUrl = model.scenegraph as string;\n let gltfPromise: Promise;\n if (cache) {\n gltfPromise = cache[gltfUrl] || (cache[gltfUrl] = fetch(gltfUrl).then(r => r.blob()));\n } else {\n gltfPromise = fetch(gltfUrl);\n }\n // eslint-disable-next-line @typescript-eslint/naming-convention\n const gltf = await parse(gltfPromise, GLTFLoader, { DracoLoader, gltf: { decompressMeshes: true, postProcess: true } });\n\n if (!gltf.nodes) {\n console.log('WARNING: Empty Scene', gltfUrl, gltf);\n }\n\n return deriveScenegraph(model.scenegraphNode as string, gltf);\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport async function loadGLTF2(scenegraphNodeName: string, gltfPromise: Promise): Promise {\n return deriveScenegraph(scenegraphNodeName, await gltfPromise);\n}\n/* eslint-enable */\n","import { load } from '@loaders.gl/core';\nimport { DracoLoader } from '@loaders.gl/draco';\nimport { GLTFLoader } from '@loaders.gl/gltf';\nimport { Matrix4 } from '@math.gl/core';\nimport { AABB, Vec3 } from 'cannon-es';\n\nimport { SpatialSceneNode } from '../shared/spatial-scene-node';\nimport { traverseScene } from './scene-traversal';\n\n\ninterface Collision {\n '@id': string;\n name: string;\n hits: { '@id': string; name: string }[];\n}\n\n/* eslint-disable */\nexport async function doCollisions(scene: SpatialSceneNode[]): Promise {\n console.log('Starting Collisioning');\n const sourceBoxes = scene\n .filter(d => !d.scenegraph && d.geometry !== 'wireframe')\n .map(model => {\n const mat = new Matrix4(model.transformMatrix);\n const lowerBound = mat.transformAsPoint([-1, -1, -1], []);\n const upperBound = mat.transformAsPoint([1, 1, 1], []);\n return {\n '@id': model['@id'],\n name: model.tooltip,\n entityId: model.entityId,\n bbox: new AABB({\n lowerBound: new Vec3(...lowerBound.map((n, i) => Math.min(n, upperBound[i]))),\n upperBound: new Vec3(...upperBound.map((n, i) => Math.max(n, lowerBound[i])))\n })\n };\n });\n\n const targetBoxes: {'@id': string, name: string, entityId?: string; bbox: AABB, gltf: unknown}[] = [];\n for (const model of scene.filter(d => !!d.scenegraph)) {\n const gltf = await load(model.scenegraph as string, GLTFLoader, {DracoLoader, decompress: true, postProcess: true});\n for (const gltfScene of gltf.scenes) {\n traverseScene(gltfScene, new Matrix4(model.transformMatrix), (node, modelMatrix) => {\n if (node.mesh && node.mesh.primitives && node.mesh.primitives.length > 0) {\n for (const primitive of node.mesh.primitives) {\n if (primitive.attributes.POSITION && primitive.attributes.POSITION.min) {\n const lowerBound = modelMatrix.transformAsPoint(primitive.attributes.POSITION.min, []);\n const upperBound = modelMatrix.transformAsPoint(primitive.attributes.POSITION.max, []);\n targetBoxes.push({\n '@id': model['@id'],\n name: node.name,\n entityId: model.entityId,\n bbox: new AABB({\n lowerBound: new Vec3(...lowerBound.map((n, i) => Math.min(n, upperBound[i]))),\n upperBound: new Vec3(...upperBound.map((n, i) => Math.max(n, lowerBound[i])))\n }),\n gltf\n });\n }\n }\n }\n return true;\n });\n }\n }\n\n const report: Collision[] = [];\n const sad: unknown[] = [];\n for (const src of sourceBoxes) {\n const hits: {'@id': string, name: string}[] = [];\n for (const target of targetBoxes) {\n if (src.bbox.overlaps(target.bbox)) {\n hits.push({'@id': target['@id'], name: target.name});\n }\n }\n if (hits.length > 0) {\n report.push({\n '@id': src.entityId as string,\n name: src.name as string,\n hits\n });\n } else {\n sad.push(src);\n }\n }\n\n console.log({ sourceBoxes, targetBoxes, report, sad, maxHits: Math.max(...report.map(r => r.hits.length)) });\n\n const csvReport: unknown[] = [];\n for (const hit of report) {\n csvReport.push({\n 'Tissue ID': hit['@id'],\n 'Tissue Name': hit.name,\n 'Hit ID': '',\n 'Hit Name': ''\n });\n for (const h of hit.hits) {\n csvReport.push({\n 'Tissue ID': hit['@id'],\n 'Tissue Name': hit.name,\n 'Hit ID': h['@id'],\n 'Hit Name': h.name\n });\n }\n }\n console.log(csvReport);\n\n return report;\n}\n/* eslint-enable */\n","/* eslint-disable @typescript-eslint/no-unsafe-call */\nimport { CompositeLayer, COORDINATE_SYSTEM } from '@deck.gl/core';\nimport { TextLayer } from '@deck.gl/layers';\nimport { ScenegraphLayer, SimpleMeshLayer } from '@deck.gl/mesh-layers';\nimport { ConeGeometry, CubeGeometry, CylinderGeometry, Geometry, SphereGeometry } from '@luma.gl/core';\nimport { Matrix4 } from '@math.gl/core';\n\nimport { SpatialSceneNode } from './shared/spatial-scene-node';\nimport { loadGLTF, loadGLTF2, registerGLTFLoaders } from './util/load-gltf';\nimport { doCollisions } from './util/spatial-scene-collider';\n\n\nfunction meshLayer(id: string, data: SpatialSceneNode[], options: { [key: string]: unknown }): SimpleMeshLayer | undefined {\n if (!data || data.length === 0) {\n return undefined;\n } else {\n let mesh: Geometry;\n switch (options.geometry) {\n case 'sphere':\n mesh = new SphereGeometry();\n break;\n case 'cone':\n mesh = new ConeGeometry();\n break;\n case 'cylinder':\n mesh = new CylinderGeometry();\n break;\n case 'cube':\n default:\n mesh = new CubeGeometry();\n break;\n }\n return new SimpleMeshLayer({\n ...{\n id,\n pickable: true,\n autoHighlight: false,\n highlightColor: [30, 136, 229, 255],\n coordinateSystem: COORDINATE_SYSTEM.CARTESIAN,\n data,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n mesh: mesh as any,\n wireframe: false,\n getTransformMatrix: (d) => (d as { transformMatrix: number[][] }).transformMatrix,\n getColor: (d) => (d as { color: [number, number, number, number] }).color || [255, 255, 255, 0.9*255]\n },\n ...options\n });\n }\n}\n\nfunction textLayer(id: string, data: SpatialSceneNode[], options: { [key: string]: unknown }): TextLayer | undefined {\n if (!data || data.length === 0) {\n return undefined;\n } else {\n return new TextLayer({\n ...{\n id,\n pickable: true,\n data: data.map(d => ({ ...d, position: new Matrix4(d.transformMatrix).getTranslation() })),\n getText: (d) => (d as { text: string }).text,\n getPosition: (d) => (d as { position: [number, number] }).position,\n getColor: (d) => (d as { color: [number, number, number, number] }).color\n },\n ...options\n });\n }\n}\n\nexport class BodyUILayer extends CompositeLayer {\n static readonly layerName = 'BodyUILayer';\n static readonly gltfCache: { [url: string]: Promise } = {};\n\n initializeState(): void {\n const { data } = this.props;\n this.setState({ data: data ?? [], zoomOpacity: 0.8, doCollisions: false });\n registerGLTFLoaders();\n }\n\n renderLayers(): unknown[] {\n const state = this.state as { data: SpatialSceneNode[]; zoomOpacity: number; doCollisions: boolean };\n const geometries: Record = {\n 'sphere': [], 'cone': [], 'cylinder': [], 'cube': [], 'text': [], 'wireframe': [], 'scenegraph': []\n };\n\n for (const node of state.data) {\n const geometry = node.geometry ?? 'cube';\n if (node.scenegraph) {\n geometries.scenegraph.push(node);\n } else if (geometries[geometry] !== undefined) {\n geometries[geometry].push(node);\n }\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const url2gltf: { [url: string]: Promise } = {};\n for (const m of geometries.scenegraph) {\n if (m.scenegraph && m.scenegraphNode && !Object.prototype.hasOwnProperty.call(url2gltf, m.scenegraph)) {\n url2gltf[m.scenegraph] = loadGLTF({ scenegraph: m.scenegraph } as SpatialSceneNode, BodyUILayer.gltfCache);\n }\n }\n\n const layers: unknown[] = [];\n for (const [geometry, nodes] of Object.entries(geometries)) {\n if (geometry === 'scenegraph') {\n for (const model of nodes) {\n layers.push(\n new ScenegraphLayer({\n id: 'models-' + model['@id'],\n opacity: model.zoomBasedOpacity ? state.zoomOpacity : (model.opacity !== undefined ? model.opacity : 1.0),\n pickable: !model.unpickable,\n coordinateSystem: COORDINATE_SYSTEM.CARTESIAN,\n data: [model],\n scenegraph: model.scenegraphNode ?\n loadGLTF2(model.scenegraphNode, url2gltf[model.scenegraph as string]) :\n model.scenegraph as unknown as URL,\n // eslint-disable-next-line @typescript-eslint/naming-convention\n _lighting: model._lighting, // 'pbr' | undefined\n getTransformMatrix: model.transformMatrix as unknown as number[][],\n getColor: model.color ?? [0, 255, 0, 0.5*255],\n parameters: { depthMask: !model.zoomBasedOpacity && (model.opacity === undefined || model.opacity === 1) }\n })\n );\n }\n } else if (geometry === 'text') {\n layers.push(textLayer('text', nodes.filter(n => n.unpickable), { pickable: false }));\n layers.push(textLayer('textPickable', nodes.filter(n => !n.unpickable), { pickable: true }));\n } else if (geometry === 'wireframe') {\n layers.push(meshLayer(geometry, nodes, { wireframe: true, pickable: false, geometry }));\n } else {\n layers.push(meshLayer(geometry, nodes.filter(n => n.unpickable), { wireframe: false, pickable: false, geometry }));\n layers.push(meshLayer(`${geometry}Pickable`, nodes.filter(n => !n.unpickable), { wireframe: false, pickable: true, geometry }));\n }\n }\n\n if (state.doCollisions) {\n doCollisions(state.data);\n }\n\n return layers.filter(l => !!l);\n }\n\n getPickingInfo(\n e: Parameters['getPickingInfo']>[0]\n ): ReturnType['getPickingInfo']> {\n return e.info;\n }\n}\n","import { Matrix4 } from '@math.gl/core';\nimport { AABB, Vec3 } from 'cannon-es';\n\nimport { loadGLTF, registerGLTFLoaders } from './load-gltf';\nimport { traverseScene } from './scene-traversal';\nimport { SpatialSceneNode } from '../shared/spatial-scene-node';\n\n\nexport interface ProcessedNode extends SpatialSceneNode {\n bbox: AABB;\n jsonld: unknown;\n node: unknown;\n size: Vec3;\n center: Vec3;\n}\n\n/* eslint-disable */\nfunction childNames(scene, names: string[] = []): string[] {\n for (const child of (scene.nodes || scene.children || [])) {\n names.push(child.name);\n childNames(child, names);\n }\n return names;\n}\n\nexport async function processSceneNodes(gltfUrl: string, worldMatrix?: Matrix4, scenegraphNode?: string\n ): Promise<{ [node: string]: ProcessedNode}> {\n registerGLTFLoaders();\n const gltf = await loadGLTF({scenegraph: gltfUrl, scenegraphNode} as SpatialSceneNode);\n const nodes: {[node: string]: ProcessedNode} = {};\n const gltfNodes: ProcessedNode[] = [];\n for (const scene of gltf.scenes) {\n worldMatrix = new Matrix4(worldMatrix || Matrix4.IDENTITY);\n traverseScene(scene, worldMatrix, (node, modelMatrix: Matrix4) => {\n const processedNode: ProcessedNode = {\n '@id': (node.name || node.id) as string,\n '@type': 'ProcessedNode',\n transformMatrix: new Matrix4(modelMatrix),\n geometry: 'wireframe',\n node\n } as ProcessedNode;\n gltfNodes.push({\n '@id': `GLTF:${processedNode['@id']}`,\n '@type': 'GLTFNode',\n scenegraph: gltfUrl,\n scenegraphNode: processedNode['@id'],\n transformMatrix: new Matrix4(worldMatrix || Matrix4.IDENTITY),\n tooltip: (node.name || node.id) as string,\n color: [255, 255, 255, 255],\n _lighting: 'pbr',\n zoomBasedOpacity: true,\n node\n } as ProcessedNode);\n if (node.mesh && node.mesh.primitives && node.mesh.primitives.length > 0) {\n for (const primitive of node.mesh.primitives) {\n if (primitive.attributes.POSITION && primitive.attributes.POSITION.min) {\n const lowerBound = modelMatrix.transformAsPoint(primitive.attributes.POSITION.min, []);\n const upperBound = modelMatrix.transformAsPoint(primitive.attributes.POSITION.max, []);\n processedNode.bbox = new AABB({\n lowerBound: new Vec3(...lowerBound.map((n, i) => Math.min(n, upperBound[i]))),\n upperBound: new Vec3(...upperBound.map((n, i) => Math.max(n, lowerBound[i])))\n });\n }\n }\n }\n nodes[processedNode['@id']] = processedNode;\n return true;\n });\n }\n\n for (const node of Object.values(nodes).filter(n => !n.bbox)) {\n for (const child of childNames(node.node).map(n => nodes[n]).filter(n => n.bbox)) {\n if (!node.bbox) {\n node.bbox = child.bbox.clone();\n } else {\n node.bbox.extend(child.bbox);\n }\n }\n if (!node.bbox) {\n delete nodes[node['@id']];\n }\n }\n for (const node of Object.values(nodes)) {\n const lb = node.bbox.lowerBound;\n const ub = node.bbox.upperBound;\n const size = node.size = ub.clone().vsub(lb);\n const halfSize = size.clone().vmul(new Vec3(0.5, 0.5, 0.5));\n const center = node.center = lb.clone().vadd(halfSize);\n\n node.transformMatrix = new Matrix4(Matrix4.IDENTITY)\n .translate(center.toArray())\n .scale(halfSize.toArray());\n }\n for (const node of gltfNodes) {\n nodes[node['@id']] = node;\n }\n return nodes;\n}\n/* eslint-enable */\n","/* eslint-disable @typescript-eslint/consistent-type-assertions */\n/* eslint-disable @typescript-eslint/member-ordering */\nimport { AmbientLight, Deck, LightingEffect, OrbitView, OrthographicView } from '@deck.gl/core';\nimport { ViewStateProps } from '@deck.gl/core/lib/deck';\nimport { Matrix4 } from '@math.gl/core';\nimport bind from 'bind-decorator';\nimport { BehaviorSubject, Subject } from 'rxjs';\nimport { share } from 'rxjs/operators';\n\nimport { BodyUILayer } from './body-ui-layer';\nimport { SpatialSceneNode } from './shared/spatial-scene-node';\nimport { processSceneNodes } from './util/process-scene-nodes';\n\n\ninterface BodyUIViewStateProps extends ViewStateProps {\n orbitAxis?: string;\n target?: Matrix4 | number[];\n zoom: number;\n rotationOrbit: number;\n rotationX: number;\n camera: string;\n}\n\nexport interface BodyUIProps {\n id: string;\n canvas: string | HTMLCanvasElement;\n parent: HTMLElement;\n debugSceneNodeProcessing?: boolean;\n target: Matrix4 | number[];\n interactive: boolean;\n rotation: number;\n minRotationX: number;\n maxRotationX: number;\n zoom: number;\n legacyLighting?: boolean;\n camera: string;\n}\n\nexport interface PickInfo {\n layer: unknown;\n index: number;\n object: D;\n x: number;\n y: number;\n coordinate?: unknown;\n picked?: boolean;\n}\n\nexport type NodeDragEvent = { node: SpatialSceneNode; info: PickInfo; e: MouseEvent };\n\nexport type NodeClickEvent = { node: SpatialSceneNode; ctrlClick: boolean };\n\n/**\n * A convenience wrapper class for the CCF Body UI\n */\nexport class BodyUI {\n deck: Deck;\n private readonly bodyUILayer = new BodyUILayer({});\n\n private readonly nodeClickSubject = new Subject();\n private readonly nodeHoverStartSubject = new Subject();\n private readonly nodeHoverStopSubject = new Subject();\n private readonly sceneRotationSubject = new BehaviorSubject<[number, number]>([0, 0]);\n private readonly nodeDragStartSubject = new Subject();\n private readonly nodeDragSubject = new Subject();\n private readonly nodeDragEndSubject = new Subject();\n\n readonly nodeClick$ = this.nodeClickSubject.pipe(share());\n readonly nodeHoverStart$ = this.nodeHoverStartSubject.pipe(share());\n readonly nodeHoverStop$ = this.nodeHoverStopSubject.pipe(share());\n readonly sceneRotation$ = this.sceneRotationSubject.pipe(share());\n readonly nodeDragStart$ = this.nodeDragStartSubject.pipe(share());\n readonly nodeDrag$ = this.nodeDragSubject.pipe(share());\n readonly nodeDragEnd$ = this.nodeDragEndSubject.pipe(share());\n\n private cursor?: string;\n private lastHovered?: SpatialSceneNode;\n\n constructor(private deckProps: Partial) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const props: any = {\n ...deckProps,\n views: [ deckProps.camera === 'orthographic' ? new OrthographicView({\n flipY: false,\n near: -1000\n }) : new OrbitView({ orbitAxis: 'Y' }) ],\n controller: deckProps.interactive !== undefined ? deckProps.interactive : true,\n layers: [ this.bodyUILayer ],\n onHover: this._onHover,\n onClick: this._onClick,\n onViewStateChange: this._onViewStateChange,\n onDragStart: this._onDragStart,\n onDrag: this._onDrag,\n onDragEnd: this._onDragEnd,\n getCursor: (e: { isDragging: boolean }) => this.cursor ?? (e.isDragging ? 'grabbing' : 'grab')\n };\n if (deckProps.legacyLighting) {\n // eslint-disable-next-line\n props.effects = [\n new LightingEffect({\n ambientLight: new AmbientLight({\n color: [255, 255, 255],\n intensity: 10.0\n })\n })\n ];\n }\n // eslint-disable-next-line\n this.deck = new Deck(props);\n this.deck.setProps({\n viewState: {\n orbitAxis: 'Y',\n minRotationX: deckProps.minRotationX ?? -15,\n maxRotationX: deckProps.maxRotationX ?? 15,\n target: deckProps.target ?? [0.5, 0.5, 0],\n rotationX: 0,\n rotationOrbit: deckProps.rotation ?? 0,\n zoom: deckProps.zoom ?? 9.5,\n camera: deckProps.camera\n } as BodyUIViewStateProps\n });\n if (deckProps.rotation) {\n this.sceneRotationSubject.next([deckProps.rotation, 0]);\n }\n }\n\n async initialize(): Promise {\n while (!this.bodyUILayer.state) {\n // eslint-disable-next-line no-await-in-loop\n await new Promise(r => {\n setTimeout(r, 200);\n });\n }\n }\n\n finalize(): void {\n this.deck.finalize();\n }\n\n setScene(data: SpatialSceneNode[]): void {\n if (data?.length > 0) {\n let zoomOpacity = (this.bodyUILayer.state as { zoomOpacity: number }).zoomOpacity;\n let didZoom = false;\n for (const node of data) {\n if (node.zoomToOnLoad) {\n this.zoomTo(node);\n didZoom = true;\n }\n }\n zoomOpacity = didZoom ? 0.05 : zoomOpacity;\n if (!this.deckProps.debugSceneNodeProcessing) {\n this.bodyUILayer.setState({ data, zoomOpacity });\n } else {\n this.debugSceneNodeProcessing(data, zoomOpacity);\n }\n }\n }\n\n debugSceneNodeProcessing(data: SpatialSceneNode[], zoomOpacity: number): void {\n // const gltfUrl = 'https://hubmapconsortium.github.io/ccf-3d-reference-object-library/VH_Male/United/VHM_United_Color.glb';\n const gltfUrl = 'https://hubmapconsortium.github.io/ccf-3d-reference-object-library/VH_Female/United/VHF_United_Color.glb';\n // const gltfUrl = 'https://hubmapconsortium.github.io/hubmap-ontology/objects/VHF_United_v01_060420.glb';\n const gltfTransform = new Matrix4([0.076,0,0,0,0,0.076,1.6875389974302382e-17,0,0,-1.6875389974302382e-17,0.076,0,0.49,0.034,0.11,1]);\n processSceneNodes(gltfUrl, gltfTransform, 'VHF_Kidney_L_Low1').then((results) => {\n console.log('results', results);\n console.log('data', data);\n // data = Object.values(results);\n data = data.concat(Object.values(results));\n data.push({\n '@id': 'TEST',\n '@type': 'TEST',\n scenegraph: gltfUrl,\n scenegraphNode: 'VHF_Kidney_R_Low',\n transformMatrix: gltfTransform,\n color: [255, 255, 255, 200],\n // eslint-disable-next-line @typescript-eslint/naming-convention\n _lighting: 'pbr',\n zoomBasedOpacity: false\n });\n this.bodyUILayer.setState({ data, zoomOpacity });\n });\n }\n\n zoomTo(node: SpatialSceneNode): void {\n const matrix = new Matrix4(node.transformMatrix);\n this.deck.setProps({\n viewState: {\n ...this.deck.props.viewState,\n target: matrix.getTranslation(),\n rotationX: 0,\n rotationOrbit: 0,\n zoom: 11.5,\n } as BodyUIViewStateProps\n });\n }\n\n setRotation(value: number): void {\n this.deck.setProps({\n viewState: {\n ...this.deck.props.viewState,\n rotationOrbit: value\n } as BodyUIViewStateProps\n });\n }\n\n setRotationX(value: number): void {\n this.deck.setProps({\n viewState: {\n ...this.deck.props.viewState,\n rotationX: value\n } as BodyUIViewStateProps\n });\n }\n\n setZoom(value: number): void {\n this.deck.setProps({\n viewState: {\n ...this.deck.props.viewState,\n zoom: value\n } as BodyUIViewStateProps\n });\n }\n\n setTarget(value: number[]): void {\n this.deck.setProps({\n viewState: {\n ...this.deck.props.viewState,\n target: value\n } as BodyUIViewStateProps\n });\n }\n\n setInteractive(value: boolean): void {\n this.deck.setProps({\n controller: value\n });\n }\n\n @bind\n private _onHover(e: { picked: boolean; object: SpatialSceneNode }): void {\n const { lastHovered } = this;\n this.cursor = e.picked ? 'pointer' : undefined;\n if (e.picked && e.object && e.object['@id']) {\n if (lastHovered !== e.object) {\n if (lastHovered) {\n this.nodeHoverStopSubject.next(lastHovered);\n }\n this.lastHovered = e.object;\n this.nodeHoverStartSubject.next(e.object);\n }\n } else if (lastHovered) {\n this.nodeHoverStopSubject.next(lastHovered);\n this.lastHovered = undefined;\n }\n }\n\n @bind\n private _onClick(info: PickInfo, e: { srcEvent: { ctrlKey: boolean } }): void {\n if (info.picked && info.object && info.object['@id']) {\n this.nodeClickSubject.next({ node: info.object, ctrlClick: e?.srcEvent?.ctrlKey ?? undefined });\n }\n }\n\n @bind\n private _onViewStateChange(event: { interactionState: { isZooming: boolean }; viewState: BodyUIViewStateProps }): void {\n if (event.interactionState?.isZooming) {\n const currentState = this.bodyUILayer.state as { zoomOpacity: number; data: unknown };\n const zoomOpacity = Math.min(Math.max(1 - (event.viewState.zoom - 8.9) / 2, 0.05), 1.0);\n if (currentState.zoomOpacity !== zoomOpacity) {\n this.bodyUILayer.setState({ data: currentState.data, zoomOpacity });\n }\n }\n this.deck.setProps({ viewState: { ...event.viewState } });\n this.sceneRotationSubject.next([event.viewState.rotationOrbit, event.viewState.rotationX]);\n }\n\n @bind\n private _onDragStart(info: PickInfo, e: MouseEvent): void {\n this._dragEvent(info, e, this.nodeDragStartSubject);\n }\n\n @bind\n private _onDrag(info: PickInfo, e: MouseEvent): void {\n this._dragEvent(info, e, this.nodeDragSubject);\n }\n\n @bind\n private _onDragEnd(info: PickInfo, e: MouseEvent): void {\n this._dragEvent(info, e, this.nodeDragEndSubject);\n }\n\n private _dragEvent(info: PickInfo, e: MouseEvent, subject: Subject): void {\n if (info?.object?.['@id']) {\n subject.next({ node: info.object, info, e });\n }\n }\n}\n","import { Matrix4 } from '@math.gl/core';\nimport { AABB, Vec3 } from 'cannon-es';\n\nimport { SpatialSceneNode } from '../shared/spatial-scene-node';\nimport { loadGLTF } from './load-gltf';\nimport { traverseScene } from './scene-traversal';\n\n\nexport async function simplifyScene(nodes: SpatialSceneNode[]): Promise {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const gltfCache: { [url: string]: any } = {};\n const gltfUrls = new Set(nodes.map(n => n.scenegraph).filter(n => !!n));\n for (const gltfUrl of gltfUrls) {\n // eslint-disable-next-line no-await-in-loop\n gltfCache[gltfUrl as string] = await loadGLTF({ scenegraph: gltfUrl } as SpatialSceneNode);\n }\n const newNodes: SpatialSceneNode[] = nodes.filter(n => !n.scenegraph);\n\n for (const model of nodes.filter(n => n.scenegraph)) {\n const gltf = gltfCache[model.scenegraph as string];\n const bbox = new AABB();\n let worldMatrix = new Matrix4(model.transformMatrix);\n\n /* eslint-disable */\n if (model.scenegraphNode) {\n const scenegraphNode = model.scenegraphNode ? gltf.nodes.find((n) => n.name === model.scenegraphNode) : undefined;\n let foundNodeInScene = false;\n for (const scene of gltf.scenes) {\n if (!foundNodeInScene) {\n traverseScene(scene, new Matrix4(model.transformMatrix), (child, modelMatrix) => {\n if (child === scenegraphNode) {\n worldMatrix = modelMatrix;\n foundNodeInScene = true;\n return false;\n }\n return true;\n });\n }\n }\n gltf.scene = {\n id: model.scenegraphNode,\n name: model.scenegraphNode,\n nodes: [scenegraphNode]\n };\n }\n\n traverseScene(gltf.scene, worldMatrix, (node, modelMatrix) => {\n if (node.mesh && node.mesh.primitives && node.mesh.primitives.length > 0) {\n for (const primitive of node.mesh.primitives) {\n if (primitive.attributes.POSITION && primitive.attributes.POSITION.min) {\n const lowerBound = modelMatrix.transformAsPoint(primitive.attributes.POSITION.min, []);\n const upperBound = modelMatrix.transformAsPoint(primitive.attributes.POSITION.max, []);\n const innerBbox = new AABB({\n lowerBound: new Vec3(...lowerBound.map((n, i) => Math.min(n, upperBound[i]))),\n upperBound: new Vec3(...upperBound.map((n, i) => Math.max(n, lowerBound[i])))\n });\n bbox.extend(innerBbox);\n }\n }\n }\n return true;\n });\n /* eslint-enable */\n\n const size = bbox.upperBound.clone().vsub(bbox.lowerBound);\n const halfSize = size.clone().vmul(new Vec3(0.5, 0.5, 0.5));\n const position = bbox.lowerBound.clone().vadd(halfSize);\n const transformMatrix = new Matrix4(Matrix4.IDENTITY)\n .translate(position.toArray())\n .scale(halfSize.toArray());\n const newNode: SpatialSceneNode = {\n ...model,\n transformMatrix,\n geometry: 'wireframe'\n };\n delete newNode.scenegraph;\n delete newNode.scenegraphNode;\n\n newNodes.push(newNode);\n }\n return newNodes;\n}\n","// Hack to support deck.gl and other typings\n// eslint-disable-next-line @typescript-eslint/triple-slash-reference\n/// \n\n/*\n * Public API Surface of ccf-body-ui\n */\nexport * from './lib/body-ui-layer';\nexport * from './lib/body-ui';\nexport * from './lib/shared/spatial-scene-node';\nexport * from './lib/shared/ccf-spatial-jsonld';\n\nexport * from './lib/util/load-gltf';\nexport * from './lib/util/scene-traversal';\nexport * from './lib/util/spatial-scene-collider';\nexport * from './lib/util/process-scene-nodes';\nexport * from './lib/util/simplify-scene';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["Matrix4","registerLoaders","DracoWorkerLoader","GLTFLoader","parse","gltf","AABB","Vec3","load","SphereGeometry","ConeGeometry","CylinderGeometry","CubeGeometry","SimpleMeshLayer","COORDINATE_SYSTEM","TextLayer","ScenegraphLayer","CompositeLayer","Subject","BehaviorSubject","share","OrthographicView","OrbitView","LightingEffect","AmbientLight","Deck","bind"],"mappings":";;;;;;;;;;IAAA;;;;;;;;;;;;;;IAcA;IAEA,IAAI,aAAa,GAAG,UAAS,CAAC,EAAE,CAAC;QAC7B,aAAa,GAAG,MAAM,CAAC,cAAc;aAChC,EAAE,SAAS,EAAE,EAAE,EAAE,YAAY,KAAK,IAAI,UAAU,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,SAAS,GAAG,CAAC,CAAC,EAAE,CAAC;YAC5E,UAAU,CAAC,EAAE,CAAC,IAAI,KAAK,IAAI,CAAC,IAAI,CAAC;gBAAE,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC;oBAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QACtG,OAAO,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAC/B,CAAC,CAAC;aAEc,SAAS,CAAC,CAAC,EAAE,CAAC;QAC1B,IAAI,OAAO,CAAC,KAAK,UAAU,IAAI,CAAC,KAAK,IAAI;YACrC,MAAM,IAAI,SAAS,CAAC,sBAAsB,GAAG,MAAM,CAAC,CAAC,CAAC,GAAG,+BAA+B,CAAC,CAAC;QAC9F,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QACpB,SAAS,EAAE,KAAK,IAAI,CAAC,WAAW,GAAG,CAAC,CAAC,EAAE;QACvC,CAAC,CAAC,SAAS,GAAG,CAAC,KAAK,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,SAAS,GAAG,CAAC,CAAC,SAAS,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;IACzF,CAAC;IAEM,IAAI,QAAQ,GAAG;QAClB,QAAQ,GAAG,MAAM,CAAC,MAAM,IAAI,SAAS,QAAQ,CAAC,CAAC;YAC3C,KAAK,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;gBACjD,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC;gBACjB,KAAK,IAAI,CAAC,IAAI,CAAC;oBAAE,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC;wBAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;aAChF;YACD,OAAO,CAAC,CAAC;SACZ,CAAA;QACD,OAAO,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;IAC3C,CAAC,CAAA;aAEe,MAAM,CAAC,CAAC,EAAE,CAAC;QACvB,IAAI,CAAC,GAAG,EAAE,CAAC;QACX,KAAK,IAAI,CAAC,IAAI,CAAC;YAAE,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC;gBAC/E,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QAChB,IAAI,CAAC,IAAI,IAAI,IAAI,OAAO,MAAM,CAAC,qBAAqB,KAAK,UAAU;YAC/D,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,qBAAqB,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;gBACpE,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,MAAM,CAAC,SAAS,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;oBAC1E,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;aACzB;QACL,OAAO,CAAC,CAAC;IACb,CAAC;aAEe,UAAU,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI;QACpD,IAAI,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,MAAM,GAAG,IAAI,KAAK,IAAI,GAAG,IAAI,GAAG,MAAM,CAAC,wBAAwB,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,EAAE,CAAC,CAAC;QAC7H,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,OAAO,CAAC,QAAQ,KAAK,UAAU;YAAE,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC;;YAC1H,KAAK,IAAI,CAAC,GAAG,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE;gBAAE,IAAI,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC;oBAAE,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC;QAClJ,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;IAClE,CAAC;aAEe,OAAO,CAAC,UAAU,EAAE,SAAS;QACzC,OAAO,UAAU,MAAM,EAAE,GAAG,IAAI,SAAS,CAAC,MAAM,EAAE,GAAG,EAAE,UAAU,CAAC,CAAC,EAAE,CAAA;IACzE,CAAC;aAEe,UAAU,CAAC,WAAW,EAAE,aAAa;QACjD,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,OAAO,CAAC,QAAQ,KAAK,UAAU;YAAE,OAAO,OAAO,CAAC,QAAQ,CAAC,WAAW,EAAE,aAAa,CAAC,CAAC;IACnI,CAAC;aAEe,SAAS,CAAC,OAAO,EAAE,UAAU,EAAE,CAAC,EAAE,SAAS;QACvD,SAAS,KAAK,CAAC,KAAK,IAAI,OAAO,KAAK,YAAY,CAAC,GAAG,KAAK,GAAG,IAAI,CAAC,CAAC,UAAU,OAAO,IAAI,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE;QAC5G,OAAO,KAAK,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC,EAAE,UAAU,OAAO,EAAE,MAAM;YACrD,SAAS,SAAS,CAAC,KAAK,IAAI,IAAI;gBAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;aAAE;YAAC,OAAO,CAAC,EAAE;gBAAE,MAAM,CAAC,CAAC,CAAC,CAAC;aAAE,EAAE;YAC3F,SAAS,QAAQ,CAAC,KAAK,IAAI,IAAI;gBAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;aAAE;YAAC,OAAO,CAAC,EAAE;gBAAE,MAAM,CAAC,CAAC,CAAC,CAAC;aAAE,EAAE;YAC9F,SAAS,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC,EAAE;YAC9G,IAAI,CAAC,CAAC,SAAS,GAAG,SAAS,CAAC,KAAK,CAAC,OAAO,EAAE,UAAU,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC;SACzE,CAAC,CAAC;IACP,CAAC;aAEe,WAAW,CAAC,OAAO,EAAE,IAAI;QACrC,IAAI,CAAC,GAAG,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,cAAa,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;gBAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;QACjH,OAAO,CAAC,GAAG,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,OAAO,MAAM,KAAK,UAAU,KAAK,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,cAAa,OAAO,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;QACzJ,SAAS,IAAI,CAAC,CAAC,IAAI,OAAO,UAAU,CAAC,IAAI,OAAO,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE;QAClE,SAAS,IAAI,CAAC,EAAE;YACZ,IAAI,CAAC;gBAAE,MAAM,IAAI,SAAS,CAAC,iCAAiC,CAAC,CAAC;YAC9D,OAAO,CAAC;gBAAE,IAAI;oBACV,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI;wBAAE,OAAO,CAAC,CAAC;oBAC7J,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;wBAAE,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC;oBACxC,QAAQ,EAAE,CAAC,CAAC,CAAC;wBACT,KAAK,CAAC,CAAC;wBAAC,KAAK,CAAC;4BAAE,CAAC,GAAG,EAAE,CAAC;4BAAC,MAAM;wBAC9B,KAAK,CAAC;4BAAE,CAAC,CAAC,KAAK,EAAE,CAAC;4BAAC,OAAO,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;wBACxD,KAAK,CAAC;4BAAE,CAAC,CAAC,KAAK,EAAE,CAAC;4BAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;4BAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC;4BAAC,SAAS;wBACjD,KAAK,CAAC;4BAAE,EAAE,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC;4BAAC,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;4BAAC,SAAS;wBACjD;4BACI,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE;gCAAE,CAAC,GAAG,CAAC,CAAC;gCAAC,SAAS;6BAAE;4BAC5G,IAAI,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE;gCAAE,CAAC,CAAC,KAAK,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;gCAAC,MAAM;6BAAE;4BACtF,IAAI,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE;gCAAE,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;gCAAC,CAAC,GAAG,EAAE,CAAC;gCAAC,MAAM;6BAAE;4BACrE,IAAI,CAAC,IAAI,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE;gCAAE,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;gCAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;gCAAC,MAAM;6BAAE;4BACnE,IAAI,CAAC,CAAC,CAAC,CAAC;gCAAE,CAAC,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC;4BACtB,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;4BAAC,SAAS;qBAC9B;oBACD,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;iBAC9B;gBAAC,OAAO,CAAC,EAAE;oBAAE,EAAE,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;oBAAC,CAAC,GAAG,CAAC,CAAC;iBAAE;wBAAS;oBAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;iBAAE;YAC1D,IAAI,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC;gBAAE,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC;YAAC,OAAO,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;SACpF;IACL,CAAC;IAEM,IAAI,eAAe,GAAG,MAAM,CAAC,MAAM,IAAI,UAAS,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE;QAC9D,IAAI,EAAE,KAAK,SAAS;YAAE,EAAE,GAAG,CAAC,CAAC;QAC7B,MAAM,CAAC,cAAc,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,cAAa,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IACzF,CAAC,KAAK,UAAS,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE;QACtB,IAAI,EAAE,KAAK,SAAS;YAAE,EAAE,GAAG,CAAC,CAAC;QAC7B,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IACjB,CAAC,CAAC,CAAC;aAEa,YAAY,CAAC,CAAC,EAAE,CAAC;QAC7B,KAAK,IAAI,CAAC,IAAI,CAAC;YAAE,IAAI,CAAC,KAAK,SAAS,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC;gBAAE,eAAe,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IAClH,CAAC;aAEe,QAAQ,CAAC,CAAC;QACtB,IAAI,CAAC,GAAG,OAAO,MAAM,KAAK,UAAU,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;QAC9E,IAAI,CAAC;YAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACxB,IAAI,CAAC,IAAI,OAAO,CAAC,CAAC,MAAM,KAAK,QAAQ;YAAE,OAAO;gBAC1C,IAAI,EAAE;oBACF,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,MAAM;wBAAE,CAAC,GAAG,KAAK,CAAC,CAAC;oBACnC,OAAO,EAAE,KAAK,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC;iBAC3C;aACJ,CAAC;QACF,MAAM,IAAI,SAAS,CAAC,CAAC,GAAG,yBAAyB,GAAG,iCAAiC,CAAC,CAAC;IAC3F,CAAC;aAEe,MAAM,CAAC,CAAC,EAAE,CAAC;QACvB,IAAI,CAAC,GAAG,OAAO,MAAM,KAAK,UAAU,IAAI,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QAC3D,IAAI,CAAC,CAAC;YAAE,OAAO,CAAC,CAAC;QACjB,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC;QACjC,IAAI;YACA,OAAO,CAAC,CAAC,KAAK,KAAK,CAAC,IAAI,CAAC,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,IAAI;gBAAE,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;SAC9E;QACD,OAAO,KAAK,EAAE;YAAE,CAAC,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;SAAE;gBAC/B;YACJ,IAAI;gBACA,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,CAAC;oBAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;aACpD;oBACO;gBAAE,IAAI,CAAC;oBAAE,MAAM,CAAC,CAAC,KAAK,CAAC;aAAE;SACpC;QACD,OAAO,EAAE,CAAC;IACd,CAAC;IAED;aACgB,QAAQ;QACpB,KAAK,IAAI,EAAE,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE;YAC9C,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACzC,OAAO,EAAE,CAAC;IACd,CAAC;IAED;aACgB,cAAc;QAC1B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,EAAE,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE;YAAE,CAAC,IAAI,SAAS,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;QACpF,KAAK,IAAI,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE;YAC5C,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,EAAE;gBAC7D,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QACpB,OAAO,CAAC,CAAC;IACb,CAAC;aAEe,aAAa,CAAC,EAAE,EAAE,IAAI,EAAE,IAAI;QACxC,IAAI,IAAI,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC;YAAE,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,EAAE,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;gBACjF,IAAI,EAAE,IAAI,EAAE,CAAC,IAAI,IAAI,CAAC,EAAE;oBACpB,IAAI,CAAC,EAAE;wBAAE,EAAE,GAAG,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;oBACrD,EAAE,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;iBACnB;aACJ;QACD,OAAO,EAAE,CAAC,MAAM,CAAC,EAAE,IAAI,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAC7D,CAAC;aAEe,OAAO,CAAC,CAAC;QACrB,OAAO,IAAI,YAAY,OAAO,IAAI,IAAI,CAAC,CAAC,GAAG,CAAC,EAAE,IAAI,IAAI,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC;IACzE,CAAC;aAEe,gBAAgB,CAAC,OAAO,EAAE,UAAU,EAAE,SAAS;QAC3D,IAAI,CAAC,MAAM,CAAC,aAAa;YAAE,MAAM,IAAI,SAAS,CAAC,sCAAsC,CAAC,CAAC;QACvF,IAAI,CAAC,GAAG,SAAS,CAAC,KAAK,CAAC,OAAO,EAAE,UAAU,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC;QAC9D,OAAO,CAAC,GAAG,EAAE,EAAE,IAAI,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,GAAG,cAAc,OAAO,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC;QACtH,SAAS,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC;YAAE,CAAC,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,IAAI,OAAO,IAAI,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE;QAC1I,SAAS,MAAM,CAAC,CAAC,EAAE,CAAC,IAAI,IAAI;YAAE,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;SAAE;QAAC,OAAO,CAAC,EAAE;YAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;SAAE,EAAE;QAClF,SAAS,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,YAAY,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE;QACxH,SAAS,OAAO,CAAC,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,EAAE;QAClD,SAAS,MAAM,CAAC,KAAK,IAAI,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,EAAE;QAClD,SAAS,MAAM,CAAC,CAAC,EAAE,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,MAAM;YAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE;IACtF,CAAC;aAEe,gBAAgB,CAAC,CAAC;QAC9B,IAAI,CAAC,EAAE,CAAC,CAAC;QACT,OAAO,CAAC,GAAG,EAAE,EAAE,IAAI,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,OAAO,EAAE,UAAU,CAAC,IAAI,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,cAAc,OAAO,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC;QAC5I,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,IAAI,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,KAAK,QAAQ,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE;IACnJ,CAAC;aAEe,aAAa,CAAC,CAAC;QAC3B,IAAI,CAAC,MAAM,CAAC,aAAa;YAAE,MAAM,IAAI,SAAS,CAAC,sCAAsC,CAAC,CAAC;QACvF,IAAI,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC;QACnC,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,OAAO,QAAQ,KAAK,UAAU,GAAG,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC,GAAG,EAAE,EAAE,IAAI,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,GAAG,cAAc,OAAO,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;QACjN,SAAS,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,UAAU,CAAC,IAAI,OAAO,IAAI,OAAO,CAAC,UAAU,OAAO,EAAE,MAAM,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE;QAChK,SAAS,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,UAAS,CAAC,IAAI,OAAO,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC,EAAE;IAChI,CAAC;aAEe,oBAAoB,CAAC,MAAM,EAAE,GAAG;QAC5C,IAAI,MAAM,CAAC,cAAc,EAAE;YAAE,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC;SAAE;aAAM;YAAE,MAAM,CAAC,GAAG,GAAG,GAAG,CAAC;SAAE;QAC/G,OAAO,MAAM,CAAC;IAClB,CAAC;IAAA,CAAC;IAEF,IAAI,kBAAkB,GAAG,MAAM,CAAC,MAAM,IAAI,UAAS,CAAC,EAAE,CAAC;QACnD,MAAM,CAAC,cAAc,CAAC,CAAC,EAAE,SAAS,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC;IACxE,CAAC,IAAI,UAAS,CAAC,EAAE,CAAC;QACd,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;IACrB,CAAC,CAAC;aAEc,YAAY,CAAC,GAAG;QAC5B,IAAI,GAAG,IAAI,GAAG,CAAC,UAAU;YAAE,OAAO,GAAG,CAAC;QACtC,IAAI,MAAM,GAAG,EAAE,CAAC;QAChB,IAAI,GAAG,IAAI,IAAI;YAAE,KAAK,IAAI,CAAC,IAAI,GAAG;gBAAE,IAAI,CAAC,KAAK,SAAS,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;oBAAE,eAAe,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC;QACzI,kBAAkB,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QAChC,OAAO,MAAM,CAAC;IAClB,CAAC;aAEe,eAAe,CAAC,GAAG;QAC/B,OAAO,CAAC,GAAG,IAAI,GAAG,CAAC,UAAU,IAAI,GAAG,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC;IAC5D,CAAC;aAEe,sBAAsB,CAAC,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;QAC3D,IAAI,IAAI,KAAK,GAAG,IAAI,CAAC,CAAC;YAAE,MAAM,IAAI,SAAS,CAAC,+CAA+C,CAAC,CAAC;QAC7F,IAAI,OAAO,KAAK,KAAK,UAAU,GAAG,QAAQ,KAAK,KAAK,IAAI,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC;YAAE,MAAM,IAAI,SAAS,CAAC,0EAA0E,CAAC,CAAC;QACnL,OAAO,IAAI,KAAK,GAAG,GAAG,CAAC,GAAG,IAAI,KAAK,GAAG,GAAG,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IAClG,CAAC;aAEe,sBAAsB,CAAC,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;QAClE,IAAI,IAAI,KAAK,GAAG;YAAE,MAAM,IAAI,SAAS,CAAC,gCAAgC,CAAC,CAAC;QACxE,IAAI,IAAI,KAAK,GAAG,IAAI,CAAC,CAAC;YAAE,MAAM,IAAI,SAAS,CAAC,+CAA+C,CAAC,CAAC;QAC7F,IAAI,OAAO,KAAK,KAAK,UAAU,GAAG,QAAQ,KAAK,KAAK,IAAI,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC;YAAE,MAAM,IAAI,SAAS,CAAC,yEAAyE,CAAC,CAAC;QAClL,OAAO,CAAC,IAAI,KAAK,GAAG,GAAG,CAAC,CAAC,IAAI,CAAC,QAAQ,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,KAAK,GAAG,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,QAAQ,EAAE,KAAK,CAAC,GAAG,KAAK,CAAC;IAC9G;;ICxOA;aACgB,aAAa,CAAC,KAAK,EAAE,WAAoB,EAAE,OAA8B;;QACvF,IAAI,CAAC,WAAW,EAAE;YAChB,WAAW,GAAG,IAAIA,YAAO,CAACA,YAAO,CAAC,QAAQ,CAAC,CAAC;SAC7C;QACD,IAAM,MAAM,GAAG,IAAIA,YAAO,CAACA,YAAO,CAAC,QAAQ,CAAC,CAAC;QAC7C,IAAI,CAAC,KAAK,EAAE;YACV,OAAO,IAAI,CAAC;SACb;aAAM,IAAI,KAAK,CAAC,MAAM,EAAE;YACvB,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;SAC3B;aAAM;YACL,MAAM,CAAC,QAAQ,EAAE,CAAC;YAElB,IAAI,KAAK,CAAC,WAAW,EAAE;gBACrB,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;aACrC;YAED,IAAI,KAAK,CAAC,QAAQ,EAAE;gBAClB,IAAM,cAAc,GAAG,IAAIA,YAAO,CAACA,YAAO,CAAC,QAAQ,CAAC,CAAC,cAAc,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;gBACpF,MAAM,CAAC,aAAa,CAAC,cAAc,CAAC,CAAC;aACtC;YAED,IAAI,KAAK,CAAC,KAAK,EAAE;gBACf,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;aAC3B;SACF;QACD,IAAM,WAAW,GAAG,IAAIA,YAAO,CAAC,WAAW,CAAC,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;QACnE,IAAI,OAAO,CAAC,KAAK,EAAE,WAAW,EAAE,WAAW,CAAC,KAAK,KAAK,EAAE;YACtD,OAAO,KAAK,CAAC;SACd;;YACD,KAAoB,IAAA,KAAA,UAAC,KAAK,CAAC,KAAK,IAAI,KAAK,CAAC,QAAQ,IAAI,EAAE,EAAC,gBAAA,4BAAE;gBAAtD,IAAM,KAAK,WAAA;gBACd,IAAI,aAAa,CAAC,KAAK,EAAE,WAAW,EAAE,OAAO,CAAC,KAAK,KAAK,EAAE;oBACxD,OAAO,KAAK,CAAC;iBACd;aACF;;;;;;;;;QACD,OAAO,IAAI,CAAC;IACd;;aC/BgB,mBAAmB;QACjCC,sBAAe,CAAC,CAACC,uBAAiB,EAAEC,eAAU,CAAC,CAAC,CAAC;IACnD,CAAC;IAED;aACgB,gBAAgB,CAAC,kBAA0B,EAAE,IAAS;;;QACpE,IAAM,cAAc,GAAG,MAAA,IAAI,CAAC,KAAK,0CAAE,IAAI,CAAC,UAAC,CAAC,IAAK,OAAA,CAAC,CAAC,IAAI,KAAK,kBAAkB,GAAA,CAAC,CAAC;QAC9E,IAAI,cAAc,EAAE;YAClB,IAAI,kBAAgB,GAAG,KAAK,CAAC;;gBAC7B,KAAoB,IAAA,KAAA,SAAA,IAAI,CAAC,MAAM,CAAA,gBAAA,4BAAE;oBAA5B,IAAM,KAAK,WAAA;oBACd,IAAI,CAAC,kBAAgB,EAAE;wBACrB,aAAa,CAAC,KAAK,EAAE,IAAIH,YAAO,CAACA,YAAO,CAAC,QAAQ,CAAC,EAAE,UAAC,KAAK,EAAE,WAAW;4BACrE,IAAI,KAAK,KAAK,cAAc,EAAE;gCAC5B,KAAK,CAAC,MAAM,GAAG,WAAW,CAAC;gCAC3B,KAAK,CAAC,WAAW,GAAG,SAAS,CAAC;gCAC9B,KAAK,CAAC,QAAQ,GAAG,SAAS,CAAC;gCAC3B,KAAK,CAAC,KAAK,GAAG,SAAS,CAAC;gCACxB,kBAAgB,GAAG,IAAI,CAAC;gCACxB,OAAO,KAAK,CAAC;6BACd;4BACD,OAAO,IAAI,CAAC;yBACb,CAAC,CAAC;qBACJ;iBACF;;;;;;;;;YACD,IAAI,CAAC,KAAK,GAAG;gBACX,EAAE,EAAE,kBAAkB;gBACtB,IAAI,EAAE,kBAAkB;gBACxB,KAAK,EAAE,CAAC,cAAc,CAAC;aACxB,CAAC;YACF,IAAI,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YAE3B,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC;SACnD;aAAM;YACL,OAAO,IAAI,CAAC;SACb;IACH,CAAC;IAED;aACsB,QAAQ,CAAC,KAAuB,EAAE,KAAwC;;;;;;wBACxF,OAAO,GAAG,KAAK,CAAC,UAAoB,CAAC;wBAE3C,IAAI,KAAK,EAAE;4BACT,WAAW,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,KAAK,CAAC,OAAO,CAAC,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,IAAI,EAAE,GAAA,CAAC,CAAC,CAAC;yBACvF;6BAAM;4BACL,WAAW,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC;yBAC9B;wBAEY,qBAAMI,YAAK,CAAC,WAAW,EAAED,eAAU,EAAE,EAAE,WAAW,mBAAA,EAAE,IAAI,EAAE,EAAE,gBAAgB,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,EAAE,CAAC,EAAA;;wBAAjHE,MAAI,GAAG,SAA0G;wBAEvH,IAAI,CAACA,MAAI,CAAC,KAAK,EAAE;4BACf,OAAO,CAAC,GAAG,CAAC,sBAAsB,EAAE,OAAO,EAAEA,MAAI,CAAC,CAAC;yBACpD;wBAED,sBAAO,gBAAgB,CAAC,KAAK,CAAC,cAAwB,EAAEA,MAAI,CAAC,EAAC;;;SAC/D;KAAA;IAED;aACsB,SAAS,CAAC,kBAA0B,EAAE,WAAyB;;;;;;wBAC5E,KAAA,gBAAgB,CAAA;8BAAC,kBAAkB;wBAAE,qBAAM,WAAW,EAAA;4BAA7D,sBAAO,4BAAqC,SAAiB,GAAC,EAAC;;;SAChE;KAAA;IACD;;ICvDA;aACsB,YAAY,CAAC,KAAyB;;;;;;;wBAC1D,OAAO,CAAC,GAAG,CAAC,uBAAuB,CAAC,CAAC;wBAC/B,WAAW,GAAG,KAAK;6BACtB,MAAM,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,CAAC,UAAU,IAAI,CAAC,CAAC,QAAQ,KAAK,WAAW,GAAA,CAAC;6BACxD,GAAG,CAAC,UAAA,KAAK;4BACR,IAAM,GAAG,GAAG,IAAIL,YAAO,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC;4BAC/C,IAAM,UAAU,GAAG,GAAG,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;4BAC1D,IAAM,UAAU,GAAG,GAAG,CAAC,gBAAgB,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;4BACvD,OAAO;gCACL,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC;gCACnB,IAAI,EAAE,KAAK,CAAC,OAAO;gCACnB,QAAQ,EAAE,KAAK,CAAC,QAAQ;gCACxB,IAAI,EAAE,IAAIM,aAAI,CAAC;oCACb,UAAU,OAAMC,aAAI,YAAJA,aAAI,iCAAI,UAAU,CAAC,GAAG,CAAC,UAAC,CAAC,EAAE,CAAC,IAAK,OAAA,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC,GAAA,CAAC,MAAC;oCAC7E,UAAU,OAAMA,aAAI,YAAJA,aAAI,iCAAI,UAAU,CAAC,GAAG,CAAC,UAAC,CAAC,EAAE,CAAC,IAAK,OAAA,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC,GAAA,CAAC,MAAC;iCAC9E,CAAC;6BACH,CAAC;yBACH,CAAC,CAAC;wBAEC,WAAW,GAAkF,EAAE,CAAC;4CAC3F,KAAK;;;;;4CACD,qBAAMC,WAAI,CAAC,KAAK,CAAC,UAAoB,EAAEL,eAAU,EAAE,EAAC,WAAW,mBAAA,EAAE,UAAU,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAC,CAAC,EAAA;;wCAA7GE,MAAI,GAAG,SAAsG;;4CACnH,KAAwB,oBAAA,SAAAA,MAAI,CAAC,MAAM,CAAA,CAAA,4CAAE;gDAA1B,SAAS;gDAClB,aAAa,CAAC,SAAS,EAAE,IAAIL,YAAO,CAAC,KAAK,CAAC,eAAe,CAAC,EAAE,UAAC,IAAI,EAAE,WAAW;;oDAC7E,IAAI,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE;gFAC7D,SAAS;4DAClB,IAAI,SAAS,CAAC,UAAU,CAAC,QAAQ,IAAI,SAAS,CAAC,UAAU,CAAC,QAAQ,CAAC,GAAG,EAAE;gEACtE,IAAM,YAAU,GAAG,WAAW,CAAC,gBAAgB,CAAC,SAAS,CAAC,UAAU,CAAC,QAAQ,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;gEACvF,IAAM,YAAU,GAAG,WAAW,CAAC,gBAAgB,CAAC,SAAS,CAAC,UAAU,CAAC,QAAQ,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;gEACvF,WAAW,CAAC,IAAI,CAAC;oEACf,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC;oEACnB,IAAI,EAAE,IAAI,CAAC,IAAI;oEACf,QAAQ,EAAE,KAAK,CAAC,QAAQ;oEACxB,IAAI,EAAE,IAAIM,aAAI,CAAC;wEACb,UAAU,OAAMC,aAAI,YAAJA,aAAI,iCAAI,YAAU,CAAC,GAAG,CAAC,UAAC,CAAC,EAAE,CAAC,IAAK,OAAA,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,YAAU,CAAC,CAAC,CAAC,CAAC,GAAA,CAAC,MAAC;wEAC7E,UAAU,OAAMA,aAAI,YAAJA,aAAI,iCAAI,YAAU,CAAC,GAAG,CAAC,UAAC,CAAC,EAAE,CAAC,IAAK,OAAA,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,YAAU,CAAC,CAAC,CAAC,CAAC,GAAA,CAAC,MAAC;qEAC9E,CAAC;oEACF,IAAI,QAAA;iEACL,CAAC,CAAC;6DACJ;;;4DAdH,KAAwB,IAAA,oBAAA,SAAA,IAAI,CAAC,IAAI,CAAC,UAAU,CAAA,CAAA,gBAAA;gEAAvC,IAAM,SAAS,WAAA;wEAAT,SAAS;6DAenB;;;;;;;;;qDACF;oDACD,OAAO,IAAI,CAAC;iDACb,CAAC,CAAC;6CACJ;;;;;;;;;;;;;;;;wBAxBiB,KAAA,SAAA,KAAK,CAAC,MAAM,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,CAAC,CAAC,UAAU,GAAA,CAAC,CAAA;;;;wBAA1C,KAAK;sDAAL,KAAK;;;;;;;;;;;;;;;;;;;wBA2BV,MAAM,GAAgB,EAAE,CAAC;wBACzB,GAAG,GAAc,EAAE,CAAC;;4BAC1B,KAAkB,gBAAA,SAAA,WAAW,CAAA,yGAAE;gCAApB,GAAG;gCACN,IAAI,GAAoC,EAAE,CAAC;;oCACjD,KAAqB,+BAAA,SAAA,WAAW,CAAA,CAAA,yGAAE;wCAAvB,MAAM;wCACf,IAAI,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE;4CAClC,IAAI,CAAC,IAAI,CAAC,EAAC,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAC,CAAC,CAAC;yCACtD;qCACF;;;;;;;;;gCACD,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE;oCACnB,MAAM,CAAC,IAAI,CAAC;wCACV,KAAK,EAAE,GAAG,CAAC,QAAkB;wCAC7B,IAAI,EAAE,GAAG,CAAC,IAAc;wCACxB,IAAI,MAAA;qCACL,CAAC,CAAC;iCACJ;qCAAM;oCACL,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;iCACf;6BACF;;;;;;;;;wBAED,OAAO,CAAC,GAAG,CAAC,EAAE,WAAW,aAAA,EAAE,WAAW,aAAA,EAAE,MAAM,QAAA,EAAE,GAAG,KAAA,EAAE,OAAO,EAAE,IAAI,CAAC,GAAG,OAAR,IAAI,2BAAQ,MAAM,CAAC,GAAG,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,IAAI,CAAC,MAAM,GAAA,CAAC,GAAC,EAAE,CAAC,CAAC;wBAEvG,SAAS,GAAc,EAAE,CAAC;;4BAChC,KAAkB,WAAA,SAAA,MAAM,CAAA,gFAAE;gCAAf,GAAG;gCACZ,SAAS,CAAC,IAAI,CAAC;oCACb,WAAW,EAAE,GAAG,CAAC,KAAK,CAAC;oCACvB,aAAa,EAAE,GAAG,CAAC,IAAI;oCACvB,QAAQ,EAAE,EAAE;oCACZ,UAAU,EAAE,EAAE;iCACf,CAAC,CAAC;;oCACH,KAAgB,oBAAA,SAAA,GAAG,CAAC,IAAI,CAAA,CAAA,4CAAE;wCAAf,CAAC;wCACV,SAAS,CAAC,IAAI,CAAC;4CACb,WAAW,EAAE,GAAG,CAAC,KAAK,CAAC;4CACvB,aAAa,EAAE,GAAG,CAAC,IAAI;4CACvB,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC;4CAClB,UAAU,EAAE,CAAC,CAAC,IAAI;yCACnB,CAAC,CAAC;qCACJ;;;;;;;;;6BACF;;;;;;;;;wBACD,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;wBAEvB,sBAAO,MAAM,EAAC;;;SACf;KAAA;IACD;;IC/FA,SAAS,SAAS,CAAC,EAAU,EAAE,IAAwB,EAAE,OAAmC;QAC1F,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE;YAC9B,OAAO,SAAS,CAAC;SAClB;aAAM;YACL,IAAI,IAAc,SAAA,CAAC;YACnB,QAAQ,OAAO,CAAC,QAAQ;gBACtB,KAAK,QAAQ;oBACX,IAAI,GAAG,IAAIE,qBAAc,EAAE,CAAC;oBAC5B,MAAM;gBACR,KAAK,MAAM;oBACT,IAAI,GAAG,IAAIC,mBAAY,EAAE,CAAC;oBAC1B,MAAM;gBACR,KAAK,UAAU;oBACb,IAAI,GAAG,IAAIC,uBAAgB,EAAE,CAAC;oBAC9B,MAAM;gBACR,KAAK,MAAM,CAAC;gBACZ;oBACE,IAAI,GAAG,IAAIC,mBAAY,EAAE,CAAC;oBAC1B,MAAM;aACT;YACD,OAAO,IAAIC,0BAAe,eACrB;gBACD,EAAE,IAAA;gBACF,QAAQ,EAAE,IAAI;gBACd,aAAa,EAAE,KAAK;gBACpB,cAAc,EAAE,CAAC,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;gBACnC,gBAAgB,EAAEC,wBAAiB,CAAC,SAAS;gBAC7C,IAAI,MAAA;;gBAEJ,IAAI,EAAE,IAAW;gBACjB,SAAS,EAAE,KAAK;gBAChB,kBAAkB,EAAE,UAAC,CAAC,IAAM,OAAA,CAAqC,CAAC,eAAe,GAAA;gBACjF,QAAQ,EAAE,UAAC,CAAC,IAAM,OAAA,CAAiD,CAAC,KAAK,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,GAAC,GAAG,CAAC,GAAA;aACtG,EACE,OAAO,EACV,CAAC;SACJ;IACH,CAAC;IAED,SAAS,SAAS,CAAC,EAAU,EAAE,IAAwB,EAAE,OAAmC;QAC1F,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE;YAC9B,OAAO,SAAS,CAAC;SAClB;aAAM;YACL,OAAO,IAAIC,gBAAS,eACf;gBACD,EAAE,IAAA;gBACF,QAAQ,EAAE,IAAI;gBACd,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,UAAA,CAAC,IAAI,wCAAM,CAAC,KAAE,QAAQ,EAAE,IAAIf,YAAO,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,cAAc,EAAE,OAAG,CAAC;gBAC1F,OAAO,EAAE,UAAC,CAAC,IAAM,OAAA,CAAsB,CAAC,IAAI,GAAA;gBAC5C,WAAW,EAAE,UAAC,CAAC,IAAM,OAAA,CAAoC,CAAC,QAAQ,GAAA;gBAClE,QAAQ,EAAE,UAAC,CAAC,IAAM,OAAA,CAAiD,CAAC,KAAK,GAAA;aAC1E,EACE,OAAO,EACV,CAAC;SACJ;IACH,CAAC;;QAEgC,+BAAgC;QAAjE;;;QAIE,qCAAe,GAAf;YACU,IAAA,IAAI,GAAK,IAAI,CAAC,KAAK,KAAf,CAAgB;YAC5B,IAAI,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,IAAI,aAAJ,IAAI,cAAJ,IAAI,GAAI,EAAE,EAAE,WAAW,EAAE,GAAG,EAAE,YAAY,EAAE,KAAK,EAAE,CAAC,CAAC;YAC3E,mBAAmB,EAAE,CAAC;SACvB;QAED,kCAAY,GAAZ;;;YACE,IAAM,KAAK,GAAG,IAAI,CAAC,KAAiF,CAAC;YACrG,IAAM,UAAU,GAAuC;gBACrD,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,UAAU,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,WAAW,EAAE,EAAE,EAAE,YAAY,EAAE,EAAE;aACpG,CAAC;;gBAEF,KAAmB,IAAA,KAAA,SAAA,KAAK,CAAC,IAAI,CAAA,gBAAA,4BAAE;oBAA1B,IAAM,IAAI,WAAA;oBACb,IAAM,QAAQ,GAAG,MAAA,IAAI,CAAC,QAAQ,mCAAI,MAAM,CAAC;oBACzC,IAAI,IAAI,CAAC,UAAU,EAAE;wBACnB,UAAU,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;qBAClC;yBAAM,IAAI,UAAU,CAAC,QAAQ,CAAC,KAAK,SAAS,EAAE;wBAC7C,UAAU,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;qBACjC;iBACF;;;;;;;;;;YAGD,IAAM,QAAQ,GAAoC,EAAE,CAAC;;gBACrD,KAAgB,IAAA,KAAA,SAAA,UAAU,CAAC,UAAU,CAAA,gBAAA,4BAAE;oBAAlC,IAAM,CAAC,WAAA;oBACV,IAAI,CAAC,CAAC,UAAU,IAAI,CAAC,CAAC,cAAc,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC,UAAU,CAAC,EAAE;wBACrG,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,GAAG,QAAQ,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC,UAAU,EAAsB,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;qBAC5G;iBACF;;;;;;;;;YAED,IAAM,MAAM,GAAc,EAAE,CAAC;;gBAC7B,KAAgC,IAAA,KAAA,SAAA,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,CAAA,gBAAA,4BAAE;oBAAjD,IAAA,KAAA,mBAAiB,EAAhB,QAAQ,QAAA,EAAE,KAAK,QAAA;oBACzB,IAAI,QAAQ,KAAK,YAAY,EAAE;;4BAC7B,KAAoB,IAAA,yBAAA,SAAA,KAAK,CAAA,CAAA,4BAAA,+CAAE;gCAAtB,IAAM,KAAK,kBAAA;gCACd,MAAM,CAAC,IAAI,CACT,IAAIgB,0BAAe,CAAC;oCAClB,EAAE,EAAE,SAAS,GAAG,KAAK,CAAC,KAAK,CAAC;oCAC5B,OAAO,EAAE,KAAK,CAAC,gBAAgB,GAAG,KAAK,CAAC,WAAW,IAAI,KAAK,CAAC,OAAO,KAAK,SAAS,GAAG,KAAK,CAAC,OAAO,GAAG,GAAG,CAAC;oCACzG,QAAQ,EAAE,CAAC,KAAK,CAAC,UAAU;oCAC3B,gBAAgB,EAAEF,wBAAiB,CAAC,SAAS;oCAC7C,IAAI,EAAE,CAAC,KAAK,CAAC;oCACb,UAAU,EAAE,KAAK,CAAC,cAAc;wCAC9B,SAAS,CAAC,KAAK,CAAC,cAAc,EAAE,QAAQ,CAAC,KAAK,CAAC,UAAoB,CAAC,CAAC;wCACrE,KAAK,CAAC,UAA4B;;oCAEpC,SAAS,EAAE,KAAK,CAAC,SAAS;oCAC1B,kBAAkB,EAAE,KAAK,CAAC,eAAwC;oCAClE,QAAQ,EAAE,MAAA,KAAK,CAAC,KAAK,mCAAI,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,GAAC,GAAG,CAAC;oCAC7C,UAAU,EAAE,EAAE,SAAS,EAAE,CAAC,KAAK,CAAC,gBAAgB,KAAK,KAAK,CAAC,OAAO,KAAK,SAAS,IAAI,KAAK,CAAC,OAAO,KAAK,CAAC,CAAC,EAAE;iCAC3G,CAAC,CACH,CAAC;6BACH;;;;;;;;;qBACF;yBAAM,IAAI,QAAQ,KAAK,MAAM,EAAE;wBAC9B,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,UAAU,GAAA,CAAC,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC;wBACrF,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,cAAc,EAAE,KAAK,CAAC,MAAM,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,CAAC,UAAU,GAAA,CAAC,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;qBAC9F;yBAAM,IAAI,QAAQ,KAAK,WAAW,EAAE;wBACnC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,KAAK,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,UAAA,EAAE,CAAC,CAAC,CAAC;qBACzF;yBAAM;wBACL,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,KAAK,CAAC,MAAM,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,UAAU,GAAA,CAAC,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,UAAA,EAAE,CAAC,CAAC,CAAC;wBACnH,MAAM,CAAC,IAAI,CAAC,SAAS,CAAI,QAAQ,aAAU,EAAE,KAAK,CAAC,MAAM,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,CAAC,UAAU,GAAA,CAAC,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,UAAA,EAAE,CAAC,CAAC,CAAC;qBACjI;iBACF;;;;;;;;;YAED,IAAI,KAAK,CAAC,YAAY,EAAE;gBACtB,YAAY,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;aAC1B;YAED,OAAO,MAAM,CAAC,MAAM,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,CAAC,GAAA,CAAC,CAAC;SAChC;QAED,oCAAc,GAAd,UACE,CAAoE;YAEpE,OAAO,CAAC,CAAC,IAAI,CAAC;SACf;;KA7EH,CAAiCG,qBAAgC;IAC/C,qBAAS,GAAG,aAAa,CAAC;IAC1B,qBAAS,GAAqC,EAAE;;ICvDlE;IACA,SAAS,UAAU,CAAC,KAAK,EAAE,KAAoB;;QAApB,sBAAA,EAAA,UAAoB;;YAC7C,KAAoB,IAAA,KAAA,UAAC,KAAK,CAAC,KAAK,IAAI,KAAK,CAAC,QAAQ,IAAI,EAAE,EAAC,gBAAA,4BAAE;gBAAtD,IAAM,KAAK,WAAA;gBACd,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;gBACvB,UAAU,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;aAC1B;;;;;;;;;QACD,OAAO,KAAK,CAAC;IACf,CAAC;aAEqB,iBAAiB,CAAC,OAAe,EAAE,WAAqB,EAAE,cAAuB;;;;;;;wBAErG,mBAAmB,EAAE,CAAC;wBACT,qBAAM,QAAQ,CAAC,EAAC,UAAU,EAAE,OAAO,EAAE,cAAc,gBAAA,EAAqB,CAAC,EAAA;;wBAAhF,IAAI,GAAG,SAAyE;wBAChF,KAAK,GAAoC,EAAE,CAAC;wBAC5C,SAAS,GAAoB,EAAE,CAAC;;4BACtC,KAAoB,KAAA,SAAA,IAAI,CAAC,MAAM,CAAA,4CAAE;gCAAtB,KAAK;gCACd,WAAW,GAAG,IAAIjB,YAAO,CAAC,WAAW,IAAIA,YAAO,CAAC,QAAQ,CAAC,CAAC;gCAC3D,aAAa,CAAC,KAAK,EAAE,WAAW,EAAE,UAAC,IAAI,EAAE,WAAoB;;oCAC3D,IAAM,aAAa,GAAkB;wCACnC,KAAK,GAAG,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,EAAE,CAAW;wCACvC,OAAO,EAAE,eAAe;wCACxB,eAAe,EAAE,IAAIA,YAAO,CAAC,WAAW,CAAC;wCACzC,QAAQ,EAAE,WAAW;wCACrB,IAAI,MAAA;qCACY,CAAC;oCACnB,SAAS,CAAC,IAAI,CAAC;wCACb,KAAK,EAAE,UAAQ,aAAa,CAAC,KAAK,CAAG;wCACrC,OAAO,EAAE,UAAU;wCACnB,UAAU,EAAE,OAAO;wCACnB,cAAc,EAAE,aAAa,CAAC,KAAK,CAAC;wCACpC,eAAe,EAAE,IAAIA,YAAO,CAAC,WAAW,IAAIA,YAAO,CAAC,QAAQ,CAAC;wCAC7D,OAAO,GAAG,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,EAAE,CAAW;wCACzC,KAAK,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;wCAC3B,SAAS,EAAE,KAAK;wCAChB,gBAAgB,EAAE,IAAI;wCACtB,IAAI,MAAA;qCACY,CAAC,CAAC;oCACpB,IAAI,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE;gEAC7D,SAAS;4CAClB,IAAI,SAAS,CAAC,UAAU,CAAC,QAAQ,IAAI,SAAS,CAAC,UAAU,CAAC,QAAQ,CAAC,GAAG,EAAE;gDACtE,IAAM,YAAU,GAAG,WAAW,CAAC,gBAAgB,CAAC,SAAS,CAAC,UAAU,CAAC,QAAQ,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;gDACvF,IAAM,YAAU,GAAG,WAAW,CAAC,gBAAgB,CAAC,SAAS,CAAC,UAAU,CAAC,QAAQ,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;gDACvF,aAAa,CAAC,IAAI,GAAG,IAAIM,aAAI,CAAC;oDAC5B,UAAU,OAAMC,aAAI,YAAJA,aAAI,iCAAI,YAAU,CAAC,GAAG,CAAC,UAAC,CAAC,EAAE,CAAC,IAAK,OAAA,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,YAAU,CAAC,CAAC,CAAC,CAAC,GAAA,CAAC,MAAC;oDAC7E,UAAU,OAAMA,aAAI,YAAJA,aAAI,iCAAI,YAAU,CAAC,GAAG,CAAC,UAAC,CAAC,EAAE,CAAC,IAAK,OAAA,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,YAAU,CAAC,CAAC,CAAC,CAAC,GAAA,CAAC,MAAC;iDAC9E,CAAC,CAAC;6CACJ;;;4CARH,KAAwB,IAAA,oBAAA,SAAA,IAAI,CAAC,IAAI,CAAC,UAAU,CAAA,CAAA,gBAAA;gDAAvC,IAAM,SAAS,WAAA;wDAAT,SAAS;6CASnB;;;;;;;;;qCACF;oCACD,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,GAAG,aAAa,CAAC;oCAC5C,OAAO,IAAI,CAAC;iCACb,CAAC,CAAC;6BACJ;;;;;;;;;;4BAED,KAAmB,KAAA,SAAA,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,CAAC,IAAI,GAAA,CAAC,CAAA,4CAAE;gCAAnD,IAAI;;oCACb,KAAoB,oBAAA,SAAA,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,UAAA,CAAC,IAAI,OAAA,KAAK,CAAC,CAAC,CAAC,GAAA,CAAC,CAAC,MAAM,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,IAAI,GAAA,CAAC,CAAA,CAAA,4CAAE;wCAAvE,KAAK;wCACd,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE;4CACd,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;yCAChC;6CAAM;4CACL,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;yCAC9B;qCACF;;;;;;;;;gCACD,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE;oCACd,OAAO,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;iCAC3B;6BACF;;;;;;;;;;4BACD,KAAmB,KAAA,SAAA,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA,4CAAE;gCAA9B,IAAI;gCACP,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC;gCAC1B,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC;gCAC1B,IAAI,GAAG,IAAI,CAAC,IAAI,GAAG,EAAE,CAAC,KAAK,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;gCACvC,QAAQ,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC,IAAI,CAAC,IAAIA,aAAI,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;gCACtD,MAAM,GAAG,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC,KAAK,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;gCAEvD,IAAI,CAAC,eAAe,GAAG,IAAIP,YAAO,CAACA,YAAO,CAAC,QAAQ,CAAC;qCACjD,SAAS,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;qCAC3B,KAAK,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAC;6BAC9B;;;;;;;;;;4BACD,KAAmB,cAAA,SAAA,SAAS,CAAA,+FAAE;gCAAnB,IAAI;gCACb,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,IAAI,CAAC;6BAC3B;;;;;;;;;wBACD,sBAAO,KAAK,EAAC;;;SACd;KAAA;IACD;;IC9CA;;;;QA0BE,gBAAoB,SAA+B;YAAnD,iBA8CC;;YA9CmB,cAAS,GAAT,SAAS,CAAsB;YArBlC,gBAAW,GAAG,IAAI,WAAW,CAAC,EAAE,CAAC,CAAC;YAElC,qBAAgB,GAAG,IAAIkB,YAAO,EAAkB,CAAC;YACjD,0BAAqB,GAAG,IAAIA,YAAO,EAAoB,CAAC;YACxD,yBAAoB,GAAG,IAAIA,YAAO,EAAoB,CAAC;YACvD,yBAAoB,GAAG,IAAIC,oBAAe,CAAmB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;YACrE,yBAAoB,GAAG,IAAID,YAAO,EAAiB,CAAC;YACpD,oBAAe,GAAG,IAAIA,YAAO,EAAiB,CAAC;YAC/C,uBAAkB,GAAG,IAAIA,YAAO,EAAiB,CAAC;YAE1D,eAAU,GAAG,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAACE,eAAK,EAAE,CAAC,CAAC;YACjD,oBAAe,GAAG,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAACA,eAAK,EAAE,CAAC,CAAC;YAC3D,mBAAc,GAAG,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAACA,eAAK,EAAE,CAAC,CAAC;YACzD,mBAAc,GAAG,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAACA,eAAK,EAAE,CAAC,CAAC;YACzD,mBAAc,GAAG,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAACA,eAAK,EAAE,CAAC,CAAC;YACzD,cAAS,GAAG,IAAI,CAAC,eAAe,CAAC,IAAI,CAACA,eAAK,EAAE,CAAC,CAAC;YAC/C,iBAAY,GAAG,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAACA,eAAK,EAAE,CAAC,CAAC;;YAO5D,IAAM,KAAK,mCACN,SAAS,KACZ,KAAK,EAAE,CAAE,SAAS,CAAC,MAAM,KAAK,cAAc,GAAG,IAAIC,uBAAgB,CAAC;wBAClE,KAAK,EAAE,KAAK;wBACZ,IAAI,EAAE,CAAC,IAAI;qBACZ,CAAC,GAAG,IAAIC,gBAAS,CAAC,EAAE,SAAS,EAAE,GAAG,EAAE,CAAC,CAAE,EACxC,UAAU,EAAE,SAAS,CAAC,WAAW,KAAK,SAAS,GAAG,SAAS,CAAC,WAAW,GAAG,IAAI,EAC9E,MAAM,EAAE,CAAE,IAAI,CAAC,WAAW,CAAE,EAC5B,OAAO,EAAE,IAAI,CAAC,QAAQ,EACtB,OAAO,EAAE,IAAI,CAAC,QAAQ,EACtB,iBAAiB,EAAE,IAAI,CAAC,kBAAkB,EAC1C,WAAW,EAAE,IAAI,CAAC,YAAY,EAC9B,MAAM,EAAE,IAAI,CAAC,OAAO,EACpB,SAAS,EAAE,IAAI,CAAC,UAAU,EAC1B,SAAS,EAAE,UAAC,CAA0B,YAAK,OAAA,MAAA,KAAI,CAAC,MAAM,oCAAK,CAAC,CAAC,UAAU,GAAG,UAAU,GAAG,MAAM,CAAC,CAAA,EAAA,GAC/F,CAAC;YACF,IAAI,SAAS,CAAC,cAAc,EAAE;;gBAE5B,KAAK,CAAC,OAAO,GAAG;oBACd,IAAIC,qBAAc,CAAC;wBACjB,YAAY,EAAE,IAAIC,mBAAY,CAAC;4BAC7B,KAAK,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;4BACtB,SAAS,EAAE,IAAI;yBAChB,CAAC;qBACH,CAAC;iBACH,CAAC;aACH;;YAED,IAAI,CAAC,IAAI,GAAG,IAAIC,WAAI,CAAC,KAAK,CAAC,CAAC;YAC5B,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC;gBACjB,SAAS,EAAE;oBACT,SAAS,EAAE,GAAG;oBACd,YAAY,EAAE,MAAA,SAAS,CAAC,YAAY,mCAAI,CAAC,EAAE;oBAC3C,YAAY,EAAE,MAAA,SAAS,CAAC,YAAY,mCAAI,EAAE;oBAC1C,MAAM,EAAE,MAAA,SAAS,CAAC,MAAM,mCAAI,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC;oBACzC,SAAS,EAAE,CAAC;oBACZ,aAAa,EAAE,MAAA,SAAS,CAAC,QAAQ,mCAAI,CAAC;oBACtC,IAAI,EAAE,MAAA,SAAS,CAAC,IAAI,mCAAI,GAAG;oBAC3B,MAAM,EAAE,SAAS,CAAC,MAAM;iBACD;aAC1B,CAAC,CAAC;YACH,IAAI,SAAS,CAAC,QAAQ,EAAE;gBACtB,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,CAAC;aACzD;SACF;QAEK,2BAAU,GAAV;;;;;iCACG,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK;;4BAE5B,qBAAM,IAAI,OAAO,CAAC,UAAA,CAAC;oCACjB,UAAU,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;iCACpB,CAAC,EAAA;;;4BAFF,SAEE,CAAC;;;;;aAEN;SAAA;QAED,yBAAQ,GAAR;YACE,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;SACtB;QAED,yBAAQ,GAAR,UAAS,IAAwB;;YAC/B,IAAI,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,MAAM,IAAG,CAAC,EAAE;gBACpB,IAAI,WAAW,GAAI,IAAI,CAAC,WAAW,CAAC,KAAiC,CAAC,WAAW,CAAC;gBAClF,IAAI,OAAO,GAAG,KAAK,CAAC;;oBACpB,KAAmB,IAAA,SAAA,SAAA,IAAI,CAAA,0BAAA,4CAAE;wBAApB,IAAM,IAAI,iBAAA;wBACb,IAAI,IAAI,CAAC,YAAY,EAAE;4BACrB,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;4BAClB,OAAO,GAAG,IAAI,CAAC;yBAChB;qBACF;;;;;;;;;gBACD,WAAW,GAAG,OAAO,GAAG,IAAI,GAAG,WAAW,CAAC;gBAC3C,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,wBAAwB,EAAE;oBAC5C,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,EAAE,IAAI,MAAA,EAAE,WAAW,aAAA,EAAE,CAAC,CAAC;iBAClD;qBAAM;oBACL,IAAI,CAAC,wBAAwB,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;iBAClD;aACF;SACF;QAED,yCAAwB,GAAxB,UAAyB,IAAwB,EAAE,WAAmB;YAAtE,iBAuBC;;YArBC,IAAM,OAAO,GAAG,0GAA0G,CAAC;;YAE3H,IAAM,aAAa,GAAG,IAAIzB,YAAO,CAAC,CAAC,KAAK,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,KAAK,EAAC,sBAAsB,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,sBAAsB,EAAC,KAAK,EAAC,CAAC,EAAC,IAAI,EAAC,KAAK,EAAC,IAAI,EAAC,CAAC,CAAC,CAAC,CAAC;YACtI,iBAAiB,CAAC,OAAO,EAAE,aAAa,EAAE,mBAAmB,CAAC,CAAC,IAAI,CAAC,UAAC,OAAO;gBAC1E,OAAO,CAAC,GAAG,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;gBAChC,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;;gBAE1B,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC;gBAC3C,IAAI,CAAC,IAAI,CAAC;oBACR,KAAK,EAAE,MAAM;oBACb,OAAO,EAAE,MAAM;oBACf,UAAU,EAAE,OAAO;oBACnB,cAAc,EAAE,kBAAkB;oBAClC,eAAe,EAAE,aAAa;oBAC9B,KAAK,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;;oBAE3B,SAAS,EAAE,KAAK;oBAChB,gBAAgB,EAAE,KAAK;iBACxB,CAAC,CAAC;gBACH,KAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,EAAE,IAAI,MAAA,EAAE,WAAW,aAAA,EAAE,CAAC,CAAC;aAClD,CAAC,CAAC;SACJ;QAED,uBAAM,GAAN,UAAO,IAAsB;YAC3B,IAAM,MAAM,GAAG,IAAIA,YAAO,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;YACjD,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC;gBACjB,SAAS,EAAE,gCACN,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,KAC5B,MAAM,EAAE,MAAM,CAAC,cAAc,EAAE,EAC/B,SAAS,EAAE,CAAC,EACZ,aAAa,EAAE,CAAC,EAChB,IAAI,EAAE,IAAI,GACa;aAC1B,CAAC,CAAC;SACJ;QAED,4BAAW,GAAX,UAAY,KAAa;YACvB,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC;gBACjB,SAAS,EAAE,gCACN,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,KAC5B,aAAa,EAAE,KAAK,GACG;aAC1B,CAAC,CAAC;SACJ;QAED,6BAAY,GAAZ,UAAa,KAAa;YACxB,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC;gBACjB,SAAS,EAAE,gCACN,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,KAC5B,SAAS,EAAE,KAAK,GACO;aAC1B,CAAC,CAAC;SACJ;QAED,wBAAO,GAAP,UAAQ,KAAa;YACnB,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC;gBACjB,SAAS,EAAE,gCACN,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,KAC5B,IAAI,EAAE,KAAK,GACY;aAC1B,CAAC,CAAC;SACJ;QAED,0BAAS,GAAT,UAAU,KAAe;YACvB,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC;gBACjB,SAAS,EAAE,gCACN,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,KAC5B,MAAM,EAAE,KAAK,GACU;aAC1B,CAAC,CAAC;SACJ;QAED,+BAAc,GAAd,UAAe,KAAc;YAC3B,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC;gBACjB,UAAU,EAAE,KAAK;aAClB,CAAC,CAAC;SACJ;QAGO,yBAAQ,GAAR,UAAS,CAAgD;YACvD,IAAA,WAAW,GAAK,IAAI,YAAT,CAAU;YAC7B,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,MAAM,GAAG,SAAS,GAAG,SAAS,CAAC;YAC/C,IAAI,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE;gBAC3C,IAAI,WAAW,KAAK,CAAC,CAAC,MAAM,EAAE;oBAC5B,IAAI,WAAW,EAAE;wBACf,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;qBAC7C;oBACD,IAAI,CAAC,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC;oBAC5B,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;iBAC3C;aACF;iBAAM,IAAI,WAAW,EAAE;gBACtB,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;gBAC5C,IAAI,CAAC,WAAW,GAAG,SAAS,CAAC;aAC9B;SACF;QAGO,yBAAQ,GAAR,UAAS,IAAgC,EAAE,CAAqC;;YACtF,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE;gBACpD,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,MAAM,EAAE,SAAS,EAAE,MAAA,MAAA,CAAC,aAAD,CAAC,uBAAD,CAAC,CAAE,QAAQ,0CAAE,OAAO,mCAAI,SAAS,EAAE,CAAC,CAAC;aACjG;SACF;QAGO,mCAAkB,GAAlB,UAAmB,KAAoF;;YAC7G,IAAI,MAAA,KAAK,CAAC,gBAAgB,0CAAE,SAAS,EAAE;gBACrC,IAAM,YAAY,GAAG,IAAI,CAAC,WAAW,CAAC,KAA+C,CAAC;gBACtF,IAAM,WAAW,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,SAAS,CAAC,IAAI,GAAG,GAAG,IAAI,CAAC,EAAE,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC;gBACxF,IAAI,YAAY,CAAC,WAAW,KAAK,WAAW,EAAE;oBAC5C,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,YAAY,CAAC,IAAI,EAAE,WAAW,aAAA,EAAE,CAAC,CAAC;iBACrE;aACF;YACD,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,SAAS,oBAAO,KAAK,CAAC,SAAS,CAAE,EAAE,CAAC,CAAC;YAC1D,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,aAAa,EAAE,KAAK,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC;SAC5F;QAGO,6BAAY,GAAZ,UAAa,IAAgC,EAAE,CAAa;YAClE,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC,EAAE,IAAI,CAAC,oBAAoB,CAAC,CAAC;SACrD;QAGO,wBAAO,GAAP,UAAQ,IAAgC,EAAE,CAAa;YAC7D,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC,EAAE,IAAI,CAAC,eAAe,CAAC,CAAC;SAChD;QAGO,2BAAU,GAAV,UAAW,IAAgC,EAAE,CAAa;YAChE,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC,EAAE,IAAI,CAAC,kBAAkB,CAAC,CAAC;SACnD;QAEO,2BAAU,GAAV,UAAW,IAAgC,EAAE,CAAa,EAAE,OAA+B;;YACjG,IAAI,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,MAAM,0CAAG,KAAK,CAAC,EAAE;gBACzB,OAAO,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,MAAA,EAAE,CAAC,GAAA,EAAE,CAAC,CAAC;aAC9C;SACF;qBACF;KAAA,IAAA;IAzDC;QADC0B,wBAAI;0CAgBJ;IAGD;QADCA,wBAAI;0CAKJ;IAGD;QADCA,wBAAI;oDAWJ;IAGD;QADCA,wBAAI;8CAGJ;IAGD;QADCA,wBAAI;yCAGJ;IAGD;QADCA,wBAAI;4CAGJ;;aCzRmB,aAAa,CAAC,KAAyB;;;;;;;wBAErD,SAAS,GAA2B,EAAE,CAAC;wBACvC,QAAQ,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,UAAU,GAAA,CAAC,CAAC,MAAM,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,CAAC,GAAA,CAAC,CAAC,CAAC;;;;wBAClD,aAAA,SAAA,QAAQ,CAAA;;;;wBAAnB,OAAO;;wBAEhB,KAAA,SAAS,CAAA;wBAAC,KAAA,OAAiB,CAAA;wBAAI,qBAAM,QAAQ,CAAC,EAAE,UAAU,EAAE,OAAO,EAAsB,CAAC,EAAA;;;wBAA1F,MAA4B,GAAG,SAA2D,CAAC;;;;;;;;;;;;;;;;;wBAEvF,QAAQ,GAAuB,KAAK,CAAC,MAAM,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,CAAC,UAAU,GAAA,CAAC,CAAC;4CAE3D,KAAK;;4BACd,IAAM,IAAI,GAAG,SAAS,CAAC,KAAK,CAAC,UAAoB,CAAC,CAAC;4BACnD,IAAM,IAAI,GAAG,IAAIpB,aAAI,EAAE,CAAC;4BACxB,IAAI,WAAW,GAAG,IAAIN,YAAO,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC;;4BAGrD,IAAI,KAAK,CAAC,cAAc,EAAE;gCACxB,IAAM,gBAAc,GAAG,KAAK,CAAC,cAAc,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,UAAC,CAAC,IAAK,OAAA,CAAC,CAAC,IAAI,KAAK,KAAK,CAAC,cAAc,GAAA,CAAC,GAAG,SAAS,CAAC;gCAClH,IAAI,kBAAgB,GAAG,KAAK,CAAC;;oCAC7B,KAAoB,IAAA,oBAAA,SAAA,IAAI,CAAC,MAAM,CAAA,CAAA,gBAAA,4BAAE;wCAA5B,IAAM,KAAK,WAAA;wCACd,IAAI,CAAC,kBAAgB,EAAE;4CACrB,aAAa,CAAC,KAAK,EAAE,IAAIA,YAAO,CAAC,KAAK,CAAC,eAAe,CAAC,EAAE,UAAC,KAAK,EAAE,WAAW;gDAC1E,IAAI,KAAK,KAAK,gBAAc,EAAE;oDAC5B,WAAW,GAAG,WAAW,CAAC;oDAC1B,kBAAgB,GAAG,IAAI,CAAC;oDACxB,OAAO,KAAK,CAAC;iDACd;gDACD,OAAO,IAAI,CAAC;6CACb,CAAC,CAAC;yCACJ;qCACF;;;;;;;;;gCACD,IAAI,CAAC,KAAK,GAAG;oCACX,EAAE,EAAE,KAAK,CAAC,cAAc;oCACxB,IAAI,EAAE,KAAK,CAAC,cAAc;oCAC1B,KAAK,EAAE,CAAC,gBAAc,CAAC;iCACxB,CAAC;6BACH;4BAED,aAAa,CAAC,IAAI,CAAC,KAAK,EAAE,WAAW,EAAE,UAAC,IAAI,EAAE,WAAW;;gCACvD,IAAI,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE;4DAC7D,SAAS;wCAClB,IAAI,SAAS,CAAC,UAAU,CAAC,QAAQ,IAAI,SAAS,CAAC,UAAU,CAAC,QAAQ,CAAC,GAAG,EAAE;4CACtE,IAAM,YAAU,GAAG,WAAW,CAAC,gBAAgB,CAAC,SAAS,CAAC,UAAU,CAAC,QAAQ,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;4CACvF,IAAM,YAAU,GAAG,WAAW,CAAC,gBAAgB,CAAC,SAAS,CAAC,UAAU,CAAC,QAAQ,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;4CACvF,IAAM,SAAS,GAAG,IAAIM,aAAI,CAAC;gDACzB,UAAU,OAAMC,aAAI,YAAJA,aAAI,iCAAI,YAAU,CAAC,GAAG,CAAC,UAAC,CAAC,EAAE,CAAC,IAAK,OAAA,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,YAAU,CAAC,CAAC,CAAC,CAAC,GAAA,CAAC,MAAC;gDAC7E,UAAU,OAAMA,aAAI,YAAJA,aAAI,iCAAI,YAAU,CAAC,GAAG,CAAC,UAAC,CAAC,EAAE,CAAC,IAAK,OAAA,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,YAAU,CAAC,CAAC,CAAC,CAAC,GAAA,CAAC,MAAC;6CAC9E,CAAC,CAAC;4CACH,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;yCACxB;;;wCATH,KAAwB,IAAA,oBAAA,SAAA,IAAI,CAAC,IAAI,CAAC,UAAU,CAAA,CAAA,gBAAA;4CAAvC,IAAM,SAAS,WAAA;oDAAT,SAAS;yCAUnB;;;;;;;;;iCACF;gCACD,OAAO,IAAI,CAAC;6BACb,CAAC,CAAC;;4BAGH,IAAM,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;4BAC3D,IAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC,IAAI,CAAC,IAAIA,aAAI,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;4BAC5D,IAAM,QAAQ,GAAG,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;4BACxD,IAAM,eAAe,GAAG,IAAIP,YAAO,CAACA,YAAO,CAAC,QAAQ,CAAC;iCAClD,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC;iCAC7B,KAAK,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAC;4BAC7B,IAAM,OAAO,mCACR,KAAK,KACR,eAAe,iBAAA,EACf,QAAQ,EAAE,WAAW,GACtB,CAAC;4BACF,OAAO,OAAO,CAAC,UAAU,CAAC;4BAC1B,OAAO,OAAO,CAAC,cAAc,CAAC;4BAE9B,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;;;4BA5DzB,KAAoB,KAAA,SAAA,KAAK,CAAC,MAAM,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,UAAU,GAAA,CAAC,CAAA;gCAAxC,KAAK;wCAAL,KAAK;6BA6Df;;;;;;;;;wBACD,sBAAO,QAAQ,EAAC;;;SACjB;;;ICjFD;;ICAA;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/ccf-body-ui/ccf-body-ui.d.ts b/ccf-body-ui/ccf-body-ui.d.ts deleted file mode 100644 index adc6d982f..000000000 --- a/ccf-body-ui/ccf-body-ui.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -/** - * Generated bundle index. Do not edit. - */ -/// -export * from './public-api'; diff --git a/ccf-body-ui/esm2015/ccf-body-ui.js b/ccf-body-ui/esm2015/ccf-body-ui.js deleted file mode 100644 index 94660049a..000000000 --- a/ccf-body-ui/esm2015/ccf-body-ui.js +++ /dev/null @@ -1,5 +0,0 @@ -/** - * Generated bundle index. Do not edit. - */ -export * from './public-api'; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2NmLWJvZHktdWkuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9wcm9qZWN0cy9jY2YtYm9keS11aS9zcmMvY2NmLWJvZHktdWkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7O0dBRUc7QUFFSCxjQUFjLGNBQWMsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogR2VuZXJhdGVkIGJ1bmRsZSBpbmRleC4gRG8gbm90IGVkaXQuXG4gKi9cblxuZXhwb3J0ICogZnJvbSAnLi9wdWJsaWMtYXBpJztcbiJdfQ== \ No newline at end of file diff --git a/ccf-body-ui/esm2015/lib/body-ui-layer.js b/ccf-body-ui/esm2015/lib/body-ui-layer.js deleted file mode 100644 index a28e59d6b..000000000 --- a/ccf-body-ui/esm2015/lib/body-ui-layer.js +++ /dev/null @@ -1,132 +0,0 @@ -/* eslint-disable @typescript-eslint/no-unsafe-call */ -import { CompositeLayer, COORDINATE_SYSTEM } from '@deck.gl/core'; -import { TextLayer } from '@deck.gl/layers'; -import { ScenegraphLayer, SimpleMeshLayer } from '@deck.gl/mesh-layers'; -import { ConeGeometry, CubeGeometry, CylinderGeometry, SphereGeometry } from '@luma.gl/core'; -import { Matrix4 } from '@math.gl/core'; -import { loadGLTF, loadGLTF2, registerGLTFLoaders } from './util/load-gltf'; -import { doCollisions } from './util/spatial-scene-collider'; -function meshLayer(id, data, options) { - if (!data || data.length === 0) { - return undefined; - } - else { - let mesh; - switch (options.geometry) { - case 'sphere': - mesh = new SphereGeometry(); - break; - case 'cone': - mesh = new ConeGeometry(); - break; - case 'cylinder': - mesh = new CylinderGeometry(); - break; - case 'cube': - default: - mesh = new CubeGeometry(); - break; - } - return new SimpleMeshLayer(Object.assign({ - id, - pickable: true, - autoHighlight: false, - highlightColor: [30, 136, 229, 255], - coordinateSystem: COORDINATE_SYSTEM.CARTESIAN, - data, - // eslint-disable-next-line @typescript-eslint/no-explicit-any - mesh: mesh, - wireframe: false, - getTransformMatrix: (d) => d.transformMatrix, - getColor: (d) => d.color || [255, 255, 255, 0.9 * 255] - }, options)); - } -} -function textLayer(id, data, options) { - if (!data || data.length === 0) { - return undefined; - } - else { - return new TextLayer(Object.assign({ - id, - pickable: true, - data: data.map(d => (Object.assign(Object.assign({}, d), { position: new Matrix4(d.transformMatrix).getTranslation() }))), - getText: (d) => d.text, - getPosition: (d) => d.position, - getColor: (d) => d.color - }, options)); - } -} -export class BodyUILayer extends CompositeLayer { - initializeState() { - const { data } = this.props; - this.setState({ data: data !== null && data !== void 0 ? data : [], zoomOpacity: 0.8, doCollisions: false }); - registerGLTFLoaders(); - } - renderLayers() { - var _a, _b; - const state = this.state; - const geometries = { - 'sphere': [], 'cone': [], 'cylinder': [], 'cube': [], 'text': [], 'wireframe': [], 'scenegraph': [] - }; - for (const node of state.data) { - const geometry = (_a = node.geometry) !== null && _a !== void 0 ? _a : 'cube'; - if (node.scenegraph) { - geometries.scenegraph.push(node); - } - else if (geometries[geometry] !== undefined) { - geometries[geometry].push(node); - } - } - // eslint-disable-next-line @typescript-eslint/no-explicit-any - const url2gltf = {}; - for (const m of geometries.scenegraph) { - if (m.scenegraph && m.scenegraphNode && !Object.prototype.hasOwnProperty.call(url2gltf, m.scenegraph)) { - url2gltf[m.scenegraph] = loadGLTF({ scenegraph: m.scenegraph }, BodyUILayer.gltfCache); - } - } - const layers = []; - for (const [geometry, nodes] of Object.entries(geometries)) { - if (geometry === 'scenegraph') { - for (const model of nodes) { - layers.push(new ScenegraphLayer({ - id: 'models-' + model['@id'], - opacity: model.zoomBasedOpacity ? state.zoomOpacity : (model.opacity !== undefined ? model.opacity : 1.0), - pickable: !model.unpickable, - coordinateSystem: COORDINATE_SYSTEM.CARTESIAN, - data: [model], - scenegraph: model.scenegraphNode ? - loadGLTF2(model.scenegraphNode, url2gltf[model.scenegraph]) : - model.scenegraph, - // eslint-disable-next-line @typescript-eslint/naming-convention - _lighting: model._lighting, - getTransformMatrix: model.transformMatrix, - getColor: (_b = model.color) !== null && _b !== void 0 ? _b : [0, 255, 0, 0.5 * 255], - parameters: { depthMask: !model.zoomBasedOpacity && (model.opacity === undefined || model.opacity === 1) } - })); - } - } - else if (geometry === 'text') { - layers.push(textLayer('text', nodes.filter(n => n.unpickable), { pickable: false })); - layers.push(textLayer('textPickable', nodes.filter(n => !n.unpickable), { pickable: true })); - } - else if (geometry === 'wireframe') { - layers.push(meshLayer(geometry, nodes, { wireframe: true, pickable: false, geometry })); - } - else { - layers.push(meshLayer(geometry, nodes.filter(n => n.unpickable), { wireframe: false, pickable: false, geometry })); - layers.push(meshLayer(`${geometry}Pickable`, nodes.filter(n => !n.unpickable), { wireframe: false, pickable: true, geometry })); - } - } - if (state.doCollisions) { - doCollisions(state.data); - } - return layers.filter(l => !!l); - } - getPickingInfo(e) { - return e.info; - } -} -BodyUILayer.layerName = 'BodyUILayer'; -BodyUILayer.gltfCache = {}; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYm9keS11aS1sYXllci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3Byb2plY3RzL2NjZi1ib2R5LXVpL3NyYy9saWIvYm9keS11aS1sYXllci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxzREFBc0Q7QUFDdEQsT0FBTyxFQUFFLGNBQWMsRUFBRSxpQkFBaUIsRUFBRSxNQUFNLGVBQWUsQ0FBQztBQUNsRSxPQUFPLEVBQUUsU0FBUyxFQUFFLE1BQU0saUJBQWlCLENBQUM7QUFDNUMsT0FBTyxFQUFFLGVBQWUsRUFBRSxlQUFlLEVBQUUsTUFBTSxzQkFBc0IsQ0FBQztBQUN4RSxPQUFPLEVBQUUsWUFBWSxFQUFFLFlBQVksRUFBRSxnQkFBZ0IsRUFBWSxjQUFjLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFDdkcsT0FBTyxFQUFFLE9BQU8sRUFBRSxNQUFNLGVBQWUsQ0FBQztBQUd4QyxPQUFPLEVBQUUsUUFBUSxFQUFFLFNBQVMsRUFBRSxtQkFBbUIsRUFBRSxNQUFNLGtCQUFrQixDQUFDO0FBQzVFLE9BQU8sRUFBRSxZQUFZLEVBQUUsTUFBTSwrQkFBK0IsQ0FBQztBQUc3RCxTQUFTLFNBQVMsQ0FBQyxFQUFVLEVBQUUsSUFBd0IsRUFBRSxPQUFtQztJQUMxRixJQUFJLENBQUMsSUFBSSxJQUFJLElBQUksQ0FBQyxNQUFNLEtBQUssQ0FBQyxFQUFFO1FBQzlCLE9BQU8sU0FBUyxDQUFDO0tBQ2xCO1NBQU07UUFDTCxJQUFJLElBQWMsQ0FBQztRQUNuQixRQUFRLE9BQU8sQ0FBQyxRQUFRLEVBQUU7WUFDeEIsS0FBSyxRQUFRO2dCQUNYLElBQUksR0FBRyxJQUFJLGNBQWMsRUFBRSxDQUFDO2dCQUM1QixNQUFNO1lBQ1IsS0FBSyxNQUFNO2dCQUNULElBQUksR0FBRyxJQUFJLFlBQVksRUFBRSxDQUFDO2dCQUMxQixNQUFNO1lBQ1IsS0FBSyxVQUFVO2dCQUNiLElBQUksR0FBRyxJQUFJLGdCQUFnQixFQUFFLENBQUM7Z0JBQzlCLE1BQU07WUFDUixLQUFLLE1BQU0sQ0FBQztZQUNaO2dCQUNFLElBQUksR0FBRyxJQUFJLFlBQVksRUFBRSxDQUFDO2dCQUMxQixNQUFNO1NBQ1Q7UUFDRCxPQUFPLElBQUksZUFBZSxlQUNyQjtZQUNELEVBQUU7WUFDRixRQUFRLEVBQUUsSUFBSTtZQUNkLGFBQWEsRUFBRSxLQUFLO1lBQ3BCLGNBQWMsRUFBRSxDQUFDLEVBQUUsRUFBRSxHQUFHLEVBQUUsR0FBRyxFQUFFLEdBQUcsQ0FBQztZQUNuQyxnQkFBZ0IsRUFBRSxpQkFBaUIsQ0FBQyxTQUFTO1lBQzdDLElBQUk7WUFDSiw4REFBOEQ7WUFDOUQsSUFBSSxFQUFFLElBQVc7WUFDakIsU0FBUyxFQUFFLEtBQUs7WUFDaEIsa0JBQWtCLEVBQUUsQ0FBQyxDQUFDLEVBQUUsRUFBRSxDQUFFLENBQXFDLENBQUMsZUFBZTtZQUNqRixRQUFRLEVBQUUsQ0FBQyxDQUFDLEVBQUUsRUFBRSxDQUFFLENBQWlELENBQUMsS0FBSyxJQUFJLENBQUMsR0FBRyxFQUFFLEdBQUcsRUFBRSxHQUFHLEVBQUUsR0FBRyxHQUFDLEdBQUcsQ0FBQztTQUN0RyxFQUNFLE9BQU8sRUFDVixDQUFDO0tBQ0o7QUFDSCxDQUFDO0FBRUQsU0FBUyxTQUFTLENBQUMsRUFBVSxFQUFFLElBQXdCLEVBQUUsT0FBbUM7SUFDMUYsSUFBSSxDQUFDLElBQUksSUFBSSxJQUFJLENBQUMsTUFBTSxLQUFLLENBQUMsRUFBRTtRQUM5QixPQUFPLFNBQVMsQ0FBQztLQUNsQjtTQUFNO1FBQ0wsT0FBTyxJQUFJLFNBQVMsZUFDZjtZQUNELEVBQUU7WUFDRixRQUFRLEVBQUUsSUFBSTtZQUNkLElBQUksRUFBRSxJQUFJLENBQUMsR0FBRyxDQUFDLENBQUMsQ0FBQyxFQUFFLENBQUMsaUNBQU0sQ0FBQyxLQUFFLFFBQVEsRUFBRSxJQUFJLE9BQU8sQ0FBQyxDQUFDLENBQUMsZUFBZSxDQUFDLENBQUMsY0FBYyxFQUFFLElBQUcsQ0FBQztZQUMxRixPQUFPLEVBQUUsQ0FBQyxDQUFDLEVBQUUsRUFBRSxDQUFFLENBQXNCLENBQUMsSUFBSTtZQUM1QyxXQUFXLEVBQUUsQ0FBQyxDQUFDLEVBQUUsRUFBRSxDQUFFLENBQW9DLENBQUMsUUFBUTtZQUNsRSxRQUFRLEVBQUUsQ0FBQyxDQUFDLEVBQUUsRUFBRSxDQUFFLENBQWlELENBQUMsS0FBSztTQUMxRSxFQUNFLE9BQU8sRUFDVixDQUFDO0tBQ0o7QUFDSCxDQUFDO0FBRUQsTUFBTSxPQUFPLFdBQVksU0FBUSxjQUFnQztJQUkvRCxlQUFlO1FBQ2IsTUFBTSxFQUFFLElBQUksRUFBRSxHQUFHLElBQUksQ0FBQyxLQUFLLENBQUM7UUFDNUIsSUFBSSxDQUFDLFFBQVEsQ0FBQyxFQUFFLElBQUksRUFBRSxJQUFJLGFBQUosSUFBSSxjQUFKLElBQUksR0FBSSxFQUFFLEVBQUUsV0FBVyxFQUFFLEdBQUcsRUFBRSxZQUFZLEVBQUUsS0FBSyxFQUFFLENBQUMsQ0FBQztRQUMzRSxtQkFBbUIsRUFBRSxDQUFDO0lBQ3hCLENBQUM7SUFFRCxZQUFZOztRQUNWLE1BQU0sS0FBSyxHQUFHLElBQUksQ0FBQyxLQUFpRixDQUFDO1FBQ3JHLE1BQU0sVUFBVSxHQUF1QztZQUNyRCxRQUFRLEVBQUUsRUFBRSxFQUFFLE1BQU0sRUFBRSxFQUFFLEVBQUUsVUFBVSxFQUFFLEVBQUUsRUFBRSxNQUFNLEVBQUUsRUFBRSxFQUFFLE1BQU0sRUFBRSxFQUFFLEVBQUUsV0FBVyxFQUFFLEVBQUUsRUFBRSxZQUFZLEVBQUUsRUFBRTtTQUNwRyxDQUFDO1FBRUYsS0FBSyxNQUFNLElBQUksSUFBSSxLQUFLLENBQUMsSUFBSSxFQUFFO1lBQzdCLE1BQU0sUUFBUSxHQUFHLE1BQUEsSUFBSSxDQUFDLFFBQVEsbUNBQUksTUFBTSxDQUFDO1lBQ3pDLElBQUksSUFBSSxDQUFDLFVBQVUsRUFBRTtnQkFDbkIsVUFBVSxDQUFDLFVBQVUsQ0FBQyxJQUFJLENBQUMsSUFBSSxDQUFDLENBQUM7YUFDbEM7aUJBQU0sSUFBSSxVQUFVLENBQUMsUUFBUSxDQUFDLEtBQUssU0FBUyxFQUFFO2dCQUM3QyxVQUFVLENBQUMsUUFBUSxDQUFDLENBQUMsSUFBSSxDQUFDLElBQUksQ0FBQyxDQUFDO2FBQ2pDO1NBQ0Y7UUFFRCw4REFBOEQ7UUFDOUQsTUFBTSxRQUFRLEdBQW9DLEVBQUUsQ0FBQztRQUNyRCxLQUFLLE1BQU0sQ0FBQyxJQUFJLFVBQVUsQ0FBQyxVQUFVLEVBQUU7WUFDckMsSUFBSSxDQUFDLENBQUMsVUFBVSxJQUFJLENBQUMsQ0FBQyxjQUFjLElBQUksQ0FBQyxNQUFNLENBQUMsU0FBUyxDQUFDLGNBQWMsQ0FBQyxJQUFJLENBQUMsUUFBUSxFQUFFLENBQUMsQ0FBQyxVQUFVLENBQUMsRUFBRTtnQkFDckcsUUFBUSxDQUFDLENBQUMsQ0FBQyxVQUFVLENBQUMsR0FBRyxRQUFRLENBQUMsRUFBRSxVQUFVLEVBQUUsQ0FBQyxDQUFDLFVBQVUsRUFBc0IsRUFBRSxXQUFXLENBQUMsU0FBUyxDQUFDLENBQUM7YUFDNUc7U0FDRjtRQUVELE1BQU0sTUFBTSxHQUFjLEVBQUUsQ0FBQztRQUM3QixLQUFLLE1BQU0sQ0FBQyxRQUFRLEVBQUUsS0FBSyxDQUFDLElBQUksTUFBTSxDQUFDLE9BQU8sQ0FBQyxVQUFVLENBQUMsRUFBRTtZQUMxRCxJQUFJLFFBQVEsS0FBSyxZQUFZLEVBQUU7Z0JBQzdCLEtBQUssTUFBTSxLQUFLLElBQUksS0FBSyxFQUFFO29CQUN6QixNQUFNLENBQUMsSUFBSSxDQUNULElBQUksZUFBZSxDQUFDO3dCQUNsQixFQUFFLEVBQUUsU0FBUyxHQUFHLEtBQUssQ0FBQyxLQUFLLENBQUM7d0JBQzVCLE9BQU8sRUFBRSxLQUFLLENBQUMsZ0JBQWdCLENBQUMsQ0FBQyxDQUFDLEtBQUssQ0FBQyxXQUFXLENBQUMsQ0FBQyxDQUFDLENBQUMsS0FBSyxDQUFDLE9BQU8sS0FBSyxTQUFTLENBQUMsQ0FBQyxDQUFDLEtBQUssQ0FBQyxPQUFPLENBQUMsQ0FBQyxDQUFDLEdBQUcsQ0FBQzt3QkFDekcsUUFBUSxFQUFFLENBQUMsS0FBSyxDQUFDLFVBQVU7d0JBQzNCLGdCQUFnQixFQUFFLGlCQUFpQixDQUFDLFNBQVM7d0JBQzdDLElBQUksRUFBRSxDQUFDLEtBQUssQ0FBQzt3QkFDYixVQUFVLEVBQUUsS0FBSyxDQUFDLGNBQWMsQ0FBQyxDQUFDOzRCQUNoQyxTQUFTLENBQUMsS0FBSyxDQUFDLGNBQWMsRUFBRSxRQUFRLENBQUMsS0FBSyxDQUFDLFVBQW9CLENBQUMsQ0FBQyxDQUFDLENBQUM7NEJBQ3ZFLEtBQUssQ0FBQyxVQUE0Qjt3QkFDcEMsZ0VBQWdFO3dCQUNoRSxTQUFTLEVBQUUsS0FBSyxDQUFDLFNBQVM7d0JBQzFCLGtCQUFrQixFQUFFLEtBQUssQ0FBQyxlQUF3Qzt3QkFDbEUsUUFBUSxFQUFFLE1BQUEsS0FBSyxDQUFDLEtBQUssbUNBQUksQ0FBQyxDQUFDLEVBQUUsR0FBRyxFQUFFLENBQUMsRUFBRSxHQUFHLEdBQUMsR0FBRyxDQUFDO3dCQUM3QyxVQUFVLEVBQUUsRUFBRSxTQUFTLEVBQUUsQ0FBQyxLQUFLLENBQUMsZ0JBQWdCLElBQUksQ0FBQyxLQUFLLENBQUMsT0FBTyxLQUFLLFNBQVMsSUFBSSxLQUFLLENBQUMsT0FBTyxLQUFLLENBQUMsQ0FBQyxFQUFFO3FCQUMzRyxDQUFDLENBQ0gsQ0FBQztpQkFDSDthQUNGO2lCQUFNLElBQUksUUFBUSxLQUFLLE1BQU0sRUFBRTtnQkFDOUIsTUFBTSxDQUFDLElBQUksQ0FBQyxTQUFTLENBQUMsTUFBTSxFQUFFLEtBQUssQ0FBQyxNQUFNLENBQUMsQ0FBQyxDQUFDLEVBQUUsQ0FBQyxDQUFDLENBQUMsVUFBVSxDQUFDLEVBQUUsRUFBRSxRQUFRLEVBQUUsS0FBSyxFQUFFLENBQUMsQ0FBQyxDQUFDO2dCQUNyRixNQUFNLENBQUMsSUFBSSxDQUFDLFNBQVMsQ0FBQyxjQUFjLEVBQUUsS0FBSyxDQUFDLE1BQU0sQ0FBQyxDQUFDLENBQUMsRUFBRSxDQUFDLENBQUMsQ0FBQyxDQUFDLFVBQVUsQ0FBQyxFQUFFLEVBQUUsUUFBUSxFQUFFLElBQUksRUFBRSxDQUFDLENBQUMsQ0FBQzthQUM5RjtpQkFBTSxJQUFJLFFBQVEsS0FBSyxXQUFXLEVBQUU7Z0JBQ25DLE1BQU0sQ0FBQyxJQUFJLENBQUMsU0FBUyxDQUFDLFFBQVEsRUFBRSxLQUFLLEVBQUUsRUFBRSxTQUFTLEVBQUUsSUFBSSxFQUFFLFFBQVEsRUFBRSxLQUFLLEVBQUUsUUFBUSxFQUFFLENBQUMsQ0FBQyxDQUFDO2FBQ3pGO2lCQUFNO2dCQUNMLE1BQU0sQ0FBQyxJQUFJLENBQUMsU0FBUyxDQUFDLFFBQVEsRUFBRSxLQUFLLENBQUMsTUFBTSxDQUFDLENBQUMsQ0FBQyxFQUFFLENBQUMsQ0FBQyxDQUFDLFVBQVUsQ0FBQyxFQUFFLEVBQUUsU0FBUyxFQUFFLEtBQUssRUFBRSxRQUFRLEVBQUUsS0FBSyxFQUFFLFFBQVEsRUFBRSxDQUFDLENBQUMsQ0FBQztnQkFDbkgsTUFBTSxDQUFDLElBQUksQ0FBQyxTQUFTLENBQUMsR0FBRyxRQUFRLFVBQVUsRUFBRSxLQUFLLENBQUMsTUFBTSxDQUFDLENBQUMsQ0FBQyxFQUFFLENBQUMsQ0FBQyxDQUFDLENBQUMsVUFBVSxDQUFDLEVBQUUsRUFBRSxTQUFTLEVBQUUsS0FBSyxFQUFFLFFBQVEsRUFBRSxJQUFJLEVBQUUsUUFBUSxFQUFFLENBQUMsQ0FBQyxDQUFDO2FBQ2pJO1NBQ0Y7UUFFRCxJQUFJLEtBQUssQ0FBQyxZQUFZLEVBQUU7WUFDdEIsWUFBWSxDQUFDLEtBQUssQ0FBQyxJQUFJLENBQUMsQ0FBQztTQUMxQjtRQUVELE9BQU8sTUFBTSxDQUFDLE1BQU0sQ0FBQyxDQUFDLENBQUMsRUFBRSxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztJQUNqQyxDQUFDO0lBRUQsY0FBYyxDQUNaLENBQW9FO1FBRXBFLE9BQU8sQ0FBQyxDQUFDLElBQUksQ0FBQztJQUNoQixDQUFDOztBQTVFZSxxQkFBUyxHQUFHLGFBQWEsQ0FBQztBQUMxQixxQkFBUyxHQUFxQyxFQUFFLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyIvKiBlc2xpbnQtZGlzYWJsZSBAdHlwZXNjcmlwdC1lc2xpbnQvbm8tdW5zYWZlLWNhbGwgKi9cbmltcG9ydCB7IENvbXBvc2l0ZUxheWVyLCBDT09SRElOQVRFX1NZU1RFTSB9IGZyb20gJ0BkZWNrLmdsL2NvcmUnO1xuaW1wb3J0IHsgVGV4dExheWVyIH0gZnJvbSAnQGRlY2suZ2wvbGF5ZXJzJztcbmltcG9ydCB7IFNjZW5lZ3JhcGhMYXllciwgU2ltcGxlTWVzaExheWVyIH0gZnJvbSAnQGRlY2suZ2wvbWVzaC1sYXllcnMnO1xuaW1wb3J0IHsgQ29uZUdlb21ldHJ5LCBDdWJlR2VvbWV0cnksIEN5bGluZGVyR2VvbWV0cnksIEdlb21ldHJ5LCBTcGhlcmVHZW9tZXRyeSB9IGZyb20gJ0BsdW1hLmdsL2NvcmUnO1xuaW1wb3J0IHsgTWF0cml4NCB9IGZyb20gJ0BtYXRoLmdsL2NvcmUnO1xuXG5pbXBvcnQgeyBTcGF0aWFsU2NlbmVOb2RlIH0gZnJvbSAnLi9zaGFyZWQvc3BhdGlhbC1zY2VuZS1ub2RlJztcbmltcG9ydCB7IGxvYWRHTFRGLCBsb2FkR0xURjIsIHJlZ2lzdGVyR0xURkxvYWRlcnMgfSBmcm9tICcuL3V0aWwvbG9hZC1nbHRmJztcbmltcG9ydCB7IGRvQ29sbGlzaW9ucyB9IGZyb20gJy4vdXRpbC9zcGF0aWFsLXNjZW5lLWNvbGxpZGVyJztcblxuXG5mdW5jdGlvbiBtZXNoTGF5ZXIoaWQ6IHN0cmluZywgZGF0YTogU3BhdGlhbFNjZW5lTm9kZVtdLCBvcHRpb25zOiB7IFtrZXk6IHN0cmluZ106IHVua25vd24gfSk6IFNpbXBsZU1lc2hMYXllcjx1bmtub3duPiB8IHVuZGVmaW5lZCB7XG4gIGlmICghZGF0YSB8fCBkYXRhLmxlbmd0aCA9PT0gMCkge1xuICAgIHJldHVybiB1bmRlZmluZWQ7XG4gIH0gZWxzZSB7XG4gICAgbGV0IG1lc2g6IEdlb21ldHJ5O1xuICAgIHN3aXRjaCAob3B0aW9ucy5nZW9tZXRyeSkge1xuICAgICAgY2FzZSAnc3BoZXJlJzpcbiAgICAgICAgbWVzaCA9IG5ldyBTcGhlcmVHZW9tZXRyeSgpO1xuICAgICAgICBicmVhaztcbiAgICAgIGNhc2UgJ2NvbmUnOlxuICAgICAgICBtZXNoID0gbmV3IENvbmVHZW9tZXRyeSgpO1xuICAgICAgICBicmVhaztcbiAgICAgIGNhc2UgJ2N5bGluZGVyJzpcbiAgICAgICAgbWVzaCA9IG5ldyBDeWxpbmRlckdlb21ldHJ5KCk7XG4gICAgICAgIGJyZWFrO1xuICAgICAgY2FzZSAnY3ViZSc6XG4gICAgICBkZWZhdWx0OlxuICAgICAgICBtZXNoID0gbmV3IEN1YmVHZW9tZXRyeSgpO1xuICAgICAgICBicmVhaztcbiAgICB9XG4gICAgcmV0dXJuIG5ldyBTaW1wbGVNZXNoTGF5ZXIoe1xuICAgICAgLi4ue1xuICAgICAgICBpZCxcbiAgICAgICAgcGlja2FibGU6IHRydWUsXG4gICAgICAgIGF1dG9IaWdobGlnaHQ6IGZhbHNlLFxuICAgICAgICBoaWdobGlnaHRDb2xvcjogWzMwLCAxMzYsIDIyOSwgMjU1XSxcbiAgICAgICAgY29vcmRpbmF0ZVN5c3RlbTogQ09PUkRJTkFURV9TWVNURU0uQ0FSVEVTSUFOLFxuICAgICAgICBkYXRhLFxuICAgICAgICAvLyBlc2xpbnQtZGlzYWJsZS1uZXh0LWxpbmUgQHR5cGVzY3JpcHQtZXNsaW50L25vLWV4cGxpY2l0LWFueVxuICAgICAgICBtZXNoOiBtZXNoIGFzIGFueSxcbiAgICAgICAgd2lyZWZyYW1lOiBmYWxzZSxcbiAgICAgICAgZ2V0VHJhbnNmb3JtTWF0cml4OiAoZCkgPT4gKGQgYXMgeyB0cmFuc2Zvcm1NYXRyaXg6IG51bWJlcltdW10gfSkudHJhbnNmb3JtTWF0cml4LFxuICAgICAgICBnZXRDb2xvcjogKGQpID0+IChkIGFzIHsgY29sb3I6IFtudW1iZXIsIG51bWJlciwgbnVtYmVyLCBudW1iZXJdIH0pLmNvbG9yIHx8IFsyNTUsIDI1NSwgMjU1LCAwLjkqMjU1XVxuICAgICAgfSxcbiAgICAgIC4uLm9wdGlvbnNcbiAgICB9KTtcbiAgfVxufVxuXG5mdW5jdGlvbiB0ZXh0TGF5ZXIoaWQ6IHN0cmluZywgZGF0YTogU3BhdGlhbFNjZW5lTm9kZVtdLCBvcHRpb25zOiB7IFtrZXk6IHN0cmluZ106IHVua25vd24gfSk6IFRleHRMYXllcjx1bmtub3duPiB8IHVuZGVmaW5lZCB7XG4gIGlmICghZGF0YSB8fCBkYXRhLmxlbmd0aCA9PT0gMCkge1xuICAgIHJldHVybiB1bmRlZmluZWQ7XG4gIH0gZWxzZSB7XG4gICAgcmV0dXJuIG5ldyBUZXh0TGF5ZXIoe1xuICAgICAgLi4ue1xuICAgICAgICBpZCxcbiAgICAgICAgcGlja2FibGU6IHRydWUsXG4gICAgICAgIGRhdGE6IGRhdGEubWFwKGQgPT4gKHsgLi4uZCwgcG9zaXRpb246IG5ldyBNYXRyaXg0KGQudHJhbnNmb3JtTWF0cml4KS5nZXRUcmFuc2xhdGlvbigpIH0pKSxcbiAgICAgICAgZ2V0VGV4dDogKGQpID0+IChkIGFzIHsgdGV4dDogc3RyaW5nIH0pLnRleHQsXG4gICAgICAgIGdldFBvc2l0aW9uOiAoZCkgPT4gKGQgYXMgeyBwb3NpdGlvbjogW251bWJlciwgbnVtYmVyXSB9KS5wb3NpdGlvbixcbiAgICAgICAgZ2V0Q29sb3I6IChkKSA9PiAoZCBhcyB7IGNvbG9yOiBbbnVtYmVyLCBudW1iZXIsIG51bWJlciwgbnVtYmVyXSB9KS5jb2xvclxuICAgICAgfSxcbiAgICAgIC4uLm9wdGlvbnNcbiAgICB9KTtcbiAgfVxufVxuXG5leHBvcnQgY2xhc3MgQm9keVVJTGF5ZXIgZXh0ZW5kcyBDb21wb3NpdGVMYXllcjxTcGF0aWFsU2NlbmVOb2RlPiB7XG4gIHN0YXRpYyByZWFkb25seSBsYXllck5hbWUgPSAnQm9keVVJTGF5ZXInO1xuICBzdGF0aWMgcmVhZG9ubHkgZ2x0ZkNhY2hlOiB7IFt1cmw6IHN0cmluZ106IFByb21pc2U8QmxvYj4gfSA9IHt9O1xuXG4gIGluaXRpYWxpemVTdGF0ZSgpOiB2b2lkIHtcbiAgICBjb25zdCB7IGRhdGEgfSA9IHRoaXMucHJvcHM7XG4gICAgdGhpcy5zZXRTdGF0ZSh7IGRhdGE6IGRhdGEgPz8gW10sIHpvb21PcGFjaXR5OiAwLjgsIGRvQ29sbGlzaW9uczogZmFsc2UgfSk7XG4gICAgcmVnaXN0ZXJHTFRGTG9hZGVycygpO1xuICB9XG5cbiAgcmVuZGVyTGF5ZXJzKCk6IHVua25vd25bXSB7XG4gICAgY29uc3Qgc3RhdGUgPSB0aGlzLnN0YXRlIGFzIHsgZGF0YTogU3BhdGlhbFNjZW5lTm9kZVtdOyB6b29tT3BhY2l0eTogbnVtYmVyOyBkb0NvbGxpc2lvbnM6IGJvb2xlYW4gfTtcbiAgICBjb25zdCBnZW9tZXRyaWVzOiBSZWNvcmQ8c3RyaW5nLCBTcGF0aWFsU2NlbmVOb2RlW10+ID0ge1xuICAgICAgJ3NwaGVyZSc6IFtdLCAnY29uZSc6IFtdLCAnY3lsaW5kZXInOiBbXSwgJ2N1YmUnOiBbXSwgJ3RleHQnOiBbXSwgJ3dpcmVmcmFtZSc6IFtdLCAnc2NlbmVncmFwaCc6IFtdXG4gICAgfTtcblxuICAgIGZvciAoY29uc3Qgbm9kZSBvZiBzdGF0ZS5kYXRhKSB7XG4gICAgICBjb25zdCBnZW9tZXRyeSA9IG5vZGUuZ2VvbWV0cnkgPz8gJ2N1YmUnO1xuICAgICAgaWYgKG5vZGUuc2NlbmVncmFwaCkge1xuICAgICAgICBnZW9tZXRyaWVzLnNjZW5lZ3JhcGgucHVzaChub2RlKTtcbiAgICAgIH0gZWxzZSBpZiAoZ2VvbWV0cmllc1tnZW9tZXRyeV0gIT09IHVuZGVmaW5lZCkge1xuICAgICAgICBnZW9tZXRyaWVzW2dlb21ldHJ5XS5wdXNoKG5vZGUpO1xuICAgICAgfVxuICAgIH1cblxuICAgIC8vIGVzbGludC1kaXNhYmxlLW5leHQtbGluZSBAdHlwZXNjcmlwdC1lc2xpbnQvbm8tZXhwbGljaXQtYW55XG4gICAgY29uc3QgdXJsMmdsdGY6IHsgW3VybDogc3RyaW5nXTogUHJvbWlzZTxhbnk+IH0gPSB7fTtcbiAgICBmb3IgKGNvbnN0IG0gb2YgZ2VvbWV0cmllcy5zY2VuZWdyYXBoKSB7XG4gICAgICBpZiAobS5zY2VuZWdyYXBoICYmIG0uc2NlbmVncmFwaE5vZGUgJiYgIU9iamVjdC5wcm90b3R5cGUuaGFzT3duUHJvcGVydHkuY2FsbCh1cmwyZ2x0ZiwgbS5zY2VuZWdyYXBoKSkge1xuICAgICAgICB1cmwyZ2x0ZlttLnNjZW5lZ3JhcGhdID0gbG9hZEdMVEYoeyBzY2VuZWdyYXBoOiBtLnNjZW5lZ3JhcGggfSBhcyBTcGF0aWFsU2NlbmVOb2RlLCBCb2R5VUlMYXllci5nbHRmQ2FjaGUpO1xuICAgICAgfVxuICAgIH1cblxuICAgIGNvbnN0IGxheWVyczogdW5rbm93bltdID0gW107XG4gICAgZm9yIChjb25zdCBbZ2VvbWV0cnksIG5vZGVzXSBvZiBPYmplY3QuZW50cmllcyhnZW9tZXRyaWVzKSkge1xuICAgICAgaWYgKGdlb21ldHJ5ID09PSAnc2NlbmVncmFwaCcpIHtcbiAgICAgICAgZm9yIChjb25zdCBtb2RlbCBvZiBub2Rlcykge1xuICAgICAgICAgIGxheWVycy5wdXNoKFxuICAgICAgICAgICAgbmV3IFNjZW5lZ3JhcGhMYXllcih7XG4gICAgICAgICAgICAgIGlkOiAnbW9kZWxzLScgKyBtb2RlbFsnQGlkJ10sXG4gICAgICAgICAgICAgIG9wYWNpdHk6IG1vZGVsLnpvb21CYXNlZE9wYWNpdHkgPyBzdGF0ZS56b29tT3BhY2l0eSA6IChtb2RlbC5vcGFjaXR5ICE9PSB1bmRlZmluZWQgPyBtb2RlbC5vcGFjaXR5IDogMS4wKSxcbiAgICAgICAgICAgICAgcGlja2FibGU6ICFtb2RlbC51bnBpY2thYmxlLFxuICAgICAgICAgICAgICBjb29yZGluYXRlU3lzdGVtOiBDT09SRElOQVRFX1NZU1RFTS5DQVJURVNJQU4sXG4gICAgICAgICAgICAgIGRhdGE6IFttb2RlbF0sXG4gICAgICAgICAgICAgIHNjZW5lZ3JhcGg6IG1vZGVsLnNjZW5lZ3JhcGhOb2RlID9cbiAgICAgICAgICAgICAgICBsb2FkR0xURjIobW9kZWwuc2NlbmVncmFwaE5vZGUsIHVybDJnbHRmW21vZGVsLnNjZW5lZ3JhcGggYXMgc3RyaW5nXSkgOlxuICAgICAgICAgICAgICAgIG1vZGVsLnNjZW5lZ3JhcGggYXMgdW5rbm93biBhcyBVUkwsXG4gICAgICAgICAgICAgIC8vIGVzbGludC1kaXNhYmxlLW5leHQtbGluZSBAdHlwZXNjcmlwdC1lc2xpbnQvbmFtaW5nLWNvbnZlbnRpb25cbiAgICAgICAgICAgICAgX2xpZ2h0aW5nOiBtb2RlbC5fbGlnaHRpbmcsIC8vICdwYnInIHwgdW5kZWZpbmVkXG4gICAgICAgICAgICAgIGdldFRyYW5zZm9ybU1hdHJpeDogbW9kZWwudHJhbnNmb3JtTWF0cml4IGFzIHVua25vd24gYXMgbnVtYmVyW11bXSxcbiAgICAgICAgICAgICAgZ2V0Q29sb3I6IG1vZGVsLmNvbG9yID8/IFswLCAyNTUsIDAsIDAuNSoyNTVdLFxuICAgICAgICAgICAgICBwYXJhbWV0ZXJzOiB7IGRlcHRoTWFzazogIW1vZGVsLnpvb21CYXNlZE9wYWNpdHkgJiYgKG1vZGVsLm9wYWNpdHkgPT09IHVuZGVmaW5lZCB8fCBtb2RlbC5vcGFjaXR5ID09PSAxKSB9XG4gICAgICAgICAgICB9KVxuICAgICAgICAgICk7XG4gICAgICAgIH1cbiAgICAgIH0gZWxzZSBpZiAoZ2VvbWV0cnkgPT09ICd0ZXh0Jykge1xuICAgICAgICBsYXllcnMucHVzaCh0ZXh0TGF5ZXIoJ3RleHQnLCBub2Rlcy5maWx0ZXIobiA9PiBuLnVucGlja2FibGUpLCB7IHBpY2thYmxlOiBmYWxzZSB9KSk7XG4gICAgICAgIGxheWVycy5wdXNoKHRleHRMYXllcigndGV4dFBpY2thYmxlJywgbm9kZXMuZmlsdGVyKG4gPT4gIW4udW5waWNrYWJsZSksIHsgcGlja2FibGU6IHRydWUgfSkpO1xuICAgICAgfSBlbHNlIGlmIChnZW9tZXRyeSA9PT0gJ3dpcmVmcmFtZScpIHtcbiAgICAgICAgbGF5ZXJzLnB1c2gobWVzaExheWVyKGdlb21ldHJ5LCBub2RlcywgeyB3aXJlZnJhbWU6IHRydWUsIHBpY2thYmxlOiBmYWxzZSwgZ2VvbWV0cnkgfSkpO1xuICAgICAgfSBlbHNlIHtcbiAgICAgICAgbGF5ZXJzLnB1c2gobWVzaExheWVyKGdlb21ldHJ5LCBub2Rlcy5maWx0ZXIobiA9PiBuLnVucGlja2FibGUpLCB7IHdpcmVmcmFtZTogZmFsc2UsIHBpY2thYmxlOiBmYWxzZSwgZ2VvbWV0cnkgfSkpO1xuICAgICAgICBsYXllcnMucHVzaChtZXNoTGF5ZXIoYCR7Z2VvbWV0cnl9UGlja2FibGVgLCBub2Rlcy5maWx0ZXIobiA9PiAhbi51bnBpY2thYmxlKSwgeyB3aXJlZnJhbWU6IGZhbHNlLCBwaWNrYWJsZTogdHJ1ZSwgZ2VvbWV0cnkgfSkpO1xuICAgICAgfVxuICAgIH1cblxuICAgIGlmIChzdGF0ZS5kb0NvbGxpc2lvbnMpIHtcbiAgICAgIGRvQ29sbGlzaW9ucyhzdGF0ZS5kYXRhKTtcbiAgICB9XG5cbiAgICByZXR1cm4gbGF5ZXJzLmZpbHRlcihsID0+ICEhbCk7XG4gIH1cblxuICBnZXRQaWNraW5nSW5mbyhcbiAgICBlOiBQYXJhbWV0ZXJzPENvbXBvc2l0ZUxheWVyPFNwYXRpYWxTY2VuZU5vZGU+WydnZXRQaWNraW5nSW5mbyddPlswXVxuICApOiBSZXR1cm5UeXBlPENvbXBvc2l0ZUxheWVyPFNwYXRpYWxTY2VuZU5vZGU+WydnZXRQaWNraW5nSW5mbyddPiB7XG4gICAgcmV0dXJuIGUuaW5mbztcbiAgfVxufVxuIl19 \ No newline at end of file diff --git a/ccf-body-ui/esm2015/lib/body-ui.js b/ccf-body-ui/esm2015/lib/body-ui.js deleted file mode 100644 index edf34fe32..000000000 --- a/ccf-body-ui/esm2015/lib/body-ui.js +++ /dev/null @@ -1,223 +0,0 @@ -import { __awaiter, __decorate } from "tslib"; -/* eslint-disable @typescript-eslint/consistent-type-assertions */ -/* eslint-disable @typescript-eslint/member-ordering */ -import { AmbientLight, Deck, LightingEffect, OrbitView, OrthographicView } from '@deck.gl/core'; -import { Matrix4 } from '@math.gl/core'; -import bind from 'bind-decorator'; -import { BehaviorSubject, Subject } from 'rxjs'; -import { share } from 'rxjs/operators'; -import { BodyUILayer } from './body-ui-layer'; -import { processSceneNodes } from './util/process-scene-nodes'; -/** - * A convenience wrapper class for the CCF Body UI - */ -export class BodyUI { - constructor(deckProps) { - var _a, _b, _c, _d, _e; - this.deckProps = deckProps; - this.bodyUILayer = new BodyUILayer({}); - this.nodeClickSubject = new Subject(); - this.nodeHoverStartSubject = new Subject(); - this.nodeHoverStopSubject = new Subject(); - this.sceneRotationSubject = new BehaviorSubject([0, 0]); - this.nodeDragStartSubject = new Subject(); - this.nodeDragSubject = new Subject(); - this.nodeDragEndSubject = new Subject(); - this.nodeClick$ = this.nodeClickSubject.pipe(share()); - this.nodeHoverStart$ = this.nodeHoverStartSubject.pipe(share()); - this.nodeHoverStop$ = this.nodeHoverStopSubject.pipe(share()); - this.sceneRotation$ = this.sceneRotationSubject.pipe(share()); - this.nodeDragStart$ = this.nodeDragStartSubject.pipe(share()); - this.nodeDrag$ = this.nodeDragSubject.pipe(share()); - this.nodeDragEnd$ = this.nodeDragEndSubject.pipe(share()); - // eslint-disable-next-line @typescript-eslint/no-explicit-any - const props = Object.assign(Object.assign({}, deckProps), { views: [deckProps.camera === 'orthographic' ? new OrthographicView({ - flipY: false, - near: -1000 - }) : new OrbitView({ orbitAxis: 'Y' })], controller: deckProps.interactive !== undefined ? deckProps.interactive : true, layers: [this.bodyUILayer], onHover: this._onHover, onClick: this._onClick, onViewStateChange: this._onViewStateChange, onDragStart: this._onDragStart, onDrag: this._onDrag, onDragEnd: this._onDragEnd, getCursor: (e) => { var _a; return (_a = this.cursor) !== null && _a !== void 0 ? _a : (e.isDragging ? 'grabbing' : 'grab'); } }); - if (deckProps.legacyLighting) { - // eslint-disable-next-line - props.effects = [ - new LightingEffect({ - ambientLight: new AmbientLight({ - color: [255, 255, 255], - intensity: 10.0 - }) - }) - ]; - } - // eslint-disable-next-line - this.deck = new Deck(props); - this.deck.setProps({ - viewState: { - orbitAxis: 'Y', - minRotationX: (_a = deckProps.minRotationX) !== null && _a !== void 0 ? _a : -15, - maxRotationX: (_b = deckProps.maxRotationX) !== null && _b !== void 0 ? _b : 15, - target: (_c = deckProps.target) !== null && _c !== void 0 ? _c : [0.5, 0.5, 0], - rotationX: 0, - rotationOrbit: (_d = deckProps.rotation) !== null && _d !== void 0 ? _d : 0, - zoom: (_e = deckProps.zoom) !== null && _e !== void 0 ? _e : 9.5, - camera: deckProps.camera - } - }); - if (deckProps.rotation) { - this.sceneRotationSubject.next([deckProps.rotation, 0]); - } - } - initialize() { - return __awaiter(this, void 0, void 0, function* () { - while (!this.bodyUILayer.state) { - // eslint-disable-next-line no-await-in-loop - yield new Promise(r => { - setTimeout(r, 200); - }); - } - }); - } - finalize() { - this.deck.finalize(); - } - setScene(data) { - if ((data === null || data === void 0 ? void 0 : data.length) > 0) { - let zoomOpacity = this.bodyUILayer.state.zoomOpacity; - let didZoom = false; - for (const node of data) { - if (node.zoomToOnLoad) { - this.zoomTo(node); - didZoom = true; - } - } - zoomOpacity = didZoom ? 0.05 : zoomOpacity; - if (!this.deckProps.debugSceneNodeProcessing) { - this.bodyUILayer.setState({ data, zoomOpacity }); - } - else { - this.debugSceneNodeProcessing(data, zoomOpacity); - } - } - } - debugSceneNodeProcessing(data, zoomOpacity) { - // const gltfUrl = 'https://hubmapconsortium.github.io/ccf-3d-reference-object-library/VH_Male/United/VHM_United_Color.glb'; - const gltfUrl = 'https://hubmapconsortium.github.io/ccf-3d-reference-object-library/VH_Female/United/VHF_United_Color.glb'; - // const gltfUrl = 'https://hubmapconsortium.github.io/hubmap-ontology/objects/VHF_United_v01_060420.glb'; - const gltfTransform = new Matrix4([0.076, 0, 0, 0, 0, 0.076, 1.6875389974302382e-17, 0, 0, -1.6875389974302382e-17, 0.076, 0, 0.49, 0.034, 0.11, 1]); - processSceneNodes(gltfUrl, gltfTransform, 'VHF_Kidney_L_Low1').then((results) => { - console.log('results', results); - console.log('data', data); - // data = Object.values(results); - data = data.concat(Object.values(results)); - data.push({ - '@id': 'TEST', - '@type': 'TEST', - scenegraph: gltfUrl, - scenegraphNode: 'VHF_Kidney_R_Low', - transformMatrix: gltfTransform, - color: [255, 255, 255, 200], - // eslint-disable-next-line @typescript-eslint/naming-convention - _lighting: 'pbr', - zoomBasedOpacity: false - }); - this.bodyUILayer.setState({ data, zoomOpacity }); - }); - } - zoomTo(node) { - const matrix = new Matrix4(node.transformMatrix); - this.deck.setProps({ - viewState: Object.assign(Object.assign({}, this.deck.props.viewState), { target: matrix.getTranslation(), rotationX: 0, rotationOrbit: 0, zoom: 11.5 }) - }); - } - setRotation(value) { - this.deck.setProps({ - viewState: Object.assign(Object.assign({}, this.deck.props.viewState), { rotationOrbit: value }) - }); - } - setRotationX(value) { - this.deck.setProps({ - viewState: Object.assign(Object.assign({}, this.deck.props.viewState), { rotationX: value }) - }); - } - setZoom(value) { - this.deck.setProps({ - viewState: Object.assign(Object.assign({}, this.deck.props.viewState), { zoom: value }) - }); - } - setTarget(value) { - this.deck.setProps({ - viewState: Object.assign(Object.assign({}, this.deck.props.viewState), { target: value }) - }); - } - setInteractive(value) { - this.deck.setProps({ - controller: value - }); - } - _onHover(e) { - const { lastHovered } = this; - this.cursor = e.picked ? 'pointer' : undefined; - if (e.picked && e.object && e.object['@id']) { - if (lastHovered !== e.object) { - if (lastHovered) { - this.nodeHoverStopSubject.next(lastHovered); - } - this.lastHovered = e.object; - this.nodeHoverStartSubject.next(e.object); - } - } - else if (lastHovered) { - this.nodeHoverStopSubject.next(lastHovered); - this.lastHovered = undefined; - } - } - _onClick(info, e) { - var _a, _b; - if (info.picked && info.object && info.object['@id']) { - this.nodeClickSubject.next({ node: info.object, ctrlClick: (_b = (_a = e === null || e === void 0 ? void 0 : e.srcEvent) === null || _a === void 0 ? void 0 : _a.ctrlKey) !== null && _b !== void 0 ? _b : undefined }); - } - } - _onViewStateChange(event) { - var _a; - if ((_a = event.interactionState) === null || _a === void 0 ? void 0 : _a.isZooming) { - const currentState = this.bodyUILayer.state; - const zoomOpacity = Math.min(Math.max(1 - (event.viewState.zoom - 8.9) / 2, 0.05), 1.0); - if (currentState.zoomOpacity !== zoomOpacity) { - this.bodyUILayer.setState({ data: currentState.data, zoomOpacity }); - } - } - this.deck.setProps({ viewState: Object.assign({}, event.viewState) }); - this.sceneRotationSubject.next([event.viewState.rotationOrbit, event.viewState.rotationX]); - } - _onDragStart(info, e) { - this._dragEvent(info, e, this.nodeDragStartSubject); - } - _onDrag(info, e) { - this._dragEvent(info, e, this.nodeDragSubject); - } - _onDragEnd(info, e) { - this._dragEvent(info, e, this.nodeDragEndSubject); - } - _dragEvent(info, e, subject) { - var _a; - if ((_a = info === null || info === void 0 ? void 0 : info.object) === null || _a === void 0 ? void 0 : _a['@id']) { - subject.next({ node: info.object, info, e }); - } - } -} -__decorate([ - bind -], BodyUI.prototype, "_onHover", null); -__decorate([ - bind -], BodyUI.prototype, "_onClick", null); -__decorate([ - bind -], BodyUI.prototype, "_onViewStateChange", null); -__decorate([ - bind -], BodyUI.prototype, "_onDragStart", null); -__decorate([ - bind -], BodyUI.prototype, "_onDrag", null); -__decorate([ - bind -], BodyUI.prototype, "_onDragEnd", null); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYm9keS11aS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3Byb2plY3RzL2NjZi1ib2R5LXVpL3NyYy9saWIvYm9keS11aS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsa0VBQWtFO0FBQ2xFLHVEQUF1RDtBQUN2RCxPQUFPLEVBQUUsWUFBWSxFQUFFLElBQUksRUFBRSxjQUFjLEVBQUUsU0FBUyxFQUFFLGdCQUFnQixFQUFFLE1BQU0sZUFBZSxDQUFDO0FBRWhHLE9BQU8sRUFBRSxPQUFPLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFDeEMsT0FBTyxJQUFJLE1BQU0sZ0JBQWdCLENBQUM7QUFDbEMsT0FBTyxFQUFFLGVBQWUsRUFBRSxPQUFPLEVBQUUsTUFBTSxNQUFNLENBQUM7QUFDaEQsT0FBTyxFQUFFLEtBQUssRUFBRSxNQUFNLGdCQUFnQixDQUFDO0FBRXZDLE9BQU8sRUFBRSxXQUFXLEVBQUUsTUFBTSxpQkFBaUIsQ0FBQztBQUU5QyxPQUFPLEVBQUUsaUJBQWlCLEVBQUUsTUFBTSw0QkFBNEIsQ0FBQztBQXlDL0Q7O0dBRUc7QUFDSCxNQUFNLE9BQU8sTUFBTTtJQXVCakIsWUFBb0IsU0FBK0I7O1FBQS9CLGNBQVMsR0FBVCxTQUFTLENBQXNCO1FBckJsQyxnQkFBVyxHQUFHLElBQUksV0FBVyxDQUFDLEVBQUUsQ0FBQyxDQUFDO1FBRWxDLHFCQUFnQixHQUFHLElBQUksT0FBTyxFQUFrQixDQUFDO1FBQ2pELDBCQUFxQixHQUFHLElBQUksT0FBTyxFQUFvQixDQUFDO1FBQ3hELHlCQUFvQixHQUFHLElBQUksT0FBTyxFQUFvQixDQUFDO1FBQ3ZELHlCQUFvQixHQUFHLElBQUksZUFBZSxDQUFtQixDQUFDLENBQUMsRUFBRSxDQUFDLENBQUMsQ0FBQyxDQUFDO1FBQ3JFLHlCQUFvQixHQUFHLElBQUksT0FBTyxFQUFpQixDQUFDO1FBQ3BELG9CQUFlLEdBQUcsSUFBSSxPQUFPLEVBQWlCLENBQUM7UUFDL0MsdUJBQWtCLEdBQUcsSUFBSSxPQUFPLEVBQWlCLENBQUM7UUFFMUQsZUFBVSxHQUFHLElBQUksQ0FBQyxnQkFBZ0IsQ0FBQyxJQUFJLENBQUMsS0FBSyxFQUFFLENBQUMsQ0FBQztRQUNqRCxvQkFBZSxHQUFHLElBQUksQ0FBQyxxQkFBcUIsQ0FBQyxJQUFJLENBQUMsS0FBSyxFQUFFLENBQUMsQ0FBQztRQUMzRCxtQkFBYyxHQUFHLElBQUksQ0FBQyxvQkFBb0IsQ0FBQyxJQUFJLENBQUMsS0FBSyxFQUFFLENBQUMsQ0FBQztRQUN6RCxtQkFBYyxHQUFHLElBQUksQ0FBQyxvQkFBb0IsQ0FBQyxJQUFJLENBQUMsS0FBSyxFQUFFLENBQUMsQ0FBQztRQUN6RCxtQkFBYyxHQUFHLElBQUksQ0FBQyxvQkFBb0IsQ0FBQyxJQUFJLENBQUMsS0FBSyxFQUFFLENBQUMsQ0FBQztRQUN6RCxjQUFTLEdBQUcsSUFBSSxDQUFDLGVBQWUsQ0FBQyxJQUFJLENBQUMsS0FBSyxFQUFFLENBQUMsQ0FBQztRQUMvQyxpQkFBWSxHQUFHLElBQUksQ0FBQyxrQkFBa0IsQ0FBQyxJQUFJLENBQUMsS0FBSyxFQUFFLENBQUMsQ0FBQztRQU01RCw4REFBOEQ7UUFDOUQsTUFBTSxLQUFLLG1DQUNOLFNBQVMsS0FDWixLQUFLLEVBQUUsQ0FBRSxTQUFTLENBQUMsTUFBTSxLQUFLLGNBQWMsQ0FBQyxDQUFDLENBQUMsSUFBSSxnQkFBZ0IsQ0FBQztvQkFDbEUsS0FBSyxFQUFFLEtBQUs7b0JBQ1osSUFBSSxFQUFFLENBQUMsSUFBSTtpQkFDWixDQUFDLENBQUMsQ0FBQyxDQUFDLElBQUksU0FBUyxDQUFDLEVBQUUsU0FBUyxFQUFFLEdBQUcsRUFBRSxDQUFDLENBQUUsRUFDeEMsVUFBVSxFQUFFLFNBQVMsQ0FBQyxXQUFXLEtBQUssU0FBUyxDQUFDLENBQUMsQ0FBQyxTQUFTLENBQUMsV0FBVyxDQUFDLENBQUMsQ0FBQyxJQUFJLEVBQzlFLE1BQU0sRUFBRSxDQUFFLElBQUksQ0FBQyxXQUFXLENBQUUsRUFDNUIsT0FBTyxFQUFFLElBQUksQ0FBQyxRQUFRLEVBQ3RCLE9BQU8sRUFBRSxJQUFJLENBQUMsUUFBUSxFQUN0QixpQkFBaUIsRUFBRSxJQUFJLENBQUMsa0JBQWtCLEVBQzFDLFdBQVcsRUFBRSxJQUFJLENBQUMsWUFBWSxFQUM5QixNQUFNLEVBQUUsSUFBSSxDQUFDLE9BQU8sRUFDcEIsU0FBUyxFQUFFLElBQUksQ0FBQyxVQUFVLEVBQzFCLFNBQVMsRUFBRSxDQUFDLENBQTBCLEVBQUUsRUFBRSxXQUFDLE9BQUEsTUFBQSxJQUFJLENBQUMsTUFBTSxtQ0FBSSxDQUFDLENBQUMsQ0FBQyxVQUFVLENBQUMsQ0FBQyxDQUFDLFVBQVUsQ0FBQyxDQUFDLENBQUMsTUFBTSxDQUFDLENBQUEsRUFBQSxHQUMvRixDQUFDO1FBQ0YsSUFBSSxTQUFTLENBQUMsY0FBYyxFQUFFO1lBQzVCLDJCQUEyQjtZQUMzQixLQUFLLENBQUMsT0FBTyxHQUFHO2dCQUNkLElBQUksY0FBYyxDQUFDO29CQUNqQixZQUFZLEVBQUUsSUFBSSxZQUFZLENBQUM7d0JBQzdCLEtBQUssRUFBRSxDQUFDLEdBQUcsRUFBRSxHQUFHLEVBQUUsR0FBRyxDQUFDO3dCQUN0QixTQUFTLEVBQUUsSUFBSTtxQkFDaEIsQ0FBQztpQkFDSCxDQUFDO2FBQ0gsQ0FBQztTQUNIO1FBQ0QsMkJBQTJCO1FBQzNCLElBQUksQ0FBQyxJQUFJLEdBQUcsSUFBSSxJQUFJLENBQUMsS0FBSyxDQUFDLENBQUM7UUFDNUIsSUFBSSxDQUFDLElBQUksQ0FBQyxRQUFRLENBQUM7WUFDakIsU0FBUyxFQUFFO2dCQUNULFNBQVMsRUFBRSxHQUFHO2dCQUNkLFlBQVksRUFBRSxNQUFBLFNBQVMsQ0FBQyxZQUFZLG1DQUFJLENBQUMsRUFBRTtnQkFDM0MsWUFBWSxFQUFFLE1BQUEsU0FBUyxDQUFDLFlBQVksbUNBQUksRUFBRTtnQkFDMUMsTUFBTSxFQUFFLE1BQUEsU0FBUyxDQUFDLE1BQU0sbUNBQUksQ0FBQyxHQUFHLEVBQUUsR0FBRyxFQUFFLENBQUMsQ0FBQztnQkFDekMsU0FBUyxFQUFFLENBQUM7Z0JBQ1osYUFBYSxFQUFFLE1BQUEsU0FBUyxDQUFDLFFBQVEsbUNBQUksQ0FBQztnQkFDdEMsSUFBSSxFQUFFLE1BQUEsU0FBUyxDQUFDLElBQUksbUNBQUksR0FBRztnQkFDM0IsTUFBTSxFQUFFLFNBQVMsQ0FBQyxNQUFNO2FBQ0Q7U0FDMUIsQ0FBQyxDQUFDO1FBQ0gsSUFBSSxTQUFTLENBQUMsUUFBUSxFQUFFO1lBQ3RCLElBQUksQ0FBQyxvQkFBb0IsQ0FBQyxJQUFJLENBQUMsQ0FBQyxTQUFTLENBQUMsUUFBUSxFQUFFLENBQUMsQ0FBQyxDQUFDLENBQUM7U0FDekQ7SUFDSCxDQUFDO0lBRUssVUFBVTs7WUFDZCxPQUFPLENBQUMsSUFBSSxDQUFDLFdBQVcsQ0FBQyxLQUFLLEVBQUU7Z0JBQzlCLDRDQUE0QztnQkFDNUMsTUFBTSxJQUFJLE9BQU8sQ0FBQyxDQUFDLENBQUMsRUFBRTtvQkFDcEIsVUFBVSxDQUFDLENBQUMsRUFBRSxHQUFHLENBQUMsQ0FBQztnQkFDckIsQ0FBQyxDQUFDLENBQUM7YUFDSjtRQUNILENBQUM7S0FBQTtJQUVELFFBQVE7UUFDTixJQUFJLENBQUMsSUFBSSxDQUFDLFFBQVEsRUFBRSxDQUFDO0lBQ3ZCLENBQUM7SUFFRCxRQUFRLENBQUMsSUFBd0I7UUFDL0IsSUFBSSxDQUFBLElBQUksYUFBSixJQUFJLHVCQUFKLElBQUksQ0FBRSxNQUFNLElBQUcsQ0FBQyxFQUFFO1lBQ3BCLElBQUksV0FBVyxHQUFJLElBQUksQ0FBQyxXQUFXLENBQUMsS0FBaUMsQ0FBQyxXQUFXLENBQUM7WUFDbEYsSUFBSSxPQUFPLEdBQUcsS0FBSyxDQUFDO1lBQ3BCLEtBQUssTUFBTSxJQUFJLElBQUksSUFBSSxFQUFFO2dCQUN2QixJQUFJLElBQUksQ0FBQyxZQUFZLEVBQUU7b0JBQ3JCLElBQUksQ0FBQyxNQUFNLENBQUMsSUFBSSxDQUFDLENBQUM7b0JBQ2xCLE9BQU8sR0FBRyxJQUFJLENBQUM7aUJBQ2hCO2FBQ0Y7WUFDRCxXQUFXLEdBQUcsT0FBTyxDQUFDLENBQUMsQ0FBQyxJQUFJLENBQUMsQ0FBQyxDQUFDLFdBQVcsQ0FBQztZQUMzQyxJQUFJLENBQUMsSUFBSSxDQUFDLFNBQVMsQ0FBQyx3QkFBd0IsRUFBRTtnQkFDNUMsSUFBSSxDQUFDLFdBQVcsQ0FBQyxRQUFRLENBQUMsRUFBRSxJQUFJLEVBQUUsV0FBVyxFQUFFLENBQUMsQ0FBQzthQUNsRDtpQkFBTTtnQkFDTCxJQUFJLENBQUMsd0JBQXdCLENBQUMsSUFBSSxFQUFFLFdBQVcsQ0FBQyxDQUFDO2FBQ2xEO1NBQ0Y7SUFDSCxDQUFDO0lBRUQsd0JBQXdCLENBQUMsSUFBd0IsRUFBRSxXQUFtQjtRQUNwRSw0SEFBNEg7UUFDNUgsTUFBTSxPQUFPLEdBQUcsMEdBQTBHLENBQUM7UUFDM0gsMEdBQTBHO1FBQzFHLE1BQU0sYUFBYSxHQUFHLElBQUksT0FBTyxDQUFDLENBQUMsS0FBSyxFQUFDLENBQUMsRUFBQyxDQUFDLEVBQUMsQ0FBQyxFQUFDLENBQUMsRUFBQyxLQUFLLEVBQUMsc0JBQXNCLEVBQUMsQ0FBQyxFQUFDLENBQUMsRUFBQyxDQUFDLHNCQUFzQixFQUFDLEtBQUssRUFBQyxDQUFDLEVBQUMsSUFBSSxFQUFDLEtBQUssRUFBQyxJQUFJLEVBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztRQUN0SSxpQkFBaUIsQ0FBQyxPQUFPLEVBQUUsYUFBYSxFQUFFLG1CQUFtQixDQUFDLENBQUMsSUFBSSxDQUFDLENBQUMsT0FBTyxFQUFFLEVBQUU7WUFDOUUsT0FBTyxDQUFDLEdBQUcsQ0FBQyxTQUFTLEVBQUUsT0FBTyxDQUFDLENBQUM7WUFDaEMsT0FBTyxDQUFDLEdBQUcsQ0FBQyxNQUFNLEVBQUUsSUFBSSxDQUFDLENBQUM7WUFDMUIsaUNBQWlDO1lBQ2pDLElBQUksR0FBRyxJQUFJLENBQUMsTUFBTSxDQUFDLE1BQU0sQ0FBQyxNQUFNLENBQUMsT0FBTyxDQUFDLENBQUMsQ0FBQztZQUMzQyxJQUFJLENBQUMsSUFBSSxDQUFDO2dCQUNSLEtBQUssRUFBRSxNQUFNO2dCQUNiLE9BQU8sRUFBRSxNQUFNO2dCQUNmLFVBQVUsRUFBRSxPQUFPO2dCQUNuQixjQUFjLEVBQUUsa0JBQWtCO2dCQUNsQyxlQUFlLEVBQUUsYUFBYTtnQkFDOUIsS0FBSyxFQUFFLENBQUMsR0FBRyxFQUFFLEdBQUcsRUFBRSxHQUFHLEVBQUUsR0FBRyxDQUFDO2dCQUMzQixnRUFBZ0U7Z0JBQ2hFLFNBQVMsRUFBRSxLQUFLO2dCQUNoQixnQkFBZ0IsRUFBRSxLQUFLO2FBQ3hCLENBQUMsQ0FBQztZQUNILElBQUksQ0FBQyxXQUFXLENBQUMsUUFBUSxDQUFDLEVBQUUsSUFBSSxFQUFFLFdBQVcsRUFBRSxDQUFDLENBQUM7UUFDbkQsQ0FBQyxDQUFDLENBQUM7SUFDTCxDQUFDO0lBRUQsTUFBTSxDQUFDLElBQXNCO1FBQzNCLE1BQU0sTUFBTSxHQUFHLElBQUksT0FBTyxDQUFDLElBQUksQ0FBQyxlQUFlLENBQUMsQ0FBQztRQUNqRCxJQUFJLENBQUMsSUFBSSxDQUFDLFFBQVEsQ0FBQztZQUNqQixTQUFTLEVBQUUsZ0NBQ04sSUFBSSxDQUFDLElBQUksQ0FBQyxLQUFLLENBQUMsU0FBUyxLQUM1QixNQUFNLEVBQUUsTUFBTSxDQUFDLGNBQWMsRUFBRSxFQUMvQixTQUFTLEVBQUUsQ0FBQyxFQUNaLGFBQWEsRUFBRSxDQUFDLEVBQ2hCLElBQUksRUFBRSxJQUFJLEdBQ2E7U0FDMUIsQ0FBQyxDQUFDO0lBQ0wsQ0FBQztJQUVELFdBQVcsQ0FBQyxLQUFhO1FBQ3ZCLElBQUksQ0FBQyxJQUFJLENBQUMsUUFBUSxDQUFDO1lBQ2pCLFNBQVMsRUFBRSxnQ0FDTixJQUFJLENBQUMsSUFBSSxDQUFDLEtBQUssQ0FBQyxTQUFTLEtBQzVCLGFBQWEsRUFBRSxLQUFLLEdBQ0c7U0FDMUIsQ0FBQyxDQUFDO0lBQ0wsQ0FBQztJQUVELFlBQVksQ0FBQyxLQUFhO1FBQ3hCLElBQUksQ0FBQyxJQUFJLENBQUMsUUFBUSxDQUFDO1lBQ2pCLFNBQVMsRUFBRSxnQ0FDTixJQUFJLENBQUMsSUFBSSxDQUFDLEtBQUssQ0FBQyxTQUFTLEtBQzVCLFNBQVMsRUFBRSxLQUFLLEdBQ087U0FDMUIsQ0FBQyxDQUFDO0lBQ0wsQ0FBQztJQUVELE9BQU8sQ0FBQyxLQUFhO1FBQ25CLElBQUksQ0FBQyxJQUFJLENBQUMsUUFBUSxDQUFDO1lBQ2pCLFNBQVMsRUFBRSxnQ0FDTixJQUFJLENBQUMsSUFBSSxDQUFDLEtBQUssQ0FBQyxTQUFTLEtBQzVCLElBQUksRUFBRSxLQUFLLEdBQ1k7U0FDMUIsQ0FBQyxDQUFDO0lBQ0wsQ0FBQztJQUVELFNBQVMsQ0FBQyxLQUFlO1FBQ3ZCLElBQUksQ0FBQyxJQUFJLENBQUMsUUFBUSxDQUFDO1lBQ2pCLFNBQVMsRUFBRSxnQ0FDTixJQUFJLENBQUMsSUFBSSxDQUFDLEtBQUssQ0FBQyxTQUFTLEtBQzVCLE1BQU0sRUFBRSxLQUFLLEdBQ1U7U0FDMUIsQ0FBQyxDQUFDO0lBQ0wsQ0FBQztJQUVELGNBQWMsQ0FBQyxLQUFjO1FBQzNCLElBQUksQ0FBQyxJQUFJLENBQUMsUUFBUSxDQUFDO1lBQ2pCLFVBQVUsRUFBRSxLQUFLO1NBQ2xCLENBQUMsQ0FBQztJQUNMLENBQUM7SUFHTyxRQUFRLENBQUMsQ0FBZ0Q7UUFDL0QsTUFBTSxFQUFFLFdBQVcsRUFBRSxHQUFHLElBQUksQ0FBQztRQUM3QixJQUFJLENBQUMsTUFBTSxHQUFHLENBQUMsQ0FBQyxNQUFNLENBQUMsQ0FBQyxDQUFDLFNBQVMsQ0FBQyxDQUFDLENBQUMsU0FBUyxDQUFDO1FBQy9DLElBQUksQ0FBQyxDQUFDLE1BQU0sSUFBSSxDQUFDLENBQUMsTUFBTSxJQUFJLENBQUMsQ0FBQyxNQUFNLENBQUMsS0FBSyxDQUFDLEVBQUU7WUFDM0MsSUFBSSxXQUFXLEtBQUssQ0FBQyxDQUFDLE1BQU0sRUFBRTtnQkFDNUIsSUFBSSxXQUFXLEVBQUU7b0JBQ2YsSUFBSSxDQUFDLG9CQUFvQixDQUFDLElBQUksQ0FBQyxXQUFXLENBQUMsQ0FBQztpQkFDN0M7Z0JBQ0QsSUFBSSxDQUFDLFdBQVcsR0FBRyxDQUFDLENBQUMsTUFBTSxDQUFDO2dCQUM1QixJQUFJLENBQUMscUJBQXFCLENBQUMsSUFBSSxDQUFDLENBQUMsQ0FBQyxNQUFNLENBQUMsQ0FBQzthQUMzQztTQUNGO2FBQU0sSUFBSSxXQUFXLEVBQUU7WUFDdEIsSUFBSSxDQUFDLG9CQUFvQixDQUFDLElBQUksQ0FBQyxXQUFXLENBQUMsQ0FBQztZQUM1QyxJQUFJLENBQUMsV0FBVyxHQUFHLFNBQVMsQ0FBQztTQUM5QjtJQUNILENBQUM7SUFHTyxRQUFRLENBQUMsSUFBZ0MsRUFBRSxDQUFxQzs7UUFDdEYsSUFBSSxJQUFJLENBQUMsTUFBTSxJQUFJLElBQUksQ0FBQyxNQUFNLElBQUksSUFBSSxDQUFDLE1BQU0sQ0FBQyxLQUFLLENBQUMsRUFBRTtZQUNwRCxJQUFJLENBQUMsZ0JBQWdCLENBQUMsSUFBSSxDQUFDLEVBQUUsSUFBSSxFQUFFLElBQUksQ0FBQyxNQUFNLEVBQUUsU0FBUyxFQUFFLE1BQUEsTUFBQSxDQUFDLGFBQUQsQ0FBQyx1QkFBRCxDQUFDLENBQUUsUUFBUSwwQ0FBRSxPQUFPLG1DQUFJLFNBQVMsRUFBRSxDQUFDLENBQUM7U0FDakc7SUFDSCxDQUFDO0lBR08sa0JBQWtCLENBQUMsS0FBb0Y7O1FBQzdHLElBQUksTUFBQSxLQUFLLENBQUMsZ0JBQWdCLDBDQUFFLFNBQVMsRUFBRTtZQUNyQyxNQUFNLFlBQVksR0FBRyxJQUFJLENBQUMsV0FBVyxDQUFDLEtBQStDLENBQUM7WUFDdEYsTUFBTSxXQUFXLEdBQUcsSUFBSSxDQUFDLEdBQUcsQ0FBQyxJQUFJLENBQUMsR0FBRyxDQUFDLENBQUMsR0FBRyxDQUFDLEtBQUssQ0FBQyxTQUFTLENBQUMsSUFBSSxHQUFHLEdBQUcsQ0FBQyxHQUFHLENBQUMsRUFBRSxJQUFJLENBQUMsRUFBRSxHQUFHLENBQUMsQ0FBQztZQUN4RixJQUFJLFlBQVksQ0FBQyxXQUFXLEtBQUssV0FBVyxFQUFFO2dCQUM1QyxJQUFJLENBQUMsV0FBVyxDQUFDLFFBQVEsQ0FBQyxFQUFFLElBQUksRUFBRSxZQUFZLENBQUMsSUFBSSxFQUFFLFdBQVcsRUFBRSxDQUFDLENBQUM7YUFDckU7U0FDRjtRQUNELElBQUksQ0FBQyxJQUFJLENBQUMsUUFBUSxDQUFDLEVBQUUsU0FBUyxvQkFBTyxLQUFLLENBQUMsU0FBUyxDQUFFLEVBQUUsQ0FBQyxDQUFDO1FBQzFELElBQUksQ0FBQyxvQkFBb0IsQ0FBQyxJQUFJLENBQUMsQ0FBQyxLQUFLLENBQUMsU0FBUyxDQUFDLGFBQWEsRUFBRSxLQUFLLENBQUMsU0FBUyxDQUFDLFNBQVMsQ0FBQyxDQUFDLENBQUM7SUFDN0YsQ0FBQztJQUdPLFlBQVksQ0FBQyxJQUFnQyxFQUFFLENBQWE7UUFDbEUsSUFBSSxDQUFDLFVBQVUsQ0FBQyxJQUFJLEVBQUUsQ0FBQyxFQUFFLElBQUksQ0FBQyxvQkFBb0IsQ0FBQyxDQUFDO0lBQ3RELENBQUM7SUFHTyxPQUFPLENBQUMsSUFBZ0MsRUFBRSxDQUFhO1FBQzdELElBQUksQ0FBQyxVQUFVLENBQUMsSUFBSSxFQUFFLENBQUMsRUFBRSxJQUFJLENBQUMsZUFBZSxDQUFDLENBQUM7SUFDakQsQ0FBQztJQUdPLFVBQVUsQ0FBQyxJQUFnQyxFQUFFLENBQWE7UUFDaEUsSUFBSSxDQUFDLFVBQVUsQ0FBQyxJQUFJLEVBQUUsQ0FBQyxFQUFFLElBQUksQ0FBQyxrQkFBa0IsQ0FBQyxDQUFDO0lBQ3BELENBQUM7SUFFTyxVQUFVLENBQUMsSUFBZ0MsRUFBRSxDQUFhLEVBQUUsT0FBK0I7O1FBQ2pHLElBQUksTUFBQSxJQUFJLGFBQUosSUFBSSx1QkFBSixJQUFJLENBQUUsTUFBTSwwQ0FBRyxLQUFLLENBQUMsRUFBRTtZQUN6QixPQUFPLENBQUMsSUFBSSxDQUFDLEVBQUUsSUFBSSxFQUFFLElBQUksQ0FBQyxNQUFNLEVBQUUsSUFBSSxFQUFFLENBQUMsRUFBRSxDQUFDLENBQUM7U0FDOUM7SUFDSCxDQUFDO0NBQ0Y7QUF6REM7SUFEQyxJQUFJO3NDQWdCSjtBQUdEO0lBREMsSUFBSTtzQ0FLSjtBQUdEO0lBREMsSUFBSTtnREFXSjtBQUdEO0lBREMsSUFBSTswQ0FHSjtBQUdEO0lBREMsSUFBSTtxQ0FHSjtBQUdEO0lBREMsSUFBSTt3Q0FHSiIsInNvdXJjZXNDb250ZW50IjpbIi8qIGVzbGludC1kaXNhYmxlIEB0eXBlc2NyaXB0LWVzbGludC9jb25zaXN0ZW50LXR5cGUtYXNzZXJ0aW9ucyAqL1xuLyogZXNsaW50LWRpc2FibGUgQHR5cGVzY3JpcHQtZXNsaW50L21lbWJlci1vcmRlcmluZyAqL1xuaW1wb3J0IHsgQW1iaWVudExpZ2h0LCBEZWNrLCBMaWdodGluZ0VmZmVjdCwgT3JiaXRWaWV3LCBPcnRob2dyYXBoaWNWaWV3IH0gZnJvbSAnQGRlY2suZ2wvY29yZSc7XG5pbXBvcnQgeyBWaWV3U3RhdGVQcm9wcyB9IGZyb20gJ0BkZWNrLmdsL2NvcmUvbGliL2RlY2snO1xuaW1wb3J0IHsgTWF0cml4NCB9IGZyb20gJ0BtYXRoLmdsL2NvcmUnO1xuaW1wb3J0IGJpbmQgZnJvbSAnYmluZC1kZWNvcmF0b3InO1xuaW1wb3J0IHsgQmVoYXZpb3JTdWJqZWN0LCBTdWJqZWN0IH0gZnJvbSAncnhqcyc7XG5pbXBvcnQgeyBzaGFyZSB9IGZyb20gJ3J4anMvb3BlcmF0b3JzJztcblxuaW1wb3J0IHsgQm9keVVJTGF5ZXIgfSBmcm9tICcuL2JvZHktdWktbGF5ZXInO1xuaW1wb3J0IHsgU3BhdGlhbFNjZW5lTm9kZSB9IGZyb20gJy4vc2hhcmVkL3NwYXRpYWwtc2NlbmUtbm9kZSc7XG5pbXBvcnQgeyBwcm9jZXNzU2NlbmVOb2RlcyB9IGZyb20gJy4vdXRpbC9wcm9jZXNzLXNjZW5lLW5vZGVzJztcblxuXG5pbnRlcmZhY2UgQm9keVVJVmlld1N0YXRlUHJvcHMgZXh0ZW5kcyBWaWV3U3RhdGVQcm9wcyB7XG4gIG9yYml0QXhpcz86IHN0cmluZztcbiAgdGFyZ2V0PzogTWF0cml4NCB8IG51bWJlcltdO1xuICB6b29tOiBudW1iZXI7XG4gIHJvdGF0aW9uT3JiaXQ6IG51bWJlcjtcbiAgcm90YXRpb25YOiBudW1iZXI7XG4gIGNhbWVyYTogc3RyaW5nO1xufVxuXG5leHBvcnQgaW50ZXJmYWNlIEJvZHlVSVByb3BzIHtcbiAgaWQ6IHN0cmluZztcbiAgY2FudmFzOiBzdHJpbmcgfCBIVE1MQ2FudmFzRWxlbWVudDtcbiAgcGFyZW50OiBIVE1MRWxlbWVudDtcbiAgZGVidWdTY2VuZU5vZGVQcm9jZXNzaW5nPzogYm9vbGVhbjtcbiAgdGFyZ2V0OiBNYXRyaXg0IHwgbnVtYmVyW107XG4gIGludGVyYWN0aXZlOiBib29sZWFuO1xuICByb3RhdGlvbjogbnVtYmVyO1xuICBtaW5Sb3RhdGlvblg6IG51bWJlcjtcbiAgbWF4Um90YXRpb25YOiBudW1iZXI7XG4gIHpvb206IG51bWJlcjtcbiAgbGVnYWN5TGlnaHRpbmc/OiBib29sZWFuO1xuICBjYW1lcmE6IHN0cmluZztcbn1cblxuZXhwb3J0IGludGVyZmFjZSBQaWNrSW5mbzxEPiB7XG4gIGxheWVyOiB1bmtub3duO1xuICBpbmRleDogbnVtYmVyO1xuICBvYmplY3Q6IEQ7XG4gIHg6IG51bWJlcjtcbiAgeTogbnVtYmVyO1xuICBjb29yZGluYXRlPzogdW5rbm93bjtcbiAgcGlja2VkPzogYm9vbGVhbjtcbn1cblxuZXhwb3J0IHR5cGUgTm9kZURyYWdFdmVudCA9IHsgbm9kZTogU3BhdGlhbFNjZW5lTm9kZTsgaW5mbzogUGlja0luZm88U3BhdGlhbFNjZW5lTm9kZT47IGU6IE1vdXNlRXZlbnQgfTtcblxuZXhwb3J0IHR5cGUgTm9kZUNsaWNrRXZlbnQgPSB7IG5vZGU6IFNwYXRpYWxTY2VuZU5vZGU7IGN0cmxDbGljazogYm9vbGVhbiB9O1xuXG4vKipcbiAqIEEgY29udmVuaWVuY2Ugd3JhcHBlciBjbGFzcyBmb3IgdGhlIENDRiBCb2R5IFVJXG4gKi9cbmV4cG9ydCBjbGFzcyBCb2R5VUkge1xuICBkZWNrOiBEZWNrO1xuICBwcml2YXRlIHJlYWRvbmx5IGJvZHlVSUxheWVyID0gbmV3IEJvZHlVSUxheWVyKHt9KTtcblxuICBwcml2YXRlIHJlYWRvbmx5IG5vZGVDbGlja1N1YmplY3QgPSBuZXcgU3ViamVjdDxOb2RlQ2xpY2tFdmVudD4oKTtcbiAgcHJpdmF0ZSByZWFkb25seSBub2RlSG92ZXJTdGFydFN1YmplY3QgPSBuZXcgU3ViamVjdDxTcGF0aWFsU2NlbmVOb2RlPigpO1xuICBwcml2YXRlIHJlYWRvbmx5IG5vZGVIb3ZlclN0b3BTdWJqZWN0ID0gbmV3IFN1YmplY3Q8U3BhdGlhbFNjZW5lTm9kZT4oKTtcbiAgcHJpdmF0ZSByZWFkb25seSBzY2VuZVJvdGF0aW9uU3ViamVjdCA9IG5ldyBCZWhhdmlvclN1YmplY3Q8W251bWJlciwgbnVtYmVyXT4oWzAsIDBdKTtcbiAgcHJpdmF0ZSByZWFkb25seSBub2RlRHJhZ1N0YXJ0U3ViamVjdCA9IG5ldyBTdWJqZWN0PE5vZGVEcmFnRXZlbnQ+KCk7XG4gIHByaXZhdGUgcmVhZG9ubHkgbm9kZURyYWdTdWJqZWN0ID0gbmV3IFN1YmplY3Q8Tm9kZURyYWdFdmVudD4oKTtcbiAgcHJpdmF0ZSByZWFkb25seSBub2RlRHJhZ0VuZFN1YmplY3QgPSBuZXcgU3ViamVjdDxOb2RlRHJhZ0V2ZW50PigpO1xuXG4gIHJlYWRvbmx5IG5vZGVDbGljayQgPSB0aGlzLm5vZGVDbGlja1N1YmplY3QucGlwZShzaGFyZSgpKTtcbiAgcmVhZG9ubHkgbm9kZUhvdmVyU3RhcnQkID0gdGhpcy5ub2RlSG92ZXJTdGFydFN1YmplY3QucGlwZShzaGFyZSgpKTtcbiAgcmVhZG9ubHkgbm9kZUhvdmVyU3RvcCQgPSB0aGlzLm5vZGVIb3ZlclN0b3BTdWJqZWN0LnBpcGUoc2hhcmUoKSk7XG4gIHJlYWRvbmx5IHNjZW5lUm90YXRpb24kID0gdGhpcy5zY2VuZVJvdGF0aW9uU3ViamVjdC5waXBlKHNoYXJlKCkpO1xuICByZWFkb25seSBub2RlRHJhZ1N0YXJ0JCA9IHRoaXMubm9kZURyYWdTdGFydFN1YmplY3QucGlwZShzaGFyZSgpKTtcbiAgcmVhZG9ubHkgbm9kZURyYWckID0gdGhpcy5ub2RlRHJhZ1N1YmplY3QucGlwZShzaGFyZSgpKTtcbiAgcmVhZG9ubHkgbm9kZURyYWdFbmQkID0gdGhpcy5ub2RlRHJhZ0VuZFN1YmplY3QucGlwZShzaGFyZSgpKTtcblxuICBwcml2YXRlIGN1cnNvcj86IHN0cmluZztcbiAgcHJpdmF0ZSBsYXN0SG92ZXJlZD86IFNwYXRpYWxTY2VuZU5vZGU7XG5cbiAgY29uc3RydWN0b3IocHJpdmF0ZSBkZWNrUHJvcHM6IFBhcnRpYWw8Qm9keVVJUHJvcHM+KSB7XG4gICAgLy8gZXNsaW50LWRpc2FibGUtbmV4dC1saW5lIEB0eXBlc2NyaXB0LWVzbGludC9uby1leHBsaWNpdC1hbnlcbiAgICBjb25zdCBwcm9wczogYW55ID0ge1xuICAgICAgLi4uZGVja1Byb3BzLFxuICAgICAgdmlld3M6IFsgZGVja1Byb3BzLmNhbWVyYSA9PT0gJ29ydGhvZ3JhcGhpYycgPyBuZXcgT3J0aG9ncmFwaGljVmlldyh7XG4gICAgICAgIGZsaXBZOiBmYWxzZSxcbiAgICAgICAgbmVhcjogLTEwMDBcbiAgICAgIH0pIDogbmV3IE9yYml0Vmlldyh7IG9yYml0QXhpczogJ1knIH0pIF0sXG4gICAgICBjb250cm9sbGVyOiBkZWNrUHJvcHMuaW50ZXJhY3RpdmUgIT09IHVuZGVmaW5lZCA/IGRlY2tQcm9wcy5pbnRlcmFjdGl2ZSA6IHRydWUsXG4gICAgICBsYXllcnM6IFsgdGhpcy5ib2R5VUlMYXllciBdLFxuICAgICAgb25Ib3ZlcjogdGhpcy5fb25Ib3ZlcixcbiAgICAgIG9uQ2xpY2s6IHRoaXMuX29uQ2xpY2ssXG4gICAgICBvblZpZXdTdGF0ZUNoYW5nZTogdGhpcy5fb25WaWV3U3RhdGVDaGFuZ2UsXG4gICAgICBvbkRyYWdTdGFydDogdGhpcy5fb25EcmFnU3RhcnQsXG4gICAgICBvbkRyYWc6IHRoaXMuX29uRHJhZyxcbiAgICAgIG9uRHJhZ0VuZDogdGhpcy5fb25EcmFnRW5kLFxuICAgICAgZ2V0Q3Vyc29yOiAoZTogeyBpc0RyYWdnaW5nOiBib29sZWFuIH0pID0+IHRoaXMuY3Vyc29yID8/IChlLmlzRHJhZ2dpbmcgPyAnZ3JhYmJpbmcnIDogJ2dyYWInKVxuICAgIH07XG4gICAgaWYgKGRlY2tQcm9wcy5sZWdhY3lMaWdodGluZykge1xuICAgICAgLy8gZXNsaW50LWRpc2FibGUtbmV4dC1saW5lXG4gICAgICBwcm9wcy5lZmZlY3RzID0gW1xuICAgICAgICBuZXcgTGlnaHRpbmdFZmZlY3Qoe1xuICAgICAgICAgIGFtYmllbnRMaWdodDogbmV3IEFtYmllbnRMaWdodCh7XG4gICAgICAgICAgICBjb2xvcjogWzI1NSwgMjU1LCAyNTVdLFxuICAgICAgICAgICAgaW50ZW5zaXR5OiAxMC4wXG4gICAgICAgICAgfSlcbiAgICAgICAgfSlcbiAgICAgIF07XG4gICAgfVxuICAgIC8vIGVzbGludC1kaXNhYmxlLW5leHQtbGluZVxuICAgIHRoaXMuZGVjayA9IG5ldyBEZWNrKHByb3BzKTtcbiAgICB0aGlzLmRlY2suc2V0UHJvcHMoe1xuICAgICAgdmlld1N0YXRlOiB7XG4gICAgICAgIG9yYml0QXhpczogJ1knLFxuICAgICAgICBtaW5Sb3RhdGlvblg6IGRlY2tQcm9wcy5taW5Sb3RhdGlvblggPz8gLTE1LFxuICAgICAgICBtYXhSb3RhdGlvblg6IGRlY2tQcm9wcy5tYXhSb3RhdGlvblggPz8gMTUsXG4gICAgICAgIHRhcmdldDogZGVja1Byb3BzLnRhcmdldCA/PyBbMC41LCAwLjUsIDBdLFxuICAgICAgICByb3RhdGlvblg6IDAsXG4gICAgICAgIHJvdGF0aW9uT3JiaXQ6IGRlY2tQcm9wcy5yb3RhdGlvbiA/PyAwLFxuICAgICAgICB6b29tOiBkZWNrUHJvcHMuem9vbSA/PyA5LjUsXG4gICAgICAgIGNhbWVyYTogZGVja1Byb3BzLmNhbWVyYVxuICAgICAgfSBhcyBCb2R5VUlWaWV3U3RhdGVQcm9wc1xuICAgIH0pO1xuICAgIGlmIChkZWNrUHJvcHMucm90YXRpb24pIHtcbiAgICAgIHRoaXMuc2NlbmVSb3RhdGlvblN1YmplY3QubmV4dChbZGVja1Byb3BzLnJvdGF0aW9uLCAwXSk7XG4gICAgfVxuICB9XG5cbiAgYXN5bmMgaW5pdGlhbGl6ZSgpOiBQcm9taXNlPHZvaWQ+IHtcbiAgICB3aGlsZSAoIXRoaXMuYm9keVVJTGF5ZXIuc3RhdGUpIHtcbiAgICAgIC8vIGVzbGludC1kaXNhYmxlLW5leHQtbGluZSBuby1hd2FpdC1pbi1sb29wXG4gICAgICBhd2FpdCBuZXcgUHJvbWlzZShyID0+IHtcbiAgICAgICAgc2V0VGltZW91dChyLCAyMDApO1xuICAgICAgfSk7XG4gICAgfVxuICB9XG5cbiAgZmluYWxpemUoKTogdm9pZCB7XG4gICAgdGhpcy5kZWNrLmZpbmFsaXplKCk7XG4gIH1cblxuICBzZXRTY2VuZShkYXRhOiBTcGF0aWFsU2NlbmVOb2RlW10pOiB2b2lkIHtcbiAgICBpZiAoZGF0YT8ubGVuZ3RoID4gMCkge1xuICAgICAgbGV0IHpvb21PcGFjaXR5ID0gKHRoaXMuYm9keVVJTGF5ZXIuc3RhdGUgYXMgeyB6b29tT3BhY2l0eTogbnVtYmVyIH0pLnpvb21PcGFjaXR5O1xuICAgICAgbGV0IGRpZFpvb20gPSBmYWxzZTtcbiAgICAgIGZvciAoY29uc3Qgbm9kZSBvZiBkYXRhKSB7XG4gICAgICAgIGlmIChub2RlLnpvb21Ub09uTG9hZCkge1xuICAgICAgICAgIHRoaXMuem9vbVRvKG5vZGUpO1xuICAgICAgICAgIGRpZFpvb20gPSB0cnVlO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICB6b29tT3BhY2l0eSA9IGRpZFpvb20gPyAwLjA1IDogem9vbU9wYWNpdHk7XG4gICAgICBpZiAoIXRoaXMuZGVja1Byb3BzLmRlYnVnU2NlbmVOb2RlUHJvY2Vzc2luZykge1xuICAgICAgICB0aGlzLmJvZHlVSUxheWVyLnNldFN0YXRlKHsgZGF0YSwgem9vbU9wYWNpdHkgfSk7XG4gICAgICB9IGVsc2Uge1xuICAgICAgICB0aGlzLmRlYnVnU2NlbmVOb2RlUHJvY2Vzc2luZyhkYXRhLCB6b29tT3BhY2l0eSk7XG4gICAgICB9XG4gICAgfVxuICB9XG5cbiAgZGVidWdTY2VuZU5vZGVQcm9jZXNzaW5nKGRhdGE6IFNwYXRpYWxTY2VuZU5vZGVbXSwgem9vbU9wYWNpdHk6IG51bWJlcik6IHZvaWQge1xuICAgIC8vIGNvbnN0IGdsdGZVcmwgPSAnaHR0cHM6Ly9odWJtYXBjb25zb3J0aXVtLmdpdGh1Yi5pby9jY2YtM2QtcmVmZXJlbmNlLW9iamVjdC1saWJyYXJ5L1ZIX01hbGUvVW5pdGVkL1ZITV9Vbml0ZWRfQ29sb3IuZ2xiJztcbiAgICBjb25zdCBnbHRmVXJsID0gJ2h0dHBzOi8vaHVibWFwY29uc29ydGl1bS5naXRodWIuaW8vY2NmLTNkLXJlZmVyZW5jZS1vYmplY3QtbGlicmFyeS9WSF9GZW1hbGUvVW5pdGVkL1ZIRl9Vbml0ZWRfQ29sb3IuZ2xiJztcbiAgICAvLyBjb25zdCBnbHRmVXJsID0gJ2h0dHBzOi8vaHVibWFwY29uc29ydGl1bS5naXRodWIuaW8vaHVibWFwLW9udG9sb2d5L29iamVjdHMvVkhGX1VuaXRlZF92MDFfMDYwNDIwLmdsYic7XG4gICAgY29uc3QgZ2x0ZlRyYW5zZm9ybSA9IG5ldyBNYXRyaXg0KFswLjA3NiwwLDAsMCwwLDAuMDc2LDEuNjg3NTM4OTk3NDMwMjM4MmUtMTcsMCwwLC0xLjY4NzUzODk5NzQzMDIzODJlLTE3LDAuMDc2LDAsMC40OSwwLjAzNCwwLjExLDFdKTtcbiAgICBwcm9jZXNzU2NlbmVOb2RlcyhnbHRmVXJsLCBnbHRmVHJhbnNmb3JtLCAnVkhGX0tpZG5leV9MX0xvdzEnKS50aGVuKChyZXN1bHRzKSA9PiB7XG4gICAgICBjb25zb2xlLmxvZygncmVzdWx0cycsIHJlc3VsdHMpO1xuICAgICAgY29uc29sZS5sb2coJ2RhdGEnLCBkYXRhKTtcbiAgICAgIC8vIGRhdGEgPSBPYmplY3QudmFsdWVzKHJlc3VsdHMpO1xuICAgICAgZGF0YSA9IGRhdGEuY29uY2F0KE9iamVjdC52YWx1ZXMocmVzdWx0cykpO1xuICAgICAgZGF0YS5wdXNoKHtcbiAgICAgICAgJ0BpZCc6ICdURVNUJyxcbiAgICAgICAgJ0B0eXBlJzogJ1RFU1QnLFxuICAgICAgICBzY2VuZWdyYXBoOiBnbHRmVXJsLFxuICAgICAgICBzY2VuZWdyYXBoTm9kZTogJ1ZIRl9LaWRuZXlfUl9Mb3cnLFxuICAgICAgICB0cmFuc2Zvcm1NYXRyaXg6IGdsdGZUcmFuc2Zvcm0sXG4gICAgICAgIGNvbG9yOiBbMjU1LCAyNTUsIDI1NSwgMjAwXSxcbiAgICAgICAgLy8gZXNsaW50LWRpc2FibGUtbmV4dC1saW5lIEB0eXBlc2NyaXB0LWVzbGludC9uYW1pbmctY29udmVudGlvblxuICAgICAgICBfbGlnaHRpbmc6ICdwYnInLFxuICAgICAgICB6b29tQmFzZWRPcGFjaXR5OiBmYWxzZVxuICAgICAgfSk7XG4gICAgICB0aGlzLmJvZHlVSUxheWVyLnNldFN0YXRlKHsgZGF0YSwgem9vbU9wYWNpdHkgfSk7XG4gICAgfSk7XG4gIH1cblxuICB6b29tVG8obm9kZTogU3BhdGlhbFNjZW5lTm9kZSk6IHZvaWQge1xuICAgIGNvbnN0IG1hdHJpeCA9IG5ldyBNYXRyaXg0KG5vZGUudHJhbnNmb3JtTWF0cml4KTtcbiAgICB0aGlzLmRlY2suc2V0UHJvcHMoe1xuICAgICAgdmlld1N0YXRlOiB7XG4gICAgICAgIC4uLnRoaXMuZGVjay5wcm9wcy52aWV3U3RhdGUsXG4gICAgICAgIHRhcmdldDogbWF0cml4LmdldFRyYW5zbGF0aW9uKCksXG4gICAgICAgIHJvdGF0aW9uWDogMCxcbiAgICAgICAgcm90YXRpb25PcmJpdDogMCxcbiAgICAgICAgem9vbTogMTEuNSxcbiAgICAgIH0gYXMgQm9keVVJVmlld1N0YXRlUHJvcHNcbiAgICB9KTtcbiAgfVxuXG4gIHNldFJvdGF0aW9uKHZhbHVlOiBudW1iZXIpOiB2b2lkIHtcbiAgICB0aGlzLmRlY2suc2V0UHJvcHMoe1xuICAgICAgdmlld1N0YXRlOiB7XG4gICAgICAgIC4uLnRoaXMuZGVjay5wcm9wcy52aWV3U3RhdGUsXG4gICAgICAgIHJvdGF0aW9uT3JiaXQ6IHZhbHVlXG4gICAgICB9IGFzIEJvZHlVSVZpZXdTdGF0ZVByb3BzXG4gICAgfSk7XG4gIH1cblxuICBzZXRSb3RhdGlvblgodmFsdWU6IG51bWJlcik6IHZvaWQge1xuICAgIHRoaXMuZGVjay5zZXRQcm9wcyh7XG4gICAgICB2aWV3U3RhdGU6IHtcbiAgICAgICAgLi4udGhpcy5kZWNrLnByb3BzLnZpZXdTdGF0ZSxcbiAgICAgICAgcm90YXRpb25YOiB2YWx1ZVxuICAgICAgfSBhcyBCb2R5VUlWaWV3U3RhdGVQcm9wc1xuICAgIH0pO1xuICB9XG5cbiAgc2V0Wm9vbSh2YWx1ZTogbnVtYmVyKTogdm9pZCB7XG4gICAgdGhpcy5kZWNrLnNldFByb3BzKHtcbiAgICAgIHZpZXdTdGF0ZToge1xuICAgICAgICAuLi50aGlzLmRlY2sucHJvcHMudmlld1N0YXRlLFxuICAgICAgICB6b29tOiB2YWx1ZVxuICAgICAgfSBhcyBCb2R5VUlWaWV3U3RhdGVQcm9wc1xuICAgIH0pO1xuICB9XG5cbiAgc2V0VGFyZ2V0KHZhbHVlOiBudW1iZXJbXSk6IHZvaWQge1xuICAgIHRoaXMuZGVjay5zZXRQcm9wcyh7XG4gICAgICB2aWV3U3RhdGU6IHtcbiAgICAgICAgLi4udGhpcy5kZWNrLnByb3BzLnZpZXdTdGF0ZSxcbiAgICAgICAgdGFyZ2V0OiB2YWx1ZVxuICAgICAgfSBhcyBCb2R5VUlWaWV3U3RhdGVQcm9wc1xuICAgIH0pO1xuICB9XG5cbiAgc2V0SW50ZXJhY3RpdmUodmFsdWU6IGJvb2xlYW4pOiB2b2lkIHtcbiAgICB0aGlzLmRlY2suc2V0UHJvcHMoe1xuICAgICAgY29udHJvbGxlcjogdmFsdWVcbiAgICB9KTtcbiAgfVxuXG4gIEBiaW5kXG4gIHByaXZhdGUgX29uSG92ZXIoZTogeyBwaWNrZWQ6IGJvb2xlYW47IG9iamVjdDogU3BhdGlhbFNjZW5lTm9kZSB9KTogdm9pZCB7XG4gICAgY29uc3QgeyBsYXN0SG92ZXJlZCB9ID0gdGhpcztcbiAgICB0aGlzLmN1cnNvciA9IGUucGlja2VkID8gJ3BvaW50ZXInIDogdW5kZWZpbmVkO1xuICAgIGlmIChlLnBpY2tlZCAmJiBlLm9iamVjdCAmJiBlLm9iamVjdFsnQGlkJ10pIHtcbiAgICAgIGlmIChsYXN0SG92ZXJlZCAhPT0gZS5vYmplY3QpIHtcbiAgICAgICAgaWYgKGxhc3RIb3ZlcmVkKSB7XG4gICAgICAgICAgdGhpcy5ub2RlSG92ZXJTdG9wU3ViamVjdC5uZXh0KGxhc3RIb3ZlcmVkKTtcbiAgICAgICAgfVxuICAgICAgICB0aGlzLmxhc3RIb3ZlcmVkID0gZS5vYmplY3Q7XG4gICAgICAgIHRoaXMubm9kZUhvdmVyU3RhcnRTdWJqZWN0Lm5leHQoZS5vYmplY3QpO1xuICAgICAgfVxuICAgIH0gZWxzZSBpZiAobGFzdEhvdmVyZWQpIHtcbiAgICAgIHRoaXMubm9kZUhvdmVyU3RvcFN1YmplY3QubmV4dChsYXN0SG92ZXJlZCk7XG4gICAgICB0aGlzLmxhc3RIb3ZlcmVkID0gdW5kZWZpbmVkO1xuICAgIH1cbiAgfVxuXG4gIEBiaW5kXG4gIHByaXZhdGUgX29uQ2xpY2soaW5mbzogUGlja0luZm88U3BhdGlhbFNjZW5lTm9kZT4sIGU6IHsgc3JjRXZlbnQ6IHsgY3RybEtleTogYm9vbGVhbiB9IH0pOiB2b2lkIHtcbiAgICBpZiAoaW5mby5waWNrZWQgJiYgaW5mby5vYmplY3QgJiYgaW5mby5vYmplY3RbJ0BpZCddKSB7XG4gICAgICB0aGlzLm5vZGVDbGlja1N1YmplY3QubmV4dCh7IG5vZGU6IGluZm8ub2JqZWN0LCBjdHJsQ2xpY2s6IGU/LnNyY0V2ZW50Py5jdHJsS2V5ID8/IHVuZGVmaW5lZCB9KTtcbiAgICB9XG4gIH1cblxuICBAYmluZFxuICBwcml2YXRlIF9vblZpZXdTdGF0ZUNoYW5nZShldmVudDogeyBpbnRlcmFjdGlvblN0YXRlOiB7IGlzWm9vbWluZzogYm9vbGVhbiB9OyB2aWV3U3RhdGU6IEJvZHlVSVZpZXdTdGF0ZVByb3BzIH0pOiB2b2lkIHtcbiAgICBpZiAoZXZlbnQuaW50ZXJhY3Rpb25TdGF0ZT8uaXNab29taW5nKSB7XG4gICAgICBjb25zdCBjdXJyZW50U3RhdGUgPSB0aGlzLmJvZHlVSUxheWVyLnN0YXRlIGFzIHsgem9vbU9wYWNpdHk6IG51bWJlcjsgZGF0YTogdW5rbm93biB9O1xuICAgICAgY29uc3Qgem9vbU9wYWNpdHkgPSBNYXRoLm1pbihNYXRoLm1heCgxIC0gKGV2ZW50LnZpZXdTdGF0ZS56b29tIC0gOC45KSAvIDIsIDAuMDUpLCAxLjApO1xuICAgICAgaWYgKGN1cnJlbnRTdGF0ZS56b29tT3BhY2l0eSAhPT0gem9vbU9wYWNpdHkpIHtcbiAgICAgICAgdGhpcy5ib2R5VUlMYXllci5zZXRTdGF0ZSh7IGRhdGE6IGN1cnJlbnRTdGF0ZS5kYXRhLCB6b29tT3BhY2l0eSB9KTtcbiAgICAgIH1cbiAgICB9XG4gICAgdGhpcy5kZWNrLnNldFByb3BzKHsgdmlld1N0YXRlOiB7IC4uLmV2ZW50LnZpZXdTdGF0ZSB9IH0pO1xuICAgIHRoaXMuc2NlbmVSb3RhdGlvblN1YmplY3QubmV4dChbZXZlbnQudmlld1N0YXRlLnJvdGF0aW9uT3JiaXQsIGV2ZW50LnZpZXdTdGF0ZS5yb3RhdGlvblhdKTtcbiAgfVxuXG4gIEBiaW5kXG4gIHByaXZhdGUgX29uRHJhZ1N0YXJ0KGluZm86IFBpY2tJbmZvPFNwYXRpYWxTY2VuZU5vZGU+LCBlOiBNb3VzZUV2ZW50KTogdm9pZCB7XG4gICAgdGhpcy5fZHJhZ0V2ZW50KGluZm8sIGUsIHRoaXMubm9kZURyYWdTdGFydFN1YmplY3QpO1xuICB9XG5cbiAgQGJpbmRcbiAgcHJpdmF0ZSBfb25EcmFnKGluZm86IFBpY2tJbmZvPFNwYXRpYWxTY2VuZU5vZGU+LCBlOiBNb3VzZUV2ZW50KTogdm9pZCB7XG4gICAgdGhpcy5fZHJhZ0V2ZW50KGluZm8sIGUsIHRoaXMubm9kZURyYWdTdWJqZWN0KTtcbiAgfVxuXG4gIEBiaW5kXG4gIHByaXZhdGUgX29uRHJhZ0VuZChpbmZvOiBQaWNrSW5mbzxTcGF0aWFsU2NlbmVOb2RlPiwgZTogTW91c2VFdmVudCk6IHZvaWQge1xuICAgIHRoaXMuX2RyYWdFdmVudChpbmZvLCBlLCB0aGlzLm5vZGVEcmFnRW5kU3ViamVjdCk7XG4gIH1cblxuICBwcml2YXRlIF9kcmFnRXZlbnQoaW5mbzogUGlja0luZm88U3BhdGlhbFNjZW5lTm9kZT4sIGU6IE1vdXNlRXZlbnQsIHN1YmplY3Q6IFN1YmplY3Q8Tm9kZURyYWdFdmVudD4pOiB2b2lkIHtcbiAgICBpZiAoaW5mbz8ub2JqZWN0Py5bJ0BpZCddKSB7XG4gICAgICBzdWJqZWN0Lm5leHQoeyBub2RlOiBpbmZvLm9iamVjdCwgaW5mbywgZSB9KTtcbiAgICB9XG4gIH1cbn1cbiJdfQ== \ No newline at end of file diff --git a/ccf-body-ui/esm2015/lib/shared/ccf-spatial-jsonld.js b/ccf-body-ui/esm2015/lib/shared/ccf-spatial-jsonld.js deleted file mode 100644 index b8e10d93e..000000000 --- a/ccf-body-ui/esm2015/lib/shared/ccf-spatial-jsonld.js +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2NmLXNwYXRpYWwtanNvbmxkLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvY2NmLWJvZHktdWkvc3JjL2xpYi9zaGFyZWQvY2NmLXNwYXRpYWwtanNvbmxkLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiIiLCJzb3VyY2VzQ29udGVudCI6WyIvKiBlc2xpbnQtZGlzYWJsZSBAdHlwZXNjcmlwdC1lc2xpbnQvbmFtaW5nLWNvbnZlbnRpb24gKi9cbmltcG9ydCB7IEpzb25MZE9iaiB9IGZyb20gJ2pzb25sZC9qc29ubGQtc3BlYyc7XG5cblxuZXhwb3J0IGludGVyZmFjZSBTcGF0aWFsUGxhY2VtZW50SnNvbkxkIGV4dGVuZHMgSnNvbkxkT2JqIHtcbiAgJ0Bjb250ZXh0Jz86IHN0cmluZztcbiAgJ0BpZCc6IHN0cmluZztcbiAgJ0B0eXBlJzogc3RyaW5nO1xuICBzb3VyY2U/OiBzdHJpbmc7XG4gIHRhcmdldDogc3RyaW5nO1xuICBwbGFjZW1lbnRfZGF0ZTogc3RyaW5nO1xuICB4X3NjYWxpbmc6IG51bWJlcjtcbiAgeV9zY2FsaW5nOiBudW1iZXI7XG4gIHpfc2NhbGluZzogbnVtYmVyO1xuICBzY2FsaW5nX3VuaXRzOiBzdHJpbmc7XG4gIHhfcm90YXRpb246IG51bWJlcjtcbiAgeV9yb3RhdGlvbjogbnVtYmVyO1xuICB6X3JvdGF0aW9uOiBudW1iZXI7XG4gIHJvdGF0aW9uX3VuaXRzOiBzdHJpbmc7XG4gIHhfdHJhbnNsYXRpb246IG51bWJlcjtcbiAgeV90cmFuc2xhdGlvbjogbnVtYmVyO1xuICB6X3RyYW5zbGF0aW9uOiBudW1iZXI7XG4gIHRyYW5zbGF0aW9uX3VuaXRzOiBzdHJpbmc7XG59XG5cbmV4cG9ydCBpbnRlcmZhY2UgU3BhdGlhbE9iamVjdFJlZmVyZW5jZUpzb25MZCBleHRlbmRzIEpzb25MZE9iaiB7XG4gICdAaWQnOiBzdHJpbmc7XG4gICdAdHlwZSc6IHN0cmluZztcbiAgZmlsZTogc3RyaW5nO1xuICBmaWxlX2Zvcm1hdDogc3RyaW5nO1xuICBwbGFjZW1lbnQ6IFNwYXRpYWxQbGFjZW1lbnRKc29uTGQ7XG59XG5cbmV4cG9ydCBpbnRlcmZhY2UgU3BhdGlhbEVudGl0eUpzb25MZCBleHRlbmRzIEpzb25MZE9iaiB7XG4gICdAY29udGV4dCc6IHN0cmluZztcbiAgJ0BpZCc6IHN0cmluZztcbiAgJ0B0eXBlJzogc3RyaW5nIHwgc3RyaW5nW107XG4gIGxhYmVsOiBzdHJpbmc7XG4gIGNvbW1lbnQ6IHN0cmluZztcbiAgY3JlYXRvcjogc3RyaW5nO1xuICBjcmVhdG9yX2ZpcnN0X25hbWU6IHN0cmluZztcbiAgY3JlYXRvcl9sYXN0X25hbWU6IHN0cmluZztcbiAgY3JlYXRpb25fZGF0ZTogc3RyaW5nO1xuICB1cGRhdGVkX2RhdGU6IHN0cmluZztcbiAgY2NmX2Fubm90YXRpb25zOiBzdHJpbmdbXTtcbiAgcmVwcmVzZW50YXRpb25fb2Y6IHN0cmluZztcbiAgcmVmZXJlbmNlX29yZ2FuOiBzdHJpbmc7XG4gIGV4dHJhY3Rpb25fc2V0OiBzdHJpbmc7XG4gIHNleDogJ01hbGUnIHwgJ0ZlbWFsZScgfCB1bmRlZmluZWQ7XG4gIHNpZGU6ICdMZWZ0JyB8ICdSaWdodCcgfCB1bmRlZmluZWQ7XG4gIHJ1aV9yYW5rOiBudW1iZXI7XG4gIHNsaWNlX3RoaWNrbmVzczogbnVtYmVyO1xuICBzbGljZV9jb3VudDogbnVtYmVyO1xuICB4X2RpbWVuc2lvbjogbnVtYmVyO1xuICB5X2RpbWVuc2lvbjogbnVtYmVyO1xuICB6X2RpbWVuc2lvbjogbnVtYmVyO1xuICBkaW1lbnNpb25fdW5pdHM6IHN0cmluZztcbiAgb2JqZWN0OiBTcGF0aWFsT2JqZWN0UmVmZXJlbmNlSnNvbkxkO1xuICBwbGFjZW1lbnQ6IFNwYXRpYWxQbGFjZW1lbnRKc29uTGQgfCBTcGF0aWFsUGxhY2VtZW50SnNvbkxkW107XG59XG4iXX0= \ No newline at end of file diff --git a/ccf-body-ui/esm2015/lib/shared/spatial-scene-node.js b/ccf-body-ui/esm2015/lib/shared/spatial-scene-node.js deleted file mode 100644 index e7be557b9..000000000 --- a/ccf-body-ui/esm2015/lib/shared/spatial-scene-node.js +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3BhdGlhbC1zY2VuZS1ub2RlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvY2NmLWJvZHktdWkvc3JjL2xpYi9zaGFyZWQvc3BhdGlhbC1zY2VuZS1ub2RlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiIiLCJzb3VyY2VzQ29udGVudCI6WyIvKiBlc2xpbnQtZGlzYWJsZSBAdHlwZXNjcmlwdC1lc2xpbnQvbmFtaW5nLWNvbnZlbnRpb24gKi9cbmltcG9ydCB7IE1hdHJpeDQgfSBmcm9tICdAbWF0aC5nbC9jb3JlJztcblxuZXhwb3J0IHR5cGUgU3BhdGlhbFNjZW5lR2VvbWV0cnkgPSAnc3BoZXJlJyB8ICdjdWJlJyB8ICd3aXJlZnJhbWUnIHwgJ3RleHQnIHwgJ2NvbmUnIHwgJ2N5bGluZGVyJztcblxuZXhwb3J0IGludGVyZmFjZSBTcGF0aWFsU2NlbmVOb2RlIHtcbiAgJ0BpZCc6IHN0cmluZztcbiAgJ0B0eXBlJzogc3RyaW5nO1xuICBlbnRpdHlJZD86IHN0cmluZztcbiAgcmVwcmVzZW50YXRpb25fb2Y/OiBzdHJpbmc7XG4gIHJlZmVyZW5jZV9vcmdhbj86IHN0cmluZztcbiAgdW5waWNrYWJsZT86IGJvb2xlYW47XG4gIGdlb21ldHJ5PzogU3BhdGlhbFNjZW5lR2VvbWV0cnk7XG4gIHRleHQ/OiBzdHJpbmc7XG4gIF9saWdodGluZz86IHN0cmluZztcbiAgc2NlbmVncmFwaD86IHN0cmluZztcbiAgc2NlbmVncmFwaE5vZGU/OiBzdHJpbmc7XG4gIHpvb21CYXNlZE9wYWNpdHk/OiBib29sZWFuO1xuICB6b29tVG9PbkxvYWQ/OiBib29sZWFuO1xuICBjb2xvcj86IFtudW1iZXIsIG51bWJlciwgbnVtYmVyLCBudW1iZXJdO1xuICBvcGFjaXR5PzogbnVtYmVyO1xuICB0cmFuc2Zvcm1NYXRyaXg6IE1hdHJpeDQ7XG4gIG5hbWU/OiBzdHJpbmc7XG4gIHRvb2x0aXA/OiBzdHJpbmc7XG4gIHByaW9yaXR5PzogbnVtYmVyO1xufVxuIl19 \ No newline at end of file diff --git a/ccf-body-ui/esm2015/lib/util/load-gltf.js b/ccf-body-ui/esm2015/lib/util/load-gltf.js deleted file mode 100644 index daea68233..000000000 --- a/ccf-body-ui/esm2015/lib/util/load-gltf.js +++ /dev/null @@ -1,71 +0,0 @@ -import { __awaiter } from "tslib"; -/* eslint-disable @typescript-eslint/no-unsafe-call */ -/* eslint-disable @typescript-eslint/no-unsafe-member-access */ -import { parse, registerLoaders } from '@loaders.gl/core'; -import { DracoLoader, DracoWorkerLoader } from '@loaders.gl/draco'; -import { GLTFLoader } from '@loaders.gl/gltf'; -import { Matrix4 } from '@math.gl/core'; -import { traverseScene } from './scene-traversal'; -export function registerGLTFLoaders() { - registerLoaders([DracoWorkerLoader, GLTFLoader]); -} -// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types -export function deriveScenegraph(scenegraphNodeName, gltf) { - var _a; - const scenegraphNode = (_a = gltf.nodes) === null || _a === void 0 ? void 0 : _a.find((n) => n.name === scenegraphNodeName); - if (scenegraphNode) { - let foundNodeInScene = false; - for (const scene of gltf.scenes) { - if (!foundNodeInScene) { - traverseScene(scene, new Matrix4(Matrix4.IDENTITY), (child, modelMatrix) => { - if (child === scenegraphNode) { - child.matrix = modelMatrix; - child.translation = undefined; - child.rotation = undefined; - child.scale = undefined; - foundNodeInScene = true; - return false; - } - return true; - }); - } - } - gltf.scene = { - id: scenegraphNodeName, - name: scenegraphNodeName, - nodes: [scenegraphNode] - }; - gltf.scenes = [gltf.scene]; - return { scene: gltf.scene, scenes: gltf.scenes }; - } - else { - return gltf; - } -} -// eslint-disable-next-line @typescript-eslint/no-explicit-any -export function loadGLTF(model, cache) { - return __awaiter(this, void 0, void 0, function* () { - const gltfUrl = model.scenegraph; - let gltfPromise; - if (cache) { - gltfPromise = cache[gltfUrl] || (cache[gltfUrl] = fetch(gltfUrl).then(r => r.blob())); - } - else { - gltfPromise = fetch(gltfUrl); - } - // eslint-disable-next-line @typescript-eslint/naming-convention - const gltf = yield parse(gltfPromise, GLTFLoader, { DracoLoader, gltf: { decompressMeshes: true, postProcess: true } }); - if (!gltf.nodes) { - console.log('WARNING: Empty Scene', gltfUrl, gltf); - } - return deriveScenegraph(model.scenegraphNode, gltf); - }); -} -// eslint-disable-next-line @typescript-eslint/no-explicit-any -export function loadGLTF2(scenegraphNodeName, gltfPromise) { - return __awaiter(this, void 0, void 0, function* () { - return deriveScenegraph(scenegraphNodeName, yield gltfPromise); - }); -} -/* eslint-enable */ -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibG9hZC1nbHRmLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvY2NmLWJvZHktdWkvc3JjL2xpYi91dGlsL2xvYWQtZ2x0Zi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsc0RBQXNEO0FBQ3RELCtEQUErRDtBQUMvRCxPQUFPLEVBQUUsS0FBSyxFQUFFLGVBQWUsRUFBRSxNQUFNLGtCQUFrQixDQUFDO0FBQzFELE9BQU8sRUFBRSxXQUFXLEVBQUUsaUJBQWlCLEVBQUUsTUFBTSxtQkFBbUIsQ0FBQztBQUNuRSxPQUFPLEVBQUUsVUFBVSxFQUFFLE1BQU0sa0JBQWtCLENBQUM7QUFDOUMsT0FBTyxFQUFFLE9BQU8sRUFBRSxNQUFNLGVBQWUsQ0FBQztBQUd4QyxPQUFPLEVBQUUsYUFBYSxFQUFFLE1BQU0sbUJBQW1CLENBQUM7QUFHbEQsTUFBTSxVQUFVLG1CQUFtQjtJQUNqQyxlQUFlLENBQUMsQ0FBQyxpQkFBaUIsRUFBRSxVQUFVLENBQUMsQ0FBQyxDQUFDO0FBQ25ELENBQUM7QUFFRCxpSEFBaUg7QUFDakgsTUFBTSxVQUFVLGdCQUFnQixDQUFDLGtCQUEwQixFQUFFLElBQVM7O0lBQ3BFLE1BQU0sY0FBYyxHQUFHLE1BQUEsSUFBSSxDQUFDLEtBQUssMENBQUUsSUFBSSxDQUFDLENBQUMsQ0FBQyxFQUFFLEVBQUUsQ0FBQyxDQUFDLENBQUMsSUFBSSxLQUFLLGtCQUFrQixDQUFDLENBQUM7SUFDOUUsSUFBSSxjQUFjLEVBQUU7UUFDbEIsSUFBSSxnQkFBZ0IsR0FBRyxLQUFLLENBQUM7UUFDN0IsS0FBSyxNQUFNLEtBQUssSUFBSSxJQUFJLENBQUMsTUFBTSxFQUFFO1lBQy9CLElBQUksQ0FBQyxnQkFBZ0IsRUFBRTtnQkFDckIsYUFBYSxDQUFDLEtBQUssRUFBRSxJQUFJLE9BQU8sQ0FBQyxPQUFPLENBQUMsUUFBUSxDQUFDLEVBQUUsQ0FBQyxLQUFLLEVBQUUsV0FBVyxFQUFFLEVBQUU7b0JBQ3pFLElBQUksS0FBSyxLQUFLLGNBQWMsRUFBRTt3QkFDNUIsS0FBSyxDQUFDLE1BQU0sR0FBRyxXQUFXLENBQUM7d0JBQzNCLEtBQUssQ0FBQyxXQUFXLEdBQUcsU0FBUyxDQUFDO3dCQUM5QixLQUFLLENBQUMsUUFBUSxHQUFHLFNBQVMsQ0FBQzt3QkFDM0IsS0FBSyxDQUFDLEtBQUssR0FBRyxTQUFTLENBQUM7d0JBQ3hCLGdCQUFnQixHQUFHLElBQUksQ0FBQzt3QkFDeEIsT0FBTyxLQUFLLENBQUM7cUJBQ2Q7b0JBQ0QsT0FBTyxJQUFJLENBQUM7Z0JBQ2QsQ0FBQyxDQUFDLENBQUM7YUFDSjtTQUNGO1FBQ0QsSUFBSSxDQUFDLEtBQUssR0FBRztZQUNYLEVBQUUsRUFBRSxrQkFBa0I7WUFDdEIsSUFBSSxFQUFFLGtCQUFrQjtZQUN4QixLQUFLLEVBQUUsQ0FBQyxjQUFjLENBQUM7U0FDeEIsQ0FBQztRQUNGLElBQUksQ0FBQyxNQUFNLEdBQUcsQ0FBQyxJQUFJLENBQUMsS0FBSyxDQUFDLENBQUM7UUFFM0IsT0FBTyxFQUFFLEtBQUssRUFBRSxJQUFJLENBQUMsS0FBSyxFQUFFLE1BQU0sRUFBRSxJQUFJLENBQUMsTUFBTSxFQUFFLENBQUM7S0FDbkQ7U0FBTTtRQUNMLE9BQU8sSUFBSSxDQUFDO0tBQ2I7QUFDSCxDQUFDO0FBRUQsOERBQThEO0FBQzlELE1BQU0sVUFBZ0IsUUFBUSxDQUFDLEtBQXVCLEVBQUUsS0FBd0M7O1FBQzlGLE1BQU0sT0FBTyxHQUFHLEtBQUssQ0FBQyxVQUFvQixDQUFDO1FBQzNDLElBQUksV0FBcUMsQ0FBQztRQUMxQyxJQUFJLEtBQUssRUFBRTtZQUNULFdBQVcsR0FBRyxLQUFLLENBQUMsT0FBTyxDQUFDLElBQUksQ0FBQyxLQUFLLENBQUMsT0FBTyxDQUFDLEdBQUcsS0FBSyxDQUFDLE9BQU8sQ0FBQyxDQUFDLElBQUksQ0FBQyxDQUFDLENBQUMsRUFBRSxDQUFDLENBQUMsQ0FBQyxJQUFJLEVBQUUsQ0FBQyxDQUFDLENBQUM7U0FDdkY7YUFBTTtZQUNMLFdBQVcsR0FBRyxLQUFLLENBQUMsT0FBTyxDQUFDLENBQUM7U0FDOUI7UUFDRCxnRUFBZ0U7UUFDaEUsTUFBTSxJQUFJLEdBQUcsTUFBTSxLQUFLLENBQUMsV0FBVyxFQUFFLFVBQVUsRUFBRSxFQUFFLFdBQVcsRUFBRSxJQUFJLEVBQUUsRUFBRSxnQkFBZ0IsRUFBRSxJQUFJLEVBQUUsV0FBVyxFQUFFLElBQUksRUFBRSxFQUFFLENBQUMsQ0FBQztRQUV4SCxJQUFJLENBQUMsSUFBSSxDQUFDLEtBQUssRUFBRTtZQUNmLE9BQU8sQ0FBQyxHQUFHLENBQUMsc0JBQXNCLEVBQUUsT0FBTyxFQUFFLElBQUksQ0FBQyxDQUFDO1NBQ3BEO1FBRUQsT0FBTyxnQkFBZ0IsQ0FBQyxLQUFLLENBQUMsY0FBd0IsRUFBRSxJQUFJLENBQUMsQ0FBQztJQUNoRSxDQUFDO0NBQUE7QUFFRCw4REFBOEQ7QUFDOUQsTUFBTSxVQUFnQixTQUFTLENBQUMsa0JBQTBCLEVBQUUsV0FBeUI7O1FBQ25GLE9BQU8sZ0JBQWdCLENBQUMsa0JBQWtCLEVBQUUsTUFBTSxXQUFXLENBQUMsQ0FBQztJQUNqRSxDQUFDO0NBQUE7QUFDRCxtQkFBbUIiLCJzb3VyY2VzQ29udGVudCI6WyIvKiBlc2xpbnQtZGlzYWJsZSBAdHlwZXNjcmlwdC1lc2xpbnQvbm8tdW5zYWZlLWNhbGwgKi9cbi8qIGVzbGludC1kaXNhYmxlIEB0eXBlc2NyaXB0LWVzbGludC9uby11bnNhZmUtbWVtYmVyLWFjY2VzcyAqL1xuaW1wb3J0IHsgcGFyc2UsIHJlZ2lzdGVyTG9hZGVycyB9IGZyb20gJ0Bsb2FkZXJzLmdsL2NvcmUnO1xuaW1wb3J0IHsgRHJhY29Mb2FkZXIsIERyYWNvV29ya2VyTG9hZGVyIH0gZnJvbSAnQGxvYWRlcnMuZ2wvZHJhY28nO1xuaW1wb3J0IHsgR0xURkxvYWRlciB9IGZyb20gJ0Bsb2FkZXJzLmdsL2dsdGYnO1xuaW1wb3J0IHsgTWF0cml4NCB9IGZyb20gJ0BtYXRoLmdsL2NvcmUnO1xuXG5pbXBvcnQgeyBTcGF0aWFsU2NlbmVOb2RlIH0gZnJvbSAnLi4vc2hhcmVkL3NwYXRpYWwtc2NlbmUtbm9kZSc7XG5pbXBvcnQgeyB0cmF2ZXJzZVNjZW5lIH0gZnJvbSAnLi9zY2VuZS10cmF2ZXJzYWwnO1xuXG5cbmV4cG9ydCBmdW5jdGlvbiByZWdpc3RlckdMVEZMb2FkZXJzKCk6IHZvaWQge1xuICByZWdpc3RlckxvYWRlcnMoW0RyYWNvV29ya2VyTG9hZGVyLCBHTFRGTG9hZGVyXSk7XG59XG5cbi8vIGVzbGludC1kaXNhYmxlLW5leHQtbGluZSBAdHlwZXNjcmlwdC1lc2xpbnQvbm8tZXhwbGljaXQtYW55LCBAdHlwZXNjcmlwdC1lc2xpbnQvZXhwbGljaXQtbW9kdWxlLWJvdW5kYXJ5LXR5cGVzXG5leHBvcnQgZnVuY3Rpb24gZGVyaXZlU2NlbmVncmFwaChzY2VuZWdyYXBoTm9kZU5hbWU6IHN0cmluZywgZ2x0ZjogYW55KTogYW55IHtcbiAgY29uc3Qgc2NlbmVncmFwaE5vZGUgPSBnbHRmLm5vZGVzPy5maW5kKChuKSA9PiBuLm5hbWUgPT09IHNjZW5lZ3JhcGhOb2RlTmFtZSk7XG4gIGlmIChzY2VuZWdyYXBoTm9kZSkge1xuICAgIGxldCBmb3VuZE5vZGVJblNjZW5lID0gZmFsc2U7XG4gICAgZm9yIChjb25zdCBzY2VuZSBvZiBnbHRmLnNjZW5lcykge1xuICAgICAgaWYgKCFmb3VuZE5vZGVJblNjZW5lKSB7XG4gICAgICAgIHRyYXZlcnNlU2NlbmUoc2NlbmUsIG5ldyBNYXRyaXg0KE1hdHJpeDQuSURFTlRJVFkpLCAoY2hpbGQsIG1vZGVsTWF0cml4KSA9PiB7XG4gICAgICAgICAgaWYgKGNoaWxkID09PSBzY2VuZWdyYXBoTm9kZSkge1xuICAgICAgICAgICAgY2hpbGQubWF0cml4ID0gbW9kZWxNYXRyaXg7XG4gICAgICAgICAgICBjaGlsZC50cmFuc2xhdGlvbiA9IHVuZGVmaW5lZDtcbiAgICAgICAgICAgIGNoaWxkLnJvdGF0aW9uID0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgY2hpbGQuc2NhbGUgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgICBmb3VuZE5vZGVJblNjZW5lID0gdHJ1ZTtcbiAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgICB9XG4gICAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICAgIH0pO1xuICAgICAgfVxuICAgIH1cbiAgICBnbHRmLnNjZW5lID0ge1xuICAgICAgaWQ6IHNjZW5lZ3JhcGhOb2RlTmFtZSxcbiAgICAgIG5hbWU6IHNjZW5lZ3JhcGhOb2RlTmFtZSxcbiAgICAgIG5vZGVzOiBbc2NlbmVncmFwaE5vZGVdXG4gICAgfTtcbiAgICBnbHRmLnNjZW5lcyA9IFtnbHRmLnNjZW5lXTtcblxuICAgIHJldHVybiB7IHNjZW5lOiBnbHRmLnNjZW5lLCBzY2VuZXM6IGdsdGYuc2NlbmVzIH07XG4gIH0gZWxzZSB7XG4gICAgcmV0dXJuIGdsdGY7XG4gIH1cbn1cblxuLy8gZXNsaW50LWRpc2FibGUtbmV4dC1saW5lIEB0eXBlc2NyaXB0LWVzbGludC9uby1leHBsaWNpdC1hbnlcbmV4cG9ydCBhc3luYyBmdW5jdGlvbiBsb2FkR0xURihtb2RlbDogU3BhdGlhbFNjZW5lTm9kZSwgY2FjaGU/OiB7IFt1cmw6IHN0cmluZ106IFByb21pc2U8QmxvYj4gfSk6IFByb21pc2U8YW55PiB7XG4gIGNvbnN0IGdsdGZVcmwgPSBtb2RlbC5zY2VuZWdyYXBoIGFzIHN0cmluZztcbiAgbGV0IGdsdGZQcm9taXNlOiBQcm9taXNlPEJsb2IgfCBSZXNwb25zZT47XG4gIGlmIChjYWNoZSkge1xuICAgIGdsdGZQcm9taXNlID0gY2FjaGVbZ2x0ZlVybF0gfHwgKGNhY2hlW2dsdGZVcmxdID0gZmV0Y2goZ2x0ZlVybCkudGhlbihyID0+IHIuYmxvYigpKSk7XG4gIH0gZWxzZSB7XG4gICAgZ2x0ZlByb21pc2UgPSBmZXRjaChnbHRmVXJsKTtcbiAgfVxuICAvLyBlc2xpbnQtZGlzYWJsZS1uZXh0LWxpbmUgQHR5cGVzY3JpcHQtZXNsaW50L25hbWluZy1jb252ZW50aW9uXG4gIGNvbnN0IGdsdGYgPSBhd2FpdCBwYXJzZShnbHRmUHJvbWlzZSwgR0xURkxvYWRlciwgeyBEcmFjb0xvYWRlciwgZ2x0ZjogeyBkZWNvbXByZXNzTWVzaGVzOiB0cnVlLCBwb3N0UHJvY2VzczogdHJ1ZSB9IH0pO1xuXG4gIGlmICghZ2x0Zi5ub2Rlcykge1xuICAgIGNvbnNvbGUubG9nKCdXQVJOSU5HOiBFbXB0eSBTY2VuZScsIGdsdGZVcmwsIGdsdGYpO1xuICB9XG5cbiAgcmV0dXJuIGRlcml2ZVNjZW5lZ3JhcGgobW9kZWwuc2NlbmVncmFwaE5vZGUgYXMgc3RyaW5nLCBnbHRmKTtcbn1cblxuLy8gZXNsaW50LWRpc2FibGUtbmV4dC1saW5lIEB0eXBlc2NyaXB0LWVzbGludC9uby1leHBsaWNpdC1hbnlcbmV4cG9ydCBhc3luYyBmdW5jdGlvbiBsb2FkR0xURjIoc2NlbmVncmFwaE5vZGVOYW1lOiBzdHJpbmcsIGdsdGZQcm9taXNlOiBQcm9taXNlPGFueT4pOiBQcm9taXNlPGFueT4ge1xuICByZXR1cm4gZGVyaXZlU2NlbmVncmFwaChzY2VuZWdyYXBoTm9kZU5hbWUsIGF3YWl0IGdsdGZQcm9taXNlKTtcbn1cbi8qIGVzbGludC1lbmFibGUgKi9cbiJdfQ== \ No newline at end of file diff --git a/ccf-body-ui/esm2015/lib/util/process-scene-nodes.js b/ccf-body-ui/esm2015/lib/util/process-scene-nodes.js deleted file mode 100644 index 1cca1aa6a..000000000 --- a/ccf-body-ui/esm2015/lib/util/process-scene-nodes.js +++ /dev/null @@ -1,88 +0,0 @@ -import { __awaiter } from "tslib"; -import { Matrix4 } from '@math.gl/core'; -import { AABB, Vec3 } from 'cannon-es'; -import { loadGLTF, registerGLTFLoaders } from './load-gltf'; -import { traverseScene } from './scene-traversal'; -/* eslint-disable */ -function childNames(scene, names = []) { - for (const child of (scene.nodes || scene.children || [])) { - names.push(child.name); - childNames(child, names); - } - return names; -} -export function processSceneNodes(gltfUrl, worldMatrix, scenegraphNode) { - return __awaiter(this, void 0, void 0, function* () { - registerGLTFLoaders(); - const gltf = yield loadGLTF({ scenegraph: gltfUrl, scenegraphNode }); - const nodes = {}; - const gltfNodes = []; - for (const scene of gltf.scenes) { - worldMatrix = new Matrix4(worldMatrix || Matrix4.IDENTITY); - traverseScene(scene, worldMatrix, (node, modelMatrix) => { - const processedNode = { - '@id': (node.name || node.id), - '@type': 'ProcessedNode', - transformMatrix: new Matrix4(modelMatrix), - geometry: 'wireframe', - node - }; - gltfNodes.push({ - '@id': `GLTF:${processedNode['@id']}`, - '@type': 'GLTFNode', - scenegraph: gltfUrl, - scenegraphNode: processedNode['@id'], - transformMatrix: new Matrix4(worldMatrix || Matrix4.IDENTITY), - tooltip: (node.name || node.id), - color: [255, 255, 255, 255], - _lighting: 'pbr', - zoomBasedOpacity: true, - node - }); - if (node.mesh && node.mesh.primitives && node.mesh.primitives.length > 0) { - for (const primitive of node.mesh.primitives) { - if (primitive.attributes.POSITION && primitive.attributes.POSITION.min) { - const lowerBound = modelMatrix.transformAsPoint(primitive.attributes.POSITION.min, []); - const upperBound = modelMatrix.transformAsPoint(primitive.attributes.POSITION.max, []); - processedNode.bbox = new AABB({ - lowerBound: new Vec3(...lowerBound.map((n, i) => Math.min(n, upperBound[i]))), - upperBound: new Vec3(...upperBound.map((n, i) => Math.max(n, lowerBound[i]))) - }); - } - } - } - nodes[processedNode['@id']] = processedNode; - return true; - }); - } - for (const node of Object.values(nodes).filter(n => !n.bbox)) { - for (const child of childNames(node.node).map(n => nodes[n]).filter(n => n.bbox)) { - if (!node.bbox) { - node.bbox = child.bbox.clone(); - } - else { - node.bbox.extend(child.bbox); - } - } - if (!node.bbox) { - delete nodes[node['@id']]; - } - } - for (const node of Object.values(nodes)) { - const lb = node.bbox.lowerBound; - const ub = node.bbox.upperBound; - const size = node.size = ub.clone().vsub(lb); - const halfSize = size.clone().vmul(new Vec3(0.5, 0.5, 0.5)); - const center = node.center = lb.clone().vadd(halfSize); - node.transformMatrix = new Matrix4(Matrix4.IDENTITY) - .translate(center.toArray()) - .scale(halfSize.toArray()); - } - for (const node of gltfNodes) { - nodes[node['@id']] = node; - } - return nodes; - }); -} -/* eslint-enable */ -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJvY2Vzcy1zY2VuZS1ub2Rlcy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL2NjZi1ib2R5LXVpL3NyYy9saWIvdXRpbC9wcm9jZXNzLXNjZW5lLW5vZGVzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSxPQUFPLEVBQUUsT0FBTyxFQUFFLE1BQU0sZUFBZSxDQUFDO0FBQ3hDLE9BQU8sRUFBRSxJQUFJLEVBQUUsSUFBSSxFQUFFLE1BQU0sV0FBVyxDQUFDO0FBRXZDLE9BQU8sRUFBRSxRQUFRLEVBQUUsbUJBQW1CLEVBQUUsTUFBTSxhQUFhLENBQUM7QUFDNUQsT0FBTyxFQUFFLGFBQWEsRUFBRSxNQUFNLG1CQUFtQixDQUFDO0FBWWxELHFCQUFxQjtBQUNyQixTQUFTLFVBQVUsQ0FBQyxLQUFLLEVBQUUsUUFBa0IsRUFBRTtJQUM3QyxLQUFLLE1BQU0sS0FBSyxJQUFJLENBQUMsS0FBSyxDQUFDLEtBQUssSUFBSSxLQUFLLENBQUMsUUFBUSxJQUFJLEVBQUUsQ0FBQyxFQUFFO1FBQ3pELEtBQUssQ0FBQyxJQUFJLENBQUMsS0FBSyxDQUFDLElBQUksQ0FBQyxDQUFDO1FBQ3ZCLFVBQVUsQ0FBQyxLQUFLLEVBQUUsS0FBSyxDQUFDLENBQUM7S0FDMUI7SUFDRCxPQUFPLEtBQUssQ0FBQztBQUNmLENBQUM7QUFFRCxNQUFNLFVBQWdCLGlCQUFpQixDQUFDLE9BQWUsRUFBRSxXQUFxQixFQUFFLGNBQXVCOztRQUVyRyxtQkFBbUIsRUFBRSxDQUFDO1FBQ3RCLE1BQU0sSUFBSSxHQUFHLE1BQU0sUUFBUSxDQUFDLEVBQUMsVUFBVSxFQUFFLE9BQU8sRUFBRSxjQUFjLEVBQXFCLENBQUMsQ0FBQztRQUN2RixNQUFNLEtBQUssR0FBb0MsRUFBRSxDQUFDO1FBQ2xELE1BQU0sU0FBUyxHQUFvQixFQUFFLENBQUM7UUFDdEMsS0FBSyxNQUFNLEtBQUssSUFBSSxJQUFJLENBQUMsTUFBTSxFQUFFO1lBQy9CLFdBQVcsR0FBRyxJQUFJLE9BQU8sQ0FBQyxXQUFXLElBQUksT0FBTyxDQUFDLFFBQVEsQ0FBQyxDQUFDO1lBQzNELGFBQWEsQ0FBQyxLQUFLLEVBQUUsV0FBVyxFQUFFLENBQUMsSUFBSSxFQUFFLFdBQW9CLEVBQUUsRUFBRTtnQkFDL0QsTUFBTSxhQUFhLEdBQWtCO29CQUNuQyxLQUFLLEVBQUUsQ0FBQyxJQUFJLENBQUMsSUFBSSxJQUFJLElBQUksQ0FBQyxFQUFFLENBQVc7b0JBQ3ZDLE9BQU8sRUFBRSxlQUFlO29CQUN4QixlQUFlLEVBQUUsSUFBSSxPQUFPLENBQUMsV0FBVyxDQUFDO29CQUN6QyxRQUFRLEVBQUUsV0FBVztvQkFDckIsSUFBSTtpQkFDWSxDQUFDO2dCQUNuQixTQUFTLENBQUMsSUFBSSxDQUFDO29CQUNiLEtBQUssRUFBRSxRQUFRLGFBQWEsQ0FBQyxLQUFLLENBQUMsRUFBRTtvQkFDckMsT0FBTyxFQUFFLFVBQVU7b0JBQ25CLFVBQVUsRUFBRSxPQUFPO29CQUNuQixjQUFjLEVBQUUsYUFBYSxDQUFDLEtBQUssQ0FBQztvQkFDcEMsZUFBZSxFQUFFLElBQUksT0FBTyxDQUFDLFdBQVcsSUFBSSxPQUFPLENBQUMsUUFBUSxDQUFDO29CQUM3RCxPQUFPLEVBQUUsQ0FBQyxJQUFJLENBQUMsSUFBSSxJQUFJLElBQUksQ0FBQyxFQUFFLENBQVc7b0JBQ3pDLEtBQUssRUFBRSxDQUFDLEdBQUcsRUFBRSxHQUFHLEVBQUUsR0FBRyxFQUFFLEdBQUcsQ0FBQztvQkFDM0IsU0FBUyxFQUFFLEtBQUs7b0JBQ2hCLGdCQUFnQixFQUFFLElBQUk7b0JBQ3RCLElBQUk7aUJBQ1ksQ0FBQyxDQUFDO2dCQUNwQixJQUFJLElBQUksQ0FBQyxJQUFJLElBQUksSUFBSSxDQUFDLElBQUksQ0FBQyxVQUFVLElBQUksSUFBSSxDQUFDLElBQUksQ0FBQyxVQUFVLENBQUMsTUFBTSxHQUFHLENBQUMsRUFBRTtvQkFDeEUsS0FBSyxNQUFNLFNBQVMsSUFBSSxJQUFJLENBQUMsSUFBSSxDQUFDLFVBQVUsRUFBRTt3QkFDNUMsSUFBSSxTQUFTLENBQUMsVUFBVSxDQUFDLFFBQVEsSUFBSSxTQUFTLENBQUMsVUFBVSxDQUFDLFFBQVEsQ0FBQyxHQUFHLEVBQUU7NEJBQ3RFLE1BQU0sVUFBVSxHQUFHLFdBQVcsQ0FBQyxnQkFBZ0IsQ0FBQyxTQUFTLENBQUMsVUFBVSxDQUFDLFFBQVEsQ0FBQyxHQUFHLEVBQUUsRUFBRSxDQUFDLENBQUM7NEJBQ3ZGLE1BQU0sVUFBVSxHQUFHLFdBQVcsQ0FBQyxnQkFBZ0IsQ0FBQyxTQUFTLENBQUMsVUFBVSxDQUFDLFFBQVEsQ0FBQyxHQUFHLEVBQUUsRUFBRSxDQUFDLENBQUM7NEJBQ3ZGLGFBQWEsQ0FBQyxJQUFJLEdBQUcsSUFBSSxJQUFJLENBQUM7Z0NBQzVCLFVBQVUsRUFBRSxJQUFJLElBQUksQ0FBQyxHQUFHLFVBQVUsQ0FBQyxHQUFHLENBQUMsQ0FBQyxDQUFDLEVBQUUsQ0FBQyxFQUFFLEVBQUUsQ0FBQyxJQUFJLENBQUMsR0FBRyxDQUFDLENBQUMsRUFBRSxVQUFVLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDO2dDQUM3RSxVQUFVLEVBQUUsSUFBSSxJQUFJLENBQUMsR0FBRyxVQUFVLENBQUMsR0FBRyxDQUFDLENBQUMsQ0FBQyxFQUFFLENBQUMsRUFBRSxFQUFFLENBQUMsSUFBSSxDQUFDLEdBQUcsQ0FBQyxDQUFDLEVBQUUsVUFBVSxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQzs2QkFDOUUsQ0FBQyxDQUFDO3lCQUNKO3FCQUNGO2lCQUNGO2dCQUNELEtBQUssQ0FBQyxhQUFhLENBQUMsS0FBSyxDQUFDLENBQUMsR0FBRyxhQUFhLENBQUM7Z0JBQzVDLE9BQU8sSUFBSSxDQUFDO1lBQ2QsQ0FBQyxDQUFDLENBQUM7U0FDSjtRQUVELEtBQUssTUFBTSxJQUFJLElBQUksTUFBTSxDQUFDLE1BQU0sQ0FBQyxLQUFLLENBQUMsQ0FBQyxNQUFNLENBQUMsQ0FBQyxDQUFDLEVBQUUsQ0FBQyxDQUFDLENBQUMsQ0FBQyxJQUFJLENBQUMsRUFBRTtZQUM1RCxLQUFLLE1BQU0sS0FBSyxJQUFJLFVBQVUsQ0FBQyxJQUFJLENBQUMsSUFBSSxDQUFDLENBQUMsR0FBRyxDQUFDLENBQUMsQ0FBQyxFQUFFLENBQUMsS0FBSyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsTUFBTSxDQUFDLENBQUMsQ0FBQyxFQUFFLENBQUMsQ0FBQyxDQUFDLElBQUksQ0FBQyxFQUFFO2dCQUNoRixJQUFJLENBQUMsSUFBSSxDQUFDLElBQUksRUFBRTtvQkFDZCxJQUFJLENBQUMsSUFBSSxHQUFHLEtBQUssQ0FBQyxJQUFJLENBQUMsS0FBSyxFQUFFLENBQUM7aUJBQ2hDO3FCQUFNO29CQUNMLElBQUksQ0FBQyxJQUFJLENBQUMsTUFBTSxDQUFDLEtBQUssQ0FBQyxJQUFJLENBQUMsQ0FBQztpQkFDOUI7YUFDRjtZQUNELElBQUksQ0FBQyxJQUFJLENBQUMsSUFBSSxFQUFFO2dCQUNkLE9BQU8sS0FBSyxDQUFDLElBQUksQ0FBQyxLQUFLLENBQUMsQ0FBQyxDQUFDO2FBQzNCO1NBQ0Y7UUFDRCxLQUFLLE1BQU0sSUFBSSxJQUFJLE1BQU0sQ0FBQyxNQUFNLENBQUMsS0FBSyxDQUFDLEVBQUU7WUFDdkMsTUFBTSxFQUFFLEdBQUcsSUFBSSxDQUFDLElBQUksQ0FBQyxVQUFVLENBQUM7WUFDaEMsTUFBTSxFQUFFLEdBQUcsSUFBSSxDQUFDLElBQUksQ0FBQyxVQUFVLENBQUM7WUFDaEMsTUFBTSxJQUFJLEdBQUcsSUFBSSxDQUFDLElBQUksR0FBRyxFQUFFLENBQUMsS0FBSyxFQUFFLENBQUMsSUFBSSxDQUFDLEVBQUUsQ0FBQyxDQUFDO1lBQzdDLE1BQU0sUUFBUSxHQUFHLElBQUksQ0FBQyxLQUFLLEVBQUUsQ0FBQyxJQUFJLENBQUMsSUFBSSxJQUFJLENBQUMsR0FBRyxFQUFFLEdBQUcsRUFBRSxHQUFHLENBQUMsQ0FBQyxDQUFDO1lBQzVELE1BQU0sTUFBTSxHQUFHLElBQUksQ0FBQyxNQUFNLEdBQUcsRUFBRSxDQUFDLEtBQUssRUFBRSxDQUFDLElBQUksQ0FBQyxRQUFRLENBQUMsQ0FBQztZQUV2RCxJQUFJLENBQUMsZUFBZSxHQUFHLElBQUksT0FBTyxDQUFDLE9BQU8sQ0FBQyxRQUFRLENBQUM7aUJBQ2pELFNBQVMsQ0FBQyxNQUFNLENBQUMsT0FBTyxFQUFFLENBQUM7aUJBQzNCLEtBQUssQ0FBQyxRQUFRLENBQUMsT0FBTyxFQUFFLENBQUMsQ0FBQztTQUM5QjtRQUNELEtBQUssTUFBTSxJQUFJLElBQUksU0FBUyxFQUFFO1lBQzVCLEtBQUssQ0FBQyxJQUFJLENBQUMsS0FBSyxDQUFDLENBQUMsR0FBRyxJQUFJLENBQUM7U0FDM0I7UUFDRCxPQUFPLEtBQUssQ0FBQztJQUNmLENBQUM7Q0FBQTtBQUNELG1CQUFtQiIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IE1hdHJpeDQgfSBmcm9tICdAbWF0aC5nbC9jb3JlJztcbmltcG9ydCB7IEFBQkIsIFZlYzMgfSBmcm9tICdjYW5ub24tZXMnO1xuXG5pbXBvcnQgeyBsb2FkR0xURiwgcmVnaXN0ZXJHTFRGTG9hZGVycyB9IGZyb20gJy4vbG9hZC1nbHRmJztcbmltcG9ydCB7IHRyYXZlcnNlU2NlbmUgfSBmcm9tICcuL3NjZW5lLXRyYXZlcnNhbCc7XG5pbXBvcnQgeyBTcGF0aWFsU2NlbmVOb2RlIH0gZnJvbSAnLi4vc2hhcmVkL3NwYXRpYWwtc2NlbmUtbm9kZSc7XG5cblxuZXhwb3J0IGludGVyZmFjZSBQcm9jZXNzZWROb2RlIGV4dGVuZHMgU3BhdGlhbFNjZW5lTm9kZSB7XG4gIGJib3g6IEFBQkI7XG4gIGpzb25sZDogdW5rbm93bjtcbiAgbm9kZTogdW5rbm93bjtcbiAgc2l6ZTogVmVjMztcbiAgY2VudGVyOiBWZWMzO1xufVxuXG4vKiBlc2xpbnQtZGlzYWJsZSAgKi9cbmZ1bmN0aW9uIGNoaWxkTmFtZXMoc2NlbmUsIG5hbWVzOiBzdHJpbmdbXSA9IFtdKTogc3RyaW5nW10ge1xuICBmb3IgKGNvbnN0IGNoaWxkIG9mIChzY2VuZS5ub2RlcyB8fCBzY2VuZS5jaGlsZHJlbiB8fCBbXSkpIHtcbiAgICBuYW1lcy5wdXNoKGNoaWxkLm5hbWUpO1xuICAgIGNoaWxkTmFtZXMoY2hpbGQsIG5hbWVzKTtcbiAgfVxuICByZXR1cm4gbmFtZXM7XG59XG5cbmV4cG9ydCBhc3luYyBmdW5jdGlvbiBwcm9jZXNzU2NlbmVOb2RlcyhnbHRmVXJsOiBzdHJpbmcsIHdvcmxkTWF0cml4PzogTWF0cml4NCwgc2NlbmVncmFwaE5vZGU/OiBzdHJpbmdcbiAgICApOiBQcm9taXNlPHsgW25vZGU6IHN0cmluZ106IFByb2Nlc3NlZE5vZGV9PiB7XG4gIHJlZ2lzdGVyR0xURkxvYWRlcnMoKTtcbiAgY29uc3QgZ2x0ZiA9IGF3YWl0IGxvYWRHTFRGKHtzY2VuZWdyYXBoOiBnbHRmVXJsLCBzY2VuZWdyYXBoTm9kZX0gYXMgU3BhdGlhbFNjZW5lTm9kZSk7XG4gIGNvbnN0IG5vZGVzOiB7W25vZGU6IHN0cmluZ106IFByb2Nlc3NlZE5vZGV9ID0ge307XG4gIGNvbnN0IGdsdGZOb2RlczogUHJvY2Vzc2VkTm9kZVtdID0gW107XG4gIGZvciAoY29uc3Qgc2NlbmUgb2YgZ2x0Zi5zY2VuZXMpIHtcbiAgICB3b3JsZE1hdHJpeCA9IG5ldyBNYXRyaXg0KHdvcmxkTWF0cml4IHx8IE1hdHJpeDQuSURFTlRJVFkpO1xuICAgIHRyYXZlcnNlU2NlbmUoc2NlbmUsIHdvcmxkTWF0cml4LCAobm9kZSwgbW9kZWxNYXRyaXg6IE1hdHJpeDQpID0+IHtcbiAgICAgIGNvbnN0IHByb2Nlc3NlZE5vZGU6IFByb2Nlc3NlZE5vZGUgPSB7XG4gICAgICAgICdAaWQnOiAobm9kZS5uYW1lIHx8IG5vZGUuaWQpIGFzIHN0cmluZyxcbiAgICAgICAgJ0B0eXBlJzogJ1Byb2Nlc3NlZE5vZGUnLFxuICAgICAgICB0cmFuc2Zvcm1NYXRyaXg6IG5ldyBNYXRyaXg0KG1vZGVsTWF0cml4KSxcbiAgICAgICAgZ2VvbWV0cnk6ICd3aXJlZnJhbWUnLFxuICAgICAgICBub2RlXG4gICAgICB9IGFzIFByb2Nlc3NlZE5vZGU7XG4gICAgICBnbHRmTm9kZXMucHVzaCh7XG4gICAgICAgICdAaWQnOiBgR0xURjoke3Byb2Nlc3NlZE5vZGVbJ0BpZCddfWAsXG4gICAgICAgICdAdHlwZSc6ICdHTFRGTm9kZScsXG4gICAgICAgIHNjZW5lZ3JhcGg6IGdsdGZVcmwsXG4gICAgICAgIHNjZW5lZ3JhcGhOb2RlOiBwcm9jZXNzZWROb2RlWydAaWQnXSxcbiAgICAgICAgdHJhbnNmb3JtTWF0cml4OiBuZXcgTWF0cml4NCh3b3JsZE1hdHJpeCB8fCBNYXRyaXg0LklERU5USVRZKSxcbiAgICAgICAgdG9vbHRpcDogKG5vZGUubmFtZSB8fCBub2RlLmlkKSBhcyBzdHJpbmcsXG4gICAgICAgIGNvbG9yOiBbMjU1LCAyNTUsIDI1NSwgMjU1XSxcbiAgICAgICAgX2xpZ2h0aW5nOiAncGJyJyxcbiAgICAgICAgem9vbUJhc2VkT3BhY2l0eTogdHJ1ZSxcbiAgICAgICAgbm9kZVxuICAgICAgfSBhcyBQcm9jZXNzZWROb2RlKTtcbiAgICAgIGlmIChub2RlLm1lc2ggJiYgbm9kZS5tZXNoLnByaW1pdGl2ZXMgJiYgbm9kZS5tZXNoLnByaW1pdGl2ZXMubGVuZ3RoID4gMCkge1xuICAgICAgICBmb3IgKGNvbnN0IHByaW1pdGl2ZSBvZiBub2RlLm1lc2gucHJpbWl0aXZlcykge1xuICAgICAgICAgIGlmIChwcmltaXRpdmUuYXR0cmlidXRlcy5QT1NJVElPTiAmJiBwcmltaXRpdmUuYXR0cmlidXRlcy5QT1NJVElPTi5taW4pIHtcbiAgICAgICAgICAgIGNvbnN0IGxvd2VyQm91bmQgPSBtb2RlbE1hdHJpeC50cmFuc2Zvcm1Bc1BvaW50KHByaW1pdGl2ZS5hdHRyaWJ1dGVzLlBPU0lUSU9OLm1pbiwgW10pO1xuICAgICAgICAgICAgY29uc3QgdXBwZXJCb3VuZCA9IG1vZGVsTWF0cml4LnRyYW5zZm9ybUFzUG9pbnQocHJpbWl0aXZlLmF0dHJpYnV0ZXMuUE9TSVRJT04ubWF4LCBbXSk7XG4gICAgICAgICAgICBwcm9jZXNzZWROb2RlLmJib3ggPSBuZXcgQUFCQih7XG4gICAgICAgICAgICAgIGxvd2VyQm91bmQ6IG5ldyBWZWMzKC4uLmxvd2VyQm91bmQubWFwKChuLCBpKSA9PiBNYXRoLm1pbihuLCB1cHBlckJvdW5kW2ldKSkpLFxuICAgICAgICAgICAgICB1cHBlckJvdW5kOiBuZXcgVmVjMyguLi51cHBlckJvdW5kLm1hcCgobiwgaSkgPT4gTWF0aC5tYXgobiwgbG93ZXJCb3VuZFtpXSkpKVxuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9XG4gICAgICBub2Rlc1twcm9jZXNzZWROb2RlWydAaWQnXV0gPSBwcm9jZXNzZWROb2RlO1xuICAgICAgcmV0dXJuIHRydWU7XG4gICAgfSk7XG4gIH1cblxuICBmb3IgKGNvbnN0IG5vZGUgb2YgT2JqZWN0LnZhbHVlcyhub2RlcykuZmlsdGVyKG4gPT4gIW4uYmJveCkpIHtcbiAgICBmb3IgKGNvbnN0IGNoaWxkIG9mIGNoaWxkTmFtZXMobm9kZS5ub2RlKS5tYXAobiA9PiBub2Rlc1tuXSkuZmlsdGVyKG4gPT4gbi5iYm94KSkge1xuICAgICAgaWYgKCFub2RlLmJib3gpIHtcbiAgICAgICAgbm9kZS5iYm94ID0gY2hpbGQuYmJveC5jbG9uZSgpO1xuICAgICAgfSBlbHNlIHtcbiAgICAgICAgbm9kZS5iYm94LmV4dGVuZChjaGlsZC5iYm94KTtcbiAgICAgIH1cbiAgICB9XG4gICAgaWYgKCFub2RlLmJib3gpIHtcbiAgICAgIGRlbGV0ZSBub2Rlc1tub2RlWydAaWQnXV07XG4gICAgfVxuICB9XG4gIGZvciAoY29uc3Qgbm9kZSBvZiBPYmplY3QudmFsdWVzKG5vZGVzKSkge1xuICAgIGNvbnN0IGxiID0gbm9kZS5iYm94Lmxvd2VyQm91bmQ7XG4gICAgY29uc3QgdWIgPSBub2RlLmJib3gudXBwZXJCb3VuZDtcbiAgICBjb25zdCBzaXplID0gbm9kZS5zaXplID0gdWIuY2xvbmUoKS52c3ViKGxiKTtcbiAgICBjb25zdCBoYWxmU2l6ZSA9IHNpemUuY2xvbmUoKS52bXVsKG5ldyBWZWMzKDAuNSwgMC41LCAwLjUpKTtcbiAgICBjb25zdCBjZW50ZXIgPSBub2RlLmNlbnRlciA9IGxiLmNsb25lKCkudmFkZChoYWxmU2l6ZSk7XG5cbiAgICBub2RlLnRyYW5zZm9ybU1hdHJpeCA9IG5ldyBNYXRyaXg0KE1hdHJpeDQuSURFTlRJVFkpXG4gICAgICAudHJhbnNsYXRlKGNlbnRlci50b0FycmF5KCkpXG4gICAgICAuc2NhbGUoaGFsZlNpemUudG9BcnJheSgpKTtcbiAgfVxuICBmb3IgKGNvbnN0IG5vZGUgb2YgZ2x0Zk5vZGVzKSB7XG4gICAgbm9kZXNbbm9kZVsnQGlkJ11dID0gbm9kZTtcbiAgfVxuICByZXR1cm4gbm9kZXM7XG59XG4vKiBlc2xpbnQtZW5hYmxlICovXG4iXX0= \ No newline at end of file diff --git a/ccf-body-ui/esm2015/lib/util/scene-traversal.js b/ccf-body-ui/esm2015/lib/util/scene-traversal.js deleted file mode 100644 index 2648a747d..000000000 --- a/ccf-body-ui/esm2015/lib/util/scene-traversal.js +++ /dev/null @@ -1,39 +0,0 @@ -/* eslint-disable @typescript-eslint/no-unsafe-member-access */ -import { Matrix4 } from '@math.gl/core'; -// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types -export function traverseScene(scene, worldMatrix, visitor) { - if (!worldMatrix) { - worldMatrix = new Matrix4(Matrix4.IDENTITY); - } - const matrix = new Matrix4(Matrix4.IDENTITY); - if (!scene) { - return true; - } - else if (scene.matrix) { - matrix.copy(scene.matrix); - } - else { - matrix.identity(); - if (scene.translation) { - matrix.translate(scene.translation); - } - if (scene.rotation) { - const rotationMatrix = new Matrix4(Matrix4.IDENTITY).fromQuaternion(scene.rotation); - matrix.multiplyRight(rotationMatrix); - } - if (scene.scale) { - matrix.scale(scene.scale); - } - } - const modelMatrix = new Matrix4(worldMatrix).multiplyRight(matrix); - if (visitor(scene, modelMatrix, worldMatrix) === false) { - return false; - } - for (const child of (scene.nodes || scene.children || [])) { - if (traverseScene(child, modelMatrix, visitor) === false) { - return false; - } - } - return true; -} -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2NlbmUtdHJhdmVyc2FsLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvY2NmLWJvZHktdWkvc3JjL2xpYi91dGlsL3NjZW5lLXRyYXZlcnNhbC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSwrREFBK0Q7QUFDL0QsT0FBTyxFQUFFLE9BQU8sRUFBRSxNQUFNLGVBQWUsQ0FBQztBQUt4Qyw2RUFBNkU7QUFDN0UsTUFBTSxVQUFVLGFBQWEsQ0FBQyxLQUFLLEVBQUUsV0FBb0IsRUFBRSxPQUE4QjtJQUN2RixJQUFJLENBQUMsV0FBVyxFQUFFO1FBQ2hCLFdBQVcsR0FBRyxJQUFJLE9BQU8sQ0FBQyxPQUFPLENBQUMsUUFBUSxDQUFDLENBQUM7S0FDN0M7SUFDRCxNQUFNLE1BQU0sR0FBRyxJQUFJLE9BQU8sQ0FBQyxPQUFPLENBQUMsUUFBUSxDQUFDLENBQUM7SUFDN0MsSUFBSSxDQUFDLEtBQUssRUFBRTtRQUNWLE9BQU8sSUFBSSxDQUFDO0tBQ2I7U0FBTSxJQUFJLEtBQUssQ0FBQyxNQUFNLEVBQUU7UUFDdkIsTUFBTSxDQUFDLElBQUksQ0FBQyxLQUFLLENBQUMsTUFBTSxDQUFDLENBQUM7S0FDM0I7U0FBTTtRQUNMLE1BQU0sQ0FBQyxRQUFRLEVBQUUsQ0FBQztRQUVsQixJQUFJLEtBQUssQ0FBQyxXQUFXLEVBQUU7WUFDckIsTUFBTSxDQUFDLFNBQVMsQ0FBQyxLQUFLLENBQUMsV0FBVyxDQUFDLENBQUM7U0FDckM7UUFFRCxJQUFJLEtBQUssQ0FBQyxRQUFRLEVBQUU7WUFDbEIsTUFBTSxjQUFjLEdBQUcsSUFBSSxPQUFPLENBQUMsT0FBTyxDQUFDLFFBQVEsQ0FBQyxDQUFDLGNBQWMsQ0FBQyxLQUFLLENBQUMsUUFBUSxDQUFDLENBQUM7WUFDcEYsTUFBTSxDQUFDLGFBQWEsQ0FBQyxjQUFjLENBQUMsQ0FBQztTQUN0QztRQUVELElBQUksS0FBSyxDQUFDLEtBQUssRUFBRTtZQUNmLE1BQU0sQ0FBQyxLQUFLLENBQUMsS0FBSyxDQUFDLEtBQUssQ0FBQyxDQUFDO1NBQzNCO0tBQ0Y7SUFDRCxNQUFNLFdBQVcsR0FBRyxJQUFJLE9BQU8sQ0FBQyxXQUFXLENBQUMsQ0FBQyxhQUFhLENBQUMsTUFBTSxDQUFDLENBQUM7SUFDbkUsSUFBSSxPQUFPLENBQUMsS0FBSyxFQUFFLFdBQVcsRUFBRSxXQUFXLENBQUMsS0FBSyxLQUFLLEVBQUU7UUFDdEQsT0FBTyxLQUFLLENBQUM7S0FDZDtJQUNELEtBQUssTUFBTSxLQUFLLElBQUksQ0FBQyxLQUFLLENBQUMsS0FBSyxJQUFJLEtBQUssQ0FBQyxRQUFRLElBQUksRUFBRSxDQUFDLEVBQUU7UUFDekQsSUFBSSxhQUFhLENBQUMsS0FBSyxFQUFFLFdBQVcsRUFBRSxPQUFPLENBQUMsS0FBSyxLQUFLLEVBQUU7WUFDeEQsT0FBTyxLQUFLLENBQUM7U0FDZDtLQUNGO0lBQ0QsT0FBTyxJQUFJLENBQUM7QUFDZCxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLyogZXNsaW50LWRpc2FibGUgQHR5cGVzY3JpcHQtZXNsaW50L25vLXVuc2FmZS1tZW1iZXItYWNjZXNzICovXG5pbXBvcnQgeyBNYXRyaXg0IH0gZnJvbSAnQG1hdGguZ2wvY29yZSc7XG5cblxuZXhwb3J0IHR5cGUgU2NlbmVUcmF2ZXJzYWxWaXNpdG9yID0gKGNoaWxkLCBtb2RlbE1hdHJpeDogTWF0cml4NCwgcGFyZW50TWF0cml4OiBNYXRyaXg0KSA9PiBib29sZWFuO1xuXG4vLyBlc2xpbnQtZGlzYWJsZS1uZXh0LWxpbmUgQHR5cGVzY3JpcHQtZXNsaW50L2V4cGxpY2l0LW1vZHVsZS1ib3VuZGFyeS10eXBlc1xuZXhwb3J0IGZ1bmN0aW9uIHRyYXZlcnNlU2NlbmUoc2NlbmUsIHdvcmxkTWF0cml4OiBNYXRyaXg0LCB2aXNpdG9yOiBTY2VuZVRyYXZlcnNhbFZpc2l0b3IpOiBib29sZWFuIHtcbiAgaWYgKCF3b3JsZE1hdHJpeCkge1xuICAgIHdvcmxkTWF0cml4ID0gbmV3IE1hdHJpeDQoTWF0cml4NC5JREVOVElUWSk7XG4gIH1cbiAgY29uc3QgbWF0cml4ID0gbmV3IE1hdHJpeDQoTWF0cml4NC5JREVOVElUWSk7XG4gIGlmICghc2NlbmUpIHtcbiAgICByZXR1cm4gdHJ1ZTtcbiAgfSBlbHNlIGlmIChzY2VuZS5tYXRyaXgpIHtcbiAgICBtYXRyaXguY29weShzY2VuZS5tYXRyaXgpO1xuICB9IGVsc2Uge1xuICAgIG1hdHJpeC5pZGVudGl0eSgpO1xuXG4gICAgaWYgKHNjZW5lLnRyYW5zbGF0aW9uKSB7XG4gICAgICBtYXRyaXgudHJhbnNsYXRlKHNjZW5lLnRyYW5zbGF0aW9uKTtcbiAgICB9XG5cbiAgICBpZiAoc2NlbmUucm90YXRpb24pIHtcbiAgICAgIGNvbnN0IHJvdGF0aW9uTWF0cml4ID0gbmV3IE1hdHJpeDQoTWF0cml4NC5JREVOVElUWSkuZnJvbVF1YXRlcm5pb24oc2NlbmUucm90YXRpb24pO1xuICAgICAgbWF0cml4Lm11bHRpcGx5UmlnaHQocm90YXRpb25NYXRyaXgpO1xuICAgIH1cblxuICAgIGlmIChzY2VuZS5zY2FsZSkge1xuICAgICAgbWF0cml4LnNjYWxlKHNjZW5lLnNjYWxlKTtcbiAgICB9XG4gIH1cbiAgY29uc3QgbW9kZWxNYXRyaXggPSBuZXcgTWF0cml4NCh3b3JsZE1hdHJpeCkubXVsdGlwbHlSaWdodChtYXRyaXgpO1xuICBpZiAodmlzaXRvcihzY2VuZSwgbW9kZWxNYXRyaXgsIHdvcmxkTWF0cml4KSA9PT0gZmFsc2UpIHtcbiAgICByZXR1cm4gZmFsc2U7XG4gIH1cbiAgZm9yIChjb25zdCBjaGlsZCBvZiAoc2NlbmUubm9kZXMgfHwgc2NlbmUuY2hpbGRyZW4gfHwgW10pKSB7XG4gICAgaWYgKHRyYXZlcnNlU2NlbmUoY2hpbGQsIG1vZGVsTWF0cml4LCB2aXNpdG9yKSA9PT0gZmFsc2UpIHtcbiAgICAgIHJldHVybiBmYWxzZTtcbiAgICB9XG4gIH1cbiAgcmV0dXJuIHRydWU7XG59XG4iXX0= \ No newline at end of file diff --git a/ccf-body-ui/esm2015/lib/util/simplify-scene.js b/ccf-body-ui/esm2015/lib/util/simplify-scene.js deleted file mode 100644 index af7360942..000000000 --- a/ccf-body-ui/esm2015/lib/util/simplify-scene.js +++ /dev/null @@ -1,73 +0,0 @@ -import { __awaiter } from "tslib"; -import { Matrix4 } from '@math.gl/core'; -import { AABB, Vec3 } from 'cannon-es'; -import { loadGLTF } from './load-gltf'; -import { traverseScene } from './scene-traversal'; -export function simplifyScene(nodes) { - return __awaiter(this, void 0, void 0, function* () { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - const gltfCache = {}; - const gltfUrls = new Set(nodes.map(n => n.scenegraph).filter(n => !!n)); - for (const gltfUrl of gltfUrls) { - // eslint-disable-next-line no-await-in-loop - gltfCache[gltfUrl] = yield loadGLTF({ scenegraph: gltfUrl }); - } - const newNodes = nodes.filter(n => !n.scenegraph); - for (const model of nodes.filter(n => n.scenegraph)) { - const gltf = gltfCache[model.scenegraph]; - const bbox = new AABB(); - let worldMatrix = new Matrix4(model.transformMatrix); - /* eslint-disable */ - if (model.scenegraphNode) { - const scenegraphNode = model.scenegraphNode ? gltf.nodes.find((n) => n.name === model.scenegraphNode) : undefined; - let foundNodeInScene = false; - for (const scene of gltf.scenes) { - if (!foundNodeInScene) { - traverseScene(scene, new Matrix4(model.transformMatrix), (child, modelMatrix) => { - if (child === scenegraphNode) { - worldMatrix = modelMatrix; - foundNodeInScene = true; - return false; - } - return true; - }); - } - } - gltf.scene = { - id: model.scenegraphNode, - name: model.scenegraphNode, - nodes: [scenegraphNode] - }; - } - traverseScene(gltf.scene, worldMatrix, (node, modelMatrix) => { - if (node.mesh && node.mesh.primitives && node.mesh.primitives.length > 0) { - for (const primitive of node.mesh.primitives) { - if (primitive.attributes.POSITION && primitive.attributes.POSITION.min) { - const lowerBound = modelMatrix.transformAsPoint(primitive.attributes.POSITION.min, []); - const upperBound = modelMatrix.transformAsPoint(primitive.attributes.POSITION.max, []); - const innerBbox = new AABB({ - lowerBound: new Vec3(...lowerBound.map((n, i) => Math.min(n, upperBound[i]))), - upperBound: new Vec3(...upperBound.map((n, i) => Math.max(n, lowerBound[i]))) - }); - bbox.extend(innerBbox); - } - } - } - return true; - }); - /* eslint-enable */ - const size = bbox.upperBound.clone().vsub(bbox.lowerBound); - const halfSize = size.clone().vmul(new Vec3(0.5, 0.5, 0.5)); - const position = bbox.lowerBound.clone().vadd(halfSize); - const transformMatrix = new Matrix4(Matrix4.IDENTITY) - .translate(position.toArray()) - .scale(halfSize.toArray()); - const newNode = Object.assign(Object.assign({}, model), { transformMatrix, geometry: 'wireframe' }); - delete newNode.scenegraph; - delete newNode.scenegraphNode; - newNodes.push(newNode); - } - return newNodes; - }); -} -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2ltcGxpZnktc2NlbmUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9jY2YtYm9keS11aS9zcmMvbGliL3V0aWwvc2ltcGxpZnktc2NlbmUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLE9BQU8sRUFBRSxPQUFPLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFDeEMsT0FBTyxFQUFFLElBQUksRUFBRSxJQUFJLEVBQUUsTUFBTSxXQUFXLENBQUM7QUFHdkMsT0FBTyxFQUFFLFFBQVEsRUFBRSxNQUFNLGFBQWEsQ0FBQztBQUN2QyxPQUFPLEVBQUUsYUFBYSxFQUFFLE1BQU0sbUJBQW1CLENBQUM7QUFHbEQsTUFBTSxVQUFnQixhQUFhLENBQUMsS0FBeUI7O1FBQzNELDhEQUE4RDtRQUM5RCxNQUFNLFNBQVMsR0FBMkIsRUFBRSxDQUFDO1FBQzdDLE1BQU0sUUFBUSxHQUFHLElBQUksR0FBRyxDQUFDLEtBQUssQ0FBQyxHQUFHLENBQUMsQ0FBQyxDQUFDLEVBQUUsQ0FBQyxDQUFDLENBQUMsVUFBVSxDQUFDLENBQUMsTUFBTSxDQUFDLENBQUMsQ0FBQyxFQUFFLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7UUFDeEUsS0FBSyxNQUFNLE9BQU8sSUFBSSxRQUFRLEVBQUU7WUFDOUIsNENBQTRDO1lBQzVDLFNBQVMsQ0FBQyxPQUFpQixDQUFDLEdBQUcsTUFBTSxRQUFRLENBQUMsRUFBRSxVQUFVLEVBQUUsT0FBTyxFQUFzQixDQUFDLENBQUM7U0FDNUY7UUFDRCxNQUFNLFFBQVEsR0FBdUIsS0FBSyxDQUFDLE1BQU0sQ0FBQyxDQUFDLENBQUMsRUFBRSxDQUFDLENBQUMsQ0FBQyxDQUFDLFVBQVUsQ0FBQyxDQUFDO1FBRXRFLEtBQUssTUFBTSxLQUFLLElBQUksS0FBSyxDQUFDLE1BQU0sQ0FBQyxDQUFDLENBQUMsRUFBRSxDQUFDLENBQUMsQ0FBQyxVQUFVLENBQUMsRUFBRTtZQUNuRCxNQUFNLElBQUksR0FBRyxTQUFTLENBQUMsS0FBSyxDQUFDLFVBQW9CLENBQUMsQ0FBQztZQUNuRCxNQUFNLElBQUksR0FBRyxJQUFJLElBQUksRUFBRSxDQUFDO1lBQ3hCLElBQUksV0FBVyxHQUFHLElBQUksT0FBTyxDQUFDLEtBQUssQ0FBQyxlQUFlLENBQUMsQ0FBQztZQUVyRCxxQkFBcUI7WUFDckIsSUFBSSxLQUFLLENBQUMsY0FBYyxFQUFFO2dCQUN4QixNQUFNLGNBQWMsR0FBRyxLQUFLLENBQUMsY0FBYyxDQUFDLENBQUMsQ0FBQyxJQUFJLENBQUMsS0FBSyxDQUFDLElBQUksQ0FBQyxDQUFDLENBQUMsRUFBRSxFQUFFLENBQUMsQ0FBQyxDQUFDLElBQUksS0FBSyxLQUFLLENBQUMsY0FBYyxDQUFDLENBQUMsQ0FBQyxDQUFDLFNBQVMsQ0FBQztnQkFDbEgsSUFBSSxnQkFBZ0IsR0FBRyxLQUFLLENBQUM7Z0JBQzdCLEtBQUssTUFBTSxLQUFLLElBQUksSUFBSSxDQUFDLE1BQU0sRUFBRTtvQkFDL0IsSUFBSSxDQUFDLGdCQUFnQixFQUFFO3dCQUNyQixhQUFhLENBQUMsS0FBSyxFQUFFLElBQUksT0FBTyxDQUFDLEtBQUssQ0FBQyxlQUFlLENBQUMsRUFBRSxDQUFDLEtBQUssRUFBRSxXQUFXLEVBQUUsRUFBRTs0QkFDOUUsSUFBSSxLQUFLLEtBQUssY0FBYyxFQUFFO2dDQUM1QixXQUFXLEdBQUcsV0FBVyxDQUFDO2dDQUMxQixnQkFBZ0IsR0FBRyxJQUFJLENBQUM7Z0NBQ3hCLE9BQU8sS0FBSyxDQUFDOzZCQUNkOzRCQUNELE9BQU8sSUFBSSxDQUFDO3dCQUNkLENBQUMsQ0FBQyxDQUFDO3FCQUNKO2lCQUNGO2dCQUNELElBQUksQ0FBQyxLQUFLLEdBQUc7b0JBQ1gsRUFBRSxFQUFFLEtBQUssQ0FBQyxjQUFjO29CQUN4QixJQUFJLEVBQUUsS0FBSyxDQUFDLGNBQWM7b0JBQzFCLEtBQUssRUFBRSxDQUFDLGNBQWMsQ0FBQztpQkFDeEIsQ0FBQzthQUNIO1lBRUQsYUFBYSxDQUFDLElBQUksQ0FBQyxLQUFLLEVBQUUsV0FBVyxFQUFFLENBQUMsSUFBSSxFQUFFLFdBQVcsRUFBRSxFQUFFO2dCQUMzRCxJQUFJLElBQUksQ0FBQyxJQUFJLElBQUksSUFBSSxDQUFDLElBQUksQ0FBQyxVQUFVLElBQUksSUFBSSxDQUFDLElBQUksQ0FBQyxVQUFVLENBQUMsTUFBTSxHQUFHLENBQUMsRUFBRTtvQkFDeEUsS0FBSyxNQUFNLFNBQVMsSUFBSSxJQUFJLENBQUMsSUFBSSxDQUFDLFVBQVUsRUFBRTt3QkFDNUMsSUFBSSxTQUFTLENBQUMsVUFBVSxDQUFDLFFBQVEsSUFBSSxTQUFTLENBQUMsVUFBVSxDQUFDLFFBQVEsQ0FBQyxHQUFHLEVBQUU7NEJBQ3RFLE1BQU0sVUFBVSxHQUFHLFdBQVcsQ0FBQyxnQkFBZ0IsQ0FBQyxTQUFTLENBQUMsVUFBVSxDQUFDLFFBQVEsQ0FBQyxHQUFHLEVBQUUsRUFBRSxDQUFDLENBQUM7NEJBQ3ZGLE1BQU0sVUFBVSxHQUFHLFdBQVcsQ0FBQyxnQkFBZ0IsQ0FBQyxTQUFTLENBQUMsVUFBVSxDQUFDLFFBQVEsQ0FBQyxHQUFHLEVBQUUsRUFBRSxDQUFDLENBQUM7NEJBQ3ZGLE1BQU0sU0FBUyxHQUFHLElBQUksSUFBSSxDQUFDO2dDQUN6QixVQUFVLEVBQUUsSUFBSSxJQUFJLENBQUMsR0FBRyxVQUFVLENBQUMsR0FBRyxDQUFDLENBQUMsQ0FBQyxFQUFFLENBQUMsRUFBRSxFQUFFLENBQUMsSUFBSSxDQUFDLEdBQUcsQ0FBQyxDQUFDLEVBQUUsVUFBVSxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztnQ0FDN0UsVUFBVSxFQUFFLElBQUksSUFBSSxDQUFDLEdBQUcsVUFBVSxDQUFDLEdBQUcsQ0FBQyxDQUFDLENBQUMsRUFBRSxDQUFDLEVBQUUsRUFBRSxDQUFDLElBQUksQ0FBQyxHQUFHLENBQUMsQ0FBQyxFQUFFLFVBQVUsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7NkJBQzlFLENBQUMsQ0FBQzs0QkFDSCxJQUFJLENBQUMsTUFBTSxDQUFDLFNBQVMsQ0FBQyxDQUFDO3lCQUN4QjtxQkFDRjtpQkFDRjtnQkFDRCxPQUFPLElBQUksQ0FBQztZQUNkLENBQUMsQ0FBQyxDQUFDO1lBQ0gsbUJBQW1CO1lBRW5CLE1BQU0sSUFBSSxHQUFHLElBQUksQ0FBQyxVQUFVLENBQUMsS0FBSyxFQUFFLENBQUMsSUFBSSxDQUFDLElBQUksQ0FBQyxVQUFVLENBQUMsQ0FBQztZQUMzRCxNQUFNLFFBQVEsR0FBRyxJQUFJLENBQUMsS0FBSyxFQUFFLENBQUMsSUFBSSxDQUFDLElBQUksSUFBSSxDQUFDLEdBQUcsRUFBRSxHQUFHLEVBQUUsR0FBRyxDQUFDLENBQUMsQ0FBQztZQUM1RCxNQUFNLFFBQVEsR0FBRyxJQUFJLENBQUMsVUFBVSxDQUFDLEtBQUssRUFBRSxDQUFDLElBQUksQ0FBQyxRQUFRLENBQUMsQ0FBQztZQUN4RCxNQUFNLGVBQWUsR0FBRyxJQUFJLE9BQU8sQ0FBQyxPQUFPLENBQUMsUUFBUSxDQUFDO2lCQUNsRCxTQUFTLENBQUMsUUFBUSxDQUFDLE9BQU8sRUFBRSxDQUFDO2lCQUM3QixLQUFLLENBQUMsUUFBUSxDQUFDLE9BQU8sRUFBRSxDQUFDLENBQUM7WUFDN0IsTUFBTSxPQUFPLG1DQUNSLEtBQUssS0FDUixlQUFlLEVBQ2YsUUFBUSxFQUFFLFdBQVcsR0FDdEIsQ0FBQztZQUNGLE9BQU8sT0FBTyxDQUFDLFVBQVUsQ0FBQztZQUMxQixPQUFPLE9BQU8sQ0FBQyxjQUFjLENBQUM7WUFFOUIsUUFBUSxDQUFDLElBQUksQ0FBQyxPQUFPLENBQUMsQ0FBQztTQUN4QjtRQUNELE9BQU8sUUFBUSxDQUFDO0lBQ2xCLENBQUM7Q0FBQSIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IE1hdHJpeDQgfSBmcm9tICdAbWF0aC5nbC9jb3JlJztcbmltcG9ydCB7IEFBQkIsIFZlYzMgfSBmcm9tICdjYW5ub24tZXMnO1xuXG5pbXBvcnQgeyBTcGF0aWFsU2NlbmVOb2RlIH0gZnJvbSAnLi4vc2hhcmVkL3NwYXRpYWwtc2NlbmUtbm9kZSc7XG5pbXBvcnQgeyBsb2FkR0xURiB9IGZyb20gJy4vbG9hZC1nbHRmJztcbmltcG9ydCB7IHRyYXZlcnNlU2NlbmUgfSBmcm9tICcuL3NjZW5lLXRyYXZlcnNhbCc7XG5cblxuZXhwb3J0IGFzeW5jIGZ1bmN0aW9uIHNpbXBsaWZ5U2NlbmUobm9kZXM6IFNwYXRpYWxTY2VuZU5vZGVbXSk6IFByb21pc2U8U3BhdGlhbFNjZW5lTm9kZVtdPiB7XG4gIC8vIGVzbGludC1kaXNhYmxlLW5leHQtbGluZSBAdHlwZXNjcmlwdC1lc2xpbnQvbm8tZXhwbGljaXQtYW55XG4gIGNvbnN0IGdsdGZDYWNoZTogeyBbdXJsOiBzdHJpbmddOiBhbnkgfSA9IHt9O1xuICBjb25zdCBnbHRmVXJscyA9IG5ldyBTZXQobm9kZXMubWFwKG4gPT4gbi5zY2VuZWdyYXBoKS5maWx0ZXIobiA9PiAhIW4pKTtcbiAgZm9yIChjb25zdCBnbHRmVXJsIG9mIGdsdGZVcmxzKSB7XG4gICAgLy8gZXNsaW50LWRpc2FibGUtbmV4dC1saW5lIG5vLWF3YWl0LWluLWxvb3BcbiAgICBnbHRmQ2FjaGVbZ2x0ZlVybCBhcyBzdHJpbmddID0gYXdhaXQgbG9hZEdMVEYoeyBzY2VuZWdyYXBoOiBnbHRmVXJsIH0gYXMgU3BhdGlhbFNjZW5lTm9kZSk7XG4gIH1cbiAgY29uc3QgbmV3Tm9kZXM6IFNwYXRpYWxTY2VuZU5vZGVbXSA9IG5vZGVzLmZpbHRlcihuID0+ICFuLnNjZW5lZ3JhcGgpO1xuXG4gIGZvciAoY29uc3QgbW9kZWwgb2Ygbm9kZXMuZmlsdGVyKG4gPT4gbi5zY2VuZWdyYXBoKSkge1xuICAgIGNvbnN0IGdsdGYgPSBnbHRmQ2FjaGVbbW9kZWwuc2NlbmVncmFwaCBhcyBzdHJpbmddO1xuICAgIGNvbnN0IGJib3ggPSBuZXcgQUFCQigpO1xuICAgIGxldCB3b3JsZE1hdHJpeCA9IG5ldyBNYXRyaXg0KG1vZGVsLnRyYW5zZm9ybU1hdHJpeCk7XG5cbiAgICAvKiBlc2xpbnQtZGlzYWJsZSAgKi9cbiAgICBpZiAobW9kZWwuc2NlbmVncmFwaE5vZGUpIHtcbiAgICAgIGNvbnN0IHNjZW5lZ3JhcGhOb2RlID0gbW9kZWwuc2NlbmVncmFwaE5vZGUgPyBnbHRmLm5vZGVzLmZpbmQoKG4pID0+IG4ubmFtZSA9PT0gbW9kZWwuc2NlbmVncmFwaE5vZGUpIDogdW5kZWZpbmVkO1xuICAgICAgbGV0IGZvdW5kTm9kZUluU2NlbmUgPSBmYWxzZTtcbiAgICAgIGZvciAoY29uc3Qgc2NlbmUgb2YgZ2x0Zi5zY2VuZXMpIHtcbiAgICAgICAgaWYgKCFmb3VuZE5vZGVJblNjZW5lKSB7XG4gICAgICAgICAgdHJhdmVyc2VTY2VuZShzY2VuZSwgbmV3IE1hdHJpeDQobW9kZWwudHJhbnNmb3JtTWF0cml4KSwgKGNoaWxkLCBtb2RlbE1hdHJpeCkgPT4ge1xuICAgICAgICAgICAgaWYgKGNoaWxkID09PSBzY2VuZWdyYXBoTm9kZSkge1xuICAgICAgICAgICAgICB3b3JsZE1hdHJpeCA9IG1vZGVsTWF0cml4O1xuICAgICAgICAgICAgICBmb3VuZE5vZGVJblNjZW5lID0gdHJ1ZTtcbiAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgIGdsdGYuc2NlbmUgPSB7XG4gICAgICAgIGlkOiBtb2RlbC5zY2VuZWdyYXBoTm9kZSxcbiAgICAgICAgbmFtZTogbW9kZWwuc2NlbmVncmFwaE5vZGUsXG4gICAgICAgIG5vZGVzOiBbc2NlbmVncmFwaE5vZGVdXG4gICAgICB9O1xuICAgIH1cblxuICAgIHRyYXZlcnNlU2NlbmUoZ2x0Zi5zY2VuZSwgd29ybGRNYXRyaXgsIChub2RlLCBtb2RlbE1hdHJpeCkgPT4ge1xuICAgICAgaWYgKG5vZGUubWVzaCAmJiBub2RlLm1lc2gucHJpbWl0aXZlcyAmJiBub2RlLm1lc2gucHJpbWl0aXZlcy5sZW5ndGggPiAwKSB7XG4gICAgICAgIGZvciAoY29uc3QgcHJpbWl0aXZlIG9mIG5vZGUubWVzaC5wcmltaXRpdmVzKSB7XG4gICAgICAgICAgaWYgKHByaW1pdGl2ZS5hdHRyaWJ1dGVzLlBPU0lUSU9OICYmIHByaW1pdGl2ZS5hdHRyaWJ1dGVzLlBPU0lUSU9OLm1pbikge1xuICAgICAgICAgICAgY29uc3QgbG93ZXJCb3VuZCA9IG1vZGVsTWF0cml4LnRyYW5zZm9ybUFzUG9pbnQocHJpbWl0aXZlLmF0dHJpYnV0ZXMuUE9TSVRJT04ubWluLCBbXSk7XG4gICAgICAgICAgICBjb25zdCB1cHBlckJvdW5kID0gbW9kZWxNYXRyaXgudHJhbnNmb3JtQXNQb2ludChwcmltaXRpdmUuYXR0cmlidXRlcy5QT1NJVElPTi5tYXgsIFtdKTtcbiAgICAgICAgICAgIGNvbnN0IGlubmVyQmJveCA9IG5ldyBBQUJCKHtcbiAgICAgICAgICAgICAgbG93ZXJCb3VuZDogbmV3IFZlYzMoLi4ubG93ZXJCb3VuZC5tYXAoKG4sIGkpID0+IE1hdGgubWluKG4sIHVwcGVyQm91bmRbaV0pKSksXG4gICAgICAgICAgICAgIHVwcGVyQm91bmQ6IG5ldyBWZWMzKC4uLnVwcGVyQm91bmQubWFwKChuLCBpKSA9PiBNYXRoLm1heChuLCBsb3dlckJvdW5kW2ldKSkpXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIGJib3guZXh0ZW5kKGlubmVyQmJveCk7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9XG4gICAgICByZXR1cm4gdHJ1ZTtcbiAgICB9KTtcbiAgICAvKiBlc2xpbnQtZW5hYmxlICovXG5cbiAgICBjb25zdCBzaXplID0gYmJveC51cHBlckJvdW5kLmNsb25lKCkudnN1YihiYm94Lmxvd2VyQm91bmQpO1xuICAgIGNvbnN0IGhhbGZTaXplID0gc2l6ZS5jbG9uZSgpLnZtdWwobmV3IFZlYzMoMC41LCAwLjUsIDAuNSkpO1xuICAgIGNvbnN0IHBvc2l0aW9uID0gYmJveC5sb3dlckJvdW5kLmNsb25lKCkudmFkZChoYWxmU2l6ZSk7XG4gICAgY29uc3QgdHJhbnNmb3JtTWF0cml4ID0gbmV3IE1hdHJpeDQoTWF0cml4NC5JREVOVElUWSlcbiAgICAgIC50cmFuc2xhdGUocG9zaXRpb24udG9BcnJheSgpKVxuICAgICAgLnNjYWxlKGhhbGZTaXplLnRvQXJyYXkoKSk7XG4gICAgY29uc3QgbmV3Tm9kZTogU3BhdGlhbFNjZW5lTm9kZSA9IHtcbiAgICAgIC4uLm1vZGVsLFxuICAgICAgdHJhbnNmb3JtTWF0cml4LFxuICAgICAgZ2VvbWV0cnk6ICd3aXJlZnJhbWUnXG4gICAgfTtcbiAgICBkZWxldGUgbmV3Tm9kZS5zY2VuZWdyYXBoO1xuICAgIGRlbGV0ZSBuZXdOb2RlLnNjZW5lZ3JhcGhOb2RlO1xuXG4gICAgbmV3Tm9kZXMucHVzaChuZXdOb2RlKTtcbiAgfVxuICByZXR1cm4gbmV3Tm9kZXM7XG59XG4iXX0= \ No newline at end of file diff --git a/ccf-body-ui/esm2015/lib/util/spatial-scene-collider.js b/ccf-body-ui/esm2015/lib/util/spatial-scene-collider.js deleted file mode 100644 index ccd355306..000000000 --- a/ccf-body-ui/esm2015/lib/util/spatial-scene-collider.js +++ /dev/null @@ -1,98 +0,0 @@ -import { __awaiter } from "tslib"; -import { load } from '@loaders.gl/core'; -import { DracoLoader } from '@loaders.gl/draco'; -import { GLTFLoader } from '@loaders.gl/gltf'; -import { Matrix4 } from '@math.gl/core'; -import { AABB, Vec3 } from 'cannon-es'; -import { traverseScene } from './scene-traversal'; -/* eslint-disable */ -export function doCollisions(scene) { - return __awaiter(this, void 0, void 0, function* () { - console.log('Starting Collisioning'); - const sourceBoxes = scene - .filter(d => !d.scenegraph && d.geometry !== 'wireframe') - .map(model => { - const mat = new Matrix4(model.transformMatrix); - const lowerBound = mat.transformAsPoint([-1, -1, -1], []); - const upperBound = mat.transformAsPoint([1, 1, 1], []); - return { - '@id': model['@id'], - name: model.tooltip, - entityId: model.entityId, - bbox: new AABB({ - lowerBound: new Vec3(...lowerBound.map((n, i) => Math.min(n, upperBound[i]))), - upperBound: new Vec3(...upperBound.map((n, i) => Math.max(n, lowerBound[i]))) - }) - }; - }); - const targetBoxes = []; - for (const model of scene.filter(d => !!d.scenegraph)) { - const gltf = yield load(model.scenegraph, GLTFLoader, { DracoLoader, decompress: true, postProcess: true }); - for (const gltfScene of gltf.scenes) { - traverseScene(gltfScene, new Matrix4(model.transformMatrix), (node, modelMatrix) => { - if (node.mesh && node.mesh.primitives && node.mesh.primitives.length > 0) { - for (const primitive of node.mesh.primitives) { - if (primitive.attributes.POSITION && primitive.attributes.POSITION.min) { - const lowerBound = modelMatrix.transformAsPoint(primitive.attributes.POSITION.min, []); - const upperBound = modelMatrix.transformAsPoint(primitive.attributes.POSITION.max, []); - targetBoxes.push({ - '@id': model['@id'], - name: node.name, - entityId: model.entityId, - bbox: new AABB({ - lowerBound: new Vec3(...lowerBound.map((n, i) => Math.min(n, upperBound[i]))), - upperBound: new Vec3(...upperBound.map((n, i) => Math.max(n, lowerBound[i]))) - }), - gltf - }); - } - } - } - return true; - }); - } - } - const report = []; - const sad = []; - for (const src of sourceBoxes) { - const hits = []; - for (const target of targetBoxes) { - if (src.bbox.overlaps(target.bbox)) { - hits.push({ '@id': target['@id'], name: target.name }); - } - } - if (hits.length > 0) { - report.push({ - '@id': src.entityId, - name: src.name, - hits - }); - } - else { - sad.push(src); - } - } - console.log({ sourceBoxes, targetBoxes, report, sad, maxHits: Math.max(...report.map(r => r.hits.length)) }); - const csvReport = []; - for (const hit of report) { - csvReport.push({ - 'Tissue ID': hit['@id'], - 'Tissue Name': hit.name, - 'Hit ID': '', - 'Hit Name': '' - }); - for (const h of hit.hits) { - csvReport.push({ - 'Tissue ID': hit['@id'], - 'Tissue Name': hit.name, - 'Hit ID': h['@id'], - 'Hit Name': h.name - }); - } - } - console.log(csvReport); - return report; - }); -} -/* eslint-enable */ -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3BhdGlhbC1zY2VuZS1jb2xsaWRlci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL2NjZi1ib2R5LXVpL3NyYy9saWIvdXRpbC9zcGF0aWFsLXNjZW5lLWNvbGxpZGVyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSxPQUFPLEVBQUUsSUFBSSxFQUFFLE1BQU0sa0JBQWtCLENBQUM7QUFDeEMsT0FBTyxFQUFFLFdBQVcsRUFBRSxNQUFNLG1CQUFtQixDQUFDO0FBQ2hELE9BQU8sRUFBRSxVQUFVLEVBQUUsTUFBTSxrQkFBa0IsQ0FBQztBQUM5QyxPQUFPLEVBQUUsT0FBTyxFQUFFLE1BQU0sZUFBZSxDQUFDO0FBQ3hDLE9BQU8sRUFBRSxJQUFJLEVBQUUsSUFBSSxFQUFFLE1BQU0sV0FBVyxDQUFDO0FBR3ZDLE9BQU8sRUFBRSxhQUFhLEVBQUUsTUFBTSxtQkFBbUIsQ0FBQztBQVNsRCxxQkFBcUI7QUFDckIsTUFBTSxVQUFnQixZQUFZLENBQUMsS0FBeUI7O1FBQzFELE9BQU8sQ0FBQyxHQUFHLENBQUMsdUJBQXVCLENBQUMsQ0FBQztRQUNyQyxNQUFNLFdBQVcsR0FBRyxLQUFLO2FBQ3RCLE1BQU0sQ0FBQyxDQUFDLENBQUMsRUFBRSxDQUFDLENBQUMsQ0FBQyxDQUFDLFVBQVUsSUFBSSxDQUFDLENBQUMsUUFBUSxLQUFLLFdBQVcsQ0FBQzthQUN4RCxHQUFHLENBQUMsS0FBSyxDQUFDLEVBQUU7WUFDWCxNQUFNLEdBQUcsR0FBRyxJQUFJLE9BQU8sQ0FBQyxLQUFLLENBQUMsZUFBZSxDQUFDLENBQUM7WUFDL0MsTUFBTSxVQUFVLEdBQUcsR0FBRyxDQUFDLGdCQUFnQixDQUFDLENBQUMsQ0FBQyxDQUFDLEVBQUUsQ0FBQyxDQUFDLEVBQUUsQ0FBQyxDQUFDLENBQUMsRUFBRSxFQUFFLENBQUMsQ0FBQztZQUMxRCxNQUFNLFVBQVUsR0FBRyxHQUFHLENBQUMsZ0JBQWdCLENBQUMsQ0FBQyxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsQ0FBQyxFQUFFLEVBQUUsQ0FBQyxDQUFDO1lBQ3ZELE9BQU87Z0JBQ0wsS0FBSyxFQUFFLEtBQUssQ0FBQyxLQUFLLENBQUM7Z0JBQ25CLElBQUksRUFBRSxLQUFLLENBQUMsT0FBTztnQkFDbkIsUUFBUSxFQUFFLEtBQUssQ0FBQyxRQUFRO2dCQUN4QixJQUFJLEVBQUUsSUFBSSxJQUFJLENBQUM7b0JBQ2IsVUFBVSxFQUFFLElBQUksSUFBSSxDQUFDLEdBQUcsVUFBVSxDQUFDLEdBQUcsQ0FBQyxDQUFDLENBQUMsRUFBRSxDQUFDLEVBQUUsRUFBRSxDQUFDLElBQUksQ0FBQyxHQUFHLENBQUMsQ0FBQyxFQUFFLFVBQVUsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7b0JBQzdFLFVBQVUsRUFBRSxJQUFJLElBQUksQ0FBQyxHQUFHLFVBQVUsQ0FBQyxHQUFHLENBQUMsQ0FBQyxDQUFDLEVBQUUsQ0FBQyxFQUFFLEVBQUUsQ0FBQyxJQUFJLENBQUMsR0FBRyxDQUFDLENBQUMsRUFBRSxVQUFVLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDO2lCQUM5RSxDQUFDO2FBQ0gsQ0FBQztRQUNKLENBQUMsQ0FBQyxDQUFDO1FBRUwsTUFBTSxXQUFXLEdBQWtGLEVBQUUsQ0FBQztRQUN0RyxLQUFLLE1BQU0sS0FBSyxJQUFJLEtBQUssQ0FBQyxNQUFNLENBQUMsQ0FBQyxDQUFDLEVBQUUsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLFVBQVUsQ0FBQyxFQUFFO1lBQ3JELE1BQU0sSUFBSSxHQUFHLE1BQU0sSUFBSSxDQUFDLEtBQUssQ0FBQyxVQUFvQixFQUFFLFVBQVUsRUFBRSxFQUFDLFdBQVcsRUFBRSxVQUFVLEVBQUUsSUFBSSxFQUFFLFdBQVcsRUFBRSxJQUFJLEVBQUMsQ0FBQyxDQUFDO1lBQ3BILEtBQUssTUFBTSxTQUFTLElBQUksSUFBSSxDQUFDLE1BQU0sRUFBRTtnQkFDbkMsYUFBYSxDQUFDLFNBQVMsRUFBRSxJQUFJLE9BQU8sQ0FBQyxLQUFLLENBQUMsZUFBZSxDQUFDLEVBQUUsQ0FBQyxJQUFJLEVBQUUsV0FBVyxFQUFFLEVBQUU7b0JBQ2pGLElBQUksSUFBSSxDQUFDLElBQUksSUFBSSxJQUFJLENBQUMsSUFBSSxDQUFDLFVBQVUsSUFBSSxJQUFJLENBQUMsSUFBSSxDQUFDLFVBQVUsQ0FBQyxNQUFNLEdBQUcsQ0FBQyxFQUFFO3dCQUN4RSxLQUFLLE1BQU0sU0FBUyxJQUFJLElBQUksQ0FBQyxJQUFJLENBQUMsVUFBVSxFQUFFOzRCQUM1QyxJQUFJLFNBQVMsQ0FBQyxVQUFVLENBQUMsUUFBUSxJQUFJLFNBQVMsQ0FBQyxVQUFVLENBQUMsUUFBUSxDQUFDLEdBQUcsRUFBRTtnQ0FDdEUsTUFBTSxVQUFVLEdBQUcsV0FBVyxDQUFDLGdCQUFnQixDQUFDLFNBQVMsQ0FBQyxVQUFVLENBQUMsUUFBUSxDQUFDLEdBQUcsRUFBRSxFQUFFLENBQUMsQ0FBQztnQ0FDdkYsTUFBTSxVQUFVLEdBQUcsV0FBVyxDQUFDLGdCQUFnQixDQUFDLFNBQVMsQ0FBQyxVQUFVLENBQUMsUUFBUSxDQUFDLEdBQUcsRUFBRSxFQUFFLENBQUMsQ0FBQztnQ0FDdkYsV0FBVyxDQUFDLElBQUksQ0FBQztvQ0FDZixLQUFLLEVBQUUsS0FBSyxDQUFDLEtBQUssQ0FBQztvQ0FDbkIsSUFBSSxFQUFFLElBQUksQ0FBQyxJQUFJO29DQUNmLFFBQVEsRUFBRSxLQUFLLENBQUMsUUFBUTtvQ0FDeEIsSUFBSSxFQUFFLElBQUksSUFBSSxDQUFDO3dDQUNiLFVBQVUsRUFBRSxJQUFJLElBQUksQ0FBQyxHQUFHLFVBQVUsQ0FBQyxHQUFHLENBQUMsQ0FBQyxDQUFDLEVBQUUsQ0FBQyxFQUFFLEVBQUUsQ0FBQyxJQUFJLENBQUMsR0FBRyxDQUFDLENBQUMsRUFBRSxVQUFVLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDO3dDQUM3RSxVQUFVLEVBQUUsSUFBSSxJQUFJLENBQUMsR0FBRyxVQUFVLENBQUMsR0FBRyxDQUFDLENBQUMsQ0FBQyxFQUFFLENBQUMsRUFBRSxFQUFFLENBQUMsSUFBSSxDQUFDLEdBQUcsQ0FBQyxDQUFDLEVBQUUsVUFBVSxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztxQ0FDOUUsQ0FBQztvQ0FDRixJQUFJO2lDQUNMLENBQUMsQ0FBQzs2QkFDSjt5QkFDRjtxQkFDRjtvQkFDRCxPQUFPLElBQUksQ0FBQztnQkFDZCxDQUFDLENBQUMsQ0FBQzthQUNKO1NBQ0Y7UUFFRCxNQUFNLE1BQU0sR0FBZ0IsRUFBRSxDQUFDO1FBQy9CLE1BQU0sR0FBRyxHQUFjLEVBQUUsQ0FBQztRQUMxQixLQUFLLE1BQU0sR0FBRyxJQUFJLFdBQVcsRUFBRTtZQUM3QixNQUFNLElBQUksR0FBb0MsRUFBRSxDQUFDO1lBQ2pELEtBQUssTUFBTSxNQUFNLElBQUksV0FBVyxFQUFFO2dCQUNoQyxJQUFJLEdBQUcsQ0FBQyxJQUFJLENBQUMsUUFBUSxDQUFDLE1BQU0sQ0FBQyxJQUFJLENBQUMsRUFBRTtvQkFDbEMsSUFBSSxDQUFDLElBQUksQ0FBQyxFQUFDLEtBQUssRUFBRSxNQUFNLENBQUMsS0FBSyxDQUFDLEVBQUUsSUFBSSxFQUFFLE1BQU0sQ0FBQyxJQUFJLEVBQUMsQ0FBQyxDQUFDO2lCQUN0RDthQUNGO1lBQ0QsSUFBSSxJQUFJLENBQUMsTUFBTSxHQUFHLENBQUMsRUFBRTtnQkFDbkIsTUFBTSxDQUFDLElBQUksQ0FBQztvQkFDVixLQUFLLEVBQUUsR0FBRyxDQUFDLFFBQWtCO29CQUM3QixJQUFJLEVBQUUsR0FBRyxDQUFDLElBQWM7b0JBQ3hCLElBQUk7aUJBQ0wsQ0FBQyxDQUFDO2FBQ0o7aUJBQU07Z0JBQ0wsR0FBRyxDQUFDLElBQUksQ0FBQyxHQUFHLENBQUMsQ0FBQzthQUNmO1NBQ0Y7UUFFRCxPQUFPLENBQUMsR0FBRyxDQUFDLEVBQUUsV0FBVyxFQUFFLFdBQVcsRUFBRSxNQUFNLEVBQUUsR0FBRyxFQUFFLE9BQU8sRUFBRSxJQUFJLENBQUMsR0FBRyxDQUFDLEdBQUcsTUFBTSxDQUFDLEdBQUcsQ0FBQyxDQUFDLENBQUMsRUFBRSxDQUFDLENBQUMsQ0FBQyxJQUFJLENBQUMsTUFBTSxDQUFDLENBQUMsRUFBRSxDQUFDLENBQUM7UUFFN0csTUFBTSxTQUFTLEdBQWMsRUFBRSxDQUFDO1FBQ2hDLEtBQUssTUFBTSxHQUFHLElBQUksTUFBTSxFQUFFO1lBQ3hCLFNBQVMsQ0FBQyxJQUFJLENBQUM7Z0JBQ2IsV0FBVyxFQUFFLEdBQUcsQ0FBQyxLQUFLLENBQUM7Z0JBQ3ZCLGFBQWEsRUFBRSxHQUFHLENBQUMsSUFBSTtnQkFDdkIsUUFBUSxFQUFFLEVBQUU7Z0JBQ1osVUFBVSxFQUFFLEVBQUU7YUFDZixDQUFDLENBQUM7WUFDSCxLQUFLLE1BQU0sQ0FBQyxJQUFJLEdBQUcsQ0FBQyxJQUFJLEVBQUU7Z0JBQ3hCLFNBQVMsQ0FBQyxJQUFJLENBQUM7b0JBQ2IsV0FBVyxFQUFFLEdBQUcsQ0FBQyxLQUFLLENBQUM7b0JBQ3ZCLGFBQWEsRUFBRSxHQUFHLENBQUMsSUFBSTtvQkFDdkIsUUFBUSxFQUFFLENBQUMsQ0FBQyxLQUFLLENBQUM7b0JBQ2xCLFVBQVUsRUFBRSxDQUFDLENBQUMsSUFBSTtpQkFDbkIsQ0FBQyxDQUFDO2FBQ0o7U0FDRjtRQUNELE9BQU8sQ0FBQyxHQUFHLENBQUMsU0FBUyxDQUFDLENBQUM7UUFFdkIsT0FBTyxNQUFNLENBQUM7SUFDaEIsQ0FBQztDQUFBO0FBQ0QsbUJBQW1CIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgbG9hZCB9IGZyb20gJ0Bsb2FkZXJzLmdsL2NvcmUnO1xuaW1wb3J0IHsgRHJhY29Mb2FkZXIgfSBmcm9tICdAbG9hZGVycy5nbC9kcmFjbyc7XG5pbXBvcnQgeyBHTFRGTG9hZGVyIH0gZnJvbSAnQGxvYWRlcnMuZ2wvZ2x0Zic7XG5pbXBvcnQgeyBNYXRyaXg0IH0gZnJvbSAnQG1hdGguZ2wvY29yZSc7XG5pbXBvcnQgeyBBQUJCLCBWZWMzIH0gZnJvbSAnY2Fubm9uLWVzJztcblxuaW1wb3J0IHsgU3BhdGlhbFNjZW5lTm9kZSB9IGZyb20gJy4uL3NoYXJlZC9zcGF0aWFsLXNjZW5lLW5vZGUnO1xuaW1wb3J0IHsgdHJhdmVyc2VTY2VuZSB9IGZyb20gJy4vc2NlbmUtdHJhdmVyc2FsJztcblxuXG5pbnRlcmZhY2UgQ29sbGlzaW9uIHtcbiAgJ0BpZCc6IHN0cmluZztcbiAgbmFtZTogc3RyaW5nO1xuICBoaXRzOiB7ICdAaWQnOiBzdHJpbmc7IG5hbWU6IHN0cmluZyB9W107XG59XG5cbi8qIGVzbGludC1kaXNhYmxlICAqL1xuZXhwb3J0IGFzeW5jIGZ1bmN0aW9uIGRvQ29sbGlzaW9ucyhzY2VuZTogU3BhdGlhbFNjZW5lTm9kZVtdKTogUHJvbWlzZTxDb2xsaXNpb25bXT4ge1xuICBjb25zb2xlLmxvZygnU3RhcnRpbmcgQ29sbGlzaW9uaW5nJyk7XG4gIGNvbnN0IHNvdXJjZUJveGVzID0gc2NlbmVcbiAgICAuZmlsdGVyKGQgPT4gIWQuc2NlbmVncmFwaCAmJiBkLmdlb21ldHJ5ICE9PSAnd2lyZWZyYW1lJylcbiAgICAubWFwKG1vZGVsID0+IHtcbiAgICAgIGNvbnN0IG1hdCA9IG5ldyBNYXRyaXg0KG1vZGVsLnRyYW5zZm9ybU1hdHJpeCk7XG4gICAgICBjb25zdCBsb3dlckJvdW5kID0gbWF0LnRyYW5zZm9ybUFzUG9pbnQoWy0xLCAtMSwgLTFdLCBbXSk7XG4gICAgICBjb25zdCB1cHBlckJvdW5kID0gbWF0LnRyYW5zZm9ybUFzUG9pbnQoWzEsIDEsIDFdLCBbXSk7XG4gICAgICByZXR1cm4ge1xuICAgICAgICAnQGlkJzogbW9kZWxbJ0BpZCddLFxuICAgICAgICBuYW1lOiBtb2RlbC50b29sdGlwLFxuICAgICAgICBlbnRpdHlJZDogbW9kZWwuZW50aXR5SWQsXG4gICAgICAgIGJib3g6IG5ldyBBQUJCKHtcbiAgICAgICAgICBsb3dlckJvdW5kOiBuZXcgVmVjMyguLi5sb3dlckJvdW5kLm1hcCgobiwgaSkgPT4gTWF0aC5taW4obiwgdXBwZXJCb3VuZFtpXSkpKSxcbiAgICAgICAgICB1cHBlckJvdW5kOiBuZXcgVmVjMyguLi51cHBlckJvdW5kLm1hcCgobiwgaSkgPT4gTWF0aC5tYXgobiwgbG93ZXJCb3VuZFtpXSkpKVxuICAgICAgICB9KVxuICAgICAgfTtcbiAgICB9KTtcblxuICBjb25zdCB0YXJnZXRCb3hlczogeydAaWQnOiBzdHJpbmcsIG5hbWU6IHN0cmluZywgZW50aXR5SWQ/OiBzdHJpbmc7IGJib3g6IEFBQkIsIGdsdGY6IHVua25vd259W10gPSBbXTtcbiAgZm9yIChjb25zdCBtb2RlbCBvZiBzY2VuZS5maWx0ZXIoZCA9PiAhIWQuc2NlbmVncmFwaCkpIHtcbiAgICBjb25zdCBnbHRmID0gYXdhaXQgbG9hZChtb2RlbC5zY2VuZWdyYXBoIGFzIHN0cmluZywgR0xURkxvYWRlciwge0RyYWNvTG9hZGVyLCBkZWNvbXByZXNzOiB0cnVlLCBwb3N0UHJvY2VzczogdHJ1ZX0pO1xuICAgIGZvciAoY29uc3QgZ2x0ZlNjZW5lIG9mIGdsdGYuc2NlbmVzKSB7XG4gICAgICB0cmF2ZXJzZVNjZW5lKGdsdGZTY2VuZSwgbmV3IE1hdHJpeDQobW9kZWwudHJhbnNmb3JtTWF0cml4KSwgKG5vZGUsIG1vZGVsTWF0cml4KSA9PiB7XG4gICAgICAgIGlmIChub2RlLm1lc2ggJiYgbm9kZS5tZXNoLnByaW1pdGl2ZXMgJiYgbm9kZS5tZXNoLnByaW1pdGl2ZXMubGVuZ3RoID4gMCkge1xuICAgICAgICAgIGZvciAoY29uc3QgcHJpbWl0aXZlIG9mIG5vZGUubWVzaC5wcmltaXRpdmVzKSB7XG4gICAgICAgICAgICBpZiAocHJpbWl0aXZlLmF0dHJpYnV0ZXMuUE9TSVRJT04gJiYgcHJpbWl0aXZlLmF0dHJpYnV0ZXMuUE9TSVRJT04ubWluKSB7XG4gICAgICAgICAgICAgIGNvbnN0IGxvd2VyQm91bmQgPSBtb2RlbE1hdHJpeC50cmFuc2Zvcm1Bc1BvaW50KHByaW1pdGl2ZS5hdHRyaWJ1dGVzLlBPU0lUSU9OLm1pbiwgW10pO1xuICAgICAgICAgICAgICBjb25zdCB1cHBlckJvdW5kID0gbW9kZWxNYXRyaXgudHJhbnNmb3JtQXNQb2ludChwcmltaXRpdmUuYXR0cmlidXRlcy5QT1NJVElPTi5tYXgsIFtdKTtcbiAgICAgICAgICAgICAgdGFyZ2V0Qm94ZXMucHVzaCh7XG4gICAgICAgICAgICAgICAgJ0BpZCc6IG1vZGVsWydAaWQnXSxcbiAgICAgICAgICAgICAgICBuYW1lOiBub2RlLm5hbWUsXG4gICAgICAgICAgICAgICAgZW50aXR5SWQ6IG1vZGVsLmVudGl0eUlkLFxuICAgICAgICAgICAgICAgIGJib3g6IG5ldyBBQUJCKHtcbiAgICAgICAgICAgICAgICAgIGxvd2VyQm91bmQ6IG5ldyBWZWMzKC4uLmxvd2VyQm91bmQubWFwKChuLCBpKSA9PiBNYXRoLm1pbihuLCB1cHBlckJvdW5kW2ldKSkpLFxuICAgICAgICAgICAgICAgICAgdXBwZXJCb3VuZDogbmV3IFZlYzMoLi4udXBwZXJCb3VuZC5tYXAoKG4sIGkpID0+IE1hdGgubWF4KG4sIGxvd2VyQm91bmRbaV0pKSlcbiAgICAgICAgICAgICAgICB9KSxcbiAgICAgICAgICAgICAgICBnbHRmXG4gICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgIH0pO1xuICAgIH1cbiAgfVxuXG4gIGNvbnN0IHJlcG9ydDogQ29sbGlzaW9uW10gPSBbXTtcbiAgY29uc3Qgc2FkOiB1bmtub3duW10gPSBbXTtcbiAgZm9yIChjb25zdCBzcmMgb2Ygc291cmNlQm94ZXMpIHtcbiAgICBjb25zdCBoaXRzOiB7J0BpZCc6IHN0cmluZywgbmFtZTogc3RyaW5nfVtdID0gW107XG4gICAgZm9yIChjb25zdCB0YXJnZXQgb2YgdGFyZ2V0Qm94ZXMpIHtcbiAgICAgIGlmIChzcmMuYmJveC5vdmVybGFwcyh0YXJnZXQuYmJveCkpIHtcbiAgICAgICAgaGl0cy5wdXNoKHsnQGlkJzogdGFyZ2V0WydAaWQnXSwgbmFtZTogdGFyZ2V0Lm5hbWV9KTtcbiAgICAgIH1cbiAgICB9XG4gICAgaWYgKGhpdHMubGVuZ3RoID4gMCkge1xuICAgICAgcmVwb3J0LnB1c2goe1xuICAgICAgICAnQGlkJzogc3JjLmVudGl0eUlkIGFzIHN0cmluZyxcbiAgICAgICAgbmFtZTogc3JjLm5hbWUgYXMgc3RyaW5nLFxuICAgICAgICBoaXRzXG4gICAgICB9KTtcbiAgICB9IGVsc2Uge1xuICAgICAgc2FkLnB1c2goc3JjKTtcbiAgICB9XG4gIH1cblxuICBjb25zb2xlLmxvZyh7IHNvdXJjZUJveGVzLCB0YXJnZXRCb3hlcywgcmVwb3J0LCBzYWQsIG1heEhpdHM6IE1hdGgubWF4KC4uLnJlcG9ydC5tYXAociA9PiByLmhpdHMubGVuZ3RoKSkgfSk7XG5cbiAgY29uc3QgY3N2UmVwb3J0OiB1bmtub3duW10gPSBbXTtcbiAgZm9yIChjb25zdCBoaXQgb2YgcmVwb3J0KSB7XG4gICAgY3N2UmVwb3J0LnB1c2goe1xuICAgICAgJ1Rpc3N1ZSBJRCc6IGhpdFsnQGlkJ10sXG4gICAgICAnVGlzc3VlIE5hbWUnOiBoaXQubmFtZSxcbiAgICAgICdIaXQgSUQnOiAnJyxcbiAgICAgICdIaXQgTmFtZSc6ICcnXG4gICAgfSk7XG4gICAgZm9yIChjb25zdCBoIG9mIGhpdC5oaXRzKSB7XG4gICAgICBjc3ZSZXBvcnQucHVzaCh7XG4gICAgICAgICdUaXNzdWUgSUQnOiBoaXRbJ0BpZCddLFxuICAgICAgICAnVGlzc3VlIE5hbWUnOiBoaXQubmFtZSxcbiAgICAgICAgJ0hpdCBJRCc6IGhbJ0BpZCddLFxuICAgICAgICAnSGl0IE5hbWUnOiBoLm5hbWVcbiAgICAgIH0pO1xuICAgIH1cbiAgfVxuICBjb25zb2xlLmxvZyhjc3ZSZXBvcnQpO1xuXG4gIHJldHVybiByZXBvcnQ7XG59XG4vKiBlc2xpbnQtZW5hYmxlICovXG4iXX0= \ No newline at end of file diff --git a/ccf-body-ui/esm2015/public-api.js b/ccf-body-ui/esm2015/public-api.js deleted file mode 100644 index f08b94dd5..000000000 --- a/ccf-body-ui/esm2015/public-api.js +++ /dev/null @@ -1,16 +0,0 @@ -// Hack to support deck.gl and other typings -// eslint-disable-next-line @typescript-eslint/triple-slash-reference -/// -/* - * Public API Surface of ccf-body-ui - */ -export * from './lib/body-ui-layer'; -export * from './lib/body-ui'; -export * from './lib/shared/spatial-scene-node'; -export * from './lib/shared/ccf-spatial-jsonld'; -export * from './lib/util/load-gltf'; -export * from './lib/util/scene-traversal'; -export * from './lib/util/spatial-scene-collider'; -export * from './lib/util/process-scene-nodes'; -export * from './lib/util/simplify-scene'; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljLWFwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3Byb2plY3RzL2NjZi1ib2R5LXVpL3NyYy9wdWJsaWMtYXBpLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLDRDQUE0QztBQUM1QyxxRUFBcUU7QUFDckUsOEJBQThCO0FBRTlCOztHQUVHO0FBQ0gsY0FBYyxxQkFBcUIsQ0FBQztBQUNwQyxjQUFjLGVBQWUsQ0FBQztBQUM5QixjQUFjLGlDQUFpQyxDQUFDO0FBQ2hELGNBQWMsaUNBQWlDLENBQUM7QUFFaEQsY0FBYyxzQkFBc0IsQ0FBQztBQUNyQyxjQUFjLDRCQUE0QixDQUFDO0FBQzNDLGNBQWMsbUNBQW1DLENBQUM7QUFDbEQsY0FBYyxnQ0FBZ0MsQ0FBQztBQUMvQyxjQUFjLDJCQUEyQixDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLy8gSGFjayB0byBzdXBwb3J0IGRlY2suZ2wgYW5kIG90aGVyIHR5cGluZ3Ncbi8vIGVzbGludC1kaXNhYmxlLW5leHQtbGluZSBAdHlwZXNjcmlwdC1lc2xpbnQvdHJpcGxlLXNsYXNoLXJlZmVyZW5jZVxuLy8vIDxyZWZlcmVuY2UgdHlwZXM9XCJub2RlXCIgLz5cblxuLypcbiAqIFB1YmxpYyBBUEkgU3VyZmFjZSBvZiBjY2YtYm9keS11aVxuICovXG5leHBvcnQgKiBmcm9tICcuL2xpYi9ib2R5LXVpLWxheWVyJztcbmV4cG9ydCAqIGZyb20gJy4vbGliL2JvZHktdWknO1xuZXhwb3J0ICogZnJvbSAnLi9saWIvc2hhcmVkL3NwYXRpYWwtc2NlbmUtbm9kZSc7XG5leHBvcnQgKiBmcm9tICcuL2xpYi9zaGFyZWQvY2NmLXNwYXRpYWwtanNvbmxkJztcblxuZXhwb3J0ICogZnJvbSAnLi9saWIvdXRpbC9sb2FkLWdsdGYnO1xuZXhwb3J0ICogZnJvbSAnLi9saWIvdXRpbC9zY2VuZS10cmF2ZXJzYWwnO1xuZXhwb3J0ICogZnJvbSAnLi9saWIvdXRpbC9zcGF0aWFsLXNjZW5lLWNvbGxpZGVyJztcbmV4cG9ydCAqIGZyb20gJy4vbGliL3V0aWwvcHJvY2Vzcy1zY2VuZS1ub2Rlcyc7XG5leHBvcnQgKiBmcm9tICcuL2xpYi91dGlsL3NpbXBsaWZ5LXNjZW5lJztcbiJdfQ== \ No newline at end of file diff --git a/ccf-body-ui/fesm2015/ccf-body-ui.js b/ccf-body-ui/fesm2015/ccf-body-ui.js deleted file mode 100644 index 6edd0df56..000000000 --- a/ccf-body-ui/fesm2015/ccf-body-ui.js +++ /dev/null @@ -1,703 +0,0 @@ -import { COORDINATE_SYSTEM, CompositeLayer, OrthographicView, OrbitView, LightingEffect, AmbientLight, Deck } from '@deck.gl/core'; -import { TextLayer } from '@deck.gl/layers'; -import { SimpleMeshLayer, ScenegraphLayer } from '@deck.gl/mesh-layers'; -import { CubeGeometry, CylinderGeometry, ConeGeometry, SphereGeometry } from '@luma.gl/core'; -import { Matrix4 } from '@math.gl/core'; -import { __awaiter, __decorate } from 'tslib'; -import { registerLoaders, parse, load } from '@loaders.gl/core'; -import { DracoWorkerLoader, DracoLoader } from '@loaders.gl/draco'; -import { GLTFLoader } from '@loaders.gl/gltf'; -import { AABB, Vec3 } from 'cannon-es'; -import bind from 'bind-decorator'; -import { Subject, BehaviorSubject } from 'rxjs'; -import { share } from 'rxjs/operators'; - -/* eslint-disable @typescript-eslint/no-unsafe-member-access */ -// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types -function traverseScene(scene, worldMatrix, visitor) { - if (!worldMatrix) { - worldMatrix = new Matrix4(Matrix4.IDENTITY); - } - const matrix = new Matrix4(Matrix4.IDENTITY); - if (!scene) { - return true; - } - else if (scene.matrix) { - matrix.copy(scene.matrix); - } - else { - matrix.identity(); - if (scene.translation) { - matrix.translate(scene.translation); - } - if (scene.rotation) { - const rotationMatrix = new Matrix4(Matrix4.IDENTITY).fromQuaternion(scene.rotation); - matrix.multiplyRight(rotationMatrix); - } - if (scene.scale) { - matrix.scale(scene.scale); - } - } - const modelMatrix = new Matrix4(worldMatrix).multiplyRight(matrix); - if (visitor(scene, modelMatrix, worldMatrix) === false) { - return false; - } - for (const child of (scene.nodes || scene.children || [])) { - if (traverseScene(child, modelMatrix, visitor) === false) { - return false; - } - } - return true; -} - -function registerGLTFLoaders() { - registerLoaders([DracoWorkerLoader, GLTFLoader]); -} -// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types -function deriveScenegraph(scenegraphNodeName, gltf) { - var _a; - const scenegraphNode = (_a = gltf.nodes) === null || _a === void 0 ? void 0 : _a.find((n) => n.name === scenegraphNodeName); - if (scenegraphNode) { - let foundNodeInScene = false; - for (const scene of gltf.scenes) { - if (!foundNodeInScene) { - traverseScene(scene, new Matrix4(Matrix4.IDENTITY), (child, modelMatrix) => { - if (child === scenegraphNode) { - child.matrix = modelMatrix; - child.translation = undefined; - child.rotation = undefined; - child.scale = undefined; - foundNodeInScene = true; - return false; - } - return true; - }); - } - } - gltf.scene = { - id: scenegraphNodeName, - name: scenegraphNodeName, - nodes: [scenegraphNode] - }; - gltf.scenes = [gltf.scene]; - return { scene: gltf.scene, scenes: gltf.scenes }; - } - else { - return gltf; - } -} -// eslint-disable-next-line @typescript-eslint/no-explicit-any -function loadGLTF(model, cache) { - return __awaiter(this, void 0, void 0, function* () { - const gltfUrl = model.scenegraph; - let gltfPromise; - if (cache) { - gltfPromise = cache[gltfUrl] || (cache[gltfUrl] = fetch(gltfUrl).then(r => r.blob())); - } - else { - gltfPromise = fetch(gltfUrl); - } - // eslint-disable-next-line @typescript-eslint/naming-convention - const gltf = yield parse(gltfPromise, GLTFLoader, { DracoLoader, gltf: { decompressMeshes: true, postProcess: true } }); - if (!gltf.nodes) { - console.log('WARNING: Empty Scene', gltfUrl, gltf); - } - return deriveScenegraph(model.scenegraphNode, gltf); - }); -} -// eslint-disable-next-line @typescript-eslint/no-explicit-any -function loadGLTF2(scenegraphNodeName, gltfPromise) { - return __awaiter(this, void 0, void 0, function* () { - return deriveScenegraph(scenegraphNodeName, yield gltfPromise); - }); -} -/* eslint-enable */ - -/* eslint-disable */ -function doCollisions(scene) { - return __awaiter(this, void 0, void 0, function* () { - console.log('Starting Collisioning'); - const sourceBoxes = scene - .filter(d => !d.scenegraph && d.geometry !== 'wireframe') - .map(model => { - const mat = new Matrix4(model.transformMatrix); - const lowerBound = mat.transformAsPoint([-1, -1, -1], []); - const upperBound = mat.transformAsPoint([1, 1, 1], []); - return { - '@id': model['@id'], - name: model.tooltip, - entityId: model.entityId, - bbox: new AABB({ - lowerBound: new Vec3(...lowerBound.map((n, i) => Math.min(n, upperBound[i]))), - upperBound: new Vec3(...upperBound.map((n, i) => Math.max(n, lowerBound[i]))) - }) - }; - }); - const targetBoxes = []; - for (const model of scene.filter(d => !!d.scenegraph)) { - const gltf = yield load(model.scenegraph, GLTFLoader, { DracoLoader, decompress: true, postProcess: true }); - for (const gltfScene of gltf.scenes) { - traverseScene(gltfScene, new Matrix4(model.transformMatrix), (node, modelMatrix) => { - if (node.mesh && node.mesh.primitives && node.mesh.primitives.length > 0) { - for (const primitive of node.mesh.primitives) { - if (primitive.attributes.POSITION && primitive.attributes.POSITION.min) { - const lowerBound = modelMatrix.transformAsPoint(primitive.attributes.POSITION.min, []); - const upperBound = modelMatrix.transformAsPoint(primitive.attributes.POSITION.max, []); - targetBoxes.push({ - '@id': model['@id'], - name: node.name, - entityId: model.entityId, - bbox: new AABB({ - lowerBound: new Vec3(...lowerBound.map((n, i) => Math.min(n, upperBound[i]))), - upperBound: new Vec3(...upperBound.map((n, i) => Math.max(n, lowerBound[i]))) - }), - gltf - }); - } - } - } - return true; - }); - } - } - const report = []; - const sad = []; - for (const src of sourceBoxes) { - const hits = []; - for (const target of targetBoxes) { - if (src.bbox.overlaps(target.bbox)) { - hits.push({ '@id': target['@id'], name: target.name }); - } - } - if (hits.length > 0) { - report.push({ - '@id': src.entityId, - name: src.name, - hits - }); - } - else { - sad.push(src); - } - } - console.log({ sourceBoxes, targetBoxes, report, sad, maxHits: Math.max(...report.map(r => r.hits.length)) }); - const csvReport = []; - for (const hit of report) { - csvReport.push({ - 'Tissue ID': hit['@id'], - 'Tissue Name': hit.name, - 'Hit ID': '', - 'Hit Name': '' - }); - for (const h of hit.hits) { - csvReport.push({ - 'Tissue ID': hit['@id'], - 'Tissue Name': hit.name, - 'Hit ID': h['@id'], - 'Hit Name': h.name - }); - } - } - console.log(csvReport); - return report; - }); -} -/* eslint-enable */ - -/* eslint-disable @typescript-eslint/no-unsafe-call */ -function meshLayer(id, data, options) { - if (!data || data.length === 0) { - return undefined; - } - else { - let mesh; - switch (options.geometry) { - case 'sphere': - mesh = new SphereGeometry(); - break; - case 'cone': - mesh = new ConeGeometry(); - break; - case 'cylinder': - mesh = new CylinderGeometry(); - break; - case 'cube': - default: - mesh = new CubeGeometry(); - break; - } - return new SimpleMeshLayer(Object.assign({ - id, - pickable: true, - autoHighlight: false, - highlightColor: [30, 136, 229, 255], - coordinateSystem: COORDINATE_SYSTEM.CARTESIAN, - data, - // eslint-disable-next-line @typescript-eslint/no-explicit-any - mesh: mesh, - wireframe: false, - getTransformMatrix: (d) => d.transformMatrix, - getColor: (d) => d.color || [255, 255, 255, 0.9 * 255] - }, options)); - } -} -function textLayer(id, data, options) { - if (!data || data.length === 0) { - return undefined; - } - else { - return new TextLayer(Object.assign({ - id, - pickable: true, - data: data.map(d => (Object.assign(Object.assign({}, d), { position: new Matrix4(d.transformMatrix).getTranslation() }))), - getText: (d) => d.text, - getPosition: (d) => d.position, - getColor: (d) => d.color - }, options)); - } -} -class BodyUILayer extends CompositeLayer { - initializeState() { - const { data } = this.props; - this.setState({ data: data !== null && data !== void 0 ? data : [], zoomOpacity: 0.8, doCollisions: false }); - registerGLTFLoaders(); - } - renderLayers() { - var _a, _b; - const state = this.state; - const geometries = { - 'sphere': [], 'cone': [], 'cylinder': [], 'cube': [], 'text': [], 'wireframe': [], 'scenegraph': [] - }; - for (const node of state.data) { - const geometry = (_a = node.geometry) !== null && _a !== void 0 ? _a : 'cube'; - if (node.scenegraph) { - geometries.scenegraph.push(node); - } - else if (geometries[geometry] !== undefined) { - geometries[geometry].push(node); - } - } - // eslint-disable-next-line @typescript-eslint/no-explicit-any - const url2gltf = {}; - for (const m of geometries.scenegraph) { - if (m.scenegraph && m.scenegraphNode && !Object.prototype.hasOwnProperty.call(url2gltf, m.scenegraph)) { - url2gltf[m.scenegraph] = loadGLTF({ scenegraph: m.scenegraph }, BodyUILayer.gltfCache); - } - } - const layers = []; - for (const [geometry, nodes] of Object.entries(geometries)) { - if (geometry === 'scenegraph') { - for (const model of nodes) { - layers.push(new ScenegraphLayer({ - id: 'models-' + model['@id'], - opacity: model.zoomBasedOpacity ? state.zoomOpacity : (model.opacity !== undefined ? model.opacity : 1.0), - pickable: !model.unpickable, - coordinateSystem: COORDINATE_SYSTEM.CARTESIAN, - data: [model], - scenegraph: model.scenegraphNode ? - loadGLTF2(model.scenegraphNode, url2gltf[model.scenegraph]) : - model.scenegraph, - // eslint-disable-next-line @typescript-eslint/naming-convention - _lighting: model._lighting, - getTransformMatrix: model.transformMatrix, - getColor: (_b = model.color) !== null && _b !== void 0 ? _b : [0, 255, 0, 0.5 * 255], - parameters: { depthMask: !model.zoomBasedOpacity && (model.opacity === undefined || model.opacity === 1) } - })); - } - } - else if (geometry === 'text') { - layers.push(textLayer('text', nodes.filter(n => n.unpickable), { pickable: false })); - layers.push(textLayer('textPickable', nodes.filter(n => !n.unpickable), { pickable: true })); - } - else if (geometry === 'wireframe') { - layers.push(meshLayer(geometry, nodes, { wireframe: true, pickable: false, geometry })); - } - else { - layers.push(meshLayer(geometry, nodes.filter(n => n.unpickable), { wireframe: false, pickable: false, geometry })); - layers.push(meshLayer(`${geometry}Pickable`, nodes.filter(n => !n.unpickable), { wireframe: false, pickable: true, geometry })); - } - } - if (state.doCollisions) { - doCollisions(state.data); - } - return layers.filter(l => !!l); - } - getPickingInfo(e) { - return e.info; - } -} -BodyUILayer.layerName = 'BodyUILayer'; -BodyUILayer.gltfCache = {}; - -/* eslint-disable */ -function childNames(scene, names = []) { - for (const child of (scene.nodes || scene.children || [])) { - names.push(child.name); - childNames(child, names); - } - return names; -} -function processSceneNodes(gltfUrl, worldMatrix, scenegraphNode) { - return __awaiter(this, void 0, void 0, function* () { - registerGLTFLoaders(); - const gltf = yield loadGLTF({ scenegraph: gltfUrl, scenegraphNode }); - const nodes = {}; - const gltfNodes = []; - for (const scene of gltf.scenes) { - worldMatrix = new Matrix4(worldMatrix || Matrix4.IDENTITY); - traverseScene(scene, worldMatrix, (node, modelMatrix) => { - const processedNode = { - '@id': (node.name || node.id), - '@type': 'ProcessedNode', - transformMatrix: new Matrix4(modelMatrix), - geometry: 'wireframe', - node - }; - gltfNodes.push({ - '@id': `GLTF:${processedNode['@id']}`, - '@type': 'GLTFNode', - scenegraph: gltfUrl, - scenegraphNode: processedNode['@id'], - transformMatrix: new Matrix4(worldMatrix || Matrix4.IDENTITY), - tooltip: (node.name || node.id), - color: [255, 255, 255, 255], - _lighting: 'pbr', - zoomBasedOpacity: true, - node - }); - if (node.mesh && node.mesh.primitives && node.mesh.primitives.length > 0) { - for (const primitive of node.mesh.primitives) { - if (primitive.attributes.POSITION && primitive.attributes.POSITION.min) { - const lowerBound = modelMatrix.transformAsPoint(primitive.attributes.POSITION.min, []); - const upperBound = modelMatrix.transformAsPoint(primitive.attributes.POSITION.max, []); - processedNode.bbox = new AABB({ - lowerBound: new Vec3(...lowerBound.map((n, i) => Math.min(n, upperBound[i]))), - upperBound: new Vec3(...upperBound.map((n, i) => Math.max(n, lowerBound[i]))) - }); - } - } - } - nodes[processedNode['@id']] = processedNode; - return true; - }); - } - for (const node of Object.values(nodes).filter(n => !n.bbox)) { - for (const child of childNames(node.node).map(n => nodes[n]).filter(n => n.bbox)) { - if (!node.bbox) { - node.bbox = child.bbox.clone(); - } - else { - node.bbox.extend(child.bbox); - } - } - if (!node.bbox) { - delete nodes[node['@id']]; - } - } - for (const node of Object.values(nodes)) { - const lb = node.bbox.lowerBound; - const ub = node.bbox.upperBound; - const size = node.size = ub.clone().vsub(lb); - const halfSize = size.clone().vmul(new Vec3(0.5, 0.5, 0.5)); - const center = node.center = lb.clone().vadd(halfSize); - node.transformMatrix = new Matrix4(Matrix4.IDENTITY) - .translate(center.toArray()) - .scale(halfSize.toArray()); - } - for (const node of gltfNodes) { - nodes[node['@id']] = node; - } - return nodes; - }); -} -/* eslint-enable */ - -/** - * A convenience wrapper class for the CCF Body UI - */ -class BodyUI { - constructor(deckProps) { - var _a, _b, _c, _d, _e; - this.deckProps = deckProps; - this.bodyUILayer = new BodyUILayer({}); - this.nodeClickSubject = new Subject(); - this.nodeHoverStartSubject = new Subject(); - this.nodeHoverStopSubject = new Subject(); - this.sceneRotationSubject = new BehaviorSubject([0, 0]); - this.nodeDragStartSubject = new Subject(); - this.nodeDragSubject = new Subject(); - this.nodeDragEndSubject = new Subject(); - this.nodeClick$ = this.nodeClickSubject.pipe(share()); - this.nodeHoverStart$ = this.nodeHoverStartSubject.pipe(share()); - this.nodeHoverStop$ = this.nodeHoverStopSubject.pipe(share()); - this.sceneRotation$ = this.sceneRotationSubject.pipe(share()); - this.nodeDragStart$ = this.nodeDragStartSubject.pipe(share()); - this.nodeDrag$ = this.nodeDragSubject.pipe(share()); - this.nodeDragEnd$ = this.nodeDragEndSubject.pipe(share()); - // eslint-disable-next-line @typescript-eslint/no-explicit-any - const props = Object.assign(Object.assign({}, deckProps), { views: [deckProps.camera === 'orthographic' ? new OrthographicView({ - flipY: false, - near: -1000 - }) : new OrbitView({ orbitAxis: 'Y' })], controller: deckProps.interactive !== undefined ? deckProps.interactive : true, layers: [this.bodyUILayer], onHover: this._onHover, onClick: this._onClick, onViewStateChange: this._onViewStateChange, onDragStart: this._onDragStart, onDrag: this._onDrag, onDragEnd: this._onDragEnd, getCursor: (e) => { var _a; return (_a = this.cursor) !== null && _a !== void 0 ? _a : (e.isDragging ? 'grabbing' : 'grab'); } }); - if (deckProps.legacyLighting) { - // eslint-disable-next-line - props.effects = [ - new LightingEffect({ - ambientLight: new AmbientLight({ - color: [255, 255, 255], - intensity: 10.0 - }) - }) - ]; - } - // eslint-disable-next-line - this.deck = new Deck(props); - this.deck.setProps({ - viewState: { - orbitAxis: 'Y', - minRotationX: (_a = deckProps.minRotationX) !== null && _a !== void 0 ? _a : -15, - maxRotationX: (_b = deckProps.maxRotationX) !== null && _b !== void 0 ? _b : 15, - target: (_c = deckProps.target) !== null && _c !== void 0 ? _c : [0.5, 0.5, 0], - rotationX: 0, - rotationOrbit: (_d = deckProps.rotation) !== null && _d !== void 0 ? _d : 0, - zoom: (_e = deckProps.zoom) !== null && _e !== void 0 ? _e : 9.5, - camera: deckProps.camera - } - }); - if (deckProps.rotation) { - this.sceneRotationSubject.next([deckProps.rotation, 0]); - } - } - initialize() { - return __awaiter(this, void 0, void 0, function* () { - while (!this.bodyUILayer.state) { - // eslint-disable-next-line no-await-in-loop - yield new Promise(r => { - setTimeout(r, 200); - }); - } - }); - } - finalize() { - this.deck.finalize(); - } - setScene(data) { - if ((data === null || data === void 0 ? void 0 : data.length) > 0) { - let zoomOpacity = this.bodyUILayer.state.zoomOpacity; - let didZoom = false; - for (const node of data) { - if (node.zoomToOnLoad) { - this.zoomTo(node); - didZoom = true; - } - } - zoomOpacity = didZoom ? 0.05 : zoomOpacity; - if (!this.deckProps.debugSceneNodeProcessing) { - this.bodyUILayer.setState({ data, zoomOpacity }); - } - else { - this.debugSceneNodeProcessing(data, zoomOpacity); - } - } - } - debugSceneNodeProcessing(data, zoomOpacity) { - // const gltfUrl = 'https://hubmapconsortium.github.io/ccf-3d-reference-object-library/VH_Male/United/VHM_United_Color.glb'; - const gltfUrl = 'https://hubmapconsortium.github.io/ccf-3d-reference-object-library/VH_Female/United/VHF_United_Color.glb'; - // const gltfUrl = 'https://hubmapconsortium.github.io/hubmap-ontology/objects/VHF_United_v01_060420.glb'; - const gltfTransform = new Matrix4([0.076, 0, 0, 0, 0, 0.076, 1.6875389974302382e-17, 0, 0, -1.6875389974302382e-17, 0.076, 0, 0.49, 0.034, 0.11, 1]); - processSceneNodes(gltfUrl, gltfTransform, 'VHF_Kidney_L_Low1').then((results) => { - console.log('results', results); - console.log('data', data); - // data = Object.values(results); - data = data.concat(Object.values(results)); - data.push({ - '@id': 'TEST', - '@type': 'TEST', - scenegraph: gltfUrl, - scenegraphNode: 'VHF_Kidney_R_Low', - transformMatrix: gltfTransform, - color: [255, 255, 255, 200], - // eslint-disable-next-line @typescript-eslint/naming-convention - _lighting: 'pbr', - zoomBasedOpacity: false - }); - this.bodyUILayer.setState({ data, zoomOpacity }); - }); - } - zoomTo(node) { - const matrix = new Matrix4(node.transformMatrix); - this.deck.setProps({ - viewState: Object.assign(Object.assign({}, this.deck.props.viewState), { target: matrix.getTranslation(), rotationX: 0, rotationOrbit: 0, zoom: 11.5 }) - }); - } - setRotation(value) { - this.deck.setProps({ - viewState: Object.assign(Object.assign({}, this.deck.props.viewState), { rotationOrbit: value }) - }); - } - setRotationX(value) { - this.deck.setProps({ - viewState: Object.assign(Object.assign({}, this.deck.props.viewState), { rotationX: value }) - }); - } - setZoom(value) { - this.deck.setProps({ - viewState: Object.assign(Object.assign({}, this.deck.props.viewState), { zoom: value }) - }); - } - setTarget(value) { - this.deck.setProps({ - viewState: Object.assign(Object.assign({}, this.deck.props.viewState), { target: value }) - }); - } - setInteractive(value) { - this.deck.setProps({ - controller: value - }); - } - _onHover(e) { - const { lastHovered } = this; - this.cursor = e.picked ? 'pointer' : undefined; - if (e.picked && e.object && e.object['@id']) { - if (lastHovered !== e.object) { - if (lastHovered) { - this.nodeHoverStopSubject.next(lastHovered); - } - this.lastHovered = e.object; - this.nodeHoverStartSubject.next(e.object); - } - } - else if (lastHovered) { - this.nodeHoverStopSubject.next(lastHovered); - this.lastHovered = undefined; - } - } - _onClick(info, e) { - var _a, _b; - if (info.picked && info.object && info.object['@id']) { - this.nodeClickSubject.next({ node: info.object, ctrlClick: (_b = (_a = e === null || e === void 0 ? void 0 : e.srcEvent) === null || _a === void 0 ? void 0 : _a.ctrlKey) !== null && _b !== void 0 ? _b : undefined }); - } - } - _onViewStateChange(event) { - var _a; - if ((_a = event.interactionState) === null || _a === void 0 ? void 0 : _a.isZooming) { - const currentState = this.bodyUILayer.state; - const zoomOpacity = Math.min(Math.max(1 - (event.viewState.zoom - 8.9) / 2, 0.05), 1.0); - if (currentState.zoomOpacity !== zoomOpacity) { - this.bodyUILayer.setState({ data: currentState.data, zoomOpacity }); - } - } - this.deck.setProps({ viewState: Object.assign({}, event.viewState) }); - this.sceneRotationSubject.next([event.viewState.rotationOrbit, event.viewState.rotationX]); - } - _onDragStart(info, e) { - this._dragEvent(info, e, this.nodeDragStartSubject); - } - _onDrag(info, e) { - this._dragEvent(info, e, this.nodeDragSubject); - } - _onDragEnd(info, e) { - this._dragEvent(info, e, this.nodeDragEndSubject); - } - _dragEvent(info, e, subject) { - var _a; - if ((_a = info === null || info === void 0 ? void 0 : info.object) === null || _a === void 0 ? void 0 : _a['@id']) { - subject.next({ node: info.object, info, e }); - } - } -} -__decorate([ - bind -], BodyUI.prototype, "_onHover", null); -__decorate([ - bind -], BodyUI.prototype, "_onClick", null); -__decorate([ - bind -], BodyUI.prototype, "_onViewStateChange", null); -__decorate([ - bind -], BodyUI.prototype, "_onDragStart", null); -__decorate([ - bind -], BodyUI.prototype, "_onDrag", null); -__decorate([ - bind -], BodyUI.prototype, "_onDragEnd", null); - -function simplifyScene(nodes) { - return __awaiter(this, void 0, void 0, function* () { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - const gltfCache = {}; - const gltfUrls = new Set(nodes.map(n => n.scenegraph).filter(n => !!n)); - for (const gltfUrl of gltfUrls) { - // eslint-disable-next-line no-await-in-loop - gltfCache[gltfUrl] = yield loadGLTF({ scenegraph: gltfUrl }); - } - const newNodes = nodes.filter(n => !n.scenegraph); - for (const model of nodes.filter(n => n.scenegraph)) { - const gltf = gltfCache[model.scenegraph]; - const bbox = new AABB(); - let worldMatrix = new Matrix4(model.transformMatrix); - /* eslint-disable */ - if (model.scenegraphNode) { - const scenegraphNode = model.scenegraphNode ? gltf.nodes.find((n) => n.name === model.scenegraphNode) : undefined; - let foundNodeInScene = false; - for (const scene of gltf.scenes) { - if (!foundNodeInScene) { - traverseScene(scene, new Matrix4(model.transformMatrix), (child, modelMatrix) => { - if (child === scenegraphNode) { - worldMatrix = modelMatrix; - foundNodeInScene = true; - return false; - } - return true; - }); - } - } - gltf.scene = { - id: model.scenegraphNode, - name: model.scenegraphNode, - nodes: [scenegraphNode] - }; - } - traverseScene(gltf.scene, worldMatrix, (node, modelMatrix) => { - if (node.mesh && node.mesh.primitives && node.mesh.primitives.length > 0) { - for (const primitive of node.mesh.primitives) { - if (primitive.attributes.POSITION && primitive.attributes.POSITION.min) { - const lowerBound = modelMatrix.transformAsPoint(primitive.attributes.POSITION.min, []); - const upperBound = modelMatrix.transformAsPoint(primitive.attributes.POSITION.max, []); - const innerBbox = new AABB({ - lowerBound: new Vec3(...lowerBound.map((n, i) => Math.min(n, upperBound[i]))), - upperBound: new Vec3(...upperBound.map((n, i) => Math.max(n, lowerBound[i]))) - }); - bbox.extend(innerBbox); - } - } - } - return true; - }); - /* eslint-enable */ - const size = bbox.upperBound.clone().vsub(bbox.lowerBound); - const halfSize = size.clone().vmul(new Vec3(0.5, 0.5, 0.5)); - const position = bbox.lowerBound.clone().vadd(halfSize); - const transformMatrix = new Matrix4(Matrix4.IDENTITY) - .translate(position.toArray()) - .scale(halfSize.toArray()); - const newNode = Object.assign(Object.assign({}, model), { transformMatrix, geometry: 'wireframe' }); - delete newNode.scenegraph; - delete newNode.scenegraphNode; - newNodes.push(newNode); - } - return newNodes; - }); -} - -// Hack to support deck.gl and other typings - -/** - * Generated bundle index. Do not edit. - */ - -export { BodyUI, BodyUILayer, deriveScenegraph, doCollisions, loadGLTF, loadGLTF2, processSceneNodes, registerGLTFLoaders, simplifyScene, traverseScene }; -//# sourceMappingURL=ccf-body-ui.js.map diff --git a/ccf-body-ui/fesm2015/ccf-body-ui.js.map b/ccf-body-ui/fesm2015/ccf-body-ui.js.map deleted file mode 100644 index ac9208ecc..000000000 --- a/ccf-body-ui/fesm2015/ccf-body-ui.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ccf-body-ui.js","sources":["../../../projects/ccf-body-ui/src/lib/util/scene-traversal.ts","../../../projects/ccf-body-ui/src/lib/util/load-gltf.ts","../../../projects/ccf-body-ui/src/lib/util/spatial-scene-collider.ts","../../../projects/ccf-body-ui/src/lib/body-ui-layer.ts","../../../projects/ccf-body-ui/src/lib/util/process-scene-nodes.ts","../../../projects/ccf-body-ui/src/lib/body-ui.ts","../../../projects/ccf-body-ui/src/lib/util/simplify-scene.ts","../../../projects/ccf-body-ui/src/public-api.ts","../../../projects/ccf-body-ui/src/ccf-body-ui.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unsafe-member-access */\nimport { Matrix4 } from '@math.gl/core';\n\n\nexport type SceneTraversalVisitor = (child, modelMatrix: Matrix4, parentMatrix: Matrix4) => boolean;\n\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nexport function traverseScene(scene, worldMatrix: Matrix4, visitor: SceneTraversalVisitor): boolean {\n if (!worldMatrix) {\n worldMatrix = new Matrix4(Matrix4.IDENTITY);\n }\n const matrix = new Matrix4(Matrix4.IDENTITY);\n if (!scene) {\n return true;\n } else if (scene.matrix) {\n matrix.copy(scene.matrix);\n } else {\n matrix.identity();\n\n if (scene.translation) {\n matrix.translate(scene.translation);\n }\n\n if (scene.rotation) {\n const rotationMatrix = new Matrix4(Matrix4.IDENTITY).fromQuaternion(scene.rotation);\n matrix.multiplyRight(rotationMatrix);\n }\n\n if (scene.scale) {\n matrix.scale(scene.scale);\n }\n }\n const modelMatrix = new Matrix4(worldMatrix).multiplyRight(matrix);\n if (visitor(scene, modelMatrix, worldMatrix) === false) {\n return false;\n }\n for (const child of (scene.nodes || scene.children || [])) {\n if (traverseScene(child, modelMatrix, visitor) === false) {\n return false;\n }\n }\n return true;\n}\n","/* eslint-disable @typescript-eslint/no-unsafe-call */\n/* eslint-disable @typescript-eslint/no-unsafe-member-access */\nimport { parse, registerLoaders } from '@loaders.gl/core';\nimport { DracoLoader, DracoWorkerLoader } from '@loaders.gl/draco';\nimport { GLTFLoader } from '@loaders.gl/gltf';\nimport { Matrix4 } from '@math.gl/core';\n\nimport { SpatialSceneNode } from '../shared/spatial-scene-node';\nimport { traverseScene } from './scene-traversal';\n\n\nexport function registerGLTFLoaders(): void {\n registerLoaders([DracoWorkerLoader, GLTFLoader]);\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types\nexport function deriveScenegraph(scenegraphNodeName: string, gltf: any): any {\n const scenegraphNode = gltf.nodes?.find((n) => n.name === scenegraphNodeName);\n if (scenegraphNode) {\n let foundNodeInScene = false;\n for (const scene of gltf.scenes) {\n if (!foundNodeInScene) {\n traverseScene(scene, new Matrix4(Matrix4.IDENTITY), (child, modelMatrix) => {\n if (child === scenegraphNode) {\n child.matrix = modelMatrix;\n child.translation = undefined;\n child.rotation = undefined;\n child.scale = undefined;\n foundNodeInScene = true;\n return false;\n }\n return true;\n });\n }\n }\n gltf.scene = {\n id: scenegraphNodeName,\n name: scenegraphNodeName,\n nodes: [scenegraphNode]\n };\n gltf.scenes = [gltf.scene];\n\n return { scene: gltf.scene, scenes: gltf.scenes };\n } else {\n return gltf;\n }\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport async function loadGLTF(model: SpatialSceneNode, cache?: { [url: string]: Promise }): Promise {\n const gltfUrl = model.scenegraph as string;\n let gltfPromise: Promise;\n if (cache) {\n gltfPromise = cache[gltfUrl] || (cache[gltfUrl] = fetch(gltfUrl).then(r => r.blob()));\n } else {\n gltfPromise = fetch(gltfUrl);\n }\n // eslint-disable-next-line @typescript-eslint/naming-convention\n const gltf = await parse(gltfPromise, GLTFLoader, { DracoLoader, gltf: { decompressMeshes: true, postProcess: true } });\n\n if (!gltf.nodes) {\n console.log('WARNING: Empty Scene', gltfUrl, gltf);\n }\n\n return deriveScenegraph(model.scenegraphNode as string, gltf);\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport async function loadGLTF2(scenegraphNodeName: string, gltfPromise: Promise): Promise {\n return deriveScenegraph(scenegraphNodeName, await gltfPromise);\n}\n/* eslint-enable */\n","import { load } from '@loaders.gl/core';\nimport { DracoLoader } from '@loaders.gl/draco';\nimport { GLTFLoader } from '@loaders.gl/gltf';\nimport { Matrix4 } from '@math.gl/core';\nimport { AABB, Vec3 } from 'cannon-es';\n\nimport { SpatialSceneNode } from '../shared/spatial-scene-node';\nimport { traverseScene } from './scene-traversal';\n\n\ninterface Collision {\n '@id': string;\n name: string;\n hits: { '@id': string; name: string }[];\n}\n\n/* eslint-disable */\nexport async function doCollisions(scene: SpatialSceneNode[]): Promise {\n console.log('Starting Collisioning');\n const sourceBoxes = scene\n .filter(d => !d.scenegraph && d.geometry !== 'wireframe')\n .map(model => {\n const mat = new Matrix4(model.transformMatrix);\n const lowerBound = mat.transformAsPoint([-1, -1, -1], []);\n const upperBound = mat.transformAsPoint([1, 1, 1], []);\n return {\n '@id': model['@id'],\n name: model.tooltip,\n entityId: model.entityId,\n bbox: new AABB({\n lowerBound: new Vec3(...lowerBound.map((n, i) => Math.min(n, upperBound[i]))),\n upperBound: new Vec3(...upperBound.map((n, i) => Math.max(n, lowerBound[i])))\n })\n };\n });\n\n const targetBoxes: {'@id': string, name: string, entityId?: string; bbox: AABB, gltf: unknown}[] = [];\n for (const model of scene.filter(d => !!d.scenegraph)) {\n const gltf = await load(model.scenegraph as string, GLTFLoader, {DracoLoader, decompress: true, postProcess: true});\n for (const gltfScene of gltf.scenes) {\n traverseScene(gltfScene, new Matrix4(model.transformMatrix), (node, modelMatrix) => {\n if (node.mesh && node.mesh.primitives && node.mesh.primitives.length > 0) {\n for (const primitive of node.mesh.primitives) {\n if (primitive.attributes.POSITION && primitive.attributes.POSITION.min) {\n const lowerBound = modelMatrix.transformAsPoint(primitive.attributes.POSITION.min, []);\n const upperBound = modelMatrix.transformAsPoint(primitive.attributes.POSITION.max, []);\n targetBoxes.push({\n '@id': model['@id'],\n name: node.name,\n entityId: model.entityId,\n bbox: new AABB({\n lowerBound: new Vec3(...lowerBound.map((n, i) => Math.min(n, upperBound[i]))),\n upperBound: new Vec3(...upperBound.map((n, i) => Math.max(n, lowerBound[i])))\n }),\n gltf\n });\n }\n }\n }\n return true;\n });\n }\n }\n\n const report: Collision[] = [];\n const sad: unknown[] = [];\n for (const src of sourceBoxes) {\n const hits: {'@id': string, name: string}[] = [];\n for (const target of targetBoxes) {\n if (src.bbox.overlaps(target.bbox)) {\n hits.push({'@id': target['@id'], name: target.name});\n }\n }\n if (hits.length > 0) {\n report.push({\n '@id': src.entityId as string,\n name: src.name as string,\n hits\n });\n } else {\n sad.push(src);\n }\n }\n\n console.log({ sourceBoxes, targetBoxes, report, sad, maxHits: Math.max(...report.map(r => r.hits.length)) });\n\n const csvReport: unknown[] = [];\n for (const hit of report) {\n csvReport.push({\n 'Tissue ID': hit['@id'],\n 'Tissue Name': hit.name,\n 'Hit ID': '',\n 'Hit Name': ''\n });\n for (const h of hit.hits) {\n csvReport.push({\n 'Tissue ID': hit['@id'],\n 'Tissue Name': hit.name,\n 'Hit ID': h['@id'],\n 'Hit Name': h.name\n });\n }\n }\n console.log(csvReport);\n\n return report;\n}\n/* eslint-enable */\n","/* eslint-disable @typescript-eslint/no-unsafe-call */\nimport { CompositeLayer, COORDINATE_SYSTEM } from '@deck.gl/core';\nimport { TextLayer } from '@deck.gl/layers';\nimport { ScenegraphLayer, SimpleMeshLayer } from '@deck.gl/mesh-layers';\nimport { ConeGeometry, CubeGeometry, CylinderGeometry, Geometry, SphereGeometry } from '@luma.gl/core';\nimport { Matrix4 } from '@math.gl/core';\n\nimport { SpatialSceneNode } from './shared/spatial-scene-node';\nimport { loadGLTF, loadGLTF2, registerGLTFLoaders } from './util/load-gltf';\nimport { doCollisions } from './util/spatial-scene-collider';\n\n\nfunction meshLayer(id: string, data: SpatialSceneNode[], options: { [key: string]: unknown }): SimpleMeshLayer | undefined {\n if (!data || data.length === 0) {\n return undefined;\n } else {\n let mesh: Geometry;\n switch (options.geometry) {\n case 'sphere':\n mesh = new SphereGeometry();\n break;\n case 'cone':\n mesh = new ConeGeometry();\n break;\n case 'cylinder':\n mesh = new CylinderGeometry();\n break;\n case 'cube':\n default:\n mesh = new CubeGeometry();\n break;\n }\n return new SimpleMeshLayer({\n ...{\n id,\n pickable: true,\n autoHighlight: false,\n highlightColor: [30, 136, 229, 255],\n coordinateSystem: COORDINATE_SYSTEM.CARTESIAN,\n data,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n mesh: mesh as any,\n wireframe: false,\n getTransformMatrix: (d) => (d as { transformMatrix: number[][] }).transformMatrix,\n getColor: (d) => (d as { color: [number, number, number, number] }).color || [255, 255, 255, 0.9*255]\n },\n ...options\n });\n }\n}\n\nfunction textLayer(id: string, data: SpatialSceneNode[], options: { [key: string]: unknown }): TextLayer | undefined {\n if (!data || data.length === 0) {\n return undefined;\n } else {\n return new TextLayer({\n ...{\n id,\n pickable: true,\n data: data.map(d => ({ ...d, position: new Matrix4(d.transformMatrix).getTranslation() })),\n getText: (d) => (d as { text: string }).text,\n getPosition: (d) => (d as { position: [number, number] }).position,\n getColor: (d) => (d as { color: [number, number, number, number] }).color\n },\n ...options\n });\n }\n}\n\nexport class BodyUILayer extends CompositeLayer {\n static readonly layerName = 'BodyUILayer';\n static readonly gltfCache: { [url: string]: Promise } = {};\n\n initializeState(): void {\n const { data } = this.props;\n this.setState({ data: data ?? [], zoomOpacity: 0.8, doCollisions: false });\n registerGLTFLoaders();\n }\n\n renderLayers(): unknown[] {\n const state = this.state as { data: SpatialSceneNode[]; zoomOpacity: number; doCollisions: boolean };\n const geometries: Record = {\n 'sphere': [], 'cone': [], 'cylinder': [], 'cube': [], 'text': [], 'wireframe': [], 'scenegraph': []\n };\n\n for (const node of state.data) {\n const geometry = node.geometry ?? 'cube';\n if (node.scenegraph) {\n geometries.scenegraph.push(node);\n } else if (geometries[geometry] !== undefined) {\n geometries[geometry].push(node);\n }\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const url2gltf: { [url: string]: Promise } = {};\n for (const m of geometries.scenegraph) {\n if (m.scenegraph && m.scenegraphNode && !Object.prototype.hasOwnProperty.call(url2gltf, m.scenegraph)) {\n url2gltf[m.scenegraph] = loadGLTF({ scenegraph: m.scenegraph } as SpatialSceneNode, BodyUILayer.gltfCache);\n }\n }\n\n const layers: unknown[] = [];\n for (const [geometry, nodes] of Object.entries(geometries)) {\n if (geometry === 'scenegraph') {\n for (const model of nodes) {\n layers.push(\n new ScenegraphLayer({\n id: 'models-' + model['@id'],\n opacity: model.zoomBasedOpacity ? state.zoomOpacity : (model.opacity !== undefined ? model.opacity : 1.0),\n pickable: !model.unpickable,\n coordinateSystem: COORDINATE_SYSTEM.CARTESIAN,\n data: [model],\n scenegraph: model.scenegraphNode ?\n loadGLTF2(model.scenegraphNode, url2gltf[model.scenegraph as string]) :\n model.scenegraph as unknown as URL,\n // eslint-disable-next-line @typescript-eslint/naming-convention\n _lighting: model._lighting, // 'pbr' | undefined\n getTransformMatrix: model.transformMatrix as unknown as number[][],\n getColor: model.color ?? [0, 255, 0, 0.5*255],\n parameters: { depthMask: !model.zoomBasedOpacity && (model.opacity === undefined || model.opacity === 1) }\n })\n );\n }\n } else if (geometry === 'text') {\n layers.push(textLayer('text', nodes.filter(n => n.unpickable), { pickable: false }));\n layers.push(textLayer('textPickable', nodes.filter(n => !n.unpickable), { pickable: true }));\n } else if (geometry === 'wireframe') {\n layers.push(meshLayer(geometry, nodes, { wireframe: true, pickable: false, geometry }));\n } else {\n layers.push(meshLayer(geometry, nodes.filter(n => n.unpickable), { wireframe: false, pickable: false, geometry }));\n layers.push(meshLayer(`${geometry}Pickable`, nodes.filter(n => !n.unpickable), { wireframe: false, pickable: true, geometry }));\n }\n }\n\n if (state.doCollisions) {\n doCollisions(state.data);\n }\n\n return layers.filter(l => !!l);\n }\n\n getPickingInfo(\n e: Parameters['getPickingInfo']>[0]\n ): ReturnType['getPickingInfo']> {\n return e.info;\n }\n}\n","import { Matrix4 } from '@math.gl/core';\nimport { AABB, Vec3 } from 'cannon-es';\n\nimport { loadGLTF, registerGLTFLoaders } from './load-gltf';\nimport { traverseScene } from './scene-traversal';\nimport { SpatialSceneNode } from '../shared/spatial-scene-node';\n\n\nexport interface ProcessedNode extends SpatialSceneNode {\n bbox: AABB;\n jsonld: unknown;\n node: unknown;\n size: Vec3;\n center: Vec3;\n}\n\n/* eslint-disable */\nfunction childNames(scene, names: string[] = []): string[] {\n for (const child of (scene.nodes || scene.children || [])) {\n names.push(child.name);\n childNames(child, names);\n }\n return names;\n}\n\nexport async function processSceneNodes(gltfUrl: string, worldMatrix?: Matrix4, scenegraphNode?: string\n ): Promise<{ [node: string]: ProcessedNode}> {\n registerGLTFLoaders();\n const gltf = await loadGLTF({scenegraph: gltfUrl, scenegraphNode} as SpatialSceneNode);\n const nodes: {[node: string]: ProcessedNode} = {};\n const gltfNodes: ProcessedNode[] = [];\n for (const scene of gltf.scenes) {\n worldMatrix = new Matrix4(worldMatrix || Matrix4.IDENTITY);\n traverseScene(scene, worldMatrix, (node, modelMatrix: Matrix4) => {\n const processedNode: ProcessedNode = {\n '@id': (node.name || node.id) as string,\n '@type': 'ProcessedNode',\n transformMatrix: new Matrix4(modelMatrix),\n geometry: 'wireframe',\n node\n } as ProcessedNode;\n gltfNodes.push({\n '@id': `GLTF:${processedNode['@id']}`,\n '@type': 'GLTFNode',\n scenegraph: gltfUrl,\n scenegraphNode: processedNode['@id'],\n transformMatrix: new Matrix4(worldMatrix || Matrix4.IDENTITY),\n tooltip: (node.name || node.id) as string,\n color: [255, 255, 255, 255],\n _lighting: 'pbr',\n zoomBasedOpacity: true,\n node\n } as ProcessedNode);\n if (node.mesh && node.mesh.primitives && node.mesh.primitives.length > 0) {\n for (const primitive of node.mesh.primitives) {\n if (primitive.attributes.POSITION && primitive.attributes.POSITION.min) {\n const lowerBound = modelMatrix.transformAsPoint(primitive.attributes.POSITION.min, []);\n const upperBound = modelMatrix.transformAsPoint(primitive.attributes.POSITION.max, []);\n processedNode.bbox = new AABB({\n lowerBound: new Vec3(...lowerBound.map((n, i) => Math.min(n, upperBound[i]))),\n upperBound: new Vec3(...upperBound.map((n, i) => Math.max(n, lowerBound[i])))\n });\n }\n }\n }\n nodes[processedNode['@id']] = processedNode;\n return true;\n });\n }\n\n for (const node of Object.values(nodes).filter(n => !n.bbox)) {\n for (const child of childNames(node.node).map(n => nodes[n]).filter(n => n.bbox)) {\n if (!node.bbox) {\n node.bbox = child.bbox.clone();\n } else {\n node.bbox.extend(child.bbox);\n }\n }\n if (!node.bbox) {\n delete nodes[node['@id']];\n }\n }\n for (const node of Object.values(nodes)) {\n const lb = node.bbox.lowerBound;\n const ub = node.bbox.upperBound;\n const size = node.size = ub.clone().vsub(lb);\n const halfSize = size.clone().vmul(new Vec3(0.5, 0.5, 0.5));\n const center = node.center = lb.clone().vadd(halfSize);\n\n node.transformMatrix = new Matrix4(Matrix4.IDENTITY)\n .translate(center.toArray())\n .scale(halfSize.toArray());\n }\n for (const node of gltfNodes) {\n nodes[node['@id']] = node;\n }\n return nodes;\n}\n/* eslint-enable */\n","/* eslint-disable @typescript-eslint/consistent-type-assertions */\n/* eslint-disable @typescript-eslint/member-ordering */\nimport { AmbientLight, Deck, LightingEffect, OrbitView, OrthographicView } from '@deck.gl/core';\nimport { ViewStateProps } from '@deck.gl/core/lib/deck';\nimport { Matrix4 } from '@math.gl/core';\nimport bind from 'bind-decorator';\nimport { BehaviorSubject, Subject } from 'rxjs';\nimport { share } from 'rxjs/operators';\n\nimport { BodyUILayer } from './body-ui-layer';\nimport { SpatialSceneNode } from './shared/spatial-scene-node';\nimport { processSceneNodes } from './util/process-scene-nodes';\n\n\ninterface BodyUIViewStateProps extends ViewStateProps {\n orbitAxis?: string;\n target?: Matrix4 | number[];\n zoom: number;\n rotationOrbit: number;\n rotationX: number;\n camera: string;\n}\n\nexport interface BodyUIProps {\n id: string;\n canvas: string | HTMLCanvasElement;\n parent: HTMLElement;\n debugSceneNodeProcessing?: boolean;\n target: Matrix4 | number[];\n interactive: boolean;\n rotation: number;\n minRotationX: number;\n maxRotationX: number;\n zoom: number;\n legacyLighting?: boolean;\n camera: string;\n}\n\nexport interface PickInfo {\n layer: unknown;\n index: number;\n object: D;\n x: number;\n y: number;\n coordinate?: unknown;\n picked?: boolean;\n}\n\nexport type NodeDragEvent = { node: SpatialSceneNode; info: PickInfo; e: MouseEvent };\n\nexport type NodeClickEvent = { node: SpatialSceneNode; ctrlClick: boolean };\n\n/**\n * A convenience wrapper class for the CCF Body UI\n */\nexport class BodyUI {\n deck: Deck;\n private readonly bodyUILayer = new BodyUILayer({});\n\n private readonly nodeClickSubject = new Subject();\n private readonly nodeHoverStartSubject = new Subject();\n private readonly nodeHoverStopSubject = new Subject();\n private readonly sceneRotationSubject = new BehaviorSubject<[number, number]>([0, 0]);\n private readonly nodeDragStartSubject = new Subject();\n private readonly nodeDragSubject = new Subject();\n private readonly nodeDragEndSubject = new Subject();\n\n readonly nodeClick$ = this.nodeClickSubject.pipe(share());\n readonly nodeHoverStart$ = this.nodeHoverStartSubject.pipe(share());\n readonly nodeHoverStop$ = this.nodeHoverStopSubject.pipe(share());\n readonly sceneRotation$ = this.sceneRotationSubject.pipe(share());\n readonly nodeDragStart$ = this.nodeDragStartSubject.pipe(share());\n readonly nodeDrag$ = this.nodeDragSubject.pipe(share());\n readonly nodeDragEnd$ = this.nodeDragEndSubject.pipe(share());\n\n private cursor?: string;\n private lastHovered?: SpatialSceneNode;\n\n constructor(private deckProps: Partial) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const props: any = {\n ...deckProps,\n views: [ deckProps.camera === 'orthographic' ? new OrthographicView({\n flipY: false,\n near: -1000\n }) : new OrbitView({ orbitAxis: 'Y' }) ],\n controller: deckProps.interactive !== undefined ? deckProps.interactive : true,\n layers: [ this.bodyUILayer ],\n onHover: this._onHover,\n onClick: this._onClick,\n onViewStateChange: this._onViewStateChange,\n onDragStart: this._onDragStart,\n onDrag: this._onDrag,\n onDragEnd: this._onDragEnd,\n getCursor: (e: { isDragging: boolean }) => this.cursor ?? (e.isDragging ? 'grabbing' : 'grab')\n };\n if (deckProps.legacyLighting) {\n // eslint-disable-next-line\n props.effects = [\n new LightingEffect({\n ambientLight: new AmbientLight({\n color: [255, 255, 255],\n intensity: 10.0\n })\n })\n ];\n }\n // eslint-disable-next-line\n this.deck = new Deck(props);\n this.deck.setProps({\n viewState: {\n orbitAxis: 'Y',\n minRotationX: deckProps.minRotationX ?? -15,\n maxRotationX: deckProps.maxRotationX ?? 15,\n target: deckProps.target ?? [0.5, 0.5, 0],\n rotationX: 0,\n rotationOrbit: deckProps.rotation ?? 0,\n zoom: deckProps.zoom ?? 9.5,\n camera: deckProps.camera\n } as BodyUIViewStateProps\n });\n if (deckProps.rotation) {\n this.sceneRotationSubject.next([deckProps.rotation, 0]);\n }\n }\n\n async initialize(): Promise {\n while (!this.bodyUILayer.state) {\n // eslint-disable-next-line no-await-in-loop\n await new Promise(r => {\n setTimeout(r, 200);\n });\n }\n }\n\n finalize(): void {\n this.deck.finalize();\n }\n\n setScene(data: SpatialSceneNode[]): void {\n if (data?.length > 0) {\n let zoomOpacity = (this.bodyUILayer.state as { zoomOpacity: number }).zoomOpacity;\n let didZoom = false;\n for (const node of data) {\n if (node.zoomToOnLoad) {\n this.zoomTo(node);\n didZoom = true;\n }\n }\n zoomOpacity = didZoom ? 0.05 : zoomOpacity;\n if (!this.deckProps.debugSceneNodeProcessing) {\n this.bodyUILayer.setState({ data, zoomOpacity });\n } else {\n this.debugSceneNodeProcessing(data, zoomOpacity);\n }\n }\n }\n\n debugSceneNodeProcessing(data: SpatialSceneNode[], zoomOpacity: number): void {\n // const gltfUrl = 'https://hubmapconsortium.github.io/ccf-3d-reference-object-library/VH_Male/United/VHM_United_Color.glb';\n const gltfUrl = 'https://hubmapconsortium.github.io/ccf-3d-reference-object-library/VH_Female/United/VHF_United_Color.glb';\n // const gltfUrl = 'https://hubmapconsortium.github.io/hubmap-ontology/objects/VHF_United_v01_060420.glb';\n const gltfTransform = new Matrix4([0.076,0,0,0,0,0.076,1.6875389974302382e-17,0,0,-1.6875389974302382e-17,0.076,0,0.49,0.034,0.11,1]);\n processSceneNodes(gltfUrl, gltfTransform, 'VHF_Kidney_L_Low1').then((results) => {\n console.log('results', results);\n console.log('data', data);\n // data = Object.values(results);\n data = data.concat(Object.values(results));\n data.push({\n '@id': 'TEST',\n '@type': 'TEST',\n scenegraph: gltfUrl,\n scenegraphNode: 'VHF_Kidney_R_Low',\n transformMatrix: gltfTransform,\n color: [255, 255, 255, 200],\n // eslint-disable-next-line @typescript-eslint/naming-convention\n _lighting: 'pbr',\n zoomBasedOpacity: false\n });\n this.bodyUILayer.setState({ data, zoomOpacity });\n });\n }\n\n zoomTo(node: SpatialSceneNode): void {\n const matrix = new Matrix4(node.transformMatrix);\n this.deck.setProps({\n viewState: {\n ...this.deck.props.viewState,\n target: matrix.getTranslation(),\n rotationX: 0,\n rotationOrbit: 0,\n zoom: 11.5,\n } as BodyUIViewStateProps\n });\n }\n\n setRotation(value: number): void {\n this.deck.setProps({\n viewState: {\n ...this.deck.props.viewState,\n rotationOrbit: value\n } as BodyUIViewStateProps\n });\n }\n\n setRotationX(value: number): void {\n this.deck.setProps({\n viewState: {\n ...this.deck.props.viewState,\n rotationX: value\n } as BodyUIViewStateProps\n });\n }\n\n setZoom(value: number): void {\n this.deck.setProps({\n viewState: {\n ...this.deck.props.viewState,\n zoom: value\n } as BodyUIViewStateProps\n });\n }\n\n setTarget(value: number[]): void {\n this.deck.setProps({\n viewState: {\n ...this.deck.props.viewState,\n target: value\n } as BodyUIViewStateProps\n });\n }\n\n setInteractive(value: boolean): void {\n this.deck.setProps({\n controller: value\n });\n }\n\n @bind\n private _onHover(e: { picked: boolean; object: SpatialSceneNode }): void {\n const { lastHovered } = this;\n this.cursor = e.picked ? 'pointer' : undefined;\n if (e.picked && e.object && e.object['@id']) {\n if (lastHovered !== e.object) {\n if (lastHovered) {\n this.nodeHoverStopSubject.next(lastHovered);\n }\n this.lastHovered = e.object;\n this.nodeHoverStartSubject.next(e.object);\n }\n } else if (lastHovered) {\n this.nodeHoverStopSubject.next(lastHovered);\n this.lastHovered = undefined;\n }\n }\n\n @bind\n private _onClick(info: PickInfo, e: { srcEvent: { ctrlKey: boolean } }): void {\n if (info.picked && info.object && info.object['@id']) {\n this.nodeClickSubject.next({ node: info.object, ctrlClick: e?.srcEvent?.ctrlKey ?? undefined });\n }\n }\n\n @bind\n private _onViewStateChange(event: { interactionState: { isZooming: boolean }; viewState: BodyUIViewStateProps }): void {\n if (event.interactionState?.isZooming) {\n const currentState = this.bodyUILayer.state as { zoomOpacity: number; data: unknown };\n const zoomOpacity = Math.min(Math.max(1 - (event.viewState.zoom - 8.9) / 2, 0.05), 1.0);\n if (currentState.zoomOpacity !== zoomOpacity) {\n this.bodyUILayer.setState({ data: currentState.data, zoomOpacity });\n }\n }\n this.deck.setProps({ viewState: { ...event.viewState } });\n this.sceneRotationSubject.next([event.viewState.rotationOrbit, event.viewState.rotationX]);\n }\n\n @bind\n private _onDragStart(info: PickInfo, e: MouseEvent): void {\n this._dragEvent(info, e, this.nodeDragStartSubject);\n }\n\n @bind\n private _onDrag(info: PickInfo, e: MouseEvent): void {\n this._dragEvent(info, e, this.nodeDragSubject);\n }\n\n @bind\n private _onDragEnd(info: PickInfo, e: MouseEvent): void {\n this._dragEvent(info, e, this.nodeDragEndSubject);\n }\n\n private _dragEvent(info: PickInfo, e: MouseEvent, subject: Subject): void {\n if (info?.object?.['@id']) {\n subject.next({ node: info.object, info, e });\n }\n }\n}\n","import { Matrix4 } from '@math.gl/core';\nimport { AABB, Vec3 } from 'cannon-es';\n\nimport { SpatialSceneNode } from '../shared/spatial-scene-node';\nimport { loadGLTF } from './load-gltf';\nimport { traverseScene } from './scene-traversal';\n\n\nexport async function simplifyScene(nodes: SpatialSceneNode[]): Promise {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const gltfCache: { [url: string]: any } = {};\n const gltfUrls = new Set(nodes.map(n => n.scenegraph).filter(n => !!n));\n for (const gltfUrl of gltfUrls) {\n // eslint-disable-next-line no-await-in-loop\n gltfCache[gltfUrl as string] = await loadGLTF({ scenegraph: gltfUrl } as SpatialSceneNode);\n }\n const newNodes: SpatialSceneNode[] = nodes.filter(n => !n.scenegraph);\n\n for (const model of nodes.filter(n => n.scenegraph)) {\n const gltf = gltfCache[model.scenegraph as string];\n const bbox = new AABB();\n let worldMatrix = new Matrix4(model.transformMatrix);\n\n /* eslint-disable */\n if (model.scenegraphNode) {\n const scenegraphNode = model.scenegraphNode ? gltf.nodes.find((n) => n.name === model.scenegraphNode) : undefined;\n let foundNodeInScene = false;\n for (const scene of gltf.scenes) {\n if (!foundNodeInScene) {\n traverseScene(scene, new Matrix4(model.transformMatrix), (child, modelMatrix) => {\n if (child === scenegraphNode) {\n worldMatrix = modelMatrix;\n foundNodeInScene = true;\n return false;\n }\n return true;\n });\n }\n }\n gltf.scene = {\n id: model.scenegraphNode,\n name: model.scenegraphNode,\n nodes: [scenegraphNode]\n };\n }\n\n traverseScene(gltf.scene, worldMatrix, (node, modelMatrix) => {\n if (node.mesh && node.mesh.primitives && node.mesh.primitives.length > 0) {\n for (const primitive of node.mesh.primitives) {\n if (primitive.attributes.POSITION && primitive.attributes.POSITION.min) {\n const lowerBound = modelMatrix.transformAsPoint(primitive.attributes.POSITION.min, []);\n const upperBound = modelMatrix.transformAsPoint(primitive.attributes.POSITION.max, []);\n const innerBbox = new AABB({\n lowerBound: new Vec3(...lowerBound.map((n, i) => Math.min(n, upperBound[i]))),\n upperBound: new Vec3(...upperBound.map((n, i) => Math.max(n, lowerBound[i])))\n });\n bbox.extend(innerBbox);\n }\n }\n }\n return true;\n });\n /* eslint-enable */\n\n const size = bbox.upperBound.clone().vsub(bbox.lowerBound);\n const halfSize = size.clone().vmul(new Vec3(0.5, 0.5, 0.5));\n const position = bbox.lowerBound.clone().vadd(halfSize);\n const transformMatrix = new Matrix4(Matrix4.IDENTITY)\n .translate(position.toArray())\n .scale(halfSize.toArray());\n const newNode: SpatialSceneNode = {\n ...model,\n transformMatrix,\n geometry: 'wireframe'\n };\n delete newNode.scenegraph;\n delete newNode.scenegraphNode;\n\n newNodes.push(newNode);\n }\n return newNodes;\n}\n","// Hack to support deck.gl and other typings\n// eslint-disable-next-line @typescript-eslint/triple-slash-reference\n/// \n\n/*\n * Public API Surface of ccf-body-ui\n */\nexport * from './lib/body-ui-layer';\nexport * from './lib/body-ui';\nexport * from './lib/shared/spatial-scene-node';\nexport * from './lib/shared/ccf-spatial-jsonld';\n\nexport * from './lib/util/load-gltf';\nexport * from './lib/util/scene-traversal';\nexport * from './lib/util/spatial-scene-collider';\nexport * from './lib/util/process-scene-nodes';\nexport * from './lib/util/simplify-scene';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA;AAMA;SACgB,aAAa,CAAC,KAAK,EAAE,WAAoB,EAAE,OAA8B;IACvF,IAAI,CAAC,WAAW,EAAE;QAChB,WAAW,GAAG,IAAI,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;KAC7C;IACD,MAAM,MAAM,GAAG,IAAI,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC7C,IAAI,CAAC,KAAK,EAAE;QACV,OAAO,IAAI,CAAC;KACb;SAAM,IAAI,KAAK,CAAC,MAAM,EAAE;QACvB,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;KAC3B;SAAM;QACL,MAAM,CAAC,QAAQ,EAAE,CAAC;QAElB,IAAI,KAAK,CAAC,WAAW,EAAE;YACrB,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;SACrC;QAED,IAAI,KAAK,CAAC,QAAQ,EAAE;YAClB,MAAM,cAAc,GAAG,IAAI,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,cAAc,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;YACpF,MAAM,CAAC,aAAa,CAAC,cAAc,CAAC,CAAC;SACtC;QAED,IAAI,KAAK,CAAC,KAAK,EAAE;YACf,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;SAC3B;KACF;IACD,MAAM,WAAW,GAAG,IAAI,OAAO,CAAC,WAAW,CAAC,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;IACnE,IAAI,OAAO,CAAC,KAAK,EAAE,WAAW,EAAE,WAAW,CAAC,KAAK,KAAK,EAAE;QACtD,OAAO,KAAK,CAAC;KACd;IACD,KAAK,MAAM,KAAK,KAAK,KAAK,CAAC,KAAK,IAAI,KAAK,CAAC,QAAQ,IAAI,EAAE,GAAG;QACzD,IAAI,aAAa,CAAC,KAAK,EAAE,WAAW,EAAE,OAAO,CAAC,KAAK,KAAK,EAAE;YACxD,OAAO,KAAK,CAAC;SACd;KACF;IACD,OAAO,IAAI,CAAC;AACd;;SC/BgB,mBAAmB;IACjC,eAAe,CAAC,CAAC,iBAAiB,EAAE,UAAU,CAAC,CAAC,CAAC;AACnD,CAAC;AAED;SACgB,gBAAgB,CAAC,kBAA0B,EAAE,IAAS;;IACpE,MAAM,cAAc,GAAG,MAAA,IAAI,CAAC,KAAK,0CAAE,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,KAAK,kBAAkB,CAAC,CAAC;IAC9E,IAAI,cAAc,EAAE;QAClB,IAAI,gBAAgB,GAAG,KAAK,CAAC;QAC7B,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,MAAM,EAAE;YAC/B,IAAI,CAAC,gBAAgB,EAAE;gBACrB,aAAa,CAAC,KAAK,EAAE,IAAI,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,WAAW;oBACrE,IAAI,KAAK,KAAK,cAAc,EAAE;wBAC5B,KAAK,CAAC,MAAM,GAAG,WAAW,CAAC;wBAC3B,KAAK,CAAC,WAAW,GAAG,SAAS,CAAC;wBAC9B,KAAK,CAAC,QAAQ,GAAG,SAAS,CAAC;wBAC3B,KAAK,CAAC,KAAK,GAAG,SAAS,CAAC;wBACxB,gBAAgB,GAAG,IAAI,CAAC;wBACxB,OAAO,KAAK,CAAC;qBACd;oBACD,OAAO,IAAI,CAAC;iBACb,CAAC,CAAC;aACJ;SACF;QACD,IAAI,CAAC,KAAK,GAAG;YACX,EAAE,EAAE,kBAAkB;YACtB,IAAI,EAAE,kBAAkB;YACxB,KAAK,EAAE,CAAC,cAAc,CAAC;SACxB,CAAC;QACF,IAAI,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAE3B,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC;KACnD;SAAM;QACL,OAAO,IAAI,CAAC;KACb;AACH,CAAC;AAED;SACsB,QAAQ,CAAC,KAAuB,EAAE,KAAwC;;QAC9F,MAAM,OAAO,GAAG,KAAK,CAAC,UAAoB,CAAC;QAC3C,IAAI,WAAqC,CAAC;QAC1C,IAAI,KAAK,EAAE;YACT,WAAW,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,KAAK,CAAC,OAAO,CAAC,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;SACvF;aAAM;YACL,WAAW,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC;SAC9B;;QAED,MAAM,IAAI,GAAG,MAAM,KAAK,CAAC,WAAW,EAAE,UAAU,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,EAAE,gBAAgB,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;QAExH,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE;YACf,OAAO,CAAC,GAAG,CAAC,sBAAsB,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;SACpD;QAED,OAAO,gBAAgB,CAAC,KAAK,CAAC,cAAwB,EAAE,IAAI,CAAC,CAAC;KAC/D;CAAA;AAED;SACsB,SAAS,CAAC,kBAA0B,EAAE,WAAyB;;QACnF,OAAO,gBAAgB,CAAC,kBAAkB,EAAE,MAAM,WAAW,CAAC,CAAC;KAChE;CAAA;AACD;;ACvDA;SACsB,YAAY,CAAC,KAAyB;;QAC1D,OAAO,CAAC,GAAG,CAAC,uBAAuB,CAAC,CAAC;QACrC,MAAM,WAAW,GAAG,KAAK;aACtB,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,UAAU,IAAI,CAAC,CAAC,QAAQ,KAAK,WAAW,CAAC;aACxD,GAAG,CAAC,KAAK;YACR,MAAM,GAAG,GAAG,IAAI,OAAO,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC;YAC/C,MAAM,UAAU,GAAG,GAAG,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YAC1D,MAAM,UAAU,GAAG,GAAG,CAAC,gBAAgB,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YACvD,OAAO;gBACL,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC;gBACnB,IAAI,EAAE,KAAK,CAAC,OAAO;gBACnB,QAAQ,EAAE,KAAK,CAAC,QAAQ;gBACxB,IAAI,EAAE,IAAI,IAAI,CAAC;oBACb,UAAU,EAAE,IAAI,IAAI,CAAC,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;oBAC7E,UAAU,EAAE,IAAI,IAAI,CAAC,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;iBAC9E,CAAC;aACH,CAAC;SACH,CAAC,CAAC;QAEL,MAAM,WAAW,GAAkF,EAAE,CAAC;QACtG,KAAK,MAAM,KAAK,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,EAAE;YACrD,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,UAAoB,EAAE,UAAU,EAAE,EAAC,WAAW,EAAE,UAAU,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAC,CAAC,CAAC;YACpH,KAAK,MAAM,SAAS,IAAI,IAAI,CAAC,MAAM,EAAE;gBACnC,aAAa,CAAC,SAAS,EAAE,IAAI,OAAO,CAAC,KAAK,CAAC,eAAe,CAAC,EAAE,CAAC,IAAI,EAAE,WAAW;oBAC7E,IAAI,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE;wBACxE,KAAK,MAAM,SAAS,IAAI,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE;4BAC5C,IAAI,SAAS,CAAC,UAAU,CAAC,QAAQ,IAAI,SAAS,CAAC,UAAU,CAAC,QAAQ,CAAC,GAAG,EAAE;gCACtE,MAAM,UAAU,GAAG,WAAW,CAAC,gBAAgB,CAAC,SAAS,CAAC,UAAU,CAAC,QAAQ,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;gCACvF,MAAM,UAAU,GAAG,WAAW,CAAC,gBAAgB,CAAC,SAAS,CAAC,UAAU,CAAC,QAAQ,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;gCACvF,WAAW,CAAC,IAAI,CAAC;oCACf,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC;oCACnB,IAAI,EAAE,IAAI,CAAC,IAAI;oCACf,QAAQ,EAAE,KAAK,CAAC,QAAQ;oCACxB,IAAI,EAAE,IAAI,IAAI,CAAC;wCACb,UAAU,EAAE,IAAI,IAAI,CAAC,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;wCAC7E,UAAU,EAAE,IAAI,IAAI,CAAC,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;qCAC9E,CAAC;oCACF,IAAI;iCACL,CAAC,CAAC;6BACJ;yBACF;qBACF;oBACD,OAAO,IAAI,CAAC;iBACb,CAAC,CAAC;aACJ;SACF;QAED,MAAM,MAAM,GAAgB,EAAE,CAAC;QAC/B,MAAM,GAAG,GAAc,EAAE,CAAC;QAC1B,KAAK,MAAM,GAAG,IAAI,WAAW,EAAE;YAC7B,MAAM,IAAI,GAAoC,EAAE,CAAC;YACjD,KAAK,MAAM,MAAM,IAAI,WAAW,EAAE;gBAChC,IAAI,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE;oBAClC,IAAI,CAAC,IAAI,CAAC,EAAC,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAC,CAAC,CAAC;iBACtD;aACF;YACD,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE;gBACnB,MAAM,CAAC,IAAI,CAAC;oBACV,KAAK,EAAE,GAAG,CAAC,QAAkB;oBAC7B,IAAI,EAAE,GAAG,CAAC,IAAc;oBACxB,IAAI;iBACL,CAAC,CAAC;aACJ;iBAAM;gBACL,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;aACf;SACF;QAED,OAAO,CAAC,GAAG,CAAC,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC;QAE7G,MAAM,SAAS,GAAc,EAAE,CAAC;QAChC,KAAK,MAAM,GAAG,IAAI,MAAM,EAAE;YACxB,SAAS,CAAC,IAAI,CAAC;gBACb,WAAW,EAAE,GAAG,CAAC,KAAK,CAAC;gBACvB,aAAa,EAAE,GAAG,CAAC,IAAI;gBACvB,QAAQ,EAAE,EAAE;gBACZ,UAAU,EAAE,EAAE;aACf,CAAC,CAAC;YACH,KAAK,MAAM,CAAC,IAAI,GAAG,CAAC,IAAI,EAAE;gBACxB,SAAS,CAAC,IAAI,CAAC;oBACb,WAAW,EAAE,GAAG,CAAC,KAAK,CAAC;oBACvB,aAAa,EAAE,GAAG,CAAC,IAAI;oBACvB,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC;oBAClB,UAAU,EAAE,CAAC,CAAC,IAAI;iBACnB,CAAC,CAAC;aACJ;SACF;QACD,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QAEvB,OAAO,MAAM,CAAC;KACf;CAAA;AACD;;AC3GA;AAYA,SAAS,SAAS,CAAC,EAAU,EAAE,IAAwB,EAAE,OAAmC;IAC1F,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE;QAC9B,OAAO,SAAS,CAAC;KAClB;SAAM;QACL,IAAI,IAAc,CAAC;QACnB,QAAQ,OAAO,CAAC,QAAQ;YACtB,KAAK,QAAQ;gBACX,IAAI,GAAG,IAAI,cAAc,EAAE,CAAC;gBAC5B,MAAM;YACR,KAAK,MAAM;gBACT,IAAI,GAAG,IAAI,YAAY,EAAE,CAAC;gBAC1B,MAAM;YACR,KAAK,UAAU;gBACb,IAAI,GAAG,IAAI,gBAAgB,EAAE,CAAC;gBAC9B,MAAM;YACR,KAAK,MAAM,CAAC;YACZ;gBACE,IAAI,GAAG,IAAI,YAAY,EAAE,CAAC;gBAC1B,MAAM;SACT;QACD,OAAO,IAAI,eAAe,eACrB;YACD,EAAE;YACF,QAAQ,EAAE,IAAI;YACd,aAAa,EAAE,KAAK;YACpB,cAAc,EAAE,CAAC,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;YACnC,gBAAgB,EAAE,iBAAiB,CAAC,SAAS;YAC7C,IAAI;;YAEJ,IAAI,EAAE,IAAW;YACjB,SAAS,EAAE,KAAK;YAChB,kBAAkB,EAAE,CAAC,CAAC,KAAM,CAAqC,CAAC,eAAe;YACjF,QAAQ,EAAE,CAAC,CAAC,KAAM,CAAiD,CAAC,KAAK,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,GAAC,GAAG,CAAC;SACtG,EACE,OAAO,EACV,CAAC;KACJ;AACH,CAAC;AAED,SAAS,SAAS,CAAC,EAAU,EAAE,IAAwB,EAAE,OAAmC;IAC1F,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE;QAC9B,OAAO,SAAS,CAAC;KAClB;SAAM;QACL,OAAO,IAAI,SAAS,eACf;YACD,EAAE;YACF,QAAQ,EAAE,IAAI;YACd,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,qCAAU,CAAC,KAAE,QAAQ,EAAE,IAAI,OAAO,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,cAAc,EAAE,IAAG,CAAC;YAC1F,OAAO,EAAE,CAAC,CAAC,KAAM,CAAsB,CAAC,IAAI;YAC5C,WAAW,EAAE,CAAC,CAAC,KAAM,CAAoC,CAAC,QAAQ;YAClE,QAAQ,EAAE,CAAC,CAAC,KAAM,CAAiD,CAAC,KAAK;SAC1E,EACE,OAAO,EACV,CAAC;KACJ;AACH,CAAC;MAEY,WAAY,SAAQ,cAAgC;IAI/D,eAAe;QACb,MAAM,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;QAC5B,IAAI,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,IAAI,aAAJ,IAAI,cAAJ,IAAI,GAAI,EAAE,EAAE,WAAW,EAAE,GAAG,EAAE,YAAY,EAAE,KAAK,EAAE,CAAC,CAAC;QAC3E,mBAAmB,EAAE,CAAC;KACvB;IAED,YAAY;;QACV,MAAM,KAAK,GAAG,IAAI,CAAC,KAAiF,CAAC;QACrG,MAAM,UAAU,GAAuC;YACrD,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,UAAU,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,WAAW,EAAE,EAAE,EAAE,YAAY,EAAE,EAAE;SACpG,CAAC;QAEF,KAAK,MAAM,IAAI,IAAI,KAAK,CAAC,IAAI,EAAE;YAC7B,MAAM,QAAQ,GAAG,MAAA,IAAI,CAAC,QAAQ,mCAAI,MAAM,CAAC;YACzC,IAAI,IAAI,CAAC,UAAU,EAAE;gBACnB,UAAU,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;aAClC;iBAAM,IAAI,UAAU,CAAC,QAAQ,CAAC,KAAK,SAAS,EAAE;gBAC7C,UAAU,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;aACjC;SACF;;QAGD,MAAM,QAAQ,GAAoC,EAAE,CAAC;QACrD,KAAK,MAAM,CAAC,IAAI,UAAU,CAAC,UAAU,EAAE;YACrC,IAAI,CAAC,CAAC,UAAU,IAAI,CAAC,CAAC,cAAc,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC,UAAU,CAAC,EAAE;gBACrG,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,GAAG,QAAQ,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC,UAAU,EAAsB,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;aAC5G;SACF;QAED,MAAM,MAAM,GAAc,EAAE,CAAC;QAC7B,KAAK,MAAM,CAAC,QAAQ,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE;YAC1D,IAAI,QAAQ,KAAK,YAAY,EAAE;gBAC7B,KAAK,MAAM,KAAK,IAAI,KAAK,EAAE;oBACzB,MAAM,CAAC,IAAI,CACT,IAAI,eAAe,CAAC;wBAClB,EAAE,EAAE,SAAS,GAAG,KAAK,CAAC,KAAK,CAAC;wBAC5B,OAAO,EAAE,KAAK,CAAC,gBAAgB,GAAG,KAAK,CAAC,WAAW,IAAI,KAAK,CAAC,OAAO,KAAK,SAAS,GAAG,KAAK,CAAC,OAAO,GAAG,GAAG,CAAC;wBACzG,QAAQ,EAAE,CAAC,KAAK,CAAC,UAAU;wBAC3B,gBAAgB,EAAE,iBAAiB,CAAC,SAAS;wBAC7C,IAAI,EAAE,CAAC,KAAK,CAAC;wBACb,UAAU,EAAE,KAAK,CAAC,cAAc;4BAC9B,SAAS,CAAC,KAAK,CAAC,cAAc,EAAE,QAAQ,CAAC,KAAK,CAAC,UAAoB,CAAC,CAAC;4BACrE,KAAK,CAAC,UAA4B;;wBAEpC,SAAS,EAAE,KAAK,CAAC,SAAS;wBAC1B,kBAAkB,EAAE,KAAK,CAAC,eAAwC;wBAClE,QAAQ,EAAE,MAAA,KAAK,CAAC,KAAK,mCAAI,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,GAAC,GAAG,CAAC;wBAC7C,UAAU,EAAE,EAAE,SAAS,EAAE,CAAC,KAAK,CAAC,gBAAgB,KAAK,KAAK,CAAC,OAAO,KAAK,SAAS,IAAI,KAAK,CAAC,OAAO,KAAK,CAAC,CAAC,EAAE;qBAC3G,CAAC,CACH,CAAC;iBACH;aACF;iBAAM,IAAI,QAAQ,KAAK,MAAM,EAAE;gBAC9B,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,UAAU,CAAC,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC;gBACrF,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,cAAc,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;aAC9F;iBAAM,IAAI,QAAQ,KAAK,WAAW,EAAE;gBACnC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,KAAK,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC;aACzF;iBAAM;gBACL,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,UAAU,CAAC,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC;gBACnH,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,QAAQ,UAAU,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC;aACjI;SACF;QAED,IAAI,KAAK,CAAC,YAAY,EAAE;YACtB,YAAY,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;SAC1B;QAED,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;KAChC;IAED,cAAc,CACZ,CAAoE;QAEpE,OAAO,CAAC,CAAC,IAAI,CAAC;KACf;;AA5Ee,qBAAS,GAAG,aAAa,CAAC;AAC1B,qBAAS,GAAqC,EAAE;;ACvDlE;AACA,SAAS,UAAU,CAAC,KAAK,EAAE,QAAkB,EAAE;IAC7C,KAAK,MAAM,KAAK,KAAK,KAAK,CAAC,KAAK,IAAI,KAAK,CAAC,QAAQ,IAAI,EAAE,GAAG;QACzD,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACvB,UAAU,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;KAC1B;IACD,OAAO,KAAK,CAAC;AACf,CAAC;SAEqB,iBAAiB,CAAC,OAAe,EAAE,WAAqB,EAAE,cAAuB;;QAErG,mBAAmB,EAAE,CAAC;QACtB,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,EAAC,UAAU,EAAE,OAAO,EAAE,cAAc,EAAqB,CAAC,CAAC;QACvF,MAAM,KAAK,GAAoC,EAAE,CAAC;QAClD,MAAM,SAAS,GAAoB,EAAE,CAAC;QACtC,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,MAAM,EAAE;YAC/B,WAAW,GAAG,IAAI,OAAO,CAAC,WAAW,IAAI,OAAO,CAAC,QAAQ,CAAC,CAAC;YAC3D,aAAa,CAAC,KAAK,EAAE,WAAW,EAAE,CAAC,IAAI,EAAE,WAAoB;gBAC3D,MAAM,aAAa,GAAkB;oBACnC,KAAK,GAAG,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,EAAE,CAAW;oBACvC,OAAO,EAAE,eAAe;oBACxB,eAAe,EAAE,IAAI,OAAO,CAAC,WAAW,CAAC;oBACzC,QAAQ,EAAE,WAAW;oBACrB,IAAI;iBACY,CAAC;gBACnB,SAAS,CAAC,IAAI,CAAC;oBACb,KAAK,EAAE,QAAQ,aAAa,CAAC,KAAK,CAAC,EAAE;oBACrC,OAAO,EAAE,UAAU;oBACnB,UAAU,EAAE,OAAO;oBACnB,cAAc,EAAE,aAAa,CAAC,KAAK,CAAC;oBACpC,eAAe,EAAE,IAAI,OAAO,CAAC,WAAW,IAAI,OAAO,CAAC,QAAQ,CAAC;oBAC7D,OAAO,GAAG,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,EAAE,CAAW;oBACzC,KAAK,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;oBAC3B,SAAS,EAAE,KAAK;oBAChB,gBAAgB,EAAE,IAAI;oBACtB,IAAI;iBACY,CAAC,CAAC;gBACpB,IAAI,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE;oBACxE,KAAK,MAAM,SAAS,IAAI,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE;wBAC5C,IAAI,SAAS,CAAC,UAAU,CAAC,QAAQ,IAAI,SAAS,CAAC,UAAU,CAAC,QAAQ,CAAC,GAAG,EAAE;4BACtE,MAAM,UAAU,GAAG,WAAW,CAAC,gBAAgB,CAAC,SAAS,CAAC,UAAU,CAAC,QAAQ,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;4BACvF,MAAM,UAAU,GAAG,WAAW,CAAC,gBAAgB,CAAC,SAAS,CAAC,UAAU,CAAC,QAAQ,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;4BACvF,aAAa,CAAC,IAAI,GAAG,IAAI,IAAI,CAAC;gCAC5B,UAAU,EAAE,IAAI,IAAI,CAAC,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;gCAC7E,UAAU,EAAE,IAAI,IAAI,CAAC,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;6BAC9E,CAAC,CAAC;yBACJ;qBACF;iBACF;gBACD,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,GAAG,aAAa,CAAC;gBAC5C,OAAO,IAAI,CAAC;aACb,CAAC,CAAC;SACJ;QAED,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE;YAC5D,KAAK,MAAM,KAAK,IAAI,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,EAAE;gBAChF,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE;oBACd,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;iBAChC;qBAAM;oBACL,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;iBAC9B;aACF;YACD,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE;gBACd,OAAO,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;aAC3B;SACF;QACD,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE;YACvC,MAAM,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC;YAChC,MAAM,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC;YAChC,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,GAAG,EAAE,CAAC,KAAK,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YAC7C,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;YAC5D,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC,KAAK,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YAEvD,IAAI,CAAC,eAAe,GAAG,IAAI,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC;iBACjD,SAAS,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;iBAC3B,KAAK,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAC;SAC9B;QACD,KAAK,MAAM,IAAI,IAAI,SAAS,EAAE;YAC5B,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,IAAI,CAAC;SAC3B;QACD,OAAO,KAAK,CAAC;KACd;CAAA;AACD;;AC9CA;;;MAGa,MAAM;IAuBjB,YAAoB,SAA+B;;QAA/B,cAAS,GAAT,SAAS,CAAsB;QArBlC,gBAAW,GAAG,IAAI,WAAW,CAAC,EAAE,CAAC,CAAC;QAElC,qBAAgB,GAAG,IAAI,OAAO,EAAkB,CAAC;QACjD,0BAAqB,GAAG,IAAI,OAAO,EAAoB,CAAC;QACxD,yBAAoB,GAAG,IAAI,OAAO,EAAoB,CAAC;QACvD,yBAAoB,GAAG,IAAI,eAAe,CAAmB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QACrE,yBAAoB,GAAG,IAAI,OAAO,EAAiB,CAAC;QACpD,oBAAe,GAAG,IAAI,OAAO,EAAiB,CAAC;QAC/C,uBAAkB,GAAG,IAAI,OAAO,EAAiB,CAAC;QAE1D,eAAU,GAAG,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC;QACjD,oBAAe,GAAG,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC;QAC3D,mBAAc,GAAG,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC;QACzD,mBAAc,GAAG,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC;QACzD,mBAAc,GAAG,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC;QACzD,cAAS,GAAG,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC;QAC/C,iBAAY,GAAG,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC;;QAO5D,MAAM,KAAK,mCACN,SAAS,KACZ,KAAK,EAAE,CAAE,SAAS,CAAC,MAAM,KAAK,cAAc,GAAG,IAAI,gBAAgB,CAAC;oBAClE,KAAK,EAAE,KAAK;oBACZ,IAAI,EAAE,CAAC,IAAI;iBACZ,CAAC,GAAG,IAAI,SAAS,CAAC,EAAE,SAAS,EAAE,GAAG,EAAE,CAAC,CAAE,EACxC,UAAU,EAAE,SAAS,CAAC,WAAW,KAAK,SAAS,GAAG,SAAS,CAAC,WAAW,GAAG,IAAI,EAC9E,MAAM,EAAE,CAAE,IAAI,CAAC,WAAW,CAAE,EAC5B,OAAO,EAAE,IAAI,CAAC,QAAQ,EACtB,OAAO,EAAE,IAAI,CAAC,QAAQ,EACtB,iBAAiB,EAAE,IAAI,CAAC,kBAAkB,EAC1C,WAAW,EAAE,IAAI,CAAC,YAAY,EAC9B,MAAM,EAAE,IAAI,CAAC,OAAO,EACpB,SAAS,EAAE,IAAI,CAAC,UAAU,EAC1B,SAAS,EAAE,CAAC,CAA0B,eAAK,OAAA,MAAA,IAAI,CAAC,MAAM,oCAAK,CAAC,CAAC,UAAU,GAAG,UAAU,GAAG,MAAM,CAAC,CAAA,EAAA,GAC/F,CAAC;QACF,IAAI,SAAS,CAAC,cAAc,EAAE;;YAE5B,KAAK,CAAC,OAAO,GAAG;gBACd,IAAI,cAAc,CAAC;oBACjB,YAAY,EAAE,IAAI,YAAY,CAAC;wBAC7B,KAAK,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;wBACtB,SAAS,EAAE,IAAI;qBAChB,CAAC;iBACH,CAAC;aACH,CAAC;SACH;;QAED,IAAI,CAAC,IAAI,GAAG,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC;QAC5B,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC;YACjB,SAAS,EAAE;gBACT,SAAS,EAAE,GAAG;gBACd,YAAY,EAAE,MAAA,SAAS,CAAC,YAAY,mCAAI,CAAC,EAAE;gBAC3C,YAAY,EAAE,MAAA,SAAS,CAAC,YAAY,mCAAI,EAAE;gBAC1C,MAAM,EAAE,MAAA,SAAS,CAAC,MAAM,mCAAI,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC;gBACzC,SAAS,EAAE,CAAC;gBACZ,aAAa,EAAE,MAAA,SAAS,CAAC,QAAQ,mCAAI,CAAC;gBACtC,IAAI,EAAE,MAAA,SAAS,CAAC,IAAI,mCAAI,GAAG;gBAC3B,MAAM,EAAE,SAAS,CAAC,MAAM;aACD;SAC1B,CAAC,CAAC;QACH,IAAI,SAAS,CAAC,QAAQ,EAAE;YACtB,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,CAAC;SACzD;KACF;IAEK,UAAU;;YACd,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE;;gBAE9B,MAAM,IAAI,OAAO,CAAC,CAAC;oBACjB,UAAU,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;iBACpB,CAAC,CAAC;aACJ;SACF;KAAA;IAED,QAAQ;QACN,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;KACtB;IAED,QAAQ,CAAC,IAAwB;QAC/B,IAAI,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,MAAM,IAAG,CAAC,EAAE;YACpB,IAAI,WAAW,GAAI,IAAI,CAAC,WAAW,CAAC,KAAiC,CAAC,WAAW,CAAC;YAClF,IAAI,OAAO,GAAG,KAAK,CAAC;YACpB,KAAK,MAAM,IAAI,IAAI,IAAI,EAAE;gBACvB,IAAI,IAAI,CAAC,YAAY,EAAE;oBACrB,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;oBAClB,OAAO,GAAG,IAAI,CAAC;iBAChB;aACF;YACD,WAAW,GAAG,OAAO,GAAG,IAAI,GAAG,WAAW,CAAC;YAC3C,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,wBAAwB,EAAE;gBAC5C,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC,CAAC;aAClD;iBAAM;gBACL,IAAI,CAAC,wBAAwB,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;aAClD;SACF;KACF;IAED,wBAAwB,CAAC,IAAwB,EAAE,WAAmB;;QAEpE,MAAM,OAAO,GAAG,0GAA0G,CAAC;;QAE3H,MAAM,aAAa,GAAG,IAAI,OAAO,CAAC,CAAC,KAAK,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,KAAK,EAAC,sBAAsB,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,sBAAsB,EAAC,KAAK,EAAC,CAAC,EAAC,IAAI,EAAC,KAAK,EAAC,IAAI,EAAC,CAAC,CAAC,CAAC,CAAC;QACtI,iBAAiB,CAAC,OAAO,EAAE,aAAa,EAAE,mBAAmB,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO;YAC1E,OAAO,CAAC,GAAG,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;YAChC,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;;YAE1B,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC;YAC3C,IAAI,CAAC,IAAI,CAAC;gBACR,KAAK,EAAE,MAAM;gBACb,OAAO,EAAE,MAAM;gBACf,UAAU,EAAE,OAAO;gBACnB,cAAc,EAAE,kBAAkB;gBAClC,eAAe,EAAE,aAAa;gBAC9B,KAAK,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;;gBAE3B,SAAS,EAAE,KAAK;gBAChB,gBAAgB,EAAE,KAAK;aACxB,CAAC,CAAC;YACH,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC,CAAC;SAClD,CAAC,CAAC;KACJ;IAED,MAAM,CAAC,IAAsB;QAC3B,MAAM,MAAM,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;QACjD,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC;YACjB,SAAS,EAAE,gCACN,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,KAC5B,MAAM,EAAE,MAAM,CAAC,cAAc,EAAE,EAC/B,SAAS,EAAE,CAAC,EACZ,aAAa,EAAE,CAAC,EAChB,IAAI,EAAE,IAAI,GACa;SAC1B,CAAC,CAAC;KACJ;IAED,WAAW,CAAC,KAAa;QACvB,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC;YACjB,SAAS,EAAE,gCACN,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,KAC5B,aAAa,EAAE,KAAK,GACG;SAC1B,CAAC,CAAC;KACJ;IAED,YAAY,CAAC,KAAa;QACxB,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC;YACjB,SAAS,EAAE,gCACN,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,KAC5B,SAAS,EAAE,KAAK,GACO;SAC1B,CAAC,CAAC;KACJ;IAED,OAAO,CAAC,KAAa;QACnB,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC;YACjB,SAAS,EAAE,gCACN,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,KAC5B,IAAI,EAAE,KAAK,GACY;SAC1B,CAAC,CAAC;KACJ;IAED,SAAS,CAAC,KAAe;QACvB,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC;YACjB,SAAS,EAAE,gCACN,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,KAC5B,MAAM,EAAE,KAAK,GACU;SAC1B,CAAC,CAAC;KACJ;IAED,cAAc,CAAC,KAAc;QAC3B,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC;YACjB,UAAU,EAAE,KAAK;SAClB,CAAC,CAAC;KACJ;IAGO,QAAQ,CAAC,CAAgD;QAC/D,MAAM,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC;QAC7B,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,MAAM,GAAG,SAAS,GAAG,SAAS,CAAC;QAC/C,IAAI,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE;YAC3C,IAAI,WAAW,KAAK,CAAC,CAAC,MAAM,EAAE;gBAC5B,IAAI,WAAW,EAAE;oBACf,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;iBAC7C;gBACD,IAAI,CAAC,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC;gBAC5B,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;aAC3C;SACF;aAAM,IAAI,WAAW,EAAE;YACtB,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;YAC5C,IAAI,CAAC,WAAW,GAAG,SAAS,CAAC;SAC9B;KACF;IAGO,QAAQ,CAAC,IAAgC,EAAE,CAAqC;;QACtF,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE;YACpD,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,MAAM,EAAE,SAAS,EAAE,MAAA,MAAA,CAAC,aAAD,CAAC,uBAAD,CAAC,CAAE,QAAQ,0CAAE,OAAO,mCAAI,SAAS,EAAE,CAAC,CAAC;SACjG;KACF;IAGO,kBAAkB,CAAC,KAAoF;;QAC7G,IAAI,MAAA,KAAK,CAAC,gBAAgB,0CAAE,SAAS,EAAE;YACrC,MAAM,YAAY,GAAG,IAAI,CAAC,WAAW,CAAC,KAA+C,CAAC;YACtF,MAAM,WAAW,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,SAAS,CAAC,IAAI,GAAG,GAAG,IAAI,CAAC,EAAE,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC;YACxF,IAAI,YAAY,CAAC,WAAW,KAAK,WAAW,EAAE;gBAC5C,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,YAAY,CAAC,IAAI,EAAE,WAAW,EAAE,CAAC,CAAC;aACrE;SACF;QACD,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,SAAS,oBAAO,KAAK,CAAC,SAAS,CAAE,EAAE,CAAC,CAAC;QAC1D,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,aAAa,EAAE,KAAK,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC;KAC5F;IAGO,YAAY,CAAC,IAAgC,EAAE,CAAa;QAClE,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC,EAAE,IAAI,CAAC,oBAAoB,CAAC,CAAC;KACrD;IAGO,OAAO,CAAC,IAAgC,EAAE,CAAa;QAC7D,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC,EAAE,IAAI,CAAC,eAAe,CAAC,CAAC;KAChD;IAGO,UAAU,CAAC,IAAgC,EAAE,CAAa;QAChE,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC,EAAE,IAAI,CAAC,kBAAkB,CAAC,CAAC;KACnD;IAEO,UAAU,CAAC,IAAgC,EAAE,CAAa,EAAE,OAA+B;;QACjG,IAAI,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,MAAM,0CAAG,KAAK,CAAC,EAAE;YACzB,OAAO,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC;SAC9C;KACF;CACF;AAzDC;IADC,IAAI;sCAgBJ;AAGD;IADC,IAAI;sCAKJ;AAGD;IADC,IAAI;gDAWJ;AAGD;IADC,IAAI;0CAGJ;AAGD;IADC,IAAI;qCAGJ;AAGD;IADC,IAAI;wCAGJ;;SCzRmB,aAAa,CAAC,KAAyB;;;QAE3D,MAAM,SAAS,GAA2B,EAAE,CAAC;QAC7C,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACxE,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE;;YAE9B,SAAS,CAAC,OAAiB,CAAC,GAAG,MAAM,QAAQ,CAAC,EAAE,UAAU,EAAE,OAAO,EAAsB,CAAC,CAAC;SAC5F;QACD,MAAM,QAAQ,GAAuB,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC;QAEtE,KAAK,MAAM,KAAK,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,UAAU,CAAC,EAAE;YACnD,MAAM,IAAI,GAAG,SAAS,CAAC,KAAK,CAAC,UAAoB,CAAC,CAAC;YACnD,MAAM,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC;YACxB,IAAI,WAAW,GAAG,IAAI,OAAO,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC;;YAGrD,IAAI,KAAK,CAAC,cAAc,EAAE;gBACxB,MAAM,cAAc,GAAG,KAAK,CAAC,cAAc,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,KAAK,KAAK,CAAC,cAAc,CAAC,GAAG,SAAS,CAAC;gBAClH,IAAI,gBAAgB,GAAG,KAAK,CAAC;gBAC7B,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,MAAM,EAAE;oBAC/B,IAAI,CAAC,gBAAgB,EAAE;wBACrB,aAAa,CAAC,KAAK,EAAE,IAAI,OAAO,CAAC,KAAK,CAAC,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE,WAAW;4BAC1E,IAAI,KAAK,KAAK,cAAc,EAAE;gCAC5B,WAAW,GAAG,WAAW,CAAC;gCAC1B,gBAAgB,GAAG,IAAI,CAAC;gCACxB,OAAO,KAAK,CAAC;6BACd;4BACD,OAAO,IAAI,CAAC;yBACb,CAAC,CAAC;qBACJ;iBACF;gBACD,IAAI,CAAC,KAAK,GAAG;oBACX,EAAE,EAAE,KAAK,CAAC,cAAc;oBACxB,IAAI,EAAE,KAAK,CAAC,cAAc;oBAC1B,KAAK,EAAE,CAAC,cAAc,CAAC;iBACxB,CAAC;aACH;YAED,aAAa,CAAC,IAAI,CAAC,KAAK,EAAE,WAAW,EAAE,CAAC,IAAI,EAAE,WAAW;gBACvD,IAAI,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE;oBACxE,KAAK,MAAM,SAAS,IAAI,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE;wBAC5C,IAAI,SAAS,CAAC,UAAU,CAAC,QAAQ,IAAI,SAAS,CAAC,UAAU,CAAC,QAAQ,CAAC,GAAG,EAAE;4BACtE,MAAM,UAAU,GAAG,WAAW,CAAC,gBAAgB,CAAC,SAAS,CAAC,UAAU,CAAC,QAAQ,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;4BACvF,MAAM,UAAU,GAAG,WAAW,CAAC,gBAAgB,CAAC,SAAS,CAAC,UAAU,CAAC,QAAQ,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;4BACvF,MAAM,SAAS,GAAG,IAAI,IAAI,CAAC;gCACzB,UAAU,EAAE,IAAI,IAAI,CAAC,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;gCAC7E,UAAU,EAAE,IAAI,IAAI,CAAC,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;6BAC9E,CAAC,CAAC;4BACH,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;yBACxB;qBACF;iBACF;gBACD,OAAO,IAAI,CAAC;aACb,CAAC,CAAC;;YAGH,MAAM,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;YAC3D,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;YAC5D,MAAM,QAAQ,GAAG,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YACxD,MAAM,eAAe,GAAG,IAAI,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC;iBAClD,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC;iBAC7B,KAAK,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAC;YAC7B,MAAM,OAAO,mCACR,KAAK,KACR,eAAe,EACf,QAAQ,EAAE,WAAW,GACtB,CAAC;YACF,OAAO,OAAO,CAAC,UAAU,CAAC;YAC1B,OAAO,OAAO,CAAC,cAAc,CAAC;YAE9B,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;SACxB;QACD,OAAO,QAAQ,CAAC;KACjB;;;ACjFD;;ACAA;;;;;;"} \ No newline at end of file diff --git a/ccf-body-ui/lib/body-ui-layer.d.ts b/ccf-body-ui/lib/body-ui-layer.d.ts deleted file mode 100644 index 179e295c1..000000000 --- a/ccf-body-ui/lib/body-ui-layer.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -/// -import { CompositeLayer } from '@deck.gl/core'; -import { SpatialSceneNode } from './shared/spatial-scene-node'; -export declare class BodyUILayer extends CompositeLayer { - static readonly layerName = "BodyUILayer"; - static readonly gltfCache: { - [url: string]: Promise; - }; - initializeState(): void; - renderLayers(): unknown[]; - getPickingInfo(e: Parameters['getPickingInfo']>[0]): ReturnType['getPickingInfo']>; -} diff --git a/ccf-body-ui/lib/body-ui.d.ts b/ccf-body-ui/lib/body-ui.d.ts deleted file mode 100644 index 78b3a1bb8..000000000 --- a/ccf-body-ui/lib/body-ui.d.ts +++ /dev/null @@ -1,78 +0,0 @@ -/// -import { Deck } from '@deck.gl/core'; -import { Matrix4 } from '@math.gl/core'; -import { SpatialSceneNode } from './shared/spatial-scene-node'; -export interface BodyUIProps { - id: string; - canvas: string | HTMLCanvasElement; - parent: HTMLElement; - debugSceneNodeProcessing?: boolean; - target: Matrix4 | number[]; - interactive: boolean; - rotation: number; - minRotationX: number; - maxRotationX: number; - zoom: number; - legacyLighting?: boolean; - camera: string; -} -export interface PickInfo { - layer: unknown; - index: number; - object: D; - x: number; - y: number; - coordinate?: unknown; - picked?: boolean; -} -export declare type NodeDragEvent = { - node: SpatialSceneNode; - info: PickInfo; - e: MouseEvent; -}; -export declare type NodeClickEvent = { - node: SpatialSceneNode; - ctrlClick: boolean; -}; -/** - * A convenience wrapper class for the CCF Body UI - */ -export declare class BodyUI { - private deckProps; - deck: Deck; - private readonly bodyUILayer; - private readonly nodeClickSubject; - private readonly nodeHoverStartSubject; - private readonly nodeHoverStopSubject; - private readonly sceneRotationSubject; - private readonly nodeDragStartSubject; - private readonly nodeDragSubject; - private readonly nodeDragEndSubject; - readonly nodeClick$: import("rxjs").Observable; - readonly nodeHoverStart$: import("rxjs").Observable; - readonly nodeHoverStop$: import("rxjs").Observable; - readonly sceneRotation$: import("rxjs").Observable<[number, number]>; - readonly nodeDragStart$: import("rxjs").Observable; - readonly nodeDrag$: import("rxjs").Observable; - readonly nodeDragEnd$: import("rxjs").Observable; - private cursor?; - private lastHovered?; - constructor(deckProps: Partial); - initialize(): Promise; - finalize(): void; - setScene(data: SpatialSceneNode[]): void; - debugSceneNodeProcessing(data: SpatialSceneNode[], zoomOpacity: number): void; - zoomTo(node: SpatialSceneNode): void; - setRotation(value: number): void; - setRotationX(value: number): void; - setZoom(value: number): void; - setTarget(value: number[]): void; - setInteractive(value: boolean): void; - private _onHover; - private _onClick; - private _onViewStateChange; - private _onDragStart; - private _onDrag; - private _onDragEnd; - private _dragEvent; -} diff --git a/ccf-body-ui/lib/shared/ccf-spatial-jsonld.d.ts b/ccf-body-ui/lib/shared/ccf-spatial-jsonld.d.ts deleted file mode 100644 index c517aa585..000000000 --- a/ccf-body-ui/lib/shared/ccf-spatial-jsonld.d.ts +++ /dev/null @@ -1,55 +0,0 @@ -import { JsonLdObj } from 'jsonld/jsonld-spec'; -export interface SpatialPlacementJsonLd extends JsonLdObj { - '@context'?: string; - '@id': string; - '@type': string; - source?: string; - target: string; - placement_date: string; - x_scaling: number; - y_scaling: number; - z_scaling: number; - scaling_units: string; - x_rotation: number; - y_rotation: number; - z_rotation: number; - rotation_units: string; - x_translation: number; - y_translation: number; - z_translation: number; - translation_units: string; -} -export interface SpatialObjectReferenceJsonLd extends JsonLdObj { - '@id': string; - '@type': string; - file: string; - file_format: string; - placement: SpatialPlacementJsonLd; -} -export interface SpatialEntityJsonLd extends JsonLdObj { - '@context': string; - '@id': string; - '@type': string | string[]; - label: string; - comment: string; - creator: string; - creator_first_name: string; - creator_last_name: string; - creation_date: string; - updated_date: string; - ccf_annotations: string[]; - representation_of: string; - reference_organ: string; - extraction_set: string; - sex: 'Male' | 'Female' | undefined; - side: 'Left' | 'Right' | undefined; - rui_rank: number; - slice_thickness: number; - slice_count: number; - x_dimension: number; - y_dimension: number; - z_dimension: number; - dimension_units: string; - object: SpatialObjectReferenceJsonLd; - placement: SpatialPlacementJsonLd | SpatialPlacementJsonLd[]; -} diff --git a/ccf-body-ui/lib/shared/spatial-scene-node.d.ts b/ccf-body-ui/lib/shared/spatial-scene-node.d.ts deleted file mode 100644 index 231771d8b..000000000 --- a/ccf-body-ui/lib/shared/spatial-scene-node.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { Matrix4 } from '@math.gl/core'; -export declare type SpatialSceneGeometry = 'sphere' | 'cube' | 'wireframe' | 'text' | 'cone' | 'cylinder'; -export interface SpatialSceneNode { - '@id': string; - '@type': string; - entityId?: string; - representation_of?: string; - reference_organ?: string; - unpickable?: boolean; - geometry?: SpatialSceneGeometry; - text?: string; - _lighting?: string; - scenegraph?: string; - scenegraphNode?: string; - zoomBasedOpacity?: boolean; - zoomToOnLoad?: boolean; - color?: [number, number, number, number]; - opacity?: number; - transformMatrix: Matrix4; - name?: string; - tooltip?: string; - priority?: number; -} diff --git a/ccf-body-ui/lib/util/load-gltf.d.ts b/ccf-body-ui/lib/util/load-gltf.d.ts deleted file mode 100644 index c951113eb..000000000 --- a/ccf-body-ui/lib/util/load-gltf.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { SpatialSceneNode } from '../shared/spatial-scene-node'; -export declare function registerGLTFLoaders(): void; -export declare function deriveScenegraph(scenegraphNodeName: string, gltf: any): any; -export declare function loadGLTF(model: SpatialSceneNode, cache?: { - [url: string]: Promise; -}): Promise; -export declare function loadGLTF2(scenegraphNodeName: string, gltfPromise: Promise): Promise; diff --git a/ccf-body-ui/lib/util/process-scene-nodes.d.ts b/ccf-body-ui/lib/util/process-scene-nodes.d.ts deleted file mode 100644 index 2c230ad96..000000000 --- a/ccf-body-ui/lib/util/process-scene-nodes.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { Matrix4 } from '@math.gl/core'; -import { AABB, Vec3 } from 'cannon-es'; -import { SpatialSceneNode } from '../shared/spatial-scene-node'; -export interface ProcessedNode extends SpatialSceneNode { - bbox: AABB; - jsonld: unknown; - node: unknown; - size: Vec3; - center: Vec3; -} -export declare function processSceneNodes(gltfUrl: string, worldMatrix?: Matrix4, scenegraphNode?: string): Promise<{ - [node: string]: ProcessedNode; -}>; diff --git a/ccf-body-ui/lib/util/scene-traversal.d.ts b/ccf-body-ui/lib/util/scene-traversal.d.ts deleted file mode 100644 index 91e9a7bf6..000000000 --- a/ccf-body-ui/lib/util/scene-traversal.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { Matrix4 } from '@math.gl/core'; -export declare type SceneTraversalVisitor = (child: any, modelMatrix: Matrix4, parentMatrix: Matrix4) => boolean; -export declare function traverseScene(scene: any, worldMatrix: Matrix4, visitor: SceneTraversalVisitor): boolean; diff --git a/ccf-body-ui/lib/util/simplify-scene.d.ts b/ccf-body-ui/lib/util/simplify-scene.d.ts deleted file mode 100644 index c937584dd..000000000 --- a/ccf-body-ui/lib/util/simplify-scene.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import { SpatialSceneNode } from '../shared/spatial-scene-node'; -export declare function simplifyScene(nodes: SpatialSceneNode[]): Promise; diff --git a/ccf-body-ui/lib/util/spatial-scene-collider.d.ts b/ccf-body-ui/lib/util/spatial-scene-collider.d.ts deleted file mode 100644 index fb016c5f9..000000000 --- a/ccf-body-ui/lib/util/spatial-scene-collider.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { SpatialSceneNode } from '../shared/spatial-scene-node'; -interface Collision { - '@id': string; - name: string; - hits: { - '@id': string; - name: string; - }[]; -} -export declare function doCollisions(scene: SpatialSceneNode[]): Promise; -export {}; diff --git a/ccf-body-ui/package.json b/ccf-body-ui/package.json deleted file mode 100644 index 8c258f2ef..000000000 --- a/ccf-body-ui/package.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "name": "ccf-body-ui", - "version": "0.0.1", - "peerDependencies": { - "@angular/common": "^9.1.1", - "@angular/core": "^9.1.1", - "lodash": "^4.17.21" - }, - "dependencies": { - "tslib": "^2.0.0" - }, - "main": "bundles/ccf-body-ui.umd.js", - "module": "fesm2015/ccf-body-ui.js", - "es2015": "fesm2015/ccf-body-ui.js", - "esm2015": "esm2015/ccf-body-ui.js", - "fesm2015": "fesm2015/ccf-body-ui.js", - "typings": "ccf-body-ui.d.ts", - "sideEffects": false, - "scripts": { - "prepublishOnly": "node --eval \"console.error('ERROR: Trying to publish a package that has been compiled by Ivy in full compilation mode. This is not allowed.\\nPlease delete and rebuild the package with Ivy partial compilation mode, before attempting to publish.\\n')\" && exit 1" - } -} \ No newline at end of file diff --git a/ccf-body-ui/public-api.d.ts b/ccf-body-ui/public-api.d.ts deleted file mode 100644 index c348b8a4c..000000000 --- a/ccf-body-ui/public-api.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -export * from './lib/body-ui-layer'; -export * from './lib/body-ui'; -export * from './lib/shared/spatial-scene-node'; -export * from './lib/shared/ccf-spatial-jsonld'; -export * from './lib/util/load-gltf'; -export * from './lib/util/scene-traversal'; -export * from './lib/util/spatial-scene-collider'; -export * from './lib/util/process-scene-nodes'; -export * from './lib/util/simplify-scene'; diff --git a/ccf-database/README.md b/ccf-database/README.md deleted file mode 100644 index 15f0598c3..000000000 --- a/ccf-database/README.md +++ /dev/null @@ -1,24 +0,0 @@ -# CcfDatabase - -This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 9.1.1. - -## Code scaffolding - -Run `ng generate component component-name --project ccf-database` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project ccf-database`. -> Note: Don't forget to add `--project ccf-database` or else it will be added to the default project in your `angular.json` file. - -## Build - -Run `ng build ccf-database` to build the project. The build artifacts will be stored in the `dist/` directory. - -## Publishing - -After building your library with `ng build ccf-database`, go to the dist folder `cd dist/ccf-database` and run `npm publish`. - -## Running unit tests - -Run `ng test ccf-database` to execute the unit tests via [Karma](https://karma-runner.github.io). - -## Further help - -To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md). diff --git a/ccf-database/bundles/ccf-database.umd.js b/ccf-database/bundles/ccf-database.umd.js deleted file mode 100644 index 3fde52227..000000000 --- a/ccf-database/bundles/ccf-database.umd.js +++ /dev/null @@ -1,4063 +0,0 @@ -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('idb-keyval'), require('triple-store-utils'), require('@math.gl/core'), require('graphology'), require('graphology-shortest-path/unweighted'), require('lodash'), require('uuid'), require('rdf-literal'), require('@math.gl/culling')) : - typeof define === 'function' && define.amd ? define('ccf-database', ['exports', 'idb-keyval', 'triple-store-utils', '@math.gl/core', 'graphology', 'graphology-shortest-path/unweighted', 'lodash', 'uuid', 'rdf-literal', '@math.gl/culling'], factory) : - (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global['ccf-database'] = {}, global['idb-keyval'], global.tripleStoreUtils, global.core, global.graphology, global.shortestPath, global.lodash, global.uuid, global.rdfLiteral, global.culling)); -}(this, (function (exports, idbKeyval, tripleStoreUtils, core, graphology, shortestPath, lodash, uuid, rdfLiteral, culling) { 'use strict'; - - function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } - - var shortestPath__default = /*#__PURE__*/_interopDefaultLegacy(shortestPath); - - /*! ***************************************************************************** - Copyright (c) Microsoft Corporation. - - Permission to use, copy, modify, and/or distribute this software for any - purpose with or without fee is hereby granted. - - THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH - REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR - OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - PERFORMANCE OF THIS SOFTWARE. - ***************************************************************************** */ - /* global Reflect, Promise */ - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) - if (Object.prototype.hasOwnProperty.call(b, p)) - d[p] = b[p]; }; - return extendStatics(d, b); - }; - function __extends(d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - } - var __assign = function () { - __assign = Object.assign || function __assign(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) - if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return __assign.apply(this, arguments); - }; - function __rest(s, e) { - var t = {}; - for (var p in s) - if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; - } - function __decorate(decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") - r = Reflect.decorate(decorators, target, key, desc); - else - for (var i = decorators.length - 1; i >= 0; i--) - if (d = decorators[i]) - r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - } - function __param(paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); }; - } - function __metadata(metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") - return Reflect.metadata(metadataKey, metadataValue); - } - function __awaiter(thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { - step(generator.next(value)); - } - catch (e) { - reject(e); - } } - function rejected(value) { try { - step(generator["throw"](value)); - } - catch (e) { - reject(e); - } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - } - function __generator(thisArg, body) { - var _ = { label: 0, sent: function () { if (t[0] & 1) - throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) - throw new TypeError("Generator is already executing."); - while (_) - try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) - return t; - if (y = 0, t) - op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: - case 1: - t = op; - break; - case 4: - _.label++; - return { value: op[1], done: false }; - case 5: - _.label++; - y = op[1]; - op = [0]; - continue; - case 7: - op = _.ops.pop(); - _.trys.pop(); - continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { - _ = 0; - continue; - } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { - _.label = op[1]; - break; - } - if (op[0] === 6 && _.label < t[1]) { - _.label = t[1]; - t = op; - break; - } - if (t && _.label < t[2]) { - _.label = t[2]; - _.ops.push(op); - break; - } - if (t[2]) - _.ops.pop(); - _.trys.pop(); - continue; - } - op = body.call(thisArg, _); - } - catch (e) { - op = [6, e]; - y = 0; - } - finally { - f = t = 0; - } - if (op[0] & 5) - throw op[1]; - return { value: op[0] ? op[1] : void 0, done: true }; - } - } - var __createBinding = Object.create ? (function (o, m, k, k2) { - if (k2 === undefined) - k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } }); - }) : (function (o, m, k, k2) { - if (k2 === undefined) - k2 = k; - o[k2] = m[k]; - }); - function __exportStar(m, o) { - for (var p in m) - if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) - __createBinding(o, m, p); - } - function __values(o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) - return m.call(o); - if (o && typeof o.length === "number") - return { - next: function () { - if (o && i >= o.length) - o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); - } - function __read(o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) - return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) - ar.push(r.value); - } - catch (error) { - e = { error: error }; - } - finally { - try { - if (r && !r.done && (m = i["return"])) - m.call(i); - } - finally { - if (e) - throw e.error; - } - } - return ar; - } - /** @deprecated */ - function __spread() { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; - } - /** @deprecated */ - function __spreadArrays() { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) - s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; - } - function __spreadArray(to, from, pack) { - if (pack || arguments.length === 2) - for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) - ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); - } - function __await(v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); - } - function __asyncGenerator(thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) - throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; - function verb(n) { if (g[n]) - i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } - function resume(n, v) { try { - step(g[n](v)); - } - catch (e) { - settle(q[0][3], e); - } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) - resume(q[0][0], q[0][1]); } - } - function __asyncDelegator(o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; - function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; } - } - function __asyncValues(o) { - if (!Symbol.asyncIterator) - throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); } - } - function __makeTemplateObject(cooked, raw) { - if (Object.defineProperty) { - Object.defineProperty(cooked, "raw", { value: raw }); - } - else { - cooked.raw = raw; - } - return cooked; - } - ; - var __setModuleDefault = Object.create ? (function (o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function (o, v) { - o["default"] = v; - }; - function __importStar(mod) { - if (mod && mod.__esModule) - return mod; - var result = {}; - if (mod != null) - for (var k in mod) - if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) - __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; - } - function __importDefault(mod) { - return (mod && mod.__esModule) ? mod : { default: mod }; - } - function __classPrivateFieldGet(receiver, state, kind, f) { - if (kind === "a" && !f) - throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) - throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); - } - function __classPrivateFieldSet(receiver, state, value, kind, f) { - if (kind === "m") - throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) - throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) - throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; - } - - /** - * Iterates over the key/value pairs for an IRI, using the specified mapping with quads from the store. - * - * @param store The triple store. - * @param iri The data identifier. - * @param mapping Property mappings. - * @returns an iterator over the key/value pairs - */ - function getEntries(store, iri, mapping) { - var _a, _b, _c, predicate, key, _d, _e, quad, value, e_1_1, e_2_1; - var e_2, _f, e_1, _g; - return __generator(this, function (_h) { - switch (_h.label) { - case 0: - _h.trys.push([0, 11, 12, 13]); - _a = __values(Object.entries(mapping)), _b = _a.next(); - _h.label = 1; - case 1: - if (!!_b.done) return [3 /*break*/, 10]; - _c = __read(_b.value, 2), predicate = _c[0], key = _c[1]; - _h.label = 2; - case 2: - _h.trys.push([2, 7, 8, 9]); - _d = (e_1 = void 0, __values(tripleStoreUtils.readQuads(store, iri, predicate, null, null))), _e = _d.next(); - _h.label = 3; - case 3: - if (!!_e.done) return [3 /*break*/, 6]; - quad = _e.value; - value = quad.object.termType === 'Literal' ? rdfLiteral.fromRdf(quad.object) : quad.object.id; - return [4 /*yield*/, [key, value]]; - case 4: - _h.sent(); - _h.label = 5; - case 5: - _e = _d.next(); - return [3 /*break*/, 3]; - case 6: return [3 /*break*/, 9]; - case 7: - e_1_1 = _h.sent(); - e_1 = { error: e_1_1 }; - return [3 /*break*/, 9]; - case 8: - try { - if (_e && !_e.done && (_g = _d.return)) _g.call(_d); - } - finally { if (e_1) throw e_1.error; } - return [7 /*endfinally*/]; - case 9: - _b = _a.next(); - return [3 /*break*/, 1]; - case 10: return [3 /*break*/, 13]; - case 11: - e_2_1 = _h.sent(); - e_2 = { error: e_2_1 }; - return [3 /*break*/, 13]; - case 12: - try { - if (_b && !_b.done && (_f = _a.return)) _f.call(_a); - } - finally { if (e_2) throw e_2.error; } - return [7 /*endfinally*/]; - case 13: return [2 /*return*/]; - } - }); - } - /** - * Creates an object of the specified type using quads from the store. - * - * @param store The triple store. - * @param iri The data identifier. - * @param type Type name. - * @param mapping Property mappings. - * @returns A new data object. - */ - function getMappedResult(store, iri, type, mapping) { - var e_3, _a, e_4, _b; - var result = { '@id': iri, '@type': type }; - try { - for (var _c = __values(Object.entries(mapping)), _d = _c.next(); !_d.done; _d = _c.next()) { - var _e = __read(_d.value, 2), predicate = _e[0], key = _e[1]; - try { - for (var _f = (e_4 = void 0, __values(tripleStoreUtils.readQuads(store, result['@id'], predicate, null, null))), _g = _f.next(); !_g.done; _g = _f.next()) { - var quad = _g.value; - var value = quad.object.termType === 'Literal' ? rdfLiteral.fromRdf(quad.object) : quad.object.id; - result[key] = value; - } - } - catch (e_4_1) { e_4 = { error: e_4_1 }; } - finally { - try { - if (_g && !_g.done && (_b = _f.return)) _b.call(_f); - } - finally { if (e_4) throw e_4.error; } - } - } - } - catch (e_3_1) { e_3 = { error: e_3_1 }; } - finally { - try { - if (_d && !_d.done && (_a = _c.return)) _a.call(_c); - } - finally { if (e_3) throw e_3.error; } - } - return result; - } - - /* eslint-disable @typescript-eslint/naming-convention */ - /** Constants used to create entity accessors. */ - var PREFIXES = { - base: 'http://purl.org/ccf/latest/ccf.owl#', - ccf: 'http://purl.org/ccf/', - fma: 'http://purl.org/sig/ont/fma/fma', - obo: 'http://purl.obolibrary.org/obo/', - uberon: 'http://purl.obolibrary.org/obo/UBERON_', - cl: 'http://purl.obolibrary.org/obo/CL_', - 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/', - dcterms: 'http://purl.org/dc/terms/' - }; - /** Prefix factory. */ - var prefixer = tripleStoreUtils.Util.prefixes(PREFIXES, tripleStoreUtils.DataFactory); - var rdf = { - x: prefixer('rdf'), - type: prefixer('rdf')('type') - }; - var rdfs = { - x: prefixer('rdfs'), - label: prefixer('rdfs')('label'), - comment: prefixer('rdfs')('comment'), - isDefinedBy: prefixer('rdfs')('isDefinedBy'), - seeAlso: prefixer('rdfs')('seeAlso') - }; - /** CCF id helper. */ - var ccfx = prefixer('ccf'); - /** Common entity ids. */ - var entity = { - id: prefixer('ccf')('has_registration_location'), - label: prefixer('rdfs')('label'), - description: prefixer('rdfs')('comment'), - link: ccfx('url'), - sex: ccfx('sex'), - age: ccfx('age'), - bmi: ccfx('bmi'), - Male: tripleStoreUtils.DataFactory.literal('Male'), - Female: tripleStoreUtils.DataFactory.literal('Female'), - consortiumName: ccfx('consortium_name'), - providerName: ccfx('tissue_provider_name'), - providerUUID: ccfx('tissue_provider_uuid'), - donor: ccfx('comes_from'), - sections: ccfx('subdivided_into_sections'), - datasets: ccfx('generates_dataset'), - sampleType: ccfx('sample_type'), - TissueBlock: tripleStoreUtils.DataFactory.literal('Tissue Block'), - TissueSection: tripleStoreUtils.DataFactory.literal('Tissue Section'), - NonStandard: tripleStoreUtils.DataFactory.literal('Non-standard'), - sectionCount: ccfx('section_count'), - sectionSize: ccfx('section_size'), - sectionUnits: ccfx('section_size_unit'), - sectionNumber: ccfx('section_number'), - spatialEntity: ccfx('has_registration_location'), - ontologyTerms: ccfx('has_ontology_term'), - cellTypeTerms: ccfx('has_cell_type_term'), - technology: ccfx('technology'), - thumbnail: ccfx('thumbnail') - }; - /** CCF specific ids. */ - var ccf = { - x: ccfx, - base: prefixer('base'), - ontologyNode: { - label: ccfx('ccf_pref_label'), - parent: ccfx('ccf_part_of'), - children: ccfx('ccf_part_of'), - rui_rank: ccfx('rui_rank'), - synonymLabels: tripleStoreUtils.DataFactory.namedNode('http://www.geneontology.org/formats/oboInOwl#hasExactSynonym') - }, - asctb: { - part_of: ccfx('ccf_part_of'), - ct_is_a: ccfx('ccf_ct_isa'), - located_in: ccfx('ccf_located_in'), - characterizes: ccfx('ccf_characterizes') - }, - spatial: { - Female: prefixer('base')('VHFemale'), - Male: prefixer('base')('VHMale'), - BothSexes: prefixer('base')('VHBothSexes'), - FemaleOrgans: prefixer('base')('VHFemaleOrgans'), - MaleOrgans: prefixer('base')('VHMaleOrgans') - }, - SpatialObjectReference: ccfx('spatial_object_reference'), - SpatialEntity: ccfx('spatial_entity'), - SpatialPlacement: ccfx('spatial_placement'), - spatialObjectReference: { - file: ccfx('file_url'), - file_format: ccfx('file_format'), - file_subpath: ccfx('file_subpath') - }, - extractionSet: { - label: prefixer('rdfs')('label'), - rui_rank: ccfx('rui_rank') - }, - spatialEntity: { - label: prefixer('rdfs')('label'), - description: prefixer('rdfs')('comment'), - creator: prefixer('dcterms')('creator'), - creator_first_name: ccfx('creator_first_name'), - creator_last_name: ccfx('creator_last_name'), - creator_orcid: ccfx('creator_orcid'), - creation_date: prefixer('dcterms')('created'), - updated_date: ccfx('updated_date'), - ccf_annotations: ccfx('collides_with'), - representation_of: ccfx('representation_of'), - reference_organ: ccfx('has_reference_organ'), - extraction_set_for: ccfx('extraction_set_for'), - extraction_set: ccfx('has_extraction_set'), - sex: ccfx('organ_owner_sex'), - side: ccfx('organ_side'), - rui_rank: ccfx('rui_rank'), - slice_thickness: ccfx('slice_thickness'), - slice_count: ccfx('slice_count'), - x_dimension: ccfx('x_dimension'), - y_dimension: ccfx('y_dimension'), - z_dimension: ccfx('z_dimension'), - dimension_units: ccfx('dimension_unit'), - object: ccfx('has_object_reference') - }, - spatialPlacement: { - source: ccfx('placement_for'), - target: ccfx('placement_relative_to'), - placement_date: prefixer('dcterms')('created'), - x_scaling: ccfx('x_scaling'), - y_scaling: ccfx('y_scaling'), - z_scaling: ccfx('z_scaling'), - scaling_units: ccfx('scaling_unit'), - x_rotation: ccfx('x_rotation'), - y_rotation: ccfx('y_rotation'), - z_rotation: ccfx('z_rotation'), - w_rotation: ccfx('theta_rotation'), - rotation_order: ccfx('rotation_order'), - rotation_units: ccfx('rotation_unit'), - x_translation: ccfx('x_translation'), - y_translation: ccfx('y_translation'), - z_translation: ccfx('z_translation'), - translation_units: ccfx('translation_unit') - } - }; - /** Uberon specific ids. */ - var uberon = { - x: prefixer('uberon'), - body: prefixer('uberon')('0013702') - }; - /** CL specific ids. */ - var cl = { - x: prefixer('cl'), - cell: prefixer('cl')('0000000') - }; - /** FMA specific ids. */ - var fma = { - x: prefixer('fma') - }; - /** LMHA specific ids. */ - var lmha = { - x: prefixer('lmha') - }; - /** RUI accessors. */ - var rui = { - body: uberon.body, - cell: cl.cell, - respiratory_system: uberon.x('0001004'), - colon: uberon.x('0001155'), - left_lung: uberon.x('0002168'), - right_lung: uberon.x('0002167'), - left_bronchus: uberon.x('0002178'), - right_bronchus: uberon.x('0002177'), - kidney: uberon.x('0002113'), - ureter: uberon.x('0000056'), - eye: uberon.x('0000970'), - fallopian_tube: uberon.x('0003889'), - knee: uberon.x('0001465'), - ovary: uberon.x('0000992'), - trachea: uberon.x('0003126'), - aorta: uberon.x('0000947'), - blood: uberon.x('0000178'), - bone_marrow: uberon.x('0002371'), - male_reproductive_system: uberon.x('0000079'), - lymph_node: uberon.x('0000029'), - // Derived using console.log(ALL_POSSIBLE_ORGANS.map(o => ` ${o.name.toLowerCase().replace(',', '').replace(/ /g, '_')}: ${o.id.split('/').slice(-1)[0].split('_')[0].toLowerCase()}.x('${o.id.split('_').slice(-1)[0]}'),`).join('\n')); - blood_vasculature: uberon.x('0004537'), - brain: uberon.x('0000955'), - eye_left: uberon.x('0004548'), - eye_right: fma.x('54449'), - fallopian_tube_left: uberon.x('0001303'), - fallopian_tube_right: uberon.x('0001302'), - heart: uberon.x('0000948'), - kidney_left: uberon.x('0004538'), - kidney_right: uberon.x('0004539'), - knee_left: fma.x('24978'), - knee_right: fma.x('24977'), - large_intestine: uberon.x('0000059'), - liver: uberon.x('0002107'), - lungs: uberon.x('0002048'), - mesenteric_lymph_node: uberon.x('0002509'), - ovary_left: fma.x('7214'), - ovary_right: fma.x('7213'), - pancreas: uberon.x('0001264'), - pelvis: uberon.x('0001270'), - prostate_gland: uberon.x('0002367'), - skin: uberon.x('0002097'), - small_intestine: uberon.x('0002108'), - spleen: uberon.x('0002106'), - thymus: uberon.x('0002370'), - ureter_left: uberon.x('0001223'), - ureter_right: uberon.x('0001222'), - urinary_bladder: uberon.x('0001255'), - uterus: uberon.x('0000995') - }; - - /** - * Reverses the keys and values in a mapping. - * - * @param mapping The mapping to reverse. - * @returns The reversed mapping. - */ - function reverseMapping(mapping) { - var newMapping = {}; - Object.entries(mapping).forEach(function (_a) { - var _b = __read(_a, 2), prop = _b[0], predicate = _b[1]; - newMapping[predicate.id] = prop; - }); - return newMapping; - } - /** A mapping of spatial objects. */ - var mappings = { - spatialObjectReference: reverseMapping(ccf.spatialObjectReference), - spatialEntity: reverseMapping(ccf.spatialEntity), - spatialPlacement: reverseMapping(ccf.spatialPlacement) - }; - /** - * Creates a spatial object reference. - * - * @param store The triple store. - * @param iri The data identifier. - * @returns The new reference. - */ - function getSpatialObjectReference(store, iri) { - return getMappedResult(store, iri, 'SpatialObjectReference', mappings.spatialObjectReference); - } - /** - * Creates an extraction set data object. - * - * @param store The triple store. - * @param iri The data identifier. - * @returns The new entity. - */ - function getExtractionSet(store, iri) { - var result = getMappedResult(store, iri, 'ExtractionSet', mappings.spatialEntity); - result.extractionSites = lodash.sortBy(store.getSubjects(ccf.spatialEntity.extraction_set, iri, null) - .map(function (value) { return getSpatialEntity(store, value.id); }), ['rui_rank']); - return result; - } - /** - * Gets extraction sets associated with a reference organ - * - * @param store The triple store. - * @param iri The data identifier (the reference organ). - * @returns A set of extraction sets associated with the reference organ - */ - function getExtractionSets(store, iri) { - return lodash.sortBy(store.getSubjects(ccf.spatialEntity.extraction_set_for, iri, null) - .map(function (value) { return getExtractionSet(store, value.id); }), ['rui_rank']); - } - /** - * Gets the anatomical structures associated with a reference organ. - * - * @param store The triple store. - * @param iri The data identifier (reference organ). - * @returns The new entity. - */ - function getAnatomicalStructures(store, iri) { - return lodash.sortBy(store.getSubjects(ccf.spatialEntity.reference_organ, iri, null) - .map(function (value) { return getSpatialEntity(store, value.id); }) - .filter(function (e) { return e['@id'] !== iri; }), ['rui_rank']); - } - /** - * Gets all reference organs in the triple store - * - * @param store The triple store. - * @returns All the reference organs. - */ - function getReferenceOrgans(store) { - var results = []; - store.forEach(function (quad) { - if (quad.subject.id === quad.object.id) { - results.push(getSpatialEntity(store, quad.subject.id)); - } - }, null, ccf.spatialEntity.reference_organ, null, null); - return lodash.sortBy(results, ['rui_rank']); - } - /** - * Creates a spatial entity data object. - * - * @param store The triple store. - * @param iri The data identifier. - * @returns The new entity. - */ - function getSpatialEntity(store, iri) { - var result = getMappedResult(store, iri, 'SpatialEntity', mappings.spatialEntity); - // Default mapping will come back as an IRI which we can look up for the full object - if (result.object) { - result.object = getSpatialObjectReference(store, result.object); - } - if (result.ccf_annotations) { - result.ccf_annotations = store.getObjects(iri, ccf.spatialEntity.ccf_annotations, null).map(function (o) { return o.id; }); - } - store.forSubjects(function (subject) { return (result.entityId = subject.id); }, entity.spatialEntity, iri, null); - return result; - } - /** - * Creates a spatial placement object. - * - * @param store The triple store. - * @param iri The data identifier. - * @returns THe new placement object. - */ - function getSpatialPlacement(store, iri) { - var result = getMappedResult(store, iri, 'SpatialPlacement', mappings.spatialPlacement); - // Default mapping will come back as an IRI for source/target which we can look up for the full object - if (result.source) { - result.source = getSpatialEntity(store, result.source); - } - if (result.target) { - result.target = getSpatialEntity(store, result.target); - } - return result; - } - /** - * Creates a spatial entity based on another entity in the store. - * - * @param store The triple store. - * @param entityIRI The indentifier of the store entity. - * @returns A new entity. - */ - function getSpatialEntityForEntity(store, entityIRI) { - var spatialEntityNodes = store.getObjects(tripleStoreUtils.DataFactory.namedNode(entityIRI), entity.spatialEntity, null); - if (spatialEntityNodes.length > 0) { - return getSpatialEntity(store, spatialEntityNodes[0].id); - } - else { - return undefined; - } - } - - function applySpatialPlacement(tx, placement) { - var p = placement; - var factor; - switch (p.translation_units) { - case 'centimeter': - factor = 1 / 100; - break; - case 'millimeter': - factor = 1 / 1000; - break; - case 'meter': - default: - factor = 1; - break; - } - var T = [p.x_translation, p.y_translation, p.z_translation].map(function (t) { return t * factor; }); - var R = [p.x_rotation, p.y_rotation, p.z_rotation].map(core.toRadians); - var S = [p.x_scaling, p.y_scaling, p.z_scaling]; - return tx.translate(T).rotateXYZ(R).scale(S); - } - var CCFSpatialGraph = /** @class */ (function () { - function CCFSpatialGraph(db) { - this.db = db; - this.createGraph(); - } - CCFSpatialGraph.prototype.createGraph = function () { - var e_1, _a, e_2, _b; - var _this = this; - this.graph = new graphology.DirectedGraph(); - var store = this.db.store; - // Add all Spatial Object References - store.forSubjects(function (subject) { - _this.addNode(subject.id, 'SpatialObjectReference'); - }, rdf.type, ccf.SpatialObjectReference, null); - // Add all Spatial Entities - store.forSubjects(function (subject) { - _this.addNode(subject.id, 'SpatialEntity'); - }, rdf.type, ccf.SpatialEntity, null); - // Add all Spatial Placements - var edgeSource = {}; - try { - for (var _c = __values(tripleStoreUtils.readQuads(store, null, ccf.spatialPlacement.source, null, null)), _d = _c.next(); !_d.done; _d = _c.next()) { - var quad = _d.value; - edgeSource[quad.subject.id] = quad.object.id; - } - } - catch (e_1_1) { e_1 = { error: e_1_1 }; } - finally { - try { - if (_d && !_d.done && (_a = _c.return)) _a.call(_c); - } - finally { if (e_1) throw e_1.error; } - } - try { - for (var _e = __values(tripleStoreUtils.readQuads(store, null, ccf.spatialPlacement.target, null, null)), _f = _e.next(); !_f.done; _f = _e.next()) { - var quad = _f.value; - var source = edgeSource[quad.subject.id]; - if (source) { - this.addEdge(quad.subject.id, source, quad.object.id, 'SpatialPlacement'); - } - } - } - catch (e_2_1) { e_2 = { error: e_2_1 }; } - finally { - try { - if (_f && !_f.done && (_b = _e.return)) _b.call(_e); - } - finally { if (e_2) throw e_2.error; } - } - }; - CCFSpatialGraph.prototype.addNode = function (id, type) { - this.graph.mergeNode(id, { type: type }); - }; - CCFSpatialGraph.prototype.addEdge = function (id, source, target, type) { - this.graph.mergeDirectedEdge(source, target, { type: type, id: id }); - }; - CCFSpatialGraph.prototype.getTransformationMatrix = function (sourceIRI, targetIRI) { - var e_3, _a; - if (sourceIRI === targetIRI) { - return new core.Matrix4(core.Matrix4.IDENTITY); // identity - } - if (!this.graph.hasNode(sourceIRI) || !this.graph.hasNode(targetIRI)) { - return undefined; - } - var store = this.db.store; - var tx = new core.Matrix4(core.Matrix4.IDENTITY); - var path = shortestPath__default['default'](this.graph, sourceIRI, targetIRI); - if (path && path.length > 0) { - path.reverse(); - var target = ''; - try { - for (var path_1 = __values(path), path_1_1 = path_1.next(); !path_1_1.done; path_1_1 = path_1.next()) { - var source = path_1_1.value; - if (target) { - var placementId = this.graph.getEdgeAttribute(source, target, 'id'); - var placement = getSpatialPlacement(store, placementId); - applySpatialPlacement(tx, placement); - } - target = source; - } - } - catch (e_3_1) { e_3 = { error: e_3_1 }; } - finally { - try { - if (path_1_1 && !path_1_1.done && (_a = path_1.return)) _a.call(path_1); - } - finally { if (e_3) throw e_3.error; } - } - return tx; - } - else { - return undefined; - } - }; - CCFSpatialGraph.prototype.getSpatialPlacement = function (source, targetIri) { - var sourceIri = this.graph.hasNode(source['@id']) ? source['@id'] : undefined; - var placement = lodash.get(source, 'placement[0]', lodash.get(source, 'placement', undefined)); - var matrix; - if (placement && this.graph.hasNode(placement.target)) { - matrix = this.getTransformationMatrix(placement.target, targetIri); - if (matrix) { - matrix = applySpatialPlacement(matrix, placement); - } - } - else if (sourceIri) { - matrix = this.getTransformationMatrix(sourceIri, targetIri); - } - if (matrix) { - var euler = new core.Euler().fromRotationMatrix(matrix, core.Euler.XYZ); - var T = matrix.getTranslation().map(function (n) { return n * 1000; }); - var R = euler.toVector3().map(core.toDegrees); - var S = matrix.getScale().map(function (n) { return n < 1 && n > 0.999999 ? 1 : n; }); - return { - '@context': 'https://hubmapconsortium.github.io/hubmap-ontology/ccf-context.jsonld', - '@id': "http://purl.org/ccf/1.5/" + uuid.v4() + "_placement", - '@type': 'SpatialPlacement', - source: source['@id'], - target: targetIri, - placement_date: new Date().toISOString().split('T')[0], - x_scaling: S[0], - y_scaling: S[1], - z_scaling: S[2], - scaling_units: 'ratio', - x_rotation: R[0], - y_rotation: R[1], - z_rotation: R[2], - rotation_order: 'XYZ', - rotation_units: 'degree', - x_translation: T[0], - y_translation: T[1], - z_translation: T[2], - translation_units: 'millimeter' - }; - } - else { - return undefined; - } - }; - return CCFSpatialGraph; - }()); - - var CCFSpatialScene = /** @class */ (function () { - function CCFSpatialScene(db) { - this.db = db; - } - CCFSpatialScene.prototype.getSpatialEntity = function (iri) { - return getSpatialEntity(this.db.store, iri); - }; - CCFSpatialScene.prototype.getExtractionSets = function (iri) { - return getExtractionSets(this.db.store, iri); - }; - CCFSpatialScene.prototype.getExtractionSet = function (iri) { - return getExtractionSet(this.db.store, iri); - }; - CCFSpatialScene.prototype.getAnatomicalStructures = function (iri) { - return getAnatomicalStructures(this.db.store, iri); - }; - CCFSpatialScene.prototype.getReferenceOrgans = function () { - return getReferenceOrgans(this.db.store); - }; - CCFSpatialScene.prototype.getReferenceBody = function (filter) { - var bodyId; - switch (filter === null || filter === void 0 ? void 0 : filter.sex) { - case 'Male': - bodyId = ccf.spatial.Male.id; - break; - case 'Female': - bodyId = ccf.spatial.Female.id; - break; - case 'Both': - default: - bodyId = ccf.spatial.BothSexes.id; - break; - } - return this.getSpatialEntity(bodyId); - }; - CCFSpatialScene.prototype.getReferenceOrganSets = function (filter) { - var _this = this; - var organSet = this.getReferenceOrgans(); - switch (filter === null || filter === void 0 ? void 0 : filter.sex) { - case 'Male': - organSet = organSet.filter(function (s) { return s.sex === 'Male'; }); - break; - case 'Female': - organSet = organSet.filter(function (s) { return s.sex === 'Female'; }); - break; - case 'Both': - default: - break; - } - if (filter === null || filter === void 0 ? void 0 : filter.debug) { - organSet = organSet.map(function (o) { return [[o], _this.getAnatomicalStructures(o['@id'])]; }) - .reduce(function (acc, _e) { - var _f = __read(_e, 2), organ = _f[0], structures = _f[1]; - return acc.concat(structures.length > 0 ? structures : organ); - }, []); - } - return organSet; - }; - CCFSpatialScene.prototype.getReferenceSceneNodes = function (filter) { - var _this = this; - var body = this.getReferenceBody(filter); - var skinNodes = []; - var nodes = __spreadArray([], __read(this.getReferenceOrganSets(filter).map(function (organ) { - var isSkin = organ.representation_of === 'http://purl.obolibrary.org/obo/UBERON_0002097'; - var sceneNode = _this.getSceneNode(organ, body, { - color: [255, 255, 255, 255], opacity: isSkin ? 0.5 : 0.2, unpickable: true, _lighting: 'pbr', zoomBasedOpacity: !isSkin - }); - if (isSkin && sceneNode) { - skinNodes.push(sceneNode); - return undefined; - } - else { - return sceneNode; - } - }))); - if (skinNodes.length > 0) { - nodes = __spreadArray(__spreadArray([], __read(skinNodes)), __read(nodes)); - } - if (filter === null || filter === void 0 ? void 0 : filter.debug) { - // Debug bounding boxes - nodes = nodes.concat([ - this.getSceneNode(this.getSpatialEntity(ccf.base('VHRightKidney').id), body, { color: [0, 0, 255, 0.5 * 255], geometry: 'wireframe' }), - this.getSceneNode(this.getSpatialEntity(ccf.base('VHLeftKidney').id), body, { color: [255, 0, 0, 0.5 * 255], geometry: 'wireframe' }), - this.getSceneNode(this.getSpatialEntity(ccf.base('VHSpleenCC1').id), body, { color: [0, 255, 0, 0.5 * 255], geometry: 'wireframe' }), - this.getSceneNode(this.getSpatialEntity(ccf.base('VHSpleenCC2').id), body, { color: [0, 255, 0, 0.5 * 255], geometry: 'wireframe' }), - this.getSceneNode(this.getSpatialEntity(ccf.base('VHSpleenCC3').id), body, { color: [0, 255, 0, 0.5 * 255], geometry: 'wireframe' }) - ]); - } - return nodes.filter(function (s) { return s !== undefined; }); - }; - CCFSpatialScene.prototype.getReferenceOrganScene = function (organIri, filter) { - var _this = this; - var _a, _b; - var hasSexFilter = (filter === null || filter === void 0 ? void 0 : filter.sex) !== undefined && ((_a = filter === null || filter === void 0 ? void 0 : filter.sex) === null || _a === void 0 ? void 0 : _a.toLowerCase()) !== 'both'; - var organs = this.getReferenceOrgans().filter(function (o) { return o.representation_of === organIri && (!hasSexFilter || o.sex === (filter === null || filter === void 0 ? void 0 : filter.sex)); }); - if (organs.length > 0) { - var organ_1 = organs[0]; - var isSkin = organ_1.representation_of === 'http://purl.obolibrary.org/obo/UBERON_0002097'; - var organNode = this.getSceneNode(organ_1, organ_1, { - color: [255, 255, 255, 255], opacity: isSkin ? 0.5 : 0.2, unpickable: true, _lighting: 'pbr' - }); - var scene = ((_b = this.db.getSpatialEntities(filter)) !== null && _b !== void 0 ? _b : []).map(function (entity) { return _this.getSceneNode(entity, organ_1, { color: [255, 255, 255, 0.9 * 255] }); }); - return [organNode].concat(scene).filter(function (n) { return n !== undefined; }); - } - else { - return []; - } - }; - CCFSpatialScene.prototype.getEntitySceneNodes = function (filter) { - var _this = this; - var body = this.getReferenceBody(filter); - return this.db.getSpatialEntities(filter).map(function (entity) { return _this.getSceneNode(entity, body, { color: [255, 255, 255, 0.9 * 255] }); }).filter(function (s) { return s !== undefined; }); - }; - CCFSpatialScene.prototype.getSceneNode = function (source, target, nodeAttrs) { - if (nodeAttrs === void 0) { nodeAttrs = {}; } - var _a, _b, _c, _d; - var has3dObject = (_b = (_a = source === null || source === void 0 ? void 0 : source.object) === null || _a === void 0 ? void 0 : _a.file_format) === null || _b === void 0 ? void 0 : _b.startsWith('model/gltf'); - var sourceID = has3dObject && source.object ? source.object['@id'] : source['@id']; - var transform = this.db.graph.getTransformationMatrix(sourceID, target['@id']); - if (transform) { - if (has3dObject) { - transform = new core.Matrix4(core.Matrix4.IDENTITY).rotateX(core.toRadians(90)).multiplyLeft(transform); - } - else { - // Scale visible bounding boxes to the desired dimensions - var factor_1; - switch (source.dimension_units) { - case 'centimeter': - factor_1 = 1 / 100; - break; - case 'millimeter': - factor_1 = 1 / 1000; - break; - case 'meter': - default: - factor_1 = 1; - break; - } - var scale = [source.x_dimension, source.y_dimension, source.z_dimension].map(function (dim) { return dim * factor_1 / 2; }); - transform.scale(scale); - } - return Object.assign({ '@id': source['@id'], '@type': 'SpatialSceneNode', entityId: source.entityId, ccf_annotations: source.ccf_annotations, representation_of: source.representation_of, reference_organ: source.reference_organ, scenegraph: has3dObject ? (_c = source.object) === null || _c === void 0 ? void 0 : _c.file : undefined, scenegraphNode: has3dObject ? (_d = source.object) === null || _d === void 0 ? void 0 : _d.file_subpath : undefined, transformMatrix: transform, tooltip: source.label }, nodeAttrs); - } - else { - return undefined; - } - }; - CCFSpatialScene.prototype.getScene = function (filter) { - return __spreadArray(__spreadArray([], __read(this.getReferenceSceneNodes(filter))), __read(this.getEntitySceneNodes(filter))); - }; - return CCFSpatialScene; - }()); - - var HBM_PREFIX = 'https://entity.api.hubmapconsortium.org/entities/'; - // eslint-disable-next-line max-len - var DR1_VU_THUMBS = 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']); - // eslint-disable-next-line max-len - var UFL_THUMBS = { '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' }; - /** UUID to TMC mapping. */ - var GROUP_UUID_MAPPING = { - '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', - '5c106f29-ea2d-11e9-85e8-0efb3ba9a670': 'RTI-General Electric', - '301615f9-c870-11eb-a8dc-35ce3d8786fe': 'TMC-UConn' - }; - var ENTITY_CONTEXT = { - '@base': 'http://purl.org/ccf/latest/ccf-entity.owl#', - '@vocab': 'http://purl.org/ccf/latest/ccf-entity.owl#', - ccf: 'http://purl.org/ccf/', - 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' - }, - // eslint-disable-next-line @typescript-eslint/naming-convention - rui_location: { - '@id': 'has_spatial_entity', - '@type': '@id' - }, - ontologyTerms: { - '@id': 'has_ontology_term', - '@type': '@id' - }, - cellTypeTerms: { - '@id': 'has_cell_type_term', - '@type': '@id' - }, - thumbnail: { - '@id': 'has_thumbnail' - } - }; - /** - * Converts a hubmap response object into JsonLd. - * - * @param data The hubmap data. - * @returns The converted data. - */ - function hubmapResponseAsJsonLd(data, assetsApi, portalUrl, serviceToken, debug) { - var e_1, _c; - if (assetsApi === void 0) { assetsApi = ''; } - if (portalUrl === void 0) { portalUrl = ''; } - if (debug === void 0) { debug = false; } - var entries = lodash.get(data, 'hits.hits', []) - .map(function (e) { return lodash.get(e, '_source', {}); }) - .sort(function (a, b) { return a['uuid'].localeCompare(b['uuid']); }); - var donorLookup = {}; - var unflattened = entries.map(function (e) { return new HuBMAPTissueBlock(e, assetsApi, portalUrl, serviceToken).toJsonLd(); }); - try { - for (var unflattened_1 = __values(unflattened), unflattened_1_1 = unflattened_1.next(); !unflattened_1_1.done; unflattened_1_1 = unflattened_1.next()) { - var donor = unflattened_1_1.value; - var donorId = donor['@id']; - if (!donorLookup[donorId]) { - donorLookup[donorId] = donor; - } - else { - var samples = donorLookup[donorId].samples; - samples.push(donor.samples[0]); - } - } - } - catch (e_1_1) { e_1 = { error: e_1_1 }; } - finally { - try { - if (unflattened_1_1 && !unflattened_1_1.done && (_c = unflattened_1.return)) _c.call(unflattened_1); - } - finally { if (e_1) throw e_1.error; } - } - var donors = Object.values(donorLookup); - if (debug) { - debugDonors(donors); - console.log(donors.map(function (d) { return (Object.assign({ '@context': ENTITY_CONTEXT }, d)); })); - } - return { '@context': ENTITY_CONTEXT, '@graph': donors }; - } - function debugDonors(donors) { - var e_2, _c; - var datasets = []; - var deleted = 0; - try { - for (var _d = __values(donors.filter(function (d) { return d.samples.length > 1; })), _e = _d.next(); !_e.done; _e = _d.next()) { - var donor = _e.value; - var samples = donor.samples; - var _loop_1 = function (i) { - var e_3, _f; - var blockId = samples[i]['@id']; - datasets = datasets.concat(samples[i].datasets); - try { - for (var _g = (e_3 = void 0, __values(samples[i].sections)), _h = _g.next(); !_h.done; _h = _g.next()) { - var section = _h.value; - datasets = datasets.concat(section.datasets); - } - } - catch (e_3_1) { e_3 = { error: e_3_1 }; } - finally { - try { - if (_h && !_h.done && (_f = _g.return)) _f.call(_g); - } - finally { if (e_3) throw e_3.error; } - } - for (var j = i + 1; j < samples.length; j++) { - var sections = samples[j].sections; - if (sections.find(function (s) { return s['@id'] === blockId; })) { - samples[i].deleteMe = true; - deleted++; - } - } - }; - for (var i = 0; i < samples.length; i++) { - _loop_1(i); - } - donor.samples = samples.filter(function (s) { return s.deleteMe !== true; }); - } - } - catch (e_2_1) { e_2 = { error: e_2_1 }; } - finally { - try { - if (_e && !_e.done && (_c = _d.return)) _c.call(_d); - } - finally { if (e_2) throw e_2.error; } - } - if (deleted > 0) { - console.log("\u26A0 " + deleted + " sections identified as blocks"); - } - } - var HuBMAPTissueBlock = /** @class */ (function () { - function HuBMAPTissueBlock(data, assetsApi, portalUrl, serviceToken) { - var e_4, _c, e_5, _d; - if (assetsApi === void 0) { assetsApi = ''; } - if (portalUrl === void 0) { portalUrl = ''; } - var _a, _b; - this.data = data; - this.bad = false; - this['@type'] = 'Sample'; - this.sample_type = 'Tissue Block'; - var entityType = this.data.entity_type; - if (entityType !== 'Sample') { - this.bad = true; - return; - } - var ancestors = (this.data.ancestors || []); - var descendants = (this.data.descendants || []); - var donor = ancestors.find(function (e) { return e.entity_type === 'Donor'; }); - this.donor = this.getDonor(donor, portalUrl); - var ruiLocation = this.getRuiLocation(data, this.donor); - if (!ruiLocation) { - this.bad = true; - } - else { - this.rui_location = ruiLocation; - } - if (!GROUP_UUID_MAPPING[data.group_uuid]) { - GROUP_UUID_MAPPING[data.group_uuid] = data.group_name; - } - var dateEntered = new Date(data.last_modified_timestamp).toLocaleDateString(); - var groupName = GROUP_UUID_MAPPING[data.group_uuid] || data.group_name; - var creator = data.created_by_user_displayname; - this['@id'] = HBM_PREFIX + data.uuid; - this.label = "Registered " + dateEntered + ", " + creator + ", " + groupName; - this.link = portalUrl + "browse/sample/" + data.uuid; - var sectionLookup = {}; - var sections = []; - this.sections = sections; - var datasets = []; - this.datasets = datasets; - try { - for (var _e = __values(descendants.filter(function (d) { return d.entity_type === 'Sample'; })), _f = _e.next(); !_f.done; _f = _e.next()) { - var descendant = _f.value; - var section = this.getSection(descendant, data, portalUrl); - var sectionId = descendant.submission_id; - sectionLookup[sectionId] = section; - sections.push(section); - section.section_number = (_a = section.section_number) !== null && _a !== void 0 ? _a : sections.length; - } - } - catch (e_4_1) { e_4 = { error: e_4_1 }; } - finally { - try { - if (_f && !_f.done && (_c = _e.return)) _c.call(_e); - } - finally { if (e_4) throw e_4.error; } - } - try { - for (var descendants_1 = __values(descendants), descendants_1_1 = descendants_1.next(); !descendants_1_1.done; descendants_1_1 = descendants_1.next()) { - var descendant = descendants_1_1.value; - if (descendant.entity_type === 'Dataset') { - var dataset = this.getDataset(descendant, assetsApi, portalUrl, serviceToken); - var sectionId = lodash.get(descendant, ['ingest_metadata', 'metadata', 'tissue_id']); - if (sectionLookup[sectionId]) { - (_b = sectionLookup[sectionId].datasets) === null || _b === void 0 ? void 0 : _b.push(dataset); - } - else { - datasets.push(dataset); - } - } - } - } - catch (e_5_1) { e_5 = { error: e_5_1 }; } - finally { - try { - if (descendants_1_1 && !descendants_1_1.done && (_d = descendants_1.return)) _d.call(descendants_1); - } - finally { if (e_5) throw e_5.error; } - } - var loc = ruiLocation !== null && ruiLocation !== void 0 ? ruiLocation : {}; - var dims = loc.x_dimension + " x " + loc.y_dimension + " x " + loc.z_dimension + " " + loc.dimension_units; - this.section_count = loc.slice_count || sections.length; - var sSize = parseFloat((loc.slice_thickness || - ((loc.z_dimension || 0) / Math.max(this.section_count, 1))) - .toFixed(1)); - this.section_size = sSize; - var sUnits = loc.dimension_units || 'millimeter'; - this.section_units = sUnits; - this.description = dims + ", " + sSize + " " + sUnits + ", " + data.specimen_type + ", " + this.section_count + " Sections"; - sections.forEach(function (section, index) { - section.description = loc.x_dimension + " x " + loc.y_dimension + " x " + sSize + " " + sUnits + ", " + sSize + " " + sUnits + ", " + section.description; - section.section_number = index + 1; - }); - } - HuBMAPTissueBlock.prototype.getSection = function (section, data, portalUrl) { - var dateEntered = new Date(section.last_modified_timestamp).toLocaleDateString(); - var groupName = GROUP_UUID_MAPPING[section.group_uuid] || section.group_name; - var creator = section.created_by_user_displayname; - return { - '@id': HBM_PREFIX + section.uuid, - '@type': 'Sample', - label: "Registered " + dateEntered + ", " + creator + ", " + groupName, - description: "" + data.specimen_type, - link: portalUrl + "browse/sample/" + section.uuid, - sample_type: 'Tissue Section', - section_number: 1, - samples: [], - datasets: [] - }; - }; - HuBMAPTissueBlock.prototype.getDataset = function (dataset, assetsApi, portalUrl, serviceToken) { - if (assetsApi === void 0) { assetsApi = ''; } - if (portalUrl === void 0) { portalUrl = ''; } - var _a; - var dateEntered = new Date(dataset.last_modified_timestamp).toLocaleDateString(); - var groupName = GROUP_UUID_MAPPING[dataset.group_uuid] || dataset.group_name; - var creator = dataset.created_by_user_displayname; - var types = __spreadArray(__spreadArray([], __read(dataset.data_types)), [ - lodash.get(dataset, ['ingest_metadata', 'metadata', 'assay_type'], '') - ]); - var typesSearch = types.join('|').toLowerCase(); - var technology; - var thumbnail = 'assets/icons/ico-unknown.svg'; - if (typesSearch.indexOf('10x') !== -1) { - technology = '10x'; - thumbnail = 'assets/icons/ico-bulk-10x.svg'; - } - else if (typesSearch.indexOf('af') !== -1) { - technology = 'AF'; - thumbnail = 'assets/icons/ico-spatial-af.svg'; - } - else if (typesSearch.indexOf('codex') !== -1) { - technology = 'CODEX'; - thumbnail = 'assets/icons/ico-spatial-codex.svg'; - } - else if (typesSearch.indexOf('imc') !== -1) { - technology = 'IMC'; - thumbnail = 'assets/icons/ico-spatial-imc.svg'; - } - else if ((typesSearch.indexOf('lc') !== -1) && (typesSearch.indexOf('af') === -1)) { - technology = 'LC'; - thumbnail = 'assets/icons/ico-bulk-lc.svg'; - } - else if (typesSearch.indexOf('maldi') !== -1) { - technology = 'MALDI'; - } - else if (typesSearch.indexOf('pas') !== -1) { - technology = 'PAS'; - } - else { - technology = 'OTHER'; - } - thumbnail = (_a = this.getDatasetThumbnail(dataset, assetsApi, serviceToken)) !== null && _a !== void 0 ? _a : thumbnail; - return { - '@id': HBM_PREFIX + dataset.uuid, - '@type': 'Dataset', - label: "Registered " + dateEntered + ", " + creator + ", " + groupName, - description: "Data/Assay Types: " + types.join(', '), - link: portalUrl + "browse/dataset/" + dataset.uuid, - technology: technology, - thumbnail: thumbnail - }; - }; - HuBMAPTissueBlock.prototype.getDatasetThumbnail = function (dataset, assetsApi, serviceToken) { - if (dataset.thumbnail_file) { - var thumbnailFile = dataset.thumbnail_file; - return assetsApi + "/" + thumbnailFile.file_uuid + "/" + thumbnailFile.filename + (serviceToken ? "?token=" + serviceToken : ''); - } - else if (dataset.group_uuid === '73bb26e4-ed43-11e8-8f19-0a7c1eab007a') { // TMC-Vanderbilt - var tiffs = lodash.get(dataset, 'metadata.files', []) - .filter(function (f) { return /\.(ome\.tif|ome\.tiff)$/.test(f.rel_path); }) - .filter(function (f) { return !/(multilayer\.ome\.tif|_ac\.ome\.tif)/.test(f.rel_path); }) - .filter(function (f) { return DR1_VU_THUMBS.has(f.rel_path.split('/').slice(-1)[0].split('?')[0].replace('.ome.tif', '_thumbnail.jpg')); }) - .map(function (f) { return assetsApi + "/" + dataset.uuid + "/" + f.rel_path + (serviceToken ? "?token=" + serviceToken : ''); }); - if (tiffs.length > 0) { - var thumb = tiffs[0].split('/').slice(-1)[0].split('?')[0].replace('.ome.tif', '_thumbnail.jpg'); - if (DR1_VU_THUMBS.has(thumb)) { - return "assets/thumbnails/TMC-Vanderbilt/DR1/" + thumb; - } - } - } - else if (dataset.group_uuid === '07a29e4c-ed43-11e8-b56a-0e8017bdda58') { // TMC-Florida - var thumb = UFL_THUMBS[dataset.hubmap_id]; - if (thumb) { - return "assets/thumbnails/TMC-Florida/" + thumb; - } - } - return undefined; - }; - HuBMAPTissueBlock.prototype.getDonor = function (donor, portalUrl) { - var e_6, _c; - var donorDescription = (donor.description || '').toLowerCase(); - var sex; - if (donorDescription.includes('female')) { - sex = 'Female'; - } - else if (donorDescription.includes('male')) { - sex = 'Male'; - } - var ageMatch = donorDescription.match(/age ([0-9]+)/); - var age; - if (ageMatch) { - age = lodash.toNumber(ageMatch[1]); - } - var bmi; - try { - for (var _d = __values(lodash.get(donor, 'metadata.organ_donor_data', lodash.get(donor, 'metadata.living_donor_data', []))), _e = _d.next(); !_e.done; _e = _d.next()) { - var md = _e.value; - if (md.preferred_term === 'Feminine gender' || md.preferred_term === 'Female') { - sex = 'Female'; - } - else if (md.preferred_term === 'Masculine gender' || md.preferred_term === 'Male') { - sex = 'Male'; - } - else if (md.preferred_term === 'Current chronological age' || md.preferred_term === 'Age') { - age = lodash.toNumber(md.data_value); - } - else if (md.preferred_term === 'Body mass index') { - bmi = lodash.toNumber(md.data_value); - } - } - } - catch (e_6_1) { e_6 = { error: e_6_1 }; } - finally { - try { - if (_e && !_e.done && (_c = _d.return)) _c.call(_d); - } - finally { if (e_6) throw e_6.error; } - } - var label = ''; - if (sex && age) { - label += sex + ", Age " + age; - if (bmi) { - label += ", BMI " + bmi.toFixed(1); - } - } - var dateEntered = new Date(donor.last_modified_timestamp).toLocaleDateString(); - var groupName = GROUP_UUID_MAPPING[donor.group_uuid] || donor.group_name; - var creator = donor.created_by_user_displayname; - return { - '@id': HBM_PREFIX + donor.uuid, - '@type': 'Donor', - label: label, - description: "Entered " + dateEntered + ", " + creator + ", " + groupName, - link: portalUrl + "browse/donor/" + donor.uuid, - age: age, - sex: sex, - bmi: bmi, - consortium_name: 'HuBMAP', - provider_name: groupName, - provider_uuid: donor.group_uuid, - samples: [] - }; - }; - HuBMAPTissueBlock.prototype.getRuiLocation = function (data, donor) { - var _a; - var spatialEntity; - var ruiLocation = data.rui_location; - if (ruiLocation) { - // RUI Location may come in as an unparsed string - if (typeof ruiLocation === 'string') { - ruiLocation = JSON.parse(ruiLocation); - } - if (ruiLocation.alignment_id) { // Detect RUI 0.5 generated JSON - console.log('Detected a deprecated rui_location', data.uuid); - } - else if (ruiLocation['@id']) { // Detect RUI 1.0+ generated JSON-LD - // eslint-disable-next-line @typescript-eslint/no-explicit-any - spatialEntity = ruiLocation; - } - } - if (spatialEntity) { - // Patch to fix RUI 0.5 Kidney and Spleen Placements - var target = (_a = lodash.get(spatialEntity, ['placement', 'target'])) !== null && _a !== void 0 ? _a : ''; - if (target.startsWith('http://purl.org/ccf/latest/ccf.owl#VHSpleenCC')) { - if (donor.sex === 'Male') { - lodash.set(spatialEntity, ['placement', 'target'], target.replace('#VHSpleenCC', '#VHMSpleenCC')); - } - else { - lodash.set(spatialEntity, ['placement', 'target'], target.replace('#VHSpleenCC', '#VHFSpleenCC')); - } - } - else if (target === 'http://purl.org/ccf/latest/ccf.owl#VHLeftKidney' || target === 'http://purl.org/ccf/latest/ccf.owl#VHRightKidney') { - if (donor.sex === 'Male') { - lodash.set(spatialEntity, ['placement', 'target'], target.replace('#VH', '#VHM') + '_Patch'); - } - else { - lodash.set(spatialEntity, ['placement', 'target'], target.replace('#VH', '#VHF') + '_Patch'); - } - } - } - return spatialEntity; - }; - HuBMAPTissueBlock.prototype.getTissueBlock = function () { - return lodash.omit(Object.assign({}, this), ['data', 'bad', 'donor']); - }; - HuBMAPTissueBlock.prototype.toJsonLd = function () { - return Object.assign(Object.assign({}, this.donor), { samples: [this.getTissueBlock()] }); - }; - return HuBMAPTissueBlock; - }()); - - // Reduce this value if including more data fields - var PER_API_SEARCH_REQUEST_COUNT = 250; - var INCLUDED_DATA_FIELDS = [ - 'uuid', 'entity_type', - 'group_uuid', 'group_name', - 'last_modified_timestamp', 'created_by_user_displayname', - 'ancestors.entity_type', - 'ancestors.description', - 'ancestors.metadata.organ_donor_data.preferred_term', - 'ancestors.metadata.organ_donor_data.data_value', - 'ancestors.metadata.living_donor_data.preferred_term', - 'ancestors.metadata.living_donor_data.data_value', - 'ancestors.last_modified_timestamp', - 'ancestors.group_uuid', - 'ancestors.group_name', - 'ancestors.created_by_user_displayname', - 'ancestors.uuid', - 'descendants.entity_type', - 'descendants.ingest_metadata.metadata.tissue_id', - 'descendants.last_modified_timestamp', - 'descendants.group_uuid', - 'descendants.group_name', - 'descendants.created_by_user_displayname', - 'descendants.uuid', - 'descendants.data_types', - 'descendants.ingest_metadata.metadata.assay_type', - 'descendants.thumbnail_file', - 'descendants.metadata.files.rel_path', - 'rui_location', 'specimen_type' - ]; - var DEFAULT_API_SEARCH_QUERY = { - exists: { - field: 'rui_location' - } - }; - function getApiSearchHeaders(token) { - var headers = new Headers(); - headers.append('Content-type', 'application/json'); - if (token) { - headers.append('Authorization', "Bearer " + token); - } - return headers; - } - function getApiSearchBody(from, size, query) { - var bodyObj = { - version: true, - from: from, - size: size, - stored_fields: ['*'], - script_fields: {}, - docvalue_fields: [], - query: query !== null && query !== void 0 ? query : DEFAULT_API_SEARCH_QUERY, - _source: { - includes: INCLUDED_DATA_FIELDS - } - }; - return JSON.stringify(bodyObj); - } - function doSearchRequest(url, init) { - return __awaiter(this, void 0, void 0, function () { - var res, _a, _error_1; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: - _b.trys.push([0, 5, , 6]); - return [4 /*yield*/, fetch(url, init)]; - case 1: - res = _b.sent(); - if (!res.ok) return [3 /*break*/, 3]; - return [4 /*yield*/, res.json()]; - case 2: - _a = (_b.sent()); - return [3 /*break*/, 4]; - case 3: - _a = undefined; - _b.label = 4; - case 4: return [2 /*return*/, _a]; - case 5: - _error_1 = _b.sent(); - return [2 /*return*/, undefined]; - case 6: return [2 /*return*/]; - } - }); - }); - } - function doApiSearch(url, token, query) { - return __awaiter(this, void 0, void 0, function () { - var perReqCount, headers, body, firstResult, totalCount, requests, from, results, items; - var _a; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: - perReqCount = PER_API_SEARCH_REQUEST_COUNT; - headers = getApiSearchHeaders(token); - body = getApiSearchBody(0, perReqCount, query); - return [4 /*yield*/, doSearchRequest(url, { method: 'POST', headers: headers, body: body })]; - case 1: - firstResult = _b.sent(); - if (!firstResult) { - return [2 /*return*/, undefined]; - } - totalCount = firstResult.hits.total.value; - if (totalCount <= perReqCount) { - return [2 /*return*/, firstResult]; - } - requests = []; - for (from = perReqCount; from < totalCount; from += perReqCount) { - requests.push(doSearchRequest(url, { - method: 'POST', - headers: headers, - body: getApiSearchBody(from, perReqCount, query) - })); - } - return [4 /*yield*/, Promise.all(requests)]; - case 2: - results = _b.sent(); - if (results.some(function (res) { return !res; })) { - return [2 /*return*/, undefined]; - } - items = results.map(function (res) { return res.hits.hits; }); - return [2 /*return*/, Object.assign(Object.assign({}, firstResult), { hits: Object.assign(Object.assign({}, firstResult.hits), { hits: (_a = firstResult.hits.hits).concat.apply(_a, __spreadArray([], __read(items))) }) })]; - } - }); - }); - } - /** - * Search the HuBMAP Search API and return CCF-compatible JSON-LD data - * - * @param dataUrl the search API url - * @param serviceType 'static' if a statically saved response or 'search-api' if querying the search-api live - * @param query the elastic search query to use - * @param serviceToken the api key to the search-api - * @param assetsApi the assets api endpoint - * @param portalUrl the portal url to point to - * @returns CCF-compatible JSON-LD data or undefined on error - */ - function searchHubmap(dataUrl, serviceType, query, serviceToken, assetsApi, portalUrl) { - if (assetsApi === void 0) { assetsApi = ''; } - if (portalUrl === void 0) { portalUrl = ''; } - return __awaiter(this, void 0, void 0, function () { - var hubmapData; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - if (!(serviceType === 'static')) return [3 /*break*/, 2]; - return [4 /*yield*/, doSearchRequest(dataUrl)]; - case 1: - hubmapData = _a.sent(); - return [3 /*break*/, 4]; - case 2: - if (!(serviceType === 'search-api')) return [3 /*break*/, 4]; - return [4 /*yield*/, doApiSearch(dataUrl, serviceToken, query)]; - case 3: - hubmapData = _a.sent(); - _a.label = 4; - case 4: - if (hubmapData) { - return [2 /*return*/, hubmapResponseAsJsonLd(hubmapData, assetsApi, portalUrl, serviceToken)]; - } - else { - console.warn("Unable to load " + dataUrl + " as HuBMAP Data"); - return [2 /*return*/, undefined]; - } - return [2 /*return*/]; - } - }); - }); - } - /** - * Adds hubmap data from a url to the triple store. - * - * @param store The triple store. - * @param dataUrl The data url. - * @param serviceType The service type. - */ - function addHubmapDataToStore(store, dataUrl, serviceType, serviceToken, assetsApi, portalUrl) { - if (assetsApi === void 0) { assetsApi = ''; } - if (portalUrl === void 0) { portalUrl = ''; } - return __awaiter(this, void 0, void 0, function () { - var hubmapData; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, searchHubmap(dataUrl, serviceType, undefined, serviceToken, assetsApi, portalUrl)]; - case 1: - hubmapData = _a.sent(); - if (!hubmapData) return [3 /*break*/, 3]; - return [4 /*yield*/, tripleStoreUtils.addJsonLdToStore(hubmapData, store)]; - case 2: - _a.sent(); - _a.label = 3; - case 3: return [2 /*return*/]; - } - }); - }); - } - - function getObjects(store, ids, predicate) { - var e_1, _a, e_2, _b; - var objects = new Set(); - try { - for (var ids_1 = __values(ids), ids_1_1 = ids_1.next(); !ids_1_1.done; ids_1_1 = ids_1.next()) { - var id = ids_1_1.value; - try { - for (var _c = (e_2 = void 0, __values(tripleStoreUtils.readQuads(store, id, predicate, null, null))), _d = _c.next(); !_d.done; _d = _c.next()) { - var quad = _d.value; - objects.add(quad.object.id); - } - } - catch (e_2_1) { e_2 = { error: e_2_1 }; } - finally { - try { - if (_d && !_d.done && (_b = _c.return)) _b.call(_c); - } - finally { if (e_2) throw e_2.error; } - } - } - } - catch (e_1_1) { e_1 = { error: e_1_1 }; } - finally { - try { - if (ids_1_1 && !ids_1_1.done && (_a = ids_1.return)) _a.call(ids_1); - } - finally { if (e_1) throw e_1.error; } - } - return objects; - } - /** - * Computes aggregate results. - * - * @param ids Ids of objects to calculate aggregate over. - * @param store The triple store. - * @returns The list of aggregate results. - */ - function getAggregateResults(ids, store) { - var e_3, _a, e_4, _b; - var donors = getObjects(store, ids, entity.donor.id); - var centers = getObjects(store, donors, entity.providerUUID.id); - var tissueBlocks = new Set(); - try { - for (var ids_2 = __values(ids), ids_2_1 = ids_2.next(); !ids_2_1.done; ids_2_1 = ids_2.next()) { - var id = ids_2_1.value; - try { - for (var _c = (e_4 = void 0, __values(tripleStoreUtils.readQuads(store, id, entity.spatialEntity, null, null))), _d = _c.next(); !_d.done; _d = _c.next()) { - var quad = _d.value; - tissueBlocks.add(quad.subject.id); - } - } - catch (e_4_1) { e_4 = { error: e_4_1 }; } - finally { - try { - if (_d && !_d.done && (_b = _c.return)) _b.call(_c); - } - finally { if (e_4) throw e_4.error; } - } - } - } - catch (e_3_1) { e_3 = { error: e_3_1 }; } - finally { - try { - if (ids_2_1 && !ids_2_1.done && (_a = ids_2.return)) _a.call(ids_2); - } - finally { if (e_3) throw e_3.error; } - } - var tissueSections = getObjects(store, tissueBlocks, entity.sections.id); - var tissueDatasets = new Set(__spreadArray(__spreadArray([], __read(getObjects(store, tissueBlocks, entity.datasets.id))), __read(getObjects(store, tissueSections, entity.datasets.id)))); - var results = { - 'Tissue Data Providers': centers.size, - Donors: donors.size, - 'Tissue Blocks': tissueBlocks.size, - 'Tissue Sections': tissueSections.size, - 'Tissue Datasets': tissueDatasets.size - }; - return Object.entries(results).map(function (_a) { - var _b = __read(_a, 2), label = _b[0], count = _b[1]; - return ({ label: label, count: count }); - }); - } - /** - * Get a list of technology names used by datasets - * - * @param store The triple store. - * @returns list of unique technology names in the data - */ - function getDatasetTechnologyNames(store) { - var e_5, _a; - var names = new Set(); - try { - for (var _b = __values(tripleStoreUtils.readQuads(store, null, entity.technology, null, null)), _c = _b.next(); !_c.done; _c = _b.next()) { - var quad = _c.value; - names.add(quad.object.value); - } - } - catch (e_5_1) { e_5 = { error: e_5_1 }; } - finally { - try { - if (_c && !_c.done && (_a = _b.return)) _a.call(_b); - } - finally { if (e_5) throw e_5.error; } - } - return Array.from(names).sort(); - } - /** - * Get a list of provider names from the database - * - * @param store The triple store. - * @returns list of unique provider names in the data - */ - function getProviderNames(store) { - var e_6, _a; - var names = new Set(); - try { - for (var _b = __values(tripleStoreUtils.readQuads(store, null, entity.providerName, null, null)), _c = _b.next(); !_c.done; _c = _b.next()) { - var quad = _c.value; - names.add(quad.object.value); - } - } - catch (e_6_1) { e_6 = { error: e_6_1 }; } - finally { - try { - if (_c && !_c.done && (_a = _b.return)) _a.call(_b); - } - finally { if (e_6) throw e_6.error; } - } - return Array.from(names).sort(); - } - - var _a$1; - var spatialEntityDimensions = (_a$1 = {}, - _a$1[ccf.spatialEntity.x_dimension.id] = 'x', - _a$1[ccf.spatialEntity.y_dimension.id] = 'y', - _a$1[ccf.spatialEntity.z_dimension.id] = 'z', - _a$1); - function getSpatialEntityDimensions(store, iri) { - var dims = getMappedResult(store, iri, 'Dimensions', spatialEntityDimensions); - return [dims.x, dims.y, dims.z]; - } - function getOrientedBoundingBox(store, graph, sourceIri, targetIri) { - var matrix = graph.getTransformationMatrix(sourceIri, targetIri); - var result = undefined; - if (matrix) { - var center = matrix.getTranslation(); - var halfSize = getSpatialEntityDimensions(store, sourceIri).map(function (n) { return n / 1000 / 2; }); - var quaternion = new core.Euler().fromRotationMatrix(matrix, core.Euler.XYZ).toQuaternion().normalize().calculateW(); - result = new culling.OrientedBoundingBox().fromCenterHalfSizeQuaternion(center, halfSize, quaternion); - } - return result; - } - function filterByProbingSphere(store, graph, seen, search) { - var e_1, _a; - var x = search.x, y = search.y, z = search.z, radius = search.radius, target = search.target; - var newSeen = new Set(); - var radiusSquared = (radius / 1000) * (radius / 1000); - try { - for (var seen_1 = __values(seen), seen_1_1 = seen_1.next(); !seen_1_1.done; seen_1_1 = seen_1.next()) { - var sourceIri = seen_1_1.value; - var boundingBox = getOrientedBoundingBox(store, graph, sourceIri, target); - if (boundingBox) { - var distanceSquared = boundingBox.distanceSquaredTo([x, y, z].map(function (n) { return n / 1000; })); - if (distanceSquared <= radiusSquared) { - newSeen.add(sourceIri); - } - } - } - } - catch (e_1_1) { e_1 = { error: e_1_1 }; } - finally { - try { - if (seen_1_1 && !seen_1_1.done && (_a = seen_1.return)) _a.call(seen_1); - } - finally { if (e_1) throw e_1.error; } - } - return newSeen; - } - - function filterWithDonor(store, seen, callback) { - var e_1, _h, e_2, _j, e_3, _k, e_4, _l; - var _a, _b; - var donor2entity = new Map(); - var donors = new Set(); - try { - for (var seen_1 = __values(seen), seen_1_1 = seen_1.next(); !seen_1_1.done; seen_1_1 = seen_1.next()) { - var subject = seen_1_1.value; - try { - for (var _m = (e_2 = void 0, __values(tripleStoreUtils.readQuads(store, subject, entity.donor, null, null))), _o = _m.next(); !_o.done; _o = _m.next()) { - var quad = _o.value; - donors.add(quad.object.id); - if (!donor2entity.has(quad.object.id)) { - donor2entity.set(quad.object.id, [subject]); - } - else { - (_a = donor2entity.get(quad.object.id)) === null || _a === void 0 ? void 0 : _a.push(subject); - } - } - } - catch (e_2_1) { e_2 = { error: e_2_1 }; } - finally { - try { - if (_o && !_o.done && (_j = _m.return)) _j.call(_m); - } - finally { if (e_2) throw e_2.error; } - } - } - } - catch (e_1_1) { e_1 = { error: e_1_1 }; } - finally { - try { - if (seen_1_1 && !seen_1_1.done && (_h = seen_1.return)) _h.call(seen_1); - } - finally { if (e_1) throw e_1.error; } - } - var newDonors = callback(donors); - var newSeen = new Set(); - try { - for (var newDonors_1 = __values(newDonors), newDonors_1_1 = newDonors_1.next(); !newDonors_1_1.done; newDonors_1_1 = newDonors_1.next()) { - var d = newDonors_1_1.value; - try { - for (var _p = (e_4 = void 0, __values((_b = donor2entity.get(d)) !== null && _b !== void 0 ? _b : [])), _q = _p.next(); !_q.done; _q = _p.next()) { - var s = _q.value; - newSeen.add(s); - } - } - catch (e_4_1) { e_4 = { error: e_4_1 }; } - finally { - try { - if (_q && !_q.done && (_l = _p.return)) _l.call(_p); - } - finally { if (e_4) throw e_4.error; } - } - } - } - catch (e_3_1) { e_3 = { error: e_3_1 }; } - finally { - try { - if (newDonors_1_1 && !newDonors_1_1.done && (_k = newDonors_1.return)) _k.call(newDonors_1); - } - finally { if (e_3) throw e_3.error; } - } - return newSeen; - } - function filterWithSpatialEntity(store, seen, callback) { - var e_5, _h, e_6, _j, e_7, _k, e_8, _l; - var _a, _b; - var spatial2entity = new Map(); - var entities = new Set(); - try { - for (var seen_2 = __values(seen), seen_2_1 = seen_2.next(); !seen_2_1.done; seen_2_1 = seen_2.next()) { - var subject = seen_2_1.value; - try { - for (var _m = (e_6 = void 0, __values(tripleStoreUtils.readQuads(store, subject, entity.spatialEntity, null, null))), _o = _m.next(); !_o.done; _o = _m.next()) { - var quad = _o.value; - entities.add(quad.object.id); - if (!spatial2entity.has(quad.object.id)) { - spatial2entity.set(quad.object.id, [subject]); - } - else { - (_a = spatial2entity.get(quad.object.id)) === null || _a === void 0 ? void 0 : _a.push(subject); - } - } - } - catch (e_6_1) { e_6 = { error: e_6_1 }; } - finally { - try { - if (_o && !_o.done && (_j = _m.return)) _j.call(_m); - } - finally { if (e_6) throw e_6.error; } - } - } - } - catch (e_5_1) { e_5 = { error: e_5_1 }; } - finally { - try { - if (seen_2_1 && !seen_2_1.done && (_h = seen_2.return)) _h.call(seen_2); - } - finally { if (e_5) throw e_5.error; } - } - var newSpatialEntities = callback(entities); - var newSeen = new Set(); - try { - for (var newSpatialEntities_1 = __values(newSpatialEntities), newSpatialEntities_1_1 = newSpatialEntities_1.next(); !newSpatialEntities_1_1.done; newSpatialEntities_1_1 = newSpatialEntities_1.next()) { - var e = newSpatialEntities_1_1.value; - try { - for (var _p = (e_8 = void 0, __values((_b = spatial2entity.get(e)) !== null && _b !== void 0 ? _b : [])), _q = _p.next(); !_q.done; _q = _p.next()) { - var s = _q.value; - newSeen.add(s); - } - } - catch (e_8_1) { e_8 = { error: e_8_1 }; } - finally { - try { - if (_q && !_q.done && (_l = _p.return)) _l.call(_p); - } - finally { if (e_8) throw e_8.error; } - } - } - } - catch (e_7_1) { e_7 = { error: e_7_1 }; } - finally { - try { - if (newSpatialEntities_1_1 && !newSpatialEntities_1_1.done && (_k = newSpatialEntities_1.return)) _k.call(newSpatialEntities_1); - } - finally { if (e_7) throw e_7.error; } - } - return newSeen; - } - function filterWithDataset(store, seen, callback) { - var e_9, _h, e_10, _j, e_11, _k, e_12, _l, e_13, _m, e_14, _o; - var _a, _b; - var dataset2entity = new Map(); - var datasets = new Set(); - var sectionAndBlockSeen = new Set(seen); - try { - for (var seen_3 = __values(seen), seen_3_1 = seen_3.next(); !seen_3_1.done; seen_3_1 = seen_3.next()) { - var subject = seen_3_1.value; - try { - for (var _p = (e_10 = void 0, __values(tripleStoreUtils.readQuads(store, subject, entity.sections, null, null))), _q = _p.next(); !_q.done; _q = _p.next()) { - var quad = _q.value; - sectionAndBlockSeen.add(quad.object.id); - } - } - catch (e_10_1) { e_10 = { error: e_10_1 }; } - finally { - try { - if (_q && !_q.done && (_j = _p.return)) _j.call(_p); - } - finally { if (e_10) throw e_10.error; } - } - } - } - catch (e_9_1) { e_9 = { error: e_9_1 }; } - finally { - try { - if (seen_3_1 && !seen_3_1.done && (_h = seen_3.return)) _h.call(seen_3); - } - finally { if (e_9) throw e_9.error; } - } - try { - for (var sectionAndBlockSeen_1 = __values(sectionAndBlockSeen), sectionAndBlockSeen_1_1 = sectionAndBlockSeen_1.next(); !sectionAndBlockSeen_1_1.done; sectionAndBlockSeen_1_1 = sectionAndBlockSeen_1.next()) { - var subject = sectionAndBlockSeen_1_1.value; - try { - for (var _r = (e_12 = void 0, __values(tripleStoreUtils.readQuads(store, subject, entity.datasets, null, null))), _s = _r.next(); !_s.done; _s = _r.next()) { - var quad = _s.value; - datasets.add(quad.object.id); - if (!dataset2entity.has(quad.object.id)) { - dataset2entity.set(quad.object.id, [subject]); - } - else { - (_a = dataset2entity.get(quad.object.id)) === null || _a === void 0 ? void 0 : _a.push(subject); - } - } - } - catch (e_12_1) { e_12 = { error: e_12_1 }; } - finally { - try { - if (_s && !_s.done && (_l = _r.return)) _l.call(_r); - } - finally { if (e_12) throw e_12.error; } - } - } - } - catch (e_11_1) { e_11 = { error: e_11_1 }; } - finally { - try { - if (sectionAndBlockSeen_1_1 && !sectionAndBlockSeen_1_1.done && (_k = sectionAndBlockSeen_1.return)) _k.call(sectionAndBlockSeen_1); - } - finally { if (e_11) throw e_11.error; } - } - var newDatasets = callback(datasets); - var newSeen = new Set(); - try { - for (var newDatasets_1 = __values(newDatasets), newDatasets_1_1 = newDatasets_1.next(); !newDatasets_1_1.done; newDatasets_1_1 = newDatasets_1.next()) { - var e = newDatasets_1_1.value; - try { - for (var _t = (e_14 = void 0, __values((_b = dataset2entity.get(e)) !== null && _b !== void 0 ? _b : [])), _u = _t.next(); !_u.done; _u = _t.next()) { - var s = _u.value; - newSeen.add(s); - } - } - catch (e_14_1) { e_14 = { error: e_14_1 }; } - finally { - try { - if (_u && !_u.done && (_o = _t.return)) _o.call(_t); - } - finally { if (e_14) throw e_14.error; } - } - } - } - catch (e_13_1) { e_13 = { error: e_13_1 }; } - finally { - try { - if (newDatasets_1_1 && !newDatasets_1_1.done && (_m = newDatasets_1.return)) _m.call(newDatasets_1); - } - finally { if (e_13) throw e_13.error; } - } - return newSeen; - } - /** - * Finds all ids of object matching a filter. - * - * @param store The triple store. - * @param filter The filter to limit objects. - * @returns A set of all ids matching the filter. - */ - function findIds(store, graph, filter) { - var _a, _b, _c, _d, _e, _f, _g; - var seen = getAllEntities(store); - if (seen.size > 0) { - seen = filterByHasSpatialEntity(store, seen); - } - if (seen.size > 0 && (filter.sex === 'Male' || filter.sex === 'Female')) { - var sex_1 = filter.sex; - seen = filterWithDonor(store, seen, function (donors) { return filterBySex(store, donors, sex_1); }); - } - if (seen.size > 0 && ((_a = filter.tmc) === null || _a === void 0 ? void 0 : _a.length) > 0) { - seen = filterWithDonor(store, seen, function (donors) { return filterByGroupName(store, donors, filter.tmc); }); - } - if (seen.size > 0 && ((_b = filter.technologies) === null || _b === void 0 ? void 0 : _b.length) > 0) { - seen = filterWithDataset(store, seen, function (datasets) { return filterByTechnology(store, datasets, filter.technologies); }); - } - if (seen.size > 0 && ((_c = filter.spatialSearches) === null || _c === void 0 ? void 0 : _c.length) > 0) { - seen = filterWithSpatialEntity(store, seen, function (entities) { return filterBySpatialSearches(store, graph, entities, filter.spatialSearches); }); - } - if (seen.size > 0 && ((_d = filter.ontologyTerms) === null || _d === void 0 ? void 0 : _d.length) > 0) { - var terms_1 = filter.ontologyTerms; - if (terms_1.indexOf(rui.body.id) === -1) { - seen = filterWithSpatialEntity(store, seen, function (entities) { return filterByOntologyTerms(store, entities, terms_1); }); - } - } - if (seen.size > 0 && ((_e = filter.cellTypeTerms) === null || _e === void 0 ? void 0 : _e.length) > 0) { - var terms_2 = filter.cellTypeTerms; - if (terms_2.indexOf(rui.cell.id) === -1) { - seen = filterWithSpatialEntity(store, seen, function (entities) { return filterByCellTypeTerms(store, entities, terms_2); }); - } - } - if (seen.size > 0 && ((_f = filter.ageRange) === null || _f === void 0 ? void 0 : _f.length) === 2 && - lodash.isFinite(filter.ageRange[0]) && lodash.isFinite(filter.ageRange[1])) { - var maxAge_1 = Math.max.apply(Math, __spreadArray([], __read(filter.ageRange))); - var minAge_1 = Math.min.apply(Math, __spreadArray([], __read(filter.ageRange))); - // Age filter given by their default range will be ignored - if (!(minAge_1 === 1 && maxAge_1 === 110)) { - seen = filterWithDonor(store, seen, function (donors) { return filterByAge(store, donors, minAge_1, maxAge_1); }); - } - } - if (seen.size > 0 && ((_g = filter.bmiRange) === null || _g === void 0 ? void 0 : _g.length) === 2 && - lodash.isFinite(filter.bmiRange[0]) && lodash.isFinite(filter.bmiRange[1])) { - var maxBMI_1 = Math.max.apply(Math, __spreadArray([], __read(filter.bmiRange))); - var minBMI_1 = Math.min.apply(Math, __spreadArray([], __read(filter.bmiRange))); - // BMI filter given by their default range will be ignored - if (!(minBMI_1 === 13 && maxBMI_1 === 83)) { - seen = filterWithDonor(store, seen, function (donors) { return filterByBMI(store, donors, minBMI_1, maxBMI_1); }); - } - } - return seen; - } - /** - * Gets all object ids in a store. - * - * @param store The triple store. - * @returns A set of all ids. - */ - function getAllEntities(store) { - var seen = new Set(); - store.forSubjects(function (s) { return seen.add(s.id); }, entity.spatialEntity, null, null); - return seen; - } - /** - * Creates a callback function that adds ids to a second set iff it exists in the first set. - * - * @param seen The first set of ids. - * @param newSeen The second set to add ids to. - * @returns The callback function. - */ - function differenceCallback(seen, newSeen) { - return function (term) { - if (seen.has(term.id)) { - newSeen.add(term.id); - } - }; - } - /** - * Filters ids by sex. - * - * @param store The triple store. - * @param seen All ids to choose from. - * @param sex Sex to filter on. - * @returns The subset of ids with the specified sex. - */ - function filterBySex(store, seen, sex) { - var newSeen = new Set(); - store.forSubjects(differenceCallback(seen, newSeen), entity.sex, entity[sex], null); - return newSeen; - } - /** - * Filters ids by group names. - * - * @param store The triple store. - * @param seen All ids to choose from. - * @param groupNames Group names to filter on. - * @returns The subset of ids with the specified group names. - */ - function filterByGroupName(store, seen, groupNames) { - var e_15, _h; - var newSeen = new Set(); - try { - for (var groupNames_1 = __values(groupNames), groupNames_1_1 = groupNames_1.next(); !groupNames_1_1.done; groupNames_1_1 = groupNames_1.next()) { - var groupName = groupNames_1_1.value; - var literal = tripleStoreUtils.DataFactory.literal(groupName); - store.forSubjects(differenceCallback(seen, newSeen), entity.providerName, literal, null); - } - } - catch (e_15_1) { e_15 = { error: e_15_1 }; } - finally { - try { - if (groupNames_1_1 && !groupNames_1_1.done && (_h = groupNames_1.return)) _h.call(groupNames_1); - } - finally { if (e_15) throw e_15.error; } - } - return newSeen; - } - /** - * Filters ids by technology names. - * - * @param store The triple store. - * @param seen All ids to choose from. - * @param technologies Technology names to filter on. - * @returns The subset of ids with the specified technology names. - */ - function filterByTechnology(store, seen, technologies) { - var e_16, _h; - var newSeen = new Set(); - try { - for (var technologies_1 = __values(technologies), technologies_1_1 = technologies_1.next(); !technologies_1_1.done; technologies_1_1 = technologies_1.next()) { - var technology = technologies_1_1.value; - var literal = tripleStoreUtils.DataFactory.literal(technology); - store.forSubjects(differenceCallback(seen, newSeen), entity.technology, literal, null); - } - } - catch (e_16_1) { e_16 = { error: e_16_1 }; } - finally { - try { - if (technologies_1_1 && !technologies_1_1.done && (_h = technologies_1.return)) _h.call(technologies_1); - } - finally { if (e_16) throw e_16.error; } - } - return newSeen; - } - /** - * Filters ids by ontology terms. - * - * @param store The triple store. - * @param seen All ids to choose from. - * @param terms Ontology terms to filter on. - * @returns The subset of ids with the specified ontology terms. - */ - function filterByOntologyTerms(store, seen, terms) { - var e_17, _h; - var newSeen = new Set(); - try { - for (var terms_3 = __values(terms), terms_3_1 = terms_3.next(); !terms_3_1.done; terms_3_1 = terms_3.next()) { - var term = terms_3_1.value; - var namedNode = tripleStoreUtils.DataFactory.namedNode(term); - store.forSubjects(differenceCallback(seen, newSeen), ccf.spatialEntity.ccf_annotations, namedNode, null); - } - } - catch (e_17_1) { e_17 = { error: e_17_1 }; } - finally { - try { - if (terms_3_1 && !terms_3_1.done && (_h = terms_3.return)) _h.call(terms_3); - } - finally { if (e_17) throw e_17.error; } - } - return newSeen; - } - /** - * Filters ids by cell type terms. - * - * @param store The triple store. - * @param seen All ids to choose from. - * @param terms Cell type terms to filter on. - * @returns The subset of ids with the specified cell type terms. - */ - function filterByCellTypeTerms(store, seen, terms) { - var e_18, _h; - var asTerms = new Set(); - try { - for (var terms_4 = __values(terms), terms_4_1 = terms_4.next(); !terms_4_1.done; terms_4_1 = terms_4.next()) { - var term = terms_4_1.value; - store.forObjects(function (asTerm) { - asTerms.add(asTerm.id); - }, term, ccf.asctb.located_in, null); - if (term === rui.cell.id) { - asTerms.add(rui.body.id); - } - } - } - catch (e_18_1) { e_18 = { error: e_18_1 }; } - finally { - try { - if (terms_4_1 && !terms_4_1.done && (_h = terms_4.return)) _h.call(terms_4); - } - finally { if (e_18) throw e_18.error; } - } - return filterByOntologyTerms(store, seen, __spreadArray([], __read(asTerms))); - } - /** - * Filters ids by age. - * - * @param store The triple store. - * @param seen All ids to choose from. - * @param minAge Minimum age. - * @param maxAge Maximum age. - * @returns The subset of ids with the specified age. - */ - function filterByAge(store, seen, minAge, maxAge) { - var e_19, _h, e_20, _j; - var newSeen = new Set(); - try { - for (var seen_4 = __values(seen), seen_4_1 = seen_4.next(); !seen_4_1.done; seen_4_1 = seen_4.next()) { - var subject = seen_4_1.value; - try { - for (var _k = (e_20 = void 0, __values(tripleStoreUtils.readQuads(store, subject, entity.age, null, null))), _l = _k.next(); !_l.done; _l = _k.next()) { - var quad = _l.value; - var value = rdfLiteral.fromRdf(quad.object); - if (value >= minAge && value <= maxAge) { - newSeen.add(subject); - } - } - } - catch (e_20_1) { e_20 = { error: e_20_1 }; } - finally { - try { - if (_l && !_l.done && (_j = _k.return)) _j.call(_k); - } - finally { if (e_20) throw e_20.error; } - } - } - } - catch (e_19_1) { e_19 = { error: e_19_1 }; } - finally { - try { - if (seen_4_1 && !seen_4_1.done && (_h = seen_4.return)) _h.call(seen_4); - } - finally { if (e_19) throw e_19.error; } - } - return newSeen; - } - /** - * Filters ids by BMI. - * - * @param store The triple store. - * @param seen All ids to choose from. - * @param minBMI Minimum BMI. - * @param maxBMI Maximum BMI. - * @returns The subset of ids with the specified BMI. - */ - function filterByBMI(store, seen, minBMI, maxBMI) { - var e_21, _h, e_22, _j; - var newSeen = new Set(); - try { - for (var seen_5 = __values(seen), seen_5_1 = seen_5.next(); !seen_5_1.done; seen_5_1 = seen_5.next()) { - var subject = seen_5_1.value; - try { - for (var _k = (e_22 = void 0, __values(tripleStoreUtils.readQuads(store, subject, entity.bmi, null, null))), _l = _k.next(); !_l.done; _l = _k.next()) { - var quad = _l.value; - var value = rdfLiteral.fromRdf(quad.object); - if (value >= minBMI && value <= maxBMI) { - newSeen.add(subject); - } - } - } - catch (e_22_1) { e_22 = { error: e_22_1 }; } - finally { - try { - if (_l && !_l.done && (_j = _k.return)) _j.call(_k); - } - finally { if (e_22) throw e_22.error; } - } - } - } - catch (e_21_1) { e_21 = { error: e_21_1 }; } - finally { - try { - if (seen_5_1 && !seen_5_1.done && (_h = seen_5.return)) _h.call(seen_5); - } - finally { if (e_21) throw e_21.error; } - } - return newSeen; - } - /** - * Filters ids by spatial entities. - * - * @param store The triple store. - * @param seen All ids to choose from. - * @param hasSpatialEntity Whether the filtered objects should have a spatial entity. - * @returns The subset of ids with/without spatial entities. - */ - function filterByHasSpatialEntity(store, seen, hasSpatialEntity) { - if (hasSpatialEntity === void 0) { hasSpatialEntity = true; } - var newSeen = new Set(); - store.forSubjects(differenceCallback(seen, newSeen), entity.spatialEntity, null, null); - if (!hasSpatialEntity) { - var notNewSeen_1 = new Set(); - seen.forEach(function (s) { return !newSeen.has(s) ? notNewSeen_1.add(s) : undefined; }); - return notNewSeen_1; - } - return newSeen; - } - function filterBySpatialSearches(store, graph, seen, spatialSearches) { - var e_23, _h; - var newSeen = new Set(); - try { - for (var spatialSearches_1 = __values(spatialSearches), spatialSearches_1_1 = spatialSearches_1.next(); !spatialSearches_1_1.done; spatialSearches_1_1 = spatialSearches_1.next()) { - var search = spatialSearches_1_1.value; - var thisSeen = filterByProbingSphere(store, graph, seen, search); - thisSeen.forEach(function (s) { return newSeen.add(s); }); - } - } - catch (e_23_1) { e_23 = { error: e_23_1 }; } - finally { - try { - if (spatialSearches_1_1 && !spatialSearches_1_1.done && (_h = spatialSearches_1.return)) _h.call(spatialSearches_1); - } - finally { if (e_23) throw e_23.error; } - } - return newSeen; - } - - function getSpatialEntityMapping(subjects, store) { - var e_1, _c, e_2, _d; - var spatial2entity = new Map(); - try { - for (var subjects_1 = __values(subjects), subjects_1_1 = subjects_1.next(); !subjects_1_1.done; subjects_1_1 = subjects_1.next()) { - var subject = subjects_1_1.value; - try { - for (var _e = (e_2 = void 0, __values(tripleStoreUtils.readQuads(store, subject, entity.spatialEntity, null, null))), _f = _e.next(); !_f.done; _f = _e.next()) { - var quad = _f.value; - if (!spatial2entity.has(quad.object.id)) { - spatial2entity.set(quad.object.id, new Set([subject])); - } - else { - spatial2entity.get(quad.object.id).add(subject); - } - } - } - catch (e_2_1) { e_2 = { error: e_2_1 }; } - finally { - try { - if (_f && !_f.done && (_d = _e.return)) _d.call(_e); - } - finally { if (e_2) throw e_2.error; } - } - } - } - catch (e_1_1) { e_1 = { error: e_1_1 }; } - finally { - try { - if (subjects_1_1 && !subjects_1_1.done && (_c = subjects_1.return)) _c.call(subjects_1); - } - finally { if (e_1) throw e_1.error; } - } - return spatial2entity; - } - function getAnatomicalStructureMapping(ids, store) { - var e_3, _c, e_4, _d; - var spatial2entity = getSpatialEntityMapping(ids, store); - var term2entity = new Map(); - try { - for (var _e = __values(spatial2entity.keys()), _f = _e.next(); !_f.done; _f = _e.next()) { - var subject = _f.value; - var entities = spatial2entity.get(subject); - var _loop_1 = function (quad) { - if (!term2entity.has(quad.object.id)) { - term2entity.set(quad.object.id, new Set(entities)); - } - else { - var termEntities_1 = term2entity.get(quad.object.id); - entities.forEach(function (value) { return termEntities_1.add(value); }); - } - }; - try { - for (var _g = (e_4 = void 0, __values(tripleStoreUtils.readQuads(store, subject, ccf.spatialEntity.ccf_annotations, null, null))), _h = _g.next(); !_h.done; _h = _g.next()) { - var quad = _h.value; - _loop_1(quad); - } - } - catch (e_4_1) { e_4 = { error: e_4_1 }; } - finally { - try { - if (_h && !_h.done && (_d = _g.return)) _d.call(_g); - } - finally { if (e_4) throw e_4.error; } - } - } - } - catch (e_3_1) { e_3 = { error: e_3_1 }; } - finally { - try { - if (_f && !_f.done && (_c = _e.return)) _c.call(_e); - } - finally { if (e_3) throw e_3.error; } - } - return term2entity; - } - /** - * Get number of occurrences of ontology terms for a set of ids. - * - * @param ids Ids of objects to calculate aggregate over. - * @param store The triple store. - * @returns Ontology term counts. - */ - function getOntologyTermOccurences(ids, store) { - var counts = {}; - var term2entities = getAnatomicalStructureMapping(ids, store); - term2entities.forEach(function (value, key) { - counts[key] = value.size; - }); - return counts; - } - /** - * Get number of occurrences of cell type terms for a set of ids. - * - * @param ids Ids of objects to calculate aggregate over. - * @param store The triple store. - * @returns Ontology term counts. - */ - function getCellTypeTermOccurences(ids, store) { - var e_5, _c, e_6, _d; - var _a, _b; - var asTerm2entities = getAnatomicalStructureMapping(ids, store); - var ctTerm2entities = new Map(); - try { - for (var _e = __values(asTerm2entities.keys()), _f = _e.next(); !_f.done; _f = _e.next()) { - var asTerm = _f.value; - var entities = asTerm2entities.get(asTerm); - var _loop_2 = function (quad) { - var cellType = quad.subject.id; - if (!ctTerm2entities.has(cellType)) { - ctTerm2entities.set(cellType, new Set(entities)); - } - else { - var termEntities_2 = ctTerm2entities.get(cellType); - entities.forEach(function (value) { return termEntities_2.add(value); }); - } - }; - try { - for (var _g = (e_6 = void 0, __values(tripleStoreUtils.readQuads(store, null, ccf.asctb.located_in, asTerm, null))), _h = _g.next(); !_h.done; _h = _g.next()) { - var quad = _h.value; - _loop_2(quad); - } - } - catch (e_6_1) { e_6 = { error: e_6_1 }; } - finally { - try { - if (_h && !_h.done && (_d = _g.return)) _d.call(_g); - } - finally { if (e_6) throw e_6.error; } - } - } - } - catch (e_5_1) { e_5 = { error: e_5_1 }; } - finally { - try { - if (_f && !_f.done && (_c = _e.return)) _c.call(_e); - } - finally { if (e_5) throw e_5.error; } - } - var counts = {}; - ctTerm2entities.forEach(function (value, key) { - counts[key] = value.size; - }); - counts[rui.cell.id] = (_b = (_a = asTerm2entities.get(rui.body.id)) === null || _a === void 0 ? void 0 : _a.size) !== null && _b !== void 0 ? _b : 0; - return counts; - } - - function getOntologyTreeNode(store, iri, relationshipIri) { - var _a, e_1, _b; - var result = { - '@id': iri, '@type': 'OntologyTreeNode', id: iri, parent: '', - children: [], synonymLabels: [], label: '' - }; - var ontologyTreeNodeResult = (_a = {}, - _a[ccf.ontologyNode.label.id] = 'label', - _a[relationshipIri] = 'parent', - _a[ccf.ontologyNode.synonymLabels.id] = 'synonymLabels', - _a); - try { - for (var _c = __values(getEntries(store, iri, ontologyTreeNodeResult)), _d = _c.next(); !_d.done; _d = _c.next()) { - var _e = __read(_d.value, 2), key = _e[0], value = _e[1]; - if (key === 'synonymLabels') { - result.synonymLabels.push(value); - } - else { - result[key] = value; - } - } - } - catch (e_1_1) { e_1 = { error: e_1_1 }; } - finally { - try { - if (_d && !_d.done && (_b = _c.return)) _b.call(_c); - } - finally { if (e_1) throw e_1.error; } - } - result.children = store.getSubjects(relationshipIri, iri, null).map(function (s) { return s.id; }); - return result; - } - function getOntologyTreeModel(store, rootIri, rootLabel, relationshipIri) { - var e_2, _a, e_3, _b; - var result = { root: rootIri, nodes: {} }; - var seen = new Set(); - try { - for (var _c = __values(tripleStoreUtils.readQuads(store, null, relationshipIri, null, null)), _d = _c.next(); !_d.done; _d = _c.next()) { - var quad = _d.value; - seen.add(quad.subject.id); - seen.add(quad.object.id); - } - } - catch (e_2_1) { e_2 = { error: e_2_1 }; } - finally { - try { - if (_d && !_d.done && (_a = _c.return)) _a.call(_c); - } - finally { if (e_2) throw e_2.error; } - } - try { - for (var seen_1 = __values(seen), seen_1_1 = seen_1.next(); !seen_1_1.done; seen_1_1 = seen_1.next()) { - var iri = seen_1_1.value; - result.nodes[iri] = getOntologyTreeNode(store, iri, relationshipIri); - } - } - catch (e_3_1) { e_3 = { error: e_3_1 }; } - finally { - try { - if (seen_1_1 && !seen_1_1.done && (_b = seen_1.return)) _b.call(seen_1); - } - finally { if (e_3) throw e_3.error; } - } - if (!result.nodes[rootIri]) { - result.nodes[rootIri] = { - '@id': rootIri, - '@type': 'OntologyTreeNode', - id: rootIri, - label: rootLabel, - children: [], - synonymLabels: [] - }; - } - var rootChildren = store - .getSubjects(relationshipIri, rootIri, null).map(function (o) { return o.id; }) - .sort(function (a, b) { return result.nodes[a].label.localeCompare(result.nodes[b].label); }); - result.nodes[rootIri].children = rootChildren; - treeify(result); - return result; - } - /** - * Recursive function to ensure that the given ontology tree model is actually a tree by essentially using a BFS search. - * - * @param model the ontology tree model to mutate - * @param nodeIri the tree node iri to modify. Starts at root in the base case - * @param seen a set of IRIs that have been 'seen' so far to remove loops in the graph - */ - function treeify(model, nodeIri, seen) { - var e_4, _a; - if (nodeIri === void 0) { nodeIri = undefined; } - if (seen === void 0) { seen = new Set(); } - var node = model.nodes[nodeIri !== null && nodeIri !== void 0 ? nodeIri : model.root]; - if (node) { - node.children = node.children.filter(function (n) { return !seen.has(n); }); - node.children.forEach(function (n) { return seen.add(n); }); - try { - for (var _b = __values(node.children), _c = _b.next(); !_c.done; _c = _b.next()) { - var childId = _c.value; - treeify(model, childId, seen); - if (model.nodes[childId]) { - model.nodes[childId].parent = node['@id']; - } - } - } - catch (e_4_1) { e_4 = { error: e_4_1 }; } - finally { - try { - if (_c && !_c.done && (_a = _b.return)) _a.call(_b); - } - finally { if (e_4) throw e_4.error; } - } - } - } - function getAnatomicalStructureTreeModelSlowly(store) { - var model = getOntologyTreeModel(store, rui.body.id, 'body', ccf.asctb.part_of.id); - model.nodes[rui.body.id].children = [ - 'http://purl.obolibrary.org/obo/UBERON_0000955', - 'http://purl.obolibrary.org/obo/UBERON_0000029', - // 'http://purl.obolibrary.org/obo/UBERON_0002509', // Mesenteric Lymph Node - 'http://purl.obolibrary.org/obo/UBERON_0000970', - // 'http://purl.obolibrary.org/obo/UBERON_0004548', // Eye, L - // 'http://purl.org/sig/ont/fma/fma54449', // Eye, R - 'http://purl.obolibrary.org/obo/UBERON_0003889', - // 'http://purl.obolibrary.org/obo/UBERON_0001303', // Fallopian Tube, L - // 'http://purl.obolibrary.org/obo/UBERON_0001302', // Fallopian Tube, R - 'http://purl.obolibrary.org/obo/UBERON_0000948', - 'http://purl.obolibrary.org/obo/UBERON_0002113', - // 'http://purl.obolibrary.org/obo/UBERON_0004538', // Kidney, L - // 'http://purl.obolibrary.org/obo/UBERON_0004539', // Kidney, R - 'http://purl.obolibrary.org/obo/UBERON_0001465', - // 'http://purl.org/sig/ont/fma/fma24978', // Knee, L - // 'http://purl.org/sig/ont/fma/fma24977', // Knee, R - 'http://purl.obolibrary.org/obo/UBERON_0002107', - 'http://purl.obolibrary.org/obo/UBERON_0002048', - 'http://purl.obolibrary.org/obo/UBERON_0001911', - // 'http://purl.org/sig/ont/fma/fma57991', // Mammary Gland, L - // 'http://purl.org/sig/ont/fma/fma57987', // Mammary Gland, R - 'http://purl.obolibrary.org/obo/UBERON_0000992', - // 'http://purl.org/sig/ont/fma/fma7214', // Ovary, L - // 'http://purl.org/sig/ont/fma/fma7213', // Ovary, R - 'http://purl.obolibrary.org/obo/UBERON_0001264', - 'http://purl.obolibrary.org/obo/UBERON_0001270', - 'http://purl.obolibrary.org/obo/UBERON_0001987', - 'http://purl.obolibrary.org/obo/UBERON_0002367', - 'http://purl.obolibrary.org/obo/UBERON_0002097', - 'http://purl.obolibrary.org/obo/UBERON_0002108', - 'http://purl.obolibrary.org/obo/UBERON_0002240', - 'http://purl.obolibrary.org/obo/UBERON_0000059', - 'http://purl.obolibrary.org/obo/UBERON_0002106', - 'http://purl.obolibrary.org/obo/UBERON_0002370', - 'http://purl.obolibrary.org/obo/UBERON_0000056', - // 'http://purl.obolibrary.org/obo/UBERON_0001223', // Ureter, L - // 'http://purl.obolibrary.org/obo/UBERON_0001222', // Ureter, R - 'http://purl.obolibrary.org/obo/UBERON_0001255', - 'http://purl.obolibrary.org/obo/UBERON_0000995', - 'http://purl.obolibrary.org/obo/UBERON_0004537' // Blood Vasculature - ].filter(function (iri) { return iri in model.nodes; }); - return model; - } - var getAnatomicalStructureTreeModel = lodash.memoize(getAnatomicalStructureTreeModelSlowly, function () { return ''; }); - function getCellTypeTreeModel(store) { - return getOntologyTreeModel(store, rui.cell.id, 'cell', ccf.asctb.ct_is_a.id); - } - - var _a, _b, _c, _d, _e; - /** Entity iri to property path. */ - var listResultSet = (_a = {}, - _a[entity.label.id] = 'label', - _a[entity.description.id] = 'description', - _a[entity.link.id] = 'link', - _a); - var donorResultSet = Object.assign(Object.assign({}, listResultSet), (_b = {}, _b[entity.providerName.id] = 'providerName', _b)); - var datasetResultSet = Object.assign(Object.assign({}, listResultSet), (_c = {}, _c[entity.technology.id] = 'technology', _c[entity.thumbnail.id] = 'thumbnail', _c)); - var tissueSectionResultSet = Object.assign(Object.assign({}, listResultSet), (_d = {}, _d[entity.sampleType.id] = 'sampleType', _d[entity.sectionNumber.id] = 'sectionNumber', _d[entity.datasets.id] = 'datasets', _d)); - var tissueBlockResultSet = Object.assign(Object.assign({}, listResultSet), (_e = {}, _e[entity.sampleType.id] = 'sampleType', _e[entity.sectionCount.id] = 'sectionCount', _e[entity.sectionSize.id] = 'sectionSize', _e[entity.sectionUnits.id] = 'sectionUnits', _e[entity.donor.id] = 'donor', _e[entity.spatialEntity.id] = 'spatialEntityId', _e[entity.sections.id] = 'sections', _e[entity.datasets.id] = 'datasets', _e)); - /** - * Extracts a single donor result from the triple store. - * - * @param store The triple store. - * @param iri The entity id. - * @returns The list data. - */ - function getDonorResult(store, iri) { - return getMappedResult(store, iri, 'Donor', donorResultSet); - } - /** - * Extracts a single dataset result from the triple store. - * - * @param store The triple store. - * @param iri The entity id. - * @returns The list data. - */ - function getDatasetResult(store, iri) { - return getMappedResult(store, iri, 'Dataset', datasetResultSet); - } - /** - * Extracts a single tissue section result from the triple store. - * - * @param store The triple store. - * @param iri The entity id. - * @returns The list data. - */ - function getTissueSectionResult(store, iri) { - var e_1, _a; - // eslint-disable-next-line @typescript-eslint/consistent-type-assertions - var result = { '@id': iri, '@type': 'Sample', datasets: [] }; - try { - for (var _b = __values(getEntries(store, iri, tissueSectionResultSet)), _c = _b.next(); !_c.done; _c = _b.next()) { - var _d = __read(_c.value, 2), key = _d[0], value = _d[1]; - if (key === 'datasets') { - var dataset = getDatasetResult(store, value); - result[key].push(dataset); - } - else { - result[key] = value; - } - } - } - catch (e_1_1) { e_1 = { error: e_1_1 }; } - finally { - try { - if (_c && !_c.done && (_a = _b.return)) _a.call(_b); - } - finally { if (e_1) throw e_1.error; } - } - return result; - } - /** - * Extracts a single tissue block result from the triple store. - * - * @param store The triple store. - * @param iri The entity id. - * @returns The list data. - */ - function getTissueBlockResult(store, iri) { - var e_2, _a; - // eslint-disable-next-line @typescript-eslint/consistent-type-assertions - var result = { '@id': iri, '@type': 'Sample', - sections: [], datasets: [] - }; - try { - for (var _b = __values(getEntries(store, iri, tissueBlockResultSet)), _c = _b.next(); !_c.done; _c = _b.next()) { - var _d = __read(_c.value, 2), key = _d[0], value = _d[1]; - if (key === 'sections') { - var section = getTissueSectionResult(store, value); - result[key].push(section); - } - else if (key === 'datasets') { - var dataset = getDatasetResult(store, value); - result[key].push(dataset); - } - else if (key === 'donor') { - result[key] = getDonorResult(store, value); - } - else { - result[key] = value; - } - } - } - catch (e_2_1) { e_2 = { error: e_2_1 }; } - finally { - try { - if (_c && !_c.done && (_a = _b.return)) _a.call(_b); - } - finally { if (e_2) throw e_2.error; } - } - return result; - } - - var CCFDatabaseStatusTracker = /** @class */ (function () { - function CCFDatabaseStatusTracker(database) { - this.database = database; - this.connect(); - } - CCFDatabaseStatusTracker.prototype.toJson = function () { - return { - status: this.status, - message: this.message, - checkback: this.status === 'Ready' || this.status === 'Error' ? 60 * 60 * 1000 : 2000, - loadTime: this.loadTime - }; - }; - CCFDatabaseStatusTracker.prototype.connect = function () { - var _this = this; - this.status = 'Loading'; - this.message = 'Loading database'; - var startTime = Date.now(); - return this.database.connect() - .then(function (loaded) { return __awaiter(_this, void 0, void 0, function () { - return __generator(this, function (_b) { - switch (_b.label) { - case 0: - if (!loaded) return [3 /*break*/, 4]; - // Warm up the database - this.message = 'Building scene'; - return [4 /*yield*/, this.database.getScene()]; - case 1: - _b.sent(); - this.message = 'Building tissue block results'; - return [4 /*yield*/, this.database.getTissueBlockResults()]; - case 2: - _b.sent(); - this.message = 'Aggregating results'; - return [4 /*yield*/, this.database.getAggregateResults()]; - case 3: - _b.sent(); - this.status = 'Ready'; - this.message = 'Database successfully loaded'; - return [3 /*break*/, 5]; - case 4: - this.status = 'Error'; - this.message = 'Unknown error while loading database'; - _b.label = 5; - case 5: return [2 /*return*/]; - } - }); - }); }) - .catch(function (error) { - var _a; - _this.status = 'Error'; - _this.message = (_a = error === null || error === void 0 ? void 0 : error.message) !== null && _a !== void 0 ? _a : 'Unknown error while loading database'; - }) - .finally(function () { - _this.loadTime = Date.now() - startTime; - }); - }; - return CCFDatabaseStatusTracker; - }()); - - /* eslint-disable @typescript-eslint/naming-convention */ - /** CCF v2.0 JSON-LD Context */ - var CCF_CONTEXT = { - '@context': { - '@base': 'http://purl.org/ccf/', - '@vocab': 'http://purl.org/ccf/', - 'ccf': 'http://purl.org/ccf/', - 'rdfs': 'http://www.w3.org/2000/01/rdf-schema#', - 'dcterms': 'http://purl.org/dc/terms/', - 'label': 'rdfs:label', - 'description': 'rdfs:comment', - 'link': 'ccf:url', - 'sex': 'ccf:sex', - 'age': 'ccf:age', - 'bmi': 'ccf:bmi', - 'consortium_name': 'ccf:consortium_name', - 'provider_name': 'ccf:tissue_provider_name', - 'provider_uuid': 'ccf:tissue_provider_uuid', - 'donor': { - '@id': 'ccf:comes_from', - '@type': '@id' - }, - 'samples': { - '@reverse': 'donor' - }, - 'sections': { - '@id': 'ccf:subdivided_into_sections', - '@type': '@id' - }, - 'datasets': { - '@id': 'ccf:generates_dataset', - '@type': '@id' - }, - 'sample_type': 'ccf:sample_type', - 'section_count': 'ccf:section_count', - 'section_size': 'ccf:section_size', - 'section_units': 'ccf:section_size_unit', - 'section_number': 'ccf:section_number', - 'rui_location': { - '@id': 'ccf:has_registration_location', - '@type': '@id' - }, - 'ccf_annotations': { - '@id': 'ccf:collides_with', - '@type': '@id', - '@container': '@set' - }, - 'representation_of': { - '@id': 'ccf:representation_of', - '@type': '@id' - }, - 'reference_organ': { - '@id': 'ccf:has_reference_organ', - '@type': '@id' - }, - 'extraction_set_for': { - '@id': 'ccf:extraction_set_for', - '@type': '@id' - }, - 'extraction_set': { - '@id': 'ccf:has_extraction_set', - '@type': '@id' - }, - 'organ_owner_sex': 'ccf:organ_owner_sex', - 'side': 'ccf:organ_side', - 'rui_rank': 'ccf:rui_rank', - 'slice_thickness': 'ccf:slice_thickness', - 'slice_count': 'ccf:slice_count', - 'object': { - '@id': 'ccf:has_object_reference', - '@type': '@id' - }, - 'creation_date': 'dcterms:created', - 'updated_date': 'ccf:updated_date', - 'creator': 'dcterms:creator', - 'creator_first_name': 'ccf:creator_first_name', - 'creator_last_name': 'ccf:creator_last_name', - 'placement': { - '@reverse': 'ccf:placement_for' - }, - 'placement_date': 'dcterms:created', - 'rotation_order': 'ccf:rotation_order', - 'dimension_units': 'ccf:dimension_unit', - 'rotation_units': 'ccf:rotation_unit', - 'scaling_units': 'ccf:scaling_unit', - 'translation_units': 'ccf:translation_unit', - 'source': { - '@id': 'ccf:placement_for', - '@type': '@id' - }, - 'target': { - '@id': 'ccf:placement_relative_to', - '@type': '@id' - }, - 'x_rotation': 'ccf:x_rotation', - 'y_rotation': 'ccf:y_rotation', - 'z_rotation': 'ccf:z_rotation', - 'x_scaling': 'ccf:x_scaling', - 'y_scaling': 'ccf:y_scaling', - 'z_scaling': 'ccf:z_scaling', - 'x_translation': 'ccf:x_translation', - 'y_translation': 'ccf:y_translation', - 'z_translation': 'ccf:z_translation', - 'x_dimension': 'ccf:x_dimension', - 'y_dimension': 'ccf:y_dimension', - 'z_dimension': 'ccf:z_dimension', - 'ontology_terms': { - '@id': 'ccf:has_ontology_term', - '@type': '@id' - }, - 'technology': 'ccf:technology', - 'thumbnail': 'ccf:thumbnail', - 'file': 'ccf:file_url', - 'file_format': 'ccf:file_format', - 'file_subpath': 'ccf:file_subpath' - } - }; - /* eslint-enable @typescript-eslint/naming-convention */ - /** - * Function which takes JSON-LD data and makes patches to update from CCF v1.x to v2.0 automatically - * - * @param jsonLdString the input JSON-LD as a string - * @returns A JSON-LD object derived from the given string with updated data to be compatible with CCF v2.0 - */ - function patchJsonLd(jsonLdString) { - return JSON.parse(jsonLdString, function (key, value) { - if (key === 'ccf_annotations' && Array.isArray(value)) { - return value.map(function (iri) { - if (iri === null || iri === void 0 ? void 0 : iri.startsWith('http://purl.obolibrary.org/obo/FMA_')) { - return iri.replace('http://purl.obolibrary.org/obo/FMA_', 'http://purl.org/sig/ont/fma/fma'); - } - else { - return iri; - } - }); - } - else if (key === '@context' && value && (value === 'https://hubmapconsortium.github.io/hubmap-ontology/ccf-entity-context.jsonld' - || value === 'https://hubmapconsortium.github.io/hubmap-ontology/ccf-context.jsonld' - || value === 'https://hubmapconsortium.github.io/ccf-ontology/ccf-context.jsonld' - || value['@base'] === 'http://purl.org/ccf/latest/ccf-entity.owl#')) { - return CCF_CONTEXT; - } - return value; - }); - } - - /** - * Function to add additional ccf_annotations to rui locations based on the - * reference organ it was placed relative to. - * - * @param store the triple store holding the CCF.OWL data - */ - function enrichRuiLocations(store) { - var e_1, _d, e_2, _e, e_3, _f, e_4, _g, e_5, _h; - var _a, _b, _c; - var tree = getAnatomicalStructureTreeModel(store); - var refOrganMap = new Map(); - try { - // Build a map from reference organ to ccf annotations via representation_of and the AS partonomy - for (var _j = __values(tripleStoreUtils.readQuads(store, null, ccf.spatialEntity.representation_of, null, null)), _k = _j.next(); !_k.done; _k = _j.next()) { - var _l = _k.value, organ = _l.subject, term = _l.object; - var annotations = new Set([term.id]); - var parent = (_a = tree.nodes[term.id]) === null || _a === void 0 ? void 0 : _a.parent; - while (parent) { - if (annotations.has(parent)) { - break; - } - else { - annotations.add(parent); - parent = (_b = tree.nodes[parent]) === null || _b === void 0 ? void 0 : _b.parent; - } - } - refOrganMap.set(organ.id, __spreadArray([], __read(annotations)).map(function (s) { return tripleStoreUtils.DataFactory.namedNode(s); })); - } - } - catch (e_1_1) { e_1 = { error: e_1_1 }; } - finally { - try { - if (_k && !_k.done && (_d = _j.return)) _d.call(_j); - } - finally { if (e_1) throw e_1.error; } - } - try { - // Add AS terms for rui locations based on the reference organs they are placed relative to - for (var _m = __values(tripleStoreUtils.readQuads(store, null, entity.spatialEntity, null, null)), _o = _m.next(); !_o.done; _o = _m.next()) { - var ruiLocation = _o.value.object; - try { - for (var _p = (e_3 = void 0, __values(tripleStoreUtils.readQuads(store, null, ccf.spatialPlacement.source, ruiLocation, null))), _q = _p.next(); !_q.done; _q = _p.next()) { - var placement = _q.value.subject; - try { - for (var _r = (e_4 = void 0, __values(tripleStoreUtils.readQuads(store, placement, ccf.spatialPlacement.target, null, null))), _s = _r.next(); !_s.done; _s = _r.next()) { - var organ = _s.value.object; - try { - for (var _t = (e_5 = void 0, __values((_c = refOrganMap.get(organ.id)) !== null && _c !== void 0 ? _c : [])), _u = _t.next(); !_u.done; _u = _t.next()) { - var term = _u.value; - store.addQuad(tripleStoreUtils.DataFactory.namedNode(ruiLocation.id), ccf.spatialEntity.ccf_annotations, term); - } - } - catch (e_5_1) { e_5 = { error: e_5_1 }; } - finally { - try { - if (_u && !_u.done && (_h = _t.return)) _h.call(_t); - } - finally { if (e_5) throw e_5.error; } - } - } - } - catch (e_4_1) { e_4 = { error: e_4_1 }; } - finally { - try { - if (_s && !_s.done && (_g = _r.return)) _g.call(_r); - } - finally { if (e_4) throw e_4.error; } - } - } - } - catch (e_3_1) { e_3 = { error: e_3_1 }; } - finally { - try { - if (_q && !_q.done && (_f = _p.return)) _f.call(_p); - } - finally { if (e_3) throw e_3.error; } - } - } - } - catch (e_2_1) { e_2 = { error: e_2_1 }; } - finally { - try { - if (_o && !_o.done && (_e = _m.return)) _e.call(_m); - } - finally { if (e_2) throw e_2.error; } - } - } - - /** Default initialization options. */ - var DEFAULT_CCF_DB_OPTIONS = { - 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' - }; - /** Database provider. */ - var CCFDatabase = /** @class */ (function () { - /** - * Creates an instance of ccfdatabase. - * - * @param [options] Initialization options. - */ - function CCFDatabase(options) { - if (options === void 0) { options = DEFAULT_CCF_DB_OPTIONS; } - this.options = options; - this.store = new tripleStoreUtils.Store(undefined, { factory: tripleStoreUtils.DataFactory }); - this.graph = new CCFSpatialGraph(this); - this.scene = new CCFSpatialScene(this); - } - /** - * Connects the database. - * - * @param [options] Options used to initialize. - * @returns A promise resolving to true if data has been loaded into the database. - */ - CCFDatabase.prototype.connect = function (options, cached) { - if (cached === void 0) { cached = false; } - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_c) { - switch (_c.label) { - case 0: - if (options) { - this.options = options; - } - if (!this.initializing) { - if (cached) { - this.initializing = this.cachedConnect(); - } - else { - this.initializing = this.doConnect(); - } - } - return [4 /*yield*/, this.initializing]; - case 1: - _c.sent(); - return [2 /*return*/, this.store.size > 0]; - } - }); - }); - }; - CCFDatabase.prototype.cachedConnect = function () { - return __awaiter(this, void 0, void 0, function () { - var start, lastModifiedKey, ccfDatabaseKey, lastModified, serializedDb; - return __generator(this, function (_c) { - switch (_c.label) { - case 0: - start = new Date().getTime(); - lastModifiedKey = 'ccf-database.last_modified'; - ccfDatabaseKey = 'ccf-database'; - return [4 /*yield*/, idbKeyval.get(lastModifiedKey).catch(function () { return undefined; })]; - case 1: - lastModified = _c.sent(); - if (!(lastModified && start - new Date(+lastModified).getTime() > 60 * 60 * 1000)) return [3 /*break*/, 3]; - return [4 /*yield*/, idbKeyval.delMany([ccfDatabaseKey, lastModifiedKey]).catch(function () { return undefined; })]; - case 2: - _c.sent(); - return [3 /*break*/, 5]; - case 3: return [4 /*yield*/, idbKeyval.get(ccfDatabaseKey).catch(function () { return undefined; })]; - case 4: - serializedDb = _c.sent(); - _c.label = 5; - case 5: - if (!serializedDb) return [3 /*break*/, 7]; - return [4 /*yield*/, this.deserialize(serializedDb)]; - case 6: - _c.sent(); - return [3 /*break*/, 9]; - case 7: return [4 /*yield*/, this.doConnect()]; - case 8: - _c.sent(); - idbKeyval.setMany([ - [ccfDatabaseKey, this.serialize()], - [lastModifiedKey, '' + start] - ]).catch(function () { return undefined; }); - _c.label = 9; - case 9: return [2 /*return*/]; - } - }); - }); - }; - /** - * Actually connects to the database. - * - * @returns A promise resolving to void when connected. - */ - CCFDatabase.prototype.doConnect = function () { - var _a, _b; - return __awaiter(this, void 0, void 0, function () { - var ops, sources, ccfOwlUrl, storeString; - var _this = this; - return __generator(this, function (_c) { - switch (_c.label) { - case 0: - ops = []; - sources = (_b = (_a = this.options.dataSources) === null || _a === void 0 ? void 0 : _a.concat()) !== null && _b !== void 0 ? _b : []; - ccfOwlUrl = this.options.ccfOwlUrl; - if (!ccfOwlUrl.startsWith('{')) return [3 /*break*/, 1]; - // serialized n3 store was provided as the ccfOwlUrl - this.store = tripleStoreUtils.deserializeN3Store(ccfOwlUrl, tripleStoreUtils.DataFactory); - return [3 /*break*/, 4]; - case 1: - if (!ccfOwlUrl.endsWith('.n3store.json')) return [3 /*break*/, 3]; - return [4 /*yield*/, fetch(ccfOwlUrl).then(function (r) { return r.text(); }) - .catch(function () { return console.log('Couldn\'t locate serialized store.'); })]; - case 2: - storeString = _c.sent(); - if (storeString) { - this.store = tripleStoreUtils.deserializeN3Store(storeString, tripleStoreUtils.DataFactory); - } - return [3 /*break*/, 4]; - case 3: - if ((ccfOwlUrl === null || ccfOwlUrl === void 0 ? void 0 : ccfOwlUrl.length) > 0) { - sources.push(ccfOwlUrl); - } - _c.label = 4; - case 4: - if (this.options.hubmapDataUrl) { - if (this.options.hubmapDataUrl.endsWith('jsonld')) { - sources.push(this.options.hubmapDataUrl); - } - else { - ops.push(searchHubmap(this.options.hubmapDataUrl, this.options.hubmapDataService, this.options.hubmapQuery, this.options.hubmapToken, this.options.hubmapAssetsUrl, this.options.hubmapPortalUrl).then(function (jsonld) { - if (jsonld) { - return _this.addDataSources([jsonld]); - } - else { - return undefined; - } - })); - } - } - ops.push(this.addDataSources(sources)); - return [4 /*yield*/, Promise.all(ops)]; - case 5: - _c.sent(); - return [4 /*yield*/, this.synchronize()]; - case 6: - _c.sent(); - return [2 /*return*/]; - } - }); - }); - }; - CCFDatabase.prototype.addDataSources = function (sources, inputStore) { - return __awaiter(this, void 0, void 0, function () { - var store; - var _this = this; - return __generator(this, function (_c) { - switch (_c.label) { - case 0: - store = inputStore !== null && inputStore !== void 0 ? inputStore : this.store; - return [4 /*yield*/, Promise.all(sources.map(function (source) { return __awaiter(_this, void 0, void 0, function () { - return __generator(this, function (_c) { - switch (_c.label) { - case 0: - if (!(typeof source === 'string')) return [3 /*break*/, 10]; - if (!((source.startsWith('http') || source.startsWith('assets/')) && source.includes('jsonld'))) return [3 /*break*/, 3]; - return [4 /*yield*/, fetch(source).then(function (r) { return r.text(); })]; - case 1: - source = _c.sent(); - source = patchJsonLd(source); - return [4 /*yield*/, tripleStoreUtils.addJsonLdToStore(source, store)]; - case 2: - _c.sent(); - return [3 /*break*/, 9]; - case 3: - if (!source.endsWith('n3')) return [3 /*break*/, 5]; - return [4 /*yield*/, tripleStoreUtils.addN3ToStore(source, store)]; - case 4: - _c.sent(); - return [3 /*break*/, 9]; - case 5: - if (!(source.endsWith('rdf') || source.endsWith('owl') || source.endsWith('xml'))) return [3 /*break*/, 7]; - return [4 /*yield*/, tripleStoreUtils.addRdfXmlToStore(source, store)]; - case 6: - _c.sent(); - return [3 /*break*/, 9]; - case 7: - // Passthrough assumes a JSON-LD response - source = patchJsonLd(source); - return [4 /*yield*/, tripleStoreUtils.addJsonLdToStore(source, store)]; - case 8: - _c.sent(); - _c.label = 9; - case 9: return [3 /*break*/, 12]; - case 10: - source = patchJsonLd(JSON.stringify(source)); - return [4 /*yield*/, tripleStoreUtils.addJsonLdToStore(source, store)]; - case 11: - _c.sent(); - _c.label = 12; - case 12: return [2 /*return*/]; - } - }); - }); }))]; - case 1: - _c.sent(); - return [2 /*return*/, this]; - } - }); - }); - }; - CCFDatabase.prototype.synchronize = function () { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_c) { - switch (_c.label) { - case 0: - // Add a small delay to allow the triple store to settle - return [4 /*yield*/, new Promise(function (r) { - setTimeout(r, 500); - })]; - case 1: - // Add a small delay to allow the triple store to settle - _c.sent(); - this.graph.createGraph(); - enrichRuiLocations(this.store); - return [2 /*return*/, this]; - } - }); - }); - }; - CCFDatabase.prototype.serialize = function () { - return tripleStoreUtils.serializeN3Store(this.store); - }; - CCFDatabase.prototype.deserialize = function (value) { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_c) { - switch (_c.label) { - case 0: - this.store = tripleStoreUtils.deserializeN3Store(value, tripleStoreUtils.DataFactory); - this.graph = new CCFSpatialGraph(this); - this.scene = new CCFSpatialScene(this); - return [4 /*yield*/, new Promise(function (r) { - setTimeout(r, 10); - })]; - case 1: - _c.sent(); - return [2 /*return*/]; - } - }); - }); - }; - /** - * Gets all ids matching the filter. - * - * @param [filter] The filter. - * @returns A set of all matching ids. - */ - CCFDatabase.prototype.getIds = function (filter) { - if (filter === void 0) { filter = {}; } - return findIds(this.store, this.graph, filter); - }; - /** - * Gets the data for an object. - * - * @param id The id of the requested object. - * @returns The object data. - */ - CCFDatabase.prototype.get = function (id) { - return this.store.getQuads(tripleStoreUtils.DataFactory.namedNode(id), null, null, null); - }; - /** - * Gets the data for objects matching a filter. - * - * @param [filter] The filter. - * @returns An array of data. - */ - CCFDatabase.prototype.search = function (filter) { - var _this = this; - if (filter === void 0) { filter = {}; } - return __spreadArray([], __read(this.getIds(filter))).map(function (s) { return _this.get(s); }); - }; - /** - * Gets all spatial entities for a filter. - * - * @param [filter] The filter. - * @returns A list of spatial entities. - */ - CCFDatabase.prototype.getSpatialEntities = function (filter) { - var _this = this; - // eslint-disable-next-line @typescript-eslint/consistent-type-assertions - filter = Object.assign(Object.assign({}, filter), { hasSpatialEntity: true }); - return __spreadArray([], __read(this.getIds(filter))).map(function (s) { return getSpatialEntityForEntity(_this.store, s); }); - }; - CCFDatabase.prototype.getDatabaseStatus = function () { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_c) { - if (!this.status) { - this.status = new CCFDatabaseStatusTracker(this); - } - return [2 /*return*/, this.status.toJson()]; - }); - }); - }; - /** - * Get a list of technology names used by datasets - * - * @returns list of unique technology names in the data - */ - CCFDatabase.prototype.getDatasetTechnologyNames = function () { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_c) { - return [2 /*return*/, getDatasetTechnologyNames(this.store)]; - }); - }); - }; - /** - * Get a list of provider names from the database - * - * @returns list of unique provider names in the data - */ - CCFDatabase.prototype.getProviderNames = function () { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_c) { - return [2 /*return*/, getProviderNames(this.store)]; - }); - }); - }; - /** - * Gets all tissue block results for a filter. - * - * @param [filter] The filter. - * @returns A list of results. - */ - CCFDatabase.prototype.getTissueBlockResults = function (filter) { - return __awaiter(this, void 0, void 0, function () { - var _this = this; - return __generator(this, function (_c) { - // eslint-disable-next-line @typescript-eslint/consistent-type-assertions - filter = Object.assign(Object.assign({}, filter), { hasSpatialEntity: true }); - return [2 /*return*/, __spreadArray([], __read(this.getIds(filter))).map(function (s) { return getTissueBlockResult(_this.store, s); })]; - }); - }); - }; - /** - * Gets all aggregate results for a filter. - * - * @param [filter] The filter. - * @returns A list of aggregate data. - */ - CCFDatabase.prototype.getAggregateResults = function (filter) { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_c) { - return [2 /*return*/, getAggregateResults(this.getIds(filter), this.store)]; - }); - }); - }; - /** - * Get number of occurrences of ontology terms for a set of ids. - * - * @param [filter] The filter. - * @returns Ontology term counts. - */ - CCFDatabase.prototype.getOntologyTermOccurences = function (filter) { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_c) { - return [2 /*return*/, getOntologyTermOccurences(this.getIds(filter), this.store)]; - }); - }); - }; - /** - * Get number of occurrences of cell type terms for a set of ids. - * - * @param [filter] The filter. - * @returns Cell type term counts. - */ - CCFDatabase.prototype.getCellTypeTermOccurences = function (filter) { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_c) { - return [2 /*return*/, getCellTypeTermOccurences(this.getIds(filter), this.store)]; - }); - }); - }; - /** - * Get ontology term tree nodes - * - * @returns Ontology term counts. - */ - CCFDatabase.prototype.getOntologyTreeModel = function () { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_c) { - return [2 /*return*/, getAnatomicalStructureTreeModel(this.store)]; - }); - }); - }; - /** - * Get cell type term tree nodes - * - * @returns Ontology term counts. - */ - CCFDatabase.prototype.getCellTypeTreeModel = function () { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_c) { - return [2 /*return*/, getCellTypeTreeModel(this.store)]; - }); - }); - }; - /** - * Get reference organs - * - * @returns Ontology term counts. - */ - CCFDatabase.prototype.getReferenceOrgans = function () { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_c) { - return [2 /*return*/, this.scene.getReferenceOrgans()]; - }); - }); - }; - /** - * Get all nodes to form the 3D scene of reference body, organs, and tissues - * - * @param [filter] The filter. - * @returns A list of Spatial Scene Nodes for the 3D Scene - */ - CCFDatabase.prototype.getScene = function (filter) { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_c) { - this.graph.createGraph(); - return [2 /*return*/, this.scene.getScene(filter)]; - }); - }); - }; - /** - * Get all nodes to form the 3D scene of reference organ and tissues - * - * @param [organIri] The Reference Organ IRI - * @param [filter] The filter. - * @returns A list of Spatial Scene Nodes for the 3D Scene - */ - CCFDatabase.prototype.getReferenceOrganScene = function (organIri, filter) { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_c) { - this.graph.createGraph(); - return [2 /*return*/, this.scene.getReferenceOrganScene(organIri, filter)]; - }); - }); - }; - CCFDatabase.prototype.getSpatialPlacement = function (source, targetIri) { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_c) { - return [2 /*return*/, this.graph.getSpatialPlacement(source, targetIri)]; - }); - }); - }; - return CCFDatabase; - }()); - - var gold = [240, 183, 98, 255]; - var red$1 = [213, 0, 0, 255]; - var green$1 = [29, 204, 101, 255]; - var blue$1 = [41, 121, 255, 255]; - /** - * Create a set of scene nodes for the body-ui to show the probing sphere and lines around it - * for a given spatial search. - * @param node the Spatial Entity (usually a reference organ) that the sphere is probing into - * @param sphere the Spatial Search that defines where and how big the probing sphere is - * @returns a set of scene nodes for the body-ui - */ - function getProbingSphereScene(node, sphere) { - var _a; - var sceneWidth = node.x_dimension / 1000; - var sceneHeight = node.y_dimension / 1000; - var sceneDepth = node.z_dimension / 1000; - var defaultSphereRadius = Math.max(sceneWidth, sceneHeight, sceneDepth) * 0.07; - var sphereLineRadius = defaultSphereRadius * 0.05; - var sphereLineLength = defaultSphereRadius * 2; - var sphereConeRadius = sphereLineRadius * 4; - if (!sphere) { - sphere = { - target: (_a = node.representation_of) !== null && _a !== void 0 ? _a : node['@id'], - radius: defaultSphereRadius, - x: sceneWidth / 2, - y: sceneHeight / 2, - z: sceneDepth / 2 - }; - } - else { - sphere = Object.assign(Object.assign({}, sphere), { radius: sphere.radius / 1000, x: sphere.x / 1000, y: sphere.y / 1000, z: sphere.z / 1000 }); - } - return [ - // Probing Sphere - { - '@id': 'http://purl.org/ccf/latest/ccf.owl#ProbingSphere', - '@type': 'SpatialSceneNode', - unpickable: false, - geometry: 'sphere', - transformMatrix: new core.Matrix4(core.Matrix4.IDENTITY).translate([sphere.x, sphere.y, sphere.z]).scale(sphere.radius), - color: gold - }, - // Probing Sphere Positive X Axis (D) - { - '@id': 'http://purl.org/ccf/latest/ccf.owl#ProbingsphereXD', - '@type': 'SpatialSceneNode', - unpickable: true, - geometry: 'cylinder', - transformMatrix: new core.Matrix4(core.Matrix4.IDENTITY) - .translate([sphere.x + sphere.radius + sphereLineLength / 2, sphere.y, sphere.z]) - .rotateZ(core.toRadians(-90)) - .scale([sphereLineRadius, sphereLineLength, sphereLineRadius]), - color: red$1 - }, - { - '@id': 'http://purl.org/ccf/latest/ccf.owl#ProbingsphereXDCone', - '@type': 'SpatialSceneNode', - unpickable: true, - geometry: 'cone', - transformMatrix: new core.Matrix4(core.Matrix4.IDENTITY) - .translate([sphere.x + sphere.radius + sphereLineLength, sphere.y, sphere.z]) - .rotateZ(core.toRadians(-90)) - .scale([sphereConeRadius, sphereConeRadius * 3, sphereConeRadius]), - color: red$1 - }, - { - '@id': 'http://purl.org/ccf/latest/ccf.owl#ProbingsphereXDLabel', - '@type': 'SpatialSceneNode', - unpickable: true, - geometry: 'text', - text: 'D', - transformMatrix: new core.Matrix4(core.Matrix4.IDENTITY) - .translate([sphere.x + sphere.radius + sphereLineLength + sphereConeRadius * 3, sphere.y, sphere.z]) - .scale(sphereConeRadius), - color: red$1 - }, - // Probing Sphere Negative X Axis (A) - { - '@id': 'http://purl.org/ccf/latest/ccf.owl#ProbingsphereXA', - '@type': 'SpatialSceneNode', - unpickable: true, - geometry: 'cylinder', - transformMatrix: new core.Matrix4(core.Matrix4.IDENTITY) - .translate([sphere.x - sphere.radius - sphereLineLength / 2, sphere.y, sphere.z]) - .rotateZ(core.toRadians(-90)) - .scale([sphereLineRadius, sphereLineLength, sphereLineRadius]), - color: red$1 - }, - { - '@id': 'http://purl.org/ccf/latest/ccf.owl#ProbingsphereXACone', - '@type': 'SpatialSceneNode', - unpickable: true, - geometry: 'cone', - transformMatrix: new core.Matrix4(core.Matrix4.IDENTITY) - .translate([sphere.x - sphere.radius - sphereLineLength, sphere.y, sphere.z]) - .rotateZ(core.toRadians(90)) - .scale([sphereConeRadius, sphereConeRadius * 3, sphereConeRadius]), - color: red$1 - }, - { - '@id': 'http://purl.org/ccf/latest/ccf.owl#ProbingsphereXALabel', - '@type': 'SpatialSceneNode', - unpickable: true, - geometry: 'text', - text: 'A', - transformMatrix: new core.Matrix4(core.Matrix4.IDENTITY) - .translate([sphere.x - sphere.radius - sphereLineLength - sphereConeRadius * 3.5, sphere.y, sphere.z]) - .scale(sphereConeRadius), - color: red$1 - }, - // Probing Sphere Positive Y Axis (W) - { - '@id': 'http://purl.org/ccf/latest/ccf.owl#ProbingsphereYW', - '@type': 'SpatialSceneNode', - unpickable: true, - geometry: 'cylinder', - transformMatrix: new core.Matrix4(core.Matrix4.IDENTITY) - .translate([sphere.x, sphere.y + sphere.radius + sphereLineLength / 2, sphere.z]) - .scale([sphereLineRadius, sphereLineLength, sphereLineRadius]), - color: green$1 - }, - { - '@id': 'http://purl.org/ccf/latest/ccf.owl#ProbingsphereYWCone', - '@type': 'SpatialSceneNode', - unpickable: true, - geometry: 'cone', - transformMatrix: new core.Matrix4(core.Matrix4.IDENTITY) - .translate([sphere.x, sphere.y + sphere.radius + sphereLineLength, sphere.z]) - .scale([sphereConeRadius, sphereConeRadius * 3, sphereConeRadius]), - color: green$1 - }, - { - '@id': 'http://purl.org/ccf/latest/ccf.owl#ProbingsphereYWLabel', - '@type': 'SpatialSceneNode', - unpickable: true, - geometry: 'text', - text: 'W', - transformMatrix: new core.Matrix4(core.Matrix4.IDENTITY) - .translate([sphere.x, sphere.y + sphere.radius + sphereLineLength + sphereConeRadius * 3, sphere.z]) - .scale(sphereConeRadius), - color: green$1 - }, - // Probing Sphere Negative Y Axis (S) - { - '@id': 'http://purl.org/ccf/latest/ccf.owl#ProbingsphereYS', - '@type': 'SpatialSceneNode', - unpickable: true, - geometry: 'cylinder', - transformMatrix: new core.Matrix4(core.Matrix4.IDENTITY) - .translate([sphere.x, sphere.y - sphere.radius - sphereLineLength / 2, sphere.z]) - .scale([sphereLineRadius, sphereLineLength, sphereLineRadius]), - color: green$1 - }, - { - '@id': 'http://purl.org/ccf/latest/ccf.owl#ProbingsphereYSCone', - '@type': 'SpatialSceneNode', - unpickable: true, - geometry: 'cone', - transformMatrix: new core.Matrix4(core.Matrix4.IDENTITY) - .translate([sphere.x, sphere.y - sphere.radius - sphereLineLength, sphere.z]) - .rotateZ(core.toRadians(180)) - .scale([sphereConeRadius, sphereConeRadius * 3, sphereConeRadius]), - color: green$1 - }, - { - '@id': 'http://purl.org/ccf/latest/ccf.owl#ProbingsphereYSLabel', - '@type': 'SpatialSceneNode', - unpickable: true, - geometry: 'text', - text: 'S', - transformMatrix: new core.Matrix4(core.Matrix4.IDENTITY) - .translate([sphere.x, sphere.y - sphere.radius - sphereLineLength - sphereConeRadius * 3.5, sphere.z]) - .scale(sphereConeRadius), - color: green$1 - }, - // Probing Sphere Positive Z Axis (E) - { - '@id': 'http://purl.org/ccf/latest/ccf.owl#ProbingsphereZE', - '@type': 'SpatialSceneNode', - unpickable: true, - geometry: 'cylinder', - transformMatrix: new core.Matrix4(core.Matrix4.IDENTITY) - .translate([sphere.x, sphere.y, sphere.z + sphere.radius + sphereLineLength / 2]) - .rotateX(core.toRadians(90)) - .scale([sphereLineRadius, sphereLineLength, sphereLineRadius]), - color: blue$1 - }, - { - '@id': 'http://purl.org/ccf/latest/ccf.owl#ProbingsphereZECone', - '@type': 'SpatialSceneNode', - unpickable: true, - geometry: 'cone', - transformMatrix: new core.Matrix4(core.Matrix4.IDENTITY) - .translate([sphere.x, sphere.y, sphere.z + sphere.radius + sphereLineLength]) - .rotateX(core.toRadians(90)) - .scale([sphereConeRadius, sphereConeRadius * 3, sphereConeRadius]), - color: blue$1 - }, - { - '@id': 'http://purl.org/ccf/latest/ccf.owl#ProbingsphereZELabel', - '@type': 'SpatialSceneNode', - unpickable: true, - geometry: 'text', - text: 'E', - transformMatrix: new core.Matrix4(core.Matrix4.IDENTITY) - .translate([sphere.x, sphere.y, sphere.z + sphere.radius + sphereLineLength + sphereConeRadius * 3]) - .scale(sphereConeRadius), - color: blue$1 - }, - // Probing Sphere Negative Z Axis (Q) - { - '@id': 'http://purl.org/ccf/latest/ccf.owl#ProbingsphereZQ', - '@type': 'SpatialSceneNode', - unpickable: true, - geometry: 'cylinder', - transformMatrix: new core.Matrix4(core.Matrix4.IDENTITY) - .translate([sphere.x, sphere.y, sphere.z - sphere.radius - sphereLineLength / 2]) - .rotateX(core.toRadians(-90)) - .scale([sphereLineRadius, sphereLineLength, sphereLineRadius]), - color: blue$1 - }, - { - '@id': 'http://purl.org/ccf/latest/ccf.owl#ProbingsphereZQCone', - '@type': 'SpatialSceneNode', - unpickable: true, - geometry: 'cone', - transformMatrix: new core.Matrix4(core.Matrix4.IDENTITY) - .translate([sphere.x, sphere.y, sphere.z - sphere.radius - sphereLineLength]) - .rotateX(core.toRadians(-90)) - .scale([sphereConeRadius, sphereConeRadius * 3, sphereConeRadius]), - color: blue$1 - }, - { - '@id': 'http://purl.org/ccf/latest/ccf.owl#ProbingsphereZQLabel', - '@type': 'SpatialSceneNode', - unpickable: true, - geometry: 'text', - text: 'Q', - transformMatrix: new core.Matrix4(core.Matrix4.IDENTITY) - .translate([sphere.x, sphere.y, sphere.z - sphere.radius - sphereLineLength - sphereConeRadius * 3.5]) - .scale(sphereConeRadius), - color: blue$1 - } - ]; - } - - var gray = [204, 204, 204, 255]; - var red = [213, 0, 0, 255]; - var green = [29, 204, 101, 255]; - var blue = [41, 121, 255, 255]; - /** - * Create a set of scene nodes for the body-ui to show the origin and lines extending to it's dimensions. - * @param node the Spatial Entity (usually a reference organ) that the origin is defined by - * @param includeLetters whether to show the keyboard letters associated with the origin points - * @returns a set of scene nodes for the body-ui - */ - function getOriginScene(node, includeLetters) { - if (includeLetters === void 0) { includeLetters = false; } - var sceneWidth = node.x_dimension / 1000; - var sceneHeight = node.y_dimension / 1000; - var sceneDepth = node.z_dimension / 1000; - var originRadius = Math.max(sceneWidth, sceneHeight, sceneDepth) * 0.05; - var lineRadius = originRadius * 0.1; - return [ - // Origin Sphere - { - '@id': 'http://purl.org/ccf/latest/ccf.owl#OriginSphere', - '@type': 'SpatialSceneNode', - unpickable: true, - geometry: 'sphere', - transformMatrix: new core.Matrix4(core.Matrix4.IDENTITY).scale(originRadius), - color: gray - }, - // Origin X Axis - { - '@id': 'http://purl.org/ccf/latest/ccf.owl#OriginX', - '@type': 'SpatialSceneNode', - unpickable: true, - geometry: 'cylinder', - transformMatrix: new core.Matrix4(core.Matrix4.IDENTITY) - .translate([sceneWidth / 2, 0, 0]) - .rotateZ(core.toRadians(-90)) - .scale([lineRadius, sceneWidth, lineRadius]), - color: red - }, - { - '@id': 'http://purl.org/ccf/latest/ccf.owl#OriginXCone', - '@type': 'SpatialSceneNode', - unpickable: true, - geometry: 'cone', - transformMatrix: new core.Matrix4(core.Matrix4.IDENTITY) - .translate([sceneWidth, 0, 0]) - .rotateZ(core.toRadians(-90)) - .scale([originRadius, originRadius * 3, originRadius]), - color: red - }, - { - '@id': 'http://purl.org/ccf/latest/ccf.owl#OriginXALabel', - '@type': 'SpatialSceneNode', - unpickable: true, - geometry: 'text', - text: 'A', - transformMatrix: new core.Matrix4(core.Matrix4.IDENTITY).translate([-originRadius * 2, 0, 0]).scale(originRadius), - color: red - }, - { - '@id': 'http://purl.org/ccf/latest/ccf.owl#OriginXDLabel', - '@type': 'SpatialSceneNode', - unpickable: true, - geometry: 'text', - text: 'D', - transformMatrix: new core.Matrix4(core.Matrix4.IDENTITY).translate([sceneWidth + originRadius * 2, 0, 0]).scale(originRadius), - color: red - }, - // Origin Y Axis - { - '@id': 'http://purl.org/ccf/latest/ccf.owl#OriginY', - '@type': 'SpatialSceneNode', - unpickable: true, - geometry: 'cylinder', - transformMatrix: new core.Matrix4(core.Matrix4.IDENTITY) - .translate([0, sceneHeight / 2, 0]) - .scale([lineRadius, sceneHeight, lineRadius]), - color: green - }, - { - '@id': 'http://purl.org/ccf/latest/ccf.owl#OriginYCone', - '@type': 'SpatialSceneNode', - unpickable: true, - geometry: 'cone', - transformMatrix: new core.Matrix4(core.Matrix4.IDENTITY) - .translate([0, sceneHeight, 0]) - .scale([originRadius, originRadius * 3, originRadius]), - color: green - }, - { - '@id': 'http://purl.org/ccf/latest/ccf.owl#OriginYSLabel', - '@type': 'SpatialSceneNode', - unpickable: true, - geometry: 'text', - text: 'S', - transformMatrix: new core.Matrix4(core.Matrix4.IDENTITY).translate([originRadius * 1.5, originRadius * 1.5, 0]).scale(originRadius), - color: green - }, - { - '@id': 'http://purl.org/ccf/latest/ccf.owl#OriginYWLabel', - '@type': 'SpatialSceneNode', - unpickable: true, - geometry: 'text', - text: 'W', - transformMatrix: new core.Matrix4(core.Matrix4.IDENTITY).translate([0, sceneHeight + originRadius * 2, 0]).scale(originRadius), - color: green - }, - // Origin Z Axis - { - '@id': 'http://purl.org/ccf/latest/ccf.owl#OriginZ', - '@type': 'SpatialSceneNode', - unpickable: true, - geometry: 'cylinder', - transformMatrix: new core.Matrix4(core.Matrix4.IDENTITY) - .translate([0, 0, sceneDepth / 2]) - .rotateX(core.toRadians(90)) - .scale([lineRadius, sceneDepth, lineRadius]), - color: blue - }, - { - '@id': 'http://purl.org/ccf/latest/ccf.owl#OriginZCone', - '@type': 'SpatialSceneNode', - unpickable: true, - geometry: 'cone', - transformMatrix: new core.Matrix4(core.Matrix4.IDENTITY) - .translate([0, 0, sceneDepth]) - .rotateX(core.toRadians(90)) - .scale([originRadius, originRadius * 3, originRadius]), - color: blue - }, - { - '@id': 'http://purl.org/ccf/latest/ccf.owl#OriginZQLabel', - '@type': 'SpatialSceneNode', - unpickable: true, - geometry: 'text', - text: 'Q', - transformMatrix: new core.Matrix4(core.Matrix4.IDENTITY).translate([originRadius * 1.5, -originRadius * 1.5, 0]).scale(originRadius), - color: blue - }, - { - '@id': 'http://purl.org/ccf/latest/ccf.owl#OriginZELabel', - '@type': 'SpatialSceneNode', - unpickable: true, - geometry: 'text', - text: 'E', - transformMatrix: new core.Matrix4(core.Matrix4.IDENTITY).translate([0, 0, sceneDepth + originRadius * 2]).scale(originRadius), - color: blue - } - ].filter(function (n) { return (includeLetters && n.geometry === 'text' && n.text) || !n.text; }); - } - - /* - * Public API Surface of ccf - */ - - /** - * Generated bundle index. Do not edit. - */ - - exports.CCFDatabase = CCFDatabase; - exports.CCFDatabaseStatusTracker = CCFDatabaseStatusTracker; - exports.CCFSpatialScene = CCFSpatialScene; - exports.DEFAULT_CCF_DB_OPTIONS = DEFAULT_CCF_DB_OPTIONS; - exports.addHubmapDataToStore = addHubmapDataToStore; - exports.getOriginScene = getOriginScene; - exports.getProbingSphereScene = getProbingSphereScene; - exports.searchHubmap = searchHubmap; - - Object.defineProperty(exports, '__esModule', { value: true }); - -}))); -//# sourceMappingURL=ccf-database.umd.js.map diff --git a/ccf-database/bundles/ccf-database.umd.js.map b/ccf-database/bundles/ccf-database.umd.js.map deleted file mode 100644 index 5c60d11a8..000000000 --- a/ccf-database/bundles/ccf-database.umd.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ccf-database.umd.js","sources":["../../../node_modules/tslib/tslib.es6.js","../../../projects/ccf-database/src/lib/util/n3-functions.ts","../../../projects/ccf-database/src/lib/util/prefixes.ts","../../../projects/ccf-database/src/lib/queries/spatial-result-n3.ts","../../../projects/ccf-database/src/lib/ccf-spatial-graph.ts","../../../projects/ccf-database/src/lib/ccf-spatial-scene.ts","../../../projects/ccf-database/src/lib/hubmap/hubmap-data.ts","../../../projects/ccf-database/src/lib/hubmap/hubmap-data-import.ts","../../../projects/ccf-database/src/lib/queries/aggregate-results-n3.ts","../../../projects/ccf-database/src/lib/queries/spatial-search-n3.ts","../../../projects/ccf-database/src/lib/queries/find-ids-n3.ts","../../../projects/ccf-database/src/lib/queries/ontology-term-occurences-n3.ts","../../../projects/ccf-database/src/lib/queries/ontology-tree-n3.ts","../../../projects/ccf-database/src/lib/queries/tissue-block-result-n3.ts","../../../projects/ccf-database/src/lib/util/ccf-database-status-tracker.ts","../../../projects/ccf-database/src/lib/util/patch-jsonld.ts","../../../projects/ccf-database/src/lib/util/enrich-rui-locations.ts","../../../projects/ccf-database/src/lib/ccf-database.ts","../../../projects/ccf-database/src/lib/util/probing-sphere-scene.ts","../../../projects/ccf-database/src/lib/util/origin-scene.ts","../../../projects/ccf-database/src/public-api.ts","../../../projects/ccf-database/src/ccf-database.ts"],"sourcesContent":["/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n","import { fromRdf } from 'rdf-literal';\nimport { Store, readQuads } from 'triple-store-utils';\n\n\n/**\n * Iterates over the key/value pairs for an IRI, using the specified mapping with quads from the store.\n *\n * @param store The triple store.\n * @param iri The data identifier.\n * @param mapping Property mappings.\n * @returns an iterator over the key/value pairs\n */\nexport function* getEntries(store: Store, iri: string, mapping: { [iri: string]: string }): Generator<[ string, string|number ]> {\n for (const [predicate, key] of Object.entries(mapping)) {\n for (const quad of readQuads(store, iri, predicate, null, null)) {\n const value = quad.object.termType === 'Literal' ? fromRdf(quad.object) : quad.object.id;\n yield [key, value];\n }\n }\n}\n\n/**\n * Creates an object of the specified type using quads from the store.\n *\n * @param store The triple store.\n * @param iri The data identifier.\n * @param type Type name.\n * @param mapping Property mappings.\n * @returns A new data object.\n */\nexport function getMappedResult(store: Store, iri: string, type: string, mapping: { [iri: string]: string }): T {\n const result = { '@id': iri, '@type': type };\n for (const [predicate, key] of Object.entries(mapping)) {\n for (const quad of readQuads(store, result['@id'], predicate, null, null)) {\n const value = quad.object.termType === 'Literal' ? fromRdf(quad.object) : quad.object.id;\n result[key] = value;\n }\n }\n return result as unknown as T;\n}\n","/* eslint-disable @typescript-eslint/naming-convention */\nimport { DataFactory, Util } from 'triple-store-utils';\n\n/** Constants used to create entity accessors. */\nexport const PREFIXES = {\n base: 'http://purl.org/ccf/latest/ccf.owl#',\n ccf: 'http://purl.org/ccf/',\n fma: 'http://purl.org/sig/ont/fma/fma',\n obo: 'http://purl.obolibrary.org/obo/',\n uberon: 'http://purl.obolibrary.org/obo/UBERON_',\n cl: 'http://purl.obolibrary.org/obo/CL_',\n lmha: 'http://purl.obolibrary.org/obo/LMHA_',\n rdf: 'http://www.w3.org/1999/02/22-rdf-syntax-ns#',\n rdfs: 'http://www.w3.org/2000/01/rdf-schema#',\n dc: 'http://purl.org/dc/elements/1.1/',\n dcterms: 'http://purl.org/dc/terms/'\n};\n\n/** Prefix factory. */\nexport const prefixer = Util.prefixes(PREFIXES, DataFactory);\n\nexport const rdf = {\n x: prefixer('rdf'),\n type: prefixer('rdf')('type')\n};\n\nexport const rdfs = {\n x: prefixer('rdfs'),\n label: prefixer('rdfs')('label'),\n comment: prefixer('rdfs')('comment'),\n isDefinedBy: prefixer('rdfs')('isDefinedBy'),\n seeAlso: prefixer('rdfs')('seeAlso')\n};\n\n/** CCF id helper. */\nconst ccfx = prefixer('ccf');\n\n/** Common entity ids. */\nexport const entity = {\n id: prefixer('ccf')('has_registration_location'),\n label: prefixer('rdfs')('label'),\n description: prefixer('rdfs')('comment'),\n link: ccfx('url'),\n\n sex: ccfx('sex'),\n age: ccfx('age'),\n bmi: ccfx('bmi'),\n\n Male: DataFactory.literal('Male'),\n Female: DataFactory.literal('Female'),\n\n consortiumName: ccfx('consortium_name'),\n providerName: ccfx('tissue_provider_name'),\n providerUUID: ccfx('tissue_provider_uuid'),\n\n donor: ccfx('comes_from'),\n\n sections: ccfx('subdivided_into_sections'),\n datasets: ccfx('generates_dataset'),\n\n sampleType: ccfx('sample_type'),\n\n TissueBlock: DataFactory.literal('Tissue Block'),\n TissueSection: DataFactory.literal('Tissue Section'),\n NonStandard: DataFactory.literal('Non-standard'),\n\n sectionCount: ccfx('section_count'),\n sectionSize: ccfx('section_size'),\n sectionUnits: ccfx('section_size_unit'),\n sectionNumber: ccfx('section_number'),\n\n spatialEntity: ccfx('has_registration_location'),\n ontologyTerms: ccfx('has_ontology_term'),\n cellTypeTerms: ccfx('has_cell_type_term'),\n\n technology: ccfx('technology'),\n thumbnail: ccfx('thumbnail')\n};\n\n/** CCF specific ids. */\nexport const ccf = {\n x: ccfx,\n base: prefixer('base'),\n ontologyNode: {\n label: ccfx('ccf_pref_label'),\n parent: ccfx('ccf_part_of'),\n children: ccfx('ccf_part_of'),\n rui_rank: ccfx('rui_rank'),\n synonymLabels: DataFactory.namedNode('http://www.geneontology.org/formats/oboInOwl#hasExactSynonym')\n },\n asctb: {\n part_of: ccfx('ccf_part_of'),\n ct_is_a: ccfx('ccf_ct_isa'),\n located_in: ccfx('ccf_located_in'),\n characterizes: ccfx('ccf_characterizes')\n },\n spatial: {\n Female: prefixer('base')('VHFemale'),\n Male: prefixer('base')('VHMale'),\n BothSexes: prefixer('base')('VHBothSexes'),\n FemaleOrgans: prefixer('base')('VHFemaleOrgans'),\n MaleOrgans: prefixer('base')('VHMaleOrgans')\n },\n SpatialObjectReference: ccfx('spatial_object_reference'),\n SpatialEntity: ccfx('spatial_entity'),\n SpatialPlacement: ccfx('spatial_placement'),\n spatialObjectReference: {\n file: ccfx('file_url'),\n file_format: ccfx('file_format'),\n file_subpath: ccfx('file_subpath')\n },\n extractionSet: {\n label: prefixer('rdfs')('label'),\n rui_rank: ccfx('rui_rank')\n },\n spatialEntity: {\n label: prefixer('rdfs')('label'),\n description: prefixer('rdfs')('comment'),\n creator: prefixer('dcterms')('creator'),\n creator_first_name: ccfx('creator_first_name'),\n creator_last_name: ccfx('creator_last_name'),\n creator_orcid: ccfx('creator_orcid'),\n creation_date: prefixer('dcterms')('created'),\n updated_date: ccfx('updated_date'),\n ccf_annotations: ccfx('collides_with'),\n representation_of: ccfx('representation_of'),\n reference_organ: ccfx('has_reference_organ'),\n extraction_set_for: ccfx('extraction_set_for'),\n extraction_set: ccfx('has_extraction_set'),\n sex: ccfx('organ_owner_sex'),\n side: ccfx('organ_side'),\n rui_rank: ccfx('rui_rank'),\n slice_thickness: ccfx('slice_thickness'),\n slice_count: ccfx('slice_count'),\n x_dimension: ccfx('x_dimension'),\n y_dimension: ccfx('y_dimension'),\n z_dimension: ccfx('z_dimension'),\n dimension_units: ccfx('dimension_unit'),\n object: ccfx('has_object_reference')\n },\n spatialPlacement: {\n source: ccfx('placement_for'),\n target: ccfx('placement_relative_to'),\n\n placement_date: prefixer('dcterms')('created'),\n x_scaling: ccfx('x_scaling'),\n y_scaling: ccfx('y_scaling'),\n z_scaling: ccfx('z_scaling'),\n scaling_units: ccfx('scaling_unit'),\n\n x_rotation: ccfx('x_rotation'),\n y_rotation: ccfx('y_rotation'),\n z_rotation: ccfx('z_rotation'),\n w_rotation: ccfx('theta_rotation'),\n rotation_order: ccfx('rotation_order'),\n rotation_units: ccfx('rotation_unit'),\n\n x_translation: ccfx('x_translation'),\n y_translation: ccfx('y_translation'),\n z_translation: ccfx('z_translation'),\n translation_units: ccfx('translation_unit')\n }\n};\n\n/** Uberon specific ids. */\nexport const uberon = {\n x: prefixer('uberon'),\n body: prefixer('uberon')('0013702')\n};\n\n/** CL specific ids. */\nexport const cl = {\n x: prefixer('cl'),\n cell: prefixer('cl')('0000000')\n};\n\n/** FMA specific ids. */\nexport const fma = {\n x: prefixer('fma')\n};\n\n/** LMHA specific ids. */\nexport const lmha = {\n x: prefixer('lmha')\n};\n\n/** RUI accessors. */\nexport const rui = {\n body: uberon.body,\n cell: cl.cell,\n respiratory_system: uberon.x('0001004'),\n colon: uberon.x('0001155'),\n left_lung: uberon.x('0002168'),\n right_lung: uberon.x('0002167'),\n left_bronchus: uberon.x('0002178'),\n right_bronchus: uberon.x('0002177'),\n kidney: uberon.x('0002113'),\n ureter: uberon.x('0000056'),\n eye: uberon.x('0000970'),\n fallopian_tube: uberon.x('0003889'),\n knee: uberon.x('0001465'),\n ovary: uberon.x('0000992'),\n trachea: uberon.x('0003126'),\n aorta: uberon.x('0000947'),\n blood: uberon.x('0000178'),\n bone_marrow: uberon.x('0002371'),\n male_reproductive_system: uberon.x('0000079'),\n lymph_node: uberon.x('0000029'),\n\n // Derived using console.log(ALL_POSSIBLE_ORGANS.map(o => ` ${o.name.toLowerCase().replace(',', '').replace(/ /g, '_')}: ${o.id.split('/').slice(-1)[0].split('_')[0].toLowerCase()}.x('${o.id.split('_').slice(-1)[0]}'),`).join('\\n'));\n blood_vasculature: uberon.x('0004537'),\n brain: uberon.x('0000955'),\n eye_left: uberon.x('0004548'),\n eye_right: fma.x('54449'),\n fallopian_tube_left: uberon.x('0001303'),\n fallopian_tube_right: uberon.x('0001302'),\n heart: uberon.x('0000948'),\n kidney_left: uberon.x('0004538'),\n kidney_right: uberon.x('0004539'),\n knee_left: fma.x('24978'),\n knee_right: fma.x('24977'),\n large_intestine: uberon.x('0000059'),\n liver: uberon.x('0002107'),\n lungs: uberon.x('0002048'),\n mesenteric_lymph_node: uberon.x('0002509'),\n ovary_left: fma.x('7214'),\n ovary_right: fma.x('7213'),\n pancreas: uberon.x('0001264'),\n pelvis: uberon.x('0001270'),\n prostate_gland: uberon.x('0002367'),\n skin: uberon.x('0002097'),\n small_intestine: uberon.x('0002108'),\n spleen: uberon.x('0002106'),\n thymus: uberon.x('0002370'),\n ureter_left: uberon.x('0001223'),\n ureter_right: uberon.x('0001222'),\n urinary_bladder: uberon.x('0001255'),\n uterus: uberon.x('0000995')\n};\n","import { sortBy } from 'lodash';\nimport { DataFactory, NamedNode, Store } from 'triple-store-utils';\n\nimport { SpatialEntity, SpatialObjectReference, SpatialPlacement, ExtractionSet } from '../spatial-types';\nimport { getMappedResult } from '../util/n3-functions';\nimport { ccf, entity } from '../util/prefixes';\n\n\n/**\n * Reverses the keys and values in a mapping.\n *\n * @param mapping The mapping to reverse.\n * @returns The reversed mapping.\n */\nfunction reverseMapping(mapping: { [property: string]: NamedNode }): { [iri: string]: string } {\n const newMapping: { [iri: string]: string } = {};\n Object.entries(mapping).forEach(([prop, predicate]) => {\n newMapping[predicate.id] = prop;\n });\n return newMapping;\n}\n\n/** A mapping of spatial objects. */\nconst mappings = {\n spatialObjectReference: reverseMapping(ccf.spatialObjectReference),\n spatialEntity: reverseMapping(ccf.spatialEntity),\n spatialPlacement: reverseMapping(ccf.spatialPlacement)\n};\n\n/**\n * Creates a spatial object reference.\n *\n * @param store The triple store.\n * @param iri The data identifier.\n * @returns The new reference.\n */\nexport function getSpatialObjectReference(store: Store, iri: string): SpatialObjectReference {\n return getMappedResult(store, iri, 'SpatialObjectReference', mappings.spatialObjectReference);\n}\n\n/**\n * Creates an extraction set data object.\n *\n * @param store The triple store.\n * @param iri The data identifier.\n * @returns The new entity.\n */\nexport function getExtractionSet(store: Store, iri: string): ExtractionSet {\n const result = getMappedResult(store, iri, 'ExtractionSet', mappings.spatialEntity);\n result.extractionSites = sortBy(\n store.getSubjects(ccf.spatialEntity.extraction_set, iri, null)\n .map((value) => getSpatialEntity(store, value.id)),\n ['rui_rank']);\n return result;\n}\n\n/**\n * Gets extraction sets associated with a reference organ\n *\n * @param store The triple store.\n * @param iri The data identifier (the reference organ).\n * @returns A set of extraction sets associated with the reference organ\n */\nexport function getExtractionSets(store: Store, iri: string): ExtractionSet[] {\n return sortBy(\n store.getSubjects(ccf.spatialEntity.extraction_set_for, iri, null)\n .map((value) => getExtractionSet(store, value.id)),\n ['rui_rank']\n );\n}\n\n\n/**\n * Gets the anatomical structures associated with a reference organ.\n *\n * @param store The triple store.\n * @param iri The data identifier (reference organ).\n * @returns The new entity.\n */\nexport function getAnatomicalStructures(store: Store, iri: string): SpatialEntity[] {\n return sortBy(\n store.getSubjects(ccf.spatialEntity.reference_organ, iri, null)\n .map((value) => getSpatialEntity(store, value.id))\n .filter((e) => e['@id'] !== iri),\n ['rui_rank']\n );\n}\n\n/**\n * Gets all reference organs in the triple store\n *\n * @param store The triple store.\n * @returns All the reference organs.\n */\nexport function getReferenceOrgans(store: Store): SpatialEntity[] {\n const results: SpatialEntity[] = [];\n store.forEach((quad) => {\n if (quad.subject.id === quad.object.id) {\n results.push(getSpatialEntity(store, quad.subject.id));\n }\n }, null, ccf.spatialEntity.reference_organ, null, null);\n return sortBy(results, ['rui_rank']);\n}\n\n/**\n * Creates a spatial entity data object.\n *\n * @param store The triple store.\n * @param iri The data identifier.\n * @returns The new entity.\n */\nexport function getSpatialEntity(store: Store, iri: string): SpatialEntity {\n const result = getMappedResult(store, iri, 'SpatialEntity', mappings.spatialEntity);\n // Default mapping will come back as an IRI which we can look up for the full object\n if (result.object) {\n result.object = getSpatialObjectReference(store, (result.object as unknown) as string);\n }\n if (result.ccf_annotations) {\n result.ccf_annotations = store.getObjects(iri, ccf.spatialEntity.ccf_annotations, null).map(o => o.id);\n }\n store.forSubjects((subject) => (result.entityId = subject.id), entity.spatialEntity, iri, null);\n return result;\n}\n\n/**\n * Creates a spatial placement object.\n *\n * @param store The triple store.\n * @param iri The data identifier.\n * @returns THe new placement object.\n */\nexport function getSpatialPlacement(store: Store, iri: string): SpatialPlacement {\n const result = getMappedResult(store, iri, 'SpatialPlacement', mappings.spatialPlacement);\n // Default mapping will come back as an IRI for source/target which we can look up for the full object\n if (result.source) {\n result.source = getSpatialEntity(store, (result.source as unknown) as string);\n }\n if (result.target) {\n result.target = getSpatialEntity(store, (result.target as unknown) as string);\n }\n return result;\n}\n\n/**\n * Creates a spatial entity based on another entity in the store.\n *\n * @param store The triple store.\n * @param entityIRI The indentifier of the store entity.\n * @returns A new entity.\n */\nexport function getSpatialEntityForEntity(store: Store, entityIRI: string): SpatialEntity | undefined {\n const spatialEntityNodes = store.getObjects(DataFactory.namedNode(entityIRI), entity.spatialEntity, null);\n if (spatialEntityNodes.length > 0) {\n return getSpatialEntity(store, spatialEntityNodes[0].id);\n } else {\n return undefined;\n }\n}\n","/* eslint-disable @typescript-eslint/naming-convention */\n/* eslint-disable @typescript-eslint/no-unsafe-call */\n/* eslint-disable @typescript-eslint/no-unsafe-member-access */\nimport { Euler, Matrix4, toDegrees, toRadians } from '@math.gl/core';\nimport { DirectedGraph } from 'graphology';\nimport shortestPath from 'graphology-shortest-path/unweighted';\nimport { get } from 'lodash';\nimport { readQuads } from 'triple-store-utils';\nimport { v4 as uuidV4 } from 'uuid';\n\nimport { CCFDatabase } from './ccf-database';\nimport { getSpatialPlacement } from './queries/spatial-result-n3';\nimport { FlatSpatialPlacement, SpatialEntity, SpatialPlacement } from './spatial-types';\nimport { ccf, rdf } from './util/prefixes';\n\n\nexport function applySpatialPlacement(tx: Matrix4, placement: SpatialPlacement): Matrix4 {\n const p = placement;\n let factor: number;\n switch (p.translation_units) {\n case 'centimeter':\n factor = 1 / 100;\n break;\n case 'millimeter':\n factor = 1 / 1000;\n break;\n case 'meter':\n default:\n factor = 1;\n break;\n }\n const T = [p.x_translation, p.y_translation, p.z_translation].map(t => t * factor);\n const R = [p.x_rotation, p.y_rotation, p.z_rotation].map(toRadians) as [number, number, number];\n const S = [p.x_scaling, p.y_scaling, p.z_scaling];\n\n return tx.translate(T).rotateXYZ(R).scale(S);\n}\n\nexport class CCFSpatialGraph {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n graph: any;\n\n constructor(private db: CCFDatabase) {\n this.createGraph();\n }\n\n createGraph(): void {\n this.graph = new DirectedGraph();\n const store = this.db.store;\n\n // Add all Spatial Object References\n store.forSubjects((subject) => {\n this.addNode(subject.id, 'SpatialObjectReference');\n }, rdf.type, ccf.SpatialObjectReference, null);\n\n // Add all Spatial Entities\n store.forSubjects((subject) => {\n this.addNode(subject.id, 'SpatialEntity');\n }, rdf.type, ccf.SpatialEntity, null);\n\n // Add all Spatial Placements\n const edgeSource: Record = {};\n for (const quad of readQuads(store, null, ccf.spatialPlacement.source, null, null)) {\n edgeSource[quad.subject.id] = quad.object.id;\n }\n for (const quad of readQuads(store, null, ccf.spatialPlacement.target, null, null)) {\n const source = edgeSource[quad.subject.id];\n if (source) {\n this.addEdge(quad.subject.id, source, quad.object.id, 'SpatialPlacement');\n }\n }\n }\n\n addNode(id: string, type: string): void {\n this.graph.mergeNode(id, { type });\n }\n\n addEdge(id: string, source: string, target: string, type: string): void {\n this.graph.mergeDirectedEdge(source, target, { type, id });\n }\n\n getTransformationMatrix(sourceIRI: string, targetIRI: string): Matrix4 | undefined {\n if (sourceIRI === targetIRI) {\n return new Matrix4(Matrix4.IDENTITY); // identity\n }\n if (!this.graph.hasNode(sourceIRI) || !this.graph.hasNode(targetIRI)) {\n return undefined;\n }\n\n const store = this.db.store;\n const tx = new Matrix4(Matrix4.IDENTITY);\n const path = shortestPath(this.graph, sourceIRI, targetIRI);\n if (path && path.length > 0) {\n path.reverse();\n let target: string | number = '';\n for (const source of path) {\n if (target) {\n const placementId = this.graph.getEdgeAttribute(source, target, 'id');\n const placement = getSpatialPlacement(store, placementId);\n applySpatialPlacement(tx, placement);\n }\n target = source;\n }\n return tx;\n } else {\n return undefined;\n }\n }\n\n getSpatialPlacement(source: SpatialEntity, targetIri: string): FlatSpatialPlacement | undefined {\n const sourceIri = this.graph.hasNode(source['@id']) ? source['@id'] : undefined;\n const placement: SpatialPlacement = get(source, 'placement[0]', get(source, 'placement', undefined));\n\n let matrix: Matrix4 | undefined;\n if (placement && this.graph.hasNode(placement.target)) {\n matrix = this.getTransformationMatrix(placement.target as unknown as string, targetIri);\n if (matrix) {\n matrix = applySpatialPlacement(matrix, placement);\n }\n } else if (sourceIri) {\n matrix = this.getTransformationMatrix(sourceIri, targetIri);\n }\n\n if (matrix) {\n const euler = new Euler().fromRotationMatrix(matrix, Euler.XYZ);\n const T = matrix.getTranslation().map(n => n * 1000) as [number, number, number];\n const R = euler.toVector3().map(toDegrees) as [number, number, number];\n const S = matrix.getScale().map(n => n < 1 && n > 0.999999 ? 1 : n) as [number, number, number];\n\n return {\n '@context': 'https://hubmapconsortium.github.io/hubmap-ontology/ccf-context.jsonld',\n '@id': `http://purl.org/ccf/1.5/${uuidV4()}_placement`,\n '@type': 'SpatialPlacement',\n source: source['@id'],\n target: targetIri,\n placement_date: new Date().toISOString().split('T')[0],\n x_scaling: S[0],\n y_scaling: S[1],\n z_scaling: S[2],\n scaling_units: 'ratio',\n x_rotation: R[0],\n y_rotation: R[1],\n z_rotation: R[2],\n rotation_order: 'XYZ',\n rotation_units: 'degree',\n x_translation: T[0],\n y_translation: T[1],\n z_translation: T[2],\n translation_units: 'millimeter'\n };\n } else {\n return undefined;\n }\n }\n}\n","/* eslint-disable @typescript-eslint/naming-convention */\nimport { Matrix4, toRadians } from '@math.gl/core';\n\nimport { CCFDatabase } from './ccf-database';\nimport { Filter } from './interfaces';\nimport {\n getAnatomicalStructures, getExtractionSet, getExtractionSets, getReferenceOrgans, getSpatialEntity,\n} from './queries/spatial-result-n3';\nimport { ExtractionSet, SpatialEntity } from './spatial-types';\nimport { ccf } from './util/prefixes';\n\n\nexport type SpatialSceneGeometry = 'sphere' | 'cube' | 'wireframe' | 'text' | 'cone' | 'cylinder';\n\nexport interface SpatialSceneNode {\n '@id': string;\n '@type': string;\n entityId?: string;\n ccf_annotations?: string[];\n representation_of?: string;\n reference_organ?: string;\n unpickable?: boolean;\n geometry?: SpatialSceneGeometry;\n text?: string;\n _lighting?: string;\n scenegraph?: string;\n scenegraphNode?: string;\n zoomBasedOpacity?: boolean;\n zoomToOnLoad?: boolean;\n color?: [number, number, number, number];\n opacity?: number;\n transformMatrix: Matrix4;\n name?: string;\n tooltip?: string;\n priority?: number;\n}\n\nexport class CCFSpatialScene {\n\n constructor(private db: CCFDatabase) {}\n\n getSpatialEntity(iri: string): SpatialEntity {\n return getSpatialEntity(this.db.store, iri);\n }\n getExtractionSets(iri: string): ExtractionSet[] {\n return getExtractionSets(this.db.store, iri);\n }\n getExtractionSet(iri: string): ExtractionSet {\n return getExtractionSet(this.db.store, iri);\n }\n getAnatomicalStructures(iri: string): SpatialEntity[] {\n return getAnatomicalStructures(this.db.store, iri);\n }\n getReferenceOrgans(): SpatialEntity[] {\n return getReferenceOrgans(this.db.store);\n }\n\n getReferenceBody(filter?: Filter): SpatialEntity {\n let bodyId: string;\n switch (filter?.sex) {\n case 'Male':\n bodyId = ccf.spatial.Male.id;\n break;\n case 'Female':\n bodyId = ccf.spatial.Female.id;\n break;\n case 'Both':\n default:\n bodyId = ccf.spatial.BothSexes.id;\n break;\n }\n return this.getSpatialEntity(bodyId);\n }\n\n getReferenceOrganSets(filter?: Filter): SpatialEntity[] {\n let organSet = this.getReferenceOrgans();\n switch (filter?.sex) {\n case 'Male':\n organSet = organSet.filter(s => s.sex === 'Male');\n break;\n case 'Female':\n organSet = organSet.filter(s => s.sex === 'Female');\n break;\n case 'Both':\n default:\n break;\n }\n if (filter?.debug) {\n organSet = organSet.map(o => [ [o], this.getAnatomicalStructures(o['@id'])])\n .reduce((acc, [organ, structures]) => acc.concat(structures.length > 0 ? structures : organ), []);\n }\n return organSet;\n }\n\n getReferenceSceneNodes(filter?: Filter): SpatialSceneNode[] {\n const body = this.getReferenceBody(filter);\n const skinNodes: SpatialSceneNode[] = [];\n let nodes: (SpatialSceneNode | undefined)[] = [\n ...this.getReferenceOrganSets(filter).map((organ) => {\n const isSkin = organ.representation_of === 'http://purl.obolibrary.org/obo/UBERON_0002097';\n const sceneNode = this.getSceneNode(organ, body, {\n color: [255, 255, 255, 255], opacity: isSkin ? 0.5 : 0.2, unpickable: true, _lighting: 'pbr', zoomBasedOpacity: !isSkin\n });\n if (isSkin && sceneNode) {\n skinNodes.push(sceneNode);\n return undefined;\n } else {\n return sceneNode;\n }\n })\n ];\n if (skinNodes.length > 0) {\n nodes = [...skinNodes, ...nodes];\n }\n\n if (filter?.debug) {\n // Debug bounding boxes\n nodes = nodes.concat([\n this.getSceneNode(this.getSpatialEntity(ccf.base('VHRightKidney').id), body, { color: [0, 0, 255, 0.5*255], geometry: 'wireframe' }),\n this.getSceneNode(this.getSpatialEntity(ccf.base('VHLeftKidney').id), body, { color: [255, 0, 0, 0.5*255], geometry: 'wireframe' }),\n this.getSceneNode(this.getSpatialEntity(ccf.base('VHSpleenCC1').id), body, { color: [0, 255, 0, 0.5*255], geometry: 'wireframe' }),\n this.getSceneNode(this.getSpatialEntity(ccf.base('VHSpleenCC2').id), body, { color: [0, 255, 0, 0.5*255], geometry: 'wireframe' }),\n this.getSceneNode(this.getSpatialEntity(ccf.base('VHSpleenCC3').id), body, { color: [0, 255, 0, 0.5*255], geometry: 'wireframe' })\n ]);\n }\n\n return nodes.filter(s => s !== undefined) as SpatialSceneNode[];\n }\n\n getReferenceOrganScene(organIri: string, filter?: Filter): SpatialSceneNode[] {\n const hasSexFilter = filter?.sex !== undefined && filter?.sex?.toLowerCase() !== 'both';\n const organs = this.getReferenceOrgans().filter((o) => o.representation_of === organIri && (!hasSexFilter || o.sex === filter?.sex));\n if (organs.length > 0) {\n const organ = organs[0];\n const isSkin = organ.representation_of === 'http://purl.obolibrary.org/obo/UBERON_0002097';\n const organNode = this.getSceneNode(organ, organ, {\n color: [255, 255, 255, 255], opacity: isSkin ? 0.5 : 0.2, unpickable: true, _lighting: 'pbr'\n }) as SpatialSceneNode;\n\n const scene = (this.db.getSpatialEntities(filter) ?? []).map((entity) =>\n this.getSceneNode(entity, organ, { color: [255, 255, 255, 0.9*255] })\n ) as SpatialSceneNode[];\n return [organNode].concat(scene).filter(n => n !== undefined);\n } else {\n return [];\n }\n }\n\n getEntitySceneNodes(filter?: Filter): SpatialSceneNode[] {\n const body = this.getReferenceBody(filter);\n return this.db.getSpatialEntities(filter).map((entity) =>\n this.getSceneNode(entity, body, { color: [255, 255, 255, 0.9*255] })\n ).filter(s => s !== undefined) as SpatialSceneNode[];\n }\n\n getSceneNode(source: SpatialEntity, target: SpatialEntity, nodeAttrs: Partial = {}): SpatialSceneNode | undefined {\n const has3dObject = source?.object?.file_format?.startsWith('model/gltf');\n const sourceID = has3dObject && source.object ? source.object['@id'] : source['@id'];\n let transform = this.db.graph.getTransformationMatrix(sourceID, target['@id']);\n if (transform) {\n if (has3dObject) {\n transform = new Matrix4(Matrix4.IDENTITY).rotateX(toRadians(90)).multiplyLeft(transform);\n } else {\n // Scale visible bounding boxes to the desired dimensions\n let factor: number;\n switch (source.dimension_units) {\n case 'centimeter':\n factor = 1 / 100;\n break;\n case 'millimeter':\n factor = 1 / 1000;\n break;\n case 'meter':\n default:\n factor = 1;\n break;\n }\n const scale = [source.x_dimension, source.y_dimension, source.z_dimension].map(dim => dim * factor / 2);\n transform.scale(scale);\n }\n return {\n '@id': source['@id'], '@type': 'SpatialSceneNode',\n entityId: source.entityId,\n ccf_annotations: source.ccf_annotations,\n representation_of: source.representation_of,\n reference_organ: source.reference_organ,\n scenegraph: has3dObject ? source.object?.file : undefined,\n scenegraphNode: has3dObject ? source.object?.file_subpath : undefined,\n transformMatrix: transform,\n tooltip: source.label,\n ...nodeAttrs\n };\n } else {\n return undefined;\n }\n }\n\n getScene(filter?: Filter): SpatialSceneNode[] {\n return [\n ...this.getReferenceSceneNodes(filter),\n ...this.getEntitySceneNodes(filter)\n ];\n }\n}\n","/* eslint-disable @typescript-eslint/naming-convention */\nimport { JsonLd, JsonLdObj } from 'jsonld/jsonld-spec';\nimport { get, omit, set, toNumber } from 'lodash';\n\n\ntype JsonDict = Record;\nconst HBM_PREFIX = 'https://entity.api.hubmapconsortium.org/entities/';\n\n// eslint-disable-next-line max-len\nexport const DR1_VU_THUMBS = 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']);\n// eslint-disable-next-line max-len\nexport const UFL_THUMBS = { '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' };\n\n/** UUID to TMC mapping. */\nconst GROUP_UUID_MAPPING: { [uuid: string]: string } = {\n '03b3d854-ed44-11e8-8bce-0e368f3075e8': 'TMC-UCSD',\n '07a29e4c-ed43-11e8-b56a-0e8017bdda58': 'TMC-Florida',\n '308f5ffc-ed43-11e8-b56a-0e8017bdda58': 'TMC-CalTech',\n '5bd084c8-edc2-11e8-802f-0e368f3075e8': 'HBM-TestingGroup',\n '73bb26e4-ed43-11e8-8f19-0a7c1eab007a': 'TMC-Vanderbilt',\n 'def5fd76-ed43-11e8-b56a-0e8017bdda58': 'TMC-Stanford',\n '5c106f29-ea2d-11e9-85e8-0efb3ba9a670': 'RTI-General Electric',\n '301615f9-c870-11eb-a8dc-35ce3d8786fe': 'TMC-UConn'\n};\n\nconst ENTITY_CONTEXT = {\n '@base': 'http://purl.org/ccf/latest/ccf-entity.owl#',\n '@vocab': 'http://purl.org/ccf/latest/ccf-entity.owl#',\n ccf: 'http://purl.org/ccf/',\n rdfs: 'http://www.w3.org/2000/01/rdf-schema#',\n\n label: 'rdfs:label',\n description: 'rdfs:comment',\n link: {\n '@id': 'rdfs:seeAlso',\n '@type': '@id'\n },\n samples: {\n '@reverse': 'has_donor'\n },\n sections: {\n '@id': 'has_tissue_section',\n '@type': '@id'\n },\n datasets: {\n '@id': 'has_dataset',\n '@type': '@id'\n },\n // eslint-disable-next-line @typescript-eslint/naming-convention\n rui_location: {\n '@id': 'has_spatial_entity',\n '@type': '@id'\n },\n ontologyTerms: {\n '@id': 'has_ontology_term',\n '@type': '@id'\n },\n cellTypeTerms: {\n '@id': 'has_cell_type_term',\n '@type': '@id'\n },\n thumbnail: {\n '@id': 'has_thumbnail'\n }\n};\n\n/**\n * Converts a hubmap response object into JsonLd.\n *\n * @param data The hubmap data.\n * @returns The converted data.\n */\nexport function hubmapResponseAsJsonLd(data: unknown, assetsApi = '', portalUrl = '', serviceToken?: string, debug = false): JsonLd {\n const entries = (get(data, 'hits.hits', []) as JsonDict[])\n .map(e => get(e, '_source', {}) as JsonDict)\n .sort((a, b) => (a['uuid'] as string).localeCompare(b['uuid'] as string));\n\n const donorLookup: Record = {};\n const unflattened: JsonLdObj[] = entries.map(e =>\n new HuBMAPTissueBlock(e, assetsApi, portalUrl, serviceToken).toJsonLd()\n );\n for (const donor of unflattened) {\n const donorId = donor['@id'] as string;\n if (!donorLookup[donorId]) {\n donorLookup[donorId] = donor;\n } else {\n const samples = donorLookup[donorId].samples as JsonLdObj[];\n samples.push((donor.samples as JsonLdObj[])[0]);\n }\n }\n const donors = Object.values(donorLookup);\n\n if (debug) {\n debugDonors(donors);\n console.log(donors.map(d => ({ '@context': ENTITY_CONTEXT, ...d })));\n }\n\n return { '@context': ENTITY_CONTEXT, '@graph': donors };\n}\n\nfunction debugDonors(donors: JsonLdObj[]) {\n let datasets: JsonLdObj[] = [];\n let deleted = 0;\n for (const donor of donors.filter(d => (d.samples as []).length > 1)) {\n const samples = donor.samples as JsonLdObj[];\n for (let i=0; i < samples.length; i++) {\n const blockId = samples[i]['@id'] as string;\n datasets = datasets.concat(samples[i].datasets as JsonLdObj[]);\n for (const section of samples[i].sections as JsonLdObj[]) {\n datasets = datasets.concat(section.datasets as JsonLdObj[]);\n }\n for (let j=i+1; j < samples.length; j++) {\n const sections = samples[j].sections as JsonLdObj[];\n if (sections.find(s => s['@id'] === blockId)) {\n samples[i].deleteMe = true;\n deleted++;\n }\n }\n }\n donor.samples = samples.filter(s => s.deleteMe !== true);\n }\n if (deleted > 0) {\n console.log(`âš  ${deleted} sections identified as blocks`);\n }\n}\n\nexport class HuBMAPTissueBlock {\n bad = false;\n donor: JsonLdObj;\n\n '@id': string;\n '@type' = 'Sample';\n label: string;\n description: string;\n link: string;\n\n sample_type = 'Tissue Block';\n section_count: number;\n section_size: number;\n section_units: string;\n\n rui_location: JsonLdObj;\n sections: JsonLdObj[];\n datasets: JsonLdObj[];\n\n constructor(public data: JsonDict, assetsApi = '', portalUrl = '', serviceToken?: string) {\n const entityType = this.data.entity_type;\n if (entityType !== 'Sample') {\n this.bad = true;\n return;\n }\n const ancestors = (this.data.ancestors || []) as JsonDict[];\n const descendants = (this.data.descendants || []) as JsonDict[];\n\n const donor = ancestors.find(e => e.entity_type === 'Donor') as JsonDict;\n this.donor = this.getDonor(donor, portalUrl);\n const ruiLocation = this.getRuiLocation(data, this.donor);\n if (!ruiLocation) {\n this.bad = true;\n } else {\n this.rui_location = ruiLocation;\n }\n\n if (!GROUP_UUID_MAPPING[data.group_uuid as string]) {\n GROUP_UUID_MAPPING[data.group_uuid as string] = data.group_name as string;\n }\n\n const dateEntered = new Date(data.last_modified_timestamp as number).toLocaleDateString();\n const groupName = GROUP_UUID_MAPPING[data.group_uuid as string] || data.group_name as string;\n const creator = data.created_by_user_displayname;\n\n this['@id'] = HBM_PREFIX + data.uuid;\n this.label = `Registered ${dateEntered}, ${creator}, ${groupName}`;\n this.link = `${portalUrl}browse/sample/${data.uuid}`;\n\n const sectionLookup: Record = {};\n const sections: JsonLdObj[] = [];\n this.sections = sections;\n const datasets: JsonLdObj[] = [];\n this.datasets = datasets;\n\n for (const descendant of descendants.filter(d => d.entity_type === 'Sample')) {\n const section = this.getSection(descendant, data, portalUrl);\n\n const sectionId = descendant.submission_id as string;\n sectionLookup[sectionId] = section;\n sections.push(section);\n section.section_number = section.section_number ?? sections.length;\n }\n for (const descendant of descendants) {\n if (descendant.entity_type === 'Dataset') {\n const dataset = this.getDataset(descendant, assetsApi, portalUrl, serviceToken);\n\n const sectionId = get(descendant, ['ingest_metadata', 'metadata', 'tissue_id']) as string;\n if (sectionLookup[sectionId]) {\n (sectionLookup[sectionId].datasets as JsonLd[])?.push(dataset);\n } else {\n datasets.push(dataset);\n }\n }\n }\n\n const loc: JsonDict = ruiLocation ?? {};\n const dims = `${loc.x_dimension} x ${loc.y_dimension} x ${loc.z_dimension} ${loc.dimension_units}`;\n this.section_count = loc.slice_count as number || sections.length;\n const sSize = parseFloat(\n (loc.slice_thickness as number ||\n ((loc.z_dimension as number || 0) / Math.max(this.section_count, 1)))\n .toFixed(1)\n );\n this.section_size = sSize;\n const sUnits = loc.dimension_units as string || 'millimeter';\n this.section_units = sUnits;\n\n this.description = `${dims}, ${sSize} ${sUnits}, ${data.specimen_type}, ${this.section_count} Sections`;\n\n sections.forEach((section, index) => {\n section.description = `${loc.x_dimension} x ${loc.y_dimension} x ${sSize} ${sUnits}, ${sSize} ${sUnits}, ${section.description}`;\n section.section_number = index + 1;\n });\n }\n\n getSection(section: JsonDict, data: JsonDict, portalUrl: string): JsonLdObj {\n const dateEntered = new Date(section.last_modified_timestamp as number).toLocaleDateString();\n const groupName = GROUP_UUID_MAPPING[section.group_uuid as string] || section.group_name as string;\n const creator = section.created_by_user_displayname;\n\n return {\n '@id': HBM_PREFIX + section.uuid,\n '@type': 'Sample',\n label: `Registered ${dateEntered}, ${creator}, ${groupName}`,\n description: `${data.specimen_type}`,\n link: `${portalUrl}browse/sample/${section.uuid}`,\n\n sample_type: 'Tissue Section',\n section_number: 1,\n\n samples: [],\n datasets: []\n };\n }\n\n getDataset(dataset: JsonDict, assetsApi = '', portalUrl = '', serviceToken?: string): JsonLdObj {\n const dateEntered = new Date(dataset.last_modified_timestamp as number).toLocaleDateString();\n const groupName = GROUP_UUID_MAPPING[dataset.group_uuid as string] || dataset.group_name as string;\n const creator = dataset.created_by_user_displayname;\n\n const types = [\n ...dataset.data_types as string[],\n get(dataset, ['ingest_metadata', 'metadata', 'assay_type'], '')\n ];\n const typesSearch = types.join('|').toLowerCase();\n\n let technology: string;\n let thumbnail = 'assets/icons/ico-unknown.svg';\n if (typesSearch.indexOf('10x') !== -1) {\n technology = '10x';\n thumbnail = 'assets/icons/ico-bulk-10x.svg';\n } else if (typesSearch.indexOf('af') !== -1) {\n technology = 'AF';\n thumbnail = 'assets/icons/ico-spatial-af.svg';\n } else if (typesSearch.indexOf('codex') !== -1) {\n technology = 'CODEX';\n thumbnail = 'assets/icons/ico-spatial-codex.svg';\n } else if (typesSearch.indexOf('imc') !== -1) {\n technology = 'IMC';\n thumbnail = 'assets/icons/ico-spatial-imc.svg';\n } else if ((typesSearch.indexOf('lc') !== -1) && (typesSearch.indexOf('af') === -1)) {\n technology = 'LC';\n thumbnail = 'assets/icons/ico-bulk-lc.svg';\n } else if (typesSearch.indexOf('maldi') !== -1) {\n technology = 'MALDI';\n } else if (typesSearch.indexOf('pas') !== -1) {\n technology = 'PAS';\n } else {\n technology = 'OTHER';\n }\n thumbnail = this.getDatasetThumbnail(dataset, assetsApi, serviceToken) ?? thumbnail;\n\n return {\n '@id': HBM_PREFIX + dataset.uuid,\n '@type': 'Dataset',\n label: `Registered ${dateEntered}, ${creator}, ${groupName}`,\n description: `Data/Assay Types: ${types.join(', ')}`,\n link: `${portalUrl}browse/dataset/${dataset.uuid}`,\n technology,\n thumbnail\n };\n }\n\n getDatasetThumbnail(dataset: JsonDict, assetsApi: string, serviceToken?: string): string | undefined {\n if (dataset.thumbnail_file) {\n const thumbnailFile = dataset.thumbnail_file as JsonDict;\n return `${assetsApi}/${thumbnailFile.file_uuid}/${thumbnailFile.filename}` + (serviceToken ? `?token=${serviceToken}` : '');\n } else if (dataset.group_uuid === '73bb26e4-ed43-11e8-8f19-0a7c1eab007a') { // TMC-Vanderbilt\n const tiffs = (get(dataset, 'metadata.files', []) as { rel_path: string }[])\n .filter(f => /\\.(ome\\.tif|ome\\.tiff)$/.test(f.rel_path))\n .filter(f => !/(multilayer\\.ome\\.tif|_ac\\.ome\\.tif)/.test(f.rel_path))\n .filter(f => DR1_VU_THUMBS.has(\n f.rel_path.split('/').slice(-1)[0].split('?')[0].replace('.ome.tif', '_thumbnail.jpg')\n ))\n .map(f => `${assetsApi}/${dataset.uuid}/${f.rel_path}` + (serviceToken ? `?token=${serviceToken}` : ''));\n\n if (tiffs.length > 0) {\n const thumb = tiffs[0].split('/').slice(-1)[0].split('?')[0].replace('.ome.tif', '_thumbnail.jpg');\n if (DR1_VU_THUMBS.has(thumb)) {\n return `assets/thumbnails/TMC-Vanderbilt/DR1/${thumb}`;\n }\n }\n } else if (dataset.group_uuid === '07a29e4c-ed43-11e8-b56a-0e8017bdda58') { // TMC-Florida\n const thumb = UFL_THUMBS[dataset.hubmap_id as string];\n if (thumb) {\n return `assets/thumbnails/TMC-Florida/${thumb}`;\n }\n }\n return undefined;\n }\n\n getDonor(donor: JsonDict, portalUrl: string): JsonLdObj {\n const donorDescription = (donor.description as string || '').toLowerCase();\n let sex: 'Male' | 'Female' | undefined;\n if (donorDescription.includes('female')) {\n sex = 'Female';\n } else if (donorDescription.includes('male')) {\n sex = 'Male';\n }\n const ageMatch = donorDescription.match(/age ([0-9]+)/);\n let age: number | undefined;\n if (ageMatch) {\n age = toNumber(ageMatch[1]);\n }\n let bmi: number | undefined;\n for (const md of get(donor, 'metadata.organ_donor_data', get(donor, 'metadata.living_donor_data', [])) as JsonDict[]) {\n if (md.preferred_term === 'Feminine gender' || md.preferred_term === 'Female') {\n sex = 'Female';\n } else if (md.preferred_term === 'Masculine gender' || md.preferred_term === 'Male') {\n sex = 'Male';\n } else if (md.preferred_term === 'Current chronological age' || md.preferred_term === 'Age') {\n age = toNumber(md.data_value);\n } else if (md.preferred_term === 'Body mass index') {\n bmi = toNumber(md.data_value);\n }\n }\n let label = '';\n if (sex && age) {\n label += `${sex}, Age ${age}`;\n if (bmi) {\n label += `, BMI ${bmi.toFixed(1)}`;\n }\n }\n\n const dateEntered = new Date(donor.last_modified_timestamp as number).toLocaleDateString();\n const groupName = GROUP_UUID_MAPPING[donor.group_uuid as string] || donor.group_name as string;\n const creator = donor.created_by_user_displayname;\n\n return {\n '@id': HBM_PREFIX + donor.uuid,\n '@type': 'Donor',\n label,\n description: `Entered ${dateEntered}, ${creator}, ${groupName}`,\n link: `${portalUrl}browse/donor/${donor.uuid}`,\n\n age,\n sex,\n bmi,\n\n consortium_name: 'HuBMAP',\n provider_name: groupName,\n provider_uuid: donor.group_uuid as string,\n\n samples: []\n };\n }\n\n getRuiLocation(data: JsonDict, donor: JsonLdObj): JsonLdObj | undefined {\n let spatialEntity: JsonLdObj | undefined;\n let ruiLocation = data.rui_location as JsonDict;\n if (ruiLocation) {\n // RUI Location may come in as an unparsed string\n if (typeof ruiLocation === 'string') {\n ruiLocation = JSON.parse(ruiLocation as string) as JsonDict;\n }\n if (ruiLocation.alignment_id) { // Detect RUI 0.5 generated JSON\n console.log('Detected a deprecated rui_location', data.uuid);\n } else if ((ruiLocation as unknown as { '@id': string })['@id']) { // Detect RUI 1.0+ generated JSON-LD\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n spatialEntity = ruiLocation as unknown as JsonLdObj;\n }\n }\n if (spatialEntity) {\n // Patch to fix RUI 0.5 Kidney and Spleen Placements\n const target: string = get(spatialEntity, ['placement', 'target']) ?? '';\n if (target.startsWith('http://purl.org/ccf/latest/ccf.owl#VHSpleenCC')) {\n if (donor.sex === 'Male') {\n set(spatialEntity, ['placement', 'target'], target.replace('#VHSpleenCC', '#VHMSpleenCC'));\n } else {\n set(spatialEntity, ['placement', 'target'], target.replace('#VHSpleenCC', '#VHFSpleenCC'));\n }\n } else if (target === 'http://purl.org/ccf/latest/ccf.owl#VHLeftKidney' || target === 'http://purl.org/ccf/latest/ccf.owl#VHRightKidney') {\n if (donor.sex === 'Male') {\n set(spatialEntity, ['placement', 'target'], target.replace('#VH', '#VHM') + '_Patch');\n } else {\n set(spatialEntity, ['placement', 'target'], target.replace('#VH', '#VHF') + '_Patch');\n }\n }\n }\n return spatialEntity;\n }\n\n getTissueBlock(): JsonLdObj {\n return omit({ ...this }, ['data', 'bad', 'donor']) as unknown as JsonLdObj;\n }\n\n toJsonLd(): JsonLdObj {\n return { ...this.donor, samples: [this.getTissueBlock()] };\n }\n}\n","/* eslint-disable @typescript-eslint/naming-convention */\nimport { JsonLd } from 'jsonld/jsonld-spec';\nimport { addJsonLdToStore, Store } from 'triple-store-utils';\n\nimport { hubmapResponseAsJsonLd } from './hubmap-data';\n\n\ninterface SearchResultJson {\n hits: {\n hits: unknown[];\n total: {\n value: number;\n };\n };\n}\n\n\n// Reduce this value if including more data fields\nconst PER_API_SEARCH_REQUEST_COUNT = 250;\n\nconst INCLUDED_DATA_FIELDS = [\n 'uuid', 'entity_type',\n 'group_uuid', 'group_name',\n 'last_modified_timestamp', 'created_by_user_displayname',\n 'ancestors.entity_type',\n 'ancestors.description',\n 'ancestors.metadata.organ_donor_data.preferred_term',\n 'ancestors.metadata.organ_donor_data.data_value',\n 'ancestors.metadata.living_donor_data.preferred_term',\n 'ancestors.metadata.living_donor_data.data_value',\n 'ancestors.last_modified_timestamp',\n 'ancestors.group_uuid',\n 'ancestors.group_name',\n 'ancestors.created_by_user_displayname',\n 'ancestors.uuid',\n 'descendants.entity_type',\n 'descendants.ingest_metadata.metadata.tissue_id',\n 'descendants.last_modified_timestamp',\n 'descendants.group_uuid',\n 'descendants.group_name',\n 'descendants.created_by_user_displayname',\n 'descendants.uuid',\n 'descendants.data_types',\n 'descendants.ingest_metadata.metadata.assay_type',\n 'descendants.thumbnail_file',\n 'descendants.metadata.files.rel_path',\n 'rui_location', 'specimen_type'\n];\n\nconst DEFAULT_API_SEARCH_QUERY: unknown = {\n exists: {\n field: 'rui_location'\n }\n};\n\nfunction getApiSearchHeaders(token?: string): Headers {\n const headers = new Headers();\n\n headers.append('Content-type', 'application/json');\n if (token) {\n headers.append('Authorization', `Bearer ${token}`);\n }\n\n return headers;\n}\n\nfunction getApiSearchBody(from: number, size: number, query?: unknown): string {\n const bodyObj = {\n version: true,\n from,\n size,\n stored_fields: ['*'],\n script_fields: {},\n docvalue_fields: [],\n query: query ?? DEFAULT_API_SEARCH_QUERY,\n _source: {\n includes: INCLUDED_DATA_FIELDS\n }\n };\n\n return JSON.stringify(bodyObj);\n}\n\nasync function doSearchRequest(\n url: string, init?: RequestInit\n): Promise {\n try {\n const res = await fetch(url, init);\n return res.ok ? (await res.json()) : undefined;\n } catch (_error) {\n return undefined;\n }\n}\n\nasync function doApiSearch(\n url: string, token?: string, query?: unknown\n): Promise {\n const perReqCount = PER_API_SEARCH_REQUEST_COUNT;\n const headers = getApiSearchHeaders(token);\n const body = getApiSearchBody(0, perReqCount, query);\n const firstResult = await doSearchRequest(url, { method: 'POST', headers, body });\n if (!firstResult) {\n return undefined;\n }\n\n const totalCount = firstResult.hits.total.value;\n if (totalCount <= perReqCount) {\n return firstResult;\n }\n\n const requests: Promise[] = [];\n for (let from = perReqCount; from < totalCount; from += perReqCount) {\n requests.push(doSearchRequest(url, {\n method: 'POST',\n headers,\n body: getApiSearchBody(from, perReqCount, query)\n }));\n }\n\n const results = await Promise.all(requests);\n if (results.some(res => !res)) {\n return undefined;\n }\n\n const items = results.map(res => res!.hits.hits);\n return {\n ...firstResult,\n hits: {\n ...firstResult.hits,\n hits: firstResult.hits.hits.concat(...items),\n }\n };\n}\n\n/**\n * Search the HuBMAP Search API and return CCF-compatible JSON-LD data\n *\n * @param dataUrl the search API url\n * @param serviceType 'static' if a statically saved response or 'search-api' if querying the search-api live\n * @param query the elastic search query to use\n * @param serviceToken the api key to the search-api\n * @param assetsApi the assets api endpoint\n * @param portalUrl the portal url to point to\n * @returns CCF-compatible JSON-LD data or undefined on error\n */\nexport async function searchHubmap(\n dataUrl: string, serviceType: 'static' | 'search-api',\n query?: unknown, serviceToken?: string, assetsApi = '', portalUrl = ''\n): Promise {\n let hubmapData: SearchResultJson | undefined;\n if (serviceType === 'static') {\n hubmapData = await doSearchRequest(dataUrl);\n } else if (serviceType === 'search-api') {\n hubmapData = await doApiSearch(dataUrl, serviceToken, query);\n }\n\n if (hubmapData) {\n return hubmapResponseAsJsonLd(hubmapData, assetsApi, portalUrl, serviceToken);\n } else {\n console.warn(`Unable to load ${dataUrl} as HuBMAP Data`);\n return undefined;\n }\n}\n\n/**\n * Adds hubmap data from a url to the triple store.\n *\n * @param store The triple store.\n * @param dataUrl The data url.\n * @param serviceType The service type.\n */\nexport async function addHubmapDataToStore(\n store: Store, dataUrl: string, serviceType: 'static' | 'search-api', serviceToken?: string, assetsApi = '', portalUrl = ''\n): Promise {\n const hubmapData = await searchHubmap(dataUrl, serviceType, undefined, serviceToken, assetsApi, portalUrl);\n if (hubmapData) {\n await addJsonLdToStore(hubmapData, store);\n }\n}\n","/* eslint-disable @typescript-eslint/naming-convention */\nimport { readQuads, Store } from 'triple-store-utils';\n\nimport { AggregateResult } from '../interfaces';\nimport { entity } from '../util/prefixes';\n\n\nfunction getObjects(store: Store, ids: Set, predicate: string): Set {\n const objects = new Set();\n for (const id of ids) {\n for (const quad of readQuads(store, id, predicate, null, null)) {\n objects.add(quad.object.id);\n }\n }\n return objects;\n}\n\n/**\n * Computes aggregate results.\n *\n * @param ids Ids of objects to calculate aggregate over.\n * @param store The triple store.\n * @returns The list of aggregate results.\n */\nexport function getAggregateResults(ids: Set, store: Store): AggregateResult[] {\n const donors = getObjects(store, ids, entity.donor.id);\n const centers = getObjects(store, donors, entity.providerUUID.id);\n\n const tissueBlocks = new Set();\n for (const id of ids) {\n for (const quad of readQuads(store, id, entity.spatialEntity, null, null)) {\n tissueBlocks.add(quad.subject.id);\n }\n }\n\n const tissueSections = getObjects(store, tissueBlocks, entity.sections.id);\n const tissueDatasets = new Set([\n ...getObjects(store, tissueBlocks, entity.datasets.id),\n ...getObjects(store, tissueSections, entity.datasets.id)\n ]);\n\n const results: { [key: string]: number } = {\n 'Tissue Data Providers': centers.size,\n Donors: donors.size,\n 'Tissue Blocks': tissueBlocks.size,\n 'Tissue Sections': tissueSections.size,\n 'Tissue Datasets': tissueDatasets.size\n };\n\n return Object.entries(results).map(([label, count]) => ({ label, count }));\n}\n\n/**\n * Get a list of technology names used by datasets\n *\n * @param store The triple store.\n * @returns list of unique technology names in the data\n */\nexport function getDatasetTechnologyNames(store: Store): string[] {\n const names = new Set();\n for (const quad of readQuads(store, null, entity.technology, null, null)) {\n names.add(quad.object.value);\n }\n return Array.from(names).sort();\n}\n\n/**\n * Get a list of provider names from the database\n *\n * @param store The triple store.\n * @returns list of unique provider names in the data\n */\nexport function getProviderNames(store: Store): string[] {\n const names = new Set();\n for (const quad of readQuads(store, null, entity.providerName, null, null)) {\n names.add(quad.object.value);\n }\n return Array.from(names).sort();\n}\n","import { Euler } from '@math.gl/core';\nimport { OrientedBoundingBox } from '@math.gl/culling';\nimport { Store } from 'triple-store-utils';\n\nimport { CCFSpatialGraph } from '../ccf-spatial-graph';\nimport { SpatialSearch } from '../interfaces';\nimport { getMappedResult } from '../util/n3-functions';\nimport { ccf } from '../util/prefixes';\n\n\nconst spatialEntityDimensions = {\n [ccf.spatialEntity.x_dimension.id]: 'x',\n [ccf.spatialEntity.y_dimension.id]: 'y',\n [ccf.spatialEntity.z_dimension.id]: 'z'\n};\n\nfunction getSpatialEntityDimensions(store: Store, iri: string): [number, number, number] {\n const dims = getMappedResult<{ x: number; y: number; z: number }>(store, iri, 'Dimensions', spatialEntityDimensions);\n return [ dims.x, dims.y, dims.z ];\n}\n\nexport function getOrientedBoundingBox(store: Store, graph: CCFSpatialGraph, sourceIri: string, targetIri: string): OrientedBoundingBox | undefined {\n const matrix = graph.getTransformationMatrix(sourceIri, targetIri);\n let result: OrientedBoundingBox | undefined = undefined;\n if (matrix) {\n const center = matrix.getTranslation();\n const halfSize = getSpatialEntityDimensions(store, sourceIri).map(n => n / 1000 / 2);\n const quaternion = new Euler().fromRotationMatrix(matrix, Euler.XYZ).toQuaternion().normalize().calculateW();\n result = new OrientedBoundingBox().fromCenterHalfSizeQuaternion(center, halfSize, quaternion);\n }\n return result;\n}\n\nexport function filterByProbingSphere(store: Store, graph: CCFSpatialGraph, seen: Set, search: SpatialSearch): Set {\n const { x, y, z, radius, target } = search;\n const newSeen = new Set();\n const radiusSquared = (radius / 1000) * (radius / 1000);\n for (const sourceIri of seen) {\n const boundingBox = getOrientedBoundingBox(store, graph, sourceIri, target);\n if (boundingBox) {\n const distanceSquared = boundingBox.distanceSquaredTo([x, y, z].map(n => n / 1000));\n if (distanceSquared <= radiusSquared) {\n newSeen.add(sourceIri);\n }\n }\n }\n return newSeen;\n}\n","import { isFinite } from 'lodash';\nimport { fromRdf } from 'rdf-literal';\nimport { DataFactory, Literal, readQuads, Store, Term } from 'triple-store-utils';\n\nimport { CCFSpatialGraph } from '../ccf-spatial-graph';\nimport { Filter, SpatialSearch } from '../interfaces';\nimport { ccf, entity, rui } from '../util/prefixes';\nimport { filterByProbingSphere } from './spatial-search-n3';\n\n\nfunction filterWithDonor(store: Store, seen: Set, callback: (donorsSeen: Set) => Set): Set {\n const donor2entity = new Map();\n const donors = new Set();\n for (const subject of seen) {\n for (const quad of readQuads(store, subject, entity.donor, null, null)) {\n donors.add(quad.object.id);\n if (!donor2entity.has(quad.object.id)) {\n donor2entity.set(quad.object.id, [subject]);\n } else {\n donor2entity.get(quad.object.id)?.push(subject);\n }\n }\n }\n\n const newDonors = callback(donors);\n const newSeen = new Set();\n for (const d of newDonors) {\n for (const s of donor2entity.get(d) ?? []) {\n newSeen.add(s);\n }\n }\n return newSeen;\n}\n\nfunction filterWithSpatialEntity(store: Store, seen: Set, callback: (entitiesSeen: Set) => Set): Set {\n const spatial2entity = new Map();\n const entities = new Set();\n for (const subject of seen) {\n for (const quad of readQuads(store, subject, entity.spatialEntity, null, null)) {\n entities.add(quad.object.id);\n if (!spatial2entity.has(quad.object.id)) {\n spatial2entity.set(quad.object.id, [subject]);\n } else {\n spatial2entity.get(quad.object.id)?.push(subject);\n }\n }\n }\n\n const newSpatialEntities = callback(entities);\n const newSeen = new Set();\n for (const e of newSpatialEntities) {\n for (const s of spatial2entity.get(e) ?? []) {\n newSeen.add(s);\n }\n }\n return newSeen;\n}\n\nfunction filterWithDataset(store: Store, seen: Set, callback: (datasetsSeen: Set) => Set): Set {\n const dataset2entity = new Map();\n const datasets = new Set();\n\n const sectionAndBlockSeen = new Set(seen);\n for (const subject of seen) {\n for (const quad of readQuads(store, subject, entity.sections, null, null)) {\n sectionAndBlockSeen.add(quad.object.id);\n }\n }\n\n for (const subject of sectionAndBlockSeen) {\n for (const quad of readQuads(store, subject, entity.datasets, null, null)) {\n datasets.add(quad.object.id);\n if (!dataset2entity.has(quad.object.id)) {\n dataset2entity.set(quad.object.id, [subject]);\n } else {\n dataset2entity.get(quad.object.id)?.push(subject);\n }\n }\n }\n\n const newDatasets = callback(datasets);\n const newSeen = new Set();\n for (const e of newDatasets) {\n for (const s of dataset2entity.get(e) ?? []) {\n newSeen.add(s);\n }\n }\n return newSeen;\n}\n\n/**\n * Finds all ids of object matching a filter.\n *\n * @param store The triple store.\n * @param filter The filter to limit objects.\n * @returns A set of all ids matching the filter.\n */\nexport function findIds(store: Store, graph: CCFSpatialGraph, filter: Filter): Set {\n let seen = getAllEntities(store);\n if (seen.size > 0) {\n seen = filterByHasSpatialEntity(store, seen);\n }\n if (seen.size > 0 && (filter.sex === 'Male' || filter.sex === 'Female')) {\n const sex = filter.sex;\n seen = filterWithDonor(store, seen, (donors) =>\n filterBySex(store, donors, sex)\n );\n }\n if (seen.size > 0 && filter.tmc?.length > 0) {\n seen = filterWithDonor(store, seen, (donors) =>\n filterByGroupName(store, donors, filter.tmc)\n );\n }\n if (seen.size > 0 && filter.technologies?.length > 0) {\n seen = filterWithDataset(store, seen, (datasets) =>\n filterByTechnology(store, datasets, filter.technologies)\n );\n }\n if (seen.size > 0 && filter.spatialSearches?.length > 0) {\n seen = filterWithSpatialEntity(store, seen, (entities) =>\n filterBySpatialSearches(store, graph, entities, filter.spatialSearches)\n );\n }\n if (seen.size > 0 && filter.ontologyTerms?.length > 0) {\n const terms = filter.ontologyTerms;\n if (terms.indexOf(rui.body.id) === -1) {\n seen = filterWithSpatialEntity(store, seen, (entities) =>\n filterByOntologyTerms(store, entities, terms)\n );\n }\n }\n if (seen.size > 0 && filter.cellTypeTerms?.length > 0) {\n const terms = filter.cellTypeTerms;\n if (terms.indexOf(rui.cell.id) === -1) {\n seen = filterWithSpatialEntity(store, seen, (entities) =>\n filterByCellTypeTerms(store, entities, terms)\n );\n }\n }\n if (seen.size > 0 && filter.ageRange?.length === 2 &&\n isFinite(filter.ageRange[0]) && isFinite(filter.ageRange[1])) {\n const maxAge = Math.max(...filter.ageRange);\n const minAge = Math.min(...filter.ageRange);\n\n // Age filter given by their default range will be ignored\n if (!(minAge === 1 && maxAge === 110)) {\n seen = filterWithDonor(store, seen, (donors) =>\n filterByAge(store, donors, minAge, maxAge)\n );\n }\n }\n if (seen.size > 0 && filter.bmiRange?.length === 2 &&\n isFinite(filter.bmiRange[0]) && isFinite(filter.bmiRange[1])) {\n const maxBMI = Math.max(...filter.bmiRange);\n const minBMI = Math.min(...filter.bmiRange);\n\n // BMI filter given by their default range will be ignored\n if (!(minBMI === 13 && maxBMI === 83)) {\n seen = filterWithDonor(store, seen, (donors) =>\n filterByBMI(store, donors, minBMI, maxBMI)\n );\n }\n }\n return seen;\n}\n\n/**\n * Gets all object ids in a store.\n *\n * @param store The triple store.\n * @returns A set of all ids.\n */\nfunction getAllEntities(store: Store): Set {\n const seen = new Set();\n store.forSubjects((s) => seen.add(s.id), entity.spatialEntity, null, null);\n return seen;\n}\n\n/**\n * Creates a callback function that adds ids to a second set iff it exists in the first set.\n *\n * @param seen The first set of ids.\n * @param newSeen The second set to add ids to.\n * @returns The callback function.\n */\nfunction differenceCallback(seen: Set, newSeen: Set): (term: Term) => void {\n return function (term: Term) {\n if (seen.has(term.id)) {\n newSeen.add(term.id);\n }\n };\n}\n\n/**\n * Filters ids by sex.\n *\n * @param store The triple store.\n * @param seen All ids to choose from.\n * @param sex Sex to filter on.\n * @returns The subset of ids with the specified sex.\n */\nfunction filterBySex(store: Store, seen: Set, sex: 'Male' | 'Female'): Set {\n const newSeen = new Set();\n store.forSubjects(differenceCallback(seen, newSeen), entity.sex, entity[sex], null);\n return newSeen;\n}\n\n/**\n * Filters ids by group names.\n *\n * @param store The triple store.\n * @param seen All ids to choose from.\n * @param groupNames Group names to filter on.\n * @returns The subset of ids with the specified group names.\n */\nfunction filterByGroupName(store: Store, seen: Set, groupNames: string[]): Set {\n const newSeen = new Set();\n for (const groupName of groupNames) {\n const literal = DataFactory.literal(groupName);\n store.forSubjects(differenceCallback(seen, newSeen), entity.providerName, literal, null);\n }\n return newSeen;\n}\n\n/**\n * Filters ids by technology names.\n *\n * @param store The triple store.\n * @param seen All ids to choose from.\n * @param technologies Technology names to filter on.\n * @returns The subset of ids with the specified technology names.\n */\nfunction filterByTechnology(store: Store, seen: Set, technologies: string[]): Set {\n const newSeen = new Set();\n for (const technology of technologies) {\n const literal = DataFactory.literal(technology);\n store.forSubjects(differenceCallback(seen, newSeen), entity.technology, literal, null);\n }\n return newSeen;\n}\n\n/**\n * Filters ids by ontology terms.\n *\n * @param store The triple store.\n * @param seen All ids to choose from.\n * @param terms Ontology terms to filter on.\n * @returns The subset of ids with the specified ontology terms.\n */\nfunction filterByOntologyTerms(store: Store, seen: Set, terms: string[]): Set {\n const newSeen = new Set();\n for (const term of terms) {\n const namedNode = DataFactory.namedNode(term);\n store.forSubjects(differenceCallback(seen, newSeen), ccf.spatialEntity.ccf_annotations, namedNode, null);\n }\n return newSeen;\n}\n\n/**\n * Filters ids by cell type terms.\n *\n * @param store The triple store.\n * @param seen All ids to choose from.\n * @param terms Cell type terms to filter on.\n * @returns The subset of ids with the specified cell type terms.\n */\nfunction filterByCellTypeTerms(store: Store, seen: Set, terms: string[]): Set {\n const asTerms = new Set();\n for (const term of terms) {\n store.forObjects((asTerm) => {\n asTerms.add(asTerm.id);\n }, term, ccf.asctb.located_in, null);\n if (term === rui.cell.id) {\n asTerms.add(rui.body.id);\n }\n }\n return filterByOntologyTerms(store, seen, [...asTerms]);\n}\n\n/**\n * Filters ids by age.\n *\n * @param store The triple store.\n * @param seen All ids to choose from.\n * @param minAge Minimum age.\n * @param maxAge Maximum age.\n * @returns The subset of ids with the specified age.\n */\nfunction filterByAge(store: Store, seen: Set, minAge: number, maxAge: number): Set {\n const newSeen = new Set();\n for (const subject of seen) {\n for (const quad of readQuads(store, subject, entity.age, null, null)) {\n const value = fromRdf(quad.object as Literal) as number;\n if (value >= minAge && value <= maxAge) {\n newSeen.add(subject);\n }\n }\n }\n return newSeen;\n}\n\n/**\n * Filters ids by BMI.\n *\n * @param store The triple store.\n * @param seen All ids to choose from.\n * @param minBMI Minimum BMI.\n * @param maxBMI Maximum BMI.\n * @returns The subset of ids with the specified BMI.\n */\nfunction filterByBMI(store: Store, seen: Set, minBMI: number, maxBMI: number): Set {\n const newSeen = new Set();\n for (const subject of seen) {\n for (const quad of readQuads(store, subject, entity.bmi, null, null)) {\n const value = fromRdf(quad.object as Literal) as number;\n if (value >= minBMI && value <= maxBMI) {\n newSeen.add(subject);\n }\n }\n }\n return newSeen;\n}\n\n/**\n * Filters ids by spatial entities.\n *\n * @param store The triple store.\n * @param seen All ids to choose from.\n * @param hasSpatialEntity Whether the filtered objects should have a spatial entity.\n * @returns The subset of ids with/without spatial entities.\n */\nfunction filterByHasSpatialEntity(store: Store, seen: Set, hasSpatialEntity = true): Set {\n const newSeen = new Set();\n store.forSubjects(differenceCallback(seen, newSeen), entity.spatialEntity, null, null);\n if (!hasSpatialEntity) {\n const notNewSeen = new Set();\n seen.forEach((s) => !newSeen.has(s) ? notNewSeen.add(s) : undefined);\n return notNewSeen;\n }\n return newSeen;\n}\n\nfunction filterBySpatialSearches(store: Store, graph: CCFSpatialGraph, seen: Set, spatialSearches: SpatialSearch[]): Set {\n const newSeen = new Set();\n for (const search of spatialSearches) {\n const thisSeen = filterByProbingSphere(store, graph, seen, search);\n thisSeen.forEach((s) => newSeen.add(s));\n }\n return newSeen;\n}\n","import { Store, readQuads } from 'triple-store-utils';\n\nimport { ccf, entity, rui } from '../util/prefixes';\n\n\nfunction getSpatialEntityMapping(subjects: Set, store: Store): Map> {\n const spatial2entity = new Map>();\n\n for (const subject of subjects) {\n for (const quad of readQuads(store, subject, entity.spatialEntity, null, null)) {\n if (!spatial2entity.has(quad.object.id)) {\n spatial2entity.set(quad.object.id, new Set([subject]));\n } else {\n spatial2entity.get(quad.object.id)!.add(subject);\n }\n }\n }\n return spatial2entity;\n}\n\nfunction getAnatomicalStructureMapping(ids: Set, store: Store): Map> {\n const spatial2entity = getSpatialEntityMapping(ids, store);\n const term2entity = new Map>();\n\n for (const subject of spatial2entity.keys()) {\n const entities = spatial2entity.get(subject)!;\n for (const quad of readQuads(store, subject, ccf.spatialEntity.ccf_annotations, null, null)) {\n if (!term2entity.has(quad.object.id)) {\n term2entity.set(quad.object.id, new Set(entities));\n } else {\n const termEntities = term2entity.get(quad.object.id)!;\n entities.forEach((value) => termEntities.add(value));\n }\n }\n }\n return term2entity;\n}\n\n/**\n * Get number of occurrences of ontology terms for a set of ids.\n *\n * @param ids Ids of objects to calculate aggregate over.\n * @param store The triple store.\n * @returns Ontology term counts.\n */\nexport function getOntologyTermOccurences(ids: Set, store: Store): Record {\n const counts: Record = {};\n const term2entities = getAnatomicalStructureMapping(ids, store);\n\n term2entities.forEach((value, key) => {\n counts[key] = value.size;\n });\n\n return counts;\n}\n\n/**\n * Get number of occurrences of cell type terms for a set of ids.\n *\n * @param ids Ids of objects to calculate aggregate over.\n * @param store The triple store.\n * @returns Ontology term counts.\n */\nexport function getCellTypeTermOccurences(ids: Set, store: Store): Record {\n const asTerm2entities = getAnatomicalStructureMapping(ids, store);\n const ctTerm2entities = new Map>();\n\n for (const asTerm of asTerm2entities.keys()) {\n const entities = asTerm2entities.get(asTerm)!;\n for (const quad of readQuads(store, null, ccf.asctb.located_in, asTerm, null)) {\n const cellType = quad.subject.id;\n if (!ctTerm2entities.has(cellType)) {\n ctTerm2entities.set(cellType, new Set(entities));\n } else {\n const termEntities = ctTerm2entities.get(cellType)!;\n entities.forEach((value) => termEntities.add(value));\n }\n }\n }\n\n const counts: Record = {};\n\n ctTerm2entities.forEach((value, key) => {\n counts[key] = value.size;\n });\n\n counts[rui.cell.id] = asTerm2entities.get(rui.body.id)?.size ?? 0;\n\n return counts;\n}\n","import { memoize } from 'lodash';\nimport { readQuads, Store } from 'triple-store-utils';\nimport { OntologyTreeModel, OntologyTreeNode } from '../interfaces';\nimport { getEntries } from '../util/n3-functions';\nimport { ccf, rui } from '../util/prefixes';\n\n\nexport function getOntologyTreeNode(store: Store, iri: string, relationshipIri: string): OntologyTreeNode {\n const result: OntologyTreeNode = {\n '@id': iri, '@type': 'OntologyTreeNode', id: iri, parent: '',\n children: [] as string[], synonymLabels: [] as string[], label: ''\n };\n\n const ontologyTreeNodeResult = {\n [ccf.ontologyNode.label.id]: 'label',\n [relationshipIri]: 'parent',\n [ccf.ontologyNode.synonymLabels.id]: 'synonymLabels',\n };\n\n for (const [key, value] of getEntries(store, iri, ontologyTreeNodeResult)) {\n if (key === 'synonymLabels') {\n result.synonymLabels.push(value as string);\n } else {\n result[key] = value;\n }\n }\n result.children = store.getSubjects(relationshipIri, iri, null).map(s => s.id);\n\n return result;\n}\n\nexport function getOntologyTreeModel(store: Store, rootIri: string, rootLabel: string, relationshipIri: string): OntologyTreeModel {\n const result: OntologyTreeModel = { root: rootIri, nodes: {} };\n const seen = new Set();\n for (const quad of readQuads(store, null, relationshipIri, null, null)) {\n seen.add(quad.subject.id);\n seen.add(quad.object.id);\n }\n\n for (const iri of seen) {\n result.nodes[iri] = getOntologyTreeNode(store, iri, relationshipIri);\n }\n\n if (!result.nodes[rootIri]) {\n result.nodes[rootIri] = {\n '@id': rootIri,\n '@type': 'OntologyTreeNode',\n id: rootIri,\n label: rootLabel,\n children: [],\n synonymLabels: []\n } as unknown as OntologyTreeNode;\n }\n\n const rootChildren = store\n .getSubjects(relationshipIri, rootIri, null).map(o => o.id)\n .sort((a, b) => result.nodes[a].label.localeCompare(result.nodes[b].label));\n result.nodes[rootIri].children = rootChildren;\n\n treeify(result);\n\n return result;\n}\n\n/**\n * Recursive function to ensure that the given ontology tree model is actually a tree by essentially using a BFS search.\n *\n * @param model the ontology tree model to mutate\n * @param nodeIri the tree node iri to modify. Starts at root in the base case\n * @param seen a set of IRIs that have been 'seen' so far to remove loops in the graph\n */\nfunction treeify(model: OntologyTreeModel, nodeIri: string | undefined = undefined, seen: Set = new Set()) {\n const node = model.nodes[nodeIri ?? model.root];\n if (node) {\n node.children = node.children.filter(n => !seen.has(n));\n node.children.forEach(n => seen.add(n));\n for (const childId of node.children) {\n treeify(model, childId, seen);\n if (model.nodes[childId]) {\n model.nodes[childId].parent = node['@id'];\n }\n }\n }\n}\n\nexport function getAnatomicalStructureTreeModelSlowly(store: Store): OntologyTreeModel {\n const model = getOntologyTreeModel(store, rui.body.id, 'body', ccf.asctb.part_of.id);\n model.nodes[rui.body.id].children = [\n 'http://purl.obolibrary.org/obo/UBERON_0000955', // Brain\n 'http://purl.obolibrary.org/obo/UBERON_0000029', // Lymph Node\n // 'http://purl.obolibrary.org/obo/UBERON_0002509', // Mesenteric Lymph Node\n 'http://purl.obolibrary.org/obo/UBERON_0000970', // Eye\n // 'http://purl.obolibrary.org/obo/UBERON_0004548', // Eye, L\n // 'http://purl.org/sig/ont/fma/fma54449', // Eye, R\n 'http://purl.obolibrary.org/obo/UBERON_0003889', // Fallopian Tube\n // 'http://purl.obolibrary.org/obo/UBERON_0001303', // Fallopian Tube, L\n // 'http://purl.obolibrary.org/obo/UBERON_0001302', // Fallopian Tube, R\n 'http://purl.obolibrary.org/obo/UBERON_0000948', // Heart\n 'http://purl.obolibrary.org/obo/UBERON_0002113', // Kidney\n // 'http://purl.obolibrary.org/obo/UBERON_0004538', // Kidney, L\n // 'http://purl.obolibrary.org/obo/UBERON_0004539', // Kidney, R\n 'http://purl.obolibrary.org/obo/UBERON_0001465', // Knee\n // 'http://purl.org/sig/ont/fma/fma24978', // Knee, L\n // 'http://purl.org/sig/ont/fma/fma24977', // Knee, R\n 'http://purl.obolibrary.org/obo/UBERON_0002107', // Liver\n 'http://purl.obolibrary.org/obo/UBERON_0002048', // Lungs\n 'http://purl.obolibrary.org/obo/UBERON_0001911', // Mammary Gland\n // 'http://purl.org/sig/ont/fma/fma57991', // Mammary Gland, L\n // 'http://purl.org/sig/ont/fma/fma57987', // Mammary Gland, R\n 'http://purl.obolibrary.org/obo/UBERON_0000992', // Ovary\n // 'http://purl.org/sig/ont/fma/fma7214', // Ovary, L\n // 'http://purl.org/sig/ont/fma/fma7213', // Ovary, R\n 'http://purl.obolibrary.org/obo/UBERON_0001264', // Pancreas\n 'http://purl.obolibrary.org/obo/UBERON_0001270', // Pelvis\n 'http://purl.obolibrary.org/obo/UBERON_0001987', // Placenta\n 'http://purl.obolibrary.org/obo/UBERON_0002367', // Prostate\n 'http://purl.obolibrary.org/obo/UBERON_0002097', // Skin\n 'http://purl.obolibrary.org/obo/UBERON_0002108', // Small Intestine\n 'http://purl.obolibrary.org/obo/UBERON_0002240', // Spinal Cord\n 'http://purl.obolibrary.org/obo/UBERON_0000059', // Large Intestine\n 'http://purl.obolibrary.org/obo/UBERON_0002106', // Spleen\n 'http://purl.obolibrary.org/obo/UBERON_0002370', // Thymus\n 'http://purl.obolibrary.org/obo/UBERON_0000056', // Ureter\n // 'http://purl.obolibrary.org/obo/UBERON_0001223', // Ureter, L\n // 'http://purl.obolibrary.org/obo/UBERON_0001222', // Ureter, R\n 'http://purl.obolibrary.org/obo/UBERON_0001255', // Urinary Bladder\n 'http://purl.obolibrary.org/obo/UBERON_0000995', // Uterus\n 'http://purl.obolibrary.org/obo/UBERON_0004537' // Blood Vasculature\n ].filter(iri => iri in model.nodes);\n return model;\n}\n\nexport const getAnatomicalStructureTreeModel = memoize(getAnatomicalStructureTreeModelSlowly, () => '');\n\nexport function getCellTypeTreeModel(store: Store): OntologyTreeModel {\n return getOntologyTreeModel(store, rui.cell.id, 'cell', ccf.asctb.ct_is_a.id);\n}\n","import { Store } from 'triple-store-utils';\nimport { DatasetResult, DonorResult, TissueBlockResult, TissueSectionResult } from '../interfaces';\nimport { getEntries, getMappedResult } from '../util/n3-functions';\nimport { entity } from '../util/prefixes';\n\n\n/** Entity iri to property path. */\nconst listResultSet: { [iri: string]: string } = {\n [entity.label.id]: 'label',\n [entity.description.id]: 'description',\n [entity.link.id]: 'link'\n};\n\nconst donorResultSet: { [iri: string]: string } = {\n ...listResultSet,\n [entity.providerName.id]: 'providerName'\n};\n\nconst datasetResultSet: { [iri: string]: string } = {\n ...listResultSet,\n [entity.technology.id]: 'technology',\n [entity.thumbnail.id]: 'thumbnail',\n};\n\nconst tissueSectionResultSet: { [iri: string]: string } = {\n ...listResultSet,\n [entity.sampleType.id]: 'sampleType',\n [entity.sectionNumber.id]: 'sectionNumber',\n [entity.datasets.id]: 'datasets',\n};\n\nconst tissueBlockResultSet: { [iri: string]: string } = {\n ...listResultSet,\n [entity.sampleType.id]: 'sampleType',\n [entity.sectionCount.id]: 'sectionCount',\n [entity.sectionSize.id]: 'sectionSize',\n [entity.sectionUnits.id]: 'sectionUnits',\n\n [entity.donor.id]: 'donor',\n [entity.spatialEntity.id]: 'spatialEntityId',\n [entity.sections.id]: 'sections',\n [entity.datasets.id]: 'datasets',\n};\n\n/**\n * Extracts a single donor result from the triple store.\n *\n * @param store The triple store.\n * @param iri The entity id.\n * @returns The list data.\n */\nexport function getDonorResult(store: Store, iri: string): DonorResult {\n return getMappedResult(store, iri, 'Donor', donorResultSet);\n}\n\n/**\n * Extracts a single dataset result from the triple store.\n *\n * @param store The triple store.\n * @param iri The entity id.\n * @returns The list data.\n */\nexport function getDatasetResult(store: Store, iri: string): DatasetResult {\n return getMappedResult(store, iri, 'Dataset', datasetResultSet);\n}\n\n/**\n * Extracts a single tissue section result from the triple store.\n *\n * @param store The triple store.\n * @param iri The entity id.\n * @returns The list data.\n */\nexport function getTissueSectionResult(store: Store, iri: string): TissueSectionResult {\n // eslint-disable-next-line @typescript-eslint/consistent-type-assertions\n const result = { '@id': iri, '@type': 'Sample', datasets: [] as DatasetResult[] } as TissueSectionResult;\n for (const [key, value] of getEntries(store, iri, tissueSectionResultSet)) {\n if (key === 'datasets') {\n const dataset = getDatasetResult(store, value as string);\n result[key].push(dataset);\n } else {\n result[key] = value;\n }\n }\n return result;\n}\n\n/**\n * Extracts a single tissue block result from the triple store.\n *\n * @param store The triple store.\n * @param iri The entity id.\n * @returns The list data.\n */\nexport function getTissueBlockResult(store: Store, iri: string): TissueBlockResult {\n // eslint-disable-next-line @typescript-eslint/consistent-type-assertions\n const result = { '@id': iri, '@type': 'Sample',\n sections: [] as TissueSectionResult[], datasets: [] as DatasetResult[]\n } as TissueBlockResult;\n for (const [key, value] of getEntries(store, iri, tissueBlockResultSet)) {\n if (key === 'sections') {\n const section = getTissueSectionResult(store, value as string);\n result[key].push(section);\n } else if (key === 'datasets') {\n const dataset = getDatasetResult(store, value as string);\n result[key].push(dataset);\n } else if (key === 'donor') {\n result[key] = getDonorResult(store, value as string);\n } else {\n result[key] = value;\n }\n }\n return result;\n}\n","import { DatabaseStatus } from '../interfaces';\nimport { CCFDatabase } from '../ccf-database';\n\n\nexport class CCFDatabaseStatusTracker {\n status: 'Ready' | 'Loading' | 'Error';\n message?: string;\n loadTime?: number;\n\n constructor(public database: CCFDatabase) {\n this.connect();\n }\n\n toJson(): DatabaseStatus {\n return {\n status: this.status,\n message: this.message,\n checkback: this.status === 'Ready' || this.status === 'Error' ? 60 * 60 * 1000 : 2000,\n loadTime: this.loadTime\n };\n }\n\n private connect(): Promise {\n this.status = 'Loading';\n this.message = 'Loading database';\n\n const startTime = Date.now();\n return this.database.connect()\n .then(async (loaded) => {\n if (loaded) {\n // Warm up the database\n this.message = 'Building scene';\n await this.database.getScene();\n this.message = 'Building tissue block results';\n await this.database.getTissueBlockResults();\n this.message = 'Aggregating results';\n await this.database.getAggregateResults();\n this.status = 'Ready';\n this.message = 'Database successfully loaded';\n } else {\n this.status = 'Error';\n this.message = 'Unknown error while loading database';\n }\n })\n .catch((error: { message?: string }) => {\n this.status = 'Error';\n this.message = error?.message ?? 'Unknown error while loading database';\n })\n .finally(() => {\n this.loadTime = Date.now() - startTime;\n });\n }\n}\n","\nimport { Context, JsonLd } from 'jsonld/jsonld-spec';\n\n/* eslint-disable @typescript-eslint/naming-convention */\n/** CCF v2.0 JSON-LD Context */\nconst CCF_CONTEXT = {\n '@context': {\n '@base': 'http://purl.org/ccf/',\n '@vocab': 'http://purl.org/ccf/',\n 'ccf': 'http://purl.org/ccf/',\n 'rdfs': 'http://www.w3.org/2000/01/rdf-schema#',\n 'dcterms': 'http://purl.org/dc/terms/',\n 'label': 'rdfs:label',\n 'description': 'rdfs:comment',\n 'link': 'ccf:url',\n 'sex': 'ccf:sex',\n 'age': 'ccf:age',\n 'bmi': 'ccf:bmi',\n 'consortium_name': 'ccf:consortium_name',\n 'provider_name': 'ccf:tissue_provider_name',\n 'provider_uuid': 'ccf:tissue_provider_uuid',\n 'donor': {\n '@id': 'ccf:comes_from',\n '@type': '@id'\n },\n 'samples': {\n '@reverse': 'donor'\n },\n 'sections': {\n '@id': 'ccf:subdivided_into_sections',\n '@type': '@id'\n },\n 'datasets': {\n '@id': 'ccf:generates_dataset',\n '@type': '@id'\n },\n 'sample_type': 'ccf:sample_type',\n 'section_count': 'ccf:section_count',\n 'section_size': 'ccf:section_size',\n 'section_units': 'ccf:section_size_unit',\n 'section_number': 'ccf:section_number',\n 'rui_location': {\n '@id': 'ccf:has_registration_location',\n '@type': '@id'\n },\n 'ccf_annotations': {\n '@id': 'ccf:collides_with',\n '@type': '@id',\n '@container': '@set'\n },\n 'representation_of': {\n '@id': 'ccf:representation_of',\n '@type': '@id'\n },\n 'reference_organ': {\n '@id': 'ccf:has_reference_organ',\n '@type': '@id'\n },\n 'extraction_set_for': {\n '@id': 'ccf:extraction_set_for',\n '@type': '@id'\n },\n 'extraction_set': {\n '@id': 'ccf:has_extraction_set',\n '@type': '@id'\n },\n 'organ_owner_sex': 'ccf:organ_owner_sex',\n 'side': 'ccf:organ_side',\n 'rui_rank': 'ccf:rui_rank',\n 'slice_thickness': 'ccf:slice_thickness',\n 'slice_count': 'ccf:slice_count',\n 'object': {\n '@id': 'ccf:has_object_reference',\n '@type': '@id'\n },\n 'creation_date': 'dcterms:created',\n 'updated_date': 'ccf:updated_date',\n 'creator': 'dcterms:creator',\n 'creator_first_name': 'ccf:creator_first_name',\n 'creator_last_name': 'ccf:creator_last_name',\n 'placement': {\n '@reverse': 'ccf:placement_for'\n },\n 'placement_date': 'dcterms:created',\n 'rotation_order': 'ccf:rotation_order',\n 'dimension_units': 'ccf:dimension_unit',\n 'rotation_units': 'ccf:rotation_unit',\n 'scaling_units': 'ccf:scaling_unit',\n 'translation_units': 'ccf:translation_unit',\n 'source': {\n '@id': 'ccf:placement_for',\n '@type': '@id'\n },\n 'target': {\n '@id': 'ccf:placement_relative_to',\n '@type': '@id'\n },\n 'x_rotation': 'ccf:x_rotation',\n 'y_rotation': 'ccf:y_rotation',\n 'z_rotation': 'ccf:z_rotation',\n 'x_scaling': 'ccf:x_scaling',\n 'y_scaling': 'ccf:y_scaling',\n 'z_scaling': 'ccf:z_scaling',\n 'x_translation': 'ccf:x_translation',\n 'y_translation': 'ccf:y_translation',\n 'z_translation': 'ccf:z_translation',\n 'x_dimension': 'ccf:x_dimension',\n 'y_dimension': 'ccf:y_dimension',\n 'z_dimension': 'ccf:z_dimension',\n 'ontology_terms': {\n '@id': 'ccf:has_ontology_term',\n '@type': '@id'\n },\n 'technology': 'ccf:technology',\n 'thumbnail': 'ccf:thumbnail',\n 'file': 'ccf:file_url',\n 'file_format': 'ccf:file_format',\n 'file_subpath': 'ccf:file_subpath'\n }\n};\n/* eslint-enable @typescript-eslint/naming-convention */\n\n/**\n * Function which takes JSON-LD data and makes patches to update from CCF v1.x to v2.0 automatically\n *\n * @param jsonLdString the input JSON-LD as a string\n * @returns A JSON-LD object derived from the given string with updated data to be compatible with CCF v2.0\n */\nexport function patchJsonLd(jsonLdString: string): JsonLd {\n return JSON.parse(jsonLdString, (key, value) => {\n if (key === 'ccf_annotations' && Array.isArray(value)) {\n return value.map((iri: string) => {\n if (iri?.startsWith('http://purl.obolibrary.org/obo/FMA_')) {\n return iri.replace(\n 'http://purl.obolibrary.org/obo/FMA_',\n 'http://purl.org/sig/ont/fma/fma'\n );\n } else {\n return iri;\n }\n });\n } else if (key === '@context' && value && (\n value === 'https://hubmapconsortium.github.io/hubmap-ontology/ccf-entity-context.jsonld'\n || value === 'https://hubmapconsortium.github.io/hubmap-ontology/ccf-context.jsonld'\n || value === 'https://hubmapconsortium.github.io/ccf-ontology/ccf-context.jsonld'\n || (value as Context)['@base'] === 'http://purl.org/ccf/latest/ccf-entity.owl#'\n )) {\n return CCF_CONTEXT;\n }\n return value;\n });\n}\n","import { Store, readQuads, DataFactory, NamedNode } from 'triple-store-utils';\nimport { getAnatomicalStructureTreeModel } from '../queries/ontology-tree-n3';\nimport { ccf, entity } from './prefixes';\n\n\n/**\n * Function to add additional ccf_annotations to rui locations based on the\n * reference organ it was placed relative to.\n *\n * @param store the triple store holding the CCF.OWL data\n */\nexport function enrichRuiLocations(store: Store): void {\n const tree = getAnatomicalStructureTreeModel(store);\n const refOrganMap: Map = new Map();\n\n // Build a map from reference organ to ccf annotations via representation_of and the AS partonomy\n for (const { subject: organ, object: term } of readQuads(store, null, ccf.spatialEntity.representation_of, null, null)) {\n const annotations = new Set([term.id]);\n let parent = tree.nodes[term.id]?.parent;\n while (parent) {\n if (annotations.has(parent)) {\n break;\n } else {\n annotations.add(parent);\n parent = tree.nodes[parent]?.parent;\n }\n }\n refOrganMap.set(organ.id, [ ...annotations].map(s => DataFactory.namedNode(s)));\n }\n\n // Add AS terms for rui locations based on the reference organs they are placed relative to\n for (const { object: ruiLocation } of readQuads(store, null, entity.spatialEntity, null, null)) {\n for (const { subject: placement } of readQuads(store, null, ccf.spatialPlacement.source, ruiLocation, null)) {\n for (const { object: organ } of readQuads(store, placement, ccf.spatialPlacement.target, null, null)) {\n for (const term of refOrganMap.get(organ.id) ?? []) {\n store.addQuad(DataFactory.namedNode(ruiLocation.id), ccf.spatialEntity.ccf_annotations, term);\n }\n }\n }\n }\n}\n","/* eslint-disable @typescript-eslint/member-ordering */\nimport { delMany, get, setMany } from 'idb-keyval';\nimport { JsonLd } from 'jsonld/jsonld-spec';\nimport {\n addJsonLdToStore, addN3ToStore, addRdfXmlToStore, DataFactory, deserializeN3Store, Quad, serializeN3Store, Store\n} from 'triple-store-utils';\n\nimport { CCFSpatialGraph } from './ccf-spatial-graph';\nimport { CCFSpatialScene, SpatialSceneNode } from './ccf-spatial-scene';\nimport { searchHubmap } from './hubmap/hubmap-data-import';\nimport { AggregateResult, DatabaseStatus, Filter, OntologyTreeModel, TissueBlockResult } from './interfaces';\nimport { getAggregateResults, getDatasetTechnologyNames, getProviderNames } from './queries/aggregate-results-n3';\nimport { findIds } from './queries/find-ids-n3';\nimport { getCellTypeTermOccurences, getOntologyTermOccurences } from './queries/ontology-term-occurences-n3';\nimport { getAnatomicalStructureTreeModel, getCellTypeTreeModel } from './queries/ontology-tree-n3';\nimport { getSpatialEntityForEntity } from './queries/spatial-result-n3';\nimport { getTissueBlockResult } from './queries/tissue-block-result-n3';\nimport { FlatSpatialPlacement, SpatialEntity } from './spatial-types';\nimport { CCFDatabaseStatusTracker } from './util/ccf-database-status-tracker';\nimport { patchJsonLd } from './util/patch-jsonld';\nimport { enrichRuiLocations } from './util/enrich-rui-locations';\n\n\n/** Database initialization options. */\nexport interface CCFDatabaseOptions {\n /** A url to load data from. */\n ccfOwlUrl: string;\n /** Context. */\n ccfContextUrl: string;\n /** A list of data sources (in n3, rdf, xml, owl, or jsonld format) */\n dataSources: (string|JsonLd)[];\n /** Data service type. */\n hubmapDataService: 'static' | 'search-api';\n /** HuBMAP Elastic Search Query */\n hubmapQuery?: unknown;\n /** Hubmap Portal url. */\n hubmapPortalUrl: string;\n /** Hubmap data url. */\n hubmapDataUrl: string;\n /** Hubmap assets api url. */\n hubmapAssetsUrl: string;\n /** HuBMAP Service Token. */\n hubmapToken?: string;\n}\n\n/** Default initialization options. */\nexport const DEFAULT_CCF_DB_OPTIONS: CCFDatabaseOptions = {\n ccfOwlUrl: 'https://purl.org/ccf/latest/ccf.owl',\n ccfContextUrl: 'https://purl.org/ccf/latest/ccf-context.jsonld',\n dataSources: [],\n hubmapDataService: 'static',\n hubmapPortalUrl: 'https://portal.hubmapconsortium.org/',\n hubmapDataUrl: '',\n hubmapAssetsUrl: 'https://assets.hubmapconsortium.org'\n};\n\n/** Database provider. */\nexport class CCFDatabase {\n /** The triple store. */\n store: Store;\n /** The spatial graph */\n graph: CCFSpatialGraph;\n /** Creates SpatialEntity Scenes */\n scene: CCFSpatialScene;\n /** If the database is initialized */\n private initializing?: Promise;\n\n private status: CCFDatabaseStatusTracker;\n\n /**\n * Creates an instance of ccfdatabase.\n *\n * @param [options] Initialization options.\n */\n constructor(public options: CCFDatabaseOptions = DEFAULT_CCF_DB_OPTIONS) {\n this.store = new Store(undefined, { factory: DataFactory });\n this.graph = new CCFSpatialGraph(this);\n this.scene = new CCFSpatialScene(this);\n }\n\n /**\n * Connects the database.\n *\n * @param [options] Options used to initialize.\n * @returns A promise resolving to true if data has been loaded into the database.\n */\n async connect(options?: CCFDatabaseOptions, cached = false): Promise {\n if (options) {\n this.options = options;\n }\n if (!this.initializing) {\n if (cached) {\n this.initializing = this.cachedConnect();\n } else {\n this.initializing = this.doConnect();\n }\n }\n await this.initializing;\n return this.store.size > 0;\n }\n\n private async cachedConnect(): Promise {\n const start = new Date().getTime();\n const lastModifiedKey = 'ccf-database.last_modified';\n const ccfDatabaseKey = 'ccf-database';\n\n const lastModified = await get(lastModifiedKey).catch(() => undefined);\n let serializedDb: string | undefined;\n\n if (lastModified && start - new Date(+lastModified).getTime() > 60*60*1000) {\n await delMany([ccfDatabaseKey, lastModifiedKey]).catch(() => undefined);\n } else {\n serializedDb = await get(ccfDatabaseKey).catch(() => undefined);\n }\n\n if (serializedDb) {\n await this.deserialize(serializedDb);\n } else {\n await this.doConnect();\n\n setMany([\n [ccfDatabaseKey, this.serialize()],\n [lastModifiedKey, '' + start]\n ]).catch(() => undefined);\n }\n }\n\n /**\n * Actually connects to the database.\n *\n * @returns A promise resolving to void when connected.\n */\n private async doConnect(): Promise {\n const ops: Promise[] = [];\n const sources: (string|JsonLd)[] = this.options.dataSources?.concat() ?? [];\n\n const ccfOwlUrl = this.options.ccfOwlUrl;\n if (ccfOwlUrl.startsWith('{')) {\n // serialized n3 store was provided as the ccfOwlUrl\n this.store = deserializeN3Store(ccfOwlUrl, DataFactory);\n } else if (ccfOwlUrl.endsWith('.n3store.json')) {\n const storeString = await fetch(ccfOwlUrl).then(r => r.text())\n .catch(() => console.log('Couldn\\'t locate serialized store.'));\n if (storeString) {\n this.store = deserializeN3Store(storeString, DataFactory);\n }\n } else if (ccfOwlUrl?.length > 0) {\n sources.push(ccfOwlUrl);\n }\n if (this.options.hubmapDataUrl) {\n if (this.options.hubmapDataUrl.endsWith('jsonld')) {\n sources.push(this.options.hubmapDataUrl);\n } else {\n ops.push(searchHubmap(\n this.options.hubmapDataUrl,\n this.options.hubmapDataService,\n this.options.hubmapQuery,\n this.options.hubmapToken,\n this.options.hubmapAssetsUrl,\n this.options.hubmapPortalUrl\n ).then((jsonld) => {\n if (jsonld) {\n return this.addDataSources([jsonld]);\n } else {\n return undefined;\n }\n }));\n }\n }\n ops.push(this.addDataSources(sources));\n await Promise.all(ops);\n await this.synchronize();\n }\n\n async addDataSources(sources: (string|JsonLd)[], inputStore?: Store): Promise {\n const store: Store = inputStore ?? this.store;\n await Promise.all(\n sources.map(async (source) => {\n if (typeof source === 'string') {\n if ((source.startsWith('http') || source.startsWith('assets/')) && source.includes('jsonld')) {\n source = await fetch(source).then(r => r.text());\n source = patchJsonLd(source as string);\n await addJsonLdToStore(source, store);\n } else if (source.endsWith('n3')) {\n await addN3ToStore(source, store);\n } else if (source.endsWith('rdf') || source.endsWith('owl') || source.endsWith('xml')) {\n await addRdfXmlToStore(source, store);\n } else {\n // Passthrough assumes a JSON-LD response\n source = patchJsonLd(source);\n await addJsonLdToStore(source, store);\n }\n } else {\n source = patchJsonLd(JSON.stringify(source));\n await addJsonLdToStore(source, store);\n }\n })\n );\n return this;\n }\n\n async synchronize(): Promise {\n // Add a small delay to allow the triple store to settle\n await new Promise(r => {\n setTimeout(r, 500);\n });\n this.graph.createGraph();\n enrichRuiLocations(this.store);\n return this;\n }\n\n serialize(): string {\n return serializeN3Store(this.store);\n }\n\n async deserialize(value: string): Promise {\n this.store = deserializeN3Store(value, DataFactory);\n this.graph = new CCFSpatialGraph(this);\n this.scene = new CCFSpatialScene(this);\n await new Promise(r => {\n setTimeout(r, 10);\n });\n }\n\n /**\n * Gets all ids matching the filter.\n *\n * @param [filter] The filter.\n * @returns A set of all matching ids.\n */\n getIds(filter: Filter = {} as Filter): Set {\n return findIds(this.store, this.graph, filter);\n }\n\n /**\n * Gets the data for an object.\n *\n * @param id The id of the requested object.\n * @returns The object data.\n */\n get(id: string): Quad[] {\n return this.store.getQuads(DataFactory.namedNode(id), null, null, null);\n }\n\n /**\n * Gets the data for objects matching a filter.\n *\n * @param [filter] The filter.\n * @returns An array of data.\n */\n search(filter: Filter = {} as Filter): Quad[][] {\n return [...this.getIds(filter)].map((s) => this.get(s));\n }\n\n /**\n * Gets all spatial entities for a filter.\n *\n * @param [filter] The filter.\n * @returns A list of spatial entities.\n */\n getSpatialEntities(filter?: Filter): SpatialEntity[] {\n // eslint-disable-next-line @typescript-eslint/consistent-type-assertions\n filter = { ...filter, hasSpatialEntity: true } as Filter;\n return [...this.getIds(filter)].map((s) => getSpatialEntityForEntity(this.store, s) as SpatialEntity);\n }\n\n async getDatabaseStatus(): Promise {\n if (!this.status) {\n this.status = new CCFDatabaseStatusTracker(this);\n }\n return this.status.toJson();\n }\n\n /**\n * Get a list of technology names used by datasets\n *\n * @returns list of unique technology names in the data\n */\n async getDatasetTechnologyNames(): Promise {\n return getDatasetTechnologyNames(this.store);\n }\n\n /**\n * Get a list of provider names from the database\n *\n * @returns list of unique provider names in the data\n */\n async getProviderNames(): Promise {\n return getProviderNames(this.store);\n }\n\n /**\n * Gets all tissue block results for a filter.\n *\n * @param [filter] The filter.\n * @returns A list of results.\n */\n async getTissueBlockResults(filter?: Filter): Promise {\n // eslint-disable-next-line @typescript-eslint/consistent-type-assertions\n filter = { ...filter, hasSpatialEntity: true } as Filter;\n return [...this.getIds(filter)].map((s) => getTissueBlockResult(this.store, s));\n }\n\n /**\n * Gets all aggregate results for a filter.\n *\n * @param [filter] The filter.\n * @returns A list of aggregate data.\n */\n async getAggregateResults(filter?: Filter): Promise {\n return getAggregateResults(this.getIds(filter), this.store);\n }\n\n /**\n * Get number of occurrences of ontology terms for a set of ids.\n *\n * @param [filter] The filter.\n * @returns Ontology term counts.\n */\n async getOntologyTermOccurences(filter?: Filter): Promise> {\n return getOntologyTermOccurences(this.getIds(filter), this.store);\n }\n\n /**\n * Get number of occurrences of cell type terms for a set of ids.\n *\n * @param [filter] The filter.\n * @returns Cell type term counts.\n */\n async getCellTypeTermOccurences(filter?: Filter): Promise> {\n return getCellTypeTermOccurences(this.getIds(filter), this.store);\n }\n\n /**\n * Get ontology term tree nodes\n *\n * @returns Ontology term counts.\n */\n async getOntologyTreeModel(): Promise {\n return getAnatomicalStructureTreeModel(this.store);\n }\n\n /**\n * Get cell type term tree nodes\n *\n * @returns Ontology term counts.\n */\n async getCellTypeTreeModel(): Promise {\n return getCellTypeTreeModel(this.store);\n }\n\n /**\n * Get reference organs\n *\n * @returns Ontology term counts.\n */\n async getReferenceOrgans(): Promise {\n return this.scene.getReferenceOrgans();\n }\n\n /**\n * Get all nodes to form the 3D scene of reference body, organs, and tissues\n *\n * @param [filter] The filter.\n * @returns A list of Spatial Scene Nodes for the 3D Scene\n */\n async getScene(filter?: Filter): Promise {\n this.graph.createGraph();\n return this.scene.getScene(filter);\n }\n\n /**\n * Get all nodes to form the 3D scene of reference organ and tissues\n *\n * @param [organIri] The Reference Organ IRI\n * @param [filter] The filter.\n * @returns A list of Spatial Scene Nodes for the 3D Scene\n */\n async getReferenceOrganScene(organIri: string, filter?: Filter): Promise {\n this.graph.createGraph();\n return this.scene.getReferenceOrganScene(organIri, filter);\n }\n\n async getSpatialPlacement(source: SpatialEntity, targetIri: string): Promise {\n return this.graph.getSpatialPlacement(source, targetIri);\n }\n}\n","import { Matrix4, toRadians } from '@math.gl/core';\nimport { SpatialSceneNode } from '../ccf-spatial-scene';\nimport { SpatialSearch } from '../interfaces';\nimport { SpatialEntity } from '../spatial-types';\n\ntype Color = [number, number, number, number];\nconst gold: Color = [240, 183, 98, 255];\nconst red: Color = [213, 0, 0, 255];\nconst green: Color = [29, 204, 101, 255];\nconst blue: Color = [41, 121, 255, 255];\n\n/**\n * Create a set of scene nodes for the body-ui to show the probing sphere and lines around it\n * for a given spatial search.\n * @param node the Spatial Entity (usually a reference organ) that the sphere is probing into\n * @param sphere the Spatial Search that defines where and how big the probing sphere is\n * @returns a set of scene nodes for the body-ui\n */\nexport function getProbingSphereScene(node: SpatialEntity, sphere?: SpatialSearch): SpatialSceneNode[] {\n const sceneWidth = node.x_dimension / 1000;\n const sceneHeight = node.y_dimension / 1000;\n const sceneDepth = node.z_dimension / 1000;\n const defaultSphereRadius = Math.max(sceneWidth, sceneHeight, sceneDepth) * 0.07;\n const sphereLineRadius = defaultSphereRadius * 0.05;\n const sphereLineLength = defaultSphereRadius * 2;\n const sphereConeRadius = sphereLineRadius * 4;\n\n if (!sphere) {\n sphere = {\n target: node.representation_of ?? node['@id'],\n radius: defaultSphereRadius,\n x: sceneWidth / 2,\n y: sceneHeight / 2,\n z: sceneDepth / 2\n };\n } else {\n sphere = {\n ...sphere,\n radius: sphere.radius / 1000,\n x: sphere.x / 1000,\n y: sphere.y / 1000,\n z: sphere.z / 1000\n };\n }\n\n return [\n // Probing Sphere\n {\n '@id': 'http://purl.org/ccf/latest/ccf.owl#ProbingSphere',\n '@type': 'SpatialSceneNode',\n unpickable: false,\n geometry: 'sphere',\n transformMatrix: new Matrix4(Matrix4.IDENTITY).translate([sphere.x, sphere.y, sphere.z]).scale(sphere.radius),\n color: gold\n },\n // Probing Sphere Positive X Axis (D)\n {\n '@id': 'http://purl.org/ccf/latest/ccf.owl#ProbingsphereXD',\n '@type': 'SpatialSceneNode',\n unpickable: true,\n geometry: 'cylinder',\n transformMatrix: new Matrix4(Matrix4.IDENTITY)\n .translate([sphere.x + sphere.radius + sphereLineLength / 2, sphere.y, sphere.z])\n .rotateZ(toRadians(-90))\n .scale([sphereLineRadius, sphereLineLength, sphereLineRadius]),\n color: red\n },\n {\n '@id': 'http://purl.org/ccf/latest/ccf.owl#ProbingsphereXDCone',\n '@type': 'SpatialSceneNode',\n unpickable: true,\n geometry: 'cone',\n transformMatrix: new Matrix4(Matrix4.IDENTITY)\n .translate([sphere.x + sphere.radius + sphereLineLength, sphere.y, sphere.z])\n .rotateZ(toRadians(-90))\n .scale([ sphereConeRadius, sphereConeRadius * 3, sphereConeRadius ]),\n color: red\n },\n {\n '@id': 'http://purl.org/ccf/latest/ccf.owl#ProbingsphereXDLabel',\n '@type': 'SpatialSceneNode',\n unpickable: true,\n geometry: 'text',\n text: 'D',\n transformMatrix: new Matrix4(Matrix4.IDENTITY)\n .translate([sphere.x + sphere.radius + sphereLineLength + sphereConeRadius * 3, sphere.y, sphere.z])\n .scale(sphereConeRadius),\n color: red\n },\n // Probing Sphere Negative X Axis (A)\n {\n '@id': 'http://purl.org/ccf/latest/ccf.owl#ProbingsphereXA',\n '@type': 'SpatialSceneNode',\n unpickable: true,\n geometry: 'cylinder',\n transformMatrix: new Matrix4(Matrix4.IDENTITY)\n .translate([sphere.x - sphere.radius - sphereLineLength / 2, sphere.y, sphere.z])\n .rotateZ(toRadians(-90))\n .scale([sphereLineRadius, sphereLineLength, sphereLineRadius]),\n color: red\n },\n {\n '@id': 'http://purl.org/ccf/latest/ccf.owl#ProbingsphereXACone',\n '@type': 'SpatialSceneNode',\n unpickable: true,\n geometry: 'cone',\n transformMatrix: new Matrix4(Matrix4.IDENTITY)\n .translate([sphere.x - sphere.radius - sphereLineLength, sphere.y, sphere.z])\n .rotateZ(toRadians(90))\n .scale([ sphereConeRadius, sphereConeRadius * 3, sphereConeRadius ]),\n color: red\n },\n {\n '@id': 'http://purl.org/ccf/latest/ccf.owl#ProbingsphereXALabel',\n '@type': 'SpatialSceneNode',\n unpickable: true,\n geometry: 'text',\n text: 'A',\n transformMatrix: new Matrix4(Matrix4.IDENTITY)\n .translate([sphere.x - sphere.radius - sphereLineLength - sphereConeRadius * 3.5, sphere.y, sphere.z])\n .scale(sphereConeRadius),\n color: red\n },\n // Probing Sphere Positive Y Axis (W)\n {\n '@id': 'http://purl.org/ccf/latest/ccf.owl#ProbingsphereYW',\n '@type': 'SpatialSceneNode',\n unpickable: true,\n geometry: 'cylinder',\n transformMatrix: new Matrix4(Matrix4.IDENTITY)\n .translate([sphere.x, sphere.y + sphere.radius + sphereLineLength / 2, sphere.z])\n .scale([sphereLineRadius, sphereLineLength, sphereLineRadius]),\n color: green\n },\n {\n '@id': 'http://purl.org/ccf/latest/ccf.owl#ProbingsphereYWCone',\n '@type': 'SpatialSceneNode',\n unpickable: true,\n geometry: 'cone',\n transformMatrix: new Matrix4(Matrix4.IDENTITY)\n .translate([sphere.x, sphere.y + sphere.radius + sphereLineLength, sphere.z])\n .scale([ sphereConeRadius, sphereConeRadius * 3, sphereConeRadius ]),\n color: green\n },\n {\n '@id': 'http://purl.org/ccf/latest/ccf.owl#ProbingsphereYWLabel',\n '@type': 'SpatialSceneNode',\n unpickable: true,\n geometry: 'text',\n text: 'W',\n transformMatrix: new Matrix4(Matrix4.IDENTITY)\n .translate([sphere.x, sphere.y + sphere.radius + sphereLineLength + sphereConeRadius * 3, sphere.z])\n .scale(sphereConeRadius),\n color: green\n },\n // Probing Sphere Negative Y Axis (S)\n {\n '@id': 'http://purl.org/ccf/latest/ccf.owl#ProbingsphereYS',\n '@type': 'SpatialSceneNode',\n unpickable: true,\n geometry: 'cylinder',\n transformMatrix: new Matrix4(Matrix4.IDENTITY)\n .translate([sphere.x, sphere.y - sphere.radius - sphereLineLength / 2, sphere.z])\n .scale([sphereLineRadius, sphereLineLength, sphereLineRadius]),\n color: green\n },\n {\n '@id': 'http://purl.org/ccf/latest/ccf.owl#ProbingsphereYSCone',\n '@type': 'SpatialSceneNode',\n unpickable: true,\n geometry: 'cone',\n transformMatrix: new Matrix4(Matrix4.IDENTITY)\n .translate([sphere.x, sphere.y - sphere.radius - sphereLineLength, sphere.z])\n .rotateZ(toRadians(180))\n .scale([ sphereConeRadius, sphereConeRadius * 3, sphereConeRadius ]),\n color: green\n },\n {\n '@id': 'http://purl.org/ccf/latest/ccf.owl#ProbingsphereYSLabel',\n '@type': 'SpatialSceneNode',\n unpickable: true,\n geometry: 'text',\n text: 'S',\n transformMatrix: new Matrix4(Matrix4.IDENTITY)\n .translate([sphere.x, sphere.y - sphere.radius - sphereLineLength - sphereConeRadius * 3.5, sphere.z])\n .scale(sphereConeRadius),\n color: green\n },\n // Probing Sphere Positive Z Axis (E)\n {\n '@id': 'http://purl.org/ccf/latest/ccf.owl#ProbingsphereZE',\n '@type': 'SpatialSceneNode',\n unpickable: true,\n geometry: 'cylinder',\n transformMatrix: new Matrix4(Matrix4.IDENTITY)\n .translate([sphere.x, sphere.y, sphere.z + sphere.radius + sphereLineLength / 2])\n .rotateX(toRadians(90))\n .scale([sphereLineRadius, sphereLineLength, sphereLineRadius]),\n color: blue\n },\n {\n '@id': 'http://purl.org/ccf/latest/ccf.owl#ProbingsphereZECone',\n '@type': 'SpatialSceneNode',\n unpickable: true,\n geometry: 'cone',\n transformMatrix: new Matrix4(Matrix4.IDENTITY)\n .translate([sphere.x, sphere.y, sphere.z + sphere.radius + sphereLineLength])\n .rotateX(toRadians(90))\n .scale([ sphereConeRadius, sphereConeRadius * 3, sphereConeRadius ]),\n color: blue\n },\n {\n '@id': 'http://purl.org/ccf/latest/ccf.owl#ProbingsphereZELabel',\n '@type': 'SpatialSceneNode',\n unpickable: true,\n geometry: 'text',\n text: 'E',\n transformMatrix: new Matrix4(Matrix4.IDENTITY)\n .translate([sphere.x, sphere.y, sphere.z + sphere.radius + sphereLineLength + sphereConeRadius * 3])\n .scale(sphereConeRadius),\n color: blue\n },\n // Probing Sphere Negative Z Axis (Q)\n {\n '@id': 'http://purl.org/ccf/latest/ccf.owl#ProbingsphereZQ',\n '@type': 'SpatialSceneNode',\n unpickable: true,\n geometry: 'cylinder',\n transformMatrix: new Matrix4(Matrix4.IDENTITY)\n .translate([sphere.x, sphere.y, sphere.z - sphere.radius - sphereLineLength / 2])\n .rotateX(toRadians(-90))\n .scale([sphereLineRadius, sphereLineLength, sphereLineRadius]),\n color: blue\n },\n {\n '@id': 'http://purl.org/ccf/latest/ccf.owl#ProbingsphereZQCone',\n '@type': 'SpatialSceneNode',\n unpickable: true,\n geometry: 'cone',\n transformMatrix: new Matrix4(Matrix4.IDENTITY)\n .translate([sphere.x, sphere.y, sphere.z - sphere.radius - sphereLineLength])\n .rotateX(toRadians(-90))\n .scale([ sphereConeRadius, sphereConeRadius * 3, sphereConeRadius ]),\n color: blue\n },\n {\n '@id': 'http://purl.org/ccf/latest/ccf.owl#ProbingsphereZQLabel',\n '@type': 'SpatialSceneNode',\n unpickable: true,\n geometry: 'text',\n text: 'Q',\n transformMatrix: new Matrix4(Matrix4.IDENTITY)\n .translate([sphere.x, sphere.y, sphere.z - sphere.radius - sphereLineLength - sphereConeRadius * 3.5])\n .scale(sphereConeRadius),\n color: blue\n }\n ];\n}\n","import { Matrix4, toRadians } from '@math.gl/core';\nimport { SpatialSceneNode } from '../ccf-spatial-scene';\nimport { SpatialEntity } from '../spatial-types';\n\n\ntype Color = [number, number, number, number];\nconst gray: Color = [204, 204, 204, 255];\nconst red: Color = [213, 0, 0, 255];\nconst green: Color = [29, 204, 101, 255];\nconst blue: Color = [41, 121, 255, 255];\n\n/**\n * Create a set of scene nodes for the body-ui to show the origin and lines extending to it's dimensions.\n * @param node the Spatial Entity (usually a reference organ) that the origin is defined by\n * @param includeLetters whether to show the keyboard letters associated with the origin points\n * @returns a set of scene nodes for the body-ui\n */\nexport function getOriginScene(node: SpatialEntity, includeLetters = false): SpatialSceneNode[] {\n const sceneWidth = node.x_dimension / 1000;\n const sceneHeight = node.y_dimension / 1000;\n const sceneDepth = node.z_dimension / 1000;\n const originRadius = Math.max(sceneWidth, sceneHeight, sceneDepth) * 0.05;\n const lineRadius = originRadius * 0.1;\n\n return [\n // Origin Sphere\n {\n '@id': 'http://purl.org/ccf/latest/ccf.owl#OriginSphere',\n '@type': 'SpatialSceneNode',\n unpickable: true,\n geometry: 'sphere',\n transformMatrix: new Matrix4(Matrix4.IDENTITY).scale(originRadius),\n color: gray\n },\n // Origin X Axis\n {\n '@id': 'http://purl.org/ccf/latest/ccf.owl#OriginX',\n '@type': 'SpatialSceneNode',\n unpickable: true,\n geometry: 'cylinder',\n transformMatrix: new Matrix4(Matrix4.IDENTITY)\n .translate([sceneWidth / 2, 0, 0])\n .rotateZ(toRadians(-90))\n .scale([lineRadius, sceneWidth, lineRadius]),\n color: red\n },\n {\n '@id': 'http://purl.org/ccf/latest/ccf.owl#OriginXCone',\n '@type': 'SpatialSceneNode',\n unpickable: true,\n geometry: 'cone',\n transformMatrix: new Matrix4(Matrix4.IDENTITY)\n .translate([sceneWidth, 0, 0])\n .rotateZ(toRadians(-90))\n .scale([ originRadius, originRadius * 3, originRadius ]),\n color: red\n },\n {\n '@id': 'http://purl.org/ccf/latest/ccf.owl#OriginXALabel',\n '@type': 'SpatialSceneNode',\n unpickable: true,\n geometry: 'text',\n text: 'A',\n transformMatrix: new Matrix4(Matrix4.IDENTITY).translate([-originRadius * 2, 0, 0]).scale(originRadius),\n color: red\n },\n {\n '@id': 'http://purl.org/ccf/latest/ccf.owl#OriginXDLabel',\n '@type': 'SpatialSceneNode',\n unpickable: true,\n geometry: 'text',\n text: 'D',\n transformMatrix: new Matrix4(Matrix4.IDENTITY).translate([sceneWidth + originRadius * 2, 0, 0]).scale(originRadius),\n color: red\n },\n // Origin Y Axis\n {\n '@id': 'http://purl.org/ccf/latest/ccf.owl#OriginY',\n '@type': 'SpatialSceneNode',\n unpickable: true,\n geometry: 'cylinder',\n transformMatrix: new Matrix4(Matrix4.IDENTITY)\n .translate([0, sceneHeight / 2, 0])\n .scale([lineRadius, sceneHeight, lineRadius]),\n color: green\n },\n {\n '@id': 'http://purl.org/ccf/latest/ccf.owl#OriginYCone',\n '@type': 'SpatialSceneNode',\n unpickable: true,\n geometry: 'cone',\n transformMatrix: new Matrix4(Matrix4.IDENTITY)\n .translate([0, sceneHeight, 0])\n .scale([ originRadius, originRadius * 3, originRadius ]),\n color: green\n },\n {\n '@id': 'http://purl.org/ccf/latest/ccf.owl#OriginYSLabel',\n '@type': 'SpatialSceneNode',\n unpickable: true,\n geometry: 'text',\n text: 'S',\n transformMatrix: new Matrix4(Matrix4.IDENTITY).translate([originRadius * 1.5, originRadius * 1.5, 0]).scale(originRadius),\n color: green\n },\n {\n '@id': 'http://purl.org/ccf/latest/ccf.owl#OriginYWLabel',\n '@type': 'SpatialSceneNode',\n unpickable: true,\n geometry: 'text',\n text: 'W',\n transformMatrix: new Matrix4(Matrix4.IDENTITY).translate([0, sceneHeight + originRadius * 2, 0]).scale(originRadius),\n color: green\n },\n // Origin Z Axis\n {\n '@id': 'http://purl.org/ccf/latest/ccf.owl#OriginZ',\n '@type': 'SpatialSceneNode',\n unpickable: true,\n geometry: 'cylinder',\n transformMatrix: new Matrix4(Matrix4.IDENTITY)\n .translate([0, 0, sceneDepth / 2])\n .rotateX(toRadians(90))\n .scale([lineRadius, sceneDepth, lineRadius]),\n color: blue\n },\n {\n '@id': 'http://purl.org/ccf/latest/ccf.owl#OriginZCone',\n '@type': 'SpatialSceneNode',\n unpickable: true,\n geometry: 'cone',\n transformMatrix: new Matrix4(Matrix4.IDENTITY)\n .translate([0, 0, sceneDepth])\n .rotateX(toRadians(90))\n .scale([ originRadius, originRadius * 3, originRadius ]),\n color: blue\n },\n {\n '@id': 'http://purl.org/ccf/latest/ccf.owl#OriginZQLabel',\n '@type': 'SpatialSceneNode',\n unpickable: true,\n geometry: 'text',\n text: 'Q',\n transformMatrix: new Matrix4(Matrix4.IDENTITY).translate([originRadius * 1.5, - originRadius * 1.5, 0]).scale(originRadius),\n color: blue\n },\n {\n '@id': 'http://purl.org/ccf/latest/ccf.owl#OriginZELabel',\n '@type': 'SpatialSceneNode',\n unpickable: true,\n geometry: 'text',\n text: 'E',\n transformMatrix: new Matrix4(Matrix4.IDENTITY).translate([0, 0, sceneDepth + originRadius * 2]).scale(originRadius),\n color: blue\n }\n ].filter(n => (includeLetters && n.geometry === 'text' && n.text) || !n.text) as SpatialSceneNode[];\n}\n","/*\n * Public API Surface of ccf\n */\nexport * from './lib/ccf-database';\nexport * from './lib/ccf-spatial-scene';\nexport * from './lib/interfaces';\nexport * from './lib/spatial-types';\nexport * from './lib/hubmap/hubmap-data-import';\nexport * from './lib/util/ccf-database-status-tracker';\nexport * from './lib/util/probing-sphere-scene';\nexport * from './lib/util/origin-scene';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["readQuads","fromRdf","Util","DataFactory","sortBy","toRadians","DirectedGraph","Matrix4","shortestPath","get","Euler","toDegrees","uuidV4","toNumber","set","omit","addJsonLdToStore","_a","OrientedBoundingBox","isFinite","memoize","Store","delMany","setMany","deserializeN3Store","addN3ToStore","addRdfXmlToStore","serializeN3Store","red","green","blue"],"mappings":";;;;;;;;;;IAAA;;;;;;;;;;;;;;IAcA;IAEA,IAAI,aAAa,GAAG,UAAS,CAAC,EAAE,CAAC;QAC7B,aAAa,GAAG,MAAM,CAAC,cAAc;aAChC,EAAE,SAAS,EAAE,EAAE,EAAE,YAAY,KAAK,IAAI,UAAU,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,SAAS,GAAG,CAAC,CAAC,EAAE,CAAC;YAC5E,UAAU,CAAC,EAAE,CAAC,IAAI,KAAK,IAAI,CAAC,IAAI,CAAC;gBAAE,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC;oBAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QACtG,OAAO,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAC/B,CAAC,CAAC;aAEc,SAAS,CAAC,CAAC,EAAE,CAAC;QAC1B,IAAI,OAAO,CAAC,KAAK,UAAU,IAAI,CAAC,KAAK,IAAI;YACrC,MAAM,IAAI,SAAS,CAAC,sBAAsB,GAAG,MAAM,CAAC,CAAC,CAAC,GAAG,+BAA+B,CAAC,CAAC;QAC9F,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QACpB,SAAS,EAAE,KAAK,IAAI,CAAC,WAAW,GAAG,CAAC,CAAC,EAAE;QACvC,CAAC,CAAC,SAAS,GAAG,CAAC,KAAK,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,SAAS,GAAG,CAAC,CAAC,SAAS,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;IACzF,CAAC;IAEM,IAAI,QAAQ,GAAG;QAClB,QAAQ,GAAG,MAAM,CAAC,MAAM,IAAI,SAAS,QAAQ,CAAC,CAAC;YAC3C,KAAK,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;gBACjD,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC;gBACjB,KAAK,IAAI,CAAC,IAAI,CAAC;oBAAE,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC;wBAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;aAChF;YACD,OAAO,CAAC,CAAC;SACZ,CAAA;QACD,OAAO,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;IAC3C,CAAC,CAAA;aAEe,MAAM,CAAC,CAAC,EAAE,CAAC;QACvB,IAAI,CAAC,GAAG,EAAE,CAAC;QACX,KAAK,IAAI,CAAC,IAAI,CAAC;YAAE,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC;gBAC/E,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QAChB,IAAI,CAAC,IAAI,IAAI,IAAI,OAAO,MAAM,CAAC,qBAAqB,KAAK,UAAU;YAC/D,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,qBAAqB,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;gBACpE,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,MAAM,CAAC,SAAS,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;oBAC1E,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;aACzB;QACL,OAAO,CAAC,CAAC;IACb,CAAC;aAEe,UAAU,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI;QACpD,IAAI,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,MAAM,GAAG,IAAI,KAAK,IAAI,GAAG,IAAI,GAAG,MAAM,CAAC,wBAAwB,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,EAAE,CAAC,CAAC;QAC7H,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,OAAO,CAAC,QAAQ,KAAK,UAAU;YAAE,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC;;YAC1H,KAAK,IAAI,CAAC,GAAG,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE;gBAAE,IAAI,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC;oBAAE,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC;QAClJ,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;IAClE,CAAC;aAEe,OAAO,CAAC,UAAU,EAAE,SAAS;QACzC,OAAO,UAAU,MAAM,EAAE,GAAG,IAAI,SAAS,CAAC,MAAM,EAAE,GAAG,EAAE,UAAU,CAAC,CAAC,EAAE,CAAA;IACzE,CAAC;aAEe,UAAU,CAAC,WAAW,EAAE,aAAa;QACjD,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,OAAO,CAAC,QAAQ,KAAK,UAAU;YAAE,OAAO,OAAO,CAAC,QAAQ,CAAC,WAAW,EAAE,aAAa,CAAC,CAAC;IACnI,CAAC;aAEe,SAAS,CAAC,OAAO,EAAE,UAAU,EAAE,CAAC,EAAE,SAAS;QACvD,SAAS,KAAK,CAAC,KAAK,IAAI,OAAO,KAAK,YAAY,CAAC,GAAG,KAAK,GAAG,IAAI,CAAC,CAAC,UAAU,OAAO,IAAI,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE;QAC5G,OAAO,KAAK,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC,EAAE,UAAU,OAAO,EAAE,MAAM;YACrD,SAAS,SAAS,CAAC,KAAK,IAAI,IAAI;gBAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;aAAE;YAAC,OAAO,CAAC,EAAE;gBAAE,MAAM,CAAC,CAAC,CAAC,CAAC;aAAE,EAAE;YAC3F,SAAS,QAAQ,CAAC,KAAK,IAAI,IAAI;gBAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;aAAE;YAAC,OAAO,CAAC,EAAE;gBAAE,MAAM,CAAC,CAAC,CAAC,CAAC;aAAE,EAAE;YAC9F,SAAS,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC,EAAE;YAC9G,IAAI,CAAC,CAAC,SAAS,GAAG,SAAS,CAAC,KAAK,CAAC,OAAO,EAAE,UAAU,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC;SACzE,CAAC,CAAC;IACP,CAAC;aAEe,WAAW,CAAC,OAAO,EAAE,IAAI;QACrC,IAAI,CAAC,GAAG,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,cAAa,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;gBAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;QACjH,OAAO,CAAC,GAAG,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,OAAO,MAAM,KAAK,UAAU,KAAK,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,cAAa,OAAO,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;QACzJ,SAAS,IAAI,CAAC,CAAC,IAAI,OAAO,UAAU,CAAC,IAAI,OAAO,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE;QAClE,SAAS,IAAI,CAAC,EAAE;YACZ,IAAI,CAAC;gBAAE,MAAM,IAAI,SAAS,CAAC,iCAAiC,CAAC,CAAC;YAC9D,OAAO,CAAC;gBAAE,IAAI;oBACV,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI;wBAAE,OAAO,CAAC,CAAC;oBAC7J,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;wBAAE,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC;oBACxC,QAAQ,EAAE,CAAC,CAAC,CAAC;wBACT,KAAK,CAAC,CAAC;wBAAC,KAAK,CAAC;4BAAE,CAAC,GAAG,EAAE,CAAC;4BAAC,MAAM;wBAC9B,KAAK,CAAC;4BAAE,CAAC,CAAC,KAAK,EAAE,CAAC;4BAAC,OAAO,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;wBACxD,KAAK,CAAC;4BAAE,CAAC,CAAC,KAAK,EAAE,CAAC;4BAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;4BAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC;4BAAC,SAAS;wBACjD,KAAK,CAAC;4BAAE,EAAE,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC;4BAAC,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;4BAAC,SAAS;wBACjD;4BACI,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE;gCAAE,CAAC,GAAG,CAAC,CAAC;gCAAC,SAAS;6BAAE;4BAC5G,IAAI,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE;gCAAE,CAAC,CAAC,KAAK,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;gCAAC,MAAM;6BAAE;4BACtF,IAAI,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE;gCAAE,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;gCAAC,CAAC,GAAG,EAAE,CAAC;gCAAC,MAAM;6BAAE;4BACrE,IAAI,CAAC,IAAI,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE;gCAAE,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;gCAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;gCAAC,MAAM;6BAAE;4BACnE,IAAI,CAAC,CAAC,CAAC,CAAC;gCAAE,CAAC,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC;4BACtB,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;4BAAC,SAAS;qBAC9B;oBACD,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;iBAC9B;gBAAC,OAAO,CAAC,EAAE;oBAAE,EAAE,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;oBAAC,CAAC,GAAG,CAAC,CAAC;iBAAE;wBAAS;oBAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;iBAAE;YAC1D,IAAI,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC;gBAAE,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC;YAAC,OAAO,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;SACpF;IACL,CAAC;IAEM,IAAI,eAAe,GAAG,MAAM,CAAC,MAAM,IAAI,UAAS,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE;QAC9D,IAAI,EAAE,KAAK,SAAS;YAAE,EAAE,GAAG,CAAC,CAAC;QAC7B,MAAM,CAAC,cAAc,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,cAAa,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IACzF,CAAC,KAAK,UAAS,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE;QACtB,IAAI,EAAE,KAAK,SAAS;YAAE,EAAE,GAAG,CAAC,CAAC;QAC7B,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IACjB,CAAC,CAAC,CAAC;aAEa,YAAY,CAAC,CAAC,EAAE,CAAC;QAC7B,KAAK,IAAI,CAAC,IAAI,CAAC;YAAE,IAAI,CAAC,KAAK,SAAS,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC;gBAAE,eAAe,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IAClH,CAAC;aAEe,QAAQ,CAAC,CAAC;QACtB,IAAI,CAAC,GAAG,OAAO,MAAM,KAAK,UAAU,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;QAC9E,IAAI,CAAC;YAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACxB,IAAI,CAAC,IAAI,OAAO,CAAC,CAAC,MAAM,KAAK,QAAQ;YAAE,OAAO;gBAC1C,IAAI,EAAE;oBACF,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,MAAM;wBAAE,CAAC,GAAG,KAAK,CAAC,CAAC;oBACnC,OAAO,EAAE,KAAK,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC;iBAC3C;aACJ,CAAC;QACF,MAAM,IAAI,SAAS,CAAC,CAAC,GAAG,yBAAyB,GAAG,iCAAiC,CAAC,CAAC;IAC3F,CAAC;aAEe,MAAM,CAAC,CAAC,EAAE,CAAC;QACvB,IAAI,CAAC,GAAG,OAAO,MAAM,KAAK,UAAU,IAAI,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QAC3D,IAAI,CAAC,CAAC;YAAE,OAAO,CAAC,CAAC;QACjB,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC;QACjC,IAAI;YACA,OAAO,CAAC,CAAC,KAAK,KAAK,CAAC,IAAI,CAAC,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,IAAI;gBAAE,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;SAC9E;QACD,OAAO,KAAK,EAAE;YAAE,CAAC,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;SAAE;gBAC/B;YACJ,IAAI;gBACA,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,CAAC;oBAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;aACpD;oBACO;gBAAE,IAAI,CAAC;oBAAE,MAAM,CAAC,CAAC,KAAK,CAAC;aAAE;SACpC;QACD,OAAO,EAAE,CAAC;IACd,CAAC;IAED;aACgB,QAAQ;QACpB,KAAK,IAAI,EAAE,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE;YAC9C,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACzC,OAAO,EAAE,CAAC;IACd,CAAC;IAED;aACgB,cAAc;QAC1B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,EAAE,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE;YAAE,CAAC,IAAI,SAAS,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;QACpF,KAAK,IAAI,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE;YAC5C,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,EAAE;gBAC7D,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QACpB,OAAO,CAAC,CAAC;IACb,CAAC;aAEe,aAAa,CAAC,EAAE,EAAE,IAAI,EAAE,IAAI;QACxC,IAAI,IAAI,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC;YAAE,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,EAAE,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;gBACjF,IAAI,EAAE,IAAI,EAAE,CAAC,IAAI,IAAI,CAAC,EAAE;oBACpB,IAAI,CAAC,EAAE;wBAAE,EAAE,GAAG,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;oBACrD,EAAE,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;iBACnB;aACJ;QACD,OAAO,EAAE,CAAC,MAAM,CAAC,EAAE,IAAI,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAC7D,CAAC;aAEe,OAAO,CAAC,CAAC;QACrB,OAAO,IAAI,YAAY,OAAO,IAAI,IAAI,CAAC,CAAC,GAAG,CAAC,EAAE,IAAI,IAAI,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC;IACzE,CAAC;aAEe,gBAAgB,CAAC,OAAO,EAAE,UAAU,EAAE,SAAS;QAC3D,IAAI,CAAC,MAAM,CAAC,aAAa;YAAE,MAAM,IAAI,SAAS,CAAC,sCAAsC,CAAC,CAAC;QACvF,IAAI,CAAC,GAAG,SAAS,CAAC,KAAK,CAAC,OAAO,EAAE,UAAU,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC;QAC9D,OAAO,CAAC,GAAG,EAAE,EAAE,IAAI,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,GAAG,cAAc,OAAO,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC;QACtH,SAAS,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC;YAAE,CAAC,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,IAAI,OAAO,IAAI,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE;QAC1I,SAAS,MAAM,CAAC,CAAC,EAAE,CAAC,IAAI,IAAI;YAAE,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;SAAE;QAAC,OAAO,CAAC,EAAE;YAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;SAAE,EAAE;QAClF,SAAS,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,YAAY,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE;QACxH,SAAS,OAAO,CAAC,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,EAAE;QAClD,SAAS,MAAM,CAAC,KAAK,IAAI,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,EAAE;QAClD,SAAS,MAAM,CAAC,CAAC,EAAE,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,MAAM;YAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE;IACtF,CAAC;aAEe,gBAAgB,CAAC,CAAC;QAC9B,IAAI,CAAC,EAAE,CAAC,CAAC;QACT,OAAO,CAAC,GAAG,EAAE,EAAE,IAAI,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,OAAO,EAAE,UAAU,CAAC,IAAI,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,cAAc,OAAO,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC;QAC5I,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,IAAI,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,KAAK,QAAQ,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE;IACnJ,CAAC;aAEe,aAAa,CAAC,CAAC;QAC3B,IAAI,CAAC,MAAM,CAAC,aAAa;YAAE,MAAM,IAAI,SAAS,CAAC,sCAAsC,CAAC,CAAC;QACvF,IAAI,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC;QACnC,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,OAAO,QAAQ,KAAK,UAAU,GAAG,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC,GAAG,EAAE,EAAE,IAAI,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,GAAG,cAAc,OAAO,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;QACjN,SAAS,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,UAAU,CAAC,IAAI,OAAO,IAAI,OAAO,CAAC,UAAU,OAAO,EAAE,MAAM,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE;QAChK,SAAS,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,UAAS,CAAC,IAAI,OAAO,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC,EAAE;IAChI,CAAC;aAEe,oBAAoB,CAAC,MAAM,EAAE,GAAG;QAC5C,IAAI,MAAM,CAAC,cAAc,EAAE;YAAE,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC;SAAE;aAAM;YAAE,MAAM,CAAC,GAAG,GAAG,GAAG,CAAC;SAAE;QAC/G,OAAO,MAAM,CAAC;IAClB,CAAC;IAAA,CAAC;IAEF,IAAI,kBAAkB,GAAG,MAAM,CAAC,MAAM,IAAI,UAAS,CAAC,EAAE,CAAC;QACnD,MAAM,CAAC,cAAc,CAAC,CAAC,EAAE,SAAS,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC;IACxE,CAAC,IAAI,UAAS,CAAC,EAAE,CAAC;QACd,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;IACrB,CAAC,CAAC;aAEc,YAAY,CAAC,GAAG;QAC5B,IAAI,GAAG,IAAI,GAAG,CAAC,UAAU;YAAE,OAAO,GAAG,CAAC;QACtC,IAAI,MAAM,GAAG,EAAE,CAAC;QAChB,IAAI,GAAG,IAAI,IAAI;YAAE,KAAK,IAAI,CAAC,IAAI,GAAG;gBAAE,IAAI,CAAC,KAAK,SAAS,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;oBAAE,eAAe,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC;QACzI,kBAAkB,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QAChC,OAAO,MAAM,CAAC;IAClB,CAAC;aAEe,eAAe,CAAC,GAAG;QAC/B,OAAO,CAAC,GAAG,IAAI,GAAG,CAAC,UAAU,IAAI,GAAG,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC;IAC5D,CAAC;aAEe,sBAAsB,CAAC,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;QAC3D,IAAI,IAAI,KAAK,GAAG,IAAI,CAAC,CAAC;YAAE,MAAM,IAAI,SAAS,CAAC,+CAA+C,CAAC,CAAC;QAC7F,IAAI,OAAO,KAAK,KAAK,UAAU,GAAG,QAAQ,KAAK,KAAK,IAAI,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC;YAAE,MAAM,IAAI,SAAS,CAAC,0EAA0E,CAAC,CAAC;QACnL,OAAO,IAAI,KAAK,GAAG,GAAG,CAAC,GAAG,IAAI,KAAK,GAAG,GAAG,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IAClG,CAAC;aAEe,sBAAsB,CAAC,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;QAClE,IAAI,IAAI,KAAK,GAAG;YAAE,MAAM,IAAI,SAAS,CAAC,gCAAgC,CAAC,CAAC;QACxE,IAAI,IAAI,KAAK,GAAG,IAAI,CAAC,CAAC;YAAE,MAAM,IAAI,SAAS,CAAC,+CAA+C,CAAC,CAAC;QAC7F,IAAI,OAAO,KAAK,KAAK,UAAU,GAAG,QAAQ,KAAK,KAAK,IAAI,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC;YAAE,MAAM,IAAI,SAAS,CAAC,yEAAyE,CAAC,CAAC;QAClL,OAAO,CAAC,IAAI,KAAK,GAAG,GAAG,CAAC,CAAC,IAAI,CAAC,QAAQ,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,KAAK,GAAG,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,QAAQ,EAAE,KAAK,CAAC,GAAG,KAAK,CAAC;IAC9G;;IC1OA;;;;;;;;aAQiB,UAAU,CAAC,KAAY,EAAE,GAAW,EAAE,OAAkC;;;;;;;oBACxD,KAAA,SAAA,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAA;;;;oBAA3C,KAAA,mBAAgB,EAAf,SAAS,QAAA,EAAE,GAAG,QAAA;;;;oBACL,oBAAA,SAAAA,0BAAS,CAAC,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA,CAAA;;;;oBAApD,IAAI;oBACP,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,QAAQ,KAAK,SAAS,GAAGC,kBAAO,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;oBACzF,qBAAM,CAAC,GAAG,EAAE,KAAK,CAAC,EAAA;;oBAAlB,SAAkB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAGxB;IAED;;;;;;;;;aASgB,eAAe,CAAc,KAAY,EAAE,GAAW,EAAE,IAAY,EAAE,OAAkC;;QACtH,IAAM,MAAM,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;YAC7C,KAA+B,IAAA,KAAA,SAAA,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAA,gBAAA,4BAAE;gBAA7C,IAAA,KAAA,mBAAgB,EAAf,SAAS,QAAA,EAAE,GAAG,QAAA;;oBACxB,KAAmB,IAAA,oBAAA,SAAAD,0BAAS,CAAC,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA,CAAA,gBAAA,4BAAE;wBAAtE,IAAM,IAAI,WAAA;wBACb,IAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,QAAQ,KAAK,SAAS,GAAGC,kBAAO,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;wBACzF,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;qBACrB;;;;;;;;;aACF;;;;;;;;;QACD,OAAO,MAAsB,CAAC;IAChC;;ICvCA;IAGA;IACO,IAAM,QAAQ,GAAG;QACtB,IAAI,EAAE,qCAAqC;QAC3C,GAAG,EAAE,sBAAsB;QAC3B,GAAG,EAAE,iCAAiC;QACtC,GAAG,EAAE,iCAAiC;QACtC,MAAM,EAAE,wCAAwC;QAChD,EAAE,EAAE,oCAAoC;QACxC,IAAI,EAAE,sCAAsC;QAC5C,GAAG,EAAE,6CAA6C;QAClD,IAAI,EAAE,uCAAuC;QAC7C,EAAE,EAAE,kCAAkC;QACtC,OAAO,EAAE,2BAA2B;KACrC,CAAC;IAEF;IACO,IAAM,QAAQ,GAAGC,qBAAI,CAAC,QAAQ,CAAC,QAAQ,EAAEC,4BAAW,CAAC,CAAC;IAEtD,IAAM,GAAG,GAAG;QACjB,CAAC,EAAE,QAAQ,CAAC,KAAK,CAAC;QAClB,IAAI,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC;KAC9B,CAAC;IAEK,IAAM,IAAI,GAAG;QAClB,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC;QACnB,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC;QAChC,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC;QACpC,WAAW,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,aAAa,CAAC;QAC5C,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC;KACrC,CAAC;IAEF;IACA,IAAM,IAAI,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAE7B;IACO,IAAM,MAAM,GAAG;QACpB,EAAE,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC,2BAA2B,CAAC;QAChD,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC;QAChC,WAAW,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC;QACxC,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC;QAEjB,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC;QAChB,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC;QAChB,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC;QAEhB,IAAI,EAAEA,4BAAW,CAAC,OAAO,CAAC,MAAM,CAAC;QACjC,MAAM,EAAEA,4BAAW,CAAC,OAAO,CAAC,QAAQ,CAAC;QAErC,cAAc,EAAE,IAAI,CAAC,iBAAiB,CAAC;QACvC,YAAY,EAAE,IAAI,CAAC,sBAAsB,CAAC;QAC1C,YAAY,EAAE,IAAI,CAAC,sBAAsB,CAAC;QAE1C,KAAK,EAAE,IAAI,CAAC,YAAY,CAAC;QAEzB,QAAQ,EAAE,IAAI,CAAC,0BAA0B,CAAC;QAC1C,QAAQ,EAAE,IAAI,CAAC,mBAAmB,CAAC;QAEnC,UAAU,EAAE,IAAI,CAAC,aAAa,CAAC;QAE/B,WAAW,EAAEA,4BAAW,CAAC,OAAO,CAAC,cAAc,CAAC;QAChD,aAAa,EAAEA,4BAAW,CAAC,OAAO,CAAC,gBAAgB,CAAC;QACpD,WAAW,EAAEA,4BAAW,CAAC,OAAO,CAAC,cAAc,CAAC;QAEhD,YAAY,EAAE,IAAI,CAAC,eAAe,CAAC;QACnC,WAAW,EAAE,IAAI,CAAC,cAAc,CAAC;QACjC,YAAY,EAAE,IAAI,CAAC,mBAAmB,CAAC;QACvC,aAAa,EAAE,IAAI,CAAC,gBAAgB,CAAC;QAErC,aAAa,EAAE,IAAI,CAAC,2BAA2B,CAAC;QAChD,aAAa,EAAE,IAAI,CAAC,mBAAmB,CAAC;QACxC,aAAa,EAAE,IAAI,CAAC,oBAAoB,CAAC;QAEzC,UAAU,EAAE,IAAI,CAAC,YAAY,CAAC;QAC9B,SAAS,EAAE,IAAI,CAAC,WAAW,CAAC;KAC7B,CAAC;IAEF;IACO,IAAM,GAAG,GAAG;QACjB,CAAC,EAAE,IAAI;QACP,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC;QACtB,YAAY,EAAE;YACZ,KAAK,EAAE,IAAI,CAAC,gBAAgB,CAAC;YAC7B,MAAM,EAAE,IAAI,CAAC,aAAa,CAAC;YAC3B,QAAQ,EAAE,IAAI,CAAC,aAAa,CAAC;YAC7B,QAAQ,EAAE,IAAI,CAAC,UAAU,CAAC;YAC1B,aAAa,EAAEA,4BAAW,CAAC,SAAS,CAAC,8DAA8D,CAAC;SACrG;QACD,KAAK,EAAE;YACL,OAAO,EAAE,IAAI,CAAC,aAAa,CAAC;YAC5B,OAAO,EAAE,IAAI,CAAC,YAAY,CAAC;YAC3B,UAAU,EAAE,IAAI,CAAC,gBAAgB,CAAC;YAClC,aAAa,EAAE,IAAI,CAAC,mBAAmB,CAAC;SACzC;QACD,OAAO,EAAE;YACP,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,UAAU,CAAC;YACpC,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC;YAChC,SAAS,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,aAAa,CAAC;YAC1C,YAAY,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,gBAAgB,CAAC;YAChD,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,cAAc,CAAC;SAC7C;QACD,sBAAsB,EAAE,IAAI,CAAC,0BAA0B,CAAC;QACxD,aAAa,EAAE,IAAI,CAAC,gBAAgB,CAAC;QACrC,gBAAgB,EAAE,IAAI,CAAC,mBAAmB,CAAC;QAC3C,sBAAsB,EAAE;YACtB,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC;YACtB,WAAW,EAAE,IAAI,CAAC,aAAa,CAAC;YAChC,YAAY,EAAE,IAAI,CAAC,cAAc,CAAC;SACnC;QACD,aAAa,EAAE;YACb,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC;YAChC,QAAQ,EAAE,IAAI,CAAC,UAAU,CAAC;SAC3B;QACD,aAAa,EAAE;YACb,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC;YAChC,WAAW,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC;YACxC,OAAO,EAAE,QAAQ,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC;YACvC,kBAAkB,EAAE,IAAI,CAAC,oBAAoB,CAAC;YAC9C,iBAAiB,EAAE,IAAI,CAAC,mBAAmB,CAAC;YAC5C,aAAa,EAAE,IAAI,CAAC,eAAe,CAAC;YACpC,aAAa,EAAE,QAAQ,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC;YAC7C,YAAY,EAAE,IAAI,CAAC,cAAc,CAAC;YAClC,eAAe,EAAE,IAAI,CAAC,eAAe,CAAC;YACtC,iBAAiB,EAAE,IAAI,CAAC,mBAAmB,CAAC;YAC5C,eAAe,EAAE,IAAI,CAAC,qBAAqB,CAAC;YAC5C,kBAAkB,EAAE,IAAI,CAAC,oBAAoB,CAAC;YAC9C,cAAc,EAAE,IAAI,CAAC,oBAAoB,CAAC;YAC1C,GAAG,EAAE,IAAI,CAAC,iBAAiB,CAAC;YAC5B,IAAI,EAAE,IAAI,CAAC,YAAY,CAAC;YACxB,QAAQ,EAAE,IAAI,CAAC,UAAU,CAAC;YAC1B,eAAe,EAAE,IAAI,CAAC,iBAAiB,CAAC;YACxC,WAAW,EAAE,IAAI,CAAC,aAAa,CAAC;YAChC,WAAW,EAAE,IAAI,CAAC,aAAa,CAAC;YAChC,WAAW,EAAE,IAAI,CAAC,aAAa,CAAC;YAChC,WAAW,EAAE,IAAI,CAAC,aAAa,CAAC;YAChC,eAAe,EAAE,IAAI,CAAC,gBAAgB,CAAC;YACvC,MAAM,EAAE,IAAI,CAAC,sBAAsB,CAAC;SACrC;QACD,gBAAgB,EAAE;YAChB,MAAM,EAAE,IAAI,CAAC,eAAe,CAAC;YAC7B,MAAM,EAAE,IAAI,CAAC,uBAAuB,CAAC;YAErC,cAAc,EAAE,QAAQ,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC;YAC9C,SAAS,EAAE,IAAI,CAAC,WAAW,CAAC;YAC5B,SAAS,EAAE,IAAI,CAAC,WAAW,CAAC;YAC5B,SAAS,EAAE,IAAI,CAAC,WAAW,CAAC;YAC5B,aAAa,EAAE,IAAI,CAAC,cAAc,CAAC;YAEnC,UAAU,EAAE,IAAI,CAAC,YAAY,CAAC;YAC9B,UAAU,EAAE,IAAI,CAAC,YAAY,CAAC;YAC9B,UAAU,EAAE,IAAI,CAAC,YAAY,CAAC;YAC9B,UAAU,EAAE,IAAI,CAAC,gBAAgB,CAAC;YAClC,cAAc,EAAE,IAAI,CAAC,gBAAgB,CAAC;YACtC,cAAc,EAAE,IAAI,CAAC,eAAe,CAAC;YAErC,aAAa,EAAE,IAAI,CAAC,eAAe,CAAC;YACpC,aAAa,EAAE,IAAI,CAAC,eAAe,CAAC;YACpC,aAAa,EAAE,IAAI,CAAC,eAAe,CAAC;YACpC,iBAAiB,EAAE,IAAI,CAAC,kBAAkB,CAAC;SAC5C;KACF,CAAC;IAEF;IACO,IAAM,MAAM,GAAG;QACpB,CAAC,EAAE,QAAQ,CAAC,QAAQ,CAAC;QACrB,IAAI,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC,SAAS,CAAC;KACpC,CAAC;IAEF;IACO,IAAM,EAAE,GAAG;QAChB,CAAC,EAAE,QAAQ,CAAC,IAAI,CAAC;QACjB,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC,SAAS,CAAC;KAChC,CAAC;IAEF;IACO,IAAM,GAAG,GAAG;QACjB,CAAC,EAAE,QAAQ,CAAC,KAAK,CAAC;KACnB,CAAC;IAEF;IACO,IAAM,IAAI,GAAG;QAClB,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC;KACpB,CAAC;IAEF;IACO,IAAM,GAAG,GAAG;QACjB,IAAI,EAAE,MAAM,CAAC,IAAI;QACjB,IAAI,EAAE,EAAE,CAAC,IAAI;QACb,kBAAkB,EAAE,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;QACvC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;QAC1B,SAAS,EAAE,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;QAC9B,UAAU,EAAE,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;QAC/B,aAAa,EAAE,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;QAClC,cAAc,EAAE,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;QACnC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;QAC3B,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;QAC3B,GAAG,EAAE,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;QACxB,cAAc,EAAE,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;QACnC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;QACzB,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;QAC1B,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;QAC5B,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;QAC1B,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;QAC1B,WAAW,EAAE,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;QAChC,wBAAwB,EAAE,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;QAC7C,UAAU,EAAE,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;;QAG/B,iBAAiB,EAAE,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;QACtC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;QAC1B,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;QAC7B,SAAS,EAAE,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC;QACzB,mBAAmB,EAAE,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;QACxC,oBAAoB,EAAE,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;QACzC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;QAC1B,WAAW,EAAE,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;QAChC,YAAY,EAAE,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;QACjC,SAAS,EAAE,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC;QACzB,UAAU,EAAE,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC;QAC1B,eAAe,EAAE,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;QACpC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;QAC1B,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;QAC1B,qBAAqB,EAAE,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;QAC1C,UAAU,EAAE,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC;QACzB,WAAW,EAAE,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC;QAC1B,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;QAC7B,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;QAC3B,cAAc,EAAE,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;QACnC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;QACzB,eAAe,EAAE,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;QACpC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;QAC3B,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;QAC3B,WAAW,EAAE,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;QAChC,YAAY,EAAE,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;QACjC,eAAe,EAAE,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;QACpC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;KAC5B;;ICtOD;;;;;;IAMA,SAAS,cAAc,CAAC,OAA0C;QAChE,IAAM,UAAU,GAA8B,EAAE,CAAC;QACjD,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,UAAC,EAAiB;gBAAjB,KAAA,aAAiB,EAAhB,IAAI,QAAA,EAAE,SAAS,QAAA;YAC/C,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC;SACjC,CAAC,CAAC;QACH,OAAO,UAAU,CAAC;IACpB,CAAC;IAED;IACA,IAAM,QAAQ,GAAG;QACf,sBAAsB,EAAE,cAAc,CAAC,GAAG,CAAC,sBAAsB,CAAC;QAClE,aAAa,EAAE,cAAc,CAAC,GAAG,CAAC,aAAa,CAAC;QAChD,gBAAgB,EAAE,cAAc,CAAC,GAAG,CAAC,gBAAgB,CAAC;KACvD,CAAC;IAEF;;;;;;;aAOgB,yBAAyB,CAAC,KAAY,EAAE,GAAW;QACjE,OAAO,eAAe,CAAyB,KAAK,EAAE,GAAG,EAAE,wBAAwB,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC;IACxH,CAAC;IAED;;;;;;;aAOgB,gBAAgB,CAAC,KAAY,EAAE,GAAW;QACxD,IAAM,MAAM,GAAG,eAAe,CAAgB,KAAK,EAAE,GAAG,EAAE,eAAe,EAAE,QAAQ,CAAC,aAAa,CAAC,CAAC;QACnG,MAAM,CAAC,eAAe,GAAGC,aAAM,CAC7B,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC,aAAa,CAAC,cAAc,EAAE,GAAG,EAAE,IAAI,CAAC;aAC3D,GAAG,CAAC,UAAC,KAAK,IAAK,OAAA,gBAAgB,CAAC,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,GAAA,CAAC,EACpD,CAAC,UAAU,CAAC,CAAC,CAAC;QAChB,OAAO,MAAM,CAAC;IAChB,CAAC;IAED;;;;;;;aAOgB,iBAAiB,CAAC,KAAY,EAAE,GAAW;QACzD,OAAOA,aAAM,CACX,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC,aAAa,CAAC,kBAAkB,EAAE,GAAG,EAAE,IAAI,CAAC;aAC/D,GAAG,CAAC,UAAC,KAAK,IAAK,OAAA,gBAAgB,CAAC,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,GAAA,CAAC,EACpD,CAAC,UAAU,CAAC,CACb,CAAC;IACJ,CAAC;IAGD;;;;;;;aAOgB,uBAAuB,CAAC,KAAY,EAAE,GAAW;QAC/D,OAAOA,aAAM,CACX,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC,aAAa,CAAC,eAAe,EAAE,GAAG,EAAE,IAAI,CAAC;aAC5D,GAAG,CAAC,UAAC,KAAK,IAAK,OAAA,gBAAgB,CAAC,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,GAAA,CAAC;aACjD,MAAM,CAAC,UAAC,CAAC,IAAK,OAAA,CAAC,CAAC,KAAK,CAAC,KAAK,GAAG,GAAA,CAAC,EAClC,CAAC,UAAU,CAAC,CACb,CAAC;IACJ,CAAC;IAED;;;;;;aAMgB,kBAAkB,CAAC,KAAY;QAC7C,IAAM,OAAO,GAAoB,EAAE,CAAC;QACpC,KAAK,CAAC,OAAO,CAAC,UAAC,IAAI;YACjB,IAAI,IAAI,CAAC,OAAO,CAAC,EAAE,KAAK,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE;gBACtC,OAAO,CAAC,IAAI,CAAC,gBAAgB,CAAC,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC;aACxD;SACF,EAAE,IAAI,EAAE,GAAG,CAAC,aAAa,CAAC,eAAe,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;QACxD,OAAOA,aAAM,CAAC,OAAO,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC;IACvC,CAAC;IAED;;;;;;;aAOgB,gBAAgB,CAAC,KAAY,EAAE,GAAW;QACxD,IAAM,MAAM,GAAG,eAAe,CAAgB,KAAK,EAAE,GAAG,EAAE,eAAe,EAAE,QAAQ,CAAC,aAAa,CAAC,CAAC;;QAEnG,IAAI,MAAM,CAAC,MAAM,EAAE;YACjB,MAAM,CAAC,MAAM,GAAG,yBAAyB,CAAC,KAAK,EAAG,MAAM,CAAC,MAA4B,CAAC,CAAC;SACxF;QACD,IAAI,MAAM,CAAC,eAAe,EAAE;YAC1B,MAAM,CAAC,eAAe,GAAG,KAAK,CAAC,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC,aAAa,CAAC,eAAe,EAAE,IAAI,CAAC,CAAC,GAAG,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,EAAE,GAAA,CAAC,CAAC;SACxG;QACD,KAAK,CAAC,WAAW,CAAC,UAAC,OAAO,IAAK,QAAC,MAAM,CAAC,QAAQ,GAAG,OAAO,CAAC,EAAE,IAAC,EAAE,MAAM,CAAC,aAAa,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC;QAChG,OAAO,MAAM,CAAC;IAChB,CAAC;IAED;;;;;;;aAOgB,mBAAmB,CAAC,KAAY,EAAE,GAAW;QAC3D,IAAM,MAAM,GAAG,eAAe,CAAmB,KAAK,EAAE,GAAG,EAAE,kBAAkB,EAAE,QAAQ,CAAC,gBAAgB,CAAC,CAAC;;QAE5G,IAAI,MAAM,CAAC,MAAM,EAAE;YACjB,MAAM,CAAC,MAAM,GAAG,gBAAgB,CAAC,KAAK,EAAG,MAAM,CAAC,MAA4B,CAAC,CAAC;SAC/E;QACD,IAAI,MAAM,CAAC,MAAM,EAAE;YACjB,MAAM,CAAC,MAAM,GAAG,gBAAgB,CAAC,KAAK,EAAG,MAAM,CAAC,MAA4B,CAAC,CAAC;SAC/E;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;IAED;;;;;;;aAOgB,yBAAyB,CAAC,KAAY,EAAE,SAAiB;QACvE,IAAM,kBAAkB,GAAG,KAAK,CAAC,UAAU,CAACD,4BAAW,CAAC,SAAS,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC,aAAa,EAAE,IAAI,CAAC,CAAC;QAC1G,IAAI,kBAAkB,CAAC,MAAM,GAAG,CAAC,EAAE;YACjC,OAAO,gBAAgB,CAAC,KAAK,EAAE,kBAAkB,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;SAC1D;aAAM;YACL,OAAO,SAAS,CAAC;SAClB;IACH;;aC7IgB,qBAAqB,CAAC,EAAW,EAAE,SAA2B;QAC5E,IAAM,CAAC,GAAG,SAAS,CAAC;QACpB,IAAI,MAAc,CAAC;QACnB,QAAQ,CAAC,CAAC,iBAAiB;YACzB,KAAK,YAAY;gBACf,MAAM,GAAG,CAAC,GAAG,GAAG,CAAC;gBACjB,MAAM;YACR,KAAK,YAAY;gBACf,MAAM,GAAG,CAAC,GAAG,IAAI,CAAC;gBAClB,MAAM;YACR,KAAK,OAAO,CAAC;YACb;gBACE,MAAM,GAAG,CAAC,CAAC;gBACX,MAAM;SACT;QACD,IAAM,CAAC,GAAG,CAAC,CAAC,CAAC,aAAa,EAAE,CAAC,CAAC,aAAa,EAAE,CAAC,CAAC,aAAa,CAAC,CAAC,GAAG,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,GAAG,MAAM,GAAA,CAAC,CAAC;QACnF,IAAM,CAAC,GAAG,CAAC,CAAC,CAAC,UAAU,EAAE,CAAC,CAAC,UAAU,EAAE,CAAC,CAAC,UAAU,CAAC,CAAC,GAAG,CAASE,cAAS,CAA6B,CAAC;QACxG,IAAM,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC;QAElD,OAAO,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAC/C,CAAC;IAED;QAIE,yBAAoB,EAAe;YAAf,OAAE,GAAF,EAAE,CAAa;YACjC,IAAI,CAAC,WAAW,EAAE,CAAC;SACpB;QAED,qCAAW,GAAX;;YAAA,iBAyBC;YAxBC,IAAI,CAAC,KAAK,GAAG,IAAIC,wBAAa,EAAE,CAAC;YACjC,IAAM,KAAK,GAAG,IAAI,CAAC,EAAE,CAAC,KAAK,CAAC;;YAG5B,KAAK,CAAC,WAAW,CAAC,UAAC,OAAO;gBACxB,KAAI,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,EAAE,wBAAwB,CAAC,CAAC;aACpD,EAAE,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,sBAAsB,EAAE,IAAI,CAAC,CAAC;;YAG/C,KAAK,CAAC,WAAW,CAAC,UAAC,OAAO;gBACxB,KAAI,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,EAAE,eAAe,CAAC,CAAC;aAC3C,EAAE,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,aAAa,EAAE,IAAI,CAAC,CAAC;;YAGtC,IAAM,UAAU,GAA2B,EAAE,CAAC;;gBAC9C,KAAmB,IAAA,KAAA,SAAAN,0BAAS,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,CAAC,gBAAgB,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA,gBAAA,4BAAE;oBAA/E,IAAM,IAAI,WAAA;oBACb,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;iBAC9C;;;;;;;;;;gBACD,KAAmB,IAAA,KAAA,SAAAA,0BAAS,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,CAAC,gBAAgB,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA,gBAAA,4BAAE;oBAA/E,IAAM,IAAI,WAAA;oBACb,IAAM,MAAM,GAAG,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;oBAC3C,IAAI,MAAM,EAAE;wBACV,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,kBAAkB,CAAC,CAAC;qBAC3E;iBACF;;;;;;;;;SACF;QAED,iCAAO,GAAP,UAAQ,EAAU,EAAE,IAAY;YAC9B,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,IAAI,MAAA,EAAE,CAAC,CAAC;SACpC;QAED,iCAAO,GAAP,UAAQ,EAAU,EAAE,MAAc,EAAE,MAAc,EAAE,IAAY;YAC9D,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,IAAI,MAAA,EAAE,EAAE,IAAA,EAAE,CAAC,CAAC;SAC5D;QAED,iDAAuB,GAAvB,UAAwB,SAAiB,EAAE,SAAiB;;YAC1D,IAAI,SAAS,KAAK,SAAS,EAAE;gBAC3B,OAAO,IAAIO,YAAO,CAACA,YAAO,CAAC,QAAQ,CAAC,CAAC;aACtC;YACD,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE;gBACpE,OAAO,SAAS,CAAC;aAClB;YAED,IAAM,KAAK,GAAG,IAAI,CAAC,EAAE,CAAC,KAAK,CAAC;YAC5B,IAAM,EAAE,GAAG,IAAIA,YAAO,CAACA,YAAO,CAAC,QAAQ,CAAC,CAAC;YACzC,IAAM,IAAI,GAAGC,gCAAY,CAAC,IAAI,CAAC,KAAK,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC;YAC5D,IAAI,IAAI,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE;gBAC3B,IAAI,CAAC,OAAO,EAAE,CAAC;gBACf,IAAI,MAAM,GAAoB,EAAE,CAAC;;oBACjC,KAAqB,IAAA,SAAA,SAAA,IAAI,CAAA,0BAAA,4CAAE;wBAAtB,IAAM,MAAM,iBAAA;wBACf,IAAI,MAAM,EAAE;4BACV,IAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;4BACtE,IAAM,SAAS,GAAG,mBAAmB,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC;4BAC1D,qBAAqB,CAAC,EAAE,EAAE,SAAS,CAAC,CAAC;yBACtC;wBACD,MAAM,GAAG,MAAM,CAAC;qBACjB;;;;;;;;;gBACD,OAAO,EAAE,CAAC;aACX;iBAAM;gBACL,OAAO,SAAS,CAAC;aAClB;SACF;QAED,6CAAmB,GAAnB,UAAoB,MAAqB,EAAE,SAAiB;YAC1D,IAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,SAAS,CAAC;YAChF,IAAM,SAAS,GAAqBC,UAAG,CAAC,MAAM,EAAE,cAAc,EAAEA,UAAG,CAAC,MAAM,EAAE,WAAW,EAAE,SAAS,CAAC,CAAC,CAAC;YAErG,IAAI,MAA2B,CAAC;YAChC,IAAI,SAAS,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE;gBACrD,MAAM,GAAG,IAAI,CAAC,uBAAuB,CAAC,SAAS,CAAC,MAA2B,EAAE,SAAS,CAAC,CAAC;gBACxF,IAAI,MAAM,EAAE;oBACV,MAAM,GAAG,qBAAqB,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;iBACnD;aACF;iBAAM,IAAI,SAAS,EAAE;gBACpB,MAAM,GAAG,IAAI,CAAC,uBAAuB,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;aAC7D;YAED,IAAI,MAAM,EAAE;gBACV,IAAM,KAAK,GAAG,IAAIC,UAAK,EAAE,CAAC,kBAAkB,CAAC,MAAM,EAAEA,UAAK,CAAC,GAAG,CAAC,CAAC;gBAChE,IAAM,CAAC,GAAG,MAAM,CAAC,cAAc,EAAE,CAAC,GAAG,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,GAAG,IAAI,GAAA,CAA6B,CAAC;gBACjF,IAAM,CAAC,GAAG,KAAK,CAAC,SAAS,EAAE,CAAC,GAAG,CAASC,cAAS,CAA6B,CAAC;gBAC/E,IAAM,CAAC,GAAG,MAAM,CAAC,QAAQ,EAAE,CAAC,GAAG,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,QAAQ,GAAG,CAAC,GAAG,CAAC,GAAA,CAA6B,CAAC;gBAEhG,OAAO;oBACL,UAAU,EAAE,uEAAuE;oBACnF,KAAK,EAAE,6BAA2BC,OAAM,EAAE,eAAY;oBACtD,OAAO,EAAE,kBAAkB;oBAC3B,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC;oBACrB,MAAM,EAAE,SAAS;oBACjB,cAAc,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;oBACtD,SAAS,EAAE,CAAC,CAAC,CAAC,CAAC;oBACf,SAAS,EAAE,CAAC,CAAC,CAAC,CAAC;oBACf,SAAS,EAAE,CAAC,CAAC,CAAC,CAAC;oBACf,aAAa,EAAE,OAAO;oBACtB,UAAU,EAAE,CAAC,CAAC,CAAC,CAAC;oBAChB,UAAU,EAAE,CAAC,CAAC,CAAC,CAAC;oBAChB,UAAU,EAAE,CAAC,CAAC,CAAC,CAAC;oBAChB,cAAc,EAAE,KAAK;oBACrB,cAAc,EAAE,QAAQ;oBACxB,aAAa,EAAE,CAAC,CAAC,CAAC,CAAC;oBACnB,aAAa,EAAE,CAAC,CAAC,CAAC,CAAC;oBACnB,aAAa,EAAE,CAAC,CAAC,CAAC,CAAC;oBACnB,iBAAiB,EAAE,YAAY;iBAChC,CAAC;aACH;iBAAM;gBACL,OAAO,SAAS,CAAC;aAClB;SACF;8BACF;KAAA;;;QCnHC,yBAAoB,EAAe;YAAf,OAAE,GAAF,EAAE,CAAa;SAAI;QAEvC,0CAAgB,GAAhB,UAAiB,GAAW;YAC1B,OAAO,gBAAgB,CAAC,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;SAC7C;QACD,2CAAiB,GAAjB,UAAkB,GAAW;YAC3B,OAAO,iBAAiB,CAAC,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;SAC9C;QACD,0CAAgB,GAAhB,UAAiB,GAAW;YAC1B,OAAO,gBAAgB,CAAC,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;SAC7C;QACD,iDAAuB,GAAvB,UAAwB,GAAW;YACjC,OAAO,uBAAuB,CAAC,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;SACpD;QACD,4CAAkB,GAAlB;YACE,OAAO,kBAAkB,CAAC,IAAI,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC;SAC1C;QAED,0CAAgB,GAAhB,UAAiB,MAAe;YAC9B,IAAI,MAAc,CAAC;YACnB,QAAQ,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,GAAG;gBACjB,KAAK,MAAM;oBACT,MAAM,GAAG,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;oBAC7B,MAAM;gBACR,KAAK,QAAQ;oBACX,MAAM,GAAG,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;oBAC/B,MAAM;gBACR,KAAK,MAAM,CAAC;gBACZ;oBACE,MAAM,GAAG,GAAG,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,CAAC;oBAClC,MAAM;aACT;YACD,OAAO,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC;SACtC;QAED,+CAAqB,GAArB,UAAsB,MAAe;YAArC,iBAkBC;YAjBC,IAAI,QAAQ,GAAG,IAAI,CAAC,kBAAkB,EAAE,CAAC;YACzC,QAAQ,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,GAAG;gBACjB,KAAK,MAAM;oBACT,QAAQ,GAAG,QAAQ,CAAC,MAAM,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,GAAG,KAAK,MAAM,GAAA,CAAC,CAAC;oBAClD,MAAM;gBACR,KAAK,QAAQ;oBACX,QAAQ,GAAG,QAAQ,CAAC,MAAM,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,GAAG,KAAK,QAAQ,GAAA,CAAC,CAAC;oBACpD,MAAM;gBACR,KAAK,MAAM,CAAC;gBACZ;oBACE,MAAM;aACT;YACD,IAAI,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,KAAK,EAAE;gBACjB,QAAQ,GAAG,QAAQ,CAAC,GAAG,CAAC,UAAA,CAAC,IAAI,OAAA,CAAE,CAAC,CAAC,CAAC,EAAE,KAAI,CAAC,uBAAuB,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAA,CAAC;qBACzE,MAAM,CAAkB,UAAC,GAAG,EAAE,EAAmB;wBAAnB,KAAA,aAAmB,EAAlB,KAAK,QAAA,EAAE,UAAU,QAAA;oBAAM,OAAA,GAAG,CAAC,MAAM,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,GAAG,UAAU,GAAG,KAAK,CAAC;iBAAA,EAAE,EAAE,CAAC,CAAC;aACtH;YACD,OAAO,QAAQ,CAAC;SACjB;QAED,gDAAsB,GAAtB,UAAuB,MAAe;YAAtC,iBAiCC;YAhCC,IAAM,IAAI,GAAG,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC;YAC3C,IAAM,SAAS,GAAuB,EAAE,CAAC;YACzC,IAAI,KAAK,4BACJ,IAAI,CAAC,qBAAqB,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,UAAC,KAAK;gBAC9C,IAAM,MAAM,GAAG,KAAK,CAAC,iBAAiB,KAAK,+CAA+C,CAAC;gBAC3F,IAAM,SAAS,GAAG,KAAI,CAAC,YAAY,CAAC,KAAK,EAAE,IAAI,EAAE;oBAC/C,KAAK,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,OAAO,EAAE,MAAM,GAAG,GAAG,GAAG,GAAG,EAAE,UAAU,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,gBAAgB,EAAE,CAAC,MAAM;iBACxH,CAAC,CAAC;gBACH,IAAI,MAAM,IAAI,SAAS,EAAE;oBACvB,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;oBAC1B,OAAO,SAAS,CAAC;iBAClB;qBAAM;oBACL,OAAO,SAAS,CAAC;iBAClB;aACF,CAAC,EACH,CAAC;YACF,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE;gBACxB,KAAK,0CAAO,SAAS,WAAK,KAAK,EAAC,CAAC;aAClC;YAED,IAAI,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,KAAK,EAAE;;gBAEjB,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC;oBACnB,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,GAAC,GAAG,CAAC,EAAE,QAAQ,EAAE,WAAW,EAAE,CAAC;oBACpI,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,GAAC,GAAG,CAAC,EAAE,QAAQ,EAAE,WAAW,EAAE,CAAC;oBACnI,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,GAAC,GAAG,CAAC,EAAE,QAAQ,EAAE,WAAW,EAAE,CAAC;oBAClI,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,GAAC,GAAG,CAAC,EAAE,QAAQ,EAAE,WAAW,EAAE,CAAC;oBAClI,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,GAAC,GAAG,CAAC,EAAE,QAAQ,EAAE,WAAW,EAAE,CAAC;iBACnI,CAAC,CAAC;aACJ;YAED,OAAO,KAAK,CAAC,MAAM,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,KAAK,SAAS,GAAA,CAAuB,CAAC;SACjE;QAED,gDAAsB,GAAtB,UAAuB,QAAgB,EAAE,MAAe;YAAxD,iBAiBC;;YAhBC,IAAM,YAAY,GAAG,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,GAAG,MAAK,SAAS,IAAI,CAAA,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,GAAG,0CAAE,WAAW,EAAE,MAAK,MAAM,CAAC;YACxF,IAAM,MAAM,GAAG,IAAI,CAAC,kBAAkB,EAAE,CAAC,MAAM,CAAC,UAAC,CAAC,IAAK,OAAA,CAAC,CAAC,iBAAiB,KAAK,QAAQ,KAAK,CAAC,YAAY,IAAI,CAAC,CAAC,GAAG,MAAK,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,GAAG,CAAA,CAAC,GAAA,CAAC,CAAC;YACrI,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE;gBACrB,IAAM,OAAK,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;gBACxB,IAAM,MAAM,GAAG,OAAK,CAAC,iBAAiB,KAAK,+CAA+C,CAAC;gBAC3F,IAAM,SAAS,GAAG,IAAI,CAAC,YAAY,CAAC,OAAK,EAAE,OAAK,EAAE;oBAChD,KAAK,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,OAAO,EAAE,MAAM,GAAG,GAAG,GAAG,GAAG,EAAE,UAAU,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK;iBAC7F,CAAqB,CAAC;gBAEvB,IAAM,KAAK,GAAG,CAAC,MAAA,IAAI,CAAC,EAAE,CAAC,kBAAkB,CAAC,MAAM,CAAC,mCAAI,EAAE,EAAE,GAAG,CAAC,UAAC,MAAM,IAClE,OAAA,KAAI,CAAC,YAAY,CAAC,MAAM,EAAE,OAAK,EAAE,EAAE,KAAK,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,GAAC,GAAG,CAAC,EAAE,CAAC,GAAA,CAChD,CAAC;gBACxB,OAAO,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,KAAK,SAAS,GAAA,CAAC,CAAC;aAC/D;iBAAM;gBACL,OAAO,EAAE,CAAC;aACX;SACF;QAED,6CAAmB,GAAnB,UAAoB,MAAe;YAAnC,iBAKC;YAJC,IAAM,IAAI,GAAG,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC;YAC3C,OAAO,IAAI,CAAC,EAAE,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,UAAC,MAAM,IACnD,OAAA,KAAI,CAAC,YAAY,CAAC,MAAM,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,GAAC,GAAG,CAAC,EAAE,CAAC,GAAA,CACrE,CAAC,MAAM,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,KAAK,SAAS,GAAA,CAAuB,CAAC;SACtD;QAED,sCAAY,GAAZ,UAAa,MAAqB,EAAE,MAAqB,EAAE,SAAyC;YAAzC,0BAAA,EAAA,cAAyC;;YAClG,IAAM,WAAW,GAAG,MAAA,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,MAAM,0CAAE,WAAW,0CAAE,UAAU,CAAC,YAAY,CAAC,CAAC;YAC1E,IAAM,QAAQ,GAAG,WAAW,IAAI,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;YACrF,IAAI,SAAS,GAAG,IAAI,CAAC,EAAE,CAAC,KAAK,CAAC,uBAAuB,CAAC,QAAQ,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;YAC/E,IAAI,SAAS,EAAE;gBACb,IAAI,WAAW,EAAE;oBACf,SAAS,GAAG,IAAIL,YAAO,CAACA,YAAO,CAAC,QAAQ,CAAC,CAAC,OAAO,CAACF,cAAS,CAAC,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;iBAC1F;qBAAM;;oBAEL,IAAI,QAAc,CAAC;oBACnB,QAAQ,MAAM,CAAC,eAAe;wBAC5B,KAAK,YAAY;4BACf,QAAM,GAAG,CAAC,GAAG,GAAG,CAAC;4BACjB,MAAM;wBACR,KAAK,YAAY;4BACf,QAAM,GAAG,CAAC,GAAG,IAAI,CAAC;4BAClB,MAAM;wBACR,KAAK,OAAO,CAAC;wBACb;4BACE,QAAM,GAAG,CAAC,CAAC;4BACX,MAAM;qBACT;oBACD,IAAM,KAAK,GAAG,CAAC,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,UAAA,GAAG,IAAI,OAAA,GAAG,GAAG,QAAM,GAAG,CAAC,GAAA,CAAC,CAAC;oBACxG,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;iBACxB;gBACD,uBACE,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,EAAE,OAAO,EAAE,kBAAkB,EACjD,QAAQ,EAAE,MAAM,CAAC,QAAQ,EACzB,eAAe,EAAE,MAAM,CAAC,eAAe,EACvC,iBAAiB,EAAE,MAAM,CAAC,iBAAiB,EAC3C,eAAe,EAAE,MAAM,CAAC,eAAe,EACvC,UAAU,EAAE,WAAW,GAAG,MAAA,MAAM,CAAC,MAAM,0CAAE,IAAI,GAAG,SAAS,EACzD,cAAc,EAAE,WAAW,GAAG,MAAA,MAAM,CAAC,MAAM,0CAAE,YAAY,GAAG,SAAS,EACrE,eAAe,EAAE,SAAS,EAC1B,OAAO,EAAE,MAAM,CAAC,KAAK,IAClB,SAAS,EACZ;aACH;iBAAM;gBACL,OAAO,SAAS,CAAC;aAClB;SACF;QAED,kCAAQ,GAAR,UAAS,MAAe;YACtB,8CACK,IAAI,CAAC,sBAAsB,CAAC,MAAM,CAAC,WACnC,IAAI,CAAC,mBAAmB,CAAC,MAAM,CAAC,GACnC;SACH;8BACF;KAAA;;ICrMD,IAAM,UAAU,GAAG,mDAAmD,CAAC;IAEvE;IACO,IAAM,aAAa,GAAG,IAAI,GAAG,CAAC,CAAC,qDAAqD,EAAE,uDAAuD,EAAE,uDAAuD,EAAE,+CAA+C,EAAE,sDAAsD,EAAE,qDAAqD,EAAE,qDAAqD,EAAE,qDAAqD,EAAE,mDAAmD,EAAE,qDAAqD,EAAE,qDAAqD,EAAE,6CAA6C,EAAE,qDAAqD,EAAE,uDAAuD,EAAE,uDAAuD,EAAE,+CAA+C,EAAE,oDAAoD,EAAE,sDAAsD,EAAE,sDAAsD,EAAE,8CAA8C,EAAE,qDAAqD,EAAE,oDAAoD,EAAE,oDAAoD,EAAE,oDAAoD,EAAE,uDAAuD,EAAE,yDAAyD,EAAE,yDAAyD,EAAE,iDAAiD,EAAE,uDAAuD,EAAE,yDAAyD,EAAE,yDAAyD,EAAE,iDAAiD,EAAE,wDAAwD,EAAE,uDAAuD,EAAE,uDAAuD,EAAE,uDAAuD,EAAE,qDAAqD,EAAE,uDAAuD,EAAE,uDAAuD,EAAE,+CAA+C,EAAE,sDAAsD,EAAE,wDAAwD,EAAE,wDAAwD,EAAE,gDAAgD,EAAE,oDAAoD,EAAE,sDAAsD,EAAE,sDAAsD,EAAE,8CAA8C,EAAE,qDAAqD,EAAE,oDAAoD,EAAE,oDAAoD,EAAE,oDAAoD,EAAE,sDAAsD,EAAE,wDAAwD,EAAE,wDAAwD,EAAE,gDAAgD,EAAE,uDAAuD,EAAE,sDAAsD,EAAE,sDAAsD,EAAE,sDAAsD,EAAE,sDAAsD,EAAE,wDAAwD,EAAE,wDAAwD,EAAE,gDAAgD,EAAE,uDAAuD,EAAE,sDAAsD,EAAE,sDAAsD,EAAE,sDAAsD,EAAE,uDAAuD,EAAE,yDAAyD,EAAE,yDAAyD,EAAE,iDAAiD,EAAE,sDAAsD,EAAE,wDAAwD,EAAE,wDAAwD,EAAE,gDAAgD,EAAE,qDAAqD,EAAE,uDAAuD,EAAE,uDAAuD,EAAE,+CAA+C,EAAE,sDAAsD,EAAE,qDAAqD,EAAE,qDAAqD,EAAE,qDAAqD,EAAE,mDAAmD,EAAE,qDAAqD,EAAE,qDAAqD,EAAE,6CAA6C,EAAE,qDAAqD,EAAE,uDAAuD,EAAE,uDAAuD,EAAE,+CAA+C,EAAE,oDAAoD,EAAE,sDAAsD,EAAE,sDAAsD,EAAE,8CAA8C,EAAE,qDAAqD,EAAE,oDAAoD,EAAE,oDAAoD,EAAE,oDAAoD,EAAE,uDAAuD,EAAE,yDAAyD,EAAE,yDAAyD,EAAE,iDAAiD,EAAE,uDAAuD,EAAE,yDAAyD,EAAE,yDAAyD,EAAE,iDAAiD,EAAE,wDAAwD,EAAE,uDAAuD,EAAE,uDAAuD,EAAE,uDAAuD,EAAE,oDAAoD,EAAE,sDAAsD,EAAE,sDAAsD,EAAE,8CAA8C,EAAE,qDAAqD,EAAE,oDAAoD,EAAE,oDAAoD,EAAE,oDAAoD,EAAE,sDAAsD,EAAE,wDAAwD,EAAE,wDAAwD,EAAE,gDAAgD,EAAE,uDAAuD,EAAE,sDAAsD,EAAE,sDAAsD,EAAE,sDAAsD,CAAC,CAAC,CAAC;IACh7N;IACO,IAAM,UAAU,GAAG,EAAE,iBAAiB,EAAE,sCAAsC,EAAE,iBAAiB,EAAE,sCAAsC,EAAE,iBAAiB,EAAE,sCAAsC,EAAE,iBAAiB,EAAE,sCAAsC,EAAE,iBAAiB,EAAE,sCAAsC,EAAE,iBAAiB,EAAE,sCAAsC,EAAE,iBAAiB,EAAE,sCAAsC,EAAE,iBAAiB,EAAE,sCAAsC,EAAE,iBAAiB,EAAE,sCAAsC,EAAE,iBAAiB,EAAE,sCAAsC,EAAE,iBAAiB,EAAE,sCAAsC,EAAE,iBAAiB,EAAE,sCAAsC,EAAE,iBAAiB,EAAE,sCAAsC,EAAE,iBAAiB,EAAE,sCAAsC,EAAE,iBAAiB,EAAE,sCAAsC,EAAE,iBAAiB,EAAE,sCAAsC,EAAE,iBAAiB,EAAE,sCAAsC,EAAE,iBAAiB,EAAE,sCAAsC,EAAE,iBAAiB,EAAE,sCAAsC,EAAE,iBAAiB,EAAE,sCAAsC,EAAE,iBAAiB,EAAE,sCAAsC,EAAE,iBAAiB,EAAE,sCAAsC,EAAE,iBAAiB,EAAE,sCAAsC,EAAE,iBAAiB,EAAE,sCAAsC,EAAE,iBAAiB,EAAE,sCAAsC,EAAE,iBAAiB,EAAE,sCAAsC,EAAE,iBAAiB,EAAE,sCAAsC,EAAE,iBAAiB,EAAE,sCAAsC,EAAE,iBAAiB,EAAE,sCAAsC,EAAE,iBAAiB,EAAE,sCAAsC,EAAE,iBAAiB,EAAE,sCAAsC,EAAE,iBAAiB,EAAE,sCAAsC,EAAE,iBAAiB,EAAE,sCAAsC,EAAE,iBAAiB,EAAE,sCAAsC,EAAE,iBAAiB,EAAE,sCAAsC,EAAE,iBAAiB,EAAE,sCAAsC,EAAE,iBAAiB,EAAE,sCAAsC,EAAE,iBAAiB,EAAE,sCAAsC,EAAE,iBAAiB,EAAE,sCAAsC,EAAE,CAAC;IAE1xE;IACA,IAAM,kBAAkB,GAA+B;QACrD,sCAAsC,EAAE,UAAU;QAClD,sCAAsC,EAAE,aAAa;QACrD,sCAAsC,EAAE,aAAa;QACrD,sCAAsC,EAAE,kBAAkB;QAC1D,sCAAsC,EAAE,gBAAgB;QACxD,sCAAsC,EAAE,cAAc;QACtD,sCAAsC,EAAE,sBAAsB;QAC9D,sCAAsC,EAAE,WAAW;KACpD,CAAC;IAEF,IAAM,cAAc,GAAG;QACrB,OAAO,EAAE,4CAA4C;QACrD,QAAQ,EAAE,4CAA4C;QACtD,GAAG,EAAE,sBAAsB;QAC3B,IAAI,EAAE,uCAAuC;QAE7C,KAAK,EAAE,YAAY;QACnB,WAAW,EAAE,cAAc;QAC3B,IAAI,EAAE;YACJ,KAAK,EAAE,cAAc;YACrB,OAAO,EAAE,KAAK;SACf;QACD,OAAO,EAAE;YACP,UAAU,EAAE,WAAW;SACxB;QACD,QAAQ,EAAE;YACR,KAAK,EAAE,oBAAoB;YAC3B,OAAO,EAAE,KAAK;SACf;QACD,QAAQ,EAAE;YACR,KAAK,EAAE,aAAa;YACpB,OAAO,EAAE,KAAK;SACf;;QAED,YAAY,EAAE;YACZ,KAAK,EAAE,oBAAoB;YAC3B,OAAO,EAAE,KAAK;SACf;QACD,aAAa,EAAE;YACb,KAAK,EAAE,mBAAmB;YAC1B,OAAO,EAAE,KAAK;SACf;QACD,aAAa,EAAE;YACb,KAAK,EAAE,oBAAoB;YAC3B,OAAO,EAAE,KAAK;SACf;QACD,SAAS,EAAE;YACT,KAAK,EAAE,eAAe;SACvB;KACF,CAAC;IAEF;;;;;;aAMgB,sBAAsB,CAAC,IAAa,EAAE,SAAc,EAAE,SAAc,EAAE,YAAqB,EAAE,KAAa;;QAApE,0BAAA,EAAA,cAAc;QAAE,0BAAA,EAAA,cAAc;QAAyB,sBAAA,EAAA,aAAa;QACxH,IAAM,OAAO,GAAII,UAAG,CAAC,IAAI,EAAE,WAAW,EAAE,EAAE,CAAgB;aACvD,GAAG,CAAC,UAAA,CAAC,IAAI,OAAAA,UAAG,CAAC,CAAC,EAAE,SAAS,EAAE,EAAE,CAAa,GAAA,CAAC;aAC3C,IAAI,CAAC,UAAC,CAAC,EAAE,CAAC,IAAM,OAAA,CAAC,CAAC,MAAM,CAAY,CAAC,aAAa,CAAC,CAAC,CAAC,MAAM,CAAW,CAAC,GAAA,CAAC,CAAC;QAE5E,IAAM,WAAW,GAA8B,EAAE,CAAC;QAClD,IAAM,WAAW,GAAgB,OAAO,CAAC,GAAG,CAAC,UAAA,CAAC,IAC5C,OAAA,IAAI,iBAAiB,CAAC,CAAC,EAAE,SAAS,EAAE,SAAS,EAAE,YAAY,CAAC,CAAC,QAAQ,EAAE,GAAA,CACxE,CAAC;;YACF,KAAoB,IAAA,gBAAA,SAAA,WAAW,CAAA,wCAAA,iEAAE;gBAA5B,IAAM,KAAK,wBAAA;gBACd,IAAM,OAAO,GAAG,KAAK,CAAC,KAAK,CAAW,CAAC;gBACvC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE;oBACzB,WAAW,CAAC,OAAO,CAAC,GAAG,KAAK,CAAC;iBAC9B;qBAAM;oBACL,IAAM,OAAO,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC,OAAsB,CAAC;oBAC5D,OAAO,CAAC,IAAI,CAAE,KAAK,CAAC,OAAuB,CAAC,CAAC,CAAC,CAAC,CAAC;iBACjD;aACF;;;;;;;;;QACD,IAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;QAE1C,IAAI,KAAK,EAAE;YACT,WAAW,CAAC,MAAM,CAAC,CAAC;YACpB,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,UAAA,CAAC,IAAI,wBAAG,UAAU,EAAE,cAAc,IAAK,CAAC,KAAG,CAAC,CAAC,CAAC;SACtE;QAED,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC;IAC1D,CAAC;IAED,SAAS,WAAW,CAAC,MAAmB;;QACtC,IAAI,QAAQ,GAAgB,EAAE,CAAC;QAC/B,IAAI,OAAO,GAAG,CAAC,CAAC;;YAChB,KAAoB,IAAA,KAAA,SAAA,MAAM,CAAC,MAAM,CAAC,UAAA,CAAC,IAAK,OAAA,CAAC,CAAC,OAAc,CAAC,MAAM,GAAG,CAAC,GAAA,CAAC,CAAA,gBAAA,4BAAE;gBAAjE,IAAM,KAAK,WAAA;gBACd,IAAM,OAAO,GAAG,KAAK,CAAC,OAAsB,CAAC;wCACpC,CAAC;;oBACR,IAAM,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK,CAAW,CAAC;oBAC5C,QAAQ,GAAG,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,QAAuB,CAAC,CAAC;;wBAC/D,KAAsB,IAAA,oBAAA,SAAA,OAAO,CAAC,CAAC,CAAC,CAAC,QAAuB,CAAA,CAAA,gBAAA,4BAAE;4BAArD,IAAM,OAAO,WAAA;4BAChB,QAAQ,GAAG,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,QAAuB,CAAC,CAAC;yBAC7D;;;;;;;;;oBACD,KAAK,IAAI,CAAC,GAAC,CAAC,GAAC,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;wBACvC,IAAM,QAAQ,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,QAAuB,CAAC;wBACpD,IAAI,QAAQ,CAAC,IAAI,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,KAAK,CAAC,KAAK,OAAO,GAAA,CAAC,EAAE;4BAC5C,OAAO,CAAC,CAAC,CAAC,CAAC,QAAQ,GAAG,IAAI,CAAC;4BAC3B,OAAO,EAAE,CAAC;yBACX;qBACF;;gBAZH,KAAK,IAAI,CAAC,GAAC,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE;4BAA5B,CAAC;iBAaT;gBACD,KAAK,CAAC,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,QAAQ,KAAK,IAAI,GAAA,CAAC,CAAC;aAC1D;;;;;;;;;QACD,IAAI,OAAO,GAAG,CAAC,EAAE;YACf,OAAO,CAAC,GAAG,CAAC,YAAK,OAAO,mCAAgC,CAAC,CAAC;SAC3D;IACH,CAAC;IAED;QAmBE,2BAAmB,IAAc,EAAE,SAAc,EAAE,SAAc,EAAE,YAAqB;;YAArD,0BAAA,EAAA,cAAc;YAAE,0BAAA,EAAA,cAAc;;YAA9C,SAAI,GAAJ,IAAI,CAAU;YAlBjC,QAAG,GAAG,KAAK,CAAC;YAIZ,aAAO,GAAG,QAAQ,CAAC;YAKnB,gBAAW,GAAG,cAAc,CAAC;YAU3B,IAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC;YACzC,IAAI,UAAU,KAAK,QAAQ,EAAE;gBAC3B,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC;gBAChB,OAAO;aACR;YACD,IAAM,SAAS,IAAI,IAAI,CAAC,IAAI,CAAC,SAAS,IAAI,EAAE,CAAe,CAAC;YAC5D,IAAM,WAAW,IAAI,IAAI,CAAC,IAAI,CAAC,WAAW,IAAI,EAAE,CAAe,CAAC;YAEhE,IAAM,KAAK,GAAG,SAAS,CAAC,IAAI,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,WAAW,KAAK,OAAO,GAAA,CAAa,CAAC;YACzE,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;YAC7C,IAAM,WAAW,GAAG,IAAI,CAAC,cAAc,CAAC,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;YAC1D,IAAI,CAAC,WAAW,EAAE;gBAChB,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC;aACjB;iBAAM;gBACL,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC;aACjC;YAED,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,UAAoB,CAAC,EAAE;gBAClD,kBAAkB,CAAC,IAAI,CAAC,UAAoB,CAAC,GAAG,IAAI,CAAC,UAAoB,CAAC;aAC3E;YAED,IAAM,WAAW,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,uBAAiC,CAAC,CAAC,kBAAkB,EAAE,CAAC;YAC1F,IAAM,SAAS,GAAG,kBAAkB,CAAC,IAAI,CAAC,UAAoB,CAAC,IAAI,IAAI,CAAC,UAAoB,CAAC;YAC7F,IAAM,OAAO,GAAG,IAAI,CAAC,2BAA2B,CAAC;YAEjD,IAAI,CAAC,KAAK,CAAC,GAAG,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC;YACrC,IAAI,CAAC,KAAK,GAAG,gBAAc,WAAW,UAAK,OAAO,UAAK,SAAW,CAAC;YACnE,IAAI,CAAC,IAAI,GAAM,SAAS,sBAAiB,IAAI,CAAC,IAAM,CAAC;YAErD,IAAM,aAAa,GAA8B,EAAE,CAAC;YACpD,IAAM,QAAQ,GAAgB,EAAE,CAAC;YACjC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;YACzB,IAAM,QAAQ,GAAgB,EAAE,CAAC;YACjC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;;gBAEzB,KAAyB,IAAA,KAAA,SAAA,WAAW,CAAC,MAAM,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,WAAW,KAAK,QAAQ,GAAA,CAAC,CAAA,gBAAA,4BAAE;oBAAzE,IAAM,UAAU,WAAA;oBACnB,IAAM,OAAO,GAAG,IAAI,CAAC,UAAU,CAAC,UAAU,EAAE,IAAI,EAAE,SAAS,CAAC,CAAC;oBAE7D,IAAM,SAAS,GAAG,UAAU,CAAC,aAAuB,CAAC;oBACrD,aAAa,CAAC,SAAS,CAAC,GAAG,OAAO,CAAC;oBACnC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;oBACvB,OAAO,CAAC,cAAc,GAAG,MAAA,OAAO,CAAC,cAAc,mCAAI,QAAQ,CAAC,MAAM,CAAC;iBACpE;;;;;;;;;;gBACD,KAAyB,IAAA,gBAAA,SAAA,WAAW,CAAA,wCAAA,iEAAE;oBAAjC,IAAM,UAAU,wBAAA;oBACnB,IAAI,UAAU,CAAC,WAAW,KAAK,SAAS,EAAE;wBACxC,IAAM,OAAO,GAAG,IAAI,CAAC,UAAU,CAAC,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,YAAY,CAAC,CAAC;wBAEhF,IAAM,SAAS,GAAGA,UAAG,CAAC,UAAU,EAAE,CAAC,iBAAiB,EAAE,UAAU,EAAE,WAAW,CAAC,CAAW,CAAC;wBAC1F,IAAI,aAAa,CAAC,SAAS,CAAC,EAAE;4BAC5B,MAAC,aAAa,CAAC,SAAS,CAAC,CAAC,QAAqB,0CAAE,IAAI,CAAC,OAAO,CAAC,CAAC;yBAChE;6BAAM;4BACL,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;yBACxB;qBACF;iBACF;;;;;;;;;YAED,IAAM,GAAG,GAAa,WAAW,aAAX,WAAW,cAAX,WAAW,GAAI,EAAE,CAAC;YACxC,IAAM,IAAI,GAAM,GAAG,CAAC,WAAW,WAAM,GAAG,CAAC,WAAW,WAAM,GAAG,CAAC,WAAW,SAAI,GAAG,CAAC,eAAiB,CAAC;YACnG,IAAI,CAAC,aAAa,GAAG,GAAG,CAAC,WAAqB,IAAI,QAAQ,CAAC,MAAM,CAAC;YAClE,IAAM,KAAK,GAAG,UAAU,CACtB,CAAC,GAAG,CAAC,eAAyB;iBAC3B,CAAC,GAAG,CAAC,WAAqB,IAAI,CAAC,IAAI,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,aAAa,EAAE,CAAC,CAAC,CAAC;iBACnE,OAAO,CAAC,CAAC,CAAC,CACd,CAAC;YACF,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC;YAC1B,IAAM,MAAM,GAAG,GAAG,CAAC,eAAyB,IAAI,YAAY,CAAC;YAC7D,IAAI,CAAC,aAAa,GAAG,MAAM,CAAC;YAE5B,IAAI,CAAC,WAAW,GAAM,IAAI,UAAK,KAAK,SAAI,MAAM,UAAK,IAAI,CAAC,aAAa,UAAK,IAAI,CAAC,aAAa,cAAW,CAAC;YAExG,QAAQ,CAAC,OAAO,CAAC,UAAC,OAAO,EAAE,KAAK;gBAC9B,OAAO,CAAC,WAAW,GAAM,GAAG,CAAC,WAAW,WAAM,GAAG,CAAC,WAAW,WAAM,KAAK,SAAI,MAAM,UAAK,KAAK,SAAI,MAAM,UAAK,OAAO,CAAC,WAAa,CAAC;gBACjI,OAAO,CAAC,cAAc,GAAG,KAAK,GAAG,CAAC,CAAC;aACpC,CAAC,CAAC;SACJ;QAED,sCAAU,GAAV,UAAW,OAAiB,EAAE,IAAc,EAAE,SAAiB;YAC7D,IAAM,WAAW,GAAG,IAAI,IAAI,CAAC,OAAO,CAAC,uBAAiC,CAAC,CAAC,kBAAkB,EAAE,CAAC;YAC7F,IAAM,SAAS,GAAG,kBAAkB,CAAC,OAAO,CAAC,UAAoB,CAAC,IAAI,OAAO,CAAC,UAAoB,CAAC;YACnG,IAAM,OAAO,GAAG,OAAO,CAAC,2BAA2B,CAAC;YAEpD,OAAO;gBACL,KAAK,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI;gBAChC,OAAO,EAAE,QAAQ;gBACjB,KAAK,EAAE,gBAAc,WAAW,UAAK,OAAO,UAAK,SAAW;gBAC5D,WAAW,EAAE,KAAG,IAAI,CAAC,aAAe;gBACpC,IAAI,EAAK,SAAS,sBAAiB,OAAO,CAAC,IAAM;gBAEjD,WAAW,EAAE,gBAAgB;gBAC7B,cAAc,EAAE,CAAC;gBAEjB,OAAO,EAAE,EAAE;gBACX,QAAQ,EAAE,EAAE;aACb,CAAC;SACH;QAED,sCAAU,GAAV,UAAW,OAAiB,EAAE,SAAc,EAAE,SAAc,EAAE,YAAqB;YAArD,0BAAA,EAAA,cAAc;YAAE,0BAAA,EAAA,cAAc;;YAC1D,IAAM,WAAW,GAAG,IAAI,IAAI,CAAC,OAAO,CAAC,uBAAiC,CAAC,CAAC,kBAAkB,EAAE,CAAC;YAC7F,IAAM,SAAS,GAAG,kBAAkB,CAAC,OAAO,CAAC,UAAoB,CAAC,IAAI,OAAO,CAAC,UAAoB,CAAC;YACnG,IAAM,OAAO,GAAG,OAAO,CAAC,2BAA2B,CAAC;YAEpD,IAAM,KAAK,0CACN,OAAO,CAAC,UAAsB;gBACjCA,UAAG,CAAC,OAAO,EAAE,CAAC,iBAAiB,EAAE,UAAU,EAAE,YAAY,CAAC,EAAE,EAAE,CAAC;cAChE,CAAC;YACF,IAAM,WAAW,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE,CAAC;YAElD,IAAI,UAAkB,CAAC;YACvB,IAAI,SAAS,GAAG,8BAA8B,CAAC;YAC/C,IAAI,WAAW,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE;gBACrC,UAAU,GAAG,KAAK,CAAC;gBACnB,SAAS,GAAG,+BAA+B,CAAC;aAC7C;iBAAM,IAAI,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE;gBAC3C,UAAU,GAAG,IAAI,CAAC;gBAClB,SAAS,GAAG,iCAAiC,CAAC;aAC/C;iBAAM,IAAI,WAAW,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE;gBAC9C,UAAU,GAAG,OAAO,CAAC;gBACrB,SAAS,GAAG,oCAAoC,CAAC;aAClD;iBAAM,IAAI,WAAW,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE;gBAC5C,UAAU,GAAG,KAAK,CAAC;gBACnB,SAAS,GAAG,kCAAkC,CAAC;aAChD;iBAAM,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE;gBACnF,UAAU,GAAG,IAAI,CAAC;gBAClB,SAAS,GAAG,8BAA8B,CAAC;aAC5C;iBAAM,IAAI,WAAW,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE;gBAC9C,UAAU,GAAG,OAAO,CAAC;aACtB;iBAAM,IAAI,WAAW,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE;gBAC5C,UAAU,GAAG,KAAK,CAAC;aACpB;iBAAM;gBACL,UAAU,GAAG,OAAO,CAAC;aACtB;YACD,SAAS,GAAG,MAAA,IAAI,CAAC,mBAAmB,CAAC,OAAO,EAAE,SAAS,EAAE,YAAY,CAAC,mCAAI,SAAS,CAAC;YAEpF,OAAO;gBACL,KAAK,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI;gBAChC,OAAO,EAAE,SAAS;gBAClB,KAAK,EAAE,gBAAc,WAAW,UAAK,OAAO,UAAK,SAAW;gBAC5D,WAAW,EAAE,uBAAqB,KAAK,CAAC,IAAI,CAAC,IAAI,CAAG;gBACpD,IAAI,EAAK,SAAS,uBAAkB,OAAO,CAAC,IAAM;gBAClD,UAAU,YAAA;gBACV,SAAS,WAAA;aACV,CAAC;SACH;QAED,+CAAmB,GAAnB,UAAoB,OAAiB,EAAE,SAAiB,EAAE,YAAqB;YAC7E,IAAI,OAAO,CAAC,cAAc,EAAE;gBAC1B,IAAM,aAAa,GAAG,OAAO,CAAC,cAA0B,CAAC;gBACzD,OAAU,SAAS,SAAI,aAAa,CAAC,SAAS,SAAI,aAAa,CAAC,QAAU,IAAI,YAAY,GAAG,YAAU,YAAc,GAAG,EAAE,CAAC,CAAC;aAC7H;iBAAM,IAAI,OAAO,CAAC,UAAU,KAAK,sCAAsC,EAAE;gBACxE,IAAM,KAAK,GAAIA,UAAG,CAAC,OAAO,EAAE,gBAAgB,EAAE,EAAE,CAA4B;qBACzE,MAAM,CAAC,UAAA,CAAC,IAAI,OAAA,yBAAyB,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAA,CAAC;qBACvD,MAAM,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,sCAAsC,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAA,CAAC;qBACrE,MAAM,CAAC,UAAA,CAAC,IAAI,OAAA,aAAa,CAAC,GAAG,CAC5B,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,UAAU,EAAE,gBAAgB,CAAC,CACvF,GAAA,CAAC;qBACD,GAAG,CAAC,UAAA,CAAC,IAAI,OAAG,SAAS,SAAI,OAAO,CAAC,IAAI,SAAI,CAAC,CAAC,QAAU,IAAI,YAAY,GAAG,YAAU,YAAc,GAAG,EAAE,CAAC,GAAA,CAAC,CAAC;gBAE3G,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE;oBACpB,IAAM,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,UAAU,EAAE,gBAAgB,CAAC,CAAC;oBACnG,IAAI,aAAa,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE;wBAC5B,OAAO,0CAAwC,KAAO,CAAC;qBACxD;iBACF;aACF;iBAAM,IAAI,OAAO,CAAC,UAAU,KAAK,sCAAsC,EAAE;gBACxE,IAAM,KAAK,GAAG,UAAU,CAAC,OAAO,CAAC,SAAmB,CAAC,CAAC;gBACtD,IAAI,KAAK,EAAE;oBACT,OAAO,mCAAiC,KAAO,CAAC;iBACjD;aACF;YACD,OAAO,SAAS,CAAC;SAClB;QAED,oCAAQ,GAAR,UAAS,KAAe,EAAE,SAAiB;;YACzC,IAAM,gBAAgB,GAAG,CAAC,KAAK,CAAC,WAAqB,IAAI,EAAE,EAAE,WAAW,EAAE,CAAC;YAC3E,IAAI,GAAkC,CAAC;YACvC,IAAI,gBAAgB,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE;gBACvC,GAAG,GAAG,QAAQ,CAAC;aAChB;iBAAM,IAAI,gBAAgB,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE;gBAC5C,GAAG,GAAG,MAAM,CAAC;aACd;YACD,IAAM,QAAQ,GAAG,gBAAgB,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;YACxD,IAAI,GAAuB,CAAC;YAC5B,IAAI,QAAQ,EAAE;gBACZ,GAAG,GAAGI,eAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;aAC7B;YACD,IAAI,GAAuB,CAAC;;gBAC5B,KAAiB,IAAA,KAAA,SAAAJ,UAAG,CAAC,KAAK,EAAE,2BAA2B,EAAEA,UAAG,CAAC,KAAK,EAAE,4BAA4B,EAAE,EAAE,CAAC,CAAe,CAAA,gBAAA,4BAAE;oBAAjH,IAAM,EAAE,WAAA;oBACX,IAAI,EAAE,CAAC,cAAc,KAAK,iBAAiB,IAAI,EAAE,CAAC,cAAc,KAAK,QAAQ,EAAE;wBAC7E,GAAG,GAAG,QAAQ,CAAC;qBAChB;yBAAM,IAAI,EAAE,CAAC,cAAc,KAAK,kBAAkB,IAAI,EAAE,CAAC,cAAc,KAAK,MAAM,EAAE;wBACnF,GAAG,GAAG,MAAM,CAAC;qBACd;yBAAM,IAAI,EAAE,CAAC,cAAc,KAAK,2BAA2B,IAAI,EAAE,CAAC,cAAc,KAAK,KAAK,EAAE;wBAC3F,GAAG,GAAGI,eAAQ,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC;qBAC/B;yBAAM,IAAI,EAAE,CAAC,cAAc,KAAK,iBAAiB,EAAE;wBAClD,GAAG,GAAGA,eAAQ,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC;qBAC/B;iBACF;;;;;;;;;YACD,IAAI,KAAK,GAAG,EAAE,CAAC;YACf,IAAI,GAAG,IAAI,GAAG,EAAE;gBACd,KAAK,IAAO,GAAG,cAAS,GAAK,CAAC;gBAC9B,IAAI,GAAG,EAAE;oBACP,KAAK,IAAI,WAAS,GAAG,CAAC,OAAO,CAAC,CAAC,CAAG,CAAC;iBACpC;aACF;YAED,IAAM,WAAW,GAAG,IAAI,IAAI,CAAC,KAAK,CAAC,uBAAiC,CAAC,CAAC,kBAAkB,EAAE,CAAC;YAC3F,IAAM,SAAS,GAAG,kBAAkB,CAAC,KAAK,CAAC,UAAoB,CAAC,IAAI,KAAK,CAAC,UAAoB,CAAC;YAC/F,IAAM,OAAO,GAAG,KAAK,CAAC,2BAA2B,CAAC;YAElD,OAAO;gBACL,KAAK,EAAE,UAAU,GAAG,KAAK,CAAC,IAAI;gBAC9B,OAAO,EAAE,OAAO;gBAChB,KAAK,OAAA;gBACL,WAAW,EAAE,aAAW,WAAW,UAAK,OAAO,UAAK,SAAW;gBAC/D,IAAI,EAAK,SAAS,qBAAgB,KAAK,CAAC,IAAM;gBAE9C,GAAG,KAAA;gBACH,GAAG,KAAA;gBACH,GAAG,KAAA;gBAEH,eAAe,EAAE,QAAQ;gBACzB,aAAa,EAAE,SAAS;gBACxB,aAAa,EAAE,KAAK,CAAC,UAAoB;gBAEzC,OAAO,EAAE,EAAE;aACZ,CAAC;SACH;QAED,0CAAc,GAAd,UAAe,IAAc,EAAE,KAAgB;;YAC7C,IAAI,aAAoC,CAAC;YACzC,IAAI,WAAW,GAAG,IAAI,CAAC,YAAwB,CAAC;YAChD,IAAI,WAAW,EAAE;;gBAEf,IAAI,OAAO,WAAW,KAAK,QAAQ,EAAE;oBACnC,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,WAAqB,CAAa,CAAC;iBAC7D;gBACD,IAAI,WAAW,CAAC,YAAY,EAAE;oBAC5B,OAAO,CAAC,GAAG,CAAC,oCAAoC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;iBAC9D;qBAAM,IAAK,WAA4C,CAAC,KAAK,CAAC,EAAE;;oBAE/D,aAAa,GAAG,WAAmC,CAAC;iBACrD;aACF;YACD,IAAI,aAAa,EAAE;;gBAEjB,IAAM,MAAM,GAAW,MAAAJ,UAAG,CAAC,aAAa,EAAE,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC,mCAAI,EAAE,CAAC;gBACzE,IAAI,MAAM,CAAC,UAAU,CAAC,+CAA+C,CAAC,EAAE;oBACtE,IAAI,KAAK,CAAC,GAAG,KAAK,MAAM,EAAE;wBACxBK,UAAG,CAAC,aAAa,EAAE,CAAC,WAAW,EAAE,QAAQ,CAAC,EAAE,MAAM,CAAC,OAAO,CAAC,aAAa,EAAE,cAAc,CAAC,CAAC,CAAC;qBAC5F;yBAAM;wBACLA,UAAG,CAAC,aAAa,EAAE,CAAC,WAAW,EAAE,QAAQ,CAAC,EAAE,MAAM,CAAC,OAAO,CAAC,aAAa,EAAE,cAAc,CAAC,CAAC,CAAC;qBAC5F;iBACF;qBAAM,IAAI,MAAM,KAAK,iDAAiD,IAAI,MAAM,KAAK,kDAAkD,EAAE;oBACxI,IAAI,KAAK,CAAC,GAAG,KAAK,MAAM,EAAE;wBACxBA,UAAG,CAAC,aAAa,EAAE,CAAC,WAAW,EAAE,QAAQ,CAAC,EAAE,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC,GAAG,QAAQ,CAAC,CAAC;qBACvF;yBAAM;wBACLA,UAAG,CAAC,aAAa,EAAE,CAAC,WAAW,EAAE,QAAQ,CAAC,EAAE,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC,GAAG,QAAQ,CAAC,CAAC;qBACvF;iBACF;aACF;YACD,OAAO,aAAa,CAAC;SACtB;QAED,0CAAc,GAAd;YACE,OAAOC,WAAI,mBAAM,IAAI,GAAI,CAAC,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC,CAAyB,CAAC;SAC5E;QAED,oCAAQ,GAAR;YACE,uCAAY,IAAI,CAAC,KAAK,KAAE,OAAO,EAAE,CAAC,IAAI,CAAC,cAAc,EAAE,CAAC,IAAG;SAC5D;gCACF;KAAA;;IC/YD;IACA,IAAM,4BAA4B,GAAG,GAAG,CAAC;IAEzC,IAAM,oBAAoB,GAAG;QAC3B,MAAM,EAAE,aAAa;QACrB,YAAY,EAAE,YAAY;QAC1B,yBAAyB,EAAE,6BAA6B;QACxD,uBAAuB;QACvB,uBAAuB;QACvB,oDAAoD;QACpD,gDAAgD;QAChD,qDAAqD;QACrD,iDAAiD;QACjD,mCAAmC;QACnC,sBAAsB;QACtB,sBAAsB;QACtB,uCAAuC;QACvC,gBAAgB;QAChB,yBAAyB;QACzB,gDAAgD;QAChD,qCAAqC;QACrC,wBAAwB;QACxB,wBAAwB;QACxB,yCAAyC;QACzC,kBAAkB;QAClB,wBAAwB;QACxB,iDAAiD;QACjD,4BAA4B;QAC5B,qCAAqC;QACrC,cAAc,EAAE,eAAe;KAChC,CAAC;IAEF,IAAM,wBAAwB,GAAY;QACxC,MAAM,EAAE;YACN,KAAK,EAAE,cAAc;SACtB;KACF,CAAC;IAEF,SAAS,mBAAmB,CAAC,KAAc;QACzC,IAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;QAE9B,OAAO,CAAC,MAAM,CAAC,cAAc,EAAE,kBAAkB,CAAC,CAAC;QACnD,IAAI,KAAK,EAAE;YACT,OAAO,CAAC,MAAM,CAAC,eAAe,EAAE,YAAU,KAAO,CAAC,CAAC;SACpD;QAED,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,SAAS,gBAAgB,CAAC,IAAY,EAAE,IAAY,EAAE,KAAe;QACnE,IAAM,OAAO,GAAG;YACd,OAAO,EAAE,IAAI;YACb,IAAI,MAAA;YACJ,IAAI,MAAA;YACJ,aAAa,EAAE,CAAC,GAAG,CAAC;YACpB,aAAa,EAAE,EAAE;YACjB,eAAe,EAAE,EAAE;YACnB,KAAK,EAAE,KAAK,aAAL,KAAK,cAAL,KAAK,GAAI,wBAAwB;YACxC,OAAO,EAAE;gBACP,QAAQ,EAAE,oBAAoB;aAC/B;SACF,CAAC;QAEF,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;IACjC,CAAC;IAED,SAAe,eAAe,CAC5B,GAAW,EAAE,IAAkB;;;;;;;wBAGjB,qBAAM,KAAK,CAAC,GAAG,EAAE,IAAI,CAAC,EAAA;;wBAA5B,GAAG,GAAG,SAAsB;6BAC3B,GAAG,CAAC,EAAE,EAAN,wBAAM;wBAAI,qBAAM,GAAG,CAAC,IAAI,EAAE,EAAA;;wBAAjB,MAAC,SAAgB,CAAC,CAAA;;;wBAAG,KAAA,SAAS,CAAA;;4BAA9C,0BAA+C;;;wBAE/C,sBAAO,SAAS,EAAC;;;;SAEpB;KAAA;IAED,SAAe,WAAW,CACxB,GAAW,EAAE,KAAc,EAAE,KAAe;;;;;;;wBAEtC,WAAW,GAAG,4BAA4B,CAAC;wBAC3C,OAAO,GAAG,mBAAmB,CAAC,KAAK,CAAC,CAAC;wBACrC,IAAI,GAAG,gBAAgB,CAAC,CAAC,EAAE,WAAW,EAAE,KAAK,CAAC,CAAC;wBACjC,qBAAM,eAAe,CAAC,GAAG,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,SAAA,EAAE,IAAI,MAAA,EAAE,CAAC,EAAA;;wBAA3E,WAAW,GAAG,SAA6D;wBACjF,IAAI,CAAC,WAAW,EAAE;4BAChB,sBAAO,SAAS,EAAC;yBAClB;wBAEK,UAAU,GAAG,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC;wBAChD,IAAI,UAAU,IAAI,WAAW,EAAE;4BAC7B,sBAAO,WAAW,EAAC;yBACpB;wBAEK,QAAQ,GAA4C,EAAE,CAAC;wBAC7D,KAAS,IAAI,GAAG,WAAW,EAAE,IAAI,GAAG,UAAU,EAAE,IAAI,IAAI,WAAW,EAAE;4BACnE,QAAQ,CAAC,IAAI,CAAC,eAAe,CAAC,GAAG,EAAE;gCACjC,MAAM,EAAE,MAAM;gCACd,OAAO,SAAA;gCACP,IAAI,EAAE,gBAAgB,CAAC,IAAI,EAAE,WAAW,EAAE,KAAK,CAAC;6BACjD,CAAC,CAAC,CAAC;yBACL;wBAEe,qBAAM,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAA;;wBAArC,OAAO,GAAG,SAA2B;wBAC3C,IAAI,OAAO,CAAC,IAAI,CAAC,UAAA,GAAG,IAAI,OAAA,CAAC,GAAG,GAAA,CAAC,EAAE;4BAC7B,sBAAO,SAAS,EAAC;yBAClB;wBAEK,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,UAAA,GAAG,IAAI,OAAA,GAAI,CAAC,IAAI,CAAC,IAAI,GAAA,CAAC,CAAC;wBACjD,sDACK,WAAW,KACd,IAAI,kCACC,WAAW,CAAC,IAAI,KACnB,IAAI,EAAE,CAAA,KAAA,WAAW,CAAC,IAAI,CAAC,IAAI,EAAC,MAAM,oCAAI,KAAK,GAAC,QAE9C;;;SACH;KAAA;IAED;;;;;;;;;;;aAWsB,YAAY,CAChC,OAAe,EAAE,WAAoC,EACrD,KAAe,EAAE,YAAqB,EAAE,SAAc,EAAE,SAAc;QAA9B,0BAAA,EAAA,cAAc;QAAE,0BAAA,EAAA,cAAc;;;;;;8BAGlE,WAAW,KAAK,QAAQ,CAAA,EAAxB,wBAAwB;wBACb,qBAAM,eAAe,CAAC,OAAO,CAAC,EAAA;;wBAA3C,UAAU,GAAG,SAA8B,CAAC;;;8BACnC,WAAW,KAAK,YAAY,CAAA,EAA5B,wBAA4B;wBACxB,qBAAM,WAAW,CAAC,OAAO,EAAE,YAAY,EAAE,KAAK,CAAC,EAAA;;wBAA5D,UAAU,GAAG,SAA+C,CAAC;;;wBAG/D,IAAI,UAAU,EAAE;4BACd,sBAAO,sBAAsB,CAAC,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,YAAY,CAAC,EAAC;yBAC/E;6BAAM;4BACL,OAAO,CAAC,IAAI,CAAC,oBAAkB,OAAO,oBAAiB,CAAC,CAAC;4BACzD,sBAAO,SAAS,EAAC;yBAClB;;;;SACF;KAAA;IAED;;;;;;;aAOsB,oBAAoB,CACxC,KAAY,EAAE,OAAe,EAAE,WAAoC,EAAE,YAAqB,EAAE,SAAc,EAAE,SAAc;QAA9B,0BAAA,EAAA,cAAc;QAAE,0BAAA,EAAA,cAAc;;;;;4BAEvG,qBAAM,YAAY,CAAC,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,YAAY,EAAE,SAAS,EAAE,SAAS,CAAC,EAAA;;wBAApG,UAAU,GAAG,SAAuF;6BACtG,UAAU,EAAV,wBAAU;wBACZ,qBAAMC,iCAAgB,CAAC,UAAU,EAAE,KAAK,CAAC,EAAA;;wBAAzC,SAAyC,CAAC;;;;;SAE7C;;;IC3KD,SAAS,UAAU,CAAC,KAAY,EAAE,GAAgB,EAAE,SAAiB;;QACnE,IAAM,OAAO,GAAG,IAAI,GAAG,EAAU,CAAC;;YAClC,KAAiB,IAAA,QAAA,SAAA,GAAG,CAAA,wBAAA,yCAAE;gBAAjB,IAAM,EAAE,gBAAA;;oBACX,KAAmB,IAAA,oBAAA,SAAAhB,0BAAS,CAAC,KAAK,EAAE,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA,CAAA,gBAAA,4BAAE;wBAA3D,IAAM,IAAI,WAAA;wBACb,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;qBAC7B;;;;;;;;;aACF;;;;;;;;;QACD,OAAO,OAAO,CAAC;IACjB,CAAC;IAED;;;;;;;aAOgB,mBAAmB,CAAC,GAAgB,EAAE,KAAY;;QAChE,IAAM,MAAM,GAAG,UAAU,CAAC,KAAK,EAAE,GAAG,EAAE,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QACvD,IAAM,OAAO,GAAG,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC;QAElE,IAAM,YAAY,GAAG,IAAI,GAAG,EAAU,CAAC;;YACvC,KAAiB,IAAA,QAAA,SAAA,GAAG,CAAA,wBAAA,yCAAE;gBAAjB,IAAM,EAAE,gBAAA;;oBACX,KAAmB,IAAA,oBAAA,SAAAA,0BAAS,CAAC,KAAK,EAAE,EAAE,EAAE,MAAM,CAAC,aAAa,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA,CAAA,gBAAA,4BAAE;wBAAtE,IAAM,IAAI,WAAA;wBACb,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;qBACnC;;;;;;;;;aACF;;;;;;;;;QAED,IAAM,cAAc,GAAG,UAAU,CAAC,KAAK,EAAE,YAAY,EAAE,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;QAC3E,IAAM,cAAc,GAAG,IAAI,GAAG,wCACzB,UAAU,CAAC,KAAK,EAAE,YAAY,EAAE,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,WACnD,UAAU,CAAC,KAAK,EAAE,cAAc,EAAE,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,GACxD,CAAC;QAEH,IAAM,OAAO,GAA8B;YACzC,uBAAuB,EAAE,OAAO,CAAC,IAAI;YACrC,MAAM,EAAE,MAAM,CAAC,IAAI;YACnB,eAAe,EAAE,YAAY,CAAC,IAAI;YAClC,iBAAiB,EAAE,cAAc,CAAC,IAAI;YACtC,iBAAiB,EAAE,cAAc,CAAC,IAAI;SACvC,CAAC;QAEF,OAAO,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,UAAC,EAAc;gBAAd,KAAA,aAAc,EAAb,KAAK,QAAA,EAAE,KAAK,QAAA;YAAM,QAAC,EAAE,KAAK,OAAA,EAAE,KAAK,OAAA,EAAE;SAAC,CAAC,CAAC;IAC7E,CAAC;IAED;;;;;;aAMgB,yBAAyB,CAAC,KAAY;;QACpD,IAAM,KAAK,GAAG,IAAI,GAAG,EAAU,CAAC;;YAChC,KAAmB,IAAA,KAAA,SAAAA,0BAAS,CAAC,KAAK,EAAE,IAAI,EAAE,MAAM,CAAC,UAAU,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA,gBAAA,4BAAE;gBAArE,IAAM,IAAI,WAAA;gBACb,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;aAC9B;;;;;;;;;QACD,OAAO,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,CAAC;IAClC,CAAC;IAED;;;;;;aAMgB,gBAAgB,CAAC,KAAY;;QAC3C,IAAM,KAAK,GAAG,IAAI,GAAG,EAAU,CAAC;;YAChC,KAAmB,IAAA,KAAA,SAAAA,0BAAS,CAAC,KAAK,EAAE,IAAI,EAAE,MAAM,CAAC,YAAY,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA,gBAAA,4BAAE;gBAAvE,IAAM,IAAI,WAAA;gBACb,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;aAC9B;;;;;;;;;QACD,OAAO,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,CAAC;IAClC;;;ICpEA,IAAM,uBAAuB;QAC3BiB,KAAC,GAAG,CAAC,aAAa,CAAC,WAAW,CAAC,EAAE,IAAG,GAAG;QACvCA,KAAC,GAAG,CAAC,aAAa,CAAC,WAAW,CAAC,EAAE,IAAG,GAAG;QACvCA,KAAC,GAAG,CAAC,aAAa,CAAC,WAAW,CAAC,EAAE,IAAG,GAAG;aACxC,CAAC;IAEF,SAAS,0BAA0B,CAAC,KAAY,EAAE,GAAW;QAC3D,IAAM,IAAI,GAAG,eAAe,CAAsC,KAAK,EAAE,GAAG,EAAE,YAAY,EAAE,uBAAuB,CAAC,CAAC;QACrH,OAAO,CAAE,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAE,CAAC;IACpC,CAAC;aAEe,sBAAsB,CAAC,KAAY,EAAE,KAAsB,EAAE,SAAiB,EAAE,SAAiB;QAC/G,IAAM,MAAM,GAAG,KAAK,CAAC,uBAAuB,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;QACnE,IAAI,MAAM,GAAoC,SAAS,CAAC;QACxD,IAAI,MAAM,EAAE;YACV,IAAM,MAAM,GAAG,MAAM,CAAC,cAAc,EAAE,CAAC;YACvC,IAAM,QAAQ,GAAG,0BAA0B,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC,GAAG,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,GAAG,IAAI,GAAG,CAAC,GAAA,CAAC,CAAC;YACrF,IAAM,UAAU,GAAG,IAAIP,UAAK,EAAE,CAAC,kBAAkB,CAAC,MAAM,EAAEA,UAAK,CAAC,GAAG,CAAC,CAAC,YAAY,EAAE,CAAC,SAAS,EAAE,CAAC,UAAU,EAAE,CAAC;YAC7G,MAAM,GAAG,IAAIQ,2BAAmB,EAAE,CAAC,4BAA4B,CAAC,MAAM,EAAE,QAAQ,EAAE,UAAU,CAAC,CAAC;SAC/F;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;aAEe,qBAAqB,CAAC,KAAY,EAAE,KAAsB,EAAE,IAAiB,EAAE,MAAqB;;QAC1G,IAAA,CAAC,GAA2B,MAAM,EAAjC,EAAE,CAAC,GAAwB,MAAM,EAA9B,EAAE,CAAC,GAAqB,MAAM,EAA3B,EAAE,MAAM,GAAa,MAAM,OAAnB,EAAE,MAAM,GAAK,MAAM,OAAX,CAAY;QAC3C,IAAM,OAAO,GAAG,IAAI,GAAG,EAAU,CAAC;QAClC,IAAM,aAAa,GAAG,CAAC,MAAM,GAAG,IAAI,KAAK,MAAM,GAAG,IAAI,CAAC,CAAC;;YACxD,KAAwB,IAAA,SAAA,SAAA,IAAI,CAAA,0BAAA,4CAAE;gBAAzB,IAAM,SAAS,iBAAA;gBAClB,IAAM,WAAW,GAAG,sBAAsB,CAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;gBAC5E,IAAI,WAAW,EAAE;oBACf,IAAM,eAAe,GAAG,WAAW,CAAC,iBAAiB,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,GAAG,IAAI,GAAA,CAAC,CAAC,CAAC;oBACpF,IAAI,eAAe,IAAI,aAAa,EAAE;wBACpC,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;qBACxB;iBACF;aACF;;;;;;;;;QACD,OAAO,OAAO,CAAC;IACjB;;ICrCA,SAAS,eAAe,CAAC,KAAY,EAAE,IAAiB,EAAE,QAAkD;;;QAC1G,IAAM,YAAY,GAAG,IAAI,GAAG,EAAoB,CAAC;QACjD,IAAM,MAAM,GAAG,IAAI,GAAG,EAAU,CAAC;;YACjC,KAAsB,IAAA,SAAA,SAAA,IAAI,CAAA,0BAAA,4CAAE;gBAAvB,IAAM,OAAO,iBAAA;;oBAChB,KAAmB,IAAA,oBAAA,SAAAlB,0BAAS,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA,CAAA,gBAAA,4BAAE;wBAAnE,IAAM,IAAI,WAAA;wBACb,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;wBAC3B,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE;4BACrC,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;yBAC7C;6BAAM;4BACL,MAAA,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,0CAAE,IAAI,CAAC,OAAO,CAAC,CAAC;yBACjD;qBACF;;;;;;;;;aACF;;;;;;;;;QAED,IAAM,SAAS,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC;QACnC,IAAM,OAAO,GAAG,IAAI,GAAG,EAAU,CAAC;;YAClC,KAAgB,IAAA,cAAA,SAAA,SAAS,CAAA,oCAAA,2DAAE;gBAAtB,IAAM,CAAC,sBAAA;;oBACV,KAAgB,IAAA,oBAAA,SAAA,MAAA,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,mCAAI,EAAE,CAAA,CAAA,gBAAA,4BAAE;wBAAtC,IAAM,CAAC,WAAA;wBACV,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;qBAChB;;;;;;;;;aACF;;;;;;;;;QACD,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,SAAS,uBAAuB,CAAC,KAAY,EAAE,IAAiB,EAAE,QAAoD;;;QACpH,IAAM,cAAc,GAAG,IAAI,GAAG,EAAoB,CAAC;QACnD,IAAM,QAAQ,GAAG,IAAI,GAAG,EAAU,CAAC;;YACnC,KAAsB,IAAA,SAAA,SAAA,IAAI,CAAA,0BAAA,4CAAE;gBAAvB,IAAM,OAAO,iBAAA;;oBAChB,KAAmB,IAAA,oBAAA,SAAAA,0BAAS,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,CAAC,aAAa,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA,CAAA,gBAAA,4BAAE;wBAA3E,IAAM,IAAI,WAAA;wBACb,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;wBAC7B,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE;4BACvC,cAAc,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;yBAC/C;6BAAM;4BACL,MAAA,cAAc,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,0CAAE,IAAI,CAAC,OAAO,CAAC,CAAC;yBACnD;qBACF;;;;;;;;;aACF;;;;;;;;;QAED,IAAM,kBAAkB,GAAG,QAAQ,CAAC,QAAQ,CAAC,CAAC;QAC9C,IAAM,OAAO,GAAG,IAAI,GAAG,EAAU,CAAC;;YAClC,KAAgB,IAAA,uBAAA,SAAA,kBAAkB,CAAA,sDAAA,sFAAE;gBAA/B,IAAM,CAAC,+BAAA;;oBACV,KAAgB,IAAA,oBAAA,SAAA,MAAA,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,mCAAI,EAAE,CAAA,CAAA,gBAAA,4BAAE;wBAAxC,IAAM,CAAC,WAAA;wBACV,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;qBAChB;;;;;;;;;aACF;;;;;;;;;QACD,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,SAAS,iBAAiB,CAAC,KAAY,EAAE,IAAiB,EAAE,QAAoD;;;QAC9G,IAAM,cAAc,GAAG,IAAI,GAAG,EAAoB,CAAC;QACnD,IAAM,QAAQ,GAAG,IAAI,GAAG,EAAU,CAAC;QAEnC,IAAM,mBAAmB,GAAG,IAAI,GAAG,CAAS,IAAI,CAAC,CAAC;;YAClD,KAAsB,IAAA,SAAA,SAAA,IAAI,CAAA,0BAAA,4CAAE;gBAAvB,IAAM,OAAO,iBAAA;;oBAChB,KAAmB,IAAA,qBAAA,SAAAA,0BAAS,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,CAAC,QAAQ,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA,CAAA,gBAAA,4BAAE;wBAAtE,IAAM,IAAI,WAAA;wBACb,mBAAmB,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;qBACzC;;;;;;;;;aACF;;;;;;;;;;YAED,KAAsB,IAAA,wBAAA,SAAA,mBAAmB,CAAA,wDAAA,yFAAE;gBAAtC,IAAM,OAAO,gCAAA;;oBAChB,KAAmB,IAAA,qBAAA,SAAAA,0BAAS,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,CAAC,QAAQ,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA,CAAA,gBAAA,4BAAE;wBAAtE,IAAM,IAAI,WAAA;wBACb,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;wBAC7B,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE;4BACvC,cAAc,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;yBAC/C;6BAAM;4BACL,MAAA,cAAc,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,0CAAE,IAAI,CAAC,OAAO,CAAC,CAAC;yBACnD;qBACF;;;;;;;;;aACF;;;;;;;;;QAED,IAAM,WAAW,GAAG,QAAQ,CAAC,QAAQ,CAAC,CAAC;QACvC,IAAM,OAAO,GAAG,IAAI,GAAG,EAAU,CAAC;;YAClC,KAAgB,IAAA,gBAAA,SAAA,WAAW,CAAA,wCAAA,iEAAE;gBAAxB,IAAM,CAAC,wBAAA;;oBACV,KAAgB,IAAA,qBAAA,SAAA,MAAA,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,mCAAI,EAAE,CAAA,CAAA,gBAAA,4BAAE;wBAAxC,IAAM,CAAC,WAAA;wBACV,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;qBAChB;;;;;;;;;aACF;;;;;;;;;QACD,OAAO,OAAO,CAAC;IACjB,CAAC;IAED;;;;;;;aAOgB,OAAO,CAAC,KAAY,EAAE,KAAsB,EAAE,MAAc;;QAC1E,IAAI,IAAI,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC;QACjC,IAAI,IAAI,CAAC,IAAI,GAAG,CAAC,EAAE;YACjB,IAAI,GAAG,wBAAwB,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;SAC9C;QACD,IAAI,IAAI,CAAC,IAAI,GAAG,CAAC,KAAK,MAAM,CAAC,GAAG,KAAK,MAAM,IAAI,MAAM,CAAC,GAAG,KAAK,QAAQ,CAAC,EAAE;YACvE,IAAM,KAAG,GAAG,MAAM,CAAC,GAAG,CAAC;YACvB,IAAI,GAAG,eAAe,CAAC,KAAK,EAAE,IAAI,EAAE,UAAC,MAAM,IACzC,OAAA,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,KAAG,CAAC,GAAA,CAChC,CAAC;SACH;QACD,IAAI,IAAI,CAAC,IAAI,GAAG,CAAC,IAAI,CAAA,MAAA,MAAM,CAAC,GAAG,0CAAE,MAAM,IAAG,CAAC,EAAE;YAC3C,IAAI,GAAG,eAAe,CAAC,KAAK,EAAE,IAAI,EAAE,UAAC,MAAM,IACzC,OAAA,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,GAAA,CAC7C,CAAC;SACH;QACD,IAAI,IAAI,CAAC,IAAI,GAAG,CAAC,IAAI,CAAA,MAAA,MAAM,CAAC,YAAY,0CAAE,MAAM,IAAG,CAAC,EAAE;YACpD,IAAI,GAAG,iBAAiB,CAAC,KAAK,EAAE,IAAI,EAAE,UAAC,QAAQ,IAC7C,OAAA,kBAAkB,CAAC,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC,YAAY,CAAC,GAAA,CACzD,CAAC;SACH;QACD,IAAI,IAAI,CAAC,IAAI,GAAG,CAAC,IAAI,CAAA,MAAA,MAAM,CAAC,eAAe,0CAAE,MAAM,IAAG,CAAC,EAAE;YACvD,IAAI,GAAG,uBAAuB,CAAC,KAAK,EAAE,IAAI,EAAE,UAAC,QAAQ,IACnD,OAAA,uBAAuB,CAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC,eAAe,CAAC,GAAA,CACxE,CAAC;SACH;QACD,IAAI,IAAI,CAAC,IAAI,GAAG,CAAC,IAAI,CAAA,MAAA,MAAM,CAAC,aAAa,0CAAE,MAAM,IAAG,CAAC,EAAE;YACrD,IAAM,OAAK,GAAG,MAAM,CAAC,aAAa,CAAC;YACnC,IAAI,OAAK,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE;gBACrC,IAAI,GAAG,uBAAuB,CAAC,KAAK,EAAE,IAAI,EAAE,UAAC,QAAQ,IACnD,OAAA,qBAAqB,CAAC,KAAK,EAAE,QAAQ,EAAE,OAAK,CAAC,GAAA,CAC9C,CAAC;aACH;SACF;QACD,IAAI,IAAI,CAAC,IAAI,GAAG,CAAC,IAAI,CAAA,MAAA,MAAM,CAAC,aAAa,0CAAE,MAAM,IAAG,CAAC,EAAE;YACrD,IAAM,OAAK,GAAG,MAAM,CAAC,aAAa,CAAC;YACnC,IAAI,OAAK,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE;gBACrC,IAAI,GAAG,uBAAuB,CAAC,KAAK,EAAE,IAAI,EAAE,UAAC,QAAQ,IACnD,OAAA,qBAAqB,CAAC,KAAK,EAAE,QAAQ,EAAE,OAAK,CAAC,GAAA,CAC9C,CAAC;aACH;SACF;QACD,IAAI,IAAI,CAAC,IAAI,GAAG,CAAC,IAAI,CAAA,MAAA,MAAM,CAAC,QAAQ,0CAAE,MAAM,MAAK,CAAC;YAChDmB,eAAQ,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAIA,eAAQ,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE;YAC9D,IAAM,QAAM,GAAG,IAAI,CAAC,GAAG,OAAR,IAAI,2BAAQ,MAAM,CAAC,QAAQ,GAAC,CAAC;YAC5C,IAAM,QAAM,GAAG,IAAI,CAAC,GAAG,OAAR,IAAI,2BAAQ,MAAM,CAAC,QAAQ,GAAC,CAAC;;YAG5C,IAAI,EAAE,QAAM,KAAK,CAAC,IAAI,QAAM,KAAK,GAAG,CAAC,EAAE;gBACrC,IAAI,GAAG,eAAe,CAAC,KAAK,EAAE,IAAI,EAAE,UAAC,MAAM,IACzC,OAAA,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,QAAM,EAAE,QAAM,CAAC,GAAA,CAC3C,CAAC;aACH;SACF;QACD,IAAI,IAAI,CAAC,IAAI,GAAG,CAAC,IAAI,CAAA,MAAA,MAAM,CAAC,QAAQ,0CAAE,MAAM,MAAK,CAAC;YAChDA,eAAQ,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAIA,eAAQ,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE;YAC9D,IAAM,QAAM,GAAG,IAAI,CAAC,GAAG,OAAR,IAAI,2BAAQ,MAAM,CAAC,QAAQ,GAAC,CAAC;YAC5C,IAAM,QAAM,GAAG,IAAI,CAAC,GAAG,OAAR,IAAI,2BAAQ,MAAM,CAAC,QAAQ,GAAC,CAAC;;YAG5C,IAAI,EAAE,QAAM,KAAK,EAAE,IAAI,QAAM,KAAK,EAAE,CAAC,EAAE;gBACrC,IAAI,GAAG,eAAe,CAAC,KAAK,EAAE,IAAI,EAAE,UAAC,MAAM,IACzC,OAAA,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,QAAM,EAAE,QAAM,CAAC,GAAA,CAC3C,CAAC;aACH;SACF;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;;;IAMA,SAAS,cAAc,CAAC,KAAY;QAClC,IAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAC;QAC/B,KAAK,CAAC,WAAW,CAAC,UAAC,CAAC,IAAK,OAAA,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,GAAA,EAAE,MAAM,CAAC,aAAa,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;QAC3E,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;;;;IAOA,SAAS,kBAAkB,CAAC,IAAiB,EAAE,OAAoB;QACjE,OAAO,UAAU,IAAU;YACzB,IAAI,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE;gBACrB,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;aACtB;SACF,CAAC;IACJ,CAAC;IAED;;;;;;;;IAQA,SAAS,WAAW,CAAC,KAAY,EAAE,IAAiB,EAAE,GAAsB;QAC1E,IAAM,OAAO,GAAG,IAAI,GAAG,EAAU,CAAC;QAClC,KAAK,CAAC,WAAW,CAAC,kBAAkB,CAAC,IAAI,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,CAAC;QACpF,OAAO,OAAO,CAAC;IACjB,CAAC;IAED;;;;;;;;IAQA,SAAS,iBAAiB,CAAC,KAAY,EAAE,IAAiB,EAAE,UAAoB;;QAC9E,IAAM,OAAO,GAAG,IAAI,GAAG,EAAU,CAAC;;YAClC,KAAwB,IAAA,eAAA,SAAA,UAAU,CAAA,sCAAA,8DAAE;gBAA/B,IAAM,SAAS,uBAAA;gBAClB,IAAM,OAAO,GAAGhB,4BAAW,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;gBAC/C,KAAK,CAAC,WAAW,CAAC,kBAAkB,CAAC,IAAI,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,YAAY,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;aAC1F;;;;;;;;;QACD,OAAO,OAAO,CAAC;IACjB,CAAC;IAED;;;;;;;;IAQA,SAAS,kBAAkB,CAAC,KAAY,EAAE,IAAiB,EAAE,YAAsB;;QACjF,IAAM,OAAO,GAAG,IAAI,GAAG,EAAU,CAAC;;YAClC,KAAyB,IAAA,iBAAA,SAAA,YAAY,CAAA,0CAAA,oEAAE;gBAAlC,IAAM,UAAU,yBAAA;gBACnB,IAAM,OAAO,GAAGA,4BAAW,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;gBAChD,KAAK,CAAC,WAAW,CAAC,kBAAkB,CAAC,IAAI,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,UAAU,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;aACxF;;;;;;;;;QACD,OAAO,OAAO,CAAC;IACjB,CAAC;IAED;;;;;;;;IAQA,SAAS,qBAAqB,CAAC,KAAY,EAAE,IAAiB,EAAE,KAAe;;QAC7E,IAAM,OAAO,GAAG,IAAI,GAAG,EAAU,CAAC;;YAClC,KAAmB,IAAA,UAAA,SAAA,KAAK,CAAA,4BAAA,+CAAE;gBAArB,IAAM,IAAI,kBAAA;gBACb,IAAM,SAAS,GAAGA,4BAAW,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;gBAC9C,KAAK,CAAC,WAAW,CAAC,kBAAkB,CAAC,IAAI,EAAE,OAAO,CAAC,EAAE,GAAG,CAAC,aAAa,CAAC,eAAe,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC;aAC1G;;;;;;;;;QACD,OAAO,OAAO,CAAC;IACjB,CAAC;IAED;;;;;;;;IAQA,SAAS,qBAAqB,CAAC,KAAY,EAAE,IAAiB,EAAE,KAAe;;QAC7E,IAAM,OAAO,GAAG,IAAI,GAAG,EAAU,CAAC;;YAClC,KAAmB,IAAA,UAAA,SAAA,KAAK,CAAA,4BAAA,+CAAE;gBAArB,IAAM,IAAI,kBAAA;gBACb,KAAK,CAAC,UAAU,CAAC,UAAC,MAAM;oBACtB,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;iBACxB,EAAE,IAAI,EAAE,GAAG,CAAC,KAAK,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;gBACrC,IAAI,IAAI,KAAK,GAAG,CAAC,IAAI,CAAC,EAAE,EAAE;oBACxB,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;iBAC1B;aACF;;;;;;;;;QACD,OAAO,qBAAqB,CAAC,KAAK,EAAE,IAAI,2BAAM,OAAO,GAAE,CAAC;IAC1D,CAAC;IAED;;;;;;;;;IASA,SAAS,WAAW,CAAC,KAAY,EAAE,IAAiB,EAAE,MAAc,EAAE,MAAc;;QAClF,IAAM,OAAO,GAAG,IAAI,GAAG,EAAU,CAAC;;YAClC,KAAsB,IAAA,SAAA,SAAA,IAAI,CAAA,0BAAA,4CAAE;gBAAvB,IAAM,OAAO,iBAAA;;oBAChB,KAAmB,IAAA,qBAAA,SAAAH,0BAAS,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,CAAC,GAAG,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA,CAAA,gBAAA,4BAAE;wBAAjE,IAAM,IAAI,WAAA;wBACb,IAAM,KAAK,GAAGC,kBAAO,CAAC,IAAI,CAAC,MAAiB,CAAW,CAAC;wBACxD,IAAI,KAAK,IAAI,MAAM,IAAI,KAAK,IAAI,MAAM,EAAE;4BACtC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;yBACtB;qBACF;;;;;;;;;aACF;;;;;;;;;QACD,OAAO,OAAO,CAAC;IACjB,CAAC;IAED;;;;;;;;;IASA,SAAS,WAAW,CAAC,KAAY,EAAE,IAAiB,EAAE,MAAc,EAAE,MAAc;;QAClF,IAAM,OAAO,GAAG,IAAI,GAAG,EAAU,CAAC;;YAClC,KAAsB,IAAA,SAAA,SAAA,IAAI,CAAA,0BAAA,4CAAE;gBAAvB,IAAM,OAAO,iBAAA;;oBAChB,KAAmB,IAAA,qBAAA,SAAAD,0BAAS,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,CAAC,GAAG,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA,CAAA,gBAAA,4BAAE;wBAAjE,IAAM,IAAI,WAAA;wBACb,IAAM,KAAK,GAAGC,kBAAO,CAAC,IAAI,CAAC,MAAiB,CAAW,CAAC;wBACxD,IAAI,KAAK,IAAI,MAAM,IAAI,KAAK,IAAI,MAAM,EAAE;4BACtC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;yBACtB;qBACF;;;;;;;;;aACF;;;;;;;;;QACD,OAAO,OAAO,CAAC;IACjB,CAAC;IAED;;;;;;;;IAQA,SAAS,wBAAwB,CAAC,KAAY,EAAE,IAAiB,EAAE,gBAAuB;QAAvB,iCAAA,EAAA,uBAAuB;QACxF,IAAM,OAAO,GAAG,IAAI,GAAG,EAAU,CAAC;QAClC,KAAK,CAAC,WAAW,CAAC,kBAAkB,CAAC,IAAI,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,aAAa,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;QACvF,IAAI,CAAC,gBAAgB,EAAE;YACrB,IAAM,YAAU,GAAG,IAAI,GAAG,EAAU,CAAC;YACrC,IAAI,CAAC,OAAO,CAAC,UAAC,CAAC,IAAK,OAAA,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,YAAU,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,SAAS,GAAA,CAAC,CAAC;YACrE,OAAO,YAAU,CAAC;SACnB;QACD,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,SAAS,uBAAuB,CAAC,KAAY,EAAE,KAAsB,EAAE,IAAiB,EAAE,eAAgC;;QACxH,IAAM,OAAO,GAAG,IAAI,GAAG,EAAU,CAAC;;YAClC,KAAqB,IAAA,oBAAA,SAAA,eAAe,CAAA,gDAAA,6EAAE;gBAAjC,IAAM,MAAM,4BAAA;gBACf,IAAM,QAAQ,GAAG,qBAAqB,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;gBACnE,QAAQ,CAAC,OAAO,CAAC,UAAC,CAAC,IAAK,OAAA,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,GAAA,CAAC,CAAC;aACzC;;;;;;;;;QACD,OAAO,OAAO,CAAC;IACjB;;ICxVA,SAAS,uBAAuB,CAAC,QAAqB,EAAE,KAAY;;QAClE,IAAM,cAAc,GAAG,IAAI,GAAG,EAAuB,CAAC;;YAEtD,KAAsB,IAAA,aAAA,SAAA,QAAQ,CAAA,kCAAA,wDAAE;gBAA3B,IAAM,OAAO,qBAAA;;oBAChB,KAAmB,IAAA,oBAAA,SAAAD,0BAAS,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,CAAC,aAAa,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA,CAAA,gBAAA,4BAAE;wBAA3E,IAAM,IAAI,WAAA;wBACb,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE;4BACvC,cAAc,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,IAAI,GAAG,CAAS,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;yBAChE;6BAAM;4BACL,cAAc,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAE,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;yBAClD;qBACF;;;;;;;;;aACF;;;;;;;;;QACD,OAAO,cAAc,CAAC;IACxB,CAAC;IAED,SAAS,6BAA6B,CAAC,GAAgB,EAAE,KAAY;;QACnE,IAAM,cAAc,GAAG,uBAAuB,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QAC3D,IAAM,WAAW,GAAG,IAAI,GAAG,EAAuB,CAAC;;YAEnD,KAAsB,IAAA,KAAA,SAAA,cAAc,CAAC,IAAI,EAAE,CAAA,gBAAA,4BAAE;gBAAxC,IAAM,OAAO,WAAA;gBAChB,IAAM,QAAQ,GAAG,cAAc,CAAC,GAAG,CAAC,OAAO,CAAE,CAAC;wCACnC,IAAI;oBACb,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE;wBACpC,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,IAAI,GAAG,CAAS,QAAQ,CAAC,CAAC,CAAC;qBAC5D;yBAAM;wBACL,IAAM,cAAY,GAAG,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAE,CAAC;wBACtD,QAAQ,CAAC,OAAO,CAAC,UAAC,KAAK,IAAK,OAAA,cAAY,CAAC,GAAG,CAAC,KAAK,CAAC,GAAA,CAAC,CAAC;qBACtD;;;oBANH,KAAmB,IAAA,oBAAA,SAAAA,0BAAS,CAAC,KAAK,EAAE,OAAO,EAAE,GAAG,CAAC,aAAa,CAAC,eAAe,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA,CAAA,gBAAA;wBAAtF,IAAM,IAAI,WAAA;gCAAJ,IAAI;qBAOd;;;;;;;;;aACF;;;;;;;;;QACD,OAAO,WAAW,CAAC;IACrB,CAAC;IAED;;;;;;;aAOgB,yBAAyB,CAAC,GAAgB,EAAE,KAAY;QACtE,IAAM,MAAM,GAA2B,EAAE,CAAC;QAC1C,IAAM,aAAa,GAAG,6BAA6B,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QAEhE,aAAa,CAAC,OAAO,CAAC,UAAC,KAAK,EAAE,GAAG;YAC/B,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC;SAC1B,CAAC,CAAC;QAEH,OAAO,MAAM,CAAC;IAChB,CAAC;IAED;;;;;;;aAOgB,yBAAyB,CAAC,GAAgB,EAAE,KAAY;;;QACtE,IAAM,eAAe,GAAG,6BAA6B,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QAClE,IAAM,eAAe,GAAG,IAAI,GAAG,EAAuB,CAAC;;YAEvD,KAAqB,IAAA,KAAA,SAAA,eAAe,CAAC,IAAI,EAAE,CAAA,gBAAA,4BAAE;gBAAxC,IAAM,MAAM,WAAA;gBACf,IAAM,QAAQ,GAAG,eAAe,CAAC,GAAG,CAAC,MAAM,CAAE,CAAC;wCACnC,IAAI;oBACb,IAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;oBACjC,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE;wBAClC,eAAe,CAAC,GAAG,CAAC,QAAQ,EAAE,IAAI,GAAG,CAAS,QAAQ,CAAC,CAAC,CAAC;qBAC1D;yBAAM;wBACL,IAAM,cAAY,GAAG,eAAe,CAAC,GAAG,CAAC,QAAQ,CAAE,CAAC;wBACpD,QAAQ,CAAC,OAAO,CAAC,UAAC,KAAK,IAAK,OAAA,cAAY,CAAC,GAAG,CAAC,KAAK,CAAC,GAAA,CAAC,CAAC;qBACtD;;;oBAPH,KAAmB,IAAA,oBAAA,SAAAA,0BAAS,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,CAAC,KAAK,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,CAAC,CAAA,CAAA,gBAAA;wBAAxE,IAAM,IAAI,WAAA;gCAAJ,IAAI;qBAQd;;;;;;;;;aACF;;;;;;;;;QAED,IAAM,MAAM,GAA2B,EAAE,CAAC;QAE1C,eAAe,CAAC,OAAO,CAAC,UAAC,KAAK,EAAE,GAAG;YACjC,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC;SAC1B,CAAC,CAAC;QAEH,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,MAAA,MAAA,eAAe,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,0CAAE,IAAI,mCAAI,CAAC,CAAC;QAElE,OAAO,MAAM,CAAC;IAChB;;aClFgB,mBAAmB,CAAC,KAAY,EAAE,GAAW,EAAE,eAAuB;;QACpF,IAAM,MAAM,GAAqB;YAC/B,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,kBAAkB,EAAE,EAAE,EAAE,GAAG,EAAE,MAAM,EAAE,EAAE;YAC5D,QAAQ,EAAE,EAAc,EAAE,aAAa,EAAE,EAAc,EAAE,KAAK,EAAE,EAAE;SACnE,CAAC;QAEF,IAAM,sBAAsB;YAC1B,GAAC,GAAG,CAAC,YAAY,CAAC,KAAK,CAAC,EAAE,IAAG,OAAO;YACpC,GAAC,eAAe,IAAG,QAAQ;YAC3B,GAAC,GAAG,CAAC,YAAY,CAAC,aAAa,CAAC,EAAE,IAAG,eAAe;eACrD,CAAC;;YAEF,KAA2B,IAAA,KAAA,SAAA,UAAU,CAAC,KAAK,EAAE,GAAG,EAAE,sBAAsB,CAAC,CAAA,gBAAA,4BAAE;gBAAhE,IAAA,KAAA,mBAAY,EAAX,GAAG,QAAA,EAAE,KAAK,QAAA;gBACpB,IAAI,GAAG,KAAK,eAAe,EAAE;oBAC3B,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,KAAe,CAAC,CAAC;iBAC5C;qBAAM;oBACL,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;iBACrB;aACF;;;;;;;;;QACD,MAAM,CAAC,QAAQ,GAAG,KAAK,CAAC,WAAW,CAAC,eAAe,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC,GAAG,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,EAAE,GAAA,CAAC,CAAC;QAE/E,OAAO,MAAM,CAAC;IAChB,CAAC;aAEe,oBAAoB,CAAC,KAAY,EAAE,OAAe,EAAE,SAAiB,EAAE,eAAuB;;QAC5G,IAAM,MAAM,GAAsB,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC;QAC/D,IAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAC;;YAC/B,KAAmB,IAAA,KAAA,SAAAA,0BAAS,CAAC,KAAK,EAAE,IAAI,EAAE,eAAe,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA,gBAAA,4BAAE;gBAAnE,IAAM,IAAI,WAAA;gBACb,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;gBAC1B,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;aAC1B;;;;;;;;;;YAED,KAAkB,IAAA,SAAA,SAAA,IAAI,CAAA,0BAAA,4CAAE;gBAAnB,IAAM,GAAG,iBAAA;gBACZ,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,mBAAmB,CAAC,KAAK,EAAE,GAAG,EAAE,eAAe,CAAC,CAAC;aACtE;;;;;;;;;QAED,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE;YAC1B,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG;gBACtB,KAAK,EAAE,OAAO;gBACd,OAAO,EAAE,kBAAkB;gBAC3B,EAAE,EAAE,OAAO;gBACX,KAAK,EAAE,SAAS;gBAChB,QAAQ,EAAE,EAAE;gBACZ,aAAa,EAAE,EAAE;aACa,CAAC;SAClC;QAED,IAAM,YAAY,GAAG,KAAK;aACvB,WAAW,CAAC,eAAe,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC,GAAG,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,EAAE,GAAA,CAAC;aAC1D,IAAI,CAAC,UAAC,CAAC,EAAE,CAAC,IAAK,OAAA,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,aAAa,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAA,CAAC,CAAC;QAC9E,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,QAAQ,GAAG,YAAY,CAAC;QAE9C,OAAO,CAAC,MAAM,CAAC,CAAC;QAEhB,OAAO,MAAM,CAAC;IAChB,CAAC;IAED;;;;;;;IAOA,SAAS,OAAO,CAAC,KAAwB,EAAE,OAAuC,EAAE,IAA6B;;QAAtE,wBAAA,EAAA,mBAAuC;QAAE,qBAAA,EAAA,WAAwB,GAAG,EAAE;QAC/G,IAAM,IAAI,GAAG,KAAK,CAAC,KAAK,CAAC,OAAO,aAAP,OAAO,cAAP,OAAO,GAAI,KAAK,CAAC,IAAI,CAAC,CAAC;QAChD,IAAI,IAAI,EAAE;YACR,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,GAAA,CAAC,CAAC;YACxD,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,UAAA,CAAC,IAAI,OAAA,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,GAAA,CAAC,CAAC;;gBACxC,KAAsB,IAAA,KAAA,SAAA,IAAI,CAAC,QAAQ,CAAA,gBAAA,4BAAE;oBAAhC,IAAM,OAAO,WAAA;oBAChB,OAAO,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;oBAC9B,IAAI,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE;wBACxB,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC;qBAC3C;iBACF;;;;;;;;;SACF;IACH,CAAC;aAEe,qCAAqC,CAAC,KAAY;QAChE,IAAM,KAAK,GAAG,oBAAoB,CAAC,KAAK,EAAE,GAAG,CAAC,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QACrF,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,QAAQ,GAAG;YAClC,+CAA+C;YAC/C,+CAA+C;;YAE/C,+CAA+C;;;YAG/C,+CAA+C;;;YAG/C,+CAA+C;YAC/C,+CAA+C;;;YAG/C,+CAA+C;;;YAG/C,+CAA+C;YAC/C,+CAA+C;YAC/C,+CAA+C;;;YAG/C,+CAA+C;;;YAG/C,+CAA+C;YAC/C,+CAA+C;YAC/C,+CAA+C;YAC/C,+CAA+C;YAC/C,+CAA+C;YAC/C,+CAA+C;YAC/C,+CAA+C;YAC/C,+CAA+C;YAC/C,+CAA+C;YAC/C,+CAA+C;YAC/C,+CAA+C;;;YAG/C,+CAA+C;YAC/C,+CAA+C;YAC/C,+CAA+C;SAChD,CAAC,MAAM,CAAC,UAAA,GAAG,IAAI,OAAA,GAAG,IAAI,KAAK,CAAC,KAAK,GAAA,CAAC,CAAC;QACpC,OAAO,KAAK,CAAC;IACf,CAAC;IAEM,IAAM,+BAA+B,GAAGoB,cAAO,CAAC,qCAAqC,EAAE,cAAM,OAAA,EAAE,GAAA,CAAC,CAAC;aAExF,oBAAoB,CAAC,KAAY;QAC/C,OAAO,oBAAoB,CAAC,KAAK,EAAE,GAAG,CAAC,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IAChF;;;IClIA;IACA,IAAM,aAAa;QACjB,GAAC,MAAM,CAAC,KAAK,CAAC,EAAE,IAAG,OAAO;QAC1B,GAAC,MAAM,CAAC,WAAW,CAAC,EAAE,IAAG,aAAa;QACtC,GAAC,MAAM,CAAC,IAAI,CAAC,EAAE,IAAG,MAAM;WACzB,CAAC;IAEF,IAAM,cAAc,mCACf,aAAa,aAChB,GAAC,MAAM,CAAC,YAAY,CAAC,EAAE,IAAG,cAAc,MACzC,CAAC;IAEF,IAAM,gBAAgB,mCACjB,aAAa,aAChB,GAAC,MAAM,CAAC,UAAU,CAAC,EAAE,IAAG,YAAY,EACpC,GAAC,MAAM,CAAC,SAAS,CAAC,EAAE,IAAG,WAAW,MACnC,CAAC;IAEF,IAAM,sBAAsB,mCACvB,aAAa,aAChB,GAAC,MAAM,CAAC,UAAU,CAAC,EAAE,IAAG,YAAY,EACpC,GAAC,MAAM,CAAC,aAAa,CAAC,EAAE,IAAG,eAAe,EAC1C,GAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,IAAG,UAAU,MACjC,CAAC;IAEF,IAAM,oBAAoB,mCACrB,aAAa,aAChB,GAAC,MAAM,CAAC,UAAU,CAAC,EAAE,IAAG,YAAY,EACpC,GAAC,MAAM,CAAC,YAAY,CAAC,EAAE,IAAG,cAAc,EACxC,GAAC,MAAM,CAAC,WAAW,CAAC,EAAE,IAAG,aAAa,EACtC,GAAC,MAAM,CAAC,YAAY,CAAC,EAAE,IAAG,cAAc,EAExC,GAAC,MAAM,CAAC,KAAK,CAAC,EAAE,IAAG,OAAO,EAC1B,GAAC,MAAM,CAAC,aAAa,CAAC,EAAE,IAAG,iBAAiB,EAC5C,GAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,IAAG,UAAU,EAChC,GAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,IAAG,UAAU,MACjC,CAAC;IAEF;;;;;;;aAOgB,cAAc,CAAC,KAAY,EAAE,GAAW;QACtD,OAAO,eAAe,CAAC,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,cAAc,CAAC,CAAC;IAC9D,CAAC;IAED;;;;;;;aAOgB,gBAAgB,CAAC,KAAY,EAAE,GAAW;QACxD,OAAO,eAAe,CAAC,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,gBAAgB,CAAC,CAAC;IAClE,CAAC;IAED;;;;;;;aAOgB,sBAAsB,CAAC,KAAY,EAAE,GAAW;;;QAE9D,IAAM,MAAM,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAqB,EAAyB,CAAC;;YACzG,KAA2B,IAAA,KAAA,SAAA,UAAU,CAAC,KAAK,EAAE,GAAG,EAAE,sBAAsB,CAAC,CAAA,gBAAA,4BAAE;gBAAhE,IAAA,KAAA,mBAAY,EAAX,GAAG,QAAA,EAAE,KAAK,QAAA;gBACpB,IAAI,GAAG,KAAK,UAAU,EAAE;oBACtB,IAAM,OAAO,GAAG,gBAAgB,CAAC,KAAK,EAAE,KAAe,CAAC,CAAC;oBACzD,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;iBAC3B;qBAAM;oBACL,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;iBACrB;aACF;;;;;;;;;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;IAED;;;;;;;aAOgB,oBAAoB,CAAC,KAAY,EAAE,GAAW;;;QAE5D,IAAM,MAAM,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,QAAQ;YAC5C,QAAQ,EAAE,EAA2B,EAAE,QAAQ,EAAE,EAAqB;SAClD,CAAC;;YACvB,KAA2B,IAAA,KAAA,SAAA,UAAU,CAAC,KAAK,EAAE,GAAG,EAAE,oBAAoB,CAAC,CAAA,gBAAA,4BAAE;gBAA9D,IAAA,KAAA,mBAAY,EAAX,GAAG,QAAA,EAAE,KAAK,QAAA;gBACpB,IAAI,GAAG,KAAK,UAAU,EAAE;oBACtB,IAAM,OAAO,GAAG,sBAAsB,CAAC,KAAK,EAAE,KAAe,CAAC,CAAC;oBAC/D,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;iBAC3B;qBAAM,IAAI,GAAG,KAAK,UAAU,EAAE;oBAC7B,IAAM,OAAO,GAAG,gBAAgB,CAAC,KAAK,EAAE,KAAe,CAAC,CAAC;oBACzD,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;iBAC3B;qBAAM,IAAI,GAAG,KAAK,OAAO,EAAE;oBAC1B,MAAM,CAAC,GAAG,CAAC,GAAG,cAAc,CAAC,KAAK,EAAE,KAAe,CAAC,CAAC;iBACtD;qBAAM;oBACL,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;iBACrB;aACF;;;;;;;;;QACD,OAAO,MAAM,CAAC;IAChB;;;QCxGE,kCAAmB,QAAqB;YAArB,aAAQ,GAAR,QAAQ,CAAa;YACtC,IAAI,CAAC,OAAO,EAAE,CAAC;SAChB;QAED,yCAAM,GAAN;YACE,OAAO;gBACL,MAAM,EAAE,IAAI,CAAC,MAAM;gBACnB,OAAO,EAAE,IAAI,CAAC,OAAO;gBACrB,SAAS,EAAE,IAAI,CAAC,MAAM,KAAK,OAAO,IAAI,IAAI,CAAC,MAAM,KAAK,OAAO,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,GAAG,IAAI;gBACrF,QAAQ,EAAE,IAAI,CAAC,QAAQ;aACxB,CAAC;SACH;QAEO,0CAAO,GAAP;YAAA,iBA6BP;YA5BC,IAAI,CAAC,MAAM,GAAG,SAAS,CAAC;YACxB,IAAI,CAAC,OAAO,GAAG,kBAAkB,CAAC;YAElC,IAAM,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;YAC7B,OAAO,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE;iBAC3B,IAAI,CAAC,UAAO,MAAM;;;;iCACb,MAAM,EAAN,wBAAM;;4BAER,IAAI,CAAC,OAAO,GAAG,gBAAgB,CAAC;4BAChC,qBAAM,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,EAAA;;4BAA9B,SAA8B,CAAC;4BAC/B,IAAI,CAAC,OAAO,GAAG,+BAA+B,CAAC;4BAC/C,qBAAM,IAAI,CAAC,QAAQ,CAAC,qBAAqB,EAAE,EAAA;;4BAA3C,SAA2C,CAAC;4BAC5C,IAAI,CAAC,OAAO,GAAG,qBAAqB,CAAC;4BACrC,qBAAM,IAAI,CAAC,QAAQ,CAAC,mBAAmB,EAAE,EAAA;;4BAAzC,SAAyC,CAAC;4BAC1C,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC;4BACtB,IAAI,CAAC,OAAO,GAAG,8BAA8B,CAAC;;;4BAE9C,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC;4BACtB,IAAI,CAAC,OAAO,GAAG,sCAAsC,CAAC;;;;;aAEzD,CAAA,GAAA,CAAC;iBACD,KAAK,CAAC,UAAC,KAA2B;;gBACjC,KAAI,CAAC,MAAM,GAAG,OAAO,CAAC;gBACtB,KAAI,CAAC,OAAO,GAAG,MAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,OAAO,mCAAI,sCAAsC,CAAC;aACzE,CAAC;iBACD,OAAO,CAAC;gBACP,KAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,SAAS,CAAC;aACxC,CAAC,CAAC;SACN;uCACF;KAAA;;ICjDD;IACA;IACA,IAAM,WAAW,GAAG;QAClB,UAAU,EAAE;YACV,OAAO,EAAE,sBAAsB;YAC/B,QAAQ,EAAE,sBAAsB;YAChC,KAAK,EAAE,sBAAsB;YAC7B,MAAM,EAAE,uCAAuC;YAC/C,SAAS,EAAE,2BAA2B;YACtC,OAAO,EAAE,YAAY;YACrB,aAAa,EAAE,cAAc;YAC7B,MAAM,EAAE,SAAS;YACjB,KAAK,EAAE,SAAS;YAChB,KAAK,EAAE,SAAS;YAChB,KAAK,EAAE,SAAS;YAChB,iBAAiB,EAAE,qBAAqB;YACxC,eAAe,EAAE,0BAA0B;YAC3C,eAAe,EAAE,0BAA0B;YAC3C,OAAO,EAAE;gBACP,KAAK,EAAE,gBAAgB;gBACvB,OAAO,EAAE,KAAK;aACf;YACD,SAAS,EAAE;gBACT,UAAU,EAAE,OAAO;aACpB;YACD,UAAU,EAAE;gBACV,KAAK,EAAE,8BAA8B;gBACrC,OAAO,EAAE,KAAK;aACf;YACD,UAAU,EAAE;gBACV,KAAK,EAAE,uBAAuB;gBAC9B,OAAO,EAAE,KAAK;aACf;YACD,aAAa,EAAE,iBAAiB;YAChC,eAAe,EAAE,mBAAmB;YACpC,cAAc,EAAE,kBAAkB;YAClC,eAAe,EAAE,uBAAuB;YACxC,gBAAgB,EAAE,oBAAoB;YACtC,cAAc,EAAE;gBACd,KAAK,EAAE,+BAA+B;gBACtC,OAAO,EAAE,KAAK;aACf;YACD,iBAAiB,EAAE;gBACjB,KAAK,EAAE,mBAAmB;gBAC1B,OAAO,EAAE,KAAK;gBACd,YAAY,EAAE,MAAM;aACrB;YACD,mBAAmB,EAAE;gBACnB,KAAK,EAAE,uBAAuB;gBAC9B,OAAO,EAAE,KAAK;aACf;YACD,iBAAiB,EAAE;gBACjB,KAAK,EAAE,yBAAyB;gBAChC,OAAO,EAAE,KAAK;aACf;YACD,oBAAoB,EAAE;gBACpB,KAAK,EAAE,wBAAwB;gBAC/B,OAAO,EAAE,KAAK;aACf;YACD,gBAAgB,EAAE;gBAChB,KAAK,EAAE,wBAAwB;gBAC/B,OAAO,EAAE,KAAK;aACf;YACD,iBAAiB,EAAE,qBAAqB;YACxC,MAAM,EAAE,gBAAgB;YACxB,UAAU,EAAE,cAAc;YAC1B,iBAAiB,EAAE,qBAAqB;YACxC,aAAa,EAAE,iBAAiB;YAChC,QAAQ,EAAE;gBACR,KAAK,EAAE,0BAA0B;gBACjC,OAAO,EAAE,KAAK;aACf;YACD,eAAe,EAAE,iBAAiB;YAClC,cAAc,EAAE,kBAAkB;YAClC,SAAS,EAAE,iBAAiB;YAC5B,oBAAoB,EAAE,wBAAwB;YAC9C,mBAAmB,EAAE,uBAAuB;YAC5C,WAAW,EAAE;gBACX,UAAU,EAAE,mBAAmB;aAChC;YACD,gBAAgB,EAAE,iBAAiB;YACnC,gBAAgB,EAAE,oBAAoB;YACtC,iBAAiB,EAAE,oBAAoB;YACvC,gBAAgB,EAAE,mBAAmB;YACrC,eAAe,EAAE,kBAAkB;YACnC,mBAAmB,EAAE,sBAAsB;YAC3C,QAAQ,EAAE;gBACR,KAAK,EAAE,mBAAmB;gBAC1B,OAAO,EAAE,KAAK;aACf;YACD,QAAQ,EAAE;gBACR,KAAK,EAAE,2BAA2B;gBAClC,OAAO,EAAE,KAAK;aACf;YACD,YAAY,EAAE,gBAAgB;YAC9B,YAAY,EAAE,gBAAgB;YAC9B,YAAY,EAAE,gBAAgB;YAC9B,WAAW,EAAE,eAAe;YAC5B,WAAW,EAAE,eAAe;YAC5B,WAAW,EAAE,eAAe;YAC5B,eAAe,EAAE,mBAAmB;YACpC,eAAe,EAAE,mBAAmB;YACpC,eAAe,EAAE,mBAAmB;YACpC,aAAa,EAAE,iBAAiB;YAChC,aAAa,EAAE,iBAAiB;YAChC,aAAa,EAAE,iBAAiB;YAChC,gBAAgB,EAAE;gBAChB,KAAK,EAAE,uBAAuB;gBAC9B,OAAO,EAAE,KAAK;aACf;YACD,YAAY,EAAE,gBAAgB;YAC9B,WAAW,EAAE,eAAe;YAC5B,MAAM,EAAE,cAAc;YACtB,aAAa,EAAE,iBAAiB;YAChC,cAAc,EAAE,kBAAkB;SACnC;KACF,CAAC;IACF;IAEA;;;;;;aAMgB,WAAW,CAAC,YAAoB;QAC9C,OAAO,IAAI,CAAC,KAAK,CAAC,YAAY,EAAE,UAAC,GAAG,EAAE,KAAK;YACzC,IAAI,GAAG,KAAK,iBAAiB,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;gBACrD,OAAO,KAAK,CAAC,GAAG,CAAC,UAAC,GAAW;oBAC3B,IAAI,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,UAAU,CAAC,qCAAqC,CAAC,EAAE;wBAC1D,OAAO,GAAG,CAAC,OAAO,CAChB,qCAAqC,EACrC,iCAAiC,CAClC,CAAC;qBACH;yBAAM;wBACL,OAAO,GAAG,CAAC;qBACZ;iBACF,CAAC,CAAC;aACJ;iBAAM,IAAI,GAAG,KAAK,UAAU,IAAI,KAAK,KACpC,KAAK,KAAK,8EAA8E;mBACnF,KAAK,KAAK,uEAAuE;mBACjF,KAAK,KAAK,oEAAoE;mBAC7E,KAAiB,CAAC,OAAO,CAAC,KAAK,4CAA4C,CAClF,EAAE;gBACD,OAAO,WAAW,CAAC;aACpB;YACD,OAAO,KAAK,CAAC;SACd,CAAC,CAAC;IACL;;IClJA;;;;;;aAMgB,kBAAkB,CAAC,KAAY;;;QAC7C,IAAM,IAAI,GAAG,+BAA+B,CAAC,KAAK,CAAC,CAAC;QACpD,IAAM,WAAW,GAA6B,IAAI,GAAG,EAAE,CAAC;;;YAGxD,KAA+C,IAAA,KAAA,SAAApB,0BAAS,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,CAAC,aAAa,CAAC,iBAAiB,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA,gBAAA,4BAAE;gBAA7G,IAAA,aAAgC,EAArB,KAAK,aAAA,EAAU,IAAI,YAAA;gBACvC,IAAM,WAAW,GAAG,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;gBACvC,IAAI,MAAM,GAAG,MAAA,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,0CAAE,MAAM,CAAC;gBACzC,OAAO,MAAM,EAAE;oBACb,IAAI,WAAW,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE;wBAC3B,MAAM;qBACP;yBAAM;wBACL,WAAW,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;wBACxB,MAAM,GAAG,MAAA,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,0CAAE,MAAM,CAAC;qBACrC;iBACF;gBACD,WAAW,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,EAAE,yBAAK,WAAW,GAAE,GAAG,CAAC,UAAA,CAAC,IAAI,OAAAG,4BAAW,CAAC,SAAS,CAAC,CAAC,CAAC,GAAA,CAAC,CAAC,CAAC;aACjF;;;;;;;;;;;YAGD,KAAsC,IAAA,KAAA,SAAAH,0BAAS,CAAC,KAAK,EAAE,IAAI,EAAE,MAAM,CAAC,aAAa,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA,gBAAA,4BAAE;gBAAnF,IAAQ,WAAW,kBAAA;;oBAC9B,KAAqC,IAAA,oBAAA,SAAAA,0BAAS,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,CAAC,gBAAgB,CAAC,MAAM,EAAE,WAAW,EAAE,IAAI,CAAC,CAAA,CAAA,gBAAA,4BAAE;wBAAhG,IAAS,SAAS,mBAAA;;4BAC7B,KAAgC,IAAA,oBAAA,SAAAA,0BAAS,CAAC,KAAK,EAAE,SAAS,EAAE,GAAG,CAAC,gBAAgB,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA,CAAA,gBAAA,4BAAE;gCAAzF,IAAQ,KAAK,kBAAA;;oCACxB,KAAmB,IAAA,oBAAA,SAAA,MAAA,WAAW,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,mCAAI,EAAE,CAAA,CAAA,gBAAA,4BAAE;wCAA/C,IAAM,IAAI,WAAA;wCACb,KAAK,CAAC,OAAO,CAACG,4BAAW,CAAC,SAAS,CAAC,WAAW,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,aAAa,CAAC,eAAe,EAAE,IAAI,CAAC,CAAC;qCAC/F;;;;;;;;;6BACF;;;;;;;;;qBACF;;;;;;;;;aACF;;;;;;;;;IACH;;ICKA;QACa,sBAAsB,GAAuB;QACxD,SAAS,EAAE,qCAAqC;QAChD,aAAa,EAAE,gDAAgD;QAC/D,WAAW,EAAE,EAAE;QACf,iBAAiB,EAAE,QAAQ;QAC3B,eAAe,EAAE,sCAAsC;QACvD,aAAa,EAAE,EAAE;QACjB,eAAe,EAAE,qCAAqC;MACtD;IAEF;;;;;;;QAkBE,qBAAmB,OAAoD;YAApD,wBAAA,EAAA,gCAAoD;YAApD,YAAO,GAAP,OAAO,CAA6C;YACrE,IAAI,CAAC,KAAK,GAAG,IAAIkB,sBAAK,CAAC,SAAS,EAAE,EAAE,OAAO,EAAElB,4BAAW,EAAE,CAAC,CAAC;YAC5D,IAAI,CAAC,KAAK,GAAG,IAAI,eAAe,CAAC,IAAI,CAAC,CAAC;YACvC,IAAI,CAAC,KAAK,GAAG,IAAI,eAAe,CAAC,IAAI,CAAC,CAAC;SACxC;;;;;;;QAQK,6BAAO,GAAP,UAAQ,OAA4B,EAAE,MAAc;YAAd,uBAAA,EAAA,cAAc;;;;;4BACxD,IAAI,OAAO,EAAE;gCACX,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;6BACxB;4BACD,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE;gCACtB,IAAI,MAAM,EAAE;oCACV,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,aAAa,EAAE,CAAC;iCAC1C;qCAAM;oCACL,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC;iCACtC;6BACF;4BACD,qBAAM,IAAI,CAAC,YAAY,EAAA;;4BAAvB,SAAuB,CAAC;4BACxB,sBAAO,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,CAAC,EAAC;;;aAC5B;SAAA;QAEa,mCAAa,GAAb;;;;;;4BACN,KAAK,GAAG,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,CAAC;4BAC7B,eAAe,GAAG,4BAA4B,CAAC;4BAC/C,cAAc,GAAG,cAAc,CAAC;4BAEjB,qBAAMM,aAAG,CAAC,eAAe,CAAC,CAAC,KAAK,CAAC,cAAM,OAAA,SAAS,GAAA,CAAC,EAAA;;4BAAhE,YAAY,GAAG,SAAiD;kCAGlE,YAAY,IAAI,KAAK,GAAG,IAAI,IAAI,CAAC,CAAC,YAAY,CAAC,CAAC,OAAO,EAAE,GAAG,EAAE,GAAC,EAAE,GAAC,IAAI,CAAA,EAAtE,wBAAsE;4BACxE,qBAAMa,iBAAO,CAAC,CAAC,cAAc,EAAE,eAAe,CAAC,CAAC,CAAC,KAAK,CAAC,cAAM,OAAA,SAAS,GAAA,CAAC,EAAA;;4BAAvE,SAAuE,CAAC;;gCAEzD,qBAAMb,aAAG,CAAC,cAAc,CAAC,CAAC,KAAK,CAAC,cAAM,OAAA,SAAS,GAAA,CAAC,EAAA;;4BAA/D,YAAY,GAAG,SAAgD,CAAC;;;iCAG9D,YAAY,EAAZ,wBAAY;4BACd,qBAAM,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,EAAA;;4BAApC,SAAoC,CAAC;;gCAErC,qBAAM,IAAI,CAAC,SAAS,EAAE,EAAA;;4BAAtB,SAAsB,CAAC;4BAEvBc,iBAAO,CAAC;gCACN,CAAC,cAAc,EAAE,IAAI,CAAC,SAAS,EAAE,CAAC;gCAClC,CAAC,eAAe,EAAE,EAAE,GAAG,KAAK,CAAC;6BAC9B,CAAC,CAAC,KAAK,CAAC,cAAM,OAAA,SAAS,GAAA,CAAC,CAAC;;;;;aAE7B;SAAA;;;;;;QAOa,+BAAS,GAAT;;;;;;;;4BACN,GAAG,GAAuB,EAAE,CAAC;4BAC7B,OAAO,GAAsB,MAAA,MAAA,IAAI,CAAC,OAAO,CAAC,WAAW,0CAAE,MAAM,EAAE,mCAAI,EAAE,CAAC;4BAEtE,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC;iCACrC,SAAS,CAAC,UAAU,CAAC,GAAG,CAAC,EAAzB,wBAAyB;;4BAE3B,IAAI,CAAC,KAAK,GAAGC,mCAAkB,CAAC,SAAS,EAAErB,4BAAW,CAAC,CAAC;;;iCAC/C,SAAS,CAAC,QAAQ,CAAC,eAAe,CAAC,EAAnC,wBAAmC;4BACxB,qBAAM,KAAK,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,IAAI,EAAE,GAAA,CAAC;qCAC3D,KAAK,CAAC,cAAM,OAAA,OAAO,CAAC,GAAG,CAAC,oCAAoC,CAAC,GAAA,CAAC,EAAA;;4BAD3D,WAAW,GAAG,SAC6C;4BACjE,IAAI,WAAW,EAAE;gCACf,IAAI,CAAC,KAAK,GAAGqB,mCAAkB,CAAC,WAAW,EAAErB,4BAAW,CAAC,CAAC;6BAC3D;;;4BACI,IAAI,CAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,MAAM,IAAG,CAAC,EAAE;gCAChC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;6BACzB;;;4BACD,IAAI,IAAI,CAAC,OAAO,CAAC,aAAa,EAAE;gCAC9B,IAAI,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE;oCACjD,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;iCAC1C;qCAAM;oCACL,GAAG,CAAC,IAAI,CAAC,YAAY,CACnB,IAAI,CAAC,OAAO,CAAC,aAAa,EAC1B,IAAI,CAAC,OAAO,CAAC,iBAAiB,EAC9B,IAAI,CAAC,OAAO,CAAC,WAAW,EACxB,IAAI,CAAC,OAAO,CAAC,WAAW,EACxB,IAAI,CAAC,OAAO,CAAC,eAAe,EAC5B,IAAI,CAAC,OAAO,CAAC,eAAe,CAC7B,CAAC,IAAI,CAAC,UAAC,MAAM;wCACZ,IAAI,MAAM,EAAE;4CACV,OAAO,KAAI,CAAC,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;yCACtC;6CAAM;4CACL,OAAO,SAAS,CAAC;yCAClB;qCACF,CAAC,CAAC,CAAC;iCACL;6BACF;4BACD,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;4BACvC,qBAAM,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,EAAA;;4BAAtB,SAAsB,CAAC;4BACvB,qBAAM,IAAI,CAAC,WAAW,EAAE,EAAA;;4BAAxB,SAAwB,CAAC;;;;;SAC1B;QAEK,oCAAc,GAAd,UAAe,OAA0B,EAAE,UAAkB;;;iCAyBlE;;;;4BAxBO,KAAK,GAAU,UAAU,aAAV,UAAU,cAAV,UAAU,GAAI,IAAI,CAAC,KAAK,CAAC;4BAC9C,qBAAM,OAAO,CAAC,GAAG,CACf,OAAO,CAAC,GAAG,CAAC,UAAO,MAAM;;;;sDACnB,OAAO,MAAM,KAAK,QAAQ,CAAA,EAA1B,yBAA0B;sDACxB,CAAC,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,MAAM,CAAC,UAAU,CAAC,SAAS,CAAC,KAAK,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAA,EAAxF,wBAAwF;gDACjF,qBAAM,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,IAAI,EAAE,GAAA,CAAC,EAAA;;gDAAhD,MAAM,GAAG,SAAuC,CAAC;gDACjD,MAAM,GAAG,WAAW,CAAC,MAAgB,CAAC,CAAC;gDACvC,qBAAMa,iCAAgB,CAAC,MAAM,EAAE,KAAK,CAAC,EAAA;;gDAArC,SAAqC,CAAC;;;qDAC7B,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,EAArB,wBAAqB;gDAC9B,qBAAMS,6BAAY,CAAC,MAAM,EAAE,KAAK,CAAC,EAAA;;gDAAjC,SAAiC,CAAC;;;sDACzB,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAA,EAA1E,wBAA0E;gDACnF,qBAAMC,iCAAgB,CAAC,MAAM,EAAE,KAAK,CAAC,EAAA;;gDAArC,SAAqC,CAAC;;;;gDAGtC,MAAM,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC;gDAC7B,qBAAMV,iCAAgB,CAAC,MAAM,EAAE,KAAK,CAAC,EAAA;;gDAArC,SAAqC,CAAC;;;;gDAGxC,MAAM,GAAG,WAAW,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC;gDAC7C,qBAAMA,iCAAgB,CAAC,MAAM,EAAE,KAAK,CAAC,EAAA;;gDAArC,SAAqC,CAAC;;;;;iCAEzC,CAAA,GAAA,CAAC,CACH,EAAA;;4BArBD,SAqBC,CAAC;4BACF,sBAAO,IAAI,EAAC;;;aACb;SAAA;QAEK,iCAAW,GAAX;;;;;;wBAEJ,qBAAM,IAAI,OAAO,CAAC,UAAA,CAAC;gCACjB,UAAU,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;6BACpB,CAAC,EAAA;;;4BAFF,SAEE,CAAC;4BACH,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC;4BACzB,kBAAkB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;4BAC/B,sBAAO,IAAI,EAAC;;;aACb;SAAA;QAED,+BAAS,GAAT;YACE,OAAOW,iCAAgB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;SACrC;QAEK,iCAAW,GAAX,UAAY,KAAa;;;;;4BAC7B,IAAI,CAAC,KAAK,GAAGH,mCAAkB,CAAC,KAAK,EAAErB,4BAAW,CAAC,CAAC;4BACpD,IAAI,CAAC,KAAK,GAAG,IAAI,eAAe,CAAC,IAAI,CAAC,CAAC;4BACvC,IAAI,CAAC,KAAK,GAAG,IAAI,eAAe,CAAC,IAAI,CAAC,CAAC;4BACvC,qBAAM,IAAI,OAAO,CAAC,UAAA,CAAC;oCACjB,UAAU,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;iCACnB,CAAC,EAAA;;4BAFF,SAEE,CAAC;;;;aACJ;SAAA;;;;;;;QAQD,4BAAM,GAAN,UAAO,MAA6B;YAA7B,uBAAA,EAAA,WAA6B;YAClC,OAAO,OAAO,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;SAChD;;;;;;;QAQD,yBAAG,GAAH,UAAI,EAAU;YACZ,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,CAACA,4BAAW,CAAC,SAAS,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;SACzE;;;;;;;QAQD,4BAAM,GAAN,UAAO,MAA6B;YAApC,iBAEC;YAFM,uBAAA,EAAA,WAA6B;YAClC,OAAO,yBAAI,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,GAAE,GAAG,CAAC,UAAC,CAAC,IAAK,OAAA,KAAI,CAAC,GAAG,CAAC,CAAC,CAAC,GAAA,CAAC,CAAC;SACzD;;;;;;;QAQD,wCAAkB,GAAlB,UAAmB,MAAe;YAAlC,iBAIC;;YAFC,MAAM,GAAG,gCAAK,MAAM,KAAE,gBAAgB,EAAE,IAAI,GAAY,CAAC;YACzD,OAAO,yBAAI,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,GAAE,GAAG,CAAC,UAAC,CAAC,IAAK,OAAA,yBAAyB,CAAC,KAAI,CAAC,KAAK,EAAE,CAAC,CAAkB,GAAA,CAAC,CAAC;SACvG;QAEK,uCAAiB,GAAjB;;;oBACJ,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE;wBAChB,IAAI,CAAC,MAAM,GAAG,IAAI,wBAAwB,CAAC,IAAI,CAAC,CAAC;qBAClD;oBACD,sBAAO,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,EAAC;;aAC7B;SAAA;;;;;;QAOK,+CAAyB,GAAzB;;;oBACJ,sBAAO,yBAAyB,CAAC,IAAI,CAAC,KAAK,CAAC,EAAC;;aAC9C;SAAA;;;;;;QAOK,sCAAgB,GAAhB;;;oBACJ,sBAAO,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC,EAAC;;aACrC;SAAA;;;;;;;QAQK,2CAAqB,GAArB,UAAsB,MAAe;;iCAI1C;;;oBAFC,MAAM,GAAG,gCAAK,MAAM,KAAE,gBAAgB,EAAE,IAAI,GAAY,CAAC;oBACzD,sBAAO,yBAAI,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,GAAE,GAAG,CAAC,UAAC,CAAC,IAAK,OAAA,oBAAoB,CAAC,KAAI,CAAC,KAAK,EAAE,CAAC,CAAC,GAAA,CAAC,EAAC;;aACjF;SAAA;;;;;;;QAQK,yCAAmB,GAAnB,UAAoB,MAAe;;;oBACvC,sBAAO,mBAAmB,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,EAAC;;aAC7D;SAAA;;;;;;;QAQK,+CAAyB,GAAzB,UAA0B,MAAe;;;oBAC7C,sBAAO,yBAAyB,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,EAAC;;aACnE;SAAA;;;;;;;QAQK,+CAAyB,GAAzB,UAA0B,MAAe;;;oBAC7C,sBAAO,yBAAyB,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,EAAC;;aACnE;SAAA;;;;;;QAOK,0CAAoB,GAApB;;;oBACJ,sBAAO,+BAA+B,CAAC,IAAI,CAAC,KAAK,CAAC,EAAC;;aACpD;SAAA;;;;;;QAOK,0CAAoB,GAApB;;;oBACJ,sBAAO,oBAAoB,CAAC,IAAI,CAAC,KAAK,CAAC,EAAC;;aACzC;SAAA;;;;;;QAOK,wCAAkB,GAAlB;;;oBACJ,sBAAO,IAAI,CAAC,KAAK,CAAC,kBAAkB,EAAE,EAAC;;aACxC;SAAA;;;;;;;QAQK,8BAAQ,GAAR,UAAS,MAAe;;;oBAC5B,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC;oBACzB,sBAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAC;;aACpC;SAAA;;;;;;;;QASK,4CAAsB,GAAtB,UAAuB,QAAgB,EAAE,MAAe;;;oBAC5D,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC;oBACzB,sBAAO,IAAI,CAAC,KAAK,CAAC,sBAAsB,CAAC,QAAQ,EAAE,MAAM,CAAC,EAAC;;aAC5D;SAAA;QAEK,yCAAmB,GAAnB,UAAoB,MAAqB,EAAE,SAAiB;;;oBAChE,sBAAO,IAAI,CAAC,KAAK,CAAC,mBAAmB,CAAC,MAAM,EAAE,SAAS,CAAC,EAAC;;aAC1D;SAAA;0BACF;KAAA;;IC5XD,IAAM,IAAI,GAAU,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,CAAC,CAAC;IACxC,IAAMyB,KAAG,GAAU,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC;IACpC,IAAMC,OAAK,GAAU,CAAC,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;IACzC,IAAMC,MAAI,GAAU,CAAC,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;IAExC;;;;;;;aAOgB,qBAAqB,CAAC,IAAmB,EAAE,MAAsB;;QAC/E,IAAM,UAAU,GAAG,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;QAC3C,IAAM,WAAW,GAAG,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;QAC5C,IAAM,UAAU,GAAG,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;QAC3C,IAAM,mBAAmB,GAAG,IAAI,CAAC,GAAG,CAAC,UAAU,EAAE,WAAW,EAAE,UAAU,CAAC,GAAG,IAAI,CAAC;QACjF,IAAM,gBAAgB,GAAG,mBAAmB,GAAG,IAAI,CAAC;QACpD,IAAM,gBAAgB,GAAG,mBAAmB,GAAG,CAAC,CAAC;QACjD,IAAM,gBAAgB,GAAG,gBAAgB,GAAG,CAAC,CAAC;QAE9C,IAAI,CAAC,MAAM,EAAE;YACX,MAAM,GAAG;gBACP,MAAM,EAAE,MAAA,IAAI,CAAC,iBAAiB,mCAAI,IAAI,CAAC,KAAK,CAAC;gBAC7C,MAAM,EAAE,mBAAmB;gBAC3B,CAAC,EAAE,UAAU,GAAG,CAAC;gBACjB,CAAC,EAAE,WAAW,GAAG,CAAC;gBAClB,CAAC,EAAE,UAAU,GAAG,CAAC;aAClB,CAAC;SACH;aAAM;YACL,MAAM,mCACD,MAAM,KACT,MAAM,EAAE,MAAM,CAAC,MAAM,GAAG,IAAI,EAC5B,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,IAAI,EAClB,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,IAAI,EAClB,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,IAAI,GACnB,CAAC;SACH;QAED,OAAO;;YAEL;gBACE,KAAK,EAAE,kDAAkD;gBACzD,OAAO,EAAE,kBAAkB;gBAC3B,UAAU,EAAE,KAAK;gBACjB,QAAQ,EAAE,QAAQ;gBAClB,eAAe,EAAE,IAAIvB,YAAO,CAACA,YAAO,CAAC,QAAQ,CAAC,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC;gBAC7G,KAAK,EAAE,IAAI;aACZ;;YAED;gBACE,KAAK,EAAE,oDAAoD;gBAC3D,OAAO,EAAE,kBAAkB;gBAC3B,UAAU,EAAE,IAAI;gBAChB,QAAQ,EAAE,UAAU;gBACpB,eAAe,EAAE,IAAIA,YAAO,CAACA,YAAO,CAAC,QAAQ,CAAC;qBAC3C,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,GAAG,gBAAgB,GAAG,CAAC,EAAE,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;qBAChF,OAAO,CAACF,cAAS,CAAC,CAAC,EAAE,CAAC,CAAC;qBACvB,KAAK,CAAC,CAAC,gBAAgB,EAAE,gBAAgB,EAAE,gBAAgB,CAAC,CAAC;gBAChE,KAAK,EAAEuB,KAAG;aACX;YACD;gBACE,KAAK,EAAE,wDAAwD;gBAC/D,OAAO,EAAE,kBAAkB;gBAC3B,UAAU,EAAE,IAAI;gBAChB,QAAQ,EAAE,MAAM;gBAChB,eAAe,EAAE,IAAIrB,YAAO,CAACA,YAAO,CAAC,QAAQ,CAAC;qBAC3C,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,GAAG,gBAAgB,EAAE,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;qBAC5E,OAAO,CAACF,cAAS,CAAC,CAAC,EAAE,CAAC,CAAC;qBACvB,KAAK,CAAC,CAAE,gBAAgB,EAAE,gBAAgB,GAAG,CAAC,EAAE,gBAAgB,CAAE,CAAC;gBACtE,KAAK,EAAEuB,KAAG;aACX;YACD;gBACE,KAAK,EAAE,yDAAyD;gBAChE,OAAO,EAAE,kBAAkB;gBAC3B,UAAU,EAAE,IAAI;gBAChB,QAAQ,EAAE,MAAM;gBAChB,IAAI,EAAE,GAAG;gBACT,eAAe,EAAE,IAAIrB,YAAO,CAACA,YAAO,CAAC,QAAQ,CAAC;qBAC3C,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,GAAG,gBAAgB,GAAG,gBAAgB,GAAG,CAAC,EAAE,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;qBACnG,KAAK,CAAC,gBAAgB,CAAC;gBAC1B,KAAK,EAAEqB,KAAG;aACX;;YAED;gBACE,KAAK,EAAE,oDAAoD;gBAC3D,OAAO,EAAE,kBAAkB;gBAC3B,UAAU,EAAE,IAAI;gBAChB,QAAQ,EAAE,UAAU;gBACpB,eAAe,EAAE,IAAIrB,YAAO,CAACA,YAAO,CAAC,QAAQ,CAAC;qBAC3C,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,GAAG,gBAAgB,GAAG,CAAC,EAAE,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;qBAChF,OAAO,CAACF,cAAS,CAAC,CAAC,EAAE,CAAC,CAAC;qBACvB,KAAK,CAAC,CAAC,gBAAgB,EAAE,gBAAgB,EAAE,gBAAgB,CAAC,CAAC;gBAChE,KAAK,EAAEuB,KAAG;aACX;YACD;gBACE,KAAK,EAAE,wDAAwD;gBAC/D,OAAO,EAAE,kBAAkB;gBAC3B,UAAU,EAAE,IAAI;gBAChB,QAAQ,EAAE,MAAM;gBAChB,eAAe,EAAE,IAAIrB,YAAO,CAACA,YAAO,CAAC,QAAQ,CAAC;qBAC3C,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,GAAG,gBAAgB,EAAE,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;qBAC5E,OAAO,CAACF,cAAS,CAAC,EAAE,CAAC,CAAC;qBACtB,KAAK,CAAC,CAAE,gBAAgB,EAAE,gBAAgB,GAAG,CAAC,EAAE,gBAAgB,CAAE,CAAC;gBACtE,KAAK,EAAEuB,KAAG;aACX;YACD;gBACE,KAAK,EAAE,yDAAyD;gBAChE,OAAO,EAAE,kBAAkB;gBAC3B,UAAU,EAAE,IAAI;gBAChB,QAAQ,EAAE,MAAM;gBAChB,IAAI,EAAE,GAAG;gBACT,eAAe,EAAE,IAAIrB,YAAO,CAACA,YAAO,CAAC,QAAQ,CAAC;qBAC3C,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,GAAG,gBAAgB,GAAG,gBAAgB,GAAG,GAAG,EAAE,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;qBACrG,KAAK,CAAC,gBAAgB,CAAC;gBAC1B,KAAK,EAAEqB,KAAG;aACX;;YAED;gBACE,KAAK,EAAE,oDAAoD;gBAC3D,OAAO,EAAE,kBAAkB;gBAC3B,UAAU,EAAE,IAAI;gBAChB,QAAQ,EAAE,UAAU;gBACpB,eAAe,EAAE,IAAIrB,YAAO,CAACA,YAAO,CAAC,QAAQ,CAAC;qBAC3C,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,GAAG,gBAAgB,GAAG,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;qBAChF,KAAK,CAAC,CAAC,gBAAgB,EAAE,gBAAgB,EAAE,gBAAgB,CAAC,CAAC;gBAChE,KAAK,EAAEsB,OAAK;aACb;YACD;gBACE,KAAK,EAAE,wDAAwD;gBAC/D,OAAO,EAAE,kBAAkB;gBAC3B,UAAU,EAAE,IAAI;gBAChB,QAAQ,EAAE,MAAM;gBAChB,eAAe,EAAE,IAAItB,YAAO,CAACA,YAAO,CAAC,QAAQ,CAAC;qBAC3C,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,GAAG,gBAAgB,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;qBAC5E,KAAK,CAAC,CAAE,gBAAgB,EAAE,gBAAgB,GAAG,CAAC,EAAE,gBAAgB,CAAE,CAAC;gBACtE,KAAK,EAAEsB,OAAK;aACb;YACD;gBACE,KAAK,EAAE,yDAAyD;gBAChE,OAAO,EAAE,kBAAkB;gBAC3B,UAAU,EAAE,IAAI;gBAChB,QAAQ,EAAE,MAAM;gBAChB,IAAI,EAAE,GAAG;gBACT,eAAe,EAAE,IAAItB,YAAO,CAACA,YAAO,CAAC,QAAQ,CAAC;qBAC3C,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,GAAG,gBAAgB,GAAG,gBAAgB,GAAG,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;qBACnG,KAAK,CAAC,gBAAgB,CAAC;gBAC1B,KAAK,EAAEsB,OAAK;aACb;;YAED;gBACE,KAAK,EAAE,oDAAoD;gBAC3D,OAAO,EAAE,kBAAkB;gBAC3B,UAAU,EAAE,IAAI;gBAChB,QAAQ,EAAE,UAAU;gBACpB,eAAe,EAAE,IAAItB,YAAO,CAACA,YAAO,CAAC,QAAQ,CAAC;qBAC3C,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,GAAG,gBAAgB,GAAG,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;qBAChF,KAAK,CAAC,CAAC,gBAAgB,EAAE,gBAAgB,EAAE,gBAAgB,CAAC,CAAC;gBAChE,KAAK,EAAEsB,OAAK;aACb;YACD;gBACE,KAAK,EAAE,wDAAwD;gBAC/D,OAAO,EAAE,kBAAkB;gBAC3B,UAAU,EAAE,IAAI;gBAChB,QAAQ,EAAE,MAAM;gBAChB,eAAe,EAAE,IAAItB,YAAO,CAACA,YAAO,CAAC,QAAQ,CAAC;qBAC3C,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,GAAG,gBAAgB,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;qBAC5E,OAAO,CAACF,cAAS,CAAC,GAAG,CAAC,CAAC;qBACvB,KAAK,CAAC,CAAE,gBAAgB,EAAE,gBAAgB,GAAG,CAAC,EAAE,gBAAgB,CAAE,CAAC;gBACtE,KAAK,EAAEwB,OAAK;aACb;YACD;gBACE,KAAK,EAAE,yDAAyD;gBAChE,OAAO,EAAE,kBAAkB;gBAC3B,UAAU,EAAE,IAAI;gBAChB,QAAQ,EAAE,MAAM;gBAChB,IAAI,EAAE,GAAG;gBACT,eAAe,EAAE,IAAItB,YAAO,CAACA,YAAO,CAAC,QAAQ,CAAC;qBAC3C,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,GAAG,gBAAgB,GAAG,gBAAgB,GAAG,GAAG,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;qBACrG,KAAK,CAAC,gBAAgB,CAAC;gBAC1B,KAAK,EAAEsB,OAAK;aACb;;YAED;gBACE,KAAK,EAAE,oDAAoD;gBAC3D,OAAO,EAAE,kBAAkB;gBAC3B,UAAU,EAAE,IAAI;gBAChB,QAAQ,EAAE,UAAU;gBACpB,eAAe,EAAE,IAAItB,YAAO,CAACA,YAAO,CAAC,QAAQ,CAAC;qBAC3C,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,GAAG,gBAAgB,GAAG,CAAC,CAAC,CAAC;qBAChF,OAAO,CAACF,cAAS,CAAC,EAAE,CAAC,CAAC;qBACtB,KAAK,CAAC,CAAC,gBAAgB,EAAE,gBAAgB,EAAE,gBAAgB,CAAC,CAAC;gBAChE,KAAK,EAAEyB,MAAI;aACZ;YACD;gBACE,KAAK,EAAE,wDAAwD;gBAC/D,OAAO,EAAE,kBAAkB;gBAC3B,UAAU,EAAE,IAAI;gBAChB,QAAQ,EAAE,MAAM;gBAChB,eAAe,EAAE,IAAIvB,YAAO,CAACA,YAAO,CAAC,QAAQ,CAAC;qBAC3C,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,GAAG,gBAAgB,CAAC,CAAC;qBAC5E,OAAO,CAACF,cAAS,CAAC,EAAE,CAAC,CAAC;qBACtB,KAAK,CAAC,CAAE,gBAAgB,EAAE,gBAAgB,GAAG,CAAC,EAAE,gBAAgB,CAAE,CAAC;gBACtE,KAAK,EAAEyB,MAAI;aACZ;YACD;gBACE,KAAK,EAAE,yDAAyD;gBAChE,OAAO,EAAE,kBAAkB;gBAC3B,UAAU,EAAE,IAAI;gBAChB,QAAQ,EAAE,MAAM;gBAChB,IAAI,EAAE,GAAG;gBACT,eAAe,EAAE,IAAIvB,YAAO,CAACA,YAAO,CAAC,QAAQ,CAAC;qBAC3C,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,GAAG,gBAAgB,GAAG,gBAAgB,GAAG,CAAC,CAAC,CAAC;qBACnG,KAAK,CAAC,gBAAgB,CAAC;gBAC1B,KAAK,EAAEuB,MAAI;aACZ;;YAED;gBACE,KAAK,EAAE,oDAAoD;gBAC3D,OAAO,EAAE,kBAAkB;gBAC3B,UAAU,EAAE,IAAI;gBAChB,QAAQ,EAAE,UAAU;gBACpB,eAAe,EAAE,IAAIvB,YAAO,CAACA,YAAO,CAAC,QAAQ,CAAC;qBAC3C,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,GAAG,gBAAgB,GAAG,CAAC,CAAC,CAAC;qBAChF,OAAO,CAACF,cAAS,CAAC,CAAC,EAAE,CAAC,CAAC;qBACvB,KAAK,CAAC,CAAC,gBAAgB,EAAE,gBAAgB,EAAE,gBAAgB,CAAC,CAAC;gBAChE,KAAK,EAAEyB,MAAI;aACZ;YACD;gBACE,KAAK,EAAE,wDAAwD;gBAC/D,OAAO,EAAE,kBAAkB;gBAC3B,UAAU,EAAE,IAAI;gBAChB,QAAQ,EAAE,MAAM;gBAChB,eAAe,EAAE,IAAIvB,YAAO,CAACA,YAAO,CAAC,QAAQ,CAAC;qBAC3C,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,GAAG,gBAAgB,CAAC,CAAC;qBAC5E,OAAO,CAACF,cAAS,CAAC,CAAC,EAAE,CAAC,CAAC;qBACvB,KAAK,CAAC,CAAE,gBAAgB,EAAE,gBAAgB,GAAG,CAAC,EAAE,gBAAgB,CAAE,CAAC;gBACtE,KAAK,EAAEyB,MAAI;aACZ;YACD;gBACE,KAAK,EAAE,yDAAyD;gBAChE,OAAO,EAAE,kBAAkB;gBAC3B,UAAU,EAAE,IAAI;gBAChB,QAAQ,EAAE,MAAM;gBAChB,IAAI,EAAE,GAAG;gBACT,eAAe,EAAE,IAAIvB,YAAO,CAACA,YAAO,CAAC,QAAQ,CAAC;qBAC3C,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,GAAG,gBAAgB,GAAG,gBAAgB,GAAG,GAAG,CAAC,CAAC;qBACrG,KAAK,CAAC,gBAAgB,CAAC;gBAC1B,KAAK,EAAEuB,MAAI;aACZ;SACF,CAAC;IACJ;;IC3PA,IAAM,IAAI,GAAU,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;IACzC,IAAM,GAAG,GAAU,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC;IACpC,IAAM,KAAK,GAAU,CAAC,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;IACzC,IAAM,IAAI,GAAU,CAAC,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;IAExC;;;;;;aAMgB,cAAc,CAAC,IAAmB,EAAE,cAAsB;QAAtB,+BAAA,EAAA,sBAAsB;QACxE,IAAM,UAAU,GAAG,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;QAC3C,IAAM,WAAW,GAAG,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;QAC5C,IAAM,UAAU,GAAG,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;QAC3C,IAAM,YAAY,GAAG,IAAI,CAAC,GAAG,CAAC,UAAU,EAAE,WAAW,EAAE,UAAU,CAAC,GAAG,IAAI,CAAC;QAC1E,IAAM,UAAU,GAAG,YAAY,GAAG,GAAG,CAAC;QAEtC,OAAO;;YAEL;gBACE,KAAK,EAAE,iDAAiD;gBACxD,OAAO,EAAE,kBAAkB;gBAC3B,UAAU,EAAE,IAAI;gBAChB,QAAQ,EAAE,QAAQ;gBAClB,eAAe,EAAE,IAAIvB,YAAO,CAACA,YAAO,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,YAAY,CAAC;gBAClE,KAAK,EAAE,IAAI;aACZ;;YAED;gBACE,KAAK,EAAE,4CAA4C;gBACnD,OAAO,EAAE,kBAAkB;gBAC3B,UAAU,EAAE,IAAI;gBAChB,QAAQ,EAAE,UAAU;gBACpB,eAAe,EAAE,IAAIA,YAAO,CAACA,YAAO,CAAC,QAAQ,CAAC;qBAC3C,SAAS,CAAC,CAAC,UAAU,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;qBACjC,OAAO,CAACF,cAAS,CAAC,CAAC,EAAE,CAAC,CAAC;qBACvB,KAAK,CAAC,CAAC,UAAU,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC;gBAC9C,KAAK,EAAE,GAAG;aACX;YACD;gBACE,KAAK,EAAE,gDAAgD;gBACvD,OAAO,EAAE,kBAAkB;gBAC3B,UAAU,EAAE,IAAI;gBAChB,QAAQ,EAAE,MAAM;gBAChB,eAAe,EAAE,IAAIE,YAAO,CAACA,YAAO,CAAC,QAAQ,CAAC;qBAC3C,SAAS,CAAC,CAAC,UAAU,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;qBAC7B,OAAO,CAACF,cAAS,CAAC,CAAC,EAAE,CAAC,CAAC;qBACvB,KAAK,CAAC,CAAE,YAAY,EAAE,YAAY,GAAG,CAAC,EAAE,YAAY,CAAE,CAAC;gBAC1D,KAAK,EAAE,GAAG;aACX;YACD;gBACE,KAAK,EAAE,kDAAkD;gBACzD,OAAO,EAAE,kBAAkB;gBAC3B,UAAU,EAAE,IAAI;gBAChB,QAAQ,EAAE,MAAM;gBAChB,IAAI,EAAE,GAAG;gBACT,eAAe,EAAE,IAAIE,YAAO,CAACA,YAAO,CAAC,QAAQ,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,YAAY,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,YAAY,CAAC;gBACvG,KAAK,EAAE,GAAG;aACX;YACD;gBACE,KAAK,EAAE,kDAAkD;gBACzD,OAAO,EAAE,kBAAkB;gBAC3B,UAAU,EAAE,IAAI;gBAChB,QAAQ,EAAE,MAAM;gBAChB,IAAI,EAAE,GAAG;gBACT,eAAe,EAAE,IAAIA,YAAO,CAACA,YAAO,CAAC,QAAQ,CAAC,CAAC,SAAS,CAAC,CAAC,UAAU,GAAG,YAAY,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,YAAY,CAAC;gBACnH,KAAK,EAAE,GAAG;aACX;;YAED;gBACE,KAAK,EAAE,4CAA4C;gBACnD,OAAO,EAAE,kBAAkB;gBAC3B,UAAU,EAAE,IAAI;gBAChB,QAAQ,EAAE,UAAU;gBACpB,eAAe,EAAE,IAAIA,YAAO,CAACA,YAAO,CAAC,QAAQ,CAAC;qBAC3C,SAAS,CAAC,CAAC,CAAC,EAAE,WAAW,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;qBAClC,KAAK,CAAC,CAAC,UAAU,EAAE,WAAW,EAAE,UAAU,CAAC,CAAC;gBAC/C,KAAK,EAAE,KAAK;aACb;YACD;gBACE,KAAK,EAAE,gDAAgD;gBACvD,OAAO,EAAE,kBAAkB;gBAC3B,UAAU,EAAE,IAAI;gBAChB,QAAQ,EAAE,MAAM;gBAChB,eAAe,EAAE,IAAIA,YAAO,CAACA,YAAO,CAAC,QAAQ,CAAC;qBAC3C,SAAS,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC;qBAC9B,KAAK,CAAC,CAAE,YAAY,EAAE,YAAY,GAAG,CAAC,EAAE,YAAY,CAAE,CAAC;gBAC1D,KAAK,EAAE,KAAK;aACb;YACD;gBACE,KAAK,EAAE,kDAAkD;gBACzD,OAAO,EAAE,kBAAkB;gBAC3B,UAAU,EAAE,IAAI;gBAChB,QAAQ,EAAE,MAAM;gBAChB,IAAI,EAAE,GAAG;gBACT,eAAe,EAAE,IAAIA,YAAO,CAACA,YAAO,CAAC,QAAQ,CAAC,CAAC,SAAS,CAAC,CAAC,YAAY,GAAG,GAAG,EAAE,YAAY,GAAG,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,YAAY,CAAC;gBACzH,KAAK,EAAE,KAAK;aACb;YACD;gBACE,KAAK,EAAE,kDAAkD;gBACzD,OAAO,EAAE,kBAAkB;gBAC3B,UAAU,EAAE,IAAI;gBAChB,QAAQ,EAAE,MAAM;gBAChB,IAAI,EAAE,GAAG;gBACT,eAAe,EAAE,IAAIA,YAAO,CAACA,YAAO,CAAC,QAAQ,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,WAAW,GAAG,YAAY,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,YAAY,CAAC;gBACpH,KAAK,EAAE,KAAK;aACb;;YAED;gBACE,KAAK,EAAE,4CAA4C;gBACnD,OAAO,EAAE,kBAAkB;gBAC3B,UAAU,EAAE,IAAI;gBAChB,QAAQ,EAAE,UAAU;gBACpB,eAAe,EAAE,IAAIA,YAAO,CAACA,YAAO,CAAC,QAAQ,CAAC;qBAC3C,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,UAAU,GAAG,CAAC,CAAC,CAAC;qBACjC,OAAO,CAACF,cAAS,CAAC,EAAE,CAAC,CAAC;qBACtB,KAAK,CAAC,CAAC,UAAU,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC;gBAC9C,KAAK,EAAE,IAAI;aACZ;YACD;gBACE,KAAK,EAAE,gDAAgD;gBACvD,OAAO,EAAE,kBAAkB;gBAC3B,UAAU,EAAE,IAAI;gBAChB,QAAQ,EAAE,MAAM;gBAChB,eAAe,EAAE,IAAIE,YAAO,CAACA,YAAO,CAAC,QAAQ,CAAC;qBAC3C,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,UAAU,CAAC,CAAC;qBAC7B,OAAO,CAACF,cAAS,CAAC,EAAE,CAAC,CAAC;qBACtB,KAAK,CAAC,CAAE,YAAY,EAAE,YAAY,GAAG,CAAC,EAAE,YAAY,CAAE,CAAC;gBAC1D,KAAK,EAAE,IAAI;aACZ;YACD;gBACE,KAAK,EAAE,kDAAkD;gBACzD,OAAO,EAAE,kBAAkB;gBAC3B,UAAU,EAAE,IAAI;gBAChB,QAAQ,EAAE,MAAM;gBAChB,IAAI,EAAE,GAAG;gBACT,eAAe,EAAE,IAAIE,YAAO,CAACA,YAAO,CAAC,QAAQ,CAAC,CAAC,SAAS,CAAC,CAAC,YAAY,GAAG,GAAG,EAAE,CAAE,YAAY,GAAG,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,YAAY,CAAC;gBAC3H,KAAK,EAAE,IAAI;aACZ;YACD;gBACE,KAAK,EAAE,kDAAkD;gBACzD,OAAO,EAAE,kBAAkB;gBAC3B,UAAU,EAAE,IAAI;gBAChB,QAAQ,EAAE,MAAM;gBAChB,IAAI,EAAE,GAAG;gBACT,eAAe,EAAE,IAAIA,YAAO,CAACA,YAAO,CAAC,QAAQ,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,UAAU,GAAG,YAAY,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,YAAY,CAAC;gBACnH,KAAK,EAAE,IAAI;aACZ;SACF,CAAC,MAAM,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,cAAc,IAAI,CAAC,CAAC,QAAQ,KAAK,MAAM,IAAI,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,IAAI,GAAA,CAAuB,CAAC;IACtG;;IC5JA;;;;ICAA;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/ccf-database/ccf-database.d.ts b/ccf-database/ccf-database.d.ts deleted file mode 100644 index 075228695..000000000 --- a/ccf-database/ccf-database.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -/** - * Generated bundle index. Do not edit. - */ -/// -export * from './public-api'; diff --git a/ccf-database/esm2015/ccf-database.js b/ccf-database/esm2015/ccf-database.js deleted file mode 100644 index 89a78ff7c..000000000 --- a/ccf-database/esm2015/ccf-database.js +++ /dev/null @@ -1,5 +0,0 @@ -/** - * Generated bundle index. Do not edit. - */ -export * from './public-api'; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2NmLWRhdGFiYXNlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vcHJvamVjdHMvY2NmLWRhdGFiYXNlL3NyYy9jY2YtZGF0YWJhc2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7O0dBRUc7QUFFSCxjQUFjLGNBQWMsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogR2VuZXJhdGVkIGJ1bmRsZSBpbmRleC4gRG8gbm90IGVkaXQuXG4gKi9cblxuZXhwb3J0ICogZnJvbSAnLi9wdWJsaWMtYXBpJztcbiJdfQ== \ No newline at end of file diff --git a/ccf-database/esm2015/lib/ccf-database.js b/ccf-database/esm2015/lib/ccf-database.js deleted file mode 100644 index 496baa500..000000000 --- a/ccf-database/esm2015/lib/ccf-database.js +++ /dev/null @@ -1,360 +0,0 @@ -import { __awaiter } from "tslib"; -/* eslint-disable @typescript-eslint/member-ordering */ -import { delMany, get, setMany } from 'idb-keyval'; -import { addJsonLdToStore, addN3ToStore, addRdfXmlToStore, DataFactory, deserializeN3Store, serializeN3Store, Store } from 'triple-store-utils'; -import { CCFSpatialGraph } from './ccf-spatial-graph'; -import { CCFSpatialScene } from './ccf-spatial-scene'; -import { searchHubmap } from './hubmap/hubmap-data-import'; -import { getAggregateResults, getDatasetTechnologyNames, getProviderNames } from './queries/aggregate-results-n3'; -import { findIds } from './queries/find-ids-n3'; -import { getCellTypeTermOccurences, getOntologyTermOccurences } from './queries/ontology-term-occurences-n3'; -import { getAnatomicalStructureTreeModel, getCellTypeTreeModel } from './queries/ontology-tree-n3'; -import { getSpatialEntityForEntity } from './queries/spatial-result-n3'; -import { getTissueBlockResult } from './queries/tissue-block-result-n3'; -import { CCFDatabaseStatusTracker } from './util/ccf-database-status-tracker'; -import { patchJsonLd } from './util/patch-jsonld'; -import { enrichRuiLocations } from './util/enrich-rui-locations'; -/** Default initialization options. */ -export const DEFAULT_CCF_DB_OPTIONS = { - 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' -}; -/** Database provider. */ -export class CCFDatabase { - /** - * Creates an instance of ccfdatabase. - * - * @param [options] Initialization options. - */ - constructor(options = DEFAULT_CCF_DB_OPTIONS) { - this.options = options; - this.store = new Store(undefined, { factory: DataFactory }); - this.graph = new CCFSpatialGraph(this); - this.scene = new CCFSpatialScene(this); - } - /** - * Connects the database. - * - * @param [options] Options used to initialize. - * @returns A promise resolving to true if data has been loaded into the database. - */ - connect(options, cached = false) { - return __awaiter(this, void 0, void 0, function* () { - if (options) { - this.options = options; - } - if (!this.initializing) { - if (cached) { - this.initializing = this.cachedConnect(); - } - else { - this.initializing = this.doConnect(); - } - } - yield this.initializing; - return this.store.size > 0; - }); - } - cachedConnect() { - return __awaiter(this, void 0, void 0, function* () { - const start = new Date().getTime(); - const lastModifiedKey = 'ccf-database.last_modified'; - const ccfDatabaseKey = 'ccf-database'; - const lastModified = yield get(lastModifiedKey).catch(() => undefined); - let serializedDb; - if (lastModified && start - new Date(+lastModified).getTime() > 60 * 60 * 1000) { - yield delMany([ccfDatabaseKey, lastModifiedKey]).catch(() => undefined); - } - else { - serializedDb = yield get(ccfDatabaseKey).catch(() => undefined); - } - if (serializedDb) { - yield this.deserialize(serializedDb); - } - else { - yield this.doConnect(); - setMany([ - [ccfDatabaseKey, this.serialize()], - [lastModifiedKey, '' + start] - ]).catch(() => undefined); - } - }); - } - /** - * Actually connects to the database. - * - * @returns A promise resolving to void when connected. - */ - doConnect() { - var _a, _b; - return __awaiter(this, void 0, void 0, function* () { - const ops = []; - const sources = (_b = (_a = this.options.dataSources) === null || _a === void 0 ? void 0 : _a.concat()) !== null && _b !== void 0 ? _b : []; - const ccfOwlUrl = this.options.ccfOwlUrl; - if (ccfOwlUrl.startsWith('{')) { - // serialized n3 store was provided as the ccfOwlUrl - this.store = deserializeN3Store(ccfOwlUrl, DataFactory); - } - else if (ccfOwlUrl.endsWith('.n3store.json')) { - const storeString = yield fetch(ccfOwlUrl).then(r => r.text()) - .catch(() => console.log('Couldn\'t locate serialized store.')); - if (storeString) { - this.store = deserializeN3Store(storeString, DataFactory); - } - } - else if ((ccfOwlUrl === null || ccfOwlUrl === void 0 ? void 0 : ccfOwlUrl.length) > 0) { - sources.push(ccfOwlUrl); - } - if (this.options.hubmapDataUrl) { - if (this.options.hubmapDataUrl.endsWith('jsonld')) { - sources.push(this.options.hubmapDataUrl); - } - else { - ops.push(searchHubmap(this.options.hubmapDataUrl, this.options.hubmapDataService, this.options.hubmapQuery, this.options.hubmapToken, this.options.hubmapAssetsUrl, this.options.hubmapPortalUrl).then((jsonld) => { - if (jsonld) { - return this.addDataSources([jsonld]); - } - else { - return undefined; - } - })); - } - } - ops.push(this.addDataSources(sources)); - yield Promise.all(ops); - yield this.synchronize(); - }); - } - addDataSources(sources, inputStore) { - return __awaiter(this, void 0, void 0, function* () { - const store = inputStore !== null && inputStore !== void 0 ? inputStore : this.store; - yield Promise.all(sources.map((source) => __awaiter(this, void 0, void 0, function* () { - if (typeof source === 'string') { - if ((source.startsWith('http') || source.startsWith('assets/')) && source.includes('jsonld')) { - source = yield fetch(source).then(r => r.text()); - source = patchJsonLd(source); - yield addJsonLdToStore(source, store); - } - else if (source.endsWith('n3')) { - yield addN3ToStore(source, store); - } - else if (source.endsWith('rdf') || source.endsWith('owl') || source.endsWith('xml')) { - yield addRdfXmlToStore(source, store); - } - else { - // Passthrough assumes a JSON-LD response - source = patchJsonLd(source); - yield addJsonLdToStore(source, store); - } - } - else { - source = patchJsonLd(JSON.stringify(source)); - yield addJsonLdToStore(source, store); - } - }))); - return this; - }); - } - synchronize() { - return __awaiter(this, void 0, void 0, function* () { - // Add a small delay to allow the triple store to settle - yield new Promise(r => { - setTimeout(r, 500); - }); - this.graph.createGraph(); - enrichRuiLocations(this.store); - return this; - }); - } - serialize() { - return serializeN3Store(this.store); - } - deserialize(value) { - return __awaiter(this, void 0, void 0, function* () { - this.store = deserializeN3Store(value, DataFactory); - this.graph = new CCFSpatialGraph(this); - this.scene = new CCFSpatialScene(this); - yield new Promise(r => { - setTimeout(r, 10); - }); - }); - } - /** - * Gets all ids matching the filter. - * - * @param [filter] The filter. - * @returns A set of all matching ids. - */ - getIds(filter = {}) { - return findIds(this.store, this.graph, filter); - } - /** - * Gets the data for an object. - * - * @param id The id of the requested object. - * @returns The object data. - */ - get(id) { - return this.store.getQuads(DataFactory.namedNode(id), null, null, null); - } - /** - * Gets the data for objects matching a filter. - * - * @param [filter] The filter. - * @returns An array of data. - */ - search(filter = {}) { - return [...this.getIds(filter)].map((s) => this.get(s)); - } - /** - * Gets all spatial entities for a filter. - * - * @param [filter] The filter. - * @returns A list of spatial entities. - */ - getSpatialEntities(filter) { - // eslint-disable-next-line @typescript-eslint/consistent-type-assertions - filter = Object.assign(Object.assign({}, filter), { hasSpatialEntity: true }); - return [...this.getIds(filter)].map((s) => getSpatialEntityForEntity(this.store, s)); - } - getDatabaseStatus() { - return __awaiter(this, void 0, void 0, function* () { - if (!this.status) { - this.status = new CCFDatabaseStatusTracker(this); - } - return this.status.toJson(); - }); - } - /** - * Get a list of technology names used by datasets - * - * @returns list of unique technology names in the data - */ - getDatasetTechnologyNames() { - return __awaiter(this, void 0, void 0, function* () { - return getDatasetTechnologyNames(this.store); - }); - } - /** - * Get a list of provider names from the database - * - * @returns list of unique provider names in the data - */ - getProviderNames() { - return __awaiter(this, void 0, void 0, function* () { - return getProviderNames(this.store); - }); - } - /** - * Gets all tissue block results for a filter. - * - * @param [filter] The filter. - * @returns A list of results. - */ - getTissueBlockResults(filter) { - return __awaiter(this, void 0, void 0, function* () { - // eslint-disable-next-line @typescript-eslint/consistent-type-assertions - filter = Object.assign(Object.assign({}, filter), { hasSpatialEntity: true }); - return [...this.getIds(filter)].map((s) => getTissueBlockResult(this.store, s)); - }); - } - /** - * Gets all aggregate results for a filter. - * - * @param [filter] The filter. - * @returns A list of aggregate data. - */ - getAggregateResults(filter) { - return __awaiter(this, void 0, void 0, function* () { - return getAggregateResults(this.getIds(filter), this.store); - }); - } - /** - * Get number of occurrences of ontology terms for a set of ids. - * - * @param [filter] The filter. - * @returns Ontology term counts. - */ - getOntologyTermOccurences(filter) { - return __awaiter(this, void 0, void 0, function* () { - return getOntologyTermOccurences(this.getIds(filter), this.store); - }); - } - /** - * Get number of occurrences of cell type terms for a set of ids. - * - * @param [filter] The filter. - * @returns Cell type term counts. - */ - getCellTypeTermOccurences(filter) { - return __awaiter(this, void 0, void 0, function* () { - return getCellTypeTermOccurences(this.getIds(filter), this.store); - }); - } - /** - * Get ontology term tree nodes - * - * @returns Ontology term counts. - */ - getOntologyTreeModel() { - return __awaiter(this, void 0, void 0, function* () { - return getAnatomicalStructureTreeModel(this.store); - }); - } - /** - * Get cell type term tree nodes - * - * @returns Ontology term counts. - */ - getCellTypeTreeModel() { - return __awaiter(this, void 0, void 0, function* () { - return getCellTypeTreeModel(this.store); - }); - } - /** - * Get reference organs - * - * @returns Ontology term counts. - */ - getReferenceOrgans() { - return __awaiter(this, void 0, void 0, function* () { - return this.scene.getReferenceOrgans(); - }); - } - /** - * Get all nodes to form the 3D scene of reference body, organs, and tissues - * - * @param [filter] The filter. - * @returns A list of Spatial Scene Nodes for the 3D Scene - */ - getScene(filter) { - return __awaiter(this, void 0, void 0, function* () { - this.graph.createGraph(); - return this.scene.getScene(filter); - }); - } - /** - * Get all nodes to form the 3D scene of reference organ and tissues - * - * @param [organIri] The Reference Organ IRI - * @param [filter] The filter. - * @returns A list of Spatial Scene Nodes for the 3D Scene - */ - getReferenceOrganScene(organIri, filter) { - return __awaiter(this, void 0, void 0, function* () { - this.graph.createGraph(); - return this.scene.getReferenceOrganScene(organIri, filter); - }); - } - getSpatialPlacement(source, targetIri) { - return __awaiter(this, void 0, void 0, function* () { - return this.graph.getSpatialPlacement(source, targetIri); - }); - } -} -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2NmLWRhdGFiYXNlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vcHJvamVjdHMvY2NmLWRhdGFiYXNlL3NyYy9saWIvY2NmLWRhdGFiYXNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSx1REFBdUQ7QUFDdkQsT0FBTyxFQUFFLE9BQU8sRUFBRSxHQUFHLEVBQUUsT0FBTyxFQUFFLE1BQU0sWUFBWSxDQUFDO0FBRW5ELE9BQU8sRUFDTCxnQkFBZ0IsRUFBRSxZQUFZLEVBQUUsZ0JBQWdCLEVBQUUsV0FBVyxFQUFFLGtCQUFrQixFQUFRLGdCQUFnQixFQUFFLEtBQUssRUFDakgsTUFBTSxvQkFBb0IsQ0FBQztBQUU1QixPQUFPLEVBQUUsZUFBZSxFQUFFLE1BQU0scUJBQXFCLENBQUM7QUFDdEQsT0FBTyxFQUFFLGVBQWUsRUFBb0IsTUFBTSxxQkFBcUIsQ0FBQztBQUN4RSxPQUFPLEVBQUUsWUFBWSxFQUFFLE1BQU0sNkJBQTZCLENBQUM7QUFFM0QsT0FBTyxFQUFFLG1CQUFtQixFQUFFLHlCQUF5QixFQUFFLGdCQUFnQixFQUFFLE1BQU0sZ0NBQWdDLENBQUM7QUFDbEgsT0FBTyxFQUFFLE9BQU8sRUFBRSxNQUFNLHVCQUF1QixDQUFDO0FBQ2hELE9BQU8sRUFBRSx5QkFBeUIsRUFBRSx5QkFBeUIsRUFBRSxNQUFNLHVDQUF1QyxDQUFDO0FBQzdHLE9BQU8sRUFBRSwrQkFBK0IsRUFBRSxvQkFBb0IsRUFBRSxNQUFNLDRCQUE0QixDQUFDO0FBQ25HLE9BQU8sRUFBRSx5QkFBeUIsRUFBRSxNQUFNLDZCQUE2QixDQUFDO0FBQ3hFLE9BQU8sRUFBRSxvQkFBb0IsRUFBRSxNQUFNLGtDQUFrQyxDQUFDO0FBRXhFLE9BQU8sRUFBRSx3QkFBd0IsRUFBRSxNQUFNLG9DQUFvQyxDQUFDO0FBQzlFLE9BQU8sRUFBRSxXQUFXLEVBQUUsTUFBTSxxQkFBcUIsQ0FBQztBQUNsRCxPQUFPLEVBQUUsa0JBQWtCLEVBQUUsTUFBTSw2QkFBNkIsQ0FBQztBQXlCakUsc0NBQXNDO0FBQ3RDLE1BQU0sQ0FBQyxNQUFNLHNCQUFzQixHQUF1QjtJQUN4RCxTQUFTLEVBQUUscUNBQXFDO0lBQ2hELGFBQWEsRUFBRSxnREFBZ0Q7SUFDL0QsV0FBVyxFQUFFLEVBQUU7SUFDZixpQkFBaUIsRUFBRSxRQUFRO0lBQzNCLGVBQWUsRUFBRSxzQ0FBc0M7SUFDdkQsYUFBYSxFQUFFLEVBQUU7SUFDakIsZUFBZSxFQUFFLHFDQUFxQztDQUN2RCxDQUFDO0FBRUYseUJBQXlCO0FBQ3pCLE1BQU0sT0FBTyxXQUFXO0lBWXRCOzs7O09BSUc7SUFDSCxZQUFtQixVQUE4QixzQkFBc0I7UUFBcEQsWUFBTyxHQUFQLE9BQU8sQ0FBNkM7UUFDckUsSUFBSSxDQUFDLEtBQUssR0FBRyxJQUFJLEtBQUssQ0FBQyxTQUFTLEVBQUUsRUFBRSxPQUFPLEVBQUUsV0FBVyxFQUFFLENBQUMsQ0FBQztRQUM1RCxJQUFJLENBQUMsS0FBSyxHQUFHLElBQUksZUFBZSxDQUFDLElBQUksQ0FBQyxDQUFDO1FBQ3ZDLElBQUksQ0FBQyxLQUFLLEdBQUcsSUFBSSxlQUFlLENBQUMsSUFBSSxDQUFDLENBQUM7SUFDekMsQ0FBQztJQUVEOzs7OztPQUtHO0lBQ0csT0FBTyxDQUFDLE9BQTRCLEVBQUUsTUFBTSxHQUFHLEtBQUs7O1lBQ3hELElBQUksT0FBTyxFQUFFO2dCQUNYLElBQUksQ0FBQyxPQUFPLEdBQUcsT0FBTyxDQUFDO2FBQ3hCO1lBQ0QsSUFBSSxDQUFDLElBQUksQ0FBQyxZQUFZLEVBQUU7Z0JBQ3RCLElBQUksTUFBTSxFQUFFO29CQUNWLElBQUksQ0FBQyxZQUFZLEdBQUcsSUFBSSxDQUFDLGFBQWEsRUFBRSxDQUFDO2lCQUMxQztxQkFBTTtvQkFDTCxJQUFJLENBQUMsWUFBWSxHQUFHLElBQUksQ0FBQyxTQUFTLEVBQUUsQ0FBQztpQkFDdEM7YUFDRjtZQUNELE1BQU0sSUFBSSxDQUFDLFlBQVksQ0FBQztZQUN4QixPQUFPLElBQUksQ0FBQyxLQUFLLENBQUMsSUFBSSxHQUFHLENBQUMsQ0FBQztRQUM3QixDQUFDO0tBQUE7SUFFYSxhQUFhOztZQUN6QixNQUFNLEtBQUssR0FBRyxJQUFJLElBQUksRUFBRSxDQUFDLE9BQU8sRUFBRSxDQUFDO1lBQ25DLE1BQU0sZUFBZSxHQUFHLDRCQUE0QixDQUFDO1lBQ3JELE1BQU0sY0FBYyxHQUFHLGNBQWMsQ0FBQztZQUV0QyxNQUFNLFlBQVksR0FBRyxNQUFNLEdBQUcsQ0FBQyxlQUFlLENBQUMsQ0FBQyxLQUFLLENBQUMsR0FBRyxFQUFFLENBQUMsU0FBUyxDQUFDLENBQUM7WUFDdkUsSUFBSSxZQUFnQyxDQUFDO1lBRXJDLElBQUksWUFBWSxJQUFJLEtBQUssR0FBRyxJQUFJLElBQUksQ0FBQyxDQUFDLFlBQVksQ0FBQyxDQUFDLE9BQU8sRUFBRSxHQUFHLEVBQUUsR0FBQyxFQUFFLEdBQUMsSUFBSSxFQUFFO2dCQUMxRSxNQUFNLE9BQU8sQ0FBQyxDQUFDLGNBQWMsRUFBRSxlQUFlLENBQUMsQ0FBQyxDQUFDLEtBQUssQ0FBQyxHQUFHLEVBQUUsQ0FBQyxTQUFTLENBQUMsQ0FBQzthQUN6RTtpQkFBTTtnQkFDTCxZQUFZLEdBQUcsTUFBTSxHQUFHLENBQUMsY0FBYyxDQUFDLENBQUMsS0FBSyxDQUFDLEdBQUcsRUFBRSxDQUFDLFNBQVMsQ0FBQyxDQUFDO2FBQ2pFO1lBRUQsSUFBSSxZQUFZLEVBQUU7Z0JBQ2hCLE1BQU0sSUFBSSxDQUFDLFdBQVcsQ0FBQyxZQUFZLENBQUMsQ0FBQzthQUN0QztpQkFBTTtnQkFDTCxNQUFNLElBQUksQ0FBQyxTQUFTLEVBQUUsQ0FBQztnQkFFdkIsT0FBTyxDQUFDO29CQUNOLENBQUMsY0FBYyxFQUFFLElBQUksQ0FBQyxTQUFTLEVBQUUsQ0FBQztvQkFDbEMsQ0FBQyxlQUFlLEVBQUUsRUFBRSxHQUFHLEtBQUssQ0FBQztpQkFDOUIsQ0FBQyxDQUFDLEtBQUssQ0FBQyxHQUFHLEVBQUUsQ0FBQyxTQUFTLENBQUMsQ0FBQzthQUMzQjtRQUNILENBQUM7S0FBQTtJQUVEOzs7O09BSUc7SUFDVyxTQUFTOzs7WUFDckIsTUFBTSxHQUFHLEdBQXVCLEVBQUUsQ0FBQztZQUNuQyxNQUFNLE9BQU8sR0FBc0IsTUFBQSxNQUFBLElBQUksQ0FBQyxPQUFPLENBQUMsV0FBVywwQ0FBRSxNQUFNLEVBQUUsbUNBQUksRUFBRSxDQUFDO1lBRTVFLE1BQU0sU0FBUyxHQUFHLElBQUksQ0FBQyxPQUFPLENBQUMsU0FBUyxDQUFDO1lBQ3pDLElBQUksU0FBUyxDQUFDLFVBQVUsQ0FBQyxHQUFHLENBQUMsRUFBRTtnQkFDN0Isb0RBQW9EO2dCQUNwRCxJQUFJLENBQUMsS0FBSyxHQUFHLGtCQUFrQixDQUFDLFNBQVMsRUFBRSxXQUFXLENBQUMsQ0FBQzthQUN6RDtpQkFBTSxJQUFJLFNBQVMsQ0FBQyxRQUFRLENBQUMsZUFBZSxDQUFDLEVBQUU7Z0JBQzlDLE1BQU0sV0FBVyxHQUFHLE1BQU0sS0FBSyxDQUFDLFNBQVMsQ0FBQyxDQUFDLElBQUksQ0FBQyxDQUFDLENBQUMsRUFBRSxDQUFDLENBQUMsQ0FBQyxJQUFJLEVBQUUsQ0FBQztxQkFDM0QsS0FBSyxDQUFDLEdBQUcsRUFBRSxDQUFDLE9BQU8sQ0FBQyxHQUFHLENBQUMsb0NBQW9DLENBQUMsQ0FBQyxDQUFDO2dCQUNsRSxJQUFJLFdBQVcsRUFBRTtvQkFDZixJQUFJLENBQUMsS0FBSyxHQUFHLGtCQUFrQixDQUFDLFdBQVcsRUFBRSxXQUFXLENBQUMsQ0FBQztpQkFDM0Q7YUFDRjtpQkFBTSxJQUFJLENBQUEsU0FBUyxhQUFULFNBQVMsdUJBQVQsU0FBUyxDQUFFLE1BQU0sSUFBRyxDQUFDLEVBQUU7Z0JBQ2hDLE9BQU8sQ0FBQyxJQUFJLENBQUMsU0FBUyxDQUFDLENBQUM7YUFDekI7WUFDRCxJQUFJLElBQUksQ0FBQyxPQUFPLENBQUMsYUFBYSxFQUFFO2dCQUM5QixJQUFJLElBQUksQ0FBQyxPQUFPLENBQUMsYUFBYSxDQUFDLFFBQVEsQ0FBQyxRQUFRLENBQUMsRUFBRTtvQkFDakQsT0FBTyxDQUFDLElBQUksQ0FBQyxJQUFJLENBQUMsT0FBTyxDQUFDLGFBQWEsQ0FBQyxDQUFDO2lCQUMxQztxQkFBTTtvQkFDTCxHQUFHLENBQUMsSUFBSSxDQUFDLFlBQVksQ0FDbkIsSUFBSSxDQUFDLE9BQU8sQ0FBQyxhQUFhLEVBQzFCLElBQUksQ0FBQyxPQUFPLENBQUMsaUJBQWlCLEVBQzlCLElBQUksQ0FBQyxPQUFPLENBQUMsV0FBVyxFQUN4QixJQUFJLENBQUMsT0FBTyxDQUFDLFdBQVcsRUFDeEIsSUFBSSxDQUFDLE9BQU8sQ0FBQyxlQUFlLEVBQzVCLElBQUksQ0FBQyxPQUFPLENBQUMsZUFBZSxDQUM3QixDQUFDLElBQUksQ0FBQyxDQUFDLE1BQU0sRUFBRSxFQUFFO3dCQUNoQixJQUFJLE1BQU0sRUFBRTs0QkFDVixPQUFPLElBQUksQ0FBQyxjQUFjLENBQUMsQ0FBQyxNQUFNLENBQUMsQ0FBQyxDQUFDO3lCQUN0Qzs2QkFBTTs0QkFDTCxPQUFPLFNBQVMsQ0FBQzt5QkFDbEI7b0JBQ0gsQ0FBQyxDQUFDLENBQUMsQ0FBQztpQkFDTDthQUNGO1lBQ0QsR0FBRyxDQUFDLElBQUksQ0FBQyxJQUFJLENBQUMsY0FBYyxDQUFDLE9BQU8sQ0FBQyxDQUFDLENBQUM7WUFDdkMsTUFBTSxPQUFPLENBQUMsR0FBRyxDQUFDLEdBQUcsQ0FBQyxDQUFDO1lBQ3ZCLE1BQU0sSUFBSSxDQUFDLFdBQVcsRUFBRSxDQUFDOztLQUMxQjtJQUVLLGNBQWMsQ0FBQyxPQUEwQixFQUFFLFVBQWtCOztZQUNqRSxNQUFNLEtBQUssR0FBVSxVQUFVLGFBQVYsVUFBVSxjQUFWLFVBQVUsR0FBSSxJQUFJLENBQUMsS0FBSyxDQUFDO1lBQzlDLE1BQU0sT0FBTyxDQUFDLEdBQUcsQ0FDZixPQUFPLENBQUMsR0FBRyxDQUFDLENBQU8sTUFBTSxFQUFFLEVBQUU7Z0JBQzNCLElBQUksT0FBTyxNQUFNLEtBQUssUUFBUSxFQUFFO29CQUM5QixJQUFJLENBQUMsTUFBTSxDQUFDLFVBQVUsQ0FBQyxNQUFNLENBQUMsSUFBSSxNQUFNLENBQUMsVUFBVSxDQUFDLFNBQVMsQ0FBQyxDQUFDLElBQUksTUFBTSxDQUFDLFFBQVEsQ0FBQyxRQUFRLENBQUMsRUFBRTt3QkFDNUYsTUFBTSxHQUFHLE1BQU0sS0FBSyxDQUFDLE1BQU0sQ0FBQyxDQUFDLElBQUksQ0FBQyxDQUFDLENBQUMsRUFBRSxDQUFDLENBQUMsQ0FBQyxJQUFJLEVBQUUsQ0FBQyxDQUFDO3dCQUNqRCxNQUFNLEdBQUcsV0FBVyxDQUFDLE1BQWdCLENBQUMsQ0FBQzt3QkFDdkMsTUFBTSxnQkFBZ0IsQ0FBQyxNQUFNLEVBQUUsS0FBSyxDQUFDLENBQUM7cUJBQ3ZDO3lCQUFNLElBQUksTUFBTSxDQUFDLFFBQVEsQ0FBQyxJQUFJLENBQUMsRUFBRTt3QkFDaEMsTUFBTSxZQUFZLENBQUMsTUFBTSxFQUFFLEtBQUssQ0FBQyxDQUFDO3FCQUNuQzt5QkFBTSxJQUFJLE1BQU0sQ0FBQyxRQUFRLENBQUMsS0FBSyxDQUFDLElBQUksTUFBTSxDQUFDLFFBQVEsQ0FBQyxLQUFLLENBQUMsSUFBSSxNQUFNLENBQUMsUUFBUSxDQUFDLEtBQUssQ0FBQyxFQUFFO3dCQUNyRixNQUFNLGdCQUFnQixDQUFDLE1BQU0sRUFBRSxLQUFLLENBQUMsQ0FBQztxQkFDdkM7eUJBQU07d0JBQ0wseUNBQXlDO3dCQUN6QyxNQUFNLEdBQUcsV0FBVyxDQUFDLE1BQU0sQ0FBQyxDQUFDO3dCQUM3QixNQUFNLGdCQUFnQixDQUFDLE1BQU0sRUFBRSxLQUFLLENBQUMsQ0FBQztxQkFDdkM7aUJBQ0Y7cUJBQU07b0JBQ0wsTUFBTSxHQUFHLFdBQVcsQ0FBQyxJQUFJLENBQUMsU0FBUyxDQUFDLE1BQU0sQ0FBQyxDQUFDLENBQUM7b0JBQzdDLE1BQU0sZ0JBQWdCLENBQUMsTUFBTSxFQUFFLEtBQUssQ0FBQyxDQUFDO2lCQUN2QztZQUNILENBQUMsQ0FBQSxDQUFDLENBQ0gsQ0FBQztZQUNGLE9BQU8sSUFBSSxDQUFDO1FBQ2QsQ0FBQztLQUFBO0lBRUssV0FBVzs7WUFDZix3REFBd0Q7WUFDeEQsTUFBTSxJQUFJLE9BQU8sQ0FBQyxDQUFDLENBQUMsRUFBRTtnQkFDcEIsVUFBVSxDQUFDLENBQUMsRUFBRSxHQUFHLENBQUMsQ0FBQztZQUNyQixDQUFDLENBQUMsQ0FBQztZQUNILElBQUksQ0FBQyxLQUFLLENBQUMsV0FBVyxFQUFFLENBQUM7WUFDekIsa0JBQWtCLENBQUMsSUFBSSxDQUFDLEtBQUssQ0FBQyxDQUFDO1lBQy9CLE9BQU8sSUFBSSxDQUFDO1FBQ2QsQ0FBQztLQUFBO0lBRUQsU0FBUztRQUNQLE9BQU8sZ0JBQWdCLENBQUMsSUFBSSxDQUFDLEtBQUssQ0FBQyxDQUFDO0lBQ3RDLENBQUM7SUFFSyxXQUFXLENBQUMsS0FBYTs7WUFDN0IsSUFBSSxDQUFDLEtBQUssR0FBRyxrQkFBa0IsQ0FBQyxLQUFLLEVBQUUsV0FBVyxDQUFDLENBQUM7WUFDcEQsSUFBSSxDQUFDLEtBQUssR0FBRyxJQUFJLGVBQWUsQ0FBQyxJQUFJLENBQUMsQ0FBQztZQUN2QyxJQUFJLENBQUMsS0FBSyxHQUFHLElBQUksZUFBZSxDQUFDLElBQUksQ0FBQyxDQUFDO1lBQ3ZDLE1BQU0sSUFBSSxPQUFPLENBQUMsQ0FBQyxDQUFDLEVBQUU7Z0JBQ3BCLFVBQVUsQ0FBQyxDQUFDLEVBQUUsRUFBRSxDQUFDLENBQUM7WUFDcEIsQ0FBQyxDQUFDLENBQUM7UUFDTCxDQUFDO0tBQUE7SUFFRDs7Ozs7T0FLRztJQUNILE1BQU0sQ0FBQyxTQUFpQixFQUFZO1FBQ2xDLE9BQU8sT0FBTyxDQUFDLElBQUksQ0FBQyxLQUFLLEVBQUUsSUFBSSxDQUFDLEtBQUssRUFBRSxNQUFNLENBQUMsQ0FBQztJQUNqRCxDQUFDO0lBRUQ7Ozs7O09BS0c7SUFDSCxHQUFHLENBQUMsRUFBVTtRQUNaLE9BQU8sSUFBSSxDQUFDLEtBQUssQ0FBQyxRQUFRLENBQUMsV0FBVyxDQUFDLFNBQVMsQ0FBQyxFQUFFLENBQUMsRUFBRSxJQUFJLEVBQUUsSUFBSSxFQUFFLElBQUksQ0FBQyxDQUFDO0lBQzFFLENBQUM7SUFFRDs7Ozs7T0FLRztJQUNILE1BQU0sQ0FBQyxTQUFpQixFQUFZO1FBQ2xDLE9BQU8sQ0FBQyxHQUFHLElBQUksQ0FBQyxNQUFNLENBQUMsTUFBTSxDQUFDLENBQUMsQ0FBQyxHQUFHLENBQUMsQ0FBQyxDQUFDLEVBQUUsRUFBRSxDQUFDLElBQUksQ0FBQyxHQUFHLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztJQUMxRCxDQUFDO0lBRUQ7Ozs7O09BS0c7SUFDSCxrQkFBa0IsQ0FBQyxNQUFlO1FBQ2hDLHlFQUF5RTtRQUN6RSxNQUFNLEdBQUcsZ0NBQUssTUFBTSxLQUFFLGdCQUFnQixFQUFFLElBQUksR0FBWSxDQUFDO1FBQ3pELE9BQU8sQ0FBQyxHQUFHLElBQUksQ0FBQyxNQUFNLENBQUMsTUFBTSxDQUFDLENBQUMsQ0FBQyxHQUFHLENBQUMsQ0FBQyxDQUFDLEVBQUUsRUFBRSxDQUFDLHlCQUF5QixDQUFDLElBQUksQ0FBQyxLQUFLLEVBQUUsQ0FBQyxDQUFrQixDQUFDLENBQUM7SUFDeEcsQ0FBQztJQUVLLGlCQUFpQjs7WUFDckIsSUFBSSxDQUFDLElBQUksQ0FBQyxNQUFNLEVBQUU7Z0JBQ2hCLElBQUksQ0FBQyxNQUFNLEdBQUcsSUFBSSx3QkFBd0IsQ0FBQyxJQUFJLENBQUMsQ0FBQzthQUNsRDtZQUNELE9BQU8sSUFBSSxDQUFDLE1BQU0sQ0FBQyxNQUFNLEVBQUUsQ0FBQztRQUM5QixDQUFDO0tBQUE7SUFFRDs7OztPQUlHO0lBQ0cseUJBQXlCOztZQUM3QixPQUFPLHlCQUF5QixDQUFDLElBQUksQ0FBQyxLQUFLLENBQUMsQ0FBQztRQUMvQyxDQUFDO0tBQUE7SUFFRDs7OztPQUlHO0lBQ0csZ0JBQWdCOztZQUNwQixPQUFPLGdCQUFnQixDQUFDLElBQUksQ0FBQyxLQUFLLENBQUMsQ0FBQztRQUN0QyxDQUFDO0tBQUE7SUFFRDs7Ozs7T0FLRztJQUNHLHFCQUFxQixDQUFDLE1BQWU7O1lBQ3pDLHlFQUF5RTtZQUN6RSxNQUFNLEdBQUcsZ0NBQUssTUFBTSxLQUFFLGdCQUFnQixFQUFFLElBQUksR0FBWSxDQUFDO1lBQ3pELE9BQU8sQ0FBQyxHQUFHLElBQUksQ0FBQyxNQUFNLENBQUMsTUFBTSxDQUFDLENBQUMsQ0FBQyxHQUFHLENBQUMsQ0FBQyxDQUFDLEVBQUUsRUFBRSxDQUFDLG9CQUFvQixDQUFDLElBQUksQ0FBQyxLQUFLLEVBQUUsQ0FBQyxDQUFDLENBQUMsQ0FBQztRQUNsRixDQUFDO0tBQUE7SUFFRDs7Ozs7T0FLRztJQUNHLG1CQUFtQixDQUFDLE1BQWU7O1lBQ3ZDLE9BQU8sbUJBQW1CLENBQUMsSUFBSSxDQUFDLE1BQU0sQ0FBQyxNQUFNLENBQUMsRUFBRSxJQUFJLENBQUMsS0FBSyxDQUFDLENBQUM7UUFDOUQsQ0FBQztLQUFBO0lBRUQ7Ozs7O09BS0c7SUFDRyx5QkFBeUIsQ0FBQyxNQUFlOztZQUM3QyxPQUFPLHlCQUF5QixDQUFDLElBQUksQ0FBQyxNQUFNLENBQUMsTUFBTSxDQUFDLEVBQUUsSUFBSSxDQUFDLEtBQUssQ0FBQyxDQUFDO1FBQ3BFLENBQUM7S0FBQTtJQUVEOzs7OztPQUtHO0lBQ0cseUJBQXlCLENBQUMsTUFBZTs7WUFDN0MsT0FBTyx5QkFBeUIsQ0FBQyxJQUFJLENBQUMsTUFBTSxDQUFDLE1BQU0sQ0FBQyxFQUFFLElBQUksQ0FBQyxLQUFLLENBQUMsQ0FBQztRQUNwRSxDQUFDO0tBQUE7SUFFRDs7OztPQUlHO0lBQ0csb0JBQW9COztZQUN4QixPQUFPLCtCQUErQixDQUFDLElBQUksQ0FBQyxLQUFLLENBQUMsQ0FBQztRQUNyRCxDQUFDO0tBQUE7SUFFRDs7OztPQUlHO0lBQ0csb0JBQW9COztZQUN4QixPQUFPLG9CQUFvQixDQUFDLElBQUksQ0FBQyxLQUFLLENBQUMsQ0FBQztRQUMxQyxDQUFDO0tBQUE7SUFFRDs7OztPQUlHO0lBQ0csa0JBQWtCOztZQUN0QixPQUFPLElBQUksQ0FBQyxLQUFLLENBQUMsa0JBQWtCLEVBQUUsQ0FBQztRQUN6QyxDQUFDO0tBQUE7SUFFRDs7Ozs7T0FLRztJQUNHLFFBQVEsQ0FBQyxNQUFlOztZQUM1QixJQUFJLENBQUMsS0FBSyxDQUFDLFdBQVcsRUFBRSxDQUFDO1lBQ3pCLE9BQU8sSUFBSSxDQUFDLEtBQUssQ0FBQyxRQUFRLENBQUMsTUFBTSxDQUFDLENBQUM7UUFDckMsQ0FBQztLQUFBO0lBRUQ7Ozs7OztPQU1HO0lBQ0csc0JBQXNCLENBQUMsUUFBZ0IsRUFBRSxNQUFlOztZQUM1RCxJQUFJLENBQUMsS0FBSyxDQUFDLFdBQVcsRUFBRSxDQUFDO1lBQ3pCLE9BQU8sSUFBSSxDQUFDLEtBQUssQ0FBQyxzQkFBc0IsQ0FBQyxRQUFRLEVBQUUsTUFBTSxDQUFDLENBQUM7UUFDN0QsQ0FBQztLQUFBO0lBRUssbUJBQW1CLENBQUMsTUFBcUIsRUFBRSxTQUFpQjs7WUFDaEUsT0FBTyxJQUFJLENBQUMsS0FBSyxDQUFDLG1CQUFtQixDQUFDLE1BQU0sRUFBRSxTQUFTLENBQUMsQ0FBQztRQUMzRCxDQUFDO0tBQUE7Q0FDRiIsInNvdXJjZXNDb250ZW50IjpbIi8qIGVzbGludC1kaXNhYmxlIEB0eXBlc2NyaXB0LWVzbGludC9tZW1iZXItb3JkZXJpbmcgKi9cbmltcG9ydCB7IGRlbE1hbnksIGdldCwgc2V0TWFueSB9IGZyb20gJ2lkYi1rZXl2YWwnO1xuaW1wb3J0IHsgSnNvbkxkIH0gZnJvbSAnanNvbmxkL2pzb25sZC1zcGVjJztcbmltcG9ydCB7XG4gIGFkZEpzb25MZFRvU3RvcmUsIGFkZE4zVG9TdG9yZSwgYWRkUmRmWG1sVG9TdG9yZSwgRGF0YUZhY3RvcnksIGRlc2VyaWFsaXplTjNTdG9yZSwgUXVhZCwgc2VyaWFsaXplTjNTdG9yZSwgU3RvcmVcbn0gZnJvbSAndHJpcGxlLXN0b3JlLXV0aWxzJztcblxuaW1wb3J0IHsgQ0NGU3BhdGlhbEdyYXBoIH0gZnJvbSAnLi9jY2Ytc3BhdGlhbC1ncmFwaCc7XG5pbXBvcnQgeyBDQ0ZTcGF0aWFsU2NlbmUsIFNwYXRpYWxTY2VuZU5vZGUgfSBmcm9tICcuL2NjZi1zcGF0aWFsLXNjZW5lJztcbmltcG9ydCB7IHNlYXJjaEh1Ym1hcCB9IGZyb20gJy4vaHVibWFwL2h1Ym1hcC1kYXRhLWltcG9ydCc7XG5pbXBvcnQgeyBBZ2dyZWdhdGVSZXN1bHQsIERhdGFiYXNlU3RhdHVzLCBGaWx0ZXIsIE9udG9sb2d5VHJlZU1vZGVsLCBUaXNzdWVCbG9ja1Jlc3VsdCB9IGZyb20gJy4vaW50ZXJmYWNlcyc7XG5pbXBvcnQgeyBnZXRBZ2dyZWdhdGVSZXN1bHRzLCBnZXREYXRhc2V0VGVjaG5vbG9neU5hbWVzLCBnZXRQcm92aWRlck5hbWVzIH0gZnJvbSAnLi9xdWVyaWVzL2FnZ3JlZ2F0ZS1yZXN1bHRzLW4zJztcbmltcG9ydCB7IGZpbmRJZHMgfSBmcm9tICcuL3F1ZXJpZXMvZmluZC1pZHMtbjMnO1xuaW1wb3J0IHsgZ2V0Q2VsbFR5cGVUZXJtT2NjdXJlbmNlcywgZ2V0T250b2xvZ3lUZXJtT2NjdXJlbmNlcyB9IGZyb20gJy4vcXVlcmllcy9vbnRvbG9neS10ZXJtLW9jY3VyZW5jZXMtbjMnO1xuaW1wb3J0IHsgZ2V0QW5hdG9taWNhbFN0cnVjdHVyZVRyZWVNb2RlbCwgZ2V0Q2VsbFR5cGVUcmVlTW9kZWwgfSBmcm9tICcuL3F1ZXJpZXMvb250b2xvZ3ktdHJlZS1uMyc7XG5pbXBvcnQgeyBnZXRTcGF0aWFsRW50aXR5Rm9yRW50aXR5IH0gZnJvbSAnLi9xdWVyaWVzL3NwYXRpYWwtcmVzdWx0LW4zJztcbmltcG9ydCB7IGdldFRpc3N1ZUJsb2NrUmVzdWx0IH0gZnJvbSAnLi9xdWVyaWVzL3Rpc3N1ZS1ibG9jay1yZXN1bHQtbjMnO1xuaW1wb3J0IHsgRmxhdFNwYXRpYWxQbGFjZW1lbnQsIFNwYXRpYWxFbnRpdHkgfSBmcm9tICcuL3NwYXRpYWwtdHlwZXMnO1xuaW1wb3J0IHsgQ0NGRGF0YWJhc2VTdGF0dXNUcmFja2VyIH0gZnJvbSAnLi91dGlsL2NjZi1kYXRhYmFzZS1zdGF0dXMtdHJhY2tlcic7XG5pbXBvcnQgeyBwYXRjaEpzb25MZCB9IGZyb20gJy4vdXRpbC9wYXRjaC1qc29ubGQnO1xuaW1wb3J0IHsgZW5yaWNoUnVpTG9jYXRpb25zIH0gZnJvbSAnLi91dGlsL2VucmljaC1ydWktbG9jYXRpb25zJztcblxuXG4vKiogRGF0YWJhc2UgaW5pdGlhbGl6YXRpb24gb3B0aW9ucy4gKi9cbmV4cG9ydCBpbnRlcmZhY2UgQ0NGRGF0YWJhc2VPcHRpb25zIHtcbiAgLyoqIEEgdXJsIHRvIGxvYWQgZGF0YSBmcm9tLiAqL1xuICBjY2ZPd2xVcmw6IHN0cmluZztcbiAgLyoqIENvbnRleHQuICovXG4gIGNjZkNvbnRleHRVcmw6IHN0cmluZztcbiAgLyoqIEEgbGlzdCBvZiBkYXRhIHNvdXJjZXMgKGluIG4zLCByZGYsIHhtbCwgb3dsLCBvciBqc29ubGQgZm9ybWF0KSAqL1xuICBkYXRhU291cmNlczogKHN0cmluZ3xKc29uTGQpW107XG4gIC8qKiBEYXRhIHNlcnZpY2UgdHlwZS4gKi9cbiAgaHVibWFwRGF0YVNlcnZpY2U6ICdzdGF0aWMnIHwgJ3NlYXJjaC1hcGknO1xuICAvKiogSHVCTUFQIEVsYXN0aWMgU2VhcmNoIFF1ZXJ5ICovXG4gIGh1Ym1hcFF1ZXJ5PzogdW5rbm93bjtcbiAgLyoqIEh1Ym1hcCBQb3J0YWwgdXJsLiAqL1xuICBodWJtYXBQb3J0YWxVcmw6IHN0cmluZztcbiAgLyoqIEh1Ym1hcCBkYXRhIHVybC4gKi9cbiAgaHVibWFwRGF0YVVybDogc3RyaW5nO1xuICAvKiogSHVibWFwIGFzc2V0cyBhcGkgdXJsLiAqL1xuICBodWJtYXBBc3NldHNVcmw6IHN0cmluZztcbiAgLyoqIEh1Qk1BUCBTZXJ2aWNlIFRva2VuLiAqL1xuICBodWJtYXBUb2tlbj86IHN0cmluZztcbn1cblxuLyoqIERlZmF1bHQgaW5pdGlhbGl6YXRpb24gb3B0aW9ucy4gKi9cbmV4cG9ydCBjb25zdCBERUZBVUxUX0NDRl9EQl9PUFRJT05TOiBDQ0ZEYXRhYmFzZU9wdGlvbnMgPSB7XG4gIGNjZk93bFVybDogJ2h0dHBzOi8vcHVybC5vcmcvY2NmL2xhdGVzdC9jY2Yub3dsJyxcbiAgY2NmQ29udGV4dFVybDogJ2h0dHBzOi8vcHVybC5vcmcvY2NmL2xhdGVzdC9jY2YtY29udGV4dC5qc29ubGQnLFxuICBkYXRhU291cmNlczogW10sXG4gIGh1Ym1hcERhdGFTZXJ2aWNlOiAnc3RhdGljJyxcbiAgaHVibWFwUG9ydGFsVXJsOiAnaHR0cHM6Ly9wb3J0YWwuaHVibWFwY29uc29ydGl1bS5vcmcvJyxcbiAgaHVibWFwRGF0YVVybDogJycsXG4gIGh1Ym1hcEFzc2V0c1VybDogJ2h0dHBzOi8vYXNzZXRzLmh1Ym1hcGNvbnNvcnRpdW0ub3JnJ1xufTtcblxuLyoqIERhdGFiYXNlIHByb3ZpZGVyLiAqL1xuZXhwb3J0IGNsYXNzIENDRkRhdGFiYXNlIHtcbiAgLyoqIFRoZSB0cmlwbGUgc3RvcmUuICovXG4gIHN0b3JlOiBTdG9yZTtcbiAgLyoqIFRoZSBzcGF0aWFsIGdyYXBoICovXG4gIGdyYXBoOiBDQ0ZTcGF0aWFsR3JhcGg7XG4gIC8qKiBDcmVhdGVzIFNwYXRpYWxFbnRpdHkgU2NlbmVzICovXG4gIHNjZW5lOiBDQ0ZTcGF0aWFsU2NlbmU7XG4gIC8qKiBJZiB0aGUgZGF0YWJhc2UgaXMgaW5pdGlhbGl6ZWQgKi9cbiAgcHJpdmF0ZSBpbml0aWFsaXppbmc/OiBQcm9taXNlPHZvaWQ+O1xuXG4gIHByaXZhdGUgc3RhdHVzOiBDQ0ZEYXRhYmFzZVN0YXR1c1RyYWNrZXI7XG5cbiAgLyoqXG4gICAqIENyZWF0ZXMgYW4gaW5zdGFuY2Ugb2YgY2NmZGF0YWJhc2UuXG4gICAqXG4gICAqIEBwYXJhbSBbb3B0aW9uc10gSW5pdGlhbGl6YXRpb24gb3B0aW9ucy5cbiAgICovXG4gIGNvbnN0cnVjdG9yKHB1YmxpYyBvcHRpb25zOiBDQ0ZEYXRhYmFzZU9wdGlvbnMgPSBERUZBVUxUX0NDRl9EQl9PUFRJT05TKSB7XG4gICAgdGhpcy5zdG9yZSA9IG5ldyBTdG9yZSh1bmRlZmluZWQsIHsgZmFjdG9yeTogRGF0YUZhY3RvcnkgfSk7XG4gICAgdGhpcy5ncmFwaCA9IG5ldyBDQ0ZTcGF0aWFsR3JhcGgodGhpcyk7XG4gICAgdGhpcy5zY2VuZSA9IG5ldyBDQ0ZTcGF0aWFsU2NlbmUodGhpcyk7XG4gIH1cblxuICAvKipcbiAgICogQ29ubmVjdHMgdGhlIGRhdGFiYXNlLlxuICAgKlxuICAgKiBAcGFyYW0gW29wdGlvbnNdIE9wdGlvbnMgdXNlZCB0byBpbml0aWFsaXplLlxuICAgKiBAcmV0dXJucyBBIHByb21pc2UgcmVzb2x2aW5nIHRvIHRydWUgaWYgZGF0YSBoYXMgYmVlbiBsb2FkZWQgaW50byB0aGUgZGF0YWJhc2UuXG4gICAqL1xuICBhc3luYyBjb25uZWN0KG9wdGlvbnM/OiBDQ0ZEYXRhYmFzZU9wdGlvbnMsIGNhY2hlZCA9IGZhbHNlKTogUHJvbWlzZTxib29sZWFuPiB7XG4gICAgaWYgKG9wdGlvbnMpIHtcbiAgICAgIHRoaXMub3B0aW9ucyA9IG9wdGlvbnM7XG4gICAgfVxuICAgIGlmICghdGhpcy5pbml0aWFsaXppbmcpIHtcbiAgICAgIGlmIChjYWNoZWQpIHtcbiAgICAgICAgdGhpcy5pbml0aWFsaXppbmcgPSB0aGlzLmNhY2hlZENvbm5lY3QoKTtcbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIHRoaXMuaW5pdGlhbGl6aW5nID0gdGhpcy5kb0Nvbm5lY3QoKTtcbiAgICAgIH1cbiAgICB9XG4gICAgYXdhaXQgdGhpcy5pbml0aWFsaXppbmc7XG4gICAgcmV0dXJuIHRoaXMuc3RvcmUuc2l6ZSA+IDA7XG4gIH1cblxuICBwcml2YXRlIGFzeW5jIGNhY2hlZENvbm5lY3QoKTogUHJvbWlzZTx2b2lkPiB7XG4gICAgY29uc3Qgc3RhcnQgPSBuZXcgRGF0ZSgpLmdldFRpbWUoKTtcbiAgICBjb25zdCBsYXN0TW9kaWZpZWRLZXkgPSAnY2NmLWRhdGFiYXNlLmxhc3RfbW9kaWZpZWQnO1xuICAgIGNvbnN0IGNjZkRhdGFiYXNlS2V5ID0gJ2NjZi1kYXRhYmFzZSc7XG5cbiAgICBjb25zdCBsYXN0TW9kaWZpZWQgPSBhd2FpdCBnZXQobGFzdE1vZGlmaWVkS2V5KS5jYXRjaCgoKSA9PiB1bmRlZmluZWQpO1xuICAgIGxldCBzZXJpYWxpemVkRGI6IHN0cmluZyB8IHVuZGVmaW5lZDtcblxuICAgIGlmIChsYXN0TW9kaWZpZWQgJiYgc3RhcnQgLSBuZXcgRGF0ZSgrbGFzdE1vZGlmaWVkKS5nZXRUaW1lKCkgPiA2MCo2MCoxMDAwKSB7XG4gICAgICBhd2FpdCBkZWxNYW55KFtjY2ZEYXRhYmFzZUtleSwgbGFzdE1vZGlmaWVkS2V5XSkuY2F0Y2goKCkgPT4gdW5kZWZpbmVkKTtcbiAgICB9IGVsc2Uge1xuICAgICAgc2VyaWFsaXplZERiID0gYXdhaXQgZ2V0KGNjZkRhdGFiYXNlS2V5KS5jYXRjaCgoKSA9PiB1bmRlZmluZWQpO1xuICAgIH1cblxuICAgIGlmIChzZXJpYWxpemVkRGIpIHtcbiAgICAgIGF3YWl0IHRoaXMuZGVzZXJpYWxpemUoc2VyaWFsaXplZERiKTtcbiAgICB9IGVsc2Uge1xuICAgICAgYXdhaXQgdGhpcy5kb0Nvbm5lY3QoKTtcblxuICAgICAgc2V0TWFueShbXG4gICAgICAgIFtjY2ZEYXRhYmFzZUtleSwgdGhpcy5zZXJpYWxpemUoKV0sXG4gICAgICAgIFtsYXN0TW9kaWZpZWRLZXksICcnICsgc3RhcnRdXG4gICAgICBdKS5jYXRjaCgoKSA9PiB1bmRlZmluZWQpO1xuICAgIH1cbiAgfVxuXG4gIC8qKlxuICAgKiBBY3R1YWxseSBjb25uZWN0cyB0byB0aGUgZGF0YWJhc2UuXG4gICAqXG4gICAqIEByZXR1cm5zIEEgcHJvbWlzZSByZXNvbHZpbmcgdG8gdm9pZCB3aGVuIGNvbm5lY3RlZC5cbiAgICovXG4gIHByaXZhdGUgYXN5bmMgZG9Db25uZWN0KCk6IFByb21pc2U8dm9pZD4ge1xuICAgIGNvbnN0IG9wczogUHJvbWlzZTx1bmtub3duPltdID0gW107XG4gICAgY29uc3Qgc291cmNlczogKHN0cmluZ3xKc29uTGQpW10gPSB0aGlzLm9wdGlvbnMuZGF0YVNvdXJjZXM/LmNvbmNhdCgpID8/IFtdO1xuXG4gICAgY29uc3QgY2NmT3dsVXJsID0gdGhpcy5vcHRpb25zLmNjZk93bFVybDtcbiAgICBpZiAoY2NmT3dsVXJsLnN0YXJ0c1dpdGgoJ3snKSkge1xuICAgICAgLy8gc2VyaWFsaXplZCBuMyBzdG9yZSB3YXMgcHJvdmlkZWQgYXMgdGhlIGNjZk93bFVybFxuICAgICAgdGhpcy5zdG9yZSA9IGRlc2VyaWFsaXplTjNTdG9yZShjY2ZPd2xVcmwsIERhdGFGYWN0b3J5KTtcbiAgICB9IGVsc2UgaWYgKGNjZk93bFVybC5lbmRzV2l0aCgnLm4zc3RvcmUuanNvbicpKSB7XG4gICAgICBjb25zdCBzdG9yZVN0cmluZyA9IGF3YWl0IGZldGNoKGNjZk93bFVybCkudGhlbihyID0+IHIudGV4dCgpKVxuICAgICAgICAuY2F0Y2goKCkgPT4gY29uc29sZS5sb2coJ0NvdWxkblxcJ3QgbG9jYXRlIHNlcmlhbGl6ZWQgc3RvcmUuJykpO1xuICAgICAgaWYgKHN0b3JlU3RyaW5nKSB7XG4gICAgICAgIHRoaXMuc3RvcmUgPSBkZXNlcmlhbGl6ZU4zU3RvcmUoc3RvcmVTdHJpbmcsIERhdGFGYWN0b3J5KTtcbiAgICAgIH1cbiAgICB9IGVsc2UgaWYgKGNjZk93bFVybD8ubGVuZ3RoID4gMCkge1xuICAgICAgc291cmNlcy5wdXNoKGNjZk93bFVybCk7XG4gICAgfVxuICAgIGlmICh0aGlzLm9wdGlvbnMuaHVibWFwRGF0YVVybCkge1xuICAgICAgaWYgKHRoaXMub3B0aW9ucy5odWJtYXBEYXRhVXJsLmVuZHNXaXRoKCdqc29ubGQnKSkge1xuICAgICAgICBzb3VyY2VzLnB1c2godGhpcy5vcHRpb25zLmh1Ym1hcERhdGFVcmwpO1xuICAgICAgfSBlbHNlIHtcbiAgICAgICAgb3BzLnB1c2goc2VhcmNoSHVibWFwKFxuICAgICAgICAgIHRoaXMub3B0aW9ucy5odWJtYXBEYXRhVXJsLFxuICAgICAgICAgIHRoaXMub3B0aW9ucy5odWJtYXBEYXRhU2VydmljZSxcbiAgICAgICAgICB0aGlzLm9wdGlvbnMuaHVibWFwUXVlcnksXG4gICAgICAgICAgdGhpcy5vcHRpb25zLmh1Ym1hcFRva2VuLFxuICAgICAgICAgIHRoaXMub3B0aW9ucy5odWJtYXBBc3NldHNVcmwsXG4gICAgICAgICAgdGhpcy5vcHRpb25zLmh1Ym1hcFBvcnRhbFVybFxuICAgICAgICApLnRoZW4oKGpzb25sZCkgPT4ge1xuICAgICAgICAgIGlmIChqc29ubGQpIHtcbiAgICAgICAgICAgIHJldHVybiB0aGlzLmFkZERhdGFTb3VyY2VzKFtqc29ubGRdKTtcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgcmV0dXJuIHVuZGVmaW5lZDtcbiAgICAgICAgICB9XG4gICAgICAgIH0pKTtcbiAgICAgIH1cbiAgICB9XG4gICAgb3BzLnB1c2godGhpcy5hZGREYXRhU291cmNlcyhzb3VyY2VzKSk7XG4gICAgYXdhaXQgUHJvbWlzZS5hbGwob3BzKTtcbiAgICBhd2FpdCB0aGlzLnN5bmNocm9uaXplKCk7XG4gIH1cblxuICBhc3luYyBhZGREYXRhU291cmNlcyhzb3VyY2VzOiAoc3RyaW5nfEpzb25MZClbXSwgaW5wdXRTdG9yZT86IFN0b3JlKTogUHJvbWlzZTx0aGlzPiB7XG4gICAgY29uc3Qgc3RvcmU6IFN0b3JlID0gaW5wdXRTdG9yZSA/PyB0aGlzLnN0b3JlO1xuICAgIGF3YWl0IFByb21pc2UuYWxsKFxuICAgICAgc291cmNlcy5tYXAoYXN5bmMgKHNvdXJjZSkgPT4ge1xuICAgICAgICBpZiAodHlwZW9mIHNvdXJjZSA9PT0gJ3N0cmluZycpIHtcbiAgICAgICAgICBpZiAoKHNvdXJjZS5zdGFydHNXaXRoKCdodHRwJykgfHwgc291cmNlLnN0YXJ0c1dpdGgoJ2Fzc2V0cy8nKSkgJiYgc291cmNlLmluY2x1ZGVzKCdqc29ubGQnKSkge1xuICAgICAgICAgICAgc291cmNlID0gYXdhaXQgZmV0Y2goc291cmNlKS50aGVuKHIgPT4gci50ZXh0KCkpO1xuICAgICAgICAgICAgc291cmNlID0gcGF0Y2hKc29uTGQoc291cmNlIGFzIHN0cmluZyk7XG4gICAgICAgICAgICBhd2FpdCBhZGRKc29uTGRUb1N0b3JlKHNvdXJjZSwgc3RvcmUpO1xuICAgICAgICAgIH0gZWxzZSBpZiAoc291cmNlLmVuZHNXaXRoKCduMycpKSB7XG4gICAgICAgICAgICBhd2FpdCBhZGROM1RvU3RvcmUoc291cmNlLCBzdG9yZSk7XG4gICAgICAgICAgfSBlbHNlIGlmIChzb3VyY2UuZW5kc1dpdGgoJ3JkZicpIHx8IHNvdXJjZS5lbmRzV2l0aCgnb3dsJykgfHwgc291cmNlLmVuZHNXaXRoKCd4bWwnKSkge1xuICAgICAgICAgICAgYXdhaXQgYWRkUmRmWG1sVG9TdG9yZShzb3VyY2UsIHN0b3JlKTtcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgLy8gUGFzc3Rocm91Z2ggYXNzdW1lcyBhIEpTT04tTEQgcmVzcG9uc2VcbiAgICAgICAgICAgIHNvdXJjZSA9IHBhdGNoSnNvbkxkKHNvdXJjZSk7XG4gICAgICAgICAgICBhd2FpdCBhZGRKc29uTGRUb1N0b3JlKHNvdXJjZSwgc3RvcmUpO1xuICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBzb3VyY2UgPSBwYXRjaEpzb25MZChKU09OLnN0cmluZ2lmeShzb3VyY2UpKTtcbiAgICAgICAgICBhd2FpdCBhZGRKc29uTGRUb1N0b3JlKHNvdXJjZSwgc3RvcmUpO1xuICAgICAgICB9XG4gICAgICB9KVxuICAgICk7XG4gICAgcmV0dXJuIHRoaXM7XG4gIH1cblxuICBhc3luYyBzeW5jaHJvbml6ZSgpOiBQcm9taXNlPHRoaXM+IHtcbiAgICAvLyBBZGQgYSBzbWFsbCBkZWxheSB0byBhbGxvdyB0aGUgdHJpcGxlIHN0b3JlIHRvIHNldHRsZVxuICAgIGF3YWl0IG5ldyBQcm9taXNlKHIgPT4ge1xuICAgICAgc2V0VGltZW91dChyLCA1MDApO1xuICAgIH0pO1xuICAgIHRoaXMuZ3JhcGguY3JlYXRlR3JhcGgoKTtcbiAgICBlbnJpY2hSdWlMb2NhdGlvbnModGhpcy5zdG9yZSk7XG4gICAgcmV0dXJuIHRoaXM7XG4gIH1cblxuICBzZXJpYWxpemUoKTogc3RyaW5nIHtcbiAgICByZXR1cm4gc2VyaWFsaXplTjNTdG9yZSh0aGlzLnN0b3JlKTtcbiAgfVxuXG4gIGFzeW5jIGRlc2VyaWFsaXplKHZhbHVlOiBzdHJpbmcpOiBQcm9taXNlPHZvaWQ+IHtcbiAgICB0aGlzLnN0b3JlID0gZGVzZXJpYWxpemVOM1N0b3JlKHZhbHVlLCBEYXRhRmFjdG9yeSk7XG4gICAgdGhpcy5ncmFwaCA9IG5ldyBDQ0ZTcGF0aWFsR3JhcGgodGhpcyk7XG4gICAgdGhpcy5zY2VuZSA9IG5ldyBDQ0ZTcGF0aWFsU2NlbmUodGhpcyk7XG4gICAgYXdhaXQgbmV3IFByb21pc2UociA9PiB7XG4gICAgICBzZXRUaW1lb3V0KHIsIDEwKTtcbiAgICB9KTtcbiAgfVxuXG4gIC8qKlxuICAgKiBHZXRzIGFsbCBpZHMgbWF0Y2hpbmcgdGhlIGZpbHRlci5cbiAgICpcbiAgICogQHBhcmFtIFtmaWx0ZXJdIFRoZSBmaWx0ZXIuXG4gICAqIEByZXR1cm5zIEEgc2V0IG9mIGFsbCBtYXRjaGluZyBpZHMuXG4gICAqL1xuICBnZXRJZHMoZmlsdGVyOiBGaWx0ZXIgPSB7fSBhcyBGaWx0ZXIpOiBTZXQ8c3RyaW5nPiB7XG4gICAgcmV0dXJuIGZpbmRJZHModGhpcy5zdG9yZSwgdGhpcy5ncmFwaCwgZmlsdGVyKTtcbiAgfVxuXG4gIC8qKlxuICAgKiBHZXRzIHRoZSBkYXRhIGZvciBhbiBvYmplY3QuXG4gICAqXG4gICAqIEBwYXJhbSBpZCBUaGUgaWQgb2YgdGhlIHJlcXVlc3RlZCBvYmplY3QuXG4gICAqIEByZXR1cm5zIFRoZSBvYmplY3QgZGF0YS5cbiAgICovXG4gIGdldChpZDogc3RyaW5nKTogUXVhZFtdIHtcbiAgICByZXR1cm4gdGhpcy5zdG9yZS5nZXRRdWFkcyhEYXRhRmFjdG9yeS5uYW1lZE5vZGUoaWQpLCBudWxsLCBudWxsLCBudWxsKTtcbiAgfVxuXG4gIC8qKlxuICAgKiBHZXRzIHRoZSBkYXRhIGZvciBvYmplY3RzIG1hdGNoaW5nIGEgZmlsdGVyLlxuICAgKlxuICAgKiBAcGFyYW0gW2ZpbHRlcl0gVGhlIGZpbHRlci5cbiAgICogQHJldHVybnMgQW4gYXJyYXkgb2YgZGF0YS5cbiAgICovXG4gIHNlYXJjaChmaWx0ZXI6IEZpbHRlciA9IHt9IGFzIEZpbHRlcik6IFF1YWRbXVtdIHtcbiAgICByZXR1cm4gWy4uLnRoaXMuZ2V0SWRzKGZpbHRlcildLm1hcCgocykgPT4gdGhpcy5nZXQocykpO1xuICB9XG5cbiAgLyoqXG4gICAqIEdldHMgYWxsIHNwYXRpYWwgZW50aXRpZXMgZm9yIGEgZmlsdGVyLlxuICAgKlxuICAgKiBAcGFyYW0gW2ZpbHRlcl0gVGhlIGZpbHRlci5cbiAgICogQHJldHVybnMgQSBsaXN0IG9mIHNwYXRpYWwgZW50aXRpZXMuXG4gICAqL1xuICBnZXRTcGF0aWFsRW50aXRpZXMoZmlsdGVyPzogRmlsdGVyKTogU3BhdGlhbEVudGl0eVtdIHtcbiAgICAvLyBlc2xpbnQtZGlzYWJsZS1uZXh0LWxpbmUgQHR5cGVzY3JpcHQtZXNsaW50L2NvbnNpc3RlbnQtdHlwZS1hc3NlcnRpb25zXG4gICAgZmlsdGVyID0geyAuLi5maWx0ZXIsIGhhc1NwYXRpYWxFbnRpdHk6IHRydWUgfSBhcyBGaWx0ZXI7XG4gICAgcmV0dXJuIFsuLi50aGlzLmdldElkcyhmaWx0ZXIpXS5tYXAoKHMpID0+IGdldFNwYXRpYWxFbnRpdHlGb3JFbnRpdHkodGhpcy5zdG9yZSwgcykgYXMgU3BhdGlhbEVudGl0eSk7XG4gIH1cblxuICBhc3luYyBnZXREYXRhYmFzZVN0YXR1cygpOiBQcm9taXNlPERhdGFiYXNlU3RhdHVzPiB7XG4gICAgaWYgKCF0aGlzLnN0YXR1cykge1xuICAgICAgdGhpcy5zdGF0dXMgPSBuZXcgQ0NGRGF0YWJhc2VTdGF0dXNUcmFja2VyKHRoaXMpO1xuICAgIH1cbiAgICByZXR1cm4gdGhpcy5zdGF0dXMudG9Kc29uKCk7XG4gIH1cblxuICAvKipcbiAgICogR2V0IGEgbGlzdCBvZiB0ZWNobm9sb2d5IG5hbWVzIHVzZWQgYnkgZGF0YXNldHNcbiAgICpcbiAgICogQHJldHVybnMgbGlzdCBvZiB1bmlxdWUgdGVjaG5vbG9neSBuYW1lcyBpbiB0aGUgZGF0YVxuICAgKi9cbiAgYXN5bmMgZ2V0RGF0YXNldFRlY2hub2xvZ3lOYW1lcygpOiBQcm9taXNlPHN0cmluZ1tdPiB7XG4gICAgcmV0dXJuIGdldERhdGFzZXRUZWNobm9sb2d5TmFtZXModGhpcy5zdG9yZSk7XG4gIH1cblxuICAvKipcbiAgICogR2V0IGEgbGlzdCBvZiBwcm92aWRlciBuYW1lcyBmcm9tIHRoZSBkYXRhYmFzZVxuICAgKlxuICAgKiBAcmV0dXJucyBsaXN0IG9mIHVuaXF1ZSBwcm92aWRlciBuYW1lcyBpbiB0aGUgZGF0YVxuICAgKi9cbiAgYXN5bmMgZ2V0UHJvdmlkZXJOYW1lcygpOiBQcm9taXNlPHN0cmluZ1tdPiB7XG4gICAgcmV0dXJuIGdldFByb3ZpZGVyTmFtZXModGhpcy5zdG9yZSk7XG4gIH1cblxuICAvKipcbiAgICogR2V0cyBhbGwgdGlzc3VlIGJsb2NrIHJlc3VsdHMgZm9yIGEgZmlsdGVyLlxuICAgKlxuICAgKiBAcGFyYW0gW2ZpbHRlcl0gVGhlIGZpbHRlci5cbiAgICogQHJldHVybnMgQSBsaXN0IG9mIHJlc3VsdHMuXG4gICAqL1xuICBhc3luYyBnZXRUaXNzdWVCbG9ja1Jlc3VsdHMoZmlsdGVyPzogRmlsdGVyKTogUHJvbWlzZTxUaXNzdWVCbG9ja1Jlc3VsdFtdPiB7XG4gICAgLy8gZXNsaW50LWRpc2FibGUtbmV4dC1saW5lIEB0eXBlc2NyaXB0LWVzbGludC9jb25zaXN0ZW50LXR5cGUtYXNzZXJ0aW9uc1xuICAgIGZpbHRlciA9IHsgLi4uZmlsdGVyLCBoYXNTcGF0aWFsRW50aXR5OiB0cnVlIH0gYXMgRmlsdGVyO1xuICAgIHJldHVybiBbLi4udGhpcy5nZXRJZHMoZmlsdGVyKV0ubWFwKChzKSA9PiBnZXRUaXNzdWVCbG9ja1Jlc3VsdCh0aGlzLnN0b3JlLCBzKSk7XG4gIH1cblxuICAvKipcbiAgICogR2V0cyBhbGwgYWdncmVnYXRlIHJlc3VsdHMgZm9yIGEgZmlsdGVyLlxuICAgKlxuICAgKiBAcGFyYW0gW2ZpbHRlcl0gVGhlIGZpbHRlci5cbiAgICogQHJldHVybnMgQSBsaXN0IG9mIGFnZ3JlZ2F0ZSBkYXRhLlxuICAgKi9cbiAgYXN5bmMgZ2V0QWdncmVnYXRlUmVzdWx0cyhmaWx0ZXI/OiBGaWx0ZXIpOiBQcm9taXNlPEFnZ3JlZ2F0ZVJlc3VsdFtdPiB7XG4gICAgcmV0dXJuIGdldEFnZ3JlZ2F0ZVJlc3VsdHModGhpcy5nZXRJZHMoZmlsdGVyKSwgdGhpcy5zdG9yZSk7XG4gIH1cblxuICAvKipcbiAgICogR2V0IG51bWJlciBvZiBvY2N1cnJlbmNlcyBvZiBvbnRvbG9neSB0ZXJtcyBmb3IgYSBzZXQgb2YgaWRzLlxuICAgKlxuICAgKiBAcGFyYW0gW2ZpbHRlcl0gVGhlIGZpbHRlci5cbiAgICogQHJldHVybnMgT250b2xvZ3kgdGVybSBjb3VudHMuXG4gICAqL1xuICBhc3luYyBnZXRPbnRvbG9neVRlcm1PY2N1cmVuY2VzKGZpbHRlcj86IEZpbHRlcik6IFByb21pc2U8UmVjb3JkPHN0cmluZywgbnVtYmVyPj4ge1xuICAgIHJldHVybiBnZXRPbnRvbG9neVRlcm1PY2N1cmVuY2VzKHRoaXMuZ2V0SWRzKGZpbHRlciksIHRoaXMuc3RvcmUpO1xuICB9XG5cbiAgLyoqXG4gICAqIEdldCBudW1iZXIgb2Ygb2NjdXJyZW5jZXMgb2YgY2VsbCB0eXBlIHRlcm1zIGZvciBhIHNldCBvZiBpZHMuXG4gICAqXG4gICAqIEBwYXJhbSBbZmlsdGVyXSBUaGUgZmlsdGVyLlxuICAgKiBAcmV0dXJucyBDZWxsIHR5cGUgdGVybSBjb3VudHMuXG4gICAqL1xuICBhc3luYyBnZXRDZWxsVHlwZVRlcm1PY2N1cmVuY2VzKGZpbHRlcj86IEZpbHRlcik6IFByb21pc2U8UmVjb3JkPHN0cmluZywgbnVtYmVyPj4ge1xuICAgIHJldHVybiBnZXRDZWxsVHlwZVRlcm1PY2N1cmVuY2VzKHRoaXMuZ2V0SWRzKGZpbHRlciksIHRoaXMuc3RvcmUpO1xuICB9XG5cbiAgLyoqXG4gICAqIEdldCBvbnRvbG9neSB0ZXJtIHRyZWUgbm9kZXNcbiAgICpcbiAgICogQHJldHVybnMgT250b2xvZ3kgdGVybSBjb3VudHMuXG4gICAqL1xuICBhc3luYyBnZXRPbnRvbG9neVRyZWVNb2RlbCgpOiBQcm9taXNlPE9udG9sb2d5VHJlZU1vZGVsPiB7XG4gICAgcmV0dXJuIGdldEFuYXRvbWljYWxTdHJ1Y3R1cmVUcmVlTW9kZWwodGhpcy5zdG9yZSk7XG4gIH1cblxuICAvKipcbiAgICogR2V0IGNlbGwgdHlwZSB0ZXJtIHRyZWUgbm9kZXNcbiAgICpcbiAgICogQHJldHVybnMgT250b2xvZ3kgdGVybSBjb3VudHMuXG4gICAqL1xuICBhc3luYyBnZXRDZWxsVHlwZVRyZWVNb2RlbCgpOiBQcm9taXNlPE9udG9sb2d5VHJlZU1vZGVsPiB7XG4gICAgcmV0dXJuIGdldENlbGxUeXBlVHJlZU1vZGVsKHRoaXMuc3RvcmUpO1xuICB9XG5cbiAgLyoqXG4gICAqIEdldCByZWZlcmVuY2Ugb3JnYW5zXG4gICAqXG4gICAqIEByZXR1cm5zIE9udG9sb2d5IHRlcm0gY291bnRzLlxuICAgKi9cbiAgYXN5bmMgZ2V0UmVmZXJlbmNlT3JnYW5zKCk6IFByb21pc2U8U3BhdGlhbEVudGl0eVtdPiB7XG4gICAgcmV0dXJuIHRoaXMuc2NlbmUuZ2V0UmVmZXJlbmNlT3JnYW5zKCk7XG4gIH1cblxuICAvKipcbiAgICogR2V0IGFsbCBub2RlcyB0byBmb3JtIHRoZSAzRCBzY2VuZSBvZiByZWZlcmVuY2UgYm9keSwgb3JnYW5zLCBhbmQgdGlzc3Vlc1xuICAgKlxuICAgKiBAcGFyYW0gW2ZpbHRlcl0gVGhlIGZpbHRlci5cbiAgICogQHJldHVybnMgQSBsaXN0IG9mIFNwYXRpYWwgU2NlbmUgTm9kZXMgZm9yIHRoZSAzRCBTY2VuZVxuICAgKi9cbiAgYXN5bmMgZ2V0U2NlbmUoZmlsdGVyPzogRmlsdGVyKTogUHJvbWlzZTxTcGF0aWFsU2NlbmVOb2RlW10+IHtcbiAgICB0aGlzLmdyYXBoLmNyZWF0ZUdyYXBoKCk7XG4gICAgcmV0dXJuIHRoaXMuc2NlbmUuZ2V0U2NlbmUoZmlsdGVyKTtcbiAgfVxuXG4gIC8qKlxuICAgKiBHZXQgYWxsIG5vZGVzIHRvIGZvcm0gdGhlIDNEIHNjZW5lIG9mIHJlZmVyZW5jZSBvcmdhbiBhbmQgdGlzc3Vlc1xuICAgKlxuICAgKiBAcGFyYW0gW29yZ2FuSXJpXSBUaGUgUmVmZXJlbmNlIE9yZ2FuIElSSVxuICAgKiBAcGFyYW0gW2ZpbHRlcl0gVGhlIGZpbHRlci5cbiAgICogQHJldHVybnMgQSBsaXN0IG9mIFNwYXRpYWwgU2NlbmUgTm9kZXMgZm9yIHRoZSAzRCBTY2VuZVxuICAgKi9cbiAgYXN5bmMgZ2V0UmVmZXJlbmNlT3JnYW5TY2VuZShvcmdhbklyaTogc3RyaW5nLCBmaWx0ZXI/OiBGaWx0ZXIpOiBQcm9taXNlPFNwYXRpYWxTY2VuZU5vZGVbXT4ge1xuICAgIHRoaXMuZ3JhcGguY3JlYXRlR3JhcGgoKTtcbiAgICByZXR1cm4gdGhpcy5zY2VuZS5nZXRSZWZlcmVuY2VPcmdhblNjZW5lKG9yZ2FuSXJpLCBmaWx0ZXIpO1xuICB9XG5cbiAgYXN5bmMgZ2V0U3BhdGlhbFBsYWNlbWVudChzb3VyY2U6IFNwYXRpYWxFbnRpdHksIHRhcmdldElyaTogc3RyaW5nKTogUHJvbWlzZTxGbGF0U3BhdGlhbFBsYWNlbWVudCB8IHVuZGVmaW5lZD4ge1xuICAgIHJldHVybiB0aGlzLmdyYXBoLmdldFNwYXRpYWxQbGFjZW1lbnQoc291cmNlLCB0YXJnZXRJcmkpO1xuICB9XG59XG4iXX0= \ No newline at end of file diff --git a/ccf-database/esm2015/lib/ccf-spatial-graph.js b/ccf-database/esm2015/lib/ccf-spatial-graph.js deleted file mode 100644 index 93f2de762..000000000 --- a/ccf-database/esm2015/lib/ccf-spatial-graph.js +++ /dev/null @@ -1,138 +0,0 @@ -/* eslint-disable @typescript-eslint/naming-convention */ -/* eslint-disable @typescript-eslint/no-unsafe-call */ -/* eslint-disable @typescript-eslint/no-unsafe-member-access */ -import { Euler, Matrix4, toDegrees, toRadians } from '@math.gl/core'; -import { DirectedGraph } from 'graphology'; -import shortestPath from 'graphology-shortest-path/unweighted'; -import { get } from 'lodash'; -import { readQuads } from 'triple-store-utils'; -import { v4 as uuidV4 } from 'uuid'; -import { getSpatialPlacement } from './queries/spatial-result-n3'; -import { ccf, rdf } from './util/prefixes'; -export function applySpatialPlacement(tx, placement) { - const p = placement; - let factor; - switch (p.translation_units) { - case 'centimeter': - factor = 1 / 100; - break; - case 'millimeter': - factor = 1 / 1000; - break; - case 'meter': - default: - factor = 1; - break; - } - const T = [p.x_translation, p.y_translation, p.z_translation].map(t => t * factor); - const R = [p.x_rotation, p.y_rotation, p.z_rotation].map(toRadians); - const S = [p.x_scaling, p.y_scaling, p.z_scaling]; - return tx.translate(T).rotateXYZ(R).scale(S); -} -export class CCFSpatialGraph { - constructor(db) { - this.db = db; - this.createGraph(); - } - createGraph() { - this.graph = new DirectedGraph(); - const store = this.db.store; - // Add all Spatial Object References - store.forSubjects((subject) => { - this.addNode(subject.id, 'SpatialObjectReference'); - }, rdf.type, ccf.SpatialObjectReference, null); - // Add all Spatial Entities - store.forSubjects((subject) => { - this.addNode(subject.id, 'SpatialEntity'); - }, rdf.type, ccf.SpatialEntity, null); - // Add all Spatial Placements - const edgeSource = {}; - for (const quad of readQuads(store, null, ccf.spatialPlacement.source, null, null)) { - edgeSource[quad.subject.id] = quad.object.id; - } - for (const quad of readQuads(store, null, ccf.spatialPlacement.target, null, null)) { - const source = edgeSource[quad.subject.id]; - if (source) { - this.addEdge(quad.subject.id, source, quad.object.id, 'SpatialPlacement'); - } - } - } - addNode(id, type) { - this.graph.mergeNode(id, { type }); - } - addEdge(id, source, target, type) { - this.graph.mergeDirectedEdge(source, target, { type, id }); - } - getTransformationMatrix(sourceIRI, targetIRI) { - if (sourceIRI === targetIRI) { - return new Matrix4(Matrix4.IDENTITY); // identity - } - if (!this.graph.hasNode(sourceIRI) || !this.graph.hasNode(targetIRI)) { - return undefined; - } - const store = this.db.store; - const tx = new Matrix4(Matrix4.IDENTITY); - const path = shortestPath(this.graph, sourceIRI, targetIRI); - if (path && path.length > 0) { - path.reverse(); - let target = ''; - for (const source of path) { - if (target) { - const placementId = this.graph.getEdgeAttribute(source, target, 'id'); - const placement = getSpatialPlacement(store, placementId); - applySpatialPlacement(tx, placement); - } - target = source; - } - return tx; - } - else { - return undefined; - } - } - getSpatialPlacement(source, targetIri) { - const sourceIri = this.graph.hasNode(source['@id']) ? source['@id'] : undefined; - const placement = get(source, 'placement[0]', get(source, 'placement', undefined)); - let matrix; - if (placement && this.graph.hasNode(placement.target)) { - matrix = this.getTransformationMatrix(placement.target, targetIri); - if (matrix) { - matrix = applySpatialPlacement(matrix, placement); - } - } - else if (sourceIri) { - matrix = this.getTransformationMatrix(sourceIri, targetIri); - } - if (matrix) { - const euler = new Euler().fromRotationMatrix(matrix, Euler.XYZ); - const T = matrix.getTranslation().map(n => n * 1000); - const R = euler.toVector3().map(toDegrees); - const S = matrix.getScale().map(n => n < 1 && n > 0.999999 ? 1 : n); - return { - '@context': 'https://hubmapconsortium.github.io/hubmap-ontology/ccf-context.jsonld', - '@id': `http://purl.org/ccf/1.5/${uuidV4()}_placement`, - '@type': 'SpatialPlacement', - source: source['@id'], - target: targetIri, - placement_date: new Date().toISOString().split('T')[0], - x_scaling: S[0], - y_scaling: S[1], - z_scaling: S[2], - scaling_units: 'ratio', - x_rotation: R[0], - y_rotation: R[1], - z_rotation: R[2], - rotation_order: 'XYZ', - rotation_units: 'degree', - x_translation: T[0], - y_translation: T[1], - z_translation: T[2], - translation_units: 'millimeter' - }; - } - else { - return undefined; - } - } -} -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2NmLXNwYXRpYWwtZ3JhcGguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9wcm9qZWN0cy9jY2YtZGF0YWJhc2Uvc3JjL2xpYi9jY2Ytc3BhdGlhbC1ncmFwaC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSx5REFBeUQ7QUFDekQsc0RBQXNEO0FBQ3RELCtEQUErRDtBQUMvRCxPQUFPLEVBQUUsS0FBSyxFQUFFLE9BQU8sRUFBRSxTQUFTLEVBQUUsU0FBUyxFQUFFLE1BQU0sZUFBZSxDQUFDO0FBQ3JFLE9BQU8sRUFBRSxhQUFhLEVBQUUsTUFBTSxZQUFZLENBQUM7QUFDM0MsT0FBTyxZQUFZLE1BQU0scUNBQXFDLENBQUM7QUFDL0QsT0FBTyxFQUFFLEdBQUcsRUFBRSxNQUFNLFFBQVEsQ0FBQztBQUM3QixPQUFPLEVBQUUsU0FBUyxFQUFFLE1BQU0sb0JBQW9CLENBQUM7QUFDL0MsT0FBTyxFQUFFLEVBQUUsSUFBSSxNQUFNLEVBQUUsTUFBTSxNQUFNLENBQUM7QUFHcEMsT0FBTyxFQUFFLG1CQUFtQixFQUFFLE1BQU0sNkJBQTZCLENBQUM7QUFFbEUsT0FBTyxFQUFFLEdBQUcsRUFBRSxHQUFHLEVBQUUsTUFBTSxpQkFBaUIsQ0FBQztBQUczQyxNQUFNLFVBQVUscUJBQXFCLENBQUMsRUFBVyxFQUFFLFNBQTJCO0lBQzVFLE1BQU0sQ0FBQyxHQUFHLFNBQVMsQ0FBQztJQUNwQixJQUFJLE1BQWMsQ0FBQztJQUNuQixRQUFRLENBQUMsQ0FBQyxpQkFBaUIsRUFBRTtRQUMzQixLQUFLLFlBQVk7WUFDZixNQUFNLEdBQUcsQ0FBQyxHQUFHLEdBQUcsQ0FBQztZQUNqQixNQUFNO1FBQ1IsS0FBSyxZQUFZO1lBQ2YsTUFBTSxHQUFHLENBQUMsR0FBRyxJQUFJLENBQUM7WUFDbEIsTUFBTTtRQUNSLEtBQUssT0FBTyxDQUFDO1FBQ2I7WUFDRSxNQUFNLEdBQUcsQ0FBQyxDQUFDO1lBQ1gsTUFBTTtLQUNUO0lBQ0QsTUFBTSxDQUFDLEdBQUcsQ0FBQyxDQUFDLENBQUMsYUFBYSxFQUFFLENBQUMsQ0FBQyxhQUFhLEVBQUUsQ0FBQyxDQUFDLGFBQWEsQ0FBQyxDQUFDLEdBQUcsQ0FBQyxDQUFDLENBQUMsRUFBRSxDQUFDLENBQUMsR0FBRyxNQUFNLENBQUMsQ0FBQztJQUNuRixNQUFNLENBQUMsR0FBRyxDQUFDLENBQUMsQ0FBQyxVQUFVLEVBQUUsQ0FBQyxDQUFDLFVBQVUsRUFBRSxDQUFDLENBQUMsVUFBVSxDQUFDLENBQUMsR0FBRyxDQUFTLFNBQVMsQ0FBNkIsQ0FBQztJQUN4RyxNQUFNLENBQUMsR0FBRyxDQUFDLENBQUMsQ0FBQyxTQUFTLEVBQUUsQ0FBQyxDQUFDLFNBQVMsRUFBRSxDQUFDLENBQUMsU0FBUyxDQUFDLENBQUM7SUFFbEQsT0FBTyxFQUFFLENBQUMsU0FBUyxDQUFDLENBQUMsQ0FBQyxDQUFDLFNBQVMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxLQUFLLENBQUMsQ0FBQyxDQUFDLENBQUM7QUFDL0MsQ0FBQztBQUVELE1BQU0sT0FBTyxlQUFlO0lBSTFCLFlBQW9CLEVBQWU7UUFBZixPQUFFLEdBQUYsRUFBRSxDQUFhO1FBQ2pDLElBQUksQ0FBQyxXQUFXLEVBQUUsQ0FBQztJQUNyQixDQUFDO0lBRUQsV0FBVztRQUNULElBQUksQ0FBQyxLQUFLLEdBQUcsSUFBSSxhQUFhLEVBQUUsQ0FBQztRQUNqQyxNQUFNLEtBQUssR0FBRyxJQUFJLENBQUMsRUFBRSxDQUFDLEtBQUssQ0FBQztRQUU1QixvQ0FBb0M7UUFDcEMsS0FBSyxDQUFDLFdBQVcsQ0FBQyxDQUFDLE9BQU8sRUFBRSxFQUFFO1lBQzVCLElBQUksQ0FBQyxPQUFPLENBQUMsT0FBTyxDQUFDLEVBQUUsRUFBRSx3QkFBd0IsQ0FBQyxDQUFDO1FBQ3JELENBQUMsRUFBRSxHQUFHLENBQUMsSUFBSSxFQUFFLEdBQUcsQ0FBQyxzQkFBc0IsRUFBRSxJQUFJLENBQUMsQ0FBQztRQUUvQywyQkFBMkI7UUFDM0IsS0FBSyxDQUFDLFdBQVcsQ0FBQyxDQUFDLE9BQU8sRUFBRSxFQUFFO1lBQzVCLElBQUksQ0FBQyxPQUFPLENBQUMsT0FBTyxDQUFDLEVBQUUsRUFBRSxlQUFlLENBQUMsQ0FBQztRQUM1QyxDQUFDLEVBQUUsR0FBRyxDQUFDLElBQUksRUFBRSxHQUFHLENBQUMsYUFBYSxFQUFFLElBQUksQ0FBQyxDQUFDO1FBRXRDLDZCQUE2QjtRQUM3QixNQUFNLFVBQVUsR0FBMkIsRUFBRSxDQUFDO1FBQzlDLEtBQUssTUFBTSxJQUFJLElBQUksU0FBUyxDQUFDLEtBQUssRUFBRSxJQUFJLEVBQUUsR0FBRyxDQUFDLGdCQUFnQixDQUFDLE1BQU0sRUFBRSxJQUFJLEVBQUUsSUFBSSxDQUFDLEVBQUU7WUFDbEYsVUFBVSxDQUFDLElBQUksQ0FBQyxPQUFPLENBQUMsRUFBRSxDQUFDLEdBQUcsSUFBSSxDQUFDLE1BQU0sQ0FBQyxFQUFFLENBQUM7U0FDOUM7UUFDRCxLQUFLLE1BQU0sSUFBSSxJQUFJLFNBQVMsQ0FBQyxLQUFLLEVBQUUsSUFBSSxFQUFFLEdBQUcsQ0FBQyxnQkFBZ0IsQ0FBQyxNQUFNLEVBQUUsSUFBSSxFQUFFLElBQUksQ0FBQyxFQUFFO1lBQ2xGLE1BQU0sTUFBTSxHQUFHLFVBQVUsQ0FBQyxJQUFJLENBQUMsT0FBTyxDQUFDLEVBQUUsQ0FBQyxDQUFDO1lBQzNDLElBQUksTUFBTSxFQUFFO2dCQUNWLElBQUksQ0FBQyxPQUFPLENBQUMsSUFBSSxDQUFDLE9BQU8sQ0FBQyxFQUFFLEVBQUUsTUFBTSxFQUFFLElBQUksQ0FBQyxNQUFNLENBQUMsRUFBRSxFQUFFLGtCQUFrQixDQUFDLENBQUM7YUFDM0U7U0FDRjtJQUNILENBQUM7SUFFRCxPQUFPLENBQUMsRUFBVSxFQUFFLElBQVk7UUFDOUIsSUFBSSxDQUFDLEtBQUssQ0FBQyxTQUFTLENBQUMsRUFBRSxFQUFFLEVBQUUsSUFBSSxFQUFFLENBQUMsQ0FBQztJQUNyQyxDQUFDO0lBRUQsT0FBTyxDQUFDLEVBQVUsRUFBRSxNQUFjLEVBQUUsTUFBYyxFQUFFLElBQVk7UUFDOUQsSUFBSSxDQUFDLEtBQUssQ0FBQyxpQkFBaUIsQ0FBQyxNQUFNLEVBQUUsTUFBTSxFQUFFLEVBQUUsSUFBSSxFQUFFLEVBQUUsRUFBRSxDQUFDLENBQUM7SUFDN0QsQ0FBQztJQUVELHVCQUF1QixDQUFDLFNBQWlCLEVBQUUsU0FBaUI7UUFDMUQsSUFBSSxTQUFTLEtBQUssU0FBUyxFQUFFO1lBQzNCLE9BQU8sSUFBSSxPQUFPLENBQUMsT0FBTyxDQUFDLFFBQVEsQ0FBQyxDQUFDLENBQUMsV0FBVztTQUNsRDtRQUNELElBQUksQ0FBQyxJQUFJLENBQUMsS0FBSyxDQUFDLE9BQU8sQ0FBQyxTQUFTLENBQUMsSUFBSSxDQUFDLElBQUksQ0FBQyxLQUFLLENBQUMsT0FBTyxDQUFDLFNBQVMsQ0FBQyxFQUFFO1lBQ3BFLE9BQU8sU0FBUyxDQUFDO1NBQ2xCO1FBRUQsTUFBTSxLQUFLLEdBQUcsSUFBSSxDQUFDLEVBQUUsQ0FBQyxLQUFLLENBQUM7UUFDNUIsTUFBTSxFQUFFLEdBQUcsSUFBSSxPQUFPLENBQUMsT0FBTyxDQUFDLFFBQVEsQ0FBQyxDQUFDO1FBQ3pDLE1BQU0sSUFBSSxHQUFHLFlBQVksQ0FBQyxJQUFJLENBQUMsS0FBSyxFQUFFLFNBQVMsRUFBRSxTQUFTLENBQUMsQ0FBQztRQUM1RCxJQUFJLElBQUksSUFBSSxJQUFJLENBQUMsTUFBTSxHQUFHLENBQUMsRUFBRTtZQUMzQixJQUFJLENBQUMsT0FBTyxFQUFFLENBQUM7WUFDZixJQUFJLE1BQU0sR0FBb0IsRUFBRSxDQUFDO1lBQ2pDLEtBQUssTUFBTSxNQUFNLElBQUksSUFBSSxFQUFFO2dCQUN6QixJQUFJLE1BQU0sRUFBRTtvQkFDVixNQUFNLFdBQVcsR0FBRyxJQUFJLENBQUMsS0FBSyxDQUFDLGdCQUFnQixDQUFDLE1BQU0sRUFBRSxNQUFNLEVBQUUsSUFBSSxDQUFDLENBQUM7b0JBQ3RFLE1BQU0sU0FBUyxHQUFHLG1CQUFtQixDQUFDLEtBQUssRUFBRSxXQUFXLENBQUMsQ0FBQztvQkFDMUQscUJBQXFCLENBQUMsRUFBRSxFQUFFLFNBQVMsQ0FBQyxDQUFDO2lCQUN0QztnQkFDRCxNQUFNLEdBQUcsTUFBTSxDQUFDO2FBQ2pCO1lBQ0QsT0FBTyxFQUFFLENBQUM7U0FDWDthQUFNO1lBQ0wsT0FBTyxTQUFTLENBQUM7U0FDbEI7SUFDSCxDQUFDO0lBRUQsbUJBQW1CLENBQUMsTUFBcUIsRUFBRSxTQUFpQjtRQUMxRCxNQUFNLFNBQVMsR0FBRyxJQUFJLENBQUMsS0FBSyxDQUFDLE9BQU8sQ0FBQyxNQUFNLENBQUMsS0FBSyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsTUFBTSxDQUFDLEtBQUssQ0FBQyxDQUFDLENBQUMsQ0FBQyxTQUFTLENBQUM7UUFDaEYsTUFBTSxTQUFTLEdBQXFCLEdBQUcsQ0FBQyxNQUFNLEVBQUUsY0FBYyxFQUFFLEdBQUcsQ0FBQyxNQUFNLEVBQUUsV0FBVyxFQUFFLFNBQVMsQ0FBQyxDQUFDLENBQUM7UUFFckcsSUFBSSxNQUEyQixDQUFDO1FBQ2hDLElBQUksU0FBUyxJQUFJLElBQUksQ0FBQyxLQUFLLENBQUMsT0FBTyxDQUFDLFNBQVMsQ0FBQyxNQUFNLENBQUMsRUFBRTtZQUNyRCxNQUFNLEdBQUcsSUFBSSxDQUFDLHVCQUF1QixDQUFDLFNBQVMsQ0FBQyxNQUEyQixFQUFFLFNBQVMsQ0FBQyxDQUFDO1lBQ3hGLElBQUksTUFBTSxFQUFFO2dCQUNWLE1BQU0sR0FBRyxxQkFBcUIsQ0FBQyxNQUFNLEVBQUUsU0FBUyxDQUFDLENBQUM7YUFDbkQ7U0FDRjthQUFNLElBQUksU0FBUyxFQUFFO1lBQ3BCLE1BQU0sR0FBRyxJQUFJLENBQUMsdUJBQXVCLENBQUMsU0FBUyxFQUFFLFNBQVMsQ0FBQyxDQUFDO1NBQzdEO1FBRUQsSUFBSSxNQUFNLEVBQUU7WUFDVixNQUFNLEtBQUssR0FBRyxJQUFJLEtBQUssRUFBRSxDQUFDLGtCQUFrQixDQUFDLE1BQU0sRUFBRSxLQUFLLENBQUMsR0FBRyxDQUFDLENBQUM7WUFDaEUsTUFBTSxDQUFDLEdBQUcsTUFBTSxDQUFDLGNBQWMsRUFBRSxDQUFDLEdBQUcsQ0FBQyxDQUFDLENBQUMsRUFBRSxDQUFDLENBQUMsR0FBRyxJQUFJLENBQTZCLENBQUM7WUFDakYsTUFBTSxDQUFDLEdBQUcsS0FBSyxDQUFDLFNBQVMsRUFBRSxDQUFDLEdBQUcsQ0FBUyxTQUFTLENBQTZCLENBQUM7WUFDL0UsTUFBTSxDQUFDLEdBQUcsTUFBTSxDQUFDLFFBQVEsRUFBRSxDQUFDLEdBQUcsQ0FBQyxDQUFDLENBQUMsRUFBRSxDQUFDLENBQUMsR0FBRyxDQUFDLElBQUksQ0FBQyxHQUFHLFFBQVEsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQTZCLENBQUM7WUFFaEcsT0FBTztnQkFDTCxVQUFVLEVBQUUsdUVBQXVFO2dCQUNuRixLQUFLLEVBQUUsMkJBQTJCLE1BQU0sRUFBRSxZQUFZO2dCQUN0RCxPQUFPLEVBQUUsa0JBQWtCO2dCQUMzQixNQUFNLEVBQUUsTUFBTSxDQUFDLEtBQUssQ0FBQztnQkFDckIsTUFBTSxFQUFFLFNBQVM7Z0JBQ2pCLGNBQWMsRUFBRSxJQUFJLElBQUksRUFBRSxDQUFDLFdBQVcsRUFBRSxDQUFDLEtBQUssQ0FBQyxHQUFHLENBQUMsQ0FBQyxDQUFDLENBQUM7Z0JBQ3RELFNBQVMsRUFBRSxDQUFDLENBQUMsQ0FBQyxDQUFDO2dCQUNmLFNBQVMsRUFBRSxDQUFDLENBQUMsQ0FBQyxDQUFDO2dCQUNmLFNBQVMsRUFBRSxDQUFDLENBQUMsQ0FBQyxDQUFDO2dCQUNmLGFBQWEsRUFBRSxPQUFPO2dCQUN0QixVQUFVLEVBQUUsQ0FBQyxDQUFDLENBQUMsQ0FBQztnQkFDaEIsVUFBVSxFQUFFLENBQUMsQ0FBQyxDQUFDLENBQUM7Z0JBQ2hCLFVBQVUsRUFBRSxDQUFDLENBQUMsQ0FBQyxDQUFDO2dCQUNoQixjQUFjLEVBQUUsS0FBSztnQkFDckIsY0FBYyxFQUFFLFFBQVE7Z0JBQ3hCLGFBQWEsRUFBRSxDQUFDLENBQUMsQ0FBQyxDQUFDO2dCQUNuQixhQUFhLEVBQUUsQ0FBQyxDQUFDLENBQUMsQ0FBQztnQkFDbkIsYUFBYSxFQUFFLENBQUMsQ0FBQyxDQUFDLENBQUM7Z0JBQ25CLGlCQUFpQixFQUFFLFlBQVk7YUFDaEMsQ0FBQztTQUNIO2FBQU07WUFDTCxPQUFPLFNBQVMsQ0FBQztTQUNsQjtJQUNILENBQUM7Q0FDRiIsInNvdXJjZXNDb250ZW50IjpbIi8qIGVzbGludC1kaXNhYmxlIEB0eXBlc2NyaXB0LWVzbGludC9uYW1pbmctY29udmVudGlvbiAqL1xuLyogZXNsaW50LWRpc2FibGUgQHR5cGVzY3JpcHQtZXNsaW50L25vLXVuc2FmZS1jYWxsICovXG4vKiBlc2xpbnQtZGlzYWJsZSBAdHlwZXNjcmlwdC1lc2xpbnQvbm8tdW5zYWZlLW1lbWJlci1hY2Nlc3MgKi9cbmltcG9ydCB7IEV1bGVyLCBNYXRyaXg0LCB0b0RlZ3JlZXMsIHRvUmFkaWFucyB9IGZyb20gJ0BtYXRoLmdsL2NvcmUnO1xuaW1wb3J0IHsgRGlyZWN0ZWRHcmFwaCB9IGZyb20gJ2dyYXBob2xvZ3knO1xuaW1wb3J0IHNob3J0ZXN0UGF0aCBmcm9tICdncmFwaG9sb2d5LXNob3J0ZXN0LXBhdGgvdW53ZWlnaHRlZCc7XG5pbXBvcnQgeyBnZXQgfSBmcm9tICdsb2Rhc2gnO1xuaW1wb3J0IHsgcmVhZFF1YWRzIH0gZnJvbSAndHJpcGxlLXN0b3JlLXV0aWxzJztcbmltcG9ydCB7IHY0IGFzIHV1aWRWNCB9IGZyb20gJ3V1aWQnO1xuXG5pbXBvcnQgeyBDQ0ZEYXRhYmFzZSB9IGZyb20gJy4vY2NmLWRhdGFiYXNlJztcbmltcG9ydCB7IGdldFNwYXRpYWxQbGFjZW1lbnQgfSBmcm9tICcuL3F1ZXJpZXMvc3BhdGlhbC1yZXN1bHQtbjMnO1xuaW1wb3J0IHsgRmxhdFNwYXRpYWxQbGFjZW1lbnQsIFNwYXRpYWxFbnRpdHksIFNwYXRpYWxQbGFjZW1lbnQgfSBmcm9tICcuL3NwYXRpYWwtdHlwZXMnO1xuaW1wb3J0IHsgY2NmLCByZGYgfSBmcm9tICcuL3V0aWwvcHJlZml4ZXMnO1xuXG5cbmV4cG9ydCBmdW5jdGlvbiBhcHBseVNwYXRpYWxQbGFjZW1lbnQodHg6IE1hdHJpeDQsIHBsYWNlbWVudDogU3BhdGlhbFBsYWNlbWVudCk6IE1hdHJpeDQge1xuICBjb25zdCBwID0gcGxhY2VtZW50O1xuICBsZXQgZmFjdG9yOiBudW1iZXI7XG4gIHN3aXRjaCAocC50cmFuc2xhdGlvbl91bml0cykge1xuICAgIGNhc2UgJ2NlbnRpbWV0ZXInOlxuICAgICAgZmFjdG9yID0gMSAvIDEwMDtcbiAgICAgIGJyZWFrO1xuICAgIGNhc2UgJ21pbGxpbWV0ZXInOlxuICAgICAgZmFjdG9yID0gMSAvIDEwMDA7XG4gICAgICBicmVhaztcbiAgICBjYXNlICdtZXRlcic6XG4gICAgZGVmYXVsdDpcbiAgICAgIGZhY3RvciA9IDE7XG4gICAgICBicmVhaztcbiAgfVxuICBjb25zdCBUID0gW3AueF90cmFuc2xhdGlvbiwgcC55X3RyYW5zbGF0aW9uLCBwLnpfdHJhbnNsYXRpb25dLm1hcCh0ID0+IHQgKiBmYWN0b3IpO1xuICBjb25zdCBSID0gW3AueF9yb3RhdGlvbiwgcC55X3JvdGF0aW9uLCBwLnpfcm90YXRpb25dLm1hcDxudW1iZXI+KHRvUmFkaWFucykgYXMgW251bWJlciwgbnVtYmVyLCBudW1iZXJdO1xuICBjb25zdCBTID0gW3AueF9zY2FsaW5nLCBwLnlfc2NhbGluZywgcC56X3NjYWxpbmddO1xuXG4gIHJldHVybiB0eC50cmFuc2xhdGUoVCkucm90YXRlWFlaKFIpLnNjYWxlKFMpO1xufVxuXG5leHBvcnQgY2xhc3MgQ0NGU3BhdGlhbEdyYXBoIHtcbiAgLy8gZXNsaW50LWRpc2FibGUtbmV4dC1saW5lIEB0eXBlc2NyaXB0LWVzbGludC9uby1leHBsaWNpdC1hbnlcbiAgZ3JhcGg6IGFueTtcblxuICBjb25zdHJ1Y3Rvcihwcml2YXRlIGRiOiBDQ0ZEYXRhYmFzZSkge1xuICAgIHRoaXMuY3JlYXRlR3JhcGgoKTtcbiAgfVxuXG4gIGNyZWF0ZUdyYXBoKCk6IHZvaWQge1xuICAgIHRoaXMuZ3JhcGggPSBuZXcgRGlyZWN0ZWRHcmFwaCgpO1xuICAgIGNvbnN0IHN0b3JlID0gdGhpcy5kYi5zdG9yZTtcblxuICAgIC8vIEFkZCBhbGwgU3BhdGlhbCBPYmplY3QgUmVmZXJlbmNlc1xuICAgIHN0b3JlLmZvclN1YmplY3RzKChzdWJqZWN0KSA9PiB7XG4gICAgICB0aGlzLmFkZE5vZGUoc3ViamVjdC5pZCwgJ1NwYXRpYWxPYmplY3RSZWZlcmVuY2UnKTtcbiAgICB9LCByZGYudHlwZSwgY2NmLlNwYXRpYWxPYmplY3RSZWZlcmVuY2UsIG51bGwpO1xuXG4gICAgLy8gQWRkIGFsbCBTcGF0aWFsIEVudGl0aWVzXG4gICAgc3RvcmUuZm9yU3ViamVjdHMoKHN1YmplY3QpID0+IHtcbiAgICAgIHRoaXMuYWRkTm9kZShzdWJqZWN0LmlkLCAnU3BhdGlhbEVudGl0eScpO1xuICAgIH0sIHJkZi50eXBlLCBjY2YuU3BhdGlhbEVudGl0eSwgbnVsbCk7XG5cbiAgICAvLyBBZGQgYWxsIFNwYXRpYWwgUGxhY2VtZW50c1xuICAgIGNvbnN0IGVkZ2VTb3VyY2U6IFJlY29yZDxzdHJpbmcsIHN0cmluZz4gPSB7fTtcbiAgICBmb3IgKGNvbnN0IHF1YWQgb2YgcmVhZFF1YWRzKHN0b3JlLCBudWxsLCBjY2Yuc3BhdGlhbFBsYWNlbWVudC5zb3VyY2UsIG51bGwsIG51bGwpKSB7XG4gICAgICBlZGdlU291cmNlW3F1YWQuc3ViamVjdC5pZF0gPSBxdWFkLm9iamVjdC5pZDtcbiAgICB9XG4gICAgZm9yIChjb25zdCBxdWFkIG9mIHJlYWRRdWFkcyhzdG9yZSwgbnVsbCwgY2NmLnNwYXRpYWxQbGFjZW1lbnQudGFyZ2V0LCBudWxsLCBudWxsKSkge1xuICAgICAgY29uc3Qgc291cmNlID0gZWRnZVNvdXJjZVtxdWFkLnN1YmplY3QuaWRdO1xuICAgICAgaWYgKHNvdXJjZSkge1xuICAgICAgICB0aGlzLmFkZEVkZ2UocXVhZC5zdWJqZWN0LmlkLCBzb3VyY2UsIHF1YWQub2JqZWN0LmlkLCAnU3BhdGlhbFBsYWNlbWVudCcpO1xuICAgICAgfVxuICAgIH1cbiAgfVxuXG4gIGFkZE5vZGUoaWQ6IHN0cmluZywgdHlwZTogc3RyaW5nKTogdm9pZCB7XG4gICAgdGhpcy5ncmFwaC5tZXJnZU5vZGUoaWQsIHsgdHlwZSB9KTtcbiAgfVxuXG4gIGFkZEVkZ2UoaWQ6IHN0cmluZywgc291cmNlOiBzdHJpbmcsIHRhcmdldDogc3RyaW5nLCB0eXBlOiBzdHJpbmcpOiB2b2lkIHtcbiAgICB0aGlzLmdyYXBoLm1lcmdlRGlyZWN0ZWRFZGdlKHNvdXJjZSwgdGFyZ2V0LCB7IHR5cGUsIGlkIH0pO1xuICB9XG5cbiAgZ2V0VHJhbnNmb3JtYXRpb25NYXRyaXgoc291cmNlSVJJOiBzdHJpbmcsIHRhcmdldElSSTogc3RyaW5nKTogTWF0cml4NCB8IHVuZGVmaW5lZCB7XG4gICAgaWYgKHNvdXJjZUlSSSA9PT0gdGFyZ2V0SVJJKSB7XG4gICAgICByZXR1cm4gbmV3IE1hdHJpeDQoTWF0cml4NC5JREVOVElUWSk7IC8vIGlkZW50aXR5XG4gICAgfVxuICAgIGlmICghdGhpcy5ncmFwaC5oYXNOb2RlKHNvdXJjZUlSSSkgfHwgIXRoaXMuZ3JhcGguaGFzTm9kZSh0YXJnZXRJUkkpKSB7XG4gICAgICByZXR1cm4gdW5kZWZpbmVkO1xuICAgIH1cblxuICAgIGNvbnN0IHN0b3JlID0gdGhpcy5kYi5zdG9yZTtcbiAgICBjb25zdCB0eCA9IG5ldyBNYXRyaXg0KE1hdHJpeDQuSURFTlRJVFkpO1xuICAgIGNvbnN0IHBhdGggPSBzaG9ydGVzdFBhdGgodGhpcy5ncmFwaCwgc291cmNlSVJJLCB0YXJnZXRJUkkpO1xuICAgIGlmIChwYXRoICYmIHBhdGgubGVuZ3RoID4gMCkge1xuICAgICAgcGF0aC5yZXZlcnNlKCk7XG4gICAgICBsZXQgdGFyZ2V0OiBzdHJpbmcgfCBudW1iZXIgPSAnJztcbiAgICAgIGZvciAoY29uc3Qgc291cmNlIG9mIHBhdGgpIHtcbiAgICAgICAgaWYgKHRhcmdldCkge1xuICAgICAgICAgIGNvbnN0IHBsYWNlbWVudElkID0gdGhpcy5ncmFwaC5nZXRFZGdlQXR0cmlidXRlKHNvdXJjZSwgdGFyZ2V0LCAnaWQnKTtcbiAgICAgICAgICBjb25zdCBwbGFjZW1lbnQgPSBnZXRTcGF0aWFsUGxhY2VtZW50KHN0b3JlLCBwbGFjZW1lbnRJZCk7XG4gICAgICAgICAgYXBwbHlTcGF0aWFsUGxhY2VtZW50KHR4LCBwbGFjZW1lbnQpO1xuICAgICAgICB9XG4gICAgICAgIHRhcmdldCA9IHNvdXJjZTtcbiAgICAgIH1cbiAgICAgIHJldHVybiB0eDtcbiAgICB9IGVsc2Uge1xuICAgICAgcmV0dXJuIHVuZGVmaW5lZDtcbiAgICB9XG4gIH1cblxuICBnZXRTcGF0aWFsUGxhY2VtZW50KHNvdXJjZTogU3BhdGlhbEVudGl0eSwgdGFyZ2V0SXJpOiBzdHJpbmcpOiBGbGF0U3BhdGlhbFBsYWNlbWVudCB8IHVuZGVmaW5lZCB7XG4gICAgY29uc3Qgc291cmNlSXJpID0gdGhpcy5ncmFwaC5oYXNOb2RlKHNvdXJjZVsnQGlkJ10pID8gc291cmNlWydAaWQnXSA6IHVuZGVmaW5lZDtcbiAgICBjb25zdCBwbGFjZW1lbnQ6IFNwYXRpYWxQbGFjZW1lbnQgPSBnZXQoc291cmNlLCAncGxhY2VtZW50WzBdJywgZ2V0KHNvdXJjZSwgJ3BsYWNlbWVudCcsIHVuZGVmaW5lZCkpO1xuXG4gICAgbGV0IG1hdHJpeDogTWF0cml4NCB8IHVuZGVmaW5lZDtcbiAgICBpZiAocGxhY2VtZW50ICYmIHRoaXMuZ3JhcGguaGFzTm9kZShwbGFjZW1lbnQudGFyZ2V0KSkge1xuICAgICAgbWF0cml4ID0gdGhpcy5nZXRUcmFuc2Zvcm1hdGlvbk1hdHJpeChwbGFjZW1lbnQudGFyZ2V0IGFzIHVua25vd24gYXMgc3RyaW5nLCB0YXJnZXRJcmkpO1xuICAgICAgaWYgKG1hdHJpeCkge1xuICAgICAgICBtYXRyaXggPSBhcHBseVNwYXRpYWxQbGFjZW1lbnQobWF0cml4LCBwbGFjZW1lbnQpO1xuICAgICAgfVxuICAgIH0gZWxzZSBpZiAoc291cmNlSXJpKSB7XG4gICAgICBtYXRyaXggPSB0aGlzLmdldFRyYW5zZm9ybWF0aW9uTWF0cml4KHNvdXJjZUlyaSwgdGFyZ2V0SXJpKTtcbiAgICB9XG5cbiAgICBpZiAobWF0cml4KSB7XG4gICAgICBjb25zdCBldWxlciA9IG5ldyBFdWxlcigpLmZyb21Sb3RhdGlvbk1hdHJpeChtYXRyaXgsIEV1bGVyLlhZWik7XG4gICAgICBjb25zdCBUID0gbWF0cml4LmdldFRyYW5zbGF0aW9uKCkubWFwKG4gPT4gbiAqIDEwMDApIGFzIFtudW1iZXIsIG51bWJlciwgbnVtYmVyXTtcbiAgICAgIGNvbnN0IFIgPSBldWxlci50b1ZlY3RvcjMoKS5tYXA8bnVtYmVyPih0b0RlZ3JlZXMpIGFzIFtudW1iZXIsIG51bWJlciwgbnVtYmVyXTtcbiAgICAgIGNvbnN0IFMgPSBtYXRyaXguZ2V0U2NhbGUoKS5tYXAobiA9PiBuIDwgMSAmJiBuID4gMC45OTk5OTkgPyAxIDogbikgYXMgW251bWJlciwgbnVtYmVyLCBudW1iZXJdO1xuXG4gICAgICByZXR1cm4ge1xuICAgICAgICAnQGNvbnRleHQnOiAnaHR0cHM6Ly9odWJtYXBjb25zb3J0aXVtLmdpdGh1Yi5pby9odWJtYXAtb250b2xvZ3kvY2NmLWNvbnRleHQuanNvbmxkJyxcbiAgICAgICAgJ0BpZCc6IGBodHRwOi8vcHVybC5vcmcvY2NmLzEuNS8ke3V1aWRWNCgpfV9wbGFjZW1lbnRgLFxuICAgICAgICAnQHR5cGUnOiAnU3BhdGlhbFBsYWNlbWVudCcsXG4gICAgICAgIHNvdXJjZTogc291cmNlWydAaWQnXSxcbiAgICAgICAgdGFyZ2V0OiB0YXJnZXRJcmksXG4gICAgICAgIHBsYWNlbWVudF9kYXRlOiBuZXcgRGF0ZSgpLnRvSVNPU3RyaW5nKCkuc3BsaXQoJ1QnKVswXSxcbiAgICAgICAgeF9zY2FsaW5nOiBTWzBdLFxuICAgICAgICB5X3NjYWxpbmc6IFNbMV0sXG4gICAgICAgIHpfc2NhbGluZzogU1syXSxcbiAgICAgICAgc2NhbGluZ191bml0czogJ3JhdGlvJyxcbiAgICAgICAgeF9yb3RhdGlvbjogUlswXSxcbiAgICAgICAgeV9yb3RhdGlvbjogUlsxXSxcbiAgICAgICAgel9yb3RhdGlvbjogUlsyXSxcbiAgICAgICAgcm90YXRpb25fb3JkZXI6ICdYWVonLFxuICAgICAgICByb3RhdGlvbl91bml0czogJ2RlZ3JlZScsXG4gICAgICAgIHhfdHJhbnNsYXRpb246IFRbMF0sXG4gICAgICAgIHlfdHJhbnNsYXRpb246IFRbMV0sXG4gICAgICAgIHpfdHJhbnNsYXRpb246IFRbMl0sXG4gICAgICAgIHRyYW5zbGF0aW9uX3VuaXRzOiAnbWlsbGltZXRlcidcbiAgICAgIH07XG4gICAgfSBlbHNlIHtcbiAgICAgIHJldHVybiB1bmRlZmluZWQ7XG4gICAgfVxuICB9XG59XG4iXX0= \ No newline at end of file diff --git a/ccf-database/esm2015/lib/ccf-spatial-scene.js b/ccf-database/esm2015/lib/ccf-spatial-scene.js deleted file mode 100644 index 990febff0..000000000 --- a/ccf-database/esm2015/lib/ccf-spatial-scene.js +++ /dev/null @@ -1,153 +0,0 @@ -/* eslint-disable @typescript-eslint/naming-convention */ -import { Matrix4, toRadians } from '@math.gl/core'; -import { getAnatomicalStructures, getExtractionSet, getExtractionSets, getReferenceOrgans, getSpatialEntity, } from './queries/spatial-result-n3'; -import { ccf } from './util/prefixes'; -export class CCFSpatialScene { - constructor(db) { - this.db = db; - } - getSpatialEntity(iri) { - return getSpatialEntity(this.db.store, iri); - } - getExtractionSets(iri) { - return getExtractionSets(this.db.store, iri); - } - getExtractionSet(iri) { - return getExtractionSet(this.db.store, iri); - } - getAnatomicalStructures(iri) { - return getAnatomicalStructures(this.db.store, iri); - } - getReferenceOrgans() { - return getReferenceOrgans(this.db.store); - } - getReferenceBody(filter) { - let bodyId; - switch (filter === null || filter === void 0 ? void 0 : filter.sex) { - case 'Male': - bodyId = ccf.spatial.Male.id; - break; - case 'Female': - bodyId = ccf.spatial.Female.id; - break; - case 'Both': - default: - bodyId = ccf.spatial.BothSexes.id; - break; - } - return this.getSpatialEntity(bodyId); - } - getReferenceOrganSets(filter) { - let organSet = this.getReferenceOrgans(); - switch (filter === null || filter === void 0 ? void 0 : filter.sex) { - case 'Male': - organSet = organSet.filter(s => s.sex === 'Male'); - break; - case 'Female': - organSet = organSet.filter(s => s.sex === 'Female'); - break; - case 'Both': - default: - break; - } - if (filter === null || filter === void 0 ? void 0 : filter.debug) { - organSet = organSet.map(o => [[o], this.getAnatomicalStructures(o['@id'])]) - .reduce((acc, [organ, structures]) => acc.concat(structures.length > 0 ? structures : organ), []); - } - return organSet; - } - getReferenceSceneNodes(filter) { - const body = this.getReferenceBody(filter); - const skinNodes = []; - let nodes = [ - ...this.getReferenceOrganSets(filter).map((organ) => { - const isSkin = organ.representation_of === 'http://purl.obolibrary.org/obo/UBERON_0002097'; - const sceneNode = this.getSceneNode(organ, body, { - color: [255, 255, 255, 255], opacity: isSkin ? 0.5 : 0.2, unpickable: true, _lighting: 'pbr', zoomBasedOpacity: !isSkin - }); - if (isSkin && sceneNode) { - skinNodes.push(sceneNode); - return undefined; - } - else { - return sceneNode; - } - }) - ]; - if (skinNodes.length > 0) { - nodes = [...skinNodes, ...nodes]; - } - if (filter === null || filter === void 0 ? void 0 : filter.debug) { - // Debug bounding boxes - nodes = nodes.concat([ - this.getSceneNode(this.getSpatialEntity(ccf.base('VHRightKidney').id), body, { color: [0, 0, 255, 0.5 * 255], geometry: 'wireframe' }), - this.getSceneNode(this.getSpatialEntity(ccf.base('VHLeftKidney').id), body, { color: [255, 0, 0, 0.5 * 255], geometry: 'wireframe' }), - this.getSceneNode(this.getSpatialEntity(ccf.base('VHSpleenCC1').id), body, { color: [0, 255, 0, 0.5 * 255], geometry: 'wireframe' }), - this.getSceneNode(this.getSpatialEntity(ccf.base('VHSpleenCC2').id), body, { color: [0, 255, 0, 0.5 * 255], geometry: 'wireframe' }), - this.getSceneNode(this.getSpatialEntity(ccf.base('VHSpleenCC3').id), body, { color: [0, 255, 0, 0.5 * 255], geometry: 'wireframe' }) - ]); - } - return nodes.filter(s => s !== undefined); - } - getReferenceOrganScene(organIri, filter) { - var _a, _b; - const hasSexFilter = (filter === null || filter === void 0 ? void 0 : filter.sex) !== undefined && ((_a = filter === null || filter === void 0 ? void 0 : filter.sex) === null || _a === void 0 ? void 0 : _a.toLowerCase()) !== 'both'; - const organs = this.getReferenceOrgans().filter((o) => o.representation_of === organIri && (!hasSexFilter || o.sex === (filter === null || filter === void 0 ? void 0 : filter.sex))); - if (organs.length > 0) { - const organ = organs[0]; - const isSkin = organ.representation_of === 'http://purl.obolibrary.org/obo/UBERON_0002097'; - const organNode = this.getSceneNode(organ, organ, { - color: [255, 255, 255, 255], opacity: isSkin ? 0.5 : 0.2, unpickable: true, _lighting: 'pbr' - }); - const scene = ((_b = this.db.getSpatialEntities(filter)) !== null && _b !== void 0 ? _b : []).map((entity) => this.getSceneNode(entity, organ, { color: [255, 255, 255, 0.9 * 255] })); - return [organNode].concat(scene).filter(n => n !== undefined); - } - else { - return []; - } - } - getEntitySceneNodes(filter) { - const body = this.getReferenceBody(filter); - return this.db.getSpatialEntities(filter).map((entity) => this.getSceneNode(entity, body, { color: [255, 255, 255, 0.9 * 255] })).filter(s => s !== undefined); - } - getSceneNode(source, target, nodeAttrs = {}) { - var _a, _b, _c, _d; - const has3dObject = (_b = (_a = source === null || source === void 0 ? void 0 : source.object) === null || _a === void 0 ? void 0 : _a.file_format) === null || _b === void 0 ? void 0 : _b.startsWith('model/gltf'); - const sourceID = has3dObject && source.object ? source.object['@id'] : source['@id']; - let transform = this.db.graph.getTransformationMatrix(sourceID, target['@id']); - if (transform) { - if (has3dObject) { - transform = new Matrix4(Matrix4.IDENTITY).rotateX(toRadians(90)).multiplyLeft(transform); - } - else { - // Scale visible bounding boxes to the desired dimensions - let factor; - switch (source.dimension_units) { - case 'centimeter': - factor = 1 / 100; - break; - case 'millimeter': - factor = 1 / 1000; - break; - case 'meter': - default: - factor = 1; - break; - } - const scale = [source.x_dimension, source.y_dimension, source.z_dimension].map(dim => dim * factor / 2); - transform.scale(scale); - } - return Object.assign({ '@id': source['@id'], '@type': 'SpatialSceneNode', entityId: source.entityId, ccf_annotations: source.ccf_annotations, representation_of: source.representation_of, reference_organ: source.reference_organ, scenegraph: has3dObject ? (_c = source.object) === null || _c === void 0 ? void 0 : _c.file : undefined, scenegraphNode: has3dObject ? (_d = source.object) === null || _d === void 0 ? void 0 : _d.file_subpath : undefined, transformMatrix: transform, tooltip: source.label }, nodeAttrs); - } - else { - return undefined; - } - } - getScene(filter) { - return [ - ...this.getReferenceSceneNodes(filter), - ...this.getEntitySceneNodes(filter) - ]; - } -} -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2NmLXNwYXRpYWwtc2NlbmUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9wcm9qZWN0cy9jY2YtZGF0YWJhc2Uvc3JjL2xpYi9jY2Ytc3BhdGlhbC1zY2VuZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSx5REFBeUQ7QUFDekQsT0FBTyxFQUFFLE9BQU8sRUFBRSxTQUFTLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFJbkQsT0FBTyxFQUNMLHVCQUF1QixFQUFFLGdCQUFnQixFQUFFLGlCQUFpQixFQUFFLGtCQUFrQixFQUFFLGdCQUFnQixHQUNuRyxNQUFNLDZCQUE2QixDQUFDO0FBRXJDLE9BQU8sRUFBRSxHQUFHLEVBQUUsTUFBTSxpQkFBaUIsQ0FBQztBQTRCdEMsTUFBTSxPQUFPLGVBQWU7SUFFMUIsWUFBb0IsRUFBZTtRQUFmLE9BQUUsR0FBRixFQUFFLENBQWE7SUFBRyxDQUFDO0lBRXZDLGdCQUFnQixDQUFDLEdBQVc7UUFDMUIsT0FBTyxnQkFBZ0IsQ0FBQyxJQUFJLENBQUMsRUFBRSxDQUFDLEtBQUssRUFBRSxHQUFHLENBQUMsQ0FBQztJQUM5QyxDQUFDO0lBQ0QsaUJBQWlCLENBQUMsR0FBVztRQUMzQixPQUFPLGlCQUFpQixDQUFDLElBQUksQ0FBQyxFQUFFLENBQUMsS0FBSyxFQUFFLEdBQUcsQ0FBQyxDQUFDO0lBQy9DLENBQUM7SUFDRCxnQkFBZ0IsQ0FBQyxHQUFXO1FBQzFCLE9BQU8sZ0JBQWdCLENBQUMsSUFBSSxDQUFDLEVBQUUsQ0FBQyxLQUFLLEVBQUUsR0FBRyxDQUFDLENBQUM7SUFDOUMsQ0FBQztJQUNELHVCQUF1QixDQUFDLEdBQVc7UUFDakMsT0FBTyx1QkFBdUIsQ0FBQyxJQUFJLENBQUMsRUFBRSxDQUFDLEtBQUssRUFBRSxHQUFHLENBQUMsQ0FBQztJQUNyRCxDQUFDO0lBQ0Qsa0JBQWtCO1FBQ2hCLE9BQU8sa0JBQWtCLENBQUMsSUFBSSxDQUFDLEVBQUUsQ0FBQyxLQUFLLENBQUMsQ0FBQztJQUMzQyxDQUFDO0lBRUQsZ0JBQWdCLENBQUMsTUFBZTtRQUM5QixJQUFJLE1BQWMsQ0FBQztRQUNuQixRQUFRLE1BQU0sYUFBTixNQUFNLHVCQUFOLE1BQU0sQ0FBRSxHQUFHLEVBQUU7WUFDbkIsS0FBSyxNQUFNO2dCQUNULE1BQU0sR0FBRyxHQUFHLENBQUMsT0FBTyxDQUFDLElBQUksQ0FBQyxFQUFFLENBQUM7Z0JBQzdCLE1BQU07WUFDUixLQUFLLFFBQVE7Z0JBQ1gsTUFBTSxHQUFHLEdBQUcsQ0FBQyxPQUFPLENBQUMsTUFBTSxDQUFDLEVBQUUsQ0FBQztnQkFDL0IsTUFBTTtZQUNSLEtBQUssTUFBTSxDQUFDO1lBQ1o7Z0JBQ0UsTUFBTSxHQUFHLEdBQUcsQ0FBQyxPQUFPLENBQUMsU0FBUyxDQUFDLEVBQUUsQ0FBQztnQkFDbEMsTUFBTTtTQUNUO1FBQ0QsT0FBTyxJQUFJLENBQUMsZ0JBQWdCLENBQUMsTUFBTSxDQUFDLENBQUM7SUFDdkMsQ0FBQztJQUVELHFCQUFxQixDQUFDLE1BQWU7UUFDbkMsSUFBSSxRQUFRLEdBQUcsSUFBSSxDQUFDLGtCQUFrQixFQUFFLENBQUM7UUFDekMsUUFBUSxNQUFNLGFBQU4sTUFBTSx1QkFBTixNQUFNLENBQUUsR0FBRyxFQUFFO1lBQ25CLEtBQUssTUFBTTtnQkFDVCxRQUFRLEdBQUcsUUFBUSxDQUFDLE1BQU0sQ0FBQyxDQUFDLENBQUMsRUFBRSxDQUFDLENBQUMsQ0FBQyxHQUFHLEtBQUssTUFBTSxDQUFDLENBQUM7Z0JBQ2xELE1BQU07WUFDUixLQUFLLFFBQVE7Z0JBQ1gsUUFBUSxHQUFHLFFBQVEsQ0FBQyxNQUFNLENBQUMsQ0FBQyxDQUFDLEVBQUUsQ0FBQyxDQUFDLENBQUMsR0FBRyxLQUFLLFFBQVEsQ0FBQyxDQUFDO2dCQUNwRCxNQUFNO1lBQ1IsS0FBSyxNQUFNLENBQUM7WUFDWjtnQkFDRSxNQUFNO1NBQ1Q7UUFDRCxJQUFJLE1BQU0sYUFBTixNQUFNLHVCQUFOLE1BQU0sQ0FBRSxLQUFLLEVBQUU7WUFDakIsUUFBUSxHQUFHLFFBQVEsQ0FBQyxHQUFHLENBQUMsQ0FBQyxDQUFDLEVBQUUsQ0FBQyxDQUFFLENBQUMsQ0FBQyxDQUFDLEVBQUUsSUFBSSxDQUFDLHVCQUF1QixDQUFDLENBQUMsQ0FBQyxLQUFLLENBQUMsQ0FBQyxDQUFDLENBQUM7aUJBQ3pFLE1BQU0sQ0FBa0IsQ0FBQyxHQUFHLEVBQUUsQ0FBQyxLQUFLLEVBQUUsVUFBVSxDQUFDLEVBQUUsRUFBRSxDQUFDLEdBQUcsQ0FBQyxNQUFNLENBQUMsVUFBVSxDQUFDLE1BQU0sR0FBRyxDQUFDLENBQUMsQ0FBQyxDQUFDLFVBQVUsQ0FBQyxDQUFDLENBQUMsS0FBSyxDQUFDLEVBQUUsRUFBRSxDQUFDLENBQUM7U0FDdEg7UUFDRCxPQUFPLFFBQVEsQ0FBQztJQUNsQixDQUFDO0lBRUQsc0JBQXNCLENBQUMsTUFBZTtRQUNwQyxNQUFNLElBQUksR0FBRyxJQUFJLENBQUMsZ0JBQWdCLENBQUMsTUFBTSxDQUFDLENBQUM7UUFDM0MsTUFBTSxTQUFTLEdBQXVCLEVBQUUsQ0FBQztRQUN6QyxJQUFJLEtBQUssR0FBcUM7WUFDNUMsR0FBRyxJQUFJLENBQUMscUJBQXFCLENBQUMsTUFBTSxDQUFDLENBQUMsR0FBRyxDQUFDLENBQUMsS0FBSyxFQUFFLEVBQUU7Z0JBQ2xELE1BQU0sTUFBTSxHQUFHLEtBQUssQ0FBQyxpQkFBaUIsS0FBSywrQ0FBK0MsQ0FBQztnQkFDM0YsTUFBTSxTQUFTLEdBQUcsSUFBSSxDQUFDLFlBQVksQ0FBQyxLQUFLLEVBQUUsSUFBSSxFQUFFO29CQUMvQyxLQUFLLEVBQUUsQ0FBQyxHQUFHLEVBQUUsR0FBRyxFQUFFLEdBQUcsRUFBRSxHQUFHLENBQUMsRUFBRSxPQUFPLEVBQUUsTUFBTSxDQUFDLENBQUMsQ0FBQyxHQUFHLENBQUMsQ0FBQyxDQUFDLEdBQUcsRUFBRSxVQUFVLEVBQUUsSUFBSSxFQUFFLFNBQVMsRUFBRSxLQUFLLEVBQUUsZ0JBQWdCLEVBQUUsQ0FBQyxNQUFNO2lCQUN4SCxDQUFDLENBQUM7Z0JBQ0gsSUFBSSxNQUFNLElBQUksU0FBUyxFQUFFO29CQUN2QixTQUFTLENBQUMsSUFBSSxDQUFDLFNBQVMsQ0FBQyxDQUFDO29CQUMxQixPQUFPLFNBQVMsQ0FBQztpQkFDbEI7cUJBQU07b0JBQ0wsT0FBTyxTQUFTLENBQUM7aUJBQ2xCO1lBQ0gsQ0FBQyxDQUFDO1NBQ0gsQ0FBQztRQUNGLElBQUksU0FBUyxDQUFDLE1BQU0sR0FBRyxDQUFDLEVBQUU7WUFDeEIsS0FBSyxHQUFHLENBQUMsR0FBRyxTQUFTLEVBQUUsR0FBRyxLQUFLLENBQUMsQ0FBQztTQUNsQztRQUVELElBQUksTUFBTSxhQUFOLE1BQU0sdUJBQU4sTUFBTSxDQUFFLEtBQUssRUFBRTtZQUNqQix1QkFBdUI7WUFDdkIsS0FBSyxHQUFHLEtBQUssQ0FBQyxNQUFNLENBQUM7Z0JBQ25CLElBQUksQ0FBQyxZQUFZLENBQUMsSUFBSSxDQUFDLGdCQUFnQixDQUFDLEdBQUcsQ0FBQyxJQUFJLENBQUMsZUFBZSxDQUFDLENBQUMsRUFBRSxDQUFDLEVBQUUsSUFBSSxFQUFFLEVBQUUsS0FBSyxFQUFFLENBQUMsQ0FBQyxFQUFFLENBQUMsRUFBRSxHQUFHLEVBQUUsR0FBRyxHQUFDLEdBQUcsQ0FBQyxFQUFFLFFBQVEsRUFBRSxXQUFXLEVBQUUsQ0FBQztnQkFDcEksSUFBSSxDQUFDLFlBQVksQ0FBQyxJQUFJLENBQUMsZ0JBQWdCLENBQUMsR0FBRyxDQUFDLElBQUksQ0FBQyxjQUFjLENBQUMsQ0FBQyxFQUFFLENBQUMsRUFBRSxJQUFJLEVBQUUsRUFBRSxLQUFLLEVBQUUsQ0FBQyxHQUFHLEVBQUUsQ0FBQyxFQUFFLENBQUMsRUFBRSxHQUFHLEdBQUMsR0FBRyxDQUFDLEVBQUUsUUFBUSxFQUFFLFdBQVcsRUFBRSxDQUFDO2dCQUNuSSxJQUFJLENBQUMsWUFBWSxDQUFDLElBQUksQ0FBQyxnQkFBZ0IsQ0FBQyxHQUFHLENBQUMsSUFBSSxDQUFDLGFBQWEsQ0FBQyxDQUFDLEVBQUUsQ0FBQyxFQUFFLElBQUksRUFBRSxFQUFFLEtBQUssRUFBRSxDQUFDLENBQUMsRUFBRSxHQUFHLEVBQUUsQ0FBQyxFQUFFLEdBQUcsR0FBQyxHQUFHLENBQUMsRUFBRSxRQUFRLEVBQUUsV0FBVyxFQUFFLENBQUM7Z0JBQ2xJLElBQUksQ0FBQyxZQUFZLENBQUMsSUFBSSxDQUFDLGdCQUFnQixDQUFDLEdBQUcsQ0FBQyxJQUFJLENBQUMsYUFBYSxDQUFDLENBQUMsRUFBRSxDQUFDLEVBQUUsSUFBSSxFQUFFLEVBQUUsS0FBSyxFQUFFLENBQUMsQ0FBQyxFQUFFLEdBQUcsRUFBRSxDQUFDLEVBQUUsR0FBRyxHQUFDLEdBQUcsQ0FBQyxFQUFFLFFBQVEsRUFBRSxXQUFXLEVBQUUsQ0FBQztnQkFDbEksSUFBSSxDQUFDLFlBQVksQ0FBQyxJQUFJLENBQUMsZ0JBQWdCLENBQUMsR0FBRyxDQUFDLElBQUksQ0FBQyxhQUFhLENBQUMsQ0FBQyxFQUFFLENBQUMsRUFBRSxJQUFJLEVBQUUsRUFBRSxLQUFLLEVBQUUsQ0FBQyxDQUFDLEVBQUUsR0FBRyxFQUFFLENBQUMsRUFBRSxHQUFHLEdBQUMsR0FBRyxDQUFDLEVBQUUsUUFBUSxFQUFFLFdBQVcsRUFBRSxDQUFDO2FBQ25JLENBQUMsQ0FBQztTQUNKO1FBRUQsT0FBTyxLQUFLLENBQUMsTUFBTSxDQUFDLENBQUMsQ0FBQyxFQUFFLENBQUMsQ0FBQyxLQUFLLFNBQVMsQ0FBdUIsQ0FBQztJQUNsRSxDQUFDO0lBRUQsc0JBQXNCLENBQUMsUUFBZ0IsRUFBRSxNQUFlOztRQUN0RCxNQUFNLFlBQVksR0FBRyxDQUFBLE1BQU0sYUFBTixNQUFNLHVCQUFOLE1BQU0sQ0FBRSxHQUFHLE1BQUssU0FBUyxJQUFJLENBQUEsTUFBQSxNQUFNLGFBQU4sTUFBTSx1QkFBTixNQUFNLENBQUUsR0FBRywwQ0FBRSxXQUFXLEVBQUUsTUFBSyxNQUFNLENBQUM7UUFDeEYsTUFBTSxNQUFNLEdBQUcsSUFBSSxDQUFDLGtCQUFrQixFQUFFLENBQUMsTUFBTSxDQUFDLENBQUMsQ0FBQyxFQUFFLEVBQUUsQ0FBQyxDQUFDLENBQUMsaUJBQWlCLEtBQUssUUFBUSxJQUFJLENBQUMsQ0FBQyxZQUFZLElBQUksQ0FBQyxDQUFDLEdBQUcsTUFBSyxNQUFNLGFBQU4sTUFBTSx1QkFBTixNQUFNLENBQUUsR0FBRyxDQUFBLENBQUMsQ0FBQyxDQUFDO1FBQ3JJLElBQUksTUFBTSxDQUFDLE1BQU0sR0FBRyxDQUFDLEVBQUU7WUFDckIsTUFBTSxLQUFLLEdBQUcsTUFBTSxDQUFDLENBQUMsQ0FBQyxDQUFDO1lBQ3hCLE1BQU0sTUFBTSxHQUFHLEtBQUssQ0FBQyxpQkFBaUIsS0FBSywrQ0FBK0MsQ0FBQztZQUMzRixNQUFNLFNBQVMsR0FBRyxJQUFJLENBQUMsWUFBWSxDQUFDLEtBQUssRUFBRSxLQUFLLEVBQUU7Z0JBQ2hELEtBQUssRUFBRSxDQUFDLEdBQUcsRUFBRSxHQUFHLEVBQUUsR0FBRyxFQUFFLEdBQUcsQ0FBQyxFQUFFLE9BQU8sRUFBRSxNQUFNLENBQUMsQ0FBQyxDQUFDLEdBQUcsQ0FBQyxDQUFDLENBQUMsR0FBRyxFQUFFLFVBQVUsRUFBRSxJQUFJLEVBQUUsU0FBUyxFQUFFLEtBQUs7YUFDN0YsQ0FBcUIsQ0FBQztZQUV2QixNQUFNLEtBQUssR0FBRyxDQUFDLE1BQUEsSUFBSSxDQUFDLEVBQUUsQ0FBQyxrQkFBa0IsQ0FBQyxNQUFNLENBQUMsbUNBQUksRUFBRSxDQUFDLENBQUMsR0FBRyxDQUFDLENBQUMsTUFBTSxFQUFFLEVBQUUsQ0FDdEUsSUFBSSxDQUFDLFlBQVksQ0FBQyxNQUFNLEVBQUUsS0FBSyxFQUFFLEVBQUUsS0FBSyxFQUFFLENBQUMsR0FBRyxFQUFFLEdBQUcsRUFBRSxHQUFHLEVBQUUsR0FBRyxHQUFDLEdBQUcsQ0FBQyxFQUFFLENBQUMsQ0FDaEQsQ0FBQztZQUN4QixPQUFPLENBQUMsU0FBUyxDQUFDLENBQUMsTUFBTSxDQUFDLEtBQUssQ0FBQyxDQUFDLE1BQU0sQ0FBQyxDQUFDLENBQUMsRUFBRSxDQUFDLENBQUMsS0FBSyxTQUFTLENBQUMsQ0FBQztTQUMvRDthQUFNO1lBQ0wsT0FBTyxFQUFFLENBQUM7U0FDWDtJQUNILENBQUM7SUFFRCxtQkFBbUIsQ0FBQyxNQUFlO1FBQ2pDLE1BQU0sSUFBSSxHQUFHLElBQUksQ0FBQyxnQkFBZ0IsQ0FBQyxNQUFNLENBQUMsQ0FBQztRQUMzQyxPQUFPLElBQUksQ0FBQyxFQUFFLENBQUMsa0JBQWtCLENBQUMsTUFBTSxDQUFDLENBQUMsR0FBRyxDQUFDLENBQUMsTUFBTSxFQUFFLEVBQUUsQ0FDdkQsSUFBSSxDQUFDLFlBQVksQ0FBQyxNQUFNLEVBQUUsSUFBSSxFQUFFLEVBQUUsS0FBSyxFQUFFLENBQUMsR0FBRyxFQUFFLEdBQUcsRUFBRSxHQUFHLEVBQUUsR0FBRyxHQUFDLEdBQUcsQ0FBQyxFQUFFLENBQUMsQ0FDckUsQ0FBQyxNQUFNLENBQUMsQ0FBQyxDQUFDLEVBQUUsQ0FBQyxDQUFDLEtBQUssU0FBUyxDQUF1QixDQUFDO0lBQ3ZELENBQUM7SUFFRCxZQUFZLENBQUMsTUFBcUIsRUFBRSxNQUFxQixFQUFFLFlBQXVDLEVBQUU7O1FBQ2xHLE1BQU0sV0FBVyxHQUFHLE1BQUEsTUFBQSxNQUFNLGFBQU4sTUFBTSx1QkFBTixNQUFNLENBQUUsTUFBTSwwQ0FBRSxXQUFXLDBDQUFFLFVBQVUsQ0FBQyxZQUFZLENBQUMsQ0FBQztRQUMxRSxNQUFNLFFBQVEsR0FBRyxXQUFXLElBQUksTUFBTSxDQUFDLE1BQU0sQ0FBQyxDQUFDLENBQUMsTUFBTSxDQUFDLE1BQU0sQ0FBQyxLQUFLLENBQUMsQ0FBQyxDQUFDLENBQUMsTUFBTSxDQUFDLEtBQUssQ0FBQyxDQUFDO1FBQ3JGLElBQUksU0FBUyxHQUFHLElBQUksQ0FBQyxFQUFFLENBQUMsS0FBSyxDQUFDLHVCQUF1QixDQUFDLFFBQVEsRUFBRSxNQUFNLENBQUMsS0FBSyxDQUFDLENBQUMsQ0FBQztRQUMvRSxJQUFJLFNBQVMsRUFBRTtZQUNiLElBQUksV0FBVyxFQUFFO2dCQUNmLFNBQVMsR0FBRyxJQUFJLE9BQU8sQ0FBQyxPQUFPLENBQUMsUUFBUSxDQUFDLENBQUMsT0FBTyxDQUFDLFNBQVMsQ0FBQyxFQUFFLENBQUMsQ0FBQyxDQUFDLFlBQVksQ0FBQyxTQUFTLENBQUMsQ0FBQzthQUMxRjtpQkFBTTtnQkFDTCx5REFBeUQ7Z0JBQ3pELElBQUksTUFBYyxDQUFDO2dCQUNuQixRQUFRLE1BQU0sQ0FBQyxlQUFlLEVBQUU7b0JBQzlCLEtBQUssWUFBWTt3QkFDZixNQUFNLEdBQUcsQ0FBQyxHQUFHLEdBQUcsQ0FBQzt3QkFDakIsTUFBTTtvQkFDUixLQUFLLFlBQVk7d0JBQ2YsTUFBTSxHQUFHLENBQUMsR0FBRyxJQUFJLENBQUM7d0JBQ2xCLE1BQU07b0JBQ1IsS0FBSyxPQUFPLENBQUM7b0JBQ2I7d0JBQ0UsTUFBTSxHQUFHLENBQUMsQ0FBQzt3QkFDWCxNQUFNO2lCQUNUO2dCQUNELE1BQU0sS0FBSyxHQUFHLENBQUMsTUFBTSxDQUFDLFdBQVcsRUFBRSxNQUFNLENBQUMsV0FBVyxFQUFFLE1BQU0sQ0FBQyxXQUFXLENBQUMsQ0FBQyxHQUFHLENBQUMsR0FBRyxDQUFDLEVBQUUsQ0FBQyxHQUFHLEdBQUcsTUFBTSxHQUFHLENBQUMsQ0FBQyxDQUFDO2dCQUN4RyxTQUFTLENBQUMsS0FBSyxDQUFDLEtBQUssQ0FBQyxDQUFDO2FBQ3hCO1lBQ0QsdUJBQ0UsS0FBSyxFQUFFLE1BQU0sQ0FBQyxLQUFLLENBQUMsRUFBRSxPQUFPLEVBQUUsa0JBQWtCLEVBQ2pELFFBQVEsRUFBRSxNQUFNLENBQUMsUUFBUSxFQUN6QixlQUFlLEVBQUUsTUFBTSxDQUFDLGVBQWUsRUFDdkMsaUJBQWlCLEVBQUUsTUFBTSxDQUFDLGlCQUFpQixFQUMzQyxlQUFlLEVBQUUsTUFBTSxDQUFDLGVBQWUsRUFDdkMsVUFBVSxFQUFFLFdBQVcsQ0FBQyxDQUFDLENBQUMsTUFBQSxNQUFNLENBQUMsTUFBTSwwQ0FBRSxJQUFJLENBQUMsQ0FBQyxDQUFDLFNBQVMsRUFDekQsY0FBYyxFQUFFLFdBQVcsQ0FBQyxDQUFDLENBQUMsTUFBQSxNQUFNLENBQUMsTUFBTSwwQ0FBRSxZQUFZLENBQUMsQ0FBQyxDQUFDLFNBQVMsRUFDckUsZUFBZSxFQUFFLFNBQVMsRUFDMUIsT0FBTyxFQUFFLE1BQU0sQ0FBQyxLQUFLLElBQ2xCLFNBQVMsRUFDWjtTQUNIO2FBQU07WUFDTCxPQUFPLFNBQVMsQ0FBQztTQUNsQjtJQUNILENBQUM7SUFFRCxRQUFRLENBQUMsTUFBZTtRQUN0QixPQUFPO1lBQ0wsR0FBRyxJQUFJLENBQUMsc0JBQXNCLENBQUMsTUFBTSxDQUFDO1lBQ3RDLEdBQUcsSUFBSSxDQUFDLG1CQUFtQixDQUFDLE1BQU0sQ0FBQztTQUNwQyxDQUFDO0lBQ0osQ0FBQztDQUNGIiwic291cmNlc0NvbnRlbnQiOlsiLyogZXNsaW50LWRpc2FibGUgQHR5cGVzY3JpcHQtZXNsaW50L25hbWluZy1jb252ZW50aW9uICovXG5pbXBvcnQgeyBNYXRyaXg0LCB0b1JhZGlhbnMgfSBmcm9tICdAbWF0aC5nbC9jb3JlJztcblxuaW1wb3J0IHsgQ0NGRGF0YWJhc2UgfSBmcm9tICcuL2NjZi1kYXRhYmFzZSc7XG5pbXBvcnQgeyBGaWx0ZXIgfSBmcm9tICcuL2ludGVyZmFjZXMnO1xuaW1wb3J0IHtcbiAgZ2V0QW5hdG9taWNhbFN0cnVjdHVyZXMsIGdldEV4dHJhY3Rpb25TZXQsIGdldEV4dHJhY3Rpb25TZXRzLCBnZXRSZWZlcmVuY2VPcmdhbnMsIGdldFNwYXRpYWxFbnRpdHksXG59IGZyb20gJy4vcXVlcmllcy9zcGF0aWFsLXJlc3VsdC1uMyc7XG5pbXBvcnQgeyBFeHRyYWN0aW9uU2V0LCBTcGF0aWFsRW50aXR5IH0gZnJvbSAnLi9zcGF0aWFsLXR5cGVzJztcbmltcG9ydCB7IGNjZiB9IGZyb20gJy4vdXRpbC9wcmVmaXhlcyc7XG5cblxuZXhwb3J0IHR5cGUgU3BhdGlhbFNjZW5lR2VvbWV0cnkgPSAnc3BoZXJlJyB8ICdjdWJlJyB8ICd3aXJlZnJhbWUnIHwgJ3RleHQnIHwgJ2NvbmUnIHwgJ2N5bGluZGVyJztcblxuZXhwb3J0IGludGVyZmFjZSBTcGF0aWFsU2NlbmVOb2RlIHtcbiAgJ0BpZCc6IHN0cmluZztcbiAgJ0B0eXBlJzogc3RyaW5nO1xuICBlbnRpdHlJZD86IHN0cmluZztcbiAgY2NmX2Fubm90YXRpb25zPzogc3RyaW5nW107XG4gIHJlcHJlc2VudGF0aW9uX29mPzogc3RyaW5nO1xuICByZWZlcmVuY2Vfb3JnYW4/OiBzdHJpbmc7XG4gIHVucGlja2FibGU/OiBib29sZWFuO1xuICBnZW9tZXRyeT86IFNwYXRpYWxTY2VuZUdlb21ldHJ5O1xuICB0ZXh0Pzogc3RyaW5nO1xuICBfbGlnaHRpbmc/OiBzdHJpbmc7XG4gIHNjZW5lZ3JhcGg/OiBzdHJpbmc7XG4gIHNjZW5lZ3JhcGhOb2RlPzogc3RyaW5nO1xuICB6b29tQmFzZWRPcGFjaXR5PzogYm9vbGVhbjtcbiAgem9vbVRvT25Mb2FkPzogYm9vbGVhbjtcbiAgY29sb3I/OiBbbnVtYmVyLCBudW1iZXIsIG51bWJlciwgbnVtYmVyXTtcbiAgb3BhY2l0eT86IG51bWJlcjtcbiAgdHJhbnNmb3JtTWF0cml4OiBNYXRyaXg0O1xuICBuYW1lPzogc3RyaW5nO1xuICB0b29sdGlwPzogc3RyaW5nO1xuICBwcmlvcml0eT86IG51bWJlcjtcbn1cblxuZXhwb3J0IGNsYXNzIENDRlNwYXRpYWxTY2VuZSB7XG5cbiAgY29uc3RydWN0b3IocHJpdmF0ZSBkYjogQ0NGRGF0YWJhc2UpIHt9XG5cbiAgZ2V0U3BhdGlhbEVudGl0eShpcmk6IHN0cmluZyk6IFNwYXRpYWxFbnRpdHkge1xuICAgIHJldHVybiBnZXRTcGF0aWFsRW50aXR5KHRoaXMuZGIuc3RvcmUsIGlyaSk7XG4gIH1cbiAgZ2V0RXh0cmFjdGlvblNldHMoaXJpOiBzdHJpbmcpOiBFeHRyYWN0aW9uU2V0W10ge1xuICAgIHJldHVybiBnZXRFeHRyYWN0aW9uU2V0cyh0aGlzLmRiLnN0b3JlLCBpcmkpO1xuICB9XG4gIGdldEV4dHJhY3Rpb25TZXQoaXJpOiBzdHJpbmcpOiBFeHRyYWN0aW9uU2V0IHtcbiAgICByZXR1cm4gZ2V0RXh0cmFjdGlvblNldCh0aGlzLmRiLnN0b3JlLCBpcmkpO1xuICB9XG4gIGdldEFuYXRvbWljYWxTdHJ1Y3R1cmVzKGlyaTogc3RyaW5nKTogU3BhdGlhbEVudGl0eVtdIHtcbiAgICByZXR1cm4gZ2V0QW5hdG9taWNhbFN0cnVjdHVyZXModGhpcy5kYi5zdG9yZSwgaXJpKTtcbiAgfVxuICBnZXRSZWZlcmVuY2VPcmdhbnMoKTogU3BhdGlhbEVudGl0eVtdIHtcbiAgICByZXR1cm4gZ2V0UmVmZXJlbmNlT3JnYW5zKHRoaXMuZGIuc3RvcmUpO1xuICB9XG5cbiAgZ2V0UmVmZXJlbmNlQm9keShmaWx0ZXI/OiBGaWx0ZXIpOiBTcGF0aWFsRW50aXR5IHtcbiAgICBsZXQgYm9keUlkOiBzdHJpbmc7XG4gICAgc3dpdGNoIChmaWx0ZXI/LnNleCkge1xuICAgICAgY2FzZSAnTWFsZSc6XG4gICAgICAgIGJvZHlJZCA9IGNjZi5zcGF0aWFsLk1hbGUuaWQ7XG4gICAgICAgIGJyZWFrO1xuICAgICAgY2FzZSAnRmVtYWxlJzpcbiAgICAgICAgYm9keUlkID0gY2NmLnNwYXRpYWwuRmVtYWxlLmlkO1xuICAgICAgICBicmVhaztcbiAgICAgIGNhc2UgJ0JvdGgnOlxuICAgICAgZGVmYXVsdDpcbiAgICAgICAgYm9keUlkID0gY2NmLnNwYXRpYWwuQm90aFNleGVzLmlkO1xuICAgICAgICBicmVhaztcbiAgICB9XG4gICAgcmV0dXJuIHRoaXMuZ2V0U3BhdGlhbEVudGl0eShib2R5SWQpO1xuICB9XG5cbiAgZ2V0UmVmZXJlbmNlT3JnYW5TZXRzKGZpbHRlcj86IEZpbHRlcik6IFNwYXRpYWxFbnRpdHlbXSB7XG4gICAgbGV0IG9yZ2FuU2V0ID0gdGhpcy5nZXRSZWZlcmVuY2VPcmdhbnMoKTtcbiAgICBzd2l0Y2ggKGZpbHRlcj8uc2V4KSB7XG4gICAgICBjYXNlICdNYWxlJzpcbiAgICAgICAgb3JnYW5TZXQgPSBvcmdhblNldC5maWx0ZXIocyA9PiBzLnNleCA9PT0gJ01hbGUnKTtcbiAgICAgICAgYnJlYWs7XG4gICAgICBjYXNlICdGZW1hbGUnOlxuICAgICAgICBvcmdhblNldCA9IG9yZ2FuU2V0LmZpbHRlcihzID0+IHMuc2V4ID09PSAnRmVtYWxlJyk7XG4gICAgICAgIGJyZWFrO1xuICAgICAgY2FzZSAnQm90aCc6XG4gICAgICBkZWZhdWx0OlxuICAgICAgICBicmVhaztcbiAgICB9XG4gICAgaWYgKGZpbHRlcj8uZGVidWcpIHtcbiAgICAgIG9yZ2FuU2V0ID0gb3JnYW5TZXQubWFwKG8gPT4gWyBbb10sIHRoaXMuZ2V0QW5hdG9taWNhbFN0cnVjdHVyZXMob1snQGlkJ10pXSlcbiAgICAgICAgLnJlZHVjZTxTcGF0aWFsRW50aXR5W10+KChhY2MsIFtvcmdhbiwgc3RydWN0dXJlc10pID0+IGFjYy5jb25jYXQoc3RydWN0dXJlcy5sZW5ndGggPiAwID8gc3RydWN0dXJlcyA6IG9yZ2FuKSwgW10pO1xuICAgIH1cbiAgICByZXR1cm4gb3JnYW5TZXQ7XG4gIH1cblxuICBnZXRSZWZlcmVuY2VTY2VuZU5vZGVzKGZpbHRlcj86IEZpbHRlcik6IFNwYXRpYWxTY2VuZU5vZGVbXSB7XG4gICAgY29uc3QgYm9keSA9IHRoaXMuZ2V0UmVmZXJlbmNlQm9keShmaWx0ZXIpO1xuICAgIGNvbnN0IHNraW5Ob2RlczogU3BhdGlhbFNjZW5lTm9kZVtdID0gW107XG4gICAgbGV0IG5vZGVzOiAoU3BhdGlhbFNjZW5lTm9kZSB8IHVuZGVmaW5lZClbXSA9IFtcbiAgICAgIC4uLnRoaXMuZ2V0UmVmZXJlbmNlT3JnYW5TZXRzKGZpbHRlcikubWFwKChvcmdhbikgPT4ge1xuICAgICAgICBjb25zdCBpc1NraW4gPSBvcmdhbi5yZXByZXNlbnRhdGlvbl9vZiA9PT0gJ2h0dHA6Ly9wdXJsLm9ib2xpYnJhcnkub3JnL29iby9VQkVST05fMDAwMjA5Nyc7XG4gICAgICAgIGNvbnN0IHNjZW5lTm9kZSA9IHRoaXMuZ2V0U2NlbmVOb2RlKG9yZ2FuLCBib2R5LCB7XG4gICAgICAgICAgY29sb3I6IFsyNTUsIDI1NSwgMjU1LCAyNTVdLCBvcGFjaXR5OiBpc1NraW4gPyAwLjUgOiAwLjIsIHVucGlja2FibGU6IHRydWUsIF9saWdodGluZzogJ3BicicsIHpvb21CYXNlZE9wYWNpdHk6ICFpc1NraW5cbiAgICAgICAgfSk7XG4gICAgICAgIGlmIChpc1NraW4gJiYgc2NlbmVOb2RlKSB7XG4gICAgICAgICAgc2tpbk5vZGVzLnB1c2goc2NlbmVOb2RlKTtcbiAgICAgICAgICByZXR1cm4gdW5kZWZpbmVkO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIHJldHVybiBzY2VuZU5vZGU7XG4gICAgICAgIH1cbiAgICAgIH0pXG4gICAgXTtcbiAgICBpZiAoc2tpbk5vZGVzLmxlbmd0aCA+IDApIHtcbiAgICAgIG5vZGVzID0gWy4uLnNraW5Ob2RlcywgLi4ubm9kZXNdO1xuICAgIH1cblxuICAgIGlmIChmaWx0ZXI/LmRlYnVnKSB7XG4gICAgICAvLyBEZWJ1ZyBib3VuZGluZyBib3hlc1xuICAgICAgbm9kZXMgPSBub2Rlcy5jb25jYXQoW1xuICAgICAgICB0aGlzLmdldFNjZW5lTm9kZSh0aGlzLmdldFNwYXRpYWxFbnRpdHkoY2NmLmJhc2UoJ1ZIUmlnaHRLaWRuZXknKS5pZCksIGJvZHksIHsgY29sb3I6IFswLCAwLCAyNTUsIDAuNSoyNTVdLCBnZW9tZXRyeTogJ3dpcmVmcmFtZScgfSksXG4gICAgICAgIHRoaXMuZ2V0U2NlbmVOb2RlKHRoaXMuZ2V0U3BhdGlhbEVudGl0eShjY2YuYmFzZSgnVkhMZWZ0S2lkbmV5JykuaWQpLCBib2R5LCB7IGNvbG9yOiBbMjU1LCAwLCAwLCAwLjUqMjU1XSwgZ2VvbWV0cnk6ICd3aXJlZnJhbWUnIH0pLFxuICAgICAgICB0aGlzLmdldFNjZW5lTm9kZSh0aGlzLmdldFNwYXRpYWxFbnRpdHkoY2NmLmJhc2UoJ1ZIU3BsZWVuQ0MxJykuaWQpLCBib2R5LCB7IGNvbG9yOiBbMCwgMjU1LCAwLCAwLjUqMjU1XSwgZ2VvbWV0cnk6ICd3aXJlZnJhbWUnIH0pLFxuICAgICAgICB0aGlzLmdldFNjZW5lTm9kZSh0aGlzLmdldFNwYXRpYWxFbnRpdHkoY2NmLmJhc2UoJ1ZIU3BsZWVuQ0MyJykuaWQpLCBib2R5LCB7IGNvbG9yOiBbMCwgMjU1LCAwLCAwLjUqMjU1XSwgZ2VvbWV0cnk6ICd3aXJlZnJhbWUnIH0pLFxuICAgICAgICB0aGlzLmdldFNjZW5lTm9kZSh0aGlzLmdldFNwYXRpYWxFbnRpdHkoY2NmLmJhc2UoJ1ZIU3BsZWVuQ0MzJykuaWQpLCBib2R5LCB7IGNvbG9yOiBbMCwgMjU1LCAwLCAwLjUqMjU1XSwgZ2VvbWV0cnk6ICd3aXJlZnJhbWUnIH0pXG4gICAgICBdKTtcbiAgICB9XG5cbiAgICByZXR1cm4gbm9kZXMuZmlsdGVyKHMgPT4gcyAhPT0gdW5kZWZpbmVkKSBhcyBTcGF0aWFsU2NlbmVOb2RlW107XG4gIH1cblxuICBnZXRSZWZlcmVuY2VPcmdhblNjZW5lKG9yZ2FuSXJpOiBzdHJpbmcsIGZpbHRlcj86IEZpbHRlcik6IFNwYXRpYWxTY2VuZU5vZGVbXSB7XG4gICAgY29uc3QgaGFzU2V4RmlsdGVyID0gZmlsdGVyPy5zZXggIT09IHVuZGVmaW5lZCAmJiBmaWx0ZXI/LnNleD8udG9Mb3dlckNhc2UoKSAhPT0gJ2JvdGgnO1xuICAgIGNvbnN0IG9yZ2FucyA9IHRoaXMuZ2V0UmVmZXJlbmNlT3JnYW5zKCkuZmlsdGVyKChvKSA9PiBvLnJlcHJlc2VudGF0aW9uX29mID09PSBvcmdhbklyaSAmJiAoIWhhc1NleEZpbHRlciB8fCBvLnNleCA9PT0gZmlsdGVyPy5zZXgpKTtcbiAgICBpZiAob3JnYW5zLmxlbmd0aCA+IDApIHtcbiAgICAgIGNvbnN0IG9yZ2FuID0gb3JnYW5zWzBdO1xuICAgICAgY29uc3QgaXNTa2luID0gb3JnYW4ucmVwcmVzZW50YXRpb25fb2YgPT09ICdodHRwOi8vcHVybC5vYm9saWJyYXJ5Lm9yZy9vYm8vVUJFUk9OXzAwMDIwOTcnO1xuICAgICAgY29uc3Qgb3JnYW5Ob2RlID0gdGhpcy5nZXRTY2VuZU5vZGUob3JnYW4sIG9yZ2FuLCB7XG4gICAgICAgIGNvbG9yOiBbMjU1LCAyNTUsIDI1NSwgMjU1XSwgb3BhY2l0eTogaXNTa2luID8gMC41IDogMC4yLCB1bnBpY2thYmxlOiB0cnVlLCBfbGlnaHRpbmc6ICdwYnInXG4gICAgICB9KSBhcyBTcGF0aWFsU2NlbmVOb2RlO1xuXG4gICAgICBjb25zdCBzY2VuZSA9ICh0aGlzLmRiLmdldFNwYXRpYWxFbnRpdGllcyhmaWx0ZXIpID8/IFtdKS5tYXAoKGVudGl0eSkgPT5cbiAgICAgICAgdGhpcy5nZXRTY2VuZU5vZGUoZW50aXR5LCBvcmdhbiwgeyBjb2xvcjogWzI1NSwgMjU1LCAyNTUsIDAuOSoyNTVdIH0pXG4gICAgICApIGFzIFNwYXRpYWxTY2VuZU5vZGVbXTtcbiAgICAgIHJldHVybiBbb3JnYW5Ob2RlXS5jb25jYXQoc2NlbmUpLmZpbHRlcihuID0+IG4gIT09IHVuZGVmaW5lZCk7XG4gICAgfSBlbHNlIHtcbiAgICAgIHJldHVybiBbXTtcbiAgICB9XG4gIH1cblxuICBnZXRFbnRpdHlTY2VuZU5vZGVzKGZpbHRlcj86IEZpbHRlcik6IFNwYXRpYWxTY2VuZU5vZGVbXSB7XG4gICAgY29uc3QgYm9keSA9IHRoaXMuZ2V0UmVmZXJlbmNlQm9keShmaWx0ZXIpO1xuICAgIHJldHVybiB0aGlzLmRiLmdldFNwYXRpYWxFbnRpdGllcyhmaWx0ZXIpLm1hcCgoZW50aXR5KSA9PlxuICAgICAgdGhpcy5nZXRTY2VuZU5vZGUoZW50aXR5LCBib2R5LCB7IGNvbG9yOiBbMjU1LCAyNTUsIDI1NSwgMC45KjI1NV0gfSlcbiAgICApLmZpbHRlcihzID0+IHMgIT09IHVuZGVmaW5lZCkgYXMgU3BhdGlhbFNjZW5lTm9kZVtdO1xuICB9XG5cbiAgZ2V0U2NlbmVOb2RlKHNvdXJjZTogU3BhdGlhbEVudGl0eSwgdGFyZ2V0OiBTcGF0aWFsRW50aXR5LCBub2RlQXR0cnM6IFBhcnRpYWw8U3BhdGlhbFNjZW5lTm9kZT4gPSB7fSk6IFNwYXRpYWxTY2VuZU5vZGUgfCB1bmRlZmluZWQge1xuICAgIGNvbnN0IGhhczNkT2JqZWN0ID0gc291cmNlPy5vYmplY3Q/LmZpbGVfZm9ybWF0Py5zdGFydHNXaXRoKCdtb2RlbC9nbHRmJyk7XG4gICAgY29uc3Qgc291cmNlSUQgPSBoYXMzZE9iamVjdCAmJiBzb3VyY2Uub2JqZWN0ID8gc291cmNlLm9iamVjdFsnQGlkJ10gOiBzb3VyY2VbJ0BpZCddO1xuICAgIGxldCB0cmFuc2Zvcm0gPSB0aGlzLmRiLmdyYXBoLmdldFRyYW5zZm9ybWF0aW9uTWF0cml4KHNvdXJjZUlELCB0YXJnZXRbJ0BpZCddKTtcbiAgICBpZiAodHJhbnNmb3JtKSB7XG4gICAgICBpZiAoaGFzM2RPYmplY3QpIHtcbiAgICAgICAgdHJhbnNmb3JtID0gbmV3IE1hdHJpeDQoTWF0cml4NC5JREVOVElUWSkucm90YXRlWCh0b1JhZGlhbnMoOTApKS5tdWx0aXBseUxlZnQodHJhbnNmb3JtKTtcbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIC8vIFNjYWxlIHZpc2libGUgYm91bmRpbmcgYm94ZXMgdG8gdGhlIGRlc2lyZWQgZGltZW5zaW9uc1xuICAgICAgICBsZXQgZmFjdG9yOiBudW1iZXI7XG4gICAgICAgIHN3aXRjaCAoc291cmNlLmRpbWVuc2lvbl91bml0cykge1xuICAgICAgICAgIGNhc2UgJ2NlbnRpbWV0ZXInOlxuICAgICAgICAgICAgZmFjdG9yID0gMSAvIDEwMDtcbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgIGNhc2UgJ21pbGxpbWV0ZXInOlxuICAgICAgICAgICAgZmFjdG9yID0gMSAvIDEwMDA7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgICBjYXNlICdtZXRlcic6XG4gICAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICAgIGZhY3RvciA9IDE7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgfVxuICAgICAgICBjb25zdCBzY2FsZSA9IFtzb3VyY2UueF9kaW1lbnNpb24sIHNvdXJjZS55X2RpbWVuc2lvbiwgc291cmNlLnpfZGltZW5zaW9uXS5tYXAoZGltID0+IGRpbSAqIGZhY3RvciAvIDIpO1xuICAgICAgICB0cmFuc2Zvcm0uc2NhbGUoc2NhbGUpO1xuICAgICAgfVxuICAgICAgcmV0dXJuIHtcbiAgICAgICAgJ0BpZCc6IHNvdXJjZVsnQGlkJ10sICdAdHlwZSc6ICdTcGF0aWFsU2NlbmVOb2RlJyxcbiAgICAgICAgZW50aXR5SWQ6IHNvdXJjZS5lbnRpdHlJZCxcbiAgICAgICAgY2NmX2Fubm90YXRpb25zOiBzb3VyY2UuY2NmX2Fubm90YXRpb25zLFxuICAgICAgICByZXByZXNlbnRhdGlvbl9vZjogc291cmNlLnJlcHJlc2VudGF0aW9uX29mLFxuICAgICAgICByZWZlcmVuY2Vfb3JnYW46IHNvdXJjZS5yZWZlcmVuY2Vfb3JnYW4sXG4gICAgICAgIHNjZW5lZ3JhcGg6IGhhczNkT2JqZWN0ID8gc291cmNlLm9iamVjdD8uZmlsZSA6IHVuZGVmaW5lZCxcbiAgICAgICAgc2NlbmVncmFwaE5vZGU6IGhhczNkT2JqZWN0ID8gc291cmNlLm9iamVjdD8uZmlsZV9zdWJwYXRoIDogdW5kZWZpbmVkLFxuICAgICAgICB0cmFuc2Zvcm1NYXRyaXg6IHRyYW5zZm9ybSxcbiAgICAgICAgdG9vbHRpcDogc291cmNlLmxhYmVsLFxuICAgICAgICAuLi5ub2RlQXR0cnNcbiAgICAgIH07XG4gICAgfSBlbHNlIHtcbiAgICAgIHJldHVybiB1bmRlZmluZWQ7XG4gICAgfVxuICB9XG5cbiAgZ2V0U2NlbmUoZmlsdGVyPzogRmlsdGVyKTogU3BhdGlhbFNjZW5lTm9kZVtdIHtcbiAgICByZXR1cm4gW1xuICAgICAgLi4udGhpcy5nZXRSZWZlcmVuY2VTY2VuZU5vZGVzKGZpbHRlciksXG4gICAgICAuLi50aGlzLmdldEVudGl0eVNjZW5lTm9kZXMoZmlsdGVyKVxuICAgIF07XG4gIH1cbn1cbiJdfQ== \ No newline at end of file diff --git a/ccf-database/esm2015/lib/hubmap/hubmap-data-import.js b/ccf-database/esm2015/lib/hubmap/hubmap-data-import.js deleted file mode 100644 index f5edac8a3..000000000 --- a/ccf-database/esm2015/lib/hubmap/hubmap-data-import.js +++ /dev/null @@ -1,146 +0,0 @@ -import { __awaiter } from "tslib"; -import { addJsonLdToStore } from 'triple-store-utils'; -import { hubmapResponseAsJsonLd } from './hubmap-data'; -// Reduce this value if including more data fields -const PER_API_SEARCH_REQUEST_COUNT = 250; -const INCLUDED_DATA_FIELDS = [ - 'uuid', 'entity_type', - 'group_uuid', 'group_name', - 'last_modified_timestamp', 'created_by_user_displayname', - 'ancestors.entity_type', - 'ancestors.description', - 'ancestors.metadata.organ_donor_data.preferred_term', - 'ancestors.metadata.organ_donor_data.data_value', - 'ancestors.metadata.living_donor_data.preferred_term', - 'ancestors.metadata.living_donor_data.data_value', - 'ancestors.last_modified_timestamp', - 'ancestors.group_uuid', - 'ancestors.group_name', - 'ancestors.created_by_user_displayname', - 'ancestors.uuid', - 'descendants.entity_type', - 'descendants.ingest_metadata.metadata.tissue_id', - 'descendants.last_modified_timestamp', - 'descendants.group_uuid', - 'descendants.group_name', - 'descendants.created_by_user_displayname', - 'descendants.uuid', - 'descendants.data_types', - 'descendants.ingest_metadata.metadata.assay_type', - 'descendants.thumbnail_file', - 'descendants.metadata.files.rel_path', - 'rui_location', 'specimen_type' -]; -const DEFAULT_API_SEARCH_QUERY = { - exists: { - field: 'rui_location' - } -}; -function getApiSearchHeaders(token) { - const headers = new Headers(); - headers.append('Content-type', 'application/json'); - if (token) { - headers.append('Authorization', `Bearer ${token}`); - } - return headers; -} -function getApiSearchBody(from, size, query) { - const bodyObj = { - version: true, - from, - size, - stored_fields: ['*'], - script_fields: {}, - docvalue_fields: [], - query: query !== null && query !== void 0 ? query : DEFAULT_API_SEARCH_QUERY, - _source: { - includes: INCLUDED_DATA_FIELDS - } - }; - return JSON.stringify(bodyObj); -} -function doSearchRequest(url, init) { - return __awaiter(this, void 0, void 0, function* () { - try { - const res = yield fetch(url, init); - return res.ok ? (yield res.json()) : undefined; - } - catch (_error) { - return undefined; - } - }); -} -function doApiSearch(url, token, query) { - return __awaiter(this, void 0, void 0, function* () { - const perReqCount = PER_API_SEARCH_REQUEST_COUNT; - const headers = getApiSearchHeaders(token); - const body = getApiSearchBody(0, perReqCount, query); - const firstResult = yield doSearchRequest(url, { method: 'POST', headers, body }); - if (!firstResult) { - return undefined; - } - const totalCount = firstResult.hits.total.value; - if (totalCount <= perReqCount) { - return firstResult; - } - const requests = []; - for (let from = perReqCount; from < totalCount; from += perReqCount) { - requests.push(doSearchRequest(url, { - method: 'POST', - headers, - body: getApiSearchBody(from, perReqCount, query) - })); - } - const results = yield Promise.all(requests); - if (results.some(res => !res)) { - return undefined; - } - const items = results.map(res => res.hits.hits); - return Object.assign(Object.assign({}, firstResult), { hits: Object.assign(Object.assign({}, firstResult.hits), { hits: firstResult.hits.hits.concat(...items) }) }); - }); -} -/** - * Search the HuBMAP Search API and return CCF-compatible JSON-LD data - * - * @param dataUrl the search API url - * @param serviceType 'static' if a statically saved response or 'search-api' if querying the search-api live - * @param query the elastic search query to use - * @param serviceToken the api key to the search-api - * @param assetsApi the assets api endpoint - * @param portalUrl the portal url to point to - * @returns CCF-compatible JSON-LD data or undefined on error - */ -export function searchHubmap(dataUrl, serviceType, query, serviceToken, assetsApi = '', portalUrl = '') { - return __awaiter(this, void 0, void 0, function* () { - let hubmapData; - if (serviceType === 'static') { - hubmapData = yield doSearchRequest(dataUrl); - } - else if (serviceType === 'search-api') { - hubmapData = yield doApiSearch(dataUrl, serviceToken, query); - } - if (hubmapData) { - return hubmapResponseAsJsonLd(hubmapData, assetsApi, portalUrl, serviceToken); - } - else { - console.warn(`Unable to load ${dataUrl} as HuBMAP Data`); - return undefined; - } - }); -} -/** - * Adds hubmap data from a url to the triple store. - * - * @param store The triple store. - * @param dataUrl The data url. - * @param serviceType The service type. - */ -export function addHubmapDataToStore(store, dataUrl, serviceType, serviceToken, assetsApi = '', portalUrl = '') { - return __awaiter(this, void 0, void 0, function* () { - const hubmapData = yield searchHubmap(dataUrl, serviceType, undefined, serviceToken, assetsApi, portalUrl); - if (hubmapData) { - yield addJsonLdToStore(hubmapData, store); - } - }); -} -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaHVibWFwLWRhdGEtaW1wb3J0LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvY2NmLWRhdGFiYXNlL3NyYy9saWIvaHVibWFwL2h1Ym1hcC1kYXRhLWltcG9ydC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBRUEsT0FBTyxFQUFFLGdCQUFnQixFQUFTLE1BQU0sb0JBQW9CLENBQUM7QUFFN0QsT0FBTyxFQUFFLHNCQUFzQixFQUFFLE1BQU0sZUFBZSxDQUFDO0FBYXZELGtEQUFrRDtBQUNsRCxNQUFNLDRCQUE0QixHQUFHLEdBQUcsQ0FBQztBQUV6QyxNQUFNLG9CQUFvQixHQUFHO0lBQzNCLE1BQU0sRUFBRSxhQUFhO0lBQ3JCLFlBQVksRUFBRSxZQUFZO0lBQzFCLHlCQUF5QixFQUFFLDZCQUE2QjtJQUN4RCx1QkFBdUI7SUFDdkIsdUJBQXVCO0lBQ3ZCLG9EQUFvRDtJQUNwRCxnREFBZ0Q7SUFDaEQscURBQXFEO0lBQ3JELGlEQUFpRDtJQUNqRCxtQ0FBbUM7SUFDbkMsc0JBQXNCO0lBQ3RCLHNCQUFzQjtJQUN0Qix1Q0FBdUM7SUFDdkMsZ0JBQWdCO0lBQ2hCLHlCQUF5QjtJQUN6QixnREFBZ0Q7SUFDaEQscUNBQXFDO0lBQ3JDLHdCQUF3QjtJQUN4Qix3QkFBd0I7SUFDeEIseUNBQXlDO0lBQ3pDLGtCQUFrQjtJQUNsQix3QkFBd0I7SUFDeEIsaURBQWlEO0lBQ2pELDRCQUE0QjtJQUM1QixxQ0FBcUM7SUFDckMsY0FBYyxFQUFFLGVBQWU7Q0FDaEMsQ0FBQztBQUVGLE1BQU0sd0JBQXdCLEdBQVk7SUFDeEMsTUFBTSxFQUFFO1FBQ04sS0FBSyxFQUFFLGNBQWM7S0FDdEI7Q0FDRixDQUFDO0FBRUYsU0FBUyxtQkFBbUIsQ0FBQyxLQUFjO0lBQ3pDLE1BQU0sT0FBTyxHQUFHLElBQUksT0FBTyxFQUFFLENBQUM7SUFFOUIsT0FBTyxDQUFDLE1BQU0sQ0FBQyxjQUFjLEVBQUUsa0JBQWtCLENBQUMsQ0FBQztJQUNuRCxJQUFJLEtBQUssRUFBRTtRQUNULE9BQU8sQ0FBQyxNQUFNLENBQUMsZUFBZSxFQUFFLFVBQVUsS0FBSyxFQUFFLENBQUMsQ0FBQztLQUNwRDtJQUVELE9BQU8sT0FBTyxDQUFDO0FBQ2pCLENBQUM7QUFFRCxTQUFTLGdCQUFnQixDQUFDLElBQVksRUFBRSxJQUFZLEVBQUUsS0FBZTtJQUNuRSxNQUFNLE9BQU8sR0FBRztRQUNkLE9BQU8sRUFBRSxJQUFJO1FBQ2IsSUFBSTtRQUNKLElBQUk7UUFDSixhQUFhLEVBQUUsQ0FBQyxHQUFHLENBQUM7UUFDcEIsYUFBYSxFQUFFLEVBQUU7UUFDakIsZUFBZSxFQUFFLEVBQUU7UUFDbkIsS0FBSyxFQUFFLEtBQUssYUFBTCxLQUFLLGNBQUwsS0FBSyxHQUFJLHdCQUF3QjtRQUN4QyxPQUFPLEVBQUU7WUFDUCxRQUFRLEVBQUUsb0JBQW9CO1NBQy9CO0tBQ0YsQ0FBQztJQUVGLE9BQU8sSUFBSSxDQUFDLFNBQVMsQ0FBQyxPQUFPLENBQUMsQ0FBQztBQUNqQyxDQUFDO0FBRUQsU0FBZSxlQUFlLENBQzVCLEdBQVcsRUFBRSxJQUFrQjs7UUFFL0IsSUFBSTtZQUNGLE1BQU0sR0FBRyxHQUFHLE1BQU0sS0FBSyxDQUFDLEdBQUcsRUFBRSxJQUFJLENBQUMsQ0FBQztZQUNuQyxPQUFPLEdBQUcsQ0FBQyxFQUFFLENBQUMsQ0FBQyxDQUFDLENBQUMsTUFBTSxHQUFHLENBQUMsSUFBSSxFQUFFLENBQUMsQ0FBQyxDQUFDLENBQUMsU0FBUyxDQUFDO1NBQ2hEO1FBQUMsT0FBTyxNQUFNLEVBQUU7WUFDZixPQUFPLFNBQVMsQ0FBQztTQUNsQjtJQUNILENBQUM7Q0FBQTtBQUVELFNBQWUsV0FBVyxDQUN4QixHQUFXLEVBQUUsS0FBYyxFQUFFLEtBQWU7O1FBRTVDLE1BQU0sV0FBVyxHQUFHLDRCQUE0QixDQUFDO1FBQ2pELE1BQU0sT0FBTyxHQUFHLG1CQUFtQixDQUFDLEtBQUssQ0FBQyxDQUFDO1FBQzNDLE1BQU0sSUFBSSxHQUFHLGdCQUFnQixDQUFDLENBQUMsRUFBRSxXQUFXLEVBQUUsS0FBSyxDQUFDLENBQUM7UUFDckQsTUFBTSxXQUFXLEdBQUcsTUFBTSxlQUFlLENBQUMsR0FBRyxFQUFFLEVBQUUsTUFBTSxFQUFFLE1BQU0sRUFBRSxPQUFPLEVBQUUsSUFBSSxFQUFFLENBQUMsQ0FBQztRQUNsRixJQUFJLENBQUMsV0FBVyxFQUFFO1lBQ2hCLE9BQU8sU0FBUyxDQUFDO1NBQ2xCO1FBRUQsTUFBTSxVQUFVLEdBQUcsV0FBVyxDQUFDLElBQUksQ0FBQyxLQUFLLENBQUMsS0FBSyxDQUFDO1FBQ2hELElBQUksVUFBVSxJQUFJLFdBQVcsRUFBRTtZQUM3QixPQUFPLFdBQVcsQ0FBQztTQUNwQjtRQUVELE1BQU0sUUFBUSxHQUE0QyxFQUFFLENBQUM7UUFDN0QsS0FBSyxJQUFJLElBQUksR0FBRyxXQUFXLEVBQUUsSUFBSSxHQUFHLFVBQVUsRUFBRSxJQUFJLElBQUksV0FBVyxFQUFFO1lBQ25FLFFBQVEsQ0FBQyxJQUFJLENBQUMsZUFBZSxDQUFDLEdBQUcsRUFBRTtnQkFDakMsTUFBTSxFQUFFLE1BQU07Z0JBQ2QsT0FBTztnQkFDUCxJQUFJLEVBQUUsZ0JBQWdCLENBQUMsSUFBSSxFQUFFLFdBQVcsRUFBRSxLQUFLLENBQUM7YUFDakQsQ0FBQyxDQUFDLENBQUM7U0FDTDtRQUVELE1BQU0sT0FBTyxHQUFHLE1BQU0sT0FBTyxDQUFDLEdBQUcsQ0FBQyxRQUFRLENBQUMsQ0FBQztRQUM1QyxJQUFJLE9BQU8sQ0FBQyxJQUFJLENBQUMsR0FBRyxDQUFDLEVBQUUsQ0FBQyxDQUFDLEdBQUcsQ0FBQyxFQUFFO1lBQzdCLE9BQU8sU0FBUyxDQUFDO1NBQ2xCO1FBRUQsTUFBTSxLQUFLLEdBQUcsT0FBTyxDQUFDLEdBQUcsQ0FBQyxHQUFHLENBQUMsRUFBRSxDQUFDLEdBQUksQ0FBQyxJQUFJLENBQUMsSUFBSSxDQUFDLENBQUM7UUFDakQsdUNBQ0ssV0FBVyxLQUNkLElBQUksa0NBQ0MsV0FBVyxDQUFDLElBQUksS0FDbkIsSUFBSSxFQUFFLFdBQVcsQ0FBQyxJQUFJLENBQUMsSUFBSSxDQUFDLE1BQU0sQ0FBQyxHQUFHLEtBQUssQ0FBQyxPQUU5QztJQUNKLENBQUM7Q0FBQTtBQUVEOzs7Ozs7Ozs7O0dBVUc7QUFDSCxNQUFNLFVBQWdCLFlBQVksQ0FDaEMsT0FBZSxFQUFFLFdBQW9DLEVBQ3JELEtBQWUsRUFBRSxZQUFxQixFQUFFLFNBQVMsR0FBRyxFQUFFLEVBQUUsU0FBUyxHQUFHLEVBQUU7O1FBRXRFLElBQUksVUFBd0MsQ0FBQztRQUM3QyxJQUFJLFdBQVcsS0FBSyxRQUFRLEVBQUU7WUFDNUIsVUFBVSxHQUFHLE1BQU0sZUFBZSxDQUFDLE9BQU8sQ0FBQyxDQUFDO1NBQzdDO2FBQU0sSUFBSSxXQUFXLEtBQUssWUFBWSxFQUFFO1lBQ3ZDLFVBQVUsR0FBRyxNQUFNLFdBQVcsQ0FBQyxPQUFPLEVBQUUsWUFBWSxFQUFFLEtBQUssQ0FBQyxDQUFDO1NBQzlEO1FBRUQsSUFBSSxVQUFVLEVBQUU7WUFDZCxPQUFPLHNCQUFzQixDQUFDLFVBQVUsRUFBRSxTQUFTLEVBQUUsU0FBUyxFQUFFLFlBQVksQ0FBQyxDQUFDO1NBQy9FO2FBQU07WUFDTCxPQUFPLENBQUMsSUFBSSxDQUFDLGtCQUFrQixPQUFPLGlCQUFpQixDQUFDLENBQUM7WUFDekQsT0FBTyxTQUFTLENBQUM7U0FDbEI7SUFDSCxDQUFDO0NBQUE7QUFFRDs7Ozs7O0dBTUc7QUFDSCxNQUFNLFVBQWdCLG9CQUFvQixDQUN4QyxLQUFZLEVBQUUsT0FBZSxFQUFFLFdBQW9DLEVBQUUsWUFBcUIsRUFBRSxTQUFTLEdBQUcsRUFBRSxFQUFFLFNBQVMsR0FBRyxFQUFFOztRQUUxSCxNQUFNLFVBQVUsR0FBRyxNQUFNLFlBQVksQ0FBQyxPQUFPLEVBQUUsV0FBVyxFQUFFLFNBQVMsRUFBRSxZQUFZLEVBQUUsU0FBUyxFQUFFLFNBQVMsQ0FBQyxDQUFDO1FBQzNHLElBQUksVUFBVSxFQUFFO1lBQ2QsTUFBTSxnQkFBZ0IsQ0FBQyxVQUFVLEVBQUUsS0FBSyxDQUFDLENBQUM7U0FDM0M7SUFDSCxDQUFDO0NBQUEiLCJzb3VyY2VzQ29udGVudCI6WyIvKiBlc2xpbnQtZGlzYWJsZSBAdHlwZXNjcmlwdC1lc2xpbnQvbmFtaW5nLWNvbnZlbnRpb24gKi9cbmltcG9ydCB7IEpzb25MZCB9IGZyb20gJ2pzb25sZC9qc29ubGQtc3BlYyc7XG5pbXBvcnQgeyBhZGRKc29uTGRUb1N0b3JlLCBTdG9yZSB9IGZyb20gJ3RyaXBsZS1zdG9yZS11dGlscyc7XG5cbmltcG9ydCB7IGh1Ym1hcFJlc3BvbnNlQXNKc29uTGQgfSBmcm9tICcuL2h1Ym1hcC1kYXRhJztcblxuXG5pbnRlcmZhY2UgU2VhcmNoUmVzdWx0SnNvbiB7XG4gIGhpdHM6IHtcbiAgICBoaXRzOiB1bmtub3duW107XG4gICAgdG90YWw6IHtcbiAgICAgIHZhbHVlOiBudW1iZXI7XG4gICAgfTtcbiAgfTtcbn1cblxuXG4vLyBSZWR1Y2UgdGhpcyB2YWx1ZSBpZiBpbmNsdWRpbmcgbW9yZSBkYXRhIGZpZWxkc1xuY29uc3QgUEVSX0FQSV9TRUFSQ0hfUkVRVUVTVF9DT1VOVCA9IDI1MDtcblxuY29uc3QgSU5DTFVERURfREFUQV9GSUVMRFMgPSBbXG4gICd1dWlkJywgJ2VudGl0eV90eXBlJyxcbiAgJ2dyb3VwX3V1aWQnLCAnZ3JvdXBfbmFtZScsXG4gICdsYXN0X21vZGlmaWVkX3RpbWVzdGFtcCcsICdjcmVhdGVkX2J5X3VzZXJfZGlzcGxheW5hbWUnLFxuICAnYW5jZXN0b3JzLmVudGl0eV90eXBlJyxcbiAgJ2FuY2VzdG9ycy5kZXNjcmlwdGlvbicsXG4gICdhbmNlc3RvcnMubWV0YWRhdGEub3JnYW5fZG9ub3JfZGF0YS5wcmVmZXJyZWRfdGVybScsXG4gICdhbmNlc3RvcnMubWV0YWRhdGEub3JnYW5fZG9ub3JfZGF0YS5kYXRhX3ZhbHVlJyxcbiAgJ2FuY2VzdG9ycy5tZXRhZGF0YS5saXZpbmdfZG9ub3JfZGF0YS5wcmVmZXJyZWRfdGVybScsXG4gICdhbmNlc3RvcnMubWV0YWRhdGEubGl2aW5nX2Rvbm9yX2RhdGEuZGF0YV92YWx1ZScsXG4gICdhbmNlc3RvcnMubGFzdF9tb2RpZmllZF90aW1lc3RhbXAnLFxuICAnYW5jZXN0b3JzLmdyb3VwX3V1aWQnLFxuICAnYW5jZXN0b3JzLmdyb3VwX25hbWUnLFxuICAnYW5jZXN0b3JzLmNyZWF0ZWRfYnlfdXNlcl9kaXNwbGF5bmFtZScsXG4gICdhbmNlc3RvcnMudXVpZCcsXG4gICdkZXNjZW5kYW50cy5lbnRpdHlfdHlwZScsXG4gICdkZXNjZW5kYW50cy5pbmdlc3RfbWV0YWRhdGEubWV0YWRhdGEudGlzc3VlX2lkJyxcbiAgJ2Rlc2NlbmRhbnRzLmxhc3RfbW9kaWZpZWRfdGltZXN0YW1wJyxcbiAgJ2Rlc2NlbmRhbnRzLmdyb3VwX3V1aWQnLFxuICAnZGVzY2VuZGFudHMuZ3JvdXBfbmFtZScsXG4gICdkZXNjZW5kYW50cy5jcmVhdGVkX2J5X3VzZXJfZGlzcGxheW5hbWUnLFxuICAnZGVzY2VuZGFudHMudXVpZCcsXG4gICdkZXNjZW5kYW50cy5kYXRhX3R5cGVzJyxcbiAgJ2Rlc2NlbmRhbnRzLmluZ2VzdF9tZXRhZGF0YS5tZXRhZGF0YS5hc3NheV90eXBlJyxcbiAgJ2Rlc2NlbmRhbnRzLnRodW1ibmFpbF9maWxlJyxcbiAgJ2Rlc2NlbmRhbnRzLm1ldGFkYXRhLmZpbGVzLnJlbF9wYXRoJyxcbiAgJ3J1aV9sb2NhdGlvbicsICdzcGVjaW1lbl90eXBlJ1xuXTtcblxuY29uc3QgREVGQVVMVF9BUElfU0VBUkNIX1FVRVJZOiB1bmtub3duID0ge1xuICBleGlzdHM6IHtcbiAgICBmaWVsZDogJ3J1aV9sb2NhdGlvbidcbiAgfVxufTtcblxuZnVuY3Rpb24gZ2V0QXBpU2VhcmNoSGVhZGVycyh0b2tlbj86IHN0cmluZyk6IEhlYWRlcnMge1xuICBjb25zdCBoZWFkZXJzID0gbmV3IEhlYWRlcnMoKTtcblxuICBoZWFkZXJzLmFwcGVuZCgnQ29udGVudC10eXBlJywgJ2FwcGxpY2F0aW9uL2pzb24nKTtcbiAgaWYgKHRva2VuKSB7XG4gICAgaGVhZGVycy5hcHBlbmQoJ0F1dGhvcml6YXRpb24nLCBgQmVhcmVyICR7dG9rZW59YCk7XG4gIH1cblxuICByZXR1cm4gaGVhZGVycztcbn1cblxuZnVuY3Rpb24gZ2V0QXBpU2VhcmNoQm9keShmcm9tOiBudW1iZXIsIHNpemU6IG51bWJlciwgcXVlcnk/OiB1bmtub3duKTogc3RyaW5nIHtcbiAgY29uc3QgYm9keU9iaiA9IHtcbiAgICB2ZXJzaW9uOiB0cnVlLFxuICAgIGZyb20sXG4gICAgc2l6ZSxcbiAgICBzdG9yZWRfZmllbGRzOiBbJyonXSxcbiAgICBzY3JpcHRfZmllbGRzOiB7fSxcbiAgICBkb2N2YWx1ZV9maWVsZHM6IFtdLFxuICAgIHF1ZXJ5OiBxdWVyeSA/PyBERUZBVUxUX0FQSV9TRUFSQ0hfUVVFUlksXG4gICAgX3NvdXJjZToge1xuICAgICAgaW5jbHVkZXM6IElOQ0xVREVEX0RBVEFfRklFTERTXG4gICAgfVxuICB9O1xuXG4gIHJldHVybiBKU09OLnN0cmluZ2lmeShib2R5T2JqKTtcbn1cblxuYXN5bmMgZnVuY3Rpb24gZG9TZWFyY2hSZXF1ZXN0KFxuICB1cmw6IHN0cmluZywgaW5pdD86IFJlcXVlc3RJbml0XG4pOiBQcm9taXNlPFNlYXJjaFJlc3VsdEpzb24gfCB1bmRlZmluZWQ+IHtcbiAgdHJ5IHtcbiAgICBjb25zdCByZXMgPSBhd2FpdCBmZXRjaCh1cmwsIGluaXQpO1xuICAgIHJldHVybiByZXMub2sgPyAoYXdhaXQgcmVzLmpzb24oKSkgOiB1bmRlZmluZWQ7XG4gIH0gY2F0Y2ggKF9lcnJvcikge1xuICAgIHJldHVybiB1bmRlZmluZWQ7XG4gIH1cbn1cblxuYXN5bmMgZnVuY3Rpb24gZG9BcGlTZWFyY2goXG4gIHVybDogc3RyaW5nLCB0b2tlbj86IHN0cmluZywgcXVlcnk/OiB1bmtub3duXG4pOiBQcm9taXNlPFNlYXJjaFJlc3VsdEpzb24gfCB1bmRlZmluZWQ+IHtcbiAgY29uc3QgcGVyUmVxQ291bnQgPSBQRVJfQVBJX1NFQVJDSF9SRVFVRVNUX0NPVU5UO1xuICBjb25zdCBoZWFkZXJzID0gZ2V0QXBpU2VhcmNoSGVhZGVycyh0b2tlbik7XG4gIGNvbnN0IGJvZHkgPSBnZXRBcGlTZWFyY2hCb2R5KDAsIHBlclJlcUNvdW50LCBxdWVyeSk7XG4gIGNvbnN0IGZpcnN0UmVzdWx0ID0gYXdhaXQgZG9TZWFyY2hSZXF1ZXN0KHVybCwgeyBtZXRob2Q6ICdQT1NUJywgaGVhZGVycywgYm9keSB9KTtcbiAgaWYgKCFmaXJzdFJlc3VsdCkge1xuICAgIHJldHVybiB1bmRlZmluZWQ7XG4gIH1cblxuICBjb25zdCB0b3RhbENvdW50ID0gZmlyc3RSZXN1bHQuaGl0cy50b3RhbC52YWx1ZTtcbiAgaWYgKHRvdGFsQ291bnQgPD0gcGVyUmVxQ291bnQpIHtcbiAgICByZXR1cm4gZmlyc3RSZXN1bHQ7XG4gIH1cblxuICBjb25zdCByZXF1ZXN0czogUHJvbWlzZTxTZWFyY2hSZXN1bHRKc29uIHwgdW5kZWZpbmVkPltdID0gW107XG4gIGZvciAobGV0IGZyb20gPSBwZXJSZXFDb3VudDsgZnJvbSA8IHRvdGFsQ291bnQ7IGZyb20gKz0gcGVyUmVxQ291bnQpIHtcbiAgICByZXF1ZXN0cy5wdXNoKGRvU2VhcmNoUmVxdWVzdCh1cmwsIHtcbiAgICAgIG1ldGhvZDogJ1BPU1QnLFxuICAgICAgaGVhZGVycyxcbiAgICAgIGJvZHk6IGdldEFwaVNlYXJjaEJvZHkoZnJvbSwgcGVyUmVxQ291bnQsIHF1ZXJ5KVxuICAgIH0pKTtcbiAgfVxuXG4gIGNvbnN0IHJlc3VsdHMgPSBhd2FpdCBQcm9taXNlLmFsbChyZXF1ZXN0cyk7XG4gIGlmIChyZXN1bHRzLnNvbWUocmVzID0+ICFyZXMpKSB7XG4gICAgcmV0dXJuIHVuZGVmaW5lZDtcbiAgfVxuXG4gIGNvbnN0IGl0ZW1zID0gcmVzdWx0cy5tYXAocmVzID0+IHJlcyEuaGl0cy5oaXRzKTtcbiAgcmV0dXJuIHtcbiAgICAuLi5maXJzdFJlc3VsdCxcbiAgICBoaXRzOiB7XG4gICAgICAuLi5maXJzdFJlc3VsdC5oaXRzLFxuICAgICAgaGl0czogZmlyc3RSZXN1bHQuaGl0cy5oaXRzLmNvbmNhdCguLi5pdGVtcyksXG4gICAgfVxuICB9O1xufVxuXG4vKipcbiAqIFNlYXJjaCB0aGUgSHVCTUFQIFNlYXJjaCBBUEkgYW5kIHJldHVybiBDQ0YtY29tcGF0aWJsZSBKU09OLUxEIGRhdGFcbiAqXG4gKiBAcGFyYW0gZGF0YVVybCB0aGUgc2VhcmNoIEFQSSB1cmxcbiAqIEBwYXJhbSBzZXJ2aWNlVHlwZSAnc3RhdGljJyBpZiBhIHN0YXRpY2FsbHkgc2F2ZWQgcmVzcG9uc2Ugb3IgJ3NlYXJjaC1hcGknIGlmIHF1ZXJ5aW5nIHRoZSBzZWFyY2gtYXBpIGxpdmVcbiAqIEBwYXJhbSBxdWVyeSB0aGUgZWxhc3RpYyBzZWFyY2ggcXVlcnkgdG8gdXNlXG4gKiBAcGFyYW0gc2VydmljZVRva2VuIHRoZSBhcGkga2V5IHRvIHRoZSBzZWFyY2gtYXBpXG4gKiBAcGFyYW0gYXNzZXRzQXBpIHRoZSBhc3NldHMgYXBpIGVuZHBvaW50XG4gKiBAcGFyYW0gcG9ydGFsVXJsIHRoZSBwb3J0YWwgdXJsIHRvIHBvaW50IHRvXG4gKiBAcmV0dXJucyBDQ0YtY29tcGF0aWJsZSBKU09OLUxEIGRhdGEgb3IgdW5kZWZpbmVkIG9uIGVycm9yXG4gKi9cbmV4cG9ydCBhc3luYyBmdW5jdGlvbiBzZWFyY2hIdWJtYXAoXG4gIGRhdGFVcmw6IHN0cmluZywgc2VydmljZVR5cGU6ICdzdGF0aWMnIHwgJ3NlYXJjaC1hcGknLFxuICBxdWVyeT86IHVua25vd24sIHNlcnZpY2VUb2tlbj86IHN0cmluZywgYXNzZXRzQXBpID0gJycsIHBvcnRhbFVybCA9ICcnXG4pOiBQcm9taXNlPEpzb25MZCB8IHVuZGVmaW5lZD4ge1xuICBsZXQgaHVibWFwRGF0YTogU2VhcmNoUmVzdWx0SnNvbiB8IHVuZGVmaW5lZDtcbiAgaWYgKHNlcnZpY2VUeXBlID09PSAnc3RhdGljJykge1xuICAgIGh1Ym1hcERhdGEgPSBhd2FpdCBkb1NlYXJjaFJlcXVlc3QoZGF0YVVybCk7XG4gIH0gZWxzZSBpZiAoc2VydmljZVR5cGUgPT09ICdzZWFyY2gtYXBpJykge1xuICAgIGh1Ym1hcERhdGEgPSBhd2FpdCBkb0FwaVNlYXJjaChkYXRhVXJsLCBzZXJ2aWNlVG9rZW4sIHF1ZXJ5KTtcbiAgfVxuXG4gIGlmIChodWJtYXBEYXRhKSB7XG4gICAgcmV0dXJuIGh1Ym1hcFJlc3BvbnNlQXNKc29uTGQoaHVibWFwRGF0YSwgYXNzZXRzQXBpLCBwb3J0YWxVcmwsIHNlcnZpY2VUb2tlbik7XG4gIH0gZWxzZSB7XG4gICAgY29uc29sZS53YXJuKGBVbmFibGUgdG8gbG9hZCAke2RhdGFVcmx9IGFzIEh1Qk1BUCBEYXRhYCk7XG4gICAgcmV0dXJuIHVuZGVmaW5lZDtcbiAgfVxufVxuXG4vKipcbiAqIEFkZHMgaHVibWFwIGRhdGEgZnJvbSBhIHVybCB0byB0aGUgdHJpcGxlIHN0b3JlLlxuICpcbiAqIEBwYXJhbSBzdG9yZSBUaGUgdHJpcGxlIHN0b3JlLlxuICogQHBhcmFtIGRhdGFVcmwgVGhlIGRhdGEgdXJsLlxuICogQHBhcmFtIHNlcnZpY2VUeXBlIFRoZSBzZXJ2aWNlIHR5cGUuXG4gKi9cbmV4cG9ydCBhc3luYyBmdW5jdGlvbiBhZGRIdWJtYXBEYXRhVG9TdG9yZShcbiAgc3RvcmU6IFN0b3JlLCBkYXRhVXJsOiBzdHJpbmcsIHNlcnZpY2VUeXBlOiAnc3RhdGljJyB8ICdzZWFyY2gtYXBpJywgc2VydmljZVRva2VuPzogc3RyaW5nLCBhc3NldHNBcGkgPSAnJywgcG9ydGFsVXJsID0gJydcbik6IFByb21pc2U8dm9pZD4ge1xuICBjb25zdCBodWJtYXBEYXRhID0gYXdhaXQgc2VhcmNoSHVibWFwKGRhdGFVcmwsIHNlcnZpY2VUeXBlLCB1bmRlZmluZWQsIHNlcnZpY2VUb2tlbiwgYXNzZXRzQXBpLCBwb3J0YWxVcmwpO1xuICBpZiAoaHVibWFwRGF0YSkge1xuICAgIGF3YWl0IGFkZEpzb25MZFRvU3RvcmUoaHVibWFwRGF0YSwgc3RvcmUpO1xuICB9XG59XG4iXX0= \ No newline at end of file diff --git a/ccf-database/esm2015/lib/hubmap/hubmap-data.js b/ccf-database/esm2015/lib/hubmap/hubmap-data.js deleted file mode 100644 index 1e9eea66f..000000000 --- a/ccf-database/esm2015/lib/hubmap/hubmap-data.js +++ /dev/null @@ -1,376 +0,0 @@ -import { get, omit, set, toNumber } from 'lodash'; -const HBM_PREFIX = 'https://entity.api.hubmapconsortium.org/entities/'; -// eslint-disable-next-line max-len -export const DR1_VU_THUMBS = 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']); -// eslint-disable-next-line max-len -export const UFL_THUMBS = { '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' }; -/** UUID to TMC mapping. */ -const GROUP_UUID_MAPPING = { - '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', - '5c106f29-ea2d-11e9-85e8-0efb3ba9a670': 'RTI-General Electric', - '301615f9-c870-11eb-a8dc-35ce3d8786fe': 'TMC-UConn' -}; -const ENTITY_CONTEXT = { - '@base': 'http://purl.org/ccf/latest/ccf-entity.owl#', - '@vocab': 'http://purl.org/ccf/latest/ccf-entity.owl#', - ccf: 'http://purl.org/ccf/', - 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' - }, - // eslint-disable-next-line @typescript-eslint/naming-convention - rui_location: { - '@id': 'has_spatial_entity', - '@type': '@id' - }, - ontologyTerms: { - '@id': 'has_ontology_term', - '@type': '@id' - }, - cellTypeTerms: { - '@id': 'has_cell_type_term', - '@type': '@id' - }, - thumbnail: { - '@id': 'has_thumbnail' - } -}; -/** - * Converts a hubmap response object into JsonLd. - * - * @param data The hubmap data. - * @returns The converted data. - */ -export function hubmapResponseAsJsonLd(data, assetsApi = '', portalUrl = '', serviceToken, debug = false) { - const entries = get(data, 'hits.hits', []) - .map(e => get(e, '_source', {})) - .sort((a, b) => a['uuid'].localeCompare(b['uuid'])); - const donorLookup = {}; - const unflattened = entries.map(e => new HuBMAPTissueBlock(e, assetsApi, portalUrl, serviceToken).toJsonLd()); - for (const donor of unflattened) { - const donorId = donor['@id']; - if (!donorLookup[donorId]) { - donorLookup[donorId] = donor; - } - else { - const samples = donorLookup[donorId].samples; - samples.push(donor.samples[0]); - } - } - const donors = Object.values(donorLookup); - if (debug) { - debugDonors(donors); - console.log(donors.map(d => (Object.assign({ '@context': ENTITY_CONTEXT }, d)))); - } - return { '@context': ENTITY_CONTEXT, '@graph': donors }; -} -function debugDonors(donors) { - let datasets = []; - let deleted = 0; - for (const donor of donors.filter(d => d.samples.length > 1)) { - const samples = donor.samples; - for (let i = 0; i < samples.length; i++) { - const blockId = samples[i]['@id']; - datasets = datasets.concat(samples[i].datasets); - for (const section of samples[i].sections) { - datasets = datasets.concat(section.datasets); - } - for (let j = i + 1; j < samples.length; j++) { - const sections = samples[j].sections; - if (sections.find(s => s['@id'] === blockId)) { - samples[i].deleteMe = true; - deleted++; - } - } - } - donor.samples = samples.filter(s => s.deleteMe !== true); - } - if (deleted > 0) { - console.log(`âš  ${deleted} sections identified as blocks`); - } -} -export class HuBMAPTissueBlock { - constructor(data, assetsApi = '', portalUrl = '', serviceToken) { - var _a, _b; - this.data = data; - this.bad = false; - this['@type'] = 'Sample'; - this.sample_type = 'Tissue Block'; - const entityType = this.data.entity_type; - if (entityType !== 'Sample') { - this.bad = true; - return; - } - const ancestors = (this.data.ancestors || []); - const descendants = (this.data.descendants || []); - const donor = ancestors.find(e => e.entity_type === 'Donor'); - this.donor = this.getDonor(donor, portalUrl); - const ruiLocation = this.getRuiLocation(data, this.donor); - if (!ruiLocation) { - this.bad = true; - } - else { - this.rui_location = ruiLocation; - } - if (!GROUP_UUID_MAPPING[data.group_uuid]) { - GROUP_UUID_MAPPING[data.group_uuid] = data.group_name; - } - const dateEntered = new Date(data.last_modified_timestamp).toLocaleDateString(); - const groupName = GROUP_UUID_MAPPING[data.group_uuid] || data.group_name; - const creator = data.created_by_user_displayname; - this['@id'] = HBM_PREFIX + data.uuid; - this.label = `Registered ${dateEntered}, ${creator}, ${groupName}`; - this.link = `${portalUrl}browse/sample/${data.uuid}`; - const sectionLookup = {}; - const sections = []; - this.sections = sections; - const datasets = []; - this.datasets = datasets; - for (const descendant of descendants.filter(d => d.entity_type === 'Sample')) { - const section = this.getSection(descendant, data, portalUrl); - const sectionId = descendant.submission_id; - sectionLookup[sectionId] = section; - sections.push(section); - section.section_number = (_a = section.section_number) !== null && _a !== void 0 ? _a : sections.length; - } - for (const descendant of descendants) { - if (descendant.entity_type === 'Dataset') { - const dataset = this.getDataset(descendant, assetsApi, portalUrl, serviceToken); - const sectionId = get(descendant, ['ingest_metadata', 'metadata', 'tissue_id']); - if (sectionLookup[sectionId]) { - (_b = sectionLookup[sectionId].datasets) === null || _b === void 0 ? void 0 : _b.push(dataset); - } - else { - datasets.push(dataset); - } - } - } - const loc = ruiLocation !== null && ruiLocation !== void 0 ? ruiLocation : {}; - const dims = `${loc.x_dimension} x ${loc.y_dimension} x ${loc.z_dimension} ${loc.dimension_units}`; - this.section_count = loc.slice_count || sections.length; - const sSize = parseFloat((loc.slice_thickness || - ((loc.z_dimension || 0) / Math.max(this.section_count, 1))) - .toFixed(1)); - this.section_size = sSize; - const sUnits = loc.dimension_units || 'millimeter'; - this.section_units = sUnits; - this.description = `${dims}, ${sSize} ${sUnits}, ${data.specimen_type}, ${this.section_count} Sections`; - sections.forEach((section, index) => { - section.description = `${loc.x_dimension} x ${loc.y_dimension} x ${sSize} ${sUnits}, ${sSize} ${sUnits}, ${section.description}`; - section.section_number = index + 1; - }); - } - getSection(section, data, portalUrl) { - const dateEntered = new Date(section.last_modified_timestamp).toLocaleDateString(); - const groupName = GROUP_UUID_MAPPING[section.group_uuid] || section.group_name; - const creator = section.created_by_user_displayname; - return { - '@id': HBM_PREFIX + section.uuid, - '@type': 'Sample', - label: `Registered ${dateEntered}, ${creator}, ${groupName}`, - description: `${data.specimen_type}`, - link: `${portalUrl}browse/sample/${section.uuid}`, - sample_type: 'Tissue Section', - section_number: 1, - samples: [], - datasets: [] - }; - } - getDataset(dataset, assetsApi = '', portalUrl = '', serviceToken) { - var _a; - const dateEntered = new Date(dataset.last_modified_timestamp).toLocaleDateString(); - const groupName = GROUP_UUID_MAPPING[dataset.group_uuid] || dataset.group_name; - const creator = dataset.created_by_user_displayname; - const types = [ - ...dataset.data_types, - get(dataset, ['ingest_metadata', 'metadata', 'assay_type'], '') - ]; - const typesSearch = types.join('|').toLowerCase(); - let technology; - let thumbnail = 'assets/icons/ico-unknown.svg'; - if (typesSearch.indexOf('10x') !== -1) { - technology = '10x'; - thumbnail = 'assets/icons/ico-bulk-10x.svg'; - } - else if (typesSearch.indexOf('af') !== -1) { - technology = 'AF'; - thumbnail = 'assets/icons/ico-spatial-af.svg'; - } - else if (typesSearch.indexOf('codex') !== -1) { - technology = 'CODEX'; - thumbnail = 'assets/icons/ico-spatial-codex.svg'; - } - else if (typesSearch.indexOf('imc') !== -1) { - technology = 'IMC'; - thumbnail = 'assets/icons/ico-spatial-imc.svg'; - } - else if ((typesSearch.indexOf('lc') !== -1) && (typesSearch.indexOf('af') === -1)) { - technology = 'LC'; - thumbnail = 'assets/icons/ico-bulk-lc.svg'; - } - else if (typesSearch.indexOf('maldi') !== -1) { - technology = 'MALDI'; - } - else if (typesSearch.indexOf('pas') !== -1) { - technology = 'PAS'; - } - else { - technology = 'OTHER'; - } - thumbnail = (_a = this.getDatasetThumbnail(dataset, assetsApi, serviceToken)) !== null && _a !== void 0 ? _a : thumbnail; - return { - '@id': HBM_PREFIX + dataset.uuid, - '@type': 'Dataset', - label: `Registered ${dateEntered}, ${creator}, ${groupName}`, - description: `Data/Assay Types: ${types.join(', ')}`, - link: `${portalUrl}browse/dataset/${dataset.uuid}`, - technology, - thumbnail - }; - } - getDatasetThumbnail(dataset, assetsApi, serviceToken) { - if (dataset.thumbnail_file) { - const thumbnailFile = dataset.thumbnail_file; - return `${assetsApi}/${thumbnailFile.file_uuid}/${thumbnailFile.filename}` + (serviceToken ? `?token=${serviceToken}` : ''); - } - else if (dataset.group_uuid === '73bb26e4-ed43-11e8-8f19-0a7c1eab007a') { // TMC-Vanderbilt - const tiffs = get(dataset, 'metadata.files', []) - .filter(f => /\.(ome\.tif|ome\.tiff)$/.test(f.rel_path)) - .filter(f => !/(multilayer\.ome\.tif|_ac\.ome\.tif)/.test(f.rel_path)) - .filter(f => DR1_VU_THUMBS.has(f.rel_path.split('/').slice(-1)[0].split('?')[0].replace('.ome.tif', '_thumbnail.jpg'))) - .map(f => `${assetsApi}/${dataset.uuid}/${f.rel_path}` + (serviceToken ? `?token=${serviceToken}` : '')); - if (tiffs.length > 0) { - const thumb = tiffs[0].split('/').slice(-1)[0].split('?')[0].replace('.ome.tif', '_thumbnail.jpg'); - if (DR1_VU_THUMBS.has(thumb)) { - return `assets/thumbnails/TMC-Vanderbilt/DR1/${thumb}`; - } - } - } - else if (dataset.group_uuid === '07a29e4c-ed43-11e8-b56a-0e8017bdda58') { // TMC-Florida - const thumb = UFL_THUMBS[dataset.hubmap_id]; - if (thumb) { - return `assets/thumbnails/TMC-Florida/${thumb}`; - } - } - return undefined; - } - getDonor(donor, portalUrl) { - const donorDescription = (donor.description || '').toLowerCase(); - let sex; - if (donorDescription.includes('female')) { - sex = 'Female'; - } - else if (donorDescription.includes('male')) { - sex = 'Male'; - } - const ageMatch = donorDescription.match(/age ([0-9]+)/); - let age; - if (ageMatch) { - age = toNumber(ageMatch[1]); - } - let bmi; - for (const md of get(donor, 'metadata.organ_donor_data', get(donor, 'metadata.living_donor_data', []))) { - if (md.preferred_term === 'Feminine gender' || md.preferred_term === 'Female') { - sex = 'Female'; - } - else if (md.preferred_term === 'Masculine gender' || md.preferred_term === 'Male') { - sex = 'Male'; - } - else if (md.preferred_term === 'Current chronological age' || md.preferred_term === 'Age') { - age = toNumber(md.data_value); - } - else if (md.preferred_term === 'Body mass index') { - bmi = toNumber(md.data_value); - } - } - let label = ''; - if (sex && age) { - label += `${sex}, Age ${age}`; - if (bmi) { - label += `, BMI ${bmi.toFixed(1)}`; - } - } - const dateEntered = new Date(donor.last_modified_timestamp).toLocaleDateString(); - const groupName = GROUP_UUID_MAPPING[donor.group_uuid] || donor.group_name; - const creator = donor.created_by_user_displayname; - return { - '@id': HBM_PREFIX + donor.uuid, - '@type': 'Donor', - label, - description: `Entered ${dateEntered}, ${creator}, ${groupName}`, - link: `${portalUrl}browse/donor/${donor.uuid}`, - age, - sex, - bmi, - consortium_name: 'HuBMAP', - provider_name: groupName, - provider_uuid: donor.group_uuid, - samples: [] - }; - } - getRuiLocation(data, donor) { - var _a; - let spatialEntity; - let ruiLocation = data.rui_location; - if (ruiLocation) { - // RUI Location may come in as an unparsed string - if (typeof ruiLocation === 'string') { - ruiLocation = JSON.parse(ruiLocation); - } - if (ruiLocation.alignment_id) { // Detect RUI 0.5 generated JSON - console.log('Detected a deprecated rui_location', data.uuid); - } - else if (ruiLocation['@id']) { // Detect RUI 1.0+ generated JSON-LD - // eslint-disable-next-line @typescript-eslint/no-explicit-any - spatialEntity = ruiLocation; - } - } - if (spatialEntity) { - // Patch to fix RUI 0.5 Kidney and Spleen Placements - const target = (_a = get(spatialEntity, ['placement', 'target'])) !== null && _a !== void 0 ? _a : ''; - if (target.startsWith('http://purl.org/ccf/latest/ccf.owl#VHSpleenCC')) { - if (donor.sex === 'Male') { - set(spatialEntity, ['placement', 'target'], target.replace('#VHSpleenCC', '#VHMSpleenCC')); - } - else { - set(spatialEntity, ['placement', 'target'], target.replace('#VHSpleenCC', '#VHFSpleenCC')); - } - } - else if (target === 'http://purl.org/ccf/latest/ccf.owl#VHLeftKidney' || target === 'http://purl.org/ccf/latest/ccf.owl#VHRightKidney') { - if (donor.sex === 'Male') { - set(spatialEntity, ['placement', 'target'], target.replace('#VH', '#VHM') + '_Patch'); - } - else { - set(spatialEntity, ['placement', 'target'], target.replace('#VH', '#VHF') + '_Patch'); - } - } - } - return spatialEntity; - } - getTissueBlock() { - return omit(Object.assign({}, this), ['data', 'bad', 'donor']); - } - toJsonLd() { - return Object.assign(Object.assign({}, this.donor), { samples: [this.getTissueBlock()] }); - } -} -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaHVibWFwLWRhdGEuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9jY2YtZGF0YWJhc2Uvc3JjL2xpYi9odWJtYXAvaHVibWFwLWRhdGEudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBRUEsT0FBTyxFQUFFLEdBQUcsRUFBRSxJQUFJLEVBQUUsR0FBRyxFQUFFLFFBQVEsRUFBRSxNQUFNLFFBQVEsQ0FBQztBQUlsRCxNQUFNLFVBQVUsR0FBRyxtREFBbUQsQ0FBQztBQUV2RSxtQ0FBbUM7QUFDbkMsTUFBTSxDQUFDLE1BQU0sYUFBYSxHQUFHLElBQUksR0FBRyxDQUFDLENBQUMscURBQXFELEVBQUUsdURBQXVELEVBQUUsdURBQXVELEVBQUUsK0NBQStDLEVBQUUsc0RBQXNELEVBQUUscURBQXFELEVBQUUscURBQXFELEVBQUUscURBQXFELEVBQUUsbURBQW1ELEVBQUUscURBQXFELEVBQUUscURBQXFELEVBQUUsNkNBQTZDLEVBQUUscURBQXFELEVBQUUsdURBQXVELEVBQUUsdURBQXVELEVBQUUsK0NBQStDLEVBQUUsb0RBQW9ELEVBQUUsc0RBQXNELEVBQUUsc0RBQXNELEVBQUUsOENBQThDLEVBQUUscURBQXFELEVBQUUsb0RBQW9ELEVBQUUsb0RBQW9ELEVBQUUsb0RBQW9ELEVBQUUsdURBQXVELEVBQUUseURBQXlELEVBQUUseURBQXlELEVBQUUsaURBQWlELEVBQUUsdURBQXVELEVBQUUseURBQXlELEVBQUUseURBQXlELEVBQUUsaURBQWlELEVBQUUsd0RBQXdELEVBQUUsdURBQXVELEVBQUUsdURBQXVELEVBQUUsdURBQXVELEVBQUUscURBQXFELEVBQUUsdURBQXVELEVBQUUsdURBQXVELEVBQUUsK0NBQStDLEVBQUUsc0RBQXNELEVBQUUsd0RBQXdELEVBQUUsd0RBQXdELEVBQUUsZ0RBQWdELEVBQUUsb0RBQW9ELEVBQUUsc0RBQXNELEVBQUUsc0RBQXNELEVBQUUsOENBQThDLEVBQUUscURBQXFELEVBQUUsb0RBQW9ELEVBQUUsb0RBQW9ELEVBQUUsb0RBQW9ELEVBQUUsc0RBQXNELEVBQUUsd0RBQXdELEVBQUUsd0RBQXdELEVBQUUsZ0RBQWdELEVBQUUsdURBQXVELEVBQUUsc0RBQXNELEVBQUUsc0RBQXNELEVBQUUsc0RBQXNELEVBQUUsc0RBQXNELEVBQUUsd0RBQXdELEVBQUUsd0RBQXdELEVBQUUsZ0RBQWdELEVBQUUsdURBQXVELEVBQUUsc0RBQXNELEVBQUUsc0RBQXNELEVBQUUsc0RBQXNELEVBQUUsdURBQXVELEVBQUUseURBQXlELEVBQUUseURBQXlELEVBQUUsaURBQWlELEVBQUUsc0RBQXNELEVBQUUsd0RBQXdELEVBQUUsd0RBQXdELEVBQUUsZ0RBQWdELEVBQUUscURBQXFELEVBQUUsdURBQXVELEVBQUUsdURBQXVELEVBQUUsK0NBQStDLEVBQUUsc0RBQXNELEVBQUUscURBQXFELEVBQUUscURBQXFELEVBQUUscURBQXFELEVBQUUsbURBQW1ELEVBQUUscURBQXFELEVBQUUscURBQXFELEVBQUUsNkNBQTZDLEVBQUUscURBQXFELEVBQUUsdURBQXVELEVBQUUsdURBQXVELEVBQUUsK0NBQStDLEVBQUUsb0RBQW9ELEVBQUUsc0RBQXNELEVBQUUsc0RBQXNELEVBQUUsOENBQThDLEVBQUUscURBQXFELEVBQUUsb0RBQW9ELEVBQUUsb0RBQW9ELEVBQUUsb0RBQW9ELEVBQUUsdURBQXVELEVBQUUseURBQXlELEVBQUUseURBQXlELEVBQUUsaURBQWlELEVBQUUsdURBQXVELEVBQUUseURBQXlELEVBQUUseURBQXlELEVBQUUsaURBQWlELEVBQUUsd0RBQXdELEVBQUUsdURBQXVELEVBQUUsdURBQXVELEVBQUUsdURBQXVELEVBQUUsb0RBQW9ELEVBQUUsc0RBQXNELEVBQUUsc0RBQXNELEVBQUUsOENBQThDLEVBQUUscURBQXFELEVBQUUsb0RBQW9ELEVBQUUsb0RBQW9ELEVBQUUsb0RBQW9ELEVBQUUsc0RBQXNELEVBQUUsd0RBQXdELEVBQUUsd0RBQXdELEVBQUUsZ0RBQWdELEVBQUUsdURBQXVELEVBQUUsc0RBQXNELEVBQUUsc0RBQXNELEVBQUUsc0RBQXNELENBQUMsQ0FBQyxDQUFDO0FBQ2g3TixtQ0FBbUM7QUFDbkMsTUFBTSxDQUFDLE1BQU0sVUFBVSxHQUFHLEVBQUUsaUJBQWlCLEVBQUUsc0NBQXNDLEVBQUUsaUJBQWlCLEVBQUUsc0NBQXNDLEVBQUUsaUJBQWlCLEVBQUUsc0NBQXNDLEVBQUUsaUJBQWlCLEVBQUUsc0NBQXNDLEVBQUUsaUJBQWlCLEVBQUUsc0NBQXNDLEVBQUUsaUJBQWlCLEVBQUUsc0NBQXNDLEVBQUUsaUJBQWlCLEVBQUUsc0NBQXNDLEVBQUUsaUJBQWlCLEVBQUUsc0NBQXNDLEVBQUUsaUJBQWlCLEVBQUUsc0NBQXNDLEVBQUUsaUJBQWlCLEVBQUUsc0NBQXNDLEVBQUUsaUJBQWlCLEVBQUUsc0NBQXNDLEVBQUUsaUJBQWlCLEVBQUUsc0NBQXNDLEVBQUUsaUJBQWlCLEVBQUUsc0NBQXNDLEVBQUUsaUJBQWlCLEVBQUUsc0NBQXNDLEVBQUUsaUJBQWlCLEVBQUUsc0NBQXNDLEVBQUUsaUJBQWlCLEVBQUUsc0NBQXNDLEVBQUUsaUJBQWlCLEVBQUUsc0NBQXNDLEVBQUUsaUJBQWlCLEVBQUUsc0NBQXNDLEVBQUUsaUJBQWlCLEVBQUUsc0NBQXNDLEVBQUUsaUJBQWlCLEVBQUUsc0NBQXNDLEVBQUUsaUJBQWlCLEVBQUUsc0NBQXNDLEVBQUUsaUJBQWlCLEVBQUUsc0NBQXNDLEVBQUUsaUJBQWlCLEVBQUUsc0NBQXNDLEVBQUUsaUJBQWlCLEVBQUUsc0NBQXNDLEVBQUUsaUJBQWlCLEVBQUUsc0NBQXNDLEVBQUUsaUJBQWlCLEVBQUUsc0NBQXNDLEVBQUUsaUJBQWlCLEVBQUUsc0NBQXNDLEVBQUUsaUJBQWlCLEVBQUUsc0NBQXNDLEVBQUUsaUJBQWlCLEVBQUUsc0NBQXNDLEVBQUUsaUJBQWlCLEVBQUUsc0NBQXNDLEVBQUUsaUJBQWlCLEVBQUUsc0NBQXNDLEVBQUUsaUJBQWlCLEVBQUUsc0NBQXNDLEVBQUUsaUJBQWlCLEVBQUUsc0NBQXNDLEVBQUUsaUJBQWlCLEVBQUUsc0NBQXNDLEVBQUUsaUJBQWlCLEVBQUUsc0NBQXNDLEVBQUUsaUJBQWlCLEVBQUUsc0NBQXNDLEVBQUUsaUJBQWlCLEVBQUUsc0NBQXNDLEVBQUUsaUJBQWlCLEVBQUUsc0NBQXNDLEVBQUUsaUJBQWlCLEVBQUUsc0NBQXNDLEVBQUUsQ0FBQztBQUUxeEUsMkJBQTJCO0FBQzNCLE1BQU0sa0JBQWtCLEdBQStCO0lBQ3JELHNDQUFzQyxFQUFFLFVBQVU7SUFDbEQsc0NBQXNDLEVBQUUsYUFBYTtJQUNyRCxzQ0FBc0MsRUFBRSxhQUFhO0lBQ3JELHNDQUFzQyxFQUFFLGtCQUFrQjtJQUMxRCxzQ0FBc0MsRUFBRSxnQkFBZ0I7SUFDeEQsc0NBQXNDLEVBQUUsY0FBYztJQUN0RCxzQ0FBc0MsRUFBRSxzQkFBc0I7SUFDOUQsc0NBQXNDLEVBQUUsV0FBVztDQUNwRCxDQUFDO0FBRUYsTUFBTSxjQUFjLEdBQUc7SUFDckIsT0FBTyxFQUFFLDRDQUE0QztJQUNyRCxRQUFRLEVBQUUsNENBQTRDO0lBQ3RELEdBQUcsRUFBRSxzQkFBc0I7SUFDM0IsSUFBSSxFQUFFLHVDQUF1QztJQUU3QyxLQUFLLEVBQUUsWUFBWTtJQUNuQixXQUFXLEVBQUUsY0FBYztJQUMzQixJQUFJLEVBQUU7UUFDSixLQUFLLEVBQUUsY0FBYztRQUNyQixPQUFPLEVBQUUsS0FBSztLQUNmO0lBQ0QsT0FBTyxFQUFFO1FBQ1AsVUFBVSxFQUFFLFdBQVc7S0FDeEI7SUFDRCxRQUFRLEVBQUU7UUFDUixLQUFLLEVBQUUsb0JBQW9CO1FBQzNCLE9BQU8sRUFBRSxLQUFLO0tBQ2Y7SUFDRCxRQUFRLEVBQUU7UUFDUixLQUFLLEVBQUUsYUFBYTtRQUNwQixPQUFPLEVBQUUsS0FBSztLQUNmO0lBQ0QsZ0VBQWdFO0lBQ2hFLFlBQVksRUFBRTtRQUNaLEtBQUssRUFBRSxvQkFBb0I7UUFDM0IsT0FBTyxFQUFFLEtBQUs7S0FDZjtJQUNELGFBQWEsRUFBRTtRQUNiLEtBQUssRUFBRSxtQkFBbUI7UUFDMUIsT0FBTyxFQUFFLEtBQUs7S0FDZjtJQUNELGFBQWEsRUFBRTtRQUNiLEtBQUssRUFBRSxvQkFBb0I7UUFDM0IsT0FBTyxFQUFFLEtBQUs7S0FDZjtJQUNELFNBQVMsRUFBRTtRQUNULEtBQUssRUFBRSxlQUFlO0tBQ3ZCO0NBQ0YsQ0FBQztBQUVGOzs7OztHQUtHO0FBQ0gsTUFBTSxVQUFVLHNCQUFzQixDQUFDLElBQWEsRUFBRSxTQUFTLEdBQUcsRUFBRSxFQUFFLFNBQVMsR0FBRyxFQUFFLEVBQUUsWUFBcUIsRUFBRSxLQUFLLEdBQUcsS0FBSztJQUN4SCxNQUFNLE9BQU8sR0FBSSxHQUFHLENBQUMsSUFBSSxFQUFFLFdBQVcsRUFBRSxFQUFFLENBQWdCO1NBQ3ZELEdBQUcsQ0FBQyxDQUFDLENBQUMsRUFBRSxDQUFDLEdBQUcsQ0FBQyxDQUFDLEVBQUUsU0FBUyxFQUFFLEVBQUUsQ0FBYSxDQUFDO1NBQzNDLElBQUksQ0FBQyxDQUFDLENBQUMsRUFBRSxDQUFDLEVBQUUsRUFBRSxDQUFFLENBQUMsQ0FBQyxNQUFNLENBQVksQ0FBQyxhQUFhLENBQUMsQ0FBQyxDQUFDLE1BQU0sQ0FBVyxDQUFDLENBQUMsQ0FBQztJQUU1RSxNQUFNLFdBQVcsR0FBOEIsRUFBRSxDQUFDO0lBQ2xELE1BQU0sV0FBVyxHQUFnQixPQUFPLENBQUMsR0FBRyxDQUFDLENBQUMsQ0FBQyxFQUFFLENBQy9DLElBQUksaUJBQWlCLENBQUMsQ0FBQyxFQUFFLFNBQVMsRUFBRSxTQUFTLEVBQUUsWUFBWSxDQUFDLENBQUMsUUFBUSxFQUFFLENBQ3hFLENBQUM7SUFDRixLQUFLLE1BQU0sS0FBSyxJQUFJLFdBQVcsRUFBRTtRQUMvQixNQUFNLE9BQU8sR0FBRyxLQUFLLENBQUMsS0FBSyxDQUFXLENBQUM7UUFDdkMsSUFBSSxDQUFDLFdBQVcsQ0FBQyxPQUFPLENBQUMsRUFBRTtZQUN6QixXQUFXLENBQUMsT0FBTyxDQUFDLEdBQUcsS0FBSyxDQUFDO1NBQzlCO2FBQU07WUFDTCxNQUFNLE9BQU8sR0FBRyxXQUFXLENBQUMsT0FBTyxDQUFDLENBQUMsT0FBc0IsQ0FBQztZQUM1RCxPQUFPLENBQUMsSUFBSSxDQUFFLEtBQUssQ0FBQyxPQUF1QixDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7U0FDakQ7S0FDRjtJQUNELE1BQU0sTUFBTSxHQUFHLE1BQU0sQ0FBQyxNQUFNLENBQUMsV0FBVyxDQUFDLENBQUM7SUFFMUMsSUFBSSxLQUFLLEVBQUU7UUFDVCxXQUFXLENBQUMsTUFBTSxDQUFDLENBQUM7UUFDcEIsT0FBTyxDQUFDLEdBQUcsQ0FBQyxNQUFNLENBQUMsR0FBRyxDQUFDLENBQUMsQ0FBQyxFQUFFLENBQUMsaUJBQUcsVUFBVSxFQUFFLGNBQWMsSUFBSyxDQUFDLEVBQUcsQ0FBQyxDQUFDLENBQUM7S0FDdEU7SUFFRCxPQUFPLEVBQUUsVUFBVSxFQUFFLGNBQWMsRUFBRSxRQUFRLEVBQUUsTUFBTSxFQUFFLENBQUM7QUFDMUQsQ0FBQztBQUVELFNBQVMsV0FBVyxDQUFDLE1BQW1CO0lBQ3RDLElBQUksUUFBUSxHQUFnQixFQUFFLENBQUM7SUFDL0IsSUFBSSxPQUFPLEdBQUcsQ0FBQyxDQUFDO0lBQ2hCLEtBQUssTUFBTSxLQUFLLElBQUksTUFBTSxDQUFDLE1BQU0sQ0FBQyxDQUFDLENBQUMsRUFBRSxDQUFFLENBQUMsQ0FBQyxPQUFjLENBQUMsTUFBTSxHQUFHLENBQUMsQ0FBQyxFQUFFO1FBQ3BFLE1BQU0sT0FBTyxHQUFHLEtBQUssQ0FBQyxPQUFzQixDQUFDO1FBQzdDLEtBQUssSUFBSSxDQUFDLEdBQUMsQ0FBQyxFQUFFLENBQUMsR0FBRyxPQUFPLENBQUMsTUFBTSxFQUFFLENBQUMsRUFBRSxFQUFFO1lBQ3JDLE1BQU0sT0FBTyxHQUFHLE9BQU8sQ0FBQyxDQUFDLENBQUMsQ0FBQyxLQUFLLENBQVcsQ0FBQztZQUM1QyxRQUFRLEdBQUcsUUFBUSxDQUFDLE1BQU0sQ0FBQyxPQUFPLENBQUMsQ0FBQyxDQUFDLENBQUMsUUFBdUIsQ0FBQyxDQUFDO1lBQy9ELEtBQUssTUFBTSxPQUFPLElBQUksT0FBTyxDQUFDLENBQUMsQ0FBQyxDQUFDLFFBQXVCLEVBQUU7Z0JBQ3hELFFBQVEsR0FBRyxRQUFRLENBQUMsTUFBTSxDQUFDLE9BQU8sQ0FBQyxRQUF1QixDQUFDLENBQUM7YUFDN0Q7WUFDRCxLQUFLLElBQUksQ0FBQyxHQUFDLENBQUMsR0FBQyxDQUFDLEVBQUUsQ0FBQyxHQUFHLE9BQU8sQ0FBQyxNQUFNLEVBQUUsQ0FBQyxFQUFFLEVBQUU7Z0JBQ3ZDLE1BQU0sUUFBUSxHQUFHLE9BQU8sQ0FBQyxDQUFDLENBQUMsQ0FBQyxRQUF1QixDQUFDO2dCQUNwRCxJQUFJLFFBQVEsQ0FBQyxJQUFJLENBQUMsQ0FBQyxDQUFDLEVBQUUsQ0FBQyxDQUFDLENBQUMsS0FBSyxDQUFDLEtBQUssT0FBTyxDQUFDLEVBQUU7b0JBQzVDLE9BQU8sQ0FBQyxDQUFDLENBQUMsQ0FBQyxRQUFRLEdBQUcsSUFBSSxDQUFDO29CQUMzQixPQUFPLEVBQUUsQ0FBQztpQkFDWDthQUNGO1NBQ0Y7UUFDRCxLQUFLLENBQUMsT0FBTyxHQUFHLE9BQU8sQ0FBQyxNQUFNLENBQUMsQ0FBQyxDQUFDLEVBQUUsQ0FBQyxDQUFDLENBQUMsUUFBUSxLQUFLLElBQUksQ0FBQyxDQUFDO0tBQzFEO0lBQ0QsSUFBSSxPQUFPLEdBQUcsQ0FBQyxFQUFFO1FBQ2YsT0FBTyxDQUFDLEdBQUcsQ0FBQyxLQUFLLE9BQU8sZ0NBQWdDLENBQUMsQ0FBQztLQUMzRDtBQUNILENBQUM7QUFFRCxNQUFNLE9BQU8saUJBQWlCO0lBbUI1QixZQUFtQixJQUFjLEVBQUUsU0FBUyxHQUFHLEVBQUUsRUFBRSxTQUFTLEdBQUcsRUFBRSxFQUFFLFlBQXFCOztRQUFyRSxTQUFJLEdBQUosSUFBSSxDQUFVO1FBbEJqQyxRQUFHLEdBQUcsS0FBSyxDQUFDO1FBSVosYUFBTyxHQUFHLFFBQVEsQ0FBQztRQUtuQixnQkFBVyxHQUFHLGNBQWMsQ0FBQztRQVUzQixNQUFNLFVBQVUsR0FBRyxJQUFJLENBQUMsSUFBSSxDQUFDLFdBQVcsQ0FBQztRQUN6QyxJQUFJLFVBQVUsS0FBSyxRQUFRLEVBQUU7WUFDM0IsSUFBSSxDQUFDLEdBQUcsR0FBRyxJQUFJLENBQUM7WUFDaEIsT0FBTztTQUNSO1FBQ0QsTUFBTSxTQUFTLEdBQUcsQ0FBQyxJQUFJLENBQUMsSUFBSSxDQUFDLFNBQVMsSUFBSSxFQUFFLENBQWUsQ0FBQztRQUM1RCxNQUFNLFdBQVcsR0FBRyxDQUFDLElBQUksQ0FBQyxJQUFJLENBQUMsV0FBVyxJQUFJLEVBQUUsQ0FBZSxDQUFDO1FBRWhFLE1BQU0sS0FBSyxHQUFHLFNBQVMsQ0FBQyxJQUFJLENBQUMsQ0FBQyxDQUFDLEVBQUUsQ0FBQyxDQUFDLENBQUMsV0FBVyxLQUFLLE9BQU8sQ0FBYSxDQUFDO1FBQ3pFLElBQUksQ0FBQyxLQUFLLEdBQUcsSUFBSSxDQUFDLFFBQVEsQ0FBQyxLQUFLLEVBQUUsU0FBUyxDQUFDLENBQUM7UUFDN0MsTUFBTSxXQUFXLEdBQUcsSUFBSSxDQUFDLGNBQWMsQ0FBQyxJQUFJLEVBQUUsSUFBSSxDQUFDLEtBQUssQ0FBQyxDQUFDO1FBQzFELElBQUksQ0FBQyxXQUFXLEVBQUU7WUFDaEIsSUFBSSxDQUFDLEdBQUcsR0FBRyxJQUFJLENBQUM7U0FDakI7YUFBTTtZQUNMLElBQUksQ0FBQyxZQUFZLEdBQUcsV0FBVyxDQUFDO1NBQ2pDO1FBRUQsSUFBSSxDQUFDLGtCQUFrQixDQUFDLElBQUksQ0FBQyxVQUFvQixDQUFDLEVBQUU7WUFDbEQsa0JBQWtCLENBQUMsSUFBSSxDQUFDLFVBQW9CLENBQUMsR0FBRyxJQUFJLENBQUMsVUFBb0IsQ0FBQztTQUMzRTtRQUVELE1BQU0sV0FBVyxHQUFHLElBQUksSUFBSSxDQUFDLElBQUksQ0FBQyx1QkFBaUMsQ0FBQyxDQUFDLGtCQUFrQixFQUFFLENBQUM7UUFDMUYsTUFBTSxTQUFTLEdBQUcsa0JBQWtCLENBQUMsSUFBSSxDQUFDLFVBQW9CLENBQUMsSUFBSSxJQUFJLENBQUMsVUFBb0IsQ0FBQztRQUM3RixNQUFNLE9BQU8sR0FBRyxJQUFJLENBQUMsMkJBQTJCLENBQUM7UUFFakQsSUFBSSxDQUFDLEtBQUssQ0FBQyxHQUFHLFVBQVUsR0FBRyxJQUFJLENBQUMsSUFBSSxDQUFDO1FBQ3JDLElBQUksQ0FBQyxLQUFLLEdBQUcsY0FBYyxXQUFXLEtBQUssT0FBTyxLQUFLLFNBQVMsRUFBRSxDQUFDO1FBQ25FLElBQUksQ0FBQyxJQUFJLEdBQUcsR0FBRyxTQUFTLGlCQUFpQixJQUFJLENBQUMsSUFBSSxFQUFFLENBQUM7UUFFckQsTUFBTSxhQUFhLEdBQThCLEVBQUUsQ0FBQztRQUNwRCxNQUFNLFFBQVEsR0FBZ0IsRUFBRSxDQUFDO1FBQ2pDLElBQUksQ0FBQyxRQUFRLEdBQUcsUUFBUSxDQUFDO1FBQ3pCLE1BQU0sUUFBUSxHQUFnQixFQUFFLENBQUM7UUFDakMsSUFBSSxDQUFDLFFBQVEsR0FBRyxRQUFRLENBQUM7UUFFekIsS0FBSyxNQUFNLFVBQVUsSUFBSSxXQUFXLENBQUMsTUFBTSxDQUFDLENBQUMsQ0FBQyxFQUFFLENBQUMsQ0FBQyxDQUFDLFdBQVcsS0FBSyxRQUFRLENBQUMsRUFBRTtZQUM1RSxNQUFNLE9BQU8sR0FBRyxJQUFJLENBQUMsVUFBVSxDQUFDLFVBQVUsRUFBRSxJQUFJLEVBQUUsU0FBUyxDQUFDLENBQUM7WUFFN0QsTUFBTSxTQUFTLEdBQUcsVUFBVSxDQUFDLGFBQXVCLENBQUM7WUFDckQsYUFBYSxDQUFDLFNBQVMsQ0FBQyxHQUFHLE9BQU8sQ0FBQztZQUNuQyxRQUFRLENBQUMsSUFBSSxDQUFDLE9BQU8sQ0FBQyxDQUFDO1lBQ3ZCLE9BQU8sQ0FBQyxjQUFjLEdBQUcsTUFBQSxPQUFPLENBQUMsY0FBYyxtQ0FBSSxRQUFRLENBQUMsTUFBTSxDQUFDO1NBQ3BFO1FBQ0QsS0FBSyxNQUFNLFVBQVUsSUFBSSxXQUFXLEVBQUU7WUFDcEMsSUFBSSxVQUFVLENBQUMsV0FBVyxLQUFLLFNBQVMsRUFBRTtnQkFDeEMsTUFBTSxPQUFPLEdBQUcsSUFBSSxDQUFDLFVBQVUsQ0FBQyxVQUFVLEVBQUUsU0FBUyxFQUFFLFNBQVMsRUFBRSxZQUFZLENBQUMsQ0FBQztnQkFFaEYsTUFBTSxTQUFTLEdBQUcsR0FBRyxDQUFDLFVBQVUsRUFBRSxDQUFDLGlCQUFpQixFQUFFLFVBQVUsRUFBRSxXQUFXLENBQUMsQ0FBVyxDQUFDO2dCQUMxRixJQUFJLGFBQWEsQ0FBQyxTQUFTLENBQUMsRUFBRTtvQkFDNUIsTUFBQyxhQUFhLENBQUMsU0FBUyxDQUFDLENBQUMsUUFBcUIsMENBQUUsSUFBSSxDQUFDLE9BQU8sQ0FBQyxDQUFDO2lCQUNoRTtxQkFBTTtvQkFDTCxRQUFRLENBQUMsSUFBSSxDQUFDLE9BQU8sQ0FBQyxDQUFDO2lCQUN4QjthQUNGO1NBQ0Y7UUFFRCxNQUFNLEdBQUcsR0FBYSxXQUFXLGFBQVgsV0FBVyxjQUFYLFdBQVcsR0FBSSxFQUFFLENBQUM7UUFDeEMsTUFBTSxJQUFJLEdBQUcsR0FBRyxHQUFHLENBQUMsV0FBVyxNQUFNLEdBQUcsQ0FBQyxXQUFXLE1BQU0sR0FBRyxDQUFDLFdBQVcsSUFBSSxHQUFHLENBQUMsZUFBZSxFQUFFLENBQUM7UUFDbkcsSUFBSSxDQUFDLGFBQWEsR0FBRyxHQUFHLENBQUMsV0FBcUIsSUFBSSxRQUFRLENBQUMsTUFBTSxDQUFDO1FBQ2xFLE1BQU0sS0FBSyxHQUFHLFVBQVUsQ0FDdEIsQ0FBQyxHQUFHLENBQUMsZUFBeUI7WUFDNUIsQ0FBQyxDQUFDLEdBQUcsQ0FBQyxXQUFxQixJQUFJLENBQUMsQ0FBQyxHQUFHLElBQUksQ0FBQyxHQUFHLENBQUMsSUFBSSxDQUFDLGFBQWEsRUFBRSxDQUFDLENBQUMsQ0FBQyxDQUFDO2FBQ3BFLE9BQU8sQ0FBQyxDQUFDLENBQUMsQ0FDZCxDQUFDO1FBQ0YsSUFBSSxDQUFDLFlBQVksR0FBRyxLQUFLLENBQUM7UUFDMUIsTUFBTSxNQUFNLEdBQUcsR0FBRyxDQUFDLGVBQXlCLElBQUksWUFBWSxDQUFDO1FBQzdELElBQUksQ0FBQyxhQUFhLEdBQUcsTUFBTSxDQUFDO1FBRTVCLElBQUksQ0FBQyxXQUFXLEdBQUcsR0FBRyxJQUFJLEtBQUssS0FBSyxJQUFJLE1BQU0sS0FBSyxJQUFJLENBQUMsYUFBYSxLQUFLLElBQUksQ0FBQyxhQUFhLFdBQVcsQ0FBQztRQUV4RyxRQUFRLENBQUMsT0FBTyxDQUFDLENBQUMsT0FBTyxFQUFFLEtBQUssRUFBRSxFQUFFO1lBQ2xDLE9BQU8sQ0FBQyxXQUFXLEdBQUcsR0FBRyxHQUFHLENBQUMsV0FBVyxNQUFNLEdBQUcsQ0FBQyxXQUFXLE1BQU0sS0FBSyxJQUFJLE1BQU0sS0FBSyxLQUFLLElBQUksTUFBTSxLQUFLLE9BQU8sQ0FBQyxXQUFXLEVBQUUsQ0FBQztZQUNqSSxPQUFPLENBQUMsY0FBYyxHQUFHLEtBQUssR0FBRyxDQUFDLENBQUM7UUFDckMsQ0FBQyxDQUFDLENBQUM7SUFDTCxDQUFDO0lBRUQsVUFBVSxDQUFDLE9BQWlCLEVBQUUsSUFBYyxFQUFFLFNBQWlCO1FBQzdELE1BQU0sV0FBVyxHQUFHLElBQUksSUFBSSxDQUFDLE9BQU8sQ0FBQyx1QkFBaUMsQ0FBQyxDQUFDLGtCQUFrQixFQUFFLENBQUM7UUFDN0YsTUFBTSxTQUFTLEdBQUcsa0JBQWtCLENBQUMsT0FBTyxDQUFDLFVBQW9CLENBQUMsSUFBSSxPQUFPLENBQUMsVUFBb0IsQ0FBQztRQUNuRyxNQUFNLE9BQU8sR0FBRyxPQUFPLENBQUMsMkJBQTJCLENBQUM7UUFFcEQsT0FBTztZQUNMLEtBQUssRUFBRSxVQUFVLEdBQUcsT0FBTyxDQUFDLElBQUk7WUFDaEMsT0FBTyxFQUFFLFFBQVE7WUFDakIsS0FBSyxFQUFFLGNBQWMsV0FBVyxLQUFLLE9BQU8sS0FBSyxTQUFTLEVBQUU7WUFDNUQsV0FBVyxFQUFFLEdBQUcsSUFBSSxDQUFDLGFBQWEsRUFBRTtZQUNwQyxJQUFJLEVBQUUsR0FBRyxTQUFTLGlCQUFpQixPQUFPLENBQUMsSUFBSSxFQUFFO1lBRWpELFdBQVcsRUFBRSxnQkFBZ0I7WUFDN0IsY0FBYyxFQUFFLENBQUM7WUFFakIsT0FBTyxFQUFFLEVBQUU7WUFDWCxRQUFRLEVBQUUsRUFBRTtTQUNiLENBQUM7SUFDSixDQUFDO0lBRUQsVUFBVSxDQUFDLE9BQWlCLEVBQUUsU0FBUyxHQUFHLEVBQUUsRUFBRSxTQUFTLEdBQUcsRUFBRSxFQUFFLFlBQXFCOztRQUNqRixNQUFNLFdBQVcsR0FBRyxJQUFJLElBQUksQ0FBQyxPQUFPLENBQUMsdUJBQWlDLENBQUMsQ0FBQyxrQkFBa0IsRUFBRSxDQUFDO1FBQzdGLE1BQU0sU0FBUyxHQUFHLGtCQUFrQixDQUFDLE9BQU8sQ0FBQyxVQUFvQixDQUFDLElBQUksT0FBTyxDQUFDLFVBQW9CLENBQUM7UUFDbkcsTUFBTSxPQUFPLEdBQUcsT0FBTyxDQUFDLDJCQUEyQixDQUFDO1FBRXBELE1BQU0sS0FBSyxHQUFHO1lBQ1osR0FBRyxPQUFPLENBQUMsVUFBc0I7WUFDakMsR0FBRyxDQUFDLE9BQU8sRUFBRSxDQUFDLGlCQUFpQixFQUFFLFVBQVUsRUFBRSxZQUFZLENBQUMsRUFBRSxFQUFFLENBQUM7U0FDaEUsQ0FBQztRQUNGLE1BQU0sV0FBVyxHQUFHLEtBQUssQ0FBQyxJQUFJLENBQUMsR0FBRyxDQUFDLENBQUMsV0FBVyxFQUFFLENBQUM7UUFFbEQsSUFBSSxVQUFrQixDQUFDO1FBQ3ZCLElBQUksU0FBUyxHQUFHLDhCQUE4QixDQUFDO1FBQy9DLElBQUksV0FBVyxDQUFDLE9BQU8sQ0FBQyxLQUFLLENBQUMsS0FBSyxDQUFDLENBQUMsRUFBRTtZQUNyQyxVQUFVLEdBQUcsS0FBSyxDQUFDO1lBQ25CLFNBQVMsR0FBRywrQkFBK0IsQ0FBQztTQUM3QzthQUFNLElBQUksV0FBVyxDQUFDLE9BQU8sQ0FBQyxJQUFJLENBQUMsS0FBSyxDQUFDLENBQUMsRUFBRTtZQUMzQyxVQUFVLEdBQUcsSUFBSSxDQUFDO1lBQ2xCLFNBQVMsR0FBRyxpQ0FBaUMsQ0FBQztTQUMvQzthQUFNLElBQUksV0FBVyxDQUFDLE9BQU8sQ0FBQyxPQUFPLENBQUMsS0FBSyxDQUFDLENBQUMsRUFBRTtZQUM5QyxVQUFVLEdBQUcsT0FBTyxDQUFDO1lBQ3JCLFNBQVMsR0FBRyxvQ0FBb0MsQ0FBQztTQUNsRDthQUFNLElBQUksV0FBVyxDQUFDLE9BQU8sQ0FBQyxLQUFLLENBQUMsS0FBSyxDQUFDLENBQUMsRUFBRTtZQUM1QyxVQUFVLEdBQUcsS0FBSyxDQUFDO1lBQ25CLFNBQVMsR0FBRyxrQ0FBa0MsQ0FBQztTQUNoRDthQUFNLElBQUksQ0FBQyxXQUFXLENBQUMsT0FBTyxDQUFDLElBQUksQ0FBQyxLQUFLLENBQUMsQ0FBQyxDQUFDLElBQUksQ0FBQyxXQUFXLENBQUMsT0FBTyxDQUFDLElBQUksQ0FBQyxLQUFLLENBQUMsQ0FBQyxDQUFDLEVBQUU7WUFDbkYsVUFBVSxHQUFHLElBQUksQ0FBQztZQUNsQixTQUFTLEdBQUcsOEJBQThCLENBQUM7U0FDNUM7YUFBTSxJQUFJLFdBQVcsQ0FBQyxPQUFPLENBQUMsT0FBTyxDQUFDLEtBQUssQ0FBQyxDQUFDLEVBQUU7WUFDOUMsVUFBVSxHQUFHLE9BQU8sQ0FBQztTQUN0QjthQUFNLElBQUksV0FBVyxDQUFDLE9BQU8sQ0FBQyxLQUFLLENBQUMsS0FBSyxDQUFDLENBQUMsRUFBRTtZQUM1QyxVQUFVLEdBQUcsS0FBSyxDQUFDO1NBQ3BCO2FBQU07WUFDTCxVQUFVLEdBQUcsT0FBTyxDQUFDO1NBQ3RCO1FBQ0QsU0FBUyxHQUFHLE1BQUEsSUFBSSxDQUFDLG1CQUFtQixDQUFDLE9BQU8sRUFBRSxTQUFTLEVBQUUsWUFBWSxDQUFDLG1DQUFJLFNBQVMsQ0FBQztRQUVwRixPQUFPO1lBQ0wsS0FBSyxFQUFFLFVBQVUsR0FBRyxPQUFPLENBQUMsSUFBSTtZQUNoQyxPQUFPLEVBQUUsU0FBUztZQUNsQixLQUFLLEVBQUUsY0FBYyxXQUFXLEtBQUssT0FBTyxLQUFLLFNBQVMsRUFBRTtZQUM1RCxXQUFXLEVBQUUscUJBQXFCLEtBQUssQ0FBQyxJQUFJLENBQUMsSUFBSSxDQUFDLEVBQUU7WUFDcEQsSUFBSSxFQUFFLEdBQUcsU0FBUyxrQkFBa0IsT0FBTyxDQUFDLElBQUksRUFBRTtZQUNsRCxVQUFVO1lBQ1YsU0FBUztTQUNWLENBQUM7SUFDSixDQUFDO0lBRUQsbUJBQW1CLENBQUMsT0FBaUIsRUFBRSxTQUFpQixFQUFFLFlBQXFCO1FBQzdFLElBQUksT0FBTyxDQUFDLGNBQWMsRUFBRTtZQUMxQixNQUFNLGFBQWEsR0FBRyxPQUFPLENBQUMsY0FBMEIsQ0FBQztZQUN6RCxPQUFPLEdBQUcsU0FBUyxJQUFJLGFBQWEsQ0FBQyxTQUFTLElBQUksYUFBYSxDQUFDLFFBQVEsRUFBRSxHQUFHLENBQUMsWUFBWSxDQUFDLENBQUMsQ0FBQyxVQUFVLFlBQVksRUFBRSxDQUFDLENBQUMsQ0FBQyxFQUFFLENBQUMsQ0FBQztTQUM3SDthQUFNLElBQUksT0FBTyxDQUFDLFVBQVUsS0FBSyxzQ0FBc0MsRUFBRSxFQUFFLGlCQUFpQjtZQUMzRixNQUFNLEtBQUssR0FBSSxHQUFHLENBQUMsT0FBTyxFQUFFLGdCQUFnQixFQUFFLEVBQUUsQ0FBNEI7aUJBQ3pFLE1BQU0sQ0FBQyxDQUFDLENBQUMsRUFBRSxDQUFDLHlCQUF5QixDQUFDLElBQUksQ0FBQyxDQUFDLENBQUMsUUFBUSxDQUFDLENBQUM7aUJBQ3ZELE1BQU0sQ0FBQyxDQUFDLENBQUMsRUFBRSxDQUFDLENBQUMsc0NBQXNDLENBQUMsSUFBSSxDQUFDLENBQUMsQ0FBQyxRQUFRLENBQUMsQ0FBQztpQkFDckUsTUFBTSxDQUFDLENBQUMsQ0FBQyxFQUFFLENBQUMsYUFBYSxDQUFDLEdBQUcsQ0FDNUIsQ0FBQyxDQUFDLFFBQVEsQ0FBQyxLQUFLLENBQUMsR0FBRyxDQUFDLENBQUMsS0FBSyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsS0FBSyxDQUFDLEdBQUcsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLE9BQU8sQ0FBQyxVQUFVLEVBQUUsZ0JBQWdCLENBQUMsQ0FDdkYsQ0FBQztpQkFDRCxHQUFHLENBQUMsQ0FBQyxDQUFDLEVBQUUsQ0FBQyxHQUFHLFNBQVMsSUFBSSxPQUFPLENBQUMsSUFBSSxJQUFJLENBQUMsQ0FBQyxRQUFRLEVBQUUsR0FBRyxDQUFDLFlBQVksQ0FBQyxDQUFDLENBQUMsVUFBVSxZQUFZLEVBQUUsQ0FBQyxDQUFDLENBQUMsRUFBRSxDQUFDLENBQUMsQ0FBQztZQUUzRyxJQUFJLEtBQUssQ0FBQyxNQUFNLEdBQUcsQ0FBQyxFQUFFO2dCQUNwQixNQUFNLEtBQUssR0FBRyxLQUFLLENBQUMsQ0FBQyxDQUFDLENBQUMsS0FBSyxDQUFDLEdBQUcsQ0FBQyxDQUFDLEtBQUssQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLEtBQUssQ0FBQyxHQUFHLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxPQUFPLENBQUMsVUFBVSxFQUFFLGdCQUFnQixDQUFDLENBQUM7Z0JBQ25HLElBQUksYUFBYSxDQUFDLEdBQUcsQ0FBQyxLQUFLLENBQUMsRUFBRTtvQkFDNUIsT0FBTyx3Q0FBd0MsS0FBSyxFQUFFLENBQUM7aUJBQ3hEO2FBQ0Y7U0FDRjthQUFNLElBQUksT0FBTyxDQUFDLFVBQVUsS0FBSyxzQ0FBc0MsRUFBRSxFQUFFLGNBQWM7WUFDeEYsTUFBTSxLQUFLLEdBQUcsVUFBVSxDQUFDLE9BQU8sQ0FBQyxTQUFtQixDQUFDLENBQUM7WUFDdEQsSUFBSSxLQUFLLEVBQUU7Z0JBQ1QsT0FBTyxpQ0FBaUMsS0FBSyxFQUFFLENBQUM7YUFDakQ7U0FDRjtRQUNELE9BQU8sU0FBUyxDQUFDO0lBQ25CLENBQUM7SUFFRCxRQUFRLENBQUMsS0FBZSxFQUFFLFNBQWlCO1FBQ3pDLE1BQU0sZ0JBQWdCLEdBQUcsQ0FBQyxLQUFLLENBQUMsV0FBcUIsSUFBSSxFQUFFLENBQUMsQ0FBQyxXQUFXLEVBQUUsQ0FBQztRQUMzRSxJQUFJLEdBQWtDLENBQUM7UUFDdkMsSUFBSSxnQkFBZ0IsQ0FBQyxRQUFRLENBQUMsUUFBUSxDQUFDLEVBQUU7WUFDdkMsR0FBRyxHQUFHLFFBQVEsQ0FBQztTQUNoQjthQUFNLElBQUksZ0JBQWdCLENBQUMsUUFBUSxDQUFDLE1BQU0sQ0FBQyxFQUFFO1lBQzVDLEdBQUcsR0FBRyxNQUFNLENBQUM7U0FDZDtRQUNELE1BQU0sUUFBUSxHQUFHLGdCQUFnQixDQUFDLEtBQUssQ0FBQyxjQUFjLENBQUMsQ0FBQztRQUN4RCxJQUFJLEdBQXVCLENBQUM7UUFDNUIsSUFBSSxRQUFRLEVBQUU7WUFDWixHQUFHLEdBQUcsUUFBUSxDQUFDLFFBQVEsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDO1NBQzdCO1FBQ0QsSUFBSSxHQUF1QixDQUFDO1FBQzVCLEtBQUssTUFBTSxFQUFFLElBQUksR0FBRyxDQUFDLEtBQUssRUFBRSwyQkFBMkIsRUFBRSxHQUFHLENBQUMsS0FBSyxFQUFFLDRCQUE0QixFQUFFLEVBQUUsQ0FBQyxDQUFlLEVBQUU7WUFDcEgsSUFBSSxFQUFFLENBQUMsY0FBYyxLQUFLLGlCQUFpQixJQUFJLEVBQUUsQ0FBQyxjQUFjLEtBQUssUUFBUSxFQUFFO2dCQUM3RSxHQUFHLEdBQUcsUUFBUSxDQUFDO2FBQ2hCO2lCQUFNLElBQUksRUFBRSxDQUFDLGNBQWMsS0FBSyxrQkFBa0IsSUFBSSxFQUFFLENBQUMsY0FBYyxLQUFLLE1BQU0sRUFBRTtnQkFDbkYsR0FBRyxHQUFHLE1BQU0sQ0FBQzthQUNkO2lCQUFNLElBQUksRUFBRSxDQUFDLGNBQWMsS0FBSywyQkFBMkIsSUFBSSxFQUFFLENBQUMsY0FBYyxLQUFLLEtBQUssRUFBRTtnQkFDM0YsR0FBRyxHQUFHLFFBQVEsQ0FBQyxFQUFFLENBQUMsVUFBVSxDQUFDLENBQUM7YUFDL0I7aUJBQU0sSUFBSSxFQUFFLENBQUMsY0FBYyxLQUFLLGlCQUFpQixFQUFFO2dCQUNsRCxHQUFHLEdBQUcsUUFBUSxDQUFDLEVBQUUsQ0FBQyxVQUFVLENBQUMsQ0FBQzthQUMvQjtTQUNGO1FBQ0QsSUFBSSxLQUFLLEdBQUcsRUFBRSxDQUFDO1FBQ2YsSUFBSSxHQUFHLElBQUksR0FBRyxFQUFFO1lBQ2QsS0FBSyxJQUFJLEdBQUcsR0FBRyxTQUFTLEdBQUcsRUFBRSxDQUFDO1lBQzlCLElBQUksR0FBRyxFQUFFO2dCQUNQLEtBQUssSUFBSSxTQUFTLEdBQUcsQ0FBQyxPQUFPLENBQUMsQ0FBQyxDQUFDLEVBQUUsQ0FBQzthQUNwQztTQUNGO1FBRUQsTUFBTSxXQUFXLEdBQUcsSUFBSSxJQUFJLENBQUMsS0FBSyxDQUFDLHVCQUFpQyxDQUFDLENBQUMsa0JBQWtCLEVBQUUsQ0FBQztRQUMzRixNQUFNLFNBQVMsR0FBRyxrQkFBa0IsQ0FBQyxLQUFLLENBQUMsVUFBb0IsQ0FBQyxJQUFJLEtBQUssQ0FBQyxVQUFvQixDQUFDO1FBQy9GLE1BQU0sT0FBTyxHQUFHLEtBQUssQ0FBQywyQkFBMkIsQ0FBQztRQUVsRCxPQUFPO1lBQ0wsS0FBSyxFQUFFLFVBQVUsR0FBRyxLQUFLLENBQUMsSUFBSTtZQUM5QixPQUFPLEVBQUUsT0FBTztZQUNoQixLQUFLO1lBQ0wsV0FBVyxFQUFFLFdBQVcsV0FBVyxLQUFLLE9BQU8sS0FBSyxTQUFTLEVBQUU7WUFDL0QsSUFBSSxFQUFFLEdBQUcsU0FBUyxnQkFBZ0IsS0FBSyxDQUFDLElBQUksRUFBRTtZQUU5QyxHQUFHO1lBQ0gsR0FBRztZQUNILEdBQUc7WUFFSCxlQUFlLEVBQUUsUUFBUTtZQUN6QixhQUFhLEVBQUUsU0FBUztZQUN4QixhQUFhLEVBQUUsS0FBSyxDQUFDLFVBQW9CO1lBRXpDLE9BQU8sRUFBRSxFQUFFO1NBQ1osQ0FBQztJQUNKLENBQUM7SUFFRCxjQUFjLENBQUMsSUFBYyxFQUFFLEtBQWdCOztRQUM3QyxJQUFJLGFBQW9DLENBQUM7UUFDekMsSUFBSSxXQUFXLEdBQUcsSUFBSSxDQUFDLFlBQXdCLENBQUM7UUFDaEQsSUFBSSxXQUFXLEVBQUU7WUFDZixpREFBaUQ7WUFDakQsSUFBSSxPQUFPLFdBQVcsS0FBSyxRQUFRLEVBQUU7Z0JBQ25DLFdBQVcsR0FBRyxJQUFJLENBQUMsS0FBSyxDQUFDLFdBQXFCLENBQWEsQ0FBQzthQUM3RDtZQUNELElBQUksV0FBVyxDQUFDLFlBQVksRUFBRSxFQUFFLGdDQUFnQztnQkFDOUQsT0FBTyxDQUFDLEdBQUcsQ0FBQyxvQ0FBb0MsRUFBRSxJQUFJLENBQUMsSUFBSSxDQUFDLENBQUM7YUFDOUQ7aUJBQU0sSUFBSyxXQUE0QyxDQUFDLEtBQUssQ0FBQyxFQUFFLEVBQUUsb0NBQW9DO2dCQUNyRyw4REFBOEQ7Z0JBQzlELGFBQWEsR0FBRyxXQUFtQyxDQUFDO2FBQ3JEO1NBQ0Y7UUFDRCxJQUFJLGFBQWEsRUFBRTtZQUNqQixvREFBb0Q7WUFDcEQsTUFBTSxNQUFNLEdBQVcsTUFBQSxHQUFHLENBQUMsYUFBYSxFQUFFLENBQUMsV0FBVyxFQUFFLFFBQVEsQ0FBQyxDQUFDLG1DQUFJLEVBQUUsQ0FBQztZQUN6RSxJQUFJLE1BQU0sQ0FBQyxVQUFVLENBQUMsK0NBQStDLENBQUMsRUFBRTtnQkFDdEUsSUFBSSxLQUFLLENBQUMsR0FBRyxLQUFLLE1BQU0sRUFBRTtvQkFDeEIsR0FBRyxDQUFDLGFBQWEsRUFBRSxDQUFDLFdBQVcsRUFBRSxRQUFRLENBQUMsRUFBRSxNQUFNLENBQUMsT0FBTyxDQUFDLGFBQWEsRUFBRSxjQUFjLENBQUMsQ0FBQyxDQUFDO2lCQUM1RjtxQkFBTTtvQkFDTCxHQUFHLENBQUMsYUFBYSxFQUFFLENBQUMsV0FBVyxFQUFFLFFBQVEsQ0FBQyxFQUFFLE1BQU0sQ0FBQyxPQUFPLENBQUMsYUFBYSxFQUFFLGNBQWMsQ0FBQyxDQUFDLENBQUM7aUJBQzVGO2FBQ0Y7aUJBQU0sSUFBSSxNQUFNLEtBQUssaURBQWlELElBQUksTUFBTSxLQUFLLGtEQUFrRCxFQUFFO2dCQUN4SSxJQUFJLEtBQUssQ0FBQyxHQUFHLEtBQUssTUFBTSxFQUFFO29CQUN4QixHQUFHLENBQUMsYUFBYSxFQUFFLENBQUMsV0FBVyxFQUFFLFFBQVEsQ0FBQyxFQUFFLE1BQU0sQ0FBQyxPQUFPLENBQUMsS0FBSyxFQUFFLE1BQU0sQ0FBQyxHQUFHLFFBQVEsQ0FBQyxDQUFDO2lCQUN2RjtxQkFBTTtvQkFDTCxHQUFHLENBQUMsYUFBYSxFQUFFLENBQUMsV0FBVyxFQUFFLFFBQVEsQ0FBQyxFQUFFLE1BQU0sQ0FBQyxPQUFPLENBQUMsS0FBSyxFQUFFLE1BQU0sQ0FBQyxHQUFHLFFBQVEsQ0FBQyxDQUFDO2lCQUN2RjthQUNGO1NBQ0Y7UUFDRCxPQUFPLGFBQWEsQ0FBQztJQUN2QixDQUFDO0lBRUQsY0FBYztRQUNaLE9BQU8sSUFBSSxtQkFBTSxJQUFJLEdBQUksQ0FBQyxNQUFNLEVBQUUsS0FBSyxFQUFFLE9BQU8sQ0FBQyxDQUF5QixDQUFDO0lBQzdFLENBQUM7SUFFRCxRQUFRO1FBQ04sdUNBQVksSUFBSSxDQUFDLEtBQUssS0FBRSxPQUFPLEVBQUUsQ0FBQyxJQUFJLENBQUMsY0FBYyxFQUFFLENBQUMsSUFBRztJQUM3RCxDQUFDO0NBQ0YiLCJzb3VyY2VzQ29udGVudCI6WyIvKiBlc2xpbnQtZGlzYWJsZSBAdHlwZXNjcmlwdC1lc2xpbnQvbmFtaW5nLWNvbnZlbnRpb24gKi9cbmltcG9ydCB7IEpzb25MZCwgSnNvbkxkT2JqIH0gZnJvbSAnanNvbmxkL2pzb25sZC1zcGVjJztcbmltcG9ydCB7IGdldCwgb21pdCwgc2V0LCB0b051bWJlciB9IGZyb20gJ2xvZGFzaCc7XG5cblxudHlwZSBKc29uRGljdCA9IFJlY29yZDxzdHJpbmcsIHVua25vd24+O1xuY29uc3QgSEJNX1BSRUZJWCA9ICdodHRwczovL2VudGl0eS5hcGkuaHVibWFwY29uc29ydGl1bS5vcmcvZW50aXRpZXMvJztcblxuLy8gZXNsaW50LWRpc2FibGUtbmV4dC1saW5lIG1heC1sZW5cbmV4cG9ydCBjb25zdCBEUjFfVlVfVEhVTUJTID0gbmV3IFNldChbJ1ZBTjAwMDMtTEstMzItMjEtQUZfcHJlSU1TX3JlZ2lzdGVyZWRfdGh1bWJuYWlsLmpwZycsICdWQU4wMDAzLUxLLTMyLTIxLUlNU19OZWdNb2RlX211bHRpbGF5ZXJfdGh1bWJuYWlsLmpwZycsICdWQU4wMDAzLUxLLTMyLTIxLUlNU19Qb3NNb2RlX211bHRpbGF5ZXJfdGh1bWJuYWlsLmpwZycsICdWQU4wMDAzLUxLLTMyLTIxLVBBU19yZWdpc3RlcmVkX3RodW1ibmFpbC5qcGcnLCAnVkFOMDAwMy1MSy0zMi0yMi1BRl9wcmVNeElGX3JlZ2lzdGVyZWRfdGh1bWJuYWlsLmpwZycsICdWQU4wMDAzLUxLLTMyLTIyLU14SUZfY3ljMV9yZWdpc3RlcmVkX3RodW1ibmFpbC5qcGcnLCAnVkFOMDAwMy1MSy0zMi0yMi1NeElGX2N5YzJfcmVnaXN0ZXJlZF90aHVtYm5haWwuanBnJywgJ1ZBTjAwMDMtTEstMzItMjItTXhJRl9jeWMzX3JlZ2lzdGVyZWRfdGh1bWJuYWlsLmpwZycsICdWQU4wMDA1LVJLLTEtMS1BRl9wcmVJTVNfcmVnaXN0ZXJlZF90aHVtYm5haWwuanBnJywgJ1ZBTjAwMDUtUkstMS0xLUlNU19OZWdNb2RlX211bHRpbGF5ZXJfdGh1bWJuYWlsLmpwZycsICdWQU4wMDA1LVJLLTEtMS1JTVNfUG9zTW9kZV9tdWx0aWxheWVyX3RodW1ibmFpbC5qcGcnLCAnVkFOMDAwNS1SSy0xLTEtUEFTX3JlZ2lzdGVyZWRfdGh1bWJuYWlsLmpwZycsICdWQU4wMDA1LVJLLTQtMTcyLUFGX3ByZUlNU19yZWdpc3RlcmVkX3RodW1ibmFpbC5qcGcnLCAnVkFOMDAwNS1SSy00LTE3Mi1JTVNfTmVnTW9kZV9tdWx0aWxheWVyX3RodW1ibmFpbC5qcGcnLCAnVkFOMDAwNS1SSy00LTE3Mi1JTVNfUG9zTW9kZV9tdWx0aWxheWVyX3RodW1ibmFpbC5qcGcnLCAnVkFOMDAwNS1SSy00LTE3Mi1QQVNfcmVnaXN0ZXJlZF90aHVtYm5haWwuanBnJywgJ1ZBTjAwMDYtTEstMi04NS1BRl9wcmVJTVNfcmVnaXN0ZXJlZF90aHVtYm5haWwuanBnJywgJ1ZBTjAwMDYtTEstMi04NS1JTVNfTmVnTW9kZV9tdWx0aWxheWVyX3RodW1ibmFpbC5qcGcnLCAnVkFOMDAwNi1MSy0yLTg1LUlNU19Qb3NNb2RlX211bHRpbGF5ZXJfdGh1bWJuYWlsLmpwZycsICdWQU4wMDA2LUxLLTItODUtUEFTX3JlZ2lzdGVyZWRfdGh1bWJuYWlsLmpwZycsICdWQU4wMDA2LUxLLTItODYtQUZfcHJlTXhJRl9yZWdpc3RlcmVkX3RodW1ibmFpbC5qcGcnLCAnVkFOMDAwNi1MSy0yLTg2LU14SUZfY3ljMV9yZWdpc3RlcmVkX3RodW1ibmFpbC5qcGcnLCAnVkFOMDAwNi1MSy0yLTg2LU14SUZfY3ljMl9yZWdpc3RlcmVkX3RodW1ibmFpbC5qcGcnLCAnVkFOMDAwNi1MSy0yLTg2LU14SUZfY3ljM19yZWdpc3RlcmVkX3RodW1ibmFpbC5qcGcnLCAnVkFOMDAwNy1MSy0yMDMtMTAzLUFGX3ByZUlNU19yZWdpc3RlcmVkX3RodW1ibmFpbC5qcGcnLCAnVkFOMDAwNy1MSy0yMDMtMTAzLUlNU19OZWdNb2RlX211bHRpbGF5ZXJfdGh1bWJuYWlsLmpwZycsICdWQU4wMDA3LUxLLTIwMy0xMDMtSU1TX1Bvc01vZGVfbXVsdGlsYXllcl90aHVtYm5haWwuanBnJywgJ1ZBTjAwMDctTEstMjAzLTEwMy1QQVNfcmVnaXN0ZXJlZF90aHVtYm5haWwuanBnJywgJ1ZBTjAwMDgtUkstNDAzLTEwMC1BRl9wcmVJTVNfcmVnaXN0ZXJlZF90aHVtYm5haWwuanBnJywgJ1ZBTjAwMDgtUkstNDAzLTEwMC1JTVNfTmVnTW9kZV9tdWx0aWxheWVyX3RodW1ibmFpbC5qcGcnLCAnVkFOMDAwOC1SSy00MDMtMTAwLUlNU19Qb3NNb2RlX211bHRpbGF5ZXJfdGh1bWJuYWlsLmpwZycsICdWQU4wMDA4LVJLLTQwMy0xMDAtUEFTX3JlZ2lzdGVyZWRfdGh1bWJuYWlsLmpwZycsICdWQU4wMDA4LVJLLTQwMy0xMDEtQUZfcHJlTXhJRl9yZWdpc3RlcmVkX3RodW1ibmFpbC5qcGcnLCAnVkFOMDAwOC1SSy00MDMtMTAxLU14SUZfY3ljMV9yZWdpc3RlcmVkX3RodW1ibmFpbC5qcGcnLCAnVkFOMDAwOC1SSy00MDMtMTAxLU14SUZfY3ljMl9yZWdpc3RlcmVkX3RodW1ibmFpbC5qcGcnLCAnVkFOMDAwOC1SSy00MDMtMTAxLU14SUZfY3ljM19yZWdpc3RlcmVkX3RodW1ibmFpbC5qcGcnLCAnVkFOMDAwOS1MSy0xMDItNy1BRl9wcmVJTVNfcmVnaXN0ZXJlZF90aHVtYm5haWwuanBnJywgJ1ZBTjAwMDktTEstMTAyLTctSU1TX05lZ01vZGVfbXVsdGlsYXllcl90aHVtYm5haWwuanBnJywgJ1ZBTjAwMDktTEstMTAyLTctSU1TX1Bvc01vZGVfbXVsdGlsYXllcl90aHVtYm5haWwuanBnJywgJ1ZBTjAwMDktTEstMTAyLTctUEFTX3JlZ2lzdGVyZWRfdGh1bWJuYWlsLmpwZycsICdWQU4wMDEwLUxLLTE1NS00MC1BRl9wcmVJTVNfcmVnaXN0ZXJlZF90aHVtYm5haWwuanBnJywgJ1ZBTjAwMTAtTEstMTU1LTQwLUlNU19OZWdNb2RlX211bHRpbGF5ZXJfdGh1bWJuYWlsLmpwZycsICdWQU4wMDEwLUxLLTE1NS00MC1JTVNfUG9zTW9kZV9tdWx0aWxheWVyX3RodW1ibmFpbC5qcGcnLCAnVkFOMDAxMC1MSy0xNTUtNDAtUEFTX3JlZ2lzdGVyZWRfdGh1bWJuYWlsLmpwZycsICdWQU4wMDExLVJLLTMtMTAtQUZfcHJlSU1TX3JlZ2lzdGVyZWRfdGh1bWJuYWlsLmpwZycsICdWQU4wMDExLVJLLTMtMTAtSU1TX05lZ01vZGVfbXVsdGlsYXllcl90aHVtYm5haWwuanBnJywgJ1ZBTjAwMTEtUkstMy0xMC1JTVNfUG9zTW9kZV9tdWx0aWxheWVyX3RodW1ibmFpbC5qcGcnLCAnVkFOMDAxMS1SSy0zLTEwLVBBU19yZWdpc3RlcmVkX3RodW1ibmFpbC5qcGcnLCAnVkFOMDAxMS1SSy0zLTExLUFGX3ByZU14SUZfcmVnaXN0ZXJlZF90aHVtYm5haWwuanBnJywgJ1ZBTjAwMTEtUkstMy0xMS1NeElGX2N5YzFfcmVnaXN0ZXJlZF90aHVtYm5haWwuanBnJywgJ1ZBTjAwMTEtUkstMy0xMS1NeElGX2N5YzJfcmVnaXN0ZXJlZF90aHVtYm5haWwuanBnJywgJ1ZBTjAwMTEtUkstMy0xMS1NeElGX2N5YzNfcmVnaXN0ZXJlZF90aHVtYm5haWwuanBnJywgJ1ZBTjAwMTItUkstMTAzLTc1LUFGX3ByZUlNU19yZWdpc3RlcmVkX3RodW1ibmFpbC5qcGcnLCAnVkFOMDAxMi1SSy0xMDMtNzUtSU1TX05lZ01vZGVfbXVsdGlsYXllcl90aHVtYm5haWwuanBnJywgJ1ZBTjAwMTItUkstMTAzLTc1LUlNU19Qb3NNb2RlX211bHRpbGF5ZXJfdGh1bWJuYWlsLmpwZycsICdWQU4wMDEyLVJLLTEwMy03NS1QQVNfcmVnaXN0ZXJlZF90aHVtYm5haWwuanBnJywgJ1ZBTjAwMTItUkstMTAzLTc2LUFGX3ByZU14SUZfcmVnaXN0ZXJlZF90aHVtYm5haWwuanBnJywgJ1ZBTjAwMTItUkstMTAzLTc2LU14SUZfY3ljMV9yZWdpc3RlcmVkX3RodW1ibmFpbC5qcGcnLCAnVkFOMDAxMi1SSy0xMDMtNzYtTXhJRl9jeWMyX3JlZ2lzdGVyZWRfdGh1bWJuYWlsLmpwZycsICdWQU4wMDEyLVJLLTEwMy03Ni1NeElGX2N5YzNfcmVnaXN0ZXJlZF90aHVtYm5haWwuanBnJywgJ1ZBTjAwMTMtTEstMjAyLTk2LUFGX3ByZUlNU19yZWdpc3RlcmVkX3RodW1ibmFpbC5qcGcnLCAnVkFOMDAxMy1MSy0yMDItOTYtSU1TX05lZ01vZGVfbXVsdGlsYXllcl90aHVtYm5haWwuanBnJywgJ1ZBTjAwMTMtTEstMjAyLTk2LUlNU19Qb3NNb2RlX211bHRpbGF5ZXJfdGh1bWJuYWlsLmpwZycsICdWQU4wMDEzLUxLLTIwMi05Ni1QQVNfcmVnaXN0ZXJlZF90aHVtYm5haWwuanBnJywgJ1ZBTjAwMTMtTEstMjAyLTk3LUFGX3ByZU14SUZfcmVnaXN0ZXJlZF90aHVtYm5haWwuanBnJywgJ1ZBTjAwMTMtTEstMjAyLTk3LU14SUZfY3ljMV9yZWdpc3RlcmVkX3RodW1ibmFpbC5qcGcnLCAnVkFOMDAxMy1MSy0yMDItOTctTXhJRl9jeWMyX3JlZ2lzdGVyZWRfdGh1bWJuYWlsLmpwZycsICdWQU4wMDEzLUxLLTIwMi05Ny1NeElGX2N5YzNfcmVnaXN0ZXJlZF90aHVtYm5haWwuanBnJywgJ1ZBTjAwMTQtTEstMjAzLTEwOC1BRl9wcmVJTVNfcmVnaXN0ZXJlZF90aHVtYm5haWwuanBnJywgJ1ZBTjAwMTQtTEstMjAzLTEwOC1JTVNfTmVnTW9kZV9tdWx0aWxheWVyX3RodW1ibmFpbC5qcGcnLCAnVkFOMDAxNC1MSy0yMDMtMTA4LUlNU19Qb3NNb2RlX211bHRpbGF5ZXJfdGh1bWJuYWlsLmpwZycsICdWQU4wMDE0LUxLLTIwMy0xMDgtUEFTX3JlZ2lzdGVyZWRfdGh1bWJuYWlsLmpwZycsICdWQU4wMDE2LUxLLTIwMi04OS1BRl9wcmVJTVNfcmVnaXN0ZXJlZF90aHVtYm5haWwuanBnJywgJ1ZBTjAwMTYtTEstMjAyLTg5LUlNU19OZWdNb2RlX211bHRpbGF5ZXJfdGh1bWJuYWlsLmpwZycsICdWQU4wMDE2LUxLLTIwMi04OS1JTVNfUG9zTW9kZV9tdWx0aWxheWVyX3RodW1ibmFpbC5qcGcnLCAnVkFOMDAxNi1MSy0yMDItODktUEFTX3JlZ2lzdGVyZWRfdGh1bWJuYWlsLmpwZycsICdWQU4wMDAzLUxLLTMyLTIxLUFGX3ByZUlNU19yZWdpc3RlcmVkX3RodW1ibmFpbC5qcGcnLCAnVkFOMDAwMy1MSy0zMi0yMS1JTVNfTmVnTW9kZV9tdWx0aWxheWVyX3RodW1ibmFpbC5qcGcnLCAnVkFOMDAwMy1MSy0zMi0yMS1JTVNfUG9zTW9kZV9tdWx0aWxheWVyX3RodW1ibmFpbC5qcGcnLCAnVkFOMDAwMy1MSy0zMi0yMS1QQVNfcmVnaXN0ZXJlZF90aHVtYm5haWwuanBnJywgJ1ZBTjAwMDMtTEstMzItMjItQUZfcHJlTXhJRl9yZWdpc3RlcmVkX3RodW1ibmFpbC5qcGcnLCAnVkFOMDAwMy1MSy0zMi0yMi1NeElGX2N5YzFfcmVnaXN0ZXJlZF90aHVtYm5haWwuanBnJywgJ1ZBTjAwMDMtTEstMzItMjItTXhJRl9jeWMyX3JlZ2lzdGVyZWRfdGh1bWJuYWlsLmpwZycsICdWQU4wMDAzLUxLLTMyLTIyLU14SUZfY3ljM19yZWdpc3RlcmVkX3RodW1ibmFpbC5qcGcnLCAnVkFOMDAwNS1SSy0xLTEtQUZfcHJlSU1TX3JlZ2lzdGVyZWRfdGh1bWJuYWlsLmpwZycsICdWQU4wMDA1LVJLLTEtMS1JTVNfTmVnTW9kZV9tdWx0aWxheWVyX3RodW1ibmFpbC5qcGcnLCAnVkFOMDAwNS1SSy0xLTEtSU1TX1Bvc01vZGVfbXVsdGlsYXllcl90aHVtYm5haWwuanBnJywgJ1ZBTjAwMDUtUkstMS0xLVBBU19yZWdpc3RlcmVkX3RodW1ibmFpbC5qcGcnLCAnVkFOMDAwNS1SSy00LTE3Mi1BRl9wcmVJTVNfcmVnaXN0ZXJlZF90aHVtYm5haWwuanBnJywgJ1ZBTjAwMDUtUkstNC0xNzItSU1TX05lZ01vZGVfbXVsdGlsYXllcl90aHVtYm5haWwuanBnJywgJ1ZBTjAwMDUtUkstNC0xNzItSU1TX1Bvc01vZGVfbXVsdGlsYXllcl90aHVtYm5haWwuanBnJywgJ1ZBTjAwMDUtUkstNC0xNzItUEFTX3JlZ2lzdGVyZWRfdGh1bWJuYWlsLmpwZycsICdWQU4wMDA2LUxLLTItODUtQUZfcHJlSU1TX3JlZ2lzdGVyZWRfdGh1bWJuYWlsLmpwZycsICdWQU4wMDA2LUxLLTItODUtSU1TX05lZ01vZGVfbXVsdGlsYXllcl90aHVtYm5haWwuanBnJywgJ1ZBTjAwMDYtTEstMi04NS1JTVNfUG9zTW9kZV9tdWx0aWxheWVyX3RodW1ibmFpbC5qcGcnLCAnVkFOMDAwNi1MSy0yLTg1LVBBU19yZWdpc3RlcmVkX3RodW1ibmFpbC5qcGcnLCAnVkFOMDAwNi1MSy0yLTg2LUFGX3ByZU14SUZfcmVnaXN0ZXJlZF90aHVtYm5haWwuanBnJywgJ1ZBTjAwMDYtTEstMi04Ni1NeElGX2N5YzFfcmVnaXN0ZXJlZF90aHVtYm5haWwuanBnJywgJ1ZBTjAwMDYtTEstMi04Ni1NeElGX2N5YzJfcmVnaXN0ZXJlZF90aHVtYm5haWwuanBnJywgJ1ZBTjAwMDYtTEstMi04Ni1NeElGX2N5YzNfcmVnaXN0ZXJlZF90aHVtYm5haWwuanBnJywgJ1ZBTjAwMDctTEstMjAzLTEwMy1BRl9wcmVJTVNfcmVnaXN0ZXJlZF90aHVtYm5haWwuanBnJywgJ1ZBTjAwMDctTEstMjAzLTEwMy1JTVNfTmVnTW9kZV9tdWx0aWxheWVyX3RodW1ibmFpbC5qcGcnLCAnVkFOMDAwNy1MSy0yMDMtMTAzLUlNU19Qb3NNb2RlX211bHRpbGF5ZXJfdGh1bWJuYWlsLmpwZycsICdWQU4wMDA3LUxLLTIwMy0xMDMtUEFTX3JlZ2lzdGVyZWRfdGh1bWJuYWlsLmpwZycsICdWQU4wMDA4LVJLLTQwMy0xMDAtQUZfcHJlSU1TX3JlZ2lzdGVyZWRfdGh1bWJuYWlsLmpwZycsICdWQU4wMDA4LVJLLTQwMy0xMDAtSU1TX05lZ01vZGVfbXVsdGlsYXllcl90aHVtYm5haWwuanBnJywgJ1ZBTjAwMDgtUkstNDAzLTEwMC1JTVNfUG9zTW9kZV9tdWx0aWxheWVyX3RodW1ibmFpbC5qcGcnLCAnVkFOMDAwOC1SSy00MDMtMTAwLVBBU19yZWdpc3RlcmVkX3RodW1ibmFpbC5qcGcnLCAnVkFOMDAwOC1SSy00MDMtMTAxLUFGX3ByZU14SUZfcmVnaXN0ZXJlZF90aHVtYm5haWwuanBnJywgJ1ZBTjAwMDgtUkstNDAzLTEwMS1NeElGX2N5YzFfcmVnaXN0ZXJlZF90aHVtYm5haWwuanBnJywgJ1ZBTjAwMDgtUkstNDAzLTEwMS1NeElGX2N5YzJfcmVnaXN0ZXJlZF90aHVtYm5haWwuanBnJywgJ1ZBTjAwMDgtUkstNDAzLTEwMS1NeElGX2N5YzNfcmVnaXN0ZXJlZF90aHVtYm5haWwuanBnJywgJ1ZBTjAwMTEtUkstMy0xMC1BRl9wcmVJTVNfcmVnaXN0ZXJlZF90aHVtYm5haWwuanBnJywgJ1ZBTjAwMTEtUkstMy0xMC1JTVNfTmVnTW9kZV9tdWx0aWxheWVyX3RodW1ibmFpbC5qcGcnLCAnVkFOMDAxMS1SSy0zLTEwLUlNU19Qb3NNb2RlX211bHRpbGF5ZXJfdGh1bWJuYWlsLmpwZycsICdWQU4wMDExLVJLLTMtMTAtUEFTX3JlZ2lzdGVyZWRfdGh1bWJuYWlsLmpwZycsICdWQU4wMDExLVJLLTMtMTEtQUZfcHJlTXhJRl9yZWdpc3RlcmVkX3RodW1ibmFpbC5qcGcnLCAnVkFOMDAxMS1SSy0zLTExLU14SUZfY3ljMV9yZWdpc3RlcmVkX3RodW1ibmFpbC5qcGcnLCAnVkFOMDAxMS1SSy0zLTExLU14SUZfY3ljMl9yZWdpc3RlcmVkX3RodW1ibmFpbC5qcGcnLCAnVkFOMDAxMS1SSy0zLTExLU14SUZfY3ljM19yZWdpc3RlcmVkX3RodW1ibmFpbC5qcGcnLCAnVkFOMDAxMi1SSy0xMDMtNzUtQUZfcHJlSU1TX3JlZ2lzdGVyZWRfdGh1bWJuYWlsLmpwZycsICdWQU4wMDEyLVJLLTEwMy03NS1JTVNfTmVnTW9kZV9tdWx0aWxheWVyX3RodW1ibmFpbC5qcGcnLCAnVkFOMDAxMi1SSy0xMDMtNzUtSU1TX1Bvc01vZGVfbXVsdGlsYXllcl90aHVtYm5haWwuanBnJywgJ1ZBTjAwMTItUkstMTAzLTc1LVBBU19yZWdpc3RlcmVkX3RodW1ibmFpbC5qcGcnLCAnVkFOMDAxMi1SSy0xMDMtNzYtQUZfcHJlTXhJRl9yZWdpc3RlcmVkX3RodW1ibmFpbC5qcGcnLCAnVkFOMDAxMi1SSy0xMDMtNzYtTXhJRl9jeWMxX3JlZ2lzdGVyZWRfdGh1bWJuYWlsLmpwZycsICdWQU4wMDEyLVJLLTEwMy03Ni1NeElGX2N5YzJfcmVnaXN0ZXJlZF90aHVtYm5haWwuanBnJywgJ1ZBTjAwMTItUkstMTAzLTc2LU14SUZfY3ljM19yZWdpc3RlcmVkX3RodW1ibmFpbC5qcGcnXSk7XG4vLyBlc2xpbnQtZGlzYWJsZS1uZXh0LWxpbmUgbWF4LWxlblxuZXhwb3J0IGNvbnN0IFVGTF9USFVNQlMgPSB7ICdIQk01NTguU1JaRy42MjknOiAnSEJNNTU4LlNSWkcuNjI5X1VGTDAwMDItU1AtMy00LTEuanBnJywgJ0hCTTU2Mi5OVE1ILjU0OCc6ICdIQk01NjIuTlRNSC41NDhfVUZMMDAwNi1TUC0xLTItMS5qcGcnLCAnSEJNNjg1LktIUlEuNjg0JzogJ0hCTTY4NS5LSFJRLjY4NF9VRkwwMDA4LUxZMDctMS0xLmpwZycsICdIQk0yNzguU0ZRVy42MjcnOiAnSEJNMjc4LlNGUVcuNjI3X1VGTDAwMDgtTFkwOS0xLTEuanBnJywgJ0hCTTQyNy5TTUdCLjg2Nic6ICdIQk00MjcuU01HQi44NjZfVUZMMDAwNC1TUC0xLTQtMS5qcGcnLCAnSEJNNDMyLkxMQ0YuNjc3JzogJ0hCTTQzMi5MTENGLjY3N19VRkwwMDAxLVNQLTItNS0xLmpwZycsICdIQk01ODYuWlNWUy45OTYnOiAnSEJNNTg2LlpTVlMuOTk2X1VGTDAwMDgtU1AtMS0xLTEuanBnJywgJ0hCTTI4NS5YTUJULjU0Mic6ICdIQk0yODUuWE1CVC41NDJfVUZMMDAwNi1USC0xLTMtMS5qcGcnLCAnSEJNMjg5LkJXSlcuNjYzJzogJ0hCTTI4OS5CV0pXLjY2M19VRkwwMDA2LVRILTEtMi0xLmpwZycsICdIQk0yNTUuU1JQUi45ODUnOiAnSEJNMjU1LlNSUFIuOTg1X1VGTDAwMDUtVEgtMi0yLTEuanBnJywgJ0hCTTc5OS5XWEhELjUzNSc6ICdIQk03OTkuV1hIRC41MzVfVUZMMDAwOS1MWTAyLTEtMS5qcGcnLCAnSEJNMjk0LlJaRk4uNjI0JzogJ0hCTTI5NC5SWkZOLjYyNF9VRkwwMDA1LVRILTEtMS0xLmpwZycsICdIQk0zODMuVFJRRy40MjQnOiAnSEJNMzgzLlRSUUcuNDI0X1VGTDAwMDYtU1AtMS0zLTEuanBnJywgJ0hCTTY0Ny5NRlFCLjQ5Nic6ICdIQk02NDcuTUZRQi40OTZfVUZMMDAwMS1TUC0xLTItMS5qcGcnLCAnSEJNMjM3LkdHUFIuNzM5JzogJ0hCTTIzNy5HR1BSLjczOV9VRkwwMDA2LUxZMDEtMS0xLmpwZycsICdIQk0yODguVFBCRC42NTQnOiAnSEJNMjg4LlRQQkQuNjU0X1VGTDAwMDMtU1AtMi0yLTEuanBnJywgJ0hCTTk3NC5ORFhULjY3NSc6ICdIQk05NzQuTkRYVC42NzVfVUZMMDAwOC1USC0yLTItMS5qcGcnLCAnSEJNNTg5LlNMVlYuNDIzJzogJ0hCTTU4OS5TTFZWLjQyM19VRkwwMDA4LUxZMTAtMS0xLmpwZycsICdIQk03OTQuUkxGTi4zNTgnOiAnSEJNNzk0LlJMRk4uMzU4X1VGTDAwMDYtTFkwMy0xLTEuanBnJywgJ0hCTTM3Mi5CUVNSLjc3OCc6ICdIQk0zNzIuQlFTUi43NzhfVUZMMDAwNy1TUC0xLTEtMS5qcGcnLCAnSEJNNDk5LlRLRFcuNDU4JzogJ0hCTTQ5OS5US0RXLjQ1OF9VRkwwMDA5LUxZMDMtMS0xLmpwZycsICdIQk0zNDIuUFJRQi43MzknOiAnSEJNMzQyLlBSUUIuNzM5X1VGTDAwMDMtTFkwNi0xLTEuanBnJywgJ0hCTTYzMy5DTFZOLjY3NCc6ICdIQk02MzMuQ0xWTi42NzRfVUZMMDAwMy1TUC0zLTYtMS5qcGcnLCAnSEJNMzQzLkpRS00uNTc4JzogJ0hCTTM0My5KUUtNLjU3OF9VRkwwMDA5LUxZMDEtMS0xLmpwZycsICdIQk05ODcuWEdUSC4zNjgnOiAnSEJNOTg3LlhHVEguMzY4X1VGTDAwMDItU1AtMi00LTEuanBnJywgJ0hCTTk2NC5DV0NQLjc4OCc6ICdIQk05NjQuQ1dDUC43ODhfVUZMMDAwNi1MWTAyLTItMS5qcGcnLCAnSEJNMjQ0LlRKTEsuMjIzJzogJ0hCTTI0NC5USkxLLjIyM19VRkwwMDAzLVNQLTEtNC0xLmpwZycsICdIQk02NDYuRlNCUS45NjYnOiAnSEJNNjQ2LkZTQlEuOTY2X1VGTDAwMDctU1AtMi0yLTEuanBnJywgJ0hCTTU3Mi5HWFNCLjIzNCc6ICdIQk01NzIuR1hTQi4yMzRfVUZMMDAwMy1TUC0zLTItMS5qcGcnLCAnSEJNNzcyLlRLR0ouNzk0JzogJ0hCTTc3Mi5US0dKLjc5NF9VRkwwMDA4LVNQLTItMS0xLmpwZycsICdIQk0yMzkuQ0JXUi4yNjMnOiAnSEJNMjM5LkNCV1IuMjYzX1VGTDAwMDgtU1AtMS0yLTEuanBnJywgJ0hCTTk5Mi5OUlRULjM4Myc6ICdIQk05OTIuTlJUVC4zODNfVUZMMDAwNi1TUC0xLTEtMS5qcGcnLCAnSEJNMjgzLkRRWEQuNTQ2JzogJ0hCTTI4My5EUVhELjU0Nl9VRkwwMDAzLVNQLTEtMi0xLmpwZycsICdIQk03OTUuSkhORC44NTYnOiAnSEJNNzk1LkpITkQuODU2X1VGTDAwMDctU1AtMS0yLTEuanBnJywgJ0hCTTI2Ny5CWktULjg2Nyc6ICdIQk0yNjcuQlpLVC44NjdfVUZMMDAwMy1TUC0yLTYtMS5qcGcnLCAnSEJNODM4LkRMTUouNzgyJzogJ0hCTTgzOC5ETE1KLjc4Ml9VRkwwMDA4LVRILTEtMS0xLmpwZycsICdIQk0zMzcuRlNYTC41NjQnOiAnSEJNMzM3LkZTWEwuNTY0X1VGTDAwMDEtU1AtMy04LTIuanBnJywgJ0hCTTM1NS5KRExLLjI0NCc6ICdIQk0zNTUuSkRMSy4yNDRfVUZMMDAwNC1TUC0yLTQtMS5qcGcnLCAnSEJNNTk5LlBTWkcuNzM3JzogJ0hCTTU5OS5QU1pHLjczN19VRkwwMDA2LUxZMDItMS0xLmpwZycgfTtcblxuLyoqIFVVSUQgdG8gVE1DIG1hcHBpbmcuICovXG5jb25zdCBHUk9VUF9VVUlEX01BUFBJTkc6IHsgW3V1aWQ6IHN0cmluZ106IHN0cmluZyB9ID0ge1xuICAnMDNiM2Q4NTQtZWQ0NC0xMWU4LThiY2UtMGUzNjhmMzA3NWU4JzogJ1RNQy1VQ1NEJyxcbiAgJzA3YTI5ZTRjLWVkNDMtMTFlOC1iNTZhLTBlODAxN2JkZGE1OCc6ICdUTUMtRmxvcmlkYScsXG4gICczMDhmNWZmYy1lZDQzLTExZTgtYjU2YS0wZTgwMTdiZGRhNTgnOiAnVE1DLUNhbFRlY2gnLFxuICAnNWJkMDg0YzgtZWRjMi0xMWU4LTgwMmYtMGUzNjhmMzA3NWU4JzogJ0hCTS1UZXN0aW5nR3JvdXAnLFxuICAnNzNiYjI2ZTQtZWQ0My0xMWU4LThmMTktMGE3YzFlYWIwMDdhJzogJ1RNQy1WYW5kZXJiaWx0JyxcbiAgJ2RlZjVmZDc2LWVkNDMtMTFlOC1iNTZhLTBlODAxN2JkZGE1OCc6ICdUTUMtU3RhbmZvcmQnLFxuICAnNWMxMDZmMjktZWEyZC0xMWU5LTg1ZTgtMGVmYjNiYTlhNjcwJzogJ1JUSS1HZW5lcmFsIEVsZWN0cmljJyxcbiAgJzMwMTYxNWY5LWM4NzAtMTFlYi1hOGRjLTM1Y2UzZDg3ODZmZSc6ICdUTUMtVUNvbm4nXG59O1xuXG5jb25zdCBFTlRJVFlfQ09OVEVYVCA9IHtcbiAgJ0BiYXNlJzogJ2h0dHA6Ly9wdXJsLm9yZy9jY2YvbGF0ZXN0L2NjZi1lbnRpdHkub3dsIycsXG4gICdAdm9jYWInOiAnaHR0cDovL3B1cmwub3JnL2NjZi9sYXRlc3QvY2NmLWVudGl0eS5vd2wjJyxcbiAgY2NmOiAnaHR0cDovL3B1cmwub3JnL2NjZi8nLFxuICByZGZzOiAnaHR0cDovL3d3dy53My5vcmcvMjAwMC8wMS9yZGYtc2NoZW1hIycsXG5cbiAgbGFiZWw6ICdyZGZzOmxhYmVsJyxcbiAgZGVzY3JpcHRpb246ICdyZGZzOmNvbW1lbnQnLFxuICBsaW5rOiB7XG4gICAgJ0BpZCc6ICdyZGZzOnNlZUFsc28nLFxuICAgICdAdHlwZSc6ICdAaWQnXG4gIH0sXG4gIHNhbXBsZXM6IHtcbiAgICAnQHJldmVyc2UnOiAnaGFzX2Rvbm9yJ1xuICB9LFxuICBzZWN0aW9uczoge1xuICAgICdAaWQnOiAnaGFzX3Rpc3N1ZV9zZWN0aW9uJyxcbiAgICAnQHR5cGUnOiAnQGlkJ1xuICB9LFxuICBkYXRhc2V0czoge1xuICAgICdAaWQnOiAnaGFzX2RhdGFzZXQnLFxuICAgICdAdHlwZSc6ICdAaWQnXG4gIH0sXG4gIC8vIGVzbGludC1kaXNhYmxlLW5leHQtbGluZSBAdHlwZXNjcmlwdC1lc2xpbnQvbmFtaW5nLWNvbnZlbnRpb25cbiAgcnVpX2xvY2F0aW9uOiB7XG4gICAgJ0BpZCc6ICdoYXNfc3BhdGlhbF9lbnRpdHknLFxuICAgICdAdHlwZSc6ICdAaWQnXG4gIH0sXG4gIG9udG9sb2d5VGVybXM6IHtcbiAgICAnQGlkJzogJ2hhc19vbnRvbG9neV90ZXJtJyxcbiAgICAnQHR5cGUnOiAnQGlkJ1xuICB9LFxuICBjZWxsVHlwZVRlcm1zOiB7XG4gICAgJ0BpZCc6ICdoYXNfY2VsbF90eXBlX3Rlcm0nLFxuICAgICdAdHlwZSc6ICdAaWQnXG4gIH0sXG4gIHRodW1ibmFpbDoge1xuICAgICdAaWQnOiAnaGFzX3RodW1ibmFpbCdcbiAgfVxufTtcblxuLyoqXG4gKiBDb252ZXJ0cyBhIGh1Ym1hcCByZXNwb25zZSBvYmplY3QgaW50byBKc29uTGQuXG4gKlxuICogQHBhcmFtIGRhdGEgVGhlIGh1Ym1hcCBkYXRhLlxuICogQHJldHVybnMgVGhlIGNvbnZlcnRlZCBkYXRhLlxuICovXG5leHBvcnQgZnVuY3Rpb24gaHVibWFwUmVzcG9uc2VBc0pzb25MZChkYXRhOiB1bmtub3duLCBhc3NldHNBcGkgPSAnJywgcG9ydGFsVXJsID0gJycsIHNlcnZpY2VUb2tlbj86IHN0cmluZywgZGVidWcgPSBmYWxzZSk6IEpzb25MZCB7XG4gIGNvbnN0IGVudHJpZXMgPSAoZ2V0KGRhdGEsICdoaXRzLmhpdHMnLCBbXSkgYXMgSnNvbkRpY3RbXSlcbiAgICAubWFwKGUgPT4gZ2V0KGUsICdfc291cmNlJywge30pIGFzIEpzb25EaWN0KVxuICAgIC5zb3J0KChhLCBiKSA9PiAoYVsndXVpZCddIGFzIHN0cmluZykubG9jYWxlQ29tcGFyZShiWyd1dWlkJ10gYXMgc3RyaW5nKSk7XG5cbiAgY29uc3QgZG9ub3JMb29rdXA6IFJlY29yZDxzdHJpbmcsIEpzb25MZE9iaj4gPSB7fTtcbiAgY29uc3QgdW5mbGF0dGVuZWQ6IEpzb25MZE9ialtdID0gZW50cmllcy5tYXAoZSA9PlxuICAgIG5ldyBIdUJNQVBUaXNzdWVCbG9jayhlLCBhc3NldHNBcGksIHBvcnRhbFVybCwgc2VydmljZVRva2VuKS50b0pzb25MZCgpXG4gICk7XG4gIGZvciAoY29uc3QgZG9ub3Igb2YgdW5mbGF0dGVuZWQpIHtcbiAgICBjb25zdCBkb25vcklkID0gZG9ub3JbJ0BpZCddIGFzIHN0cmluZztcbiAgICBpZiAoIWRvbm9yTG9va3VwW2Rvbm9ySWRdKSB7XG4gICAgICBkb25vckxvb2t1cFtkb25vcklkXSA9IGRvbm9yO1xuICAgIH0gZWxzZSB7XG4gICAgICBjb25zdCBzYW1wbGVzID0gZG9ub3JMb29rdXBbZG9ub3JJZF0uc2FtcGxlcyBhcyBKc29uTGRPYmpbXTtcbiAgICAgIHNhbXBsZXMucHVzaCgoZG9ub3Iuc2FtcGxlcyBhcyBKc29uTGRPYmpbXSlbMF0pO1xuICAgIH1cbiAgfVxuICBjb25zdCBkb25vcnMgPSBPYmplY3QudmFsdWVzKGRvbm9yTG9va3VwKTtcblxuICBpZiAoZGVidWcpIHtcbiAgICBkZWJ1Z0Rvbm9ycyhkb25vcnMpO1xuICAgIGNvbnNvbGUubG9nKGRvbm9ycy5tYXAoZCA9PiAoeyAnQGNvbnRleHQnOiBFTlRJVFlfQ09OVEVYVCwgLi4uZCB9KSkpO1xuICB9XG5cbiAgcmV0dXJuIHsgJ0Bjb250ZXh0JzogRU5USVRZX0NPTlRFWFQsICdAZ3JhcGgnOiBkb25vcnMgfTtcbn1cblxuZnVuY3Rpb24gZGVidWdEb25vcnMoZG9ub3JzOiBKc29uTGRPYmpbXSkge1xuICBsZXQgZGF0YXNldHM6IEpzb25MZE9ialtdID0gW107XG4gIGxldCBkZWxldGVkID0gMDtcbiAgZm9yIChjb25zdCBkb25vciBvZiBkb25vcnMuZmlsdGVyKGQgPT4gKGQuc2FtcGxlcyBhcyBbXSkubGVuZ3RoID4gMSkpIHtcbiAgICBjb25zdCBzYW1wbGVzID0gZG9ub3Iuc2FtcGxlcyBhcyBKc29uTGRPYmpbXTtcbiAgICBmb3IgKGxldCBpPTA7IGkgPCBzYW1wbGVzLmxlbmd0aDsgaSsrKSB7XG4gICAgICBjb25zdCBibG9ja0lkID0gc2FtcGxlc1tpXVsnQGlkJ10gYXMgc3RyaW5nO1xuICAgICAgZGF0YXNldHMgPSBkYXRhc2V0cy5jb25jYXQoc2FtcGxlc1tpXS5kYXRhc2V0cyBhcyBKc29uTGRPYmpbXSk7XG4gICAgICBmb3IgKGNvbnN0IHNlY3Rpb24gb2Ygc2FtcGxlc1tpXS5zZWN0aW9ucyBhcyBKc29uTGRPYmpbXSkge1xuICAgICAgICBkYXRhc2V0cyA9IGRhdGFzZXRzLmNvbmNhdChzZWN0aW9uLmRhdGFzZXRzIGFzIEpzb25MZE9ialtdKTtcbiAgICAgIH1cbiAgICAgIGZvciAobGV0IGo9aSsxOyBqIDwgc2FtcGxlcy5sZW5ndGg7IGorKykge1xuICAgICAgICBjb25zdCBzZWN0aW9ucyA9IHNhbXBsZXNbal0uc2VjdGlvbnMgYXMgSnNvbkxkT2JqW107XG4gICAgICAgIGlmIChzZWN0aW9ucy5maW5kKHMgPT4gc1snQGlkJ10gPT09IGJsb2NrSWQpKSB7XG4gICAgICAgICAgc2FtcGxlc1tpXS5kZWxldGVNZSA9IHRydWU7XG4gICAgICAgICAgZGVsZXRlZCsrO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgfVxuICAgIGRvbm9yLnNhbXBsZXMgPSBzYW1wbGVzLmZpbHRlcihzID0+IHMuZGVsZXRlTWUgIT09IHRydWUpO1xuICB9XG4gIGlmIChkZWxldGVkID4gMCkge1xuICAgIGNvbnNvbGUubG9nKGDimqAgJHtkZWxldGVkfSBzZWN0aW9ucyBpZGVudGlmaWVkIGFzIGJsb2Nrc2ApO1xuICB9XG59XG5cbmV4cG9ydCBjbGFzcyBIdUJNQVBUaXNzdWVCbG9jayB7XG4gIGJhZCA9IGZhbHNlO1xuICBkb25vcjogSnNvbkxkT2JqO1xuXG4gICdAaWQnOiBzdHJpbmc7XG4gICdAdHlwZScgPSAnU2FtcGxlJztcbiAgbGFiZWw6IHN0cmluZztcbiAgZGVzY3JpcHRpb246IHN0cmluZztcbiAgbGluazogc3RyaW5nO1xuXG4gIHNhbXBsZV90eXBlID0gJ1Rpc3N1ZSBCbG9jayc7XG4gIHNlY3Rpb25fY291bnQ6IG51bWJlcjtcbiAgc2VjdGlvbl9zaXplOiBudW1iZXI7XG4gIHNlY3Rpb25fdW5pdHM6IHN0cmluZztcblxuICBydWlfbG9jYXRpb246IEpzb25MZE9iajtcbiAgc2VjdGlvbnM6IEpzb25MZE9ialtdO1xuICBkYXRhc2V0czogSnNvbkxkT2JqW107XG5cbiAgY29uc3RydWN0b3IocHVibGljIGRhdGE6IEpzb25EaWN0LCBhc3NldHNBcGkgPSAnJywgcG9ydGFsVXJsID0gJycsIHNlcnZpY2VUb2tlbj86IHN0cmluZykge1xuICAgIGNvbnN0IGVudGl0eVR5cGUgPSB0aGlzLmRhdGEuZW50aXR5X3R5cGU7XG4gICAgaWYgKGVudGl0eVR5cGUgIT09ICdTYW1wbGUnKSB7XG4gICAgICB0aGlzLmJhZCA9IHRydWU7XG4gICAgICByZXR1cm47XG4gICAgfVxuICAgIGNvbnN0IGFuY2VzdG9ycyA9ICh0aGlzLmRhdGEuYW5jZXN0b3JzIHx8IFtdKSBhcyBKc29uRGljdFtdO1xuICAgIGNvbnN0IGRlc2NlbmRhbnRzID0gKHRoaXMuZGF0YS5kZXNjZW5kYW50cyB8fCBbXSkgYXMgSnNvbkRpY3RbXTtcblxuICAgIGNvbnN0IGRvbm9yID0gYW5jZXN0b3JzLmZpbmQoZSA9PiBlLmVudGl0eV90eXBlID09PSAnRG9ub3InKSBhcyBKc29uRGljdDtcbiAgICB0aGlzLmRvbm9yID0gdGhpcy5nZXREb25vcihkb25vciwgcG9ydGFsVXJsKTtcbiAgICBjb25zdCBydWlMb2NhdGlvbiA9IHRoaXMuZ2V0UnVpTG9jYXRpb24oZGF0YSwgdGhpcy5kb25vcik7XG4gICAgaWYgKCFydWlMb2NhdGlvbikge1xuICAgICAgdGhpcy5iYWQgPSB0cnVlO1xuICAgIH0gZWxzZSB7XG4gICAgICB0aGlzLnJ1aV9sb2NhdGlvbiA9IHJ1aUxvY2F0aW9uO1xuICAgIH1cblxuICAgIGlmICghR1JPVVBfVVVJRF9NQVBQSU5HW2RhdGEuZ3JvdXBfdXVpZCBhcyBzdHJpbmddKSB7XG4gICAgICBHUk9VUF9VVUlEX01BUFBJTkdbZGF0YS5ncm91cF91dWlkIGFzIHN0cmluZ10gPSBkYXRhLmdyb3VwX25hbWUgYXMgc3RyaW5nO1xuICAgIH1cblxuICAgIGNvbnN0IGRhdGVFbnRlcmVkID0gbmV3IERhdGUoZGF0YS5sYXN0X21vZGlmaWVkX3RpbWVzdGFtcCBhcyBudW1iZXIpLnRvTG9jYWxlRGF0ZVN0cmluZygpO1xuICAgIGNvbnN0IGdyb3VwTmFtZSA9IEdST1VQX1VVSURfTUFQUElOR1tkYXRhLmdyb3VwX3V1aWQgYXMgc3RyaW5nXSB8fCBkYXRhLmdyb3VwX25hbWUgYXMgc3RyaW5nO1xuICAgIGNvbnN0IGNyZWF0b3IgPSBkYXRhLmNyZWF0ZWRfYnlfdXNlcl9kaXNwbGF5bmFtZTtcblxuICAgIHRoaXNbJ0BpZCddID0gSEJNX1BSRUZJWCArIGRhdGEudXVpZDtcbiAgICB0aGlzLmxhYmVsID0gYFJlZ2lzdGVyZWQgJHtkYXRlRW50ZXJlZH0sICR7Y3JlYXRvcn0sICR7Z3JvdXBOYW1lfWA7XG4gICAgdGhpcy5saW5rID0gYCR7cG9ydGFsVXJsfWJyb3dzZS9zYW1wbGUvJHtkYXRhLnV1aWR9YDtcblxuICAgIGNvbnN0IHNlY3Rpb25Mb29rdXA6IFJlY29yZDxzdHJpbmcsIEpzb25MZE9iaj4gPSB7fTtcbiAgICBjb25zdCBzZWN0aW9uczogSnNvbkxkT2JqW10gPSBbXTtcbiAgICB0aGlzLnNlY3Rpb25zID0gc2VjdGlvbnM7XG4gICAgY29uc3QgZGF0YXNldHM6IEpzb25MZE9ialtdID0gW107XG4gICAgdGhpcy5kYXRhc2V0cyA9IGRhdGFzZXRzO1xuXG4gICAgZm9yIChjb25zdCBkZXNjZW5kYW50IG9mIGRlc2NlbmRhbnRzLmZpbHRlcihkID0+IGQuZW50aXR5X3R5cGUgPT09ICdTYW1wbGUnKSkge1xuICAgICAgY29uc3Qgc2VjdGlvbiA9IHRoaXMuZ2V0U2VjdGlvbihkZXNjZW5kYW50LCBkYXRhLCBwb3J0YWxVcmwpO1xuXG4gICAgICBjb25zdCBzZWN0aW9uSWQgPSBkZXNjZW5kYW50LnN1Ym1pc3Npb25faWQgYXMgc3RyaW5nO1xuICAgICAgc2VjdGlvbkxvb2t1cFtzZWN0aW9uSWRdID0gc2VjdGlvbjtcbiAgICAgIHNlY3Rpb25zLnB1c2goc2VjdGlvbik7XG4gICAgICBzZWN0aW9uLnNlY3Rpb25fbnVtYmVyID0gc2VjdGlvbi5zZWN0aW9uX251bWJlciA/PyBzZWN0aW9ucy5sZW5ndGg7XG4gICAgfVxuICAgIGZvciAoY29uc3QgZGVzY2VuZGFudCBvZiBkZXNjZW5kYW50cykge1xuICAgICAgaWYgKGRlc2NlbmRhbnQuZW50aXR5X3R5cGUgPT09ICdEYXRhc2V0Jykge1xuICAgICAgICBjb25zdCBkYXRhc2V0ID0gdGhpcy5nZXREYXRhc2V0KGRlc2NlbmRhbnQsIGFzc2V0c0FwaSwgcG9ydGFsVXJsLCBzZXJ2aWNlVG9rZW4pO1xuXG4gICAgICAgIGNvbnN0IHNlY3Rpb25JZCA9IGdldChkZXNjZW5kYW50LCBbJ2luZ2VzdF9tZXRhZGF0YScsICdtZXRhZGF0YScsICd0aXNzdWVfaWQnXSkgYXMgc3RyaW5nO1xuICAgICAgICBpZiAoc2VjdGlvbkxvb2t1cFtzZWN0aW9uSWRdKSB7XG4gICAgICAgICAgKHNlY3Rpb25Mb29rdXBbc2VjdGlvbklkXS5kYXRhc2V0cyBhcyBKc29uTGRbXSk/LnB1c2goZGF0YXNldCk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgZGF0YXNldHMucHVzaChkYXRhc2V0KTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgIH1cblxuICAgIGNvbnN0IGxvYzogSnNvbkRpY3QgPSBydWlMb2NhdGlvbiA/PyB7fTtcbiAgICBjb25zdCBkaW1zID0gYCR7bG9jLnhfZGltZW5zaW9ufSB4ICR7bG9jLnlfZGltZW5zaW9ufSB4ICR7bG9jLnpfZGltZW5zaW9ufSAke2xvYy5kaW1lbnNpb25fdW5pdHN9YDtcbiAgICB0aGlzLnNlY3Rpb25fY291bnQgPSBsb2Muc2xpY2VfY291bnQgYXMgbnVtYmVyIHx8IHNlY3Rpb25zLmxlbmd0aDtcbiAgICBjb25zdCBzU2l6ZSA9IHBhcnNlRmxvYXQoXG4gICAgICAobG9jLnNsaWNlX3RoaWNrbmVzcyBhcyBudW1iZXIgfHxcbiAgICAgICAgKChsb2Muel9kaW1lbnNpb24gYXMgbnVtYmVyIHx8IDApIC8gTWF0aC5tYXgodGhpcy5zZWN0aW9uX2NvdW50LCAxKSkpXG4gICAgICAgIC50b0ZpeGVkKDEpXG4gICAgKTtcbiAgICB0aGlzLnNlY3Rpb25fc2l6ZSA9IHNTaXplO1xuICAgIGNvbnN0IHNVbml0cyA9IGxvYy5kaW1lbnNpb25fdW5pdHMgYXMgc3RyaW5nIHx8ICdtaWxsaW1ldGVyJztcbiAgICB0aGlzLnNlY3Rpb25fdW5pdHMgPSBzVW5pdHM7XG5cbiAgICB0aGlzLmRlc2NyaXB0aW9uID0gYCR7ZGltc30sICR7c1NpemV9ICR7c1VuaXRzfSwgJHtkYXRhLnNwZWNpbWVuX3R5cGV9LCAke3RoaXMuc2VjdGlvbl9jb3VudH0gU2VjdGlvbnNgO1xuXG4gICAgc2VjdGlvbnMuZm9yRWFjaCgoc2VjdGlvbiwgaW5kZXgpID0+IHtcbiAgICAgIHNlY3Rpb24uZGVzY3JpcHRpb24gPSBgJHtsb2MueF9kaW1lbnNpb259IHggJHtsb2MueV9kaW1lbnNpb259IHggJHtzU2l6ZX0gJHtzVW5pdHN9LCAke3NTaXplfSAke3NVbml0c30sICR7c2VjdGlvbi5kZXNjcmlwdGlvbn1gO1xuICAgICAgc2VjdGlvbi5zZWN0aW9uX251bWJlciA9IGluZGV4ICsgMTtcbiAgICB9KTtcbiAgfVxuXG4gIGdldFNlY3Rpb24oc2VjdGlvbjogSnNvbkRpY3QsIGRhdGE6IEpzb25EaWN0LCBwb3J0YWxVcmw6IHN0cmluZyk6IEpzb25MZE9iaiB7XG4gICAgY29uc3QgZGF0ZUVudGVyZWQgPSBuZXcgRGF0ZShzZWN0aW9uLmxhc3RfbW9kaWZpZWRfdGltZXN0YW1wIGFzIG51bWJlcikudG9Mb2NhbGVEYXRlU3RyaW5nKCk7XG4gICAgY29uc3QgZ3JvdXBOYW1lID0gR1JPVVBfVVVJRF9NQVBQSU5HW3NlY3Rpb24uZ3JvdXBfdXVpZCBhcyBzdHJpbmddIHx8IHNlY3Rpb24uZ3JvdXBfbmFtZSBhcyBzdHJpbmc7XG4gICAgY29uc3QgY3JlYXRvciA9IHNlY3Rpb24uY3JlYXRlZF9ieV91c2VyX2Rpc3BsYXluYW1lO1xuXG4gICAgcmV0dXJuIHtcbiAgICAgICdAaWQnOiBIQk1fUFJFRklYICsgc2VjdGlvbi51dWlkLFxuICAgICAgJ0B0eXBlJzogJ1NhbXBsZScsXG4gICAgICBsYWJlbDogYFJlZ2lzdGVyZWQgJHtkYXRlRW50ZXJlZH0sICR7Y3JlYXRvcn0sICR7Z3JvdXBOYW1lfWAsXG4gICAgICBkZXNjcmlwdGlvbjogYCR7ZGF0YS5zcGVjaW1lbl90eXBlfWAsXG4gICAgICBsaW5rOiBgJHtwb3J0YWxVcmx9YnJvd3NlL3NhbXBsZS8ke3NlY3Rpb24udXVpZH1gLFxuXG4gICAgICBzYW1wbGVfdHlwZTogJ1Rpc3N1ZSBTZWN0aW9uJyxcbiAgICAgIHNlY3Rpb25fbnVtYmVyOiAxLFxuXG4gICAgICBzYW1wbGVzOiBbXSxcbiAgICAgIGRhdGFzZXRzOiBbXVxuICAgIH07XG4gIH1cblxuICBnZXREYXRhc2V0KGRhdGFzZXQ6IEpzb25EaWN0LCBhc3NldHNBcGkgPSAnJywgcG9ydGFsVXJsID0gJycsIHNlcnZpY2VUb2tlbj86IHN0cmluZyk6IEpzb25MZE9iaiB7XG4gICAgY29uc3QgZGF0ZUVudGVyZWQgPSBuZXcgRGF0ZShkYXRhc2V0Lmxhc3RfbW9kaWZpZWRfdGltZXN0YW1wIGFzIG51bWJlcikudG9Mb2NhbGVEYXRlU3RyaW5nKCk7XG4gICAgY29uc3QgZ3JvdXBOYW1lID0gR1JPVVBfVVVJRF9NQVBQSU5HW2RhdGFzZXQuZ3JvdXBfdXVpZCBhcyBzdHJpbmddIHx8IGRhdGFzZXQuZ3JvdXBfbmFtZSBhcyBzdHJpbmc7XG4gICAgY29uc3QgY3JlYXRvciA9IGRhdGFzZXQuY3JlYXRlZF9ieV91c2VyX2Rpc3BsYXluYW1lO1xuXG4gICAgY29uc3QgdHlwZXMgPSBbXG4gICAgICAuLi5kYXRhc2V0LmRhdGFfdHlwZXMgYXMgc3RyaW5nW10sXG4gICAgICBnZXQoZGF0YXNldCwgWydpbmdlc3RfbWV0YWRhdGEnLCAnbWV0YWRhdGEnLCAnYXNzYXlfdHlwZSddLCAnJylcbiAgICBdO1xuICAgIGNvbnN0IHR5cGVzU2VhcmNoID0gdHlwZXMuam9pbignfCcpLnRvTG93ZXJDYXNlKCk7XG5cbiAgICBsZXQgdGVjaG5vbG9neTogc3RyaW5nO1xuICAgIGxldCB0aHVtYm5haWwgPSAnYXNzZXRzL2ljb25zL2ljby11bmtub3duLnN2Zyc7XG4gICAgaWYgKHR5cGVzU2VhcmNoLmluZGV4T2YoJzEweCcpICE9PSAtMSkge1xuICAgICAgdGVjaG5vbG9neSA9ICcxMHgnO1xuICAgICAgdGh1bWJuYWlsID0gJ2Fzc2V0cy9pY29ucy9pY28tYnVsay0xMHguc3ZnJztcbiAgICB9IGVsc2UgaWYgKHR5cGVzU2VhcmNoLmluZGV4T2YoJ2FmJykgIT09IC0xKSB7XG4gICAgICB0ZWNobm9sb2d5ID0gJ0FGJztcbiAgICAgIHRodW1ibmFpbCA9ICdhc3NldHMvaWNvbnMvaWNvLXNwYXRpYWwtYWYuc3ZnJztcbiAgICB9IGVsc2UgaWYgKHR5cGVzU2VhcmNoLmluZGV4T2YoJ2NvZGV4JykgIT09IC0xKSB7XG4gICAgICB0ZWNobm9sb2d5ID0gJ0NPREVYJztcbiAgICAgIHRodW1ibmFpbCA9ICdhc3NldHMvaWNvbnMvaWNvLXNwYXRpYWwtY29kZXguc3ZnJztcbiAgICB9IGVsc2UgaWYgKHR5cGVzU2VhcmNoLmluZGV4T2YoJ2ltYycpICE9PSAtMSkge1xuICAgICAgdGVjaG5vbG9neSA9ICdJTUMnO1xuICAgICAgdGh1bWJuYWlsID0gJ2Fzc2V0cy9pY29ucy9pY28tc3BhdGlhbC1pbWMuc3ZnJztcbiAgICB9IGVsc2UgaWYgKCh0eXBlc1NlYXJjaC5pbmRleE9mKCdsYycpICE9PSAtMSkgJiYgKHR5cGVzU2VhcmNoLmluZGV4T2YoJ2FmJykgPT09IC0xKSkge1xuICAgICAgdGVjaG5vbG9neSA9ICdMQyc7XG4gICAgICB0aHVtYm5haWwgPSAnYXNzZXRzL2ljb25zL2ljby1idWxrLWxjLnN2Zyc7XG4gICAgfSBlbHNlIGlmICh0eXBlc1NlYXJjaC5pbmRleE9mKCdtYWxkaScpICE9PSAtMSkge1xuICAgICAgdGVjaG5vbG9neSA9ICdNQUxESSc7XG4gICAgfSBlbHNlIGlmICh0eXBlc1NlYXJjaC5pbmRleE9mKCdwYXMnKSAhPT0gLTEpIHtcbiAgICAgIHRlY2hub2xvZ3kgPSAnUEFTJztcbiAgICB9IGVsc2Uge1xuICAgICAgdGVjaG5vbG9neSA9ICdPVEhFUic7XG4gICAgfVxuICAgIHRodW1ibmFpbCA9IHRoaXMuZ2V0RGF0YXNldFRodW1ibmFpbChkYXRhc2V0LCBhc3NldHNBcGksIHNlcnZpY2VUb2tlbikgPz8gdGh1bWJuYWlsO1xuXG4gICAgcmV0dXJuIHtcbiAgICAgICdAaWQnOiBIQk1fUFJFRklYICsgZGF0YXNldC51dWlkLFxuICAgICAgJ0B0eXBlJzogJ0RhdGFzZXQnLFxuICAgICAgbGFiZWw6IGBSZWdpc3RlcmVkICR7ZGF0ZUVudGVyZWR9LCAke2NyZWF0b3J9LCAke2dyb3VwTmFtZX1gLFxuICAgICAgZGVzY3JpcHRpb246IGBEYXRhL0Fzc2F5IFR5cGVzOiAke3R5cGVzLmpvaW4oJywgJyl9YCxcbiAgICAgIGxpbms6IGAke3BvcnRhbFVybH1icm93c2UvZGF0YXNldC8ke2RhdGFzZXQudXVpZH1gLFxuICAgICAgdGVjaG5vbG9neSxcbiAgICAgIHRodW1ibmFpbFxuICAgIH07XG4gIH1cblxuICBnZXREYXRhc2V0VGh1bWJuYWlsKGRhdGFzZXQ6IEpzb25EaWN0LCBhc3NldHNBcGk6IHN0cmluZywgc2VydmljZVRva2VuPzogc3RyaW5nKTogc3RyaW5nIHwgdW5kZWZpbmVkIHtcbiAgICBpZiAoZGF0YXNldC50aHVtYm5haWxfZmlsZSkge1xuICAgICAgY29uc3QgdGh1bWJuYWlsRmlsZSA9IGRhdGFzZXQudGh1bWJuYWlsX2ZpbGUgYXMgSnNvbkRpY3Q7XG4gICAgICByZXR1cm4gYCR7YXNzZXRzQXBpfS8ke3RodW1ibmFpbEZpbGUuZmlsZV91dWlkfS8ke3RodW1ibmFpbEZpbGUuZmlsZW5hbWV9YCArIChzZXJ2aWNlVG9rZW4gPyBgP3Rva2VuPSR7c2VydmljZVRva2VufWAgOiAnJyk7XG4gICAgfSBlbHNlIGlmIChkYXRhc2V0Lmdyb3VwX3V1aWQgPT09ICc3M2JiMjZlNC1lZDQzLTExZTgtOGYxOS0wYTdjMWVhYjAwN2EnKSB7IC8vIFRNQy1WYW5kZXJiaWx0XG4gICAgICBjb25zdCB0aWZmcyA9IChnZXQoZGF0YXNldCwgJ21ldGFkYXRhLmZpbGVzJywgW10pIGFzIHsgcmVsX3BhdGg6IHN0cmluZyB9W10pXG4gICAgICAgIC5maWx0ZXIoZiA9PiAvXFwuKG9tZVxcLnRpZnxvbWVcXC50aWZmKSQvLnRlc3QoZi5yZWxfcGF0aCkpXG4gICAgICAgIC5maWx0ZXIoZiA9PiAhLyhtdWx0aWxheWVyXFwub21lXFwudGlmfF9hY1xcLm9tZVxcLnRpZikvLnRlc3QoZi5yZWxfcGF0aCkpXG4gICAgICAgIC5maWx0ZXIoZiA9PiBEUjFfVlVfVEhVTUJTLmhhcyhcbiAgICAgICAgICBmLnJlbF9wYXRoLnNwbGl0KCcvJykuc2xpY2UoLTEpWzBdLnNwbGl0KCc/JylbMF0ucmVwbGFjZSgnLm9tZS50aWYnLCAnX3RodW1ibmFpbC5qcGcnKVxuICAgICAgICApKVxuICAgICAgICAubWFwKGYgPT4gYCR7YXNzZXRzQXBpfS8ke2RhdGFzZXQudXVpZH0vJHtmLnJlbF9wYXRofWAgKyAoc2VydmljZVRva2VuID8gYD90b2tlbj0ke3NlcnZpY2VUb2tlbn1gIDogJycpKTtcblxuICAgICAgaWYgKHRpZmZzLmxlbmd0aCA+IDApIHtcbiAgICAgICAgY29uc3QgdGh1bWIgPSB0aWZmc1swXS5zcGxpdCgnLycpLnNsaWNlKC0xKVswXS5zcGxpdCgnPycpWzBdLnJlcGxhY2UoJy5vbWUudGlmJywgJ190aHVtYm5haWwuanBnJyk7XG4gICAgICAgIGlmIChEUjFfVlVfVEhVTUJTLmhhcyh0aHVtYikpIHtcbiAgICAgICAgICByZXR1cm4gYGFzc2V0cy90aHVtYm5haWxzL1RNQy1WYW5kZXJiaWx0L0RSMS8ke3RodW1ifWA7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9IGVsc2UgaWYgKGRhdGFzZXQuZ3JvdXBfdXVpZCA9PT0gJzA3YTI5ZTRjLWVkNDMtMTFlOC1iNTZhLTBlODAxN2JkZGE1OCcpIHsgLy8gVE1DLUZsb3JpZGFcbiAgICAgIGNvbnN0IHRodW1iID0gVUZMX1RIVU1CU1tkYXRhc2V0Lmh1Ym1hcF9pZCBhcyBzdHJpbmddO1xuICAgICAgaWYgKHRodW1iKSB7XG4gICAgICAgIHJldHVybiBgYXNzZXRzL3RodW1ibmFpbHMvVE1DLUZsb3JpZGEvJHt0aHVtYn1gO1xuICAgICAgfVxuICAgIH1cbiAgICByZXR1cm4gdW5kZWZpbmVkO1xuICB9XG5cbiAgZ2V0RG9ub3IoZG9ub3I6IEpzb25EaWN0LCBwb3J0YWxVcmw6IHN0cmluZyk6IEpzb25MZE9iaiB7XG4gICAgY29uc3QgZG9ub3JEZXNjcmlwdGlvbiA9IChkb25vci5kZXNjcmlwdGlvbiBhcyBzdHJpbmcgfHwgJycpLnRvTG93ZXJDYXNlKCk7XG4gICAgbGV0IHNleDogJ01hbGUnIHwgJ0ZlbWFsZScgfCB1bmRlZmluZWQ7XG4gICAgaWYgKGRvbm9yRGVzY3JpcHRpb24uaW5jbHVkZXMoJ2ZlbWFsZScpKSB7XG4gICAgICBzZXggPSAnRmVtYWxlJztcbiAgICB9IGVsc2UgaWYgKGRvbm9yRGVzY3JpcHRpb24uaW5jbHVkZXMoJ21hbGUnKSkge1xuICAgICAgc2V4ID0gJ01hbGUnO1xuICAgIH1cbiAgICBjb25zdCBhZ2VNYXRjaCA9IGRvbm9yRGVzY3JpcHRpb24ubWF0Y2goL2FnZSAoWzAtOV0rKS8pO1xuICAgIGxldCBhZ2U6IG51bWJlciB8IHVuZGVmaW5lZDtcbiAgICBpZiAoYWdlTWF0Y2gpIHtcbiAgICAgIGFnZSA9IHRvTnVtYmVyKGFnZU1hdGNoWzFdKTtcbiAgICB9XG4gICAgbGV0IGJtaTogbnVtYmVyIHwgdW5kZWZpbmVkO1xuICAgIGZvciAoY29uc3QgbWQgb2YgZ2V0KGRvbm9yLCAnbWV0YWRhdGEub3JnYW5fZG9ub3JfZGF0YScsIGdldChkb25vciwgJ21ldGFkYXRhLmxpdmluZ19kb25vcl9kYXRhJywgW10pKSBhcyBKc29uRGljdFtdKSB7XG4gICAgICBpZiAobWQucHJlZmVycmVkX3Rlcm0gPT09ICdGZW1pbmluZSBnZW5kZXInIHx8IG1kLnByZWZlcnJlZF90ZXJtID09PSAnRmVtYWxlJykge1xuICAgICAgICBzZXggPSAnRmVtYWxlJztcbiAgICAgIH0gZWxzZSBpZiAobWQucHJlZmVycmVkX3Rlcm0gPT09ICdNYXNjdWxpbmUgZ2VuZGVyJyB8fCBtZC5wcmVmZXJyZWRfdGVybSA9PT0gJ01hbGUnKSB7XG4gICAgICAgIHNleCA9ICdNYWxlJztcbiAgICAgIH0gZWxzZSBpZiAobWQucHJlZmVycmVkX3Rlcm0gPT09ICdDdXJyZW50IGNocm9ub2xvZ2ljYWwgYWdlJyB8fCBtZC5wcmVmZXJyZWRfdGVybSA9PT0gJ0FnZScpIHtcbiAgICAgICAgYWdlID0gdG9OdW1iZXIobWQuZGF0YV92YWx1ZSk7XG4gICAgICB9IGVsc2UgaWYgKG1kLnByZWZlcnJlZF90ZXJtID09PSAnQm9keSBtYXNzIGluZGV4Jykge1xuICAgICAgICBibWkgPSB0b051bWJlcihtZC5kYXRhX3ZhbHVlKTtcbiAgICAgIH1cbiAgICB9XG4gICAgbGV0IGxhYmVsID0gJyc7XG4gICAgaWYgKHNleCAmJiBhZ2UpIHtcbiAgICAgIGxhYmVsICs9IGAke3NleH0sIEFnZSAke2FnZX1gO1xuICAgICAgaWYgKGJtaSkge1xuICAgICAgICBsYWJlbCArPSBgLCBCTUkgJHtibWkudG9GaXhlZCgxKX1gO1xuICAgICAgfVxuICAgIH1cblxuICAgIGNvbnN0IGRhdGVFbnRlcmVkID0gbmV3IERhdGUoZG9ub3IubGFzdF9tb2RpZmllZF90aW1lc3RhbXAgYXMgbnVtYmVyKS50b0xvY2FsZURhdGVTdHJpbmcoKTtcbiAgICBjb25zdCBncm91cE5hbWUgPSBHUk9VUF9VVUlEX01BUFBJTkdbZG9ub3IuZ3JvdXBfdXVpZCBhcyBzdHJpbmddIHx8IGRvbm9yLmdyb3VwX25hbWUgYXMgc3RyaW5nO1xuICAgIGNvbnN0IGNyZWF0b3IgPSBkb25vci5jcmVhdGVkX2J5X3VzZXJfZGlzcGxheW5hbWU7XG5cbiAgICByZXR1cm4ge1xuICAgICAgJ0BpZCc6IEhCTV9QUkVGSVggKyBkb25vci51dWlkLFxuICAgICAgJ0B0eXBlJzogJ0Rvbm9yJyxcbiAgICAgIGxhYmVsLFxuICAgICAgZGVzY3JpcHRpb246IGBFbnRlcmVkICR7ZGF0ZUVudGVyZWR9LCAke2NyZWF0b3J9LCAke2dyb3VwTmFtZX1gLFxuICAgICAgbGluazogYCR7cG9ydGFsVXJsfWJyb3dzZS9kb25vci8ke2Rvbm9yLnV1aWR9YCxcblxuICAgICAgYWdlLFxuICAgICAgc2V4LFxuICAgICAgYm1pLFxuXG4gICAgICBjb25zb3J0aXVtX25hbWU6ICdIdUJNQVAnLFxuICAgICAgcHJvdmlkZXJfbmFtZTogZ3JvdXBOYW1lLFxuICAgICAgcHJvdmlkZXJfdXVpZDogZG9ub3IuZ3JvdXBfdXVpZCBhcyBzdHJpbmcsXG5cbiAgICAgIHNhbXBsZXM6IFtdXG4gICAgfTtcbiAgfVxuXG4gIGdldFJ1aUxvY2F0aW9uKGRhdGE6IEpzb25EaWN0LCBkb25vcjogSnNvbkxkT2JqKTogSnNvbkxkT2JqIHwgdW5kZWZpbmVkIHtcbiAgICBsZXQgc3BhdGlhbEVudGl0eTogSnNvbkxkT2JqIHwgdW5kZWZpbmVkO1xuICAgIGxldCBydWlMb2NhdGlvbiA9IGRhdGEucnVpX2xvY2F0aW9uIGFzIEpzb25EaWN0O1xuICAgIGlmIChydWlMb2NhdGlvbikge1xuICAgICAgLy8gUlVJIExvY2F0aW9uIG1heSBjb21lIGluIGFzIGFuIHVucGFyc2VkIHN0cmluZ1xuICAgICAgaWYgKHR5cGVvZiBydWlMb2NhdGlvbiA9PT0gJ3N0cmluZycpIHtcbiAgICAgICAgcnVpTG9jYXRpb24gPSBKU09OLnBhcnNlKHJ1aUxvY2F0aW9uIGFzIHN0cmluZykgYXMgSnNvbkRpY3Q7XG4gICAgICB9XG4gICAgICBpZiAocnVpTG9jYXRpb24uYWxpZ25tZW50X2lkKSB7IC8vIERldGVjdCBSVUkgMC41IGdlbmVyYXRlZCBKU09OXG4gICAgICAgIGNvbnNvbGUubG9nKCdEZXRlY3RlZCBhIGRlcHJlY2F0ZWQgcnVpX2xvY2F0aW9uJywgZGF0YS51dWlkKTtcbiAgICAgIH0gZWxzZSBpZiAoKHJ1aUxvY2F0aW9uIGFzIHVua25vd24gYXMgeyAnQGlkJzogc3RyaW5nIH0pWydAaWQnXSkgeyAvLyBEZXRlY3QgUlVJIDEuMCsgZ2VuZXJhdGVkIEpTT04tTERcbiAgICAgICAgLy8gZXNsaW50LWRpc2FibGUtbmV4dC1saW5lIEB0eXBlc2NyaXB0LWVzbGludC9uby1leHBsaWNpdC1hbnlcbiAgICAgICAgc3BhdGlhbEVudGl0eSA9IHJ1aUxvY2F0aW9uIGFzIHVua25vd24gYXMgSnNvbkxkT2JqO1xuICAgICAgfVxuICAgIH1cbiAgICBpZiAoc3BhdGlhbEVudGl0eSkge1xuICAgICAgLy8gUGF0Y2ggdG8gZml4IFJVSSAwLjUgS2lkbmV5IGFuZCBTcGxlZW4gUGxhY2VtZW50c1xuICAgICAgY29uc3QgdGFyZ2V0OiBzdHJpbmcgPSBnZXQoc3BhdGlhbEVudGl0eSwgWydwbGFjZW1lbnQnLCAndGFyZ2V0J10pID8/ICcnO1xuICAgICAgaWYgKHRhcmdldC5zdGFydHNXaXRoKCdodHRwOi8vcHVybC5vcmcvY2NmL2xhdGVzdC9jY2Yub3dsI1ZIU3BsZWVuQ0MnKSkge1xuICAgICAgICBpZiAoZG9ub3Iuc2V4ID09PSAnTWFsZScpIHtcbiAgICAgICAgICBzZXQoc3BhdGlhbEVudGl0eSwgWydwbGFjZW1lbnQnLCAndGFyZ2V0J10sIHRhcmdldC5yZXBsYWNlKCcjVkhTcGxlZW5DQycsICcjVkhNU3BsZWVuQ0MnKSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgc2V0KHNwYXRpYWxFbnRpdHksIFsncGxhY2VtZW50JywgJ3RhcmdldCddLCB0YXJnZXQucmVwbGFjZSgnI1ZIU3BsZWVuQ0MnLCAnI1ZIRlNwbGVlbkNDJykpO1xuICAgICAgICB9XG4gICAgICB9IGVsc2UgaWYgKHRhcmdldCA9PT0gJ2h0dHA6Ly9wdXJsLm9yZy9jY2YvbGF0ZXN0L2NjZi5vd2wjVkhMZWZ0S2lkbmV5JyB8fCB0YXJnZXQgPT09ICdodHRwOi8vcHVybC5vcmcvY2NmL2xhdGVzdC9jY2Yub3dsI1ZIUmlnaHRLaWRuZXknKSB7XG4gICAgICAgIGlmIChkb25vci5zZXggPT09ICdNYWxlJykge1xuICAgICAgICAgIHNldChzcGF0aWFsRW50aXR5LCBbJ3BsYWNlbWVudCcsICd0YXJnZXQnXSwgdGFyZ2V0LnJlcGxhY2UoJyNWSCcsICcjVkhNJykgKyAnX1BhdGNoJyk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgc2V0KHNwYXRpYWxFbnRpdHksIFsncGxhY2VtZW50JywgJ3RhcmdldCddLCB0YXJnZXQucmVwbGFjZSgnI1ZIJywgJyNWSEYnKSArICdfUGF0Y2gnKTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgIH1cbiAgICByZXR1cm4gc3BhdGlhbEVudGl0eTtcbiAgfVxuXG4gIGdldFRpc3N1ZUJsb2NrKCk6IEpzb25MZE9iaiB7XG4gICAgcmV0dXJuIG9taXQoeyAuLi50aGlzIH0sIFsnZGF0YScsICdiYWQnLCAnZG9ub3InXSkgYXMgdW5rbm93biBhcyBKc29uTGRPYmo7XG4gIH1cblxuICB0b0pzb25MZCgpOiBKc29uTGRPYmoge1xuICAgIHJldHVybiB7IC4uLnRoaXMuZG9ub3IsIHNhbXBsZXM6IFt0aGlzLmdldFRpc3N1ZUJsb2NrKCldIH07XG4gIH1cbn1cbiJdfQ== \ No newline at end of file diff --git a/ccf-database/esm2015/lib/interfaces.js b/ccf-database/esm2015/lib/interfaces.js deleted file mode 100644 index 38ebe7e93..000000000 --- a/ccf-database/esm2015/lib/interfaces.js +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW50ZXJmYWNlcy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3Byb2plY3RzL2NjZi1kYXRhYmFzZS9zcmMvbGliL2ludGVyZmFjZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsInNvdXJjZXNDb250ZW50IjpbIi8qKiBTdGF0dXMgb2YgdGhlIGRhdGFiYXNlICovXG5leHBvcnQgaW50ZXJmYWNlIERhdGFiYXNlU3RhdHVzIHtcbiAgLyoqIFN0YXR1cyBvZiB0aGUgZGF0YWJhc2UgKi9cbiAgc3RhdHVzOiAnUmVhZHknIHwgJ0xvYWRpbmcnIHwgJ0Vycm9yJztcbiAgLyoqIEhvdyBsb25nIHRvIHdhaXQgKGluIG1pbGxpc2Vjb25kcykgYmVmb3JlIGNoZWNraW5nIHN0YXR1cyBhZ2FpbiAqL1xuICBjaGVja2JhY2s/OiBudW1iZXI7XG4gIC8qKiBUaGUgYW1vdW50IG9mIHRpbWUgKGluIG1pbGxpc2Vjb25kcykgdGFrZW4gdG8gbG9hZCB0aGUgZGF0YWJhc2UgKi9cbiAgbG9hZFRpbWU/OiBudW1iZXI7XG4gIC8qKiBIdW1hbiByZWFkYWJsZSBkZXNjcmlwdGlvbiBvZiB0aGUgY3VycmVudCBzdGF0dXMgKi9cbiAgbWVzc2FnZT86IHN0cmluZztcbn1cblxuLyoqIEFnZ3JlZ2F0ZSBxdWVyeSByZXN1bHQgKi9cbmV4cG9ydCBpbnRlcmZhY2UgQWdncmVnYXRlUmVzdWx0IHtcbiAgLyoqIFF1ZXJpZWQgZmllbGQgKi9cbiAgbGFiZWw6IHN0cmluZztcbiAgLyoqIEFnZ3JlZ2F0ZSB2YWx1ZSAqL1xuICBjb3VudDogc3RyaW5nIHwgbnVtYmVyO1xufVxuXG4vKiogTGlzdCByZXN1bHQgKi9cbmV4cG9ydCBpbnRlcmZhY2UgTGlzdFJlc3VsdEl0ZW0ge1xuICAvKiogSWRlbnRpZmllciAqL1xuICAnQGlkJzogc3RyaW5nO1xuICAvKiogTGFiZWwgKi9cbiAgbGFiZWw6IHN0cmluZztcbiAgLyoqIERlc2NyaXB0aW9uICovXG4gIGRlc2NyaXB0aW9uOiBzdHJpbmc7XG4gIC8qKiBBc3NvY2lhdGVkIFVSTCAqL1xuICBsaW5rOiBzdHJpbmc7XG59XG5cbi8qKiBEb25vciBMaXN0IFJlc3VsdCAqL1xuZXhwb3J0IGludGVyZmFjZSBEb25vclJlc3VsdCBleHRlbmRzIExpc3RSZXN1bHRJdGVtIHtcbiAgLyoqIEpTT04tTEQgVHlwZSAqL1xuICAnQHR5cGUnOiAnRG9ub3InO1xuICAvKiogUHJvdmlkZXIgTmFtZSAqL1xuICBwcm92aWRlck5hbWU6IHN0cmluZztcbn1cblxuLyoqIERhdGFzZXQgTGlzdCBSZXN1bHQgKi9cbmV4cG9ydCBpbnRlcmZhY2UgRGF0YXNldFJlc3VsdCBleHRlbmRzIExpc3RSZXN1bHRJdGVtIHtcbiAgLyoqIEpTT04tTEQgVHlwZSAqL1xuICAnQHR5cGUnOiAnRGF0YXNldCc7XG4gIC8qKiBUZWNobm9sb2d5IHVzZWQgaW4gZGF0YSAqL1xuICB0ZWNobm9sb2d5OiBzdHJpbmc7XG4gIC8qKiBSZXByZXNlbnRhdGl2ZSB0aHVtYm5haWwgVVJMICovXG4gIHRodW1ibmFpbDogc3RyaW5nO1xufVxuXG4vKiogVGlzc3VlIFNlY3Rpb24gTGlzdCBSZXN1bHQgKi9cbmV4cG9ydCBpbnRlcmZhY2UgVGlzc3VlU2VjdGlvblJlc3VsdCBleHRlbmRzIExpc3RSZXN1bHRJdGVtIHtcbiAgLyoqIEpTT04tTEQgVHlwZSAqL1xuICAnQHR5cGUnOiAnU2FtcGxlJztcbiAgLyoqIFNhbXBsZSB0aXNzdWUgc2VjdGlvbiB0eXBlICovXG4gIHNhbXBsZVR5cGU6ICdUaXNzdWUgU2VjdGlvbicgfCAnTm9uLVN0YW5kYXJkJztcbiAgLyoqIEluZGV4IGludG8gdGhlIHNlcXVlbmNlIG9mIHNlY3Rpb25zIGZyb20gdGhlIHBhcmVudCBibG9jayAqL1xuICBzZWN0aW9uTnVtYmVyOiBudW1iZXI7XG4gIC8qKiBEYXRhc2V0cyBkZXJpdmVkIGZyb20gdGhpcyB0aXNzdWUgc2VjdGlvbiAqL1xuICBkYXRhc2V0czogRGF0YXNldFJlc3VsdFtdO1xufVxuXG4vKiogVGlzc3VlIEJsb2NrIExpc3QgUmVzdWx0ICovXG5leHBvcnQgaW50ZXJmYWNlIFRpc3N1ZUJsb2NrUmVzdWx0IGV4dGVuZHMgTGlzdFJlc3VsdEl0ZW0ge1xuICAvKiogSlNPTi1MRCBUeXBlICovXG4gICdAdHlwZSc6ICdTYW1wbGUnO1xuICAvKiogU2FtcGxlIHRpc3N1ZSBibG9jayB0eXBlICovXG4gIHNhbXBsZVR5cGU6ICdUaXNzdWUgQmxvY2snIHwgJ05vbi1TdGFuZGFyZCc7XG4gIC8qKiBOdW1iZXIgb2Ygc2VjdGlvbnMgZXh0cmFjdGVkIGZyb20gdGhpcyBibG9jayAqL1xuICBzZWN0aW9uQ291bnQ6IG51bWJlcjtcbiAgLyoqIFNpemUgb2YgZWFjaCB0aXNzdWUgc2VjdGlvbiAqL1xuICBzZWN0aW9uU2l6ZTogbnVtYmVyO1xuICAvKiogVW5pdHMgb2YgdGhlIHNlY3Rpb24gc2l6ZSAoZ2VuZXJhbGx5LCBtaWxsaW1ldGVycykgKi9cbiAgc2VjdGlvblVuaXRzOiBzdHJpbmc7XG5cbiAgLyoqIFRoZSBkb25vciB0aGlzIHRpc3N1ZSBibG9jayB3YXMgZGVyaXZlZCBmcm9tICovXG4gIGRvbm9yOiBEb25vclJlc3VsdDtcbiAgLyoqIFRoZSBhc3NvY2lhdGVkIHNwYXRpYWwgZW50aXR5IChydWlfbG9jYXRpb24pIGZvciB0aGlzIGJsb2NrICovXG4gIHNwYXRpYWxFbnRpdHlJZDogc3RyaW5nO1xuICAvKiogVGhlIHNlY3Rpb25zIGV4dHJhY3RlZCBmcm9tIHRoaXMgdGlzc3VlIGJsb2NrICovXG4gIHNlY3Rpb25zOiBUaXNzdWVTZWN0aW9uUmVzdWx0W107XG4gIC8qKiBEYXRhc2V0cyBkZXJpdmVkIGZyb20gdGhpcyB0aXNzdWUgYmxvY2sgKi9cbiAgZGF0YXNldHM6IERhdGFzZXRSZXN1bHRbXTtcbn1cblxuLyoqIEl0ZW0gdGhhdCBjYW4gYmUgc2VhcmNoZWQgZm9yICovXG5leHBvcnQgaW50ZXJmYWNlIFNlYXJjaGFibGVJdGVtIHtcbiAgLyoqIElkZW50aWZpZXIgKi9cbiAgaWQ6IHN0cmluZztcbiAgLyoqIFNleCAqL1xuICBzZXg/OiAnTWFsZScgfCAnRmVtYWxlJztcbiAgLyoqIEFnZSAqL1xuICBhZ2U/OiBudW1iZXI7XG4gIC8qKiBCTUkgKi9cbiAgYm1pPzogbnVtYmVyO1xuICAvKiogT250b2xvZ3kgdGVybXMgKi9cbiAgb250b2xvZ3lUZXJtcz86IFNldDxzdHJpbmc+O1xuICAvKiogQ2VsbFR5cGUgdGVybXMgKi9cbiAgY2VsbFR5cGVUZXJtcz86IFNldDxzdHJpbmc+O1xufVxuXG4vKiogU3BlY2lmaWNhdGlvbiBmb3IgYSBTcGF0aWFsIFNlYXJjaCB2aWEgUHJvYmluZyBTcGhlcmUgKi9cbmV4cG9ydCBpbnRlcmZhY2UgU3BhdGlhbFNlYXJjaCB7XG4gIC8qKiBYIGNvb3JkaW5hdGUgcmVsYXRpdmUgdG8gdGFyZ2V0IGluIG1pbGxpbWV0ZXJzICovXG4gIHg6IG51bWJlcjtcbiAgLyoqIHkgY29vcmRpbmF0ZSByZWxhdGl2ZSB0byB0YXJnZXQgaW4gbWlsbGltZXRlcnMgKi9cbiAgeTogbnVtYmVyO1xuICAvKiogeiBjb29yZGluYXRlIHJlbGF0aXZlIHRvIHRhcmdldCBpbiBtaWxsaW1ldGVycyAqL1xuICB6OiBudW1iZXI7XG4gIC8qKiBTaXplIG9mIHRoZSBwcm9iaW5nIHNwaGVyZSBpbiBtaWxsaW1ldGVycyAqL1xuICByYWRpdXM6IG51bWJlcjtcbiAgLyoqIFRoZSB0YXJnZXQgc3BhdGlhbCBlbnRpdHkgSVJJICovXG4gIHRhcmdldDogc3RyaW5nO1xufVxuXG4vKiogT3B0aW9ucyBhcHBsaWVkIGR1cmluZyBxdWVyaWVzICovXG5leHBvcnQgaW50ZXJmYWNlIEZpbHRlciB7XG4gIC8qKiBTZXggKi9cbiAgc2V4OiAnQm90aCcgfCAnTWFsZScgfCAnRmVtYWxlJztcbiAgLyoqIEFnZSByYW5nZSAqL1xuICBhZ2VSYW5nZTogW251bWJlciwgbnVtYmVyXTtcbiAgLyoqIEJNSSByYW5nZSAqL1xuICBibWlSYW5nZTogW251bWJlciwgbnVtYmVyXTtcbiAgLyoqIFRNQyAqL1xuICB0bWM6IHN0cmluZ1tdO1xuICAvKiogVGVjaG5vbG9naWVzICovXG4gIHRlY2hub2xvZ2llczogc3RyaW5nW107XG4gIC8qKiBPbnRvbG9neSB0ZXJtcyAqL1xuICBvbnRvbG9neVRlcm1zOiBzdHJpbmdbXTtcbiAgLyoqIENlbGxUeXBlIHRlcm1zICovXG4gIGNlbGxUeXBlVGVybXM6IHN0cmluZ1tdO1xuICAvKiogc3BhdGlhbCBzZWFyY2ggKi9cbiAgc3BhdGlhbFNlYXJjaGVzOiBTcGF0aWFsU2VhcmNoW107XG4gIC8qKiBJbmNsdWRlIG9wdGlvbmFsIGRlYnVnZ2luZyBpbmZvcm1hdGlvbiAqL1xuICBkZWJ1Zz86IGJvb2xlYW47XG59XG5cbi8qKiBBIG5vZGUgaW4gdGhlIG9udG9sb2d5ICovXG5leHBvcnQgaW50ZXJmYWNlIE9udG9sb2d5VHJlZU5vZGUge1xuICAvKiogSWRlbnRpZmllciAvIElSSSAqL1xuICAnQGlkJzogc3RyaW5nO1xuICAvKiogSlNPTi1MRCBUeXBlICovXG4gICdAdHlwZSc6ICdPbnRvbG9neVRyZWVOb2RlJztcbiAgLyoqIElkZW50aWZpZXIgLyBJUkkgKi9cbiAgaWQ6IHN0cmluZztcbiAgLyoqIFJERlMgbGFiZWwgKi9cbiAgbGFiZWw6IHN0cmluZztcbiAgLyoqIFBhcmVudCBvbnRvbG9neSBub2RlICovXG4gIHBhcmVudDogc3RyaW5nO1xuICAvKiogQ2hpbGQgb250b2xvZ3kgbm9kZXMgKi9cbiAgY2hpbGRyZW46IHN0cmluZ1tdO1xuICAvKiogU3lub255bSBsYWJlbHMgKi9cbiAgc3lub255bUxhYmVsczogc3RyaW5nW107XG59XG5cbi8qKiBPbnRvbG9neSB0cmVlIG1vZGVsICovXG5leHBvcnQgaW50ZXJmYWNlIE9udG9sb2d5VHJlZU1vZGVsIHtcbiAgLyoqIGlkIG9mIHRoZSByb290IG5vZGUgb2YgdGhlIG9udG9sb2d5ICovXG4gIHJvb3Q6IHN0cmluZztcbiAgLyoqIE1hcHBpbmcgZnJvbSBpZC9JUkkgdG8gb250b2xvZ3kgbm9kZSBpbnN0YW5jZSAqL1xuICBub2RlczogeyBbaWQ6IHN0cmluZ106IE9udG9sb2d5VHJlZU5vZGUgfTtcbn1cbiJdfQ== \ No newline at end of file diff --git a/ccf-database/esm2015/lib/queries/aggregate-results-n3.js b/ccf-database/esm2015/lib/queries/aggregate-results-n3.js deleted file mode 100644 index e1c252018..000000000 --- a/ccf-database/esm2015/lib/queries/aggregate-results-n3.js +++ /dev/null @@ -1,69 +0,0 @@ -/* eslint-disable @typescript-eslint/naming-convention */ -import { readQuads } from 'triple-store-utils'; -import { entity } from '../util/prefixes'; -function getObjects(store, ids, predicate) { - const objects = new Set(); - for (const id of ids) { - for (const quad of readQuads(store, id, predicate, null, null)) { - objects.add(quad.object.id); - } - } - return objects; -} -/** - * Computes aggregate results. - * - * @param ids Ids of objects to calculate aggregate over. - * @param store The triple store. - * @returns The list of aggregate results. - */ -export function getAggregateResults(ids, store) { - const donors = getObjects(store, ids, entity.donor.id); - const centers = getObjects(store, donors, entity.providerUUID.id); - const tissueBlocks = new Set(); - for (const id of ids) { - for (const quad of readQuads(store, id, entity.spatialEntity, null, null)) { - tissueBlocks.add(quad.subject.id); - } - } - const tissueSections = getObjects(store, tissueBlocks, entity.sections.id); - const tissueDatasets = new Set([ - ...getObjects(store, tissueBlocks, entity.datasets.id), - ...getObjects(store, tissueSections, entity.datasets.id) - ]); - const results = { - 'Tissue Data Providers': centers.size, - Donors: donors.size, - 'Tissue Blocks': tissueBlocks.size, - 'Tissue Sections': tissueSections.size, - 'Tissue Datasets': tissueDatasets.size - }; - return Object.entries(results).map(([label, count]) => ({ label, count })); -} -/** - * Get a list of technology names used by datasets - * - * @param store The triple store. - * @returns list of unique technology names in the data - */ -export function getDatasetTechnologyNames(store) { - const names = new Set(); - for (const quad of readQuads(store, null, entity.technology, null, null)) { - names.add(quad.object.value); - } - return Array.from(names).sort(); -} -/** - * Get a list of provider names from the database - * - * @param store The triple store. - * @returns list of unique provider names in the data - */ -export function getProviderNames(store) { - const names = new Set(); - for (const quad of readQuads(store, null, entity.providerName, null, null)) { - names.add(quad.object.value); - } - return Array.from(names).sort(); -} -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWdncmVnYXRlLXJlc3VsdHMtbjMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9jY2YtZGF0YWJhc2Uvc3JjL2xpYi9xdWVyaWVzL2FnZ3JlZ2F0ZS1yZXN1bHRzLW4zLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLHlEQUF5RDtBQUN6RCxPQUFPLEVBQUUsU0FBUyxFQUFTLE1BQU0sb0JBQW9CLENBQUM7QUFHdEQsT0FBTyxFQUFFLE1BQU0sRUFBRSxNQUFNLGtCQUFrQixDQUFDO0FBRzFDLFNBQVMsVUFBVSxDQUFDLEtBQVksRUFBRSxHQUFnQixFQUFFLFNBQWlCO0lBQ25FLE1BQU0sT0FBTyxHQUFHLElBQUksR0FBRyxFQUFVLENBQUM7SUFDbEMsS0FBSyxNQUFNLEVBQUUsSUFBSSxHQUFHLEVBQUU7UUFDcEIsS0FBSyxNQUFNLElBQUksSUFBSSxTQUFTLENBQUMsS0FBSyxFQUFFLEVBQUUsRUFBRSxTQUFTLEVBQUUsSUFBSSxFQUFFLElBQUksQ0FBQyxFQUFFO1lBQzlELE9BQU8sQ0FBQyxHQUFHLENBQUMsSUFBSSxDQUFDLE1BQU0sQ0FBQyxFQUFFLENBQUMsQ0FBQztTQUM3QjtLQUNGO0lBQ0QsT0FBTyxPQUFPLENBQUM7QUFDakIsQ0FBQztBQUVEOzs7Ozs7R0FNRztBQUNILE1BQU0sVUFBVSxtQkFBbUIsQ0FBQyxHQUFnQixFQUFFLEtBQVk7SUFDaEUsTUFBTSxNQUFNLEdBQUcsVUFBVSxDQUFDLEtBQUssRUFBRSxHQUFHLEVBQUUsTUFBTSxDQUFDLEtBQUssQ0FBQyxFQUFFLENBQUMsQ0FBQztJQUN2RCxNQUFNLE9BQU8sR0FBRyxVQUFVLENBQUMsS0FBSyxFQUFFLE1BQU0sRUFBRSxNQUFNLENBQUMsWUFBWSxDQUFDLEVBQUUsQ0FBQyxDQUFDO0lBRWxFLE1BQU0sWUFBWSxHQUFHLElBQUksR0FBRyxFQUFVLENBQUM7SUFDdkMsS0FBSyxNQUFNLEVBQUUsSUFBSSxHQUFHLEVBQUU7UUFDcEIsS0FBSyxNQUFNLElBQUksSUFBSSxTQUFTLENBQUMsS0FBSyxFQUFFLEVBQUUsRUFBRSxNQUFNLENBQUMsYUFBYSxFQUFFLElBQUksRUFBRSxJQUFJLENBQUMsRUFBRTtZQUN6RSxZQUFZLENBQUMsR0FBRyxDQUFDLElBQUksQ0FBQyxPQUFPLENBQUMsRUFBRSxDQUFDLENBQUM7U0FDbkM7S0FDRjtJQUVELE1BQU0sY0FBYyxHQUFHLFVBQVUsQ0FBQyxLQUFLLEVBQUUsWUFBWSxFQUFFLE1BQU0sQ0FBQyxRQUFRLENBQUMsRUFBRSxDQUFDLENBQUM7SUFDM0UsTUFBTSxjQUFjLEdBQUcsSUFBSSxHQUFHLENBQVM7UUFDckMsR0FBRyxVQUFVLENBQUMsS0FBSyxFQUFFLFlBQVksRUFBRSxNQUFNLENBQUMsUUFBUSxDQUFDLEVBQUUsQ0FBQztRQUN0RCxHQUFHLFVBQVUsQ0FBQyxLQUFLLEVBQUUsY0FBYyxFQUFFLE1BQU0sQ0FBQyxRQUFRLENBQUMsRUFBRSxDQUFDO0tBQ3pELENBQUMsQ0FBQztJQUVILE1BQU0sT0FBTyxHQUE4QjtRQUN6Qyx1QkFBdUIsRUFBRSxPQUFPLENBQUMsSUFBSTtRQUNyQyxNQUFNLEVBQUUsTUFBTSxDQUFDLElBQUk7UUFDbkIsZUFBZSxFQUFFLFlBQVksQ0FBQyxJQUFJO1FBQ2xDLGlCQUFpQixFQUFFLGNBQWMsQ0FBQyxJQUFJO1FBQ3RDLGlCQUFpQixFQUFFLGNBQWMsQ0FBQyxJQUFJO0tBQ3ZDLENBQUM7SUFFRixPQUFPLE1BQU0sQ0FBQyxPQUFPLENBQUMsT0FBTyxDQUFDLENBQUMsR0FBRyxDQUFDLENBQUMsQ0FBQyxLQUFLLEVBQUUsS0FBSyxDQUFDLEVBQUUsRUFBRSxDQUFDLENBQUMsRUFBRSxLQUFLLEVBQUUsS0FBSyxFQUFFLENBQUMsQ0FBQyxDQUFDO0FBQzdFLENBQUM7QUFFRDs7Ozs7R0FLRztBQUNILE1BQU0sVUFBVSx5QkFBeUIsQ0FBQyxLQUFZO0lBQ3BELE1BQU0sS0FBSyxHQUFHLElBQUksR0FBRyxFQUFVLENBQUM7SUFDaEMsS0FBSyxNQUFNLElBQUksSUFBSSxTQUFTLENBQUMsS0FBSyxFQUFFLElBQUksRUFBRSxNQUFNLENBQUMsVUFBVSxFQUFFLElBQUksRUFBRSxJQUFJLENBQUMsRUFBRTtRQUN4RSxLQUFLLENBQUMsR0FBRyxDQUFDLElBQUksQ0FBQyxNQUFNLENBQUMsS0FBSyxDQUFDLENBQUM7S0FDOUI7SUFDRCxPQUFPLEtBQUssQ0FBQyxJQUFJLENBQUMsS0FBSyxDQUFDLENBQUMsSUFBSSxFQUFFLENBQUM7QUFDbEMsQ0FBQztBQUVEOzs7OztHQUtHO0FBQ0gsTUFBTSxVQUFVLGdCQUFnQixDQUFDLEtBQVk7SUFDM0MsTUFBTSxLQUFLLEdBQUcsSUFBSSxHQUFHLEVBQVUsQ0FBQztJQUNoQyxLQUFLLE1BQU0sSUFBSSxJQUFJLFNBQVMsQ0FBQyxLQUFLLEVBQUUsSUFBSSxFQUFFLE1BQU0sQ0FBQyxZQUFZLEVBQUUsSUFBSSxFQUFFLElBQUksQ0FBQyxFQUFFO1FBQzFFLEtBQUssQ0FBQyxHQUFHLENBQUMsSUFBSSxDQUFDLE1BQU0sQ0FBQyxLQUFLLENBQUMsQ0FBQztLQUM5QjtJQUNELE9BQU8sS0FBSyxDQUFDLElBQUksQ0FBQyxLQUFLLENBQUMsQ0FBQyxJQUFJLEVBQUUsQ0FBQztBQUNsQyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLyogZXNsaW50LWRpc2FibGUgQHR5cGVzY3JpcHQtZXNsaW50L25hbWluZy1jb252ZW50aW9uICovXG5pbXBvcnQgeyByZWFkUXVhZHMsIFN0b3JlIH0gZnJvbSAndHJpcGxlLXN0b3JlLXV0aWxzJztcblxuaW1wb3J0IHsgQWdncmVnYXRlUmVzdWx0IH0gZnJvbSAnLi4vaW50ZXJmYWNlcyc7XG5pbXBvcnQgeyBlbnRpdHkgfSBmcm9tICcuLi91dGlsL3ByZWZpeGVzJztcblxuXG5mdW5jdGlvbiBnZXRPYmplY3RzKHN0b3JlOiBTdG9yZSwgaWRzOiBTZXQ8c3RyaW5nPiwgcHJlZGljYXRlOiBzdHJpbmcpOiBTZXQ8c3RyaW5nPiB7XG4gIGNvbnN0IG9iamVjdHMgPSBuZXcgU2V0PHN0cmluZz4oKTtcbiAgZm9yIChjb25zdCBpZCBvZiBpZHMpIHtcbiAgICBmb3IgKGNvbnN0IHF1YWQgb2YgcmVhZFF1YWRzKHN0b3JlLCBpZCwgcHJlZGljYXRlLCBudWxsLCBudWxsKSkge1xuICAgICAgb2JqZWN0cy5hZGQocXVhZC5vYmplY3QuaWQpO1xuICAgIH1cbiAgfVxuICByZXR1cm4gb2JqZWN0cztcbn1cblxuLyoqXG4gKiBDb21wdXRlcyBhZ2dyZWdhdGUgcmVzdWx0cy5cbiAqXG4gKiBAcGFyYW0gaWRzIElkcyBvZiBvYmplY3RzIHRvIGNhbGN1bGF0ZSBhZ2dyZWdhdGUgb3Zlci5cbiAqIEBwYXJhbSBzdG9yZSBUaGUgdHJpcGxlIHN0b3JlLlxuICogQHJldHVybnMgVGhlIGxpc3Qgb2YgYWdncmVnYXRlIHJlc3VsdHMuXG4gKi9cbmV4cG9ydCBmdW5jdGlvbiBnZXRBZ2dyZWdhdGVSZXN1bHRzKGlkczogU2V0PHN0cmluZz4sIHN0b3JlOiBTdG9yZSk6IEFnZ3JlZ2F0ZVJlc3VsdFtdIHtcbiAgY29uc3QgZG9ub3JzID0gZ2V0T2JqZWN0cyhzdG9yZSwgaWRzLCBlbnRpdHkuZG9ub3IuaWQpO1xuICBjb25zdCBjZW50ZXJzID0gZ2V0T2JqZWN0cyhzdG9yZSwgZG9ub3JzLCBlbnRpdHkucHJvdmlkZXJVVUlELmlkKTtcblxuICBjb25zdCB0aXNzdWVCbG9ja3MgPSBuZXcgU2V0PHN0cmluZz4oKTtcbiAgZm9yIChjb25zdCBpZCBvZiBpZHMpIHtcbiAgICBmb3IgKGNvbnN0IHF1YWQgb2YgcmVhZFF1YWRzKHN0b3JlLCBpZCwgZW50aXR5LnNwYXRpYWxFbnRpdHksIG51bGwsIG51bGwpKSB7XG4gICAgICB0aXNzdWVCbG9ja3MuYWRkKHF1YWQuc3ViamVjdC5pZCk7XG4gICAgfVxuICB9XG5cbiAgY29uc3QgdGlzc3VlU2VjdGlvbnMgPSBnZXRPYmplY3RzKHN0b3JlLCB0aXNzdWVCbG9ja3MsIGVudGl0eS5zZWN0aW9ucy5pZCk7XG4gIGNvbnN0IHRpc3N1ZURhdGFzZXRzID0gbmV3IFNldDxzdHJpbmc+KFtcbiAgICAuLi5nZXRPYmplY3RzKHN0b3JlLCB0aXNzdWVCbG9ja3MsIGVudGl0eS5kYXRhc2V0cy5pZCksXG4gICAgLi4uZ2V0T2JqZWN0cyhzdG9yZSwgdGlzc3VlU2VjdGlvbnMsIGVudGl0eS5kYXRhc2V0cy5pZClcbiAgXSk7XG5cbiAgY29uc3QgcmVzdWx0czogeyBba2V5OiBzdHJpbmddOiBudW1iZXIgfSA9IHtcbiAgICAnVGlzc3VlIERhdGEgUHJvdmlkZXJzJzogY2VudGVycy5zaXplLFxuICAgIERvbm9yczogZG9ub3JzLnNpemUsXG4gICAgJ1Rpc3N1ZSBCbG9ja3MnOiB0aXNzdWVCbG9ja3Muc2l6ZSxcbiAgICAnVGlzc3VlIFNlY3Rpb25zJzogdGlzc3VlU2VjdGlvbnMuc2l6ZSxcbiAgICAnVGlzc3VlIERhdGFzZXRzJzogdGlzc3VlRGF0YXNldHMuc2l6ZVxuICB9O1xuXG4gIHJldHVybiBPYmplY3QuZW50cmllcyhyZXN1bHRzKS5tYXAoKFtsYWJlbCwgY291bnRdKSA9PiAoeyBsYWJlbCwgY291bnQgfSkpO1xufVxuXG4vKipcbiAqIEdldCBhIGxpc3Qgb2YgdGVjaG5vbG9neSBuYW1lcyB1c2VkIGJ5IGRhdGFzZXRzXG4gKlxuICogQHBhcmFtIHN0b3JlIFRoZSB0cmlwbGUgc3RvcmUuXG4gKiBAcmV0dXJucyBsaXN0IG9mIHVuaXF1ZSB0ZWNobm9sb2d5IG5hbWVzIGluIHRoZSBkYXRhXG4gKi9cbmV4cG9ydCBmdW5jdGlvbiBnZXREYXRhc2V0VGVjaG5vbG9neU5hbWVzKHN0b3JlOiBTdG9yZSk6IHN0cmluZ1tdIHtcbiAgY29uc3QgbmFtZXMgPSBuZXcgU2V0PHN0cmluZz4oKTtcbiAgZm9yIChjb25zdCBxdWFkIG9mIHJlYWRRdWFkcyhzdG9yZSwgbnVsbCwgZW50aXR5LnRlY2hub2xvZ3ksIG51bGwsIG51bGwpKSB7XG4gICAgbmFtZXMuYWRkKHF1YWQub2JqZWN0LnZhbHVlKTtcbiAgfVxuICByZXR1cm4gQXJyYXkuZnJvbShuYW1lcykuc29ydCgpO1xufVxuXG4vKipcbiAqIEdldCBhIGxpc3Qgb2YgcHJvdmlkZXIgbmFtZXMgZnJvbSB0aGUgZGF0YWJhc2VcbiAqXG4gKiBAcGFyYW0gc3RvcmUgVGhlIHRyaXBsZSBzdG9yZS5cbiAqIEByZXR1cm5zIGxpc3Qgb2YgdW5pcXVlIHByb3ZpZGVyIG5hbWVzIGluIHRoZSBkYXRhXG4gKi9cbmV4cG9ydCBmdW5jdGlvbiBnZXRQcm92aWRlck5hbWVzKHN0b3JlOiBTdG9yZSk6IHN0cmluZ1tdIHtcbiAgY29uc3QgbmFtZXMgPSBuZXcgU2V0PHN0cmluZz4oKTtcbiAgZm9yIChjb25zdCBxdWFkIG9mIHJlYWRRdWFkcyhzdG9yZSwgbnVsbCwgZW50aXR5LnByb3ZpZGVyTmFtZSwgbnVsbCwgbnVsbCkpIHtcbiAgICBuYW1lcy5hZGQocXVhZC5vYmplY3QudmFsdWUpO1xuICB9XG4gIHJldHVybiBBcnJheS5mcm9tKG5hbWVzKS5zb3J0KCk7XG59XG4iXX0= \ No newline at end of file diff --git a/ccf-database/esm2015/lib/queries/find-ids-n3.js b/ccf-database/esm2015/lib/queries/find-ids-n3.js deleted file mode 100644 index 2e2d2f355..000000000 --- a/ccf-database/esm2015/lib/queries/find-ids-n3.js +++ /dev/null @@ -1,316 +0,0 @@ -import { isFinite } from 'lodash'; -import { fromRdf } from 'rdf-literal'; -import { DataFactory, readQuads } from 'triple-store-utils'; -import { ccf, entity, rui } from '../util/prefixes'; -import { filterByProbingSphere } from './spatial-search-n3'; -function filterWithDonor(store, seen, callback) { - var _a, _b; - const donor2entity = new Map(); - const donors = new Set(); - for (const subject of seen) { - for (const quad of readQuads(store, subject, entity.donor, null, null)) { - donors.add(quad.object.id); - if (!donor2entity.has(quad.object.id)) { - donor2entity.set(quad.object.id, [subject]); - } - else { - (_a = donor2entity.get(quad.object.id)) === null || _a === void 0 ? void 0 : _a.push(subject); - } - } - } - const newDonors = callback(donors); - const newSeen = new Set(); - for (const d of newDonors) { - for (const s of (_b = donor2entity.get(d)) !== null && _b !== void 0 ? _b : []) { - newSeen.add(s); - } - } - return newSeen; -} -function filterWithSpatialEntity(store, seen, callback) { - var _a, _b; - const spatial2entity = new Map(); - const entities = new Set(); - for (const subject of seen) { - for (const quad of readQuads(store, subject, entity.spatialEntity, null, null)) { - entities.add(quad.object.id); - if (!spatial2entity.has(quad.object.id)) { - spatial2entity.set(quad.object.id, [subject]); - } - else { - (_a = spatial2entity.get(quad.object.id)) === null || _a === void 0 ? void 0 : _a.push(subject); - } - } - } - const newSpatialEntities = callback(entities); - const newSeen = new Set(); - for (const e of newSpatialEntities) { - for (const s of (_b = spatial2entity.get(e)) !== null && _b !== void 0 ? _b : []) { - newSeen.add(s); - } - } - return newSeen; -} -function filterWithDataset(store, seen, callback) { - var _a, _b; - const dataset2entity = new Map(); - const datasets = new Set(); - const sectionAndBlockSeen = new Set(seen); - for (const subject of seen) { - for (const quad of readQuads(store, subject, entity.sections, null, null)) { - sectionAndBlockSeen.add(quad.object.id); - } - } - for (const subject of sectionAndBlockSeen) { - for (const quad of readQuads(store, subject, entity.datasets, null, null)) { - datasets.add(quad.object.id); - if (!dataset2entity.has(quad.object.id)) { - dataset2entity.set(quad.object.id, [subject]); - } - else { - (_a = dataset2entity.get(quad.object.id)) === null || _a === void 0 ? void 0 : _a.push(subject); - } - } - } - const newDatasets = callback(datasets); - const newSeen = new Set(); - for (const e of newDatasets) { - for (const s of (_b = dataset2entity.get(e)) !== null && _b !== void 0 ? _b : []) { - newSeen.add(s); - } - } - return newSeen; -} -/** - * Finds all ids of object matching a filter. - * - * @param store The triple store. - * @param filter The filter to limit objects. - * @returns A set of all ids matching the filter. - */ -export function findIds(store, graph, filter) { - var _a, _b, _c, _d, _e, _f, _g; - let seen = getAllEntities(store); - if (seen.size > 0) { - seen = filterByHasSpatialEntity(store, seen); - } - if (seen.size > 0 && (filter.sex === 'Male' || filter.sex === 'Female')) { - const sex = filter.sex; - seen = filterWithDonor(store, seen, (donors) => filterBySex(store, donors, sex)); - } - if (seen.size > 0 && ((_a = filter.tmc) === null || _a === void 0 ? void 0 : _a.length) > 0) { - seen = filterWithDonor(store, seen, (donors) => filterByGroupName(store, donors, filter.tmc)); - } - if (seen.size > 0 && ((_b = filter.technologies) === null || _b === void 0 ? void 0 : _b.length) > 0) { - seen = filterWithDataset(store, seen, (datasets) => filterByTechnology(store, datasets, filter.technologies)); - } - if (seen.size > 0 && ((_c = filter.spatialSearches) === null || _c === void 0 ? void 0 : _c.length) > 0) { - seen = filterWithSpatialEntity(store, seen, (entities) => filterBySpatialSearches(store, graph, entities, filter.spatialSearches)); - } - if (seen.size > 0 && ((_d = filter.ontologyTerms) === null || _d === void 0 ? void 0 : _d.length) > 0) { - const terms = filter.ontologyTerms; - if (terms.indexOf(rui.body.id) === -1) { - seen = filterWithSpatialEntity(store, seen, (entities) => filterByOntologyTerms(store, entities, terms)); - } - } - if (seen.size > 0 && ((_e = filter.cellTypeTerms) === null || _e === void 0 ? void 0 : _e.length) > 0) { - const terms = filter.cellTypeTerms; - if (terms.indexOf(rui.cell.id) === -1) { - seen = filterWithSpatialEntity(store, seen, (entities) => filterByCellTypeTerms(store, entities, terms)); - } - } - if (seen.size > 0 && ((_f = filter.ageRange) === null || _f === void 0 ? void 0 : _f.length) === 2 && - isFinite(filter.ageRange[0]) && isFinite(filter.ageRange[1])) { - const maxAge = Math.max(...filter.ageRange); - const minAge = Math.min(...filter.ageRange); - // Age filter given by their default range will be ignored - if (!(minAge === 1 && maxAge === 110)) { - seen = filterWithDonor(store, seen, (donors) => filterByAge(store, donors, minAge, maxAge)); - } - } - if (seen.size > 0 && ((_g = filter.bmiRange) === null || _g === void 0 ? void 0 : _g.length) === 2 && - isFinite(filter.bmiRange[0]) && isFinite(filter.bmiRange[1])) { - const maxBMI = Math.max(...filter.bmiRange); - const minBMI = Math.min(...filter.bmiRange); - // BMI filter given by their default range will be ignored - if (!(minBMI === 13 && maxBMI === 83)) { - seen = filterWithDonor(store, seen, (donors) => filterByBMI(store, donors, minBMI, maxBMI)); - } - } - return seen; -} -/** - * Gets all object ids in a store. - * - * @param store The triple store. - * @returns A set of all ids. - */ -function getAllEntities(store) { - const seen = new Set(); - store.forSubjects((s) => seen.add(s.id), entity.spatialEntity, null, null); - return seen; -} -/** - * Creates a callback function that adds ids to a second set iff it exists in the first set. - * - * @param seen The first set of ids. - * @param newSeen The second set to add ids to. - * @returns The callback function. - */ -function differenceCallback(seen, newSeen) { - return function (term) { - if (seen.has(term.id)) { - newSeen.add(term.id); - } - }; -} -/** - * Filters ids by sex. - * - * @param store The triple store. - * @param seen All ids to choose from. - * @param sex Sex to filter on. - * @returns The subset of ids with the specified sex. - */ -function filterBySex(store, seen, sex) { - const newSeen = new Set(); - store.forSubjects(differenceCallback(seen, newSeen), entity.sex, entity[sex], null); - return newSeen; -} -/** - * Filters ids by group names. - * - * @param store The triple store. - * @param seen All ids to choose from. - * @param groupNames Group names to filter on. - * @returns The subset of ids with the specified group names. - */ -function filterByGroupName(store, seen, groupNames) { - const newSeen = new Set(); - for (const groupName of groupNames) { - const literal = DataFactory.literal(groupName); - store.forSubjects(differenceCallback(seen, newSeen), entity.providerName, literal, null); - } - return newSeen; -} -/** - * Filters ids by technology names. - * - * @param store The triple store. - * @param seen All ids to choose from. - * @param technologies Technology names to filter on. - * @returns The subset of ids with the specified technology names. - */ -function filterByTechnology(store, seen, technologies) { - const newSeen = new Set(); - for (const technology of technologies) { - const literal = DataFactory.literal(technology); - store.forSubjects(differenceCallback(seen, newSeen), entity.technology, literal, null); - } - return newSeen; -} -/** - * Filters ids by ontology terms. - * - * @param store The triple store. - * @param seen All ids to choose from. - * @param terms Ontology terms to filter on. - * @returns The subset of ids with the specified ontology terms. - */ -function filterByOntologyTerms(store, seen, terms) { - const newSeen = new Set(); - for (const term of terms) { - const namedNode = DataFactory.namedNode(term); - store.forSubjects(differenceCallback(seen, newSeen), ccf.spatialEntity.ccf_annotations, namedNode, null); - } - return newSeen; -} -/** - * Filters ids by cell type terms. - * - * @param store The triple store. - * @param seen All ids to choose from. - * @param terms Cell type terms to filter on. - * @returns The subset of ids with the specified cell type terms. - */ -function filterByCellTypeTerms(store, seen, terms) { - const asTerms = new Set(); - for (const term of terms) { - store.forObjects((asTerm) => { - asTerms.add(asTerm.id); - }, term, ccf.asctb.located_in, null); - if (term === rui.cell.id) { - asTerms.add(rui.body.id); - } - } - return filterByOntologyTerms(store, seen, [...asTerms]); -} -/** - * Filters ids by age. - * - * @param store The triple store. - * @param seen All ids to choose from. - * @param minAge Minimum age. - * @param maxAge Maximum age. - * @returns The subset of ids with the specified age. - */ -function filterByAge(store, seen, minAge, maxAge) { - const newSeen = new Set(); - for (const subject of seen) { - for (const quad of readQuads(store, subject, entity.age, null, null)) { - const value = fromRdf(quad.object); - if (value >= minAge && value <= maxAge) { - newSeen.add(subject); - } - } - } - return newSeen; -} -/** - * Filters ids by BMI. - * - * @param store The triple store. - * @param seen All ids to choose from. - * @param minBMI Minimum BMI. - * @param maxBMI Maximum BMI. - * @returns The subset of ids with the specified BMI. - */ -function filterByBMI(store, seen, minBMI, maxBMI) { - const newSeen = new Set(); - for (const subject of seen) { - for (const quad of readQuads(store, subject, entity.bmi, null, null)) { - const value = fromRdf(quad.object); - if (value >= minBMI && value <= maxBMI) { - newSeen.add(subject); - } - } - } - return newSeen; -} -/** - * Filters ids by spatial entities. - * - * @param store The triple store. - * @param seen All ids to choose from. - * @param hasSpatialEntity Whether the filtered objects should have a spatial entity. - * @returns The subset of ids with/without spatial entities. - */ -function filterByHasSpatialEntity(store, seen, hasSpatialEntity = true) { - const newSeen = new Set(); - store.forSubjects(differenceCallback(seen, newSeen), entity.spatialEntity, null, null); - if (!hasSpatialEntity) { - const notNewSeen = new Set(); - seen.forEach((s) => !newSeen.has(s) ? notNewSeen.add(s) : undefined); - return notNewSeen; - } - return newSeen; -} -function filterBySpatialSearches(store, graph, seen, spatialSearches) { - const newSeen = new Set(); - for (const search of spatialSearches) { - const thisSeen = filterByProbingSphere(store, graph, seen, search); - thisSeen.forEach((s) => newSeen.add(s)); - } - return newSeen; -} -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmluZC1pZHMtbjMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9jY2YtZGF0YWJhc2Uvc3JjL2xpYi9xdWVyaWVzL2ZpbmQtaWRzLW4zLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxRQUFRLEVBQUUsTUFBTSxRQUFRLENBQUM7QUFDbEMsT0FBTyxFQUFFLE9BQU8sRUFBRSxNQUFNLGFBQWEsQ0FBQztBQUN0QyxPQUFPLEVBQUUsV0FBVyxFQUFXLFNBQVMsRUFBZSxNQUFNLG9CQUFvQixDQUFDO0FBSWxGLE9BQU8sRUFBRSxHQUFHLEVBQUUsTUFBTSxFQUFFLEdBQUcsRUFBRSxNQUFNLGtCQUFrQixDQUFDO0FBQ3BELE9BQU8sRUFBRSxxQkFBcUIsRUFBRSxNQUFNLHFCQUFxQixDQUFDO0FBRzVELFNBQVMsZUFBZSxDQUFDLEtBQVksRUFBRSxJQUFpQixFQUFFLFFBQWtEOztJQUMxRyxNQUFNLFlBQVksR0FBRyxJQUFJLEdBQUcsRUFBb0IsQ0FBQztJQUNqRCxNQUFNLE1BQU0sR0FBRyxJQUFJLEdBQUcsRUFBVSxDQUFDO0lBQ2pDLEtBQUssTUFBTSxPQUFPLElBQUksSUFBSSxFQUFFO1FBQzFCLEtBQUssTUFBTSxJQUFJLElBQUksU0FBUyxDQUFDLEtBQUssRUFBRSxPQUFPLEVBQUUsTUFBTSxDQUFDLEtBQUssRUFBRSxJQUFJLEVBQUUsSUFBSSxDQUFDLEVBQUU7WUFDdEUsTUFBTSxDQUFDLEdBQUcsQ0FBQyxJQUFJLENBQUMsTUFBTSxDQUFDLEVBQUUsQ0FBQyxDQUFDO1lBQzNCLElBQUksQ0FBQyxZQUFZLENBQUMsR0FBRyxDQUFDLElBQUksQ0FBQyxNQUFNLENBQUMsRUFBRSxDQUFDLEVBQUU7Z0JBQ3JDLFlBQVksQ0FBQyxHQUFHLENBQUMsSUFBSSxDQUFDLE1BQU0sQ0FBQyxFQUFFLEVBQUUsQ0FBQyxPQUFPLENBQUMsQ0FBQyxDQUFDO2FBQzdDO2lCQUFNO2dCQUNMLE1BQUEsWUFBWSxDQUFDLEdBQUcsQ0FBQyxJQUFJLENBQUMsTUFBTSxDQUFDLEVBQUUsQ0FBQywwQ0FBRSxJQUFJLENBQUMsT0FBTyxDQUFDLENBQUM7YUFDakQ7U0FDRjtLQUNGO0lBRUQsTUFBTSxTQUFTLEdBQUcsUUFBUSxDQUFDLE1BQU0sQ0FBQyxDQUFDO0lBQ25DLE1BQU0sT0FBTyxHQUFHLElBQUksR0FBRyxFQUFVLENBQUM7SUFDbEMsS0FBSyxNQUFNLENBQUMsSUFBSSxTQUFTLEVBQUU7UUFDekIsS0FBSyxNQUFNLENBQUMsSUFBSSxNQUFBLFlBQVksQ0FBQyxHQUFHLENBQUMsQ0FBQyxDQUFDLG1DQUFJLEVBQUUsRUFBRTtZQUN6QyxPQUFPLENBQUMsR0FBRyxDQUFDLENBQUMsQ0FBQyxDQUFDO1NBQ2hCO0tBQ0Y7SUFDRCxPQUFPLE9BQU8sQ0FBQztBQUNqQixDQUFDO0FBRUQsU0FBUyx1QkFBdUIsQ0FBQyxLQUFZLEVBQUUsSUFBaUIsRUFBRSxRQUFvRDs7SUFDcEgsTUFBTSxjQUFjLEdBQUcsSUFBSSxHQUFHLEVBQW9CLENBQUM7SUFDbkQsTUFBTSxRQUFRLEdBQUcsSUFBSSxHQUFHLEVBQVUsQ0FBQztJQUNuQyxLQUFLLE1BQU0sT0FBTyxJQUFJLElBQUksRUFBRTtRQUMxQixLQUFLLE1BQU0sSUFBSSxJQUFJLFNBQVMsQ0FBQyxLQUFLLEVBQUUsT0FBTyxFQUFFLE1BQU0sQ0FBQyxhQUFhLEVBQUUsSUFBSSxFQUFFLElBQUksQ0FBQyxFQUFFO1lBQzlFLFFBQVEsQ0FBQyxHQUFHLENBQUMsSUFBSSxDQUFDLE1BQU0sQ0FBQyxFQUFFLENBQUMsQ0FBQztZQUM3QixJQUFJLENBQUMsY0FBYyxDQUFDLEdBQUcsQ0FBQyxJQUFJLENBQUMsTUFBTSxDQUFDLEVBQUUsQ0FBQyxFQUFFO2dCQUN2QyxjQUFjLENBQUMsR0FBRyxDQUFDLElBQUksQ0FBQyxNQUFNLENBQUMsRUFBRSxFQUFFLENBQUMsT0FBTyxDQUFDLENBQUMsQ0FBQzthQUMvQztpQkFBTTtnQkFDTCxNQUFBLGNBQWMsQ0FBQyxHQUFHLENBQUMsSUFBSSxDQUFDLE1BQU0sQ0FBQyxFQUFFLENBQUMsMENBQUUsSUFBSSxDQUFDLE9BQU8sQ0FBQyxDQUFDO2FBQ25EO1NBQ0Y7S0FDRjtJQUVELE1BQU0sa0JBQWtCLEdBQUcsUUFBUSxDQUFDLFFBQVEsQ0FBQyxDQUFDO0lBQzlDLE1BQU0sT0FBTyxHQUFHLElBQUksR0FBRyxFQUFVLENBQUM7SUFDbEMsS0FBSyxNQUFNLENBQUMsSUFBSSxrQkFBa0IsRUFBRTtRQUNsQyxLQUFLLE1BQU0sQ0FBQyxJQUFJLE1BQUEsY0FBYyxDQUFDLEdBQUcsQ0FBQyxDQUFDLENBQUMsbUNBQUksRUFBRSxFQUFFO1lBQzNDLE9BQU8sQ0FBQyxHQUFHLENBQUMsQ0FBQyxDQUFDLENBQUM7U0FDaEI7S0FDRjtJQUNELE9BQU8sT0FBTyxDQUFDO0FBQ2pCLENBQUM7QUFFRCxTQUFTLGlCQUFpQixDQUFDLEtBQVksRUFBRSxJQUFpQixFQUFFLFFBQW9EOztJQUM5RyxNQUFNLGNBQWMsR0FBRyxJQUFJLEdBQUcsRUFBb0IsQ0FBQztJQUNuRCxNQUFNLFFBQVEsR0FBRyxJQUFJLEdBQUcsRUFBVSxDQUFDO0lBRW5DLE1BQU0sbUJBQW1CLEdBQUcsSUFBSSxHQUFHLENBQVMsSUFBSSxDQUFDLENBQUM7SUFDbEQsS0FBSyxNQUFNLE9BQU8sSUFBSSxJQUFJLEVBQUU7UUFDMUIsS0FBSyxNQUFNLElBQUksSUFBSSxTQUFTLENBQUMsS0FBSyxFQUFFLE9BQU8sRUFBRSxNQUFNLENBQUMsUUFBUSxFQUFFLElBQUksRUFBRSxJQUFJLENBQUMsRUFBRTtZQUN6RSxtQkFBbUIsQ0FBQyxHQUFHLENBQUMsSUFBSSxDQUFDLE1BQU0sQ0FBQyxFQUFFLENBQUMsQ0FBQztTQUN6QztLQUNGO0lBRUQsS0FBSyxNQUFNLE9BQU8sSUFBSSxtQkFBbUIsRUFBRTtRQUN6QyxLQUFLLE1BQU0sSUFBSSxJQUFJLFNBQVMsQ0FBQyxLQUFLLEVBQUUsT0FBTyxFQUFFLE1BQU0sQ0FBQyxRQUFRLEVBQUUsSUFBSSxFQUFFLElBQUksQ0FBQyxFQUFFO1lBQ3pFLFFBQVEsQ0FBQyxHQUFHLENBQUMsSUFBSSxDQUFDLE1BQU0sQ0FBQyxFQUFFLENBQUMsQ0FBQztZQUM3QixJQUFJLENBQUMsY0FBYyxDQUFDLEdBQUcsQ0FBQyxJQUFJLENBQUMsTUFBTSxDQUFDLEVBQUUsQ0FBQyxFQUFFO2dCQUN2QyxjQUFjLENBQUMsR0FBRyxDQUFDLElBQUksQ0FBQyxNQUFNLENBQUMsRUFBRSxFQUFFLENBQUMsT0FBTyxDQUFDLENBQUMsQ0FBQzthQUMvQztpQkFBTTtnQkFDTCxNQUFBLGNBQWMsQ0FBQyxHQUFHLENBQUMsSUFBSSxDQUFDLE1BQU0sQ0FBQyxFQUFFLENBQUMsMENBQUUsSUFBSSxDQUFDLE9BQU8sQ0FBQyxDQUFDO2FBQ25EO1NBQ0Y7S0FDRjtJQUVELE1BQU0sV0FBVyxHQUFHLFFBQVEsQ0FBQyxRQUFRLENBQUMsQ0FBQztJQUN2QyxNQUFNLE9BQU8sR0FBRyxJQUFJLEdBQUcsRUFBVSxDQUFDO0lBQ2xDLEtBQUssTUFBTSxDQUFDLElBQUksV0FBVyxFQUFFO1FBQzNCLEtBQUssTUFBTSxDQUFDLElBQUksTUFBQSxjQUFjLENBQUMsR0FBRyxDQUFDLENBQUMsQ0FBQyxtQ0FBSSxFQUFFLEVBQUU7WUFDM0MsT0FBTyxDQUFDLEdBQUcsQ0FBQyxDQUFDLENBQUMsQ0FBQztTQUNoQjtLQUNGO0lBQ0QsT0FBTyxPQUFPLENBQUM7QUFDakIsQ0FBQztBQUVEOzs7Ozs7R0FNRztBQUNILE1BQU0sVUFBVSxPQUFPLENBQUMsS0FBWSxFQUFFLEtBQXNCLEVBQUUsTUFBYzs7SUFDMUUsSUFBSSxJQUFJLEdBQUcsY0FBYyxDQUFDLEtBQUssQ0FBQyxDQUFDO0lBQ2pDLElBQUksSUFBSSxDQUFDLElBQUksR0FBRyxDQUFDLEVBQUU7UUFDakIsSUFBSSxHQUFHLHdCQUF3QixDQUFDLEtBQUssRUFBRSxJQUFJLENBQUMsQ0FBQztLQUM5QztJQUNELElBQUksSUFBSSxDQUFDLElBQUksR0FBRyxDQUFDLElBQUksQ0FBQyxNQUFNLENBQUMsR0FBRyxLQUFLLE1BQU0sSUFBSSxNQUFNLENBQUMsR0FBRyxLQUFLLFFBQVEsQ0FBQyxFQUFFO1FBQ3ZFLE1BQU0sR0FBRyxHQUFHLE1BQU0sQ0FBQyxHQUFHLENBQUM7UUFDdkIsSUFBSSxHQUFHLGVBQWUsQ0FBQyxLQUFLLEVBQUUsSUFBSSxFQUFFLENBQUMsTUFBTSxFQUFFLEVBQUUsQ0FDN0MsV0FBVyxDQUFDLEtBQUssRUFBRSxNQUFNLEVBQUUsR0FBRyxDQUFDLENBQ2hDLENBQUM7S0FDSDtJQUNELElBQUksSUFBSSxDQUFDLElBQUksR0FBRyxDQUFDLElBQUksQ0FBQSxNQUFBLE1BQU0sQ0FBQyxHQUFHLDBDQUFFLE1BQU0sSUFBRyxDQUFDLEVBQUU7UUFDM0MsSUFBSSxHQUFHLGVBQWUsQ0FBQyxLQUFLLEVBQUUsSUFBSSxFQUFFLENBQUMsTUFBTSxFQUFFLEVBQUUsQ0FDN0MsaUJBQWlCLENBQUMsS0FBSyxFQUFFLE1BQU0sRUFBRSxNQUFNLENBQUMsR0FBRyxDQUFDLENBQzdDLENBQUM7S0FDSDtJQUNELElBQUksSUFBSSxDQUFDLElBQUksR0FBRyxDQUFDLElBQUksQ0FBQSxNQUFBLE1BQU0sQ0FBQyxZQUFZLDBDQUFFLE1BQU0sSUFBRyxDQUFDLEVBQUU7UUFDcEQsSUFBSSxHQUFHLGlCQUFpQixDQUFDLEtBQUssRUFBRSxJQUFJLEVBQUUsQ0FBQyxRQUFRLEVBQUUsRUFBRSxDQUNqRCxrQkFBa0IsQ0FBQyxLQUFLLEVBQUUsUUFBUSxFQUFFLE1BQU0sQ0FBQyxZQUFZLENBQUMsQ0FDekQsQ0FBQztLQUNIO0lBQ0QsSUFBSSxJQUFJLENBQUMsSUFBSSxHQUFHLENBQUMsSUFBSSxDQUFBLE1BQUEsTUFBTSxDQUFDLGVBQWUsMENBQUUsTUFBTSxJQUFHLENBQUMsRUFBRTtRQUN2RCxJQUFJLEdBQUcsdUJBQXVCLENBQUMsS0FBSyxFQUFFLElBQUksRUFBRSxDQUFDLFFBQVEsRUFBRSxFQUFFLENBQ3ZELHVCQUF1QixDQUFDLEtBQUssRUFBRSxLQUFLLEVBQUUsUUFBUSxFQUFFLE1BQU0sQ0FBQyxlQUFlLENBQUMsQ0FDeEUsQ0FBQztLQUNIO0lBQ0QsSUFBSSxJQUFJLENBQUMsSUFBSSxHQUFHLENBQUMsSUFBSSxDQUFBLE1BQUEsTUFBTSxDQUFDLGFBQWEsMENBQUUsTUFBTSxJQUFHLENBQUMsRUFBRTtRQUNyRCxNQUFNLEtBQUssR0FBRyxNQUFNLENBQUMsYUFBYSxDQUFDO1FBQ25DLElBQUksS0FBSyxDQUFDLE9BQU8sQ0FBQyxHQUFHLENBQUMsSUFBSSxDQUFDLEVBQUUsQ0FBQyxLQUFLLENBQUMsQ0FBQyxFQUFFO1lBQ3JDLElBQUksR0FBRyx1QkFBdUIsQ0FBQyxLQUFLLEVBQUUsSUFBSSxFQUFFLENBQUMsUUFBUSxFQUFFLEVBQUUsQ0FDdkQscUJBQXFCLENBQUMsS0FBSyxFQUFFLFFBQVEsRUFBRSxLQUFLLENBQUMsQ0FDOUMsQ0FBQztTQUNIO0tBQ0Y7SUFDRCxJQUFJLElBQUksQ0FBQyxJQUFJLEdBQUcsQ0FBQyxJQUFJLENBQUEsTUFBQSxNQUFNLENBQUMsYUFBYSwwQ0FBRSxNQUFNLElBQUcsQ0FBQyxFQUFFO1FBQ3JELE1BQU0sS0FBSyxHQUFHLE1BQU0sQ0FBQyxhQUFhLENBQUM7UUFDbkMsSUFBSSxLQUFLLENBQUMsT0FBTyxDQUFDLEdBQUcsQ0FBQyxJQUFJLENBQUMsRUFBRSxDQUFDLEtBQUssQ0FBQyxDQUFDLEVBQUU7WUFDckMsSUFBSSxHQUFHLHVCQUF1QixDQUFDLEtBQUssRUFBRSxJQUFJLEVBQUUsQ0FBQyxRQUFRLEVBQUUsRUFBRSxDQUN2RCxxQkFBcUIsQ0FBQyxLQUFLLEVBQUUsUUFBUSxFQUFFLEtBQUssQ0FBQyxDQUM5QyxDQUFDO1NBQ0g7S0FDRjtJQUNELElBQUksSUFBSSxDQUFDLElBQUksR0FBRyxDQUFDLElBQUksQ0FBQSxNQUFBLE1BQU0sQ0FBQyxRQUFRLDBDQUFFLE1BQU0sTUFBSyxDQUFDO1FBQ2hELFFBQVEsQ0FBQyxNQUFNLENBQUMsUUFBUSxDQUFDLENBQUMsQ0FBQyxDQUFDLElBQUksUUFBUSxDQUFDLE1BQU0sQ0FBQyxRQUFRLENBQUMsQ0FBQyxDQUFDLENBQUMsRUFBRTtRQUM5RCxNQUFNLE1BQU0sR0FBRyxJQUFJLENBQUMsR0FBRyxDQUFDLEdBQUcsTUFBTSxDQUFDLFFBQVEsQ0FBQyxDQUFDO1FBQzVDLE1BQU0sTUFBTSxHQUFHLElBQUksQ0FBQyxHQUFHLENBQUMsR0FBRyxNQUFNLENBQUMsUUFBUSxDQUFDLENBQUM7UUFFNUMsMERBQTBEO1FBQzFELElBQUksQ0FBQyxDQUFDLE1BQU0sS0FBSyxDQUFDLElBQUksTUFBTSxLQUFLLEdBQUcsQ0FBQyxFQUFFO1lBQ3JDLElBQUksR0FBRyxlQUFlLENBQUMsS0FBSyxFQUFFLElBQUksRUFBRSxDQUFDLE1BQU0sRUFBRSxFQUFFLENBQzdDLFdBQVcsQ0FBQyxLQUFLLEVBQUUsTUFBTSxFQUFFLE1BQU0sRUFBRSxNQUFNLENBQUMsQ0FDM0MsQ0FBQztTQUNIO0tBQ0Y7SUFDRCxJQUFJLElBQUksQ0FBQyxJQUFJLEdBQUcsQ0FBQyxJQUFJLENBQUEsTUFBQSxNQUFNLENBQUMsUUFBUSwwQ0FBRSxNQUFNLE1BQUssQ0FBQztRQUNoRCxRQUFRLENBQUMsTUFBTSxDQUFDLFFBQVEsQ0FBQyxDQUFDLENBQUMsQ0FBQyxJQUFJLFFBQVEsQ0FBQyxNQUFNLENBQUMsUUFBUSxDQUFDLENBQUMsQ0FBQyxDQUFDLEVBQUU7UUFDOUQsTUFBTSxNQUFNLEdBQUcsSUFBSSxDQUFDLEdBQUcsQ0FBQyxHQUFHLE1BQU0sQ0FBQyxRQUFRLENBQUMsQ0FBQztRQUM1QyxNQUFNLE1BQU0sR0FBRyxJQUFJLENBQUMsR0FBRyxDQUFDLEdBQUcsTUFBTSxDQUFDLFFBQVEsQ0FBQyxDQUFDO1FBRTVDLDBEQUEwRDtRQUMxRCxJQUFJLENBQUMsQ0FBQyxNQUFNLEtBQUssRUFBRSxJQUFJLE1BQU0sS0FBSyxFQUFFLENBQUMsRUFBRTtZQUNyQyxJQUFJLEdBQUcsZUFBZSxDQUFDLEtBQUssRUFBRSxJQUFJLEVBQUUsQ0FBQyxNQUFNLEVBQUUsRUFBRSxDQUM3QyxXQUFXLENBQUMsS0FBSyxFQUFFLE1BQU0sRUFBRSxNQUFNLEVBQUUsTUFBTSxDQUFDLENBQzNDLENBQUM7U0FDSDtLQUNGO0lBQ0QsT0FBTyxJQUFJLENBQUM7QUFDZCxDQUFDO0FBRUQ7Ozs7O0dBS0c7QUFDSCxTQUFTLGNBQWMsQ0FBQyxLQUFZO0lBQ2xDLE1BQU0sSUFBSSxHQUFHLElBQUksR0FBRyxFQUFVLENBQUM7SUFDL0IsS0FBSyxDQUFDLFdBQVcsQ0FBQyxDQUFDLENBQUMsRUFBRSxFQUFFLENBQUMsSUFBSSxDQUFDLEdBQUcsQ0FBQyxDQUFDLENBQUMsRUFBRSxDQUFDLEVBQUUsTUFBTSxDQUFDLGFBQWEsRUFBRSxJQUFJLEVBQUUsSUFBSSxDQUFDLENBQUM7SUFDM0UsT0FBTyxJQUFJLENBQUM7QUFDZCxDQUFDO0FBRUQ7Ozs7OztHQU1HO0FBQ0gsU0FBUyxrQkFBa0IsQ0FBQyxJQUFpQixFQUFFLE9BQW9CO0lBQ2pFLE9BQU8sVUFBVSxJQUFVO1FBQ3pCLElBQUksSUFBSSxDQUFDLEdBQUcsQ0FBQyxJQUFJLENBQUMsRUFBRSxDQUFDLEVBQUU7WUFDckIsT0FBTyxDQUFDLEdBQUcsQ0FBQyxJQUFJLENBQUMsRUFBRSxDQUFDLENBQUM7U0FDdEI7SUFDSCxDQUFDLENBQUM7QUFDSixDQUFDO0FBRUQ7Ozs7Ozs7R0FPRztBQUNILFNBQVMsV0FBVyxDQUFDLEtBQVksRUFBRSxJQUFpQixFQUFFLEdBQXNCO0lBQzFFLE1BQU0sT0FBTyxHQUFHLElBQUksR0FBRyxFQUFVLENBQUM7SUFDbEMsS0FBSyxDQUFDLFdBQVcsQ0FBQyxrQkFBa0IsQ0FBQyxJQUFJLEVBQUUsT0FBTyxDQUFDLEVBQUUsTUFBTSxDQUFDLEdBQUcsRUFBRSxNQUFNLENBQUMsR0FBRyxDQUFDLEVBQUUsSUFBSSxDQUFDLENBQUM7SUFDcEYsT0FBTyxPQUFPLENBQUM7QUFDakIsQ0FBQztBQUVEOzs7Ozs7O0dBT0c7QUFDSCxTQUFTLGlCQUFpQixDQUFDLEtBQVksRUFBRSxJQUFpQixFQUFFLFVBQW9CO0lBQzlFLE1BQU0sT0FBTyxHQUFHLElBQUksR0FBRyxFQUFVLENBQUM7SUFDbEMsS0FBSyxNQUFNLFNBQVMsSUFBSSxVQUFVLEVBQUU7UUFDbEMsTUFBTSxPQUFPLEdBQUcsV0FBVyxDQUFDLE9BQU8sQ0FBQyxTQUFTLENBQUMsQ0FBQztRQUMvQyxLQUFLLENBQUMsV0FBVyxDQUFDLGtCQUFrQixDQUFDLElBQUksRUFBRSxPQUFPLENBQUMsRUFBRSxNQUFNLENBQUMsWUFBWSxFQUFFLE9BQU8sRUFBRSxJQUFJLENBQUMsQ0FBQztLQUMxRjtJQUNELE9BQU8sT0FBTyxDQUFDO0FBQ2pCLENBQUM7QUFFRDs7Ozs7OztHQU9HO0FBQ0gsU0FBUyxrQkFBa0IsQ0FBQyxLQUFZLEVBQUUsSUFBaUIsRUFBRSxZQUFzQjtJQUNqRixNQUFNLE9BQU8sR0FBRyxJQUFJLEdBQUcsRUFBVSxDQUFDO0lBQ2xDLEtBQUssTUFBTSxVQUFVLElBQUksWUFBWSxFQUFFO1FBQ3JDLE1BQU0sT0FBTyxHQUFHLFdBQVcsQ0FBQyxPQUFPLENBQUMsVUFBVSxDQUFDLENBQUM7UUFDaEQsS0FBSyxDQUFDLFdBQVcsQ0FBQyxrQkFBa0IsQ0FBQyxJQUFJLEVBQUUsT0FBTyxDQUFDLEVBQUUsTUFBTSxDQUFDLFVBQVUsRUFBRSxPQUFPLEVBQUUsSUFBSSxDQUFDLENBQUM7S0FDeEY7SUFDRCxPQUFPLE9BQU8sQ0FBQztBQUNqQixDQUFDO0FBRUQ7Ozs7Ozs7R0FPRztBQUNILFNBQVMscUJBQXFCLENBQUMsS0FBWSxFQUFFLElBQWlCLEVBQUUsS0FBZTtJQUM3RSxNQUFNLE9BQU8sR0FBRyxJQUFJLEdBQUcsRUFBVSxDQUFDO0lBQ2xDLEtBQUssTUFBTSxJQUFJLElBQUksS0FBSyxFQUFFO1FBQ3hCLE1BQU0sU0FBUyxHQUFHLFdBQVcsQ0FBQyxTQUFTLENBQUMsSUFBSSxDQUFDLENBQUM7UUFDOUMsS0FBSyxDQUFDLFdBQVcsQ0FBQyxrQkFBa0IsQ0FBQyxJQUFJLEVBQUUsT0FBTyxDQUFDLEVBQUUsR0FBRyxDQUFDLGFBQWEsQ0FBQyxlQUFlLEVBQUUsU0FBUyxFQUFFLElBQUksQ0FBQyxDQUFDO0tBQzFHO0lBQ0QsT0FBTyxPQUFPLENBQUM7QUFDakIsQ0FBQztBQUVEOzs7Ozs7O0dBT0c7QUFDSCxTQUFTLHFCQUFxQixDQUFDLEtBQVksRUFBRSxJQUFpQixFQUFFLEtBQWU7SUFDN0UsTUFBTSxPQUFPLEdBQUcsSUFBSSxHQUFHLEVBQVUsQ0FBQztJQUNsQyxLQUFLLE1BQU0sSUFBSSxJQUFJLEtBQUssRUFBRTtRQUN4QixLQUFLLENBQUMsVUFBVSxDQUFDLENBQUMsTUFBTSxFQUFFLEVBQUU7WUFDMUIsT0FBTyxDQUFDLEdBQUcsQ0FBQyxNQUFNLENBQUMsRUFBRSxDQUFDLENBQUM7UUFDekIsQ0FBQyxFQUFFLElBQUksRUFBRSxHQUFHLENBQUMsS0FBSyxDQUFDLFVBQVUsRUFBRSxJQUFJLENBQUMsQ0FBQztRQUNyQyxJQUFJLElBQUksS0FBSyxHQUFHLENBQUMsSUFBSSxDQUFDLEVBQUUsRUFBRTtZQUN4QixPQUFPLENBQUMsR0FBRyxDQUFDLEdBQUcsQ0FBQyxJQUFJLENBQUMsRUFBRSxDQUFDLENBQUM7U0FDMUI7S0FDRjtJQUNELE9BQU8scUJBQXFCLENBQUMsS0FBSyxFQUFFLElBQUksRUFBRSxDQUFDLEdBQUcsT0FBTyxDQUFDLENBQUMsQ0FBQztBQUMxRCxDQUFDO0FBRUQ7Ozs7Ozs7O0dBUUc7QUFDSCxTQUFTLFdBQVcsQ0FBQyxLQUFZLEVBQUUsSUFBaUIsRUFBRSxNQUFjLEVBQUUsTUFBYztJQUNsRixNQUFNLE9BQU8sR0FBRyxJQUFJLEdBQUcsRUFBVSxDQUFDO0lBQ2xDLEtBQUssTUFBTSxPQUFPLElBQUksSUFBSSxFQUFFO1FBQzFCLEtBQUssTUFBTSxJQUFJLElBQUksU0FBUyxDQUFDLEtBQUssRUFBRSxPQUFPLEVBQUUsTUFBTSxDQUFDLEdBQUcsRUFBRSxJQUFJLEVBQUUsSUFBSSxDQUFDLEVBQUU7WUFDcEUsTUFBTSxLQUFLLEdBQUcsT0FBTyxDQUFDLElBQUksQ0FBQyxNQUFpQixDQUFXLENBQUM7WUFDeEQsSUFBSSxLQUFLLElBQUksTUFBTSxJQUFJLEtBQUssSUFBSSxNQUFNLEVBQUU7Z0JBQ3RDLE9BQU8sQ0FBQyxHQUFHLENBQUMsT0FBTyxDQUFDLENBQUM7YUFDdEI7U0FDRjtLQUNGO0lBQ0QsT0FBTyxPQUFPLENBQUM7QUFDakIsQ0FBQztBQUVEOzs7Ozs7OztHQVFHO0FBQ0gsU0FBUyxXQUFXLENBQUMsS0FBWSxFQUFFLElBQWlCLEVBQUUsTUFBYyxFQUFFLE1BQWM7SUFDbEYsTUFBTSxPQUFPLEdBQUcsSUFBSSxHQUFHLEVBQVUsQ0FBQztJQUNsQyxLQUFLLE1BQU0sT0FBTyxJQUFJLElBQUksRUFBRTtRQUMxQixLQUFLLE1BQU0sSUFBSSxJQUFJLFNBQVMsQ0FBQyxLQUFLLEVBQUUsT0FBTyxFQUFFLE1BQU0sQ0FBQyxHQUFHLEVBQUUsSUFBSSxFQUFFLElBQUksQ0FBQyxFQUFFO1lBQ3BFLE1BQU0sS0FBSyxHQUFHLE9BQU8sQ0FBQyxJQUFJLENBQUMsTUFBaUIsQ0FBVyxDQUFDO1lBQ3hELElBQUksS0FBSyxJQUFJLE1BQU0sSUFBSSxLQUFLLElBQUksTUFBTSxFQUFFO2dCQUN0QyxPQUFPLENBQUMsR0FBRyxDQUFDLE9BQU8sQ0FBQyxDQUFDO2FBQ3RCO1NBQ0Y7S0FDRjtJQUNELE9BQU8sT0FBTyxDQUFDO0FBQ2pCLENBQUM7QUFFRDs7Ozs7OztHQU9HO0FBQ0gsU0FBUyx3QkFBd0IsQ0FBQyxLQUFZLEVBQUUsSUFBaUIsRUFBRSxnQkFBZ0IsR0FBRyxJQUFJO0lBQ3hGLE1BQU0sT0FBTyxHQUFHLElBQUksR0FBRyxFQUFVLENBQUM7SUFDbEMsS0FBSyxDQUFDLFdBQVcsQ0FBQyxrQkFBa0IsQ0FBQyxJQUFJLEVBQUUsT0FBTyxDQUFDLEVBQUUsTUFBTSxDQUFDLGFBQWEsRUFBRSxJQUFJLEVBQUUsSUFBSSxDQUFDLENBQUM7SUFDdkYsSUFBSSxDQUFDLGdCQUFnQixFQUFFO1FBQ3JCLE1BQU0sVUFBVSxHQUFHLElBQUksR0FBRyxFQUFVLENBQUM7UUFDckMsSUFBSSxDQUFDLE9BQU8sQ0FBQyxDQUFDLENBQUMsRUFBRSxFQUFFLENBQUMsQ0FBQyxPQUFPLENBQUMsR0FBRyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxVQUFVLENBQUMsR0FBRyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxTQUFTLENBQUMsQ0FBQztRQUNyRSxPQUFPLFVBQVUsQ0FBQztLQUNuQjtJQUNELE9BQU8sT0FBTyxDQUFDO0FBQ2pCLENBQUM7QUFFRCxTQUFTLHVCQUF1QixDQUFDLEtBQVksRUFBRSxLQUFzQixFQUFFLElBQWlCLEVBQUUsZUFBZ0M7SUFDeEgsTUFBTSxPQUFPLEdBQUcsSUFBSSxHQUFHLEVBQVUsQ0FBQztJQUNsQyxLQUFLLE1BQU0sTUFBTSxJQUFJLGVBQWUsRUFBRTtRQUNwQyxNQUFNLFFBQVEsR0FBRyxxQkFBcUIsQ0FBQyxLQUFLLEVBQUUsS0FBSyxFQUFFLElBQUksRUFBRSxNQUFNLENBQUMsQ0FBQztRQUNuRSxRQUFRLENBQUMsT0FBTyxDQUFDLENBQUMsQ0FBQyxFQUFFLEVBQUUsQ0FBQyxPQUFPLENBQUMsR0FBRyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7S0FDekM7SUFDRCxPQUFPLE9BQU8sQ0FBQztBQUNqQixDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgaXNGaW5pdGUgfSBmcm9tICdsb2Rhc2gnO1xuaW1wb3J0IHsgZnJvbVJkZiB9IGZyb20gJ3JkZi1saXRlcmFsJztcbmltcG9ydCB7IERhdGFGYWN0b3J5LCBMaXRlcmFsLCByZWFkUXVhZHMsIFN0b3JlLCBUZXJtIH0gZnJvbSAndHJpcGxlLXN0b3JlLXV0aWxzJztcblxuaW1wb3J0IHsgQ0NGU3BhdGlhbEdyYXBoIH0gZnJvbSAnLi4vY2NmLXNwYXRpYWwtZ3JhcGgnO1xuaW1wb3J0IHsgRmlsdGVyLCBTcGF0aWFsU2VhcmNoIH0gZnJvbSAnLi4vaW50ZXJmYWNlcyc7XG5pbXBvcnQgeyBjY2YsIGVudGl0eSwgcnVpIH0gZnJvbSAnLi4vdXRpbC9wcmVmaXhlcyc7XG5pbXBvcnQgeyBmaWx0ZXJCeVByb2JpbmdTcGhlcmUgfSBmcm9tICcuL3NwYXRpYWwtc2VhcmNoLW4zJztcblxuXG5mdW5jdGlvbiBmaWx0ZXJXaXRoRG9ub3Ioc3RvcmU6IFN0b3JlLCBzZWVuOiBTZXQ8c3RyaW5nPiwgY2FsbGJhY2s6IChkb25vcnNTZWVuOiBTZXQ8c3RyaW5nPikgPT4gU2V0PHN0cmluZz4pOiBTZXQ8c3RyaW5nPiB7XG4gIGNvbnN0IGRvbm9yMmVudGl0eSA9IG5ldyBNYXA8c3RyaW5nLCBzdHJpbmdbXT4oKTtcbiAgY29uc3QgZG9ub3JzID0gbmV3IFNldDxzdHJpbmc+KCk7XG4gIGZvciAoY29uc3Qgc3ViamVjdCBvZiBzZWVuKSB7XG4gICAgZm9yIChjb25zdCBxdWFkIG9mIHJlYWRRdWFkcyhzdG9yZSwgc3ViamVjdCwgZW50aXR5LmRvbm9yLCBudWxsLCBudWxsKSkge1xuICAgICAgZG9ub3JzLmFkZChxdWFkLm9iamVjdC5pZCk7XG4gICAgICBpZiAoIWRvbm9yMmVudGl0eS5oYXMocXVhZC5vYmplY3QuaWQpKSB7XG4gICAgICAgIGRvbm9yMmVudGl0eS5zZXQocXVhZC5vYmplY3QuaWQsIFtzdWJqZWN0XSk7XG4gICAgICB9IGVsc2Uge1xuICAgICAgICBkb25vcjJlbnRpdHkuZ2V0KHF1YWQub2JqZWN0LmlkKT8ucHVzaChzdWJqZWN0KTtcbiAgICAgIH1cbiAgICB9XG4gIH1cblxuICBjb25zdCBuZXdEb25vcnMgPSBjYWxsYmFjayhkb25vcnMpO1xuICBjb25zdCBuZXdTZWVuID0gbmV3IFNldDxzdHJpbmc+KCk7XG4gIGZvciAoY29uc3QgZCBvZiBuZXdEb25vcnMpIHtcbiAgICBmb3IgKGNvbnN0IHMgb2YgZG9ub3IyZW50aXR5LmdldChkKSA/PyBbXSkge1xuICAgICAgbmV3U2Vlbi5hZGQocyk7XG4gICAgfVxuICB9XG4gIHJldHVybiBuZXdTZWVuO1xufVxuXG5mdW5jdGlvbiBmaWx0ZXJXaXRoU3BhdGlhbEVudGl0eShzdG9yZTogU3RvcmUsIHNlZW46IFNldDxzdHJpbmc+LCBjYWxsYmFjazogKGVudGl0aWVzU2VlbjogU2V0PHN0cmluZz4pID0+IFNldDxzdHJpbmc+KTogU2V0PHN0cmluZz4ge1xuICBjb25zdCBzcGF0aWFsMmVudGl0eSA9IG5ldyBNYXA8c3RyaW5nLCBzdHJpbmdbXT4oKTtcbiAgY29uc3QgZW50aXRpZXMgPSBuZXcgU2V0PHN0cmluZz4oKTtcbiAgZm9yIChjb25zdCBzdWJqZWN0IG9mIHNlZW4pIHtcbiAgICBmb3IgKGNvbnN0IHF1YWQgb2YgcmVhZFF1YWRzKHN0b3JlLCBzdWJqZWN0LCBlbnRpdHkuc3BhdGlhbEVudGl0eSwgbnVsbCwgbnVsbCkpIHtcbiAgICAgIGVudGl0aWVzLmFkZChxdWFkLm9iamVjdC5pZCk7XG4gICAgICBpZiAoIXNwYXRpYWwyZW50aXR5LmhhcyhxdWFkLm9iamVjdC5pZCkpIHtcbiAgICAgICAgc3BhdGlhbDJlbnRpdHkuc2V0KHF1YWQub2JqZWN0LmlkLCBbc3ViamVjdF0pO1xuICAgICAgfSBlbHNlIHtcbiAgICAgICAgc3BhdGlhbDJlbnRpdHkuZ2V0KHF1YWQub2JqZWN0LmlkKT8ucHVzaChzdWJqZWN0KTtcbiAgICAgIH1cbiAgICB9XG4gIH1cblxuICBjb25zdCBuZXdTcGF0aWFsRW50aXRpZXMgPSBjYWxsYmFjayhlbnRpdGllcyk7XG4gIGNvbnN0IG5ld1NlZW4gPSBuZXcgU2V0PHN0cmluZz4oKTtcbiAgZm9yIChjb25zdCBlIG9mIG5ld1NwYXRpYWxFbnRpdGllcykge1xuICAgIGZvciAoY29uc3QgcyBvZiBzcGF0aWFsMmVudGl0eS5nZXQoZSkgPz8gW10pIHtcbiAgICAgIG5ld1NlZW4uYWRkKHMpO1xuICAgIH1cbiAgfVxuICByZXR1cm4gbmV3U2Vlbjtcbn1cblxuZnVuY3Rpb24gZmlsdGVyV2l0aERhdGFzZXQoc3RvcmU6IFN0b3JlLCBzZWVuOiBTZXQ8c3RyaW5nPiwgY2FsbGJhY2s6IChkYXRhc2V0c1NlZW46IFNldDxzdHJpbmc+KSA9PiBTZXQ8c3RyaW5nPik6IFNldDxzdHJpbmc+IHtcbiAgY29uc3QgZGF0YXNldDJlbnRpdHkgPSBuZXcgTWFwPHN0cmluZywgc3RyaW5nW10+KCk7XG4gIGNvbnN0IGRhdGFzZXRzID0gbmV3IFNldDxzdHJpbmc+KCk7XG5cbiAgY29uc3Qgc2VjdGlvbkFuZEJsb2NrU2VlbiA9IG5ldyBTZXQ8c3RyaW5nPihzZWVuKTtcbiAgZm9yIChjb25zdCBzdWJqZWN0IG9mIHNlZW4pIHtcbiAgICBmb3IgKGNvbnN0IHF1YWQgb2YgcmVhZFF1YWRzKHN0b3JlLCBzdWJqZWN0LCBlbnRpdHkuc2VjdGlvbnMsIG51bGwsIG51bGwpKSB7XG4gICAgICBzZWN0aW9uQW5kQmxvY2tTZWVuLmFkZChxdWFkLm9iamVjdC5pZCk7XG4gICAgfVxuICB9XG5cbiAgZm9yIChjb25zdCBzdWJqZWN0IG9mIHNlY3Rpb25BbmRCbG9ja1NlZW4pIHtcbiAgICBmb3IgKGNvbnN0IHF1YWQgb2YgcmVhZFF1YWRzKHN0b3JlLCBzdWJqZWN0LCBlbnRpdHkuZGF0YXNldHMsIG51bGwsIG51bGwpKSB7XG4gICAgICBkYXRhc2V0cy5hZGQocXVhZC5vYmplY3QuaWQpO1xuICAgICAgaWYgKCFkYXRhc2V0MmVudGl0eS5oYXMocXVhZC5vYmplY3QuaWQpKSB7XG4gICAgICAgIGRhdGFzZXQyZW50aXR5LnNldChxdWFkLm9iamVjdC5pZCwgW3N1YmplY3RdKTtcbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIGRhdGFzZXQyZW50aXR5LmdldChxdWFkLm9iamVjdC5pZCk/LnB1c2goc3ViamVjdCk7XG4gICAgICB9XG4gICAgfVxuICB9XG5cbiAgY29uc3QgbmV3RGF0YXNldHMgPSBjYWxsYmFjayhkYXRhc2V0cyk7XG4gIGNvbnN0IG5ld1NlZW4gPSBuZXcgU2V0PHN0cmluZz4oKTtcbiAgZm9yIChjb25zdCBlIG9mIG5ld0RhdGFzZXRzKSB7XG4gICAgZm9yIChjb25zdCBzIG9mIGRhdGFzZXQyZW50aXR5LmdldChlKSA/PyBbXSkge1xuICAgICAgbmV3U2Vlbi5hZGQocyk7XG4gICAgfVxuICB9XG4gIHJldHVybiBuZXdTZWVuO1xufVxuXG4vKipcbiAqIEZpbmRzIGFsbCBpZHMgb2Ygb2JqZWN0IG1hdGNoaW5nIGEgZmlsdGVyLlxuICpcbiAqIEBwYXJhbSBzdG9yZSBUaGUgdHJpcGxlIHN0b3JlLlxuICogQHBhcmFtIGZpbHRlciBUaGUgZmlsdGVyIHRvIGxpbWl0IG9iamVjdHMuXG4gKiBAcmV0dXJucyBBIHNldCBvZiBhbGwgaWRzIG1hdGNoaW5nIHRoZSBmaWx0ZXIuXG4gKi9cbmV4cG9ydCBmdW5jdGlvbiBmaW5kSWRzKHN0b3JlOiBTdG9yZSwgZ3JhcGg6IENDRlNwYXRpYWxHcmFwaCwgZmlsdGVyOiBGaWx0ZXIpOiBTZXQ8c3RyaW5nPiB7XG4gIGxldCBzZWVuID0gZ2V0QWxsRW50aXRpZXMoc3RvcmUpO1xuICBpZiAoc2Vlbi5zaXplID4gMCkge1xuICAgIHNlZW4gPSBmaWx0ZXJCeUhhc1NwYXRpYWxFbnRpdHkoc3RvcmUsIHNlZW4pO1xuICB9XG4gIGlmIChzZWVuLnNpemUgPiAwICYmIChmaWx0ZXIuc2V4ID09PSAnTWFsZScgfHwgZmlsdGVyLnNleCA9PT0gJ0ZlbWFsZScpKSB7XG4gICAgY29uc3Qgc2V4ID0gZmlsdGVyLnNleDtcbiAgICBzZWVuID0gZmlsdGVyV2l0aERvbm9yKHN0b3JlLCBzZWVuLCAoZG9ub3JzKSA9PlxuICAgICAgZmlsdGVyQnlTZXgoc3RvcmUsIGRvbm9ycywgc2V4KVxuICAgICk7XG4gIH1cbiAgaWYgKHNlZW4uc2l6ZSA+IDAgJiYgZmlsdGVyLnRtYz8ubGVuZ3RoID4gMCkge1xuICAgIHNlZW4gPSBmaWx0ZXJXaXRoRG9ub3Ioc3RvcmUsIHNlZW4sIChkb25vcnMpID0+XG4gICAgICBmaWx0ZXJCeUdyb3VwTmFtZShzdG9yZSwgZG9ub3JzLCBmaWx0ZXIudG1jKVxuICAgICk7XG4gIH1cbiAgaWYgKHNlZW4uc2l6ZSA+IDAgJiYgZmlsdGVyLnRlY2hub2xvZ2llcz8ubGVuZ3RoID4gMCkge1xuICAgIHNlZW4gPSBmaWx0ZXJXaXRoRGF0YXNldChzdG9yZSwgc2VlbiwgKGRhdGFzZXRzKSA9PlxuICAgICAgZmlsdGVyQnlUZWNobm9sb2d5KHN0b3JlLCBkYXRhc2V0cywgZmlsdGVyLnRlY2hub2xvZ2llcylcbiAgICApO1xuICB9XG4gIGlmIChzZWVuLnNpemUgPiAwICYmIGZpbHRlci5zcGF0aWFsU2VhcmNoZXM/Lmxlbmd0aCA+IDApIHtcbiAgICBzZWVuID0gZmlsdGVyV2l0aFNwYXRpYWxFbnRpdHkoc3RvcmUsIHNlZW4sIChlbnRpdGllcykgPT5cbiAgICAgIGZpbHRlckJ5U3BhdGlhbFNlYXJjaGVzKHN0b3JlLCBncmFwaCwgZW50aXRpZXMsIGZpbHRlci5zcGF0aWFsU2VhcmNoZXMpXG4gICAgKTtcbiAgfVxuICBpZiAoc2Vlbi5zaXplID4gMCAmJiBmaWx0ZXIub250b2xvZ3lUZXJtcz8ubGVuZ3RoID4gMCkge1xuICAgIGNvbnN0IHRlcm1zID0gZmlsdGVyLm9udG9sb2d5VGVybXM7XG4gICAgaWYgKHRlcm1zLmluZGV4T2YocnVpLmJvZHkuaWQpID09PSAtMSkge1xuICAgICAgc2VlbiA9IGZpbHRlcldpdGhTcGF0aWFsRW50aXR5KHN0b3JlLCBzZWVuLCAoZW50aXRpZXMpID0+XG4gICAgICAgIGZpbHRlckJ5T250b2xvZ3lUZXJtcyhzdG9yZSwgZW50aXRpZXMsIHRlcm1zKVxuICAgICAgKTtcbiAgICB9XG4gIH1cbiAgaWYgKHNlZW4uc2l6ZSA+IDAgJiYgZmlsdGVyLmNlbGxUeXBlVGVybXM/Lmxlbmd0aCA+IDApIHtcbiAgICBjb25zdCB0ZXJtcyA9IGZpbHRlci5jZWxsVHlwZVRlcm1zO1xuICAgIGlmICh0ZXJtcy5pbmRleE9mKHJ1aS5jZWxsLmlkKSA9PT0gLTEpIHtcbiAgICAgIHNlZW4gPSBmaWx0ZXJXaXRoU3BhdGlhbEVudGl0eShzdG9yZSwgc2VlbiwgKGVudGl0aWVzKSA9PlxuICAgICAgICBmaWx0ZXJCeUNlbGxUeXBlVGVybXMoc3RvcmUsIGVudGl0aWVzLCB0ZXJtcylcbiAgICAgICk7XG4gICAgfVxuICB9XG4gIGlmIChzZWVuLnNpemUgPiAwICYmIGZpbHRlci5hZ2VSYW5nZT8ubGVuZ3RoID09PSAyICYmXG4gICAgaXNGaW5pdGUoZmlsdGVyLmFnZVJhbmdlWzBdKSAmJiBpc0Zpbml0ZShmaWx0ZXIuYWdlUmFuZ2VbMV0pKSB7XG4gICAgY29uc3QgbWF4QWdlID0gTWF0aC5tYXgoLi4uZmlsdGVyLmFnZVJhbmdlKTtcbiAgICBjb25zdCBtaW5BZ2UgPSBNYXRoLm1pbiguLi5maWx0ZXIuYWdlUmFuZ2UpO1xuXG4gICAgLy8gQWdlIGZpbHRlciBnaXZlbiBieSB0aGVpciBkZWZhdWx0IHJhbmdlIHdpbGwgYmUgaWdub3JlZFxuICAgIGlmICghKG1pbkFnZSA9PT0gMSAmJiBtYXhBZ2UgPT09IDExMCkpIHtcbiAgICAgIHNlZW4gPSBmaWx0ZXJXaXRoRG9ub3Ioc3RvcmUsIHNlZW4sIChkb25vcnMpID0+XG4gICAgICAgIGZpbHRlckJ5QWdlKHN0b3JlLCBkb25vcnMsIG1pbkFnZSwgbWF4QWdlKVxuICAgICAgKTtcbiAgICB9XG4gIH1cbiAgaWYgKHNlZW4uc2l6ZSA+IDAgJiYgZmlsdGVyLmJtaVJhbmdlPy5sZW5ndGggPT09IDIgJiZcbiAgICBpc0Zpbml0ZShmaWx0ZXIuYm1pUmFuZ2VbMF0pICYmIGlzRmluaXRlKGZpbHRlci5ibWlSYW5nZVsxXSkpIHtcbiAgICBjb25zdCBtYXhCTUkgPSBNYXRoLm1heCguLi5maWx0ZXIuYm1pUmFuZ2UpO1xuICAgIGNvbnN0IG1pbkJNSSA9IE1hdGgubWluKC4uLmZpbHRlci5ibWlSYW5nZSk7XG5cbiAgICAvLyBCTUkgZmlsdGVyIGdpdmVuIGJ5IHRoZWlyIGRlZmF1bHQgcmFuZ2Ugd2lsbCBiZSBpZ25vcmVkXG4gICAgaWYgKCEobWluQk1JID09PSAxMyAmJiBtYXhCTUkgPT09IDgzKSkge1xuICAgICAgc2VlbiA9IGZpbHRlcldpdGhEb25vcihzdG9yZSwgc2VlbiwgKGRvbm9ycykgPT5cbiAgICAgICAgZmlsdGVyQnlCTUkoc3RvcmUsIGRvbm9ycywgbWluQk1JLCBtYXhCTUkpXG4gICAgICApO1xuICAgIH1cbiAgfVxuICByZXR1cm4gc2Vlbjtcbn1cblxuLyoqXG4gKiBHZXRzIGFsbCBvYmplY3QgaWRzIGluIGEgc3RvcmUuXG4gKlxuICogQHBhcmFtIHN0b3JlIFRoZSB0cmlwbGUgc3RvcmUuXG4gKiBAcmV0dXJucyBBIHNldCBvZiBhbGwgaWRzLlxuICovXG5mdW5jdGlvbiBnZXRBbGxFbnRpdGllcyhzdG9yZTogU3RvcmUpOiBTZXQ8c3RyaW5nPiB7XG4gIGNvbnN0IHNlZW4gPSBuZXcgU2V0PHN0cmluZz4oKTtcbiAgc3RvcmUuZm9yU3ViamVjdHMoKHMpID0+IHNlZW4uYWRkKHMuaWQpLCBlbnRpdHkuc3BhdGlhbEVudGl0eSwgbnVsbCwgbnVsbCk7XG4gIHJldHVybiBzZWVuO1xufVxuXG4vKipcbiAqIENyZWF0ZXMgYSBjYWxsYmFjayBmdW5jdGlvbiB0aGF0IGFkZHMgaWRzIHRvIGEgc2Vjb25kIHNldCBpZmYgaXQgZXhpc3RzIGluIHRoZSBmaXJzdCBzZXQuXG4gKlxuICogQHBhcmFtIHNlZW4gVGhlIGZpcnN0IHNldCBvZiBpZHMuXG4gKiBAcGFyYW0gbmV3U2VlbiBUaGUgc2Vjb25kIHNldCB0byBhZGQgaWRzIHRvLlxuICogQHJldHVybnMgVGhlIGNhbGxiYWNrIGZ1bmN0aW9uLlxuICovXG5mdW5jdGlvbiBkaWZmZXJlbmNlQ2FsbGJhY2soc2VlbjogU2V0PHN0cmluZz4sIG5ld1NlZW46IFNldDxzdHJpbmc+KTogKHRlcm06IFRlcm0pID0+IHZvaWQge1xuICByZXR1cm4gZnVuY3Rpb24gKHRlcm06IFRlcm0pIHtcbiAgICBpZiAoc2Vlbi5oYXModGVybS5pZCkpIHtcbiAgICAgIG5ld1NlZW4uYWRkKHRlcm0uaWQpO1xuICAgIH1cbiAgfTtcbn1cblxuLyoqXG4gKiBGaWx0ZXJzIGlkcyBieSBzZXguXG4gKlxuICogQHBhcmFtIHN0b3JlIFRoZSB0cmlwbGUgc3RvcmUuXG4gKiBAcGFyYW0gc2VlbiBBbGwgaWRzIHRvIGNob29zZSBmcm9tLlxuICogQHBhcmFtIHNleCBTZXggdG8gZmlsdGVyIG9uLlxuICogQHJldHVybnMgVGhlIHN1YnNldCBvZiBpZHMgd2l0aCB0aGUgc3BlY2lmaWVkIHNleC5cbiAqL1xuZnVuY3Rpb24gZmlsdGVyQnlTZXgoc3RvcmU6IFN0b3JlLCBzZWVuOiBTZXQ8c3RyaW5nPiwgc2V4OiAnTWFsZScgfCAnRmVtYWxlJyk6IFNldDxzdHJpbmc+IHtcbiAgY29uc3QgbmV3U2VlbiA9IG5ldyBTZXQ8c3RyaW5nPigpO1xuICBzdG9yZS5mb3JTdWJqZWN0cyhkaWZmZXJlbmNlQ2FsbGJhY2soc2VlbiwgbmV3U2VlbiksIGVudGl0eS5zZXgsIGVudGl0eVtzZXhdLCBudWxsKTtcbiAgcmV0dXJuIG5ld1NlZW47XG59XG5cbi8qKlxuICogRmlsdGVycyBpZHMgYnkgZ3JvdXAgbmFtZXMuXG4gKlxuICogQHBhcmFtIHN0b3JlIFRoZSB0cmlwbGUgc3RvcmUuXG4gKiBAcGFyYW0gc2VlbiBBbGwgaWRzIHRvIGNob29zZSBmcm9tLlxuICogQHBhcmFtIGdyb3VwTmFtZXMgR3JvdXAgbmFtZXMgdG8gZmlsdGVyIG9uLlxuICogQHJldHVybnMgVGhlIHN1YnNldCBvZiBpZHMgd2l0aCB0aGUgc3BlY2lmaWVkIGdyb3VwIG5hbWVzLlxuICovXG5mdW5jdGlvbiBmaWx0ZXJCeUdyb3VwTmFtZShzdG9yZTogU3RvcmUsIHNlZW46IFNldDxzdHJpbmc+LCBncm91cE5hbWVzOiBzdHJpbmdbXSk6IFNldDxzdHJpbmc+IHtcbiAgY29uc3QgbmV3U2VlbiA9IG5ldyBTZXQ8c3RyaW5nPigpO1xuICBmb3IgKGNvbnN0IGdyb3VwTmFtZSBvZiBncm91cE5hbWVzKSB7XG4gICAgY29uc3QgbGl0ZXJhbCA9IERhdGFGYWN0b3J5LmxpdGVyYWwoZ3JvdXBOYW1lKTtcbiAgICBzdG9yZS5mb3JTdWJqZWN0cyhkaWZmZXJlbmNlQ2FsbGJhY2soc2VlbiwgbmV3U2VlbiksIGVudGl0eS5wcm92aWRlck5hbWUsIGxpdGVyYWwsIG51bGwpO1xuICB9XG4gIHJldHVybiBuZXdTZWVuO1xufVxuXG4vKipcbiAqIEZpbHRlcnMgaWRzIGJ5IHRlY2hub2xvZ3kgbmFtZXMuXG4gKlxuICogQHBhcmFtIHN0b3JlIFRoZSB0cmlwbGUgc3RvcmUuXG4gKiBAcGFyYW0gc2VlbiBBbGwgaWRzIHRvIGNob29zZSBmcm9tLlxuICogQHBhcmFtIHRlY2hub2xvZ2llcyBUZWNobm9sb2d5IG5hbWVzIHRvIGZpbHRlciBvbi5cbiAqIEByZXR1cm5zIFRoZSBzdWJzZXQgb2YgaWRzIHdpdGggdGhlIHNwZWNpZmllZCB0ZWNobm9sb2d5IG5hbWVzLlxuICovXG5mdW5jdGlvbiBmaWx0ZXJCeVRlY2hub2xvZ3koc3RvcmU6IFN0b3JlLCBzZWVuOiBTZXQ8c3RyaW5nPiwgdGVjaG5vbG9naWVzOiBzdHJpbmdbXSk6IFNldDxzdHJpbmc+IHtcbiAgY29uc3QgbmV3U2VlbiA9IG5ldyBTZXQ8c3RyaW5nPigpO1xuICBmb3IgKGNvbnN0IHRlY2hub2xvZ3kgb2YgdGVjaG5vbG9naWVzKSB7XG4gICAgY29uc3QgbGl0ZXJhbCA9IERhdGFGYWN0b3J5LmxpdGVyYWwodGVjaG5vbG9neSk7XG4gICAgc3RvcmUuZm9yU3ViamVjdHMoZGlmZmVyZW5jZUNhbGxiYWNrKHNlZW4sIG5ld1NlZW4pLCBlbnRpdHkudGVjaG5vbG9neSwgbGl0ZXJhbCwgbnVsbCk7XG4gIH1cbiAgcmV0dXJuIG5ld1NlZW47XG59XG5cbi8qKlxuICogRmlsdGVycyBpZHMgYnkgb250b2xvZ3kgdGVybXMuXG4gKlxuICogQHBhcmFtIHN0b3JlIFRoZSB0cmlwbGUgc3RvcmUuXG4gKiBAcGFyYW0gc2VlbiBBbGwgaWRzIHRvIGNob29zZSBmcm9tLlxuICogQHBhcmFtIHRlcm1zIE9udG9sb2d5IHRlcm1zIHRvIGZpbHRlciBvbi5cbiAqIEByZXR1cm5zIFRoZSBzdWJzZXQgb2YgaWRzIHdpdGggdGhlIHNwZWNpZmllZCBvbnRvbG9neSB0ZXJtcy5cbiAqL1xuZnVuY3Rpb24gZmlsdGVyQnlPbnRvbG9neVRlcm1zKHN0b3JlOiBTdG9yZSwgc2VlbjogU2V0PHN0cmluZz4sIHRlcm1zOiBzdHJpbmdbXSk6IFNldDxzdHJpbmc+IHtcbiAgY29uc3QgbmV3U2VlbiA9IG5ldyBTZXQ8c3RyaW5nPigpO1xuICBmb3IgKGNvbnN0IHRlcm0gb2YgdGVybXMpIHtcbiAgICBjb25zdCBuYW1lZE5vZGUgPSBEYXRhRmFjdG9yeS5uYW1lZE5vZGUodGVybSk7XG4gICAgc3RvcmUuZm9yU3ViamVjdHMoZGlmZmVyZW5jZUNhbGxiYWNrKHNlZW4sIG5ld1NlZW4pLCBjY2Yuc3BhdGlhbEVudGl0eS5jY2ZfYW5ub3RhdGlvbnMsIG5hbWVkTm9kZSwgbnVsbCk7XG4gIH1cbiAgcmV0dXJuIG5ld1NlZW47XG59XG5cbi8qKlxuICogRmlsdGVycyBpZHMgYnkgY2VsbCB0eXBlIHRlcm1zLlxuICpcbiAqIEBwYXJhbSBzdG9yZSBUaGUgdHJpcGxlIHN0b3JlLlxuICogQHBhcmFtIHNlZW4gQWxsIGlkcyB0byBjaG9vc2UgZnJvbS5cbiAqIEBwYXJhbSB0ZXJtcyBDZWxsIHR5cGUgdGVybXMgdG8gZmlsdGVyIG9uLlxuICogQHJldHVybnMgVGhlIHN1YnNldCBvZiBpZHMgd2l0aCB0aGUgc3BlY2lmaWVkIGNlbGwgdHlwZSB0ZXJtcy5cbiAqL1xuZnVuY3Rpb24gZmlsdGVyQnlDZWxsVHlwZVRlcm1zKHN0b3JlOiBTdG9yZSwgc2VlbjogU2V0PHN0cmluZz4sIHRlcm1zOiBzdHJpbmdbXSk6IFNldDxzdHJpbmc+IHtcbiAgY29uc3QgYXNUZXJtcyA9IG5ldyBTZXQ8c3RyaW5nPigpO1xuICBmb3IgKGNvbnN0IHRlcm0gb2YgdGVybXMpIHtcbiAgICBzdG9yZS5mb3JPYmplY3RzKChhc1Rlcm0pID0+IHtcbiAgICAgIGFzVGVybXMuYWRkKGFzVGVybS5pZCk7XG4gICAgfSwgdGVybSwgY2NmLmFzY3RiLmxvY2F0ZWRfaW4sIG51bGwpO1xuICAgIGlmICh0ZXJtID09PSBydWkuY2VsbC5pZCkge1xuICAgICAgYXNUZXJtcy5hZGQocnVpLmJvZHkuaWQpO1xuICAgIH1cbiAgfVxuICByZXR1cm4gZmlsdGVyQnlPbnRvbG9neVRlcm1zKHN0b3JlLCBzZWVuLCBbLi4uYXNUZXJtc10pO1xufVxuXG4vKipcbiAqIEZpbHRlcnMgaWRzIGJ5IGFnZS5cbiAqXG4gKiBAcGFyYW0gc3RvcmUgVGhlIHRyaXBsZSBzdG9yZS5cbiAqIEBwYXJhbSBzZWVuIEFsbCBpZHMgdG8gY2hvb3NlIGZyb20uXG4gKiBAcGFyYW0gbWluQWdlIE1pbmltdW0gYWdlLlxuICogQHBhcmFtIG1heEFnZSBNYXhpbXVtIGFnZS5cbiAqIEByZXR1cm5zIFRoZSBzdWJzZXQgb2YgaWRzIHdpdGggdGhlIHNwZWNpZmllZCBhZ2UuXG4gKi9cbmZ1bmN0aW9uIGZpbHRlckJ5QWdlKHN0b3JlOiBTdG9yZSwgc2VlbjogU2V0PHN0cmluZz4sIG1pbkFnZTogbnVtYmVyLCBtYXhBZ2U6IG51bWJlcik6IFNldDxzdHJpbmc+IHtcbiAgY29uc3QgbmV3U2VlbiA9IG5ldyBTZXQ8c3RyaW5nPigpO1xuICBmb3IgKGNvbnN0IHN1YmplY3Qgb2Ygc2Vlbikge1xuICAgIGZvciAoY29uc3QgcXVhZCBvZiByZWFkUXVhZHMoc3RvcmUsIHN1YmplY3QsIGVudGl0eS5hZ2UsIG51bGwsIG51bGwpKSB7XG4gICAgICBjb25zdCB2YWx1ZSA9IGZyb21SZGYocXVhZC5vYmplY3QgYXMgTGl0ZXJhbCkgYXMgbnVtYmVyO1xuICAgICAgaWYgKHZhbHVlID49IG1pbkFnZSAmJiB2YWx1ZSA8PSBtYXhBZ2UpIHtcbiAgICAgICAgbmV3U2Vlbi5hZGQoc3ViamVjdCk7XG4gICAgICB9XG4gICAgfVxuICB9XG4gIHJldHVybiBuZXdTZWVuO1xufVxuXG4vKipcbiAqIEZpbHRlcnMgaWRzIGJ5IEJNSS5cbiAqXG4gKiBAcGFyYW0gc3RvcmUgVGhlIHRyaXBsZSBzdG9yZS5cbiAqIEBwYXJhbSBzZWVuIEFsbCBpZHMgdG8gY2hvb3NlIGZyb20uXG4gKiBAcGFyYW0gbWluQk1JIE1pbmltdW0gQk1JLlxuICogQHBhcmFtIG1heEJNSSBNYXhpbXVtIEJNSS5cbiAqIEByZXR1cm5zIFRoZSBzdWJzZXQgb2YgaWRzIHdpdGggdGhlIHNwZWNpZmllZCBCTUkuXG4gKi9cbmZ1bmN0aW9uIGZpbHRlckJ5Qk1JKHN0b3JlOiBTdG9yZSwgc2VlbjogU2V0PHN0cmluZz4sIG1pbkJNSTogbnVtYmVyLCBtYXhCTUk6IG51bWJlcik6IFNldDxzdHJpbmc+IHtcbiAgY29uc3QgbmV3U2VlbiA9IG5ldyBTZXQ8c3RyaW5nPigpO1xuICBmb3IgKGNvbnN0IHN1YmplY3Qgb2Ygc2Vlbikge1xuICAgIGZvciAoY29uc3QgcXVhZCBvZiByZWFkUXVhZHMoc3RvcmUsIHN1YmplY3QsIGVudGl0eS5ibWksIG51bGwsIG51bGwpKSB7XG4gICAgICBjb25zdCB2YWx1ZSA9IGZyb21SZGYocXVhZC5vYmplY3QgYXMgTGl0ZXJhbCkgYXMgbnVtYmVyO1xuICAgICAgaWYgKHZhbHVlID49IG1pbkJNSSAmJiB2YWx1ZSA8PSBtYXhCTUkpIHtcbiAgICAgICAgbmV3U2Vlbi5hZGQoc3ViamVjdCk7XG4gICAgICB9XG4gICAgfVxuICB9XG4gIHJldHVybiBuZXdTZWVuO1xufVxuXG4vKipcbiAqIEZpbHRlcnMgaWRzIGJ5IHNwYXRpYWwgZW50aXRpZXMuXG4gKlxuICogQHBhcmFtIHN0b3JlIFRoZSB0cmlwbGUgc3RvcmUuXG4gKiBAcGFyYW0gc2VlbiBBbGwgaWRzIHRvIGNob29zZSBmcm9tLlxuICogQHBhcmFtIGhhc1NwYXRpYWxFbnRpdHkgV2hldGhlciB0aGUgZmlsdGVyZWQgb2JqZWN0cyBzaG91bGQgaGF2ZSBhIHNwYXRpYWwgZW50aXR5LlxuICogQHJldHVybnMgVGhlIHN1YnNldCBvZiBpZHMgd2l0aC93aXRob3V0IHNwYXRpYWwgZW50aXRpZXMuXG4gKi9cbmZ1bmN0aW9uIGZpbHRlckJ5SGFzU3BhdGlhbEVudGl0eShzdG9yZTogU3RvcmUsIHNlZW46IFNldDxzdHJpbmc+LCBoYXNTcGF0aWFsRW50aXR5ID0gdHJ1ZSk6IFNldDxzdHJpbmc+IHtcbiAgY29uc3QgbmV3U2VlbiA9IG5ldyBTZXQ8c3RyaW5nPigpO1xuICBzdG9yZS5mb3JTdWJqZWN0cyhkaWZmZXJlbmNlQ2FsbGJhY2soc2VlbiwgbmV3U2VlbiksIGVudGl0eS5zcGF0aWFsRW50aXR5LCBudWxsLCBudWxsKTtcbiAgaWYgKCFoYXNTcGF0aWFsRW50aXR5KSB7XG4gICAgY29uc3Qgbm90TmV3U2VlbiA9IG5ldyBTZXQ8c3RyaW5nPigpO1xuICAgIHNlZW4uZm9yRWFjaCgocykgPT4gIW5ld1NlZW4uaGFzKHMpID8gbm90TmV3U2Vlbi5hZGQocykgOiB1bmRlZmluZWQpO1xuICAgIHJldHVybiBub3ROZXdTZWVuO1xuICB9XG4gIHJldHVybiBuZXdTZWVuO1xufVxuXG5mdW5jdGlvbiBmaWx0ZXJCeVNwYXRpYWxTZWFyY2hlcyhzdG9yZTogU3RvcmUsIGdyYXBoOiBDQ0ZTcGF0aWFsR3JhcGgsIHNlZW46IFNldDxzdHJpbmc+LCBzcGF0aWFsU2VhcmNoZXM6IFNwYXRpYWxTZWFyY2hbXSk6IFNldDxzdHJpbmc+IHtcbiAgY29uc3QgbmV3U2VlbiA9IG5ldyBTZXQ8c3RyaW5nPigpO1xuICBmb3IgKGNvbnN0IHNlYXJjaCBvZiBzcGF0aWFsU2VhcmNoZXMpIHtcbiAgICBjb25zdCB0aGlzU2VlbiA9IGZpbHRlckJ5UHJvYmluZ1NwaGVyZShzdG9yZSwgZ3JhcGgsIHNlZW4sIHNlYXJjaCk7XG4gICAgdGhpc1NlZW4uZm9yRWFjaCgocykgPT4gbmV3U2Vlbi5hZGQocykpO1xuICB9XG4gIHJldHVybiBuZXdTZWVuO1xufVxuIl19 \ No newline at end of file diff --git a/ccf-database/esm2015/lib/queries/ontology-term-occurences-n3.js b/ccf-database/esm2015/lib/queries/ontology-term-occurences-n3.js deleted file mode 100644 index 6ac1c0e4c..000000000 --- a/ccf-database/esm2015/lib/queries/ontology-term-occurences-n3.js +++ /dev/null @@ -1,80 +0,0 @@ -import { readQuads } from 'triple-store-utils'; -import { ccf, entity, rui } from '../util/prefixes'; -function getSpatialEntityMapping(subjects, store) { - const spatial2entity = new Map(); - for (const subject of subjects) { - for (const quad of readQuads(store, subject, entity.spatialEntity, null, null)) { - if (!spatial2entity.has(quad.object.id)) { - spatial2entity.set(quad.object.id, new Set([subject])); - } - else { - spatial2entity.get(quad.object.id).add(subject); - } - } - } - return spatial2entity; -} -function getAnatomicalStructureMapping(ids, store) { - const spatial2entity = getSpatialEntityMapping(ids, store); - const term2entity = new Map(); - for (const subject of spatial2entity.keys()) { - const entities = spatial2entity.get(subject); - for (const quad of readQuads(store, subject, ccf.spatialEntity.ccf_annotations, null, null)) { - if (!term2entity.has(quad.object.id)) { - term2entity.set(quad.object.id, new Set(entities)); - } - else { - const termEntities = term2entity.get(quad.object.id); - entities.forEach((value) => termEntities.add(value)); - } - } - } - return term2entity; -} -/** - * Get number of occurrences of ontology terms for a set of ids. - * - * @param ids Ids of objects to calculate aggregate over. - * @param store The triple store. - * @returns Ontology term counts. - */ -export function getOntologyTermOccurences(ids, store) { - const counts = {}; - const term2entities = getAnatomicalStructureMapping(ids, store); - term2entities.forEach((value, key) => { - counts[key] = value.size; - }); - return counts; -} -/** - * Get number of occurrences of cell type terms for a set of ids. - * - * @param ids Ids of objects to calculate aggregate over. - * @param store The triple store. - * @returns Ontology term counts. - */ -export function getCellTypeTermOccurences(ids, store) { - var _a, _b; - const asTerm2entities = getAnatomicalStructureMapping(ids, store); - const ctTerm2entities = new Map(); - for (const asTerm of asTerm2entities.keys()) { - const entities = asTerm2entities.get(asTerm); - for (const quad of readQuads(store, null, ccf.asctb.located_in, asTerm, null)) { - const cellType = quad.subject.id; - if (!ctTerm2entities.has(cellType)) { - ctTerm2entities.set(cellType, new Set(entities)); - } - else { - const termEntities = ctTerm2entities.get(cellType); - entities.forEach((value) => termEntities.add(value)); - } - } - } - const counts = {}; - ctTerm2entities.forEach((value, key) => { - counts[key] = value.size; - }); - counts[rui.cell.id] = (_b = (_a = asTerm2entities.get(rui.body.id)) === null || _a === void 0 ? void 0 : _a.size) !== null && _b !== void 0 ? _b : 0; - return counts; -} -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib250b2xvZ3ktdGVybS1vY2N1cmVuY2VzLW4zLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvY2NmLWRhdGFiYXNlL3NyYy9saWIvcXVlcmllcy9vbnRvbG9neS10ZXJtLW9jY3VyZW5jZXMtbjMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFTLFNBQVMsRUFBRSxNQUFNLG9CQUFvQixDQUFDO0FBRXRELE9BQU8sRUFBRSxHQUFHLEVBQUUsTUFBTSxFQUFFLEdBQUcsRUFBRSxNQUFNLGtCQUFrQixDQUFDO0FBR3BELFNBQVMsdUJBQXVCLENBQUMsUUFBcUIsRUFBRSxLQUFZO0lBQ2xFLE1BQU0sY0FBYyxHQUFHLElBQUksR0FBRyxFQUF1QixDQUFDO0lBRXRELEtBQUssTUFBTSxPQUFPLElBQUksUUFBUSxFQUFFO1FBQzlCLEtBQUssTUFBTSxJQUFJLElBQUksU0FBUyxDQUFDLEtBQUssRUFBRSxPQUFPLEVBQUUsTUFBTSxDQUFDLGFBQWEsRUFBRSxJQUFJLEVBQUUsSUFBSSxDQUFDLEVBQUU7WUFDOUUsSUFBSSxDQUFDLGNBQWMsQ0FBQyxHQUFHLENBQUMsSUFBSSxDQUFDLE1BQU0sQ0FBQyxFQUFFLENBQUMsRUFBRTtnQkFDdkMsY0FBYyxDQUFDLEdBQUcsQ0FBQyxJQUFJLENBQUMsTUFBTSxDQUFDLEVBQUUsRUFBRSxJQUFJLEdBQUcsQ0FBUyxDQUFDLE9BQU8sQ0FBQyxDQUFDLENBQUMsQ0FBQzthQUNoRTtpQkFBTTtnQkFDTCxjQUFjLENBQUMsR0FBRyxDQUFDLElBQUksQ0FBQyxNQUFNLENBQUMsRUFBRSxDQUFFLENBQUMsR0FBRyxDQUFDLE9BQU8sQ0FBQyxDQUFDO2FBQ2xEO1NBQ0Y7S0FDRjtJQUNELE9BQU8sY0FBYyxDQUFDO0FBQ3hCLENBQUM7QUFFRCxTQUFTLDZCQUE2QixDQUFDLEdBQWdCLEVBQUUsS0FBWTtJQUNuRSxNQUFNLGNBQWMsR0FBRyx1QkFBdUIsQ0FBQyxHQUFHLEVBQUUsS0FBSyxDQUFDLENBQUM7SUFDM0QsTUFBTSxXQUFXLEdBQUcsSUFBSSxHQUFHLEVBQXVCLENBQUM7SUFFbkQsS0FBSyxNQUFNLE9BQU8sSUFBSSxjQUFjLENBQUMsSUFBSSxFQUFFLEVBQUU7UUFDM0MsTUFBTSxRQUFRLEdBQUcsY0FBYyxDQUFDLEdBQUcsQ0FBQyxPQUFPLENBQUUsQ0FBQztRQUM5QyxLQUFLLE1BQU0sSUFBSSxJQUFJLFNBQVMsQ0FBQyxLQUFLLEVBQUUsT0FBTyxFQUFFLEdBQUcsQ0FBQyxhQUFhLENBQUMsZUFBZSxFQUFFLElBQUksRUFBRSxJQUFJLENBQUMsRUFBRTtZQUMzRixJQUFJLENBQUMsV0FBVyxDQUFDLEdBQUcsQ0FBQyxJQUFJLENBQUMsTUFBTSxDQUFDLEVBQUUsQ0FBQyxFQUFFO2dCQUNwQyxXQUFXLENBQUMsR0FBRyxDQUFDLElBQUksQ0FBQyxNQUFNLENBQUMsRUFBRSxFQUFFLElBQUksR0FBRyxDQUFTLFFBQVEsQ0FBQyxDQUFDLENBQUM7YUFDNUQ7aUJBQU07Z0JBQ0wsTUFBTSxZQUFZLEdBQUcsV0FBVyxDQUFDLEdBQUcsQ0FBQyxJQUFJLENBQUMsTUFBTSxDQUFDLEVBQUUsQ0FBRSxDQUFDO2dCQUN0RCxRQUFRLENBQUMsT0FBTyxDQUFDLENBQUMsS0FBSyxFQUFFLEVBQUUsQ0FBQyxZQUFZLENBQUMsR0FBRyxDQUFDLEtBQUssQ0FBQyxDQUFDLENBQUM7YUFDdEQ7U0FDRjtLQUNGO0lBQ0QsT0FBTyxXQUFXLENBQUM7QUFDckIsQ0FBQztBQUVEOzs7Ozs7R0FNRztBQUNILE1BQU0sVUFBVSx5QkFBeUIsQ0FBQyxHQUFnQixFQUFFLEtBQVk7SUFDdEUsTUFBTSxNQUFNLEdBQTJCLEVBQUUsQ0FBQztJQUMxQyxNQUFNLGFBQWEsR0FBRyw2QkFBNkIsQ0FBQyxHQUFHLEVBQUUsS0FBSyxDQUFDLENBQUM7SUFFaEUsYUFBYSxDQUFDLE9BQU8sQ0FBQyxDQUFDLEtBQUssRUFBRSxHQUFHLEVBQUUsRUFBRTtRQUNuQyxNQUFNLENBQUMsR0FBRyxDQUFDLEdBQUcsS0FBSyxDQUFDLElBQUksQ0FBQztJQUMzQixDQUFDLENBQUMsQ0FBQztJQUVILE9BQU8sTUFBTSxDQUFDO0FBQ2hCLENBQUM7QUFFRDs7Ozs7O0dBTUc7QUFDSCxNQUFNLFVBQVUseUJBQXlCLENBQUMsR0FBZ0IsRUFBRSxLQUFZOztJQUN0RSxNQUFNLGVBQWUsR0FBRyw2QkFBNkIsQ0FBQyxHQUFHLEVBQUUsS0FBSyxDQUFDLENBQUM7SUFDbEUsTUFBTSxlQUFlLEdBQUcsSUFBSSxHQUFHLEVBQXVCLENBQUM7SUFFdkQsS0FBSyxNQUFNLE1BQU0sSUFBSSxlQUFlLENBQUMsSUFBSSxFQUFFLEVBQUU7UUFDM0MsTUFBTSxRQUFRLEdBQUcsZUFBZSxDQUFDLEdBQUcsQ0FBQyxNQUFNLENBQUUsQ0FBQztRQUM5QyxLQUFLLE1BQU0sSUFBSSxJQUFJLFNBQVMsQ0FBQyxLQUFLLEVBQUUsSUFBSSxFQUFFLEdBQUcsQ0FBQyxLQUFLLENBQUMsVUFBVSxFQUFFLE1BQU0sRUFBRSxJQUFJLENBQUMsRUFBRTtZQUM3RSxNQUFNLFFBQVEsR0FBRyxJQUFJLENBQUMsT0FBTyxDQUFDLEVBQUUsQ0FBQztZQUNqQyxJQUFJLENBQUMsZUFBZSxDQUFDLEdBQUcsQ0FBQyxRQUFRLENBQUMsRUFBRTtnQkFDbEMsZUFBZSxDQUFDLEdBQUcsQ0FBQyxRQUFRLEVBQUUsSUFBSSxHQUFHLENBQVMsUUFBUSxDQUFDLENBQUMsQ0FBQzthQUMxRDtpQkFBTTtnQkFDTCxNQUFNLFlBQVksR0FBRyxlQUFlLENBQUMsR0FBRyxDQUFDLFFBQVEsQ0FBRSxDQUFDO2dCQUNwRCxRQUFRLENBQUMsT0FBTyxDQUFDLENBQUMsS0FBSyxFQUFFLEVBQUUsQ0FBQyxZQUFZLENBQUMsR0FBRyxDQUFDLEtBQUssQ0FBQyxDQUFDLENBQUM7YUFDdEQ7U0FDRjtLQUNGO0lBRUQsTUFBTSxNQUFNLEdBQTJCLEVBQUUsQ0FBQztJQUUxQyxlQUFlLENBQUMsT0FBTyxDQUFDLENBQUMsS0FBSyxFQUFFLEdBQUcsRUFBRSxFQUFFO1FBQ3JDLE1BQU0sQ0FBQyxHQUFHLENBQUMsR0FBRyxLQUFLLENBQUMsSUFBSSxDQUFDO0lBQzNCLENBQUMsQ0FBQyxDQUFDO0lBRUgsTUFBTSxDQUFDLEdBQUcsQ0FBQyxJQUFJLENBQUMsRUFBRSxDQUFDLEdBQUcsTUFBQSxNQUFBLGVBQWUsQ0FBQyxHQUFHLENBQUMsR0FBRyxDQUFDLElBQUksQ0FBQyxFQUFFLENBQUMsMENBQUUsSUFBSSxtQ0FBSSxDQUFDLENBQUM7SUFFbEUsT0FBTyxNQUFNLENBQUM7QUFDaEIsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IFN0b3JlLCByZWFkUXVhZHMgfSBmcm9tICd0cmlwbGUtc3RvcmUtdXRpbHMnO1xuXG5pbXBvcnQgeyBjY2YsIGVudGl0eSwgcnVpIH0gZnJvbSAnLi4vdXRpbC9wcmVmaXhlcyc7XG5cblxuZnVuY3Rpb24gZ2V0U3BhdGlhbEVudGl0eU1hcHBpbmcoc3ViamVjdHM6IFNldDxzdHJpbmc+LCBzdG9yZTogU3RvcmUpOiBNYXA8c3RyaW5nLCBTZXQ8c3RyaW5nPj4ge1xuICBjb25zdCBzcGF0aWFsMmVudGl0eSA9IG5ldyBNYXA8c3RyaW5nLCBTZXQ8c3RyaW5nPj4oKTtcblxuICBmb3IgKGNvbnN0IHN1YmplY3Qgb2Ygc3ViamVjdHMpIHtcbiAgICBmb3IgKGNvbnN0IHF1YWQgb2YgcmVhZFF1YWRzKHN0b3JlLCBzdWJqZWN0LCBlbnRpdHkuc3BhdGlhbEVudGl0eSwgbnVsbCwgbnVsbCkpIHtcbiAgICAgIGlmICghc3BhdGlhbDJlbnRpdHkuaGFzKHF1YWQub2JqZWN0LmlkKSkge1xuICAgICAgICBzcGF0aWFsMmVudGl0eS5zZXQocXVhZC5vYmplY3QuaWQsIG5ldyBTZXQ8c3RyaW5nPihbc3ViamVjdF0pKTtcbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIHNwYXRpYWwyZW50aXR5LmdldChxdWFkLm9iamVjdC5pZCkhLmFkZChzdWJqZWN0KTtcbiAgICAgIH1cbiAgICB9XG4gIH1cbiAgcmV0dXJuIHNwYXRpYWwyZW50aXR5O1xufVxuXG5mdW5jdGlvbiBnZXRBbmF0b21pY2FsU3RydWN0dXJlTWFwcGluZyhpZHM6IFNldDxzdHJpbmc+LCBzdG9yZTogU3RvcmUpOiBNYXA8c3RyaW5nLCBTZXQ8c3RyaW5nPj4ge1xuICBjb25zdCBzcGF0aWFsMmVudGl0eSA9IGdldFNwYXRpYWxFbnRpdHlNYXBwaW5nKGlkcywgc3RvcmUpO1xuICBjb25zdCB0ZXJtMmVudGl0eSA9IG5ldyBNYXA8c3RyaW5nLCBTZXQ8c3RyaW5nPj4oKTtcblxuICBmb3IgKGNvbnN0IHN1YmplY3Qgb2Ygc3BhdGlhbDJlbnRpdHkua2V5cygpKSB7XG4gICAgY29uc3QgZW50aXRpZXMgPSBzcGF0aWFsMmVudGl0eS5nZXQoc3ViamVjdCkhO1xuICAgIGZvciAoY29uc3QgcXVhZCBvZiByZWFkUXVhZHMoc3RvcmUsIHN1YmplY3QsIGNjZi5zcGF0aWFsRW50aXR5LmNjZl9hbm5vdGF0aW9ucywgbnVsbCwgbnVsbCkpIHtcbiAgICAgIGlmICghdGVybTJlbnRpdHkuaGFzKHF1YWQub2JqZWN0LmlkKSkge1xuICAgICAgICB0ZXJtMmVudGl0eS5zZXQocXVhZC5vYmplY3QuaWQsIG5ldyBTZXQ8c3RyaW5nPihlbnRpdGllcykpO1xuICAgICAgfSBlbHNlIHtcbiAgICAgICAgY29uc3QgdGVybUVudGl0aWVzID0gdGVybTJlbnRpdHkuZ2V0KHF1YWQub2JqZWN0LmlkKSE7XG4gICAgICAgIGVudGl0aWVzLmZvckVhY2goKHZhbHVlKSA9PiB0ZXJtRW50aXRpZXMuYWRkKHZhbHVlKSk7XG4gICAgICB9XG4gICAgfVxuICB9XG4gIHJldHVybiB0ZXJtMmVudGl0eTtcbn1cblxuLyoqXG4gKiBHZXQgbnVtYmVyIG9mIG9jY3VycmVuY2VzIG9mIG9udG9sb2d5IHRlcm1zIGZvciBhIHNldCBvZiBpZHMuXG4gKlxuICogQHBhcmFtIGlkcyBJZHMgb2Ygb2JqZWN0cyB0byBjYWxjdWxhdGUgYWdncmVnYXRlIG92ZXIuXG4gKiBAcGFyYW0gc3RvcmUgVGhlIHRyaXBsZSBzdG9yZS5cbiAqIEByZXR1cm5zIE9udG9sb2d5IHRlcm0gY291bnRzLlxuICovXG5leHBvcnQgZnVuY3Rpb24gZ2V0T250b2xvZ3lUZXJtT2NjdXJlbmNlcyhpZHM6IFNldDxzdHJpbmc+LCBzdG9yZTogU3RvcmUpOiBSZWNvcmQ8c3RyaW5nLCBudW1iZXI+IHtcbiAgY29uc3QgY291bnRzOiBSZWNvcmQ8c3RyaW5nLCBudW1iZXI+ID0ge307XG4gIGNvbnN0IHRlcm0yZW50aXRpZXMgPSBnZXRBbmF0b21pY2FsU3RydWN0dXJlTWFwcGluZyhpZHMsIHN0b3JlKTtcblxuICB0ZXJtMmVudGl0aWVzLmZvckVhY2goKHZhbHVlLCBrZXkpID0+IHtcbiAgICBjb3VudHNba2V5XSA9IHZhbHVlLnNpemU7XG4gIH0pO1xuXG4gIHJldHVybiBjb3VudHM7XG59XG5cbi8qKlxuICogR2V0IG51bWJlciBvZiBvY2N1cnJlbmNlcyBvZiBjZWxsIHR5cGUgdGVybXMgZm9yIGEgc2V0IG9mIGlkcy5cbiAqXG4gKiBAcGFyYW0gaWRzIElkcyBvZiBvYmplY3RzIHRvIGNhbGN1bGF0ZSBhZ2dyZWdhdGUgb3Zlci5cbiAqIEBwYXJhbSBzdG9yZSBUaGUgdHJpcGxlIHN0b3JlLlxuICogQHJldHVybnMgT250b2xvZ3kgdGVybSBjb3VudHMuXG4gKi9cbmV4cG9ydCBmdW5jdGlvbiBnZXRDZWxsVHlwZVRlcm1PY2N1cmVuY2VzKGlkczogU2V0PHN0cmluZz4sIHN0b3JlOiBTdG9yZSk6IFJlY29yZDxzdHJpbmcsIG51bWJlcj4ge1xuICBjb25zdCBhc1Rlcm0yZW50aXRpZXMgPSBnZXRBbmF0b21pY2FsU3RydWN0dXJlTWFwcGluZyhpZHMsIHN0b3JlKTtcbiAgY29uc3QgY3RUZXJtMmVudGl0aWVzID0gbmV3IE1hcDxzdHJpbmcsIFNldDxzdHJpbmc+PigpO1xuXG4gIGZvciAoY29uc3QgYXNUZXJtIG9mIGFzVGVybTJlbnRpdGllcy5rZXlzKCkpIHtcbiAgICBjb25zdCBlbnRpdGllcyA9IGFzVGVybTJlbnRpdGllcy5nZXQoYXNUZXJtKSE7XG4gICAgZm9yIChjb25zdCBxdWFkIG9mIHJlYWRRdWFkcyhzdG9yZSwgbnVsbCwgY2NmLmFzY3RiLmxvY2F0ZWRfaW4sIGFzVGVybSwgbnVsbCkpIHtcbiAgICAgIGNvbnN0IGNlbGxUeXBlID0gcXVhZC5zdWJqZWN0LmlkO1xuICAgICAgaWYgKCFjdFRlcm0yZW50aXRpZXMuaGFzKGNlbGxUeXBlKSkge1xuICAgICAgICBjdFRlcm0yZW50aXRpZXMuc2V0KGNlbGxUeXBlLCBuZXcgU2V0PHN0cmluZz4oZW50aXRpZXMpKTtcbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIGNvbnN0IHRlcm1FbnRpdGllcyA9IGN0VGVybTJlbnRpdGllcy5nZXQoY2VsbFR5cGUpITtcbiAgICAgICAgZW50aXRpZXMuZm9yRWFjaCgodmFsdWUpID0+IHRlcm1FbnRpdGllcy5hZGQodmFsdWUpKTtcbiAgICAgIH1cbiAgICB9XG4gIH1cblxuICBjb25zdCBjb3VudHM6IFJlY29yZDxzdHJpbmcsIG51bWJlcj4gPSB7fTtcblxuICBjdFRlcm0yZW50aXRpZXMuZm9yRWFjaCgodmFsdWUsIGtleSkgPT4ge1xuICAgIGNvdW50c1trZXldID0gdmFsdWUuc2l6ZTtcbiAgfSk7XG5cbiAgY291bnRzW3J1aS5jZWxsLmlkXSA9IGFzVGVybTJlbnRpdGllcy5nZXQocnVpLmJvZHkuaWQpPy5zaXplID8/IDA7XG5cbiAgcmV0dXJuIGNvdW50cztcbn1cbiJdfQ== \ No newline at end of file diff --git a/ccf-database/esm2015/lib/queries/ontology-tree-n3.js b/ccf-database/esm2015/lib/queries/ontology-tree-n3.js deleted file mode 100644 index 606eb4296..000000000 --- a/ccf-database/esm2015/lib/queries/ontology-tree-n3.js +++ /dev/null @@ -1,123 +0,0 @@ -import { memoize } from 'lodash'; -import { readQuads } from 'triple-store-utils'; -import { getEntries } from '../util/n3-functions'; -import { ccf, rui } from '../util/prefixes'; -export function getOntologyTreeNode(store, iri, relationshipIri) { - const result = { - '@id': iri, '@type': 'OntologyTreeNode', id: iri, parent: '', - children: [], synonymLabels: [], label: '' - }; - const ontologyTreeNodeResult = { - [ccf.ontologyNode.label.id]: 'label', - [relationshipIri]: 'parent', - [ccf.ontologyNode.synonymLabels.id]: 'synonymLabels', - }; - for (const [key, value] of getEntries(store, iri, ontologyTreeNodeResult)) { - if (key === 'synonymLabels') { - result.synonymLabels.push(value); - } - else { - result[key] = value; - } - } - result.children = store.getSubjects(relationshipIri, iri, null).map(s => s.id); - return result; -} -export function getOntologyTreeModel(store, rootIri, rootLabel, relationshipIri) { - const result = { root: rootIri, nodes: {} }; - const seen = new Set(); - for (const quad of readQuads(store, null, relationshipIri, null, null)) { - seen.add(quad.subject.id); - seen.add(quad.object.id); - } - for (const iri of seen) { - result.nodes[iri] = getOntologyTreeNode(store, iri, relationshipIri); - } - if (!result.nodes[rootIri]) { - result.nodes[rootIri] = { - '@id': rootIri, - '@type': 'OntologyTreeNode', - id: rootIri, - label: rootLabel, - children: [], - synonymLabels: [] - }; - } - const rootChildren = store - .getSubjects(relationshipIri, rootIri, null).map(o => o.id) - .sort((a, b) => result.nodes[a].label.localeCompare(result.nodes[b].label)); - result.nodes[rootIri].children = rootChildren; - treeify(result); - return result; -} -/** - * Recursive function to ensure that the given ontology tree model is actually a tree by essentially using a BFS search. - * - * @param model the ontology tree model to mutate - * @param nodeIri the tree node iri to modify. Starts at root in the base case - * @param seen a set of IRIs that have been 'seen' so far to remove loops in the graph - */ -function treeify(model, nodeIri = undefined, seen = new Set()) { - const node = model.nodes[nodeIri !== null && nodeIri !== void 0 ? nodeIri : model.root]; - if (node) { - node.children = node.children.filter(n => !seen.has(n)); - node.children.forEach(n => seen.add(n)); - for (const childId of node.children) { - treeify(model, childId, seen); - if (model.nodes[childId]) { - model.nodes[childId].parent = node['@id']; - } - } - } -} -export function getAnatomicalStructureTreeModelSlowly(store) { - const model = getOntologyTreeModel(store, rui.body.id, 'body', ccf.asctb.part_of.id); - model.nodes[rui.body.id].children = [ - 'http://purl.obolibrary.org/obo/UBERON_0000955', - 'http://purl.obolibrary.org/obo/UBERON_0000029', - // 'http://purl.obolibrary.org/obo/UBERON_0002509', // Mesenteric Lymph Node - 'http://purl.obolibrary.org/obo/UBERON_0000970', - // 'http://purl.obolibrary.org/obo/UBERON_0004548', // Eye, L - // 'http://purl.org/sig/ont/fma/fma54449', // Eye, R - 'http://purl.obolibrary.org/obo/UBERON_0003889', - // 'http://purl.obolibrary.org/obo/UBERON_0001303', // Fallopian Tube, L - // 'http://purl.obolibrary.org/obo/UBERON_0001302', // Fallopian Tube, R - 'http://purl.obolibrary.org/obo/UBERON_0000948', - 'http://purl.obolibrary.org/obo/UBERON_0002113', - // 'http://purl.obolibrary.org/obo/UBERON_0004538', // Kidney, L - // 'http://purl.obolibrary.org/obo/UBERON_0004539', // Kidney, R - 'http://purl.obolibrary.org/obo/UBERON_0001465', - // 'http://purl.org/sig/ont/fma/fma24978', // Knee, L - // 'http://purl.org/sig/ont/fma/fma24977', // Knee, R - 'http://purl.obolibrary.org/obo/UBERON_0002107', - 'http://purl.obolibrary.org/obo/UBERON_0002048', - 'http://purl.obolibrary.org/obo/UBERON_0001911', - // 'http://purl.org/sig/ont/fma/fma57991', // Mammary Gland, L - // 'http://purl.org/sig/ont/fma/fma57987', // Mammary Gland, R - 'http://purl.obolibrary.org/obo/UBERON_0000992', - // 'http://purl.org/sig/ont/fma/fma7214', // Ovary, L - // 'http://purl.org/sig/ont/fma/fma7213', // Ovary, R - 'http://purl.obolibrary.org/obo/UBERON_0001264', - 'http://purl.obolibrary.org/obo/UBERON_0001270', - 'http://purl.obolibrary.org/obo/UBERON_0001987', - 'http://purl.obolibrary.org/obo/UBERON_0002367', - 'http://purl.obolibrary.org/obo/UBERON_0002097', - 'http://purl.obolibrary.org/obo/UBERON_0002108', - 'http://purl.obolibrary.org/obo/UBERON_0002240', - 'http://purl.obolibrary.org/obo/UBERON_0000059', - 'http://purl.obolibrary.org/obo/UBERON_0002106', - 'http://purl.obolibrary.org/obo/UBERON_0002370', - 'http://purl.obolibrary.org/obo/UBERON_0000056', - // 'http://purl.obolibrary.org/obo/UBERON_0001223', // Ureter, L - // 'http://purl.obolibrary.org/obo/UBERON_0001222', // Ureter, R - 'http://purl.obolibrary.org/obo/UBERON_0001255', - 'http://purl.obolibrary.org/obo/UBERON_0000995', - 'http://purl.obolibrary.org/obo/UBERON_0004537' // Blood Vasculature - ].filter(iri => iri in model.nodes); - return model; -} -export const getAnatomicalStructureTreeModel = memoize(getAnatomicalStructureTreeModelSlowly, () => ''); -export function getCellTypeTreeModel(store) { - return getOntologyTreeModel(store, rui.cell.id, 'cell', ccf.asctb.ct_is_a.id); -} -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib250b2xvZ3ktdHJlZS1uMy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL2NjZi1kYXRhYmFzZS9zcmMvbGliL3F1ZXJpZXMvb250b2xvZ3ktdHJlZS1uMy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsT0FBTyxFQUFFLE1BQU0sUUFBUSxDQUFDO0FBQ2pDLE9BQU8sRUFBRSxTQUFTLEVBQVMsTUFBTSxvQkFBb0IsQ0FBQztBQUV0RCxPQUFPLEVBQUUsVUFBVSxFQUFFLE1BQU0sc0JBQXNCLENBQUM7QUFDbEQsT0FBTyxFQUFFLEdBQUcsRUFBRSxHQUFHLEVBQUUsTUFBTSxrQkFBa0IsQ0FBQztBQUc1QyxNQUFNLFVBQVUsbUJBQW1CLENBQUMsS0FBWSxFQUFFLEdBQVcsRUFBRSxlQUF1QjtJQUNwRixNQUFNLE1BQU0sR0FBcUI7UUFDL0IsS0FBSyxFQUFFLEdBQUcsRUFBRSxPQUFPLEVBQUUsa0JBQWtCLEVBQUUsRUFBRSxFQUFFLEdBQUcsRUFBRSxNQUFNLEVBQUUsRUFBRTtRQUM1RCxRQUFRLEVBQUUsRUFBYyxFQUFFLGFBQWEsRUFBRSxFQUFjLEVBQUUsS0FBSyxFQUFFLEVBQUU7S0FDbkUsQ0FBQztJQUVGLE1BQU0sc0JBQXNCLEdBQUc7UUFDN0IsQ0FBQyxHQUFHLENBQUMsWUFBWSxDQUFDLEtBQUssQ0FBQyxFQUFFLENBQUMsRUFBRSxPQUFPO1FBQ3BDLENBQUMsZUFBZSxDQUFDLEVBQUUsUUFBUTtRQUMzQixDQUFDLEdBQUcsQ0FBQyxZQUFZLENBQUMsYUFBYSxDQUFDLEVBQUUsQ0FBQyxFQUFFLGVBQWU7S0FDckQsQ0FBQztJQUVGLEtBQUssTUFBTSxDQUFDLEdBQUcsRUFBRSxLQUFLLENBQUMsSUFBSSxVQUFVLENBQUMsS0FBSyxFQUFFLEdBQUcsRUFBRSxzQkFBc0IsQ0FBQyxFQUFFO1FBQ3pFLElBQUksR0FBRyxLQUFLLGVBQWUsRUFBRTtZQUMzQixNQUFNLENBQUMsYUFBYSxDQUFDLElBQUksQ0FBQyxLQUFlLENBQUMsQ0FBQztTQUM1QzthQUFNO1lBQ0wsTUFBTSxDQUFDLEdBQUcsQ0FBQyxHQUFHLEtBQUssQ0FBQztTQUNyQjtLQUNGO0lBQ0QsTUFBTSxDQUFDLFFBQVEsR0FBRyxLQUFLLENBQUMsV0FBVyxDQUFDLGVBQWUsRUFBRSxHQUFHLEVBQUUsSUFBSSxDQUFDLENBQUMsR0FBRyxDQUFDLENBQUMsQ0FBQyxFQUFFLENBQUMsQ0FBQyxDQUFDLEVBQUUsQ0FBQyxDQUFDO0lBRS9FLE9BQU8sTUFBTSxDQUFDO0FBQ2hCLENBQUM7QUFFRCxNQUFNLFVBQVUsb0JBQW9CLENBQUMsS0FBWSxFQUFFLE9BQWUsRUFBRSxTQUFpQixFQUFFLGVBQXVCO0lBQzVHLE1BQU0sTUFBTSxHQUFzQixFQUFFLElBQUksRUFBRSxPQUFPLEVBQUUsS0FBSyxFQUFFLEVBQUUsRUFBRSxDQUFDO0lBQy9ELE1BQU0sSUFBSSxHQUFHLElBQUksR0FBRyxFQUFVLENBQUM7SUFDL0IsS0FBSyxNQUFNLElBQUksSUFBSSxTQUFTLENBQUMsS0FBSyxFQUFFLElBQUksRUFBRSxlQUFlLEVBQUUsSUFBSSxFQUFFLElBQUksQ0FBQyxFQUFFO1FBQ3RFLElBQUksQ0FBQyxHQUFHLENBQUMsSUFBSSxDQUFDLE9BQU8sQ0FBQyxFQUFFLENBQUMsQ0FBQztRQUMxQixJQUFJLENBQUMsR0FBRyxDQUFDLElBQUksQ0FBQyxNQUFNLENBQUMsRUFBRSxDQUFDLENBQUM7S0FDMUI7SUFFRCxLQUFLLE1BQU0sR0FBRyxJQUFJLElBQUksRUFBRTtRQUN0QixNQUFNLENBQUMsS0FBSyxDQUFDLEdBQUcsQ0FBQyxHQUFHLG1CQUFtQixDQUFDLEtBQUssRUFBRSxHQUFHLEVBQUUsZUFBZSxDQUFDLENBQUM7S0FDdEU7SUFFRCxJQUFJLENBQUMsTUFBTSxDQUFDLEtBQUssQ0FBQyxPQUFPLENBQUMsRUFBRTtRQUMxQixNQUFNLENBQUMsS0FBSyxDQUFDLE9BQU8sQ0FBQyxHQUFHO1lBQ3RCLEtBQUssRUFBRSxPQUFPO1lBQ2QsT0FBTyxFQUFFLGtCQUFrQjtZQUMzQixFQUFFLEVBQUUsT0FBTztZQUNYLEtBQUssRUFBRSxTQUFTO1lBQ2hCLFFBQVEsRUFBRSxFQUFFO1lBQ1osYUFBYSxFQUFFLEVBQUU7U0FDYSxDQUFDO0tBQ2xDO0lBRUQsTUFBTSxZQUFZLEdBQUcsS0FBSztTQUN2QixXQUFXLENBQUMsZUFBZSxFQUFFLE9BQU8sRUFBRSxJQUFJLENBQUMsQ0FBQyxHQUFHLENBQUMsQ0FBQyxDQUFDLEVBQUUsQ0FBQyxDQUFDLENBQUMsRUFBRSxDQUFDO1NBQzFELElBQUksQ0FBQyxDQUFDLENBQUMsRUFBRSxDQUFDLEVBQUUsRUFBRSxDQUFDLE1BQU0sQ0FBQyxLQUFLLENBQUMsQ0FBQyxDQUFDLENBQUMsS0FBSyxDQUFDLGFBQWEsQ0FBQyxNQUFNLENBQUMsS0FBSyxDQUFDLENBQUMsQ0FBQyxDQUFDLEtBQUssQ0FBQyxDQUFDLENBQUM7SUFDOUUsTUFBTSxDQUFDLEtBQUssQ0FBQyxPQUFPLENBQUMsQ0FBQyxRQUFRLEdBQUcsWUFBWSxDQUFDO0lBRTlDLE9BQU8sQ0FBQyxNQUFNLENBQUMsQ0FBQztJQUVoQixPQUFPLE1BQU0sQ0FBQztBQUNoQixDQUFDO0FBRUQ7Ozs7OztHQU1HO0FBQ0gsU0FBUyxPQUFPLENBQUMsS0FBd0IsRUFBRSxVQUE4QixTQUFTLEVBQUUsT0FBb0IsSUFBSSxHQUFHLEVBQUU7SUFDL0csTUFBTSxJQUFJLEdBQUcsS0FBSyxDQUFDLEtBQUssQ0FBQyxPQUFPLGFBQVAsT0FBTyxjQUFQLE9BQU8sR0FBSSxLQUFLLENBQUMsSUFBSSxDQUFDLENBQUM7SUFDaEQsSUFBSSxJQUFJLEVBQUU7UUFDUixJQUFJLENBQUMsUUFBUSxHQUFHLElBQUksQ0FBQyxRQUFRLENBQUMsTUFBTSxDQUFDLENBQUMsQ0FBQyxFQUFFLENBQUMsQ0FBQyxJQUFJLENBQUMsR0FBRyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7UUFDeEQsSUFBSSxDQUFDLFFBQVEsQ0FBQyxPQUFPLENBQUMsQ0FBQyxDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsR0FBRyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7UUFDeEMsS0FBSyxNQUFNLE9BQU8sSUFBSSxJQUFJLENBQUMsUUFBUSxFQUFFO1lBQ25DLE9BQU8sQ0FBQyxLQUFLLEVBQUUsT0FBTyxFQUFFLElBQUksQ0FBQyxDQUFDO1lBQzlCLElBQUksS0FBSyxDQUFDLEtBQUssQ0FBQyxPQUFPLENBQUMsRUFBRTtnQkFDeEIsS0FBSyxDQUFDLEtBQUssQ0FBQyxPQUFPLENBQUMsQ0FBQyxNQUFNLEdBQUcsSUFBSSxDQUFDLEtBQUssQ0FBQyxDQUFDO2FBQzNDO1NBQ0Y7S0FDRjtBQUNILENBQUM7QUFFRCxNQUFNLFVBQVUscUNBQXFDLENBQUMsS0FBWTtJQUNoRSxNQUFNLEtBQUssR0FBRyxvQkFBb0IsQ0FBQyxLQUFLLEVBQUUsR0FBRyxDQUFDLElBQUksQ0FBQyxFQUFFLEVBQUUsTUFBTSxFQUFFLEdBQUcsQ0FBQyxLQUFLLENBQUMsT0FBTyxDQUFDLEVBQUUsQ0FBQyxDQUFDO0lBQ3JGLEtBQUssQ0FBQyxLQUFLLENBQUMsR0FBRyxDQUFDLElBQUksQ0FBQyxFQUFFLENBQUMsQ0FBQyxRQUFRLEdBQUc7UUFDbEMsK0NBQStDO1FBQy9DLCtDQUErQztRQUMvQyw0RUFBNEU7UUFDNUUsK0NBQStDO1FBQy9DLDZEQUE2RDtRQUM3RCxvREFBb0Q7UUFDcEQsK0NBQStDO1FBQy9DLHdFQUF3RTtRQUN4RSx3RUFBd0U7UUFDeEUsK0NBQStDO1FBQy9DLCtDQUErQztRQUMvQyxnRUFBZ0U7UUFDaEUsZ0VBQWdFO1FBQ2hFLCtDQUErQztRQUMvQyxxREFBcUQ7UUFDckQscURBQXFEO1FBQ3JELCtDQUErQztRQUMvQywrQ0FBK0M7UUFDL0MsK0NBQStDO1FBQy9DLDhEQUE4RDtRQUM5RCw4REFBOEQ7UUFDOUQsK0NBQStDO1FBQy9DLHFEQUFxRDtRQUNyRCxxREFBcUQ7UUFDckQsK0NBQStDO1FBQy9DLCtDQUErQztRQUMvQywrQ0FBK0M7UUFDL0MsK0NBQStDO1FBQy9DLCtDQUErQztRQUMvQywrQ0FBK0M7UUFDL0MsK0NBQStDO1FBQy9DLCtDQUErQztRQUMvQywrQ0FBK0M7UUFDL0MsK0NBQStDO1FBQy9DLCtDQUErQztRQUMvQyxnRUFBZ0U7UUFDaEUsZ0VBQWdFO1FBQ2hFLCtDQUErQztRQUMvQywrQ0FBK0M7UUFDL0MsK0NBQStDLENBQUMsb0JBQW9CO0tBQ3JFLENBQUMsTUFBTSxDQUFDLEdBQUcsQ0FBQyxFQUFFLENBQUMsR0FBRyxJQUFJLEtBQUssQ0FBQyxLQUFLLENBQUMsQ0FBQztJQUNwQyxPQUFPLEtBQUssQ0FBQztBQUNmLENBQUM7QUFFRCxNQUFNLENBQUMsTUFBTSwrQkFBK0IsR0FBRyxPQUFPLENBQUMscUNBQXFDLEVBQUUsR0FBRyxFQUFFLENBQUMsRUFBRSxDQUFDLENBQUM7QUFFeEcsTUFBTSxVQUFVLG9CQUFvQixDQUFDLEtBQVk7SUFDL0MsT0FBTyxvQkFBb0IsQ0FBQyxLQUFLLEVBQUUsR0FBRyxDQUFDLElBQUksQ0FBQyxFQUFFLEVBQUUsTUFBTSxFQUFFLEdBQUcsQ0FBQyxLQUFLLENBQUMsT0FBTyxDQUFDLEVBQUUsQ0FBQyxDQUFDO0FBQ2hGLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBtZW1vaXplIH0gZnJvbSAnbG9kYXNoJztcbmltcG9ydCB7IHJlYWRRdWFkcywgU3RvcmUgfSBmcm9tICd0cmlwbGUtc3RvcmUtdXRpbHMnO1xuaW1wb3J0IHsgT250b2xvZ3lUcmVlTW9kZWwsIE9udG9sb2d5VHJlZU5vZGUgfSBmcm9tICcuLi9pbnRlcmZhY2VzJztcbmltcG9ydCB7IGdldEVudHJpZXMgfSBmcm9tICcuLi91dGlsL24zLWZ1bmN0aW9ucyc7XG5pbXBvcnQgeyBjY2YsIHJ1aSB9IGZyb20gJy4uL3V0aWwvcHJlZml4ZXMnO1xuXG5cbmV4cG9ydCBmdW5jdGlvbiBnZXRPbnRvbG9neVRyZWVOb2RlKHN0b3JlOiBTdG9yZSwgaXJpOiBzdHJpbmcsIHJlbGF0aW9uc2hpcElyaTogc3RyaW5nKTogT250b2xvZ3lUcmVlTm9kZSB7XG4gIGNvbnN0IHJlc3VsdDogT250b2xvZ3lUcmVlTm9kZSA9IHtcbiAgICAnQGlkJzogaXJpLCAnQHR5cGUnOiAnT250b2xvZ3lUcmVlTm9kZScsIGlkOiBpcmksIHBhcmVudDogJycsXG4gICAgY2hpbGRyZW46IFtdIGFzIHN0cmluZ1tdLCBzeW5vbnltTGFiZWxzOiBbXSBhcyBzdHJpbmdbXSwgbGFiZWw6ICcnXG4gIH07XG5cbiAgY29uc3Qgb250b2xvZ3lUcmVlTm9kZVJlc3VsdCA9IHtcbiAgICBbY2NmLm9udG9sb2d5Tm9kZS5sYWJlbC5pZF06ICdsYWJlbCcsXG4gICAgW3JlbGF0aW9uc2hpcElyaV06ICdwYXJlbnQnLFxuICAgIFtjY2Yub250b2xvZ3lOb2RlLnN5bm9ueW1MYWJlbHMuaWRdOiAnc3lub255bUxhYmVscycsXG4gIH07XG5cbiAgZm9yIChjb25zdCBba2V5LCB2YWx1ZV0gb2YgZ2V0RW50cmllcyhzdG9yZSwgaXJpLCBvbnRvbG9neVRyZWVOb2RlUmVzdWx0KSkge1xuICAgIGlmIChrZXkgPT09ICdzeW5vbnltTGFiZWxzJykge1xuICAgICAgcmVzdWx0LnN5bm9ueW1MYWJlbHMucHVzaCh2YWx1ZSBhcyBzdHJpbmcpO1xuICAgIH0gZWxzZSB7XG4gICAgICByZXN1bHRba2V5XSA9IHZhbHVlO1xuICAgIH1cbiAgfVxuICByZXN1bHQuY2hpbGRyZW4gPSBzdG9yZS5nZXRTdWJqZWN0cyhyZWxhdGlvbnNoaXBJcmksIGlyaSwgbnVsbCkubWFwKHMgPT4gcy5pZCk7XG5cbiAgcmV0dXJuIHJlc3VsdDtcbn1cblxuZXhwb3J0IGZ1bmN0aW9uIGdldE9udG9sb2d5VHJlZU1vZGVsKHN0b3JlOiBTdG9yZSwgcm9vdElyaTogc3RyaW5nLCByb290TGFiZWw6IHN0cmluZywgcmVsYXRpb25zaGlwSXJpOiBzdHJpbmcpOiBPbnRvbG9neVRyZWVNb2RlbCB7XG4gIGNvbnN0IHJlc3VsdDogT250b2xvZ3lUcmVlTW9kZWwgPSB7IHJvb3Q6IHJvb3RJcmksIG5vZGVzOiB7fSB9O1xuICBjb25zdCBzZWVuID0gbmV3IFNldDxzdHJpbmc+KCk7XG4gIGZvciAoY29uc3QgcXVhZCBvZiByZWFkUXVhZHMoc3RvcmUsIG51bGwsIHJlbGF0aW9uc2hpcElyaSwgbnVsbCwgbnVsbCkpIHtcbiAgICBzZWVuLmFkZChxdWFkLnN1YmplY3QuaWQpO1xuICAgIHNlZW4uYWRkKHF1YWQub2JqZWN0LmlkKTtcbiAgfVxuXG4gIGZvciAoY29uc3QgaXJpIG9mIHNlZW4pIHtcbiAgICByZXN1bHQubm9kZXNbaXJpXSA9IGdldE9udG9sb2d5VHJlZU5vZGUoc3RvcmUsIGlyaSwgcmVsYXRpb25zaGlwSXJpKTtcbiAgfVxuXG4gIGlmICghcmVzdWx0Lm5vZGVzW3Jvb3RJcmldKSB7XG4gICAgcmVzdWx0Lm5vZGVzW3Jvb3RJcmldID0ge1xuICAgICAgJ0BpZCc6IHJvb3RJcmksXG4gICAgICAnQHR5cGUnOiAnT250b2xvZ3lUcmVlTm9kZScsXG4gICAgICBpZDogcm9vdElyaSxcbiAgICAgIGxhYmVsOiByb290TGFiZWwsXG4gICAgICBjaGlsZHJlbjogW10sXG4gICAgICBzeW5vbnltTGFiZWxzOiBbXVxuICAgIH0gYXMgdW5rbm93biBhcyBPbnRvbG9neVRyZWVOb2RlO1xuICB9XG5cbiAgY29uc3Qgcm9vdENoaWxkcmVuID0gc3RvcmVcbiAgICAuZ2V0U3ViamVjdHMocmVsYXRpb25zaGlwSXJpLCByb290SXJpLCBudWxsKS5tYXAobyA9PiBvLmlkKVxuICAgIC5zb3J0KChhLCBiKSA9PiByZXN1bHQubm9kZXNbYV0ubGFiZWwubG9jYWxlQ29tcGFyZShyZXN1bHQubm9kZXNbYl0ubGFiZWwpKTtcbiAgcmVzdWx0Lm5vZGVzW3Jvb3RJcmldLmNoaWxkcmVuID0gcm9vdENoaWxkcmVuO1xuXG4gIHRyZWVpZnkocmVzdWx0KTtcblxuICByZXR1cm4gcmVzdWx0O1xufVxuXG4vKipcbiAqIFJlY3Vyc2l2ZSBmdW5jdGlvbiB0byBlbnN1cmUgdGhhdCB0aGUgZ2l2ZW4gb250b2xvZ3kgdHJlZSBtb2RlbCBpcyBhY3R1YWxseSBhIHRyZWUgYnkgZXNzZW50aWFsbHkgdXNpbmcgYSBCRlMgc2VhcmNoLlxuICpcbiAqIEBwYXJhbSBtb2RlbCB0aGUgb250b2xvZ3kgdHJlZSBtb2RlbCB0byBtdXRhdGVcbiAqIEBwYXJhbSBub2RlSXJpIHRoZSB0cmVlIG5vZGUgaXJpIHRvIG1vZGlmeS4gU3RhcnRzIGF0IHJvb3QgaW4gdGhlIGJhc2UgY2FzZVxuICogQHBhcmFtIHNlZW4gYSBzZXQgb2YgSVJJcyB0aGF0IGhhdmUgYmVlbiAnc2Vlbicgc28gZmFyIHRvIHJlbW92ZSBsb29wcyBpbiB0aGUgZ3JhcGhcbiAqL1xuZnVuY3Rpb24gdHJlZWlmeShtb2RlbDogT250b2xvZ3lUcmVlTW9kZWwsIG5vZGVJcmk6IHN0cmluZyB8IHVuZGVmaW5lZCA9IHVuZGVmaW5lZCwgc2VlbjogU2V0PHN0cmluZz4gPSBuZXcgU2V0KCkpIHtcbiAgY29uc3Qgbm9kZSA9IG1vZGVsLm5vZGVzW25vZGVJcmkgPz8gbW9kZWwucm9vdF07XG4gIGlmIChub2RlKSB7XG4gICAgbm9kZS5jaGlsZHJlbiA9IG5vZGUuY2hpbGRyZW4uZmlsdGVyKG4gPT4gIXNlZW4uaGFzKG4pKTtcbiAgICBub2RlLmNoaWxkcmVuLmZvckVhY2gobiA9PiBzZWVuLmFkZChuKSk7XG4gICAgZm9yIChjb25zdCBjaGlsZElkIG9mIG5vZGUuY2hpbGRyZW4pIHtcbiAgICAgIHRyZWVpZnkobW9kZWwsIGNoaWxkSWQsIHNlZW4pO1xuICAgICAgaWYgKG1vZGVsLm5vZGVzW2NoaWxkSWRdKSB7XG4gICAgICAgIG1vZGVsLm5vZGVzW2NoaWxkSWRdLnBhcmVudCA9IG5vZGVbJ0BpZCddO1xuICAgICAgfVxuICAgIH1cbiAgfVxufVxuXG5leHBvcnQgZnVuY3Rpb24gZ2V0QW5hdG9taWNhbFN0cnVjdHVyZVRyZWVNb2RlbFNsb3dseShzdG9yZTogU3RvcmUpOiBPbnRvbG9neVRyZWVNb2RlbCB7XG4gIGNvbnN0IG1vZGVsID0gZ2V0T250b2xvZ3lUcmVlTW9kZWwoc3RvcmUsIHJ1aS5ib2R5LmlkLCAnYm9keScsIGNjZi5hc2N0Yi5wYXJ0X29mLmlkKTtcbiAgbW9kZWwubm9kZXNbcnVpLmJvZHkuaWRdLmNoaWxkcmVuID0gW1xuICAgICdodHRwOi8vcHVybC5vYm9saWJyYXJ5Lm9yZy9vYm8vVUJFUk9OXzAwMDA5NTUnLCAvLyBCcmFpblxuICAgICdodHRwOi8vcHVybC5vYm9saWJyYXJ5Lm9yZy9vYm8vVUJFUk9OXzAwMDAwMjknLCAvLyBMeW1waCBOb2RlXG4gICAgLy8gJ2h0dHA6Ly9wdXJsLm9ib2xpYnJhcnkub3JnL29iby9VQkVST05fMDAwMjUwOScsIC8vIE1lc2VudGVyaWMgTHltcGggTm9kZVxuICAgICdodHRwOi8vcHVybC5vYm9saWJyYXJ5Lm9yZy9vYm8vVUJFUk9OXzAwMDA5NzAnLCAvLyBFeWVcbiAgICAvLyAnaHR0cDovL3B1cmwub2JvbGlicmFyeS5vcmcvb2JvL1VCRVJPTl8wMDA0NTQ4JywgLy8gRXllLCBMXG4gICAgLy8gJ2h0dHA6Ly9wdXJsLm9yZy9zaWcvb250L2ZtYS9mbWE1NDQ0OScsIC8vIEV5ZSwgUlxuICAgICdodHRwOi8vcHVybC5vYm9saWJyYXJ5Lm9yZy9vYm8vVUJFUk9OXzAwMDM4ODknLCAvLyBGYWxsb3BpYW4gVHViZVxuICAgIC8vICdodHRwOi8vcHVybC5vYm9saWJyYXJ5Lm9yZy9vYm8vVUJFUk9OXzAwMDEzMDMnLCAvLyBGYWxsb3BpYW4gVHViZSwgTFxuICAgIC8vICdodHRwOi8vcHVybC5vYm9saWJyYXJ5Lm9yZy9vYm8vVUJFUk9OXzAwMDEzMDInLCAvLyBGYWxsb3BpYW4gVHViZSwgUlxuICAgICdodHRwOi8vcHVybC5vYm9saWJyYXJ5Lm9yZy9vYm8vVUJFUk9OXzAwMDA5NDgnLCAvLyBIZWFydFxuICAgICdodHRwOi8vcHVybC5vYm9saWJyYXJ5Lm9yZy9vYm8vVUJFUk9OXzAwMDIxMTMnLCAvLyBLaWRuZXlcbiAgICAvLyAnaHR0cDovL3B1cmwub2JvbGlicmFyeS5vcmcvb2JvL1VCRVJPTl8wMDA0NTM4JywgLy8gS2lkbmV5LCBMXG4gICAgLy8gJ2h0dHA6Ly9wdXJsLm9ib2xpYnJhcnkub3JnL29iby9VQkVST05fMDAwNDUzOScsIC8vIEtpZG5leSwgUlxuICAgICdodHRwOi8vcHVybC5vYm9saWJyYXJ5Lm9yZy9vYm8vVUJFUk9OXzAwMDE0NjUnLCAvLyBLbmVlXG4gICAgLy8gJ2h0dHA6Ly9wdXJsLm9yZy9zaWcvb250L2ZtYS9mbWEyNDk3OCcsIC8vIEtuZWUsIExcbiAgICAvLyAnaHR0cDovL3B1cmwub3JnL3NpZy9vbnQvZm1hL2ZtYTI0OTc3JywgLy8gS25lZSwgUlxuICAgICdodHRwOi8vcHVybC5vYm9saWJyYXJ5Lm9yZy9vYm8vVUJFUk9OXzAwMDIxMDcnLCAvLyBMaXZlclxuICAgICdodHRwOi8vcHVybC5vYm9saWJyYXJ5Lm9yZy9vYm8vVUJFUk9OXzAwMDIwNDgnLCAvLyBMdW5nc1xuICAgICdodHRwOi8vcHVybC5vYm9saWJyYXJ5Lm9yZy9vYm8vVUJFUk9OXzAwMDE5MTEnLCAvLyBNYW1tYXJ5IEdsYW5kXG4gICAgLy8gJ2h0dHA6Ly9wdXJsLm9yZy9zaWcvb250L2ZtYS9mbWE1Nzk5MScsIC8vIE1hbW1hcnkgR2xhbmQsIExcbiAgICAvLyAnaHR0cDovL3B1cmwub3JnL3NpZy9vbnQvZm1hL2ZtYTU3OTg3JywgLy8gTWFtbWFyeSBHbGFuZCwgUlxuICAgICdodHRwOi8vcHVybC5vYm9saWJyYXJ5Lm9yZy9vYm8vVUJFUk9OXzAwMDA5OTInLCAvLyBPdmFyeVxuICAgIC8vICdodHRwOi8vcHVybC5vcmcvc2lnL29udC9mbWEvZm1hNzIxNCcsIC8vIE92YXJ5LCBMXG4gICAgLy8gJ2h0dHA6Ly9wdXJsLm9yZy9zaWcvb250L2ZtYS9mbWE3MjEzJywgLy8gT3ZhcnksIFJcbiAgICAnaHR0cDovL3B1cmwub2JvbGlicmFyeS5vcmcvb2JvL1VCRVJPTl8wMDAxMjY0JywgLy8gUGFuY3JlYXNcbiAgICAnaHR0cDovL3B1cmwub2JvbGlicmFyeS5vcmcvb2JvL1VCRVJPTl8wMDAxMjcwJywgLy8gUGVsdmlzXG4gICAgJ2h0dHA6Ly9wdXJsLm9ib2xpYnJhcnkub3JnL29iby9VQkVST05fMDAwMTk4NycsIC8vIFBsYWNlbnRhXG4gICAgJ2h0dHA6Ly9wdXJsLm9ib2xpYnJhcnkub3JnL29iby9VQkVST05fMDAwMjM2NycsIC8vIFByb3N0YXRlXG4gICAgJ2h0dHA6Ly9wdXJsLm9ib2xpYnJhcnkub3JnL29iby9VQkVST05fMDAwMjA5NycsIC8vIFNraW5cbiAgICAnaHR0cDovL3B1cmwub2JvbGlicmFyeS5vcmcvb2JvL1VCRVJPTl8wMDAyMTA4JywgLy8gU21hbGwgSW50ZXN0aW5lXG4gICAgJ2h0dHA6Ly9wdXJsLm9ib2xpYnJhcnkub3JnL29iby9VQkVST05fMDAwMjI0MCcsIC8vIFNwaW5hbCBDb3JkXG4gICAgJ2h0dHA6Ly9wdXJsLm9ib2xpYnJhcnkub3JnL29iby9VQkVST05fMDAwMDA1OScsIC8vIExhcmdlIEludGVzdGluZVxuICAgICdodHRwOi8vcHVybC5vYm9saWJyYXJ5Lm9yZy9vYm8vVUJFUk9OXzAwMDIxMDYnLCAvLyBTcGxlZW5cbiAgICAnaHR0cDovL3B1cmwub2JvbGlicmFyeS5vcmcvb2JvL1VCRVJPTl8wMDAyMzcwJywgLy8gVGh5bXVzXG4gICAgJ2h0dHA6Ly9wdXJsLm9ib2xpYnJhcnkub3JnL29iby9VQkVST05fMDAwMDA1NicsIC8vIFVyZXRlclxuICAgIC8vICdodHRwOi8vcHVybC5vYm9saWJyYXJ5Lm9yZy9vYm8vVUJFUk9OXzAwMDEyMjMnLCAvLyBVcmV0ZXIsIExcbiAgICAvLyAnaHR0cDovL3B1cmwub2JvbGlicmFyeS5vcmcvb2JvL1VCRVJPTl8wMDAxMjIyJywgLy8gVXJldGVyLCBSXG4gICAgJ2h0dHA6Ly9wdXJsLm9ib2xpYnJhcnkub3JnL29iby9VQkVST05fMDAwMTI1NScsIC8vIFVyaW5hcnkgQmxhZGRlclxuICAgICdodHRwOi8vcHVybC5vYm9saWJyYXJ5Lm9yZy9vYm8vVUJFUk9OXzAwMDA5OTUnLCAvLyBVdGVydXNcbiAgICAnaHR0cDovL3B1cmwub2JvbGlicmFyeS5vcmcvb2JvL1VCRVJPTl8wMDA0NTM3JyAvLyBCbG9vZCBWYXNjdWxhdHVyZVxuICBdLmZpbHRlcihpcmkgPT4gaXJpIGluIG1vZGVsLm5vZGVzKTtcbiAgcmV0dXJuIG1vZGVsO1xufVxuXG5leHBvcnQgY29uc3QgZ2V0QW5hdG9taWNhbFN0cnVjdHVyZVRyZWVNb2RlbCA9IG1lbW9pemUoZ2V0QW5hdG9taWNhbFN0cnVjdHVyZVRyZWVNb2RlbFNsb3dseSwgKCkgPT4gJycpO1xuXG5leHBvcnQgZnVuY3Rpb24gZ2V0Q2VsbFR5cGVUcmVlTW9kZWwoc3RvcmU6IFN0b3JlKTogT250b2xvZ3lUcmVlTW9kZWwge1xuICByZXR1cm4gZ2V0T250b2xvZ3lUcmVlTW9kZWwoc3RvcmUsIHJ1aS5jZWxsLmlkLCAnY2VsbCcsIGNjZi5hc2N0Yi5jdF9pc19hLmlkKTtcbn1cbiJdfQ== \ No newline at end of file diff --git a/ccf-database/esm2015/lib/queries/spatial-result-n3.js b/ccf-database/esm2015/lib/queries/spatial-result-n3.js deleted file mode 100644 index 4daec3618..000000000 --- a/ccf-database/esm2015/lib/queries/spatial-result-n3.js +++ /dev/null @@ -1,138 +0,0 @@ -import { sortBy } from 'lodash'; -import { DataFactory } from 'triple-store-utils'; -import { getMappedResult } from '../util/n3-functions'; -import { ccf, entity } from '../util/prefixes'; -/** - * Reverses the keys and values in a mapping. - * - * @param mapping The mapping to reverse. - * @returns The reversed mapping. - */ -function reverseMapping(mapping) { - const newMapping = {}; - Object.entries(mapping).forEach(([prop, predicate]) => { - newMapping[predicate.id] = prop; - }); - return newMapping; -} -/** A mapping of spatial objects. */ -const mappings = { - spatialObjectReference: reverseMapping(ccf.spatialObjectReference), - spatialEntity: reverseMapping(ccf.spatialEntity), - spatialPlacement: reverseMapping(ccf.spatialPlacement) -}; -/** - * Creates a spatial object reference. - * - * @param store The triple store. - * @param iri The data identifier. - * @returns The new reference. - */ -export function getSpatialObjectReference(store, iri) { - return getMappedResult(store, iri, 'SpatialObjectReference', mappings.spatialObjectReference); -} -/** - * Creates an extraction set data object. - * - * @param store The triple store. - * @param iri The data identifier. - * @returns The new entity. - */ -export function getExtractionSet(store, iri) { - const result = getMappedResult(store, iri, 'ExtractionSet', mappings.spatialEntity); - result.extractionSites = sortBy(store.getSubjects(ccf.spatialEntity.extraction_set, iri, null) - .map((value) => getSpatialEntity(store, value.id)), ['rui_rank']); - return result; -} -/** - * Gets extraction sets associated with a reference organ - * - * @param store The triple store. - * @param iri The data identifier (the reference organ). - * @returns A set of extraction sets associated with the reference organ - */ -export function getExtractionSets(store, iri) { - return sortBy(store.getSubjects(ccf.spatialEntity.extraction_set_for, iri, null) - .map((value) => getExtractionSet(store, value.id)), ['rui_rank']); -} -/** - * Gets the anatomical structures associated with a reference organ. - * - * @param store The triple store. - * @param iri The data identifier (reference organ). - * @returns The new entity. - */ -export function getAnatomicalStructures(store, iri) { - return sortBy(store.getSubjects(ccf.spatialEntity.reference_organ, iri, null) - .map((value) => getSpatialEntity(store, value.id)) - .filter((e) => e['@id'] !== iri), ['rui_rank']); -} -/** - * Gets all reference organs in the triple store - * - * @param store The triple store. - * @returns All the reference organs. - */ -export function getReferenceOrgans(store) { - const results = []; - store.forEach((quad) => { - if (quad.subject.id === quad.object.id) { - results.push(getSpatialEntity(store, quad.subject.id)); - } - }, null, ccf.spatialEntity.reference_organ, null, null); - return sortBy(results, ['rui_rank']); -} -/** - * Creates a spatial entity data object. - * - * @param store The triple store. - * @param iri The data identifier. - * @returns The new entity. - */ -export function getSpatialEntity(store, iri) { - const result = getMappedResult(store, iri, 'SpatialEntity', mappings.spatialEntity); - // Default mapping will come back as an IRI which we can look up for the full object - if (result.object) { - result.object = getSpatialObjectReference(store, result.object); - } - if (result.ccf_annotations) { - result.ccf_annotations = store.getObjects(iri, ccf.spatialEntity.ccf_annotations, null).map(o => o.id); - } - store.forSubjects((subject) => (result.entityId = subject.id), entity.spatialEntity, iri, null); - return result; -} -/** - * Creates a spatial placement object. - * - * @param store The triple store. - * @param iri The data identifier. - * @returns THe new placement object. - */ -export function getSpatialPlacement(store, iri) { - const result = getMappedResult(store, iri, 'SpatialPlacement', mappings.spatialPlacement); - // Default mapping will come back as an IRI for source/target which we can look up for the full object - if (result.source) { - result.source = getSpatialEntity(store, result.source); - } - if (result.target) { - result.target = getSpatialEntity(store, result.target); - } - return result; -} -/** - * Creates a spatial entity based on another entity in the store. - * - * @param store The triple store. - * @param entityIRI The indentifier of the store entity. - * @returns A new entity. - */ -export function getSpatialEntityForEntity(store, entityIRI) { - const spatialEntityNodes = store.getObjects(DataFactory.namedNode(entityIRI), entity.spatialEntity, null); - if (spatialEntityNodes.length > 0) { - return getSpatialEntity(store, spatialEntityNodes[0].id); - } - else { - return undefined; - } -} -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3BhdGlhbC1yZXN1bHQtbjMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9jY2YtZGF0YWJhc2Uvc3JjL2xpYi9xdWVyaWVzL3NwYXRpYWwtcmVzdWx0LW4zLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxNQUFNLEVBQUUsTUFBTSxRQUFRLENBQUM7QUFDaEMsT0FBTyxFQUFFLFdBQVcsRUFBb0IsTUFBTSxvQkFBb0IsQ0FBQztBQUduRSxPQUFPLEVBQUUsZUFBZSxFQUFFLE1BQU0sc0JBQXNCLENBQUM7QUFDdkQsT0FBTyxFQUFFLEdBQUcsRUFBRSxNQUFNLEVBQUUsTUFBTSxrQkFBa0IsQ0FBQztBQUcvQzs7Ozs7R0FLRztBQUNILFNBQVMsY0FBYyxDQUFDLE9BQTBDO0lBQ2hFLE1BQU0sVUFBVSxHQUE4QixFQUFFLENBQUM7SUFDakQsTUFBTSxDQUFDLE9BQU8sQ0FBQyxPQUFPLENBQUMsQ0FBQyxPQUFPLENBQUMsQ0FBQyxDQUFDLElBQUksRUFBRSxTQUFTLENBQUMsRUFBRSxFQUFFO1FBQ3BELFVBQVUsQ0FBQyxTQUFTLENBQUMsRUFBRSxDQUFDLEdBQUcsSUFBSSxDQUFDO0lBQ2xDLENBQUMsQ0FBQyxDQUFDO0lBQ0gsT0FBTyxVQUFVLENBQUM7QUFDcEIsQ0FBQztBQUVELG9DQUFvQztBQUNwQyxNQUFNLFFBQVEsR0FBRztJQUNmLHNCQUFzQixFQUFFLGNBQWMsQ0FBQyxHQUFHLENBQUMsc0JBQXNCLENBQUM7SUFDbEUsYUFBYSxFQUFFLGNBQWMsQ0FBQyxHQUFHLENBQUMsYUFBYSxDQUFDO0lBQ2hELGdCQUFnQixFQUFFLGNBQWMsQ0FBQyxHQUFHLENBQUMsZ0JBQWdCLENBQUM7Q0FDdkQsQ0FBQztBQUVGOzs7Ozs7R0FNRztBQUNILE1BQU0sVUFBVSx5QkFBeUIsQ0FBQyxLQUFZLEVBQUUsR0FBVztJQUNqRSxPQUFPLGVBQWUsQ0FBeUIsS0FBSyxFQUFFLEdBQUcsRUFBRSx3QkFBd0IsRUFBRSxRQUFRLENBQUMsc0JBQXNCLENBQUMsQ0FBQztBQUN4SCxDQUFDO0FBRUQ7Ozs7OztHQU1HO0FBQ0gsTUFBTSxVQUFVLGdCQUFnQixDQUFDLEtBQVksRUFBRSxHQUFXO0lBQ3hELE1BQU0sTUFBTSxHQUFHLGVBQWUsQ0FBZ0IsS0FBSyxFQUFFLEdBQUcsRUFBRSxlQUFlLEVBQUUsUUFBUSxDQUFDLGFBQWEsQ0FBQyxDQUFDO0lBQ25HLE1BQU0sQ0FBQyxlQUFlLEdBQUcsTUFBTSxDQUM3QixLQUFLLENBQUMsV0FBVyxDQUFDLEdBQUcsQ0FBQyxhQUFhLENBQUMsY0FBYyxFQUFFLEdBQUcsRUFBRSxJQUFJLENBQUM7U0FDM0QsR0FBRyxDQUFDLENBQUMsS0FBSyxFQUFFLEVBQUUsQ0FBQyxnQkFBZ0IsQ0FBQyxLQUFLLEVBQUUsS0FBSyxDQUFDLEVBQUUsQ0FBQyxDQUFDLEVBQ3BELENBQUMsVUFBVSxDQUFDLENBQUMsQ0FBQztJQUNoQixPQUFPLE1BQU0sQ0FBQztBQUNoQixDQUFDO0FBRUQ7Ozs7OztHQU1HO0FBQ0gsTUFBTSxVQUFVLGlCQUFpQixDQUFDLEtBQVksRUFBRSxHQUFXO0lBQ3pELE9BQU8sTUFBTSxDQUNYLEtBQUssQ0FBQyxXQUFXLENBQUMsR0FBRyxDQUFDLGFBQWEsQ0FBQyxrQkFBa0IsRUFBRSxHQUFHLEVBQUUsSUFBSSxDQUFDO1NBQy9ELEdBQUcsQ0FBQyxDQUFDLEtBQUssRUFBRSxFQUFFLENBQUMsZ0JBQWdCLENBQUMsS0FBSyxFQUFFLEtBQUssQ0FBQyxFQUFFLENBQUMsQ0FBQyxFQUNwRCxDQUFDLFVBQVUsQ0FBQyxDQUNiLENBQUM7QUFDSixDQUFDO0FBR0Q7Ozs7OztHQU1HO0FBQ0gsTUFBTSxVQUFVLHVCQUF1QixDQUFDLEtBQVksRUFBRSxHQUFXO0lBQy9ELE9BQU8sTUFBTSxDQUNYLEtBQUssQ0FBQyxXQUFXLENBQUMsR0FBRyxDQUFDLGFBQWEsQ0FBQyxlQUFlLEVBQUUsR0FBRyxFQUFFLElBQUksQ0FBQztTQUM1RCxHQUFHLENBQUMsQ0FBQyxLQUFLLEVBQUUsRUFBRSxDQUFDLGdCQUFnQixDQUFDLEtBQUssRUFBRSxLQUFLLENBQUMsRUFBRSxDQUFDLENBQUM7U0FDakQsTUFBTSxDQUFDLENBQUMsQ0FBQyxFQUFFLEVBQUUsQ0FBQyxDQUFDLENBQUMsS0FBSyxDQUFDLEtBQUssR0FBRyxDQUFDLEVBQ2xDLENBQUMsVUFBVSxDQUFDLENBQ2IsQ0FBQztBQUNKLENBQUM7QUFFRDs7Ozs7R0FLRztBQUNILE1BQU0sVUFBVSxrQkFBa0IsQ0FBQyxLQUFZO0lBQzdDLE1BQU0sT0FBTyxHQUFvQixFQUFFLENBQUM7SUFDcEMsS0FBSyxDQUFDLE9BQU8sQ0FBQyxDQUFDLElBQUksRUFBRSxFQUFFO1FBQ3JCLElBQUksSUFBSSxDQUFDLE9BQU8sQ0FBQyxFQUFFLEtBQUssSUFBSSxDQUFDLE1BQU0sQ0FBQyxFQUFFLEVBQUU7WUFDdEMsT0FBTyxDQUFDLElBQUksQ0FBQyxnQkFBZ0IsQ0FBQyxLQUFLLEVBQUUsSUFBSSxDQUFDLE9BQU8sQ0FBQyxFQUFFLENBQUMsQ0FBQyxDQUFDO1NBQ3hEO0lBQ0gsQ0FBQyxFQUFFLElBQUksRUFBRSxHQUFHLENBQUMsYUFBYSxDQUFDLGVBQWUsRUFBRSxJQUFJLEVBQUUsSUFBSSxDQUFDLENBQUM7SUFDeEQsT0FBTyxNQUFNLENBQUMsT0FBTyxFQUFFLENBQUMsVUFBVSxDQUFDLENBQUMsQ0FBQztBQUN2QyxDQUFDO0FBRUQ7Ozs7OztHQU1HO0FBQ0gsTUFBTSxVQUFVLGdCQUFnQixDQUFDLEtBQVksRUFBRSxHQUFXO0lBQ3hELE1BQU0sTUFBTSxHQUFHLGVBQWUsQ0FBZ0IsS0FBSyxFQUFFLEdBQUcsRUFBRSxlQUFlLEVBQUUsUUFBUSxDQUFDLGFBQWEsQ0FBQyxDQUFDO0lBQ25HLG9GQUFvRjtJQUNwRixJQUFJLE1BQU0sQ0FBQyxNQUFNLEVBQUU7UUFDakIsTUFBTSxDQUFDLE1BQU0sR0FBRyx5QkFBeUIsQ0FBQyxLQUFLLEVBQUcsTUFBTSxDQUFDLE1BQTRCLENBQUMsQ0FBQztLQUN4RjtJQUNELElBQUksTUFBTSxDQUFDLGVBQWUsRUFBRTtRQUMxQixNQUFNLENBQUMsZUFBZSxHQUFHLEtBQUssQ0FBQyxVQUFVLENBQUMsR0FBRyxFQUFFLEdBQUcsQ0FBQyxhQUFhLENBQUMsZUFBZSxFQUFFLElBQUksQ0FBQyxDQUFDLEdBQUcsQ0FBQyxDQUFDLENBQUMsRUFBRSxDQUFDLENBQUMsQ0FBQyxFQUFFLENBQUMsQ0FBQztLQUN4RztJQUNELEtBQUssQ0FBQyxXQUFXLENBQUMsQ0FBQyxPQUFPLEVBQUUsRUFBRSxDQUFDLENBQUMsTUFBTSxDQUFDLFFBQVEsR0FBRyxPQUFPLENBQUMsRUFBRSxDQUFDLEVBQUUsTUFBTSxDQUFDLGFBQWEsRUFBRSxHQUFHLEVBQUUsSUFBSSxDQUFDLENBQUM7SUFDaEcsT0FBTyxNQUFNLENBQUM7QUFDaEIsQ0FBQztBQUVEOzs7Ozs7R0FNRztBQUNILE1BQU0sVUFBVSxtQkFBbUIsQ0FBQyxLQUFZLEVBQUUsR0FBVztJQUMzRCxNQUFNLE1BQU0sR0FBRyxlQUFlLENBQW1CLEtBQUssRUFBRSxHQUFHLEVBQUUsa0JBQWtCLEVBQUUsUUFBUSxDQUFDLGdCQUFnQixDQUFDLENBQUM7SUFDNUcsc0dBQXNHO0lBQ3RHLElBQUksTUFBTSxDQUFDLE1BQU0sRUFBRTtRQUNqQixNQUFNLENBQUMsTUFBTSxHQUFHLGdCQUFnQixDQUFDLEtBQUssRUFBRyxNQUFNLENBQUMsTUFBNEIsQ0FBQyxDQUFDO0tBQy9FO0lBQ0QsSUFBSSxNQUFNLENBQUMsTUFBTSxFQUFFO1FBQ2pCLE1BQU0sQ0FBQyxNQUFNLEdBQUcsZ0JBQWdCLENBQUMsS0FBSyxFQUFHLE1BQU0sQ0FBQyxNQUE0QixDQUFDLENBQUM7S0FDL0U7SUFDRCxPQUFPLE1BQU0sQ0FBQztBQUNoQixDQUFDO0FBRUQ7Ozs7OztHQU1HO0FBQ0gsTUFBTSxVQUFVLHlCQUF5QixDQUFDLEtBQVksRUFBRSxTQUFpQjtJQUN2RSxNQUFNLGtCQUFrQixHQUFHLEtBQUssQ0FBQyxVQUFVLENBQUMsV0FBVyxDQUFDLFNBQVMsQ0FBQyxTQUFTLENBQUMsRUFBRSxNQUFNLENBQUMsYUFBYSxFQUFFLElBQUksQ0FBQyxDQUFDO0lBQzFHLElBQUksa0JBQWtCLENBQUMsTUFBTSxHQUFHLENBQUMsRUFBRTtRQUNqQyxPQUFPLGdCQUFnQixDQUFDLEtBQUssRUFBRSxrQkFBa0IsQ0FBQyxDQUFDLENBQUMsQ0FBQyxFQUFFLENBQUMsQ0FBQztLQUMxRDtTQUFNO1FBQ0wsT0FBTyxTQUFTLENBQUM7S0FDbEI7QUFDSCxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgc29ydEJ5IH0gZnJvbSAnbG9kYXNoJztcbmltcG9ydCB7IERhdGFGYWN0b3J5LCBOYW1lZE5vZGUsIFN0b3JlIH0gZnJvbSAndHJpcGxlLXN0b3JlLXV0aWxzJztcblxuaW1wb3J0IHsgU3BhdGlhbEVudGl0eSwgU3BhdGlhbE9iamVjdFJlZmVyZW5jZSwgU3BhdGlhbFBsYWNlbWVudCwgRXh0cmFjdGlvblNldCB9IGZyb20gJy4uL3NwYXRpYWwtdHlwZXMnO1xuaW1wb3J0IHsgZ2V0TWFwcGVkUmVzdWx0IH0gZnJvbSAnLi4vdXRpbC9uMy1mdW5jdGlvbnMnO1xuaW1wb3J0IHsgY2NmLCBlbnRpdHkgfSBmcm9tICcuLi91dGlsL3ByZWZpeGVzJztcblxuXG4vKipcbiAqIFJldmVyc2VzIHRoZSBrZXlzIGFuZCB2YWx1ZXMgaW4gYSBtYXBwaW5nLlxuICpcbiAqIEBwYXJhbSBtYXBwaW5nIFRoZSBtYXBwaW5nIHRvIHJldmVyc2UuXG4gKiBAcmV0dXJucyBUaGUgcmV2ZXJzZWQgbWFwcGluZy5cbiAqL1xuZnVuY3Rpb24gcmV2ZXJzZU1hcHBpbmcobWFwcGluZzogeyBbcHJvcGVydHk6IHN0cmluZ106IE5hbWVkTm9kZSB9KTogeyBbaXJpOiBzdHJpbmddOiBzdHJpbmcgfSB7XG4gIGNvbnN0IG5ld01hcHBpbmc6IHsgW2lyaTogc3RyaW5nXTogc3RyaW5nIH0gPSB7fTtcbiAgT2JqZWN0LmVudHJpZXMobWFwcGluZykuZm9yRWFjaCgoW3Byb3AsIHByZWRpY2F0ZV0pID0+IHtcbiAgICBuZXdNYXBwaW5nW3ByZWRpY2F0ZS5pZF0gPSBwcm9wO1xuICB9KTtcbiAgcmV0dXJuIG5ld01hcHBpbmc7XG59XG5cbi8qKiBBIG1hcHBpbmcgb2Ygc3BhdGlhbCBvYmplY3RzLiAqL1xuY29uc3QgbWFwcGluZ3MgPSB7XG4gIHNwYXRpYWxPYmplY3RSZWZlcmVuY2U6IHJldmVyc2VNYXBwaW5nKGNjZi5zcGF0aWFsT2JqZWN0UmVmZXJlbmNlKSxcbiAgc3BhdGlhbEVudGl0eTogcmV2ZXJzZU1hcHBpbmcoY2NmLnNwYXRpYWxFbnRpdHkpLFxuICBzcGF0aWFsUGxhY2VtZW50OiByZXZlcnNlTWFwcGluZyhjY2Yuc3BhdGlhbFBsYWNlbWVudClcbn07XG5cbi8qKlxuICogQ3JlYXRlcyBhIHNwYXRpYWwgb2JqZWN0IHJlZmVyZW5jZS5cbiAqXG4gKiBAcGFyYW0gc3RvcmUgVGhlIHRyaXBsZSBzdG9yZS5cbiAqIEBwYXJhbSBpcmkgVGhlIGRhdGEgaWRlbnRpZmllci5cbiAqIEByZXR1cm5zIFRoZSBuZXcgcmVmZXJlbmNlLlxuICovXG5leHBvcnQgZnVuY3Rpb24gZ2V0U3BhdGlhbE9iamVjdFJlZmVyZW5jZShzdG9yZTogU3RvcmUsIGlyaTogc3RyaW5nKTogU3BhdGlhbE9iamVjdFJlZmVyZW5jZSB7XG4gIHJldHVybiBnZXRNYXBwZWRSZXN1bHQ8U3BhdGlhbE9iamVjdFJlZmVyZW5jZT4oc3RvcmUsIGlyaSwgJ1NwYXRpYWxPYmplY3RSZWZlcmVuY2UnLCBtYXBwaW5ncy5zcGF0aWFsT2JqZWN0UmVmZXJlbmNlKTtcbn1cblxuLyoqXG4gKiBDcmVhdGVzIGFuIGV4dHJhY3Rpb24gc2V0IGRhdGEgb2JqZWN0LlxuICpcbiAqIEBwYXJhbSBzdG9yZSBUaGUgdHJpcGxlIHN0b3JlLlxuICogQHBhcmFtIGlyaSBUaGUgZGF0YSBpZGVudGlmaWVyLlxuICogQHJldHVybnMgVGhlIG5ldyBlbnRpdHkuXG4gKi9cbmV4cG9ydCBmdW5jdGlvbiBnZXRFeHRyYWN0aW9uU2V0KHN0b3JlOiBTdG9yZSwgaXJpOiBzdHJpbmcpOiBFeHRyYWN0aW9uU2V0IHtcbiAgY29uc3QgcmVzdWx0ID0gZ2V0TWFwcGVkUmVzdWx0PEV4dHJhY3Rpb25TZXQ+KHN0b3JlLCBpcmksICdFeHRyYWN0aW9uU2V0JywgbWFwcGluZ3Muc3BhdGlhbEVudGl0eSk7XG4gIHJlc3VsdC5leHRyYWN0aW9uU2l0ZXMgPSBzb3J0QnkoXG4gICAgc3RvcmUuZ2V0U3ViamVjdHMoY2NmLnNwYXRpYWxFbnRpdHkuZXh0cmFjdGlvbl9zZXQsIGlyaSwgbnVsbClcbiAgICAgIC5tYXAoKHZhbHVlKSA9PiBnZXRTcGF0aWFsRW50aXR5KHN0b3JlLCB2YWx1ZS5pZCkpLFxuICAgIFsncnVpX3JhbmsnXSk7XG4gIHJldHVybiByZXN1bHQ7XG59XG5cbi8qKlxuICogR2V0cyBleHRyYWN0aW9uIHNldHMgYXNzb2NpYXRlZCB3aXRoIGEgcmVmZXJlbmNlIG9yZ2FuXG4gKlxuICogQHBhcmFtIHN0b3JlIFRoZSB0cmlwbGUgc3RvcmUuXG4gKiBAcGFyYW0gaXJpIFRoZSBkYXRhIGlkZW50aWZpZXIgKHRoZSByZWZlcmVuY2Ugb3JnYW4pLlxuICogQHJldHVybnMgQSBzZXQgb2YgZXh0cmFjdGlvbiBzZXRzIGFzc29jaWF0ZWQgd2l0aCB0aGUgcmVmZXJlbmNlIG9yZ2FuXG4gKi9cbmV4cG9ydCBmdW5jdGlvbiBnZXRFeHRyYWN0aW9uU2V0cyhzdG9yZTogU3RvcmUsIGlyaTogc3RyaW5nKTogRXh0cmFjdGlvblNldFtdIHtcbiAgcmV0dXJuIHNvcnRCeShcbiAgICBzdG9yZS5nZXRTdWJqZWN0cyhjY2Yuc3BhdGlhbEVudGl0eS5leHRyYWN0aW9uX3NldF9mb3IsIGlyaSwgbnVsbClcbiAgICAgIC5tYXAoKHZhbHVlKSA9PiBnZXRFeHRyYWN0aW9uU2V0KHN0b3JlLCB2YWx1ZS5pZCkpLFxuICAgIFsncnVpX3JhbmsnXVxuICApO1xufVxuXG5cbi8qKlxuICogR2V0cyB0aGUgYW5hdG9taWNhbCBzdHJ1Y3R1cmVzIGFzc29jaWF0ZWQgd2l0aCBhIHJlZmVyZW5jZSBvcmdhbi5cbiAqXG4gKiBAcGFyYW0gc3RvcmUgVGhlIHRyaXBsZSBzdG9yZS5cbiAqIEBwYXJhbSBpcmkgVGhlIGRhdGEgaWRlbnRpZmllciAocmVmZXJlbmNlIG9yZ2FuKS5cbiAqIEByZXR1cm5zIFRoZSBuZXcgZW50aXR5LlxuICovXG5leHBvcnQgZnVuY3Rpb24gZ2V0QW5hdG9taWNhbFN0cnVjdHVyZXMoc3RvcmU6IFN0b3JlLCBpcmk6IHN0cmluZyk6IFNwYXRpYWxFbnRpdHlbXSB7XG4gIHJldHVybiBzb3J0QnkoXG4gICAgc3RvcmUuZ2V0U3ViamVjdHMoY2NmLnNwYXRpYWxFbnRpdHkucmVmZXJlbmNlX29yZ2FuLCBpcmksIG51bGwpXG4gICAgICAubWFwKCh2YWx1ZSkgPT4gZ2V0U3BhdGlhbEVudGl0eShzdG9yZSwgdmFsdWUuaWQpKVxuICAgICAgLmZpbHRlcigoZSkgPT4gZVsnQGlkJ10gIT09IGlyaSksXG4gICAgWydydWlfcmFuayddXG4gICk7XG59XG5cbi8qKlxuICogR2V0cyBhbGwgcmVmZXJlbmNlIG9yZ2FucyBpbiB0aGUgdHJpcGxlIHN0b3JlXG4gKlxuICogQHBhcmFtIHN0b3JlIFRoZSB0cmlwbGUgc3RvcmUuXG4gKiBAcmV0dXJucyBBbGwgdGhlIHJlZmVyZW5jZSBvcmdhbnMuXG4gKi9cbmV4cG9ydCBmdW5jdGlvbiBnZXRSZWZlcmVuY2VPcmdhbnMoc3RvcmU6IFN0b3JlKTogU3BhdGlhbEVudGl0eVtdIHtcbiAgY29uc3QgcmVzdWx0czogU3BhdGlhbEVudGl0eVtdID0gW107XG4gIHN0b3JlLmZvckVhY2goKHF1YWQpID0+IHtcbiAgICBpZiAocXVhZC5zdWJqZWN0LmlkID09PSBxdWFkLm9iamVjdC5pZCkge1xuICAgICAgcmVzdWx0cy5wdXNoKGdldFNwYXRpYWxFbnRpdHkoc3RvcmUsIHF1YWQuc3ViamVjdC5pZCkpO1xuICAgIH1cbiAgfSwgbnVsbCwgY2NmLnNwYXRpYWxFbnRpdHkucmVmZXJlbmNlX29yZ2FuLCBudWxsLCBudWxsKTtcbiAgcmV0dXJuIHNvcnRCeShyZXN1bHRzLCBbJ3J1aV9yYW5rJ10pO1xufVxuXG4vKipcbiAqIENyZWF0ZXMgYSBzcGF0aWFsIGVudGl0eSBkYXRhIG9iamVjdC5cbiAqXG4gKiBAcGFyYW0gc3RvcmUgVGhlIHRyaXBsZSBzdG9yZS5cbiAqIEBwYXJhbSBpcmkgVGhlIGRhdGEgaWRlbnRpZmllci5cbiAqIEByZXR1cm5zIFRoZSBuZXcgZW50aXR5LlxuICovXG5leHBvcnQgZnVuY3Rpb24gZ2V0U3BhdGlhbEVudGl0eShzdG9yZTogU3RvcmUsIGlyaTogc3RyaW5nKTogU3BhdGlhbEVudGl0eSB7XG4gIGNvbnN0IHJlc3VsdCA9IGdldE1hcHBlZFJlc3VsdDxTcGF0aWFsRW50aXR5PihzdG9yZSwgaXJpLCAnU3BhdGlhbEVudGl0eScsIG1hcHBpbmdzLnNwYXRpYWxFbnRpdHkpO1xuICAvLyBEZWZhdWx0IG1hcHBpbmcgd2lsbCBjb21lIGJhY2sgYXMgYW4gSVJJIHdoaWNoIHdlIGNhbiBsb29rIHVwIGZvciB0aGUgZnVsbCBvYmplY3RcbiAgaWYgKHJlc3VsdC5vYmplY3QpIHtcbiAgICByZXN1bHQub2JqZWN0ID0gZ2V0U3BhdGlhbE9iamVjdFJlZmVyZW5jZShzdG9yZSwgKHJlc3VsdC5vYmplY3QgYXMgdW5rbm93bikgYXMgc3RyaW5nKTtcbiAgfVxuICBpZiAocmVzdWx0LmNjZl9hbm5vdGF0aW9ucykge1xuICAgIHJlc3VsdC5jY2ZfYW5ub3RhdGlvbnMgPSBzdG9yZS5nZXRPYmplY3RzKGlyaSwgY2NmLnNwYXRpYWxFbnRpdHkuY2NmX2Fubm90YXRpb25zLCBudWxsKS5tYXAobyA9PiBvLmlkKTtcbiAgfVxuICBzdG9yZS5mb3JTdWJqZWN0cygoc3ViamVjdCkgPT4gKHJlc3VsdC5lbnRpdHlJZCA9IHN1YmplY3QuaWQpLCBlbnRpdHkuc3BhdGlhbEVudGl0eSwgaXJpLCBudWxsKTtcbiAgcmV0dXJuIHJlc3VsdDtcbn1cblxuLyoqXG4gKiBDcmVhdGVzIGEgc3BhdGlhbCBwbGFjZW1lbnQgb2JqZWN0LlxuICpcbiAqIEBwYXJhbSBzdG9yZSBUaGUgdHJpcGxlIHN0b3JlLlxuICogQHBhcmFtIGlyaSBUaGUgZGF0YSBpZGVudGlmaWVyLlxuICogQHJldHVybnMgVEhlIG5ldyBwbGFjZW1lbnQgb2JqZWN0LlxuICovXG5leHBvcnQgZnVuY3Rpb24gZ2V0U3BhdGlhbFBsYWNlbWVudChzdG9yZTogU3RvcmUsIGlyaTogc3RyaW5nKTogU3BhdGlhbFBsYWNlbWVudCB7XG4gIGNvbnN0IHJlc3VsdCA9IGdldE1hcHBlZFJlc3VsdDxTcGF0aWFsUGxhY2VtZW50PihzdG9yZSwgaXJpLCAnU3BhdGlhbFBsYWNlbWVudCcsIG1hcHBpbmdzLnNwYXRpYWxQbGFjZW1lbnQpO1xuICAvLyBEZWZhdWx0IG1hcHBpbmcgd2lsbCBjb21lIGJhY2sgYXMgYW4gSVJJIGZvciBzb3VyY2UvdGFyZ2V0IHdoaWNoIHdlIGNhbiBsb29rIHVwIGZvciB0aGUgZnVsbCBvYmplY3RcbiAgaWYgKHJlc3VsdC5zb3VyY2UpIHtcbiAgICByZXN1bHQuc291cmNlID0gZ2V0U3BhdGlhbEVudGl0eShzdG9yZSwgKHJlc3VsdC5zb3VyY2UgYXMgdW5rbm93bikgYXMgc3RyaW5nKTtcbiAgfVxuICBpZiAocmVzdWx0LnRhcmdldCkge1xuICAgIHJlc3VsdC50YXJnZXQgPSBnZXRTcGF0aWFsRW50aXR5KHN0b3JlLCAocmVzdWx0LnRhcmdldCBhcyB1bmtub3duKSBhcyBzdHJpbmcpO1xuICB9XG4gIHJldHVybiByZXN1bHQ7XG59XG5cbi8qKlxuICogQ3JlYXRlcyBhIHNwYXRpYWwgZW50aXR5IGJhc2VkIG9uIGFub3RoZXIgZW50aXR5IGluIHRoZSBzdG9yZS5cbiAqXG4gKiBAcGFyYW0gc3RvcmUgVGhlIHRyaXBsZSBzdG9yZS5cbiAqIEBwYXJhbSBlbnRpdHlJUkkgVGhlIGluZGVudGlmaWVyIG9mIHRoZSBzdG9yZSBlbnRpdHkuXG4gKiBAcmV0dXJucyBBIG5ldyBlbnRpdHkuXG4gKi9cbmV4cG9ydCBmdW5jdGlvbiBnZXRTcGF0aWFsRW50aXR5Rm9yRW50aXR5KHN0b3JlOiBTdG9yZSwgZW50aXR5SVJJOiBzdHJpbmcpOiBTcGF0aWFsRW50aXR5IHwgdW5kZWZpbmVkIHtcbiAgY29uc3Qgc3BhdGlhbEVudGl0eU5vZGVzID0gc3RvcmUuZ2V0T2JqZWN0cyhEYXRhRmFjdG9yeS5uYW1lZE5vZGUoZW50aXR5SVJJKSwgZW50aXR5LnNwYXRpYWxFbnRpdHksIG51bGwpO1xuICBpZiAoc3BhdGlhbEVudGl0eU5vZGVzLmxlbmd0aCA+IDApIHtcbiAgICByZXR1cm4gZ2V0U3BhdGlhbEVudGl0eShzdG9yZSwgc3BhdGlhbEVudGl0eU5vZGVzWzBdLmlkKTtcbiAgfSBlbHNlIHtcbiAgICByZXR1cm4gdW5kZWZpbmVkO1xuICB9XG59XG4iXX0= \ No newline at end of file diff --git a/ccf-database/esm2015/lib/queries/spatial-search-n3.js b/ccf-database/esm2015/lib/queries/spatial-search-n3.js deleted file mode 100644 index 425123dcc..000000000 --- a/ccf-database/esm2015/lib/queries/spatial-search-n3.js +++ /dev/null @@ -1,40 +0,0 @@ -import { Euler } from '@math.gl/core'; -import { OrientedBoundingBox } from '@math.gl/culling'; -import { getMappedResult } from '../util/n3-functions'; -import { ccf } from '../util/prefixes'; -const spatialEntityDimensions = { - [ccf.spatialEntity.x_dimension.id]: 'x', - [ccf.spatialEntity.y_dimension.id]: 'y', - [ccf.spatialEntity.z_dimension.id]: 'z' -}; -function getSpatialEntityDimensions(store, iri) { - const dims = getMappedResult(store, iri, 'Dimensions', spatialEntityDimensions); - return [dims.x, dims.y, dims.z]; -} -export function getOrientedBoundingBox(store, graph, sourceIri, targetIri) { - const matrix = graph.getTransformationMatrix(sourceIri, targetIri); - let result = undefined; - if (matrix) { - const center = matrix.getTranslation(); - const halfSize = getSpatialEntityDimensions(store, sourceIri).map(n => n / 1000 / 2); - const quaternion = new Euler().fromRotationMatrix(matrix, Euler.XYZ).toQuaternion().normalize().calculateW(); - result = new OrientedBoundingBox().fromCenterHalfSizeQuaternion(center, halfSize, quaternion); - } - return result; -} -export function filterByProbingSphere(store, graph, seen, search) { - const { x, y, z, radius, target } = search; - const newSeen = new Set(); - const radiusSquared = (radius / 1000) * (radius / 1000); - for (const sourceIri of seen) { - const boundingBox = getOrientedBoundingBox(store, graph, sourceIri, target); - if (boundingBox) { - const distanceSquared = boundingBox.distanceSquaredTo([x, y, z].map(n => n / 1000)); - if (distanceSquared <= radiusSquared) { - newSeen.add(sourceIri); - } - } - } - return newSeen; -} -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3BhdGlhbC1zZWFyY2gtbjMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9jY2YtZGF0YWJhc2Uvc3JjL2xpYi9xdWVyaWVzL3NwYXRpYWwtc2VhcmNoLW4zLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxLQUFLLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFDdEMsT0FBTyxFQUFFLG1CQUFtQixFQUFFLE1BQU0sa0JBQWtCLENBQUM7QUFLdkQsT0FBTyxFQUFFLGVBQWUsRUFBRSxNQUFNLHNCQUFzQixDQUFDO0FBQ3ZELE9BQU8sRUFBRSxHQUFHLEVBQUUsTUFBTSxrQkFBa0IsQ0FBQztBQUd2QyxNQUFNLHVCQUF1QixHQUFHO0lBQzlCLENBQUMsR0FBRyxDQUFDLGFBQWEsQ0FBQyxXQUFXLENBQUMsRUFBRSxDQUFDLEVBQUUsR0FBRztJQUN2QyxDQUFDLEdBQUcsQ0FBQyxhQUFhLENBQUMsV0FBVyxDQUFDLEVBQUUsQ0FBQyxFQUFFLEdBQUc7SUFDdkMsQ0FBQyxHQUFHLENBQUMsYUFBYSxDQUFDLFdBQVcsQ0FBQyxFQUFFLENBQUMsRUFBRSxHQUFHO0NBQ3hDLENBQUM7QUFFRixTQUFTLDBCQUEwQixDQUFDLEtBQVksRUFBRSxHQUFXO0lBQzNELE1BQU0sSUFBSSxHQUFHLGVBQWUsQ0FBc0MsS0FBSyxFQUFFLEdBQUcsRUFBRSxZQUFZLEVBQUUsdUJBQXVCLENBQUMsQ0FBQztJQUNySCxPQUFPLENBQUUsSUFBSSxDQUFDLENBQUMsRUFBRSxJQUFJLENBQUMsQ0FBQyxFQUFFLElBQUksQ0FBQyxDQUFDLENBQUUsQ0FBQztBQUNwQyxDQUFDO0FBRUQsTUFBTSxVQUFVLHNCQUFzQixDQUFDLEtBQVksRUFBRSxLQUFzQixFQUFFLFNBQWlCLEVBQUUsU0FBaUI7SUFDL0csTUFBTSxNQUFNLEdBQUcsS0FBSyxDQUFDLHVCQUF1QixDQUFDLFNBQVMsRUFBRSxTQUFTLENBQUMsQ0FBQztJQUNuRSxJQUFJLE1BQU0sR0FBb0MsU0FBUyxDQUFDO0lBQ3hELElBQUksTUFBTSxFQUFFO1FBQ1YsTUFBTSxNQUFNLEdBQUcsTUFBTSxDQUFDLGNBQWMsRUFBRSxDQUFDO1FBQ3ZDLE1BQU0sUUFBUSxHQUFHLDBCQUEwQixDQUFDLEtBQUssRUFBRSxTQUFTLENBQUMsQ0FBQyxHQUFHLENBQUMsQ0FBQyxDQUFDLEVBQUUsQ0FBQyxDQUFDLEdBQUcsSUFBSSxHQUFHLENBQUMsQ0FBQyxDQUFDO1FBQ3JGLE1BQU0sVUFBVSxHQUFHLElBQUksS0FBSyxFQUFFLENBQUMsa0JBQWtCLENBQUMsTUFBTSxFQUFFLEtBQUssQ0FBQyxHQUFHLENBQUMsQ0FBQyxZQUFZLEVBQUUsQ0FBQyxTQUFTLEVBQUUsQ0FBQyxVQUFVLEVBQUUsQ0FBQztRQUM3RyxNQUFNLEdBQUcsSUFBSSxtQkFBbUIsRUFBRSxDQUFDLDRCQUE0QixDQUFDLE1BQU0sRUFBRSxRQUFRLEVBQUUsVUFBVSxDQUFDLENBQUM7S0FDL0Y7SUFDRCxPQUFPLE1BQU0sQ0FBQztBQUNoQixDQUFDO0FBRUQsTUFBTSxVQUFVLHFCQUFxQixDQUFDLEtBQVksRUFBRSxLQUFzQixFQUFFLElBQWlCLEVBQUUsTUFBcUI7SUFDbEgsTUFBTSxFQUFFLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxFQUFFLE1BQU0sRUFBRSxNQUFNLEVBQUUsR0FBRyxNQUFNLENBQUM7SUFDM0MsTUFBTSxPQUFPLEdBQUcsSUFBSSxHQUFHLEVBQVUsQ0FBQztJQUNsQyxNQUFNLGFBQWEsR0FBRyxDQUFDLE1BQU0sR0FBRyxJQUFJLENBQUMsR0FBRyxDQUFDLE1BQU0sR0FBRyxJQUFJLENBQUMsQ0FBQztJQUN4RCxLQUFLLE1BQU0sU0FBUyxJQUFJLElBQUksRUFBRTtRQUM1QixNQUFNLFdBQVcsR0FBRyxzQkFBc0IsQ0FBQyxLQUFLLEVBQUUsS0FBSyxFQUFFLFNBQVMsRUFBRSxNQUFNLENBQUMsQ0FBQztRQUM1RSxJQUFJLFdBQVcsRUFBRTtZQUNmLE1BQU0sZUFBZSxHQUFHLFdBQVcsQ0FBQyxpQkFBaUIsQ0FBQyxDQUFDLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxDQUFDLENBQUMsR0FBRyxDQUFDLENBQUMsQ0FBQyxFQUFFLENBQUMsQ0FBQyxHQUFHLElBQUksQ0FBQyxDQUFDLENBQUM7WUFDcEYsSUFBSSxlQUFlLElBQUksYUFBYSxFQUFFO2dCQUNwQyxPQUFPLENBQUMsR0FBRyxDQUFDLFNBQVMsQ0FBQyxDQUFDO2FBQ3hCO1NBQ0Y7S0FDRjtJQUNELE9BQU8sT0FBTyxDQUFDO0FBQ2pCLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBFdWxlciB9IGZyb20gJ0BtYXRoLmdsL2NvcmUnO1xuaW1wb3J0IHsgT3JpZW50ZWRCb3VuZGluZ0JveCB9IGZyb20gJ0BtYXRoLmdsL2N1bGxpbmcnO1xuaW1wb3J0IHsgU3RvcmUgfSBmcm9tICd0cmlwbGUtc3RvcmUtdXRpbHMnO1xuXG5pbXBvcnQgeyBDQ0ZTcGF0aWFsR3JhcGggfSBmcm9tICcuLi9jY2Ytc3BhdGlhbC1ncmFwaCc7XG5pbXBvcnQgeyBTcGF0aWFsU2VhcmNoIH0gZnJvbSAnLi4vaW50ZXJmYWNlcyc7XG5pbXBvcnQgeyBnZXRNYXBwZWRSZXN1bHQgfSBmcm9tICcuLi91dGlsL24zLWZ1bmN0aW9ucyc7XG5pbXBvcnQgeyBjY2YgfSBmcm9tICcuLi91dGlsL3ByZWZpeGVzJztcblxuXG5jb25zdCBzcGF0aWFsRW50aXR5RGltZW5zaW9ucyA9IHtcbiAgW2NjZi5zcGF0aWFsRW50aXR5LnhfZGltZW5zaW9uLmlkXTogJ3gnLFxuICBbY2NmLnNwYXRpYWxFbnRpdHkueV9kaW1lbnNpb24uaWRdOiAneScsXG4gIFtjY2Yuc3BhdGlhbEVudGl0eS56X2RpbWVuc2lvbi5pZF06ICd6J1xufTtcblxuZnVuY3Rpb24gZ2V0U3BhdGlhbEVudGl0eURpbWVuc2lvbnMoc3RvcmU6IFN0b3JlLCBpcmk6IHN0cmluZyk6IFtudW1iZXIsIG51bWJlciwgbnVtYmVyXSB7XG4gIGNvbnN0IGRpbXMgPSBnZXRNYXBwZWRSZXN1bHQ8eyB4OiBudW1iZXI7IHk6IG51bWJlcjsgejogbnVtYmVyIH0+KHN0b3JlLCBpcmksICdEaW1lbnNpb25zJywgc3BhdGlhbEVudGl0eURpbWVuc2lvbnMpO1xuICByZXR1cm4gWyBkaW1zLngsIGRpbXMueSwgZGltcy56IF07XG59XG5cbmV4cG9ydCBmdW5jdGlvbiBnZXRPcmllbnRlZEJvdW5kaW5nQm94KHN0b3JlOiBTdG9yZSwgZ3JhcGg6IENDRlNwYXRpYWxHcmFwaCwgc291cmNlSXJpOiBzdHJpbmcsIHRhcmdldElyaTogc3RyaW5nKTogT3JpZW50ZWRCb3VuZGluZ0JveCB8IHVuZGVmaW5lZCB7XG4gIGNvbnN0IG1hdHJpeCA9IGdyYXBoLmdldFRyYW5zZm9ybWF0aW9uTWF0cml4KHNvdXJjZUlyaSwgdGFyZ2V0SXJpKTtcbiAgbGV0IHJlc3VsdDogT3JpZW50ZWRCb3VuZGluZ0JveCB8IHVuZGVmaW5lZCA9IHVuZGVmaW5lZDtcbiAgaWYgKG1hdHJpeCkge1xuICAgIGNvbnN0IGNlbnRlciA9IG1hdHJpeC5nZXRUcmFuc2xhdGlvbigpO1xuICAgIGNvbnN0IGhhbGZTaXplID0gZ2V0U3BhdGlhbEVudGl0eURpbWVuc2lvbnMoc3RvcmUsIHNvdXJjZUlyaSkubWFwKG4gPT4gbiAvIDEwMDAgLyAyKTtcbiAgICBjb25zdCBxdWF0ZXJuaW9uID0gbmV3IEV1bGVyKCkuZnJvbVJvdGF0aW9uTWF0cml4KG1hdHJpeCwgRXVsZXIuWFlaKS50b1F1YXRlcm5pb24oKS5ub3JtYWxpemUoKS5jYWxjdWxhdGVXKCk7XG4gICAgcmVzdWx0ID0gbmV3IE9yaWVudGVkQm91bmRpbmdCb3goKS5mcm9tQ2VudGVySGFsZlNpemVRdWF0ZXJuaW9uKGNlbnRlciwgaGFsZlNpemUsIHF1YXRlcm5pb24pO1xuICB9XG4gIHJldHVybiByZXN1bHQ7XG59XG5cbmV4cG9ydCBmdW5jdGlvbiBmaWx0ZXJCeVByb2JpbmdTcGhlcmUoc3RvcmU6IFN0b3JlLCBncmFwaDogQ0NGU3BhdGlhbEdyYXBoLCBzZWVuOiBTZXQ8c3RyaW5nPiwgc2VhcmNoOiBTcGF0aWFsU2VhcmNoKTogU2V0PHN0cmluZz4ge1xuICBjb25zdCB7IHgsIHksIHosIHJhZGl1cywgdGFyZ2V0IH0gPSBzZWFyY2g7XG4gIGNvbnN0IG5ld1NlZW4gPSBuZXcgU2V0PHN0cmluZz4oKTtcbiAgY29uc3QgcmFkaXVzU3F1YXJlZCA9IChyYWRpdXMgLyAxMDAwKSAqIChyYWRpdXMgLyAxMDAwKTtcbiAgZm9yIChjb25zdCBzb3VyY2VJcmkgb2Ygc2Vlbikge1xuICAgIGNvbnN0IGJvdW5kaW5nQm94ID0gZ2V0T3JpZW50ZWRCb3VuZGluZ0JveChzdG9yZSwgZ3JhcGgsIHNvdXJjZUlyaSwgdGFyZ2V0KTtcbiAgICBpZiAoYm91bmRpbmdCb3gpIHtcbiAgICAgIGNvbnN0IGRpc3RhbmNlU3F1YXJlZCA9IGJvdW5kaW5nQm94LmRpc3RhbmNlU3F1YXJlZFRvKFt4LCB5LCB6XS5tYXAobiA9PiBuIC8gMTAwMCkpO1xuICAgICAgaWYgKGRpc3RhbmNlU3F1YXJlZCA8PSByYWRpdXNTcXVhcmVkKSB7XG4gICAgICAgIG5ld1NlZW4uYWRkKHNvdXJjZUlyaSk7XG4gICAgICB9XG4gICAgfVxuICB9XG4gIHJldHVybiBuZXdTZWVuO1xufVxuIl19 \ No newline at end of file diff --git a/ccf-database/esm2015/lib/queries/tissue-block-result-n3.js b/ccf-database/esm2015/lib/queries/tissue-block-result-n3.js deleted file mode 100644 index 7facad3c4..000000000 --- a/ccf-database/esm2015/lib/queries/tissue-block-result-n3.js +++ /dev/null @@ -1,84 +0,0 @@ -import { getEntries, getMappedResult } from '../util/n3-functions'; -import { entity } from '../util/prefixes'; -/** Entity iri to property path. */ -const listResultSet = { - [entity.label.id]: 'label', - [entity.description.id]: 'description', - [entity.link.id]: 'link' -}; -const donorResultSet = Object.assign(Object.assign({}, listResultSet), { [entity.providerName.id]: 'providerName' }); -const datasetResultSet = Object.assign(Object.assign({}, listResultSet), { [entity.technology.id]: 'technology', [entity.thumbnail.id]: 'thumbnail' }); -const tissueSectionResultSet = Object.assign(Object.assign({}, listResultSet), { [entity.sampleType.id]: 'sampleType', [entity.sectionNumber.id]: 'sectionNumber', [entity.datasets.id]: 'datasets' }); -const tissueBlockResultSet = Object.assign(Object.assign({}, listResultSet), { [entity.sampleType.id]: 'sampleType', [entity.sectionCount.id]: 'sectionCount', [entity.sectionSize.id]: 'sectionSize', [entity.sectionUnits.id]: 'sectionUnits', [entity.donor.id]: 'donor', [entity.spatialEntity.id]: 'spatialEntityId', [entity.sections.id]: 'sections', [entity.datasets.id]: 'datasets' }); -/** - * Extracts a single donor result from the triple store. - * - * @param store The triple store. - * @param iri The entity id. - * @returns The list data. - */ -export function getDonorResult(store, iri) { - return getMappedResult(store, iri, 'Donor', donorResultSet); -} -/** - * Extracts a single dataset result from the triple store. - * - * @param store The triple store. - * @param iri The entity id. - * @returns The list data. - */ -export function getDatasetResult(store, iri) { - return getMappedResult(store, iri, 'Dataset', datasetResultSet); -} -/** - * Extracts a single tissue section result from the triple store. - * - * @param store The triple store. - * @param iri The entity id. - * @returns The list data. - */ -export function getTissueSectionResult(store, iri) { - // eslint-disable-next-line @typescript-eslint/consistent-type-assertions - const result = { '@id': iri, '@type': 'Sample', datasets: [] }; - for (const [key, value] of getEntries(store, iri, tissueSectionResultSet)) { - if (key === 'datasets') { - const dataset = getDatasetResult(store, value); - result[key].push(dataset); - } - else { - result[key] = value; - } - } - return result; -} -/** - * Extracts a single tissue block result from the triple store. - * - * @param store The triple store. - * @param iri The entity id. - * @returns The list data. - */ -export function getTissueBlockResult(store, iri) { - // eslint-disable-next-line @typescript-eslint/consistent-type-assertions - const result = { '@id': iri, '@type': 'Sample', - sections: [], datasets: [] - }; - for (const [key, value] of getEntries(store, iri, tissueBlockResultSet)) { - if (key === 'sections') { - const section = getTissueSectionResult(store, value); - result[key].push(section); - } - else if (key === 'datasets') { - const dataset = getDatasetResult(store, value); - result[key].push(dataset); - } - else if (key === 'donor') { - result[key] = getDonorResult(store, value); - } - else { - result[key] = value; - } - } - return result; -} -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGlzc3VlLWJsb2NrLXJlc3VsdC1uMy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL2NjZi1kYXRhYmFzZS9zcmMvbGliL3F1ZXJpZXMvdGlzc3VlLWJsb2NrLXJlc3VsdC1uMy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFFQSxPQUFPLEVBQUUsVUFBVSxFQUFFLGVBQWUsRUFBRSxNQUFNLHNCQUFzQixDQUFDO0FBQ25FLE9BQU8sRUFBRSxNQUFNLEVBQUUsTUFBTSxrQkFBa0IsQ0FBQztBQUcxQyxtQ0FBbUM7QUFDbkMsTUFBTSxhQUFhLEdBQThCO0lBQy9DLENBQUMsTUFBTSxDQUFDLEtBQUssQ0FBQyxFQUFFLENBQUMsRUFBRSxPQUFPO0lBQzFCLENBQUMsTUFBTSxDQUFDLFdBQVcsQ0FBQyxFQUFFLENBQUMsRUFBRSxhQUFhO0lBQ3RDLENBQUMsTUFBTSxDQUFDLElBQUksQ0FBQyxFQUFFLENBQUMsRUFBRSxNQUFNO0NBQ3pCLENBQUM7QUFFRixNQUFNLGNBQWMsbUNBQ2YsYUFBYSxLQUNoQixDQUFDLE1BQU0sQ0FBQyxZQUFZLENBQUMsRUFBRSxDQUFDLEVBQUUsY0FBYyxHQUN6QyxDQUFDO0FBRUYsTUFBTSxnQkFBZ0IsbUNBQ2pCLGFBQWEsS0FDaEIsQ0FBQyxNQUFNLENBQUMsVUFBVSxDQUFDLEVBQUUsQ0FBQyxFQUFFLFlBQVksRUFDcEMsQ0FBQyxNQUFNLENBQUMsU0FBUyxDQUFDLEVBQUUsQ0FBQyxFQUFFLFdBQVcsR0FDbkMsQ0FBQztBQUVGLE1BQU0sc0JBQXNCLG1DQUN2QixhQUFhLEtBQ2hCLENBQUMsTUFBTSxDQUFDLFVBQVUsQ0FBQyxFQUFFLENBQUMsRUFBRSxZQUFZLEVBQ3BDLENBQUMsTUFBTSxDQUFDLGFBQWEsQ0FBQyxFQUFFLENBQUMsRUFBRSxlQUFlLEVBQzFDLENBQUMsTUFBTSxDQUFDLFFBQVEsQ0FBQyxFQUFFLENBQUMsRUFBRSxVQUFVLEdBQ2pDLENBQUM7QUFFRixNQUFNLG9CQUFvQixtQ0FDckIsYUFBYSxLQUNoQixDQUFDLE1BQU0sQ0FBQyxVQUFVLENBQUMsRUFBRSxDQUFDLEVBQUUsWUFBWSxFQUNwQyxDQUFDLE1BQU0sQ0FBQyxZQUFZLENBQUMsRUFBRSxDQUFDLEVBQUUsY0FBYyxFQUN4QyxDQUFDLE1BQU0sQ0FBQyxXQUFXLENBQUMsRUFBRSxDQUFDLEVBQUUsYUFBYSxFQUN0QyxDQUFDLE1BQU0sQ0FBQyxZQUFZLENBQUMsRUFBRSxDQUFDLEVBQUUsY0FBYyxFQUV4QyxDQUFDLE1BQU0sQ0FBQyxLQUFLLENBQUMsRUFBRSxDQUFDLEVBQUUsT0FBTyxFQUMxQixDQUFDLE1BQU0sQ0FBQyxhQUFhLENBQUMsRUFBRSxDQUFDLEVBQUUsaUJBQWlCLEVBQzVDLENBQUMsTUFBTSxDQUFDLFFBQVEsQ0FBQyxFQUFFLENBQUMsRUFBRSxVQUFVLEVBQ2hDLENBQUMsTUFBTSxDQUFDLFFBQVEsQ0FBQyxFQUFFLENBQUMsRUFBRSxVQUFVLEdBQ2pDLENBQUM7QUFFRjs7Ozs7O0dBTUc7QUFDSCxNQUFNLFVBQVUsY0FBYyxDQUFDLEtBQVksRUFBRSxHQUFXO0lBQ3RELE9BQU8sZUFBZSxDQUFDLEtBQUssRUFBRSxHQUFHLEVBQUUsT0FBTyxFQUFFLGNBQWMsQ0FBQyxDQUFDO0FBQzlELENBQUM7QUFFRDs7Ozs7O0dBTUc7QUFDSCxNQUFNLFVBQVUsZ0JBQWdCLENBQUMsS0FBWSxFQUFFLEdBQVc7SUFDeEQsT0FBTyxlQUFlLENBQUMsS0FBSyxFQUFFLEdBQUcsRUFBRSxTQUFTLEVBQUUsZ0JBQWdCLENBQUMsQ0FBQztBQUNsRSxDQUFDO0FBRUQ7Ozs7OztHQU1HO0FBQ0gsTUFBTSxVQUFVLHNCQUFzQixDQUFDLEtBQVksRUFBRSxHQUFXO0lBQzlELHlFQUF5RTtJQUN6RSxNQUFNLE1BQU0sR0FBRyxFQUFFLEtBQUssRUFBRSxHQUFHLEVBQUUsT0FBTyxFQUFFLFFBQVEsRUFBRSxRQUFRLEVBQUUsRUFBcUIsRUFBeUIsQ0FBQztJQUN6RyxLQUFLLE1BQU0sQ0FBQyxHQUFHLEVBQUUsS0FBSyxDQUFDLElBQUksVUFBVSxDQUFDLEtBQUssRUFBRSxHQUFHLEVBQUUsc0JBQXNCLENBQUMsRUFBRTtRQUN6RSxJQUFJLEdBQUcsS0FBSyxVQUFVLEVBQUU7WUFDdEIsTUFBTSxPQUFPLEdBQUcsZ0JBQWdCLENBQUMsS0FBSyxFQUFFLEtBQWUsQ0FBQyxDQUFDO1lBQ3pELE1BQU0sQ0FBQyxHQUFHLENBQUMsQ0FBQyxJQUFJLENBQUMsT0FBTyxDQUFDLENBQUM7U0FDM0I7YUFBTTtZQUNMLE1BQU0sQ0FBQyxHQUFHLENBQUMsR0FBRyxLQUFLLENBQUM7U0FDckI7S0FDRjtJQUNELE9BQU8sTUFBTSxDQUFDO0FBQ2hCLENBQUM7QUFFRDs7Ozs7O0dBTUc7QUFDSCxNQUFNLFVBQVUsb0JBQW9CLENBQUMsS0FBWSxFQUFFLEdBQVc7SUFDNUQseUVBQXlFO0lBQ3pFLE1BQU0sTUFBTSxHQUFHLEVBQUUsS0FBSyxFQUFFLEdBQUcsRUFBRSxPQUFPLEVBQUUsUUFBUTtRQUM1QyxRQUFRLEVBQUUsRUFBMkIsRUFBRSxRQUFRLEVBQUUsRUFBcUI7S0FDbEQsQ0FBQztJQUN2QixLQUFLLE1BQU0sQ0FBQyxHQUFHLEVBQUUsS0FBSyxDQUFDLElBQUksVUFBVSxDQUFDLEtBQUssRUFBRSxHQUFHLEVBQUUsb0JBQW9CLENBQUMsRUFBRTtRQUN2RSxJQUFJLEdBQUcsS0FBSyxVQUFVLEVBQUU7WUFDdEIsTUFBTSxPQUFPLEdBQUcsc0JBQXNCLENBQUMsS0FBSyxFQUFFLEtBQWUsQ0FBQyxDQUFDO1lBQy9ELE1BQU0sQ0FBQyxHQUFHLENBQUMsQ0FBQyxJQUFJLENBQUMsT0FBTyxDQUFDLENBQUM7U0FDM0I7YUFBTSxJQUFJLEdBQUcsS0FBSyxVQUFVLEVBQUU7WUFDN0IsTUFBTSxPQUFPLEdBQUcsZ0JBQWdCLENBQUMsS0FBSyxFQUFFLEtBQWUsQ0FBQyxDQUFDO1lBQ3pELE1BQU0sQ0FBQyxHQUFHLENBQUMsQ0FBQyxJQUFJLENBQUMsT0FBTyxDQUFDLENBQUM7U0FDM0I7YUFBTSxJQUFJLEdBQUcsS0FBSyxPQUFPLEVBQUU7WUFDMUIsTUFBTSxDQUFDLEdBQUcsQ0FBQyxHQUFHLGNBQWMsQ0FBQyxLQUFLLEVBQUUsS0FBZSxDQUFDLENBQUM7U0FDdEQ7YUFBTTtZQUNMLE1BQU0sQ0FBQyxHQUFHLENBQUMsR0FBRyxLQUFLLENBQUM7U0FDckI7S0FDRjtJQUNELE9BQU8sTUFBTSxDQUFDO0FBQ2hCLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBTdG9yZSB9IGZyb20gJ3RyaXBsZS1zdG9yZS11dGlscyc7XG5pbXBvcnQgeyBEYXRhc2V0UmVzdWx0LCBEb25vclJlc3VsdCwgVGlzc3VlQmxvY2tSZXN1bHQsIFRpc3N1ZVNlY3Rpb25SZXN1bHQgfSBmcm9tICcuLi9pbnRlcmZhY2VzJztcbmltcG9ydCB7IGdldEVudHJpZXMsIGdldE1hcHBlZFJlc3VsdCB9IGZyb20gJy4uL3V0aWwvbjMtZnVuY3Rpb25zJztcbmltcG9ydCB7IGVudGl0eSB9IGZyb20gJy4uL3V0aWwvcHJlZml4ZXMnO1xuXG5cbi8qKiBFbnRpdHkgaXJpIHRvIHByb3BlcnR5IHBhdGguICovXG5jb25zdCBsaXN0UmVzdWx0U2V0OiB7IFtpcmk6IHN0cmluZ106IHN0cmluZyB9ID0ge1xuICBbZW50aXR5LmxhYmVsLmlkXTogJ2xhYmVsJyxcbiAgW2VudGl0eS5kZXNjcmlwdGlvbi5pZF06ICdkZXNjcmlwdGlvbicsXG4gIFtlbnRpdHkubGluay5pZF06ICdsaW5rJ1xufTtcblxuY29uc3QgZG9ub3JSZXN1bHRTZXQ6IHsgW2lyaTogc3RyaW5nXTogc3RyaW5nIH0gPSB7XG4gIC4uLmxpc3RSZXN1bHRTZXQsXG4gIFtlbnRpdHkucHJvdmlkZXJOYW1lLmlkXTogJ3Byb3ZpZGVyTmFtZSdcbn07XG5cbmNvbnN0IGRhdGFzZXRSZXN1bHRTZXQ6IHsgW2lyaTogc3RyaW5nXTogc3RyaW5nIH0gPSB7XG4gIC4uLmxpc3RSZXN1bHRTZXQsXG4gIFtlbnRpdHkudGVjaG5vbG9neS5pZF06ICd0ZWNobm9sb2d5JyxcbiAgW2VudGl0eS50aHVtYm5haWwuaWRdOiAndGh1bWJuYWlsJyxcbn07XG5cbmNvbnN0IHRpc3N1ZVNlY3Rpb25SZXN1bHRTZXQ6IHsgW2lyaTogc3RyaW5nXTogc3RyaW5nIH0gPSB7XG4gIC4uLmxpc3RSZXN1bHRTZXQsXG4gIFtlbnRpdHkuc2FtcGxlVHlwZS5pZF06ICdzYW1wbGVUeXBlJyxcbiAgW2VudGl0eS5zZWN0aW9uTnVtYmVyLmlkXTogJ3NlY3Rpb25OdW1iZXInLFxuICBbZW50aXR5LmRhdGFzZXRzLmlkXTogJ2RhdGFzZXRzJyxcbn07XG5cbmNvbnN0IHRpc3N1ZUJsb2NrUmVzdWx0U2V0OiB7IFtpcmk6IHN0cmluZ106IHN0cmluZyB9ID0ge1xuICAuLi5saXN0UmVzdWx0U2V0LFxuICBbZW50aXR5LnNhbXBsZVR5cGUuaWRdOiAnc2FtcGxlVHlwZScsXG4gIFtlbnRpdHkuc2VjdGlvbkNvdW50LmlkXTogJ3NlY3Rpb25Db3VudCcsXG4gIFtlbnRpdHkuc2VjdGlvblNpemUuaWRdOiAnc2VjdGlvblNpemUnLFxuICBbZW50aXR5LnNlY3Rpb25Vbml0cy5pZF06ICdzZWN0aW9uVW5pdHMnLFxuXG4gIFtlbnRpdHkuZG9ub3IuaWRdOiAnZG9ub3InLFxuICBbZW50aXR5LnNwYXRpYWxFbnRpdHkuaWRdOiAnc3BhdGlhbEVudGl0eUlkJyxcbiAgW2VudGl0eS5zZWN0aW9ucy5pZF06ICdzZWN0aW9ucycsXG4gIFtlbnRpdHkuZGF0YXNldHMuaWRdOiAnZGF0YXNldHMnLFxufTtcblxuLyoqXG4gKiBFeHRyYWN0cyBhIHNpbmdsZSBkb25vciByZXN1bHQgZnJvbSB0aGUgdHJpcGxlIHN0b3JlLlxuICpcbiAqIEBwYXJhbSBzdG9yZSBUaGUgdHJpcGxlIHN0b3JlLlxuICogQHBhcmFtIGlyaSBUaGUgZW50aXR5IGlkLlxuICogQHJldHVybnMgVGhlIGxpc3QgZGF0YS5cbiAqL1xuZXhwb3J0IGZ1bmN0aW9uIGdldERvbm9yUmVzdWx0KHN0b3JlOiBTdG9yZSwgaXJpOiBzdHJpbmcpOiBEb25vclJlc3VsdCB7XG4gIHJldHVybiBnZXRNYXBwZWRSZXN1bHQoc3RvcmUsIGlyaSwgJ0Rvbm9yJywgZG9ub3JSZXN1bHRTZXQpO1xufVxuXG4vKipcbiAqIEV4dHJhY3RzIGEgc2luZ2xlIGRhdGFzZXQgcmVzdWx0IGZyb20gdGhlIHRyaXBsZSBzdG9yZS5cbiAqXG4gKiBAcGFyYW0gc3RvcmUgVGhlIHRyaXBsZSBzdG9yZS5cbiAqIEBwYXJhbSBpcmkgVGhlIGVudGl0eSBpZC5cbiAqIEByZXR1cm5zIFRoZSBsaXN0IGRhdGEuXG4gKi9cbmV4cG9ydCBmdW5jdGlvbiBnZXREYXRhc2V0UmVzdWx0KHN0b3JlOiBTdG9yZSwgaXJpOiBzdHJpbmcpOiBEYXRhc2V0UmVzdWx0IHtcbiAgcmV0dXJuIGdldE1hcHBlZFJlc3VsdChzdG9yZSwgaXJpLCAnRGF0YXNldCcsIGRhdGFzZXRSZXN1bHRTZXQpO1xufVxuXG4vKipcbiAqIEV4dHJhY3RzIGEgc2luZ2xlIHRpc3N1ZSBzZWN0aW9uIHJlc3VsdCBmcm9tIHRoZSB0cmlwbGUgc3RvcmUuXG4gKlxuICogQHBhcmFtIHN0b3JlIFRoZSB0cmlwbGUgc3RvcmUuXG4gKiBAcGFyYW0gaXJpIFRoZSBlbnRpdHkgaWQuXG4gKiBAcmV0dXJucyBUaGUgbGlzdCBkYXRhLlxuICovXG5leHBvcnQgZnVuY3Rpb24gZ2V0VGlzc3VlU2VjdGlvblJlc3VsdChzdG9yZTogU3RvcmUsIGlyaTogc3RyaW5nKTogVGlzc3VlU2VjdGlvblJlc3VsdCB7XG4gIC8vIGVzbGludC1kaXNhYmxlLW5leHQtbGluZSBAdHlwZXNjcmlwdC1lc2xpbnQvY29uc2lzdGVudC10eXBlLWFzc2VydGlvbnNcbiAgY29uc3QgcmVzdWx0ID0geyAnQGlkJzogaXJpLCAnQHR5cGUnOiAnU2FtcGxlJywgZGF0YXNldHM6IFtdIGFzIERhdGFzZXRSZXN1bHRbXSB9IGFzIFRpc3N1ZVNlY3Rpb25SZXN1bHQ7XG4gIGZvciAoY29uc3QgW2tleSwgdmFsdWVdIG9mIGdldEVudHJpZXMoc3RvcmUsIGlyaSwgdGlzc3VlU2VjdGlvblJlc3VsdFNldCkpIHtcbiAgICBpZiAoa2V5ID09PSAnZGF0YXNldHMnKSB7XG4gICAgICBjb25zdCBkYXRhc2V0ID0gZ2V0RGF0YXNldFJlc3VsdChzdG9yZSwgdmFsdWUgYXMgc3RyaW5nKTtcbiAgICAgIHJlc3VsdFtrZXldLnB1c2goZGF0YXNldCk7XG4gICAgfSBlbHNlIHtcbiAgICAgIHJlc3VsdFtrZXldID0gdmFsdWU7XG4gICAgfVxuICB9XG4gIHJldHVybiByZXN1bHQ7XG59XG5cbi8qKlxuICogRXh0cmFjdHMgYSBzaW5nbGUgdGlzc3VlIGJsb2NrIHJlc3VsdCBmcm9tIHRoZSB0cmlwbGUgc3RvcmUuXG4gKlxuICogQHBhcmFtIHN0b3JlIFRoZSB0cmlwbGUgc3RvcmUuXG4gKiBAcGFyYW0gaXJpIFRoZSBlbnRpdHkgaWQuXG4gKiBAcmV0dXJucyBUaGUgbGlzdCBkYXRhLlxuICovXG5leHBvcnQgZnVuY3Rpb24gZ2V0VGlzc3VlQmxvY2tSZXN1bHQoc3RvcmU6IFN0b3JlLCBpcmk6IHN0cmluZyk6IFRpc3N1ZUJsb2NrUmVzdWx0IHtcbiAgLy8gZXNsaW50LWRpc2FibGUtbmV4dC1saW5lIEB0eXBlc2NyaXB0LWVzbGludC9jb25zaXN0ZW50LXR5cGUtYXNzZXJ0aW9uc1xuICBjb25zdCByZXN1bHQgPSB7ICdAaWQnOiBpcmksICdAdHlwZSc6ICdTYW1wbGUnLFxuICAgIHNlY3Rpb25zOiBbXSBhcyBUaXNzdWVTZWN0aW9uUmVzdWx0W10sIGRhdGFzZXRzOiBbXSBhcyBEYXRhc2V0UmVzdWx0W11cbiAgfSBhcyBUaXNzdWVCbG9ja1Jlc3VsdDtcbiAgZm9yIChjb25zdCBba2V5LCB2YWx1ZV0gb2YgZ2V0RW50cmllcyhzdG9yZSwgaXJpLCB0aXNzdWVCbG9ja1Jlc3VsdFNldCkpIHtcbiAgICBpZiAoa2V5ID09PSAnc2VjdGlvbnMnKSB7XG4gICAgICBjb25zdCBzZWN0aW9uID0gZ2V0VGlzc3VlU2VjdGlvblJlc3VsdChzdG9yZSwgdmFsdWUgYXMgc3RyaW5nKTtcbiAgICAgIHJlc3VsdFtrZXldLnB1c2goc2VjdGlvbik7XG4gICAgfSBlbHNlIGlmIChrZXkgPT09ICdkYXRhc2V0cycpIHtcbiAgICAgIGNvbnN0IGRhdGFzZXQgPSBnZXREYXRhc2V0UmVzdWx0KHN0b3JlLCB2YWx1ZSBhcyBzdHJpbmcpO1xuICAgICAgcmVzdWx0W2tleV0ucHVzaChkYXRhc2V0KTtcbiAgICB9IGVsc2UgaWYgKGtleSA9PT0gJ2Rvbm9yJykge1xuICAgICAgcmVzdWx0W2tleV0gPSBnZXREb25vclJlc3VsdChzdG9yZSwgdmFsdWUgYXMgc3RyaW5nKTtcbiAgICB9IGVsc2Uge1xuICAgICAgcmVzdWx0W2tleV0gPSB2YWx1ZTtcbiAgICB9XG4gIH1cbiAgcmV0dXJuIHJlc3VsdDtcbn1cbiJdfQ== \ No newline at end of file diff --git a/ccf-database/esm2015/lib/spatial-types.js b/ccf-database/esm2015/lib/spatial-types.js deleted file mode 100644 index 50a61cb55..000000000 --- a/ccf-database/esm2015/lib/spatial-types.js +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3BhdGlhbC10eXBlcy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3Byb2plY3RzL2NjZi1kYXRhYmFzZS9zcmMvbGliL3NwYXRpYWwtdHlwZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsInNvdXJjZXNDb250ZW50IjpbIi8qIGVzbGludC1kaXNhYmxlIEB0eXBlc2NyaXB0LWVzbGludC9uYW1pbmctY29udmVudGlvbiAqL1xuLyoqIEEgcmVmZXJlbmNlIHRvIGEgc3BhdGlhbCBvYmplY3QgKi9cbmV4cG9ydCBpbnRlcmZhY2UgU3BhdGlhbE9iamVjdFJlZmVyZW5jZSB7XG4gIC8qKiBJZGVudGlmaWVyICovXG4gICdAaWQnOiBzdHJpbmc7XG4gIC8qKiBUeXBlIG5hbWUgKi9cbiAgJ0B0eXBlJzogJ1NwYXRpYWxPYmplY3RSZWZlcmVuY2UnO1xuICAvKiogRGF0YSBmaWxlIG5hbWUgKi9cbiAgZmlsZTogc3RyaW5nO1xuICAvKiogRGF0YSBmb3JtYXQgKi9cbiAgZmlsZV9mb3JtYXQ6IHN0cmluZztcbiAgLyoqIEZpbGUgc3VicGF0aCAqL1xuICBmaWxlX3N1YnBhdGg/OiBzdHJpbmc7XG59XG5cbi8qKiBBIHNldCBvZiBleHRyYWN0aW9uIHNpdGVzICovXG5leHBvcnQgaW50ZXJmYWNlIEV4dHJhY3Rpb25TZXQge1xuICAvKiogSWRlbnRpZmllciAqL1xuICAnQGlkJzogc3RyaW5nO1xuICAvKiogVHlwZSBuYW1lICovXG4gICdAdHlwZSc6ICdFeHRyYWN0aW9uU2V0JztcbiAgLyoqIEVudGl0eSBsYWJlbCAqL1xuICBsYWJlbDogc3RyaW5nO1xuICAvKiogVGhlIGxpc3Qgb2YgZXh0cmFjdGlvbiBzaXRlcyBpbiB0aGlzIHNldCAqL1xuICBleHRyYWN0aW9uU2l0ZXM6IFNwYXRpYWxFbnRpdHlbXTtcbn1cblxuLyoqIEEgc3BhdGlhbCBlbnRpdHkgKi9cbmV4cG9ydCBpbnRlcmZhY2UgU3BhdGlhbEVudGl0eSB7XG4gIC8qKiBJZGVudGlmaWVyICovXG4gICdAaWQnOiBzdHJpbmc7XG4gIC8qKiBUeXBlIG5hbWUgKi9cbiAgJ0B0eXBlJzogJ1NwYXRpYWxFbnRpdHknO1xuICAvKiogSVJJIG9mIHRoZSBFbnRpdHkgdGhpcyBTcGF0aWFsIEVudGl0eSByZXByZXNlbnRzICovXG4gIGVudGl0eUlkPzogc3RyaW5nO1xuICAvKiogRW50aXR5IGxhYmVsICovXG4gIGxhYmVsPzogc3RyaW5nO1xuICAvKiogRW50aXR5IGNvbW1lbnQgKi9cbiAgY29tbWVudD86IHN0cmluZztcbiAgLyoqIENyZWF0b3IgKi9cbiAgY3JlYXRvcj86IHN0cmluZztcbiAgLyoqIENyZWF0b3IgZmlyc3QgbmFtZSAqL1xuICBjcmVhdG9yX2ZpcnN0X25hbWU/OiBzdHJpbmc7XG4gIC8qKiBDcmVhdG9yIGxhc3QgbmFtZSAqL1xuICBjcmVhdG9yX2xhc3RfbmFtZT86IHN0cmluZztcbiAgLyoqIENyZWF0b3IgaWRlbnRpZmllciAqL1xuICBjcmVhdG9yX29yY2lkPzogc3RyaW5nO1xuICAvKiogQ3JlYXRpb24gZGF0ZSAqL1xuICBjcmVhdGlvbl9kYXRlPzogc3RyaW5nO1xuXG4gIC8qKiBBbm5vdGF0aW9ucyAoYSBzZXQgb2YgSVJJcykgKi9cbiAgY2NmX2Fubm90YXRpb25zPzogc3RyaW5nW107XG4gIC8qKiBBbm5vdGF0aW9uIChJUkkpIHRoYXQgc2F5cyB3aGF0IHRoaXMgZW50aXR5IHJlcHJlc2VudHMgKi9cbiAgcmVwcmVzZW50YXRpb25fb2Y/OiBzdHJpbmc7XG4gIC8qKiBTcGVjaWZpZXMgaWYgdGhpcyBpcyBhbiBhbmF0b21pY2FsIHN0cnVjdHVyZSBvZiB0aGlzIG9yZ2FuIChJUkkpICovXG4gIHJlZmVyZW5jZV9vcmdhbj86IHN0cmluZztcbiAgLyoqIFNwZWNpZmllcyAod2hlcmUgYXBwbGljYWJsZSkgaWYgdGhpcyBlbnRpdHkgY2FtZSBmcm9tIGEgTWFsZSBvciBGZW1hbGUgKi9cbiAgc2V4OiAnTWFsZScgfCAnRmVtYWxlJyB8IHVuZGVmaW5lZDtcbiAgLyoqIFNwZWNpZmllcyAod2hlcmUgYXBwbGljYWJsZSkgaWYgdGhpcyBlbnRpdHkgY2FtZSBmcm9tIHRoZSBsZWZ0IG9yIHJpZ2h0IHNpZGUgb3JnYW4gKi9cbiAgc2lkZTogJ0xlZnQnIHwgJ1JpZ2h0JyB8IHVuZGVmaW5lZDtcbiAgLyoqIFJhbmtpbmcgdXNlZCBpbiB0aGUgUlVJIGZvciBvcmRlcmluZyBsaXN0cyAqL1xuICBydWlfcmFuaz86IG51bWJlcjtcbiAgLyoqIFRoZSB0aGlja25lc3MgKGluIG5hbm9tZXRlcnMpIG9mIHNsaWNlcyB0YWtlbiBvdXQgb2YgdGhpcyBzcGF0aWFsIGVudGl0eSAqL1xuICBzbGljZV90aGlja25lc3M/OiBudW1iZXI7XG4gIC8qKiBUaGUgbnVtYmVyIG9mIHNsaWNlcyB0YWtlbiBvdXQgb2YgdGhpcyBzcGF0aWFsIGVudGl0eSAqL1xuICBzbGljZV9jb3VudD86IG51bWJlcjtcblxuICAvKiogWC1kaW1lbnNpb24gKi9cbiAgeF9kaW1lbnNpb246IG51bWJlcjtcbiAgLyoqIFktZGltZW5zaW9uICovXG4gIHlfZGltZW5zaW9uOiBudW1iZXI7XG4gIC8qKiBaLWRpbWVuc2lvbiAqL1xuICB6X2RpbWVuc2lvbjogbnVtYmVyO1xuICAvKiogVW5pdHMgZGltZW5zaW9ucyBhcmUgaW4gKi9cbiAgZGltZW5zaW9uX3VuaXRzOiBzdHJpbmc7XG4gIC8qKiBEYXRhIHJlZmVyZW5jZXMgKi9cbiAgb2JqZWN0PzogU3BhdGlhbE9iamVjdFJlZmVyZW5jZTtcblxuICAvKiogQ29sb3JpbmcgKi9cbiAgY29sb3I/OiBbbnVtYmVyLCBudW1iZXIsIG51bWJlciwgbnVtYmVyXTtcbn1cblxuLyoqIE9iamVjdCBkZXNjcmliaW5nIHRoZSBwbGFjZW1lbnQgb2YgYW4gZW50aXR5ICovXG5leHBvcnQgaW50ZXJmYWNlIFNwYXRpYWxQbGFjZW1lbnRDb21tb24ge1xuICAvKiogSlNPTi1MRCBjb250ZXh0ICovXG4gICdAY29udGV4dCc/OiBzdHJpbmc7XG4gIC8qKiBJZGVudGlmaWVyICovXG4gICdAaWQnOiBzdHJpbmc7XG4gIC8qKiBUeXBlIG5hbWUgKi9cbiAgJ0B0eXBlJzogJ1NwYXRpYWxQbGFjZW1lbnQnO1xuXG4gIC8qKiBEYXRlIHBsYWNlbWVudCB3YXMgbWFkZSAqL1xuICBwbGFjZW1lbnRfZGF0ZTogc3RyaW5nO1xuICAvKiogU2NhbGluZyBpbiB4LWRpbWVuc2lvbiAqL1xuICB4X3NjYWxpbmc6IG51bWJlcjtcbiAgLyoqIFNjYWxpbmcgaW4geS1kaW1lbnNpb24gKi9cbiAgeV9zY2FsaW5nOiBudW1iZXI7XG4gIC8qKiBTY2FsaW5nIGluIHotZGltZW5zaW9uICovXG4gIHpfc2NhbGluZzogbnVtYmVyO1xuICAvKiogVW5pdHMgc2NhbGluZyBpcyBleHByZXNzZWQgaW4gKi9cbiAgc2NhbGluZ191bml0czogc3RyaW5nO1xuXG4gIC8qKiBSb3RhdGlvbiBpbiB4LWRpbWVuc2lvbiAqL1xuICB4X3JvdGF0aW9uOiBudW1iZXI7XG4gIC8qKiBSb3RhdGlvbiBpbiB5LWRpbWVuc2lvbiAqL1xuICB5X3JvdGF0aW9uOiBudW1iZXI7XG4gIC8qKiBSb3RhdGlvbiBpbiB6LWRpbWVuc2lvbiAqL1xuICB6X3JvdGF0aW9uOiBudW1iZXI7XG4gIC8qKiBSb3RhdGlvbiBpbiB3LWRpbWVuc2lvbiAqL1xuICB3X3JvdGF0aW9uPzogbnVtYmVyO1xuICAvKiogT3JkZXIgcm90YXRpb25zIHNob3VsZCBiZSBhcHBsaWVkIGluICovXG4gIHJvdGF0aW9uX29yZGVyPzogc3RyaW5nO1xuICAvKiogVW5pdHMgcm90YXRpb24gaXMgZXhwcmVzc2VkIGluICovXG4gIHJvdGF0aW9uX3VuaXRzOiBzdHJpbmc7XG5cbiAgLyoqIFRyYW5zbGF0aW9uIGluIHgtZGltZW5zaW9uICovXG4gIHhfdHJhbnNsYXRpb246IG51bWJlcjtcbiAgLyoqIFRyYW5zbGF0aW9uIGluIHktZGltZW5zaW9uICovXG4gIHlfdHJhbnNsYXRpb246IG51bWJlcjtcbiAgLyoqIFRyYW5zbGF0aW9uIGluIHotZGltZW5zaW9uICovXG4gIHpfdHJhbnNsYXRpb246IG51bWJlcjtcbiAgLyoqIFVuaXRzIHRyYW5zbGF0aW9uIGlzIGV4cHJlc3NlZCBpbiAqL1xuICB0cmFuc2xhdGlvbl91bml0czogc3RyaW5nO1xufVxuXG5leHBvcnQgaW50ZXJmYWNlIFNwYXRpYWxQbGFjZW1lbnQgZXh0ZW5kcyBTcGF0aWFsUGxhY2VtZW50Q29tbW9uIHtcbiAgLyoqIFNvdXJjZSBlbnRpdHkgKi9cbiAgc291cmNlOiBTcGF0aWFsRW50aXR5IHwgU3BhdGlhbE9iamVjdFJlZmVyZW5jZTtcbiAgLyoqIFRhcmdldCBlbnRpdHkgKi9cbiAgdGFyZ2V0OiBTcGF0aWFsRW50aXR5O1xufVxuXG5leHBvcnQgaW50ZXJmYWNlIEZsYXRTcGF0aWFsUGxhY2VtZW50IGV4dGVuZHMgU3BhdGlhbFBsYWNlbWVudENvbW1vbiB7XG4gIC8qKiBTb3VyY2UgZW50aXR5IGlyaSAqL1xuICBzb3VyY2U6IHN0cmluZztcbiAgLyoqIFRhcmdldCBlbnRpdHkgaXJpICovXG4gIHRhcmdldDogc3RyaW5nO1xufVxuIl19 \ No newline at end of file diff --git a/ccf-database/esm2015/lib/util/ccf-database-status-tracker.js b/ccf-database/esm2015/lib/util/ccf-database-status-tracker.js deleted file mode 100644 index 7a0c2579d..000000000 --- a/ccf-database/esm2015/lib/util/ccf-database-status-tracker.js +++ /dev/null @@ -1,47 +0,0 @@ -import { __awaiter } from "tslib"; -export class CCFDatabaseStatusTracker { - constructor(database) { - this.database = database; - this.connect(); - } - toJson() { - return { - status: this.status, - message: this.message, - checkback: this.status === 'Ready' || this.status === 'Error' ? 60 * 60 * 1000 : 2000, - loadTime: this.loadTime - }; - } - connect() { - this.status = 'Loading'; - this.message = 'Loading database'; - const startTime = Date.now(); - return this.database.connect() - .then((loaded) => __awaiter(this, void 0, void 0, function* () { - if (loaded) { - // Warm up the database - this.message = 'Building scene'; - yield this.database.getScene(); - this.message = 'Building tissue block results'; - yield this.database.getTissueBlockResults(); - this.message = 'Aggregating results'; - yield this.database.getAggregateResults(); - this.status = 'Ready'; - this.message = 'Database successfully loaded'; - } - else { - this.status = 'Error'; - this.message = 'Unknown error while loading database'; - } - })) - .catch((error) => { - var _a; - this.status = 'Error'; - this.message = (_a = error === null || error === void 0 ? void 0 : error.message) !== null && _a !== void 0 ? _a : 'Unknown error while loading database'; - }) - .finally(() => { - this.loadTime = Date.now() - startTime; - }); - } -} -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2NmLWRhdGFiYXNlLXN0YXR1cy10cmFja2VyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvY2NmLWRhdGFiYXNlL3NyYy9saWIvdXRpbC9jY2YtZGF0YWJhc2Utc3RhdHVzLXRyYWNrZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUlBLE1BQU0sT0FBTyx3QkFBd0I7SUFLbkMsWUFBbUIsUUFBcUI7UUFBckIsYUFBUSxHQUFSLFFBQVEsQ0FBYTtRQUN0QyxJQUFJLENBQUMsT0FBTyxFQUFFLENBQUM7SUFDakIsQ0FBQztJQUVELE1BQU07UUFDSixPQUFPO1lBQ0wsTUFBTSxFQUFFLElBQUksQ0FBQyxNQUFNO1lBQ25CLE9BQU8sRUFBRSxJQUFJLENBQUMsT0FBTztZQUNyQixTQUFTLEVBQUUsSUFBSSxDQUFDLE1BQU0sS0FBSyxPQUFPLElBQUksSUFBSSxDQUFDLE1BQU0sS0FBSyxPQUFPLENBQUMsQ0FBQyxDQUFDLEVBQUUsR0FBRyxFQUFFLEdBQUcsSUFBSSxDQUFDLENBQUMsQ0FBQyxJQUFJO1lBQ3JGLFFBQVEsRUFBRSxJQUFJLENBQUMsUUFBUTtTQUN4QixDQUFDO0lBQ0osQ0FBQztJQUVPLE9BQU87UUFDYixJQUFJLENBQUMsTUFBTSxHQUFHLFNBQVMsQ0FBQztRQUN4QixJQUFJLENBQUMsT0FBTyxHQUFHLGtCQUFrQixDQUFDO1FBRWxDLE1BQU0sU0FBUyxHQUFHLElBQUksQ0FBQyxHQUFHLEVBQUUsQ0FBQztRQUM3QixPQUFPLElBQUksQ0FBQyxRQUFRLENBQUMsT0FBTyxFQUFFO2FBQzNCLElBQUksQ0FBQyxDQUFPLE1BQU0sRUFBRSxFQUFFO1lBQ3JCLElBQUksTUFBTSxFQUFFO2dCQUNWLHVCQUF1QjtnQkFDdkIsSUFBSSxDQUFDLE9BQU8sR0FBRyxnQkFBZ0IsQ0FBQztnQkFDaEMsTUFBTSxJQUFJLENBQUMsUUFBUSxDQUFDLFFBQVEsRUFBRSxDQUFDO2dCQUMvQixJQUFJLENBQUMsT0FBTyxHQUFHLCtCQUErQixDQUFDO2dCQUMvQyxNQUFNLElBQUksQ0FBQyxRQUFRLENBQUMscUJBQXFCLEVBQUUsQ0FBQztnQkFDNUMsSUFBSSxDQUFDLE9BQU8sR0FBRyxxQkFBcUIsQ0FBQztnQkFDckMsTUFBTSxJQUFJLENBQUMsUUFBUSxDQUFDLG1CQUFtQixFQUFFLENBQUM7Z0JBQzFDLElBQUksQ0FBQyxNQUFNLEdBQUcsT0FBTyxDQUFDO2dCQUN0QixJQUFJLENBQUMsT0FBTyxHQUFHLDhCQUE4QixDQUFDO2FBQy9DO2lCQUFNO2dCQUNMLElBQUksQ0FBQyxNQUFNLEdBQUcsT0FBTyxDQUFDO2dCQUN0QixJQUFJLENBQUMsT0FBTyxHQUFHLHNDQUFzQyxDQUFDO2FBQ3ZEO1FBQ0gsQ0FBQyxDQUFBLENBQUM7YUFDRCxLQUFLLENBQUMsQ0FBQyxLQUEyQixFQUFFLEVBQUU7O1lBQ3JDLElBQUksQ0FBQyxNQUFNLEdBQUcsT0FBTyxDQUFDO1lBQ3RCLElBQUksQ0FBQyxPQUFPLEdBQUcsTUFBQSxLQUFLLGFBQUwsS0FBSyx1QkFBTCxLQUFLLENBQUUsT0FBTyxtQ0FBSSxzQ0FBc0MsQ0FBQztRQUMxRSxDQUFDLENBQUM7YUFDRCxPQUFPLENBQUMsR0FBRyxFQUFFO1lBQ1osSUFBSSxDQUFDLFFBQVEsR0FBRyxJQUFJLENBQUMsR0FBRyxFQUFFLEdBQUcsU0FBUyxDQUFDO1FBQ3pDLENBQUMsQ0FBQyxDQUFDO0lBQ1AsQ0FBQztDQUNGIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgRGF0YWJhc2VTdGF0dXMgfSBmcm9tICcuLi9pbnRlcmZhY2VzJztcbmltcG9ydCB7IENDRkRhdGFiYXNlIH0gZnJvbSAnLi4vY2NmLWRhdGFiYXNlJztcblxuXG5leHBvcnQgY2xhc3MgQ0NGRGF0YWJhc2VTdGF0dXNUcmFja2VyIHtcbiAgc3RhdHVzOiAnUmVhZHknIHwgJ0xvYWRpbmcnIHwgJ0Vycm9yJztcbiAgbWVzc2FnZT86IHN0cmluZztcbiAgbG9hZFRpbWU/OiBudW1iZXI7XG5cbiAgY29uc3RydWN0b3IocHVibGljIGRhdGFiYXNlOiBDQ0ZEYXRhYmFzZSkge1xuICAgIHRoaXMuY29ubmVjdCgpO1xuICB9XG5cbiAgdG9Kc29uKCk6IERhdGFiYXNlU3RhdHVzIHtcbiAgICByZXR1cm4ge1xuICAgICAgc3RhdHVzOiB0aGlzLnN0YXR1cyxcbiAgICAgIG1lc3NhZ2U6IHRoaXMubWVzc2FnZSxcbiAgICAgIGNoZWNrYmFjazogdGhpcy5zdGF0dXMgPT09ICdSZWFkeScgfHwgdGhpcy5zdGF0dXMgPT09ICdFcnJvcicgPyA2MCAqIDYwICogMTAwMCA6IDIwMDAsXG4gICAgICBsb2FkVGltZTogdGhpcy5sb2FkVGltZVxuICAgIH07XG4gIH1cblxuICBwcml2YXRlIGNvbm5lY3QoKTogUHJvbWlzZTx2b2lkPiB7XG4gICAgdGhpcy5zdGF0dXMgPSAnTG9hZGluZyc7XG4gICAgdGhpcy5tZXNzYWdlID0gJ0xvYWRpbmcgZGF0YWJhc2UnO1xuXG4gICAgY29uc3Qgc3RhcnRUaW1lID0gRGF0ZS5ub3coKTtcbiAgICByZXR1cm4gdGhpcy5kYXRhYmFzZS5jb25uZWN0KClcbiAgICAgIC50aGVuKGFzeW5jIChsb2FkZWQpID0+IHtcbiAgICAgICAgaWYgKGxvYWRlZCkge1xuICAgICAgICAgIC8vIFdhcm0gdXAgdGhlIGRhdGFiYXNlXG4gICAgICAgICAgdGhpcy5tZXNzYWdlID0gJ0J1aWxkaW5nIHNjZW5lJztcbiAgICAgICAgICBhd2FpdCB0aGlzLmRhdGFiYXNlLmdldFNjZW5lKCk7XG4gICAgICAgICAgdGhpcy5tZXNzYWdlID0gJ0J1aWxkaW5nIHRpc3N1ZSBibG9jayByZXN1bHRzJztcbiAgICAgICAgICBhd2FpdCB0aGlzLmRhdGFiYXNlLmdldFRpc3N1ZUJsb2NrUmVzdWx0cygpO1xuICAgICAgICAgIHRoaXMubWVzc2FnZSA9ICdBZ2dyZWdhdGluZyByZXN1bHRzJztcbiAgICAgICAgICBhd2FpdCB0aGlzLmRhdGFiYXNlLmdldEFnZ3JlZ2F0ZVJlc3VsdHMoKTtcbiAgICAgICAgICB0aGlzLnN0YXR1cyA9ICdSZWFkeSc7XG4gICAgICAgICAgdGhpcy5tZXNzYWdlID0gJ0RhdGFiYXNlIHN1Y2Nlc3NmdWxseSBsb2FkZWQnO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIHRoaXMuc3RhdHVzID0gJ0Vycm9yJztcbiAgICAgICAgICB0aGlzLm1lc3NhZ2UgPSAnVW5rbm93biBlcnJvciB3aGlsZSBsb2FkaW5nIGRhdGFiYXNlJztcbiAgICAgICAgfVxuICAgICAgfSlcbiAgICAgIC5jYXRjaCgoZXJyb3I6IHsgbWVzc2FnZT86IHN0cmluZyB9KSA9PiB7XG4gICAgICAgIHRoaXMuc3RhdHVzID0gJ0Vycm9yJztcbiAgICAgICAgdGhpcy5tZXNzYWdlID0gZXJyb3I/Lm1lc3NhZ2UgPz8gJ1Vua25vd24gZXJyb3Igd2hpbGUgbG9hZGluZyBkYXRhYmFzZSc7XG4gICAgICB9KVxuICAgICAgLmZpbmFsbHkoKCkgPT4ge1xuICAgICAgICB0aGlzLmxvYWRUaW1lID0gRGF0ZS5ub3coKSAtIHN0YXJ0VGltZTtcbiAgICAgIH0pO1xuICB9XG59XG4iXX0= \ No newline at end of file diff --git a/ccf-database/esm2015/lib/util/enrich-rui-locations.js b/ccf-database/esm2015/lib/util/enrich-rui-locations.js deleted file mode 100644 index 3136f4b6b..000000000 --- a/ccf-database/esm2015/lib/util/enrich-rui-locations.js +++ /dev/null @@ -1,40 +0,0 @@ -import { readQuads, DataFactory } from 'triple-store-utils'; -import { getAnatomicalStructureTreeModel } from '../queries/ontology-tree-n3'; -import { ccf, entity } from './prefixes'; -/** - * Function to add additional ccf_annotations to rui locations based on the - * reference organ it was placed relative to. - * - * @param store the triple store holding the CCF.OWL data - */ -export function enrichRuiLocations(store) { - var _a, _b, _c; - const tree = getAnatomicalStructureTreeModel(store); - const refOrganMap = new Map(); - // Build a map from reference organ to ccf annotations via representation_of and the AS partonomy - for (const { subject: organ, object: term } of readQuads(store, null, ccf.spatialEntity.representation_of, null, null)) { - const annotations = new Set([term.id]); - let parent = (_a = tree.nodes[term.id]) === null || _a === void 0 ? void 0 : _a.parent; - while (parent) { - if (annotations.has(parent)) { - break; - } - else { - annotations.add(parent); - parent = (_b = tree.nodes[parent]) === null || _b === void 0 ? void 0 : _b.parent; - } - } - refOrganMap.set(organ.id, [...annotations].map(s => DataFactory.namedNode(s))); - } - // Add AS terms for rui locations based on the reference organs they are placed relative to - for (const { object: ruiLocation } of readQuads(store, null, entity.spatialEntity, null, null)) { - for (const { subject: placement } of readQuads(store, null, ccf.spatialPlacement.source, ruiLocation, null)) { - for (const { object: organ } of readQuads(store, placement, ccf.spatialPlacement.target, null, null)) { - for (const term of (_c = refOrganMap.get(organ.id)) !== null && _c !== void 0 ? _c : []) { - store.addQuad(DataFactory.namedNode(ruiLocation.id), ccf.spatialEntity.ccf_annotations, term); - } - } - } - } -} -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZW5yaWNoLXJ1aS1sb2NhdGlvbnMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9jY2YtZGF0YWJhc2Uvc3JjL2xpYi91dGlsL2VucmljaC1ydWktbG9jYXRpb25zLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBUyxTQUFTLEVBQUUsV0FBVyxFQUFhLE1BQU0sb0JBQW9CLENBQUM7QUFDOUUsT0FBTyxFQUFFLCtCQUErQixFQUFFLE1BQU0sNkJBQTZCLENBQUM7QUFDOUUsT0FBTyxFQUFFLEdBQUcsRUFBRSxNQUFNLEVBQUUsTUFBTSxZQUFZLENBQUM7QUFHekM7Ozs7O0dBS0c7QUFDSCxNQUFNLFVBQVUsa0JBQWtCLENBQUMsS0FBWTs7SUFDN0MsTUFBTSxJQUFJLEdBQUcsK0JBQStCLENBQUMsS0FBSyxDQUFDLENBQUM7SUFDcEQsTUFBTSxXQUFXLEdBQTZCLElBQUksR0FBRyxFQUFFLENBQUM7SUFFeEQsaUdBQWlHO0lBQ2pHLEtBQUssTUFBTSxFQUFFLE9BQU8sRUFBRSxLQUFLLEVBQUUsTUFBTSxFQUFFLElBQUksRUFBRSxJQUFJLFNBQVMsQ0FBQyxLQUFLLEVBQUUsSUFBSSxFQUFFLEdBQUcsQ0FBQyxhQUFhLENBQUMsaUJBQWlCLEVBQUUsSUFBSSxFQUFFLElBQUksQ0FBQyxFQUFFO1FBQ3RILE1BQU0sV0FBVyxHQUFHLElBQUksR0FBRyxDQUFDLENBQUMsSUFBSSxDQUFDLEVBQUUsQ0FBQyxDQUFDLENBQUM7UUFDdkMsSUFBSSxNQUFNLEdBQUcsTUFBQSxJQUFJLENBQUMsS0FBSyxDQUFDLElBQUksQ0FBQyxFQUFFLENBQUMsMENBQUUsTUFBTSxDQUFDO1FBQ3pDLE9BQU8sTUFBTSxFQUFFO1lBQ2IsSUFBSSxXQUFXLENBQUMsR0FBRyxDQUFDLE1BQU0sQ0FBQyxFQUFFO2dCQUMzQixNQUFNO2FBQ1A7aUJBQU07Z0JBQ0wsV0FBVyxDQUFDLEdBQUcsQ0FBQyxNQUFNLENBQUMsQ0FBQztnQkFDeEIsTUFBTSxHQUFHLE1BQUEsSUFBSSxDQUFDLEtBQUssQ0FBQyxNQUFNLENBQUMsMENBQUUsTUFBTSxDQUFDO2FBQ3JDO1NBQ0Y7UUFDRCxXQUFXLENBQUMsR0FBRyxDQUFDLEtBQUssQ0FBQyxFQUFFLEVBQUUsQ0FBRSxHQUFHLFdBQVcsQ0FBQyxDQUFDLEdBQUcsQ0FBQyxDQUFDLENBQUMsRUFBRSxDQUFDLFdBQVcsQ0FBQyxTQUFTLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDO0tBQ2pGO0lBRUQsMkZBQTJGO0lBQzNGLEtBQUssTUFBTSxFQUFFLE1BQU0sRUFBRSxXQUFXLEVBQUUsSUFBSSxTQUFTLENBQUMsS0FBSyxFQUFFLElBQUksRUFBRSxNQUFNLENBQUMsYUFBYSxFQUFFLElBQUksRUFBRSxJQUFJLENBQUMsRUFBRTtRQUM5RixLQUFLLE1BQU0sRUFBRSxPQUFPLEVBQUUsU0FBUyxFQUFFLElBQUksU0FBUyxDQUFDLEtBQUssRUFBRSxJQUFJLEVBQUUsR0FBRyxDQUFDLGdCQUFnQixDQUFDLE1BQU0sRUFBRSxXQUFXLEVBQUUsSUFBSSxDQUFDLEVBQUU7WUFDM0csS0FBSyxNQUFNLEVBQUUsTUFBTSxFQUFFLEtBQUssRUFBRSxJQUFJLFNBQVMsQ0FBQyxLQUFLLEVBQUUsU0FBUyxFQUFFLEdBQUcsQ0FBQyxnQkFBZ0IsQ0FBQyxNQUFNLEVBQUUsSUFBSSxFQUFFLElBQUksQ0FBQyxFQUFFO2dCQUNwRyxLQUFLLE1BQU0sSUFBSSxJQUFJLE1BQUEsV0FBVyxDQUFDLEdBQUcsQ0FBQyxLQUFLLENBQUMsRUFBRSxDQUFDLG1DQUFJLEVBQUUsRUFBRTtvQkFDbEQsS0FBSyxDQUFDLE9BQU8sQ0FBQyxXQUFXLENBQUMsU0FBUyxDQUFDLFdBQVcsQ0FBQyxFQUFFLENBQUMsRUFBRSxHQUFHLENBQUMsYUFBYSxDQUFDLGVBQWUsRUFBRSxJQUFJLENBQUMsQ0FBQztpQkFDL0Y7YUFDRjtTQUNGO0tBQ0Y7QUFDSCxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgU3RvcmUsIHJlYWRRdWFkcywgRGF0YUZhY3RvcnksIE5hbWVkTm9kZSB9IGZyb20gJ3RyaXBsZS1zdG9yZS11dGlscyc7XG5pbXBvcnQgeyBnZXRBbmF0b21pY2FsU3RydWN0dXJlVHJlZU1vZGVsIH0gZnJvbSAnLi4vcXVlcmllcy9vbnRvbG9neS10cmVlLW4zJztcbmltcG9ydCB7IGNjZiwgZW50aXR5IH0gZnJvbSAnLi9wcmVmaXhlcyc7XG5cblxuLyoqXG4gKiBGdW5jdGlvbiB0byBhZGQgYWRkaXRpb25hbCBjY2ZfYW5ub3RhdGlvbnMgdG8gcnVpIGxvY2F0aW9ucyBiYXNlZCBvbiB0aGVcbiAqIHJlZmVyZW5jZSBvcmdhbiBpdCB3YXMgcGxhY2VkIHJlbGF0aXZlIHRvLlxuICpcbiAqIEBwYXJhbSBzdG9yZSB0aGUgdHJpcGxlIHN0b3JlIGhvbGRpbmcgdGhlIENDRi5PV0wgZGF0YVxuICovXG5leHBvcnQgZnVuY3Rpb24gZW5yaWNoUnVpTG9jYXRpb25zKHN0b3JlOiBTdG9yZSk6IHZvaWQge1xuICBjb25zdCB0cmVlID0gZ2V0QW5hdG9taWNhbFN0cnVjdHVyZVRyZWVNb2RlbChzdG9yZSk7XG4gIGNvbnN0IHJlZk9yZ2FuTWFwOiBNYXA8c3RyaW5nLCBOYW1lZE5vZGVbXT4gPSBuZXcgTWFwKCk7XG5cbiAgLy8gQnVpbGQgYSBtYXAgZnJvbSByZWZlcmVuY2Ugb3JnYW4gdG8gY2NmIGFubm90YXRpb25zIHZpYSByZXByZXNlbnRhdGlvbl9vZiBhbmQgdGhlIEFTIHBhcnRvbm9teVxuICBmb3IgKGNvbnN0IHsgc3ViamVjdDogb3JnYW4sIG9iamVjdDogdGVybSB9IG9mIHJlYWRRdWFkcyhzdG9yZSwgbnVsbCwgY2NmLnNwYXRpYWxFbnRpdHkucmVwcmVzZW50YXRpb25fb2YsIG51bGwsIG51bGwpKSB7XG4gICAgY29uc3QgYW5ub3RhdGlvbnMgPSBuZXcgU2V0KFt0ZXJtLmlkXSk7XG4gICAgbGV0IHBhcmVudCA9IHRyZWUubm9kZXNbdGVybS5pZF0/LnBhcmVudDtcbiAgICB3aGlsZSAocGFyZW50KSB7XG4gICAgICBpZiAoYW5ub3RhdGlvbnMuaGFzKHBhcmVudCkpIHtcbiAgICAgICAgYnJlYWs7XG4gICAgICB9IGVsc2Uge1xuICAgICAgICBhbm5vdGF0aW9ucy5hZGQocGFyZW50KTtcbiAgICAgICAgcGFyZW50ID0gdHJlZS5ub2Rlc1twYXJlbnRdPy5wYXJlbnQ7XG4gICAgICB9XG4gICAgfVxuICAgIHJlZk9yZ2FuTWFwLnNldChvcmdhbi5pZCwgWyAuLi5hbm5vdGF0aW9uc10ubWFwKHMgPT4gRGF0YUZhY3RvcnkubmFtZWROb2RlKHMpKSk7XG4gIH1cblxuICAvLyBBZGQgQVMgdGVybXMgZm9yIHJ1aSBsb2NhdGlvbnMgYmFzZWQgb24gdGhlIHJlZmVyZW5jZSBvcmdhbnMgdGhleSBhcmUgcGxhY2VkIHJlbGF0aXZlIHRvXG4gIGZvciAoY29uc3QgeyBvYmplY3Q6IHJ1aUxvY2F0aW9uIH0gb2YgcmVhZFF1YWRzKHN0b3JlLCBudWxsLCBlbnRpdHkuc3BhdGlhbEVudGl0eSwgbnVsbCwgbnVsbCkpIHtcbiAgICBmb3IgKGNvbnN0IHsgc3ViamVjdDogcGxhY2VtZW50IH0gb2YgcmVhZFF1YWRzKHN0b3JlLCBudWxsLCBjY2Yuc3BhdGlhbFBsYWNlbWVudC5zb3VyY2UsIHJ1aUxvY2F0aW9uLCBudWxsKSkge1xuICAgICAgZm9yIChjb25zdCB7IG9iamVjdDogb3JnYW4gfSBvZiByZWFkUXVhZHMoc3RvcmUsIHBsYWNlbWVudCwgY2NmLnNwYXRpYWxQbGFjZW1lbnQudGFyZ2V0LCBudWxsLCBudWxsKSkge1xuICAgICAgICBmb3IgKGNvbnN0IHRlcm0gb2YgcmVmT3JnYW5NYXAuZ2V0KG9yZ2FuLmlkKSA/PyBbXSkge1xuICAgICAgICAgIHN0b3JlLmFkZFF1YWQoRGF0YUZhY3RvcnkubmFtZWROb2RlKHJ1aUxvY2F0aW9uLmlkKSwgY2NmLnNwYXRpYWxFbnRpdHkuY2NmX2Fubm90YXRpb25zLCB0ZXJtKTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgIH1cbiAgfVxufVxuIl19 \ No newline at end of file diff --git a/ccf-database/esm2015/lib/util/n3-functions.js b/ccf-database/esm2015/lib/util/n3-functions.js deleted file mode 100644 index f0c2f96b8..000000000 --- a/ccf-database/esm2015/lib/util/n3-functions.js +++ /dev/null @@ -1,38 +0,0 @@ -import { fromRdf } from 'rdf-literal'; -import { readQuads } from 'triple-store-utils'; -/** - * Iterates over the key/value pairs for an IRI, using the specified mapping with quads from the store. - * - * @param store The triple store. - * @param iri The data identifier. - * @param mapping Property mappings. - * @returns an iterator over the key/value pairs - */ -export function* getEntries(store, iri, mapping) { - for (const [predicate, key] of Object.entries(mapping)) { - for (const quad of readQuads(store, iri, predicate, null, null)) { - const value = quad.object.termType === 'Literal' ? fromRdf(quad.object) : quad.object.id; - yield [key, value]; - } - } -} -/** - * Creates an object of the specified type using quads from the store. - * - * @param store The triple store. - * @param iri The data identifier. - * @param type Type name. - * @param mapping Property mappings. - * @returns A new data object. - */ -export function getMappedResult(store, iri, type, mapping) { - const result = { '@id': iri, '@type': type }; - for (const [predicate, key] of Object.entries(mapping)) { - for (const quad of readQuads(store, result['@id'], predicate, null, null)) { - const value = quad.object.termType === 'Literal' ? fromRdf(quad.object) : quad.object.id; - result[key] = value; - } - } - return result; -} -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibjMtZnVuY3Rpb25zLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvY2NmLWRhdGFiYXNlL3NyYy9saWIvdXRpbC9uMy1mdW5jdGlvbnMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLE9BQU8sRUFBRSxNQUFNLGFBQWEsQ0FBQztBQUN0QyxPQUFPLEVBQVMsU0FBUyxFQUFFLE1BQU0sb0JBQW9CLENBQUM7QUFHdEQ7Ozs7Ozs7R0FPRztBQUNILE1BQU0sU0FBUyxDQUFDLENBQUMsVUFBVSxDQUFDLEtBQVksRUFBRSxHQUFXLEVBQUUsT0FBa0M7SUFDdkYsS0FBSyxNQUFNLENBQUMsU0FBUyxFQUFFLEdBQUcsQ0FBQyxJQUFJLE1BQU0sQ0FBQyxPQUFPLENBQUMsT0FBTyxDQUFDLEVBQUU7UUFDdEQsS0FBSyxNQUFNLElBQUksSUFBSSxTQUFTLENBQUMsS0FBSyxFQUFFLEdBQUcsRUFBRSxTQUFTLEVBQUUsSUFBSSxFQUFFLElBQUksQ0FBQyxFQUFFO1lBQy9ELE1BQU0sS0FBSyxHQUFHLElBQUksQ0FBQyxNQUFNLENBQUMsUUFBUSxLQUFLLFNBQVMsQ0FBQyxDQUFDLENBQUMsT0FBTyxDQUFDLElBQUksQ0FBQyxNQUFNLENBQUMsQ0FBQyxDQUFDLENBQUMsSUFBSSxDQUFDLE1BQU0sQ0FBQyxFQUFFLENBQUM7WUFDekYsTUFBTSxDQUFDLEdBQUcsRUFBRSxLQUFLLENBQUMsQ0FBQztTQUNwQjtLQUNGO0FBQ0gsQ0FBQztBQUVEOzs7Ozs7OztHQVFHO0FBQ0gsTUFBTSxVQUFVLGVBQWUsQ0FBYyxLQUFZLEVBQUUsR0FBVyxFQUFFLElBQVksRUFBRSxPQUFrQztJQUN0SCxNQUFNLE1BQU0sR0FBRyxFQUFFLEtBQUssRUFBRSxHQUFHLEVBQUUsT0FBTyxFQUFFLElBQUksRUFBRSxDQUFDO0lBQzdDLEtBQUssTUFBTSxDQUFDLFNBQVMsRUFBRSxHQUFHLENBQUMsSUFBSSxNQUFNLENBQUMsT0FBTyxDQUFDLE9BQU8sQ0FBQyxFQUFFO1FBQ3RELEtBQUssTUFBTSxJQUFJLElBQUksU0FBUyxDQUFDLEtBQUssRUFBRSxNQUFNLENBQUMsS0FBSyxDQUFDLEVBQUUsU0FBUyxFQUFFLElBQUksRUFBRSxJQUFJLENBQUMsRUFBRTtZQUN6RSxNQUFNLEtBQUssR0FBRyxJQUFJLENBQUMsTUFBTSxDQUFDLFFBQVEsS0FBSyxTQUFTLENBQUMsQ0FBQyxDQUFDLE9BQU8sQ0FBQyxJQUFJLENBQUMsTUFBTSxDQUFDLENBQUMsQ0FBQyxDQUFDLElBQUksQ0FBQyxNQUFNLENBQUMsRUFBRSxDQUFDO1lBQ3pGLE1BQU0sQ0FBQyxHQUFHLENBQUMsR0FBRyxLQUFLLENBQUM7U0FDckI7S0FDRjtJQUNELE9BQU8sTUFBc0IsQ0FBQztBQUNoQyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgZnJvbVJkZiB9IGZyb20gJ3JkZi1saXRlcmFsJztcbmltcG9ydCB7IFN0b3JlLCByZWFkUXVhZHMgfSBmcm9tICd0cmlwbGUtc3RvcmUtdXRpbHMnO1xuXG5cbi8qKlxuICogSXRlcmF0ZXMgb3ZlciB0aGUga2V5L3ZhbHVlIHBhaXJzIGZvciBhbiBJUkksIHVzaW5nIHRoZSBzcGVjaWZpZWQgbWFwcGluZyB3aXRoIHF1YWRzIGZyb20gdGhlIHN0b3JlLlxuICpcbiAqIEBwYXJhbSBzdG9yZSBUaGUgdHJpcGxlIHN0b3JlLlxuICogQHBhcmFtIGlyaSBUaGUgZGF0YSBpZGVudGlmaWVyLlxuICogQHBhcmFtIG1hcHBpbmcgUHJvcGVydHkgbWFwcGluZ3MuXG4gKiBAcmV0dXJucyBhbiBpdGVyYXRvciBvdmVyIHRoZSBrZXkvdmFsdWUgcGFpcnNcbiAqL1xuZXhwb3J0IGZ1bmN0aW9uKiBnZXRFbnRyaWVzKHN0b3JlOiBTdG9yZSwgaXJpOiBzdHJpbmcsIG1hcHBpbmc6IHsgW2lyaTogc3RyaW5nXTogc3RyaW5nIH0pOiBHZW5lcmF0b3I8WyBzdHJpbmcsIHN0cmluZ3xudW1iZXIgXT4ge1xuICBmb3IgKGNvbnN0IFtwcmVkaWNhdGUsIGtleV0gb2YgT2JqZWN0LmVudHJpZXMobWFwcGluZykpIHtcbiAgICBmb3IgKGNvbnN0IHF1YWQgb2YgcmVhZFF1YWRzKHN0b3JlLCBpcmksIHByZWRpY2F0ZSwgbnVsbCwgbnVsbCkpIHtcbiAgICAgIGNvbnN0IHZhbHVlID0gcXVhZC5vYmplY3QudGVybVR5cGUgPT09ICdMaXRlcmFsJyA/IGZyb21SZGYocXVhZC5vYmplY3QpIDogcXVhZC5vYmplY3QuaWQ7XG4gICAgICB5aWVsZCBba2V5LCB2YWx1ZV07XG4gICAgfVxuICB9XG59XG5cbi8qKlxuICogQ3JlYXRlcyBhbiBvYmplY3Qgb2YgdGhlIHNwZWNpZmllZCB0eXBlIHVzaW5nIHF1YWRzIGZyb20gdGhlIHN0b3JlLlxuICpcbiAqIEBwYXJhbSBzdG9yZSBUaGUgdHJpcGxlIHN0b3JlLlxuICogQHBhcmFtIGlyaSBUaGUgZGF0YSBpZGVudGlmaWVyLlxuICogQHBhcmFtIHR5cGUgVHlwZSBuYW1lLlxuICogQHBhcmFtIG1hcHBpbmcgUHJvcGVydHkgbWFwcGluZ3MuXG4gKiBAcmV0dXJucyBBIG5ldyBkYXRhIG9iamVjdC5cbiAqL1xuZXhwb3J0IGZ1bmN0aW9uIGdldE1hcHBlZFJlc3VsdDxUID0gdW5rbm93bj4oc3RvcmU6IFN0b3JlLCBpcmk6IHN0cmluZywgdHlwZTogc3RyaW5nLCBtYXBwaW5nOiB7IFtpcmk6IHN0cmluZ106IHN0cmluZyB9KTogVCB7XG4gIGNvbnN0IHJlc3VsdCA9IHsgJ0BpZCc6IGlyaSwgJ0B0eXBlJzogdHlwZSB9O1xuICBmb3IgKGNvbnN0IFtwcmVkaWNhdGUsIGtleV0gb2YgT2JqZWN0LmVudHJpZXMobWFwcGluZykpIHtcbiAgICBmb3IgKGNvbnN0IHF1YWQgb2YgcmVhZFF1YWRzKHN0b3JlLCByZXN1bHRbJ0BpZCddLCBwcmVkaWNhdGUsIG51bGwsIG51bGwpKSB7XG4gICAgICBjb25zdCB2YWx1ZSA9IHF1YWQub2JqZWN0LnRlcm1UeXBlID09PSAnTGl0ZXJhbCcgPyBmcm9tUmRmKHF1YWQub2JqZWN0KSA6IHF1YWQub2JqZWN0LmlkO1xuICAgICAgcmVzdWx0W2tleV0gPSB2YWx1ZTtcbiAgICB9XG4gIH1cbiAgcmV0dXJuIHJlc3VsdCBhcyB1bmtub3duIGFzIFQ7XG59XG4iXX0= \ No newline at end of file diff --git a/ccf-database/esm2015/lib/util/origin-scene.js b/ccf-database/esm2015/lib/util/origin-scene.js deleted file mode 100644 index 99b795288..000000000 --- a/ccf-database/esm2015/lib/util/origin-scene.js +++ /dev/null @@ -1,151 +0,0 @@ -import { Matrix4, toRadians } from '@math.gl/core'; -const gray = [204, 204, 204, 255]; -const red = [213, 0, 0, 255]; -const green = [29, 204, 101, 255]; -const blue = [41, 121, 255, 255]; -/** - * Create a set of scene nodes for the body-ui to show the origin and lines extending to it's dimensions. - * @param node the Spatial Entity (usually a reference organ) that the origin is defined by - * @param includeLetters whether to show the keyboard letters associated with the origin points - * @returns a set of scene nodes for the body-ui - */ -export function getOriginScene(node, includeLetters = false) { - const sceneWidth = node.x_dimension / 1000; - const sceneHeight = node.y_dimension / 1000; - const sceneDepth = node.z_dimension / 1000; - const originRadius = Math.max(sceneWidth, sceneHeight, sceneDepth) * 0.05; - const lineRadius = originRadius * 0.1; - return [ - // Origin Sphere - { - '@id': 'http://purl.org/ccf/latest/ccf.owl#OriginSphere', - '@type': 'SpatialSceneNode', - unpickable: true, - geometry: 'sphere', - transformMatrix: new Matrix4(Matrix4.IDENTITY).scale(originRadius), - color: gray - }, - // Origin X Axis - { - '@id': 'http://purl.org/ccf/latest/ccf.owl#OriginX', - '@type': 'SpatialSceneNode', - unpickable: true, - geometry: 'cylinder', - transformMatrix: new Matrix4(Matrix4.IDENTITY) - .translate([sceneWidth / 2, 0, 0]) - .rotateZ(toRadians(-90)) - .scale([lineRadius, sceneWidth, lineRadius]), - color: red - }, - { - '@id': 'http://purl.org/ccf/latest/ccf.owl#OriginXCone', - '@type': 'SpatialSceneNode', - unpickable: true, - geometry: 'cone', - transformMatrix: new Matrix4(Matrix4.IDENTITY) - .translate([sceneWidth, 0, 0]) - .rotateZ(toRadians(-90)) - .scale([originRadius, originRadius * 3, originRadius]), - color: red - }, - { - '@id': 'http://purl.org/ccf/latest/ccf.owl#OriginXALabel', - '@type': 'SpatialSceneNode', - unpickable: true, - geometry: 'text', - text: 'A', - transformMatrix: new Matrix4(Matrix4.IDENTITY).translate([-originRadius * 2, 0, 0]).scale(originRadius), - color: red - }, - { - '@id': 'http://purl.org/ccf/latest/ccf.owl#OriginXDLabel', - '@type': 'SpatialSceneNode', - unpickable: true, - geometry: 'text', - text: 'D', - transformMatrix: new Matrix4(Matrix4.IDENTITY).translate([sceneWidth + originRadius * 2, 0, 0]).scale(originRadius), - color: red - }, - // Origin Y Axis - { - '@id': 'http://purl.org/ccf/latest/ccf.owl#OriginY', - '@type': 'SpatialSceneNode', - unpickable: true, - geometry: 'cylinder', - transformMatrix: new Matrix4(Matrix4.IDENTITY) - .translate([0, sceneHeight / 2, 0]) - .scale([lineRadius, sceneHeight, lineRadius]), - color: green - }, - { - '@id': 'http://purl.org/ccf/latest/ccf.owl#OriginYCone', - '@type': 'SpatialSceneNode', - unpickable: true, - geometry: 'cone', - transformMatrix: new Matrix4(Matrix4.IDENTITY) - .translate([0, sceneHeight, 0]) - .scale([originRadius, originRadius * 3, originRadius]), - color: green - }, - { - '@id': 'http://purl.org/ccf/latest/ccf.owl#OriginYSLabel', - '@type': 'SpatialSceneNode', - unpickable: true, - geometry: 'text', - text: 'S', - transformMatrix: new Matrix4(Matrix4.IDENTITY).translate([originRadius * 1.5, originRadius * 1.5, 0]).scale(originRadius), - color: green - }, - { - '@id': 'http://purl.org/ccf/latest/ccf.owl#OriginYWLabel', - '@type': 'SpatialSceneNode', - unpickable: true, - geometry: 'text', - text: 'W', - transformMatrix: new Matrix4(Matrix4.IDENTITY).translate([0, sceneHeight + originRadius * 2, 0]).scale(originRadius), - color: green - }, - // Origin Z Axis - { - '@id': 'http://purl.org/ccf/latest/ccf.owl#OriginZ', - '@type': 'SpatialSceneNode', - unpickable: true, - geometry: 'cylinder', - transformMatrix: new Matrix4(Matrix4.IDENTITY) - .translate([0, 0, sceneDepth / 2]) - .rotateX(toRadians(90)) - .scale([lineRadius, sceneDepth, lineRadius]), - color: blue - }, - { - '@id': 'http://purl.org/ccf/latest/ccf.owl#OriginZCone', - '@type': 'SpatialSceneNode', - unpickable: true, - geometry: 'cone', - transformMatrix: new Matrix4(Matrix4.IDENTITY) - .translate([0, 0, sceneDepth]) - .rotateX(toRadians(90)) - .scale([originRadius, originRadius * 3, originRadius]), - color: blue - }, - { - '@id': 'http://purl.org/ccf/latest/ccf.owl#OriginZQLabel', - '@type': 'SpatialSceneNode', - unpickable: true, - geometry: 'text', - text: 'Q', - transformMatrix: new Matrix4(Matrix4.IDENTITY).translate([originRadius * 1.5, -originRadius * 1.5, 0]).scale(originRadius), - color: blue - }, - { - '@id': 'http://purl.org/ccf/latest/ccf.owl#OriginZELabel', - '@type': 'SpatialSceneNode', - unpickable: true, - geometry: 'text', - text: 'E', - transformMatrix: new Matrix4(Matrix4.IDENTITY).translate([0, 0, sceneDepth + originRadius * 2]).scale(originRadius), - color: blue - } - ].filter(n => (includeLetters && n.geometry === 'text' && n.text) || !n.text); -} -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib3JpZ2luLXNjZW5lLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvY2NmLWRhdGFiYXNlL3NyYy9saWIvdXRpbC9vcmlnaW4tc2NlbmUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLE9BQU8sRUFBRSxTQUFTLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFNbkQsTUFBTSxJQUFJLEdBQVUsQ0FBQyxHQUFHLEVBQUUsR0FBRyxFQUFFLEdBQUcsRUFBRSxHQUFHLENBQUMsQ0FBQztBQUN6QyxNQUFNLEdBQUcsR0FBVSxDQUFDLEdBQUcsRUFBRSxDQUFDLEVBQUUsQ0FBQyxFQUFFLEdBQUcsQ0FBQyxDQUFDO0FBQ3BDLE1BQU0sS0FBSyxHQUFVLENBQUMsRUFBRSxFQUFFLEdBQUcsRUFBRSxHQUFHLEVBQUUsR0FBRyxDQUFDLENBQUM7QUFDekMsTUFBTSxJQUFJLEdBQVUsQ0FBQyxFQUFFLEVBQUUsR0FBRyxFQUFFLEdBQUcsRUFBRSxHQUFHLENBQUMsQ0FBQztBQUV4Qzs7Ozs7R0FLRztBQUNILE1BQU0sVUFBVSxjQUFjLENBQUMsSUFBbUIsRUFBRSxjQUFjLEdBQUcsS0FBSztJQUN4RSxNQUFNLFVBQVUsR0FBRyxJQUFJLENBQUMsV0FBVyxHQUFHLElBQUksQ0FBQztJQUMzQyxNQUFNLFdBQVcsR0FBRyxJQUFJLENBQUMsV0FBVyxHQUFHLElBQUksQ0FBQztJQUM1QyxNQUFNLFVBQVUsR0FBRyxJQUFJLENBQUMsV0FBVyxHQUFHLElBQUksQ0FBQztJQUMzQyxNQUFNLFlBQVksR0FBRyxJQUFJLENBQUMsR0FBRyxDQUFDLFVBQVUsRUFBRSxXQUFXLEVBQUUsVUFBVSxDQUFDLEdBQUcsSUFBSSxDQUFDO0lBQzFFLE1BQU0sVUFBVSxHQUFHLFlBQVksR0FBRyxHQUFHLENBQUM7SUFFdEMsT0FBTztRQUNMLGdCQUFnQjtRQUNoQjtZQUNFLEtBQUssRUFBRSxpREFBaUQ7WUFDeEQsT0FBTyxFQUFFLGtCQUFrQjtZQUMzQixVQUFVLEVBQUUsSUFBSTtZQUNoQixRQUFRLEVBQUUsUUFBUTtZQUNsQixlQUFlLEVBQUUsSUFBSSxPQUFPLENBQUMsT0FBTyxDQUFDLFFBQVEsQ0FBQyxDQUFDLEtBQUssQ0FBQyxZQUFZLENBQUM7WUFDbEUsS0FBSyxFQUFFLElBQUk7U0FDWjtRQUNELGdCQUFnQjtRQUNoQjtZQUNFLEtBQUssRUFBRSw0Q0FBNEM7WUFDbkQsT0FBTyxFQUFFLGtCQUFrQjtZQUMzQixVQUFVLEVBQUUsSUFBSTtZQUNoQixRQUFRLEVBQUUsVUFBVTtZQUNwQixlQUFlLEVBQUUsSUFBSSxPQUFPLENBQUMsT0FBTyxDQUFDLFFBQVEsQ0FBQztpQkFDM0MsU0FBUyxDQUFDLENBQUMsVUFBVSxHQUFHLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxDQUFDLENBQUM7aUJBQ2pDLE9BQU8sQ0FBQyxTQUFTLENBQUMsQ0FBQyxFQUFFLENBQUMsQ0FBQztpQkFDdkIsS0FBSyxDQUFDLENBQUMsVUFBVSxFQUFFLFVBQVUsRUFBRSxVQUFVLENBQUMsQ0FBQztZQUM5QyxLQUFLLEVBQUUsR0FBRztTQUNYO1FBQ0Q7WUFDRSxLQUFLLEVBQUUsZ0RBQWdEO1lBQ3ZELE9BQU8sRUFBRSxrQkFBa0I7WUFDM0IsVUFBVSxFQUFFLElBQUk7WUFDaEIsUUFBUSxFQUFFLE1BQU07WUFDaEIsZUFBZSxFQUFFLElBQUksT0FBTyxDQUFDLE9BQU8sQ0FBQyxRQUFRLENBQUM7aUJBQzNDLFNBQVMsQ0FBQyxDQUFDLFVBQVUsRUFBRSxDQUFDLEVBQUUsQ0FBQyxDQUFDLENBQUM7aUJBQzdCLE9BQU8sQ0FBQyxTQUFTLENBQUMsQ0FBQyxFQUFFLENBQUMsQ0FBQztpQkFDdkIsS0FBSyxDQUFDLENBQUUsWUFBWSxFQUFFLFlBQVksR0FBRyxDQUFDLEVBQUUsWUFBWSxDQUFFLENBQUM7WUFDMUQsS0FBSyxFQUFFLEdBQUc7U0FDWDtRQUNEO1lBQ0UsS0FBSyxFQUFFLGtEQUFrRDtZQUN6RCxPQUFPLEVBQUUsa0JBQWtCO1lBQzNCLFVBQVUsRUFBRSxJQUFJO1lBQ2hCLFFBQVEsRUFBRSxNQUFNO1lBQ2hCLElBQUksRUFBRSxHQUFHO1lBQ1QsZUFBZSxFQUFFLElBQUksT0FBTyxDQUFDLE9BQU8sQ0FBQyxRQUFRLENBQUMsQ0FBQyxTQUFTLENBQUMsQ0FBQyxDQUFDLFlBQVksR0FBRyxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsQ0FBQyxDQUFDLENBQUMsS0FBSyxDQUFDLFlBQVksQ0FBQztZQUN2RyxLQUFLLEVBQUUsR0FBRztTQUNYO1FBQ0Q7WUFDRSxLQUFLLEVBQUUsa0RBQWtEO1lBQ3pELE9BQU8sRUFBRSxrQkFBa0I7WUFDM0IsVUFBVSxFQUFFLElBQUk7WUFDaEIsUUFBUSxFQUFFLE1BQU07WUFDaEIsSUFBSSxFQUFFLEdBQUc7WUFDVCxlQUFlLEVBQUUsSUFBSSxPQUFPLENBQUMsT0FBTyxDQUFDLFFBQVEsQ0FBQyxDQUFDLFNBQVMsQ0FBQyxDQUFDLFVBQVUsR0FBRyxZQUFZLEdBQUcsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLENBQUMsQ0FBQyxDQUFDLEtBQUssQ0FBQyxZQUFZLENBQUM7WUFDbkgsS0FBSyxFQUFFLEdBQUc7U0FDWDtRQUNELGdCQUFnQjtRQUNoQjtZQUNFLEtBQUssRUFBRSw0Q0FBNEM7WUFDbkQsT0FBTyxFQUFFLGtCQUFrQjtZQUMzQixVQUFVLEVBQUUsSUFBSTtZQUNoQixRQUFRLEVBQUUsVUFBVTtZQUNwQixlQUFlLEVBQUUsSUFBSSxPQUFPLENBQUMsT0FBTyxDQUFDLFFBQVEsQ0FBQztpQkFDM0MsU0FBUyxDQUFDLENBQUMsQ0FBQyxFQUFFLFdBQVcsR0FBRyxDQUFDLEVBQUUsQ0FBQyxDQUFDLENBQUM7aUJBQ2xDLEtBQUssQ0FBQyxDQUFDLFVBQVUsRUFBRSxXQUFXLEVBQUUsVUFBVSxDQUFDLENBQUM7WUFDL0MsS0FBSyxFQUFFLEtBQUs7U0FDYjtRQUNEO1lBQ0UsS0FBSyxFQUFFLGdEQUFnRDtZQUN2RCxPQUFPLEVBQUUsa0JBQWtCO1lBQzNCLFVBQVUsRUFBRSxJQUFJO1lBQ2hCLFFBQVEsRUFBRSxNQUFNO1lBQ2hCLGVBQWUsRUFBRSxJQUFJLE9BQU8sQ0FBQyxPQUFPLENBQUMsUUFBUSxDQUFDO2lCQUMzQyxTQUFTLENBQUMsQ0FBQyxDQUFDLEVBQUUsV0FBVyxFQUFFLENBQUMsQ0FBQyxDQUFDO2lCQUM5QixLQUFLLENBQUMsQ0FBRSxZQUFZLEVBQUUsWUFBWSxHQUFHLENBQUMsRUFBRSxZQUFZLENBQUUsQ0FBQztZQUMxRCxLQUFLLEVBQUUsS0FBSztTQUNiO1FBQ0Q7WUFDRSxLQUFLLEVBQUUsa0RBQWtEO1lBQ3pELE9BQU8sRUFBRSxrQkFBa0I7WUFDM0IsVUFBVSxFQUFFLElBQUk7WUFDaEIsUUFBUSxFQUFFLE1BQU07WUFDaEIsSUFBSSxFQUFFLEdBQUc7WUFDVCxlQUFlLEVBQUUsSUFBSSxPQUFPLENBQUMsT0FBTyxDQUFDLFFBQVEsQ0FBQyxDQUFDLFNBQVMsQ0FBQyxDQUFDLFlBQVksR0FBRyxHQUFHLEVBQUUsWUFBWSxHQUFHLEdBQUcsRUFBRSxDQUFDLENBQUMsQ0FBQyxDQUFDLEtBQUssQ0FBQyxZQUFZLENBQUM7WUFDekgsS0FBSyxFQUFFLEtBQUs7U0FDYjtRQUNEO1lBQ0UsS0FBSyxFQUFFLGtEQUFrRDtZQUN6RCxPQUFPLEVBQUUsa0JBQWtCO1lBQzNCLFVBQVUsRUFBRSxJQUFJO1lBQ2hCLFFBQVEsRUFBRSxNQUFNO1lBQ2hCLElBQUksRUFBRSxHQUFHO1lBQ1QsZUFBZSxFQUFFLElBQUksT0FBTyxDQUFDLE9BQU8sQ0FBQyxRQUFRLENBQUMsQ0FBQyxTQUFTLENBQUMsQ0FBQyxDQUFDLEVBQUUsV0FBVyxHQUFHLFlBQVksR0FBRyxDQUFDLEVBQUUsQ0FBQyxDQUFDLENBQUMsQ0FBQyxLQUFLLENBQUMsWUFBWSxDQUFDO1lBQ3BILEtBQUssRUFBRSxLQUFLO1NBQ2I7UUFDRCxnQkFBZ0I7UUFDaEI7WUFDRSxLQUFLLEVBQUUsNENBQTRDO1lBQ25ELE9BQU8sRUFBRSxrQkFBa0I7WUFDM0IsVUFBVSxFQUFFLElBQUk7WUFDaEIsUUFBUSxFQUFFLFVBQVU7WUFDcEIsZUFBZSxFQUFFLElBQUksT0FBTyxDQUFDLE9BQU8sQ0FBQyxRQUFRLENBQUM7aUJBQzNDLFNBQVMsQ0FBQyxDQUFDLENBQUMsRUFBRSxDQUFDLEVBQUUsVUFBVSxHQUFHLENBQUMsQ0FBQyxDQUFDO2lCQUNqQyxPQUFPLENBQUMsU0FBUyxDQUFDLEVBQUUsQ0FBQyxDQUFDO2lCQUN0QixLQUFLLENBQUMsQ0FBQyxVQUFVLEVBQUUsVUFBVSxFQUFFLFVBQVUsQ0FBQyxDQUFDO1lBQzlDLEtBQUssRUFBRSxJQUFJO1NBQ1o7UUFDRDtZQUNFLEtBQUssRUFBRSxnREFBZ0Q7WUFDdkQsT0FBTyxFQUFFLGtCQUFrQjtZQUMzQixVQUFVLEVBQUUsSUFBSTtZQUNoQixRQUFRLEVBQUUsTUFBTTtZQUNoQixlQUFlLEVBQUUsSUFBSSxPQUFPLENBQUMsT0FBTyxDQUFDLFFBQVEsQ0FBQztpQkFDM0MsU0FBUyxDQUFDLENBQUMsQ0FBQyxFQUFFLENBQUMsRUFBRSxVQUFVLENBQUMsQ0FBQztpQkFDN0IsT0FBTyxDQUFDLFNBQVMsQ0FBQyxFQUFFLENBQUMsQ0FBQztpQkFDdEIsS0FBSyxDQUFDLENBQUUsWUFBWSxFQUFFLFlBQVksR0FBRyxDQUFDLEVBQUUsWUFBWSxDQUFFLENBQUM7WUFDMUQsS0FBSyxFQUFFLElBQUk7U0FDWjtRQUNEO1lBQ0UsS0FBSyxFQUFFLGtEQUFrRDtZQUN6RCxPQUFPLEVBQUUsa0JBQWtCO1lBQzNCLFVBQVUsRUFBRSxJQUFJO1lBQ2hCLFFBQVEsRUFBRSxNQUFNO1lBQ2hCLElBQUksRUFBRSxHQUFHO1lBQ1QsZUFBZSxFQUFFLElBQUksT0FBTyxDQUFDLE9BQU8sQ0FBQyxRQUFRLENBQUMsQ0FBQyxTQUFTLENBQUMsQ0FBQyxZQUFZLEdBQUcsR0FBRyxFQUFFLENBQUUsWUFBWSxHQUFHLEdBQUcsRUFBRSxDQUFDLENBQUMsQ0FBQyxDQUFDLEtBQUssQ0FBQyxZQUFZLENBQUM7WUFDM0gsS0FBSyxFQUFFLElBQUk7U0FDWjtRQUNEO1lBQ0UsS0FBSyxFQUFFLGtEQUFrRDtZQUN6RCxPQUFPLEVBQUUsa0JBQWtCO1lBQzNCLFVBQVUsRUFBRSxJQUFJO1lBQ2hCLFFBQVEsRUFBRSxNQUFNO1lBQ2hCLElBQUksRUFBRSxHQUFHO1lBQ1QsZUFBZSxFQUFFLElBQUksT0FBTyxDQUFDLE9BQU8sQ0FBQyxRQUFRLENBQUMsQ0FBQyxTQUFTLENBQUMsQ0FBQyxDQUFDLEVBQUUsQ0FBQyxFQUFFLFVBQVUsR0FBRyxZQUFZLEdBQUcsQ0FBQyxDQUFDLENBQUMsQ0FBQyxLQUFLLENBQUMsWUFBWSxDQUFDO1lBQ25ILEtBQUssRUFBRSxJQUFJO1NBQ1o7S0FDRixDQUFDLE1BQU0sQ0FBQyxDQUFDLENBQUMsRUFBRSxDQUFDLENBQUMsY0FBYyxJQUFJLENBQUMsQ0FBQyxRQUFRLEtBQUssTUFBTSxJQUFJLENBQUMsQ0FBQyxJQUFJLENBQUMsSUFBSSxDQUFDLENBQUMsQ0FBQyxJQUFJLENBQXVCLENBQUM7QUFDdEcsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IE1hdHJpeDQsIHRvUmFkaWFucyB9IGZyb20gJ0BtYXRoLmdsL2NvcmUnO1xuaW1wb3J0IHsgU3BhdGlhbFNjZW5lTm9kZSB9IGZyb20gJy4uL2NjZi1zcGF0aWFsLXNjZW5lJztcbmltcG9ydCB7IFNwYXRpYWxFbnRpdHkgfSBmcm9tICcuLi9zcGF0aWFsLXR5cGVzJztcblxuXG50eXBlIENvbG9yID0gW251bWJlciwgbnVtYmVyLCBudW1iZXIsIG51bWJlcl07XG5jb25zdCBncmF5OiBDb2xvciA9IFsyMDQsIDIwNCwgMjA0LCAyNTVdO1xuY29uc3QgcmVkOiBDb2xvciA9IFsyMTMsIDAsIDAsIDI1NV07XG5jb25zdCBncmVlbjogQ29sb3IgPSBbMjksIDIwNCwgMTAxLCAyNTVdO1xuY29uc3QgYmx1ZTogQ29sb3IgPSBbNDEsIDEyMSwgMjU1LCAyNTVdO1xuXG4vKipcbiAqIENyZWF0ZSBhIHNldCBvZiBzY2VuZSBub2RlcyBmb3IgdGhlIGJvZHktdWkgdG8gc2hvdyB0aGUgb3JpZ2luIGFuZCBsaW5lcyBleHRlbmRpbmcgdG8gaXQncyBkaW1lbnNpb25zLlxuICogQHBhcmFtIG5vZGUgdGhlIFNwYXRpYWwgRW50aXR5ICh1c3VhbGx5IGEgcmVmZXJlbmNlIG9yZ2FuKSB0aGF0IHRoZSBvcmlnaW4gaXMgZGVmaW5lZCBieVxuICogQHBhcmFtIGluY2x1ZGVMZXR0ZXJzIHdoZXRoZXIgdG8gc2hvdyB0aGUga2V5Ym9hcmQgbGV0dGVycyBhc3NvY2lhdGVkIHdpdGggdGhlIG9yaWdpbiBwb2ludHNcbiAqIEByZXR1cm5zIGEgc2V0IG9mIHNjZW5lIG5vZGVzIGZvciB0aGUgYm9keS11aVxuICovXG5leHBvcnQgZnVuY3Rpb24gZ2V0T3JpZ2luU2NlbmUobm9kZTogU3BhdGlhbEVudGl0eSwgaW5jbHVkZUxldHRlcnMgPSBmYWxzZSk6IFNwYXRpYWxTY2VuZU5vZGVbXSB7XG4gIGNvbnN0IHNjZW5lV2lkdGggPSBub2RlLnhfZGltZW5zaW9uIC8gMTAwMDtcbiAgY29uc3Qgc2NlbmVIZWlnaHQgPSBub2RlLnlfZGltZW5zaW9uIC8gMTAwMDtcbiAgY29uc3Qgc2NlbmVEZXB0aCA9IG5vZGUuel9kaW1lbnNpb24gLyAxMDAwO1xuICBjb25zdCBvcmlnaW5SYWRpdXMgPSBNYXRoLm1heChzY2VuZVdpZHRoLCBzY2VuZUhlaWdodCwgc2NlbmVEZXB0aCkgKiAwLjA1O1xuICBjb25zdCBsaW5lUmFkaXVzID0gb3JpZ2luUmFkaXVzICogMC4xO1xuXG4gIHJldHVybiBbXG4gICAgLy8gT3JpZ2luIFNwaGVyZVxuICAgIHtcbiAgICAgICdAaWQnOiAnaHR0cDovL3B1cmwub3JnL2NjZi9sYXRlc3QvY2NmLm93bCNPcmlnaW5TcGhlcmUnLFxuICAgICAgJ0B0eXBlJzogJ1NwYXRpYWxTY2VuZU5vZGUnLFxuICAgICAgdW5waWNrYWJsZTogdHJ1ZSxcbiAgICAgIGdlb21ldHJ5OiAnc3BoZXJlJyxcbiAgICAgIHRyYW5zZm9ybU1hdHJpeDogbmV3IE1hdHJpeDQoTWF0cml4NC5JREVOVElUWSkuc2NhbGUob3JpZ2luUmFkaXVzKSxcbiAgICAgIGNvbG9yOiBncmF5XG4gICAgfSxcbiAgICAvLyBPcmlnaW4gWCBBeGlzXG4gICAge1xuICAgICAgJ0BpZCc6ICdodHRwOi8vcHVybC5vcmcvY2NmL2xhdGVzdC9jY2Yub3dsI09yaWdpblgnLFxuICAgICAgJ0B0eXBlJzogJ1NwYXRpYWxTY2VuZU5vZGUnLFxuICAgICAgdW5waWNrYWJsZTogdHJ1ZSxcbiAgICAgIGdlb21ldHJ5OiAnY3lsaW5kZXInLFxuICAgICAgdHJhbnNmb3JtTWF0cml4OiBuZXcgTWF0cml4NChNYXRyaXg0LklERU5USVRZKVxuICAgICAgICAudHJhbnNsYXRlKFtzY2VuZVdpZHRoIC8gMiwgMCwgMF0pXG4gICAgICAgIC5yb3RhdGVaKHRvUmFkaWFucygtOTApKVxuICAgICAgICAuc2NhbGUoW2xpbmVSYWRpdXMsIHNjZW5lV2lkdGgsIGxpbmVSYWRpdXNdKSxcbiAgICAgIGNvbG9yOiByZWRcbiAgICB9LFxuICAgIHtcbiAgICAgICdAaWQnOiAnaHR0cDovL3B1cmwub3JnL2NjZi9sYXRlc3QvY2NmLm93bCNPcmlnaW5YQ29uZScsXG4gICAgICAnQHR5cGUnOiAnU3BhdGlhbFNjZW5lTm9kZScsXG4gICAgICB1bnBpY2thYmxlOiB0cnVlLFxuICAgICAgZ2VvbWV0cnk6ICdjb25lJyxcbiAgICAgIHRyYW5zZm9ybU1hdHJpeDogbmV3IE1hdHJpeDQoTWF0cml4NC5JREVOVElUWSlcbiAgICAgICAgLnRyYW5zbGF0ZShbc2NlbmVXaWR0aCwgMCwgMF0pXG4gICAgICAgIC5yb3RhdGVaKHRvUmFkaWFucygtOTApKVxuICAgICAgICAuc2NhbGUoWyBvcmlnaW5SYWRpdXMsIG9yaWdpblJhZGl1cyAqIDMsIG9yaWdpblJhZGl1cyBdKSxcbiAgICAgIGNvbG9yOiByZWRcbiAgICB9LFxuICAgIHtcbiAgICAgICdAaWQnOiAnaHR0cDovL3B1cmwub3JnL2NjZi9sYXRlc3QvY2NmLm93bCNPcmlnaW5YQUxhYmVsJyxcbiAgICAgICdAdHlwZSc6ICdTcGF0aWFsU2NlbmVOb2RlJyxcbiAgICAgIHVucGlja2FibGU6IHRydWUsXG4gICAgICBnZW9tZXRyeTogJ3RleHQnLFxuICAgICAgdGV4dDogJ0EnLFxuICAgICAgdHJhbnNmb3JtTWF0cml4OiBuZXcgTWF0cml4NChNYXRyaXg0LklERU5USVRZKS50cmFuc2xhdGUoWy1vcmlnaW5SYWRpdXMgKiAyLCAwLCAwXSkuc2NhbGUob3JpZ2luUmFkaXVzKSxcbiAgICAgIGNvbG9yOiByZWRcbiAgICB9LFxuICAgIHtcbiAgICAgICdAaWQnOiAnaHR0cDovL3B1cmwub3JnL2NjZi9sYXRlc3QvY2NmLm93bCNPcmlnaW5YRExhYmVsJyxcbiAgICAgICdAdHlwZSc6ICdTcGF0aWFsU2NlbmVOb2RlJyxcbiAgICAgIHVucGlja2FibGU6IHRydWUsXG4gICAgICBnZW9tZXRyeTogJ3RleHQnLFxuICAgICAgdGV4dDogJ0QnLFxuICAgICAgdHJhbnNmb3JtTWF0cml4OiBuZXcgTWF0cml4NChNYXRyaXg0LklERU5USVRZKS50cmFuc2xhdGUoW3NjZW5lV2lkdGggKyBvcmlnaW5SYWRpdXMgKiAyLCAwLCAwXSkuc2NhbGUob3JpZ2luUmFkaXVzKSxcbiAgICAgIGNvbG9yOiByZWRcbiAgICB9LFxuICAgIC8vIE9yaWdpbiBZIEF4aXNcbiAgICB7XG4gICAgICAnQGlkJzogJ2h0dHA6Ly9wdXJsLm9yZy9jY2YvbGF0ZXN0L2NjZi5vd2wjT3JpZ2luWScsXG4gICAgICAnQHR5cGUnOiAnU3BhdGlhbFNjZW5lTm9kZScsXG4gICAgICB1bnBpY2thYmxlOiB0cnVlLFxuICAgICAgZ2VvbWV0cnk6ICdjeWxpbmRlcicsXG4gICAgICB0cmFuc2Zvcm1NYXRyaXg6IG5ldyBNYXRyaXg0KE1hdHJpeDQuSURFTlRJVFkpXG4gICAgICAgIC50cmFuc2xhdGUoWzAsIHNjZW5lSGVpZ2h0IC8gMiwgMF0pXG4gICAgICAgIC5zY2FsZShbbGluZVJhZGl1cywgc2NlbmVIZWlnaHQsIGxpbmVSYWRpdXNdKSxcbiAgICAgIGNvbG9yOiBncmVlblxuICAgIH0sXG4gICAge1xuICAgICAgJ0BpZCc6ICdodHRwOi8vcHVybC5vcmcvY2NmL2xhdGVzdC9jY2Yub3dsI09yaWdpbllDb25lJyxcbiAgICAgICdAdHlwZSc6ICdTcGF0aWFsU2NlbmVOb2RlJyxcbiAgICAgIHVucGlja2FibGU6IHRydWUsXG4gICAgICBnZW9tZXRyeTogJ2NvbmUnLFxuICAgICAgdHJhbnNmb3JtTWF0cml4OiBuZXcgTWF0cml4NChNYXRyaXg0LklERU5USVRZKVxuICAgICAgICAudHJhbnNsYXRlKFswLCBzY2VuZUhlaWdodCwgMF0pXG4gICAgICAgIC5zY2FsZShbIG9yaWdpblJhZGl1cywgb3JpZ2luUmFkaXVzICogMywgb3JpZ2luUmFkaXVzIF0pLFxuICAgICAgY29sb3I6IGdyZWVuXG4gICAgfSxcbiAgICB7XG4gICAgICAnQGlkJzogJ2h0dHA6Ly9wdXJsLm9yZy9jY2YvbGF0ZXN0L2NjZi5vd2wjT3JpZ2luWVNMYWJlbCcsXG4gICAgICAnQHR5cGUnOiAnU3BhdGlhbFNjZW5lTm9kZScsXG4gICAgICB1bnBpY2thYmxlOiB0cnVlLFxuICAgICAgZ2VvbWV0cnk6ICd0ZXh0JyxcbiAgICAgIHRleHQ6ICdTJyxcbiAgICAgIHRyYW5zZm9ybU1hdHJpeDogbmV3IE1hdHJpeDQoTWF0cml4NC5JREVOVElUWSkudHJhbnNsYXRlKFtvcmlnaW5SYWRpdXMgKiAxLjUsIG9yaWdpblJhZGl1cyAqIDEuNSwgMF0pLnNjYWxlKG9yaWdpblJhZGl1cyksXG4gICAgICBjb2xvcjogZ3JlZW5cbiAgICB9LFxuICAgIHtcbiAgICAgICdAaWQnOiAnaHR0cDovL3B1cmwub3JnL2NjZi9sYXRlc3QvY2NmLm93bCNPcmlnaW5ZV0xhYmVsJyxcbiAgICAgICdAdHlwZSc6ICdTcGF0aWFsU2NlbmVOb2RlJyxcbiAgICAgIHVucGlja2FibGU6IHRydWUsXG4gICAgICBnZW9tZXRyeTogJ3RleHQnLFxuICAgICAgdGV4dDogJ1cnLFxuICAgICAgdHJhbnNmb3JtTWF0cml4OiBuZXcgTWF0cml4NChNYXRyaXg0LklERU5USVRZKS50cmFuc2xhdGUoWzAsIHNjZW5lSGVpZ2h0ICsgb3JpZ2luUmFkaXVzICogMiwgMF0pLnNjYWxlKG9yaWdpblJhZGl1cyksXG4gICAgICBjb2xvcjogZ3JlZW5cbiAgICB9LFxuICAgIC8vIE9yaWdpbiBaIEF4aXNcbiAgICB7XG4gICAgICAnQGlkJzogJ2h0dHA6Ly9wdXJsLm9yZy9jY2YvbGF0ZXN0L2NjZi5vd2wjT3JpZ2luWicsXG4gICAgICAnQHR5cGUnOiAnU3BhdGlhbFNjZW5lTm9kZScsXG4gICAgICB1bnBpY2thYmxlOiB0cnVlLFxuICAgICAgZ2VvbWV0cnk6ICdjeWxpbmRlcicsXG4gICAgICB0cmFuc2Zvcm1NYXRyaXg6IG5ldyBNYXRyaXg0KE1hdHJpeDQuSURFTlRJVFkpXG4gICAgICAgIC50cmFuc2xhdGUoWzAsIDAsIHNjZW5lRGVwdGggLyAyXSlcbiAgICAgICAgLnJvdGF0ZVgodG9SYWRpYW5zKDkwKSlcbiAgICAgICAgLnNjYWxlKFtsaW5lUmFkaXVzLCBzY2VuZURlcHRoLCBsaW5lUmFkaXVzXSksXG4gICAgICBjb2xvcjogYmx1ZVxuICAgIH0sXG4gICAge1xuICAgICAgJ0BpZCc6ICdodHRwOi8vcHVybC5vcmcvY2NmL2xhdGVzdC9jY2Yub3dsI09yaWdpblpDb25lJyxcbiAgICAgICdAdHlwZSc6ICdTcGF0aWFsU2NlbmVOb2RlJyxcbiAgICAgIHVucGlja2FibGU6IHRydWUsXG4gICAgICBnZW9tZXRyeTogJ2NvbmUnLFxuICAgICAgdHJhbnNmb3JtTWF0cml4OiBuZXcgTWF0cml4NChNYXRyaXg0LklERU5USVRZKVxuICAgICAgICAudHJhbnNsYXRlKFswLCAwLCBzY2VuZURlcHRoXSlcbiAgICAgICAgLnJvdGF0ZVgodG9SYWRpYW5zKDkwKSlcbiAgICAgICAgLnNjYWxlKFsgb3JpZ2luUmFkaXVzLCBvcmlnaW5SYWRpdXMgKiAzLCBvcmlnaW5SYWRpdXMgXSksXG4gICAgICBjb2xvcjogYmx1ZVxuICAgIH0sXG4gICAge1xuICAgICAgJ0BpZCc6ICdodHRwOi8vcHVybC5vcmcvY2NmL2xhdGVzdC9jY2Yub3dsI09yaWdpblpRTGFiZWwnLFxuICAgICAgJ0B0eXBlJzogJ1NwYXRpYWxTY2VuZU5vZGUnLFxuICAgICAgdW5waWNrYWJsZTogdHJ1ZSxcbiAgICAgIGdlb21ldHJ5OiAndGV4dCcsXG4gICAgICB0ZXh0OiAnUScsXG4gICAgICB0cmFuc2Zvcm1NYXRyaXg6IG5ldyBNYXRyaXg0KE1hdHJpeDQuSURFTlRJVFkpLnRyYW5zbGF0ZShbb3JpZ2luUmFkaXVzICogMS41LCAtIG9yaWdpblJhZGl1cyAqIDEuNSwgMF0pLnNjYWxlKG9yaWdpblJhZGl1cyksXG4gICAgICBjb2xvcjogYmx1ZVxuICAgIH0sXG4gICAge1xuICAgICAgJ0BpZCc6ICdodHRwOi8vcHVybC5vcmcvY2NmL2xhdGVzdC9jY2Yub3dsI09yaWdpblpFTGFiZWwnLFxuICAgICAgJ0B0eXBlJzogJ1NwYXRpYWxTY2VuZU5vZGUnLFxuICAgICAgdW5waWNrYWJsZTogdHJ1ZSxcbiAgICAgIGdlb21ldHJ5OiAndGV4dCcsXG4gICAgICB0ZXh0OiAnRScsXG4gICAgICB0cmFuc2Zvcm1NYXRyaXg6IG5ldyBNYXRyaXg0KE1hdHJpeDQuSURFTlRJVFkpLnRyYW5zbGF0ZShbMCwgMCwgc2NlbmVEZXB0aCArIG9yaWdpblJhZGl1cyAqIDJdKS5zY2FsZShvcmlnaW5SYWRpdXMpLFxuICAgICAgY29sb3I6IGJsdWVcbiAgICB9XG4gIF0uZmlsdGVyKG4gPT4gKGluY2x1ZGVMZXR0ZXJzICYmIG4uZ2VvbWV0cnkgPT09ICd0ZXh0JyAmJiBuLnRleHQpIHx8ICFuLnRleHQpIGFzIFNwYXRpYWxTY2VuZU5vZGVbXTtcbn1cbiJdfQ== \ No newline at end of file diff --git a/ccf-database/esm2015/lib/util/patch-jsonld.js b/ccf-database/esm2015/lib/util/patch-jsonld.js deleted file mode 100644 index cfc1a7b6f..000000000 --- a/ccf-database/esm2015/lib/util/patch-jsonld.js +++ /dev/null @@ -1,146 +0,0 @@ -/* eslint-disable @typescript-eslint/naming-convention */ -/** CCF v2.0 JSON-LD Context */ -const CCF_CONTEXT = { - '@context': { - '@base': 'http://purl.org/ccf/', - '@vocab': 'http://purl.org/ccf/', - 'ccf': 'http://purl.org/ccf/', - 'rdfs': 'http://www.w3.org/2000/01/rdf-schema#', - 'dcterms': 'http://purl.org/dc/terms/', - 'label': 'rdfs:label', - 'description': 'rdfs:comment', - 'link': 'ccf:url', - 'sex': 'ccf:sex', - 'age': 'ccf:age', - 'bmi': 'ccf:bmi', - 'consortium_name': 'ccf:consortium_name', - 'provider_name': 'ccf:tissue_provider_name', - 'provider_uuid': 'ccf:tissue_provider_uuid', - 'donor': { - '@id': 'ccf:comes_from', - '@type': '@id' - }, - 'samples': { - '@reverse': 'donor' - }, - 'sections': { - '@id': 'ccf:subdivided_into_sections', - '@type': '@id' - }, - 'datasets': { - '@id': 'ccf:generates_dataset', - '@type': '@id' - }, - 'sample_type': 'ccf:sample_type', - 'section_count': 'ccf:section_count', - 'section_size': 'ccf:section_size', - 'section_units': 'ccf:section_size_unit', - 'section_number': 'ccf:section_number', - 'rui_location': { - '@id': 'ccf:has_registration_location', - '@type': '@id' - }, - 'ccf_annotations': { - '@id': 'ccf:collides_with', - '@type': '@id', - '@container': '@set' - }, - 'representation_of': { - '@id': 'ccf:representation_of', - '@type': '@id' - }, - 'reference_organ': { - '@id': 'ccf:has_reference_organ', - '@type': '@id' - }, - 'extraction_set_for': { - '@id': 'ccf:extraction_set_for', - '@type': '@id' - }, - 'extraction_set': { - '@id': 'ccf:has_extraction_set', - '@type': '@id' - }, - 'organ_owner_sex': 'ccf:organ_owner_sex', - 'side': 'ccf:organ_side', - 'rui_rank': 'ccf:rui_rank', - 'slice_thickness': 'ccf:slice_thickness', - 'slice_count': 'ccf:slice_count', - 'object': { - '@id': 'ccf:has_object_reference', - '@type': '@id' - }, - 'creation_date': 'dcterms:created', - 'updated_date': 'ccf:updated_date', - 'creator': 'dcterms:creator', - 'creator_first_name': 'ccf:creator_first_name', - 'creator_last_name': 'ccf:creator_last_name', - 'placement': { - '@reverse': 'ccf:placement_for' - }, - 'placement_date': 'dcterms:created', - 'rotation_order': 'ccf:rotation_order', - 'dimension_units': 'ccf:dimension_unit', - 'rotation_units': 'ccf:rotation_unit', - 'scaling_units': 'ccf:scaling_unit', - 'translation_units': 'ccf:translation_unit', - 'source': { - '@id': 'ccf:placement_for', - '@type': '@id' - }, - 'target': { - '@id': 'ccf:placement_relative_to', - '@type': '@id' - }, - 'x_rotation': 'ccf:x_rotation', - 'y_rotation': 'ccf:y_rotation', - 'z_rotation': 'ccf:z_rotation', - 'x_scaling': 'ccf:x_scaling', - 'y_scaling': 'ccf:y_scaling', - 'z_scaling': 'ccf:z_scaling', - 'x_translation': 'ccf:x_translation', - 'y_translation': 'ccf:y_translation', - 'z_translation': 'ccf:z_translation', - 'x_dimension': 'ccf:x_dimension', - 'y_dimension': 'ccf:y_dimension', - 'z_dimension': 'ccf:z_dimension', - 'ontology_terms': { - '@id': 'ccf:has_ontology_term', - '@type': '@id' - }, - 'technology': 'ccf:technology', - 'thumbnail': 'ccf:thumbnail', - 'file': 'ccf:file_url', - 'file_format': 'ccf:file_format', - 'file_subpath': 'ccf:file_subpath' - } -}; -/* eslint-enable @typescript-eslint/naming-convention */ -/** - * Function which takes JSON-LD data and makes patches to update from CCF v1.x to v2.0 automatically - * - * @param jsonLdString the input JSON-LD as a string - * @returns A JSON-LD object derived from the given string with updated data to be compatible with CCF v2.0 - */ -export function patchJsonLd(jsonLdString) { - return JSON.parse(jsonLdString, (key, value) => { - if (key === 'ccf_annotations' && Array.isArray(value)) { - return value.map((iri) => { - if (iri === null || iri === void 0 ? void 0 : iri.startsWith('http://purl.obolibrary.org/obo/FMA_')) { - return iri.replace('http://purl.obolibrary.org/obo/FMA_', 'http://purl.org/sig/ont/fma/fma'); - } - else { - return iri; - } - }); - } - else if (key === '@context' && value && (value === 'https://hubmapconsortium.github.io/hubmap-ontology/ccf-entity-context.jsonld' - || value === 'https://hubmapconsortium.github.io/hubmap-ontology/ccf-context.jsonld' - || value === 'https://hubmapconsortium.github.io/ccf-ontology/ccf-context.jsonld' - || value['@base'] === 'http://purl.org/ccf/latest/ccf-entity.owl#')) { - return CCF_CONTEXT; - } - return value; - }); -} -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGF0Y2gtanNvbmxkLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvY2NmLWRhdGFiYXNlL3NyYy9saWIvdXRpbC9wYXRjaC1qc29ubGQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBR0EseURBQXlEO0FBQ3pELCtCQUErQjtBQUMvQixNQUFNLFdBQVcsR0FBRztJQUNsQixVQUFVLEVBQUU7UUFDVixPQUFPLEVBQUUsc0JBQXNCO1FBQy9CLFFBQVEsRUFBRSxzQkFBc0I7UUFDaEMsS0FBSyxFQUFFLHNCQUFzQjtRQUM3QixNQUFNLEVBQUUsdUNBQXVDO1FBQy9DLFNBQVMsRUFBRSwyQkFBMkI7UUFDdEMsT0FBTyxFQUFFLFlBQVk7UUFDckIsYUFBYSxFQUFFLGNBQWM7UUFDN0IsTUFBTSxFQUFFLFNBQVM7UUFDakIsS0FBSyxFQUFFLFNBQVM7UUFDaEIsS0FBSyxFQUFFLFNBQVM7UUFDaEIsS0FBSyxFQUFFLFNBQVM7UUFDaEIsaUJBQWlCLEVBQUUscUJBQXFCO1FBQ3hDLGVBQWUsRUFBRSwwQkFBMEI7UUFDM0MsZUFBZSxFQUFFLDBCQUEwQjtRQUMzQyxPQUFPLEVBQUU7WUFDUCxLQUFLLEVBQUUsZ0JBQWdCO1lBQ3ZCLE9BQU8sRUFBRSxLQUFLO1NBQ2Y7UUFDRCxTQUFTLEVBQUU7WUFDVCxVQUFVLEVBQUUsT0FBTztTQUNwQjtRQUNELFVBQVUsRUFBRTtZQUNWLEtBQUssRUFBRSw4QkFBOEI7WUFDckMsT0FBTyxFQUFFLEtBQUs7U0FDZjtRQUNELFVBQVUsRUFBRTtZQUNWLEtBQUssRUFBRSx1QkFBdUI7WUFDOUIsT0FBTyxFQUFFLEtBQUs7U0FDZjtRQUNELGFBQWEsRUFBRSxpQkFBaUI7UUFDaEMsZUFBZSxFQUFFLG1CQUFtQjtRQUNwQyxjQUFjLEVBQUUsa0JBQWtCO1FBQ2xDLGVBQWUsRUFBRSx1QkFBdUI7UUFDeEMsZ0JBQWdCLEVBQUUsb0JBQW9CO1FBQ3RDLGNBQWMsRUFBRTtZQUNkLEtBQUssRUFBRSwrQkFBK0I7WUFDdEMsT0FBTyxFQUFFLEtBQUs7U0FDZjtRQUNELGlCQUFpQixFQUFFO1lBQ2pCLEtBQUssRUFBRSxtQkFBbUI7WUFDMUIsT0FBTyxFQUFFLEtBQUs7WUFDZCxZQUFZLEVBQUUsTUFBTTtTQUNyQjtRQUNELG1CQUFtQixFQUFFO1lBQ25CLEtBQUssRUFBRSx1QkFBdUI7WUFDOUIsT0FBTyxFQUFFLEtBQUs7U0FDZjtRQUNELGlCQUFpQixFQUFFO1lBQ2pCLEtBQUssRUFBRSx5QkFBeUI7WUFDaEMsT0FBTyxFQUFFLEtBQUs7U0FDZjtRQUNELG9CQUFvQixFQUFFO1lBQ3BCLEtBQUssRUFBRSx3QkFBd0I7WUFDL0IsT0FBTyxFQUFFLEtBQUs7U0FDZjtRQUNELGdCQUFnQixFQUFFO1lBQ2hCLEtBQUssRUFBRSx3QkFBd0I7WUFDL0IsT0FBTyxFQUFFLEtBQUs7U0FDZjtRQUNELGlCQUFpQixFQUFFLHFCQUFxQjtRQUN4QyxNQUFNLEVBQUUsZ0JBQWdCO1FBQ3hCLFVBQVUsRUFBRSxjQUFjO1FBQzFCLGlCQUFpQixFQUFFLHFCQUFxQjtRQUN4QyxhQUFhLEVBQUUsaUJBQWlCO1FBQ2hDLFFBQVEsRUFBRTtZQUNSLEtBQUssRUFBRSwwQkFBMEI7WUFDakMsT0FBTyxFQUFFLEtBQUs7U0FDZjtRQUNELGVBQWUsRUFBRSxpQkFBaUI7UUFDbEMsY0FBYyxFQUFFLGtCQUFrQjtRQUNsQyxTQUFTLEVBQUUsaUJBQWlCO1FBQzVCLG9CQUFvQixFQUFFLHdCQUF3QjtRQUM5QyxtQkFBbUIsRUFBRSx1QkFBdUI7UUFDNUMsV0FBVyxFQUFFO1lBQ1gsVUFBVSxFQUFFLG1CQUFtQjtTQUNoQztRQUNELGdCQUFnQixFQUFFLGlCQUFpQjtRQUNuQyxnQkFBZ0IsRUFBRSxvQkFBb0I7UUFDdEMsaUJBQWlCLEVBQUUsb0JBQW9CO1FBQ3ZDLGdCQUFnQixFQUFFLG1CQUFtQjtRQUNyQyxlQUFlLEVBQUUsa0JBQWtCO1FBQ25DLG1CQUFtQixFQUFFLHNCQUFzQjtRQUMzQyxRQUFRLEVBQUU7WUFDUixLQUFLLEVBQUUsbUJBQW1CO1lBQzFCLE9BQU8sRUFBRSxLQUFLO1NBQ2Y7UUFDRCxRQUFRLEVBQUU7WUFDUixLQUFLLEVBQUUsMkJBQTJCO1lBQ2xDLE9BQU8sRUFBRSxLQUFLO1NBQ2Y7UUFDRCxZQUFZLEVBQUUsZ0JBQWdCO1FBQzlCLFlBQVksRUFBRSxnQkFBZ0I7UUFDOUIsWUFBWSxFQUFFLGdCQUFnQjtRQUM5QixXQUFXLEVBQUUsZUFBZTtRQUM1QixXQUFXLEVBQUUsZUFBZTtRQUM1QixXQUFXLEVBQUUsZUFBZTtRQUM1QixlQUFlLEVBQUUsbUJBQW1CO1FBQ3BDLGVBQWUsRUFBRSxtQkFBbUI7UUFDcEMsZUFBZSxFQUFFLG1CQUFtQjtRQUNwQyxhQUFhLEVBQUUsaUJBQWlCO1FBQ2hDLGFBQWEsRUFBRSxpQkFBaUI7UUFDaEMsYUFBYSxFQUFFLGlCQUFpQjtRQUNoQyxnQkFBZ0IsRUFBRTtZQUNoQixLQUFLLEVBQUUsdUJBQXVCO1lBQzlCLE9BQU8sRUFBRSxLQUFLO1NBQ2Y7UUFDRCxZQUFZLEVBQUUsZ0JBQWdCO1FBQzlCLFdBQVcsRUFBRSxlQUFlO1FBQzVCLE1BQU0sRUFBRSxjQUFjO1FBQ3RCLGFBQWEsRUFBRSxpQkFBaUI7UUFDaEMsY0FBYyxFQUFFLGtCQUFrQjtLQUNuQztDQUNGLENBQUM7QUFDRix3REFBd0Q7QUFFeEQ7Ozs7O0dBS0c7QUFDSCxNQUFNLFVBQVUsV0FBVyxDQUFDLFlBQW9CO0lBQzlDLE9BQU8sSUFBSSxDQUFDLEtBQUssQ0FBQyxZQUFZLEVBQUUsQ0FBQyxHQUFHLEVBQUUsS0FBSyxFQUFFLEVBQUU7UUFDN0MsSUFBSSxHQUFHLEtBQUssaUJBQWlCLElBQUksS0FBSyxDQUFDLE9BQU8sQ0FBQyxLQUFLLENBQUMsRUFBRTtZQUNyRCxPQUFPLEtBQUssQ0FBQyxHQUFHLENBQUMsQ0FBQyxHQUFXLEVBQUUsRUFBRTtnQkFDL0IsSUFBSSxHQUFHLGFBQUgsR0FBRyx1QkFBSCxHQUFHLENBQUUsVUFBVSxDQUFDLHFDQUFxQyxDQUFDLEVBQUU7b0JBQzFELE9BQU8sR0FBRyxDQUFDLE9BQU8sQ0FDaEIscUNBQXFDLEVBQ3JDLGlDQUFpQyxDQUNsQyxDQUFDO2lCQUNIO3FCQUFNO29CQUNMLE9BQU8sR0FBRyxDQUFDO2lCQUNaO1lBQ0gsQ0FBQyxDQUFDLENBQUM7U0FDSjthQUFNLElBQUksR0FBRyxLQUFLLFVBQVUsSUFBSSxLQUFLLElBQUksQ0FDeEMsS0FBSyxLQUFLLDhFQUE4RTtlQUNuRixLQUFLLEtBQUssdUVBQXVFO2VBQ2pGLEtBQUssS0FBSyxvRUFBb0U7ZUFDN0UsS0FBaUIsQ0FBQyxPQUFPLENBQUMsS0FBSyw0Q0FBNEMsQ0FDbEYsRUFBRTtZQUNELE9BQU8sV0FBVyxDQUFDO1NBQ3BCO1FBQ0QsT0FBTyxLQUFLLENBQUM7SUFDZixDQUFDLENBQUMsQ0FBQztBQUNMLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJcbmltcG9ydCB7IENvbnRleHQsIEpzb25MZCB9IGZyb20gJ2pzb25sZC9qc29ubGQtc3BlYyc7XG5cbi8qIGVzbGludC1kaXNhYmxlIEB0eXBlc2NyaXB0LWVzbGludC9uYW1pbmctY29udmVudGlvbiAqL1xuLyoqIENDRiB2Mi4wIEpTT04tTEQgQ29udGV4dCAqL1xuY29uc3QgQ0NGX0NPTlRFWFQgPSB7XG4gICdAY29udGV4dCc6IHtcbiAgICAnQGJhc2UnOiAnaHR0cDovL3B1cmwub3JnL2NjZi8nLFxuICAgICdAdm9jYWInOiAnaHR0cDovL3B1cmwub3JnL2NjZi8nLFxuICAgICdjY2YnOiAnaHR0cDovL3B1cmwub3JnL2NjZi8nLFxuICAgICdyZGZzJzogJ2h0dHA6Ly93d3cudzMub3JnLzIwMDAvMDEvcmRmLXNjaGVtYSMnLFxuICAgICdkY3Rlcm1zJzogJ2h0dHA6Ly9wdXJsLm9yZy9kYy90ZXJtcy8nLFxuICAgICdsYWJlbCc6ICdyZGZzOmxhYmVsJyxcbiAgICAnZGVzY3JpcHRpb24nOiAncmRmczpjb21tZW50JyxcbiAgICAnbGluayc6ICdjY2Y6dXJsJyxcbiAgICAnc2V4JzogJ2NjZjpzZXgnLFxuICAgICdhZ2UnOiAnY2NmOmFnZScsXG4gICAgJ2JtaSc6ICdjY2Y6Ym1pJyxcbiAgICAnY29uc29ydGl1bV9uYW1lJzogJ2NjZjpjb25zb3J0aXVtX25hbWUnLFxuICAgICdwcm92aWRlcl9uYW1lJzogJ2NjZjp0aXNzdWVfcHJvdmlkZXJfbmFtZScsXG4gICAgJ3Byb3ZpZGVyX3V1aWQnOiAnY2NmOnRpc3N1ZV9wcm92aWRlcl91dWlkJyxcbiAgICAnZG9ub3InOiB7XG4gICAgICAnQGlkJzogJ2NjZjpjb21lc19mcm9tJyxcbiAgICAgICdAdHlwZSc6ICdAaWQnXG4gICAgfSxcbiAgICAnc2FtcGxlcyc6IHtcbiAgICAgICdAcmV2ZXJzZSc6ICdkb25vcidcbiAgICB9LFxuICAgICdzZWN0aW9ucyc6IHtcbiAgICAgICdAaWQnOiAnY2NmOnN1YmRpdmlkZWRfaW50b19zZWN0aW9ucycsXG4gICAgICAnQHR5cGUnOiAnQGlkJ1xuICAgIH0sXG4gICAgJ2RhdGFzZXRzJzoge1xuICAgICAgJ0BpZCc6ICdjY2Y6Z2VuZXJhdGVzX2RhdGFzZXQnLFxuICAgICAgJ0B0eXBlJzogJ0BpZCdcbiAgICB9LFxuICAgICdzYW1wbGVfdHlwZSc6ICdjY2Y6c2FtcGxlX3R5cGUnLFxuICAgICdzZWN0aW9uX2NvdW50JzogJ2NjZjpzZWN0aW9uX2NvdW50JyxcbiAgICAnc2VjdGlvbl9zaXplJzogJ2NjZjpzZWN0aW9uX3NpemUnLFxuICAgICdzZWN0aW9uX3VuaXRzJzogJ2NjZjpzZWN0aW9uX3NpemVfdW5pdCcsXG4gICAgJ3NlY3Rpb25fbnVtYmVyJzogJ2NjZjpzZWN0aW9uX251bWJlcicsXG4gICAgJ3J1aV9sb2NhdGlvbic6IHtcbiAgICAgICdAaWQnOiAnY2NmOmhhc19yZWdpc3RyYXRpb25fbG9jYXRpb24nLFxuICAgICAgJ0B0eXBlJzogJ0BpZCdcbiAgICB9LFxuICAgICdjY2ZfYW5ub3RhdGlvbnMnOiB7XG4gICAgICAnQGlkJzogJ2NjZjpjb2xsaWRlc193aXRoJyxcbiAgICAgICdAdHlwZSc6ICdAaWQnLFxuICAgICAgJ0Bjb250YWluZXInOiAnQHNldCdcbiAgICB9LFxuICAgICdyZXByZXNlbnRhdGlvbl9vZic6IHtcbiAgICAgICdAaWQnOiAnY2NmOnJlcHJlc2VudGF0aW9uX29mJyxcbiAgICAgICdAdHlwZSc6ICdAaWQnXG4gICAgfSxcbiAgICAncmVmZXJlbmNlX29yZ2FuJzoge1xuICAgICAgJ0BpZCc6ICdjY2Y6aGFzX3JlZmVyZW5jZV9vcmdhbicsXG4gICAgICAnQHR5cGUnOiAnQGlkJ1xuICAgIH0sXG4gICAgJ2V4dHJhY3Rpb25fc2V0X2Zvcic6IHtcbiAgICAgICdAaWQnOiAnY2NmOmV4dHJhY3Rpb25fc2V0X2ZvcicsXG4gICAgICAnQHR5cGUnOiAnQGlkJ1xuICAgIH0sXG4gICAgJ2V4dHJhY3Rpb25fc2V0Jzoge1xuICAgICAgJ0BpZCc6ICdjY2Y6aGFzX2V4dHJhY3Rpb25fc2V0JyxcbiAgICAgICdAdHlwZSc6ICdAaWQnXG4gICAgfSxcbiAgICAnb3JnYW5fb3duZXJfc2V4JzogJ2NjZjpvcmdhbl9vd25lcl9zZXgnLFxuICAgICdzaWRlJzogJ2NjZjpvcmdhbl9zaWRlJyxcbiAgICAncnVpX3JhbmsnOiAnY2NmOnJ1aV9yYW5rJyxcbiAgICAnc2xpY2VfdGhpY2tuZXNzJzogJ2NjZjpzbGljZV90aGlja25lc3MnLFxuICAgICdzbGljZV9jb3VudCc6ICdjY2Y6c2xpY2VfY291bnQnLFxuICAgICdvYmplY3QnOiB7XG4gICAgICAnQGlkJzogJ2NjZjpoYXNfb2JqZWN0X3JlZmVyZW5jZScsXG4gICAgICAnQHR5cGUnOiAnQGlkJ1xuICAgIH0sXG4gICAgJ2NyZWF0aW9uX2RhdGUnOiAnZGN0ZXJtczpjcmVhdGVkJyxcbiAgICAndXBkYXRlZF9kYXRlJzogJ2NjZjp1cGRhdGVkX2RhdGUnLFxuICAgICdjcmVhdG9yJzogJ2RjdGVybXM6Y3JlYXRvcicsXG4gICAgJ2NyZWF0b3JfZmlyc3RfbmFtZSc6ICdjY2Y6Y3JlYXRvcl9maXJzdF9uYW1lJyxcbiAgICAnY3JlYXRvcl9sYXN0X25hbWUnOiAnY2NmOmNyZWF0b3JfbGFzdF9uYW1lJyxcbiAgICAncGxhY2VtZW50Jzoge1xuICAgICAgJ0ByZXZlcnNlJzogJ2NjZjpwbGFjZW1lbnRfZm9yJ1xuICAgIH0sXG4gICAgJ3BsYWNlbWVudF9kYXRlJzogJ2RjdGVybXM6Y3JlYXRlZCcsXG4gICAgJ3JvdGF0aW9uX29yZGVyJzogJ2NjZjpyb3RhdGlvbl9vcmRlcicsXG4gICAgJ2RpbWVuc2lvbl91bml0cyc6ICdjY2Y6ZGltZW5zaW9uX3VuaXQnLFxuICAgICdyb3RhdGlvbl91bml0cyc6ICdjY2Y6cm90YXRpb25fdW5pdCcsXG4gICAgJ3NjYWxpbmdfdW5pdHMnOiAnY2NmOnNjYWxpbmdfdW5pdCcsXG4gICAgJ3RyYW5zbGF0aW9uX3VuaXRzJzogJ2NjZjp0cmFuc2xhdGlvbl91bml0JyxcbiAgICAnc291cmNlJzoge1xuICAgICAgJ0BpZCc6ICdjY2Y6cGxhY2VtZW50X2ZvcicsXG4gICAgICAnQHR5cGUnOiAnQGlkJ1xuICAgIH0sXG4gICAgJ3RhcmdldCc6IHtcbiAgICAgICdAaWQnOiAnY2NmOnBsYWNlbWVudF9yZWxhdGl2ZV90bycsXG4gICAgICAnQHR5cGUnOiAnQGlkJ1xuICAgIH0sXG4gICAgJ3hfcm90YXRpb24nOiAnY2NmOnhfcm90YXRpb24nLFxuICAgICd5X3JvdGF0aW9uJzogJ2NjZjp5X3JvdGF0aW9uJyxcbiAgICAnel9yb3RhdGlvbic6ICdjY2Y6el9yb3RhdGlvbicsXG4gICAgJ3hfc2NhbGluZyc6ICdjY2Y6eF9zY2FsaW5nJyxcbiAgICAneV9zY2FsaW5nJzogJ2NjZjp5X3NjYWxpbmcnLFxuICAgICd6X3NjYWxpbmcnOiAnY2NmOnpfc2NhbGluZycsXG4gICAgJ3hfdHJhbnNsYXRpb24nOiAnY2NmOnhfdHJhbnNsYXRpb24nLFxuICAgICd5X3RyYW5zbGF0aW9uJzogJ2NjZjp5X3RyYW5zbGF0aW9uJyxcbiAgICAnel90cmFuc2xhdGlvbic6ICdjY2Y6el90cmFuc2xhdGlvbicsXG4gICAgJ3hfZGltZW5zaW9uJzogJ2NjZjp4X2RpbWVuc2lvbicsXG4gICAgJ3lfZGltZW5zaW9uJzogJ2NjZjp5X2RpbWVuc2lvbicsXG4gICAgJ3pfZGltZW5zaW9uJzogJ2NjZjp6X2RpbWVuc2lvbicsXG4gICAgJ29udG9sb2d5X3Rlcm1zJzoge1xuICAgICAgJ0BpZCc6ICdjY2Y6aGFzX29udG9sb2d5X3Rlcm0nLFxuICAgICAgJ0B0eXBlJzogJ0BpZCdcbiAgICB9LFxuICAgICd0ZWNobm9sb2d5JzogJ2NjZjp0ZWNobm9sb2d5JyxcbiAgICAndGh1bWJuYWlsJzogJ2NjZjp0aHVtYm5haWwnLFxuICAgICdmaWxlJzogJ2NjZjpmaWxlX3VybCcsXG4gICAgJ2ZpbGVfZm9ybWF0JzogJ2NjZjpmaWxlX2Zvcm1hdCcsXG4gICAgJ2ZpbGVfc3VicGF0aCc6ICdjY2Y6ZmlsZV9zdWJwYXRoJ1xuICB9XG59O1xuLyogZXNsaW50LWVuYWJsZSBAdHlwZXNjcmlwdC1lc2xpbnQvbmFtaW5nLWNvbnZlbnRpb24gKi9cblxuLyoqXG4gKiBGdW5jdGlvbiB3aGljaCB0YWtlcyBKU09OLUxEIGRhdGEgYW5kIG1ha2VzIHBhdGNoZXMgdG8gdXBkYXRlIGZyb20gQ0NGIHYxLnggdG8gdjIuMCBhdXRvbWF0aWNhbGx5XG4gKlxuICogQHBhcmFtIGpzb25MZFN0cmluZyB0aGUgaW5wdXQgSlNPTi1MRCBhcyBhIHN0cmluZ1xuICogQHJldHVybnMgQSBKU09OLUxEIG9iamVjdCBkZXJpdmVkIGZyb20gdGhlIGdpdmVuIHN0cmluZyB3aXRoIHVwZGF0ZWQgZGF0YSB0byBiZSBjb21wYXRpYmxlIHdpdGggQ0NGIHYyLjBcbiAqL1xuZXhwb3J0IGZ1bmN0aW9uIHBhdGNoSnNvbkxkKGpzb25MZFN0cmluZzogc3RyaW5nKTogSnNvbkxkIHtcbiAgcmV0dXJuIEpTT04ucGFyc2UoanNvbkxkU3RyaW5nLCAoa2V5LCB2YWx1ZSkgPT4ge1xuICAgIGlmIChrZXkgPT09ICdjY2ZfYW5ub3RhdGlvbnMnICYmIEFycmF5LmlzQXJyYXkodmFsdWUpKSB7XG4gICAgICByZXR1cm4gdmFsdWUubWFwKChpcmk6IHN0cmluZykgPT4ge1xuICAgICAgICBpZiAoaXJpPy5zdGFydHNXaXRoKCdodHRwOi8vcHVybC5vYm9saWJyYXJ5Lm9yZy9vYm8vRk1BXycpKSB7XG4gICAgICAgICAgcmV0dXJuIGlyaS5yZXBsYWNlKFxuICAgICAgICAgICAgJ2h0dHA6Ly9wdXJsLm9ib2xpYnJhcnkub3JnL29iby9GTUFfJyxcbiAgICAgICAgICAgICdodHRwOi8vcHVybC5vcmcvc2lnL29udC9mbWEvZm1hJ1xuICAgICAgICAgICk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgcmV0dXJuIGlyaTtcbiAgICAgICAgfVxuICAgICAgfSk7XG4gICAgfSBlbHNlIGlmIChrZXkgPT09ICdAY29udGV4dCcgJiYgdmFsdWUgJiYgKFxuICAgICAgdmFsdWUgPT09ICdodHRwczovL2h1Ym1hcGNvbnNvcnRpdW0uZ2l0aHViLmlvL2h1Ym1hcC1vbnRvbG9neS9jY2YtZW50aXR5LWNvbnRleHQuanNvbmxkJ1xuICAgICAgICB8fCB2YWx1ZSA9PT0gJ2h0dHBzOi8vaHVibWFwY29uc29ydGl1bS5naXRodWIuaW8vaHVibWFwLW9udG9sb2d5L2NjZi1jb250ZXh0Lmpzb25sZCdcbiAgICAgICAgfHwgdmFsdWUgPT09ICdodHRwczovL2h1Ym1hcGNvbnNvcnRpdW0uZ2l0aHViLmlvL2NjZi1vbnRvbG9neS9jY2YtY29udGV4dC5qc29ubGQnXG4gICAgICAgIHx8ICh2YWx1ZSBhcyBDb250ZXh0KVsnQGJhc2UnXSA9PT0gJ2h0dHA6Ly9wdXJsLm9yZy9jY2YvbGF0ZXN0L2NjZi1lbnRpdHkub3dsIydcbiAgICApKSB7XG4gICAgICByZXR1cm4gQ0NGX0NPTlRFWFQ7XG4gICAgfVxuICAgIHJldHVybiB2YWx1ZTtcbiAgfSk7XG59XG4iXX0= \ No newline at end of file diff --git a/ccf-database/esm2015/lib/util/prefixes.js b/ccf-database/esm2015/lib/util/prefixes.js deleted file mode 100644 index 0fe0b1d65..000000000 --- a/ccf-database/esm2015/lib/util/prefixes.js +++ /dev/null @@ -1,214 +0,0 @@ -/* eslint-disable @typescript-eslint/naming-convention */ -import { DataFactory, Util } from 'triple-store-utils'; -/** Constants used to create entity accessors. */ -export const PREFIXES = { - base: 'http://purl.org/ccf/latest/ccf.owl#', - ccf: 'http://purl.org/ccf/', - fma: 'http://purl.org/sig/ont/fma/fma', - obo: 'http://purl.obolibrary.org/obo/', - uberon: 'http://purl.obolibrary.org/obo/UBERON_', - cl: 'http://purl.obolibrary.org/obo/CL_', - 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/', - dcterms: 'http://purl.org/dc/terms/' -}; -/** Prefix factory. */ -export const prefixer = Util.prefixes(PREFIXES, DataFactory); -export const rdf = { - x: prefixer('rdf'), - type: prefixer('rdf')('type') -}; -export const rdfs = { - x: prefixer('rdfs'), - label: prefixer('rdfs')('label'), - comment: prefixer('rdfs')('comment'), - isDefinedBy: prefixer('rdfs')('isDefinedBy'), - seeAlso: prefixer('rdfs')('seeAlso') -}; -/** CCF id helper. */ -const ccfx = prefixer('ccf'); -/** Common entity ids. */ -export const entity = { - id: prefixer('ccf')('has_registration_location'), - label: prefixer('rdfs')('label'), - description: prefixer('rdfs')('comment'), - link: ccfx('url'), - sex: ccfx('sex'), - age: ccfx('age'), - bmi: ccfx('bmi'), - Male: DataFactory.literal('Male'), - Female: DataFactory.literal('Female'), - consortiumName: ccfx('consortium_name'), - providerName: ccfx('tissue_provider_name'), - providerUUID: ccfx('tissue_provider_uuid'), - donor: ccfx('comes_from'), - sections: ccfx('subdivided_into_sections'), - datasets: ccfx('generates_dataset'), - sampleType: ccfx('sample_type'), - TissueBlock: DataFactory.literal('Tissue Block'), - TissueSection: DataFactory.literal('Tissue Section'), - NonStandard: DataFactory.literal('Non-standard'), - sectionCount: ccfx('section_count'), - sectionSize: ccfx('section_size'), - sectionUnits: ccfx('section_size_unit'), - sectionNumber: ccfx('section_number'), - spatialEntity: ccfx('has_registration_location'), - ontologyTerms: ccfx('has_ontology_term'), - cellTypeTerms: ccfx('has_cell_type_term'), - technology: ccfx('technology'), - thumbnail: ccfx('thumbnail') -}; -/** CCF specific ids. */ -export const ccf = { - x: ccfx, - base: prefixer('base'), - ontologyNode: { - label: ccfx('ccf_pref_label'), - parent: ccfx('ccf_part_of'), - children: ccfx('ccf_part_of'), - rui_rank: ccfx('rui_rank'), - synonymLabels: DataFactory.namedNode('http://www.geneontology.org/formats/oboInOwl#hasExactSynonym') - }, - asctb: { - part_of: ccfx('ccf_part_of'), - ct_is_a: ccfx('ccf_ct_isa'), - located_in: ccfx('ccf_located_in'), - characterizes: ccfx('ccf_characterizes') - }, - spatial: { - Female: prefixer('base')('VHFemale'), - Male: prefixer('base')('VHMale'), - BothSexes: prefixer('base')('VHBothSexes'), - FemaleOrgans: prefixer('base')('VHFemaleOrgans'), - MaleOrgans: prefixer('base')('VHMaleOrgans') - }, - SpatialObjectReference: ccfx('spatial_object_reference'), - SpatialEntity: ccfx('spatial_entity'), - SpatialPlacement: ccfx('spatial_placement'), - spatialObjectReference: { - file: ccfx('file_url'), - file_format: ccfx('file_format'), - file_subpath: ccfx('file_subpath') - }, - extractionSet: { - label: prefixer('rdfs')('label'), - rui_rank: ccfx('rui_rank') - }, - spatialEntity: { - label: prefixer('rdfs')('label'), - description: prefixer('rdfs')('comment'), - creator: prefixer('dcterms')('creator'), - creator_first_name: ccfx('creator_first_name'), - creator_last_name: ccfx('creator_last_name'), - creator_orcid: ccfx('creator_orcid'), - creation_date: prefixer('dcterms')('created'), - updated_date: ccfx('updated_date'), - ccf_annotations: ccfx('collides_with'), - representation_of: ccfx('representation_of'), - reference_organ: ccfx('has_reference_organ'), - extraction_set_for: ccfx('extraction_set_for'), - extraction_set: ccfx('has_extraction_set'), - sex: ccfx('organ_owner_sex'), - side: ccfx('organ_side'), - rui_rank: ccfx('rui_rank'), - slice_thickness: ccfx('slice_thickness'), - slice_count: ccfx('slice_count'), - x_dimension: ccfx('x_dimension'), - y_dimension: ccfx('y_dimension'), - z_dimension: ccfx('z_dimension'), - dimension_units: ccfx('dimension_unit'), - object: ccfx('has_object_reference') - }, - spatialPlacement: { - source: ccfx('placement_for'), - target: ccfx('placement_relative_to'), - placement_date: prefixer('dcterms')('created'), - x_scaling: ccfx('x_scaling'), - y_scaling: ccfx('y_scaling'), - z_scaling: ccfx('z_scaling'), - scaling_units: ccfx('scaling_unit'), - x_rotation: ccfx('x_rotation'), - y_rotation: ccfx('y_rotation'), - z_rotation: ccfx('z_rotation'), - w_rotation: ccfx('theta_rotation'), - rotation_order: ccfx('rotation_order'), - rotation_units: ccfx('rotation_unit'), - x_translation: ccfx('x_translation'), - y_translation: ccfx('y_translation'), - z_translation: ccfx('z_translation'), - translation_units: ccfx('translation_unit') - } -}; -/** Uberon specific ids. */ -export const uberon = { - x: prefixer('uberon'), - body: prefixer('uberon')('0013702') -}; -/** CL specific ids. */ -export const cl = { - x: prefixer('cl'), - cell: prefixer('cl')('0000000') -}; -/** FMA specific ids. */ -export const fma = { - x: prefixer('fma') -}; -/** LMHA specific ids. */ -export const lmha = { - x: prefixer('lmha') -}; -/** RUI accessors. */ -export const rui = { - body: uberon.body, - cell: cl.cell, - respiratory_system: uberon.x('0001004'), - colon: uberon.x('0001155'), - left_lung: uberon.x('0002168'), - right_lung: uberon.x('0002167'), - left_bronchus: uberon.x('0002178'), - right_bronchus: uberon.x('0002177'), - kidney: uberon.x('0002113'), - ureter: uberon.x('0000056'), - eye: uberon.x('0000970'), - fallopian_tube: uberon.x('0003889'), - knee: uberon.x('0001465'), - ovary: uberon.x('0000992'), - trachea: uberon.x('0003126'), - aorta: uberon.x('0000947'), - blood: uberon.x('0000178'), - bone_marrow: uberon.x('0002371'), - male_reproductive_system: uberon.x('0000079'), - lymph_node: uberon.x('0000029'), - // Derived using console.log(ALL_POSSIBLE_ORGANS.map(o => ` ${o.name.toLowerCase().replace(',', '').replace(/ /g, '_')}: ${o.id.split('/').slice(-1)[0].split('_')[0].toLowerCase()}.x('${o.id.split('_').slice(-1)[0]}'),`).join('\n')); - blood_vasculature: uberon.x('0004537'), - brain: uberon.x('0000955'), - eye_left: uberon.x('0004548'), - eye_right: fma.x('54449'), - fallopian_tube_left: uberon.x('0001303'), - fallopian_tube_right: uberon.x('0001302'), - heart: uberon.x('0000948'), - kidney_left: uberon.x('0004538'), - kidney_right: uberon.x('0004539'), - knee_left: fma.x('24978'), - knee_right: fma.x('24977'), - large_intestine: uberon.x('0000059'), - liver: uberon.x('0002107'), - lungs: uberon.x('0002048'), - mesenteric_lymph_node: uberon.x('0002509'), - ovary_left: fma.x('7214'), - ovary_right: fma.x('7213'), - pancreas: uberon.x('0001264'), - pelvis: uberon.x('0001270'), - prostate_gland: uberon.x('0002367'), - skin: uberon.x('0002097'), - small_intestine: uberon.x('0002108'), - spleen: uberon.x('0002106'), - thymus: uberon.x('0002370'), - ureter_left: uberon.x('0001223'), - ureter_right: uberon.x('0001222'), - urinary_bladder: uberon.x('0001255'), - uterus: uberon.x('0000995') -}; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJlZml4ZXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9jY2YtZGF0YWJhc2Uvc3JjL2xpYi91dGlsL3ByZWZpeGVzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLHlEQUF5RDtBQUN6RCxPQUFPLEVBQUUsV0FBVyxFQUFFLElBQUksRUFBRSxNQUFNLG9CQUFvQixDQUFDO0FBRXZELGlEQUFpRDtBQUNqRCxNQUFNLENBQUMsTUFBTSxRQUFRLEdBQUc7SUFDdEIsSUFBSSxFQUFFLHFDQUFxQztJQUMzQyxHQUFHLEVBQUUsc0JBQXNCO0lBQzNCLEdBQUcsRUFBRSxpQ0FBaUM7SUFDdEMsR0FBRyxFQUFFLGlDQUFpQztJQUN0QyxNQUFNLEVBQUUsd0NBQXdDO0lBQ2hELEVBQUUsRUFBRSxvQ0FBb0M7SUFDeEMsSUFBSSxFQUFFLHNDQUFzQztJQUM1QyxHQUFHLEVBQUUsNkNBQTZDO0lBQ2xELElBQUksRUFBRSx1Q0FBdUM7SUFDN0MsRUFBRSxFQUFFLGtDQUFrQztJQUN0QyxPQUFPLEVBQUUsMkJBQTJCO0NBQ3JDLENBQUM7QUFFRixzQkFBc0I7QUFDdEIsTUFBTSxDQUFDLE1BQU0sUUFBUSxHQUFHLElBQUksQ0FBQyxRQUFRLENBQUMsUUFBUSxFQUFFLFdBQVcsQ0FBQyxDQUFDO0FBRTdELE1BQU0sQ0FBQyxNQUFNLEdBQUcsR0FBRztJQUNqQixDQUFDLEVBQUUsUUFBUSxDQUFDLEtBQUssQ0FBQztJQUNsQixJQUFJLEVBQUUsUUFBUSxDQUFDLEtBQUssQ0FBQyxDQUFDLE1BQU0sQ0FBQztDQUM5QixDQUFDO0FBRUYsTUFBTSxDQUFDLE1BQU0sSUFBSSxHQUFHO0lBQ2xCLENBQUMsRUFBRSxRQUFRLENBQUMsTUFBTSxDQUFDO0lBQ25CLEtBQUssRUFBRSxRQUFRLENBQUMsTUFBTSxDQUFDLENBQUMsT0FBTyxDQUFDO0lBQ2hDLE9BQU8sRUFBRSxRQUFRLENBQUMsTUFBTSxDQUFDLENBQUMsU0FBUyxDQUFDO0lBQ3BDLFdBQVcsRUFBRSxRQUFRLENBQUMsTUFBTSxDQUFDLENBQUMsYUFBYSxDQUFDO0lBQzVDLE9BQU8sRUFBRSxRQUFRLENBQUMsTUFBTSxDQUFDLENBQUMsU0FBUyxDQUFDO0NBQ3JDLENBQUM7QUFFRixxQkFBcUI7QUFDckIsTUFBTSxJQUFJLEdBQUcsUUFBUSxDQUFDLEtBQUssQ0FBQyxDQUFDO0FBRTdCLHlCQUF5QjtBQUN6QixNQUFNLENBQUMsTUFBTSxNQUFNLEdBQUc7SUFDcEIsRUFBRSxFQUFFLFFBQVEsQ0FBQyxLQUFLLENBQUMsQ0FBQywyQkFBMkIsQ0FBQztJQUNoRCxLQUFLLEVBQUUsUUFBUSxDQUFDLE1BQU0sQ0FBQyxDQUFDLE9BQU8sQ0FBQztJQUNoQyxXQUFXLEVBQUUsUUFBUSxDQUFDLE1BQU0sQ0FBQyxDQUFDLFNBQVMsQ0FBQztJQUN4QyxJQUFJLEVBQUUsSUFBSSxDQUFDLEtBQUssQ0FBQztJQUVqQixHQUFHLEVBQUUsSUFBSSxDQUFDLEtBQUssQ0FBQztJQUNoQixHQUFHLEVBQUUsSUFBSSxDQUFDLEtBQUssQ0FBQztJQUNoQixHQUFHLEVBQUUsSUFBSSxDQUFDLEtBQUssQ0FBQztJQUVoQixJQUFJLEVBQUUsV0FBVyxDQUFDLE9BQU8sQ0FBQyxNQUFNLENBQUM7SUFDakMsTUFBTSxFQUFFLFdBQVcsQ0FBQyxPQUFPLENBQUMsUUFBUSxDQUFDO0lBRXJDLGNBQWMsRUFBRSxJQUFJLENBQUMsaUJBQWlCLENBQUM7SUFDdkMsWUFBWSxFQUFFLElBQUksQ0FBQyxzQkFBc0IsQ0FBQztJQUMxQyxZQUFZLEVBQUUsSUFBSSxDQUFDLHNCQUFzQixDQUFDO0lBRTFDLEtBQUssRUFBRSxJQUFJLENBQUMsWUFBWSxDQUFDO0lBRXpCLFFBQVEsRUFBRSxJQUFJLENBQUMsMEJBQTBCLENBQUM7SUFDMUMsUUFBUSxFQUFFLElBQUksQ0FBQyxtQkFBbUIsQ0FBQztJQUVuQyxVQUFVLEVBQUUsSUFBSSxDQUFDLGFBQWEsQ0FBQztJQUUvQixXQUFXLEVBQUUsV0FBVyxDQUFDLE9BQU8sQ0FBQyxjQUFjLENBQUM7SUFDaEQsYUFBYSxFQUFFLFdBQVcsQ0FBQyxPQUFPLENBQUMsZ0JBQWdCLENBQUM7SUFDcEQsV0FBVyxFQUFFLFdBQVcsQ0FBQyxPQUFPLENBQUMsY0FBYyxDQUFDO0lBRWhELFlBQVksRUFBRSxJQUFJLENBQUMsZUFBZSxDQUFDO0lBQ25DLFdBQVcsRUFBRSxJQUFJLENBQUMsY0FBYyxDQUFDO0lBQ2pDLFlBQVksRUFBRSxJQUFJLENBQUMsbUJBQW1CLENBQUM7SUFDdkMsYUFBYSxFQUFFLElBQUksQ0FBQyxnQkFBZ0IsQ0FBQztJQUVyQyxhQUFhLEVBQUUsSUFBSSxDQUFDLDJCQUEyQixDQUFDO0lBQ2hELGFBQWEsRUFBRSxJQUFJLENBQUMsbUJBQW1CLENBQUM7SUFDeEMsYUFBYSxFQUFFLElBQUksQ0FBQyxvQkFBb0IsQ0FBQztJQUV6QyxVQUFVLEVBQUUsSUFBSSxDQUFDLFlBQVksQ0FBQztJQUM5QixTQUFTLEVBQUUsSUFBSSxDQUFDLFdBQVcsQ0FBQztDQUM3QixDQUFDO0FBRUYsd0JBQXdCO0FBQ3hCLE1BQU0sQ0FBQyxNQUFNLEdBQUcsR0FBRztJQUNqQixDQUFDLEVBQUUsSUFBSTtJQUNQLElBQUksRUFBRSxRQUFRLENBQUMsTUFBTSxDQUFDO0lBQ3RCLFlBQVksRUFBRTtRQUNaLEtBQUssRUFBRSxJQUFJLENBQUMsZ0JBQWdCLENBQUM7UUFDN0IsTUFBTSxFQUFFLElBQUksQ0FBQyxhQUFhLENBQUM7UUFDM0IsUUFBUSxFQUFFLElBQUksQ0FBQyxhQUFhLENBQUM7UUFDN0IsUUFBUSxFQUFFLElBQUksQ0FBQyxVQUFVLENBQUM7UUFDMUIsYUFBYSxFQUFFLFdBQVcsQ0FBQyxTQUFTLENBQUMsOERBQThELENBQUM7S0FDckc7SUFDRCxLQUFLLEVBQUU7UUFDTCxPQUFPLEVBQUUsSUFBSSxDQUFDLGFBQWEsQ0FBQztRQUM1QixPQUFPLEVBQUUsSUFBSSxDQUFDLFlBQVksQ0FBQztRQUMzQixVQUFVLEVBQUUsSUFBSSxDQUFDLGdCQUFnQixDQUFDO1FBQ2xDLGFBQWEsRUFBRSxJQUFJLENBQUMsbUJBQW1CLENBQUM7S0FDekM7SUFDRCxPQUFPLEVBQUU7UUFDUCxNQUFNLEVBQUUsUUFBUSxDQUFDLE1BQU0sQ0FBQyxDQUFDLFVBQVUsQ0FBQztRQUNwQyxJQUFJLEVBQUUsUUFBUSxDQUFDLE1BQU0sQ0FBQyxDQUFDLFFBQVEsQ0FBQztRQUNoQyxTQUFTLEVBQUUsUUFBUSxDQUFDLE1BQU0sQ0FBQyxDQUFDLGFBQWEsQ0FBQztRQUMxQyxZQUFZLEVBQUUsUUFBUSxDQUFDLE1BQU0sQ0FBQyxDQUFDLGdCQUFnQixDQUFDO1FBQ2hELFVBQVUsRUFBRSxRQUFRLENBQUMsTUFBTSxDQUFDLENBQUMsY0FBYyxDQUFDO0tBQzdDO0lBQ0Qsc0JBQXNCLEVBQUUsSUFBSSxDQUFDLDBCQUEwQixDQUFDO0lBQ3hELGFBQWEsRUFBRSxJQUFJLENBQUMsZ0JBQWdCLENBQUM7SUFDckMsZ0JBQWdCLEVBQUUsSUFBSSxDQUFDLG1CQUFtQixDQUFDO0lBQzNDLHNCQUFzQixFQUFFO1FBQ3RCLElBQUksRUFBRSxJQUFJLENBQUMsVUFBVSxDQUFDO1FBQ3RCLFdBQVcsRUFBRSxJQUFJLENBQUMsYUFBYSxDQUFDO1FBQ2hDLFlBQVksRUFBRSxJQUFJLENBQUMsY0FBYyxDQUFDO0tBQ25DO0lBQ0QsYUFBYSxFQUFFO1FBQ2IsS0FBSyxFQUFFLFFBQVEsQ0FBQyxNQUFNLENBQUMsQ0FBQyxPQUFPLENBQUM7UUFDaEMsUUFBUSxFQUFFLElBQUksQ0FBQyxVQUFVLENBQUM7S0FDM0I7SUFDRCxhQUFhLEVBQUU7UUFDYixLQUFLLEVBQUUsUUFBUSxDQUFDLE1BQU0sQ0FBQyxDQUFDLE9BQU8sQ0FBQztRQUNoQyxXQUFXLEVBQUUsUUFBUSxDQUFDLE1BQU0sQ0FBQyxDQUFDLFNBQVMsQ0FBQztRQUN4QyxPQUFPLEVBQUUsUUFBUSxDQUFDLFNBQVMsQ0FBQyxDQUFDLFNBQVMsQ0FBQztRQUN2QyxrQkFBa0IsRUFBRSxJQUFJLENBQUMsb0JBQW9CLENBQUM7UUFDOUMsaUJBQWlCLEVBQUUsSUFBSSxDQUFDLG1CQUFtQixDQUFDO1FBQzVDLGFBQWEsRUFBRSxJQUFJLENBQUMsZUFBZSxDQUFDO1FBQ3BDLGFBQWEsRUFBRSxRQUFRLENBQUMsU0FBUyxDQUFDLENBQUMsU0FBUyxDQUFDO1FBQzdDLFlBQVksRUFBRSxJQUFJLENBQUMsY0FBYyxDQUFDO1FBQ2xDLGVBQWUsRUFBRSxJQUFJLENBQUMsZUFBZSxDQUFDO1FBQ3RDLGlCQUFpQixFQUFFLElBQUksQ0FBQyxtQkFBbUIsQ0FBQztRQUM1QyxlQUFlLEVBQUUsSUFBSSxDQUFDLHFCQUFxQixDQUFDO1FBQzVDLGtCQUFrQixFQUFFLElBQUksQ0FBQyxvQkFBb0IsQ0FBQztRQUM5QyxjQUFjLEVBQUUsSUFBSSxDQUFDLG9CQUFvQixDQUFDO1FBQzFDLEdBQUcsRUFBRSxJQUFJLENBQUMsaUJBQWlCLENBQUM7UUFDNUIsSUFBSSxFQUFFLElBQUksQ0FBQyxZQUFZLENBQUM7UUFDeEIsUUFBUSxFQUFFLElBQUksQ0FBQyxVQUFVLENBQUM7UUFDMUIsZUFBZSxFQUFFLElBQUksQ0FBQyxpQkFBaUIsQ0FBQztRQUN4QyxXQUFXLEVBQUUsSUFBSSxDQUFDLGFBQWEsQ0FBQztRQUNoQyxXQUFXLEVBQUUsSUFBSSxDQUFDLGFBQWEsQ0FBQztRQUNoQyxXQUFXLEVBQUUsSUFBSSxDQUFDLGFBQWEsQ0FBQztRQUNoQyxXQUFXLEVBQUUsSUFBSSxDQUFDLGFBQWEsQ0FBQztRQUNoQyxlQUFlLEVBQUUsSUFBSSxDQUFDLGdCQUFnQixDQUFDO1FBQ3ZDLE1BQU0sRUFBRSxJQUFJLENBQUMsc0JBQXNCLENBQUM7S0FDckM7SUFDRCxnQkFBZ0IsRUFBRTtRQUNoQixNQUFNLEVBQUUsSUFBSSxDQUFDLGVBQWUsQ0FBQztRQUM3QixNQUFNLEVBQUUsSUFBSSxDQUFDLHVCQUF1QixDQUFDO1FBRXJDLGNBQWMsRUFBRSxRQUFRLENBQUMsU0FBUyxDQUFDLENBQUMsU0FBUyxDQUFDO1FBQzlDLFNBQVMsRUFBRSxJQUFJLENBQUMsV0FBVyxDQUFDO1FBQzVCLFNBQVMsRUFBRSxJQUFJLENBQUMsV0FBVyxDQUFDO1FBQzVCLFNBQVMsRUFBRSxJQUFJLENBQUMsV0FBVyxDQUFDO1FBQzVCLGFBQWEsRUFBRSxJQUFJLENBQUMsY0FBYyxDQUFDO1FBRW5DLFVBQVUsRUFBRSxJQUFJLENBQUMsWUFBWSxDQUFDO1FBQzlCLFVBQVUsRUFBRSxJQUFJLENBQUMsWUFBWSxDQUFDO1FBQzlCLFVBQVUsRUFBRSxJQUFJLENBQUMsWUFBWSxDQUFDO1FBQzlCLFVBQVUsRUFBRSxJQUFJLENBQUMsZ0JBQWdCLENBQUM7UUFDbEMsY0FBYyxFQUFFLElBQUksQ0FBQyxnQkFBZ0IsQ0FBQztRQUN0QyxjQUFjLEVBQUUsSUFBSSxDQUFDLGVBQWUsQ0FBQztRQUVyQyxhQUFhLEVBQUUsSUFBSSxDQUFDLGVBQWUsQ0FBQztRQUNwQyxhQUFhLEVBQUUsSUFBSSxDQUFDLGVBQWUsQ0FBQztRQUNwQyxhQUFhLEVBQUUsSUFBSSxDQUFDLGVBQWUsQ0FBQztRQUNwQyxpQkFBaUIsRUFBRSxJQUFJLENBQUMsa0JBQWtCLENBQUM7S0FDNUM7Q0FDRixDQUFDO0FBRUYsMkJBQTJCO0FBQzNCLE1BQU0sQ0FBQyxNQUFNLE1BQU0sR0FBRztJQUNwQixDQUFDLEVBQUUsUUFBUSxDQUFDLFFBQVEsQ0FBQztJQUNyQixJQUFJLEVBQUUsUUFBUSxDQUFDLFFBQVEsQ0FBQyxDQUFDLFNBQVMsQ0FBQztDQUNwQyxDQUFDO0FBRUYsdUJBQXVCO0FBQ3ZCLE1BQU0sQ0FBQyxNQUFNLEVBQUUsR0FBRztJQUNoQixDQUFDLEVBQUUsUUFBUSxDQUFDLElBQUksQ0FBQztJQUNqQixJQUFJLEVBQUUsUUFBUSxDQUFDLElBQUksQ0FBQyxDQUFDLFNBQVMsQ0FBQztDQUNoQyxDQUFDO0FBRUYsd0JBQXdCO0FBQ3hCLE1BQU0sQ0FBQyxNQUFNLEdBQUcsR0FBRztJQUNqQixDQUFDLEVBQUUsUUFBUSxDQUFDLEtBQUssQ0FBQztDQUNuQixDQUFDO0FBRUYseUJBQXlCO0FBQ3pCLE1BQU0sQ0FBQyxNQUFNLElBQUksR0FBRztJQUNsQixDQUFDLEVBQUUsUUFBUSxDQUFDLE1BQU0sQ0FBQztDQUNwQixDQUFDO0FBRUYscUJBQXFCO0FBQ3JCLE1BQU0sQ0FBQyxNQUFNLEdBQUcsR0FBRztJQUNqQixJQUFJLEVBQUUsTUFBTSxDQUFDLElBQUk7SUFDakIsSUFBSSxFQUFFLEVBQUUsQ0FBQyxJQUFJO0lBQ2Isa0JBQWtCLEVBQUUsTUFBTSxDQUFDLENBQUMsQ0FBQyxTQUFTLENBQUM7SUFDdkMsS0FBSyxFQUFFLE1BQU0sQ0FBQyxDQUFDLENBQUMsU0FBUyxDQUFDO0lBQzFCLFNBQVMsRUFBRSxNQUFNLENBQUMsQ0FBQyxDQUFDLFNBQVMsQ0FBQztJQUM5QixVQUFVLEVBQUUsTUFBTSxDQUFDLENBQUMsQ0FBQyxTQUFTLENBQUM7SUFDL0IsYUFBYSxFQUFFLE1BQU0sQ0FBQyxDQUFDLENBQUMsU0FBUyxDQUFDO0lBQ2xDLGNBQWMsRUFBRSxNQUFNLENBQUMsQ0FBQyxDQUFDLFNBQVMsQ0FBQztJQUNuQyxNQUFNLEVBQUUsTUFBTSxDQUFDLENBQUMsQ0FBQyxTQUFTLENBQUM7SUFDM0IsTUFBTSxFQUFFLE1BQU0sQ0FBQyxDQUFDLENBQUMsU0FBUyxDQUFDO0lBQzNCLEdBQUcsRUFBRSxNQUFNLENBQUMsQ0FBQyxDQUFDLFNBQVMsQ0FBQztJQUN4QixjQUFjLEVBQUUsTUFBTSxDQUFDLENBQUMsQ0FBQyxTQUFTLENBQUM7SUFDbkMsSUFBSSxFQUFFLE1BQU0sQ0FBQyxDQUFDLENBQUMsU0FBUyxDQUFDO0lBQ3pCLEtBQUssRUFBRSxNQUFNLENBQUMsQ0FBQyxDQUFDLFNBQVMsQ0FBQztJQUMxQixPQUFPLEVBQUUsTUFBTSxDQUFDLENBQUMsQ0FBQyxTQUFTLENBQUM7SUFDNUIsS0FBSyxFQUFFLE1BQU0sQ0FBQyxDQUFDLENBQUMsU0FBUyxDQUFDO0lBQzFCLEtBQUssRUFBRSxNQUFNLENBQUMsQ0FBQyxDQUFDLFNBQVMsQ0FBQztJQUMxQixXQUFXLEVBQUUsTUFBTSxDQUFDLENBQUMsQ0FBQyxTQUFTLENBQUM7SUFDaEMsd0JBQXdCLEVBQUUsTUFBTSxDQUFDLENBQUMsQ0FBQyxTQUFTLENBQUM7SUFDN0MsVUFBVSxFQUFFLE1BQU0sQ0FBQyxDQUFDLENBQUMsU0FBUyxDQUFDO0lBRS9CLDBPQUEwTztJQUMxTyxpQkFBaUIsRUFBRSxNQUFNLENBQUMsQ0FBQyxDQUFDLFNBQVMsQ0FBQztJQUN0QyxLQUFLLEVBQUUsTUFBTSxDQUFDLENBQUMsQ0FBQyxTQUFTLENBQUM7SUFDMUIsUUFBUSxFQUFFLE1BQU0sQ0FBQyxDQUFDLENBQUMsU0FBUyxDQUFDO0lBQzdCLFNBQVMsRUFBRSxHQUFHLENBQUMsQ0FBQyxDQUFDLE9BQU8sQ0FBQztJQUN6QixtQkFBbUIsRUFBRSxNQUFNLENBQUMsQ0FBQyxDQUFDLFNBQVMsQ0FBQztJQUN4QyxvQkFBb0IsRUFBRSxNQUFNLENBQUMsQ0FBQyxDQUFDLFNBQVMsQ0FBQztJQUN6QyxLQUFLLEVBQUUsTUFBTSxDQUFDLENBQUMsQ0FBQyxTQUFTLENBQUM7SUFDMUIsV0FBVyxFQUFFLE1BQU0sQ0FBQyxDQUFDLENBQUMsU0FBUyxDQUFDO0lBQ2hDLFlBQVksRUFBRSxNQUFNLENBQUMsQ0FBQyxDQUFDLFNBQVMsQ0FBQztJQUNqQyxTQUFTLEVBQUUsR0FBRyxDQUFDLENBQUMsQ0FBQyxPQUFPLENBQUM7SUFDekIsVUFBVSxFQUFFLEdBQUcsQ0FBQyxDQUFDLENBQUMsT0FBTyxDQUFDO0lBQzFCLGVBQWUsRUFBRSxNQUFNLENBQUMsQ0FBQyxDQUFDLFNBQVMsQ0FBQztJQUNwQyxLQUFLLEVBQUUsTUFBTSxDQUFDLENBQUMsQ0FBQyxTQUFTLENBQUM7SUFDMUIsS0FBSyxFQUFFLE1BQU0sQ0FBQyxDQUFDLENBQUMsU0FBUyxDQUFDO0lBQzFCLHFCQUFxQixFQUFFLE1BQU0sQ0FBQyxDQUFDLENBQUMsU0FBUyxDQUFDO0lBQzFDLFVBQVUsRUFBRSxHQUFHLENBQUMsQ0FBQyxDQUFDLE1BQU0sQ0FBQztJQUN6QixXQUFXLEVBQUUsR0FBRyxDQUFDLENBQUMsQ0FBQyxNQUFNLENBQUM7SUFDMUIsUUFBUSxFQUFFLE1BQU0sQ0FBQyxDQUFDLENBQUMsU0FBUyxDQUFDO0lBQzdCLE1BQU0sRUFBRSxNQUFNLENBQUMsQ0FBQyxDQUFDLFNBQVMsQ0FBQztJQUMzQixjQUFjLEVBQUUsTUFBTSxDQUFDLENBQUMsQ0FBQyxTQUFTLENBQUM7SUFDbkMsSUFBSSxFQUFFLE1BQU0sQ0FBQyxDQUFDLENBQUMsU0FBUyxDQUFDO0lBQ3pCLGVBQWUsRUFBRSxNQUFNLENBQUMsQ0FBQyxDQUFDLFNBQVMsQ0FBQztJQUNwQyxNQUFNLEVBQUUsTUFBTSxDQUFDLENBQUMsQ0FBQyxTQUFTLENBQUM7SUFDM0IsTUFBTSxFQUFFLE1BQU0sQ0FBQyxDQUFDLENBQUMsU0FBUyxDQUFDO0lBQzNCLFdBQVcsRUFBRSxNQUFNLENBQUMsQ0FBQyxDQUFDLFNBQVMsQ0FBQztJQUNoQyxZQUFZLEVBQUUsTUFBTSxDQUFDLENBQUMsQ0FBQyxTQUFTLENBQUM7SUFDakMsZUFBZSxFQUFFLE1BQU0sQ0FBQyxDQUFDLENBQUMsU0FBUyxDQUFDO0lBQ3BDLE1BQU0sRUFBRSxNQUFNLENBQUMsQ0FBQyxDQUFDLFNBQVMsQ0FBQztDQUM1QixDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLyogZXNsaW50LWRpc2FibGUgQHR5cGVzY3JpcHQtZXNsaW50L25hbWluZy1jb252ZW50aW9uICovXG5pbXBvcnQgeyBEYXRhRmFjdG9yeSwgVXRpbCB9IGZyb20gJ3RyaXBsZS1zdG9yZS11dGlscyc7XG5cbi8qKiBDb25zdGFudHMgdXNlZCB0byBjcmVhdGUgZW50aXR5IGFjY2Vzc29ycy4gKi9cbmV4cG9ydCBjb25zdCBQUkVGSVhFUyA9IHtcbiAgYmFzZTogJ2h0dHA6Ly9wdXJsLm9yZy9jY2YvbGF0ZXN0L2NjZi5vd2wjJyxcbiAgY2NmOiAnaHR0cDovL3B1cmwub3JnL2NjZi8nLFxuICBmbWE6ICdodHRwOi8vcHVybC5vcmcvc2lnL29udC9mbWEvZm1hJyxcbiAgb2JvOiAnaHR0cDovL3B1cmwub2JvbGlicmFyeS5vcmcvb2JvLycsXG4gIHViZXJvbjogJ2h0dHA6Ly9wdXJsLm9ib2xpYnJhcnkub3JnL29iby9VQkVST05fJyxcbiAgY2w6ICdodHRwOi8vcHVybC5vYm9saWJyYXJ5Lm9yZy9vYm8vQ0xfJyxcbiAgbG1oYTogJ2h0dHA6Ly9wdXJsLm9ib2xpYnJhcnkub3JnL29iby9MTUhBXycsXG4gIHJkZjogJ2h0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMnLFxuICByZGZzOiAnaHR0cDovL3d3dy53My5vcmcvMjAwMC8wMS9yZGYtc2NoZW1hIycsXG4gIGRjOiAnaHR0cDovL3B1cmwub3JnL2RjL2VsZW1lbnRzLzEuMS8nLFxuICBkY3Rlcm1zOiAnaHR0cDovL3B1cmwub3JnL2RjL3Rlcm1zLydcbn07XG5cbi8qKiBQcmVmaXggZmFjdG9yeS4gKi9cbmV4cG9ydCBjb25zdCBwcmVmaXhlciA9IFV0aWwucHJlZml4ZXMoUFJFRklYRVMsIERhdGFGYWN0b3J5KTtcblxuZXhwb3J0IGNvbnN0IHJkZiA9IHtcbiAgeDogcHJlZml4ZXIoJ3JkZicpLFxuICB0eXBlOiBwcmVmaXhlcigncmRmJykoJ3R5cGUnKVxufTtcblxuZXhwb3J0IGNvbnN0IHJkZnMgPSB7XG4gIHg6IHByZWZpeGVyKCdyZGZzJyksXG4gIGxhYmVsOiBwcmVmaXhlcigncmRmcycpKCdsYWJlbCcpLFxuICBjb21tZW50OiBwcmVmaXhlcigncmRmcycpKCdjb21tZW50JyksXG4gIGlzRGVmaW5lZEJ5OiBwcmVmaXhlcigncmRmcycpKCdpc0RlZmluZWRCeScpLFxuICBzZWVBbHNvOiBwcmVmaXhlcigncmRmcycpKCdzZWVBbHNvJylcbn07XG5cbi8qKiBDQ0YgaWQgaGVscGVyLiAqL1xuY29uc3QgY2NmeCA9IHByZWZpeGVyKCdjY2YnKTtcblxuLyoqIENvbW1vbiBlbnRpdHkgaWRzLiAqL1xuZXhwb3J0IGNvbnN0IGVudGl0eSA9IHtcbiAgaWQ6IHByZWZpeGVyKCdjY2YnKSgnaGFzX3JlZ2lzdHJhdGlvbl9sb2NhdGlvbicpLFxuICBsYWJlbDogcHJlZml4ZXIoJ3JkZnMnKSgnbGFiZWwnKSxcbiAgZGVzY3JpcHRpb246IHByZWZpeGVyKCdyZGZzJykoJ2NvbW1lbnQnKSxcbiAgbGluazogY2NmeCgndXJsJyksXG5cbiAgc2V4OiBjY2Z4KCdzZXgnKSxcbiAgYWdlOiBjY2Z4KCdhZ2UnKSxcbiAgYm1pOiBjY2Z4KCdibWknKSxcblxuICBNYWxlOiBEYXRhRmFjdG9yeS5saXRlcmFsKCdNYWxlJyksXG4gIEZlbWFsZTogRGF0YUZhY3RvcnkubGl0ZXJhbCgnRmVtYWxlJyksXG5cbiAgY29uc29ydGl1bU5hbWU6IGNjZngoJ2NvbnNvcnRpdW1fbmFtZScpLFxuICBwcm92aWRlck5hbWU6IGNjZngoJ3Rpc3N1ZV9wcm92aWRlcl9uYW1lJyksXG4gIHByb3ZpZGVyVVVJRDogY2NmeCgndGlzc3VlX3Byb3ZpZGVyX3V1aWQnKSxcblxuICBkb25vcjogY2NmeCgnY29tZXNfZnJvbScpLFxuXG4gIHNlY3Rpb25zOiBjY2Z4KCdzdWJkaXZpZGVkX2ludG9fc2VjdGlvbnMnKSxcbiAgZGF0YXNldHM6IGNjZngoJ2dlbmVyYXRlc19kYXRhc2V0JyksXG5cbiAgc2FtcGxlVHlwZTogY2NmeCgnc2FtcGxlX3R5cGUnKSxcblxuICBUaXNzdWVCbG9jazogRGF0YUZhY3RvcnkubGl0ZXJhbCgnVGlzc3VlIEJsb2NrJyksXG4gIFRpc3N1ZVNlY3Rpb246IERhdGFGYWN0b3J5LmxpdGVyYWwoJ1Rpc3N1ZSBTZWN0aW9uJyksXG4gIE5vblN0YW5kYXJkOiBEYXRhRmFjdG9yeS5saXRlcmFsKCdOb24tc3RhbmRhcmQnKSxcblxuICBzZWN0aW9uQ291bnQ6IGNjZngoJ3NlY3Rpb25fY291bnQnKSxcbiAgc2VjdGlvblNpemU6IGNjZngoJ3NlY3Rpb25fc2l6ZScpLFxuICBzZWN0aW9uVW5pdHM6IGNjZngoJ3NlY3Rpb25fc2l6ZV91bml0JyksXG4gIHNlY3Rpb25OdW1iZXI6IGNjZngoJ3NlY3Rpb25fbnVtYmVyJyksXG5cbiAgc3BhdGlhbEVudGl0eTogY2NmeCgnaGFzX3JlZ2lzdHJhdGlvbl9sb2NhdGlvbicpLFxuICBvbnRvbG9neVRlcm1zOiBjY2Z4KCdoYXNfb250b2xvZ3lfdGVybScpLFxuICBjZWxsVHlwZVRlcm1zOiBjY2Z4KCdoYXNfY2VsbF90eXBlX3Rlcm0nKSxcblxuICB0ZWNobm9sb2d5OiBjY2Z4KCd0ZWNobm9sb2d5JyksXG4gIHRodW1ibmFpbDogY2NmeCgndGh1bWJuYWlsJylcbn07XG5cbi8qKiBDQ0Ygc3BlY2lmaWMgaWRzLiAqL1xuZXhwb3J0IGNvbnN0IGNjZiA9IHtcbiAgeDogY2NmeCxcbiAgYmFzZTogcHJlZml4ZXIoJ2Jhc2UnKSxcbiAgb250b2xvZ3lOb2RlOiB7XG4gICAgbGFiZWw6IGNjZngoJ2NjZl9wcmVmX2xhYmVsJyksXG4gICAgcGFyZW50OiBjY2Z4KCdjY2ZfcGFydF9vZicpLFxuICAgIGNoaWxkcmVuOiBjY2Z4KCdjY2ZfcGFydF9vZicpLFxuICAgIHJ1aV9yYW5rOiBjY2Z4KCdydWlfcmFuaycpLFxuICAgIHN5bm9ueW1MYWJlbHM6IERhdGFGYWN0b3J5Lm5hbWVkTm9kZSgnaHR0cDovL3d3dy5nZW5lb250b2xvZ3kub3JnL2Zvcm1hdHMvb2JvSW5Pd2wjaGFzRXhhY3RTeW5vbnltJylcbiAgfSxcbiAgYXNjdGI6IHtcbiAgICBwYXJ0X29mOiBjY2Z4KCdjY2ZfcGFydF9vZicpLFxuICAgIGN0X2lzX2E6IGNjZngoJ2NjZl9jdF9pc2EnKSxcbiAgICBsb2NhdGVkX2luOiBjY2Z4KCdjY2ZfbG9jYXRlZF9pbicpLFxuICAgIGNoYXJhY3Rlcml6ZXM6IGNjZngoJ2NjZl9jaGFyYWN0ZXJpemVzJylcbiAgfSxcbiAgc3BhdGlhbDoge1xuICAgIEZlbWFsZTogcHJlZml4ZXIoJ2Jhc2UnKSgnVkhGZW1hbGUnKSxcbiAgICBNYWxlOiBwcmVmaXhlcignYmFzZScpKCdWSE1hbGUnKSxcbiAgICBCb3RoU2V4ZXM6IHByZWZpeGVyKCdiYXNlJykoJ1ZIQm90aFNleGVzJyksXG4gICAgRmVtYWxlT3JnYW5zOiBwcmVmaXhlcignYmFzZScpKCdWSEZlbWFsZU9yZ2FucycpLFxuICAgIE1hbGVPcmdhbnM6IHByZWZpeGVyKCdiYXNlJykoJ1ZITWFsZU9yZ2FucycpXG4gIH0sXG4gIFNwYXRpYWxPYmplY3RSZWZlcmVuY2U6IGNjZngoJ3NwYXRpYWxfb2JqZWN0X3JlZmVyZW5jZScpLFxuICBTcGF0aWFsRW50aXR5OiBjY2Z4KCdzcGF0aWFsX2VudGl0eScpLFxuICBTcGF0aWFsUGxhY2VtZW50OiBjY2Z4KCdzcGF0aWFsX3BsYWNlbWVudCcpLFxuICBzcGF0aWFsT2JqZWN0UmVmZXJlbmNlOiB7XG4gICAgZmlsZTogY2NmeCgnZmlsZV91cmwnKSxcbiAgICBmaWxlX2Zvcm1hdDogY2NmeCgnZmlsZV9mb3JtYXQnKSxcbiAgICBmaWxlX3N1YnBhdGg6IGNjZngoJ2ZpbGVfc3VicGF0aCcpXG4gIH0sXG4gIGV4dHJhY3Rpb25TZXQ6IHtcbiAgICBsYWJlbDogcHJlZml4ZXIoJ3JkZnMnKSgnbGFiZWwnKSxcbiAgICBydWlfcmFuazogY2NmeCgncnVpX3JhbmsnKVxuICB9LFxuICBzcGF0aWFsRW50aXR5OiB7XG4gICAgbGFiZWw6IHByZWZpeGVyKCdyZGZzJykoJ2xhYmVsJyksXG4gICAgZGVzY3JpcHRpb246IHByZWZpeGVyKCdyZGZzJykoJ2NvbW1lbnQnKSxcbiAgICBjcmVhdG9yOiBwcmVmaXhlcignZGN0ZXJtcycpKCdjcmVhdG9yJyksXG4gICAgY3JlYXRvcl9maXJzdF9uYW1lOiBjY2Z4KCdjcmVhdG9yX2ZpcnN0X25hbWUnKSxcbiAgICBjcmVhdG9yX2xhc3RfbmFtZTogY2NmeCgnY3JlYXRvcl9sYXN0X25hbWUnKSxcbiAgICBjcmVhdG9yX29yY2lkOiBjY2Z4KCdjcmVhdG9yX29yY2lkJyksXG4gICAgY3JlYXRpb25fZGF0ZTogcHJlZml4ZXIoJ2RjdGVybXMnKSgnY3JlYXRlZCcpLFxuICAgIHVwZGF0ZWRfZGF0ZTogY2NmeCgndXBkYXRlZF9kYXRlJyksXG4gICAgY2NmX2Fubm90YXRpb25zOiBjY2Z4KCdjb2xsaWRlc193aXRoJyksXG4gICAgcmVwcmVzZW50YXRpb25fb2Y6IGNjZngoJ3JlcHJlc2VudGF0aW9uX29mJyksXG4gICAgcmVmZXJlbmNlX29yZ2FuOiBjY2Z4KCdoYXNfcmVmZXJlbmNlX29yZ2FuJyksXG4gICAgZXh0cmFjdGlvbl9zZXRfZm9yOiBjY2Z4KCdleHRyYWN0aW9uX3NldF9mb3InKSxcbiAgICBleHRyYWN0aW9uX3NldDogY2NmeCgnaGFzX2V4dHJhY3Rpb25fc2V0JyksXG4gICAgc2V4OiBjY2Z4KCdvcmdhbl9vd25lcl9zZXgnKSxcbiAgICBzaWRlOiBjY2Z4KCdvcmdhbl9zaWRlJyksXG4gICAgcnVpX3Jhbms6IGNjZngoJ3J1aV9yYW5rJyksXG4gICAgc2xpY2VfdGhpY2tuZXNzOiBjY2Z4KCdzbGljZV90aGlja25lc3MnKSxcbiAgICBzbGljZV9jb3VudDogY2NmeCgnc2xpY2VfY291bnQnKSxcbiAgICB4X2RpbWVuc2lvbjogY2NmeCgneF9kaW1lbnNpb24nKSxcbiAgICB5X2RpbWVuc2lvbjogY2NmeCgneV9kaW1lbnNpb24nKSxcbiAgICB6X2RpbWVuc2lvbjogY2NmeCgnel9kaW1lbnNpb24nKSxcbiAgICBkaW1lbnNpb25fdW5pdHM6IGNjZngoJ2RpbWVuc2lvbl91bml0JyksXG4gICAgb2JqZWN0OiBjY2Z4KCdoYXNfb2JqZWN0X3JlZmVyZW5jZScpXG4gIH0sXG4gIHNwYXRpYWxQbGFjZW1lbnQ6IHtcbiAgICBzb3VyY2U6IGNjZngoJ3BsYWNlbWVudF9mb3InKSxcbiAgICB0YXJnZXQ6IGNjZngoJ3BsYWNlbWVudF9yZWxhdGl2ZV90bycpLFxuXG4gICAgcGxhY2VtZW50X2RhdGU6IHByZWZpeGVyKCdkY3Rlcm1zJykoJ2NyZWF0ZWQnKSxcbiAgICB4X3NjYWxpbmc6IGNjZngoJ3hfc2NhbGluZycpLFxuICAgIHlfc2NhbGluZzogY2NmeCgneV9zY2FsaW5nJyksXG4gICAgel9zY2FsaW5nOiBjY2Z4KCd6X3NjYWxpbmcnKSxcbiAgICBzY2FsaW5nX3VuaXRzOiBjY2Z4KCdzY2FsaW5nX3VuaXQnKSxcblxuICAgIHhfcm90YXRpb246IGNjZngoJ3hfcm90YXRpb24nKSxcbiAgICB5X3JvdGF0aW9uOiBjY2Z4KCd5X3JvdGF0aW9uJyksXG4gICAgel9yb3RhdGlvbjogY2NmeCgnel9yb3RhdGlvbicpLFxuICAgIHdfcm90YXRpb246IGNjZngoJ3RoZXRhX3JvdGF0aW9uJyksXG4gICAgcm90YXRpb25fb3JkZXI6IGNjZngoJ3JvdGF0aW9uX29yZGVyJyksXG4gICAgcm90YXRpb25fdW5pdHM6IGNjZngoJ3JvdGF0aW9uX3VuaXQnKSxcblxuICAgIHhfdHJhbnNsYXRpb246IGNjZngoJ3hfdHJhbnNsYXRpb24nKSxcbiAgICB5X3RyYW5zbGF0aW9uOiBjY2Z4KCd5X3RyYW5zbGF0aW9uJyksXG4gICAgel90cmFuc2xhdGlvbjogY2NmeCgnel90cmFuc2xhdGlvbicpLFxuICAgIHRyYW5zbGF0aW9uX3VuaXRzOiBjY2Z4KCd0cmFuc2xhdGlvbl91bml0JylcbiAgfVxufTtcblxuLyoqIFViZXJvbiBzcGVjaWZpYyBpZHMuICovXG5leHBvcnQgY29uc3QgdWJlcm9uID0ge1xuICB4OiBwcmVmaXhlcigndWJlcm9uJyksXG4gIGJvZHk6IHByZWZpeGVyKCd1YmVyb24nKSgnMDAxMzcwMicpXG59O1xuXG4vKiogQ0wgc3BlY2lmaWMgaWRzLiAqL1xuZXhwb3J0IGNvbnN0IGNsID0ge1xuICB4OiBwcmVmaXhlcignY2wnKSxcbiAgY2VsbDogcHJlZml4ZXIoJ2NsJykoJzAwMDAwMDAnKVxufTtcblxuLyoqIEZNQSBzcGVjaWZpYyBpZHMuICovXG5leHBvcnQgY29uc3QgZm1hID0ge1xuICB4OiBwcmVmaXhlcignZm1hJylcbn07XG5cbi8qKiBMTUhBIHNwZWNpZmljIGlkcy4gKi9cbmV4cG9ydCBjb25zdCBsbWhhID0ge1xuICB4OiBwcmVmaXhlcignbG1oYScpXG59O1xuXG4vKiogUlVJIGFjY2Vzc29ycy4gKi9cbmV4cG9ydCBjb25zdCBydWkgPSB7XG4gIGJvZHk6IHViZXJvbi5ib2R5LFxuICBjZWxsOiBjbC5jZWxsLFxuICByZXNwaXJhdG9yeV9zeXN0ZW06IHViZXJvbi54KCcwMDAxMDA0JyksXG4gIGNvbG9uOiB1YmVyb24ueCgnMDAwMTE1NScpLFxuICBsZWZ0X2x1bmc6IHViZXJvbi54KCcwMDAyMTY4JyksXG4gIHJpZ2h0X2x1bmc6IHViZXJvbi54KCcwMDAyMTY3JyksXG4gIGxlZnRfYnJvbmNodXM6IHViZXJvbi54KCcwMDAyMTc4JyksXG4gIHJpZ2h0X2Jyb25jaHVzOiB1YmVyb24ueCgnMDAwMjE3NycpLFxuICBraWRuZXk6IHViZXJvbi54KCcwMDAyMTEzJyksXG4gIHVyZXRlcjogdWJlcm9uLngoJzAwMDAwNTYnKSxcbiAgZXllOiB1YmVyb24ueCgnMDAwMDk3MCcpLFxuICBmYWxsb3BpYW5fdHViZTogdWJlcm9uLngoJzAwMDM4ODknKSxcbiAga25lZTogdWJlcm9uLngoJzAwMDE0NjUnKSxcbiAgb3Zhcnk6IHViZXJvbi54KCcwMDAwOTkyJyksXG4gIHRyYWNoZWE6IHViZXJvbi54KCcwMDAzMTI2JyksXG4gIGFvcnRhOiB1YmVyb24ueCgnMDAwMDk0NycpLFxuICBibG9vZDogdWJlcm9uLngoJzAwMDAxNzgnKSxcbiAgYm9uZV9tYXJyb3c6IHViZXJvbi54KCcwMDAyMzcxJyksXG4gIG1hbGVfcmVwcm9kdWN0aXZlX3N5c3RlbTogdWJlcm9uLngoJzAwMDAwNzknKSxcbiAgbHltcGhfbm9kZTogdWJlcm9uLngoJzAwMDAwMjknKSxcblxuICAvLyBEZXJpdmVkIHVzaW5nIGNvbnNvbGUubG9nKEFMTF9QT1NTSUJMRV9PUkdBTlMubWFwKG8gPT4gYCAgJHtvLm5hbWUudG9Mb3dlckNhc2UoKS5yZXBsYWNlKCcsJywgJycpLnJlcGxhY2UoLyAvZywgJ18nKX06ICR7by5pZC5zcGxpdCgnLycpLnNsaWNlKC0xKVswXS5zcGxpdCgnXycpWzBdLnRvTG93ZXJDYXNlKCl9LngoJyR7by5pZC5zcGxpdCgnXycpLnNsaWNlKC0xKVswXX0nKSxgKS5qb2luKCdcXG4nKSk7XG4gIGJsb29kX3Zhc2N1bGF0dXJlOiB1YmVyb24ueCgnMDAwNDUzNycpLFxuICBicmFpbjogdWJlcm9uLngoJzAwMDA5NTUnKSxcbiAgZXllX2xlZnQ6IHViZXJvbi54KCcwMDA0NTQ4JyksXG4gIGV5ZV9yaWdodDogZm1hLngoJzU0NDQ5JyksXG4gIGZhbGxvcGlhbl90dWJlX2xlZnQ6IHViZXJvbi54KCcwMDAxMzAzJyksXG4gIGZhbGxvcGlhbl90dWJlX3JpZ2h0OiB1YmVyb24ueCgnMDAwMTMwMicpLFxuICBoZWFydDogdWJlcm9uLngoJzAwMDA5NDgnKSxcbiAga2lkbmV5X2xlZnQ6IHViZXJvbi54KCcwMDA0NTM4JyksXG4gIGtpZG5leV9yaWdodDogdWJlcm9uLngoJzAwMDQ1MzknKSxcbiAga25lZV9sZWZ0OiBmbWEueCgnMjQ5NzgnKSxcbiAga25lZV9yaWdodDogZm1hLngoJzI0OTc3JyksXG4gIGxhcmdlX2ludGVzdGluZTogdWJlcm9uLngoJzAwMDAwNTknKSxcbiAgbGl2ZXI6IHViZXJvbi54KCcwMDAyMTA3JyksXG4gIGx1bmdzOiB1YmVyb24ueCgnMDAwMjA0OCcpLFxuICBtZXNlbnRlcmljX2x5bXBoX25vZGU6IHViZXJvbi54KCcwMDAyNTA5JyksXG4gIG92YXJ5X2xlZnQ6IGZtYS54KCc3MjE0JyksXG4gIG92YXJ5X3JpZ2h0OiBmbWEueCgnNzIxMycpLFxuICBwYW5jcmVhczogdWJlcm9uLngoJzAwMDEyNjQnKSxcbiAgcGVsdmlzOiB1YmVyb24ueCgnMDAwMTI3MCcpLFxuICBwcm9zdGF0ZV9nbGFuZDogdWJlcm9uLngoJzAwMDIzNjcnKSxcbiAgc2tpbjogdWJlcm9uLngoJzAwMDIwOTcnKSxcbiAgc21hbGxfaW50ZXN0aW5lOiB1YmVyb24ueCgnMDAwMjEwOCcpLFxuICBzcGxlZW46IHViZXJvbi54KCcwMDAyMTA2JyksXG4gIHRoeW11czogdWJlcm9uLngoJzAwMDIzNzAnKSxcbiAgdXJldGVyX2xlZnQ6IHViZXJvbi54KCcwMDAxMjIzJyksXG4gIHVyZXRlcl9yaWdodDogdWJlcm9uLngoJzAwMDEyMjInKSxcbiAgdXJpbmFyeV9ibGFkZGVyOiB1YmVyb24ueCgnMDAwMTI1NScpLFxuICB1dGVydXM6IHViZXJvbi54KCcwMDAwOTk1Jylcbn07XG4iXX0= \ No newline at end of file diff --git a/ccf-database/esm2015/lib/util/probing-sphere-scene.js b/ccf-database/esm2015/lib/util/probing-sphere-scene.js deleted file mode 100644 index c1e5bc3a1..000000000 --- a/ccf-database/esm2015/lib/util/probing-sphere-scene.js +++ /dev/null @@ -1,247 +0,0 @@ -import { Matrix4, toRadians } from '@math.gl/core'; -const gold = [240, 183, 98, 255]; -const red = [213, 0, 0, 255]; -const green = [29, 204, 101, 255]; -const blue = [41, 121, 255, 255]; -/** - * Create a set of scene nodes for the body-ui to show the probing sphere and lines around it - * for a given spatial search. - * @param node the Spatial Entity (usually a reference organ) that the sphere is probing into - * @param sphere the Spatial Search that defines where and how big the probing sphere is - * @returns a set of scene nodes for the body-ui - */ -export function getProbingSphereScene(node, sphere) { - var _a; - const sceneWidth = node.x_dimension / 1000; - const sceneHeight = node.y_dimension / 1000; - const sceneDepth = node.z_dimension / 1000; - const defaultSphereRadius = Math.max(sceneWidth, sceneHeight, sceneDepth) * 0.07; - const sphereLineRadius = defaultSphereRadius * 0.05; - const sphereLineLength = defaultSphereRadius * 2; - const sphereConeRadius = sphereLineRadius * 4; - if (!sphere) { - sphere = { - target: (_a = node.representation_of) !== null && _a !== void 0 ? _a : node['@id'], - radius: defaultSphereRadius, - x: sceneWidth / 2, - y: sceneHeight / 2, - z: sceneDepth / 2 - }; - } - else { - sphere = Object.assign(Object.assign({}, sphere), { radius: sphere.radius / 1000, x: sphere.x / 1000, y: sphere.y / 1000, z: sphere.z / 1000 }); - } - return [ - // Probing Sphere - { - '@id': 'http://purl.org/ccf/latest/ccf.owl#ProbingSphere', - '@type': 'SpatialSceneNode', - unpickable: false, - geometry: 'sphere', - transformMatrix: new Matrix4(Matrix4.IDENTITY).translate([sphere.x, sphere.y, sphere.z]).scale(sphere.radius), - color: gold - }, - // Probing Sphere Positive X Axis (D) - { - '@id': 'http://purl.org/ccf/latest/ccf.owl#ProbingsphereXD', - '@type': 'SpatialSceneNode', - unpickable: true, - geometry: 'cylinder', - transformMatrix: new Matrix4(Matrix4.IDENTITY) - .translate([sphere.x + sphere.radius + sphereLineLength / 2, sphere.y, sphere.z]) - .rotateZ(toRadians(-90)) - .scale([sphereLineRadius, sphereLineLength, sphereLineRadius]), - color: red - }, - { - '@id': 'http://purl.org/ccf/latest/ccf.owl#ProbingsphereXDCone', - '@type': 'SpatialSceneNode', - unpickable: true, - geometry: 'cone', - transformMatrix: new Matrix4(Matrix4.IDENTITY) - .translate([sphere.x + sphere.radius + sphereLineLength, sphere.y, sphere.z]) - .rotateZ(toRadians(-90)) - .scale([sphereConeRadius, sphereConeRadius * 3, sphereConeRadius]), - color: red - }, - { - '@id': 'http://purl.org/ccf/latest/ccf.owl#ProbingsphereXDLabel', - '@type': 'SpatialSceneNode', - unpickable: true, - geometry: 'text', - text: 'D', - transformMatrix: new Matrix4(Matrix4.IDENTITY) - .translate([sphere.x + sphere.radius + sphereLineLength + sphereConeRadius * 3, sphere.y, sphere.z]) - .scale(sphereConeRadius), - color: red - }, - // Probing Sphere Negative X Axis (A) - { - '@id': 'http://purl.org/ccf/latest/ccf.owl#ProbingsphereXA', - '@type': 'SpatialSceneNode', - unpickable: true, - geometry: 'cylinder', - transformMatrix: new Matrix4(Matrix4.IDENTITY) - .translate([sphere.x - sphere.radius - sphereLineLength / 2, sphere.y, sphere.z]) - .rotateZ(toRadians(-90)) - .scale([sphereLineRadius, sphereLineLength, sphereLineRadius]), - color: red - }, - { - '@id': 'http://purl.org/ccf/latest/ccf.owl#ProbingsphereXACone', - '@type': 'SpatialSceneNode', - unpickable: true, - geometry: 'cone', - transformMatrix: new Matrix4(Matrix4.IDENTITY) - .translate([sphere.x - sphere.radius - sphereLineLength, sphere.y, sphere.z]) - .rotateZ(toRadians(90)) - .scale([sphereConeRadius, sphereConeRadius * 3, sphereConeRadius]), - color: red - }, - { - '@id': 'http://purl.org/ccf/latest/ccf.owl#ProbingsphereXALabel', - '@type': 'SpatialSceneNode', - unpickable: true, - geometry: 'text', - text: 'A', - transformMatrix: new Matrix4(Matrix4.IDENTITY) - .translate([sphere.x - sphere.radius - sphereLineLength - sphereConeRadius * 3.5, sphere.y, sphere.z]) - .scale(sphereConeRadius), - color: red - }, - // Probing Sphere Positive Y Axis (W) - { - '@id': 'http://purl.org/ccf/latest/ccf.owl#ProbingsphereYW', - '@type': 'SpatialSceneNode', - unpickable: true, - geometry: 'cylinder', - transformMatrix: new Matrix4(Matrix4.IDENTITY) - .translate([sphere.x, sphere.y + sphere.radius + sphereLineLength / 2, sphere.z]) - .scale([sphereLineRadius, sphereLineLength, sphereLineRadius]), - color: green - }, - { - '@id': 'http://purl.org/ccf/latest/ccf.owl#ProbingsphereYWCone', - '@type': 'SpatialSceneNode', - unpickable: true, - geometry: 'cone', - transformMatrix: new Matrix4(Matrix4.IDENTITY) - .translate([sphere.x, sphere.y + sphere.radius + sphereLineLength, sphere.z]) - .scale([sphereConeRadius, sphereConeRadius * 3, sphereConeRadius]), - color: green - }, - { - '@id': 'http://purl.org/ccf/latest/ccf.owl#ProbingsphereYWLabel', - '@type': 'SpatialSceneNode', - unpickable: true, - geometry: 'text', - text: 'W', - transformMatrix: new Matrix4(Matrix4.IDENTITY) - .translate([sphere.x, sphere.y + sphere.radius + sphereLineLength + sphereConeRadius * 3, sphere.z]) - .scale(sphereConeRadius), - color: green - }, - // Probing Sphere Negative Y Axis (S) - { - '@id': 'http://purl.org/ccf/latest/ccf.owl#ProbingsphereYS', - '@type': 'SpatialSceneNode', - unpickable: true, - geometry: 'cylinder', - transformMatrix: new Matrix4(Matrix4.IDENTITY) - .translate([sphere.x, sphere.y - sphere.radius - sphereLineLength / 2, sphere.z]) - .scale([sphereLineRadius, sphereLineLength, sphereLineRadius]), - color: green - }, - { - '@id': 'http://purl.org/ccf/latest/ccf.owl#ProbingsphereYSCone', - '@type': 'SpatialSceneNode', - unpickable: true, - geometry: 'cone', - transformMatrix: new Matrix4(Matrix4.IDENTITY) - .translate([sphere.x, sphere.y - sphere.radius - sphereLineLength, sphere.z]) - .rotateZ(toRadians(180)) - .scale([sphereConeRadius, sphereConeRadius * 3, sphereConeRadius]), - color: green - }, - { - '@id': 'http://purl.org/ccf/latest/ccf.owl#ProbingsphereYSLabel', - '@type': 'SpatialSceneNode', - unpickable: true, - geometry: 'text', - text: 'S', - transformMatrix: new Matrix4(Matrix4.IDENTITY) - .translate([sphere.x, sphere.y - sphere.radius - sphereLineLength - sphereConeRadius * 3.5, sphere.z]) - .scale(sphereConeRadius), - color: green - }, - // Probing Sphere Positive Z Axis (E) - { - '@id': 'http://purl.org/ccf/latest/ccf.owl#ProbingsphereZE', - '@type': 'SpatialSceneNode', - unpickable: true, - geometry: 'cylinder', - transformMatrix: new Matrix4(Matrix4.IDENTITY) - .translate([sphere.x, sphere.y, sphere.z + sphere.radius + sphereLineLength / 2]) - .rotateX(toRadians(90)) - .scale([sphereLineRadius, sphereLineLength, sphereLineRadius]), - color: blue - }, - { - '@id': 'http://purl.org/ccf/latest/ccf.owl#ProbingsphereZECone', - '@type': 'SpatialSceneNode', - unpickable: true, - geometry: 'cone', - transformMatrix: new Matrix4(Matrix4.IDENTITY) - .translate([sphere.x, sphere.y, sphere.z + sphere.radius + sphereLineLength]) - .rotateX(toRadians(90)) - .scale([sphereConeRadius, sphereConeRadius * 3, sphereConeRadius]), - color: blue - }, - { - '@id': 'http://purl.org/ccf/latest/ccf.owl#ProbingsphereZELabel', - '@type': 'SpatialSceneNode', - unpickable: true, - geometry: 'text', - text: 'E', - transformMatrix: new Matrix4(Matrix4.IDENTITY) - .translate([sphere.x, sphere.y, sphere.z + sphere.radius + sphereLineLength + sphereConeRadius * 3]) - .scale(sphereConeRadius), - color: blue - }, - // Probing Sphere Negative Z Axis (Q) - { - '@id': 'http://purl.org/ccf/latest/ccf.owl#ProbingsphereZQ', - '@type': 'SpatialSceneNode', - unpickable: true, - geometry: 'cylinder', - transformMatrix: new Matrix4(Matrix4.IDENTITY) - .translate([sphere.x, sphere.y, sphere.z - sphere.radius - sphereLineLength / 2]) - .rotateX(toRadians(-90)) - .scale([sphereLineRadius, sphereLineLength, sphereLineRadius]), - color: blue - }, - { - '@id': 'http://purl.org/ccf/latest/ccf.owl#ProbingsphereZQCone', - '@type': 'SpatialSceneNode', - unpickable: true, - geometry: 'cone', - transformMatrix: new Matrix4(Matrix4.IDENTITY) - .translate([sphere.x, sphere.y, sphere.z - sphere.radius - sphereLineLength]) - .rotateX(toRadians(-90)) - .scale([sphereConeRadius, sphereConeRadius * 3, sphereConeRadius]), - color: blue - }, - { - '@id': 'http://purl.org/ccf/latest/ccf.owl#ProbingsphereZQLabel', - '@type': 'SpatialSceneNode', - unpickable: true, - geometry: 'text', - text: 'Q', - transformMatrix: new Matrix4(Matrix4.IDENTITY) - .translate([sphere.x, sphere.y, sphere.z - sphere.radius - sphereLineLength - sphereConeRadius * 3.5]) - .scale(sphereConeRadius), - color: blue - } - ]; -} -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJvYmluZy1zcGhlcmUtc2NlbmUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9jY2YtZGF0YWJhc2Uvc3JjL2xpYi91dGlsL3Byb2Jpbmctc3BoZXJlLXNjZW5lLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxPQUFPLEVBQUUsU0FBUyxFQUFFLE1BQU0sZUFBZSxDQUFDO0FBTW5ELE1BQU0sSUFBSSxHQUFVLENBQUMsR0FBRyxFQUFFLEdBQUcsRUFBRSxFQUFFLEVBQUUsR0FBRyxDQUFDLENBQUM7QUFDeEMsTUFBTSxHQUFHLEdBQVUsQ0FBQyxHQUFHLEVBQUUsQ0FBQyxFQUFFLENBQUMsRUFBRSxHQUFHLENBQUMsQ0FBQztBQUNwQyxNQUFNLEtBQUssR0FBVSxDQUFDLEVBQUUsRUFBRSxHQUFHLEVBQUUsR0FBRyxFQUFFLEdBQUcsQ0FBQyxDQUFDO0FBQ3pDLE1BQU0sSUFBSSxHQUFVLENBQUMsRUFBRSxFQUFFLEdBQUcsRUFBRSxHQUFHLEVBQUUsR0FBRyxDQUFDLENBQUM7QUFFeEM7Ozs7OztHQU1HO0FBQ0gsTUFBTSxVQUFVLHFCQUFxQixDQUFDLElBQW1CLEVBQUUsTUFBc0I7O0lBQy9FLE1BQU0sVUFBVSxHQUFHLElBQUksQ0FBQyxXQUFXLEdBQUcsSUFBSSxDQUFDO0lBQzNDLE1BQU0sV0FBVyxHQUFHLElBQUksQ0FBQyxXQUFXLEdBQUcsSUFBSSxDQUFDO0lBQzVDLE1BQU0sVUFBVSxHQUFHLElBQUksQ0FBQyxXQUFXLEdBQUcsSUFBSSxDQUFDO0lBQzNDLE1BQU0sbUJBQW1CLEdBQUcsSUFBSSxDQUFDLEdBQUcsQ0FBQyxVQUFVLEVBQUUsV0FBVyxFQUFFLFVBQVUsQ0FBQyxHQUFHLElBQUksQ0FBQztJQUNqRixNQUFNLGdCQUFnQixHQUFHLG1CQUFtQixHQUFHLElBQUksQ0FBQztJQUNwRCxNQUFNLGdCQUFnQixHQUFHLG1CQUFtQixHQUFHLENBQUMsQ0FBQztJQUNqRCxNQUFNLGdCQUFnQixHQUFHLGdCQUFnQixHQUFHLENBQUMsQ0FBQztJQUU5QyxJQUFJLENBQUMsTUFBTSxFQUFFO1FBQ1gsTUFBTSxHQUFHO1lBQ1AsTUFBTSxFQUFFLE1BQUEsSUFBSSxDQUFDLGlCQUFpQixtQ0FBSSxJQUFJLENBQUMsS0FBSyxDQUFDO1lBQzdDLE1BQU0sRUFBRSxtQkFBbUI7WUFDM0IsQ0FBQyxFQUFFLFVBQVUsR0FBRyxDQUFDO1lBQ2pCLENBQUMsRUFBRSxXQUFXLEdBQUcsQ0FBQztZQUNsQixDQUFDLEVBQUUsVUFBVSxHQUFHLENBQUM7U0FDbEIsQ0FBQztLQUNIO1NBQU07UUFDTCxNQUFNLG1DQUNELE1BQU0sS0FDVCxNQUFNLEVBQUUsTUFBTSxDQUFDLE1BQU0sR0FBRyxJQUFJLEVBQzVCLENBQUMsRUFBRSxNQUFNLENBQUMsQ0FBQyxHQUFHLElBQUksRUFDbEIsQ0FBQyxFQUFFLE1BQU0sQ0FBQyxDQUFDLEdBQUcsSUFBSSxFQUNsQixDQUFDLEVBQUUsTUFBTSxDQUFDLENBQUMsR0FBRyxJQUFJLEdBQ25CLENBQUM7S0FDSDtJQUVELE9BQU87UUFDTCxpQkFBaUI7UUFDakI7WUFDRSxLQUFLLEVBQUUsa0RBQWtEO1lBQ3pELE9BQU8sRUFBRSxrQkFBa0I7WUFDM0IsVUFBVSxFQUFFLEtBQUs7WUFDakIsUUFBUSxFQUFFLFFBQVE7WUFDbEIsZUFBZSxFQUFFLElBQUksT0FBTyxDQUFDLE9BQU8sQ0FBQyxRQUFRLENBQUMsQ0FBQyxTQUFTLENBQUMsQ0FBQyxNQUFNLENBQUMsQ0FBQyxFQUFFLE1BQU0sQ0FBQyxDQUFDLEVBQUUsTUFBTSxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsS0FBSyxDQUFDLE1BQU0sQ0FBQyxNQUFNLENBQUM7WUFDN0csS0FBSyxFQUFFLElBQUk7U0FDWjtRQUNELHFDQUFxQztRQUNyQztZQUNFLEtBQUssRUFBRSxvREFBb0Q7WUFDM0QsT0FBTyxFQUFFLGtCQUFrQjtZQUMzQixVQUFVLEVBQUUsSUFBSTtZQUNoQixRQUFRLEVBQUUsVUFBVTtZQUNwQixlQUFlLEVBQUUsSUFBSSxPQUFPLENBQUMsT0FBTyxDQUFDLFFBQVEsQ0FBQztpQkFDM0MsU0FBUyxDQUFDLENBQUMsTUFBTSxDQUFDLENBQUMsR0FBRyxNQUFNLENBQUMsTUFBTSxHQUFHLGdCQUFnQixHQUFHLENBQUMsRUFBRSxNQUFNLENBQUMsQ0FBQyxFQUFFLE1BQU0sQ0FBQyxDQUFDLENBQUMsQ0FBQztpQkFDaEYsT0FBTyxDQUFDLFNBQVMsQ0FBQyxDQUFDLEVBQUUsQ0FBQyxDQUFDO2lCQUN2QixLQUFLLENBQUMsQ0FBQyxnQkFBZ0IsRUFBRSxnQkFBZ0IsRUFBRSxnQkFBZ0IsQ0FBQyxDQUFDO1lBQ2hFLEtBQUssRUFBRSxHQUFHO1NBQ1g7UUFDRDtZQUNFLEtBQUssRUFBRSx3REFBd0Q7WUFDL0QsT0FBTyxFQUFFLGtCQUFrQjtZQUMzQixVQUFVLEVBQUUsSUFBSTtZQUNoQixRQUFRLEVBQUUsTUFBTTtZQUNoQixlQUFlLEVBQUUsSUFBSSxPQUFPLENBQUMsT0FBTyxDQUFDLFFBQVEsQ0FBQztpQkFDM0MsU0FBUyxDQUFDLENBQUMsTUFBTSxDQUFDLENBQUMsR0FBRyxNQUFNLENBQUMsTUFBTSxHQUFHLGdCQUFnQixFQUFFLE1BQU0sQ0FBQyxDQUFDLEVBQUUsTUFBTSxDQUFDLENBQUMsQ0FBQyxDQUFDO2lCQUM1RSxPQUFPLENBQUMsU0FBUyxDQUFDLENBQUMsRUFBRSxDQUFDLENBQUM7aUJBQ3ZCLEtBQUssQ0FBQyxDQUFFLGdCQUFnQixFQUFFLGdCQUFnQixHQUFHLENBQUMsRUFBRSxnQkFBZ0IsQ0FBRSxDQUFDO1lBQ3RFLEtBQUssRUFBRSxHQUFHO1NBQ1g7UUFDRDtZQUNFLEtBQUssRUFBRSx5REFBeUQ7WUFDaEUsT0FBTyxFQUFFLGtCQUFrQjtZQUMzQixVQUFVLEVBQUUsSUFBSTtZQUNoQixRQUFRLEVBQUUsTUFBTTtZQUNoQixJQUFJLEVBQUUsR0FBRztZQUNULGVBQWUsRUFBRSxJQUFJLE9BQU8sQ0FBQyxPQUFPLENBQUMsUUFBUSxDQUFDO2lCQUMzQyxTQUFTLENBQUMsQ0FBQyxNQUFNLENBQUMsQ0FBQyxHQUFHLE1BQU0sQ0FBQyxNQUFNLEdBQUcsZ0JBQWdCLEdBQUcsZ0JBQWdCLEdBQUcsQ0FBQyxFQUFFLE1BQU0sQ0FBQyxDQUFDLEVBQUUsTUFBTSxDQUFDLENBQUMsQ0FBQyxDQUFDO2lCQUNuRyxLQUFLLENBQUMsZ0JBQWdCLENBQUM7WUFDMUIsS0FBSyxFQUFFLEdBQUc7U0FDWDtRQUNELHFDQUFxQztRQUNyQztZQUNFLEtBQUssRUFBRSxvREFBb0Q7WUFDM0QsT0FBTyxFQUFFLGtCQUFrQjtZQUMzQixVQUFVLEVBQUUsSUFBSTtZQUNoQixRQUFRLEVBQUUsVUFBVTtZQUNwQixlQUFlLEVBQUUsSUFBSSxPQUFPLENBQUMsT0FBTyxDQUFDLFFBQVEsQ0FBQztpQkFDM0MsU0FBUyxDQUFDLENBQUMsTUFBTSxDQUFDLENBQUMsR0FBRyxNQUFNLENBQUMsTUFBTSxHQUFHLGdCQUFnQixHQUFHLENBQUMsRUFBRSxNQUFNLENBQUMsQ0FBQyxFQUFFLE1BQU0sQ0FBQyxDQUFDLENBQUMsQ0FBQztpQkFDaEYsT0FBTyxDQUFDLFNBQVMsQ0FBQyxDQUFDLEVBQUUsQ0FBQyxDQUFDO2lCQUN2QixLQUFLLENBQUMsQ0FBQyxnQkFBZ0IsRUFBRSxnQkFBZ0IsRUFBRSxnQkFBZ0IsQ0FBQyxDQUFDO1lBQ2hFLEtBQUssRUFBRSxHQUFHO1NBQ1g7UUFDRDtZQUNFLEtBQUssRUFBRSx3REFBd0Q7WUFDL0QsT0FBTyxFQUFFLGtCQUFrQjtZQUMzQixVQUFVLEVBQUUsSUFBSTtZQUNoQixRQUFRLEVBQUUsTUFBTTtZQUNoQixlQUFlLEVBQUUsSUFBSSxPQUFPLENBQUMsT0FBTyxDQUFDLFFBQVEsQ0FBQztpQkFDM0MsU0FBUyxDQUFDLENBQUMsTUFBTSxDQUFDLENBQUMsR0FBRyxNQUFNLENBQUMsTUFBTSxHQUFHLGdCQUFnQixFQUFFLE1BQU0sQ0FBQyxDQUFDLEVBQUUsTUFBTSxDQUFDLENBQUMsQ0FBQyxDQUFDO2lCQUM1RSxPQUFPLENBQUMsU0FBUyxDQUFDLEVBQUUsQ0FBQyxDQUFDO2lCQUN0QixLQUFLLENBQUMsQ0FBRSxnQkFBZ0IsRUFBRSxnQkFBZ0IsR0FBRyxDQUFDLEVBQUUsZ0JBQWdCLENBQUUsQ0FBQztZQUN0RSxLQUFLLEVBQUUsR0FBRztTQUNYO1FBQ0Q7WUFDRSxLQUFLLEVBQUUseURBQXlEO1lBQ2hFLE9BQU8sRUFBRSxrQkFBa0I7WUFDM0IsVUFBVSxFQUFFLElBQUk7WUFDaEIsUUFBUSxFQUFFLE1BQU07WUFDaEIsSUFBSSxFQUFFLEdBQUc7WUFDVCxlQUFlLEVBQUUsSUFBSSxPQUFPLENBQUMsT0FBTyxDQUFDLFFBQVEsQ0FBQztpQkFDM0MsU0FBUyxDQUFDLENBQUMsTUFBTSxDQUFDLENBQUMsR0FBRyxNQUFNLENBQUMsTUFBTSxHQUFHLGdCQUFnQixHQUFHLGdCQUFnQixHQUFHLEdBQUcsRUFBRSxNQUFNLENBQUMsQ0FBQyxFQUFFLE1BQU0sQ0FBQyxDQUFDLENBQUMsQ0FBQztpQkFDckcsS0FBSyxDQUFDLGdCQUFnQixDQUFDO1lBQzFCLEtBQUssRUFBRSxHQUFHO1NBQ1g7UUFDRCxxQ0FBcUM7UUFDckM7WUFDRSxLQUFLLEVBQUUsb0RBQW9EO1lBQzNELE9BQU8sRUFBRSxrQkFBa0I7WUFDM0IsVUFBVSxFQUFFLElBQUk7WUFDaEIsUUFBUSxFQUFFLFVBQVU7WUFDcEIsZUFBZSxFQUFFLElBQUksT0FBTyxDQUFDLE9BQU8sQ0FBQyxRQUFRLENBQUM7aUJBQzNDLFNBQVMsQ0FBQyxDQUFDLE1BQU0sQ0FBQyxDQUFDLEVBQUUsTUFBTSxDQUFDLENBQUMsR0FBRyxNQUFNLENBQUMsTUFBTSxHQUFHLGdCQUFnQixHQUFHLENBQUMsRUFBRSxNQUFNLENBQUMsQ0FBQyxDQUFDLENBQUM7aUJBQ2hGLEtBQUssQ0FBQyxDQUFDLGdCQUFnQixFQUFFLGdCQUFnQixFQUFFLGdCQUFnQixDQUFDLENBQUM7WUFDaEUsS0FBSyxFQUFFLEtBQUs7U0FDYjtRQUNEO1lBQ0UsS0FBSyxFQUFFLHdEQUF3RDtZQUMvRCxPQUFPLEVBQUUsa0JBQWtCO1lBQzNCLFVBQVUsRUFBRSxJQUFJO1lBQ2hCLFFBQVEsRUFBRSxNQUFNO1lBQ2hCLGVBQWUsRUFBRSxJQUFJLE9BQU8sQ0FBQyxPQUFPLENBQUMsUUFBUSxDQUFDO2lCQUMzQyxTQUFTLENBQUMsQ0FBQyxNQUFNLENBQUMsQ0FBQyxFQUFFLE1BQU0sQ0FBQyxDQUFDLEdBQUcsTUFBTSxDQUFDLE1BQU0sR0FBRyxnQkFBZ0IsRUFBRSxNQUFNLENBQUMsQ0FBQyxDQUFDLENBQUM7aUJBQzVFLEtBQUssQ0FBQyxDQUFFLGdCQUFnQixFQUFFLGdCQUFnQixHQUFHLENBQUMsRUFBRSxnQkFBZ0IsQ0FBRSxDQUFDO1lBQ3RFLEtBQUssRUFBRSxLQUFLO1NBQ2I7UUFDRDtZQUNFLEtBQUssRUFBRSx5REFBeUQ7WUFDaEUsT0FBTyxFQUFFLGtCQUFrQjtZQUMzQixVQUFVLEVBQUUsSUFBSTtZQUNoQixRQUFRLEVBQUUsTUFBTTtZQUNoQixJQUFJLEVBQUUsR0FBRztZQUNULGVBQWUsRUFBRSxJQUFJLE9BQU8sQ0FBQyxPQUFPLENBQUMsUUFBUSxDQUFDO2lCQUMzQyxTQUFTLENBQUMsQ0FBQyxNQUFNLENBQUMsQ0FBQyxFQUFFLE1BQU0sQ0FBQyxDQUFDLEdBQUcsTUFBTSxDQUFDLE1BQU0sR0FBRyxnQkFBZ0IsR0FBRyxnQkFBZ0IsR0FBRyxDQUFDLEVBQUUsTUFBTSxDQUFDLENBQUMsQ0FBQyxDQUFDO2lCQUNuRyxLQUFLLENBQUMsZ0JBQWdCLENBQUM7WUFDMUIsS0FBSyxFQUFFLEtBQUs7U0FDYjtRQUNELHFDQUFxQztRQUNyQztZQUNFLEtBQUssRUFBRSxvREFBb0Q7WUFDM0QsT0FBTyxFQUFFLGtCQUFrQjtZQUMzQixVQUFVLEVBQUUsSUFBSTtZQUNoQixRQUFRLEVBQUUsVUFBVTtZQUNwQixlQUFlLEVBQUUsSUFBSSxPQUFPLENBQUMsT0FBTyxDQUFDLFFBQVEsQ0FBQztpQkFDM0MsU0FBUyxDQUFDLENBQUMsTUFBTSxDQUFDLENBQUMsRUFBRSxNQUFNLENBQUMsQ0FBQyxHQUFHLE1BQU0sQ0FBQyxNQUFNLEdBQUcsZ0JBQWdCLEdBQUcsQ0FBQyxFQUFFLE1BQU0sQ0FBQyxDQUFDLENBQUMsQ0FBQztpQkFDaEYsS0FBSyxDQUFDLENBQUMsZ0JBQWdCLEVBQUUsZ0JBQWdCLEVBQUUsZ0JBQWdCLENBQUMsQ0FBQztZQUNoRSxLQUFLLEVBQUUsS0FBSztTQUNiO1FBQ0Q7WUFDRSxLQUFLLEVBQUUsd0RBQXdEO1lBQy9ELE9BQU8sRUFBRSxrQkFBa0I7WUFDM0IsVUFBVSxFQUFFLElBQUk7WUFDaEIsUUFBUSxFQUFFLE1BQU07WUFDaEIsZUFBZSxFQUFFLElBQUksT0FBTyxDQUFDLE9BQU8sQ0FBQyxRQUFRLENBQUM7aUJBQzNDLFNBQVMsQ0FBQyxDQUFDLE1BQU0sQ0FBQyxDQUFDLEVBQUUsTUFBTSxDQUFDLENBQUMsR0FBRyxNQUFNLENBQUMsTUFBTSxHQUFHLGdCQUFnQixFQUFFLE1BQU0sQ0FBQyxDQUFDLENBQUMsQ0FBQztpQkFDNUUsT0FBTyxDQUFDLFNBQVMsQ0FBQyxHQUFHLENBQUMsQ0FBQztpQkFDdkIsS0FBSyxDQUFDLENBQUUsZ0JBQWdCLEVBQUUsZ0JBQWdCLEdBQUcsQ0FBQyxFQUFFLGdCQUFnQixDQUFFLENBQUM7WUFDdEUsS0FBSyxFQUFFLEtBQUs7U0FDYjtRQUNEO1lBQ0UsS0FBSyxFQUFFLHlEQUF5RDtZQUNoRSxPQUFPLEVBQUUsa0JBQWtCO1lBQzNCLFVBQVUsRUFBRSxJQUFJO1lBQ2hCLFFBQVEsRUFBRSxNQUFNO1lBQ2hCLElBQUksRUFBRSxHQUFHO1lBQ1QsZUFBZSxFQUFFLElBQUksT0FBTyxDQUFDLE9BQU8sQ0FBQyxRQUFRLENBQUM7aUJBQzNDLFNBQVMsQ0FBQyxDQUFDLE1BQU0sQ0FBQyxDQUFDLEVBQUUsTUFBTSxDQUFDLENBQUMsR0FBRyxNQUFNLENBQUMsTUFBTSxHQUFHLGdCQUFnQixHQUFHLGdCQUFnQixHQUFHLEdBQUcsRUFBRSxNQUFNLENBQUMsQ0FBQyxDQUFDLENBQUM7aUJBQ3JHLEtBQUssQ0FBQyxnQkFBZ0IsQ0FBQztZQUMxQixLQUFLLEVBQUUsS0FBSztTQUNiO1FBQ0QscUNBQXFDO1FBQ3JDO1lBQ0UsS0FBSyxFQUFFLG9EQUFvRDtZQUMzRCxPQUFPLEVBQUUsa0JBQWtCO1lBQzNCLFVBQVUsRUFBRSxJQUFJO1lBQ2hCLFFBQVEsRUFBRSxVQUFVO1lBQ3BCLGVBQWUsRUFBRSxJQUFJLE9BQU8sQ0FBQyxPQUFPLENBQUMsUUFBUSxDQUFDO2lCQUMzQyxTQUFTLENBQUMsQ0FBQyxNQUFNLENBQUMsQ0FBQyxFQUFFLE1BQU0sQ0FBQyxDQUFDLEVBQUUsTUFBTSxDQUFDLENBQUMsR0FBRyxNQUFNLENBQUMsTUFBTSxHQUFHLGdCQUFnQixHQUFHLENBQUMsQ0FBQyxDQUFDO2lCQUNoRixPQUFPLENBQUMsU0FBUyxDQUFDLEVBQUUsQ0FBQyxDQUFDO2lCQUN0QixLQUFLLENBQUMsQ0FBQyxnQkFBZ0IsRUFBRSxnQkFBZ0IsRUFBRSxnQkFBZ0IsQ0FBQyxDQUFDO1lBQ2hFLEtBQUssRUFBRSxJQUFJO1NBQ1o7UUFDRDtZQUNFLEtBQUssRUFBRSx3REFBd0Q7WUFDL0QsT0FBTyxFQUFFLGtCQUFrQjtZQUMzQixVQUFVLEVBQUUsSUFBSTtZQUNoQixRQUFRLEVBQUUsTUFBTTtZQUNoQixlQUFlLEVBQUUsSUFBSSxPQUFPLENBQUMsT0FBTyxDQUFDLFFBQVEsQ0FBQztpQkFDM0MsU0FBUyxDQUFDLENBQUMsTUFBTSxDQUFDLENBQUMsRUFBRSxNQUFNLENBQUMsQ0FBQyxFQUFFLE1BQU0sQ0FBQyxDQUFDLEdBQUcsTUFBTSxDQUFDLE1BQU0sR0FBRyxnQkFBZ0IsQ0FBQyxDQUFDO2lCQUM1RSxPQUFPLENBQUMsU0FBUyxDQUFDLEVBQUUsQ0FBQyxDQUFDO2lCQUN0QixLQUFLLENBQUMsQ0FBRSxnQkFBZ0IsRUFBRSxnQkFBZ0IsR0FBRyxDQUFDLEVBQUUsZ0JBQWdCLENBQUUsQ0FBQztZQUN0RSxLQUFLLEVBQUUsSUFBSTtTQUNaO1FBQ0Q7WUFDRSxLQUFLLEVBQUUseURBQXlEO1lBQ2hFLE9BQU8sRUFBRSxrQkFBa0I7WUFDM0IsVUFBVSxFQUFFLElBQUk7WUFDaEIsUUFBUSxFQUFFLE1BQU07WUFDaEIsSUFBSSxFQUFFLEdBQUc7WUFDVCxlQUFlLEVBQUUsSUFBSSxPQUFPLENBQUMsT0FBTyxDQUFDLFFBQVEsQ0FBQztpQkFDM0MsU0FBUyxDQUFDLENBQUMsTUFBTSxDQUFDLENBQUMsRUFBRSxNQUFNLENBQUMsQ0FBQyxFQUFFLE1BQU0sQ0FBQyxDQUFDLEdBQUcsTUFBTSxDQUFDLE1BQU0sR0FBRyxnQkFBZ0IsR0FBRyxnQkFBZ0IsR0FBRyxDQUFDLENBQUMsQ0FBQztpQkFDbkcsS0FBSyxDQUFDLGdCQUFnQixDQUFDO1lBQzFCLEtBQUssRUFBRSxJQUFJO1NBQ1o7UUFDRCxxQ0FBcUM7UUFDckM7WUFDRSxLQUFLLEVBQUUsb0RBQW9EO1lBQzNELE9BQU8sRUFBRSxrQkFBa0I7WUFDM0IsVUFBVSxFQUFFLElBQUk7WUFDaEIsUUFBUSxFQUFFLFVBQVU7WUFDcEIsZUFBZSxFQUFFLElBQUksT0FBTyxDQUFDLE9BQU8sQ0FBQyxRQUFRLENBQUM7aUJBQzNDLFNBQVMsQ0FBQyxDQUFDLE1BQU0sQ0FBQyxDQUFDLEVBQUUsTUFBTSxDQUFDLENBQUMsRUFBRSxNQUFNLENBQUMsQ0FBQyxHQUFHLE1BQU0sQ0FBQyxNQUFNLEdBQUcsZ0JBQWdCLEdBQUcsQ0FBQyxDQUFDLENBQUM7aUJBQ2hGLE9BQU8sQ0FBQyxTQUFTLENBQUMsQ0FBQyxFQUFFLENBQUMsQ0FBQztpQkFDdkIsS0FBSyxDQUFDLENBQUMsZ0JBQWdCLEVBQUUsZ0JBQWdCLEVBQUUsZ0JBQWdCLENBQUMsQ0FBQztZQUNoRSxLQUFLLEVBQUUsSUFBSTtTQUNaO1FBQ0Q7WUFDRSxLQUFLLEVBQUUsd0RBQXdEO1lBQy9ELE9BQU8sRUFBRSxrQkFBa0I7WUFDM0IsVUFBVSxFQUFFLElBQUk7WUFDaEIsUUFBUSxFQUFFLE1BQU07WUFDaEIsZUFBZSxFQUFFLElBQUksT0FBTyxDQUFDLE9BQU8sQ0FBQyxRQUFRLENBQUM7aUJBQzNDLFNBQVMsQ0FBQyxDQUFDLE1BQU0sQ0FBQyxDQUFDLEVBQUUsTUFBTSxDQUFDLENBQUMsRUFBRSxNQUFNLENBQUMsQ0FBQyxHQUFHLE1BQU0sQ0FBQyxNQUFNLEdBQUcsZ0JBQWdCLENBQUMsQ0FBQztpQkFDNUUsT0FBTyxDQUFDLFNBQVMsQ0FBQyxDQUFDLEVBQUUsQ0FBQyxDQUFDO2lCQUN2QixLQUFLLENBQUMsQ0FBRSxnQkFBZ0IsRUFBRSxnQkFBZ0IsR0FBRyxDQUFDLEVBQUUsZ0JBQWdCLENBQUUsQ0FBQztZQUN0RSxLQUFLLEVBQUUsSUFBSTtTQUNaO1FBQ0Q7WUFDRSxLQUFLLEVBQUUseURBQXlEO1lBQ2hFLE9BQU8sRUFBRSxrQkFBa0I7WUFDM0IsVUFBVSxFQUFFLElBQUk7WUFDaEIsUUFBUSxFQUFFLE1BQU07WUFDaEIsSUFBSSxFQUFFLEdBQUc7WUFDVCxlQUFlLEVBQUUsSUFBSSxPQUFPLENBQUMsT0FBTyxDQUFDLFFBQVEsQ0FBQztpQkFDM0MsU0FBUyxDQUFDLENBQUMsTUFBTSxDQUFDLENBQUMsRUFBRSxNQUFNLENBQUMsQ0FBQyxFQUFFLE1BQU0sQ0FBQyxDQUFDLEdBQUcsTUFBTSxDQUFDLE1BQU0sR0FBRyxnQkFBZ0IsR0FBRyxnQkFBZ0IsR0FBRyxHQUFHLENBQUMsQ0FBQztpQkFDckcsS0FBSyxDQUFDLGdCQUFnQixDQUFDO1lBQzFCLEtBQUssRUFBRSxJQUFJO1NBQ1o7S0FDRixDQUFDO0FBQ0osQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IE1hdHJpeDQsIHRvUmFkaWFucyB9IGZyb20gJ0BtYXRoLmdsL2NvcmUnO1xuaW1wb3J0IHsgU3BhdGlhbFNjZW5lTm9kZSB9IGZyb20gJy4uL2NjZi1zcGF0aWFsLXNjZW5lJztcbmltcG9ydCB7IFNwYXRpYWxTZWFyY2ggfSBmcm9tICcuLi9pbnRlcmZhY2VzJztcbmltcG9ydCB7IFNwYXRpYWxFbnRpdHkgfSBmcm9tICcuLi9zcGF0aWFsLXR5cGVzJztcblxudHlwZSBDb2xvciA9IFtudW1iZXIsIG51bWJlciwgbnVtYmVyLCBudW1iZXJdO1xuY29uc3QgZ29sZDogQ29sb3IgPSBbMjQwLCAxODMsIDk4LCAyNTVdO1xuY29uc3QgcmVkOiBDb2xvciA9IFsyMTMsIDAsIDAsIDI1NV07XG5jb25zdCBncmVlbjogQ29sb3IgPSBbMjksIDIwNCwgMTAxLCAyNTVdO1xuY29uc3QgYmx1ZTogQ29sb3IgPSBbNDEsIDEyMSwgMjU1LCAyNTVdO1xuXG4vKipcbiAqIENyZWF0ZSBhIHNldCBvZiBzY2VuZSBub2RlcyBmb3IgdGhlIGJvZHktdWkgdG8gc2hvdyB0aGUgcHJvYmluZyBzcGhlcmUgYW5kIGxpbmVzIGFyb3VuZCBpdFxuICogZm9yIGEgZ2l2ZW4gc3BhdGlhbCBzZWFyY2guXG4gKiBAcGFyYW0gbm9kZSB0aGUgU3BhdGlhbCBFbnRpdHkgKHVzdWFsbHkgYSByZWZlcmVuY2Ugb3JnYW4pIHRoYXQgdGhlIHNwaGVyZSBpcyBwcm9iaW5nIGludG9cbiAqIEBwYXJhbSBzcGhlcmUgdGhlIFNwYXRpYWwgU2VhcmNoIHRoYXQgZGVmaW5lcyB3aGVyZSBhbmQgaG93IGJpZyB0aGUgcHJvYmluZyBzcGhlcmUgaXNcbiAqIEByZXR1cm5zIGEgc2V0IG9mIHNjZW5lIG5vZGVzIGZvciB0aGUgYm9keS11aVxuICovXG5leHBvcnQgZnVuY3Rpb24gZ2V0UHJvYmluZ1NwaGVyZVNjZW5lKG5vZGU6IFNwYXRpYWxFbnRpdHksIHNwaGVyZT86IFNwYXRpYWxTZWFyY2gpOiBTcGF0aWFsU2NlbmVOb2RlW10ge1xuICBjb25zdCBzY2VuZVdpZHRoID0gbm9kZS54X2RpbWVuc2lvbiAvIDEwMDA7XG4gIGNvbnN0IHNjZW5lSGVpZ2h0ID0gbm9kZS55X2RpbWVuc2lvbiAvIDEwMDA7XG4gIGNvbnN0IHNjZW5lRGVwdGggPSBub2RlLnpfZGltZW5zaW9uIC8gMTAwMDtcbiAgY29uc3QgZGVmYXVsdFNwaGVyZVJhZGl1cyA9IE1hdGgubWF4KHNjZW5lV2lkdGgsIHNjZW5lSGVpZ2h0LCBzY2VuZURlcHRoKSAqIDAuMDc7XG4gIGNvbnN0IHNwaGVyZUxpbmVSYWRpdXMgPSBkZWZhdWx0U3BoZXJlUmFkaXVzICogMC4wNTtcbiAgY29uc3Qgc3BoZXJlTGluZUxlbmd0aCA9IGRlZmF1bHRTcGhlcmVSYWRpdXMgKiAyO1xuICBjb25zdCBzcGhlcmVDb25lUmFkaXVzID0gc3BoZXJlTGluZVJhZGl1cyAqIDQ7XG5cbiAgaWYgKCFzcGhlcmUpIHtcbiAgICBzcGhlcmUgPSB7XG4gICAgICB0YXJnZXQ6IG5vZGUucmVwcmVzZW50YXRpb25fb2YgPz8gbm9kZVsnQGlkJ10sXG4gICAgICByYWRpdXM6IGRlZmF1bHRTcGhlcmVSYWRpdXMsXG4gICAgICB4OiBzY2VuZVdpZHRoIC8gMixcbiAgICAgIHk6IHNjZW5lSGVpZ2h0IC8gMixcbiAgICAgIHo6IHNjZW5lRGVwdGggLyAyXG4gICAgfTtcbiAgfSBlbHNlIHtcbiAgICBzcGhlcmUgPSB7XG4gICAgICAuLi5zcGhlcmUsXG4gICAgICByYWRpdXM6IHNwaGVyZS5yYWRpdXMgLyAxMDAwLFxuICAgICAgeDogc3BoZXJlLnggLyAxMDAwLFxuICAgICAgeTogc3BoZXJlLnkgLyAxMDAwLFxuICAgICAgejogc3BoZXJlLnogLyAxMDAwXG4gICAgfTtcbiAgfVxuXG4gIHJldHVybiBbXG4gICAgLy8gUHJvYmluZyBTcGhlcmVcbiAgICB7XG4gICAgICAnQGlkJzogJ2h0dHA6Ly9wdXJsLm9yZy9jY2YvbGF0ZXN0L2NjZi5vd2wjUHJvYmluZ1NwaGVyZScsXG4gICAgICAnQHR5cGUnOiAnU3BhdGlhbFNjZW5lTm9kZScsXG4gICAgICB1bnBpY2thYmxlOiBmYWxzZSxcbiAgICAgIGdlb21ldHJ5OiAnc3BoZXJlJyxcbiAgICAgIHRyYW5zZm9ybU1hdHJpeDogbmV3IE1hdHJpeDQoTWF0cml4NC5JREVOVElUWSkudHJhbnNsYXRlKFtzcGhlcmUueCwgc3BoZXJlLnksIHNwaGVyZS56XSkuc2NhbGUoc3BoZXJlLnJhZGl1cyksXG4gICAgICBjb2xvcjogZ29sZFxuICAgIH0sXG4gICAgLy8gUHJvYmluZyBTcGhlcmUgUG9zaXRpdmUgWCBBeGlzIChEKVxuICAgIHtcbiAgICAgICdAaWQnOiAnaHR0cDovL3B1cmwub3JnL2NjZi9sYXRlc3QvY2NmLm93bCNQcm9iaW5nc3BoZXJlWEQnLFxuICAgICAgJ0B0eXBlJzogJ1NwYXRpYWxTY2VuZU5vZGUnLFxuICAgICAgdW5waWNrYWJsZTogdHJ1ZSxcbiAgICAgIGdlb21ldHJ5OiAnY3lsaW5kZXInLFxuICAgICAgdHJhbnNmb3JtTWF0cml4OiBuZXcgTWF0cml4NChNYXRyaXg0LklERU5USVRZKVxuICAgICAgICAudHJhbnNsYXRlKFtzcGhlcmUueCArIHNwaGVyZS5yYWRpdXMgKyBzcGhlcmVMaW5lTGVuZ3RoIC8gMiwgc3BoZXJlLnksIHNwaGVyZS56XSlcbiAgICAgICAgLnJvdGF0ZVoodG9SYWRpYW5zKC05MCkpXG4gICAgICAgIC5zY2FsZShbc3BoZXJlTGluZVJhZGl1cywgc3BoZXJlTGluZUxlbmd0aCwgc3BoZXJlTGluZVJhZGl1c10pLFxuICAgICAgY29sb3I6IHJlZFxuICAgIH0sXG4gICAge1xuICAgICAgJ0BpZCc6ICdodHRwOi8vcHVybC5vcmcvY2NmL2xhdGVzdC9jY2Yub3dsI1Byb2JpbmdzcGhlcmVYRENvbmUnLFxuICAgICAgJ0B0eXBlJzogJ1NwYXRpYWxTY2VuZU5vZGUnLFxuICAgICAgdW5waWNrYWJsZTogdHJ1ZSxcbiAgICAgIGdlb21ldHJ5OiAnY29uZScsXG4gICAgICB0cmFuc2Zvcm1NYXRyaXg6IG5ldyBNYXRyaXg0KE1hdHJpeDQuSURFTlRJVFkpXG4gICAgICAgIC50cmFuc2xhdGUoW3NwaGVyZS54ICsgc3BoZXJlLnJhZGl1cyArIHNwaGVyZUxpbmVMZW5ndGgsIHNwaGVyZS55LCBzcGhlcmUuel0pXG4gICAgICAgIC5yb3RhdGVaKHRvUmFkaWFucygtOTApKVxuICAgICAgICAuc2NhbGUoWyBzcGhlcmVDb25lUmFkaXVzLCBzcGhlcmVDb25lUmFkaXVzICogMywgc3BoZXJlQ29uZVJhZGl1cyBdKSxcbiAgICAgIGNvbG9yOiByZWRcbiAgICB9LFxuICAgIHtcbiAgICAgICdAaWQnOiAnaHR0cDovL3B1cmwub3JnL2NjZi9sYXRlc3QvY2NmLm93bCNQcm9iaW5nc3BoZXJlWERMYWJlbCcsXG4gICAgICAnQHR5cGUnOiAnU3BhdGlhbFNjZW5lTm9kZScsXG4gICAgICB1bnBpY2thYmxlOiB0cnVlLFxuICAgICAgZ2VvbWV0cnk6ICd0ZXh0JyxcbiAgICAgIHRleHQ6ICdEJyxcbiAgICAgIHRyYW5zZm9ybU1hdHJpeDogbmV3IE1hdHJpeDQoTWF0cml4NC5JREVOVElUWSlcbiAgICAgICAgLnRyYW5zbGF0ZShbc3BoZXJlLnggKyBzcGhlcmUucmFkaXVzICsgc3BoZXJlTGluZUxlbmd0aCArIHNwaGVyZUNvbmVSYWRpdXMgKiAzLCBzcGhlcmUueSwgc3BoZXJlLnpdKVxuICAgICAgICAuc2NhbGUoc3BoZXJlQ29uZVJhZGl1cyksXG4gICAgICBjb2xvcjogcmVkXG4gICAgfSxcbiAgICAvLyBQcm9iaW5nIFNwaGVyZSBOZWdhdGl2ZSBYIEF4aXMgKEEpXG4gICAge1xuICAgICAgJ0BpZCc6ICdodHRwOi8vcHVybC5vcmcvY2NmL2xhdGVzdC9jY2Yub3dsI1Byb2JpbmdzcGhlcmVYQScsXG4gICAgICAnQHR5cGUnOiAnU3BhdGlhbFNjZW5lTm9kZScsXG4gICAgICB1bnBpY2thYmxlOiB0cnVlLFxuICAgICAgZ2VvbWV0cnk6ICdjeWxpbmRlcicsXG4gICAgICB0cmFuc2Zvcm1NYXRyaXg6IG5ldyBNYXRyaXg0KE1hdHJpeDQuSURFTlRJVFkpXG4gICAgICAgIC50cmFuc2xhdGUoW3NwaGVyZS54IC0gc3BoZXJlLnJhZGl1cyAtIHNwaGVyZUxpbmVMZW5ndGggLyAyLCBzcGhlcmUueSwgc3BoZXJlLnpdKVxuICAgICAgICAucm90YXRlWih0b1JhZGlhbnMoLTkwKSlcbiAgICAgICAgLnNjYWxlKFtzcGhlcmVMaW5lUmFkaXVzLCBzcGhlcmVMaW5lTGVuZ3RoLCBzcGhlcmVMaW5lUmFkaXVzXSksXG4gICAgICBjb2xvcjogcmVkXG4gICAgfSxcbiAgICB7XG4gICAgICAnQGlkJzogJ2h0dHA6Ly9wdXJsLm9yZy9jY2YvbGF0ZXN0L2NjZi5vd2wjUHJvYmluZ3NwaGVyZVhBQ29uZScsXG4gICAgICAnQHR5cGUnOiAnU3BhdGlhbFNjZW5lTm9kZScsXG4gICAgICB1bnBpY2thYmxlOiB0cnVlLFxuICAgICAgZ2VvbWV0cnk6ICdjb25lJyxcbiAgICAgIHRyYW5zZm9ybU1hdHJpeDogbmV3IE1hdHJpeDQoTWF0cml4NC5JREVOVElUWSlcbiAgICAgICAgLnRyYW5zbGF0ZShbc3BoZXJlLnggLSBzcGhlcmUucmFkaXVzIC0gc3BoZXJlTGluZUxlbmd0aCwgc3BoZXJlLnksIHNwaGVyZS56XSlcbiAgICAgICAgLnJvdGF0ZVoodG9SYWRpYW5zKDkwKSlcbiAgICAgICAgLnNjYWxlKFsgc3BoZXJlQ29uZVJhZGl1cywgc3BoZXJlQ29uZVJhZGl1cyAqIDMsIHNwaGVyZUNvbmVSYWRpdXMgXSksXG4gICAgICBjb2xvcjogcmVkXG4gICAgfSxcbiAgICB7XG4gICAgICAnQGlkJzogJ2h0dHA6Ly9wdXJsLm9yZy9jY2YvbGF0ZXN0L2NjZi5vd2wjUHJvYmluZ3NwaGVyZVhBTGFiZWwnLFxuICAgICAgJ0B0eXBlJzogJ1NwYXRpYWxTY2VuZU5vZGUnLFxuICAgICAgdW5waWNrYWJsZTogdHJ1ZSxcbiAgICAgIGdlb21ldHJ5OiAndGV4dCcsXG4gICAgICB0ZXh0OiAnQScsXG4gICAgICB0cmFuc2Zvcm1NYXRyaXg6IG5ldyBNYXRyaXg0KE1hdHJpeDQuSURFTlRJVFkpXG4gICAgICAgIC50cmFuc2xhdGUoW3NwaGVyZS54IC0gc3BoZXJlLnJhZGl1cyAtIHNwaGVyZUxpbmVMZW5ndGggLSBzcGhlcmVDb25lUmFkaXVzICogMy41LCBzcGhlcmUueSwgc3BoZXJlLnpdKVxuICAgICAgICAuc2NhbGUoc3BoZXJlQ29uZVJhZGl1cyksXG4gICAgICBjb2xvcjogcmVkXG4gICAgfSxcbiAgICAvLyBQcm9iaW5nIFNwaGVyZSBQb3NpdGl2ZSBZIEF4aXMgKFcpXG4gICAge1xuICAgICAgJ0BpZCc6ICdodHRwOi8vcHVybC5vcmcvY2NmL2xhdGVzdC9jY2Yub3dsI1Byb2JpbmdzcGhlcmVZVycsXG4gICAgICAnQHR5cGUnOiAnU3BhdGlhbFNjZW5lTm9kZScsXG4gICAgICB1bnBpY2thYmxlOiB0cnVlLFxuICAgICAgZ2VvbWV0cnk6ICdjeWxpbmRlcicsXG4gICAgICB0cmFuc2Zvcm1NYXRyaXg6IG5ldyBNYXRyaXg0KE1hdHJpeDQuSURFTlRJVFkpXG4gICAgICAgIC50cmFuc2xhdGUoW3NwaGVyZS54LCBzcGhlcmUueSArIHNwaGVyZS5yYWRpdXMgKyBzcGhlcmVMaW5lTGVuZ3RoIC8gMiwgc3BoZXJlLnpdKVxuICAgICAgICAuc2NhbGUoW3NwaGVyZUxpbmVSYWRpdXMsIHNwaGVyZUxpbmVMZW5ndGgsIHNwaGVyZUxpbmVSYWRpdXNdKSxcbiAgICAgIGNvbG9yOiBncmVlblxuICAgIH0sXG4gICAge1xuICAgICAgJ0BpZCc6ICdodHRwOi8vcHVybC5vcmcvY2NmL2xhdGVzdC9jY2Yub3dsI1Byb2JpbmdzcGhlcmVZV0NvbmUnLFxuICAgICAgJ0B0eXBlJzogJ1NwYXRpYWxTY2VuZU5vZGUnLFxuICAgICAgdW5waWNrYWJsZTogdHJ1ZSxcbiAgICAgIGdlb21ldHJ5OiAnY29uZScsXG4gICAgICB0cmFuc2Zvcm1NYXRyaXg6IG5ldyBNYXRyaXg0KE1hdHJpeDQuSURFTlRJVFkpXG4gICAgICAgIC50cmFuc2xhdGUoW3NwaGVyZS54LCBzcGhlcmUueSArIHNwaGVyZS5yYWRpdXMgKyBzcGhlcmVMaW5lTGVuZ3RoLCBzcGhlcmUuel0pXG4gICAgICAgIC5zY2FsZShbIHNwaGVyZUNvbmVSYWRpdXMsIHNwaGVyZUNvbmVSYWRpdXMgKiAzLCBzcGhlcmVDb25lUmFkaXVzIF0pLFxuICAgICAgY29sb3I6IGdyZWVuXG4gICAgfSxcbiAgICB7XG4gICAgICAnQGlkJzogJ2h0dHA6Ly9wdXJsLm9yZy9jY2YvbGF0ZXN0L2NjZi5vd2wjUHJvYmluZ3NwaGVyZVlXTGFiZWwnLFxuICAgICAgJ0B0eXBlJzogJ1NwYXRpYWxTY2VuZU5vZGUnLFxuICAgICAgdW5waWNrYWJsZTogdHJ1ZSxcbiAgICAgIGdlb21ldHJ5OiAndGV4dCcsXG4gICAgICB0ZXh0OiAnVycsXG4gICAgICB0cmFuc2Zvcm1NYXRyaXg6IG5ldyBNYXRyaXg0KE1hdHJpeDQuSURFTlRJVFkpXG4gICAgICAgIC50cmFuc2xhdGUoW3NwaGVyZS54LCBzcGhlcmUueSArIHNwaGVyZS5yYWRpdXMgKyBzcGhlcmVMaW5lTGVuZ3RoICsgc3BoZXJlQ29uZVJhZGl1cyAqIDMsIHNwaGVyZS56XSlcbiAgICAgICAgLnNjYWxlKHNwaGVyZUNvbmVSYWRpdXMpLFxuICAgICAgY29sb3I6IGdyZWVuXG4gICAgfSxcbiAgICAvLyBQcm9iaW5nIFNwaGVyZSBOZWdhdGl2ZSBZIEF4aXMgKFMpXG4gICAge1xuICAgICAgJ0BpZCc6ICdodHRwOi8vcHVybC5vcmcvY2NmL2xhdGVzdC9jY2Yub3dsI1Byb2JpbmdzcGhlcmVZUycsXG4gICAgICAnQHR5cGUnOiAnU3BhdGlhbFNjZW5lTm9kZScsXG4gICAgICB1bnBpY2thYmxlOiB0cnVlLFxuICAgICAgZ2VvbWV0cnk6ICdjeWxpbmRlcicsXG4gICAgICB0cmFuc2Zvcm1NYXRyaXg6IG5ldyBNYXRyaXg0KE1hdHJpeDQuSURFTlRJVFkpXG4gICAgICAgIC50cmFuc2xhdGUoW3NwaGVyZS54LCBzcGhlcmUueSAtIHNwaGVyZS5yYWRpdXMgLSBzcGhlcmVMaW5lTGVuZ3RoIC8gMiwgc3BoZXJlLnpdKVxuICAgICAgICAuc2NhbGUoW3NwaGVyZUxpbmVSYWRpdXMsIHNwaGVyZUxpbmVMZW5ndGgsIHNwaGVyZUxpbmVSYWRpdXNdKSxcbiAgICAgIGNvbG9yOiBncmVlblxuICAgIH0sXG4gICAge1xuICAgICAgJ0BpZCc6ICdodHRwOi8vcHVybC5vcmcvY2NmL2xhdGVzdC9jY2Yub3dsI1Byb2JpbmdzcGhlcmVZU0NvbmUnLFxuICAgICAgJ0B0eXBlJzogJ1NwYXRpYWxTY2VuZU5vZGUnLFxuICAgICAgdW5waWNrYWJsZTogdHJ1ZSxcbiAgICAgIGdlb21ldHJ5OiAnY29uZScsXG4gICAgICB0cmFuc2Zvcm1NYXRyaXg6IG5ldyBNYXRyaXg0KE1hdHJpeDQuSURFTlRJVFkpXG4gICAgICAgIC50cmFuc2xhdGUoW3NwaGVyZS54LCBzcGhlcmUueSAtIHNwaGVyZS5yYWRpdXMgLSBzcGhlcmVMaW5lTGVuZ3RoLCBzcGhlcmUuel0pXG4gICAgICAgIC5yb3RhdGVaKHRvUmFkaWFucygxODApKVxuICAgICAgICAuc2NhbGUoWyBzcGhlcmVDb25lUmFkaXVzLCBzcGhlcmVDb25lUmFkaXVzICogMywgc3BoZXJlQ29uZVJhZGl1cyBdKSxcbiAgICAgIGNvbG9yOiBncmVlblxuICAgIH0sXG4gICAge1xuICAgICAgJ0BpZCc6ICdodHRwOi8vcHVybC5vcmcvY2NmL2xhdGVzdC9jY2Yub3dsI1Byb2JpbmdzcGhlcmVZU0xhYmVsJyxcbiAgICAgICdAdHlwZSc6ICdTcGF0aWFsU2NlbmVOb2RlJyxcbiAgICAgIHVucGlja2FibGU6IHRydWUsXG4gICAgICBnZW9tZXRyeTogJ3RleHQnLFxuICAgICAgdGV4dDogJ1MnLFxuICAgICAgdHJhbnNmb3JtTWF0cml4OiBuZXcgTWF0cml4NChNYXRyaXg0LklERU5USVRZKVxuICAgICAgICAudHJhbnNsYXRlKFtzcGhlcmUueCwgc3BoZXJlLnkgLSBzcGhlcmUucmFkaXVzIC0gc3BoZXJlTGluZUxlbmd0aCAtIHNwaGVyZUNvbmVSYWRpdXMgKiAzLjUsIHNwaGVyZS56XSlcbiAgICAgICAgLnNjYWxlKHNwaGVyZUNvbmVSYWRpdXMpLFxuICAgICAgY29sb3I6IGdyZWVuXG4gICAgfSxcbiAgICAvLyBQcm9iaW5nIFNwaGVyZSBQb3NpdGl2ZSBaIEF4aXMgKEUpXG4gICAge1xuICAgICAgJ0BpZCc6ICdodHRwOi8vcHVybC5vcmcvY2NmL2xhdGVzdC9jY2Yub3dsI1Byb2JpbmdzcGhlcmVaRScsXG4gICAgICAnQHR5cGUnOiAnU3BhdGlhbFNjZW5lTm9kZScsXG4gICAgICB1bnBpY2thYmxlOiB0cnVlLFxuICAgICAgZ2VvbWV0cnk6ICdjeWxpbmRlcicsXG4gICAgICB0cmFuc2Zvcm1NYXRyaXg6IG5ldyBNYXRyaXg0KE1hdHJpeDQuSURFTlRJVFkpXG4gICAgICAgIC50cmFuc2xhdGUoW3NwaGVyZS54LCBzcGhlcmUueSwgc3BoZXJlLnogKyBzcGhlcmUucmFkaXVzICsgc3BoZXJlTGluZUxlbmd0aCAvIDJdKVxuICAgICAgICAucm90YXRlWCh0b1JhZGlhbnMoOTApKVxuICAgICAgICAuc2NhbGUoW3NwaGVyZUxpbmVSYWRpdXMsIHNwaGVyZUxpbmVMZW5ndGgsIHNwaGVyZUxpbmVSYWRpdXNdKSxcbiAgICAgIGNvbG9yOiBibHVlXG4gICAgfSxcbiAgICB7XG4gICAgICAnQGlkJzogJ2h0dHA6Ly9wdXJsLm9yZy9jY2YvbGF0ZXN0L2NjZi5vd2wjUHJvYmluZ3NwaGVyZVpFQ29uZScsXG4gICAgICAnQHR5cGUnOiAnU3BhdGlhbFNjZW5lTm9kZScsXG4gICAgICB1bnBpY2thYmxlOiB0cnVlLFxuICAgICAgZ2VvbWV0cnk6ICdjb25lJyxcbiAgICAgIHRyYW5zZm9ybU1hdHJpeDogbmV3IE1hdHJpeDQoTWF0cml4NC5JREVOVElUWSlcbiAgICAgICAgLnRyYW5zbGF0ZShbc3BoZXJlLngsIHNwaGVyZS55LCBzcGhlcmUueiArIHNwaGVyZS5yYWRpdXMgKyBzcGhlcmVMaW5lTGVuZ3RoXSlcbiAgICAgICAgLnJvdGF0ZVgodG9SYWRpYW5zKDkwKSlcbiAgICAgICAgLnNjYWxlKFsgc3BoZXJlQ29uZVJhZGl1cywgc3BoZXJlQ29uZVJhZGl1cyAqIDMsIHNwaGVyZUNvbmVSYWRpdXMgXSksXG4gICAgICBjb2xvcjogYmx1ZVxuICAgIH0sXG4gICAge1xuICAgICAgJ0BpZCc6ICdodHRwOi8vcHVybC5vcmcvY2NmL2xhdGVzdC9jY2Yub3dsI1Byb2JpbmdzcGhlcmVaRUxhYmVsJyxcbiAgICAgICdAdHlwZSc6ICdTcGF0aWFsU2NlbmVOb2RlJyxcbiAgICAgIHVucGlja2FibGU6IHRydWUsXG4gICAgICBnZW9tZXRyeTogJ3RleHQnLFxuICAgICAgdGV4dDogJ0UnLFxuICAgICAgdHJhbnNmb3JtTWF0cml4OiBuZXcgTWF0cml4NChNYXRyaXg0LklERU5USVRZKVxuICAgICAgICAudHJhbnNsYXRlKFtzcGhlcmUueCwgc3BoZXJlLnksIHNwaGVyZS56ICsgc3BoZXJlLnJhZGl1cyArIHNwaGVyZUxpbmVMZW5ndGggKyBzcGhlcmVDb25lUmFkaXVzICogM10pXG4gICAgICAgIC5zY2FsZShzcGhlcmVDb25lUmFkaXVzKSxcbiAgICAgIGNvbG9yOiBibHVlXG4gICAgfSxcbiAgICAvLyBQcm9iaW5nIFNwaGVyZSBOZWdhdGl2ZSBaIEF4aXMgKFEpXG4gICAge1xuICAgICAgJ0BpZCc6ICdodHRwOi8vcHVybC5vcmcvY2NmL2xhdGVzdC9jY2Yub3dsI1Byb2JpbmdzcGhlcmVaUScsXG4gICAgICAnQHR5cGUnOiAnU3BhdGlhbFNjZW5lTm9kZScsXG4gICAgICB1bnBpY2thYmxlOiB0cnVlLFxuICAgICAgZ2VvbWV0cnk6ICdjeWxpbmRlcicsXG4gICAgICB0cmFuc2Zvcm1NYXRyaXg6IG5ldyBNYXRyaXg0KE1hdHJpeDQuSURFTlRJVFkpXG4gICAgICAgIC50cmFuc2xhdGUoW3NwaGVyZS54LCBzcGhlcmUueSwgc3BoZXJlLnogLSBzcGhlcmUucmFkaXVzIC0gc3BoZXJlTGluZUxlbmd0aCAvIDJdKVxuICAgICAgICAucm90YXRlWCh0b1JhZGlhbnMoLTkwKSlcbiAgICAgICAgLnNjYWxlKFtzcGhlcmVMaW5lUmFkaXVzLCBzcGhlcmVMaW5lTGVuZ3RoLCBzcGhlcmVMaW5lUmFkaXVzXSksXG4gICAgICBjb2xvcjogYmx1ZVxuICAgIH0sXG4gICAge1xuICAgICAgJ0BpZCc6ICdodHRwOi8vcHVybC5vcmcvY2NmL2xhdGVzdC9jY2Yub3dsI1Byb2JpbmdzcGhlcmVaUUNvbmUnLFxuICAgICAgJ0B0eXBlJzogJ1NwYXRpYWxTY2VuZU5vZGUnLFxuICAgICAgdW5waWNrYWJsZTogdHJ1ZSxcbiAgICAgIGdlb21ldHJ5OiAnY29uZScsXG4gICAgICB0cmFuc2Zvcm1NYXRyaXg6IG5ldyBNYXRyaXg0KE1hdHJpeDQuSURFTlRJVFkpXG4gICAgICAgIC50cmFuc2xhdGUoW3NwaGVyZS54LCBzcGhlcmUueSwgc3BoZXJlLnogLSBzcGhlcmUucmFkaXVzIC0gc3BoZXJlTGluZUxlbmd0aF0pXG4gICAgICAgIC5yb3RhdGVYKHRvUmFkaWFucygtOTApKVxuICAgICAgICAuc2NhbGUoWyBzcGhlcmVDb25lUmFkaXVzLCBzcGhlcmVDb25lUmFkaXVzICogMywgc3BoZXJlQ29uZVJhZGl1cyBdKSxcbiAgICAgIGNvbG9yOiBibHVlXG4gICAgfSxcbiAgICB7XG4gICAgICAnQGlkJzogJ2h0dHA6Ly9wdXJsLm9yZy9jY2YvbGF0ZXN0L2NjZi5vd2wjUHJvYmluZ3NwaGVyZVpRTGFiZWwnLFxuICAgICAgJ0B0eXBlJzogJ1NwYXRpYWxTY2VuZU5vZGUnLFxuICAgICAgdW5waWNrYWJsZTogdHJ1ZSxcbiAgICAgIGdlb21ldHJ5OiAndGV4dCcsXG4gICAgICB0ZXh0OiAnUScsXG4gICAgICB0cmFuc2Zvcm1NYXRyaXg6IG5ldyBNYXRyaXg0KE1hdHJpeDQuSURFTlRJVFkpXG4gICAgICAgIC50cmFuc2xhdGUoW3NwaGVyZS54LCBzcGhlcmUueSwgc3BoZXJlLnogLSBzcGhlcmUucmFkaXVzIC0gc3BoZXJlTGluZUxlbmd0aCAtIHNwaGVyZUNvbmVSYWRpdXMgKiAzLjVdKVxuICAgICAgICAuc2NhbGUoc3BoZXJlQ29uZVJhZGl1cyksXG4gICAgICBjb2xvcjogYmx1ZVxuICAgIH1cbiAgXTtcbn1cbiJdfQ== \ No newline at end of file diff --git a/ccf-database/esm2015/public-api.js b/ccf-database/esm2015/public-api.js deleted file mode 100644 index e601c485f..000000000 --- a/ccf-database/esm2015/public-api.js +++ /dev/null @@ -1,12 +0,0 @@ -/* - * Public API Surface of ccf - */ -export * from './lib/ccf-database'; -export * from './lib/ccf-spatial-scene'; -export * from './lib/interfaces'; -export * from './lib/spatial-types'; -export * from './lib/hubmap/hubmap-data-import'; -export * from './lib/util/ccf-database-status-tracker'; -export * from './lib/util/probing-sphere-scene'; -export * from './lib/util/origin-scene'; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljLWFwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3Byb2plY3RzL2NjZi1kYXRhYmFzZS9zcmMvcHVibGljLWFwaS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7R0FFRztBQUNILGNBQWMsb0JBQW9CLENBQUM7QUFDbkMsY0FBYyx5QkFBeUIsQ0FBQztBQUN4QyxjQUFjLGtCQUFrQixDQUFDO0FBQ2pDLGNBQWMscUJBQXFCLENBQUM7QUFDcEMsY0FBYyxpQ0FBaUMsQ0FBQztBQUNoRCxjQUFjLHdDQUF3QyxDQUFDO0FBQ3ZELGNBQWMsaUNBQWlDLENBQUM7QUFDaEQsY0FBYyx5QkFBeUIsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbIi8qXG4gKiBQdWJsaWMgQVBJIFN1cmZhY2Ugb2YgY2NmXG4gKi9cbmV4cG9ydCAqIGZyb20gJy4vbGliL2NjZi1kYXRhYmFzZSc7XG5leHBvcnQgKiBmcm9tICcuL2xpYi9jY2Ytc3BhdGlhbC1zY2VuZSc7XG5leHBvcnQgKiBmcm9tICcuL2xpYi9pbnRlcmZhY2VzJztcbmV4cG9ydCAqIGZyb20gJy4vbGliL3NwYXRpYWwtdHlwZXMnO1xuZXhwb3J0ICogZnJvbSAnLi9saWIvaHVibWFwL2h1Ym1hcC1kYXRhLWltcG9ydCc7XG5leHBvcnQgKiBmcm9tICcuL2xpYi91dGlsL2NjZi1kYXRhYmFzZS1zdGF0dXMtdHJhY2tlcic7XG5leHBvcnQgKiBmcm9tICcuL2xpYi91dGlsL3Byb2Jpbmctc3BoZXJlLXNjZW5lJztcbmV4cG9ydCAqIGZyb20gJy4vbGliL3V0aWwvb3JpZ2luLXNjZW5lJztcbiJdfQ== \ No newline at end of file diff --git a/ccf-database/fesm2015/ccf-database.js b/ccf-database/fesm2015/ccf-database.js deleted file mode 100644 index 6a3639cd4..000000000 --- a/ccf-database/fesm2015/ccf-database.js +++ /dev/null @@ -1,2862 +0,0 @@ -import { __awaiter } from 'tslib'; -import { get as get$1, delMany, setMany } from 'idb-keyval'; -import { readQuads, Util, DataFactory, addJsonLdToStore, Store, deserializeN3Store, addN3ToStore, addRdfXmlToStore, serializeN3Store } from 'triple-store-utils'; -import { toRadians, Matrix4, Euler, toDegrees } from '@math.gl/core'; -import { DirectedGraph } from 'graphology'; -import shortestPath from 'graphology-shortest-path/unweighted'; -import { sortBy, get, toNumber, set, omit, isFinite, memoize } from 'lodash'; -import { v4 } from 'uuid'; -import { fromRdf } from 'rdf-literal'; -import { OrientedBoundingBox } from '@math.gl/culling'; - -/** - * Iterates over the key/value pairs for an IRI, using the specified mapping with quads from the store. - * - * @param store The triple store. - * @param iri The data identifier. - * @param mapping Property mappings. - * @returns an iterator over the key/value pairs - */ -function* getEntries(store, iri, mapping) { - for (const [predicate, key] of Object.entries(mapping)) { - for (const quad of readQuads(store, iri, predicate, null, null)) { - const value = quad.object.termType === 'Literal' ? fromRdf(quad.object) : quad.object.id; - yield [key, value]; - } - } -} -/** - * Creates an object of the specified type using quads from the store. - * - * @param store The triple store. - * @param iri The data identifier. - * @param type Type name. - * @param mapping Property mappings. - * @returns A new data object. - */ -function getMappedResult(store, iri, type, mapping) { - const result = { '@id': iri, '@type': type }; - for (const [predicate, key] of Object.entries(mapping)) { - for (const quad of readQuads(store, result['@id'], predicate, null, null)) { - const value = quad.object.termType === 'Literal' ? fromRdf(quad.object) : quad.object.id; - result[key] = value; - } - } - return result; -} - -/* eslint-disable @typescript-eslint/naming-convention */ -/** Constants used to create entity accessors. */ -const PREFIXES = { - base: 'http://purl.org/ccf/latest/ccf.owl#', - ccf: 'http://purl.org/ccf/', - fma: 'http://purl.org/sig/ont/fma/fma', - obo: 'http://purl.obolibrary.org/obo/', - uberon: 'http://purl.obolibrary.org/obo/UBERON_', - cl: 'http://purl.obolibrary.org/obo/CL_', - 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/', - dcterms: 'http://purl.org/dc/terms/' -}; -/** Prefix factory. */ -const prefixer = Util.prefixes(PREFIXES, DataFactory); -const rdf = { - x: prefixer('rdf'), - type: prefixer('rdf')('type') -}; -const rdfs = { - x: prefixer('rdfs'), - label: prefixer('rdfs')('label'), - comment: prefixer('rdfs')('comment'), - isDefinedBy: prefixer('rdfs')('isDefinedBy'), - seeAlso: prefixer('rdfs')('seeAlso') -}; -/** CCF id helper. */ -const ccfx = prefixer('ccf'); -/** Common entity ids. */ -const entity = { - id: prefixer('ccf')('has_registration_location'), - label: prefixer('rdfs')('label'), - description: prefixer('rdfs')('comment'), - link: ccfx('url'), - sex: ccfx('sex'), - age: ccfx('age'), - bmi: ccfx('bmi'), - Male: DataFactory.literal('Male'), - Female: DataFactory.literal('Female'), - consortiumName: ccfx('consortium_name'), - providerName: ccfx('tissue_provider_name'), - providerUUID: ccfx('tissue_provider_uuid'), - donor: ccfx('comes_from'), - sections: ccfx('subdivided_into_sections'), - datasets: ccfx('generates_dataset'), - sampleType: ccfx('sample_type'), - TissueBlock: DataFactory.literal('Tissue Block'), - TissueSection: DataFactory.literal('Tissue Section'), - NonStandard: DataFactory.literal('Non-standard'), - sectionCount: ccfx('section_count'), - sectionSize: ccfx('section_size'), - sectionUnits: ccfx('section_size_unit'), - sectionNumber: ccfx('section_number'), - spatialEntity: ccfx('has_registration_location'), - ontologyTerms: ccfx('has_ontology_term'), - cellTypeTerms: ccfx('has_cell_type_term'), - technology: ccfx('technology'), - thumbnail: ccfx('thumbnail') -}; -/** CCF specific ids. */ -const ccf = { - x: ccfx, - base: prefixer('base'), - ontologyNode: { - label: ccfx('ccf_pref_label'), - parent: ccfx('ccf_part_of'), - children: ccfx('ccf_part_of'), - rui_rank: ccfx('rui_rank'), - synonymLabels: DataFactory.namedNode('http://www.geneontology.org/formats/oboInOwl#hasExactSynonym') - }, - asctb: { - part_of: ccfx('ccf_part_of'), - ct_is_a: ccfx('ccf_ct_isa'), - located_in: ccfx('ccf_located_in'), - characterizes: ccfx('ccf_characterizes') - }, - spatial: { - Female: prefixer('base')('VHFemale'), - Male: prefixer('base')('VHMale'), - BothSexes: prefixer('base')('VHBothSexes'), - FemaleOrgans: prefixer('base')('VHFemaleOrgans'), - MaleOrgans: prefixer('base')('VHMaleOrgans') - }, - SpatialObjectReference: ccfx('spatial_object_reference'), - SpatialEntity: ccfx('spatial_entity'), - SpatialPlacement: ccfx('spatial_placement'), - spatialObjectReference: { - file: ccfx('file_url'), - file_format: ccfx('file_format'), - file_subpath: ccfx('file_subpath') - }, - extractionSet: { - label: prefixer('rdfs')('label'), - rui_rank: ccfx('rui_rank') - }, - spatialEntity: { - label: prefixer('rdfs')('label'), - description: prefixer('rdfs')('comment'), - creator: prefixer('dcterms')('creator'), - creator_first_name: ccfx('creator_first_name'), - creator_last_name: ccfx('creator_last_name'), - creator_orcid: ccfx('creator_orcid'), - creation_date: prefixer('dcterms')('created'), - updated_date: ccfx('updated_date'), - ccf_annotations: ccfx('collides_with'), - representation_of: ccfx('representation_of'), - reference_organ: ccfx('has_reference_organ'), - extraction_set_for: ccfx('extraction_set_for'), - extraction_set: ccfx('has_extraction_set'), - sex: ccfx('organ_owner_sex'), - side: ccfx('organ_side'), - rui_rank: ccfx('rui_rank'), - slice_thickness: ccfx('slice_thickness'), - slice_count: ccfx('slice_count'), - x_dimension: ccfx('x_dimension'), - y_dimension: ccfx('y_dimension'), - z_dimension: ccfx('z_dimension'), - dimension_units: ccfx('dimension_unit'), - object: ccfx('has_object_reference') - }, - spatialPlacement: { - source: ccfx('placement_for'), - target: ccfx('placement_relative_to'), - placement_date: prefixer('dcterms')('created'), - x_scaling: ccfx('x_scaling'), - y_scaling: ccfx('y_scaling'), - z_scaling: ccfx('z_scaling'), - scaling_units: ccfx('scaling_unit'), - x_rotation: ccfx('x_rotation'), - y_rotation: ccfx('y_rotation'), - z_rotation: ccfx('z_rotation'), - w_rotation: ccfx('theta_rotation'), - rotation_order: ccfx('rotation_order'), - rotation_units: ccfx('rotation_unit'), - x_translation: ccfx('x_translation'), - y_translation: ccfx('y_translation'), - z_translation: ccfx('z_translation'), - translation_units: ccfx('translation_unit') - } -}; -/** Uberon specific ids. */ -const uberon = { - x: prefixer('uberon'), - body: prefixer('uberon')('0013702') -}; -/** CL specific ids. */ -const cl = { - x: prefixer('cl'), - cell: prefixer('cl')('0000000') -}; -/** FMA specific ids. */ -const fma = { - x: prefixer('fma') -}; -/** LMHA specific ids. */ -const lmha = { - x: prefixer('lmha') -}; -/** RUI accessors. */ -const rui = { - body: uberon.body, - cell: cl.cell, - respiratory_system: uberon.x('0001004'), - colon: uberon.x('0001155'), - left_lung: uberon.x('0002168'), - right_lung: uberon.x('0002167'), - left_bronchus: uberon.x('0002178'), - right_bronchus: uberon.x('0002177'), - kidney: uberon.x('0002113'), - ureter: uberon.x('0000056'), - eye: uberon.x('0000970'), - fallopian_tube: uberon.x('0003889'), - knee: uberon.x('0001465'), - ovary: uberon.x('0000992'), - trachea: uberon.x('0003126'), - aorta: uberon.x('0000947'), - blood: uberon.x('0000178'), - bone_marrow: uberon.x('0002371'), - male_reproductive_system: uberon.x('0000079'), - lymph_node: uberon.x('0000029'), - // Derived using console.log(ALL_POSSIBLE_ORGANS.map(o => ` ${o.name.toLowerCase().replace(',', '').replace(/ /g, '_')}: ${o.id.split('/').slice(-1)[0].split('_')[0].toLowerCase()}.x('${o.id.split('_').slice(-1)[0]}'),`).join('\n')); - blood_vasculature: uberon.x('0004537'), - brain: uberon.x('0000955'), - eye_left: uberon.x('0004548'), - eye_right: fma.x('54449'), - fallopian_tube_left: uberon.x('0001303'), - fallopian_tube_right: uberon.x('0001302'), - heart: uberon.x('0000948'), - kidney_left: uberon.x('0004538'), - kidney_right: uberon.x('0004539'), - knee_left: fma.x('24978'), - knee_right: fma.x('24977'), - large_intestine: uberon.x('0000059'), - liver: uberon.x('0002107'), - lungs: uberon.x('0002048'), - mesenteric_lymph_node: uberon.x('0002509'), - ovary_left: fma.x('7214'), - ovary_right: fma.x('7213'), - pancreas: uberon.x('0001264'), - pelvis: uberon.x('0001270'), - prostate_gland: uberon.x('0002367'), - skin: uberon.x('0002097'), - small_intestine: uberon.x('0002108'), - spleen: uberon.x('0002106'), - thymus: uberon.x('0002370'), - ureter_left: uberon.x('0001223'), - ureter_right: uberon.x('0001222'), - urinary_bladder: uberon.x('0001255'), - uterus: uberon.x('0000995') -}; - -/** - * Reverses the keys and values in a mapping. - * - * @param mapping The mapping to reverse. - * @returns The reversed mapping. - */ -function reverseMapping(mapping) { - const newMapping = {}; - Object.entries(mapping).forEach(([prop, predicate]) => { - newMapping[predicate.id] = prop; - }); - return newMapping; -} -/** A mapping of spatial objects. */ -const mappings = { - spatialObjectReference: reverseMapping(ccf.spatialObjectReference), - spatialEntity: reverseMapping(ccf.spatialEntity), - spatialPlacement: reverseMapping(ccf.spatialPlacement) -}; -/** - * Creates a spatial object reference. - * - * @param store The triple store. - * @param iri The data identifier. - * @returns The new reference. - */ -function getSpatialObjectReference(store, iri) { - return getMappedResult(store, iri, 'SpatialObjectReference', mappings.spatialObjectReference); -} -/** - * Creates an extraction set data object. - * - * @param store The triple store. - * @param iri The data identifier. - * @returns The new entity. - */ -function getExtractionSet(store, iri) { - const result = getMappedResult(store, iri, 'ExtractionSet', mappings.spatialEntity); - result.extractionSites = sortBy(store.getSubjects(ccf.spatialEntity.extraction_set, iri, null) - .map((value) => getSpatialEntity(store, value.id)), ['rui_rank']); - return result; -} -/** - * Gets extraction sets associated with a reference organ - * - * @param store The triple store. - * @param iri The data identifier (the reference organ). - * @returns A set of extraction sets associated with the reference organ - */ -function getExtractionSets(store, iri) { - return sortBy(store.getSubjects(ccf.spatialEntity.extraction_set_for, iri, null) - .map((value) => getExtractionSet(store, value.id)), ['rui_rank']); -} -/** - * Gets the anatomical structures associated with a reference organ. - * - * @param store The triple store. - * @param iri The data identifier (reference organ). - * @returns The new entity. - */ -function getAnatomicalStructures(store, iri) { - return sortBy(store.getSubjects(ccf.spatialEntity.reference_organ, iri, null) - .map((value) => getSpatialEntity(store, value.id)) - .filter((e) => e['@id'] !== iri), ['rui_rank']); -} -/** - * Gets all reference organs in the triple store - * - * @param store The triple store. - * @returns All the reference organs. - */ -function getReferenceOrgans(store) { - const results = []; - store.forEach((quad) => { - if (quad.subject.id === quad.object.id) { - results.push(getSpatialEntity(store, quad.subject.id)); - } - }, null, ccf.spatialEntity.reference_organ, null, null); - return sortBy(results, ['rui_rank']); -} -/** - * Creates a spatial entity data object. - * - * @param store The triple store. - * @param iri The data identifier. - * @returns The new entity. - */ -function getSpatialEntity(store, iri) { - const result = getMappedResult(store, iri, 'SpatialEntity', mappings.spatialEntity); - // Default mapping will come back as an IRI which we can look up for the full object - if (result.object) { - result.object = getSpatialObjectReference(store, result.object); - } - if (result.ccf_annotations) { - result.ccf_annotations = store.getObjects(iri, ccf.spatialEntity.ccf_annotations, null).map(o => o.id); - } - store.forSubjects((subject) => (result.entityId = subject.id), entity.spatialEntity, iri, null); - return result; -} -/** - * Creates a spatial placement object. - * - * @param store The triple store. - * @param iri The data identifier. - * @returns THe new placement object. - */ -function getSpatialPlacement(store, iri) { - const result = getMappedResult(store, iri, 'SpatialPlacement', mappings.spatialPlacement); - // Default mapping will come back as an IRI for source/target which we can look up for the full object - if (result.source) { - result.source = getSpatialEntity(store, result.source); - } - if (result.target) { - result.target = getSpatialEntity(store, result.target); - } - return result; -} -/** - * Creates a spatial entity based on another entity in the store. - * - * @param store The triple store. - * @param entityIRI The indentifier of the store entity. - * @returns A new entity. - */ -function getSpatialEntityForEntity(store, entityIRI) { - const spatialEntityNodes = store.getObjects(DataFactory.namedNode(entityIRI), entity.spatialEntity, null); - if (spatialEntityNodes.length > 0) { - return getSpatialEntity(store, spatialEntityNodes[0].id); - } - else { - return undefined; - } -} - -/* eslint-disable @typescript-eslint/naming-convention */ -function applySpatialPlacement(tx, placement) { - const p = placement; - let factor; - switch (p.translation_units) { - case 'centimeter': - factor = 1 / 100; - break; - case 'millimeter': - factor = 1 / 1000; - break; - case 'meter': - default: - factor = 1; - break; - } - const T = [p.x_translation, p.y_translation, p.z_translation].map(t => t * factor); - const R = [p.x_rotation, p.y_rotation, p.z_rotation].map(toRadians); - const S = [p.x_scaling, p.y_scaling, p.z_scaling]; - return tx.translate(T).rotateXYZ(R).scale(S); -} -class CCFSpatialGraph { - constructor(db) { - this.db = db; - this.createGraph(); - } - createGraph() { - this.graph = new DirectedGraph(); - const store = this.db.store; - // Add all Spatial Object References - store.forSubjects((subject) => { - this.addNode(subject.id, 'SpatialObjectReference'); - }, rdf.type, ccf.SpatialObjectReference, null); - // Add all Spatial Entities - store.forSubjects((subject) => { - this.addNode(subject.id, 'SpatialEntity'); - }, rdf.type, ccf.SpatialEntity, null); - // Add all Spatial Placements - const edgeSource = {}; - for (const quad of readQuads(store, null, ccf.spatialPlacement.source, null, null)) { - edgeSource[quad.subject.id] = quad.object.id; - } - for (const quad of readQuads(store, null, ccf.spatialPlacement.target, null, null)) { - const source = edgeSource[quad.subject.id]; - if (source) { - this.addEdge(quad.subject.id, source, quad.object.id, 'SpatialPlacement'); - } - } - } - addNode(id, type) { - this.graph.mergeNode(id, { type }); - } - addEdge(id, source, target, type) { - this.graph.mergeDirectedEdge(source, target, { type, id }); - } - getTransformationMatrix(sourceIRI, targetIRI) { - if (sourceIRI === targetIRI) { - return new Matrix4(Matrix4.IDENTITY); // identity - } - if (!this.graph.hasNode(sourceIRI) || !this.graph.hasNode(targetIRI)) { - return undefined; - } - const store = this.db.store; - const tx = new Matrix4(Matrix4.IDENTITY); - const path = shortestPath(this.graph, sourceIRI, targetIRI); - if (path && path.length > 0) { - path.reverse(); - let target = ''; - for (const source of path) { - if (target) { - const placementId = this.graph.getEdgeAttribute(source, target, 'id'); - const placement = getSpatialPlacement(store, placementId); - applySpatialPlacement(tx, placement); - } - target = source; - } - return tx; - } - else { - return undefined; - } - } - getSpatialPlacement(source, targetIri) { - const sourceIri = this.graph.hasNode(source['@id']) ? source['@id'] : undefined; - const placement = get(source, 'placement[0]', get(source, 'placement', undefined)); - let matrix; - if (placement && this.graph.hasNode(placement.target)) { - matrix = this.getTransformationMatrix(placement.target, targetIri); - if (matrix) { - matrix = applySpatialPlacement(matrix, placement); - } - } - else if (sourceIri) { - matrix = this.getTransformationMatrix(sourceIri, targetIri); - } - if (matrix) { - const euler = new Euler().fromRotationMatrix(matrix, Euler.XYZ); - const T = matrix.getTranslation().map(n => n * 1000); - const R = euler.toVector3().map(toDegrees); - const S = matrix.getScale().map(n => n < 1 && n > 0.999999 ? 1 : n); - return { - '@context': 'https://hubmapconsortium.github.io/hubmap-ontology/ccf-context.jsonld', - '@id': `http://purl.org/ccf/1.5/${v4()}_placement`, - '@type': 'SpatialPlacement', - source: source['@id'], - target: targetIri, - placement_date: new Date().toISOString().split('T')[0], - x_scaling: S[0], - y_scaling: S[1], - z_scaling: S[2], - scaling_units: 'ratio', - x_rotation: R[0], - y_rotation: R[1], - z_rotation: R[2], - rotation_order: 'XYZ', - rotation_units: 'degree', - x_translation: T[0], - y_translation: T[1], - z_translation: T[2], - translation_units: 'millimeter' - }; - } - else { - return undefined; - } - } -} - -/* eslint-disable @typescript-eslint/naming-convention */ -class CCFSpatialScene { - constructor(db) { - this.db = db; - } - getSpatialEntity(iri) { - return getSpatialEntity(this.db.store, iri); - } - getExtractionSets(iri) { - return getExtractionSets(this.db.store, iri); - } - getExtractionSet(iri) { - return getExtractionSet(this.db.store, iri); - } - getAnatomicalStructures(iri) { - return getAnatomicalStructures(this.db.store, iri); - } - getReferenceOrgans() { - return getReferenceOrgans(this.db.store); - } - getReferenceBody(filter) { - let bodyId; - switch (filter === null || filter === void 0 ? void 0 : filter.sex) { - case 'Male': - bodyId = ccf.spatial.Male.id; - break; - case 'Female': - bodyId = ccf.spatial.Female.id; - break; - case 'Both': - default: - bodyId = ccf.spatial.BothSexes.id; - break; - } - return this.getSpatialEntity(bodyId); - } - getReferenceOrganSets(filter) { - let organSet = this.getReferenceOrgans(); - switch (filter === null || filter === void 0 ? void 0 : filter.sex) { - case 'Male': - organSet = organSet.filter(s => s.sex === 'Male'); - break; - case 'Female': - organSet = organSet.filter(s => s.sex === 'Female'); - break; - case 'Both': - default: - break; - } - if (filter === null || filter === void 0 ? void 0 : filter.debug) { - organSet = organSet.map(o => [[o], this.getAnatomicalStructures(o['@id'])]) - .reduce((acc, [organ, structures]) => acc.concat(structures.length > 0 ? structures : organ), []); - } - return organSet; - } - getReferenceSceneNodes(filter) { - const body = this.getReferenceBody(filter); - const skinNodes = []; - let nodes = [ - ...this.getReferenceOrganSets(filter).map((organ) => { - const isSkin = organ.representation_of === 'http://purl.obolibrary.org/obo/UBERON_0002097'; - const sceneNode = this.getSceneNode(organ, body, { - color: [255, 255, 255, 255], opacity: isSkin ? 0.5 : 0.2, unpickable: true, _lighting: 'pbr', zoomBasedOpacity: !isSkin - }); - if (isSkin && sceneNode) { - skinNodes.push(sceneNode); - return undefined; - } - else { - return sceneNode; - } - }) - ]; - if (skinNodes.length > 0) { - nodes = [...skinNodes, ...nodes]; - } - if (filter === null || filter === void 0 ? void 0 : filter.debug) { - // Debug bounding boxes - nodes = nodes.concat([ - this.getSceneNode(this.getSpatialEntity(ccf.base('VHRightKidney').id), body, { color: [0, 0, 255, 0.5 * 255], geometry: 'wireframe' }), - this.getSceneNode(this.getSpatialEntity(ccf.base('VHLeftKidney').id), body, { color: [255, 0, 0, 0.5 * 255], geometry: 'wireframe' }), - this.getSceneNode(this.getSpatialEntity(ccf.base('VHSpleenCC1').id), body, { color: [0, 255, 0, 0.5 * 255], geometry: 'wireframe' }), - this.getSceneNode(this.getSpatialEntity(ccf.base('VHSpleenCC2').id), body, { color: [0, 255, 0, 0.5 * 255], geometry: 'wireframe' }), - this.getSceneNode(this.getSpatialEntity(ccf.base('VHSpleenCC3').id), body, { color: [0, 255, 0, 0.5 * 255], geometry: 'wireframe' }) - ]); - } - return nodes.filter(s => s !== undefined); - } - getReferenceOrganScene(organIri, filter) { - var _a, _b; - const hasSexFilter = (filter === null || filter === void 0 ? void 0 : filter.sex) !== undefined && ((_a = filter === null || filter === void 0 ? void 0 : filter.sex) === null || _a === void 0 ? void 0 : _a.toLowerCase()) !== 'both'; - const organs = this.getReferenceOrgans().filter((o) => o.representation_of === organIri && (!hasSexFilter || o.sex === (filter === null || filter === void 0 ? void 0 : filter.sex))); - if (organs.length > 0) { - const organ = organs[0]; - const isSkin = organ.representation_of === 'http://purl.obolibrary.org/obo/UBERON_0002097'; - const organNode = this.getSceneNode(organ, organ, { - color: [255, 255, 255, 255], opacity: isSkin ? 0.5 : 0.2, unpickable: true, _lighting: 'pbr' - }); - const scene = ((_b = this.db.getSpatialEntities(filter)) !== null && _b !== void 0 ? _b : []).map((entity) => this.getSceneNode(entity, organ, { color: [255, 255, 255, 0.9 * 255] })); - return [organNode].concat(scene).filter(n => n !== undefined); - } - else { - return []; - } - } - getEntitySceneNodes(filter) { - const body = this.getReferenceBody(filter); - return this.db.getSpatialEntities(filter).map((entity) => this.getSceneNode(entity, body, { color: [255, 255, 255, 0.9 * 255] })).filter(s => s !== undefined); - } - getSceneNode(source, target, nodeAttrs = {}) { - var _a, _b, _c, _d; - const has3dObject = (_b = (_a = source === null || source === void 0 ? void 0 : source.object) === null || _a === void 0 ? void 0 : _a.file_format) === null || _b === void 0 ? void 0 : _b.startsWith('model/gltf'); - const sourceID = has3dObject && source.object ? source.object['@id'] : source['@id']; - let transform = this.db.graph.getTransformationMatrix(sourceID, target['@id']); - if (transform) { - if (has3dObject) { - transform = new Matrix4(Matrix4.IDENTITY).rotateX(toRadians(90)).multiplyLeft(transform); - } - else { - // Scale visible bounding boxes to the desired dimensions - let factor; - switch (source.dimension_units) { - case 'centimeter': - factor = 1 / 100; - break; - case 'millimeter': - factor = 1 / 1000; - break; - case 'meter': - default: - factor = 1; - break; - } - const scale = [source.x_dimension, source.y_dimension, source.z_dimension].map(dim => dim * factor / 2); - transform.scale(scale); - } - return Object.assign({ '@id': source['@id'], '@type': 'SpatialSceneNode', entityId: source.entityId, ccf_annotations: source.ccf_annotations, representation_of: source.representation_of, reference_organ: source.reference_organ, scenegraph: has3dObject ? (_c = source.object) === null || _c === void 0 ? void 0 : _c.file : undefined, scenegraphNode: has3dObject ? (_d = source.object) === null || _d === void 0 ? void 0 : _d.file_subpath : undefined, transformMatrix: transform, tooltip: source.label }, nodeAttrs); - } - else { - return undefined; - } - } - getScene(filter) { - return [ - ...this.getReferenceSceneNodes(filter), - ...this.getEntitySceneNodes(filter) - ]; - } -} - -const HBM_PREFIX = 'https://entity.api.hubmapconsortium.org/entities/'; -// eslint-disable-next-line max-len -const DR1_VU_THUMBS = 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']); -// eslint-disable-next-line max-len -const UFL_THUMBS = { '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' }; -/** UUID to TMC mapping. */ -const GROUP_UUID_MAPPING = { - '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', - '5c106f29-ea2d-11e9-85e8-0efb3ba9a670': 'RTI-General Electric', - '301615f9-c870-11eb-a8dc-35ce3d8786fe': 'TMC-UConn' -}; -const ENTITY_CONTEXT = { - '@base': 'http://purl.org/ccf/latest/ccf-entity.owl#', - '@vocab': 'http://purl.org/ccf/latest/ccf-entity.owl#', - ccf: 'http://purl.org/ccf/', - 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' - }, - // eslint-disable-next-line @typescript-eslint/naming-convention - rui_location: { - '@id': 'has_spatial_entity', - '@type': '@id' - }, - ontologyTerms: { - '@id': 'has_ontology_term', - '@type': '@id' - }, - cellTypeTerms: { - '@id': 'has_cell_type_term', - '@type': '@id' - }, - thumbnail: { - '@id': 'has_thumbnail' - } -}; -/** - * Converts a hubmap response object into JsonLd. - * - * @param data The hubmap data. - * @returns The converted data. - */ -function hubmapResponseAsJsonLd(data, assetsApi = '', portalUrl = '', serviceToken, debug = false) { - const entries = get(data, 'hits.hits', []) - .map(e => get(e, '_source', {})) - .sort((a, b) => a['uuid'].localeCompare(b['uuid'])); - const donorLookup = {}; - const unflattened = entries.map(e => new HuBMAPTissueBlock(e, assetsApi, portalUrl, serviceToken).toJsonLd()); - for (const donor of unflattened) { - const donorId = donor['@id']; - if (!donorLookup[donorId]) { - donorLookup[donorId] = donor; - } - else { - const samples = donorLookup[donorId].samples; - samples.push(donor.samples[0]); - } - } - const donors = Object.values(donorLookup); - if (debug) { - debugDonors(donors); - console.log(donors.map(d => (Object.assign({ '@context': ENTITY_CONTEXT }, d)))); - } - return { '@context': ENTITY_CONTEXT, '@graph': donors }; -} -function debugDonors(donors) { - let datasets = []; - let deleted = 0; - for (const donor of donors.filter(d => d.samples.length > 1)) { - const samples = donor.samples; - for (let i = 0; i < samples.length; i++) { - const blockId = samples[i]['@id']; - datasets = datasets.concat(samples[i].datasets); - for (const section of samples[i].sections) { - datasets = datasets.concat(section.datasets); - } - for (let j = i + 1; j < samples.length; j++) { - const sections = samples[j].sections; - if (sections.find(s => s['@id'] === blockId)) { - samples[i].deleteMe = true; - deleted++; - } - } - } - donor.samples = samples.filter(s => s.deleteMe !== true); - } - if (deleted > 0) { - console.log(`âš  ${deleted} sections identified as blocks`); - } -} -class HuBMAPTissueBlock { - constructor(data, assetsApi = '', portalUrl = '', serviceToken) { - var _a, _b; - this.data = data; - this.bad = false; - this['@type'] = 'Sample'; - this.sample_type = 'Tissue Block'; - const entityType = this.data.entity_type; - if (entityType !== 'Sample') { - this.bad = true; - return; - } - const ancestors = (this.data.ancestors || []); - const descendants = (this.data.descendants || []); - const donor = ancestors.find(e => e.entity_type === 'Donor'); - this.donor = this.getDonor(donor, portalUrl); - const ruiLocation = this.getRuiLocation(data, this.donor); - if (!ruiLocation) { - this.bad = true; - } - else { - this.rui_location = ruiLocation; - } - if (!GROUP_UUID_MAPPING[data.group_uuid]) { - GROUP_UUID_MAPPING[data.group_uuid] = data.group_name; - } - const dateEntered = new Date(data.last_modified_timestamp).toLocaleDateString(); - const groupName = GROUP_UUID_MAPPING[data.group_uuid] || data.group_name; - const creator = data.created_by_user_displayname; - this['@id'] = HBM_PREFIX + data.uuid; - this.label = `Registered ${dateEntered}, ${creator}, ${groupName}`; - this.link = `${portalUrl}browse/sample/${data.uuid}`; - const sectionLookup = {}; - const sections = []; - this.sections = sections; - const datasets = []; - this.datasets = datasets; - for (const descendant of descendants.filter(d => d.entity_type === 'Sample')) { - const section = this.getSection(descendant, data, portalUrl); - const sectionId = descendant.submission_id; - sectionLookup[sectionId] = section; - sections.push(section); - section.section_number = (_a = section.section_number) !== null && _a !== void 0 ? _a : sections.length; - } - for (const descendant of descendants) { - if (descendant.entity_type === 'Dataset') { - const dataset = this.getDataset(descendant, assetsApi, portalUrl, serviceToken); - const sectionId = get(descendant, ['ingest_metadata', 'metadata', 'tissue_id']); - if (sectionLookup[sectionId]) { - (_b = sectionLookup[sectionId].datasets) === null || _b === void 0 ? void 0 : _b.push(dataset); - } - else { - datasets.push(dataset); - } - } - } - const loc = ruiLocation !== null && ruiLocation !== void 0 ? ruiLocation : {}; - const dims = `${loc.x_dimension} x ${loc.y_dimension} x ${loc.z_dimension} ${loc.dimension_units}`; - this.section_count = loc.slice_count || sections.length; - const sSize = parseFloat((loc.slice_thickness || - ((loc.z_dimension || 0) / Math.max(this.section_count, 1))) - .toFixed(1)); - this.section_size = sSize; - const sUnits = loc.dimension_units || 'millimeter'; - this.section_units = sUnits; - this.description = `${dims}, ${sSize} ${sUnits}, ${data.specimen_type}, ${this.section_count} Sections`; - sections.forEach((section, index) => { - section.description = `${loc.x_dimension} x ${loc.y_dimension} x ${sSize} ${sUnits}, ${sSize} ${sUnits}, ${section.description}`; - section.section_number = index + 1; - }); - } - getSection(section, data, portalUrl) { - const dateEntered = new Date(section.last_modified_timestamp).toLocaleDateString(); - const groupName = GROUP_UUID_MAPPING[section.group_uuid] || section.group_name; - const creator = section.created_by_user_displayname; - return { - '@id': HBM_PREFIX + section.uuid, - '@type': 'Sample', - label: `Registered ${dateEntered}, ${creator}, ${groupName}`, - description: `${data.specimen_type}`, - link: `${portalUrl}browse/sample/${section.uuid}`, - sample_type: 'Tissue Section', - section_number: 1, - samples: [], - datasets: [] - }; - } - getDataset(dataset, assetsApi = '', portalUrl = '', serviceToken) { - var _a; - const dateEntered = new Date(dataset.last_modified_timestamp).toLocaleDateString(); - const groupName = GROUP_UUID_MAPPING[dataset.group_uuid] || dataset.group_name; - const creator = dataset.created_by_user_displayname; - const types = [ - ...dataset.data_types, - get(dataset, ['ingest_metadata', 'metadata', 'assay_type'], '') - ]; - const typesSearch = types.join('|').toLowerCase(); - let technology; - let thumbnail = 'assets/icons/ico-unknown.svg'; - if (typesSearch.indexOf('10x') !== -1) { - technology = '10x'; - thumbnail = 'assets/icons/ico-bulk-10x.svg'; - } - else if (typesSearch.indexOf('af') !== -1) { - technology = 'AF'; - thumbnail = 'assets/icons/ico-spatial-af.svg'; - } - else if (typesSearch.indexOf('codex') !== -1) { - technology = 'CODEX'; - thumbnail = 'assets/icons/ico-spatial-codex.svg'; - } - else if (typesSearch.indexOf('imc') !== -1) { - technology = 'IMC'; - thumbnail = 'assets/icons/ico-spatial-imc.svg'; - } - else if ((typesSearch.indexOf('lc') !== -1) && (typesSearch.indexOf('af') === -1)) { - technology = 'LC'; - thumbnail = 'assets/icons/ico-bulk-lc.svg'; - } - else if (typesSearch.indexOf('maldi') !== -1) { - technology = 'MALDI'; - } - else if (typesSearch.indexOf('pas') !== -1) { - technology = 'PAS'; - } - else { - technology = 'OTHER'; - } - thumbnail = (_a = this.getDatasetThumbnail(dataset, assetsApi, serviceToken)) !== null && _a !== void 0 ? _a : thumbnail; - return { - '@id': HBM_PREFIX + dataset.uuid, - '@type': 'Dataset', - label: `Registered ${dateEntered}, ${creator}, ${groupName}`, - description: `Data/Assay Types: ${types.join(', ')}`, - link: `${portalUrl}browse/dataset/${dataset.uuid}`, - technology, - thumbnail - }; - } - getDatasetThumbnail(dataset, assetsApi, serviceToken) { - if (dataset.thumbnail_file) { - const thumbnailFile = dataset.thumbnail_file; - return `${assetsApi}/${thumbnailFile.file_uuid}/${thumbnailFile.filename}` + (serviceToken ? `?token=${serviceToken}` : ''); - } - else if (dataset.group_uuid === '73bb26e4-ed43-11e8-8f19-0a7c1eab007a') { // TMC-Vanderbilt - const tiffs = get(dataset, 'metadata.files', []) - .filter(f => /\.(ome\.tif|ome\.tiff)$/.test(f.rel_path)) - .filter(f => !/(multilayer\.ome\.tif|_ac\.ome\.tif)/.test(f.rel_path)) - .filter(f => DR1_VU_THUMBS.has(f.rel_path.split('/').slice(-1)[0].split('?')[0].replace('.ome.tif', '_thumbnail.jpg'))) - .map(f => `${assetsApi}/${dataset.uuid}/${f.rel_path}` + (serviceToken ? `?token=${serviceToken}` : '')); - if (tiffs.length > 0) { - const thumb = tiffs[0].split('/').slice(-1)[0].split('?')[0].replace('.ome.tif', '_thumbnail.jpg'); - if (DR1_VU_THUMBS.has(thumb)) { - return `assets/thumbnails/TMC-Vanderbilt/DR1/${thumb}`; - } - } - } - else if (dataset.group_uuid === '07a29e4c-ed43-11e8-b56a-0e8017bdda58') { // TMC-Florida - const thumb = UFL_THUMBS[dataset.hubmap_id]; - if (thumb) { - return `assets/thumbnails/TMC-Florida/${thumb}`; - } - } - return undefined; - } - getDonor(donor, portalUrl) { - const donorDescription = (donor.description || '').toLowerCase(); - let sex; - if (donorDescription.includes('female')) { - sex = 'Female'; - } - else if (donorDescription.includes('male')) { - sex = 'Male'; - } - const ageMatch = donorDescription.match(/age ([0-9]+)/); - let age; - if (ageMatch) { - age = toNumber(ageMatch[1]); - } - let bmi; - for (const md of get(donor, 'metadata.organ_donor_data', get(donor, 'metadata.living_donor_data', []))) { - if (md.preferred_term === 'Feminine gender' || md.preferred_term === 'Female') { - sex = 'Female'; - } - else if (md.preferred_term === 'Masculine gender' || md.preferred_term === 'Male') { - sex = 'Male'; - } - else if (md.preferred_term === 'Current chronological age' || md.preferred_term === 'Age') { - age = toNumber(md.data_value); - } - else if (md.preferred_term === 'Body mass index') { - bmi = toNumber(md.data_value); - } - } - let label = ''; - if (sex && age) { - label += `${sex}, Age ${age}`; - if (bmi) { - label += `, BMI ${bmi.toFixed(1)}`; - } - } - const dateEntered = new Date(donor.last_modified_timestamp).toLocaleDateString(); - const groupName = GROUP_UUID_MAPPING[donor.group_uuid] || donor.group_name; - const creator = donor.created_by_user_displayname; - return { - '@id': HBM_PREFIX + donor.uuid, - '@type': 'Donor', - label, - description: `Entered ${dateEntered}, ${creator}, ${groupName}`, - link: `${portalUrl}browse/donor/${donor.uuid}`, - age, - sex, - bmi, - consortium_name: 'HuBMAP', - provider_name: groupName, - provider_uuid: donor.group_uuid, - samples: [] - }; - } - getRuiLocation(data, donor) { - var _a; - let spatialEntity; - let ruiLocation = data.rui_location; - if (ruiLocation) { - // RUI Location may come in as an unparsed string - if (typeof ruiLocation === 'string') { - ruiLocation = JSON.parse(ruiLocation); - } - if (ruiLocation.alignment_id) { // Detect RUI 0.5 generated JSON - console.log('Detected a deprecated rui_location', data.uuid); - } - else if (ruiLocation['@id']) { // Detect RUI 1.0+ generated JSON-LD - // eslint-disable-next-line @typescript-eslint/no-explicit-any - spatialEntity = ruiLocation; - } - } - if (spatialEntity) { - // Patch to fix RUI 0.5 Kidney and Spleen Placements - const target = (_a = get(spatialEntity, ['placement', 'target'])) !== null && _a !== void 0 ? _a : ''; - if (target.startsWith('http://purl.org/ccf/latest/ccf.owl#VHSpleenCC')) { - if (donor.sex === 'Male') { - set(spatialEntity, ['placement', 'target'], target.replace('#VHSpleenCC', '#VHMSpleenCC')); - } - else { - set(spatialEntity, ['placement', 'target'], target.replace('#VHSpleenCC', '#VHFSpleenCC')); - } - } - else if (target === 'http://purl.org/ccf/latest/ccf.owl#VHLeftKidney' || target === 'http://purl.org/ccf/latest/ccf.owl#VHRightKidney') { - if (donor.sex === 'Male') { - set(spatialEntity, ['placement', 'target'], target.replace('#VH', '#VHM') + '_Patch'); - } - else { - set(spatialEntity, ['placement', 'target'], target.replace('#VH', '#VHF') + '_Patch'); - } - } - } - return spatialEntity; - } - getTissueBlock() { - return omit(Object.assign({}, this), ['data', 'bad', 'donor']); - } - toJsonLd() { - return Object.assign(Object.assign({}, this.donor), { samples: [this.getTissueBlock()] }); - } -} - -// Reduce this value if including more data fields -const PER_API_SEARCH_REQUEST_COUNT = 250; -const INCLUDED_DATA_FIELDS = [ - 'uuid', 'entity_type', - 'group_uuid', 'group_name', - 'last_modified_timestamp', 'created_by_user_displayname', - 'ancestors.entity_type', - 'ancestors.description', - 'ancestors.metadata.organ_donor_data.preferred_term', - 'ancestors.metadata.organ_donor_data.data_value', - 'ancestors.metadata.living_donor_data.preferred_term', - 'ancestors.metadata.living_donor_data.data_value', - 'ancestors.last_modified_timestamp', - 'ancestors.group_uuid', - 'ancestors.group_name', - 'ancestors.created_by_user_displayname', - 'ancestors.uuid', - 'descendants.entity_type', - 'descendants.ingest_metadata.metadata.tissue_id', - 'descendants.last_modified_timestamp', - 'descendants.group_uuid', - 'descendants.group_name', - 'descendants.created_by_user_displayname', - 'descendants.uuid', - 'descendants.data_types', - 'descendants.ingest_metadata.metadata.assay_type', - 'descendants.thumbnail_file', - 'descendants.metadata.files.rel_path', - 'rui_location', 'specimen_type' -]; -const DEFAULT_API_SEARCH_QUERY = { - exists: { - field: 'rui_location' - } -}; -function getApiSearchHeaders(token) { - const headers = new Headers(); - headers.append('Content-type', 'application/json'); - if (token) { - headers.append('Authorization', `Bearer ${token}`); - } - return headers; -} -function getApiSearchBody(from, size, query) { - const bodyObj = { - version: true, - from, - size, - stored_fields: ['*'], - script_fields: {}, - docvalue_fields: [], - query: query !== null && query !== void 0 ? query : DEFAULT_API_SEARCH_QUERY, - _source: { - includes: INCLUDED_DATA_FIELDS - } - }; - return JSON.stringify(bodyObj); -} -function doSearchRequest(url, init) { - return __awaiter(this, void 0, void 0, function* () { - try { - const res = yield fetch(url, init); - return res.ok ? (yield res.json()) : undefined; - } - catch (_error) { - return undefined; - } - }); -} -function doApiSearch(url, token, query) { - return __awaiter(this, void 0, void 0, function* () { - const perReqCount = PER_API_SEARCH_REQUEST_COUNT; - const headers = getApiSearchHeaders(token); - const body = getApiSearchBody(0, perReqCount, query); - const firstResult = yield doSearchRequest(url, { method: 'POST', headers, body }); - if (!firstResult) { - return undefined; - } - const totalCount = firstResult.hits.total.value; - if (totalCount <= perReqCount) { - return firstResult; - } - const requests = []; - for (let from = perReqCount; from < totalCount; from += perReqCount) { - requests.push(doSearchRequest(url, { - method: 'POST', - headers, - body: getApiSearchBody(from, perReqCount, query) - })); - } - const results = yield Promise.all(requests); - if (results.some(res => !res)) { - return undefined; - } - const items = results.map(res => res.hits.hits); - return Object.assign(Object.assign({}, firstResult), { hits: Object.assign(Object.assign({}, firstResult.hits), { hits: firstResult.hits.hits.concat(...items) }) }); - }); -} -/** - * Search the HuBMAP Search API and return CCF-compatible JSON-LD data - * - * @param dataUrl the search API url - * @param serviceType 'static' if a statically saved response or 'search-api' if querying the search-api live - * @param query the elastic search query to use - * @param serviceToken the api key to the search-api - * @param assetsApi the assets api endpoint - * @param portalUrl the portal url to point to - * @returns CCF-compatible JSON-LD data or undefined on error - */ -function searchHubmap(dataUrl, serviceType, query, serviceToken, assetsApi = '', portalUrl = '') { - return __awaiter(this, void 0, void 0, function* () { - let hubmapData; - if (serviceType === 'static') { - hubmapData = yield doSearchRequest(dataUrl); - } - else if (serviceType === 'search-api') { - hubmapData = yield doApiSearch(dataUrl, serviceToken, query); - } - if (hubmapData) { - return hubmapResponseAsJsonLd(hubmapData, assetsApi, portalUrl, serviceToken); - } - else { - console.warn(`Unable to load ${dataUrl} as HuBMAP Data`); - return undefined; - } - }); -} -/** - * Adds hubmap data from a url to the triple store. - * - * @param store The triple store. - * @param dataUrl The data url. - * @param serviceType The service type. - */ -function addHubmapDataToStore(store, dataUrl, serviceType, serviceToken, assetsApi = '', portalUrl = '') { - return __awaiter(this, void 0, void 0, function* () { - const hubmapData = yield searchHubmap(dataUrl, serviceType, undefined, serviceToken, assetsApi, portalUrl); - if (hubmapData) { - yield addJsonLdToStore(hubmapData, store); - } - }); -} - -/* eslint-disable @typescript-eslint/naming-convention */ -function getObjects(store, ids, predicate) { - const objects = new Set(); - for (const id of ids) { - for (const quad of readQuads(store, id, predicate, null, null)) { - objects.add(quad.object.id); - } - } - return objects; -} -/** - * Computes aggregate results. - * - * @param ids Ids of objects to calculate aggregate over. - * @param store The triple store. - * @returns The list of aggregate results. - */ -function getAggregateResults(ids, store) { - const donors = getObjects(store, ids, entity.donor.id); - const centers = getObjects(store, donors, entity.providerUUID.id); - const tissueBlocks = new Set(); - for (const id of ids) { - for (const quad of readQuads(store, id, entity.spatialEntity, null, null)) { - tissueBlocks.add(quad.subject.id); - } - } - const tissueSections = getObjects(store, tissueBlocks, entity.sections.id); - const tissueDatasets = new Set([ - ...getObjects(store, tissueBlocks, entity.datasets.id), - ...getObjects(store, tissueSections, entity.datasets.id) - ]); - const results = { - 'Tissue Data Providers': centers.size, - Donors: donors.size, - 'Tissue Blocks': tissueBlocks.size, - 'Tissue Sections': tissueSections.size, - 'Tissue Datasets': tissueDatasets.size - }; - return Object.entries(results).map(([label, count]) => ({ label, count })); -} -/** - * Get a list of technology names used by datasets - * - * @param store The triple store. - * @returns list of unique technology names in the data - */ -function getDatasetTechnologyNames(store) { - const names = new Set(); - for (const quad of readQuads(store, null, entity.technology, null, null)) { - names.add(quad.object.value); - } - return Array.from(names).sort(); -} -/** - * Get a list of provider names from the database - * - * @param store The triple store. - * @returns list of unique provider names in the data - */ -function getProviderNames(store) { - const names = new Set(); - for (const quad of readQuads(store, null, entity.providerName, null, null)) { - names.add(quad.object.value); - } - return Array.from(names).sort(); -} - -const spatialEntityDimensions = { - [ccf.spatialEntity.x_dimension.id]: 'x', - [ccf.spatialEntity.y_dimension.id]: 'y', - [ccf.spatialEntity.z_dimension.id]: 'z' -}; -function getSpatialEntityDimensions(store, iri) { - const dims = getMappedResult(store, iri, 'Dimensions', spatialEntityDimensions); - return [dims.x, dims.y, dims.z]; -} -function getOrientedBoundingBox(store, graph, sourceIri, targetIri) { - const matrix = graph.getTransformationMatrix(sourceIri, targetIri); - let result = undefined; - if (matrix) { - const center = matrix.getTranslation(); - const halfSize = getSpatialEntityDimensions(store, sourceIri).map(n => n / 1000 / 2); - const quaternion = new Euler().fromRotationMatrix(matrix, Euler.XYZ).toQuaternion().normalize().calculateW(); - result = new OrientedBoundingBox().fromCenterHalfSizeQuaternion(center, halfSize, quaternion); - } - return result; -} -function filterByProbingSphere(store, graph, seen, search) { - const { x, y, z, radius, target } = search; - const newSeen = new Set(); - const radiusSquared = (radius / 1000) * (radius / 1000); - for (const sourceIri of seen) { - const boundingBox = getOrientedBoundingBox(store, graph, sourceIri, target); - if (boundingBox) { - const distanceSquared = boundingBox.distanceSquaredTo([x, y, z].map(n => n / 1000)); - if (distanceSquared <= radiusSquared) { - newSeen.add(sourceIri); - } - } - } - return newSeen; -} - -function filterWithDonor(store, seen, callback) { - var _a, _b; - const donor2entity = new Map(); - const donors = new Set(); - for (const subject of seen) { - for (const quad of readQuads(store, subject, entity.donor, null, null)) { - donors.add(quad.object.id); - if (!donor2entity.has(quad.object.id)) { - donor2entity.set(quad.object.id, [subject]); - } - else { - (_a = donor2entity.get(quad.object.id)) === null || _a === void 0 ? void 0 : _a.push(subject); - } - } - } - const newDonors = callback(donors); - const newSeen = new Set(); - for (const d of newDonors) { - for (const s of (_b = donor2entity.get(d)) !== null && _b !== void 0 ? _b : []) { - newSeen.add(s); - } - } - return newSeen; -} -function filterWithSpatialEntity(store, seen, callback) { - var _a, _b; - const spatial2entity = new Map(); - const entities = new Set(); - for (const subject of seen) { - for (const quad of readQuads(store, subject, entity.spatialEntity, null, null)) { - entities.add(quad.object.id); - if (!spatial2entity.has(quad.object.id)) { - spatial2entity.set(quad.object.id, [subject]); - } - else { - (_a = spatial2entity.get(quad.object.id)) === null || _a === void 0 ? void 0 : _a.push(subject); - } - } - } - const newSpatialEntities = callback(entities); - const newSeen = new Set(); - for (const e of newSpatialEntities) { - for (const s of (_b = spatial2entity.get(e)) !== null && _b !== void 0 ? _b : []) { - newSeen.add(s); - } - } - return newSeen; -} -function filterWithDataset(store, seen, callback) { - var _a, _b; - const dataset2entity = new Map(); - const datasets = new Set(); - const sectionAndBlockSeen = new Set(seen); - for (const subject of seen) { - for (const quad of readQuads(store, subject, entity.sections, null, null)) { - sectionAndBlockSeen.add(quad.object.id); - } - } - for (const subject of sectionAndBlockSeen) { - for (const quad of readQuads(store, subject, entity.datasets, null, null)) { - datasets.add(quad.object.id); - if (!dataset2entity.has(quad.object.id)) { - dataset2entity.set(quad.object.id, [subject]); - } - else { - (_a = dataset2entity.get(quad.object.id)) === null || _a === void 0 ? void 0 : _a.push(subject); - } - } - } - const newDatasets = callback(datasets); - const newSeen = new Set(); - for (const e of newDatasets) { - for (const s of (_b = dataset2entity.get(e)) !== null && _b !== void 0 ? _b : []) { - newSeen.add(s); - } - } - return newSeen; -} -/** - * Finds all ids of object matching a filter. - * - * @param store The triple store. - * @param filter The filter to limit objects. - * @returns A set of all ids matching the filter. - */ -function findIds(store, graph, filter) { - var _a, _b, _c, _d, _e, _f, _g; - let seen = getAllEntities(store); - if (seen.size > 0) { - seen = filterByHasSpatialEntity(store, seen); - } - if (seen.size > 0 && (filter.sex === 'Male' || filter.sex === 'Female')) { - const sex = filter.sex; - seen = filterWithDonor(store, seen, (donors) => filterBySex(store, donors, sex)); - } - if (seen.size > 0 && ((_a = filter.tmc) === null || _a === void 0 ? void 0 : _a.length) > 0) { - seen = filterWithDonor(store, seen, (donors) => filterByGroupName(store, donors, filter.tmc)); - } - if (seen.size > 0 && ((_b = filter.technologies) === null || _b === void 0 ? void 0 : _b.length) > 0) { - seen = filterWithDataset(store, seen, (datasets) => filterByTechnology(store, datasets, filter.technologies)); - } - if (seen.size > 0 && ((_c = filter.spatialSearches) === null || _c === void 0 ? void 0 : _c.length) > 0) { - seen = filterWithSpatialEntity(store, seen, (entities) => filterBySpatialSearches(store, graph, entities, filter.spatialSearches)); - } - if (seen.size > 0 && ((_d = filter.ontologyTerms) === null || _d === void 0 ? void 0 : _d.length) > 0) { - const terms = filter.ontologyTerms; - if (terms.indexOf(rui.body.id) === -1) { - seen = filterWithSpatialEntity(store, seen, (entities) => filterByOntologyTerms(store, entities, terms)); - } - } - if (seen.size > 0 && ((_e = filter.cellTypeTerms) === null || _e === void 0 ? void 0 : _e.length) > 0) { - const terms = filter.cellTypeTerms; - if (terms.indexOf(rui.cell.id) === -1) { - seen = filterWithSpatialEntity(store, seen, (entities) => filterByCellTypeTerms(store, entities, terms)); - } - } - if (seen.size > 0 && ((_f = filter.ageRange) === null || _f === void 0 ? void 0 : _f.length) === 2 && - isFinite(filter.ageRange[0]) && isFinite(filter.ageRange[1])) { - const maxAge = Math.max(...filter.ageRange); - const minAge = Math.min(...filter.ageRange); - // Age filter given by their default range will be ignored - if (!(minAge === 1 && maxAge === 110)) { - seen = filterWithDonor(store, seen, (donors) => filterByAge(store, donors, minAge, maxAge)); - } - } - if (seen.size > 0 && ((_g = filter.bmiRange) === null || _g === void 0 ? void 0 : _g.length) === 2 && - isFinite(filter.bmiRange[0]) && isFinite(filter.bmiRange[1])) { - const maxBMI = Math.max(...filter.bmiRange); - const minBMI = Math.min(...filter.bmiRange); - // BMI filter given by their default range will be ignored - if (!(minBMI === 13 && maxBMI === 83)) { - seen = filterWithDonor(store, seen, (donors) => filterByBMI(store, donors, minBMI, maxBMI)); - } - } - return seen; -} -/** - * Gets all object ids in a store. - * - * @param store The triple store. - * @returns A set of all ids. - */ -function getAllEntities(store) { - const seen = new Set(); - store.forSubjects((s) => seen.add(s.id), entity.spatialEntity, null, null); - return seen; -} -/** - * Creates a callback function that adds ids to a second set iff it exists in the first set. - * - * @param seen The first set of ids. - * @param newSeen The second set to add ids to. - * @returns The callback function. - */ -function differenceCallback(seen, newSeen) { - return function (term) { - if (seen.has(term.id)) { - newSeen.add(term.id); - } - }; -} -/** - * Filters ids by sex. - * - * @param store The triple store. - * @param seen All ids to choose from. - * @param sex Sex to filter on. - * @returns The subset of ids with the specified sex. - */ -function filterBySex(store, seen, sex) { - const newSeen = new Set(); - store.forSubjects(differenceCallback(seen, newSeen), entity.sex, entity[sex], null); - return newSeen; -} -/** - * Filters ids by group names. - * - * @param store The triple store. - * @param seen All ids to choose from. - * @param groupNames Group names to filter on. - * @returns The subset of ids with the specified group names. - */ -function filterByGroupName(store, seen, groupNames) { - const newSeen = new Set(); - for (const groupName of groupNames) { - const literal = DataFactory.literal(groupName); - store.forSubjects(differenceCallback(seen, newSeen), entity.providerName, literal, null); - } - return newSeen; -} -/** - * Filters ids by technology names. - * - * @param store The triple store. - * @param seen All ids to choose from. - * @param technologies Technology names to filter on. - * @returns The subset of ids with the specified technology names. - */ -function filterByTechnology(store, seen, technologies) { - const newSeen = new Set(); - for (const technology of technologies) { - const literal = DataFactory.literal(technology); - store.forSubjects(differenceCallback(seen, newSeen), entity.technology, literal, null); - } - return newSeen; -} -/** - * Filters ids by ontology terms. - * - * @param store The triple store. - * @param seen All ids to choose from. - * @param terms Ontology terms to filter on. - * @returns The subset of ids with the specified ontology terms. - */ -function filterByOntologyTerms(store, seen, terms) { - const newSeen = new Set(); - for (const term of terms) { - const namedNode = DataFactory.namedNode(term); - store.forSubjects(differenceCallback(seen, newSeen), ccf.spatialEntity.ccf_annotations, namedNode, null); - } - return newSeen; -} -/** - * Filters ids by cell type terms. - * - * @param store The triple store. - * @param seen All ids to choose from. - * @param terms Cell type terms to filter on. - * @returns The subset of ids with the specified cell type terms. - */ -function filterByCellTypeTerms(store, seen, terms) { - const asTerms = new Set(); - for (const term of terms) { - store.forObjects((asTerm) => { - asTerms.add(asTerm.id); - }, term, ccf.asctb.located_in, null); - if (term === rui.cell.id) { - asTerms.add(rui.body.id); - } - } - return filterByOntologyTerms(store, seen, [...asTerms]); -} -/** - * Filters ids by age. - * - * @param store The triple store. - * @param seen All ids to choose from. - * @param minAge Minimum age. - * @param maxAge Maximum age. - * @returns The subset of ids with the specified age. - */ -function filterByAge(store, seen, minAge, maxAge) { - const newSeen = new Set(); - for (const subject of seen) { - for (const quad of readQuads(store, subject, entity.age, null, null)) { - const value = fromRdf(quad.object); - if (value >= minAge && value <= maxAge) { - newSeen.add(subject); - } - } - } - return newSeen; -} -/** - * Filters ids by BMI. - * - * @param store The triple store. - * @param seen All ids to choose from. - * @param minBMI Minimum BMI. - * @param maxBMI Maximum BMI. - * @returns The subset of ids with the specified BMI. - */ -function filterByBMI(store, seen, minBMI, maxBMI) { - const newSeen = new Set(); - for (const subject of seen) { - for (const quad of readQuads(store, subject, entity.bmi, null, null)) { - const value = fromRdf(quad.object); - if (value >= minBMI && value <= maxBMI) { - newSeen.add(subject); - } - } - } - return newSeen; -} -/** - * Filters ids by spatial entities. - * - * @param store The triple store. - * @param seen All ids to choose from. - * @param hasSpatialEntity Whether the filtered objects should have a spatial entity. - * @returns The subset of ids with/without spatial entities. - */ -function filterByHasSpatialEntity(store, seen, hasSpatialEntity = true) { - const newSeen = new Set(); - store.forSubjects(differenceCallback(seen, newSeen), entity.spatialEntity, null, null); - if (!hasSpatialEntity) { - const notNewSeen = new Set(); - seen.forEach((s) => !newSeen.has(s) ? notNewSeen.add(s) : undefined); - return notNewSeen; - } - return newSeen; -} -function filterBySpatialSearches(store, graph, seen, spatialSearches) { - const newSeen = new Set(); - for (const search of spatialSearches) { - const thisSeen = filterByProbingSphere(store, graph, seen, search); - thisSeen.forEach((s) => newSeen.add(s)); - } - return newSeen; -} - -function getSpatialEntityMapping(subjects, store) { - const spatial2entity = new Map(); - for (const subject of subjects) { - for (const quad of readQuads(store, subject, entity.spatialEntity, null, null)) { - if (!spatial2entity.has(quad.object.id)) { - spatial2entity.set(quad.object.id, new Set([subject])); - } - else { - spatial2entity.get(quad.object.id).add(subject); - } - } - } - return spatial2entity; -} -function getAnatomicalStructureMapping(ids, store) { - const spatial2entity = getSpatialEntityMapping(ids, store); - const term2entity = new Map(); - for (const subject of spatial2entity.keys()) { - const entities = spatial2entity.get(subject); - for (const quad of readQuads(store, subject, ccf.spatialEntity.ccf_annotations, null, null)) { - if (!term2entity.has(quad.object.id)) { - term2entity.set(quad.object.id, new Set(entities)); - } - else { - const termEntities = term2entity.get(quad.object.id); - entities.forEach((value) => termEntities.add(value)); - } - } - } - return term2entity; -} -/** - * Get number of occurrences of ontology terms for a set of ids. - * - * @param ids Ids of objects to calculate aggregate over. - * @param store The triple store. - * @returns Ontology term counts. - */ -function getOntologyTermOccurences(ids, store) { - const counts = {}; - const term2entities = getAnatomicalStructureMapping(ids, store); - term2entities.forEach((value, key) => { - counts[key] = value.size; - }); - return counts; -} -/** - * Get number of occurrences of cell type terms for a set of ids. - * - * @param ids Ids of objects to calculate aggregate over. - * @param store The triple store. - * @returns Ontology term counts. - */ -function getCellTypeTermOccurences(ids, store) { - var _a, _b; - const asTerm2entities = getAnatomicalStructureMapping(ids, store); - const ctTerm2entities = new Map(); - for (const asTerm of asTerm2entities.keys()) { - const entities = asTerm2entities.get(asTerm); - for (const quad of readQuads(store, null, ccf.asctb.located_in, asTerm, null)) { - const cellType = quad.subject.id; - if (!ctTerm2entities.has(cellType)) { - ctTerm2entities.set(cellType, new Set(entities)); - } - else { - const termEntities = ctTerm2entities.get(cellType); - entities.forEach((value) => termEntities.add(value)); - } - } - } - const counts = {}; - ctTerm2entities.forEach((value, key) => { - counts[key] = value.size; - }); - counts[rui.cell.id] = (_b = (_a = asTerm2entities.get(rui.body.id)) === null || _a === void 0 ? void 0 : _a.size) !== null && _b !== void 0 ? _b : 0; - return counts; -} - -function getOntologyTreeNode(store, iri, relationshipIri) { - const result = { - '@id': iri, '@type': 'OntologyTreeNode', id: iri, parent: '', - children: [], synonymLabels: [], label: '' - }; - const ontologyTreeNodeResult = { - [ccf.ontologyNode.label.id]: 'label', - [relationshipIri]: 'parent', - [ccf.ontologyNode.synonymLabels.id]: 'synonymLabels', - }; - for (const [key, value] of getEntries(store, iri, ontologyTreeNodeResult)) { - if (key === 'synonymLabels') { - result.synonymLabels.push(value); - } - else { - result[key] = value; - } - } - result.children = store.getSubjects(relationshipIri, iri, null).map(s => s.id); - return result; -} -function getOntologyTreeModel(store, rootIri, rootLabel, relationshipIri) { - const result = { root: rootIri, nodes: {} }; - const seen = new Set(); - for (const quad of readQuads(store, null, relationshipIri, null, null)) { - seen.add(quad.subject.id); - seen.add(quad.object.id); - } - for (const iri of seen) { - result.nodes[iri] = getOntologyTreeNode(store, iri, relationshipIri); - } - if (!result.nodes[rootIri]) { - result.nodes[rootIri] = { - '@id': rootIri, - '@type': 'OntologyTreeNode', - id: rootIri, - label: rootLabel, - children: [], - synonymLabels: [] - }; - } - const rootChildren = store - .getSubjects(relationshipIri, rootIri, null).map(o => o.id) - .sort((a, b) => result.nodes[a].label.localeCompare(result.nodes[b].label)); - result.nodes[rootIri].children = rootChildren; - treeify(result); - return result; -} -/** - * Recursive function to ensure that the given ontology tree model is actually a tree by essentially using a BFS search. - * - * @param model the ontology tree model to mutate - * @param nodeIri the tree node iri to modify. Starts at root in the base case - * @param seen a set of IRIs that have been 'seen' so far to remove loops in the graph - */ -function treeify(model, nodeIri = undefined, seen = new Set()) { - const node = model.nodes[nodeIri !== null && nodeIri !== void 0 ? nodeIri : model.root]; - if (node) { - node.children = node.children.filter(n => !seen.has(n)); - node.children.forEach(n => seen.add(n)); - for (const childId of node.children) { - treeify(model, childId, seen); - if (model.nodes[childId]) { - model.nodes[childId].parent = node['@id']; - } - } - } -} -function getAnatomicalStructureTreeModelSlowly(store) { - const model = getOntologyTreeModel(store, rui.body.id, 'body', ccf.asctb.part_of.id); - model.nodes[rui.body.id].children = [ - 'http://purl.obolibrary.org/obo/UBERON_0000955', - 'http://purl.obolibrary.org/obo/UBERON_0000029', - // 'http://purl.obolibrary.org/obo/UBERON_0002509', // Mesenteric Lymph Node - 'http://purl.obolibrary.org/obo/UBERON_0000970', - // 'http://purl.obolibrary.org/obo/UBERON_0004548', // Eye, L - // 'http://purl.org/sig/ont/fma/fma54449', // Eye, R - 'http://purl.obolibrary.org/obo/UBERON_0003889', - // 'http://purl.obolibrary.org/obo/UBERON_0001303', // Fallopian Tube, L - // 'http://purl.obolibrary.org/obo/UBERON_0001302', // Fallopian Tube, R - 'http://purl.obolibrary.org/obo/UBERON_0000948', - 'http://purl.obolibrary.org/obo/UBERON_0002113', - // 'http://purl.obolibrary.org/obo/UBERON_0004538', // Kidney, L - // 'http://purl.obolibrary.org/obo/UBERON_0004539', // Kidney, R - 'http://purl.obolibrary.org/obo/UBERON_0001465', - // 'http://purl.org/sig/ont/fma/fma24978', // Knee, L - // 'http://purl.org/sig/ont/fma/fma24977', // Knee, R - 'http://purl.obolibrary.org/obo/UBERON_0002107', - 'http://purl.obolibrary.org/obo/UBERON_0002048', - 'http://purl.obolibrary.org/obo/UBERON_0001911', - // 'http://purl.org/sig/ont/fma/fma57991', // Mammary Gland, L - // 'http://purl.org/sig/ont/fma/fma57987', // Mammary Gland, R - 'http://purl.obolibrary.org/obo/UBERON_0000992', - // 'http://purl.org/sig/ont/fma/fma7214', // Ovary, L - // 'http://purl.org/sig/ont/fma/fma7213', // Ovary, R - 'http://purl.obolibrary.org/obo/UBERON_0001264', - 'http://purl.obolibrary.org/obo/UBERON_0001270', - 'http://purl.obolibrary.org/obo/UBERON_0001987', - 'http://purl.obolibrary.org/obo/UBERON_0002367', - 'http://purl.obolibrary.org/obo/UBERON_0002097', - 'http://purl.obolibrary.org/obo/UBERON_0002108', - 'http://purl.obolibrary.org/obo/UBERON_0002240', - 'http://purl.obolibrary.org/obo/UBERON_0000059', - 'http://purl.obolibrary.org/obo/UBERON_0002106', - 'http://purl.obolibrary.org/obo/UBERON_0002370', - 'http://purl.obolibrary.org/obo/UBERON_0000056', - // 'http://purl.obolibrary.org/obo/UBERON_0001223', // Ureter, L - // 'http://purl.obolibrary.org/obo/UBERON_0001222', // Ureter, R - 'http://purl.obolibrary.org/obo/UBERON_0001255', - 'http://purl.obolibrary.org/obo/UBERON_0000995', - 'http://purl.obolibrary.org/obo/UBERON_0004537' // Blood Vasculature - ].filter(iri => iri in model.nodes); - return model; -} -const getAnatomicalStructureTreeModel = memoize(getAnatomicalStructureTreeModelSlowly, () => ''); -function getCellTypeTreeModel(store) { - return getOntologyTreeModel(store, rui.cell.id, 'cell', ccf.asctb.ct_is_a.id); -} - -/** Entity iri to property path. */ -const listResultSet = { - [entity.label.id]: 'label', - [entity.description.id]: 'description', - [entity.link.id]: 'link' -}; -const donorResultSet = Object.assign(Object.assign({}, listResultSet), { [entity.providerName.id]: 'providerName' }); -const datasetResultSet = Object.assign(Object.assign({}, listResultSet), { [entity.technology.id]: 'technology', [entity.thumbnail.id]: 'thumbnail' }); -const tissueSectionResultSet = Object.assign(Object.assign({}, listResultSet), { [entity.sampleType.id]: 'sampleType', [entity.sectionNumber.id]: 'sectionNumber', [entity.datasets.id]: 'datasets' }); -const tissueBlockResultSet = Object.assign(Object.assign({}, listResultSet), { [entity.sampleType.id]: 'sampleType', [entity.sectionCount.id]: 'sectionCount', [entity.sectionSize.id]: 'sectionSize', [entity.sectionUnits.id]: 'sectionUnits', [entity.donor.id]: 'donor', [entity.spatialEntity.id]: 'spatialEntityId', [entity.sections.id]: 'sections', [entity.datasets.id]: 'datasets' }); -/** - * Extracts a single donor result from the triple store. - * - * @param store The triple store. - * @param iri The entity id. - * @returns The list data. - */ -function getDonorResult(store, iri) { - return getMappedResult(store, iri, 'Donor', donorResultSet); -} -/** - * Extracts a single dataset result from the triple store. - * - * @param store The triple store. - * @param iri The entity id. - * @returns The list data. - */ -function getDatasetResult(store, iri) { - return getMappedResult(store, iri, 'Dataset', datasetResultSet); -} -/** - * Extracts a single tissue section result from the triple store. - * - * @param store The triple store. - * @param iri The entity id. - * @returns The list data. - */ -function getTissueSectionResult(store, iri) { - // eslint-disable-next-line @typescript-eslint/consistent-type-assertions - const result = { '@id': iri, '@type': 'Sample', datasets: [] }; - for (const [key, value] of getEntries(store, iri, tissueSectionResultSet)) { - if (key === 'datasets') { - const dataset = getDatasetResult(store, value); - result[key].push(dataset); - } - else { - result[key] = value; - } - } - return result; -} -/** - * Extracts a single tissue block result from the triple store. - * - * @param store The triple store. - * @param iri The entity id. - * @returns The list data. - */ -function getTissueBlockResult(store, iri) { - // eslint-disable-next-line @typescript-eslint/consistent-type-assertions - const result = { '@id': iri, '@type': 'Sample', - sections: [], datasets: [] - }; - for (const [key, value] of getEntries(store, iri, tissueBlockResultSet)) { - if (key === 'sections') { - const section = getTissueSectionResult(store, value); - result[key].push(section); - } - else if (key === 'datasets') { - const dataset = getDatasetResult(store, value); - result[key].push(dataset); - } - else if (key === 'donor') { - result[key] = getDonorResult(store, value); - } - else { - result[key] = value; - } - } - return result; -} - -class CCFDatabaseStatusTracker { - constructor(database) { - this.database = database; - this.connect(); - } - toJson() { - return { - status: this.status, - message: this.message, - checkback: this.status === 'Ready' || this.status === 'Error' ? 60 * 60 * 1000 : 2000, - loadTime: this.loadTime - }; - } - connect() { - this.status = 'Loading'; - this.message = 'Loading database'; - const startTime = Date.now(); - return this.database.connect() - .then((loaded) => __awaiter(this, void 0, void 0, function* () { - if (loaded) { - // Warm up the database - this.message = 'Building scene'; - yield this.database.getScene(); - this.message = 'Building tissue block results'; - yield this.database.getTissueBlockResults(); - this.message = 'Aggregating results'; - yield this.database.getAggregateResults(); - this.status = 'Ready'; - this.message = 'Database successfully loaded'; - } - else { - this.status = 'Error'; - this.message = 'Unknown error while loading database'; - } - })) - .catch((error) => { - var _a; - this.status = 'Error'; - this.message = (_a = error === null || error === void 0 ? void 0 : error.message) !== null && _a !== void 0 ? _a : 'Unknown error while loading database'; - }) - .finally(() => { - this.loadTime = Date.now() - startTime; - }); - } -} - -/* eslint-disable @typescript-eslint/naming-convention */ -/** CCF v2.0 JSON-LD Context */ -const CCF_CONTEXT = { - '@context': { - '@base': 'http://purl.org/ccf/', - '@vocab': 'http://purl.org/ccf/', - 'ccf': 'http://purl.org/ccf/', - 'rdfs': 'http://www.w3.org/2000/01/rdf-schema#', - 'dcterms': 'http://purl.org/dc/terms/', - 'label': 'rdfs:label', - 'description': 'rdfs:comment', - 'link': 'ccf:url', - 'sex': 'ccf:sex', - 'age': 'ccf:age', - 'bmi': 'ccf:bmi', - 'consortium_name': 'ccf:consortium_name', - 'provider_name': 'ccf:tissue_provider_name', - 'provider_uuid': 'ccf:tissue_provider_uuid', - 'donor': { - '@id': 'ccf:comes_from', - '@type': '@id' - }, - 'samples': { - '@reverse': 'donor' - }, - 'sections': { - '@id': 'ccf:subdivided_into_sections', - '@type': '@id' - }, - 'datasets': { - '@id': 'ccf:generates_dataset', - '@type': '@id' - }, - 'sample_type': 'ccf:sample_type', - 'section_count': 'ccf:section_count', - 'section_size': 'ccf:section_size', - 'section_units': 'ccf:section_size_unit', - 'section_number': 'ccf:section_number', - 'rui_location': { - '@id': 'ccf:has_registration_location', - '@type': '@id' - }, - 'ccf_annotations': { - '@id': 'ccf:collides_with', - '@type': '@id', - '@container': '@set' - }, - 'representation_of': { - '@id': 'ccf:representation_of', - '@type': '@id' - }, - 'reference_organ': { - '@id': 'ccf:has_reference_organ', - '@type': '@id' - }, - 'extraction_set_for': { - '@id': 'ccf:extraction_set_for', - '@type': '@id' - }, - 'extraction_set': { - '@id': 'ccf:has_extraction_set', - '@type': '@id' - }, - 'organ_owner_sex': 'ccf:organ_owner_sex', - 'side': 'ccf:organ_side', - 'rui_rank': 'ccf:rui_rank', - 'slice_thickness': 'ccf:slice_thickness', - 'slice_count': 'ccf:slice_count', - 'object': { - '@id': 'ccf:has_object_reference', - '@type': '@id' - }, - 'creation_date': 'dcterms:created', - 'updated_date': 'ccf:updated_date', - 'creator': 'dcterms:creator', - 'creator_first_name': 'ccf:creator_first_name', - 'creator_last_name': 'ccf:creator_last_name', - 'placement': { - '@reverse': 'ccf:placement_for' - }, - 'placement_date': 'dcterms:created', - 'rotation_order': 'ccf:rotation_order', - 'dimension_units': 'ccf:dimension_unit', - 'rotation_units': 'ccf:rotation_unit', - 'scaling_units': 'ccf:scaling_unit', - 'translation_units': 'ccf:translation_unit', - 'source': { - '@id': 'ccf:placement_for', - '@type': '@id' - }, - 'target': { - '@id': 'ccf:placement_relative_to', - '@type': '@id' - }, - 'x_rotation': 'ccf:x_rotation', - 'y_rotation': 'ccf:y_rotation', - 'z_rotation': 'ccf:z_rotation', - 'x_scaling': 'ccf:x_scaling', - 'y_scaling': 'ccf:y_scaling', - 'z_scaling': 'ccf:z_scaling', - 'x_translation': 'ccf:x_translation', - 'y_translation': 'ccf:y_translation', - 'z_translation': 'ccf:z_translation', - 'x_dimension': 'ccf:x_dimension', - 'y_dimension': 'ccf:y_dimension', - 'z_dimension': 'ccf:z_dimension', - 'ontology_terms': { - '@id': 'ccf:has_ontology_term', - '@type': '@id' - }, - 'technology': 'ccf:technology', - 'thumbnail': 'ccf:thumbnail', - 'file': 'ccf:file_url', - 'file_format': 'ccf:file_format', - 'file_subpath': 'ccf:file_subpath' - } -}; -/* eslint-enable @typescript-eslint/naming-convention */ -/** - * Function which takes JSON-LD data and makes patches to update from CCF v1.x to v2.0 automatically - * - * @param jsonLdString the input JSON-LD as a string - * @returns A JSON-LD object derived from the given string with updated data to be compatible with CCF v2.0 - */ -function patchJsonLd(jsonLdString) { - return JSON.parse(jsonLdString, (key, value) => { - if (key === 'ccf_annotations' && Array.isArray(value)) { - return value.map((iri) => { - if (iri === null || iri === void 0 ? void 0 : iri.startsWith('http://purl.obolibrary.org/obo/FMA_')) { - return iri.replace('http://purl.obolibrary.org/obo/FMA_', 'http://purl.org/sig/ont/fma/fma'); - } - else { - return iri; - } - }); - } - else if (key === '@context' && value && (value === 'https://hubmapconsortium.github.io/hubmap-ontology/ccf-entity-context.jsonld' - || value === 'https://hubmapconsortium.github.io/hubmap-ontology/ccf-context.jsonld' - || value === 'https://hubmapconsortium.github.io/ccf-ontology/ccf-context.jsonld' - || value['@base'] === 'http://purl.org/ccf/latest/ccf-entity.owl#')) { - return CCF_CONTEXT; - } - return value; - }); -} - -/** - * Function to add additional ccf_annotations to rui locations based on the - * reference organ it was placed relative to. - * - * @param store the triple store holding the CCF.OWL data - */ -function enrichRuiLocations(store) { - var _a, _b, _c; - const tree = getAnatomicalStructureTreeModel(store); - const refOrganMap = new Map(); - // Build a map from reference organ to ccf annotations via representation_of and the AS partonomy - for (const { subject: organ, object: term } of readQuads(store, null, ccf.spatialEntity.representation_of, null, null)) { - const annotations = new Set([term.id]); - let parent = (_a = tree.nodes[term.id]) === null || _a === void 0 ? void 0 : _a.parent; - while (parent) { - if (annotations.has(parent)) { - break; - } - else { - annotations.add(parent); - parent = (_b = tree.nodes[parent]) === null || _b === void 0 ? void 0 : _b.parent; - } - } - refOrganMap.set(organ.id, [...annotations].map(s => DataFactory.namedNode(s))); - } - // Add AS terms for rui locations based on the reference organs they are placed relative to - for (const { object: ruiLocation } of readQuads(store, null, entity.spatialEntity, null, null)) { - for (const { subject: placement } of readQuads(store, null, ccf.spatialPlacement.source, ruiLocation, null)) { - for (const { object: organ } of readQuads(store, placement, ccf.spatialPlacement.target, null, null)) { - for (const term of (_c = refOrganMap.get(organ.id)) !== null && _c !== void 0 ? _c : []) { - store.addQuad(DataFactory.namedNode(ruiLocation.id), ccf.spatialEntity.ccf_annotations, term); - } - } - } - } -} - -/** Default initialization options. */ -const DEFAULT_CCF_DB_OPTIONS = { - 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' -}; -/** Database provider. */ -class CCFDatabase { - /** - * Creates an instance of ccfdatabase. - * - * @param [options] Initialization options. - */ - constructor(options = DEFAULT_CCF_DB_OPTIONS) { - this.options = options; - this.store = new Store(undefined, { factory: DataFactory }); - this.graph = new CCFSpatialGraph(this); - this.scene = new CCFSpatialScene(this); - } - /** - * Connects the database. - * - * @param [options] Options used to initialize. - * @returns A promise resolving to true if data has been loaded into the database. - */ - connect(options, cached = false) { - return __awaiter(this, void 0, void 0, function* () { - if (options) { - this.options = options; - } - if (!this.initializing) { - if (cached) { - this.initializing = this.cachedConnect(); - } - else { - this.initializing = this.doConnect(); - } - } - yield this.initializing; - return this.store.size > 0; - }); - } - cachedConnect() { - return __awaiter(this, void 0, void 0, function* () { - const start = new Date().getTime(); - const lastModifiedKey = 'ccf-database.last_modified'; - const ccfDatabaseKey = 'ccf-database'; - const lastModified = yield get$1(lastModifiedKey).catch(() => undefined); - let serializedDb; - if (lastModified && start - new Date(+lastModified).getTime() > 60 * 60 * 1000) { - yield delMany([ccfDatabaseKey, lastModifiedKey]).catch(() => undefined); - } - else { - serializedDb = yield get$1(ccfDatabaseKey).catch(() => undefined); - } - if (serializedDb) { - yield this.deserialize(serializedDb); - } - else { - yield this.doConnect(); - setMany([ - [ccfDatabaseKey, this.serialize()], - [lastModifiedKey, '' + start] - ]).catch(() => undefined); - } - }); - } - /** - * Actually connects to the database. - * - * @returns A promise resolving to void when connected. - */ - doConnect() { - var _a, _b; - return __awaiter(this, void 0, void 0, function* () { - const ops = []; - const sources = (_b = (_a = this.options.dataSources) === null || _a === void 0 ? void 0 : _a.concat()) !== null && _b !== void 0 ? _b : []; - const ccfOwlUrl = this.options.ccfOwlUrl; - if (ccfOwlUrl.startsWith('{')) { - // serialized n3 store was provided as the ccfOwlUrl - this.store = deserializeN3Store(ccfOwlUrl, DataFactory); - } - else if (ccfOwlUrl.endsWith('.n3store.json')) { - const storeString = yield fetch(ccfOwlUrl).then(r => r.text()) - .catch(() => console.log('Couldn\'t locate serialized store.')); - if (storeString) { - this.store = deserializeN3Store(storeString, DataFactory); - } - } - else if ((ccfOwlUrl === null || ccfOwlUrl === void 0 ? void 0 : ccfOwlUrl.length) > 0) { - sources.push(ccfOwlUrl); - } - if (this.options.hubmapDataUrl) { - if (this.options.hubmapDataUrl.endsWith('jsonld')) { - sources.push(this.options.hubmapDataUrl); - } - else { - ops.push(searchHubmap(this.options.hubmapDataUrl, this.options.hubmapDataService, this.options.hubmapQuery, this.options.hubmapToken, this.options.hubmapAssetsUrl, this.options.hubmapPortalUrl).then((jsonld) => { - if (jsonld) { - return this.addDataSources([jsonld]); - } - else { - return undefined; - } - })); - } - } - ops.push(this.addDataSources(sources)); - yield Promise.all(ops); - yield this.synchronize(); - }); - } - addDataSources(sources, inputStore) { - return __awaiter(this, void 0, void 0, function* () { - const store = inputStore !== null && inputStore !== void 0 ? inputStore : this.store; - yield Promise.all(sources.map((source) => __awaiter(this, void 0, void 0, function* () { - if (typeof source === 'string') { - if ((source.startsWith('http') || source.startsWith('assets/')) && source.includes('jsonld')) { - source = yield fetch(source).then(r => r.text()); - source = patchJsonLd(source); - yield addJsonLdToStore(source, store); - } - else if (source.endsWith('n3')) { - yield addN3ToStore(source, store); - } - else if (source.endsWith('rdf') || source.endsWith('owl') || source.endsWith('xml')) { - yield addRdfXmlToStore(source, store); - } - else { - // Passthrough assumes a JSON-LD response - source = patchJsonLd(source); - yield addJsonLdToStore(source, store); - } - } - else { - source = patchJsonLd(JSON.stringify(source)); - yield addJsonLdToStore(source, store); - } - }))); - return this; - }); - } - synchronize() { - return __awaiter(this, void 0, void 0, function* () { - // Add a small delay to allow the triple store to settle - yield new Promise(r => { - setTimeout(r, 500); - }); - this.graph.createGraph(); - enrichRuiLocations(this.store); - return this; - }); - } - serialize() { - return serializeN3Store(this.store); - } - deserialize(value) { - return __awaiter(this, void 0, void 0, function* () { - this.store = deserializeN3Store(value, DataFactory); - this.graph = new CCFSpatialGraph(this); - this.scene = new CCFSpatialScene(this); - yield new Promise(r => { - setTimeout(r, 10); - }); - }); - } - /** - * Gets all ids matching the filter. - * - * @param [filter] The filter. - * @returns A set of all matching ids. - */ - getIds(filter = {}) { - return findIds(this.store, this.graph, filter); - } - /** - * Gets the data for an object. - * - * @param id The id of the requested object. - * @returns The object data. - */ - get(id) { - return this.store.getQuads(DataFactory.namedNode(id), null, null, null); - } - /** - * Gets the data for objects matching a filter. - * - * @param [filter] The filter. - * @returns An array of data. - */ - search(filter = {}) { - return [...this.getIds(filter)].map((s) => this.get(s)); - } - /** - * Gets all spatial entities for a filter. - * - * @param [filter] The filter. - * @returns A list of spatial entities. - */ - getSpatialEntities(filter) { - // eslint-disable-next-line @typescript-eslint/consistent-type-assertions - filter = Object.assign(Object.assign({}, filter), { hasSpatialEntity: true }); - return [...this.getIds(filter)].map((s) => getSpatialEntityForEntity(this.store, s)); - } - getDatabaseStatus() { - return __awaiter(this, void 0, void 0, function* () { - if (!this.status) { - this.status = new CCFDatabaseStatusTracker(this); - } - return this.status.toJson(); - }); - } - /** - * Get a list of technology names used by datasets - * - * @returns list of unique technology names in the data - */ - getDatasetTechnologyNames() { - return __awaiter(this, void 0, void 0, function* () { - return getDatasetTechnologyNames(this.store); - }); - } - /** - * Get a list of provider names from the database - * - * @returns list of unique provider names in the data - */ - getProviderNames() { - return __awaiter(this, void 0, void 0, function* () { - return getProviderNames(this.store); - }); - } - /** - * Gets all tissue block results for a filter. - * - * @param [filter] The filter. - * @returns A list of results. - */ - getTissueBlockResults(filter) { - return __awaiter(this, void 0, void 0, function* () { - // eslint-disable-next-line @typescript-eslint/consistent-type-assertions - filter = Object.assign(Object.assign({}, filter), { hasSpatialEntity: true }); - return [...this.getIds(filter)].map((s) => getTissueBlockResult(this.store, s)); - }); - } - /** - * Gets all aggregate results for a filter. - * - * @param [filter] The filter. - * @returns A list of aggregate data. - */ - getAggregateResults(filter) { - return __awaiter(this, void 0, void 0, function* () { - return getAggregateResults(this.getIds(filter), this.store); - }); - } - /** - * Get number of occurrences of ontology terms for a set of ids. - * - * @param [filter] The filter. - * @returns Ontology term counts. - */ - getOntologyTermOccurences(filter) { - return __awaiter(this, void 0, void 0, function* () { - return getOntologyTermOccurences(this.getIds(filter), this.store); - }); - } - /** - * Get number of occurrences of cell type terms for a set of ids. - * - * @param [filter] The filter. - * @returns Cell type term counts. - */ - getCellTypeTermOccurences(filter) { - return __awaiter(this, void 0, void 0, function* () { - return getCellTypeTermOccurences(this.getIds(filter), this.store); - }); - } - /** - * Get ontology term tree nodes - * - * @returns Ontology term counts. - */ - getOntologyTreeModel() { - return __awaiter(this, void 0, void 0, function* () { - return getAnatomicalStructureTreeModel(this.store); - }); - } - /** - * Get cell type term tree nodes - * - * @returns Ontology term counts. - */ - getCellTypeTreeModel() { - return __awaiter(this, void 0, void 0, function* () { - return getCellTypeTreeModel(this.store); - }); - } - /** - * Get reference organs - * - * @returns Ontology term counts. - */ - getReferenceOrgans() { - return __awaiter(this, void 0, void 0, function* () { - return this.scene.getReferenceOrgans(); - }); - } - /** - * Get all nodes to form the 3D scene of reference body, organs, and tissues - * - * @param [filter] The filter. - * @returns A list of Spatial Scene Nodes for the 3D Scene - */ - getScene(filter) { - return __awaiter(this, void 0, void 0, function* () { - this.graph.createGraph(); - return this.scene.getScene(filter); - }); - } - /** - * Get all nodes to form the 3D scene of reference organ and tissues - * - * @param [organIri] The Reference Organ IRI - * @param [filter] The filter. - * @returns A list of Spatial Scene Nodes for the 3D Scene - */ - getReferenceOrganScene(organIri, filter) { - return __awaiter(this, void 0, void 0, function* () { - this.graph.createGraph(); - return this.scene.getReferenceOrganScene(organIri, filter); - }); - } - getSpatialPlacement(source, targetIri) { - return __awaiter(this, void 0, void 0, function* () { - return this.graph.getSpatialPlacement(source, targetIri); - }); - } -} - -const gold = [240, 183, 98, 255]; -const red$1 = [213, 0, 0, 255]; -const green$1 = [29, 204, 101, 255]; -const blue$1 = [41, 121, 255, 255]; -/** - * Create a set of scene nodes for the body-ui to show the probing sphere and lines around it - * for a given spatial search. - * @param node the Spatial Entity (usually a reference organ) that the sphere is probing into - * @param sphere the Spatial Search that defines where and how big the probing sphere is - * @returns a set of scene nodes for the body-ui - */ -function getProbingSphereScene(node, sphere) { - var _a; - const sceneWidth = node.x_dimension / 1000; - const sceneHeight = node.y_dimension / 1000; - const sceneDepth = node.z_dimension / 1000; - const defaultSphereRadius = Math.max(sceneWidth, sceneHeight, sceneDepth) * 0.07; - const sphereLineRadius = defaultSphereRadius * 0.05; - const sphereLineLength = defaultSphereRadius * 2; - const sphereConeRadius = sphereLineRadius * 4; - if (!sphere) { - sphere = { - target: (_a = node.representation_of) !== null && _a !== void 0 ? _a : node['@id'], - radius: defaultSphereRadius, - x: sceneWidth / 2, - y: sceneHeight / 2, - z: sceneDepth / 2 - }; - } - else { - sphere = Object.assign(Object.assign({}, sphere), { radius: sphere.radius / 1000, x: sphere.x / 1000, y: sphere.y / 1000, z: sphere.z / 1000 }); - } - return [ - // Probing Sphere - { - '@id': 'http://purl.org/ccf/latest/ccf.owl#ProbingSphere', - '@type': 'SpatialSceneNode', - unpickable: false, - geometry: 'sphere', - transformMatrix: new Matrix4(Matrix4.IDENTITY).translate([sphere.x, sphere.y, sphere.z]).scale(sphere.radius), - color: gold - }, - // Probing Sphere Positive X Axis (D) - { - '@id': 'http://purl.org/ccf/latest/ccf.owl#ProbingsphereXD', - '@type': 'SpatialSceneNode', - unpickable: true, - geometry: 'cylinder', - transformMatrix: new Matrix4(Matrix4.IDENTITY) - .translate([sphere.x + sphere.radius + sphereLineLength / 2, sphere.y, sphere.z]) - .rotateZ(toRadians(-90)) - .scale([sphereLineRadius, sphereLineLength, sphereLineRadius]), - color: red$1 - }, - { - '@id': 'http://purl.org/ccf/latest/ccf.owl#ProbingsphereXDCone', - '@type': 'SpatialSceneNode', - unpickable: true, - geometry: 'cone', - transformMatrix: new Matrix4(Matrix4.IDENTITY) - .translate([sphere.x + sphere.radius + sphereLineLength, sphere.y, sphere.z]) - .rotateZ(toRadians(-90)) - .scale([sphereConeRadius, sphereConeRadius * 3, sphereConeRadius]), - color: red$1 - }, - { - '@id': 'http://purl.org/ccf/latest/ccf.owl#ProbingsphereXDLabel', - '@type': 'SpatialSceneNode', - unpickable: true, - geometry: 'text', - text: 'D', - transformMatrix: new Matrix4(Matrix4.IDENTITY) - .translate([sphere.x + sphere.radius + sphereLineLength + sphereConeRadius * 3, sphere.y, sphere.z]) - .scale(sphereConeRadius), - color: red$1 - }, - // Probing Sphere Negative X Axis (A) - { - '@id': 'http://purl.org/ccf/latest/ccf.owl#ProbingsphereXA', - '@type': 'SpatialSceneNode', - unpickable: true, - geometry: 'cylinder', - transformMatrix: new Matrix4(Matrix4.IDENTITY) - .translate([sphere.x - sphere.radius - sphereLineLength / 2, sphere.y, sphere.z]) - .rotateZ(toRadians(-90)) - .scale([sphereLineRadius, sphereLineLength, sphereLineRadius]), - color: red$1 - }, - { - '@id': 'http://purl.org/ccf/latest/ccf.owl#ProbingsphereXACone', - '@type': 'SpatialSceneNode', - unpickable: true, - geometry: 'cone', - transformMatrix: new Matrix4(Matrix4.IDENTITY) - .translate([sphere.x - sphere.radius - sphereLineLength, sphere.y, sphere.z]) - .rotateZ(toRadians(90)) - .scale([sphereConeRadius, sphereConeRadius * 3, sphereConeRadius]), - color: red$1 - }, - { - '@id': 'http://purl.org/ccf/latest/ccf.owl#ProbingsphereXALabel', - '@type': 'SpatialSceneNode', - unpickable: true, - geometry: 'text', - text: 'A', - transformMatrix: new Matrix4(Matrix4.IDENTITY) - .translate([sphere.x - sphere.radius - sphereLineLength - sphereConeRadius * 3.5, sphere.y, sphere.z]) - .scale(sphereConeRadius), - color: red$1 - }, - // Probing Sphere Positive Y Axis (W) - { - '@id': 'http://purl.org/ccf/latest/ccf.owl#ProbingsphereYW', - '@type': 'SpatialSceneNode', - unpickable: true, - geometry: 'cylinder', - transformMatrix: new Matrix4(Matrix4.IDENTITY) - .translate([sphere.x, sphere.y + sphere.radius + sphereLineLength / 2, sphere.z]) - .scale([sphereLineRadius, sphereLineLength, sphereLineRadius]), - color: green$1 - }, - { - '@id': 'http://purl.org/ccf/latest/ccf.owl#ProbingsphereYWCone', - '@type': 'SpatialSceneNode', - unpickable: true, - geometry: 'cone', - transformMatrix: new Matrix4(Matrix4.IDENTITY) - .translate([sphere.x, sphere.y + sphere.radius + sphereLineLength, sphere.z]) - .scale([sphereConeRadius, sphereConeRadius * 3, sphereConeRadius]), - color: green$1 - }, - { - '@id': 'http://purl.org/ccf/latest/ccf.owl#ProbingsphereYWLabel', - '@type': 'SpatialSceneNode', - unpickable: true, - geometry: 'text', - text: 'W', - transformMatrix: new Matrix4(Matrix4.IDENTITY) - .translate([sphere.x, sphere.y + sphere.radius + sphereLineLength + sphereConeRadius * 3, sphere.z]) - .scale(sphereConeRadius), - color: green$1 - }, - // Probing Sphere Negative Y Axis (S) - { - '@id': 'http://purl.org/ccf/latest/ccf.owl#ProbingsphereYS', - '@type': 'SpatialSceneNode', - unpickable: true, - geometry: 'cylinder', - transformMatrix: new Matrix4(Matrix4.IDENTITY) - .translate([sphere.x, sphere.y - sphere.radius - sphereLineLength / 2, sphere.z]) - .scale([sphereLineRadius, sphereLineLength, sphereLineRadius]), - color: green$1 - }, - { - '@id': 'http://purl.org/ccf/latest/ccf.owl#ProbingsphereYSCone', - '@type': 'SpatialSceneNode', - unpickable: true, - geometry: 'cone', - transformMatrix: new Matrix4(Matrix4.IDENTITY) - .translate([sphere.x, sphere.y - sphere.radius - sphereLineLength, sphere.z]) - .rotateZ(toRadians(180)) - .scale([sphereConeRadius, sphereConeRadius * 3, sphereConeRadius]), - color: green$1 - }, - { - '@id': 'http://purl.org/ccf/latest/ccf.owl#ProbingsphereYSLabel', - '@type': 'SpatialSceneNode', - unpickable: true, - geometry: 'text', - text: 'S', - transformMatrix: new Matrix4(Matrix4.IDENTITY) - .translate([sphere.x, sphere.y - sphere.radius - sphereLineLength - sphereConeRadius * 3.5, sphere.z]) - .scale(sphereConeRadius), - color: green$1 - }, - // Probing Sphere Positive Z Axis (E) - { - '@id': 'http://purl.org/ccf/latest/ccf.owl#ProbingsphereZE', - '@type': 'SpatialSceneNode', - unpickable: true, - geometry: 'cylinder', - transformMatrix: new Matrix4(Matrix4.IDENTITY) - .translate([sphere.x, sphere.y, sphere.z + sphere.radius + sphereLineLength / 2]) - .rotateX(toRadians(90)) - .scale([sphereLineRadius, sphereLineLength, sphereLineRadius]), - color: blue$1 - }, - { - '@id': 'http://purl.org/ccf/latest/ccf.owl#ProbingsphereZECone', - '@type': 'SpatialSceneNode', - unpickable: true, - geometry: 'cone', - transformMatrix: new Matrix4(Matrix4.IDENTITY) - .translate([sphere.x, sphere.y, sphere.z + sphere.radius + sphereLineLength]) - .rotateX(toRadians(90)) - .scale([sphereConeRadius, sphereConeRadius * 3, sphereConeRadius]), - color: blue$1 - }, - { - '@id': 'http://purl.org/ccf/latest/ccf.owl#ProbingsphereZELabel', - '@type': 'SpatialSceneNode', - unpickable: true, - geometry: 'text', - text: 'E', - transformMatrix: new Matrix4(Matrix4.IDENTITY) - .translate([sphere.x, sphere.y, sphere.z + sphere.radius + sphereLineLength + sphereConeRadius * 3]) - .scale(sphereConeRadius), - color: blue$1 - }, - // Probing Sphere Negative Z Axis (Q) - { - '@id': 'http://purl.org/ccf/latest/ccf.owl#ProbingsphereZQ', - '@type': 'SpatialSceneNode', - unpickable: true, - geometry: 'cylinder', - transformMatrix: new Matrix4(Matrix4.IDENTITY) - .translate([sphere.x, sphere.y, sphere.z - sphere.radius - sphereLineLength / 2]) - .rotateX(toRadians(-90)) - .scale([sphereLineRadius, sphereLineLength, sphereLineRadius]), - color: blue$1 - }, - { - '@id': 'http://purl.org/ccf/latest/ccf.owl#ProbingsphereZQCone', - '@type': 'SpatialSceneNode', - unpickable: true, - geometry: 'cone', - transformMatrix: new Matrix4(Matrix4.IDENTITY) - .translate([sphere.x, sphere.y, sphere.z - sphere.radius - sphereLineLength]) - .rotateX(toRadians(-90)) - .scale([sphereConeRadius, sphereConeRadius * 3, sphereConeRadius]), - color: blue$1 - }, - { - '@id': 'http://purl.org/ccf/latest/ccf.owl#ProbingsphereZQLabel', - '@type': 'SpatialSceneNode', - unpickable: true, - geometry: 'text', - text: 'Q', - transformMatrix: new Matrix4(Matrix4.IDENTITY) - .translate([sphere.x, sphere.y, sphere.z - sphere.radius - sphereLineLength - sphereConeRadius * 3.5]) - .scale(sphereConeRadius), - color: blue$1 - } - ]; -} - -const gray = [204, 204, 204, 255]; -const red = [213, 0, 0, 255]; -const green = [29, 204, 101, 255]; -const blue = [41, 121, 255, 255]; -/** - * Create a set of scene nodes for the body-ui to show the origin and lines extending to it's dimensions. - * @param node the Spatial Entity (usually a reference organ) that the origin is defined by - * @param includeLetters whether to show the keyboard letters associated with the origin points - * @returns a set of scene nodes for the body-ui - */ -function getOriginScene(node, includeLetters = false) { - const sceneWidth = node.x_dimension / 1000; - const sceneHeight = node.y_dimension / 1000; - const sceneDepth = node.z_dimension / 1000; - const originRadius = Math.max(sceneWidth, sceneHeight, sceneDepth) * 0.05; - const lineRadius = originRadius * 0.1; - return [ - // Origin Sphere - { - '@id': 'http://purl.org/ccf/latest/ccf.owl#OriginSphere', - '@type': 'SpatialSceneNode', - unpickable: true, - geometry: 'sphere', - transformMatrix: new Matrix4(Matrix4.IDENTITY).scale(originRadius), - color: gray - }, - // Origin X Axis - { - '@id': 'http://purl.org/ccf/latest/ccf.owl#OriginX', - '@type': 'SpatialSceneNode', - unpickable: true, - geometry: 'cylinder', - transformMatrix: new Matrix4(Matrix4.IDENTITY) - .translate([sceneWidth / 2, 0, 0]) - .rotateZ(toRadians(-90)) - .scale([lineRadius, sceneWidth, lineRadius]), - color: red - }, - { - '@id': 'http://purl.org/ccf/latest/ccf.owl#OriginXCone', - '@type': 'SpatialSceneNode', - unpickable: true, - geometry: 'cone', - transformMatrix: new Matrix4(Matrix4.IDENTITY) - .translate([sceneWidth, 0, 0]) - .rotateZ(toRadians(-90)) - .scale([originRadius, originRadius * 3, originRadius]), - color: red - }, - { - '@id': 'http://purl.org/ccf/latest/ccf.owl#OriginXALabel', - '@type': 'SpatialSceneNode', - unpickable: true, - geometry: 'text', - text: 'A', - transformMatrix: new Matrix4(Matrix4.IDENTITY).translate([-originRadius * 2, 0, 0]).scale(originRadius), - color: red - }, - { - '@id': 'http://purl.org/ccf/latest/ccf.owl#OriginXDLabel', - '@type': 'SpatialSceneNode', - unpickable: true, - geometry: 'text', - text: 'D', - transformMatrix: new Matrix4(Matrix4.IDENTITY).translate([sceneWidth + originRadius * 2, 0, 0]).scale(originRadius), - color: red - }, - // Origin Y Axis - { - '@id': 'http://purl.org/ccf/latest/ccf.owl#OriginY', - '@type': 'SpatialSceneNode', - unpickable: true, - geometry: 'cylinder', - transformMatrix: new Matrix4(Matrix4.IDENTITY) - .translate([0, sceneHeight / 2, 0]) - .scale([lineRadius, sceneHeight, lineRadius]), - color: green - }, - { - '@id': 'http://purl.org/ccf/latest/ccf.owl#OriginYCone', - '@type': 'SpatialSceneNode', - unpickable: true, - geometry: 'cone', - transformMatrix: new Matrix4(Matrix4.IDENTITY) - .translate([0, sceneHeight, 0]) - .scale([originRadius, originRadius * 3, originRadius]), - color: green - }, - { - '@id': 'http://purl.org/ccf/latest/ccf.owl#OriginYSLabel', - '@type': 'SpatialSceneNode', - unpickable: true, - geometry: 'text', - text: 'S', - transformMatrix: new Matrix4(Matrix4.IDENTITY).translate([originRadius * 1.5, originRadius * 1.5, 0]).scale(originRadius), - color: green - }, - { - '@id': 'http://purl.org/ccf/latest/ccf.owl#OriginYWLabel', - '@type': 'SpatialSceneNode', - unpickable: true, - geometry: 'text', - text: 'W', - transformMatrix: new Matrix4(Matrix4.IDENTITY).translate([0, sceneHeight + originRadius * 2, 0]).scale(originRadius), - color: green - }, - // Origin Z Axis - { - '@id': 'http://purl.org/ccf/latest/ccf.owl#OriginZ', - '@type': 'SpatialSceneNode', - unpickable: true, - geometry: 'cylinder', - transformMatrix: new Matrix4(Matrix4.IDENTITY) - .translate([0, 0, sceneDepth / 2]) - .rotateX(toRadians(90)) - .scale([lineRadius, sceneDepth, lineRadius]), - color: blue - }, - { - '@id': 'http://purl.org/ccf/latest/ccf.owl#OriginZCone', - '@type': 'SpatialSceneNode', - unpickable: true, - geometry: 'cone', - transformMatrix: new Matrix4(Matrix4.IDENTITY) - .translate([0, 0, sceneDepth]) - .rotateX(toRadians(90)) - .scale([originRadius, originRadius * 3, originRadius]), - color: blue - }, - { - '@id': 'http://purl.org/ccf/latest/ccf.owl#OriginZQLabel', - '@type': 'SpatialSceneNode', - unpickable: true, - geometry: 'text', - text: 'Q', - transformMatrix: new Matrix4(Matrix4.IDENTITY).translate([originRadius * 1.5, -originRadius * 1.5, 0]).scale(originRadius), - color: blue - }, - { - '@id': 'http://purl.org/ccf/latest/ccf.owl#OriginZELabel', - '@type': 'SpatialSceneNode', - unpickable: true, - geometry: 'text', - text: 'E', - transformMatrix: new Matrix4(Matrix4.IDENTITY).translate([0, 0, sceneDepth + originRadius * 2]).scale(originRadius), - color: blue - } - ].filter(n => (includeLetters && n.geometry === 'text' && n.text) || !n.text); -} - -/* - * Public API Surface of ccf - */ - -/** - * Generated bundle index. Do not edit. - */ - -export { CCFDatabase, CCFDatabaseStatusTracker, CCFSpatialScene, DEFAULT_CCF_DB_OPTIONS, addHubmapDataToStore, getOriginScene, getProbingSphereScene, searchHubmap }; -//# sourceMappingURL=ccf-database.js.map diff --git a/ccf-database/fesm2015/ccf-database.js.map b/ccf-database/fesm2015/ccf-database.js.map deleted file mode 100644 index 8940160c0..000000000 --- a/ccf-database/fesm2015/ccf-database.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ccf-database.js","sources":["../../../projects/ccf-database/src/lib/util/n3-functions.ts","../../../projects/ccf-database/src/lib/util/prefixes.ts","../../../projects/ccf-database/src/lib/queries/spatial-result-n3.ts","../../../projects/ccf-database/src/lib/ccf-spatial-graph.ts","../../../projects/ccf-database/src/lib/ccf-spatial-scene.ts","../../../projects/ccf-database/src/lib/hubmap/hubmap-data.ts","../../../projects/ccf-database/src/lib/hubmap/hubmap-data-import.ts","../../../projects/ccf-database/src/lib/queries/aggregate-results-n3.ts","../../../projects/ccf-database/src/lib/queries/spatial-search-n3.ts","../../../projects/ccf-database/src/lib/queries/find-ids-n3.ts","../../../projects/ccf-database/src/lib/queries/ontology-term-occurences-n3.ts","../../../projects/ccf-database/src/lib/queries/ontology-tree-n3.ts","../../../projects/ccf-database/src/lib/queries/tissue-block-result-n3.ts","../../../projects/ccf-database/src/lib/util/ccf-database-status-tracker.ts","../../../projects/ccf-database/src/lib/util/patch-jsonld.ts","../../../projects/ccf-database/src/lib/util/enrich-rui-locations.ts","../../../projects/ccf-database/src/lib/ccf-database.ts","../../../projects/ccf-database/src/lib/util/probing-sphere-scene.ts","../../../projects/ccf-database/src/lib/util/origin-scene.ts","../../../projects/ccf-database/src/public-api.ts","../../../projects/ccf-database/src/ccf-database.ts"],"sourcesContent":["import { fromRdf } from 'rdf-literal';\nimport { Store, readQuads } from 'triple-store-utils';\n\n\n/**\n * Iterates over the key/value pairs for an IRI, using the specified mapping with quads from the store.\n *\n * @param store The triple store.\n * @param iri The data identifier.\n * @param mapping Property mappings.\n * @returns an iterator over the key/value pairs\n */\nexport function* getEntries(store: Store, iri: string, mapping: { [iri: string]: string }): Generator<[ string, string|number ]> {\n for (const [predicate, key] of Object.entries(mapping)) {\n for (const quad of readQuads(store, iri, predicate, null, null)) {\n const value = quad.object.termType === 'Literal' ? fromRdf(quad.object) : quad.object.id;\n yield [key, value];\n }\n }\n}\n\n/**\n * Creates an object of the specified type using quads from the store.\n *\n * @param store The triple store.\n * @param iri The data identifier.\n * @param type Type name.\n * @param mapping Property mappings.\n * @returns A new data object.\n */\nexport function getMappedResult(store: Store, iri: string, type: string, mapping: { [iri: string]: string }): T {\n const result = { '@id': iri, '@type': type };\n for (const [predicate, key] of Object.entries(mapping)) {\n for (const quad of readQuads(store, result['@id'], predicate, null, null)) {\n const value = quad.object.termType === 'Literal' ? fromRdf(quad.object) : quad.object.id;\n result[key] = value;\n }\n }\n return result as unknown as T;\n}\n","/* eslint-disable @typescript-eslint/naming-convention */\nimport { DataFactory, Util } from 'triple-store-utils';\n\n/** Constants used to create entity accessors. */\nexport const PREFIXES = {\n base: 'http://purl.org/ccf/latest/ccf.owl#',\n ccf: 'http://purl.org/ccf/',\n fma: 'http://purl.org/sig/ont/fma/fma',\n obo: 'http://purl.obolibrary.org/obo/',\n uberon: 'http://purl.obolibrary.org/obo/UBERON_',\n cl: 'http://purl.obolibrary.org/obo/CL_',\n lmha: 'http://purl.obolibrary.org/obo/LMHA_',\n rdf: 'http://www.w3.org/1999/02/22-rdf-syntax-ns#',\n rdfs: 'http://www.w3.org/2000/01/rdf-schema#',\n dc: 'http://purl.org/dc/elements/1.1/',\n dcterms: 'http://purl.org/dc/terms/'\n};\n\n/** Prefix factory. */\nexport const prefixer = Util.prefixes(PREFIXES, DataFactory);\n\nexport const rdf = {\n x: prefixer('rdf'),\n type: prefixer('rdf')('type')\n};\n\nexport const rdfs = {\n x: prefixer('rdfs'),\n label: prefixer('rdfs')('label'),\n comment: prefixer('rdfs')('comment'),\n isDefinedBy: prefixer('rdfs')('isDefinedBy'),\n seeAlso: prefixer('rdfs')('seeAlso')\n};\n\n/** CCF id helper. */\nconst ccfx = prefixer('ccf');\n\n/** Common entity ids. */\nexport const entity = {\n id: prefixer('ccf')('has_registration_location'),\n label: prefixer('rdfs')('label'),\n description: prefixer('rdfs')('comment'),\n link: ccfx('url'),\n\n sex: ccfx('sex'),\n age: ccfx('age'),\n bmi: ccfx('bmi'),\n\n Male: DataFactory.literal('Male'),\n Female: DataFactory.literal('Female'),\n\n consortiumName: ccfx('consortium_name'),\n providerName: ccfx('tissue_provider_name'),\n providerUUID: ccfx('tissue_provider_uuid'),\n\n donor: ccfx('comes_from'),\n\n sections: ccfx('subdivided_into_sections'),\n datasets: ccfx('generates_dataset'),\n\n sampleType: ccfx('sample_type'),\n\n TissueBlock: DataFactory.literal('Tissue Block'),\n TissueSection: DataFactory.literal('Tissue Section'),\n NonStandard: DataFactory.literal('Non-standard'),\n\n sectionCount: ccfx('section_count'),\n sectionSize: ccfx('section_size'),\n sectionUnits: ccfx('section_size_unit'),\n sectionNumber: ccfx('section_number'),\n\n spatialEntity: ccfx('has_registration_location'),\n ontologyTerms: ccfx('has_ontology_term'),\n cellTypeTerms: ccfx('has_cell_type_term'),\n\n technology: ccfx('technology'),\n thumbnail: ccfx('thumbnail')\n};\n\n/** CCF specific ids. */\nexport const ccf = {\n x: ccfx,\n base: prefixer('base'),\n ontologyNode: {\n label: ccfx('ccf_pref_label'),\n parent: ccfx('ccf_part_of'),\n children: ccfx('ccf_part_of'),\n rui_rank: ccfx('rui_rank'),\n synonymLabels: DataFactory.namedNode('http://www.geneontology.org/formats/oboInOwl#hasExactSynonym')\n },\n asctb: {\n part_of: ccfx('ccf_part_of'),\n ct_is_a: ccfx('ccf_ct_isa'),\n located_in: ccfx('ccf_located_in'),\n characterizes: ccfx('ccf_characterizes')\n },\n spatial: {\n Female: prefixer('base')('VHFemale'),\n Male: prefixer('base')('VHMale'),\n BothSexes: prefixer('base')('VHBothSexes'),\n FemaleOrgans: prefixer('base')('VHFemaleOrgans'),\n MaleOrgans: prefixer('base')('VHMaleOrgans')\n },\n SpatialObjectReference: ccfx('spatial_object_reference'),\n SpatialEntity: ccfx('spatial_entity'),\n SpatialPlacement: ccfx('spatial_placement'),\n spatialObjectReference: {\n file: ccfx('file_url'),\n file_format: ccfx('file_format'),\n file_subpath: ccfx('file_subpath')\n },\n extractionSet: {\n label: prefixer('rdfs')('label'),\n rui_rank: ccfx('rui_rank')\n },\n spatialEntity: {\n label: prefixer('rdfs')('label'),\n description: prefixer('rdfs')('comment'),\n creator: prefixer('dcterms')('creator'),\n creator_first_name: ccfx('creator_first_name'),\n creator_last_name: ccfx('creator_last_name'),\n creator_orcid: ccfx('creator_orcid'),\n creation_date: prefixer('dcterms')('created'),\n updated_date: ccfx('updated_date'),\n ccf_annotations: ccfx('collides_with'),\n representation_of: ccfx('representation_of'),\n reference_organ: ccfx('has_reference_organ'),\n extraction_set_for: ccfx('extraction_set_for'),\n extraction_set: ccfx('has_extraction_set'),\n sex: ccfx('organ_owner_sex'),\n side: ccfx('organ_side'),\n rui_rank: ccfx('rui_rank'),\n slice_thickness: ccfx('slice_thickness'),\n slice_count: ccfx('slice_count'),\n x_dimension: ccfx('x_dimension'),\n y_dimension: ccfx('y_dimension'),\n z_dimension: ccfx('z_dimension'),\n dimension_units: ccfx('dimension_unit'),\n object: ccfx('has_object_reference')\n },\n spatialPlacement: {\n source: ccfx('placement_for'),\n target: ccfx('placement_relative_to'),\n\n placement_date: prefixer('dcterms')('created'),\n x_scaling: ccfx('x_scaling'),\n y_scaling: ccfx('y_scaling'),\n z_scaling: ccfx('z_scaling'),\n scaling_units: ccfx('scaling_unit'),\n\n x_rotation: ccfx('x_rotation'),\n y_rotation: ccfx('y_rotation'),\n z_rotation: ccfx('z_rotation'),\n w_rotation: ccfx('theta_rotation'),\n rotation_order: ccfx('rotation_order'),\n rotation_units: ccfx('rotation_unit'),\n\n x_translation: ccfx('x_translation'),\n y_translation: ccfx('y_translation'),\n z_translation: ccfx('z_translation'),\n translation_units: ccfx('translation_unit')\n }\n};\n\n/** Uberon specific ids. */\nexport const uberon = {\n x: prefixer('uberon'),\n body: prefixer('uberon')('0013702')\n};\n\n/** CL specific ids. */\nexport const cl = {\n x: prefixer('cl'),\n cell: prefixer('cl')('0000000')\n};\n\n/** FMA specific ids. */\nexport const fma = {\n x: prefixer('fma')\n};\n\n/** LMHA specific ids. */\nexport const lmha = {\n x: prefixer('lmha')\n};\n\n/** RUI accessors. */\nexport const rui = {\n body: uberon.body,\n cell: cl.cell,\n respiratory_system: uberon.x('0001004'),\n colon: uberon.x('0001155'),\n left_lung: uberon.x('0002168'),\n right_lung: uberon.x('0002167'),\n left_bronchus: uberon.x('0002178'),\n right_bronchus: uberon.x('0002177'),\n kidney: uberon.x('0002113'),\n ureter: uberon.x('0000056'),\n eye: uberon.x('0000970'),\n fallopian_tube: uberon.x('0003889'),\n knee: uberon.x('0001465'),\n ovary: uberon.x('0000992'),\n trachea: uberon.x('0003126'),\n aorta: uberon.x('0000947'),\n blood: uberon.x('0000178'),\n bone_marrow: uberon.x('0002371'),\n male_reproductive_system: uberon.x('0000079'),\n lymph_node: uberon.x('0000029'),\n\n // Derived using console.log(ALL_POSSIBLE_ORGANS.map(o => ` ${o.name.toLowerCase().replace(',', '').replace(/ /g, '_')}: ${o.id.split('/').slice(-1)[0].split('_')[0].toLowerCase()}.x('${o.id.split('_').slice(-1)[0]}'),`).join('\\n'));\n blood_vasculature: uberon.x('0004537'),\n brain: uberon.x('0000955'),\n eye_left: uberon.x('0004548'),\n eye_right: fma.x('54449'),\n fallopian_tube_left: uberon.x('0001303'),\n fallopian_tube_right: uberon.x('0001302'),\n heart: uberon.x('0000948'),\n kidney_left: uberon.x('0004538'),\n kidney_right: uberon.x('0004539'),\n knee_left: fma.x('24978'),\n knee_right: fma.x('24977'),\n large_intestine: uberon.x('0000059'),\n liver: uberon.x('0002107'),\n lungs: uberon.x('0002048'),\n mesenteric_lymph_node: uberon.x('0002509'),\n ovary_left: fma.x('7214'),\n ovary_right: fma.x('7213'),\n pancreas: uberon.x('0001264'),\n pelvis: uberon.x('0001270'),\n prostate_gland: uberon.x('0002367'),\n skin: uberon.x('0002097'),\n small_intestine: uberon.x('0002108'),\n spleen: uberon.x('0002106'),\n thymus: uberon.x('0002370'),\n ureter_left: uberon.x('0001223'),\n ureter_right: uberon.x('0001222'),\n urinary_bladder: uberon.x('0001255'),\n uterus: uberon.x('0000995')\n};\n","import { sortBy } from 'lodash';\nimport { DataFactory, NamedNode, Store } from 'triple-store-utils';\n\nimport { SpatialEntity, SpatialObjectReference, SpatialPlacement, ExtractionSet } from '../spatial-types';\nimport { getMappedResult } from '../util/n3-functions';\nimport { ccf, entity } from '../util/prefixes';\n\n\n/**\n * Reverses the keys and values in a mapping.\n *\n * @param mapping The mapping to reverse.\n * @returns The reversed mapping.\n */\nfunction reverseMapping(mapping: { [property: string]: NamedNode }): { [iri: string]: string } {\n const newMapping: { [iri: string]: string } = {};\n Object.entries(mapping).forEach(([prop, predicate]) => {\n newMapping[predicate.id] = prop;\n });\n return newMapping;\n}\n\n/** A mapping of spatial objects. */\nconst mappings = {\n spatialObjectReference: reverseMapping(ccf.spatialObjectReference),\n spatialEntity: reverseMapping(ccf.spatialEntity),\n spatialPlacement: reverseMapping(ccf.spatialPlacement)\n};\n\n/**\n * Creates a spatial object reference.\n *\n * @param store The triple store.\n * @param iri The data identifier.\n * @returns The new reference.\n */\nexport function getSpatialObjectReference(store: Store, iri: string): SpatialObjectReference {\n return getMappedResult(store, iri, 'SpatialObjectReference', mappings.spatialObjectReference);\n}\n\n/**\n * Creates an extraction set data object.\n *\n * @param store The triple store.\n * @param iri The data identifier.\n * @returns The new entity.\n */\nexport function getExtractionSet(store: Store, iri: string): ExtractionSet {\n const result = getMappedResult(store, iri, 'ExtractionSet', mappings.spatialEntity);\n result.extractionSites = sortBy(\n store.getSubjects(ccf.spatialEntity.extraction_set, iri, null)\n .map((value) => getSpatialEntity(store, value.id)),\n ['rui_rank']);\n return result;\n}\n\n/**\n * Gets extraction sets associated with a reference organ\n *\n * @param store The triple store.\n * @param iri The data identifier (the reference organ).\n * @returns A set of extraction sets associated with the reference organ\n */\nexport function getExtractionSets(store: Store, iri: string): ExtractionSet[] {\n return sortBy(\n store.getSubjects(ccf.spatialEntity.extraction_set_for, iri, null)\n .map((value) => getExtractionSet(store, value.id)),\n ['rui_rank']\n );\n}\n\n\n/**\n * Gets the anatomical structures associated with a reference organ.\n *\n * @param store The triple store.\n * @param iri The data identifier (reference organ).\n * @returns The new entity.\n */\nexport function getAnatomicalStructures(store: Store, iri: string): SpatialEntity[] {\n return sortBy(\n store.getSubjects(ccf.spatialEntity.reference_organ, iri, null)\n .map((value) => getSpatialEntity(store, value.id))\n .filter((e) => e['@id'] !== iri),\n ['rui_rank']\n );\n}\n\n/**\n * Gets all reference organs in the triple store\n *\n * @param store The triple store.\n * @returns All the reference organs.\n */\nexport function getReferenceOrgans(store: Store): SpatialEntity[] {\n const results: SpatialEntity[] = [];\n store.forEach((quad) => {\n if (quad.subject.id === quad.object.id) {\n results.push(getSpatialEntity(store, quad.subject.id));\n }\n }, null, ccf.spatialEntity.reference_organ, null, null);\n return sortBy(results, ['rui_rank']);\n}\n\n/**\n * Creates a spatial entity data object.\n *\n * @param store The triple store.\n * @param iri The data identifier.\n * @returns The new entity.\n */\nexport function getSpatialEntity(store: Store, iri: string): SpatialEntity {\n const result = getMappedResult(store, iri, 'SpatialEntity', mappings.spatialEntity);\n // Default mapping will come back as an IRI which we can look up for the full object\n if (result.object) {\n result.object = getSpatialObjectReference(store, (result.object as unknown) as string);\n }\n if (result.ccf_annotations) {\n result.ccf_annotations = store.getObjects(iri, ccf.spatialEntity.ccf_annotations, null).map(o => o.id);\n }\n store.forSubjects((subject) => (result.entityId = subject.id), entity.spatialEntity, iri, null);\n return result;\n}\n\n/**\n * Creates a spatial placement object.\n *\n * @param store The triple store.\n * @param iri The data identifier.\n * @returns THe new placement object.\n */\nexport function getSpatialPlacement(store: Store, iri: string): SpatialPlacement {\n const result = getMappedResult(store, iri, 'SpatialPlacement', mappings.spatialPlacement);\n // Default mapping will come back as an IRI for source/target which we can look up for the full object\n if (result.source) {\n result.source = getSpatialEntity(store, (result.source as unknown) as string);\n }\n if (result.target) {\n result.target = getSpatialEntity(store, (result.target as unknown) as string);\n }\n return result;\n}\n\n/**\n * Creates a spatial entity based on another entity in the store.\n *\n * @param store The triple store.\n * @param entityIRI The indentifier of the store entity.\n * @returns A new entity.\n */\nexport function getSpatialEntityForEntity(store: Store, entityIRI: string): SpatialEntity | undefined {\n const spatialEntityNodes = store.getObjects(DataFactory.namedNode(entityIRI), entity.spatialEntity, null);\n if (spatialEntityNodes.length > 0) {\n return getSpatialEntity(store, spatialEntityNodes[0].id);\n } else {\n return undefined;\n }\n}\n","/* eslint-disable @typescript-eslint/naming-convention */\n/* eslint-disable @typescript-eslint/no-unsafe-call */\n/* eslint-disable @typescript-eslint/no-unsafe-member-access */\nimport { Euler, Matrix4, toDegrees, toRadians } from '@math.gl/core';\nimport { DirectedGraph } from 'graphology';\nimport shortestPath from 'graphology-shortest-path/unweighted';\nimport { get } from 'lodash';\nimport { readQuads } from 'triple-store-utils';\nimport { v4 as uuidV4 } from 'uuid';\n\nimport { CCFDatabase } from './ccf-database';\nimport { getSpatialPlacement } from './queries/spatial-result-n3';\nimport { FlatSpatialPlacement, SpatialEntity, SpatialPlacement } from './spatial-types';\nimport { ccf, rdf } from './util/prefixes';\n\n\nexport function applySpatialPlacement(tx: Matrix4, placement: SpatialPlacement): Matrix4 {\n const p = placement;\n let factor: number;\n switch (p.translation_units) {\n case 'centimeter':\n factor = 1 / 100;\n break;\n case 'millimeter':\n factor = 1 / 1000;\n break;\n case 'meter':\n default:\n factor = 1;\n break;\n }\n const T = [p.x_translation, p.y_translation, p.z_translation].map(t => t * factor);\n const R = [p.x_rotation, p.y_rotation, p.z_rotation].map(toRadians) as [number, number, number];\n const S = [p.x_scaling, p.y_scaling, p.z_scaling];\n\n return tx.translate(T).rotateXYZ(R).scale(S);\n}\n\nexport class CCFSpatialGraph {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n graph: any;\n\n constructor(private db: CCFDatabase) {\n this.createGraph();\n }\n\n createGraph(): void {\n this.graph = new DirectedGraph();\n const store = this.db.store;\n\n // Add all Spatial Object References\n store.forSubjects((subject) => {\n this.addNode(subject.id, 'SpatialObjectReference');\n }, rdf.type, ccf.SpatialObjectReference, null);\n\n // Add all Spatial Entities\n store.forSubjects((subject) => {\n this.addNode(subject.id, 'SpatialEntity');\n }, rdf.type, ccf.SpatialEntity, null);\n\n // Add all Spatial Placements\n const edgeSource: Record = {};\n for (const quad of readQuads(store, null, ccf.spatialPlacement.source, null, null)) {\n edgeSource[quad.subject.id] = quad.object.id;\n }\n for (const quad of readQuads(store, null, ccf.spatialPlacement.target, null, null)) {\n const source = edgeSource[quad.subject.id];\n if (source) {\n this.addEdge(quad.subject.id, source, quad.object.id, 'SpatialPlacement');\n }\n }\n }\n\n addNode(id: string, type: string): void {\n this.graph.mergeNode(id, { type });\n }\n\n addEdge(id: string, source: string, target: string, type: string): void {\n this.graph.mergeDirectedEdge(source, target, { type, id });\n }\n\n getTransformationMatrix(sourceIRI: string, targetIRI: string): Matrix4 | undefined {\n if (sourceIRI === targetIRI) {\n return new Matrix4(Matrix4.IDENTITY); // identity\n }\n if (!this.graph.hasNode(sourceIRI) || !this.graph.hasNode(targetIRI)) {\n return undefined;\n }\n\n const store = this.db.store;\n const tx = new Matrix4(Matrix4.IDENTITY);\n const path = shortestPath(this.graph, sourceIRI, targetIRI);\n if (path && path.length > 0) {\n path.reverse();\n let target: string | number = '';\n for (const source of path) {\n if (target) {\n const placementId = this.graph.getEdgeAttribute(source, target, 'id');\n const placement = getSpatialPlacement(store, placementId);\n applySpatialPlacement(tx, placement);\n }\n target = source;\n }\n return tx;\n } else {\n return undefined;\n }\n }\n\n getSpatialPlacement(source: SpatialEntity, targetIri: string): FlatSpatialPlacement | undefined {\n const sourceIri = this.graph.hasNode(source['@id']) ? source['@id'] : undefined;\n const placement: SpatialPlacement = get(source, 'placement[0]', get(source, 'placement', undefined));\n\n let matrix: Matrix4 | undefined;\n if (placement && this.graph.hasNode(placement.target)) {\n matrix = this.getTransformationMatrix(placement.target as unknown as string, targetIri);\n if (matrix) {\n matrix = applySpatialPlacement(matrix, placement);\n }\n } else if (sourceIri) {\n matrix = this.getTransformationMatrix(sourceIri, targetIri);\n }\n\n if (matrix) {\n const euler = new Euler().fromRotationMatrix(matrix, Euler.XYZ);\n const T = matrix.getTranslation().map(n => n * 1000) as [number, number, number];\n const R = euler.toVector3().map(toDegrees) as [number, number, number];\n const S = matrix.getScale().map(n => n < 1 && n > 0.999999 ? 1 : n) as [number, number, number];\n\n return {\n '@context': 'https://hubmapconsortium.github.io/hubmap-ontology/ccf-context.jsonld',\n '@id': `http://purl.org/ccf/1.5/${uuidV4()}_placement`,\n '@type': 'SpatialPlacement',\n source: source['@id'],\n target: targetIri,\n placement_date: new Date().toISOString().split('T')[0],\n x_scaling: S[0],\n y_scaling: S[1],\n z_scaling: S[2],\n scaling_units: 'ratio',\n x_rotation: R[0],\n y_rotation: R[1],\n z_rotation: R[2],\n rotation_order: 'XYZ',\n rotation_units: 'degree',\n x_translation: T[0],\n y_translation: T[1],\n z_translation: T[2],\n translation_units: 'millimeter'\n };\n } else {\n return undefined;\n }\n }\n}\n","/* eslint-disable @typescript-eslint/naming-convention */\nimport { Matrix4, toRadians } from '@math.gl/core';\n\nimport { CCFDatabase } from './ccf-database';\nimport { Filter } from './interfaces';\nimport {\n getAnatomicalStructures, getExtractionSet, getExtractionSets, getReferenceOrgans, getSpatialEntity,\n} from './queries/spatial-result-n3';\nimport { ExtractionSet, SpatialEntity } from './spatial-types';\nimport { ccf } from './util/prefixes';\n\n\nexport type SpatialSceneGeometry = 'sphere' | 'cube' | 'wireframe' | 'text' | 'cone' | 'cylinder';\n\nexport interface SpatialSceneNode {\n '@id': string;\n '@type': string;\n entityId?: string;\n ccf_annotations?: string[];\n representation_of?: string;\n reference_organ?: string;\n unpickable?: boolean;\n geometry?: SpatialSceneGeometry;\n text?: string;\n _lighting?: string;\n scenegraph?: string;\n scenegraphNode?: string;\n zoomBasedOpacity?: boolean;\n zoomToOnLoad?: boolean;\n color?: [number, number, number, number];\n opacity?: number;\n transformMatrix: Matrix4;\n name?: string;\n tooltip?: string;\n priority?: number;\n}\n\nexport class CCFSpatialScene {\n\n constructor(private db: CCFDatabase) {}\n\n getSpatialEntity(iri: string): SpatialEntity {\n return getSpatialEntity(this.db.store, iri);\n }\n getExtractionSets(iri: string): ExtractionSet[] {\n return getExtractionSets(this.db.store, iri);\n }\n getExtractionSet(iri: string): ExtractionSet {\n return getExtractionSet(this.db.store, iri);\n }\n getAnatomicalStructures(iri: string): SpatialEntity[] {\n return getAnatomicalStructures(this.db.store, iri);\n }\n getReferenceOrgans(): SpatialEntity[] {\n return getReferenceOrgans(this.db.store);\n }\n\n getReferenceBody(filter?: Filter): SpatialEntity {\n let bodyId: string;\n switch (filter?.sex) {\n case 'Male':\n bodyId = ccf.spatial.Male.id;\n break;\n case 'Female':\n bodyId = ccf.spatial.Female.id;\n break;\n case 'Both':\n default:\n bodyId = ccf.spatial.BothSexes.id;\n break;\n }\n return this.getSpatialEntity(bodyId);\n }\n\n getReferenceOrganSets(filter?: Filter): SpatialEntity[] {\n let organSet = this.getReferenceOrgans();\n switch (filter?.sex) {\n case 'Male':\n organSet = organSet.filter(s => s.sex === 'Male');\n break;\n case 'Female':\n organSet = organSet.filter(s => s.sex === 'Female');\n break;\n case 'Both':\n default:\n break;\n }\n if (filter?.debug) {\n organSet = organSet.map(o => [ [o], this.getAnatomicalStructures(o['@id'])])\n .reduce((acc, [organ, structures]) => acc.concat(structures.length > 0 ? structures : organ), []);\n }\n return organSet;\n }\n\n getReferenceSceneNodes(filter?: Filter): SpatialSceneNode[] {\n const body = this.getReferenceBody(filter);\n const skinNodes: SpatialSceneNode[] = [];\n let nodes: (SpatialSceneNode | undefined)[] = [\n ...this.getReferenceOrganSets(filter).map((organ) => {\n const isSkin = organ.representation_of === 'http://purl.obolibrary.org/obo/UBERON_0002097';\n const sceneNode = this.getSceneNode(organ, body, {\n color: [255, 255, 255, 255], opacity: isSkin ? 0.5 : 0.2, unpickable: true, _lighting: 'pbr', zoomBasedOpacity: !isSkin\n });\n if (isSkin && sceneNode) {\n skinNodes.push(sceneNode);\n return undefined;\n } else {\n return sceneNode;\n }\n })\n ];\n if (skinNodes.length > 0) {\n nodes = [...skinNodes, ...nodes];\n }\n\n if (filter?.debug) {\n // Debug bounding boxes\n nodes = nodes.concat([\n this.getSceneNode(this.getSpatialEntity(ccf.base('VHRightKidney').id), body, { color: [0, 0, 255, 0.5*255], geometry: 'wireframe' }),\n this.getSceneNode(this.getSpatialEntity(ccf.base('VHLeftKidney').id), body, { color: [255, 0, 0, 0.5*255], geometry: 'wireframe' }),\n this.getSceneNode(this.getSpatialEntity(ccf.base('VHSpleenCC1').id), body, { color: [0, 255, 0, 0.5*255], geometry: 'wireframe' }),\n this.getSceneNode(this.getSpatialEntity(ccf.base('VHSpleenCC2').id), body, { color: [0, 255, 0, 0.5*255], geometry: 'wireframe' }),\n this.getSceneNode(this.getSpatialEntity(ccf.base('VHSpleenCC3').id), body, { color: [0, 255, 0, 0.5*255], geometry: 'wireframe' })\n ]);\n }\n\n return nodes.filter(s => s !== undefined) as SpatialSceneNode[];\n }\n\n getReferenceOrganScene(organIri: string, filter?: Filter): SpatialSceneNode[] {\n const hasSexFilter = filter?.sex !== undefined && filter?.sex?.toLowerCase() !== 'both';\n const organs = this.getReferenceOrgans().filter((o) => o.representation_of === organIri && (!hasSexFilter || o.sex === filter?.sex));\n if (organs.length > 0) {\n const organ = organs[0];\n const isSkin = organ.representation_of === 'http://purl.obolibrary.org/obo/UBERON_0002097';\n const organNode = this.getSceneNode(organ, organ, {\n color: [255, 255, 255, 255], opacity: isSkin ? 0.5 : 0.2, unpickable: true, _lighting: 'pbr'\n }) as SpatialSceneNode;\n\n const scene = (this.db.getSpatialEntities(filter) ?? []).map((entity) =>\n this.getSceneNode(entity, organ, { color: [255, 255, 255, 0.9*255] })\n ) as SpatialSceneNode[];\n return [organNode].concat(scene).filter(n => n !== undefined);\n } else {\n return [];\n }\n }\n\n getEntitySceneNodes(filter?: Filter): SpatialSceneNode[] {\n const body = this.getReferenceBody(filter);\n return this.db.getSpatialEntities(filter).map((entity) =>\n this.getSceneNode(entity, body, { color: [255, 255, 255, 0.9*255] })\n ).filter(s => s !== undefined) as SpatialSceneNode[];\n }\n\n getSceneNode(source: SpatialEntity, target: SpatialEntity, nodeAttrs: Partial = {}): SpatialSceneNode | undefined {\n const has3dObject = source?.object?.file_format?.startsWith('model/gltf');\n const sourceID = has3dObject && source.object ? source.object['@id'] : source['@id'];\n let transform = this.db.graph.getTransformationMatrix(sourceID, target['@id']);\n if (transform) {\n if (has3dObject) {\n transform = new Matrix4(Matrix4.IDENTITY).rotateX(toRadians(90)).multiplyLeft(transform);\n } else {\n // Scale visible bounding boxes to the desired dimensions\n let factor: number;\n switch (source.dimension_units) {\n case 'centimeter':\n factor = 1 / 100;\n break;\n case 'millimeter':\n factor = 1 / 1000;\n break;\n case 'meter':\n default:\n factor = 1;\n break;\n }\n const scale = [source.x_dimension, source.y_dimension, source.z_dimension].map(dim => dim * factor / 2);\n transform.scale(scale);\n }\n return {\n '@id': source['@id'], '@type': 'SpatialSceneNode',\n entityId: source.entityId,\n ccf_annotations: source.ccf_annotations,\n representation_of: source.representation_of,\n reference_organ: source.reference_organ,\n scenegraph: has3dObject ? source.object?.file : undefined,\n scenegraphNode: has3dObject ? source.object?.file_subpath : undefined,\n transformMatrix: transform,\n tooltip: source.label,\n ...nodeAttrs\n };\n } else {\n return undefined;\n }\n }\n\n getScene(filter?: Filter): SpatialSceneNode[] {\n return [\n ...this.getReferenceSceneNodes(filter),\n ...this.getEntitySceneNodes(filter)\n ];\n }\n}\n","/* eslint-disable @typescript-eslint/naming-convention */\nimport { JsonLd, JsonLdObj } from 'jsonld/jsonld-spec';\nimport { get, omit, set, toNumber } from 'lodash';\n\n\ntype JsonDict = Record;\nconst HBM_PREFIX = 'https://entity.api.hubmapconsortium.org/entities/';\n\n// eslint-disable-next-line max-len\nexport const DR1_VU_THUMBS = 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']);\n// eslint-disable-next-line max-len\nexport const UFL_THUMBS = { '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' };\n\n/** UUID to TMC mapping. */\nconst GROUP_UUID_MAPPING: { [uuid: string]: string } = {\n '03b3d854-ed44-11e8-8bce-0e368f3075e8': 'TMC-UCSD',\n '07a29e4c-ed43-11e8-b56a-0e8017bdda58': 'TMC-Florida',\n '308f5ffc-ed43-11e8-b56a-0e8017bdda58': 'TMC-CalTech',\n '5bd084c8-edc2-11e8-802f-0e368f3075e8': 'HBM-TestingGroup',\n '73bb26e4-ed43-11e8-8f19-0a7c1eab007a': 'TMC-Vanderbilt',\n 'def5fd76-ed43-11e8-b56a-0e8017bdda58': 'TMC-Stanford',\n '5c106f29-ea2d-11e9-85e8-0efb3ba9a670': 'RTI-General Electric',\n '301615f9-c870-11eb-a8dc-35ce3d8786fe': 'TMC-UConn'\n};\n\nconst ENTITY_CONTEXT = {\n '@base': 'http://purl.org/ccf/latest/ccf-entity.owl#',\n '@vocab': 'http://purl.org/ccf/latest/ccf-entity.owl#',\n ccf: 'http://purl.org/ccf/',\n rdfs: 'http://www.w3.org/2000/01/rdf-schema#',\n\n label: 'rdfs:label',\n description: 'rdfs:comment',\n link: {\n '@id': 'rdfs:seeAlso',\n '@type': '@id'\n },\n samples: {\n '@reverse': 'has_donor'\n },\n sections: {\n '@id': 'has_tissue_section',\n '@type': '@id'\n },\n datasets: {\n '@id': 'has_dataset',\n '@type': '@id'\n },\n // eslint-disable-next-line @typescript-eslint/naming-convention\n rui_location: {\n '@id': 'has_spatial_entity',\n '@type': '@id'\n },\n ontologyTerms: {\n '@id': 'has_ontology_term',\n '@type': '@id'\n },\n cellTypeTerms: {\n '@id': 'has_cell_type_term',\n '@type': '@id'\n },\n thumbnail: {\n '@id': 'has_thumbnail'\n }\n};\n\n/**\n * Converts a hubmap response object into JsonLd.\n *\n * @param data The hubmap data.\n * @returns The converted data.\n */\nexport function hubmapResponseAsJsonLd(data: unknown, assetsApi = '', portalUrl = '', serviceToken?: string, debug = false): JsonLd {\n const entries = (get(data, 'hits.hits', []) as JsonDict[])\n .map(e => get(e, '_source', {}) as JsonDict)\n .sort((a, b) => (a['uuid'] as string).localeCompare(b['uuid'] as string));\n\n const donorLookup: Record = {};\n const unflattened: JsonLdObj[] = entries.map(e =>\n new HuBMAPTissueBlock(e, assetsApi, portalUrl, serviceToken).toJsonLd()\n );\n for (const donor of unflattened) {\n const donorId = donor['@id'] as string;\n if (!donorLookup[donorId]) {\n donorLookup[donorId] = donor;\n } else {\n const samples = donorLookup[donorId].samples as JsonLdObj[];\n samples.push((donor.samples as JsonLdObj[])[0]);\n }\n }\n const donors = Object.values(donorLookup);\n\n if (debug) {\n debugDonors(donors);\n console.log(donors.map(d => ({ '@context': ENTITY_CONTEXT, ...d })));\n }\n\n return { '@context': ENTITY_CONTEXT, '@graph': donors };\n}\n\nfunction debugDonors(donors: JsonLdObj[]) {\n let datasets: JsonLdObj[] = [];\n let deleted = 0;\n for (const donor of donors.filter(d => (d.samples as []).length > 1)) {\n const samples = donor.samples as JsonLdObj[];\n for (let i=0; i < samples.length; i++) {\n const blockId = samples[i]['@id'] as string;\n datasets = datasets.concat(samples[i].datasets as JsonLdObj[]);\n for (const section of samples[i].sections as JsonLdObj[]) {\n datasets = datasets.concat(section.datasets as JsonLdObj[]);\n }\n for (let j=i+1; j < samples.length; j++) {\n const sections = samples[j].sections as JsonLdObj[];\n if (sections.find(s => s['@id'] === blockId)) {\n samples[i].deleteMe = true;\n deleted++;\n }\n }\n }\n donor.samples = samples.filter(s => s.deleteMe !== true);\n }\n if (deleted > 0) {\n console.log(`âš  ${deleted} sections identified as blocks`);\n }\n}\n\nexport class HuBMAPTissueBlock {\n bad = false;\n donor: JsonLdObj;\n\n '@id': string;\n '@type' = 'Sample';\n label: string;\n description: string;\n link: string;\n\n sample_type = 'Tissue Block';\n section_count: number;\n section_size: number;\n section_units: string;\n\n rui_location: JsonLdObj;\n sections: JsonLdObj[];\n datasets: JsonLdObj[];\n\n constructor(public data: JsonDict, assetsApi = '', portalUrl = '', serviceToken?: string) {\n const entityType = this.data.entity_type;\n if (entityType !== 'Sample') {\n this.bad = true;\n return;\n }\n const ancestors = (this.data.ancestors || []) as JsonDict[];\n const descendants = (this.data.descendants || []) as JsonDict[];\n\n const donor = ancestors.find(e => e.entity_type === 'Donor') as JsonDict;\n this.donor = this.getDonor(donor, portalUrl);\n const ruiLocation = this.getRuiLocation(data, this.donor);\n if (!ruiLocation) {\n this.bad = true;\n } else {\n this.rui_location = ruiLocation;\n }\n\n if (!GROUP_UUID_MAPPING[data.group_uuid as string]) {\n GROUP_UUID_MAPPING[data.group_uuid as string] = data.group_name as string;\n }\n\n const dateEntered = new Date(data.last_modified_timestamp as number).toLocaleDateString();\n const groupName = GROUP_UUID_MAPPING[data.group_uuid as string] || data.group_name as string;\n const creator = data.created_by_user_displayname;\n\n this['@id'] = HBM_PREFIX + data.uuid;\n this.label = `Registered ${dateEntered}, ${creator}, ${groupName}`;\n this.link = `${portalUrl}browse/sample/${data.uuid}`;\n\n const sectionLookup: Record = {};\n const sections: JsonLdObj[] = [];\n this.sections = sections;\n const datasets: JsonLdObj[] = [];\n this.datasets = datasets;\n\n for (const descendant of descendants.filter(d => d.entity_type === 'Sample')) {\n const section = this.getSection(descendant, data, portalUrl);\n\n const sectionId = descendant.submission_id as string;\n sectionLookup[sectionId] = section;\n sections.push(section);\n section.section_number = section.section_number ?? sections.length;\n }\n for (const descendant of descendants) {\n if (descendant.entity_type === 'Dataset') {\n const dataset = this.getDataset(descendant, assetsApi, portalUrl, serviceToken);\n\n const sectionId = get(descendant, ['ingest_metadata', 'metadata', 'tissue_id']) as string;\n if (sectionLookup[sectionId]) {\n (sectionLookup[sectionId].datasets as JsonLd[])?.push(dataset);\n } else {\n datasets.push(dataset);\n }\n }\n }\n\n const loc: JsonDict = ruiLocation ?? {};\n const dims = `${loc.x_dimension} x ${loc.y_dimension} x ${loc.z_dimension} ${loc.dimension_units}`;\n this.section_count = loc.slice_count as number || sections.length;\n const sSize = parseFloat(\n (loc.slice_thickness as number ||\n ((loc.z_dimension as number || 0) / Math.max(this.section_count, 1)))\n .toFixed(1)\n );\n this.section_size = sSize;\n const sUnits = loc.dimension_units as string || 'millimeter';\n this.section_units = sUnits;\n\n this.description = `${dims}, ${sSize} ${sUnits}, ${data.specimen_type}, ${this.section_count} Sections`;\n\n sections.forEach((section, index) => {\n section.description = `${loc.x_dimension} x ${loc.y_dimension} x ${sSize} ${sUnits}, ${sSize} ${sUnits}, ${section.description}`;\n section.section_number = index + 1;\n });\n }\n\n getSection(section: JsonDict, data: JsonDict, portalUrl: string): JsonLdObj {\n const dateEntered = new Date(section.last_modified_timestamp as number).toLocaleDateString();\n const groupName = GROUP_UUID_MAPPING[section.group_uuid as string] || section.group_name as string;\n const creator = section.created_by_user_displayname;\n\n return {\n '@id': HBM_PREFIX + section.uuid,\n '@type': 'Sample',\n label: `Registered ${dateEntered}, ${creator}, ${groupName}`,\n description: `${data.specimen_type}`,\n link: `${portalUrl}browse/sample/${section.uuid}`,\n\n sample_type: 'Tissue Section',\n section_number: 1,\n\n samples: [],\n datasets: []\n };\n }\n\n getDataset(dataset: JsonDict, assetsApi = '', portalUrl = '', serviceToken?: string): JsonLdObj {\n const dateEntered = new Date(dataset.last_modified_timestamp as number).toLocaleDateString();\n const groupName = GROUP_UUID_MAPPING[dataset.group_uuid as string] || dataset.group_name as string;\n const creator = dataset.created_by_user_displayname;\n\n const types = [\n ...dataset.data_types as string[],\n get(dataset, ['ingest_metadata', 'metadata', 'assay_type'], '')\n ];\n const typesSearch = types.join('|').toLowerCase();\n\n let technology: string;\n let thumbnail = 'assets/icons/ico-unknown.svg';\n if (typesSearch.indexOf('10x') !== -1) {\n technology = '10x';\n thumbnail = 'assets/icons/ico-bulk-10x.svg';\n } else if (typesSearch.indexOf('af') !== -1) {\n technology = 'AF';\n thumbnail = 'assets/icons/ico-spatial-af.svg';\n } else if (typesSearch.indexOf('codex') !== -1) {\n technology = 'CODEX';\n thumbnail = 'assets/icons/ico-spatial-codex.svg';\n } else if (typesSearch.indexOf('imc') !== -1) {\n technology = 'IMC';\n thumbnail = 'assets/icons/ico-spatial-imc.svg';\n } else if ((typesSearch.indexOf('lc') !== -1) && (typesSearch.indexOf('af') === -1)) {\n technology = 'LC';\n thumbnail = 'assets/icons/ico-bulk-lc.svg';\n } else if (typesSearch.indexOf('maldi') !== -1) {\n technology = 'MALDI';\n } else if (typesSearch.indexOf('pas') !== -1) {\n technology = 'PAS';\n } else {\n technology = 'OTHER';\n }\n thumbnail = this.getDatasetThumbnail(dataset, assetsApi, serviceToken) ?? thumbnail;\n\n return {\n '@id': HBM_PREFIX + dataset.uuid,\n '@type': 'Dataset',\n label: `Registered ${dateEntered}, ${creator}, ${groupName}`,\n description: `Data/Assay Types: ${types.join(', ')}`,\n link: `${portalUrl}browse/dataset/${dataset.uuid}`,\n technology,\n thumbnail\n };\n }\n\n getDatasetThumbnail(dataset: JsonDict, assetsApi: string, serviceToken?: string): string | undefined {\n if (dataset.thumbnail_file) {\n const thumbnailFile = dataset.thumbnail_file as JsonDict;\n return `${assetsApi}/${thumbnailFile.file_uuid}/${thumbnailFile.filename}` + (serviceToken ? `?token=${serviceToken}` : '');\n } else if (dataset.group_uuid === '73bb26e4-ed43-11e8-8f19-0a7c1eab007a') { // TMC-Vanderbilt\n const tiffs = (get(dataset, 'metadata.files', []) as { rel_path: string }[])\n .filter(f => /\\.(ome\\.tif|ome\\.tiff)$/.test(f.rel_path))\n .filter(f => !/(multilayer\\.ome\\.tif|_ac\\.ome\\.tif)/.test(f.rel_path))\n .filter(f => DR1_VU_THUMBS.has(\n f.rel_path.split('/').slice(-1)[0].split('?')[0].replace('.ome.tif', '_thumbnail.jpg')\n ))\n .map(f => `${assetsApi}/${dataset.uuid}/${f.rel_path}` + (serviceToken ? `?token=${serviceToken}` : ''));\n\n if (tiffs.length > 0) {\n const thumb = tiffs[0].split('/').slice(-1)[0].split('?')[0].replace('.ome.tif', '_thumbnail.jpg');\n if (DR1_VU_THUMBS.has(thumb)) {\n return `assets/thumbnails/TMC-Vanderbilt/DR1/${thumb}`;\n }\n }\n } else if (dataset.group_uuid === '07a29e4c-ed43-11e8-b56a-0e8017bdda58') { // TMC-Florida\n const thumb = UFL_THUMBS[dataset.hubmap_id as string];\n if (thumb) {\n return `assets/thumbnails/TMC-Florida/${thumb}`;\n }\n }\n return undefined;\n }\n\n getDonor(donor: JsonDict, portalUrl: string): JsonLdObj {\n const donorDescription = (donor.description as string || '').toLowerCase();\n let sex: 'Male' | 'Female' | undefined;\n if (donorDescription.includes('female')) {\n sex = 'Female';\n } else if (donorDescription.includes('male')) {\n sex = 'Male';\n }\n const ageMatch = donorDescription.match(/age ([0-9]+)/);\n let age: number | undefined;\n if (ageMatch) {\n age = toNumber(ageMatch[1]);\n }\n let bmi: number | undefined;\n for (const md of get(donor, 'metadata.organ_donor_data', get(donor, 'metadata.living_donor_data', [])) as JsonDict[]) {\n if (md.preferred_term === 'Feminine gender' || md.preferred_term === 'Female') {\n sex = 'Female';\n } else if (md.preferred_term === 'Masculine gender' || md.preferred_term === 'Male') {\n sex = 'Male';\n } else if (md.preferred_term === 'Current chronological age' || md.preferred_term === 'Age') {\n age = toNumber(md.data_value);\n } else if (md.preferred_term === 'Body mass index') {\n bmi = toNumber(md.data_value);\n }\n }\n let label = '';\n if (sex && age) {\n label += `${sex}, Age ${age}`;\n if (bmi) {\n label += `, BMI ${bmi.toFixed(1)}`;\n }\n }\n\n const dateEntered = new Date(donor.last_modified_timestamp as number).toLocaleDateString();\n const groupName = GROUP_UUID_MAPPING[donor.group_uuid as string] || donor.group_name as string;\n const creator = donor.created_by_user_displayname;\n\n return {\n '@id': HBM_PREFIX + donor.uuid,\n '@type': 'Donor',\n label,\n description: `Entered ${dateEntered}, ${creator}, ${groupName}`,\n link: `${portalUrl}browse/donor/${donor.uuid}`,\n\n age,\n sex,\n bmi,\n\n consortium_name: 'HuBMAP',\n provider_name: groupName,\n provider_uuid: donor.group_uuid as string,\n\n samples: []\n };\n }\n\n getRuiLocation(data: JsonDict, donor: JsonLdObj): JsonLdObj | undefined {\n let spatialEntity: JsonLdObj | undefined;\n let ruiLocation = data.rui_location as JsonDict;\n if (ruiLocation) {\n // RUI Location may come in as an unparsed string\n if (typeof ruiLocation === 'string') {\n ruiLocation = JSON.parse(ruiLocation as string) as JsonDict;\n }\n if (ruiLocation.alignment_id) { // Detect RUI 0.5 generated JSON\n console.log('Detected a deprecated rui_location', data.uuid);\n } else if ((ruiLocation as unknown as { '@id': string })['@id']) { // Detect RUI 1.0+ generated JSON-LD\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n spatialEntity = ruiLocation as unknown as JsonLdObj;\n }\n }\n if (spatialEntity) {\n // Patch to fix RUI 0.5 Kidney and Spleen Placements\n const target: string = get(spatialEntity, ['placement', 'target']) ?? '';\n if (target.startsWith('http://purl.org/ccf/latest/ccf.owl#VHSpleenCC')) {\n if (donor.sex === 'Male') {\n set(spatialEntity, ['placement', 'target'], target.replace('#VHSpleenCC', '#VHMSpleenCC'));\n } else {\n set(spatialEntity, ['placement', 'target'], target.replace('#VHSpleenCC', '#VHFSpleenCC'));\n }\n } else if (target === 'http://purl.org/ccf/latest/ccf.owl#VHLeftKidney' || target === 'http://purl.org/ccf/latest/ccf.owl#VHRightKidney') {\n if (donor.sex === 'Male') {\n set(spatialEntity, ['placement', 'target'], target.replace('#VH', '#VHM') + '_Patch');\n } else {\n set(spatialEntity, ['placement', 'target'], target.replace('#VH', '#VHF') + '_Patch');\n }\n }\n }\n return spatialEntity;\n }\n\n getTissueBlock(): JsonLdObj {\n return omit({ ...this }, ['data', 'bad', 'donor']) as unknown as JsonLdObj;\n }\n\n toJsonLd(): JsonLdObj {\n return { ...this.donor, samples: [this.getTissueBlock()] };\n }\n}\n","/* eslint-disable @typescript-eslint/naming-convention */\nimport { JsonLd } from 'jsonld/jsonld-spec';\nimport { addJsonLdToStore, Store } from 'triple-store-utils';\n\nimport { hubmapResponseAsJsonLd } from './hubmap-data';\n\n\ninterface SearchResultJson {\n hits: {\n hits: unknown[];\n total: {\n value: number;\n };\n };\n}\n\n\n// Reduce this value if including more data fields\nconst PER_API_SEARCH_REQUEST_COUNT = 250;\n\nconst INCLUDED_DATA_FIELDS = [\n 'uuid', 'entity_type',\n 'group_uuid', 'group_name',\n 'last_modified_timestamp', 'created_by_user_displayname',\n 'ancestors.entity_type',\n 'ancestors.description',\n 'ancestors.metadata.organ_donor_data.preferred_term',\n 'ancestors.metadata.organ_donor_data.data_value',\n 'ancestors.metadata.living_donor_data.preferred_term',\n 'ancestors.metadata.living_donor_data.data_value',\n 'ancestors.last_modified_timestamp',\n 'ancestors.group_uuid',\n 'ancestors.group_name',\n 'ancestors.created_by_user_displayname',\n 'ancestors.uuid',\n 'descendants.entity_type',\n 'descendants.ingest_metadata.metadata.tissue_id',\n 'descendants.last_modified_timestamp',\n 'descendants.group_uuid',\n 'descendants.group_name',\n 'descendants.created_by_user_displayname',\n 'descendants.uuid',\n 'descendants.data_types',\n 'descendants.ingest_metadata.metadata.assay_type',\n 'descendants.thumbnail_file',\n 'descendants.metadata.files.rel_path',\n 'rui_location', 'specimen_type'\n];\n\nconst DEFAULT_API_SEARCH_QUERY: unknown = {\n exists: {\n field: 'rui_location'\n }\n};\n\nfunction getApiSearchHeaders(token?: string): Headers {\n const headers = new Headers();\n\n headers.append('Content-type', 'application/json');\n if (token) {\n headers.append('Authorization', `Bearer ${token}`);\n }\n\n return headers;\n}\n\nfunction getApiSearchBody(from: number, size: number, query?: unknown): string {\n const bodyObj = {\n version: true,\n from,\n size,\n stored_fields: ['*'],\n script_fields: {},\n docvalue_fields: [],\n query: query ?? DEFAULT_API_SEARCH_QUERY,\n _source: {\n includes: INCLUDED_DATA_FIELDS\n }\n };\n\n return JSON.stringify(bodyObj);\n}\n\nasync function doSearchRequest(\n url: string, init?: RequestInit\n): Promise {\n try {\n const res = await fetch(url, init);\n return res.ok ? (await res.json()) : undefined;\n } catch (_error) {\n return undefined;\n }\n}\n\nasync function doApiSearch(\n url: string, token?: string, query?: unknown\n): Promise {\n const perReqCount = PER_API_SEARCH_REQUEST_COUNT;\n const headers = getApiSearchHeaders(token);\n const body = getApiSearchBody(0, perReqCount, query);\n const firstResult = await doSearchRequest(url, { method: 'POST', headers, body });\n if (!firstResult) {\n return undefined;\n }\n\n const totalCount = firstResult.hits.total.value;\n if (totalCount <= perReqCount) {\n return firstResult;\n }\n\n const requests: Promise[] = [];\n for (let from = perReqCount; from < totalCount; from += perReqCount) {\n requests.push(doSearchRequest(url, {\n method: 'POST',\n headers,\n body: getApiSearchBody(from, perReqCount, query)\n }));\n }\n\n const results = await Promise.all(requests);\n if (results.some(res => !res)) {\n return undefined;\n }\n\n const items = results.map(res => res!.hits.hits);\n return {\n ...firstResult,\n hits: {\n ...firstResult.hits,\n hits: firstResult.hits.hits.concat(...items),\n }\n };\n}\n\n/**\n * Search the HuBMAP Search API and return CCF-compatible JSON-LD data\n *\n * @param dataUrl the search API url\n * @param serviceType 'static' if a statically saved response or 'search-api' if querying the search-api live\n * @param query the elastic search query to use\n * @param serviceToken the api key to the search-api\n * @param assetsApi the assets api endpoint\n * @param portalUrl the portal url to point to\n * @returns CCF-compatible JSON-LD data or undefined on error\n */\nexport async function searchHubmap(\n dataUrl: string, serviceType: 'static' | 'search-api',\n query?: unknown, serviceToken?: string, assetsApi = '', portalUrl = ''\n): Promise {\n let hubmapData: SearchResultJson | undefined;\n if (serviceType === 'static') {\n hubmapData = await doSearchRequest(dataUrl);\n } else if (serviceType === 'search-api') {\n hubmapData = await doApiSearch(dataUrl, serviceToken, query);\n }\n\n if (hubmapData) {\n return hubmapResponseAsJsonLd(hubmapData, assetsApi, portalUrl, serviceToken);\n } else {\n console.warn(`Unable to load ${dataUrl} as HuBMAP Data`);\n return undefined;\n }\n}\n\n/**\n * Adds hubmap data from a url to the triple store.\n *\n * @param store The triple store.\n * @param dataUrl The data url.\n * @param serviceType The service type.\n */\nexport async function addHubmapDataToStore(\n store: Store, dataUrl: string, serviceType: 'static' | 'search-api', serviceToken?: string, assetsApi = '', portalUrl = ''\n): Promise {\n const hubmapData = await searchHubmap(dataUrl, serviceType, undefined, serviceToken, assetsApi, portalUrl);\n if (hubmapData) {\n await addJsonLdToStore(hubmapData, store);\n }\n}\n","/* eslint-disable @typescript-eslint/naming-convention */\nimport { readQuads, Store } from 'triple-store-utils';\n\nimport { AggregateResult } from '../interfaces';\nimport { entity } from '../util/prefixes';\n\n\nfunction getObjects(store: Store, ids: Set, predicate: string): Set {\n const objects = new Set();\n for (const id of ids) {\n for (const quad of readQuads(store, id, predicate, null, null)) {\n objects.add(quad.object.id);\n }\n }\n return objects;\n}\n\n/**\n * Computes aggregate results.\n *\n * @param ids Ids of objects to calculate aggregate over.\n * @param store The triple store.\n * @returns The list of aggregate results.\n */\nexport function getAggregateResults(ids: Set, store: Store): AggregateResult[] {\n const donors = getObjects(store, ids, entity.donor.id);\n const centers = getObjects(store, donors, entity.providerUUID.id);\n\n const tissueBlocks = new Set();\n for (const id of ids) {\n for (const quad of readQuads(store, id, entity.spatialEntity, null, null)) {\n tissueBlocks.add(quad.subject.id);\n }\n }\n\n const tissueSections = getObjects(store, tissueBlocks, entity.sections.id);\n const tissueDatasets = new Set([\n ...getObjects(store, tissueBlocks, entity.datasets.id),\n ...getObjects(store, tissueSections, entity.datasets.id)\n ]);\n\n const results: { [key: string]: number } = {\n 'Tissue Data Providers': centers.size,\n Donors: donors.size,\n 'Tissue Blocks': tissueBlocks.size,\n 'Tissue Sections': tissueSections.size,\n 'Tissue Datasets': tissueDatasets.size\n };\n\n return Object.entries(results).map(([label, count]) => ({ label, count }));\n}\n\n/**\n * Get a list of technology names used by datasets\n *\n * @param store The triple store.\n * @returns list of unique technology names in the data\n */\nexport function getDatasetTechnologyNames(store: Store): string[] {\n const names = new Set();\n for (const quad of readQuads(store, null, entity.technology, null, null)) {\n names.add(quad.object.value);\n }\n return Array.from(names).sort();\n}\n\n/**\n * Get a list of provider names from the database\n *\n * @param store The triple store.\n * @returns list of unique provider names in the data\n */\nexport function getProviderNames(store: Store): string[] {\n const names = new Set();\n for (const quad of readQuads(store, null, entity.providerName, null, null)) {\n names.add(quad.object.value);\n }\n return Array.from(names).sort();\n}\n","import { Euler } from '@math.gl/core';\nimport { OrientedBoundingBox } from '@math.gl/culling';\nimport { Store } from 'triple-store-utils';\n\nimport { CCFSpatialGraph } from '../ccf-spatial-graph';\nimport { SpatialSearch } from '../interfaces';\nimport { getMappedResult } from '../util/n3-functions';\nimport { ccf } from '../util/prefixes';\n\n\nconst spatialEntityDimensions = {\n [ccf.spatialEntity.x_dimension.id]: 'x',\n [ccf.spatialEntity.y_dimension.id]: 'y',\n [ccf.spatialEntity.z_dimension.id]: 'z'\n};\n\nfunction getSpatialEntityDimensions(store: Store, iri: string): [number, number, number] {\n const dims = getMappedResult<{ x: number; y: number; z: number }>(store, iri, 'Dimensions', spatialEntityDimensions);\n return [ dims.x, dims.y, dims.z ];\n}\n\nexport function getOrientedBoundingBox(store: Store, graph: CCFSpatialGraph, sourceIri: string, targetIri: string): OrientedBoundingBox | undefined {\n const matrix = graph.getTransformationMatrix(sourceIri, targetIri);\n let result: OrientedBoundingBox | undefined = undefined;\n if (matrix) {\n const center = matrix.getTranslation();\n const halfSize = getSpatialEntityDimensions(store, sourceIri).map(n => n / 1000 / 2);\n const quaternion = new Euler().fromRotationMatrix(matrix, Euler.XYZ).toQuaternion().normalize().calculateW();\n result = new OrientedBoundingBox().fromCenterHalfSizeQuaternion(center, halfSize, quaternion);\n }\n return result;\n}\n\nexport function filterByProbingSphere(store: Store, graph: CCFSpatialGraph, seen: Set, search: SpatialSearch): Set {\n const { x, y, z, radius, target } = search;\n const newSeen = new Set();\n const radiusSquared = (radius / 1000) * (radius / 1000);\n for (const sourceIri of seen) {\n const boundingBox = getOrientedBoundingBox(store, graph, sourceIri, target);\n if (boundingBox) {\n const distanceSquared = boundingBox.distanceSquaredTo([x, y, z].map(n => n / 1000));\n if (distanceSquared <= radiusSquared) {\n newSeen.add(sourceIri);\n }\n }\n }\n return newSeen;\n}\n","import { isFinite } from 'lodash';\nimport { fromRdf } from 'rdf-literal';\nimport { DataFactory, Literal, readQuads, Store, Term } from 'triple-store-utils';\n\nimport { CCFSpatialGraph } from '../ccf-spatial-graph';\nimport { Filter, SpatialSearch } from '../interfaces';\nimport { ccf, entity, rui } from '../util/prefixes';\nimport { filterByProbingSphere } from './spatial-search-n3';\n\n\nfunction filterWithDonor(store: Store, seen: Set, callback: (donorsSeen: Set) => Set): Set {\n const donor2entity = new Map();\n const donors = new Set();\n for (const subject of seen) {\n for (const quad of readQuads(store, subject, entity.donor, null, null)) {\n donors.add(quad.object.id);\n if (!donor2entity.has(quad.object.id)) {\n donor2entity.set(quad.object.id, [subject]);\n } else {\n donor2entity.get(quad.object.id)?.push(subject);\n }\n }\n }\n\n const newDonors = callback(donors);\n const newSeen = new Set();\n for (const d of newDonors) {\n for (const s of donor2entity.get(d) ?? []) {\n newSeen.add(s);\n }\n }\n return newSeen;\n}\n\nfunction filterWithSpatialEntity(store: Store, seen: Set, callback: (entitiesSeen: Set) => Set): Set {\n const spatial2entity = new Map();\n const entities = new Set();\n for (const subject of seen) {\n for (const quad of readQuads(store, subject, entity.spatialEntity, null, null)) {\n entities.add(quad.object.id);\n if (!spatial2entity.has(quad.object.id)) {\n spatial2entity.set(quad.object.id, [subject]);\n } else {\n spatial2entity.get(quad.object.id)?.push(subject);\n }\n }\n }\n\n const newSpatialEntities = callback(entities);\n const newSeen = new Set();\n for (const e of newSpatialEntities) {\n for (const s of spatial2entity.get(e) ?? []) {\n newSeen.add(s);\n }\n }\n return newSeen;\n}\n\nfunction filterWithDataset(store: Store, seen: Set, callback: (datasetsSeen: Set) => Set): Set {\n const dataset2entity = new Map();\n const datasets = new Set();\n\n const sectionAndBlockSeen = new Set(seen);\n for (const subject of seen) {\n for (const quad of readQuads(store, subject, entity.sections, null, null)) {\n sectionAndBlockSeen.add(quad.object.id);\n }\n }\n\n for (const subject of sectionAndBlockSeen) {\n for (const quad of readQuads(store, subject, entity.datasets, null, null)) {\n datasets.add(quad.object.id);\n if (!dataset2entity.has(quad.object.id)) {\n dataset2entity.set(quad.object.id, [subject]);\n } else {\n dataset2entity.get(quad.object.id)?.push(subject);\n }\n }\n }\n\n const newDatasets = callback(datasets);\n const newSeen = new Set();\n for (const e of newDatasets) {\n for (const s of dataset2entity.get(e) ?? []) {\n newSeen.add(s);\n }\n }\n return newSeen;\n}\n\n/**\n * Finds all ids of object matching a filter.\n *\n * @param store The triple store.\n * @param filter The filter to limit objects.\n * @returns A set of all ids matching the filter.\n */\nexport function findIds(store: Store, graph: CCFSpatialGraph, filter: Filter): Set {\n let seen = getAllEntities(store);\n if (seen.size > 0) {\n seen = filterByHasSpatialEntity(store, seen);\n }\n if (seen.size > 0 && (filter.sex === 'Male' || filter.sex === 'Female')) {\n const sex = filter.sex;\n seen = filterWithDonor(store, seen, (donors) =>\n filterBySex(store, donors, sex)\n );\n }\n if (seen.size > 0 && filter.tmc?.length > 0) {\n seen = filterWithDonor(store, seen, (donors) =>\n filterByGroupName(store, donors, filter.tmc)\n );\n }\n if (seen.size > 0 && filter.technologies?.length > 0) {\n seen = filterWithDataset(store, seen, (datasets) =>\n filterByTechnology(store, datasets, filter.technologies)\n );\n }\n if (seen.size > 0 && filter.spatialSearches?.length > 0) {\n seen = filterWithSpatialEntity(store, seen, (entities) =>\n filterBySpatialSearches(store, graph, entities, filter.spatialSearches)\n );\n }\n if (seen.size > 0 && filter.ontologyTerms?.length > 0) {\n const terms = filter.ontologyTerms;\n if (terms.indexOf(rui.body.id) === -1) {\n seen = filterWithSpatialEntity(store, seen, (entities) =>\n filterByOntologyTerms(store, entities, terms)\n );\n }\n }\n if (seen.size > 0 && filter.cellTypeTerms?.length > 0) {\n const terms = filter.cellTypeTerms;\n if (terms.indexOf(rui.cell.id) === -1) {\n seen = filterWithSpatialEntity(store, seen, (entities) =>\n filterByCellTypeTerms(store, entities, terms)\n );\n }\n }\n if (seen.size > 0 && filter.ageRange?.length === 2 &&\n isFinite(filter.ageRange[0]) && isFinite(filter.ageRange[1])) {\n const maxAge = Math.max(...filter.ageRange);\n const minAge = Math.min(...filter.ageRange);\n\n // Age filter given by their default range will be ignored\n if (!(minAge === 1 && maxAge === 110)) {\n seen = filterWithDonor(store, seen, (donors) =>\n filterByAge(store, donors, minAge, maxAge)\n );\n }\n }\n if (seen.size > 0 && filter.bmiRange?.length === 2 &&\n isFinite(filter.bmiRange[0]) && isFinite(filter.bmiRange[1])) {\n const maxBMI = Math.max(...filter.bmiRange);\n const minBMI = Math.min(...filter.bmiRange);\n\n // BMI filter given by their default range will be ignored\n if (!(minBMI === 13 && maxBMI === 83)) {\n seen = filterWithDonor(store, seen, (donors) =>\n filterByBMI(store, donors, minBMI, maxBMI)\n );\n }\n }\n return seen;\n}\n\n/**\n * Gets all object ids in a store.\n *\n * @param store The triple store.\n * @returns A set of all ids.\n */\nfunction getAllEntities(store: Store): Set {\n const seen = new Set();\n store.forSubjects((s) => seen.add(s.id), entity.spatialEntity, null, null);\n return seen;\n}\n\n/**\n * Creates a callback function that adds ids to a second set iff it exists in the first set.\n *\n * @param seen The first set of ids.\n * @param newSeen The second set to add ids to.\n * @returns The callback function.\n */\nfunction differenceCallback(seen: Set, newSeen: Set): (term: Term) => void {\n return function (term: Term) {\n if (seen.has(term.id)) {\n newSeen.add(term.id);\n }\n };\n}\n\n/**\n * Filters ids by sex.\n *\n * @param store The triple store.\n * @param seen All ids to choose from.\n * @param sex Sex to filter on.\n * @returns The subset of ids with the specified sex.\n */\nfunction filterBySex(store: Store, seen: Set, sex: 'Male' | 'Female'): Set {\n const newSeen = new Set();\n store.forSubjects(differenceCallback(seen, newSeen), entity.sex, entity[sex], null);\n return newSeen;\n}\n\n/**\n * Filters ids by group names.\n *\n * @param store The triple store.\n * @param seen All ids to choose from.\n * @param groupNames Group names to filter on.\n * @returns The subset of ids with the specified group names.\n */\nfunction filterByGroupName(store: Store, seen: Set, groupNames: string[]): Set {\n const newSeen = new Set();\n for (const groupName of groupNames) {\n const literal = DataFactory.literal(groupName);\n store.forSubjects(differenceCallback(seen, newSeen), entity.providerName, literal, null);\n }\n return newSeen;\n}\n\n/**\n * Filters ids by technology names.\n *\n * @param store The triple store.\n * @param seen All ids to choose from.\n * @param technologies Technology names to filter on.\n * @returns The subset of ids with the specified technology names.\n */\nfunction filterByTechnology(store: Store, seen: Set, technologies: string[]): Set {\n const newSeen = new Set();\n for (const technology of technologies) {\n const literal = DataFactory.literal(technology);\n store.forSubjects(differenceCallback(seen, newSeen), entity.technology, literal, null);\n }\n return newSeen;\n}\n\n/**\n * Filters ids by ontology terms.\n *\n * @param store The triple store.\n * @param seen All ids to choose from.\n * @param terms Ontology terms to filter on.\n * @returns The subset of ids with the specified ontology terms.\n */\nfunction filterByOntologyTerms(store: Store, seen: Set, terms: string[]): Set {\n const newSeen = new Set();\n for (const term of terms) {\n const namedNode = DataFactory.namedNode(term);\n store.forSubjects(differenceCallback(seen, newSeen), ccf.spatialEntity.ccf_annotations, namedNode, null);\n }\n return newSeen;\n}\n\n/**\n * Filters ids by cell type terms.\n *\n * @param store The triple store.\n * @param seen All ids to choose from.\n * @param terms Cell type terms to filter on.\n * @returns The subset of ids with the specified cell type terms.\n */\nfunction filterByCellTypeTerms(store: Store, seen: Set, terms: string[]): Set {\n const asTerms = new Set();\n for (const term of terms) {\n store.forObjects((asTerm) => {\n asTerms.add(asTerm.id);\n }, term, ccf.asctb.located_in, null);\n if (term === rui.cell.id) {\n asTerms.add(rui.body.id);\n }\n }\n return filterByOntologyTerms(store, seen, [...asTerms]);\n}\n\n/**\n * Filters ids by age.\n *\n * @param store The triple store.\n * @param seen All ids to choose from.\n * @param minAge Minimum age.\n * @param maxAge Maximum age.\n * @returns The subset of ids with the specified age.\n */\nfunction filterByAge(store: Store, seen: Set, minAge: number, maxAge: number): Set {\n const newSeen = new Set();\n for (const subject of seen) {\n for (const quad of readQuads(store, subject, entity.age, null, null)) {\n const value = fromRdf(quad.object as Literal) as number;\n if (value >= minAge && value <= maxAge) {\n newSeen.add(subject);\n }\n }\n }\n return newSeen;\n}\n\n/**\n * Filters ids by BMI.\n *\n * @param store The triple store.\n * @param seen All ids to choose from.\n * @param minBMI Minimum BMI.\n * @param maxBMI Maximum BMI.\n * @returns The subset of ids with the specified BMI.\n */\nfunction filterByBMI(store: Store, seen: Set, minBMI: number, maxBMI: number): Set {\n const newSeen = new Set();\n for (const subject of seen) {\n for (const quad of readQuads(store, subject, entity.bmi, null, null)) {\n const value = fromRdf(quad.object as Literal) as number;\n if (value >= minBMI && value <= maxBMI) {\n newSeen.add(subject);\n }\n }\n }\n return newSeen;\n}\n\n/**\n * Filters ids by spatial entities.\n *\n * @param store The triple store.\n * @param seen All ids to choose from.\n * @param hasSpatialEntity Whether the filtered objects should have a spatial entity.\n * @returns The subset of ids with/without spatial entities.\n */\nfunction filterByHasSpatialEntity(store: Store, seen: Set, hasSpatialEntity = true): Set {\n const newSeen = new Set();\n store.forSubjects(differenceCallback(seen, newSeen), entity.spatialEntity, null, null);\n if (!hasSpatialEntity) {\n const notNewSeen = new Set();\n seen.forEach((s) => !newSeen.has(s) ? notNewSeen.add(s) : undefined);\n return notNewSeen;\n }\n return newSeen;\n}\n\nfunction filterBySpatialSearches(store: Store, graph: CCFSpatialGraph, seen: Set, spatialSearches: SpatialSearch[]): Set {\n const newSeen = new Set();\n for (const search of spatialSearches) {\n const thisSeen = filterByProbingSphere(store, graph, seen, search);\n thisSeen.forEach((s) => newSeen.add(s));\n }\n return newSeen;\n}\n","import { Store, readQuads } from 'triple-store-utils';\n\nimport { ccf, entity, rui } from '../util/prefixes';\n\n\nfunction getSpatialEntityMapping(subjects: Set, store: Store): Map> {\n const spatial2entity = new Map>();\n\n for (const subject of subjects) {\n for (const quad of readQuads(store, subject, entity.spatialEntity, null, null)) {\n if (!spatial2entity.has(quad.object.id)) {\n spatial2entity.set(quad.object.id, new Set([subject]));\n } else {\n spatial2entity.get(quad.object.id)!.add(subject);\n }\n }\n }\n return spatial2entity;\n}\n\nfunction getAnatomicalStructureMapping(ids: Set, store: Store): Map> {\n const spatial2entity = getSpatialEntityMapping(ids, store);\n const term2entity = new Map>();\n\n for (const subject of spatial2entity.keys()) {\n const entities = spatial2entity.get(subject)!;\n for (const quad of readQuads(store, subject, ccf.spatialEntity.ccf_annotations, null, null)) {\n if (!term2entity.has(quad.object.id)) {\n term2entity.set(quad.object.id, new Set(entities));\n } else {\n const termEntities = term2entity.get(quad.object.id)!;\n entities.forEach((value) => termEntities.add(value));\n }\n }\n }\n return term2entity;\n}\n\n/**\n * Get number of occurrences of ontology terms for a set of ids.\n *\n * @param ids Ids of objects to calculate aggregate over.\n * @param store The triple store.\n * @returns Ontology term counts.\n */\nexport function getOntologyTermOccurences(ids: Set, store: Store): Record {\n const counts: Record = {};\n const term2entities = getAnatomicalStructureMapping(ids, store);\n\n term2entities.forEach((value, key) => {\n counts[key] = value.size;\n });\n\n return counts;\n}\n\n/**\n * Get number of occurrences of cell type terms for a set of ids.\n *\n * @param ids Ids of objects to calculate aggregate over.\n * @param store The triple store.\n * @returns Ontology term counts.\n */\nexport function getCellTypeTermOccurences(ids: Set, store: Store): Record {\n const asTerm2entities = getAnatomicalStructureMapping(ids, store);\n const ctTerm2entities = new Map>();\n\n for (const asTerm of asTerm2entities.keys()) {\n const entities = asTerm2entities.get(asTerm)!;\n for (const quad of readQuads(store, null, ccf.asctb.located_in, asTerm, null)) {\n const cellType = quad.subject.id;\n if (!ctTerm2entities.has(cellType)) {\n ctTerm2entities.set(cellType, new Set(entities));\n } else {\n const termEntities = ctTerm2entities.get(cellType)!;\n entities.forEach((value) => termEntities.add(value));\n }\n }\n }\n\n const counts: Record = {};\n\n ctTerm2entities.forEach((value, key) => {\n counts[key] = value.size;\n });\n\n counts[rui.cell.id] = asTerm2entities.get(rui.body.id)?.size ?? 0;\n\n return counts;\n}\n","import { memoize } from 'lodash';\nimport { readQuads, Store } from 'triple-store-utils';\nimport { OntologyTreeModel, OntologyTreeNode } from '../interfaces';\nimport { getEntries } from '../util/n3-functions';\nimport { ccf, rui } from '../util/prefixes';\n\n\nexport function getOntologyTreeNode(store: Store, iri: string, relationshipIri: string): OntologyTreeNode {\n const result: OntologyTreeNode = {\n '@id': iri, '@type': 'OntologyTreeNode', id: iri, parent: '',\n children: [] as string[], synonymLabels: [] as string[], label: ''\n };\n\n const ontologyTreeNodeResult = {\n [ccf.ontologyNode.label.id]: 'label',\n [relationshipIri]: 'parent',\n [ccf.ontologyNode.synonymLabels.id]: 'synonymLabels',\n };\n\n for (const [key, value] of getEntries(store, iri, ontologyTreeNodeResult)) {\n if (key === 'synonymLabels') {\n result.synonymLabels.push(value as string);\n } else {\n result[key] = value;\n }\n }\n result.children = store.getSubjects(relationshipIri, iri, null).map(s => s.id);\n\n return result;\n}\n\nexport function getOntologyTreeModel(store: Store, rootIri: string, rootLabel: string, relationshipIri: string): OntologyTreeModel {\n const result: OntologyTreeModel = { root: rootIri, nodes: {} };\n const seen = new Set();\n for (const quad of readQuads(store, null, relationshipIri, null, null)) {\n seen.add(quad.subject.id);\n seen.add(quad.object.id);\n }\n\n for (const iri of seen) {\n result.nodes[iri] = getOntologyTreeNode(store, iri, relationshipIri);\n }\n\n if (!result.nodes[rootIri]) {\n result.nodes[rootIri] = {\n '@id': rootIri,\n '@type': 'OntologyTreeNode',\n id: rootIri,\n label: rootLabel,\n children: [],\n synonymLabels: []\n } as unknown as OntologyTreeNode;\n }\n\n const rootChildren = store\n .getSubjects(relationshipIri, rootIri, null).map(o => o.id)\n .sort((a, b) => result.nodes[a].label.localeCompare(result.nodes[b].label));\n result.nodes[rootIri].children = rootChildren;\n\n treeify(result);\n\n return result;\n}\n\n/**\n * Recursive function to ensure that the given ontology tree model is actually a tree by essentially using a BFS search.\n *\n * @param model the ontology tree model to mutate\n * @param nodeIri the tree node iri to modify. Starts at root in the base case\n * @param seen a set of IRIs that have been 'seen' so far to remove loops in the graph\n */\nfunction treeify(model: OntologyTreeModel, nodeIri: string | undefined = undefined, seen: Set = new Set()) {\n const node = model.nodes[nodeIri ?? model.root];\n if (node) {\n node.children = node.children.filter(n => !seen.has(n));\n node.children.forEach(n => seen.add(n));\n for (const childId of node.children) {\n treeify(model, childId, seen);\n if (model.nodes[childId]) {\n model.nodes[childId].parent = node['@id'];\n }\n }\n }\n}\n\nexport function getAnatomicalStructureTreeModelSlowly(store: Store): OntologyTreeModel {\n const model = getOntologyTreeModel(store, rui.body.id, 'body', ccf.asctb.part_of.id);\n model.nodes[rui.body.id].children = [\n 'http://purl.obolibrary.org/obo/UBERON_0000955', // Brain\n 'http://purl.obolibrary.org/obo/UBERON_0000029', // Lymph Node\n // 'http://purl.obolibrary.org/obo/UBERON_0002509', // Mesenteric Lymph Node\n 'http://purl.obolibrary.org/obo/UBERON_0000970', // Eye\n // 'http://purl.obolibrary.org/obo/UBERON_0004548', // Eye, L\n // 'http://purl.org/sig/ont/fma/fma54449', // Eye, R\n 'http://purl.obolibrary.org/obo/UBERON_0003889', // Fallopian Tube\n // 'http://purl.obolibrary.org/obo/UBERON_0001303', // Fallopian Tube, L\n // 'http://purl.obolibrary.org/obo/UBERON_0001302', // Fallopian Tube, R\n 'http://purl.obolibrary.org/obo/UBERON_0000948', // Heart\n 'http://purl.obolibrary.org/obo/UBERON_0002113', // Kidney\n // 'http://purl.obolibrary.org/obo/UBERON_0004538', // Kidney, L\n // 'http://purl.obolibrary.org/obo/UBERON_0004539', // Kidney, R\n 'http://purl.obolibrary.org/obo/UBERON_0001465', // Knee\n // 'http://purl.org/sig/ont/fma/fma24978', // Knee, L\n // 'http://purl.org/sig/ont/fma/fma24977', // Knee, R\n 'http://purl.obolibrary.org/obo/UBERON_0002107', // Liver\n 'http://purl.obolibrary.org/obo/UBERON_0002048', // Lungs\n 'http://purl.obolibrary.org/obo/UBERON_0001911', // Mammary Gland\n // 'http://purl.org/sig/ont/fma/fma57991', // Mammary Gland, L\n // 'http://purl.org/sig/ont/fma/fma57987', // Mammary Gland, R\n 'http://purl.obolibrary.org/obo/UBERON_0000992', // Ovary\n // 'http://purl.org/sig/ont/fma/fma7214', // Ovary, L\n // 'http://purl.org/sig/ont/fma/fma7213', // Ovary, R\n 'http://purl.obolibrary.org/obo/UBERON_0001264', // Pancreas\n 'http://purl.obolibrary.org/obo/UBERON_0001270', // Pelvis\n 'http://purl.obolibrary.org/obo/UBERON_0001987', // Placenta\n 'http://purl.obolibrary.org/obo/UBERON_0002367', // Prostate\n 'http://purl.obolibrary.org/obo/UBERON_0002097', // Skin\n 'http://purl.obolibrary.org/obo/UBERON_0002108', // Small Intestine\n 'http://purl.obolibrary.org/obo/UBERON_0002240', // Spinal Cord\n 'http://purl.obolibrary.org/obo/UBERON_0000059', // Large Intestine\n 'http://purl.obolibrary.org/obo/UBERON_0002106', // Spleen\n 'http://purl.obolibrary.org/obo/UBERON_0002370', // Thymus\n 'http://purl.obolibrary.org/obo/UBERON_0000056', // Ureter\n // 'http://purl.obolibrary.org/obo/UBERON_0001223', // Ureter, L\n // 'http://purl.obolibrary.org/obo/UBERON_0001222', // Ureter, R\n 'http://purl.obolibrary.org/obo/UBERON_0001255', // Urinary Bladder\n 'http://purl.obolibrary.org/obo/UBERON_0000995', // Uterus\n 'http://purl.obolibrary.org/obo/UBERON_0004537' // Blood Vasculature\n ].filter(iri => iri in model.nodes);\n return model;\n}\n\nexport const getAnatomicalStructureTreeModel = memoize(getAnatomicalStructureTreeModelSlowly, () => '');\n\nexport function getCellTypeTreeModel(store: Store): OntologyTreeModel {\n return getOntologyTreeModel(store, rui.cell.id, 'cell', ccf.asctb.ct_is_a.id);\n}\n","import { Store } from 'triple-store-utils';\nimport { DatasetResult, DonorResult, TissueBlockResult, TissueSectionResult } from '../interfaces';\nimport { getEntries, getMappedResult } from '../util/n3-functions';\nimport { entity } from '../util/prefixes';\n\n\n/** Entity iri to property path. */\nconst listResultSet: { [iri: string]: string } = {\n [entity.label.id]: 'label',\n [entity.description.id]: 'description',\n [entity.link.id]: 'link'\n};\n\nconst donorResultSet: { [iri: string]: string } = {\n ...listResultSet,\n [entity.providerName.id]: 'providerName'\n};\n\nconst datasetResultSet: { [iri: string]: string } = {\n ...listResultSet,\n [entity.technology.id]: 'technology',\n [entity.thumbnail.id]: 'thumbnail',\n};\n\nconst tissueSectionResultSet: { [iri: string]: string } = {\n ...listResultSet,\n [entity.sampleType.id]: 'sampleType',\n [entity.sectionNumber.id]: 'sectionNumber',\n [entity.datasets.id]: 'datasets',\n};\n\nconst tissueBlockResultSet: { [iri: string]: string } = {\n ...listResultSet,\n [entity.sampleType.id]: 'sampleType',\n [entity.sectionCount.id]: 'sectionCount',\n [entity.sectionSize.id]: 'sectionSize',\n [entity.sectionUnits.id]: 'sectionUnits',\n\n [entity.donor.id]: 'donor',\n [entity.spatialEntity.id]: 'spatialEntityId',\n [entity.sections.id]: 'sections',\n [entity.datasets.id]: 'datasets',\n};\n\n/**\n * Extracts a single donor result from the triple store.\n *\n * @param store The triple store.\n * @param iri The entity id.\n * @returns The list data.\n */\nexport function getDonorResult(store: Store, iri: string): DonorResult {\n return getMappedResult(store, iri, 'Donor', donorResultSet);\n}\n\n/**\n * Extracts a single dataset result from the triple store.\n *\n * @param store The triple store.\n * @param iri The entity id.\n * @returns The list data.\n */\nexport function getDatasetResult(store: Store, iri: string): DatasetResult {\n return getMappedResult(store, iri, 'Dataset', datasetResultSet);\n}\n\n/**\n * Extracts a single tissue section result from the triple store.\n *\n * @param store The triple store.\n * @param iri The entity id.\n * @returns The list data.\n */\nexport function getTissueSectionResult(store: Store, iri: string): TissueSectionResult {\n // eslint-disable-next-line @typescript-eslint/consistent-type-assertions\n const result = { '@id': iri, '@type': 'Sample', datasets: [] as DatasetResult[] } as TissueSectionResult;\n for (const [key, value] of getEntries(store, iri, tissueSectionResultSet)) {\n if (key === 'datasets') {\n const dataset = getDatasetResult(store, value as string);\n result[key].push(dataset);\n } else {\n result[key] = value;\n }\n }\n return result;\n}\n\n/**\n * Extracts a single tissue block result from the triple store.\n *\n * @param store The triple store.\n * @param iri The entity id.\n * @returns The list data.\n */\nexport function getTissueBlockResult(store: Store, iri: string): TissueBlockResult {\n // eslint-disable-next-line @typescript-eslint/consistent-type-assertions\n const result = { '@id': iri, '@type': 'Sample',\n sections: [] as TissueSectionResult[], datasets: [] as DatasetResult[]\n } as TissueBlockResult;\n for (const [key, value] of getEntries(store, iri, tissueBlockResultSet)) {\n if (key === 'sections') {\n const section = getTissueSectionResult(store, value as string);\n result[key].push(section);\n } else if (key === 'datasets') {\n const dataset = getDatasetResult(store, value as string);\n result[key].push(dataset);\n } else if (key === 'donor') {\n result[key] = getDonorResult(store, value as string);\n } else {\n result[key] = value;\n }\n }\n return result;\n}\n","import { DatabaseStatus } from '../interfaces';\nimport { CCFDatabase } from '../ccf-database';\n\n\nexport class CCFDatabaseStatusTracker {\n status: 'Ready' | 'Loading' | 'Error';\n message?: string;\n loadTime?: number;\n\n constructor(public database: CCFDatabase) {\n this.connect();\n }\n\n toJson(): DatabaseStatus {\n return {\n status: this.status,\n message: this.message,\n checkback: this.status === 'Ready' || this.status === 'Error' ? 60 * 60 * 1000 : 2000,\n loadTime: this.loadTime\n };\n }\n\n private connect(): Promise {\n this.status = 'Loading';\n this.message = 'Loading database';\n\n const startTime = Date.now();\n return this.database.connect()\n .then(async (loaded) => {\n if (loaded) {\n // Warm up the database\n this.message = 'Building scene';\n await this.database.getScene();\n this.message = 'Building tissue block results';\n await this.database.getTissueBlockResults();\n this.message = 'Aggregating results';\n await this.database.getAggregateResults();\n this.status = 'Ready';\n this.message = 'Database successfully loaded';\n } else {\n this.status = 'Error';\n this.message = 'Unknown error while loading database';\n }\n })\n .catch((error: { message?: string }) => {\n this.status = 'Error';\n this.message = error?.message ?? 'Unknown error while loading database';\n })\n .finally(() => {\n this.loadTime = Date.now() - startTime;\n });\n }\n}\n","\nimport { Context, JsonLd } from 'jsonld/jsonld-spec';\n\n/* eslint-disable @typescript-eslint/naming-convention */\n/** CCF v2.0 JSON-LD Context */\nconst CCF_CONTEXT = {\n '@context': {\n '@base': 'http://purl.org/ccf/',\n '@vocab': 'http://purl.org/ccf/',\n 'ccf': 'http://purl.org/ccf/',\n 'rdfs': 'http://www.w3.org/2000/01/rdf-schema#',\n 'dcterms': 'http://purl.org/dc/terms/',\n 'label': 'rdfs:label',\n 'description': 'rdfs:comment',\n 'link': 'ccf:url',\n 'sex': 'ccf:sex',\n 'age': 'ccf:age',\n 'bmi': 'ccf:bmi',\n 'consortium_name': 'ccf:consortium_name',\n 'provider_name': 'ccf:tissue_provider_name',\n 'provider_uuid': 'ccf:tissue_provider_uuid',\n 'donor': {\n '@id': 'ccf:comes_from',\n '@type': '@id'\n },\n 'samples': {\n '@reverse': 'donor'\n },\n 'sections': {\n '@id': 'ccf:subdivided_into_sections',\n '@type': '@id'\n },\n 'datasets': {\n '@id': 'ccf:generates_dataset',\n '@type': '@id'\n },\n 'sample_type': 'ccf:sample_type',\n 'section_count': 'ccf:section_count',\n 'section_size': 'ccf:section_size',\n 'section_units': 'ccf:section_size_unit',\n 'section_number': 'ccf:section_number',\n 'rui_location': {\n '@id': 'ccf:has_registration_location',\n '@type': '@id'\n },\n 'ccf_annotations': {\n '@id': 'ccf:collides_with',\n '@type': '@id',\n '@container': '@set'\n },\n 'representation_of': {\n '@id': 'ccf:representation_of',\n '@type': '@id'\n },\n 'reference_organ': {\n '@id': 'ccf:has_reference_organ',\n '@type': '@id'\n },\n 'extraction_set_for': {\n '@id': 'ccf:extraction_set_for',\n '@type': '@id'\n },\n 'extraction_set': {\n '@id': 'ccf:has_extraction_set',\n '@type': '@id'\n },\n 'organ_owner_sex': 'ccf:organ_owner_sex',\n 'side': 'ccf:organ_side',\n 'rui_rank': 'ccf:rui_rank',\n 'slice_thickness': 'ccf:slice_thickness',\n 'slice_count': 'ccf:slice_count',\n 'object': {\n '@id': 'ccf:has_object_reference',\n '@type': '@id'\n },\n 'creation_date': 'dcterms:created',\n 'updated_date': 'ccf:updated_date',\n 'creator': 'dcterms:creator',\n 'creator_first_name': 'ccf:creator_first_name',\n 'creator_last_name': 'ccf:creator_last_name',\n 'placement': {\n '@reverse': 'ccf:placement_for'\n },\n 'placement_date': 'dcterms:created',\n 'rotation_order': 'ccf:rotation_order',\n 'dimension_units': 'ccf:dimension_unit',\n 'rotation_units': 'ccf:rotation_unit',\n 'scaling_units': 'ccf:scaling_unit',\n 'translation_units': 'ccf:translation_unit',\n 'source': {\n '@id': 'ccf:placement_for',\n '@type': '@id'\n },\n 'target': {\n '@id': 'ccf:placement_relative_to',\n '@type': '@id'\n },\n 'x_rotation': 'ccf:x_rotation',\n 'y_rotation': 'ccf:y_rotation',\n 'z_rotation': 'ccf:z_rotation',\n 'x_scaling': 'ccf:x_scaling',\n 'y_scaling': 'ccf:y_scaling',\n 'z_scaling': 'ccf:z_scaling',\n 'x_translation': 'ccf:x_translation',\n 'y_translation': 'ccf:y_translation',\n 'z_translation': 'ccf:z_translation',\n 'x_dimension': 'ccf:x_dimension',\n 'y_dimension': 'ccf:y_dimension',\n 'z_dimension': 'ccf:z_dimension',\n 'ontology_terms': {\n '@id': 'ccf:has_ontology_term',\n '@type': '@id'\n },\n 'technology': 'ccf:technology',\n 'thumbnail': 'ccf:thumbnail',\n 'file': 'ccf:file_url',\n 'file_format': 'ccf:file_format',\n 'file_subpath': 'ccf:file_subpath'\n }\n};\n/* eslint-enable @typescript-eslint/naming-convention */\n\n/**\n * Function which takes JSON-LD data and makes patches to update from CCF v1.x to v2.0 automatically\n *\n * @param jsonLdString the input JSON-LD as a string\n * @returns A JSON-LD object derived from the given string with updated data to be compatible with CCF v2.0\n */\nexport function patchJsonLd(jsonLdString: string): JsonLd {\n return JSON.parse(jsonLdString, (key, value) => {\n if (key === 'ccf_annotations' && Array.isArray(value)) {\n return value.map((iri: string) => {\n if (iri?.startsWith('http://purl.obolibrary.org/obo/FMA_')) {\n return iri.replace(\n 'http://purl.obolibrary.org/obo/FMA_',\n 'http://purl.org/sig/ont/fma/fma'\n );\n } else {\n return iri;\n }\n });\n } else if (key === '@context' && value && (\n value === 'https://hubmapconsortium.github.io/hubmap-ontology/ccf-entity-context.jsonld'\n || value === 'https://hubmapconsortium.github.io/hubmap-ontology/ccf-context.jsonld'\n || value === 'https://hubmapconsortium.github.io/ccf-ontology/ccf-context.jsonld'\n || (value as Context)['@base'] === 'http://purl.org/ccf/latest/ccf-entity.owl#'\n )) {\n return CCF_CONTEXT;\n }\n return value;\n });\n}\n","import { Store, readQuads, DataFactory, NamedNode } from 'triple-store-utils';\nimport { getAnatomicalStructureTreeModel } from '../queries/ontology-tree-n3';\nimport { ccf, entity } from './prefixes';\n\n\n/**\n * Function to add additional ccf_annotations to rui locations based on the\n * reference organ it was placed relative to.\n *\n * @param store the triple store holding the CCF.OWL data\n */\nexport function enrichRuiLocations(store: Store): void {\n const tree = getAnatomicalStructureTreeModel(store);\n const refOrganMap: Map = new Map();\n\n // Build a map from reference organ to ccf annotations via representation_of and the AS partonomy\n for (const { subject: organ, object: term } of readQuads(store, null, ccf.spatialEntity.representation_of, null, null)) {\n const annotations = new Set([term.id]);\n let parent = tree.nodes[term.id]?.parent;\n while (parent) {\n if (annotations.has(parent)) {\n break;\n } else {\n annotations.add(parent);\n parent = tree.nodes[parent]?.parent;\n }\n }\n refOrganMap.set(organ.id, [ ...annotations].map(s => DataFactory.namedNode(s)));\n }\n\n // Add AS terms for rui locations based on the reference organs they are placed relative to\n for (const { object: ruiLocation } of readQuads(store, null, entity.spatialEntity, null, null)) {\n for (const { subject: placement } of readQuads(store, null, ccf.spatialPlacement.source, ruiLocation, null)) {\n for (const { object: organ } of readQuads(store, placement, ccf.spatialPlacement.target, null, null)) {\n for (const term of refOrganMap.get(organ.id) ?? []) {\n store.addQuad(DataFactory.namedNode(ruiLocation.id), ccf.spatialEntity.ccf_annotations, term);\n }\n }\n }\n }\n}\n","/* eslint-disable @typescript-eslint/member-ordering */\nimport { delMany, get, setMany } from 'idb-keyval';\nimport { JsonLd } from 'jsonld/jsonld-spec';\nimport {\n addJsonLdToStore, addN3ToStore, addRdfXmlToStore, DataFactory, deserializeN3Store, Quad, serializeN3Store, Store\n} from 'triple-store-utils';\n\nimport { CCFSpatialGraph } from './ccf-spatial-graph';\nimport { CCFSpatialScene, SpatialSceneNode } from './ccf-spatial-scene';\nimport { searchHubmap } from './hubmap/hubmap-data-import';\nimport { AggregateResult, DatabaseStatus, Filter, OntologyTreeModel, TissueBlockResult } from './interfaces';\nimport { getAggregateResults, getDatasetTechnologyNames, getProviderNames } from './queries/aggregate-results-n3';\nimport { findIds } from './queries/find-ids-n3';\nimport { getCellTypeTermOccurences, getOntologyTermOccurences } from './queries/ontology-term-occurences-n3';\nimport { getAnatomicalStructureTreeModel, getCellTypeTreeModel } from './queries/ontology-tree-n3';\nimport { getSpatialEntityForEntity } from './queries/spatial-result-n3';\nimport { getTissueBlockResult } from './queries/tissue-block-result-n3';\nimport { FlatSpatialPlacement, SpatialEntity } from './spatial-types';\nimport { CCFDatabaseStatusTracker } from './util/ccf-database-status-tracker';\nimport { patchJsonLd } from './util/patch-jsonld';\nimport { enrichRuiLocations } from './util/enrich-rui-locations';\n\n\n/** Database initialization options. */\nexport interface CCFDatabaseOptions {\n /** A url to load data from. */\n ccfOwlUrl: string;\n /** Context. */\n ccfContextUrl: string;\n /** A list of data sources (in n3, rdf, xml, owl, or jsonld format) */\n dataSources: (string|JsonLd)[];\n /** Data service type. */\n hubmapDataService: 'static' | 'search-api';\n /** HuBMAP Elastic Search Query */\n hubmapQuery?: unknown;\n /** Hubmap Portal url. */\n hubmapPortalUrl: string;\n /** Hubmap data url. */\n hubmapDataUrl: string;\n /** Hubmap assets api url. */\n hubmapAssetsUrl: string;\n /** HuBMAP Service Token. */\n hubmapToken?: string;\n}\n\n/** Default initialization options. */\nexport const DEFAULT_CCF_DB_OPTIONS: CCFDatabaseOptions = {\n ccfOwlUrl: 'https://purl.org/ccf/latest/ccf.owl',\n ccfContextUrl: 'https://purl.org/ccf/latest/ccf-context.jsonld',\n dataSources: [],\n hubmapDataService: 'static',\n hubmapPortalUrl: 'https://portal.hubmapconsortium.org/',\n hubmapDataUrl: '',\n hubmapAssetsUrl: 'https://assets.hubmapconsortium.org'\n};\n\n/** Database provider. */\nexport class CCFDatabase {\n /** The triple store. */\n store: Store;\n /** The spatial graph */\n graph: CCFSpatialGraph;\n /** Creates SpatialEntity Scenes */\n scene: CCFSpatialScene;\n /** If the database is initialized */\n private initializing?: Promise;\n\n private status: CCFDatabaseStatusTracker;\n\n /**\n * Creates an instance of ccfdatabase.\n *\n * @param [options] Initialization options.\n */\n constructor(public options: CCFDatabaseOptions = DEFAULT_CCF_DB_OPTIONS) {\n this.store = new Store(undefined, { factory: DataFactory });\n this.graph = new CCFSpatialGraph(this);\n this.scene = new CCFSpatialScene(this);\n }\n\n /**\n * Connects the database.\n *\n * @param [options] Options used to initialize.\n * @returns A promise resolving to true if data has been loaded into the database.\n */\n async connect(options?: CCFDatabaseOptions, cached = false): Promise {\n if (options) {\n this.options = options;\n }\n if (!this.initializing) {\n if (cached) {\n this.initializing = this.cachedConnect();\n } else {\n this.initializing = this.doConnect();\n }\n }\n await this.initializing;\n return this.store.size > 0;\n }\n\n private async cachedConnect(): Promise {\n const start = new Date().getTime();\n const lastModifiedKey = 'ccf-database.last_modified';\n const ccfDatabaseKey = 'ccf-database';\n\n const lastModified = await get(lastModifiedKey).catch(() => undefined);\n let serializedDb: string | undefined;\n\n if (lastModified && start - new Date(+lastModified).getTime() > 60*60*1000) {\n await delMany([ccfDatabaseKey, lastModifiedKey]).catch(() => undefined);\n } else {\n serializedDb = await get(ccfDatabaseKey).catch(() => undefined);\n }\n\n if (serializedDb) {\n await this.deserialize(serializedDb);\n } else {\n await this.doConnect();\n\n setMany([\n [ccfDatabaseKey, this.serialize()],\n [lastModifiedKey, '' + start]\n ]).catch(() => undefined);\n }\n }\n\n /**\n * Actually connects to the database.\n *\n * @returns A promise resolving to void when connected.\n */\n private async doConnect(): Promise {\n const ops: Promise[] = [];\n const sources: (string|JsonLd)[] = this.options.dataSources?.concat() ?? [];\n\n const ccfOwlUrl = this.options.ccfOwlUrl;\n if (ccfOwlUrl.startsWith('{')) {\n // serialized n3 store was provided as the ccfOwlUrl\n this.store = deserializeN3Store(ccfOwlUrl, DataFactory);\n } else if (ccfOwlUrl.endsWith('.n3store.json')) {\n const storeString = await fetch(ccfOwlUrl).then(r => r.text())\n .catch(() => console.log('Couldn\\'t locate serialized store.'));\n if (storeString) {\n this.store = deserializeN3Store(storeString, DataFactory);\n }\n } else if (ccfOwlUrl?.length > 0) {\n sources.push(ccfOwlUrl);\n }\n if (this.options.hubmapDataUrl) {\n if (this.options.hubmapDataUrl.endsWith('jsonld')) {\n sources.push(this.options.hubmapDataUrl);\n } else {\n ops.push(searchHubmap(\n this.options.hubmapDataUrl,\n this.options.hubmapDataService,\n this.options.hubmapQuery,\n this.options.hubmapToken,\n this.options.hubmapAssetsUrl,\n this.options.hubmapPortalUrl\n ).then((jsonld) => {\n if (jsonld) {\n return this.addDataSources([jsonld]);\n } else {\n return undefined;\n }\n }));\n }\n }\n ops.push(this.addDataSources(sources));\n await Promise.all(ops);\n await this.synchronize();\n }\n\n async addDataSources(sources: (string|JsonLd)[], inputStore?: Store): Promise {\n const store: Store = inputStore ?? this.store;\n await Promise.all(\n sources.map(async (source) => {\n if (typeof source === 'string') {\n if ((source.startsWith('http') || source.startsWith('assets/')) && source.includes('jsonld')) {\n source = await fetch(source).then(r => r.text());\n source = patchJsonLd(source as string);\n await addJsonLdToStore(source, store);\n } else if (source.endsWith('n3')) {\n await addN3ToStore(source, store);\n } else if (source.endsWith('rdf') || source.endsWith('owl') || source.endsWith('xml')) {\n await addRdfXmlToStore(source, store);\n } else {\n // Passthrough assumes a JSON-LD response\n source = patchJsonLd(source);\n await addJsonLdToStore(source, store);\n }\n } else {\n source = patchJsonLd(JSON.stringify(source));\n await addJsonLdToStore(source, store);\n }\n })\n );\n return this;\n }\n\n async synchronize(): Promise {\n // Add a small delay to allow the triple store to settle\n await new Promise(r => {\n setTimeout(r, 500);\n });\n this.graph.createGraph();\n enrichRuiLocations(this.store);\n return this;\n }\n\n serialize(): string {\n return serializeN3Store(this.store);\n }\n\n async deserialize(value: string): Promise {\n this.store = deserializeN3Store(value, DataFactory);\n this.graph = new CCFSpatialGraph(this);\n this.scene = new CCFSpatialScene(this);\n await new Promise(r => {\n setTimeout(r, 10);\n });\n }\n\n /**\n * Gets all ids matching the filter.\n *\n * @param [filter] The filter.\n * @returns A set of all matching ids.\n */\n getIds(filter: Filter = {} as Filter): Set {\n return findIds(this.store, this.graph, filter);\n }\n\n /**\n * Gets the data for an object.\n *\n * @param id The id of the requested object.\n * @returns The object data.\n */\n get(id: string): Quad[] {\n return this.store.getQuads(DataFactory.namedNode(id), null, null, null);\n }\n\n /**\n * Gets the data for objects matching a filter.\n *\n * @param [filter] The filter.\n * @returns An array of data.\n */\n search(filter: Filter = {} as Filter): Quad[][] {\n return [...this.getIds(filter)].map((s) => this.get(s));\n }\n\n /**\n * Gets all spatial entities for a filter.\n *\n * @param [filter] The filter.\n * @returns A list of spatial entities.\n */\n getSpatialEntities(filter?: Filter): SpatialEntity[] {\n // eslint-disable-next-line @typescript-eslint/consistent-type-assertions\n filter = { ...filter, hasSpatialEntity: true } as Filter;\n return [...this.getIds(filter)].map((s) => getSpatialEntityForEntity(this.store, s) as SpatialEntity);\n }\n\n async getDatabaseStatus(): Promise {\n if (!this.status) {\n this.status = new CCFDatabaseStatusTracker(this);\n }\n return this.status.toJson();\n }\n\n /**\n * Get a list of technology names used by datasets\n *\n * @returns list of unique technology names in the data\n */\n async getDatasetTechnologyNames(): Promise {\n return getDatasetTechnologyNames(this.store);\n }\n\n /**\n * Get a list of provider names from the database\n *\n * @returns list of unique provider names in the data\n */\n async getProviderNames(): Promise {\n return getProviderNames(this.store);\n }\n\n /**\n * Gets all tissue block results for a filter.\n *\n * @param [filter] The filter.\n * @returns A list of results.\n */\n async getTissueBlockResults(filter?: Filter): Promise {\n // eslint-disable-next-line @typescript-eslint/consistent-type-assertions\n filter = { ...filter, hasSpatialEntity: true } as Filter;\n return [...this.getIds(filter)].map((s) => getTissueBlockResult(this.store, s));\n }\n\n /**\n * Gets all aggregate results for a filter.\n *\n * @param [filter] The filter.\n * @returns A list of aggregate data.\n */\n async getAggregateResults(filter?: Filter): Promise {\n return getAggregateResults(this.getIds(filter), this.store);\n }\n\n /**\n * Get number of occurrences of ontology terms for a set of ids.\n *\n * @param [filter] The filter.\n * @returns Ontology term counts.\n */\n async getOntologyTermOccurences(filter?: Filter): Promise> {\n return getOntologyTermOccurences(this.getIds(filter), this.store);\n }\n\n /**\n * Get number of occurrences of cell type terms for a set of ids.\n *\n * @param [filter] The filter.\n * @returns Cell type term counts.\n */\n async getCellTypeTermOccurences(filter?: Filter): Promise> {\n return getCellTypeTermOccurences(this.getIds(filter), this.store);\n }\n\n /**\n * Get ontology term tree nodes\n *\n * @returns Ontology term counts.\n */\n async getOntologyTreeModel(): Promise {\n return getAnatomicalStructureTreeModel(this.store);\n }\n\n /**\n * Get cell type term tree nodes\n *\n * @returns Ontology term counts.\n */\n async getCellTypeTreeModel(): Promise {\n return getCellTypeTreeModel(this.store);\n }\n\n /**\n * Get reference organs\n *\n * @returns Ontology term counts.\n */\n async getReferenceOrgans(): Promise {\n return this.scene.getReferenceOrgans();\n }\n\n /**\n * Get all nodes to form the 3D scene of reference body, organs, and tissues\n *\n * @param [filter] The filter.\n * @returns A list of Spatial Scene Nodes for the 3D Scene\n */\n async getScene(filter?: Filter): Promise {\n this.graph.createGraph();\n return this.scene.getScene(filter);\n }\n\n /**\n * Get all nodes to form the 3D scene of reference organ and tissues\n *\n * @param [organIri] The Reference Organ IRI\n * @param [filter] The filter.\n * @returns A list of Spatial Scene Nodes for the 3D Scene\n */\n async getReferenceOrganScene(organIri: string, filter?: Filter): Promise {\n this.graph.createGraph();\n return this.scene.getReferenceOrganScene(organIri, filter);\n }\n\n async getSpatialPlacement(source: SpatialEntity, targetIri: string): Promise {\n return this.graph.getSpatialPlacement(source, targetIri);\n }\n}\n","import { Matrix4, toRadians } from '@math.gl/core';\nimport { SpatialSceneNode } from '../ccf-spatial-scene';\nimport { SpatialSearch } from '../interfaces';\nimport { SpatialEntity } from '../spatial-types';\n\ntype Color = [number, number, number, number];\nconst gold: Color = [240, 183, 98, 255];\nconst red: Color = [213, 0, 0, 255];\nconst green: Color = [29, 204, 101, 255];\nconst blue: Color = [41, 121, 255, 255];\n\n/**\n * Create a set of scene nodes for the body-ui to show the probing sphere and lines around it\n * for a given spatial search.\n * @param node the Spatial Entity (usually a reference organ) that the sphere is probing into\n * @param sphere the Spatial Search that defines where and how big the probing sphere is\n * @returns a set of scene nodes for the body-ui\n */\nexport function getProbingSphereScene(node: SpatialEntity, sphere?: SpatialSearch): SpatialSceneNode[] {\n const sceneWidth = node.x_dimension / 1000;\n const sceneHeight = node.y_dimension / 1000;\n const sceneDepth = node.z_dimension / 1000;\n const defaultSphereRadius = Math.max(sceneWidth, sceneHeight, sceneDepth) * 0.07;\n const sphereLineRadius = defaultSphereRadius * 0.05;\n const sphereLineLength = defaultSphereRadius * 2;\n const sphereConeRadius = sphereLineRadius * 4;\n\n if (!sphere) {\n sphere = {\n target: node.representation_of ?? node['@id'],\n radius: defaultSphereRadius,\n x: sceneWidth / 2,\n y: sceneHeight / 2,\n z: sceneDepth / 2\n };\n } else {\n sphere = {\n ...sphere,\n radius: sphere.radius / 1000,\n x: sphere.x / 1000,\n y: sphere.y / 1000,\n z: sphere.z / 1000\n };\n }\n\n return [\n // Probing Sphere\n {\n '@id': 'http://purl.org/ccf/latest/ccf.owl#ProbingSphere',\n '@type': 'SpatialSceneNode',\n unpickable: false,\n geometry: 'sphere',\n transformMatrix: new Matrix4(Matrix4.IDENTITY).translate([sphere.x, sphere.y, sphere.z]).scale(sphere.radius),\n color: gold\n },\n // Probing Sphere Positive X Axis (D)\n {\n '@id': 'http://purl.org/ccf/latest/ccf.owl#ProbingsphereXD',\n '@type': 'SpatialSceneNode',\n unpickable: true,\n geometry: 'cylinder',\n transformMatrix: new Matrix4(Matrix4.IDENTITY)\n .translate([sphere.x + sphere.radius + sphereLineLength / 2, sphere.y, sphere.z])\n .rotateZ(toRadians(-90))\n .scale([sphereLineRadius, sphereLineLength, sphereLineRadius]),\n color: red\n },\n {\n '@id': 'http://purl.org/ccf/latest/ccf.owl#ProbingsphereXDCone',\n '@type': 'SpatialSceneNode',\n unpickable: true,\n geometry: 'cone',\n transformMatrix: new Matrix4(Matrix4.IDENTITY)\n .translate([sphere.x + sphere.radius + sphereLineLength, sphere.y, sphere.z])\n .rotateZ(toRadians(-90))\n .scale([ sphereConeRadius, sphereConeRadius * 3, sphereConeRadius ]),\n color: red\n },\n {\n '@id': 'http://purl.org/ccf/latest/ccf.owl#ProbingsphereXDLabel',\n '@type': 'SpatialSceneNode',\n unpickable: true,\n geometry: 'text',\n text: 'D',\n transformMatrix: new Matrix4(Matrix4.IDENTITY)\n .translate([sphere.x + sphere.radius + sphereLineLength + sphereConeRadius * 3, sphere.y, sphere.z])\n .scale(sphereConeRadius),\n color: red\n },\n // Probing Sphere Negative X Axis (A)\n {\n '@id': 'http://purl.org/ccf/latest/ccf.owl#ProbingsphereXA',\n '@type': 'SpatialSceneNode',\n unpickable: true,\n geometry: 'cylinder',\n transformMatrix: new Matrix4(Matrix4.IDENTITY)\n .translate([sphere.x - sphere.radius - sphereLineLength / 2, sphere.y, sphere.z])\n .rotateZ(toRadians(-90))\n .scale([sphereLineRadius, sphereLineLength, sphereLineRadius]),\n color: red\n },\n {\n '@id': 'http://purl.org/ccf/latest/ccf.owl#ProbingsphereXACone',\n '@type': 'SpatialSceneNode',\n unpickable: true,\n geometry: 'cone',\n transformMatrix: new Matrix4(Matrix4.IDENTITY)\n .translate([sphere.x - sphere.radius - sphereLineLength, sphere.y, sphere.z])\n .rotateZ(toRadians(90))\n .scale([ sphereConeRadius, sphereConeRadius * 3, sphereConeRadius ]),\n color: red\n },\n {\n '@id': 'http://purl.org/ccf/latest/ccf.owl#ProbingsphereXALabel',\n '@type': 'SpatialSceneNode',\n unpickable: true,\n geometry: 'text',\n text: 'A',\n transformMatrix: new Matrix4(Matrix4.IDENTITY)\n .translate([sphere.x - sphere.radius - sphereLineLength - sphereConeRadius * 3.5, sphere.y, sphere.z])\n .scale(sphereConeRadius),\n color: red\n },\n // Probing Sphere Positive Y Axis (W)\n {\n '@id': 'http://purl.org/ccf/latest/ccf.owl#ProbingsphereYW',\n '@type': 'SpatialSceneNode',\n unpickable: true,\n geometry: 'cylinder',\n transformMatrix: new Matrix4(Matrix4.IDENTITY)\n .translate([sphere.x, sphere.y + sphere.radius + sphereLineLength / 2, sphere.z])\n .scale([sphereLineRadius, sphereLineLength, sphereLineRadius]),\n color: green\n },\n {\n '@id': 'http://purl.org/ccf/latest/ccf.owl#ProbingsphereYWCone',\n '@type': 'SpatialSceneNode',\n unpickable: true,\n geometry: 'cone',\n transformMatrix: new Matrix4(Matrix4.IDENTITY)\n .translate([sphere.x, sphere.y + sphere.radius + sphereLineLength, sphere.z])\n .scale([ sphereConeRadius, sphereConeRadius * 3, sphereConeRadius ]),\n color: green\n },\n {\n '@id': 'http://purl.org/ccf/latest/ccf.owl#ProbingsphereYWLabel',\n '@type': 'SpatialSceneNode',\n unpickable: true,\n geometry: 'text',\n text: 'W',\n transformMatrix: new Matrix4(Matrix4.IDENTITY)\n .translate([sphere.x, sphere.y + sphere.radius + sphereLineLength + sphereConeRadius * 3, sphere.z])\n .scale(sphereConeRadius),\n color: green\n },\n // Probing Sphere Negative Y Axis (S)\n {\n '@id': 'http://purl.org/ccf/latest/ccf.owl#ProbingsphereYS',\n '@type': 'SpatialSceneNode',\n unpickable: true,\n geometry: 'cylinder',\n transformMatrix: new Matrix4(Matrix4.IDENTITY)\n .translate([sphere.x, sphere.y - sphere.radius - sphereLineLength / 2, sphere.z])\n .scale([sphereLineRadius, sphereLineLength, sphereLineRadius]),\n color: green\n },\n {\n '@id': 'http://purl.org/ccf/latest/ccf.owl#ProbingsphereYSCone',\n '@type': 'SpatialSceneNode',\n unpickable: true,\n geometry: 'cone',\n transformMatrix: new Matrix4(Matrix4.IDENTITY)\n .translate([sphere.x, sphere.y - sphere.radius - sphereLineLength, sphere.z])\n .rotateZ(toRadians(180))\n .scale([ sphereConeRadius, sphereConeRadius * 3, sphereConeRadius ]),\n color: green\n },\n {\n '@id': 'http://purl.org/ccf/latest/ccf.owl#ProbingsphereYSLabel',\n '@type': 'SpatialSceneNode',\n unpickable: true,\n geometry: 'text',\n text: 'S',\n transformMatrix: new Matrix4(Matrix4.IDENTITY)\n .translate([sphere.x, sphere.y - sphere.radius - sphereLineLength - sphereConeRadius * 3.5, sphere.z])\n .scale(sphereConeRadius),\n color: green\n },\n // Probing Sphere Positive Z Axis (E)\n {\n '@id': 'http://purl.org/ccf/latest/ccf.owl#ProbingsphereZE',\n '@type': 'SpatialSceneNode',\n unpickable: true,\n geometry: 'cylinder',\n transformMatrix: new Matrix4(Matrix4.IDENTITY)\n .translate([sphere.x, sphere.y, sphere.z + sphere.radius + sphereLineLength / 2])\n .rotateX(toRadians(90))\n .scale([sphereLineRadius, sphereLineLength, sphereLineRadius]),\n color: blue\n },\n {\n '@id': 'http://purl.org/ccf/latest/ccf.owl#ProbingsphereZECone',\n '@type': 'SpatialSceneNode',\n unpickable: true,\n geometry: 'cone',\n transformMatrix: new Matrix4(Matrix4.IDENTITY)\n .translate([sphere.x, sphere.y, sphere.z + sphere.radius + sphereLineLength])\n .rotateX(toRadians(90))\n .scale([ sphereConeRadius, sphereConeRadius * 3, sphereConeRadius ]),\n color: blue\n },\n {\n '@id': 'http://purl.org/ccf/latest/ccf.owl#ProbingsphereZELabel',\n '@type': 'SpatialSceneNode',\n unpickable: true,\n geometry: 'text',\n text: 'E',\n transformMatrix: new Matrix4(Matrix4.IDENTITY)\n .translate([sphere.x, sphere.y, sphere.z + sphere.radius + sphereLineLength + sphereConeRadius * 3])\n .scale(sphereConeRadius),\n color: blue\n },\n // Probing Sphere Negative Z Axis (Q)\n {\n '@id': 'http://purl.org/ccf/latest/ccf.owl#ProbingsphereZQ',\n '@type': 'SpatialSceneNode',\n unpickable: true,\n geometry: 'cylinder',\n transformMatrix: new Matrix4(Matrix4.IDENTITY)\n .translate([sphere.x, sphere.y, sphere.z - sphere.radius - sphereLineLength / 2])\n .rotateX(toRadians(-90))\n .scale([sphereLineRadius, sphereLineLength, sphereLineRadius]),\n color: blue\n },\n {\n '@id': 'http://purl.org/ccf/latest/ccf.owl#ProbingsphereZQCone',\n '@type': 'SpatialSceneNode',\n unpickable: true,\n geometry: 'cone',\n transformMatrix: new Matrix4(Matrix4.IDENTITY)\n .translate([sphere.x, sphere.y, sphere.z - sphere.radius - sphereLineLength])\n .rotateX(toRadians(-90))\n .scale([ sphereConeRadius, sphereConeRadius * 3, sphereConeRadius ]),\n color: blue\n },\n {\n '@id': 'http://purl.org/ccf/latest/ccf.owl#ProbingsphereZQLabel',\n '@type': 'SpatialSceneNode',\n unpickable: true,\n geometry: 'text',\n text: 'Q',\n transformMatrix: new Matrix4(Matrix4.IDENTITY)\n .translate([sphere.x, sphere.y, sphere.z - sphere.radius - sphereLineLength - sphereConeRadius * 3.5])\n .scale(sphereConeRadius),\n color: blue\n }\n ];\n}\n","import { Matrix4, toRadians } from '@math.gl/core';\nimport { SpatialSceneNode } from '../ccf-spatial-scene';\nimport { SpatialEntity } from '../spatial-types';\n\n\ntype Color = [number, number, number, number];\nconst gray: Color = [204, 204, 204, 255];\nconst red: Color = [213, 0, 0, 255];\nconst green: Color = [29, 204, 101, 255];\nconst blue: Color = [41, 121, 255, 255];\n\n/**\n * Create a set of scene nodes for the body-ui to show the origin and lines extending to it's dimensions.\n * @param node the Spatial Entity (usually a reference organ) that the origin is defined by\n * @param includeLetters whether to show the keyboard letters associated with the origin points\n * @returns a set of scene nodes for the body-ui\n */\nexport function getOriginScene(node: SpatialEntity, includeLetters = false): SpatialSceneNode[] {\n const sceneWidth = node.x_dimension / 1000;\n const sceneHeight = node.y_dimension / 1000;\n const sceneDepth = node.z_dimension / 1000;\n const originRadius = Math.max(sceneWidth, sceneHeight, sceneDepth) * 0.05;\n const lineRadius = originRadius * 0.1;\n\n return [\n // Origin Sphere\n {\n '@id': 'http://purl.org/ccf/latest/ccf.owl#OriginSphere',\n '@type': 'SpatialSceneNode',\n unpickable: true,\n geometry: 'sphere',\n transformMatrix: new Matrix4(Matrix4.IDENTITY).scale(originRadius),\n color: gray\n },\n // Origin X Axis\n {\n '@id': 'http://purl.org/ccf/latest/ccf.owl#OriginX',\n '@type': 'SpatialSceneNode',\n unpickable: true,\n geometry: 'cylinder',\n transformMatrix: new Matrix4(Matrix4.IDENTITY)\n .translate([sceneWidth / 2, 0, 0])\n .rotateZ(toRadians(-90))\n .scale([lineRadius, sceneWidth, lineRadius]),\n color: red\n },\n {\n '@id': 'http://purl.org/ccf/latest/ccf.owl#OriginXCone',\n '@type': 'SpatialSceneNode',\n unpickable: true,\n geometry: 'cone',\n transformMatrix: new Matrix4(Matrix4.IDENTITY)\n .translate([sceneWidth, 0, 0])\n .rotateZ(toRadians(-90))\n .scale([ originRadius, originRadius * 3, originRadius ]),\n color: red\n },\n {\n '@id': 'http://purl.org/ccf/latest/ccf.owl#OriginXALabel',\n '@type': 'SpatialSceneNode',\n unpickable: true,\n geometry: 'text',\n text: 'A',\n transformMatrix: new Matrix4(Matrix4.IDENTITY).translate([-originRadius * 2, 0, 0]).scale(originRadius),\n color: red\n },\n {\n '@id': 'http://purl.org/ccf/latest/ccf.owl#OriginXDLabel',\n '@type': 'SpatialSceneNode',\n unpickable: true,\n geometry: 'text',\n text: 'D',\n transformMatrix: new Matrix4(Matrix4.IDENTITY).translate([sceneWidth + originRadius * 2, 0, 0]).scale(originRadius),\n color: red\n },\n // Origin Y Axis\n {\n '@id': 'http://purl.org/ccf/latest/ccf.owl#OriginY',\n '@type': 'SpatialSceneNode',\n unpickable: true,\n geometry: 'cylinder',\n transformMatrix: new Matrix4(Matrix4.IDENTITY)\n .translate([0, sceneHeight / 2, 0])\n .scale([lineRadius, sceneHeight, lineRadius]),\n color: green\n },\n {\n '@id': 'http://purl.org/ccf/latest/ccf.owl#OriginYCone',\n '@type': 'SpatialSceneNode',\n unpickable: true,\n geometry: 'cone',\n transformMatrix: new Matrix4(Matrix4.IDENTITY)\n .translate([0, sceneHeight, 0])\n .scale([ originRadius, originRadius * 3, originRadius ]),\n color: green\n },\n {\n '@id': 'http://purl.org/ccf/latest/ccf.owl#OriginYSLabel',\n '@type': 'SpatialSceneNode',\n unpickable: true,\n geometry: 'text',\n text: 'S',\n transformMatrix: new Matrix4(Matrix4.IDENTITY).translate([originRadius * 1.5, originRadius * 1.5, 0]).scale(originRadius),\n color: green\n },\n {\n '@id': 'http://purl.org/ccf/latest/ccf.owl#OriginYWLabel',\n '@type': 'SpatialSceneNode',\n unpickable: true,\n geometry: 'text',\n text: 'W',\n transformMatrix: new Matrix4(Matrix4.IDENTITY).translate([0, sceneHeight + originRadius * 2, 0]).scale(originRadius),\n color: green\n },\n // Origin Z Axis\n {\n '@id': 'http://purl.org/ccf/latest/ccf.owl#OriginZ',\n '@type': 'SpatialSceneNode',\n unpickable: true,\n geometry: 'cylinder',\n transformMatrix: new Matrix4(Matrix4.IDENTITY)\n .translate([0, 0, sceneDepth / 2])\n .rotateX(toRadians(90))\n .scale([lineRadius, sceneDepth, lineRadius]),\n color: blue\n },\n {\n '@id': 'http://purl.org/ccf/latest/ccf.owl#OriginZCone',\n '@type': 'SpatialSceneNode',\n unpickable: true,\n geometry: 'cone',\n transformMatrix: new Matrix4(Matrix4.IDENTITY)\n .translate([0, 0, sceneDepth])\n .rotateX(toRadians(90))\n .scale([ originRadius, originRadius * 3, originRadius ]),\n color: blue\n },\n {\n '@id': 'http://purl.org/ccf/latest/ccf.owl#OriginZQLabel',\n '@type': 'SpatialSceneNode',\n unpickable: true,\n geometry: 'text',\n text: 'Q',\n transformMatrix: new Matrix4(Matrix4.IDENTITY).translate([originRadius * 1.5, - originRadius * 1.5, 0]).scale(originRadius),\n color: blue\n },\n {\n '@id': 'http://purl.org/ccf/latest/ccf.owl#OriginZELabel',\n '@type': 'SpatialSceneNode',\n unpickable: true,\n geometry: 'text',\n text: 'E',\n transformMatrix: new Matrix4(Matrix4.IDENTITY).translate([0, 0, sceneDepth + originRadius * 2]).scale(originRadius),\n color: blue\n }\n ].filter(n => (includeLetters && n.geometry === 'text' && n.text) || !n.text) as SpatialSceneNode[];\n}\n","/*\n * Public API Surface of ccf\n */\nexport * from './lib/ccf-database';\nexport * from './lib/ccf-spatial-scene';\nexport * from './lib/interfaces';\nexport * from './lib/spatial-types';\nexport * from './lib/hubmap/hubmap-data-import';\nexport * from './lib/util/ccf-database-status-tracker';\nexport * from './lib/util/probing-sphere-scene';\nexport * from './lib/util/origin-scene';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["uuidV4","get","red","green","blue"],"mappings":";;;;;;;;;;;AAIA;;;;;;;;UAQiB,UAAU,CAAC,KAAY,EAAE,GAAW,EAAE,OAAkC;IACvF,KAAK,MAAM,CAAC,SAAS,EAAE,GAAG,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE;QACtD,KAAK,MAAM,IAAI,IAAI,SAAS,CAAC,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE;YAC/D,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,QAAQ,KAAK,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;YACzF,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;SACpB;KACF;AACH,CAAC;AAED;;;;;;;;;SASgB,eAAe,CAAc,KAAY,EAAE,GAAW,EAAE,IAAY,EAAE,OAAkC;IACtH,MAAM,MAAM,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAC7C,KAAK,MAAM,CAAC,SAAS,EAAE,GAAG,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE;QACtD,KAAK,MAAM,IAAI,IAAI,SAAS,CAAC,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE;YACzE,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,QAAQ,KAAK,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;YACzF,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;SACrB;KACF;IACD,OAAO,MAAsB,CAAC;AAChC;;ACvCA;AAGA;AACO,MAAM,QAAQ,GAAG;IACtB,IAAI,EAAE,qCAAqC;IAC3C,GAAG,EAAE,sBAAsB;IAC3B,GAAG,EAAE,iCAAiC;IACtC,GAAG,EAAE,iCAAiC;IACtC,MAAM,EAAE,wCAAwC;IAChD,EAAE,EAAE,oCAAoC;IACxC,IAAI,EAAE,sCAAsC;IAC5C,GAAG,EAAE,6CAA6C;IAClD,IAAI,EAAE,uCAAuC;IAC7C,EAAE,EAAE,kCAAkC;IACtC,OAAO,EAAE,2BAA2B;CACrC,CAAC;AAEF;AACO,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;AAEtD,MAAM,GAAG,GAAG;IACjB,CAAC,EAAE,QAAQ,CAAC,KAAK,CAAC;IAClB,IAAI,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC;CAC9B,CAAC;AAEK,MAAM,IAAI,GAAG;IAClB,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC;IACnB,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC;IAChC,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC;IACpC,WAAW,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,aAAa,CAAC;IAC5C,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC;CACrC,CAAC;AAEF;AACA,MAAM,IAAI,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;AAE7B;AACO,MAAM,MAAM,GAAG;IACpB,EAAE,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC,2BAA2B,CAAC;IAChD,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC;IAChC,WAAW,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC;IACxC,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC;IAEjB,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC;IAChB,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC;IAChB,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC;IAEhB,IAAI,EAAE,WAAW,CAAC,OAAO,CAAC,MAAM,CAAC;IACjC,MAAM,EAAE,WAAW,CAAC,OAAO,CAAC,QAAQ,CAAC;IAErC,cAAc,EAAE,IAAI,CAAC,iBAAiB,CAAC;IACvC,YAAY,EAAE,IAAI,CAAC,sBAAsB,CAAC;IAC1C,YAAY,EAAE,IAAI,CAAC,sBAAsB,CAAC;IAE1C,KAAK,EAAE,IAAI,CAAC,YAAY,CAAC;IAEzB,QAAQ,EAAE,IAAI,CAAC,0BAA0B,CAAC;IAC1C,QAAQ,EAAE,IAAI,CAAC,mBAAmB,CAAC;IAEnC,UAAU,EAAE,IAAI,CAAC,aAAa,CAAC;IAE/B,WAAW,EAAE,WAAW,CAAC,OAAO,CAAC,cAAc,CAAC;IAChD,aAAa,EAAE,WAAW,CAAC,OAAO,CAAC,gBAAgB,CAAC;IACpD,WAAW,EAAE,WAAW,CAAC,OAAO,CAAC,cAAc,CAAC;IAEhD,YAAY,EAAE,IAAI,CAAC,eAAe,CAAC;IACnC,WAAW,EAAE,IAAI,CAAC,cAAc,CAAC;IACjC,YAAY,EAAE,IAAI,CAAC,mBAAmB,CAAC;IACvC,aAAa,EAAE,IAAI,CAAC,gBAAgB,CAAC;IAErC,aAAa,EAAE,IAAI,CAAC,2BAA2B,CAAC;IAChD,aAAa,EAAE,IAAI,CAAC,mBAAmB,CAAC;IACxC,aAAa,EAAE,IAAI,CAAC,oBAAoB,CAAC;IAEzC,UAAU,EAAE,IAAI,CAAC,YAAY,CAAC;IAC9B,SAAS,EAAE,IAAI,CAAC,WAAW,CAAC;CAC7B,CAAC;AAEF;AACO,MAAM,GAAG,GAAG;IACjB,CAAC,EAAE,IAAI;IACP,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC;IACtB,YAAY,EAAE;QACZ,KAAK,EAAE,IAAI,CAAC,gBAAgB,CAAC;QAC7B,MAAM,EAAE,IAAI,CAAC,aAAa,CAAC;QAC3B,QAAQ,EAAE,IAAI,CAAC,aAAa,CAAC;QAC7B,QAAQ,EAAE,IAAI,CAAC,UAAU,CAAC;QAC1B,aAAa,EAAE,WAAW,CAAC,SAAS,CAAC,8DAA8D,CAAC;KACrG;IACD,KAAK,EAAE;QACL,OAAO,EAAE,IAAI,CAAC,aAAa,CAAC;QAC5B,OAAO,EAAE,IAAI,CAAC,YAAY,CAAC;QAC3B,UAAU,EAAE,IAAI,CAAC,gBAAgB,CAAC;QAClC,aAAa,EAAE,IAAI,CAAC,mBAAmB,CAAC;KACzC;IACD,OAAO,EAAE;QACP,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,UAAU,CAAC;QACpC,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC;QAChC,SAAS,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,aAAa,CAAC;QAC1C,YAAY,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,gBAAgB,CAAC;QAChD,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,cAAc,CAAC;KAC7C;IACD,sBAAsB,EAAE,IAAI,CAAC,0BAA0B,CAAC;IACxD,aAAa,EAAE,IAAI,CAAC,gBAAgB,CAAC;IACrC,gBAAgB,EAAE,IAAI,CAAC,mBAAmB,CAAC;IAC3C,sBAAsB,EAAE;QACtB,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC;QACtB,WAAW,EAAE,IAAI,CAAC,aAAa,CAAC;QAChC,YAAY,EAAE,IAAI,CAAC,cAAc,CAAC;KACnC;IACD,aAAa,EAAE;QACb,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC;QAChC,QAAQ,EAAE,IAAI,CAAC,UAAU,CAAC;KAC3B;IACD,aAAa,EAAE;QACb,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC;QAChC,WAAW,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC;QACxC,OAAO,EAAE,QAAQ,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC;QACvC,kBAAkB,EAAE,IAAI,CAAC,oBAAoB,CAAC;QAC9C,iBAAiB,EAAE,IAAI,CAAC,mBAAmB,CAAC;QAC5C,aAAa,EAAE,IAAI,CAAC,eAAe,CAAC;QACpC,aAAa,EAAE,QAAQ,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC;QAC7C,YAAY,EAAE,IAAI,CAAC,cAAc,CAAC;QAClC,eAAe,EAAE,IAAI,CAAC,eAAe,CAAC;QACtC,iBAAiB,EAAE,IAAI,CAAC,mBAAmB,CAAC;QAC5C,eAAe,EAAE,IAAI,CAAC,qBAAqB,CAAC;QAC5C,kBAAkB,EAAE,IAAI,CAAC,oBAAoB,CAAC;QAC9C,cAAc,EAAE,IAAI,CAAC,oBAAoB,CAAC;QAC1C,GAAG,EAAE,IAAI,CAAC,iBAAiB,CAAC;QAC5B,IAAI,EAAE,IAAI,CAAC,YAAY,CAAC;QACxB,QAAQ,EAAE,IAAI,CAAC,UAAU,CAAC;QAC1B,eAAe,EAAE,IAAI,CAAC,iBAAiB,CAAC;QACxC,WAAW,EAAE,IAAI,CAAC,aAAa,CAAC;QAChC,WAAW,EAAE,IAAI,CAAC,aAAa,CAAC;QAChC,WAAW,EAAE,IAAI,CAAC,aAAa,CAAC;QAChC,WAAW,EAAE,IAAI,CAAC,aAAa,CAAC;QAChC,eAAe,EAAE,IAAI,CAAC,gBAAgB,CAAC;QACvC,MAAM,EAAE,IAAI,CAAC,sBAAsB,CAAC;KACrC;IACD,gBAAgB,EAAE;QAChB,MAAM,EAAE,IAAI,CAAC,eAAe,CAAC;QAC7B,MAAM,EAAE,IAAI,CAAC,uBAAuB,CAAC;QAErC,cAAc,EAAE,QAAQ,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC;QAC9C,SAAS,EAAE,IAAI,CAAC,WAAW,CAAC;QAC5B,SAAS,EAAE,IAAI,CAAC,WAAW,CAAC;QAC5B,SAAS,EAAE,IAAI,CAAC,WAAW,CAAC;QAC5B,aAAa,EAAE,IAAI,CAAC,cAAc,CAAC;QAEnC,UAAU,EAAE,IAAI,CAAC,YAAY,CAAC;QAC9B,UAAU,EAAE,IAAI,CAAC,YAAY,CAAC;QAC9B,UAAU,EAAE,IAAI,CAAC,YAAY,CAAC;QAC9B,UAAU,EAAE,IAAI,CAAC,gBAAgB,CAAC;QAClC,cAAc,EAAE,IAAI,CAAC,gBAAgB,CAAC;QACtC,cAAc,EAAE,IAAI,CAAC,eAAe,CAAC;QAErC,aAAa,EAAE,IAAI,CAAC,eAAe,CAAC;QACpC,aAAa,EAAE,IAAI,CAAC,eAAe,CAAC;QACpC,aAAa,EAAE,IAAI,CAAC,eAAe,CAAC;QACpC,iBAAiB,EAAE,IAAI,CAAC,kBAAkB,CAAC;KAC5C;CACF,CAAC;AAEF;AACO,MAAM,MAAM,GAAG;IACpB,CAAC,EAAE,QAAQ,CAAC,QAAQ,CAAC;IACrB,IAAI,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC,SAAS,CAAC;CACpC,CAAC;AAEF;AACO,MAAM,EAAE,GAAG;IAChB,CAAC,EAAE,QAAQ,CAAC,IAAI,CAAC;IACjB,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC,SAAS,CAAC;CAChC,CAAC;AAEF;AACO,MAAM,GAAG,GAAG;IACjB,CAAC,EAAE,QAAQ,CAAC,KAAK,CAAC;CACnB,CAAC;AAEF;AACO,MAAM,IAAI,GAAG;IAClB,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC;CACpB,CAAC;AAEF;AACO,MAAM,GAAG,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC,IAAI;IACjB,IAAI,EAAE,EAAE,CAAC,IAAI;IACb,kBAAkB,EAAE,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;IACvC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;IAC1B,SAAS,EAAE,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;IAC9B,UAAU,EAAE,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;IAC/B,aAAa,EAAE,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;IAClC,cAAc,EAAE,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;IACnC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;IAC3B,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;IAC3B,GAAG,EAAE,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;IACxB,cAAc,EAAE,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;IACnC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;IACzB,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;IAC1B,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;IAC5B,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;IAC1B,WAAW,EAAE,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;IAChC,wBAAwB,EAAE,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;IAC7C,UAAU,EAAE,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;;IAG/B,iBAAiB,EAAE,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;IACtC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;IAC1B,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;IAC7B,SAAS,EAAE,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC;IACzB,mBAAmB,EAAE,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;IACxC,oBAAoB,EAAE,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;IACzC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;IAC1B,WAAW,EAAE,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;IAChC,YAAY,EAAE,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;IACjC,SAAS,EAAE,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC;IACzB,UAAU,EAAE,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC;IAC1B,eAAe,EAAE,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;IACpC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;IAC1B,qBAAqB,EAAE,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;IAC1C,UAAU,EAAE,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC;IACzB,WAAW,EAAE,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC;IAC1B,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;IAC7B,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;IAC3B,cAAc,EAAE,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;IACnC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;IACzB,eAAe,EAAE,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;IACpC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;IAC3B,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;IAC3B,WAAW,EAAE,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;IAChC,YAAY,EAAE,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;IACjC,eAAe,EAAE,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;IACpC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;CAC5B;;ACtOD;;;;;;AAMA,SAAS,cAAc,CAAC,OAA0C;IAChE,MAAM,UAAU,GAA8B,EAAE,CAAC;IACjD,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,EAAE,SAAS,CAAC;QAChD,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC;KACjC,CAAC,CAAC;IACH,OAAO,UAAU,CAAC;AACpB,CAAC;AAED;AACA,MAAM,QAAQ,GAAG;IACf,sBAAsB,EAAE,cAAc,CAAC,GAAG,CAAC,sBAAsB,CAAC;IAClE,aAAa,EAAE,cAAc,CAAC,GAAG,CAAC,aAAa,CAAC;IAChD,gBAAgB,EAAE,cAAc,CAAC,GAAG,CAAC,gBAAgB,CAAC;CACvD,CAAC;AAEF;;;;;;;SAOgB,yBAAyB,CAAC,KAAY,EAAE,GAAW;IACjE,OAAO,eAAe,CAAyB,KAAK,EAAE,GAAG,EAAE,wBAAwB,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC;AACxH,CAAC;AAED;;;;;;;SAOgB,gBAAgB,CAAC,KAAY,EAAE,GAAW;IACxD,MAAM,MAAM,GAAG,eAAe,CAAgB,KAAK,EAAE,GAAG,EAAE,eAAe,EAAE,QAAQ,CAAC,aAAa,CAAC,CAAC;IACnG,MAAM,CAAC,eAAe,GAAG,MAAM,CAC7B,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC,aAAa,CAAC,cAAc,EAAE,GAAG,EAAE,IAAI,CAAC;SAC3D,GAAG,CAAC,CAAC,KAAK,KAAK,gBAAgB,CAAC,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,CAAC,EACpD,CAAC,UAAU,CAAC,CAAC,CAAC;IAChB,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;;;;;SAOgB,iBAAiB,CAAC,KAAY,EAAE,GAAW;IACzD,OAAO,MAAM,CACX,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC,aAAa,CAAC,kBAAkB,EAAE,GAAG,EAAE,IAAI,CAAC;SAC/D,GAAG,CAAC,CAAC,KAAK,KAAK,gBAAgB,CAAC,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,CAAC,EACpD,CAAC,UAAU,CAAC,CACb,CAAC;AACJ,CAAC;AAGD;;;;;;;SAOgB,uBAAuB,CAAC,KAAY,EAAE,GAAW;IAC/D,OAAO,MAAM,CACX,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC,aAAa,CAAC,eAAe,EAAE,GAAG,EAAE,IAAI,CAAC;SAC5D,GAAG,CAAC,CAAC,KAAK,KAAK,gBAAgB,CAAC,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,CAAC;SACjD,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,KAAK,GAAG,CAAC,EAClC,CAAC,UAAU,CAAC,CACb,CAAC;AACJ,CAAC;AAED;;;;;;SAMgB,kBAAkB,CAAC,KAAY;IAC7C,MAAM,OAAO,GAAoB,EAAE,CAAC;IACpC,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI;QACjB,IAAI,IAAI,CAAC,OAAO,CAAC,EAAE,KAAK,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE;YACtC,OAAO,CAAC,IAAI,CAAC,gBAAgB,CAAC,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC;SACxD;KACF,EAAE,IAAI,EAAE,GAAG,CAAC,aAAa,CAAC,eAAe,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;IACxD,OAAO,MAAM,CAAC,OAAO,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC;AACvC,CAAC;AAED;;;;;;;SAOgB,gBAAgB,CAAC,KAAY,EAAE,GAAW;IACxD,MAAM,MAAM,GAAG,eAAe,CAAgB,KAAK,EAAE,GAAG,EAAE,eAAe,EAAE,QAAQ,CAAC,aAAa,CAAC,CAAC;;IAEnG,IAAI,MAAM,CAAC,MAAM,EAAE;QACjB,MAAM,CAAC,MAAM,GAAG,yBAAyB,CAAC,KAAK,EAAG,MAAM,CAAC,MAA4B,CAAC,CAAC;KACxF;IACD,IAAI,MAAM,CAAC,eAAe,EAAE;QAC1B,MAAM,CAAC,eAAe,GAAG,KAAK,CAAC,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC,aAAa,CAAC,eAAe,EAAE,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC;KACxG;IACD,KAAK,CAAC,WAAW,CAAC,CAAC,OAAO,MAAM,MAAM,CAAC,QAAQ,GAAG,OAAO,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC,aAAa,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC;IAChG,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;;;;;SAOgB,mBAAmB,CAAC,KAAY,EAAE,GAAW;IAC3D,MAAM,MAAM,GAAG,eAAe,CAAmB,KAAK,EAAE,GAAG,EAAE,kBAAkB,EAAE,QAAQ,CAAC,gBAAgB,CAAC,CAAC;;IAE5G,IAAI,MAAM,CAAC,MAAM,EAAE;QACjB,MAAM,CAAC,MAAM,GAAG,gBAAgB,CAAC,KAAK,EAAG,MAAM,CAAC,MAA4B,CAAC,CAAC;KAC/E;IACD,IAAI,MAAM,CAAC,MAAM,EAAE;QACjB,MAAM,CAAC,MAAM,GAAG,gBAAgB,CAAC,KAAK,EAAG,MAAM,CAAC,MAA4B,CAAC,CAAC;KAC/E;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;;;;;SAOgB,yBAAyB,CAAC,KAAY,EAAE,SAAiB;IACvE,MAAM,kBAAkB,GAAG,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,SAAS,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC,aAAa,EAAE,IAAI,CAAC,CAAC;IAC1G,IAAI,kBAAkB,CAAC,MAAM,GAAG,CAAC,EAAE;QACjC,OAAO,gBAAgB,CAAC,KAAK,EAAE,kBAAkB,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;KAC1D;SAAM;QACL,OAAO,SAAS,CAAC;KAClB;AACH;;AC7JA;SAgBgB,qBAAqB,CAAC,EAAW,EAAE,SAA2B;IAC5E,MAAM,CAAC,GAAG,SAAS,CAAC;IACpB,IAAI,MAAc,CAAC;IACnB,QAAQ,CAAC,CAAC,iBAAiB;QACzB,KAAK,YAAY;YACf,MAAM,GAAG,CAAC,GAAG,GAAG,CAAC;YACjB,MAAM;QACR,KAAK,YAAY;YACf,MAAM,GAAG,CAAC,GAAG,IAAI,CAAC;YAClB,MAAM;QACR,KAAK,OAAO,CAAC;QACb;YACE,MAAM,GAAG,CAAC,CAAC;YACX,MAAM;KACT;IACD,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,aAAa,EAAE,CAAC,CAAC,aAAa,EAAE,CAAC,CAAC,aAAa,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,CAAC;IACnF,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,UAAU,EAAE,CAAC,CAAC,UAAU,EAAE,CAAC,CAAC,UAAU,CAAC,CAAC,GAAG,CAAS,SAAS,CAA6B,CAAC;IACxG,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC;IAElD,OAAO,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AAC/C,CAAC;MAEY,eAAe;IAI1B,YAAoB,EAAe;QAAf,OAAE,GAAF,EAAE,CAAa;QACjC,IAAI,CAAC,WAAW,EAAE,CAAC;KACpB;IAED,WAAW;QACT,IAAI,CAAC,KAAK,GAAG,IAAI,aAAa,EAAE,CAAC;QACjC,MAAM,KAAK,GAAG,IAAI,CAAC,EAAE,CAAC,KAAK,CAAC;;QAG5B,KAAK,CAAC,WAAW,CAAC,CAAC,OAAO;YACxB,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,EAAE,wBAAwB,CAAC,CAAC;SACpD,EAAE,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,sBAAsB,EAAE,IAAI,CAAC,CAAC;;QAG/C,KAAK,CAAC,WAAW,CAAC,CAAC,OAAO;YACxB,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,EAAE,eAAe,CAAC,CAAC;SAC3C,EAAE,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,aAAa,EAAE,IAAI,CAAC,CAAC;;QAGtC,MAAM,UAAU,GAA2B,EAAE,CAAC;QAC9C,KAAK,MAAM,IAAI,IAAI,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,CAAC,gBAAgB,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE;YAClF,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;SAC9C;QACD,KAAK,MAAM,IAAI,IAAI,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,CAAC,gBAAgB,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE;YAClF,MAAM,MAAM,GAAG,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;YAC3C,IAAI,MAAM,EAAE;gBACV,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,kBAAkB,CAAC,CAAC;aAC3E;SACF;KACF;IAED,OAAO,CAAC,EAAU,EAAE,IAAY;QAC9B,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;KACpC;IAED,OAAO,CAAC,EAAU,EAAE,MAAc,EAAE,MAAc,EAAE,IAAY;QAC9D,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC;KAC5D;IAED,uBAAuB,CAAC,SAAiB,EAAE,SAAiB;QAC1D,IAAI,SAAS,KAAK,SAAS,EAAE;YAC3B,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;SACtC;QACD,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE;YACpE,OAAO,SAAS,CAAC;SAClB;QAED,MAAM,KAAK,GAAG,IAAI,CAAC,EAAE,CAAC,KAAK,CAAC;QAC5B,MAAM,EAAE,GAAG,IAAI,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;QACzC,MAAM,IAAI,GAAG,YAAY,CAAC,IAAI,CAAC,KAAK,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC;QAC5D,IAAI,IAAI,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE;YAC3B,IAAI,CAAC,OAAO,EAAE,CAAC;YACf,IAAI,MAAM,GAAoB,EAAE,CAAC;YACjC,KAAK,MAAM,MAAM,IAAI,IAAI,EAAE;gBACzB,IAAI,MAAM,EAAE;oBACV,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;oBACtE,MAAM,SAAS,GAAG,mBAAmB,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC;oBAC1D,qBAAqB,CAAC,EAAE,EAAE,SAAS,CAAC,CAAC;iBACtC;gBACD,MAAM,GAAG,MAAM,CAAC;aACjB;YACD,OAAO,EAAE,CAAC;SACX;aAAM;YACL,OAAO,SAAS,CAAC;SAClB;KACF;IAED,mBAAmB,CAAC,MAAqB,EAAE,SAAiB;QAC1D,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,SAAS,CAAC;QAChF,MAAM,SAAS,GAAqB,GAAG,CAAC,MAAM,EAAE,cAAc,EAAE,GAAG,CAAC,MAAM,EAAE,WAAW,EAAE,SAAS,CAAC,CAAC,CAAC;QAErG,IAAI,MAA2B,CAAC;QAChC,IAAI,SAAS,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE;YACrD,MAAM,GAAG,IAAI,CAAC,uBAAuB,CAAC,SAAS,CAAC,MAA2B,EAAE,SAAS,CAAC,CAAC;YACxF,IAAI,MAAM,EAAE;gBACV,MAAM,GAAG,qBAAqB,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;aACnD;SACF;aAAM,IAAI,SAAS,EAAE;YACpB,MAAM,GAAG,IAAI,CAAC,uBAAuB,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;SAC7D;QAED,IAAI,MAAM,EAAE;YACV,MAAM,KAAK,GAAG,IAAI,KAAK,EAAE,CAAC,kBAAkB,CAAC,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;YAChE,MAAM,CAAC,GAAG,MAAM,CAAC,cAAc,EAAE,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,IAAI,CAA6B,CAAC;YACjF,MAAM,CAAC,GAAG,KAAK,CAAC,SAAS,EAAE,CAAC,GAAG,CAAS,SAAS,CAA6B,CAAC;YAC/E,MAAM,CAAC,GAAG,MAAM,CAAC,QAAQ,EAAE,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,QAAQ,GAAG,CAAC,GAAG,CAAC,CAA6B,CAAC;YAEhG,OAAO;gBACL,UAAU,EAAE,uEAAuE;gBACnF,KAAK,EAAE,2BAA2BA,EAAM,EAAE,YAAY;gBACtD,OAAO,EAAE,kBAAkB;gBAC3B,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC;gBACrB,MAAM,EAAE,SAAS;gBACjB,cAAc,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;gBACtD,SAAS,EAAE,CAAC,CAAC,CAAC,CAAC;gBACf,SAAS,EAAE,CAAC,CAAC,CAAC,CAAC;gBACf,SAAS,EAAE,CAAC,CAAC,CAAC,CAAC;gBACf,aAAa,EAAE,OAAO;gBACtB,UAAU,EAAE,CAAC,CAAC,CAAC,CAAC;gBAChB,UAAU,EAAE,CAAC,CAAC,CAAC,CAAC;gBAChB,UAAU,EAAE,CAAC,CAAC,CAAC,CAAC;gBAChB,cAAc,EAAE,KAAK;gBACrB,cAAc,EAAE,QAAQ;gBACxB,aAAa,EAAE,CAAC,CAAC,CAAC,CAAC;gBACnB,aAAa,EAAE,CAAC,CAAC,CAAC,CAAC;gBACnB,aAAa,EAAE,CAAC,CAAC,CAAC,CAAC;gBACnB,iBAAiB,EAAE,YAAY;aAChC,CAAC;SACH;aAAM;YACL,OAAO,SAAS,CAAC;SAClB;KACF;;;ACzJH;MAqCa,eAAe;IAE1B,YAAoB,EAAe;QAAf,OAAE,GAAF,EAAE,CAAa;KAAI;IAEvC,gBAAgB,CAAC,GAAW;QAC1B,OAAO,gBAAgB,CAAC,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;KAC7C;IACD,iBAAiB,CAAC,GAAW;QAC3B,OAAO,iBAAiB,CAAC,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;KAC9C;IACD,gBAAgB,CAAC,GAAW;QAC1B,OAAO,gBAAgB,CAAC,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;KAC7C;IACD,uBAAuB,CAAC,GAAW;QACjC,OAAO,uBAAuB,CAAC,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;KACpD;IACD,kBAAkB;QAChB,OAAO,kBAAkB,CAAC,IAAI,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC;KAC1C;IAED,gBAAgB,CAAC,MAAe;QAC9B,IAAI,MAAc,CAAC;QACnB,QAAQ,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,GAAG;YACjB,KAAK,MAAM;gBACT,MAAM,GAAG,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;gBAC7B,MAAM;YACR,KAAK,QAAQ;gBACX,MAAM,GAAG,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;gBAC/B,MAAM;YACR,KAAK,MAAM,CAAC;YACZ;gBACE,MAAM,GAAG,GAAG,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,CAAC;gBAClC,MAAM;SACT;QACD,OAAO,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC;KACtC;IAED,qBAAqB,CAAC,MAAe;QACnC,IAAI,QAAQ,GAAG,IAAI,CAAC,kBAAkB,EAAE,CAAC;QACzC,QAAQ,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,GAAG;YACjB,KAAK,MAAM;gBACT,QAAQ,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,KAAK,MAAM,CAAC,CAAC;gBAClD,MAAM;YACR,KAAK,QAAQ;gBACX,QAAQ,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,KAAK,QAAQ,CAAC,CAAC;gBACpD,MAAM;YACR,KAAK,MAAM,CAAC;YACZ;gBACE,MAAM;SACT;QACD,IAAI,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,KAAK,EAAE;YACjB,QAAQ,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,IAAI,CAAE,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,uBAAuB,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;iBACzE,MAAM,CAAkB,CAAC,GAAG,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,KAAK,GAAG,CAAC,MAAM,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,GAAG,UAAU,GAAG,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC;SACtH;QACD,OAAO,QAAQ,CAAC;KACjB;IAED,sBAAsB,CAAC,MAAe;QACpC,MAAM,IAAI,GAAG,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC;QAC3C,MAAM,SAAS,GAAuB,EAAE,CAAC;QACzC,IAAI,KAAK,GAAqC;YAC5C,GAAG,IAAI,CAAC,qBAAqB,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK;gBAC9C,MAAM,MAAM,GAAG,KAAK,CAAC,iBAAiB,KAAK,+CAA+C,CAAC;gBAC3F,MAAM,SAAS,GAAG,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,IAAI,EAAE;oBAC/C,KAAK,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,OAAO,EAAE,MAAM,GAAG,GAAG,GAAG,GAAG,EAAE,UAAU,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,gBAAgB,EAAE,CAAC,MAAM;iBACxH,CAAC,CAAC;gBACH,IAAI,MAAM,IAAI,SAAS,EAAE;oBACvB,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;oBAC1B,OAAO,SAAS,CAAC;iBAClB;qBAAM;oBACL,OAAO,SAAS,CAAC;iBAClB;aACF,CAAC;SACH,CAAC;QACF,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE;YACxB,KAAK,GAAG,CAAC,GAAG,SAAS,EAAE,GAAG,KAAK,CAAC,CAAC;SAClC;QAED,IAAI,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,KAAK,EAAE;;YAEjB,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC;gBACnB,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,GAAC,GAAG,CAAC,EAAE,QAAQ,EAAE,WAAW,EAAE,CAAC;gBACpI,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,GAAC,GAAG,CAAC,EAAE,QAAQ,EAAE,WAAW,EAAE,CAAC;gBACnI,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,GAAC,GAAG,CAAC,EAAE,QAAQ,EAAE,WAAW,EAAE,CAAC;gBAClI,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,GAAC,GAAG,CAAC,EAAE,QAAQ,EAAE,WAAW,EAAE,CAAC;gBAClI,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,GAAC,GAAG,CAAC,EAAE,QAAQ,EAAE,WAAW,EAAE,CAAC;aACnI,CAAC,CAAC;SACJ;QAED,OAAO,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,KAAK,SAAS,CAAuB,CAAC;KACjE;IAED,sBAAsB,CAAC,QAAgB,EAAE,MAAe;;QACtD,MAAM,YAAY,GAAG,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,GAAG,MAAK,SAAS,IAAI,CAAA,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,GAAG,0CAAE,WAAW,EAAE,MAAK,MAAM,CAAC;QACxF,MAAM,MAAM,GAAG,IAAI,CAAC,kBAAkB,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,iBAAiB,KAAK,QAAQ,KAAK,CAAC,YAAY,IAAI,CAAC,CAAC,GAAG,MAAK,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,GAAG,CAAA,CAAC,CAAC,CAAC;QACrI,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE;YACrB,MAAM,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;YACxB,MAAM,MAAM,GAAG,KAAK,CAAC,iBAAiB,KAAK,+CAA+C,CAAC;YAC3F,MAAM,SAAS,GAAG,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,KAAK,EAAE;gBAChD,KAAK,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,OAAO,EAAE,MAAM,GAAG,GAAG,GAAG,GAAG,EAAE,UAAU,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK;aAC7F,CAAqB,CAAC;YAEvB,MAAM,KAAK,GAAG,CAAC,MAAA,IAAI,CAAC,EAAE,CAAC,kBAAkB,CAAC,MAAM,CAAC,mCAAI,EAAE,EAAE,GAAG,CAAC,CAAC,MAAM,KAClE,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,GAAC,GAAG,CAAC,EAAE,CAAC,CAChD,CAAC;YACxB,OAAO,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,KAAK,SAAS,CAAC,CAAC;SAC/D;aAAM;YACL,OAAO,EAAE,CAAC;SACX;KACF;IAED,mBAAmB,CAAC,MAAe;QACjC,MAAM,IAAI,GAAG,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC;QAC3C,OAAO,IAAI,CAAC,EAAE,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,MAAM,KACnD,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,GAAC,GAAG,CAAC,EAAE,CAAC,CACrE,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,KAAK,SAAS,CAAuB,CAAC;KACtD;IAED,YAAY,CAAC,MAAqB,EAAE,MAAqB,EAAE,YAAuC,EAAE;;QAClG,MAAM,WAAW,GAAG,MAAA,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,MAAM,0CAAE,WAAW,0CAAE,UAAU,CAAC,YAAY,CAAC,CAAC;QAC1E,MAAM,QAAQ,GAAG,WAAW,IAAI,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;QACrF,IAAI,SAAS,GAAG,IAAI,CAAC,EAAE,CAAC,KAAK,CAAC,uBAAuB,CAAC,QAAQ,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;QAC/E,IAAI,SAAS,EAAE;YACb,IAAI,WAAW,EAAE;gBACf,SAAS,GAAG,IAAI,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;aAC1F;iBAAM;;gBAEL,IAAI,MAAc,CAAC;gBACnB,QAAQ,MAAM,CAAC,eAAe;oBAC5B,KAAK,YAAY;wBACf,MAAM,GAAG,CAAC,GAAG,GAAG,CAAC;wBACjB,MAAM;oBACR,KAAK,YAAY;wBACf,MAAM,GAAG,CAAC,GAAG,IAAI,CAAC;wBAClB,MAAM;oBACR,KAAK,OAAO,CAAC;oBACb;wBACE,MAAM,GAAG,CAAC,CAAC;wBACX,MAAM;iBACT;gBACD,MAAM,KAAK,GAAG,CAAC,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,GAAG,IAAI,GAAG,GAAG,MAAM,GAAG,CAAC,CAAC,CAAC;gBACxG,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;aACxB;YACD,uBACE,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,EAAE,OAAO,EAAE,kBAAkB,EACjD,QAAQ,EAAE,MAAM,CAAC,QAAQ,EACzB,eAAe,EAAE,MAAM,CAAC,eAAe,EACvC,iBAAiB,EAAE,MAAM,CAAC,iBAAiB,EAC3C,eAAe,EAAE,MAAM,CAAC,eAAe,EACvC,UAAU,EAAE,WAAW,GAAG,MAAA,MAAM,CAAC,MAAM,0CAAE,IAAI,GAAG,SAAS,EACzD,cAAc,EAAE,WAAW,GAAG,MAAA,MAAM,CAAC,MAAM,0CAAE,YAAY,GAAG,SAAS,EACrE,eAAe,EAAE,SAAS,EAC1B,OAAO,EAAE,MAAM,CAAC,KAAK,IAClB,SAAS,EACZ;SACH;aAAM;YACL,OAAO,SAAS,CAAC;SAClB;KACF;IAED,QAAQ,CAAC,MAAe;QACtB,OAAO;YACL,GAAG,IAAI,CAAC,sBAAsB,CAAC,MAAM,CAAC;YACtC,GAAG,IAAI,CAAC,mBAAmB,CAAC,MAAM,CAAC;SACpC,CAAC;KACH;;;ACpMH,MAAM,UAAU,GAAG,mDAAmD,CAAC;AAEvE;AACO,MAAM,aAAa,GAAG,IAAI,GAAG,CAAC,CAAC,qDAAqD,EAAE,uDAAuD,EAAE,uDAAuD,EAAE,+CAA+C,EAAE,sDAAsD,EAAE,qDAAqD,EAAE,qDAAqD,EAAE,qDAAqD,EAAE,mDAAmD,EAAE,qDAAqD,EAAE,qDAAqD,EAAE,6CAA6C,EAAE,qDAAqD,EAAE,uDAAuD,EAAE,uDAAuD,EAAE,+CAA+C,EAAE,oDAAoD,EAAE,sDAAsD,EAAE,sDAAsD,EAAE,8CAA8C,EAAE,qDAAqD,EAAE,oDAAoD,EAAE,oDAAoD,EAAE,oDAAoD,EAAE,uDAAuD,EAAE,yDAAyD,EAAE,yDAAyD,EAAE,iDAAiD,EAAE,uDAAuD,EAAE,yDAAyD,EAAE,yDAAyD,EAAE,iDAAiD,EAAE,wDAAwD,EAAE,uDAAuD,EAAE,uDAAuD,EAAE,uDAAuD,EAAE,qDAAqD,EAAE,uDAAuD,EAAE,uDAAuD,EAAE,+CAA+C,EAAE,sDAAsD,EAAE,wDAAwD,EAAE,wDAAwD,EAAE,gDAAgD,EAAE,oDAAoD,EAAE,sDAAsD,EAAE,sDAAsD,EAAE,8CAA8C,EAAE,qDAAqD,EAAE,oDAAoD,EAAE,oDAAoD,EAAE,oDAAoD,EAAE,sDAAsD,EAAE,wDAAwD,EAAE,wDAAwD,EAAE,gDAAgD,EAAE,uDAAuD,EAAE,sDAAsD,EAAE,sDAAsD,EAAE,sDAAsD,EAAE,sDAAsD,EAAE,wDAAwD,EAAE,wDAAwD,EAAE,gDAAgD,EAAE,uDAAuD,EAAE,sDAAsD,EAAE,sDAAsD,EAAE,sDAAsD,EAAE,uDAAuD,EAAE,yDAAyD,EAAE,yDAAyD,EAAE,iDAAiD,EAAE,sDAAsD,EAAE,wDAAwD,EAAE,wDAAwD,EAAE,gDAAgD,EAAE,qDAAqD,EAAE,uDAAuD,EAAE,uDAAuD,EAAE,+CAA+C,EAAE,sDAAsD,EAAE,qDAAqD,EAAE,qDAAqD,EAAE,qDAAqD,EAAE,mDAAmD,EAAE,qDAAqD,EAAE,qDAAqD,EAAE,6CAA6C,EAAE,qDAAqD,EAAE,uDAAuD,EAAE,uDAAuD,EAAE,+CAA+C,EAAE,oDAAoD,EAAE,sDAAsD,EAAE,sDAAsD,EAAE,8CAA8C,EAAE,qDAAqD,EAAE,oDAAoD,EAAE,oDAAoD,EAAE,oDAAoD,EAAE,uDAAuD,EAAE,yDAAyD,EAAE,yDAAyD,EAAE,iDAAiD,EAAE,uDAAuD,EAAE,yDAAyD,EAAE,yDAAyD,EAAE,iDAAiD,EAAE,wDAAwD,EAAE,uDAAuD,EAAE,uDAAuD,EAAE,uDAAuD,EAAE,oDAAoD,EAAE,sDAAsD,EAAE,sDAAsD,EAAE,8CAA8C,EAAE,qDAAqD,EAAE,oDAAoD,EAAE,oDAAoD,EAAE,oDAAoD,EAAE,sDAAsD,EAAE,wDAAwD,EAAE,wDAAwD,EAAE,gDAAgD,EAAE,uDAAuD,EAAE,sDAAsD,EAAE,sDAAsD,EAAE,sDAAsD,CAAC,CAAC,CAAC;AACh7N;AACO,MAAM,UAAU,GAAG,EAAE,iBAAiB,EAAE,sCAAsC,EAAE,iBAAiB,EAAE,sCAAsC,EAAE,iBAAiB,EAAE,sCAAsC,EAAE,iBAAiB,EAAE,sCAAsC,EAAE,iBAAiB,EAAE,sCAAsC,EAAE,iBAAiB,EAAE,sCAAsC,EAAE,iBAAiB,EAAE,sCAAsC,EAAE,iBAAiB,EAAE,sCAAsC,EAAE,iBAAiB,EAAE,sCAAsC,EAAE,iBAAiB,EAAE,sCAAsC,EAAE,iBAAiB,EAAE,sCAAsC,EAAE,iBAAiB,EAAE,sCAAsC,EAAE,iBAAiB,EAAE,sCAAsC,EAAE,iBAAiB,EAAE,sCAAsC,EAAE,iBAAiB,EAAE,sCAAsC,EAAE,iBAAiB,EAAE,sCAAsC,EAAE,iBAAiB,EAAE,sCAAsC,EAAE,iBAAiB,EAAE,sCAAsC,EAAE,iBAAiB,EAAE,sCAAsC,EAAE,iBAAiB,EAAE,sCAAsC,EAAE,iBAAiB,EAAE,sCAAsC,EAAE,iBAAiB,EAAE,sCAAsC,EAAE,iBAAiB,EAAE,sCAAsC,EAAE,iBAAiB,EAAE,sCAAsC,EAAE,iBAAiB,EAAE,sCAAsC,EAAE,iBAAiB,EAAE,sCAAsC,EAAE,iBAAiB,EAAE,sCAAsC,EAAE,iBAAiB,EAAE,sCAAsC,EAAE,iBAAiB,EAAE,sCAAsC,EAAE,iBAAiB,EAAE,sCAAsC,EAAE,iBAAiB,EAAE,sCAAsC,EAAE,iBAAiB,EAAE,sCAAsC,EAAE,iBAAiB,EAAE,sCAAsC,EAAE,iBAAiB,EAAE,sCAAsC,EAAE,iBAAiB,EAAE,sCAAsC,EAAE,iBAAiB,EAAE,sCAAsC,EAAE,iBAAiB,EAAE,sCAAsC,EAAE,iBAAiB,EAAE,sCAAsC,EAAE,iBAAiB,EAAE,sCAAsC,EAAE,CAAC;AAE1xE;AACA,MAAM,kBAAkB,GAA+B;IACrD,sCAAsC,EAAE,UAAU;IAClD,sCAAsC,EAAE,aAAa;IACrD,sCAAsC,EAAE,aAAa;IACrD,sCAAsC,EAAE,kBAAkB;IAC1D,sCAAsC,EAAE,gBAAgB;IACxD,sCAAsC,EAAE,cAAc;IACtD,sCAAsC,EAAE,sBAAsB;IAC9D,sCAAsC,EAAE,WAAW;CACpD,CAAC;AAEF,MAAM,cAAc,GAAG;IACrB,OAAO,EAAE,4CAA4C;IACrD,QAAQ,EAAE,4CAA4C;IACtD,GAAG,EAAE,sBAAsB;IAC3B,IAAI,EAAE,uCAAuC;IAE7C,KAAK,EAAE,YAAY;IACnB,WAAW,EAAE,cAAc;IAC3B,IAAI,EAAE;QACJ,KAAK,EAAE,cAAc;QACrB,OAAO,EAAE,KAAK;KACf;IACD,OAAO,EAAE;QACP,UAAU,EAAE,WAAW;KACxB;IACD,QAAQ,EAAE;QACR,KAAK,EAAE,oBAAoB;QAC3B,OAAO,EAAE,KAAK;KACf;IACD,QAAQ,EAAE;QACR,KAAK,EAAE,aAAa;QACpB,OAAO,EAAE,KAAK;KACf;;IAED,YAAY,EAAE;QACZ,KAAK,EAAE,oBAAoB;QAC3B,OAAO,EAAE,KAAK;KACf;IACD,aAAa,EAAE;QACb,KAAK,EAAE,mBAAmB;QAC1B,OAAO,EAAE,KAAK;KACf;IACD,aAAa,EAAE;QACb,KAAK,EAAE,oBAAoB;QAC3B,OAAO,EAAE,KAAK;KACf;IACD,SAAS,EAAE;QACT,KAAK,EAAE,eAAe;KACvB;CACF,CAAC;AAEF;;;;;;SAMgB,sBAAsB,CAAC,IAAa,EAAE,SAAS,GAAG,EAAE,EAAE,SAAS,GAAG,EAAE,EAAE,YAAqB,EAAE,KAAK,GAAG,KAAK;IACxH,MAAM,OAAO,GAAI,GAAG,CAAC,IAAI,EAAE,WAAW,EAAE,EAAE,CAAgB;SACvD,GAAG,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,EAAE,SAAS,EAAE,EAAE,CAAa,CAAC;SAC3C,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,KAAM,CAAC,CAAC,MAAM,CAAY,CAAC,aAAa,CAAC,CAAC,CAAC,MAAM,CAAW,CAAC,CAAC,CAAC;IAE5E,MAAM,WAAW,GAA8B,EAAE,CAAC;IAClD,MAAM,WAAW,GAAgB,OAAO,CAAC,GAAG,CAAC,CAAC,IAC5C,IAAI,iBAAiB,CAAC,CAAC,EAAE,SAAS,EAAE,SAAS,EAAE,YAAY,CAAC,CAAC,QAAQ,EAAE,CACxE,CAAC;IACF,KAAK,MAAM,KAAK,IAAI,WAAW,EAAE;QAC/B,MAAM,OAAO,GAAG,KAAK,CAAC,KAAK,CAAW,CAAC;QACvC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE;YACzB,WAAW,CAAC,OAAO,CAAC,GAAG,KAAK,CAAC;SAC9B;aAAM;YACL,MAAM,OAAO,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC,OAAsB,CAAC;YAC5D,OAAO,CAAC,IAAI,CAAE,KAAK,CAAC,OAAuB,CAAC,CAAC,CAAC,CAAC,CAAC;SACjD;KACF;IACD,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;IAE1C,IAAI,KAAK,EAAE;QACT,WAAW,CAAC,MAAM,CAAC,CAAC;QACpB,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,qBAAO,UAAU,EAAE,cAAc,IAAK,CAAC,EAAG,CAAC,CAAC,CAAC;KACtE;IAED,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC;AAC1D,CAAC;AAED,SAAS,WAAW,CAAC,MAAmB;IACtC,IAAI,QAAQ,GAAgB,EAAE,CAAC;IAC/B,IAAI,OAAO,GAAG,CAAC,CAAC;IAChB,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,MAAM,CAAC,CAAC,IAAK,CAAC,CAAC,OAAc,CAAC,MAAM,GAAG,CAAC,CAAC,EAAE;QACpE,MAAM,OAAO,GAAG,KAAK,CAAC,OAAsB,CAAC;QAC7C,KAAK,IAAI,CAAC,GAAC,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YACrC,MAAM,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK,CAAW,CAAC;YAC5C,QAAQ,GAAG,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,QAAuB,CAAC,CAAC;YAC/D,KAAK,MAAM,OAAO,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC,QAAuB,EAAE;gBACxD,QAAQ,GAAG,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,QAAuB,CAAC,CAAC;aAC7D;YACD,KAAK,IAAI,CAAC,GAAC,CAAC,GAAC,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;gBACvC,MAAM,QAAQ,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,QAAuB,CAAC;gBACpD,IAAI,QAAQ,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,KAAK,OAAO,CAAC,EAAE;oBAC5C,OAAO,CAAC,CAAC,CAAC,CAAC,QAAQ,GAAG,IAAI,CAAC;oBAC3B,OAAO,EAAE,CAAC;iBACX;aACF;SACF;QACD,KAAK,CAAC,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,KAAK,IAAI,CAAC,CAAC;KAC1D;IACD,IAAI,OAAO,GAAG,CAAC,EAAE;QACf,OAAO,CAAC,GAAG,CAAC,KAAK,OAAO,gCAAgC,CAAC,CAAC;KAC3D;AACH,CAAC;MAEY,iBAAiB;IAmB5B,YAAmB,IAAc,EAAE,SAAS,GAAG,EAAE,EAAE,SAAS,GAAG,EAAE,EAAE,YAAqB;;QAArE,SAAI,GAAJ,IAAI,CAAU;QAlBjC,QAAG,GAAG,KAAK,CAAC;QAIZ,aAAO,GAAG,QAAQ,CAAC;QAKnB,gBAAW,GAAG,cAAc,CAAC;QAU3B,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC;QACzC,IAAI,UAAU,KAAK,QAAQ,EAAE;YAC3B,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC;YAChB,OAAO;SACR;QACD,MAAM,SAAS,IAAI,IAAI,CAAC,IAAI,CAAC,SAAS,IAAI,EAAE,CAAe,CAAC;QAC5D,MAAM,WAAW,IAAI,IAAI,CAAC,IAAI,CAAC,WAAW,IAAI,EAAE,CAAe,CAAC;QAEhE,MAAM,KAAK,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,WAAW,KAAK,OAAO,CAAa,CAAC;QACzE,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;QAC7C,MAAM,WAAW,GAAG,IAAI,CAAC,cAAc,CAAC,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;QAC1D,IAAI,CAAC,WAAW,EAAE;YAChB,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC;SACjB;aAAM;YACL,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC;SACjC;QAED,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,UAAoB,CAAC,EAAE;YAClD,kBAAkB,CAAC,IAAI,CAAC,UAAoB,CAAC,GAAG,IAAI,CAAC,UAAoB,CAAC;SAC3E;QAED,MAAM,WAAW,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,uBAAiC,CAAC,CAAC,kBAAkB,EAAE,CAAC;QAC1F,MAAM,SAAS,GAAG,kBAAkB,CAAC,IAAI,CAAC,UAAoB,CAAC,IAAI,IAAI,CAAC,UAAoB,CAAC;QAC7F,MAAM,OAAO,GAAG,IAAI,CAAC,2BAA2B,CAAC;QAEjD,IAAI,CAAC,KAAK,CAAC,GAAG,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC;QACrC,IAAI,CAAC,KAAK,GAAG,cAAc,WAAW,KAAK,OAAO,KAAK,SAAS,EAAE,CAAC;QACnE,IAAI,CAAC,IAAI,GAAG,GAAG,SAAS,iBAAiB,IAAI,CAAC,IAAI,EAAE,CAAC;QAErD,MAAM,aAAa,GAA8B,EAAE,CAAC;QACpD,MAAM,QAAQ,GAAgB,EAAE,CAAC;QACjC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,MAAM,QAAQ,GAAgB,EAAE,CAAC;QACjC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QAEzB,KAAK,MAAM,UAAU,IAAI,WAAW,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,WAAW,KAAK,QAAQ,CAAC,EAAE;YAC5E,MAAM,OAAO,GAAG,IAAI,CAAC,UAAU,CAAC,UAAU,EAAE,IAAI,EAAE,SAAS,CAAC,CAAC;YAE7D,MAAM,SAAS,GAAG,UAAU,CAAC,aAAuB,CAAC;YACrD,aAAa,CAAC,SAAS,CAAC,GAAG,OAAO,CAAC;YACnC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YACvB,OAAO,CAAC,cAAc,GAAG,MAAA,OAAO,CAAC,cAAc,mCAAI,QAAQ,CAAC,MAAM,CAAC;SACpE;QACD,KAAK,MAAM,UAAU,IAAI,WAAW,EAAE;YACpC,IAAI,UAAU,CAAC,WAAW,KAAK,SAAS,EAAE;gBACxC,MAAM,OAAO,GAAG,IAAI,CAAC,UAAU,CAAC,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,YAAY,CAAC,CAAC;gBAEhF,MAAM,SAAS,GAAG,GAAG,CAAC,UAAU,EAAE,CAAC,iBAAiB,EAAE,UAAU,EAAE,WAAW,CAAC,CAAW,CAAC;gBAC1F,IAAI,aAAa,CAAC,SAAS,CAAC,EAAE;oBAC5B,MAAC,aAAa,CAAC,SAAS,CAAC,CAAC,QAAqB,0CAAE,IAAI,CAAC,OAAO,CAAC,CAAC;iBAChE;qBAAM;oBACL,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;iBACxB;aACF;SACF;QAED,MAAM,GAAG,GAAa,WAAW,aAAX,WAAW,cAAX,WAAW,GAAI,EAAE,CAAC;QACxC,MAAM,IAAI,GAAG,GAAG,GAAG,CAAC,WAAW,MAAM,GAAG,CAAC,WAAW,MAAM,GAAG,CAAC,WAAW,IAAI,GAAG,CAAC,eAAe,EAAE,CAAC;QACnG,IAAI,CAAC,aAAa,GAAG,GAAG,CAAC,WAAqB,IAAI,QAAQ,CAAC,MAAM,CAAC;QAClE,MAAM,KAAK,GAAG,UAAU,CACtB,CAAC,GAAG,CAAC,eAAyB;aAC3B,CAAC,GAAG,CAAC,WAAqB,IAAI,CAAC,IAAI,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,aAAa,EAAE,CAAC,CAAC,CAAC;aACnE,OAAO,CAAC,CAAC,CAAC,CACd,CAAC;QACF,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC;QAC1B,MAAM,MAAM,GAAG,GAAG,CAAC,eAAyB,IAAI,YAAY,CAAC;QAC7D,IAAI,CAAC,aAAa,GAAG,MAAM,CAAC;QAE5B,IAAI,CAAC,WAAW,GAAG,GAAG,IAAI,KAAK,KAAK,IAAI,MAAM,KAAK,IAAI,CAAC,aAAa,KAAK,IAAI,CAAC,aAAa,WAAW,CAAC;QAExG,QAAQ,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,KAAK;YAC9B,OAAO,CAAC,WAAW,GAAG,GAAG,GAAG,CAAC,WAAW,MAAM,GAAG,CAAC,WAAW,MAAM,KAAK,IAAI,MAAM,KAAK,KAAK,IAAI,MAAM,KAAK,OAAO,CAAC,WAAW,EAAE,CAAC;YACjI,OAAO,CAAC,cAAc,GAAG,KAAK,GAAG,CAAC,CAAC;SACpC,CAAC,CAAC;KACJ;IAED,UAAU,CAAC,OAAiB,EAAE,IAAc,EAAE,SAAiB;QAC7D,MAAM,WAAW,GAAG,IAAI,IAAI,CAAC,OAAO,CAAC,uBAAiC,CAAC,CAAC,kBAAkB,EAAE,CAAC;QAC7F,MAAM,SAAS,GAAG,kBAAkB,CAAC,OAAO,CAAC,UAAoB,CAAC,IAAI,OAAO,CAAC,UAAoB,CAAC;QACnG,MAAM,OAAO,GAAG,OAAO,CAAC,2BAA2B,CAAC;QAEpD,OAAO;YACL,KAAK,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI;YAChC,OAAO,EAAE,QAAQ;YACjB,KAAK,EAAE,cAAc,WAAW,KAAK,OAAO,KAAK,SAAS,EAAE;YAC5D,WAAW,EAAE,GAAG,IAAI,CAAC,aAAa,EAAE;YACpC,IAAI,EAAE,GAAG,SAAS,iBAAiB,OAAO,CAAC,IAAI,EAAE;YAEjD,WAAW,EAAE,gBAAgB;YAC7B,cAAc,EAAE,CAAC;YAEjB,OAAO,EAAE,EAAE;YACX,QAAQ,EAAE,EAAE;SACb,CAAC;KACH;IAED,UAAU,CAAC,OAAiB,EAAE,SAAS,GAAG,EAAE,EAAE,SAAS,GAAG,EAAE,EAAE,YAAqB;;QACjF,MAAM,WAAW,GAAG,IAAI,IAAI,CAAC,OAAO,CAAC,uBAAiC,CAAC,CAAC,kBAAkB,EAAE,CAAC;QAC7F,MAAM,SAAS,GAAG,kBAAkB,CAAC,OAAO,CAAC,UAAoB,CAAC,IAAI,OAAO,CAAC,UAAoB,CAAC;QACnG,MAAM,OAAO,GAAG,OAAO,CAAC,2BAA2B,CAAC;QAEpD,MAAM,KAAK,GAAG;YACZ,GAAG,OAAO,CAAC,UAAsB;YACjC,GAAG,CAAC,OAAO,EAAE,CAAC,iBAAiB,EAAE,UAAU,EAAE,YAAY,CAAC,EAAE,EAAE,CAAC;SAChE,CAAC;QACF,MAAM,WAAW,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE,CAAC;QAElD,IAAI,UAAkB,CAAC;QACvB,IAAI,SAAS,GAAG,8BAA8B,CAAC;QAC/C,IAAI,WAAW,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE;YACrC,UAAU,GAAG,KAAK,CAAC;YACnB,SAAS,GAAG,+BAA+B,CAAC;SAC7C;aAAM,IAAI,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE;YAC3C,UAAU,GAAG,IAAI,CAAC;YAClB,SAAS,GAAG,iCAAiC,CAAC;SAC/C;aAAM,IAAI,WAAW,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE;YAC9C,UAAU,GAAG,OAAO,CAAC;YACrB,SAAS,GAAG,oCAAoC,CAAC;SAClD;aAAM,IAAI,WAAW,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE;YAC5C,UAAU,GAAG,KAAK,CAAC;YACnB,SAAS,GAAG,kCAAkC,CAAC;SAChD;aAAM,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE;YACnF,UAAU,GAAG,IAAI,CAAC;YAClB,SAAS,GAAG,8BAA8B,CAAC;SAC5C;aAAM,IAAI,WAAW,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE;YAC9C,UAAU,GAAG,OAAO,CAAC;SACtB;aAAM,IAAI,WAAW,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE;YAC5C,UAAU,GAAG,KAAK,CAAC;SACpB;aAAM;YACL,UAAU,GAAG,OAAO,CAAC;SACtB;QACD,SAAS,GAAG,MAAA,IAAI,CAAC,mBAAmB,CAAC,OAAO,EAAE,SAAS,EAAE,YAAY,CAAC,mCAAI,SAAS,CAAC;QAEpF,OAAO;YACL,KAAK,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI;YAChC,OAAO,EAAE,SAAS;YAClB,KAAK,EAAE,cAAc,WAAW,KAAK,OAAO,KAAK,SAAS,EAAE;YAC5D,WAAW,EAAE,qBAAqB,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;YACpD,IAAI,EAAE,GAAG,SAAS,kBAAkB,OAAO,CAAC,IAAI,EAAE;YAClD,UAAU;YACV,SAAS;SACV,CAAC;KACH;IAED,mBAAmB,CAAC,OAAiB,EAAE,SAAiB,EAAE,YAAqB;QAC7E,IAAI,OAAO,CAAC,cAAc,EAAE;YAC1B,MAAM,aAAa,GAAG,OAAO,CAAC,cAA0B,CAAC;YACzD,OAAO,GAAG,SAAS,IAAI,aAAa,CAAC,SAAS,IAAI,aAAa,CAAC,QAAQ,EAAE,IAAI,YAAY,GAAG,UAAU,YAAY,EAAE,GAAG,EAAE,CAAC,CAAC;SAC7H;aAAM,IAAI,OAAO,CAAC,UAAU,KAAK,sCAAsC,EAAE;YACxE,MAAM,KAAK,GAAI,GAAG,CAAC,OAAO,EAAE,gBAAgB,EAAE,EAAE,CAA4B;iBACzE,MAAM,CAAC,CAAC,IAAI,yBAAyB,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;iBACvD,MAAM,CAAC,CAAC,IAAI,CAAC,sCAAsC,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;iBACrE,MAAM,CAAC,CAAC,IAAI,aAAa,CAAC,GAAG,CAC5B,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,UAAU,EAAE,gBAAgB,CAAC,CACvF,CAAC;iBACD,GAAG,CAAC,CAAC,IAAI,GAAG,SAAS,IAAI,OAAO,CAAC,IAAI,IAAI,CAAC,CAAC,QAAQ,EAAE,IAAI,YAAY,GAAG,UAAU,YAAY,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC;YAE3G,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE;gBACpB,MAAM,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,UAAU,EAAE,gBAAgB,CAAC,CAAC;gBACnG,IAAI,aAAa,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE;oBAC5B,OAAO,wCAAwC,KAAK,EAAE,CAAC;iBACxD;aACF;SACF;aAAM,IAAI,OAAO,CAAC,UAAU,KAAK,sCAAsC,EAAE;YACxE,MAAM,KAAK,GAAG,UAAU,CAAC,OAAO,CAAC,SAAmB,CAAC,CAAC;YACtD,IAAI,KAAK,EAAE;gBACT,OAAO,iCAAiC,KAAK,EAAE,CAAC;aACjD;SACF;QACD,OAAO,SAAS,CAAC;KAClB;IAED,QAAQ,CAAC,KAAe,EAAE,SAAiB;QACzC,MAAM,gBAAgB,GAAG,CAAC,KAAK,CAAC,WAAqB,IAAI,EAAE,EAAE,WAAW,EAAE,CAAC;QAC3E,IAAI,GAAkC,CAAC;QACvC,IAAI,gBAAgB,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE;YACvC,GAAG,GAAG,QAAQ,CAAC;SAChB;aAAM,IAAI,gBAAgB,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE;YAC5C,GAAG,GAAG,MAAM,CAAC;SACd;QACD,MAAM,QAAQ,GAAG,gBAAgB,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;QACxD,IAAI,GAAuB,CAAC;QAC5B,IAAI,QAAQ,EAAE;YACZ,GAAG,GAAG,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;SAC7B;QACD,IAAI,GAAuB,CAAC;QAC5B,KAAK,MAAM,EAAE,IAAI,GAAG,CAAC,KAAK,EAAE,2BAA2B,EAAE,GAAG,CAAC,KAAK,EAAE,4BAA4B,EAAE,EAAE,CAAC,CAAe,EAAE;YACpH,IAAI,EAAE,CAAC,cAAc,KAAK,iBAAiB,IAAI,EAAE,CAAC,cAAc,KAAK,QAAQ,EAAE;gBAC7E,GAAG,GAAG,QAAQ,CAAC;aAChB;iBAAM,IAAI,EAAE,CAAC,cAAc,KAAK,kBAAkB,IAAI,EAAE,CAAC,cAAc,KAAK,MAAM,EAAE;gBACnF,GAAG,GAAG,MAAM,CAAC;aACd;iBAAM,IAAI,EAAE,CAAC,cAAc,KAAK,2BAA2B,IAAI,EAAE,CAAC,cAAc,KAAK,KAAK,EAAE;gBAC3F,GAAG,GAAG,QAAQ,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC;aAC/B;iBAAM,IAAI,EAAE,CAAC,cAAc,KAAK,iBAAiB,EAAE;gBAClD,GAAG,GAAG,QAAQ,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC;aAC/B;SACF;QACD,IAAI,KAAK,GAAG,EAAE,CAAC;QACf,IAAI,GAAG,IAAI,GAAG,EAAE;YACd,KAAK,IAAI,GAAG,GAAG,SAAS,GAAG,EAAE,CAAC;YAC9B,IAAI,GAAG,EAAE;gBACP,KAAK,IAAI,SAAS,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC;aACpC;SACF;QAED,MAAM,WAAW,GAAG,IAAI,IAAI,CAAC,KAAK,CAAC,uBAAiC,CAAC,CAAC,kBAAkB,EAAE,CAAC;QAC3F,MAAM,SAAS,GAAG,kBAAkB,CAAC,KAAK,CAAC,UAAoB,CAAC,IAAI,KAAK,CAAC,UAAoB,CAAC;QAC/F,MAAM,OAAO,GAAG,KAAK,CAAC,2BAA2B,CAAC;QAElD,OAAO;YACL,KAAK,EAAE,UAAU,GAAG,KAAK,CAAC,IAAI;YAC9B,OAAO,EAAE,OAAO;YAChB,KAAK;YACL,WAAW,EAAE,WAAW,WAAW,KAAK,OAAO,KAAK,SAAS,EAAE;YAC/D,IAAI,EAAE,GAAG,SAAS,gBAAgB,KAAK,CAAC,IAAI,EAAE;YAE9C,GAAG;YACH,GAAG;YACH,GAAG;YAEH,eAAe,EAAE,QAAQ;YACzB,aAAa,EAAE,SAAS;YACxB,aAAa,EAAE,KAAK,CAAC,UAAoB;YAEzC,OAAO,EAAE,EAAE;SACZ,CAAC;KACH;IAED,cAAc,CAAC,IAAc,EAAE,KAAgB;;QAC7C,IAAI,aAAoC,CAAC;QACzC,IAAI,WAAW,GAAG,IAAI,CAAC,YAAwB,CAAC;QAChD,IAAI,WAAW,EAAE;;YAEf,IAAI,OAAO,WAAW,KAAK,QAAQ,EAAE;gBACnC,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,WAAqB,CAAa,CAAC;aAC7D;YACD,IAAI,WAAW,CAAC,YAAY,EAAE;gBAC5B,OAAO,CAAC,GAAG,CAAC,oCAAoC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;aAC9D;iBAAM,IAAK,WAA4C,CAAC,KAAK,CAAC,EAAE;;gBAE/D,aAAa,GAAG,WAAmC,CAAC;aACrD;SACF;QACD,IAAI,aAAa,EAAE;;YAEjB,MAAM,MAAM,GAAW,MAAA,GAAG,CAAC,aAAa,EAAE,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC,mCAAI,EAAE,CAAC;YACzE,IAAI,MAAM,CAAC,UAAU,CAAC,+CAA+C,CAAC,EAAE;gBACtE,IAAI,KAAK,CAAC,GAAG,KAAK,MAAM,EAAE;oBACxB,GAAG,CAAC,aAAa,EAAE,CAAC,WAAW,EAAE,QAAQ,CAAC,EAAE,MAAM,CAAC,OAAO,CAAC,aAAa,EAAE,cAAc,CAAC,CAAC,CAAC;iBAC5F;qBAAM;oBACL,GAAG,CAAC,aAAa,EAAE,CAAC,WAAW,EAAE,QAAQ,CAAC,EAAE,MAAM,CAAC,OAAO,CAAC,aAAa,EAAE,cAAc,CAAC,CAAC,CAAC;iBAC5F;aACF;iBAAM,IAAI,MAAM,KAAK,iDAAiD,IAAI,MAAM,KAAK,kDAAkD,EAAE;gBACxI,IAAI,KAAK,CAAC,GAAG,KAAK,MAAM,EAAE;oBACxB,GAAG,CAAC,aAAa,EAAE,CAAC,WAAW,EAAE,QAAQ,CAAC,EAAE,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC,GAAG,QAAQ,CAAC,CAAC;iBACvF;qBAAM;oBACL,GAAG,CAAC,aAAa,EAAE,CAAC,WAAW,EAAE,QAAQ,CAAC,EAAE,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC,GAAG,QAAQ,CAAC,CAAC;iBACvF;aACF;SACF;QACD,OAAO,aAAa,CAAC;KACtB;IAED,cAAc;QACZ,OAAO,IAAI,mBAAM,IAAI,GAAI,CAAC,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC,CAAyB,CAAC;KAC5E;IAED,QAAQ;QACN,uCAAY,IAAI,CAAC,KAAK,KAAE,OAAO,EAAE,CAAC,IAAI,CAAC,cAAc,EAAE,CAAC,IAAG;KAC5D;;;AC9YH;AACA,MAAM,4BAA4B,GAAG,GAAG,CAAC;AAEzC,MAAM,oBAAoB,GAAG;IAC3B,MAAM,EAAE,aAAa;IACrB,YAAY,EAAE,YAAY;IAC1B,yBAAyB,EAAE,6BAA6B;IACxD,uBAAuB;IACvB,uBAAuB;IACvB,oDAAoD;IACpD,gDAAgD;IAChD,qDAAqD;IACrD,iDAAiD;IACjD,mCAAmC;IACnC,sBAAsB;IACtB,sBAAsB;IACtB,uCAAuC;IACvC,gBAAgB;IAChB,yBAAyB;IACzB,gDAAgD;IAChD,qCAAqC;IACrC,wBAAwB;IACxB,wBAAwB;IACxB,yCAAyC;IACzC,kBAAkB;IAClB,wBAAwB;IACxB,iDAAiD;IACjD,4BAA4B;IAC5B,qCAAqC;IACrC,cAAc,EAAE,eAAe;CAChC,CAAC;AAEF,MAAM,wBAAwB,GAAY;IACxC,MAAM,EAAE;QACN,KAAK,EAAE,cAAc;KACtB;CACF,CAAC;AAEF,SAAS,mBAAmB,CAAC,KAAc;IACzC,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;IAE9B,OAAO,CAAC,MAAM,CAAC,cAAc,EAAE,kBAAkB,CAAC,CAAC;IACnD,IAAI,KAAK,EAAE;QACT,OAAO,CAAC,MAAM,CAAC,eAAe,EAAE,UAAU,KAAK,EAAE,CAAC,CAAC;KACpD;IAED,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,SAAS,gBAAgB,CAAC,IAAY,EAAE,IAAY,EAAE,KAAe;IACnE,MAAM,OAAO,GAAG;QACd,OAAO,EAAE,IAAI;QACb,IAAI;QACJ,IAAI;QACJ,aAAa,EAAE,CAAC,GAAG,CAAC;QACpB,aAAa,EAAE,EAAE;QACjB,eAAe,EAAE,EAAE;QACnB,KAAK,EAAE,KAAK,aAAL,KAAK,cAAL,KAAK,GAAI,wBAAwB;QACxC,OAAO,EAAE;YACP,QAAQ,EAAE,oBAAoB;SAC/B;KACF,CAAC;IAEF,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;AACjC,CAAC;AAED,SAAe,eAAe,CAC5B,GAAW,EAAE,IAAkB;;QAE/B,IAAI;YACF,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;YACnC,OAAO,GAAG,CAAC,EAAE,IAAI,MAAM,GAAG,CAAC,IAAI,EAAE,IAAI,SAAS,CAAC;SAChD;QAAC,OAAO,MAAM,EAAE;YACf,OAAO,SAAS,CAAC;SAClB;KACF;CAAA;AAED,SAAe,WAAW,CACxB,GAAW,EAAE,KAAc,EAAE,KAAe;;QAE5C,MAAM,WAAW,GAAG,4BAA4B,CAAC;QACjD,MAAM,OAAO,GAAG,mBAAmB,CAAC,KAAK,CAAC,CAAC;QAC3C,MAAM,IAAI,GAAG,gBAAgB,CAAC,CAAC,EAAE,WAAW,EAAE,KAAK,CAAC,CAAC;QACrD,MAAM,WAAW,GAAG,MAAM,eAAe,CAAC,GAAG,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;QAClF,IAAI,CAAC,WAAW,EAAE;YAChB,OAAO,SAAS,CAAC;SAClB;QAED,MAAM,UAAU,GAAG,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC;QAChD,IAAI,UAAU,IAAI,WAAW,EAAE;YAC7B,OAAO,WAAW,CAAC;SACpB;QAED,MAAM,QAAQ,GAA4C,EAAE,CAAC;QAC7D,KAAK,IAAI,IAAI,GAAG,WAAW,EAAE,IAAI,GAAG,UAAU,EAAE,IAAI,IAAI,WAAW,EAAE;YACnE,QAAQ,CAAC,IAAI,CAAC,eAAe,CAAC,GAAG,EAAE;gBACjC,MAAM,EAAE,MAAM;gBACd,OAAO;gBACP,IAAI,EAAE,gBAAgB,CAAC,IAAI,EAAE,WAAW,EAAE,KAAK,CAAC;aACjD,CAAC,CAAC,CAAC;SACL;QAED,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QAC5C,IAAI,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,EAAE;YAC7B,OAAO,SAAS,CAAC;SAClB;QAED,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,GAAG,IAAI,GAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACjD,uCACK,WAAW,KACd,IAAI,kCACC,WAAW,CAAC,IAAI,KACnB,IAAI,EAAE,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC,OAE9C;KACH;CAAA;AAED;;;;;;;;;;;SAWsB,YAAY,CAChC,OAAe,EAAE,WAAoC,EACrD,KAAe,EAAE,YAAqB,EAAE,SAAS,GAAG,EAAE,EAAE,SAAS,GAAG,EAAE;;QAEtE,IAAI,UAAwC,CAAC;QAC7C,IAAI,WAAW,KAAK,QAAQ,EAAE;YAC5B,UAAU,GAAG,MAAM,eAAe,CAAC,OAAO,CAAC,CAAC;SAC7C;aAAM,IAAI,WAAW,KAAK,YAAY,EAAE;YACvC,UAAU,GAAG,MAAM,WAAW,CAAC,OAAO,EAAE,YAAY,EAAE,KAAK,CAAC,CAAC;SAC9D;QAED,IAAI,UAAU,EAAE;YACd,OAAO,sBAAsB,CAAC,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,YAAY,CAAC,CAAC;SAC/E;aAAM;YACL,OAAO,CAAC,IAAI,CAAC,kBAAkB,OAAO,iBAAiB,CAAC,CAAC;YACzD,OAAO,SAAS,CAAC;SAClB;KACF;CAAA;AAED;;;;;;;SAOsB,oBAAoB,CACxC,KAAY,EAAE,OAAe,EAAE,WAAoC,EAAE,YAAqB,EAAE,SAAS,GAAG,EAAE,EAAE,SAAS,GAAG,EAAE;;QAE1H,MAAM,UAAU,GAAG,MAAM,YAAY,CAAC,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,YAAY,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC;QAC3G,IAAI,UAAU,EAAE;YACd,MAAM,gBAAgB,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC;SAC3C;KACF;;;AClLD;AAOA,SAAS,UAAU,CAAC,KAAY,EAAE,GAAgB,EAAE,SAAiB;IACnE,MAAM,OAAO,GAAG,IAAI,GAAG,EAAU,CAAC;IAClC,KAAK,MAAM,EAAE,IAAI,GAAG,EAAE;QACpB,KAAK,MAAM,IAAI,IAAI,SAAS,CAAC,KAAK,EAAE,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE;YAC9D,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;SAC7B;KACF;IACD,OAAO,OAAO,CAAC;AACjB,CAAC;AAED;;;;;;;SAOgB,mBAAmB,CAAC,GAAgB,EAAE,KAAY;IAChE,MAAM,MAAM,GAAG,UAAU,CAAC,KAAK,EAAE,GAAG,EAAE,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IACvD,MAAM,OAAO,GAAG,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC;IAElE,MAAM,YAAY,GAAG,IAAI,GAAG,EAAU,CAAC;IACvC,KAAK,MAAM,EAAE,IAAI,GAAG,EAAE;QACpB,KAAK,MAAM,IAAI,IAAI,SAAS,CAAC,KAAK,EAAE,EAAE,EAAE,MAAM,CAAC,aAAa,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE;YACzE,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;SACnC;KACF;IAED,MAAM,cAAc,GAAG,UAAU,CAAC,KAAK,EAAE,YAAY,EAAE,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IAC3E,MAAM,cAAc,GAAG,IAAI,GAAG,CAAS;QACrC,GAAG,UAAU,CAAC,KAAK,EAAE,YAAY,EAAE,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC;QACtD,GAAG,UAAU,CAAC,KAAK,EAAE,cAAc,EAAE,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC;KACzD,CAAC,CAAC;IAEH,MAAM,OAAO,GAA8B;QACzC,uBAAuB,EAAE,OAAO,CAAC,IAAI;QACrC,MAAM,EAAE,MAAM,CAAC,IAAI;QACnB,eAAe,EAAE,YAAY,CAAC,IAAI;QAClC,iBAAiB,EAAE,cAAc,CAAC,IAAI;QACtC,iBAAiB,EAAE,cAAc,CAAC,IAAI;KACvC,CAAC;IAEF,OAAO,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC;AAC7E,CAAC;AAED;;;;;;SAMgB,yBAAyB,CAAC,KAAY;IACpD,MAAM,KAAK,GAAG,IAAI,GAAG,EAAU,CAAC;IAChC,KAAK,MAAM,IAAI,IAAI,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,MAAM,CAAC,UAAU,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE;QACxE,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;KAC9B;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,CAAC;AAClC,CAAC;AAED;;;;;;SAMgB,gBAAgB,CAAC,KAAY;IAC3C,MAAM,KAAK,GAAG,IAAI,GAAG,EAAU,CAAC;IAChC,KAAK,MAAM,IAAI,IAAI,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,MAAM,CAAC,YAAY,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE;QAC1E,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;KAC9B;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,CAAC;AAClC;;ACpEA,MAAM,uBAAuB,GAAG;IAC9B,CAAC,GAAG,CAAC,aAAa,CAAC,WAAW,CAAC,EAAE,GAAG,GAAG;IACvC,CAAC,GAAG,CAAC,aAAa,CAAC,WAAW,CAAC,EAAE,GAAG,GAAG;IACvC,CAAC,GAAG,CAAC,aAAa,CAAC,WAAW,CAAC,EAAE,GAAG,GAAG;CACxC,CAAC;AAEF,SAAS,0BAA0B,CAAC,KAAY,EAAE,GAAW;IAC3D,MAAM,IAAI,GAAG,eAAe,CAAsC,KAAK,EAAE,GAAG,EAAE,YAAY,EAAE,uBAAuB,CAAC,CAAC;IACrH,OAAO,CAAE,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAE,CAAC;AACpC,CAAC;SAEe,sBAAsB,CAAC,KAAY,EAAE,KAAsB,EAAE,SAAiB,EAAE,SAAiB;IAC/G,MAAM,MAAM,GAAG,KAAK,CAAC,uBAAuB,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;IACnE,IAAI,MAAM,GAAoC,SAAS,CAAC;IACxD,IAAI,MAAM,EAAE;QACV,MAAM,MAAM,GAAG,MAAM,CAAC,cAAc,EAAE,CAAC;QACvC,MAAM,QAAQ,GAAG,0BAA0B,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC,CAAC;QACrF,MAAM,UAAU,GAAG,IAAI,KAAK,EAAE,CAAC,kBAAkB,CAAC,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,YAAY,EAAE,CAAC,SAAS,EAAE,CAAC,UAAU,EAAE,CAAC;QAC7G,MAAM,GAAG,IAAI,mBAAmB,EAAE,CAAC,4BAA4B,CAAC,MAAM,EAAE,QAAQ,EAAE,UAAU,CAAC,CAAC;KAC/F;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;SAEe,qBAAqB,CAAC,KAAY,EAAE,KAAsB,EAAE,IAAiB,EAAE,MAAqB;IAClH,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;IAC3C,MAAM,OAAO,GAAG,IAAI,GAAG,EAAU,CAAC;IAClC,MAAM,aAAa,GAAG,CAAC,MAAM,GAAG,IAAI,KAAK,MAAM,GAAG,IAAI,CAAC,CAAC;IACxD,KAAK,MAAM,SAAS,IAAI,IAAI,EAAE;QAC5B,MAAM,WAAW,GAAG,sBAAsB,CAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;QAC5E,IAAI,WAAW,EAAE;YACf,MAAM,eAAe,GAAG,WAAW,CAAC,iBAAiB,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC;YACpF,IAAI,eAAe,IAAI,aAAa,EAAE;gBACpC,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;aACxB;SACF;KACF;IACD,OAAO,OAAO,CAAC;AACjB;;ACrCA,SAAS,eAAe,CAAC,KAAY,EAAE,IAAiB,EAAE,QAAkD;;IAC1G,MAAM,YAAY,GAAG,IAAI,GAAG,EAAoB,CAAC;IACjD,MAAM,MAAM,GAAG,IAAI,GAAG,EAAU,CAAC;IACjC,KAAK,MAAM,OAAO,IAAI,IAAI,EAAE;QAC1B,KAAK,MAAM,IAAI,IAAI,SAAS,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE;YACtE,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;YAC3B,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE;gBACrC,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;aAC7C;iBAAM;gBACL,MAAA,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,0CAAE,IAAI,CAAC,OAAO,CAAC,CAAC;aACjD;SACF;KACF;IAED,MAAM,SAAS,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC;IACnC,MAAM,OAAO,GAAG,IAAI,GAAG,EAAU,CAAC;IAClC,KAAK,MAAM,CAAC,IAAI,SAAS,EAAE;QACzB,KAAK,MAAM,CAAC,IAAI,MAAA,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,mCAAI,EAAE,EAAE;YACzC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;SAChB;KACF;IACD,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,SAAS,uBAAuB,CAAC,KAAY,EAAE,IAAiB,EAAE,QAAoD;;IACpH,MAAM,cAAc,GAAG,IAAI,GAAG,EAAoB,CAAC;IACnD,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAU,CAAC;IACnC,KAAK,MAAM,OAAO,IAAI,IAAI,EAAE;QAC1B,KAAK,MAAM,IAAI,IAAI,SAAS,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,CAAC,aAAa,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE;YAC9E,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;YAC7B,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE;gBACvC,cAAc,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;aAC/C;iBAAM;gBACL,MAAA,cAAc,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,0CAAE,IAAI,CAAC,OAAO,CAAC,CAAC;aACnD;SACF;KACF;IAED,MAAM,kBAAkB,GAAG,QAAQ,CAAC,QAAQ,CAAC,CAAC;IAC9C,MAAM,OAAO,GAAG,IAAI,GAAG,EAAU,CAAC;IAClC,KAAK,MAAM,CAAC,IAAI,kBAAkB,EAAE;QAClC,KAAK,MAAM,CAAC,IAAI,MAAA,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,mCAAI,EAAE,EAAE;YAC3C,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;SAChB;KACF;IACD,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,SAAS,iBAAiB,CAAC,KAAY,EAAE,IAAiB,EAAE,QAAoD;;IAC9G,MAAM,cAAc,GAAG,IAAI,GAAG,EAAoB,CAAC;IACnD,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAU,CAAC;IAEnC,MAAM,mBAAmB,GAAG,IAAI,GAAG,CAAS,IAAI,CAAC,CAAC;IAClD,KAAK,MAAM,OAAO,IAAI,IAAI,EAAE;QAC1B,KAAK,MAAM,IAAI,IAAI,SAAS,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,CAAC,QAAQ,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE;YACzE,mBAAmB,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;SACzC;KACF;IAED,KAAK,MAAM,OAAO,IAAI,mBAAmB,EAAE;QACzC,KAAK,MAAM,IAAI,IAAI,SAAS,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,CAAC,QAAQ,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE;YACzE,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;YAC7B,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE;gBACvC,cAAc,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;aAC/C;iBAAM;gBACL,MAAA,cAAc,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,0CAAE,IAAI,CAAC,OAAO,CAAC,CAAC;aACnD;SACF;KACF;IAED,MAAM,WAAW,GAAG,QAAQ,CAAC,QAAQ,CAAC,CAAC;IACvC,MAAM,OAAO,GAAG,IAAI,GAAG,EAAU,CAAC;IAClC,KAAK,MAAM,CAAC,IAAI,WAAW,EAAE;QAC3B,KAAK,MAAM,CAAC,IAAI,MAAA,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,mCAAI,EAAE,EAAE;YAC3C,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;SAChB;KACF;IACD,OAAO,OAAO,CAAC;AACjB,CAAC;AAED;;;;;;;SAOgB,OAAO,CAAC,KAAY,EAAE,KAAsB,EAAE,MAAc;;IAC1E,IAAI,IAAI,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC;IACjC,IAAI,IAAI,CAAC,IAAI,GAAG,CAAC,EAAE;QACjB,IAAI,GAAG,wBAAwB,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;KAC9C;IACD,IAAI,IAAI,CAAC,IAAI,GAAG,CAAC,KAAK,MAAM,CAAC,GAAG,KAAK,MAAM,IAAI,MAAM,CAAC,GAAG,KAAK,QAAQ,CAAC,EAAE;QACvE,MAAM,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC;QACvB,IAAI,GAAG,eAAe,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,MAAM,KACzC,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,CAAC,CAChC,CAAC;KACH;IACD,IAAI,IAAI,CAAC,IAAI,GAAG,CAAC,IAAI,CAAA,MAAA,MAAM,CAAC,GAAG,0CAAE,MAAM,IAAG,CAAC,EAAE;QAC3C,IAAI,GAAG,eAAe,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,MAAM,KACzC,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,CAC7C,CAAC;KACH;IACD,IAAI,IAAI,CAAC,IAAI,GAAG,CAAC,IAAI,CAAA,MAAA,MAAM,CAAC,YAAY,0CAAE,MAAM,IAAG,CAAC,EAAE;QACpD,IAAI,GAAG,iBAAiB,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,QAAQ,KAC7C,kBAAkB,CAAC,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC,YAAY,CAAC,CACzD,CAAC;KACH;IACD,IAAI,IAAI,CAAC,IAAI,GAAG,CAAC,IAAI,CAAA,MAAA,MAAM,CAAC,eAAe,0CAAE,MAAM,IAAG,CAAC,EAAE;QACvD,IAAI,GAAG,uBAAuB,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,QAAQ,KACnD,uBAAuB,CAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC,eAAe,CAAC,CACxE,CAAC;KACH;IACD,IAAI,IAAI,CAAC,IAAI,GAAG,CAAC,IAAI,CAAA,MAAA,MAAM,CAAC,aAAa,0CAAE,MAAM,IAAG,CAAC,EAAE;QACrD,MAAM,KAAK,GAAG,MAAM,CAAC,aAAa,CAAC;QACnC,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE;YACrC,IAAI,GAAG,uBAAuB,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,QAAQ,KACnD,qBAAqB,CAAC,KAAK,EAAE,QAAQ,EAAE,KAAK,CAAC,CAC9C,CAAC;SACH;KACF;IACD,IAAI,IAAI,CAAC,IAAI,GAAG,CAAC,IAAI,CAAA,MAAA,MAAM,CAAC,aAAa,0CAAE,MAAM,IAAG,CAAC,EAAE;QACrD,MAAM,KAAK,GAAG,MAAM,CAAC,aAAa,CAAC;QACnC,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE;YACrC,IAAI,GAAG,uBAAuB,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,QAAQ,KACnD,qBAAqB,CAAC,KAAK,EAAE,QAAQ,EAAE,KAAK,CAAC,CAC9C,CAAC;SACH;KACF;IACD,IAAI,IAAI,CAAC,IAAI,GAAG,CAAC,IAAI,CAAA,MAAA,MAAM,CAAC,QAAQ,0CAAE,MAAM,MAAK,CAAC;QAChD,QAAQ,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,QAAQ,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE;QAC9D,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC;QAC5C,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC;;QAG5C,IAAI,EAAE,MAAM,KAAK,CAAC,IAAI,MAAM,KAAK,GAAG,CAAC,EAAE;YACrC,IAAI,GAAG,eAAe,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,MAAM,KACzC,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAC3C,CAAC;SACH;KACF;IACD,IAAI,IAAI,CAAC,IAAI,GAAG,CAAC,IAAI,CAAA,MAAA,MAAM,CAAC,QAAQ,0CAAE,MAAM,MAAK,CAAC;QAChD,QAAQ,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,QAAQ,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE;QAC9D,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC;QAC5C,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC;;QAG5C,IAAI,EAAE,MAAM,KAAK,EAAE,IAAI,MAAM,KAAK,EAAE,CAAC,EAAE;YACrC,IAAI,GAAG,eAAe,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,MAAM,KACzC,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAC3C,CAAC;SACH;KACF;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;;;AAMA,SAAS,cAAc,CAAC,KAAY;IAClC,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAC;IAC/B,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC,aAAa,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;IAC3E,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;;;;AAOA,SAAS,kBAAkB,CAAC,IAAiB,EAAE,OAAoB;IACjE,OAAO,UAAU,IAAU;QACzB,IAAI,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE;YACrB,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;SACtB;KACF,CAAC;AACJ,CAAC;AAED;;;;;;;;AAQA,SAAS,WAAW,CAAC,KAAY,EAAE,IAAiB,EAAE,GAAsB;IAC1E,MAAM,OAAO,GAAG,IAAI,GAAG,EAAU,CAAC;IAClC,KAAK,CAAC,WAAW,CAAC,kBAAkB,CAAC,IAAI,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,CAAC;IACpF,OAAO,OAAO,CAAC;AACjB,CAAC;AAED;;;;;;;;AAQA,SAAS,iBAAiB,CAAC,KAAY,EAAE,IAAiB,EAAE,UAAoB;IAC9E,MAAM,OAAO,GAAG,IAAI,GAAG,EAAU,CAAC;IAClC,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE;QAClC,MAAM,OAAO,GAAG,WAAW,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QAC/C,KAAK,CAAC,WAAW,CAAC,kBAAkB,CAAC,IAAI,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,YAAY,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;KAC1F;IACD,OAAO,OAAO,CAAC;AACjB,CAAC;AAED;;;;;;;;AAQA,SAAS,kBAAkB,CAAC,KAAY,EAAE,IAAiB,EAAE,YAAsB;IACjF,MAAM,OAAO,GAAG,IAAI,GAAG,EAAU,CAAC;IAClC,KAAK,MAAM,UAAU,IAAI,YAAY,EAAE;QACrC,MAAM,OAAO,GAAG,WAAW,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;QAChD,KAAK,CAAC,WAAW,CAAC,kBAAkB,CAAC,IAAI,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,UAAU,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;KACxF;IACD,OAAO,OAAO,CAAC;AACjB,CAAC;AAED;;;;;;;;AAQA,SAAS,qBAAqB,CAAC,KAAY,EAAE,IAAiB,EAAE,KAAe;IAC7E,MAAM,OAAO,GAAG,IAAI,GAAG,EAAU,CAAC;IAClC,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE;QACxB,MAAM,SAAS,GAAG,WAAW,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;QAC9C,KAAK,CAAC,WAAW,CAAC,kBAAkB,CAAC,IAAI,EAAE,OAAO,CAAC,EAAE,GAAG,CAAC,aAAa,CAAC,eAAe,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC;KAC1G;IACD,OAAO,OAAO,CAAC;AACjB,CAAC;AAED;;;;;;;;AAQA,SAAS,qBAAqB,CAAC,KAAY,EAAE,IAAiB,EAAE,KAAe;IAC7E,MAAM,OAAO,GAAG,IAAI,GAAG,EAAU,CAAC;IAClC,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE;QACxB,KAAK,CAAC,UAAU,CAAC,CAAC,MAAM;YACtB,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;SACxB,EAAE,IAAI,EAAE,GAAG,CAAC,KAAK,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;QACrC,IAAI,IAAI,KAAK,GAAG,CAAC,IAAI,CAAC,EAAE,EAAE;YACxB,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;SAC1B;KACF;IACD,OAAO,qBAAqB,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;AAC1D,CAAC;AAED;;;;;;;;;AASA,SAAS,WAAW,CAAC,KAAY,EAAE,IAAiB,EAAE,MAAc,EAAE,MAAc;IAClF,MAAM,OAAO,GAAG,IAAI,GAAG,EAAU,CAAC;IAClC,KAAK,MAAM,OAAO,IAAI,IAAI,EAAE;QAC1B,KAAK,MAAM,IAAI,IAAI,SAAS,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,CAAC,GAAG,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE;YACpE,MAAM,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC,MAAiB,CAAW,CAAC;YACxD,IAAI,KAAK,IAAI,MAAM,IAAI,KAAK,IAAI,MAAM,EAAE;gBACtC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;aACtB;SACF;KACF;IACD,OAAO,OAAO,CAAC;AACjB,CAAC;AAED;;;;;;;;;AASA,SAAS,WAAW,CAAC,KAAY,EAAE,IAAiB,EAAE,MAAc,EAAE,MAAc;IAClF,MAAM,OAAO,GAAG,IAAI,GAAG,EAAU,CAAC;IAClC,KAAK,MAAM,OAAO,IAAI,IAAI,EAAE;QAC1B,KAAK,MAAM,IAAI,IAAI,SAAS,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,CAAC,GAAG,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE;YACpE,MAAM,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC,MAAiB,CAAW,CAAC;YACxD,IAAI,KAAK,IAAI,MAAM,IAAI,KAAK,IAAI,MAAM,EAAE;gBACtC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;aACtB;SACF;KACF;IACD,OAAO,OAAO,CAAC;AACjB,CAAC;AAED;;;;;;;;AAQA,SAAS,wBAAwB,CAAC,KAAY,EAAE,IAAiB,EAAE,gBAAgB,GAAG,IAAI;IACxF,MAAM,OAAO,GAAG,IAAI,GAAG,EAAU,CAAC;IAClC,KAAK,CAAC,WAAW,CAAC,kBAAkB,CAAC,IAAI,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,aAAa,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;IACvF,IAAI,CAAC,gBAAgB,EAAE;QACrB,MAAM,UAAU,GAAG,IAAI,GAAG,EAAU,CAAC;QACrC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC;QACrE,OAAO,UAAU,CAAC;KACnB;IACD,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,SAAS,uBAAuB,CAAC,KAAY,EAAE,KAAsB,EAAE,IAAiB,EAAE,eAAgC;IACxH,MAAM,OAAO,GAAG,IAAI,GAAG,EAAU,CAAC;IAClC,KAAK,MAAM,MAAM,IAAI,eAAe,EAAE;QACpC,MAAM,QAAQ,GAAG,qBAAqB,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;QACnE,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;KACzC;IACD,OAAO,OAAO,CAAC;AACjB;;ACxVA,SAAS,uBAAuB,CAAC,QAAqB,EAAE,KAAY;IAClE,MAAM,cAAc,GAAG,IAAI,GAAG,EAAuB,CAAC;IAEtD,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE;QAC9B,KAAK,MAAM,IAAI,IAAI,SAAS,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,CAAC,aAAa,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE;YAC9E,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE;gBACvC,cAAc,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,IAAI,GAAG,CAAS,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;aAChE;iBAAM;gBACL,cAAc,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAE,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;aAClD;SACF;KACF;IACD,OAAO,cAAc,CAAC;AACxB,CAAC;AAED,SAAS,6BAA6B,CAAC,GAAgB,EAAE,KAAY;IACnE,MAAM,cAAc,GAAG,uBAAuB,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IAC3D,MAAM,WAAW,GAAG,IAAI,GAAG,EAAuB,CAAC;IAEnD,KAAK,MAAM,OAAO,IAAI,cAAc,CAAC,IAAI,EAAE,EAAE;QAC3C,MAAM,QAAQ,GAAG,cAAc,CAAC,GAAG,CAAC,OAAO,CAAE,CAAC;QAC9C,KAAK,MAAM,IAAI,IAAI,SAAS,CAAC,KAAK,EAAE,OAAO,EAAE,GAAG,CAAC,aAAa,CAAC,eAAe,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE;YAC3F,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE;gBACpC,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,IAAI,GAAG,CAAS,QAAQ,CAAC,CAAC,CAAC;aAC5D;iBAAM;gBACL,MAAM,YAAY,GAAG,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAE,CAAC;gBACtD,QAAQ,CAAC,OAAO,CAAC,CAAC,KAAK,KAAK,YAAY,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC;aACtD;SACF;KACF;IACD,OAAO,WAAW,CAAC;AACrB,CAAC;AAED;;;;;;;SAOgB,yBAAyB,CAAC,GAAgB,EAAE,KAAY;IACtE,MAAM,MAAM,GAA2B,EAAE,CAAC;IAC1C,MAAM,aAAa,GAAG,6BAA6B,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IAEhE,aAAa,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,GAAG;QAC/B,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC;KAC1B,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;;;;;SAOgB,yBAAyB,CAAC,GAAgB,EAAE,KAAY;;IACtE,MAAM,eAAe,GAAG,6BAA6B,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IAClE,MAAM,eAAe,GAAG,IAAI,GAAG,EAAuB,CAAC;IAEvD,KAAK,MAAM,MAAM,IAAI,eAAe,CAAC,IAAI,EAAE,EAAE;QAC3C,MAAM,QAAQ,GAAG,eAAe,CAAC,GAAG,CAAC,MAAM,CAAE,CAAC;QAC9C,KAAK,MAAM,IAAI,IAAI,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,CAAC,KAAK,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE;YAC7E,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;YACjC,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE;gBAClC,eAAe,CAAC,GAAG,CAAC,QAAQ,EAAE,IAAI,GAAG,CAAS,QAAQ,CAAC,CAAC,CAAC;aAC1D;iBAAM;gBACL,MAAM,YAAY,GAAG,eAAe,CAAC,GAAG,CAAC,QAAQ,CAAE,CAAC;gBACpD,QAAQ,CAAC,OAAO,CAAC,CAAC,KAAK,KAAK,YAAY,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC;aACtD;SACF;KACF;IAED,MAAM,MAAM,GAA2B,EAAE,CAAC;IAE1C,eAAe,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,GAAG;QACjC,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC;KAC1B,CAAC,CAAC;IAEH,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,MAAA,MAAA,eAAe,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,0CAAE,IAAI,mCAAI,CAAC,CAAC;IAElE,OAAO,MAAM,CAAC;AAChB;;SClFgB,mBAAmB,CAAC,KAAY,EAAE,GAAW,EAAE,eAAuB;IACpF,MAAM,MAAM,GAAqB;QAC/B,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,kBAAkB,EAAE,EAAE,EAAE,GAAG,EAAE,MAAM,EAAE,EAAE;QAC5D,QAAQ,EAAE,EAAc,EAAE,aAAa,EAAE,EAAc,EAAE,KAAK,EAAE,EAAE;KACnE,CAAC;IAEF,MAAM,sBAAsB,GAAG;QAC7B,CAAC,GAAG,CAAC,YAAY,CAAC,KAAK,CAAC,EAAE,GAAG,OAAO;QACpC,CAAC,eAAe,GAAG,QAAQ;QAC3B,CAAC,GAAG,CAAC,YAAY,CAAC,aAAa,CAAC,EAAE,GAAG,eAAe;KACrD,CAAC;IAEF,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,UAAU,CAAC,KAAK,EAAE,GAAG,EAAE,sBAAsB,CAAC,EAAE;QACzE,IAAI,GAAG,KAAK,eAAe,EAAE;YAC3B,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,KAAe,CAAC,CAAC;SAC5C;aAAM;YACL,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;SACrB;KACF;IACD,MAAM,CAAC,QAAQ,GAAG,KAAK,CAAC,WAAW,CAAC,eAAe,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC;IAE/E,OAAO,MAAM,CAAC;AAChB,CAAC;SAEe,oBAAoB,CAAC,KAAY,EAAE,OAAe,EAAE,SAAiB,EAAE,eAAuB;IAC5G,MAAM,MAAM,GAAsB,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC;IAC/D,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAC;IAC/B,KAAK,MAAM,IAAI,IAAI,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,eAAe,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE;QACtE,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QAC1B,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;KAC1B;IAED,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE;QACtB,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,mBAAmB,CAAC,KAAK,EAAE,GAAG,EAAE,eAAe,CAAC,CAAC;KACtE;IAED,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE;QAC1B,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG;YACtB,KAAK,EAAE,OAAO;YACd,OAAO,EAAE,kBAAkB;YAC3B,EAAE,EAAE,OAAO;YACX,KAAK,EAAE,SAAS;YAChB,QAAQ,EAAE,EAAE;YACZ,aAAa,EAAE,EAAE;SACa,CAAC;KAClC;IAED,MAAM,YAAY,GAAG,KAAK;SACvB,WAAW,CAAC,eAAe,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC;SAC1D,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,aAAa,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;IAC9E,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,QAAQ,GAAG,YAAY,CAAC;IAE9C,OAAO,CAAC,MAAM,CAAC,CAAC;IAEhB,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;;;;;AAOA,SAAS,OAAO,CAAC,KAAwB,EAAE,UAA8B,SAAS,EAAE,OAAoB,IAAI,GAAG,EAAE;IAC/G,MAAM,IAAI,GAAG,KAAK,CAAC,KAAK,CAAC,OAAO,aAAP,OAAO,cAAP,OAAO,GAAI,KAAK,CAAC,IAAI,CAAC,CAAC;IAChD,IAAI,IAAI,EAAE;QACR,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QACxD,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QACxC,KAAK,MAAM,OAAO,IAAI,IAAI,CAAC,QAAQ,EAAE;YACnC,OAAO,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;YAC9B,IAAI,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE;gBACxB,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC;aAC3C;SACF;KACF;AACH,CAAC;SAEe,qCAAqC,CAAC,KAAY;IAChE,MAAM,KAAK,GAAG,oBAAoB,CAAC,KAAK,EAAE,GAAG,CAAC,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IACrF,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,QAAQ,GAAG;QAClC,+CAA+C;QAC/C,+CAA+C;;QAE/C,+CAA+C;;;QAG/C,+CAA+C;;;QAG/C,+CAA+C;QAC/C,+CAA+C;;;QAG/C,+CAA+C;;;QAG/C,+CAA+C;QAC/C,+CAA+C;QAC/C,+CAA+C;;;QAG/C,+CAA+C;;;QAG/C,+CAA+C;QAC/C,+CAA+C;QAC/C,+CAA+C;QAC/C,+CAA+C;QAC/C,+CAA+C;QAC/C,+CAA+C;QAC/C,+CAA+C;QAC/C,+CAA+C;QAC/C,+CAA+C;QAC/C,+CAA+C;QAC/C,+CAA+C;;;QAG/C,+CAA+C;QAC/C,+CAA+C;QAC/C,+CAA+C;KAChD,CAAC,MAAM,CAAC,GAAG,IAAI,GAAG,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC;IACpC,OAAO,KAAK,CAAC;AACf,CAAC;AAEM,MAAM,+BAA+B,GAAG,OAAO,CAAC,qCAAqC,EAAE,MAAM,EAAE,CAAC,CAAC;SAExF,oBAAoB,CAAC,KAAY;IAC/C,OAAO,oBAAoB,CAAC,KAAK,EAAE,GAAG,CAAC,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;AAChF;;AClIA;AACA,MAAM,aAAa,GAA8B;IAC/C,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,GAAG,OAAO;IAC1B,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE,GAAG,aAAa;IACtC,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,GAAG,MAAM;CACzB,CAAC;AAEF,MAAM,cAAc,mCACf,aAAa,KAChB,CAAC,MAAM,CAAC,YAAY,CAAC,EAAE,GAAG,cAAc,GACzC,CAAC;AAEF,MAAM,gBAAgB,mCACjB,aAAa,KAChB,CAAC,MAAM,CAAC,UAAU,CAAC,EAAE,GAAG,YAAY,EACpC,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,GAAG,WAAW,GACnC,CAAC;AAEF,MAAM,sBAAsB,mCACvB,aAAa,KAChB,CAAC,MAAM,CAAC,UAAU,CAAC,EAAE,GAAG,YAAY,EACpC,CAAC,MAAM,CAAC,aAAa,CAAC,EAAE,GAAG,eAAe,EAC1C,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,GAAG,UAAU,GACjC,CAAC;AAEF,MAAM,oBAAoB,mCACrB,aAAa,KAChB,CAAC,MAAM,CAAC,UAAU,CAAC,EAAE,GAAG,YAAY,EACpC,CAAC,MAAM,CAAC,YAAY,CAAC,EAAE,GAAG,cAAc,EACxC,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE,GAAG,aAAa,EACtC,CAAC,MAAM,CAAC,YAAY,CAAC,EAAE,GAAG,cAAc,EAExC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,GAAG,OAAO,EAC1B,CAAC,MAAM,CAAC,aAAa,CAAC,EAAE,GAAG,iBAAiB,EAC5C,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,GAAG,UAAU,EAChC,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,GAAG,UAAU,GACjC,CAAC;AAEF;;;;;;;SAOgB,cAAc,CAAC,KAAY,EAAE,GAAW;IACtD,OAAO,eAAe,CAAC,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,cAAc,CAAC,CAAC;AAC9D,CAAC;AAED;;;;;;;SAOgB,gBAAgB,CAAC,KAAY,EAAE,GAAW;IACxD,OAAO,eAAe,CAAC,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,gBAAgB,CAAC,CAAC;AAClE,CAAC;AAED;;;;;;;SAOgB,sBAAsB,CAAC,KAAY,EAAE,GAAW;;IAE9D,MAAM,MAAM,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAqB,EAAyB,CAAC;IACzG,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,UAAU,CAAC,KAAK,EAAE,GAAG,EAAE,sBAAsB,CAAC,EAAE;QACzE,IAAI,GAAG,KAAK,UAAU,EAAE;YACtB,MAAM,OAAO,GAAG,gBAAgB,CAAC,KAAK,EAAE,KAAe,CAAC,CAAC;YACzD,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;SAC3B;aAAM;YACL,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;SACrB;KACF;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;;;;;SAOgB,oBAAoB,CAAC,KAAY,EAAE,GAAW;;IAE5D,MAAM,MAAM,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,QAAQ;QAC5C,QAAQ,EAAE,EAA2B,EAAE,QAAQ,EAAE,EAAqB;KAClD,CAAC;IACvB,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,UAAU,CAAC,KAAK,EAAE,GAAG,EAAE,oBAAoB,CAAC,EAAE;QACvE,IAAI,GAAG,KAAK,UAAU,EAAE;YACtB,MAAM,OAAO,GAAG,sBAAsB,CAAC,KAAK,EAAE,KAAe,CAAC,CAAC;YAC/D,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;SAC3B;aAAM,IAAI,GAAG,KAAK,UAAU,EAAE;YAC7B,MAAM,OAAO,GAAG,gBAAgB,CAAC,KAAK,EAAE,KAAe,CAAC,CAAC;YACzD,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;SAC3B;aAAM,IAAI,GAAG,KAAK,OAAO,EAAE;YAC1B,MAAM,CAAC,GAAG,CAAC,GAAG,cAAc,CAAC,KAAK,EAAE,KAAe,CAAC,CAAC;SACtD;aAAM;YACL,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;SACrB;KACF;IACD,OAAO,MAAM,CAAC;AAChB;;MC7Ga,wBAAwB;IAKnC,YAAmB,QAAqB;QAArB,aAAQ,GAAR,QAAQ,CAAa;QACtC,IAAI,CAAC,OAAO,EAAE,CAAC;KAChB;IAED,MAAM;QACJ,OAAO;YACL,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,SAAS,EAAE,IAAI,CAAC,MAAM,KAAK,OAAO,IAAI,IAAI,CAAC,MAAM,KAAK,OAAO,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,GAAG,IAAI;YACrF,QAAQ,EAAE,IAAI,CAAC,QAAQ;SACxB,CAAC;KACH;IAEO,OAAO;QACb,IAAI,CAAC,MAAM,GAAG,SAAS,CAAC;QACxB,IAAI,CAAC,OAAO,GAAG,kBAAkB,CAAC;QAElC,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QAC7B,OAAO,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE;aAC3B,IAAI,CAAC,CAAO,MAAM;YACjB,IAAI,MAAM,EAAE;;gBAEV,IAAI,CAAC,OAAO,GAAG,gBAAgB,CAAC;gBAChC,MAAM,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC;gBAC/B,IAAI,CAAC,OAAO,GAAG,+BAA+B,CAAC;gBAC/C,MAAM,IAAI,CAAC,QAAQ,CAAC,qBAAqB,EAAE,CAAC;gBAC5C,IAAI,CAAC,OAAO,GAAG,qBAAqB,CAAC;gBACrC,MAAM,IAAI,CAAC,QAAQ,CAAC,mBAAmB,EAAE,CAAC;gBAC1C,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC;gBACtB,IAAI,CAAC,OAAO,GAAG,8BAA8B,CAAC;aAC/C;iBAAM;gBACL,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC;gBACtB,IAAI,CAAC,OAAO,GAAG,sCAAsC,CAAC;aACvD;SACF,CAAA,CAAC;aACD,KAAK,CAAC,CAAC,KAA2B;;YACjC,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC;YACtB,IAAI,CAAC,OAAO,GAAG,MAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,OAAO,mCAAI,sCAAsC,CAAC;SACzE,CAAC;aACD,OAAO,CAAC;YACP,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,SAAS,CAAC;SACxC,CAAC,CAAC;KACN;;;AChDH;AACA;AACA,MAAM,WAAW,GAAG;IAClB,UAAU,EAAE;QACV,OAAO,EAAE,sBAAsB;QAC/B,QAAQ,EAAE,sBAAsB;QAChC,KAAK,EAAE,sBAAsB;QAC7B,MAAM,EAAE,uCAAuC;QAC/C,SAAS,EAAE,2BAA2B;QACtC,OAAO,EAAE,YAAY;QACrB,aAAa,EAAE,cAAc;QAC7B,MAAM,EAAE,SAAS;QACjB,KAAK,EAAE,SAAS;QAChB,KAAK,EAAE,SAAS;QAChB,KAAK,EAAE,SAAS;QAChB,iBAAiB,EAAE,qBAAqB;QACxC,eAAe,EAAE,0BAA0B;QAC3C,eAAe,EAAE,0BAA0B;QAC3C,OAAO,EAAE;YACP,KAAK,EAAE,gBAAgB;YACvB,OAAO,EAAE,KAAK;SACf;QACD,SAAS,EAAE;YACT,UAAU,EAAE,OAAO;SACpB;QACD,UAAU,EAAE;YACV,KAAK,EAAE,8BAA8B;YACrC,OAAO,EAAE,KAAK;SACf;QACD,UAAU,EAAE;YACV,KAAK,EAAE,uBAAuB;YAC9B,OAAO,EAAE,KAAK;SACf;QACD,aAAa,EAAE,iBAAiB;QAChC,eAAe,EAAE,mBAAmB;QACpC,cAAc,EAAE,kBAAkB;QAClC,eAAe,EAAE,uBAAuB;QACxC,gBAAgB,EAAE,oBAAoB;QACtC,cAAc,EAAE;YACd,KAAK,EAAE,+BAA+B;YACtC,OAAO,EAAE,KAAK;SACf;QACD,iBAAiB,EAAE;YACjB,KAAK,EAAE,mBAAmB;YAC1B,OAAO,EAAE,KAAK;YACd,YAAY,EAAE,MAAM;SACrB;QACD,mBAAmB,EAAE;YACnB,KAAK,EAAE,uBAAuB;YAC9B,OAAO,EAAE,KAAK;SACf;QACD,iBAAiB,EAAE;YACjB,KAAK,EAAE,yBAAyB;YAChC,OAAO,EAAE,KAAK;SACf;QACD,oBAAoB,EAAE;YACpB,KAAK,EAAE,wBAAwB;YAC/B,OAAO,EAAE,KAAK;SACf;QACD,gBAAgB,EAAE;YAChB,KAAK,EAAE,wBAAwB;YAC/B,OAAO,EAAE,KAAK;SACf;QACD,iBAAiB,EAAE,qBAAqB;QACxC,MAAM,EAAE,gBAAgB;QACxB,UAAU,EAAE,cAAc;QAC1B,iBAAiB,EAAE,qBAAqB;QACxC,aAAa,EAAE,iBAAiB;QAChC,QAAQ,EAAE;YACR,KAAK,EAAE,0BAA0B;YACjC,OAAO,EAAE,KAAK;SACf;QACD,eAAe,EAAE,iBAAiB;QAClC,cAAc,EAAE,kBAAkB;QAClC,SAAS,EAAE,iBAAiB;QAC5B,oBAAoB,EAAE,wBAAwB;QAC9C,mBAAmB,EAAE,uBAAuB;QAC5C,WAAW,EAAE;YACX,UAAU,EAAE,mBAAmB;SAChC;QACD,gBAAgB,EAAE,iBAAiB;QACnC,gBAAgB,EAAE,oBAAoB;QACtC,iBAAiB,EAAE,oBAAoB;QACvC,gBAAgB,EAAE,mBAAmB;QACrC,eAAe,EAAE,kBAAkB;QACnC,mBAAmB,EAAE,sBAAsB;QAC3C,QAAQ,EAAE;YACR,KAAK,EAAE,mBAAmB;YAC1B,OAAO,EAAE,KAAK;SACf;QACD,QAAQ,EAAE;YACR,KAAK,EAAE,2BAA2B;YAClC,OAAO,EAAE,KAAK;SACf;QACD,YAAY,EAAE,gBAAgB;QAC9B,YAAY,EAAE,gBAAgB;QAC9B,YAAY,EAAE,gBAAgB;QAC9B,WAAW,EAAE,eAAe;QAC5B,WAAW,EAAE,eAAe;QAC5B,WAAW,EAAE,eAAe;QAC5B,eAAe,EAAE,mBAAmB;QACpC,eAAe,EAAE,mBAAmB;QACpC,eAAe,EAAE,mBAAmB;QACpC,aAAa,EAAE,iBAAiB;QAChC,aAAa,EAAE,iBAAiB;QAChC,aAAa,EAAE,iBAAiB;QAChC,gBAAgB,EAAE;YAChB,KAAK,EAAE,uBAAuB;YAC9B,OAAO,EAAE,KAAK;SACf;QACD,YAAY,EAAE,gBAAgB;QAC9B,WAAW,EAAE,eAAe;QAC5B,MAAM,EAAE,cAAc;QACtB,aAAa,EAAE,iBAAiB;QAChC,cAAc,EAAE,kBAAkB;KACnC;CACF,CAAC;AACF;AAEA;;;;;;SAMgB,WAAW,CAAC,YAAoB;IAC9C,OAAO,IAAI,CAAC,KAAK,CAAC,YAAY,EAAE,CAAC,GAAG,EAAE,KAAK;QACzC,IAAI,GAAG,KAAK,iBAAiB,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;YACrD,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,GAAW;gBAC3B,IAAI,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,UAAU,CAAC,qCAAqC,CAAC,EAAE;oBAC1D,OAAO,GAAG,CAAC,OAAO,CAChB,qCAAqC,EACrC,iCAAiC,CAClC,CAAC;iBACH;qBAAM;oBACL,OAAO,GAAG,CAAC;iBACZ;aACF,CAAC,CAAC;SACJ;aAAM,IAAI,GAAG,KAAK,UAAU,IAAI,KAAK,KACpC,KAAK,KAAK,8EAA8E;eACnF,KAAK,KAAK,uEAAuE;eACjF,KAAK,KAAK,oEAAoE;eAC7E,KAAiB,CAAC,OAAO,CAAC,KAAK,4CAA4C,CAClF,EAAE;YACD,OAAO,WAAW,CAAC;SACpB;QACD,OAAO,KAAK,CAAC;KACd,CAAC,CAAC;AACL;;AClJA;;;;;;SAMgB,kBAAkB,CAAC,KAAY;;IAC7C,MAAM,IAAI,GAAG,+BAA+B,CAAC,KAAK,CAAC,CAAC;IACpD,MAAM,WAAW,GAA6B,IAAI,GAAG,EAAE,CAAC;;IAGxD,KAAK,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,CAAC,aAAa,CAAC,iBAAiB,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE;QACtH,MAAM,WAAW,GAAG,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;QACvC,IAAI,MAAM,GAAG,MAAA,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,0CAAE,MAAM,CAAC;QACzC,OAAO,MAAM,EAAE;YACb,IAAI,WAAW,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE;gBAC3B,MAAM;aACP;iBAAM;gBACL,WAAW,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;gBACxB,MAAM,GAAG,MAAA,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,0CAAE,MAAM,CAAC;aACrC;SACF;QACD,WAAW,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,EAAE,CAAE,GAAG,WAAW,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,WAAW,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;KACjF;;IAGD,KAAK,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,IAAI,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,MAAM,CAAC,aAAa,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE;QAC9F,KAAK,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,IAAI,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,CAAC,gBAAgB,CAAC,MAAM,EAAE,WAAW,EAAE,IAAI,CAAC,EAAE;YAC3G,KAAK,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,SAAS,CAAC,KAAK,EAAE,SAAS,EAAE,GAAG,CAAC,gBAAgB,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE;gBACpG,KAAK,MAAM,IAAI,IAAI,MAAA,WAAW,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,mCAAI,EAAE,EAAE;oBAClD,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,SAAS,CAAC,WAAW,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,aAAa,CAAC,eAAe,EAAE,IAAI,CAAC,CAAC;iBAC/F;aACF;SACF;KACF;AACH;;ACKA;MACa,sBAAsB,GAAuB;IACxD,SAAS,EAAE,qCAAqC;IAChD,aAAa,EAAE,gDAAgD;IAC/D,WAAW,EAAE,EAAE;IACf,iBAAiB,EAAE,QAAQ;IAC3B,eAAe,EAAE,sCAAsC;IACvD,aAAa,EAAE,EAAE;IACjB,eAAe,EAAE,qCAAqC;EACtD;AAEF;MACa,WAAW;;;;;;IAiBtB,YAAmB,UAA8B,sBAAsB;QAApD,YAAO,GAAP,OAAO,CAA6C;QACrE,IAAI,CAAC,KAAK,GAAG,IAAI,KAAK,CAAC,SAAS,EAAE,EAAE,OAAO,EAAE,WAAW,EAAE,CAAC,CAAC;QAC5D,IAAI,CAAC,KAAK,GAAG,IAAI,eAAe,CAAC,IAAI,CAAC,CAAC;QACvC,IAAI,CAAC,KAAK,GAAG,IAAI,eAAe,CAAC,IAAI,CAAC,CAAC;KACxC;;;;;;;IAQK,OAAO,CAAC,OAA4B,EAAE,MAAM,GAAG,KAAK;;YACxD,IAAI,OAAO,EAAE;gBACX,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;aACxB;YACD,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE;gBACtB,IAAI,MAAM,EAAE;oBACV,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,aAAa,EAAE,CAAC;iBAC1C;qBAAM;oBACL,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC;iBACtC;aACF;YACD,MAAM,IAAI,CAAC,YAAY,CAAC;YACxB,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,CAAC,CAAC;SAC5B;KAAA;IAEa,aAAa;;YACzB,MAAM,KAAK,GAAG,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,CAAC;YACnC,MAAM,eAAe,GAAG,4BAA4B,CAAC;YACrD,MAAM,cAAc,GAAG,cAAc,CAAC;YAEtC,MAAM,YAAY,GAAG,MAAMC,KAAG,CAAC,eAAe,CAAC,CAAC,KAAK,CAAC,MAAM,SAAS,CAAC,CAAC;YACvE,IAAI,YAAgC,CAAC;YAErC,IAAI,YAAY,IAAI,KAAK,GAAG,IAAI,IAAI,CAAC,CAAC,YAAY,CAAC,CAAC,OAAO,EAAE,GAAG,EAAE,GAAC,EAAE,GAAC,IAAI,EAAE;gBAC1E,MAAM,OAAO,CAAC,CAAC,cAAc,EAAE,eAAe,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,SAAS,CAAC,CAAC;aACzE;iBAAM;gBACL,YAAY,GAAG,MAAMA,KAAG,CAAC,cAAc,CAAC,CAAC,KAAK,CAAC,MAAM,SAAS,CAAC,CAAC;aACjE;YAED,IAAI,YAAY,EAAE;gBAChB,MAAM,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC;aACtC;iBAAM;gBACL,MAAM,IAAI,CAAC,SAAS,EAAE,CAAC;gBAEvB,OAAO,CAAC;oBACN,CAAC,cAAc,EAAE,IAAI,CAAC,SAAS,EAAE,CAAC;oBAClC,CAAC,eAAe,EAAE,EAAE,GAAG,KAAK,CAAC;iBAC9B,CAAC,CAAC,KAAK,CAAC,MAAM,SAAS,CAAC,CAAC;aAC3B;SACF;KAAA;;;;;;IAOa,SAAS;;;YACrB,MAAM,GAAG,GAAuB,EAAE,CAAC;YACnC,MAAM,OAAO,GAAsB,MAAA,MAAA,IAAI,CAAC,OAAO,CAAC,WAAW,0CAAE,MAAM,EAAE,mCAAI,EAAE,CAAC;YAE5E,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC;YACzC,IAAI,SAAS,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE;;gBAE7B,IAAI,CAAC,KAAK,GAAG,kBAAkB,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;aACzD;iBAAM,IAAI,SAAS,CAAC,QAAQ,CAAC,eAAe,CAAC,EAAE;gBAC9C,MAAM,WAAW,GAAG,MAAM,KAAK,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC;qBAC3D,KAAK,CAAC,MAAM,OAAO,CAAC,GAAG,CAAC,oCAAoC,CAAC,CAAC,CAAC;gBAClE,IAAI,WAAW,EAAE;oBACf,IAAI,CAAC,KAAK,GAAG,kBAAkB,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;iBAC3D;aACF;iBAAM,IAAI,CAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,MAAM,IAAG,CAAC,EAAE;gBAChC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;aACzB;YACD,IAAI,IAAI,CAAC,OAAO,CAAC,aAAa,EAAE;gBAC9B,IAAI,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE;oBACjD,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;iBAC1C;qBAAM;oBACL,GAAG,CAAC,IAAI,CAAC,YAAY,CACnB,IAAI,CAAC,OAAO,CAAC,aAAa,EAC1B,IAAI,CAAC,OAAO,CAAC,iBAAiB,EAC9B,IAAI,CAAC,OAAO,CAAC,WAAW,EACxB,IAAI,CAAC,OAAO,CAAC,WAAW,EACxB,IAAI,CAAC,OAAO,CAAC,eAAe,EAC5B,IAAI,CAAC,OAAO,CAAC,eAAe,CAC7B,CAAC,IAAI,CAAC,CAAC,MAAM;wBACZ,IAAI,MAAM,EAAE;4BACV,OAAO,IAAI,CAAC,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;yBACtC;6BAAM;4BACL,OAAO,SAAS,CAAC;yBAClB;qBACF,CAAC,CAAC,CAAC;iBACL;aACF;YACD,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;YACvC,MAAM,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YACvB,MAAM,IAAI,CAAC,WAAW,EAAE,CAAC;;KAC1B;IAEK,cAAc,CAAC,OAA0B,EAAE,UAAkB;;YACjE,MAAM,KAAK,GAAU,UAAU,aAAV,UAAU,cAAV,UAAU,GAAI,IAAI,CAAC,KAAK,CAAC;YAC9C,MAAM,OAAO,CAAC,GAAG,CACf,OAAO,CAAC,GAAG,CAAC,CAAO,MAAM;gBACvB,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE;oBAC9B,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,MAAM,CAAC,UAAU,CAAC,SAAS,CAAC,KAAK,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE;wBAC5F,MAAM,GAAG,MAAM,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;wBACjD,MAAM,GAAG,WAAW,CAAC,MAAgB,CAAC,CAAC;wBACvC,MAAM,gBAAgB,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;qBACvC;yBAAM,IAAI,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE;wBAChC,MAAM,YAAY,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;qBACnC;yBAAM,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE;wBACrF,MAAM,gBAAgB,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;qBACvC;yBAAM;;wBAEL,MAAM,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC;wBAC7B,MAAM,gBAAgB,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;qBACvC;iBACF;qBAAM;oBACL,MAAM,GAAG,WAAW,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC;oBAC7C,MAAM,gBAAgB,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;iBACvC;aACF,CAAA,CAAC,CACH,CAAC;YACF,OAAO,IAAI,CAAC;SACb;KAAA;IAEK,WAAW;;;YAEf,MAAM,IAAI,OAAO,CAAC,CAAC;gBACjB,UAAU,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;aACpB,CAAC,CAAC;YACH,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC;YACzB,kBAAkB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YAC/B,OAAO,IAAI,CAAC;SACb;KAAA;IAED,SAAS;QACP,OAAO,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;KACrC;IAEK,WAAW,CAAC,KAAa;;YAC7B,IAAI,CAAC,KAAK,GAAG,kBAAkB,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC;YACpD,IAAI,CAAC,KAAK,GAAG,IAAI,eAAe,CAAC,IAAI,CAAC,CAAC;YACvC,IAAI,CAAC,KAAK,GAAG,IAAI,eAAe,CAAC,IAAI,CAAC,CAAC;YACvC,MAAM,IAAI,OAAO,CAAC,CAAC;gBACjB,UAAU,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;aACnB,CAAC,CAAC;SACJ;KAAA;;;;;;;IAQD,MAAM,CAAC,SAAiB,EAAY;QAClC,OAAO,OAAO,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;KAChD;;;;;;;IAQD,GAAG,CAAC,EAAU;QACZ,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,WAAW,CAAC,SAAS,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;KACzE;;;;;;;IAQD,MAAM,CAAC,SAAiB,EAAY;QAClC,OAAO,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;KACzD;;;;;;;IAQD,kBAAkB,CAAC,MAAe;;QAEhC,MAAM,GAAG,gCAAK,MAAM,KAAE,gBAAgB,EAAE,IAAI,GAAY,CAAC;QACzD,OAAO,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,yBAAyB,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,CAAkB,CAAC,CAAC;KACvG;IAEK,iBAAiB;;YACrB,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE;gBAChB,IAAI,CAAC,MAAM,GAAG,IAAI,wBAAwB,CAAC,IAAI,CAAC,CAAC;aAClD;YACD,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;SAC7B;KAAA;;;;;;IAOK,yBAAyB;;YAC7B,OAAO,yBAAyB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;SAC9C;KAAA;;;;;;IAOK,gBAAgB;;YACpB,OAAO,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;SACrC;KAAA;;;;;;;IAQK,qBAAqB,CAAC,MAAe;;;YAEzC,MAAM,GAAG,gCAAK,MAAM,KAAE,gBAAgB,EAAE,IAAI,GAAY,CAAC;YACzD,OAAO,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,oBAAoB,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC;SACjF;KAAA;;;;;;;IAQK,mBAAmB,CAAC,MAAe;;YACvC,OAAO,mBAAmB,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;SAC7D;KAAA;;;;;;;IAQK,yBAAyB,CAAC,MAAe;;YAC7C,OAAO,yBAAyB,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;SACnE;KAAA;;;;;;;IAQK,yBAAyB,CAAC,MAAe;;YAC7C,OAAO,yBAAyB,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;SACnE;KAAA;;;;;;IAOK,oBAAoB;;YACxB,OAAO,+BAA+B,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;SACpD;KAAA;;;;;;IAOK,oBAAoB;;YACxB,OAAO,oBAAoB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;SACzC;KAAA;;;;;;IAOK,kBAAkB;;YACtB,OAAO,IAAI,CAAC,KAAK,CAAC,kBAAkB,EAAE,CAAC;SACxC;KAAA;;;;;;;IAQK,QAAQ,CAAC,MAAe;;YAC5B,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC;YACzB,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;SACpC;KAAA;;;;;;;;IASK,sBAAsB,CAAC,QAAgB,EAAE,MAAe;;YAC5D,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC;YACzB,OAAO,IAAI,CAAC,KAAK,CAAC,sBAAsB,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;SAC5D;KAAA;IAEK,mBAAmB,CAAC,MAAqB,EAAE,SAAiB;;YAChE,OAAO,IAAI,CAAC,KAAK,CAAC,mBAAmB,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;SAC1D;KAAA;;;AC3XH,MAAM,IAAI,GAAU,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,CAAC,CAAC;AACxC,MAAMC,KAAG,GAAU,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC;AACpC,MAAMC,OAAK,GAAU,CAAC,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;AACzC,MAAMC,MAAI,GAAU,CAAC,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;AAExC;;;;;;;SAOgB,qBAAqB,CAAC,IAAmB,EAAE,MAAsB;;IAC/E,MAAM,UAAU,GAAG,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;IAC3C,MAAM,WAAW,GAAG,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;IAC5C,MAAM,UAAU,GAAG,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;IAC3C,MAAM,mBAAmB,GAAG,IAAI,CAAC,GAAG,CAAC,UAAU,EAAE,WAAW,EAAE,UAAU,CAAC,GAAG,IAAI,CAAC;IACjF,MAAM,gBAAgB,GAAG,mBAAmB,GAAG,IAAI,CAAC;IACpD,MAAM,gBAAgB,GAAG,mBAAmB,GAAG,CAAC,CAAC;IACjD,MAAM,gBAAgB,GAAG,gBAAgB,GAAG,CAAC,CAAC;IAE9C,IAAI,CAAC,MAAM,EAAE;QACX,MAAM,GAAG;YACP,MAAM,EAAE,MAAA,IAAI,CAAC,iBAAiB,mCAAI,IAAI,CAAC,KAAK,CAAC;YAC7C,MAAM,EAAE,mBAAmB;YAC3B,CAAC,EAAE,UAAU,GAAG,CAAC;YACjB,CAAC,EAAE,WAAW,GAAG,CAAC;YAClB,CAAC,EAAE,UAAU,GAAG,CAAC;SAClB,CAAC;KACH;SAAM;QACL,MAAM,mCACD,MAAM,KACT,MAAM,EAAE,MAAM,CAAC,MAAM,GAAG,IAAI,EAC5B,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,IAAI,EAClB,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,IAAI,EAClB,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,IAAI,GACnB,CAAC;KACH;IAED,OAAO;;QAEL;YACE,KAAK,EAAE,kDAAkD;YACzD,OAAO,EAAE,kBAAkB;YAC3B,UAAU,EAAE,KAAK;YACjB,QAAQ,EAAE,QAAQ;YAClB,eAAe,EAAE,IAAI,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC;YAC7G,KAAK,EAAE,IAAI;SACZ;;QAED;YACE,KAAK,EAAE,oDAAoD;YAC3D,OAAO,EAAE,kBAAkB;YAC3B,UAAU,EAAE,IAAI;YAChB,QAAQ,EAAE,UAAU;YACpB,eAAe,EAAE,IAAI,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC;iBAC3C,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,GAAG,gBAAgB,GAAG,CAAC,EAAE,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;iBAChF,OAAO,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC;iBACvB,KAAK,CAAC,CAAC,gBAAgB,EAAE,gBAAgB,EAAE,gBAAgB,CAAC,CAAC;YAChE,KAAK,EAAEF,KAAG;SACX;QACD;YACE,KAAK,EAAE,wDAAwD;YAC/D,OAAO,EAAE,kBAAkB;YAC3B,UAAU,EAAE,IAAI;YAChB,QAAQ,EAAE,MAAM;YAChB,eAAe,EAAE,IAAI,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC;iBAC3C,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,GAAG,gBAAgB,EAAE,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;iBAC5E,OAAO,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC;iBACvB,KAAK,CAAC,CAAE,gBAAgB,EAAE,gBAAgB,GAAG,CAAC,EAAE,gBAAgB,CAAE,CAAC;YACtE,KAAK,EAAEA,KAAG;SACX;QACD;YACE,KAAK,EAAE,yDAAyD;YAChE,OAAO,EAAE,kBAAkB;YAC3B,UAAU,EAAE,IAAI;YAChB,QAAQ,EAAE,MAAM;YAChB,IAAI,EAAE,GAAG;YACT,eAAe,EAAE,IAAI,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC;iBAC3C,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,GAAG,gBAAgB,GAAG,gBAAgB,GAAG,CAAC,EAAE,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;iBACnG,KAAK,CAAC,gBAAgB,CAAC;YAC1B,KAAK,EAAEA,KAAG;SACX;;QAED;YACE,KAAK,EAAE,oDAAoD;YAC3D,OAAO,EAAE,kBAAkB;YAC3B,UAAU,EAAE,IAAI;YAChB,QAAQ,EAAE,UAAU;YACpB,eAAe,EAAE,IAAI,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC;iBAC3C,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,GAAG,gBAAgB,GAAG,CAAC,EAAE,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;iBAChF,OAAO,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC;iBACvB,KAAK,CAAC,CAAC,gBAAgB,EAAE,gBAAgB,EAAE,gBAAgB,CAAC,CAAC;YAChE,KAAK,EAAEA,KAAG;SACX;QACD;YACE,KAAK,EAAE,wDAAwD;YAC/D,OAAO,EAAE,kBAAkB;YAC3B,UAAU,EAAE,IAAI;YAChB,QAAQ,EAAE,MAAM;YAChB,eAAe,EAAE,IAAI,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC;iBAC3C,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,GAAG,gBAAgB,EAAE,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;iBAC5E,OAAO,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;iBACtB,KAAK,CAAC,CAAE,gBAAgB,EAAE,gBAAgB,GAAG,CAAC,EAAE,gBAAgB,CAAE,CAAC;YACtE,KAAK,EAAEA,KAAG;SACX;QACD;YACE,KAAK,EAAE,yDAAyD;YAChE,OAAO,EAAE,kBAAkB;YAC3B,UAAU,EAAE,IAAI;YAChB,QAAQ,EAAE,MAAM;YAChB,IAAI,EAAE,GAAG;YACT,eAAe,EAAE,IAAI,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC;iBAC3C,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,GAAG,gBAAgB,GAAG,gBAAgB,GAAG,GAAG,EAAE,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;iBACrG,KAAK,CAAC,gBAAgB,CAAC;YAC1B,KAAK,EAAEA,KAAG;SACX;;QAED;YACE,KAAK,EAAE,oDAAoD;YAC3D,OAAO,EAAE,kBAAkB;YAC3B,UAAU,EAAE,IAAI;YAChB,QAAQ,EAAE,UAAU;YACpB,eAAe,EAAE,IAAI,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC;iBAC3C,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,GAAG,gBAAgB,GAAG,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;iBAChF,KAAK,CAAC,CAAC,gBAAgB,EAAE,gBAAgB,EAAE,gBAAgB,CAAC,CAAC;YAChE,KAAK,EAAEC,OAAK;SACb;QACD;YACE,KAAK,EAAE,wDAAwD;YAC/D,OAAO,EAAE,kBAAkB;YAC3B,UAAU,EAAE,IAAI;YAChB,QAAQ,EAAE,MAAM;YAChB,eAAe,EAAE,IAAI,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC;iBAC3C,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,GAAG,gBAAgB,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;iBAC5E,KAAK,CAAC,CAAE,gBAAgB,EAAE,gBAAgB,GAAG,CAAC,EAAE,gBAAgB,CAAE,CAAC;YACtE,KAAK,EAAEA,OAAK;SACb;QACD;YACE,KAAK,EAAE,yDAAyD;YAChE,OAAO,EAAE,kBAAkB;YAC3B,UAAU,EAAE,IAAI;YAChB,QAAQ,EAAE,MAAM;YAChB,IAAI,EAAE,GAAG;YACT,eAAe,EAAE,IAAI,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC;iBAC3C,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,GAAG,gBAAgB,GAAG,gBAAgB,GAAG,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;iBACnG,KAAK,CAAC,gBAAgB,CAAC;YAC1B,KAAK,EAAEA,OAAK;SACb;;QAED;YACE,KAAK,EAAE,oDAAoD;YAC3D,OAAO,EAAE,kBAAkB;YAC3B,UAAU,EAAE,IAAI;YAChB,QAAQ,EAAE,UAAU;YACpB,eAAe,EAAE,IAAI,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC;iBAC3C,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,GAAG,gBAAgB,GAAG,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;iBAChF,KAAK,CAAC,CAAC,gBAAgB,EAAE,gBAAgB,EAAE,gBAAgB,CAAC,CAAC;YAChE,KAAK,EAAEA,OAAK;SACb;QACD;YACE,KAAK,EAAE,wDAAwD;YAC/D,OAAO,EAAE,kBAAkB;YAC3B,UAAU,EAAE,IAAI;YAChB,QAAQ,EAAE,MAAM;YAChB,eAAe,EAAE,IAAI,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC;iBAC3C,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,GAAG,gBAAgB,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;iBAC5E,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;iBACvB,KAAK,CAAC,CAAE,gBAAgB,EAAE,gBAAgB,GAAG,CAAC,EAAE,gBAAgB,CAAE,CAAC;YACtE,KAAK,EAAEA,OAAK;SACb;QACD;YACE,KAAK,EAAE,yDAAyD;YAChE,OAAO,EAAE,kBAAkB;YAC3B,UAAU,EAAE,IAAI;YAChB,QAAQ,EAAE,MAAM;YAChB,IAAI,EAAE,GAAG;YACT,eAAe,EAAE,IAAI,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC;iBAC3C,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,GAAG,gBAAgB,GAAG,gBAAgB,GAAG,GAAG,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;iBACrG,KAAK,CAAC,gBAAgB,CAAC;YAC1B,KAAK,EAAEA,OAAK;SACb;;QAED;YACE,KAAK,EAAE,oDAAoD;YAC3D,OAAO,EAAE,kBAAkB;YAC3B,UAAU,EAAE,IAAI;YAChB,QAAQ,EAAE,UAAU;YACpB,eAAe,EAAE,IAAI,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC;iBAC3C,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,GAAG,gBAAgB,GAAG,CAAC,CAAC,CAAC;iBAChF,OAAO,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;iBACtB,KAAK,CAAC,CAAC,gBAAgB,EAAE,gBAAgB,EAAE,gBAAgB,CAAC,CAAC;YAChE,KAAK,EAAEC,MAAI;SACZ;QACD;YACE,KAAK,EAAE,wDAAwD;YAC/D,OAAO,EAAE,kBAAkB;YAC3B,UAAU,EAAE,IAAI;YAChB,QAAQ,EAAE,MAAM;YAChB,eAAe,EAAE,IAAI,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC;iBAC3C,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,GAAG,gBAAgB,CAAC,CAAC;iBAC5E,OAAO,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;iBACtB,KAAK,CAAC,CAAE,gBAAgB,EAAE,gBAAgB,GAAG,CAAC,EAAE,gBAAgB,CAAE,CAAC;YACtE,KAAK,EAAEA,MAAI;SACZ;QACD;YACE,KAAK,EAAE,yDAAyD;YAChE,OAAO,EAAE,kBAAkB;YAC3B,UAAU,EAAE,IAAI;YAChB,QAAQ,EAAE,MAAM;YAChB,IAAI,EAAE,GAAG;YACT,eAAe,EAAE,IAAI,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC;iBAC3C,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,GAAG,gBAAgB,GAAG,gBAAgB,GAAG,CAAC,CAAC,CAAC;iBACnG,KAAK,CAAC,gBAAgB,CAAC;YAC1B,KAAK,EAAEA,MAAI;SACZ;;QAED;YACE,KAAK,EAAE,oDAAoD;YAC3D,OAAO,EAAE,kBAAkB;YAC3B,UAAU,EAAE,IAAI;YAChB,QAAQ,EAAE,UAAU;YACpB,eAAe,EAAE,IAAI,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC;iBAC3C,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,GAAG,gBAAgB,GAAG,CAAC,CAAC,CAAC;iBAChF,OAAO,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC;iBACvB,KAAK,CAAC,CAAC,gBAAgB,EAAE,gBAAgB,EAAE,gBAAgB,CAAC,CAAC;YAChE,KAAK,EAAEA,MAAI;SACZ;QACD;YACE,KAAK,EAAE,wDAAwD;YAC/D,OAAO,EAAE,kBAAkB;YAC3B,UAAU,EAAE,IAAI;YAChB,QAAQ,EAAE,MAAM;YAChB,eAAe,EAAE,IAAI,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC;iBAC3C,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,GAAG,gBAAgB,CAAC,CAAC;iBAC5E,OAAO,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC;iBACvB,KAAK,CAAC,CAAE,gBAAgB,EAAE,gBAAgB,GAAG,CAAC,EAAE,gBAAgB,CAAE,CAAC;YACtE,KAAK,EAAEA,MAAI;SACZ;QACD;YACE,KAAK,EAAE,yDAAyD;YAChE,OAAO,EAAE,kBAAkB;YAC3B,UAAU,EAAE,IAAI;YAChB,QAAQ,EAAE,MAAM;YAChB,IAAI,EAAE,GAAG;YACT,eAAe,EAAE,IAAI,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC;iBAC3C,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,GAAG,gBAAgB,GAAG,gBAAgB,GAAG,GAAG,CAAC,CAAC;iBACrG,KAAK,CAAC,gBAAgB,CAAC;YAC1B,KAAK,EAAEA,MAAI;SACZ;KACF,CAAC;AACJ;;AC3PA,MAAM,IAAI,GAAU,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;AACzC,MAAM,GAAG,GAAU,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC;AACpC,MAAM,KAAK,GAAU,CAAC,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;AACzC,MAAM,IAAI,GAAU,CAAC,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;AAExC;;;;;;SAMgB,cAAc,CAAC,IAAmB,EAAE,cAAc,GAAG,KAAK;IACxE,MAAM,UAAU,GAAG,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;IAC3C,MAAM,WAAW,GAAG,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;IAC5C,MAAM,UAAU,GAAG,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;IAC3C,MAAM,YAAY,GAAG,IAAI,CAAC,GAAG,CAAC,UAAU,EAAE,WAAW,EAAE,UAAU,CAAC,GAAG,IAAI,CAAC;IAC1E,MAAM,UAAU,GAAG,YAAY,GAAG,GAAG,CAAC;IAEtC,OAAO;;QAEL;YACE,KAAK,EAAE,iDAAiD;YACxD,OAAO,EAAE,kBAAkB;YAC3B,UAAU,EAAE,IAAI;YAChB,QAAQ,EAAE,QAAQ;YAClB,eAAe,EAAE,IAAI,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,YAAY,CAAC;YAClE,KAAK,EAAE,IAAI;SACZ;;QAED;YACE,KAAK,EAAE,4CAA4C;YACnD,OAAO,EAAE,kBAAkB;YAC3B,UAAU,EAAE,IAAI;YAChB,QAAQ,EAAE,UAAU;YACpB,eAAe,EAAE,IAAI,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC;iBAC3C,SAAS,CAAC,CAAC,UAAU,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;iBACjC,OAAO,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC;iBACvB,KAAK,CAAC,CAAC,UAAU,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC;YAC9C,KAAK,EAAE,GAAG;SACX;QACD;YACE,KAAK,EAAE,gDAAgD;YACvD,OAAO,EAAE,kBAAkB;YAC3B,UAAU,EAAE,IAAI;YAChB,QAAQ,EAAE,MAAM;YAChB,eAAe,EAAE,IAAI,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC;iBAC3C,SAAS,CAAC,CAAC,UAAU,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;iBAC7B,OAAO,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC;iBACvB,KAAK,CAAC,CAAE,YAAY,EAAE,YAAY,GAAG,CAAC,EAAE,YAAY,CAAE,CAAC;YAC1D,KAAK,EAAE,GAAG;SACX;QACD;YACE,KAAK,EAAE,kDAAkD;YACzD,OAAO,EAAE,kBAAkB;YAC3B,UAAU,EAAE,IAAI;YAChB,QAAQ,EAAE,MAAM;YAChB,IAAI,EAAE,GAAG;YACT,eAAe,EAAE,IAAI,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,YAAY,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,YAAY,CAAC;YACvG,KAAK,EAAE,GAAG;SACX;QACD;YACE,KAAK,EAAE,kDAAkD;YACzD,OAAO,EAAE,kBAAkB;YAC3B,UAAU,EAAE,IAAI;YAChB,QAAQ,EAAE,MAAM;YAChB,IAAI,EAAE,GAAG;YACT,eAAe,EAAE,IAAI,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,SAAS,CAAC,CAAC,UAAU,GAAG,YAAY,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,YAAY,CAAC;YACnH,KAAK,EAAE,GAAG;SACX;;QAED;YACE,KAAK,EAAE,4CAA4C;YACnD,OAAO,EAAE,kBAAkB;YAC3B,UAAU,EAAE,IAAI;YAChB,QAAQ,EAAE,UAAU;YACpB,eAAe,EAAE,IAAI,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC;iBAC3C,SAAS,CAAC,CAAC,CAAC,EAAE,WAAW,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;iBAClC,KAAK,CAAC,CAAC,UAAU,EAAE,WAAW,EAAE,UAAU,CAAC,CAAC;YAC/C,KAAK,EAAE,KAAK;SACb;QACD;YACE,KAAK,EAAE,gDAAgD;YACvD,OAAO,EAAE,kBAAkB;YAC3B,UAAU,EAAE,IAAI;YAChB,QAAQ,EAAE,MAAM;YAChB,eAAe,EAAE,IAAI,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC;iBAC3C,SAAS,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC;iBAC9B,KAAK,CAAC,CAAE,YAAY,EAAE,YAAY,GAAG,CAAC,EAAE,YAAY,CAAE,CAAC;YAC1D,KAAK,EAAE,KAAK;SACb;QACD;YACE,KAAK,EAAE,kDAAkD;YACzD,OAAO,EAAE,kBAAkB;YAC3B,UAAU,EAAE,IAAI;YAChB,QAAQ,EAAE,MAAM;YAChB,IAAI,EAAE,GAAG;YACT,eAAe,EAAE,IAAI,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,SAAS,CAAC,CAAC,YAAY,GAAG,GAAG,EAAE,YAAY,GAAG,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,YAAY,CAAC;YACzH,KAAK,EAAE,KAAK;SACb;QACD;YACE,KAAK,EAAE,kDAAkD;YACzD,OAAO,EAAE,kBAAkB;YAC3B,UAAU,EAAE,IAAI;YAChB,QAAQ,EAAE,MAAM;YAChB,IAAI,EAAE,GAAG;YACT,eAAe,EAAE,IAAI,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,WAAW,GAAG,YAAY,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,YAAY,CAAC;YACpH,KAAK,EAAE,KAAK;SACb;;QAED;YACE,KAAK,EAAE,4CAA4C;YACnD,OAAO,EAAE,kBAAkB;YAC3B,UAAU,EAAE,IAAI;YAChB,QAAQ,EAAE,UAAU;YACpB,eAAe,EAAE,IAAI,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC;iBAC3C,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,UAAU,GAAG,CAAC,CAAC,CAAC;iBACjC,OAAO,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;iBACtB,KAAK,CAAC,CAAC,UAAU,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC;YAC9C,KAAK,EAAE,IAAI;SACZ;QACD;YACE,KAAK,EAAE,gDAAgD;YACvD,OAAO,EAAE,kBAAkB;YAC3B,UAAU,EAAE,IAAI;YAChB,QAAQ,EAAE,MAAM;YAChB,eAAe,EAAE,IAAI,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC;iBAC3C,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,UAAU,CAAC,CAAC;iBAC7B,OAAO,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;iBACtB,KAAK,CAAC,CAAE,YAAY,EAAE,YAAY,GAAG,CAAC,EAAE,YAAY,CAAE,CAAC;YAC1D,KAAK,EAAE,IAAI;SACZ;QACD;YACE,KAAK,EAAE,kDAAkD;YACzD,OAAO,EAAE,kBAAkB;YAC3B,UAAU,EAAE,IAAI;YAChB,QAAQ,EAAE,MAAM;YAChB,IAAI,EAAE,GAAG;YACT,eAAe,EAAE,IAAI,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,SAAS,CAAC,CAAC,YAAY,GAAG,GAAG,EAAE,CAAE,YAAY,GAAG,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,YAAY,CAAC;YAC3H,KAAK,EAAE,IAAI;SACZ;QACD;YACE,KAAK,EAAE,kDAAkD;YACzD,OAAO,EAAE,kBAAkB;YAC3B,UAAU,EAAE,IAAI;YAChB,QAAQ,EAAE,MAAM;YAChB,IAAI,EAAE,GAAG;YACT,eAAe,EAAE,IAAI,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,UAAU,GAAG,YAAY,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,YAAY,CAAC;YACnH,KAAK,EAAE,IAAI;SACZ;KACF,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,cAAc,IAAI,CAAC,CAAC,QAAQ,KAAK,MAAM,IAAI,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,IAAI,CAAuB,CAAC;AACtG;;AC5JA;;;;ACAA;;;;;;"} \ No newline at end of file diff --git a/ccf-database/lib/ccf-database.d.ts b/ccf-database/lib/ccf-database.d.ts deleted file mode 100644 index c51cfbff4..000000000 --- a/ccf-database/lib/ccf-database.d.ts +++ /dev/null @@ -1,169 +0,0 @@ -import { JsonLd } from 'jsonld/jsonld-spec'; -import { Quad, Store } from 'triple-store-utils'; -import { CCFSpatialGraph } from './ccf-spatial-graph'; -import { CCFSpatialScene, SpatialSceneNode } from './ccf-spatial-scene'; -import { AggregateResult, DatabaseStatus, Filter, OntologyTreeModel, TissueBlockResult } from './interfaces'; -import { FlatSpatialPlacement, SpatialEntity } from './spatial-types'; -/** Database initialization options. */ -export interface CCFDatabaseOptions { - /** A url to load data from. */ - ccfOwlUrl: string; - /** Context. */ - ccfContextUrl: string; - /** A list of data sources (in n3, rdf, xml, owl, or jsonld format) */ - dataSources: (string | JsonLd)[]; - /** Data service type. */ - hubmapDataService: 'static' | 'search-api'; - /** HuBMAP Elastic Search Query */ - hubmapQuery?: unknown; - /** Hubmap Portal url. */ - hubmapPortalUrl: string; - /** Hubmap data url. */ - hubmapDataUrl: string; - /** Hubmap assets api url. */ - hubmapAssetsUrl: string; - /** HuBMAP Service Token. */ - hubmapToken?: string; -} -/** Default initialization options. */ -export declare const DEFAULT_CCF_DB_OPTIONS: CCFDatabaseOptions; -/** Database provider. */ -export declare class CCFDatabase { - options: CCFDatabaseOptions; - /** The triple store. */ - store: Store; - /** The spatial graph */ - graph: CCFSpatialGraph; - /** Creates SpatialEntity Scenes */ - scene: CCFSpatialScene; - /** If the database is initialized */ - private initializing?; - private status; - /** - * Creates an instance of ccfdatabase. - * - * @param [options] Initialization options. - */ - constructor(options?: CCFDatabaseOptions); - /** - * Connects the database. - * - * @param [options] Options used to initialize. - * @returns A promise resolving to true if data has been loaded into the database. - */ - connect(options?: CCFDatabaseOptions, cached?: boolean): Promise; - private cachedConnect; - /** - * Actually connects to the database. - * - * @returns A promise resolving to void when connected. - */ - private doConnect; - addDataSources(sources: (string | JsonLd)[], inputStore?: Store): Promise; - synchronize(): Promise; - serialize(): string; - deserialize(value: string): Promise; - /** - * Gets all ids matching the filter. - * - * @param [filter] The filter. - * @returns A set of all matching ids. - */ - getIds(filter?: Filter): Set; - /** - * Gets the data for an object. - * - * @param id The id of the requested object. - * @returns The object data. - */ - get(id: string): Quad[]; - /** - * Gets the data for objects matching a filter. - * - * @param [filter] The filter. - * @returns An array of data. - */ - search(filter?: Filter): Quad[][]; - /** - * Gets all spatial entities for a filter. - * - * @param [filter] The filter. - * @returns A list of spatial entities. - */ - getSpatialEntities(filter?: Filter): SpatialEntity[]; - getDatabaseStatus(): Promise; - /** - * Get a list of technology names used by datasets - * - * @returns list of unique technology names in the data - */ - getDatasetTechnologyNames(): Promise; - /** - * Get a list of provider names from the database - * - * @returns list of unique provider names in the data - */ - getProviderNames(): Promise; - /** - * Gets all tissue block results for a filter. - * - * @param [filter] The filter. - * @returns A list of results. - */ - getTissueBlockResults(filter?: Filter): Promise; - /** - * Gets all aggregate results for a filter. - * - * @param [filter] The filter. - * @returns A list of aggregate data. - */ - getAggregateResults(filter?: Filter): Promise; - /** - * Get number of occurrences of ontology terms for a set of ids. - * - * @param [filter] The filter. - * @returns Ontology term counts. - */ - getOntologyTermOccurences(filter?: Filter): Promise>; - /** - * Get number of occurrences of cell type terms for a set of ids. - * - * @param [filter] The filter. - * @returns Cell type term counts. - */ - getCellTypeTermOccurences(filter?: Filter): Promise>; - /** - * Get ontology term tree nodes - * - * @returns Ontology term counts. - */ - getOntologyTreeModel(): Promise; - /** - * Get cell type term tree nodes - * - * @returns Ontology term counts. - */ - getCellTypeTreeModel(): Promise; - /** - * Get reference organs - * - * @returns Ontology term counts. - */ - getReferenceOrgans(): Promise; - /** - * Get all nodes to form the 3D scene of reference body, organs, and tissues - * - * @param [filter] The filter. - * @returns A list of Spatial Scene Nodes for the 3D Scene - */ - getScene(filter?: Filter): Promise; - /** - * Get all nodes to form the 3D scene of reference organ and tissues - * - * @param [organIri] The Reference Organ IRI - * @param [filter] The filter. - * @returns A list of Spatial Scene Nodes for the 3D Scene - */ - getReferenceOrganScene(organIri: string, filter?: Filter): Promise; - getSpatialPlacement(source: SpatialEntity, targetIri: string): Promise; -} diff --git a/ccf-database/lib/ccf-spatial-graph.d.ts b/ccf-database/lib/ccf-spatial-graph.d.ts deleted file mode 100644 index 83359f629..000000000 --- a/ccf-database/lib/ccf-spatial-graph.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { Matrix4 } from '@math.gl/core'; -import { CCFDatabase } from './ccf-database'; -import { FlatSpatialPlacement, SpatialEntity, SpatialPlacement } from './spatial-types'; -export declare function applySpatialPlacement(tx: Matrix4, placement: SpatialPlacement): Matrix4; -export declare class CCFSpatialGraph { - private db; - graph: any; - constructor(db: CCFDatabase); - createGraph(): void; - addNode(id: string, type: string): void; - addEdge(id: string, source: string, target: string, type: string): void; - getTransformationMatrix(sourceIRI: string, targetIRI: string): Matrix4 | undefined; - getSpatialPlacement(source: SpatialEntity, targetIri: string): FlatSpatialPlacement | undefined; -} diff --git a/ccf-database/lib/ccf-spatial-scene.d.ts b/ccf-database/lib/ccf-spatial-scene.d.ts deleted file mode 100644 index 0f8e2a7cd..000000000 --- a/ccf-database/lib/ccf-spatial-scene.d.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { Matrix4 } from '@math.gl/core'; -import { CCFDatabase } from './ccf-database'; -import { Filter } from './interfaces'; -import { ExtractionSet, SpatialEntity } from './spatial-types'; -export declare type SpatialSceneGeometry = 'sphere' | 'cube' | 'wireframe' | 'text' | 'cone' | 'cylinder'; -export interface SpatialSceneNode { - '@id': string; - '@type': string; - entityId?: string; - ccf_annotations?: string[]; - representation_of?: string; - reference_organ?: string; - unpickable?: boolean; - geometry?: SpatialSceneGeometry; - text?: string; - _lighting?: string; - scenegraph?: string; - scenegraphNode?: string; - zoomBasedOpacity?: boolean; - zoomToOnLoad?: boolean; - color?: [number, number, number, number]; - opacity?: number; - transformMatrix: Matrix4; - name?: string; - tooltip?: string; - priority?: number; -} -export declare class CCFSpatialScene { - private db; - constructor(db: CCFDatabase); - getSpatialEntity(iri: string): SpatialEntity; - getExtractionSets(iri: string): ExtractionSet[]; - getExtractionSet(iri: string): ExtractionSet; - getAnatomicalStructures(iri: string): SpatialEntity[]; - getReferenceOrgans(): SpatialEntity[]; - getReferenceBody(filter?: Filter): SpatialEntity; - getReferenceOrganSets(filter?: Filter): SpatialEntity[]; - getReferenceSceneNodes(filter?: Filter): SpatialSceneNode[]; - getReferenceOrganScene(organIri: string, filter?: Filter): SpatialSceneNode[]; - getEntitySceneNodes(filter?: Filter): SpatialSceneNode[]; - getSceneNode(source: SpatialEntity, target: SpatialEntity, nodeAttrs?: Partial): SpatialSceneNode | undefined; - getScene(filter?: Filter): SpatialSceneNode[]; -} diff --git a/ccf-database/lib/hubmap/hubmap-data-import.d.ts b/ccf-database/lib/hubmap/hubmap-data-import.d.ts deleted file mode 100644 index febefcdb4..000000000 --- a/ccf-database/lib/hubmap/hubmap-data-import.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { JsonLd } from 'jsonld/jsonld-spec'; -import { Store } from 'triple-store-utils'; -/** - * Search the HuBMAP Search API and return CCF-compatible JSON-LD data - * - * @param dataUrl the search API url - * @param serviceType 'static' if a statically saved response or 'search-api' if querying the search-api live - * @param query the elastic search query to use - * @param serviceToken the api key to the search-api - * @param assetsApi the assets api endpoint - * @param portalUrl the portal url to point to - * @returns CCF-compatible JSON-LD data or undefined on error - */ -export declare function searchHubmap(dataUrl: string, serviceType: 'static' | 'search-api', query?: unknown, serviceToken?: string, assetsApi?: string, portalUrl?: string): Promise; -/** - * Adds hubmap data from a url to the triple store. - * - * @param store The triple store. - * @param dataUrl The data url. - * @param serviceType The service type. - */ -export declare function addHubmapDataToStore(store: Store, dataUrl: string, serviceType: 'static' | 'search-api', serviceToken?: string, assetsApi?: string, portalUrl?: string): Promise; diff --git a/ccf-database/lib/hubmap/hubmap-data.d.ts b/ccf-database/lib/hubmap/hubmap-data.d.ts deleted file mode 100644 index 36a8d802f..000000000 --- a/ccf-database/lib/hubmap/hubmap-data.d.ts +++ /dev/null @@ -1,77 +0,0 @@ -import { JsonLd, JsonLdObj } from 'jsonld/jsonld-spec'; -declare type JsonDict = Record; -export declare const DR1_VU_THUMBS: Set; -export declare const UFL_THUMBS: { - 'HBM558.SRZG.629': string; - 'HBM562.NTMH.548': string; - 'HBM685.KHRQ.684': string; - 'HBM278.SFQW.627': string; - 'HBM427.SMGB.866': string; - 'HBM432.LLCF.677': string; - 'HBM586.ZSVS.996': string; - 'HBM285.XMBT.542': string; - 'HBM289.BWJW.663': string; - 'HBM255.SRPR.985': string; - 'HBM799.WXHD.535': string; - 'HBM294.RZFN.624': string; - 'HBM383.TRQG.424': string; - 'HBM647.MFQB.496': string; - 'HBM237.GGPR.739': string; - 'HBM288.TPBD.654': string; - 'HBM974.NDXT.675': string; - 'HBM589.SLVV.423': string; - 'HBM794.RLFN.358': string; - 'HBM372.BQSR.778': string; - 'HBM499.TKDW.458': string; - 'HBM342.PRQB.739': string; - 'HBM633.CLVN.674': string; - 'HBM343.JQKM.578': string; - 'HBM987.XGTH.368': string; - 'HBM964.CWCP.788': string; - 'HBM244.TJLK.223': string; - 'HBM646.FSBQ.966': string; - 'HBM572.GXSB.234': string; - 'HBM772.TKGJ.794': string; - 'HBM239.CBWR.263': string; - 'HBM992.NRTT.383': string; - 'HBM283.DQXD.546': string; - 'HBM795.JHND.856': string; - 'HBM267.BZKT.867': string; - 'HBM838.DLMJ.782': string; - 'HBM337.FSXL.564': string; - 'HBM355.JDLK.244': string; - 'HBM599.PSZG.737': string; -}; -/** - * Converts a hubmap response object into JsonLd. - * - * @param data The hubmap data. - * @returns The converted data. - */ -export declare function hubmapResponseAsJsonLd(data: unknown, assetsApi?: string, portalUrl?: string, serviceToken?: string, debug?: boolean): JsonLd; -export declare class HuBMAPTissueBlock { - data: JsonDict; - bad: boolean; - donor: JsonLdObj; - '@id': string; - '@type': string; - label: string; - description: string; - link: string; - sample_type: string; - section_count: number; - section_size: number; - section_units: string; - rui_location: JsonLdObj; - sections: JsonLdObj[]; - datasets: JsonLdObj[]; - constructor(data: JsonDict, assetsApi?: string, portalUrl?: string, serviceToken?: string); - getSection(section: JsonDict, data: JsonDict, portalUrl: string): JsonLdObj; - getDataset(dataset: JsonDict, assetsApi?: string, portalUrl?: string, serviceToken?: string): JsonLdObj; - getDatasetThumbnail(dataset: JsonDict, assetsApi: string, serviceToken?: string): string | undefined; - getDonor(donor: JsonDict, portalUrl: string): JsonLdObj; - getRuiLocation(data: JsonDict, donor: JsonLdObj): JsonLdObj | undefined; - getTissueBlock(): JsonLdObj; - toJsonLd(): JsonLdObj; -} -export {}; diff --git a/ccf-database/lib/interfaces.d.ts b/ccf-database/lib/interfaces.d.ts deleted file mode 100644 index 3057adc28..000000000 --- a/ccf-database/lib/interfaces.d.ts +++ /dev/null @@ -1,152 +0,0 @@ -/** Status of the database */ -export interface DatabaseStatus { - /** Status of the database */ - status: 'Ready' | 'Loading' | 'Error'; - /** How long to wait (in milliseconds) before checking status again */ - checkback?: number; - /** The amount of time (in milliseconds) taken to load the database */ - loadTime?: number; - /** Human readable description of the current status */ - message?: string; -} -/** Aggregate query result */ -export interface AggregateResult { - /** Queried field */ - label: string; - /** Aggregate value */ - count: string | number; -} -/** List result */ -export interface ListResultItem { - /** Identifier */ - '@id': string; - /** Label */ - label: string; - /** Description */ - description: string; - /** Associated URL */ - link: string; -} -/** Donor List Result */ -export interface DonorResult extends ListResultItem { - /** JSON-LD Type */ - '@type': 'Donor'; - /** Provider Name */ - providerName: string; -} -/** Dataset List Result */ -export interface DatasetResult extends ListResultItem { - /** JSON-LD Type */ - '@type': 'Dataset'; - /** Technology used in data */ - technology: string; - /** Representative thumbnail URL */ - thumbnail: string; -} -/** Tissue Section List Result */ -export interface TissueSectionResult extends ListResultItem { - /** JSON-LD Type */ - '@type': 'Sample'; - /** Sample tissue section type */ - sampleType: 'Tissue Section' | 'Non-Standard'; - /** Index into the sequence of sections from the parent block */ - sectionNumber: number; - /** Datasets derived from this tissue section */ - datasets: DatasetResult[]; -} -/** Tissue Block List Result */ -export interface TissueBlockResult extends ListResultItem { - /** JSON-LD Type */ - '@type': 'Sample'; - /** Sample tissue block type */ - sampleType: 'Tissue Block' | 'Non-Standard'; - /** Number of sections extracted from this block */ - sectionCount: number; - /** Size of each tissue section */ - sectionSize: number; - /** Units of the section size (generally, millimeters) */ - sectionUnits: string; - /** The donor this tissue block was derived from */ - donor: DonorResult; - /** The associated spatial entity (rui_location) for this block */ - spatialEntityId: string; - /** The sections extracted from this tissue block */ - sections: TissueSectionResult[]; - /** Datasets derived from this tissue block */ - datasets: DatasetResult[]; -} -/** Item that can be searched for */ -export interface SearchableItem { - /** Identifier */ - id: string; - /** Sex */ - sex?: 'Male' | 'Female'; - /** Age */ - age?: number; - /** BMI */ - bmi?: number; - /** Ontology terms */ - ontologyTerms?: Set; - /** CellType terms */ - cellTypeTerms?: Set; -} -/** Specification for a Spatial Search via Probing Sphere */ -export interface SpatialSearch { - /** X coordinate relative to target in millimeters */ - x: number; - /** y coordinate relative to target in millimeters */ - y: number; - /** z coordinate relative to target in millimeters */ - z: number; - /** Size of the probing sphere in millimeters */ - radius: number; - /** The target spatial entity IRI */ - target: string; -} -/** Options applied during queries */ -export interface Filter { - /** Sex */ - sex: 'Both' | 'Male' | 'Female'; - /** Age range */ - ageRange: [number, number]; - /** BMI range */ - bmiRange: [number, number]; - /** TMC */ - tmc: string[]; - /** Technologies */ - technologies: string[]; - /** Ontology terms */ - ontologyTerms: string[]; - /** CellType terms */ - cellTypeTerms: string[]; - /** spatial search */ - spatialSearches: SpatialSearch[]; - /** Include optional debugging information */ - debug?: boolean; -} -/** A node in the ontology */ -export interface OntologyTreeNode { - /** Identifier / IRI */ - '@id': string; - /** JSON-LD Type */ - '@type': 'OntologyTreeNode'; - /** Identifier / IRI */ - id: string; - /** RDFS label */ - label: string; - /** Parent ontology node */ - parent: string; - /** Child ontology nodes */ - children: string[]; - /** Synonym labels */ - synonymLabels: string[]; -} -/** Ontology tree model */ -export interface OntologyTreeModel { - /** id of the root node of the ontology */ - root: string; - /** Mapping from id/IRI to ontology node instance */ - nodes: { - [id: string]: OntologyTreeNode; - }; -} diff --git a/ccf-database/lib/queries/aggregate-results-n3.d.ts b/ccf-database/lib/queries/aggregate-results-n3.d.ts deleted file mode 100644 index 93420b7a4..000000000 --- a/ccf-database/lib/queries/aggregate-results-n3.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { Store } from 'triple-store-utils'; -import { AggregateResult } from '../interfaces'; -/** - * Computes aggregate results. - * - * @param ids Ids of objects to calculate aggregate over. - * @param store The triple store. - * @returns The list of aggregate results. - */ -export declare function getAggregateResults(ids: Set, store: Store): AggregateResult[]; -/** - * Get a list of technology names used by datasets - * - * @param store The triple store. - * @returns list of unique technology names in the data - */ -export declare function getDatasetTechnologyNames(store: Store): string[]; -/** - * Get a list of provider names from the database - * - * @param store The triple store. - * @returns list of unique provider names in the data - */ -export declare function getProviderNames(store: Store): string[]; diff --git a/ccf-database/lib/queries/find-ids-n3.d.ts b/ccf-database/lib/queries/find-ids-n3.d.ts deleted file mode 100644 index 95c78a319..000000000 --- a/ccf-database/lib/queries/find-ids-n3.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { Store } from 'triple-store-utils'; -import { CCFSpatialGraph } from '../ccf-spatial-graph'; -import { Filter } from '../interfaces'; -/** - * Finds all ids of object matching a filter. - * - * @param store The triple store. - * @param filter The filter to limit objects. - * @returns A set of all ids matching the filter. - */ -export declare function findIds(store: Store, graph: CCFSpatialGraph, filter: Filter): Set; diff --git a/ccf-database/lib/queries/ontology-term-occurences-n3.d.ts b/ccf-database/lib/queries/ontology-term-occurences-n3.d.ts deleted file mode 100644 index 725dc15a3..000000000 --- a/ccf-database/lib/queries/ontology-term-occurences-n3.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { Store } from 'triple-store-utils'; -/** - * Get number of occurrences of ontology terms for a set of ids. - * - * @param ids Ids of objects to calculate aggregate over. - * @param store The triple store. - * @returns Ontology term counts. - */ -export declare function getOntologyTermOccurences(ids: Set, store: Store): Record; -/** - * Get number of occurrences of cell type terms for a set of ids. - * - * @param ids Ids of objects to calculate aggregate over. - * @param store The triple store. - * @returns Ontology term counts. - */ -export declare function getCellTypeTermOccurences(ids: Set, store: Store): Record; diff --git a/ccf-database/lib/queries/ontology-tree-n3.d.ts b/ccf-database/lib/queries/ontology-tree-n3.d.ts deleted file mode 100644 index 14f48a895..000000000 --- a/ccf-database/lib/queries/ontology-tree-n3.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { Store } from 'triple-store-utils'; -import { OntologyTreeModel, OntologyTreeNode } from '../interfaces'; -export declare function getOntologyTreeNode(store: Store, iri: string, relationshipIri: string): OntologyTreeNode; -export declare function getOntologyTreeModel(store: Store, rootIri: string, rootLabel: string, relationshipIri: string): OntologyTreeModel; -export declare function getAnatomicalStructureTreeModelSlowly(store: Store): OntologyTreeModel; -export declare const getAnatomicalStructureTreeModel: typeof getAnatomicalStructureTreeModelSlowly & import("lodash").MemoizedFunction; -export declare function getCellTypeTreeModel(store: Store): OntologyTreeModel; diff --git a/ccf-database/lib/queries/spatial-result-n3.d.ts b/ccf-database/lib/queries/spatial-result-n3.d.ts deleted file mode 100644 index fdbef5ddf..000000000 --- a/ccf-database/lib/queries/spatial-result-n3.d.ts +++ /dev/null @@ -1,65 +0,0 @@ -import { Store } from 'triple-store-utils'; -import { SpatialEntity, SpatialObjectReference, SpatialPlacement, ExtractionSet } from '../spatial-types'; -/** - * Creates a spatial object reference. - * - * @param store The triple store. - * @param iri The data identifier. - * @returns The new reference. - */ -export declare function getSpatialObjectReference(store: Store, iri: string): SpatialObjectReference; -/** - * Creates an extraction set data object. - * - * @param store The triple store. - * @param iri The data identifier. - * @returns The new entity. - */ -export declare function getExtractionSet(store: Store, iri: string): ExtractionSet; -/** - * Gets extraction sets associated with a reference organ - * - * @param store The triple store. - * @param iri The data identifier (the reference organ). - * @returns A set of extraction sets associated with the reference organ - */ -export declare function getExtractionSets(store: Store, iri: string): ExtractionSet[]; -/** - * Gets the anatomical structures associated with a reference organ. - * - * @param store The triple store. - * @param iri The data identifier (reference organ). - * @returns The new entity. - */ -export declare function getAnatomicalStructures(store: Store, iri: string): SpatialEntity[]; -/** - * Gets all reference organs in the triple store - * - * @param store The triple store. - * @returns All the reference organs. - */ -export declare function getReferenceOrgans(store: Store): SpatialEntity[]; -/** - * Creates a spatial entity data object. - * - * @param store The triple store. - * @param iri The data identifier. - * @returns The new entity. - */ -export declare function getSpatialEntity(store: Store, iri: string): SpatialEntity; -/** - * Creates a spatial placement object. - * - * @param store The triple store. - * @param iri The data identifier. - * @returns THe new placement object. - */ -export declare function getSpatialPlacement(store: Store, iri: string): SpatialPlacement; -/** - * Creates a spatial entity based on another entity in the store. - * - * @param store The triple store. - * @param entityIRI The indentifier of the store entity. - * @returns A new entity. - */ -export declare function getSpatialEntityForEntity(store: Store, entityIRI: string): SpatialEntity | undefined; diff --git a/ccf-database/lib/queries/spatial-search-n3.d.ts b/ccf-database/lib/queries/spatial-search-n3.d.ts deleted file mode 100644 index 79121f731..000000000 --- a/ccf-database/lib/queries/spatial-search-n3.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { OrientedBoundingBox } from '@math.gl/culling'; -import { Store } from 'triple-store-utils'; -import { CCFSpatialGraph } from '../ccf-spatial-graph'; -import { SpatialSearch } from '../interfaces'; -export declare function getOrientedBoundingBox(store: Store, graph: CCFSpatialGraph, sourceIri: string, targetIri: string): OrientedBoundingBox | undefined; -export declare function filterByProbingSphere(store: Store, graph: CCFSpatialGraph, seen: Set, search: SpatialSearch): Set; diff --git a/ccf-database/lib/queries/tissue-block-result-n3.d.ts b/ccf-database/lib/queries/tissue-block-result-n3.d.ts deleted file mode 100644 index 26ae5285f..000000000 --- a/ccf-database/lib/queries/tissue-block-result-n3.d.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { Store } from 'triple-store-utils'; -import { DatasetResult, DonorResult, TissueBlockResult, TissueSectionResult } from '../interfaces'; -/** - * Extracts a single donor result from the triple store. - * - * @param store The triple store. - * @param iri The entity id. - * @returns The list data. - */ -export declare function getDonorResult(store: Store, iri: string): DonorResult; -/** - * Extracts a single dataset result from the triple store. - * - * @param store The triple store. - * @param iri The entity id. - * @returns The list data. - */ -export declare function getDatasetResult(store: Store, iri: string): DatasetResult; -/** - * Extracts a single tissue section result from the triple store. - * - * @param store The triple store. - * @param iri The entity id. - * @returns The list data. - */ -export declare function getTissueSectionResult(store: Store, iri: string): TissueSectionResult; -/** - * Extracts a single tissue block result from the triple store. - * - * @param store The triple store. - * @param iri The entity id. - * @returns The list data. - */ -export declare function getTissueBlockResult(store: Store, iri: string): TissueBlockResult; diff --git a/ccf-database/lib/spatial-types.d.ts b/ccf-database/lib/spatial-types.d.ts deleted file mode 100644 index 2b50990eb..000000000 --- a/ccf-database/lib/spatial-types.d.ts +++ /dev/null @@ -1,126 +0,0 @@ -/** A reference to a spatial object */ -export interface SpatialObjectReference { - /** Identifier */ - '@id': string; - /** Type name */ - '@type': 'SpatialObjectReference'; - /** Data file name */ - file: string; - /** Data format */ - file_format: string; - /** File subpath */ - file_subpath?: string; -} -/** A set of extraction sites */ -export interface ExtractionSet { - /** Identifier */ - '@id': string; - /** Type name */ - '@type': 'ExtractionSet'; - /** Entity label */ - label: string; - /** The list of extraction sites in this set */ - extractionSites: SpatialEntity[]; -} -/** A spatial entity */ -export interface SpatialEntity { - /** Identifier */ - '@id': string; - /** Type name */ - '@type': 'SpatialEntity'; - /** IRI of the Entity this Spatial Entity represents */ - entityId?: string; - /** Entity label */ - label?: string; - /** Entity comment */ - comment?: string; - /** Creator */ - creator?: string; - /** Creator first name */ - creator_first_name?: string; - /** Creator last name */ - creator_last_name?: string; - /** Creator identifier */ - creator_orcid?: string; - /** Creation date */ - creation_date?: string; - /** Annotations (a set of IRIs) */ - ccf_annotations?: string[]; - /** Annotation (IRI) that says what this entity represents */ - representation_of?: string; - /** Specifies if this is an anatomical structure of this organ (IRI) */ - reference_organ?: string; - /** Specifies (where applicable) if this entity came from a Male or Female */ - sex: 'Male' | 'Female' | undefined; - /** Specifies (where applicable) if this entity came from the left or right side organ */ - side: 'Left' | 'Right' | undefined; - /** Ranking used in the RUI for ordering lists */ - rui_rank?: number; - /** The thickness (in nanometers) of slices taken out of this spatial entity */ - slice_thickness?: number; - /** The number of slices taken out of this spatial entity */ - slice_count?: number; - /** X-dimension */ - x_dimension: number; - /** Y-dimension */ - y_dimension: number; - /** Z-dimension */ - z_dimension: number; - /** Units dimensions are in */ - dimension_units: string; - /** Data references */ - object?: SpatialObjectReference; - /** Coloring */ - color?: [number, number, number, number]; -} -/** Object describing the placement of an entity */ -export interface SpatialPlacementCommon { - /** JSON-LD context */ - '@context'?: string; - /** Identifier */ - '@id': string; - /** Type name */ - '@type': 'SpatialPlacement'; - /** Date placement was made */ - placement_date: string; - /** Scaling in x-dimension */ - x_scaling: number; - /** Scaling in y-dimension */ - y_scaling: number; - /** Scaling in z-dimension */ - z_scaling: number; - /** Units scaling is expressed in */ - scaling_units: string; - /** Rotation in x-dimension */ - x_rotation: number; - /** Rotation in y-dimension */ - y_rotation: number; - /** Rotation in z-dimension */ - z_rotation: number; - /** Rotation in w-dimension */ - w_rotation?: number; - /** Order rotations should be applied in */ - rotation_order?: string; - /** Units rotation is expressed in */ - rotation_units: string; - /** Translation in x-dimension */ - x_translation: number; - /** Translation in y-dimension */ - y_translation: number; - /** Translation in z-dimension */ - z_translation: number; - /** Units translation is expressed in */ - translation_units: string; -} -export interface SpatialPlacement extends SpatialPlacementCommon { - /** Source entity */ - source: SpatialEntity | SpatialObjectReference; - /** Target entity */ - target: SpatialEntity; -} -export interface FlatSpatialPlacement extends SpatialPlacementCommon { - /** Source entity iri */ - source: string; - /** Target entity iri */ - target: string; -} diff --git a/ccf-database/lib/util/ccf-database-status-tracker.d.ts b/ccf-database/lib/util/ccf-database-status-tracker.d.ts deleted file mode 100644 index 0de6bf0d5..000000000 --- a/ccf-database/lib/util/ccf-database-status-tracker.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { DatabaseStatus } from '../interfaces'; -import { CCFDatabase } from '../ccf-database'; -export declare class CCFDatabaseStatusTracker { - database: CCFDatabase; - status: 'Ready' | 'Loading' | 'Error'; - message?: string; - loadTime?: number; - constructor(database: CCFDatabase); - toJson(): DatabaseStatus; - private connect; -} diff --git a/ccf-database/lib/util/enrich-rui-locations.d.ts b/ccf-database/lib/util/enrich-rui-locations.d.ts deleted file mode 100644 index 821fb80e1..000000000 --- a/ccf-database/lib/util/enrich-rui-locations.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { Store } from 'triple-store-utils'; -/** - * Function to add additional ccf_annotations to rui locations based on the - * reference organ it was placed relative to. - * - * @param store the triple store holding the CCF.OWL data - */ -export declare function enrichRuiLocations(store: Store): void; diff --git a/ccf-database/lib/util/n3-functions.d.ts b/ccf-database/lib/util/n3-functions.d.ts deleted file mode 100644 index ba20d10fa..000000000 --- a/ccf-database/lib/util/n3-functions.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { Store } from 'triple-store-utils'; -/** - * Iterates over the key/value pairs for an IRI, using the specified mapping with quads from the store. - * - * @param store The triple store. - * @param iri The data identifier. - * @param mapping Property mappings. - * @returns an iterator over the key/value pairs - */ -export declare function getEntries(store: Store, iri: string, mapping: { - [iri: string]: string; -}): Generator<[string, string | number]>; -/** - * Creates an object of the specified type using quads from the store. - * - * @param store The triple store. - * @param iri The data identifier. - * @param type Type name. - * @param mapping Property mappings. - * @returns A new data object. - */ -export declare function getMappedResult(store: Store, iri: string, type: string, mapping: { - [iri: string]: string; -}): T; diff --git a/ccf-database/lib/util/origin-scene.d.ts b/ccf-database/lib/util/origin-scene.d.ts deleted file mode 100644 index 6af67a4b3..000000000 --- a/ccf-database/lib/util/origin-scene.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { SpatialSceneNode } from '../ccf-spatial-scene'; -import { SpatialEntity } from '../spatial-types'; -/** - * Create a set of scene nodes for the body-ui to show the origin and lines extending to it's dimensions. - * @param node the Spatial Entity (usually a reference organ) that the origin is defined by - * @param includeLetters whether to show the keyboard letters associated with the origin points - * @returns a set of scene nodes for the body-ui - */ -export declare function getOriginScene(node: SpatialEntity, includeLetters?: boolean): SpatialSceneNode[]; diff --git a/ccf-database/lib/util/patch-jsonld.d.ts b/ccf-database/lib/util/patch-jsonld.d.ts deleted file mode 100644 index 112e434f4..000000000 --- a/ccf-database/lib/util/patch-jsonld.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { JsonLd } from 'jsonld/jsonld-spec'; -/** - * Function which takes JSON-LD data and makes patches to update from CCF v1.x to v2.0 automatically - * - * @param jsonLdString the input JSON-LD as a string - * @returns A JSON-LD object derived from the given string with updated data to be compatible with CCF v2.0 - */ -export declare function patchJsonLd(jsonLdString: string): JsonLd; diff --git a/ccf-database/lib/util/prefixes.d.ts b/ccf-database/lib/util/prefixes.d.ts deleted file mode 100644 index e45a6a594..000000000 --- a/ccf-database/lib/util/prefixes.d.ts +++ /dev/null @@ -1,208 +0,0 @@ -/** Constants used to create entity accessors. */ -export declare const PREFIXES: { - base: string; - ccf: string; - fma: string; - obo: string; - uberon: string; - cl: string; - lmha: string; - rdf: string; - rdfs: string; - dc: string; - dcterms: string; -}; -/** Prefix factory. */ -export declare const prefixer: (prefix: string) => import("n3").PrefixedToIri; -export declare const rdf: { - x: import("n3").PrefixedToIri; - type: import("n3").NamedNode; -}; -export declare const rdfs: { - x: import("n3").PrefixedToIri; - label: import("n3").NamedNode; - comment: import("n3").NamedNode; - isDefinedBy: import("n3").NamedNode; - seeAlso: import("n3").NamedNode; -}; -/** Common entity ids. */ -export declare const entity: { - id: import("n3").NamedNode; - label: import("n3").NamedNode; - description: import("n3").NamedNode; - link: import("n3").NamedNode; - sex: import("n3").NamedNode; - age: import("n3").NamedNode; - bmi: import("n3").NamedNode; - Male: import("n3").Literal; - Female: import("n3").Literal; - consortiumName: import("n3").NamedNode; - providerName: import("n3").NamedNode; - providerUUID: import("n3").NamedNode; - donor: import("n3").NamedNode; - sections: import("n3").NamedNode; - datasets: import("n3").NamedNode; - sampleType: import("n3").NamedNode; - TissueBlock: import("n3").Literal; - TissueSection: import("n3").Literal; - NonStandard: import("n3").Literal; - sectionCount: import("n3").NamedNode; - sectionSize: import("n3").NamedNode; - sectionUnits: import("n3").NamedNode; - sectionNumber: import("n3").NamedNode; - spatialEntity: import("n3").NamedNode; - ontologyTerms: import("n3").NamedNode; - cellTypeTerms: import("n3").NamedNode; - technology: import("n3").NamedNode; - thumbnail: import("n3").NamedNode; -}; -/** CCF specific ids. */ -export declare const ccf: { - x: import("n3").PrefixedToIri; - base: import("n3").PrefixedToIri; - ontologyNode: { - label: import("n3").NamedNode; - parent: import("n3").NamedNode; - children: import("n3").NamedNode; - rui_rank: import("n3").NamedNode; - synonymLabels: import("n3").NamedNode<"http://www.geneontology.org/formats/oboInOwl#hasExactSynonym">; - }; - asctb: { - part_of: import("n3").NamedNode; - ct_is_a: import("n3").NamedNode; - located_in: import("n3").NamedNode; - characterizes: import("n3").NamedNode; - }; - spatial: { - Female: import("n3").NamedNode; - Male: import("n3").NamedNode; - BothSexes: import("n3").NamedNode; - FemaleOrgans: import("n3").NamedNode; - MaleOrgans: import("n3").NamedNode; - }; - SpatialObjectReference: import("n3").NamedNode; - SpatialEntity: import("n3").NamedNode; - SpatialPlacement: import("n3").NamedNode; - spatialObjectReference: { - file: import("n3").NamedNode; - file_format: import("n3").NamedNode; - file_subpath: import("n3").NamedNode; - }; - extractionSet: { - label: import("n3").NamedNode; - rui_rank: import("n3").NamedNode; - }; - spatialEntity: { - label: import("n3").NamedNode; - description: import("n3").NamedNode; - creator: import("n3").NamedNode; - creator_first_name: import("n3").NamedNode; - creator_last_name: import("n3").NamedNode; - creator_orcid: import("n3").NamedNode; - creation_date: import("n3").NamedNode; - updated_date: import("n3").NamedNode; - ccf_annotations: import("n3").NamedNode; - representation_of: import("n3").NamedNode; - reference_organ: import("n3").NamedNode; - extraction_set_for: import("n3").NamedNode; - extraction_set: import("n3").NamedNode; - sex: import("n3").NamedNode; - side: import("n3").NamedNode; - rui_rank: import("n3").NamedNode; - slice_thickness: import("n3").NamedNode; - slice_count: import("n3").NamedNode; - x_dimension: import("n3").NamedNode; - y_dimension: import("n3").NamedNode; - z_dimension: import("n3").NamedNode; - dimension_units: import("n3").NamedNode; - object: import("n3").NamedNode; - }; - spatialPlacement: { - source: import("n3").NamedNode; - target: import("n3").NamedNode; - placement_date: import("n3").NamedNode; - x_scaling: import("n3").NamedNode; - y_scaling: import("n3").NamedNode; - z_scaling: import("n3").NamedNode; - scaling_units: import("n3").NamedNode; - x_rotation: import("n3").NamedNode; - y_rotation: import("n3").NamedNode; - z_rotation: import("n3").NamedNode; - w_rotation: import("n3").NamedNode; - rotation_order: import("n3").NamedNode; - rotation_units: import("n3").NamedNode; - x_translation: import("n3").NamedNode; - y_translation: import("n3").NamedNode; - z_translation: import("n3").NamedNode; - translation_units: import("n3").NamedNode; - }; -}; -/** Uberon specific ids. */ -export declare const uberon: { - x: import("n3").PrefixedToIri; - body: import("n3").NamedNode; -}; -/** CL specific ids. */ -export declare const cl: { - x: import("n3").PrefixedToIri; - cell: import("n3").NamedNode; -}; -/** FMA specific ids. */ -export declare const fma: { - x: import("n3").PrefixedToIri; -}; -/** LMHA specific ids. */ -export declare const lmha: { - x: import("n3").PrefixedToIri; -}; -/** RUI accessors. */ -export declare const rui: { - body: import("n3").NamedNode; - cell: import("n3").NamedNode; - respiratory_system: import("n3").NamedNode; - colon: import("n3").NamedNode; - left_lung: import("n3").NamedNode; - right_lung: import("n3").NamedNode; - left_bronchus: import("n3").NamedNode; - right_bronchus: import("n3").NamedNode; - kidney: import("n3").NamedNode; - ureter: import("n3").NamedNode; - eye: import("n3").NamedNode; - fallopian_tube: import("n3").NamedNode; - knee: import("n3").NamedNode; - ovary: import("n3").NamedNode; - trachea: import("n3").NamedNode; - aorta: import("n3").NamedNode; - blood: import("n3").NamedNode; - bone_marrow: import("n3").NamedNode; - male_reproductive_system: import("n3").NamedNode; - lymph_node: import("n3").NamedNode; - blood_vasculature: import("n3").NamedNode; - brain: import("n3").NamedNode; - eye_left: import("n3").NamedNode; - eye_right: import("n3").NamedNode; - fallopian_tube_left: import("n3").NamedNode; - fallopian_tube_right: import("n3").NamedNode; - heart: import("n3").NamedNode; - kidney_left: import("n3").NamedNode; - kidney_right: import("n3").NamedNode; - knee_left: import("n3").NamedNode; - knee_right: import("n3").NamedNode; - large_intestine: import("n3").NamedNode; - liver: import("n3").NamedNode; - lungs: import("n3").NamedNode; - mesenteric_lymph_node: import("n3").NamedNode; - ovary_left: import("n3").NamedNode; - ovary_right: import("n3").NamedNode; - pancreas: import("n3").NamedNode; - pelvis: import("n3").NamedNode; - prostate_gland: import("n3").NamedNode; - skin: import("n3").NamedNode; - small_intestine: import("n3").NamedNode; - spleen: import("n3").NamedNode; - thymus: import("n3").NamedNode; - ureter_left: import("n3").NamedNode; - ureter_right: import("n3").NamedNode; - urinary_bladder: import("n3").NamedNode; - uterus: import("n3").NamedNode; -}; diff --git a/ccf-database/lib/util/probing-sphere-scene.d.ts b/ccf-database/lib/util/probing-sphere-scene.d.ts deleted file mode 100644 index 62df3a7a7..000000000 --- a/ccf-database/lib/util/probing-sphere-scene.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { SpatialSceneNode } from '../ccf-spatial-scene'; -import { SpatialSearch } from '../interfaces'; -import { SpatialEntity } from '../spatial-types'; -/** - * Create a set of scene nodes for the body-ui to show the probing sphere and lines around it - * for a given spatial search. - * @param node the Spatial Entity (usually a reference organ) that the sphere is probing into - * @param sphere the Spatial Search that defines where and how big the probing sphere is - * @returns a set of scene nodes for the body-ui - */ -export declare function getProbingSphereScene(node: SpatialEntity, sphere?: SpatialSearch): SpatialSceneNode[]; diff --git a/ccf-database/package.json b/ccf-database/package.json deleted file mode 100644 index 1194703e6..000000000 --- a/ccf-database/package.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "name": "ccf-database", - "version": "0.0.1", - "peerDependencies": { - "@angular/common": "^9.1.1", - "@angular/core": "^9.1.1", - "@math.gl/core": "^3.5.5", - "idb-keyval": "^6.0.1", - "jsonld": "^4.0.1", - "lodash": "^4.17.21", - "rdf-literal": "^1.2.0", - "uuid": "^8.3.2" - }, - "dependencies": { - "tslib": "^2.0.0" - }, - "main": "bundles/ccf-database.umd.js", - "module": "fesm2015/ccf-database.js", - "es2015": "fesm2015/ccf-database.js", - "esm2015": "esm2015/ccf-database.js", - "fesm2015": "fesm2015/ccf-database.js", - "typings": "ccf-database.d.ts", - "sideEffects": false, - "scripts": { - "prepublishOnly": "node --eval \"console.error('ERROR: Trying to publish a package that has been compiled by Ivy in full compilation mode. This is not allowed.\\nPlease delete and rebuild the package with Ivy partial compilation mode, before attempting to publish.\\n')\" && exit 1" - } -} \ No newline at end of file diff --git a/ccf-database/public-api.d.ts b/ccf-database/public-api.d.ts deleted file mode 100644 index b96a3b2be..000000000 --- a/ccf-database/public-api.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -export * from './lib/ccf-database'; -export * from './lib/ccf-spatial-scene'; -export * from './lib/interfaces'; -export * from './lib/spatial-types'; -export * from './lib/hubmap/hubmap-data-import'; -export * from './lib/util/ccf-database-status-tracker'; -export * from './lib/util/probing-sphere-scene'; -export * from './lib/util/origin-scene'; diff --git a/docs/ccf-body-ui/interfaces/ProcessedNode.html b/docs/ccf-body-ui/interfaces/ProcessedNode.html index b8a8c5f34..5e7e98c62 100644 --- a/docs/ccf-body-ui/interfaces/ProcessedNode.html +++ b/docs/ccf-body-ui/interfaces/ProcessedNode.html @@ -312,10 +312,10 @@

    Properties

    return names; } -export async function processSceneNodes(gltfUrl: string, worldMatrix?: Matrix4, scenegraphNode?: string - ): Promise<{ [node: string]: ProcessedNode}> { +export async function processSceneNodes(gltfUrl: string, worldMatrix?: Matrix4, scenegraphNode?: string, + gltfCache?: { [url: string]: Promise<Blob> }): Promise<{ [node: string]: ProcessedNode}> { registerGLTFLoaders(); - const gltf = await loadGLTF({scenegraph: gltfUrl, scenegraphNode} as SpatialSceneNode); + const gltf = await loadGLTF({scenegraph: gltfUrl, scenegraphNode} as SpatialSceneNode, gltfCache); const nodes: {[node: string]: ProcessedNode} = {}; const gltfNodes: ProcessedNode[] = []; for (const scene of gltf.scenes) { diff --git a/docs/ccf-body-ui/js/search/search_index.js b/docs/ccf-body-ui/js/search/search_index.js index 3d16ee1bd..53daeba94 100644 --- a/docs/ccf-body-ui/js/search/search_index.js +++ b/docs/ccf-body-ui/js/search/search_index.js @@ -1,4 +1,4 @@ var COMPODOC_SEARCH_INDEX = { - "index": {"version":"2.3.9","fields":["title","body"],"fieldVectors":[["title/classes/BodyUILayer.html",[0,1.249,1,1.249]],["body/classes/BodyUILayer.html",[0,0.942,1,1.799,2,1.71,3,0.417,4,0.557,5,0.355,6,0.632,7,0.411,8,1.757,9,1.543,10,1.44,11,1.065,12,3.677,13,0.298,14,0.709,15,4.502,16,2.628,17,3.677,18,3.677,19,3.107,20,3.677,21,4.048,22,4.048,23,0.516,24,0.053,25,1.238,26,2.496,27,1.381,28,3.475,29,2.121,30,1.11,31,2.121,32,2.121,33,2.121,34,2.506,35,1.238,36,0.727,37,1.814,38,2.965,39,2.121,40,2.121,41,1.577,42,2.121,43,1.253,44,2.121,45,1.077,46,2.496,47,1.71,48,3.107,49,2.965,50,1.71,51,1.577,52,3.107,53,3.107,54,3.107,55,3.358,56,3.107,57,1.71,58,0.827,59,0.727,60,1.295,61,0.942,62,0.709,63,1.212,64,1.814,65,1.44,66,1.814,67,2.121,68,1.238,69,2.496,70,2.121,71,2.121,72,1.577,73,1.71,74,2.228,75,2.748,76,3.107,77,2.001,78,1.635,79,3.107,80,1.579,81,3.057,82,4.651,83,1.71,84,2.121,85,4.048,86,2.109,87,1.635,88,4.048,89,2.109,90,2.109,91,2.496,92,0.723,93,4.77,94,1.915,95,2.121,96,2.784,97,2.121,98,1.71,99,2.121,100,2.121,101,2.187,102,3.107,103,3.107,104,1.634,105,1.634,106,1.867,107,2.146,108,1.634,109,1.814,110,1.814,111,2.286,112,3.107,113,2.927,114,1.381,115,1.539,116,3.677,117,1.579,118,2.121,119,1.71,120,2.121,121,2.965,122,2.121,123,2.121,124,2.748,125,2.121,126,0.557,127,3.677,128,1.212,129,2.198,130,2.121,131,2.121,132,1.814,133,2.121,134,2.121,135,2.121,136,0.942,137,2.121,138,2.121,139,1.799,140,2.121,141,2.121,142,2.121,143,2.121,144,2.121,145,2.121,146,2.121,147,2.121,148,2.121,149,3.677,150,2.121,151,2.121,152,2.121,153,2.121,154,1.634,155,2.121,156,1.814,157,2.121,158,1.71,159,1.71,160,1.44,161,3.107,162,2.121,163,4.048,164,1.077,165,2.121,166,2.121,167,2.121,168,2.121,169,2.121,170,1.238,171,1.238,172,0.942,173,2.121,174,1.077,175,2.121,176,2.121,177,2.121,178,2.121,179,1.44,180,2.121,181,4.048,182,4.048,183,2.121,184,3.107,185,2.121,186,2.121,187,2.121,188,2.121,189,2.121,190,2.121,191,2.121,192,2.121,193,0.019,194,0.028,195,0.019]],["title/interfaces/BodyUIProps.html",[196,0.024,197,1.427]],["body/interfaces/BodyUIProps.html",[0,1.175,1,1.436,3,0.635,4,0.45,5,0.287,6,0.24,7,0.295,8,0.668,9,0.906,11,0.587,13,0.371,14,0.603,16,2.923,23,0.703,24,0.053,27,1.745,30,1.105,36,1.245,37,2.784,41,2.564,43,1.205,45,0.869,51,0.869,58,1.532,59,0.587,60,1.344,61,0.761,62,0.603,63,1.62,74,1.986,77,1.436,78,1.245,80,1.744,87,1.731,92,0.772,94,1.175,96,1.886,101,2.108,104,1.745,105,1.745,106,1.994,107,2.293,108,1.175,109,0.999,110,0.999,113,0.999,114,0.761,115,1.612,117,1.032,126,1.032,128,0.668,129,2.082,132,2.863,136,2.245,139,0.761,154,0.761,164,0.869,170,0.999,171,0.999,172,0.761,174,0.869,193,0.016,194,0.024,195,0.024,196,0.028,197,1.343,198,0.337,199,0.869,200,2.819,201,2.467,202,2.467,203,2.467,204,2.467,205,2.667,206,2.667,207,1.845,208,2.467,209,1.744,210,3.035,211,2.194,212,2.194,213,2.194,214,2.194,215,1.796,216,1.796,217,1.796,218,1.796,219,1.163,220,2.609,221,0.999,222,1.163,223,2.678,224,0.999,225,1.163,226,1.163,227,1.796,228,0.869,229,1.163,230,2.269,231,2.194,232,2.467,233,2.467,234,2.197,235,1.418,236,1.163,237,2.194,238,0.869,239,1.796,240,0.999,241,2.667,242,0.999,243,1.796,244,1.163,245,1.163,246,0.869,247,0.999,248,3.456,249,1.163,250,1.163,251,1.163,252,1.163,253,1.163,254,1.163,255,1.163,256,1.163,257,1.163,258,1.163,259,1.163,260,1.163,261,1.163,262,1.163,263,1.163,264,1.163,265,1.163,266,1.163,267,1.163,268,1.163,269,1.163,270,1.163,271,1.163,272,2.667,273,1.163,274,1.796,275,1.163,276,1.163,277,0.999,278,1.796,279,0.999,280,1.163,281,1.163,282,1.163,283,1.796,284,1.796,285,1.163,286,1.163,287,1.163,288,1.163,289,1.163,290,1.163,291,1.163,292,1.163,293,1.163,294,1.163,295,1.163,296,1.163,297,1.163,298,1.163,299,1.163,300,1.796,301,1.163,302,1.163,303,1.163,304,1.163,305,1.163,306,1.163,307,1.163,308,1.163,309,1.163,310,3.035,311,3.035,312,1.163,313,1.544,314,1.163,315,1.163,316,1.544,317,1.796,318,1.163,319,1.163,320,1.163,321,0.869,322,1.163,323,2.194,324,1.343,325,1.163,326,1.163,327,1.163,328,1.796,329,1.163,330,1.163,331,1.163,332,1.163,333,2.194,334,1.163,335,1.163,336,1.796,337,1.163,338,2.194,339,1.163,340,1.163,341,1.845,342,1.544,343,1.343,344,1.032,345,1.163,346,1.163,347,1.163,348,1.163,349,2.194,350,1.163,351,1.163,352,1.163,353,1.163,354,0.869,355,1.163,356,1.163,357,1.163,358,1.163,359,1.163,360,1.163,361,1.544,362,0.761,363,1.163,364,0.869,365,1.163,366,1.163,367,1.163,368,2.667,369,1.163,370,1.163,371,1.163,372,1.163,373,1.163,374,1.163,375,1.163,376,1.163,377,1.796,378,1.163,379,2.194,380,1.163,381,1.796,382,1.796,383,1.163,384,1.163,385,1.163,386,1.163,387,1.163,388,2.194,389,1.163,390,1.163,391,1.163,392,1.163,393,1.163,394,1.163,395,1.163,396,1.163,397,1.163,398,1.163,399,1.163,400,0.761,401,1.163,402,1.163,403,1.163,404,1.163,405,1.163,406,1.163,407,2.194,408,1.163,409,1.163,410,1.163,411,1.163,412,1.163,413,1.163,414,1.163,415,1.163]],["title/interfaces/BodyUIViewStateProps.html",[196,0.024,230,1.427]],["body/interfaces/BodyUIViewStateProps.html",[0,1.201,1,1.462,3,0.647,4,0.463,5,0.295,6,0.247,7,0.301,8,0.687,9,0.927,11,0.927,13,0.379,14,0.617,16,2.939,23,0.649,24,0.053,27,1.768,30,1.078,36,1.264,37,2.804,41,2.578,43,1.215,45,0.895,51,0.895,58,1.553,59,0.604,60,1.356,61,0.783,62,0.617,63,1.638,74,2.005,77,1.462,78,1.264,80,1.76,87,1.74,92,0.531,94,1.201,96,1.92,101,2.132,104,1.768,105,1.768,106,2.02,107,2.323,108,1.201,109,1.029,110,1.029,113,1.029,114,0.783,115,1.608,117,1.055,126,1.045,128,0.687,129,2.098,132,2.88,136,2.098,139,0.783,154,0.783,164,0.895,170,1.029,171,1.029,172,0.783,174,0.895,193,0.016,194,0.025,195,0.025,196,0.029,197,0.895,198,0.346,199,0.895,200,2.851,201,1.196,202,1.196,203,1.196,204,1.196,205,1.836,206,1.836,207,0.895,208,1.196,209,1.76,210,3.063,211,1.196,212,1.196,213,2.233,214,2.233,215,1.836,216,1.836,217,1.836,218,2.233,219,1.196,220,2.634,221,1.029,222,1.196,223,2.7,224,1.029,225,1.196,226,1.196,227,1.836,228,0.895,229,1.196,230,2.349,231,2.851,232,2.969,233,2.969,234,2.22,235,1.439,236,1.196,237,2.233,238,0.895,239,1.836,240,1.029,241,2.702,242,1.029,243,1.836,244,1.196,245,1.196,246,0.895,247,1.029,248,3.473,249,1.196,250,1.196,251,1.196,252,1.196,253,1.196,254,1.196,255,1.196,256,1.196,257,1.196,258,1.196,259,1.196,260,1.196,261,1.196,262,1.196,263,1.196,264,1.196,265,1.196,266,1.196,267,1.196,268,1.196,269,1.196,270,1.196,271,1.196,272,2.702,273,1.196,274,1.836,275,1.196,276,1.196,277,1.029,278,1.836,279,1.029,280,1.196,281,1.196,282,1.196,283,1.836,284,1.836,285,1.196,286,1.196,287,1.196,288,1.196,289,1.196,290,1.196,291,1.196,292,1.196,293,1.196,294,1.196,295,1.196,296,1.196,297,1.196,298,1.196,299,1.196,300,1.836,301,1.196,302,1.196,303,1.196,304,1.196,305,1.196,306,1.196,307,1.196,308,1.196,309,1.196,310,3.063,311,3.063,312,1.196,313,1.578,314,1.196,315,1.196,316,1.578,317,1.836,318,1.196,319,1.196,320,1.196,321,0.895,322,1.196,323,2.233,324,1.373,325,1.196,326,1.196,327,1.196,328,1.836,329,1.196,330,1.196,331,1.196,332,1.196,333,2.233,334,1.196,335,1.196,336,1.836,337,1.196,338,2.233,339,1.196,340,1.196,341,1.873,342,1.578,343,1.373,344,1.055,345,1.196,346,1.196,347,1.196,348,1.196,349,2.233,350,1.196,351,1.196,352,1.196,353,1.196,354,0.895,355,1.196,356,1.196,357,1.196,358,1.196,359,1.196,360,1.196,361,1.578,362,0.783,363,1.196,364,0.895,365,1.196,366,1.196,367,1.196,368,2.702,369,1.196,370,1.196,371,1.196,372,1.196,373,1.196,374,1.196,375,1.196,376,1.196,377,1.836,378,1.196,379,2.233,380,1.196,381,1.836,382,1.836,383,1.196,384,1.196,385,1.196,386,1.196,387,1.196,388,2.233,389,1.196,390,1.196,391,1.196,392,1.196,393,1.196,394,1.196,395,1.196,396,1.196,397,1.196,398,1.196,399,1.196,400,0.783,401,1.196,402,1.196,403,1.196,404,1.196,405,1.196,406,1.196,407,2.233,408,1.196,409,1.196,410,1.196,411,1.196,412,1.196,413,1.196,414,1.196,415,1.196]],["title/interfaces/Collision.html",[196,0.024,416,1.908]],["body/interfaces/Collision.html",[3,0.534,4,0.713,5,0.455,6,0.381,7,0.248,13,0.381,14,0.844,23,0.664,24,0.052,25,2.16,30,1.237,35,3.15,43,1.312,58,1.059,59,0.93,60,1.112,61,1.206,62,1.031,63,1.443,68,2.457,72,1.378,77,1.87,80,1.443,81,2.857,87,1.742,92,1.056,94,1.87,104,1.644,105,1.206,111,1.378,126,0.713,128,1.059,129,2.434,156,1.585,159,2.984,179,3.211,193,0.025,194,0.034,195,0.025,196,0.024,198,0.534,209,1.059,321,1.378,324,1.378,416,2.857,417,1.843,418,1.843,419,4.88,420,1.843,421,2.189,422,3.7,423,2.189,424,3.7,425,2.189,426,3.645,427,2.189,428,1.843,429,1.843,430,1.585,431,2.189,432,2.189,433,2.715,434,2.715,435,4.209,436,2.715,437,3.7,438,2.715,439,2.715,440,2.715,441,3.7,442,3.645,443,2.715,444,3.645,445,2.715,446,2.715,447,3.394,448,3.7,449,3.394,450,2.984,451,2.984,452,2.984,453,2.984,454,2.984,455,2.984,456,4.209,457,2.715,458,2.715,459,2.715,460,2.715,461,2.715,462,2.189,463,2.715,464,2.189,465,2.189,466,2.984,467,2.189,468,2.189,469,2.189,470,2.189,471,2.189,472,2.189,473,2.715,474,2.189,475,4.52,476,3.7,477,2.715,478,2.715,479,2.715,480,2.715,481,2.715,482,2.715,483,2.715,484,2.715,485,2.715,486,2.715,487,2.715,488,2.715,489,2.715,490,2.715,491,2.715,492,4.729,493,3.7,494,3.645,495,3.7,496,3.7,497,2.715,498,2.715,499,2.715,500,2.715,501,2.715,502,2.189]],["title/interfaces/PickInfo.html",[196,0.024,234,1.427]],["body/interfaces/PickInfo.html",[0,1.206,1,1.466,3,0.649,4,0.465,5,0.296,6,0.248,7,0.301,8,0.691,9,0.93,11,0.607,13,0.56,14,0.619,16,2.942,23,0.634,24,0.053,27,1.772,30,0.96,36,1.267,37,2.807,41,2.58,43,1.217,45,0.899,51,0.899,58,1.287,59,0.607,60,1.358,61,0.787,62,0.619,63,1.641,74,2.008,77,1.466,78,1.267,80,1.763,87,1.742,92,0.533,94,1.206,96,1.926,101,2.136,104,1.772,105,1.772,106,2.024,107,2.328,108,1.206,109,1.033,110,1.033,113,1.926,114,0.787,115,1.599,117,1.059,126,1.047,128,0.691,129,2.101,132,2.883,136,2.168,139,0.787,154,0.787,164,0.899,170,1.033,171,1.033,172,0.787,174,0.899,193,0.016,194,0.025,195,0.025,196,0.029,197,0.899,198,0.348,199,0.899,200,2.24,201,1.202,202,1.202,203,1.202,204,1.202,205,1.842,206,1.842,207,0.899,208,1.202,209,1.556,210,2.707,211,1.202,212,1.202,213,2.24,214,2.24,215,1.842,216,1.842,217,1.842,218,1.842,219,1.202,220,2.637,221,1.033,222,1.202,223,2.704,224,1.033,225,1.202,226,1.202,227,2.707,228,0.899,229,1.202,230,2.294,231,2.24,232,2.511,233,2.511,234,2.294,235,1.709,236,2.511,237,2.857,238,1.877,239,2.707,240,1.033,241,2.707,242,1.033,243,1.842,244,1.202,245,1.202,246,0.899,247,1.033,248,3.476,249,1.202,250,1.202,251,1.202,252,1.202,253,1.202,254,1.202,255,1.202,256,1.202,257,1.202,258,1.202,259,1.202,260,1.202,261,1.202,262,1.202,263,1.202,264,1.202,265,1.202,266,1.202,267,1.202,268,1.202,269,1.202,270,1.202,271,1.202,272,2.707,273,1.202,274,1.842,275,1.202,276,1.202,277,1.033,278,1.842,279,1.033,280,1.202,281,1.202,282,1.202,283,1.842,284,1.842,285,1.202,286,1.202,287,1.202,288,1.202,289,1.202,290,1.202,291,1.202,292,1.202,293,1.202,294,1.202,295,1.202,296,1.202,297,1.202,298,1.202,299,1.202,300,1.842,301,1.202,302,1.202,303,1.202,304,1.202,305,1.202,306,1.202,307,1.202,308,1.202,309,1.202,310,3.068,311,3.068,312,1.202,313,1.584,314,1.202,315,1.202,316,1.584,317,1.842,318,1.202,319,1.202,320,1.202,321,0.899,322,1.202,323,2.24,324,1.377,325,1.202,326,1.202,327,1.202,328,1.842,329,1.202,330,1.202,331,1.202,332,1.202,333,2.24,334,1.202,335,1.202,336,1.842,337,1.202,338,2.24,339,1.202,340,1.202,341,1.877,342,1.584,343,1.377,344,1.059,345,1.202,346,1.202,347,1.202,348,1.202,349,2.24,350,1.202,351,1.202,352,1.202,353,1.202,354,0.899,355,1.202,356,1.202,357,1.202,358,1.202,359,1.202,360,1.202,361,1.584,362,0.787,363,1.202,364,0.899,365,1.202,366,1.202,367,1.202,368,2.707,369,1.202,370,1.202,371,1.202,372,1.202,373,1.202,374,1.202,375,1.202,376,1.202,377,1.842,378,1.202,379,2.24,380,1.202,381,1.842,382,1.842,383,1.202,384,1.202,385,1.202,386,1.202,387,1.202,388,2.24,389,1.202,390,1.202,391,1.202,392,1.202,393,1.202,394,1.202,395,1.202,396,1.202,397,1.202,398,1.202,399,1.202,400,0.787,401,1.202,402,1.202,403,1.202,404,1.202,405,1.202,406,1.202,407,2.24,408,1.202,409,1.202,410,1.202,411,1.202,412,1.202,413,1.202,414,1.202,415,1.202]],["title/interfaces/ProcessedNode.html",[196,0.024,503,1.908]],["body/interfaces/ProcessedNode.html",[3,0.547,4,0.731,5,0.466,6,0.391,7,0.254,11,1.289,13,0.391,14,0.859,23,0.669,24,0.052,30,1.147,43,1.253,55,1.889,58,1.663,59,0.954,60,1.372,61,1.237,62,1.042,63,2.09,64,1.624,66,2.196,68,2.196,72,1.91,77,1.672,80,1.086,81,2.894,87,1.723,92,0.74,94,1.672,101,2.318,104,1.672,105,1.237,111,1.413,114,1.672,117,1.086,126,0.988,128,1.086,129,2.433,139,1.237,154,1.672,172,1.237,174,1.413,193,0.025,194,0.034,195,0.025,196,0.024,198,0.547,316,2.196,321,1.413,324,1.413,341,1.91,354,1.413,362,1.894,364,1.413,420,1.889,426,3.846,427,4.053,428,1.889,429,1.889,430,1.624,431,2.244,442,3.034,444,3.034,449,3.682,450,2.244,451,2.244,452,2.244,453,2.244,454,2.244,455,2.244,462,2.244,464,2.244,465,2.244,466,3.034,467,2.244,468,2.244,469,2.244,470,2.244,471,2.244,472,2.244,474,3.034,502,2.244,503,3.556,504,1.624,505,1.889,506,3.846,507,3.682,508,4.77,509,2.244,510,2.894,511,3.762,512,2.783,513,2.783,514,2.783,515,2.783,516,3.437,517,2.783,518,3.762,519,3.762,520,3.762,521,2.244,522,3.762,523,2.783,524,2.783,525,2.783,526,2.783,527,2.783,528,2.244,529,2.783,530,2.783,531,2.783,532,3.762,533,2.783,534,2.783,535,4.263,536,2.783,537,2.783,538,2.783,539,3.762,540,2.783,541,2.783,542,2.783,543,2.783,544,2.783,545,2.783,546,2.783,547,2.783,548,2.783,549,2.783,550,2.783,551,2.783,552,2.783,553,2.783,554,2.783,555,2.783]],["title/interfaces/SpatialEntityJsonLd.html",[196,0.024,556,1.427]],["body/interfaces/SpatialEntityJsonLd.html",[3,0.551,4,0.992,5,0.633,6,0.393,7,0.256,11,1.569,13,0.393,14,0.862,23,0.788,24,0.052,30,1.302,43,0.736,78,1.688,92,0.968,115,1.678,126,1.123,193,0.026,194,0.035,195,0.026,196,0.037,198,0.551,209,1.093,235,1.786,556,1.918,557,1.635,558,1.244,559,1.635,560,3.245,561,3.245,562,3.108,563,3.108,564,3.108,565,3.108,566,3.108,567,3.108,568,3.108,569,3.108,570,3.108,571,2.79,572,2.672,573,2.672,574,3.108,575,2.672,576,2.672,577,3.108,578,3.108,579,3.108,580,3.108,581,3.108,582,3.108,583,2.324,584,2.599,585,2.903,586,2.903,587,2.496,588,2.496,589,1.901,590,1.635,591,1.901,592,1.901,593,1.901,594,1.901,595,1.901,596,1.901,597,1.901,598,1.901,599,1.901,600,1.901,601,1.901,602,1.901,603,1.901,604,1.901]],["title/interfaces/SpatialObjectReferenceJsonLd.html",[196,0.024,583,1.427]],["body/interfaces/SpatialObjectReferenceJsonLd.html",[3,0.665,4,1.123,5,0.85,6,0.475,7,0.309,11,1.688,13,0.475,14,0.976,23,0.765,24,0.051,30,1.3,43,0.889,78,1.465,92,1.02,115,1.666,126,1.231,193,0.031,194,0.039,195,0.031,196,0.041,198,0.665,209,1.32,235,1.32,556,1.718,557,1.975,558,1.504,559,1.975,560,3.448,561,2.903,562,2.297,563,2.297,564,2.297,565,2.297,566,2.297,567,2.297,568,2.297,569,2.297,570,2.297,571,2.964,572,1.975,573,1.975,574,2.297,575,1.975,576,1.975,577,2.297,578,2.297,579,2.297,580,2.297,581,2.297,582,2.297,583,2.38,584,2.633,585,2.297,586,2.297,587,1.975,588,1.975,589,2.297,590,1.975,591,2.297,592,2.297,593,2.297,594,2.297,595,2.297,596,2.297,597,2.297,598,2.297,599,2.297,600,2.297,601,2.297,602,2.297,603,2.297,604,3.343]],["title/interfaces/SpatialPlacementJsonLd.html",[196,0.024,584,1.427]],["body/interfaces/SpatialPlacementJsonLd.html",[3,0.594,4,1.287,5,0.665,6,0.424,7,0.276,11,1.617,13,0.424,14,0.906,23,0.785,24,0.052,30,1.299,36,1.617,43,0.793,78,1.362,92,0.989,115,1.698,126,1.166,193,0.028,194,0.036,195,0.028,196,0.039,198,0.594,209,1.841,235,1.178,556,1.533,557,1.762,558,1.342,559,1.762,560,3.328,561,3.328,562,2.05,563,2.05,564,2.05,565,2.05,566,2.05,567,2.05,568,2.05,569,2.05,570,2.05,571,2.319,572,1.762,573,1.762,574,2.05,575,1.762,576,1.762,577,2.05,578,2.05,579,2.05,580,2.05,581,2.05,582,2.05,583,2.017,584,2.488,585,2.05,586,2.05,587,1.762,588,1.762,589,2.05,590,1.762,591,3.203,592,3.203,593,3.203,594,3.203,595,3.203,596,3.203,597,3.203,598,3.203,599,3.203,600,3.203,601,3.203,602,3.203,603,3.203,604,2.05]],["title/interfaces/SpatialSceneNode.html",[60,0.845,196,0.024]],["body/interfaces/SpatialSceneNode.html",[3,0.614,4,0.821,5,0.523,6,0.439,7,0.286,13,0.439,14,0.927,23,0.787,24,0.052,30,1.291,35,2.791,36,1.938,43,0.821,55,3.246,58,1.865,59,1.071,60,1.221,62,0.713,86,2.122,89,2.122,90,2.122,91,2.122,92,0.94,111,1.587,114,2.125,115,1.666,117,1.865,124,3.365,126,1.067,136,2.356,139,2.125,160,3.246,172,2.125,193,0.029,194,0.037,195,0.029,196,0.027,198,0.614,362,2.125,364,2.427,447,3.856,528,3.856,572,2.791,573,2.791,605,2.122,606,2.122,607,4.781,608,4.781,609,4.781,610,3.856]],["title/changelog.html",[611,1.61,612,1.384,613,1.61]],["body/changelog.html",[3,0.726,5,0.194,7,0.367,9,1.458,14,0.264,23,0.163,24,0.039,26,0.787,28,0.934,36,0.397,62,0.916,74,2.211,75,1.312,83,0.934,87,1.458,92,0.228,98,1.558,106,1.874,108,0.858,115,0.348,117,1.131,121,0.934,160,0.787,164,1.963,179,1.312,193,0.011,194,0.018,195,0.037,196,0.034,198,0.228,207,0.588,238,0.588,246,2.628,277,1.45,279,0.676,313,0.676,343,2.357,344,1.787,361,0.676,400,1.288,420,1.968,494,3.639,510,0.787,558,1.288,571,1.128,575,1.128,576,0.676,587,0.676,588,1.128,590,2.154,612,1.45,613,1.312,614,1.558,615,0.934,616,3.239,617,1.558,618,3.867,619,3.691,620,5.541,621,4.875,622,1.932,623,1.159,624,1.159,625,1.159,626,1.159,627,1.159,628,1.159,629,4.351,630,1.159,631,1.558,632,1.159,633,3.509,634,2.484,635,1.932,636,2.484,637,4.255,638,1.159,639,1.558,640,0.934,641,1.159,642,1.159,643,4.016,644,1.932,645,3.222,646,2.484,647,2.484,648,1.159,649,1.932,650,4.265,651,1.932,652,2.813,653,1.159,654,4.642,655,1.159,656,3.415,657,1.159,658,2.484,659,3.222,660,1.932,661,2.484,662,2.484,663,1.932,664,2.484,665,1.159,666,1.932,667,1.932,668,1.159,669,3.691,670,3.48,671,3.691,672,1.932,673,1.159,674,1.159,675,2.899,676,1.159,677,1.932,678,1.159,679,1.159,680,1.932,681,2.484,682,2.484,683,2.598,684,1.159,685,1.932,686,1.159,687,1.159,688,1.159,689,1.932,690,4.581,691,1.159,692,3.48,693,1.159,694,1.159,695,1.159,696,2.484,697,2.003,698,1.159,699,1.159,700,2.598,701,1.558,702,1.159,703,3.48,704,4.255,705,4.351,706,1.932,707,3.222,708,1.159,709,3.222,710,1.932,711,3.48,712,1.932,713,1.159,714,1.159,715,1.159,716,1.932,717,2.977,718,3.48,719,2.338,720,1.159,721,3.691,722,4.095,723,1.159,724,1.159,725,1.932,726,1.159,727,2.899,728,1.159,729,1.932,730,2.484,731,1.159,732,1.159,733,2.484,734,2.484,735,1.932,736,1.159,737,1.932,738,1.159,739,1.159,740,1.159,741,4.513,742,1.159,743,0.934,744,0.934,745,2.187,746,0.934,747,1.159,748,1.932,749,0.934,750,1.159,751,1.932,752,2.899,753,2.899,754,1.159,755,1.932,756,2.484,757,1.159,758,1.159,759,1.932,760,1.159,761,1.159,762,3.48,763,2.363,764,2.598,765,2.003,766,1.159,767,2.598,768,1.159,769,2.484,770,3.119,771,4.437,772,1.159,773,1.159,774,1.932,775,2.003,776,1.159,777,1.159,778,1.159,779,3.222,780,1.159,781,1.159,782,1.159,783,1.159,784,2.484,785,1.159,786,1.558,787,1.558,788,1.159,789,3.119,790,1.159,791,1.159,792,1.159,793,1.159,794,1.159,795,1.159,796,2.598,797,2.598,798,1.159,799,1.932,800,1.159,801,1.159,802,2.484,803,1.932,804,1.159,805,1.932,806,1.159,807,1.932,808,1.932,809,1.932,810,1.932,811,1.159,812,2.484,813,1.159,814,1.159,815,0.934,816,1.159,817,2.003,818,1.128,819,1.932,820,1.159,821,1.159,822,1.932,823,1.932,824,1.932,825,1.932,826,1.159,827,1.159,828,1.159,829,2.484,830,1.159,831,1.932,832,1.159,833,1.159,834,1.932,835,3.48,836,1.558,837,1.159,838,0.934,839,1.159,840,1.159,841,3.222,842,2.899,843,1.159,844,2.484,845,1.932,846,3.48,847,1.558,848,2.899,849,1.159,850,1.159,851,2.899,852,1.159,853,1.159,854,1.159,855,1.159,856,1.932,857,1.932,858,1.159,859,1.932,860,1.159,861,0.934,862,1.932,863,1.159,864,1.932,865,1.159,866,1.159,867,2.899,868,1.159,869,1.159,870,1.159,871,1.159,872,1.932,873,1.159,874,1.159,875,1.159,876,1.159,877,1.159,878,1.159,879,1.932,880,1.159,881,1.159,882,1.159,883,1.159,884,1.159,885,1.932,886,1.159,887,3.48,888,1.159,889,2.484,890,1.932,891,1.159,892,1.932,893,1.159,894,0.934,895,0.934,896,1.159,897,1.932,898,1.159,899,1.159,900,1.968,901,1.159,902,1.159,903,1.932,904,1.932,905,1.159,906,1.159,907,1.932,908,1.932,909,1.159,910,1.932,911,2.899,912,2.484,913,1.159,914,1.159,915,1.159,916,1.159,917,0.934,918,0.934,919,1.159,920,1.932,921,1.159,922,1.159,923,1.159,924,1.159,925,1.932,926,2.899,927,1.159,928,1.159,929,1.159,930,1.159,931,3.48,932,2.484,933,1.932,934,1.159,935,1.159,936,2.484,937,1.932,938,1.932,939,1.932,940,2.899,941,1.159,942,1.159,943,1.159,944,1.932,945,1.159,946,1.159,947,1.159,948,1.159,949,1.159,950,2.899,951,1.159,952,2.484,953,2.899,954,1.159,955,2.484,956,3.222,957,1.932,958,1.932,959,1.932,960,1.932,961,2.484,962,2.899,963,3.222,964,1.932,965,2.484,966,1.159,967,1.159,968,3.691,969,2.484,970,1.159,971,2.899,972,2.899,973,4.016,974,1.159,975,1.159,976,1.159,977,1.159,978,1.159,979,1.159,980,1.932,981,1.159,982,1.932,983,1.159,984,1.159,985,1.159,986,1.159,987,1.932,988,1.159,989,1.687,990,1.159,991,1.932,992,2.003,993,1.932,994,2.484,995,1.159,996,1.159,997,1.159,998,1.932,999,1.159,1000,1.159,1001,1.159,1002,1.159,1003,1.159,1004,1.159,1005,1.159,1006,1.932,1007,1.159,1008,1.159,1009,2.899,1010,3.48,1011,1.932,1012,2.484,1013,1.932,1014,2.899,1015,1.159,1016,1.159,1017,1.159,1018,1.159,1019,2.484,1020,1.159,1021,1.159,1022,1.159,1023,1.932,1024,1.932,1025,1.932,1026,1.932,1027,2.484,1028,1.159,1029,1.159,1030,1.159,1031,1.159,1032,1.159,1033,1.159,1034,0.934,1035,1.159,1036,1.159,1037,1.159,1038,1.932,1039,1.159,1040,1.159,1041,1.932,1042,1.159,1043,1.159,1044,1.159,1045,1.159,1046,1.159,1047,1.159,1048,1.159,1049,1.159,1050,1.159,1051,1.159,1052,3.867,1053,1.159,1054,2.003,1055,2.484,1056,2.899,1057,1.932,1058,2.484,1059,1.159,1060,1.932,1061,1.159,1062,1.159,1063,1.932,1064,1.932,1065,1.932,1066,1.159,1067,1.159,1068,1.159,1069,1.159,1070,1.932,1071,1.159,1072,2.484,1073,1.159,1074,1.159,1075,1.159,1076,1.159,1077,0.934,1078,1.159,1079,1.159,1080,1.159,1081,1.159,1082,1.159,1083,1.159,1084,1.159,1085,1.159,1086,1.159,1087,1.159,1088,1.159,1089,3.222,1090,1.159,1091,1.159,1092,1.159,1093,1.159,1094,1.159,1095,1.159,1096,1.159,1097,1.159,1098,1.159,1099,1.159,1100,1.159,1101,1.159,1102,1.159,1103,1.159,1104,1.932,1105,1.159,1106,1.932,1107,1.159,1108,1.932,1109,1.932,1110,2.899,1111,2.899,1112,1.932,1113,1.932,1114,1.159,1115,1.159,1116,1.159,1117,2.484,1118,1.159,1119,0.934,1120,1.159,1121,1.159,1122,1.159,1123,1.159,1124,1.159,1125,1.159,1126,1.932,1127,4.144,1128,2.484,1129,1.159,1130,1.932,1131,1.159,1132,1.159,1133,1.159,1134,1.159,1135,1.159,1136,1.159,1137,1.159,1138,1.159,1139,1.159,1140,1.932,1141,2.977,1142,1.932,1143,1.159,1144,1.159,1145,1.159,1146,1.558,1147,1.159,1148,2.899,1149,1.159,1150,1.932,1151,1.159,1152,1.159,1153,1.968,1154,1.159,1155,1.932,1156,1.159,1157,1.159,1158,1.159,1159,1.932,1160,1.932,1161,1.159,1162,1.159,1163,1.159,1164,1.159,1165,1.932,1166,2.484,1167,1.932,1168,1.159,1169,1.159,1170,1.558,1171,1.159,1172,1.159,1173,1.159,1174,1.159,1175,1.159,1176,1.159,1177,1.159,1178,1.159,1179,1.159,1180,0.934,1181,1.159,1182,1.159,1183,1.932,1184,1.159,1185,1.159,1186,1.159,1187,1.159,1188,1.159,1189,1.159,1190,1.159,1191,1.932,1192,1.159,1193,0.934,1194,1.159,1195,1.159,1196,0.934,1197,1.159,1198,1.159,1199,1.159,1200,1.932,1201,1.159,1202,1.159,1203,1.159,1204,1.159,1205,1.159,1206,1.159,1207,1.159,1208,1.159,1209,1.159,1210,1.159,1211,1.159,1212,1.932,1213,1.159,1214,1.159,1215,1.159,1216,1.159,1217,1.932,1218,1.159,1219,0.934,1220,1.159,1221,1.159,1222,1.159,1223,1.159,1224,1.159,1225,1.159,1226,1.159]],["title/coverage.html",[1153,2.571]],["body/coverage.html",[0,1.745,1,1.318,5,0.497,6,0.79,7,0.514,8,1.993,9,1.508,10,2.988,23,0.416,24,0.051,46,2.014,60,0.891,62,1.142,64,1.731,65,2.014,66,1.731,69,2.014,72,2.799,80,2.193,87,1.016,193,0.027,194,0.036,195,0.027,196,0.046,197,1.506,199,2.378,228,1.506,230,1.506,234,1.506,247,1.731,344,1.532,400,1.318,416,2.014,417,2.665,418,2.665,430,1.731,503,2.014,504,3.027,505,2.988,556,1.506,557,2.569,558,2.082,559,2.569,583,1.506,584,1.506,605,2.014,606,2.014,763,2.014,818,1.731,989,2.014,1153,2.014,1227,2.966,1228,2.966,1229,2.392,1230,2.392,1231,2.392,1232,5.527,1233,4.401,1234,2.392,1235,2.966,1236,2.966,1237,2.966,1238,2.966,1239,2.966,1240,2.966,1241,2.966,1242,3.778,1243,3.778,1244,2.392,1245,3.166,1246,3.166,1247,2.392,1248,2.392,1249,2.392,1250,2.392,1251,2.392,1252,2.392,1253,2.665,1254,2.392,1255,2.966,1256,2.392,1257,2.392,1258,2.392,1259,2.392,1260,2.014,1261,2.014,1262,2.392,1263,2.392,1264,2.392,1265,2.966,1266,2.966,1267,2.966]],["title/dependencies.html",[749,1.912,900,2.286]],["body/dependencies.html",[5,0.527,7,0.288,24,0.052,25,1.837,45,1.598,47,2.538,50,2.538,51,2.072,57,2.538,59,1.079,63,1.228,156,1.837,193,0.029,194,0.037,195,0.029,220,1.837,221,2.383,224,1.837,421,2.538,423,2.538,425,2.538,428,2.137,429,2.137,507,2.538,617,2.538,639,2.538,640,2.538,745,2.137,767,2.538,786,2.538,836,2.538,847,2.538,894,2.538,895,2.538,900,2.137,918,3.292,992,2.538,1054,3.292,1146,3.292,1268,3.148,1269,3.148,1270,3.148,1271,5.392,1272,3.148,1273,3.148,1274,3.148,1275,3.148,1276,3.148,1277,3.148,1278,3.148,1279,3.148,1280,4.082,1281,3.148,1282,3.148,1283,3.148,1284,3.148,1285,3.148,1286,3.148,1287,4.531,1288,3.148,1289,3.148,1290,4.531,1291,3.148,1292,3.148,1293,3.148,1294,3.148,1295,4.082,1296,3.148,1297,3.148,1298,3.148,1299,3.148,1300,3.148,1301,4.082,1302,4.082,1303,3.148,1304,3.148,1305,3.148,1306,3.148,1307,3.148,1308,3.292,1309,3.148,1310,3.148,1311,4.082,1312,3.148,1313,3.148,1314,3.148,1315,3.148,1316,3.148,1317,3.148,1318,3.148,1319,3.148,1320,3.148,1321,3.148,1322,3.148,1323,3.148,1324,3.148,1325,3.148,1326,3.148,1327,2.538,1328,3.148,1329,3.148,1330,3.148,1331,3.148,1332,3.148,1333,3.148,1334,4.082,1335,3.148,1336,3.148,1337,3.148,1338,3.148,1339,3.148,1340,3.148,1341,3.148,1342,3.148,1343,3.148,1344,3.148,1345,3.148,1346,3.148,1347,3.148,1348,3.148,1349,3.148,1350,3.148,1351,3.148,1352,3.148,1353,3.148,1354,3.148,1355,3.148,1356,4.082,1357,3.148,1358,3.148,1359,3.148,1360,3.148,1361,3.148,1362,3.148,1363,3.148,1364,3.148,1365,3.148,1366,3.148,1367,3.148,1368,4.082,1369,3.148,1370,3.148,1371,3.148,1372,3.148,1373,3.148,1374,3.148,1375,3.148,1376,3.148,1377,3.148,1378,3.148,1379,3.148,1380,3.148]],["title/miscellaneous/functions.html",[1381,1.054,1382,2.715]],["body/miscellaneous/functions.html",[6,0.749,7,0.488,8,1.105,9,1.474,10,2.92,13,0.398,24,0.052,27,1.259,30,0.646,34,4.41,35,3.192,36,1.874,38,4.41,41,1.438,46,2.92,49,2.285,62,1.171,64,2.223,65,2.586,66,2.511,68,2.223,69,2.586,73,2.285,74,2.044,75,3.123,78,1.305,92,0.749,119,2.285,128,2.068,136,1.259,154,1.259,156,1.654,193,0.026,194,0.035,195,0.026,207,1.438,228,1.933,341,1.438,344,1.486,354,1.438,362,1.692,417,1.924,418,2.586,430,2.223,432,2.285,504,2.801,505,2.92,509,2.285,510,2.586,516,3.709,521,2.285,558,1.692,818,2.223,861,3.071,989,2.586,1229,2.285,1230,3.071,1231,3.071,1234,3.071,1242,2.285,1243,3.87,1244,3.071,1245,2.285,1246,3.469,1247,3.071,1248,3.071,1249,3.071,1250,3.071,1251,3.071,1252,3.071,1253,2.586,1254,3.071,1257,3.071,1258,3.071,1259,3.071,1260,1.924,1261,2.586,1262,2.285,1263,3.071,1264,3.071,1308,3.071,1381,1.259,1382,2.285,1383,2.833,1384,3.985,1385,4.599,1386,2.285,1387,3.071,1388,3.808,1389,2.833,1390,2.285,1391,2.833,1392,4.942,1393,2.833,1394,3.808,1395,2.833,1396,2.833,1397,3.808,1398,2.833,1399,4.599,1400,4.302,1401,2.833,1402,2.833,1403,2.833,1404,4.599,1405,2.833,1406,2.833,1407,2.833,1408,2.833,1409,3.808,1410,2.833,1411,3.808]],["title/index.html",[13,0.333,611,1.61,612,1.384]],["body/index.html",[3,1.008,9,1.199,24,0.04,108,1.555,193,0.032,194,0.04,195,0.032,196,0.038,198,0.688,238,2.217,246,2.872,342,2.909,506,2.822,613,2.376,614,3.521,615,3.521,616,3.838,633,3.838,650,3.521,652,3.384,656,3.232,683,2.822,697,3.521,700,3.521,701,3.521,717,2.822,719,2.822,722,3.838,743,2.822,744,2.822,745,2.376,746,2.822,764,4.137,765,4.02,770,3.521,775,2.822,787,3.521,789,2.822,797,2.822,817,2.822,917,2.822,1077,2.822,1170,2.822,1180,2.822,1193,2.822,1412,4.366,1413,3.499,1414,3.499,1415,3.499,1416,3.499,1417,3.521,1418,3.499,1419,3.499,1420,3.499,1421,4.366,1422,4.366,1423,4.366,1424,4.76,1425,3.499,1426,3.499,1427,4.76,1428,3.499,1429,3.499,1430,4.366,1431,3.499,1432,3.499,1433,3.499,1434,3.499,1435,3.499,1436,3.499,1437,3.499,1438,3.499,1439,3.499,1440,3.499,1441,4.984,1442,3.499,1443,3.499,1444,3.499,1445,3.499,1446,3.499,1447,3.499,1448,3.499,1449,3.499,1450,3.499,1451,3.499,1452,3.499,1453,3.499,1454,3.499,1455,3.499,1456,3.499,1457,3.499]],["title/license.html",[611,1.61,612,1.384,1458,1.912]],["body/license.html",[24,0.042,193,0.035,194,0.042,195,0.035,223,2.236,631,3.722,652,2.601,763,2.601,796,3.722,815,3.995,838,3.089,1034,3.722,1119,3.089,1141,3.089,1196,3.089,1219,3.089,1327,3.089,1417,4.428,1458,3.089,1459,3.831,1460,4.954,1461,3.831,1462,3.831,1463,4.616,1464,3.831,1465,3.831,1466,3.831,1467,3.831,1468,3.831,1469,3.831,1470,4.616,1471,3.831,1472,3.831,1473,3.831,1474,3.831,1475,3.831,1476,3.831,1477,3.831,1478,3.831,1479,3.831,1480,3.831,1481,3.831,1482,3.831,1483,4.616,1484,3.831,1485,3.831,1486,3.831,1487,3.831,1488,3.831,1489,4.616,1490,3.831,1491,3.831,1492,3.831,1493,3.831,1494,3.831,1495,3.831,1496,3.831,1497,3.831,1498,3.831,1499,3.831,1500,3.831,1501,3.831,1502,3.831,1503,3.831,1504,3.831,1505,3.831,1506,3.831,1507,3.831,1508,3.831,1509,3.831,1510,3.831,1511,3.831,1512,3.831,1513,3.831,1514,3.831,1515,3.831,1516,3.831,1517,3.831]],["title/modules.html",[1518,3.054]],["body/modules.html",[24,0.046,193,0.04,194,0.046,195,0.04,1518,3.56]],["title/overview.html",[1519,3.054]],["body/overview.html",[2,3.536,24,0.046,193,0.04,194,0.046,195,0.04,198,0.862,400,1.949,1519,3.536,1520,4.385]],["title/miscellaneous/typealiases.html",[1381,1.054,1521,3.367]],["body/miscellaneous/typealiases.html",[6,0.714,7,0.465,8,1.593,13,0.573,23,0.714,24,0.05,25,2.799,62,1.094,72,2.073,86,2.772,89,2.772,90,2.772,91,2.772,111,2.073,124,2.772,193,0.037,194,0.044,195,0.037,199,2.584,240,2.799,242,2.799,605,2.772,606,3.255,610,3.866,1260,2.772,1261,3.255,1381,1.814,1386,3.293,1387,3.866,1390,3.293,1522,4.083,1523,4.794]],["title/miscellaneous/variables.html",[1381,1.054,1524,2.715]],["body/miscellaneous/variables.html",[6,0.58,7,0.378,13,0.58,23,0.58,24,0.05,26,2.807,27,1.837,158,3.894,193,0.038,194,0.044,195,0.038,235,1.613,343,2.452,344,1.884,504,2.413,656,2.807,818,2.413,1253,3.279,1256,3.894,1381,1.837,1384,3.334,1524,3.334,1525,4.134,1526,4.829,1527,4.829,1528,4.134,1529,4.134,1530,4.134,1531,4.134,1532,4.829,1533,4.134,1534,4.134,1535,4.134,1536,4.134]]],"invertedIndex":[["",{"_index":24,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/Collision.html":{},"interfaces/PickInfo.html":{},"interfaces/ProcessedNode.html":{},"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{},"interfaces/SpatialSceneNode.html":{},"changelog.html":{},"coverage.html":{},"dependencies.html":{},"miscellaneous/functions.html":{},"index.html":{},"license.html":{},"modules.html":{},"overview.html":{},"miscellaneous/typealiases.html":{},"miscellaneous/variables.html":{}}}],["0",{"_index":80,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/Collision.html":{},"interfaces/PickInfo.html":{},"interfaces/ProcessedNode.html":{},"coverage.html":{}}}],["0.05",{"_index":336,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["0.1.0",{"_index":1217,"title":{},"body":{"changelog.html":{}}}],["0.11.4",{"_index":1380,"title":{},"body":{"dependencies.html":{}}}],["0.18.0",{"_index":1313,"title":{},"body":{"dependencies.html":{}}}],["0.2.0",{"_index":1212,"title":{},"body":{"changelog.html":{}}}],["0.20.0",{"_index":1335,"title":{},"body":{"dependencies.html":{}}}],["0.5",{"_index":316,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{},"interfaces/ProcessedNode.html":{}}}],["0.5*255",{"_index":177,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["0.5.0",{"_index":1200,"title":{},"body":{"changelog.html":{}}}],["0.6.0",{"_index":1170,"title":{},"body":{"changelog.html":{},"index.html":{}}}],["0.8",{"_index":133,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["0.9*255",{"_index":118,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["0/1",{"_index":1232,"title":{},"body":{"coverage.html":{}}}],["0/13",{"_index":1236,"title":{},"body":{"coverage.html":{}}}],["0/19",{"_index":1240,"title":{},"body":{"coverage.html":{}}}],["0/20",{"_index":1241,"title":{},"body":{"coverage.html":{}}}],["0/26",{"_index":1239,"title":{},"body":{"coverage.html":{}}}],["0/4",{"_index":1265,"title":{},"body":{"coverage.html":{}}}],["0/6",{"_index":1233,"title":{},"body":{"coverage.html":{}}}],["0/7",{"_index":1237,"title":{},"body":{"coverage.html":{}}}],["0/8",{"_index":1238,"title":{},"body":{"coverage.html":{}}}],["01",{"_index":660,"title":{},"body":{"changelog.html":{}}}],["02",{"_index":1020,"title":{},"body":{"changelog.html":{}}}],["03",{"_index":956,"title":{},"body":{"changelog.html":{}}}],["04",{"_index":707,"title":{},"body":{"changelog.html":{}}}],["05",{"_index":926,"title":{},"body":{"changelog.html":{}}}],["06",{"_index":681,"title":{},"body":{"changelog.html":{}}}],["07",{"_index":659,"title":{},"body":{"changelog.html":{}}}],["08",{"_index":1142,"title":{},"body":{"changelog.html":{}}}],["09",{"_index":645,"title":{},"body":{"changelog.html":{}}}],["1",{"_index":179,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/Collision.html":{},"changelog.html":{}}}],["1.0",{"_index":164,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{},"changelog.html":{}}}],["1.0.0",{"_index":1127,"title":{},"body":{"changelog.html":{}}}],["1.0.11",{"_index":1310,"title":{},"body":{"dependencies.html":{}}}],["1.0.3",{"_index":1317,"title":{},"body":{"dependencies.html":{}}}],["1.0.6",{"_index":1375,"title":{},"body":{"dependencies.html":{}}}],["1.1.0",{"_index":1104,"title":{},"body":{"changelog.html":{}}}],["1.16.0",{"_index":1352,"title":{},"body":{"dependencies.html":{}}}],["1.19.0",{"_index":1312,"title":{},"body":{"dependencies.html":{}}}],["1.2.0",{"_index":1054,"title":{},"body":{"changelog.html":{},"dependencies.html":{}}}],["1.2.3",{"_index":1321,"title":{},"body":{"dependencies.html":{}}}],["1.2.6",{"_index":1355,"title":{},"body":{"dependencies.html":{}}}],["1.3.5",{"_index":1019,"title":{},"body":{"changelog.html":{}}}],["1.4.0",{"_index":992,"title":{},"body":{"changelog.html":{},"dependencies.html":{}}}],["1.4.1",{"_index":1338,"title":{},"body":{"dependencies.html":{}}}],["1.5.0",{"_index":955,"title":{},"body":{"changelog.html":{}}}],["1.6.0",{"_index":940,"title":{},"body":{"changelog.html":{}}}],["1.6875389974302382e",{"_index":352,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["1.7.0",{"_index":925,"title":{},"body":{"changelog.html":{}}}],["1.7.2",{"_index":1324,"title":{},"body":{"dependencies.html":{}}}],["1/37",{"_index":1235,"title":{},"body":{"coverage.html":{}}}],["10",{"_index":619,"title":{},"body":{"changelog.html":{}}}],["10.0",{"_index":307,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["10.0.0",{"_index":1333,"title":{},"body":{"dependencies.html":{}}}],["1000",{"_index":282,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["10x",{"_index":1116,"title":{},"body":{"changelog.html":{}}}],["11",{"_index":994,"title":{},"body":{"changelog.html":{}}}],["11.2.1",{"_index":1357,"title":{},"body":{"dependencies.html":{}}}],["11.5",{"_index":370,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["12",{"_index":717,"title":{},"body":{"changelog.html":{},"index.html":{}}}],["12.0.1",{"_index":1359,"title":{},"body":{"dependencies.html":{}}}],["12.1.1",{"_index":1271,"title":{},"body":{"dependencies.html":{}}}],["12.1.3",{"_index":1279,"title":{},"body":{"dependencies.html":{}}}],["13",{"_index":825,"title":{},"body":{"changelog.html":{}}}],["136",{"_index":99,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["14",{"_index":708,"title":{},"body":{"changelog.html":{}}}],["15",{"_index":313,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{},"changelog.html":{}}}],["15.126.1",{"_index":1269,"title":{},"body":{"dependencies.html":{}}}],["16",{"_index":890,"title":{},"body":{"changelog.html":{}}}],["16.0.0",{"_index":1326,"title":{},"body":{"dependencies.html":{}}}],["17",{"_index":682,"title":{},"body":{"changelog.html":{}}}],["17,0,0",{"_index":351,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["17,0.076,0,0.49,0.034,0.11,1",{"_index":353,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["2",{"_index":400,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{},"changelog.html":{},"coverage.html":{},"overview.html":{}}}],["2.0.0",{"_index":889,"title":{},"body":{"changelog.html":{}}}],["2.0.5",{"_index":1330,"title":{},"body":{"dependencies.html":{}}}],["2.1.0",{"_index":847,"title":{},"body":{"changelog.html":{},"dependencies.html":{}}}],["2.2.0",{"_index":836,"title":{},"body":{"changelog.html":{},"dependencies.html":{}}}],["2.3.0",{"_index":831,"title":{},"body":{"changelog.html":{}}}],["2.3.1",{"_index":824,"title":{},"body":{"changelog.html":{}}}],["2.4.0",{"_index":809,"title":{},"body":{"changelog.html":{}}}],["2.5.0",{"_index":786,"title":{},"body":{"changelog.html":{},"dependencies.html":{}}}],["2.6.7",{"_index":1361,"title":{},"body":{"dependencies.html":{}}}],["2.8.5",{"_index":1319,"title":{},"body":{"dependencies.html":{}}}],["2.awsapprunner.com",{"_index":1438,"title":{},"body":{"index.html":{}}}],["200",{"_index":328,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["2019",{"_index":1141,"title":{},"body":{"changelog.html":{},"license.html":{}}}],["2020",{"_index":1056,"title":{},"body":{"changelog.html":{}}}],["2021",{"_index":771,"title":{},"body":{"changelog.html":{}}}],["2022",{"_index":618,"title":{},"body":{"changelog.html":{}}}],["21",{"_index":927,"title":{},"body":{"changelog.html":{}}}],["22",{"_index":1129,"title":{},"body":{"changelog.html":{}}}],["229",{"_index":100,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["24",{"_index":1201,"title":{},"body":{"changelog.html":{}}}],["255",{"_index":101,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{},"interfaces/ProcessedNode.html":{}}}],["26",{"_index":957,"title":{},"body":{"changelog.html":{}}}],["26th",{"_index":997,"title":{},"body":{"changelog.html":{}}}],["27",{"_index":646,"title":{},"body":{"changelog.html":{}}}],["3",{"_index":1041,"title":{},"body":{"changelog.html":{}}}],["3.0.0",{"_index":767,"title":{},"body":{"changelog.html":{},"dependencies.html":{}}}],["3.0.12",{"_index":1290,"title":{},"body":{"dependencies.html":{}}}],["3.1.0",{"_index":725,"title":{},"body":{"changelog.html":{}}}],["3.1.1",{"_index":716,"title":{},"body":{"changelog.html":{}}}],["3.2.0",{"_index":706,"title":{},"body":{"changelog.html":{}}}],["3.3.0",{"_index":680,"title":{},"body":{"changelog.html":{}}}],["3.4.0",{"_index":658,"title":{},"body":{"changelog.html":{}}}],["3.5.0",{"_index":644,"title":{},"body":{"changelog.html":{}}}],["3.5.5",{"_index":1292,"title":{},"body":{"dependencies.html":{}}}],["3.5.7",{"_index":1294,"title":{},"body":{"dependencies.html":{}}}],["3.6",{"_index":1445,"title":{},"body":{"index.html":{}}}],["3.6.0",{"_index":617,"title":{},"body":{"changelog.html":{},"dependencies.html":{}}}],["3.7.1",{"_index":1302,"title":{},"body":{"dependencies.html":{}}}],["3.7.3",{"_index":1305,"title":{},"body":{"dependencies.html":{}}}],["30",{"_index":98,"title":{},"body":{"classes/BodyUILayer.html":{},"changelog.html":{}}}],["31",{"_index":1105,"title":{},"body":{"changelog.html":{}}}],["3d",{"_index":343,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{},"changelog.html":{},"miscellaneous/variables.html":{}}}],["4",{"_index":1075,"title":{},"body":{"changelog.html":{}}}],["4.0",{"_index":1422,"title":{},"body":{"index.html":{}}}],["4.0.2",{"_index":1299,"title":{},"body":{"dependencies.html":{}}}],["4.17.1",{"_index":1328,"title":{},"body":{"dependencies.html":{}}}],["4.17.21",{"_index":1349,"title":{},"body":{"dependencies.html":{}}}],["4.3.0",{"_index":1315,"title":{},"body":{"dependencies.html":{}}}],["4.6.0",{"_index":1340,"title":{},"body":{"dependencies.html":{}}}],["4th",{"_index":628,"title":{},"body":{"changelog.html":{}}}],["5.0.0",{"_index":1343,"title":{},"body":{"dependencies.html":{}}}],["5.2.0",{"_index":1347,"title":{},"body":{"dependencies.html":{}}}],["6.0.1",{"_index":1346,"title":{},"body":{"dependencies.html":{}}}],["6.10.2",{"_index":1363,"title":{},"body":{"dependencies.html":{}}}],["6.2.0",{"_index":1297,"title":{},"body":{"dependencies.html":{}}}],["6.5.1",{"_index":1372,"title":{},"body":{"dependencies.html":{}}}],["6.6.7",{"_index":1369,"title":{},"body":{"dependencies.html":{}}}],["8",{"_index":933,"title":{},"body":{"changelog.html":{}}}],["8.3.2",{"_index":1378,"title":{},"body":{"dependencies.html":{}}}],["8.5.12",{"_index":1291,"title":{},"body":{"dependencies.html":{}}}],["8.5.7",{"_index":1287,"title":{},"body":{"dependencies.html":{}}}],["8.7.8",{"_index":1289,"title":{},"body":{"dependencies.html":{}}}],["8.9",{"_index":399,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["85",{"_index":1211,"title":{},"body":{"changelog.html":{}}}],["9",{"_index":1520,"title":{},"body":{"overview.html":{}}}],["9.5",{"_index":319,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["90",{"_index":1152,"title":{},"body":{"changelog.html":{}}}],["95",{"_index":712,"title":{},"body":{"changelog.html":{}}}],["9th",{"_index":967,"title":{},"body":{"changelog.html":{}}}],["_dragevent(info",{"_index":413,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["_lighting",{"_index":172,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{},"interfaces/ProcessedNode.html":{},"interfaces/SpatialSceneNode.html":{}}}],["_onclick(info",{"_index":384,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["_ondrag(info",{"_index":409,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["_ondragend(info",{"_index":411,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["_ondragstart(info",{"_index":406,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["_onhover(e",{"_index":376,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["_onviewstatechange(event",{"_index":392,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["aabb",{"_index":426,"title":{},"body":{"interfaces/Collision.html":{},"interfaces/ProcessedNode.html":{}}}],["ability",{"_index":862,"title":{},"body":{"changelog.html":{}}}],["above",{"_index":1196,"title":{},"body":{"changelog.html":{},"license.html":{}}}],["accurate",{"_index":954,"title":{},"body":{"changelog.html":{}}}],["action",{"_index":1510,"title":{},"body":{"license.html":{}}}],["actions",{"_index":1045,"title":{},"body":{"changelog.html":{}}}],["added",{"_index":620,"title":{},"body":{"changelog.html":{}}}],["additional",{"_index":1197,"title":{},"body":{"changelog.html":{}}}],["addressed",{"_index":1098,"title":{},"body":{"changelog.html":{}}}],["adds",{"_index":685,"title":{},"body":{"changelog.html":{}}}],["adjusting",{"_index":1092,"title":{},"body":{"changelog.html":{}}}],["adjustment",{"_index":990,"title":{},"body":{"changelog.html":{}}}],["advanced",{"_index":893,"title":{},"body":{"changelog.html":{}}}],["again",{"_index":1065,"title":{},"body":{"changelog.html":{}}}],["age",{"_index":805,"title":{},"body":{"changelog.html":{}}}],["ala",{"_index":828,"title":{},"body":{"changelog.html":{}}}],["aliases",{"_index":1522,"title":{},"body":{"miscellaneous/typealiases.html":{}}}],["allows",{"_index":974,"title":{},"body":{"changelog.html":{}}}],["alpha",{"_index":1182,"title":{},"body":{"changelog.html":{}}}],["alpha.1",{"_index":1160,"title":{},"body":{"changelog.html":{}}}],["alpha.2",{"_index":1155,"title":{},"body":{"changelog.html":{}}}],["alpha.3",{"_index":1140,"title":{},"body":{"changelog.html":{}}}],["alt",{"_index":1426,"title":{},"body":{"index.html":{}}}],["ambientlight",{"_index":213,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["analytics",{"_index":895,"title":{},"body":{"changelog.html":{},"dependencies.html":{}}}],["anatomical",{"_index":989,"title":{},"body":{"changelog.html":{},"coverage.html":{},"miscellaneous/functions.html":{}}}],["anatomicalstructuresurl",{"_index":1533,"title":{},"body":{"miscellaneous/variables.html":{}}}],["and/or",{"_index":1481,"title":{},"body":{"license.html":{}}}],["angular",{"_index":745,"title":{},"body":{"changelog.html":{},"dependencies.html":{},"index.html":{}}}],["angular/animations",{"_index":1270,"title":{},"body":{"dependencies.html":{}}}],["angular/cdk",{"_index":1272,"title":{},"body":{"dependencies.html":{}}}],["angular/common",{"_index":1273,"title":{},"body":{"dependencies.html":{}}}],["angular/compiler",{"_index":1274,"title":{},"body":{"dependencies.html":{}}}],["angular/core",{"_index":1275,"title":{},"body":{"dependencies.html":{}}}],["angular/elements",{"_index":1276,"title":{},"body":{"dependencies.html":{}}}],["angular/forms",{"_index":1277,"title":{},"body":{"dependencies.html":{}}}],["angular/material",{"_index":1278,"title":{},"body":{"dependencies.html":{}}}],["angular/platform",{"_index":1280,"title":{},"body":{"dependencies.html":{}}}],["angular/router",{"_index":1282,"title":{},"body":{"dependencies.html":{}}}],["angular/youtube",{"_index":1283,"title":{},"body":{"dependencies.html":{}}}],["api",{"_index":633,"title":{},"body":{"changelog.html":{},"index.html":{}}}],["api.hubmapconsortium.org",{"_index":1435,"title":{},"body":{"index.html":{}}}],["appear",{"_index":780,"title":{},"body":{"changelog.html":{}}}],["application",{"_index":978,"title":{},"body":{"changelog.html":{}}}],["applied",{"_index":1028,"title":{},"body":{"changelog.html":{}}}],["appropriate",{"_index":748,"title":{},"body":{"changelog.html":{}}}],["april",{"_index":966,"title":{},"body":{"changelog.html":{}}}],["arising",{"_index":1514,"title":{},"body":{"license.html":{}}}],["asct+b",{"_index":772,"title":{},"body":{"changelog.html":{}}}],["assignment/selection",{"_index":942,"title":{},"body":{"changelog.html":{}}}],["associated",{"_index":838,"title":{},"body":{"changelog.html":{},"license.html":{}}}],["async",{"_index":321,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/Collision.html":{},"interfaces/PickInfo.html":{},"interfaces/ProcessedNode.html":{}}}],["atlas",{"_index":626,"title":{},"body":{"changelog.html":{}}}],["attempts",{"_index":813,"title":{},"body":{"changelog.html":{}}}],["authors",{"_index":1503,"title":{},"body":{"license.html":{}}}],["autohighlight",{"_index":95,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["automatic",{"_index":1079,"title":{},"body":{"changelog.html":{}}}],["automatically",{"_index":1029,"title":{},"body":{"changelog.html":{}}}],["available",{"_index":1072,"title":{},"body":{"changelog.html":{}}}],["avoid",{"_index":880,"title":{},"body":{"changelog.html":{}}}],["await",{"_index":324,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/Collision.html":{},"interfaces/PickInfo.html":{},"interfaces/ProcessedNode.html":{}}}],["award",{"_index":1456,"title":{},"body":{"index.html":{}}}],["b",{"_index":1527,"title":{},"body":{"miscellaneous/variables.html":{}}}],["backend",{"_index":792,"title":{},"body":{"changelog.html":{}}}],["background",{"_index":1193,"title":{},"body":{"changelog.html":{},"index.html":{}}}],["base",{"_index":1165,"title":{},"body":{"changelog.html":{}}}],["based",{"_index":869,"title":{},"body":{"changelog.html":{}}}],["basic",{"_index":891,"title":{},"body":{"changelog.html":{}}}],["bbox",{"_index":449,"title":{},"body":{"interfaces/Collision.html":{},"interfaces/ProcessedNode.html":{}}}],["before",{"_index":784,"title":{},"body":{"changelog.html":{}}}],["behaviorsubject",{"_index":222,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["behaviorsubject([0",{"_index":253,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["being",{"_index":924,"title":{},"body":{"changelog.html":{}}}],["beta",{"_index":770,"title":{},"body":{"changelog.html":{},"index.html":{}}}],["better",{"_index":848,"title":{},"body":{"changelog.html":{}}}],["between",{"_index":1133,"title":{},"body":{"changelog.html":{}}}],["bind",{"_index":220,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{},"dependencies.html":{}}}],["block",{"_index":733,"title":{},"body":{"changelog.html":{}}}],["blocks",{"_index":675,"title":{},"body":{"changelog.html":{}}}],["bmi",{"_index":806,"title":{},"body":{"changelog.html":{}}}],["board",{"_index":1157,"title":{},"body":{"changelog.html":{}}}],["body",{"_index":7,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/Collision.html":{},"interfaces/PickInfo.html":{},"interfaces/ProcessedNode.html":{},"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{},"interfaces/SpatialSceneNode.html":{},"changelog.html":{},"coverage.html":{},"dependencies.html":{},"miscellaneous/functions.html":{},"miscellaneous/typealiases.html":{},"miscellaneous/variables.html":{}}}],["bodyui",{"_index":247,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{},"coverage.html":{}}}],["bodyuilayer",{"_index":1,"title":{"classes/BodyUILayer.html":{}},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{},"coverage.html":{}}}],["bodyuilayer.gltfcache",{"_index":153,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["bodyuiprops",{"_index":197,"title":{"interfaces/BodyUIProps.html":{}},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{},"coverage.html":{}}}],["bodyuiviewstateprops",{"_index":230,"title":{"interfaces/BodyUIViewStateProps.html":{}},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{},"coverage.html":{}}}],["boolean",{"_index":136,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{},"interfaces/SpatialSceneNode.html":{},"miscellaneous/functions.html":{}}}],["both",{"_index":834,"title":{},"body":{"changelog.html":{}}}],["box",{"_index":879,"title":{},"body":{"changelog.html":{}}}],["break",{"_index":88,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["breaking",{"_index":914,"title":{},"body":{"changelog.html":{}}}],["bringing",{"_index":934,"title":{},"body":{"changelog.html":{}}}],["browser",{"_index":1146,"title":{},"body":{"changelog.html":{},"dependencies.html":{}}}],["browserify",{"_index":1370,"title":{},"body":{"dependencies.html":{}}}],["browsing",{"_index":1221,"title":{},"body":{"changelog.html":{}}}],["bug",{"_index":704,"title":{},"body":{"changelog.html":{}}}],["build",{"_index":1418,"title":{},"body":{"index.html":{}}}],["builds",{"_index":766,"title":{},"body":{"changelog.html":{}}}],["button",{"_index":1159,"title":{},"body":{"changelog.html":{}}}],["c",{"_index":1461,"title":{},"body":{"license.html":{}}}],["cache",{"_index":1308,"title":{},"body":{"dependencies.html":{},"miscellaneous/functions.html":{}}}],["cacheable",{"_index":1374,"title":{},"body":{"dependencies.html":{}}}],["callback",{"_index":866,"title":{},"body":{"changelog.html":{}}}],["called",{"_index":920,"title":{},"body":{"changelog.html":{}}}],["calls",{"_index":642,"title":{},"body":{"changelog.html":{}}}],["camera",{"_index":200,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["cancelregistration",{"_index":865,"title":{},"body":{"changelog.html":{}}}],["candidate",{"_index":1131,"title":{},"body":{"changelog.html":{}}}],["cannon",{"_index":428,"title":{},"body":{"interfaces/Collision.html":{},"interfaces/ProcessedNode.html":{},"dependencies.html":{}}}],["canvas",{"_index":201,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["card",{"_index":898,"title":{},"body":{"changelog.html":{}}}],["carousel",{"_index":903,"title":{},"body":{"changelog.html":{}}}],["case",{"_index":85,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["cases",{"_index":1103,"title":{},"body":{"changelog.html":{}}}],["casttoglobaltype",{"_index":1231,"title":{},"body":{"coverage.html":{},"miscellaneous/functions.html":{}}}],["casttoglobaltype(value",{"_index":1391,"title":{},"body":{"miscellaneous/functions.html":{}}}],["ccf",{"_index":246,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{},"changelog.html":{},"index.html":{}}}],["ccf's",{"_index":1050,"title":{},"body":{"changelog.html":{}}}],["ccf.owl",{"_index":622,"title":{},"body":{"changelog.html":{}}}],["ccf_annotations",{"_index":562,"title":{},"body":{"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{}}}],["cell",{"_index":727,"title":{},"body":{"changelog.html":{}}}],["center",{"_index":506,"title":{},"body":{"interfaces/ProcessedNode.html":{},"index.html":{}}}],["change",{"_index":917,"title":{},"body":{"changelog.html":{},"index.html":{}}}],["changed",{"_index":636,"title":{},"body":{"changelog.html":{}}}],["changelog",{"_index":613,"title":{"changelog.html":{}},"body":{"changelog.html":{},"index.html":{}}}],["changes",{"_index":734,"title":{},"body":{"changelog.html":{}}}],["charge",{"_index":1467,"title":{},"body":{"license.html":{}}}],["child",{"_index":511,"title":{},"body":{"interfaces/ProcessedNode.html":{}}}],["child.bbox.clone",{"_index":536,"title":{},"body":{"interfaces/ProcessedNode.html":{}}}],["childnames",{"_index":1257,"title":{},"body":{"coverage.html":{},"miscellaneous/functions.html":{}}}],["childnames(child",{"_index":515,"title":{},"body":{"interfaces/ProcessedNode.html":{}}}],["childnames(node.node).map(n",{"_index":533,"title":{},"body":{"interfaces/ProcessedNode.html":{}}}],["childnames(scene",{"_index":509,"title":{},"body":{"interfaces/ProcessedNode.html":{},"miscellaneous/functions.html":{}}}],["choose",{"_index":1073,"title":{},"body":{"changelog.html":{}}}],["ci/cd",{"_index":1048,"title":{},"body":{"changelog.html":{}}}],["claim",{"_index":1506,"title":{},"body":{"license.html":{}}}],["class",{"_index":0,"title":{"classes/BodyUILayer.html":{}},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{},"coverage.html":{}}}],["classes",{"_index":2,"title":{},"body":{"classes/BodyUILayer.html":{},"overview.html":{}}}],["clean",{"_index":702,"title":{},"body":{"changelog.html":{}}}],["cleanup",{"_index":769,"title":{},"body":{"changelog.html":{}}}],["click",{"_index":820,"title":{},"body":{"changelog.html":{}}}],["clicking",{"_index":910,"title":{},"body":{"changelog.html":{}}}],["client",{"_index":1441,"title":{},"body":{"index.html":{}}}],["code",{"_index":762,"title":{},"body":{"changelog.html":{}}}],["codebase",{"_index":1059,"title":{},"body":{"changelog.html":{}}}],["codex",{"_index":1115,"title":{},"body":{"changelog.html":{}}}],["codifies",{"_index":1175,"title":{},"body":{"changelog.html":{}}}],["collaboration",{"_index":1057,"title":{},"body":{"changelog.html":{}}}],["collider",{"_index":71,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["collider.ts",{"_index":418,"title":{},"body":{"interfaces/Collision.html":{},"coverage.html":{},"miscellaneous/functions.html":{}}}],["collision",{"_index":416,"title":{"interfaces/Collision.html":{}},"body":{"interfaces/Collision.html":{},"coverage.html":{}}}],["collisioning",{"_index":434,"title":{},"body":{"interfaces/Collision.html":{}}}],["collisions",{"_index":1081,"title":{},"body":{"changelog.html":{}}}],["color",{"_index":117,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{},"interfaces/ProcessedNode.html":{},"interfaces/SpatialSceneNode.html":{},"changelog.html":{}}}],["colorizing",{"_index":1124,"title":{},"body":{"changelog.html":{}}}],["combination",{"_index":1074,"title":{},"body":{"changelog.html":{}}}],["come",{"_index":1120,"title":{},"body":{"changelog.html":{}}}],["coming",{"_index":1112,"title":{},"body":{"changelog.html":{}}}],["comlink",{"_index":1314,"title":{},"body":{"dependencies.html":{}}}],["comment",{"_index":563,"title":{},"body":{"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{}}}],["common",{"_index":614,"title":{},"body":{"changelog.html":{},"index.html":{}}}],["complexity",{"_index":949,"title":{},"body":{"changelog.html":{}}}],["compodoc",{"_index":760,"title":{},"body":{"changelog.html":{}}}],["component",{"_index":719,"title":{},"body":{"changelog.html":{},"index.html":{}}}],["components",{"_index":892,"title":{},"body":{"changelog.html":{}}}],["compositelayer",{"_index":12,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["comunica/query",{"_index":1285,"title":{},"body":{"dependencies.html":{}}}],["concat",{"_index":1316,"title":{},"body":{"dependencies.html":{}}}],["conditions",{"_index":1488,"title":{},"body":{"license.html":{}}}],["cone",{"_index":89,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/SpatialSceneNode.html":{},"miscellaneous/typealiases.html":{}}}],["conegeometry",{"_index":52,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["config",{"_index":861,"title":{},"body":{"changelog.html":{},"miscellaneous/functions.html":{}}}],["config.csv",{"_index":1532,"title":{},"body":{"miscellaneous/variables.html":{}}}],["configuration",{"_index":851,"title":{},"body":{"changelog.html":{}}}],["configurations",{"_index":860,"title":{},"body":{"changelog.html":{}}}],["confirmation",{"_index":811,"title":{},"body":{"changelog.html":{}}}],["conform",{"_index":873,"title":{},"body":{"changelog.html":{}}}],["connect",{"_index":790,"title":{},"body":{"changelog.html":{}}}],["connection",{"_index":1516,"title":{},"body":{"license.html":{}}}],["console.log",{"_index":487,"title":{},"body":{"interfaces/Collision.html":{}}}],["console.log('data",{"_index":357,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["console.log('results",{"_index":356,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["console.log('starting",{"_index":433,"title":{},"body":{"interfaces/Collision.html":{}}}],["console.log(csvreport",{"_index":501,"title":{},"body":{"interfaces/Collision.html":{}}}],["consortium",{"_index":1462,"title":{},"body":{"license.html":{}}}],["const",{"_index":129,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/Collision.html":{},"interfaces/PickInfo.html":{},"interfaces/ProcessedNode.html":{}}}],["constructor(private",{"_index":273,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["container",{"_index":905,"title":{},"body":{"changelog.html":{}}}],["containers",{"_index":850,"title":{},"body":{"changelog.html":{}}}],["containing",{"_index":1416,"title":{},"body":{"index.html":{}}}],["context",{"_index":561,"title":{},"body":{"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{}}}],["contract",{"_index":1511,"title":{},"body":{"license.html":{}}}],["control",{"_index":1015,"title":{},"body":{"changelog.html":{}}}],["controller",{"_index":283,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["convenience",{"_index":244,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["convention",{"_index":171,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["coordinate",{"_index":238,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{},"changelog.html":{},"index.html":{}}}],["coordinate_system",{"_index":44,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["coordinate_system.cartesian",{"_index":103,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["coordinatesystem",{"_index":102,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["copies",{"_index":1483,"title":{},"body":{"license.html":{}}}],["copy",{"_index":1470,"title":{},"body":{"license.html":{}}}],["copyright",{"_index":1460,"title":{},"body":{"license.html":{}}}],["cord",{"_index":688,"title":{},"body":{"changelog.html":{}}}],["cors",{"_index":1318,"title":{},"body":{"dependencies.html":{}}}],["coverage",{"_index":1153,"title":{"coverage.html":{}},"body":{"changelog.html":{},"coverage.html":{}}}],["created",{"_index":1024,"title":{},"body":{"changelog.html":{}}}],["creation_date",{"_index":564,"title":{},"body":{"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{}}}],["creator",{"_index":565,"title":{},"body":{"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{}}}],["creator_first_name",{"_index":566,"title":{},"body":{"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{}}}],["creator_last_name",{"_index":567,"title":{},"body":{"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{}}}],["credits",{"_index":1447,"title":{},"body":{"index.html":{}}}],["css",{"_index":1320,"title":{},"body":{"dependencies.html":{}}}],["csv.ts",{"_index":1246,"title":{},"body":{"coverage.html":{},"miscellaneous/functions.html":{}}}],["csvreport",{"_index":491,"title":{},"body":{"interfaces/Collision.html":{}}}],["csvreport.push",{"_index":493,"title":{},"body":{"interfaces/Collision.html":{}}}],["csvtext",{"_index":1402,"title":{},"body":{"miscellaneous/functions.html":{}}}],["ctrlclick",{"_index":243,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["ctrlkey",{"_index":386,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["cube",{"_index":91,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/SpatialSceneNode.html":{},"miscellaneous/typealiases.html":{}}}],["cubegeometry",{"_index":53,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["cuboid",{"_index":1151,"title":{},"body":{"changelog.html":{}}}],["cuboids",{"_index":1149,"title":{},"body":{"changelog.html":{}}}],["currently",{"_index":802,"title":{},"body":{"changelog.html":{}}}],["currentstate",{"_index":396,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["currentstate.data",{"_index":402,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["currentstate.zoomopacity",{"_index":401,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["cursor",{"_index":271,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["cyberinfrastructure",{"_index":1449,"title":{},"body":{"index.html":{}}}],["cycle",{"_index":960,"title":{},"body":{"changelog.html":{}}}],["cylinder",{"_index":90,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/SpatialSceneNode.html":{},"miscellaneous/typealiases.html":{}}}],["cylindergeometry",{"_index":54,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["d",{"_index":113,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["d.geometry",{"_index":438,"title":{},"body":{"interfaces/Collision.html":{}}}],["d.scenegraph",{"_index":437,"title":{},"body":{"interfaces/Collision.html":{}}}],["damages",{"_index":1507,"title":{},"body":{"license.html":{}}}],["dark/light",{"_index":868,"title":{},"body":{"changelog.html":{}}}],["data",{"_index":74,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{},"changelog.html":{},"miscellaneous/functions.html":{}}}],["data.concat(object.values(results",{"_index":359,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["data.length",{"_index":79,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["data.map(d",{"_index":120,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["data.push",{"_index":360,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["data.ts",{"_index":1253,"title":{},"body":{"coverage.html":{},"miscellaneous/functions.html":{},"miscellaneous/variables.html":{}}}],["data?.length",{"_index":332,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["database",{"_index":709,"title":{},"body":{"changelog.html":{}}}],["datasets",{"_index":972,"title":{},"body":{"changelog.html":{}}}],["deal",{"_index":1472,"title":{},"body":{"license.html":{}}}],["dealings",{"_index":1517,"title":{},"body":{"license.html":{}}}],["debugscenenodeprocessing",{"_index":202,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["debugscenenodeprocessing(data",{"_index":340,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["december",{"_index":1066,"title":{},"body":{"changelog.html":{}}}],["deck",{"_index":214,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["deck(props",{"_index":309,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["deck.gl/core",{"_index":45,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{},"dependencies.html":{}}}],["deck.gl/core/lib/deck",{"_index":219,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["deck.gl/geo",{"_index":1288,"title":{},"body":{"dependencies.html":{}}}],["deck.gl/layers",{"_index":47,"title":{},"body":{"classes/BodyUILayer.html":{},"dependencies.html":{}}}],["deck.gl/mesh",{"_index":50,"title":{},"body":{"classes/BodyUILayer.html":{},"dependencies.html":{}}}],["deckprops",{"_index":274,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["deckprops.camera",{"_index":278,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["deckprops.interactive",{"_index":284,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["deckprops.legacylighting",{"_index":304,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["deckprops.maxrotationx",{"_index":314,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["deckprops.minrotationx",{"_index":312,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["deckprops.rotation",{"_index":317,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["deckprops.target",{"_index":315,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["deckprops.zoom",{"_index":318,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["decompress",{"_index":459,"title":{},"body":{"interfaces/Collision.html":{}}}],["decorator",{"_index":221,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{},"dependencies.html":{}}}],["deeply",{"_index":794,"title":{},"body":{"changelog.html":{}}}],["default",{"_index":26,"title":{},"body":{"classes/BodyUILayer.html":{},"changelog.html":{},"miscellaneous/variables.html":{}}}],["defined",{"_index":28,"title":{},"body":{"classes/BodyUILayer.html":{},"changelog.html":{}}}],["delete",{"_index":538,"title":{},"body":{"interfaces/ProcessedNode.html":{}}}],["demo",{"_index":822,"title":{},"body":{"changelog.html":{}}}],["dependencies",{"_index":900,"title":{"dependencies.html":{}},"body":{"changelog.html":{},"dependencies.html":{}}}],["depending",{"_index":923,"title":{},"body":{"changelog.html":{}}}],["depthmask",{"_index":178,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["derivescenegraph",{"_index":1244,"title":{},"body":{"coverage.html":{},"miscellaneous/functions.html":{}}}],["derivescenegraph(scenegraphnodename",{"_index":1393,"title":{},"body":{"miscellaneous/functions.html":{}}}],["descrepancies",{"_index":673,"title":{},"body":{"changelog.html":{}}}],["details",{"_index":1199,"title":{},"body":{"changelog.html":{}}}],["developed",{"_index":1448,"title":{},"body":{"index.html":{}}}],["developments",{"_index":1180,"title":{},"body":{"changelog.html":{},"index.html":{}}}],["dialog",{"_index":812,"title":{},"body":{"changelog.html":{}}}],["didzoom",{"_index":333,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["different",{"_index":849,"title":{},"body":{"changelog.html":{}}}],["digits",{"_index":1042,"title":{},"body":{"changelog.html":{}}}],["dimension_units",{"_index":568,"title":{},"body":{"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{}}}],["direct",{"_index":1208,"title":{},"body":{"changelog.html":{}}}],["directly",{"_index":1113,"title":{},"body":{"changelog.html":{}}}],["disable",{"_index":105,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/Collision.html":{},"interfaces/PickInfo.html":{},"interfaces/ProcessedNode.html":{}}}],["display",{"_index":841,"title":{},"body":{"changelog.html":{}}}],["displayed",{"_index":1150,"title":{},"body":{"changelog.html":{}}}],["displaying",{"_index":837,"title":{},"body":{"changelog.html":{}}}],["distribute",{"_index":1479,"title":{},"body":{"license.html":{}}}],["doc",{"_index":1163,"title":{},"body":{"changelog.html":{}}}],["docollisions",{"_index":69,"title":{},"body":{"classes/BodyUILayer.html":{},"coverage.html":{},"miscellaneous/functions.html":{}}}],["docollisions(scene",{"_index":432,"title":{},"body":{"interfaces/Collision.html":{},"miscellaneous/functions.html":{}}}],["docollisions(state.data",{"_index":187,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["docs",{"_index":699,"title":{},"body":{"changelog.html":{}}}],["document",{"_index":1322,"title":{},"body":{"dependencies.html":{}}}],["documentation",{"_index":763,"title":{},"body":{"changelog.html":{},"coverage.html":{},"license.html":{}}}],["done",{"_index":915,"title":{},"body":{"changelog.html":{}}}],["donor",{"_index":897,"title":{},"body":{"changelog.html":{}}}],["donors",{"_index":975,"title":{},"body":{"changelog.html":{}}}],["dotenv",{"_index":1325,"title":{},"body":{"dependencies.html":{}}}],["download",{"_index":1191,"title":{},"body":{"changelog.html":{}}}],["dracoloader",{"_index":422,"title":{},"body":{"interfaces/Collision.html":{}}}],["during",{"_index":959,"title":{},"body":{"changelog.html":{}}}],["dynamic",{"_index":1281,"title":{},"body":{"dependencies.html":{}}}],["dynamically",{"_index":666,"title":{},"body":{"changelog.html":{}}}],["e",{"_index":37,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["e.info",{"_index":192,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["e.isdragging",{"_index":301,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["e.object",{"_index":379,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["e.object['@id",{"_index":380,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["e.picked",{"_index":377,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["e?.srcevent?.ctrlkey",{"_index":391,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["easier",{"_index":739,"title":{},"body":{"changelog.html":{}}}],["east",{"_index":1437,"title":{},"body":{"index.html":{}}}],["effect",{"_index":1095,"title":{},"body":{"changelog.html":{}}}],["efficiency",{"_index":1002,"title":{},"body":{"changelog.html":{}}}],["element",{"_index":918,"title":{},"body":{"changelog.html":{},"dependencies.html":{}}}],["embedded",{"_index":857,"title":{},"body":{"changelog.html":{}}}],["embedding",{"_index":846,"title":{},"body":{"changelog.html":{}}}],["embedding.md",{"_index":844,"title":{},"body":{"changelog.html":{}}}],["enable",{"_index":502,"title":{},"body":{"interfaces/Collision.html":{},"interfaces/ProcessedNode.html":{}}}],["entities",{"_index":1404,"title":{},"body":{"miscellaneous/functions.html":{}}}],["entities.ts",{"_index":1258,"title":{},"body":{"coverage.html":{},"miscellaneous/functions.html":{}}}],["entityid",{"_index":447,"title":{},"body":{"interfaces/Collision.html":{},"interfaces/SpatialSceneNode.html":{}}}],["es",{"_index":429,"title":{},"body":{"interfaces/Collision.html":{},"interfaces/ProcessedNode.html":{},"dependencies.html":{}}}],["eslint",{"_index":104,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/Collision.html":{},"interfaces/PickInfo.html":{},"interfaces/ProcessedNode.html":{}}}],["eslint/naming",{"_index":170,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["eslint/no",{"_index":109,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["etc",{"_index":877,"title":{},"body":{"changelog.html":{}}}],["eui",{"_index":722,"title":{},"body":{"changelog.html":{},"index.html":{}}}],["eui/rui",{"_index":756,"title":{},"body":{"changelog.html":{}}}],["event",{"_index":1502,"title":{},"body":{"license.html":{}}}],["event.interactionstate?.iszooming",{"_index":395,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["event.viewstate",{"_index":403,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["event.viewstate.rotationx",{"_index":405,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["event.viewstate.zoom",{"_index":398,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["expanded",{"_index":664,"title":{},"body":{"changelog.html":{}}}],["explicit",{"_index":110,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["exploration",{"_index":1420,"title":{},"body":{"index.html":{}}}],["export",{"_index":126,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/Collision.html":{},"interfaces/PickInfo.html":{},"interfaces/ProcessedNode.html":{},"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{},"interfaces/SpatialSceneNode.html":{}}}],["express",{"_index":1327,"title":{},"body":{"dependencies.html":{},"license.html":{}}}],["extends",{"_index":11,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{},"interfaces/ProcessedNode.html":{},"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{}}}],["external",{"_index":864,"title":{},"body":{"changelog.html":{}}}],["extra",{"_index":1332,"title":{},"body":{"dependencies.html":{}}}],["extraction",{"_index":818,"title":{},"body":{"changelog.html":{},"coverage.html":{},"miscellaneous/functions.html":{},"miscellaneous/variables.html":{}}}],["extraction_set",{"_index":569,"title":{},"body":{"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{}}}],["extractionsitesconfigurl",{"_index":1529,"title":{},"body":{"miscellaneous/variables.html":{}}}],["extractionsitesurl",{"_index":1525,"title":{},"body":{"miscellaneous/variables.html":{}}}],["fail",{"_index":1062,"title":{},"body":{"changelog.html":{}}}],["fails",{"_index":1100,"title":{},"body":{"changelog.html":{}}}],["false",{"_index":96,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["favor",{"_index":1053,"title":{},"body":{"changelog.html":{}}}],["feature",{"_index":662,"title":{},"body":{"changelog.html":{}}}],["features",{"_index":961,"title":{},"body":{"changelog.html":{}}}],["feel",{"_index":1000,"title":{},"body":{"changelog.html":{}}}],["female",{"_index":586,"title":{},"body":{"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{}}}],["fetch",{"_index":1360,"title":{},"body":{"dependencies.html":{}}}],["field",{"_index":874,"title":{},"body":{"changelog.html":{}}}],["file",{"_index":5,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/Collision.html":{},"interfaces/PickInfo.html":{},"interfaces/ProcessedNode.html":{},"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{},"interfaces/SpatialSceneNode.html":{},"changelog.html":{},"coverage.html":{},"dependencies.html":{}}}],["file_format",{"_index":604,"title":{},"body":{"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{}}}],["files",{"_index":1471,"title":{},"body":{"license.html":{}}}],["filter",{"_index":1014,"title":{},"body":{"changelog.html":{}}}],["filter(d",{"_index":436,"title":{},"body":{"interfaces/Collision.html":{}}}],["filters",{"_index":679,"title":{},"body":{"changelog.html":{}}}],["final",{"_index":1055,"title":{},"body":{"changelog.html":{}}}],["finalize",{"_index":329,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["finishing",{"_index":816,"title":{},"body":{"changelog.html":{}}}],["first",{"_index":1067,"title":{},"body":{"changelog.html":{}}}],["firstfieldname",{"_index":1399,"title":{},"body":{"miscellaneous/functions.html":{}}}],["fit",{"_index":969,"title":{},"body":{"changelog.html":{}}}],["fitness",{"_index":1498,"title":{},"body":{"license.html":{}}}],["fixed",{"_index":951,"title":{},"body":{"changelog.html":{}}}],["fixes",{"_index":705,"title":{},"body":{"changelog.html":{}}}],["fixes.ts",{"_index":1230,"title":{},"body":{"coverage.html":{},"miscellaneous/functions.html":{}}}],["fixes/performance",{"_index":1125,"title":{},"body":{"changelog.html":{}}}],["flexible",{"_index":694,"title":{},"body":{"changelog.html":{}}}],["flipy",{"_index":280,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["fly",{"_index":1216,"title":{},"body":{"changelog.html":{}}}],["following",{"_index":1487,"title":{},"body":{"license.html":{}}}],["form",{"_index":1003,"title":{},"body":{"changelog.html":{}}}],["format",{"_index":1085,"title":{},"body":{"changelog.html":{}}}],["frame",{"_index":976,"title":{},"body":{"changelog.html":{}}}],["framework",{"_index":615,"title":{},"body":{"changelog.html":{},"index.html":{}}}],["free",{"_index":1466,"title":{},"body":{"license.html":{}}}],["fs",{"_index":1331,"title":{},"body":{"dependencies.html":{}}}],["full",{"_index":908,"title":{},"body":{"changelog.html":{}}}],["fullscreen",{"_index":1158,"title":{},"body":{"changelog.html":{}}}],["fully",{"_index":962,"title":{},"body":{"changelog.html":{}}}],["function",{"_index":72,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/Collision.html":{},"interfaces/ProcessedNode.html":{},"coverage.html":{},"miscellaneous/typealiases.html":{}}}],["functions",{"_index":1382,"title":{"miscellaneous/functions.html":{}},"body":{"miscellaneous/functions.html":{}}}],["funded",{"_index":1454,"title":{},"body":{"index.html":{}}}],["furnished",{"_index":1486,"title":{},"body":{"license.html":{}}}],["further",{"_index":1154,"title":{},"body":{"changelog.html":{}}}],["future",{"_index":952,"title":{},"body":{"changelog.html":{}}}],["generate",{"_index":729,"title":{},"body":{"changelog.html":{}}}],["generated",{"_index":761,"title":{},"body":{"changelog.html":{}}}],["generating",{"_index":667,"title":{},"body":{"changelog.html":{}}}],["geometries",{"_index":137,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["geometries.scenegraph",{"_index":148,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["geometries.scenegraph.push(node",{"_index":143,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["geometries[geometry",{"_index":144,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["geometries[geometry].push(node",{"_index":145,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["geometry",{"_index":55,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/ProcessedNode.html":{},"interfaces/SpatialSceneNode.html":{}}}],["getcolor",{"_index":116,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["getcursor",{"_index":298,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["getpickinginfo",{"_index":20,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["getpickinginfo(e",{"_index":32,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["getposition",{"_index":125,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["gettext",{"_index":123,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["getting",{"_index":611,"title":{"changelog.html":{},"index.html":{},"license.html":{}},"body":{}}],["gettransformmatrix",{"_index":112,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["github",{"_index":1044,"title":{},"body":{"changelog.html":{}}}],["gizmo",{"_index":883,"title":{},"body":{"changelog.html":{}}}],["globalconfig",{"_index":854,"title":{},"body":{"changelog.html":{}}}],["gltf",{"_index":68,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/Collision.html":{},"interfaces/ProcessedNode.html":{},"miscellaneous/functions.html":{}}}],["gltf.scenes",{"_index":462,"title":{},"body":{"interfaces/Collision.html":{},"interfaces/ProcessedNode.html":{}}}],["gltf.ts",{"_index":1243,"title":{},"body":{"coverage.html":{},"miscellaneous/functions.html":{}}}],["gltf:${processednode['@id",{"_index":525,"title":{},"body":{"interfaces/ProcessedNode.html":{}}}],["gltfcache",{"_index":17,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["gltfloader",{"_index":424,"title":{},"body":{"interfaces/Collision.html":{}}}],["gltfnode",{"_index":526,"title":{},"body":{"interfaces/ProcessedNode.html":{}}}],["gltfnodes",{"_index":518,"title":{},"body":{"interfaces/ProcessedNode.html":{}}}],["gltfnodes.push",{"_index":524,"title":{},"body":{"interfaces/ProcessedNode.html":{}}}],["gltfoverride",{"_index":1409,"title":{},"body":{"miscellaneous/functions.html":{}}}],["gltfpromise",{"_index":1397,"title":{},"body":{"miscellaneous/functions.html":{}}}],["gltfscene",{"_index":461,"title":{},"body":{"interfaces/Collision.html":{}}}],["gltftransform",{"_index":349,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["gltfurl",{"_index":341,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{},"interfaces/ProcessedNode.html":{},"miscellaneous/functions.html":{}}}],["good",{"_index":1097,"title":{},"body":{"changelog.html":{}}}],["google",{"_index":894,"title":{},"body":{"changelog.html":{},"dependencies.html":{}}}],["grab",{"_index":303,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["grabbing",{"_index":302,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["granted",{"_index":1465,"title":{},"body":{"license.html":{}}}],["graphical",{"_index":715,"title":{},"body":{"changelog.html":{}}}],["graphology",{"_index":1334,"title":{},"body":{"dependencies.html":{}}}],["greatly",{"_index":832,"title":{},"body":{"changelog.html":{}}}],["gtex",{"_index":730,"title":{},"body":{"changelog.html":{}}}],["guide",{"_index":1088,"title":{},"body":{"changelog.html":{}}}],["h",{"_index":497,"title":{},"body":{"interfaces/Collision.html":{}}}],["h.name",{"_index":500,"title":{},"body":{"interfaces/Collision.html":{}}}],["h['@id",{"_index":499,"title":{},"body":{"interfaces/Collision.html":{}}}],["halfsize",{"_index":547,"title":{},"body":{"interfaces/ProcessedNode.html":{}}}],["hand",{"_index":1093,"title":{},"body":{"changelog.html":{}}}],["happen",{"_index":1132,"title":{},"body":{"changelog.html":{}}}],["happens",{"_index":1063,"title":{},"body":{"changelog.html":{}}}],["helmet",{"_index":1339,"title":{},"body":{"dependencies.html":{}}}],["help",{"_index":1087,"title":{},"body":{"changelog.html":{}}}],["here",{"_index":1091,"title":{},"body":{"changelog.html":{}}}],["hereby",{"_index":1464,"title":{},"body":{"license.html":{}}}],["hex",{"_index":1341,"title":{},"body":{"dependencies.html":{}}}],["hidden",{"_index":1181,"title":{},"body":{"changelog.html":{}}}],["highlight",{"_index":800,"title":{},"body":{"changelog.html":{}}}],["highlightcolor",{"_index":97,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["highlighted",{"_index":676,"title":{},"body":{"changelog.html":{}}}],["highlights",{"_index":803,"title":{},"body":{"changelog.html":{}}}],["hit",{"_index":492,"title":{},"body":{"interfaces/Collision.html":{}}}],["hit.hits",{"_index":498,"title":{},"body":{"interfaces/Collision.html":{}}}],["hit.name",{"_index":496,"title":{},"body":{"interfaces/Collision.html":{}}}],["hit['@id",{"_index":495,"title":{},"body":{"interfaces/Collision.html":{}}}],["hits",{"_index":419,"title":{},"body":{"interfaces/Collision.html":{}}}],["hits.length",{"_index":482,"title":{},"body":{"interfaces/Collision.html":{}}}],["hits.push({'@id",{"_index":479,"title":{},"body":{"interfaces/Collision.html":{}}}],["holders",{"_index":1504,"title":{},"body":{"license.html":{}}}],["hooked",{"_index":1012,"title":{},"body":{"changelog.html":{}}}],["host",{"_index":691,"title":{},"body":{"changelog.html":{}}}],["hovering",{"_index":899,"title":{},"body":{"changelog.html":{}}}],["hra",{"_index":627,"title":{},"body":{"changelog.html":{}}}],["htmlcanvaselement",{"_index":211,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["htmlelement",{"_index":212,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["http://localhost:8080/source_data/asct",{"_index":1526,"title":{},"body":{"miscellaneous/variables.html":{}}}],["http://localhost:8080/source_data/extraction",{"_index":1530,"title":{},"body":{"miscellaneous/variables.html":{}}}],["http://localhost:8080/source_data/reference",{"_index":1536,"title":{},"body":{"miscellaneous/variables.html":{}}}],["https://beta",{"_index":1423,"title":{},"body":{"index.html":{}}}],["https://ccf",{"_index":1434,"title":{},"body":{"index.html":{}}}],["https://hubmap",{"_index":1427,"title":{},"body":{"index.html":{}}}],["https://hubmapconsortium.github.io/ccf",{"_index":342,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{},"index.html":{}}}],["https://hubmapconsortium.github.io/hubmap",{"_index":347,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["https://old",{"_index":1429,"title":{},"body":{"index.html":{}}}],["https://portal.hubmapconsortium.org/ccf",{"_index":1425,"title":{},"body":{"index.html":{}}}],["https://r5i95k35v5.us",{"_index":1436,"title":{},"body":{"index.html":{}}}],["https://sampledata.hubmapconsortium.org",{"_index":1210,"title":{},"body":{"changelog.html":{}}}],["hubmap",{"_index":652,"title":{},"body":{"changelog.html":{},"index.html":{},"license.html":{}}}],["human",{"_index":625,"title":{},"body":{"changelog.html":{}}}],["icon",{"_index":1192,"title":{},"body":{"changelog.html":{}}}],["icons",{"_index":909,"title":{},"body":{"changelog.html":{}}}],["id",{"_index":92,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/Collision.html":{},"interfaces/PickInfo.html":{},"interfaces/ProcessedNode.html":{},"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{},"interfaces/SpatialSceneNode.html":{},"changelog.html":{},"miscellaneous/functions.html":{}}}],["idb",{"_index":1344,"title":{},"body":{"dependencies.html":{}}}],["identifier",{"_index":1227,"title":{},"body":{"coverage.html":{}}}],["iec",{"_index":1058,"title":{},"body":{"changelog.html":{}}}],["image",{"_index":1052,"title":{},"body":{"changelog.html":{}}}],["images",{"_index":1111,"title":{},"body":{"changelog.html":{}}}],["implementation",{"_index":788,"title":{},"body":{"changelog.html":{}}}],["implemented",{"_index":1010,"title":{},"body":{"changelog.html":{}}}],["implementing",{"_index":1162,"title":{},"body":{"changelog.html":{}}}],["implied",{"_index":1495,"title":{},"body":{"license.html":{}}}],["import",{"_index":43,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/Collision.html":{},"interfaces/PickInfo.html":{},"interfaces/ProcessedNode.html":{},"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{},"interfaces/SpatialSceneNode.html":{}}}],["improve",{"_index":1001,"title":{},"body":{"changelog.html":{}}}],["improved",{"_index":752,"title":{},"body":{"changelog.html":{}}}],["improvements",{"_index":711,"title":{},"body":{"changelog.html":{}}}],["improves",{"_index":833,"title":{},"body":{"changelog.html":{}}}],["include",{"_index":1069,"title":{},"body":{"changelog.html":{}}}],["included",{"_index":1490,"title":{},"body":{"license.html":{}}}],["includes",{"_index":663,"title":{},"body":{"changelog.html":{}}}],["including",{"_index":796,"title":{},"body":{"changelog.html":{},"license.html":{}}}],["increase",{"_index":1037,"title":{},"body":{"changelog.html":{}}}],["increased",{"_index":1156,"title":{},"body":{"changelog.html":{}}}],["index",{"_index":13,"title":{"index.html":{}},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/Collision.html":{},"interfaces/PickInfo.html":{},"interfaces/ProcessedNode.html":{},"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{},"interfaces/SpatialSceneNode.html":{},"miscellaneous/functions.html":{},"miscellaneous/typealiases.html":{},"miscellaneous/variables.html":{}}}],["indexes",{"_index":624,"title":{},"body":{"changelog.html":{}}}],["indiana",{"_index":1452,"title":{},"body":{"index.html":{}}}],["individual",{"_index":1017,"title":{},"body":{"changelog.html":{}}}],["info",{"_index":3,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/Collision.html":{},"interfaces/PickInfo.html":{},"interfaces/ProcessedNode.html":{},"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{},"interfaces/SpatialSceneNode.html":{},"changelog.html":{},"index.html":{}}}],["info.object",{"_index":388,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["info.object['@id",{"_index":389,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["info.picked",{"_index":387,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["info?.object?.['@id",{"_index":414,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["information",{"_index":701,"title":{},"body":{"changelog.html":{},"index.html":{}}}],["infrastructure",{"_index":1114,"title":{},"body":{"changelog.html":{}}}],["ingestion",{"_index":1071,"title":{},"body":{"changelog.html":{}}}],["initial",{"_index":931,"title":{},"body":{"changelog.html":{}}}],["initialize",{"_index":322,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["initializestate",{"_index":21,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["instead",{"_index":922,"title":{},"body":{"changelog.html":{}}}],["instructions",{"_index":845,"title":{},"body":{"changelog.html":{}}}],["integrated",{"_index":963,"title":{},"body":{"changelog.html":{}}}],["integrating",{"_index":793,"title":{},"body":{"changelog.html":{}}}],["integration",{"_index":1070,"title":{},"body":{"changelog.html":{}}}],["integrations",{"_index":983,"title":{},"body":{"changelog.html":{}}}],["intensity",{"_index":306,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["interact",{"_index":946,"title":{},"body":{"changelog.html":{}}}],["interactions",{"_index":1136,"title":{},"body":{"changelog.html":{}}}],["interactionstate",{"_index":393,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["interactive",{"_index":203,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["interest",{"_index":1207,"title":{},"body":{"changelog.html":{}}}],["interface",{"_index":196,"title":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/Collision.html":{},"interfaces/PickInfo.html":{},"interfaces/ProcessedNode.html":{},"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{},"interfaces/SpatialSceneNode.html":{}},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/Collision.html":{},"interfaces/PickInfo.html":{},"interfaces/ProcessedNode.html":{},"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{},"interfaces/SpatialSceneNode.html":{},"changelog.html":{},"coverage.html":{},"index.html":{}}}],["interfaces",{"_index":198,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/Collision.html":{},"interfaces/PickInfo.html":{},"interfaces/ProcessedNode.html":{},"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{},"interfaces/SpatialSceneNode.html":{},"changelog.html":{},"index.html":{},"overview.html":{}}}],["internal",{"_index":1051,"title":{},"body":{"changelog.html":{}}}],["isdragging",{"_index":299,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["issue",{"_index":1033,"title":{},"body":{"changelog.html":{}}}],["issues",{"_index":670,"title":{},"body":{"changelog.html":{}}}],["iszooming",{"_index":394,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["it's",{"_index":791,"title":{},"body":{"changelog.html":{}}}],["item",{"_index":1189,"title":{},"body":{"changelog.html":{}}}],["iu",{"_index":1178,"title":{},"body":{"changelog.html":{}}}],["javascript",{"_index":746,"title":{},"body":{"changelog.html":{},"index.html":{}}}],["json",{"_index":1083,"title":{},"body":{"changelog.html":{}}}],["jsonld",{"_index":507,"title":{},"body":{"interfaces/ProcessedNode.html":{},"dependencies.html":{}}}],["jsonld.ts",{"_index":559,"title":{},"body":{"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{},"coverage.html":{}}}],["jsonld/jsonld",{"_index":589,"title":{},"body":{"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{}}}],["jsonldobj",{"_index":560,"title":{},"body":{"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{}}}],["july",{"_index":1135,"title":{},"body":{"changelog.html":{}}}],["jump",{"_index":1187,"title":{},"body":{"changelog.html":{}}}],["key",{"_index":76,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["keyboard",{"_index":1185,"title":{},"body":{"changelog.html":{}}}],["keyval",{"_index":1345,"title":{},"body":{"dependencies.html":{}}}],["kidney",{"_index":829,"title":{},"body":{"changelog.html":{}}}],["kind",{"_index":1494,"title":{},"body":{"license.html":{}}}],["known",{"_index":669,"title":{},"body":{"changelog.html":{}}}],["kpmp",{"_index":649,"title":{},"body":{"changelog.html":{}}}],["l",{"_index":189,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["label",{"_index":570,"title":{},"body":{"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{}}}],["labs/data",{"_index":1296,"title":{},"body":{"dependencies.html":{}}}],["labs/dispatch",{"_index":1298,"title":{},"body":{"dependencies.html":{}}}],["landmarks",{"_index":689,"title":{},"body":{"changelog.html":{}}}],["larger",{"_index":740,"title":{},"body":{"changelog.html":{}}}],["lasthovered",{"_index":272,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["latest",{"_index":683,"title":{},"body":{"changelog.html":{},"index.html":{}}}],["layer",{"_index":227,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["layer.ts",{"_index":10,"title":{},"body":{"classes/BodyUILayer.html":{},"coverage.html":{},"miscellaneous/functions.html":{}}}],["layer.ts:143",{"_index":33,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["layer.ts:71",{"_index":31,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["layer.ts:72",{"_index":29,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["layer.ts:74",{"_index":40,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["layer.ts:80",{"_index":42,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["layername",{"_index":18,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["layers",{"_index":51,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{},"dependencies.html":{}}}],["layers.filter(l",{"_index":188,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["layers.push",{"_index":157,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["layers.push(meshlayer(`${geometry}pickable",{"_index":185,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["layers.push(meshlayer(geometry",{"_index":184,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["layers.push(textlayer('text",{"_index":180,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["layers.push(textlayer('textpickable",{"_index":183,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["lb",{"_index":541,"title":{},"body":{"interfaces/ProcessedNode.html":{}}}],["lb.clone().vadd(halfsize",{"_index":551,"title":{},"body":{"interfaces/ProcessedNode.html":{}}}],["ld",{"_index":1084,"title":{},"body":{"changelog.html":{}}}],["leak",{"_index":1032,"title":{},"body":{"changelog.html":{}}}],["leave",{"_index":814,"title":{},"body":{"changelog.html":{}}}],["left",{"_index":587,"title":{},"body":{"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{},"changelog.html":{}}}],["left/right",{"_index":830,"title":{},"body":{"changelog.html":{}}}],["legacylighting",{"_index":204,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["level",{"_index":1183,"title":{},"body":{"changelog.html":{}}}],["levels",{"_index":1204,"title":{},"body":{"changelog.html":{}}}],["liability",{"_index":1508,"title":{},"body":{"license.html":{}}}],["liable",{"_index":1505,"title":{},"body":{"license.html":{}}}],["libraries",{"_index":743,"title":{},"body":{"changelog.html":{},"index.html":{}}}],["library",{"_index":993,"title":{},"body":{"changelog.html":{}}}],["library/vh_female/united/vhf_united_color.glb",{"_index":346,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["library/vh_male/united/vhm_united_color.glb",{"_index":345,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["license",{"_index":1458,"title":{"license.html":{}},"body":{"license.html":{}}}],["life",{"_index":808,"title":{},"body":{"changelog.html":{}}}],["lightingeffect",{"_index":215,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["limitation",{"_index":1474,"title":{},"body":{"license.html":{}}}],["limited",{"_index":1119,"title":{},"body":{"changelog.html":{},"license.html":{}}}],["line",{"_index":107,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["link",{"_index":823,"title":{},"body":{"changelog.html":{}}}],["linkage",{"_index":1137,"title":{},"body":{"changelog.html":{}}}],["linked",{"_index":696,"title":{},"body":{"changelog.html":{}}}],["links",{"_index":775,"title":{},"body":{"changelog.html":{},"index.html":{}}}],["list",{"_index":939,"title":{},"body":{"changelog.html":{}}}],["literal",{"_index":25,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/Collision.html":{},"dependencies.html":{},"miscellaneous/typealiases.html":{}}}],["little",{"_index":944,"title":{},"body":{"changelog.html":{}}}],["load",{"_index":420,"title":{},"body":{"interfaces/Collision.html":{},"interfaces/ProcessedNode.html":{},"changelog.html":{}}}],["load(model.scenegraph",{"_index":458,"title":{},"body":{"interfaces/Collision.html":{}}}],["loaded",{"_index":1139,"title":{},"body":{"changelog.html":{}}}],["loaders.gl/core",{"_index":421,"title":{},"body":{"interfaces/Collision.html":{},"dependencies.html":{}}}],["loaders.gl/draco",{"_index":423,"title":{},"body":{"interfaces/Collision.html":{},"dependencies.html":{}}}],["loaders.gl/gltf",{"_index":425,"title":{},"body":{"interfaces/Collision.html":{},"dependencies.html":{}}}],["loadgltf",{"_index":64,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/ProcessedNode.html":{},"coverage.html":{},"miscellaneous/functions.html":{}}}],["loadgltf(model",{"_index":1395,"title":{},"body":{"miscellaneous/functions.html":{}}}],["loadgltf({scenegraph",{"_index":517,"title":{},"body":{"interfaces/ProcessedNode.html":{}}}],["loadgltf2",{"_index":65,"title":{},"body":{"classes/BodyUILayer.html":{},"coverage.html":{},"miscellaneous/functions.html":{}}}],["loadgltf2(model.scenegraphnode",{"_index":167,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["loadgltf2(scenegraphnodename",{"_index":1396,"title":{},"body":{"miscellaneous/functions.html":{}}}],["loading",{"_index":657,"title":{},"body":{"changelog.html":{}}}],["location",{"_index":1038,"title":{},"body":{"changelog.html":{}}}],["locations",{"_index":651,"title":{},"body":{"changelog.html":{}}}],["lodash",{"_index":1348,"title":{},"body":{"dependencies.html":{}}}],["log",{"_index":1446,"title":{},"body":{"index.html":{}}}],["logging",{"_index":732,"title":{},"body":{"changelog.html":{}}}],["longer",{"_index":919,"title":{},"body":{"changelog.html":{}}}],["look",{"_index":999,"title":{},"body":{"changelog.html":{}}}],["loop",{"_index":325,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["lowerbound",{"_index":442,"title":{},"body":{"interfaces/Collision.html":{},"interfaces/ProcessedNode.html":{}}}],["lowerbound[i",{"_index":455,"title":{},"body":{"interfaces/Collision.html":{},"interfaces/ProcessedNode.html":{}}}],["lru",{"_index":1350,"title":{},"body":{"dependencies.html":{}}}],["luma.gl/core",{"_index":57,"title":{},"body":{"classes/BodyUILayer.html":{},"dependencies.html":{}}}],["m",{"_index":147,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["m.scenegraph",{"_index":149,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["m.scenegraphnode",{"_index":150,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["made",{"_index":1060,"title":{},"body":{"changelog.html":{}}}],["major",{"_index":661,"title":{},"body":{"changelog.html":{}}}],["makes",{"_index":736,"title":{},"body":{"changelog.html":{}}}],["making",{"_index":785,"title":{},"body":{"changelog.html":{}}}],["male",{"_index":585,"title":{},"body":{"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{}}}],["managers",{"_index":750,"title":{},"body":{"changelog.html":{}}}],["map(model",{"_index":439,"title":{},"body":{"interfaces/Collision.html":{}}}],["mapping.csv",{"_index":1534,"title":{},"body":{"miscellaneous/variables.html":{}}}],["march",{"_index":996,"title":{},"body":{"changelog.html":{}}}],["markdown",{"_index":1358,"title":{},"body":{"dependencies.html":{}}}],["mat",{"_index":440,"title":{},"body":{"interfaces/Collision.html":{}}}],["mat.transformaspoint",{"_index":443,"title":{},"body":{"interfaces/Collision.html":{}}}],["mat.transformaspoint([1",{"_index":445,"title":{},"body":{"interfaces/Collision.html":{}}}],["match",{"_index":998,"title":{},"body":{"changelog.html":{}}}],["matching",{"_index":194,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/Collision.html":{},"interfaces/PickInfo.html":{},"interfaces/ProcessedNode.html":{},"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{},"interfaces/SpatialSceneNode.html":{},"changelog.html":{},"coverage.html":{},"dependencies.html":{},"miscellaneous/functions.html":{},"index.html":{},"license.html":{},"modules.html":{},"overview.html":{},"miscellaneous/typealiases.html":{},"miscellaneous/variables.html":{}}}],["math.gl/core",{"_index":59,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/Collision.html":{},"interfaces/PickInfo.html":{},"interfaces/ProcessedNode.html":{},"interfaces/SpatialSceneNode.html":{},"dependencies.html":{}}}],["math.gl/culling",{"_index":1293,"title":{},"body":{"dependencies.html":{}}}],["math.max(...report.map(r",{"_index":489,"title":{},"body":{"interfaces/Collision.html":{}}}],["math.max(n",{"_index":454,"title":{},"body":{"interfaces/Collision.html":{},"interfaces/ProcessedNode.html":{}}}],["math.min(math.max(1",{"_index":397,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["math.min(n",{"_index":451,"title":{},"body":{"interfaces/Collision.html":{},"interfaces/ProcessedNode.html":{}}}],["matrix",{"_index":366,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["matrix.gettranslation",{"_index":369,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["matrix4",{"_index":58,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/Collision.html":{},"interfaces/PickInfo.html":{},"interfaces/ProcessedNode.html":{},"interfaces/SpatialSceneNode.html":{}}}],["matrix4([0.076,0,0,0,0,0.076,1.6875389974302382e",{"_index":350,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["matrix4(d.transformmatrix).gettranslation",{"_index":122,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["matrix4(matrix4.identity",{"_index":553,"title":{},"body":{"interfaces/ProcessedNode.html":{}}}],["matrix4(model.transformmatrix",{"_index":441,"title":{},"body":{"interfaces/Collision.html":{}}}],["matrix4(modelmatrix",{"_index":523,"title":{},"body":{"interfaces/ProcessedNode.html":{}}}],["matrix4(node.transformmatrix",{"_index":367,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["matrix4(worldmatrix",{"_index":519,"title":{},"body":{"interfaces/ProcessedNode.html":{}}}],["matrix4.identity",{"_index":520,"title":{},"body":{"interfaces/ProcessedNode.html":{}}}],["maxhits",{"_index":488,"title":{},"body":{"interfaces/Collision.html":{}}}],["maxrotationx",{"_index":205,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["mc",{"_index":1177,"title":{},"body":{"changelog.html":{}}}],["memory",{"_index":1031,"title":{},"body":{"changelog.html":{}}}],["menu",{"_index":1094,"title":{},"body":{"changelog.html":{}}}],["merchantability",{"_index":1497,"title":{},"body":{"license.html":{}}}],["merge",{"_index":1477,"title":{},"body":{"license.html":{}}}],["mesh",{"_index":82,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["meshlayer",{"_index":1234,"title":{},"body":{"coverage.html":{},"miscellaneous/functions.html":{}}}],["meshlayer(id",{"_index":73,"title":{},"body":{"classes/BodyUILayer.html":{},"miscellaneous/functions.html":{}}}],["metadata",{"_index":1148,"title":{},"body":{"changelog.html":{}}}],["methods",{"_index":19,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["minor",{"_index":671,"title":{},"body":{"changelog.html":{}}}],["minrotationx",{"_index":206,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["miscellaneous",{"_index":1381,"title":{"miscellaneous/functions.html":{},"miscellaneous/typealiases.html":{},"miscellaneous/variables.html":{}},"body":{"miscellaneous/functions.html":{},"miscellaneous/typealiases.html":{},"miscellaneous/variables.html":{}}}],["mit",{"_index":1459,"title":{},"body":{"license.html":{}}}],["mock",{"_index":1173,"title":{},"body":{"changelog.html":{}}}],["modal",{"_index":929,"title":{},"body":{"changelog.html":{}}}],["mode",{"_index":859,"title":{},"body":{"changelog.html":{}}}],["model",{"_index":156,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/Collision.html":{},"dependencies.html":{},"miscellaneous/functions.html":{}}}],["model._lighting",{"_index":173,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["model.color",{"_index":176,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["model.entityid",{"_index":448,"title":{},"body":{"interfaces/Collision.html":{}}}],["model.opacity",{"_index":163,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["model.scenegraph",{"_index":169,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["model.scenegraphnode",{"_index":166,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["model.tooltip",{"_index":446,"title":{},"body":{"interfaces/Collision.html":{}}}],["model.transformmatrix",{"_index":175,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["model.unpickable",{"_index":165,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["model.zoombasedopacity",{"_index":161,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["model['@id",{"_index":159,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/Collision.html":{}}}],["modelmatrix",{"_index":464,"title":{},"body":{"interfaces/Collision.html":{},"interfaces/ProcessedNode.html":{}}}],["modelmatrix.transformaspoint(primitive.attributes.position.max",{"_index":472,"title":{},"body":{"interfaces/Collision.html":{},"interfaces/ProcessedNode.html":{}}}],["modelmatrix.transformaspoint(primitive.attributes.position.min",{"_index":471,"title":{},"body":{"interfaces/Collision.html":{},"interfaces/ProcessedNode.html":{}}}],["models",{"_index":158,"title":{},"body":{"classes/BodyUILayer.html":{},"miscellaneous/variables.html":{}}}],["modify",{"_index":1476,"title":{},"body":{"license.html":{}}}],["modules",{"_index":1518,"title":{"modules.html":{}},"body":{"modules.html":{}}}],["monorepo",{"_index":1413,"title":{},"body":{"index.html":{}}}],["more",{"_index":700,"title":{},"body":{"changelog.html":{},"index.html":{}}}],["mouseevent",{"_index":241,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["moved",{"_index":1194,"title":{},"body":{"changelog.html":{}}}],["much",{"_index":738,"title":{},"body":{"changelog.html":{}}}],["multiple",{"_index":1414,"title":{},"body":{"index.html":{}}}],["n.bbox",{"_index":532,"title":{},"body":{"interfaces/ProcessedNode.html":{}}}],["n.unpickable",{"_index":182,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["n3",{"_index":1351,"title":{},"body":{"dependencies.html":{}}}],["name",{"_index":35,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/Collision.html":{},"interfaces/SpatialSceneNode.html":{},"miscellaneous/functions.html":{}}}],["names",{"_index":510,"title":{},"body":{"interfaces/ProcessedNode.html":{},"changelog.html":{},"miscellaneous/functions.html":{}}}],["names.push(child.name",{"_index":514,"title":{},"body":{"interfaces/ProcessedNode.html":{}}}],["navigation",{"_index":1186,"title":{},"body":{"changelog.html":{}}}],["near",{"_index":281,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["need",{"_index":641,"title":{},"body":{"changelog.html":{}}}],["needed",{"_index":1004,"title":{},"body":{"changelog.html":{}}}],["needs",{"_index":1011,"title":{},"body":{"changelog.html":{}}}],["network",{"_index":1450,"title":{},"body":{"index.html":{}}}],["new",{"_index":87,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/Collision.html":{},"interfaces/PickInfo.html":{},"interfaces/ProcessedNode.html":{},"changelog.html":{},"coverage.html":{}}}],["next",{"_index":106,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{},"changelog.html":{}}}],["ng5",{"_index":1353,"title":{},"body":{"dependencies.html":{}}}],["ngx",{"_index":1356,"title":{},"body":{"dependencies.html":{}}}],["ngxs",{"_index":1295,"title":{},"body":{"dependencies.html":{}}}],["ngxs/logger",{"_index":1300,"title":{},"body":{"dependencies.html":{}}}],["ngxs/storage",{"_index":1303,"title":{},"body":{"dependencies.html":{}}}],["ngxs/store",{"_index":1304,"title":{},"body":{"dependencies.html":{}}}],["nih",{"_index":1455,"title":{},"body":{"index.html":{}}}],["node",{"_index":63,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/Collision.html":{},"interfaces/PickInfo.html":{},"interfaces/ProcessedNode.html":{},"dependencies.html":{}}}],["node.bbox",{"_index":535,"title":{},"body":{"interfaces/ProcessedNode.html":{}}}],["node.bbox.extend(child.bbox",{"_index":537,"title":{},"body":{"interfaces/ProcessedNode.html":{}}}],["node.bbox.lowerbound",{"_index":542,"title":{},"body":{"interfaces/ProcessedNode.html":{}}}],["node.bbox.upperbound",{"_index":544,"title":{},"body":{"interfaces/ProcessedNode.html":{}}}],["node.center",{"_index":550,"title":{},"body":{"interfaces/ProcessedNode.html":{}}}],["node.geometry",{"_index":141,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["node.id",{"_index":522,"title":{},"body":{"interfaces/ProcessedNode.html":{}}}],["node.mesh",{"_index":465,"title":{},"body":{"interfaces/Collision.html":{},"interfaces/ProcessedNode.html":{}}}],["node.mesh.primitives",{"_index":466,"title":{},"body":{"interfaces/Collision.html":{},"interfaces/ProcessedNode.html":{}}}],["node.mesh.primitives.length",{"_index":467,"title":{},"body":{"interfaces/Collision.html":{},"interfaces/ProcessedNode.html":{}}}],["node.name",{"_index":474,"title":{},"body":{"interfaces/Collision.html":{},"interfaces/ProcessedNode.html":{}}}],["node.scenegraph",{"_index":142,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["node.size",{"_index":545,"title":{},"body":{"interfaces/ProcessedNode.html":{}}}],["node.transformmatrix",{"_index":552,"title":{},"body":{"interfaces/ProcessedNode.html":{}}}],["node.ts",{"_index":606,"title":{},"body":{"interfaces/SpatialSceneNode.html":{},"coverage.html":{},"miscellaneous/typealiases.html":{}}}],["node.zoomtoonload",{"_index":334,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["nodeclick",{"_index":257,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["nodeclickevent",{"_index":242,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{},"miscellaneous/typealiases.html":{}}}],["nodeclicksubject",{"_index":249,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["nodedrag",{"_index":267,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["nodedragend",{"_index":269,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["nodedragendsubject",{"_index":256,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["nodedragevent",{"_index":240,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{},"miscellaneous/typealiases.html":{}}}],["nodedragstart",{"_index":265,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["nodedragstartsubject",{"_index":254,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["nodedragsubject",{"_index":255,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["nodehoverstart",{"_index":259,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["nodehoverstartsubject",{"_index":250,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["nodehoverstop",{"_index":261,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["nodehoverstopsubject",{"_index":251,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["nodes",{"_index":154,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{},"interfaces/ProcessedNode.html":{},"miscellaneous/functions.html":{}}}],["nodes.filter(n",{"_index":181,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["nodes.ts",{"_index":505,"title":{},"body":{"interfaces/ProcessedNode.html":{},"coverage.html":{},"miscellaneous/functions.html":{}}}],["nodes[n]).filter(n",{"_index":534,"title":{},"body":{"interfaces/ProcessedNode.html":{}}}],["nodes[node['@id",{"_index":539,"title":{},"body":{"interfaces/ProcessedNode.html":{}}}],["nodes[processednode['@id",{"_index":530,"title":{},"body":{"interfaces/ProcessedNode.html":{}}}],["noninfringement",{"_index":1501,"title":{},"body":{"license.html":{}}}],["note",{"_index":634,"title":{},"body":{"changelog.html":{}}}],["notice",{"_index":1034,"title":{},"body":{"changelog.html":{},"license.html":{}}}],["now",{"_index":741,"title":{},"body":{"changelog.html":{}}}],["number",{"_index":115,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{},"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{},"interfaces/SpatialSceneNode.html":{},"changelog.html":{}}}],["numeric",{"_index":1039,"title":{},"body":{"changelog.html":{}}}],["object",{"_index":235,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{},"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{},"miscellaneous/variables.html":{}}}],["object.entries(geometries",{"_index":155,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["object.prototype.hasownproperty.call(url2gltf",{"_index":151,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["object.values(nodes",{"_index":540,"title":{},"body":{"interfaces/ProcessedNode.html":{}}}],["object.values(nodes).filter(n",{"_index":531,"title":{},"body":{"interfaces/ProcessedNode.html":{}}}],["object.values(results",{"_index":358,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["obtaining",{"_index":1469,"title":{},"body":{"license.html":{}}}],["off/on",{"_index":1008,"title":{},"body":{"changelog.html":{}}}],["official",{"_index":1134,"title":{},"body":{"changelog.html":{}}}],["old",{"_index":1428,"title":{},"body":{"index.html":{}}}],["onclick",{"_index":288,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["ondrag",{"_index":294,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["ondragend",{"_index":296,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["ondragstart",{"_index":292,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["one",{"_index":1077,"title":{},"body":{"changelog.html":{},"index.html":{}}}],["onhover",{"_index":286,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["online",{"_index":1144,"title":{},"body":{"changelog.html":{}}}],["ontological",{"_index":1215,"title":{},"body":{"changelog.html":{}}}],["ontologies",{"_index":1086,"title":{},"body":{"changelog.html":{}}}],["ontology",{"_index":637,"title":{},"body":{"changelog.html":{}}}],["ontology/objects/vhf_united_v01_060420.glb",{"_index":348,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["onviewstatechange",{"_index":290,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["opacities",{"_index":1016,"title":{},"body":{"changelog.html":{}}}],["opacity",{"_index":160,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/SpatialSceneNode.html":{},"changelog.html":{}}}],["openapi",{"_index":787,"title":{},"body":{"changelog.html":{},"index.html":{}}}],["openapi/js",{"_index":1442,"title":{},"body":{"index.html":{}}}],["openapi/ng",{"_index":1444,"title":{},"body":{"index.html":{}}}],["openapi/ts",{"_index":1443,"title":{},"body":{"index.html":{}}}],["optimization",{"_index":943,"title":{},"body":{"changelog.html":{}}}],["optimizations",{"_index":1126,"title":{},"body":{"changelog.html":{}}}],["optimized",{"_index":981,"title":{},"body":{"changelog.html":{}}}],["option",{"_index":799,"title":{},"body":{"changelog.html":{}}}],["optional",{"_index":36,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{},"interfaces/SpatialPlacementJsonLd.html":{},"interfaces/SpatialSceneNode.html":{},"changelog.html":{},"miscellaneous/functions.html":{}}}],["options",{"_index":75,"title":{},"body":{"classes/BodyUILayer.html":{},"changelog.html":{},"miscellaneous/functions.html":{}}}],["options.geometry",{"_index":84,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["orbitaxis",{"_index":231,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["orbitview",{"_index":216,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["organ",{"_index":656,"title":{},"body":{"changelog.html":{},"index.html":{},"miscellaneous/variables.html":{}}}],["organs",{"_index":690,"title":{},"body":{"changelog.html":{}}}],["organs/anatomical",{"_index":1018,"title":{},"body":{"changelog.html":{}}}],["orthographic",{"_index":279,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{},"changelog.html":{}}}],["orthographicview",{"_index":217,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["ot2od026671",{"_index":1457,"title":{},"body":{"index.html":{}}}],["otherwise",{"_index":1513,"title":{},"body":{"license.html":{}}}],["out",{"_index":1515,"title":{},"body":{"license.html":{}}}],["over",{"_index":1046,"title":{},"body":{"changelog.html":{}}}],["overall",{"_index":678,"title":{},"body":{"changelog.html":{}}}],["overlays",{"_index":1205,"title":{},"body":{"changelog.html":{}}}],["overview",{"_index":1519,"title":{"overview.html":{}},"body":{"overview.html":{}}}],["p",{"_index":1168,"title":{},"body":{"changelog.html":{}}}],["package",{"_index":749,"title":{"dependencies.html":{}},"body":{"changelog.html":{}}}],["pages",{"_index":843,"title":{},"body":{"changelog.html":{}}}],["paired",{"_index":826,"title":{},"body":{"changelog.html":{}}}],["pane",{"_index":970,"title":{},"body":{"changelog.html":{}}}],["panel",{"_index":840,"title":{},"body":{"changelog.html":{}}}],["parameters",{"_index":34,"title":{},"body":{"classes/BodyUILayer.html":{},"miscellaneous/functions.html":{}}}],["parameters['getpickinginfo']>[0",{"_index":190,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["parent",{"_index":207,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{},"changelog.html":{},"miscellaneous/functions.html":{}}}],["parsecsv",{"_index":1247,"title":{},"body":{"coverage.html":{},"miscellaneous/functions.html":{}}}],["parsecsv(sourceurl",{"_index":1398,"title":{},"body":{"miscellaneous/functions.html":{}}}],["parsecsvtext",{"_index":1248,"title":{},"body":{"coverage.html":{},"miscellaneous/functions.html":{}}}],["parsecsvtext(csvtext",{"_index":1401,"title":{},"body":{"miscellaneous/functions.html":{}}}],["parser",{"_index":1311,"title":{},"body":{"dependencies.html":{}}}],["partial",{"_index":275,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["particular",{"_index":1499,"title":{},"body":{"license.html":{}}}],["partly",{"_index":995,"title":{},"body":{"changelog.html":{}}}],["partonomy",{"_index":912,"title":{},"body":{"changelog.html":{}}}],["path",{"_index":1337,"title":{},"body":{"dependencies.html":{}}}],["pbr",{"_index":174,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{},"interfaces/ProcessedNode.html":{}}}],["performance",{"_index":753,"title":{},"body":{"changelog.html":{}}}],["permission",{"_index":1463,"title":{},"body":{"license.html":{}}}],["permit",{"_index":1484,"title":{},"body":{"license.html":{}}}],["person",{"_index":1468,"title":{},"body":{"license.html":{}}}],["persons",{"_index":1485,"title":{},"body":{"license.html":{}}}],["pick",{"_index":655,"title":{},"body":{"changelog.html":{}}}],["pickable",{"_index":93,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["picked",{"_index":239,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["pickinfo",{"_index":234,"title":{"interfaces/PickInfo.html":{}},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{},"coverage.html":{}}}],["placeholder",{"_index":1138,"title":{},"body":{"changelog.html":{}}}],["placement",{"_index":571,"title":{},"body":{"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{},"changelog.html":{}}}],["placement_date",{"_index":591,"title":{},"body":{"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{}}}],["placenta",{"_index":686,"title":{},"body":{"changelog.html":{}}}],["player",{"_index":1284,"title":{},"body":{"dependencies.html":{}}}],["plugin",{"_index":1301,"title":{},"body":{"dependencies.html":{}}}],["plus",{"_index":665,"title":{},"body":{"changelog.html":{}}}],["pointer",{"_index":378,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["popup",{"_index":1147,"title":{},"body":{"changelog.html":{}}}],["portal",{"_index":797,"title":{},"body":{"changelog.html":{},"index.html":{}}}],["portal's",{"_index":1118,"title":{},"body":{"changelog.html":{}}}],["portions",{"_index":1492,"title":{},"body":{"license.html":{}}}],["position",{"_index":121,"title":{},"body":{"classes/BodyUILayer.html":{},"changelog.html":{}}}],["possible",{"_index":1061,"title":{},"body":{"changelog.html":{}}}],["postprocess",{"_index":460,"title":{},"body":{"interfaces/Collision.html":{}}}],["preferences",{"_index":871,"title":{},"body":{"changelog.html":{}}}],["preparation",{"_index":1179,"title":{},"body":{"changelog.html":{}}}],["presented",{"_index":1203,"title":{},"body":{"changelog.html":{}}}],["prevent",{"_index":723,"title":{},"body":{"changelog.html":{}}}],["preview",{"_index":886,"title":{},"body":{"changelog.html":{}}}],["previous",{"_index":1023,"title":{},"body":{"changelog.html":{}}}],["previously",{"_index":777,"title":{},"body":{"changelog.html":{}}}],["primitive",{"_index":468,"title":{},"body":{"interfaces/Collision.html":{},"interfaces/ProcessedNode.html":{}}}],["primitive.attributes.position",{"_index":469,"title":{},"body":{"interfaces/Collision.html":{},"interfaces/ProcessedNode.html":{}}}],["primitive.attributes.position.min",{"_index":470,"title":{},"body":{"interfaces/Collision.html":{},"interfaces/ProcessedNode.html":{}}}],["priority",{"_index":607,"title":{},"body":{"interfaces/SpatialSceneNode.html":{}}}],["private",{"_index":248,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["process",{"_index":1161,"title":{},"body":{"changelog.html":{}}}],["processanatomicalstructures",{"_index":1250,"title":{},"body":{"coverage.html":{},"miscellaneous/functions.html":{}}}],["processanatomicalstructures(sourceurl",{"_index":1403,"title":{},"body":{"miscellaneous/functions.html":{}}}],["processed",{"_index":1109,"title":{},"body":{"changelog.html":{}}}],["processednode",{"_index":503,"title":{"interfaces/ProcessedNode.html":{}},"body":{"interfaces/ProcessedNode.html":{},"coverage.html":{}}}],["processednode.bbox",{"_index":529,"title":{},"body":{"interfaces/ProcessedNode.html":{}}}],["processednode['@id",{"_index":527,"title":{},"body":{"interfaces/ProcessedNode.html":{}}}],["processextractionsites",{"_index":1252,"title":{},"body":{"coverage.html":{},"miscellaneous/functions.html":{}}}],["processextractionsites(sourceurl",{"_index":1405,"title":{},"body":{"miscellaneous/functions.html":{}}}],["processing",{"_index":872,"title":{},"body":{"changelog.html":{}}}],["processreferencedata",{"_index":1254,"title":{},"body":{"coverage.html":{},"miscellaneous/functions.html":{}}}],["processreferencedata(refentities",{"_index":1406,"title":{},"body":{"miscellaneous/functions.html":{}}}],["processscenenodes",{"_index":228,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{},"coverage.html":{},"miscellaneous/functions.html":{}}}],["processscenenodes(gltfurl",{"_index":354,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{},"interfaces/ProcessedNode.html":{},"miscellaneous/functions.html":{}}}],["processspatialentities",{"_index":1259,"title":{},"body":{"coverage.html":{},"miscellaneous/functions.html":{}}}],["processspatialentities(parent",{"_index":1408,"title":{},"body":{"miscellaneous/functions.html":{}}}],["production",{"_index":764,"title":{},"body":{"changelog.html":{},"index.html":{}}}],["programming",{"_index":742,"title":{},"body":{"changelog.html":{}}}],["project",{"_index":1166,"title":{},"body":{"changelog.html":{}}}],["projects",{"_index":1415,"title":{},"body":{"index.html":{}}}],["projects/.../body",{"_index":1387,"title":{},"body":{"miscellaneous/functions.html":{},"miscellaneous/typealiases.html":{}}}],["projects/.../global",{"_index":1383,"title":{},"body":{"miscellaneous/functions.html":{}}}],["projects/.../load",{"_index":1385,"title":{},"body":{"miscellaneous/functions.html":{}}}],["projects/.../parse",{"_index":1388,"title":{},"body":{"miscellaneous/functions.html":{}}}],["projects/.../process",{"_index":1384,"title":{},"body":{"miscellaneous/functions.html":{},"miscellaneous/variables.html":{}}}],["projects/.../scene",{"_index":1390,"title":{},"body":{"miscellaneous/functions.html":{},"miscellaneous/typealiases.html":{}}}],["projects/.../simplify",{"_index":1389,"title":{},"body":{"miscellaneous/functions.html":{}}}],["projects/.../spatial",{"_index":1386,"title":{},"body":{"miscellaneous/functions.html":{},"miscellaneous/typealiases.html":{}}}],["projects/ccf",{"_index":6,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/Collision.html":{},"interfaces/PickInfo.html":{},"interfaces/ProcessedNode.html":{},"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{},"interfaces/SpatialSceneNode.html":{},"coverage.html":{},"miscellaneous/functions.html":{},"miscellaneous/typealiases.html":{},"miscellaneous/variables.html":{}}}],["promise",{"_index":128,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/Collision.html":{},"interfaces/PickInfo.html":{},"interfaces/ProcessedNode.html":{},"miscellaneous/functions.html":{}}}],["promise(r",{"_index":326,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["properties",{"_index":14,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/Collision.html":{},"interfaces/PickInfo.html":{},"interfaces/ProcessedNode.html":{},"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{},"interfaces/SpatialSceneNode.html":{},"changelog.html":{}}}],["props",{"_index":276,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["props.effects",{"_index":305,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["provided",{"_index":1219,"title":{},"body":{"changelog.html":{},"license.html":{}}}],["providers",{"_index":804,"title":{},"body":{"changelog.html":{}}}],["public",{"_index":1145,"title":{},"body":{"changelog.html":{}}}],["publish",{"_index":1478,"title":{},"body":{"license.html":{}}}],["publishing",{"_index":747,"title":{},"body":{"changelog.html":{}}}],["purpose",{"_index":1500,"title":{},"body":{"license.html":{}}}],["pushed",{"_index":958,"title":{},"body":{"changelog.html":{}}}],["python",{"_index":744,"title":{},"body":{"changelog.html":{},"index.html":{}}}],["qs",{"_index":1362,"title":{},"body":{"dependencies.html":{}}}],["qualitative",{"_index":1122,"title":{},"body":{"changelog.html":{}}}],["quality",{"_index":807,"title":{},"body":{"changelog.html":{}}}],["queries",{"_index":640,"title":{},"body":{"changelog.html":{},"dependencies.html":{}}}],["query",{"_index":1213,"title":{},"body":{"changelog.html":{}}}],["querying",{"_index":695,"title":{},"body":{"changelog.html":{}}}],["quickly",{"_index":1102,"title":{},"body":{"changelog.html":{}}}],["r.hits.length",{"_index":490,"title":{},"body":{"interfaces/Collision.html":{}}}],["rc.1",{"_index":1128,"title":{},"body":{"changelog.html":{}}}],["rdf",{"_index":1364,"title":{},"body":{"dependencies.html":{}}}],["rdfjs",{"_index":1286,"title":{},"body":{"dependencies.html":{}}}],["rdfjs/data",{"_index":1306,"title":{},"body":{"dependencies.html":{}}}],["rdfxml",{"_index":1365,"title":{},"body":{"dependencies.html":{}}}],["readable",{"_index":1367,"title":{},"body":{"dependencies.html":{}}}],["readonly",{"_index":16,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["real",{"_index":1143,"title":{},"body":{"changelog.html":{}}}],["record",{"_index":138,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["rectify",{"_index":783,"title":{},"body":{"changelog.html":{}}}],["reduce",{"_index":948,"title":{},"body":{"changelog.html":{}}}],["reduction",{"_index":713,"title":{},"body":{"changelog.html":{}}}],["refentities",{"_index":1407,"title":{},"body":{"miscellaneous/functions.html":{}}}],["reference",{"_index":344,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{},"changelog.html":{},"coverage.html":{},"miscellaneous/functions.html":{},"miscellaneous/variables.html":{}}}],["reference_organ",{"_index":572,"title":{},"body":{"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{},"interfaces/SpatialSceneNode.html":{}}}],["referencedataconfig",{"_index":1256,"title":{},"body":{"coverage.html":{},"miscellaneous/variables.html":{}}}],["referenceorganconfigurl",{"_index":1535,"title":{},"body":{"miscellaneous/variables.html":{}}}],["refernced",{"_index":827,"title":{},"body":{"changelog.html":{}}}],["refresh",{"_index":911,"title":{},"body":{"changelog.html":{}}}],["regions",{"_index":1206,"title":{},"body":{"changelog.html":{}}}],["register",{"_index":1323,"title":{},"body":{"dependencies.html":{}}}],["registered",{"_index":778,"title":{},"body":{"changelog.html":{}}}],["registergltfloaders",{"_index":66,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/ProcessedNode.html":{},"coverage.html":{},"miscellaneous/functions.html":{}}}],["registration",{"_index":817,"title":{},"body":{"changelog.html":{},"index.html":{}}}],["registrations",{"_index":936,"title":{},"body":{"changelog.html":{}}}],["related",{"_index":987,"title":{},"body":{"changelog.html":{}}}],["release",{"_index":629,"title":{},"body":{"changelog.html":{}}}],["reliability",{"_index":1036,"title":{},"body":{"changelog.html":{}}}],["reloads",{"_index":882,"title":{},"body":{"changelog.html":{}}}],["removed",{"_index":856,"title":{},"body":{"changelog.html":{}}}],["removes",{"_index":986,"title":{},"body":{"changelog.html":{}}}],["renderlayers",{"_index":22,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["report",{"_index":475,"title":{},"body":{"interfaces/Collision.html":{}}}],["report.push",{"_index":483,"title":{},"body":{"interfaces/Collision.html":{}}}],["repository",{"_index":1412,"title":{},"body":{"index.html":{}}}],["representation_of",{"_index":573,"title":{},"body":{"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{},"interfaces/SpatialSceneNode.html":{}}}],["required",{"_index":1090,"title":{},"body":{"changelog.html":{}}}],["resets",{"_index":913,"title":{},"body":{"changelog.html":{}}}],["resolved",{"_index":964,"title":{},"body":{"changelog.html":{}}}],["respond",{"_index":904,"title":{},"body":{"changelog.html":{}}}],["restriction",{"_index":1473,"title":{},"body":{"license.html":{}}}],["result",{"_index":193,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/Collision.html":{},"interfaces/PickInfo.html":{},"interfaces/ProcessedNode.html":{},"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{},"interfaces/SpatialSceneNode.html":{},"changelog.html":{},"coverage.html":{},"dependencies.html":{},"miscellaneous/functions.html":{},"index.html":{},"license.html":{},"modules.html":{},"overview.html":{},"miscellaneous/typealiases.html":{},"miscellaneous/variables.html":{}}}],["results",{"_index":195,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/Collision.html":{},"interfaces/PickInfo.html":{},"interfaces/ProcessedNode.html":{},"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{},"interfaces/SpatialSceneNode.html":{},"changelog.html":{},"coverage.html":{},"dependencies.html":{},"miscellaneous/functions.html":{},"index.html":{},"license.html":{},"modules.html":{},"overview.html":{},"miscellaneous/typealiases.html":{},"miscellaneous/variables.html":{}}}],["return",{"_index":81,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/Collision.html":{},"interfaces/ProcessedNode.html":{}}}],["returns",{"_index":38,"title":{},"body":{"classes/BodyUILayer.html":{},"miscellaneous/functions.html":{}}}],["returntype",{"_index":39,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["returntype['getpickinginfo",{"_index":191,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["rgb",{"_index":1342,"title":{},"body":{"dependencies.html":{}}}],["right",{"_index":588,"title":{},"body":{"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{},"changelog.html":{}}}],["rights",{"_index":1475,"title":{},"body":{"license.html":{}}}],["root",{"_index":921,"title":{},"body":{"changelog.html":{}}}],["rotates",{"_index":884,"title":{},"body":{"changelog.html":{}}}],["rotation",{"_index":208,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["rotation_units",{"_index":599,"title":{},"body":{"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{}}}],["rotationorbit",{"_index":232,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["rotationx",{"_index":233,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["round",{"_index":1021,"title":{},"body":{"changelog.html":{}}}],["rounded",{"_index":1040,"title":{},"body":{"changelog.html":{}}}],["route",{"_index":693,"title":{},"body":{"changelog.html":{}}}],["ru/common",{"_index":1268,"title":{},"body":{"dependencies.html":{}}}],["rui",{"_index":650,"title":{},"body":{"changelog.html":{},"index.html":{}}}],["rui_locations.jsonld",{"_index":731,"title":{},"body":{"changelog.html":{}}}],["rui_rank",{"_index":574,"title":{},"body":{"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{}}}],["rxjs",{"_index":224,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{},"dependencies.html":{}}}],["rxjs/operators",{"_index":226,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["sad",{"_index":476,"title":{},"body":{"interfaces/Collision.html":{}}}],["sad.push(src",{"_index":486,"title":{},"body":{"interfaces/Collision.html":{}}}],["sample",{"_index":1218,"title":{},"body":{"changelog.html":{}}}],["samples",{"_index":950,"title":{},"body":{"changelog.html":{}}}],["saver",{"_index":1329,"title":{},"body":{"dependencies.html":{}}}],["scaffolding",{"_index":1167,"title":{},"body":{"changelog.html":{}}}],["scale(halfsize.toarray",{"_index":555,"title":{},"body":{"interfaces/ProcessedNode.html":{}}}],["scaling_units",{"_index":595,"title":{},"body":{"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{}}}],["scene",{"_index":62,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/Collision.html":{},"interfaces/PickInfo.html":{},"interfaces/ProcessedNode.html":{},"interfaces/SpatialSceneNode.html":{},"changelog.html":{},"coverage.html":{},"miscellaneous/functions.html":{},"miscellaneous/typealiases.html":{}}}],["scene.children",{"_index":513,"title":{},"body":{"interfaces/ProcessedNode.html":{}}}],["scene.filter(d",{"_index":457,"title":{},"body":{"interfaces/Collision.html":{}}}],["scene.nodes",{"_index":512,"title":{},"body":{"interfaces/ProcessedNode.html":{}}}],["scene.ts",{"_index":1263,"title":{},"body":{"coverage.html":{},"miscellaneous/functions.html":{}}}],["scenegraph",{"_index":139,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{},"interfaces/ProcessedNode.html":{},"interfaces/SpatialSceneNode.html":{}}}],["scenegraphlayer",{"_index":48,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["scenegraphnode",{"_index":362,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{},"interfaces/ProcessedNode.html":{},"interfaces/SpatialSceneNode.html":{},"miscellaneous/functions.html":{}}}],["scenegraphnodename",{"_index":1394,"title":{},"body":{"miscellaneous/functions.html":{}}}],["scenerotation",{"_index":263,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["scenerotationsubject",{"_index":252,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["scenetraversalvisitor",{"_index":1523,"title":{},"body":{"miscellaneous/typealiases.html":{}}}],["scheduled",{"_index":965,"title":{},"body":{"changelog.html":{}}}],["schema",{"_index":1171,"title":{},"body":{"changelog.html":{}}}],["schemes",{"_index":1123,"title":{},"body":{"changelog.html":{}}}],["science",{"_index":1451,"title":{},"body":{"index.html":{}}}],["search",{"_index":654,"title":{},"body":{"changelog.html":{}}}],["searches",{"_index":668,"title":{},"body":{"changelog.html":{}}}],["section",{"_index":937,"title":{},"body":{"changelog.html":{}}}],["see",{"_index":697,"title":{},"body":{"changelog.html":{},"index.html":{}}}],["select",{"_index":855,"title":{},"body":{"changelog.html":{}}}],["selected",{"_index":677,"title":{},"body":{"changelog.html":{}}}],["selecting",{"_index":737,"title":{},"body":{"changelog.html":{}}}],["selector",{"_index":735,"title":{},"body":{"changelog.html":{}}}],["selects",{"_index":1188,"title":{},"body":{"changelog.html":{}}}],["sell",{"_index":1482,"title":{},"body":{"license.html":{}}}],["semantic",{"_index":1202,"title":{},"body":{"changelog.html":{}}}],["sennet",{"_index":758,"title":{},"body":{"changelog.html":{}}}],["server",{"_index":1174,"title":{},"body":{"changelog.html":{}}}],["set",{"_index":867,"title":{},"body":{"changelog.html":{}}}],["setinteractive(value",{"_index":375,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["setrotation(value",{"_index":371,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["setrotationx(value",{"_index":372,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["setscene(data",{"_index":331,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["settarget(value",{"_index":374,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["settimeout(r",{"_index":327,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["setup",{"_index":932,"title":{},"body":{"changelog.html":{}}}],["setzoom(value",{"_index":373,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["sex",{"_index":575,"title":{},"body":{"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{},"changelog.html":{}}}],["sexes",{"_index":1076,"title":{},"body":{"changelog.html":{}}}],["shall",{"_index":1489,"title":{},"body":{"license.html":{}}}],["share",{"_index":225,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["shared",{"_index":875,"title":{},"body":{"changelog.html":{}}}],["shared/spatial",{"_index":61,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/Collision.html":{},"interfaces/PickInfo.html":{},"interfaces/ProcessedNode.html":{}}}],["shortest",{"_index":1336,"title":{},"body":{"dependencies.html":{}}}],["show",{"_index":907,"title":{},"body":{"changelog.html":{}}}],["showing",{"_index":1108,"title":{},"body":{"changelog.html":{}}}],["shown",{"_index":1117,"title":{},"body":{"changelog.html":{}}}],["shows",{"_index":810,"title":{},"body":{"changelog.html":{}}}],["side",{"_index":576,"title":{},"body":{"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{},"changelog.html":{}}}],["sides",{"_index":1078,"title":{},"body":{"changelog.html":{}}}],["significant",{"_index":916,"title":{},"body":{"changelog.html":{}}}],["simple",{"_index":839,"title":{},"body":{"changelog.html":{}}}],["simplemeshlayer",{"_index":49,"title":{},"body":{"classes/BodyUILayer.html":{},"miscellaneous/functions.html":{}}}],["simplifies",{"_index":930,"title":{},"body":{"changelog.html":{}}}],["simplifyscene",{"_index":1264,"title":{},"body":{"coverage.html":{},"miscellaneous/functions.html":{}}}],["simplifyscene(nodes",{"_index":1410,"title":{},"body":{"miscellaneous/functions.html":{}}}],["site",{"_index":1531,"title":{},"body":{"miscellaneous/variables.html":{}}}],["sites",{"_index":819,"title":{},"body":{"changelog.html":{}}}],["sites.csv",{"_index":1528,"title":{},"body":{"miscellaneous/variables.html":{}}}],["sites.ts",{"_index":1251,"title":{},"body":{"coverage.html":{},"miscellaneous/functions.html":{}}}],["sizable",{"_index":1035,"title":{},"body":{"changelog.html":{}}}],["size",{"_index":508,"title":{},"body":{"interfaces/ProcessedNode.html":{}}}],["size.clone().vmul(new",{"_index":548,"title":{},"body":{"interfaces/ProcessedNode.html":{}}}],["slice_count",{"_index":577,"title":{},"body":{"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{}}}],["slice_thickness",{"_index":578,"title":{},"body":{"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{}}}],["slider",{"_index":1354,"title":{},"body":{"dependencies.html":{}}}],["slightly",{"_index":781,"title":{},"body":{"changelog.html":{}}}],["slow",{"_index":945,"title":{},"body":{"changelog.html":{}}}],["software",{"_index":1417,"title":{},"body":{"index.html":{},"license.html":{}}}],["solved",{"_index":1030,"title":{},"body":{"changelog.html":{}}}],["sometimes",{"_index":1099,"title":{},"body":{"changelog.html":{}}}],["soon",{"_index":751,"title":{},"body":{"changelog.html":{}}}],["sop",{"_index":941,"title":{},"body":{"changelog.html":{}}}],["source",{"_index":4,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/Collision.html":{},"interfaces/PickInfo.html":{},"interfaces/ProcessedNode.html":{},"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{},"interfaces/SpatialSceneNode.html":{}}}],["sourceboxes",{"_index":435,"title":{},"body":{"interfaces/Collision.html":{}}}],["sources",{"_index":863,"title":{},"body":{"changelog.html":{}}}],["sourceurl",{"_index":1400,"title":{},"body":{"miscellaneous/functions.html":{}}}],["sparc",{"_index":935,"title":{},"body":{"changelog.html":{}}}],["sparql",{"_index":639,"title":{},"body":{"changelog.html":{},"dependencies.html":{}}}],["spatial",{"_index":558,"title":{},"body":{"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{},"changelog.html":{},"coverage.html":{},"miscellaneous/functions.html":{}}}],["spatialentityjsonld",{"_index":556,"title":{"interfaces/SpatialEntityJsonLd.html":{}},"body":{"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{},"coverage.html":{}}}],["spatialobjectreferencejsonld",{"_index":583,"title":{"interfaces/SpatialObjectReferenceJsonLd.html":{}},"body":{"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{},"coverage.html":{}}}],["spatialplacementjsonld",{"_index":584,"title":{"interfaces/SpatialPlacementJsonLd.html":{}},"body":{"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{},"coverage.html":{}}}],["spatialscenegeometry",{"_index":610,"title":{},"body":{"interfaces/SpatialSceneNode.html":{},"miscellaneous/typealiases.html":{}}}],["spatialscenenode",{"_index":60,"title":{"interfaces/SpatialSceneNode.html":{}},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/Collision.html":{},"interfaces/PickInfo.html":{},"interfaces/ProcessedNode.html":{},"interfaces/SpatialSceneNode.html":{},"coverage.html":{}}}],["spec",{"_index":590,"title":{},"body":{"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{},"changelog.html":{}}}],["spec.yaml",{"_index":1440,"title":{},"body":{"index.html":{}}}],["specific",{"_index":801,"title":{},"body":{"changelog.html":{}}}],["specification",{"_index":1439,"title":{},"body":{"index.html":{}}}],["speed",{"_index":710,"title":{},"body":{"changelog.html":{}}}],["sphere",{"_index":86,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/SpatialSceneNode.html":{},"miscellaneous/typealiases.html":{}}}],["spheregeometry",{"_index":56,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["spinal",{"_index":687,"title":{},"body":{"changelog.html":{}}}],["spinning",{"_index":1172,"title":{},"body":{"changelog.html":{}}}],["sprint",{"_index":968,"title":{},"body":{"changelog.html":{}}}],["src",{"_index":477,"title":{},"body":{"interfaces/Collision.html":{}}}],["src.bbox.overlaps(target.bbox",{"_index":478,"title":{},"body":{"interfaces/Collision.html":{}}}],["src.entityid",{"_index":484,"title":{},"body":{"interfaces/Collision.html":{}}}],["src.name",{"_index":485,"title":{},"body":{"interfaces/Collision.html":{}}}],["srcevent",{"_index":385,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["stage",{"_index":1009,"title":{},"body":{"changelog.html":{}}}],["staging",{"_index":765,"title":{},"body":{"changelog.html":{},"index.html":{}}}],["standalone",{"_index":1025,"title":{},"body":{"changelog.html":{}}}],["standard",{"_index":1082,"title":{},"body":{"changelog.html":{}}}],["standards",{"_index":1176,"title":{},"body":{"changelog.html":{}}}],["star2",{"_index":1421,"title":{},"body":{"index.html":{}}}],["started",{"_index":612,"title":{"changelog.html":{},"index.html":{},"license.html":{}},"body":{"changelog.html":{}}}],["starts",{"_index":1225,"title":{},"body":{"changelog.html":{}}}],["startup",{"_index":928,"title":{},"body":{"changelog.html":{}}}],["state",{"_index":134,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["state.data",{"_index":140,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["state.docollisions",{"_index":186,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["state.zoomopacity",{"_index":162,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["statements",{"_index":1228,"title":{},"body":{"coverage.html":{}}}],["static",{"_index":15,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["stay",{"_index":1223,"title":{},"body":{"changelog.html":{}}}],["still",{"_index":953,"title":{},"body":{"changelog.html":{}}}],["stories",{"_index":1164,"title":{},"body":{"changelog.html":{}}}],["stream",{"_index":1368,"title":{},"body":{"dependencies.html":{}}}],["streaming",{"_index":1366,"title":{},"body":{"dependencies.html":{}}}],["string",{"_index":30,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/Collision.html":{},"interfaces/PickInfo.html":{},"interfaces/ProcessedNode.html":{},"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{},"interfaces/SpatialSceneNode.html":{},"miscellaneous/functions.html":{}}}],["structure",{"_index":982,"title":{},"body":{"changelog.html":{}}}],["structures",{"_index":971,"title":{},"body":{"changelog.html":{}}}],["structures.ts",{"_index":1249,"title":{},"body":{"coverage.html":{},"miscellaneous/functions.html":{}}}],["styles",{"_index":1198,"title":{},"body":{"changelog.html":{}}}],["styling",{"_index":835,"title":{},"body":{"changelog.html":{}}}],["subject",{"_index":223,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{},"license.html":{}}}],["subject.next",{"_index":415,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["sublicense",{"_index":1480,"title":{},"body":{"license.html":{}}}],["substantial",{"_index":1491,"title":{},"body":{"license.html":{}}}],["such",{"_index":638,"title":{},"body":{"changelog.html":{}}}],["support",{"_index":643,"title":{},"body":{"changelog.html":{}}}],["swiper",{"_index":1371,"title":{},"body":{"dependencies.html":{}}}],["switch",{"_index":83,"title":{},"body":{"classes/BodyUILayer.html":{},"changelog.html":{}}}],["switched",{"_index":1043,"title":{},"body":{"changelog.html":{}}}],["sync",{"_index":885,"title":{},"body":{"changelog.html":{}}}],["table",{"_index":1267,"title":{},"body":{"coverage.html":{}}}],["tables",{"_index":773,"title":{},"body":{"changelog.html":{}}}],["tablesort(document.getelementbyid('coverage",{"_index":1266,"title":{},"body":{"coverage.html":{}}}],["tagging",{"_index":1080,"title":{},"body":{"changelog.html":{}}}],["take",{"_index":798,"title":{},"body":{"changelog.html":{}}}],["target",{"_index":209,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/Collision.html":{},"interfaces/PickInfo.html":{},"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{}}}],["target.name",{"_index":481,"title":{},"body":{"interfaces/Collision.html":{}}}],["target['@id",{"_index":480,"title":{},"body":{"interfaces/Collision.html":{}}}],["targetboxes",{"_index":456,"title":{},"body":{"interfaces/Collision.html":{}}}],["targetboxes.push",{"_index":473,"title":{},"body":{"interfaces/Collision.html":{}}}],["technologies",{"_index":1195,"title":{},"body":{"changelog.html":{}}}],["technology",{"_index":1013,"title":{},"body":{"changelog.html":{}}}],["telemetry",{"_index":878,"title":{},"body":{"changelog.html":{}}}],["terms",{"_index":635,"title":{},"body":{"changelog.html":{}}}],["test",{"_index":361,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{},"changelog.html":{}}}],["testing",{"_index":1089,"title":{},"body":{"changelog.html":{}}}],["text",{"_index":124,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/SpatialSceneNode.html":{},"miscellaneous/typealiases.html":{}}}],["textlayer",{"_index":46,"title":{},"body":{"classes/BodyUILayer.html":{},"coverage.html":{},"miscellaneous/functions.html":{}}}],["textlayer(id",{"_index":119,"title":{},"body":{"classes/BodyUILayer.html":{},"miscellaneous/functions.html":{}}}],["theme",{"_index":759,"title":{},"body":{"changelog.html":{}}}],["themes",{"_index":757,"title":{},"body":{"changelog.html":{}}}],["theming",{"_index":754,"title":{},"body":{"changelog.html":{}}}],["this._dragevent(info",{"_index":407,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["this._onclick",{"_index":289,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["this._ondrag",{"_index":295,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["this._ondragend",{"_index":297,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["this._ondragstart",{"_index":293,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["this._onhover",{"_index":287,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["this._onviewstatechange",{"_index":291,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["this.bodyuilayer",{"_index":285,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["this.bodyuilayer.setstate",{"_index":338,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["this.bodyuilayer.state",{"_index":323,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["this.cursor",{"_index":300,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["this.debugscenenodeprocessing(data",{"_index":339,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["this.deck",{"_index":308,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["this.deck.finalize",{"_index":330,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["this.deck.props.viewstate",{"_index":368,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["this.deck.setprops",{"_index":310,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["this.deckprops.debugscenenodeprocessing",{"_index":337,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["this.lasthovered",{"_index":382,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["this.nodeclicksubject.next",{"_index":390,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["this.nodeclicksubject.pipe(share",{"_index":258,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["this.nodedragendsubject",{"_index":412,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["this.nodedragendsubject.pipe(share",{"_index":270,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["this.nodedragstartsubject",{"_index":408,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["this.nodedragstartsubject.pipe(share",{"_index":266,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["this.nodedragsubject",{"_index":410,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["this.nodedragsubject.pipe(share",{"_index":268,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["this.nodehoverstartsubject.next(e.object",{"_index":383,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["this.nodehoverstartsubject.pipe(share",{"_index":260,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["this.nodehoverstopsubject.next(lasthovered",{"_index":381,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["this.nodehoverstopsubject.pipe(share",{"_index":262,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["this.props",{"_index":130,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["this.scenerotationsubject.next([deckprops.rotation",{"_index":320,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["this.scenerotationsubject.next([event.viewstate.rotationorbit",{"_index":404,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["this.scenerotationsubject.pipe(share",{"_index":264,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["this.setstate",{"_index":131,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["this.state",{"_index":135,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["this.zoomto(node",{"_index":335,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["through",{"_index":1101,"title":{},"body":{"changelog.html":{}}}],["thumbnails",{"_index":980,"title":{},"body":{"changelog.html":{}}}],["tied",{"_index":984,"title":{},"body":{"changelog.html":{}}}],["tiff",{"_index":1110,"title":{},"body":{"changelog.html":{}}}],["timeouts",{"_index":724,"title":{},"body":{"changelog.html":{}}}],["times",{"_index":714,"title":{},"body":{"changelog.html":{}}}],["tissue",{"_index":494,"title":{},"body":{"interfaces/Collision.html":{},"changelog.html":{}}}],["tissues",{"_index":779,"title":{},"body":{"changelog.html":{}}}],["tmc",{"_index":1214,"title":{},"body":{"changelog.html":{}}}],["toggle",{"_index":755,"title":{},"body":{"changelog.html":{}}}],["tool",{"_index":1026,"title":{},"body":{"changelog.html":{}}}],["tooltip",{"_index":528,"title":{},"body":{"interfaces/ProcessedNode.html":{},"interfaces/SpatialSceneNode.html":{}}}],["tort",{"_index":1512,"title":{},"body":{"license.html":{}}}],["tracking/telemetry",{"_index":896,"title":{},"body":{"changelog.html":{}}}],["transformmatrix",{"_index":114,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{},"interfaces/ProcessedNode.html":{},"interfaces/SpatialSceneNode.html":{}}}],["translate(center.toarray",{"_index":554,"title":{},"body":{"interfaces/ProcessedNode.html":{}}}],["translation_units",{"_index":603,"title":{},"body":{"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{}}}],["transparency",{"_index":1027,"title":{},"body":{"changelog.html":{}}}],["traversal",{"_index":431,"title":{},"body":{"interfaces/Collision.html":{},"interfaces/ProcessedNode.html":{}}}],["traversal.ts",{"_index":1261,"title":{},"body":{"coverage.html":{},"miscellaneous/functions.html":{},"miscellaneous/typealiases.html":{}}}],["traversescene",{"_index":430,"title":{},"body":{"interfaces/Collision.html":{},"interfaces/ProcessedNode.html":{},"coverage.html":{},"miscellaneous/functions.html":{}}}],["traversescene(gltfscene",{"_index":463,"title":{},"body":{"interfaces/Collision.html":{}}}],["traversescene(scene",{"_index":521,"title":{},"body":{"interfaces/ProcessedNode.html":{},"miscellaneous/functions.html":{}}}],["travisci",{"_index":1047,"title":{},"body":{"changelog.html":{}}}],["tree",{"_index":1169,"title":{},"body":{"changelog.html":{}}}],["true",{"_index":94,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/Collision.html":{},"interfaces/PickInfo.html":{},"interfaces/ProcessedNode.html":{}}}],["try",{"_index":1064,"title":{},"body":{"changelog.html":{}}}],["ts",{"_index":1373,"title":{},"body":{"dependencies.html":{}}}],["tslib",{"_index":1376,"title":{},"body":{"dependencies.html":{}}}],["tuned",{"_index":1224,"title":{},"body":{"changelog.html":{}}}],["turn",{"_index":1007,"title":{},"body":{"changelog.html":{}}}],["turned",{"_index":988,"title":{},"body":{"changelog.html":{}}}],["turning",{"_index":985,"title":{},"body":{"changelog.html":{}}}],["tutorial",{"_index":858,"title":{},"body":{"changelog.html":{}}}],["two",{"_index":1121,"title":{},"body":{"changelog.html":{}}}],["type",{"_index":23,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/Collision.html":{},"interfaces/PickInfo.html":{},"interfaces/ProcessedNode.html":{},"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{},"interfaces/SpatialSceneNode.html":{},"changelog.html":{},"coverage.html":{},"miscellaneous/typealiases.html":{},"miscellaneous/variables.html":{}}}],["typealiases",{"_index":1521,"title":{"miscellaneous/typealiases.html":{}},"body":{}}],["types",{"_index":728,"title":{},"body":{"changelog.html":{}}}],["types/lru",{"_index":1307,"title":{},"body":{"dependencies.html":{}}}],["typescript",{"_index":108,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{},"changelog.html":{},"index.html":{}}}],["typing",{"_index":1184,"title":{},"body":{"changelog.html":{}}}],["ub",{"_index":543,"title":{},"body":{"interfaces/ProcessedNode.html":{}}}],["ub.clone().vsub(lb",{"_index":546,"title":{},"body":{"interfaces/ProcessedNode.html":{}}}],["ufl",{"_index":979,"title":{},"body":{"changelog.html":{}}}],["ui",{"_index":9,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{},"changelog.html":{},"coverage.html":{},"miscellaneous/functions.html":{},"index.html":{}}}],["ui.netlify.app",{"_index":1424,"title":{},"body":{"index.html":{}}}],["ui.netlify.app/organ",{"_index":1433,"title":{},"body":{"index.html":{}}}],["ui.netlify.app/rui",{"_index":1430,"title":{},"body":{"index.html":{}}}],["ui.ts",{"_index":199,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{},"coverage.html":{},"miscellaneous/typealiases.html":{}}}],["ui/organ",{"_index":1432,"title":{},"body":{"index.html":{}}}],["ui/rui",{"_index":1431,"title":{},"body":{"index.html":{}}}],["ui/src/global",{"_index":1229,"title":{},"body":{"coverage.html":{},"miscellaneous/functions.html":{}}}],["ui/src/lib/body",{"_index":8,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{},"coverage.html":{},"miscellaneous/functions.html":{},"miscellaneous/typealiases.html":{}}}],["ui/src/lib/shared/ccf",{"_index":557,"title":{},"body":{"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{},"coverage.html":{}}}],["ui/src/lib/shared/spatial",{"_index":605,"title":{},"body":{"interfaces/SpatialSceneNode.html":{},"coverage.html":{},"miscellaneous/typealiases.html":{}}}],["ui/src/lib/util/load",{"_index":1242,"title":{},"body":{"coverage.html":{},"miscellaneous/functions.html":{}}}],["ui/src/lib/util/parse",{"_index":1245,"title":{},"body":{"coverage.html":{},"miscellaneous/functions.html":{}}}],["ui/src/lib/util/process",{"_index":504,"title":{},"body":{"interfaces/ProcessedNode.html":{},"coverage.html":{},"miscellaneous/functions.html":{},"miscellaneous/variables.html":{}}}],["ui/src/lib/util/scene",{"_index":1260,"title":{},"body":{"coverage.html":{},"miscellaneous/functions.html":{},"miscellaneous/typealiases.html":{}}}],["ui/src/lib/util/simplify",{"_index":1262,"title":{},"body":{"coverage.html":{},"miscellaneous/functions.html":{}}}],["ui/src/lib/util/spatial",{"_index":417,"title":{},"body":{"interfaces/Collision.html":{},"coverage.html":{},"miscellaneous/functions.html":{}}}],["uis",{"_index":632,"title":{},"body":{"changelog.html":{}}}],["undefined",{"_index":78,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{},"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{},"miscellaneous/functions.html":{}}}],["university",{"_index":1453,"title":{},"body":{"index.html":{}}}],["unknown",{"_index":77,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/Collision.html":{},"interfaces/PickInfo.html":{},"interfaces/ProcessedNode.html":{}}}],["unnecessary",{"_index":881,"title":{},"body":{"changelog.html":{}}}],["unpickable",{"_index":608,"title":{},"body":{"interfaces/SpatialSceneNode.html":{}}}],["unselect",{"_index":947,"title":{},"body":{"changelog.html":{}}}],["until",{"_index":991,"title":{},"body":{"changelog.html":{}}}],["up",{"_index":703,"title":{},"body":{"changelog.html":{}}}],["update",{"_index":647,"title":{},"body":{"changelog.html":{}}}],["updated",{"_index":621,"title":{},"body":{"changelog.html":{}}}],["updated_date",{"_index":579,"title":{},"body":{"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{}}}],["updates",{"_index":692,"title":{},"body":{"changelog.html":{}}}],["upgraded",{"_index":1106,"title":{},"body":{"changelog.html":{}}}],["upgrades",{"_index":1190,"title":{},"body":{"changelog.html":{}}}],["upgrading",{"_index":901,"title":{},"body":{"changelog.html":{}}}],["upload",{"_index":1022,"title":{},"body":{"changelog.html":{}}}],["upperbound",{"_index":444,"title":{},"body":{"interfaces/Collision.html":{},"interfaces/ProcessedNode.html":{}}}],["upperbound[i",{"_index":452,"title":{},"body":{"interfaces/Collision.html":{},"interfaces/ProcessedNode.html":{}}}],["url",{"_index":127,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["url2gltf",{"_index":146,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["url2gltf[m.scenegraph",{"_index":152,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["url2gltf[model.scenegraph",{"_index":168,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["use",{"_index":631,"title":{},"body":{"changelog.html":{},"license.html":{}}}],["used",{"_index":1006,"title":{},"body":{"changelog.html":{}}}],["user",{"_index":616,"title":{},"body":{"changelog.html":{},"index.html":{}}}],["user/os",{"_index":870,"title":{},"body":{"changelog.html":{}}}],["users",{"_index":1209,"title":{},"body":{"changelog.html":{}}}],["uses",{"_index":888,"title":{},"body":{"changelog.html":{}}}],["using",{"_index":842,"title":{},"body":{"changelog.html":{}}}],["util/load",{"_index":67,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["util/process",{"_index":229,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["util/spatial",{"_index":70,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["utilities",{"_index":876,"title":{},"body":{"changelog.html":{}}}],["uuid",{"_index":1377,"title":{},"body":{"dependencies.html":{}}}],["v1.1",{"_index":774,"title":{},"body":{"changelog.html":{}}}],["v1.3",{"_index":630,"title":{},"body":{"changelog.html":{}}}],["v1.5.0",{"_index":1005,"title":{},"body":{"changelog.html":{}}}],["v1.7",{"_index":776,"title":{},"body":{"changelog.html":{}}}],["v1.7.0",{"_index":768,"title":{},"body":{"changelog.html":{}}}],["v1.8.0",{"_index":726,"title":{},"body":{"changelog.html":{}}}],["v1.9.0",{"_index":684,"title":{},"body":{"changelog.html":{}}}],["v1.9.4",{"_index":648,"title":{},"body":{"changelog.html":{}}}],["v1/sparql",{"_index":698,"title":{},"body":{"changelog.html":{}}}],["v2.1.0",{"_index":623,"title":{},"body":{"changelog.html":{}}}],["v3",{"_index":653,"title":{},"body":{"changelog.html":{}}}],["value",{"_index":27,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{},"miscellaneous/functions.html":{},"miscellaneous/variables.html":{}}}],["variable",{"_index":1255,"title":{},"body":{"coverage.html":{}}}],["variables",{"_index":1524,"title":{"miscellaneous/variables.html":{}},"body":{"miscellaneous/variables.html":{}}}],["vec3",{"_index":427,"title":{},"body":{"interfaces/Collision.html":{},"interfaces/ProcessedNode.html":{}}}],["vec3(...lowerbound.map((n",{"_index":450,"title":{},"body":{"interfaces/Collision.html":{},"interfaces/ProcessedNode.html":{}}}],["vec3(...upperbound.map((n",{"_index":453,"title":{},"body":{"interfaces/Collision.html":{},"interfaces/ProcessedNode.html":{}}}],["vec3(0.5",{"_index":549,"title":{},"body":{"interfaces/ProcessedNode.html":{}}}],["version",{"_index":789,"title":{},"body":{"changelog.html":{},"index.html":{}}}],["very",{"_index":1096,"title":{},"body":{"changelog.html":{}}}],["vhf_kidney_l_low1').then((results",{"_index":355,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["vhf_kidney_r_low",{"_index":363,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["via",{"_index":721,"title":{},"body":{"changelog.html":{}}}],["video",{"_index":902,"title":{},"body":{"changelog.html":{}}}],["view",{"_index":887,"title":{},"body":{"changelog.html":{}}}],["viewer",{"_index":973,"title":{},"body":{"changelog.html":{}}}],["viewing",{"_index":674,"title":{},"body":{"changelog.html":{}}}],["views",{"_index":277,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{},"changelog.html":{}}}],["viewstate",{"_index":311,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["viewstateprops",{"_index":218,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["visitor",{"_index":1411,"title":{},"body":{"miscellaneous/functions.html":{}}}],["visual",{"_index":672,"title":{},"body":{"changelog.html":{}}}],["visualization",{"_index":938,"title":{},"body":{"changelog.html":{}}}],["vitessce",{"_index":1107,"title":{},"body":{"changelog.html":{}}}],["void",{"_index":41,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{},"miscellaneous/functions.html":{}}}],["vs",{"_index":853,"title":{},"body":{"changelog.html":{}}}],["vu",{"_index":1220,"title":{},"body":{"changelog.html":{}}}],["warming",{"_index":720,"title":{},"body":{"changelog.html":{}}}],["warning",{"_index":1130,"title":{},"body":{"changelog.html":{}}}],["warranties",{"_index":1496,"title":{},"body":{"license.html":{}}}],["warranty",{"_index":1493,"title":{},"body":{"license.html":{}}}],["web",{"_index":718,"title":{},"body":{"changelog.html":{}}}],["webcomponent",{"_index":852,"title":{},"body":{"changelog.html":{}}}],["webcomponents/webcomponentsjs",{"_index":1309,"title":{},"body":{"dependencies.html":{}}}],["webpages",{"_index":795,"title":{},"body":{"changelog.html":{}}}],["website",{"_index":1419,"title":{},"body":{"index.html":{}}}],["week",{"_index":1226,"title":{},"body":{"changelog.html":{}}}],["whether",{"_index":1509,"title":{},"body":{"license.html":{}}}],["whole",{"_index":1222,"title":{},"body":{"changelog.html":{}}}],["width",{"_index":906,"title":{},"body":{"changelog.html":{}}}],["wireframe",{"_index":111,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/Collision.html":{},"interfaces/ProcessedNode.html":{},"interfaces/SpatialSceneNode.html":{},"miscellaneous/typealiases.html":{}}}],["within",{"_index":977,"title":{},"body":{"changelog.html":{}}}],["without",{"_index":815,"title":{},"body":{"changelog.html":{},"license.html":{}}}],["workflows",{"_index":1049,"title":{},"body":{"changelog.html":{}}}],["working",{"_index":782,"title":{},"body":{"changelog.html":{}}}],["works",{"_index":1068,"title":{},"body":{"changelog.html":{}}}],["worldmatrix",{"_index":516,"title":{},"body":{"interfaces/ProcessedNode.html":{},"miscellaneous/functions.html":{}}}],["wrapper",{"_index":245,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["x",{"_index":236,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["x_dimension",{"_index":580,"title":{},"body":{"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{}}}],["x_rotation",{"_index":596,"title":{},"body":{"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{}}}],["x_scaling",{"_index":592,"title":{},"body":{"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{}}}],["x_translation",{"_index":600,"title":{},"body":{"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{}}}],["y",{"_index":237,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["y_dimension",{"_index":581,"title":{},"body":{"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{}}}],["y_rotation",{"_index":597,"title":{},"body":{"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{}}}],["y_scaling",{"_index":593,"title":{},"body":{"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{}}}],["y_translation",{"_index":601,"title":{},"body":{"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{}}}],["yes",{"_index":1392,"title":{},"body":{"miscellaneous/functions.html":{}}}],["youtube",{"_index":821,"title":{},"body":{"changelog.html":{}}}],["z_dimension",{"_index":582,"title":{},"body":{"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{}}}],["z_rotation",{"_index":598,"title":{},"body":{"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{}}}],["z_scaling",{"_index":594,"title":{},"body":{"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{}}}],["z_translation",{"_index":602,"title":{},"body":{"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{}}}],["zone.js",{"_index":1379,"title":{},"body":{"dependencies.html":{}}}],["zoom",{"_index":210,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["zoombasedopacity",{"_index":364,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{},"interfaces/ProcessedNode.html":{},"interfaces/SpatialSceneNode.html":{}}}],["zoomopacity",{"_index":132,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["zoomto(node",{"_index":365,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["zoomtoonload",{"_index":609,"title":{},"body":{"interfaces/SpatialSceneNode.html":{}}}]],"pipeline":["stemmer"]}, - "store": {"classes/BodyUILayer.html":{"url":"classes/BodyUILayer.html","title":"class - BodyUILayer","body":"\n \n\n\n\n\n\n\n\n\n\n\n\n\n Classes\n BodyUILayer\n\n\n\n \n Info\n \n \n Source\n \n\n\n\n \n \n File\n \n \n projects/ccf-body-ui/src/lib/body-ui-layer.ts\n \n\n\n\n \n Extends\n \n \n CompositeLayer\n \n\n\n\n \n Index\n \n \n \n \n Properties\n \n \n \n \n \n \n Static\n Readonly\n gltfCache\n \n \n Static\n Readonly\n layerName\n \n \n \n \n\n \n \n Methods\n \n \n \n \n \n \n getPickingInfo\n \n \n initializeState\n \n \n renderLayers\n \n \n \n \n\n\n\n\n\n \n \n\n\n\n \n \n \n Properties\n \n \n \n \n \n \n \n Static\n Readonly\n gltfCache\n \n \n \n \n \n \n Type : literal type\n\n \n \n \n \n Default value : {}\n \n \n \n \n Defined in projects/ccf-body-ui/src/lib/body-ui-layer.ts:72\n \n \n\n\n \n \n \n \n \n \n \n \n Static\n Readonly\n layerName\n \n \n \n \n \n \n Type : string\n\n \n \n \n \n Default value : 'BodyUILayer'\n \n \n \n \n Defined in projects/ccf-body-ui/src/lib/body-ui-layer.ts:71\n \n \n\n\n \n \n\n\n \n \n \n Methods\n \n \n \n \n \n \n \n getPickingInfo\n \n \n \n \n \n \ngetPickingInfo(e)\n \n \n\n\n \n \n Defined in projects/ccf-body-ui/src/lib/body-ui-layer.ts:143\n \n \n\n\n \n \n\n \n Parameters :\n \n \n \n Name\n Optional\n \n \n \n \n e\n\n \n No\n \n\n\n \n \n \n \n \n \n \n Returns : ReturnType<>\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n initializeState\n \n \n \n \n \n \ninitializeState()\n \n \n\n\n \n \n Defined in projects/ccf-body-ui/src/lib/body-ui-layer.ts:74\n \n \n\n\n \n \n\n \n Returns : void\n\n \n \n \n \n \n \n \n \n \n \n \n renderLayers\n \n \n \n \n \n \nrenderLayers()\n \n \n\n\n \n \n Defined in projects/ccf-body-ui/src/lib/body-ui-layer.ts:80\n \n \n\n\n \n \n\n \n Returns : []\n\n \n \n \n \n \n\n\n\n\n\n\n \n\n\n \n import { CompositeLayer, COORDINATE_SYSTEM } from '@deck.gl/core';\nimport { TextLayer } from '@deck.gl/layers';\nimport { ScenegraphLayer, SimpleMeshLayer } from '@deck.gl/mesh-layers';\nimport { ConeGeometry, CubeGeometry, CylinderGeometry, Geometry, SphereGeometry } from '@luma.gl/core';\nimport { Matrix4 } from '@math.gl/core';\n\nimport { SpatialSceneNode } from './shared/spatial-scene-node';\nimport { loadGLTF, loadGLTF2, registerGLTFLoaders } from './util/load-gltf';\nimport { doCollisions } from './util/spatial-scene-collider';\n\n\nfunction meshLayer(id: string, data: SpatialSceneNode[], options: { [key: string]: unknown }): SimpleMeshLayer | undefined {\n if (!data || data.length === 0) {\n return undefined;\n } else {\n let mesh: Geometry;\n switch (options.geometry) {\n case 'sphere':\n mesh = new SphereGeometry();\n break;\n case 'cone':\n mesh = new ConeGeometry();\n break;\n case 'cylinder':\n mesh = new CylinderGeometry();\n break;\n case 'cube':\n default:\n mesh = new CubeGeometry();\n break;\n }\n return new SimpleMeshLayer({\n ...{\n id,\n pickable: true,\n autoHighlight: false,\n highlightColor: [30, 136, 229, 255],\n coordinateSystem: COORDINATE_SYSTEM.CARTESIAN,\n data,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n mesh: mesh as any,\n wireframe: false,\n getTransformMatrix: (d) => (d as { transformMatrix: number[][] }).transformMatrix,\n getColor: (d) => (d as { color: [number, number, number, number] }).color || [255, 255, 255, 0.9*255]\n },\n ...options\n });\n }\n}\n\nfunction textLayer(id: string, data: SpatialSceneNode[], options: { [key: string]: unknown }): TextLayer | undefined {\n if (!data || data.length === 0) {\n return undefined;\n } else {\n return new TextLayer({\n ...{\n id,\n pickable: true,\n data: data.map(d => ({ ...d, position: new Matrix4(d.transformMatrix).getTranslation() })),\n getText: (d) => (d as { text: string }).text,\n getPosition: (d) => (d as { position: [number, number] }).position,\n getColor: (d) => (d as { color: [number, number, number, number] }).color\n },\n ...options\n });\n }\n}\n\nexport class BodyUILayer extends CompositeLayer {\n static readonly layerName = 'BodyUILayer';\n static readonly gltfCache: { [url: string]: Promise } = {};\n\n initializeState(): void {\n const { data } = this.props;\n this.setState({ data: data ?? [], zoomOpacity: 0.8, doCollisions: false });\n registerGLTFLoaders();\n }\n\n renderLayers(): unknown[] {\n const state = this.state as { data: SpatialSceneNode[]; zoomOpacity: number; doCollisions: boolean };\n const geometries: Record = {\n 'sphere': [], 'cone': [], 'cylinder': [], 'cube': [], 'text': [], 'wireframe': [], 'scenegraph': []\n };\n\n for (const node of state.data) {\n const geometry = node.geometry ?? 'cube';\n if (node.scenegraph) {\n geometries.scenegraph.push(node);\n } else if (geometries[geometry] !== undefined) {\n geometries[geometry].push(node);\n }\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const url2gltf: { [url: string]: Promise } = {};\n for (const m of geometries.scenegraph) {\n if (m.scenegraph && m.scenegraphNode && !Object.prototype.hasOwnProperty.call(url2gltf, m.scenegraph)) {\n url2gltf[m.scenegraph] = loadGLTF({ scenegraph: m.scenegraph } as SpatialSceneNode, BodyUILayer.gltfCache);\n }\n }\n\n const layers: unknown[] = [];\n for (const [geometry, nodes] of Object.entries(geometries)) {\n if (geometry === 'scenegraph') {\n for (const model of nodes) {\n layers.push(\n new ScenegraphLayer({\n id: 'models-' + model['@id'],\n opacity: model.zoomBasedOpacity ? state.zoomOpacity : (model.opacity !== undefined ? model.opacity : 1.0),\n pickable: !model.unpickable,\n coordinateSystem: COORDINATE_SYSTEM.CARTESIAN,\n data: [model],\n scenegraph: model.scenegraphNode ?\n loadGLTF2(model.scenegraphNode, url2gltf[model.scenegraph as string]) :\n model.scenegraph as unknown as URL,\n // eslint-disable-next-line @typescript-eslint/naming-convention\n _lighting: model._lighting, // 'pbr' | undefined\n getTransformMatrix: model.transformMatrix as unknown as number[][],\n getColor: model.color ?? [0, 255, 0, 0.5*255],\n parameters: { depthMask: !model.zoomBasedOpacity && (model.opacity === undefined || model.opacity === 1) }\n })\n );\n }\n } else if (geometry === 'text') {\n layers.push(textLayer('text', nodes.filter(n => n.unpickable), { pickable: false }));\n layers.push(textLayer('textPickable', nodes.filter(n => !n.unpickable), { pickable: true }));\n } else if (geometry === 'wireframe') {\n layers.push(meshLayer(geometry, nodes, { wireframe: true, pickable: false, geometry }));\n } else {\n layers.push(meshLayer(geometry, nodes.filter(n => n.unpickable), { wireframe: false, pickable: false, geometry }));\n layers.push(meshLayer(`${geometry}Pickable`, nodes.filter(n => !n.unpickable), { wireframe: false, pickable: true, geometry }));\n }\n }\n\n if (state.doCollisions) {\n doCollisions(state.data);\n }\n\n return layers.filter(l => !!l);\n }\n\n getPickingInfo(\n e: Parameters['getPickingInfo']>[0]\n ): ReturnType['getPickingInfo']> {\n return e.info;\n }\n}\n\n \n\n\n\n\n \n\n\n\n\n \n \n result-matching \"\"\n \n \n \n No results matching \"\"\n \n\n"},"interfaces/BodyUIProps.html":{"url":"interfaces/BodyUIProps.html","title":"interface - BodyUIProps","body":"\n \n\n\n\n\n\n\n\n\n\n\n\n\n\n Interfaces\n \n BodyUIProps\n\n\n\n \n Info\n \n \n Source\n \n\n\n\n \n \n File\n \n \n projects/ccf-body-ui/src/lib/body-ui.ts\n \n\n\n\n\n \n Index\n \n \n \n \n Properties\n \n \n \n \n \n \n \n camera\n \n \n \n \n canvas\n \n \n \n Optional\n \n debugSceneNodeProcessing\n \n \n \n \n id\n \n \n \n \n interactive\n \n \n \n Optional\n \n legacyLighting\n \n \n \n \n maxRotationX\n \n \n \n \n minRotationX\n \n \n \n \n parent\n \n \n \n \n rotation\n \n \n \n \n target\n \n \n \n \n zoom\n \n \n \n \n \n \n \n \n\n\n\n \n Properties\n \n \n \n \n \n camera\n \n \n \n \n \n \n \n \n camera: string\n\n \n \n\n\n \n \n Type : string\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n canvas\n \n \n \n \n \n \n \n \n canvas: string | HTMLCanvasElement\n\n \n \n\n\n \n \n Type : string | HTMLCanvasElement\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n debugSceneNodeProcessing\n \n \n \n \n \n \n \n \n debugSceneNodeProcessing: boolean\n\n \n \n\n\n \n \n Type : boolean\n\n \n \n\n \n \n Optional\n \n \n\n\n\n\n \n \n \n \n \n \n \n id\n \n \n \n \n \n \n \n \n id: string\n\n \n \n\n\n \n \n Type : string\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n interactive\n \n \n \n \n \n \n \n \n interactive: boolean\n\n \n \n\n\n \n \n Type : boolean\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n legacyLighting\n \n \n \n \n \n \n \n \n legacyLighting: boolean\n\n \n \n\n\n \n \n Type : boolean\n\n \n \n\n \n \n Optional\n \n \n\n\n\n\n \n \n \n \n \n \n \n maxRotationX\n \n \n \n \n \n \n \n \n maxRotationX: number\n\n \n \n\n\n \n \n Type : number\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n minRotationX\n \n \n \n \n \n \n \n \n minRotationX: number\n\n \n \n\n\n \n \n Type : number\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n parent\n \n \n \n \n \n \n \n \n parent: HTMLElement\n\n \n \n\n\n \n \n Type : HTMLElement\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n rotation\n \n \n \n \n \n \n \n \n rotation: number\n\n \n \n\n\n \n \n Type : number\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n target\n \n \n \n \n \n \n \n \n target: Matrix4 | number[]\n\n \n \n\n\n \n \n Type : Matrix4 | number[]\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n zoom\n \n \n \n \n \n \n \n \n zoom: number\n\n \n \n\n\n \n \n Type : number\n\n \n \n\n\n\n\n\n \n \n \n \n\n\n \n import { AmbientLight, Deck, LightingEffect, OrbitView, OrthographicView } from '@deck.gl/core';\nimport { ViewStateProps } from '@deck.gl/core/lib/deck';\nimport { Matrix4 } from '@math.gl/core';\nimport bind from 'bind-decorator';\nimport { BehaviorSubject, Subject } from 'rxjs';\nimport { share } from 'rxjs/operators';\n\nimport { BodyUILayer } from './body-ui-layer';\nimport { SpatialSceneNode } from './shared/spatial-scene-node';\nimport { processSceneNodes } from './util/process-scene-nodes';\n\n\ninterface BodyUIViewStateProps extends ViewStateProps {\n orbitAxis?: string;\n target?: Matrix4 | number[];\n zoom: number;\n rotationOrbit: number;\n rotationX: number;\n camera: string;\n}\n\nexport interface BodyUIProps {\n id: string;\n canvas: string | HTMLCanvasElement;\n parent: HTMLElement;\n debugSceneNodeProcessing?: boolean;\n target: Matrix4 | number[];\n interactive: boolean;\n rotation: number;\n minRotationX: number;\n maxRotationX: number;\n zoom: number;\n legacyLighting?: boolean;\n camera: string;\n}\n\nexport interface PickInfo {\n layer: unknown;\n index: number;\n object: D;\n x: number;\n y: number;\n coordinate?: unknown;\n picked?: boolean;\n}\n\nexport type NodeDragEvent = { node: SpatialSceneNode; info: PickInfo; e: MouseEvent };\n\nexport type NodeClickEvent = { node: SpatialSceneNode; ctrlClick: boolean };\n\n/**\n * A convenience wrapper class for the CCF Body UI\n */\nexport class BodyUI {\n deck: Deck;\n private readonly bodyUILayer = new BodyUILayer({});\n\n private readonly nodeClickSubject = new Subject();\n private readonly nodeHoverStartSubject = new Subject();\n private readonly nodeHoverStopSubject = new Subject();\n private readonly sceneRotationSubject = new BehaviorSubject([0, 0]);\n private readonly nodeDragStartSubject = new Subject();\n private readonly nodeDragSubject = new Subject();\n private readonly nodeDragEndSubject = new Subject();\n\n readonly nodeClick$ = this.nodeClickSubject.pipe(share());\n readonly nodeHoverStart$ = this.nodeHoverStartSubject.pipe(share());\n readonly nodeHoverStop$ = this.nodeHoverStopSubject.pipe(share());\n readonly sceneRotation$ = this.sceneRotationSubject.pipe(share());\n readonly nodeDragStart$ = this.nodeDragStartSubject.pipe(share());\n readonly nodeDrag$ = this.nodeDragSubject.pipe(share());\n readonly nodeDragEnd$ = this.nodeDragEndSubject.pipe(share());\n\n private cursor?: string;\n private lastHovered?: SpatialSceneNode;\n\n constructor(private deckProps: Partial) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const props: any = {\n ...deckProps,\n views: [ deckProps.camera === 'orthographic' ? new OrthographicView({\n flipY: false,\n near: -1000\n }) : new OrbitView({ orbitAxis: 'Y' }) ],\n controller: deckProps.interactive !== undefined ? deckProps.interactive : true,\n layers: [ this.bodyUILayer ],\n onHover: this._onHover,\n onClick: this._onClick,\n onViewStateChange: this._onViewStateChange,\n onDragStart: this._onDragStart,\n onDrag: this._onDrag,\n onDragEnd: this._onDragEnd,\n getCursor: (e: { isDragging: boolean }) => this.cursor ?? (e.isDragging ? 'grabbing' : 'grab')\n };\n if (deckProps.legacyLighting) {\n // eslint-disable-next-line\n props.effects = [\n new LightingEffect({\n ambientLight: new AmbientLight({\n color: [255, 255, 255],\n intensity: 10.0\n })\n })\n ];\n }\n // eslint-disable-next-line\n this.deck = new Deck(props);\n this.deck.setProps({\n viewState: {\n orbitAxis: 'Y',\n minRotationX: deckProps.minRotationX ?? -15,\n maxRotationX: deckProps.maxRotationX ?? 15,\n target: deckProps.target ?? [0.5, 0.5, 0],\n rotationX: 0,\n rotationOrbit: deckProps.rotation ?? 0,\n zoom: deckProps.zoom ?? 9.5,\n camera: deckProps.camera\n } as BodyUIViewStateProps\n });\n if (deckProps.rotation) {\n this.sceneRotationSubject.next([deckProps.rotation, 0]);\n }\n }\n\n async initialize(): Promise {\n while (!this.bodyUILayer.state) {\n // eslint-disable-next-line no-await-in-loop\n await new Promise(r => {\n setTimeout(r, 200);\n });\n }\n }\n\n finalize(): void {\n this.deck.finalize();\n }\n\n setScene(data: SpatialSceneNode[]): void {\n if (data?.length > 0) {\n let zoomOpacity = (this.bodyUILayer.state as { zoomOpacity: number }).zoomOpacity;\n let didZoom = false;\n for (const node of data) {\n if (node.zoomToOnLoad) {\n this.zoomTo(node);\n didZoom = true;\n }\n }\n zoomOpacity = didZoom ? 0.05 : zoomOpacity;\n if (!this.deckProps.debugSceneNodeProcessing) {\n this.bodyUILayer.setState({ data, zoomOpacity });\n } else {\n this.debugSceneNodeProcessing(data, zoomOpacity);\n }\n }\n }\n\n debugSceneNodeProcessing(data: SpatialSceneNode[], zoomOpacity: number): void {\n // const gltfUrl = 'https://hubmapconsortium.github.io/ccf-3d-reference-object-library/VH_Male/United/VHM_United_Color.glb';\n const gltfUrl = 'https://hubmapconsortium.github.io/ccf-3d-reference-object-library/VH_Female/United/VHF_United_Color.glb';\n // const gltfUrl = 'https://hubmapconsortium.github.io/hubmap-ontology/objects/VHF_United_v01_060420.glb';\n const gltfTransform = new Matrix4([0.076,0,0,0,0,0.076,1.6875389974302382e-17,0,0,-1.6875389974302382e-17,0.076,0,0.49,0.034,0.11,1]);\n processSceneNodes(gltfUrl, gltfTransform, 'VHF_Kidney_L_Low1').then((results) => {\n console.log('results', results);\n console.log('data', data);\n // data = Object.values(results);\n data = data.concat(Object.values(results));\n data.push({\n '@id': 'TEST',\n '@type': 'TEST',\n scenegraph: gltfUrl,\n scenegraphNode: 'VHF_Kidney_R_Low',\n transformMatrix: gltfTransform,\n color: [255, 255, 255, 200],\n // eslint-disable-next-line @typescript-eslint/naming-convention\n _lighting: 'pbr',\n zoomBasedOpacity: false\n });\n this.bodyUILayer.setState({ data, zoomOpacity });\n });\n }\n\n zoomTo(node: SpatialSceneNode): void {\n const matrix = new Matrix4(node.transformMatrix);\n this.deck.setProps({\n viewState: {\n ...this.deck.props.viewState,\n target: matrix.getTranslation(),\n rotationX: 0,\n rotationOrbit: 0,\n zoom: 11.5,\n } as BodyUIViewStateProps\n });\n }\n\n setRotation(value: number): void {\n this.deck.setProps({\n viewState: {\n ...this.deck.props.viewState,\n rotationOrbit: value\n } as BodyUIViewStateProps\n });\n }\n\n setRotationX(value: number): void {\n this.deck.setProps({\n viewState: {\n ...this.deck.props.viewState,\n rotationX: value\n } as BodyUIViewStateProps\n });\n }\n\n setZoom(value: number): void {\n this.deck.setProps({\n viewState: {\n ...this.deck.props.viewState,\n zoom: value\n } as BodyUIViewStateProps\n });\n }\n\n setTarget(value: number[]): void {\n this.deck.setProps({\n viewState: {\n ...this.deck.props.viewState,\n target: value\n } as BodyUIViewStateProps\n });\n }\n\n setInteractive(value: boolean): void {\n this.deck.setProps({\n controller: value\n });\n }\n\n @bind\n private _onHover(e: { picked: boolean; object: SpatialSceneNode }): void {\n const { lastHovered } = this;\n this.cursor = e.picked ? 'pointer' : undefined;\n if (e.picked && e.object && e.object['@id']) {\n if (lastHovered !== e.object) {\n if (lastHovered) {\n this.nodeHoverStopSubject.next(lastHovered);\n }\n this.lastHovered = e.object;\n this.nodeHoverStartSubject.next(e.object);\n }\n } else if (lastHovered) {\n this.nodeHoverStopSubject.next(lastHovered);\n this.lastHovered = undefined;\n }\n }\n\n @bind\n private _onClick(info: PickInfo, e: { srcEvent: { ctrlKey: boolean } }): void {\n if (info.picked && info.object && info.object['@id']) {\n this.nodeClickSubject.next({ node: info.object, ctrlClick: e?.srcEvent?.ctrlKey ?? undefined });\n }\n }\n\n @bind\n private _onViewStateChange(event: { interactionState: { isZooming: boolean }; viewState: BodyUIViewStateProps }): void {\n if (event.interactionState?.isZooming) {\n const currentState = this.bodyUILayer.state as { zoomOpacity: number; data: unknown };\n const zoomOpacity = Math.min(Math.max(1 - (event.viewState.zoom - 8.9) / 2, 0.05), 1.0);\n if (currentState.zoomOpacity !== zoomOpacity) {\n this.bodyUILayer.setState({ data: currentState.data, zoomOpacity });\n }\n }\n this.deck.setProps({ viewState: { ...event.viewState } });\n this.sceneRotationSubject.next([event.viewState.rotationOrbit, event.viewState.rotationX]);\n }\n\n @bind\n private _onDragStart(info: PickInfo, e: MouseEvent): void {\n this._dragEvent(info, e, this.nodeDragStartSubject);\n }\n\n @bind\n private _onDrag(info: PickInfo, e: MouseEvent): void {\n this._dragEvent(info, e, this.nodeDragSubject);\n }\n\n @bind\n private _onDragEnd(info: PickInfo, e: MouseEvent): void {\n this._dragEvent(info, e, this.nodeDragEndSubject);\n }\n\n private _dragEvent(info: PickInfo, e: MouseEvent, subject: Subject): void {\n if (info?.object?.['@id']) {\n subject.next({ node: info.object, info, e });\n }\n }\n}\n\n \n\n\n\n \n\n\n\n\n \n \n result-matching \"\"\n \n \n \n No results matching \"\"\n \n\n"},"interfaces/BodyUIViewStateProps.html":{"url":"interfaces/BodyUIViewStateProps.html","title":"interface - BodyUIViewStateProps","body":"\n \n\n\n\n\n\n\n\n\n\n\n\n\n\n Interfaces\n \n BodyUIViewStateProps\n\n\n\n \n Info\n \n \n Source\n \n\n\n\n \n \n File\n \n \n projects/ccf-body-ui/src/lib/body-ui.ts\n \n\n\n\n \n Extends\n \n \n ViewStateProps\n \n\n \n Index\n \n \n \n \n Properties\n \n \n \n \n \n \n \n camera\n \n \n \n Optional\n \n orbitAxis\n \n \n \n \n rotationOrbit\n \n \n \n \n rotationX\n \n \n \n Optional\n \n target\n \n \n \n \n zoom\n \n \n \n \n \n \n \n \n\n\n\n \n Properties\n \n \n \n \n \n camera\n \n \n \n \n \n \n \n \n camera: string\n\n \n \n\n\n \n \n Type : string\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n orbitAxis\n \n \n \n \n \n \n \n \n orbitAxis: string\n\n \n \n\n\n \n \n Type : string\n\n \n \n\n \n \n Optional\n \n \n\n\n\n\n \n \n \n \n \n \n \n rotationOrbit\n \n \n \n \n \n \n \n \n rotationOrbit: number\n\n \n \n\n\n \n \n Type : number\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n rotationX\n \n \n \n \n \n \n \n \n rotationX: number\n\n \n \n\n\n \n \n Type : number\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n target\n \n \n \n \n \n \n \n \n target: Matrix4 | number[]\n\n \n \n\n\n \n \n Type : Matrix4 | number[]\n\n \n \n\n \n \n Optional\n \n \n\n\n\n\n \n \n \n \n \n \n \n zoom\n \n \n \n \n \n \n \n \n zoom: number\n\n \n \n\n\n \n \n Type : number\n\n \n \n\n\n\n\n\n \n \n \n \n\n\n \n import { AmbientLight, Deck, LightingEffect, OrbitView, OrthographicView } from '@deck.gl/core';\nimport { ViewStateProps } from '@deck.gl/core/lib/deck';\nimport { Matrix4 } from '@math.gl/core';\nimport bind from 'bind-decorator';\nimport { BehaviorSubject, Subject } from 'rxjs';\nimport { share } from 'rxjs/operators';\n\nimport { BodyUILayer } from './body-ui-layer';\nimport { SpatialSceneNode } from './shared/spatial-scene-node';\nimport { processSceneNodes } from './util/process-scene-nodes';\n\n\ninterface BodyUIViewStateProps extends ViewStateProps {\n orbitAxis?: string;\n target?: Matrix4 | number[];\n zoom: number;\n rotationOrbit: number;\n rotationX: number;\n camera: string;\n}\n\nexport interface BodyUIProps {\n id: string;\n canvas: string | HTMLCanvasElement;\n parent: HTMLElement;\n debugSceneNodeProcessing?: boolean;\n target: Matrix4 | number[];\n interactive: boolean;\n rotation: number;\n minRotationX: number;\n maxRotationX: number;\n zoom: number;\n legacyLighting?: boolean;\n camera: string;\n}\n\nexport interface PickInfo {\n layer: unknown;\n index: number;\n object: D;\n x: number;\n y: number;\n coordinate?: unknown;\n picked?: boolean;\n}\n\nexport type NodeDragEvent = { node: SpatialSceneNode; info: PickInfo; e: MouseEvent };\n\nexport type NodeClickEvent = { node: SpatialSceneNode; ctrlClick: boolean };\n\n/**\n * A convenience wrapper class for the CCF Body UI\n */\nexport class BodyUI {\n deck: Deck;\n private readonly bodyUILayer = new BodyUILayer({});\n\n private readonly nodeClickSubject = new Subject();\n private readonly nodeHoverStartSubject = new Subject();\n private readonly nodeHoverStopSubject = new Subject();\n private readonly sceneRotationSubject = new BehaviorSubject([0, 0]);\n private readonly nodeDragStartSubject = new Subject();\n private readonly nodeDragSubject = new Subject();\n private readonly nodeDragEndSubject = new Subject();\n\n readonly nodeClick$ = this.nodeClickSubject.pipe(share());\n readonly nodeHoverStart$ = this.nodeHoverStartSubject.pipe(share());\n readonly nodeHoverStop$ = this.nodeHoverStopSubject.pipe(share());\n readonly sceneRotation$ = this.sceneRotationSubject.pipe(share());\n readonly nodeDragStart$ = this.nodeDragStartSubject.pipe(share());\n readonly nodeDrag$ = this.nodeDragSubject.pipe(share());\n readonly nodeDragEnd$ = this.nodeDragEndSubject.pipe(share());\n\n private cursor?: string;\n private lastHovered?: SpatialSceneNode;\n\n constructor(private deckProps: Partial) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const props: any = {\n ...deckProps,\n views: [ deckProps.camera === 'orthographic' ? new OrthographicView({\n flipY: false,\n near: -1000\n }) : new OrbitView({ orbitAxis: 'Y' }) ],\n controller: deckProps.interactive !== undefined ? deckProps.interactive : true,\n layers: [ this.bodyUILayer ],\n onHover: this._onHover,\n onClick: this._onClick,\n onViewStateChange: this._onViewStateChange,\n onDragStart: this._onDragStart,\n onDrag: this._onDrag,\n onDragEnd: this._onDragEnd,\n getCursor: (e: { isDragging: boolean }) => this.cursor ?? (e.isDragging ? 'grabbing' : 'grab')\n };\n if (deckProps.legacyLighting) {\n // eslint-disable-next-line\n props.effects = [\n new LightingEffect({\n ambientLight: new AmbientLight({\n color: [255, 255, 255],\n intensity: 10.0\n })\n })\n ];\n }\n // eslint-disable-next-line\n this.deck = new Deck(props);\n this.deck.setProps({\n viewState: {\n orbitAxis: 'Y',\n minRotationX: deckProps.minRotationX ?? -15,\n maxRotationX: deckProps.maxRotationX ?? 15,\n target: deckProps.target ?? [0.5, 0.5, 0],\n rotationX: 0,\n rotationOrbit: deckProps.rotation ?? 0,\n zoom: deckProps.zoom ?? 9.5,\n camera: deckProps.camera\n } as BodyUIViewStateProps\n });\n if (deckProps.rotation) {\n this.sceneRotationSubject.next([deckProps.rotation, 0]);\n }\n }\n\n async initialize(): Promise {\n while (!this.bodyUILayer.state) {\n // eslint-disable-next-line no-await-in-loop\n await new Promise(r => {\n setTimeout(r, 200);\n });\n }\n }\n\n finalize(): void {\n this.deck.finalize();\n }\n\n setScene(data: SpatialSceneNode[]): void {\n if (data?.length > 0) {\n let zoomOpacity = (this.bodyUILayer.state as { zoomOpacity: number }).zoomOpacity;\n let didZoom = false;\n for (const node of data) {\n if (node.zoomToOnLoad) {\n this.zoomTo(node);\n didZoom = true;\n }\n }\n zoomOpacity = didZoom ? 0.05 : zoomOpacity;\n if (!this.deckProps.debugSceneNodeProcessing) {\n this.bodyUILayer.setState({ data, zoomOpacity });\n } else {\n this.debugSceneNodeProcessing(data, zoomOpacity);\n }\n }\n }\n\n debugSceneNodeProcessing(data: SpatialSceneNode[], zoomOpacity: number): void {\n // const gltfUrl = 'https://hubmapconsortium.github.io/ccf-3d-reference-object-library/VH_Male/United/VHM_United_Color.glb';\n const gltfUrl = 'https://hubmapconsortium.github.io/ccf-3d-reference-object-library/VH_Female/United/VHF_United_Color.glb';\n // const gltfUrl = 'https://hubmapconsortium.github.io/hubmap-ontology/objects/VHF_United_v01_060420.glb';\n const gltfTransform = new Matrix4([0.076,0,0,0,0,0.076,1.6875389974302382e-17,0,0,-1.6875389974302382e-17,0.076,0,0.49,0.034,0.11,1]);\n processSceneNodes(gltfUrl, gltfTransform, 'VHF_Kidney_L_Low1').then((results) => {\n console.log('results', results);\n console.log('data', data);\n // data = Object.values(results);\n data = data.concat(Object.values(results));\n data.push({\n '@id': 'TEST',\n '@type': 'TEST',\n scenegraph: gltfUrl,\n scenegraphNode: 'VHF_Kidney_R_Low',\n transformMatrix: gltfTransform,\n color: [255, 255, 255, 200],\n // eslint-disable-next-line @typescript-eslint/naming-convention\n _lighting: 'pbr',\n zoomBasedOpacity: false\n });\n this.bodyUILayer.setState({ data, zoomOpacity });\n });\n }\n\n zoomTo(node: SpatialSceneNode): void {\n const matrix = new Matrix4(node.transformMatrix);\n this.deck.setProps({\n viewState: {\n ...this.deck.props.viewState,\n target: matrix.getTranslation(),\n rotationX: 0,\n rotationOrbit: 0,\n zoom: 11.5,\n } as BodyUIViewStateProps\n });\n }\n\n setRotation(value: number): void {\n this.deck.setProps({\n viewState: {\n ...this.deck.props.viewState,\n rotationOrbit: value\n } as BodyUIViewStateProps\n });\n }\n\n setRotationX(value: number): void {\n this.deck.setProps({\n viewState: {\n ...this.deck.props.viewState,\n rotationX: value\n } as BodyUIViewStateProps\n });\n }\n\n setZoom(value: number): void {\n this.deck.setProps({\n viewState: {\n ...this.deck.props.viewState,\n zoom: value\n } as BodyUIViewStateProps\n });\n }\n\n setTarget(value: number[]): void {\n this.deck.setProps({\n viewState: {\n ...this.deck.props.viewState,\n target: value\n } as BodyUIViewStateProps\n });\n }\n\n setInteractive(value: boolean): void {\n this.deck.setProps({\n controller: value\n });\n }\n\n @bind\n private _onHover(e: { picked: boolean; object: SpatialSceneNode }): void {\n const { lastHovered } = this;\n this.cursor = e.picked ? 'pointer' : undefined;\n if (e.picked && e.object && e.object['@id']) {\n if (lastHovered !== e.object) {\n if (lastHovered) {\n this.nodeHoverStopSubject.next(lastHovered);\n }\n this.lastHovered = e.object;\n this.nodeHoverStartSubject.next(e.object);\n }\n } else if (lastHovered) {\n this.nodeHoverStopSubject.next(lastHovered);\n this.lastHovered = undefined;\n }\n }\n\n @bind\n private _onClick(info: PickInfo, e: { srcEvent: { ctrlKey: boolean } }): void {\n if (info.picked && info.object && info.object['@id']) {\n this.nodeClickSubject.next({ node: info.object, ctrlClick: e?.srcEvent?.ctrlKey ?? undefined });\n }\n }\n\n @bind\n private _onViewStateChange(event: { interactionState: { isZooming: boolean }; viewState: BodyUIViewStateProps }): void {\n if (event.interactionState?.isZooming) {\n const currentState = this.bodyUILayer.state as { zoomOpacity: number; data: unknown };\n const zoomOpacity = Math.min(Math.max(1 - (event.viewState.zoom - 8.9) / 2, 0.05), 1.0);\n if (currentState.zoomOpacity !== zoomOpacity) {\n this.bodyUILayer.setState({ data: currentState.data, zoomOpacity });\n }\n }\n this.deck.setProps({ viewState: { ...event.viewState } });\n this.sceneRotationSubject.next([event.viewState.rotationOrbit, event.viewState.rotationX]);\n }\n\n @bind\n private _onDragStart(info: PickInfo, e: MouseEvent): void {\n this._dragEvent(info, e, this.nodeDragStartSubject);\n }\n\n @bind\n private _onDrag(info: PickInfo, e: MouseEvent): void {\n this._dragEvent(info, e, this.nodeDragSubject);\n }\n\n @bind\n private _onDragEnd(info: PickInfo, e: MouseEvent): void {\n this._dragEvent(info, e, this.nodeDragEndSubject);\n }\n\n private _dragEvent(info: PickInfo, e: MouseEvent, subject: Subject): void {\n if (info?.object?.['@id']) {\n subject.next({ node: info.object, info, e });\n }\n }\n}\n\n \n\n\n\n \n\n\n\n\n \n \n result-matching \"\"\n \n \n \n No results matching \"\"\n \n\n"},"interfaces/Collision.html":{"url":"interfaces/Collision.html","title":"interface - Collision","body":"\n \n\n\n\n\n\n\n\n\n\n\n\n\n\n Interfaces\n \n Collision\n\n\n\n \n Info\n \n \n Source\n \n\n\n\n \n \n File\n \n \n projects/ccf-body-ui/src/lib/util/spatial-scene-collider.ts\n \n\n\n\n\n \n Index\n \n \n \n \n Properties\n \n \n \n \n \n \n \n @id\n \n \n \n \n hits\n \n \n \n \n name\n \n \n \n \n \n \n \n \n\n\n\n \n Properties\n \n \n \n \n \n @id\n \n \n \n \n \n \n \n \n @id: string\n\n \n \n\n\n \n \n Type : string\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n hits\n \n \n \n \n \n \n \n \n hits: literal type[]\n\n \n \n\n\n \n \n Type : literal type[]\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n name\n \n \n \n \n \n \n \n \n name: string\n\n \n \n\n\n \n \n Type : string\n\n \n \n\n\n\n\n\n \n \n \n \n\n\n \n import { load } from '@loaders.gl/core';\nimport { DracoLoader } from '@loaders.gl/draco';\nimport { GLTFLoader } from '@loaders.gl/gltf';\nimport { Matrix4 } from '@math.gl/core';\nimport { AABB, Vec3 } from 'cannon-es';\n\nimport { SpatialSceneNode } from '../shared/spatial-scene-node';\nimport { traverseScene } from './scene-traversal';\n\n\ninterface Collision {\n '@id': string;\n name: string;\n hits: { '@id': string; name: string }[];\n}\n\n/* eslint-disable */\nexport async function doCollisions(scene: SpatialSceneNode[]): Promise {\n console.log('Starting Collisioning');\n const sourceBoxes = scene\n .filter(d => !d.scenegraph && d.geometry !== 'wireframe')\n .map(model => {\n const mat = new Matrix4(model.transformMatrix);\n const lowerBound = mat.transformAsPoint([-1, -1, -1], []);\n const upperBound = mat.transformAsPoint([1, 1, 1], []);\n return {\n '@id': model['@id'],\n name: model.tooltip,\n entityId: model.entityId,\n bbox: new AABB({\n lowerBound: new Vec3(...lowerBound.map((n, i) => Math.min(n, upperBound[i]))),\n upperBound: new Vec3(...upperBound.map((n, i) => Math.max(n, lowerBound[i])))\n })\n };\n });\n\n const targetBoxes: {'@id': string, name: string, entityId?: string; bbox: AABB, gltf: unknown}[] = [];\n for (const model of scene.filter(d => !!d.scenegraph)) {\n const gltf = await load(model.scenegraph as string, GLTFLoader, {DracoLoader, decompress: true, postProcess: true});\n for (const gltfScene of gltf.scenes) {\n traverseScene(gltfScene, new Matrix4(model.transformMatrix), (node, modelMatrix) => {\n if (node.mesh && node.mesh.primitives && node.mesh.primitives.length > 0) {\n for (const primitive of node.mesh.primitives) {\n if (primitive.attributes.POSITION && primitive.attributes.POSITION.min) {\n const lowerBound = modelMatrix.transformAsPoint(primitive.attributes.POSITION.min, []);\n const upperBound = modelMatrix.transformAsPoint(primitive.attributes.POSITION.max, []);\n targetBoxes.push({\n '@id': model['@id'],\n name: node.name,\n entityId: model.entityId,\n bbox: new AABB({\n lowerBound: new Vec3(...lowerBound.map((n, i) => Math.min(n, upperBound[i]))),\n upperBound: new Vec3(...upperBound.map((n, i) => Math.max(n, lowerBound[i])))\n }),\n gltf\n });\n }\n }\n }\n return true;\n });\n }\n }\n\n const report: Collision[] = [];\n const sad: unknown[] = [];\n for (const src of sourceBoxes) {\n const hits: {'@id': string, name: string}[] = [];\n for (const target of targetBoxes) {\n if (src.bbox.overlaps(target.bbox)) {\n hits.push({'@id': target['@id'], name: target.name});\n }\n }\n if (hits.length > 0) {\n report.push({\n '@id': src.entityId as string,\n name: src.name as string,\n hits\n });\n } else {\n sad.push(src);\n }\n }\n\n console.log({ sourceBoxes, targetBoxes, report, sad, maxHits: Math.max(...report.map(r => r.hits.length)) });\n\n const csvReport: unknown[] = [];\n for (const hit of report) {\n csvReport.push({\n 'Tissue ID': hit['@id'],\n 'Tissue Name': hit.name,\n 'Hit ID': '',\n 'Hit Name': ''\n });\n for (const h of hit.hits) {\n csvReport.push({\n 'Tissue ID': hit['@id'],\n 'Tissue Name': hit.name,\n 'Hit ID': h['@id'],\n 'Hit Name': h.name\n });\n }\n }\n console.log(csvReport);\n\n return report;\n}\n/* eslint-enable */\n\n \n\n\n\n \n\n\n\n\n \n \n result-matching \"\"\n \n \n \n No results matching \"\"\n \n\n"},"interfaces/PickInfo.html":{"url":"interfaces/PickInfo.html","title":"interface - PickInfo","body":"\n \n\n\n\n\n\n\n\n\n\n\n\n\n\n Interfaces\n \n PickInfo\n\n\n\n \n Info\n \n \n Source\n \n\n\n\n \n \n File\n \n \n projects/ccf-body-ui/src/lib/body-ui.ts\n \n\n\n\n\n \n Index\n \n \n \n \n Properties\n \n \n \n \n \n \n Optional\n \n coordinate\n \n \n \n \n index\n \n \n \n \n layer\n \n \n \n \n object\n \n \n \n Optional\n \n picked\n \n \n \n \n x\n \n \n \n \n y\n \n \n \n \n \n \n \n \n\n\n\n \n Properties\n \n \n \n \n \n coordinate\n \n \n \n \n \n \n \n \n coordinate: \n\n \n \n\n\n\n \n \n Optional\n \n \n\n\n\n\n \n \n \n \n \n \n \n index\n \n \n \n \n \n \n \n \n index: number\n\n \n \n\n\n \n \n Type : number\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n layer\n \n \n \n \n \n \n \n \n layer: \n\n \n \n\n\n\n\n\n\n\n \n \n \n \n \n \n \n object\n \n \n \n \n \n \n \n \n object: D\n\n \n \n\n\n \n \n Type : D\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n picked\n \n \n \n \n \n \n \n \n picked: boolean\n\n \n \n\n\n \n \n Type : boolean\n\n \n \n\n \n \n Optional\n \n \n\n\n\n\n \n \n \n \n \n \n \n x\n \n \n \n \n \n \n \n \n x: number\n\n \n \n\n\n \n \n Type : number\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n y\n \n \n \n \n \n \n \n \n y: number\n\n \n \n\n\n \n \n Type : number\n\n \n \n\n\n\n\n\n \n \n \n \n\n\n \n import { AmbientLight, Deck, LightingEffect, OrbitView, OrthographicView } from '@deck.gl/core';\nimport { ViewStateProps } from '@deck.gl/core/lib/deck';\nimport { Matrix4 } from '@math.gl/core';\nimport bind from 'bind-decorator';\nimport { BehaviorSubject, Subject } from 'rxjs';\nimport { share } from 'rxjs/operators';\n\nimport { BodyUILayer } from './body-ui-layer';\nimport { SpatialSceneNode } from './shared/spatial-scene-node';\nimport { processSceneNodes } from './util/process-scene-nodes';\n\n\ninterface BodyUIViewStateProps extends ViewStateProps {\n orbitAxis?: string;\n target?: Matrix4 | number[];\n zoom: number;\n rotationOrbit: number;\n rotationX: number;\n camera: string;\n}\n\nexport interface BodyUIProps {\n id: string;\n canvas: string | HTMLCanvasElement;\n parent: HTMLElement;\n debugSceneNodeProcessing?: boolean;\n target: Matrix4 | number[];\n interactive: boolean;\n rotation: number;\n minRotationX: number;\n maxRotationX: number;\n zoom: number;\n legacyLighting?: boolean;\n camera: string;\n}\n\nexport interface PickInfo {\n layer: unknown;\n index: number;\n object: D;\n x: number;\n y: number;\n coordinate?: unknown;\n picked?: boolean;\n}\n\nexport type NodeDragEvent = { node: SpatialSceneNode; info: PickInfo; e: MouseEvent };\n\nexport type NodeClickEvent = { node: SpatialSceneNode; ctrlClick: boolean };\n\n/**\n * A convenience wrapper class for the CCF Body UI\n */\nexport class BodyUI {\n deck: Deck;\n private readonly bodyUILayer = new BodyUILayer({});\n\n private readonly nodeClickSubject = new Subject();\n private readonly nodeHoverStartSubject = new Subject();\n private readonly nodeHoverStopSubject = new Subject();\n private readonly sceneRotationSubject = new BehaviorSubject([0, 0]);\n private readonly nodeDragStartSubject = new Subject();\n private readonly nodeDragSubject = new Subject();\n private readonly nodeDragEndSubject = new Subject();\n\n readonly nodeClick$ = this.nodeClickSubject.pipe(share());\n readonly nodeHoverStart$ = this.nodeHoverStartSubject.pipe(share());\n readonly nodeHoverStop$ = this.nodeHoverStopSubject.pipe(share());\n readonly sceneRotation$ = this.sceneRotationSubject.pipe(share());\n readonly nodeDragStart$ = this.nodeDragStartSubject.pipe(share());\n readonly nodeDrag$ = this.nodeDragSubject.pipe(share());\n readonly nodeDragEnd$ = this.nodeDragEndSubject.pipe(share());\n\n private cursor?: string;\n private lastHovered?: SpatialSceneNode;\n\n constructor(private deckProps: Partial) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const props: any = {\n ...deckProps,\n views: [ deckProps.camera === 'orthographic' ? new OrthographicView({\n flipY: false,\n near: -1000\n }) : new OrbitView({ orbitAxis: 'Y' }) ],\n controller: deckProps.interactive !== undefined ? deckProps.interactive : true,\n layers: [ this.bodyUILayer ],\n onHover: this._onHover,\n onClick: this._onClick,\n onViewStateChange: this._onViewStateChange,\n onDragStart: this._onDragStart,\n onDrag: this._onDrag,\n onDragEnd: this._onDragEnd,\n getCursor: (e: { isDragging: boolean }) => this.cursor ?? (e.isDragging ? 'grabbing' : 'grab')\n };\n if (deckProps.legacyLighting) {\n // eslint-disable-next-line\n props.effects = [\n new LightingEffect({\n ambientLight: new AmbientLight({\n color: [255, 255, 255],\n intensity: 10.0\n })\n })\n ];\n }\n // eslint-disable-next-line\n this.deck = new Deck(props);\n this.deck.setProps({\n viewState: {\n orbitAxis: 'Y',\n minRotationX: deckProps.minRotationX ?? -15,\n maxRotationX: deckProps.maxRotationX ?? 15,\n target: deckProps.target ?? [0.5, 0.5, 0],\n rotationX: 0,\n rotationOrbit: deckProps.rotation ?? 0,\n zoom: deckProps.zoom ?? 9.5,\n camera: deckProps.camera\n } as BodyUIViewStateProps\n });\n if (deckProps.rotation) {\n this.sceneRotationSubject.next([deckProps.rotation, 0]);\n }\n }\n\n async initialize(): Promise {\n while (!this.bodyUILayer.state) {\n // eslint-disable-next-line no-await-in-loop\n await new Promise(r => {\n setTimeout(r, 200);\n });\n }\n }\n\n finalize(): void {\n this.deck.finalize();\n }\n\n setScene(data: SpatialSceneNode[]): void {\n if (data?.length > 0) {\n let zoomOpacity = (this.bodyUILayer.state as { zoomOpacity: number }).zoomOpacity;\n let didZoom = false;\n for (const node of data) {\n if (node.zoomToOnLoad) {\n this.zoomTo(node);\n didZoom = true;\n }\n }\n zoomOpacity = didZoom ? 0.05 : zoomOpacity;\n if (!this.deckProps.debugSceneNodeProcessing) {\n this.bodyUILayer.setState({ data, zoomOpacity });\n } else {\n this.debugSceneNodeProcessing(data, zoomOpacity);\n }\n }\n }\n\n debugSceneNodeProcessing(data: SpatialSceneNode[], zoomOpacity: number): void {\n // const gltfUrl = 'https://hubmapconsortium.github.io/ccf-3d-reference-object-library/VH_Male/United/VHM_United_Color.glb';\n const gltfUrl = 'https://hubmapconsortium.github.io/ccf-3d-reference-object-library/VH_Female/United/VHF_United_Color.glb';\n // const gltfUrl = 'https://hubmapconsortium.github.io/hubmap-ontology/objects/VHF_United_v01_060420.glb';\n const gltfTransform = new Matrix4([0.076,0,0,0,0,0.076,1.6875389974302382e-17,0,0,-1.6875389974302382e-17,0.076,0,0.49,0.034,0.11,1]);\n processSceneNodes(gltfUrl, gltfTransform, 'VHF_Kidney_L_Low1').then((results) => {\n console.log('results', results);\n console.log('data', data);\n // data = Object.values(results);\n data = data.concat(Object.values(results));\n data.push({\n '@id': 'TEST',\n '@type': 'TEST',\n scenegraph: gltfUrl,\n scenegraphNode: 'VHF_Kidney_R_Low',\n transformMatrix: gltfTransform,\n color: [255, 255, 255, 200],\n // eslint-disable-next-line @typescript-eslint/naming-convention\n _lighting: 'pbr',\n zoomBasedOpacity: false\n });\n this.bodyUILayer.setState({ data, zoomOpacity });\n });\n }\n\n zoomTo(node: SpatialSceneNode): void {\n const matrix = new Matrix4(node.transformMatrix);\n this.deck.setProps({\n viewState: {\n ...this.deck.props.viewState,\n target: matrix.getTranslation(),\n rotationX: 0,\n rotationOrbit: 0,\n zoom: 11.5,\n } as BodyUIViewStateProps\n });\n }\n\n setRotation(value: number): void {\n this.deck.setProps({\n viewState: {\n ...this.deck.props.viewState,\n rotationOrbit: value\n } as BodyUIViewStateProps\n });\n }\n\n setRotationX(value: number): void {\n this.deck.setProps({\n viewState: {\n ...this.deck.props.viewState,\n rotationX: value\n } as BodyUIViewStateProps\n });\n }\n\n setZoom(value: number): void {\n this.deck.setProps({\n viewState: {\n ...this.deck.props.viewState,\n zoom: value\n } as BodyUIViewStateProps\n });\n }\n\n setTarget(value: number[]): void {\n this.deck.setProps({\n viewState: {\n ...this.deck.props.viewState,\n target: value\n } as BodyUIViewStateProps\n });\n }\n\n setInteractive(value: boolean): void {\n this.deck.setProps({\n controller: value\n });\n }\n\n @bind\n private _onHover(e: { picked: boolean; object: SpatialSceneNode }): void {\n const { lastHovered } = this;\n this.cursor = e.picked ? 'pointer' : undefined;\n if (e.picked && e.object && e.object['@id']) {\n if (lastHovered !== e.object) {\n if (lastHovered) {\n this.nodeHoverStopSubject.next(lastHovered);\n }\n this.lastHovered = e.object;\n this.nodeHoverStartSubject.next(e.object);\n }\n } else if (lastHovered) {\n this.nodeHoverStopSubject.next(lastHovered);\n this.lastHovered = undefined;\n }\n }\n\n @bind\n private _onClick(info: PickInfo, e: { srcEvent: { ctrlKey: boolean } }): void {\n if (info.picked && info.object && info.object['@id']) {\n this.nodeClickSubject.next({ node: info.object, ctrlClick: e?.srcEvent?.ctrlKey ?? undefined });\n }\n }\n\n @bind\n private _onViewStateChange(event: { interactionState: { isZooming: boolean }; viewState: BodyUIViewStateProps }): void {\n if (event.interactionState?.isZooming) {\n const currentState = this.bodyUILayer.state as { zoomOpacity: number; data: unknown };\n const zoomOpacity = Math.min(Math.max(1 - (event.viewState.zoom - 8.9) / 2, 0.05), 1.0);\n if (currentState.zoomOpacity !== zoomOpacity) {\n this.bodyUILayer.setState({ data: currentState.data, zoomOpacity });\n }\n }\n this.deck.setProps({ viewState: { ...event.viewState } });\n this.sceneRotationSubject.next([event.viewState.rotationOrbit, event.viewState.rotationX]);\n }\n\n @bind\n private _onDragStart(info: PickInfo, e: MouseEvent): void {\n this._dragEvent(info, e, this.nodeDragStartSubject);\n }\n\n @bind\n private _onDrag(info: PickInfo, e: MouseEvent): void {\n this._dragEvent(info, e, this.nodeDragSubject);\n }\n\n @bind\n private _onDragEnd(info: PickInfo, e: MouseEvent): void {\n this._dragEvent(info, e, this.nodeDragEndSubject);\n }\n\n private _dragEvent(info: PickInfo, e: MouseEvent, subject: Subject): void {\n if (info?.object?.['@id']) {\n subject.next({ node: info.object, info, e });\n }\n }\n}\n\n \n\n\n\n \n\n\n\n\n \n \n result-matching \"\"\n \n \n \n No results matching \"\"\n \n\n"},"interfaces/ProcessedNode.html":{"url":"interfaces/ProcessedNode.html","title":"interface - ProcessedNode","body":"\n \n\n\n\n\n\n\n\n\n\n\n\n\n\n Interfaces\n \n ProcessedNode\n\n\n\n \n Info\n \n \n Source\n \n\n\n\n \n \n File\n \n \n projects/ccf-body-ui/src/lib/util/process-scene-nodes.ts\n \n\n\n\n \n Extends\n \n \n SpatialSceneNode\n \n\n \n Index\n \n \n \n \n Properties\n \n \n \n \n \n \n \n bbox\n \n \n \n \n center\n \n \n \n \n jsonld\n \n \n \n \n node\n \n \n \n \n size\n \n \n \n \n \n \n \n \n\n\n\n \n Properties\n \n \n \n \n \n bbox\n \n \n \n \n \n \n \n \n bbox: AABB\n\n \n \n\n\n \n \n Type : AABB\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n center\n \n \n \n \n \n \n \n \n center: Vec3\n\n \n \n\n\n \n \n Type : Vec3\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n jsonld\n \n \n \n \n \n \n \n \n jsonld: \n\n \n \n\n\n\n\n\n\n\n \n \n \n \n \n \n \n node\n \n \n \n \n \n \n \n \n node: \n\n \n \n\n\n\n\n\n\n\n \n \n \n \n \n \n \n size\n \n \n \n \n \n \n \n \n size: Vec3\n\n \n \n\n\n \n \n Type : Vec3\n\n \n \n\n\n\n\n\n \n \n \n \n\n\n \n import { Matrix4 } from '@math.gl/core';\nimport { AABB, Vec3 } from 'cannon-es';\n\nimport { loadGLTF, registerGLTFLoaders } from './load-gltf';\nimport { traverseScene } from './scene-traversal';\nimport { SpatialSceneNode } from '../shared/spatial-scene-node';\n\n\nexport interface ProcessedNode extends SpatialSceneNode {\n bbox: AABB;\n jsonld: unknown;\n node: unknown;\n size: Vec3;\n center: Vec3;\n}\n\n/* eslint-disable */\nfunction childNames(scene, names: string[] = []): string[] {\n for (const child of (scene.nodes || scene.children || [])) {\n names.push(child.name);\n childNames(child, names);\n }\n return names;\n}\n\nexport async function processSceneNodes(gltfUrl: string, worldMatrix?: Matrix4, scenegraphNode?: string\n ): Promise {\n registerGLTFLoaders();\n const gltf = await loadGLTF({scenegraph: gltfUrl, scenegraphNode} as SpatialSceneNode);\n const nodes: {[node: string]: ProcessedNode} = {};\n const gltfNodes: ProcessedNode[] = [];\n for (const scene of gltf.scenes) {\n worldMatrix = new Matrix4(worldMatrix || Matrix4.IDENTITY);\n traverseScene(scene, worldMatrix, (node, modelMatrix: Matrix4) => {\n const processedNode: ProcessedNode = {\n '@id': (node.name || node.id) as string,\n '@type': 'ProcessedNode',\n transformMatrix: new Matrix4(modelMatrix),\n geometry: 'wireframe',\n node\n } as ProcessedNode;\n gltfNodes.push({\n '@id': `GLTF:${processedNode['@id']}`,\n '@type': 'GLTFNode',\n scenegraph: gltfUrl,\n scenegraphNode: processedNode['@id'],\n transformMatrix: new Matrix4(worldMatrix || Matrix4.IDENTITY),\n tooltip: (node.name || node.id) as string,\n color: [255, 255, 255, 255],\n _lighting: 'pbr',\n zoomBasedOpacity: true,\n node\n } as ProcessedNode);\n if (node.mesh && node.mesh.primitives && node.mesh.primitives.length > 0) {\n for (const primitive of node.mesh.primitives) {\n if (primitive.attributes.POSITION && primitive.attributes.POSITION.min) {\n const lowerBound = modelMatrix.transformAsPoint(primitive.attributes.POSITION.min, []);\n const upperBound = modelMatrix.transformAsPoint(primitive.attributes.POSITION.max, []);\n processedNode.bbox = new AABB({\n lowerBound: new Vec3(...lowerBound.map((n, i) => Math.min(n, upperBound[i]))),\n upperBound: new Vec3(...upperBound.map((n, i) => Math.max(n, lowerBound[i])))\n });\n }\n }\n }\n nodes[processedNode['@id']] = processedNode;\n return true;\n });\n }\n\n for (const node of Object.values(nodes).filter(n => !n.bbox)) {\n for (const child of childNames(node.node).map(n => nodes[n]).filter(n => n.bbox)) {\n if (!node.bbox) {\n node.bbox = child.bbox.clone();\n } else {\n node.bbox.extend(child.bbox);\n }\n }\n if (!node.bbox) {\n delete nodes[node['@id']];\n }\n }\n for (const node of Object.values(nodes)) {\n const lb = node.bbox.lowerBound;\n const ub = node.bbox.upperBound;\n const size = node.size = ub.clone().vsub(lb);\n const halfSize = size.clone().vmul(new Vec3(0.5, 0.5, 0.5));\n const center = node.center = lb.clone().vadd(halfSize);\n\n node.transformMatrix = new Matrix4(Matrix4.IDENTITY)\n .translate(center.toArray())\n .scale(halfSize.toArray());\n }\n for (const node of gltfNodes) {\n nodes[node['@id']] = node;\n }\n return nodes;\n}\n/* eslint-enable */\n\n \n\n\n\n \n\n\n\n\n \n \n result-matching \"\"\n \n \n \n No results matching \"\"\n \n\n"},"interfaces/SpatialEntityJsonLd.html":{"url":"interfaces/SpatialEntityJsonLd.html","title":"interface - SpatialEntityJsonLd","body":"\n \n\n\n\n\n\n\n\n\n\n\n\n\n\n Interfaces\n \n SpatialEntityJsonLd\n\n\n\n \n Info\n \n \n Source\n \n\n\n\n \n \n File\n \n \n projects/ccf-body-ui/src/lib/shared/ccf-spatial-jsonld.ts\n \n\n\n\n \n Extends\n \n \n JsonLdObj\n \n\n \n Index\n \n \n \n \n Properties\n \n \n \n \n \n \n \n @context\n \n \n \n \n @id\n \n \n \n \n @type\n \n \n \n \n ccf_annotations\n \n \n \n \n comment\n \n \n \n \n creation_date\n \n \n \n \n creator\n \n \n \n \n creator_first_name\n \n \n \n \n creator_last_name\n \n \n \n \n dimension_units\n \n \n \n \n extraction_set\n \n \n \n \n label\n \n \n \n \n object\n \n \n \n \n placement\n \n \n \n \n reference_organ\n \n \n \n \n representation_of\n \n \n \n \n rui_rank\n \n \n \n \n sex\n \n \n \n \n side\n \n \n \n \n slice_count\n \n \n \n \n slice_thickness\n \n \n \n \n updated_date\n \n \n \n \n x_dimension\n \n \n \n \n y_dimension\n \n \n \n \n z_dimension\n \n \n \n \n \n \n \n \n\n\n\n \n Properties\n \n \n \n \n \n @context\n \n \n \n \n \n \n \n \n @context: string\n\n \n \n\n\n \n \n Type : string\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n @id\n \n \n \n \n \n \n \n \n @id: string\n\n \n \n\n\n \n \n Type : string\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n @type\n \n \n \n \n \n \n \n \n @type: string | string[]\n\n \n \n\n\n \n \n Type : string | string[]\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n ccf_annotations\n \n \n \n \n \n \n \n \n ccf_annotations: string[]\n\n \n \n\n\n \n \n Type : string[]\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n comment\n \n \n \n \n \n \n \n \n comment: string\n\n \n \n\n\n \n \n Type : string\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n creation_date\n \n \n \n \n \n \n \n \n creation_date: string\n\n \n \n\n\n \n \n Type : string\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n creator\n \n \n \n \n \n \n \n \n creator: string\n\n \n \n\n\n \n \n Type : string\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n creator_first_name\n \n \n \n \n \n \n \n \n creator_first_name: string\n\n \n \n\n\n \n \n Type : string\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n creator_last_name\n \n \n \n \n \n \n \n \n creator_last_name: string\n\n \n \n\n\n \n \n Type : string\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n dimension_units\n \n \n \n \n \n \n \n \n dimension_units: string\n\n \n \n\n\n \n \n Type : string\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n extraction_set\n \n \n \n \n \n \n \n \n extraction_set: string\n\n \n \n\n\n \n \n Type : string\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n label\n \n \n \n \n \n \n \n \n label: string\n\n \n \n\n\n \n \n Type : string\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n object\n \n \n \n \n \n \n \n \n object: SpatialObjectReferenceJsonLd\n\n \n \n\n\n \n \n Type : SpatialObjectReferenceJsonLd\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n placement\n \n \n \n \n \n \n \n \n placement: SpatialPlacementJsonLd | SpatialPlacementJsonLd[]\n\n \n \n\n\n \n \n Type : SpatialPlacementJsonLd | SpatialPlacementJsonLd[]\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n reference_organ\n \n \n \n \n \n \n \n \n reference_organ: string\n\n \n \n\n\n \n \n Type : string\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n representation_of\n \n \n \n \n \n \n \n \n representation_of: string\n\n \n \n\n\n \n \n Type : string\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n rui_rank\n \n \n \n \n \n \n \n \n rui_rank: number\n\n \n \n\n\n \n \n Type : number\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n sex\n \n \n \n \n \n \n \n \n sex: \"Male\" | \"Female\" | undefined\n\n \n \n\n\n \n \n Type : \"Male\" | \"Female\" | undefined\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n side\n \n \n \n \n \n \n \n \n side: \"Left\" | \"Right\" | undefined\n\n \n \n\n\n \n \n Type : \"Left\" | \"Right\" | undefined\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n slice_count\n \n \n \n \n \n \n \n \n slice_count: number\n\n \n \n\n\n \n \n Type : number\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n slice_thickness\n \n \n \n \n \n \n \n \n slice_thickness: number\n\n \n \n\n\n \n \n Type : number\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n updated_date\n \n \n \n \n \n \n \n \n updated_date: string\n\n \n \n\n\n \n \n Type : string\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n x_dimension\n \n \n \n \n \n \n \n \n x_dimension: number\n\n \n \n\n\n \n \n Type : number\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n y_dimension\n \n \n \n \n \n \n \n \n y_dimension: number\n\n \n \n\n\n \n \n Type : number\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n z_dimension\n \n \n \n \n \n \n \n \n z_dimension: number\n\n \n \n\n\n \n \n Type : number\n\n \n \n\n\n\n\n\n \n \n \n \n\n\n \n import { JsonLdObj } from 'jsonld/jsonld-spec';\n\n\nexport interface SpatialPlacementJsonLd extends JsonLdObj {\n '@context'?: string;\n '@id': string;\n '@type': string;\n source?: string;\n target: string;\n placement_date: string;\n x_scaling: number;\n y_scaling: number;\n z_scaling: number;\n scaling_units: string;\n x_rotation: number;\n y_rotation: number;\n z_rotation: number;\n rotation_units: string;\n x_translation: number;\n y_translation: number;\n z_translation: number;\n translation_units: string;\n}\n\nexport interface SpatialObjectReferenceJsonLd extends JsonLdObj {\n '@id': string;\n '@type': string;\n file: string;\n file_format: string;\n placement: SpatialPlacementJsonLd;\n}\n\nexport interface SpatialEntityJsonLd extends JsonLdObj {\n '@context': string;\n '@id': string;\n '@type': string | string[];\n label: string;\n comment: string;\n creator: string;\n creator_first_name: string;\n creator_last_name: string;\n creation_date: string;\n updated_date: string;\n ccf_annotations: string[];\n representation_of: string;\n reference_organ: string;\n extraction_set: string;\n sex: 'Male' | 'Female' | undefined;\n side: 'Left' | 'Right' | undefined;\n rui_rank: number;\n slice_thickness: number;\n slice_count: number;\n x_dimension: number;\n y_dimension: number;\n z_dimension: number;\n dimension_units: string;\n object: SpatialObjectReferenceJsonLd;\n placement: SpatialPlacementJsonLd | SpatialPlacementJsonLd[];\n}\n\n \n\n\n\n \n\n\n\n\n \n \n result-matching \"\"\n \n \n \n No results matching \"\"\n \n\n"},"interfaces/SpatialObjectReferenceJsonLd.html":{"url":"interfaces/SpatialObjectReferenceJsonLd.html","title":"interface - SpatialObjectReferenceJsonLd","body":"\n \n\n\n\n\n\n\n\n\n\n\n\n\n\n Interfaces\n \n SpatialObjectReferenceJsonLd\n\n\n\n \n Info\n \n \n Source\n \n\n\n\n \n \n File\n \n \n projects/ccf-body-ui/src/lib/shared/ccf-spatial-jsonld.ts\n \n\n\n\n \n Extends\n \n \n JsonLdObj\n \n\n \n Index\n \n \n \n \n Properties\n \n \n \n \n \n \n \n @id\n \n \n \n \n @type\n \n \n \n \n file\n \n \n \n \n file_format\n \n \n \n \n placement\n \n \n \n \n \n \n \n \n\n\n\n \n Properties\n \n \n \n \n \n @id\n \n \n \n \n \n \n \n \n @id: string\n\n \n \n\n\n \n \n Type : string\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n @type\n \n \n \n \n \n \n \n \n @type: string\n\n \n \n\n\n \n \n Type : string\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n file\n \n \n \n \n \n \n \n \n file: string\n\n \n \n\n\n \n \n Type : string\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n file_format\n \n \n \n \n \n \n \n \n file_format: string\n\n \n \n\n\n \n \n Type : string\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n placement\n \n \n \n \n \n \n \n \n placement: SpatialPlacementJsonLd\n\n \n \n\n\n \n \n Type : SpatialPlacementJsonLd\n\n \n \n\n\n\n\n\n \n \n \n \n\n\n \n import { JsonLdObj } from 'jsonld/jsonld-spec';\n\n\nexport interface SpatialPlacementJsonLd extends JsonLdObj {\n '@context'?: string;\n '@id': string;\n '@type': string;\n source?: string;\n target: string;\n placement_date: string;\n x_scaling: number;\n y_scaling: number;\n z_scaling: number;\n scaling_units: string;\n x_rotation: number;\n y_rotation: number;\n z_rotation: number;\n rotation_units: string;\n x_translation: number;\n y_translation: number;\n z_translation: number;\n translation_units: string;\n}\n\nexport interface SpatialObjectReferenceJsonLd extends JsonLdObj {\n '@id': string;\n '@type': string;\n file: string;\n file_format: string;\n placement: SpatialPlacementJsonLd;\n}\n\nexport interface SpatialEntityJsonLd extends JsonLdObj {\n '@context': string;\n '@id': string;\n '@type': string | string[];\n label: string;\n comment: string;\n creator: string;\n creator_first_name: string;\n creator_last_name: string;\n creation_date: string;\n updated_date: string;\n ccf_annotations: string[];\n representation_of: string;\n reference_organ: string;\n extraction_set: string;\n sex: 'Male' | 'Female' | undefined;\n side: 'Left' | 'Right' | undefined;\n rui_rank: number;\n slice_thickness: number;\n slice_count: number;\n x_dimension: number;\n y_dimension: number;\n z_dimension: number;\n dimension_units: string;\n object: SpatialObjectReferenceJsonLd;\n placement: SpatialPlacementJsonLd | SpatialPlacementJsonLd[];\n}\n\n \n\n\n\n \n\n\n\n\n \n \n result-matching \"\"\n \n \n \n No results matching \"\"\n \n\n"},"interfaces/SpatialPlacementJsonLd.html":{"url":"interfaces/SpatialPlacementJsonLd.html","title":"interface - SpatialPlacementJsonLd","body":"\n \n\n\n\n\n\n\n\n\n\n\n\n\n\n Interfaces\n \n SpatialPlacementJsonLd\n\n\n\n \n Info\n \n \n Source\n \n\n\n\n \n \n File\n \n \n projects/ccf-body-ui/src/lib/shared/ccf-spatial-jsonld.ts\n \n\n\n\n \n Extends\n \n \n JsonLdObj\n \n\n \n Index\n \n \n \n \n Properties\n \n \n \n \n \n \n Optional\n \n @context\n \n \n \n \n @id\n \n \n \n \n @type\n \n \n \n \n placement_date\n \n \n \n \n rotation_units\n \n \n \n \n scaling_units\n \n \n \n Optional\n \n source\n \n \n \n \n target\n \n \n \n \n translation_units\n \n \n \n \n x_rotation\n \n \n \n \n x_scaling\n \n \n \n \n x_translation\n \n \n \n \n y_rotation\n \n \n \n \n y_scaling\n \n \n \n \n y_translation\n \n \n \n \n z_rotation\n \n \n \n \n z_scaling\n \n \n \n \n z_translation\n \n \n \n \n \n \n \n \n\n\n\n \n Properties\n \n \n \n \n \n @context\n \n \n \n \n \n \n \n \n @context: string\n\n \n \n\n\n \n \n Type : string\n\n \n \n\n \n \n Optional\n \n \n\n\n\n\n \n \n \n \n \n \n \n @id\n \n \n \n \n \n \n \n \n @id: string\n\n \n \n\n\n \n \n Type : string\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n @type\n \n \n \n \n \n \n \n \n @type: string\n\n \n \n\n\n \n \n Type : string\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n placement_date\n \n \n \n \n \n \n \n \n placement_date: string\n\n \n \n\n\n \n \n Type : string\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n rotation_units\n \n \n \n \n \n \n \n \n rotation_units: string\n\n \n \n\n\n \n \n Type : string\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n scaling_units\n \n \n \n \n \n \n \n \n scaling_units: string\n\n \n \n\n\n \n \n Type : string\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n source\n \n \n \n \n \n \n \n \n source: string\n\n \n \n\n\n \n \n Type : string\n\n \n \n\n \n \n Optional\n \n \n\n\n\n\n \n \n \n \n \n \n \n target\n \n \n \n \n \n \n \n \n target: string\n\n \n \n\n\n \n \n Type : string\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n translation_units\n \n \n \n \n \n \n \n \n translation_units: string\n\n \n \n\n\n \n \n Type : string\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n x_rotation\n \n \n \n \n \n \n \n \n x_rotation: number\n\n \n \n\n\n \n \n Type : number\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n x_scaling\n \n \n \n \n \n \n \n \n x_scaling: number\n\n \n \n\n\n \n \n Type : number\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n x_translation\n \n \n \n \n \n \n \n \n x_translation: number\n\n \n \n\n\n \n \n Type : number\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n y_rotation\n \n \n \n \n \n \n \n \n y_rotation: number\n\n \n \n\n\n \n \n Type : number\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n y_scaling\n \n \n \n \n \n \n \n \n y_scaling: number\n\n \n \n\n\n \n \n Type : number\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n y_translation\n \n \n \n \n \n \n \n \n y_translation: number\n\n \n \n\n\n \n \n Type : number\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n z_rotation\n \n \n \n \n \n \n \n \n z_rotation: number\n\n \n \n\n\n \n \n Type : number\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n z_scaling\n \n \n \n \n \n \n \n \n z_scaling: number\n\n \n \n\n\n \n \n Type : number\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n z_translation\n \n \n \n \n \n \n \n \n z_translation: number\n\n \n \n\n\n \n \n Type : number\n\n \n \n\n\n\n\n\n \n \n \n \n\n\n \n import { JsonLdObj } from 'jsonld/jsonld-spec';\n\n\nexport interface SpatialPlacementJsonLd extends JsonLdObj {\n '@context'?: string;\n '@id': string;\n '@type': string;\n source?: string;\n target: string;\n placement_date: string;\n x_scaling: number;\n y_scaling: number;\n z_scaling: number;\n scaling_units: string;\n x_rotation: number;\n y_rotation: number;\n z_rotation: number;\n rotation_units: string;\n x_translation: number;\n y_translation: number;\n z_translation: number;\n translation_units: string;\n}\n\nexport interface SpatialObjectReferenceJsonLd extends JsonLdObj {\n '@id': string;\n '@type': string;\n file: string;\n file_format: string;\n placement: SpatialPlacementJsonLd;\n}\n\nexport interface SpatialEntityJsonLd extends JsonLdObj {\n '@context': string;\n '@id': string;\n '@type': string | string[];\n label: string;\n comment: string;\n creator: string;\n creator_first_name: string;\n creator_last_name: string;\n creation_date: string;\n updated_date: string;\n ccf_annotations: string[];\n representation_of: string;\n reference_organ: string;\n extraction_set: string;\n sex: 'Male' | 'Female' | undefined;\n side: 'Left' | 'Right' | undefined;\n rui_rank: number;\n slice_thickness: number;\n slice_count: number;\n x_dimension: number;\n y_dimension: number;\n z_dimension: number;\n dimension_units: string;\n object: SpatialObjectReferenceJsonLd;\n placement: SpatialPlacementJsonLd | SpatialPlacementJsonLd[];\n}\n\n \n\n\n\n \n\n\n\n\n \n \n result-matching \"\"\n \n \n \n No results matching \"\"\n \n\n"},"interfaces/SpatialSceneNode.html":{"url":"interfaces/SpatialSceneNode.html","title":"interface - SpatialSceneNode","body":"\n \n\n\n\n\n\n\n\n\n\n\n\n\n\n Interfaces\n \n SpatialSceneNode\n\n\n\n \n Info\n \n \n Source\n \n\n\n\n \n \n File\n \n \n projects/ccf-body-ui/src/lib/shared/spatial-scene-node.ts\n \n\n\n\n\n \n Index\n \n \n \n \n Properties\n \n \n \n \n \n \n Optional\n \n _lighting\n \n \n \n \n @id\n \n \n \n \n @type\n \n \n \n Optional\n \n color\n \n \n \n Optional\n \n entityId\n \n \n \n Optional\n \n geometry\n \n \n \n Optional\n \n name\n \n \n \n Optional\n \n opacity\n \n \n \n Optional\n \n priority\n \n \n \n Optional\n \n reference_organ\n \n \n \n Optional\n \n representation_of\n \n \n \n Optional\n \n scenegraph\n \n \n \n Optional\n \n scenegraphNode\n \n \n \n Optional\n \n text\n \n \n \n Optional\n \n tooltip\n \n \n \n \n transformMatrix\n \n \n \n Optional\n \n unpickable\n \n \n \n Optional\n \n zoomBasedOpacity\n \n \n \n Optional\n \n zoomToOnLoad\n \n \n \n \n \n \n \n \n\n\n\n \n Properties\n \n \n \n \n \n _lighting\n \n \n \n \n \n \n \n \n _lighting: string\n\n \n \n\n\n \n \n Type : string\n\n \n \n\n \n \n Optional\n \n \n\n\n\n\n \n \n \n \n \n \n \n @id\n \n \n \n \n \n \n \n \n @id: string\n\n \n \n\n\n \n \n Type : string\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n @type\n \n \n \n \n \n \n \n \n @type: string\n\n \n \n\n\n \n \n Type : string\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n color\n \n \n \n \n \n \n \n \n color: [number, number, number, number]\n\n \n \n\n\n \n \n Type : [number, number, number, number]\n\n \n \n\n \n \n Optional\n \n \n\n\n\n\n \n \n \n \n \n \n \n entityId\n \n \n \n \n \n \n \n \n entityId: string\n\n \n \n\n\n \n \n Type : string\n\n \n \n\n \n \n Optional\n \n \n\n\n\n\n \n \n \n \n \n \n \n geometry\n \n \n \n \n \n \n \n \n geometry: SpatialSceneGeometry\n\n \n \n\n\n \n \n Type : SpatialSceneGeometry\n\n \n \n\n \n \n Optional\n \n \n\n\n\n\n \n \n \n \n \n \n \n name\n \n \n \n \n \n \n \n \n name: string\n\n \n \n\n\n \n \n Type : string\n\n \n \n\n \n \n Optional\n \n \n\n\n\n\n \n \n \n \n \n \n \n opacity\n \n \n \n \n \n \n \n \n opacity: number\n\n \n \n\n\n \n \n Type : number\n\n \n \n\n \n \n Optional\n \n \n\n\n\n\n \n \n \n \n \n \n \n priority\n \n \n \n \n \n \n \n \n priority: number\n\n \n \n\n\n \n \n Type : number\n\n \n \n\n \n \n Optional\n \n \n\n\n\n\n \n \n \n \n \n \n \n reference_organ\n \n \n \n \n \n \n \n \n reference_organ: string\n\n \n \n\n\n \n \n Type : string\n\n \n \n\n \n \n Optional\n \n \n\n\n\n\n \n \n \n \n \n \n \n representation_of\n \n \n \n \n \n \n \n \n representation_of: string\n\n \n \n\n\n \n \n Type : string\n\n \n \n\n \n \n Optional\n \n \n\n\n\n\n \n \n \n \n \n \n \n scenegraph\n \n \n \n \n \n \n \n \n scenegraph: string\n\n \n \n\n\n \n \n Type : string\n\n \n \n\n \n \n Optional\n \n \n\n\n\n\n \n \n \n \n \n \n \n scenegraphNode\n \n \n \n \n \n \n \n \n scenegraphNode: string\n\n \n \n\n\n \n \n Type : string\n\n \n \n\n \n \n Optional\n \n \n\n\n\n\n \n \n \n \n \n \n \n text\n \n \n \n \n \n \n \n \n text: string\n\n \n \n\n\n \n \n Type : string\n\n \n \n\n \n \n Optional\n \n \n\n\n\n\n \n \n \n \n \n \n \n tooltip\n \n \n \n \n \n \n \n \n tooltip: string\n\n \n \n\n\n \n \n Type : string\n\n \n \n\n \n \n Optional\n \n \n\n\n\n\n \n \n \n \n \n \n \n transformMatrix\n \n \n \n \n \n \n \n \n transformMatrix: Matrix4\n\n \n \n\n\n \n \n Type : Matrix4\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n unpickable\n \n \n \n \n \n \n \n \n unpickable: boolean\n\n \n \n\n\n \n \n Type : boolean\n\n \n \n\n \n \n Optional\n \n \n\n\n\n\n \n \n \n \n \n \n \n zoomBasedOpacity\n \n \n \n \n \n \n \n \n zoomBasedOpacity: boolean\n\n \n \n\n\n \n \n Type : boolean\n\n \n \n\n \n \n Optional\n \n \n\n\n\n\n \n \n \n \n \n \n \n zoomToOnLoad\n \n \n \n \n \n \n \n \n zoomToOnLoad: boolean\n\n \n \n\n\n \n \n Type : boolean\n\n \n \n\n \n \n Optional\n \n \n\n\n\n\n \n \n \n \n\n\n \n import { Matrix4 } from '@math.gl/core';\n\nexport type SpatialSceneGeometry = 'sphere' | 'cube' | 'wireframe' | 'text' | 'cone' | 'cylinder';\n\nexport interface SpatialSceneNode {\n '@id': string;\n '@type': string;\n entityId?: string;\n representation_of?: string;\n reference_organ?: string;\n unpickable?: boolean;\n geometry?: SpatialSceneGeometry;\n text?: string;\n _lighting?: string;\n scenegraph?: string;\n scenegraphNode?: string;\n zoomBasedOpacity?: boolean;\n zoomToOnLoad?: boolean;\n color?: [number, number, number, number];\n opacity?: number;\n transformMatrix: Matrix4;\n name?: string;\n tooltip?: string;\n priority?: number;\n}\n\n \n\n\n\n \n\n\n\n\n \n \n result-matching \"\"\n \n \n \n No results matching \"\"\n \n\n"},"changelog.html":{"url":"changelog.html","title":"getting-started - changelog","body":"\n \n\nChangelog\nChangelog for the Common Coordinate Framework (CCF) User Interfaces\n3.6.0 - 2022-10-15\nAdded in 3.6.0.\n\nUpdated to CCF.OWL v2.1.0 which indexes the Human Reference Atlas (HRA) 4th Release (v1.3) for use in the CCF UIs and CCF-API. Note that some terms have changed in the ontology. As such, some SPARQL queries may need to be updated. All CCF-API calls have been updated to support the new terms.\n\n3.5.0 - 2022-09-27\nAdded in 3.5.0\n\nUpdate to CCF.OWL v1.9.4\nUpdate placement for KPMP rui locations\nSwitch to HuBMAP v3 search-api\nPick right organ when loading rui locations from a file in the RUI\n\n3.4.0 - 2022-07-01\nAdded in 3.4.0\n\nMajor feature added: Spatial Search! This includes an expanded API plus a user interface for dynamically generating spatial searches.\n\nKnown Issues in 3.4.0\n\nThere are some minor visual descrepancies when viewing the spatial search 3D scene and the results. However, blocks which are highlighted will be selected if the spatial search is added to your overall search filters.\n\n3.3.0 - 2022-06-17\nAdded in 3.3.0\n\nAdded support for the latest CCF Ontology v1.9.0 which adds Placenta, Spinal Cord, new Landmarks for reference organs, and a host of data updates.\nAdded a SPARQL route to the CCF-API for flexible querying of the Ontology and linked data. See the /v1/sparql docs for more information.\nClean up and bug fixes\n\n3.2.0 - 2022-04-14\nAdded in 3.2.0\n\nMajor CCF Database speed improvements! 95% reduction in load times!\nMinor graphical fixes\n\n3.1.1 - 2022-04-12\nAdded in 3.1.1\n\nExpanded RUI web component options\nAdded support for warming up the CCF database via the CCF-API so that the EUI can prevent timeouts\n\n3.1.0 - 2022-04-07\nAdded in 3.1.0\n\nAdded support for the latest CCF Ontology v1.8.0 which adds cell types\nAdded feature to search for tissue blocks by cell type\nAdded API feature to dynamically generate GTEx rui_locations.jsonld\nAdded logging of organ and block position changes to the RUI\nAdded an expanded organ selector that makes selecting organs much easier with the larger number of reference organs we have now\nNow generating programming libraries for the CCF-API in Python, TypeScript, TypeScript (Angular), and JavaScript. We will be publishing them to appropriate package managers soon.\nImproved performance of the CCF-API\nNew theming options and toggle for the CCF EUI/RUI\nAdded new themes for SenNet, GTEx, and a default theme\nAdded compodoc generated code documentation to production and staging builds\nBug fixes and minor improvements\n\n3.0.0 - 2022-01-27\nAdded in 3.0.0\n\nAdded support for the latest CCF Ontology v1.7.0\nBug fixes and code cleanup\n\n3.0.0 BETA - 2021-12-17\nAdded in 3.0.0 BETA\n\nAdded reference organs and ASCT+B tables from the v1.1 CCF Release\nLinks: CCF Ontology v1.7 BETA, CCF Release v1.1\n\n\n\nKnown issues in 3.0.0 BETA\n\nPreviously registered tissues may appear slightly off. We are working to rectify this before making it a production release.\n\n2.5.0 - 2021-12-17\nAdded in 2.5.0\n\nCCF-API OpenAPI Spec and implementation. Next version will connect the EUI to this as it's backend.\nAdded the CCF Body UI Web Component for integrating the 3D scene deeply in webpages (including the HuBMAP data portal).\nThe organ-info Web Component can now take an option to highlight specific blocks in the scene. Currently only highlights by providers, but age, sex, and BMI will be added in the next version.\nBug fixes and Quality of Life improvements\n\n2.4.0 - 2021-12-10\nAdded in 2.4.0\n\nRUI shows a confirmation dialog when a user attempts to leave without finishing registration\nAdded GTEx data to EUI\nRUI Common Extraction Sites are now known as Landmarks\nOrgan info now highlights the block selected on click\nUpdated RUI YouTube Demo link\nBug fixes and Quality of Life improvements\n\n2.3.1 - 2021-09-13\nAdded in 2.3.1\n\nAdded support for paired organs to be refernced by their parent (ala Kidney + Left/Right Kidney)\n\n2.3.0 - 2021-09-10\nAdded in 2.3.0\n\nGreatly improved CCF Database performance. This improves the performance in both organ-info and EUI.\nImproved styling of organ-info\n\n2.2.0 - 2021-09-10\nAdded in 2.2.0\n\nAdded an organ-info web component for displaying reference organs and associated data in a simple panel display. The hubmap portal will be using this soon for organ pages.\nEMBEDDING.md instructions have been updated for organ-info embedding.\n\n2.1.0 - 2021-07-30\nAdded in EUI / RUI 2.1.0\n\nBetter support for embedding EUI/RUI in different containers, see EMBEDDING.md for updated instructions.\nConfiguration updates:\nConfiguration of EUI/RUI via webcomponent properties (vs globalConfig)\nOptional use of ontology id to select reference organs in the RUI\nRemoved embedded and tutorial mode configurations from the RUI config\nAbility to load data sources in the eui via external configuration\nAdded cancelRegistration callback to rui external configuration\n\n\nSet dark/light theme based on user/OS preferences\nUpdate HuBMAP search processing to conform to new field names\nCode cleanup, shared utilities, etc.\nTelemetry dialog box fixes to avoid unnecessary reloads\nRUI gizmo rotates in sync with the reference organ in 3D preview view\nRUI now uses an orthographic view when in registration views\n\n2.0.0 - 2021-07-16\nAdded in EUI / RUI 2.0.0\n\nRUI and EUI are now basic web-components, see EMBEDDING.md\nAdded advanced google analytics tracking/telemetry\nLinked donor card and tissue block hovering\nUpdated dependencies, including upgrading to Angular 12\nMinor UI and Bug fixes\nUpdated demo video links\nOrgan carousel will respond to container width and show only full icons\nEUI: clicking refresh and selecting body on partonomy resets the body view\n\nBreaking changes in EUI / RUI 2.0.0\n\nEmbedding the EUI and RUI must now be done via web-components. The most significant change is the element is no longer called ccf-root but is instead called ccf-eui or ccf-rui depending on the UI being embedded.\n\n1.7.0 - 2021-05-21\nAdded in EUI / RUI 1.7.0\n\nAdded a startup modal to the RUI which simplifies the initial setup for a new registration\nAdded 8 new reference organs, bringing us to 13 Reference Organs!\nAdded SPARC Registrations to the EUI\nAdded a tissue section visualization to the results list in the EUI\n\n1.6.0 - 2021-04-09\nAdded in RUI 1.6.0\n\nAdded SOP information to the About section\n\nAdded in EUI 1.6.0\n\nAdded color assignment/selection to both 3d scene and list results\nBug fixes, code cleanup, and optimization\n\nKnown issues in 1.6.0\n\nThe 3d scene is a little slow. To be able to interact, unselect reference organs to reduce scene complexity.\nTissue samples may be a little off in the 3D scene. This will be fixed in a future release. Data is still accurate.\n\n1.5.0 - 2021-03-26\nAdded in RUI 1.5.0\n\nMinor styling updates\n\nAdded in EUI 1.5.0\nNOTE: EUI will not be pushed to production during this cycle as there are some features not fully integrated. This should be resolved in the next release scheduled for April 9th. You can view the results of this sprint on staging.\n\nUpdated styling to better fit the user interface spec\nAdded a new results pane which structures data into Donor->Tissue Blocks (+Datasets)->Tissue Samples (+Datasets)\nAdded a link viewer that allows us to display donors, samples, and datasets in a frame within the application\nAdded UFL thumbnails\nUpdated and optimized the ccf-database for the new results structure and future integrations\nTied organ carousel to the 3D scene. Turning off an organ removes the organ and related tissues from the 3D scene.\nTurned off anatomical structure opacity adjustment until it can be fully integrated\n\n1.4.0 - 2021-03-12\nAdded in RUI 1.4.0\n\nUpdated library dependencies, including to Angular 11\nUpdated styling to better fit the user interface spec\n\nAdded in EUI 1.4.0\nNOTE: EUI will not be pushed to production during this cycle as there are some features partly integrated. This should be resolved in the next release scheduled for March 26th. You can view the results of this sprint on staging.\n\nUpdated library dependencies, including to Angular 11\nUpdated styling to better fit the user interface spec and match RUI styling\nUpdated the Info Dialog to match the RUI look and feel\nUpdated the data processing to improve efficiency and generate data in the form needed for the v1.5.0 spec\nAdded a reference organ selector, also used in the RUI, to turn off/on reference organs on the stage. UI is implemented, but still needs hooked up to the 3d Stage.\nAdded a technology filter\nAdded a control to set Opacities of individual organs/anatomical structures on the stage. UI is implemented, but still needs hooked up to the 3d Stage.\n\n1.3.5 - 2021-02-26\nAdded in RUI 1.3.5\n\nUpdated with a new round of User Interface improvements\nAdded the ability to upload previous registrations created using the standalone version of the RUI tool\nOrgans now have transparency applied automatically\nSolved a major memory leak and performance issue with the 3D reference organ interface. You should notice a sizable speed and reliability increase.\nRUI location numeric data is now rounded to 3 digits\nSwitched to using GitHub Actions over TravisCI for our CI/CD workflows\n\nAdded in EUI 1.3.5\n\nRemoved CCF's internal image-viewer in favor of the image-viewer on the HuBMAP Data Portal\n\nEUI 1.2.0 / RUI 1.0 FINAL - 2020-10-30\nAdded in EUI 1.2.0 / RUI 1.0 FINAL\n\nBug fixes and improvements\nUpdated embedding API in collaboration with the IEC\nUpdated EUI codebase to be in sync with code changes made for the RUI\nAdded KPMP data to the EUI\n\nKnown Issues in EUI 1.2.0 / RUI 1.0 FINAL\n\nIt is still possible that a 3d organ may fail to load. If this happens, just refresh and try again.\nEUI has not been updated with the latest organ set. This will be added in December with its scheduled refresh.\n\nRUI 1.0 BETA - 2020-10-16\nAdded in RUI 1.0 BETA\n\nCreated the first version of the RUI 1.0. This version is a BETA and works in standalone mode only. The next version will include full support and integration into the HuBMAP Ingestion Portal.\n10 Reference Organs are available to choose from (a combination of 4 organs, 2 sexes, and one organ with 2 sides [kidney])\nImplemented automatic tagging of data via collisions with anatomical structures\nRUI Location data is in standard JSON-LD format linked via the CCF Ontology and related ontologies\nImplemented extraction sites display to help guide placement of tissues\n\nKnown Issues in RUI 1.0 BETA\n\nWhile support for embedding is implemented, more testing and collaboration with IEC is required before it is made fully available. Initial embedding documentation is available here.\nWhen adjusting transparency via the left-hand Anatomical Structures menu or Show Previous Registrations option, the transparency effect is not very good. This will be addressed before the RUI 1.0 production release.\nSometimes the 3d organ fails to load when clicking through reference organs quickly (and other side cases). If this happens, just refresh and try again.\n\n1.1.0 - 2020-07-31\nAdded in 1.1.0\n\nUpgraded to latest Vitessce Image Viewer and started showing processed TIFF images coming directly from the HuBMAP infrastructure\nProcessed CODEX and 10x datasets are shown in the HuBMAP Portal's visualization tool\nAdded a limited set of TIFF image thumbnails, with more to come\nAdded two qualitative color schemes for colorizing images in the image viewer\nBug fixes/performance optimizations\n\n1.0.0-rc.1 - 2020-06-22\n\n:warning: WARNING: This version is a release candidate. Some minor updates will likely happen between now and the official HuBMAP Data Release 1 in July.\n\nAdded in 1.0.0-rc.1\n\nBody UI interactions\nImage Viewer Integration\nPartonomy linkage to search / Body UI\nNow fully integrated into the HuBMAP Portal\n\nKnown Issues in 1.0.0-rc.1\n\nImage Viewer is using a placeholder .tiff until more .tiff images can be loaded from the IEC\n\n1.0.0-alpha.3 - 2019-05-08\nAdded in 1.0.0-alpha.3\n\nHooked up the interface to real data (not shown online as the data is not public yet)\nAdded the Tissue Browser on the right\nAdded the initial (Tissue) Image Viewer popup. Currently shows metadata, but no images yet.\nAdded an initial 3D Body. Tissues cuboids currently not displayed, but a test cuboid is shown.\nDocumentation (>90%) and testing coverage improved further\n\n1.0.0-alpha.2 - 2019-03-27\nAdded in 1.0.0-alpha.2\n\nIncreased documentation and testing coverage across the board\nAdded fullscreen button\nBug fixes and optimizations\n\n1.0.0-alpha.1 - 2019-03-06\nAdded in 1.0.0-alpha.1\n\nStarted the process of implementing the 1.0.0 UI spec\nSpec Doc\nUser Stories\n\n\nSetup the base project scaffolding for the new version\nAdded CCF Partonomy (CCF-P) search and tree display\nAdded a filter for filter tissues\n\n0.6.0 - 2019-11-08\nAdded in 0.6.0\n\nThe CCF API project was started with an initial OpenAPI Schema, documentation, and code for spinning up a mock data server. This codifies the CCF data and metadata standards defined by MC-IU and will be used by the CCF EUI and RUI.\nIn preparation for future developments, we added a hidden, alpha-level 3d organ viewer. You can toggle this on and off in the organ view, by typing 3d with your keyboard.\nUpdated navigation to directly jump to the tissue browser when a user selects an item from the search box\nUpgraded dependencies, including upgrades to Angular 8\nTesting and bug fixes\nMinor UI updates\nChanged download icon color\nChanged the background color for the search\nMoved the Technologies filter above ontology\nAdditional styles for details button\n\n\n\n0.5.0 - 2019-05-24\nAdded in 0.5.0\n\nDisplay of the CCF ontology, integrated with search\nSemantic search by ontology, results are presented at all levels\nTissue overlays showing regions of interest\nData download links to direct users to https://sampledata.hubmapconsortium.org\nData documentation (95% coverage) and testing (85% coverage)\n\n0.2.0 - 2019-05-03\nAdded in 0.2.0\n\nSprint 2 release of the CCF-UI!\nA search interface was added to query data by age, sex, technology and TMC. Ontological search will be implemented in the next sprint.\nBody, Organ, and Tissue views now respond to updates to the search on the fly\nAppropriate metadata is now displayed in the Body, Organ, Tissue, and Cell views\n\n0.1.0 - 2019-04-12\nAdded in 0.1.0\n\nSprint 1 release of the CCF-UI!\nSetup the base project scaffolding\nAdded a sample database that includes initial data provided by VU\nAdded Visual browsing of tissue samples and metadata at the whole body, organ, tissue, and cell level\nStay tuned! More features coming in Sprint 2 (starts next week!) and Sprint 3\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n \n\n\n\n\n \n \n result-matching \"\"\n \n \n \n No results matching \"\"\n \n\n"},"coverage.html":{"url":"coverage.html","title":"coverage - coverage","body":"\n \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n \n\n\n\n Documentation coverage\n\n\n\n \n\n\n\n \n \n File\n Type\n Identifier\n Statements\n \n \n \n \n \n \n projects/ccf-body-ui/src/global-fixes.ts\n \n function\n castToGlobalType\n \n 0 %\n (0/1)\n \n \n \n \n \n projects/ccf-body-ui/src/lib/body-ui-layer.ts\n \n class\n BodyUILayer\n \n 0 %\n (0/6)\n \n \n \n \n \n projects/ccf-body-ui/src/lib/body-ui-layer.ts\n \n function\n meshLayer\n \n 0 %\n (0/1)\n \n \n \n \n \n projects/ccf-body-ui/src/lib/body-ui-layer.ts\n \n function\n textLayer\n \n 0 %\n (0/1)\n \n \n \n \n \n projects/ccf-body-ui/src/lib/body-ui.ts\n \n class\n BodyUI\n \n 2 %\n (1/37)\n \n \n \n \n \n projects/ccf-body-ui/src/lib/body-ui.ts\n \n interface\n BodyUIProps\n \n 0 %\n (0/13)\n \n \n \n \n \n projects/ccf-body-ui/src/lib/body-ui.ts\n \n interface\n BodyUIViewStateProps\n \n 0 %\n (0/7)\n \n \n \n \n \n projects/ccf-body-ui/src/lib/body-ui.ts\n \n interface\n PickInfo\n \n 0 %\n (0/8)\n \n \n \n \n \n projects/ccf-body-ui/src/lib/shared/ccf-spatial-jsonld.ts\n \n interface\n SpatialEntityJsonLd\n \n 0 %\n (0/26)\n \n \n \n \n \n projects/ccf-body-ui/src/lib/shared/ccf-spatial-jsonld.ts\n \n interface\n SpatialObjectReferenceJsonLd\n \n 0 %\n (0/6)\n \n \n \n \n \n projects/ccf-body-ui/src/lib/shared/ccf-spatial-jsonld.ts\n \n interface\n SpatialPlacementJsonLd\n \n 0 %\n (0/19)\n \n \n \n \n \n projects/ccf-body-ui/src/lib/shared/spatial-scene-node.ts\n \n interface\n SpatialSceneNode\n \n 0 %\n (0/20)\n \n \n \n \n \n projects/ccf-body-ui/src/lib/util/load-gltf.ts\n \n function\n deriveScenegraph\n \n 0 %\n (0/1)\n \n \n \n \n \n projects/ccf-body-ui/src/lib/util/load-gltf.ts\n \n function\n loadGLTF\n \n 0 %\n (0/1)\n \n \n \n \n \n projects/ccf-body-ui/src/lib/util/load-gltf.ts\n \n function\n loadGLTF2\n \n 0 %\n (0/1)\n \n \n \n \n \n projects/ccf-body-ui/src/lib/util/load-gltf.ts\n \n function\n registerGLTFLoaders\n \n 0 %\n (0/1)\n \n \n \n \n \n projects/ccf-body-ui/src/lib/util/parse-csv.ts\n \n function\n parseCSV\n \n 0 %\n (0/1)\n \n \n \n \n \n projects/ccf-body-ui/src/lib/util/parse-csv.ts\n \n function\n parseCSVText\n \n 0 %\n (0/1)\n \n \n \n \n \n projects/ccf-body-ui/src/lib/util/process-anatomical-structures.ts\n \n function\n processAnatomicalStructures\n \n 0 %\n (0/1)\n \n \n \n \n \n projects/ccf-body-ui/src/lib/util/process-extraction-sites.ts\n \n function\n processExtractionSites\n \n 0 %\n (0/1)\n \n \n \n \n \n projects/ccf-body-ui/src/lib/util/process-reference-data.ts\n \n function\n processReferenceData\n \n 0 %\n (0/1)\n \n \n \n \n \n projects/ccf-body-ui/src/lib/util/process-reference-data.ts\n \n variable\n referenceDataConfig\n \n 0 %\n (0/1)\n \n \n \n \n \n projects/ccf-body-ui/src/lib/util/process-scene-nodes.ts\n \n interface\n ProcessedNode\n \n 0 %\n (0/6)\n \n \n \n \n \n projects/ccf-body-ui/src/lib/util/process-scene-nodes.ts\n \n function\n childNames\n \n 0 %\n (0/1)\n \n \n \n \n \n projects/ccf-body-ui/src/lib/util/process-scene-nodes.ts\n \n function\n processSceneNodes\n \n 0 %\n (0/1)\n \n \n \n \n \n projects/ccf-body-ui/src/lib/util/process-spatial-entities.ts\n \n function\n processSpatialEntities\n \n 0 %\n (0/1)\n \n \n \n \n \n projects/ccf-body-ui/src/lib/util/scene-traversal.ts\n \n function\n traverseScene\n \n 0 %\n (0/1)\n \n \n \n \n \n projects/ccf-body-ui/src/lib/util/simplify-scene.ts\n \n function\n simplifyScene\n \n 0 %\n (0/1)\n \n \n \n \n \n projects/ccf-body-ui/src/lib/util/spatial-scene-collider.ts\n \n interface\n Collision\n \n 0 %\n (0/4)\n \n \n \n \n \n projects/ccf-body-ui/src/lib/util/spatial-scene-collider.ts\n \n function\n doCollisions\n \n 0 %\n (0/1)\n \n \n \n\n\n\n\n\n new Tablesort(document.getElementById('coverage-table'));\n\n\n \n \n result-matching \"\"\n \n \n \n No results matching \"\"\n \n\n"},"dependencies.html":{"url":"dependencies.html","title":"package-dependencies - dependencies","body":"\n \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n \n Dependencies\n \n \n \n @angular-ru/common : ^15.126.1\n \n @angular/animations : ^12.1.1\n \n @angular/cdk : ^12.1.1\n \n @angular/common : ^12.1.1\n \n @angular/compiler : ^12.1.1\n \n @angular/core : ^12.1.1\n \n @angular/elements : ^12.1.1\n \n @angular/forms : ^12.1.1\n \n @angular/material : ^12.1.3\n \n @angular/platform-browser : ^12.1.1\n \n @angular/platform-browser-dynamic : ^12.1.1\n \n @angular/router : ^12.1.1\n \n @angular/youtube-player : ^12.1.1\n \n @comunica/query-sparql-rdfjs : ^2.2.0\n \n @deck.gl/core : ^8.5.7\n \n @deck.gl/geo-layers : ^8.7.8\n \n @deck.gl/layers : ^8.5.7\n \n @deck.gl/mesh-layers : ^8.5.7\n \n @loaders.gl/core : ^3.0.12\n \n @loaders.gl/draco : ^3.0.12\n \n @loaders.gl/gltf : ^3.0.12\n \n @luma.gl/core : ^8.5.12\n \n @math.gl/core : ^3.5.5\n \n @math.gl/culling : ^3.5.7\n \n @ngxs-labs/data : ^6.2.0\n \n @ngxs-labs/dispatch-decorator : ^4.0.2\n \n @ngxs/logger-plugin : ^3.7.1\n \n @ngxs/storage-plugin : ^3.7.1\n \n @ngxs/store : ^3.7.3\n \n @rdfjs/data-model : ^1.2.0\n \n @types/lru-cache : \n \n @webcomponents/webcomponentsjs : ^2.5.0\n \n bind-decorator : ^1.0.11\n \n body-parser : ^1.19.0\n \n cannon-es : ^0.18.0\n \n comlink : ^4.3.0\n \n concat : ^1.0.3\n \n cors : ^2.8.5\n \n css-element-queries : ^1.2.3\n \n document-register-element : ^1.7.2\n \n dotenv : ^16.0.0\n \n express : ^4.17.1\n \n file-saver : ^2.0.5\n \n fs-extra : ^10.0.0\n \n graphology : ^0.20.0\n \n graphology-shortest-path : ^1.4.1\n \n helmet : ^4.6.0\n \n hex-rgb : ^5.0.0\n \n idb-keyval : ^6.0.1\n \n jsonld : ^5.2.0\n \n lodash : ^4.17.21\n \n lru-cache : \n \n n3 : ^1.16.0\n \n ng5-slider : ^1.2.6\n \n ngx-google-analytics : ^11.2.1\n \n ngx-markdown : ^12.0.1\n \n node-fetch : ^2.6.7\n \n qs : ^6.10.2\n \n rdf-literal : ^1.2.0\n \n rdfxml-streaming-parser : ^1.4.0\n \n readable-stream : ^3.6.0\n \n rxjs : ^6.6.7\n \n stream-browserify : ^3.0.0\n \n swiper : ^6.5.1\n \n ts-cacheable : ^1.0.6\n \n tslib : ^2.1.0\n \n uuid : ^8.3.2\n \n zone.js : ~0.11.4\n \n\n \n\n\n\n\n \n \n result-matching \"\"\n \n \n \n No results matching \"\"\n \n\n"},"miscellaneous/functions.html":{"url":"miscellaneous/functions.html","title":"miscellaneous-functions - functions","body":"\n \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n \n\n\n Miscellaneous\n Functions\n\n\n\n Index\n \n \n \n \n \n \n castToGlobalType   (projects/.../global-fixes.ts)\n \n \n childNames   (projects/.../process-scene-nodes.ts)\n \n \n deriveScenegraph   (projects/.../load-gltf.ts)\n \n \n doCollisions   (projects/.../spatial-scene-collider.ts)\n \n \n loadGLTF   (projects/.../load-gltf.ts)\n \n \n loadGLTF2   (projects/.../load-gltf.ts)\n \n \n meshLayer   (projects/.../body-ui-layer.ts)\n \n \n parseCSV   (projects/.../parse-csv.ts)\n \n \n parseCSVText   (projects/.../parse-csv.ts)\n \n \n processAnatomicalStructures   (projects/.../process-anatomical-structures.ts)\n \n \n processExtractionSites   (projects/.../process-extraction-sites.ts)\n \n \n processReferenceData   (projects/.../process-reference-data.ts)\n \n \n processSceneNodes   (projects/.../process-scene-nodes.ts)\n \n \n processSpatialEntities   (projects/.../process-spatial-entities.ts)\n \n \n registerGLTFLoaders   (projects/.../load-gltf.ts)\n \n \n simplifyScene   (projects/.../simplify-scene.ts)\n \n \n textLayer   (projects/.../body-ui-layer.ts)\n \n \n traverseScene   (projects/.../scene-traversal.ts)\n \n \n \n \n \n \n\n\n projects/ccf-body-ui/src/global-fixes.ts\n \n \n \n \n \n \n \n castToGlobalType\n \n \n \n \n \n \ncastToGlobalType(value)\n \n \n\n\n\n\n \n \n\n \n Parameters :\n \n \n \n Name\n Optional\n \n \n \n \n value\n\n \n No\n \n\n\n \n \n \n \n \n \n \n \n \n \n projects/ccf-body-ui/src/lib/util/process-scene-nodes.ts\n \n \n \n \n \n \n \n childNames\n \n \n \n \n \n \nchildNames(scene, names)\n \n \n\n\n\n\n \n \n\n \n Parameters :\n \n \n \n Name\n Optional\n \n \n \n \n scene\n\n \n No\n \n\n\n \n \n names\n\n \n No\n \n\n\n \n \n \n \n \n \n \n Returns : string[]\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n processSceneNodes\n \n \n \n \n \n \nprocessSceneNodes(gltfUrl, worldMatrix?, scenegraphNode?)\n \n \n\n\n\n\n \n \n\n \n Parameters :\n \n \n \n Name\n Optional\n \n \n \n \n gltfUrl\n\n \n No\n \n\n\n \n \n worldMatrix\n\n \n Yes\n \n\n\n \n \n scenegraphNode\n\n \n Yes\n \n\n\n \n \n \n \n \n \n \n Returns : Promise\n\n \n \n \n \n \n \n \n \n projects/ccf-body-ui/src/lib/util/load-gltf.ts\n \n \n \n \n \n \n \n deriveScenegraph\n \n \n \n \n \n \nderiveScenegraph(scenegraphNodeName, gltf)\n \n \n\n\n\n\n \n \n\n \n Parameters :\n \n \n \n Name\n Optional\n \n \n \n \n scenegraphNodeName\n\n \n No\n \n\n\n \n \n gltf\n\n \n No\n \n\n\n \n \n \n \n \n \n \n Returns : any\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n loadGLTF\n \n \n \n \n \n \nloadGLTF(model, cache?)\n \n \n\n\n\n\n \n \n\n \n Parameters :\n \n \n \n Name\n Optional\n \n \n \n \n model\n\n \n No\n \n\n\n \n \n cache\n\n \n Yes\n \n\n\n \n \n \n \n \n \n \n Returns : Promise\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n loadGLTF2\n \n \n \n \n \n \nloadGLTF2(scenegraphNodeName, gltfPromise)\n \n \n\n\n\n\n \n \n\n \n Parameters :\n \n \n \n Name\n Optional\n \n \n \n \n scenegraphNodeName\n\n \n No\n \n\n\n \n \n gltfPromise\n\n \n No\n \n\n\n \n \n \n \n \n \n \n Returns : Promise\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n registerGLTFLoaders\n \n \n \n \n \n \nregisterGLTFLoaders()\n \n \n\n\n\n\n \n \n\n \n Returns : void\n\n \n \n \n \n \n projects/ccf-body-ui/src/lib/util/spatial-scene-collider.ts\n \n \n \n \n \n \n \n doCollisions\n \n \n \n \n \n \ndoCollisions(scene)\n \n \n\n\n\n\n \n \n\n \n Parameters :\n \n \n \n Name\n Optional\n \n \n \n \n scene\n\n \n No\n \n\n\n \n \n \n \n \n \n \n Returns : Promise\n\n \n \n \n \n \n \n \n \n projects/ccf-body-ui/src/lib/body-ui-layer.ts\n \n \n \n \n \n \n \n meshLayer\n \n \n \n \n \n \nmeshLayer(id, data, options)\n \n \n\n\n\n\n \n \n\n \n Parameters :\n \n \n \n Name\n Optional\n \n \n \n \n id\n\n \n No\n \n\n\n \n \n data\n\n \n No\n \n\n\n \n \n options\n\n \n No\n \n\n\n \n \n \n \n \n \n \n Returns : SimpleMeshLayer | undefined\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n textLayer\n \n \n \n \n \n \ntextLayer(id, data, options)\n \n \n\n\n\n\n \n \n\n \n Parameters :\n \n \n \n Name\n Optional\n \n \n \n \n id\n\n \n No\n \n\n\n \n \n data\n\n \n No\n \n\n\n \n \n options\n\n \n No\n \n\n\n \n \n \n \n \n \n \n Returns : TextLayer | undefined\n\n \n \n \n \n \n \n \n \n projects/ccf-body-ui/src/lib/util/parse-csv.ts\n \n \n \n \n \n \n \n parseCSV\n \n \n \n \n \n \nparseCSV(sourceUrl, firstFieldName?)\n \n \n\n\n\n\n \n \n\n \n Parameters :\n \n \n \n Name\n Optional\n \n \n \n \n sourceUrl\n\n \n No\n \n\n\n \n \n firstFieldName\n\n \n Yes\n \n\n\n \n \n \n \n \n \n \n Returns : Promise\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n parseCSVText\n \n \n \n \n \n \nparseCSVText(csvText, firstFieldName?)\n \n \n\n\n\n\n \n \n\n \n Parameters :\n \n \n \n Name\n Optional\n \n \n \n \n csvText\n\n \n No\n \n\n\n \n \n firstFieldName\n\n \n Yes\n \n\n\n \n \n \n \n \n \n \n Returns : Promise\n\n \n \n \n \n \n \n \n \n projects/ccf-body-ui/src/lib/util/process-anatomical-structures.ts\n \n \n \n \n \n \n \n processAnatomicalStructures\n \n \n \n \n \n \nprocessAnatomicalStructures(sourceUrl, entities)\n \n \n\n\n\n\n \n \n\n \n Parameters :\n \n \n \n Name\n Optional\n \n \n \n \n sourceUrl\n\n \n No\n \n\n\n \n \n entities\n\n \n No\n \n\n\n \n \n \n \n \n \n \n Returns : Promise\n\n \n \n \n \n \n \n \n \n projects/ccf-body-ui/src/lib/util/process-extraction-sites.ts\n \n \n \n \n \n \n \n processExtractionSites\n \n \n \n \n \n \nprocessExtractionSites(sourceUrl, entities)\n \n \n\n\n\n\n \n \n\n \n Parameters :\n \n \n \n Name\n Optional\n \n \n \n \n sourceUrl\n\n \n No\n \n\n\n \n \n entities\n\n \n No\n \n\n\n \n \n \n \n \n \n \n Returns : Promise\n\n \n \n \n \n \n \n \n \n projects/ccf-body-ui/src/lib/util/process-reference-data.ts\n \n \n \n \n \n \n \n processReferenceData\n \n \n \n \n \n \nprocessReferenceData(refEntities, config)\n \n \n\n\n\n\n \n \n\n \n Parameters :\n \n \n \n Name\n Optional\n \n \n \n \n refEntities\n\n \n No\n \n\n\n \n \n config\n\n \n No\n \n\n\n \n \n \n \n \n \n \n Returns : Promise\n\n \n \n \n \n \n \n \n \n projects/ccf-body-ui/src/lib/util/process-spatial-entities.ts\n \n \n \n \n \n \n \n processSpatialEntities\n \n \n \n \n \n \nprocessSpatialEntities(parent, gltfOverride?)\n \n \n\n\n\n\n \n \n\n \n Parameters :\n \n \n \n Name\n Optional\n \n \n \n \n parent\n\n \n No\n \n\n\n \n \n gltfOverride\n\n \n Yes\n \n\n\n \n \n \n \n \n \n \n Returns : Promise\n\n \n \n \n \n \n \n \n \n projects/ccf-body-ui/src/lib/util/simplify-scene.ts\n \n \n \n \n \n \n \n simplifyScene\n \n \n \n \n \n \nsimplifyScene(nodes)\n \n \n\n\n\n\n \n \n\n \n Parameters :\n \n \n \n Name\n Optional\n \n \n \n \n nodes\n\n \n No\n \n\n\n \n \n \n \n \n \n \n Returns : Promise\n\n \n \n \n \n \n \n \n \n projects/ccf-body-ui/src/lib/util/scene-traversal.ts\n \n \n \n \n \n \n \n traverseScene\n \n \n \n \n \n \ntraverseScene(scene, worldMatrix, visitor)\n \n \n\n\n\n\n \n \n\n \n Parameters :\n \n \n \n Name\n Optional\n \n \n \n \n scene\n\n \n No\n \n\n\n \n \n worldMatrix\n\n \n No\n \n\n\n \n \n visitor\n\n \n No\n \n\n\n \n \n \n \n \n \n \n Returns : boolean\n\n \n \n \n \n \n \n \n \n\n\n\n \n \n result-matching \"\"\n \n \n \n No results matching \"\"\n \n\n"},"index.html":{"url":"index.html","title":"getting-started - index","body":"\n \n\nCommon Coordinate Framework (CCF) - User Interfaces\n\n\n\n\n\n\n\nThis repository is a monorepo (multiple projects in one repository) containing the software to build the CCF-EUI, CCF-RUI, and CCF-Organ-Info.\nWebsite Links\n\nCCF Exploration User Interface (CCF-EUI)\n:star2: 4.0 BETA: https://beta--hubmap-ccf-ui.netlify.app\nProduction: https://portal.hubmapconsortium.org/ccf-eui\nProduction (alt): https://hubmapconsortium.github.io/ccf-ui/\nStaging: https://hubmap-ccf-ui.netlify.app/\nOld Version 0.6.0: https://old--hubmap-ccf-ui.netlify.app\n\n\nCCF Registration User Interface (CCF-RUI)\n:star2: 4.0 BETA: https://beta--hubmap-ccf-ui.netlify.app/rui/\nProduction: https://hubmapconsortium.github.io/ccf-ui/rui/\nStaging: https://hubmap-ccf-ui.netlify.app/rui/\n\n\nCCF Organ Info Component (CCF-Organ-Info)\nProduction: https://hubmapconsortium.github.io/ccf-ui/organ-info/\nStaging: https://hubmap-ccf-ui.netlify.app/organ-info/\n\n\nCCF API\nProduction: https://ccf-api.hubmapconsortium.org\nStaging: https://r5i95k35v5.us-east-2.awsapprunner.com\nOpenAPI Specification: ccf-api-spec.yaml\n\n\nCCF API Client Libraries:\nJavaScript: @ccf-openapi/js-client\nTypeScript: @ccf-openapi/ts-client\nAngular 12+: @ccf-openapi/ng-client\nPython 3.6+: ccf-openapi\n\n\n\nBackground and More Information\nFor more information about the Common Coordinate Framework (CCF), see the HuBMAP CCF Portal at https://hubmapconsortium.github.io/ccf/.\nChange Log\nSee the ChangeLog for the latest developments.\nCredits\nThis software is developed by the Cyberinfrastructure for Network Science Center at Indiana University. It is funded by NIH Award OT2OD026671.\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n \n\n\n\n\n \n \n result-matching \"\"\n \n \n \n No results matching \"\"\n \n\n"},"license.html":{"url":"license.html","title":"getting-started - license","body":"\n \n\nMIT License\nCopyright (c) 2019 HuBMAP Consortium\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n \n\n\n\n\n \n \n result-matching \"\"\n \n \n \n No results matching \"\"\n \n\n"},"modules.html":{"url":"modules.html","title":"modules - modules","body":"\n \n\n\n\n\n Modules\n\n\n \n \n\n\n\n\n\n\n\n\n\n\n\n\n \n\n\n\n\n \n \n result-matching \"\"\n \n \n \n No results matching \"\"\n \n\n"},"overview.html":{"url":"overview.html","title":"overview - overview","body":"\n \n\n\n\n Overview\n\n \n\n \n \n \n \n \n 2 Classes\n \n \n \n \n \n \n \n 9 Interfaces\n \n \n \n \n\n\n \n\n\n\n\n\n\n\n\n\n\n\n \n\n\n\n\n \n \n result-matching \"\"\n \n \n \n No results matching \"\"\n \n\n"},"miscellaneous/typealiases.html":{"url":"miscellaneous/typealiases.html","title":"miscellaneous-typealiases - typealiases","body":"\n \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n \n\n\n Miscellaneous\n Type aliases\n\n\n\n Index\n \n \n \n \n \n \n NodeClickEvent   (projects/.../body-ui.ts)\n \n \n NodeDragEvent   (projects/.../body-ui.ts)\n \n \n SceneTraversalVisitor   (projects/.../scene-traversal.ts)\n \n \n SpatialSceneGeometry   (projects/.../spatial-scene-node.ts)\n \n \n \n \n \n \n\n\n projects/ccf-body-ui/src/lib/body-ui.ts\n \n \n \n \n \n \n NodeClickEvent\n \n \n \n \n literal type\n\n \n \n \n \n \n \n \n \n \n NodeDragEvent\n \n \n \n \n literal type\n\n \n \n \n \n projects/ccf-body-ui/src/lib/util/scene-traversal.ts\n \n \n \n \n \n \n SceneTraversalVisitor\n \n \n \n \n function\n\n \n \n \n \n projects/ccf-body-ui/src/lib/shared/spatial-scene-node.ts\n \n \n \n \n \n \n SpatialSceneGeometry\n \n \n \n \n \"sphere\" | \"cube\" | \"wireframe\" | \"text\" | \"cone\" | \"cylinder\"\n\n \n \n \n \n\n\n\n \n \n result-matching \"\"\n \n \n \n No results matching \"\"\n \n\n"},"miscellaneous/variables.html":{"url":"miscellaneous/variables.html","title":"miscellaneous-variables - variables","body":"\n \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n \n\n\n Miscellaneous\n Variables\n\n\n\n Index\n \n \n \n \n \n \n referenceDataConfig   (projects/.../process-reference-data.ts)\n \n \n \n \n \n \n\n\n projects/ccf-body-ui/src/lib/util/process-reference-data.ts\n \n \n \n \n \n \n \n referenceDataConfig\n \n \n \n \n \n \n Type : object\n\n \n \n \n \n Default value : {\n extractionSitesUrl: 'http://localhost:8080/source_data/asct-b-3d-models-extraction-sites.csv',\n extractionSitesConfigUrl: 'http://localhost:8080/source_data/extraction-site-config.csv',\n anatomicalStructuresUrl: 'http://localhost:8080/source_data/asct-b-3d-models-mapping.csv',\n referenceOrganConfigUrl: 'http://localhost:8080/source_data/reference-organ-config.csv'\n}\n \n \n\n\n \n \n\n\n\n\n \n \n result-matching \"\"\n \n \n \n No results matching \"\"\n \n\n"}} + "index": {"version":"2.3.9","fields":["title","body"],"fieldVectors":[["title/classes/BodyUILayer.html",[0,1.249,1,1.249]],["body/classes/BodyUILayer.html",[0,0.943,1,1.799,2,1.711,3,0.417,4,0.557,5,0.355,6,0.632,7,0.412,8,1.757,9,1.543,10,1.441,11,1.065,12,3.678,13,0.298,14,0.709,15,4.503,16,2.629,17,2.497,18,3.678,19,3.108,20,3.678,21,4.049,22,4.049,23,0.516,24,0.053,25,1.239,26,2.497,27,1.381,28,3.476,29,2.122,30,1.111,31,2.122,32,2.122,33,2.122,34,2.507,35,1.239,36,0.727,37,1.814,38,2.966,39,2.122,40,2.122,41,1.578,42,2.122,43,1.253,44,2.122,45,1.077,46,2.497,47,1.711,48,3.108,49,2.966,50,1.711,51,1.578,52,3.108,53,3.108,54,3.108,55,3.359,56,3.108,57,1.711,58,0.828,59,0.727,60,1.295,61,0.943,62,0.709,63,1.213,64,1.814,65,1.441,66,1.814,67,2.122,68,1.239,69,2.497,70,2.122,71,2.122,72,1.578,73,1.711,74,2.228,75,2.749,76,3.108,77,2.001,78,1.635,79,3.108,80,1.58,81,3.057,82,4.652,83,1.711,84,2.122,85,4.049,86,2.11,87,1.635,88,4.049,89,2.11,90,2.11,91,2.497,92,0.723,93,4.771,94,1.915,95,2.122,96,2.785,97,2.122,98,1.711,99,2.122,100,2.122,101,2.188,102,3.108,103,3.108,104,1.634,105,1.634,106,1.867,107,2.147,108,1.634,109,1.814,110,1.814,111,2.286,112,3.108,113,2.927,114,1.381,115,1.54,116,3.678,117,1.58,118,2.122,119,1.711,120,2.122,121,2.966,122,2.122,123,2.122,124,2.749,125,2.122,126,0.557,127,2.966,128,1.213,129,2.198,130,2.122,131,2.122,132,1.814,133,2.122,134,2.122,135,2.122,136,0.943,137,2.122,138,2.122,139,1.799,140,2.122,141,2.122,142,2.122,143,2.122,144,2.122,145,2.122,146,2.122,147,2.122,148,2.122,149,3.678,150,2.122,151,2.122,152,2.122,153,2.122,154,1.634,155,2.122,156,1.814,157,2.122,158,1.711,159,1.711,160,1.441,161,3.108,162,2.122,163,4.049,164,1.077,165,2.122,166,2.122,167,2.122,168,2.122,169,2.122,170,1.239,171,1.239,172,0.943,173,2.122,174,1.077,175,2.122,176,2.122,177,2.122,178,2.122,179,1.441,180,2.122,181,4.049,182,4.049,183,2.122,184,3.108,185,2.122,186,2.122,187,2.122,188,2.122,189,2.122,190,2.122,191,2.122,192,2.122,193,0.019,194,0.028,195,0.019]],["title/interfaces/BodyUIProps.html",[196,0.024,197,1.427]],["body/interfaces/BodyUIProps.html",[0,1.176,1,1.436,3,0.635,4,0.45,5,0.287,6,0.24,7,0.295,8,0.668,9,0.907,11,0.587,13,0.371,14,0.604,16,2.923,23,0.703,24,0.053,27,1.746,30,1.105,36,1.246,37,2.784,41,2.565,43,1.205,45,0.87,51,0.87,58,1.533,59,0.587,60,1.344,61,0.761,62,0.604,63,1.62,74,1.987,77,1.436,78,1.246,80,1.744,87,1.731,92,0.772,94,1.176,96,1.887,101,2.108,104,1.746,105,1.746,106,1.995,107,2.293,108,1.176,109,1,110,1,113,1,114,0.761,115,1.612,117,1.032,126,1.032,128,0.668,129,2.083,132,2.863,136,2.245,139,0.761,154,0.761,164,0.87,170,1,171,1,172,0.761,174,0.87,193,0.016,194,0.024,195,0.024,196,0.028,197,1.343,198,0.337,199,0.87,200,2.819,201,2.468,202,2.468,203,2.468,204,2.468,205,2.668,206,2.668,207,1.846,208,2.468,209,1.744,210,3.036,211,2.195,212,2.195,213,2.195,214,2.195,215,1.796,216,1.796,217,1.796,218,1.796,219,1.163,220,2.61,221,1,222,1.163,223,2.678,224,1,225,1.163,226,1.163,227,1.796,228,0.87,229,1.163,230,2.27,231,2.195,232,2.468,233,2.468,234,2.198,235,1.418,236,1.163,237,2.195,238,0.87,239,1.796,240,1,241,2.668,242,1,243,1.796,244,1.163,245,1.163,246,0.87,247,1,248,3.456,249,1.163,250,1.163,251,1.163,252,1.163,253,1.163,254,1.163,255,1.163,256,1.163,257,1.163,258,1.163,259,1.163,260,1.163,261,1.163,262,1.163,263,1.163,264,1.163,265,1.163,266,1.163,267,1.163,268,1.163,269,1.163,270,1.163,271,1.163,272,2.668,273,1.163,274,1.796,275,1.163,276,1.163,277,1,278,1.796,279,1,280,1.163,281,1.163,282,1.163,283,1.796,284,1.796,285,1.163,286,1.163,287,1.163,288,1.163,289,1.163,290,1.163,291,1.163,292,1.163,293,1.163,294,1.163,295,1.163,296,1.163,297,1.163,298,1.163,299,1.163,300,1.796,301,1.163,302,1.163,303,1.163,304,1.163,305,1.163,306,1.163,307,1.163,308,1.163,309,1.163,310,3.036,311,3.036,312,1.163,313,1.544,314,1.163,315,1.163,316,1.544,317,1.796,318,1.163,319,1.163,320,1.163,321,0.87,322,1.163,323,2.195,324,1.343,325,1.163,326,1.163,327,1.163,328,1.796,329,1.163,330,1.163,331,1.163,332,1.163,333,2.195,334,1.163,335,1.163,336,1.796,337,1.163,338,2.195,339,1.163,340,1.163,341,1.846,342,1.544,343,1.343,344,1.032,345,1.163,346,1.163,347,1.163,348,1.163,349,2.195,350,1.163,351,1.163,352,1.163,353,1.163,354,0.87,355,1.163,356,1.163,357,1.163,358,1.163,359,1.163,360,1.163,361,1.544,362,0.761,363,1.163,364,0.87,365,1.163,366,1.163,367,1.163,368,2.668,369,1.163,370,1.163,371,1.163,372,1.163,373,1.163,374,1.163,375,1.163,376,1.163,377,1.796,378,1.163,379,2.195,380,1.163,381,1.796,382,1.796,383,1.163,384,1.163,385,1.163,386,1.163,387,1.163,388,2.195,389,1.163,390,1.163,391,1.163,392,1.163,393,1.163,394,1.163,395,1.163,396,1.163,397,1.163,398,1.163,399,1.163,400,0.761,401,1.163,402,1.163,403,1.163,404,1.163,405,1.163,406,1.163,407,2.195,408,1.163,409,1.163,410,1.163,411,1.163,412,1.163,413,1.163,414,1.163,415,1.163]],["title/interfaces/BodyUIViewStateProps.html",[196,0.024,230,1.427]],["body/interfaces/BodyUIViewStateProps.html",[0,1.202,1,1.462,3,0.647,4,0.463,5,0.295,6,0.247,7,0.301,8,0.688,9,0.927,11,0.927,13,0.38,14,0.617,16,2.94,23,0.649,24,0.053,27,1.769,30,1.078,36,1.265,37,2.804,41,2.578,43,1.215,45,0.895,51,0.895,58,1.553,59,0.604,60,1.356,61,0.784,62,0.617,63,1.639,74,2.005,77,1.462,78,1.265,80,1.761,87,1.74,92,0.532,94,1.202,96,1.921,101,2.133,104,1.769,105,1.769,106,2.021,107,2.324,108,1.202,109,1.029,110,1.029,113,1.029,114,0.784,115,1.609,117,1.055,126,1.046,128,0.688,129,2.099,132,2.881,136,2.099,139,0.784,154,0.784,164,0.895,170,1.029,171,1.029,172,0.784,174,0.895,193,0.016,194,0.025,195,0.025,196,0.029,197,0.895,198,0.347,199,0.895,200,2.852,201,1.197,202,1.197,203,1.197,204,1.197,205,1.837,206,1.837,207,0.895,208,1.197,209,1.761,210,3.064,211,1.197,212,1.197,213,2.234,214,2.234,215,1.837,216,1.837,217,1.837,218,2.234,219,1.197,220,2.634,221,1.029,222,1.197,223,2.701,224,1.029,225,1.197,226,1.197,227,1.837,228,0.895,229,1.197,230,2.349,231,2.852,232,2.969,233,2.969,234,2.22,235,1.44,236,1.197,237,2.234,238,0.895,239,1.837,240,1.029,241,2.703,242,1.029,243,1.837,244,1.197,245,1.197,246,0.895,247,1.029,248,3.473,249,1.197,250,1.197,251,1.197,252,1.197,253,1.197,254,1.197,255,1.197,256,1.197,257,1.197,258,1.197,259,1.197,260,1.197,261,1.197,262,1.197,263,1.197,264,1.197,265,1.197,266,1.197,267,1.197,268,1.197,269,1.197,270,1.197,271,1.197,272,2.703,273,1.197,274,1.837,275,1.197,276,1.197,277,1.029,278,1.837,279,1.029,280,1.197,281,1.197,282,1.197,283,1.837,284,1.837,285,1.197,286,1.197,287,1.197,288,1.197,289,1.197,290,1.197,291,1.197,292,1.197,293,1.197,294,1.197,295,1.197,296,1.197,297,1.197,298,1.197,299,1.197,300,1.837,301,1.197,302,1.197,303,1.197,304,1.197,305,1.197,306,1.197,307,1.197,308,1.197,309,1.197,310,3.064,311,3.064,312,1.197,313,1.579,314,1.197,315,1.197,316,1.579,317,1.837,318,1.197,319,1.197,320,1.197,321,0.895,322,1.197,323,2.234,324,1.373,325,1.197,326,1.197,327,1.197,328,1.837,329,1.197,330,1.197,331,1.197,332,1.197,333,2.234,334,1.197,335,1.197,336,1.837,337,1.197,338,2.234,339,1.197,340,1.197,341,1.874,342,1.579,343,1.373,344,1.055,345,1.197,346,1.197,347,1.197,348,1.197,349,2.234,350,1.197,351,1.197,352,1.197,353,1.197,354,0.895,355,1.197,356,1.197,357,1.197,358,1.197,359,1.197,360,1.197,361,1.579,362,0.784,363,1.197,364,0.895,365,1.197,366,1.197,367,1.197,368,2.703,369,1.197,370,1.197,371,1.197,372,1.197,373,1.197,374,1.197,375,1.197,376,1.197,377,1.837,378,1.197,379,2.234,380,1.197,381,1.837,382,1.837,383,1.197,384,1.197,385,1.197,386,1.197,387,1.197,388,2.234,389,1.197,390,1.197,391,1.197,392,1.197,393,1.197,394,1.197,395,1.197,396,1.197,397,1.197,398,1.197,399,1.197,400,0.784,401,1.197,402,1.197,403,1.197,404,1.197,405,1.197,406,1.197,407,2.234,408,1.197,409,1.197,410,1.197,411,1.197,412,1.197,413,1.197,414,1.197,415,1.197]],["title/interfaces/Collision.html",[196,0.024,416,1.908]],["body/interfaces/Collision.html",[3,0.534,4,0.713,5,0.455,6,0.381,7,0.248,13,0.381,14,0.844,23,0.664,24,0.052,25,2.16,30,1.237,35,3.15,43,1.312,58,1.06,59,0.931,60,1.112,61,1.207,62,1.031,63,1.444,68,2.457,72,1.379,77,1.871,80,1.444,81,2.858,87,1.742,92,1.056,94,1.871,104,1.645,105,1.207,111,1.379,126,0.713,128,1.06,129,2.434,156,1.585,159,2.985,179,3.211,193,0.025,194,0.034,195,0.025,196,0.024,198,0.534,209,1.06,321,1.379,324,1.379,416,2.858,417,1.844,418,1.844,419,4.881,420,1.844,421,2.19,422,3.701,423,2.19,424,3.701,425,2.19,426,3.645,427,2.19,428,1.844,429,1.844,430,1.585,431,2.19,432,2.19,433,2.716,434,2.716,435,4.21,436,2.716,437,3.701,438,2.716,439,2.716,440,2.716,441,3.701,442,3.645,443,2.716,444,3.645,445,2.716,446,2.716,447,3.395,448,3.701,449,3.395,450,2.985,451,2.985,452,2.985,453,2.985,454,2.985,455,2.985,456,4.21,457,2.716,458,2.716,459,2.716,460,2.716,461,2.716,462,2.19,463,2.716,464,2.19,465,2.19,466,2.985,467,2.19,468,2.19,469,2.19,470,2.19,471,2.19,472,2.19,473,2.716,474,2.19,475,4.52,476,3.701,477,2.716,478,2.716,479,2.716,480,2.716,481,2.716,482,2.716,483,2.716,484,2.716,485,2.716,486,2.716,487,2.716,488,2.716,489,2.716,490,2.716,491,2.716,492,4.73,493,3.701,494,3.645,495,3.701,496,3.701,497,2.716,498,2.716,499,2.716,500,2.716,501,2.716,502,2.19]],["title/interfaces/PickInfo.html",[196,0.024,234,1.427]],["body/interfaces/PickInfo.html",[0,1.206,1,1.467,3,0.649,4,0.465,5,0.297,6,0.249,7,0.302,8,0.691,9,0.93,11,0.607,13,0.56,14,0.619,16,2.942,23,0.634,24,0.053,27,1.773,30,0.96,36,1.268,37,2.808,41,2.58,43,1.217,45,0.899,51,0.899,58,1.288,59,0.607,60,1.358,61,0.787,62,0.619,63,1.642,74,2.008,77,1.467,78,1.268,80,1.763,87,1.742,92,0.534,94,1.206,96,1.926,101,2.137,104,1.773,105,1.773,106,2.025,107,2.328,108,1.206,109,1.034,110,1.034,113,1.926,114,0.787,115,1.599,117,1.059,126,1.048,128,0.691,129,2.101,132,2.884,136,2.168,139,0.787,154,0.787,164,0.899,170,1.034,171,1.034,172,0.787,174,0.899,193,0.016,194,0.025,195,0.025,196,0.029,197,0.899,198,0.348,199,0.899,200,2.241,201,1.203,202,1.203,203,1.203,204,1.203,205,1.843,206,1.843,207,0.899,208,1.203,209,1.556,210,2.708,211,1.203,212,1.203,213,2.241,214,2.241,215,1.843,216,1.843,217,1.843,218,1.843,219,1.203,220,2.638,221,1.034,222,1.203,223,2.705,224,1.034,225,1.203,226,1.203,227,2.708,228,0.899,229,1.203,230,2.294,231,2.241,232,2.512,233,2.512,234,2.294,235,1.709,236,2.512,237,2.857,238,1.878,239,2.708,240,1.034,241,2.708,242,1.034,243,1.843,244,1.203,245,1.203,246,0.899,247,1.034,248,3.476,249,1.203,250,1.203,251,1.203,252,1.203,253,1.203,254,1.203,255,1.203,256,1.203,257,1.203,258,1.203,259,1.203,260,1.203,261,1.203,262,1.203,263,1.203,264,1.203,265,1.203,266,1.203,267,1.203,268,1.203,269,1.203,270,1.203,271,1.203,272,2.708,273,1.203,274,1.843,275,1.203,276,1.203,277,1.034,278,1.843,279,1.034,280,1.203,281,1.203,282,1.203,283,1.843,284,1.843,285,1.203,286,1.203,287,1.203,288,1.203,289,1.203,290,1.203,291,1.203,292,1.203,293,1.203,294,1.203,295,1.203,296,1.203,297,1.203,298,1.203,299,1.203,300,1.843,301,1.203,302,1.203,303,1.203,304,1.203,305,1.203,306,1.203,307,1.203,308,1.203,309,1.203,310,3.068,311,3.068,312,1.203,313,1.585,314,1.203,315,1.203,316,1.585,317,1.843,318,1.203,319,1.203,320,1.203,321,0.899,322,1.203,323,2.241,324,1.378,325,1.203,326,1.203,327,1.203,328,1.843,329,1.203,330,1.203,331,1.203,332,1.203,333,2.241,334,1.203,335,1.203,336,1.843,337,1.203,338,2.241,339,1.203,340,1.203,341,1.878,342,1.585,343,1.378,344,1.059,345,1.203,346,1.203,347,1.203,348,1.203,349,2.241,350,1.203,351,1.203,352,1.203,353,1.203,354,0.899,355,1.203,356,1.203,357,1.203,358,1.203,359,1.203,360,1.203,361,1.585,362,0.787,363,1.203,364,0.899,365,1.203,366,1.203,367,1.203,368,2.708,369,1.203,370,1.203,371,1.203,372,1.203,373,1.203,374,1.203,375,1.203,376,1.203,377,1.843,378,1.203,379,2.241,380,1.203,381,1.843,382,1.843,383,1.203,384,1.203,385,1.203,386,1.203,387,1.203,388,2.241,389,1.203,390,1.203,391,1.203,392,1.203,393,1.203,394,1.203,395,1.203,396,1.203,397,1.203,398,1.203,399,1.203,400,0.787,401,1.203,402,1.203,403,1.203,404,1.203,405,1.203,406,1.203,407,2.241,408,1.203,409,1.203,410,1.203,411,1.203,412,1.203,413,1.203,414,1.203,415,1.203]],["title/interfaces/ProcessedNode.html",[196,0.024,503,1.908]],["body/interfaces/ProcessedNode.html",[3,0.544,4,0.727,5,0.463,6,0.388,7,0.253,11,1.284,13,0.388,14,0.855,17,2.544,23,0.668,24,0.052,30,1.165,43,1.25,55,1.879,58,1.658,59,0.948,60,1.369,61,1.229,62,1.039,63,2.089,64,1.615,66,2.188,68,2.188,72,1.903,77,1.665,80,1.079,81,2.885,87,1.72,92,0.737,94,1.665,101,2.312,104,1.665,105,1.229,111,1.405,114,1.665,117,1.079,126,0.984,127,2.231,128,1.462,129,2.432,139,1.229,154,1.665,172,1.229,174,1.405,193,0.025,194,0.034,195,0.025,196,0.024,198,0.544,316,2.188,321,1.405,324,1.405,341,1.903,354,1.405,362,1.889,364,1.405,420,1.879,426,3.839,427,4.047,428,1.879,429,1.879,430,1.615,431,2.231,442,3.022,444,3.022,449,3.673,450,2.231,451,2.231,452,2.231,453,2.231,454,2.231,455,2.231,462,2.231,464,2.231,465,2.231,466,3.022,467,2.231,468,2.231,469,2.231,470,2.231,471,2.231,472,2.231,474,3.022,502,2.231,503,3.552,504,1.615,505,1.879,506,3.839,507,3.673,508,4.76,509,2.231,510,2.885,511,3.748,512,2.767,513,2.767,514,2.767,515,2.767,516,3.427,517,2.767,518,3.748,519,3.748,520,3.748,521,2.231,522,3.748,523,2.767,524,2.767,525,2.767,526,2.767,527,2.767,528,2.231,529,2.767,530,2.767,531,2.767,532,3.748,533,2.767,534,2.767,535,4.25,536,2.767,537,2.767,538,2.767,539,3.748,540,2.767,541,2.767,542,2.767,543,2.767,544,2.767,545,2.767,546,2.767,547,2.767,548,2.767,549,2.767,550,2.767,551,2.767,552,2.767,553,2.767,554,2.767,555,2.767]],["title/interfaces/SpatialEntityJsonLd.html",[196,0.024,556,1.427]],["body/interfaces/SpatialEntityJsonLd.html",[3,0.551,4,0.993,5,0.633,6,0.393,7,0.256,11,1.569,13,0.393,14,0.862,23,0.788,24,0.052,30,1.302,43,0.736,78,1.688,92,0.968,115,1.678,126,1.123,193,0.026,194,0.035,195,0.026,196,0.037,198,0.551,209,1.093,235,1.786,556,1.919,557,1.635,558,1.245,559,1.635,560,3.246,561,3.246,562,3.109,563,3.109,564,3.109,565,3.109,566,3.109,567,3.109,568,3.109,569,3.109,570,3.109,571,2.791,572,2.673,573,2.673,574,3.109,575,2.673,576,2.673,577,3.109,578,3.109,579,3.109,580,3.109,581,3.109,582,3.109,583,2.324,584,2.599,585,2.904,586,2.904,587,2.497,588,2.497,589,1.902,590,1.635,591,1.902,592,1.902,593,1.902,594,1.902,595,1.902,596,1.902,597,1.902,598,1.902,599,1.902,600,1.902,601,1.902,602,1.902,603,1.902,604,1.902]],["title/interfaces/SpatialObjectReferenceJsonLd.html",[196,0.024,583,1.427]],["body/interfaces/SpatialObjectReferenceJsonLd.html",[3,0.665,4,1.123,5,0.85,6,0.475,7,0.309,11,1.688,13,0.475,14,0.976,23,0.765,24,0.051,30,1.3,43,0.889,78,1.466,92,1.02,115,1.666,126,1.231,193,0.031,194,0.039,195,0.031,196,0.041,198,0.665,209,1.32,235,1.32,556,1.718,557,1.975,558,1.504,559,1.975,560,3.448,561,2.903,562,2.298,563,2.298,564,2.298,565,2.298,566,2.298,567,2.298,568,2.298,569,2.298,570,2.298,571,2.965,572,1.975,573,1.975,574,2.298,575,1.975,576,1.975,577,2.298,578,2.298,579,2.298,580,2.298,581,2.298,582,2.298,583,2.38,584,2.633,585,2.298,586,2.298,587,1.975,588,1.975,589,2.298,590,1.975,591,2.298,592,2.298,593,2.298,594,2.298,595,2.298,596,2.298,597,2.298,598,2.298,599,2.298,600,2.298,601,2.298,602,2.298,603,2.298,604,3.344]],["title/interfaces/SpatialPlacementJsonLd.html",[196,0.024,584,1.427]],["body/interfaces/SpatialPlacementJsonLd.html",[3,0.594,4,1.287,5,0.665,6,0.424,7,0.276,11,1.617,13,0.424,14,0.907,23,0.785,24,0.052,30,1.299,36,1.617,43,0.793,78,1.362,92,0.989,115,1.698,126,1.166,193,0.028,194,0.036,195,0.028,196,0.039,198,0.594,209,1.841,235,1.178,556,1.533,557,1.763,558,1.342,559,1.763,560,3.328,561,3.328,562,2.051,563,2.051,564,2.051,565,2.051,566,2.051,567,2.051,568,2.051,569,2.051,570,2.051,571,2.319,572,1.763,573,1.763,574,2.051,575,1.763,576,1.763,577,2.051,578,2.051,579,2.051,580,2.051,581,2.051,582,2.051,583,2.017,584,2.489,585,2.051,586,2.051,587,1.763,588,1.763,589,2.051,590,1.763,591,3.203,592,3.203,593,3.203,594,3.203,595,3.203,596,3.203,597,3.203,598,3.203,599,3.203,600,3.203,601,3.203,602,3.203,603,3.203,604,2.051]],["title/interfaces/SpatialSceneNode.html",[60,0.845,196,0.024]],["body/interfaces/SpatialSceneNode.html",[3,0.615,4,0.821,5,0.523,6,0.439,7,0.286,13,0.439,14,0.927,23,0.787,24,0.052,30,1.291,35,2.791,36,1.938,43,0.821,55,3.246,58,1.866,59,1.072,60,1.222,62,0.713,86,2.123,89,2.123,90,2.123,91,2.123,92,0.94,111,1.587,114,2.125,115,1.666,117,1.866,124,3.365,126,1.068,136,2.356,139,2.125,160,3.246,172,2.125,193,0.029,194,0.037,195,0.029,196,0.027,198,0.615,362,2.125,364,2.427,447,3.856,528,3.856,572,2.791,573,2.791,605,2.123,606,2.123,607,4.782,608,4.782,609,4.782,610,3.856]],["title/changelog.html",[611,1.61,612,1.384,613,1.61]],["body/changelog.html",[3,0.726,5,0.194,7,0.367,9,1.459,14,0.265,23,0.163,24,0.039,26,0.787,28,0.935,36,0.397,62,0.917,74,2.211,75,1.312,83,0.935,87,1.459,92,0.228,98,1.559,106,1.874,108,0.859,115,0.349,117,1.132,121,0.935,160,0.787,164,1.964,179,1.312,193,0.011,194,0.018,195,0.037,196,0.034,198,0.228,207,0.589,238,0.589,246,2.628,277,1.451,279,0.677,313,0.677,343,2.357,344,1.788,361,0.677,400,1.289,420,1.969,494,3.64,510,0.787,558,1.289,571,1.128,575,1.128,576,0.677,587,0.677,588,1.128,590,2.155,612,1.451,613,1.312,614,1.559,615,0.935,616,3.24,617,1.559,618,3.868,619,3.692,620,5.542,621,4.876,622,1.933,623,1.16,624,1.16,625,1.16,626,1.16,627,1.16,628,1.16,629,4.353,630,1.16,631,1.559,632,1.16,633,3.51,634,2.486,635,1.933,636,2.486,637,4.256,638,1.16,639,1.559,640,0.935,641,1.16,642,1.16,643,4.017,644,1.933,645,3.223,646,2.486,647,2.486,648,1.16,649,1.933,650,4.265,651,1.933,652,2.814,653,1.16,654,4.643,655,1.16,656,3.415,657,1.16,658,2.486,659,3.223,660,1.933,661,2.486,662,2.486,663,1.933,664,2.486,665,1.16,666,1.933,667,1.933,668,1.16,669,3.692,670,3.481,671,3.692,672,1.933,673,1.16,674,1.16,675,2.9,676,1.16,677,1.933,678,1.16,679,1.16,680,1.933,681,2.486,682,2.486,683,2.599,684,1.16,685,1.933,686,1.16,687,1.16,688,1.16,689,1.933,690,4.582,691,1.16,692,3.481,693,1.16,694,1.16,695,1.16,696,2.486,697,2.005,698,1.16,699,1.16,700,2.599,701,1.559,702,1.16,703,3.481,704,4.256,705,4.353,706,1.933,707,3.223,708,1.16,709,3.223,710,1.933,711,3.481,712,1.933,713,1.16,714,1.16,715,1.16,716,1.933,717,2.978,718,3.481,719,2.339,720,1.16,721,3.692,722,4.096,723,1.16,724,1.16,725,1.933,726,1.16,727,2.9,728,1.16,729,1.933,730,2.486,731,1.16,732,1.16,733,2.486,734,2.486,735,1.933,736,1.16,737,1.933,738,1.16,739,1.16,740,1.16,741,4.514,742,1.16,743,0.935,744,0.935,745,2.188,746,0.935,747,1.16,748,1.933,749,0.935,750,1.16,751,1.933,752,2.9,753,2.9,754,1.16,755,1.933,756,2.486,757,1.16,758,1.16,759,1.933,760,1.16,761,1.16,762,3.481,763,2.363,764,2.599,765,2.005,766,1.16,767,2.599,768,1.16,769,2.486,770,3.12,771,4.438,772,1.16,773,1.16,774,1.933,775,2.005,776,1.16,777,1.16,778,1.16,779,3.223,780,1.16,781,1.16,782,1.16,783,1.16,784,2.486,785,1.16,786,1.559,787,1.559,788,1.16,789,3.12,790,1.16,791,1.16,792,1.16,793,1.16,794,1.16,795,1.16,796,2.599,797,2.599,798,1.16,799,1.933,800,1.16,801,1.16,802,2.486,803,1.933,804,1.16,805,1.933,806,1.16,807,1.933,808,1.933,809,1.933,810,1.933,811,1.16,812,2.486,813,1.16,814,1.16,815,0.935,816,1.16,817,2.005,818,1.128,819,1.933,820,1.16,821,1.16,822,1.933,823,1.933,824,1.933,825,1.933,826,1.16,827,1.16,828,1.16,829,2.486,830,1.16,831,1.933,832,1.16,833,1.16,834,1.933,835,3.481,836,1.559,837,1.16,838,0.935,839,1.16,840,1.16,841,3.223,842,2.9,843,1.16,844,2.486,845,1.933,846,3.481,847,1.559,848,2.9,849,1.16,850,1.16,851,2.9,852,1.16,853,1.16,854,1.16,855,1.16,856,1.933,857,1.933,858,1.16,859,1.933,860,1.16,861,0.935,862,1.933,863,1.16,864,1.933,865,1.16,866,1.16,867,2.9,868,1.16,869,1.16,870,1.16,871,1.16,872,1.933,873,1.16,874,1.16,875,1.16,876,1.16,877,1.16,878,1.16,879,1.933,880,1.16,881,1.16,882,1.16,883,1.16,884,1.16,885,1.933,886,1.16,887,3.481,888,1.16,889,2.486,890,1.933,891,1.16,892,1.933,893,1.16,894,0.935,895,0.935,896,1.16,897,1.933,898,1.16,899,1.16,900,1.969,901,1.16,902,1.16,903,1.933,904,1.933,905,1.16,906,1.16,907,1.933,908,1.933,909,1.16,910,1.933,911,2.9,912,2.486,913,1.16,914,1.16,915,1.16,916,1.16,917,0.935,918,0.935,919,1.16,920,1.933,921,1.16,922,1.16,923,1.16,924,1.16,925,1.933,926,2.9,927,1.16,928,1.16,929,1.16,930,1.16,931,3.481,932,2.486,933,1.933,934,1.16,935,1.16,936,2.486,937,1.933,938,1.933,939,1.933,940,2.9,941,1.16,942,1.16,943,1.16,944,1.933,945,1.16,946,1.16,947,1.16,948,1.16,949,1.16,950,2.9,951,1.16,952,2.486,953,2.9,954,1.16,955,2.486,956,3.223,957,1.933,958,1.933,959,1.933,960,1.933,961,2.486,962,2.9,963,3.223,964,1.933,965,2.486,966,1.16,967,1.16,968,3.692,969,2.486,970,1.16,971,2.9,972,2.9,973,4.017,974,1.16,975,1.16,976,1.16,977,1.16,978,1.16,979,1.16,980,1.933,981,1.16,982,1.933,983,1.16,984,1.16,985,1.16,986,1.16,987,1.933,988,1.16,989,1.688,990,1.16,991,1.933,992,2.005,993,1.933,994,2.486,995,1.16,996,1.16,997,1.16,998,1.933,999,1.16,1000,1.16,1001,1.16,1002,1.16,1003,1.16,1004,1.16,1005,1.16,1006,1.933,1007,1.16,1008,1.16,1009,2.9,1010,3.481,1011,1.933,1012,2.486,1013,1.933,1014,2.9,1015,1.16,1016,1.16,1017,1.16,1018,1.16,1019,2.486,1020,1.16,1021,1.16,1022,1.16,1023,1.933,1024,1.933,1025,1.933,1026,1.933,1027,2.486,1028,1.16,1029,1.16,1030,1.16,1031,1.16,1032,1.16,1033,1.16,1034,0.935,1035,1.16,1036,1.16,1037,1.16,1038,1.933,1039,1.16,1040,1.16,1041,1.933,1042,1.16,1043,1.16,1044,1.16,1045,1.16,1046,1.16,1047,1.16,1048,1.16,1049,1.16,1050,1.16,1051,1.16,1052,3.868,1053,1.16,1054,2.005,1055,2.486,1056,2.9,1057,1.933,1058,2.486,1059,1.16,1060,1.933,1061,1.16,1062,1.16,1063,1.933,1064,1.933,1065,1.933,1066,1.16,1067,1.16,1068,1.16,1069,1.16,1070,1.933,1071,1.16,1072,2.486,1073,1.16,1074,1.16,1075,1.16,1076,1.16,1077,0.935,1078,1.16,1079,1.16,1080,1.16,1081,1.16,1082,1.16,1083,1.16,1084,1.16,1085,1.16,1086,1.16,1087,1.16,1088,1.16,1089,3.223,1090,1.16,1091,1.16,1092,1.16,1093,1.16,1094,1.16,1095,1.16,1096,1.16,1097,1.16,1098,1.16,1099,1.16,1100,1.16,1101,1.16,1102,1.16,1103,1.16,1104,1.933,1105,1.16,1106,1.933,1107,1.16,1108,1.933,1109,1.933,1110,2.9,1111,2.9,1112,1.933,1113,1.933,1114,1.16,1115,1.16,1116,1.16,1117,2.486,1118,1.16,1119,0.935,1120,1.16,1121,1.16,1122,1.16,1123,1.16,1124,1.16,1125,1.16,1126,1.933,1127,4.145,1128,2.486,1129,1.16,1130,1.933,1131,1.16,1132,1.16,1133,1.16,1134,1.16,1135,1.16,1136,1.16,1137,1.16,1138,1.16,1139,1.16,1140,1.933,1141,2.978,1142,1.933,1143,1.16,1144,1.16,1145,1.16,1146,1.559,1147,1.16,1148,2.9,1149,1.16,1150,1.933,1151,1.16,1152,1.16,1153,1.969,1154,1.16,1155,1.933,1156,1.16,1157,1.16,1158,1.16,1159,1.933,1160,1.933,1161,1.16,1162,1.16,1163,1.16,1164,1.16,1165,1.933,1166,2.486,1167,1.933,1168,1.16,1169,1.16,1170,1.559,1171,1.16,1172,1.16,1173,1.16,1174,1.16,1175,1.16,1176,1.16,1177,1.16,1178,1.16,1179,1.16,1180,0.935,1181,1.16,1182,1.16,1183,1.933,1184,1.16,1185,1.16,1186,1.16,1187,1.16,1188,1.16,1189,1.16,1190,1.16,1191,1.933,1192,1.16,1193,0.935,1194,1.16,1195,1.16,1196,0.935,1197,1.16,1198,1.16,1199,1.16,1200,1.933,1201,1.16,1202,1.16,1203,1.16,1204,1.16,1205,1.16,1206,1.16,1207,1.16,1208,1.16,1209,1.16,1210,1.16,1211,1.16,1212,1.933,1213,1.16,1214,1.16,1215,1.16,1216,1.16,1217,1.933,1218,1.16,1219,0.935,1220,1.16,1221,1.16,1222,1.16,1223,1.16,1224,1.16,1225,1.16,1226,1.16]],["title/coverage.html",[1153,2.571]],["body/coverage.html",[0,1.745,1,1.318,5,0.497,6,0.79,7,0.514,8,1.993,9,1.509,10,2.989,23,0.416,24,0.051,46,2.014,60,0.892,62,1.143,64,1.732,65,2.014,66,1.732,69,2.014,72,2.799,80,2.193,87,1.017,193,0.027,194,0.036,195,0.027,196,0.046,197,1.506,199,2.378,228,1.506,230,1.506,234,1.506,247,1.732,344,1.532,400,1.318,416,2.014,417,2.666,418,2.666,430,1.732,503,2.014,504,3.027,505,2.989,556,1.506,557,2.569,558,2.082,559,2.569,583,1.506,584,1.506,605,2.014,606,2.014,763,2.014,818,1.732,989,2.014,1153,2.014,1227,2.967,1228,2.967,1229,2.392,1230,2.392,1231,2.392,1232,5.528,1233,4.402,1234,2.392,1235,2.967,1236,2.967,1237,2.967,1238,2.967,1239,2.967,1240,2.967,1241,2.967,1242,3.778,1243,3.778,1244,2.392,1245,3.167,1246,3.167,1247,2.392,1248,2.392,1249,2.392,1250,2.392,1251,2.392,1252,2.392,1253,2.666,1254,2.392,1255,2.967,1256,2.392,1257,2.392,1258,2.392,1259,2.392,1260,2.014,1261,2.014,1262,2.392,1263,2.392,1264,2.392,1265,2.967,1266,2.967,1267,2.967]],["title/dependencies.html",[749,1.912,900,2.286]],["body/dependencies.html",[5,0.527,7,0.288,24,0.052,25,1.838,45,1.599,47,2.539,50,2.539,51,2.073,57,2.539,59,1.079,63,1.228,156,1.838,193,0.029,194,0.037,195,0.029,220,1.838,221,2.383,224,1.838,421,2.539,423,2.539,425,2.539,428,2.138,429,2.138,507,2.539,617,2.539,639,2.539,640,2.539,745,2.138,767,2.539,786,2.539,836,2.539,847,2.539,894,2.539,895,2.539,900,2.138,918,3.293,992,2.539,1054,3.293,1146,3.293,1268,3.149,1269,3.149,1270,3.149,1271,5.392,1272,3.149,1273,3.149,1274,3.149,1275,3.149,1276,3.149,1277,3.149,1278,3.149,1279,3.149,1280,4.083,1281,3.149,1282,3.149,1283,3.149,1284,3.149,1285,3.149,1286,3.149,1287,4.531,1288,3.149,1289,3.149,1290,4.531,1291,3.149,1292,3.149,1293,3.149,1294,3.149,1295,4.083,1296,3.149,1297,3.149,1298,3.149,1299,3.149,1300,3.149,1301,4.083,1302,4.083,1303,3.149,1304,3.149,1305,3.149,1306,3.149,1307,3.149,1308,3.293,1309,3.149,1310,3.149,1311,4.083,1312,3.149,1313,3.149,1314,3.149,1315,3.149,1316,3.149,1317,3.149,1318,3.149,1319,3.149,1320,3.149,1321,3.149,1322,3.149,1323,3.149,1324,3.149,1325,3.149,1326,3.149,1327,2.539,1328,3.149,1329,3.149,1330,3.149,1331,3.149,1332,3.149,1333,3.149,1334,4.083,1335,3.149,1336,3.149,1337,3.149,1338,3.149,1339,3.149,1340,3.149,1341,3.149,1342,3.149,1343,3.149,1344,3.149,1345,3.149,1346,3.149,1347,3.149,1348,3.149,1349,3.149,1350,3.149,1351,3.149,1352,3.149,1353,3.149,1354,3.149,1355,3.149,1356,4.083,1357,3.149,1358,3.149,1359,3.149,1360,3.149,1361,3.149,1362,3.149,1363,3.149,1364,3.149,1365,3.149,1366,3.149,1367,3.149,1368,4.083,1369,3.149,1370,3.149,1371,3.149,1372,3.149,1373,3.149,1374,3.149,1375,3.149,1376,3.149,1377,3.149,1378,3.149,1379,3.149,1380,3.149]],["title/miscellaneous/functions.html",[1381,1.054,1382,2.715]],["body/miscellaneous/functions.html",[6,0.749,7,0.488,8,1.102,9,1.472,10,2.916,13,0.397,17,2.581,24,0.052,27,1.256,30,0.645,34,4.409,35,3.191,36,1.874,38,4.409,41,1.434,46,2.916,49,2.279,62,1.17,64,2.219,65,2.581,66,2.507,68,2.219,69,2.581,73,2.279,74,2.042,75,3.119,78,1.303,92,0.747,119,2.279,128,2.067,136,1.256,154,1.256,156,1.649,193,0.026,194,0.035,195,0.026,207,1.434,228,1.93,341,1.434,344,1.483,354,1.434,362,1.689,417,1.918,418,2.581,430,2.219,432,2.279,504,2.799,505,2.916,509,2.279,510,2.581,516,3.705,521,2.279,558,1.689,818,2.219,861,3.065,989,2.581,1229,2.279,1230,3.065,1231,3.065,1234,3.065,1242,2.279,1243,3.866,1244,3.065,1245,2.279,1246,3.464,1247,3.065,1248,3.065,1249,3.065,1250,3.065,1251,3.065,1252,3.065,1253,2.581,1254,3.065,1257,3.065,1258,3.065,1259,3.065,1260,1.918,1261,2.581,1262,2.279,1263,3.065,1264,3.065,1308,3.065,1381,1.256,1382,2.279,1383,2.825,1384,3.982,1385,4.594,1386,2.279,1387,3.065,1388,3.801,1389,2.825,1390,2.279,1391,2.825,1392,5.046,1393,2.825,1394,3.801,1395,2.825,1396,2.825,1397,3.801,1398,2.825,1399,4.594,1400,4.295,1401,2.825,1402,2.825,1403,2.825,1404,4.594,1405,2.825,1406,2.825,1407,2.825,1408,2.825,1409,3.801,1410,2.825,1411,3.801]],["title/index.html",[13,0.333,611,1.61,612,1.384]],["body/index.html",[3,1.008,9,1.199,24,0.04,108,1.555,193,0.032,194,0.04,195,0.032,196,0.038,198,0.688,238,2.217,246,2.872,342,2.91,506,2.822,613,2.376,614,3.522,615,3.522,616,3.839,633,3.839,650,3.522,652,3.384,656,3.232,683,2.822,697,3.522,700,3.522,701,3.522,717,2.822,719,2.822,722,3.839,743,2.822,744,2.822,745,2.376,746,2.822,764,4.137,765,4.02,770,3.522,775,2.822,787,3.522,789,2.822,797,2.822,817,2.822,917,2.822,1077,2.822,1170,2.822,1180,2.822,1193,2.822,1412,4.367,1413,3.5,1414,3.5,1415,3.5,1416,3.5,1417,3.522,1418,3.5,1419,3.5,1420,3.5,1421,4.367,1422,4.367,1423,4.367,1424,4.76,1425,3.5,1426,3.5,1427,4.76,1428,3.5,1429,3.5,1430,4.367,1431,3.5,1432,3.5,1433,3.5,1434,3.5,1435,3.5,1436,3.5,1437,3.5,1438,3.5,1439,3.5,1440,3.5,1441,4.985,1442,3.5,1443,3.5,1444,3.5,1445,3.5,1446,3.5,1447,3.5,1448,3.5,1449,3.5,1450,3.5,1451,3.5,1452,3.5,1453,3.5,1454,3.5,1455,3.5,1456,3.5,1457,3.5]],["title/license.html",[611,1.61,612,1.384,1458,1.912]],["body/license.html",[24,0.042,193,0.035,194,0.042,195,0.035,223,2.236,631,3.723,652,2.601,763,2.601,796,3.723,815,3.996,838,3.09,1034,3.723,1119,3.09,1141,3.09,1196,3.09,1219,3.09,1327,3.09,1417,4.429,1458,3.09,1459,3.831,1460,4.955,1461,3.831,1462,3.831,1463,4.616,1464,3.831,1465,3.831,1466,3.831,1467,3.831,1468,3.831,1469,3.831,1470,4.616,1471,3.831,1472,3.831,1473,3.831,1474,3.831,1475,3.831,1476,3.831,1477,3.831,1478,3.831,1479,3.831,1480,3.831,1481,3.831,1482,3.831,1483,4.616,1484,3.831,1485,3.831,1486,3.831,1487,3.831,1488,3.831,1489,4.616,1490,3.831,1491,3.831,1492,3.831,1493,3.831,1494,3.831,1495,3.831,1496,3.831,1497,3.831,1498,3.831,1499,3.831,1500,3.831,1501,3.831,1502,3.831,1503,3.831,1504,3.831,1505,3.831,1506,3.831,1507,3.831,1508,3.831,1509,3.831,1510,3.831,1511,3.831,1512,3.831,1513,3.831,1514,3.831,1515,3.831,1516,3.831,1517,3.831]],["title/modules.html",[1518,3.054]],["body/modules.html",[24,0.046,193,0.04,194,0.046,195,0.04,1518,3.56]],["title/overview.html",[1519,3.054]],["body/overview.html",[2,3.537,24,0.046,193,0.04,194,0.046,195,0.04,198,0.862,400,1.949,1519,3.537,1520,4.385]],["title/miscellaneous/typealiases.html",[1381,1.054,1521,3.367]],["body/miscellaneous/typealiases.html",[6,0.714,7,0.465,8,1.593,13,0.573,23,0.714,24,0.05,25,2.799,62,1.094,72,2.073,86,2.772,89,2.772,90,2.772,91,2.772,111,2.073,124,2.772,193,0.037,194,0.044,195,0.037,199,2.584,240,2.799,242,2.799,605,2.772,606,3.255,610,3.867,1260,2.772,1261,3.255,1381,1.815,1386,3.293,1387,3.867,1390,3.293,1522,4.083,1523,4.795]],["title/miscellaneous/variables.html",[1381,1.054,1524,2.715]],["body/miscellaneous/variables.html",[6,0.58,7,0.378,13,0.58,23,0.58,24,0.05,26,2.807,27,1.837,158,3.895,193,0.038,194,0.044,195,0.038,235,1.613,343,2.452,344,1.884,504,2.413,656,2.807,818,2.413,1253,3.279,1256,3.895,1381,1.837,1384,3.334,1524,3.334,1525,4.134,1526,4.829,1527,4.829,1528,4.134,1529,4.134,1530,4.134,1531,4.134,1532,4.829,1533,4.134,1534,4.134,1535,4.134,1536,4.134]]],"invertedIndex":[["",{"_index":24,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/Collision.html":{},"interfaces/PickInfo.html":{},"interfaces/ProcessedNode.html":{},"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{},"interfaces/SpatialSceneNode.html":{},"changelog.html":{},"coverage.html":{},"dependencies.html":{},"miscellaneous/functions.html":{},"index.html":{},"license.html":{},"modules.html":{},"overview.html":{},"miscellaneous/typealiases.html":{},"miscellaneous/variables.html":{}}}],["0",{"_index":80,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/Collision.html":{},"interfaces/PickInfo.html":{},"interfaces/ProcessedNode.html":{},"coverage.html":{}}}],["0.05",{"_index":336,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["0.1.0",{"_index":1217,"title":{},"body":{"changelog.html":{}}}],["0.11.4",{"_index":1380,"title":{},"body":{"dependencies.html":{}}}],["0.18.0",{"_index":1313,"title":{},"body":{"dependencies.html":{}}}],["0.2.0",{"_index":1212,"title":{},"body":{"changelog.html":{}}}],["0.20.0",{"_index":1335,"title":{},"body":{"dependencies.html":{}}}],["0.5",{"_index":316,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{},"interfaces/ProcessedNode.html":{}}}],["0.5*255",{"_index":177,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["0.5.0",{"_index":1200,"title":{},"body":{"changelog.html":{}}}],["0.6.0",{"_index":1170,"title":{},"body":{"changelog.html":{},"index.html":{}}}],["0.8",{"_index":133,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["0.9*255",{"_index":118,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["0/1",{"_index":1232,"title":{},"body":{"coverage.html":{}}}],["0/13",{"_index":1236,"title":{},"body":{"coverage.html":{}}}],["0/19",{"_index":1240,"title":{},"body":{"coverage.html":{}}}],["0/20",{"_index":1241,"title":{},"body":{"coverage.html":{}}}],["0/26",{"_index":1239,"title":{},"body":{"coverage.html":{}}}],["0/4",{"_index":1265,"title":{},"body":{"coverage.html":{}}}],["0/6",{"_index":1233,"title":{},"body":{"coverage.html":{}}}],["0/7",{"_index":1237,"title":{},"body":{"coverage.html":{}}}],["0/8",{"_index":1238,"title":{},"body":{"coverage.html":{}}}],["01",{"_index":660,"title":{},"body":{"changelog.html":{}}}],["02",{"_index":1020,"title":{},"body":{"changelog.html":{}}}],["03",{"_index":956,"title":{},"body":{"changelog.html":{}}}],["04",{"_index":707,"title":{},"body":{"changelog.html":{}}}],["05",{"_index":926,"title":{},"body":{"changelog.html":{}}}],["06",{"_index":681,"title":{},"body":{"changelog.html":{}}}],["07",{"_index":659,"title":{},"body":{"changelog.html":{}}}],["08",{"_index":1142,"title":{},"body":{"changelog.html":{}}}],["09",{"_index":645,"title":{},"body":{"changelog.html":{}}}],["1",{"_index":179,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/Collision.html":{},"changelog.html":{}}}],["1.0",{"_index":164,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{},"changelog.html":{}}}],["1.0.0",{"_index":1127,"title":{},"body":{"changelog.html":{}}}],["1.0.11",{"_index":1310,"title":{},"body":{"dependencies.html":{}}}],["1.0.3",{"_index":1317,"title":{},"body":{"dependencies.html":{}}}],["1.0.6",{"_index":1375,"title":{},"body":{"dependencies.html":{}}}],["1.1.0",{"_index":1104,"title":{},"body":{"changelog.html":{}}}],["1.16.0",{"_index":1352,"title":{},"body":{"dependencies.html":{}}}],["1.19.0",{"_index":1312,"title":{},"body":{"dependencies.html":{}}}],["1.2.0",{"_index":1054,"title":{},"body":{"changelog.html":{},"dependencies.html":{}}}],["1.2.3",{"_index":1321,"title":{},"body":{"dependencies.html":{}}}],["1.2.6",{"_index":1355,"title":{},"body":{"dependencies.html":{}}}],["1.3.5",{"_index":1019,"title":{},"body":{"changelog.html":{}}}],["1.4.0",{"_index":992,"title":{},"body":{"changelog.html":{},"dependencies.html":{}}}],["1.4.1",{"_index":1338,"title":{},"body":{"dependencies.html":{}}}],["1.5.0",{"_index":955,"title":{},"body":{"changelog.html":{}}}],["1.6.0",{"_index":940,"title":{},"body":{"changelog.html":{}}}],["1.6875389974302382e",{"_index":352,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["1.7.0",{"_index":925,"title":{},"body":{"changelog.html":{}}}],["1.7.2",{"_index":1324,"title":{},"body":{"dependencies.html":{}}}],["1/37",{"_index":1235,"title":{},"body":{"coverage.html":{}}}],["10",{"_index":619,"title":{},"body":{"changelog.html":{}}}],["10.0",{"_index":307,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["10.0.0",{"_index":1333,"title":{},"body":{"dependencies.html":{}}}],["1000",{"_index":282,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["10x",{"_index":1116,"title":{},"body":{"changelog.html":{}}}],["11",{"_index":994,"title":{},"body":{"changelog.html":{}}}],["11.2.1",{"_index":1357,"title":{},"body":{"dependencies.html":{}}}],["11.5",{"_index":370,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["12",{"_index":717,"title":{},"body":{"changelog.html":{},"index.html":{}}}],["12.0.1",{"_index":1359,"title":{},"body":{"dependencies.html":{}}}],["12.1.1",{"_index":1271,"title":{},"body":{"dependencies.html":{}}}],["12.1.3",{"_index":1279,"title":{},"body":{"dependencies.html":{}}}],["13",{"_index":825,"title":{},"body":{"changelog.html":{}}}],["136",{"_index":99,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["14",{"_index":708,"title":{},"body":{"changelog.html":{}}}],["15",{"_index":313,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{},"changelog.html":{}}}],["15.126.1",{"_index":1269,"title":{},"body":{"dependencies.html":{}}}],["16",{"_index":890,"title":{},"body":{"changelog.html":{}}}],["16.0.0",{"_index":1326,"title":{},"body":{"dependencies.html":{}}}],["17",{"_index":682,"title":{},"body":{"changelog.html":{}}}],["17,0,0",{"_index":351,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["17,0.076,0,0.49,0.034,0.11,1",{"_index":353,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["2",{"_index":400,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{},"changelog.html":{},"coverage.html":{},"overview.html":{}}}],["2.0.0",{"_index":889,"title":{},"body":{"changelog.html":{}}}],["2.0.5",{"_index":1330,"title":{},"body":{"dependencies.html":{}}}],["2.1.0",{"_index":847,"title":{},"body":{"changelog.html":{},"dependencies.html":{}}}],["2.2.0",{"_index":836,"title":{},"body":{"changelog.html":{},"dependencies.html":{}}}],["2.3.0",{"_index":831,"title":{},"body":{"changelog.html":{}}}],["2.3.1",{"_index":824,"title":{},"body":{"changelog.html":{}}}],["2.4.0",{"_index":809,"title":{},"body":{"changelog.html":{}}}],["2.5.0",{"_index":786,"title":{},"body":{"changelog.html":{},"dependencies.html":{}}}],["2.6.7",{"_index":1361,"title":{},"body":{"dependencies.html":{}}}],["2.8.5",{"_index":1319,"title":{},"body":{"dependencies.html":{}}}],["2.awsapprunner.com",{"_index":1438,"title":{},"body":{"index.html":{}}}],["200",{"_index":328,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["2019",{"_index":1141,"title":{},"body":{"changelog.html":{},"license.html":{}}}],["2020",{"_index":1056,"title":{},"body":{"changelog.html":{}}}],["2021",{"_index":771,"title":{},"body":{"changelog.html":{}}}],["2022",{"_index":618,"title":{},"body":{"changelog.html":{}}}],["21",{"_index":927,"title":{},"body":{"changelog.html":{}}}],["22",{"_index":1129,"title":{},"body":{"changelog.html":{}}}],["229",{"_index":100,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["24",{"_index":1201,"title":{},"body":{"changelog.html":{}}}],["255",{"_index":101,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{},"interfaces/ProcessedNode.html":{}}}],["26",{"_index":957,"title":{},"body":{"changelog.html":{}}}],["26th",{"_index":997,"title":{},"body":{"changelog.html":{}}}],["27",{"_index":646,"title":{},"body":{"changelog.html":{}}}],["3",{"_index":1041,"title":{},"body":{"changelog.html":{}}}],["3.0.0",{"_index":767,"title":{},"body":{"changelog.html":{},"dependencies.html":{}}}],["3.0.12",{"_index":1290,"title":{},"body":{"dependencies.html":{}}}],["3.1.0",{"_index":725,"title":{},"body":{"changelog.html":{}}}],["3.1.1",{"_index":716,"title":{},"body":{"changelog.html":{}}}],["3.2.0",{"_index":706,"title":{},"body":{"changelog.html":{}}}],["3.3.0",{"_index":680,"title":{},"body":{"changelog.html":{}}}],["3.4.0",{"_index":658,"title":{},"body":{"changelog.html":{}}}],["3.5.0",{"_index":644,"title":{},"body":{"changelog.html":{}}}],["3.5.5",{"_index":1292,"title":{},"body":{"dependencies.html":{}}}],["3.5.7",{"_index":1294,"title":{},"body":{"dependencies.html":{}}}],["3.6",{"_index":1445,"title":{},"body":{"index.html":{}}}],["3.6.0",{"_index":617,"title":{},"body":{"changelog.html":{},"dependencies.html":{}}}],["3.7.1",{"_index":1302,"title":{},"body":{"dependencies.html":{}}}],["3.7.3",{"_index":1305,"title":{},"body":{"dependencies.html":{}}}],["30",{"_index":98,"title":{},"body":{"classes/BodyUILayer.html":{},"changelog.html":{}}}],["31",{"_index":1105,"title":{},"body":{"changelog.html":{}}}],["3d",{"_index":343,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{},"changelog.html":{},"miscellaneous/variables.html":{}}}],["4",{"_index":1075,"title":{},"body":{"changelog.html":{}}}],["4.0",{"_index":1422,"title":{},"body":{"index.html":{}}}],["4.0.2",{"_index":1299,"title":{},"body":{"dependencies.html":{}}}],["4.17.1",{"_index":1328,"title":{},"body":{"dependencies.html":{}}}],["4.17.21",{"_index":1349,"title":{},"body":{"dependencies.html":{}}}],["4.3.0",{"_index":1315,"title":{},"body":{"dependencies.html":{}}}],["4.6.0",{"_index":1340,"title":{},"body":{"dependencies.html":{}}}],["4th",{"_index":628,"title":{},"body":{"changelog.html":{}}}],["5.0.0",{"_index":1343,"title":{},"body":{"dependencies.html":{}}}],["5.2.0",{"_index":1347,"title":{},"body":{"dependencies.html":{}}}],["6.0.1",{"_index":1346,"title":{},"body":{"dependencies.html":{}}}],["6.10.2",{"_index":1363,"title":{},"body":{"dependencies.html":{}}}],["6.2.0",{"_index":1297,"title":{},"body":{"dependencies.html":{}}}],["6.5.1",{"_index":1372,"title":{},"body":{"dependencies.html":{}}}],["6.6.7",{"_index":1369,"title":{},"body":{"dependencies.html":{}}}],["8",{"_index":933,"title":{},"body":{"changelog.html":{}}}],["8.3.2",{"_index":1378,"title":{},"body":{"dependencies.html":{}}}],["8.5.12",{"_index":1291,"title":{},"body":{"dependencies.html":{}}}],["8.5.7",{"_index":1287,"title":{},"body":{"dependencies.html":{}}}],["8.7.8",{"_index":1289,"title":{},"body":{"dependencies.html":{}}}],["8.9",{"_index":399,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["85",{"_index":1211,"title":{},"body":{"changelog.html":{}}}],["9",{"_index":1520,"title":{},"body":{"overview.html":{}}}],["9.5",{"_index":319,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["90",{"_index":1152,"title":{},"body":{"changelog.html":{}}}],["95",{"_index":712,"title":{},"body":{"changelog.html":{}}}],["9th",{"_index":967,"title":{},"body":{"changelog.html":{}}}],["_dragevent(info",{"_index":413,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["_lighting",{"_index":172,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{},"interfaces/ProcessedNode.html":{},"interfaces/SpatialSceneNode.html":{}}}],["_onclick(info",{"_index":384,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["_ondrag(info",{"_index":409,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["_ondragend(info",{"_index":411,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["_ondragstart(info",{"_index":406,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["_onhover(e",{"_index":376,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["_onviewstatechange(event",{"_index":392,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["aabb",{"_index":426,"title":{},"body":{"interfaces/Collision.html":{},"interfaces/ProcessedNode.html":{}}}],["ability",{"_index":862,"title":{},"body":{"changelog.html":{}}}],["above",{"_index":1196,"title":{},"body":{"changelog.html":{},"license.html":{}}}],["accurate",{"_index":954,"title":{},"body":{"changelog.html":{}}}],["action",{"_index":1510,"title":{},"body":{"license.html":{}}}],["actions",{"_index":1045,"title":{},"body":{"changelog.html":{}}}],["added",{"_index":620,"title":{},"body":{"changelog.html":{}}}],["additional",{"_index":1197,"title":{},"body":{"changelog.html":{}}}],["addressed",{"_index":1098,"title":{},"body":{"changelog.html":{}}}],["adds",{"_index":685,"title":{},"body":{"changelog.html":{}}}],["adjusting",{"_index":1092,"title":{},"body":{"changelog.html":{}}}],["adjustment",{"_index":990,"title":{},"body":{"changelog.html":{}}}],["advanced",{"_index":893,"title":{},"body":{"changelog.html":{}}}],["again",{"_index":1065,"title":{},"body":{"changelog.html":{}}}],["age",{"_index":805,"title":{},"body":{"changelog.html":{}}}],["ala",{"_index":828,"title":{},"body":{"changelog.html":{}}}],["aliases",{"_index":1522,"title":{},"body":{"miscellaneous/typealiases.html":{}}}],["allows",{"_index":974,"title":{},"body":{"changelog.html":{}}}],["alpha",{"_index":1182,"title":{},"body":{"changelog.html":{}}}],["alpha.1",{"_index":1160,"title":{},"body":{"changelog.html":{}}}],["alpha.2",{"_index":1155,"title":{},"body":{"changelog.html":{}}}],["alpha.3",{"_index":1140,"title":{},"body":{"changelog.html":{}}}],["alt",{"_index":1426,"title":{},"body":{"index.html":{}}}],["ambientlight",{"_index":213,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["analytics",{"_index":895,"title":{},"body":{"changelog.html":{},"dependencies.html":{}}}],["anatomical",{"_index":989,"title":{},"body":{"changelog.html":{},"coverage.html":{},"miscellaneous/functions.html":{}}}],["anatomicalstructuresurl",{"_index":1533,"title":{},"body":{"miscellaneous/variables.html":{}}}],["and/or",{"_index":1481,"title":{},"body":{"license.html":{}}}],["angular",{"_index":745,"title":{},"body":{"changelog.html":{},"dependencies.html":{},"index.html":{}}}],["angular/animations",{"_index":1270,"title":{},"body":{"dependencies.html":{}}}],["angular/cdk",{"_index":1272,"title":{},"body":{"dependencies.html":{}}}],["angular/common",{"_index":1273,"title":{},"body":{"dependencies.html":{}}}],["angular/compiler",{"_index":1274,"title":{},"body":{"dependencies.html":{}}}],["angular/core",{"_index":1275,"title":{},"body":{"dependencies.html":{}}}],["angular/elements",{"_index":1276,"title":{},"body":{"dependencies.html":{}}}],["angular/forms",{"_index":1277,"title":{},"body":{"dependencies.html":{}}}],["angular/material",{"_index":1278,"title":{},"body":{"dependencies.html":{}}}],["angular/platform",{"_index":1280,"title":{},"body":{"dependencies.html":{}}}],["angular/router",{"_index":1282,"title":{},"body":{"dependencies.html":{}}}],["angular/youtube",{"_index":1283,"title":{},"body":{"dependencies.html":{}}}],["api",{"_index":633,"title":{},"body":{"changelog.html":{},"index.html":{}}}],["api.hubmapconsortium.org",{"_index":1435,"title":{},"body":{"index.html":{}}}],["appear",{"_index":780,"title":{},"body":{"changelog.html":{}}}],["application",{"_index":978,"title":{},"body":{"changelog.html":{}}}],["applied",{"_index":1028,"title":{},"body":{"changelog.html":{}}}],["appropriate",{"_index":748,"title":{},"body":{"changelog.html":{}}}],["april",{"_index":966,"title":{},"body":{"changelog.html":{}}}],["arising",{"_index":1514,"title":{},"body":{"license.html":{}}}],["asct+b",{"_index":772,"title":{},"body":{"changelog.html":{}}}],["assignment/selection",{"_index":942,"title":{},"body":{"changelog.html":{}}}],["associated",{"_index":838,"title":{},"body":{"changelog.html":{},"license.html":{}}}],["async",{"_index":321,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/Collision.html":{},"interfaces/PickInfo.html":{},"interfaces/ProcessedNode.html":{}}}],["atlas",{"_index":626,"title":{},"body":{"changelog.html":{}}}],["attempts",{"_index":813,"title":{},"body":{"changelog.html":{}}}],["authors",{"_index":1503,"title":{},"body":{"license.html":{}}}],["autohighlight",{"_index":95,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["automatic",{"_index":1079,"title":{},"body":{"changelog.html":{}}}],["automatically",{"_index":1029,"title":{},"body":{"changelog.html":{}}}],["available",{"_index":1072,"title":{},"body":{"changelog.html":{}}}],["avoid",{"_index":880,"title":{},"body":{"changelog.html":{}}}],["await",{"_index":324,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/Collision.html":{},"interfaces/PickInfo.html":{},"interfaces/ProcessedNode.html":{}}}],["award",{"_index":1456,"title":{},"body":{"index.html":{}}}],["b",{"_index":1527,"title":{},"body":{"miscellaneous/variables.html":{}}}],["backend",{"_index":792,"title":{},"body":{"changelog.html":{}}}],["background",{"_index":1193,"title":{},"body":{"changelog.html":{},"index.html":{}}}],["base",{"_index":1165,"title":{},"body":{"changelog.html":{}}}],["based",{"_index":869,"title":{},"body":{"changelog.html":{}}}],["basic",{"_index":891,"title":{},"body":{"changelog.html":{}}}],["bbox",{"_index":449,"title":{},"body":{"interfaces/Collision.html":{},"interfaces/ProcessedNode.html":{}}}],["before",{"_index":784,"title":{},"body":{"changelog.html":{}}}],["behaviorsubject",{"_index":222,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["behaviorsubject([0",{"_index":253,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["being",{"_index":924,"title":{},"body":{"changelog.html":{}}}],["beta",{"_index":770,"title":{},"body":{"changelog.html":{},"index.html":{}}}],["better",{"_index":848,"title":{},"body":{"changelog.html":{}}}],["between",{"_index":1133,"title":{},"body":{"changelog.html":{}}}],["bind",{"_index":220,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{},"dependencies.html":{}}}],["block",{"_index":733,"title":{},"body":{"changelog.html":{}}}],["blocks",{"_index":675,"title":{},"body":{"changelog.html":{}}}],["bmi",{"_index":806,"title":{},"body":{"changelog.html":{}}}],["board",{"_index":1157,"title":{},"body":{"changelog.html":{}}}],["body",{"_index":7,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/Collision.html":{},"interfaces/PickInfo.html":{},"interfaces/ProcessedNode.html":{},"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{},"interfaces/SpatialSceneNode.html":{},"changelog.html":{},"coverage.html":{},"dependencies.html":{},"miscellaneous/functions.html":{},"miscellaneous/typealiases.html":{},"miscellaneous/variables.html":{}}}],["bodyui",{"_index":247,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{},"coverage.html":{}}}],["bodyuilayer",{"_index":1,"title":{"classes/BodyUILayer.html":{}},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{},"coverage.html":{}}}],["bodyuilayer.gltfcache",{"_index":153,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["bodyuiprops",{"_index":197,"title":{"interfaces/BodyUIProps.html":{}},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{},"coverage.html":{}}}],["bodyuiviewstateprops",{"_index":230,"title":{"interfaces/BodyUIViewStateProps.html":{}},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{},"coverage.html":{}}}],["boolean",{"_index":136,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{},"interfaces/SpatialSceneNode.html":{},"miscellaneous/functions.html":{}}}],["both",{"_index":834,"title":{},"body":{"changelog.html":{}}}],["box",{"_index":879,"title":{},"body":{"changelog.html":{}}}],["break",{"_index":88,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["breaking",{"_index":914,"title":{},"body":{"changelog.html":{}}}],["bringing",{"_index":934,"title":{},"body":{"changelog.html":{}}}],["browser",{"_index":1146,"title":{},"body":{"changelog.html":{},"dependencies.html":{}}}],["browserify",{"_index":1370,"title":{},"body":{"dependencies.html":{}}}],["browsing",{"_index":1221,"title":{},"body":{"changelog.html":{}}}],["bug",{"_index":704,"title":{},"body":{"changelog.html":{}}}],["build",{"_index":1418,"title":{},"body":{"index.html":{}}}],["builds",{"_index":766,"title":{},"body":{"changelog.html":{}}}],["button",{"_index":1159,"title":{},"body":{"changelog.html":{}}}],["c",{"_index":1461,"title":{},"body":{"license.html":{}}}],["cache",{"_index":1308,"title":{},"body":{"dependencies.html":{},"miscellaneous/functions.html":{}}}],["cacheable",{"_index":1374,"title":{},"body":{"dependencies.html":{}}}],["callback",{"_index":866,"title":{},"body":{"changelog.html":{}}}],["called",{"_index":920,"title":{},"body":{"changelog.html":{}}}],["calls",{"_index":642,"title":{},"body":{"changelog.html":{}}}],["camera",{"_index":200,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["cancelregistration",{"_index":865,"title":{},"body":{"changelog.html":{}}}],["candidate",{"_index":1131,"title":{},"body":{"changelog.html":{}}}],["cannon",{"_index":428,"title":{},"body":{"interfaces/Collision.html":{},"interfaces/ProcessedNode.html":{},"dependencies.html":{}}}],["canvas",{"_index":201,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["card",{"_index":898,"title":{},"body":{"changelog.html":{}}}],["carousel",{"_index":903,"title":{},"body":{"changelog.html":{}}}],["case",{"_index":85,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["cases",{"_index":1103,"title":{},"body":{"changelog.html":{}}}],["casttoglobaltype",{"_index":1231,"title":{},"body":{"coverage.html":{},"miscellaneous/functions.html":{}}}],["casttoglobaltype(value",{"_index":1391,"title":{},"body":{"miscellaneous/functions.html":{}}}],["ccf",{"_index":246,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{},"changelog.html":{},"index.html":{}}}],["ccf's",{"_index":1050,"title":{},"body":{"changelog.html":{}}}],["ccf.owl",{"_index":622,"title":{},"body":{"changelog.html":{}}}],["ccf_annotations",{"_index":562,"title":{},"body":{"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{}}}],["cell",{"_index":727,"title":{},"body":{"changelog.html":{}}}],["center",{"_index":506,"title":{},"body":{"interfaces/ProcessedNode.html":{},"index.html":{}}}],["change",{"_index":917,"title":{},"body":{"changelog.html":{},"index.html":{}}}],["changed",{"_index":636,"title":{},"body":{"changelog.html":{}}}],["changelog",{"_index":613,"title":{"changelog.html":{}},"body":{"changelog.html":{},"index.html":{}}}],["changes",{"_index":734,"title":{},"body":{"changelog.html":{}}}],["charge",{"_index":1467,"title":{},"body":{"license.html":{}}}],["child",{"_index":511,"title":{},"body":{"interfaces/ProcessedNode.html":{}}}],["child.bbox.clone",{"_index":536,"title":{},"body":{"interfaces/ProcessedNode.html":{}}}],["childnames",{"_index":1257,"title":{},"body":{"coverage.html":{},"miscellaneous/functions.html":{}}}],["childnames(child",{"_index":515,"title":{},"body":{"interfaces/ProcessedNode.html":{}}}],["childnames(node.node).map(n",{"_index":533,"title":{},"body":{"interfaces/ProcessedNode.html":{}}}],["childnames(scene",{"_index":509,"title":{},"body":{"interfaces/ProcessedNode.html":{},"miscellaneous/functions.html":{}}}],["choose",{"_index":1073,"title":{},"body":{"changelog.html":{}}}],["ci/cd",{"_index":1048,"title":{},"body":{"changelog.html":{}}}],["claim",{"_index":1506,"title":{},"body":{"license.html":{}}}],["class",{"_index":0,"title":{"classes/BodyUILayer.html":{}},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{},"coverage.html":{}}}],["classes",{"_index":2,"title":{},"body":{"classes/BodyUILayer.html":{},"overview.html":{}}}],["clean",{"_index":702,"title":{},"body":{"changelog.html":{}}}],["cleanup",{"_index":769,"title":{},"body":{"changelog.html":{}}}],["click",{"_index":820,"title":{},"body":{"changelog.html":{}}}],["clicking",{"_index":910,"title":{},"body":{"changelog.html":{}}}],["client",{"_index":1441,"title":{},"body":{"index.html":{}}}],["code",{"_index":762,"title":{},"body":{"changelog.html":{}}}],["codebase",{"_index":1059,"title":{},"body":{"changelog.html":{}}}],["codex",{"_index":1115,"title":{},"body":{"changelog.html":{}}}],["codifies",{"_index":1175,"title":{},"body":{"changelog.html":{}}}],["collaboration",{"_index":1057,"title":{},"body":{"changelog.html":{}}}],["collider",{"_index":71,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["collider.ts",{"_index":418,"title":{},"body":{"interfaces/Collision.html":{},"coverage.html":{},"miscellaneous/functions.html":{}}}],["collision",{"_index":416,"title":{"interfaces/Collision.html":{}},"body":{"interfaces/Collision.html":{},"coverage.html":{}}}],["collisioning",{"_index":434,"title":{},"body":{"interfaces/Collision.html":{}}}],["collisions",{"_index":1081,"title":{},"body":{"changelog.html":{}}}],["color",{"_index":117,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{},"interfaces/ProcessedNode.html":{},"interfaces/SpatialSceneNode.html":{},"changelog.html":{}}}],["colorizing",{"_index":1124,"title":{},"body":{"changelog.html":{}}}],["combination",{"_index":1074,"title":{},"body":{"changelog.html":{}}}],["come",{"_index":1120,"title":{},"body":{"changelog.html":{}}}],["coming",{"_index":1112,"title":{},"body":{"changelog.html":{}}}],["comlink",{"_index":1314,"title":{},"body":{"dependencies.html":{}}}],["comment",{"_index":563,"title":{},"body":{"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{}}}],["common",{"_index":614,"title":{},"body":{"changelog.html":{},"index.html":{}}}],["complexity",{"_index":949,"title":{},"body":{"changelog.html":{}}}],["compodoc",{"_index":760,"title":{},"body":{"changelog.html":{}}}],["component",{"_index":719,"title":{},"body":{"changelog.html":{},"index.html":{}}}],["components",{"_index":892,"title":{},"body":{"changelog.html":{}}}],["compositelayer",{"_index":12,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["comunica/query",{"_index":1285,"title":{},"body":{"dependencies.html":{}}}],["concat",{"_index":1316,"title":{},"body":{"dependencies.html":{}}}],["conditions",{"_index":1488,"title":{},"body":{"license.html":{}}}],["cone",{"_index":89,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/SpatialSceneNode.html":{},"miscellaneous/typealiases.html":{}}}],["conegeometry",{"_index":52,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["config",{"_index":861,"title":{},"body":{"changelog.html":{},"miscellaneous/functions.html":{}}}],["config.csv",{"_index":1532,"title":{},"body":{"miscellaneous/variables.html":{}}}],["configuration",{"_index":851,"title":{},"body":{"changelog.html":{}}}],["configurations",{"_index":860,"title":{},"body":{"changelog.html":{}}}],["confirmation",{"_index":811,"title":{},"body":{"changelog.html":{}}}],["conform",{"_index":873,"title":{},"body":{"changelog.html":{}}}],["connect",{"_index":790,"title":{},"body":{"changelog.html":{}}}],["connection",{"_index":1516,"title":{},"body":{"license.html":{}}}],["console.log",{"_index":487,"title":{},"body":{"interfaces/Collision.html":{}}}],["console.log('data",{"_index":357,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["console.log('results",{"_index":356,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["console.log('starting",{"_index":433,"title":{},"body":{"interfaces/Collision.html":{}}}],["console.log(csvreport",{"_index":501,"title":{},"body":{"interfaces/Collision.html":{}}}],["consortium",{"_index":1462,"title":{},"body":{"license.html":{}}}],["const",{"_index":129,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/Collision.html":{},"interfaces/PickInfo.html":{},"interfaces/ProcessedNode.html":{}}}],["constructor(private",{"_index":273,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["container",{"_index":905,"title":{},"body":{"changelog.html":{}}}],["containers",{"_index":850,"title":{},"body":{"changelog.html":{}}}],["containing",{"_index":1416,"title":{},"body":{"index.html":{}}}],["context",{"_index":561,"title":{},"body":{"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{}}}],["contract",{"_index":1511,"title":{},"body":{"license.html":{}}}],["control",{"_index":1015,"title":{},"body":{"changelog.html":{}}}],["controller",{"_index":283,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["convenience",{"_index":244,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["convention",{"_index":171,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["coordinate",{"_index":238,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{},"changelog.html":{},"index.html":{}}}],["coordinate_system",{"_index":44,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["coordinate_system.cartesian",{"_index":103,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["coordinatesystem",{"_index":102,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["copies",{"_index":1483,"title":{},"body":{"license.html":{}}}],["copy",{"_index":1470,"title":{},"body":{"license.html":{}}}],["copyright",{"_index":1460,"title":{},"body":{"license.html":{}}}],["cord",{"_index":688,"title":{},"body":{"changelog.html":{}}}],["cors",{"_index":1318,"title":{},"body":{"dependencies.html":{}}}],["coverage",{"_index":1153,"title":{"coverage.html":{}},"body":{"changelog.html":{},"coverage.html":{}}}],["created",{"_index":1024,"title":{},"body":{"changelog.html":{}}}],["creation_date",{"_index":564,"title":{},"body":{"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{}}}],["creator",{"_index":565,"title":{},"body":{"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{}}}],["creator_first_name",{"_index":566,"title":{},"body":{"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{}}}],["creator_last_name",{"_index":567,"title":{},"body":{"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{}}}],["credits",{"_index":1447,"title":{},"body":{"index.html":{}}}],["css",{"_index":1320,"title":{},"body":{"dependencies.html":{}}}],["csv.ts",{"_index":1246,"title":{},"body":{"coverage.html":{},"miscellaneous/functions.html":{}}}],["csvreport",{"_index":491,"title":{},"body":{"interfaces/Collision.html":{}}}],["csvreport.push",{"_index":493,"title":{},"body":{"interfaces/Collision.html":{}}}],["csvtext",{"_index":1402,"title":{},"body":{"miscellaneous/functions.html":{}}}],["ctrlclick",{"_index":243,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["ctrlkey",{"_index":386,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["cube",{"_index":91,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/SpatialSceneNode.html":{},"miscellaneous/typealiases.html":{}}}],["cubegeometry",{"_index":53,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["cuboid",{"_index":1151,"title":{},"body":{"changelog.html":{}}}],["cuboids",{"_index":1149,"title":{},"body":{"changelog.html":{}}}],["currently",{"_index":802,"title":{},"body":{"changelog.html":{}}}],["currentstate",{"_index":396,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["currentstate.data",{"_index":402,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["currentstate.zoomopacity",{"_index":401,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["cursor",{"_index":271,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["cyberinfrastructure",{"_index":1449,"title":{},"body":{"index.html":{}}}],["cycle",{"_index":960,"title":{},"body":{"changelog.html":{}}}],["cylinder",{"_index":90,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/SpatialSceneNode.html":{},"miscellaneous/typealiases.html":{}}}],["cylindergeometry",{"_index":54,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["d",{"_index":113,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["d.geometry",{"_index":438,"title":{},"body":{"interfaces/Collision.html":{}}}],["d.scenegraph",{"_index":437,"title":{},"body":{"interfaces/Collision.html":{}}}],["damages",{"_index":1507,"title":{},"body":{"license.html":{}}}],["dark/light",{"_index":868,"title":{},"body":{"changelog.html":{}}}],["data",{"_index":74,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{},"changelog.html":{},"miscellaneous/functions.html":{}}}],["data.concat(object.values(results",{"_index":359,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["data.length",{"_index":79,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["data.map(d",{"_index":120,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["data.push",{"_index":360,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["data.ts",{"_index":1253,"title":{},"body":{"coverage.html":{},"miscellaneous/functions.html":{},"miscellaneous/variables.html":{}}}],["data?.length",{"_index":332,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["database",{"_index":709,"title":{},"body":{"changelog.html":{}}}],["datasets",{"_index":972,"title":{},"body":{"changelog.html":{}}}],["deal",{"_index":1472,"title":{},"body":{"license.html":{}}}],["dealings",{"_index":1517,"title":{},"body":{"license.html":{}}}],["debugscenenodeprocessing",{"_index":202,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["debugscenenodeprocessing(data",{"_index":340,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["december",{"_index":1066,"title":{},"body":{"changelog.html":{}}}],["deck",{"_index":214,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["deck(props",{"_index":309,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["deck.gl/core",{"_index":45,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{},"dependencies.html":{}}}],["deck.gl/core/lib/deck",{"_index":219,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["deck.gl/geo",{"_index":1288,"title":{},"body":{"dependencies.html":{}}}],["deck.gl/layers",{"_index":47,"title":{},"body":{"classes/BodyUILayer.html":{},"dependencies.html":{}}}],["deck.gl/mesh",{"_index":50,"title":{},"body":{"classes/BodyUILayer.html":{},"dependencies.html":{}}}],["deckprops",{"_index":274,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["deckprops.camera",{"_index":278,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["deckprops.interactive",{"_index":284,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["deckprops.legacylighting",{"_index":304,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["deckprops.maxrotationx",{"_index":314,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["deckprops.minrotationx",{"_index":312,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["deckprops.rotation",{"_index":317,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["deckprops.target",{"_index":315,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["deckprops.zoom",{"_index":318,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["decompress",{"_index":459,"title":{},"body":{"interfaces/Collision.html":{}}}],["decorator",{"_index":221,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{},"dependencies.html":{}}}],["deeply",{"_index":794,"title":{},"body":{"changelog.html":{}}}],["default",{"_index":26,"title":{},"body":{"classes/BodyUILayer.html":{},"changelog.html":{},"miscellaneous/variables.html":{}}}],["defined",{"_index":28,"title":{},"body":{"classes/BodyUILayer.html":{},"changelog.html":{}}}],["delete",{"_index":538,"title":{},"body":{"interfaces/ProcessedNode.html":{}}}],["demo",{"_index":822,"title":{},"body":{"changelog.html":{}}}],["dependencies",{"_index":900,"title":{"dependencies.html":{}},"body":{"changelog.html":{},"dependencies.html":{}}}],["depending",{"_index":923,"title":{},"body":{"changelog.html":{}}}],["depthmask",{"_index":178,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["derivescenegraph",{"_index":1244,"title":{},"body":{"coverage.html":{},"miscellaneous/functions.html":{}}}],["derivescenegraph(scenegraphnodename",{"_index":1393,"title":{},"body":{"miscellaneous/functions.html":{}}}],["descrepancies",{"_index":673,"title":{},"body":{"changelog.html":{}}}],["details",{"_index":1199,"title":{},"body":{"changelog.html":{}}}],["developed",{"_index":1448,"title":{},"body":{"index.html":{}}}],["developments",{"_index":1180,"title":{},"body":{"changelog.html":{},"index.html":{}}}],["dialog",{"_index":812,"title":{},"body":{"changelog.html":{}}}],["didzoom",{"_index":333,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["different",{"_index":849,"title":{},"body":{"changelog.html":{}}}],["digits",{"_index":1042,"title":{},"body":{"changelog.html":{}}}],["dimension_units",{"_index":568,"title":{},"body":{"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{}}}],["direct",{"_index":1208,"title":{},"body":{"changelog.html":{}}}],["directly",{"_index":1113,"title":{},"body":{"changelog.html":{}}}],["disable",{"_index":105,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/Collision.html":{},"interfaces/PickInfo.html":{},"interfaces/ProcessedNode.html":{}}}],["display",{"_index":841,"title":{},"body":{"changelog.html":{}}}],["displayed",{"_index":1150,"title":{},"body":{"changelog.html":{}}}],["displaying",{"_index":837,"title":{},"body":{"changelog.html":{}}}],["distribute",{"_index":1479,"title":{},"body":{"license.html":{}}}],["doc",{"_index":1163,"title":{},"body":{"changelog.html":{}}}],["docollisions",{"_index":69,"title":{},"body":{"classes/BodyUILayer.html":{},"coverage.html":{},"miscellaneous/functions.html":{}}}],["docollisions(scene",{"_index":432,"title":{},"body":{"interfaces/Collision.html":{},"miscellaneous/functions.html":{}}}],["docollisions(state.data",{"_index":187,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["docs",{"_index":699,"title":{},"body":{"changelog.html":{}}}],["document",{"_index":1322,"title":{},"body":{"dependencies.html":{}}}],["documentation",{"_index":763,"title":{},"body":{"changelog.html":{},"coverage.html":{},"license.html":{}}}],["done",{"_index":915,"title":{},"body":{"changelog.html":{}}}],["donor",{"_index":897,"title":{},"body":{"changelog.html":{}}}],["donors",{"_index":975,"title":{},"body":{"changelog.html":{}}}],["dotenv",{"_index":1325,"title":{},"body":{"dependencies.html":{}}}],["download",{"_index":1191,"title":{},"body":{"changelog.html":{}}}],["dracoloader",{"_index":422,"title":{},"body":{"interfaces/Collision.html":{}}}],["during",{"_index":959,"title":{},"body":{"changelog.html":{}}}],["dynamic",{"_index":1281,"title":{},"body":{"dependencies.html":{}}}],["dynamically",{"_index":666,"title":{},"body":{"changelog.html":{}}}],["e",{"_index":37,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["e.info",{"_index":192,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["e.isdragging",{"_index":301,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["e.object",{"_index":379,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["e.object['@id",{"_index":380,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["e.picked",{"_index":377,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["e?.srcevent?.ctrlkey",{"_index":391,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["easier",{"_index":739,"title":{},"body":{"changelog.html":{}}}],["east",{"_index":1437,"title":{},"body":{"index.html":{}}}],["effect",{"_index":1095,"title":{},"body":{"changelog.html":{}}}],["efficiency",{"_index":1002,"title":{},"body":{"changelog.html":{}}}],["element",{"_index":918,"title":{},"body":{"changelog.html":{},"dependencies.html":{}}}],["embedded",{"_index":857,"title":{},"body":{"changelog.html":{}}}],["embedding",{"_index":846,"title":{},"body":{"changelog.html":{}}}],["embedding.md",{"_index":844,"title":{},"body":{"changelog.html":{}}}],["enable",{"_index":502,"title":{},"body":{"interfaces/Collision.html":{},"interfaces/ProcessedNode.html":{}}}],["entities",{"_index":1404,"title":{},"body":{"miscellaneous/functions.html":{}}}],["entities.ts",{"_index":1258,"title":{},"body":{"coverage.html":{},"miscellaneous/functions.html":{}}}],["entityid",{"_index":447,"title":{},"body":{"interfaces/Collision.html":{},"interfaces/SpatialSceneNode.html":{}}}],["es",{"_index":429,"title":{},"body":{"interfaces/Collision.html":{},"interfaces/ProcessedNode.html":{},"dependencies.html":{}}}],["eslint",{"_index":104,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/Collision.html":{},"interfaces/PickInfo.html":{},"interfaces/ProcessedNode.html":{}}}],["eslint/naming",{"_index":170,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["eslint/no",{"_index":109,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["etc",{"_index":877,"title":{},"body":{"changelog.html":{}}}],["eui",{"_index":722,"title":{},"body":{"changelog.html":{},"index.html":{}}}],["eui/rui",{"_index":756,"title":{},"body":{"changelog.html":{}}}],["event",{"_index":1502,"title":{},"body":{"license.html":{}}}],["event.interactionstate?.iszooming",{"_index":395,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["event.viewstate",{"_index":403,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["event.viewstate.rotationx",{"_index":405,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["event.viewstate.zoom",{"_index":398,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["expanded",{"_index":664,"title":{},"body":{"changelog.html":{}}}],["explicit",{"_index":110,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["exploration",{"_index":1420,"title":{},"body":{"index.html":{}}}],["export",{"_index":126,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/Collision.html":{},"interfaces/PickInfo.html":{},"interfaces/ProcessedNode.html":{},"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{},"interfaces/SpatialSceneNode.html":{}}}],["express",{"_index":1327,"title":{},"body":{"dependencies.html":{},"license.html":{}}}],["extends",{"_index":11,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{},"interfaces/ProcessedNode.html":{},"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{}}}],["external",{"_index":864,"title":{},"body":{"changelog.html":{}}}],["extra",{"_index":1332,"title":{},"body":{"dependencies.html":{}}}],["extraction",{"_index":818,"title":{},"body":{"changelog.html":{},"coverage.html":{},"miscellaneous/functions.html":{},"miscellaneous/variables.html":{}}}],["extraction_set",{"_index":569,"title":{},"body":{"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{}}}],["extractionsitesconfigurl",{"_index":1529,"title":{},"body":{"miscellaneous/variables.html":{}}}],["extractionsitesurl",{"_index":1525,"title":{},"body":{"miscellaneous/variables.html":{}}}],["fail",{"_index":1062,"title":{},"body":{"changelog.html":{}}}],["fails",{"_index":1100,"title":{},"body":{"changelog.html":{}}}],["false",{"_index":96,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["favor",{"_index":1053,"title":{},"body":{"changelog.html":{}}}],["feature",{"_index":662,"title":{},"body":{"changelog.html":{}}}],["features",{"_index":961,"title":{},"body":{"changelog.html":{}}}],["feel",{"_index":1000,"title":{},"body":{"changelog.html":{}}}],["female",{"_index":586,"title":{},"body":{"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{}}}],["fetch",{"_index":1360,"title":{},"body":{"dependencies.html":{}}}],["field",{"_index":874,"title":{},"body":{"changelog.html":{}}}],["file",{"_index":5,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/Collision.html":{},"interfaces/PickInfo.html":{},"interfaces/ProcessedNode.html":{},"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{},"interfaces/SpatialSceneNode.html":{},"changelog.html":{},"coverage.html":{},"dependencies.html":{}}}],["file_format",{"_index":604,"title":{},"body":{"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{}}}],["files",{"_index":1471,"title":{},"body":{"license.html":{}}}],["filter",{"_index":1014,"title":{},"body":{"changelog.html":{}}}],["filter(d",{"_index":436,"title":{},"body":{"interfaces/Collision.html":{}}}],["filters",{"_index":679,"title":{},"body":{"changelog.html":{}}}],["final",{"_index":1055,"title":{},"body":{"changelog.html":{}}}],["finalize",{"_index":329,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["finishing",{"_index":816,"title":{},"body":{"changelog.html":{}}}],["first",{"_index":1067,"title":{},"body":{"changelog.html":{}}}],["firstfieldname",{"_index":1399,"title":{},"body":{"miscellaneous/functions.html":{}}}],["fit",{"_index":969,"title":{},"body":{"changelog.html":{}}}],["fitness",{"_index":1498,"title":{},"body":{"license.html":{}}}],["fixed",{"_index":951,"title":{},"body":{"changelog.html":{}}}],["fixes",{"_index":705,"title":{},"body":{"changelog.html":{}}}],["fixes.ts",{"_index":1230,"title":{},"body":{"coverage.html":{},"miscellaneous/functions.html":{}}}],["fixes/performance",{"_index":1125,"title":{},"body":{"changelog.html":{}}}],["flexible",{"_index":694,"title":{},"body":{"changelog.html":{}}}],["flipy",{"_index":280,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["fly",{"_index":1216,"title":{},"body":{"changelog.html":{}}}],["following",{"_index":1487,"title":{},"body":{"license.html":{}}}],["form",{"_index":1003,"title":{},"body":{"changelog.html":{}}}],["format",{"_index":1085,"title":{},"body":{"changelog.html":{}}}],["frame",{"_index":976,"title":{},"body":{"changelog.html":{}}}],["framework",{"_index":615,"title":{},"body":{"changelog.html":{},"index.html":{}}}],["free",{"_index":1466,"title":{},"body":{"license.html":{}}}],["fs",{"_index":1331,"title":{},"body":{"dependencies.html":{}}}],["full",{"_index":908,"title":{},"body":{"changelog.html":{}}}],["fullscreen",{"_index":1158,"title":{},"body":{"changelog.html":{}}}],["fully",{"_index":962,"title":{},"body":{"changelog.html":{}}}],["function",{"_index":72,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/Collision.html":{},"interfaces/ProcessedNode.html":{},"coverage.html":{},"miscellaneous/typealiases.html":{}}}],["functions",{"_index":1382,"title":{"miscellaneous/functions.html":{}},"body":{"miscellaneous/functions.html":{}}}],["funded",{"_index":1454,"title":{},"body":{"index.html":{}}}],["furnished",{"_index":1486,"title":{},"body":{"license.html":{}}}],["further",{"_index":1154,"title":{},"body":{"changelog.html":{}}}],["future",{"_index":952,"title":{},"body":{"changelog.html":{}}}],["generate",{"_index":729,"title":{},"body":{"changelog.html":{}}}],["generated",{"_index":761,"title":{},"body":{"changelog.html":{}}}],["generating",{"_index":667,"title":{},"body":{"changelog.html":{}}}],["geometries",{"_index":137,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["geometries.scenegraph",{"_index":148,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["geometries.scenegraph.push(node",{"_index":143,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["geometries[geometry",{"_index":144,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["geometries[geometry].push(node",{"_index":145,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["geometry",{"_index":55,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/ProcessedNode.html":{},"interfaces/SpatialSceneNode.html":{}}}],["getcolor",{"_index":116,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["getcursor",{"_index":298,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["getpickinginfo",{"_index":20,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["getpickinginfo(e",{"_index":32,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["getposition",{"_index":125,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["gettext",{"_index":123,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["getting",{"_index":611,"title":{"changelog.html":{},"index.html":{},"license.html":{}},"body":{}}],["gettransformmatrix",{"_index":112,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["github",{"_index":1044,"title":{},"body":{"changelog.html":{}}}],["gizmo",{"_index":883,"title":{},"body":{"changelog.html":{}}}],["globalconfig",{"_index":854,"title":{},"body":{"changelog.html":{}}}],["gltf",{"_index":68,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/Collision.html":{},"interfaces/ProcessedNode.html":{},"miscellaneous/functions.html":{}}}],["gltf.scenes",{"_index":462,"title":{},"body":{"interfaces/Collision.html":{},"interfaces/ProcessedNode.html":{}}}],["gltf.ts",{"_index":1243,"title":{},"body":{"coverage.html":{},"miscellaneous/functions.html":{}}}],["gltf:${processednode['@id",{"_index":525,"title":{},"body":{"interfaces/ProcessedNode.html":{}}}],["gltfcache",{"_index":17,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/ProcessedNode.html":{},"miscellaneous/functions.html":{}}}],["gltfloader",{"_index":424,"title":{},"body":{"interfaces/Collision.html":{}}}],["gltfnode",{"_index":526,"title":{},"body":{"interfaces/ProcessedNode.html":{}}}],["gltfnodes",{"_index":518,"title":{},"body":{"interfaces/ProcessedNode.html":{}}}],["gltfnodes.push",{"_index":524,"title":{},"body":{"interfaces/ProcessedNode.html":{}}}],["gltfoverride",{"_index":1409,"title":{},"body":{"miscellaneous/functions.html":{}}}],["gltfpromise",{"_index":1397,"title":{},"body":{"miscellaneous/functions.html":{}}}],["gltfscene",{"_index":461,"title":{},"body":{"interfaces/Collision.html":{}}}],["gltftransform",{"_index":349,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["gltfurl",{"_index":341,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{},"interfaces/ProcessedNode.html":{},"miscellaneous/functions.html":{}}}],["good",{"_index":1097,"title":{},"body":{"changelog.html":{}}}],["google",{"_index":894,"title":{},"body":{"changelog.html":{},"dependencies.html":{}}}],["grab",{"_index":303,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["grabbing",{"_index":302,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["granted",{"_index":1465,"title":{},"body":{"license.html":{}}}],["graphical",{"_index":715,"title":{},"body":{"changelog.html":{}}}],["graphology",{"_index":1334,"title":{},"body":{"dependencies.html":{}}}],["greatly",{"_index":832,"title":{},"body":{"changelog.html":{}}}],["gtex",{"_index":730,"title":{},"body":{"changelog.html":{}}}],["guide",{"_index":1088,"title":{},"body":{"changelog.html":{}}}],["h",{"_index":497,"title":{},"body":{"interfaces/Collision.html":{}}}],["h.name",{"_index":500,"title":{},"body":{"interfaces/Collision.html":{}}}],["h['@id",{"_index":499,"title":{},"body":{"interfaces/Collision.html":{}}}],["halfsize",{"_index":547,"title":{},"body":{"interfaces/ProcessedNode.html":{}}}],["hand",{"_index":1093,"title":{},"body":{"changelog.html":{}}}],["happen",{"_index":1132,"title":{},"body":{"changelog.html":{}}}],["happens",{"_index":1063,"title":{},"body":{"changelog.html":{}}}],["helmet",{"_index":1339,"title":{},"body":{"dependencies.html":{}}}],["help",{"_index":1087,"title":{},"body":{"changelog.html":{}}}],["here",{"_index":1091,"title":{},"body":{"changelog.html":{}}}],["hereby",{"_index":1464,"title":{},"body":{"license.html":{}}}],["hex",{"_index":1341,"title":{},"body":{"dependencies.html":{}}}],["hidden",{"_index":1181,"title":{},"body":{"changelog.html":{}}}],["highlight",{"_index":800,"title":{},"body":{"changelog.html":{}}}],["highlightcolor",{"_index":97,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["highlighted",{"_index":676,"title":{},"body":{"changelog.html":{}}}],["highlights",{"_index":803,"title":{},"body":{"changelog.html":{}}}],["hit",{"_index":492,"title":{},"body":{"interfaces/Collision.html":{}}}],["hit.hits",{"_index":498,"title":{},"body":{"interfaces/Collision.html":{}}}],["hit.name",{"_index":496,"title":{},"body":{"interfaces/Collision.html":{}}}],["hit['@id",{"_index":495,"title":{},"body":{"interfaces/Collision.html":{}}}],["hits",{"_index":419,"title":{},"body":{"interfaces/Collision.html":{}}}],["hits.length",{"_index":482,"title":{},"body":{"interfaces/Collision.html":{}}}],["hits.push({'@id",{"_index":479,"title":{},"body":{"interfaces/Collision.html":{}}}],["holders",{"_index":1504,"title":{},"body":{"license.html":{}}}],["hooked",{"_index":1012,"title":{},"body":{"changelog.html":{}}}],["host",{"_index":691,"title":{},"body":{"changelog.html":{}}}],["hovering",{"_index":899,"title":{},"body":{"changelog.html":{}}}],["hra",{"_index":627,"title":{},"body":{"changelog.html":{}}}],["htmlcanvaselement",{"_index":211,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["htmlelement",{"_index":212,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["http://localhost:8080/source_data/asct",{"_index":1526,"title":{},"body":{"miscellaneous/variables.html":{}}}],["http://localhost:8080/source_data/extraction",{"_index":1530,"title":{},"body":{"miscellaneous/variables.html":{}}}],["http://localhost:8080/source_data/reference",{"_index":1536,"title":{},"body":{"miscellaneous/variables.html":{}}}],["https://beta",{"_index":1423,"title":{},"body":{"index.html":{}}}],["https://ccf",{"_index":1434,"title":{},"body":{"index.html":{}}}],["https://hubmap",{"_index":1427,"title":{},"body":{"index.html":{}}}],["https://hubmapconsortium.github.io/ccf",{"_index":342,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{},"index.html":{}}}],["https://hubmapconsortium.github.io/hubmap",{"_index":347,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["https://old",{"_index":1429,"title":{},"body":{"index.html":{}}}],["https://portal.hubmapconsortium.org/ccf",{"_index":1425,"title":{},"body":{"index.html":{}}}],["https://r5i95k35v5.us",{"_index":1436,"title":{},"body":{"index.html":{}}}],["https://sampledata.hubmapconsortium.org",{"_index":1210,"title":{},"body":{"changelog.html":{}}}],["hubmap",{"_index":652,"title":{},"body":{"changelog.html":{},"index.html":{},"license.html":{}}}],["human",{"_index":625,"title":{},"body":{"changelog.html":{}}}],["icon",{"_index":1192,"title":{},"body":{"changelog.html":{}}}],["icons",{"_index":909,"title":{},"body":{"changelog.html":{}}}],["id",{"_index":92,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/Collision.html":{},"interfaces/PickInfo.html":{},"interfaces/ProcessedNode.html":{},"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{},"interfaces/SpatialSceneNode.html":{},"changelog.html":{},"miscellaneous/functions.html":{}}}],["idb",{"_index":1344,"title":{},"body":{"dependencies.html":{}}}],["identifier",{"_index":1227,"title":{},"body":{"coverage.html":{}}}],["iec",{"_index":1058,"title":{},"body":{"changelog.html":{}}}],["image",{"_index":1052,"title":{},"body":{"changelog.html":{}}}],["images",{"_index":1111,"title":{},"body":{"changelog.html":{}}}],["implementation",{"_index":788,"title":{},"body":{"changelog.html":{}}}],["implemented",{"_index":1010,"title":{},"body":{"changelog.html":{}}}],["implementing",{"_index":1162,"title":{},"body":{"changelog.html":{}}}],["implied",{"_index":1495,"title":{},"body":{"license.html":{}}}],["import",{"_index":43,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/Collision.html":{},"interfaces/PickInfo.html":{},"interfaces/ProcessedNode.html":{},"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{},"interfaces/SpatialSceneNode.html":{}}}],["improve",{"_index":1001,"title":{},"body":{"changelog.html":{}}}],["improved",{"_index":752,"title":{},"body":{"changelog.html":{}}}],["improvements",{"_index":711,"title":{},"body":{"changelog.html":{}}}],["improves",{"_index":833,"title":{},"body":{"changelog.html":{}}}],["include",{"_index":1069,"title":{},"body":{"changelog.html":{}}}],["included",{"_index":1490,"title":{},"body":{"license.html":{}}}],["includes",{"_index":663,"title":{},"body":{"changelog.html":{}}}],["including",{"_index":796,"title":{},"body":{"changelog.html":{},"license.html":{}}}],["increase",{"_index":1037,"title":{},"body":{"changelog.html":{}}}],["increased",{"_index":1156,"title":{},"body":{"changelog.html":{}}}],["index",{"_index":13,"title":{"index.html":{}},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/Collision.html":{},"interfaces/PickInfo.html":{},"interfaces/ProcessedNode.html":{},"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{},"interfaces/SpatialSceneNode.html":{},"miscellaneous/functions.html":{},"miscellaneous/typealiases.html":{},"miscellaneous/variables.html":{}}}],["indexes",{"_index":624,"title":{},"body":{"changelog.html":{}}}],["indiana",{"_index":1452,"title":{},"body":{"index.html":{}}}],["individual",{"_index":1017,"title":{},"body":{"changelog.html":{}}}],["info",{"_index":3,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/Collision.html":{},"interfaces/PickInfo.html":{},"interfaces/ProcessedNode.html":{},"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{},"interfaces/SpatialSceneNode.html":{},"changelog.html":{},"index.html":{}}}],["info.object",{"_index":388,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["info.object['@id",{"_index":389,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["info.picked",{"_index":387,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["info?.object?.['@id",{"_index":414,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["information",{"_index":701,"title":{},"body":{"changelog.html":{},"index.html":{}}}],["infrastructure",{"_index":1114,"title":{},"body":{"changelog.html":{}}}],["ingestion",{"_index":1071,"title":{},"body":{"changelog.html":{}}}],["initial",{"_index":931,"title":{},"body":{"changelog.html":{}}}],["initialize",{"_index":322,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["initializestate",{"_index":21,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["instead",{"_index":922,"title":{},"body":{"changelog.html":{}}}],["instructions",{"_index":845,"title":{},"body":{"changelog.html":{}}}],["integrated",{"_index":963,"title":{},"body":{"changelog.html":{}}}],["integrating",{"_index":793,"title":{},"body":{"changelog.html":{}}}],["integration",{"_index":1070,"title":{},"body":{"changelog.html":{}}}],["integrations",{"_index":983,"title":{},"body":{"changelog.html":{}}}],["intensity",{"_index":306,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["interact",{"_index":946,"title":{},"body":{"changelog.html":{}}}],["interactions",{"_index":1136,"title":{},"body":{"changelog.html":{}}}],["interactionstate",{"_index":393,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["interactive",{"_index":203,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["interest",{"_index":1207,"title":{},"body":{"changelog.html":{}}}],["interface",{"_index":196,"title":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/Collision.html":{},"interfaces/PickInfo.html":{},"interfaces/ProcessedNode.html":{},"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{},"interfaces/SpatialSceneNode.html":{}},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/Collision.html":{},"interfaces/PickInfo.html":{},"interfaces/ProcessedNode.html":{},"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{},"interfaces/SpatialSceneNode.html":{},"changelog.html":{},"coverage.html":{},"index.html":{}}}],["interfaces",{"_index":198,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/Collision.html":{},"interfaces/PickInfo.html":{},"interfaces/ProcessedNode.html":{},"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{},"interfaces/SpatialSceneNode.html":{},"changelog.html":{},"index.html":{},"overview.html":{}}}],["internal",{"_index":1051,"title":{},"body":{"changelog.html":{}}}],["isdragging",{"_index":299,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["issue",{"_index":1033,"title":{},"body":{"changelog.html":{}}}],["issues",{"_index":670,"title":{},"body":{"changelog.html":{}}}],["iszooming",{"_index":394,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["it's",{"_index":791,"title":{},"body":{"changelog.html":{}}}],["item",{"_index":1189,"title":{},"body":{"changelog.html":{}}}],["iu",{"_index":1178,"title":{},"body":{"changelog.html":{}}}],["javascript",{"_index":746,"title":{},"body":{"changelog.html":{},"index.html":{}}}],["json",{"_index":1083,"title":{},"body":{"changelog.html":{}}}],["jsonld",{"_index":507,"title":{},"body":{"interfaces/ProcessedNode.html":{},"dependencies.html":{}}}],["jsonld.ts",{"_index":559,"title":{},"body":{"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{},"coverage.html":{}}}],["jsonld/jsonld",{"_index":589,"title":{},"body":{"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{}}}],["jsonldobj",{"_index":560,"title":{},"body":{"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{}}}],["july",{"_index":1135,"title":{},"body":{"changelog.html":{}}}],["jump",{"_index":1187,"title":{},"body":{"changelog.html":{}}}],["key",{"_index":76,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["keyboard",{"_index":1185,"title":{},"body":{"changelog.html":{}}}],["keyval",{"_index":1345,"title":{},"body":{"dependencies.html":{}}}],["kidney",{"_index":829,"title":{},"body":{"changelog.html":{}}}],["kind",{"_index":1494,"title":{},"body":{"license.html":{}}}],["known",{"_index":669,"title":{},"body":{"changelog.html":{}}}],["kpmp",{"_index":649,"title":{},"body":{"changelog.html":{}}}],["l",{"_index":189,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["label",{"_index":570,"title":{},"body":{"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{}}}],["labs/data",{"_index":1296,"title":{},"body":{"dependencies.html":{}}}],["labs/dispatch",{"_index":1298,"title":{},"body":{"dependencies.html":{}}}],["landmarks",{"_index":689,"title":{},"body":{"changelog.html":{}}}],["larger",{"_index":740,"title":{},"body":{"changelog.html":{}}}],["lasthovered",{"_index":272,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["latest",{"_index":683,"title":{},"body":{"changelog.html":{},"index.html":{}}}],["layer",{"_index":227,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["layer.ts",{"_index":10,"title":{},"body":{"classes/BodyUILayer.html":{},"coverage.html":{},"miscellaneous/functions.html":{}}}],["layer.ts:143",{"_index":33,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["layer.ts:71",{"_index":31,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["layer.ts:72",{"_index":29,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["layer.ts:74",{"_index":40,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["layer.ts:80",{"_index":42,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["layername",{"_index":18,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["layers",{"_index":51,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{},"dependencies.html":{}}}],["layers.filter(l",{"_index":188,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["layers.push",{"_index":157,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["layers.push(meshlayer(`${geometry}pickable",{"_index":185,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["layers.push(meshlayer(geometry",{"_index":184,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["layers.push(textlayer('text",{"_index":180,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["layers.push(textlayer('textpickable",{"_index":183,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["lb",{"_index":541,"title":{},"body":{"interfaces/ProcessedNode.html":{}}}],["lb.clone().vadd(halfsize",{"_index":551,"title":{},"body":{"interfaces/ProcessedNode.html":{}}}],["ld",{"_index":1084,"title":{},"body":{"changelog.html":{}}}],["leak",{"_index":1032,"title":{},"body":{"changelog.html":{}}}],["leave",{"_index":814,"title":{},"body":{"changelog.html":{}}}],["left",{"_index":587,"title":{},"body":{"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{},"changelog.html":{}}}],["left/right",{"_index":830,"title":{},"body":{"changelog.html":{}}}],["legacylighting",{"_index":204,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["level",{"_index":1183,"title":{},"body":{"changelog.html":{}}}],["levels",{"_index":1204,"title":{},"body":{"changelog.html":{}}}],["liability",{"_index":1508,"title":{},"body":{"license.html":{}}}],["liable",{"_index":1505,"title":{},"body":{"license.html":{}}}],["libraries",{"_index":743,"title":{},"body":{"changelog.html":{},"index.html":{}}}],["library",{"_index":993,"title":{},"body":{"changelog.html":{}}}],["library/vh_female/united/vhf_united_color.glb",{"_index":346,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["library/vh_male/united/vhm_united_color.glb",{"_index":345,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["license",{"_index":1458,"title":{"license.html":{}},"body":{"license.html":{}}}],["life",{"_index":808,"title":{},"body":{"changelog.html":{}}}],["lightingeffect",{"_index":215,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["limitation",{"_index":1474,"title":{},"body":{"license.html":{}}}],["limited",{"_index":1119,"title":{},"body":{"changelog.html":{},"license.html":{}}}],["line",{"_index":107,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["link",{"_index":823,"title":{},"body":{"changelog.html":{}}}],["linkage",{"_index":1137,"title":{},"body":{"changelog.html":{}}}],["linked",{"_index":696,"title":{},"body":{"changelog.html":{}}}],["links",{"_index":775,"title":{},"body":{"changelog.html":{},"index.html":{}}}],["list",{"_index":939,"title":{},"body":{"changelog.html":{}}}],["literal",{"_index":25,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/Collision.html":{},"dependencies.html":{},"miscellaneous/typealiases.html":{}}}],["little",{"_index":944,"title":{},"body":{"changelog.html":{}}}],["load",{"_index":420,"title":{},"body":{"interfaces/Collision.html":{},"interfaces/ProcessedNode.html":{},"changelog.html":{}}}],["load(model.scenegraph",{"_index":458,"title":{},"body":{"interfaces/Collision.html":{}}}],["loaded",{"_index":1139,"title":{},"body":{"changelog.html":{}}}],["loaders.gl/core",{"_index":421,"title":{},"body":{"interfaces/Collision.html":{},"dependencies.html":{}}}],["loaders.gl/draco",{"_index":423,"title":{},"body":{"interfaces/Collision.html":{},"dependencies.html":{}}}],["loaders.gl/gltf",{"_index":425,"title":{},"body":{"interfaces/Collision.html":{},"dependencies.html":{}}}],["loadgltf",{"_index":64,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/ProcessedNode.html":{},"coverage.html":{},"miscellaneous/functions.html":{}}}],["loadgltf(model",{"_index":1395,"title":{},"body":{"miscellaneous/functions.html":{}}}],["loadgltf({scenegraph",{"_index":517,"title":{},"body":{"interfaces/ProcessedNode.html":{}}}],["loadgltf2",{"_index":65,"title":{},"body":{"classes/BodyUILayer.html":{},"coverage.html":{},"miscellaneous/functions.html":{}}}],["loadgltf2(model.scenegraphnode",{"_index":167,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["loadgltf2(scenegraphnodename",{"_index":1396,"title":{},"body":{"miscellaneous/functions.html":{}}}],["loading",{"_index":657,"title":{},"body":{"changelog.html":{}}}],["location",{"_index":1038,"title":{},"body":{"changelog.html":{}}}],["locations",{"_index":651,"title":{},"body":{"changelog.html":{}}}],["lodash",{"_index":1348,"title":{},"body":{"dependencies.html":{}}}],["log",{"_index":1446,"title":{},"body":{"index.html":{}}}],["logging",{"_index":732,"title":{},"body":{"changelog.html":{}}}],["longer",{"_index":919,"title":{},"body":{"changelog.html":{}}}],["look",{"_index":999,"title":{},"body":{"changelog.html":{}}}],["loop",{"_index":325,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["lowerbound",{"_index":442,"title":{},"body":{"interfaces/Collision.html":{},"interfaces/ProcessedNode.html":{}}}],["lowerbound[i",{"_index":455,"title":{},"body":{"interfaces/Collision.html":{},"interfaces/ProcessedNode.html":{}}}],["lru",{"_index":1350,"title":{},"body":{"dependencies.html":{}}}],["luma.gl/core",{"_index":57,"title":{},"body":{"classes/BodyUILayer.html":{},"dependencies.html":{}}}],["m",{"_index":147,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["m.scenegraph",{"_index":149,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["m.scenegraphnode",{"_index":150,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["made",{"_index":1060,"title":{},"body":{"changelog.html":{}}}],["major",{"_index":661,"title":{},"body":{"changelog.html":{}}}],["makes",{"_index":736,"title":{},"body":{"changelog.html":{}}}],["making",{"_index":785,"title":{},"body":{"changelog.html":{}}}],["male",{"_index":585,"title":{},"body":{"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{}}}],["managers",{"_index":750,"title":{},"body":{"changelog.html":{}}}],["map(model",{"_index":439,"title":{},"body":{"interfaces/Collision.html":{}}}],["mapping.csv",{"_index":1534,"title":{},"body":{"miscellaneous/variables.html":{}}}],["march",{"_index":996,"title":{},"body":{"changelog.html":{}}}],["markdown",{"_index":1358,"title":{},"body":{"dependencies.html":{}}}],["mat",{"_index":440,"title":{},"body":{"interfaces/Collision.html":{}}}],["mat.transformaspoint",{"_index":443,"title":{},"body":{"interfaces/Collision.html":{}}}],["mat.transformaspoint([1",{"_index":445,"title":{},"body":{"interfaces/Collision.html":{}}}],["match",{"_index":998,"title":{},"body":{"changelog.html":{}}}],["matching",{"_index":194,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/Collision.html":{},"interfaces/PickInfo.html":{},"interfaces/ProcessedNode.html":{},"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{},"interfaces/SpatialSceneNode.html":{},"changelog.html":{},"coverage.html":{},"dependencies.html":{},"miscellaneous/functions.html":{},"index.html":{},"license.html":{},"modules.html":{},"overview.html":{},"miscellaneous/typealiases.html":{},"miscellaneous/variables.html":{}}}],["math.gl/core",{"_index":59,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/Collision.html":{},"interfaces/PickInfo.html":{},"interfaces/ProcessedNode.html":{},"interfaces/SpatialSceneNode.html":{},"dependencies.html":{}}}],["math.gl/culling",{"_index":1293,"title":{},"body":{"dependencies.html":{}}}],["math.max(...report.map(r",{"_index":489,"title":{},"body":{"interfaces/Collision.html":{}}}],["math.max(n",{"_index":454,"title":{},"body":{"interfaces/Collision.html":{},"interfaces/ProcessedNode.html":{}}}],["math.min(math.max(1",{"_index":397,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["math.min(n",{"_index":451,"title":{},"body":{"interfaces/Collision.html":{},"interfaces/ProcessedNode.html":{}}}],["matrix",{"_index":366,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["matrix.gettranslation",{"_index":369,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["matrix4",{"_index":58,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/Collision.html":{},"interfaces/PickInfo.html":{},"interfaces/ProcessedNode.html":{},"interfaces/SpatialSceneNode.html":{}}}],["matrix4([0.076,0,0,0,0,0.076,1.6875389974302382e",{"_index":350,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["matrix4(d.transformmatrix).gettranslation",{"_index":122,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["matrix4(matrix4.identity",{"_index":553,"title":{},"body":{"interfaces/ProcessedNode.html":{}}}],["matrix4(model.transformmatrix",{"_index":441,"title":{},"body":{"interfaces/Collision.html":{}}}],["matrix4(modelmatrix",{"_index":523,"title":{},"body":{"interfaces/ProcessedNode.html":{}}}],["matrix4(node.transformmatrix",{"_index":367,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["matrix4(worldmatrix",{"_index":519,"title":{},"body":{"interfaces/ProcessedNode.html":{}}}],["matrix4.identity",{"_index":520,"title":{},"body":{"interfaces/ProcessedNode.html":{}}}],["maxhits",{"_index":488,"title":{},"body":{"interfaces/Collision.html":{}}}],["maxrotationx",{"_index":205,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["mc",{"_index":1177,"title":{},"body":{"changelog.html":{}}}],["memory",{"_index":1031,"title":{},"body":{"changelog.html":{}}}],["menu",{"_index":1094,"title":{},"body":{"changelog.html":{}}}],["merchantability",{"_index":1497,"title":{},"body":{"license.html":{}}}],["merge",{"_index":1477,"title":{},"body":{"license.html":{}}}],["mesh",{"_index":82,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["meshlayer",{"_index":1234,"title":{},"body":{"coverage.html":{},"miscellaneous/functions.html":{}}}],["meshlayer(id",{"_index":73,"title":{},"body":{"classes/BodyUILayer.html":{},"miscellaneous/functions.html":{}}}],["metadata",{"_index":1148,"title":{},"body":{"changelog.html":{}}}],["methods",{"_index":19,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["minor",{"_index":671,"title":{},"body":{"changelog.html":{}}}],["minrotationx",{"_index":206,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["miscellaneous",{"_index":1381,"title":{"miscellaneous/functions.html":{},"miscellaneous/typealiases.html":{},"miscellaneous/variables.html":{}},"body":{"miscellaneous/functions.html":{},"miscellaneous/typealiases.html":{},"miscellaneous/variables.html":{}}}],["mit",{"_index":1459,"title":{},"body":{"license.html":{}}}],["mock",{"_index":1173,"title":{},"body":{"changelog.html":{}}}],["modal",{"_index":929,"title":{},"body":{"changelog.html":{}}}],["mode",{"_index":859,"title":{},"body":{"changelog.html":{}}}],["model",{"_index":156,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/Collision.html":{},"dependencies.html":{},"miscellaneous/functions.html":{}}}],["model._lighting",{"_index":173,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["model.color",{"_index":176,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["model.entityid",{"_index":448,"title":{},"body":{"interfaces/Collision.html":{}}}],["model.opacity",{"_index":163,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["model.scenegraph",{"_index":169,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["model.scenegraphnode",{"_index":166,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["model.tooltip",{"_index":446,"title":{},"body":{"interfaces/Collision.html":{}}}],["model.transformmatrix",{"_index":175,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["model.unpickable",{"_index":165,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["model.zoombasedopacity",{"_index":161,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["model['@id",{"_index":159,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/Collision.html":{}}}],["modelmatrix",{"_index":464,"title":{},"body":{"interfaces/Collision.html":{},"interfaces/ProcessedNode.html":{}}}],["modelmatrix.transformaspoint(primitive.attributes.position.max",{"_index":472,"title":{},"body":{"interfaces/Collision.html":{},"interfaces/ProcessedNode.html":{}}}],["modelmatrix.transformaspoint(primitive.attributes.position.min",{"_index":471,"title":{},"body":{"interfaces/Collision.html":{},"interfaces/ProcessedNode.html":{}}}],["models",{"_index":158,"title":{},"body":{"classes/BodyUILayer.html":{},"miscellaneous/variables.html":{}}}],["modify",{"_index":1476,"title":{},"body":{"license.html":{}}}],["modules",{"_index":1518,"title":{"modules.html":{}},"body":{"modules.html":{}}}],["monorepo",{"_index":1413,"title":{},"body":{"index.html":{}}}],["more",{"_index":700,"title":{},"body":{"changelog.html":{},"index.html":{}}}],["mouseevent",{"_index":241,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["moved",{"_index":1194,"title":{},"body":{"changelog.html":{}}}],["much",{"_index":738,"title":{},"body":{"changelog.html":{}}}],["multiple",{"_index":1414,"title":{},"body":{"index.html":{}}}],["n.bbox",{"_index":532,"title":{},"body":{"interfaces/ProcessedNode.html":{}}}],["n.unpickable",{"_index":182,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["n3",{"_index":1351,"title":{},"body":{"dependencies.html":{}}}],["name",{"_index":35,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/Collision.html":{},"interfaces/SpatialSceneNode.html":{},"miscellaneous/functions.html":{}}}],["names",{"_index":510,"title":{},"body":{"interfaces/ProcessedNode.html":{},"changelog.html":{},"miscellaneous/functions.html":{}}}],["names.push(child.name",{"_index":514,"title":{},"body":{"interfaces/ProcessedNode.html":{}}}],["navigation",{"_index":1186,"title":{},"body":{"changelog.html":{}}}],["near",{"_index":281,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["need",{"_index":641,"title":{},"body":{"changelog.html":{}}}],["needed",{"_index":1004,"title":{},"body":{"changelog.html":{}}}],["needs",{"_index":1011,"title":{},"body":{"changelog.html":{}}}],["network",{"_index":1450,"title":{},"body":{"index.html":{}}}],["new",{"_index":87,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/Collision.html":{},"interfaces/PickInfo.html":{},"interfaces/ProcessedNode.html":{},"changelog.html":{},"coverage.html":{}}}],["next",{"_index":106,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{},"changelog.html":{}}}],["ng5",{"_index":1353,"title":{},"body":{"dependencies.html":{}}}],["ngx",{"_index":1356,"title":{},"body":{"dependencies.html":{}}}],["ngxs",{"_index":1295,"title":{},"body":{"dependencies.html":{}}}],["ngxs/logger",{"_index":1300,"title":{},"body":{"dependencies.html":{}}}],["ngxs/storage",{"_index":1303,"title":{},"body":{"dependencies.html":{}}}],["ngxs/store",{"_index":1304,"title":{},"body":{"dependencies.html":{}}}],["nih",{"_index":1455,"title":{},"body":{"index.html":{}}}],["node",{"_index":63,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/Collision.html":{},"interfaces/PickInfo.html":{},"interfaces/ProcessedNode.html":{},"dependencies.html":{}}}],["node.bbox",{"_index":535,"title":{},"body":{"interfaces/ProcessedNode.html":{}}}],["node.bbox.extend(child.bbox",{"_index":537,"title":{},"body":{"interfaces/ProcessedNode.html":{}}}],["node.bbox.lowerbound",{"_index":542,"title":{},"body":{"interfaces/ProcessedNode.html":{}}}],["node.bbox.upperbound",{"_index":544,"title":{},"body":{"interfaces/ProcessedNode.html":{}}}],["node.center",{"_index":550,"title":{},"body":{"interfaces/ProcessedNode.html":{}}}],["node.geometry",{"_index":141,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["node.id",{"_index":522,"title":{},"body":{"interfaces/ProcessedNode.html":{}}}],["node.mesh",{"_index":465,"title":{},"body":{"interfaces/Collision.html":{},"interfaces/ProcessedNode.html":{}}}],["node.mesh.primitives",{"_index":466,"title":{},"body":{"interfaces/Collision.html":{},"interfaces/ProcessedNode.html":{}}}],["node.mesh.primitives.length",{"_index":467,"title":{},"body":{"interfaces/Collision.html":{},"interfaces/ProcessedNode.html":{}}}],["node.name",{"_index":474,"title":{},"body":{"interfaces/Collision.html":{},"interfaces/ProcessedNode.html":{}}}],["node.scenegraph",{"_index":142,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["node.size",{"_index":545,"title":{},"body":{"interfaces/ProcessedNode.html":{}}}],["node.transformmatrix",{"_index":552,"title":{},"body":{"interfaces/ProcessedNode.html":{}}}],["node.ts",{"_index":606,"title":{},"body":{"interfaces/SpatialSceneNode.html":{},"coverage.html":{},"miscellaneous/typealiases.html":{}}}],["node.zoomtoonload",{"_index":334,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["nodeclick",{"_index":257,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["nodeclickevent",{"_index":242,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{},"miscellaneous/typealiases.html":{}}}],["nodeclicksubject",{"_index":249,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["nodedrag",{"_index":267,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["nodedragend",{"_index":269,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["nodedragendsubject",{"_index":256,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["nodedragevent",{"_index":240,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{},"miscellaneous/typealiases.html":{}}}],["nodedragstart",{"_index":265,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["nodedragstartsubject",{"_index":254,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["nodedragsubject",{"_index":255,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["nodehoverstart",{"_index":259,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["nodehoverstartsubject",{"_index":250,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["nodehoverstop",{"_index":261,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["nodehoverstopsubject",{"_index":251,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["nodes",{"_index":154,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{},"interfaces/ProcessedNode.html":{},"miscellaneous/functions.html":{}}}],["nodes.filter(n",{"_index":181,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["nodes.ts",{"_index":505,"title":{},"body":{"interfaces/ProcessedNode.html":{},"coverage.html":{},"miscellaneous/functions.html":{}}}],["nodes[n]).filter(n",{"_index":534,"title":{},"body":{"interfaces/ProcessedNode.html":{}}}],["nodes[node['@id",{"_index":539,"title":{},"body":{"interfaces/ProcessedNode.html":{}}}],["nodes[processednode['@id",{"_index":530,"title":{},"body":{"interfaces/ProcessedNode.html":{}}}],["noninfringement",{"_index":1501,"title":{},"body":{"license.html":{}}}],["note",{"_index":634,"title":{},"body":{"changelog.html":{}}}],["notice",{"_index":1034,"title":{},"body":{"changelog.html":{},"license.html":{}}}],["now",{"_index":741,"title":{},"body":{"changelog.html":{}}}],["number",{"_index":115,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{},"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{},"interfaces/SpatialSceneNode.html":{},"changelog.html":{}}}],["numeric",{"_index":1039,"title":{},"body":{"changelog.html":{}}}],["object",{"_index":235,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{},"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{},"miscellaneous/variables.html":{}}}],["object.entries(geometries",{"_index":155,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["object.prototype.hasownproperty.call(url2gltf",{"_index":151,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["object.values(nodes",{"_index":540,"title":{},"body":{"interfaces/ProcessedNode.html":{}}}],["object.values(nodes).filter(n",{"_index":531,"title":{},"body":{"interfaces/ProcessedNode.html":{}}}],["object.values(results",{"_index":358,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["obtaining",{"_index":1469,"title":{},"body":{"license.html":{}}}],["off/on",{"_index":1008,"title":{},"body":{"changelog.html":{}}}],["official",{"_index":1134,"title":{},"body":{"changelog.html":{}}}],["old",{"_index":1428,"title":{},"body":{"index.html":{}}}],["onclick",{"_index":288,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["ondrag",{"_index":294,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["ondragend",{"_index":296,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["ondragstart",{"_index":292,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["one",{"_index":1077,"title":{},"body":{"changelog.html":{},"index.html":{}}}],["onhover",{"_index":286,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["online",{"_index":1144,"title":{},"body":{"changelog.html":{}}}],["ontological",{"_index":1215,"title":{},"body":{"changelog.html":{}}}],["ontologies",{"_index":1086,"title":{},"body":{"changelog.html":{}}}],["ontology",{"_index":637,"title":{},"body":{"changelog.html":{}}}],["ontology/objects/vhf_united_v01_060420.glb",{"_index":348,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["onviewstatechange",{"_index":290,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["opacities",{"_index":1016,"title":{},"body":{"changelog.html":{}}}],["opacity",{"_index":160,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/SpatialSceneNode.html":{},"changelog.html":{}}}],["openapi",{"_index":787,"title":{},"body":{"changelog.html":{},"index.html":{}}}],["openapi/js",{"_index":1442,"title":{},"body":{"index.html":{}}}],["openapi/ng",{"_index":1444,"title":{},"body":{"index.html":{}}}],["openapi/ts",{"_index":1443,"title":{},"body":{"index.html":{}}}],["optimization",{"_index":943,"title":{},"body":{"changelog.html":{}}}],["optimizations",{"_index":1126,"title":{},"body":{"changelog.html":{}}}],["optimized",{"_index":981,"title":{},"body":{"changelog.html":{}}}],["option",{"_index":799,"title":{},"body":{"changelog.html":{}}}],["optional",{"_index":36,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{},"interfaces/SpatialPlacementJsonLd.html":{},"interfaces/SpatialSceneNode.html":{},"changelog.html":{},"miscellaneous/functions.html":{}}}],["options",{"_index":75,"title":{},"body":{"classes/BodyUILayer.html":{},"changelog.html":{},"miscellaneous/functions.html":{}}}],["options.geometry",{"_index":84,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["orbitaxis",{"_index":231,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["orbitview",{"_index":216,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["organ",{"_index":656,"title":{},"body":{"changelog.html":{},"index.html":{},"miscellaneous/variables.html":{}}}],["organs",{"_index":690,"title":{},"body":{"changelog.html":{}}}],["organs/anatomical",{"_index":1018,"title":{},"body":{"changelog.html":{}}}],["orthographic",{"_index":279,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{},"changelog.html":{}}}],["orthographicview",{"_index":217,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["ot2od026671",{"_index":1457,"title":{},"body":{"index.html":{}}}],["otherwise",{"_index":1513,"title":{},"body":{"license.html":{}}}],["out",{"_index":1515,"title":{},"body":{"license.html":{}}}],["over",{"_index":1046,"title":{},"body":{"changelog.html":{}}}],["overall",{"_index":678,"title":{},"body":{"changelog.html":{}}}],["overlays",{"_index":1205,"title":{},"body":{"changelog.html":{}}}],["overview",{"_index":1519,"title":{"overview.html":{}},"body":{"overview.html":{}}}],["p",{"_index":1168,"title":{},"body":{"changelog.html":{}}}],["package",{"_index":749,"title":{"dependencies.html":{}},"body":{"changelog.html":{}}}],["pages",{"_index":843,"title":{},"body":{"changelog.html":{}}}],["paired",{"_index":826,"title":{},"body":{"changelog.html":{}}}],["pane",{"_index":970,"title":{},"body":{"changelog.html":{}}}],["panel",{"_index":840,"title":{},"body":{"changelog.html":{}}}],["parameters",{"_index":34,"title":{},"body":{"classes/BodyUILayer.html":{},"miscellaneous/functions.html":{}}}],["parameters['getpickinginfo']>[0",{"_index":190,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["parent",{"_index":207,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{},"changelog.html":{},"miscellaneous/functions.html":{}}}],["parsecsv",{"_index":1247,"title":{},"body":{"coverage.html":{},"miscellaneous/functions.html":{}}}],["parsecsv(sourceurl",{"_index":1398,"title":{},"body":{"miscellaneous/functions.html":{}}}],["parsecsvtext",{"_index":1248,"title":{},"body":{"coverage.html":{},"miscellaneous/functions.html":{}}}],["parsecsvtext(csvtext",{"_index":1401,"title":{},"body":{"miscellaneous/functions.html":{}}}],["parser",{"_index":1311,"title":{},"body":{"dependencies.html":{}}}],["partial",{"_index":275,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["particular",{"_index":1499,"title":{},"body":{"license.html":{}}}],["partly",{"_index":995,"title":{},"body":{"changelog.html":{}}}],["partonomy",{"_index":912,"title":{},"body":{"changelog.html":{}}}],["path",{"_index":1337,"title":{},"body":{"dependencies.html":{}}}],["pbr",{"_index":174,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{},"interfaces/ProcessedNode.html":{}}}],["performance",{"_index":753,"title":{},"body":{"changelog.html":{}}}],["permission",{"_index":1463,"title":{},"body":{"license.html":{}}}],["permit",{"_index":1484,"title":{},"body":{"license.html":{}}}],["person",{"_index":1468,"title":{},"body":{"license.html":{}}}],["persons",{"_index":1485,"title":{},"body":{"license.html":{}}}],["pick",{"_index":655,"title":{},"body":{"changelog.html":{}}}],["pickable",{"_index":93,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["picked",{"_index":239,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["pickinfo",{"_index":234,"title":{"interfaces/PickInfo.html":{}},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{},"coverage.html":{}}}],["placeholder",{"_index":1138,"title":{},"body":{"changelog.html":{}}}],["placement",{"_index":571,"title":{},"body":{"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{},"changelog.html":{}}}],["placement_date",{"_index":591,"title":{},"body":{"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{}}}],["placenta",{"_index":686,"title":{},"body":{"changelog.html":{}}}],["player",{"_index":1284,"title":{},"body":{"dependencies.html":{}}}],["plugin",{"_index":1301,"title":{},"body":{"dependencies.html":{}}}],["plus",{"_index":665,"title":{},"body":{"changelog.html":{}}}],["pointer",{"_index":378,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["popup",{"_index":1147,"title":{},"body":{"changelog.html":{}}}],["portal",{"_index":797,"title":{},"body":{"changelog.html":{},"index.html":{}}}],["portal's",{"_index":1118,"title":{},"body":{"changelog.html":{}}}],["portions",{"_index":1492,"title":{},"body":{"license.html":{}}}],["position",{"_index":121,"title":{},"body":{"classes/BodyUILayer.html":{},"changelog.html":{}}}],["possible",{"_index":1061,"title":{},"body":{"changelog.html":{}}}],["postprocess",{"_index":460,"title":{},"body":{"interfaces/Collision.html":{}}}],["preferences",{"_index":871,"title":{},"body":{"changelog.html":{}}}],["preparation",{"_index":1179,"title":{},"body":{"changelog.html":{}}}],["presented",{"_index":1203,"title":{},"body":{"changelog.html":{}}}],["prevent",{"_index":723,"title":{},"body":{"changelog.html":{}}}],["preview",{"_index":886,"title":{},"body":{"changelog.html":{}}}],["previous",{"_index":1023,"title":{},"body":{"changelog.html":{}}}],["previously",{"_index":777,"title":{},"body":{"changelog.html":{}}}],["primitive",{"_index":468,"title":{},"body":{"interfaces/Collision.html":{},"interfaces/ProcessedNode.html":{}}}],["primitive.attributes.position",{"_index":469,"title":{},"body":{"interfaces/Collision.html":{},"interfaces/ProcessedNode.html":{}}}],["primitive.attributes.position.min",{"_index":470,"title":{},"body":{"interfaces/Collision.html":{},"interfaces/ProcessedNode.html":{}}}],["priority",{"_index":607,"title":{},"body":{"interfaces/SpatialSceneNode.html":{}}}],["private",{"_index":248,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["process",{"_index":1161,"title":{},"body":{"changelog.html":{}}}],["processanatomicalstructures",{"_index":1250,"title":{},"body":{"coverage.html":{},"miscellaneous/functions.html":{}}}],["processanatomicalstructures(sourceurl",{"_index":1403,"title":{},"body":{"miscellaneous/functions.html":{}}}],["processed",{"_index":1109,"title":{},"body":{"changelog.html":{}}}],["processednode",{"_index":503,"title":{"interfaces/ProcessedNode.html":{}},"body":{"interfaces/ProcessedNode.html":{},"coverage.html":{}}}],["processednode.bbox",{"_index":529,"title":{},"body":{"interfaces/ProcessedNode.html":{}}}],["processednode['@id",{"_index":527,"title":{},"body":{"interfaces/ProcessedNode.html":{}}}],["processextractionsites",{"_index":1252,"title":{},"body":{"coverage.html":{},"miscellaneous/functions.html":{}}}],["processextractionsites(sourceurl",{"_index":1405,"title":{},"body":{"miscellaneous/functions.html":{}}}],["processing",{"_index":872,"title":{},"body":{"changelog.html":{}}}],["processreferencedata",{"_index":1254,"title":{},"body":{"coverage.html":{},"miscellaneous/functions.html":{}}}],["processreferencedata(refentities",{"_index":1406,"title":{},"body":{"miscellaneous/functions.html":{}}}],["processscenenodes",{"_index":228,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{},"coverage.html":{},"miscellaneous/functions.html":{}}}],["processscenenodes(gltfurl",{"_index":354,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{},"interfaces/ProcessedNode.html":{},"miscellaneous/functions.html":{}}}],["processspatialentities",{"_index":1259,"title":{},"body":{"coverage.html":{},"miscellaneous/functions.html":{}}}],["processspatialentities(parent",{"_index":1408,"title":{},"body":{"miscellaneous/functions.html":{}}}],["production",{"_index":764,"title":{},"body":{"changelog.html":{},"index.html":{}}}],["programming",{"_index":742,"title":{},"body":{"changelog.html":{}}}],["project",{"_index":1166,"title":{},"body":{"changelog.html":{}}}],["projects",{"_index":1415,"title":{},"body":{"index.html":{}}}],["projects/.../body",{"_index":1387,"title":{},"body":{"miscellaneous/functions.html":{},"miscellaneous/typealiases.html":{}}}],["projects/.../global",{"_index":1383,"title":{},"body":{"miscellaneous/functions.html":{}}}],["projects/.../load",{"_index":1385,"title":{},"body":{"miscellaneous/functions.html":{}}}],["projects/.../parse",{"_index":1388,"title":{},"body":{"miscellaneous/functions.html":{}}}],["projects/.../process",{"_index":1384,"title":{},"body":{"miscellaneous/functions.html":{},"miscellaneous/variables.html":{}}}],["projects/.../scene",{"_index":1390,"title":{},"body":{"miscellaneous/functions.html":{},"miscellaneous/typealiases.html":{}}}],["projects/.../simplify",{"_index":1389,"title":{},"body":{"miscellaneous/functions.html":{}}}],["projects/.../spatial",{"_index":1386,"title":{},"body":{"miscellaneous/functions.html":{},"miscellaneous/typealiases.html":{}}}],["projects/ccf",{"_index":6,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/Collision.html":{},"interfaces/PickInfo.html":{},"interfaces/ProcessedNode.html":{},"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{},"interfaces/SpatialSceneNode.html":{},"coverage.html":{},"miscellaneous/functions.html":{},"miscellaneous/typealiases.html":{},"miscellaneous/variables.html":{}}}],["promise",{"_index":128,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/Collision.html":{},"interfaces/PickInfo.html":{},"interfaces/ProcessedNode.html":{},"miscellaneous/functions.html":{}}}],["promise(r",{"_index":326,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["properties",{"_index":14,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/Collision.html":{},"interfaces/PickInfo.html":{},"interfaces/ProcessedNode.html":{},"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{},"interfaces/SpatialSceneNode.html":{},"changelog.html":{}}}],["props",{"_index":276,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["props.effects",{"_index":305,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["provided",{"_index":1219,"title":{},"body":{"changelog.html":{},"license.html":{}}}],["providers",{"_index":804,"title":{},"body":{"changelog.html":{}}}],["public",{"_index":1145,"title":{},"body":{"changelog.html":{}}}],["publish",{"_index":1478,"title":{},"body":{"license.html":{}}}],["publishing",{"_index":747,"title":{},"body":{"changelog.html":{}}}],["purpose",{"_index":1500,"title":{},"body":{"license.html":{}}}],["pushed",{"_index":958,"title":{},"body":{"changelog.html":{}}}],["python",{"_index":744,"title":{},"body":{"changelog.html":{},"index.html":{}}}],["qs",{"_index":1362,"title":{},"body":{"dependencies.html":{}}}],["qualitative",{"_index":1122,"title":{},"body":{"changelog.html":{}}}],["quality",{"_index":807,"title":{},"body":{"changelog.html":{}}}],["queries",{"_index":640,"title":{},"body":{"changelog.html":{},"dependencies.html":{}}}],["query",{"_index":1213,"title":{},"body":{"changelog.html":{}}}],["querying",{"_index":695,"title":{},"body":{"changelog.html":{}}}],["quickly",{"_index":1102,"title":{},"body":{"changelog.html":{}}}],["r.hits.length",{"_index":490,"title":{},"body":{"interfaces/Collision.html":{}}}],["rc.1",{"_index":1128,"title":{},"body":{"changelog.html":{}}}],["rdf",{"_index":1364,"title":{},"body":{"dependencies.html":{}}}],["rdfjs",{"_index":1286,"title":{},"body":{"dependencies.html":{}}}],["rdfjs/data",{"_index":1306,"title":{},"body":{"dependencies.html":{}}}],["rdfxml",{"_index":1365,"title":{},"body":{"dependencies.html":{}}}],["readable",{"_index":1367,"title":{},"body":{"dependencies.html":{}}}],["readonly",{"_index":16,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["real",{"_index":1143,"title":{},"body":{"changelog.html":{}}}],["record",{"_index":138,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["rectify",{"_index":783,"title":{},"body":{"changelog.html":{}}}],["reduce",{"_index":948,"title":{},"body":{"changelog.html":{}}}],["reduction",{"_index":713,"title":{},"body":{"changelog.html":{}}}],["refentities",{"_index":1407,"title":{},"body":{"miscellaneous/functions.html":{}}}],["reference",{"_index":344,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{},"changelog.html":{},"coverage.html":{},"miscellaneous/functions.html":{},"miscellaneous/variables.html":{}}}],["reference_organ",{"_index":572,"title":{},"body":{"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{},"interfaces/SpatialSceneNode.html":{}}}],["referencedataconfig",{"_index":1256,"title":{},"body":{"coverage.html":{},"miscellaneous/variables.html":{}}}],["referenceorganconfigurl",{"_index":1535,"title":{},"body":{"miscellaneous/variables.html":{}}}],["refernced",{"_index":827,"title":{},"body":{"changelog.html":{}}}],["refresh",{"_index":911,"title":{},"body":{"changelog.html":{}}}],["regions",{"_index":1206,"title":{},"body":{"changelog.html":{}}}],["register",{"_index":1323,"title":{},"body":{"dependencies.html":{}}}],["registered",{"_index":778,"title":{},"body":{"changelog.html":{}}}],["registergltfloaders",{"_index":66,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/ProcessedNode.html":{},"coverage.html":{},"miscellaneous/functions.html":{}}}],["registration",{"_index":817,"title":{},"body":{"changelog.html":{},"index.html":{}}}],["registrations",{"_index":936,"title":{},"body":{"changelog.html":{}}}],["related",{"_index":987,"title":{},"body":{"changelog.html":{}}}],["release",{"_index":629,"title":{},"body":{"changelog.html":{}}}],["reliability",{"_index":1036,"title":{},"body":{"changelog.html":{}}}],["reloads",{"_index":882,"title":{},"body":{"changelog.html":{}}}],["removed",{"_index":856,"title":{},"body":{"changelog.html":{}}}],["removes",{"_index":986,"title":{},"body":{"changelog.html":{}}}],["renderlayers",{"_index":22,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["report",{"_index":475,"title":{},"body":{"interfaces/Collision.html":{}}}],["report.push",{"_index":483,"title":{},"body":{"interfaces/Collision.html":{}}}],["repository",{"_index":1412,"title":{},"body":{"index.html":{}}}],["representation_of",{"_index":573,"title":{},"body":{"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{},"interfaces/SpatialSceneNode.html":{}}}],["required",{"_index":1090,"title":{},"body":{"changelog.html":{}}}],["resets",{"_index":913,"title":{},"body":{"changelog.html":{}}}],["resolved",{"_index":964,"title":{},"body":{"changelog.html":{}}}],["respond",{"_index":904,"title":{},"body":{"changelog.html":{}}}],["restriction",{"_index":1473,"title":{},"body":{"license.html":{}}}],["result",{"_index":193,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/Collision.html":{},"interfaces/PickInfo.html":{},"interfaces/ProcessedNode.html":{},"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{},"interfaces/SpatialSceneNode.html":{},"changelog.html":{},"coverage.html":{},"dependencies.html":{},"miscellaneous/functions.html":{},"index.html":{},"license.html":{},"modules.html":{},"overview.html":{},"miscellaneous/typealiases.html":{},"miscellaneous/variables.html":{}}}],["results",{"_index":195,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/Collision.html":{},"interfaces/PickInfo.html":{},"interfaces/ProcessedNode.html":{},"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{},"interfaces/SpatialSceneNode.html":{},"changelog.html":{},"coverage.html":{},"dependencies.html":{},"miscellaneous/functions.html":{},"index.html":{},"license.html":{},"modules.html":{},"overview.html":{},"miscellaneous/typealiases.html":{},"miscellaneous/variables.html":{}}}],["return",{"_index":81,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/Collision.html":{},"interfaces/ProcessedNode.html":{}}}],["returns",{"_index":38,"title":{},"body":{"classes/BodyUILayer.html":{},"miscellaneous/functions.html":{}}}],["returntype",{"_index":39,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["returntype['getpickinginfo",{"_index":191,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["rgb",{"_index":1342,"title":{},"body":{"dependencies.html":{}}}],["right",{"_index":588,"title":{},"body":{"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{},"changelog.html":{}}}],["rights",{"_index":1475,"title":{},"body":{"license.html":{}}}],["root",{"_index":921,"title":{},"body":{"changelog.html":{}}}],["rotates",{"_index":884,"title":{},"body":{"changelog.html":{}}}],["rotation",{"_index":208,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["rotation_units",{"_index":599,"title":{},"body":{"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{}}}],["rotationorbit",{"_index":232,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["rotationx",{"_index":233,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["round",{"_index":1021,"title":{},"body":{"changelog.html":{}}}],["rounded",{"_index":1040,"title":{},"body":{"changelog.html":{}}}],["route",{"_index":693,"title":{},"body":{"changelog.html":{}}}],["ru/common",{"_index":1268,"title":{},"body":{"dependencies.html":{}}}],["rui",{"_index":650,"title":{},"body":{"changelog.html":{},"index.html":{}}}],["rui_locations.jsonld",{"_index":731,"title":{},"body":{"changelog.html":{}}}],["rui_rank",{"_index":574,"title":{},"body":{"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{}}}],["rxjs",{"_index":224,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{},"dependencies.html":{}}}],["rxjs/operators",{"_index":226,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["sad",{"_index":476,"title":{},"body":{"interfaces/Collision.html":{}}}],["sad.push(src",{"_index":486,"title":{},"body":{"interfaces/Collision.html":{}}}],["sample",{"_index":1218,"title":{},"body":{"changelog.html":{}}}],["samples",{"_index":950,"title":{},"body":{"changelog.html":{}}}],["saver",{"_index":1329,"title":{},"body":{"dependencies.html":{}}}],["scaffolding",{"_index":1167,"title":{},"body":{"changelog.html":{}}}],["scale(halfsize.toarray",{"_index":555,"title":{},"body":{"interfaces/ProcessedNode.html":{}}}],["scaling_units",{"_index":595,"title":{},"body":{"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{}}}],["scene",{"_index":62,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/Collision.html":{},"interfaces/PickInfo.html":{},"interfaces/ProcessedNode.html":{},"interfaces/SpatialSceneNode.html":{},"changelog.html":{},"coverage.html":{},"miscellaneous/functions.html":{},"miscellaneous/typealiases.html":{}}}],["scene.children",{"_index":513,"title":{},"body":{"interfaces/ProcessedNode.html":{}}}],["scene.filter(d",{"_index":457,"title":{},"body":{"interfaces/Collision.html":{}}}],["scene.nodes",{"_index":512,"title":{},"body":{"interfaces/ProcessedNode.html":{}}}],["scene.ts",{"_index":1263,"title":{},"body":{"coverage.html":{},"miscellaneous/functions.html":{}}}],["scenegraph",{"_index":139,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{},"interfaces/ProcessedNode.html":{},"interfaces/SpatialSceneNode.html":{}}}],["scenegraphlayer",{"_index":48,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["scenegraphnode",{"_index":362,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{},"interfaces/ProcessedNode.html":{},"interfaces/SpatialSceneNode.html":{},"miscellaneous/functions.html":{}}}],["scenegraphnodename",{"_index":1394,"title":{},"body":{"miscellaneous/functions.html":{}}}],["scenerotation",{"_index":263,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["scenerotationsubject",{"_index":252,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["scenetraversalvisitor",{"_index":1523,"title":{},"body":{"miscellaneous/typealiases.html":{}}}],["scheduled",{"_index":965,"title":{},"body":{"changelog.html":{}}}],["schema",{"_index":1171,"title":{},"body":{"changelog.html":{}}}],["schemes",{"_index":1123,"title":{},"body":{"changelog.html":{}}}],["science",{"_index":1451,"title":{},"body":{"index.html":{}}}],["search",{"_index":654,"title":{},"body":{"changelog.html":{}}}],["searches",{"_index":668,"title":{},"body":{"changelog.html":{}}}],["section",{"_index":937,"title":{},"body":{"changelog.html":{}}}],["see",{"_index":697,"title":{},"body":{"changelog.html":{},"index.html":{}}}],["select",{"_index":855,"title":{},"body":{"changelog.html":{}}}],["selected",{"_index":677,"title":{},"body":{"changelog.html":{}}}],["selecting",{"_index":737,"title":{},"body":{"changelog.html":{}}}],["selector",{"_index":735,"title":{},"body":{"changelog.html":{}}}],["selects",{"_index":1188,"title":{},"body":{"changelog.html":{}}}],["sell",{"_index":1482,"title":{},"body":{"license.html":{}}}],["semantic",{"_index":1202,"title":{},"body":{"changelog.html":{}}}],["sennet",{"_index":758,"title":{},"body":{"changelog.html":{}}}],["server",{"_index":1174,"title":{},"body":{"changelog.html":{}}}],["set",{"_index":867,"title":{},"body":{"changelog.html":{}}}],["setinteractive(value",{"_index":375,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["setrotation(value",{"_index":371,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["setrotationx(value",{"_index":372,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["setscene(data",{"_index":331,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["settarget(value",{"_index":374,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["settimeout(r",{"_index":327,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["setup",{"_index":932,"title":{},"body":{"changelog.html":{}}}],["setzoom(value",{"_index":373,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["sex",{"_index":575,"title":{},"body":{"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{},"changelog.html":{}}}],["sexes",{"_index":1076,"title":{},"body":{"changelog.html":{}}}],["shall",{"_index":1489,"title":{},"body":{"license.html":{}}}],["share",{"_index":225,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["shared",{"_index":875,"title":{},"body":{"changelog.html":{}}}],["shared/spatial",{"_index":61,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/Collision.html":{},"interfaces/PickInfo.html":{},"interfaces/ProcessedNode.html":{}}}],["shortest",{"_index":1336,"title":{},"body":{"dependencies.html":{}}}],["show",{"_index":907,"title":{},"body":{"changelog.html":{}}}],["showing",{"_index":1108,"title":{},"body":{"changelog.html":{}}}],["shown",{"_index":1117,"title":{},"body":{"changelog.html":{}}}],["shows",{"_index":810,"title":{},"body":{"changelog.html":{}}}],["side",{"_index":576,"title":{},"body":{"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{},"changelog.html":{}}}],["sides",{"_index":1078,"title":{},"body":{"changelog.html":{}}}],["significant",{"_index":916,"title":{},"body":{"changelog.html":{}}}],["simple",{"_index":839,"title":{},"body":{"changelog.html":{}}}],["simplemeshlayer",{"_index":49,"title":{},"body":{"classes/BodyUILayer.html":{},"miscellaneous/functions.html":{}}}],["simplifies",{"_index":930,"title":{},"body":{"changelog.html":{}}}],["simplifyscene",{"_index":1264,"title":{},"body":{"coverage.html":{},"miscellaneous/functions.html":{}}}],["simplifyscene(nodes",{"_index":1410,"title":{},"body":{"miscellaneous/functions.html":{}}}],["site",{"_index":1531,"title":{},"body":{"miscellaneous/variables.html":{}}}],["sites",{"_index":819,"title":{},"body":{"changelog.html":{}}}],["sites.csv",{"_index":1528,"title":{},"body":{"miscellaneous/variables.html":{}}}],["sites.ts",{"_index":1251,"title":{},"body":{"coverage.html":{},"miscellaneous/functions.html":{}}}],["sizable",{"_index":1035,"title":{},"body":{"changelog.html":{}}}],["size",{"_index":508,"title":{},"body":{"interfaces/ProcessedNode.html":{}}}],["size.clone().vmul(new",{"_index":548,"title":{},"body":{"interfaces/ProcessedNode.html":{}}}],["slice_count",{"_index":577,"title":{},"body":{"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{}}}],["slice_thickness",{"_index":578,"title":{},"body":{"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{}}}],["slider",{"_index":1354,"title":{},"body":{"dependencies.html":{}}}],["slightly",{"_index":781,"title":{},"body":{"changelog.html":{}}}],["slow",{"_index":945,"title":{},"body":{"changelog.html":{}}}],["software",{"_index":1417,"title":{},"body":{"index.html":{},"license.html":{}}}],["solved",{"_index":1030,"title":{},"body":{"changelog.html":{}}}],["sometimes",{"_index":1099,"title":{},"body":{"changelog.html":{}}}],["soon",{"_index":751,"title":{},"body":{"changelog.html":{}}}],["sop",{"_index":941,"title":{},"body":{"changelog.html":{}}}],["source",{"_index":4,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/Collision.html":{},"interfaces/PickInfo.html":{},"interfaces/ProcessedNode.html":{},"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{},"interfaces/SpatialSceneNode.html":{}}}],["sourceboxes",{"_index":435,"title":{},"body":{"interfaces/Collision.html":{}}}],["sources",{"_index":863,"title":{},"body":{"changelog.html":{}}}],["sourceurl",{"_index":1400,"title":{},"body":{"miscellaneous/functions.html":{}}}],["sparc",{"_index":935,"title":{},"body":{"changelog.html":{}}}],["sparql",{"_index":639,"title":{},"body":{"changelog.html":{},"dependencies.html":{}}}],["spatial",{"_index":558,"title":{},"body":{"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{},"changelog.html":{},"coverage.html":{},"miscellaneous/functions.html":{}}}],["spatialentityjsonld",{"_index":556,"title":{"interfaces/SpatialEntityJsonLd.html":{}},"body":{"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{},"coverage.html":{}}}],["spatialobjectreferencejsonld",{"_index":583,"title":{"interfaces/SpatialObjectReferenceJsonLd.html":{}},"body":{"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{},"coverage.html":{}}}],["spatialplacementjsonld",{"_index":584,"title":{"interfaces/SpatialPlacementJsonLd.html":{}},"body":{"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{},"coverage.html":{}}}],["spatialscenegeometry",{"_index":610,"title":{},"body":{"interfaces/SpatialSceneNode.html":{},"miscellaneous/typealiases.html":{}}}],["spatialscenenode",{"_index":60,"title":{"interfaces/SpatialSceneNode.html":{}},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/Collision.html":{},"interfaces/PickInfo.html":{},"interfaces/ProcessedNode.html":{},"interfaces/SpatialSceneNode.html":{},"coverage.html":{}}}],["spec",{"_index":590,"title":{},"body":{"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{},"changelog.html":{}}}],["spec.yaml",{"_index":1440,"title":{},"body":{"index.html":{}}}],["specific",{"_index":801,"title":{},"body":{"changelog.html":{}}}],["specification",{"_index":1439,"title":{},"body":{"index.html":{}}}],["speed",{"_index":710,"title":{},"body":{"changelog.html":{}}}],["sphere",{"_index":86,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/SpatialSceneNode.html":{},"miscellaneous/typealiases.html":{}}}],["spheregeometry",{"_index":56,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["spinal",{"_index":687,"title":{},"body":{"changelog.html":{}}}],["spinning",{"_index":1172,"title":{},"body":{"changelog.html":{}}}],["sprint",{"_index":968,"title":{},"body":{"changelog.html":{}}}],["src",{"_index":477,"title":{},"body":{"interfaces/Collision.html":{}}}],["src.bbox.overlaps(target.bbox",{"_index":478,"title":{},"body":{"interfaces/Collision.html":{}}}],["src.entityid",{"_index":484,"title":{},"body":{"interfaces/Collision.html":{}}}],["src.name",{"_index":485,"title":{},"body":{"interfaces/Collision.html":{}}}],["srcevent",{"_index":385,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["stage",{"_index":1009,"title":{},"body":{"changelog.html":{}}}],["staging",{"_index":765,"title":{},"body":{"changelog.html":{},"index.html":{}}}],["standalone",{"_index":1025,"title":{},"body":{"changelog.html":{}}}],["standard",{"_index":1082,"title":{},"body":{"changelog.html":{}}}],["standards",{"_index":1176,"title":{},"body":{"changelog.html":{}}}],["star2",{"_index":1421,"title":{},"body":{"index.html":{}}}],["started",{"_index":612,"title":{"changelog.html":{},"index.html":{},"license.html":{}},"body":{"changelog.html":{}}}],["starts",{"_index":1225,"title":{},"body":{"changelog.html":{}}}],["startup",{"_index":928,"title":{},"body":{"changelog.html":{}}}],["state",{"_index":134,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["state.data",{"_index":140,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["state.docollisions",{"_index":186,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["state.zoomopacity",{"_index":162,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["statements",{"_index":1228,"title":{},"body":{"coverage.html":{}}}],["static",{"_index":15,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["stay",{"_index":1223,"title":{},"body":{"changelog.html":{}}}],["still",{"_index":953,"title":{},"body":{"changelog.html":{}}}],["stories",{"_index":1164,"title":{},"body":{"changelog.html":{}}}],["stream",{"_index":1368,"title":{},"body":{"dependencies.html":{}}}],["streaming",{"_index":1366,"title":{},"body":{"dependencies.html":{}}}],["string",{"_index":30,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/Collision.html":{},"interfaces/PickInfo.html":{},"interfaces/ProcessedNode.html":{},"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{},"interfaces/SpatialSceneNode.html":{},"miscellaneous/functions.html":{}}}],["structure",{"_index":982,"title":{},"body":{"changelog.html":{}}}],["structures",{"_index":971,"title":{},"body":{"changelog.html":{}}}],["structures.ts",{"_index":1249,"title":{},"body":{"coverage.html":{},"miscellaneous/functions.html":{}}}],["styles",{"_index":1198,"title":{},"body":{"changelog.html":{}}}],["styling",{"_index":835,"title":{},"body":{"changelog.html":{}}}],["subject",{"_index":223,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{},"license.html":{}}}],["subject.next",{"_index":415,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["sublicense",{"_index":1480,"title":{},"body":{"license.html":{}}}],["substantial",{"_index":1491,"title":{},"body":{"license.html":{}}}],["such",{"_index":638,"title":{},"body":{"changelog.html":{}}}],["support",{"_index":643,"title":{},"body":{"changelog.html":{}}}],["swiper",{"_index":1371,"title":{},"body":{"dependencies.html":{}}}],["switch",{"_index":83,"title":{},"body":{"classes/BodyUILayer.html":{},"changelog.html":{}}}],["switched",{"_index":1043,"title":{},"body":{"changelog.html":{}}}],["sync",{"_index":885,"title":{},"body":{"changelog.html":{}}}],["table",{"_index":1267,"title":{},"body":{"coverage.html":{}}}],["tables",{"_index":773,"title":{},"body":{"changelog.html":{}}}],["tablesort(document.getelementbyid('coverage",{"_index":1266,"title":{},"body":{"coverage.html":{}}}],["tagging",{"_index":1080,"title":{},"body":{"changelog.html":{}}}],["take",{"_index":798,"title":{},"body":{"changelog.html":{}}}],["target",{"_index":209,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/Collision.html":{},"interfaces/PickInfo.html":{},"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{}}}],["target.name",{"_index":481,"title":{},"body":{"interfaces/Collision.html":{}}}],["target['@id",{"_index":480,"title":{},"body":{"interfaces/Collision.html":{}}}],["targetboxes",{"_index":456,"title":{},"body":{"interfaces/Collision.html":{}}}],["targetboxes.push",{"_index":473,"title":{},"body":{"interfaces/Collision.html":{}}}],["technologies",{"_index":1195,"title":{},"body":{"changelog.html":{}}}],["technology",{"_index":1013,"title":{},"body":{"changelog.html":{}}}],["telemetry",{"_index":878,"title":{},"body":{"changelog.html":{}}}],["terms",{"_index":635,"title":{},"body":{"changelog.html":{}}}],["test",{"_index":361,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{},"changelog.html":{}}}],["testing",{"_index":1089,"title":{},"body":{"changelog.html":{}}}],["text",{"_index":124,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/SpatialSceneNode.html":{},"miscellaneous/typealiases.html":{}}}],["textlayer",{"_index":46,"title":{},"body":{"classes/BodyUILayer.html":{},"coverage.html":{},"miscellaneous/functions.html":{}}}],["textlayer(id",{"_index":119,"title":{},"body":{"classes/BodyUILayer.html":{},"miscellaneous/functions.html":{}}}],["theme",{"_index":759,"title":{},"body":{"changelog.html":{}}}],["themes",{"_index":757,"title":{},"body":{"changelog.html":{}}}],["theming",{"_index":754,"title":{},"body":{"changelog.html":{}}}],["this._dragevent(info",{"_index":407,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["this._onclick",{"_index":289,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["this._ondrag",{"_index":295,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["this._ondragend",{"_index":297,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["this._ondragstart",{"_index":293,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["this._onhover",{"_index":287,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["this._onviewstatechange",{"_index":291,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["this.bodyuilayer",{"_index":285,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["this.bodyuilayer.setstate",{"_index":338,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["this.bodyuilayer.state",{"_index":323,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["this.cursor",{"_index":300,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["this.debugscenenodeprocessing(data",{"_index":339,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["this.deck",{"_index":308,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["this.deck.finalize",{"_index":330,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["this.deck.props.viewstate",{"_index":368,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["this.deck.setprops",{"_index":310,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["this.deckprops.debugscenenodeprocessing",{"_index":337,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["this.lasthovered",{"_index":382,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["this.nodeclicksubject.next",{"_index":390,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["this.nodeclicksubject.pipe(share",{"_index":258,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["this.nodedragendsubject",{"_index":412,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["this.nodedragendsubject.pipe(share",{"_index":270,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["this.nodedragstartsubject",{"_index":408,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["this.nodedragstartsubject.pipe(share",{"_index":266,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["this.nodedragsubject",{"_index":410,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["this.nodedragsubject.pipe(share",{"_index":268,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["this.nodehoverstartsubject.next(e.object",{"_index":383,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["this.nodehoverstartsubject.pipe(share",{"_index":260,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["this.nodehoverstopsubject.next(lasthovered",{"_index":381,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["this.nodehoverstopsubject.pipe(share",{"_index":262,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["this.props",{"_index":130,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["this.scenerotationsubject.next([deckprops.rotation",{"_index":320,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["this.scenerotationsubject.next([event.viewstate.rotationorbit",{"_index":404,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["this.scenerotationsubject.pipe(share",{"_index":264,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["this.setstate",{"_index":131,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["this.state",{"_index":135,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["this.zoomto(node",{"_index":335,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["through",{"_index":1101,"title":{},"body":{"changelog.html":{}}}],["thumbnails",{"_index":980,"title":{},"body":{"changelog.html":{}}}],["tied",{"_index":984,"title":{},"body":{"changelog.html":{}}}],["tiff",{"_index":1110,"title":{},"body":{"changelog.html":{}}}],["timeouts",{"_index":724,"title":{},"body":{"changelog.html":{}}}],["times",{"_index":714,"title":{},"body":{"changelog.html":{}}}],["tissue",{"_index":494,"title":{},"body":{"interfaces/Collision.html":{},"changelog.html":{}}}],["tissues",{"_index":779,"title":{},"body":{"changelog.html":{}}}],["tmc",{"_index":1214,"title":{},"body":{"changelog.html":{}}}],["toggle",{"_index":755,"title":{},"body":{"changelog.html":{}}}],["tool",{"_index":1026,"title":{},"body":{"changelog.html":{}}}],["tooltip",{"_index":528,"title":{},"body":{"interfaces/ProcessedNode.html":{},"interfaces/SpatialSceneNode.html":{}}}],["tort",{"_index":1512,"title":{},"body":{"license.html":{}}}],["tracking/telemetry",{"_index":896,"title":{},"body":{"changelog.html":{}}}],["transformmatrix",{"_index":114,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{},"interfaces/ProcessedNode.html":{},"interfaces/SpatialSceneNode.html":{}}}],["translate(center.toarray",{"_index":554,"title":{},"body":{"interfaces/ProcessedNode.html":{}}}],["translation_units",{"_index":603,"title":{},"body":{"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{}}}],["transparency",{"_index":1027,"title":{},"body":{"changelog.html":{}}}],["traversal",{"_index":431,"title":{},"body":{"interfaces/Collision.html":{},"interfaces/ProcessedNode.html":{}}}],["traversal.ts",{"_index":1261,"title":{},"body":{"coverage.html":{},"miscellaneous/functions.html":{},"miscellaneous/typealiases.html":{}}}],["traversescene",{"_index":430,"title":{},"body":{"interfaces/Collision.html":{},"interfaces/ProcessedNode.html":{},"coverage.html":{},"miscellaneous/functions.html":{}}}],["traversescene(gltfscene",{"_index":463,"title":{},"body":{"interfaces/Collision.html":{}}}],["traversescene(scene",{"_index":521,"title":{},"body":{"interfaces/ProcessedNode.html":{},"miscellaneous/functions.html":{}}}],["travisci",{"_index":1047,"title":{},"body":{"changelog.html":{}}}],["tree",{"_index":1169,"title":{},"body":{"changelog.html":{}}}],["true",{"_index":94,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/Collision.html":{},"interfaces/PickInfo.html":{},"interfaces/ProcessedNode.html":{}}}],["try",{"_index":1064,"title":{},"body":{"changelog.html":{}}}],["ts",{"_index":1373,"title":{},"body":{"dependencies.html":{}}}],["tslib",{"_index":1376,"title":{},"body":{"dependencies.html":{}}}],["tuned",{"_index":1224,"title":{},"body":{"changelog.html":{}}}],["turn",{"_index":1007,"title":{},"body":{"changelog.html":{}}}],["turned",{"_index":988,"title":{},"body":{"changelog.html":{}}}],["turning",{"_index":985,"title":{},"body":{"changelog.html":{}}}],["tutorial",{"_index":858,"title":{},"body":{"changelog.html":{}}}],["two",{"_index":1121,"title":{},"body":{"changelog.html":{}}}],["type",{"_index":23,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/Collision.html":{},"interfaces/PickInfo.html":{},"interfaces/ProcessedNode.html":{},"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{},"interfaces/SpatialSceneNode.html":{},"changelog.html":{},"coverage.html":{},"miscellaneous/typealiases.html":{},"miscellaneous/variables.html":{}}}],["typealiases",{"_index":1521,"title":{"miscellaneous/typealiases.html":{}},"body":{}}],["types",{"_index":728,"title":{},"body":{"changelog.html":{}}}],["types/lru",{"_index":1307,"title":{},"body":{"dependencies.html":{}}}],["typescript",{"_index":108,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{},"changelog.html":{},"index.html":{}}}],["typing",{"_index":1184,"title":{},"body":{"changelog.html":{}}}],["ub",{"_index":543,"title":{},"body":{"interfaces/ProcessedNode.html":{}}}],["ub.clone().vsub(lb",{"_index":546,"title":{},"body":{"interfaces/ProcessedNode.html":{}}}],["ufl",{"_index":979,"title":{},"body":{"changelog.html":{}}}],["ui",{"_index":9,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{},"changelog.html":{},"coverage.html":{},"miscellaneous/functions.html":{},"index.html":{}}}],["ui.netlify.app",{"_index":1424,"title":{},"body":{"index.html":{}}}],["ui.netlify.app/organ",{"_index":1433,"title":{},"body":{"index.html":{}}}],["ui.netlify.app/rui",{"_index":1430,"title":{},"body":{"index.html":{}}}],["ui.ts",{"_index":199,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{},"coverage.html":{},"miscellaneous/typealiases.html":{}}}],["ui/organ",{"_index":1432,"title":{},"body":{"index.html":{}}}],["ui/rui",{"_index":1431,"title":{},"body":{"index.html":{}}}],["ui/src/global",{"_index":1229,"title":{},"body":{"coverage.html":{},"miscellaneous/functions.html":{}}}],["ui/src/lib/body",{"_index":8,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{},"coverage.html":{},"miscellaneous/functions.html":{},"miscellaneous/typealiases.html":{}}}],["ui/src/lib/shared/ccf",{"_index":557,"title":{},"body":{"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{},"coverage.html":{}}}],["ui/src/lib/shared/spatial",{"_index":605,"title":{},"body":{"interfaces/SpatialSceneNode.html":{},"coverage.html":{},"miscellaneous/typealiases.html":{}}}],["ui/src/lib/util/load",{"_index":1242,"title":{},"body":{"coverage.html":{},"miscellaneous/functions.html":{}}}],["ui/src/lib/util/parse",{"_index":1245,"title":{},"body":{"coverage.html":{},"miscellaneous/functions.html":{}}}],["ui/src/lib/util/process",{"_index":504,"title":{},"body":{"interfaces/ProcessedNode.html":{},"coverage.html":{},"miscellaneous/functions.html":{},"miscellaneous/variables.html":{}}}],["ui/src/lib/util/scene",{"_index":1260,"title":{},"body":{"coverage.html":{},"miscellaneous/functions.html":{},"miscellaneous/typealiases.html":{}}}],["ui/src/lib/util/simplify",{"_index":1262,"title":{},"body":{"coverage.html":{},"miscellaneous/functions.html":{}}}],["ui/src/lib/util/spatial",{"_index":417,"title":{},"body":{"interfaces/Collision.html":{},"coverage.html":{},"miscellaneous/functions.html":{}}}],["uis",{"_index":632,"title":{},"body":{"changelog.html":{}}}],["undefined",{"_index":78,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{},"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{},"miscellaneous/functions.html":{}}}],["university",{"_index":1453,"title":{},"body":{"index.html":{}}}],["unknown",{"_index":77,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/Collision.html":{},"interfaces/PickInfo.html":{},"interfaces/ProcessedNode.html":{}}}],["unnecessary",{"_index":881,"title":{},"body":{"changelog.html":{}}}],["unpickable",{"_index":608,"title":{},"body":{"interfaces/SpatialSceneNode.html":{}}}],["unselect",{"_index":947,"title":{},"body":{"changelog.html":{}}}],["until",{"_index":991,"title":{},"body":{"changelog.html":{}}}],["up",{"_index":703,"title":{},"body":{"changelog.html":{}}}],["update",{"_index":647,"title":{},"body":{"changelog.html":{}}}],["updated",{"_index":621,"title":{},"body":{"changelog.html":{}}}],["updated_date",{"_index":579,"title":{},"body":{"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{}}}],["updates",{"_index":692,"title":{},"body":{"changelog.html":{}}}],["upgraded",{"_index":1106,"title":{},"body":{"changelog.html":{}}}],["upgrades",{"_index":1190,"title":{},"body":{"changelog.html":{}}}],["upgrading",{"_index":901,"title":{},"body":{"changelog.html":{}}}],["upload",{"_index":1022,"title":{},"body":{"changelog.html":{}}}],["upperbound",{"_index":444,"title":{},"body":{"interfaces/Collision.html":{},"interfaces/ProcessedNode.html":{}}}],["upperbound[i",{"_index":452,"title":{},"body":{"interfaces/Collision.html":{},"interfaces/ProcessedNode.html":{}}}],["url",{"_index":127,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/ProcessedNode.html":{}}}],["url2gltf",{"_index":146,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["url2gltf[m.scenegraph",{"_index":152,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["url2gltf[model.scenegraph",{"_index":168,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["use",{"_index":631,"title":{},"body":{"changelog.html":{},"license.html":{}}}],["used",{"_index":1006,"title":{},"body":{"changelog.html":{}}}],["user",{"_index":616,"title":{},"body":{"changelog.html":{},"index.html":{}}}],["user/os",{"_index":870,"title":{},"body":{"changelog.html":{}}}],["users",{"_index":1209,"title":{},"body":{"changelog.html":{}}}],["uses",{"_index":888,"title":{},"body":{"changelog.html":{}}}],["using",{"_index":842,"title":{},"body":{"changelog.html":{}}}],["util/load",{"_index":67,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["util/process",{"_index":229,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["util/spatial",{"_index":70,"title":{},"body":{"classes/BodyUILayer.html":{}}}],["utilities",{"_index":876,"title":{},"body":{"changelog.html":{}}}],["uuid",{"_index":1377,"title":{},"body":{"dependencies.html":{}}}],["v1.1",{"_index":774,"title":{},"body":{"changelog.html":{}}}],["v1.3",{"_index":630,"title":{},"body":{"changelog.html":{}}}],["v1.5.0",{"_index":1005,"title":{},"body":{"changelog.html":{}}}],["v1.7",{"_index":776,"title":{},"body":{"changelog.html":{}}}],["v1.7.0",{"_index":768,"title":{},"body":{"changelog.html":{}}}],["v1.8.0",{"_index":726,"title":{},"body":{"changelog.html":{}}}],["v1.9.0",{"_index":684,"title":{},"body":{"changelog.html":{}}}],["v1.9.4",{"_index":648,"title":{},"body":{"changelog.html":{}}}],["v1/sparql",{"_index":698,"title":{},"body":{"changelog.html":{}}}],["v2.1.0",{"_index":623,"title":{},"body":{"changelog.html":{}}}],["v3",{"_index":653,"title":{},"body":{"changelog.html":{}}}],["value",{"_index":27,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{},"miscellaneous/functions.html":{},"miscellaneous/variables.html":{}}}],["variable",{"_index":1255,"title":{},"body":{"coverage.html":{}}}],["variables",{"_index":1524,"title":{"miscellaneous/variables.html":{}},"body":{"miscellaneous/variables.html":{}}}],["vec3",{"_index":427,"title":{},"body":{"interfaces/Collision.html":{},"interfaces/ProcessedNode.html":{}}}],["vec3(...lowerbound.map((n",{"_index":450,"title":{},"body":{"interfaces/Collision.html":{},"interfaces/ProcessedNode.html":{}}}],["vec3(...upperbound.map((n",{"_index":453,"title":{},"body":{"interfaces/Collision.html":{},"interfaces/ProcessedNode.html":{}}}],["vec3(0.5",{"_index":549,"title":{},"body":{"interfaces/ProcessedNode.html":{}}}],["version",{"_index":789,"title":{},"body":{"changelog.html":{},"index.html":{}}}],["very",{"_index":1096,"title":{},"body":{"changelog.html":{}}}],["vhf_kidney_l_low1').then((results",{"_index":355,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["vhf_kidney_r_low",{"_index":363,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["via",{"_index":721,"title":{},"body":{"changelog.html":{}}}],["video",{"_index":902,"title":{},"body":{"changelog.html":{}}}],["view",{"_index":887,"title":{},"body":{"changelog.html":{}}}],["viewer",{"_index":973,"title":{},"body":{"changelog.html":{}}}],["viewing",{"_index":674,"title":{},"body":{"changelog.html":{}}}],["views",{"_index":277,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{},"changelog.html":{}}}],["viewstate",{"_index":311,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["viewstateprops",{"_index":218,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["visitor",{"_index":1411,"title":{},"body":{"miscellaneous/functions.html":{}}}],["visual",{"_index":672,"title":{},"body":{"changelog.html":{}}}],["visualization",{"_index":938,"title":{},"body":{"changelog.html":{}}}],["vitessce",{"_index":1107,"title":{},"body":{"changelog.html":{}}}],["void",{"_index":41,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{},"miscellaneous/functions.html":{}}}],["vs",{"_index":853,"title":{},"body":{"changelog.html":{}}}],["vu",{"_index":1220,"title":{},"body":{"changelog.html":{}}}],["warming",{"_index":720,"title":{},"body":{"changelog.html":{}}}],["warning",{"_index":1130,"title":{},"body":{"changelog.html":{}}}],["warranties",{"_index":1496,"title":{},"body":{"license.html":{}}}],["warranty",{"_index":1493,"title":{},"body":{"license.html":{}}}],["web",{"_index":718,"title":{},"body":{"changelog.html":{}}}],["webcomponent",{"_index":852,"title":{},"body":{"changelog.html":{}}}],["webcomponents/webcomponentsjs",{"_index":1309,"title":{},"body":{"dependencies.html":{}}}],["webpages",{"_index":795,"title":{},"body":{"changelog.html":{}}}],["website",{"_index":1419,"title":{},"body":{"index.html":{}}}],["week",{"_index":1226,"title":{},"body":{"changelog.html":{}}}],["whether",{"_index":1509,"title":{},"body":{"license.html":{}}}],["whole",{"_index":1222,"title":{},"body":{"changelog.html":{}}}],["width",{"_index":906,"title":{},"body":{"changelog.html":{}}}],["wireframe",{"_index":111,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/Collision.html":{},"interfaces/ProcessedNode.html":{},"interfaces/SpatialSceneNode.html":{},"miscellaneous/typealiases.html":{}}}],["within",{"_index":977,"title":{},"body":{"changelog.html":{}}}],["without",{"_index":815,"title":{},"body":{"changelog.html":{},"license.html":{}}}],["workflows",{"_index":1049,"title":{},"body":{"changelog.html":{}}}],["working",{"_index":782,"title":{},"body":{"changelog.html":{}}}],["works",{"_index":1068,"title":{},"body":{"changelog.html":{}}}],["worldmatrix",{"_index":516,"title":{},"body":{"interfaces/ProcessedNode.html":{},"miscellaneous/functions.html":{}}}],["wrapper",{"_index":245,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["x",{"_index":236,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["x_dimension",{"_index":580,"title":{},"body":{"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{}}}],["x_rotation",{"_index":596,"title":{},"body":{"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{}}}],["x_scaling",{"_index":592,"title":{},"body":{"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{}}}],["x_translation",{"_index":600,"title":{},"body":{"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{}}}],["y",{"_index":237,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["y_dimension",{"_index":581,"title":{},"body":{"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{}}}],["y_rotation",{"_index":597,"title":{},"body":{"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{}}}],["y_scaling",{"_index":593,"title":{},"body":{"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{}}}],["y_translation",{"_index":601,"title":{},"body":{"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{}}}],["yes",{"_index":1392,"title":{},"body":{"miscellaneous/functions.html":{}}}],["youtube",{"_index":821,"title":{},"body":{"changelog.html":{}}}],["z_dimension",{"_index":582,"title":{},"body":{"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{}}}],["z_rotation",{"_index":598,"title":{},"body":{"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{}}}],["z_scaling",{"_index":594,"title":{},"body":{"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{}}}],["z_translation",{"_index":602,"title":{},"body":{"interfaces/SpatialEntityJsonLd.html":{},"interfaces/SpatialObjectReferenceJsonLd.html":{},"interfaces/SpatialPlacementJsonLd.html":{}}}],["zone.js",{"_index":1379,"title":{},"body":{"dependencies.html":{}}}],["zoom",{"_index":210,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["zoombasedopacity",{"_index":364,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{},"interfaces/ProcessedNode.html":{},"interfaces/SpatialSceneNode.html":{}}}],["zoomopacity",{"_index":132,"title":{},"body":{"classes/BodyUILayer.html":{},"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["zoomto(node",{"_index":365,"title":{},"body":{"interfaces/BodyUIProps.html":{},"interfaces/BodyUIViewStateProps.html":{},"interfaces/PickInfo.html":{}}}],["zoomtoonload",{"_index":609,"title":{},"body":{"interfaces/SpatialSceneNode.html":{}}}]],"pipeline":["stemmer"]}, + "store": {"classes/BodyUILayer.html":{"url":"classes/BodyUILayer.html","title":"class - BodyUILayer","body":"\n \n\n\n\n\n\n\n\n\n\n\n\n\n Classes\n BodyUILayer\n\n\n\n \n Info\n \n \n Source\n \n\n\n\n \n \n File\n \n \n projects/ccf-body-ui/src/lib/body-ui-layer.ts\n \n\n\n\n \n Extends\n \n \n CompositeLayer\n \n\n\n\n \n Index\n \n \n \n \n Properties\n \n \n \n \n \n \n Static\n Readonly\n gltfCache\n \n \n Static\n Readonly\n layerName\n \n \n \n \n\n \n \n Methods\n \n \n \n \n \n \n getPickingInfo\n \n \n initializeState\n \n \n renderLayers\n \n \n \n \n\n\n\n\n\n \n \n\n\n\n \n \n \n Properties\n \n \n \n \n \n \n \n Static\n Readonly\n gltfCache\n \n \n \n \n \n \n Type : literal type\n\n \n \n \n \n Default value : {}\n \n \n \n \n Defined in projects/ccf-body-ui/src/lib/body-ui-layer.ts:72\n \n \n\n\n \n \n \n \n \n \n \n \n Static\n Readonly\n layerName\n \n \n \n \n \n \n Type : string\n\n \n \n \n \n Default value : 'BodyUILayer'\n \n \n \n \n Defined in projects/ccf-body-ui/src/lib/body-ui-layer.ts:71\n \n \n\n\n \n \n\n\n \n \n \n Methods\n \n \n \n \n \n \n \n getPickingInfo\n \n \n \n \n \n \ngetPickingInfo(e)\n \n \n\n\n \n \n Defined in projects/ccf-body-ui/src/lib/body-ui-layer.ts:143\n \n \n\n\n \n \n\n \n Parameters :\n \n \n \n Name\n Optional\n \n \n \n \n e\n\n \n No\n \n\n\n \n \n \n \n \n \n \n Returns : ReturnType<>\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n initializeState\n \n \n \n \n \n \ninitializeState()\n \n \n\n\n \n \n Defined in projects/ccf-body-ui/src/lib/body-ui-layer.ts:74\n \n \n\n\n \n \n\n \n Returns : void\n\n \n \n \n \n \n \n \n \n \n \n \n renderLayers\n \n \n \n \n \n \nrenderLayers()\n \n \n\n\n \n \n Defined in projects/ccf-body-ui/src/lib/body-ui-layer.ts:80\n \n \n\n\n \n \n\n \n Returns : []\n\n \n \n \n \n \n\n\n\n\n\n\n \n\n\n \n import { CompositeLayer, COORDINATE_SYSTEM } from '@deck.gl/core';\nimport { TextLayer } from '@deck.gl/layers';\nimport { ScenegraphLayer, SimpleMeshLayer } from '@deck.gl/mesh-layers';\nimport { ConeGeometry, CubeGeometry, CylinderGeometry, Geometry, SphereGeometry } from '@luma.gl/core';\nimport { Matrix4 } from '@math.gl/core';\n\nimport { SpatialSceneNode } from './shared/spatial-scene-node';\nimport { loadGLTF, loadGLTF2, registerGLTFLoaders } from './util/load-gltf';\nimport { doCollisions } from './util/spatial-scene-collider';\n\n\nfunction meshLayer(id: string, data: SpatialSceneNode[], options: { [key: string]: unknown }): SimpleMeshLayer | undefined {\n if (!data || data.length === 0) {\n return undefined;\n } else {\n let mesh: Geometry;\n switch (options.geometry) {\n case 'sphere':\n mesh = new SphereGeometry();\n break;\n case 'cone':\n mesh = new ConeGeometry();\n break;\n case 'cylinder':\n mesh = new CylinderGeometry();\n break;\n case 'cube':\n default:\n mesh = new CubeGeometry();\n break;\n }\n return new SimpleMeshLayer({\n ...{\n id,\n pickable: true,\n autoHighlight: false,\n highlightColor: [30, 136, 229, 255],\n coordinateSystem: COORDINATE_SYSTEM.CARTESIAN,\n data,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n mesh: mesh as any,\n wireframe: false,\n getTransformMatrix: (d) => (d as { transformMatrix: number[][] }).transformMatrix,\n getColor: (d) => (d as { color: [number, number, number, number] }).color || [255, 255, 255, 0.9*255]\n },\n ...options\n });\n }\n}\n\nfunction textLayer(id: string, data: SpatialSceneNode[], options: { [key: string]: unknown }): TextLayer | undefined {\n if (!data || data.length === 0) {\n return undefined;\n } else {\n return new TextLayer({\n ...{\n id,\n pickable: true,\n data: data.map(d => ({ ...d, position: new Matrix4(d.transformMatrix).getTranslation() })),\n getText: (d) => (d as { text: string }).text,\n getPosition: (d) => (d as { position: [number, number] }).position,\n getColor: (d) => (d as { color: [number, number, number, number] }).color\n },\n ...options\n });\n }\n}\n\nexport class BodyUILayer extends CompositeLayer {\n static readonly layerName = 'BodyUILayer';\n static readonly gltfCache: { [url: string]: Promise } = {};\n\n initializeState(): void {\n const { data } = this.props;\n this.setState({ data: data ?? [], zoomOpacity: 0.8, doCollisions: false });\n registerGLTFLoaders();\n }\n\n renderLayers(): unknown[] {\n const state = this.state as { data: SpatialSceneNode[]; zoomOpacity: number; doCollisions: boolean };\n const geometries: Record = {\n 'sphere': [], 'cone': [], 'cylinder': [], 'cube': [], 'text': [], 'wireframe': [], 'scenegraph': []\n };\n\n for (const node of state.data) {\n const geometry = node.geometry ?? 'cube';\n if (node.scenegraph) {\n geometries.scenegraph.push(node);\n } else if (geometries[geometry] !== undefined) {\n geometries[geometry].push(node);\n }\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const url2gltf: { [url: string]: Promise } = {};\n for (const m of geometries.scenegraph) {\n if (m.scenegraph && m.scenegraphNode && !Object.prototype.hasOwnProperty.call(url2gltf, m.scenegraph)) {\n url2gltf[m.scenegraph] = loadGLTF({ scenegraph: m.scenegraph } as SpatialSceneNode, BodyUILayer.gltfCache);\n }\n }\n\n const layers: unknown[] = [];\n for (const [geometry, nodes] of Object.entries(geometries)) {\n if (geometry === 'scenegraph') {\n for (const model of nodes) {\n layers.push(\n new ScenegraphLayer({\n id: 'models-' + model['@id'],\n opacity: model.zoomBasedOpacity ? state.zoomOpacity : (model.opacity !== undefined ? model.opacity : 1.0),\n pickable: !model.unpickable,\n coordinateSystem: COORDINATE_SYSTEM.CARTESIAN,\n data: [model],\n scenegraph: model.scenegraphNode ?\n loadGLTF2(model.scenegraphNode, url2gltf[model.scenegraph as string]) :\n model.scenegraph as unknown as URL,\n // eslint-disable-next-line @typescript-eslint/naming-convention\n _lighting: model._lighting, // 'pbr' | undefined\n getTransformMatrix: model.transformMatrix as unknown as number[][],\n getColor: model.color ?? [0, 255, 0, 0.5*255],\n parameters: { depthMask: !model.zoomBasedOpacity && (model.opacity === undefined || model.opacity === 1) }\n })\n );\n }\n } else if (geometry === 'text') {\n layers.push(textLayer('text', nodes.filter(n => n.unpickable), { pickable: false }));\n layers.push(textLayer('textPickable', nodes.filter(n => !n.unpickable), { pickable: true }));\n } else if (geometry === 'wireframe') {\n layers.push(meshLayer(geometry, nodes, { wireframe: true, pickable: false, geometry }));\n } else {\n layers.push(meshLayer(geometry, nodes.filter(n => n.unpickable), { wireframe: false, pickable: false, geometry }));\n layers.push(meshLayer(`${geometry}Pickable`, nodes.filter(n => !n.unpickable), { wireframe: false, pickable: true, geometry }));\n }\n }\n\n if (state.doCollisions) {\n doCollisions(state.data);\n }\n\n return layers.filter(l => !!l);\n }\n\n getPickingInfo(\n e: Parameters['getPickingInfo']>[0]\n ): ReturnType['getPickingInfo']> {\n return e.info;\n }\n}\n\n \n\n\n\n\n \n\n\n\n\n \n \n result-matching \"\"\n \n \n \n No results matching \"\"\n \n\n"},"interfaces/BodyUIProps.html":{"url":"interfaces/BodyUIProps.html","title":"interface - BodyUIProps","body":"\n \n\n\n\n\n\n\n\n\n\n\n\n\n\n Interfaces\n \n BodyUIProps\n\n\n\n \n Info\n \n \n Source\n \n\n\n\n \n \n File\n \n \n projects/ccf-body-ui/src/lib/body-ui.ts\n \n\n\n\n\n \n Index\n \n \n \n \n Properties\n \n \n \n \n \n \n \n camera\n \n \n \n \n canvas\n \n \n \n Optional\n \n debugSceneNodeProcessing\n \n \n \n \n id\n \n \n \n \n interactive\n \n \n \n Optional\n \n legacyLighting\n \n \n \n \n maxRotationX\n \n \n \n \n minRotationX\n \n \n \n \n parent\n \n \n \n \n rotation\n \n \n \n \n target\n \n \n \n \n zoom\n \n \n \n \n \n \n \n \n\n\n\n \n Properties\n \n \n \n \n \n camera\n \n \n \n \n \n \n \n \n camera: string\n\n \n \n\n\n \n \n Type : string\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n canvas\n \n \n \n \n \n \n \n \n canvas: string | HTMLCanvasElement\n\n \n \n\n\n \n \n Type : string | HTMLCanvasElement\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n debugSceneNodeProcessing\n \n \n \n \n \n \n \n \n debugSceneNodeProcessing: boolean\n\n \n \n\n\n \n \n Type : boolean\n\n \n \n\n \n \n Optional\n \n \n\n\n\n\n \n \n \n \n \n \n \n id\n \n \n \n \n \n \n \n \n id: string\n\n \n \n\n\n \n \n Type : string\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n interactive\n \n \n \n \n \n \n \n \n interactive: boolean\n\n \n \n\n\n \n \n Type : boolean\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n legacyLighting\n \n \n \n \n \n \n \n \n legacyLighting: boolean\n\n \n \n\n\n \n \n Type : boolean\n\n \n \n\n \n \n Optional\n \n \n\n\n\n\n \n \n \n \n \n \n \n maxRotationX\n \n \n \n \n \n \n \n \n maxRotationX: number\n\n \n \n\n\n \n \n Type : number\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n minRotationX\n \n \n \n \n \n \n \n \n minRotationX: number\n\n \n \n\n\n \n \n Type : number\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n parent\n \n \n \n \n \n \n \n \n parent: HTMLElement\n\n \n \n\n\n \n \n Type : HTMLElement\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n rotation\n \n \n \n \n \n \n \n \n rotation: number\n\n \n \n\n\n \n \n Type : number\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n target\n \n \n \n \n \n \n \n \n target: Matrix4 | number[]\n\n \n \n\n\n \n \n Type : Matrix4 | number[]\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n zoom\n \n \n \n \n \n \n \n \n zoom: number\n\n \n \n\n\n \n \n Type : number\n\n \n \n\n\n\n\n\n \n \n \n \n\n\n \n import { AmbientLight, Deck, LightingEffect, OrbitView, OrthographicView } from '@deck.gl/core';\nimport { ViewStateProps } from '@deck.gl/core/lib/deck';\nimport { Matrix4 } from '@math.gl/core';\nimport bind from 'bind-decorator';\nimport { BehaviorSubject, Subject } from 'rxjs';\nimport { share } from 'rxjs/operators';\n\nimport { BodyUILayer } from './body-ui-layer';\nimport { SpatialSceneNode } from './shared/spatial-scene-node';\nimport { processSceneNodes } from './util/process-scene-nodes';\n\n\ninterface BodyUIViewStateProps extends ViewStateProps {\n orbitAxis?: string;\n target?: Matrix4 | number[];\n zoom: number;\n rotationOrbit: number;\n rotationX: number;\n camera: string;\n}\n\nexport interface BodyUIProps {\n id: string;\n canvas: string | HTMLCanvasElement;\n parent: HTMLElement;\n debugSceneNodeProcessing?: boolean;\n target: Matrix4 | number[];\n interactive: boolean;\n rotation: number;\n minRotationX: number;\n maxRotationX: number;\n zoom: number;\n legacyLighting?: boolean;\n camera: string;\n}\n\nexport interface PickInfo {\n layer: unknown;\n index: number;\n object: D;\n x: number;\n y: number;\n coordinate?: unknown;\n picked?: boolean;\n}\n\nexport type NodeDragEvent = { node: SpatialSceneNode; info: PickInfo; e: MouseEvent };\n\nexport type NodeClickEvent = { node: SpatialSceneNode; ctrlClick: boolean };\n\n/**\n * A convenience wrapper class for the CCF Body UI\n */\nexport class BodyUI {\n deck: Deck;\n private readonly bodyUILayer = new BodyUILayer({});\n\n private readonly nodeClickSubject = new Subject();\n private readonly nodeHoverStartSubject = new Subject();\n private readonly nodeHoverStopSubject = new Subject();\n private readonly sceneRotationSubject = new BehaviorSubject([0, 0]);\n private readonly nodeDragStartSubject = new Subject();\n private readonly nodeDragSubject = new Subject();\n private readonly nodeDragEndSubject = new Subject();\n\n readonly nodeClick$ = this.nodeClickSubject.pipe(share());\n readonly nodeHoverStart$ = this.nodeHoverStartSubject.pipe(share());\n readonly nodeHoverStop$ = this.nodeHoverStopSubject.pipe(share());\n readonly sceneRotation$ = this.sceneRotationSubject.pipe(share());\n readonly nodeDragStart$ = this.nodeDragStartSubject.pipe(share());\n readonly nodeDrag$ = this.nodeDragSubject.pipe(share());\n readonly nodeDragEnd$ = this.nodeDragEndSubject.pipe(share());\n\n private cursor?: string;\n private lastHovered?: SpatialSceneNode;\n\n constructor(private deckProps: Partial) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const props: any = {\n ...deckProps,\n views: [ deckProps.camera === 'orthographic' ? new OrthographicView({\n flipY: false,\n near: -1000\n }) : new OrbitView({ orbitAxis: 'Y' }) ],\n controller: deckProps.interactive !== undefined ? deckProps.interactive : true,\n layers: [ this.bodyUILayer ],\n onHover: this._onHover,\n onClick: this._onClick,\n onViewStateChange: this._onViewStateChange,\n onDragStart: this._onDragStart,\n onDrag: this._onDrag,\n onDragEnd: this._onDragEnd,\n getCursor: (e: { isDragging: boolean }) => this.cursor ?? (e.isDragging ? 'grabbing' : 'grab')\n };\n if (deckProps.legacyLighting) {\n // eslint-disable-next-line\n props.effects = [\n new LightingEffect({\n ambientLight: new AmbientLight({\n color: [255, 255, 255],\n intensity: 10.0\n })\n })\n ];\n }\n // eslint-disable-next-line\n this.deck = new Deck(props);\n this.deck.setProps({\n viewState: {\n orbitAxis: 'Y',\n minRotationX: deckProps.minRotationX ?? -15,\n maxRotationX: deckProps.maxRotationX ?? 15,\n target: deckProps.target ?? [0.5, 0.5, 0],\n rotationX: 0,\n rotationOrbit: deckProps.rotation ?? 0,\n zoom: deckProps.zoom ?? 9.5,\n camera: deckProps.camera\n } as BodyUIViewStateProps\n });\n if (deckProps.rotation) {\n this.sceneRotationSubject.next([deckProps.rotation, 0]);\n }\n }\n\n async initialize(): Promise {\n while (!this.bodyUILayer.state) {\n // eslint-disable-next-line no-await-in-loop\n await new Promise(r => {\n setTimeout(r, 200);\n });\n }\n }\n\n finalize(): void {\n this.deck.finalize();\n }\n\n setScene(data: SpatialSceneNode[]): void {\n if (data?.length > 0) {\n let zoomOpacity = (this.bodyUILayer.state as { zoomOpacity: number }).zoomOpacity;\n let didZoom = false;\n for (const node of data) {\n if (node.zoomToOnLoad) {\n this.zoomTo(node);\n didZoom = true;\n }\n }\n zoomOpacity = didZoom ? 0.05 : zoomOpacity;\n if (!this.deckProps.debugSceneNodeProcessing) {\n this.bodyUILayer.setState({ data, zoomOpacity });\n } else {\n this.debugSceneNodeProcessing(data, zoomOpacity);\n }\n }\n }\n\n debugSceneNodeProcessing(data: SpatialSceneNode[], zoomOpacity: number): void {\n // const gltfUrl = 'https://hubmapconsortium.github.io/ccf-3d-reference-object-library/VH_Male/United/VHM_United_Color.glb';\n const gltfUrl = 'https://hubmapconsortium.github.io/ccf-3d-reference-object-library/VH_Female/United/VHF_United_Color.glb';\n // const gltfUrl = 'https://hubmapconsortium.github.io/hubmap-ontology/objects/VHF_United_v01_060420.glb';\n const gltfTransform = new Matrix4([0.076,0,0,0,0,0.076,1.6875389974302382e-17,0,0,-1.6875389974302382e-17,0.076,0,0.49,0.034,0.11,1]);\n processSceneNodes(gltfUrl, gltfTransform, 'VHF_Kidney_L_Low1').then((results) => {\n console.log('results', results);\n console.log('data', data);\n // data = Object.values(results);\n data = data.concat(Object.values(results));\n data.push({\n '@id': 'TEST',\n '@type': 'TEST',\n scenegraph: gltfUrl,\n scenegraphNode: 'VHF_Kidney_R_Low',\n transformMatrix: gltfTransform,\n color: [255, 255, 255, 200],\n // eslint-disable-next-line @typescript-eslint/naming-convention\n _lighting: 'pbr',\n zoomBasedOpacity: false\n });\n this.bodyUILayer.setState({ data, zoomOpacity });\n });\n }\n\n zoomTo(node: SpatialSceneNode): void {\n const matrix = new Matrix4(node.transformMatrix);\n this.deck.setProps({\n viewState: {\n ...this.deck.props.viewState,\n target: matrix.getTranslation(),\n rotationX: 0,\n rotationOrbit: 0,\n zoom: 11.5,\n } as BodyUIViewStateProps\n });\n }\n\n setRotation(value: number): void {\n this.deck.setProps({\n viewState: {\n ...this.deck.props.viewState,\n rotationOrbit: value\n } as BodyUIViewStateProps\n });\n }\n\n setRotationX(value: number): void {\n this.deck.setProps({\n viewState: {\n ...this.deck.props.viewState,\n rotationX: value\n } as BodyUIViewStateProps\n });\n }\n\n setZoom(value: number): void {\n this.deck.setProps({\n viewState: {\n ...this.deck.props.viewState,\n zoom: value\n } as BodyUIViewStateProps\n });\n }\n\n setTarget(value: number[]): void {\n this.deck.setProps({\n viewState: {\n ...this.deck.props.viewState,\n target: value\n } as BodyUIViewStateProps\n });\n }\n\n setInteractive(value: boolean): void {\n this.deck.setProps({\n controller: value\n });\n }\n\n @bind\n private _onHover(e: { picked: boolean; object: SpatialSceneNode }): void {\n const { lastHovered } = this;\n this.cursor = e.picked ? 'pointer' : undefined;\n if (e.picked && e.object && e.object['@id']) {\n if (lastHovered !== e.object) {\n if (lastHovered) {\n this.nodeHoverStopSubject.next(lastHovered);\n }\n this.lastHovered = e.object;\n this.nodeHoverStartSubject.next(e.object);\n }\n } else if (lastHovered) {\n this.nodeHoverStopSubject.next(lastHovered);\n this.lastHovered = undefined;\n }\n }\n\n @bind\n private _onClick(info: PickInfo, e: { srcEvent: { ctrlKey: boolean } }): void {\n if (info.picked && info.object && info.object['@id']) {\n this.nodeClickSubject.next({ node: info.object, ctrlClick: e?.srcEvent?.ctrlKey ?? undefined });\n }\n }\n\n @bind\n private _onViewStateChange(event: { interactionState: { isZooming: boolean }; viewState: BodyUIViewStateProps }): void {\n if (event.interactionState?.isZooming) {\n const currentState = this.bodyUILayer.state as { zoomOpacity: number; data: unknown };\n const zoomOpacity = Math.min(Math.max(1 - (event.viewState.zoom - 8.9) / 2, 0.05), 1.0);\n if (currentState.zoomOpacity !== zoomOpacity) {\n this.bodyUILayer.setState({ data: currentState.data, zoomOpacity });\n }\n }\n this.deck.setProps({ viewState: { ...event.viewState } });\n this.sceneRotationSubject.next([event.viewState.rotationOrbit, event.viewState.rotationX]);\n }\n\n @bind\n private _onDragStart(info: PickInfo, e: MouseEvent): void {\n this._dragEvent(info, e, this.nodeDragStartSubject);\n }\n\n @bind\n private _onDrag(info: PickInfo, e: MouseEvent): void {\n this._dragEvent(info, e, this.nodeDragSubject);\n }\n\n @bind\n private _onDragEnd(info: PickInfo, e: MouseEvent): void {\n this._dragEvent(info, e, this.nodeDragEndSubject);\n }\n\n private _dragEvent(info: PickInfo, e: MouseEvent, subject: Subject): void {\n if (info?.object?.['@id']) {\n subject.next({ node: info.object, info, e });\n }\n }\n}\n\n \n\n\n\n \n\n\n\n\n \n \n result-matching \"\"\n \n \n \n No results matching \"\"\n \n\n"},"interfaces/BodyUIViewStateProps.html":{"url":"interfaces/BodyUIViewStateProps.html","title":"interface - BodyUIViewStateProps","body":"\n \n\n\n\n\n\n\n\n\n\n\n\n\n\n Interfaces\n \n BodyUIViewStateProps\n\n\n\n \n Info\n \n \n Source\n \n\n\n\n \n \n File\n \n \n projects/ccf-body-ui/src/lib/body-ui.ts\n \n\n\n\n \n Extends\n \n \n ViewStateProps\n \n\n \n Index\n \n \n \n \n Properties\n \n \n \n \n \n \n \n camera\n \n \n \n Optional\n \n orbitAxis\n \n \n \n \n rotationOrbit\n \n \n \n \n rotationX\n \n \n \n Optional\n \n target\n \n \n \n \n zoom\n \n \n \n \n \n \n \n \n\n\n\n \n Properties\n \n \n \n \n \n camera\n \n \n \n \n \n \n \n \n camera: string\n\n \n \n\n\n \n \n Type : string\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n orbitAxis\n \n \n \n \n \n \n \n \n orbitAxis: string\n\n \n \n\n\n \n \n Type : string\n\n \n \n\n \n \n Optional\n \n \n\n\n\n\n \n \n \n \n \n \n \n rotationOrbit\n \n \n \n \n \n \n \n \n rotationOrbit: number\n\n \n \n\n\n \n \n Type : number\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n rotationX\n \n \n \n \n \n \n \n \n rotationX: number\n\n \n \n\n\n \n \n Type : number\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n target\n \n \n \n \n \n \n \n \n target: Matrix4 | number[]\n\n \n \n\n\n \n \n Type : Matrix4 | number[]\n\n \n \n\n \n \n Optional\n \n \n\n\n\n\n \n \n \n \n \n \n \n zoom\n \n \n \n \n \n \n \n \n zoom: number\n\n \n \n\n\n \n \n Type : number\n\n \n \n\n\n\n\n\n \n \n \n \n\n\n \n import { AmbientLight, Deck, LightingEffect, OrbitView, OrthographicView } from '@deck.gl/core';\nimport { ViewStateProps } from '@deck.gl/core/lib/deck';\nimport { Matrix4 } from '@math.gl/core';\nimport bind from 'bind-decorator';\nimport { BehaviorSubject, Subject } from 'rxjs';\nimport { share } from 'rxjs/operators';\n\nimport { BodyUILayer } from './body-ui-layer';\nimport { SpatialSceneNode } from './shared/spatial-scene-node';\nimport { processSceneNodes } from './util/process-scene-nodes';\n\n\ninterface BodyUIViewStateProps extends ViewStateProps {\n orbitAxis?: string;\n target?: Matrix4 | number[];\n zoom: number;\n rotationOrbit: number;\n rotationX: number;\n camera: string;\n}\n\nexport interface BodyUIProps {\n id: string;\n canvas: string | HTMLCanvasElement;\n parent: HTMLElement;\n debugSceneNodeProcessing?: boolean;\n target: Matrix4 | number[];\n interactive: boolean;\n rotation: number;\n minRotationX: number;\n maxRotationX: number;\n zoom: number;\n legacyLighting?: boolean;\n camera: string;\n}\n\nexport interface PickInfo {\n layer: unknown;\n index: number;\n object: D;\n x: number;\n y: number;\n coordinate?: unknown;\n picked?: boolean;\n}\n\nexport type NodeDragEvent = { node: SpatialSceneNode; info: PickInfo; e: MouseEvent };\n\nexport type NodeClickEvent = { node: SpatialSceneNode; ctrlClick: boolean };\n\n/**\n * A convenience wrapper class for the CCF Body UI\n */\nexport class BodyUI {\n deck: Deck;\n private readonly bodyUILayer = new BodyUILayer({});\n\n private readonly nodeClickSubject = new Subject();\n private readonly nodeHoverStartSubject = new Subject();\n private readonly nodeHoverStopSubject = new Subject();\n private readonly sceneRotationSubject = new BehaviorSubject([0, 0]);\n private readonly nodeDragStartSubject = new Subject();\n private readonly nodeDragSubject = new Subject();\n private readonly nodeDragEndSubject = new Subject();\n\n readonly nodeClick$ = this.nodeClickSubject.pipe(share());\n readonly nodeHoverStart$ = this.nodeHoverStartSubject.pipe(share());\n readonly nodeHoverStop$ = this.nodeHoverStopSubject.pipe(share());\n readonly sceneRotation$ = this.sceneRotationSubject.pipe(share());\n readonly nodeDragStart$ = this.nodeDragStartSubject.pipe(share());\n readonly nodeDrag$ = this.nodeDragSubject.pipe(share());\n readonly nodeDragEnd$ = this.nodeDragEndSubject.pipe(share());\n\n private cursor?: string;\n private lastHovered?: SpatialSceneNode;\n\n constructor(private deckProps: Partial) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const props: any = {\n ...deckProps,\n views: [ deckProps.camera === 'orthographic' ? new OrthographicView({\n flipY: false,\n near: -1000\n }) : new OrbitView({ orbitAxis: 'Y' }) ],\n controller: deckProps.interactive !== undefined ? deckProps.interactive : true,\n layers: [ this.bodyUILayer ],\n onHover: this._onHover,\n onClick: this._onClick,\n onViewStateChange: this._onViewStateChange,\n onDragStart: this._onDragStart,\n onDrag: this._onDrag,\n onDragEnd: this._onDragEnd,\n getCursor: (e: { isDragging: boolean }) => this.cursor ?? (e.isDragging ? 'grabbing' : 'grab')\n };\n if (deckProps.legacyLighting) {\n // eslint-disable-next-line\n props.effects = [\n new LightingEffect({\n ambientLight: new AmbientLight({\n color: [255, 255, 255],\n intensity: 10.0\n })\n })\n ];\n }\n // eslint-disable-next-line\n this.deck = new Deck(props);\n this.deck.setProps({\n viewState: {\n orbitAxis: 'Y',\n minRotationX: deckProps.minRotationX ?? -15,\n maxRotationX: deckProps.maxRotationX ?? 15,\n target: deckProps.target ?? [0.5, 0.5, 0],\n rotationX: 0,\n rotationOrbit: deckProps.rotation ?? 0,\n zoom: deckProps.zoom ?? 9.5,\n camera: deckProps.camera\n } as BodyUIViewStateProps\n });\n if (deckProps.rotation) {\n this.sceneRotationSubject.next([deckProps.rotation, 0]);\n }\n }\n\n async initialize(): Promise {\n while (!this.bodyUILayer.state) {\n // eslint-disable-next-line no-await-in-loop\n await new Promise(r => {\n setTimeout(r, 200);\n });\n }\n }\n\n finalize(): void {\n this.deck.finalize();\n }\n\n setScene(data: SpatialSceneNode[]): void {\n if (data?.length > 0) {\n let zoomOpacity = (this.bodyUILayer.state as { zoomOpacity: number }).zoomOpacity;\n let didZoom = false;\n for (const node of data) {\n if (node.zoomToOnLoad) {\n this.zoomTo(node);\n didZoom = true;\n }\n }\n zoomOpacity = didZoom ? 0.05 : zoomOpacity;\n if (!this.deckProps.debugSceneNodeProcessing) {\n this.bodyUILayer.setState({ data, zoomOpacity });\n } else {\n this.debugSceneNodeProcessing(data, zoomOpacity);\n }\n }\n }\n\n debugSceneNodeProcessing(data: SpatialSceneNode[], zoomOpacity: number): void {\n // const gltfUrl = 'https://hubmapconsortium.github.io/ccf-3d-reference-object-library/VH_Male/United/VHM_United_Color.glb';\n const gltfUrl = 'https://hubmapconsortium.github.io/ccf-3d-reference-object-library/VH_Female/United/VHF_United_Color.glb';\n // const gltfUrl = 'https://hubmapconsortium.github.io/hubmap-ontology/objects/VHF_United_v01_060420.glb';\n const gltfTransform = new Matrix4([0.076,0,0,0,0,0.076,1.6875389974302382e-17,0,0,-1.6875389974302382e-17,0.076,0,0.49,0.034,0.11,1]);\n processSceneNodes(gltfUrl, gltfTransform, 'VHF_Kidney_L_Low1').then((results) => {\n console.log('results', results);\n console.log('data', data);\n // data = Object.values(results);\n data = data.concat(Object.values(results));\n data.push({\n '@id': 'TEST',\n '@type': 'TEST',\n scenegraph: gltfUrl,\n scenegraphNode: 'VHF_Kidney_R_Low',\n transformMatrix: gltfTransform,\n color: [255, 255, 255, 200],\n // eslint-disable-next-line @typescript-eslint/naming-convention\n _lighting: 'pbr',\n zoomBasedOpacity: false\n });\n this.bodyUILayer.setState({ data, zoomOpacity });\n });\n }\n\n zoomTo(node: SpatialSceneNode): void {\n const matrix = new Matrix4(node.transformMatrix);\n this.deck.setProps({\n viewState: {\n ...this.deck.props.viewState,\n target: matrix.getTranslation(),\n rotationX: 0,\n rotationOrbit: 0,\n zoom: 11.5,\n } as BodyUIViewStateProps\n });\n }\n\n setRotation(value: number): void {\n this.deck.setProps({\n viewState: {\n ...this.deck.props.viewState,\n rotationOrbit: value\n } as BodyUIViewStateProps\n });\n }\n\n setRotationX(value: number): void {\n this.deck.setProps({\n viewState: {\n ...this.deck.props.viewState,\n rotationX: value\n } as BodyUIViewStateProps\n });\n }\n\n setZoom(value: number): void {\n this.deck.setProps({\n viewState: {\n ...this.deck.props.viewState,\n zoom: value\n } as BodyUIViewStateProps\n });\n }\n\n setTarget(value: number[]): void {\n this.deck.setProps({\n viewState: {\n ...this.deck.props.viewState,\n target: value\n } as BodyUIViewStateProps\n });\n }\n\n setInteractive(value: boolean): void {\n this.deck.setProps({\n controller: value\n });\n }\n\n @bind\n private _onHover(e: { picked: boolean; object: SpatialSceneNode }): void {\n const { lastHovered } = this;\n this.cursor = e.picked ? 'pointer' : undefined;\n if (e.picked && e.object && e.object['@id']) {\n if (lastHovered !== e.object) {\n if (lastHovered) {\n this.nodeHoverStopSubject.next(lastHovered);\n }\n this.lastHovered = e.object;\n this.nodeHoverStartSubject.next(e.object);\n }\n } else if (lastHovered) {\n this.nodeHoverStopSubject.next(lastHovered);\n this.lastHovered = undefined;\n }\n }\n\n @bind\n private _onClick(info: PickInfo, e: { srcEvent: { ctrlKey: boolean } }): void {\n if (info.picked && info.object && info.object['@id']) {\n this.nodeClickSubject.next({ node: info.object, ctrlClick: e?.srcEvent?.ctrlKey ?? undefined });\n }\n }\n\n @bind\n private _onViewStateChange(event: { interactionState: { isZooming: boolean }; viewState: BodyUIViewStateProps }): void {\n if (event.interactionState?.isZooming) {\n const currentState = this.bodyUILayer.state as { zoomOpacity: number; data: unknown };\n const zoomOpacity = Math.min(Math.max(1 - (event.viewState.zoom - 8.9) / 2, 0.05), 1.0);\n if (currentState.zoomOpacity !== zoomOpacity) {\n this.bodyUILayer.setState({ data: currentState.data, zoomOpacity });\n }\n }\n this.deck.setProps({ viewState: { ...event.viewState } });\n this.sceneRotationSubject.next([event.viewState.rotationOrbit, event.viewState.rotationX]);\n }\n\n @bind\n private _onDragStart(info: PickInfo, e: MouseEvent): void {\n this._dragEvent(info, e, this.nodeDragStartSubject);\n }\n\n @bind\n private _onDrag(info: PickInfo, e: MouseEvent): void {\n this._dragEvent(info, e, this.nodeDragSubject);\n }\n\n @bind\n private _onDragEnd(info: PickInfo, e: MouseEvent): void {\n this._dragEvent(info, e, this.nodeDragEndSubject);\n }\n\n private _dragEvent(info: PickInfo, e: MouseEvent, subject: Subject): void {\n if (info?.object?.['@id']) {\n subject.next({ node: info.object, info, e });\n }\n }\n}\n\n \n\n\n\n \n\n\n\n\n \n \n result-matching \"\"\n \n \n \n No results matching \"\"\n \n\n"},"interfaces/Collision.html":{"url":"interfaces/Collision.html","title":"interface - Collision","body":"\n \n\n\n\n\n\n\n\n\n\n\n\n\n\n Interfaces\n \n Collision\n\n\n\n \n Info\n \n \n Source\n \n\n\n\n \n \n File\n \n \n projects/ccf-body-ui/src/lib/util/spatial-scene-collider.ts\n \n\n\n\n\n \n Index\n \n \n \n \n Properties\n \n \n \n \n \n \n \n @id\n \n \n \n \n hits\n \n \n \n \n name\n \n \n \n \n \n \n \n \n\n\n\n \n Properties\n \n \n \n \n \n @id\n \n \n \n \n \n \n \n \n @id: string\n\n \n \n\n\n \n \n Type : string\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n hits\n \n \n \n \n \n \n \n \n hits: literal type[]\n\n \n \n\n\n \n \n Type : literal type[]\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n name\n \n \n \n \n \n \n \n \n name: string\n\n \n \n\n\n \n \n Type : string\n\n \n \n\n\n\n\n\n \n \n \n \n\n\n \n import { load } from '@loaders.gl/core';\nimport { DracoLoader } from '@loaders.gl/draco';\nimport { GLTFLoader } from '@loaders.gl/gltf';\nimport { Matrix4 } from '@math.gl/core';\nimport { AABB, Vec3 } from 'cannon-es';\n\nimport { SpatialSceneNode } from '../shared/spatial-scene-node';\nimport { traverseScene } from './scene-traversal';\n\n\ninterface Collision {\n '@id': string;\n name: string;\n hits: { '@id': string; name: string }[];\n}\n\n/* eslint-disable */\nexport async function doCollisions(scene: SpatialSceneNode[]): Promise {\n console.log('Starting Collisioning');\n const sourceBoxes = scene\n .filter(d => !d.scenegraph && d.geometry !== 'wireframe')\n .map(model => {\n const mat = new Matrix4(model.transformMatrix);\n const lowerBound = mat.transformAsPoint([-1, -1, -1], []);\n const upperBound = mat.transformAsPoint([1, 1, 1], []);\n return {\n '@id': model['@id'],\n name: model.tooltip,\n entityId: model.entityId,\n bbox: new AABB({\n lowerBound: new Vec3(...lowerBound.map((n, i) => Math.min(n, upperBound[i]))),\n upperBound: new Vec3(...upperBound.map((n, i) => Math.max(n, lowerBound[i])))\n })\n };\n });\n\n const targetBoxes: {'@id': string, name: string, entityId?: string; bbox: AABB, gltf: unknown}[] = [];\n for (const model of scene.filter(d => !!d.scenegraph)) {\n const gltf = await load(model.scenegraph as string, GLTFLoader, {DracoLoader, decompress: true, postProcess: true});\n for (const gltfScene of gltf.scenes) {\n traverseScene(gltfScene, new Matrix4(model.transformMatrix), (node, modelMatrix) => {\n if (node.mesh && node.mesh.primitives && node.mesh.primitives.length > 0) {\n for (const primitive of node.mesh.primitives) {\n if (primitive.attributes.POSITION && primitive.attributes.POSITION.min) {\n const lowerBound = modelMatrix.transformAsPoint(primitive.attributes.POSITION.min, []);\n const upperBound = modelMatrix.transformAsPoint(primitive.attributes.POSITION.max, []);\n targetBoxes.push({\n '@id': model['@id'],\n name: node.name,\n entityId: model.entityId,\n bbox: new AABB({\n lowerBound: new Vec3(...lowerBound.map((n, i) => Math.min(n, upperBound[i]))),\n upperBound: new Vec3(...upperBound.map((n, i) => Math.max(n, lowerBound[i])))\n }),\n gltf\n });\n }\n }\n }\n return true;\n });\n }\n }\n\n const report: Collision[] = [];\n const sad: unknown[] = [];\n for (const src of sourceBoxes) {\n const hits: {'@id': string, name: string}[] = [];\n for (const target of targetBoxes) {\n if (src.bbox.overlaps(target.bbox)) {\n hits.push({'@id': target['@id'], name: target.name});\n }\n }\n if (hits.length > 0) {\n report.push({\n '@id': src.entityId as string,\n name: src.name as string,\n hits\n });\n } else {\n sad.push(src);\n }\n }\n\n console.log({ sourceBoxes, targetBoxes, report, sad, maxHits: Math.max(...report.map(r => r.hits.length)) });\n\n const csvReport: unknown[] = [];\n for (const hit of report) {\n csvReport.push({\n 'Tissue ID': hit['@id'],\n 'Tissue Name': hit.name,\n 'Hit ID': '',\n 'Hit Name': ''\n });\n for (const h of hit.hits) {\n csvReport.push({\n 'Tissue ID': hit['@id'],\n 'Tissue Name': hit.name,\n 'Hit ID': h['@id'],\n 'Hit Name': h.name\n });\n }\n }\n console.log(csvReport);\n\n return report;\n}\n/* eslint-enable */\n\n \n\n\n\n \n\n\n\n\n \n \n result-matching \"\"\n \n \n \n No results matching \"\"\n \n\n"},"interfaces/PickInfo.html":{"url":"interfaces/PickInfo.html","title":"interface - PickInfo","body":"\n \n\n\n\n\n\n\n\n\n\n\n\n\n\n Interfaces\n \n PickInfo\n\n\n\n \n Info\n \n \n Source\n \n\n\n\n \n \n File\n \n \n projects/ccf-body-ui/src/lib/body-ui.ts\n \n\n\n\n\n \n Index\n \n \n \n \n Properties\n \n \n \n \n \n \n Optional\n \n coordinate\n \n \n \n \n index\n \n \n \n \n layer\n \n \n \n \n object\n \n \n \n Optional\n \n picked\n \n \n \n \n x\n \n \n \n \n y\n \n \n \n \n \n \n \n \n\n\n\n \n Properties\n \n \n \n \n \n coordinate\n \n \n \n \n \n \n \n \n coordinate: \n\n \n \n\n\n\n \n \n Optional\n \n \n\n\n\n\n \n \n \n \n \n \n \n index\n \n \n \n \n \n \n \n \n index: number\n\n \n \n\n\n \n \n Type : number\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n layer\n \n \n \n \n \n \n \n \n layer: \n\n \n \n\n\n\n\n\n\n\n \n \n \n \n \n \n \n object\n \n \n \n \n \n \n \n \n object: D\n\n \n \n\n\n \n \n Type : D\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n picked\n \n \n \n \n \n \n \n \n picked: boolean\n\n \n \n\n\n \n \n Type : boolean\n\n \n \n\n \n \n Optional\n \n \n\n\n\n\n \n \n \n \n \n \n \n x\n \n \n \n \n \n \n \n \n x: number\n\n \n \n\n\n \n \n Type : number\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n y\n \n \n \n \n \n \n \n \n y: number\n\n \n \n\n\n \n \n Type : number\n\n \n \n\n\n\n\n\n \n \n \n \n\n\n \n import { AmbientLight, Deck, LightingEffect, OrbitView, OrthographicView } from '@deck.gl/core';\nimport { ViewStateProps } from '@deck.gl/core/lib/deck';\nimport { Matrix4 } from '@math.gl/core';\nimport bind from 'bind-decorator';\nimport { BehaviorSubject, Subject } from 'rxjs';\nimport { share } from 'rxjs/operators';\n\nimport { BodyUILayer } from './body-ui-layer';\nimport { SpatialSceneNode } from './shared/spatial-scene-node';\nimport { processSceneNodes } from './util/process-scene-nodes';\n\n\ninterface BodyUIViewStateProps extends ViewStateProps {\n orbitAxis?: string;\n target?: Matrix4 | number[];\n zoom: number;\n rotationOrbit: number;\n rotationX: number;\n camera: string;\n}\n\nexport interface BodyUIProps {\n id: string;\n canvas: string | HTMLCanvasElement;\n parent: HTMLElement;\n debugSceneNodeProcessing?: boolean;\n target: Matrix4 | number[];\n interactive: boolean;\n rotation: number;\n minRotationX: number;\n maxRotationX: number;\n zoom: number;\n legacyLighting?: boolean;\n camera: string;\n}\n\nexport interface PickInfo {\n layer: unknown;\n index: number;\n object: D;\n x: number;\n y: number;\n coordinate?: unknown;\n picked?: boolean;\n}\n\nexport type NodeDragEvent = { node: SpatialSceneNode; info: PickInfo; e: MouseEvent };\n\nexport type NodeClickEvent = { node: SpatialSceneNode; ctrlClick: boolean };\n\n/**\n * A convenience wrapper class for the CCF Body UI\n */\nexport class BodyUI {\n deck: Deck;\n private readonly bodyUILayer = new BodyUILayer({});\n\n private readonly nodeClickSubject = new Subject();\n private readonly nodeHoverStartSubject = new Subject();\n private readonly nodeHoverStopSubject = new Subject();\n private readonly sceneRotationSubject = new BehaviorSubject([0, 0]);\n private readonly nodeDragStartSubject = new Subject();\n private readonly nodeDragSubject = new Subject();\n private readonly nodeDragEndSubject = new Subject();\n\n readonly nodeClick$ = this.nodeClickSubject.pipe(share());\n readonly nodeHoverStart$ = this.nodeHoverStartSubject.pipe(share());\n readonly nodeHoverStop$ = this.nodeHoverStopSubject.pipe(share());\n readonly sceneRotation$ = this.sceneRotationSubject.pipe(share());\n readonly nodeDragStart$ = this.nodeDragStartSubject.pipe(share());\n readonly nodeDrag$ = this.nodeDragSubject.pipe(share());\n readonly nodeDragEnd$ = this.nodeDragEndSubject.pipe(share());\n\n private cursor?: string;\n private lastHovered?: SpatialSceneNode;\n\n constructor(private deckProps: Partial) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const props: any = {\n ...deckProps,\n views: [ deckProps.camera === 'orthographic' ? new OrthographicView({\n flipY: false,\n near: -1000\n }) : new OrbitView({ orbitAxis: 'Y' }) ],\n controller: deckProps.interactive !== undefined ? deckProps.interactive : true,\n layers: [ this.bodyUILayer ],\n onHover: this._onHover,\n onClick: this._onClick,\n onViewStateChange: this._onViewStateChange,\n onDragStart: this._onDragStart,\n onDrag: this._onDrag,\n onDragEnd: this._onDragEnd,\n getCursor: (e: { isDragging: boolean }) => this.cursor ?? (e.isDragging ? 'grabbing' : 'grab')\n };\n if (deckProps.legacyLighting) {\n // eslint-disable-next-line\n props.effects = [\n new LightingEffect({\n ambientLight: new AmbientLight({\n color: [255, 255, 255],\n intensity: 10.0\n })\n })\n ];\n }\n // eslint-disable-next-line\n this.deck = new Deck(props);\n this.deck.setProps({\n viewState: {\n orbitAxis: 'Y',\n minRotationX: deckProps.minRotationX ?? -15,\n maxRotationX: deckProps.maxRotationX ?? 15,\n target: deckProps.target ?? [0.5, 0.5, 0],\n rotationX: 0,\n rotationOrbit: deckProps.rotation ?? 0,\n zoom: deckProps.zoom ?? 9.5,\n camera: deckProps.camera\n } as BodyUIViewStateProps\n });\n if (deckProps.rotation) {\n this.sceneRotationSubject.next([deckProps.rotation, 0]);\n }\n }\n\n async initialize(): Promise {\n while (!this.bodyUILayer.state) {\n // eslint-disable-next-line no-await-in-loop\n await new Promise(r => {\n setTimeout(r, 200);\n });\n }\n }\n\n finalize(): void {\n this.deck.finalize();\n }\n\n setScene(data: SpatialSceneNode[]): void {\n if (data?.length > 0) {\n let zoomOpacity = (this.bodyUILayer.state as { zoomOpacity: number }).zoomOpacity;\n let didZoom = false;\n for (const node of data) {\n if (node.zoomToOnLoad) {\n this.zoomTo(node);\n didZoom = true;\n }\n }\n zoomOpacity = didZoom ? 0.05 : zoomOpacity;\n if (!this.deckProps.debugSceneNodeProcessing) {\n this.bodyUILayer.setState({ data, zoomOpacity });\n } else {\n this.debugSceneNodeProcessing(data, zoomOpacity);\n }\n }\n }\n\n debugSceneNodeProcessing(data: SpatialSceneNode[], zoomOpacity: number): void {\n // const gltfUrl = 'https://hubmapconsortium.github.io/ccf-3d-reference-object-library/VH_Male/United/VHM_United_Color.glb';\n const gltfUrl = 'https://hubmapconsortium.github.io/ccf-3d-reference-object-library/VH_Female/United/VHF_United_Color.glb';\n // const gltfUrl = 'https://hubmapconsortium.github.io/hubmap-ontology/objects/VHF_United_v01_060420.glb';\n const gltfTransform = new Matrix4([0.076,0,0,0,0,0.076,1.6875389974302382e-17,0,0,-1.6875389974302382e-17,0.076,0,0.49,0.034,0.11,1]);\n processSceneNodes(gltfUrl, gltfTransform, 'VHF_Kidney_L_Low1').then((results) => {\n console.log('results', results);\n console.log('data', data);\n // data = Object.values(results);\n data = data.concat(Object.values(results));\n data.push({\n '@id': 'TEST',\n '@type': 'TEST',\n scenegraph: gltfUrl,\n scenegraphNode: 'VHF_Kidney_R_Low',\n transformMatrix: gltfTransform,\n color: [255, 255, 255, 200],\n // eslint-disable-next-line @typescript-eslint/naming-convention\n _lighting: 'pbr',\n zoomBasedOpacity: false\n });\n this.bodyUILayer.setState({ data, zoomOpacity });\n });\n }\n\n zoomTo(node: SpatialSceneNode): void {\n const matrix = new Matrix4(node.transformMatrix);\n this.deck.setProps({\n viewState: {\n ...this.deck.props.viewState,\n target: matrix.getTranslation(),\n rotationX: 0,\n rotationOrbit: 0,\n zoom: 11.5,\n } as BodyUIViewStateProps\n });\n }\n\n setRotation(value: number): void {\n this.deck.setProps({\n viewState: {\n ...this.deck.props.viewState,\n rotationOrbit: value\n } as BodyUIViewStateProps\n });\n }\n\n setRotationX(value: number): void {\n this.deck.setProps({\n viewState: {\n ...this.deck.props.viewState,\n rotationX: value\n } as BodyUIViewStateProps\n });\n }\n\n setZoom(value: number): void {\n this.deck.setProps({\n viewState: {\n ...this.deck.props.viewState,\n zoom: value\n } as BodyUIViewStateProps\n });\n }\n\n setTarget(value: number[]): void {\n this.deck.setProps({\n viewState: {\n ...this.deck.props.viewState,\n target: value\n } as BodyUIViewStateProps\n });\n }\n\n setInteractive(value: boolean): void {\n this.deck.setProps({\n controller: value\n });\n }\n\n @bind\n private _onHover(e: { picked: boolean; object: SpatialSceneNode }): void {\n const { lastHovered } = this;\n this.cursor = e.picked ? 'pointer' : undefined;\n if (e.picked && e.object && e.object['@id']) {\n if (lastHovered !== e.object) {\n if (lastHovered) {\n this.nodeHoverStopSubject.next(lastHovered);\n }\n this.lastHovered = e.object;\n this.nodeHoverStartSubject.next(e.object);\n }\n } else if (lastHovered) {\n this.nodeHoverStopSubject.next(lastHovered);\n this.lastHovered = undefined;\n }\n }\n\n @bind\n private _onClick(info: PickInfo, e: { srcEvent: { ctrlKey: boolean } }): void {\n if (info.picked && info.object && info.object['@id']) {\n this.nodeClickSubject.next({ node: info.object, ctrlClick: e?.srcEvent?.ctrlKey ?? undefined });\n }\n }\n\n @bind\n private _onViewStateChange(event: { interactionState: { isZooming: boolean }; viewState: BodyUIViewStateProps }): void {\n if (event.interactionState?.isZooming) {\n const currentState = this.bodyUILayer.state as { zoomOpacity: number; data: unknown };\n const zoomOpacity = Math.min(Math.max(1 - (event.viewState.zoom - 8.9) / 2, 0.05), 1.0);\n if (currentState.zoomOpacity !== zoomOpacity) {\n this.bodyUILayer.setState({ data: currentState.data, zoomOpacity });\n }\n }\n this.deck.setProps({ viewState: { ...event.viewState } });\n this.sceneRotationSubject.next([event.viewState.rotationOrbit, event.viewState.rotationX]);\n }\n\n @bind\n private _onDragStart(info: PickInfo, e: MouseEvent): void {\n this._dragEvent(info, e, this.nodeDragStartSubject);\n }\n\n @bind\n private _onDrag(info: PickInfo, e: MouseEvent): void {\n this._dragEvent(info, e, this.nodeDragSubject);\n }\n\n @bind\n private _onDragEnd(info: PickInfo, e: MouseEvent): void {\n this._dragEvent(info, e, this.nodeDragEndSubject);\n }\n\n private _dragEvent(info: PickInfo, e: MouseEvent, subject: Subject): void {\n if (info?.object?.['@id']) {\n subject.next({ node: info.object, info, e });\n }\n }\n}\n\n \n\n\n\n \n\n\n\n\n \n \n result-matching \"\"\n \n \n \n No results matching \"\"\n \n\n"},"interfaces/ProcessedNode.html":{"url":"interfaces/ProcessedNode.html","title":"interface - ProcessedNode","body":"\n \n\n\n\n\n\n\n\n\n\n\n\n\n\n Interfaces\n \n ProcessedNode\n\n\n\n \n Info\n \n \n Source\n \n\n\n\n \n \n File\n \n \n projects/ccf-body-ui/src/lib/util/process-scene-nodes.ts\n \n\n\n\n \n Extends\n \n \n SpatialSceneNode\n \n\n \n Index\n \n \n \n \n Properties\n \n \n \n \n \n \n \n bbox\n \n \n \n \n center\n \n \n \n \n jsonld\n \n \n \n \n node\n \n \n \n \n size\n \n \n \n \n \n \n \n \n\n\n\n \n Properties\n \n \n \n \n \n bbox\n \n \n \n \n \n \n \n \n bbox: AABB\n\n \n \n\n\n \n \n Type : AABB\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n center\n \n \n \n \n \n \n \n \n center: Vec3\n\n \n \n\n\n \n \n Type : Vec3\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n jsonld\n \n \n \n \n \n \n \n \n jsonld: \n\n \n \n\n\n\n\n\n\n\n \n \n \n \n \n \n \n node\n \n \n \n \n \n \n \n \n node: \n\n \n \n\n\n\n\n\n\n\n \n \n \n \n \n \n \n size\n \n \n \n \n \n \n \n \n size: Vec3\n\n \n \n\n\n \n \n Type : Vec3\n\n \n \n\n\n\n\n\n \n \n \n \n\n\n \n import { Matrix4 } from '@math.gl/core';\nimport { AABB, Vec3 } from 'cannon-es';\n\nimport { loadGLTF, registerGLTFLoaders } from './load-gltf';\nimport { traverseScene } from './scene-traversal';\nimport { SpatialSceneNode } from '../shared/spatial-scene-node';\n\n\nexport interface ProcessedNode extends SpatialSceneNode {\n bbox: AABB;\n jsonld: unknown;\n node: unknown;\n size: Vec3;\n center: Vec3;\n}\n\n/* eslint-disable */\nfunction childNames(scene, names: string[] = []): string[] {\n for (const child of (scene.nodes || scene.children || [])) {\n names.push(child.name);\n childNames(child, names);\n }\n return names;\n}\n\nexport async function processSceneNodes(gltfUrl: string, worldMatrix?: Matrix4, scenegraphNode?: string, \n gltfCache?: { [url: string]: Promise }): Promise {\n registerGLTFLoaders();\n const gltf = await loadGLTF({scenegraph: gltfUrl, scenegraphNode} as SpatialSceneNode, gltfCache);\n const nodes: {[node: string]: ProcessedNode} = {};\n const gltfNodes: ProcessedNode[] = [];\n for (const scene of gltf.scenes) {\n worldMatrix = new Matrix4(worldMatrix || Matrix4.IDENTITY);\n traverseScene(scene, worldMatrix, (node, modelMatrix: Matrix4) => {\n const processedNode: ProcessedNode = {\n '@id': (node.name || node.id) as string,\n '@type': 'ProcessedNode',\n transformMatrix: new Matrix4(modelMatrix),\n geometry: 'wireframe',\n node\n } as ProcessedNode;\n gltfNodes.push({\n '@id': `GLTF:${processedNode['@id']}`,\n '@type': 'GLTFNode',\n scenegraph: gltfUrl,\n scenegraphNode: processedNode['@id'],\n transformMatrix: new Matrix4(worldMatrix || Matrix4.IDENTITY),\n tooltip: (node.name || node.id) as string,\n color: [255, 255, 255, 255],\n _lighting: 'pbr',\n zoomBasedOpacity: true,\n node\n } as ProcessedNode);\n if (node.mesh && node.mesh.primitives && node.mesh.primitives.length > 0) {\n for (const primitive of node.mesh.primitives) {\n if (primitive.attributes.POSITION && primitive.attributes.POSITION.min) {\n const lowerBound = modelMatrix.transformAsPoint(primitive.attributes.POSITION.min, []);\n const upperBound = modelMatrix.transformAsPoint(primitive.attributes.POSITION.max, []);\n processedNode.bbox = new AABB({\n lowerBound: new Vec3(...lowerBound.map((n, i) => Math.min(n, upperBound[i]))),\n upperBound: new Vec3(...upperBound.map((n, i) => Math.max(n, lowerBound[i])))\n });\n }\n }\n }\n nodes[processedNode['@id']] = processedNode;\n return true;\n });\n }\n\n for (const node of Object.values(nodes).filter(n => !n.bbox)) {\n for (const child of childNames(node.node).map(n => nodes[n]).filter(n => n.bbox)) {\n if (!node.bbox) {\n node.bbox = child.bbox.clone();\n } else {\n node.bbox.extend(child.bbox);\n }\n }\n if (!node.bbox) {\n delete nodes[node['@id']];\n }\n }\n for (const node of Object.values(nodes)) {\n const lb = node.bbox.lowerBound;\n const ub = node.bbox.upperBound;\n const size = node.size = ub.clone().vsub(lb);\n const halfSize = size.clone().vmul(new Vec3(0.5, 0.5, 0.5));\n const center = node.center = lb.clone().vadd(halfSize);\n\n node.transformMatrix = new Matrix4(Matrix4.IDENTITY)\n .translate(center.toArray())\n .scale(halfSize.toArray());\n }\n for (const node of gltfNodes) {\n nodes[node['@id']] = node;\n }\n return nodes;\n}\n/* eslint-enable */\n\n \n\n\n\n \n\n\n\n\n \n \n result-matching \"\"\n \n \n \n No results matching \"\"\n \n\n"},"interfaces/SpatialEntityJsonLd.html":{"url":"interfaces/SpatialEntityJsonLd.html","title":"interface - SpatialEntityJsonLd","body":"\n \n\n\n\n\n\n\n\n\n\n\n\n\n\n Interfaces\n \n SpatialEntityJsonLd\n\n\n\n \n Info\n \n \n Source\n \n\n\n\n \n \n File\n \n \n projects/ccf-body-ui/src/lib/shared/ccf-spatial-jsonld.ts\n \n\n\n\n \n Extends\n \n \n JsonLdObj\n \n\n \n Index\n \n \n \n \n Properties\n \n \n \n \n \n \n \n @context\n \n \n \n \n @id\n \n \n \n \n @type\n \n \n \n \n ccf_annotations\n \n \n \n \n comment\n \n \n \n \n creation_date\n \n \n \n \n creator\n \n \n \n \n creator_first_name\n \n \n \n \n creator_last_name\n \n \n \n \n dimension_units\n \n \n \n \n extraction_set\n \n \n \n \n label\n \n \n \n \n object\n \n \n \n \n placement\n \n \n \n \n reference_organ\n \n \n \n \n representation_of\n \n \n \n \n rui_rank\n \n \n \n \n sex\n \n \n \n \n side\n \n \n \n \n slice_count\n \n \n \n \n slice_thickness\n \n \n \n \n updated_date\n \n \n \n \n x_dimension\n \n \n \n \n y_dimension\n \n \n \n \n z_dimension\n \n \n \n \n \n \n \n \n\n\n\n \n Properties\n \n \n \n \n \n @context\n \n \n \n \n \n \n \n \n @context: string\n\n \n \n\n\n \n \n Type : string\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n @id\n \n \n \n \n \n \n \n \n @id: string\n\n \n \n\n\n \n \n Type : string\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n @type\n \n \n \n \n \n \n \n \n @type: string | string[]\n\n \n \n\n\n \n \n Type : string | string[]\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n ccf_annotations\n \n \n \n \n \n \n \n \n ccf_annotations: string[]\n\n \n \n\n\n \n \n Type : string[]\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n comment\n \n \n \n \n \n \n \n \n comment: string\n\n \n \n\n\n \n \n Type : string\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n creation_date\n \n \n \n \n \n \n \n \n creation_date: string\n\n \n \n\n\n \n \n Type : string\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n creator\n \n \n \n \n \n \n \n \n creator: string\n\n \n \n\n\n \n \n Type : string\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n creator_first_name\n \n \n \n \n \n \n \n \n creator_first_name: string\n\n \n \n\n\n \n \n Type : string\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n creator_last_name\n \n \n \n \n \n \n \n \n creator_last_name: string\n\n \n \n\n\n \n \n Type : string\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n dimension_units\n \n \n \n \n \n \n \n \n dimension_units: string\n\n \n \n\n\n \n \n Type : string\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n extraction_set\n \n \n \n \n \n \n \n \n extraction_set: string\n\n \n \n\n\n \n \n Type : string\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n label\n \n \n \n \n \n \n \n \n label: string\n\n \n \n\n\n \n \n Type : string\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n object\n \n \n \n \n \n \n \n \n object: SpatialObjectReferenceJsonLd\n\n \n \n\n\n \n \n Type : SpatialObjectReferenceJsonLd\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n placement\n \n \n \n \n \n \n \n \n placement: SpatialPlacementJsonLd | SpatialPlacementJsonLd[]\n\n \n \n\n\n \n \n Type : SpatialPlacementJsonLd | SpatialPlacementJsonLd[]\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n reference_organ\n \n \n \n \n \n \n \n \n reference_organ: string\n\n \n \n\n\n \n \n Type : string\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n representation_of\n \n \n \n \n \n \n \n \n representation_of: string\n\n \n \n\n\n \n \n Type : string\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n rui_rank\n \n \n \n \n \n \n \n \n rui_rank: number\n\n \n \n\n\n \n \n Type : number\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n sex\n \n \n \n \n \n \n \n \n sex: \"Male\" | \"Female\" | undefined\n\n \n \n\n\n \n \n Type : \"Male\" | \"Female\" | undefined\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n side\n \n \n \n \n \n \n \n \n side: \"Left\" | \"Right\" | undefined\n\n \n \n\n\n \n \n Type : \"Left\" | \"Right\" | undefined\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n slice_count\n \n \n \n \n \n \n \n \n slice_count: number\n\n \n \n\n\n \n \n Type : number\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n slice_thickness\n \n \n \n \n \n \n \n \n slice_thickness: number\n\n \n \n\n\n \n \n Type : number\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n updated_date\n \n \n \n \n \n \n \n \n updated_date: string\n\n \n \n\n\n \n \n Type : string\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n x_dimension\n \n \n \n \n \n \n \n \n x_dimension: number\n\n \n \n\n\n \n \n Type : number\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n y_dimension\n \n \n \n \n \n \n \n \n y_dimension: number\n\n \n \n\n\n \n \n Type : number\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n z_dimension\n \n \n \n \n \n \n \n \n z_dimension: number\n\n \n \n\n\n \n \n Type : number\n\n \n \n\n\n\n\n\n \n \n \n \n\n\n \n import { JsonLdObj } from 'jsonld/jsonld-spec';\n\n\nexport interface SpatialPlacementJsonLd extends JsonLdObj {\n '@context'?: string;\n '@id': string;\n '@type': string;\n source?: string;\n target: string;\n placement_date: string;\n x_scaling: number;\n y_scaling: number;\n z_scaling: number;\n scaling_units: string;\n x_rotation: number;\n y_rotation: number;\n z_rotation: number;\n rotation_units: string;\n x_translation: number;\n y_translation: number;\n z_translation: number;\n translation_units: string;\n}\n\nexport interface SpatialObjectReferenceJsonLd extends JsonLdObj {\n '@id': string;\n '@type': string;\n file: string;\n file_format: string;\n placement: SpatialPlacementJsonLd;\n}\n\nexport interface SpatialEntityJsonLd extends JsonLdObj {\n '@context': string;\n '@id': string;\n '@type': string | string[];\n label: string;\n comment: string;\n creator: string;\n creator_first_name: string;\n creator_last_name: string;\n creation_date: string;\n updated_date: string;\n ccf_annotations: string[];\n representation_of: string;\n reference_organ: string;\n extraction_set: string;\n sex: 'Male' | 'Female' | undefined;\n side: 'Left' | 'Right' | undefined;\n rui_rank: number;\n slice_thickness: number;\n slice_count: number;\n x_dimension: number;\n y_dimension: number;\n z_dimension: number;\n dimension_units: string;\n object: SpatialObjectReferenceJsonLd;\n placement: SpatialPlacementJsonLd | SpatialPlacementJsonLd[];\n}\n\n \n\n\n\n \n\n\n\n\n \n \n result-matching \"\"\n \n \n \n No results matching \"\"\n \n\n"},"interfaces/SpatialObjectReferenceJsonLd.html":{"url":"interfaces/SpatialObjectReferenceJsonLd.html","title":"interface - SpatialObjectReferenceJsonLd","body":"\n \n\n\n\n\n\n\n\n\n\n\n\n\n\n Interfaces\n \n SpatialObjectReferenceJsonLd\n\n\n\n \n Info\n \n \n Source\n \n\n\n\n \n \n File\n \n \n projects/ccf-body-ui/src/lib/shared/ccf-spatial-jsonld.ts\n \n\n\n\n \n Extends\n \n \n JsonLdObj\n \n\n \n Index\n \n \n \n \n Properties\n \n \n \n \n \n \n \n @id\n \n \n \n \n @type\n \n \n \n \n file\n \n \n \n \n file_format\n \n \n \n \n placement\n \n \n \n \n \n \n \n \n\n\n\n \n Properties\n \n \n \n \n \n @id\n \n \n \n \n \n \n \n \n @id: string\n\n \n \n\n\n \n \n Type : string\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n @type\n \n \n \n \n \n \n \n \n @type: string\n\n \n \n\n\n \n \n Type : string\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n file\n \n \n \n \n \n \n \n \n file: string\n\n \n \n\n\n \n \n Type : string\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n file_format\n \n \n \n \n \n \n \n \n file_format: string\n\n \n \n\n\n \n \n Type : string\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n placement\n \n \n \n \n \n \n \n \n placement: SpatialPlacementJsonLd\n\n \n \n\n\n \n \n Type : SpatialPlacementJsonLd\n\n \n \n\n\n\n\n\n \n \n \n \n\n\n \n import { JsonLdObj } from 'jsonld/jsonld-spec';\n\n\nexport interface SpatialPlacementJsonLd extends JsonLdObj {\n '@context'?: string;\n '@id': string;\n '@type': string;\n source?: string;\n target: string;\n placement_date: string;\n x_scaling: number;\n y_scaling: number;\n z_scaling: number;\n scaling_units: string;\n x_rotation: number;\n y_rotation: number;\n z_rotation: number;\n rotation_units: string;\n x_translation: number;\n y_translation: number;\n z_translation: number;\n translation_units: string;\n}\n\nexport interface SpatialObjectReferenceJsonLd extends JsonLdObj {\n '@id': string;\n '@type': string;\n file: string;\n file_format: string;\n placement: SpatialPlacementJsonLd;\n}\n\nexport interface SpatialEntityJsonLd extends JsonLdObj {\n '@context': string;\n '@id': string;\n '@type': string | string[];\n label: string;\n comment: string;\n creator: string;\n creator_first_name: string;\n creator_last_name: string;\n creation_date: string;\n updated_date: string;\n ccf_annotations: string[];\n representation_of: string;\n reference_organ: string;\n extraction_set: string;\n sex: 'Male' | 'Female' | undefined;\n side: 'Left' | 'Right' | undefined;\n rui_rank: number;\n slice_thickness: number;\n slice_count: number;\n x_dimension: number;\n y_dimension: number;\n z_dimension: number;\n dimension_units: string;\n object: SpatialObjectReferenceJsonLd;\n placement: SpatialPlacementJsonLd | SpatialPlacementJsonLd[];\n}\n\n \n\n\n\n \n\n\n\n\n \n \n result-matching \"\"\n \n \n \n No results matching \"\"\n \n\n"},"interfaces/SpatialPlacementJsonLd.html":{"url":"interfaces/SpatialPlacementJsonLd.html","title":"interface - SpatialPlacementJsonLd","body":"\n \n\n\n\n\n\n\n\n\n\n\n\n\n\n Interfaces\n \n SpatialPlacementJsonLd\n\n\n\n \n Info\n \n \n Source\n \n\n\n\n \n \n File\n \n \n projects/ccf-body-ui/src/lib/shared/ccf-spatial-jsonld.ts\n \n\n\n\n \n Extends\n \n \n JsonLdObj\n \n\n \n Index\n \n \n \n \n Properties\n \n \n \n \n \n \n Optional\n \n @context\n \n \n \n \n @id\n \n \n \n \n @type\n \n \n \n \n placement_date\n \n \n \n \n rotation_units\n \n \n \n \n scaling_units\n \n \n \n Optional\n \n source\n \n \n \n \n target\n \n \n \n \n translation_units\n \n \n \n \n x_rotation\n \n \n \n \n x_scaling\n \n \n \n \n x_translation\n \n \n \n \n y_rotation\n \n \n \n \n y_scaling\n \n \n \n \n y_translation\n \n \n \n \n z_rotation\n \n \n \n \n z_scaling\n \n \n \n \n z_translation\n \n \n \n \n \n \n \n \n\n\n\n \n Properties\n \n \n \n \n \n @context\n \n \n \n \n \n \n \n \n @context: string\n\n \n \n\n\n \n \n Type : string\n\n \n \n\n \n \n Optional\n \n \n\n\n\n\n \n \n \n \n \n \n \n @id\n \n \n \n \n \n \n \n \n @id: string\n\n \n \n\n\n \n \n Type : string\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n @type\n \n \n \n \n \n \n \n \n @type: string\n\n \n \n\n\n \n \n Type : string\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n placement_date\n \n \n \n \n \n \n \n \n placement_date: string\n\n \n \n\n\n \n \n Type : string\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n rotation_units\n \n \n \n \n \n \n \n \n rotation_units: string\n\n \n \n\n\n \n \n Type : string\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n scaling_units\n \n \n \n \n \n \n \n \n scaling_units: string\n\n \n \n\n\n \n \n Type : string\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n source\n \n \n \n \n \n \n \n \n source: string\n\n \n \n\n\n \n \n Type : string\n\n \n \n\n \n \n Optional\n \n \n\n\n\n\n \n \n \n \n \n \n \n target\n \n \n \n \n \n \n \n \n target: string\n\n \n \n\n\n \n \n Type : string\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n translation_units\n \n \n \n \n \n \n \n \n translation_units: string\n\n \n \n\n\n \n \n Type : string\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n x_rotation\n \n \n \n \n \n \n \n \n x_rotation: number\n\n \n \n\n\n \n \n Type : number\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n x_scaling\n \n \n \n \n \n \n \n \n x_scaling: number\n\n \n \n\n\n \n \n Type : number\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n x_translation\n \n \n \n \n \n \n \n \n x_translation: number\n\n \n \n\n\n \n \n Type : number\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n y_rotation\n \n \n \n \n \n \n \n \n y_rotation: number\n\n \n \n\n\n \n \n Type : number\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n y_scaling\n \n \n \n \n \n \n \n \n y_scaling: number\n\n \n \n\n\n \n \n Type : number\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n y_translation\n \n \n \n \n \n \n \n \n y_translation: number\n\n \n \n\n\n \n \n Type : number\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n z_rotation\n \n \n \n \n \n \n \n \n z_rotation: number\n\n \n \n\n\n \n \n Type : number\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n z_scaling\n \n \n \n \n \n \n \n \n z_scaling: number\n\n \n \n\n\n \n \n Type : number\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n z_translation\n \n \n \n \n \n \n \n \n z_translation: number\n\n \n \n\n\n \n \n Type : number\n\n \n \n\n\n\n\n\n \n \n \n \n\n\n \n import { JsonLdObj } from 'jsonld/jsonld-spec';\n\n\nexport interface SpatialPlacementJsonLd extends JsonLdObj {\n '@context'?: string;\n '@id': string;\n '@type': string;\n source?: string;\n target: string;\n placement_date: string;\n x_scaling: number;\n y_scaling: number;\n z_scaling: number;\n scaling_units: string;\n x_rotation: number;\n y_rotation: number;\n z_rotation: number;\n rotation_units: string;\n x_translation: number;\n y_translation: number;\n z_translation: number;\n translation_units: string;\n}\n\nexport interface SpatialObjectReferenceJsonLd extends JsonLdObj {\n '@id': string;\n '@type': string;\n file: string;\n file_format: string;\n placement: SpatialPlacementJsonLd;\n}\n\nexport interface SpatialEntityJsonLd extends JsonLdObj {\n '@context': string;\n '@id': string;\n '@type': string | string[];\n label: string;\n comment: string;\n creator: string;\n creator_first_name: string;\n creator_last_name: string;\n creation_date: string;\n updated_date: string;\n ccf_annotations: string[];\n representation_of: string;\n reference_organ: string;\n extraction_set: string;\n sex: 'Male' | 'Female' | undefined;\n side: 'Left' | 'Right' | undefined;\n rui_rank: number;\n slice_thickness: number;\n slice_count: number;\n x_dimension: number;\n y_dimension: number;\n z_dimension: number;\n dimension_units: string;\n object: SpatialObjectReferenceJsonLd;\n placement: SpatialPlacementJsonLd | SpatialPlacementJsonLd[];\n}\n\n \n\n\n\n \n\n\n\n\n \n \n result-matching \"\"\n \n \n \n No results matching \"\"\n \n\n"},"interfaces/SpatialSceneNode.html":{"url":"interfaces/SpatialSceneNode.html","title":"interface - SpatialSceneNode","body":"\n \n\n\n\n\n\n\n\n\n\n\n\n\n\n Interfaces\n \n SpatialSceneNode\n\n\n\n \n Info\n \n \n Source\n \n\n\n\n \n \n File\n \n \n projects/ccf-body-ui/src/lib/shared/spatial-scene-node.ts\n \n\n\n\n\n \n Index\n \n \n \n \n Properties\n \n \n \n \n \n \n Optional\n \n _lighting\n \n \n \n \n @id\n \n \n \n \n @type\n \n \n \n Optional\n \n color\n \n \n \n Optional\n \n entityId\n \n \n \n Optional\n \n geometry\n \n \n \n Optional\n \n name\n \n \n \n Optional\n \n opacity\n \n \n \n Optional\n \n priority\n \n \n \n Optional\n \n reference_organ\n \n \n \n Optional\n \n representation_of\n \n \n \n Optional\n \n scenegraph\n \n \n \n Optional\n \n scenegraphNode\n \n \n \n Optional\n \n text\n \n \n \n Optional\n \n tooltip\n \n \n \n \n transformMatrix\n \n \n \n Optional\n \n unpickable\n \n \n \n Optional\n \n zoomBasedOpacity\n \n \n \n Optional\n \n zoomToOnLoad\n \n \n \n \n \n \n \n \n\n\n\n \n Properties\n \n \n \n \n \n _lighting\n \n \n \n \n \n \n \n \n _lighting: string\n\n \n \n\n\n \n \n Type : string\n\n \n \n\n \n \n Optional\n \n \n\n\n\n\n \n \n \n \n \n \n \n @id\n \n \n \n \n \n \n \n \n @id: string\n\n \n \n\n\n \n \n Type : string\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n @type\n \n \n \n \n \n \n \n \n @type: string\n\n \n \n\n\n \n \n Type : string\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n color\n \n \n \n \n \n \n \n \n color: [number, number, number, number]\n\n \n \n\n\n \n \n Type : [number, number, number, number]\n\n \n \n\n \n \n Optional\n \n \n\n\n\n\n \n \n \n \n \n \n \n entityId\n \n \n \n \n \n \n \n \n entityId: string\n\n \n \n\n\n \n \n Type : string\n\n \n \n\n \n \n Optional\n \n \n\n\n\n\n \n \n \n \n \n \n \n geometry\n \n \n \n \n \n \n \n \n geometry: SpatialSceneGeometry\n\n \n \n\n\n \n \n Type : SpatialSceneGeometry\n\n \n \n\n \n \n Optional\n \n \n\n\n\n\n \n \n \n \n \n \n \n name\n \n \n \n \n \n \n \n \n name: string\n\n \n \n\n\n \n \n Type : string\n\n \n \n\n \n \n Optional\n \n \n\n\n\n\n \n \n \n \n \n \n \n opacity\n \n \n \n \n \n \n \n \n opacity: number\n\n \n \n\n\n \n \n Type : number\n\n \n \n\n \n \n Optional\n \n \n\n\n\n\n \n \n \n \n \n \n \n priority\n \n \n \n \n \n \n \n \n priority: number\n\n \n \n\n\n \n \n Type : number\n\n \n \n\n \n \n Optional\n \n \n\n\n\n\n \n \n \n \n \n \n \n reference_organ\n \n \n \n \n \n \n \n \n reference_organ: string\n\n \n \n\n\n \n \n Type : string\n\n \n \n\n \n \n Optional\n \n \n\n\n\n\n \n \n \n \n \n \n \n representation_of\n \n \n \n \n \n \n \n \n representation_of: string\n\n \n \n\n\n \n \n Type : string\n\n \n \n\n \n \n Optional\n \n \n\n\n\n\n \n \n \n \n \n \n \n scenegraph\n \n \n \n \n \n \n \n \n scenegraph: string\n\n \n \n\n\n \n \n Type : string\n\n \n \n\n \n \n Optional\n \n \n\n\n\n\n \n \n \n \n \n \n \n scenegraphNode\n \n \n \n \n \n \n \n \n scenegraphNode: string\n\n \n \n\n\n \n \n Type : string\n\n \n \n\n \n \n Optional\n \n \n\n\n\n\n \n \n \n \n \n \n \n text\n \n \n \n \n \n \n \n \n text: string\n\n \n \n\n\n \n \n Type : string\n\n \n \n\n \n \n Optional\n \n \n\n\n\n\n \n \n \n \n \n \n \n tooltip\n \n \n \n \n \n \n \n \n tooltip: string\n\n \n \n\n\n \n \n Type : string\n\n \n \n\n \n \n Optional\n \n \n\n\n\n\n \n \n \n \n \n \n \n transformMatrix\n \n \n \n \n \n \n \n \n transformMatrix: Matrix4\n\n \n \n\n\n \n \n Type : Matrix4\n\n \n \n\n\n\n\n\n \n \n \n \n \n \n \n unpickable\n \n \n \n \n \n \n \n \n unpickable: boolean\n\n \n \n\n\n \n \n Type : boolean\n\n \n \n\n \n \n Optional\n \n \n\n\n\n\n \n \n \n \n \n \n \n zoomBasedOpacity\n \n \n \n \n \n \n \n \n zoomBasedOpacity: boolean\n\n \n \n\n\n \n \n Type : boolean\n\n \n \n\n \n \n Optional\n \n \n\n\n\n\n \n \n \n \n \n \n \n zoomToOnLoad\n \n \n \n \n \n \n \n \n zoomToOnLoad: boolean\n\n \n \n\n\n \n \n Type : boolean\n\n \n \n\n \n \n Optional\n \n \n\n\n\n\n \n \n \n \n\n\n \n import { Matrix4 } from '@math.gl/core';\n\nexport type SpatialSceneGeometry = 'sphere' | 'cube' | 'wireframe' | 'text' | 'cone' | 'cylinder';\n\nexport interface SpatialSceneNode {\n '@id': string;\n '@type': string;\n entityId?: string;\n representation_of?: string;\n reference_organ?: string;\n unpickable?: boolean;\n geometry?: SpatialSceneGeometry;\n text?: string;\n _lighting?: string;\n scenegraph?: string;\n scenegraphNode?: string;\n zoomBasedOpacity?: boolean;\n zoomToOnLoad?: boolean;\n color?: [number, number, number, number];\n opacity?: number;\n transformMatrix: Matrix4;\n name?: string;\n tooltip?: string;\n priority?: number;\n}\n\n \n\n\n\n \n\n\n\n\n \n \n result-matching \"\"\n \n \n \n No results matching \"\"\n \n\n"},"changelog.html":{"url":"changelog.html","title":"getting-started - changelog","body":"\n \n\nChangelog\nChangelog for the Common Coordinate Framework (CCF) User Interfaces\n3.6.0 - 2022-10-15\nAdded in 3.6.0.\n\nUpdated to CCF.OWL v2.1.0 which indexes the Human Reference Atlas (HRA) 4th Release (v1.3) for use in the CCF UIs and CCF-API. Note that some terms have changed in the ontology. As such, some SPARQL queries may need to be updated. All CCF-API calls have been updated to support the new terms.\n\n3.5.0 - 2022-09-27\nAdded in 3.5.0\n\nUpdate to CCF.OWL v1.9.4\nUpdate placement for KPMP rui locations\nSwitch to HuBMAP v3 search-api\nPick right organ when loading rui locations from a file in the RUI\n\n3.4.0 - 2022-07-01\nAdded in 3.4.0\n\nMajor feature added: Spatial Search! This includes an expanded API plus a user interface for dynamically generating spatial searches.\n\nKnown Issues in 3.4.0\n\nThere are some minor visual descrepancies when viewing the spatial search 3D scene and the results. However, blocks which are highlighted will be selected if the spatial search is added to your overall search filters.\n\n3.3.0 - 2022-06-17\nAdded in 3.3.0\n\nAdded support for the latest CCF Ontology v1.9.0 which adds Placenta, Spinal Cord, new Landmarks for reference organs, and a host of data updates.\nAdded a SPARQL route to the CCF-API for flexible querying of the Ontology and linked data. See the /v1/sparql docs for more information.\nClean up and bug fixes\n\n3.2.0 - 2022-04-14\nAdded in 3.2.0\n\nMajor CCF Database speed improvements! 95% reduction in load times!\nMinor graphical fixes\n\n3.1.1 - 2022-04-12\nAdded in 3.1.1\n\nExpanded RUI web component options\nAdded support for warming up the CCF database via the CCF-API so that the EUI can prevent timeouts\n\n3.1.0 - 2022-04-07\nAdded in 3.1.0\n\nAdded support for the latest CCF Ontology v1.8.0 which adds cell types\nAdded feature to search for tissue blocks by cell type\nAdded API feature to dynamically generate GTEx rui_locations.jsonld\nAdded logging of organ and block position changes to the RUI\nAdded an expanded organ selector that makes selecting organs much easier with the larger number of reference organs we have now\nNow generating programming libraries for the CCF-API in Python, TypeScript, TypeScript (Angular), and JavaScript. We will be publishing them to appropriate package managers soon.\nImproved performance of the CCF-API\nNew theming options and toggle for the CCF EUI/RUI\nAdded new themes for SenNet, GTEx, and a default theme\nAdded compodoc generated code documentation to production and staging builds\nBug fixes and minor improvements\n\n3.0.0 - 2022-01-27\nAdded in 3.0.0\n\nAdded support for the latest CCF Ontology v1.7.0\nBug fixes and code cleanup\n\n3.0.0 BETA - 2021-12-17\nAdded in 3.0.0 BETA\n\nAdded reference organs and ASCT+B tables from the v1.1 CCF Release\nLinks: CCF Ontology v1.7 BETA, CCF Release v1.1\n\n\n\nKnown issues in 3.0.0 BETA\n\nPreviously registered tissues may appear slightly off. We are working to rectify this before making it a production release.\n\n2.5.0 - 2021-12-17\nAdded in 2.5.0\n\nCCF-API OpenAPI Spec and implementation. Next version will connect the EUI to this as it's backend.\nAdded the CCF Body UI Web Component for integrating the 3D scene deeply in webpages (including the HuBMAP data portal).\nThe organ-info Web Component can now take an option to highlight specific blocks in the scene. Currently only highlights by providers, but age, sex, and BMI will be added in the next version.\nBug fixes and Quality of Life improvements\n\n2.4.0 - 2021-12-10\nAdded in 2.4.0\n\nRUI shows a confirmation dialog when a user attempts to leave without finishing registration\nAdded GTEx data to EUI\nRUI Common Extraction Sites are now known as Landmarks\nOrgan info now highlights the block selected on click\nUpdated RUI YouTube Demo link\nBug fixes and Quality of Life improvements\n\n2.3.1 - 2021-09-13\nAdded in 2.3.1\n\nAdded support for paired organs to be refernced by their parent (ala Kidney + Left/Right Kidney)\n\n2.3.0 - 2021-09-10\nAdded in 2.3.0\n\nGreatly improved CCF Database performance. This improves the performance in both organ-info and EUI.\nImproved styling of organ-info\n\n2.2.0 - 2021-09-10\nAdded in 2.2.0\n\nAdded an organ-info web component for displaying reference organs and associated data in a simple panel display. The hubmap portal will be using this soon for organ pages.\nEMBEDDING.md instructions have been updated for organ-info embedding.\n\n2.1.0 - 2021-07-30\nAdded in EUI / RUI 2.1.0\n\nBetter support for embedding EUI/RUI in different containers, see EMBEDDING.md for updated instructions.\nConfiguration updates:\nConfiguration of EUI/RUI via webcomponent properties (vs globalConfig)\nOptional use of ontology id to select reference organs in the RUI\nRemoved embedded and tutorial mode configurations from the RUI config\nAbility to load data sources in the eui via external configuration\nAdded cancelRegistration callback to rui external configuration\n\n\nSet dark/light theme based on user/OS preferences\nUpdate HuBMAP search processing to conform to new field names\nCode cleanup, shared utilities, etc.\nTelemetry dialog box fixes to avoid unnecessary reloads\nRUI gizmo rotates in sync with the reference organ in 3D preview view\nRUI now uses an orthographic view when in registration views\n\n2.0.0 - 2021-07-16\nAdded in EUI / RUI 2.0.0\n\nRUI and EUI are now basic web-components, see EMBEDDING.md\nAdded advanced google analytics tracking/telemetry\nLinked donor card and tissue block hovering\nUpdated dependencies, including upgrading to Angular 12\nMinor UI and Bug fixes\nUpdated demo video links\nOrgan carousel will respond to container width and show only full icons\nEUI: clicking refresh and selecting body on partonomy resets the body view\n\nBreaking changes in EUI / RUI 2.0.0\n\nEmbedding the EUI and RUI must now be done via web-components. The most significant change is the element is no longer called ccf-root but is instead called ccf-eui or ccf-rui depending on the UI being embedded.\n\n1.7.0 - 2021-05-21\nAdded in EUI / RUI 1.7.0\n\nAdded a startup modal to the RUI which simplifies the initial setup for a new registration\nAdded 8 new reference organs, bringing us to 13 Reference Organs!\nAdded SPARC Registrations to the EUI\nAdded a tissue section visualization to the results list in the EUI\n\n1.6.0 - 2021-04-09\nAdded in RUI 1.6.0\n\nAdded SOP information to the About section\n\nAdded in EUI 1.6.0\n\nAdded color assignment/selection to both 3d scene and list results\nBug fixes, code cleanup, and optimization\n\nKnown issues in 1.6.0\n\nThe 3d scene is a little slow. To be able to interact, unselect reference organs to reduce scene complexity.\nTissue samples may be a little off in the 3D scene. This will be fixed in a future release. Data is still accurate.\n\n1.5.0 - 2021-03-26\nAdded in RUI 1.5.0\n\nMinor styling updates\n\nAdded in EUI 1.5.0\nNOTE: EUI will not be pushed to production during this cycle as there are some features not fully integrated. This should be resolved in the next release scheduled for April 9th. You can view the results of this sprint on staging.\n\nUpdated styling to better fit the user interface spec\nAdded a new results pane which structures data into Donor->Tissue Blocks (+Datasets)->Tissue Samples (+Datasets)\nAdded a link viewer that allows us to display donors, samples, and datasets in a frame within the application\nAdded UFL thumbnails\nUpdated and optimized the ccf-database for the new results structure and future integrations\nTied organ carousel to the 3D scene. Turning off an organ removes the organ and related tissues from the 3D scene.\nTurned off anatomical structure opacity adjustment until it can be fully integrated\n\n1.4.0 - 2021-03-12\nAdded in RUI 1.4.0\n\nUpdated library dependencies, including to Angular 11\nUpdated styling to better fit the user interface spec\n\nAdded in EUI 1.4.0\nNOTE: EUI will not be pushed to production during this cycle as there are some features partly integrated. This should be resolved in the next release scheduled for March 26th. You can view the results of this sprint on staging.\n\nUpdated library dependencies, including to Angular 11\nUpdated styling to better fit the user interface spec and match RUI styling\nUpdated the Info Dialog to match the RUI look and feel\nUpdated the data processing to improve efficiency and generate data in the form needed for the v1.5.0 spec\nAdded a reference organ selector, also used in the RUI, to turn off/on reference organs on the stage. UI is implemented, but still needs hooked up to the 3d Stage.\nAdded a technology filter\nAdded a control to set Opacities of individual organs/anatomical structures on the stage. UI is implemented, but still needs hooked up to the 3d Stage.\n\n1.3.5 - 2021-02-26\nAdded in RUI 1.3.5\n\nUpdated with a new round of User Interface improvements\nAdded the ability to upload previous registrations created using the standalone version of the RUI tool\nOrgans now have transparency applied automatically\nSolved a major memory leak and performance issue with the 3D reference organ interface. You should notice a sizable speed and reliability increase.\nRUI location numeric data is now rounded to 3 digits\nSwitched to using GitHub Actions over TravisCI for our CI/CD workflows\n\nAdded in EUI 1.3.5\n\nRemoved CCF's internal image-viewer in favor of the image-viewer on the HuBMAP Data Portal\n\nEUI 1.2.0 / RUI 1.0 FINAL - 2020-10-30\nAdded in EUI 1.2.0 / RUI 1.0 FINAL\n\nBug fixes and improvements\nUpdated embedding API in collaboration with the IEC\nUpdated EUI codebase to be in sync with code changes made for the RUI\nAdded KPMP data to the EUI\n\nKnown Issues in EUI 1.2.0 / RUI 1.0 FINAL\n\nIt is still possible that a 3d organ may fail to load. If this happens, just refresh and try again.\nEUI has not been updated with the latest organ set. This will be added in December with its scheduled refresh.\n\nRUI 1.0 BETA - 2020-10-16\nAdded in RUI 1.0 BETA\n\nCreated the first version of the RUI 1.0. This version is a BETA and works in standalone mode only. The next version will include full support and integration into the HuBMAP Ingestion Portal.\n10 Reference Organs are available to choose from (a combination of 4 organs, 2 sexes, and one organ with 2 sides [kidney])\nImplemented automatic tagging of data via collisions with anatomical structures\nRUI Location data is in standard JSON-LD format linked via the CCF Ontology and related ontologies\nImplemented extraction sites display to help guide placement of tissues\n\nKnown Issues in RUI 1.0 BETA\n\nWhile support for embedding is implemented, more testing and collaboration with IEC is required before it is made fully available. Initial embedding documentation is available here.\nWhen adjusting transparency via the left-hand Anatomical Structures menu or Show Previous Registrations option, the transparency effect is not very good. This will be addressed before the RUI 1.0 production release.\nSometimes the 3d organ fails to load when clicking through reference organs quickly (and other side cases). If this happens, just refresh and try again.\n\n1.1.0 - 2020-07-31\nAdded in 1.1.0\n\nUpgraded to latest Vitessce Image Viewer and started showing processed TIFF images coming directly from the HuBMAP infrastructure\nProcessed CODEX and 10x datasets are shown in the HuBMAP Portal's visualization tool\nAdded a limited set of TIFF image thumbnails, with more to come\nAdded two qualitative color schemes for colorizing images in the image viewer\nBug fixes/performance optimizations\n\n1.0.0-rc.1 - 2020-06-22\n\n:warning: WARNING: This version is a release candidate. Some minor updates will likely happen between now and the official HuBMAP Data Release 1 in July.\n\nAdded in 1.0.0-rc.1\n\nBody UI interactions\nImage Viewer Integration\nPartonomy linkage to search / Body UI\nNow fully integrated into the HuBMAP Portal\n\nKnown Issues in 1.0.0-rc.1\n\nImage Viewer is using a placeholder .tiff until more .tiff images can be loaded from the IEC\n\n1.0.0-alpha.3 - 2019-05-08\nAdded in 1.0.0-alpha.3\n\nHooked up the interface to real data (not shown online as the data is not public yet)\nAdded the Tissue Browser on the right\nAdded the initial (Tissue) Image Viewer popup. Currently shows metadata, but no images yet.\nAdded an initial 3D Body. Tissues cuboids currently not displayed, but a test cuboid is shown.\nDocumentation (>90%) and testing coverage improved further\n\n1.0.0-alpha.2 - 2019-03-27\nAdded in 1.0.0-alpha.2\n\nIncreased documentation and testing coverage across the board\nAdded fullscreen button\nBug fixes and optimizations\n\n1.0.0-alpha.1 - 2019-03-06\nAdded in 1.0.0-alpha.1\n\nStarted the process of implementing the 1.0.0 UI spec\nSpec Doc\nUser Stories\n\n\nSetup the base project scaffolding for the new version\nAdded CCF Partonomy (CCF-P) search and tree display\nAdded a filter for filter tissues\n\n0.6.0 - 2019-11-08\nAdded in 0.6.0\n\nThe CCF API project was started with an initial OpenAPI Schema, documentation, and code for spinning up a mock data server. This codifies the CCF data and metadata standards defined by MC-IU and will be used by the CCF EUI and RUI.\nIn preparation for future developments, we added a hidden, alpha-level 3d organ viewer. You can toggle this on and off in the organ view, by typing 3d with your keyboard.\nUpdated navigation to directly jump to the tissue browser when a user selects an item from the search box\nUpgraded dependencies, including upgrades to Angular 8\nTesting and bug fixes\nMinor UI updates\nChanged download icon color\nChanged the background color for the search\nMoved the Technologies filter above ontology\nAdditional styles for details button\n\n\n\n0.5.0 - 2019-05-24\nAdded in 0.5.0\n\nDisplay of the CCF ontology, integrated with search\nSemantic search by ontology, results are presented at all levels\nTissue overlays showing regions of interest\nData download links to direct users to https://sampledata.hubmapconsortium.org\nData documentation (95% coverage) and testing (85% coverage)\n\n0.2.0 - 2019-05-03\nAdded in 0.2.0\n\nSprint 2 release of the CCF-UI!\nA search interface was added to query data by age, sex, technology and TMC. Ontological search will be implemented in the next sprint.\nBody, Organ, and Tissue views now respond to updates to the search on the fly\nAppropriate metadata is now displayed in the Body, Organ, Tissue, and Cell views\n\n0.1.0 - 2019-04-12\nAdded in 0.1.0\n\nSprint 1 release of the CCF-UI!\nSetup the base project scaffolding\nAdded a sample database that includes initial data provided by VU\nAdded Visual browsing of tissue samples and metadata at the whole body, organ, tissue, and cell level\nStay tuned! More features coming in Sprint 2 (starts next week!) and Sprint 3\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n \n\n\n\n\n \n \n result-matching \"\"\n \n \n \n No results matching \"\"\n \n\n"},"coverage.html":{"url":"coverage.html","title":"coverage - coverage","body":"\n \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n \n\n\n\n Documentation coverage\n\n\n\n \n\n\n\n \n \n File\n Type\n Identifier\n Statements\n \n \n \n \n \n \n projects/ccf-body-ui/src/global-fixes.ts\n \n function\n castToGlobalType\n \n 0 %\n (0/1)\n \n \n \n \n \n projects/ccf-body-ui/src/lib/body-ui-layer.ts\n \n class\n BodyUILayer\n \n 0 %\n (0/6)\n \n \n \n \n \n projects/ccf-body-ui/src/lib/body-ui-layer.ts\n \n function\n meshLayer\n \n 0 %\n (0/1)\n \n \n \n \n \n projects/ccf-body-ui/src/lib/body-ui-layer.ts\n \n function\n textLayer\n \n 0 %\n (0/1)\n \n \n \n \n \n projects/ccf-body-ui/src/lib/body-ui.ts\n \n class\n BodyUI\n \n 2 %\n (1/37)\n \n \n \n \n \n projects/ccf-body-ui/src/lib/body-ui.ts\n \n interface\n BodyUIProps\n \n 0 %\n (0/13)\n \n \n \n \n \n projects/ccf-body-ui/src/lib/body-ui.ts\n \n interface\n BodyUIViewStateProps\n \n 0 %\n (0/7)\n \n \n \n \n \n projects/ccf-body-ui/src/lib/body-ui.ts\n \n interface\n PickInfo\n \n 0 %\n (0/8)\n \n \n \n \n \n projects/ccf-body-ui/src/lib/shared/ccf-spatial-jsonld.ts\n \n interface\n SpatialEntityJsonLd\n \n 0 %\n (0/26)\n \n \n \n \n \n projects/ccf-body-ui/src/lib/shared/ccf-spatial-jsonld.ts\n \n interface\n SpatialObjectReferenceJsonLd\n \n 0 %\n (0/6)\n \n \n \n \n \n projects/ccf-body-ui/src/lib/shared/ccf-spatial-jsonld.ts\n \n interface\n SpatialPlacementJsonLd\n \n 0 %\n (0/19)\n \n \n \n \n \n projects/ccf-body-ui/src/lib/shared/spatial-scene-node.ts\n \n interface\n SpatialSceneNode\n \n 0 %\n (0/20)\n \n \n \n \n \n projects/ccf-body-ui/src/lib/util/load-gltf.ts\n \n function\n deriveScenegraph\n \n 0 %\n (0/1)\n \n \n \n \n \n projects/ccf-body-ui/src/lib/util/load-gltf.ts\n \n function\n loadGLTF\n \n 0 %\n (0/1)\n \n \n \n \n \n projects/ccf-body-ui/src/lib/util/load-gltf.ts\n \n function\n loadGLTF2\n \n 0 %\n (0/1)\n \n \n \n \n \n projects/ccf-body-ui/src/lib/util/load-gltf.ts\n \n function\n registerGLTFLoaders\n \n 0 %\n (0/1)\n \n \n \n \n \n projects/ccf-body-ui/src/lib/util/parse-csv.ts\n \n function\n parseCSV\n \n 0 %\n (0/1)\n \n \n \n \n \n projects/ccf-body-ui/src/lib/util/parse-csv.ts\n \n function\n parseCSVText\n \n 0 %\n (0/1)\n \n \n \n \n \n projects/ccf-body-ui/src/lib/util/process-anatomical-structures.ts\n \n function\n processAnatomicalStructures\n \n 0 %\n (0/1)\n \n \n \n \n \n projects/ccf-body-ui/src/lib/util/process-extraction-sites.ts\n \n function\n processExtractionSites\n \n 0 %\n (0/1)\n \n \n \n \n \n projects/ccf-body-ui/src/lib/util/process-reference-data.ts\n \n function\n processReferenceData\n \n 0 %\n (0/1)\n \n \n \n \n \n projects/ccf-body-ui/src/lib/util/process-reference-data.ts\n \n variable\n referenceDataConfig\n \n 0 %\n (0/1)\n \n \n \n \n \n projects/ccf-body-ui/src/lib/util/process-scene-nodes.ts\n \n interface\n ProcessedNode\n \n 0 %\n (0/6)\n \n \n \n \n \n projects/ccf-body-ui/src/lib/util/process-scene-nodes.ts\n \n function\n childNames\n \n 0 %\n (0/1)\n \n \n \n \n \n projects/ccf-body-ui/src/lib/util/process-scene-nodes.ts\n \n function\n processSceneNodes\n \n 0 %\n (0/1)\n \n \n \n \n \n projects/ccf-body-ui/src/lib/util/process-spatial-entities.ts\n \n function\n processSpatialEntities\n \n 0 %\n (0/1)\n \n \n \n \n \n projects/ccf-body-ui/src/lib/util/scene-traversal.ts\n \n function\n traverseScene\n \n 0 %\n (0/1)\n \n \n \n \n \n projects/ccf-body-ui/src/lib/util/simplify-scene.ts\n \n function\n simplifyScene\n \n 0 %\n (0/1)\n \n \n \n \n \n projects/ccf-body-ui/src/lib/util/spatial-scene-collider.ts\n \n interface\n Collision\n \n 0 %\n (0/4)\n \n \n \n \n \n projects/ccf-body-ui/src/lib/util/spatial-scene-collider.ts\n \n function\n doCollisions\n \n 0 %\n (0/1)\n \n \n \n\n\n\n\n\n new Tablesort(document.getElementById('coverage-table'));\n\n\n \n \n result-matching \"\"\n \n \n \n No results matching \"\"\n \n\n"},"dependencies.html":{"url":"dependencies.html","title":"package-dependencies - dependencies","body":"\n \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n \n Dependencies\n \n \n \n @angular-ru/common : ^15.126.1\n \n @angular/animations : ^12.1.1\n \n @angular/cdk : ^12.1.1\n \n @angular/common : ^12.1.1\n \n @angular/compiler : ^12.1.1\n \n @angular/core : ^12.1.1\n \n @angular/elements : ^12.1.1\n \n @angular/forms : ^12.1.1\n \n @angular/material : ^12.1.3\n \n @angular/platform-browser : ^12.1.1\n \n @angular/platform-browser-dynamic : ^12.1.1\n \n @angular/router : ^12.1.1\n \n @angular/youtube-player : ^12.1.1\n \n @comunica/query-sparql-rdfjs : ^2.2.0\n \n @deck.gl/core : ^8.5.7\n \n @deck.gl/geo-layers : ^8.7.8\n \n @deck.gl/layers : ^8.5.7\n \n @deck.gl/mesh-layers : ^8.5.7\n \n @loaders.gl/core : ^3.0.12\n \n @loaders.gl/draco : ^3.0.12\n \n @loaders.gl/gltf : ^3.0.12\n \n @luma.gl/core : ^8.5.12\n \n @math.gl/core : ^3.5.5\n \n @math.gl/culling : ^3.5.7\n \n @ngxs-labs/data : ^6.2.0\n \n @ngxs-labs/dispatch-decorator : ^4.0.2\n \n @ngxs/logger-plugin : ^3.7.1\n \n @ngxs/storage-plugin : ^3.7.1\n \n @ngxs/store : ^3.7.3\n \n @rdfjs/data-model : ^1.2.0\n \n @types/lru-cache : \n \n @webcomponents/webcomponentsjs : ^2.5.0\n \n bind-decorator : ^1.0.11\n \n body-parser : ^1.19.0\n \n cannon-es : ^0.18.0\n \n comlink : ^4.3.0\n \n concat : ^1.0.3\n \n cors : ^2.8.5\n \n css-element-queries : ^1.2.3\n \n document-register-element : ^1.7.2\n \n dotenv : ^16.0.0\n \n express : ^4.17.1\n \n file-saver : ^2.0.5\n \n fs-extra : ^10.0.0\n \n graphology : ^0.20.0\n \n graphology-shortest-path : ^1.4.1\n \n helmet : ^4.6.0\n \n hex-rgb : ^5.0.0\n \n idb-keyval : ^6.0.1\n \n jsonld : ^5.2.0\n \n lodash : ^4.17.21\n \n lru-cache : \n \n n3 : ^1.16.0\n \n ng5-slider : ^1.2.6\n \n ngx-google-analytics : ^11.2.1\n \n ngx-markdown : ^12.0.1\n \n node-fetch : ^2.6.7\n \n qs : ^6.10.2\n \n rdf-literal : ^1.2.0\n \n rdfxml-streaming-parser : ^1.4.0\n \n readable-stream : ^3.6.0\n \n rxjs : ^6.6.7\n \n stream-browserify : ^3.0.0\n \n swiper : ^6.5.1\n \n ts-cacheable : ^1.0.6\n \n tslib : ^2.1.0\n \n uuid : ^8.3.2\n \n zone.js : ~0.11.4\n \n\n \n\n\n\n\n \n \n result-matching \"\"\n \n \n \n No results matching \"\"\n \n\n"},"miscellaneous/functions.html":{"url":"miscellaneous/functions.html","title":"miscellaneous-functions - functions","body":"\n \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n \n\n\n Miscellaneous\n Functions\n\n\n\n Index\n \n \n \n \n \n \n castToGlobalType   (projects/.../global-fixes.ts)\n \n \n childNames   (projects/.../process-scene-nodes.ts)\n \n \n deriveScenegraph   (projects/.../load-gltf.ts)\n \n \n doCollisions   (projects/.../spatial-scene-collider.ts)\n \n \n loadGLTF   (projects/.../load-gltf.ts)\n \n \n loadGLTF2   (projects/.../load-gltf.ts)\n \n \n meshLayer   (projects/.../body-ui-layer.ts)\n \n \n parseCSV   (projects/.../parse-csv.ts)\n \n \n parseCSVText   (projects/.../parse-csv.ts)\n \n \n processAnatomicalStructures   (projects/.../process-anatomical-structures.ts)\n \n \n processExtractionSites   (projects/.../process-extraction-sites.ts)\n \n \n processReferenceData   (projects/.../process-reference-data.ts)\n \n \n processSceneNodes   (projects/.../process-scene-nodes.ts)\n \n \n processSpatialEntities   (projects/.../process-spatial-entities.ts)\n \n \n registerGLTFLoaders   (projects/.../load-gltf.ts)\n \n \n simplifyScene   (projects/.../simplify-scene.ts)\n \n \n textLayer   (projects/.../body-ui-layer.ts)\n \n \n traverseScene   (projects/.../scene-traversal.ts)\n \n \n \n \n \n \n\n\n projects/ccf-body-ui/src/global-fixes.ts\n \n \n \n \n \n \n \n castToGlobalType\n \n \n \n \n \n \ncastToGlobalType(value)\n \n \n\n\n\n\n \n \n\n \n Parameters :\n \n \n \n Name\n Optional\n \n \n \n \n value\n\n \n No\n \n\n\n \n \n \n \n \n \n \n \n \n \n projects/ccf-body-ui/src/lib/util/process-scene-nodes.ts\n \n \n \n \n \n \n \n childNames\n \n \n \n \n \n \nchildNames(scene, names)\n \n \n\n\n\n\n \n \n\n \n Parameters :\n \n \n \n Name\n Optional\n \n \n \n \n scene\n\n \n No\n \n\n\n \n \n names\n\n \n No\n \n\n\n \n \n \n \n \n \n \n Returns : string[]\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n processSceneNodes\n \n \n \n \n \n \nprocessSceneNodes(gltfUrl, worldMatrix?, scenegraphNode?, gltfCache?)\n \n \n\n\n\n\n \n \n\n \n Parameters :\n \n \n \n Name\n Optional\n \n \n \n \n gltfUrl\n\n \n No\n \n\n\n \n \n worldMatrix\n\n \n Yes\n \n\n\n \n \n scenegraphNode\n\n \n Yes\n \n\n\n \n \n gltfCache\n\n \n Yes\n \n\n\n \n \n \n \n \n \n \n Returns : Promise\n\n \n \n \n \n \n \n \n \n projects/ccf-body-ui/src/lib/util/load-gltf.ts\n \n \n \n \n \n \n \n deriveScenegraph\n \n \n \n \n \n \nderiveScenegraph(scenegraphNodeName, gltf)\n \n \n\n\n\n\n \n \n\n \n Parameters :\n \n \n \n Name\n Optional\n \n \n \n \n scenegraphNodeName\n\n \n No\n \n\n\n \n \n gltf\n\n \n No\n \n\n\n \n \n \n \n \n \n \n Returns : any\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n loadGLTF\n \n \n \n \n \n \nloadGLTF(model, cache?)\n \n \n\n\n\n\n \n \n\n \n Parameters :\n \n \n \n Name\n Optional\n \n \n \n \n model\n\n \n No\n \n\n\n \n \n cache\n\n \n Yes\n \n\n\n \n \n \n \n \n \n \n Returns : Promise\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n loadGLTF2\n \n \n \n \n \n \nloadGLTF2(scenegraphNodeName, gltfPromise)\n \n \n\n\n\n\n \n \n\n \n Parameters :\n \n \n \n Name\n Optional\n \n \n \n \n scenegraphNodeName\n\n \n No\n \n\n\n \n \n gltfPromise\n\n \n No\n \n\n\n \n \n \n \n \n \n \n Returns : Promise\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n registerGLTFLoaders\n \n \n \n \n \n \nregisterGLTFLoaders()\n \n \n\n\n\n\n \n \n\n \n Returns : void\n\n \n \n \n \n \n projects/ccf-body-ui/src/lib/util/spatial-scene-collider.ts\n \n \n \n \n \n \n \n doCollisions\n \n \n \n \n \n \ndoCollisions(scene)\n \n \n\n\n\n\n \n \n\n \n Parameters :\n \n \n \n Name\n Optional\n \n \n \n \n scene\n\n \n No\n \n\n\n \n \n \n \n \n \n \n Returns : Promise\n\n \n \n \n \n \n \n \n \n projects/ccf-body-ui/src/lib/body-ui-layer.ts\n \n \n \n \n \n \n \n meshLayer\n \n \n \n \n \n \nmeshLayer(id, data, options)\n \n \n\n\n\n\n \n \n\n \n Parameters :\n \n \n \n Name\n Optional\n \n \n \n \n id\n\n \n No\n \n\n\n \n \n data\n\n \n No\n \n\n\n \n \n options\n\n \n No\n \n\n\n \n \n \n \n \n \n \n Returns : SimpleMeshLayer | undefined\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n textLayer\n \n \n \n \n \n \ntextLayer(id, data, options)\n \n \n\n\n\n\n \n \n\n \n Parameters :\n \n \n \n Name\n Optional\n \n \n \n \n id\n\n \n No\n \n\n\n \n \n data\n\n \n No\n \n\n\n \n \n options\n\n \n No\n \n\n\n \n \n \n \n \n \n \n Returns : TextLayer | undefined\n\n \n \n \n \n \n \n \n \n projects/ccf-body-ui/src/lib/util/parse-csv.ts\n \n \n \n \n \n \n \n parseCSV\n \n \n \n \n \n \nparseCSV(sourceUrl, firstFieldName?)\n \n \n\n\n\n\n \n \n\n \n Parameters :\n \n \n \n Name\n Optional\n \n \n \n \n sourceUrl\n\n \n No\n \n\n\n \n \n firstFieldName\n\n \n Yes\n \n\n\n \n \n \n \n \n \n \n Returns : Promise\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n parseCSVText\n \n \n \n \n \n \nparseCSVText(csvText, firstFieldName?)\n \n \n\n\n\n\n \n \n\n \n Parameters :\n \n \n \n Name\n Optional\n \n \n \n \n csvText\n\n \n No\n \n\n\n \n \n firstFieldName\n\n \n Yes\n \n\n\n \n \n \n \n \n \n \n Returns : Promise\n\n \n \n \n \n \n \n \n \n projects/ccf-body-ui/src/lib/util/process-anatomical-structures.ts\n \n \n \n \n \n \n \n processAnatomicalStructures\n \n \n \n \n \n \nprocessAnatomicalStructures(sourceUrl, entities)\n \n \n\n\n\n\n \n \n\n \n Parameters :\n \n \n \n Name\n Optional\n \n \n \n \n sourceUrl\n\n \n No\n \n\n\n \n \n entities\n\n \n No\n \n\n\n \n \n \n \n \n \n \n Returns : Promise\n\n \n \n \n \n \n \n \n \n projects/ccf-body-ui/src/lib/util/process-extraction-sites.ts\n \n \n \n \n \n \n \n processExtractionSites\n \n \n \n \n \n \nprocessExtractionSites(sourceUrl, entities)\n \n \n\n\n\n\n \n \n\n \n Parameters :\n \n \n \n Name\n Optional\n \n \n \n \n sourceUrl\n\n \n No\n \n\n\n \n \n entities\n\n \n No\n \n\n\n \n \n \n \n \n \n \n Returns : Promise\n\n \n \n \n \n \n \n \n \n projects/ccf-body-ui/src/lib/util/process-reference-data.ts\n \n \n \n \n \n \n \n processReferenceData\n \n \n \n \n \n \nprocessReferenceData(refEntities, config)\n \n \n\n\n\n\n \n \n\n \n Parameters :\n \n \n \n Name\n Optional\n \n \n \n \n refEntities\n\n \n No\n \n\n\n \n \n config\n\n \n No\n \n\n\n \n \n \n \n \n \n \n Returns : Promise\n\n \n \n \n \n \n \n \n \n projects/ccf-body-ui/src/lib/util/process-spatial-entities.ts\n \n \n \n \n \n \n \n processSpatialEntities\n \n \n \n \n \n \nprocessSpatialEntities(parent, gltfOverride?)\n \n \n\n\n\n\n \n \n\n \n Parameters :\n \n \n \n Name\n Optional\n \n \n \n \n parent\n\n \n No\n \n\n\n \n \n gltfOverride\n\n \n Yes\n \n\n\n \n \n \n \n \n \n \n Returns : Promise\n\n \n \n \n \n \n \n \n \n projects/ccf-body-ui/src/lib/util/simplify-scene.ts\n \n \n \n \n \n \n \n simplifyScene\n \n \n \n \n \n \nsimplifyScene(nodes)\n \n \n\n\n\n\n \n \n\n \n Parameters :\n \n \n \n Name\n Optional\n \n \n \n \n nodes\n\n \n No\n \n\n\n \n \n \n \n \n \n \n Returns : Promise\n\n \n \n \n \n \n \n \n \n projects/ccf-body-ui/src/lib/util/scene-traversal.ts\n \n \n \n \n \n \n \n traverseScene\n \n \n \n \n \n \ntraverseScene(scene, worldMatrix, visitor)\n \n \n\n\n\n\n \n \n\n \n Parameters :\n \n \n \n Name\n Optional\n \n \n \n \n scene\n\n \n No\n \n\n\n \n \n worldMatrix\n\n \n No\n \n\n\n \n \n visitor\n\n \n No\n \n\n\n \n \n \n \n \n \n \n Returns : boolean\n\n \n \n \n \n \n \n \n \n\n\n\n \n \n result-matching \"\"\n \n \n \n No results matching \"\"\n \n\n"},"index.html":{"url":"index.html","title":"getting-started - index","body":"\n \n\nCommon Coordinate Framework (CCF) - User Interfaces\n\n\n\n\n\n\n\nThis repository is a monorepo (multiple projects in one repository) containing the software to build the CCF-EUI, CCF-RUI, and CCF-Organ-Info.\nWebsite Links\n\nCCF Exploration User Interface (CCF-EUI)\n:star2: 4.0 BETA: https://beta--hubmap-ccf-ui.netlify.app\nProduction: https://portal.hubmapconsortium.org/ccf-eui\nProduction (alt): https://hubmapconsortium.github.io/ccf-ui/\nStaging: https://hubmap-ccf-ui.netlify.app/\nOld Version 0.6.0: https://old--hubmap-ccf-ui.netlify.app\n\n\nCCF Registration User Interface (CCF-RUI)\n:star2: 4.0 BETA: https://beta--hubmap-ccf-ui.netlify.app/rui/\nProduction: https://hubmapconsortium.github.io/ccf-ui/rui/\nStaging: https://hubmap-ccf-ui.netlify.app/rui/\n\n\nCCF Organ Info Component (CCF-Organ-Info)\nProduction: https://hubmapconsortium.github.io/ccf-ui/organ-info/\nStaging: https://hubmap-ccf-ui.netlify.app/organ-info/\n\n\nCCF API\nProduction: https://ccf-api.hubmapconsortium.org\nStaging: https://r5i95k35v5.us-east-2.awsapprunner.com\nOpenAPI Specification: ccf-api-spec.yaml\n\n\nCCF API Client Libraries:\nJavaScript: @ccf-openapi/js-client\nTypeScript: @ccf-openapi/ts-client\nAngular 12+: @ccf-openapi/ng-client\nPython 3.6+: ccf-openapi\n\n\n\nBackground and More Information\nFor more information about the Common Coordinate Framework (CCF), see the HuBMAP CCF Portal at https://hubmapconsortium.github.io/ccf/.\nChange Log\nSee the ChangeLog for the latest developments.\nCredits\nThis software is developed by the Cyberinfrastructure for Network Science Center at Indiana University. It is funded by NIH Award OT2OD026671.\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n \n\n\n\n\n \n \n result-matching \"\"\n \n \n \n No results matching \"\"\n \n\n"},"license.html":{"url":"license.html","title":"getting-started - license","body":"\n \n\nMIT License\nCopyright (c) 2019 HuBMAP Consortium\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n \n\n\n\n\n \n \n result-matching \"\"\n \n \n \n No results matching \"\"\n \n\n"},"modules.html":{"url":"modules.html","title":"modules - modules","body":"\n \n\n\n\n\n Modules\n\n\n \n \n\n\n\n\n\n\n\n\n\n\n\n\n \n\n\n\n\n \n \n result-matching \"\"\n \n \n \n No results matching \"\"\n \n\n"},"overview.html":{"url":"overview.html","title":"overview - overview","body":"\n \n\n\n\n Overview\n\n \n\n \n \n \n \n \n 2 Classes\n \n \n \n \n \n \n \n 9 Interfaces\n \n \n \n \n\n\n \n\n\n\n\n\n\n\n\n\n\n\n \n\n\n\n\n \n \n result-matching \"\"\n \n \n \n No results matching \"\"\n \n\n"},"miscellaneous/typealiases.html":{"url":"miscellaneous/typealiases.html","title":"miscellaneous-typealiases - typealiases","body":"\n \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n \n\n\n Miscellaneous\n Type aliases\n\n\n\n Index\n \n \n \n \n \n \n NodeClickEvent   (projects/.../body-ui.ts)\n \n \n NodeDragEvent   (projects/.../body-ui.ts)\n \n \n SceneTraversalVisitor   (projects/.../scene-traversal.ts)\n \n \n SpatialSceneGeometry   (projects/.../spatial-scene-node.ts)\n \n \n \n \n \n \n\n\n projects/ccf-body-ui/src/lib/body-ui.ts\n \n \n \n \n \n \n NodeClickEvent\n \n \n \n \n literal type\n\n \n \n \n \n \n \n \n \n \n NodeDragEvent\n \n \n \n \n literal type\n\n \n \n \n \n projects/ccf-body-ui/src/lib/util/scene-traversal.ts\n \n \n \n \n \n \n SceneTraversalVisitor\n \n \n \n \n function\n\n \n \n \n \n projects/ccf-body-ui/src/lib/shared/spatial-scene-node.ts\n \n \n \n \n \n \n SpatialSceneGeometry\n \n \n \n \n \"sphere\" | \"cube\" | \"wireframe\" | \"text\" | \"cone\" | \"cylinder\"\n\n \n \n \n \n\n\n\n \n \n result-matching \"\"\n \n \n \n No results matching \"\"\n \n\n"},"miscellaneous/variables.html":{"url":"miscellaneous/variables.html","title":"miscellaneous-variables - variables","body":"\n \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n \n\n\n Miscellaneous\n Variables\n\n\n\n Index\n \n \n \n \n \n \n referenceDataConfig   (projects/.../process-reference-data.ts)\n \n \n \n \n \n \n\n\n projects/ccf-body-ui/src/lib/util/process-reference-data.ts\n \n \n \n \n \n \n \n referenceDataConfig\n \n \n \n \n \n \n Type : object\n\n \n \n \n \n Default value : {\n extractionSitesUrl: 'http://localhost:8080/source_data/asct-b-3d-models-extraction-sites.csv',\n extractionSitesConfigUrl: 'http://localhost:8080/source_data/extraction-site-config.csv',\n anatomicalStructuresUrl: 'http://localhost:8080/source_data/asct-b-3d-models-mapping.csv',\n referenceOrganConfigUrl: 'http://localhost:8080/source_data/reference-organ-config.csv'\n}\n \n \n\n\n \n \n\n\n\n\n \n \n result-matching \"\"\n \n \n \n No results matching \"\"\n \n\n"}} } diff --git a/docs/ccf-body-ui/miscellaneous/functions.html b/docs/ccf-body-ui/miscellaneous/functions.html index 4b44e8e2b..29c886b20 100644 --- a/docs/ccf-body-ui/miscellaneous/functions.html +++ b/docs/ccf-body-ui/miscellaneous/functions.html @@ -254,7 +254,7 @@

    @@ -300,6 +300,15 @@

    -processSceneNodes(gltfUrl, worldMatrix?, scenegraphNode?) +processSceneNodes(gltfUrl, worldMatrix?, scenegraphNode?, gltfCache?)
    + + + + + + +
    gltfCache + Yes +
    diff --git a/index.html b/index.html index 36e4da7eb..4e3710576 100644 --- a/index.html +++ b/index.html @@ -4,7 +4,7 @@ - + diff --git a/main-es2015.js b/main-es2015.js index d06394402..be83faf1b 100644 --- a/main-es2015.js +++ b/main-es2015.js @@ -1 +1 @@ -var X6e=Object.defineProperty,K6e=Object.defineProperties,q6e=Object.getOwnPropertyDescriptors,YM=Object.getOwnPropertySymbols,bZ=Object.prototype.hasOwnProperty,wZ=Object.prototype.propertyIsEnumerable,Yr=Math.pow,SZ=(t,e,n)=>e in t?X6e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,vt=(t,e)=>{for(var n in e||(e={}))bZ.call(e,n)&&SZ(t,n,e[n]);if(YM)for(var n of YM(e))wZ.call(e,n)&&SZ(t,n,e[n]);return t},zn=(t,e)=>K6e(t,q6e(e)),CZ=(t,e)=>{var n={};for(var i in t)bZ.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&YM)for(var i of YM(t))e.indexOf(i)<0&&wZ.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 C(this,e,n);case"ascii":return E(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 C(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 E(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 A(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 M(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 I(t,e,n,r,s){return e=+e,n>>>=0,s||M(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||M(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||P(t,e,this.length);for(var i=this[t],r=1,s=0;++s>>=0,e>>>=0,n||P(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||P(t,1,this.length),this[t]},o.prototype.readUInt16LE=function(t,e){return t>>>=0,e||P(t,2,this.length),this[t]|this[t+1]<<8},o.prototype.readUInt16BE=function(t,e){return t>>>=0,e||P(t,2,this.length),this[t]<<8|this[t+1]},o.prototype.readUInt32LE=function(t,e){return t>>>=0,e||P(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||P(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||P(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||P(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||P(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},o.prototype.readInt16LE=function(t,e){t>>>=0,e||P(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||P(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||P(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||P(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||P(t,4,this.length),i.read(this,t,!0,23,4)},o.prototype.readFloatBE=function(t,e){return t>>>=0,e||P(t,4,this.length),i.read(this,t,!1,23,4)},o.prototype.readDoubleLE=function(t,e){return t>>>=0,e||P(t,8,this.length),i.read(this,t,!0,52,8)},o.prototype.readDoubleBE=function(t,e){return t>>>=0,e||P(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||A(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||A(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||A(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||A(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||A(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||A(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||A(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);A(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);A(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||A(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||A(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||A(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||A(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||A(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 I(this,t,e,!0,n)},o.prototype.writeFloatBE=function(t,e,n){return I(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"),C={};function E(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=C,C.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=C.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 P=Object.keys(n).sort();for(const l of P){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=C.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=C.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&&(E(t,n,i),o(_[n])||(_[n]={}),r=_[n]),w(r,e,p,{propertyIsArray:!0})}for(const e of p){const n=C.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&&(E(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 C.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={[C.compactIri({activeCtx:t,iri:"@list",relativeTo:{vocab:!0}})]:O},"@index"in e&&(O[C.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"])||C.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={[C.compactIri({activeCtx:t,iri:"@graph",relativeTo:{vocab:!0}})]:O},"@id"in e&&(O[C.compactIri({activeCtx:t,iri:"@id",relativeTo:{vocab:!0}})]=e["@id"]),"@index"in e&&(O[C.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=C.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=C.compactIri({activeCtx:t,iri:"@id",relativeTo:{vocab:!0}});s=O[e],delete O[e]}else if(m.includes("@type")){const r=C.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 C.compact({activeCtx:t,activeProperty:n,element:{"@id":e["@id"]},options:i,compactionMap:f}))}s||(s=C.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=C.compactIri({activeCtx:t,iri:l,relativeTo:{vocab:!0}});w(_,n,p)}else{const n=yield C.compact({activeCtx:t,activeProperty:e,element:p,options:i,compactionMap:f});s(n)&&0===n.length||w(_,l,n)}else{const e=yield C.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=C.compactIri({activeCtx:t,iri:l,relativeTo:{vocab:!0}});w(_,n,e)}}else{let e=x(p).map(t=>C.compactIri({activeCtx:S,iri:t,relativeTo:{vocab:!0}}));1===e.length&&(e=e[0]);const n=C.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=>C.compactIri({activeCtx:t,iri:e,relativeTo:{vocab:!1},base:i.base}));1===e.length&&(e=e[0]),_[C.compactIri({activeCtx:t,iri:"@id",relativeTo:{vocab:!0}})]=e}}return _}return n});return function(e){return t.apply(this,arguments)}}(),C.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)},C.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[C.compactIri({activeCtx:t,iri:"@index",relativeTo:{vocab:!0}})]=n["@index"]),"@type"in n?f[C.compactIri({activeCtx:t,iri:"@type",relativeTo:{vocab:!0}})]=C.compactIri({activeCtx:t,iri:n["@type"],relativeTo:{vocab:!0}}):"@language"in n&&(f[C.compactIri({activeCtx:t,iri:"@language",relativeTo:{vocab:!0}})]=n["@language"]),"@direction"in n&&(f[C.compactIri({activeCtx:t,iri:"@direction",relativeTo:{vocab:!0}})]=n["@direction"]),f[C.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=C.compactIri({activeCtx:t,iri:n["@id"],relativeTo:{vocab:"@vocab"===s},base:i.base});return"@id"===s||"@vocab"===s||"@graph"===r?o:{[C.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"),C={};e.exports=C;const E=/^[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:M,expansionMap:I}){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=I({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(M,t,{vocab:!0}),w(e).map(t=>f(M,t,{base:!0,vocab:!0}))]))),S(D,x.isFrame),_(d,"@type",w(D).map(t=>l(t)?f(M,t,{base:!0,vocab:!0},x):t),{propertyIsArray:x.isFrame});continue}if("@included"===j&&y(t,1.1)){const n=w(yield C.expand({activeCtx:t,activeProperty:e,element:D,options:x,expansionMap:I}));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(E)&&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 C.expand({activeCtx:t,activeProperty:"@reverse",element:D,options:x,expansionMap:I}),"@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:M,typeKey:k,expansionMap:I})}}})).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 P(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 A(t){return M.apply(this,arguments)}function M(){return(M=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 C.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)}C.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 P={};yield O({activeCtx:t,activeProperty:e,expandedActiveProperty:m,element:n,expandedParent:P,options:i,insideList:u,typeKey:T,typeScopedContext:d,expansionMap:p}),S=Object.keys(P);let A=S.length;if("@value"in P){if("@type"in P&&("@language"in P||"@direction"in P))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:P});let s=A-1;if("@type"in P&&(s-=1),"@index"in P&&(s-=1),"@language"in P&&(s-=1),"@direction"in P&&(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:P});const o=null===P["@value"]?[]:w(P["@value"]),c=x(P,"@type");if(!y(t,1.1)||!c.includes("@json")||1!==c.length)if(0===o.length){const r=yield p({unmappedValue:P,activeCtx:t,activeProperty:e,element:n,options:i,insideList:u});P=void 0!==r?r:null}else{if(!o.every(t=>l(t)||a(t))&&"@language"in P)throw new r("Invalid JSON-LD syntax; only strings may be language-tagged.","jsonld.SyntaxError",{code:"invalid language-tagged value",element:P});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:P})}}else if("@type"in P&&!s(P["@type"]))P["@type"]=[P["@type"]];else if("@set"in P||"@list"in P){if(A>1&&(2!==A||!("@index"in P)))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:P});"@set"in P&&(P=P["@set"],S=Object.keys(P),A=S.length)}else if(1===A&&"@language"in P){const r=yield p(P,{unmappedValue:P,activeCtx:t,activeProperty:e,element:n,options:i,insideList:u});P=void 0!==r?r:null}if(o(P)&&!i.keepFreeFloatingNodes&&!u&&(null===e||"@graph"===m)&&(0===A||"@value"in P||"@list"in P||1===A&&"@id"in P)){const r=yield p({unmappedValue:P,activeCtx:t,activeProperty:e,element:n,options:i,insideList:u});P=void 0!==r?r:null}return P});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(zn(vt({},t),{graph:g,embedded:!1}),Object.keys(t.graphMap[g]).sort(),[i],S,"@graph")}"@included"in n&&h.frame(zn(vt({},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(zn(vt({},t),{embedded:!0}),[e["@id"]],s,a,"@list"):v(a,"@list",o.clone(e))}else r.isSubjectReference(i)?h.frame(zn(vt({},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(zn(vt({},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:C,processingMode:E}=t("./context"),{compact:O,compactIri:T}=t("./compact"),{createNodeMap:k,createMergedNodeMap:P,mergeNodeMaps:A}=t("./nodeMap"),M=function(e){const n={},M=new u({max:100});function I(t,n){var i=n,{documentLoader:r=e.documentLoader}=i,s=CZ(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=I(i,{base:_(t)?t:"",compactArrays:!0,compactToRelative:!0,graph:!1,skipExpansion:!1,link:!1,issuer:new l("_:b"),contextResolver:new a({sharedCache:M})})).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=I(n,{keepFreeFloatingNodes:!1,contextResolver:new a({sharedCache:M})})).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 C({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=I(i,{base:_(t)?t:"",contextResolver:new a({sharedCache:M})});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=I(i,{base:_(t)?t:"",embed:"@once",explicit:!1,requireAll:!1,omitDefault:!1,bnodesToClear:[],contextResolver:new a({sharedCache:M})}),_(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=E(s,1.1)),i.hasOwnProperty("pruneBlankNodeIdentifiers")||(i.pruneBlankNodeIdentifiers=E(s,1.1));const o=yield e.expand(t,i),l=vt({},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=E(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=I(n,{base:_(t)?t:"",algorithm:"URDNA2015",skipExpansion:!1,contextResolver:new a({sharedCache:M})}))){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=vt({},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=I(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=I(n,{base:_(t)?t:"",skipExpansion:!1,contextResolver:new a({sharedCache:M})})).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=I(n,{base:_(t)?t:"",contextResolver:new a({sharedCache:M})});const i=yield e.expand(t,n);return P(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=I(i,{contextResolver:new a({sharedCache:M})});const r=yield Promise.all(t.map(t=>{const n=vt({},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=I(n,{base:"",contextResolver:new a({sharedCache:M})}),null===e?S(n):(e=o.clone(e),v(e)&&"@context"in e||(e={"@context":e}),C({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},I=function(){return M(function(){return I()})};M(I),e.exports=I},{"./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.default=n.Variable=n.Triple=n.Term=n.Quad=n.NamedNode=n.Literal=n.DefaultGraph=n.BlankNode=void 0,n.escapeQuotes=_,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.unescapeQuotes=w;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}hashCode(){return 0}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,i=n.length;for(;;){let t,a;for(;t=this._newline.exec(n);)this._comments&&(a=this._comment.exec(t[0]))&&r("comment",a[1],"",this._line,t[0].length),n=n.substr(t[0].length,n.length),i=n.length,this._line++;if(!t&&(t=this._whitespace.exec(n))&&(n=n.substr(t[0].length,n.length)),this._endOfFile.test(n))return e&&(this._comments&&(a=this._comment.exec(n))&&r("comment",a[1],"",this._line,n.length),n=null,r("eof","","",this._line,0)),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 s(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 s(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 s(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)?s(this):this._input=n;const b=g||f[0].length,y=r(h,d,p,l,b);this.previousToken=y,this._previousMarker=h,n=n.substr(b,n.length)}function r(e,r,s,o,a){const l=n?i-n.length:i,c={type:e,value:r,prefix:s,line:o,start:l,end:l+a};return t(null,c),c}function s(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"[":if(this._n3Mode)return this._saveContext("blank",this._graph,this._subject,this._subject=this._blankNode(),null),this._readBlankNodeHead;case"blank":if(!this._n3Mode)return this._error("Disallowed blank node as predicate",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?this._getContextEndReader():null!==this._predicate?this._readObject:e?this._readPredicateOrNamedGraph:this._readPredicateAfterBlank}_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){let c,u,h;const d=!e+!n+!i>1?Object.keys(this._ids):this._entities,p=(0,r.termFromId)(l,this._factory);e&&((c=t,t={})[e]=c[e]);for(const f in t){const e=d[f];if(u=t[f]){n&&((c=u,u={})[n]=c[n]);for(const t in u){const n=d[t];if(h=u[t]){const t=i?i in h?[i]:[]:Object.keys(h);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.readQuads(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){return[...this.readQuads(t,e,n,i)]}*readQuads(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;if(!(c(t)&&!(l=o[t])||c(e)&&!(u=o[e])||c(n)&&!(h=o[n])))for(const r in s)(a=s[r])&&(l?h?yield*this._findInIndex(a.objects,h,l,u,"object","subject","predicate",r,null,!0):yield*this._findInIndex(a.subjects,l,u,null,"subject","predicate","object",r,null,!0):u?yield*this._findInIndex(a.predicates,u,h,null,"predicate","object","subject",r,null,!0):h?yield*this._findInIndex(a.objects,h,null,null,"object","subject","predicate",r,null,!0):yield*this._findInIndex(a.subjects,null,null,null,"subject","predicate","object",r,null,!0))}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,r){for(const s of this.readQuads(e,n,i,r))if(t(s))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.inDefaultGraph=function(t){return s(t.graph)},n.isBlankNode=function(t){return!!t&&"BlankNode"===t.termType},n.isDefaultGraph=s,n.isLiteral=function(t){return!!t&&"Literal"===t.termType},n.isNamedNode=function(t){return!!t&&"NamedNode"===t.termType},n.isVariable=function(t){return!!t&&"Variable"===t.termType},n.prefix=function(t,e){return o({"":t.value||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}function m(t){return t.replace(/[\]\/\(\)\*\+\?\.\\\$]/g,"\\$&")}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._prefixIRIs=Object.create(null),e.prefixes&&this.addPrefixes(e.prefixes),e.baseIRI&&(this._baseMatcher=new RegExp(`^${m(e.baseIRI)}${e.baseIRI.endsWith("/")?"":"[#?]"}`),this._baseLength=e.baseIRI.length))}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._baseMatcher&&this._baseMatcher.test(e)&&(e=e.substr(this._baseLength)),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=m(t),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,"BlankNode",{enumerable:!0,get:function(){return u.BlankNode}}),Object.defineProperty(n,"DataFactory",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(n,"DefaultGraph",{enumerable:!0,get:function(){return u.DefaultGraph}}),Object.defineProperty(n,"Lexer",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(n,"Literal",{enumerable:!0,get:function(){return u.Literal}}),Object.defineProperty(n,"NamedNode",{enumerable:!0,get:function(){return u.NamedNode}}),Object.defineProperty(n,"Parser",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(n,"Quad",{enumerable:!0,get:function(){return u.Quad}}),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,"Term",{enumerable:!0,get:function(){return u.Term}}),Object.defineProperty(n,"Triple",{enumerable:!0,get:function(){return u.Triple}}),n.Util=void 0,Object.defineProperty(n,"Variable",{enumerable:!0,get:function(){return u.Variable}}),Object.defineProperty(n,"Writer",{enumerable:!0,get:function(){return s.default}}),n.default=void 0,Object.defineProperty(n,"termFromId",{enumerable:!0,get:function(){return u.termFromId}}),Object.defineProperty(n,"termToId",{enumerable:!0,get:function(){return u.termToId}});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}}n.default={Lexer:i.default,Parser:r.default,Writer:s.default,Store:o.default,StreamParser:a.default,StreamWriter:l.default,Util:c,DataFactory:u.default,Term:u.Term,NamedNode:u.NamedNode,Literal:u.Literal,BlankNode:u.BlankNode,Variable:u.Variable,DefaultGraph:u.DefaultGraph,Quad:u.Quad,Triple:u.Triple,termFromId:u.termFromId,termToId:u.termToId}},{"./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=vt({},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=vt({},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):I(t,o)):T(t,o,e,!1)}else i||(o.reading=!1,I(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 A(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(M,t))}function M(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 I(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):A(this),null;if(0===(t=P(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},E.prototype._read=function(t){x(this,new _("_read()"))},E.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},E.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?A(this):r.reading||n.nextTick(N,this)),i},E.prototype.removeListener=function(t,e){var i=o.prototype.removeListener.call(this,t,e);return"readable"===t&&n.nextTick(R,this),i},E.prototype.removeAllListeners=function(t){var e=o.prototype.removeAllListeners.apply(this,arguments);return("readable"===t||void 0===t)&&n.nextTick(R,this),e},E.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},E.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},E.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(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(t,e,n){n(new g("_write()"))},E.prototype._writev=null,E.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,I(t,e),i&&(e.finished?n.nextTick(i):t.once("finish",i)),e.ended=!0,t.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(t){!this._writableState||(this._writableState.destroyed=t)}}),E.prototype.destroy=h.destroy,E.prototype._undestroy=h.undestroy,E.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?(M(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:(I(e),">"===s?N(e):"/"===s?e.state=S.OPEN_TAG_SLASH:(g(s)||M(e,"Invalid character in tag name"),e.state=S.ATTRIB));continue;case S.OPEN_TAG_SLASH:">"===s?(N(e,!0),L(e)):(M(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):M(e,"Invalid attribute name");continue;case S.ATTRIB_NAME:"="===s?e.state=S.ATTRIB_VALUE:">"===s?(M(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:M(e,"Invalid attribute name");continue;case S.ATTRIB_NAME_SAW_WHITE:if("="===s)e.state=S.ATTRIB_VALUE;else{if(g(s))continue;M(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):(M(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):(M(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)?(M(e,"No whitespace between attributes"),e.attribName=s,e.attribValue="",e.state=S.ATTRIB_NAME):M(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):M(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:(M(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:P(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 C 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[C]]=C;function E(t,e,n){t[e]&&t[e](n)}function O(t,e,n){t.textNode&&T(t),E(t,e,n)}function T(t){t.textNode=k(t.opt,t.textNode),t.textNode&&E(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 P(t,e){return T(t),t.trackPosition&&(e+="\nLine: "+t.line+"\nColumn: "+t.column+"\nChar: "+t.c),e=new Error(e),t.error=e,E(t,"onerror",e),t}function A(t){return t.sawRoot&&!t.closedRoot&&M(t,"Unclosed root tag"),t.state!==S.BEGIN&&t.state!==S.BEGIN_WHITESPACE&&t.state!==S.TEXT&&P(t,"Unexpected end"),T(t),t.c="",t.closed=!0,E(t,"onend"),s.call(t,t.strict,t.opt),t}function M(t,e){if("object"!=typeof t||!(t instanceof s))throw new Error("bad call to strictFail");t.strict&&P(t,e)}function I(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)M(t,"xml: prefix must be bound to "+l+"\nActual: "+t.attribValue);else if("xmlns"===n&&t.attribValue!==c)M(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&&(M(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;)M(t,"Unexpected close tag");if(e<0)return M(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?(M(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)||(M(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=0?1.2:1))}function i(t,e,n,i,s,o){for(var a=0;a-1);o[++c]=l,a[c]=u,a[c+1]=e}for(l=0,c=0;l{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=A(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):P.call(t,e)},w.prototype.listenerCount=P,w.prototype.eventNames=function(){return this._eventsCount>0?m(this._events):[]},I.prototype.next=function(){if(this.done)return{done:!0};var t=this._next();return t.done&&(this.done=!0),t},"undefined"!=typeof Symbol&&(I.prototype[Symbol.iterator]=function(){return this}),I.of=function(){var t=arguments,e=t.length,n=0;return new I(function(){return n>=e?{done:!0}:{done:!1,value:t[n++]}})},I.empty=function(){var t=new I(null);return t.done=!0,t},I.is=function(t){return t instanceof I||"object"==typeof t&&null!==t&&"function"==typeof t.next};var D=I,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 Ct(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 Et(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 Pt(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 At(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 Mt(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 It(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?It(!1,this,t):Mt(!1,this,t)},i.forEachUntil=function(t){if("function"!=typeof t)throw new L("Graph.forEach: expecting a callback.");this.multi?It(!0,this,t):Mt(!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 At(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 Ct(n,n.undirected,i);if("string"==typeof e)return Ct(n,n[e],i)}var r=new Set;"undirected"!==t&&("out"!==e&&Et(r,n,n.in,i),"in"!==e&&Et(r,n,n.out,i)),"directed"!==t&&Et(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,Pt(r,n,n.in))),"in"!==e&&(i=q(i,Pt(r,n,n.out)))),"directed"!==t&&(i=q(i,Pt(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 P(t,e,n){if(t.indexOf&&!n)return t.indexOf(e);for(var i=0;in[e]}):i.sort()),i}function I(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&&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)},destroy: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)}};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=P(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=A(t.touches),i=A(t.changedTouches);return 12&e&&(n=M(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=A(t.touches),i=this.targetIds;if(3&e&&1===n.length)return i[n[0].identifier]=!0,[n,n];var r,s,o=A(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 Mt.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=Pt(t.direction);e&&(t.additionalEvent=this.options.event+e),this._super.emit.call(this,t)}}),_(Dt,Mt,{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,Mt,{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,Mt,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:30,pointers:1},getTouchAction:function(){return It.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=Pt(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",Ct="A-Z\\xc0-\\xd6\\xd8-\\xde",Et="\\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+"]",Pt="["+wt+"]",At="\\d+",Mt="["+xt+"]",It="["+St+"]",Dt="[^"+_t+Ot+At+xt+St+Ct+"]",Rt="\\ud83c[\\udffb-\\udfff]",Nt="[^"+_t+"]",Lt="(?:\\ud83c[\\udde6-\\uddff]){2}",jt="[\\ud800-\\udbff][\\udc00-\\udfff]",Ft="["+Ct+"]",Bt="(?:"+It+"|"+Dt+")",Vt="(?:"+Ft+"|"+Dt+")",zt="(?:['\u2019](?:d|ll|m|re|s|t|ve))?",Ut="(?:['\u2019](?:D|LL|M|RE|S|T|VE))?",Ht="(?:"+Pt+"|"+Rt+")?",$t="["+Et+"]?",Gt=$t+Ht+"(?:\\u200d(?:"+[Nt,Lt,jt].join("|")+")"+$t+Ht+")*",Wt="(?:"+[Mt,Lt,jt].join("|")+")"+Gt,qt="(?:"+[Nt+Pt+"?",Pt,Lt,jt,Tt].join("|")+")",Xt=RegExp("['\u2019]","g"),Yt=RegExp(Pt,"g"),Kt=RegExp(Rt+"(?="+Rt+")|"+qt+Gt,"g"),Qt=RegExp([Ft+"?"+It+"+"+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_])",At,Wt].join("|"),"g"),Zt=RegExp("[\\u200d"+_t+wt+Et+"]"),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[I]=ne[D]=ne[R]=ne[N]=ne[L]=ne[j]=ne[F]=ne[B]=ne[V]=!0,ne[f]=ne[g]=ne[A]=ne[m]=ne[M]=ne[b]=ne[y]=ne[v]=ne[w]=ne[x]=ne[S]=ne[E]=ne[O]=ne[T]=ne[P]=!1;var ie={};ie[f]=ie[g]=ie[A]=ie[M]=ie[m]=ie[b]=ie[I]=ie[D]=ie[R]=ie[N]=ie[L]=ie[w]=ie[x]=ie[S]=ie[E]=ie[O]=ie[T]=ie[k]=ie[j]=ie[F]=ie[B]=ie[V]=!0,ie[y]=ie[v]=ie[P]=!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,Ct=e.RegExp,Et=e.String,Ot=e.TypeError,Tt=i.prototype,kt=St.prototype,Pt=e["__core-js_shared__"],At=wt.prototype.toString,Mt=kt.hasOwnProperty,It=0,Dt=(n=/[^.]+$/.exec(Pt&&Pt.keys&&Pt.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",Rt=kt.toString,Nt=At.call(St),Lt=ce._,jt=Ct("^"+At.call(Mt).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(Ms){}}(),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"),Cn=os(e,"WeakMap"),En=os(St,"create"),On=Cn&&new Cn,Tn={},kn=Ns(_n),Pn=Ns(wn),An=Ns(xn),Mn=Ns(Sn),In=Ns(Cn),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(Mt.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]&&Mt.call(t,"index")&&(n.index=t.index,n.input=t.input),n}(t),!l)return Cr(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 Er(t,ls(t),e)}(t,function(t,e){return t&&Er(e,Aa(e),t)}(a,t)):function(t,e){return Er(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 A:return vr(t);case m:case b:return new i(+t);case M:return function(t,e){var n=e?vr(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}(t,n);case I: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 E: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?Aa:Pa)(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=Pe(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):Ae(r,a):i||(r[r.length]=a)}return r}var fi=Pr(),gi=Pr(!0);function mi(t,e){return t&&fi(t,e,Pa)}function bi(t,e){return t&&gi(t,e,Pa)}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&&Mt.call(t,e)}function Ci(t,e){return null!=t&&e in St(t)}function Ei(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=Pe(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:Pe(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 As(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 Ps(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 As(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){Mt.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)?Ce:ci)(t,is(e,3))}var yo=Or(function(t,e,n){Mt.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)?Pe: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),[])}),Co=ae||function(){return ce.Date.now()};function Eo(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 Po(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=Co();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=Co(),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(Co())},_}var Ao=Gi(function(t,e){return oi(t,1,e)}),Mo=Gi(function(t,e,n){return oi(t,fa(e)||0,n)});function Io(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(Io.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)}}Io.Cache=Hn;var Ro=gr(function(t,e){var n=(e=1==e.length&&Uo(e[0])?Pe(e[0],qe(is())):Pe(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)&&Mt.call(t,"callee")&&!$t.call(t,"callee")},Uo=i.isArray,Ho=ge?qe(ge):function(t){return Jo(t)&&wi(t)==A};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=Mt.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&At.call(n)==Nt}var ia=ye?qe(ye):function(t){return Jo(t)&&wi(t)==E},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):Cr(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 Er(t,Aa(t))}function ma(t){return null==t?"":rr(t)}var ba=Tr(function(t,e){if(ys(e)||$o(e))Er(e,Pa(e),t);else for(var n in e)Mt.call(e,n)&&Qn(t,n,e[n])}),ya=Tr(function(t,e){Er(e,Aa(e),t)}),va=Tr(function(t,e,n,i){Er(e,Aa(e),t,i)}),_a=Tr(function(t,e,n,i){Er(e,Pa(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}),Er(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 Ea(t,n)})}(t,e)});function Na(t,e){if(null==t)return{};var n=Pe(Jr(t),function(t){return[t]});return e=is(e),Vi(t,n,function(t,n){return e(t,n[0])})}var La=Gr(Pa),ja=Gr(Aa);function Fa(t){return null==t?[]:Xe(t,Pa(t))}var Ba=Mr(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=Mr(function(t,e,n){return t+(n?"-":"")+e.toLowerCase()}),Ha=Mr(function(t,e,n){return t+(n?" ":"")+e.toLowerCase()}),$a=Ar("toLowerCase"),Ga=Mr(function(t,e,n){return t+(n?"_":"")+e.toLowerCase()}),Wa=Mr(function(t,e,n){return t+(n?" ":"")+Xa(e)}),qa=Mr(function(t,e,n){return t+(n?" ":"")+e.toUpperCase()}),Xa=Ar("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(Is){return Xo(Is)?Is:new _t(Is)}}),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 Mi("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=Pa(e),r=yi(e,i);null==n&&(!Zo(e)||!r.length&&i.length)&&(n=e,e=t,t=this,r=yi(e,Pa(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__=Cr(this.__actions__);return r.push({func:i,args:arguments,thisArg:t}),n.__chain__=e,n}return i.apply(t,Ae([this.value()],arguments))})}),t}function ol(){}var al=Fr(Pe),ll=Fr(Ee),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=Eo,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&&Ae(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),Po(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)?Pe(t,Rs):oa(t)?[t]:Cr(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 Eo(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,Aa(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,Pa(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)?Ee: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),Aa)},Ln.forInRight=function(t,e){return null==t?t:gi(t,is(e,3),Aa)},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=Ca,Ln.gt=Bo,Ln.gte=Vo,Ln.has=function(t,e){return null!=t&&us(t,e,Si)},Ln.hasIn=Ea,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)==P},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=Co,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)?Me:He,r=arguments.length<3;return i(t,is(e,4),n,r,li)},Ln.reduceRight=function(t,e,n){var i=Uo(t)?Ie: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=Ct(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=++It;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){Mt.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,Ae([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+"";Mt.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__=Cr(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=Cr(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=Cr(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},A=i.exports.defaults,M=w,I=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:M(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=M(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:I(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=M(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=C,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=E,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,"qs",{enumerable:!0,get:function(){return o.default}});var s=n(41151),o=(l(n(61602)),l(n(97310)));i(n(22344));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)}function l(t,e){if(!e&&t&&t.__esModule)return t;if(null===t||"object"!==r(t)&&"function"!=typeof t)return{default:t};var n=a(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 l=s?Object.getOwnPropertyDescriptor(t,o):null;l&&(l.get||l.set)?Object.defineProperty(i,o,l):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)},51316:function(t,e,n){"use strict";var i={};n.r(i),n.d(i,{decode:function(){return xj},encode:function(){return Cj}});var r={};n.r(r),n.d(r,{decode:function(){return Aj},encode:function(){return Ij}});var s={};n.r(s),n.d(s,{decode:function(){return Dj},encode:function(){return Nj}});var o={};function a(t){return"function"==typeof t}n.r(o),n.d(o,{decode:function(){return jj},encode:function(){return Bj}});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 C(t)}function C(t){return 0===t.length?x:1===t.length?t[0]:function(e){return t.reduce((t,e)=>e(t),e)}}let E=(()=>{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:C(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 P extends v{constructor(t){super(t),this.destination=t}}let A=(()=>{class t extends E{constructor(){super(),this.observers=[],this.closed=!1,this.isStopped=!1,this.hasError=!1,this.thrownError=null}[y](){return new P(this)}lift(t){const e=new M(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 M(t,e),t})();class M extends A{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 I(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 E(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 E(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 E(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 E(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 E?t:new E(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 E)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 E(L(t))}function Q(...t){let e=Number.POSITIVE_INFINITY,n=null,i=t[t.length-1];return I(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 E?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 E{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 P{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 A}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 bt(t){return"string"==typeof t?t:null==t?"":String(t)}function yt(t){return"function"==typeof t?t.name||t.toString():"object"==typeof t&&null!=t&&"function"==typeof t.type?t.type.name||t.type.toString():bt(t)}function _t(t,e){const n=e?` in ${e}`:"";throw new mt("201",`No provider for ${yt(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 Ct(t){return Et(t,Tt)||Et(t,Pt)}function Et(t,e){return t.hasOwnProperty(e)?t[e]:null}function Ot(t){return t&&(t.hasOwnProperty(kt)||t.hasOwnProperty(At))?t[kt]:null}const Tt=lt({"\u0275prov":lt}),kt=lt({"\u0275inj":lt}),Pt=lt({ngInjectableDef:lt}),At=lt({ngInjectorDef:lt});var Mt=(()=>((Mt=Mt||{})[Mt.Default=0]="Default",Mt[Mt.Host=1]="Host",Mt[Mt.Self=2]="Self",Mt[Mt.SkipSelf=4]="SkipSelf",Mt[Mt.Optional=8]="Optional",Mt))();let It;function Dt(t){const e=It;return It=t,e}function Rt(t,e,n){const i=Ct(t);return i&&"root"==i.providedIn?void 0===i.value?i.value=i.factory():i.value:n&Mt.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 Ce="http://www.w3.org/2000/svg";let Ee;function Oe(){return void 0!==Ee?Ee:"undefined"!=typeof document?document:void 0}function Te(t){return!!t.listen}const ke={createRenderer:(t,e)=>Oe()};function Pe(t){for(;Array.isArray(t);)t=t[0];return t}function Ae(t,e){return Pe(e[t])}function Me(t,e){return Pe(e[t.index])}function Ie(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&Mt.SkipSelf){let i=e,r=t;for(;!(i=i.parent,null!==i||n&Mt.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 Ie(t.tView,t.selectedIndex)}function vn(){Ve.lFrame.currentNamespace=Ce}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=Un(t,e),s=t.injectorIndex;if(In(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 Un(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 Hn(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:Xn:e}(n);if("function"==typeof s){if(!cn(e,t,i))return i&Mt.Host?$n(r,n,i):Gn(e,n,i,r);try{const t=s(i);if(null!=t||i&Mt.Optional)return t;_t(n)}finally{fn()}}else if("number"==typeof s){let r=null,o=Vn(t,e),a=-1,l=i&Mt.Host?e[16][6]:null;for((-1===o||i&Mt.SkipSelf)&&(a=-1===o?Un(t,e):e[o+8],-1!==a&&Jn(i,!1)?(r=e[1],o=Dn(a),e=Rn(a,e)):o=-1);-1!==o;){const t=e[1];if(Zn(s,o,t.data)){const t=Yn(o,e,n,r,i,l);if(t!==qn)return t}a=e[o+8],-1!==a&&Jn(i,e[1].data[o+8]===l)&&Zn(s,o,e)?(r=t,o=Dn(a),e=Rn(a,e)):o=-1}}}return Gn(e,n,i,r)}const qn={};function Xn(){return new ti(Ge(),Ue())}function Yn(t,e,n,i,r,s){const o=e[1],a=o.data[t+8],l=Kn(a,o,n,null==i?de(a)&&Nn:i!=o&&0!=(3&a.type),r&Mt.Host&&s===a);return null!==l?Qn(e,o,l,a):qn}function Kn(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 Qn(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}`)}(yt(s[n]));const a=Ln(o.canSeeViewProviders);o.resolving=!0;const l=o.injectImpl?Dt(o.injectImpl):null;cn(t,i,Mt.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 Zn(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 Mi=ki(si("Inject",t=>({token:t})),-1),Ii=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(),bt(t))}function _r(t){const e=xr();return e?e.sanitize(yr.URL,t)||"":qi(t,"URL")?Wi(t):Ji(bt(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 Cr(t,e){t[Sr]=e}function Er(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 Pr=(()=>("undefined"!=typeof requestAnimationFrame&&requestAnimationFrame||setTimeout).bind(Ut))();function Ar(t){return t.ownerDocument.defaultView}function Mr(t){return t.ownerDocument}function Ir(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 Nr(t){const e=t[3];return ue(e)?e[3]:e}function Lr(t){return Fr(t[13])}function jr(t){return Fr(t[4])}function Fr(t){for(;null!==t&&!ue(t);)t=t[4];return t}function Br(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=Pe(i);0===t&&null!==n?null==r?qr(e,n,a):Wr(e,n,a,r||null,!0):1===t&&null!==n?Wr(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!==Pe(n)&&Br(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 Hr(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 $r(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)&&$r(e[1],e),e=e[3];null===e&&(e=t),ce(e)&&$r(e[1],e),n=e&&e[4]}e=n}}(e)}}function $r(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 Cs(t){return t>>17&32767}function Es(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 Ps(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=Lr(t);null!==n;n=jr(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,Mo(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=Mt.Default){this.assertNotDestroyed();const i=Si(this),r=Dt(void 0);try{if(!(n&Mt.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)&&Ct(t);e=n&&this.injectableDefInScope(n)?Mo(Po(t),So):null,this.records.set(t,e)}if(null!=e)return this.hydrate(t,e)}return(n&Mt.Self?Oo():this.parent).get(t,e=n&Mt.Optional&&e===mi?null:e)}catch(s){if("NullInjectorError"===s.name){if((s[yi]=s[yi]||[]).unshift(ut(t)),i)throw s;return Ai(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,Mo(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 Io(t)?Mo(void 0,t.useValue):Mo(Ao(t),So)}(t);if(Do(t)||!0!==t.multi)this.records.get(i);else{let e=this.records.get(i);e||(e=Mo(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=Co,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 Po(t){const e=Ct(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[Pt]);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 Ao(t,e,n){let i;if(Do(t)){const e=ft(t);return me(e)||Po(e)}if(Io(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=()=>Ei(ft(t.useExisting));else{const e=ft(t&&(t.useClass||t.provide));if(!function(t){return!!t.deps}(t))return me(e)||Po(e);i=()=>new e(...Ti(t.deps))}return i}function Mo(t,e,n=!1){return{factory:t,value:e,multi:n?[]:void 0}}function Io(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(Er(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=An(r.hostAttrs,n=An(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:()=>Ei(_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(Pe(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 Pa(t){return t.substring(Ta.value,Ta.valueEnd)}function Aa(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 Ma(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 Ia(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=Ma(e,n))Xa(t,ka(e),Pa(e))}function Va(t){Ha(pi,za,t,!0)}function za(t,e){for(let n=function(t){return Ia(t),Aa(t,Da(t,0,Ta.textEnd))}(e);n>=0;n=Aa(e,n))pi(t,ka(e),!0)}function Ua(t,e,n,i){const r=Ue(),s=He(),o=en(2);s.firstUpdatePass&&Ga(s,t,o,i),e!==_s&&Xo(r,o,e)&&Ya(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 Ha(t,e,n,i){const r=He(),s=en(2);r.firstUpdatePass&&Ga(r,null,s,i);const o=Ue();if(n!==_s&&Xo(o,s,n)){const a=r.data[mn()];if(Za(a,i)&&!$a(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 Ga(t,e,n,i){const r=t.data;if(null===r[n+1]){const s=r[mn()],o=$a(t,n);Za(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=qa(n=Wa(null,t,e,n,i),e.attrs,i),s=null);else{const o=e.directiveStylingLast;if(-1===o||t[o]!==r)if(n=Wa(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[Cs(i)]}(t,e,i);void 0!==n&&Array.isArray(n)&&(n=Wa(null,t,e,n[1],i),n=qa(n,e.attrs,i),function(t,e,n,i){t[Cs(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=Cs(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]=Es(t[i+1])),Ea(t,c,i,!0),Ea(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 Wa(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&&!Qa(h)&&(h=fi(e,i)),Qa(h)&&(a=h,o))return a;const d=t[r+1];r=o?Cs(d):Os(d)}if(null!==e){let t=s?e.residualClasses:e.residualStyles;null!=t&&(a=fi(t,i))}return a}function Qa(t){return void 0!==t}function Za(t,e){return 0!=(t.flags&(e?16:32))}function Ja(t,e=""){const n=Ue(),i=He(),r=t+20,s=i.firstCreatePass?Ms(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 tl(t){return el("",t,""),tl}function el(t,e,n){const i=Ue(),r=Qo(i,t,e,n);return r!==_s&&yo(i,mn(),r),el}function nl(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+bt(n)+i+bt(r)+s:_s}(s,t,e,n,i,r);return o!==_s&&yo(s,mn(),o),nl}function il(t,e,n){Ha(pi,za,Qo(Ue(),t,e,n),!0)}function rl(t,e,n){const i=Ue();return Xo(i,tn(),e)&&$s(He(),yn(),i,t,e,i[11],n,!0),rl}function sl(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 sl}const ol=void 0;var al=["en",[["a","p"],["AM","PM"],ol],[["AM","PM"],ol,ol],[["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"]],ol,[["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"]],ol,[["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}",ol,"{1} 'at' {0}",ol],[".",",",";","%","+","-","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 ll={};function cl(t){const e=function(t){return t.toLowerCase().replace(/_/g,"-")}(t);let n=ul(e);if(n)return n;const i=e.split("-")[0];if(n=ul(i),n)return n;if("en"===i)return al;throw new Error(`Missing locale data for the locale "${t}".`)}function ul(t){return t in ll||(ll[t]=Ut.ng&&Ut.ng.common&&Ut.ng.common.locales&&Ut.ng.common.locales[t]),ll[t]}var hl=(()=>((hl=hl||{})[hl.LocaleId=0]="LocaleId",hl[hl.DayPeriodsFormat=1]="DayPeriodsFormat",hl[hl.DayPeriodsStandalone=2]="DayPeriodsStandalone",hl[hl.DaysFormat=3]="DaysFormat",hl[hl.DaysStandalone=4]="DaysStandalone",hl[hl.MonthsFormat=5]="MonthsFormat",hl[hl.MonthsStandalone=6]="MonthsStandalone",hl[hl.Eras=7]="Eras",hl[hl.FirstDayOfWeek=8]="FirstDayOfWeek",hl[hl.WeekendRange=9]="WeekendRange",hl[hl.DateFormat=10]="DateFormat",hl[hl.TimeFormat=11]="TimeFormat",hl[hl.DateTimeFormat=12]="DateTimeFormat",hl[hl.NumberSymbols=13]="NumberSymbols",hl[hl.NumberFormats=14]="NumberFormats",hl[hl.CurrencyCode=15]="CurrencyCode",hl[hl.CurrencySymbol=16]="CurrencySymbol",hl[hl.CurrencyName=17]="CurrencyName",hl[hl.Currencies=18]="Currencies",hl[hl.Directionality=19]="Directionality",hl[hl.PluralCase=20]="PluralCase",hl[hl.ExtraData=21]="ExtraData",hl))();const dl="en-US";let pl=dl;function fl(t){wt(t,"Expected localeId to be defined"),"string"==typeof t&&(pl=t.toLowerCase().replace(/_/g,"-"))}function gl(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=yl(a,e,r?u:u+d,h);-1===p?(Hn(Fn(c,o),s,a),ml(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=yl(a,e,u+d,h),f=yl(a,e,u,u+d),g=p>=0&&n[p],m=f>=0&&n[f];if(r&&!m||!r&&!g){Hn(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,bl(s,r,i&&!n),s}(r?_l:vl,n.length,r,i,l);!r&&m&&(n[f].providerFactory=u),ml(s,t,e.length,0),e.push(a),c.directiveStart++,c.directiveEnd++,r&&(c.providerIndexes+=1048576),n.push(u),o.push(u)}else ml(s,t,p>-1?p:f,bl(n[r?f:p],l,!r&&i));!r&&i&&m&&n[f].componentProviders++}}}function ml(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 bl(t,e,n){return n&&t.componentProviders++,t.multi.push(e)-1}function yl(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);gl(n,i.data,i.blueprint,r,!0),gl(e,i.data,i.blueprint,r,!1)}}(n,i?i(t):t,e)}}class Sl{}const Cl="ngComponent";class El{resolveComponentFactory(t){throw function(t){const e=Error(`No component factory found for ${ut(t)}. Did you add it to @NgModule.entryComponents?`);return e[Cl]=t,e}(t)}}class Ol{}function Tl(...t){}function kl(t,e){return new Al(Me(t,e))}Ol.NULL=new El;const Pl=function(){return kl(Ge(),Ue())};let Al=(()=>{class t{constructor(t){this.nativeElement=t}}return t.__NG_ELEMENT_ID__=Pl,t})();function Ml(t){return t instanceof Al?t.nativeElement:t}class Il{}let Dl=(()=>{class t{}return t.__NG_ELEMENT_ID__=()=>Rl(),t})();const Rl=function(){const t=Ue(),e=Re(Ge().index,t);return function(t){return t[11]}(ce(e)?e:t)};let Nl=(()=>{class t{}return t.\u0275prov=xt({token:t,providedIn:"root",factory:()=>null}),t})();class Ll{constructor(t){this.full=t,this.major=t.split(".")[0],this.minor=t.split(".")[1],this.patch=t.split(".").slice(2).join(".")}}const jl=new Ll("12.2.5");class Fl{constructor(){}supports(t){return Go(t)}create(t){return new Vl(t)}}const Bl=(t,e)=>e;class Vl{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||Bl}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<$l(n,i,r)?e:n,o=$l(s,i,r),a=s.currentIndex;if(s===n)i--,n=n._nextRemoved;else if(e=e._next,null==s.previousIndex)i++;else{r||(r=[]);const t=o-i,e=a-i;if(t!=e){for(let n=0;n{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 zl(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 Hl),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 Hl),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 zl{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 Ul{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 Hl{constructor(){this.map=new Map}put(t){const e=t.trackById;let n=this.map.get(e);n||(n=new Ul,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 $l(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 ql(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 ql{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 Xl(){return new Yl([new Fl])}let Yl=(()=>{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||Xl()),deps:[[t,new Di,new Ii]]}}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:Xl}),t})();function Kl(){return new Ql([new Gl])}let Ql=(()=>{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||Kl()),deps:[[t,new Di,new Ii]]}}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:Kl}),t})();function Zl(t,e,n,i,r=!1){for(;null!==n;){const s=e[n.index];if(null!==s&&i.push(Pe(s)),ue(s))for(let t=10;t-1&&(Ur(t,n),hi(e,n))}this._attachedToViewContainer=!1}Hr(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 tc extends Jl{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 ec=function(t){return function(t,e,n){if(de(t)&&!n){const n=Re(t.index,e);return new Jl(n,n)}return 47&t.type?new Jl(e[16],e):null}(Ge(),Ue(),16==(16&t))};let nc=(()=>{class t{}return t.__NG_ELEMENT_ID__=ec,t})();const ic=[new Gl],rc=new Yl([new Fl]),sc=new Ql(ic),oc=function(){return uc(Ge(),Ue())};let ac=(()=>{class t{}return t.__NG_ELEMENT_ID__=oc,t})();const lc=ac,cc=class extends lc{constructor(t,e,n){super(),this._declarationLView=t,this._declarationTContainer=e,this.elementRef=n}createEmbeddedView(t){const e=this._declarationTContainer.tViews,n=As(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 Jl(n)}};function uc(t,e){return 4&t.type?new cc(e,t,kl(t,e)):null}class hc{}const dc=function(){return yc(Ge(),Ue())};let pc=(()=>{class t{}return t.__NG_ELEMENT_ID__=dc,t})();const fc=pc,gc=class extends fc{constructor(t,e,n){super(),this._lContainer=t,this._hostTNode=e,this._hostLView=n}get element(){return kl(this._hostTNode,this._hostLView)}get injector(){return new ti(this._hostTNode,this._hostLView)}get parentInjector(){const t=Un(this._hostTNode,this._hostLView);if(In(t)){const e=Rn(t,this._hostLView),n=Dn(t);return new ti(e[1].data[n+8],e)}return new ti(null,this._hostLView)}clear(){for(;this.length>0;)this.remove(this.length-1)}get(t){const e=mc(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(hc,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 gc(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),iPr});class Sc extends Sl{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 wc(this.componentDef.inputs)}get outputs(){return wc(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,vc,r);return s!==vc||i===vc?s:e.get(n,i,r)}}}(t,i.injector):t,s=r.get(Il,ke),o=r.get(Nl,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):Vr(s.createRenderer(null,this.componentDef),l,function(t){const e=t.toLowerCase();return"svg"===e?Ce:"math"===e?"http://www.w3.org/1998/MathML/":null}(l)),u=this.componentDef.onPush?576:528,h=function(t,e){return{components:[],scheduler:t||Pr,clean:ho,playerHandler:e||null,flags:0}}(),d=zs(0,null,null,1,0,null,null,null,null,null),p=As(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=Ms(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=As(n,Vs(e),null,e.onPush?64:16,n[20],a,i,c,s||null,null);return o.firstCreatePass&&(Hn(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",jl.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=Ie(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 Cc(this.componentType,f,kl(g,p),p,g)}}class Cc 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 tc(i),this.componentType=t}get injector(){return new ti(this._tNode,this._rootLView)}destroy(){this.hostView.destroy()}onDestroy(t){this.hostView.onDestroy(t)}}const Ec=new Map;class Oc extends hc{constructor(t,e){super(),this._parent=e,this._bootstrapComponents=[],this.injector=this,this.destroyCbs=[],this.componentFactoryResolver=new _c(this);const n=le(t),i=function(t){return t[Yt]||null}(t);i&&fl(i),this._bootstrapComponents=Ir(n.bootstrap),this._r3Injector=To(t,e,[{provide:hc,useValue:this},{provide:Ol,useValue:this.componentFactoryResolver}],ut(t)),this._r3Injector._resolveInjectorDefTypes(),this.instance=this.get(t)}get(t,e=No.THROW_IF_NOT_FOUND,n=Mt.Default){return t===No||t===hc||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 Tc 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,Ec.get(r),n),Ec.set(r,n));const s=Ir(i.imports);for(const o of s)e.has(o)||(e.add(o),t(o))}(t)}(t)}create(t){return new Oc(this.moduleType,t)}}function kc(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 Pc(t,e,n,i){return Ic(Ue(),Ze(),t,e,n,i)}function Ac(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)):Mc(t,l+3)}(Ue(),Ze(),t,e,n,i,r,s)}function Mc(t,e){const n=t[e];return n===_s?void 0:n}function Ic(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)):Mc(t,o+1)}function Dc(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 Rc(t,e,n){const i=t+20,r=Ue(),s=De(r,i);return jc(r,Lc(r,i)?Ic(r,Ze(),e,s.transform,n,s):s.transform(n))}function Nc(t,e,n,i){const r=t+20,s=Ue(),o=De(s,r);return jc(s,Lc(s,r)?function(t,e,n,i,r,s,o){const a=e+n;return Yo(t,a,r,s)?qo(t,a+2,o?i.call(o,r,s):i(r,s)):Mc(t,a+2)}(s,Ze(),e,o.transform,n,i,o):o.transform(n,i))}function Lc(t,e){return t[1].data[e].pure}function jc(t,e){return $o.isWrapped(e)&&(e=$o.unwrap(e),t[Je()]=_s),e}function Fc(t){return e=>{setTimeout(t,void 0,e)}}const Bc=class extends A{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=Fc(a),o&&(o=Fc(o)),l&&(l=Fc(l)));const c=super.subscribe({next:o,error:a,complete:l});return t instanceof g&&t.add(c),c}};function Vc(){return this._results[Ho()]()}class zc{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=zc.prototype;n[e]||(n[e]=Vc)}get changes(){return this._changes||(this._changes=new Bc)}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=Tl,this.reject=Tl,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)(Ei(su,8))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();const au=new oi("AppId"),lu={provide:au,useFactory:function(){return`${cu()}${cu()}${cu()}`},deps:[]};function cu(){return String.fromCharCode(97+Math.floor(25*Math.random()))}const uu=new oi("Platform Initializer"),hu=new oi("Platform ID"),du=new oi("appBootstrapListener");let pu=(()=>{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 fu=new oi("LocaleId"),gu=new oi("DefaultCurrencyCode");class mu{constructor(t,e){this.ngModuleFactory=t,this.componentFactories=e}}const bu=function(t){return new Tc(t)},yu=bu,vu=function(t){return Promise.resolve(bu(t))},_u=function(t){const e=bu(t),n=Ir(le(t).declarations).reduce((t,e)=>{const n=ae(e);return n&&t.push(new Sc(n)),t},[]);return new mu(e,n)},wu=_u,xu=function(t){return Promise.resolve(_u(t))};let Su=(()=>{class t{constructor(){this.compileModuleSync=yu,this.compileModuleAsync=vu,this.compileModuleAndAllComponentsSync=wu,this.compileModuleAndAllComponentsAsync=xu}clearCache(){}clearCacheFor(t){}getModuleId(t){}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();const Cu=new oi("compilerOptions"),Eu=(()=>Promise.resolve(0))();function Ou(t){"undefined"==typeof Zone?Eu.then(()=>{t&&t.apply(null,null)}):Zone.current.scheduleMicroTask("scheduleMicrotask",t)}class Tu{constructor({enableLongStackTrace:t=!1,shouldCoalesceEventChangeDetection:e=!1,shouldCoalesceRunChangeDetection:n=!1}){if(this.hasPendingMacrotasks=!1,this.hasPendingMicrotasks=!1,this.isStable=!0,this.onUnstable=new Bc(!1),this.onMicrotaskEmpty=new Bc(!1),this.onStable=new Bc(!1),this.onError=new Bc(!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,Au(t),t.isCheckStableRunning=!0,Pu(t),t.isCheckStableRunning=!1},void 0,()=>{},()=>{})),t.fakeTopEventTask.invoke()}),Au(t))}(t)};t._inner=t._inner.fork({name:"angular",properties:{isAngularZone:!0},onInvokeTask:(n,i,r,s,o,a)=>{try{return Mu(t),n.invokeTask(r,s,o,a)}finally{(t.shouldCoalesceEventChangeDetection&&"eventTask"===s.type||t.shouldCoalesceRunChangeDetection)&&e(),Iu(t)}},onInvoke:(n,i,r,s,o,a,l)=>{try{return Mu(t),n.invoke(r,s,o,a,l)}finally{t.shouldCoalesceRunChangeDetection&&e(),Iu(t)}},onHasTask:(e,n,i,r)=>{e.hasTask(i,r),n===i&&("microTask"==r.change?(t._hasPendingMicrotasks=r.microTask,Au(t),Pu(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(!Tu.isInAngularZone())throw new Error("Expected to be in Angular Zone, but it is not!")}static assertNotInAngularZone(){if(Tu.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,ku,Tl,Tl);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 ku={};function Pu(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 Au(t){t.hasPendingMicrotasks=!!(t._hasPendingMicrotasks||(t.shouldCoalesceEventChangeDetection||t.shouldCoalesceRunChangeDetection)&&-1!==t.lastRequestAnimationFrameId)}function Mu(t){t._nesting++,t.isStable&&(t.isStable=!1,t.onUnstable.emit(null))}function Iu(t){t._nesting--,Pu(t)}class Du{constructor(){this.hasPendingMicrotasks=!1,this.hasPendingMacrotasks=!1,this.isStable=!0,this.onUnstable=new Bc,this.onMicrotaskEmpty=new Bc,this.onStable=new Bc,this.onError=new Bc}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 Ru=(()=>{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:()=>{Tu.assertNotInAngularZone(),Ou(()=>{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())Ou(()=>{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)(Ei(Tu))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),Nu=(()=>{class t{constructor(){this._applications=new Map,ju.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 ju.findTestabilityInTree(this,t,e)}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();class Lu{addToWindow(t){}findTestabilityInTree(t,e,n){return null}}let ju=new Lu,Fu=!0,Bu=!1;function Vu(){return Bu=!0,Fu}let zu;const Uu=new oi("AllowMultipleToken");function Hu(t,e,n=[]){const i=`Platform: ${e}`,r=new oi(i);return(e=[])=>{let s=$u();if(!s||s.injector.get(Uu,!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(zu&&!zu.destroyed&&!zu.injector.get(Uu,!1))throw new Error("There can be only one platform. Destroy the previous one to create a new one.");zu=t.get(Gu);const e=t.get(uu,null);e&&e.forEach(t=>t())}(No.create({providers:t,name:i}))}return function(t){const e=$u();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 $u(){return zu&&!zu.destroyed?zu:null}let Gu=(()=>{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 Du:("zone.js"===t?void 0:t)||new Tu({enableLongStackTrace:Vu(),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:Tu,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(()=>{Xu(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(ou);return t.runInitializers(),t.donePromise.then(()=>(fl(s.injector.get(fu,dl)||dl),this._moduleDoBootstrap(s),s))})})}bootstrapModule(t,e=[]){const n=Wu({},e);return function(t,e,n){const i=new Tc(n);return Promise.resolve(i)}(0,0,t).then(t=>this.bootstrapModuleFactory(t,n))}_moduleDoBootstrap(t){const e=t.injector.get(qu);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)(Ei(No))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();function Wu(t,e){return Array.isArray(e)?e.reduce(Wu,t):Object.assign(Object.assign({},t),e)}let qu=(()=>{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 E(t=>{this._stable=this._zone.isStable&&!this._zone.hasPendingMacrotasks&&!this._zone.hasPendingMicrotasks,this._zone.runOutsideAngular(()=>{t.next(this._stable),t.complete()})}),o=new E(t=>{let e;this._zone.runOutsideAngular(()=>{e=this._zone.onStable.subscribe(()=>{Tu.assertNotInAngularZone(),Ou(()=>{!this._stable&&!this._zone.hasPendingMacrotasks&&!this._zone.hasPendingMicrotasks&&(this._stable=!0,t.next(!0))})})});const n=this._zone.onUnstable.subscribe(()=>{Tu.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 Sl?t:this._componentFactoryResolver.resolveComponentFactory(t),this.componentTypes.push(n.componentType);const i=function(t){return t.isBoundToModule}(n)?void 0:this._injector.get(hc),r=n.create(No.NULL,[],e||n.selector,i),s=r.location.nativeElement,o=r.injector.get(Ru,null),a=o&&r.injector.get(Nu);return o&&a&&a.registerApplication(s,o),r.onDestroy(()=>{this.detachView(r.hostView),Xu(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;Xu(this._views,e),e.detachFromAppRef()}_loadComponent(t){this.attachView(t.hostView),this.tick(),this.components.push(t),this._injector.get(du,[]).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)(Ei(Tu),Ei(No),Ei(kr),Ei(Ol),Ei(ou))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();function Xu(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const Yu=Hu(null,"core",[{provide:hu,useValue:"unknown"},{provide:Gu,deps:[No]},{provide:Nu,deps:[]},{provide:pu,deps:[]}]),Ku=[{provide:qu,useClass:qu,deps:[Tu,No,kr,Ol,ou]},{provide:xc,deps:[Tu],useFactory:function(t){let e=[];return t.onStable.subscribe(()=>{for(;e.length;)e.pop()()}),function(t){e.push(t)}}},{provide:ou,useClass:ou,deps:[[new Ii,su]]},{provide:Su,useClass:Su,deps:[]},lu,{provide:Yl,useFactory:function(){return rc},deps:[]},{provide:Ql,useFactory:function(){return sc},deps:[]},{provide:fu,useFactory:function(t){return fl(t=t||"undefined"!=typeof $localize&&$localize.locale||dl),t},deps:[[new Mi(fu),new Ii,new Di]]},{provide:gu,useValue:"USD"}];let Qu=(()=>{class t{constructor(t){}}return t.\u0275fac=function(e){return new(e||t)(Ei(qu))},t.\u0275mod=ie({type:t}),t.\u0275inj=St({providers:Ku}),t})(),Zu=null;function Ju(){return Zu}const th=new oi("DocumentToken");let eh=(()=>{class t{historyGo(t){throw new Error("Not implemented")}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=xt({factory:nh,token:t,providedIn:"platform"}),t})();function nh(){return Ei(ih)}let ih=(()=>{class t extends eh{constructor(t){super(),this._doc=t,this._init()}_init(){this.location=window.location,this._history=window.history}getBaseHrefFromDOM(){return Ju().getBaseHref(this._doc)}onPopState(t){const e=Ju().getGlobalEventTarget(this._doc,"window");return e.addEventListener("popstate",t,!1),()=>e.removeEventListener("popstate",t)}onHashChange(t){const e=Ju().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){rh()?this._history.pushState(t,e,n):this.location.hash=n}replaceState(t,e,n){rh()?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)(Ei(th))},t.\u0275prov=xt({factory:sh,token:t,providedIn:"platform"}),t})();function rh(){return!!window.history.pushState}function sh(){return new ih(Ei(th))}function oh(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 ah(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 lh(t){return t&&"?"!==t[0]?"?"+t:t}let ch=(()=>{class t{historyGo(t){throw new Error("Not implemented")}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=xt({factory:uh,token:t,providedIn:"root"}),t})();function uh(t){const e=Ei(th).location;return new dh(Ei(eh),e&&e.origin||"")}const hh=new oi("appBaseHref");let dh=(()=>{class t extends ch{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 oh(this._baseHref,t)}path(t=!1){const e=this._platformLocation.pathname+lh(this._platformLocation.search),n=this._platformLocation.hash;return n&&t?`${e}${n}`:e}pushState(t,e,n,i){const r=this.prepareExternalUrl(n+lh(i));this._platformLocation.pushState(t,e,r)}replaceState(t,e,n,i){const r=this.prepareExternalUrl(n+lh(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)(Ei(eh),Ei(hh,8))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),ph=(()=>{class t{constructor(t,e){this._subject=new Bc,this._urlChangeListeners=[],this._platformStrategy=t;const n=this._platformStrategy.getBaseHref();this._platformLocation=e,this._baseHref=ah(gh(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+lh(e))}normalize(e){return t.stripTrailingSlash(function(t,e){return t&&e.startsWith(t)?e.substring(t.length):e}(this._baseHref,gh(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+lh(e)),n)}replaceState(t,e="",n=null){this._platformStrategy.replaceState(n,"",t,e),this._notifyUrlChangeListeners(this.prepareExternalUrl(t+lh(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)(Ei(ch),Ei(eh))},t.normalizeQueryParams=lh,t.joinWithSlash=oh,t.stripTrailingSlash=ah,t.\u0275prov=xt({factory:fh,token:t,providedIn:"root"}),t})();function fh(){return new ph(Ei(ch),Ei(eh))}function gh(t){return t.replace(/\/index.html$/,"")}var mh=(()=>((mh=mh||{})[mh.Decimal=0]="Decimal",mh[mh.Percent=1]="Percent",mh[mh.Currency=2]="Currency",mh[mh.Scientific=3]="Scientific",mh))(),bh=(()=>((bh=bh||{})[bh.Zero=0]="Zero",bh[bh.One=1]="One",bh[bh.Two=2]="Two",bh[bh.Few=3]="Few",bh[bh.Many=4]="Many",bh[bh.Other=5]="Other",bh))(),yh=(()=>((yh=yh||{})[yh.Decimal=0]="Decimal",yh[yh.Group=1]="Group",yh[yh.List=2]="List",yh[yh.PercentSign=3]="PercentSign",yh[yh.PlusSign=4]="PlusSign",yh[yh.MinusSign=5]="MinusSign",yh[yh.Exponential=6]="Exponential",yh[yh.SuperscriptingExponent=7]="SuperscriptingExponent",yh[yh.PerMille=8]="PerMille",yh[yh.Infinity=9]="Infinity",yh[yh.NaN=10]="NaN",yh[yh.TimeSeparator=11]="TimeSeparator",yh[yh.CurrencyDecimal=12]="CurrencyDecimal",yh[yh.CurrencyGroup=13]="CurrencyGroup",yh))();function vh(t,e){const n=cl(t),i=n[hl.NumberSymbols][e];if(void 0===i){if(e===yh.CurrencyDecimal)return n[hl.NumberSymbols][yh.Decimal];if(e===yh.CurrencyGroup)return n[hl.NumberSymbols][yh.Group]}return i}const _h=function(t){return cl(t)[hl.PluralCase]},wh=/^(\d+)?\.((\d+)(-(\d+))?)?$/;function xh(t){const e=parseInt(t);if(isNaN(e))throw new Error("Invalid integer literal when parsing "+t);return e}class Sh{}let Ch=(()=>{class t extends Sh{constructor(t){super(),this.locale=t}getPluralCategory(t,e){switch(_h(e||this.locale)(t)){case bh.Zero:return"zero";case bh.One:return"one";case bh.Two:return"two";case bh.Few:return"few";case bh.Many:return"many";default:return"other"}}}return t.\u0275fac=function(e){return new(e||t)(Ei(fu))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();function Eh(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 Oh=(()=>{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(Yl),ea(Ql),ea(Al),ea(Dl))},t.\u0275dir=se({type:t,selectors:[["","ngClass",""]],inputs:{klass:["class","klass"],ngClass:"ngClass"}}),t})();class Th{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 kh=(()=>{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 Th(null,this._ngForOf,-1,-1),null===i?void 0:i),r=new Ph(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 Ph(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(pc),ea(ac),ea(Yl))},t.\u0275dir=se({type:t,selectors:[["","ngFor","","ngForOf",""]],inputs:{ngForOf:"ngForOf",ngForTrackBy:"ngForTrackBy",ngForTemplate:"ngForTemplate"}}),t})();class Ph{constructor(t,e){this.record=t,this.view=e}}let Ah=(()=>{class t{constructor(t,e){this._viewContainer=t,this._context=new Mh,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){Ih("ngIfThen",t),this._thenTemplateRef=t,this._thenViewRef=null,this._updateView()}set ngIfElse(t){Ih("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(pc),ea(ac))},t.\u0275dir=se({type:t,selectors:[["","ngIf",""]],inputs:{ngIf:"ngIf",ngIfThen:"ngIfThen",ngIfElse:"ngIfElse"}}),t})();class Mh{constructor(){this.$implicit=null,this.ngIf=null}}function Ih(t,e){if(e&&!e.createEmbeddedView)throw new Error(`${t} must be a TemplateRef, but received '${ut(e)}'.`)}class Dh{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 Rh=(()=>{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 Dh(t,e)}ngDoCheck(){this._view.enforceState(this.ngSwitch._matchCase(this.ngSwitchCase))}}return t.\u0275fac=function(e){return new(e||t)(ea(pc),ea(ac),ea(Rh,9))},t.\u0275dir=se({type:t,selectors:[["","ngSwitchCase",""]],inputs:{ngSwitchCase:"ngSwitchCase"}}),t})(),Lh=(()=>{class t{constructor(t,e,n){n._addDefault(new Dh(t,e))}}return t.\u0275fac=function(e){return new(e||t)(ea(pc),ea(ac),ea(Rh,9))},t.\u0275dir=se({type:t,selectors:[["","ngSwitchDefault",""]]}),t})(),jh=(()=>{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(Al),ea(Ql),ea(Dl))},t.\u0275dir=se({type:t,selectors:[["","ngStyle",""]],inputs:{ngStyle:"ngStyle"}}),t})(),Fh=(()=>{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(pc))},t.\u0275dir=se({type:t,selectors:[["","ngTemplateOutlet",""]],inputs:{ngTemplateOutletContext:"ngTemplateOutletContext",ngTemplateOutlet:"ngTemplateOutlet"},features:[ye]}),t})();function Bh(t,e){return Error(`InvalidPipeArgument: '${e}' for pipe '${ut(t)}'`)}class Vh{createSubscription(t,e){return t.subscribe({next:e,error:t=>{throw t}})}dispose(t){t.unsubscribe()}onDestroy(t){t.unsubscribe()}}class zh{createSubscription(t,e){return t.then(e,t=>{throw t})}dispose(t){}onDestroy(t){}}const Uh=new zh,Hh=new Vh;let $h=(()=>{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 Uh;if(da(e))return Hh;throw Bh(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(nc,16))},t.\u0275pipe=oe({name:"async",type:t,pure:!1}),t})(),Gh=(()=>{class t{constructor(t){this._locale=t}transform(e,n,i){if(!function(t){return!(null==t||""===t||t!=t)}(e))return null;i=i||this._locale;try{return function(t,e,n){return function(t,e,n,i,r,s,o=!1){let a="",l=!1;if(isFinite(t)){let c=function(t){let e,n,i,r,s,o=Math.abs(t)+"",a=0;for((n=o.indexOf("."))>-1&&(o=o.replace(".","")),(i=o.search(/e/i))>0?(n<0&&(n=i),n+=+o.slice(i+1),o=o.substring(0,i)):n<0&&(n=o.length),i=0;"0"===o.charAt(i);i++);if(i===(s=o.length))e=[0],n=1;else{for(s--;"0"===o.charAt(s);)s--;for(n-=i,e=[],r=0;i<=s;i++,r++)e[r]=Number(o.charAt(i))}return n>22&&(e=e.splice(0,21),a=n-1,n=1),{digits:e,exponent:a,integerLen:n}}(t);o&&(c=function(t){if(0===t.digits[0])return t;const e=t.digits.length-t.integerLen;return t.exponent?t.exponent+=2:(0===e?t.digits.push(0,0):1===e&&t.digits.push(0),t.integerLen+=2),t}(c));let u=e.minInt,h=e.minFrac,d=e.maxFrac;if(s){const t=s.match(wh);if(null===t)throw new Error(`${s} is not a valid digit info`);const e=t[1],n=t[3],i=t[5];null!=e&&(u=xh(e)),null!=n&&(h=xh(n)),null!=i?d=xh(i):null!=n&&h>d&&(d=h)}!function(t,e,n){if(e>n)throw new Error(`The minimum number of digits after fraction (${e}) is higher than the maximum (${n}).`);let i=t.digits,r=i.length-t.integerLen;const s=Math.min(Math.max(e,r),n);let o=s+t.integerLen,a=i[o];if(o>0){i.splice(Math.max(t.integerLen,o));for(let t=o;t=5)if(o-1<0){for(let e=0;e>o;e--)i.unshift(0),t.integerLen++;i.unshift(1),t.integerLen++}else i[o-1]++;for(;r=c?i.pop():l=!1),e>=10?1:0},0);u&&(i.unshift(u),t.integerLen++)}(c,h,d);let p=c.digits,f=c.integerLen;const g=c.exponent;let m=[];for(l=p.every(t=>!t);f0?m=p.splice(f,p.length):(m=p,p=[0]);const b=[];for(p.length>=e.lgSize&&b.unshift(p.splice(-e.lgSize,p.length).join(""));p.length>e.gSize;)b.unshift(p.splice(-e.gSize,p.length).join(""));p.length&&b.unshift(p.join("")),a=b.join(vh(n,i)),m.length&&(a+=vh(n,r)+m.join("")),g&&(a+=vh(n,yh.Exponential)+"+"+g)}else a=vh(n,yh.Infinity);return a=t<0&&!l?e.negPre+a+e.negSuf:e.posPre+a+e.posSuf,a}(t,function(t,e="-"){const n={minInt:1,minFrac:0,maxFrac:0,posPre:"",posSuf:"",negPre:"",negSuf:"",gSize:0,lgSize:0},i=t.split(";"),r=i[0],s=i[1],o=-1!==r.indexOf(".")?r.split("."):[r.substring(0,r.lastIndexOf("0")+1),r.substring(r.lastIndexOf("0")+1)],a=o[0],l=o[1]||"";n.posPre=a.substr(0,a.indexOf("#"));for(let u=0;u{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({providers:[{provide:Sh,useClass:Ch}]}),t})();const qh="browser";function Xh(t){return t===qh}class Yh{}class Kh extends class extends class{}{constructor(){super(...arguments),this.supportsDOMEvents=!0}}{static makeCurrent(){!function(t){Zu||(Zu=t)}(new Kh)}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=(Zh=Zh||document.querySelector("base"),Zh?Zh.getAttribute("href"):null);return null==e?null:function(t){Qh=Qh||document.createElement("a"),Qh.setAttribute("href",t);const e=Qh.pathname;return"/"===e.charAt(0)?e:`/${e}`}(e)}resetBaseElement(){Zh=null}getUserAgent(){return window.navigator.userAgent}getCookie(t){return Eh(document.cookie,t)}}let Qh,Zh=null;const Jh=new oi("TRANSITION_ID"),td=[{provide:su,useFactory:function(t,e,n){return()=>{n.get(ou).donePromise.then(()=>{const n=Ju(),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?Ju().isShadowRoot(e)?this.findTestabilityInTree(t,e.host,!0):this.findTestabilityInTree(t,e.parentElement,!0):null}}let nd=(()=>{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 id=new oi("EventManagerPlugins");let rd=(()=>{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})(),ad=(()=>{class t extends od{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(ld),this._hostNodes.delete(t)}onStylesAdded(t){this._hostNodes.forEach((e,n)=>{this._addStylesToHost(t,n,e)})}ngOnDestroy(){this._hostNodes.forEach(t=>t.forEach(ld))}}return t.\u0275fac=function(e){return new(e||t)(Ei(th))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();function ld(t){Ju().remove(t)}const cd={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/"},ud=/%COMP%/g;function hd(t,e,n){for(let i=0;i{if("__ngUnwrap__"===e)return t;!1===t(e)&&(e.preventDefault(),e.returnValue=!1)}}let pd=(()=>{class t{constructor(t,e,n){this.eventManager=t,this.sharedStylesHost=e,this.appId=n,this.rendererByCompId=new Map,this.defaultRenderer=new fd(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 gd(this.eventManager,this.sharedStylesHost,e,this.appId),this.rendererByCompId.set(e.id,n)),n.applyToHost(t),n}case 1:case jt.ShadowDom:return new md(this.eventManager,this.sharedStylesHost,t,e);default:if(!this.rendererByCompId.has(e.id)){const t=hd(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)(Ei(rd),Ei(ad),Ei(au))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();class fd{constructor(t){this.eventManager=t,this.data=Object.create(null)}destroy(){}createElement(t,e){return e?document.createElementNS(cd[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=cd[i];r?t.setAttributeNS(r,e,n):t.setAttribute(e,n)}else t.setAttribute(e,n)}removeAttribute(t,e,n){if(n){const i=cd[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,dd(n)):this.eventManager.addEventListener(t,e,dd(n))}}class gd extends fd{constructor(t,e,n,i){super(t),this.component=n;const r=hd(i+"-"+n.id,n.styles,[]);e.addStyles(r),this.contentAttr=function(t){return"_ngcontent-%COMP%".replace(ud,t)}(i+"-"+n.id),this.hostAttr=function(t){return"_nghost-%COMP%".replace(ud,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 md extends fd{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=hd(i.id,i.styles,[]);for(let s=0;s{class t extends sd{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)(Ei(th))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();const yd=["alt","control","meta","shift"],vd={"\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"},_d={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"},wd={alt:t=>t.altKey,control:t=>t.ctrlKey,meta:t=>t.metaKey,shift:t=>t.shiftKey};let xd=(()=>{class t extends sd{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(()=>Ju().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(yd.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&&_d.hasOwnProperty(e)&&(e=_d[e]))}return vd[e]||e}(t);return n=n.toLowerCase()," "===n?n="space":"."===n&&(n="dot"),yd.forEach(i=>{i!=n&&wd[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)(Ei(th))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),Sd=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=xt({factory:function(){return Ei(Cd)},token:t,providedIn:"root"}),t})(),Cd=(()=>{class t extends Sd{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)(Ei(th))},t.\u0275prov=xt({factory:function(){return function(t){return new Cd(t.get(th))}(Ei(_o))},token:t,providedIn:"root"}),t})();const Ed=Hu(Yu,"browser",[{provide:hu,useValue:qh},{provide:uu,useValue:function(){Kh.makeCurrent(),ed.init()},multi:!0},{provide:th,useFactory:function(){return function(t){Ee=t}(document),document},deps:[]}]),Od=[[],{provide:xo,useValue:"root"},{provide:kr,useFactory:function(){return new kr},deps:[]},{provide:id,useClass:bd,multi:!0,deps:[th,Tu,hu]},{provide:id,useClass:xd,multi:!0,deps:[th]},[],{provide:pd,useClass:pd,deps:[rd,ad,au]},{provide:Il,useExisting:pd},{provide:od,useExisting:ad},{provide:ad,useClass:ad,deps:[th]},{provide:Ru,useClass:Ru,deps:[Tu]},{provide:rd,useClass:rd,deps:[id,Tu]},{provide:Yh,useClass:nd,deps:[]},[]];let Td=(()=>{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:au,useValue:e.appId},{provide:Jh,useExisting:au},td]}}}return t.\u0275fac=function(e){return new(e||t)(Ei(t,12))},t.\u0275mod=ie({type:t}),t.\u0275inj=St({providers:Od,imports:[Wh,Qu]}),t})();function kd(t){return null!=t&&"false"!=`${t}`}function Pd(t,e=0){return function(t){return!isNaN(parseFloat(t))&&!isNaN(Number(t))}(t)?Number(t):e}function Ad(t){return Array.isArray(t)?t:[t]}function Md(t){return null==t?"":"string"==typeof t?t:`${t}px`}function Id(t){return t instanceof Al?t.nativeElement:t}function Dd(...t){let e=t[t.length-1];return I(e)?(t.pop(),z(t,e)):K(t)}function Rd(t,e,n,i){return a(n)&&(i=n,n=void 0),i?Rd(t,e,n).pipe(D(t=>d(t)?i(...t):i(t))):new E(i=>{Nd(t,e,function(t){i.next(arguments.length>1?Array.prototype.slice.call(arguments):t)},i,n)})}function Nd(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 Bd extends Fd{constructor(t,e=Fd.now){super(t,()=>Bd.delegate&&Bd.delegate!==this?Bd.delegate.now():e()),this.actions=[],this.active=!1,this.scheduled=void 0}schedule(t,e=0,n){return Bd.delegate&&Bd.delegate!==this?Bd.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 Bd{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 Vd=1;const zd=Promise.resolve(),Ud={};function Hd(t){return t in Ud&&(delete Ud[t],!0)}const $d={setImmediate(t){const e=Vd++;return Ud[e]=!0,zd.then(()=>Hd(e)&&t()),e},clearImmediate(t){Hd(t)}};new class extends Bd{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=$d.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&&($d.clearImmediate(e),t.scheduled=void 0)}});function Gd(t){return!!t&&(t instanceof E||"function"==typeof t.lift&&"function"==typeof t.subscribe)}function Wd(t,e){return n=>n.lift(new qd(t,e))}class qd{constructor(t,e){this.compare=t,this.keySelector=e}call(t,e){return e.subscribe(new Xd(t,this.compare,this.keySelector))}}class Xd 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 Yd=new Bd(jd);class Kd{constructor(t){this.durationSelector=t}call(t,e){return e.subscribe(new Qd(t,this.durationSelector))}}class Qd 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 Zd(t){return!d(t)&&t-parseFloat(t)+1>=0}function Jd(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 tp(t,e=Yd){return function(t){return function(e){return e.lift(new Kd(t))}}(()=>function(t=0,e,n){let i=-1;return Zd(e)?i=Number(e)<1?1:Number(e):I(e)&&(n=e),I(n)||(n=Yd),new E(e=>{const r=Zd(t)?t:+t-n.now();return n.schedule(Jd,r,{index:0,period:i,subscriber:e})})}(t,e))}function ep(t,e){return function(n){return n.lift(new np(t,e))}}class np{constructor(t,e){this.predicate=t,this.thisArg=e}call(t,e){return e.subscribe(new ip(t,this.predicate,this.thisArg))}}class ip 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 rp(t){return e=>e.lift(new sp(t))}class sp{constructor(t){this.notifier=t}call(t,e){const n=new op(t),i=G(this.notifier,new H(n));return i&&!n.seenValue?(n.add(i),e.subscribe(n)):n}}class op extends ${constructor(t){super(t),this.seenValue=!1}notifyNext(){this.seenValue=!0,this.complete()}notifyComplete(){}}function ap(...t){return Y(1)(Dd(...t))}function lp(...t){const e=t[t.length-1];return I(e)?(t.pop(),n=>ap(t,n,e)):e=>ap(t,e)}function cp(t,e){return"function"==typeof e?n=>n.pipe(cp((n,i)=>U(t(n,i)).pipe(D((t,r)=>e(n,t,i,r))))):e=>e.lift(new up(t))}class up{constructor(t){this.project=t}call(t,e){return e.subscribe(new hp(t,this.project))}}class hp 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 dp=new class extends Bd{}(class extends jd{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)}}),pp=new E(t=>t.complete());function fp(t){return t?function(t){return new E(e=>t.schedule(()=>e.complete()))}(t):pp}function gp(t,e){return new E(e?n=>e.schedule(mp,0,{error:t,subscriber:n}):e=>e.error(t))}function mp({error:t,subscriber:e}){e.error(t)}class bp{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 Dd(this.value);case"E":return gp(this.error);case"C":return fp()}throw new Error("unexpected notification kind value")}static createNext(t){return void 0!==t?new bp("N",t):bp.undefinedValueNotification}static createError(t){return new bp("E",void 0,t)}static createComplete(){return bp.completeNotification}}bp.completeNotification=new bp("C"),bp.undefinedValueNotification=new bp("N",void 0);class yp 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(yp.dispatch,this.delay,new vp(t,this.destination)))}_next(t){this.scheduleMessage(bp.createNext(t))}_error(t){this.scheduleMessage(bp.createError(t)),this.unsubscribe()}_complete(){this.scheduleMessage(bp.createComplete()),this.unsubscribe()}}class vp{constructor(t,e){this.notification=t,this.destination=e}}class _p extends A{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 wp(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 yp(t,i)),e)for(let o=0;oe&&(s=Math.max(s,r-e)),s>0&&i.splice(0,s),i}}class wp{constructor(t,e){this.time=t,this.value=e}}function xp(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 _p(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 Sp;try{Sp="undefined"!=typeof Intl&&Intl.v8BreakIterator}catch(m){Sp=!1}let Cp,Ep=(()=>{class t{constructor(t){this._platformId=t,this.isBrowser=this._platformId?Xh(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&&!Sp)&&"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)(Ei(hu))},t.\u0275prov=xt({factory:function(){return new t(Ei(hu))},token:t,providedIn:"root"}),t})(),Op=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({}),t})();const Tp=["color","button","checkbox","date","datetime-local","email","file","hidden","image","month","number","password","radio","range","reset","search","submit","tel","text","time","url","week"];function kp(){if(Cp)return Cp;if("object"!=typeof document||!document)return Cp=new Set(Tp),Cp;let t=document.createElement("input");return Cp=new Set(Tp.filter(e=>(t.setAttribute("type",e),t.type===e))),Cp}let Pp,Ap,Mp;function Ip(t){return function(){if(null==Pp&&"undefined"!=typeof window)try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:()=>Pp=!0}))}finally{Pp=Pp||!1}return Pp}()?t:!!t.capture}function Dp(){if(null==Ap){if("object"!=typeof document||!document||"function"!=typeof Element||!Element)return Ap=!1,Ap;if("scrollBehavior"in document.documentElement.style)Ap=!0;else{const t=Element.prototype.scrollTo;Ap=!!t&&!/\{\s*\[native code\]\s*\}/.test(t.toString())}}return Ap}function Rp(t){if(function(){if(null==Mp){const t="undefined"!=typeof document?document.head:null;Mp=!(!t||!t.createShadowRoot&&!t.attachShadow)}return Mp}()){const e=t.getRootNode?t.getRootNode():null;if("undefined"!=typeof ShadowRoot&&ShadowRoot&&e instanceof ShadowRoot)return e}return null}function Np(){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 Lp(t){return t.composedPath?t.composedPath()[0]:t.target}const jp=new oi("cdk-dir-doc",{providedIn:"root",factory:function(){return Oi(th)}});let Fp=(()=>{class t{constructor(t){if(this.value="ltr",this.change=new Bc,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)(Ei(jp,8))},t.\u0275prov=xt({factory:function(){return new t(Ei(jp,8))},token:t,providedIn:"root"}),t})(),Bp=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({}),t})();class Vp{constructor(t=!1,e,n=!0){this._multiple=t,this._emitChanges=n,this._selection=new Set,this._deselectedToEmit=[],this._selectedToEmit=[],this.changed=new A,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 zp=(()=>{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})(),Up=(()=>{class t{constructor(t,e,n){this._ngZone=t,this._platform=e,this._scrolled=new A,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 E(e=>{this._globalSubscription||this._addGlobalListener();const n=t>0?this._scrolled.pipe(tp(t)).subscribe(e):this._scrolled.subscribe(e);return this._scrolledCount++,()=>{n.unsubscribe(),this._scrolledCount--,this._scrolledCount||this._removeGlobalListener()}}):Dd()}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(ep(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=Id(e),i=t.getElementRef().nativeElement;do{if(n==i)return!0}while(n=n.parentElement);return!1}_addGlobalListener(){this._globalSubscription=this._ngZone.runOutsideAngular(()=>Rd(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)(Ei(Tu),Ei(Ep),Ei(th,8))},t.\u0275prov=xt({factory:function(){return new t(Ei(Tu),Ei(Ep),Ei(th,8))},token:t,providedIn:"root"}),t})(),Hp=(()=>{class t{constructor(t,e,n){this._platform=t,this._change=new A,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(tp(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)(Ei(Ep),Ei(Tu),Ei(th,8))},t.\u0275prov=xt({factory:function(){return new t(Ei(Ep),Ei(Tu),Ei(th,8))},token:t,providedIn:"root"}),t})(),$p=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({}),t})(),Gp=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Bp,Op,$p],Bp,$p]}),t})();class Wp{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 qp extends Wp{constructor(t,e,n,i){super(),this.component=t,this.viewContainerRef=e,this.injector=n,this.componentFactoryResolver=i}}class Xp extends Wp{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 Yp extends Wp{constructor(t){super(),this.element=t instanceof Al?t.nativeElement:t}}class Kp{constructor(){this._isDisposed=!1,this.attachDomPortal=null}hasAttached(){return!!this._attachedPortal}attach(t){return t instanceof qp?(this._attachedPortal=t,this.attachComponentPortal(t)):t instanceof Xp?(this._attachedPortal=t,this.attachTemplatePortal(t)):this.attachDomPortal&&t instanceof Yp?(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 Qp extends Kp{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 Zp=(()=>{class t extends Xp{constructor(t,e){super(t,e)}}return t.\u0275fac=function(e){return new(e||t)(ea(ac),ea(pc))},t.\u0275dir=se({type:t,selectors:[["","cdkPortal",""]],exportAs:["cdkPortal"],features:[jo]}),t})(),Jp=(()=>{class t extends Zp{}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:[xl([{provide:Zp,useExisting:t}]),jo]}),t})(),tf=(()=>{class t extends Kp{constructor(t,e,n){super(),this._componentFactoryResolver=t,this._viewContainerRef=e,this._isInitialized=!1,this.attached=new Bc,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(Ol),ea(pc),ea(th))},t.\u0275dir=se({type:t,selectors:[["","cdkPortalOutlet",""]],inputs:{portal:["cdkPortalOutlet","portal"]},outputs:{attached:"attached"},exportAs:["cdkPortalOutlet"],features:[jo]}),t})(),ef=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({}),t})();const nf=(()=>{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 rf(t){return e=>0===t?fp():e.lift(new sf(t))}class sf{constructor(t){if(this.total=t,this.total<0)throw new nf}call(t,e){return e.subscribe(new of(t,this.total))}}class of 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 af(t,e=!1){return n=>n.lift(new lf(t,e))}class lf{constructor(t,e){this.predicate=t,this.inclusive=e}call(t,e){return e.subscribe(new cf(t,this.predicate,this.inclusive))}}class cf 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 uf(t,...e){return e.length?e.some(e=>t[e]):t.altKey||t.shiftKey||t.ctrlKey||t.metaKey}const hf=Dp();class df{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=Md(-this._previousScrollPosition.left),t.style.top=Md(-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"),hf&&(e.scrollBehavior=n.scrollBehavior="auto"),window.scroll(this._previousScrollPosition.left,this._previousScrollPosition.top),hf&&(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 pf{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 ff{enable(){}disable(){}attach(){}}function gf(t,e){return e.some(e=>t.bottome.bottom||t.righte.right)}function mf(t,e){return e.some(e=>t.tope.bottom||t.lefte.right)}class bf{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();gf(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 yf=(()=>{class t{constructor(t,e,n,i){this._scrollDispatcher=t,this._viewportRuler=e,this._ngZone=n,this.noop=()=>new ff,this.close=t=>new pf(this._scrollDispatcher,this._ngZone,this._viewportRuler,t),this.block=()=>new df(this._viewportRuler,this._document),this.reposition=t=>new bf(this._scrollDispatcher,this._viewportRuler,this._ngZone,t),this._document=i}}return t.\u0275fac=function(e){return new(e||t)(Ei(Up),Ei(Hp),Ei(Tu),Ei(th))},t.\u0275prov=xt({factory:function(){return new t(Ei(Up),Ei(Hp),Ei(Tu),Ei(th))},token:t,providedIn:"root"}),t})();class vf{constructor(t){if(this.scrollStrategy=new ff,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 _f{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 wf{constructor(t,e){this.connectionPair=t,this.scrollableViewProperties=e}}let xf=(()=>{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)(Ei(th))},t.\u0275prov=xt({factory:function(){return new t(Ei(th))},token:t,providedIn:"root"}),t})(),Sf=(()=>{class t extends xf{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)(Ei(th))},t.\u0275prov=xt({factory:function(){return new t(Ei(th))},token:t,providedIn:"root"}),t})(),Cf=(()=>{class t extends xf{constructor(t,e){super(t),this._platform=e,this._cursorStyleIsSet=!1,this._clickListener=t=>{const e=Lp(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)(Ei(th),Ei(Ep))},t.\u0275prov=xt({factory:function(){return new t(Ei(th),Ei(Ep))},token:t,providedIn:"root"}),t})();const Ef="undefined"!=typeof window?window:{},Of=void 0!==Ef.__karma__&&!!Ef.__karma__||void 0!==Ef.jasmine&&!!Ef.jasmine||void 0!==Ef.jest&&!!Ef.jest||void 0!==Ef.Mocha&&!!Ef.Mocha;let Tf=(()=>{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||Of){const e=this._document.querySelectorAll(`.${t}[platform="server"], .${t}[platform="test"]`);for(let t=0;tthis._backdropClick.next(t),this._keydownEvents=new A,this._outsidePointerEvents=new A,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(rf(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=Md(this._config.width),t.height=Md(this._config.height),t.minWidth=Md(this._config.minWidth),t.minHeight=Md(this._config.minHeight),t.maxWidth=Md(this._config.maxWidth),t.maxHeight=Md(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;Ad(e).forEach(t=>{t&&(n?i.add(t):i.remove(t))})}_detachContentWhenStable(){this._ngZone.runOutsideAngular(()=>{const t=this._ngZone.onStable.pipe(rp(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 Pf="cdk-overlay-connected-position-bounding-box",Af=/([A-Za-z%]+)$/;class Mf{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 A,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(Pf),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&&If(this._boundingBox.style,{top:"",left:"",right:"",bottom:"",height:"",width:"",alignItems:"",justifyContent:""}),this._pane&&this._resetOverlayElementStyles(),this._overlayRef&&this._overlayRef.hostElement.classList.remove(Pf),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=Rf(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=Df(this._overlayRef.getConfig().minHeight),o=Df(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=Rf(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=Md(n.height),i.top=Md(n.top),i.bottom=Md(n.bottom),i.width=Md(n.width),i.left=Md(n.left),i.right=Md(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=Md(t)),r&&(i.maxWidth=Md(r))}this._lastBoundingBoxSize=n,If(this._boundingBox.style,i)}_resetBoundingBoxStyles(){If(this._boundingBox.style,{top:"0",left:"0",right:"0",bottom:"0",height:"",width:"",alignItems:"",justifyContent:""})}_resetOverlayElementStyles(){If(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();If(n,this._getExactOverlayY(e,t,i)),If(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=Md(s.maxHeight):r&&(n.maxHeight="")),s.maxWidth&&(i?n.maxWidth=Md(s.maxWidth):r&&(n.maxWidth="")),If(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=Md(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=Md(s.x),r}_getScrollVisibility(){const t=this._getOriginRect(),e=this._pane.getBoundingClientRect(),n=this._scrollables.map(t=>t.getElementRef().nativeElement.getBoundingClientRect());return{isOriginClipped:mf(t,n),isOriginOutsideView:gf(t,n),isOverlayClipped:mf(e,n),isOverlayOutsideView:gf(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&&Ad(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 Al)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 If(t,e){for(let n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}function Df(t){if("number"!=typeof t&&null!=t){const[e,n]=t.split(Af);return n&&"px"!==n?null:parseFloat(e)}return t||null}function Rf(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 Nf{constructor(t,e,n,i,r,s,o){this._preferredPositions=[],this._positionStrategy=new Mf(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 _f(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 Lf="cdk-global-overlay-wrapper";class jf{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(Lf),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(Lf),n.justifyContent=n.alignItems=t.marginTop=t.marginBottom=t.marginLeft=t.marginRight=t.position="",this._overlayRef=null,this._isDisposed=!0}}let Ff=(()=>{class t{constructor(t,e,n,i){this._viewportRuler=t,this._document=e,this._platform=n,this._overlayContainer=i}global(){return new jf}connectedTo(t,e,n){return new Nf(e,n,t,this._viewportRuler,this._document,this._platform,this._overlayContainer)}flexibleConnectedTo(t){return new Mf(t,this._viewportRuler,this._document,this._platform,this._overlayContainer)}}return t.\u0275fac=function(e){return new(e||t)(Ei(Hp),Ei(th),Ei(Ep),Ei(Tf))},t.\u0275prov=xt({factory:function(){return new t(Ei(Hp),Ei(th),Ei(Ep),Ei(Tf))},token:t,providedIn:"root"}),t})(),Bf=0,Vf=(()=>{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 vf(t);return r.direction=r.direction||this._directionality.value,new kf(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-"+Bf++,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(qu)),new Qp(t,this._componentFactoryResolver,this._appRef,this._injector,this._document)}}return t.\u0275fac=function(e){return new(e||t)(Ei(yf),Ei(Tf),Ei(Ol),Ei(Ff),Ei(Sf),Ei(No),Ei(Tu),Ei(th),Ei(Fp),Ei(ph),Ei(Cf))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();const zf=[{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"}],Uf=new oi("cdk-connected-overlay-scroll-strategy");let Hf=(()=>{class t{constructor(t){this.elementRef=t}}return t.\u0275fac=function(e){return new(e||t)(ea(Al))},t.\u0275dir=se({type:t,selectors:[["","cdk-overlay-origin",""],["","overlay-origin",""],["","cdkOverlayOrigin",""]],exportAs:["cdkOverlayOrigin"]}),t})(),$f=(()=>{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 Bc,this.positionChange=new Bc,this.attach=new Bc,this.detach=new Bc,this.overlayKeydown=new Bc,this.overlayOutsideClick=new Bc,this._templatePortal=new Xp(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=kd(t)}get lockPosition(){return this._lockPosition}set lockPosition(t){this._lockPosition=kd(t)}get flexibleDimensions(){return this._flexibleDimensions}set flexibleDimensions(t){this._flexibleDimensions=kd(t)}get growAfterOpen(){return this._growAfterOpen}set growAfterOpen(t){this._growAfterOpen=kd(t)}get push(){return this._push}set push(t){this._push=kd(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=zf);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&&!uf(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 vf({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(af(()=>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(Vf),ea(ac),ea(pc),ea(Uf),ea(Fp,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 Gf={provide:Uf,deps:[Vf],useFactory:function(t){return()=>t.scrollStrategies.reposition()}};let Wf=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({providers:[Vf,Gf],imports:[[Bp,ef,Gp],Gp]}),t})();const qf={schedule(t,e){const n=setTimeout(t,e);return()=>clearTimeout(n)},scheduleBeforeRender(t){if("undefined"==typeof window)return qf.schedule(t,0);if(void 0===window.requestAnimationFrame)return qf.schedule(t,16);const e=window.requestAnimationFrame(t);return()=>window.cancelAnimationFrame(e)}};let Xf;function Yf(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(!Xf){const t=Element.prototype;Xf=t.matches||t.matchesSelector||t.mozMatchesSelector||t.msMatchesSelector||t.oMatchesSelector||t.webkitMatchesSelector}return t.nodeType===Node.ELEMENT_NODE&&Xf.call(t,e)}(t,e)||(i=n,0))),i}class Kf{constructor(t,e){this.componentFactory=e.get(Ol).resolveComponentFactory(t)}create(t){return new Qf(this.componentFactory,t)}}class Qf{constructor(t,e){this.componentFactory=t,this.injector=e,this.eventEmitters=new _p(1),this.events=this.eventEmitters.pipe(cp(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(Tu),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=qf.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=qf.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 Jf extends A{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 tg(){}function eg(t,e,n){return function(i){return i.lift(new ng(t,e,n))}}class ng{constructor(t,e,n){this.nextOrObserver=t,this.error=e,this.complete=n}call(t,e){return e.subscribe(new ig(t,this.nextOrObserver,this.error,this.complete))}}class ig extends v{constructor(t,e,n,i){super(t),this._tapNext=tg,this._tapError=tg,this._tapComplete=tg,this._tapError=n||tg,this._tapComplete=i||tg,a(e)?(this._context=this,this._tapNext=e):e&&(this._context=e,this._tapNext=e.next||tg,this._tapError=e.error||tg,this._tapComplete=e.complete||tg)}_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 rg(t,e=Yd){return n=>n.lift(new sg(t,e))}class sg{constructor(t,e){this.dueTime=t,this.scheduler=e}call(t,e){return e.subscribe(new og(t,this.dueTime,this.scheduler))}}class og 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(ag,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 ag(t){t.debouncedNext()}function lg(t){return e=>e.lift(new cg(t))}class cg{constructor(t){this.total=t}call(t,e){return e.subscribe(new ug(t,this.total))}}class ug extends v{constructor(t,e){super(t),this.total=e,this.count=0}_next(t){++this.count>this.total&&this.destination.next(t)}}let hg=(()=>{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})(),dg=(()=>{class t{constructor(t){this._mutationObserverFactory=t,this._observedElements=new Map}ngOnDestroy(){this._observedElements.forEach((t,e)=>this._cleanupObserver(e))}observe(t){const e=Id(t);return new E(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 A,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)(Ei(hg))},t.\u0275prov=xt({factory:function(){return new t(Ei(hg))},token:t,providedIn:"root"}),t})(),pg=(()=>{class t{constructor(t,e,n){this._contentObserver=t,this._elementRef=e,this._ngZone=n,this.event=new Bc,this._disabled=!1,this._currentSubscription=null}get disabled(){return this._disabled}set disabled(t){this._disabled=kd(t),this._disabled?this._unsubscribe():this._subscribe()}get debounce(){return this._debounce}set debounce(t){this._debounce=Pd(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(rg(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(dg),ea(Al),ea(Tu))},t.\u0275dir=se({type:t,selectors:[["","cdkObserveContent",""]],inputs:{disabled:["cdkObserveContentDisabled","disabled"],debounce:"debounce"},outputs:{event:"cdkObserveContent"},exportAs:["cdkObserveContent"]}),t})(),fg=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({providers:[hg]}),t})();function gg(t,e){return(t.getAttribute(e)||"").match(/\S+/g)||[]}const mg="cdk-describedby-message-container",bg="cdk-describedby-message",yg="cdk-describedby-host";let vg=0;const _g=new Map;let wg=null,xg=(()=>{class t{constructor(t){this._document=t}describe(t,e,n){if(!this._canBeDescribed(t,e))return;const i=Sg(e,n);"string"!=typeof e?(Cg(e),_g.set(i,{messageElement:e,referenceCount:0})):_g.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=Sg(e,n);if(this._isElementDescribedByMessage(t,i)&&this._removeMessageReference(t,i),"string"==typeof e){const t=_g.get(i);t&&0===t.referenceCount&&this._deleteMessageElement(i)}wg&&0===wg.childNodes.length&&this._deleteMessagesContainer()}ngOnDestroy(){const t=this._document.querySelectorAll(`[${yg}]`);for(let e=0;e0!=t.indexOf(bg));t.setAttribute("aria-describedby",e.join(" "))}_addMessageReference(t,e){const n=_g.get(e);(function(t,e,n){const i=gg(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(yg,""),n.referenceCount++}_removeMessageReference(t,e){const n=_g.get(e);n.referenceCount--,function(t,e,n){const i=gg(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(yg)}_isElementDescribedByMessage(t,e){const n=gg(t,"aria-describedby"),i=_g.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)(Ei(th))},t.\u0275prov=xt({factory:function(){return new t(Ei(th))},token:t,providedIn:"root"}),t})();function Sg(t,e){return"string"==typeof t?`${e||""}/${t}`:t}function Cg(t){t.id||(t.id=`${bg}-${vg++}`)}class Eg extends class{constructor(t){this._items=t,this._activeItemIndex=-1,this._activeItem=null,this._wrap=!1,this._letterKeyStream=new A,this._typeaheadSubscription=g.EMPTY,this._vertical=!0,this._allowedModifierKeys=[],this._homeAndEnd=!1,this._skipPredicateFn=t=>t.disabled,this._pressedLetters=[],this.tabOut=new A,this.change=new A,t instanceof zc&&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(eg(t=>this._pressedLetters.push(t)),rg(t),ep(()=>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||uf(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 zc?this._items.toArray():this._items}}{setActiveItem(t){this.activeItem&&this.activeItem.setInactiveStyles(),super.setActiveItem(t),this.activeItem&&this.activeItem.setActiveStyles()}}let Og=(()=>{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===kg(e)||!this.isVisible(e)))return!1;let n=t.nodeName.toLowerCase(),i=kg(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")||Tg(t))}(t)&&!this.isDisabled(t)&&((null==e?void 0:e.ignoreVisibility)||this.isVisible(t))}}return t.\u0275fac=function(e){return new(e||t)(Ei(Ep))},t.\u0275prov=xt({factory:function(){return new t(Ei(Ep))},token:t,providedIn:"root"}),t})();function Tg(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 kg(t){if(!Tg(t))return null;const e=parseInt(t.getAttribute("tabindex")||"",10);return isNaN(e)?-1:e}class Pg{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(rf(1)).subscribe(t)}}let Ag=(()=>{class t{constructor(t,e,n){this._checker=t,this._ngZone=e,this._document=n}create(t,e=!1){return new Pg(t,this._checker,this._ngZone,this._document,e)}}return t.\u0275fac=function(e){return new(e||t)(Ei(Og),Ei(Tu),Ei(th))},t.\u0275prov=xt({factory:function(){return new t(Ei(Og),Ei(Tu),Ei(th))},token:t,providedIn:"root"}),t})();function Mg(t){return 0===t.offsetX&&0===t.offsetY}function Ig(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 Dg=new oi("cdk-input-modality-detector-options"),Rg={ignoreKeys:[18,17,224,91,16]},Ng=Ip({passive:!0,capture:!0});let Lg=(()=>{class t{constructor(t,e,n,i){this._platform=t,this._mostRecentTarget=null,this._modality=new Jf(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=Lp(t))},this._onMousedown=t=>{Date.now()-this._lastTouchMs<650||(this._modality.next(Mg(t)?"keyboard":"mouse"),this._mostRecentTarget=Lp(t))},this._onTouchstart=t=>{Ig(t)?this._modality.next("keyboard"):(this._lastTouchMs=Date.now(),this._modality.next("touch"),this._mostRecentTarget=Lp(t))},this._options=Object.assign(Object.assign({},Rg),i),this.modalityDetected=this._modality.pipe(lg(1)),this.modalityChanged=this.modalityDetected.pipe(Wd()),t.isBrowser&&e.runOutsideAngular(()=>{n.addEventListener("keydown",this._onKeydown,Ng),n.addEventListener("mousedown",this._onMousedown,Ng),n.addEventListener("touchstart",this._onTouchstart,Ng)})}get mostRecentModality(){return this._modality.value}ngOnDestroy(){!this._platform.isBrowser||(document.removeEventListener("keydown",this._onKeydown,Ng),document.removeEventListener("mousedown",this._onMousedown,Ng),document.removeEventListener("touchstart",this._onTouchstart,Ng))}}return t.\u0275fac=function(e){return new(e||t)(Ei(Ep),Ei(Tu),Ei(th),Ei(Dg,8))},t.\u0275prov=xt({factory:function(){return new t(Ei(Ep),Ei(Tu),Ei(th),Ei(Dg,8))},token:t,providedIn:"root"}),t})();const jg=new oi("liveAnnouncerElement",{providedIn:"root",factory:function(){return null}}),Fg=new oi("LIVE_ANNOUNCER_DEFAULT_OPTIONS");let Bg=(()=>{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 A,this._rootNodeFocusAndBlurListener=t=>{const e=Lp(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=Id(t);if(!this._platform.isBrowser||1!==n.nodeType)return Dd(null);const i=Rp(n)||this._getDocument(),r=this._elementInfo.get(n);if(r)return e&&(r.checkChildren=!0),r.subject;const s={checkChildren:e,subject:new A,rootNode:i};return this._elementInfo.set(n,s),this._registerGlobalListeners(s),s.subject}stopMonitoring(t){const e=Id(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=Id(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=Lp(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,zg),e.addEventListener("blur",this._rootNodeFocusAndBlurListener,zg)}),this._rootNodeFocusListenerCount.set(e,n+1),1==++this._monitoredElementCount&&(this._ngZone.runOutsideAngular(()=>{this._getWindow().addEventListener("focus",this._windowFocusListener)}),this._inputModalityDetector.modalityDetected.pipe(rp(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,zg),e.removeEventListener("blur",this._rootNodeFocusAndBlurListener,zg),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)(Ei(Tu),Ei(Ep),Ei(Lg),Ei(th,8),Ei(Vg,8))},t.\u0275prov=xt({factory:function(){return new t(Ei(Tu),Ei(Ep),Ei(Lg),Ei(th,8),Ei(Vg,8))},token:t,providedIn:"root"}),t})();const Hg="cdk-high-contrast-black-on-white",$g="cdk-high-contrast-white-on-black",Gg="cdk-high-contrast-active";let Wg=(()=>{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(Gg),t.remove(Hg),t.remove($g),this._hasCheckedHighContrastMode=!0;const e=this.getHighContrastMode();1===e?(t.add(Gg),t.add(Hg)):2===e&&(t.add(Gg),t.add($g))}}}return t.\u0275fac=function(e){return new(e||t)(Ei(Ep),Ei(th))},t.\u0275prov=xt({factory:function(){return new t(Ei(Ep),Ei(th))},token:t,providedIn:"root"}),t})(),qg=(()=>{class t{constructor(t){t._applyBodyHighContrastModeCssClasses()}}return t.\u0275fac=function(e){return new(e||t)(Ei(Wg))},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Op,fg]]}),t})();const Xg=new Ll("12.2.5");class Yg{}const Kg="*";function Qg(t,e){return{type:7,name:t,definitions:e,options:{}}}function Zg(t,e=null){return{type:4,styles:e,timings:t}}function Jg(t,e=null){return{type:2,steps:t,options:e}}function tm(t){return{type:6,styles:t,offset:null}}function em(t,e,n){return{type:0,name:t,styles:e,options:n}}function nm(t){return{type:5,steps:t}}function im(t,e,n=null){return{type:1,expr:t,animation:e,options:n}}function rm(t=null){return{type:9,options:t}}function sm(t,e,n=null){return{type:11,selector:t,animation:e,options:n}}function om(t){Promise.resolve(null).then(t)}class am{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(){om(()=>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 lm{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?om(()=>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 cm(){return"undefined"!=typeof window&&void 0!==window.document}function um(){return"undefined"!=typeof process&&"[object process]"==={}.toString.call(process)}function hm(t){switch(t.length){case 0:return new am;case 1:return t[0];default:return new lm(t)}}function dm(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 Kg: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 pm(t,e,n,i){switch(e){case"start":t.onStart(()=>i(n&&fm(n,"start",t)));break;case"done":t.onDone(()=>i(n&&fm(n,"done",t)));break;case"destroy":t.onDestroy(()=>i(n&&fm(n,"destroy",t)))}}function fm(t,e,n){const i=n.totalTime,r=gm(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 gm(t,e,n,i,r="",s=0,o){return{element:t,triggerName:e,fromState:n,toState:i,phaseName:r,totalTime:s,disabled:!!o}}function mm(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 bm(t){const e=t.indexOf(":");return[t.substring(1,e),t.substr(e+1)]}let ym=(t,e)=>!1,vm=(t,e)=>!1,_m=(t,e,n)=>[];const wm=um();(wm||"undefined"!=typeof Element)&&(ym=cm()?(t,e)=>{for(;e&&e!==document.documentElement;){if(e===t)return!0;e=e.parentNode||e.host}return!1}:(t,e)=>t.contains(e),vm=(()=>{if(wm||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]):vm}})(),_m=(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 Pm=(()=>{class t{validateStyleProperty(t){return Cm(t)}matchesElement(t,e){return Em(t,e)}containsElement(t,e){return Om(t,e)}query(t,e,n){return Tm(t,e,n)}computeStyle(t,e,n){return n||""}animate(t,e,n,i,r,s=[],o){return new am(n,i)}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();class Am{}Am.NOOP=new Pm;const Mm="ng-enter",Im="ng-leave",Dm="ng-trigger",Rm=".ng-trigger",Nm="ng-animating",Lm=".ng-animating";function jm(t){if("number"==typeof t)return t;const e=t.match(/^(-?[\.\d]+)(m?s)/);return!e||e.length<2?0:Fm(parseFloat(e[1]),e[2])}function Fm(t,e){switch(e){case"s":return 1e3*t;default:return t}}function Bm(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=Fm(parseFloat(n[1]),n[2]);const o=n[3];null!=o&&(r=Fm(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 Vm(t,e={}){return Object.keys(t).forEach(n=>{e[n]=t[n]}),e}function zm(t,e,n={}){if(e)for(let i in t)n[i]=t[i];else Vm(t,n);return n}function Um(t,e,n){return n?e+":"+n+";":""}function Hm(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]}),um()&&Hm(t))}function Gm(t,e){t.style&&(Object.keys(e).forEach(e=>{const n=Zm(e);t.style[n]=""}),um()&&Hm(t))}function Wm(t){return Array.isArray(t)?1==t.length?t[0]:Jg(t):t}const qm=new RegExp("{{\\s*(.+?)\\s*}}","g");function Xm(t){let e=[];if("string"==typeof t){let n;for(;n=qm.exec(t);)e.push(n[1]);qm.lastIndex=0}return e}function Ym(t,e,n){const i=t.toString(),r=i.replace(qm,(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 Km(t){const e=[];let n=t.next();for(;!n.done;)e.push(n.value),n=t.next();return e}const Qm=/-+([a-z0-9])/g;function Zm(t){return t.replace(Qm,(...t)=>t[1].toUpperCase())}function Jm(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function tb(t,e){return 0===t||0===e}function eb(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(ab(r,o));"<"==s[0]&&!("*"==r&&"*"==o)&&e.push(ab(o,r))}(t,n,e)):n.push(t),n}const sb=new Set(["true","1"]),ob=new Set(["false","0"]);function ab(t,e){const n=sb.has(t)||ob.has(t),i=sb.has(e)||ob.has(e);return(r,s)=>{let o="*"==t||t==r,a="*"==e||e==s;return!o&&n&&"boolean"==typeof r&&(o=r?sb.has(t):ob.has(t)),!a&&i&&"boolean"==typeof s&&(a=s?sb.has(e):ob.has(e)),o&&a}}const lb=new RegExp("s*:selfs*,?","g");function cb(t,e,n){return new ub(t).build(e,n)}class ub{constructor(t){this._driver=t}build(t,e){const n=new hb(e);return this._resetContextStyleTimingState(n),nb(this,Wm(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(db(t)){const e=t;Object.keys(e).forEach(t=>{Xm(e[t]).forEach(t=>{s.hasOwnProperty(t)||r.add(t)})})}}),r.size){const n=Km(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=nb(this,Wm(t.animation),e);return{type:1,matchers:rb(t.expr,e.errors),animation:n,queryCount:e.queryCount,depCount:e.depCount,options:pb(t.options)}}visitSequence(t,e){return{type:2,steps:t.steps.map(t=>nb(this,t,e)),options:pb(t.options)}}visitGroup(t,e){const n=e.currentTime;let i=0;const r=t.steps.map(t=>{e.currentTime=n;const r=nb(this,t,e);return i=Math.max(i,e.currentTime),r});return e.currentTime=i,{type:3,steps:r,options:pb(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 fb(Bm(t,e).duration,0,"");const i=t;if(i.split(/\s+/).some(t=>"{"==t.charAt(0)&&"{"==t.charAt(1))){const t=fb(0,0,"");return t.dynamic=!0,t.strValue=i,t}return n=n||Bm(i,e),fb(n.duration,n.delay,n.easing)}(t.timings,e.errors);e.currentAnimateTimings=n;let i,r=t.styles?t.styles:tm({});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=tm(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==Kg?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(db(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=Xm(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(db(t)&&t.hasOwnProperty("offset")){const n=t;e=parseFloat(n.offset),delete n.offset}});else if(db(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:nb(this,Wm(t.animation),e),options:pb(t.options)}}visitAnimateChild(t,e){return e.depCount++,{type:9,options:pb(t.options)}}visitAnimateRef(t,e){return{type:10,animation:this.visitReference(t.animation,e),options:pb(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(lb,"")),[t=t.replace(/@\*/g,Rm).replace(/@\w+/g,t=>Rm+"-"+t.substr(1)).replace(/:animating/g,Lm),e]}(t.selector);e.currentQuerySelector=n.length?n+" "+r:r,mm(e.collectedStyles,e.currentQuerySelector,{});const o=nb(this,Wm(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:pb(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"}:Bm(t.timings,e.errors,!0);return{type:12,animation:nb(this,Wm(t.animation),e),timings:n,options:null}}}class hb{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 db(t){return!Array.isArray(t)&&"object"==typeof t}function pb(t){return t?(t=Vm(t)).params&&(t.params=function(t){return t?Vm(t):null}(t.params)):t={},t}function fb(t,e,n){return{duration:t,delay:e,easing:n}}function gb(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 mb{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 bb=new RegExp(":enter","g"),yb=new RegExp(":leave","g");function vb(t,e,n,i,r,s={},o={},a,l,c=[]){return(new _b).buildKeyframes(t,e,n,i,r,s,o,a,l,c)}class _b{buildKeyframes(t,e,n,i,r,s,o,a,l,c=[]){l=l||new mb;const u=new xb(t,e,l,i,r,c,[]);u.options=a,u.currentTimeline.setStyles([s],null,u.errors,a),nb(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()):[gb(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?jm(n.duration):null,s=null!=n.delay?jm(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),nb(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=wb);const t=jm(r.delay);i.delayNextStep(t)}t.steps.length&&(t.steps.forEach(t=>nb(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?jm(t.options.delay):0;t.steps.forEach(s=>{const o=e.createSubContext(t.options);r&&o.delayNextStep(r),nb(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 Bm(e.params?Ym(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?jm(i.delay):0;r&&(6===e.previousNode.type||0==n&&e.currentTimeline.getCurrentStyleProperties().length)&&(e.currentTimeline.snapshotCurrentStyles(),e.previousNode=wb);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),nb(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;nb(this,t.animation,e),e.previousNode=t,n.currentStaggerTime=i.currentTime-c+(i.startTime-n.currentTimeline.startTime)}}const wb={};class xb{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=wb,this.subContextCount=0,this.options={},this.currentQueryIndex=0,this.currentQueryTotal=0,this.currentStaggerTime=0,this.currentTimeline=a||new Sb(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=jm(n.duration)),null!=n.delay&&(i.delay=jm(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]=Ym(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 xb(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=wb,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 Cb(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(bb,"."+this._enterClassName)).replace(yb,"."+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 Sb{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 Sb(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]||Kg,this._currentKeyframe[t]=Kg}),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]=Kg})):zm(t,!1,n)}),n}(t,this._globalTimelineStyles);Object.keys(s).forEach(t=>{const e=Ym(s[t],r,n);this._pendingStyles[t]=e,this._localTimelineStyles.hasOwnProperty(t)||(this._backFill[t]=this._globalTimelineStyles.hasOwnProperty(t)?this._globalTimelineStyles[t]:Kg),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=zm(r,!0);Object.keys(o).forEach(n=>{const i=o[n];"!"==i?t.add(n):i==Kg&&e.add(n)}),n||(o.offset=s/this.duration),i.push(o)});const r=t.size?Km(t.values()):[],s=e.size?Km(e.values()):[];if(n){const t=i[0],e=Vm(t);t.offset=0,e.offset=1,i=[t,e]}return gb(this.element,i,r,s,this.duration,this.startTime,this.easing,!1)}}class Cb extends Sb{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=zm(t[0],!1);a.offset=0,r.push(a);const l=zm(t[0],!1);l.offset=Eb(o),r.push(l);const c=t.length-1;for(let i=1;i<=c;i++){let o=zm(t[i],!1);o.offset=Eb((e+o.offset*n)/s),r.push(o)}n=s,e=0,i="",t=r}return gb(this.element,t,this.preStyleProps,this.postStyleProps,n,e,i,!0)}}function Eb(t,e=3){const n=Math.pow(10,e-1);return Math.round(t*n)/n}class Ob{}class Tb extends Ob{normalizePropertyName(t,e){return Zm(t)}normalizeStyleValue(t,e,n,i){let r="";const s=n.toString().trim();if(kb[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 kb=(()=>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 Pb(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 Ab={};class Mb{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||Ab,d=this.buildStyles(n,o&&o.params||Ab,u),p=a&&a.params||Ab,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?[]:vb(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 Pb(e,this._triggerName,n,i,y,d,f,[],[],m,b,w,u);_.forEach(t=>{const n=t.element,i=mm(m,n,{});t.preStyleProps.forEach(t=>i[t]=!0);const r=mm(b,n,{});t.postStyleProps.forEach(t=>r[t]=!0),n!==e&&g.add(n)});const x=Km(g.values());return Pb(e,this._triggerName,n,i,y,d,f,_,x,m,b,w)}}class Ib{constructor(t,e,n){this.styles=t,this.defaultParams=e,this.normalizer=n}buildStyles(t,e){const n={},i=Vm(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=Ym(s,i,e));const o=this.normalizer.normalizePropertyName(t,e);s=this.normalizer.normalizeStyleValue(t,o,s,e),n[o]=s})}}),n}}class Db{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 Ib(t.style,t.options&&t.options.params||{},n)}),Rb(this.states,"true","1"),Rb(this.states,"false","0"),e.transitions.forEach(e=>{this.transitionFactories.push(new Mb(t,e,this.states))}),this.fallbackTransition=function(t,e,n){return new Mb(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 Rb(t,e,n){t.hasOwnProperty(e)?t.hasOwnProperty(n)||(t[n]=t[e]):t.hasOwnProperty(n)&&(t[e]=t[n])}const Nb=new mb;class Lb{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=cb(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=dm(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=vb(this._driver,e,r,Mm,Im,{},{},n,Nb,i),s.forEach(t=>{const e=mm(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,Kg)})});const a=hm(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=gm(e,"","","");return pm(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 jb="ng-animate-queued",Fb="ng-animate-disabled",Bb=".ng-animate-disabled",Vb=[],zb={namespaceId:"",setForRemoval:!1,setForMove:!1,hasAnimation:!1,removedBeforeQueried:!1},Ub={namespaceId:"",setForMove:!1,setForRemoval:!1,hasAnimation:!1,removedBeforeQueried:!0},Hb="__ng_removed";class $b{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=Vm(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 Gb="void",Wb=new $b(Gb);class qb{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,ey(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=mm(this._elementListeners,t,[]),s={name:e,phase:n,callback:i};r.push(s);const o=mm(this._engine.statesByElement,t,{});return o.hasOwnProperty(e)||(ey(t,Dm),ey(t,Dm+"-"+e),o[e]=Wb),()=>{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 Yb(this.id,e,t);let o=this._engine.statesByElement.get(t);o||(ey(t,Dm),ey(t,Dm+"-"+e),this._engine.statesByElement.set(t,o={}));let a=o[e];const l=new $b(n,this.id);if(!(n&&n.hasOwnProperty("value"))&&a&&l.absorbOptions(a.options),o[e]=l,a||(a=Wb),l.value!==Gb&&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{Gm(t,n),$m(t,i)})}return}const c=mm(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||(ey(t,jb),s.onStart(()=>{ny(t,jb)})),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,Rm,!0);n.forEach(t=>{if(t[Hb])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,Gb,i);n&&s.push(n)}}),s.length)return this._engine.markElementAsRemoved(this.id,t,!0,e),n&&hm(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]||Wb,a=new $b(Gb),l=new Yb(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[Hb];(!i||i===zb)&&(n.afterFlush(()=>this.clearElementCache(t)),n.destroyInnerAnimations(t),n._onRemovalComplete(t,e))}}insertNode(t,e){ey(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=gm(r,n.triggerName,n.fromState.value,n.toState.value);i._data=t,pm(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 Xb{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 qb(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),ey(t,Fb)):this.disabledNodes.has(t)&&(this.disabledNodes.delete(t),ny(t,Fb))}removeNode(t,e,n,i){if(Kb(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[Hb]={namespaceId:t,setForRemoval:i,hasAnimation:n,removedBeforeQueried:!1}}listen(t,e,n,i,r){return Kb(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,Rm,!0);e.forEach(t=>this.destroyActiveAnimationsForElement(t)),0!=this.playersByQueriedElement.size&&(e=this.driver.query(t,Lm,!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 hm(this.players).onDone(()=>t());t()})}processLeaveNode(t){const e=t[Hb];if(e&&e.setForRemoval){if(t[Hb]=zb,e.namespaceId){this.destroyInnerAnimations(t);const n=this._fetchNamespace(e.namespaceId);n&&n.clearElementCache(t)}this._onRemovalComplete(t,e.setForRemoval)}this.driver.matchesElement(t,Bb)&&this.markElementAsDisabled(t,!1),this.driver.query(t,Bb,!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?hm(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 mb,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=Mm+f++;p.set(e,n),t.forEach(t=>ey(t,n))});const g=[],m=new Set,b=new Set;for(let A=0;Am.add(t)):b.add(t))}const y=new Map,v=Jb(h,Array.from(m));v.forEach((t,e)=>{const n=Im+f++;y.set(e,n),t.forEach(t=>ey(t,n))}),t.push(()=>{d.forEach((t,e)=>{const n=p.get(e);t.forEach(t=>ny(t,n))}),v.forEach((t,e)=>{const n=y.get(e);t.forEach(t=>ny(t,n))}),g.forEach(t=>{this.processLeaveNode(t)})});const _=[],w=[];for(let A=this._namespaceList.length-1;A>=0;A--)this._namespaceList[A].drainQueuedTransitions(e).forEach(t=>{const e=t.player,r=t.element;if(_.push(e),this.collectedEnterElements.length){const t=r[Hb];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(()=>Gm(r,f.fromStyles)),e.onDestroy(()=>$m(r,f.toStyles)),void i.push(e);if(t.isFallbackTransition)return e.onStart(()=>Gm(r,f.fromStyles)),e.onDestroy(()=>$m(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=>mm(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=>{mm(x,e,[]).push(t),t.destroy()})});const C=g.filter(t=>sy(t,a,l)),E=new Map;Zb(E,this.driver,b,l,Kg).forEach(t=>{sy(t,a,l)&&C.push(t)});const O=new Map;d.forEach((t,e)=>{Zb(O,this.driver,new Set(t),a,"!")}),C.forEach(t=>{const e=E.get(t),n=O.get(t);E.set(t,Object.assign(Object.assign({},e),n))});const T=[],k=[],P={};s.forEach(t=>{const{element:e,player:s,instruction:o}=t;if(n.has(e)){if(c.has(e))return s.onDestroy(()=>$m(e,o.toStyles)),s.disabled=!0,s.overrideTotalTime(o.totalTime),void i.push(s);let t=P;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,E);if(s.setRealPlayer(n),t===P)T.push(s);else{const e=this.playersByElement.get(t);e&&e.length&&(s.parentPlayer=hm(e)),i.push(s)}}else Gm(e,o.fromStyles),s.onDestroy(()=>$m(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=hm(e);t.setRealPlayer(n)}}),i.forEach(t=>{t.parentPlayer?t.syncPlayerEvents(t.parentPlayer):t.destroy()});for(let A=0;A!t.destroyed);i.length?iy(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[Hb];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==Gb;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=mm(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)})}Gm(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[Hb];if(d&&d.removedBeforeQueried)return new am(e.duration,e.delay);const p=h!==a,f=function(t){const e=[];return ry(t,e),e}((n.get(h)||Vb).map(t=>t.getRealPlayer())).filter(t=>!!t.element&&t.element===h),g=r.get(h),m=s.get(h),b=dm(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 Yb(t,o,h);e.setRealPlayer(y),l.push(e)}return y});l.forEach(t=>{mm(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=>ey(t,Nm));const d=hm(h);return d.onDestroy(()=>{c.forEach(t=>ny(t,Nm)),$m(a,e.toStyles)}),u.forEach(t=>{mm(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 am(t.duration,t.delay)}}class Yb{constructor(t,e,n){this.namespaceId=t,this.triggerName=e,this.element=n,this._player=new am,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=>pm(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){mm(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 Kb(t){return t&&1===t.nodeType}function Qb(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(Qb(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[Hb]=Ub,o.push(i))}),t.set(i,s)});let a=0;return n.forEach(t=>Qb(t,s[a++])),o}function Jb(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 ty="$$classes";function ey(t,e){if(t.classList)t.classList.add(e);else{let n=t[ty];n||(n=t[ty]={}),n[e]=!0}}function ny(t,e){if(t.classList)t.classList.remove(e);else{let n=t[ty];n&&delete n[e]}}function iy(t,e,n){hm(n).onDone(()=>t.processLeaveNode(e))}function ry(t,e){for(let n=0;nr.add(t)):e.set(t,i),n.delete(t),!0}class oy{constructor(t,e,n){this.bodyNode=t,this._driver=e,this._normalizer=n,this._triggerCache={},this.onRemovalComplete=(t,e)=>{},this._transitionEngine=new Xb(t,e,n),this._timelineEngine=new Lb(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=cb(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 Db(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]=bm(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]=bm(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 ay(t,e){let n=null,i=null;return Array.isArray(e)&&e.length?(n=cy(e[0]),e.length>1&&(i=cy(e[e.length-1]))):e&&(n=cy(e)),n||i?new ly(t,n,i):null}class ly{constructor(t,e,n){this._element=t,this._startStyles=e,this._endStyles=n,this._state=0;let i=ly.initialStylesByElement.get(t);i||ly.initialStylesByElement.set(t,i={}),this._initialStyles=i}start(){this._state<1&&(this._startStyles&&$m(this._element,this._startStyles,this._initialStyles),this._state=1)}finish(){this.start(),this._state<2&&($m(this._element,this._initialStyles),this._endStyles&&($m(this._element,this._endStyles),this._endStyles=null),this._state=1)}destroy(){this.finish(),this._state<3&&(ly.initialStylesByElement.delete(this._element),this._startStyles&&(Gm(this._element,this._startStyles),this._endStyles=null),this._endStyles&&(Gm(this._element,this._endStyles),this._endStyles=null),$m(this._element,this._initialStyles),this._state=3)}}function cy(t){let e=null;const n=Object.keys(t);for(let i=0;ithis._handleCallback(t)}apply(){(function(t,e){const n=vy(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(),by(this._element,this._eventFn,!0))}destroy(){this._destroyed||(this._destroyed=!0,this.finish(),function(t,e){const n=vy(t,"").split(","),i=my(n,e);i>=0&&(n.splice(i,1),yy(t,"",n.join(",")))}(this._element,this._name))}}function fy(t,e,n){yy(t,"PlayState",n,gy(t,e))}function gy(t,e){const n=vy(t,"");return n.indexOf(",")>0?my(n.split(","),e):my([n],e)}function my(t,e){for(let n=0;n=0)return n;return-1}function by(t,e,n){n?t.removeEventListener(dy,e):t.addEventListener(dy,e)}function yy(t,e,n,i){const r=hy+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 vy(t,e){return t.style[hy+e]||""}class _y{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 py(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]:ib(this.element,n))})}this.currentSnapshot=t}}class wy extends am{constructor(t,e){super(),this.element=t,this._startingStyles={},this.__initialized=!1,this._styles=km(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 xy{constructor(){this._count=0}validateStyleProperty(t){return Cm(t)}matchesElement(t,e){return Em(t,e)}containsElement(t,e){return Om(t,e)}query(t,e,n){return Tm(t,e,n)}computeStyle(t,e,n){return window.getComputedStyle(t)[e]}buildKeyframeElement(t,e,n){n=n.map(t=>km(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 _y),l={};tb(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=eb(t,e,l));if(0==n)return new wy(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=ay(t,e),p=new _y(t,e,u,n,i,r,c,d);return p.onDestroy(()=>function(t){t.parentNode.removeChild(t)}(h)),p}}class Sy{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]:ib(this.element,e))}),this.currentSnapshot=t}triggerCallback(t){const e="start"==t?this._onStartFns:this._onDoneFns;e.forEach(t=>t()),e.length=0}}class Cy{constructor(){this._isNativeImpl=/\{\s*\[native\s+code\]\s*\}/.test(Ey().toString()),this._cssKeyframesDriver=new xy}validateStyleProperty(t){return Cm(t)}matchesElement(t,e){return Em(t,e)}containsElement(t,e){return Om(t,e)}query(t,e,n){return Tm(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 Sy);tb(n,i)&&c.forEach(t=>{let e=t.currentSnapshot;Object.keys(e).forEach(t=>l[t]=e[t])});const u=ay(t,e=eb(t,e=e.map(t=>zm(t,!1)),l));return new Sy(t,e,a,u)}}function Ey(){return cm()&&Element.prototype.animate||{}}let Oy=(()=>{class t extends Yg{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)?Jg(t):t;return Py(this._renderer,null,e,"register",[n]),new Ty(e,this._renderer)}}return t.\u0275fac=function(e){return new(e||t)(Ei(Il),Ei(th))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();class Ty extends class{}{constructor(t,e){super(),this._id=t,this._renderer=e}create(t,e){return new ky(this._id,t,e||{},this._renderer)}}class ky{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 Py(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 Py(t,e,n,i,r){return t.setProperty(e,`@@${n}:${i}`,r)}const Ay="@.disabled";let My=(()=>{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 Iy("",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 Dy(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)(Ei(Il),Ei(oy),Ei(Tu))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();class Iy{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==Ay?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 Dy extends Iy{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==Ay?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 Ry=(()=>{class t extends oy{constructor(t,e,n){super(t.body,e,n)}ngOnDestroy(){this.flush()}}return t.\u0275fac=function(e){return new(e||t)(Ei(th),Ei(Am),Ei(Ob))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();const Ny=new oi("AnimationModuleType"),Ly=[{provide:Yg,useClass:Oy},{provide:Ob,useFactory:function(){return new Tb}},{provide:oy,useClass:Ry},{provide:Il,useFactory:function(t,e,n){return new My(t,e,n)},deps:[pd,oy,Tu]}],jy=[{provide:Am,useFactory:function(){return"function"==typeof Ey()?new Cy:new xy}},{provide:Ny,useValue:"BrowserAnimations"},...Ly],Fy=[{provide:Am,useClass:Pm},{provide:Ny,useValue:"NoopAnimations"},...Ly];let By=(()=>{class t{static withConfig(e){return{ngModule:t,providers:e.disableAnimations?Fy:jy}}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({providers:jy,imports:[Td]}),t})();function Vy(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 zy(t,e){if(1&t&&(ra(0,"span",5),Ja(1),sa()),2&t){const t=va();ws(1),el("(",t.group.label,")")}}const Uy=["*"],Hy=new Ll("12.2.5"),$y=new oi("mat-sanity-checks",{providedIn:"root",factory:function(){return!0}});let Gy,Wy=(()=>{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!(!Vu()||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")&&Hy.full!==Xg.full&&console.warn("The Angular Material version ("+Hy.full+") does not match the Angular CDK version ("+Xg.full+").\nPlease ensure the versions of these two packages exactly match.")}}return t.\u0275fac=function(e){return new(e||t)(Ei(Wg),Ei($y,8),Ei(th))},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Bp],Bp]}),t})();function qy(t){return class extends t{constructor(...t){super(...t),this._disabled=!1}get disabled(){return this._disabled}set disabled(t){this._disabled=kd(t)}}}function Xy(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 Yy(t){return class extends t{constructor(...t){super(...t),this._disableRipple=!1}get disableRipple(){return this._disableRipple}set disableRipple(t){this._disableRipple=kd(t)}}}function Ky(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?Pd(t):this.defaultTabIndex}}}function Qy(t){return class extends t{constructor(...t){super(...t),this.stateChanges=new A,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{Gy="undefined"!=typeof Intl}catch(m){Gy=!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})(),Jy=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275dir=se({type:t,selectors:[["","mat-line",""],["","matLine",""]],hostAttrs:[1,"mat-line"]}),t})();function tv(t,e,n){const i=t.nativeElement.classList;n?i.add(e):i.remove(e)}let ev=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Wy],Wy]}),t})();class nv{constructor(t,e,n){this._renderer=t,this.element=e,this.config=n,this.state=3}fadeOut(){this._renderer.fadeOutRipple(this)}}const iv={enterDuration:225,exitDuration:150},rv=Ip({passive:!0}),sv=["mousedown","touchstart"],ov=["mouseup","mouseleave","touchend","touchcancel"];class av{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=Id(n))}fadeInRipple(t,e,n={}){const i=this._containerRect=this._containerRect||this._containerElement.getBoundingClientRect(),r=Object.assign(Object.assign({},iv),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 nv(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({},iv),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=Id(t);!e||e===this._triggerElement||(this._removeTriggerEvents(),this._triggerElement=e,this._registerEvents(sv))}handleEvent(t){"mousedown"===t.type?this._onMousedown(t):"touchstart"===t.type?this._onTouchStart(t):this._onPointerUp(),this._pointerUpEventsRegistered||(this._registerEvents(ov),this._pointerUpEventsRegistered=!0)}_onMousedown(t){const e=Mg(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,rv)})})}_removeTriggerEvents(){this._triggerElement&&(sv.forEach(t=>{this._triggerElement.removeEventListener(t,this,rv)}),this._pointerUpEventsRegistered&&ov.forEach(t=>{this._triggerElement.removeEventListener(t,this,rv)}))}}const lv=new oi("mat-ripple-global-options");let cv=(()=>{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 av(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(Al),ea(Tu),ea(Ep),ea(lv,8),ea(Ny,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})(),uv=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Wy,Op],Wy]}),t})(),hv=(()=>{class t{constructor(t){this._animationMode=t,this.state="unchecked",this.disabled=!1}}return t.\u0275fac=function(e){return new(e||t)(ea(Ny,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})(),dv=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Wy]]}),t})();const pv=new oi("MAT_OPTION_PARENT_COMPONENT"),fv=qy(class{});let gv=0,mv=(()=>{class t extends fv{constructor(t){var e;super(),this._labelId="mat-optgroup-label-"+gv++,this._inert=null!==(e=null==t?void 0:t.inertGroups)&&void 0!==e&&e}}return t.\u0275fac=function(e){return new(e||t)(ea(pv,8))},t.\u0275dir=se({type:t,inputs:{label:"label"},features:[jo]}),t})();const bv=new oi("MatOptgroup");let yv=0;class vv{constructor(t,e=!1){this.source=t,this.isUserInput=e}}let _v=(()=>{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-"+yv++,this.onSelectionChange=new Bc,this._stateChanges=new A}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=kd(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)&&!uf(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 vv(this,t))}}return t.\u0275fac=function(e){return new(e||t)(ea(Al),ea(nc),ea(void 0),ea(mv))},t.\u0275dir=se({type:t,inputs:{id:"id",disabled:"disabled",value:"value"},outputs:{onSelectionChange:"onSelectionChange"}}),t})(),wv=(()=>{class t extends _v{constructor(t,e,n,i){super(t,e,n,i)}}return t.\u0275fac=function(e){return new(e||t)(ea(Al),ea(nc),ea(pv,8),ea(bv,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&&(rl("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: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(t,e){1&t&&(wa(),Jo(0,Vy,1,2,"mat-pseudo-checkbox",0),ra(1,"span",1),xa(2),sa(),Jo(3,zy,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:[Ah,cv,hv],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 xv(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 Cv=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[uv,Wh,Wy,dv]]}),t})();function Ev(...t){if(1===t.length){const e=t[0];if(d(e))return Ov(e,null);if(p(e)&&Object.getPrototypeOf(e)===Object.prototype){const t=Object.keys(e);return Ov(t.map(t=>e[t]),t)}}if("function"==typeof t[t.length-1]){const e=t.pop();return Ov(t=1===t.length&&d(t[0])?t[0]:t,null).pipe(D(t=>e(...t)))}return Ov(t,null)}function Ov(t,e){return new E(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 Tv(t){return function(e){const n=new kv(t),i=e.lift(n);return n.caught=i}}class kv{constructor(t){this.selector=t}call(t,e){return e.subscribe(new Pv(t,this.selector,this.caught))}}class Pv 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 Av(t){return e=>e.lift(new Mv(t))}class Mv{constructor(t){this.callback=t}call(t,e){return e.subscribe(new Iv(t,this.callback))}}class Iv extends v{constructor(t,e){super(t),this.add(new g(e))}}class Dv{}class Rv{}class Nv{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 Nv?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 Nv;return e.lazyInit=this.lazyInit&&this.lazyInit instanceof Nv?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 Lv{encodeKey(t){return Bv(t)}encodeValue(t){return Bv(t)}decodeKey(t){return decodeURIComponent(t)}decodeValue(t){return decodeURIComponent(t)}}const jv=/%(\d[a-f0-9])/gi,Fv={40:"@","3A":":",24:"$","2C":",","3B":";","2B":"+","3D":"=","3F":"?","2F":"/"};function Bv(t){return encodeURIComponent(t).replace(jv,(t,e)=>{var n;return null!==(n=Fv[e])&&void 0!==n?n:t})}function Vv(t){return`${t}`}class zv{constructor(t={}){if(this.updates=null,this.cloneFrom=null,this.encoder=t.encoder||new Lv,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 zv({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(Vv(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(Vv(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 Uv{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 Hv(t){return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer}function $v(t){return"undefined"!=typeof Blob&&t instanceof Blob}function Gv(t){return"undefined"!=typeof FormData&&t instanceof FormData}class Wv{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 Nv),this.context||(this.context=new Uv),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 Wv(n,i,s,{params:c,headers:l,context:u,reportProgress:a,responseType:r,withCredentials:o})}}var qv=(()=>((qv=qv||{})[qv.Sent=0]="Sent",qv[qv.UploadProgress=1]="UploadProgress",qv[qv.ResponseHeader=2]="ResponseHeader",qv[qv.DownloadProgress=3]="DownloadProgress",qv[qv.Response=4]="Response",qv[qv.User=5]="User",qv))();class Xv{constructor(t,e=200,n="OK"){this.headers=t.headers||new Nv,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 Yv extends Xv{constructor(t={}){super(t),this.type=qv.ResponseHeader}clone(t={}){return new Yv({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 Kv extends Xv{constructor(t={}){super(t),this.type=qv.Response,this.body=void 0!==t.body?t.body:null}clone(t={}){return new Kv({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 Qv extends Xv{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 Zv(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 Jv=(()=>{class t{constructor(t){this.handler=t}request(t,e,n={}){let i;if(t instanceof Wv)i=t;else{let r,s;r=n.headers instanceof Nv?n.headers:new Nv(n.headers),n.params&&(s=n.params instanceof zv?n.params:new zv({fromObject:n.params})),i=new Wv(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=Dd(i).pipe(function(t,e){return W(t,e,1)}(t=>this.handler.handle(t)));if(t instanceof Wv||"events"===n.observe)return r;const s=r.pipe(ep(t=>t instanceof Kv));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 zv).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,Zv(n,e))}post(t,e,n={}){return this.request("POST",t,Zv(n,e))}put(t,e,n={}){return this.request("PUT",t,Zv(n,e))}}return t.\u0275fac=function(e){return new(e||t)(Ei(Dv))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();class t_{constructor(t,e){this.next=t,this.interceptor=e}handle(t){return this.interceptor.intercept(t,this.next)}}const e_=new oi("HTTP_INTERCEPTORS");let n_=(()=>{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 i_=/^\)\]\}',?\n/;let r_=(()=>{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 E(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 Nv(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 Yv({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(i_,"");try{l=""!==l?JSON.parse(l):null}catch(u){l=t,c&&(c=!1,l={error:u,text:l})}}c?(e.next(new Kv({body:l,headers:i,status:r,statusText:o,url:a||void 0})),e.complete()):e.error(new Qv({error:l,headers:i,status:r,statusText:o,url:a||void 0}))},a=t=>{const{url:i}=s(),r=new Qv({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:qv.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:qv.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:qv.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)(Ei(Yh))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();const s_=new oi("XSRF_COOKIE_NAME"),o_=new oi("XSRF_HEADER_NAME");class a_{}let l_=(()=>{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=Eh(t,this.cookieName),this.lastCookieString=t),this.lastToken}}return t.\u0275fac=function(e){return new(e||t)(Ei(th),Ei(hu),Ei(s_))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),c_=(()=>{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)(Ei(a_),Ei(o_))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),u_=(()=>{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(e_,[]);this.chain=t.reduceRight((t,e)=>new t_(t,e),this.backend)}return this.chain.handle(t)}}return t.\u0275fac=function(e){return new(e||t)(Ei(Rv),Ei(No))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),h_=(()=>{class t{static disable(){return{ngModule:t,providers:[{provide:c_,useClass:n_}]}}static withOptions(e={}){return{ngModule:t,providers:[e.cookieName?{provide:s_,useValue:e.cookieName}:[],e.headerName?{provide:o_,useValue:e.headerName}:[]]}}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({providers:[c_,{provide:e_,useExisting:c_,multi:!0},{provide:a_,useClass:l_},{provide:s_,useValue:"XSRF-TOKEN"},{provide:o_,useValue:"X-XSRF-TOKEN"}]}),t})(),d_=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({providers:[Jv,{provide:Dv,useClass:u_},r_,{provide:Rv,useExisting:r_}],imports:[[h_.withOptions({cookieName:"XSRF-TOKEN",headerName:"X-XSRF-TOKEN"})]]}),t})();const p_=["*"];function f_(t){return Error(`Unable to find icon with the name "${t}"`)}function g_(t){return Error(`The URL provided to MatIconRegistry was not trusted as a resource URL via Angular's DomSanitizer. Attempted URL was "${t}".`)}function m_(t){return Error(`The literal provided to MatIconRegistry was not trusted as safe HTML by Angular's DomSanitizer. Attempted literal was "${t}".`)}class b_{constructor(t,e,n){this.url=t,this.svgText=e,this.options=n}}let y_=(()=>{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 b_(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 m_(n);return this._addSvgIconConfig(t,e,new b_("",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 b_(e,null,n))}addSvgIconSetLiteralInNamespace(t,e,n){const i=this._sanitizer.sanitize(yr.HTML,e);if(!i)throw m_(e);return this._addSvgIconSetConfig(t,new b_("",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 g_(t);const n=this._cachedIconsByUrl.get(e);return n?Dd(v_(n)):this._loadSvgIconFromConfig(new b_(t,null)).pipe(eg(t=>this._cachedIconsByUrl.set(e,t)),D(t=>v_(t)))}getNamedSvgIcon(t,e=""){const n=__(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):gp(f_(n))}ngOnDestroy(){this._resolvers=[],this._svgIconConfigs.clear(),this._iconSetConfigs.clear(),this._cachedIconsByUrl.clear()}_getSvgFromConfig(t){return t.svgText?Dd(v_(this._svgElementFromConfig(t))):this._loadSvgIconFromConfig(t).pipe(D(t=>v_(t)))}_getSvgFromIconSetConfigs(t,e){const n=this._extractIconWithNameFromAnySet(t,e);return n?Dd(n):Ev(e.filter(t=>!t.svgText).map(t=>this._loadSvgIconSetFromConfig(t).pipe(Tv(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)),Dd(null)})))).pipe(D(()=>{const n=this._extractIconWithNameFromAnySet(t,e);if(!n)throw f_(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(eg(e=>t.svgText=e),D(()=>this._svgElementFromConfig(t)))}_loadSvgIconSetFromConfig(t){return t.svgText?Dd(null):this._fetchIcon(t).pipe(eg(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(__(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:""}}}),C_=["clip-path","color-profile","src","cursor","fill","filter","marker","marker-start","marker-mid","marker-end","mask","stroke"],E_=C_.map(t=>`[${t}]`).join(", "),O_=/^url\(['"]?#(.*?)['"]?\)$/;let T_=(()=>{class t extends x_{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=kd(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(E_),n=this._elementsWithExternalReferences=this._elementsWithExternalReferences||new Map;for(let i=0;i{const r=e[i],s=r.getAttribute(t),o=s?s.match(O_):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(rf(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(Al),ea(y_),ii("aria-hidden"),ea(S_),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:p_,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})(),k_=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Wy],Wy]}),t})();const P_=["mat-button",""],A_=["*"],M_=".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",I_=["mat-button","mat-flat-button","mat-icon-button","mat-raised-button","mat-stroked-button","mat-mini-fab","mat-fab"],D_=Xy(qy(Yy(class{constructor(t){this._elementRef=t}})));let R_=(()=>{class t extends D_{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 I_)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(Al),ea(Ug),ea(Ny,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&&Zc(cv,5),2&t){let t;Qc(t=tu())&&(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:P_,ngContentSelectors:A_,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:[cv],styles:[M_],encapsulation:2,changeDetection:0}),t})(),N_=(()=>{class t extends R_{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(Ug),ea(Al),ea(Ny,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:P_,ngContentSelectors:A_,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:[cv],styles:[M_],encapsulation:2,changeDetection:0}),t})(),L_=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[uv,Wy],Wy]}),t})();class j_ 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 F_ 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 B_(t,e,n,i,r=new F_(t,n,i)){if(!r.closed)return e instanceof E?e.subscribe(r):V(e)(r)}const V_={};function z_(...t){let e,n;return I(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 U_(e))}class U_{constructor(t){this.resultSelector=t}call(t,e){return e.subscribe(new H_(t,this.resultSelector))}}class H_ extends j_{constructor(t,e){super(t),this.resultSelector=e,this.active=0,this.values=[],this.observables=[]}_next(t){this.values.push(V_),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):q_}matchMedia(t){return this._platform.WEBKIT&&function(t){if(!$_.has(t))try{G_||(G_=document.createElement("style"),G_.setAttribute("type","text/css"),document.head.appendChild(G_)),G_.sheet&&(G_.sheet.insertRule(`@media ${t} {.fx-query-test{ }}`,0),$_.add(t))}catch(e){console.error(e)}}(t),this._matchMedia(t)}}return t.\u0275fac=function(e){return new(e||t)(Ei(Ep))},t.\u0275prov=xt({factory:function(){return new t(Ei(Ep))},token:t,providedIn:"root"}),t})();function q_(t){return{matches:"all"===t||""===t,media:t,addListener:()=>{},removeListener:()=>{}}}let X_=(()=>{class t{constructor(t,e){this._mediaMatcher=t,this._zone=e,this._queries=new Map,this._destroySubject=new A}ngOnDestroy(){this._destroySubject.next(),this._destroySubject.complete()}isMatched(t){return Y_(Ad(t)).some(t=>this._registerQuery(t).mql.matches)}observe(t){let e=z_(Y_(Ad(t)).map(t=>this._registerQuery(t).observable));return e=ap(e.pipe(rf(1)),e.pipe(lg(1),rg(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 E(t=>{const n=e=>this._zone.run(()=>t.next(e));return e.addListener(n),()=>{e.removeListener(n)}}).pipe(lp(e),D(({matches:e})=>({query:t,matches:e})),rp(this._destroySubject)),mql:e};return this._queries.set(t,n),n}}return t.\u0275fac=function(e){return new(e||t)(Ei(W_),Ei(Tu))},t.\u0275prov=xt({factory:function(){return new t(Ei(W_),Ei(Tu))},token:t,providedIn:"root"}),t})();function Y_(t){return t.map(t=>t.split(",")).reduce((t,e)=>t.concat(e)).map(t=>t.trim())}function K_(t,e){if(1&t){const t=ua();ra(0,"div",1),ra(1,"button",2),fa("click",function(){return $e(t),va().action()}),Ja(2),sa(),sa()}if(2&t){const t=va();ws(2),tl(t.data.action)}}function Q_(t,e){}const Z_=new oi("MatSnackBarData");class J_{constructor(){this.politeness="assertive",this.announcementMessage="",this.duration=0,this.data=null,this.horizontalPosition="center",this.verticalPosition="bottom"}}const tw=Math.pow(2,31)-1;class ew{constructor(t,e){this._overlayRef=e,this._afterDismissed=new A,this._afterOpened=new A,this._onAction=new A,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,tw))}_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 nw=(()=>{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(ew),ea(Z_))},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"),Ja(1),sa(),Jo(2,K_,3,1,"div",0)),2&t&&(ws(1),tl(e.data.message),ws(1),na("ngIf",e.hasAction))},directives:[Ah,R_],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 iw={snackBarState:Qg("state",[em("void, hidden",tm({transform:"scale(0.8)",opacity:0})),em("visible",tm({transform:"scale(1)",opacity:1})),im("* => visible",Zg("150ms cubic-bezier(0, 0, 0.2, 1)")),im("* => void, * => hidden",Zg("75ms cubic-bezier(0.4, 0.0, 1, 1)",tm({opacity:0})))])};let rw=(()=>{class t extends Kp{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 A,this._onExit=new A,this._onEnter=new A,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(rf(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(Tu),ea(Al),ea(nc),ea(Ep),ea(J_))},t.\u0275cmp=Jt({type:t,selectors:[["snack-bar-container"]],viewQuery:function(t,e){if(1&t&&Zc(tf,7),2&t){let t;Qc(t=tu())&&(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&&sl("@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,Q_,0,0,"ng-template",1),sa(),oa(2,"div")),2&t&&(ws(2),Ko("aria-live",e._live)("role",e._role))},directives:[tf],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:[iw.snackBarState]}}),t})(),sw=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Wf,ef,Wh,L_,Wy],Wy]}),t})();const ow=new oi("mat-snack-bar-default-options",{providedIn:"root",factory:function(){return new J_}});let aw=(()=>{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=nw,this.snackBarContainerComponent=rw,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:J_,useValue:e}]}),i=new qp(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 J_),this._defaultConfig),e),i=this._createOverlay(n),r=this._attachSnackBarContainer(i,n),s=new ew(r,i);if(t instanceof ac){const e=new Xp(t,null,{$implicit:n.data,snackBarRef:s});s.instance=r.attachTemplatePortal(e)}else{const e=this._createInjector(n,s),i=new qp(t,void 0,e),o=r.attachComponentPortal(i);s.instance=o.instance}return this._breakpointObserver.observe("(max-width: 599.98px) and (orientation: portrait)").pipe(rp(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 vf;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:ew,useValue:e},{provide:Z_,useValue:t.data}]})}}return t.\u0275fac=function(e){return new(e||t)(Ei(Vf),Ei(Bg),Ei(No),Ei(X_),Ei(t,12),Ei(ow))},t.\u0275prov=xt({factory:function(){return new t(Ei(Vf),Ei(Bg),Ei(_o),Ei(X_),Ei(t,12),Ei(ow))},token:t,providedIn:sw}),t})();const lw={tooltipState:Qg("state",[em("initial, void, hidden",tm({opacity:0,transform:"scale(0)"})),em("visible",tm({transform:"scale(1)"})),im("* => visible",Zg("200ms cubic-bezier(0, 0, 0.2, 1)",nm([tm({opacity:0,transform:"scale(0)",offset:0}),tm({opacity:.5,transform:"scale(0.99)",offset:.5}),tm({opacity:1,transform:"scale(1)",offset:1})]))),im("* => hidden",Zg("100ms cubic-bezier(0, 0, 0.2, 1)",tm({opacity:0})))])},cw="tooltip-panel",uw=Ip({passive:!0}),hw=new oi("mat-tooltip-scroll-strategy"),dw={provide:hw,deps:[Vf],useFactory:function(t){return()=>t.scrollStrategies.reposition({scrollThrottle:20})}},pw=new oi("mat-tooltip-default-options",{providedIn:"root",factory:function(){return{showDelay:0,hideDelay:0,touchendHideDelay:1500}}});let fw=(()=>{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 A,this._handleKeydown=t=>{this._isTooltipVisible()&&27===t.keyCode&&!uf(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(rp(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=kd(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(rp(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,uw)}),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 qp(this._tooltipComponent,this._viewContainerRef),this._tooltipInstance=e.attach(this._portal).instance,this._tooltipInstance.afterHidden().pipe(rp(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(rp(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}-${cw}`,scrollStrategy:this._scrollStrategy()}),this._updatePosition(this._overlayRef),this._overlayRef.detachments().pipe(rp(this._destroyed)).subscribe(()=>this._detach()),this._overlayRef.outsidePointerEvents().pipe(rp(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(rf(1),rp(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}-${cw}-`;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,uw)})}_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(Vf),ea(Al),ea(Up),ea(pc),ea(Tu),ea(Ep),ea(xg),ea(Ug),ea(void 0),ea(Fp),ea(void 0),ea(th))},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})(),gw=(()=>{class t extends fw{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=bw}}return t.\u0275fac=function(e){return new(e||t)(ea(Vf),ea(Al),ea(Up),ea(pc),ea(Tu),ea(Ep),ea(xg),ea(Ug),ea(hw),ea(Fp,8),ea(pw,8),ea(th))},t.\u0275dir=se({type:t,selectors:[["","matTooltip",""]],hostAttrs:[1,"mat-tooltip-trigger"],exportAs:["matTooltip"],features:[jo]}),t})(),mw=(()=>{class t{constructor(t){this._changeDetectorRef=t,this._visibility="initial",this._closeOnInteraction=!1,this._onHide=new A}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(nc))},t.\u0275dir=se({type:t}),t})(),bw=(()=>{class t extends mw{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(nc),ea(X_))},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)}),Dc(1,"async"),Ja(2),sa()),2&t){let t;ja("mat-tooltip-handset",null==(t=Rc(1,5,e._isHandset))?null:t.matches),na("ngClass",e.tooltipClass)("@state",e._visibility),ws(2),tl(e.message)}},directives:[Oh],pipes:[$h],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:[lw.tooltipState]},changeDetection:0}),t})(),yw=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({providers:[dw],imports:[[qg,Wh,Wf,Wy],Wy,$p]}),t})();function vw(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 _w(t,e){return function(n,i){e(n,i,t)}}function ww(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function xw(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 Sw(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 Cw(){return!("object"==typeof process&&"[object process]"===String(process)&&!process.browser)||Sw()}const Ew="undefined"!=typeof __VERSION__?__VERSION__:"untranspiled source",Ow=Cw();class Tw{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 kw(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 Pw={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 Aw(t){return"string"==typeof t?Pw[t.toUpperCase()]||Pw.WHITE:t}function Mw(t,e){if(!t)throw new Error(e||"Assertion failed")}const Iw={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},Dw=Iw.window||Iw.self||Iw.global,Rw=Iw.process||{};function Nw(){let t;if(Ow&&Dw.performance)t=Dw.performance.now();else if(Rw.hrtime){const e=Rw.hrtime();t=1e3*e[0]+e[1]/1e6}else t=Date.now();return t}console;const Lw={debug:Ow&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},jw={enabled:!0,level:0};function Fw(){}const Bw={},Vw={once:!0};function zw(t){for(const e in t)for(const n in t[e])return n||"untitled";return"empty"}let Uw=(()=>{class t{constructor({id:t}={id:""}){this.id=t,this.VERSION=Ew,this._startTs=Nw(),this._deltaTs=Nw(),this.LOG_THROTTLE_TIMEOUT=0,this._storage=new Tw("__probe-".concat(this.id,"__"),jw),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((Nw()-this._startTs).toPrecision(10))}getDelta(){return Number((Nw()-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){Mw(t,e)}warn(t){return this._getLogFunction(0,t,Lw.warn,arguments,Vw)}error(t){return this._getLogFunction(0,t,Lw.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,Lw.log,arguments,{time:!0,once:!0})}log(t,e){return this._getLogFunction(t,e,Lw.debug,arguments)}info(t,e){return this._getLogFunction(t,e,console.info,arguments)}once(t,e){return this._getLogFunction(t,e,Lw.debug||Lw.info,arguments,Vw)}table(t,e,n){return e?this._getLogFunction(t,e,console.table||Fw,n&&[n],{tag:zw(e)}):Fw}image({logLevel:t,priority:e,image:i,message:r="",scale:s=1}){return this._shouldLog(t||e)?Ow?function({image:t,message:e="",scale:n=1}){if("string"==typeof t){const i=new Image;return i.onload=()=>{const t=kw(i,e,n);console.log(...t)},i.src=t,Fw}const i=t.nodeName||"";if("img"===i.toLowerCase())return console.log(...kw(t,e,n)),Fw;if("canvas"===i.toLowerCase()){const i=new Image;return i.onload=()=>console.log(...kw(i,e,n)),i.src=t.toDataURL(),Fw}return Fw}({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)):Fw}({image:i,message:r,scale:s}):Fw}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||Fw)}group(t,e,n={collapsed:!1}){n=$w({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||Fw)}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()>=Hw(t)}_getLogFunction(t,e,n,i=[],r){if(this._shouldLog(t)){r=$w({logLevel:t,message:e,args:i,opts:r}),Mw(n=n||r.method),r.total=this.getTotal(),r.delta=this.getDelta(),this._deltaTs=Nw();const s=r.tag||r.message;if(r.once){if(Bw[s])return Fw;Bw[s]=Nw()}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!Ow&&"string"==typeof t&&(e&&(e=Aw(e),t="\x1b[".concat(e,"m").concat(t,"\x1b[39m")),n&&(e=Aw(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 Fw}}return t.VERSION=Ew,t})();function Hw(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 Mw(Number.isFinite(e)&&e>=0),e}function $w(t){const{logLevel:e,message:n}=t;t.logLevel=Hw(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 Mw("string"===r||"object"===r),Object.assign(t,t.opts)}var Gw=new Uw({id:"deck"});const Ww={DEFAULT:-1,LNGLAT:1,METER_OFFSETS:2,LNGLAT_OFFSETS:3,CARTESIAN:0};Object.defineProperty(Ww,"IDENTITY",{get:()=>Gw.deprecated("COORDINATE_SYSTEM.IDENTITY","COORDINATE_SYSTEM.CARTESIAN")()||0});const qw={WEB_MERCATOR:1,GLOBE:2,WEB_MERCATOR_AUTO_OFFSET:4,IDENTITY:0},Xw={click:{handler:"onClick"},panstart:{handler:"onDragStart"},panmove:{handler:"onDrag"},panend:{handler:"onDragEnd"}},Yw=new Uw({id:"luma.gl"});function Kw(t,e){if(!t)throw new Error(e||"luma.gl: assertion failed.")}function Qw(t){return"undefined"!=typeof WebGLRenderingContext&&t instanceof WebGLRenderingContext||"undefined"!=typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext||Boolean(t&&Number.isFinite(t._version))}function Zw(t){return"undefined"!=typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext||Boolean(t&&2===t._version)}function Jw(t){return Kw(Qw(t),"Invalid WebGLRenderingContext"),t}function tx(t){return Kw(Zw(t),"Requires WebGL2"),t}const ex={};const nx=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{globalThis.console&&globalThis.console.log&&globalThis.console.log("OESVertexArrayObject emulation library context restored"),e.reset_()},!0),this.reset_()};ix.prototype.VERTEX_ARRAY_BINDING_OES=34229,ix.prototype.reset_=function(){if(void 0!==this.vertexArrayObjects)for(let t=0;tZw(t)?void 0:0,lx={3074:t=>Zw(t)?void 0:36064,35723:t=>Zw(t)?void 0:4352,35977:ax,32937:ax,36795:(t,e)=>{const n=Zw(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(ox);return e(n&&n.UNMASKED_VENDOR_WEBGL||7936)},37446:(t,e)=>{const n=t.getExtension(ox);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:ax,35071:ax,37447:ax,36063:(t,e)=>{if(!Zw(t)){const n=t.getExtension(sx);return n?e(n.MAX_COLOR_ATTACHMENTS_WEBGL):0}},35379:ax,35374:ax,35377:ax,34852:t=>{if(!Zw(t)){const e=t.getExtension(sx);return e?e.MAX_DRAW_BUFFERS_WEBGL:0}},36203:t=>t.getExtension(rx)?2147483647:65535,33001:t=>t.getExtension(rx)?16777216:65535,33e3:t=>16777216,37157:ax,35373:ax,35657:ax,36183:ax,37137:ax,34045:ax,35978:ax,35979:ax,35968:ax,35376:ax,35375:ax,35659:ax,37154:ax,35371:ax,35658:ax,35076:ax,35077:ax,35380:ax},cx="ANGLE_instanced_arrays",ux={OES_vertex_array_object:{meta:{suffix:"OES"},createVertexArray:()=>{Kw(!1,"VertexArray requires WebGL2 or OES_vertex_array_object extension")},deleteVertexArray:()=>{},bindVertexArray:()=>{},isVertexArray:()=>!1},[cx]:{meta:{suffix:"ANGLE"},vertexAttribDivisor(t,e){Kw(0===e,"WebGL instanced rendering not supported")},drawElementsInstanced:()=>{},drawArraysInstanced:()=>{}},WEBGL_draw_buffers:{meta:{suffix:"WEBGL"},drawBuffers:()=>{Kw(!1)}},EXT_disjoint_timer_query:{meta:{suffix:"EXT"},createQuery:()=>{Kw(!1)},deleteQuery:()=>{Kw(!1)},beginQuery:()=>{Kw(!1)},endQuery:()=>{},getQuery(t,e){return this.getQueryObject(t,e)},getQueryParameter(t,e){return this.getQueryObject(t,e)},getQueryObject:()=>{}}},hx={readBuffer:(t,e,n)=>{Zw(t)&&e(n)},getVertexAttrib:(t,e,n,i)=>{const{webgl2:r,ext:s}=function(t,e){return{webgl2:Zw(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(!Zw(t))switch(i){case 35967:return 35981;case 35971:case 35382:return 0}return e(n,i)},getInternalformatParameter:(t,e,n,i,r)=>{if(!Zw(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=lx[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 dx(t,{extension:e,target:n,target2:i}){const r=ux[e];Kw(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)}}globalThis.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 ix(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&&dx(t,{extension:n,target:t.luma,target2:t})}(t,ux),function(t,{target:e,target2:n}){Object.keys(hx).forEach(i=>{if("function"==typeof hx[i]){const r=t[i]?t[i].bind(t):()=>{},s=hx[i].bind(null,t,r);e[i]=s,n[i]=s}})}(t,{target:e,target2:t}),e.polyfilled=!0),t};const px={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},fx=(t,e,n)=>e?t.enable(n):t.disable(n),gx=(t,e,n)=>t.hint(n,e),mx=(t,e,n)=>t.pixelStorei(n,e);function bx(t){return Array.isArray(t)||ArrayBuffer.isView(t)}const yx={3042:fx,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:fx,2885:(t,e)=>t.cullFace(e),2929:fx,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:fx,35723:gx,36006:(t,e)=>{const n=Zw(t)?36009:36160;return t.bindFramebuffer(n,e)},2886:(t,e)=>t.frontFace(e),33170:gx,2849:(t,e)=>t.lineWidth(e),32823:fx,32824:"polygonOffset",10752:"polygonOffset",35977:fx,32938:"sampleCoverage",32939:"sampleCoverage",3089:fx,3088:(t,e)=>t.scissor(...e),2960:fx,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:mx,3317:mx,37440:mx,37441:mx,37443:mx,3330:mx,3332:mx,3331:mx,36010:(t,e)=>t.bindFramebuffer(36008,e),3314:mx,32878:mx,3316:mx,3315:mx,32877:mx,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=bx(e)?e:[e,e],t.blendEquationSeparate(...e)},blendFunc:(t,e)=>{e=bx(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=bx(e)?e:[e,e];const[n,i]=e;t.stencilMaskSeparate(1028,n),t.stencilMaskSeparate(1029,i)},stencilFunc:(t,e)=>{e=bx(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=bx(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 vx(t,e,n){return void 0!==e[t]?e[t]:n[t]}const _x={blendEquation:(t,e,n)=>t.blendEquationSeparate(vx(32777,e,n),vx(34877,e,n)),blendFunc:(t,e,n)=>t.blendFuncSeparate(vx(32969,e,n),vx(32968,e,n),vx(32971,e,n),vx(32970,e,n)),polygonOffset:(t,e,n)=>t.polygonOffset(vx(32824,e,n),vx(10752,e,n)),sampleCoverage:(t,e,n)=>t.sampleCoverage(vx(32938,e,n),vx(32939,e,n)),stencilFuncFront:(t,e,n)=>t.stencilFuncSeparate(1028,vx(2962,e,n),vx(2967,e,n),vx(2963,e,n)),stencilFuncBack:(t,e,n)=>t.stencilFuncSeparate(1029,vx(34816,e,n),vx(36003,e,n),vx(36004,e,n)),stencilOpFront:(t,e,n)=>t.stencilOpSeparate(1028,vx(2964,e,n),vx(2965,e,n),vx(2966,e,n)),stencilOpBack:(t,e,n)=>t.stencilOpSeparate(1029,vx(34817,e,n),vx(34818,e,n),vx(34819,e,n))},wx={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]})},xx=(t,e)=>t.isEnabled(e),Sx={3042:xx,2884:xx,2929:xx,3024:xx,32823:xx,32926:xx,32928:xx,3089:xx,2960:xx,35977:xx};function Cx(t){for(const e in t)return!1;return!0}function Ex(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||px)){const n=e,i=Sx[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=Sx[r];i[r]=e?e(t,Number(r)):t.getParameter(Number(r))}return i}(t):Object.assign({},px),this.log=n,this._updateCache=this._updateCache.bind(this),Object.seal(this)}push(t={}){this.stateStack.push({})}pop(){Kw(this.stateStack.length>0),Mx(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){Kw(void 0!==r);const s=t[r],o=this.cache[r];Ex(s,o)||(n=!0,e=o,i&&!(r in i)&&(i[r]=o),this.cache[r]=s)}return{valueChanged:n,oldValue:e}}}function Px(t,e={}){const{enable:n=!0,copyState:i}=e;if(Kw(void 0!==i),!t.state){const{polyfillContext:e}=globalThis;e&&e(t),t.state=new kx(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 n in wx)Tx(t,n,wx[n]);Ox(t,"getParameter"),Ox(t,"isEnabled")}return t.state.enable=n,t}function Ax(t){Kw(t.state),t.state.pop()}function Mx(t,e){if(Kw(Qw(t),"setParameters requires a WebGL context"),Cx(e))return;const n={};for(const r in e){const i=Number(r),s=yx[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)_x[r](t,e,i)}function Ix(t,e,n){if(Cx(e))return n(t);const{nocatch:i=!0}=e;let r;if(function(t){t.state||Px(t,{copyState:!1}),t.state.push()}(t),Mx(t,e),i)r=n(t),Ax(t);else try{r=n(t)}finally{Ax(t)}return r}function Dx(){return!("object"==typeof process&&"[object process]"===String(process)&&!process.browser)||function(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;return!!(e&&e.indexOf("Electron")>=0)}()}function Rx(t){const{luma:e}=t;if(t.canvas&&e){const{clientWidth:n}=e.canvasSizeInfo;return n?t.drawingBufferWidth/n:1}return 1}function Nx(t,e,n=!0){return function(t,e,n,i,r){const s=Lx(t[0],e,n);let o=jx(t[1],e,i,r),a=Lx(t[0]+1,e,n);const l=a===n-1?a:a-1;let c;return a=jx(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,Rx(t),t.drawingBufferWidth,t.drawingBufferHeight,n)}function Lx(t,e,n){return Math.min(Math.round(t*e),n-1)}function jx(t,e,n,i){return i?Math.max(0,n-1-Math.round(t*e)):Math.min(Math.round(t*e),n-1)}const Fx=Dx(),Bx=Fx&&"undefined"!=typeof document,Vx={webgl2:!0,webgl1:!0,throwOnError:!0,manageState:!0,canvas:null,debug:!1,width:800,height:600};function zx(t={}){Kw(Fx,"createGLContext only available in the browser.\nCreate your own headless context or use 'createHeadlessContext' from @luma.gl/test-utils"),t=Object.assign({},Vx,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?(Bx&&"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=Ux(r,t),function(t){const e=Zw(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);Yw.info(1,`${e}${t.debug?" debug":""} context ${n?`(${n.vendor},${n.renderer})`:""}`)()}(r),r):null}function Ux(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({},Vx,e);const{manageState:n,debug:i}=e;return n&&Px(t,{copyState:!1,log:(...t)=>Yw.log(1,...t)()}),Fx&&i&&(globalThis.makeDebugContext?(t=globalThis.makeDebugContext(t,e),Yw.level=Math.max(Yw.level,1)):Yw.warn('WebGL debug mode not activated. import "@luma.gl/debug" to enable.')()),t._instrumented=!0,t}function Hx(){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 $x{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=Hx(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(Hx()-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 Gx{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 $x?t:new $x(e,n)),this.stats[e]}}const Wx="8.5.12",qx=new class{constructor(){this.stats=new Map}get(t){return this.stats.has(t)||this.stats.set(t,new Gx({id:t})),this.stats.get(t)}};if(globalThis.luma&&globalThis.luma.VERSION!==Wx)throw new Error(`luma.gl - multiple VERSIONs detected: ${globalThis.luma.VERSION} vs ${Wx}`);function Xx(t,e){if(!t)throw new Error(e||"luma.gl: assertion failed.")}function Yx(t,e){if("string"!=typeof e)return e;const n=Number(e);if(!isNaN(n))return n;const i=t[e=e.replace(/^.*\./,"")];return Xx(void 0!==i,`Accessing undefined constant GL.${e}`),i}function Kx(t,e){e=Number(e);for(const n in t)if(t[n]===e)return`GL.${n}`;return String(e)}globalThis.luma||(Dx()&&Yw.log(1,`luma.gl ${Wx} - set luma.log.level=1 (or higher) to trace rendering`)(),globalThis.luma=globalThis.luma||{VERSION:Wx,version:Wx,log:Yw,stats:qx,globals:{modules:{},nodeIO:{}}}),globalThis;const Qx={};function Zx(t="id"){return Qx[t]=Qx[t]||1,`${t}-${Qx[t]++}`}function Jx(t){return Xx("number"==typeof t,"Input must be a number"),t&&0==(t&t-1)}function tS(t){let e=!0;for(const n in t){e=!1;break}return e}function eS(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 Yw.removed(`Calling removed method ${e}.${t}: `,r)(),new Error(t)})})}const nS="Resource subclass must define virtual methods";class iS{get[Symbol.toStringTag](){return"Resource"}constructor(t,e={}){Jw(t);const{id:n,userData:i={}}=e;this.gl=t,this.gl2=t,this.id=n||Zx(this[Symbol.toStringTag]),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[Symbol.toStringTag]||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={}){Xx(t=Yx(this.gl,t));const n=(this.constructor.PARAMETERS||{})[t];if(n){const t=Zw(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=Zw(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?Kx(this.gl,a):a;s[i]=this.getParameter(a,t),n&&"GLenum"===e.type&&(s[i]=Kx(this.gl,s[i]))}}return s}setParameter(t,e){Xx(t=Yx(this.gl,t));const n=(this.constructor.PARAMETERS||{})[t];if(n){const t=Zw(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=Yx(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 eS(this,t,e,n)}initialize(t){}_createHandle(){throw new Error(nS)}_deleteHandle(){throw new Error(nS)}_bindHandle(t){throw new Error(nS)}_getOptsFromHandle(){throw new Error(nS)}_getParameter(t,e){throw new Error(nS)}_setParameter(t,e){throw new Error(nS)}_context(){return this.gl.luma=this.gl.luma||{},this.gl.luma}_addStats(){const t=this[Symbol.toStringTag],e=qx.get("Resource Counts");e.get("Resources Created").incrementCount(),e.get(`${t}s Created`).incrementCount(),e.get(`${t}s Active`).incrementCount()}_removeStats(){const t=this[Symbol.toStringTag];qx.get("Resource Counts").get(`${t}s Active`).decrementCount()}_trackAllocatedMemory(t,e=this[Symbol.toStringTag]){const n=qx.get("Memory Usage");n.get("GPU Memory").addCount(t),n.get(`${e} Memory`).addCount(t),this.byteLength=t}_trackDeallocatedMemory(t=this[Symbol.toStringTag]){const e=qx.get("Memory Usage");e.get("GPU Memory").subtractCount(this.byteLength),e.get(`${t} Memory`).subtractCount(this.byteLength),this.byteLength=0}}function rS(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 sS(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 oS({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 uS.getBytesPerElement(this)}get BYTES_PER_VERTEX(){return uS.getBytesPerVertex(this)}_assign(t={}){return void 0!==(t=aS("Accessor",t,cS)).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 hS={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"},dS={removedProps:{},replacedProps:{bytes:"byteLength"},deprecatedProps:hS},pS={removedProps:hS};class fS extends iS{get[Symbol.toStringTag](){return"Buffer"}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/uS.getBytesPerElement(t))}getVertexCount(t=this.accessor){return Math.round(this.byteLength/uS.getBytesPerVertex(t))}initialize(t={}){return ArrayBuffer.isView(t)&&(t={data:t}),Number.isFinite(t)&&(t={byteLength:t}),t=aS("Buffer",t,dS),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=aS("Buffer",t,pS))&&this.setAccessor(t.accessor),this}setAccessor(t){return delete(t=Object.assign({},t)).buffer,this.accessor=new uS(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;Xx(e);const s=this.gl.webgl2?36663:this.target;return this.gl.bindBuffer(s,this.handle),0!==i||void 0!==r?(tx(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 tx(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}={}){tx(this.gl);const r=sS(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 Xx((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):(Xx(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){Xx(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=rS(t);return Xx(r),this.setAccessor(new uS(this.accessor,{type:r})),this}_setByteLength(t,e=this.usage){Xx(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/sS(this.accessor.type||5126,{clamped:!1}).BYTES_PER_ELEMENT;return this.getElementCount()-e}_inferType(t){this.accessor.type||this.setAccessor(new uS(this.accessor,{type:rS(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 Yw.deprecated("Buffer.type","Buffer.accessor.type")(),this.accessor.type}get bytes(){return Yw.deprecated("Buffer.bytes","Buffer.byteLength")(),this.byteLength}setByteLength(t){return Yw.deprecated("setByteLength","reallocate")(),this.reallocate(t)}updateAccessor(t){return Yw.deprecated("updateAccessor(...)","setAccessor(new Accessor(buffer.accessor, ...)")(),this.accessor=new uS(this.accessor,t),this}}const gS={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}},mS={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},bS={5126:4,5125:4,5124:4,5123:2,5122:2,5131:2,5120:1,5121:1},yS=[9729,9728],vS=globalThis.WebGLBuffer||function(){};class _S extends iS{get[Symbol.toStringTag](){return"Texture"}static isSupported(t,e={}){const{format:n,linearFiltering:i}=e;let r=!0;return n&&(r=r&&function(t,e){const n=gS[e];if(!n)return!1;if(void 0===n.gl1&&void 0===n.gl2)return!0;const i=Zw(t)&&n.gl2||n.gl1;return"string"==typeof i?t.getExtension(i):i}(t,n),r=r&&(!i||function(t,e){const n=gS[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=Zx("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()&&(Yw.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=null;({data:l,dataType:g}=this._getDataType({data:l,compressed:p}));let m,b=0;return Ix(this.gl,a,()=>{switch(g){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":m=tx(f),m.bindBuffer(35052,l.handle||l),m.texImage2D(e,i,r,u,h,s,d,c,o),m.bindBuffer(35052,null);break;case"browser-object":Zw(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),b+=n.levelSize;break;default:Xx(!1,"Unknown image data type")}}),this._trackAllocatedMemory("compressed"===g?b:l&&l.byteLength?l.byteLength:this.width*this.height*(mS[this.dataFormat]||4)*(bS[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})),Xx(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 fS&&(n=n.handle),this.gl.bindTexture(this.target,this.handle),Ix(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 vS){const e=tx(this.gl);e.bindBuffer(35052,n),e.texSubImage2D(t,a,i,r,s,o,u,c,d),e.bindBuffer(35052,null)}else Zw(this.gl)?tx(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 Yw.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 fS?{data:t.handle,dataType:"buffer"}:t instanceof vS?{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=gS[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},Xx(i,"Could not deduced texture size"),Xx(void 0===e||i.width===e,"Deduced texture width does not match supplied width"),Xx(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:Xx(!1);break;default:this.gl.texParameteri(this.target,t,e)}return this.gl.bindTexture(this.target,null),this}_isNPOT(){return!(Zw(this.gl)||!this.width||!this.height||Jx(this.width)&&Jx(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===yS.indexOf(e)&&(e=9729);break;case 10242:case 10243:33071!==e&&(e=33071)}return e}}function wS(t,e){return Xx("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 xS extends _S{get[Symbol.toStringTag](){return"Texture2D"}static isSupported(t,e){return _S.isSupported(t,e)}constructor(t,e={}){Jw(t),(e instanceof Promise||"string"==typeof e)&&(e={data:e}),"string"==typeof e.data&&(e=Object.assign({},e,{data:wS(e.data)})),super(t,Object.assign({},e,{target:3553})),this.initialize(e),Object.seal(this)}}const SS="EXT_color_buffer_float";var CS={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:SS,bpp:2},33327:{gl2:SS,bpp:4},34842:{gl2:SS,bpp:8},33326:{gl2:SS,bpp:4},33328:{gl2:SS,bpp:8},34836:{gl2:SS,bpp:16},35898:{gl2:SS,bpp:4}};class ES extends iS{get[Symbol.toStringTag](){return"Renderbuffer"}static isSupported(t,{format:e}={format:null}){return!e||function(t,e,n){const i=n[e];if(!i)return!1;const r=Zw(t)&&i.gl2||i.gl1;return"string"==typeof r?t.getExtension(r):r}(t,e,CS)}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 Xx(t,"Needs format"),this._trackDeallocatedMemory(),this.gl.bindRenderbuffer(36161,this.handle),0!==i&&Zw(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)*CS[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 OS="clear: bad arguments";function TS(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)),Xx(0!==o,OS),Ix(t,s,()=>{t.clear(o)})}function kS(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 PS(t){return function(){var e=this,n=arguments;return new Promise(function(i,r){var s=t.apply(e,n);function o(t){kS(s,i,r,o,a,"next",t)}function a(t){kS(s,i,r,o,a,"throw",t)}o(void 0)})}}const AS=[34069,34070,34071,34072,34073,34074];let MS=(()=>{class t extends _S{get[Symbol.toStringTag](){return"TextureCube"}constructor(t,e={}){Jw(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 PS(function*(){const{gl:l}=a,c=n||i,u=yield Promise.all(AS.map(t=>{const e=c[t];return Promise.all(Array.isArray(e)?e:[e])}));a.bind(),AS.forEach((n,i)=>{u[i].length>1&&!1!==a.opts.mipmaps&&Yw.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=AS,t})();class IS extends _S{get[Symbol.toStringTag](){return"Texture3D"}static isSupported(t){return Zw(t)}constructor(t,e={}){tx(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),Ix(this.gl,u,()=>{ArrayBuffer.isView(c)&&this.gl.texImage3D(this.target,t,e,n,i,r,s,o,a,c),c instanceof fS&&(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*(mS[this.dataFormat]||4)*(bS[this.type]||1),"Texture"),this.loaded=!0,this}}function DS(t,e){Xx(t instanceof xS||t instanceof MS||t instanceof IS);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},e))}function RS(t,e){const{gl:n,width:i,height:r,id:s}=t;return new BS(n,Object.assign({},e,{id:`framebuffer-for-${s}`,width:i,height:r,attachments:{36064:t}}))}function NS(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}=jS(t);Xx(u);const{gl:d,handle:p,attachments:f}=u;a=a||u.width,l=l||u.height,36064===s&&null===p&&(s=1028),Xx(f[s]),c=c||f[s].type,o=function(t,e,n,i,r){if(t)return t;return new(sS(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 Xx(!1),0}}(n))}(o,c,r,a,l),c=c||rS(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 LS(t,{sourceAttachment:e=36064,targetMaxHeight:n=Number.MAX_SAFE_INTEGER}={}){let i=NS(t,{sourceAttachment:e}),{width:r,height:s}=t;for(;s>n;)({data:i,width:r,height:s}=oS({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 Xx(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&&Yw.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){Xx(void 0!==s,"Misspelled framebuffer binding point?");const t=Number(s),e=i[t];let r=e;if(r)if(r instanceof ES)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(BS.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)&&TS(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]}={}){tx(t),Ix(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:Xx(!1,OS)}})}(this.gl,{drawBuffer:e,value:t})}),this.gl.bindFramebuffer(36160,s||null),this}readPixels(t={}){return Yw.error("Framebuffer.readPixels() is no logner supported, use readPixelsToArray(framebuffer)")(),null}readPixelsToBuffer(t={}){return Yw.error("Framebuffer.readPixelsToBuffer()is no logner supported, use readPixelsToBuffer(framebuffer)")(),null}copyToDataUrl(t={}){return Yw.error("Framebuffer.copyToDataUrl() is no logner supported, use copyToDataUrl(framebuffer)")(),null}copyToImage(t={}){return Yw.error("Framebuffer.copyToImage() is no logner supported, use copyToImage(framebuffer)")(),null}copyToTexture(t={}){return Yw.error("Framebuffer.copyToTexture({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null}blit(t={}){return Yw.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=tx(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=Kx(this.gl,i)),i}getAttachmentParameters(t=36064,e,n=this.constructor.ATTACHMENT_PARAMETERS||[]){const i={};for(const r of n)i[e?Kx(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?Kx(this.gl,e):e]=this.getAttachmentParameters(e,t)}return n}show(){return"undefined"!=typeof window&&window.open(LS(this),"luma-debug-texture"),this}log(t=0,e=""){if(t>Yw.level||"undefined"==typeof window)return this;e=e||`Framebuffer ${this.id}`;const n=LS(this,{targetMaxHeight:100});return Yw.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 xS(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 ES(this.gl,{id:`${this.id}-depth-stencil`,format:35056,width:i,height:111}),this.ownResources.push(s[33306])):e?(s=s||{},s[36096]=new ES(this.gl,{id:`${this.id}-depth`,format:33189,width:i,height:r}),this.ownResources.push(s[36096])):n&&Xx(!1),s}_unattach(t){const e=this.attachments[t];!e||(e instanceof ES?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:tx(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:Xx(!1,"Illegal texture type")}r.bindTexture(e.target,null),this.attachments[t]=e}_setReadBuffer(t){const e=function(t){return Zw(t)?t:null}(this.gl);e?e.readBuffer(t):Xx(36064===t||1029===t,FS),this.readBuffer=t}_setDrawBuffers(t){const{gl:e}=this,n=tx(e);if(n)n.drawBuffers(t);else{const n=e.getExtension("WEBGL_draw_buffers");n?n.drawBuffersWEBGL(t):Xx(1===t.length&&(36064===t[0]||1029===t[0]),FS)}this.drawBuffers=t}_getAttachmentParameterFallback(t){const e=function(t){t.luma=t.luma||{},t.luma.caps=t.luma.caps||{};for(const e in VS)void 0===t.luma.caps[e]&&(t.luma.caps[e]=HS(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)}}BS.ATTACHMENT_PARAMETERS=[36049,36048,33296,33298,33299,33300,33301,33302,33303];var VS={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 xS(t,{format:6408,type:5126,dataFormat:6408}),n=new BS(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 zS(t,e){return US(t,e)}function US(t,e){return(e=Array.isArray(e)?e:[e]).every(e=>HS(t,e))}function HS(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=VS[e];let i;Xx(n,e);const r=Zw(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:Xx(!1);return i}(t,e)),t.luma.caps[e]||Yw.log(2,`Feature: ${e} not supported`)(),t.luma.caps[e]}class $S{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()}};const WS=1/Math.PI*180,qS=1/180*Math.PI,XS={};function YS(t,{precision:e=XS.precision||4}={}){return t=function(t){return Math.round(t/XS.EPSILON)*XS.EPSILON}(t),`${parseFloat(t.toPrecision(e))}`}function KS(t){return Array.isArray(t)||ArrayBuffer.isView(t)&&!(t instanceof DataView)}function QS(t,e,n){if(KS(t)){n=n||function(t){return t.clone?t.clone():new Array(t.length)}(t);for(let i=0;it*qS,void 0)}(t)}function JS(t){return function(t,e){return QS(t,t=>t*WS,void 0)}(t)}function tC(t,e,n){return QS(t,t=>Math.max(e,Math.min(n,t)))}function eC(t,e,n){return KS(t)?t.map((t,i)=>eC(t,e[i],n)):n*e+(1-n)*t}function nC(t,e,n){const i=XS.EPSILON;n&&(XS.EPSILON=n);try{if(t===e)return!0;if(KS(t)&&KS(e)){if(t.length!==e.length)return!1;for(let n=0;n0?", ":"")+YS(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&&(LC.length=t.length,i=LC):i=NC,(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 FC(t){return t&&t[Symbol.asyncIterator]}function BC(t,e=(()=>!0)){return Array.isArray(t)?VC(t,e,[]):e(t)?[t]:[]}function VC(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 WC(t,e){return t?(Number.isFinite(t)&&(t={duration:t}),t.type=t.type||"interpolation",vt(vt(vt({},GC[t.type]),e),t)):null}function qC(t,e){return e.getBuffer()?[e.getBuffer(),{divisor:0,size:e.size,normalized:e.settings.normalized}]:e.value}function XC(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 YC(t){t.push(t.shift())}function KC(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 QC({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=KC(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 $C({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===HC||(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=HC}clearNeedsUpdate(){this.state.needsUpdate=!1,this.state.updateRanges=UC}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!==HC}),!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),zC({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 JC={};function tE(t){Gw.level>0&&JC[t]&&JC[t].call(...arguments)}function eE(t,e){if(!t)throw new Error(e||"shadertools: assertion failed.")}const nE="out vec4 transform_output;\nvoid main() {\n transform_output = vec4(0);\n}",iE=`#version 300 es\n${nE}`;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 sE(t={}){const{version:e=100,input:n,inputType:i,output:r}=t;if(!n)return 300===e?iE:e>300?`#version ${e}\n${nE}`:"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 eE(!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 oE extends iS{get[Symbol.toStringTag](){return"TransformFeedback"}static isSupported(t){return Zw(t)}constructor(t,e={}){tx(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,tS(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,Yw.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 fS?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 aE{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 fS?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&&Xx(Zw(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 oE(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],Xx(n[r]instanceof fS)}return{sourceBuffers:e,feedbackBuffers:n}}_createNewBuffer(t,e){const n=new fS(this.gl,e);return this.resources[t]&&this.resources[t].delete(),this.resources[t]=n,n}_getNextIndex(){return(this.currentIndex+1)%2}}function lE(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 cE="vs",uE={[cE]:"#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"},hE="__LUMA_INJECT_DECLARATIONS__",dE=/void\s+main\s*\([^)]*\)\s*\{\n?/,pE=/}\n?[^{}]*$/,fE=[];function gE(t,e,n,i=!1){const r=e===cE;for(const s in n){const e=n[s];e.sort((t,e)=>t.order-e.order),fE.length=e.length;for(let t=0,n=e.length;tt+i));break;case"vs:#main-end":r&&(t=t.replace(pE,t=>i+t));break;case"fs:#decl":r||(t=t.replace(hE,i));break;case"fs:#main-start":r||(t=t.replace(dE,t=>t+i));break;case"fs:#main-end":r||(t=t.replace(pE,t=>i+t));break;default:t=t.replace(s,t=>t+i)}}return t=t.replace(hE,""),i&&(t=t.replace(/\}\s*$/,t=>t+uE[e])),t}function mE(t){const e={};return eE(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 bE={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_",vE="transform_position";const _E={10241:9728,10240:9728,10242:33071,10243:33071};class wE{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[`${yE}${e}`]=[r,s]);for(const o in t)({width:r,height:s}=t[o]),i[`${yE}${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=NS(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 eE(!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 fS(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 BS(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(_E)}_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=DS(t,{parameters:{10241:9728,10240:9728,10242:33071,10243:33071},pixelStore:{37440:!1}});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=`${yE}${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 eE(!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=mE([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){Xx(i);const t=`${yE}${n}`;l=mE([l,{"vs:#decl":`uniform vec2 ${t};\n`,"vs:#main-start":` vec2 ${vE} = transform_getPos(${t});\n gl_Position = vec4(${vE}, 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=mE([t.inject||{},o]);return this.targetTextureType=s,this.samplerTextureMap=a,{vs:i,fs:t._fs||sE({version:lE(i),input:this.targetTextureVarying,inputType:s,output:"transform_output"}),modules:this.hasSourceTextures||this.targetTextureVarying?[bE].concat(t.modules||[]):t.modules,uniforms:r,inject:l}}}const xE={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 SE(t){let e=CE(t);return"object"===e?t?"type"in t?Object.assign({},t,xE[t.type]):"value"in t?(e=CE(t.value),Object.assign({type:e},t,xE[e])):{type:"object",value:t}:{type:"object",value:null}:Object.assign({type:e,value:t},xE[e])}function CE(t){return Array.isArray(t)||ArrayBuffer.isView(t)?"array":typeof t}class EE{constructor({name:t,vs:e,fs:n,dependencies:i=[],uniforms:r,getUniforms:s,deprecations:o=[],defines:a={},inject:l={},vertexShader:c,fragmentShader:u}){eE("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=SE(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:eE(!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&&eE(r.validate(t[i],r),`${this.name}: invalid ${i}`),e[i]=t[i]):e[i]=r.value}return e}}function OE(t){return function(t){const e={},n={};return TE({modules:t,level:0,moduleMap:e,moduleDepth:n}),Object.keys(n).sort((t,e)=>n[e]-n[t]).map(t=>e[t])}(kE(t))}function TE({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 EE||(eE("string"!=typeof t,`Shader module use by name is deprecated. Import shader module '${t}' and use it directly.`),eE(t.name,"shader module has no name"),(t=new EE(t)).dependencies=kE(t.dependencies)),t))}const PE={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]},AE={};function ME(t,e){return t.match(/NVIDIA/i)||e.match(/NVIDIA/i)?"NVIDIA":t.match(/INTEL/i)||e.match(/INTEL/i)?"INTEL":t.match(/AMD/i)||e.match(/AMD/i)||t.match(/ATI/i)||e.match(/ATI/i)?"AMD":"UNKNOWN GPU"}Object.keys(PE).forEach(t=>{AE[t]=t});const IE={};function DE(t,e,n={}){const i=PE[e];if(eE(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 IE)return IE[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),IE[e]=o,o}function RE(t,e){return(e=Array.isArray(e)?e:[e]).every(e=>function(t,e){const n=PE[e];eE(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 eE(!1===r||!0===r),r}(t,e))}function NE(t){return new RegExp(`\\b${t}[ \\t]+(\\w+[ \\t]+\\w+(\\[\\w+\\])?;)`,"g")}const LE=[[/^(#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("]],jE=[...LE,[NE("attribute"),"in $1"],[NE("varying"),"out $1"]],FE=[...LE,[NE("varying"),"in $1"]],BE=[[/^#version[ \t]+300[ \t]+es/,"#version 100"],[/\btexture(2D|2DProj|Cube)Lod\(/g,"texture$1LodEXT("],[/\btexture\(/g,"texture2D("],[/\btextureLod\(/g,"texture2DLodEXT("]],VE=[...BE,[NE("in"),"attribute $1"],[NE("out"),"varying $1"]],zE=[...BE,[NE("in"),"varying $1"]],UE="gl_FragColor",HE=/\bout[ \t]+vec4[ \t]+(\w+)[ \t]*;\n?/,$E=/void\s+main\s*\([^)]*\)\s*\{\n?/;function GE(t,e){for(const[n,i]of e)t=t.replace(n,i);return t}const WE=`\n\n${hE}\n\n`,qE={[cE]:"vertex",fs:"fragment"};function XE(t,{id:e,source:n,type:i,modules:r,defines:s={},hookFunctions:o=[],inject:a={},transpileToGLSL100:l=!1,prologue:c=!0,log:u}){eE("string"==typeof n,"shader source must be a string");const h=i===cE,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}_${qE[n]}\n\n`:""}({id:e,source:n,type:i})}\n${function({type:t}){return`\n#define SHADER_TYPE_${qE[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:ME(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// 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"}}(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 RE(t,AE.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"),RE(t,AE.GLSL_DERIVATIVES)&&DE(t,AE.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"),RE(t,AE.GLSL_FRAG_DATA)&&DE(t,AE.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"),RE(t,AE.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+=WE,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?GE(t,jE):function(t){const e=(t=GE(t,FE)).match(HE);if(e){const n=e[1];t=t.replace(new RegExp(`\\b${UE}\\b`,"g"),n)}else{const e="fragmentColor";t=t.replace($E,t=>`out vec4 ${e};\n${t}`).replace(new RegExp(`\\b${UE}\\b`,"g"),e)}return t}(t);case 100:return n?GE(t,VE):function(t){const e=(t=GE(t,zE)).match(HE);if(e){const n=e[1];t=t.replace(HE,"").replace(new RegExp(`\\b${n}\\b`,"g"),UE)}return t}(t);default:throw new Error(`unknown GLSL version ${e}`)}}(b,l?100:p,h),b}function YE(t){return function(e){const n={};for(const i of t){const t=i.getUniforms(e,n);Object.assign(n,t)}return n}}const KE={5126:uO.bind(null,"uniform1fv",nO,1,hO),35664:uO.bind(null,"uniform2fv",nO,2,hO),35665:uO.bind(null,"uniform3fv",nO,3,hO),35666:uO.bind(null,"uniform4fv",nO,4,hO),5124:uO.bind(null,"uniform1iv",iO,1,hO),35667:uO.bind(null,"uniform2iv",iO,2,hO),35668:uO.bind(null,"uniform3iv",iO,3,hO),35669:uO.bind(null,"uniform4iv",iO,4,hO),35670:uO.bind(null,"uniform1iv",iO,1,hO),35671:uO.bind(null,"uniform2iv",iO,2,hO),35672:uO.bind(null,"uniform3iv",iO,3,hO),35673:uO.bind(null,"uniform4iv",iO,4,hO),35674:uO.bind(null,"uniformMatrix2fv",nO,4,dO),35675:uO.bind(null,"uniformMatrix3fv",nO,9,dO),35676:uO.bind(null,"uniformMatrix4fv",nO,16,dO),35678:cO,35680:cO,5125:uO.bind(null,"uniform1uiv",rO,1,hO),36294:uO.bind(null,"uniform2uiv",rO,2,hO),36295:uO.bind(null,"uniform3uiv",rO,3,hO),36296:uO.bind(null,"uniform4uiv",rO,4,hO),35685:uO.bind(null,"uniformMatrix2x3fv",nO,6,dO),35686:uO.bind(null,"uniformMatrix2x4fv",nO,8,dO),35687:uO.bind(null,"uniformMatrix3x2fv",nO,6,dO),35688:uO.bind(null,"uniformMatrix3x4fv",nO,12,dO),35689:uO.bind(null,"uniformMatrix4x2fv",nO,8,dO),35690:uO.bind(null,"uniformMatrix4x3fv",nO,12,dO),35678:cO,35680:cO,35679:cO,35682:cO,36289:cO,36292:cO,36293:cO,36298:cO,36299:cO,36300:cO,36303:cO,36306:cO,36307:cO,36308:cO,36311:cO},QE={},ZE={},JE={},tO=[0];function eO(t,e,n,i){1===e&&"boolean"==typeof t&&(t=t?1:0),Number.isFinite(t)&&(tO[0]=t,t=tO);const r=t.length;if(r%e&&Yw.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 uO(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{Xx(s===u,"Uniform length cannot change.");for(let t=0;t{const s=String(i+e);return gO(s,r-s.length)+n+t})}(e);return{shaderName:l,errors:fO(s,c),warnings:fO(o,c)}}(t,this.source,this.shaderType,this.id);throw Yw.error(`GLSL compilation errors in ${e}\n${n}`)(),Yw.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 bO extends mO{get[Symbol.toStringTag](){return"VertexShader"}constructor(t,e){"string"==typeof e&&(e={source:e}),super(t,Object.assign({},e,{shaderType:35633}))}_createHandle(){return this.gl.createShader(35633)}}class yO extends mO{get[Symbol.toStringTag](){return"FragmentShader"}constructor(t,e){"string"==typeof e&&(e={source:e}),super(t,Object.assign({},e,{shaderType:35632}))}_createHandle(){return this.gl.createShader(35632)}}const vO=5126,_O=5124,wO=5125,xO={[vO]:[vO,1,"float"],35664:[vO,2,"vec2"],35665:[vO,3,"vec3"],35666:[vO,4,"vec4"],[_O]:[_O,1,"int"],35667:[_O,2,"ivec2"],35668:[_O,3,"ivec3"],35669:[_O,4,"ivec4"],[wO]:[wO,1,"uint"],36294:[wO,2,"uvec2"],36295:[wO,3,"uvec3"],36296:[wO,4,"uvec4"],35670:[vO,1,"bool"],35671:[vO,2,"bvec2"],35672:[vO,3,"bvec3"],35673:[vO,4,"bvec4"],35674:[vO,8,"mat2"],35685:[vO,8,"mat2x3"],35686:[vO,8,"mat2x4"],35675:[vO,12,"mat3"],35687:[vO,12,"mat3x2"],35688:[vO,12,"mat3x4"],35676:[vO,16,"mat4"],35689:[vO,16,"mat4x2"],35690:[vO,16,"mat4x3"]};function SO(t){const e=xO[t];if(!e)return null;const[n,i]=e;return{type:n,components:i}}function CO(t,e){switch(t){case 5120:case 5121:case 5122:case 5123:t=vO}for(const n in xO){const[i,r,s]=xO[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(!Zw(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}=SO(n),o={type:r,size:i*s};this._inferProperties(t,e,o);const a={location:t,name:e,accessor:new uS(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}=SO(n),o={location:t,name:e,accessor:new uS({type:r,size:i*s})};this.varyingInfos.push(o),this.varyingInfosByName[o.name]=o}}const OO=35981,TO=["setVertexArray","setAttributes","setBuffers","unsetBuffers","use","getUniformCount","getUniformInfo","getUniformLocation","getUniformValue","getVarying","getFragDataLocation","getAttachedShaders","getAttributeCount","getAttributeLocation","getAttributeInfo"];class kO extends iS{get[Symbol.toStringTag](){return"Program"}constructor(t,e={}){super(t,e),this.stubRemovedMethods("Program","v6.0",TO),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=OO}=t;return this.hash=e||"",this.vs="string"==typeof n?new bO(this.gl,{id:`${t.id}-vs`,source:n}):n,this.fs="string"==typeof i?new yO(this.gl,{id:`${t.id}-fs`,source:i}):i,Xx(this.vs instanceof bO),Xx(this.fs instanceof yO),this.uniforms={},this._textureUniforms={},r&&r.length>0&&(tx(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)&&(Yw.deprecated("Program.draw({uniforms})","Program.setUniforms(uniforms)")(),this.setUniforms(f||{})),Yw.priority>=t){const i=d?d.id:"default",r=`mode=${Kx(this.gl,e)} verts=${n} instances=${l} indexType=${Kx(this.gl,a)} isInstanced=${c} isIndexed=${o} Framebuffer=${i}`;Yw.log(t,r)()}return Xx(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 Xx(!1),0}}(e);h.begin(t)}this._bindTextures(),Ix(this.gl,p,()=>{o&&c?this.gl2.drawElementsInstanced(e,n,a,i,l):o&&Zw(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={}){Yw.priority>=2&&function(t,e,n){for(const i in t){const r=t[i];if((!n||Boolean(n[i]))&&!aO(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 BS&&(t=t.texture),t instanceof _S)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)&&lO(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 bO({handle:i});break;case 35632:n.fs=new yO({handle:i})}return n}_getParameter(t){return this.gl.getProgramParameter(this.handle,t)}_setId(t){if(!t){const t=this._getName();this.id=Zx(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),Yw.time(4,`linkProgram for ${this._getName()}`)(),t.linkProgram(this.handle),Yw.timeEnd(4,`linkProgram for ${this._getName()}`)(),t.debug||Yw.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=OE(e.modules||[]);return{gl:t,vs:XE(t,Object.assign({},e,{source:n,type:cE,modules:r})),fs:XE(t,Object.assign({},e,{source:i,type:"fs",modules:r})),getUniforms:YE(r)}}(this.gl,{vs:e,fs:n,modules:l,inject:r,defines:i,hookFunctions:this._hookFunctions,transpileToGLSL100:a});this._programCache[b]=new kO(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":Dw.chrome?"Chrome":Dw.safari?"Safari":Dw.mozInnerScreenX?"Firefox":"Unknown"}()}static getDefaultArray(t){return t.luma=t.luma||{},t.luma.defaultVertexArray||(t.luma.defaultVertexArray=new MO(t,{handle:null,isDefaultArray:!0})),t.luma.defaultVertexArray}static getMaxAttributes(t){return MO.MAX_ATTRIBUTES=MO.MAX_ATTRIBUTES||t.getParameter(34921),MO.MAX_ATTRIBUTES}static setConstant(t,e,n){switch(n.constructor){case Float32Array:MO._setConstantFloatArray(t,e,n);break;case Int32Array:MO._setConstantIntArray(t,e,n);break;case Uint32Array:MO._setConstantUintArray(t,e,n);break;default:Xx(!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 MO.getMaxAttributes(this.gl)}initialize(t={}){return this.setProps(t)}setProps(t){return this}setElementBuffer(t=null,e={}){return Xx(!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?(Xx(Zw(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&&!MO.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 fS(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(!AO||AO.byteLength{switch(t){case 34373:return this.gl.getVertexAttribOffset(e,t);default:return this.gl.getVertexAttrib(e,t)}})}}const IO=/^(.+)__LOCATION_([0-9]+)$/,DO=["setBuffers","setGeneric","clearBindings","setLocations","setGenericValues","setDivisor","enable","disable"];class RO{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 MO(t),eS(this,"VertexArray","v6.0",DO),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 fS(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,Yw.once(3,()=>`unused value ${t} in ${this.id}`)(),r;const a=this._getAttributeInfo(o||s);if(!a)return r;const l=uS.resolve(a.accessor,this.accessors[s]||{},n,i),{size:c,type:u}=l;return Xx(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=IO.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 fS)this.setBuffer(t,e);else if(Array.isArray(e)&&e.length&&e[0]instanceof fS)this.setBuffer(t,e[0],e[1]);else if(ArrayBuffer.isView(e)||Array.isArray(e))this.setConstant(t,e);else{if(!(e.buffer instanceof fS))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 fS){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 Yw.deprecated("setElements","setElementBuffer")(),this.setElementBuffer(t,e)}}function NO(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+=NO(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 LO(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 fS){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 ${Kx(r,l)})`:(s=!0,f=`${h} bytes`),{[i]:`${o}${NO(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]:`${NO(a,{size:c,isInteger:s})} (constant)`,"Format ":`${c}x${l} (constant)`}}function jO(t,e){const{type:n,size:i}=e,r=CO(n,i);return r?`${t} (${r.name})`:t}function FO({header:t="Uniforms",program:e,uniforms:n,undefinedOnly:i=!1}){Xx(e);const r=".*Matrix",s={},o=Object.keys(e._uniformSetters).sort();let a=0;for(const u of o)!u.match(".*_.*")&&!u.match(r)&&BO({table:s,header:t,uniforms:n,uniformName:u,undefinedOnly:i})&&a++;for(const u of o)u.match(r)&&BO({table:s,header:t,uniforms:n,uniformName:u,undefinedOnly:i})&&a++;for(const u of o)s[u]||BO({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]:NO(e)})}return{table:s,count:a,unusedTable:c,unusedCount:l}}function BO({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?NO(s):"N/A","Uniform Type":o?s:"NOT PROVIDED"},0))}function VO(t){const{type:e,size:n}=t.accessor,i=CO(e,n);return i?`${i.name} ${t.name}`:t.name}const zO={POSITION:"positions",NORMAL:"normals",COLOR_0:"colors",TEXCOORD_0:"texCoords",TEXCOORD_1:"texCoords1",TEXCOORD_2:"texCoords2"};function UO(t,e){const{attributeMap:n=zO}=e||{};return n&&n[t]||t}function HO(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}Xx(Number.isFinite(e.size),`attribute ${t} needs size`)}const $O=()=>{},GO={};class WO{constructor(t,e={}){const{id:n=Zx("model")}=e;Xx(Qw(t)),this.id=n,this.gl=t,this.id=e.id||Zx("Model"),this.lastLogTime=0,this.animated=!1,this.initialize(e)}initialize(t){this.props={},this.programManager=t.programManager||PO.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={},Xx(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 Xx(Number.isFinite(t)),this.vertexCount=t,this}setInstanceCount(t){return Xx(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=UO(s,undefined);if("indices"===s)r=n;else if(n.constant)i[o]=n.value;else{const e=n.value,r=vt({},n);delete r.value,i[o]=[new fS(t,e),r],HO(s,r)}}if(r){const e=r.value||r;Xx(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 fS(t,{data:e,target:34963}),n]}return i}(this.gl,t),this.vertexArray.setAttributes(this.geometryBuffers),this}setAttributes(t={}){if(tS(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 TS(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),Yw.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&&Yw.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(GO,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(),Yw.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 Yw.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}Xx(t instanceof kO,"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 RO(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 fS&&e.delete()}}_setAnimationProps(t){this.animated&&Xx(t,"Model.draw(): animated uniforms but no animationProps")}_setFeedbackBuffers(t={}){if(tS(t))return this;const{gl:e}=this.program;return this.transformFeedback=this.transformFeedback||new oE(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:Yw.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=LO(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}: ${jO(s.name,a)}`),n[o]=LO(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&&Yw.log("MISSING UNIFORMS",Object.keys(l))(),a>0&&Yw.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 ${VO(i)}`]={[n]:JSON.stringify(i.accessor)});for(const i of t.varyingInfos)i&&(e[`out ${VO(i)}`]={[n]:JSON.stringify(i.accessor)});return e}(this.vertexArray.configuration);Yw.table(t,r)(),Yw.table(t,s)(),Yw.table(t+1,u)(),i&&i.log({logLevel:2,message:`Rendered to ${i.id}`}),Yw.groupEnd(2,`>>> DRAWING MODEL ${this.id}`)()}}class qO{static isSupported(t){return Zw(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();Xx(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 WO(e,Object.assign({},t,{fs:t.fs||sE({version:lE(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!(tS(t.feedbackBuffers)&&tS(t.feedbackMap)&&!(t.varyings&&t.varyings.length>0))})(e)&&(this.bufferTransform=new aE(t,e)),function(t){return!(tS(t._sourceTextures)&&!t._targetTexture&&!t._targetTextureVarying)}(e)&&(this.textureTransform=new wE(t,e)),Xx(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 XO(){}const YO={onStart:XO,onUpdate:XO,onInterrupt:XO,onEnd:XO};class KO{constructor(t){this._inProgress=!1,this._handle=null,this.timeline=t,this.settings={}}get inProgress(){return this._inProgress}start(t){this.cancel(),this.settings=vt(vt({},YO),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 QO={interpolation:class{constructor({gl:t,attribute:e,timeline:n}){this.gl=t,this.type="interpolation",this.transition=new KO(n),this.attribute=e,this.attributeInTransition=new ZC(t,e.settings),this.currentStartIndices=e.startIndices,this.currentLength=0,this.transform=function(t,e){const n=XC(e.size);return new qO(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 fS(t,i),new fS(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;YC(n);const r={numInstances:e,attribute:i,fromLength:this.currentLength,fromStartIndices:this.currentStartIndices,getData:t.enter};for(const s of n)QC(vt({buffer:s},r));this.currentStartIndices=i.startIndices,this.currentLength=KC(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:qC(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 KO(n),this.attribute=e,this.attributeInTransition=new ZC(t,zn(vt({},e.settings),{normalized:!1})),this.currentStartIndices=e.startIndices,this.currentLength=0,this.texture=function(t){return new xS(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 BS(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=XC(e.size);return new qO(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 fS(t,i),new fS(t,i),new fS(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)QC(vt({buffer:s},r));this.currentStartIndices=i.startIndices,this.currentLength=KC(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:qC(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]}}),YC(t),this.attributeInTransition.update({buffer:t[1],value:this.attribute.value}),NS(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 ZO{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=qO.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 Gw.warn("WebGL2 not supported by this browser. Transition for ".concat(t," is disabled."))();i&&this._removeTransition(t);const s=QO[n.type];s?this.transitions[t]=new s({attribute:e,timeline:this.timeline,gl:this.gl}):(Gw.error("unsupported transition type '".concat(n.type,"'"))(),r=!1)}(r||e.needsRedraw())&&(this.needsRedraw=!0,this.transitions[t].start(n,this.numInstances))}}const JO="attributeManager.invalidate";class tT{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 ZO(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;tE("attribute.updateStart",e),e.allocate(n)&&tE("attribute.allocate",e,n),e.updateBuffer(t)&&(this.needsRedraw=!0,tE("attribute.updateEnd",e,n))}}function eT(t,e,n,i,r){const s=e-t;return(n-e)*r+-s*i+s+e}function nT(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=WC(i)))return;const s=iT[i.type];if(!s)return void Gw.error("unsupported transition type '".concat(i.type,"'"))();const o=new s(this.timeline);o.start(zn(vt({},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 sT={COMPONENT:Symbol.for("component"),ASYNC_DEFAULTS:Symbol.for("asyncPropDefaults"),ASYNC_ORIGINAL:Symbol.for("asyncPropOriginal"),ASYNC_RESOLVED:Symbol.for("asyncPropResolved")},{COMPONENT:oT}=sT;function aT(t,e){if(!t.transitions)return null;const n={},i=dT(t);for(const r in t.transitions){const s=i[r],o=s&&s.type;("number"===o||"color"===o||"array"===o)&&cT(t[r],e[r],s)&&(n[r]=!0)}return n}function lT({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=cT(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=cT(t[s],e[s],i[s]);if(n)return"".concat(r,".").concat(s," ").concat(n)}}return null}function cT(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 uT(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(!pT(i[r],n[r])){e=t(i),n=i;break}return e}}function gT(t,e){if(!e)return t;const n=vt(vt({},t),e);if("defines"in e&&(n.defines=vt(vt({},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=vt({},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 mT(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,C=u*g-h*f,E=u*m-d*f,O=u*b-p*f,T=h*m-d*g,k=h*b-p*g,P=d*b-p*m,A=y*P-v*k+_*T+w*O-x*E+S*C;return A?(t[0]=(a*P-l*k+c*T)*(A=1/A),t[1]=(r*k-i*P-s*T)*A,t[2]=(g*S-m*x+b*w)*A,t[3]=(d*x-h*S-p*w)*A,t[4]=(l*O-o*P-c*E)*A,t[5]=(n*P-r*O+s*E)*A,t[6]=(m*_-f*S-b*v)*A,t[7]=(u*S-d*_+p*v)*A,t[8]=(o*k-a*O+c*C)*A,t[9]=(i*O-n*k-s*C)*A,t[10]=(f*x-g*_+b*y)*A,t[11]=(h*_-u*x-p*y)*A,t[12]=(a*E-o*T-l*C)*A,t[13]=(n*T-i*E+r*C)*A,t[14]=(g*v-f*w-m*y)*A,t[15]=(u*w-h*v+d*y)*A,t):null}function bT(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 yT(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 vT(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 _T(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 wT(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 xT(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 ST(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 CT(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;return 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],t}!function(){var t=new hC(4);hC!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0)}();const ET=[0,0,0,0],OT=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0],TT=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],kT=[0,0,0],PT=[0,0,0],AT=fT(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=ET,l=ET,c=t.cameraPosition;const{geospatialOrigin:u,shaderCoordinateOrigin:h,offsetMode:d}=MT(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=ST([],l,o),s=i||s,o=bT([],r,s),o=bT([],o,OT)),{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:kT,project_uScale:t.scale,project_uViewProjectionMatrix:s,project_uCameraPosition:a};if(c){const e=t.getDistanceScales(c);switch(n){case Ww.METER_OFFSETS:p.project_uCommonUnitsPerWorldUnit=e.unitsPerMeter,p.project_uCommonUnitsPerWorldUnit2=e.unitsPerMeter2;break;case Ww.LNGLAT:case Ww.LNGLAT_OFFSETS:p.project_uCommonUnitsPerWorldUnit=e.unitsPerDegree,p.project_uCommonUnitsPerWorldUnit2=e.unitsPerDegree2;break;case Ww.CARTESIAN:p.project_uCommonUnitsPerWorldUnit=[1,1,e.unitsPerMeter[2]],p.project_uCommonUnitsPerWorldUnit2=[0,0,e.unitsPerMeter2[2]]}}return p});function MT(t,e,n=PT){let i,r=n,s=!0;switch(i=e===Ww.LNGLAT_OFFSETS||e===Ww.METER_OFFSETS?n:t.isGeospatial?[Math.fround(t.longitude),Math.fround(t.latitude),0]:null,t.projectionMode){case qw.WEB_MERCATOR:(e===Ww.LNGLAT||e===Ww.CARTESIAN)&&(s=!1);break;case qw.WEB_MERCATOR_AUTO_OFFSET:e===Ww.LNGLAT?r=i:e===Ww.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 qw.IDENTITY:r=t.position.map(Math.fround);break;case qw.GLOBE:s=!1,i=null;break;default:s=!1}return r[2]=r[2]||0,{geospatialOrigin:i,shaderCoordinateOrigin:r,offsetMode:s}}class IT extends rC{get ELEMENTS(){return iC(!1),0}get RANK(){return iC(!1),0}toString(){let t="[";if(XS.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 VT).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 function(t,e,n,i,r){var s,o=1/Math.tan(e/2);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)}(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 mT(this,this),this.check()}multiplyLeft(t){return bT(this,t,this),this.check()}multiplyRight(t){return bT(this,this,t),this.check()}rotateX(t){return _T(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 wT(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,C,E,O,T,k=i[0],P=i[1],A=i[2],M=Math.hypot(k,P,A);Mn?n:t}const $T=Math.log2||function(t){return Math.log(t)*Math.LOG2E};function GT(t,e){if(!t)throw new Error(e||"@math.gl/web-mercator: assertion failed.")}const WT=Math.PI,qT=WT/4,XT=WT/180,KT=180/WT,QT=4003e4,ZT=85.051129;function JT([t,e]){return GT(Number.isFinite(t)),GT(Number.isFinite(e)&&e>=-90&&e<=90,"invalid latitude"),[512*(t*XT+WT)/(2*WT),512*(WT+Math.log(Math.tan(qT+e*XT*.5)))/(2*WT)]}function tk([t,e]){const n=t/512*(2*WT)-WT,i=2*(Math.atan(Math.exp(e/512*(2*WT)-WT))-qT);return[n*KT,i*KT]}function ek({latitude:t,longitude:e,highPrecision:n=!1}){GT(Number.isFinite(t)&&Number.isFinite(e));const i={},r=Math.cos(t*XT),s=512/360,o=s/r,a=512/QT/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=XT*Math.tan(t*XT)/r,n=512/QT*e,l=n/o*a;i.unitsPerDegree2=[0,s*e/2,n],i.unitsPerMeter2=[l,0,l]}return i}function nk(t,e){const[n,i,r]=t,[s,o,a]=e,{unitsPerMeter:l,unitsPerMeter2:c}=ek({longitude:n,latitude:i,highPrecision:!0}),u=JT(t);u[0]+=s*(l[0]+c[0]*o),u[1]+=o*(l[1]+c[1]*o);const h=tk(u),d=(r||0)+(a||0);return Number.isFinite(r)||Number.isFinite(a)?[h[0],h[1],d]:h}function ik(t){return 2*Math.atan(.5/t)*KT}function rk(t,e){const[n,i,r=0]=t;return GT(Number.isFinite(n)&&Number.isFinite(i)&&Number.isFinite(r)),zT(e,[n,i,r,1])}function sk(t,e,n=0){const[i,r,s]=t;if(GT(Number.isFinite(i)&&Number.isFinite(r),"invalid pixel coordinate"),Number.isFinite(s))return zT(e,[i,r,s,1]);const o=zT(e,[i,r,0,1]),a=zT(e,[i,r,1,1]),l=o[2],c=a[2];return NT([],o,a,l===c?0:((n||0)-l)/(c-l))}const ok=Math.PI/180;function ak(t,e,n){const{pixelUnprojectionMatrix:i}=t,r=zT(i,[e,0,1,1]),s=zT(i,[e,t.height,1,1]),o=tk(NT([],r,s,(n*t.distanceScales.unitsPerMeter[2]-r[2])/(s[2]-r[2])));return o[2]=n,o}const lk=Math.PI/180,ck=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],uk=[0,0,0],hk={unitsPerMeter:[1,1,1],metersPerUnit:[1,1,1]};let dk=(()=>{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?qw.WEB_MERCATOR:qw.WEB_MERCATOR_AUTO_OFFSET:qw.IDENTITY}equals(e){return e instanceof t&&(this===e||e.width===this.width&&e.height===this.height&&e.scale===this.scale&&nC(e.projectionMatrix,this.projectionMatrix)&&nC(e.viewMatrix,this.viewMatrix))}project(t,{topLeft:e=!0}={}){const n=rk(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=sk([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?JT(t):t}unprojectFlat(t){return this.isGeospatial?tk(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?ek({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 dk{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}=function({width:t,height:e,fovy:n=ik(1.5),altitude:i,pitch:r=0,nearZMultiplier:s=1,farZMultiplier:o=1}){void 0!==i&&(n=ik(i));const a=.5*n*XT,l=function(t){return.5/Math.tan(.5*t*XT)}(n),c=r*XT,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}}({width:h,height:d,pitch:r,altitude:p,nearZMultiplier:o,farZMultiplier:a});let _=function({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 yT(o,o,[0,0,-i]),_T(o,o,-e*XT),wT(o,o,n*XT),vT(o,o,[r/=t,r,r]),s&&yT(o,o,function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t}([],s)),o}({height:d,pitch:r,bearing:s,scale:f,altitude:p});u&&(_=(new VT).translate([512*u,0,0]).multiplyLeft(_)),super(zn(vt({},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(zn(vt({},this),{worldOffset:r})):this;this._subViewports.push(e)}}return this._subViewports}addMetersToLngLat(t,e){return nk(t,e)}panByPosition(t,e){const n=sk(e,this.pixelUnprojectionMatrix),i=DT([],this.projectFlat(t),RT([],n)),r=DT([],this.center,i),[s,o]=this.unprojectFlat(r);return{longitude:s,latitude:o}}getBounds(t={}){const e=function(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*ok:Math.atan(.5/t.altitude))>(90-t.pitch)*ok-.01?(l=ak(t,0,e),c=ak(t,n,e)):(l=r([0,0],s),c=r([n,0],s)),[o,a,c,l]}(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}=function({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}:GT(Number.isFinite(s.top)&&Number.isFinite(s.bottom)&&Number.isFinite(s.left)&&Number.isFinite(s.right));const h=JT([a,HT(u,-ZT,ZT)]),d=JT([c,HT(l,-ZT,ZT)]),p=[Math.max(Math.abs(d[0]-h[0]),i),Math.max(Math.abs(d[1]-h[1]),i)],f=[t-s.left-s.right-2*Math.abs(o[0]),e-s.top-s.bottom-2*Math.abs(o[1])];GT(f[0]>0&&f[1]>0);const g=f[0]/p[0],m=f[1]/p[1],b=tk([(d[0]+h[0])/2+(s.right-s.left)/2/g,(d[1]+h[1])/2+(s.bottom-s.top)/2/m]),y=Math.min(r,$T(Math.abs(Math.min(g,m))));return GT(Number.isFinite(y)),{longitude:b[0],latitude:b[1],zoom:y}}(vt({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 fk(t,e,n=!1){const i=e.projectPosition(t);if(n&&e instanceof pk){const[n,r,s=0]=t,o=e.getDistanceScales([n,r]);i[2]=s*o.unitsPerMeter[2]}return i}function gk(t,{viewport:e,modelMatrix:n,coordinateSystem:i,coordinateOrigin:r,offsetMode:s}){let[o,a,l=0]=t;switch(n&&([o,a,l]=ST([],[o,a,l,1],n)),i){case Ww.LNGLAT:return fk([o,a,l],e,s);case Ww.LNGLAT_OFFSETS:return fk([o+r[0],a+r[1],l+(r[2]||0)],e,s);case Ww.METER_OFFSETS:return fk(nk(r,[o,a,l]),e,s);case Ww.CARTESIAN:default:return e.isGeospatial?[o+r[0],a+r[1],l+r[2]]:e.projectPosition([o,a,l])}}const mk={10241:9987,10240:9729,10242:33071,10243:33071},bk={},yk={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||xk(t)&&(3===t.length||4===t.length),equal:(t,e,n)=>vk(t,e)},accessor:{validate(t,e){const n=Sk(t);return"function"===n||n===Sk(e.value)},equal:(t,e,n)=>"function"==typeof e||vk(t,e)},array:{validate:(t,e)=>e.optional&&!t||xk(t),equal:(t,e,n)=>n.compare?vk(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 xS)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 xS(n,zn(vt({},e),{parameters:vt(vt(vt({},mk),i),t.props.textureParameters)}));return bk[r.id]=!0,r}(n,t),release:t=>{!function(t){!t||!(t instanceof xS)||bk[t.id]&&(t.delete(),delete bk[t.id])}(t)}}};function vk(t,e){if(t===e)return!0;if(!xk(t)||!xk(e))return!1;const n=t.length;if(n!==e.length)return!1;for(let i=0;i{},this.oldProps=jk,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[Nk]||{},n=t[Rk]||t,i=t[Lk]||{};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(FC(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 PS(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=Dk(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:Bk,ASYNC_RESOLVED:Vk,ASYNC_DEFAULTS:zk}=sT,Uk={};let Hk=0,$k=(()=>{class t{constructor(){this.props=kk.apply(this,arguments),this.id=this.props.id,this.count=Hk++,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[zk])i in e[Vk]?n[i]=e[Vk][i]:i in e[Bk]&&(n[i]=e[Bk][i]);return new this.constructor(vt(vt(vt({},e),n),t))}get stats(){return this.internalState.stats}_initState(){this.internalState=new Fk({})}}return t.componentName="Component",t.defaultProps=Uk,t})();class Gk extends Fk{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 Wk=t=>"function"==typeof t,qk=t=>null!==t&&"object"==typeof t,Xk=t=>qk(t)&&t.constructor==={}.constructor,Yk=t=>t&&"function"==typeof t[Symbol.iterator],Kk=t=>t&&"function"==typeof t[Symbol.asyncIterator],Qk=t=>"undefined"!=typeof Response&&t instanceof Response||t&&t.arrayBuffer&&t.text&&t.json,Zk=t=>"undefined"!=typeof Blob&&t instanceof Blob,Jk=t=>(t=>"undefined"!=typeof ReadableStream&&t instanceof ReadableStream||qk(t)&&Wk(t.tee)&&Wk(t.cancel)&&Wk(t.getReader))(t)||(t=>qk(t)&&Wk(t.read)&&Wk(t.pipe)&&(t=>"boolean"==typeof t)(t.readable))(t);function tP(t,e){if(!t)throw new Error(e||"loader assertion failed.")}function eP(t){var e;return!!t&&(Array.isArray(t)&&(t=t[0]),Array.isArray(null===(e=t)||void 0===e?void 0:e.extensions))}function nP(t){var e,n;let i;return tP(t,"null loader"),tP(eP(t),"invalid loader"),Array.isArray(t)&&(i=t[1],t=zn(vt({},t=t[0]),{options:vt(vt({},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 iP={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},rP=iP.global||iP.self||iP.window||{},sP="object"!=typeof process||"[object process]"!==String(process)||process.browser,oP="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version);oP&&parseFloat(oP[1]);const aP={};function lP(t){for(const e in aP)t.startsWith(e)&&(t=t.replace(e,aP[e]));return!t.startsWith("http://")&&!t.startsWith("https://")&&(t=`${t}`),t}const cP=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,uP=/^([-\w.]+\/[-\w.+]+)/;function hP(t){const e=uP.exec(t);return e?e[1]:t}function dP(t){const e=cP.exec(t);return e?e[1]:""}const pP=/\?.*/;function fP(t){if(Qk(t)){const e=mP(t.url||"");return{url:e,type:hP(t.headers.get("content-type")||"")||dP(e)}}return Zk(t)?{url:mP(t.name||""),type:t.type||""}:"string"==typeof t?{url:mP(t),type:dP(t)}:{url:"",type:""}}function gP(t){return Qk(t)?t.headers["content-length"]||-1:Zk(t)?t.size:"string"==typeof t?t.length:t instanceof ArrayBuffer||ArrayBuffer.isView(t)?t.byteLength:-1}function mP(t){return t.replace(pP,"")}function bP(t){return yP.apply(this,arguments)}function yP(){return(yP=PS(function*(t){if(Qk(t))return t;const e={},n=gP(t);n>=0&&(e["content-length"]=String(n));const{url:i,type:r}=fP(t);r&&(e["content-type"]=r);const s=yield SP(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 vP(t){return _P.apply(this,arguments)}function _P(){return(_P=PS(function*(t){if(!t.ok){const e=yield wP(t);throw new Error(e)}})).apply(this,arguments)}function wP(t){return xP.apply(this,arguments)}function xP(){return(xP=PS(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 SP(t){return CP.apply(this,arguments)}function CP(){return(CP=PS(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,${EP(t.slice(0,5))}`:null})).apply(this,arguments)}function EP(t){let e="";const n=new Uint8Array(t);for(let i=0;i{}}info(){return()=>{}}warn(){return()=>{}}error(){return()=>{}}}const MP={fetch:null,mimeType:void 0,nothrow:!1,log:new class{constructor(){kP(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:[]},IP={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 DP(){rP.loaders=rP.loaders||{};const{loaders:t}=rP;return t._state=t._state||{},t._state}const RP=()=>{const t=DP();return t.globalOptions=t.globalOptions||vt({},MP),t.globalOptions};function NP(t,e,n,i){return n=n||[],function(t,e){jP(t,null,MP,IP,e);for(const n of e)jP(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=vt({},t.options||{});return function(t,e){e&&!("baseUri"in t)&&(t.baseUri=e)}(i,n),null===i.log&&(i.log=new AP),BP(i,RP()),BP(i,e),i}(e,t,i)}function LP(t,e){const n=RP(),i=t||n;return"function"==typeof i.fetch?i.fetch:qk(i.fetch)?t=>OP(t,i):null!=e&&e.fetch?null==e?void 0:e.fetch:OP}function jP(t,e,n,i,r){const s=e||"Top level",o=e?`${e}.`:"";for(const a in t){const l=!e&&qk(t[a]),c="baseUri"===a&&!e,u="workerUrl"===a&&e;if(!(a in n)&&!c&&!u)if(a in i)PP.warn(`${s} loader option '${o}${a}' no longer supported, use '${i[a]}'`)();else if(!l){const t=FP(a,r);PP.warn(`${s} loader option '${o}${a}' not recognized. ${t}`)()}}}function FP(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 BP(t,e){for(const n in e)n in e&&(t[n]=Xk(e[n])&&Xk(t[n])?vt(vt({},t[n]),e[n]):e[n])}function VP(t,e){if(!t)throw new Error(e||"loaders.gl assertion failed.")}function zP(t,e="3.0.12"){return VP(t,"no worker provided"),!(!e||!t.version)}const UP={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},HP=UP.global||UP.self||UP.window||{},$P="object"!=typeof process||"[object process]"!==String(process)||process.browser,GP="function"==typeof importScripts,WP="undefined"!=typeof window&&void 0!==window.orientation,qP="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version),XP=(qP&&parseFloat(qP[1]),new Map);function YP(t){const e=new Blob([t],{type:"application/javascript"});return URL.createObjectURL(e)}function KP(t,e=!0,n){const i=n||new Set;if(t)if(QP(t))i.add(t);else if(QP(t.buffer))i.add(t.buffer);else if(!ArrayBuffer.isView(t)&&e&&"object"==typeof t)for(const r in t)KP(t[r],e,i);return void 0===n?Array.from(i):[]}function QP(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 ZP=()=>{};class JP{static isSupported(){return"undefined"!=typeof Worker}constructor(t){kP(this,"name",void 0),kP(this,"source",void 0),kP(this,"url",void 0),kP(this,"terminated",!1),kP(this,"worker",void 0),kP(this,"onMessage",void 0),kP(this,"onError",void 0),kP(this,"_loadableURL","");const{name:e,source:n,url:i}=t;VP(n||i),this.name=e,this.source=n,this.url=i,this.onMessage=ZP,this.onError=t=>console.log(t),this.worker=this._createBrowserWorker()}destroy(){this.onMessage=ZP,this.onError=ZP,this.worker.terminate(),this.terminated=!0}get isRunning(){return Boolean(this.onMessage)}postMessage(t,e){e=e||KP(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){VP(t.source&&!t.url||!t.source&&t.url);let e=XP.get(t.source||t.url);return e||(t.url&&(e=function(t){return t.startsWith("http")?YP(function(t){return`try {\n importScripts('${t}');\n} catch (error) {\n console.error(error);\n throw error;\n}`}(t)):t}(t.url),XP.set(t.url,e)),t.source&&(e=YP(t.source),XP.set(t.source,e))),VP(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 tA{constructor(t,e){kP(this,"name",void 0),kP(this,"workerThread",void 0),kP(this,"isRunning",void 0),kP(this,"result",void 0),kP(this,"_resolve",void 0),kP(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){VP(this.isRunning),this.isRunning=!1,this._resolve(t)}error(t){VP(this.isRunning),this.isRunning=!1,this._reject(t)}}class eA{constructor(t){kP(this,"name","unnamed"),kP(this,"source",void 0),kP(this,"url",void 0),kP(this,"maxConcurrency",1),kP(this,"maxMobileConcurrency",1),kP(this,"onDebug",()=>{}),kP(this,"reuseWorkers",!0),kP(this,"props",{}),kP(this,"jobQueue",[]),kP(this,"idleQueue",[]),kP(this,"count",0),kP(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=vt(vt({},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 PS(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 PS(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 tA(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 iA{static isSupported(){return JP.isSupported()}static getWorkerFarm(t={}){return iA._workerFarm=iA._workerFarm||new iA({}),iA._workerFarm.setProps(t),iA._workerFarm}constructor(t){kP(this,"props",void 0),kP(this,"workerPools",new Map),this.props=vt({},nA),this.setProps(t),this.workerPools=new Map}destroy(){for(const t of this.workerPools.values())t.destroy()}setProps(t){this.props=vt(vt({},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 eA({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 rA(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 VP(i),i}function sA(t,e){return!!iA.isSupported()&&t.worker&&(null==e?void 0:e.worker)}function oA(t,e,n,i,r){return aA.apply(this,arguments)}function aA(){return(aA=PS(function*(t,e,n,i,r){const s=t.id,o=rA(t,n),a=iA.getWorkerFarm(n).getWorkerPool({name:s,url:o});n=JSON.parse(JSON.stringify(n));const l=yield a.startJob("process-on-worker",lA.bind(null,r));return l.postMessage("process",{input:e,options:n}),yield(yield l.result).result})).apply(this,arguments)}function lA(t,e,n,i){return cA.apply(this,arguments)}function cA(){return(cA=PS(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)}kP(iA,"_workerFarm",void 0);var uA=n(9521);function hA(t){if(function(t){return t&&"object"==typeof t&&t.isBuffer}(t)&&(t=function(t){return uA.toArrayBuffer?uA.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 dA(...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 pA(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 fA(t){return gA.apply(this,arguments)}function gA(){return(gA=PS(function*(t){const e=[];var n,i=!0,r=!1;try{for(var s,o,a=Dk(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 dA(...e)})).apply(this,arguments)}const mA=262144;function bA(t){this.wrapped=t}function yA(t){return new bA(t)}function vA(t){var e,n;function i(e,n){try{var s=t[e](n),o=s.value,a=o instanceof bA;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 _A(t){return function(){return new vA(t.apply(this,arguments))}}function wA(){return(wA=_A(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(OA)}function kA(t,e,n){return PA.apply(this,arguments)}function PA(){return(PA=PS(function*(t,e,n){const i=t instanceof ArrayBuffer||ArrayBuffer.isView(t);if("string"==typeof t||i)return TA(t,e);if(Zk(t)&&(t=yield bP(t)),Qk(t)){const n=t;return yield vP(n),e.binary?yield n.arrayBuffer():yield n.text()}if(Jk(t)&&(t=EA(t,n)),Yk(t)||Kk(t))return fA(t);throw new Error(OA)})).apply(this,arguments)}function AA(t,e,n=null){if(n)return n;const i=vt({fetch:LP(e,t)},t);return Array.isArray(i.loaders)||(i.loaders=null),i}function MA(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 IA=()=>{const t=DP();return t.loaderRegistry=t.loaderRegistry||[],t.loaderRegistry};function DA(t){const e=IA();t=Array.isArray(t)?t:[t];for(const n of t){const t=nP(n);e.find(e=>t===e)||e.unshift(t)}}const RA=/\.([^.]+)$/;function NA(t){return LA.apply(this,arguments)}function LA(){return(LA=PS(function*(t,e=[],n,i){if(!FA(t))return null;let r=jA(t,e,zn(vt({},n),{nothrow:!0}),i);if(r)return r;if(Zk(t)&&(r=jA(t=yield t.slice(0,10).arrayBuffer(),e,n,i)),!(r||null!=n&&n.nothrow))throw new Error(BA(t));return r})).apply(this,arguments)}function jA(t,e=[],n,i){if(!FA(t))return null;if(e&&!Array.isArray(e))return nP(e);let r=[];e&&(r=r.concat(e)),null!=n&&n.ignoreRegisteredLoaders||r.push(...IA()),function(t){for(const e of t)nP(e)}(r);const s=function(t,e,n,i){const{url:r,type:s}=fP(t),o=r||(null==i?void 0:i.url);let a=null;return null!=n&&n.mimeType&&(a=VA(e,null==n?void 0:n.mimeType)),a=a||function(t,e){const n=e&&RA.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||VA(e,s),a=a||function(t,e){if(!e)return null;for(const n of t)if("string"==typeof e){if(zA(e,n))return n}else if(ArrayBuffer.isView(e)){if(UA(e.buffer,e.byteOffset,n))return n}else if(e instanceof ArrayBuffer&&UA(e,0,n))return n;return null}(e,t),a=a||VA(e,null==n?void 0:n.fallbackMimeType),a}(t,r,n,i);if(!(s||null!=n&&n.nothrow))throw new Error(BA(t));return s}function FA(t){return!(t instanceof Response&&204===t.status)}function BA(t){const{url:e,type:n}=fP(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)?HA(t.buffer,t.byteOffset,e):t instanceof ArrayBuffer?HA(t,0,e):""}(t)}", contentType: "${n}"`),e&&(i+=` url: ${e}`),i}function VA(t,e){for(const n of t)if(n.mimeTypes&&n.mimeTypes.includes(e)||e===`application/x.${n.id}`)return n;return null}function zA(t,e){return e.testText?e.testText(t):(Array.isArray(e.tests)?e.tests:[e.tests]).some(e=>t.startsWith(e))}function UA(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 JA=new Uint8ClampedArray(0);const tM={data:{type:"data",value:QA,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=zn(vt({},r),{fetch:zn(vt({},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:XA(t,i),persistent:!1}),l=!0),l?o.subscribe({resourceId:t,onChange:t=>n.internalState.reloadAsyncProp(e,t),consumerId:n.id,requestId:e}):XA(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:Ww.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 eM=(()=>{class t extends $k{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=gk(t,{viewport:e,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem}),[i,r,s]=rk(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=vt({},t);let{coordinateSystem:n}=t;const{viewport:i,coordinateOrigin:r,fromCoordinateSystem:s,fromCoordinateOrigin:o}=t;return n===Ww.DEFAULT&&(n=i.isGeospatial?Ww.LNGLAT:Ww.CARTESIAN),void 0===s&&(e.fromCoordinateSystem=n),void 0===o&&(e.fromCoordinateOrigin=r),e.coordinateSystem=n,e}(e),{geospatialOrigin:l,shaderCoordinateOrigin:c,offsetMode:u}=MT(n,i,r),h=gk(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===Ww.DEFAULT||t===Ww.LNGLAT||t===Ww.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){RC(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=gT(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||!ZA({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(JA.length/3);if(this.internalState.usesPickingColorCache=!0,nKA&&Gw.warn("Layer has too many data objects. Picking might not be able to distinguish all objects.")(),JA=GS.allocate(JA,e,{size:3,copy:!0,maxCount:Math.max(e,KA)});const t=Math.floor(JA.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&&tE("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=lT({newProps:t,oldProps:e,propTypes:dT(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&&hT(t,e,"all"))return{all:!0};const n={};let i=!1;for(const r in t.updateTriggers)"all"!==r&&hT(t,e,r)&&(n[r]=!0,i=n);return i}(t,e)),{dataChanged:i,propsChanged:n,updateTriggersChanged:r,extensionsChanged:uT(t,e),transitionsChanged:aT(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=dT(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 tT(this.context.gl,{id:this.props.id,stats:this.context.stats,timeline:this.context.timeline})}_initState(){RC(!this.internalState&&!this.state),RC(isFinite(this.props.coordinateSystem));const t=this._getAttributeManager();t&&t.addInstanced({instancePickingColors:{type:5121,size:3,noAlloc:!0,update:this.calculateInstancePickingColors}}),this.internalState=new Gk({attributeManager:t,layer:this}),this.clearChangeFlags(),this.state={},Object.defineProperty(this.state,"attributeManager",{get:()=>(Gw.deprecated("layer.state.attributeManager","layer.getAttributeManager()"),t)}),this.internalState.layer=this,this.internalState.uniformTransitions=new rT(this.context.timeline),this.internalState.onAsyncPropUpdated=this._onAsyncPropUpdated.bind(this),this.internalState.setAsyncProps(this.props)}_transferState(t){tE("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=tM,t})(),nM=(()=>{class t extends eM{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=vt(vt({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=BC(t,Boolean),this.internalState.subLayers=t),tE("compositeLayer.renderLayers",this,e,t);for(const n of t)n.parent=this}}return t.layerName="CompositeLayer",t})();const iM=/([0-9]+\.?[0-9]*)(%|px)/;function rM(t){switch(typeof t){case"number":return{position:t,relative:!1};case"string":const e=t.match(iM);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 sM(t,e){return t.relative?Math.round(t.position*e):t.position}function oM(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)&&oM(i,r)))return!1}return!0}class aM{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=dk}=t;RC(!h||h instanceof dk),this.viewportInstance=h,this.id=e||this.constructor.displayName||"view",this.type=d,this.props=zn(vt({},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):oM(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=vt({},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:sM(this._x,t),y:sM(this._y,e),width:sM(this._width,t),height:sM(this._height,e)}}_getControllerProps(t){let e=this.props.controller;return e?!0===e?t:("function"==typeof e&&(e={type:e}),vt(vt({},t),e)):null}_getViewport(t,e){const{type:n}=this;return new n(vt(vt(vt({},t),this.props),e))}_parseDimensions({x:t,y:e,width:n,height:i}){this._x=rM(t),this._y=rM(e),this._width=rM(n),this._height=rM(i)}}const lM=()=>{},cM={transitionEasing:t=>t,transitionInterruption:1,onTransitionStart:lM,onTransitionInterrupt:lM,onTransitionEnd:lM};class uM{constructor(t,e={}){this.ControllerState=t,this.props=vt(vt({},cM),e),this.propsInTransition=null,this.transition=new KO(e.timeline),this.onViewStateChange=e.onViewStateChange||lM,this.onStateChange=e.onStateChange||lM,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=vt(vt({},cM),t),this.props=t,this._shouldIgnoreViewportChange(n,t))return e;if(this._isTransitionEnabled(t)){const{interruption:i,endProps:r}=this.transition.settings,s=vt(vt({},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(vt(vt({},this.props),l)).getViewportProps(),this.onViewStateChange({viewState:this.propsInTransition,oldViewState:this.props})}}const hM=["longitude","latitude","zoom","bearing","pitch"],dM=["longitude","latitude","zoom"];class pM 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)||!nC(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];RC(Number.isFinite(n)||Array.isArray(n),"".concat(e," is required for transition"))})}}{constructor(t={}){super((Array.isArray(t)?t:t.transitionProps)||{compare:hM,extract:hM,required:dM}),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]=eC(t[r]||0,e[r]||0,n);if(e.aroundPosition){const r=this.opts.makeViewport(vt(vt({},e),i));Object.assign(i,r.panByPosition(e.aroundPosition,eC(t.around,e.around,n)))}return i}}const fM={transitionDuration:0},gM={transitionDuration:300,transitionEasing:t=>t,transitionInterruption:1},mM=t=>1-(1-t)*(1-t),bM=["wheel"],yM=["panstart","panmove","panend"],vM=["pinchstart","pinchmove","pinchend"],_M=["tripanstart","tripanmove","tripanend"],wM=["doubletap"],xM=["keydown"];class SM{constructor(t,e={}){this.ControllerState=t,this.controllerState=null,this.controllerStateProps=null,this.eventManager=null,this.transitionManager=new uM(t,zn(vt({},e),{onViewStateChange:this._onTransition.bind(this),onStateChange:this._setInteractionState.bind(this)}));const n=this.linearTransitionProps;this._transition=n&&zn(vt({},gM),{transitionInterpolator:new pM({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(vt(vt({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(bM,c&&n),this.toggleEvents(yM,c&&(i||r)),this.toggleEvents(vM,c&&(o||a)),this.toggleEvents(_M,c&&a),this.toggleEvents(wM,c&&s),this.toggleEvents(xM,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=vt(vt({},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,fM,{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,fM,{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,zn(vt({},this._getTransitionProps()),{transitionDuration:e,transitionEasing:mM}),{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,fM,{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,zn(vt({},this._getTransitionProps()),{transitionDuration:e,transitionEasing:mM}),{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,zn(vt({},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,fM,{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,fM,{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,zn(vt({},this._getTransitionProps()),{transitionDuration:e,transitionEasing:mM}),{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,fM,{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,fM,{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,zn(vt({},this._getTransitionProps({around:i})),{transitionDuration:e,transitionEasing:mM}),{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?zn(vt({},e),{transitionInterpolator:new pM(zn(vt({},t),{transitionProps:this.linearTransitionProps,makeViewport:this.controllerState.makeViewport}))}):e:fM}}class CM{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 EM=[0,0,0];class OM extends CM{constructor({makeViewport:t,width:e,height:n,rotationX:i=0,rotationOrbit:r=0,target:s=EM,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=vt({},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(zn(vt({},this._viewportProps),{zoom:o}));return this._getUpdatedState(vt({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),tC(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 OM(vt(vt(vt({},this._viewportProps),this._state),t))}_applyConstraints(t){const{maxZoom:e,minZoom:n,zoom:i,maxRotationX:r,minRotationX:s,rotationOrbit:o}=t;return t.zoom=tC(i,n,e),t.rotationX=tC(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 TM extends SM{constructor(t){super(OM,t)}get linearTransitionProps(){return["target","zoom","rotationX","rotationOrbit"]}}class kM extends SM{constructor(t){t.dragMode=t.dragMode||"pan",super(OM,t)}_onPanRotate(t){return!1}get linearTransitionProps(){return["target","zoom"]}}const PM=(new VT).lookAt({eye:[0,0,1]});function AM({width:t,height:e,near:n,far:i}){return t=t||1,e=e||1,(new VT).ortho({left:-t/2,right:t/2,bottom:-e/2,top:e/2,near:n,far:i})}class MM extends dk{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(zn(vt({},t),{longitude:null,position:o,viewMatrix:PM.clone().scale([l,l*(a?-1:1),l]),projectionMatrix:AM({width:e,height:n,near:i,far:r}),zoom:s}))}panByPosition(t,e){const n=DT([],t,RT([],sk(e,this.pixelUnprojectionMatrix)));return{target:DT([],this.center,n)}}}let IM=(()=>{class t extends aM{constructor(t){super(zn(vt({},t),{type:MM}))}get controller(){return this._getControllerProps({type:kM})}}return t.displayName="OrthographicView",t})();const DM=Math.PI/180;function RM({height:t,fovy:e,orbitAxis:n,rotationX:i,rotationOrbit:r,zoom:s}){const o=.5/Math.tan(e*DM/2),a="Z"===n?[0,0,1]:[0,1,0],l="Z"===n?[0,-o,0]:[0,0,o],c=(new VT).lookAt({eye:l,up:a});c.rotateX(i*DM),"Z"===n?c.rotateZ(r*DM):c.rotateY(r*DM);const u=Math.pow(2,s)/(t||1);return c.scale(u),c}class NM extends dk{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(zn(vt({},t),{longitude:null,viewMatrix:RM({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]=sk([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 LM=(()=>{class t extends aM{constructor(t={}){const{orbitAxis:e="Z"}=t;super(zn(vt({},t),{orbitAxis:e,type:NM}))}get controller(){return this._getControllerProps({type:TM})}}return t.displayName="OrbitView",t})();const jM=[255,255,255],FM=1;let BM=0;class VM{constructor(t={}){const{color:e=jM}=t,{intensity:n=FM}=t;this.id=t.id||"ambient-".concat(BM++),this.color=e,this.intensity=n,this.type="ambient"}}const zM=[255,255,255],UM=1,HM=[0,0,-1];let $M=0;class GM{constructor(t={}){const{color:e=zM}=t,{intensity:n=UM}=t,{direction:i=HM}=t,{_shadow:r=!1}=t;this.id=t.id||"directional-".concat($M++),this.color=e,this.intensity=n,this.type="directional",this.direction=new OC(i).normalize().toArray(),this.shadow=r}getProjectedLight(){return this}}class WM{constructor(t={}){const{id:e="effect"}=t;this.id=e,this.props=vt({},t)}preRender(){}getModuleParameters(){}cleanup(){}}class qM extends class{constructor(t,e={}){const{id:n="pass"}=e;this.id=n,this.gl=t,this.props=vt({},e)}setProps(t){Object.assign(this.props,t)}render(){}cleanup(){}}{render(t){return Mx(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){Mx(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=XM(),l={viewport:t,isPicking:n.startsWith("picking"),renderPass:n};for(let c=0;cTS(t,e))}const a={totalCount:e.length,visibleCount:0,compositeCount:0,pickableCount:0};Mx(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]||XM(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 YM extends qM{constructor(t,e){super(t,e),this.shadowMap=new xS(t,{width:1,height:1,parameters:{10241:9729,10240:9729,10242:33071,10243:33071}}),this.depthBuffer=new ES(t,{format:33189,width:1,height:1}),this.fbo=new BS(t,{id:"shadowmap",width:1,height:1,attachments:{36064:this.shadowMap,36096:this.depthBuffer}})}render(t){const e=this.fbo;Ix(this.gl,{depthRange:[0,1],depthTest:!0,blend:!1,clearColor:[1,1,1,1]},()=>{const n=t.viewports[0],i=Rx(this.gl),r=n.width*i,s=n.height*i;(r!==e.width||s!==e.height)&&e.resize({width:r,height:s}),super.render(zn(vt({},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 KM=Object.keys(Ww).map(t=>"const int COORDINATE_SYSTEM_".concat(t," = ").concat(Ww[t],";")).join(""),QM=Object.keys(qw).map(t=>"const int PROJECTION_MODE_".concat(t," = ").concat(qw[t],";")).join("");var ZM="".concat(KM,"\n").concat(QM,"\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 JM={};var tI={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:ZM,getUniforms:function(t=JM){return t.viewport?function({viewport:t,devicePixelRatio:e=1,modelMatrix:n=null,coordinateSystem:i=Ww.DEFAULT,coordinateOrigin:r,autoWrapLongitude:s=!1}={}){i===Ww.DEFAULT&&(i=t.isGeospatial?Ww.LNGLAT:Ww.CARTESIAN);const o=AT({viewport:t,devicePixelRatio:e,coordinateSystem:i,coordinateOrigin:r});return o.project_uWrapLongitude=s,o.project_uModelMatrix=n||TT,o}(t):{}}};const eI=fT(function({viewport:t,center:e}){return new VT(t.viewProjectionMatrix).invert().transform(e)}),nI=fT(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=sk([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 OC(t.center).negate()),i=s.map(t=>e.transform(t)),r=(new VT).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}),iI=[0,0,0,1],rI=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0];var sI={name:"shadow",dependencies:[tI],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||iI,shadow_uLightId:t.shadowLightId||0,shadow_uLightCount:t.shadowMatrices.length},i=eI({viewport:t.viewport,center:e.project_uCenter}),r=[],s=nI({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 oI={color:[255,255,255],intensity:1},aI=[{color:[255,255,255],intensity:1,direction:[-1,3,-1]},{color:[255,255,255],intensity:.9,direction:[1,-8,-2.5]}],lI=[0,0,0,200/255];class cI extends WM{constructor(t){super(t),this.ambientLight=null,this.directionalLights=[],this.pointLights=[],this.shadowColor=lI,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=PO.getDefaultProgramManager(t),sI&&this.programManager.addDefaultModule(sI)),this.dummyShadowMap||(this.dummyShadowMap=new xS(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(sI),this.programManager=null)}_createLightMatrix(){const t=[];for(const e of this.directionalLights){const n=(new VT).lookAt({eye:new OC(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=hI++;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 pI{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=XA(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 fI{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 pI(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 gI=[{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"},tI],mI=["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 bI(t){const e=PO.getDefaultProgramManager(t);for(const n of gI)e.addDefaultModule(n);for(const n of mI)e.addShaderHook(n);return e}const yI=Object.seal({layerManager:null,resourceManager:null,deck:null,gl:null,stats:null,shaderCache:null,pickingFBO:null,mousePosition:null,userData:{}});class vI{constructor(t,{deck:e,stats:n,viewport:i,timeline:r}={}){this.lastRenderedLayers=[],this.layers=[],this.resourceManager=new fI({gl:t,protocol:"deck://"}),this.context=zn(vt({},yI),{layerManager:this,gl:t,deck:e,programManager:t&&bI(t),stats:n||new Gx({id:"deck.gl"}),viewport:i||new dk({id:"DEFAULT-INITIAL-VIEWPORT"}),timeline:r||new dI,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){tE("layerManager.setLayers",this,e,t),this.lastRenderedLayers=t,t=BC(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 tE("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]?Gw.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&&Gw.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 _I{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=BC(t,Boolean),this._diffViews(t,this.views)&&this.setNeedsUpdate("views changed"),this.views=t}_setViewState(t){t?(!oM(t,this.viewState)&&this.setNeedsUpdate("viewState changed"),this.viewState=t):Gw.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)(vt({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=zn(vt(vt(vt({},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 wI extends CM{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}={}){RC(Number.isFinite(r)),RC(Number.isFinite(i)),RC(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(zn(vt({},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(zn(vt({},this._viewportProps),{zoom:s}));return this._getUpdatedState(vt({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=vt({},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(vt(vt(vt({makeViewport:this.makeViewport},this._viewportProps),this._state),t))}_applyConstraints(t){const{maxZoom:e,minZoom:n,zoom:i}=t;t.zoom=tC(i,n,e);const{maxPitch:r,minPitch:s,pitch:o}=t;t.pitch=tC(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=UT(n+180,360)-180),(o<-180||o>180)&&(o=UT(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=tk([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 tC(e+Math.log2(t),i,n)}_calculateNewPitchAndBearing({deltaScaleX:t,deltaScaleY:e,startBearing:n,startPitch:i}){e=tC(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 xI extends SM{constructor(t){t.dragMode=t.dragMode||"pan",super(wI,t)}setProps(t){const e=this.controllerStateProps;super.setProps(t),(!e||e.height!==t.height)&&this.updateViewport(new this.ControllerState(vt(vt({makeViewport:this.makeViewport},this.controllerStateProps),this._state)))}get linearTransitionProps(){return["longitude","latitude","zoom","bearing","pitch"]}}let SI=(()=>{class t extends aM{constructor(t){super(zn(vt({},t),{type:pk}))}get controller(){return this._getControllerProps({type:xI})}}return t.displayName="MapView",t})();const CI=new cI;class EI{constructor(){this.effects=[],this._internalEffects=[],this._needsRedraw="Initial render",this.setEffects()}setProps(t){"effects"in t&&(t.effects.length!==this.effects.length||!oM(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 cI)||this._internalEffects.push(CI)}}class OI extends qM{}const TI={blendFunc:[1,0,32771,0],blendEquation:32774};class kI extends qM{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,Ix(p,zn(vt({scissorTest:!0,scissor:[o,a,l,c],clearColor:[0,0,0,0],depthMask:!0,depthTest:!0,depthRange:[0,1],colorMask:[!0,!0,!0,!0]},TI),{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}:zn(vt({},TI),{blend:!0,blendColor:[0,0,0,this.useAlpha?(e+1)/255:1]});return vt(vt({},t.props.parameters),n)}}class PI{constructor(t){this.gl=t,this.layerFilter=null,this.drawPickingColors=!1,this.drawLayersPass=new OI(t),this.pickLayersPass=new kI(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||BS.getDefaultFramebuffer(this.gl),this._preRender(t.effects,t);const n=this.lastPostProcessEffect?this.renderBuffers[0]:t.target,i=e.render(zn(vt({},t),{target:n}));this._postRender(t.effects,t),this.renderCount++,tE("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 BS(this.gl),new BS(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 AI={pickedColor:null,pickedLayer:null,pickedObjectIndex:-1};function MI({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}}Gw.error("Picked non-existent layer. Is picking buffer corrupt?")()}}return AI}function II({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 DI(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=II(t),u=new Map;return u.set(null,c),l.forEach(t=>{let e=vt({},c);t===o&&(e.color=s,e.index=a,e.picked=!0),e=RI({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 RI({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 NI{constructor(t){this.gl=t,this.pickingFBO=null,this.pickLayersPass=new kI(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?vt(vt({},r),u):Object.assign(u,{color:null,object:null,index:-1})}_resizeBuffer(){const{gl:t}=this;return this.pickingFBO||(this.pickingFBO=new BS(t),BS.isSupported(t,{colorBufferFloat:!0})&&(this.depthFBO=new BS(t),this.depthFBO.attach({36064:new xS(t,{format:Zw(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?(Gw.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:II({viewports:n,x:i,y:r})};this._resizeBuffer();const u=Rx(this.gl),h=Nx(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)}):Gw.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=RI({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 NS(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 LI={zIndex:1,position:"absolute",pointerEvents:"none",color:"#a0a7b4",backgroundColor:"#29323c",padding:"10px",top:0,left:0,display:"none"};class jI{constructor(t){const e=t.parentElement;e&&(this.el=document.createElement("div"),this.el.className="deck-tooltip",Object.assign(this.el.style,LI),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 FI(t,e){if(!t)throw new Error(e)}const BI={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},VI=BI.global||BI.self||BI.window,zI="object"!=typeof process||"[object process]"!==String(process)||process.browser,UI="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version),{_parseImageNode:HI}=(UI&&parseFloat(UI[1]),VI),$I="undefined"!=typeof Image,GI="undefined"!=typeof ImageBitmap,WI=Boolean(HI),qI=!!zI||WI;function XI(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 YI(t){switch(XI(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 KI=/^data:image\/svg\+xml/,QI=/\.svg((\?|#).*)?$/;function ZI(t){return t&&(KI.test(t)||QI.test(t))}function JI(t,e){if(ZI(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 tD(t,e)}function tD(t,e){if(ZI(e))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(t)])}function eD(t,e,n){return nD.apply(this,arguments)}function nD(){return(nD=PS(function*(t,e,n){const i=JI(t,n),r=self.URL||self.webkitURL,s="string"!=typeof i&&r.createObjectURL(i);try{return yield iD(s||i,e)}finally{s&&r.revokeObjectURL(s)}})).apply(this,arguments)}function iD(t,e){return rD.apply(this,arguments)}function rD(){return(rD=PS(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 sD={};let oD=!0;function aD(t,e,n){return lD.apply(this,arguments)}function lD(){return(lD=PS(function*(t,e,n){let i;i=ZI(n)?yield eD(t,e,n):tD(t,n);const r=e&&e.imagebitmap;return yield cD(i,r)})).apply(this,arguments)}function cD(t){return uD.apply(this,arguments)}function uD(){return(uD=PS(function*(t,e=null){if((hD(e)||!oD)&&(e=null),e)try{return yield createImageBitmap(t,e)}catch(n){console.warn(n),oD=!1}return yield createImageBitmap(t)})).apply(this,arguments)}function hD(t){for(const e in t||sD)return!1;return!0}const dD=!1,pD=!0;function fD(t){const e=gD(t);return function(t){const e=gD(t);return e.byteLength>=24&&2303741511===e.getUint32(0,dD)?{mimeType:"image/png",width:e.getUint32(16,dD),height:e.getUint32(20,dD)}:null}(e)||function(t){const e=gD(t);if(!(e.byteLength>=3&&65496===e.getUint16(0,dD)&&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,dD)?{mimeType:"image/gif",width:e.getUint16(6,pD),height:e.getUint16(8,pD)}:null}(e)||function(t){const e=gD(t);return e.byteLength>=14&&16973===e.getUint16(0,dD)&&e.getUint32(2,pD)===e.byteLength?{mimeType:"image/bmp",width:e.getUint32(18,pD),height:e.getUint32(22,pD)}:null}(e)}function gD(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 mD(t,e){const{mimeType:n}=fD(t)||{},{_parseImageNode:i}=VI;return FI(i),i(t,n,e)}function bD(){return(bD=PS(function*(t,e,n){const i=((e=e||{}).image||{}).type||"auto",{url:r}=n||{};let s;switch(yD(i)){case"imagebitmap":s=yield aD(t,e,r);break;case"image":s=yield eD(t,e,r);break;case"data":s=yield mD(t,e);break;default:FI(!1)}return"data"===i&&(s=YI(s)),s})).apply(this,arguments)}function yD(t){switch(t){case"auto":case"data":return function(){if(GI)return"imagebitmap";if($I)return"image";if(qI)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}();default:return function(t){switch(t){case"auto":return GI||$I||qI;case"imagebitmap":return GI;case"image":return $I;case"data":return qI;default:throw new Error(`@loaders.gl/images: image ${t} not supported in this environment`)}}(t),t}}const vD={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 bD.apply(this,arguments)},tests:[t=>Boolean(fD(new DataView(t)))],options:{image:{type:"auto",decode:!0}}};var _D=n(84761),wD={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 xD="8.5.8",SD=_D.CO.deck&&_D.CO.deck.VERSION;if(SD&&SD!==xD)throw new Error("deck.gl - multiple versions detected: ".concat(SD," vs ").concat(xD));SD||(Gw.log(1,"deck.gl ".concat(xD))(),_D.CO.deck=Object.assign(_D.CO.deck||{},{VERSION:xD,version:xD,log:Gw,_registerLoggers:function(t){JC=t}}),DA([wD,[vD,{imagebitmap:{premultiplyAlpha:"none"}}]]));var CD=_D.CO.deck;class ED extends iS{get[Symbol.toStringTag](){return"Query"}static isSupported(t,e=[]){const n=Zw(t),i=US(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:Xx(!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 ED.isSupported(this.gl)?this.gl2.createQuery():null}_deleteHandle(){this.gl2.deleteQuery(this.handle)}}const OD=Dx()&&"undefined"!=typeof document;let TD=0;class kD{constructor(t={}){const{onCreateContext:e=(t=>zx(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=qx.get("animation-loop-"+TD++)}=t;let{useDevicePixels:f=!0}=t;"useDevicePixelRatio"in t&&(Yw.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 Xx("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=ED.isSupported(this.gl,["timers"])?new ED(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 PS(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 Yw.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?Ux(this.props.gl,t):this.onCreateContext(t),!Qw(this.gl))throw new Error("AnimationLoop.onCreateContext - illegal context returned");(function(t){Mx(t,px)})(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)&&(Yw.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)&&(Yw.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 BS(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 PD=n(11524),AD=n.n(PD);const MD={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}))}}(AD().MouseInput);const ID=AD().Manager;var DD=AD();const RD=DD?[[DD.Pan,{event:"tripan",pointers:3,threshold:0,enable:!1}],[DD.Rotate,{enable:!1}],[DD.Pinch,{enable:!1}],[DD.Swipe,{enable:!1}],[DD.Pan,{threshold:0,enable:!1}],[DD.Press,{enable:!1}],[DD.Tap,{event:"doubletap",taps:2,enable:!1}],[DD.Tap,{event:"anytap",enable:!1}],[DD.Tap,{enable:!1}]]:null,ND={tripan:["rotate","pinch","pan"],rotate:["pinch"],pinch:["pan"],pan:["press","doubletap","anytap","tap"],doubletap:["anytap"],anytap:["tap"]},LD={doubletap:["tap"]},jD={pointerdown:"pointerdown",pointermove:"pointermove",pointerup:"pointerup",touchstart:"pointerdown",touchmove:"pointermove",touchend:"pointerup",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup"},FD={KEY_EVENTS:["keydown","keyup"],MOUSE_EVENTS:["mousedown","mousemove","mouseup","mouseover","mouseout","mouseleave"],WHEEL_EVENTS:["wheel","mousewheel"]},BD={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"},VD={click:"tap",anyclick:"anytap",dblclick:"doubletap",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup",mouseover:"pointerover",mouseout:"pointerout",mouseleave:"pointerleave"},zD="undefined"!=typeof navigator&&navigator.userAgent?navigator.userAgent.toLowerCase():"",UD="undefined"!=typeof window?window:global;"undefined"!=typeof global?global:window,"undefined"!=typeof document&&document;let HD=!1;try{const t={get passive(){return HD=!0,!0}};UD.addEventListener("test",t,t),UD.removeEventListener("test",t,t)}catch(m){}const $D=-1!==zD.indexOf("firefox"),{WHEEL_EVENTS:GD}=FD,WD=4.000244140625;class qD{constructor(t,e,n={}){this.element=t,this.callback=e,this.options=Object.assign({enable:!0},n),this.events=GD.concat(n.events||[]),this.handleEvent=this.handleEvent.bind(this),this.events.forEach(e=>t.addEventListener(e,this.handleEvent,!!HD&&{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;UD.WheelEvent&&($D&&t.deltaMode===UD.WheelEvent.DOM_DELTA_PIXEL&&(e/=UD.devicePixelRatio),t.deltaMode===UD.WheelEvent.DOM_DELTA_LINE&&(e*=40));const n={x:t.clientX,y:t.clientY};0!==e&&e%WD==0&&(e=Math.floor(e/WD)),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:XD}=FD,YD="pointermove",KD="pointerover",QD="pointerout",ZD="pointerleave";class JD{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=XD.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===YD&&(this.enableMoveEvent=e),t===KD&&(this.enableOverEvent=e),t===QD&&(this.enableOutEvent=e),t===ZD&&(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:KD,srcEvent:t,pointerType:"mouse",target:t.target})}handleOutEvent(t){this.enableOutEvent&&"mouseout"===t.type&&this.callback({type:QD,srcEvent:t,pointerType:"mouse",target:t.target})}handleLeaveEvent(t){this.enableLeaveEvent&&"mouseleave"===t.type&&this.callback({type:ZD,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:YD,srcEvent:t,pointerType:"mouse",target:t.target});break;case"mouseup":this.pressed=!1}}}const{KEY_EVENTS:tR}=FD,eR="keydown";class nR{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=tR.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===eR&&(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:eR,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 iR="contextmenu";class rR{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===iR&&(this.options.enable=e)}handleEvent(t){!this.options.enable||this.callback({type:iR,center:{x:t.clientX,y:t.clientY},srcEvent:t,pointerType:"mouse",target:t.target})}}const sR={pointerdown:1,pointermove:2,pointerup:4,mousedown:1,mousemove:2,mouseup:4},oR={srcElement:"root",priority:0};class aR{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({},oR,n):oR;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&&ND[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 qD(t,this._onOtherEvent,{enable:!1}),this.moveInput=new JD(t,this._onOtherEvent,{enable:!1}),this.keyInput=new nR(t,this._onOtherEvent,{enable:!1,tabIndex:e.tabIndex}),this.contextmenuInput=new rR(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=LD[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=VD[t]||t;let l=o.get(a);l||(l=new aR(this),o.set(a,l),l.recognizerName=BD[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(VD[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=jD[e.type];n&&this.manager.emit(n,t)}_onOtherEvent(t){this.manager.emit(t.type,t)}}function uR(){}const hR={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:uR,onResize:uR,onViewStateChange:uR,onInteractionStateChange:uR,onBeforeRender:uR,onAfterRender:uR,onLoad:uR,onError:(t,e)=>Gw.error(t)(),_onMetrics:null,getCursor:({isDragging:t})=>t?"grabbing":"grab",debug:!1,drawPickingColors:!1};class dR{constructor(t){t=vt(vt({},hR),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&&Gw.warn("View state tracking is disabled. Use either `initialViewState` for auto update or `viewState` for manual update.")(),"IE"===(0,_D.qs)()&&Gw.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 Gx({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&&GS.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&&Gw.removed("onLayerHover","onHover")(),"onLayerClick"in t&&Gw.removed("onLayerClick","onClick")(),t.initialViewState&&!oM(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](vt({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),RC(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 kD({width:e,height:n,useDevicePixels:c,autoResizeDrawingBuffer:u,autoResizeViewport:!1,gl:i,onCreateContext:t=>zx(zn(vt(vt({},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 SI({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,Ux(t,{enable:!0,copyState:!0})),this.tooltip=new jI(this.canvas),Mx(t,{blend:!0,blendFunc:[770,771,1,771],polygonOffsetFill:!0,depthTest:!0,depthFunc:515}),this.props.onWebGLInitialized(t);const e=new dI;e.play(),this.animationLoop.attachTimeline(e),this.eventManager=new cR(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 Xw)this.eventManager.on(i,this._onEvent);this.viewManager=new _I({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 vI(t,{deck:this,stats:this.stats,viewport:n,timeline:e}),this.effectManager=new EI,this.deckRenderer=new PI(t),this.deckPicker=new NI(t),this.setProps(this.props),this._updateCanvasSize(),this.props.onLoad()}_drawLayers(t,e){const{gl:n}=this.layerManager.context;Mx(n,this.props.parameters),this.props.onBeforeRender({gl:n}),this.deckRenderer.renderLayers(vt({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(),Gw.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=zn(vt({},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=Xw[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=qx.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}}dR.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(WM)),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}},dR.defaultProps=hR,dR.VERSION=CD.VERSION;var pR={name:"project32",dependencies:[tI],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"};const fR={pickingSelectedColor:null,pickingHighlightColor:new Uint8Array([0,255,255,255]),pickingActive:!1,pickingAttribute:!1};var gR=vt({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=fR){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 mR={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6};class bR{static get DRAW_MODE(){return mR}constructor(t={}){const{id:e=Zx("geometry"),drawMode:n=mR.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?vt({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,Xx(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?(Xx(!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 Xx(Number.isFinite(n)),n}}const yR=()=>{},vR={10241:9987,10240:9729,10242:33071,10243:33071};function _R(t){return Math.pow(2,Math.ceil(Math.log2(t)))}function wR(t,e,n,i){return n===e.width&&i===e.height?e:(t.canvas.height=i,t.canvas.width=n,t.clearRect(0,0,t.canvas.width,t.canvas.height),t.drawImage(e,0,0,e.width,e.height,0,0,n,i),t.canvas)}function xR(t){return t&&(t.id||t.url)}function SR(t,e,n){for(let i=0;i0){const{mapping:t,xOffset:n,yOffset:i,rowHeight:r,canvasHeight:s}=function({icons:t,buffer:e,mapping:n={},xOffset:i=0,yOffset:r=0,rowHeight:s=0,canvasWidth:o}){let a=[];for(let l=0;lo&&(SR(n,a,r),i=0,r=s+r+e,s=0,a=[]),a.push({icon:c,xOffset:i}),i=i+l+e,s=Math.max(s,t)}}return a.length>0&&SR(n,a,r),{mapping:n,rowHeight:s,xOffset:i,yOffset:r,canvasWidth:o,canvasHeight:_R(s+r+e)}}({icons:e,buffer:this._buffer,canvasWidth:this._canvasWidth,mapping:this._mapping,rowHeight:this._rowHeight,xOffset:this._xOffset,yOffset:this._yOffset});this._rowHeight=r,this._mapping=t,this._xOffset=n,this._yOffset=i,this._canvasHeight=s,this._texture||(this._texture=new xS(this.gl,{width:this._canvasWidth,height:this._canvasHeight,parameters:vR})),this._texture.height!==this._canvasHeight&&(this._texture=function(t,e,n,i){const r=e.width,s=e.height,o=DS(e,{width:n,height:i});return function(t,e,n={}){const{sourceX:i=0,sourceY:r=0,targetMipmaplevel:s=0,targetInternalFormat:o=6408}=n;let{targetX:a,targetY:l,targetZ:c,width:u,height:h}=n;const{framebuffer:d,deleteFramebuffer:p}=jS(t);Xx(d);const{gl:f,handle:g}=d,m=void 0!==a||void 0!==l||void 0!==c;a=a||0,l=l||0,c=c||0;const b=f.bindFramebuffer(36160,g);Xx(e);let y=null;if(e instanceof _S&&(y=e,u=Number.isFinite(u)?u:y.width,h=Number.isFinite(h)?h:y.height,y.bind(0),e=y.target),m)switch(e){case 3553:case 34067:f.copyTexSubImage2D(e,s,a,l,i,r,u,h);break;case 35866:case 32879:tx(f).copyTexSubImage3D(e,s,a,l,c,i,r,u,h)}else f.copyTexImage2D(e,s,o,i,r,u,h,0);y&&y.unbind(),f.bindFramebuffer(36160,b||null),p&&d.delete()}(e,o,{targetY:0,width:r,height:s}),e.delete(),o}(0,this._texture,this._canvasWidth,this._canvasHeight)),this.onUpdate(),this._loadIcons(e)}}_loadIcons(t){const e=this._canvas.getContext("2d");for(const n of t)this._pendingCount++,XA(n.url,vD,this._loadOptions).then(t=>{const i=xR(n),{x:r,y:s,width:o,height:a}=this._mapping[i],l=wR(e,t,o,a);this._texture.setSubImageData({data:l,x:r,y:s,width:o,height:a}),this._texture.generateMipmap(),this.onUpdate()}).catch(t=>{this.onError({url:n.url,source:n.source,sourceIndex:n.sourceIndex,loadOptions:this._loadOptions,error:t})}).finally(()=>{this._pendingCount--})}}const ER=[0,0,0,255],OR={iconAtlas:{type:"image",value:null,async:!0},iconMapping:{type:"object",value:{},async:!0},sizeScale:{type:"number",value:1,min:0},billboard:!0,sizeUnits:"pixels",sizeMinPixels:{type:"number",min:0,value:0},sizeMaxPixels:{type:"number",min:0,value:Number.MAX_SAFE_INTEGER},alphaCutoff:{type:"number",value:.05,min:0,max:1},getPosition:{type:"accessor",value:t=>t.position},getIcon:{type:"accessor",value:t=>t.icon},getColor:{type:"accessor",value:ER},getSize:{type:"accessor",value:1},getAngle:{type:"accessor",value:0},getPixelOffset:{type:"accessor",value:[0,0]},onIconError:{type:"function",value:null,compare:!1,optional:!0}};let TR=(()=>{class t extends eM{getShaders(){return super.getShaders({vs:"#define SHADER_NAME icon-layer-vertex-shader\n\nattribute vec2 positions;\n\nattribute vec3 instancePositions;\nattribute vec3 instancePositions64Low;\nattribute float instanceSizes;\nattribute float instanceAngles;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\nattribute vec4 instanceIconFrames;\nattribute float instanceColorModes;\nattribute vec2 instanceOffsets;\nattribute vec2 instancePixelOffset;\n\nuniform float sizeScale;\nuniform vec2 iconsTextureDim;\nuniform float sizeMinPixels;\nuniform float sizeMaxPixels;\nuniform bool billboard;\n\nvarying float vColorMode;\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\nvarying vec2 uv;\n\nvec2 rotate_by_angle(vec2 vertex, float angle) {\n float angle_radian = angle * PI / 180.0;\n float cos_angle = cos(angle_radian);\n float sin_angle = sin(angle_radian);\n mat2 rotationMatrix = mat2(cos_angle, -sin_angle, sin_angle, cos_angle);\n return rotationMatrix * vertex;\n}\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n geometry.uv = positions;\n geometry.pickingColor = instancePickingColors;\n uv = positions;\n\n vec2 iconSize = instanceIconFrames.zw;\n float sizePixels = clamp(\n project_size_to_pixel(instanceSizes * sizeScale), \n sizeMinPixels, sizeMaxPixels\n );\n float instanceScale = iconSize.y == 0.0 ? 0.0 : sizePixels / iconSize.y;\n vec2 pixelOffset = positions / 2.0 * iconSize + instanceOffsets;\n pixelOffset = rotate_by_angle(pixelOffset, instanceAngles) * instanceScale;\n pixelOffset += instancePixelOffset;\n pixelOffset.y *= -1.0;\n\n if (billboard) {\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, vec3(0.0), geometry.position);\n vec3 offset = vec3(pixelOffset, 0.0);\n DECKGL_FILTER_SIZE(offset, geometry);\n gl_Position.xy += project_pixel_size_to_clipspace(offset.xy);\n\n } else {\n vec3 offset_common = vec3(project_pixel_size(pixelOffset), 0.0);\n DECKGL_FILTER_SIZE(offset_common, geometry);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, offset_common, geometry.position); \n }\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n vTextureCoords = mix(\n instanceIconFrames.xy,\n instanceIconFrames.xy + iconSize,\n (positions.xy + 1.0) / 2.0\n ) / iconsTextureDim;\n\n vColor = instanceColors;\n DECKGL_FILTER_COLOR(vColor, geometry);\n\n vColorMode = instanceColorModes;\n}\n",fs:"#define SHADER_NAME icon-layer-fragment-shader\n\nprecision highp float;\n\nuniform float opacity;\nuniform sampler2D iconsTexture;\nuniform float alphaCutoff;\n\nvarying float vColorMode;\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\nvarying vec2 uv;\n\nvoid main(void) {\n geometry.uv = uv;\n\n vec4 texColor = texture2D(iconsTexture, vTextureCoords);\n vec3 color = mix(texColor.rgb, vColor.rgb, vColorMode);\n float a = texColor.a * opacity * vColor.a;\n\n if (a < alphaCutoff) {\n discard;\n }\n\n gl_FragColor = vec4(color, a);\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:[pR,gR]})}initializeState(){this.state={iconManager:new CR(this.context.gl,{onUpdate:this._onUpdate.bind(this),onError:this._onError.bind(this)})},this.getAttributeManager().addInstanced({instancePositions:{size:3,type:5130,fp64:this.use64bitPositions(),transition:!0,accessor:"getPosition"},instanceSizes:{size:1,transition:!0,accessor:"getSize",defaultValue:1},instanceOffsets:{size:2,accessor:"getIcon",transform:this.getInstanceOffset},instanceIconFrames:{size:4,accessor:"getIcon",transform:this.getInstanceIconFrame},instanceColorModes:{size:1,type:5121,accessor:"getIcon",transform:this.getInstanceColorMode},instanceColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:!0,accessor:"getColor",defaultValue:ER},instanceAngles:{size:1,transition:!0,accessor:"getAngle"},instancePixelOffset:{size:2,transition:!0,accessor:"getPixelOffset"}})}updateState({oldProps:t,props:e,changeFlags:n}){super.updateState({props:e,oldProps:t,changeFlags:n});const i=this.getAttributeManager(),{iconAtlas:r,iconMapping:s,data:o,getIcon:a}=e,{iconManager:l}=this.state;l.setProps({loadOptions:e.loadOptions});let c=!1;if(r||this.internalState.isAsyncPropLoading("iconAtlas")?(t.iconAtlas!==e.iconAtlas&&l.setProps({iconAtlas:r,autoPacking:!1}),t.iconMapping!==e.iconMapping&&(l.setProps({iconMapping:s}),c=!0)):l.setProps({autoPacking:!0}),(n.dataChanged||n.updateTriggersChanged&&(n.updateTriggersChanged.all||n.updateTriggersChanged.getIcon))&&l.setProps({data:o,getIcon:a}),c&&(i.invalidate("instanceOffsets"),i.invalidate("instanceIconFrames"),i.invalidate("instanceColorModes")),n.extensionsChanged){var u;const{gl:t}=this.context;null===(u=this.state.model)||void 0===u||u.delete(),this.state.model=this._getModel(t),i.invalidateAll()}}get isLoaded(){return super.isLoaded&&this.state.iconManager.isLoaded}finalizeState(){super.finalizeState(),this.state.iconManager.finalize()}draw({uniforms:t}){const{sizeScale:e,sizeMinPixels:n,sizeMaxPixels:i,sizeUnits:r,billboard:s,alphaCutoff:o}=this.props,{iconManager:a}=this.state,{viewport:l}=this.context,c=a.getTexture();c&&this.state.model.setUniforms(t).setUniforms({iconsTexture:c,iconsTextureDim:[c.width,c.height],sizeScale:e*("pixels"===r?l.metersPerPixel:1),sizeMinPixels:n,sizeMaxPixels:i,billboard:s,alphaCutoff:o}).draw()}_getModel(t){return new WO(t,zn(vt({},this.getShaders()),{id:this.props.id,geometry:new bR({drawMode:6,attributes:{positions:{size:2,value:new Float32Array([-1,-1,-1,1,1,1,1,-1])}}}),isInstanced:!0}))}_onUpdate(){this.setNeedsRedraw()}_onError(t){const{onIconError:e}=this.getCurrentLayer().props;e?e(t):Gw.error(t.error)()}getInstanceOffset(t){const e=this.state.iconManager.getIconMapping(t);return[e.width/2-e.anchorX||0,e.height/2-e.anchorY||0]}getInstanceColorMode(t){return this.state.iconManager.getIconMapping(t).mask?1:0}getInstanceIconFrame(t){const e=this.state.iconManager.getIconMapping(t);return[e.x||0,e.y||0,e.width||0,e.height||0]}}return t.layerName="IconLayer",t.defaultProps=OR,t})();const kR=[],PR={getIconOffsets:{type:"accessor",value:t=>t.offsets},alphaCutoff:.001,smoothing:.1,outlineWidth:0,outlineColor:{type:"color",value:[0,0,0,255]}};let AR=(()=>{class t extends TR{getShaders(){return zn(vt({},super.getShaders()),{fs:"#define SHADER_NAME multi-icon-layer-fragment-shader\n\nprecision highp float;\n\nuniform float opacity;\nuniform sampler2D iconsTexture;\nuniform float gamma;\nuniform bool sdf;\nuniform float alphaCutoff;\nuniform float buffer;\nuniform float outlineBuffer;\nuniform vec4 outlineColor;\n\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\nvarying vec2 uv;\n\nvoid main(void) {\n geometry.uv = uv;\n\n if (!picking_uActive) {\n float alpha = texture2D(iconsTexture, vTextureCoords).a;\n vec4 color = vColor;\n if (sdf) {\n float distance = alpha;\n alpha = smoothstep(buffer - gamma, buffer + gamma, distance);\n\n if (outlineBuffer > 0.0) {\n float inFill = alpha;\n float inBorder = smoothstep(outlineBuffer - gamma, outlineBuffer + gamma, distance);\n color = mix(outlineColor, vColor, inFill);\n alpha = inBorder;\n }\n }\n float a = alpha * color.a;\n \n if (a < alphaCutoff) {\n discard;\n }\n\n gl_FragColor = vec4(color.rgb, a * opacity);\n }\n\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n"})}initializeState(){super.initializeState(),this.getAttributeManager().addInstanced({instanceOffsets:{size:2,accessor:"getIconOffsets"},instancePickingColors:{type:5121,size:3,accessor:(t,{index:e,target:n})=>this.encodePickingColor(e,n)}})}updateState(t){super.updateState(t);const{props:e,oldProps:n}=t;let{outlineColor:i}=e;i!==n.outlineColor&&(i=i.map(t=>t/255),i[3]=Number.isFinite(i[3])?i[3]:1,this.setState({outlineColor:i})),!e.sdf&&e.outlineWidth&&Gw.warn("".concat(this.id,": fontSettings.sdf is required to render outline"))()}draw(t){const{sdf:e,smoothing:n,outlineWidth:i}=this.props,{outlineColor:r}=this.state;t.uniforms=zn(vt({},t.uniforms),{buffer:.75,outlineBuffer:i?Math.max(n,.75*(1-i)):-1,gamma:n,sdf:Boolean(e),outlineColor:r}),super.draw(t)}getInstanceOffset(t){return t?Array.from(t).map(t=>super.getInstanceOffset(t)):kR}getInstanceColorMode(t){return 1}getInstanceIconFrame(t){return t?Array.from(t).map(t=>super.getInstanceIconFrame(t)):kR}}return t.layerName="MultiIconLayer",t.defaultProps=PR,t})();var MR=n(51002),IR=n.n(MR);const DR=[];function RR(t){return Math.pow(2,Math.ceil(Math.log2(t)))}function NR(t,e,n,i){let r=0;for(let s=e;si&&(oa){let e=NR(t,a,l,r);c+e>i&&(oi&&(e=LR(t,a,l,i,r,s),o=s[s.length-1])),a=l,c+=e}}(t,r,s,n,i,o),o}function FR(t,e,n,i,r,s){let o=0,a=0;for(let l=e;l0,u=[0,0],h=[];let d=0,p=0,f=0;for(let g=0;g<=s;g++){const m=t[g];if(("\n"===m||g===s)&&(f=g),f>p){const s=c?jR(t,n,i,r,p,f):DR;for(let n=0;n<=s.length;n++){const i=0===n?p:s[n-1],c=ne===t);e>=0&&this._order.splice(e,1)}_appendOrder(t){this._order.push(t)}}(3),HR=["fontFamily","fontWeight","characterSet","fontSize","sdf","buffer","cutoff","radius"];function $R(t,e){for(let n=0;n{e in t&&(this.props[e]=t[e])});const e=this._key;this._key=this._getKey();const n=function(t,e){const n=UR.get(t);if(!n)return e;const i=[];let r=Object.keys(n.mapping);r=new Set(r);let s=e;return s instanceof Array&&(s=new Set(s)),s.forEach(t=>{r.has(t)||i.push(t)}),i}(this._key,this.props.characterSet),i=UR.get(this._key);if(i&&0===n.length)return void(this._key!==e&&(this._atlas=i));const r=this._generateFontAtlas(this._key,n,i);this._atlas=r,UR.set(this._key,r)}_generateFontAtlas(t,e,n){const{fontFamily:i,fontWeight:r,fontSize:s,buffer:o,sdf:a,radius:l,cutoff:c}=this.props;let u=n&&n.data;u||(u=document.createElement("canvas"),u.width=1024);const h=u.getContext("2d");GR(h,i,s,r);const{mapping:d,canvasHeight:p,xOffset:f,yOffset:g}=function({characterSet:t,getFontWidth:e,fontHeight:n,buffer:i,maxCanvasWidth:r,mapping:s={},xOffset:o=0,yOffset:a=0}){let l=0,c=o,u=0;for(const d of t)if(!s[d]){const t=e(d,u++);c+t+2*i>r&&(c=0,l++),s[d]={x:c+i,y:a+l*(n+2*i)+i,width:t,height:n},c+=t+2*i}const h=n+2*i;return{mapping:s,xOffset:c,yOffset:a+l*h,canvasHeight:RR(a+(l+1)*h)}}(vt({getFontWidth:t=>h.measureText(t).width,fontHeight:1.2*s,buffer:o,characterSet:e,maxCanvasWidth:1024},n&&{mapping:n.mapping,xOffset:n.xOffset,yOffset:n.yOffset}));if(u.height!==p){const t=h.getImageData(0,0,u.width,u.height);u.height=p,h.putImageData(t,0,0)}if(GR(h,i,s,r),a){const t=new(IR())(s,o,l,c,i,r),n=h.getImageData(0,0,t.size,t.size);for(const i of e)$R(t.draw(i),n),h.putImageData(n,d[i].x-o,d[i].y+o)}else for(const m of e)h.fillText(m,d[m].x,d[m].y+.9*s);return{xOffset:f,yOffset:g,mapping:d,data:u,width:u.width,height:u.height}}_getKey(){const{fontFamily:t,fontWeight:e,fontSize:n,buffer:i,sdf:r,radius:s,cutoff:o}=this.props;return r?"".concat(t," ").concat(e," ").concat(n," ").concat(i," ").concat(s," ").concat(o):"".concat(t," ").concat(e," ").concat(n," ").concat(i)}}const qR={billboard:!0,sizeScale:1,sizeUnits:"pixels",sizeMinPixels:0,sizeMaxPixels:Number.MAX_SAFE_INTEGER,padding:{type:"array",value:[0,0,0,0]},getPosition:{type:"accessor",value:t=>t.position},getSize:{type:"accessor",value:1},getAngle:{type:"accessor",value:0},getPixelOffset:{type:"accessor",value:[0,0]},getBoundingRect:{type:"accessor",value:[0,0,0,0]},getFillColor:{type:"accessor",value:[0,0,0,255]},getLineColor:{type:"accessor",value:[0,0,0,255]},getLineWidth:{type:"accessor",value:1}};let XR=(()=>{class t extends eM{getShaders(){return super.getShaders({vs:"#define SHADER_NAME text-background-layer-vertex-shader\n\nattribute vec2 positions;\n\nattribute vec3 instancePositions;\nattribute vec3 instancePositions64Low;\nattribute vec4 instanceRects;\nattribute float instanceSizes;\nattribute float instanceAngles;\nattribute vec2 instancePixelOffsets;\nattribute float instanceLineWidths;\nattribute vec4 instanceFillColors;\nattribute vec4 instanceLineColors;\nattribute vec3 instancePickingColors;\n\nuniform bool billboard;\nuniform float opacity;\nuniform float sizeScale;\nuniform float sizeMinPixels;\nuniform float sizeMaxPixels;\nuniform vec4 padding;\n\nvarying vec4 vFillColor;\nvarying vec4 vLineColor;\nvarying float vLineWidth;\nvarying vec2 uv;\nvarying vec2 dimensions;\n\nvec2 rotate_by_angle(vec2 vertex, float angle) {\n float angle_radian = radians(angle);\n float cos_angle = cos(angle_radian);\n float sin_angle = sin(angle_radian);\n mat2 rotationMatrix = mat2(cos_angle, -sin_angle, sin_angle, cos_angle);\n return rotationMatrix * vertex;\n}\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n geometry.uv = positions;\n geometry.pickingColor = instancePickingColors;\n uv = positions;\n vLineWidth = instanceLineWidths;\n float sizePixels = clamp(\n project_size_to_pixel(instanceSizes * sizeScale),\n sizeMinPixels, sizeMaxPixels\n );\n\n dimensions = instanceRects.zw * sizePixels + padding.xy + padding.zw;\n\n vec2 pixelOffset = (positions * instanceRects.zw + instanceRects.xy) * sizePixels + mix(-padding.xy, padding.zw, positions);\n pixelOffset = rotate_by_angle(pixelOffset, instanceAngles);\n pixelOffset += instancePixelOffsets;\n pixelOffset.y *= -1.0;\n\n if (billboard) {\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, vec3(0.0), geometry.position);\n vec3 offset = vec3(pixelOffset, 0.0);\n DECKGL_FILTER_SIZE(offset, geometry);\n gl_Position.xy += project_pixel_size_to_clipspace(offset.xy);\n } else {\n vec3 offset_common = vec3(project_pixel_size(pixelOffset), 0.0);\n DECKGL_FILTER_SIZE(offset_common, geometry);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, offset_common, geometry.position);\n }\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n vFillColor = vec4(instanceFillColors.rgb, instanceFillColors.a * opacity);\n DECKGL_FILTER_COLOR(vFillColor, geometry);\n vLineColor = vec4(instanceLineColors.rgb, instanceLineColors.a * opacity);\n DECKGL_FILTER_COLOR(vLineColor, geometry);\n}\n",fs:"#define SHADER_NAME text-background-layer-fragment-shader\n\nprecision highp float;\n\nuniform bool stroked;\n\nvarying vec4 vFillColor;\nvarying vec4 vLineColor;\nvarying float vLineWidth;\nvarying vec2 uv;\nvarying vec2 dimensions;\n\nvoid main(void) {\n geometry.uv = uv;\n\n vec2 pixelPosition = uv * dimensions;\n if (stroked) {\n float distToEdge = min(\n min(pixelPosition.x, dimensions.x - pixelPosition.x),\n min(pixelPosition.y, dimensions.y - pixelPosition.y)\n );\n float isBorder = smoothedge(distToEdge, vLineWidth);\n gl_FragColor = mix(vFillColor, vLineColor, isBorder);\n } else {\n gl_FragColor = vFillColor;\n }\n\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:[pR,gR]})}initializeState(){this.getAttributeManager().addInstanced({instancePositions:{size:3,type:5130,fp64:this.use64bitPositions(),transition:!0,accessor:"getPosition"},instanceSizes:{size:1,transition:!0,accessor:"getSize",defaultValue:1},instanceAngles:{size:1,transition:!0,accessor:"getAngle"},instanceRects:{size:4,accessor:"getBoundingRect"},instancePixelOffsets:{size:2,transition:!0,accessor:"getPixelOffset"},instanceFillColors:{size:4,transition:!0,normalized:!0,type:5121,accessor:"getFillColor",defaultValue:[0,0,0,255]},instanceLineColors:{size:4,transition:!0,normalized:!0,type:5121,accessor:"getLineColor",defaultValue:[0,0,0,255]},instanceLineWidths:{size:1,transition:!0,accessor:"getLineWidth",defaultValue:1}})}updateState({props:t,oldProps:e,changeFlags:n}){if(super.updateState({props:t,oldProps:e,changeFlags:n}),n.extensionsChanged){var i;const{gl:t}=this.context;null===(i=this.state.model)||void 0===i||i.delete(),this.state.model=this._getModel(t),this.getAttributeManager().invalidateAll()}}draw({uniforms:t}){const{viewport:e}=this.context,{billboard:n,sizeScale:i,sizeUnits:r,sizeMinPixels:s,sizeMaxPixels:o,getLineWidth:a}=this.props;let{padding:l}=this.props;const c="pixels"===r?e.metersPerPixel:1;l.length<4&&(l=[l[0],l[1],l[0],l[1]]),this.state.model.setUniforms(t).setUniforms({billboard:n,stroked:Boolean(a),padding:l,sizeScale:i*c,sizeMinPixels:s,sizeMaxPixels:o}).draw()}_getModel(t){return new WO(t,zn(vt({},this.getShaders()),{id:this.props.id,geometry:new bR({drawMode:6,vertexCount:4,attributes:{positions:{size:2,value:new Float32Array([0,0,1,0,1,1,0,1])}}}),isInstanced:!0}))}}return t.layerName="TextBackgroundLayer",t.defaultProps=qR,t})();const YR={fontSize:64,buffer:4,sdf:!1,radius:12,cutoff:.25,smoothing:.1},KR={start:1,middle:0,end:-1},QR={top:1,center:0,bottom:-1},ZR=[0,0,0,255],JR=["fontSize","buffer","sdf","radius","cutoff"],tN={billboard:!0,sizeScale:1,sizeUnits:"pixels",sizeMinPixels:0,sizeMaxPixels:Number.MAX_SAFE_INTEGER,background:!1,getBackgroundColor:{type:"accessor",value:[255,255,255,255]},getBorderColor:{type:"accessor",value:ZR},getBorderWidth:{type:"accessor",value:0},backgroundPadding:{type:"array",value:[0,0,0,0]},characterSet:{type:"object",value:VR},fontFamily:zR,fontWeight:"normal",lineHeight:1,outlineWidth:{type:"number",value:0,min:0},outlineColor:{type:"color",value:ZR},fontSettings:{},wordBreak:"break-word",maxWidth:{type:"number",value:-1},getText:{type:"accessor",value:t=>t.text},getPosition:{type:"accessor",value:t=>t.position},getColor:{type:"accessor",value:ZR},getSize:{type:"accessor",value:32},getAngle:{type:"accessor",value:0},getTextAnchor:{type:"accessor",value:"middle"},getAlignmentBaseline:{type:"accessor",value:"center"},getPixelOffset:{type:"accessor",value:[0,0]},backgroundColor:{deprecatedFor:["background","getBackgroundColor"]}};let eN=(()=>{class t extends nM{initializeState(){this.state={styleVersion:0,fontAtlasManager:new WR}}updateState({props:t,oldProps:e,changeFlags:n}){const i=this.state.characterSet;(n.dataChanged||n.updateTriggersChanged&&(n.updateTriggersChanged.all||n.updateTriggersChanged.getText))&&this._updateText();const r=i!==this.state.characterSet||this._fontChanged(e,t);r&&this._updateFontAtlas(e,t),(r||t.lineHeight!==e.lineHeight||t.wordBreak!==e.wordBreak||t.maxWidth!==e.maxWidth)&&this.setState({styleVersion:this.state.styleVersion+1})}getPickingInfo({info:t}){return t.object=t.index>=0?this.props.data[t.index]:null,t}_updateFontAtlas(t,e){const{fontSettings:n,fontFamily:i,fontWeight:r}=e,{fontAtlasManager:s,characterSet:o}=this.state;s.setProps(zn(vt(vt({},YR),n),{characterSet:o,fontFamily:i,fontWeight:r}))}_fontChanged(t,e){if(t.fontFamily!==e.fontFamily||t.fontWeight!==e.fontWeight)return!0;if(t.fontSettings===e.fontSettings)return!1;const n=t.fontSettings||{},i=e.fontSettings||{};return JR.some(t=>n[t]!==i[t])}_updateText(){const{data:t,characterSet:e}=this.props,n=t.attributes&&t.attributes.getText;let i,{getText:r}=this.props,{startIndices:s}=t;const o="auto"===e&&new Set;if(n&&s){const{texts:e,characterCount:a}=function({value:t,length:e,stride:n,offset:i,startIndices:r,characterSet:s}){const o=t.BYTES_PER_ELEMENT,a=n?n/o:1,l=i?i/o:0,c=r[e]||Math.ceil((t.length-l)/a),u=s&&new Set,h=new Array(e);let d=t;if(a>1||l>0){d=new t.constructor(c);for(let e=0;ee[n]}else{const{iterable:e,objectInfo:n}=jC(t);s=[0],i=0;for(const t of e){n.index++;const e=Array.from(r(t,n)||"");o&&e.forEach(o.add,o),i+=e.length,s.push(i)}}this.setState({getText:r,startIndices:s,numInstances:i,characterSet:o||e})}getBoundingRect(t,e){const n=this.state.fontAtlasManager.mapping,{getText:i}=this.state,{wordBreak:r,maxWidth:s,lineHeight:o,getTextAnchor:a,getAlignmentBaseline:l}=this.props,c=i(t,e)||"",{size:[u,h]}=BR(c,o,r,s,n);return[(KR["function"==typeof a?a(t,e):a]-1)*u/2,(QR["function"==typeof l?l(t,e):l]-1)*h/2,u,h]}getIconOffsets(t,e){const n=this.state.fontAtlasManager.mapping,{getText:i}=this.state,{wordBreak:r,maxWidth:s,lineHeight:o,getTextAnchor:a,getAlignmentBaseline:l}=this.props,c=i(t,e)||"",{x:u,y:h,rowWidth:d,size:[p,f]}=BR(c,o,r,s,n),g=KR["function"==typeof a?a(t,e):a],m=QR["function"==typeof l?l(t,e):l],b=u.length,y=new Array(2*b);let v=0;for(let _=0;_t*e/255)}const sN={name:"lights",vs:nN,fs:nN,getUniforms:function t(e=iN){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?rN(t):[0,0,0],e.forEach((t,e)=>{i[`lighting_uPointLight[${e}].color`]=rN(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`]=rN(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 oN={};const aN={name:"phong-lighting",dependencies:[sN],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=oN){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}}},lN=Math.PI/180,cN=new Float32Array(16),uN=new Float32Array(12);function hN(t,e,n){const i=e[0]*lN,r=e[1]*lN,s=e[2]*lN,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 dN(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 pN={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?(cN.set(a),e=dN(cN)):(e=uN,hN(e,r,s),e.set(o,9)),t.value=new Float32Array(e)}else{let l=e*t.size;const{iterable:g,objectInfo:m}=jC(i,e,n);for(const t of g){let e;m.index++,p?(cN.set(c?a:a(t,m)),e=dN(cN)):(e=uN,hN(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 fN(t,e){return e===Ww.CARTESIAN||e===Ww.METER_OFFSETS||e===Ww.DEFAULT&&!t.isGeospatial}function gN(t,e){(t.COLOR_0||t.colors)&&e||(t.colors={constant:!0,value:new Float32Array([1,1,1])}),Gw.assert(t.positions||t.POSITION,'no "postions" or "POSITION" attribute in mesh')}function mN(t,e){if(t.attributes)return gN(t.attributes,e),t instanceof bR?t:new bR(t);if(t.positions||t.POSITION)return gN(t,e),new bR({attributes:t});throw Error("Invalid mesh")}const bN={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 yN=(()=>{class t extends eM{getShaders(){const t=!Zw(this.context.gl),e={};return zS(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:[pR,aN,gR],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:pN}),this.setState({emptyTexture:new xS(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||fN(e,i),flatShading:!this.state.hasNormals}).draw()}getModel(t){const e=new WO(this.context.gl,zn(vt({},this.getShaders()),{id:this.props.id,geometry:mN(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=bN,t})();const vN={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:[sN]};class _N{constructor(t={}){const{id:e}=t;this.id=e||Zx(this.constructor.name),this.display=!0,this.position=new OC,this.rotation=new OC,this.scale=new OC(1,1,1),this.matrix=new VT,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 Xx(3===t.length,"setPosition requires vector argument"),this.position=t,this}setRotation(t){return Xx(3===t.length,"setRotation requires vector argument"),this.rotation=t,this}setScale(t){return Xx(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){Xx(t),e=e||this.matrix;const n=new VT(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 wN extends _N{constructor(t={}){t=Array.isArray(t)?{children:t}:t;const{children:e=[]}=t;Yw.assert(e.every(t=>t instanceof _N),"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 VT}={}){const n=new VT(e).multiplyRight(this.matrix);for(const i of this.children)i instanceof wN?i.traverse(t,{worldMatrix:n}):t(i,{worldMatrix:n})}}function xN(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=n[0],p=n[1],f=n[2],g=n[3],m=n[4],b=n[5],y=n[6],v=n[7],_=n[8];return t[0]=d*i+p*o+f*c,t[1]=d*r+p*a+f*u,t[2]=d*s+p*l+f*h,t[3]=g*i+m*o+b*c,t[4]=g*r+m*a+b*u,t[5]=g*s+m*l+b*h,t[6]=y*i+v*o+_*c,t[7]=y*r+v*a+_*u,t[8]=y*s+v*l+_*h,t}function SN(t,e,n){var i=n[0],r=n[1];return t[0]=i*e[0],t[1]=i*e[1],t[2]=i*e[2],t[3]=r*e[3],t[4]=r*e[4],t[5]=r*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function CN(){var t=new hC(4);return hC!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function EN(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t}function ON(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 TN(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}function kN(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);return t[0]=i*l+o*a,t[1]=r*l+s*a,t[2]=s*l-r*a,t[3]=o*l-i*a,t}function PN(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);return t[0]=i*l-s*a,t[1]=r*l+o*a,t[2]=s*l+i*a,t[3]=o*l-r*a,t}function AN(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);return t[0]=i*l+r*a,t[1]=r*l-i*a,t[2]=s*l+o*a,t[3]=o*l-s*a,t}function MN(t,e){var n=e[0],i=e[1],r=e[2];return t[0]=n,t[1]=i,t[2]=r,t[3]=Math.sqrt(Math.abs(1-n*n-i*i-r*r)),t}function IN(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];return(s=c*p+u*f+h*g+d*m)<0&&(s=-s,p=-p,f=-f,g=-g,m=-m),1-s>uC?(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,t}function DN(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;return t[0]=-n*a,t[1]=-i*a,t[2]=-r*a,t[3]=s*a,t}function RN(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t}function NN(t,e){var n,i=e[0]+e[4]+e[8];if(i>0)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}return t}var LN=function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t},jN=xT,FN=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]},BN=function(t,e,n,i){var r=e[0],s=e[1],o=e[2],a=e[3];return 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),t},VN=function(t){return Math.hypot(t[0],t[1],t[2],t[3])},zN=function(t){var e=t[0],n=t[1],i=t[2],r=t[3];return e*e+n*n+i*i+r*r},UN=function(){var t=dC(),e=pC(1,0,0),n=pC(0,1,0);return function(i,r,s){var o=fC(r,s);return o<-.999999?(gC(t,e,r),function(t){return Math.hypot(t[0],t[1],t[2])}(t)<1e-6&&gC(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),ON(i,t,Math.PI),i):o>.999999?(i[0]=0,i[1]=0,i[2]=0,i[3]=1,i):(gC(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))}}();CN(),CN(),function(){var t=new hC(9);hC!=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 HN=[0,0,0,1];class $N extends rC{constructor(t=0,e=0,n=0,i=1){super(-0,-0,-0,-0),Array.isArray(t)&&1===arguments.length?this.copy(t):this.set(t,e,n,i)}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this.check()}set(t,e,n,i){return this[0]=t,this[1]=e,this[2]=n,this[3]=i,this.check()}fromMatrix3(t){return NN(this,t),this.check()}identity(){return EN(this),this.check()}fromAxisRotation(t,e){return ON(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]=sC(t)}get y(){return this[1]}set y(t){this[1]=sC(t)}get z(){return this[2]}set z(t){this[2]=sC(t)}get w(){return this[3]}set w(t){this[3]=sC(t)}len(){return VN(this)}lengthSquared(){return zN(this)}dot(t,e){if(void 0!==e)throw new Error("Quaternion.dot only takes one argument");return FN(this,t)}rotationTo(t,e){return UN(this,t,e),this.check()}add(t,e){if(void 0!==e)throw new Error("Quaternion.add only takes one argument");return LN(this,this,t),this.check()}calculateW(){return MN(this,this),this.check()}conjugate(){return RN(this,this),this.check()}invert(){return DN(this,this),this.check()}lerp(t,e,n){return BN(this,t,e,n),this.check()}multiplyRight(t,e){return iC(!e),TN(this,this,t),this.check()}multiplyLeft(t,e){return iC(!e),TN(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 kN(this,this,t),this.check()}rotateY(t){return PN(this,this,t),this.check()}rotateZ(t){return AN(this,this,t),this.check()}scale(t){return jN(this,this,t),this.check()}slerp(t,e,n){switch(arguments.length){case 1:({start:t=HN,target:e,ratio:n}=arguments[0]);break;case 2:[e,n]=arguments,t=this}return IN(this,t,e,n),this.check()}transformVector4(t,e=t){return CT(e,t,this),oC(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)}}const GN={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},WN={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function qN(t){if(!t._animation){const e=WN[t.componentType],n=GN[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;t{(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:Yw.warn(`Bad animation path ${s}`)()}Xx(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){YN.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:qN(t.accessors[e]),interpolation:n,output:qN(t.accessors[i])})),s=e.channels.map(({sampler:e,target:n})=>({sampler:r[e],target:t.nodes[n.node],path:n.path}));return new KN({name:i,channels:s})})}animate(t){this.setTime(t)}setTime(t){this.animations.forEach(e=>e.animate(t))}getAnimations(){return this.animations}}class ZN extends _N{constructor(t,e={}){super(e),this.onBeforeRender=null,this.AfterRender=null,t instanceof WO?(this.model=t,this._setModelNodeProps(e)):this.model=new WO(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 JN{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},zS(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 xS(this.gl,vt({id:t.name||t.id,parameters:vt(vt({},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&&(Yw.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 tL(t,e){return Zw(t)?`#version 300 es\n${e}`:e}const eL={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},nL={modelOptions:{},pbrDebug:!1,imageBasedLightingEnvironment:null,lights:!0,useTangents:!1};class iL{constructor(t,e={}){this.gl=t,this.options=Object.assign({},nL,e)}instantiate(t){return this.gltf=t,(t.scenes||[]).map(t=>this.createScene(t))}createAnimator(){return Array.isArray(this.gltf.animations)?new QN(this.gltf):null}createScene(t){const e=(t.nodes||[]).map(t=>this.createNode(t));return new wN({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 wN({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 VT).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 wN({id:t.name||t.id,children:e});t._mesh=n}return t._mesh}getVertexCount(t){Yw.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 JN(t,e);Yw.info(4,"createGLTFModel defines: ",a.defines)();const l=[];l.push(...a.generatedTextures),l.push(...Object.values(s).map(t=>t.buffer));const c=new ZN(t,Object.assign({id:n,drawMode:i,vertexCount:r,modules:[vN],defines:a.defines,parameters:a.parameters,vs:tL(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:tL(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))),Yw.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 fS(this.gl,{id:`from-${n.id}`,data:n.data||t.value,target:e})),n.lumaBuffers[e]}createAccessor(t,e){return new uS({buffer:e,offset:t.byteOffset||0,stride:t.bufferView.byteStride||0,type:t.componentType,size:eL[t.type]})}createSampler(t){return t}needsPOT(){return!1}}function rL(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 cL(n,this.metadata)}selectAt(...t){const e=t.map(t=>this.fields[t]).filter(Boolean);return new cL(e,this.metadata)}assign(t){let e,n=this.metadata;if(t instanceof cL){const i=t;e=i.fields,n=uL(uL(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 cL(r,n)}}function uL(t,e){return new Map([...t||new Map,...e||new Map])}let hL,dL,pL,fL,gL,mL,bL,yL;!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"}(hL||(hL={}));class vL{static isNull(t){return t&&t.typeId===hL.Null}static isInt(t){return t&&t.typeId===hL.Int}static isFloat(t){return t&&t.typeId===hL.Float}static isBinary(t){return t&&t.typeId===hL.Binary}static isUtf8(t){return t&&t.typeId===hL.Utf8}static isBool(t){return t&&t.typeId===hL.Bool}static isDecimal(t){return t&&t.typeId===hL.Decimal}static isDate(t){return t&&t.typeId===hL.Date}static isTime(t){return t&&t.typeId===hL.Time}static isTimestamp(t){return t&&t.typeId===hL.Timestamp}static isInterval(t){return t&&t.typeId===hL.Interval}static isList(t){return t&&t.typeId===hL.List}static isStruct(t){return t&&t.typeId===hL.Struct}static isUnion(t){return t&&t.typeId===hL.Union}static isFixedSizeBinary(t){return t&&t.typeId===hL.FixedSizeBinary}static isFixedSizeList(t){return t&&t.typeId===hL.FixedSizeList}static isMap(t){return t&&t.typeId===hL.Map}static isDictionary(t){return t&&t.typeId===hL.Dictionary}get typeId(){return hL.NONE}compareTo(t){return this===t}}Symbol,Symbol,dL=Symbol.toStringTag;class _L extends vL{constructor(t,e){super(),kP(this,"isSigned",void 0),kP(this,"bitWidth",void 0),this.isSigned=t,this.bitWidth=e}get typeId(){return hL.Int}get[dL](){return"Int"}toString(){return`${this.isSigned?"I":"Ui"}nt${this.bitWidth}`}}class wL extends _L{constructor(){super(!0,8)}}class xL extends _L{constructor(){super(!0,16)}}class SL extends _L{constructor(){super(!0,32)}}class CL extends _L{constructor(){super(!1,8)}}class EL extends _L{constructor(){super(!1,16)}}class OL extends _L{constructor(){super(!1,32)}}pL=Symbol.toStringTag;class TL extends vL{constructor(t){super(),kP(this,"precision",void 0),this.precision=t}get typeId(){return hL.Float}get[pL](){return"Float"}toString(){return`Float${this.precision}`}}class kL extends TL{constructor(){super(32)}}class PL extends TL{constructor(){super(64)}}Symbol,Symbol,fL=Symbol.toStringTag,gL=Symbol.toStringTag,mL=Symbol.toStringTag,bL=Symbol.toStringTag,yL=Symbol.toStringTag;class AL extends vL{constructor(t,e){super(),kP(this,"listSize",void 0),kP(this,"children",void 0),this.listSize=t,this.children=[e]}get typeId(){return hL.FixedSizeList}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get[yL](){return"FixedSizeList"}toString(){return`FixedSizeList[${this.listSize}]<${this.valueType}>`}}class ML{constructor(t,e,n=!1,i=new Map){kP(this,"name",void 0),kP(this,"type",void 0),kP(this,"nullable",void 0),kP(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 ML(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 IL(t,e,n){const i=n?DL(n.metadata):void 0,r=function(t){switch(t.constructor){case Int8Array:return new wL;case Uint8Array:return new CL;case Int16Array:return new xL;case Uint16Array:return new EL;case Int32Array:return new SL;case Uint32Array:return new OL;case Float32Array:return new kL;case Float64Array:return new PL;default:throw new Error("array type not supported")}}(e.value);return new ML(t,new AL(e.size,new ML("value",r)),!1,i)}function DL(t){const e=new Map;for(const n in t)e.set(`${n}.string`,JSON.stringify(t[n]));return e}const RL={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},NL={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array};class LL{constructor(t){kP(this,"draco",void 0),kP(this,"decoder",void 0),kP(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=DL(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=IL(o,t[o],s[o]);r.push(e)}if(n){const t=IL("indices",n);r.push(t)}return new cL(r,i)}(o.attributes,s,o.indices);return zn(vt({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 jL=n(49125);const FL={};function BL(t){return VL.apply(this,arguments)}function VL(){return(VL=PS(function*(t,e=null,n={}){return e&&(t=zL(t,e,n)),FL[t]=FL[t]||UL(t),yield FL[t]})).apply(this,arguments)}function zL(t,e,n){if(t.startsWith("http"))return t;const i=n.modules||{};return i[t]?i[t]:$P?n.CDN?(VP(n.CDN.startsWith("http")),`${n.CDN}/${e}@3.0.12/dist/libs/${t}`):GP?`../src/libs/${t}`:`modules/${e}/src/libs/${t}`:`modules/${e}/dist/libs/${t}`}function UL(t){return HL.apply(this,arguments)}function HL(){return(HL=PS(function*(t){return t.endsWith("wasm")?yield(yield fetch(t)).arrayBuffer():$P?GP?importScripts(t):$L(yield(yield fetch(t)).text(),t):jL.requireFromFile&&(yield jL.requireFromFile(t))})).apply(this,arguments)}function $L(t,e){if(!$P)return jL.requireFromString&&jL.requireFromString(t,e);if(GP)return eval.call(HP,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 GL="https://www.gstatic.com/draco/versioned/decoders/1.4.1/draco_decoder.js",WL="https://www.gstatic.com/draco/versioned/decoders/1.4.1/draco_wasm_wrapper.js",qL="https://www.gstatic.com/draco/versioned/decoders/1.4.1/draco_decoder.wasm";let XL;function YL(t){return KL.apply(this,arguments)}function KL(){return(KL=PS(function*(t){const e=t.modules||{};return XL=e.draco3d?XL||e.draco3d.createDecoderModule({}).then(t=>({draco:t})):XL||QL(t),yield XL})).apply(this,arguments)}function QL(t){return ZL.apply(this,arguments)}function ZL(){return(ZL=PS(function*(t){let e,n;switch(t.draco&&t.draco.decoderType){case"js":e=yield BL(GL,"draco",t);break;case"wasm":default:[e,n]=yield Promise.all([yield BL(WL,"draco",t),yield BL(qL,"draco",t)])}return e=e||globalThis.DracoDecoderModule,yield JL(e,n)})).apply(this,arguments)}function JL(t,e){const n={};return e&&(n.wasmBinary=e),new Promise(e=>{t(zn(vt({},n),{onModuleLoaded:t=>e({draco:t})}))})}const tj=zn(vt({},lL),{parse:function(t,e){return ej.apply(this,arguments)}});function ej(){return(ej=PS(function*(t,e){const{draco:n}=yield YL(e),i=new LL(n);try{return i.parseSync(t,null==e?void 0:e.draco)}finally{i.destroy()}})).apply(this,arguments)}function nj(t,e){return tP(t>=0),tP(e>0),t+(e-1)&~(e-1)}function ij(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+nj(i.byteLength,4)}const rj=["SCALAR","VEC2","VEC3","VEC4"],sj=[[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Uint32Array,5125],[Float32Array,5126],[Float64Array,5130]],oj=new Map(sj),aj={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},lj={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},cj={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function uj(t){return rj[t-1]||rj[0]}function hj(t){const e=oj.get(t.constructor);if(!e)throw new Error("Illegal typed array");return e}function dj(t,e){const n=cj[t.componentType],i=aj[t.type],r=t.count*i,s=t.count*i*lj[t.componentType];return sL(s>=0&&s<=e.byteLength),{ArrayType:n,length:r,byteLength:s}}const pj={asset:{version:"2.0",generator:"loaders.gl"},buffers:[]};class fj{constructor(t){kP(this,"gltf",void 0),kP(this,"sourceBuffers",void 0),kP(this,"byteLength",void 0),this.gltf=t||{json:vt({},pj),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 sL(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}=dj(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 sL(e),this.json.extensions=this.json.extensions||{},this.json.extensions[t]=e,this.registerUsedExtension(t),e}addRequiredExtension(t,e={}){return sL(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=fD(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;sL(Number.isFinite(e)),this.sourceBuffers=this.sourceBuffers||[],this.sourceBuffers.push(t);const n={buffer:0,byteOffset:this.byteLength,byteLength:e};return this.byteLength+=nj(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:uj(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:hj(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=ij(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*Pj(t){for(const e of t.json.meshes||[])for(const t of e.primitives)yield t}function Aj(t){return Mj.apply(this,arguments)}function Mj(){return(Mj=PS(function*(t){const e=new fj(t),{json:n}=e;e.removeExtension(yj);for(const i of n.materials||[])i.extensions&&i.extensions.KHR_materials_unlit&&(i.unlit=!0),e.removeObjectExtension(i,yj)})).apply(this,arguments)}function Ij(t){const e=new fj(t),{json:n}=e;if(e.materials)for(const i of n.materials||[])i.unlit&&(delete i.unlit,e.addObjectExtension(i,yj,{}),e.addExtension(yj))}function Dj(t){return Rj.apply(this,arguments)}function Rj(){return(Rj=PS(function*(t){const e=new fj(t),{json:n}=e,i=e.getExtension(bj);i&&(e.json.lights=i.lights,e.removeExtension(bj));for(const r of n.nodes||[]){const t=e.getObjectExtension(r,bj);t&&(r.light=t.light),e.removeObjectExtension(r,bj)}})).apply(this,arguments)}function Nj(t){return Lj.apply(this,arguments)}function Lj(){return(Lj=PS(function*(t){const e=new fj(t),{json:n}=e;if(n.lights){const t=e.addExtension(bj);sL(!t.lights),t.lights=n.lights,delete n.lights}if(e.json.lights){for(const t of e.json.lights)e.addObjectExtension(t.node,bj,t);delete e.json.lights}})).apply(this,arguments)}function jj(t){return Fj.apply(this,arguments)}function Fj(){return(Fj=PS(function*(t){const e=new fj(t),{json:n}=e,i=e.getExtension(vj);if(i){const t=zj(i,e);for(const i of n.materials||[]){const n=e.getObjectExtension(i,vj);n&&(i.technique=Object.assign({},n,t[n.technique]),i.technique.values=Uj(i.technique,e)),e.removeObjectExtension(i,vj)}e.removeExtension(vj)}})).apply(this,arguments)}function Bj(t,e){return Vj.apply(this,arguments)}function Vj(){return(Vj=PS(function*(t,e){})).apply(this,arguments)}function zj(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 Uj(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 Hj={KHR_draco_mesh_compression:i,KHR_materials_unlit:r,KHR_lights_punctual:s,KHR_techniques_webgl:o};function $j(t){return Gj.apply(this,arguments)}function Gj(){return(Gj=PS(function*(t,e={},n){for(const r in Hj){var i;const s=(null==e||null===(i=e.gltf)||void 0===i?void 0:i.excludeExtensions)||{};r in s&&!s[r]||(yield Hj[r].decode(t,e,n))}})).apply(this,arguments)}const Wj={accessors:"accessor",animations:"animation",buffers:"buffer",bufferViews:"bufferView",images:"image",materials:"material",meshes:"mesh",nodes:"node",samplers:"sampler",scenes:"scene",skins:"skin",textures:"texture"},qj={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 Xj{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 fj(t),{json:n}=e;for(const i of n.images||[]){const t=e.removeObjectExtension(i,gj);t&&Object.assign(i,t)}n.buffers&&n.buffers[0]&&delete n.buffers[0].uri,e.removeExtension(gj)}(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 Wj)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 Wj)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=qj[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 Yj(t,e={}){return(new Xj).normalize(t,e)}const Kj={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Qj={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},Zj={TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,REPEAT:10497,LINEAR:9729,NEAREST_MIPMAP_LINEAR:9986},Jj={magFilter:Zj.TEXTURE_MAG_FILTER,minFilter:Zj.TEXTURE_MIN_FILTER,wrapS:Zj.TEXTURE_WRAP_S,wrapT:Zj.TEXTURE_WRAP_T},tF={[Zj.TEXTURE_MAG_FILTER]:Zj.LINEAR,[Zj.TEXTURE_MIN_FILTER]:Zj.NEAREST_MIPMAP_LINEAR,[Zj.TEXTURE_WRAP_S]:Zj.REPEAT,[Zj.TEXTURE_WRAP_]:Zj.REPEAT};class eF{postProcess(t,e={}){const{json:n,buffers:i=[],images:r=[],baseUri:s=""}=t;return sL(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=vt({},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=vt({},t.normalTexture),t.normalTexture.texture=this.getTexture(t.normalTexture.index)),t.occlusionTexture&&(t.occlustionTexture=vt({},t.occlustionTexture),t.occlusionTexture.texture=this.getTexture(t.occlusionTexture.index)),t.emissiveTexture&&(t.emmisiveTexture=vt({},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=vt({},t.pbrMetallicRoughness);const e=t.pbrMetallicRoughness;e.baseColorTexture&&(e.baseColorTexture=vt({},e.baseColorTexture),e.baseColorTexture.texture=this.getTexture(e.baseColorTexture.index)),e.metallicRoughnessTexture&&(e.metallicRoughnessTexture=vt({},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 Qj[t]}(t.componentType),t.components=function(t){return Kj[t]}(t.type),t.bytesPerElement=t.bytesPerComponent*t.components,t.bufferView){const e=t.bufferView.buffer,{ArrayType:n,byteLength:i}=dj(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):tF,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 Jj[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 nF(t,e){return(new eF).postProcess(t,e)}const iF=1735152710,rF=!0;function sF(t,e,n,i){const r=new Uint8Array(e.buffer,n,i),s=new TextDecoder("utf8").decode(r);return t.json=JSON.parse(s),nj(i,4)}function oF(t,e,n,i){return t.header.hasBinChunk=!0,t.binChunks.push({byteOffset:n,byteLength:i,arrayBuffer:e.buffer}),nj(i,4)}function aF(t,e){return lF.apply(this,arguments)}function lF(){return(lF=PS(function*(t,e,n=0,i,r){var s,o,a,l;cF(t,e,n,i),Yj(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 uF(t,i,r)),null!=i&&null!==(a=i.gltf)&&void 0!==a&&a.loadImages){const e=dF(t,i,r);c.push(e)}const u=$j(t,i,r);return c.push(u),yield Promise.all(c),null!=i&&null!==(l=i.gltf)&&void 0!==l&&l.postProcess?nF(t,i):t})).apply(this,arguments)}function cF(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=iF}=n,s=i.getUint32(e,!1);return s===r||s===iF}(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)?rL(t.buffer,t.byteOffset,e):t instanceof ArrayBuffer?rL(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,rF),a=r.getUint32(n+8,rF);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){tP(t.header.byteLength>20);const i=e.getUint32(n+0,rF),r=e.getUint32(n+4,rF);return n+=8,tP(0===r),sF(t,e,n,i),(n+=i)+oF(t,e,n,t.header.byteLength)}(t,r,n);case 2:return function(t,e,n,i){return tP(t.header.byteLength>20),function(t,e,n,i){for(;n+8<=t.header.byteLength;){const r=e.getUint32(n+0,rF),s=e.getUint32(n+4,rF);switch(n+=8,s){case 1313821514:sF(t,e,n,r);break;case 5130562:oF(t,e,n,r);break;case 0:i.strict||sF(t,e,n,r);break;case 1:i.strict||oF(t,e,n,r)}n+=nj(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),sL("glTF"===r.type,`Invalid GLB magic string ${r.type}`),t._glb=r,t.json=r.json}else sL(!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 uF(t,e,n){return hF.apply(this,arguments)}function hF(){return(hF=PS(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 vF(()=>e.some(t=>!t.loaded))})).apply(this,arguments)}function vF(t){return _F.apply(this,arguments)}function _F(){return(_F=PS(function*(t){for(;t();)yield new Promise(t=>requestAnimationFrame(t))})).apply(this,arguments)}const wF=[255,255,255,255],xF={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:wF},_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:[mF]};let SF=(()=>{class t extends eM{getShaders(){const t=[pR,gR];return"pbr"===this.props._lighting&&t.push(vN),{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:wF,transition:!0},instanceModelMatrix:pN})}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 _N)n={scenes:[t.scenegraph]};else if(t.scenegraph&&!t.scenegraph.gltf){const i=t.scenegraph,r=function(t,e,n){const i=new iL(t,n);return{scenes:i.instantiate(e),animator:i.createAnimator()}}(e,i,this._getModelOptions());n=vt({gltf:i},r),function(t){return yF.apply(this,arguments)}(r).then(()=>this.setNeedsRedraw())}else t.scenegraph&&(Gw.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 _N?(this._deleteScenegraph(),this._applyAllAttributes(r),this._applyAnimationsProp(r,s,t._animations),this.setState({scenegraph:r,animator:s})):null!==r&&Gw.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):Gw.warn("animation ".concat(t," not found"))()}})}_deleteScenegraph(){const{scenegraph:t}=this.state;t instanceof _N&&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:vt({isInstanced:!0,transpileToGLSL100:!Zw(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:fN(i,l),sceneModelMatrix:u,u_Camera:n.model.getUniforms().project_uCameraPosition}})})}}return t.layerName="ScenegraphLayer",t.defaultProps=xF,t})();class CF extends bR{constructor(t={}){const{id:e=Zx("sphere-geometry")}=t,{indices:n,attributes:i}=function(t){const{nlat:e=10,nlong:n=10}=t;let{radius:i=1}=t;const r=Math.PI-0,s=2*Math.PI-0,o=(e+1)*(n+1);if("number"==typeof i){const t=i;i=(e,n,i,r,s)=>t}const a=new Float32Array(3*o),l=new Float32Array(3*o),c=new Float32Array(2*o),u=new(o>65535?Uint32Array:Uint16Array)(e*n*6);for(let d=0;d<=e;d++)for(let t=0;t<=n;t++){const o=t/n,u=d/e,h=t+d*(n+1),p=2*h,f=3*h,g=s*o,m=r*u,b=Math.sin(g),y=Math.cos(g),v=Math.sin(m),_=y*v,w=Math.cos(m),x=b*v,S=i(_,w,x,o,u);a[f+0]=S*_,a[f+1]=S*w,a[f+2]=S*x,l[f+0]=_,l[f+1]=w,l[f+2]=x,c[p+0]=o,c[p+1]=1-u}const h=n+1;for(let d=0;ds?(a=i,o=1,t=n):t=e+T/s*(n-e),(-2===T||T===s+2)&&(t=0,o=0),a-=i/2;for(let e=0;es?0:n*g,S[E+w[1]]=T<0?-1:T>s?1:m,S[E+w[2]]=T<0||T>s?0:i*g,C[O+0]=e/r,C[O+1]=o,O+=2,E+=3}}for(let T=0;T0){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 jF){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 jF){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 jF){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 jF){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 jF){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=FF,r=1/n;i.set(this.x*r,this.y*r,this.z*r);const s=BF;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(VF),VF.almostEquals(t,e)}clone(){return new jF(this.x,this.y,this.z)}}jF.ZERO=void 0,jF.UNIT_X=void 0,jF.UNIT_Y=void 0,jF.UNIT_Z=void 0,jF.ZERO=new jF(0,0,0),jF.UNIT_X=new jF(1,0,0),jF.UNIT_Y=new jF(0,1,0),jF.UNIT_Z=new jF(0,0,1);const FF=new jF,BF=new jF,VF=new jF;class zF{constructor(t={}){this.lowerBound=void 0,this.upperBound=void 0,this.lowerBound=new jF,this.upperBound=new jF,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=HF;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=HF;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 UF=new jF,HF=[new jF,new jF,new jF,new jF,new jF,new jF,new jF,new jF];class $F{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 jF){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=GF;t.tangents(e,WF),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(Yr(t.length(),2)*Yr(e.length(),2))+t.dot(e),this.normalize()}return this}mult(t,e=new $F){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 $F){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 $F){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 jF){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 $F(this.x,this.y,this.z,this.w)}slerp(t,e,n=new $F){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 $F){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 GF=new jF,WF=new jF,qF={SPHERE:1,PLANE:2,BOX:4,COMPOUND:8,CONVEXPOLYHEDRON:16,HEIGHTFIELD:32,PARTICLE:64,CYLINDER:128,TRIMESH:256};let XF=(()=>{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=qF,t})();class YF{constructor(t={}){this.position=void 0,this.quaternion=void 0,this.position=new jF,this.quaternion=new $F,t.position&&this.position.copy(t.position),t.quaternion&&this.quaternion.copy(t.quaternion)}pointToLocal(t,e){return YF.pointToLocalFrame(this.position,this.quaternion,t,e)}pointToWorld(t,e){return YF.pointToWorldFrame(this.position,this.quaternion,t,e)}vectorToWorldFrame(t,e=new jF){return this.quaternion.vmult(t,e),e}static pointToLocalFrame(t,e,n,i=new jF){return n.vsub(t,i),e.conjugate(KF),KF.vmult(i,i),i}static pointToWorldFrame(t,e,n,i=new jF){return e.vmult(n,i),i.vadd(t,i),i}static vectorToWorldFrame(t,e,n=new jF){return t.vmult(e,n),n}static vectorToLocalFrame(t,e,n,i=new jF){return e.w*=-1,e.vmult(n,i),e.w*=-1,i}}const KF=new $F;class QF extends XF{constructor(t={}){const{vertices:e=[],faces:n=[],normals:i=[],axes:r,boundingSphereRadius:s}=t;super({type:XF.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 jF;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 jF,c=new jF,u=new jF,h=new jF,d=new jF,p=new jF;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){QF.project(this,t,n,i,ZF),QF.project(e,t,r,s,JF);const o=ZF[0],a=ZF[1],l=JF[0],c=JF[1];if(o0?1/e:0,this.material=t.material||null,this.linearDamping="number"==typeof t.linearDamping?t.linearDamping:.01,this.type=e<=0?sB.STATIC:sB.DYNAMIC,typeof t.type==typeof sB.STATIC&&(this.type=t.type),this.allowSleep=void 0===t.allowSleep||t.allowSleep,this.sleepState=sB.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 jF,this.quaternion=new $F,this.initQuaternion=new $F,this.previousQuaternion=new $F,this.interpolatedQuaternion=new $F,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 jF,t.angularVelocity&&this.angularVelocity.copy(t.angularVelocity),this.initAngularVelocity=new jF,this.shapes=[],this.shapeOffsets=[],this.shapeOrientations=[],this.inertia=new jF,this.invInertia=new jF,this.invInertiaWorld=new NF,this.invMassSolve=0,this.invInertiaSolve=new jF,this.invInertiaWorldSolve=new NF,this.fixedRotation=void 0!==t.fixedRotation&&t.fixedRotation,this.angularDamping=void 0!==t.angularDamping?t.angularDamping:.01,this.linearFactor=new jF(1,1,1),t.linearFactor&&this.linearFactor.copy(t.linearFactor),this.angularFactor=new jF(1,1,1),t.angularFactor&&this.angularFactor.copy(t.angularFactor),this.aabb=new zF,this.aabbNeedsUpdate=!0,this.boundingRadius=0,this.wlambda=new jF,this.isTrigger=Boolean(t.isTrigger),t.shape&&this.addShape(t.shape),this.updateMassProperties()}wakeUp(){const t=this.sleepState;this.sleepState=sB.AWAKE,this.wakeUpAfterNarrowphase=!1,t===sB.SLEEPING&&this.dispatchEvent(sB.wakeupEvent)}sleep(){this.sleepState=sB.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=Yr(this.sleepSpeedLimit,2);e===sB.AWAKE&&ni?this.wakeUp():e===sB.SLEEPY&&t-this.timeLastSleepy>this.sleepTimeLimit&&(this.sleep(),this.dispatchEvent(sB.sleepEvent))}}updateSolveMassProperties(){this.sleepState===sB.SLEEPING||this.type===sB.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 jF){return t.vsub(this.position,e),this.quaternion.conjugate().vmult(e,e),e}vectorToLocalFrame(t,e=new jF){return this.quaternion.conjugate().vmult(t,e),e}pointToWorldFrame(t,e=new jF){return this.quaternion.vmult(t,e),e.vadd(this.position,e),e}vectorToWorldFrame(t,e=new jF){return this.quaternion.vmult(t,e),e}addShape(t,e,n){const i=new jF,r=new $F;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=oB,s=aB,o=this.quaternion,a=this.aabb,l=lB;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=cB,n=uB;t.setRotationFromQuaternion(this.quaternion),t.transpose(n),t.scale(e,t),t.mmult(n,this.invInertiaWorld)}}applyForce(t,e=new jF){if(this.type!==sB.DYNAMIC)return;this.sleepState===sB.SLEEPING&&this.wakeUp();const n=hB;e.cross(t,n),this.force.vadd(t,this.force),this.torque.vadd(n,this.torque)}applyLocalForce(t,e=new jF){if(this.type!==sB.DYNAMIC)return;const n=dB,i=pB;this.vectorToWorldFrame(t,n),this.vectorToWorldFrame(e,i),this.applyForce(n,i)}applyTorque(t){this.type===sB.DYNAMIC&&(this.sleepState===sB.SLEEPING&&this.wakeUp(),this.torque.vadd(t,this.torque))}applyImpulse(t,e=new jF){if(this.type!==sB.DYNAMIC)return;this.sleepState===sB.SLEEPING&&this.wakeUp();const n=e,i=fB;i.copy(t),i.scale(this.invMass,i),this.velocity.vadd(i,this.velocity);const r=gB;n.cross(t,r),this.invInertiaWorld.vmult(r,r),this.angularVelocity.vadd(r,this.angularVelocity)}applyLocalImpulse(t,e=new jF){if(this.type!==sB.DYNAMIC)return;const n=mB,i=bB;this.vectorToWorldFrame(t,n),this.vectorToWorldFrame(e,i),this.applyImpulse(n,i)}updateMassProperties(){const t=yB;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),nB.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 jF;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!==sB.DYNAMIC&&this.type!==sB.KINEMATIC||this.sleepState===sB.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()}}sB.idCounter=0,sB.COLLIDE_EVENT_NAME="collide",sB.DYNAMIC=1,sB.STATIC=2,sB.KINEMATIC=4,sB.AWAKE=0,sB.SLEEPY=1,sB.SLEEPING=2,sB.wakeupEvent={type:"wakeup"},sB.sleepyEvent={type:"sleepy"},sB.sleepEvent={type:"sleep"};const oB=new jF,aB=new $F,lB=new zF,cB=new NF,uB=new NF,hB=new jF,dB=new jF,pB=new jF,fB=new jF,gB=new jF,mB=new jF,bB=new jF,yB=new jF;new jF,new jF;class vB{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 jF,this.rayToWorld=new jF,this.hitNormalWorld=new jF,this.hitPointWorld=new jF,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 _B,wB,xB,SB,CB,EB,OB;_B=XF.types.SPHERE,wB=XF.types.PLANE,xB=XF.types.BOX,SB=XF.types.CYLINDER,CB=XF.types.CONVEXPOLYHEDRON,EB=XF.types.HEIGHTFIELD,OB=XF.types.TRIMESH;class TB{get[_B](){return this._intersectSphere}get[wB](){return this._intersectPlane}get[xB](){return this._intersectBox}get[SB](){return this._intersectConvex}get[CB](){return this._intersectConvex}get[EB](){return this._intersectHeightfield}get[OB](){return this._intersectTrimesh}constructor(t=new jF,e=new jF){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 jF,this.precision=1e-4,this.checkCollisionResponse=!0,this.skipBackfaces=!1,this.collisionFilterMask=-1,this.collisionFilterGroup=-1,this.mode=TB.ANY,this.result=new vB,this.hasHit=!1,this.callback=t=>{}}intersectWorld(t,e){return this.mode=e.mode||TB.ANY,this.result=e.result||new vB,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(kB),PB.length=0,t.broadphase.aabbQuery(t,kB,PB),this.intersectBodies(PB),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=IB,r=DB;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 jF(0,0,1);e.vmult(l,l);const c=new jF;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=$B,a=GB,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,RB,r,i,t)}}}}_intersectTrimesh(t,e,n,i,r,s){const o=WB,a=ZB,l=JB,c=GB,u=qB,h=XB,d=YB,p=QB,f=KB,g=t.indices,m=this.from,b=this.to,y=this.direction;l.position.copy(n),l.quaternion.copy(e),YF.vectorToLocalFrame(n,e,y,u),YF.pointToLocalFrame(n,e,m,h),YF.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],NB),NB.vsub(h,c);const l=u.dot(o),d=o.dot(c)/l;if(d<0)continue;u.scale(d,RB),RB.vadd(h,RB),t.getVertex(g[3*s+1],LB),t.getVertex(g[3*s+2],jB);const m=RB.distanceSquared(h);!TB.pointInTriangle(RB,LB,NB,jB)&&!TB.pointInTriangle(RB,NB,LB,jB)||m>v||(YF.vectorToWorldFrame(e,o,f),YF.pointToWorldFrame(n,e,RB,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 TB.ALL:this.hasHit=!0,l.set(s,o,t,e,n,i,a),l.hasHit=!0,this.callback(l);break;case TB.CLOSEST:(a=0&&(u=r*l-s*o)>=0&&c+uDate.now()-t}var PV=n(24517);function AV(t,e,n){e||(e=new VT(VT.IDENTITY));const i=new VT(VT.IDENTITY);if(!t)return!0;if(t.matrix)i.copy(t.matrix);else{if(i.identity(),t.translation&&i.translate(t.translation),t.rotation){const e=new VT(VT.IDENTITY).fromQuaternion(t.rotation);i.multiplyRight(e)}t.scale&&i.scale(t.scale)}const r=new VT(e).multiplyRight(i);if(!1===n(t,r,e))return!1;for(const s of t.nodes||t.children||[])if(!1===AV(s,r,n))return!1;return!0}function MV(){DA([lL,mF])}function IV(t,e){var n;const i=null===(n=e.nodes)||void 0===n?void 0:n.find(e=>e.name===t);if(i){let n=!1;for(const t of e.scenes)n||AV(t,new VT(VT.IDENTITY),(t,e)=>t!==i||(t.matrix=e,t.translation=void 0,t.rotation=void 0,t.scale=void 0,n=!0,!1));return e.scene={id:t,name:t,nodes:[i]},e.scenes=[e.scene],{scene:e.scene,scenes:e.scenes}}return e}function DV(t,e){return xw(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 $A(i,mF,{DracoLoader:tj,gltf:{decompressMeshes:!0,postProcess:!0}});return r.nodes||console.log("WARNING: Empty Scene",n,r),IV(t.scenegraphNode,r)})}function RV(t,e){return xw(this,void 0,void 0,function*(){return IV(t,yield e)})}function NV(t,e,n){if(e&&0!==e.length){let i;switch(n.geometry){case"sphere":i=new CF;break;case"cone":i=new TF;break;case"cylinder":i=new kF;break;case"cube":default:i=new RF}return new yN(Object.assign({id:t,pickable:!0,autoHighlight:!1,highlightColor:[30,136,229,255],coordinateSystem:Ww.CARTESIAN,data:e,mesh:i,wireframe:!1,getTransformMatrix:t=>t.transformMatrix,getColor:t=>t.color||[255,255,255,229.5]},n))}}function LV(t,e,n){if(e&&0!==e.length)return new eN(Object.assign({id:t,pickable:!0,data:e.map(t=>Object.assign(Object.assign({},t),{position:new VT(t.transformMatrix).getTranslation()})),getText:t=>t.text,getPosition:t=>t.position,getColor:t=>t.color},n))}let jV=(()=>{class t extends nM{initializeState(){const{data:t}=this.props;this.setState({data:null!=t?t:[],zoomOpacity:.8,doCollisions:!1}),MV()}renderLayers(){var e,n;const i=this.state,r={sphere:[],cone:[],cylinder:[],cube:[],text:[],wireframe:[],scenegraph:[]};for(const t of i.data){const n=null!==(e=t.geometry)&&void 0!==e?e:"cube";t.scenegraph?r.scenegraph.push(t):void 0!==r[n]&&r[n].push(t)}const s={};for(const a of r.scenegraph)a.scenegraph&&a.scenegraphNode&&!Object.prototype.hasOwnProperty.call(s,a.scenegraph)&&(s[a.scenegraph]=DV({scenegraph:a.scenegraph},t.gltfCache));const o=[];for(const[t,a]of Object.entries(r))if("scenegraph"===t)for(const e of a)o.push(new SF({id:"models-"+e["@id"],opacity:e.zoomBasedOpacity?i.zoomOpacity:void 0!==e.opacity?e.opacity:1,pickable:!e.unpickable,coordinateSystem:Ww.CARTESIAN,data:[e],scenegraph:e.scenegraphNode?RV(e.scenegraphNode,s[e.scenegraph]):e.scenegraph,_lighting:e._lighting,getTransformMatrix:e.transformMatrix,getColor:null!==(n=e.color)&&void 0!==n?n:[0,255,0,127.5],parameters:{depthMask:!e.zoomBasedOpacity&&(void 0===e.opacity||1===e.opacity)}}));else"text"===t?(o.push(LV("text",a.filter(t=>t.unpickable),{pickable:!1})),o.push(LV("textPickable",a.filter(t=>!t.unpickable),{pickable:!0}))):"wireframe"===t?o.push(NV(t,a,{wireframe:!0,pickable:!1,geometry:t})):(o.push(NV(t,a.filter(t=>t.unpickable),{wireframe:!1,pickable:!1,geometry:t})),o.push(NV(`${t}Pickable`,a.filter(t=>!t.unpickable),{wireframe:!1,pickable:!0,geometry:t})));return i.doCollisions&&function(t){xw(this,void 0,void 0,function*(){console.log("Starting Collisioning");const e=t.filter(t=>!t.scenegraph&&"wireframe"!==t.geometry).map(t=>{const e=new VT(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 zF({lowerBound:new jF(...n.map((t,e)=>Math.min(t,i[e]))),upperBound:new jF(...i.map((t,e)=>Math.max(t,n[e])))})}}),n=[];for(const o of t.filter(t=>!!t.scenegraph)){const t=yield XA(o.scenegraph,mF,{DracoLoader:tj,decompress:!0,postProcess:!0});for(const e of t.scenes)AV(e,new VT(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 zF({lowerBound:new jF(...s.map((t,e)=>Math.min(t,a[e]))),upperBound:new jF(...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})}(i.data),o.filter(t=>!!t)}getPickingInfo(t){return t.info}}return t.layerName="BodyUILayer",t.gltfCache={},t})();function FV(t,e=[]){for(const n of t.nodes||t.children||[])e.push(n.name),FV(n,e);return e}let BV=(()=>{class t{constructor(t){var e,n,i,r,s;this.deckProps=t,this.bodyUILayer=new jV({}),this.nodeClickSubject=new A,this.nodeHoverStartSubject=new A,this.nodeHoverStopSubject=new A,this.sceneRotationSubject=new Jf([0,0]),this.nodeDragStartSubject=new A,this.nodeDragSubject=new A,this.nodeDragEndSubject=new A,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 IM({flipY:!1,near:-1e3}):new LM({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 cI({ambientLight:new VM({color:[255,255,255],intensity:10})})]),this.deck=new dR(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 xw(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 VT([.076,0,0,0,0,.076,16875389974302382e-33,0,0,-16875389974302382e-33,.076,0,.49,.034,.11,1]);(function(t,e,n){return xw(this,void 0,void 0,function*(){MV();const n=yield DV({scenegraph:t,scenegraphNode:"VHF_Kidney_L_Low1"}),i={},r=[];for(const s of n.scenes)AV(s,e=new VT(e||VT.IDENTITY),(n,s)=>{const o={"@id":n.name||n.id,"@type":"ProcessedNode",transformMatrix:new VT(s),geometry:"wireframe",node:n};if(r.push({"@id":`GLTF:${o["@id"]}`,"@type":"GLTFNode",scenegraph:t,scenegraphNode:o["@id"],transformMatrix:new VT(e||VT.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 zF({lowerBound:new jF(...e.map((t,e)=>Math.min(t,n[e]))),upperBound:new jF(...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 FV(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 jF(.5,.5,.5)),i=t.center=e.clone().vadd(n);t.transformMatrix=new VT(VT.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 VT(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 vw([PV.ZP],t.prototype,"_onHover",null),vw([PV.ZP],t.prototype,"_onClick",null),vw([PV.ZP],t.prototype,"_onViewStateChange",null),vw([PV.ZP],t.prototype,"_onDragStart",null),vw([PV.ZP],t.prototype,"_onDrag",null),vw([PV.ZP],t.prototype,"_onDragEnd",null),t})();function VV(t,e){return t===e}function zV(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 $V=(()=>{class t{constructor(){this.bootstrap$=new _p(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 GV=new oi("INITIAL_STATE_TOKEN");let WV=(()=>{class t{static set(t){this.value=t}static pop(){const t=this.value;return this.value={},t}}return t.value={},t})();const qV=new oi("Internals.StateContextFactory"),XV=new oi("Internals.StateFactory");function YV(t,e){return e?n=>n.pipe(YV((n,i)=>U(t(n,i)).pipe(D((t,r)=>e(n,t,i,r))))):e=>e.lift(new KV(t))}class KV{constructor(t){this.project=t}call(t,e){return e.subscribe(new QV(t,this.project))}}class QV 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 ZV(t=null){return e=>e.lift(new JV(t))}class JV{constructor(t){this.defaultValue=t}call(t,e){return e.subscribe(new tz(t,this.defaultValue))}}class tz 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 ez={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 nz=(()=>{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 Tu.isInAngularZone()?t():this._ngZone.run(t)}runOutsideAngular(t){return Tu.isInAngularZone()?this._ngZone.runOutsideAngular(t):t()}verifyZoneIsNotNooped(t){t instanceof Tu||console.warn(ez.ZONE_WARNING())}}return t.\u0275fac=function(e){return new(e||t)(Ei(Tu),Ei(hu))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();const iz=new oi("ROOT_STATE_TOKEN"),rz=new oi("FEATURE_STATE_TOKEN"),sz=new oi("NGXS_PLUGINS"),oz=new oi("NG_TEST_MODE"),az=new oi("NG_DEV_MODE"),lz="NGXS_META",cz="NGXS_OPTIONS_META",uz="NGXS_SELECTOR_META";let hz=(()=>{class t{constructor(){this.defaultsState={},this.selectorOptions={injectContainerState:!0,suppressErrors:!0},this.compatibility={strictContentSecurityPolicy:!1},this.executionStrategy=nz}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();class dz{constructor(t,e,n){this.previousValue=t,this.currentValue=e,this.firstChange=n}}const pz=new oi("NGXS_EXECUTION_STRATEGY");function fz(t){return t.constructor&&t.constructor.type?t.constructor.type:t.type}const gz=(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},mz=(t,e)=>e.split(".").reduce((t,e)=>t&&t[e],t),bz=t=>t&&"object"==typeof t&&!Array.isArray(t),yz=(t,...e)=>{if(!e.length)return t;const n=e.shift();if(bz(t)&&bz(n))for(const i in n)bz(n[i])?(t[i]||Object.assign(t,{[i]:{}}),yz(t[i],n[i])):Object.assign(t,{[i]:n[i]});return yz(t,...e)};function vz(t){if(!t.hasOwnProperty(lz)){const e={name:null,actions:{},defaults:{},path:null,makeRootSelector:t=>t.getStateGetter(e.name),children:[]};Object.defineProperty(t,lz,{value:e})}return _z(t)}function _z(t){return t[lz]}function wz(t){return t[uz]}function xz(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(t[fz(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 ep(n=>{const i=fz(n.action);return t[i]&&(!e||e[n.status])})}(i,r),n())}}(t,["DISPATCHED"])}function Ez(){return D(t=>t.action)}function Oz(t){return e=>new E(n=>e.subscribe({next(e){t.leave(()=>n.next(e))},error(e){t.leave(()=>n.error(e))},complete(){t.leave(()=>n.complete())}}))}let Tz=(()=>{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)(Ei(pz))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();class kz extends A{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 Pz=(()=>{class t extends kz{}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})(),Az=(()=>{class t extends E{constructor(t,e){super(n=>{const i=t.pipe(Oz(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)(Ei(Pz),Ei(Tz))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();const Mz=t=>(...e)=>t.shift()(...e,(...e)=>Mz(t)(...e));let Iz=(()=>{class t extends Jf{constructor(){super({})}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),Dz=(()=>{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)(Ei(t,12),Ei(sz,8))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),Rz=(()=>{class t extends A{}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})(),Nz=(()=>{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(Oz(this._ngxsExecutionStrategy))}dispatchByEvents(t){return Array.isArray(t)?0===t.length?Dd(this._stateStream.getValue()):Ev(t.map(t=>this.dispatchSingle(t))):this.dispatchSingle(t)}dispatchSingle(t){if(!fz(t))return gp(new Error(`This action doesn't have a type property: ${t.constructor.name}`));const e=this._stateStream.getValue();return Mz([...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(xp())}getActionResultStream(t){return this._actionResults.pipe(ep(e=>e.action===t&&"DISPATCHED"!==e.status),rf(1),xp())}createDispatchObservable(t){return t.pipe(YV(t=>{switch(t.status){case"SUCCESSFUL":return Dd(this._stateStream.getValue());case"ERRORED":return gp(t.error);default:return pp}})).pipe(xp())}}return t.\u0275fac=function(e){return new(e||t)(Ei(No),Ei(Pz),Ei(Rz),Ei(Dz),Ei(Iz),Ei(Tz))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();const Lz=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])&&Lz(t[i])}),t};let jz=(()=>{class t{constructor(t,e){this.isDevMode=t,this.isTestMode=e}}return t.\u0275fac=function(e){return new(e||t)(Ei(az),Ei(oz))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),Fz=(()=>{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(ez.INCORRECT_PRODUCTION()):this.isIncorrectDevelopment&&console.warn(ez.INCORRECT_DEVELOPMENT()))}}return t.\u0275fac=function(e){return new(e||t)(Ei(jz),Ei(hz))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),Bz=(()=>{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=Lz(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)(Ei(Iz),Ei(Nz),Ei(hz),Ei(Fz))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),Vz=(()=>{class t{constructor(t){this._internalStateOperations=t}createStateContext(t){const e=this._internalStateOperations.getRootStateOperations();function n(e){return mz(e,t.path)}function i(n,i){const r=gz(n,t.path,i),s=t.instance;if(s.ngxsOnChanges){const e=Sz(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(ez.PATCHING_ARRAY());if("object"!=typeof t)throw new Error(ez.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)(Ei(Bz))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();class zz{static stateNameErrorMessage(t){return ez.STATE_NAME(t)}static checkCorrectStateName(t){if(!t)throw new Error(ez.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(ez.STATE_UNIQUE(n,t.name,i.name));return n}static getValidStateMeta(t){const e=_z(t);if(!e)throw new Error(ez.STATE_DECORATOR());return e}}zz.stateNameRegex=new RegExp("^[a-zA-Z0-9_]+$");let Uz=(()=>{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=UV(()=>{const t=this;function e(e){const n=t.statePaths[e];return n?xz(n.split("."),t._config):null}return this._parentFactory?this._parentFactory.getRuntimeSelectorContext():{getStateGetter(t){let n=e(t);return n||((...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(zz.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[lz].name};return t.reduce((t,n)=>{const{name:i,children:r}=n[lz];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[lz].name]=e,t),{})}(n),a=[];for(const l of r){const e=o[l],n=s[l],i=e[lz];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)=>gz(t,e.path,e.defaults),{}),states:e}}connectActionHandlers(){null===this._actionsSubscription&&(this._actionsSubscription=this._actions.pipe(ep(t=>"DISPATCHED"===t.status),W(({action:t})=>this.invokeActions(this._actions,t).pipe(D(()=>({action:t,status:"SUCCESSFUL"})),ZV({action:t,status:"CANCELED"}),Tv(e=>Dd({action:t,status:"ERRORED",error:e}))))).subscribe(t=>this._actionResults.next(t)))}invokeActions(t,e){const n=fz(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 E?(r=r.pipe(ZV({})),n.options.cancelUncompleted&&(r=r.pipe(rp(t.pipe(Cz(e)))))):r=Dd({}).pipe(xp()),i.push(r)}catch(r){i.push(gp(r))}}}return i.length||i.push(Dd({})),Ev(i)}addToStatesMap(t){const e=[],n=this.statesByName;for(const i of t){const t=zz.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!==mz(this._initialState,e);return this.statesByName[t]&&n}}return t.\u0275fac=function(e){return new(e||t)(Ei(No),Ei(hz),Ei(t,12),Ei(Pz),Ei(Rz),Ei(Vz),Ei(GV,8))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),Hz=(()=>{class t{constructor(t,e,n){this.internalStateOperations=t,this.stateContextFactory=e,this.bootstrapper=n}ngxsBootstrap(t,e){this.internalStateOperations.getRootStateOperations().dispatch(t).pipe(ep(()=>!!e),eg(()=>this.invokeInit(e.states)),W(()=>this.bootstrapper.appBootstrapped$),ep(t=>!!t)).subscribe(()=>this.invokeBootstrap(e.states))}invokeInit(t){for(const e of t){const t=e.instance;if(t.ngxsOnChanges){const n=Sz(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)(Ei(Bz),Ei(Vz),Ei($V))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();const $z=t=>t&&t.NGXS_SELECTOR_OPTIONS_META||{};function Gz(t,e,n){const i=n&&n.containerClass,r=UV(function(...t){const n=e.apply(i,t);return n instanceof Function?UV.apply(null,[n]):n});Object.setPrototypeOf(r,e);const s=function(t,e){const n=function(t){return t.hasOwnProperty(uz)||Object.defineProperty(t,uz,{value:{makeRootSelector:null,originalFn:null,containerClass:null,selectorName:null,getSelectorOptions:()=>({})}}),wz(t)}(t);n.originalFn=t;let i=()=>({});e&&(n.containerClass=e.containerClass,n.selectorName=e.selectorName,i=e.getSelectorOptions||i);const r=Object.assign({},n);return n.getSelectorOptions=()=>function(t,e){return Object.assign({},$z(t.containerClass)||{},$z(t.originalFn)||{},t.getSelectorOptions()||{},e)}(r,i()),n}(e,n);return s.makeRootSelector=e=>{const{argumentSelectorFunctions:n,selectorOptions:i}=function(t,e,n=[]){const i=e.getSelectorOptions(),r=t.getSelectorOptions(i);return{selectorOptions:r,argumentSelectorFunctions:function(t=[],e,n){const i=[];return n&&(0===t.length||e.injectContainerState)&&_z(n)&&i.push(n),t&&i.push(...t),i}(n,r,e.containerClass).map(e=>Wz(e)(t))}}(e,s,t);return function(t){const e=n.map(e=>e(t));try{return r(...e)}catch(s){if(s instanceof TypeError&&i.suppressErrors)return;throw s}}},r}function Wz(t){const e=wz(t)||_z(t);return e&&e.makeRootSelector||(()=>t)}let qz=(()=>{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),Tv(t=>{const{suppressErrors:e}=this._config.selectorOptions;return t instanceof TypeError&&e?Dd(void 0):gp(t)}),Wd(),Oz(this._internalExecutionStrategy))}selectOnce(t){return this.select(t).pipe(rf(1))}selectSnapshot(t){return this.getStoreBoundSelectorFn(t)(this._stateStream.getValue())}subscribe(t){return this._stateStream.pipe(Oz(this._internalExecutionStrategy)).subscribe(t)}snapshot(){return this._internalStateOperations.getRootStateOperations().getState()}reset(t){return this._internalStateOperations.getRootStateOperations().setState(t)}getStoreBoundSelectorFn(t){return Wz(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)(Ei(Iz),Ei(Bz),Ei(hz),Ei(Tz),Ei(Uz),Ei(GV,8))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),Xz=(()=>{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)(Ei(qz),Ei(hz))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t.store=null,t.config=null,t})();class Yz{static get type(){return"@@INIT"}}class Kz{constructor(t){this.addedStates=t}static get type(){return"@@UPDATE_STATE"}}const Qz=new _p(1);let Zz=(()=>{class t{constructor(e,n,i,r,s=[],o){!function(){try{const t=window.ng,e=!(t.probe&&t.coreTokens)&&Vu();Qz.next(e)}catch(t){Qz.next(!1)}finally{Qz.complete()}}();const a=e.addAndReturnDefaults(s);n.setStateToTheCurrentWithNew(a),e.connectActionHandlers(),o.ngxsBootstrap(new Yz,a)}}return t.\u0275fac=function(e){return new(e||t)(Ei(Uz),Ei(Bz),Ei(qz),Ei(Xz),Ei(iz,8),Ei(Hz))},t.\u0275mod=ie({type:t}),t.\u0275inj=St({}),t})(),Jz=(()=>{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 Kz(a.defaults),a))}static flattenStates(t=[]){return t.reduce((t,e)=>t.concat(e),[])}}return t.\u0275fac=function(e){return new(e||t)(Ei(qz),Ei(Bz),Ei(Uz),Ei(rz,8),Ei(Hz))},t.\u0275mod=ie({type:t}),t.\u0275inj=St({}),t})();class tU{static forRoot(t=[],e={}){return{ngModule:Zz,providers:[Uz,Vz,Az,Pz,$V,Fz,jz,Hz,Nz,Rz,Bz,Tz,qz,Iz,Xz,Dz,...t,...tU.ngxsTokenProviders(t,e)]}}static forFeature(t=[]){return{ngModule:Jz,providers:[Uz,Dz,...t,{provide:rz,multi:!0,useValue:t}]}}static ngxsTokenProviders(t,e){return[{provide:oz,useValue:HV},{provide:az,useValue:Vu},{provide:pz,useClass:e.executionStrategy||nz},{provide:iz,useValue:t},{provide:tU.ROOT_OPTIONS,useValue:e},{provide:hz,useFactory:tU.ngxsConfigFactory,deps:[tU.ROOT_OPTIONS]},{provide:du,useFactory:tU.appBootstrapListenerFactory,multi:!0,deps:[$V]},{provide:GV,useFactory:tU.getInitialState},{provide:qV,useExisting:Vz},{provide:XV,useExisting:Uz}]}static ngxsConfigFactory(t){return yz(new hz,t)}static appBootstrapListenerFactory(t){return()=>t.bootstrap()}static getInitialState(){return WV.pop()}}function eU(t,e){return(n,i)=>{if(n.hasOwnProperty("prototype"))throw new Error(ez.ACTION_DECORATOR());const r=vz(n.constructor);Array.isArray(t)||(t=[t]);for(const s of t){const t=s.type;r.actions[t]||(r.actions[t]=[]),r.actions[t].push({fn:i,options:e||{},type:t})}}}function nU(t){return e=>{!function(t){Qz.subscribe(e=>{e&&(t.\u0275prov||console.warn(ez.UNDECORATED_STATE_IN_IVY(t.name)))})}(e);const n=e,i=vz(n),r=Object.getPrototypeOf(n),s=function(e){return Object.assign({},e[cz]||{},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;zz.checkCorrectStateName(a),n.hasOwnProperty(lz)&&(e.actions=Object.assign({},e.actions,(n[lz]||{}).actions)),e.children=r,e.defaults=s,e.name=a})({meta:i,inheritedStateClass:r,optionsWithInheritance:s}),n[cz]=s}}function iU(t,...e){return function(n,i){const r=i.toString(),s=`__${r}__selector`,o=function(t,e,n=[]){return"string"==typeof(e=e||function(t){const e=t.length-1;return 36===t.charCodeAt(e)?t.slice(0,e):t}(t))?xz(n.length?[e,...n]:e.split("."),Xz.config):e}(r,t,e);Object.defineProperties(n,{[s]:{writable:!0,enumerable:!1,configurable:!0},[r]:{enumerable:!0,configurable:!0,get(){return this[s]||(this[s]=function(t){if(!Xz.store)throw new Error(ez.SELECT_FACTORY_NOT_CONNECTED());return Xz.store.select(t)}(o))}}})}}function rU(t){return(e,n,i)=>{if(!i||null===i.value)throw new Error(ez.SELECTOR_DECORATOR());const r=i.value,s=Gz(t,r,{containerClass:e,selectorName:n.toString(),getSelectorOptions:()=>({})}),o={configurable:!0,get:()=>s};return o.originalFn=r,o}}tU.\u0275fac=function(t){return new(t||tU)},tU.\u0275mod=ie({type:tU}),tU.\u0275inj=St({}),tU.ROOT_OPTIONS=new oi("ROOT_OPTIONS");let sU=(()=>{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(Dl),ea(Al))},t.\u0275dir=se({type:t}),t})(),oU=(()=>{class t extends sU{}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 aU=new oi("NgValueAccessor"),lU={provide:aU,useExisting:pt(()=>uU),multi:!0},cU=new oi("CompositionEventMode");let uU=(()=>{class t extends sU{constructor(t,e,n){super(t,e),this._compositionMode=n,this._composing=!1,null==this._compositionMode&&(this._compositionMode=!function(){const t=Ju()?Ju().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(Dl),ea(Al),ea(cU,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:[xl([lU]),jo]}),t})();const hU=new oi("NgValidators"),dU=new oi("NgAsyncValidators");function pU(t){return null!=t}function fU(t){const e=ha(t)?U(t):t;return pa(e),e}function gU(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 mU(t,e){return e.map(e=>e(t))}function bU(t){return t.map(t=>function(t){return!t.validate}(t)?t:e=>t.validate(e))}function yU(t){return null!=t?function(t){if(!t)return null;const e=t.filter(pU);return 0==e.length?null:function(t){return gU(mU(t,e))}}(bU(t)):null}function vU(t){return null!=t?function(t){if(!t)return null;const e=t.filter(pU);return 0==e.length?null:function(t){return Ev(mU(t,e).map(fU)).pipe(D(gU))}}(bU(t)):null}function _U(t,e){return null===t?[e]:Array.isArray(t)?[...t,e]:[t,e]}function wU(t){return t._rawValidators}function xU(t){return t._rawAsyncValidators}function SU(t){return t?Array.isArray(t)?t:[t]:[]}function CU(t,e){return Array.isArray(t)?t.includes(e):t===e}function EU(t,e){const n=SU(e);return SU(t).forEach(t=>{CU(n,t)||n.push(t)}),n}function OU(t,e){return SU(e).filter(e=>!CU(t,e))}let TU=(()=>{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=yU(this._rawValidators)}_setAsyncValidators(t){this._rawAsyncValidators=t||[],this._composedAsyncValidatorFn=vU(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})(),kU=(()=>{class t extends TU{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 PU extends TU{constructor(){super(...arguments),this._parent=null,this.name=null,this.valueAccessor=null}}class AU{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 MU=(()=>{class t extends AU{constructor(t){super(t)}}return t.\u0275fac=function(e){return new(e||t)(ea(PU,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})(),IU=(()=>{class t extends AU{constructor(t){super(t)}}return t.\u0275fac=function(e){return new(e||t)(ea(kU,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 DU(t,e){LU(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&&FU(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&&FU(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 RU(t,e,n=!0){const i=()=>{};e.valueAccessor&&(e.valueAccessor.registerOnChange(i),e.valueAccessor.registerOnTouched(i)),jU(t,e),t&&(e._invokeOnDestroyCallbacks(),t._registerOnCollectionChange(()=>{}))}function NU(t,e){t.forEach(t=>{t.registerOnValidatorChange&&t.registerOnValidatorChange(e)})}function LU(t,e){const n=wU(t);null!==e.validator?t.setValidators(_U(n,e.validator)):"function"==typeof n&&t.setValidators([n]);const i=xU(t);null!==e.asyncValidator?t.setAsyncValidators(_U(i,e.asyncValidator)):"function"==typeof i&&t.setAsyncValidators([i]);const r=()=>t.updateValueAndValidity();NU(e._rawValidators,r),NU(e._rawAsyncValidators,r)}function jU(t,e){let n=!1;if(null!==t){if(null!==e.validator){const i=wU(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=xU(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 NU(e._rawValidators,i),NU(e._rawAsyncValidators,i),n}function FU(t,e){t._pendingDirty&&t.markAsDirty(),t.setValue(t._pendingValue,{emitModelToViewChange:!1}),e.viewToModelUpdate(t._pendingValue),t._pendingChange=!1}function BU(t,e){LU(t,e)}function VU(t,e){if(!t.hasOwnProperty("model"))return!1;const n=t.model;return!!n.isFirstChange()||!Object.is(e,n.currentValue)}function zU(t,e){t._syncPendingControls(),e.forEach(t=>{const e=t.control;"submit"===e.updateOn&&e._pendingChange&&(t.viewToModelUpdate(e._pendingValue),e._pendingChange=!1)})}function UU(t,e){if(!e)return null;let n,i,r;return Array.isArray(e),e.forEach(t=>{t.constructor===uU?n=t:function(t){return Object.getPrototypeOf(t.constructor)===oU}(t)?i=t:r=t}),r||i||n||null}function HU(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const $U="VALID",GU="INVALID",WU="PENDING",qU="DISABLED";function XU(t){return(ZU(t)?t.validators:t)||null}function YU(t){return Array.isArray(t)?yU(t):t||null}function KU(t,e){return(ZU(e)?e.asyncValidators:t)||null}function QU(t){return Array.isArray(t)?vU(t):t||null}function ZU(t){return null!=t&&!Array.isArray(t)&&"object"==typeof t}class JU{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=YU(this._rawValidators),this._composedAsyncValidatorFn=QU(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===$U}get invalid(){return this.status===GU}get pending(){return this.status==WU}get disabled(){return this.status===qU}get enabled(){return this.status!==qU}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=YU(t)}setAsyncValidators(t){this._rawAsyncValidators=t,this._composedAsyncValidatorFn=QU(t)}addValidators(t){this.setValidators(EU(t,this._rawValidators))}addAsyncValidators(t){this.setAsyncValidators(EU(t,this._rawAsyncValidators))}removeValidators(t){this.setValidators(OU(t,this._rawValidators))}removeAsyncValidators(t){this.setAsyncValidators(OU(t,this._rawAsyncValidators))}hasValidator(t){return CU(this._rawValidators,t)}hasAsyncValidator(t){return CU(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=WU,!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=qU,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=$U,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===$U||this.status===WU)&&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()?qU:$U}_runValidator(){return this.validator?this.validator(this):null}_runAsyncValidator(t){if(this.asyncValidator){this.status=WU,this._hasOwnPendingAsyncValidator=!0;const e=fU(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 eH?i.controls.hasOwnProperty(t)?i.controls[t]:null:i instanceof nH&&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 Bc,this.statusChanges=new Bc}_calculateStatus(){return this._allControlsDisabled()?qU:this.errors?GU:this._hasOwnPendingAsyncValidator||this._anyControlsHaveStatus(WU)?WU:this._anyControlsHaveStatus(GU)?GU:$U}_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){ZU(t)&&null!=t.updateOn&&(this._updateOn=t.updateOn)}_parentMarkedDirty(t){return!t&&!(!this._parent||!this._parent.dirty)&&!this._parent._anyControlsDirty()}}class tH extends JU{constructor(t=null,e,n){super(XU(e),KU(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){HU(this._onChange,t)}registerOnDisabledChange(t){this._onDisabledChange.push(t)}_unregisterOnDisabledChange(t){HU(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 eH extends JU{constructor(t,e,n){super(XU(e),KU(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 tH?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 nH extends JU{constructor(t,e,n){super(XU(e),KU(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 tH?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 iH={provide:kU,useExisting:pt(()=>sH)},rH=(()=>Promise.resolve(null))();let sH=(()=>{class t extends kU{constructor(t,e){super(),this.submitted=!1,this._directives=[],this.ngSubmit=new Bc,this.form=new eH({},yU(t),vU(e))}ngAfterViewInit(){this._setUpdateStrategy()}get formDirective(){return this}get control(){return this.form}get path(){return[]}get controls(){return this.form.controls}addControl(t){rH.then(()=>{const e=this._findContainer(t.path);t.control=e.registerControl(t.name,t.control),DU(t.control,t),t.control.updateValueAndValidity({emitEvent:!1}),this._directives.push(t)})}getControl(t){return this.form.get(t.path)}removeControl(t){rH.then(()=>{const e=this._findContainer(t.path);e&&e.removeControl(t.name),HU(this._directives,t)})}addFormGroup(t){rH.then(()=>{const e=this._findContainer(t.path),n=new eH({});BU(n,t),e.registerControl(t.name,n),n.updateValueAndValidity({emitEvent:!1})})}removeFormGroup(t){rH.then(()=>{const e=this._findContainer(t.path);e&&e.removeControl(t.name)})}getFormGroup(t){return this.form.get(t.path)}updateModel(t,e){rH.then(()=>{this.form.get(t.path).setValue(e)})}setValue(t){this.control.setValue(t)}onSubmit(t){return this.submitted=!0,zU(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(hU,10),ea(dU,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:[xl([iH]),jo]}),t})();const oH={provide:PU,useExisting:pt(()=>lH)},aH=(()=>Promise.resolve(null))();let lH=(()=>{class t extends PU{constructor(t,e,n,i){super(),this.control=new tH,this._registered=!1,this.update=new Bc,this._parent=t,this._setValidators(e),this._setAsyncValidators(n),this.valueAccessor=UU(0,i)}ngOnChanges(t){this._checkForErrors(),this._registered||this._setUpControl(),"isDisabled"in t&&this._updateDisabled(t),VU(t,this.viewModel)&&(this._updateValue(this.model),this.viewModel=this.model)}ngOnDestroy(){this.formDirective&&this.formDirective.removeControl(this)}get path(){return this._parent?function(t,e){return[...e.path,t]}(this.name,this._parent):[this.name]}get formDirective(){return this._parent?this._parent.formDirective:null}viewToModelUpdate(t){this.viewModel=t,this.update.emit(t)}_setUpControl(){this._setUpdateStrategy(),this._isStandalone()?this._setUpStandalone():this.formDirective.addControl(this),this._registered=!0}_setUpdateStrategy(){this.options&&null!=this.options.updateOn&&(this.control._updateOn=this.options.updateOn)}_isStandalone(){return!this._parent||!(!this.options||!this.options.standalone)}_setUpStandalone(){DU(this.control,this),this.control.updateValueAndValidity({emitEvent:!1})}_checkForErrors(){this._isStandalone()||this._checkParentType(),this._checkName()}_checkParentType(){}_checkName(){this.options&&this.options.name&&(this.name=this.options.name),this._isStandalone()}_updateValue(t){aH.then(()=>{this.control.setValue(t,{emitViewToModelChange:!1})})}_updateDisabled(t){const e=t.isDisabled.currentValue,n=""===e||e&&"false"!==e;aH.then(()=>{n&&!this.control.disabled?this.control.disable():!n&&this.control.disabled&&this.control.enable()})}}return t.\u0275fac=function(e){return new(e||t)(ea(kU,9),ea(hU,10),ea(dU,10),ea(aU,10))},t.\u0275dir=se({type:t,selectors:[["","ngModel","",3,"formControlName","",3,"formControl",""]],inputs:{name:"name",isDisabled:["disabled","isDisabled"],model:["ngModel","model"],options:["ngModelOptions","options"]},outputs:{update:"ngModelChange"},exportAs:["ngModel"],features:[xl([oH]),jo,ye]}),t})(),cH=(()=>{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})(),uH=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({}),t})();const hH=new oi("NgModelWithFormControlWarning"),dH={provide:PU,useExisting:pt(()=>pH)};let pH=(()=>{class t extends PU{constructor(t,e,n,i){super(),this._ngModelWarningConfig=i,this.update=new Bc,this._ngModelWarningSent=!1,this._setValidators(t),this._setAsyncValidators(e),this.valueAccessor=UU(0,n)}set isDisabled(t){}ngOnChanges(t){if(this._isControlChanged(t)){const e=t.form.previousValue;e&&RU(e,this,!1),DU(this.form,this),this.control.disabled&&this.valueAccessor.setDisabledState&&this.valueAccessor.setDisabledState(!0),this.form.updateValueAndValidity({emitEvent:!1})}VU(t,this.viewModel)&&(this.form.setValue(this.model),this.viewModel=this.model)}ngOnDestroy(){this.form&&RU(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(hU,10),ea(dU,10),ea(aU,10),ea(hH,8))},t.\u0275dir=se({type:t,selectors:[["","formControl",""]],inputs:{isDisabled:["disabled","isDisabled"],form:["formControl","form"],model:["ngModel","model"]},outputs:{update:"ngModelChange"},exportAs:["ngForm"],features:[xl([dH]),jo,ye]}),t._ngModelWarningSentOnce=!1,t})();const fH={provide:kU,useExisting:pt(()=>gH)};let gH=(()=>{class t extends kU{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 Bc,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&&(jU(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 DU(e,t),e.updateValueAndValidity({emitEvent:!1}),this.directives.push(t),e}getControl(t){return this.form.get(t.path)}removeControl(t){RU(t.control||null,t,!1),HU(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,zU(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&&(RU(e||null,t),n instanceof tH&&(DU(n,t),t.control=n))}),this.form._updateTreeValidity({emitEvent:!1})}_setUpFormContainer(t){const e=this.form.get(t.path);BU(e,t),e.updateValueAndValidity({emitEvent:!1})}_cleanUpFormContainer(t){if(this.form){const e=this.form.get(t.path);e&&function(t,e){return jU(t,e)}(e,t)&&e.updateValueAndValidity({emitEvent:!1})}}_updateRegistrations(){this.form._registerOnCollectionChange(this._onCollectionChange),this._oldForm&&this._oldForm._registerOnCollectionChange(()=>{})}_updateValidators(){LU(this.form,this),this._oldForm&&jU(this._oldForm,this)}_checkFormPresent(){}}return t.\u0275fac=function(e){return new(e||t)(ea(hU,10),ea(dU,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:[xl([fH]),jo,ye]}),t})(),mH=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[uH]]}),t})(),bH=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[mH]}),t})(),yH=(()=>{class t{static withConfig(e){return{ngModule:t,providers:[{provide:hH,useValue:e.warnOnNgModelWithFormControl}]}}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[mH]}),t})();function vH(t){return new E(e=>{let n;try{n=t()}catch(i){return void e.error(i)}return(n?U(n):fp()).subscribe(e)})}const _H=["underline"],wH=["connectionContainer"],xH=["inputContainer"],SH=["label"];function CH(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 EH(t,e){1&t&&(ra(0,"div",19),xa(1,1),sa())}function OH(t,e){if(1&t&&(aa(0),xa(1,2),ra(2,"span"),Ja(3),sa(),la()),2&t){const t=va(2);ws(3),tl(t._control.placeholder)}}function TH(t,e){1&t&&xa(0,3,["*ngSwitchCase","true"])}function kH(t,e){1&t&&(ra(0,"span",23),Ja(1," *"),sa())}function PH(t,e){if(1&t){const t=ua();ra(0,"label",20,21),fa("cdkObserveContent",function(){return $e(t),va().updateOutlineGap()}),Jo(2,OH,4,1,"ng-container",12),Jo(3,TH,1,0,"ng-content",12),Jo(4,kH,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 AH(t,e){1&t&&(ra(0,"div",24),xa(1,4),sa())}function MH(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 IH(t,e){1&t&&(ra(0,"div"),xa(1,5),sa()),2&t&&na("@transitionMessages",va()._subscriptAnimationState)}function DH(t,e){if(1&t&&(ra(0,"div",31),Ja(1),sa()),2&t){const t=va(2);na("id",t._hintLabelId),ws(1),tl(t.hintLabel)}}function RH(t,e){if(1&t&&(ra(0,"div",28),Jo(1,DH,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 NH=["*",[["","matPrefix",""]],[["mat-placeholder"]],[["mat-label"]],[["","matSuffix",""]],[["mat-error"]],[["mat-hint",3,"align","end"]],[["mat-hint","align","end"]]],LH=["*","[matPrefix]","mat-placeholder","mat-label","[matSuffix]","mat-error","mat-hint:not([align='end'])","mat-hint[align='end']"],jH=new oi("MatError"),FH={transitionMessages:Qg("transitionMessages",[em("enter",tm({opacity:1,transform:"translateY(0%)"})),im("void => enter",[tm({opacity:0,transform:"translateY(-5px)"}),Zg("300ms cubic-bezier(0.55, 0, 0.55, 0.2)")])])};let BH=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275dir=se({type:t}),t})();const VH=new oi("MatHint");let zH=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275dir=se({type:t,selectors:[["mat-label"]]}),t})(),UH=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275dir=se({type:t,selectors:[["mat-placeholder"]]}),t})();const HH=new oi("MatPrefix");let $H=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275dir=se({type:t,selectors:[["","matPrefix",""]],features:[xl([{provide:HH,useExisting:t}])]}),t})();const GH=new oi("MatSuffix");let WH=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275dir=se({type:t,selectors:[["","matSuffix",""]],features:[xl([{provide:GH,useExisting:t}])]}),t})(),qH=0;const XH=Xy(class{constructor(t){this._elementRef=t}},"primary"),YH=new oi("MAT_FORM_FIELD_DEFAULT_OPTIONS"),KH=new oi("MatFormField");let QH=(()=>{class t extends XH{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 A,this._showAlwaysAnimate=!1,this._subscriptAnimationState="",this._hintLabel="",this._hintLabelId="mat-hint-"+qH++,this._labelId="mat-form-field-label-"+qH++,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=kd(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(lp(null)).subscribe(()=>{this._validatePlaceholders(),this._syncDescribedByIds(),this._changeDetectorRef.markForCheck()}),t.ngControl&&t.ngControl.valueChanges&&t.ngControl.valueChanges.pipe(rp(this._destroyed)).subscribe(()=>this._changeDetectorRef.markForCheck()),this._ngZone.runOutsideAngular(()=>{this._ngZone.onStable.pipe(rp(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(lp(null)).subscribe(()=>{this._processHints(),this._changeDetectorRef.markForCheck()}),this._errorChildren.changes.pipe(lp(null)).subscribe(()=>{this._syncDescribedByIds(),this._changeDetectorRef.markForCheck()}),this._dir&&this._dir.change.pipe(rp(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,Rd(this._label.nativeElement,"transitionend").pipe(rf(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:[[Wh,Wy,fg],Wy]}),t})();function JH(t,e=Yd){const n=function(t){return t instanceof Date&&!isNaN(+t)}(t)?+t-e.now():Math.abs(t);return t=>t.lift(new t$(n,e))}class t${constructor(t,e){this.delay=t,this.scheduler=e}call(t,e){return e.subscribe(new e$(t,this.delay,this.scheduler))}}class e$ 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(e$.dispatch,this.delay,{source:this,destination:this.destination,scheduler:t}))}scheduleNotification(t){if(!0===this.errored)return;const e=this.scheduler,n=new n$(e.now()+this.delay,t);this.queue.push(n),!1===this.active&&this._schedule(e)}_next(t){this.scheduleNotification(bp.createNext(t))}_error(t){this.errored=!0,this.queue=[],this.destination.error(t),this.unsubscribe()}_complete(){this.scheduleNotification(bp.createComplete()),this.unsubscribe()}}class n${constructor(t,e){this.time=t,this.notification=e}}const i$=["panel"];function r$(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 s$=["*"];let o$=0;class a${constructor(t,e){this.source=t,this.option=e}}const l$=Yy(class{}),c$=new oi("mat-autocomplete-default-options",{providedIn:"root",factory:function(){return{autoActiveFirstOption:!1}}});let u$=(()=>{class t extends l${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 Bc,this.opened=new Bc,this.closed=new Bc,this.optionActivated=new Bc,this._classList={},this.id="mat-autocomplete-"+o$++,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=kd(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 Eg(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 a$(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(nc),ea(Al),ea(c$),ea(Ep))},t.\u0275dir=se({type:t,viewQuery:function(t,e){if(1&t&&(Zc(ac,7),Zc(i$,5)),2&t){let t;Qc(t=tu())&&(e.template=t.first),Qc(t=tu())&&(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})(),h$=(()=>{class t extends u${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&&(Jc(n,bv,5),Jc(n,wv,5)),2&t){let t;Qc(t=tu())&&(e.optionGroups=t),Qc(t=tu())&&(e.options=t)}},hostAttrs:[1,"mat-autocomplete"],inputs:{disableRipple:"disableRipple"},exportAs:["matAutocomplete"],features:[xl([{provide:pv,useExisting:t}]),jo],ngContentSelectors:s$,decls:1,vars:0,consts:[["role","listbox",1,"mat-autocomplete-panel",3,"id","ngClass"],["panel",""]],template:function(t,e){1&t&&(wa(),Jo(0,r$,3,4,"ng-template"))},directives:[Oh],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 d$=new oi("mat-autocomplete-scroll-strategy"),p$={provide:d$,deps:[Vf],useFactory:function(t){return()=>t.scrollStrategies.reposition()}},f$={provide:aU,useExisting:pt(()=>m$),multi:!0};let g$=(()=>{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 A,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=vH(()=>this.autocomplete&&this.autocomplete.options?Q(...this.autocomplete.options.map(t=>t.onSelectionChange)):this._zone.onStable.pipe(rf(1),cp(()=>this.optionSelections))),this._scrollStrategy=s}get autocompleteDisabled(){return this._autocompleteDisabled}set autocompleteDisabled(t){this._autocompleteDisabled=kd(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(ep(()=>this._overlayAttached)),this._closeKeyEventStream,this._getOutsideClickStream(),this._overlayRef?this._overlayRef.detachments().pipe(ep(()=>this._overlayAttached)):Dd()).pipe(D(t=>t instanceof vv?t:null))}get activeOption(){return this.autocomplete&&this.autocomplete._keyManager?this.autocomplete._keyManager.activeItem:null}_getOutsideClickStream(){return Q(Rd(this._document,"click"),Rd(this._document,"auxclick"),Rd(this._document,"touchend")).pipe(ep(t=>{const e=Lp(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&&!uf(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(rf(1)),this.autocomplete.options.changes.pipe(eg(()=>this._positionStrategy.reapplyLastPosition()),JH(0))).pipe(cp(()=>{const t=this.panelOpen;return this._resetActiveItem(),this.autocomplete._setVisibility(),this.panelOpen&&(this._overlayRef.updatePosition(),t!==this.panelOpen&&this.autocomplete.opened.emit()),this.panelClosingActions}),rf(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 Xp(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&&!uf(t)||38===t.keyCode&&uf(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 vf({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=xv(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=Sv(t.offsetTop,t.offsetHeight,e._getScrollTop(),e.panel.nativeElement.offsetHeight);e._setScrollTop(i)}}}}return t.\u0275fac=function(e){return new(e||t)(ea(Al),ea(Vf),ea(pc),ea(Tu),ea(nc),ea(d$),ea(Fp,8),ea(KH,9),ea(th,8),ea(Hp),ea(c$,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})(),m$=(()=>{class t extends g${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:[xl([f$]),jo]}),t})(),b$=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({providers:[p$],imports:[[Wf,Cv,Wy,Wh],$p,Cv,Wy]}),t})();const y$=Ip({passive:!0});let v$=(()=>{class t{constructor(t,e){this._platform=t,this._ngZone=e,this._monitoredElements=new Map}monitor(t){if(!this._platform.isBrowser)return pp;const e=Id(t),n=this._monitoredElements.get(e);if(n)return n.subject;const i=new A,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,y$),e.classList.add("cdk-text-field-autofill-monitored")}),this._monitoredElements.set(e,{subject:i,unlisten:()=>{e.removeEventListener("animationstart",s,y$)}}),i}stopMonitoring(t){const e=Id(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)(Ei(Ep),Ei(Tu))},t.\u0275prov=xt({factory:function(){return new t(Ei(Ep),Ei(Tu))},token:t,providedIn:"root"}),t})(),_$=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Op]]}),t})();const w$=new oi("MAT_INPUT_VALUE_ACCESSOR"),x$=["button","checkbox","file","hidden","image","radio","range","reset","submit"];let S$=0;const C$=Qy(class{constructor(t,e,n,i){this._defaultErrorStateMatcher=t,this._parentForm=e,this._parentFormGroup=n,this.ngControl=i}});let E$=(()=>{class t extends C${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-"+S$++,this.focused=!1,this.stateChanges=new A,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=>kp().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=kd(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=kd(t)}get type(){return this._type}set type(t){this._type=t||"text",this._validateType(),!this._isTextarea&&kp().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=kd(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(){x$.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(Al),ea(Ep),ea(PU,10),ea(sH,8),ea(gH,8),ea(Zy),ea(w$,10),ea(v$),ea(Tu),ea(KH,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&&(rl("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:[xl([{provide:BH,useExisting:t}]),jo,ye]}),t})(),O$=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({providers:[Zy],imports:[[_$,ZH,Wy],_$,ZH]}),t})();function T$(...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;rF$),multi:!0};class L${}const j$=Ky(Xy(qy(class{constructor(t){this._elementRef=t}}),"accent"));let F$=(()=>{class t extends j${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 Bc,this.input=new Bc,this.valueChange=new Bc,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||!B$(t)&&0!==t.button||this._ngZone.run(()=>{this._touchId=B$(t)?function(t,e){for(let n=0;n{if("pointer"===this._isSliding){const e=V$(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&&(!B$(t)||"number"!=typeof this._touchId||z$(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,R$),e.addEventListener("touchstart",this._pointerDown,R$)})}get invert(){return this._invert}set invert(t){this._invert=kd(t)}get max(){return this._max}set max(t){this._max=Pd(t,this._max),this._percent=this._calculatePercentage(this._value),this._changeDetectorRef.markForCheck()}get min(){return this._min}set min(t){this._min=Pd(t,this._min),this._percent=this._calculatePercentage(this._value),this._changeDetectorRef.markForCheck()}get step(){return this._step}set step(t){this._step=Pd(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=kd(t)}get tickInterval(){return this._tickInterval}set tickInterval(t){this._tickInterval="auto"===t?"auto":"number"==typeof t||"string"==typeof t?Pd(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=Pd(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=kd(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,R$),t.removeEventListener("touchstart",this._pointerDown,R$),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||uf(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=B$(t),i=n?"touchend":"mouseup";e.addEventListener(n?"touchmove":"mousemove",this._pointerMove,R$),e.addEventListener(i,this._pointerUp,R$),n&&e.addEventListener("touchcancel",this._pointerUp,R$);const r=this._getWindow();void 0!==r&&r&&r.addEventListener("blur",this._windowBlur)}_removeGlobalEvents(){const t=this._document;t.removeEventListener("mousemove",this._pointerMove,R$),t.removeEventListener("mouseup",this._pointerUp,R$),t.removeEventListener("touchmove",this._pointerMove,R$),t.removeEventListener("touchend",this._pointerUp,R$),t.removeEventListener("touchcancel",this._pointerUp,R$);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 L$;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(Al),ea(Ug),ea(nc),ea(Fp,8),ii("tabindex"),ea(Tu),ea(th),ea(Ny,8))},t.\u0275cmp=Jt({type:t,selectors:[["mat-slider"]],viewQuery:function(t,e){if(1&t&&Zc(D$,5),2&t){let t;Qc(t=tu())&&(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&&(rl("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:[xl([N$]),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),Ja(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),tl(e.displayValue))},directives:[jh],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 B$(t){return"t"===t.type[0]}function V$(t,e){let n;return n=B$(t)?"number"==typeof e?z$(t.touches,e)||z$(t.changedTouches,e):t.touches[0]||t.changedTouches[0]:t,n?{x:n.clientX,y:n.clientY}:void 0}function z$(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:[[Wh,Wy],Wy]}),t})();function H$(t,e){}class $${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 G$={dialogContainer:Qg("dialogContainer",[em("void, exit",tm({opacity:0,transform:"scale(0.7)"})),em("enter",tm({transform:"none"})),im("* => enter",Zg("150ms cubic-bezier(0, 0, 0.2, 1)",tm({transform:"none",opacity:1}))),im("* => void, * => exit",Zg("75ms cubic-bezier(0.4, 0.0, 0.2, 1)",tm({opacity:0})))])};let W$=(()=>{class t extends Kp{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 Bc,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=Np(),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=Np())}_focusDialogContainer(){this._elementRef.nativeElement.focus&&this._elementRef.nativeElement.focus()}_containsFocus(){const t=this._elementRef.nativeElement,e=Np();return t===e||t.contains(e)}}return t.\u0275fac=function(e){return new(e||t)(ea(Al),ea(Ag),ea(nc),ea(th,8),ea($$),ea(Ug))},t.\u0275dir=se({type:t,viewQuery:function(t,e){if(1&t&&Zc(tf,7),2&t){let t;Qc(t=tu())&&(e._portalOutlet=t.first)}},features:[jo]}),t})(),q$=(()=>{class t extends W${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&&(rl("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),sl("@dialogContainer",e._state))},features:[jo],decls:1,vars:0,consts:[["cdkPortalOutlet",""]],template:function(t,e){1&t&&Jo(0,H$,0,0,"ng-template",0)},directives:[tf],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:[G$.dialogContainer]}}),t})(),X$=0;class Y${constructor(t,e,n="mat-dialog-"+X$++){this._overlayRef=t,this._containerInstance=e,this.id=n,this.disableClose=this._containerInstance._config.disableClose,this._afterOpened=new A,this._afterClosed=new A,this._beforeClosed=new A,this._state=0,e._id=n,e._animationStateChanged.pipe(ep(t=>"opened"===t.state),rf(1)).subscribe(()=>{this._afterOpened.next(),this._afterOpened.complete()}),e._animationStateChanged.pipe(ep(t=>"closed"===t.state),rf(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(ep(t=>27===t.keyCode&&!this.disableClose&&!uf(t))).subscribe(t=>{t.preventDefault(),K$(this,"keyboard")}),t.backdropClick().subscribe(()=>{this.disableClose?this._containerInstance._recaptureFocus():K$(this,"mouse")})}close(t){this._result=t,this._containerInstance._animationStateChanged.pipe(ep(t=>"closing"===t.state),rf(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 K$(t,e,n){return void 0!==t._containerInstance&&(t._containerInstance._closeInteractionType=e),t.close(n)}const Q$=new oi("MatDialogData"),Z$=new oi("mat-dialog-default-options"),J$=new oi("mat-dialog-scroll-strategy"),tG={provide:J$,deps:[Vf],useFactory:function(t){return()=>t.scrollStrategies.block()}};let eG=(()=>{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 A,this._afterOpenedAtThisLevel=new A,this._ariaHiddenElements=new Map,this.afterAllClosed=vH(()=>this.openDialogs.length?this._getAfterAllClosed():this._getAfterAllClosed().pipe(lp(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 $$)).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 vf({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:$$,useValue:e}]}),i=new qp(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 ac)e.attachTemplatePortal(new Xp(t,null,{$implicit:i.data,dialogRef:r}));else{const n=this._createInjector(i,r,e),s=e.attachComponentPortal(new qp(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(Fp,null,Mt.Optional))&&r.push({provide:Fp,useValue:{value:t.direction,change:Dd()}}),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(Vf),ea(No),ea(void 0),ea(void 0),ea(Tf),ea(void 0),ea(ai),ea(ai),ea(oi))},t.\u0275dir=se({type:t}),t})(),nG=(()=>{class t extends eG{constructor(t,e,n,i,r,s,o){super(t,e,i,s,o,r,Y$,q$,Q$)}}return t.\u0275fac=function(e){return new(e||t)(Ei(Vf),Ei(No),Ei(ph,8),Ei(Z$,8),Ei(J$),Ei(t,12),Ei(Tf))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),iG=0,rG=(()=>{class t{constructor(t,e,n){this._dialogRef=t,this._elementRef=e,this._dialog=n,this.id="mat-dialog-title-"+iG++}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(Y$,8),ea(Al),ea(nG))},t.\u0275dir=se({type:t,selectors:[["","mat-dialog-title",""],["","matDialogTitle",""]],hostAttrs:[1,"mat-dialog-title"],hostVars:1,hostBindings:function(t,e){2&t&&rl("id",e.id)},inputs:{id:"id"},exportAs:["matDialogTitle"]}),t})(),sG=(()=>{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 oG=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({providers:[nG,tG],imports:[[Wf,ef,Wy],Wy]}),t})();const aG=new oi("CdkAccordion");let lG=0,cG=(()=>{class t{constructor(t,e,n){this.accordion=t,this._changeDetectorRef=e,this._expansionDispatcher=n,this._openCloseAllSubscription=g.EMPTY,this.closed=new Bc,this.opened=new Bc,this.destroyed=new Bc,this.expandedChange=new Bc,this.id="cdk-accordion-child-"+lG++,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=kd(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=kd(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(aG,12),ea(nc),ea(zp))},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:[xl([{provide:aG,useValue:void 0}])]}),t})(),uG=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({}),t})();const hG=["body"];function dG(t,e){}const pG=[[["mat-expansion-panel-header"]],"*",[["mat-action-row"]]],fG=["mat-expansion-panel-header","*","mat-action-row"];function gG(t,e){1&t&&oa(0,"span",2),2&t&&na("@indicatorRotate",va()._getExpandedState())}const mG=[[["mat-panel-title"]],[["mat-panel-description"]],"*"],bG=["mat-panel-title","mat-panel-description","*"],yG=new oi("MAT_ACCORDION"),vG="225ms cubic-bezier(0.4,0.0,0.2,1)",_G={indicatorRotate:Qg("indicatorRotate",[em("collapsed, void",tm({transform:"rotate(0deg)"})),em("expanded",tm({transform:"rotate(180deg)"})),im("expanded <=> collapsed, void => collapsed",Zg(vG))]),bodyExpansion:Qg("bodyExpansion",[em("collapsed, void",tm({height:"0px",visibility:"hidden"})),em("expanded",tm({height:"*",visibility:"visible"})),im("expanded <=> collapsed, void => collapsed",Zg(vG))])};let wG=(()=>{class t{constructor(t){this._template=t}}return t.\u0275fac=function(e){return new(e||t)(ea(ac))},t.\u0275dir=se({type:t,selectors:[["ng-template","matExpansionPanelContent",""]]}),t})(),xG=0;const SG=new oi("MAT_EXPANSION_PANEL_DEFAULT_OPTIONS");let CG=(()=>{class t extends cG{constructor(t,e,n,i,r,s,o){super(t,e,n),this._viewContainerRef=i,this._animationMode=s,this._hideToggle=!1,this.afterExpand=new Bc,this.afterCollapse=new Bc,this._inputChanges=new A,this._headerId="mat-expansion-panel-header-"+xG++,this._bodyAnimationDone=new A,this.accordion=t,this._document=r,this._bodyAnimationDone.pipe(Wd((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=kd(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(lp(null),ep(()=>this.expanded&&!this._portal),rf(1)).subscribe(()=>{this._portal=new Xp(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(yG,12),ea(nc),ea(zp),ea(pc),ea(th),ea(Ny,8),ea(SG,8))},t.\u0275cmp=Jt({type:t,selectors:[["mat-expansion-panel"]],contentQueries:function(t,e,n){if(1&t&&Jc(n,wG,5),2&t){let t;Qc(t=tu())&&(e._lazyContent=t.first)}},viewQuery:function(t,e){if(1&t&&Zc(hG,5),2&t){let t;Qc(t=tu())&&(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:[xl([{provide:yG,useValue:void 0}]),jo,ye],ngContentSelectors:fG,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(pG),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,dG,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:[tf],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:[_G.bodyExpansion]},changeDetection:0}),t})();class EG{}const OG=Ky(EG);let TG=(()=>{class t extends OG{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(ep(t=>!(!t.hideToggle&&!t.togglePosition))):pp;this.tabIndex=parseInt(o||"")||0,this._parentChangeSubscription=Q(t.opened,t.closed,a,t._inputChanges.pipe(ep(t=>!!(t.hideToggle||t.disabled||t.togglePosition)))).subscribe(()=>this._changeDetectorRef.markForCheck()),t.closed.pipe(ep(()=>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:uf(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(CG,1),ea(Al),ea(Ug),ea(nc),ea(SG,8),ea(Ny,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:bG,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(mG),ra(0,"span",0),xa(1),xa(2,1),xa(3,2),sa(),Jo(4,gG,1,1,"span",1)),2&t&&(ws(4),na("ngIf",e._showToggle()))},directives:[Ah],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:[_G.indicatorRotate]},changeDetection:0}),t})(),kG=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Wh,Wy,uG,ef]]}),t})();var PG=n(5478);Object.create(Error.prototype);const AG=["*"];var MG=(()=>(function(t){t.LineHighlight="line-highlight",t.LineNumbers="line-numbers"}(MG||(MG={})),MG))();class IG{}const DG=new oi("SECURITY_CONTEXT");let RG=(()=>{class t{constructor(t,e,n,i,r){this.platform=t,this.securityContext=e,this.http=n,this.sanitizer=r,this.initialMarkedOptions={renderer:new PG.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=PG.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(Xh(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(!Xh(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(!Xh(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(!Xh(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)(Ei(hu),Ei(DG),Ei(Jv,8),Ei(IG,8),Ei(Sd))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),NG=(()=>{class t{constructor(t,e){this.element=t,this.markdownService=e,this.error=new Bc,this.load=new Bc,this.ready=new Bc,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,MG.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:[RG,e&&e.loader||[],e&&e.markedOptions||[],{provide:DG,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 jG(t,e,n){return n?jG(t,e).pipe(D(t=>d(t)?n(...t):n(t))):new E(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 FG(...t){return e=>{let n;return"function"==typeof t[t.length-1]&&(n=t.pop()),e.lift(new BG(t,n))}}class BG{constructor(t,e){this.observables=t,this.project=e}call(t,e){return e.subscribe(new VG(t,this.observables,this.project))}}class VG extends j_{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 zG{constructor(t,e,n=!1){this.accumulator=t,this.seed=e,this.hasSeed=n}call(t,e){return e.subscribe(new UG(t,this.accumulator,this.seed,this.hasSeed))}}class UG 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 HG{constructor(t){this.predicate=t}call(t,e){return e.subscribe(new $G(t,this.predicate))}}class $G 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 GG=["youtubeContainer"];let WG=(()=>{class t{constructor(t,e){this._ngZone=t,this._youtubeContainer=new A,this._destroyed=new A,this._playerChanges=new Jf(void 0),this._videoId=new Jf(void 0),this._height=new Jf(390),this._width=new Jf(640),this._startSeconds=new Jf(void 0),this._endSeconds=new Jf(void 0),this._suggestedQuality=new Jf(void 0),this._playerVars=new Jf(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=Xh(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=Dd(!0);if(!window.YT||!window.YT.Player){const e=new A;this._existingApiReadyCallback=window.onYouTubeIframeAPIReady,window.onYouTubeIframeAPIReady=()=>{this._existingApiReadyCallback&&this._existingApiReadyCallback(),this._ngZone.run(()=>e.next(!0))},t=e.pipe(rf(1),lp(!1))}const e=function(t,e,n,i,r,s,o){const a=z_([e,s]).pipe(FG(z_([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 z_([t,a,Dd(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 U_(e))}(t),function(t){return e=>e.lift(new HG(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 zG(t,e,n))}}(qG,void 0),Wd())}(this._youtubeContainer,this._videoId,t,this._width,this._height,this._playerVars,this._ngZone).pipe(eg(t=>{this._playerChanges.next(t)}),W(t=>t?XG(t)?Dd(t):new E(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=>{XG(t)||t.destroy()})(t)}}).pipe(rf(1),lp(void 0)):Dd(void 0)),rp(this._destroyed),rt(new A));e.subscribe(t=>{this._player=t,t&&this._pendingPlayerState&&this._initializePlayer(t,this._pendingPlayerState),this._pendingPlayerState=void 0}),function(t,e,n){z_([t,e,n]).subscribe(([t,e,n])=>t&&t.setSize(e,n))}(e,this._width,this._height),function(t,e){z_([t,e]).subscribe(([t,e])=>t&&e&&t.setPlaybackQuality(e))}(e,this._suggestedQuality),function(t,e,n,i,r,s){const o=z_([n,i]).pipe(D(([t,e])=>({startSeconds:t,endSeconds:e}))),a=o.pipe(YG(t,t=>!!t&&!function(t){const e=t.getPlayerState();return e!==YT.PlayerState.UNSTARTED&&e!==YT.PlayerState.CUED}(t))),l=e.pipe(YG(t,(t,e)=>!!t&&t.videoId!==e));Q(t.pipe(YG(z_([e,o]),([t,e],n)=>!(!n||t==n.videoId&&!e.startSeconds&&!e.endSeconds))),l,a).pipe(FG(z_([t,e,o,r])),D(([t,e])=>e),rp(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(cp(e=>e?jG(n=>{e.addEventListener(t,n)},n=>{try{e.removeEventListener&&e.removeEventListener(t,n)}catch(i){}}):Dd()),t=>new E(e=>t.subscribe({next:t=>this._ngZone.run(()=>e.next(t)),error:t=>e.error(t),complete:()=>e.complete()})),rp(this._destroyed))}}return t.\u0275fac=function(e){return new(e||t)(ea(Tu),ea(hu))},t.\u0275cmp=Jt({type:t,selectors:[["youtube-player"]],viewQuery:function(t,e){if(1&t&&Zc(GG,5),2&t){let t;Qc(t=tu())&&(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 qG(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 XG(t){return"getPlayerStatus"in t}function YG(t,e){return S(FG(t),ep(([t,n])=>e(n,t)),D(([t])=>t))}let KG=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({}),t})(),QG=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275dir=se({type:t,selectors:[["","mat-card-sm-image",""],["","matCardImageSmall",""]],hostAttrs:[1,"mat-card-sm-image"]}),t})();function ZG(t){return!0===t}function JG(t){return null==t}function tW(t){return!JG(t)}function eW(t){return Boolean(t)}function nW(t){return JG(t)?t:JSON.parse(JSON.stringify(t))}const iW=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])&&iW(t[e])}),t};function rW(t){return tW(t)&&"object"==typeof t&&function(t){return"[object Object]"===Object.prototype.toString.call(t)}(t)}const sW="NGXS_DATA_META",oW="NGXS_META",aW="NGXS_ARGUMENT_REGISTRY_META";let lW=(()=>{class t{constructor(t){this.sequence$=new Jf(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)(Ei(qz,8))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();function cW(t){return t[sW]}let uW=(()=>{class t{constructor(e,n,i){t.store=e.get(qz),t.ngZone=e.get(Tu),t.factory=n,t.context=i,t.computed=e.get(lW)}}return t.store=null,t.computed=null,t.context=null,t.factory=null,t.ngZone=null,t.\u0275fac=function(e){return new(e||t)(Ei(No),Ei(XV),Ei(qV))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();class hW{constructor(){hW.statesCachedMeta.clear()}static createStateContext(t){return uW.context.createStateContext(t)}static ensureMappedState(t){if(JG(uW.factory)||JG(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(tW(t.name)?hW.statesCachedMeta.get(t.name):null)||hW.ensureMeta(t)}static getRepositoryByInstance(t){var e;const n=null!==(e=cW(hW.getStateClassByInstance(t)))&&void 0!==e?e:null;if(JG(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=hW.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=hW.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=tW(t.name)?null===(e=uW.factory.states)||void 0===e?void 0:e.find(e=>e.name===t.name):null;return tW(n)&&tW(t.name)&&hW.statesCachedMeta.set(t.name,n),n}}hW.statesCachedMeta=new Map,hW.\u0275fac=function(t){return new(t||hW)},hW.\u0275prov=xt({token:hW,factory:hW.\u0275fac}),new _p(1);class dW extends Error{constructor(t){super(`Child states can only be added to an object. Cannot convert ${tW(null==t?void 0:t.constructor)?t.constructor.name:t} to PlainObject`)}}function pW(t){var e;return null!==(e=t.NGXS_OPTIONS_META)&&void 0!==e?e:{name:""}}function fW(t){var e;const n=pW(t),i=null!==(e=n.children)&&void 0!==e?e:[],r=nW(void 0===n.defaults?{}:n.defaults);if(i.length){if(rW(r))return function(t,e){return e.reduce((t,e)=>{const n=pW(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()]=fW(e),t},null!=t?t:{})}(r,i);throw new dW(r)}return r}function gW(t){var e;return null!==(e=t.__NGXS_COMPUTED_OPTION__)&&void 0!==e?e:null}function mW(){var t,e;return null!==(e=null===(t=null==uW?void 0:uW.computed)||void 0===t?void 0:t.sequenceValue)&&void 0!==e?e:0}function bW(t){let e=!1;return Gd(t)&&(e=!0),e}function yW(t){return t[aW]}class vW extends Error{constructor(t,e){super(`An argument with the name '${t}' already exists in the method '${e}'`)}}class _W{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(eW(this.argumentMap.has(t))||eW(this.payloadMap.has(t)))throw new vW(t,e)}}function wW(t){return Vu()?iW(t):t}function xW(t){return{enumerable:!0,configurable:!0,get(){const e=cW(t),n=hW.ensureMappedState(e.stateMeta);return hW.createStateContext(n)}}}function SW(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:()=>Vu()?iW(t.getState()):t.getState(),setState(e){t.setState(e)},patchState(e){t.patchState(e)}})}function CW(){return(t,e,n)=>{!function(t,e){if(!function(t,e){var n;let i=t,r=!1;if(rW(i))for(;null!==i;){if(ZG(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 JG(gW(t))&&Object.defineProperties(t,{__NGXS_COMPUTED_OPTION__:{enumerable:!0,configurable:!0,value:new WeakMap}}),gW(t)}(this),n=null==e?void 0:e.get(i);if(ZG(null==n?void 0:n.isObservable))return null==n?void 0:n.value;if(JG(n)||n.sequenceId!==mW()){e.delete(i);const n=i.apply(this,t);return e.set(i,{value:n,sequenceId:mW(),isObservable:bW(n)}),n}return n.value},n}}const EW={cancelUncompleted:!0,insideZone:!1};function OW(t=EW){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=hW.getRepositoryByInstance(n),a=o.operations;let l=a[s];const c=o.stateMeta,u=yW(r);if(JG(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 ZG(t.insideZone)?null===(s=uW.ngZone)||void 0===s||s.run(()=>{i=r.apply(n,e)}):i=r.apply(n,e),Gd(i)?Dd(null).pipe(D(()=>i)):i};const h=hW.createAction(l,e,u),d=uW.store.dispatch(h);return Gd(i)?function(t,e){return Ev([t,e]).pipe(D(t=>t.pop()))}(d,i):i},i}}function TW(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 JG(yW(n))&&Object.defineProperties(n,{[aW]:{enumerable:!0,configurable:!0,value:new _W}}),yW(n)})(e,n).createPayloadType(r,n,i)}}function kW(){return t=>{const e=function(t){if(function(t){return!eW(t)}(t.hasOwnProperty(oW))){const e={name:null,actions:{},defaults:{},path:null,makeRootSelector:t=>t.getStateGetter(e.name),children:[]};Object.defineProperty(t,oW,{value:e})}return function(t){var e;return null===(e=t)||void 0===e?void 0:e[oW]}(t)}(t);if(JG(e.name))throw new Error("@StateRepository should be add before decorator @State");!function(t,e){(function(t){var e;const n=null!==(e=cW(t))&&void 0!==e?e:null;return(JG(n)||(null==n?void 0:n.stateClass)!==t)&&function(t){Object.defineProperty(t,sW,{writable:!0,configurable:!0,enumerable:!0,value:{stateMeta:null,operations:{},stateClass:t}})}(t),cW(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:()=>nW(n)},context:xW(t)})}(t,e,fW(t)),function(t){var e,n;const i=cW(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(tW(r)){const e=`__${r}__selector`;Object.defineProperties(t.prototype,{[e]:{writable:!0,enumerable:!1,configurable:!0},state$:{enumerable:!0,configurable:!0,get(){if(tW(this[e]))return this[e];if(JG(uW.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]=uW.store.select(t).pipe(D(t=>Vu()?iW(t):t),xp({refCount:!0,bufferSize:1})),this[e]}}})}}(t)}}let PW=(()=>{class t{constructor(){this.browserStorageEvents$=new A,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})(),AW=(()=>{class t extends PW{get snapshot(){return wW(this.getState())}get ctx(){return SW(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}),vw([CW(),ww("design:type",Object),ww("design:paramtypes",[])],t.prototype,"snapshot",null),vw([OW(),_w(0,TW("patchValue")),ww("design:type",Function),ww("design:paramtypes",[Object]),ww("design:returntype",void 0)],t.prototype,"patchState",null),vw([OW(),_w(0,TW("stateValue")),ww("design:type",Function),ww("design:paramtypes",[Object]),ww("design:returntype",void 0)],t.prototype,"setState",null),vw([OW(),ww("design:type",Function),ww("design:paramtypes",[]),ww("design:returntype",void 0)],t.prototype,"reset",null),t})(),MW=(()=>{class t extends PW{get snapshot(){return wW(this.getState())}get ctx(){return SW(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}),vw([CW(),ww("design:type",Object),ww("design:paramtypes",[])],t.prototype,"snapshot",null),vw([OW(),_w(0,TW("patchValue")),ww("design:type",Function),ww("design:paramtypes",[Object]),ww("design:returntype",void 0)],t.prototype,"patchState",null),vw([OW(),_w(0,TW("stateValue")),ww("design:type",Function),ww("design:paramtypes",[Object]),ww("design:returntype",void 0)],t.prototype,"setState",null),vw([OW(),ww("design:type",Function),ww("design:paramtypes",[]),ww("design:returntype",void 0)],t.prototype,"reset",null),t})();function IW(){return ep(t=>null!=t)}const DW=new oi("ngx-google-analytics-settings",{factory:()=>({trackingCode:"",enableTracing:!1})}),RW=new oi("ngx-window",{providedIn:"root",factory:()=>function(t){return Xh(t)?window:null}(Oi(hu))}),NW=new oi("ngx-data-layer",{providedIn:"root",factory:()=>function(t){return t?t.dataLayer=t.dataLayer||[]:null}(Oi(RW))}),LW=new oi("ngx-gtag-fn",{providedIn:"root",factory:()=>function(t,e){return t?t.gtag=t.gtag||function(){e.push(arguments)}:null}(Oi(RW),Oi(NW))});let jW=(()=>{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||Vu())&&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)(Ei(DW),Ei(th),Ei(LW))},t.\u0275prov=xt({factory:function(){return new t(Ei(DW),Ei(th),Ei(LW))},token:t,providedIn:"root"}),t})();const FW={provide:su,multi:!0,useFactory:function(t,e,n){return()=>xw(this,void 0,void 0,function*(){var i;if(!t.trackingCode)return void(Vu()||console.error("Empty tracking code for Google Analytics. Make sure to provide one when initializing NgxGoogleAnalyticsModule."));if(!e)return void(Vu()||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||Vu()||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:[DW,LW,th]};new oi("ngx-google-analytics-routing-settings",{factory:()=>({})});let BW=(()=>{class t{static forRoot(e,n=[],i,r,s){return{ngModule:t,providers:[{provide:DW,useValue:{trackingCode:e,initCommands:n,uri:i,enableTracing:r,nonce:s}},FW]}}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[]]}),t})(),VW=(()=>{class t{constructor(){this.consent="not-set",this.consentChange=new _p(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})(),zW=(()=>{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)(Ei(VW),Ei(RW),Ei(DW))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();const UW=new oi("Key under which consent is stored",{providedIn:"root",factory:()=>"ALLOW_TELEMETRY"}),HW=[VW,zW,(()=>{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)(Ei(VW),Ei(UW))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})()];function $W(t){return Object.entries(t).reduce((t,[e,n])=>(null!=n&&(t[e]=`${n}`),t),{})}let GW=(()=>{class t{static forRoot(e){const{providers:n=[]}=BW.forRoot(e.gaToken,function(t){const{appName:e,projectName:n,developmentMode:i}=t;return[{command:"set",values:[$W({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:[...HW,{provide:su,multi:!0,useFactory:()=>()=>{},deps:HW}],imports:[[BW]]}),t})();function WW(t,e,n,i){n&&"function"!=typeof n&&(i=n);const r="function"==typeof n?n:void 0,s=new _p(t,e,i);return t=>rt(()=>s,r)(t)}const qW=(t,e)=>JSON.stringify(t)===JSON.stringify(e),XW=t=>t.map(t=>void 0!==t?JSON.parse(JSON.stringify(t)):t),YW={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},KW=new A;function QW(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 YW.storageStrategy;const n=[];t.cacheModifier&&t.cacheModifier.subscribe(t=>e.addMany(t(e.getAll(r,this)),r,this)),Q(KW.asObservable(),t.cacheBusterObserver?t.cacheBusterObserver:fp()).subscribe(t=>{e.removeAll(r,this),n.length=0}),t.cacheResolver=t.cacheResolver||YW.cacheResolver||qW,t.cacheHasher=t.cacheHasher||YW.cacheHasher||XW,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||YW.maxAge)&&l&&l.created&&((new Date).getTime()-new Date(l.created).getTime()>(t.maxAge||YW.maxAge)?(e.remove?e.remove(o.indexOf(l),l,r,this):e.removeAtIndex(o.indexOf(l),r,this),l=null):(t.slidingExpiration||YW.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=Dd(l.response);return t.async?e.pipe(JH(0)):e}if(c)return c.response;{const l=s.call(this,...i).pipe(Av(()=>{const e=n.find(e=>t.cacheResolver(e.parameters,a));n.splice(n.indexOf(e),1)}),eg(n=>{(!t.shouldCacheDecider||t.shouldCacheDecider(n))&&((!(t.maxCacheCount||YW.maxCacheCount)||1===(t.maxCacheCount||YW.maxCacheCount)||(t.maxCacheCount||YW.maxCacheCount)&&(t.maxCacheCount||YW.maxCacheCount)this.isJsonMime(t));return void 0===e?t[0]:e}selectHeaderAccept(t){if(0===t.length)return;const e=t.find(t=>this.isJsonMime(t));return void 0===e?t[0]:e}isJsonMime(t){const e=new RegExp("^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$","i");return null!==t&&(e.test(t)||"application/json-patch+json"===t.toLowerCase())}lookupCredential(t){const e=this.credentials[t];return"function"==typeof e?e():e}}let eq=(()=>{class t{constructor(t,e,n){this.httpClient=t,this.basePath="/v1",this.defaultHeaders=new Nv,this.configuration=new tq,n&&(this.configuration=n),"string"!=typeof this.configuration.basePath&&("string"!=typeof e&&(e=this.basePath),this.configuration.basePath=e),this.encoder=this.configuration.encoder||new ZW}addToHttpParams(t,e,n){return this.addToHttpParamsRecursive(t,e,n)}addToHttpParamsRecursive(t,e,n){if(null==e)return t;if("object"==typeof e)if(Array.isArray(e))e.forEach(e=>t=this.addToHttpParamsRecursive(t,e,n));else if(e instanceof Date){if(null==n)throw Error("key may not be null if value is Date");t=t.append(n,e.toISOString().substr(0,10))}else Object.keys(e).forEach(i=>t=this.addToHttpParamsRecursive(t,e[i],null!=n?`${n}.${i}`:i));else{if(null==n)throw Error("key may not be null if value is not object or array");t=t.append(n,e)}return t}aggregateResults(t,e="body",n=!1,i){const r=t.age,s=t.ageRange,o=t.bmi,a=t.bmiRange,l=t.cache,c=t.ontologyTerms,u=t.cellTypeTerms,h=t.providers,d=t.sex,p=t.spatial,f=t.technologies,g=t.token;let m=new zv({encoder:this.encoder});null!=r&&(m=this.addToHttpParams(m,r,"age")),null!=s&&(m=this.addToHttpParams(m,s,"age-range")),null!=o&&(m=this.addToHttpParams(m,o,"bmi")),null!=a&&(m=this.addToHttpParams(m,a,"bmi-range")),null!=l&&(m=this.addToHttpParams(m,l,"cache")),c&&c.forEach(t=>{m=this.addToHttpParams(m,t,"ontology-terms")}),u&&u.forEach(t=>{m=this.addToHttpParams(m,t,"cell-type-terms")}),h&&h.forEach(t=>{m=this.addToHttpParams(m,t,"providers")}),null!=d&&(m=this.addToHttpParams(m,d,"sex")),p&&p.forEach(t=>{m=this.addToHttpParams(m,t,"spatial")}),f&&f.forEach(t=>{m=this.addToHttpParams(m,t,"technologies")}),null!=g&&(m=this.addToHttpParams(m,g,"token"));let b=this.defaultHeaders,y=i&&i.httpHeaderAccept;void 0===y&&(y=this.configuration.selectHeaderAccept(["application/json"])),void 0!==y&&(b=b.set("Accept",y));let v=i&&i.context;void 0===v&&(v=new Uv);let _="json";return y&&(_=y.startsWith("text")?"text":this.configuration.isJsonMime(y)?"json":"blob"),this.httpClient.get(`${this.configuration.basePath}/aggregate-results`,{context:v,params:m,responseType:_,withCredentials:this.configuration.withCredentials,headers:b,observe:e,reportProgress:n})}cellTypeTermOccurences(t,e="body",n=!1,i){const r=t.age,s=t.ageRange,o=t.bmi,a=t.bmiRange,l=t.cache,c=t.ontologyTerms,u=t.cellTypeTerms,h=t.providers,d=t.sex,p=t.spatial,f=t.technologies,g=t.token;let m=new zv({encoder:this.encoder});null!=r&&(m=this.addToHttpParams(m,r,"age")),null!=s&&(m=this.addToHttpParams(m,s,"age-range")),null!=o&&(m=this.addToHttpParams(m,o,"bmi")),null!=a&&(m=this.addToHttpParams(m,a,"bmi-range")),null!=l&&(m=this.addToHttpParams(m,l,"cache")),c&&c.forEach(t=>{m=this.addToHttpParams(m,t,"ontology-terms")}),u&&u.forEach(t=>{m=this.addToHttpParams(m,t,"cell-type-terms")}),h&&h.forEach(t=>{m=this.addToHttpParams(m,t,"providers")}),null!=d&&(m=this.addToHttpParams(m,d,"sex")),p&&p.forEach(t=>{m=this.addToHttpParams(m,t,"spatial")}),f&&f.forEach(t=>{m=this.addToHttpParams(m,t,"technologies")}),null!=g&&(m=this.addToHttpParams(m,g,"token"));let b=this.defaultHeaders,y=i&&i.httpHeaderAccept;void 0===y&&(y=this.configuration.selectHeaderAccept(["application/json"])),void 0!==y&&(b=b.set("Accept",y));let v=i&&i.context;void 0===v&&(v=new Uv);let _="json";return y&&(_=y.startsWith("text")?"text":this.configuration.isJsonMime(y)?"json":"blob"),this.httpClient.get(`${this.configuration.basePath}/cell-type-term-occurences`,{context:v,params:m,responseType:_,withCredentials:this.configuration.withCredentials,headers:b,observe:e,reportProgress:n})}cellTypeTreeModel(t,e="body",n=!1,i){const r=t.cache,s=t.token;let o=new zv({encoder:this.encoder});null!=r&&(o=this.addToHttpParams(o,r,"cache")),null!=s&&(o=this.addToHttpParams(o,s,"token"));let a=this.defaultHeaders,l=i&&i.httpHeaderAccept;void 0===l&&(l=this.configuration.selectHeaderAccept(["application/json"])),void 0!==l&&(a=a.set("Accept",l));let c=i&&i.context;void 0===c&&(c=new Uv);let u="json";return l&&(u=l.startsWith("text")?"text":this.configuration.isJsonMime(l)?"json":"blob"),this.httpClient.get(`${this.configuration.basePath}/cell-type-tree-model`,{context:c,params:o,responseType:u,withCredentials:this.configuration.withCredentials,headers:a,observe:e,reportProgress:n})}dbStatus(t,e="body",n=!1,i){const r=t.token;let s=new zv({encoder:this.encoder});null!=r&&(s=this.addToHttpParams(s,r,"token"));let o=this.defaultHeaders,a=i&&i.httpHeaderAccept;void 0===a&&(a=this.configuration.selectHeaderAccept(["application/json"])),void 0!==a&&(o=o.set("Accept",a));let l=i&&i.context;void 0===l&&(l=new Uv);let c="json";return a&&(c=a.startsWith("text")?"text":this.configuration.isJsonMime(a)?"json":"blob"),this.httpClient.get(`${this.configuration.basePath}/db-status`,{context:l,params:s,responseType:c,withCredentials:this.configuration.withCredentials,headers:o,observe:e,reportProgress:n})}getSpatialPlacement(t,e="body",n=!1,i){const r=t.getSpatialPlacementRequest;if(null==r)throw new Error("Required parameter getSpatialPlacementRequest was null or undefined when calling getSpatialPlacement.");let s=this.defaultHeaders,o=i&&i.httpHeaderAccept;void 0===o&&(o=this.configuration.selectHeaderAccept(["application/json"])),void 0!==o&&(s=s.set("Accept",o));let a=i&&i.context;void 0===a&&(a=new Uv);const l=this.configuration.selectHeaderContentType(["application/json"]);void 0!==l&&(s=s.set("Content-Type",l));let c="json";return o&&(c=o.startsWith("text")?"text":this.configuration.isJsonMime(o)?"json":"blob"),this.httpClient.post(`${this.configuration.basePath}/get-spatial-placement`,r,{context:a,responseType:c,withCredentials:this.configuration.withCredentials,headers:s,observe:e,reportProgress:n})}gtexRuiLocations(t,e="body",n=!1,i){const r=t.cache;let s=new zv({encoder:this.encoder});null!=r&&(s=this.addToHttpParams(s,r,"cache"));let o=this.defaultHeaders,a=i&&i.httpHeaderAccept;void 0===a&&(a=this.configuration.selectHeaderAccept(["application/json"])),void 0!==a&&(o=o.set("Accept",a));let l=i&&i.context;void 0===l&&(l=new Uv);let c="json";return a&&(c=a.startsWith("text")?"text":this.configuration.isJsonMime(a)?"json":"blob"),this.httpClient.get(`${this.configuration.basePath}/gtex/rui_locations.jsonld`,{context:l,params:s,responseType:c,withCredentials:this.configuration.withCredentials,headers:o,observe:e,reportProgress:n})}hubmapRuiLocations(t,e="body",n=!1,i){const r=t.cache,s=t.token;let o=new zv({encoder:this.encoder});null!=r&&(o=this.addToHttpParams(o,r,"cache")),null!=s&&(o=this.addToHttpParams(o,s,"token"));let a=this.defaultHeaders,l=i&&i.httpHeaderAccept;void 0===l&&(l=this.configuration.selectHeaderAccept(["application/json"])),void 0!==l&&(a=a.set("Accept",l));let c=i&&i.context;void 0===c&&(c=new Uv);let u="json";return l&&(u=l.startsWith("text")?"text":this.configuration.isJsonMime(l)?"json":"blob"),this.httpClient.get(`${this.configuration.basePath}/hubmap/rui_locations.jsonld`,{context:c,params:o,responseType:u,withCredentials:this.configuration.withCredentials,headers:a,observe:e,reportProgress:n})}ontologyTermOccurences(t,e="body",n=!1,i){const r=t.age,s=t.ageRange,o=t.bmi,a=t.bmiRange,l=t.cache,c=t.ontologyTerms,u=t.cellTypeTerms,h=t.providers,d=t.sex,p=t.spatial,f=t.technologies,g=t.token;let m=new zv({encoder:this.encoder});null!=r&&(m=this.addToHttpParams(m,r,"age")),null!=s&&(m=this.addToHttpParams(m,s,"age-range")),null!=o&&(m=this.addToHttpParams(m,o,"bmi")),null!=a&&(m=this.addToHttpParams(m,a,"bmi-range")),null!=l&&(m=this.addToHttpParams(m,l,"cache")),c&&c.forEach(t=>{m=this.addToHttpParams(m,t,"ontology-terms")}),u&&u.forEach(t=>{m=this.addToHttpParams(m,t,"cell-type-terms")}),h&&h.forEach(t=>{m=this.addToHttpParams(m,t,"providers")}),null!=d&&(m=this.addToHttpParams(m,d,"sex")),p&&p.forEach(t=>{m=this.addToHttpParams(m,t,"spatial")}),f&&f.forEach(t=>{m=this.addToHttpParams(m,t,"technologies")}),null!=g&&(m=this.addToHttpParams(m,g,"token"));let b=this.defaultHeaders,y=i&&i.httpHeaderAccept;void 0===y&&(y=this.configuration.selectHeaderAccept(["application/json"])),void 0!==y&&(b=b.set("Accept",y));let v=i&&i.context;void 0===v&&(v=new Uv);let _="json";return y&&(_=y.startsWith("text")?"text":this.configuration.isJsonMime(y)?"json":"blob"),this.httpClient.get(`${this.configuration.basePath}/ontology-term-occurences`,{context:v,params:m,responseType:_,withCredentials:this.configuration.withCredentials,headers:b,observe:e,reportProgress:n})}ontologyTreeModel(t,e="body",n=!1,i){const r=t.cache,s=t.token;let o=new zv({encoder:this.encoder});null!=r&&(o=this.addToHttpParams(o,r,"cache")),null!=s&&(o=this.addToHttpParams(o,s,"token"));let a=this.defaultHeaders,l=i&&i.httpHeaderAccept;void 0===l&&(l=this.configuration.selectHeaderAccept(["application/json"])),void 0!==l&&(a=a.set("Accept",l));let c=i&&i.context;void 0===c&&(c=new Uv);let u="json";return l&&(u=l.startsWith("text")?"text":this.configuration.isJsonMime(l)?"json":"blob"),this.httpClient.get(`${this.configuration.basePath}/ontology-tree-model`,{context:c,params:o,responseType:u,withCredentials:this.configuration.withCredentials,headers:a,observe:e,reportProgress:n})}providerNames(t,e="body",n=!1,i){const r=t.cache,s=t.token;let o=new zv({encoder:this.encoder});null!=r&&(o=this.addToHttpParams(o,r,"cache")),null!=s&&(o=this.addToHttpParams(o,s,"token"));let a=this.defaultHeaders,l=i&&i.httpHeaderAccept;void 0===l&&(l=this.configuration.selectHeaderAccept(["application/json"])),void 0!==l&&(a=a.set("Accept",l));let c=i&&i.context;void 0===c&&(c=new Uv);let u="json";return l&&(u=l.startsWith("text")?"text":this.configuration.isJsonMime(l)?"json":"blob"),this.httpClient.get(`${this.configuration.basePath}/provider-names`,{context:c,params:o,responseType:u,withCredentials:this.configuration.withCredentials,headers:a,observe:e,reportProgress:n})}referenceOrganScene(t,e="body",n=!1,i){const r=t.organIri;if(null==r)throw new Error("Required parameter organIri was null or undefined when calling referenceOrganScene.");const s=t.age,o=t.ageRange,a=t.bmi,l=t.bmiRange,c=t.cache,u=t.ontologyTerms,h=t.cellTypeTerms,d=t.providers,p=t.sex,f=t.spatial,g=t.technologies,m=t.token;let b=new zv({encoder:this.encoder});null!=s&&(b=this.addToHttpParams(b,s,"age")),null!=o&&(b=this.addToHttpParams(b,o,"age-range")),null!=a&&(b=this.addToHttpParams(b,a,"bmi")),null!=l&&(b=this.addToHttpParams(b,l,"bmi-range")),null!=c&&(b=this.addToHttpParams(b,c,"cache")),u&&u.forEach(t=>{b=this.addToHttpParams(b,t,"ontology-terms")}),h&&h.forEach(t=>{b=this.addToHttpParams(b,t,"cell-type-terms")}),null!=r&&(b=this.addToHttpParams(b,r,"organ-iri")),d&&d.forEach(t=>{b=this.addToHttpParams(b,t,"providers")}),null!=p&&(b=this.addToHttpParams(b,p,"sex")),f&&f.forEach(t=>{b=this.addToHttpParams(b,t,"spatial")}),g&&g.forEach(t=>{b=this.addToHttpParams(b,t,"technologies")}),null!=m&&(b=this.addToHttpParams(b,m,"token"));let y=this.defaultHeaders,v=i&&i.httpHeaderAccept;void 0===v&&(v=this.configuration.selectHeaderAccept(["application/json"])),void 0!==v&&(y=y.set("Accept",v));let _=i&&i.context;void 0===_&&(_=new Uv);let w="json";return v&&(w=v.startsWith("text")?"text":this.configuration.isJsonMime(v)?"json":"blob"),this.httpClient.get(`${this.configuration.basePath}/reference-organ-scene`,{context:_,params:b,responseType:w,withCredentials:this.configuration.withCredentials,headers:y,observe:e,reportProgress:n})}referenceOrgans(t,e="body",n=!1,i){const r=t.cache,s=t.token;let o=new zv({encoder:this.encoder});null!=r&&(o=this.addToHttpParams(o,r,"cache")),null!=s&&(o=this.addToHttpParams(o,s,"token"));let a=this.defaultHeaders,l=i&&i.httpHeaderAccept;void 0===l&&(l=this.configuration.selectHeaderAccept(["application/json"])),void 0!==l&&(a=a.set("Accept",l));let c=i&&i.context;void 0===c&&(c=new Uv);let u="json";return l&&(u=l.startsWith("text")?"text":this.configuration.isJsonMime(l)?"json":"blob"),this.httpClient.get(`${this.configuration.basePath}/reference-organs`,{context:c,params:o,responseType:u,withCredentials:this.configuration.withCredentials,headers:a,observe:e,reportProgress:n})}scene(t,e="body",n=!1,i){const r=t.age,s=t.ageRange,o=t.bmi,a=t.bmiRange,l=t.cache,c=t.ontologyTerms,u=t.cellTypeTerms,h=t.providers,d=t.sex,p=t.spatial,f=t.technologies,g=t.token;let m=new zv({encoder:this.encoder});null!=r&&(m=this.addToHttpParams(m,r,"age")),null!=s&&(m=this.addToHttpParams(m,s,"age-range")),null!=o&&(m=this.addToHttpParams(m,o,"bmi")),null!=a&&(m=this.addToHttpParams(m,a,"bmi-range")),null!=l&&(m=this.addToHttpParams(m,l,"cache")),c&&c.forEach(t=>{m=this.addToHttpParams(m,t,"ontology-terms")}),u&&u.forEach(t=>{m=this.addToHttpParams(m,t,"cell-type-terms")}),h&&h.forEach(t=>{m=this.addToHttpParams(m,t,"providers")}),null!=d&&(m=this.addToHttpParams(m,d,"sex")),p&&p.forEach(t=>{m=this.addToHttpParams(m,t,"spatial")}),f&&f.forEach(t=>{m=this.addToHttpParams(m,t,"technologies")}),null!=g&&(m=this.addToHttpParams(m,g,"token"));let b=this.defaultHeaders,y=i&&i.httpHeaderAccept;void 0===y&&(y=this.configuration.selectHeaderAccept(["application/json"])),void 0!==y&&(b=b.set("Accept",y));let v=i&&i.context;void 0===v&&(v=new Uv);let _="json";return y&&(_=y.startsWith("text")?"text":this.configuration.isJsonMime(y)?"json":"blob"),this.httpClient.get(`${this.configuration.basePath}/scene`,{context:v,params:m,responseType:_,withCredentials:this.configuration.withCredentials,headers:b,observe:e,reportProgress:n})}sparql(t,e="body",n=!1,i){const r=t.query;if(null==r)throw new Error("Required parameter query was null or undefined when calling sparql.");const s=t.token,o=t.format;let a=new zv({encoder:this.encoder});null!=r&&(a=this.addToHttpParams(a,r,"query")),null!=s&&(a=this.addToHttpParams(a,s,"token")),null!=o&&(a=this.addToHttpParams(a,o,"format"));let l=this.defaultHeaders,c=i&&i.httpHeaderAccept;void 0===c&&(c=this.configuration.selectHeaderAccept(["application/json"])),void 0!==c&&(l=l.set("Accept",c));let u=i&&i.context;void 0===u&&(u=new Uv);let h="json";return c&&(h=c.startsWith("text")?"text":this.configuration.isJsonMime(c)?"json":"blob"),this.httpClient.get(`${this.configuration.basePath}/sparql`,{context:u,params:a,responseType:h,withCredentials:this.configuration.withCredentials,headers:l,observe:e,reportProgress:n})}sparqlPost(t,e="body",n=!1,i){const r=t.sparqlQueryRequest;if(null==r)throw new Error("Required parameter sparqlQueryRequest was null or undefined when calling sparqlPost.");const s=t.token,o=t.format;let a=new zv({encoder:this.encoder});null!=s&&(a=this.addToHttpParams(a,s,"token")),null!=o&&(a=this.addToHttpParams(a,o,"format"));let l=this.defaultHeaders,c=i&&i.httpHeaderAccept;void 0===c&&(c=this.configuration.selectHeaderAccept(["application/json"])),void 0!==c&&(l=l.set("Accept",c));let u=i&&i.context;void 0===u&&(u=new Uv);const h=this.configuration.selectHeaderContentType(["application/json","application/x-www-form-urlencoded"]);void 0!==h&&(l=l.set("Content-Type",h));let d="json";return c&&(d=c.startsWith("text")?"text":this.configuration.isJsonMime(c)?"json":"blob"),this.httpClient.post(`${this.configuration.basePath}/sparql`,r,{context:u,params:a,responseType:d,withCredentials:this.configuration.withCredentials,headers:l,observe:e,reportProgress:n})}technologyNames(t,e="body",n=!1,i){const r=t.cache,s=t.token;let o=new zv({encoder:this.encoder});null!=r&&(o=this.addToHttpParams(o,r,"cache")),null!=s&&(o=this.addToHttpParams(o,s,"token"));let a=this.defaultHeaders,l=i&&i.httpHeaderAccept;void 0===l&&(l=this.configuration.selectHeaderAccept(["application/json"])),void 0!==l&&(a=a.set("Accept",l));let c=i&&i.context;void 0===c&&(c=new Uv);let u="json";return l&&(u=l.startsWith("text")?"text":this.configuration.isJsonMime(l)?"json":"blob"),this.httpClient.get(`${this.configuration.basePath}/technology-names`,{context:c,params:o,responseType:u,withCredentials:this.configuration.withCredentials,headers:a,observe:e,reportProgress:n})}tissueBlocks(t,e="body",n=!1,i){const r=t.age,s=t.ageRange,o=t.bmi,a=t.bmiRange,l=t.cache,c=t.ontologyTerms,u=t.cellTypeTerms,h=t.providers,d=t.sex,p=t.spatial,f=t.technologies,g=t.token;let m=new zv({encoder:this.encoder});null!=r&&(m=this.addToHttpParams(m,r,"age")),null!=s&&(m=this.addToHttpParams(m,s,"age-range")),null!=o&&(m=this.addToHttpParams(m,o,"bmi")),null!=a&&(m=this.addToHttpParams(m,a,"bmi-range")),null!=l&&(m=this.addToHttpParams(m,l,"cache")),c&&c.forEach(t=>{m=this.addToHttpParams(m,t,"ontology-terms")}),u&&u.forEach(t=>{m=this.addToHttpParams(m,t,"cell-type-terms")}),h&&h.forEach(t=>{m=this.addToHttpParams(m,t,"providers")}),null!=d&&(m=this.addToHttpParams(m,d,"sex")),p&&p.forEach(t=>{m=this.addToHttpParams(m,t,"spatial")}),f&&f.forEach(t=>{m=this.addToHttpParams(m,t,"technologies")}),null!=g&&(m=this.addToHttpParams(m,g,"token"));let b=this.defaultHeaders,y=i&&i.httpHeaderAccept;void 0===y&&(y=this.configuration.selectHeaderAccept(["application/json"])),void 0!==y&&(b=b.set("Accept",y));let v=i&&i.context;void 0===v&&(v=new Uv);let _="json";return y&&(_=y.startsWith("text")?"text":this.configuration.isJsonMime(y)?"json":"blob"),this.httpClient.get(`${this.configuration.basePath}/tissue-blocks`,{context:v,params:m,responseType:_,withCredentials:this.configuration.withCredentials,headers:b,observe:e,reportProgress:n})}}return t.\u0275fac=function(e){return new(e||t)(Ei(Jv),Ei(JW,8),Ei(tq,8))},t.\u0275prov=xt({factory:function(){return new t(Ei(Jv),Ei(JW,8),Ei(tq,8))},token:t,providedIn:"root"}),t})(),nq=(()=>{class t{constructor(t,e){if(t)throw new Error("CcfApiModule is already loaded. Import in your base AppModule only.");if(!e)throw new Error("You need to import the HttpClientModule in your AppModule! \nSee also https://github.com/angular/angular/issues/20575")}static forRoot(e){return{ngModule:t,providers:[{provide:tq,useFactory:e}]}}}return t.\u0275fac=function(e){return new(e||t)(Ei(t,12),Ei(Jv,8))},t.\u0275mod=ie({type:t}),t.\u0275inj=St({providers:[],imports:[[]]}),t})();function iq(t){return new Promise((e,n)=>{t.oncomplete=t.onsuccess=()=>e(t.result),t.onabort=t.onerror=()=>n(t.error)})}let rq;function sq(){return rq||(rq=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),iq(t)});return(t,i)=>n.then(n=>i(n.transaction(e,t).objectStore(e)))}(0,"keyval")),rq}function oq(t,e=sq()){return e("readonly",e=>iq(e.get(t)))}var aq=n(71440);const lq="Unknown Euler angle order",cq=.99999;class uq extends rC{static get ZYX(){return 0}static get YXZ(){return 1}static get XZY(){return 2}static get ZXY(){return 3}static get YZX(){return 4}static get XYZ(){return 5}static get RollPitchYaw(){return 0}static get DefaultOrder(){return uq.ZYX}static get RotationOrders(){return["ZYX","YXZ","XZY","ZXY","YZX","XYZ"]}static rotationOrder(t){return uq.RotationOrders[t]}get ELEMENTS(){return 4}constructor(t=0,e=0,n=0,i=uq.DefaultOrder){super(-0,-0,-0,-0),arguments.length>0&&Array.isArray(arguments[0])?this.fromVector3(...arguments):this.set(t,e,n,i)}fromQuaternion(t){const[e,n,i,r]=t,s=n*n,o=-2*(s+i*i)+1,a=2*(e*n+r*i);let l=-2*(e*i-r*n);l=l>1?1:l,l=l<-1?-1:l;const c=Math.atan2(2*(n*i+r*e),-2*(e*e+s)+1),u=Math.asin(l),h=Math.atan2(a,o);return new uq(c,u,h,uq.RollPitchYaw)}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=Number.isFinite(t[3])||this.order,this.check()}set(t=0,e=0,n=0,i){return this[0]=t,this[1]=e,this[2]=n,this[3]=Number.isFinite(i)?i:this[3],this.check()}validate(){return function(t){return t>=0&&t<6}(this[3])&&Number.isFinite(this[0])&&Number.isFinite(this[1])&&Number.isFinite(this[2])}toArray(t=[],e=0){return t[e]=this[0],t[e+1]=this[1],t[e+2]=this[2],t}toArray4(t=[],e=0){return t[e]=this[0],t[e+1]=this[1],t[e+2]=this[2],t[e+3]=this[3],t}toVector3(t=[-0,-0,-0]){return t[0]=this[0],t[1]=this[1],t[2]=this[2],t}get x(){return this[0]}set x(t){this[0]=sC(t)}get y(){return this[1]}set y(t){this[1]=sC(t)}get z(){return this[2]}set z(t){this[2]=sC(t)}get alpha(){return this[0]}set alpha(t){this[0]=sC(t)}get beta(){return this[1]}set beta(t){this[1]=sC(t)}get gamma(){return this[2]}set gamma(t){this[2]=sC(t)}get phi(){return this[0]}set phi(t){this[0]=sC(t)}get theta(){return this[1]}set theta(t){this[1]=sC(t)}get psi(){return this[2]}set psi(t){this[2]=sC(t)}get roll(){return this[0]}set roll(t){this[0]=sC(t)}get pitch(){return this[1]}set pitch(t){this[1]=sC(t)}get yaw(){return this[2]}set yaw(t){this[2]=sC(t)}get order(){return this[3]}set order(t){this[3]=function(t){if(t<0&&t>=6)throw new Error(lq);return t}(t)}fromVector3(t,e){return this.set(t[0],t[1],t[2],Number.isFinite(e)?e:this[3])}fromArray(t,e=0){return this[0]=t[0+e],this[1]=t[1+e],this[2]=t[2+e],void 0!==t[3]&&(this[3]=t[3]),this.check()}fromRollPitchYaw(t,e,n){return this.set(t,e,n,uq.ZYX)}fromRotationMatrix(t,e=uq.DefaultOrder){return this._fromRotationMatrix(t,e),this.check()}getRotationMatrix(t){return this._getRotationMatrix(t)}getQuaternion(){const t=new $N;switch(this[4]){case uq.XYZ:return t.rotateX(this[0]).rotateY(this[1]).rotateZ(this[2]);case uq.YXZ:return t.rotateY(this[0]).rotateX(this[1]).rotateZ(this[2]);case uq.ZXY:return t.rotateZ(this[0]).rotateX(this[1]).rotateY(this[2]);case uq.ZYX:return t.rotateZ(this[0]).rotateY(this[1]).rotateX(this[2]);case uq.YZX:return t.rotateY(this[0]).rotateZ(this[1]).rotateX(this[2]);case uq.XZY:return t.rotateX(this[0]).rotateZ(this[1]).rotateY(this[2]);default:throw new Error(lq)}}_fromRotationMatrix(t,e=uq.DefaultOrder){const n=t.elements,i=n[0],r=n[4],s=n[8],o=n[1],a=n[5],l=n[9],c=n[2],u=n[6],h=n[10];switch(e=e||this[3]){case uq.XYZ:this[1]=Math.asin(tC(s,-1,1)),Math.abs(s)1&&void 0!==arguments[1]?arguments[1]:0,n=(_q[t[e+0]]+_q[t[e+1]]+_q[t[e+2]]+_q[t[e+3]]+"-"+_q[t[e+4]]+_q[t[e+5]]+"-"+_q[t[e+6]]+_q[t[e+7]]+"-"+_q[t[e+8]]+_q[t[e+9]]+"-"+_q[t[e+10]]+_q[t[e+11]]+_q[t[e+12]]+_q[t[e+13]]+_q[t[e+14]]+_q[t[e+15]]).toLowerCase();if(!vq(n))throw TypeError("Stringified UUID is invalid");return n}(i)},Sq=n(31609);const Cq=Object.freeze({OUTSIDE:-1,INTERSECTING:0,INSIDE:1}),Eq=(Math,Math,{});function Oq(t,{precision:e=Eq.precision||4}={}){return t=function(t){return Math.round(t/Eq.EPSILON)*Eq.EPSILON}(t),"".concat(parseFloat(t.toPrecision(e)))}function Tq(t){return Array.isArray(t)||ArrayBuffer.isView(t)&&!(t instanceof DataView)}function kq(t,e,n){const i=Eq.EPSILON;n&&(Eq.EPSILON=n);try{if(t===e)return!0;if(Tq(t)&&Tq(e)){if(t.length!==e.length)return!1;for(let n=0;n0?", ":"")+Oq(this[n],t);return"".concat(t.printTypes?this.constructor.name:"","[").concat(e,"]")}equals(t){if(!t||this.length!==t.length)return!1;for(let e=0;e=0&&t=0&&t=s+i)return this.clone();if(i>=s+n)return t.clone();const o=.5*(n+s+i);return Vq.copy(r).scale((-n+o)/s).add(e),this.center.copy(Vq),this.radius=o,this}expand(t){const e=(t=Bq.from(t)).subtract(this.center).magnitude();return e>this.radius&&(this.radius=e),this}transform(t){this.center.transform(t);const e=function(t,e){var n=e[4],i=e[5],r=e[6],s=e[8],o=e[9],a=e[10];return t[0]=Math.hypot(e[0],e[1],e[2]),t[1]=Math.hypot(n,i,r),t[2]=Math.hypot(s,o,a),t}(Bq,t);return this.radius=Math.max(e[0],Math.max(e[1],e[2]))*this.radius,this}distanceSquaredTo(t){const e=this.distanceTo(t);return e*e}distanceTo(t){const e=(t=Bq.from(t)).subtract(this.center);return Math.max(0,e.len()-this.radius)}intersectPlane(t){const e=this.radius,n=t.normal.dot(this.center)+t.distance;return n<-e?Cq.OUTSIDE:n0?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 kN(this,this,t),this.check()}rotateY(t){return PN(this,this,t),this.check()}rotateZ(t){return AN(this,this,t),this.check()}scale(t){return jN(this,this,t),this.check()}slerp(t,e,n){switch(arguments.length){case 1:({start:t=Xq,target:e,ratio:n}=arguments[0]);break;case 2:[e,n]=arguments,t=this}return IN(this,t,e,n),this.check()}transformVector4(t,e=t){return CT(e,t,this),Iq(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)}}const Kq=new Fq,Qq=new Fq,Zq=new Fq,Jq=new Fq,tX=new Fq,eX=new Fq,nX=new Fq;class iX{constructor(t=[0,0,0],e=[0,0,0,0,0,0,0,0,0]){this.center=(new Fq).from(t),this.halfAxes=new qq(e)}get halfSize(){const t=this.halfAxes.getColumn(0),e=this.halfAxes.getColumn(1),n=this.halfAxes.getColumn(2);return[new Fq(t).len(),new Fq(e).len(),new Fq(n).len()]}get quaternion(){const t=this.halfAxes.getColumn(0),e=this.halfAxes.getColumn(1),n=this.halfAxes.getColumn(2),i=new Fq(t).normalize(),r=new Fq(e).normalize(),s=new Fq(n).normalize();return(new Yq).fromMatrix3(new qq([...i,...r,...s]))}fromCenterHalfSizeQuaternion(t,e,n){const i=new Yq(n),r=(new qq).fromQuaternion(i);return r[0]=r[0]*e[0],r[1]=r[1]*e[0],r[2]=r[2]*e[0],r[3]=r[3]*e[1],r[4]=r[4]*e[1],r[5]=r[5]*e[1],r[6]=r[6]*e[2],r[7]=r[7]*e[2],r[8]=r[8]*e[2],this.center=(new Fq).from(t),this.halfAxes=r,this}clone(){return new iX(this.center,this.halfAxes)}equals(t){return this===t||Boolean(t)&&this.center.equals(t.center)&&this.halfAxes.equals(t.halfAxes)}getBoundingSphere(t=new zq){const e=this.halfAxes,n=e.getColumn(0,Zq),i=e.getColumn(1,Jq),r=e.getColumn(2,tX),s=Kq.copy(n).add(i).add(r);return t.center.copy(this.center),t.radius=s.magnitude(),t}intersectPlane(t){const e=this.center,n=t.normal,i=this.halfAxes,r=n.x,s=n.y,o=n.z,a=Math.abs(r*i[0]+s*i[1]+o*i[2])+Math.abs(r*i[3]+s*i[4]+o*i[5])+Math.abs(r*i[6]+s*i[7]+o*i[8]),l=n.dot(e)+t.distance;return l<=-a?Cq.OUTSIDE:l>=a?Cq.INSIDE:Cq.INTERSECTING}distanceTo(t){return Math.sqrt(this.distanceSquaredTo(t))}distanceSquaredTo(t){const e=Qq.from(t).subtract(this.center),n=this.halfAxes,i=n.getColumn(0,Zq),r=n.getColumn(1,Jq),s=n.getColumn(2,tX),o=i.magnitude(),a=r.magnitude(),l=s.magnitude();i.normalize(),r.normalize(),s.normalize();let c,u=0;return c=Math.abs(e.dot(i))-o,c>0&&(u+=c*c),c=Math.abs(e.dot(r))-a,c>0&&(u+=c*c),c=Math.abs(e.dot(s))-l,c>0&&(u+=c*c),u}computePlaneDistances(t,e,n=[-0,-0]){let i=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY;const s=this.center,o=this.halfAxes,a=o.getColumn(0,Zq),l=o.getColumn(1,Jq),c=o.getColumn(2,tX),u=eX.copy(a).add(l).add(c).add(s),h=nX.copy(u).subtract(t);let d=e.dot(h);return i=Math.min(d,i),r=Math.max(d,r),u.copy(s).add(a).add(l).subtract(c),h.copy(u).subtract(t),d=e.dot(h),i=Math.min(d,i),r=Math.max(d,r),u.copy(s).add(a).subtract(l).add(c),h.copy(u).subtract(t),d=e.dot(h),i=Math.min(d,i),r=Math.max(d,r),u.copy(s).add(a).subtract(l).subtract(c),h.copy(u).subtract(t),d=e.dot(h),i=Math.min(d,i),r=Math.max(d,r),s.copy(u).subtract(a).add(l).add(c),h.copy(u).subtract(t),d=e.dot(h),i=Math.min(d,i),r=Math.max(d,r),s.copy(u).subtract(a).add(l).subtract(c),h.copy(u).subtract(t),d=e.dot(h),i=Math.min(d,i),r=Math.max(d,r),s.copy(u).subtract(a).subtract(l).add(c),h.copy(u).subtract(t),d=e.dot(h),i=Math.min(d,i),r=Math.max(d,r),s.copy(u).subtract(a).subtract(l).subtract(c),h.copy(u).subtract(t),d=e.dot(h),i=Math.min(d,i),r=Math.max(d,r),n[0]=i,n[1]=r,n}transform(t){this.center.transformAsPoint(t);const e=this.halfAxes.getColumn(0,Zq);e.transformAsPoint(t);const n=this.halfAxes.getColumn(1,Jq);n.transformAsPoint(t);const i=this.halfAxes.getColumn(2,tX);return i.transformAsPoint(t),this.halfAxes=new qq([...e,...n,...i]),this}getTransform(){throw new Error("not implemented")}}const rX=new Fq,sX=new Fq;class oX{constructor(t=[0,0,1],e=0){this.normal=new Fq,this.distance=-0,this.fromNormalDistance(t,e)}fromNormalDistance(t,e){return Pq(Number.isFinite(e)),this.normal.from(t).normalize(),this.distance=e,this}fromPointNormal(t,e){t=rX.from(t),this.normal.from(e).normalize();const n=-this.normal.dot(t);return this.distance=n,this}fromCoefficients(t,e,n,i){return this.normal.set(t,e,n),Pq(kq(this.normal.len(),1)),this.distance=i,this}clone(t){return new oX(this.normal,this.distance)}equals(t){return kq(this.distance,t.distance)&&kq(this.normal,t.normal)}getPointDistance(t){return this.normal.dot(t)+this.distance}transform(t){const e=sX.copy(this.normal).transformAsVector(t).normalize(),n=this.normal.scale(-this.distance).transform(t);return this.fromPointNormal(n,e)}projectPointOntoPlane(t,e=[0,0,0]){t=rX.from(t);const n=this.getPointDistance(t),i=sX.copy(this.normal).scale(n);return t.subtract(i).to(e)}}function*aX(t,e,n){for(const[i,r]of Object.entries(n))for(const n of(0,aq.readQuads)(t,e,i,null,null)){const t="Literal"===n.object.termType?(0,Sq.fromRdf)(n.object):n.object.id;yield[r,t]}}function lX(t,e,n,i){const r={"@id":e,"@type":n};for(const[s,o]of Object.entries(i))for(const e of(0,aq.readQuads)(t,r["@id"],s,null,null)){const t="Literal"===e.object.termType?(0,Sq.fromRdf)(e.object):e.object.id;r[o]=t}return r}new Fq([1,0,0]),new Fq([0,1,0]),new Fq([0,0,1]),new Fq,new Fq,new oX(new Fq(1,0,0),0),new Fq,new Fq,new Fq,new Fq,new Fq,new Fq,new Fq,new Fq,new Fq,new Fq,new Fq,new Fq,new Fq,new Fq,new Fq,new Fq,new Fq,Math,new qq,new qq,new qq,new qq,new qq,new Fq,new Fq,new Fq,new Fq,new Fq,new qq,new qq,new qq;const cX=aq.Util.prefixes({base:"http://purl.org/ccf/latest/ccf.owl#",ccf:"http://purl.org/ccf/",fma:"http://purl.org/sig/ont/fma/fma",obo:"http://purl.obolibrary.org/obo/",uberon:"http://purl.obolibrary.org/obo/UBERON_",cl:"http://purl.obolibrary.org/obo/CL_",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/",dcterms:"http://purl.org/dc/terms/"},aq.DataFactory),uX={x:cX("rdf"),type:cX("rdf")("type")},hX=(cX("rdfs"),cX("rdfs")("label"),cX("rdfs")("comment"),cX("rdfs")("isDefinedBy"),cX("rdfs")("seeAlso"),cX("ccf")),dX={id:cX("ccf")("has_registration_location"),label:cX("rdfs")("label"),description:cX("rdfs")("comment"),link:hX("url"),sex:hX("sex"),age:hX("age"),bmi:hX("bmi"),Male:aq.DataFactory.literal("Male"),Female:aq.DataFactory.literal("Female"),consortiumName:hX("consortium_name"),providerName:hX("tissue_provider_name"),providerUUID:hX("tissue_provider_uuid"),donor:hX("comes_from"),sections:hX("subdivided_into_sections"),datasets:hX("generates_dataset"),sampleType:hX("sample_type"),TissueBlock:aq.DataFactory.literal("Tissue Block"),TissueSection:aq.DataFactory.literal("Tissue Section"),NonStandard:aq.DataFactory.literal("Non-standard"),sectionCount:hX("section_count"),sectionSize:hX("section_size"),sectionUnits:hX("section_size_unit"),sectionNumber:hX("section_number"),spatialEntity:hX("has_registration_location"),ontologyTerms:hX("has_ontology_term"),cellTypeTerms:hX("has_cell_type_term"),technology:hX("technology"),thumbnail:hX("thumbnail")},pX={x:hX,base:cX("base"),ontologyNode:{label:hX("ccf_pref_label"),parent:hX("ccf_part_of"),children:hX("ccf_part_of"),rui_rank:hX("rui_rank"),synonymLabels:aq.DataFactory.namedNode("http://www.geneontology.org/formats/oboInOwl#hasExactSynonym")},asctb:{part_of:hX("ccf_part_of"),ct_is_a:hX("ccf_ct_isa"),located_in:hX("ccf_located_in"),characterizes:hX("ccf_characterizes")},spatial:{Female:cX("base")("VHFemale"),Male:cX("base")("VHMale"),BothSexes:cX("base")("VHBothSexes"),FemaleOrgans:cX("base")("VHFemaleOrgans"),MaleOrgans:cX("base")("VHMaleOrgans")},SpatialObjectReference:hX("spatial_object_reference"),SpatialEntity:hX("spatial_entity"),SpatialPlacement:hX("spatial_placement"),spatialObjectReference:{file:hX("file_url"),file_format:hX("file_format"),file_subpath:hX("file_subpath")},extractionSet:{label:cX("rdfs")("label"),rui_rank:hX("rui_rank")},spatialEntity:{label:cX("rdfs")("label"),description:cX("rdfs")("comment"),creator:cX("dcterms")("creator"),creator_first_name:hX("creator_first_name"),creator_last_name:hX("creator_last_name"),creator_orcid:hX("creator_orcid"),creation_date:cX("dcterms")("created"),updated_date:hX("updated_date"),ccf_annotations:hX("collides_with"),representation_of:hX("representation_of"),reference_organ:hX("has_reference_organ"),extraction_set_for:hX("extraction_set_for"),extraction_set:hX("has_extraction_set"),sex:hX("organ_owner_sex"),side:hX("organ_side"),rui_rank:hX("rui_rank"),slice_thickness:hX("slice_thickness"),slice_count:hX("slice_count"),x_dimension:hX("x_dimension"),y_dimension:hX("y_dimension"),z_dimension:hX("z_dimension"),dimension_units:hX("dimension_unit"),object:hX("has_object_reference")},spatialPlacement:{source:hX("placement_for"),target:hX("placement_relative_to"),placement_date:cX("dcterms")("created"),x_scaling:hX("x_scaling"),y_scaling:hX("y_scaling"),z_scaling:hX("z_scaling"),scaling_units:hX("scaling_unit"),x_rotation:hX("x_rotation"),y_rotation:hX("y_rotation"),z_rotation:hX("z_rotation"),w_rotation:hX("theta_rotation"),rotation_order:hX("rotation_order"),rotation_units:hX("rotation_unit"),x_translation:hX("x_translation"),y_translation:hX("y_translation"),z_translation:hX("z_translation"),translation_units:hX("translation_unit")}},fX={x:cX("uberon"),body:cX("uberon")("0013702")},gX={x:cX("cl"),cell:cX("cl")("0000000")},mX={x:cX("fma")},bX=(cX("lmha"),{body:fX.body,cell:gX.cell,respiratory_system:fX.x("0001004"),colon:fX.x("0001155"),left_lung:fX.x("0002168"),right_lung:fX.x("0002167"),left_bronchus:fX.x("0002178"),right_bronchus:fX.x("0002177"),kidney:fX.x("0002113"),ureter:fX.x("0000056"),eye:fX.x("0000970"),fallopian_tube:fX.x("0003889"),knee:fX.x("0001465"),ovary:fX.x("0000992"),trachea:fX.x("0003126"),aorta:fX.x("0000947"),blood:fX.x("0000178"),bone_marrow:fX.x("0002371"),male_reproductive_system:fX.x("0000079"),lymph_node:fX.x("0000029"),blood_vasculature:fX.x("0004537"),brain:fX.x("0000955"),eye_left:fX.x("0004548"),eye_right:mX.x("54449"),fallopian_tube_left:fX.x("0001303"),fallopian_tube_right:fX.x("0001302"),heart:fX.x("0000948"),kidney_left:fX.x("0004538"),kidney_right:fX.x("0004539"),knee_left:mX.x("24978"),knee_right:mX.x("24977"),large_intestine:fX.x("0000059"),liver:fX.x("0002107"),lungs:fX.x("0002048"),mesenteric_lymph_node:fX.x("0002509"),ovary_left:mX.x("7214"),ovary_right:mX.x("7213"),pancreas:fX.x("0001264"),pelvis:fX.x("0001270"),prostate_gland:fX.x("0002367"),skin:fX.x("0002097"),small_intestine:fX.x("0002108"),spleen:fX.x("0002106"),thymus:fX.x("0002370"),ureter_left:fX.x("0001223"),ureter_right:fX.x("0001222"),urinary_bladder:fX.x("0001255"),uterus:fX.x("0000995")});function yX(t){const e={};return Object.entries(t).forEach(([t,n])=>{e[n.id]=t}),e}const vX={spatialObjectReference:yX(pX.spatialObjectReference),spatialEntity:yX(pX.spatialEntity),spatialPlacement:yX(pX.spatialPlacement)};function _X(t,e){const n=lX(t,e,"ExtractionSet",vX.spatialEntity);return n.extractionSites=(0,gq.sortBy)(t.getSubjects(pX.spatialEntity.extraction_set,e,null).map(e=>wX(t,e.id)),["rui_rank"]),n}function wX(t,e){const n=lX(t,e,"SpatialEntity",vX.spatialEntity);return n.object&&(n.object=function(t,e){return lX(t,e,"SpatialObjectReference",vX.spatialObjectReference)}(t,n.object)),n.ccf_annotations&&(n.ccf_annotations=t.getObjects(e,pX.spatialEntity.ccf_annotations,null).map(t=>t.id)),t.forSubjects(t=>n.entityId=t.id,dX.spatialEntity,e,null),n}function xX(t,e){const n=lX(t,e,"SpatialPlacement",vX.spatialPlacement);return n.source&&(n.source=wX(t,n.source)),n.target&&(n.target=wX(t,n.target)),n}function SX(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(ZS),o=[n.x_scaling,n.y_scaling,n.z_scaling];return t.translate(r).rotateXYZ(s).scale(o)}class CX{constructor(t){this.db=t,this.createGraph()}createGraph(){this.graph=new dq.DirectedGraph;const t=this.db.store;t.forSubjects(t=>{this.addNode(t.id,"SpatialObjectReference")},uX.type,pX.SpatialObjectReference,null),t.forSubjects(t=>{this.addNode(t.id,"SpatialEntity")},uX.type,pX.SpatialEntity,null);const e={};for(const n of(0,aq.readQuads)(t,null,pX.spatialPlacement.source,null,null))e[n.subject.id]=n.object.id;for(const n of(0,aq.readQuads)(t,null,pX.spatialPlacement.target,null,null)){const t=e[n.subject.id];t&&this.addEdge(n.subject.id,t,n.object.id,"SpatialPlacement")}}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 VT(VT.IDENTITY);if(!this.graph.hasNode(t)||!this.graph.hasNode(e))return;const n=this.db.store,i=new VT(VT.IDENTITY),r=fq()(this.graph,t,e);if(r&&r.length>0){r.reverse();let t="";for(const e of r)t&&SX(i,xX(n,this.graph.getEdgeAttribute(e,t,"id"))),t=e;return i}}getSpatialPlacement(t,e){const n=this.graph.hasNode(t["@id"])?t["@id"]:void 0,i=(0,gq.get)(t,"placement[0]",(0,gq.get)(t,"placement",void 0));let r;if(i&&this.graph.hasNode(i.target)?(r=this.getTransformationMatrix(i.target,e),r&&(r=SX(r,i))):n&&(r=this.getTransformationMatrix(n,e)),r){const n=(new uq).fromRotationMatrix(r,uq.XYZ),i=r.getTranslation().map(t=>1e3*t),s=n.toVector3().map(JS),o=r.getScale().map(t=>t<1&&t>.999999?1:t);return{"@context":"https://hubmapconsortium.github.io/hubmap-ontology/ccf-context.jsonld","@id":`http://purl.org/ccf/1.5/${xq()}_placement`,"@type":"SpatialPlacement",source:t["@id"],target:e,placement_date:(new Date).toISOString().split("T")[0],x_scaling:o[0],y_scaling:o[1],z_scaling:o[2],scaling_units:"ratio",x_rotation:s[0],y_rotation:s[1],z_rotation:s[2],rotation_order:"XYZ",rotation_units:"degree",x_translation:i[0],y_translation:i[1],z_translation:i[2],translation_units:"millimeter"}}}}class EX{constructor(t){this.db=t}getSpatialEntity(t){return wX(this.db.store,t)}getExtractionSets(t){return function(t,e){return(0,gq.sortBy)(t.getSubjects(pX.spatialEntity.extraction_set_for,e,null).map(e=>_X(t,e.id)),["rui_rank"])}(this.db.store,t)}getExtractionSet(t){return _X(this.db.store,t)}getAnatomicalStructures(t){return function(t,e){return(0,gq.sortBy)(t.getSubjects(pX.spatialEntity.reference_organ,e,null).map(e=>wX(t,e.id)).filter(t=>t["@id"]!==e),["rui_rank"])}(this.db.store,t)}getReferenceOrgans(){return function(t){const e=[];return t.forEach(n=>{n.subject.id===n.object.id&&e.push(wX(t,n.subject.id))},null,pX.spatialEntity.reference_organ,null,null),(0,gq.sortBy)(e,["rui_rank"])}(this.db.store)}getReferenceBody(t){let e;switch(null==t?void 0:t.sex){case"Male":e=pX.spatial.Male.id;break;case"Female":e=pX.spatial.Female.id;break;case"Both":default:e=pX.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),n=[];let i=[...this.getReferenceOrganSets(t).map(t=>{const i="http://purl.obolibrary.org/obo/UBERON_0002097"===t.representation_of,r=this.getSceneNode(t,e,{color:[255,255,255,255],opacity:i?.5:.2,unpickable:!0,_lighting:"pbr",zoomBasedOpacity:!i});return i&&r?void n.push(r):r})];return n.length>0&&(i=[...n,...i]),(null==t?void 0:t.debug)&&(i=i.concat([this.getSceneNode(this.getSpatialEntity(pX.base("VHRightKidney").id),e,{color:[0,0,255,127.5],geometry:"wireframe"}),this.getSceneNode(this.getSpatialEntity(pX.base("VHLeftKidney").id),e,{color:[255,0,0,127.5],geometry:"wireframe"}),this.getSceneNode(this.getSpatialEntity(pX.base("VHSpleenCC1").id),e,{color:[0,255,0,127.5],geometry:"wireframe"}),this.getSceneNode(this.getSpatialEntity(pX.base("VHSpleenCC2").id),e,{color:[0,255,0,127.5],geometry:"wireframe"}),this.getSceneNode(this.getSpatialEntity(pX.base("VHSpleenCC3").id),e,{color:[0,255,0,127.5],geometry:"wireframe"})])),i.filter(t=>void 0!==t)}getReferenceOrganScene(t,e){var n,i;const r=void 0!==(null==e?void 0:e.sex)&&"both"!==(null===(n=null==e?void 0:e.sex)||void 0===n?void 0:n.toLowerCase()),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 VT(VT.IDENTITY).rotateX(ZS(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 OX="https://entity.api.hubmapconsortium.org/entities/",TX=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"]),kX={"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"},PX={"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","5c106f29-ea2d-11e9-85e8-0efb3ba9a670":"RTI-General Electric","301615f9-c870-11eb-a8dc-35ce3d8786fe":"TMC-UConn"},AX={"@base":"http://purl.org/ccf/latest/ccf-entity.owl#","@vocab":"http://purl.org/ccf/latest/ccf-entity.owl#",ccf:"http://purl.org/ccf/",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"},cellTypeTerms:{"@id":"has_cell_type_term","@type":"@id"},thumbnail:{"@id":"has_thumbnail"}};class MX{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,PX[t.group_uuid]||(PX[t.group_uuid]=t.group_name);const c=new Date(t.last_modified_timestamp).toLocaleDateString(),u=PX[t.group_uuid]||t.group_name,h=t.created_by_user_displayname;this["@id"]=OX+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,gq.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":OX+t.uuid,"@type":"Sample",label:`Registered ${i}, ${t.created_by_user_displayname}, ${PX[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=PX[t.group_uuid]||t.group_name,a=t.created_by_user_displayname,l=[...t.data_types,(0,gq.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":OX+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,gq.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=>TX.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(TX.has(t))return`assets/thumbnails/TMC-Vanderbilt/DR1/${t}`}}else if("07a29e4c-ed43-11e8-b56a-0e8017bdda58"===t.group_uuid){const e=kX[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,gq.toNumber)(r[1]));for(const u of(0,gq.get)(t,"metadata.organ_donor_data",(0,gq.get)(t,"metadata.living_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,gq.toNumber)(u.data_value):"Body mass index"===u.preferred_term&&(o=(0,gq.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=PX[t.group_uuid]||t.group_name;return{"@id":OX+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;let i,r=t.rui_location;if(r&&("string"==typeof r&&(r=JSON.parse(r)),r.alignment_id?console.log("Detected a deprecated rui_location",t.uuid):r["@id"]&&(i=r)),i){const t=null!==(n=(0,gq.get)(i,["placement","target"]))&&void 0!==n?n:"";t.startsWith("http://purl.org/ccf/latest/ccf.owl#VHSpleenCC")?(0,gq.set)(i,["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,gq.set)(i,["placement","target"],"Male"===e.sex?t.replace("#VH","#VHM")+"_Patch":t.replace("#VH","#VHF")+"_Patch")}return i}getTissueBlock(){return(0,gq.omit)(Object.assign({},this),["data","bad","donor"])}toJsonLd(){return Object.assign(Object.assign({},this.donor),{samples:[this.getTissueBlock()]})}}const IX=["uuid","entity_type","group_uuid","group_name","last_modified_timestamp","created_by_user_displayname","ancestors.entity_type","ancestors.description","ancestors.metadata.organ_donor_data.preferred_term","ancestors.metadata.organ_donor_data.data_value","ancestors.metadata.living_donor_data.preferred_term","ancestors.metadata.living_donor_data.data_value","ancestors.last_modified_timestamp","ancestors.group_uuid","ancestors.group_name","ancestors.created_by_user_displayname","ancestors.uuid","descendants.entity_type","descendants.ingest_metadata.metadata.tissue_id","descendants.last_modified_timestamp","descendants.group_uuid","descendants.group_name","descendants.created_by_user_displayname","descendants.uuid","descendants.data_types","descendants.ingest_metadata.metadata.assay_type","descendants.thumbnail_file","descendants.metadata.files.rel_path","rui_location","specimen_type"],DX={exists:{field:"rui_location"}};function RX(t,e,n){return JSON.stringify({version:!0,from:t,size:e,stored_fields:["*"],script_fields:{},docvalue_fields:[],query:null!=n?n:DX,_source:{includes:IX}})}function NX(t,e){return xw(this,void 0,void 0,function*(){try{const n=yield fetch(t,e);return n.ok?yield n.json():void 0}catch(n){return}})}function LX(t,e,n,i,r="",s=""){return xw(this,void 0,void 0,function*(){let o;if("static"===e?o=yield NX(t):"search-api"===e&&(o=yield function(t,e,n){return xw(this,void 0,void 0,function*(){const i=250,r=function(t){const e=new Headers;return e.append("Content-type","application/json"),t&&e.append("Authorization",`Bearer ${t}`),e}(e),s=RX(0,i,n),o=yield NX(t,{method:"POST",headers:r,body:s});if(!o)return;const a=o.hits.total.value;if(a<=i)return o;const l=[];for(let e=i;e!t))return;const u=c.map(t=>t.hits.hits);return Object.assign(Object.assign({},o),{hits:Object.assign(Object.assign({},o.hits),{hits:o.hits.hits.concat(...u)})})})}(t,i,n)),o)return function(t,e="",n="",i,r=!1){const s={},o=(0,gq.get)(t,"hits.hits",[]).map(t=>(0,gq.get)(t,"_source",{})).sort((t,e)=>t.uuid.localeCompare(e.uuid)).map(t=>new MX(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":AX},t)))),{"@context":AX,"@graph":a}}(o,r,s,i);console.warn(`Unable to load ${t} as HuBMAP Data`)})}function jX(t,e,n){const i=new Set;for(const r of e)for(const e of(0,aq.readQuads)(t,r,n,null,null))i.add(e.object.id);return i}const FX={[pX.spatialEntity.x_dimension.id]:"x",[pX.spatialEntity.y_dimension.id]:"y",[pX.spatialEntity.z_dimension.id]:"z"};function BX(t,e,n,i){const r=e.getTransformationMatrix(n,i);let s;if(r){const e=r.getTranslation(),i=function(t,e){const n=lX(t,e,"Dimensions",FX);return[n.x,n.y,n.z]}(t,n).map(t=>t/1e3/2),o=(new uq).fromRotationMatrix(r,uq.XYZ).toQuaternion().normalize().calculateW();s=(new iX).fromCenterHalfSizeQuaternion(e,i,o)}return s}function VX(t,e,n,i){const{x:r,y:s,z:o,radius:a,target:l}=i,c=new Set,u=a/1e3*(a/1e3);for(const h of n){const n=BX(t,e,h,l);n&&n.distanceSquaredTo([r,s,o].map(t=>t/1e3))<=u&&c.add(h)}return c}function zX(t,e,n){var i,r;const s=new Map,o=new Set;for(const c of e)for(const e of(0,aq.readQuads)(t,c,dX.donor,null,null))o.add(e.object.id),s.has(e.object.id)?null===(i=s.get(e.object.id))||void 0===i||i.push(c):s.set(e.object.id,[c]);const a=n(o),l=new Set;for(const c of a)for(const t of null!==(r=s.get(c))&&void 0!==r?r:[])l.add(t);return l}function UX(t,e,n){var i,r;const s=new Map,o=new Set;for(const c of e)for(const e of(0,aq.readQuads)(t,c,dX.spatialEntity,null,null))o.add(e.object.id),s.has(e.object.id)?null===(i=s.get(e.object.id))||void 0===i||i.push(c):s.set(e.object.id,[c]);const a=n(o),l=new Set;for(const c of a)for(const t of null!==(r=s.get(c))&&void 0!==r?r:[])l.add(t);return l}function HX(t,e){return function(n){t.has(n.id)&&e.add(n.id)}}function $X(t,e,n){const i=new Set;for(const r of n){const n=aq.DataFactory.namedNode(r);t.forSubjects(HX(e,i),pX.spatialEntity.ccf_annotations,n,null)}return i}function GX(t,e){const n=function(t,e){const n=new Map;for(const i of t)for(const t of(0,aq.readQuads)(e,i,dX.spatialEntity,null,null))n.has(t.object.id)?n.get(t.object.id).add(i):n.set(t.object.id,new Set([i]));return n}(t,e),i=new Map;for(const r of n.keys()){const t=n.get(r);for(const n of(0,aq.readQuads)(e,r,pX.spatialEntity.ccf_annotations,null,null))if(i.has(n.object.id)){const e=i.get(n.object.id);t.forEach(t=>e.add(t))}else i.set(n.object.id,new Set(t))}return i}function WX(t,e,n){const i={"@id":e,"@type":"OntologyTreeNode",id:e,parent:"",children:[],synonymLabels:[],label:""},r={[pX.ontologyNode.label.id]:"label",[n]:"parent",[pX.ontologyNode.synonymLabels.id]:"synonymLabels"};for(const[s,o]of aX(t,e,r))"synonymLabels"===s?i.synonymLabels.push(o):i[s]=o;return i.children=t.getSubjects(n,e,null).map(t=>t.id),i}function qX(t,e,n,i){const r={root:e,nodes:{}},s=new Set;for(const a of(0,aq.readQuads)(t,null,i,null,null))s.add(a.subject.id),s.add(a.object.id);for(const a of s)r.nodes[a]=WX(t,a,i);r.nodes[e]||(r.nodes[e]={"@id":e,"@type":"OntologyTreeNode",id:e,label:n,children:[],synonymLabels:[]});const o=t.getSubjects(i,e,null).map(t=>t.id).sort((t,e)=>r.nodes[t].label.localeCompare(r.nodes[e].label));return r.nodes[e].children=o,XX(r),r}function XX(t,e,n=new Set){const i=t.nodes[null!=e?e:t.root];if(i){i.children=i.children.filter(t=>!n.has(t)),i.children.forEach(t=>n.add(t));for(const e of i.children)XX(t,e,n),t.nodes[e]&&(t.nodes[e].parent=i["@id"])}}const YX=(0,gq.memoize)(function(t){const e=qX(t,bX.body.id,"body",pX.asctb.part_of.id);return e.nodes[bX.body.id].children=["http://purl.obolibrary.org/obo/UBERON_0000955","http://purl.obolibrary.org/obo/UBERON_0000029","http://purl.obolibrary.org/obo/UBERON_0000970","http://purl.obolibrary.org/obo/UBERON_0003889","http://purl.obolibrary.org/obo/UBERON_0000948","http://purl.obolibrary.org/obo/UBERON_0002113","http://purl.obolibrary.org/obo/UBERON_0001465","http://purl.obolibrary.org/obo/UBERON_0002107","http://purl.obolibrary.org/obo/UBERON_0002048","http://purl.obolibrary.org/obo/UBERON_0001911","http://purl.obolibrary.org/obo/UBERON_0000992","http://purl.obolibrary.org/obo/UBERON_0001264","http://purl.obolibrary.org/obo/UBERON_0001270","http://purl.obolibrary.org/obo/UBERON_0001987","http://purl.obolibrary.org/obo/UBERON_0002367","http://purl.obolibrary.org/obo/UBERON_0002097","http://purl.obolibrary.org/obo/UBERON_0002108","http://purl.obolibrary.org/obo/UBERON_0002240","http://purl.obolibrary.org/obo/UBERON_0000059","http://purl.obolibrary.org/obo/UBERON_0002106","http://purl.obolibrary.org/obo/UBERON_0002370","http://purl.obolibrary.org/obo/UBERON_0000056","http://purl.obolibrary.org/obo/UBERON_0001255","http://purl.obolibrary.org/obo/UBERON_0000995","http://purl.obolibrary.org/obo/UBERON_0004537"].filter(t=>t in e.nodes),e},()=>""),KX={[dX.label.id]:"label",[dX.description.id]:"description",[dX.link.id]:"link"},QX=Object.assign(Object.assign({},KX),{[dX.providerName.id]:"providerName"}),ZX=Object.assign(Object.assign({},KX),{[dX.technology.id]:"technology",[dX.thumbnail.id]:"thumbnail"}),JX=Object.assign(Object.assign({},KX),{[dX.sampleType.id]:"sampleType",[dX.sectionNumber.id]:"sectionNumber",[dX.datasets.id]:"datasets"}),tY=Object.assign(Object.assign({},KX),{[dX.sampleType.id]:"sampleType",[dX.sectionCount.id]:"sectionCount",[dX.sectionSize.id]:"sectionSize",[dX.sectionUnits.id]:"sectionUnits",[dX.donor.id]:"donor",[dX.spatialEntity.id]:"spatialEntityId",[dX.sections.id]:"sections",[dX.datasets.id]:"datasets"});function eY(t,e){return lX(t,e,"Donor",QX)}function nY(t,e){return lX(t,e,"Dataset",ZX)}function iY(t,e){const n={"@id":e,"@type":"Sample",datasets:[]};for(const[i,r]of aX(t,e,JX))if("datasets"===i){const e=nY(t,r);n[i].push(e)}else n[i]=r;return n}class rY{constructor(t){this.database=t,this.connect()}toJson(){return{status:this.status,message:this.message,checkback:"Ready"===this.status||"Error"===this.status?36e5:2e3,loadTime:this.loadTime}}connect(){this.status="Loading",this.message="Loading database";const t=Date.now();return this.database.connect().then(t=>xw(this,void 0,void 0,function*(){t?(this.message="Building scene",yield this.database.getScene(),this.message="Building tissue block results",yield this.database.getTissueBlockResults(),this.message="Aggregating results",yield this.database.getAggregateResults(),this.status="Ready",this.message="Database successfully loaded"):(this.status="Error",this.message="Unknown error while loading database")})).catch(t=>{var e;this.status="Error",this.message=null!==(e=null==t?void 0:t.message)&&void 0!==e?e:"Unknown error while loading database"}).finally(()=>{this.loadTime=Date.now()-t})}}const sY={"@context":{"@base":"http://purl.org/ccf/","@vocab":"http://purl.org/ccf/",ccf:"http://purl.org/ccf/",rdfs:"http://www.w3.org/2000/01/rdf-schema#",dcterms:"http://purl.org/dc/terms/",label:"rdfs:label",description:"rdfs:comment",link:"ccf:url",sex:"ccf:sex",age:"ccf:age",bmi:"ccf:bmi",consortium_name:"ccf:consortium_name",provider_name:"ccf:tissue_provider_name",provider_uuid:"ccf:tissue_provider_uuid",donor:{"@id":"ccf:comes_from","@type":"@id"},samples:{"@reverse":"donor"},sections:{"@id":"ccf:subdivided_into_sections","@type":"@id"},datasets:{"@id":"ccf:generates_dataset","@type":"@id"},sample_type:"ccf:sample_type",section_count:"ccf:section_count",section_size:"ccf:section_size",section_units:"ccf:section_size_unit",section_number:"ccf:section_number",rui_location:{"@id":"ccf:has_registration_location","@type":"@id"},ccf_annotations:{"@id":"ccf:collides_with","@type":"@id","@container":"@set"},representation_of:{"@id":"ccf:representation_of","@type":"@id"},reference_organ:{"@id":"ccf:has_reference_organ","@type":"@id"},extraction_set_for:{"@id":"ccf:extraction_set_for","@type":"@id"},extraction_set:{"@id":"ccf:has_extraction_set","@type":"@id"},organ_owner_sex:"ccf:organ_owner_sex",side:"ccf:organ_side",rui_rank:"ccf:rui_rank",slice_thickness:"ccf:slice_thickness",slice_count:"ccf:slice_count",object:{"@id":"ccf:has_object_reference","@type":"@id"},creation_date:"dcterms:created",updated_date:"ccf:updated_date",creator:"dcterms:creator",creator_first_name:"ccf:creator_first_name",creator_last_name:"ccf:creator_last_name",placement:{"@reverse":"ccf:placement_for"},placement_date:"dcterms:created",rotation_order:"ccf:rotation_order",dimension_units:"ccf:dimension_unit",rotation_units:"ccf:rotation_unit",scaling_units:"ccf:scaling_unit",translation_units:"ccf:translation_unit",source:{"@id":"ccf:placement_for","@type":"@id"},target:{"@id":"ccf:placement_relative_to","@type":"@id"},x_rotation:"ccf:x_rotation",y_rotation:"ccf:y_rotation",z_rotation:"ccf:z_rotation",x_scaling:"ccf:x_scaling",y_scaling:"ccf:y_scaling",z_scaling:"ccf:z_scaling",x_translation:"ccf:x_translation",y_translation:"ccf:y_translation",z_translation:"ccf:z_translation",x_dimension:"ccf:x_dimension",y_dimension:"ccf:y_dimension",z_dimension:"ccf:z_dimension",ontology_terms:{"@id":"ccf:has_ontology_term","@type":"@id"},technology:"ccf:technology",thumbnail:"ccf:thumbnail",file:"ccf:file_url",file_format:"ccf:file_format",file_subpath:"ccf:file_subpath"}};function oY(t){return JSON.parse(t,(t,e)=>"ccf_annotations"===t&&Array.isArray(e)?e.map(t=>(null==t?void 0:t.startsWith("http://purl.obolibrary.org/obo/FMA_"))?t.replace("http://purl.obolibrary.org/obo/FMA_","http://purl.org/sig/ont/fma/fma"):t):"@context"!==t||!e||"https://hubmapconsortium.github.io/hubmap-ontology/ccf-entity-context.jsonld"!==e&&"https://hubmapconsortium.github.io/hubmap-ontology/ccf-context.jsonld"!==e&&"https://hubmapconsortium.github.io/ccf-ontology/ccf-context.jsonld"!==e&&"http://purl.org/ccf/latest/ccf-entity.owl#"!==e["@base"]?e:sY)}const aY={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 lY{constructor(t=aY){this.options=t,this.store=new aq.Store(void 0,{factory:aq.DataFactory}),this.graph=new CX(this),this.scene=new EX(this)}connect(t,e=!1){return xw(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 xw(this,void 0,void 0,function*(){const t=(new Date).getTime(),e="ccf-database.last_modified",n="ccf-database",i=yield oq(e).catch(()=>{});let r;i&&t-new Date(+i).getTime()>36e5?yield function(t,e=sq()){return e("readwrite",e=>(t.forEach(t=>e.delete(t)),iq(e.transaction)))}([n,e]).catch(()=>{}):r=yield oq(n).catch(()=>{}),r?yield this.deserialize(r):(yield this.doConnect(),function(t,e=sq()){return e("readwrite",e=>(t.forEach(t=>e.put(t[1],t[0])),iq(e.transaction)))}([[n,this.serialize()],[e,""+t]]).catch(()=>{}))})}doConnect(){var t,e;return xw(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.startsWith("{"))this.store=(0,aq.deserializeN3Store)(r,aq.DataFactory);else 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,aq.deserializeN3Store)(t,aq.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(LX(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 xw(this,void 0,void 0,function*(){const n=null!=e?e:this.store;return yield Promise.all(t.map(t=>xw(this,void 0,void 0,function*(){"string"==typeof t?(t.startsWith("http")||t.startsWith("assets/"))&&t.includes("jsonld")?(t=oY(t=yield fetch(t).then(t=>t.text())),yield(0,aq.addJsonLdToStore)(t,n)):t.endsWith("n3")?yield(0,aq.addN3ToStore)(t,n):t.endsWith("rdf")||t.endsWith("owl")||t.endsWith("xml")?yield(0,aq.addRdfXmlToStore)(t,n):(t=oY(t),yield(0,aq.addJsonLdToStore)(t,n)):(t=oY(JSON.stringify(t)),yield(0,aq.addJsonLdToStore)(t,n))}))),this})}synchronize(){return xw(this,void 0,void 0,function*(){return yield new Promise(t=>{setTimeout(t,500)}),this.graph.createGraph(),function(t){var e,n,i;const r=YX(t),s=new Map;for(const{subject:o,object:a}of(0,aq.readQuads)(t,null,pX.spatialEntity.representation_of,null,null)){const t=new Set([a.id]);let i=null===(e=r.nodes[a.id])||void 0===e?void 0:e.parent;for(;i&&!t.has(i);)t.add(i),i=null===(n=r.nodes[i])||void 0===n?void 0:n.parent;s.set(o.id,[...t].map(t=>aq.DataFactory.namedNode(t)))}for(const{object:o}of(0,aq.readQuads)(t,null,dX.spatialEntity,null,null))for(const{subject:e}of(0,aq.readQuads)(t,null,pX.spatialPlacement.source,o,null))for(const{object:n}of(0,aq.readQuads)(t,e,pX.spatialPlacement.target,null,null))for(const e of null!==(i=s.get(n.id))&&void 0!==i?i:[])t.addQuad(aq.DataFactory.namedNode(o.id),pX.spatialEntity.ccf_annotations,e)}(this.store),this})}serialize(){return(0,aq.serializeN3Store)(this.store)}deserialize(t){return xw(this,void 0,void 0,function*(){this.store=(0,aq.deserializeN3Store)(t,aq.DataFactory),this.graph=new CX(this),this.scene=new EX(this),yield new Promise(t=>{setTimeout(t,10)})})}getIds(t={}){return function(t,e,n){var i,r,s,o,a,l,c;let u=function(t){const e=new Set;return t.forSubjects(t=>e.add(t.id),dX.spatialEntity,null,null),e}(t);if(u.size>0&&(u=function(t,e,n=!0){const i=new Set;if(t.forSubjects(HX(e,i),dX.spatialEntity,null,null),!n){const t=new Set;return e.forEach(e=>i.has(e)?void 0:t.add(e)),t}return i}(t,u)),u.size>0&&("Male"===n.sex||"Female"===n.sex)){const e=n.sex;u=zX(t,u,n=>function(t,e,n){const i=new Set;return t.forSubjects(HX(e,i),dX.sex,dX[n],null),i}(t,n,e))}if(u.size>0&&(null===(i=n.tmc)||void 0===i?void 0:i.length)>0&&(u=zX(t,u,e=>function(t,e,n){const i=new Set;for(const r of n){const n=aq.DataFactory.literal(r);t.forSubjects(HX(e,i),dX.providerName,n,null)}return i}(t,e,n.tmc))),u.size>0&&(null===(r=n.technologies)||void 0===r?void 0:r.length)>0&&(u=function(t,e,n){var i,r;const s=new Map,o=new Set,a=new Set(e);for(const u of e)for(const e of(0,aq.readQuads)(t,u,dX.sections,null,null))a.add(e.object.id);for(const u of a)for(const e of(0,aq.readQuads)(t,u,dX.datasets,null,null))o.add(e.object.id),s.has(e.object.id)?null===(i=s.get(e.object.id))||void 0===i||i.push(u):s.set(e.object.id,[u]);const l=n(o),c=new Set;for(const u of l)for(const t of null!==(r=s.get(u))&&void 0!==r?r:[])c.add(t);return c}(t,u,e=>function(t,e,n){const i=new Set;for(const r of n){const n=aq.DataFactory.literal(r);t.forSubjects(HX(e,i),dX.technology,n,null)}return i}(t,e,n.technologies))),u.size>0&&(null===(s=n.spatialSearches)||void 0===s?void 0:s.length)>0&&(u=UX(t,u,i=>function(t,e,n,i){const r=new Set;for(const s of i)VX(t,e,n,s).forEach(t=>r.add(t));return r}(t,e,i,n.spatialSearches))),u.size>0&&(null===(o=n.ontologyTerms)||void 0===o?void 0:o.length)>0){const e=n.ontologyTerms;-1===e.indexOf(bX.body.id)&&(u=UX(t,u,n=>$X(t,n,e)))}if(u.size>0&&(null===(a=n.cellTypeTerms)||void 0===a?void 0:a.length)>0){const e=n.cellTypeTerms;-1===e.indexOf(bX.cell.id)&&(u=UX(t,u,n=>function(t,e,n){const i=new Set;for(const r of n)t.forObjects(t=>{i.add(t.id)},r,pX.asctb.located_in,null),r===bX.cell.id&&i.add(bX.body.id);return $X(t,e,[...i])}(t,n,e)))}if(u.size>0&&2===(null===(l=n.ageRange)||void 0===l?void 0:l.length)&&(0,gq.isFinite)(n.ageRange[0])&&(0,gq.isFinite)(n.ageRange[1])){const e=Math.max(...n.ageRange),i=Math.min(...n.ageRange);1===i&&110===e||(u=zX(t,u,n=>function(t,e,n,i){const r=new Set;for(const s of e)for(const e of(0,aq.readQuads)(t,s,dX.age,null,null)){const t=(0,Sq.fromRdf)(e.object);t>=n&&t<=i&&r.add(s)}return r}(t,n,i,e)))}if(u.size>0&&2===(null===(c=n.bmiRange)||void 0===c?void 0:c.length)&&(0,gq.isFinite)(n.bmiRange[0])&&(0,gq.isFinite)(n.bmiRange[1])){const e=Math.max(...n.bmiRange),i=Math.min(...n.bmiRange);13===i&&83===e||(u=zX(t,u,n=>function(t,e,n,i){const r=new Set;for(const s of e)for(const e of(0,aq.readQuads)(t,s,dX.bmi,null,null)){const t=(0,Sq.fromRdf)(e.object);t>=n&&t<=i&&r.add(s)}return r}(t,n,i,e)))}return u}(this.store,this.graph,t)}get(t){return this.store.getQuads(aq.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=>function(t,e){const n=t.getObjects(aq.DataFactory.namedNode(e),dX.spatialEntity,null);if(n.length>0)return wX(t,n[0].id)}(this.store,t))}getDatabaseStatus(){return xw(this,void 0,void 0,function*(){return this.status||(this.status=new rY(this)),this.status.toJson()})}getDatasetTechnologyNames(){return xw(this,void 0,void 0,function*(){return function(t){const e=new Set;for(const n of(0,aq.readQuads)(t,null,dX.technology,null,null))e.add(n.object.value);return Array.from(e).sort()}(this.store)})}getProviderNames(){return xw(this,void 0,void 0,function*(){return function(t){const e=new Set;for(const n of(0,aq.readQuads)(t,null,dX.providerName,null,null))e.add(n.object.value);return Array.from(e).sort()}(this.store)})}getTissueBlockResults(t){return xw(this,void 0,void 0,function*(){return t=Object.assign(Object.assign({},t),{hasSpatialEntity:!0}),[...this.getIds(t)].map(t=>function(t,e){const n={"@id":e,"@type":"Sample",sections:[],datasets:[]};for(const[i,r]of aX(t,e,tY))if("sections"===i){const e=iY(t,r);n[i].push(e)}else if("datasets"===i){const e=nY(t,r);n[i].push(e)}else n[i]="donor"===i?eY(t,r):r;return n}(this.store,t))})}getAggregateResults(t){return xw(this,void 0,void 0,function*(){return function(t,e){const n=jX(e,t,dX.donor.id),i=jX(e,n,dX.providerUUID.id),r=new Set;for(const a of t)for(const t of(0,aq.readQuads)(e,a,dX.spatialEntity,null,null))r.add(t.subject.id);const s=jX(e,r,dX.sections.id),o=new Set([...jX(e,r,dX.datasets.id),...jX(e,s,dX.datasets.id)]);return 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 xw(this,void 0,void 0,function*(){return function(t,e){const n={};return GX(t,e).forEach((t,e)=>{n[e]=t.size}),n}(this.getIds(t),this.store)})}getCellTypeTermOccurences(t){return xw(this,void 0,void 0,function*(){return function(t,e){var n,i;const r=GX(t,e),s=new Map;for(const a of r.keys()){const t=r.get(a);for(const n of(0,aq.readQuads)(e,null,pX.asctb.located_in,a,null)){const e=n.subject.id;if(s.has(e)){const n=s.get(e);t.forEach(t=>n.add(t))}else s.set(e,new Set(t))}}const o={};return s.forEach((t,e)=>{o[e]=t.size}),o[bX.cell.id]=null!==(i=null===(n=r.get(bX.body.id))||void 0===n?void 0:n.size)&&void 0!==i?i:0,o}(this.getIds(t),this.store)})}getOntologyTreeModel(){return xw(this,void 0,void 0,function*(){return YX(this.store)})}getCellTypeTreeModel(){return xw(this,void 0,void 0,function*(){return function(t){return qX(t,bX.cell.id,"cell",pX.asctb.ct_is_a.id)}(this.store)})}getReferenceOrgans(){return xw(this,void 0,void 0,function*(){return this.scene.getReferenceOrgans()})}getScene(t){return xw(this,void 0,void 0,function*(){return this.graph.createGraph(),this.scene.getScene(t)})}getReferenceOrganScene(t,e){return xw(this,void 0,void 0,function*(){return this.graph.createGraph(),this.scene.getReferenceOrganScene(t,e)})}getSpatialPlacement(t,e){return xw(this,void 0,void 0,function*(){return this.graph.getSpatialPlacement(t,e)})}}const cY=[240,183,98,255],uY=[213,0,0,255],hY=[29,204,101,255],dY=[41,121,255,255],pY=[204,204,204,255],fY=[213,0,0,255],gY=[29,204,101,255],mY=[41,121,255,255];function bY(t,e=!1){const n=t.x_dimension/1e3,i=t.y_dimension/1e3,r=t.z_dimension/1e3,s=.05*Math.max(n,i,r),o=.1*s;return[{"@id":"http://purl.org/ccf/latest/ccf.owl#OriginSphere","@type":"SpatialSceneNode",unpickable:!0,geometry:"sphere",transformMatrix:new VT(VT.IDENTITY).scale(s),color:pY},{"@id":"http://purl.org/ccf/latest/ccf.owl#OriginX","@type":"SpatialSceneNode",unpickable:!0,geometry:"cylinder",transformMatrix:new VT(VT.IDENTITY).translate([n/2,0,0]).rotateZ(ZS(-90)).scale([o,n,o]),color:fY},{"@id":"http://purl.org/ccf/latest/ccf.owl#OriginXCone","@type":"SpatialSceneNode",unpickable:!0,geometry:"cone",transformMatrix:new VT(VT.IDENTITY).translate([n,0,0]).rotateZ(ZS(-90)).scale([s,3*s,s]),color:fY},{"@id":"http://purl.org/ccf/latest/ccf.owl#OriginXALabel","@type":"SpatialSceneNode",unpickable:!0,geometry:"text",text:"A",transformMatrix:new VT(VT.IDENTITY).translate([2*-s,0,0]).scale(s),color:fY},{"@id":"http://purl.org/ccf/latest/ccf.owl#OriginXDLabel","@type":"SpatialSceneNode",unpickable:!0,geometry:"text",text:"D",transformMatrix:new VT(VT.IDENTITY).translate([n+2*s,0,0]).scale(s),color:fY},{"@id":"http://purl.org/ccf/latest/ccf.owl#OriginY","@type":"SpatialSceneNode",unpickable:!0,geometry:"cylinder",transformMatrix:new VT(VT.IDENTITY).translate([0,i/2,0]).scale([o,i,o]),color:gY},{"@id":"http://purl.org/ccf/latest/ccf.owl#OriginYCone","@type":"SpatialSceneNode",unpickable:!0,geometry:"cone",transformMatrix:new VT(VT.IDENTITY).translate([0,i,0]).scale([s,3*s,s]),color:gY},{"@id":"http://purl.org/ccf/latest/ccf.owl#OriginYSLabel","@type":"SpatialSceneNode",unpickable:!0,geometry:"text",text:"S",transformMatrix:new VT(VT.IDENTITY).translate([1.5*s,1.5*s,0]).scale(s),color:gY},{"@id":"http://purl.org/ccf/latest/ccf.owl#OriginYWLabel","@type":"SpatialSceneNode",unpickable:!0,geometry:"text",text:"W",transformMatrix:new VT(VT.IDENTITY).translate([0,i+2*s,0]).scale(s),color:gY},{"@id":"http://purl.org/ccf/latest/ccf.owl#OriginZ","@type":"SpatialSceneNode",unpickable:!0,geometry:"cylinder",transformMatrix:new VT(VT.IDENTITY).translate([0,0,r/2]).rotateX(ZS(90)).scale([o,r,o]),color:mY},{"@id":"http://purl.org/ccf/latest/ccf.owl#OriginZCone","@type":"SpatialSceneNode",unpickable:!0,geometry:"cone",transformMatrix:new VT(VT.IDENTITY).translate([0,0,r]).rotateX(ZS(90)).scale([s,3*s,s]),color:mY},{"@id":"http://purl.org/ccf/latest/ccf.owl#OriginZQLabel","@type":"SpatialSceneNode",unpickable:!0,geometry:"text",text:"Q",transformMatrix:new VT(VT.IDENTITY).translate([1.5*s,1.5*-s,0]).scale(s),color:mY},{"@id":"http://purl.org/ccf/latest/ccf.owl#OriginZELabel","@type":"SpatialSceneNode",unpickable:!0,geometry:"text",text:"E",transformMatrix:new VT(VT.IDENTITY).translate([0,0,r+2*s]).scale(s),color:mY}].filter(t=>e&&"text"===t.geometry&&t.text||!t.text)}const yY=Symbol("Comlink.proxy"),vY=Symbol("Comlink.endpoint"),_Y=Symbol("Comlink.releaseProxy"),wY=Symbol("Comlink.thrown"),xY=t=>"object"==typeof t&&null!==t||"function"==typeof t,SY=new Map([["proxy",{canHandle:t=>xY(t)&&t[yY],serialize(t){const{port1:e,port2:n}=new MessageChannel;return CY(t,e),[n,[n]]},deserialize:t=>(t.start(),OY(t))}],["throw",{canHandle:t=>xY(t)&&wY 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 CY(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(DY);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]]=DY(i.data.value),l=!0;break;case"APPLY":l=n.apply(e,a);break;case"CONSTRUCT":l=function(t){return Object.assign(t,{[yY]:!0})}(new n(...a));break;case"ENDPOINT":{const{port1:e,port2:n}=new MessageChannel;CY(t,n),l=function(t,e){return MY.set(t,e),t}(e,[e])}break;case"RELEASE":l=void 0;break;default:return}}catch(c){l={value:c,[wY]:0}}Promise.resolve(l).catch(t=>({value:t,[wY]:0})).then(t=>{const[i,o]=IY(t);e.postMessage(Object.assign(Object.assign({},i),{id:r}),o),"RELEASE"===s&&(e.removeEventListener("message",n),EY(e))})}),e.start&&e.start()}function EY(t){(function(t){return"MessagePort"===t.constructor.name})(t)&&t.close()}function OY(t,e){return kY(t,[],e)}function TY(t){if(t)throw new Error("Proxy has been released and is not useable")}function kY(t,e=[],n=function(){}){let i=!1;const r=new Proxy(n,{get(n,s){if(TY(i),s===_Y)return()=>RY(t,{type:"RELEASE",path:e.map(t=>t.toString())}).then(()=>{EY(t),i=!0});if("then"===s){if(0===e.length)return{then:()=>r};const n=RY(t,{type:"GET",path:e.map(t=>t.toString())}).then(DY);return n.then.bind(n)}return kY(t,[...e,s])},set(n,r,s){TY(i);const[o,a]=IY(s);return RY(t,{type:"SET",path:[...e,r].map(t=>t.toString()),value:o},a).then(DY)},apply(n,r,s){TY(i);const o=e[e.length-1];if(o===vY)return RY(t,{type:"ENDPOINT"}).then(DY);if("bind"===o)return kY(t,e.slice(0,-1));const[a,l]=AY(s);return RY(t,{type:"APPLY",path:e.map(t=>t.toString()),argumentList:a},l).then(DY)},construct(n,r){TY(i);const[s,o]=AY(r);return RY(t,{type:"CONSTRUCT",path:e.map(t=>t.toString()),argumentList:s},o).then(DY)}});return r}function PY(t){return Array.prototype.concat.apply([],t)}function AY(t){const e=t.map(IY);return[e.map(t=>t[0]),PY(e.map(t=>t[1]))]}const MY=new WeakMap;function IY(t){for(const[e,n]of SY)if(n.canHandle(t)){const[i,r]=n.serialize(t);return[{type:"HANDLER",name:e,value:i},r]}return[{type:"RAW",value:t},MY.get(t)||[]]}function DY(t){switch(t.type){case"HANDLER":return SY.get(t.name).deserialize(t.value);case"RAW":return t.value}}function RY(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)})}class NY extends Error{constructor(){super(...arguments),this.message="NgxsDispatchPluginModule is not imported"}}let LY=null;function jY(t){LY=t}function FY(){if(null===LY)throw new NY;return LY.get(qz)}function BY(){if(null===LY)throw new NY;return LY.get(Tu)}function VY(t,e,n){e.run(()=>t.dispatch(n))}function zY(t,e,n,i){return ha(n)?function(t,e,n){return n.then(n=>(VY(t,e,n),n))}(t,e,n):Gd(n)?function(t,e,n,i){return null!==i&&(n=n.pipe(rp(i.cancelUncompleted$))),n.subscribe({next:n=>VY(t,e,n)}),n}(t,e,n,i):(VY(t,e,n),n)}class UY{constructor(){this.cancelUncompleted$=new A}cancelPreviousAction(){this.cancelUncompleted$.next()}}const HY="\u0275fac",$Y=Symbol("InjectorInstance"),GY=Symbol("FactoryHasBeenDecorated");function WY(t,e){const n=t[$Y];return n?n.get(e):null}const qY={cancelUncompleted:!1};function XY(t=qY){return(e,n,i)=>{let r;const s=function(t){return t?new UY:null}(t.cancelUncompleted);function o(){null!==s&&s.cancelPreviousAction();const t=WY(this,qz)||FY(),e=WY(this,Tu)||BY(),n=r.apply(this,arguments);return e.runOutsideAngular(()=>zY(t,e,n,s))}"function"==typeof(null==i?void 0:i.value)?(r=i.value,i.value=o):Object.defineProperty(e,n,{set:t=>r=t,get:()=>o}),function(t){if(GY in t.constructor.prototype)return;const e=t.constructor;"function"==typeof e[HY]&&function(t){const e=t[HY];if("function"!=typeof e)return;const n=t.\u0275prov||t.\u0275pipe||t.\u0275cmp||t.\u0275dir,i=()=>{const t=e();return t[$Y]=ea(_o),t};n&&(n.factory=i),Object.defineProperty(t,HY,{get:()=>i})}(e),t.constructor.prototype[GY]=!0}(e)}}let YY=(()=>{class t{constructor(t){jY(t.injector),t.onDestroy(()=>{jY(null)})}static forRoot(){return{ngModule:t}}}return t.\u0275fac=function(e){return new(e||t)(Ei(hc))},t.\u0275mod=ie({type:t}),t.\u0275inj=St({}),t})(),KY=(()=>{class t{constructor(){this._vertical=!1,this._inset=!1}get vertical(){return this._vertical}set vertical(t){this._vertical=kd(t)}get inset(){return this._inset}set inset(t){this._inset=kd(t)}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Jt({type:t,selectors:[["mat-divider"]],hostAttrs:["role","separator",1,"mat-divider"],hostVars:7,hostBindings:function(t,e){2&t&&(Ko("aria-orientation",e.vertical?"vertical":"horizontal"),ja("mat-divider-vertical",e.vertical)("mat-divider-horizontal",!e.vertical)("mat-divider-inset",e.inset))},inputs:{vertical:"vertical",inset:"inset"},decls:0,vars:0,template:function(t,e){},styles:[".mat-divider{display:block;margin:0;border-top-width:1px;border-top-style:solid}.mat-divider.mat-divider-vertical{border-top:0;border-right-width:1px;border-right-style:solid}.mat-divider.mat-divider-inset{margin-left:80px}[dir=rtl] .mat-divider.mat-divider-inset{margin-left:auto;margin-right:80px}\n"],encapsulation:2,changeDetection:0}),t})(),QY=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Wy],Wy]}),t})();const ZY=["*"],JY=[[["","mat-list-avatar",""],["","mat-list-icon",""],["","matListAvatar",""],["","matListIcon",""]],[["","mat-line",""],["","matLine",""]],"*"],tK=["[mat-list-avatar], [mat-list-icon], [matListAvatar], [matListIcon]","[mat-line], [matLine]","*"],eK=qy(Yy(class{})),nK=Yy(class{}),iK=new oi("MatList"),rK=new oi("MatNavList");let sK=(()=>{class t extends eK{constructor(t){super(),this._elementRef=t,this._stateChanges=new A,"action-list"===this._getListType()&&t.nativeElement.classList.add("mat-action-list")}_getListType(){const t=this._elementRef.nativeElement.nodeName.toLowerCase();return"mat-list"===t?"list":"mat-action-list"===t?"action-list":null}ngOnChanges(){this._stateChanges.next()}ngOnDestroy(){this._stateChanges.complete()}}return t.\u0275fac=function(e){return new(e||t)(ea(Al))},t.\u0275cmp=Jt({type:t,selectors:[["mat-list"],["mat-action-list"]],hostAttrs:[1,"mat-list","mat-list-base"],inputs:{disableRipple:"disableRipple",disabled:"disabled"},exportAs:["matList"],features:[xl([{provide:iK,useExisting:t}]),jo,ye],ngContentSelectors:ZY,decls:1,vars:0,template:function(t,e){1&t&&(wa(),xa(0))},styles:['.mat-subheader{display:flex;box-sizing:border-box;padding:16px;align-items:center}.mat-list-base .mat-subheader{margin:0}.mat-list-base{padding-top:8px;display:block;-webkit-tap-highlight-color:transparent}.mat-list-base .mat-subheader{height:48px;line-height:16px}.mat-list-base .mat-subheader:first-child{margin-top:-8px}.mat-list-base .mat-list-item,.mat-list-base .mat-list-option{display:block;height:48px;-webkit-tap-highlight-color:transparent;width:100%;padding:0}.mat-list-base .mat-list-item .mat-list-item-content,.mat-list-base .mat-list-option .mat-list-item-content{display:flex;flex-direction:row;align-items:center;box-sizing:border-box;padding:0 16px;position:relative;height:inherit}.mat-list-base .mat-list-item .mat-list-item-content-reverse,.mat-list-base .mat-list-option .mat-list-item-content-reverse{display:flex;align-items:center;padding:0 16px;flex-direction:row-reverse;justify-content:space-around}.mat-list-base .mat-list-item .mat-list-item-ripple,.mat-list-base .mat-list-option .mat-list-item-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none}.mat-list-base .mat-list-item.mat-list-item-with-avatar,.mat-list-base .mat-list-option.mat-list-item-with-avatar{height:56px}.mat-list-base .mat-list-item.mat-2-line,.mat-list-base .mat-list-option.mat-2-line{height:72px}.mat-list-base .mat-list-item.mat-3-line,.mat-list-base .mat-list-option.mat-3-line{height:88px}.mat-list-base .mat-list-item.mat-multi-line,.mat-list-base .mat-list-option.mat-multi-line{height:auto}.mat-list-base .mat-list-item.mat-multi-line .mat-list-item-content,.mat-list-base .mat-list-option.mat-multi-line .mat-list-item-content{padding-top:16px;padding-bottom:16px}.mat-list-base .mat-list-item .mat-list-text,.mat-list-base .mat-list-option .mat-list-text{display:flex;flex-direction:column;flex:auto;box-sizing:border-box;overflow:hidden;padding:0}.mat-list-base .mat-list-item .mat-list-text>*,.mat-list-base .mat-list-option .mat-list-text>*{margin:0;padding:0;font-weight:normal;font-size:inherit}.mat-list-base .mat-list-item .mat-list-text:empty,.mat-list-base .mat-list-option .mat-list-text:empty{display:none}.mat-list-base .mat-list-item.mat-list-item-with-avatar .mat-list-item-content .mat-list-text,.mat-list-base .mat-list-item.mat-list-option .mat-list-item-content .mat-list-text,.mat-list-base .mat-list-option.mat-list-item-with-avatar .mat-list-item-content .mat-list-text,.mat-list-base .mat-list-option.mat-list-option .mat-list-item-content .mat-list-text{padding-right:0;padding-left:16px}[dir=rtl] .mat-list-base .mat-list-item.mat-list-item-with-avatar .mat-list-item-content .mat-list-text,[dir=rtl] .mat-list-base .mat-list-item.mat-list-option .mat-list-item-content .mat-list-text,[dir=rtl] .mat-list-base .mat-list-option.mat-list-item-with-avatar .mat-list-item-content .mat-list-text,[dir=rtl] .mat-list-base .mat-list-option.mat-list-option .mat-list-item-content .mat-list-text{padding-right:16px;padding-left:0}.mat-list-base .mat-list-item.mat-list-item-with-avatar .mat-list-item-content-reverse .mat-list-text,.mat-list-base .mat-list-item.mat-list-option .mat-list-item-content-reverse .mat-list-text,.mat-list-base .mat-list-option.mat-list-item-with-avatar .mat-list-item-content-reverse .mat-list-text,.mat-list-base .mat-list-option.mat-list-option .mat-list-item-content-reverse .mat-list-text{padding-left:0;padding-right:16px}[dir=rtl] .mat-list-base .mat-list-item.mat-list-item-with-avatar .mat-list-item-content-reverse .mat-list-text,[dir=rtl] .mat-list-base .mat-list-item.mat-list-option .mat-list-item-content-reverse .mat-list-text,[dir=rtl] .mat-list-base .mat-list-option.mat-list-item-with-avatar .mat-list-item-content-reverse .mat-list-text,[dir=rtl] .mat-list-base .mat-list-option.mat-list-option .mat-list-item-content-reverse .mat-list-text{padding-right:0;padding-left:16px}.mat-list-base .mat-list-item.mat-list-item-with-avatar.mat-list-option .mat-list-item-content-reverse .mat-list-text,.mat-list-base .mat-list-item.mat-list-item-with-avatar.mat-list-option .mat-list-item-content .mat-list-text,.mat-list-base .mat-list-option.mat-list-item-with-avatar.mat-list-option .mat-list-item-content-reverse .mat-list-text,.mat-list-base .mat-list-option.mat-list-item-with-avatar.mat-list-option .mat-list-item-content .mat-list-text{padding-right:16px;padding-left:16px}.mat-list-base .mat-list-item .mat-list-avatar,.mat-list-base .mat-list-option .mat-list-avatar{flex-shrink:0;width:40px;height:40px;border-radius:50%;object-fit:cover}.mat-list-base .mat-list-item .mat-list-avatar~.mat-divider-inset,.mat-list-base .mat-list-option .mat-list-avatar~.mat-divider-inset{margin-left:72px;width:calc(100% - 72px)}[dir=rtl] .mat-list-base .mat-list-item .mat-list-avatar~.mat-divider-inset,[dir=rtl] .mat-list-base .mat-list-option .mat-list-avatar~.mat-divider-inset{margin-left:auto;margin-right:72px}.mat-list-base .mat-list-item .mat-list-icon,.mat-list-base .mat-list-option .mat-list-icon{flex-shrink:0;width:24px;height:24px;font-size:24px;box-sizing:content-box;border-radius:50%;padding:4px}.mat-list-base .mat-list-item .mat-list-icon~.mat-divider-inset,.mat-list-base .mat-list-option .mat-list-icon~.mat-divider-inset{margin-left:64px;width:calc(100% - 64px)}[dir=rtl] .mat-list-base .mat-list-item .mat-list-icon~.mat-divider-inset,[dir=rtl] .mat-list-base .mat-list-option .mat-list-icon~.mat-divider-inset{margin-left:auto;margin-right:64px}.mat-list-base .mat-list-item .mat-divider,.mat-list-base .mat-list-option .mat-divider{position:absolute;bottom:0;left:0;width:100%;margin:0}[dir=rtl] .mat-list-base .mat-list-item .mat-divider,[dir=rtl] .mat-list-base .mat-list-option .mat-divider{margin-left:auto;margin-right:0}.mat-list-base .mat-list-item .mat-divider.mat-divider-inset,.mat-list-base .mat-list-option .mat-divider.mat-divider-inset{position:absolute}.mat-list-base[dense]{padding-top:4px;display:block}.mat-list-base[dense] .mat-subheader{height:40px;line-height:8px}.mat-list-base[dense] .mat-subheader:first-child{margin-top:-4px}.mat-list-base[dense] .mat-list-item,.mat-list-base[dense] .mat-list-option{display:block;height:40px;-webkit-tap-highlight-color:transparent;width:100%;padding:0}.mat-list-base[dense] .mat-list-item .mat-list-item-content,.mat-list-base[dense] .mat-list-option .mat-list-item-content{display:flex;flex-direction:row;align-items:center;box-sizing:border-box;padding:0 16px;position:relative;height:inherit}.mat-list-base[dense] .mat-list-item .mat-list-item-content-reverse,.mat-list-base[dense] .mat-list-option .mat-list-item-content-reverse{display:flex;align-items:center;padding:0 16px;flex-direction:row-reverse;justify-content:space-around}.mat-list-base[dense] .mat-list-item .mat-list-item-ripple,.mat-list-base[dense] .mat-list-option .mat-list-item-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none}.mat-list-base[dense] .mat-list-item.mat-list-item-with-avatar,.mat-list-base[dense] .mat-list-option.mat-list-item-with-avatar{height:48px}.mat-list-base[dense] .mat-list-item.mat-2-line,.mat-list-base[dense] .mat-list-option.mat-2-line{height:60px}.mat-list-base[dense] .mat-list-item.mat-3-line,.mat-list-base[dense] .mat-list-option.mat-3-line{height:76px}.mat-list-base[dense] .mat-list-item.mat-multi-line,.mat-list-base[dense] .mat-list-option.mat-multi-line{height:auto}.mat-list-base[dense] .mat-list-item.mat-multi-line .mat-list-item-content,.mat-list-base[dense] .mat-list-option.mat-multi-line .mat-list-item-content{padding-top:16px;padding-bottom:16px}.mat-list-base[dense] .mat-list-item .mat-list-text,.mat-list-base[dense] .mat-list-option .mat-list-text{display:flex;flex-direction:column;flex:auto;box-sizing:border-box;overflow:hidden;padding:0}.mat-list-base[dense] .mat-list-item .mat-list-text>*,.mat-list-base[dense] .mat-list-option .mat-list-text>*{margin:0;padding:0;font-weight:normal;font-size:inherit}.mat-list-base[dense] .mat-list-item .mat-list-text:empty,.mat-list-base[dense] .mat-list-option .mat-list-text:empty{display:none}.mat-list-base[dense] .mat-list-item.mat-list-item-with-avatar .mat-list-item-content .mat-list-text,.mat-list-base[dense] .mat-list-item.mat-list-option .mat-list-item-content .mat-list-text,.mat-list-base[dense] .mat-list-option.mat-list-item-with-avatar .mat-list-item-content .mat-list-text,.mat-list-base[dense] .mat-list-option.mat-list-option .mat-list-item-content .mat-list-text{padding-right:0;padding-left:16px}[dir=rtl] .mat-list-base[dense] .mat-list-item.mat-list-item-with-avatar .mat-list-item-content .mat-list-text,[dir=rtl] .mat-list-base[dense] .mat-list-item.mat-list-option .mat-list-item-content .mat-list-text,[dir=rtl] .mat-list-base[dense] .mat-list-option.mat-list-item-with-avatar .mat-list-item-content .mat-list-text,[dir=rtl] .mat-list-base[dense] .mat-list-option.mat-list-option .mat-list-item-content .mat-list-text{padding-right:16px;padding-left:0}.mat-list-base[dense] .mat-list-item.mat-list-item-with-avatar .mat-list-item-content-reverse .mat-list-text,.mat-list-base[dense] .mat-list-item.mat-list-option .mat-list-item-content-reverse .mat-list-text,.mat-list-base[dense] .mat-list-option.mat-list-item-with-avatar .mat-list-item-content-reverse .mat-list-text,.mat-list-base[dense] .mat-list-option.mat-list-option .mat-list-item-content-reverse .mat-list-text{padding-left:0;padding-right:16px}[dir=rtl] .mat-list-base[dense] .mat-list-item.mat-list-item-with-avatar .mat-list-item-content-reverse .mat-list-text,[dir=rtl] .mat-list-base[dense] .mat-list-item.mat-list-option .mat-list-item-content-reverse .mat-list-text,[dir=rtl] .mat-list-base[dense] .mat-list-option.mat-list-item-with-avatar .mat-list-item-content-reverse .mat-list-text,[dir=rtl] .mat-list-base[dense] .mat-list-option.mat-list-option .mat-list-item-content-reverse .mat-list-text{padding-right:0;padding-left:16px}.mat-list-base[dense] .mat-list-item.mat-list-item-with-avatar.mat-list-option .mat-list-item-content-reverse .mat-list-text,.mat-list-base[dense] .mat-list-item.mat-list-item-with-avatar.mat-list-option .mat-list-item-content .mat-list-text,.mat-list-base[dense] .mat-list-option.mat-list-item-with-avatar.mat-list-option .mat-list-item-content-reverse .mat-list-text,.mat-list-base[dense] .mat-list-option.mat-list-item-with-avatar.mat-list-option .mat-list-item-content .mat-list-text{padding-right:16px;padding-left:16px}.mat-list-base[dense] .mat-list-item .mat-list-avatar,.mat-list-base[dense] .mat-list-option .mat-list-avatar{flex-shrink:0;width:36px;height:36px;border-radius:50%;object-fit:cover}.mat-list-base[dense] .mat-list-item .mat-list-avatar~.mat-divider-inset,.mat-list-base[dense] .mat-list-option .mat-list-avatar~.mat-divider-inset{margin-left:68px;width:calc(100% - 68px)}[dir=rtl] .mat-list-base[dense] .mat-list-item .mat-list-avatar~.mat-divider-inset,[dir=rtl] .mat-list-base[dense] .mat-list-option .mat-list-avatar~.mat-divider-inset{margin-left:auto;margin-right:68px}.mat-list-base[dense] .mat-list-item .mat-list-icon,.mat-list-base[dense] .mat-list-option .mat-list-icon{flex-shrink:0;width:20px;height:20px;font-size:20px;box-sizing:content-box;border-radius:50%;padding:4px}.mat-list-base[dense] .mat-list-item .mat-list-icon~.mat-divider-inset,.mat-list-base[dense] .mat-list-option .mat-list-icon~.mat-divider-inset{margin-left:60px;width:calc(100% - 60px)}[dir=rtl] .mat-list-base[dense] .mat-list-item .mat-list-icon~.mat-divider-inset,[dir=rtl] .mat-list-base[dense] .mat-list-option .mat-list-icon~.mat-divider-inset{margin-left:auto;margin-right:60px}.mat-list-base[dense] .mat-list-item .mat-divider,.mat-list-base[dense] .mat-list-option .mat-divider{position:absolute;bottom:0;left:0;width:100%;margin:0}[dir=rtl] .mat-list-base[dense] .mat-list-item .mat-divider,[dir=rtl] .mat-list-base[dense] .mat-list-option .mat-divider{margin-left:auto;margin-right:0}.mat-list-base[dense] .mat-list-item .mat-divider.mat-divider-inset,.mat-list-base[dense] .mat-list-option .mat-divider.mat-divider-inset{position:absolute}.mat-nav-list a{text-decoration:none;color:inherit}.mat-nav-list .mat-list-item{cursor:pointer;outline:none}mat-action-list button{background:none;color:inherit;border:none;font:inherit;outline:inherit;-webkit-tap-highlight-color:transparent;text-align:left}[dir=rtl] mat-action-list button{text-align:right}mat-action-list button::-moz-focus-inner{border:0}mat-action-list .mat-list-item{cursor:pointer;outline:inherit}.mat-list-option:not(.mat-list-item-disabled){cursor:pointer;outline:none}.mat-list-item-disabled{pointer-events:none}.cdk-high-contrast-active .mat-list-item-disabled{opacity:.5}.cdk-high-contrast-active :host .mat-list-item-disabled{opacity:.5}.cdk-high-contrast-active .mat-selection-list:focus{outline-style:dotted}.cdk-high-contrast-active .mat-list-option:hover,.cdk-high-contrast-active .mat-list-option:focus,.cdk-high-contrast-active .mat-nav-list .mat-list-item:hover,.cdk-high-contrast-active .mat-nav-list .mat-list-item:focus,.cdk-high-contrast-active mat-action-list .mat-list-item:hover,.cdk-high-contrast-active mat-action-list .mat-list-item:focus{outline:dotted 1px}.cdk-high-contrast-active .mat-list-single-selected-option::after{content:"";position:absolute;top:50%;right:16px;transform:translateY(-50%);width:10px;height:0;border-bottom:solid 10px;border-radius:10px}.cdk-high-contrast-active [dir=rtl] .mat-list-single-selected-option::after{right:auto;left:16px}@media(hover: none){.mat-list-option:not(.mat-list-single-selected-option):not(.mat-list-item-disabled):hover,.mat-nav-list .mat-list-item:not(.mat-list-item-disabled):hover,.mat-action-list .mat-list-item:not(.mat-list-item-disabled):hover{background:none}}\n'],encapsulation:2,changeDetection:0}),t})(),oK=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275dir=se({type:t,selectors:[["","mat-list-avatar",""],["","matListAvatar",""]],hostAttrs:[1,"mat-list-avatar"]}),t})(),aK=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275dir=se({type:t,selectors:[["","mat-list-icon",""],["","matListIcon",""]],hostAttrs:[1,"mat-list-icon"]}),t})(),lK=(()=>{class t extends nK{constructor(t,e,n,i){super(),this._element=t,this._isInteractiveList=!1,this._destroyed=new A,this._disabled=!1,this._isInteractiveList=!!(n||i&&"action-list"===i._getListType()),this._list=n||i;const r=this._getHostElement();"button"===r.nodeName.toLowerCase()&&!r.hasAttribute("type")&&r.setAttribute("type","button"),this._list&&this._list._stateChanges.pipe(rp(this._destroyed)).subscribe(()=>{e.markForCheck()})}get disabled(){return this._disabled||!(!this._list||!this._list.disabled)}set disabled(t){this._disabled=kd(t)}ngAfterContentInit(){!function(t,e,n="mat"){t.changes.pipe(lp(t)).subscribe(({length:t})=>{tv(e,`${n}-2-line`,!1),tv(e,`${n}-3-line`,!1),tv(e,`${n}-multi-line`,!1),2===t||3===t?tv(e,`${n}-${t}-line`,!0):t>3&&tv(e,`${n}-multi-line`,!0)})}(this._lines,this._element)}ngOnDestroy(){this._destroyed.next(),this._destroyed.complete()}_isRippleDisabled(){return!this._isInteractiveList||this.disableRipple||!(!this._list||!this._list.disableRipple)}_getHostElement(){return this._element.nativeElement}}return t.\u0275fac=function(e){return new(e||t)(ea(Al),ea(nc),ea(rK,8),ea(iK,8))},t.\u0275cmp=Jt({type:t,selectors:[["mat-list-item"],["a","mat-list-item",""],["button","mat-list-item",""]],contentQueries:function(t,e,n){if(1&t&&(Jc(n,oK,5),Jc(n,aK,5),Jc(n,Jy,5)),2&t){let t;Qc(t=tu())&&(e._avatar=t.first),Qc(t=tu())&&(e._icon=t.first),Qc(t=tu())&&(e._lines=t)}},hostAttrs:[1,"mat-list-item","mat-focus-indicator"],hostVars:6,hostBindings:function(t,e){2&t&&ja("mat-list-item-disabled",e.disabled)("mat-list-item-avatar",e._avatar||e._icon)("mat-list-item-with-avatar",e._avatar||e._icon)},inputs:{disableRipple:"disableRipple",disabled:"disabled"},exportAs:["matListItem"],features:[jo],ngContentSelectors:tK,decls:6,vars:2,consts:[[1,"mat-list-item-content"],["mat-ripple","",1,"mat-list-item-ripple",3,"matRippleTrigger","matRippleDisabled"],[1,"mat-list-text"]],template:function(t,e){1&t&&(wa(JY),ra(0,"div",0),oa(1,"div",1),xa(2),ra(3,"div",2),xa(4,1),sa(),xa(5,2),sa()),2&t&&(ws(1),na("matRippleTrigger",e._getHostElement())("matRippleDisabled",e._isRippleDisabled()))},directives:[cv],encapsulation:2,changeDetection:0}),t})(),cK=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[ev,uv,Wy,dv,Wh],ev,Wy,dv,QY]}),t})();const uK=["input"],hK=function(t){return{enterDuration:t}},dK=["*"],pK=new oi("mat-checkbox-default-options",{providedIn:"root",factory:fK});function fK(){return{color:"accent",clickAction:"check-indeterminate"}}let gK=0;const mK=fK(),bK={provide:aU,useExisting:pt(()=>_K),multi:!0};class yK{}const vK=Ky(Xy(Yy(qy(class{constructor(t){this._elementRef=t}}))));let _K=(()=>{class t extends vK{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-"+ ++gK,this.id=this._uniqueId,this.labelPosition="after",this.name=null,this.change=new Bc,this.indeterminateChange=new Bc,this._onTouched=()=>{},this._currentAnimationClass="",this._currentCheckState=0,this._controlValueAccessorChangeFn=()=>{},this._checked=!1,this._disabled=!1,this._indeterminate=!1,this._options=this._options||mK,this.color=this.defaultColor=this._options.color||mK.color,this.tabIndex=parseInt(r)||0}get inputId(){return`${this.id||this._uniqueId}-input`}get required(){return this._required}set required(t){this._required=kd(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=kd(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=kd(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 yK;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(Al),ea(nc),ea(Ug),ea(Tu),ii("tabindex"),ea(Ny,8),ea(pK,8))},t.\u0275cmp=Jt({type:t,selectors:[["mat-checkbox"]],viewQuery:function(t,e){if(1&t&&(Zc(uK,5),Zc(cv,5)),2&t){let t;Qc(t=tu())&&(e._inputElement=t.first),Qc(t=tu())&&(e.ripple=t.first)}},hostAttrs:[1,"mat-checkbox"],hostVars:12,hostBindings:function(t,e){2&t&&(rl("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:[xl([bK]),jo],ngContentSelectors:dK,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),Ja(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",Pc(19,hK,"NoopAnimations"===e._animationMode?0:150))}},directives:[cv,pg],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})(),wK=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({}),t})(),xK=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[uv,Wy,fg,wK],Wy,wK]}),t})();const SK=["bodyCanvas"];let CK=(()=>{class t{constructor(){this.clsName="ccf-body-ui",this.rotationChange=new Bc,this.nodeDrag=new Bc,this.nodeClick=new Bc,this.nodeHoverStart=new Bc,this.nodeHoverStop=new Bc,this.initialized=new Bc,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 xw(this,void 0,void 0,function*(){const e=this.bodyCanvas.nativeElement,n=new BV({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.target&&this.bodyUI.setTarget(this.target),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))],this.initialized.emit()})}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&&Zc(SK,5,Al),2&t){let t;Qc(t=tu())&&(e.bodyCanvas=t.first)}},hostVars:2,hostBindings:function(t,e){2&t&&Va(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",initialized:"initialized"},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})(),EK=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Wh]]}),t})();new oi("Maximum number of autocomplete options displayed",{providedIn:"root",factory:()=>10});const OK=["carouselContainer"],TK=["itemlist"],kK=["itemcontainer"];function PK(t,e){if(1&t){const t=ua();ra(0,"mat-icon",9),fa("touchstart",function(){return $e(t),va().scroll("left")})("touchend",function(){return $e(t),va().stopScroll()})("click",function(){return $e(t),va().shift("left")})("mousedown",function(){return $e(t),va().scroll("left")})("mouseup",function(){return $e(t),va().stopScroll()}),Ja(1,"chevron_left"),sa()}2&t&&ja("disabled",va().onLeft)}function AK(t,e){if(1&t&&(ra(0,"div",15),Ja(1),sa()),2&t){const t=va().$implicit,e=va();ws(1),tl(e.occurenceData[t.id]||0)}}function MK(t,e){if(1&t){const t=ua();ra(0,"div",10),fa("click",function(){const e=$e(t).$implicit;return va().selectOrgan(e)}),oa(1,"mat-icon",11),ra(2,"div",12),ra(3,"div",13),Ja(4),sa(),Jo(5,AK,2,1,"div",14),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),tl(t.name),ws(1),na("ngIf",void 0!==t.numResults)}}function IK(t,e){if(1&t){const t=ua();ra(0,"mat-icon",16),fa("touchstart",function(){return $e(t),va().scroll("right")})("touchend",function(){return $e(t),va().stopScroll()})("click",function(){return $e(t),va().shift("right")})("mousedown",function(){return $e(t),va().scroll("right")})("mouseup",function(){return $e(t),va().stopScroll()}),Ja(1,"chevron_right"),sa()}2&t&&ja("disabled",va().onRight)}const DK=[{src:"app:skin",organ:"Skin",name:"Skin",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002097"},{src:"app:brain",organ:"Brain",name:"Brain",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000955"},{disabled:!0,src:"app:lymph-nodes",organ:"Lymph Node",name:"Lymph Node",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000029"},{src:"app:lymph-nodes",organ:"Lymph Node",name:"Lymph Node",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002509"},{disabled:!0,src:"app:eye",organ:"Eye",name:"Eye, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000970"},{src:"app:eye",organ:"Eye",name:"Eye, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0004548"},{src:"app:eye",organ:"Eye",name:"Eye, R",side:"right",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0004549"},{disabled:!0,src:"app:fallopian-tube-left",organ:"Fallopian Tube",name:"Fallopian Tube, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0003889"},{src:"app:fallopian-tube-left",organ:"Fallopian Tube",name:"Fallopian Tube, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0001303"},{src:"app:fallopian-tube-right",organ:"Fallopian Tube",name:"Fallopian Tube, R",side:"right",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0001302"},{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, L",side:"left",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"},{disabled:!0,src:"app:knee",organ:"Knee",name:"Knee, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001465"},{src:"app:knee",organ:"Knee",name:"Knee, L",side:"left",hasSex:!0,id:"http://purl.org/sig/ont/fma/fma24978"},{src:"app:knee",organ:"Knee",name:"Knee, R",side:"right",hasSex:!0,id:"http://purl.org/sig/ont/fma/fma24977"},{src:"app:liver",organ:"Liver",name:"Liver",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002107"},{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"},{disabled:!0,src:"app:mammary-gland",organ:"Mammary Gland",name:"Mammary Gland, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0001911"},{src:"app:mammary-gland",organ:"Mammary Gland",name:"Mammary Gland, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.org/sig/ont/fma/fma57991"},{src:"app:mammary-gland",organ:"Mammary Gland",name:"Mammary Gland, R",side:"right",hasSex:!1,sex:"female",id:"http://purl.org/sig/ont/fma/fma57987"},{disabled:!0,src:"app:ovary-left",organ:"Ovary",name:"Ovary, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0000992"},{src:"app:ovary-left",organ:"Ovary",name:"Ovary, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.org/sig/ont/fma/fma7214"},{src:"app:ovary-right",organ:"Ovary",name:"Ovary, R",side:"right",hasSex:!1,sex:"female",id:"http://purl.org/sig/ont/fma/fma7213"},{src:"app:pancreas",organ:"Pancreas",name:"Pancreas",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001264"},{src:"app:pelvis-f",organ:"Pelvis",name:"Pelvis",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001270"},{src:"app:placenta",organ:"Placenta",name:"Placenta",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0001987"},{src:"app:prostate",organ:"Prostate",name:"Prostate",hasSex:!1,sex:"male",id:"http://purl.obolibrary.org/obo/UBERON_0002367",disabled:!0},{src:"app:prostate",organ:"Prostate",name:"Prostate",hasSex:!1,sex:"male",id:"http://purl.obolibrary.org/obo/UBERON_0000079"},{src:"app:small-intestine",organ:"Small Intestine",name:"Small Intestine",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002108"},{src:"app:large-intestine",organ:"Large Intestine",name:"Large Intestine",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000059"},{src:"app:spinal-cord",organ:"Spinal Cord",name:"Spinal Cord",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002240"},{src:"app:spleen",organ:"Spleen",name:"Spleen",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002106"},{src:"app:thymus",organ:"Thymus",name:"Thymus",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002370"},{disabled:!0,src:"app:ureter-left",organ:"Ureter",name:"Ureter, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000056"},{src:"app:ureter-left",organ:"Ureter",name:"Ureter, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001223"},{src:"app:ureter-right",organ:"Ureter",name:"Ureter, R",side:"right",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001222"},{src:"app:bladder",organ:"Urinary Bladder",name:"Urinary Bladder",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001255"},{src:"app:uterus",organ:"Uterus",name:"Uterus",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0000995"},{src:"app:vasculature-thick",organ:"Blood Vasculature",name:"Blood Vasculature",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0004537"},{disabled:!0,src:"app:vasculature-thick",organ:"Blood Vasculature",name:"Blood Vasculature",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002049"}].sort((t,e)=>t.name.localeCompare(e.name)),RK=DK.filter(t=>!0!==t.disabled);let NK=(()=>{class t{constructor(){this.clsName="ccf-organ-selector",this.multiselect=!1,this.displayErrors=!1,this.organList=RK,this.selectedOrgans=[],this.expanded=!1,this.organsChanged=new Bc,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 I$.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&&(Zc(OK,7),Zc(TK,7),Zc(kK,7)),2&t){let t;Qc(t=tu())&&(e.carouselContainer=t.first),Qc(t=tu())&&(e.itemList=t.first),Qc(t=tu())&&(e.itemContainer=t.first)}},hostVars:2,hostBindings:function(t,e){2&t&&Va(e.clsName)},inputs:{multiselect:"multiselect",displayErrors:"displayErrors",organList:"organList",selectedOrgans:"selectedOrgans",expanded:"expanded",occurenceData:"occurenceData"},outputs:{organsChanged:"organsChanged"},features:[ye],decls:9,vars:8,consts:[["matTooltip","Select the organ your tissue block is from.",1,"container",3,"matTooltipDisabled"],["carouselContainer",""],["class","carousel-left-icon",3,"disabled","touchstart","touchend","click","mousedown","mouseup",4,"ngIf"],[1,"carousel-item-container"],["itemcontainer",""],[1,"carousel-item-list"],["itemlist",""],["class","carousel-item",3,"disabled","selected","click",4,"ngFor","ngForOf"],["class","carousel-right-icon",3,"disabled","touchstart","touchend","click","mousedown","mouseup",4,"ngIf"],[1,"carousel-left-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"],[1,"carousel-right-icon",3,"touchstart","touchend","click","mousedown","mouseup"]],template:function(t,e){1&t&&(ra(0,"div",0,1),Jo(2,PK,2,2,"mat-icon",2),ra(3,"div",3,4),ra(5,"div",5,6),Jo(7,MK,6,7,"div",7),sa(),sa(),Jo(8,IK,2,2,"mat-icon",8),sa()),2&t&&(ja("expanded",e.expanded)("error",e.error),na("matTooltipDisabled",e.multiselect),ws(2),na("ngIf",!e.expanded),ws(5),na("ngForOf",e.organList),ws(1),na("ngIf",!e.expanded))},directives:[gw,Ah,kh,T_],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:5rem;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}[_nghost-%COMP%] .expanded[_ngcontent-%COMP%] .carousel-item-container[_ngcontent-%COMP%]{width:100%!important}[_nghost-%COMP%] .expanded[_ngcontent-%COMP%] .carousel-item-container[_ngcontent-%COMP%] .carousel-item-list[_ngcontent-%COMP%]{flex-wrap:wrap;overflow:auto;left:0rem!important}[_nghost-%COMP%] .expanded[_ngcontent-%COMP%] .carousel-item-container[_ngcontent-%COMP%] .carousel-item-list[_ngcontent-%COMP%] .carousel-item[_ngcontent-%COMP%]{height:5rem}"]}),t})(),LK=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Wh,k_,yw]]}),t})(),jK=(()=>{class t{constructor(){this.clsName="ccf-opacity-slider",this.opacity=20,this.visible=!0,this.opacityChange=new Bc,this.visibilityToggle=new Bc,this.opacityReset=new Bc}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&&Va(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),Ja(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()}),Ja(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),el("",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:[F$,T_,cv],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})(),FK=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Wh,k_,U$,uv]]}),t})();function BK(t,e){if(1&t&&(ra(0,"div",16),oa(1,"youtube-player",17),sa()),2&t){const t=va(3);ws(1),Sa("videoId",t.videoID)}}function VK(t,e){if(1&t&&(ra(0,"mat-expansion-panel",11),ra(1,"mat-expansion-panel-header"),ra(2,"h2",12),Ja(3),sa(),sa(),ra(4,"div",13),oa(5,"markdown",14),Jo(6,BK,2,1,"div",15),sa(),sa()),2&t){const t=va(),e=t.index,n=t.$implicit;na("expanded",0===e),ws(3),tl(n.title),ws(2),ja("first",0===e),na("data",n.content),ws(1),na("ngIf",0===e)}}function zK(t,e){if(1&t&&(ra(0,"div",9),Jo(1,VK,7,6,"mat-expansion-panel",10),sa()),2&t){const t=e.$implicit;ws(1),na("ngIf",t)}}let UK=(()=>{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(Y$),ea(Q$))},t.\u0275cmp=Jt({type:t,selectors:[["ccf-info-dialog"]],decls:11,vars:2,consts:[[1,"rui-about","wrapper"],[1,"container"],[1,"content"],[1,"header"],["mat-dialog-title","",1,"title"],[1,"close"],[1,"material-icons","close-icon",3,"click"],[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,"div",3),ra(4,"h2",4),Ja(5),sa(),ra(6,"div",5),ra(7,"mat-icon",6),fa("click",function(){return e.close()}),Ja(8,"clear"),sa(),sa(),sa(),ra(9,"mat-dialog-content",7),Jo(10,zK,2,1,"div",8),sa(),sa(),sa(),sa()),2&t&&(ws(5),tl(e.infoTitle),ws(5),na("ngForOf",e.documentationContents))},directives:[rG,T_,sG,kh,Ah,CG,TG,NG,WG],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%] .content[_ngcontent-%COMP%] .header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;height:3rem;margin-bottom:2.25rem;position:relative}.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%]{cursor:pointer;height:3rem;width:3rem;line-height:3rem;text-align:center;transition:.6s}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-size:1.5rem;margin:0 auto;line-height:3rem;height:3rem;justify-self:center;display:flex}.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;display:flex}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .dialog-content[_ngcontent-%COMP%] .variable-binding.first[_ngcontent-%COMP%]{padding-right:1rem;width:73%}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .dialog-content[_ngcontent-%COMP%] .variable-binding[_ngcontent-%COMP%] ul{margin:0}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .dialog-content[_ngcontent-%COMP%] .variable-binding[_ngcontent-%COMP%] img{margin-left:1rem;float:right}.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%}"]}),t})(),HK=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Wh,oG,k_,kG,KG,LG.forRoot({})]]}),t})(),$K=(()=>{class t{constructor(t){this.http=t,this.panelContent=new Jf({content:[],infoTitle:"",videoID:""})}updateData(t,e,n){this.http.get(t,{responseType:"text"}).subscribe(t=>{const i={content:this.parseMarkdown(t),infoTitle:n,videoID:e};this.panelContent.next(i)})}parseMarkdown(t){const e=[],n=t.split("# ");for(const i of n)if(i.length){const t=i.includes("\n\n")?"\n\n":"\r\n\r\n",n=i.split(t);e.push({title:n[0],content:n.splice(1).join(t)})}return e}}return t.\u0275fac=function(e){return new(e||t)(Ei(Jv))},t.\u0275prov=xt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})(),GK=(()=>{class t{constructor(t,e){this.dialog=t,this.infoButtonService=e,this.infoTitle="",this.subscriptions=new g,this.subscriptions.add(e.panelContent.subscribe(t=>{t.content.length&&this.launchInfoDialog(t)}))}ngOnDestroy(){this.subscriptions.unsubscribe()}launchInfoDialog(t){0==this.dialog.openDialogs.length&&this.dialog.open(UK,{autoFocus:!1,panelClass:"modal-animated",width:"72rem",data:{title:t.infoTitle,content:t.content,videoID:t.videoID}})}onDialogButtonClick(){this.infoButtonService.updateData(this.documentationUrl,this.videoID,this.infoTitle)}}return t.\u0275fac=function(e){return new(e||t)(ea(nG),ea($K))},t.\u0275cmp=Jt({type:t,selectors:[["ccf-info-button"]],inputs:{infoTitle:"infoTitle",videoID:"videoID",documentationUrl:"documentationUrl"},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()}),Ja(2," info "),sa(),sa())},directives:[T_],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})(),WK=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Wh,HK,k_,d_]]}),t})(),qK=(()=>{class t{constructor(){this.clsName="ccf-call-to-action",this.callToActionClicked=new Bc,this.closeClicked=new Bc}close(){this.closeClicked.emit()}onDialogButtonClick(){this.callToActionClicked.emit()}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Jt({type:t,selectors:[["ccf-call-to-action"]],hostVars:2,hostBindings:function(t,e){2&t&&Va(e.clsName)},inputs:{infoTitle:"infoTitle",imageUrl:"imageUrl",message:"message",callToAction:"callToAction"},outputs:{callToActionClicked:"callToActionClicked",closeClicked:"closeClicked"},decls:13,vars:4,consts:[[1,"rui-about","wrapper"],[1,"container"],[1,"content"],[1,"first-row"],["mat-dialog-title","",1,"title"],[1,"cta-mat-icon","material-icons","close-icon",3,"click"],["mat-card-sm-image","","alt","preview","layout-fill","",1,"cta-image",3,"src"],[1,"mat-typography","dialog-content"],[1,"message"],["mat-button","",1,"mat-button",3,"text","click"]],template:function(t,e){1&t&&(ra(0,"div",0),ra(1,"div",1),ra(2,"div",2),ra(3,"div",3),ra(4,"p",4),Ja(5),sa(),ra(6,"mat-icon",5),fa("click",function(){return e.close()}),Ja(7,"clear"),sa(),sa(),oa(8,"img",6),ra(9,"mat-dialog-content",7),ra(10,"div",8),Ja(11),sa(),ra(12,"a",9),fa("click",function(){return e.onDialogButtonClick()}),sa(),sa(),sa(),sa(),sa()),2&t&&(ws(5),tl(e.infoTitle),ws(3),na("src",e.imageUrl,_r),ws(3),el(" ",e.message,""),ws(1),na("text",e.callToAction))},directives:[rG,T_,QG,sG],styles:["[_nghost-%COMP%] .content[_ngcontent-%COMP%]{display:block;align-content:center;padding-left:1.6rem;padding-right:1.6rem;border-radius:.25rem}[_nghost-%COMP%] .info-button-wrapper[_ngcontent-%COMP%]{border-radius:.25rem;padding:.6rem;transition:.6s}[_nghost-%COMP%] .info-button-wrapper[_ngcontent-%COMP%] .ccf-info-button[_ngcontent-%COMP%]{cursor:pointer;transition:color .6s;font-size:1.2rem;vertical-align:sub}[_nghost-%COMP%] .first-row[_ngcontent-%COMP%]{display:flex;width:100%;line-height:.9rem}[_nghost-%COMP%] .first-row[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{padding-right:7rem;padding-left:.2rem;font-size:.875rem;padding-top:.75rem}[_nghost-%COMP%] .first-row[_ngcontent-%COMP%] .cta-mat-icon[_ngcontent-%COMP%]{height:30%;line-height:3.4rem}[_nghost-%COMP%] .message[_ngcontent-%COMP%]{padding:.5rem}[_nghost-%COMP%] .cta-image[_ngcontent-%COMP%]{align-self:center;-o-object-fit:cover;object-fit:cover;width:100%;border-radius:.25rem}[_nghost-%COMP%] .mat-button[_ngcontent-%COMP%]{background-color:#444a65;font-size:.75rem;position:relative;margin-bottom:1rem;width:100%;height:2rem;color:#fff}"],changeDetection:0}),t})(),XK=(()=>{let t=class extends MW{constructor(){super(...arguments),this.optionCache=new Map}get config$(){return this.state$.pipe(IW(),xp(1))}setConfig(t){this.setState(t)}patchConfig(t){this.patchState(t)}getProperty(t){return this.config$.pipe(T$(...t),Wd(),xp(1))}getOption(...t){const e=this.getPathKey(t);if(this.optionCache.has(e))return this.optionCache.get(e);const n=this.config$.pipe(T$(...t),Wd(),xp(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}),vw([CW()],t.prototype,"config$",null),t=vw([kW(),nU({name:"globalConfig",defaults:null})],t),t})();!function(){const t=localStorage.getItem("ALLOW_TELEMETRY");null===t||t.toLowerCase()}();let YK=(()=>{class t{constructor(t,e){t&&function(t,e){Rd(t,"mousemove").pipe(function(t,e=Yd,n=k$){return i=>i.lift(new P$(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)(Ei(th),Ei(jW))},t.\u0275mod=ie({type:t}),t.\u0275inj=St({}),t})();function KK(t,e){if(1&t){const t=ua();ra(0,"button",1),fa("click",function(){return $e(t),va().submit(!0)}),Ja(1),sa()}if(2&t){const t=va();ws(1),el(" ","not-set"===t.allowTelemetry?"I understand":"Opt in","\n")}}function QK(t,e){if(1&t){const t=ua();ra(0,"button",1),fa("click",function(){return $e(t),va().submit(!1)}),Ja(1,"Opt out"),sa()}}let ZK=(()=>{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(Al),ea(VW),ea(Z_))},t.\u0275cmp=Jt({type:t,selectors:[["ccf-tracking-popup"]],hostVars:2,hostBindings:function(t,e){2&t&&Va(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"),Ja(1,"We log usage to improve this service."),sa(),Jo(2,KK,2,1,"button",0),Jo(3,QK,2,0,"button",0)),2&t&&(ws(2),na("ngIf",e.showButton("opt-in")),ws(1),na("ngIf",e.showButton("opt-out")))},directives:[Ah,R_],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})(),JK=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Wh,L_]]}),t})();class tQ extends class{getDatabaseStatus(){return this.forwardCall("getDatabaseStatus")}getProviderNames(){return this.forwardCall("getProviderNames")}getDatasetTechnologyNames(){return this.forwardCall("getDatasetTechnologyNames")}getOntologyTreeModel(){return this.forwardCall("getOntologyTreeModel")}getCellTypeTreeModel(){return this.forwardCall("getCellTypeTreeModel")}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)}getCellTypeTermOccurences(t){return this.forwardCall("getCellTypeTermOccurences",t)}getScene(t){return this.forwardCall("getScene",t)}getReferenceOrganScene(t,e){return this.forwardCall("getReferenceOrganScene",t,e)}}{forwardCall(t,...e){return this.impl$.pipe(cp(n=>n[t](...e)))}}let eQ=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();const nQ=new A,iQ={cacheBusterObserver:nQ},rQ={cacheBusterObserver:nQ,maxCacheCount:4};function sQ(t,e,n){return t?{min:t[0]>e?t[0]:void 0,max:t[1]{var e;return Object.assign(Object.assign({},t),{transformMatrix:new VT(null!==(e=t.transformMatrix)&&void 0!==e?e:[])})})}let aQ=(()=>{class t{constructor(t,e){this.api=t,this.globalConfig=e,e.getOption("hubmapToken").subscribe(nQ)}getDatabaseStatus(){return this.doRequest(t=>this.api.dbStatus(t))}getProviderNames(){return this.doRequest(t=>this.api.providerNames(t))}getDatasetTechnologyNames(){return this.doRequest(t=>this.api.technologyNames(t))}getOntologyTreeModel(){return this.doRequest(t=>this.api.ontologyTreeModel(t),void 0,{},t=>t)}getCellTypeTreeModel(){return this.doRequest(t=>this.api.cellTypeTreeModel(t),void 0,{},t=>t)}getReferenceOrgans(){return this.doRequest(t=>this.api.referenceOrgans(t),void 0,{},t=>t)}getTissueBlockResults(t){return this.doRequest(t=>this.api.tissueBlocks(t),t,{},t=>t)}getAggregateResults(t){return this.doRequest(t=>this.api.aggregateResults(t),t)}getOntologyTermOccurences(t){return this.doRequest(t=>this.api.ontologyTermOccurences(t),t)}getCellTypeTermOccurences(t){return this.doRequest(t=>this.api.cellTypeTermOccurences(t),t)}getScene(t){return this.doRequest(t=>this.api.scene(t),t,{},oQ)}getReferenceOrganScene(t,e){return this.doRequest(t=>this.api.referenceOrganScene(t),e,{organIri:t},oQ)}doRequest(t,e,n,i){const{api:r,globalConfig:s}=this,o=Object.assign(Object.assign({},function(t){var e,n;return{age:sQ(null==t?void 0:t.ageRange,1,110),bmi:sQ(null==t?void 0:t.bmiRange,13,83),sex:null===(n=null===(e=null==t?void 0:t.sex)||void 0===e?void 0:e.toLowerCase)||void 0===n?void 0:n.call(e),ontologyTerms:null==t?void 0:t.ontologyTerms,cellTypeTerms:null==t?void 0:t.cellTypeTerms,providers:null==t?void 0:t.tmc,technologies:null==t?void 0:t.technologies,spatial:null==t?void 0:t.spatialSearches}}(e)),n);return z_([s.getOption("remoteApiEndpoint"),s.getOption("hubmapToken")]).pipe(rf(1),eg(([t,e])=>{r.configuration.basePath=t,e&&(o.token=e)}),cp(()=>t(o)),D(t=>i?i(t):t))}}return t.\u0275fac=function(e){return new(e||t)(Ei(eq),Ei(XK))},t.\u0275prov=xt({token:t,factory:t.\u0275fac,providedIn:"root"}),vw([QW(iQ)],t.prototype,"getProviderNames",null),vw([QW(iQ)],t.prototype,"getDatasetTechnologyNames",null),vw([QW(iQ)],t.prototype,"getOntologyTreeModel",null),vw([QW(iQ)],t.prototype,"getCellTypeTreeModel",null),vw([QW(iQ)],t.prototype,"getReferenceOrgans",null),vw([QW(rQ)],t.prototype,"getTissueBlockResults",null),vw([QW(rQ)],t.prototype,"getAggregateResults",null),vw([QW(rQ)],t.prototype,"getOntologyTermOccurences",null),vw([QW(rQ)],t.prototype,"getCellTypeTermOccurences",null),vw([QW(rQ)],t.prototype,"getScene",null),vw([QW(rQ)],t.prototype,"getReferenceOrganScene",null),t})(),lQ=(()=>{class t extends tQ{constructor(t){super(),this.impl$=this.database$=t.config$.pipe(t=>t,ep(t=>Object.keys(t).length>0),cp(t=>function(t,e){return new E(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):pp).subscribe(n);return()=>{s.unsubscribe(),i&&i.unsubscribe()}})}(()=>this.createDatabase(t),e=>this.connectDatabase(e,t))),D(t=>t.database),xp(1))}connectDatabase(t,e){return xw(this,void 0,void 0,function*(){const n=!Vu();return yield t.database.connect(e,n),t})}}return t.\u0275fac=function(e){return new(e||t)(Ei(XK))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),cQ=(()=>{class t extends lQ{createDatabase(t){return{database:new lY(t),unsubscribe:()=>{}}}}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})(),uQ=(()=>{class t extends lQ{createDatabase(t){const e=this.createWorker(t),n=OY(e);return{database:n,unsubscribe:()=>{n[_Y](),e.terminate()}}}}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})(),hQ=(()=>{class t extends tQ{constructor(t,e){super(),this.impl$=t.config$.pipe(t=>t,D(t=>this.selectToken(t)),Wd(),D(t=>e.get(t)),xp(1))}}return t.\u0275fac=function(e){return new(e||t)(Ei(XK),Ei(No))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),dQ=(()=>{class t{}return t.type="[CallToAction] Learn More",t})(),pQ=(()=>{class t{}return t.type="[CallToAction] Open Dialog",t})(),fQ=(()=>{class t{}return t.type="[CallToAction] Close Dialog",t})();var gQ;class mQ{get length(){var t,e;return null!==(e=null===(t=mQ.storage)||void 0===t?void 0:t.length)&&void 0!==e?e:0}key(t){var e,n;return null!==(n=null===(e=mQ.storage)||void 0===e?void 0:e.key(t))&&void 0!==n?n:null}getItem(t,e){var n,i,r;return null!==(r=null!==(i=null===(n=mQ.storage)||void 0===n?void 0:n.getItem(t))&&void 0!==i?i:e)&&void 0!==r?r:null}setItem(t,e){var n;try{return null===(n=mQ.storage)||void 0===n||n.setItem(t,e),!0}catch(i){return!1}}removeItem(t){var e;null===(e=mQ.storage)||void 0===e||e.removeItem(t)}clear(){var t;null===(t=mQ.storage)||void 0===t||t.clear()}}mQ.storage=(()=>{let t;try{t=window.localStorage;const e="__storage_test__";return t.setItem(e,e),t.removeItem(e),t}catch(e){return e instanceof DOMException&&(22===e.code||1014===e.code||"QuotaExceededError"===e.name||"NS_ERROR_DOM_QUOTA_REACHED"===e.name)&&t&&0!==t.length?t:void 0}})(),mQ.\u0275fac=function(t){return new(t||mQ)},mQ.\u0275prov=xt({token:mQ,factory:mQ.\u0275fac,providedIn:"root"});const bQ="callToActionPopupShown";let yQ=gQ=class{constructor(t,e,n,i,r){this.dialog=t,this.ga=e,this.storage=n,this.infoService=i,this.http=r}static ctaDatePassed(t,e=Date.now){return+e()>+new Date(t)}ngxsOnInit(t){const{expirationDate:e,popupShown:n}=t.getState(),i=this.storage.getItem(bQ,`${n}`),r=gQ.ctaDatePassed(e);"true"!==i&&!r&&t.dispatch(new pQ)}getDialogData(){return this.http.get("assets/docs/SPATIAL_SEARCH_README.md",{responseType:"text"}).pipe(D(t=>this.infoService.parseMarkdown(t)))}launchLearnMore(t){this.dialog.open(UK,{autoFocus:!1,panelClass:"modal-animated",width:"72rem",data:{title:"Spatial Search",content:t,videoID:"UfxMpzatowE"}})}learnMore(t){return this.dialog.closeAll(),this.ga.event("open_learn_more","call_to_action"),this.getDialogData().pipe(eg(t=>this.launchLearnMore(t)))}open(t){this.dialog.open(_Q,{autoFocus:!1,panelClass:"modal-animated",width:"30.75rem",height:"36.688rem"}),this.ga.event("open","call_to_action"),this.storage.setItem(bQ,"true"),t.patchState({popupShown:!0})}close(t){this.dialog.closeAll(),this.ga.event("close","call_to_action")}};yQ.\u0275fac=function(t){return new(t||yQ)(Ei(nG),Ei(jW),Ei(mQ),Ei($K),Ei(Jv))},yQ.\u0275prov=xt({token:yQ,factory:yQ.\u0275fac}),vw([eU(dQ)],yQ.prototype,"learnMore",null),vw([eU(pQ)],yQ.prototype,"open",null),vw([eU(fQ)],yQ.prototype,"close",null),yQ=gQ=vw([nU({name:"callToAction",defaults:{title:"New to the Exploration User Interface",message:"Spatial Search has arrived!",callToAction:"Learn More",imageUrl:"assets/images/spatial_search.gif",expirationDate:"Dec 1, 2022",popupShown:!1}})],yQ);let vQ=(()=>{class t{static title(t){return t.title}static message(t){return t.message}static callToAction(t){return t.callToAction}static imageUrl(t){return t.imageUrl}static expirationDate(t){return t.expirationDate}static popupShown(t){return t.popupShown}}return vw([rU([yQ])],t,"title",null),vw([rU([yQ])],t,"message",null),vw([rU([yQ])],t,"callToAction",null),vw([rU([yQ])],t,"imageUrl",null),vw([rU([yQ])],t,"expirationDate",null),vw([rU([yQ])],t,"popupShown",null),t})(),_Q=(()=>{class t{constructor(){this.close=()=>new fQ,this.learnMore=()=>new dQ}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Jt({type:t,selectors:[["ccf-call-to-action-behavior"]],decls:5,vars:12,consts:[[3,"infoTitle","message","callToAction","imageUrl","callToActionClicked","closeClicked"]],template:function(t,e){1&t&&(ra(0,"ccf-call-to-action",0),fa("callToActionClicked",function(){return e.learnMore()})("closeClicked",function(){return e.close()}),Dc(1,"async"),Dc(2,"async"),Dc(3,"async"),Dc(4,"async"),sa()),2&t&&na("infoTitle",Rc(1,4,e.title$))("message",Rc(2,6,e.message$))("callToAction",Rc(3,8,e.callToAction$))("imageUrl",Rc(4,10,e.imageUrl$))},directives:[qK],pipes:[$h],styles:[""],changeDetection:0}),vw([iU(vQ.title)],t.prototype,"title$",void 0),vw([iU(vQ.message)],t.prototype,"message$",void 0),vw([iU(vQ.callToAction)],t.prototype,"callToAction$",void 0),vw([iU(vQ.imageUrl)],t.prototype,"imageUrl$",void 0),vw([XY()],t.prototype,"close",void 0),vw([XY()],t.prototype,"learnMore",void 0),t})();function wQ(t,e){if(1&t&&(ra(0,"div",3),Ja(1),sa()),2&t){const t=va();ws(1),el(" ",t.label,"\n")}}function xQ(t,e){if(1&t){const t=ua();ra(0,"mat-list-item",4),ra(1,"div",5),ra(2,"mat-checkbox",6),fa("change",function(e){const n=$e(t).index;return va().updateItemSelection(n,e.checked)}),Ja(3),sa(),oa(4,"div",7),ra(5,"button",8),fa("click",function(){const e=$e(t).index;return va().removeItem(e)}),ra(6,"mat-icon"),Ja(7,"delete_outlined"),sa(),sa(),sa(),sa()}if(2&t){const t=e.$implicit;ws(2),na("checked",t.selected),ws(1),el(" ",t.description," ")}}let SQ=(()=>{class t{constructor(){this.clsName="ccf-spatial-search-list",this.label="",this.items=[],this.selectionChanged=new Bc,this.itemRemoved=new Bc}itemId(t,e){return e.description}updateItemSelection(t,e){const n=this.items=[...this.items];n[t]=Object.assign(Object.assign({},n[t]),{selected:e});const i=n.filter(t=>t.selected);this.selectionChanged.emit(i)}removeItem(t){const e=this.items=[...this.items],[n]=e.splice(t,1);this.itemRemoved.emit(n)}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Jt({type:t,selectors:[["ccf-spatial-search-list"]],hostVars:2,hostBindings:function(t,e){2&t&&Va(e.clsName)},inputs:{label:"label",items:"items"},outputs:{selectionChanged:"selectionChanged",itemRemoved:"itemRemoved"},decls:3,vars:3,consts:[["class","label",4,"ngIf"],[1,"list"],["class","item",4,"ngFor","ngForOf","ngForTrackBy"],[1,"label"],[1,"item"],[1,"item-content"],["labelPosition","after",1,"description",3,"checked","change"],[1,"filler"],["mat-icon-button","",1,"delete",3,"click"]],template:function(t,e){1&t&&(Jo(0,wQ,2,1,"div",0),ra(1,"mat-list",1),Jo(2,xQ,8,2,"mat-list-item",2),sa()),2&t&&(na("ngIf",e.label),ws(2),na("ngForOf",e.items)("ngForTrackBy",e.itemId))},directives:[Ah,sK,kh,lK,_K,R_,T_],styles:["[_nghost-%COMP%]{display:block}[_nghost-%COMP%] .label[_ngcontent-%COMP%]{margin-bottom:.5rem;font-weight:bold}[_nghost-%COMP%] .item[_ngcontent-%COMP%]{height:2rem}[_nghost-%COMP%] .item[_ngcontent-%COMP%] .item-content[_ngcontent-%COMP%]{display:flex;align-items:center;width:100%;height:2rem}[_nghost-%COMP%] .item[_ngcontent-%COMP%] .item-content[_ngcontent-%COMP%] .delete[_ngcontent-%COMP%]{width:2rem;height:2rem;line-height:2rem}[_nghost-%COMP%] .item[_ngcontent-%COMP%] .item-content[_ngcontent-%COMP%] .filler[_ngcontent-%COMP%]{flex-grow:1}[_nghost-%COMP%] .item[_ngcontent-%COMP%] > *{padding:0!important}"],changeDetection:0}),t})(),CQ=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Wh,L_,xK,k_,cK]]}),t})(),EQ=(()=>{class t{constructor(){this.clsName="ccf-xyz-position",this.x=0,this.y=0,this.z=0,this.format="1.0-2"}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Jt({type:t,selectors:[["ccf-xyz-position"]],hostVars:2,hostBindings:function(t,e){2&t&&Va(e.clsName)},inputs:{x:"x",y:"y",z:"z"},decls:9,vars:12,consts:[[1,"line"]],template:function(t,e){1&t&&(ra(0,"span",0),Ja(1),Dc(2,"number"),sa(),ra(3,"span",0),Ja(4),Dc(5,"number"),sa(),ra(6,"span",0),Ja(7),Dc(8,"number"),sa()),2&t&&(ws(1),el("X: ",Nc(2,3,e.x,e.format),""),ws(3),el("Y: ",Nc(5,6,e.y,e.format),""),ws(3),el("Z: ",Nc(8,9,e.z,e.format),""))},pipes:[Gh],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column}[_nghost-%COMP%] .line[_ngcontent-%COMP%]{font-size:1rem;font-weight:400}"],changeDetection:0}),t})(),OQ=(()=>{class t extends Tf{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 TQ=new oi("Default theme class");let kQ=(()=>{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(Dl,null);if(!s)return;const o=i.nativeElement,a=null===(n=r.get(Tf,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)(Ei(TQ,8))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();const PQ={initialConfig:{},parse:{},rename:{}};class AQ{constructor(t,e){this.configState=t,this.storedChanges={},this.options=Object.assign(Object.assign({},PQ),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 MQ=(()=>{class t{constructor(t,e,n={}){this.configState=t,this.cdr=e,this.options=n,this.initialized=!1,this.configManager=new AQ(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 IQ={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}};var DQ;const RQ={production:!0,disableDbWorker:!0,acceptableViewerDomains:["https://portal.hubmapconsortium.org","https://portal.test.hubmapconsortium.org"],dbOptions:{ccfOwlUrl:"https://ccf-api.hubmapconsortium.org/v1/ccf.owl.n3store.json",ccfContextUrl:"https://hubmapconsortium.github.io/ccf-ontology/ccf-context.jsonld",dataSources:["assets/kpmp/data/rui_locations.jsonld","assets/sparc/data/rui_locations.jsonld","assets/gtex/data/rui_locations.jsonld","assets/sea-ad/data/rui_locations.jsonld","assets/allen-institute/data/rui_locations.jsonld"],hubmapDataService:"search-api",hubmapPortalUrl:"https://portal.hubmapconsortium.org/",hubmapDataUrl:"https://search.api.hubmapconsortium.org/v3/entities/search",hubmapAssetsUrl:"https://assets.hubmapconsortium.org",hubmapToken:null!==(DQ=localStorage.getItem("HUBMAP_TOKEN"))&&void 0!==DQ?DQ:"",useRemoteApi:!1,remoteApiEndpoint:"https://ccf-api.hubmapconsortium.org/v1"},customization:{theme:"hubmap",header:!0,homeUrl:"https://portal.hubmapconsortium.org/",logoTooltip:"Human BioMolecular Atlas Project"},googleAnalyticsToken:"portal.hubmapconsortium.org"===window.location.hostname?"G-1WRJHN9FM6":"G-J9HWV9QPJ4"};function NQ(t){return(...e)=>new t(...e)}function LQ(t,e){return n=>n.lift(new jQ(t,e))}class jQ{constructor(t,e){this.keySelector=t,this.flushes=e}call(t,e){return e.subscribe(new FQ(t,this.keySelector,this.flushes))}}class FQ 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))}}class BQ{constructor(t,e){this.count=t,this.source=e}call(t,e){return e.subscribe(new VQ(t,this.count,this.source))}}class VQ extends v{constructor(t,e,n){super(t),this.count=e,this.source=n}complete(){if(!this.isStopped){const{source:t,count:e}=this;if(0===e)return super.complete();e>-1&&(this.count=e-1),t.subscribe(this._unsubscribeAndRecycle())}}}let zQ=(()=>{class t{constructor(t){this.filter=t}}return t.type="[DataState] Update filter",t})();const UQ={sex:"Both",ageRange:[1,110],bmiRange:[13,83],tmc:[],technologies:[],ontologyTerms:["http://purl.obolibrary.org/obo/UBERON_0013702"],cellTypeTerms:["http://purl.obolibrary.org/obo/CL_0000000"],spatialSearches:[]};var HQ=(()=>(function(t){t.Running="running",t.Completed="completed"}(HQ||(HQ={})),HQ))();function $Q(t){return()=>t.next(HQ.Completed)}function GQ(t,e){return n=>n.pipe(cp(t),eg(e),WW(1),Z())}let WQ=class extends AW{constructor(t){super(),this.source=t,this.databaseReady$=this.state$.pipe(T$("status"),LQ(),ep(t=>"Ready"===t)),this._tissueBlockDataQueryStatus$=new _p(1),this._aggregateDataQueryStatus$=new _p(1),this._ontologyTermOccurencesDataQueryStatus$=new _p(1),this._cellTypeTermOccurencesDataQueryStatus$=new _p(1),this._sceneDataQueryStatus$=new _p(1),this._technologyFilterQueryStatus$=new _p(1),this._providerFilterQueryStatus$=new _p(1),this.ontologyTermsFullData$=new _p(1),this.cellTypeTermsFullData$=new _p(1),this.filter$=this.state$.pipe(T$("filter")),this.tissueBlockData$=this.filter$.pipe(GQ(this.tissueBlockData,$Q(this._tissueBlockDataQueryStatus$))),this.aggregateData$=this.filter$.pipe(GQ(this.aggregateData,$Q(this._aggregateDataQueryStatus$))),this.ontologyTermOccurencesData$=this.filter$.pipe(GQ(this.ontologyTermOccurencesData,$Q(this._ontologyTermOccurencesDataQueryStatus$))),this.cellTypeTermOccurencesData$=this.filter$.pipe(GQ(this.cellTypeTermOccurencesData,$Q(this._cellTypeTermOccurencesDataQueryStatus$))),this.sceneData$=this.filter$.pipe(GQ(this.sceneData,$Q(this._sceneDataQueryStatus$))),this.technologyFilterData$=this.filter$.pipe(GQ(this.technologyFilterData,$Q(this._technologyFilterQueryStatus$))),this.providerFilterData$=this.filter$.pipe(GQ(this.providerFilterData,$Q(this._providerFilterQueryStatus$))),this.tissueBlockDataQueryStatus$=this._tissueBlockDataQueryStatus$.pipe(LQ()),this.aggregateDataQueryStatus$=this._aggregateDataQueryStatus$.pipe(LQ()),this.ontologyTermOccurencesDataQueryStatus$=this._ontologyTermOccurencesDataQueryStatus$.pipe(LQ()),this.cellTypeTermOccurencesDataQueryStatus$=this._cellTypeTermOccurencesDataQueryStatus$.pipe(LQ()),this.sceneDataQueryStatus$=this._sceneDataQueryStatus$.pipe(LQ()),this.technologyFilterQueryStatus$=this._technologyFilterQueryStatus$.pipe(LQ()),this.providerFilterQueryStatus$=this._providerFilterQueryStatus$.pipe(LQ()),this.queryStatus$=z_([this.tissueBlockDataQueryStatus$,this.aggregateDataQueryStatus$,this.ontologyTermOccurencesDataQueryStatus$,this.cellTypeTermOccurencesDataQueryStatus$,this.sceneDataQueryStatus$,this.technologyFilterQueryStatus$,this.providerFilterQueryStatus$]).pipe(D(t=>function(t){return t.every(t=>t===HQ.Completed)}(t)?HQ.Completed:HQ.Running),LQ()),this._tissueBlockDataQueryStatus$.next(HQ.Completed),this._aggregateDataQueryStatus$.next(HQ.Completed),this._ontologyTermOccurencesDataQueryStatus$.next(HQ.Completed),this._cellTypeTermOccurencesDataQueryStatus$.next(HQ.Completed),this._sceneDataQueryStatus$.next(HQ.Completed),this._technologyFilterQueryStatus$.next(HQ.Completed),this._providerFilterQueryStatus$.next(HQ.Completed)}ngxsOnInit(){const{ontologyTermsFullData$:t,ontologyTermOccurencesData$:e,cellTypeTermsFullData$:n,cellTypeTermOccurencesData$:i,source:r,snapshot:{filter:s}}=this;s===UQ?(e.pipe(rf(1)).subscribe(t),i.pipe(rf(1)).subscribe(n)):(r.getOntologyTermOccurences().pipe(rf(1)).subscribe(t),r.getCellTypeTermOccurences().pipe(rf(1)).subscribe(n)),this.source.getOntologyTreeModel().pipe(rf(1)).subscribe(t=>this.updateAnatomicalStructuresTreeModel(t)),this.source.getCellTypeTreeModel().pipe(rf(1)).subscribe(t=>this.updateCellTypesTreeModel(t)),this.warmUpDatabase()}warmUpDatabase(){vH(()=>this.source.getDatabaseStatus()).pipe(eg(t=>this.updateStatus(t)),JH(2e3),rf(1)).pipe(function(t=-1){return e=>0===t?fp():e.lift(new BQ(t<0?-1:t-1,e))}(1e3),af(t=>"Loading"===t.status)).subscribe(),this.databaseReady$.pipe(rf(1),eg(()=>{this.updateStatus({status:"Ready",message:"Loading CCF Exploration User Interface (EUI)"})})).subscribe()}updateAnatomicalStructuresTreeModel(t){this.ctx.patchState({anatomicalStructuresTreeModel:t})}updateCellTypesTreeModel(t){this.ctx.patchState({cellTypesTreeModel:t})}updateStatus(t){this.ctx.patchState({status:t.status,statusMessage:t.message})}updateFilter(t){this.ctx.patchState({filter:Object.assign(Object.assign({},this.getState().filter),t)})}updateFilterHandler(t,{filter:e}){this.updateFilter(e)}tissueBlockData(t){return this._tissueBlockDataQueryStatus$.next(HQ.Running),this.databaseReady$.pipe(cp(()=>this.source.getTissueBlockResults(t)))}aggregateData(t){return this._aggregateDataQueryStatus$.next(HQ.Running),this.databaseReady$.pipe(cp(()=>this.source.getAggregateResults(t)))}ontologyTermOccurencesData(t){return this._ontologyTermOccurencesDataQueryStatus$.next(HQ.Running),this.databaseReady$.pipe(cp(()=>this.source.getOntologyTermOccurences(t)))}cellTypeTermOccurencesData(t){return this._cellTypeTermOccurencesDataQueryStatus$.next(HQ.Running),this.databaseReady$.pipe(cp(()=>this.source.getCellTypeTermOccurences(t)))}sceneData(t){return this._sceneDataQueryStatus$.next(HQ.Running),this.databaseReady$.pipe(cp(()=>this.source.getScene(t)))}technologyFilterData(){return this._technologyFilterQueryStatus$.next(HQ.Running),this.databaseReady$.pipe(cp(()=>this.source.getDatasetTechnologyNames()))}providerFilterData(){return this._providerFilterQueryStatus$.next(HQ.Running),this.databaseReady$.pipe(cp(()=>this.source.getProviderNames()))}};WQ.\u0275fac=function(t){return new(t||WQ)(Ei(eQ))},WQ.\u0275prov=xt({token:WQ,factory:WQ.\u0275fac}),vw([OW(),_w(0,TW("treeModel"))],WQ.prototype,"updateAnatomicalStructuresTreeModel",null),vw([OW(),_w(0,TW("treeModel"))],WQ.prototype,"updateCellTypesTreeModel",null),vw([OW(),_w(0,TW("status"))],WQ.prototype,"updateStatus",null),vw([OW(),_w(0,TW("filter"))],WQ.prototype,"updateFilter",null),vw([eU(zQ)],WQ.prototype,"updateFilterHandler",null),vw([PV.ak],WQ.prototype,"tissueBlockData",null),vw([PV.ak],WQ.prototype,"aggregateData",null),vw([PV.ak],WQ.prototype,"ontologyTermOccurencesData",null),vw([PV.ak],WQ.prototype,"cellTypeTermOccurencesData",null),vw([PV.ak],WQ.prototype,"sceneData",null),vw([PV.ak],WQ.prototype,"technologyFilterData",null),vw([PV.ak],WQ.prototype,"providerFilterData",null),WQ=vw([kW(),nU({name:"data",defaults:{filter:UQ,status:"Loading",statusMessage:"Loading database"}})],WQ);class qQ{static filter(t){return t.filter}static anatomicalStructuresTreeModel(t){var e;return null!==(e=t.anatomicalStructuresTreeModel)&&void 0!==e?e:{root:"",nodes:{}}}static cellTypesTreeModel(t){var e;return null!==(e=t.cellTypesTreeModel)&&void 0!==e?e:{root:"",nodes:{}}}}vw([rU([WQ])],qQ,"filter",null),vw([rU([WQ])],qQ,"anatomicalStructuresTreeModel",null),vw([rU([WQ])],qQ,"cellTypesTreeModel",null);let XQ=(()=>{class t{constructor(t,e,n){this.sex=t,this.organName=e,this.search=n}}return t.type="[Spatial Search Filter] Add",t})(),YQ=(()=>{class t{constructor(t){this.id=t}}return t.type="[Spatial Search Filter] Remove",t})(),KQ=(()=>{class t{constructor(t){this.items=t}}return t.type="[Spatial Search Filter] Set selected searches",t})();let QQ=class{addSearch(t,{sex:e,organName:n,search:i}){t.setState(function(t){return function(e){return t&&t.length||!e?Array.isArray(e)?e.concat(t):t:e}}([this.createItem(e,n,i)]))}removeSearch(t,{id:e}){t.setState(function(t){return function(e){let n=-1;if(function(t){return"function"==typeof t}(t)?n=e.findIndex(t):function(t){return"number"==typeof t}(t)&&(n=t),function(t){return Number.isNaN(t)||-1===t}(n))return e;const i=e.slice();return i.splice(n,1),i}}(t=>(null==t?void 0:t.id)===e))}setSelectedSearches(t,{items:e}){const n=new Map(e.map(t=>[t.id,t])),i=t.getState().map(t=>{var e;return null!==(e=n.get(t.id))&&void 0!==e?e:t.selected?Object.assign(Object.assign({},t),{selected:!1}):t});t.setState(i)}createItem(t,e,n){return{id:this.createItemId(n),selected:!0,description:this.createItemDescription(t,e,n),sex:t,search:n}}createItemId(t){const{x:e,y:n,z:i,radius:r,target:s}=t;return`${s}-${r}-${e},${n},${i}`}createItemDescription(t,e,n){const i=t=>t.slice(0,1).toUpperCase()+t.slice(1),{x:r,y:s,z:o,radius:a}=n;return`${i(t)}, ${i(e)}, ${a.toFixed(1)} mm, X: ${r.toFixed(1)}, Y: ${s.toFixed(1)}, Z: ${o.toFixed(1)}`}};QQ.\u0275fac=function(t){return new(t||QQ)},QQ.\u0275prov=xt({token:QQ,factory:QQ.\u0275fac}),vw([eU(XQ)],QQ.prototype,"addSearch",null),vw([eU(YQ)],QQ.prototype,"removeSearch",null),vw([eU(KQ)],QQ.prototype,"setSelectedSearches",null),QQ=vw([nU({name:"spatialSearchFilter",defaults:[]})],QQ);class ZQ{static items(t){return t}static searches(t){return t.map(t=>t.search)}static selectedSearches(t){return t.filter(t=>t.selected).map(t=>t.search)}}vw([rU([QQ])],ZQ,"items",null),vw([rU([ZQ.items])],ZQ,"searches",null),vw([rU([ZQ.items])],ZQ,"selectedSearches",null);const JQ=new RegExp("[^#a-f\\d]","gi"),tZ=new RegExp("^#?[a-f\\d]{3}[a-f\\d]?$|^#?[a-f\\d]{6}([a-f\\d]{2})?$","i"),eZ=["#FF8800","#2979ff","#ffd740","#b92dff","#da326f","#7323e2","#acf32b","#82B1FF","#E040FB","#00E5FF"].map((t,e)=>{const n=function(t,e={}){if("string"!=typeof t||JQ.test(t)||!tZ.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 nZ=class extends MW{constructor(){super(...arguments),this.forcedUnassignment=new A,this.forcedUnassignment$=this.forcedUnassignment.asObservable(),this.colorAssignments$=this.state$.pipe(T$("colorAssignments"),Wd()),this.colorAssignmentsList$=this.state$.pipe(T$("colorAssignmentsList"),Wd())}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}))}};nZ.\u0275fac=function(){let t;return function(e){return(t||(t=ei(nZ)))(e||nZ)}}(),nZ.\u0275prov=xt({token:nZ,factory:nZ.\u0275fac}),vw([OW(),_w(0,TW("key")),_w(1,TW("doReset"))],nZ.prototype,"assignColor",null),vw([OW(),_w(0,TW("key"))],nZ.prototype,"unassignColor",null),nZ=vw([kW(),nU({name:"colors",defaults:{colorPalette:eZ.concat(),colorsAvailable:eZ.concat(),colorAssignments:{},colorAssignmentsList:[]}})],nZ);let iZ=class extends MW{constructor(t,e){super(),this.dataService=t,this.injector=e,this.listResults$=this.state$.pipe(T$("listResults"),Wd()),this.highlightedNodeId$=this.state$.pipe(T$("highlightedNodeId"),Wd())}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(WQ),this.colorAssignments=this.injector.get(nZ),z_([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,gq.sortBy)(n,["rank"]).concat(i)}),eg(t=>this.setListResults(t))).subscribe()}};iZ.\u0275fac=function(t){return new(t||iZ)(Ei(eQ),Ei(No))},iZ.\u0275prov=xt({token:iZ,factory:iZ.\u0275fac}),vw([OW(),_w(0,TW("listResults"))],iZ.prototype,"setListResults",null),iZ=vw([kW(),nU({name:"listResults",defaults:{listResults:[]}})],iZ);const rZ=new Set(["Skin","Heart","Kidney","Spleen"]);let sZ=class extends MW{constructor(t,e){super(),this.dataService=t,this.injector=e,this.referenceOrgans$=this.state$.pipe(T$("referenceOrgans"),Wd()),this.selectedReferenceOrgans$=this.state$.pipe(T$("selectedReferenceOrgans"),Wd()),this.scene$=this.state$.pipe(T$("scene"),Wd()),this.highlightedId$=this.state$.pipe(T$("highlightedId"),Wd())}static referenceOrgans(t){return t.referenceOrgans}static referenceOrganEntities(t){return t.referenceOrganEntities}setSelectedReferenceOrgans(t){this.ctx.patchState({selectedReferenceOrgans:t})}setReferenceOrgans(t){this.ctx.patchState({referenceOrgans:t})}setReferenceOrganEntities(t){this.ctx.patchState({referenceOrganEntities: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(WQ),this.colorAssignments=this.injector.get(nZ),this.listResults=this.injector.get(iZ),this.dataService.getReferenceOrgans().pipe(eg(t=>this.setReferenceOrganEntities(t)),D(t=>{const e=new Set(t.map(t=>t.representation_of));return DK.filter(t=>e.has(t.id)).map(t=>Object.assign(Object.assign({},t),{disabled:!1,numResults:0}))}),rf(1),eg(t=>{this.setReferenceOrgans(t),this.setSelectedReferenceOrgans(t.filter(t=>rZ.has(t.organ)))})).subscribe(),z_([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)}),eg(t=>this.setScene(t))).subscribe()}};function oZ(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 aZ(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 lZ(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 cZ(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())}}sZ.\u0275fac=function(t){return new(t||sZ)(Ei(eQ),Ei(No))},sZ.\u0275prov=xt({token:sZ,factory:sZ.\u0275fac}),vw([OW(),_w(0,TW("selectedReferenceOrgans"))],sZ.prototype,"setSelectedReferenceOrgans",null),vw([OW(),_w(0,TW("referenceOrgans"))],sZ.prototype,"setReferenceOrgans",null),vw([OW(),_w(0,TW("referenceOrganEntities"))],sZ.prototype,"setReferenceOrganEntities",null),vw([OW(),_w(0,TW("scene"))],sZ.prototype,"setScene",null),vw([rU()],sZ,"referenceOrgans",null),vw([rU()],sZ,"referenceOrganEntities",null),sZ=vw([kW(),nU({name:"scene",defaults:{scene:[],referenceOrgans:[],referenceOrganEntities:[],selectedReferenceOrgans:[],selectedAnatomicalStructures:[],anatomicalStructureSettings:{}}})],sZ);const uZ=".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",hZ=Xy(class{constructor(t){this._elementRef=t}},"primary"),dZ=new oi("mat-progress-spinner-default-options",{providedIn:"root",factory:function(){return{diameter:100}}});class pZ extends hZ{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=pZ._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=Pd(t),this._spinnerAnimationLabel=this._getSpinnerAnimationLabel(),!this._fallbackAnimation&&this._styleRoot&&this._attachStyleNode()}get strokeWidth(){return this._strokeWidth||this.diameter/10}set strokeWidth(t){this._strokeWidth=Pd(t)}get value(){return"determinate"===this.mode?this._value:0}set value(t){this._value=Math.max(0,Math.min(100,Pd(t)))}ngOnInit(){const t=this._elementRef.nativeElement;this._styleRoot=Rp(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=pZ._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(".","_")}}pZ.\u0275fac=function(t){return new(t||pZ)(ea(Al),ea(Ep),ea(th,8),ea(Ny,8),ea(dZ))},pZ.\u0275cmp=Jt({type:pZ,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,oZ,1,9,"circle",1),Jo(2,aZ,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:[Rh,Nh],styles:[uZ],encapsulation:2,changeDetection:0}),pZ._diameters=new WeakMap;let fZ=(()=>{class t extends pZ{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(Al),ea(Ep),ea(th,8),ea(Ny,8),ea(dZ))},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,lZ,1,9,"circle",1),Jo(2,cZ,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:[Rh,Nh],styles:[uZ],encapsulation:2,changeDetection:0}),t})(),gZ=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Wy,Wh],Wy]}),t})(),mZ=(()=>{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&&(Va(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),Ja(2),sa()),2&t&&(ws(2),tl(e.text))},directives:[fZ],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 bZ={isolated:!0},yZ=new oi("Message service configuration",{providedIn:"root",factory:()=>bZ});let vZ=(()=>{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(ep(t=>t.source!==this.source))}getMessagesFromSource(t){return this.getMessages().pipe(ep(e=>e.source===t))}getMessagesFromSources(t){return this.getMessages().pipe(ep(e=>t.includes(e.source)))}nextMessageId(){return t.counter++}}return t.counter=0,t})();const _Z=(()=>{class t{constructor(t,e){this.config=t,this.parent=e,this.channel=new A,this.messages=t.isolated||!e?this.channel.asObservable():U([this.channel,e.messages.pipe(af(()=>!this.channel.closed))]).pipe(Y())}ngOnDestroy(){this.channel.complete()}connect(t){return new vZ(t,this.channel,this.messages)}}return t.\u0275fac=function(e){return new(e||t)(Ei(yZ),Ei(t,12))},t.\u0275prov=xt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})(),wZ=["*"];let xZ=(()=>{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(_Z),ea(nc))},t.\u0275cmp=Jt({type:t,selectors:[["ccf-drawer-content"]],hostVars:9,hostBindings:function(t,e){2&t&&(sl("@fadeInOut",e.faded),Va(e.className),La("margin-left",e.leftMargin,"px")("margin-right",e.rightMargin,"px"),ja("cff-drawer-content-animations",e.animationsEnabled))},ngContentSelectors:wZ,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:[Qg("fadeInOut",[em("false",tm({opacity:1})),em("true",tm({opacity:0})),im("false <=> true",Zg("1s"))])]},changeDetection:0}),t})();const SZ=["*"],CZ={params:{width:0,margin:0,margin2:0}};class EZ{constructor(){this.initialized=!1,this.deferred=new Promise(t=>{this.resolve=t})}set(){this.initialized=!0,this.resolve()}wait(){return xw(this,void 0,void 0,function*(){return this.deferred})}valueOf(){return this.initialized}}let OZ=(()=>{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 Bc(!0),this.expandedChange=new Bc(!0),this.stateChange=new Bc(!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 EZ,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(kd(t))}get expanded(){return this._expanded}set expanded(t){this.toggleExpanded(kd(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 xw(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(_Z),ea(nc),ea(Al))},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&&(sl("@openClose",e.openedState)("@expandCollapse",e.expandedStateObj),Va(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:SZ,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:[Qg("openClose",[em("open, open-instant",tm({transform:"none"})),em("closed",tm({})),im("closed => open-instant",Zg(0)),im("closed <=> open, open-instant => closed",Zg(".5s ease-in-out"))]),Qg("expandCollapse",[em("collapsed",tm({})),em("half",tm({width:"calc(50% - {{ margin }}px)"}),CZ),em("extended",tm({width:"calc(100% - {{ width }}px - {{ margin }}px)"}),CZ),em("full",tm({width:"calc(100% - {{ margin }}px - {{ margin2 }}px)"}),CZ),im("* <=> *",Zg(".5s ease-in-out"))])]},changeDetection:0}),t})();function TZ(t,e){1&t&&(ra(0,"ccf-drawer-content"),xa(1,2),sa())}const kZ=[[["ccf-drawer"]],[["ccf-drawer-content"]],"*"],PZ=["ccf-drawer","ccf-drawer-content","*"];function AZ(t){throw new Error(`Multiple drawers in position ${t}`)}let MZ=(()=>{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(lp(null)).subscribe(()=>{const t=this.validateDrawers();this.channel.sendMessage({type:"drawer-containers-changed",drawers:t}),this.cdr.markForCheck()}),this.content1.changes.pipe(lp(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&&AZ("start"),n.length>1&&AZ("end"),[e[0],n[0]]}}return t.\u0275fac=function(e){return new(e||t)(ea(_Z),ea(nc))},t.\u0275cmp=Jt({type:t,selectors:[["ccf-drawer-container"]],contentQueries:function(t,e,n){if(1&t&&(Jc(n,OZ,5),Jc(n,xZ,5)),2&t){let t;Qc(t=tu())&&(e.drawers=t),Qc(t=tu())&&(e.content1=t)}},viewQuery:function(t,e){if(1&t&&Zc(xZ,5),2&t){let t;Qc(t=tu())&&(e.content2=t)}},hostVars:2,hostBindings:function(t,e){2&t&&Va(e.className)},exportAs:["ccfDrawerContainer"],features:[xl([_Z])],ngContentSelectors:PZ,decls:3,vars:1,consts:[[4,"ngIf"]],template:function(t,e){1&t&&(wa(kZ),xa(0),xa(1,1),Jo(2,TZ,2,0,"ccf-drawer-content",0)),2&t&&(ws(2),na("ngIf",!e.hasWrappedContent))},directives:[Ah,xZ],styles:["[_nghost-%COMP%]{display:block;position:relative;z-index:1;overflow:hidden;-webkit-overflow-scrolling:touch}"],changeDetection:0}),t})(),IZ=(()=>{class t{}return t.type="[SpatialSearchUi] Start the Spatial Search flow",t})(),DZ=(()=>{class t{constructor(t){this.sex=t}}return t.type="[SpatialSearchUi] Set sex",t})(),RZ=(()=>{class t{constructor(t){this.organId=t}}return t.type="[SpatialSearchUi] Set organ",t})(),NZ=(()=>{class t{constructor(t){this.position=t}}return t.type="[SpatialSearchUi] Set position",t})(),LZ=(()=>{class t{constructor(t){this.node=t}}return t.type="[SpatialSearchUi] Start moving the position to a scene node",t})(),jZ=(()=>{class t{}return t.type="[SpatialSearchUi] Reset position",t})(),FZ=(()=>{class t{constructor(t){this.radius=t}}return t.type="[SpatialSearchUi] Set radius",t})(),BZ=(()=>{class t{}return t.type="[SpatialSearchUi] Reset radius",t})(),VZ=(()=>{class t{}return t.type="[SpatialSearchUi] Update spatial search data",t})(),zZ=(()=>{class t{}return t.type="[SpatialSearchUi] Generate and add a spatial search",t})(),UZ=(()=>{class t{constructor(t=!0){this.execute=t}}return t.type="[SpatialSearchUi] Set execute search on generate",t})();const HZ=["trigger"],$Z=["panel"];function GZ(t,e){if(1&t&&(ra(0,"span",8),Ja(1),sa()),2&t){const t=va();ws(1),tl(t.placeholder)}}function WZ(t,e){if(1&t&&(ra(0,"span",12),Ja(1),sa()),2&t){const t=va(2);ws(1),tl(t.triggerValue)}}function qZ(t,e){1&t&&xa(0,0,["*ngSwitchCase","true"])}function XZ(t,e){1&t&&(ra(0,"span",9),Jo(1,WZ,2,1,"span",10),Jo(2,qZ,1,0,"ng-content",11),sa()),2&t&&(na("ngSwitch",!!va().customTrigger),ws(2),na("ngSwitchCase",!0))}function YZ(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),il("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 KZ=[[["mat-select-trigger"]],"*"],QZ=["mat-select-trigger","*"],ZZ={transformPanelWrap:Qg("transformPanelWrap",[im("* => void",sm("@transformPanel",[rm()],{optional:!0}))]),transformPanel:Qg("transformPanel",[em("void",tm({transform:"scaleY(0.8)",minWidth:"100%",opacity:0})),em("showing",tm({opacity:1,minWidth:"calc(100% + 32px)",transform:"scaleY(1)"})),em("showing-multiple",tm({opacity:1,minWidth:"calc(100% + 64px)",transform:"scaleY(1)"})),im("void => *",Zg("120ms cubic-bezier(0, 0, 0.2, 1)")),im("* => void",Zg("100ms 25ms linear",tm({opacity:0})))])};let JZ=0;const tJ=new oi("mat-select-scroll-strategy"),eJ=new oi("MAT_SELECT_CONFIG"),nJ={provide:tJ,deps:[Vf],useFactory:function(t){return()=>t.scrollStrategies.reposition()}};class iJ{constructor(t,e){this.source=t,this.value=e}}const rJ=Yy(Ky(qy(Qy(class{constructor(t,e,n,i,r){this._elementRef=t,this._defaultErrorStateMatcher=e,this._parentForm=n,this._parentFormGroup=i,this.ngControl=r}})))),sJ=new oi("MatSelectTrigger");let oJ=(()=>{class t extends rJ{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-"+JZ++,this._triggerAriaLabelledBy=null,this._destroy=new A,this._onChange=()=>{},this._onTouched=()=>{},this._valueId="mat-select-value-"+JZ++,this._panelDoneAnimatingStream=new A,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=vH(()=>{const t=this.options;return t?t.changes.pipe(lp(t),cp(()=>Q(...t.map(t=>t.onSelectionChange)))):this._ngZone.onStable.pipe(rf(1),cp(()=>this.optionSelectionChanges))}),this.openedChange=new Bc,this._openedStream=this.openedChange.pipe(ep(t=>t),D(()=>{})),this._closedStream=this.openedChange.pipe(ep(t=>!t),D(()=>{})),this.selectionChange=new Bc,this.valueChange=new Bc,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=kd(t),this.stateChanges.next()}get multiple(){return this._multiple}set multiple(t){this._multiple=kd(t)}get disableOptionCentering(){return this._disableOptionCentering}set disableOptionCentering(t){this._disableOptionCentering=kd(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=Pd(t)}get id(){return this._id}set id(t){this._id=t||this._uid,this.stateChanges.next()}ngOnInit(){this._selectionModel=new Vp(this.multiple),this.stateChanges.next(),this._panelDoneAnimatingStream.pipe(Wd(),rp(this._destroy)).subscribe(()=>this._panelDoneAnimating(this.panelOpen))}ngAfterContentInit(){this._initKeyManager(),this._selectionModel.changed.pipe(rp(this._destroy)).subscribe(t=>{t.added.forEach(t=>t.select()),t.removed.forEach(t=>t.deselect())}),this.options.changes.pipe(lp(null),rp(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&&!uf(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||uf(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(rf(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 Eg(this.options).withTypeAhead(this._typeaheadDebounceInterval).withVerticalOrientation().withHorizontalOrientation(this._isRtl()?"rtl":"ltr").withHomeAndEnd().withAllowedModifierKeys(["shiftKey"]),this._keyManager.tabOut.pipe(rp(this._destroy)).subscribe(()=>{this.panelOpen&&(!this.multiple&&this._keyManager.activeItem&&this._keyManager.activeItem._selectViaInteraction(),this.focus(),this.close())}),this._keyManager.change.pipe(rp(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(rp(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(rp(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(Hp),ea(nc),ea(Tu),ea(Zy),ea(Al),ea(Fp,8),ea(sH,8),ea(gH,8),ea(KH,8),ea(PU,10),ii("tabindex"),ea(tJ),ea(Bg),ea(eJ,8))},t.\u0275dir=se({type:t,viewQuery:function(t,e){if(1&t&&(Zc(HZ,5),Zc($Z,5),Zc($f,5)),2&t){let t;Qc(t=tu())&&(e.trigger=t.first),Qc(t=tu())&&(e.panel=t.first),Qc(t=tu())&&(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})(),aJ=(()=>{class t extends oJ{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(rp(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(rf(1)).subscribe(()=>{this._triggerFontSize&&this._overlayDir.overlayRef&&this._overlayDir.overlayRef.overlayElement&&(this._overlayDir.overlayRef.overlayElement.style.fontSize=`${this._triggerFontSize}px`)}))}_scrollOptionIntoView(t){const e=xv(t,this.options,this.optionGroups),n=this._getItemHeight();this.panel.nativeElement.scrollTop=0===t&&1===e?0:Sv((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 iJ(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+=xv(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&&(Jc(n,sJ,5),Jc(n,wv,5),Jc(n,bv,5)),2&t){let t;Qc(t=tu())&&(e.customTrigger=t.first),Qc(t=tu())&&(e.options=t),Qc(t=tu())&&(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:[xl([{provide:BH,useExisting:t},{provide:pv,useExisting:t}]),jo],ngContentSelectors:QZ,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(KZ),ra(0,"div",0,1),fa("click",function(){return e.toggle()}),ra(3,"div",2),Jo(4,GZ,2,1,"span",3),Jo(5,XZ,3,2,"span",4),sa(),ra(6,"div",5),oa(7,"div",6),sa(),sa(),Jo(8,YZ,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:[Hf,Rh,Nh,$f,Lh,Oh],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:[ZZ.transformPanelWrap,ZZ.transformPanel]},changeDetection:0}),t})(),lJ=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({providers:[nJ],imports:[[Wh,Wf,Cv,Wy],$p,ZH,Cv,Wy]}),t})();function cJ(t,e){if(1&t&&(ra(0,"mat-option",6),ra(1,"div"),Ja(2),sa(),sa()),2&t){const t=e.$implicit,n=va();na("value",t),ws(1),Va(n.optionsVisible),ws(1),el(" ",t," ")}}let uJ=(()=>{class t{constructor(t){this.ga=t,this.selectionChange=new Bc,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(jW))},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),Ja(4),sa(),ra(5,"mat-select",4),fa("selectionChange",function(t){return e.selectionChanged(t.value)})("openedChange",function(){return e.toggleOptions()}),Jo(6,cJ,3,5,"mat-option",5),sa(),sa(),sa(),sa()),2&t&&(ws(4),el(" ",e.label," "),ws(1),na("value",e.selection),ws(1),na("ngForOf",e.options))},directives:[QH,aJ,kh,wv],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})();var hJ=n(25430),dJ=n(39053),pJ=n(26202);const fJ=["tooltipTemplate"],gJ=["leftOuterSelectionBar"],mJ=["rightOuterSelectionBar"],bJ=["fullBar"],yJ=["selectionBar"],vJ=["minHandle"],_J=["maxHandle"],wJ=["floorLabel"],xJ=["ceilLabel"],SJ=["minHandleLabel"],CJ=["maxHandleLabel"],EJ=["combinedLabel"],OJ=["ticksElement"];function TJ(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 kJ(t,e){1&t&&oa(0,"span",32),2&t&&na("innerHTML",va().$implicit.legend,vr)}const PJ=function(t){return{"ng5-slider-selected":t}};function AJ(t,e){if(1&t&&(ra(0,"span",27),oa(1,"ng5-slider-tooltip-wrapper",28),Jo(2,TJ,1,4,"ng5-slider-tooltip-wrapper",29),Jo(3,kJ,1,1,"span",30),sa()),2&t){const t=e.$implicit,n=va();na("ngClass",Pc(7,PJ,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 MJ(t,e){}function IJ(t,e){1&t&&Jo(0,MJ,0,0,"ng-template")}const DJ=function(t,e,n){return{tooltip:t,placement:e,content:n}};function RJ(t,e){if(1&t&&(aa(0),Jo(1,IJ,1,0,void 0,1),la()),2&t){const t=va();ws(1),na("ngTemplateOutlet",t.template)("ngTemplateOutletContext",Ac(2,DJ,t.tooltip,t.placement,t.content))}}function NJ(t,e){if(1&t&&(aa(0),ra(1,"div",2),Ja(2),sa(),la()),2&t){const t=va();ws(1),Ko("title",t.tooltip)("data-tooltip-placement",t.placement),ws(1),el(" ",t.content," ")}}const LJ={Min:0,Max:1};LJ[LJ.Min]="Min",LJ[LJ.Max]="Max";const jJ={Low:0,High:1,Floor:2,Ceil:3,TickValue:4};jJ[jJ.Low]="Low",jJ[jJ.High]="High",jJ[jJ.Floor]="Floor",jJ[jJ.Ceil]="Ceil",jJ[jJ.TickValue]="TickValue";class FJ{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 BJ{}class VJ{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(VJ.isNullOrUndefined(i)?(0,dJ.tap)(()=>{}):(0,dJ.throttleTime)(i,void 0,{leading:!0,trailing:!0})).subscribe(t=>{n(t)}),r}detachEventListener(t){VJ.isNullOrUndefined(t.eventsSubscription)||(t.eventsSubscription.unsubscribe(),t.eventsSubscription=null),VJ.isNullOrUndefined(t.events)||(t.events.complete(),t.events=null),VJ.isNullOrUndefined(t.teardownCallback)||(t.teardownCallback(),t.teardownCallback=null)}attachEventListener(t,e,n,i){const r=new HJ;return r.eventName=e,r.events=new hJ.xQ,r.teardownCallback=this.renderer.listen(t,e,t=>{r.events.next(t)}),r.eventsSubscription=r.events.pipe(VJ.isNullOrUndefined(i)?(0,dJ.tap)(()=>{}):(0,dJ.throttleTime)(i,void 0,{leading:!0,trailing:!0})).subscribe(t=>{n(t)}),r}}let GJ=(()=>{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 $J(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;VJ.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 VJ.isNullOrUndefined(this.changeDetectionRef)||this.changeDetectionRef.destroyed}}return t.\u0275fac=function(e){return new(e||t)(ea(Al),ea(Dl),ea(nc))},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})(),WJ=(()=>{class t extends GJ{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(Al),ea(Dl),ea(nc))},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})(),qJ=(()=>{class t extends GJ{constructor(t,e,n){super(t,e,n),this._value=null}get value(){return this._value}setValue(t){let e=!1;!this.alwaysHide&&(VJ.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(Al),ea(Dl),ea(nc))},t.\u0275dir=se({type:t,selectors:[["","ng5SliderLabel",""]],features:[jo]}),t})();class XJ{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 YJ{constructor(){this.active=!1,this.value=0,this.difference=0,this.position=0,this.lowLimit=0,this.highLimit=0}}class KJ{static compare(t,e){return!(VJ.isNullOrUndefined(t)&&VJ.isNullOrUndefined(e)||VJ.isNullOrUndefined(t)!==VJ.isNullOrUndefined(e))&&t.value===e.value&&t.highValue===e.highValue}}class QJ extends KJ{static compare(t,e){return!(VJ.isNullOrUndefined(t)&&VJ.isNullOrUndefined(e)||VJ.isNullOrUndefined(t)!==VJ.isNullOrUndefined(e))&&t.value===e.value&&t.highValue===e.highValue&&t.forceChange===e.forceChange}}const ZJ={provide:aU,useExisting:pt(()=>JJ),multi:!0};let JJ=(()=>{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 Bc,this.highValue=null,this.highValueChange=new Bc,this.options=new FJ,this.userChangeStart=new Bc,this.userChange=new Bc,this.userChangeEnd=new Bc,this.initHasRun=!1,this.inputModelChangeSubject=new hJ.xQ,this.inputModelChangeSubscription=null,this.outputModelChangeSubject=new hJ.xQ,this.outputModelChangeSubscription=null,this.viewLowValue=null,this.viewHighValue=null,this.viewOptions=new FJ,this.handleHalfDimension=0,this.maxHandlePosition=0,this.currentTrackingPointer=null,this.currentFocusPointer=null,this.firstKeyDown=!1,this.touchId=null,this.dragging=new YJ,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 $J(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!VJ.isNullOrUndefined(this.value)&&!VJ.isNullOrUndefined(this.highValue)}get showTicks(){return this.viewOptions.showTicks}ngOnInit(){this.viewOptions=new FJ,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){VJ.isNullOrUndefined(t.options)||this.onChangeOptions(),(!VJ.isNullOrUndefined(t.value)||!VJ.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,dJ.distinctUntilChanged)(QJ.compare),(0,dJ.filter)(t=>!t.forceChange&&!t.internalChange),VJ.isNullOrUndefined(t)?(0,dJ.tap)(()=>{}):(0,dJ.throttleTime)(t,void 0,{leading:!0,trailing:!0})).subscribe(t=>this.applyInputModelChange(t))}subscribeOutputModelChangeSubject(t){this.outputModelChangeSubscription=this.outputModelChangeSubject.pipe((0,dJ.distinctUntilChanged)(QJ.compare),VJ.isNullOrUndefined(t)?(0,dJ.tap)(()=>{}):(0,dJ.throttleTime)(t,void 0,{leading:!0,trailing:!0})).subscribe(t=>this.publishOutputModelChange(t))}subscribeResizeObserver(){zJ.isResizeObserverAvailable()&&(this.resizeObserver=new ResizeObserver(()=>this.calculateViewDimensionsAndDetectChanges()),this.resizeObserver.observe(this.elementRef.nativeElement))}unsubscribeResizeObserver(){zJ.isResizeObserverAvailable()&&null!==this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)}unsubscribeOnMove(){VJ.isNullOrUndefined(this.onMoveEventListener)||(this.eventListenerHelper.detachEventListener(this.onMoveEventListener),this.onMoveEventListener=null)}unsubscribeOnEnd(){VJ.isNullOrUndefined(this.onEndEventListener)||(this.eventListenerHelper.detachEventListener(this.onEndEventListener),this.onEndEventListener=null)}unsubscribeInputModelChangeSubject(){VJ.isNullOrUndefined(this.inputModelChangeSubscription)||(this.inputModelChangeSubscription.unsubscribe(),this.inputModelChangeSubscription=null)}unsubscribeOutputModelChangeSubject(){VJ.isNullOrUndefined(this.outputModelChangeSubscription)||(this.outputModelChangeSubscription.unsubscribe(),this.outputModelChangeSubscription=null)}unsubscribeManualRefresh(){VJ.isNullOrUndefined(this.manualRefreshSubscription)||(this.manualRefreshSubscription.unsubscribe(),this.manualRefreshSubscription=null)}unsubscribeTriggerFocus(){VJ.isNullOrUndefined(this.triggerFocusSubscription)||(this.triggerFocusSubscription.unsubscribe(),this.triggerFocusSubscription=null)}getPointerElement(t){return t===LJ.Min?this.minHandleElement:t===LJ.Max?this.maxHandleElement:null}getCurrentTrackingValue(){return this.currentTrackingPointer===LJ.Min?this.viewLowValue:this.currentTrackingPointer===LJ.Max?this.viewHighValue:null}modelValueToViewValue(t){return VJ.isNullOrUndefined(t)?NaN:VJ.isNullOrUndefined(this.viewOptions.stepsArray)||this.viewOptions.bindIndexForStepsArray?+t:VJ.findStepIndex(+t,this.viewOptions.stepsArray)}viewValueToModelValue(t){return VJ.isNullOrUndefined(this.viewOptions.stepsArray)||this.viewOptions.bindIndexForStepsArray?t:this.getStepValue(t)}getStepValue(t){const e=this.viewOptions.stepsArray[t];return VJ.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=!KJ.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),VJ.isNullOrUndefined(this.onChangeCallback)||this.onChangeCallback(this.range?[t.value,t.highValue]:t.value),VJ.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 KJ;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))),!VJ.isNullOrUndefined(this.viewOptions.stepsArray)||!this.viewOptions.enforceRange)return e;if(e.value=UJ.clampToRange(e.value,this.viewOptions.floor,this.viewOptions.ceil),this.range&&(e.highValue=UJ.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);KJ.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 FJ,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||!VJ.isNullOrUndefined(this.viewOptions.ticksArray),this.viewOptions.showTicks&&(!VJ.isNullOrUndefined(this.viewOptions.tickStep)||!VJ.isNullOrUndefined(this.viewOptions.ticksArray))&&(this.intermediateTicks=!0),this.viewOptions.showSelectionBar=this.viewOptions.showSelectionBar||this.viewOptions.showSelectionBarEnd||!VJ.isNullOrUndefined(this.viewOptions.showSelectionBarFromValue),VJ.isNullOrUndefined(this.viewOptions.stepsArray)?this.applyFloorCeilOptions():this.applyStepsArrayOptions(),VJ.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,VJ.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(VJ.isNullOrUndefined(this.viewOptions.step)?this.viewOptions.step=1:(this.viewOptions.step=+this.viewOptions.step,this.viewOptions.step<=0&&(this.viewOptions.step=1)),VJ.isNullOrUndefined(this.viewOptions.ceil)||VJ.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,VJ.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!==LJ.Min&&t!==LJ.Max&&(t=LJ.Min),t===LJ.Min?this.minHandleElement.focus():this.range&&t===LJ.Max&&this.maxHandleElement.focus()}refocusPointerIfNeeded(){VJ.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())VJ.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"),VJ.isNullOrUndefined(this.viewOptions.ariaLabel)?VJ.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",VJ.isNullOrUndefined(this.viewOptions.ariaLabelHigh)?VJ.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,jJ.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,jJ.High),this.maxHandleElement.ariaValueMin=this.viewOptions.floor.toString(),this.maxHandleElement.ariaValueMax=this.viewOptions.ceil.toString())}calculateViewDimensions(){VJ.isNullOrUndefined(this.viewOptions.handleDimension)?this.minHandleElement.calculateDimension():this.minHandleElement.setDimension(this.viewOptions.handleDimension);const t=this.minHandleElement.dimension;this.handleHalfDimension=t/2,VJ.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=VJ.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 XJ;if(r.selected=this.isTickSelected(t),r.style={"-webkit-transform":i,"-moz-transform":i,"-o-transform":i,"-ms-transform":i,transform:i},r.selected&&!VJ.isNullOrUndefined(this.viewOptions.getSelectionBarColor)&&(r.style["background-color"]=this.getSelectionBarColor()),!r.selected&&!VJ.isNullOrUndefined(this.viewOptions.getTickColor)&&(r.style["background-color"]=this.getTickColor(t)),VJ.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,jJ.TickValue),VJ.isNullOrUndefined(this.viewOptions.ticksValuesTooltip)||(r.valueTooltip=this.viewOptions.ticksValuesTooltip(t),r.valueTooltipPlacement=this.viewOptions.vertical?"right":"top")),!VJ.isNullOrUndefined(this.viewOptions.getLegend)){const e=this.viewOptions.getLegend(t);VJ.isNullOrUndefined(e)||(r.legend=e)}return r});if(VJ.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,jJ.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,jJ.Ceil)),this.ceilLabelElement.calculateDimension(),this.ceilLabelElement.setPosition(this.viewOptions.rightToLeft?0:this.fullBarElement.dimension-this.ceilLabelElement.dimension))}updateHandles(t,e){t===LJ.Min?this.updateLowHandle(e):t===LJ.Max&&this.updateHighHandle(e),this.updateSelectionBar(),this.updateTicksScale(),this.range&&this.updateCombinedLabel()}getHandleLabelPos(t,e){const n=t===LJ.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===LJ.Min||!this.viewOptions.rightToLeft&&t===LJ.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,jJ.Low)),this.minHandleLabelElement.setPosition(this.getHandleLabelPos(LJ.Min,t)),VJ.isNullOrUndefined(this.viewOptions.getPointerColor)||(this.minPointerStyle={backgroundColor:this.getPointerColor(LJ.Min)}),this.viewOptions.autoHideLimitLabels&&this.updateFloorAndCeilLabelsVisibility()}updateHighHandle(t){this.maxHandleElement.setPosition(t),this.maxHandleLabelElement.setValue(this.getDisplayValue(this.viewHighValue,jJ.High)),this.maxHandleLabelElement.setPosition(this.getHandleLabelPos(LJ.Max,t)),VJ.isNullOrUndefined(this.viewOptions.getPointerColor)||(this.maxPointerStyle={backgroundColor:this.getPointerColor(LJ.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(VJ.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))),VJ.isNullOrUndefined(this.viewOptions.getSelectionBarColor)){if(!VJ.isNullOrUndefined(this.viewOptions.selectionBarGradient)){const i=VJ.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===LJ.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,jJ.Low),e=this.getDisplayValue(this.viewHighValue,jJ.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!VJ.isNullOrUndefined(this.viewOptions.stepsArray)&&!this.viewOptions.bindIndexForStepsArray&&(t=this.getStepValue(t)),this.viewOptions.translate(t,e)}roundStep(t,e){const n=VJ.isNullOrUndefined(e)?this.viewOptions.step:e;let i=UJ.roundToPrecisionLimit((t-this.viewOptions.floor)/n,this.viewOptions.precisionLimit);return i=Math.round(i)*n,UJ.roundToPrecisionLimit(this.viewOptions.floor+i,this.viewOptions.precisionLimit)}valueToPosition(t){let e=VJ.linearValueToPosition;VJ.isNullOrUndefined(this.viewOptions.customValueToPosition)?this.viewOptions.logScale&&(e=VJ.logValueToPosition):e=this.viewOptions.customValueToPosition;let n=e(t=UJ.clampToRange(t,this.viewOptions.floor,this.viewOptions.ceil),this.viewOptions.floor,this.viewOptions.ceil);return VJ.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=VJ.linearPositionToValue;VJ.isNullOrUndefined(this.viewOptions.customPositionToValue)?this.viewOptions.logScale&&(n=VJ.logPositionToValue):n=this.viewOptions.customPositionToValue;const i=n(e,this.viewOptions.floor,this.viewOptions.ceil);return VJ.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(!VJ.isNullOrUndefined(e))for(let r=0;ri?LJ.Max:this.viewOptions.rightToLeft?e>this.minHandleElement.position?LJ.Min:LJ.Max:ethis.onBarStart(null,t,e,!0,!0,!0)),this.viewOptions.draggableRangeOnly?(this.minHandleElement.on("mousedown",e=>this.onBarStart(LJ.Min,t,e,!0,!0)),this.maxHandleElement.on("mousedown",e=>this.onBarStart(LJ.Max,t,e,!0,!0))):(this.minHandleElement.on("mousedown",t=>this.onStart(LJ.Min,t,!0,!0)),this.range&&this.maxHandleElement.on("mousedown",t=>this.onStart(LJ.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(LJ.Min,t,e,!0,!0)),this.maxHandleElement.onPassive("touchstart",e=>this.onBarStart(LJ.Max,t,e,!0,!0))):(this.minHandleElement.onPassive("touchstart",t=>this.onStart(LJ.Min,t,!0,!0)),this.range&&this.maxHandleElement.onPassive("touchstart",t=>this.onStart(LJ.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(LJ.Min)),this.range&&this.maxHandleElement.on("focus",()=>this.onPointerFocus(LJ.Max)))}unbindEvents(){this.unsubscribeOnMove(),this.unsubscribeOnEnd();for(const t of this.getAllSliderElements())VJ.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(),(!zJ.isTouchEvent(e)||!pJ.Z.hasSupport)&&e.preventDefault(),this.calculateViewDimensions(),VJ.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=zJ.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=zJ.isTouchEvent(e)?this.eventListenerHelper.attachPassiveEventListener(document,"touchend",t):this.eventListenerHelper.attachEventListener(document,"mouseup",t)}this.userChangeStart.emit(this.getChangeContext()),zJ.isTouchEvent(e)&&!VJ.isNullOrUndefined(e.changedTouches)&&VJ.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(zJ.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&&!VJ.isNullOrUndefined(this.viewOptions.tickStep)?this.roundStep(r,this.viewOptions.tickStep):this.roundStep(r)),this.positionTrackingHandle(r)}onEnd(t){zJ.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,VJ.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=VJ.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(VJ.isNullOrUndefined(i)||VJ.isNullOrUndefined(this.currentTrackingPointer))return;t.preventDefault(),this.firstKeyDown&&(this.firstKeyDown=!1,this.userChangeStart.emit(this.getChangeContext()));const r=UJ.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===LJ.Min?(e=s,n=s+t,n>this.viewOptions.ceil&&(n=this.viewOptions.ceil,e=n-t)):this.currentTrackingPointer===LJ.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){!VJ.isNullOrUndefined(this.viewOptions.minLimit)&&tthis.viewOptions.maxLimit&&(t=UJ.roundToPrecisionLimit((e=this.viewOptions.maxLimit)-this.dragging.difference,this.viewOptions.precisionLimit)),this.viewLowValue=t,this.viewHighValue=e,this.applyViewChange(),this.updateHandles(LJ.Min,this.valueToPosition(t)),this.updateHandles(LJ.Max,this.valueToPosition(e))}positionTrackingHandle(t){t=this.applyMinMaxLimit(t),this.range&&(this.viewOptions.pushRange?t=this.applyPushRange(t):(this.viewOptions.noSwitching&&(this.currentTrackingPointer===LJ.Min&&t>this.viewHighValue?t=this.applyMinMaxRange(this.viewHighValue):this.currentTrackingPointer===LJ.Max&&tthis.viewHighValue?(this.viewLowValue=this.viewHighValue,this.applyViewChange(),this.updateHandles(LJ.Min,this.maxHandleElement.position),this.updateAriaAttributes(),this.currentTrackingPointer=LJ.Max,this.minHandleElement.active=!1,this.maxHandleElement.active=!0,this.viewOptions.keyboardSupport&&this.maxHandleElement.focus()):this.currentTrackingPointer===LJ.Max&&tthis.viewOptions.maxLimit?this.viewOptions.maxLimit:t}applyMinMaxRange(t){const e=Math.abs(t-(this.currentTrackingPointer===LJ.Min?this.viewHighValue:this.viewLowValue));if(!VJ.isNullOrUndefined(this.viewOptions.minRange)&&ethis.viewOptions.maxRange){if(this.currentTrackingPointer===LJ.Min)return UJ.roundToPrecisionLimit(this.viewHighValue-this.viewOptions.maxRange,this.viewOptions.precisionLimit);if(this.currentTrackingPointer===LJ.Max)return UJ.roundToPrecisionLimit(this.viewLowValue+this.viewOptions.maxRange,this.viewOptions.precisionLimit)}return t}applyPushRange(t){const e=this.currentTrackingPointer===LJ.Min?this.viewHighValue-t:t-this.viewLowValue,n=VJ.isNullOrUndefined(this.viewOptions.minRange)?this.viewOptions.step:this.viewOptions.minRange,i=this.viewOptions.maxRange;return ei&&(this.currentTrackingPointer===LJ.Min?(this.viewHighValue=UJ.roundToPrecisionLimit(t+i,this.viewOptions.precisionLimit),this.applyViewChange(),this.updateHandles(LJ.Max,this.valueToPosition(this.viewHighValue))):this.currentTrackingPointer===LJ.Max&&(this.viewLowValue=UJ.roundToPrecisionLimit(t-i,this.viewOptions.precisionLimit),this.applyViewChange(),this.updateHandles(LJ.Min,this.valueToPosition(this.viewLowValue))),this.updateAriaAttributes()),t}getChangeContext(){const t=new BJ;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(Dl),ea(Al),ea(nc),ea(Tu))},t.\u0275cmp=Jt({type:t,selectors:[["ng5-slider"]],contentQueries:function(t,e,n){if(1&t&&Jc(n,fJ,5),2&t){let t;Qc(t=tu())&&(e.tooltipTemplate=t.first)}},viewQuery:function(t,e){if(1&t&&(Zc(gJ,5,GJ),Zc(mJ,5,GJ),Zc(bJ,5,GJ),Zc(yJ,5,GJ),Zc(vJ,5,WJ),Zc(_J,5,WJ),Zc(wJ,5,qJ),Zc(xJ,5,qJ),Zc(SJ,5,qJ),Zc(CJ,5,qJ),Zc(EJ,5,qJ),Zc(OJ,5,GJ)),2&t){let t;Qc(t=tu())&&(e.leftOuterSelectionBarElement=t.first),Qc(t=tu())&&(e.rightOuterSelectionBarElement=t.first),Qc(t=tu())&&(e.fullBarElement=t.first),Qc(t=tu())&&(e.selectionBarElement=t.first),Qc(t=tu())&&(e.minHandleElement=t.first),Qc(t=tu())&&(e.maxHandleElement=t.first),Qc(t=tu())&&(e.floorLabelElement=t.first),Qc(t=tu())&&(e.ceilLabelElement=t.first),Qc(t=tu())&&(e.minHandleLabelElement=t.first),Qc(t=tu())&&(e.maxHandleLabelElement=t.first),Qc(t=tu())&&(e.combinedLabelElement=t.first),Qc(t=tu())&&(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,Ar),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:[xl([ZJ]),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,AJ,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[GJ,jh,WJ,qJ,kh,Oh,t0,Ah]},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})(),t0=(()=>{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,RJ,2,6,"ng-container",0),Jo(1,NJ,3,3,"ng-container",0)),2&t&&(na("ngIf",e.template),ws(1),na("ngIf",!e.template))},directives:[Ah,Fh],styles:[".ng5-slider-inner-tooltip[_ngcontent-%COMP%]{height:100%}"]}),t})(),e0=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Wh]]}),t})();const n0=["popover"];function i0(t,e){if(1&t){const t=ua();ra(0,"div",7,8),ra(2,"div"),ra(3,"div",9),Ja(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),Ja(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),il("label min fade-in ",t.contentsVisible,""),ws(2),el(" ",t.options.floor,"> "),ws(1),Sa("value",t.lowValue),ws(1),il("slider fade-in ",t.contentsVisible,""),na("options",t.options)("value",t.lowValue)("highValue",t.highValue),ws(1),il("label max fade-in ",t.contentsVisible,""),ws(2),el(" ",t.options.ceil," "),ws(1),Sa("value",t.highValue)}}let r0=(()=>{class t{constructor(t,e,n){this.element=e,this.ga=n,this.selectionChange=new Bc,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(Vf),ea(Al),ea(jW))},t.\u0275cmp=Jt({type:t,selectors:[["ccf-dual-slider"]],viewQuery:function(t,e){if(1&t&&(Zc(Zp,7),Zc(n0,5,Al)),2&t){let t;Qc(t=tu())&&(e.popoverPortal=t.first),Qc(t=tu())&&(e.popoverElement=t.first)}},hostBindings:function(t,e){1&t&&fa("click",function(t){return e.closeSliderPopover(t.target)},!1,Mr)("touchstart",function(t){return e.closeSliderPopover(t.target)},!1,Mr)},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,i0,11,16,"div",2),ra(3,"mat-form-field",3),fa("click",function(){return e.toggleSliderPopover()}),ra(4,"div",4),ra(5,"span",5),Ja(6),sa(),ra(7,"span",6),Ja(8),sa(),sa(),oa(9,"mat-select"),sa(),sa(),sa()),2&t&&(ws(3),ja("highlight",e.isSliderOpen),ws(3),tl(e.label),ws(2),tl(e.rangeLabel))},directives:[Jp,QH,aJ,JJ],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 s0(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)}),Ja(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),el(" ",t," ")}}let o0=(()=>{class t{constructor(t){this.ga=t,this.selection=[],this.columns=3,this.selectionChange=new Bc}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(jW))},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),Ja(2),sa(),ra(3,"div",2),Jo(4,s0,3,2,"div",3),sa(),sa()),2&t&&(ws(2),tl(e.label),ws(1),ja("three",3===e.columns)("four",4===e.columns),ws(1),na("ngForOf",e.options))},directives:[kh,_K],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%}"],changeDetection:0}),t})();var a0;let l0=(()=>{class t{}return t.type="[SpatialSearchUi] Really update spatial search data",t})(),c0=a0=class{constructor(t,e,n,i){this.dataSource=t,this.store=e,this.ga=i,n.pipe(Cz(VZ),rg(500),eg(()=>e.dispatch(l0))).subscribe()}static organEntity(t,e){const{organId:n,sex:i}=t;return e.find(t=>{var e;return t.representation_of===n&&(null===(e=t.sex)||void 0===e?void 0:e.toLowerCase())===i})}startSpatialSearchFlow(t){const{sex:e,organId:n}=t.getState(),i=null==n?void 0:n.split("/").slice(-1)[0];return this.ga.event("set_organ","spatial_search_ui",`${e}_${i}`),t.dispatch(new DZ(e))}setSex(t,{sex:e}){let{organId:n}=t.getState();t.patchState({sex:e}),this.ga.event("set_sex","spatial_search_ui",e),void 0!==n&&!this.organValidForSex(n,e)&&(n=void 0);const i=Object.assign(Object.assign({},this.store.selectSnapshot(qQ.filter)),{spatialSearches:[]}),r=this.store.selectSnapshot(sZ.referenceOrgans);return this.dataSource.getOntologyTermOccurences(i).pipe(rf(1),eg(e=>{t.patchState({referenceOrgans:r.filter(t=>t.id&&!t.disabled&&e[t.id]>0)}),t.dispatch(new RZ(n))}))}setOrgan(t,{organId:e}){const{sex:n}=t.getState();t.patchState({sex:n,organId:e});const i=null==e?void 0:e.split("/").slice(-1)[0];this.ga.event("set_organ","spatial_search_ui",i);const r=this.store.selectSnapshot(a0.organEntity);if(r&&e&&r.sex){const{x_dimension:n,y_dimension:i,z_dimension:s}=r,o={x:Math.round(n/2),y:Math.round(i/2),z:Math.round(s/2)},a=Math.round(.07*Math.max(n,i,s)),l=this.store.selectSnapshot(qQ.filter),c=Object.assign(Object.assign({},l),{sex:r.sex,ontologyTerms:[e],spatialSearches:[]});return this.dataSource.getReferenceOrganScene(e,c).pipe(rf(1),eg(e=>{t.patchState({position:o,radius:a,defaultPosition:o,radiusSettings:{min:Math.min(a,5),max:Math.floor(Math.max(n,i,s)/1.5),defaultValue:a},organScene:bY(r).concat(e)})}),W(()=>t.dispatch(new VZ)))}}setPosition(t,{position:e}){t.patchState({position:e}),t.dispatch(new VZ);const{x:n,y:i,z:r}=e;this.ga.event("set_position","spatial_search_ui",`${n}_${i}_${r}`)}resetPosition(t){const{defaultPosition:e}=t.getState();t.patchState({position:e}),t.dispatch(new VZ);const{x:n,y:i,z:r}=null!=e?e:{x:0,y:0,z:0};this.ga.event("reset_position","spatial_search_ui",`${n}_${i}_${r}`)}moveToNode(t,{node:e}){const n=new VT(e.transformMatrix),[i,r,s]=n.getTranslation().map(t=>Math.round(1e3*t));return t.dispatch(new NZ({x:i,y:r,z:s}))}setRadius(t,{radius:e}){t.patchState({radius:e}),t.dispatch(new VZ),this.ga.event("set_radius","spatial_search_ui",e.toFixed(1))}resetRadius(t){var e;const{radiusSettings:n}=t.getState(),i=null!==(e=null==n?void 0:n.defaultValue)&&void 0!==e?e:0;t.patchState({radius:i}),t.dispatch(new VZ),this.ga.event("reset_radius","spatial_search_ui",i.toFixed(1))}updateSpatialSearch(t){const{position:e,radius:n}=t.getState(),i=this.store.selectSnapshot(a0.organEntity);if(i&&e&&n&&i.representation_of){const r=this.dataSource,s=i.representation_of,o=this.store.selectSnapshot(qQ.filter),a=Object.assign(Object.assign({},o),{sex:i.sex,ontologyTerms:[s],spatialSearches:[Object.assign(Object.assign({},e),{radius:n,target:i["@id"]})]});return Ev({spatialSearchScene:r.getReferenceOrganScene(s,a).pipe(rf(1)),tissueBlocks:r.getTissueBlockResults(a).pipe(rf(1)),anatomicalStructures:r.getOntologyTermOccurences(a).pipe(rf(1)),cellTypes:r.getCellTypeTermOccurences(a).pipe(rf(1))}).pipe(eg(e=>t.patchState(e)))}}generateSpatialSearch(t){const{position:e,radius:n,sex:i,organId:r,referenceOrgans:s=[],executeSearchOnGeneration:o}=t.getState(),a=this.store.selectSnapshot(a0.organEntity),l=s.find(t=>t.id===r);if(e&&n&&(null==a?void 0:a.representation_of)&&l){const r=Object.assign(Object.assign({},e),{radius:n,target:a["@id"]}),s=[new XQ(i,l.name,r)];if(o){const t=this.store.selectSnapshot(ZQ.selectedSearches);s.push(new zQ({spatialSearches:t.concat(r)}))}return this.ga.event("generate_search","spatial_search_ui"),t.dispatch(s).pipe(eg(()=>t.patchState({sex:"female",organId:void 0})))}}setExecuteSearchOnGenerate(t,{execute:e}){t.patchState({executeSearchOnGeneration:e})}organValidForSex(t,e){const n=this.store.selectSnapshot(sZ.referenceOrgans).find(e=>e.id===t);return n.hasSex||n.sex===e}};c0.\u0275fac=function(t){return new(t||c0)(Ei(eQ),Ei(qz),Ei(Az),Ei(jW))},c0.\u0275prov=xt({token:c0,factory:c0.\u0275fac}),vw([eU(IZ)],c0.prototype,"startSpatialSearchFlow",null),vw([eU(DZ)],c0.prototype,"setSex",null),vw([eU(RZ)],c0.prototype,"setOrgan",null),vw([eU(NZ)],c0.prototype,"setPosition",null),vw([eU(jZ)],c0.prototype,"resetPosition",null),vw([eU(LZ)],c0.prototype,"moveToNode",null),vw([eU(FZ)],c0.prototype,"setRadius",null),vw([eU(BZ)],c0.prototype,"resetRadius",null),vw([eU(l0)],c0.prototype,"updateSpatialSearch",null),vw([eU(zZ)],c0.prototype,"generateSpatialSearch",null),vw([eU(UZ)],c0.prototype,"setExecuteSearchOnGenerate",null),vw([rU([a0,sZ.referenceOrganEntities])],c0,"organEntity",null),c0=a0=vw([nU({name:"spatialSearchUi",defaults:{sex:"female",executeSearchOnGeneration:!0}})],c0);class u0{static sex(t){return t.sex}static referenceOrgans(t){var e;return null!==(e=t.referenceOrgans)&&void 0!==e?e:[]}static organId(t){return t.organId}static organ(t,e){if(void 0!==t)return e.find(e=>e.id===t)}static organs(t,e){return e.filter(e=>this.organMatchesSex(e,t))}static organMatchesSex(t,e){return t.hasSex||t.sex===e}static position(t){var e;return null!==(e=t.position)&&void 0!==e?e:{x:0,y:0,z:0}}static defaultPosition(t){var e;return null!==(e=t.defaultPosition)&&void 0!==e?e:{x:0,y:0,z:0}}static radius(t){var e;return null!==(e=t.radius)&&void 0!==e?e:0}static radiusSettings(t){var e;return null!==(e=t.radiusSettings)&&void 0!==e?e:{min:0,max:0,defaultValue:0}}static scene(t,e,n,i){var r,s;const o=function(t,e){var n;const i=t.x_dimension/1e3,r=t.y_dimension/1e3,s=t.z_dimension/1e3,o=.07*Math.max(i,r,s),a=.05*o,l=2*o,c=4*a;return e=e?Object.assign(Object.assign({},e),{radius:e.radius/1e3,x:e.x/1e3,y:e.y/1e3,z:e.z/1e3}):{target:null!==(n=t.representation_of)&&void 0!==n?n:t["@id"],radius:o,x:i/2,y:r/2,z:s/2},[{"@id":"http://purl.org/ccf/latest/ccf.owl#ProbingSphere","@type":"SpatialSceneNode",unpickable:!1,geometry:"sphere",transformMatrix:new VT(VT.IDENTITY).translate([e.x,e.y,e.z]).scale(e.radius),color:cY},{"@id":"http://purl.org/ccf/latest/ccf.owl#ProbingsphereXD","@type":"SpatialSceneNode",unpickable:!0,geometry:"cylinder",transformMatrix:new VT(VT.IDENTITY).translate([e.x+e.radius+l/2,e.y,e.z]).rotateZ(ZS(-90)).scale([a,l,a]),color:uY},{"@id":"http://purl.org/ccf/latest/ccf.owl#ProbingsphereXDCone","@type":"SpatialSceneNode",unpickable:!0,geometry:"cone",transformMatrix:new VT(VT.IDENTITY).translate([e.x+e.radius+l,e.y,e.z]).rotateZ(ZS(-90)).scale([c,3*c,c]),color:uY},{"@id":"http://purl.org/ccf/latest/ccf.owl#ProbingsphereXDLabel","@type":"SpatialSceneNode",unpickable:!0,geometry:"text",text:"D",transformMatrix:new VT(VT.IDENTITY).translate([e.x+e.radius+l+3*c,e.y,e.z]).scale(c),color:uY},{"@id":"http://purl.org/ccf/latest/ccf.owl#ProbingsphereXA","@type":"SpatialSceneNode",unpickable:!0,geometry:"cylinder",transformMatrix:new VT(VT.IDENTITY).translate([e.x-e.radius-l/2,e.y,e.z]).rotateZ(ZS(-90)).scale([a,l,a]),color:uY},{"@id":"http://purl.org/ccf/latest/ccf.owl#ProbingsphereXACone","@type":"SpatialSceneNode",unpickable:!0,geometry:"cone",transformMatrix:new VT(VT.IDENTITY).translate([e.x-e.radius-l,e.y,e.z]).rotateZ(ZS(90)).scale([c,3*c,c]),color:uY},{"@id":"http://purl.org/ccf/latest/ccf.owl#ProbingsphereXALabel","@type":"SpatialSceneNode",unpickable:!0,geometry:"text",text:"A",transformMatrix:new VT(VT.IDENTITY).translate([e.x-e.radius-l-3.5*c,e.y,e.z]).scale(c),color:uY},{"@id":"http://purl.org/ccf/latest/ccf.owl#ProbingsphereYW","@type":"SpatialSceneNode",unpickable:!0,geometry:"cylinder",transformMatrix:new VT(VT.IDENTITY).translate([e.x,e.y+e.radius+l/2,e.z]).scale([a,l,a]),color:hY},{"@id":"http://purl.org/ccf/latest/ccf.owl#ProbingsphereYWCone","@type":"SpatialSceneNode",unpickable:!0,geometry:"cone",transformMatrix:new VT(VT.IDENTITY).translate([e.x,e.y+e.radius+l,e.z]).scale([c,3*c,c]),color:hY},{"@id":"http://purl.org/ccf/latest/ccf.owl#ProbingsphereYWLabel","@type":"SpatialSceneNode",unpickable:!0,geometry:"text",text:"W",transformMatrix:new VT(VT.IDENTITY).translate([e.x,e.y+e.radius+l+3*c,e.z]).scale(c),color:hY},{"@id":"http://purl.org/ccf/latest/ccf.owl#ProbingsphereYS","@type":"SpatialSceneNode",unpickable:!0,geometry:"cylinder",transformMatrix:new VT(VT.IDENTITY).translate([e.x,e.y-e.radius-l/2,e.z]).scale([a,l,a]),color:hY},{"@id":"http://purl.org/ccf/latest/ccf.owl#ProbingsphereYSCone","@type":"SpatialSceneNode",unpickable:!0,geometry:"cone",transformMatrix:new VT(VT.IDENTITY).translate([e.x,e.y-e.radius-l,e.z]).rotateZ(ZS(180)).scale([c,3*c,c]),color:hY},{"@id":"http://purl.org/ccf/latest/ccf.owl#ProbingsphereYSLabel","@type":"SpatialSceneNode",unpickable:!0,geometry:"text",text:"S",transformMatrix:new VT(VT.IDENTITY).translate([e.x,e.y-e.radius-l-3.5*c,e.z]).scale(c),color:hY},{"@id":"http://purl.org/ccf/latest/ccf.owl#ProbingsphereZE","@type":"SpatialSceneNode",unpickable:!0,geometry:"cylinder",transformMatrix:new VT(VT.IDENTITY).translate([e.x,e.y,e.z+e.radius+l/2]).rotateX(ZS(90)).scale([a,l,a]),color:dY},{"@id":"http://purl.org/ccf/latest/ccf.owl#ProbingsphereZECone","@type":"SpatialSceneNode",unpickable:!0,geometry:"cone",transformMatrix:new VT(VT.IDENTITY).translate([e.x,e.y,e.z+e.radius+l]).rotateX(ZS(90)).scale([c,3*c,c]),color:dY},{"@id":"http://purl.org/ccf/latest/ccf.owl#ProbingsphereZELabel","@type":"SpatialSceneNode",unpickable:!0,geometry:"text",text:"E",transformMatrix:new VT(VT.IDENTITY).translate([e.x,e.y,e.z+e.radius+l+3*c]).scale(c),color:dY},{"@id":"http://purl.org/ccf/latest/ccf.owl#ProbingsphereZQ","@type":"SpatialSceneNode",unpickable:!0,geometry:"cylinder",transformMatrix:new VT(VT.IDENTITY).translate([e.x,e.y,e.z-e.radius-l/2]).rotateX(ZS(-90)).scale([a,l,a]),color:dY},{"@id":"http://purl.org/ccf/latest/ccf.owl#ProbingsphereZQCone","@type":"SpatialSceneNode",unpickable:!0,geometry:"cone",transformMatrix:new VT(VT.IDENTITY).translate([e.x,e.y,e.z-e.radius-l]).rotateX(ZS(-90)).scale([c,3*c,c]),color:dY},{"@id":"http://purl.org/ccf/latest/ccf.owl#ProbingsphereZQLabel","@type":"SpatialSceneNode",unpickable:!0,geometry:"text",text:"Q",transformMatrix:new VT(VT.IDENTITY).translate([e.x,e.y,e.z-e.radius-l-3.5*c]).scale(c),color:dY}]}(e,Object.assign(Object.assign({},n),{radius:i,target:e["@id"]})),a=new Set((null!==(r=t.tissueBlocks)&&void 0!==r?r:[]).map(t=>t.spatialEntityId));return(null!==(s=t.organScene)&&void 0!==s?s:[]).map(t=>(a.has(t["@id"])&&(t=Object.assign(Object.assign({},t),{color:[41,121,255,229.5]})),t)).concat(o)}static sceneBounds(t){const{x_dimension:e,y_dimension:n,z_dimension:i}=t,r=.42*Math.max(e,n,i);return{x:(r+e)/1e3,y:(r+n)/1e3,z:(r+i)/1e3}}static sceneTarget(t){const{x_dimension:e,y_dimension:n,z_dimension:i}=t;return[e/1e3/2,n/1e3/2,i/1e3/2]}static tissueBlocks(t){var e;return null!==(e=t.tissueBlocks)&&void 0!==e?e:[]}static anatomicalStructures(t,e){return this.getTermCounts(t.anatomicalStructures,e)}static cellTypes(t,e){return this.getTermCounts(t.cellTypes,e)}static getTermCounts(t,e){return Object.entries(null!=t?t:{}).filter(([t,e])=>e>0).map(([t,n])=>{var i,r;return{"@id":t,label:null!==(r=null===(i=e.nodes[t])||void 0===i?void 0:i.label)&&void 0!==r?r:t.split("/").slice(-1)[0],count:n}})}}function h0(t,e){if(1&t&&(ra(0,"div",6),ra(1,"mat-icon",7),Ja(2,"person"),sa(),ra(3,"div",8),ra(4,"div",9),Ja(5),sa(),ra(6,"div",9),Ja(7),sa(),sa(),sa()),2&t){const t=e.$implicit;ws(5),tl(t.donor.label),ws(2),tl(t.donor.description)}}u0.organEntity=c0.organEntity,vw([rU([c0])],u0,"sex",null),vw([rU([c0])],u0,"referenceOrgans",null),vw([rU([c0])],u0,"organId",null),vw([rU([u0.organId,u0.referenceOrgans])],u0,"organ",null),vw([rU([u0.sex,u0.referenceOrgans])],u0,"organs",null),vw([rU([c0])],u0,"position",null),vw([rU([c0])],u0,"defaultPosition",null),vw([rU([c0])],u0,"radius",null),vw([rU([c0])],u0,"radiusSettings",null),vw([rU([c0,c0.organEntity,u0.position,u0.radius])],u0,"scene",null),vw([rU([c0.organEntity])],u0,"sceneBounds",null),vw([rU([c0.organEntity])],u0,"sceneTarget",null),vw([rU([c0])],u0,"tissueBlocks",null),vw([rU([c0,qQ.anatomicalStructuresTreeModel])],u0,"anatomicalStructures",null),vw([rU([c0,qQ.cellTypesTreeModel])],u0,"cellTypes",null);let d0=(()=>{class t{constructor(){this.className="ccf-tissue-block-list",this.tissueBlocks=[]}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Jt({type:t,selectors:[["ccf-tissue-block-list"]],hostVars:2,hostBindings:function(t,e){2&t&&Va(e.className)},inputs:{tissueBlocks:"tissueBlocks"},decls:8,vars:2,consts:[[1,"tissue-block-header"],[1,"title"],["mat-icon-button","",1,"info"],["matTooltip","Total quantity of registered Tissue Blocks detected by the Probing Sphere","matTooltipPosition","right"],[1,"tissue-list"],["class","donor",4,"ngFor","ngForOf"],[1,"donor"],[1,"icon"],[1,"donor-info"],[1,"description"]],template:function(t,e){1&t&&(ra(0,"div",0),ra(1,"div",1),Ja(2),sa(),ra(3,"button",2),ra(4,"mat-icon",3),Ja(5,"info"),sa(),sa(),sa(),ra(6,"div",4),Jo(7,h0,8,2,"div",5),sa()),2&t&&(ws(2),el("",e.tissueBlocks.length," Tissue Blocks"),ws(5),na("ngForOf",e.tissueBlocks))},directives:[T_,gw,kh],styles:["[_nghost-%COMP%] .tissue-block-header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;margin-bottom:1rem}[_nghost-%COMP%] .tissue-block-header[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-size:.875rem}[_nghost-%COMP%] .tissue-block-header[_ngcontent-%COMP%] .info[_ngcontent-%COMP%]{padding:0;background:none;border:none;outline:none;border-radius:.25rem;transition:.6s}[_nghost-%COMP%] .tissue-list[_ngcontent-%COMP%]{overflow:auto}[_nghost-%COMP%] .donor[_ngcontent-%COMP%]{min-height:3rem;display:flex;font-size:.75rem;line-height:1rem;align-items:center;flex-grow:1;height:2.5rem;width:22rem;padding:.5rem;box-shadow:0 3px 6px #00000029;cursor:pointer;margin-right:1rem;margin-bottom:.5rem}[_nghost-%COMP%] .donor[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{margin-right:.5rem}[_nghost-%COMP%] .donor[_ngcontent-%COMP%] .donor-info[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-weight:600}[_nghost-%COMP%] .donor[_ngcontent-%COMP%] .donor-info[_ngcontent-%COMP%] .description[_ngcontent-%COMP%]{width:17rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}"],changeDetection:0}),t})();function p0(t,e){if(1&t&&(ra(0,"div",6),ra(1,"div",7),ra(2,"div",8),Ja(3),sa(),ra(4,"div",8),Ja(5),sa(),sa(),sa()),2&t){const t=e.$implicit;ws(3),tl(t.label),ws(2),tl(t.count)}}let f0=(()=>{class t{constructor(){this.className="ccf-term-occurrence-list",this.termList=[]}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Jt({type:t,selectors:[["ccf-term-occurrence-list"]],hostVars:2,hostBindings:function(t,e){2&t&&Va(e.className)},inputs:{termList:"termList",title:"title",toolTipText:"toolTipText"},decls:8,vars:4,consts:[[1,"term-list-header"],[1,"title"],["mat-icon-button","",1,"info"],["matTooltipPosition","right",3,"matTooltip"],[1,"term-list"],["class","donor",4,"ngFor","ngForOf"],[1,"donor"],[1,"term-bloc"],[1,"term-line"]],template:function(t,e){1&t&&(ra(0,"div",0),ra(1,"div",1),Ja(2),sa(),ra(3,"button",2),ra(4,"mat-icon",3),Ja(5,"info"),sa(),sa(),sa(),ra(6,"div",4),Jo(7,p0,6,2,"div",5),sa()),2&t&&(ws(2),nl("",e.termList.length," ",e.title,""),ws(2),Sa("matTooltip",e.toolTipText),ws(3),na("ngForOf",e.termList))},directives:[T_,gw,kh],styles:["[_nghost-%COMP%]{padding-top:1rem}[_nghost-%COMP%] .term-list-header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;margin-bottom:1rem}[_nghost-%COMP%] .term-list-header[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-size:.875rem}[_nghost-%COMP%] .term-list-header[_ngcontent-%COMP%] .counter[_ngcontent-%COMP%]{font-size:1rem}[_nghost-%COMP%] .term-list-header[_ngcontent-%COMP%] .info[_ngcontent-%COMP%]{padding-right:0;background:none;border:none;outline:none;border-radius:.25rem;transition:.6s}[_nghost-%COMP%] .term-list[_ngcontent-%COMP%]{overflow:auto;padding-left:2rem;font-size:1rem}[_nghost-%COMP%] .term-list[_ngcontent-%COMP%] .term-bloc[_ngcontent-%COMP%]{display:flex;justify-content:space-between;margin-bottom:1rem;overflow:auto}[_nghost-%COMP%] .term-list[_ngcontent-%COMP%] .term-line[_ngcontent-%COMP%]{padding-right:2rem}"],changeDetection:0}),t})();function g0(t,e){if(1&t&&(ra(0,"mat-icon",8),Ja(1),sa()),2&t){const t=e.$implicit;ja("active",va().currentKey===t.key),ws(1),el("",t.direction," ")}}function m0(t,e){1&t&&(ra(0,"div",9),Ja(1,"SHIFT"),sa())}let b0=(()=>{class t{constructor(){this.className="ccf-spatial-search-keyboard-ui",this.keyClicked=new Bc,this.keyHovered=new Bc,this.keyMap=[{key:"w",direction:"north"},{key:"s",direction:"south"},{key:"a",direction:"west"},{key:"d",direction:"east"},{key:"e",direction:"north_east"},{key:"q",direction:"south_west"}]}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Jt({type:t,selectors:[["ccf-spatial-search-keyboard-ui"]],hostVars:2,hostBindings:function(t,e){2&t&&Va(e.className)},inputs:{currentKey:"currentKey",shiftPressed:"shiftPressed"},outputs:{keyClicked:"keyClicked",keyHovered:"keyHovered"},decls:18,vars:14,consts:[[1,"direction-arrow"],["class","arrow",3,"active",4,"ngFor","ngForOf"],[1,"keys"],[1,"keyrow"],[1,"key","blue",3,"mousedown","mouseover","mouseout"],[1,"key","green",3,"mousedown","mouseover","mouseout"],[1,"key","red",3,"mousedown","mouseover","mouseout"],["class","shift",4,"ngIf"],[1,"arrow"],[1,"shift"]],template:function(t,e){1&t&&(ra(0,"div",0),Jo(1,g0,2,3,"mat-icon",1),sa(),ra(2,"div",2),ra(3,"div",3),ra(4,"div",4),fa("mousedown",function(){return e.keyClicked.emit("q")})("mouseover",function(){return e.keyHovered.emit("q")})("mouseout",function(){return e.keyHovered.emit()}),Ja(5,"Q"),sa(),ra(6,"div",5),fa("mousedown",function(){return e.keyClicked.emit("w")})("mouseover",function(){return e.keyHovered.emit("w")})("mouseout",function(){return e.keyHovered.emit()}),Ja(7,"W"),sa(),ra(8,"div",4),fa("mousedown",function(){return e.keyClicked.emit("e")})("mouseover",function(){return e.keyHovered.emit("e")})("mouseout",function(){return e.keyHovered.emit()}),Ja(9,"E"),sa(),sa(),ra(10,"div",3),ra(11,"div",6),fa("mousedown",function(){return e.keyClicked.emit("a")})("mouseover",function(){return e.keyHovered.emit("a")})("mouseout",function(){return e.keyHovered.emit()}),Ja(12,"A"),sa(),ra(13,"div",5),fa("mousedown",function(){return e.keyClicked.emit("s")})("mouseover",function(){return e.keyHovered.emit("s")})("mouseout",function(){return e.keyHovered.emit()}),Ja(14,"S"),sa(),ra(15,"div",6),fa("mousedown",function(){return e.keyClicked.emit("d")})("mouseover",function(){return e.keyHovered.emit("d")})("mouseout",function(){return e.keyHovered.emit()}),Ja(16,"D"),sa(),sa(),Jo(17,m0,2,0,"div",7),sa()),2&t&&(ws(1),na("ngForOf",e.keyMap),ws(3),ja("highlighted","q"===e.currentKey),ws(2),ja("highlighted","w"===e.currentKey),ws(2),ja("highlighted","e"===e.currentKey),ws(3),ja("highlighted","a"===e.currentKey),ws(2),ja("highlighted","s"===e.currentKey),ws(2),ja("highlighted","d"===e.currentKey),ws(2),na("ngIf",e.shiftPressed))},directives:[kh,Ah,T_],styles:["[_nghost-%COMP%] .direction-arrow[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(5,.5fr);grid-template-rows:1fr;grid-column-gap:0px;grid-row-gap:0px;margin-bottom:1rem;width:7rem}[_nghost-%COMP%] .direction-arrow[_ngcontent-%COMP%] .arrow[_ngcontent-%COMP%]{grid-area:1/3/2/4;opacity:0;transition:.5s}[_nghost-%COMP%] .direction-arrow[_ngcontent-%COMP%] .arrow.active[_ngcontent-%COMP%]{opacity:1}[_nghost-%COMP%] .keys[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:flex-start;padding:0;grid-gap:.5rem;gap:.5rem;width:7rem;height:7rem;-webkit-user-select:none;-moz-user-select:none;user-select:none}[_nghost-%COMP%] .keys[_ngcontent-%COMP%] .keyrow[_ngcontent-%COMP%]{display:flex;flex-direction:row;justify-content:center;align-items:center;padding:0;grid-gap:.5rem;gap:.5rem}[_nghost-%COMP%] .keys[_ngcontent-%COMP%] .keyrow[_ngcontent-%COMP%] .key[_ngcontent-%COMP%]{display:flex;flex-direction:column;justify-content:center;align-items:center;padding:.25rem;width:2rem;height:2rem;border:2px solid;border-radius:.5rem;cursor:pointer}[_nghost-%COMP%] .keys[_ngcontent-%COMP%] .shift[_ngcontent-%COMP%]{display:flex;flex-direction:column;justify-content:center;align-items:center;padding:.25rem;width:7rem;height:2rem;border:2px solid;border-radius:.5rem}"],changeDetection:0}),t})(),y0=(()=>{class t{constructor(){this.className="ccf-spatial-search-keyboard-ui-behavior",this.delta=1,this.shiftDelta=2,this.changePosition=new Bc,this.shiftPressed=!1}updatePosition(t){if(this.currentDelta=this.shiftPressed?this.shiftDelta:this.delta,"Shift"===t)this.shiftPressed=!0;else{switch(this.currentKey=t.toLowerCase(),this.currentKey){case"q":this.position=Object.assign(Object.assign({},this.position),{z:this.position.z-this.currentDelta});break;case"e":this.position=Object.assign(Object.assign({},this.position),{z:this.position.z+this.currentDelta});break;case"w":this.position=Object.assign(Object.assign({},this.position),{y:this.position.y+this.currentDelta});break;case"s":this.position=Object.assign(Object.assign({},this.position),{y:this.position.y-this.currentDelta});break;case"a":this.position=Object.assign(Object.assign({},this.position),{x:this.position.x-this.currentDelta});break;case"d":this.position=Object.assign(Object.assign({},this.position),{x:this.position.x+this.currentDelta})}this.changePosition.emit(this.position)}}handleKey(t){t.preventDefault(),this.updatePosition(t.key)}keyUp(t){"Shift"===t.key?this.shiftPressed=!1:this.currentKey=void 0}keyClick(t){this.updatePosition(t)}keyHover(t){this.currentKey=t}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Jt({type:t,selectors:[["ccf-spatial-search-keyboard-ui-behavior"]],hostVars:2,hostBindings:function(t,e){1&t&&fa("keydown",function(t){return e.handleKey(t)},!1,Mr)("keyup",function(t){return e.keyUp(t)},!1,Mr),2&t&&Va(e.className)},inputs:{delta:"delta",shiftDelta:"shiftDelta",position:"position"},outputs:{changePosition:"changePosition"},decls:1,vars:2,consts:[[3,"currentKey","shiftPressed","keyClicked","keyHovered"]],template:function(t,e){1&t&&(ra(0,"ccf-spatial-search-keyboard-ui",0),fa("keyClicked",function(t){return e.keyClick(t)})("keyHovered",function(t){return e.keyHover(t)}),sa()),2&t&&na("currentKey",e.currentKey)("shiftPressed",e.shiftPressed)},directives:[b0],encapsulation:2,changeDetection:0}),t})(),v0=(()=>{class t{constructor(){this.className="ccf-spatial-search-ui",this.addSpatialSearch=new Bc,this.resetPosition=new Bc,this.resetSphere=new Bc,this.closeSpatialSearch=new Bc,this.radiusChange=new Bc,this.positionChange=new Bc,this.editReferenceOrganClicked=new Bc,this.infoClicked=new Bc,this.nodeClicked=new Bc}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Jt({type:t,selectors:[["ccf-spatial-search-ui"]],hostVars:2,hostBindings:function(t,e){2&t&&Va(e.className)},inputs:{scene:"scene",sceneBounds:"sceneBounds",sceneTarget:"sceneTarget",sex:"sex",referenceOrgan:"referenceOrgan",radius:"radius",radiusSettings:"radiusSettings",defaultPosition:"defaultPosition",position:"position",tissueBlocks:"tissueBlocks",anatomicalStructures:"anatomicalStructures",cellTypes:"cellTypes"},outputs:{addSpatialSearch:"addSpatialSearch",resetPosition:"resetPosition",resetSphere:"resetSphere",closeSpatialSearch:"closeSpatialSearch",radiusChange:"radiusChange",positionChange:"positionChange",editReferenceOrganClicked:"editReferenceOrganClicked",infoClicked:"infoClicked",nodeClicked:"nodeClicked"},decls:55,vars:27,consts:[[1,"header"],[1,"title"],["mat-icon-button","",1,"info"],[3,"click"],["mat-icon-button","",1,"close"],[1,"content"],[1,"info-panel"],[1,"organ-sex-selection"],[1,"sex"],[1,"label"],[1,"current-sex"],[1,"organ"],[1,"current-organ"],[1,"edit",3,"click"],[1,"radius-slider"],[1,"slider-container"],[1,"slider",3,"max","min","step","value","input"],[1,"text","value"],[1,"reset-buttons"],["mat-button","",1,"reset-sphere","button",3,"click"],["mat-button","",1,"reset-camera","button",3,"click"],[1,"results"],[1,"tissue-block","list",3,"tissueBlocks"],["title","Anatomical Structures","toolTipText","Total quantity of predicted anatomical structures detected by the Probing Sphere",1,"anatomical-structures","list",3,"termList"],["title","Predicted Cell Types from ASCT+B Tables","toolTipText","Total quantity of predicted cell types detected by the Probing Sphere",1,"cell-type","list",3,"termList"],["mat-button","",1,"run-spatial-search","button",3,"click"],[1,"spatial-search-scene"],[1,"primary-scene-wrapper"],[1,"body-ui-hint"],[1,"primary-scene",3,"scene","bounds","target","nodeClick","rotationChange"],["primary",""],[1,"sidebar"],[1,"minimap-scene",3,"interactive","scene","bounds","target","nodeClick"],["minimap",""],[3,"delta","shiftDelta","position","changePosition"],[3,"x","y","z"]],template:function(t,e){if(1&t){const t=ua();ra(0,"div",0),ra(1,"div",1),Ja(2,"Configure Spatial Search"),sa(),ra(3,"button",2),ra(4,"mat-icon",3),fa("click",function(){return e.infoClicked.emit()}),Ja(5,"info"),sa(),sa(),ra(6,"button",4),ra(7,"mat-icon",3),fa("click",function(){return e.closeSpatialSearch.emit()}),Ja(8,"close"),sa(),sa(),sa(),ra(9,"div",5),ra(10,"div",6),ra(11,"div",7),ra(12,"div",8),ra(13,"div",9),Ja(14,"Donor Sex: "),sa(),ra(15,"div",10),Ja(16),sa(),sa(),ra(17,"div",11),ra(18,"div",9),Ja(19,"Organ: "),sa(),ra(20,"div",12),Ja(21),sa(),sa(),ra(22,"div",13),fa("click",function(){return e.editReferenceOrganClicked.emit()}),Ja(23,"Edit"),sa(),sa(),oa(24,"mat-divider"),ra(25,"div",14),ra(26,"div",1),Ja(27,"Probing Sphere Radius"),sa(),ra(28,"div",15),ra(29,"mat-slider",16),fa("input",function(t){return e.radiusChange.emit(t.value)}),sa(),ra(30,"span",17),Ja(31),sa(),sa(),ra(32,"div",18),ra(33,"button",19),fa("click",function(){return e.resetSphere.emit(),e.resetPosition.emit()}),Ja(34,"Reset Probing Sphere"),sa(),ra(35,"button",20),fa("click",function(){$e(t);const n=ta(49),i=ta(52);return n.rotation=n.rotationX=i.rotation=i.rotationX=0,n.target=i.target=e.sceneTarget,n.bounds=i.bounds=e.sceneBounds}),Ja(36,"Reset Camera View"),sa(),sa(),sa(),oa(37,"mat-divider"),ra(38,"div",21),oa(39,"ccf-tissue-block-list",22),oa(40,"ccf-term-occurrence-list",23),oa(41,"ccf-term-occurrence-list",24),sa(),ra(42,"button",25),fa("click",function(){return e.addSpatialSearch.emit()}),Ja(43,"Run Spatial Search"),sa(),sa(),ra(44,"div",26),ra(45,"div",27),ra(46,"div",28),Ja(47,"Use the keyboard or click a Tissue Block to move the Probing Sphere"),sa(),ra(48,"ccf-body-ui",29,30),fa("nodeClick",function(t){return e.nodeClicked.emit(null==t?null:t.node)})("rotationChange",function(e){$e(t);const n=ta(52);return n.rotation=e[0],n.rotationX=e[1]}),sa(),sa(),ra(50,"div",31),ra(51,"ccf-body-ui",32,33),fa("nodeClick",function(t){return e.nodeClicked.emit(null==t?null:t.node)}),sa(),ra(53,"ccf-spatial-search-keyboard-ui-behavior",34),fa("changePosition",function(t){return e.positionChange.emit(t)}),sa(),oa(54,"ccf-xyz-position",35),sa(),sa(),sa()}2&t&&(ws(16),tl(e.sex.charAt(0).toUpperCase()+e.sex.slice(1)),ws(5),tl(e.referenceOrgan.name),ws(8),na("max",e.radiusSettings.max)("min",e.radiusSettings.min)("step",1)("value",e.radius),ws(2),el("",e.radius," mm"),ws(2),ja("disabled",e.radius===e.radiusSettings.defaultValue&&e.position===e.defaultPosition),ws(6),na("tissueBlocks",e.tissueBlocks),ws(1),na("termList",e.anatomicalStructures),ws(1),na("termList",e.cellTypes),ws(1),ja("disabled",0===(null==e.tissueBlocks?null:e.tissueBlocks.length)),ws(6),na("scene",e.scene)("bounds",e.sceneBounds)("target",e.sceneTarget),ws(3),na("interactive",!1)("scene",e.scene)("bounds",e.sceneBounds)("target",e.sceneTarget),ws(2),na("delta",1)("shiftDelta",2)("position",e.position),ws(1),na("x",e.position.x)("y",e.position.y)("z",e.position.z))},directives:[R_,T_,KY,F$,d0,f0,CK,y0,EQ],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;align-items:flex-start;padding:2rem;grid-gap:1rem;gap:1rem;height:95vh;width:78vw;border-radius:.25rem;min-height:45rem;min-width:60rem}[_nghost-%COMP%] .header[_ngcontent-%COMP%]{display:flex;width:100%}[_nghost-%COMP%] .header[_ngcontent-%COMP%] .info[_ngcontent-%COMP%], [_nghost-%COMP%] .header[_ngcontent-%COMP%] .close[_ngcontent-%COMP%]{padding:0;background:none;border:none;cursor:pointer;outline:none;border-radius:.25rem;transition:.6s}[_nghost-%COMP%] .header[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{display:flex;align-items:center;margin-right:1rem}[_nghost-%COMP%] .header[_ngcontent-%COMP%] .close[_ngcontent-%COMP%]{margin-left:auto}[_nghost-%COMP%] .content[_ngcontent-%COMP%]{display:flex;width:100%;height:calc(100% - 3.5rem)}[_nghost-%COMP%] .content[_ngcontent-%COMP%] .button[_ngcontent-%COMP%]{border-width:1px;border-style:solid;border-radius:.25rem;font-size:.875rem;height:2rem;line-height:2rem;transition:.5s}[_nghost-%COMP%] .content[_ngcontent-%COMP%] .button.disabled[_ngcontent-%COMP%]{opacity:.5;pointer-events:none}[_nghost-%COMP%] .content[_ngcontent-%COMP%] .info-panel[_ngcontent-%COMP%]{display:flex;flex-direction:column;margin-right:2rem;grid-gap:1rem;gap:1rem;width:25rem}[_nghost-%COMP%] .content[_ngcontent-%COMP%] .info-panel[_ngcontent-%COMP%] .organ-sex-selection[_ngcontent-%COMP%]{display:flex;font-size:1rem;justify-content:space-between}[_nghost-%COMP%] .content[_ngcontent-%COMP%] .info-panel[_ngcontent-%COMP%] .organ-sex-selection[_ngcontent-%COMP%] .sex[_ngcontent-%COMP%], [_nghost-%COMP%] .content[_ngcontent-%COMP%] .info-panel[_ngcontent-%COMP%] .organ-sex-selection[_ngcontent-%COMP%] .organ[_ngcontent-%COMP%]{display:flex}[_nghost-%COMP%] .content[_ngcontent-%COMP%] .info-panel[_ngcontent-%COMP%] .organ-sex-selection[_ngcontent-%COMP%] .sex[_ngcontent-%COMP%] .label[_ngcontent-%COMP%], [_nghost-%COMP%] .content[_ngcontent-%COMP%] .info-panel[_ngcontent-%COMP%] .organ-sex-selection[_ngcontent-%COMP%] .organ[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{font-weight:300;margin-right:.5rem}[_nghost-%COMP%] .content[_ngcontent-%COMP%] .info-panel[_ngcontent-%COMP%] .organ-sex-selection[_ngcontent-%COMP%] .sex[_ngcontent-%COMP%] .current-sex[_ngcontent-%COMP%], [_nghost-%COMP%] .content[_ngcontent-%COMP%] .info-panel[_ngcontent-%COMP%] .organ-sex-selection[_ngcontent-%COMP%] .sex[_ngcontent-%COMP%] .current-organ[_ngcontent-%COMP%], [_nghost-%COMP%] .content[_ngcontent-%COMP%] .info-panel[_ngcontent-%COMP%] .organ-sex-selection[_ngcontent-%COMP%] .organ[_ngcontent-%COMP%] .current-sex[_ngcontent-%COMP%], [_nghost-%COMP%] .content[_ngcontent-%COMP%] .info-panel[_ngcontent-%COMP%] .organ-sex-selection[_ngcontent-%COMP%] .organ[_ngcontent-%COMP%] .current-organ[_ngcontent-%COMP%]{font-weight:600}[_nghost-%COMP%] .content[_ngcontent-%COMP%] .info-panel[_ngcontent-%COMP%] .organ-sex-selection[_ngcontent-%COMP%] .edit[_ngcontent-%COMP%]{cursor:pointer}[_nghost-%COMP%] .content[_ngcontent-%COMP%] .info-panel[_ngcontent-%COMP%] .radius-slider[_ngcontent-%COMP%]{display:flex;flex-direction:column}[_nghost-%COMP%] .content[_ngcontent-%COMP%] .info-panel[_ngcontent-%COMP%] .radius-slider[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-weight:600;font-size:1rem}[_nghost-%COMP%] .content[_ngcontent-%COMP%] .info-panel[_ngcontent-%COMP%] .radius-slider[_ngcontent-%COMP%] .slider-container[_ngcontent-%COMP%]{display:flex;justify-content:space-between}[_nghost-%COMP%] .content[_ngcontent-%COMP%] .info-panel[_ngcontent-%COMP%] .radius-slider[_ngcontent-%COMP%] .slider-container[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%]{width:19rem}[_nghost-%COMP%] .content[_ngcontent-%COMP%] .info-panel[_ngcontent-%COMP%] .radius-slider[_ngcontent-%COMP%] .slider-container[_ngcontent-%COMP%] .value[_ngcontent-%COMP%]{display:flex;align-items:center;font-size:1rem}[_nghost-%COMP%] .content[_ngcontent-%COMP%] .info-panel[_ngcontent-%COMP%] .radius-slider[_ngcontent-%COMP%] .reset-buttons[_ngcontent-%COMP%]{display:flex;justify-content:space-between}[_nghost-%COMP%] .content[_ngcontent-%COMP%] .info-panel[_ngcontent-%COMP%] .radius-slider[_ngcontent-%COMP%] .reset-buttons[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{width:11.5rem}[_nghost-%COMP%] .content[_ngcontent-%COMP%] .info-panel[_ngcontent-%COMP%] .results[_ngcontent-%COMP%]{height:calc(100% - 15rem - 2px)}[_nghost-%COMP%] .content[_ngcontent-%COMP%] .info-panel[_ngcontent-%COMP%] .results[_ngcontent-%COMP%] .list[_ngcontent-%COMP%]{height:33%;display:flex;flex-direction:column}[_nghost-%COMP%] .content[_ngcontent-%COMP%] .spatial-search-scene[_ngcontent-%COMP%]{display:flex;width:calc(100% - 25rem);background-color:#000;border-radius:.5rem}[_nghost-%COMP%] .content[_ngcontent-%COMP%] .spatial-search-scene[_ngcontent-%COMP%] .primary-scene-wrapper[_ngcontent-%COMP%]{display:flex;flex-direction:column;width:100%;height:100%}[_nghost-%COMP%] .content[_ngcontent-%COMP%] .spatial-search-scene[_ngcontent-%COMP%] .primary-scene-wrapper[_ngcontent-%COMP%] .primary-scene[_ngcontent-%COMP%]{flex:auto;overflow:hidden}[_nghost-%COMP%] .content[_ngcontent-%COMP%] .spatial-search-scene[_ngcontent-%COMP%] .primary-scene-wrapper[_ngcontent-%COMP%] .body-ui-hint[_ngcontent-%COMP%]{color:#fff;font-size:1rem;margin:1rem}[_nghost-%COMP%] .content[_ngcontent-%COMP%] .spatial-search-scene[_ngcontent-%COMP%] .sidebar[_ngcontent-%COMP%] .minimap-scene[_ngcontent-%COMP%]{margin:1.5rem;width:12.75rem;height:11rem}[_nghost-%COMP%] .content[_ngcontent-%COMP%] .spatial-search-scene[_ngcontent-%COMP%] .sidebar[_ngcontent-%COMP%] .minimap-scene[_ngcontent-%COMP%] .body-ui{background-color:#232f3a}[_nghost-%COMP%] .content[_ngcontent-%COMP%] .spatial-search-scene[_ngcontent-%COMP%] .sidebar[_ngcontent-%COMP%] ccf-spatial-search-keyboard-ui-behavior[_ngcontent-%COMP%]{margin:1.5rem;display:flex;justify-content:center}[_nghost-%COMP%] .content[_ngcontent-%COMP%] .spatial-search-scene[_ngcontent-%COMP%] .sidebar[_ngcontent-%COMP%] ccf-xyz-position[_ngcontent-%COMP%]{margin:1.5rem;padding-left:5rem}"],changeDetection:0}),t})();function _0(t,e){if(1&t){const t=ua();ra(0,"ccf-spatial-search-ui",1),fa("addSpatialSearch",function(){return $e(t),va().addSpatialSearch()})("radiusChange",function(e){return $e(t),va().updateRadius(e)})("resetPosition",function(){return $e(t),va().resetPosition()})("resetSphere",function(){return $e(t),va().resetRadius()})("positionChange",function(e){return $e(t),va().updatePosition(e)})("closeSpatialSearch",function(){return $e(t),va().close()})("editReferenceOrganClicked",function(){return $e(t),va().openSpatialSearchConfig()})("infoClicked",function(){return $e(t),va().onDialogButtonClick()})("nodeClicked",function(e){return $e(t),va().moveToNode(e)}),Dc(1,"async"),Dc(2,"async"),Dc(3,"async"),Dc(4,"async"),Dc(5,"async"),Dc(6,"async"),Dc(7,"async"),Dc(8,"async"),Dc(9,"async"),Dc(10,"async"),Dc(11,"async"),sa()}if(2&t){const t=e.ngIf,n=va();na("sex",Rc(1,12,n.sex$))("referenceOrgan",t)("radius",Rc(2,14,n.radius$))("radiusSettings",Rc(3,16,n.radiusSettings$))("defaultPosition",Rc(4,18,n.defaultPosition$))("position",Rc(5,20,n.position$))("scene",Rc(6,22,n.scene$))("sceneBounds",Rc(7,24,n.sceneBounds$))("sceneTarget",Rc(8,26,n.sceneTarget$))("tissueBlocks",Rc(9,28,n.tissueBlocks$))("anatomicalStructures",Rc(10,30,n.anatomicalStructures$))("cellTypes",Rc(11,32,n.cellTypes$))}}class w0{constructor(t,e,n){this.dialogRef=t,this.dialog=e,this.infoService=n,this.updatePosition=NQ(NZ),this.resetPosition=NQ(jZ),this.moveToNode=NQ(LZ),this.updateRadius=NQ(FZ),this.resetRadius=NQ(BZ),this.subscriptions=new g}launchInfoDialog(t){this.subscriptions.unsubscribe(),this.dialog.open(UK,{autoFocus:!1,panelClass:"modal-animated",width:"72rem",data:{title:t.infoTitle,content:t.content,videoID:t.videoID}})}onDialogButtonClick(){this.infoService.updateData("assets/docs/SPATIAL_SEARCH_README.md","UfxMpzatowE","Spatial Search");const t=this.infoService.panelContent.asObservable();this.subscriptions.add(t.subscribe(t=>{t.content.length&&(this.panelData=t,this.launchInfoDialog(this.panelData))}))}close(){this.dialogRef.close()}addSpatialSearch(){return this.close(),new zZ}openSpatialSearchConfig(){this.close(),this.dialog.open(B0)}}w0.\u0275fac=function(t){return new(t||w0)(ea(Y$),ea(nG),ea($K))},w0.\u0275cmp=Jt({type:w0,selectors:[["ccf-spatial-search-ui-behavior"]],decls:2,vars:3,consts:[[3,"sex","referenceOrgan","radius","radiusSettings","defaultPosition","position","scene","sceneBounds","sceneTarget","tissueBlocks","anatomicalStructures","cellTypes","addSpatialSearch","radiusChange","resetPosition","resetSphere","positionChange","closeSpatialSearch","editReferenceOrganClicked","infoClicked","nodeClicked",4,"ngIf"],[3,"sex","referenceOrgan","radius","radiusSettings","defaultPosition","position","scene","sceneBounds","sceneTarget","tissueBlocks","anatomicalStructures","cellTypes","addSpatialSearch","radiusChange","resetPosition","resetSphere","positionChange","closeSpatialSearch","editReferenceOrganClicked","infoClicked","nodeClicked"]],template:function(t,e){1&t&&(Jo(0,_0,12,34,"ccf-spatial-search-ui",0),Dc(1,"async")),2&t&&na("ngIf",Rc(1,1,e.organ$))},directives:[Ah,v0],pipes:[$h],encapsulation:2,changeDetection:0}),vw([iU(u0.scene)],w0.prototype,"scene$",void 0),vw([iU(u0.sceneBounds)],w0.prototype,"sceneBounds$",void 0),vw([iU(u0.sceneTarget)],w0.prototype,"sceneTarget$",void 0),vw([iU(u0.sex)],w0.prototype,"sex$",void 0),vw([iU(u0.organ)],w0.prototype,"organ$",void 0),vw([iU(u0.position)],w0.prototype,"position$",void 0),vw([iU(u0.defaultPosition)],w0.prototype,"defaultPosition$",void 0),vw([iU(u0.radius)],w0.prototype,"radius$",void 0),vw([iU(u0.radiusSettings)],w0.prototype,"radiusSettings$",void 0),vw([iU(u0.tissueBlocks)],w0.prototype,"tissueBlocks$",void 0),vw([iU(u0.anatomicalStructures)],w0.prototype,"anatomicalStructures$",void 0),vw([iU(u0.cellTypes)],w0.prototype,"cellTypes$",void 0),vw([XY()],w0.prototype,"updatePosition",void 0),vw([XY()],w0.prototype,"resetPosition",void 0),vw([XY()],w0.prototype,"moveToNode",void 0),vw([XY()],w0.prototype,"updateRadius",void 0),vw([XY()],w0.prototype,"resetRadius",void 0),vw([XY()],w0.prototype,"addSpatialSearch",null);const x0=["input"],S0=function(t){return{enterDuration:t}},C0=["*"],E0=new oi("mat-radio-default-options",{providedIn:"root",factory:function(){return{color:"accent"}}});let O0=0;const T0={provide:aU,useExisting:pt(()=>M0),multi:!0};class k0{constructor(t,e){this.source=t,this.value=e}}const P0=new oi("MatRadioGroup");let A0=(()=>{class t{constructor(t){this._changeDetector=t,this._value=null,this._name="mat-radio-group-"+O0++,this._selected=null,this._isInitialized=!1,this._labelPosition="after",this._disabled=!1,this._required=!1,this._controlValueAccessorChangeFn=()=>{},this.onTouched=()=>{},this.change=new Bc}get name(){return this._name}set name(t){this._name=t,this._updateRadioButtonNames()}get labelPosition(){return this._labelPosition}set labelPosition(t){this._labelPosition="before"===t?"before":"after",this._markRadiosForCheck()}get value(){return this._value}set value(t){this._value!==t&&(this._value=t,this._updateSelectedRadioFromValue(),this._checkSelectedRadioButton())}_checkSelectedRadioButton(){this._selected&&!this._selected.checked&&(this._selected.checked=!0)}get selected(){return this._selected}set selected(t){this._selected=t,this.value=t?t.value:null,this._checkSelectedRadioButton()}get disabled(){return this._disabled}set disabled(t){this._disabled=kd(t),this._markRadiosForCheck()}get required(){return this._required}set required(t){this._required=kd(t),this._markRadiosForCheck()}ngAfterContentInit(){this._isInitialized=!0}_touch(){this.onTouched&&this.onTouched()}_updateRadioButtonNames(){this._radios&&this._radios.forEach(t=>{t.name=this.name,t._markForCheck()})}_updateSelectedRadioFromValue(){this._radios&&(null===this._selected||this._selected.value!==this._value)&&(this._selected=null,this._radios.forEach(t=>{t.checked=this.value===t.value,t.checked&&(this._selected=t)}))}_emitChangeEvent(){this._isInitialized&&this.change.emit(new k0(this._selected,this._value))}_markRadiosForCheck(){this._radios&&this._radios.forEach(t=>t._markForCheck())}writeValue(t){this.value=t,this._changeDetector.markForCheck()}registerOnChange(t){this._controlValueAccessorChangeFn=t}registerOnTouched(t){this.onTouched=t}setDisabledState(t){this.disabled=t,this._changeDetector.markForCheck()}}return t.\u0275fac=function(e){return new(e||t)(ea(nc))},t.\u0275dir=se({type:t,inputs:{name:"name",labelPosition:"labelPosition",value:"value",selected:"selected",disabled:"disabled",required:"required",color:"color"},outputs:{change:"change"}}),t})(),M0=(()=>{class t extends A0{}return t.\u0275fac=function(){let e;return function(n){return(e||(e=ei(t)))(n||t)}}(),t.\u0275dir=se({type:t,selectors:[["mat-radio-group"]],contentQueries:function(t,e,n){if(1&t&&Jc(n,N0,5),2&t){let t;Qc(t=tu())&&(e._radios=t)}},hostAttrs:["role","radiogroup",1,"mat-radio-group"],exportAs:["matRadioGroup"],features:[xl([T0,{provide:P0,useExisting:t}]),jo]}),t})();class I0{constructor(t){this._elementRef=t}}const D0=Yy(Ky(I0));let R0=(()=>{class t extends D0{constructor(t,e,n,i,r,s,o,a){super(e),this._changeDetector=n,this._focusMonitor=i,this._radioDispatcher=r,this._providerOverride=o,this._uniqueId="mat-radio-"+ ++O0,this.id=this._uniqueId,this.change=new Bc,this._checked=!1,this._value=null,this._removeUniqueSelectionListener=()=>{},this.radioGroup=t,this._noopAnimations="NoopAnimations"===s,a&&(this.tabIndex=Pd(a,0)),this._removeUniqueSelectionListener=r.listen((t,e)=>{t!==this.id&&e===this.name&&(this.checked=!1)})}get checked(){return this._checked}set checked(t){const e=kd(t);this._checked!==e&&(this._checked=e,e&&this.radioGroup&&this.radioGroup.value!==this.value?this.radioGroup.selected=this:!e&&this.radioGroup&&this.radioGroup.value===this.value&&(this.radioGroup.selected=null),e&&this._radioDispatcher.notify(this.id,this.name),this._changeDetector.markForCheck())}get value(){return this._value}set value(t){this._value!==t&&(this._value=t,null!==this.radioGroup&&(this.checked||(this.checked=this.radioGroup.value===t),this.checked&&(this.radioGroup.selected=this)))}get labelPosition(){return this._labelPosition||this.radioGroup&&this.radioGroup.labelPosition||"after"}set labelPosition(t){this._labelPosition=t}get disabled(){return this._disabled||null!==this.radioGroup&&this.radioGroup.disabled}set disabled(t){this._setDisabled(kd(t))}get required(){return this._required||this.radioGroup&&this.radioGroup.required}set required(t){this._required=kd(t)}get color(){return this._color||this.radioGroup&&this.radioGroup.color||this._providerOverride&&this._providerOverride.color||"accent"}set color(t){this._color=t}get inputId(){return`${this.id||this._uniqueId}-input`}focus(t,e){e?this._focusMonitor.focusVia(this._inputElement,e,t):this._inputElement.nativeElement.focus(t)}_markForCheck(){this._changeDetector.markForCheck()}ngOnInit(){this.radioGroup&&(this.checked=this.radioGroup.value===this._value,this.checked&&(this.radioGroup.selected=this),this.name=this.radioGroup.name)}ngAfterViewInit(){this._focusMonitor.monitor(this._elementRef,!0).subscribe(t=>{!t&&this.radioGroup&&this.radioGroup._touch()})}ngOnDestroy(){this._focusMonitor.stopMonitoring(this._elementRef),this._removeUniqueSelectionListener()}_emitChangeEvent(){this.change.emit(new k0(this,this._value))}_isRippleDisabled(){return this.disableRipple||this.disabled}_onInputClick(t){t.stopPropagation()}_onInputInteraction(t){if(t.stopPropagation(),!this.checked&&!this.disabled){const t=this.radioGroup&&this.value!==this.radioGroup.value;this.checked=!0,this._emitChangeEvent(),this.radioGroup&&(this.radioGroup._controlValueAccessorChangeFn(this.value),t&&this.radioGroup._emitChangeEvent())}}_setDisabled(t){this._disabled!==t&&(this._disabled=t,this._changeDetector.markForCheck())}}return t.\u0275fac=function(e){return new(e||t)(ea(A0),ea(Al),ea(nc),ea(Ug),ea(zp),ea(String),ea(void 0),ea(String))},t.\u0275dir=se({type:t,viewQuery:function(t,e){if(1&t&&Zc(x0,5),2&t){let t;Qc(t=tu())&&(e._inputElement=t.first)}},inputs:{id:"id",checked:"checked",value:"value",labelPosition:"labelPosition",disabled:"disabled",required:"required",color:"color",name:"name",ariaLabel:["aria-label","ariaLabel"],ariaLabelledby:["aria-labelledby","ariaLabelledby"],ariaDescribedby:["aria-describedby","ariaDescribedby"]},outputs:{change:"change"},features:[jo]}),t})(),N0=(()=>{class t extends R0{constructor(t,e,n,i,r,s,o,a){super(t,e,n,i,r,s,o,a)}}return t.\u0275fac=function(e){return new(e||t)(ea(P0,8),ea(Al),ea(nc),ea(Ug),ea(zp),ea(Ny,8),ea(E0,8),ii("tabindex"))},t.\u0275cmp=Jt({type:t,selectors:[["mat-radio-button"]],hostAttrs:[1,"mat-radio-button"],hostVars:17,hostBindings:function(t,e){1&t&&fa("focus",function(){return e._inputElement.nativeElement.focus()}),2&t&&(Ko("tabindex",null)("id",e.id)("aria-label",null)("aria-labelledby",null)("aria-describedby",null),ja("mat-radio-checked",e.checked)("mat-radio-disabled",e.disabled)("_mat-animation-noopable",e._noopAnimations)("mat-primary","primary"===e.color)("mat-accent","accent"===e.color)("mat-warn","warn"===e.color))},inputs:{disableRipple:"disableRipple",tabIndex:"tabIndex"},exportAs:["matRadioButton"],features:[jo],ngContentSelectors:C0,decls:13,vars:20,consts:[[1,"mat-radio-label"],["label",""],[1,"mat-radio-container"],[1,"mat-radio-outer-circle"],[1,"mat-radio-inner-circle"],["type","radio",1,"mat-radio-input","cdk-visually-hidden",3,"id","checked","disabled","tabIndex","required","change","click"],["input",""],["mat-ripple","",1,"mat-radio-ripple","mat-focus-indicator",3,"matRippleTrigger","matRippleDisabled","matRippleCentered","matRippleRadius","matRippleAnimation"],[1,"mat-ripple-element","mat-radio-persistent-ripple"],[1,"mat-radio-label-content"],[2,"display","none"]],template:function(t,e){if(1&t&&(wa(),ra(0,"label",0,1),ra(2,"span",2),oa(3,"span",3),oa(4,"span",4),ra(5,"input",5,6),fa("change",function(t){return e._onInputInteraction(t)})("click",function(t){return e._onInputClick(t)}),sa(),ra(7,"span",7),oa(8,"span",8),sa(),sa(),ra(9,"span",9),ra(10,"span",10),Ja(11,"\xa0"),sa(),xa(12),sa(),sa()),2&t){const t=ta(1);Ko("for",e.inputId),ws(5),na("id",e.inputId)("checked",e.checked)("disabled",e.disabled)("tabIndex",e.tabIndex)("required",e.required),Ko("name",e.name)("value",e.value)("aria-label",e.ariaLabel)("aria-labelledby",e.ariaLabelledby)("aria-describedby",e.ariaDescribedby),ws(2),na("matRippleTrigger",t)("matRippleDisabled",e._isRippleDisabled())("matRippleCentered",!0)("matRippleRadius",20)("matRippleAnimation",Pc(18,S0,e._noopAnimations?0:150)),ws(2),ja("mat-radio-label-before","before"==e.labelPosition)}},directives:[cv],styles:[".mat-radio-button{display:inline-block;-webkit-tap-highlight-color:transparent;outline:0}.mat-radio-label{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;display:inline-flex;align-items:center;white-space:nowrap;vertical-align:middle;width:100%}.mat-radio-container{box-sizing:border-box;display:inline-block;position:relative;width:20px;height:20px;flex-shrink:0}.mat-radio-outer-circle{box-sizing:border-box;display:block;height:20px;left:0;position:absolute;top:0;transition:border-color ease 280ms;width:20px;border-width:2px;border-style:solid;border-radius:50%}._mat-animation-noopable .mat-radio-outer-circle{transition:none}.mat-radio-inner-circle{border-radius:50%;box-sizing:border-box;display:block;height:20px;left:0;position:absolute;top:0;opacity:0;transition:transform ease 280ms,background-color ease 280ms,opacity linear 1ms 280ms;width:20px;transform:scale(0.001);-webkit-print-color-adjust:exact;color-adjust:exact}.mat-radio-checked .mat-radio-inner-circle{transform:scale(0.5);opacity:1;transition:transform ease 280ms,background-color ease 280ms}.cdk-high-contrast-active .mat-radio-checked .mat-radio-inner-circle{border:solid 10px}._mat-animation-noopable .mat-radio-inner-circle{transition:none}.mat-radio-label-content{-webkit-user-select:auto;-moz-user-select:auto;-ms-user-select:auto;user-select:auto;display:inline-block;order:0;line-height:inherit;padding-left:8px;padding-right:0}[dir=rtl] .mat-radio-label-content{padding-right:8px;padding-left:0}.mat-radio-label-content.mat-radio-label-before{order:-1;padding-left:0;padding-right:8px}[dir=rtl] .mat-radio-label-content.mat-radio-label-before{padding-right:0;padding-left:8px}.mat-radio-disabled,.mat-radio-disabled .mat-radio-label{cursor:default}.mat-radio-button .mat-radio-ripple{position:absolute;left:calc(50% - 20px);top:calc(50% - 20px);height:40px;width:40px;z-index:1;pointer-events:none}.mat-radio-button .mat-radio-ripple .mat-ripple-element:not(.mat-radio-persistent-ripple){opacity:.16}.mat-radio-persistent-ripple{width:100%;height:100%;transform:none;top:0;left:0}.mat-radio-container:hover .mat-radio-persistent-ripple{opacity:.04}.mat-radio-button:not(.mat-radio-disabled).cdk-keyboard-focused .mat-radio-persistent-ripple,.mat-radio-button:not(.mat-radio-disabled).cdk-program-focused .mat-radio-persistent-ripple{opacity:.12}.mat-radio-persistent-ripple,.mat-radio-disabled .mat-radio-container:hover .mat-radio-persistent-ripple{opacity:0}@media(hover: none){.mat-radio-container:hover .mat-radio-persistent-ripple{display:none}}.mat-radio-input{bottom:0;left:50%}.cdk-high-contrast-active .mat-radio-button:not(.mat-radio-disabled).cdk-keyboard-focused .mat-radio-ripple,.cdk-high-contrast-active .mat-radio-button:not(.mat-radio-disabled).cdk-program-focused .mat-radio-ripple{outline:solid 3px}.cdk-high-contrast-active .mat-radio-disabled{opacity:.5}\n"],encapsulation:2,changeDetection:0}),t})();function L0(t,e){1&t&&(ra(0,"div",7),Ja(1,"Organs"),sa())}function j0(t,e){if(1&t&&(ra(0,"mat-option",17),Ja(1),sa()),2&t){const t=e.$implicit;na("value",t),ws(1),el(" ",t.name," ")}}let F0=(()=>{class t{constructor(){this.className="ccf-spatial-search-config",this.updateSex=new Bc,this.updateOrgan=new Bc,this.buttonClicked=new Bc,this.closeDialog=new Bc,this.infoClicked=new Bc}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Jt({type:t,selectors:[["ccf-spatial-search-config"]],hostVars:2,hostBindings:function(t,e){2&t&&Va(e.className)},inputs:{organs:"organs",selectedOrgan:"selectedOrgan",sex:"sex"},outputs:{updateSex:"updateSex",updateOrgan:"updateOrgan",buttonClicked:"buttonClicked",closeDialog:"closeDialog",infoClicked:"infoClicked"},decls:27,vars:6,consts:[[1,"header"],[1,"header-left"],[1,"title"],["mat-icon-button","",1,"info"],[3,"click"],["mat-icon-button","",1,"close"],[1,"sex-toggle"],[1,"label"],[1,"radio-group",3,"ngModel","ngModelChange","change"],["value","male",1,"radio"],["value","female",1,"radio"],[1,"organ-selector"],["appearance","fill",1,"form-field"],["class","label",4,"ngIf"],["disableOptionCentering","true","panelClass","organ-select",3,"value","valueChange","selectionChange"],["class","organ-select-option",3,"value",4,"ngFor","ngForOf"],["mat-button","",1,"continue-button",3,"click"],[1,"organ-select-option",3,"value"]],template:function(t,e){1&t&&(ra(0,"div",0),ra(1,"div",1),ra(2,"div",2),Ja(3,"Configure Spatial Search"),sa(),ra(4,"button",3),ra(5,"mat-icon",4),fa("click",function(){return e.infoClicked.emit()}),Ja(6,"info"),sa(),sa(),sa(),ra(7,"button",5),ra(8,"mat-icon",4),fa("click",function(){return e.closeDialog.emit()}),Ja(9,"close"),sa(),sa(),sa(),ra(10,"div",6),ra(11,"div",7),Ja(12,"Donor Sex: "),sa(),ra(13,"mat-radio-group",8),fa("ngModelChange",function(t){return e.sex=t})("change",function(t){return e.updateSex.emit(t.value)}),ra(14,"mat-radio-button",9),Ja(15,"Male"),sa(),ra(16,"mat-radio-button",10),Ja(17,"Female"),sa(),sa(),sa(),ra(18,"div",11),ra(19,"div",7),Ja(20,"Select an organ"),sa(),ra(21,"mat-form-field",12),Jo(22,L0,2,0,"div",13),ra(23,"mat-select",14),fa("valueChange",function(t){return e.selectedOrgan=t})("selectionChange",function(t){return e.updateOrgan.emit(t.value)}),Jo(24,j0,2,2,"mat-option",15),sa(),sa(),sa(),ra(25,"button",16),fa("click",function(){return e.buttonClicked.emit()}),Ja(26,"Continue"),sa()),2&t&&(ws(13),na("ngModel",e.sex),ws(9),na("ngIf",!e.selectedOrgan),ws(1),na("value",e.selectedOrgan),ws(1),na("ngForOf",e.organs),ws(1),ja("disabled",!e.selectedOrgan))},directives:[R_,T_,M0,MU,lH,N0,QH,Ah,aJ,kh,wv],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;align-items:flex-start;padding:2rem;grid-gap:2rem;gap:2rem;width:30.5rem;box-shadow:0 25rem 25rem #00000029;border-radius:.25rem;font-size:1rem}[_nghost-%COMP%] .button[_ngcontent-%COMP%]{cursor:pointer}[_nghost-%COMP%] .header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;width:100%;font-size:1.25rem}[_nghost-%COMP%] .header[_ngcontent-%COMP%] .header-left[_ngcontent-%COMP%]{display:flex;align-items:center}[_nghost-%COMP%] .header[_ngcontent-%COMP%] .header-left[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{margin-right:1rem}[_nghost-%COMP%] .header[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{padding:0;background:none;border:none;cursor:pointer;outline:none;border-radius:.25rem;transition:.6s}[_nghost-%COMP%] .sex-toggle[_ngcontent-%COMP%]{display:flex}[_nghost-%COMP%] .sex-toggle[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{margin-right:2rem}[_nghost-%COMP%] .sex-toggle[_ngcontent-%COMP%] .radio[_ngcontent-%COMP%]{margin-right:4rem}[_nghost-%COMP%] .organ-selector[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{height:0rem}[_nghost-%COMP%] .organ-selector[_ngcontent-%COMP%] .mat-form-field-wrapper{padding-bottom:1rem;padding-top:3rem;margin-left:.5rem;width:14rem}[_nghost-%COMP%] .organ-selector[_ngcontent-%COMP%] .mat-form-field-wrapper .mat-form-field-infix{padding:0;border-top:none}[_nghost-%COMP%] .organ-selector[_ngcontent-%COMP%] .mat-form-field-wrapper .mat-form-field-underline{bottom:0rem;height:.125rem}[_nghost-%COMP%] .organ-selector[_ngcontent-%COMP%] .mat-form-field-wrapper .mat-select-arrow-wrapper{transform:translatey(0)}[_nghost-%COMP%] .continue-button[_ngcontent-%COMP%]{display:flex;flex-direction:row;justify-content:center;align-items:center;padding:.25rem 1rem;width:14rem;height:2rem;border-width:1px;border-style:solid;border-radius:.25rem;box-shadow:0 2px 6px #00000029}[_nghost-%COMP%] .continue-button.disabled[_ngcontent-%COMP%]{pointer-events:none;opacity:.5} .organ-select{position:absolute;top:2.5rem;left:-.25rem;border-radius:.5rem;max-height:24.5rem;width:14rem} .organ-select .organ-select-option{height:3.5rem;border-bottom:1px solid}"],changeDetection:0}),t})();class B0{constructor(t,e,n,i){this.dialog=t,this.dialogRef=e,this.spatialSearchDialog=n,this.infoService=i,this.updateSex=NQ(DZ),this.updateOrgan=NQ(RZ),this.subscriptions=new g,this.dialogSubs=new g}buttonClicked(){this.spatialSearchDialog.open(w0),this.close()}close(){this.dialogRef.close()}launchInfoDialog(t){this.dialogSubs.unsubscribe(),this.dialog.open(UK,{autoFocus:!1,panelClass:"modal-animated",width:"72rem",data:{title:t.infoTitle,content:t.content,videoID:t.videoID}})}onDialogButtonClick(){this.infoService.updateData("assets/docs/SPATIAL_SEARCH_README.md","UfxMpzatowE","Spatial Search");const t=this.infoService.panelContent.asObservable();this.dialogSubs.add(t.subscribe(t=>{t.content.length&&(this.panelData=t,this.launchInfoDialog(this.panelData))}))}ngOnDestroy(){this.subscriptions.unsubscribe()}}B0.\u0275fac=function(t){return new(t||B0)(ea(nG),ea(Y$),ea(nG),ea($K))},B0.\u0275cmp=Jt({type:B0,selectors:[["ccf-spatial-search-config-behavior"]],decls:4,vars:9,consts:[[3,"sex","organs","selectedOrgan","updateSex","updateOrgan","closeDialog","buttonClicked","infoClicked"]],template:function(t,e){1&t&&(ra(0,"ccf-spatial-search-config",0),fa("updateSex",function(t){return e.updateSex(t)})("updateOrgan",function(t){return e.updateOrgan(t.id)})("closeDialog",function(){return e.close()})("buttonClicked",function(){return e.buttonClicked()})("infoClicked",function(){return e.onDialogButtonClick()}),Dc(1,"async"),Dc(2,"async"),Dc(3,"async"),sa()),2&t&&na("sex",Rc(1,3,e.sex$))("organs",Rc(2,5,e.organs$))("selectedOrgan",Rc(3,7,e.selectedOrgan$))},directives:[F0],pipes:[$h],encapsulation:2,changeDetection:0}),vw([iU(u0.sex)],B0.prototype,"sex$",void 0),vw([iU(u0.organ)],B0.prototype,"selectedOrgan$",void 0),vw([iU(u0.organs)],B0.prototype,"organs$",void 0),vw([XY()],B0.prototype,"updateSex",void 0),vw([XY()],B0.prototype,"updateOrgan",void 0);let V0=(()=>{class t{constructor(t,e){this.store=t,this.dialog=e,this.className="ccf-run-spatial-search"}startSpatialSearchFlow(){this.store.dispatch(new IZ).pipe(rf(1),eg(()=>this.dialog.open(B0))).subscribe()}}return t.\u0275fac=function(e){return new(e||t)(ea(qz),ea(nG))},t.\u0275cmp=Jt({type:t,selectors:[["ccf-run-spatial-search"]],hostVars:2,hostBindings:function(t,e){2&t&&Va(e.className)},decls:4,vars:0,consts:[["mat-button","",1,"run-spatial-search-button",3,"click"]],template:function(t,e){1&t&&(ra(0,"button",0),fa("click",function(){return e.startSpatialSearchFlow()}),Ja(1," Run Spatial Search "),ra(2,"mat-icon"),Ja(3,"travel_explore"),sa(),sa())},directives:[R_,T_],styles:["[_nghost-%COMP%] .run-spatial-search-button[_ngcontent-%COMP%] .mat-button-wrapper{display:flex;align-items:center}[_nghost-%COMP%] .run-spatial-search-button[_ngcontent-%COMP%] .mat-button-wrapper .mat-icon{margin-left:9.75px}"],changeDetection:0}),t})();function z0(t,e){if(1&t){const t=ua();ra(0,"div",14),ra(1,"ccf-spatial-search-list",15),fa("selectionChanged",function(e){return $e(t),va().updateSearchSelection(e)})("itemRemoved",function(e){return $e(t),va().spatialSearchRemoved.emit(e.id)}),sa(),sa()}if(2&t){const t=va();ja("hidden",t.hidden),ws(1),na("items",t.spatialSearchFilters)}}const U0=function(){return["Both","Male","Female"]},H0=function(){return[1,110]},$0=function(){return[13,83]};let G0=(()=>{class t{constructor(t){this.ga=t,this.spatialSearchFilters=[],this.filtersChange=new Bc,this.spatialSearchSelected=new Bc,this.spatialSearchRemoved=new Bc,this.applyFilters=new Bc}ngOnChanges(t){"spatialSearchFilters"in t&&this.updateSexFromSelection(this.spatialSearchFilters.filter(t=>t.selected))}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.updateSearchSelection(this.spatialSearchFilters.filter(t=>t.selected)),this.ga.event("filters_applied","filter_content"),this.applyFilters.emit(this.filters)}refreshFilters(){this.filters=JSON.parse(JSON.stringify(UQ)),this.ga.event("filters_reset","filter_content"),this.spatialSearchSelected.emit([]),this.filtersChange.emit(this.filters)}updateSearchSelection(t){const e=t.map(t=>t.search);this.spatialSearchSelected.emit(t),this.updateFilter(e,"spatialSearches"),this.updateSexFromSelection(t)}updateSexFromSelection(t){var e;const n=null===(e=this.filters.sex)||void 0===e?void 0:e.toLowerCase(),i=new Set(t.map(t=>t.sex));t.length>0&&(i.size>1||!i.has(n))&&this.updateFilter("Both","sex")}}return t.\u0275fac=function(e){return new(e||t)(ea(jW))},t.\u0275cmp=Jt({type:t,selectors:[["ccf-filters-content"]],inputs:{hidden:"hidden",filters:"filters",technologyFilters:"technologyFilters",providerFilters:"providerFilters",spatialSearchFilters:"spatialSearchFilters"},outputs:{filtersChange:"filtersChange",spatialSearchSelected:"spatialSearchSelected",spatialSearchRemoved:"spatialSearchRemoved",applyFilters:"applyFilters"},features:[ye],decls:17,vars:24,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"],["class","filter spatial-locations",3,"hidden",4,"ngIf"],[1,"button-container"],[1,"right-group"],["mat-button","",1,"outline-button",3,"click"],[1,"refresh-icon"],[1,"icon","refresh",3,"click"],[1,"filter","spatial-locations"],["label","Spatial Locations",3,"items","selectionChanged","itemRemoved"]],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(),Jo(8,z0,2,3,"div",8),ra(9,"div",9),oa(10,"ccf-run-spatial-search"),ra(11,"div",10),ra(12,"button",11),fa("click",function(){return e.applyButtonClick()}),Ja(13,"APPLY FILTERS"),sa(),ra(14,"div",12),ra(15,"mat-icon",13),fa("click",function(){return e.refreshFilters()}),Ja(16,"refresh"),sa(),sa(),sa(),sa()),2&t&&(ja("hidden",e.hidden),ws(1),na("options",kc(21,U0))("selection",null==e.filters?null:e.filters.sex),ws(1),na("valueRange",kc(22,H0))("selection",null==e.filters?null:e.filters.ageRange),ws(1),na("valueRange",kc(23,$0))("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),na("ngIf",e.spatialSearchFilters.length>0),ws(1),ja("hidden",e.hidden))},directives:[uJ,r0,o0,Ah,V0,R_,T_,SQ],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%] button{border-width:1px;border-style:solid}.button-container[_ngcontent-%COMP%]{display:flex;justify-content:space-between;margin-top:2rem}.button-container[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{border-width:1px;border-style:solid}.button-container.hidden[_ngcontent-%COMP%]{opacity:0;transition-duration:.2s}.button-container[_ngcontent-%COMP%] .right-group[_ngcontent-%COMP%]{display:flex;flex-direction:row-reverse;align-items:center}.button-container[_ngcontent-%COMP%] .right-group[_ngcontent-%COMP%] .outline-button[_ngcontent-%COMP%]{box-shadow:.1rem .1rem .2rem #0000001d}.button-container[_ngcontent-%COMP%] .right-group[_ngcontent-%COMP%] .refresh-icon[_ngcontent-%COMP%]{padding:.25rem;border-radius:.25rem;margin-right:1rem;display:flex;justify-content:center;align-items:center;transition:.6s}.button-container[_ngcontent-%COMP%] .right-group[_ngcontent-%COMP%] .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 W0(t,e){1&t&&(ra(0,"div"),ra(1,"mat-icon",7),Ja(2,"close"),sa(),sa())}function q0(t,e){1&t&&oa(0,"mat-icon",8)}class X0{constructor(){this.spatialSearchFilters=[],this.filtersChange=new Bc,this.spatialSearchSelected=new Bc,this.spatialSearchRemoved=new Bc,this.filtersVisible=!1}toggleFilterVisible(){return this.filtersVisible=!this.filtersVisible,new UZ(!1)}removeBox(){return this.filtersVisible=!1,new UZ(!0)}applyFilters(t){this.filters=t,this.filtersChange.emit(t),this.removeBox()}}X0.\u0275fac=function(t){return new(t||X0)},X0.\u0275cmp=Jt({type:X0,selectors:[["ccf-filters-popover"]],inputs:{filters:"filters",drawerExpanded:"drawerExpanded",technologyFilters:"technologyFilters",providerFilters:"providerFilters",spatialSearchFilters:"spatialSearchFilters"},outputs:{filtersChange:"filtersChange",spatialSearchSelected:"spatialSearchSelected",spatialSearchRemoved:"spatialSearchRemoved"},decls:8,vars:15,consts:[[1,"filters-popover"],[1,"show-hide",3,"click"],[4,"ngIf","ngIfElse"],["notShow",""],[1,"popup-container"],[1,"popup-body"],[3,"technologyFilters","providerFilters","spatialSearchFilters","hidden","filters","applyFilters","spatialSearchSelected","spatialSearchRemoved"],[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,W0,3,0,"div",2),Jo(3,q0,1,0,"ng-template",null,3,ru),sa(),ra(5,"div",4),ra(6,"div",5),ra(7,"ccf-filters-content",6),fa("applyFilters",function(t){return e.applyFilters(t)})("spatialSearchSelected",function(t){return e.spatialSearchSelected.emit(t)})("spatialSearchRemoved",function(t){return e.spatialSearchRemoved.emit(t)}),sa(),sa(),sa(),sa()),2&t){const t=ta(4);ja("expanded",e.drawerExpanded),ws(1),ja("open",e.filtersVisible),ws(1),na("ngIf",e.filtersVisible)("ngIfElse",t),ws(3),ja("visible",e.filtersVisible)("hidden",!e.filtersVisible),ws(2),na("technologyFilters",e.technologyFilters)("providerFilters",e.providerFilters)("spatialSearchFilters",e.spatialSearchFilters)("hidden",!e.filtersVisible)("filters",e.filters)}},directives:[Ah,G0,T_],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}.popup-container.visible[_ngcontent-%COMP%]{width:35rem;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}),vw([XY()],X0.prototype,"toggleFilterVisible",null),vw([XY()],X0.prototype,"removeBox",null);class Y0{constructor(){this.treeModel$=new _p(1),this.nodes$=this.treeModel$.pipe(D(t=>Object.values(t.nodes))),this.rootNode$=this.treeModel$.pipe(D(t=>t.nodes[t.root]))}setTreeModel(t){this.treeModel$.next(t),this.treeModel=t}filter(t){return this.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.slice(0,n),t.slice(n,n+e.length),t.slice(n+e.length)]}getChildren(t){var e,n;const i=null!==(n=null===(e=this.treeModel)||void 0===e?void 0:e.nodes)&&void 0!==n?n:{};return(0,gq.at)(i,t.children)}}Y0.\u0275fac=function(t){return new(t||Y0)},Y0.\u0275prov=xt({token:Y0,factory:Y0.\u0275fac}),vw([PV.ak],Y0.prototype,"getChildren",null);class K0 extends class{constructor(){this.expansionModel=new Vp(!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 Q0=new oi("CDK_TREE_NODE_OUTLET_NODE");let Z0=(()=>{class t{constructor(t,e){this.viewContainer=t,this._node=e}}return t.\u0275fac=function(e){return new(e||t)(ea(pc),ea(Q0,8))},t.\u0275dir=se({type:t,selectors:[["","cdkTreeNodeOutlet",""]]}),t})();class J0{constructor(t){this.$implicit=t}}let t1=(()=>{class t{constructor(t){this.template=t}}return t.\u0275fac=function(e){return new(e||t)(ea(ac))},t.\u0275dir=se({type:t,selectors:[["","cdkTreeNodeDef",""]],inputs:{when:["cdkTreeNodeDefWhen","when"]}}),t})(),e1=(()=>{class t{constructor(t,e){this._differs=t,this._changeDetectorRef=e,this._onDestroy=new A,this._levels=new Map,this.viewChange=new Jf({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)?Gd(this._dataSource)?t=this._dataSource:Array.isArray(this._dataSource)&&(t=Dd(this._dataSource)):t=this._dataSource.connect(this),t&&(this._dataSubscription=t.pipe(rp(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 J0(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),n1.mostRecentTreeNode&&(n1.mostRecentTreeNode.data=t)}}return t.\u0275fac=function(e){return new(e||t)(ea(Yl),ea(nc))},t.\u0275cmp=Jt({type:t,selectors:[["cdk-tree"]],contentQueries:function(t,e,n){if(1&t&&Jc(n,t1,5),2&t){let t;Qc(t=tu())&&(e._nodeDefs=t)}},viewQuery:function(t,e){if(1&t&&Zc(Z0,7),2&t){let t;Qc(t=tu())&&(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:[Z0],encapsulation:2}),t})(),n1=(()=>{class t{constructor(e,n){this._elementRef=e,this._tree=n,this._destroyed=new A,this._dataChanges=new A,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&&!i1(e);)e=e.parentElement;return e?e.classList.contains("cdk-nested-tree-node")?Pd(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(Al),ea(e1))},t.\u0275dir=se({type:t,selectors:[["cdk-tree-node"]],inputs:{role:"role"},exportAs:["cdkTreeNode"]}),t.mostRecentTreeNode=null,t})();function i1(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 r1=/([A-Za-z%]+)$/;let s1=(()=>{class t{constructor(t,e,n,i){this._treeNode=t,this._tree=e,this._element=n,this._dir=i,this._destroyed=new A,this.indentUnits="px",this._indent=40,this._setPadding(),i&&i.change.pipe(rp(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=Pd(t,null),this._setPadding()}_setIndentInput(t){let e=t,n="px";if("string"==typeof t){const i=t.split(r1);e=i[0],n=i[1]||n}this.indentUnits=n,this._indent=Pd(e),this._setPadding()}}return t.\u0275fac=function(e){return new(e||t)(ea(n1),ea(e1),ea(Al),ea(Fp,8))},t.\u0275dir=se({type:t,selectors:[["","cdkTreeNodePadding",""]],inputs:{level:["cdkTreeNodePadding","level"],indent:["cdkTreeNodePaddingIndent","indent"]}}),t})(),o1=(()=>{class t{constructor(t,e){this._tree=t,this._treeNode=e,this._recursive=!1}get recursive(){return this._recursive}set recursive(t){this._recursive=kd(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(e1),ea(n1))},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})(),a1=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({}),t})();const l1=Ky(qy(n1));let c1=(()=>{class t extends l1{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(Al),ea(e1),ii("tabindex"))},t.\u0275dir=se({type:t,selectors:[["mat-tree-node"]],inputs:{role:"role",disabled:"disabled",tabIndex:"tabIndex"},exportAs:["matTreeNode"],features:[xl([{provide:n1,useExisting:t}]),jo]}),t})(),u1=(()=>{class t extends t1{}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:[xl([{provide:t1,useExisting:t}]),jo]}),t})(),h1=(()=>{class t extends s1{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:[xl([{provide:s1,useExisting:t}]),jo]}),t})(),d1=(()=>{class t{constructor(t,e){this.viewContainer=t,this._node=e}}return t.\u0275fac=function(e){return new(e||t)(ea(pc),ea(Q0,8))},t.\u0275dir=se({type:t,selectors:[["","matTreeNodeOutlet",""]],features:[xl([{provide:Z0,useExisting:t}])]}),t})(),p1=(()=>{class t extends e1{}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&&Zc(d1,7),2&t){let t;Qc(t=tu())&&(e._nodeOutlet=t.first)}},hostAttrs:["role","tree",1,"mat-tree","cdk-tree"],exportAs:["matTree"],features:[xl([{provide:e1,useExisting:t}]),jo],decls:1,vars:0,consts:[["matTreeNodeOutlet",""]],template:function(t,e){1&t&&ca(0,0)},directives:[d1],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})(),f1=(()=>{class t extends o1{get recursive(){return this._recursive}set recursive(t){this._recursive=kd(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:[xl([{provide:o1,useExisting:t}]),jo]}),t})(),g1=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[a1,Wy],Wy]}),t})();class m1{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(rf(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 b1 extends class{}{constructor(t,e,n){super(),this._treeControl=t,this._treeFlattener=e,this._flattenedData=new Jf([]),this._expandedData=new Jf([]),this._data=new Jf([]),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(){}}class y1{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 y1(t,e)}}function v1(t,e){if(1&t){const t=ua();ra(0,"div",4),fa("click",function(e){const n=$e(t).node,i=va();return i.select(e.ctrlKey,n,!0,!i.isSelected(n))}),Ja(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),tl("colon"===t.label?"large intestine":t.label)}}function _1(t,e){1&t&&ca(0)}const w1=function(t){return{node:t}};function x1(t,e){if(1&t){const t=ua();ra(0,"mat-tree-node",5),fa("mouseleave",function(){$e(t);const e=ta(5);return va().mouseOut(),e.reset()}),ra(1,"div"),ra(2,"mat-icon",6),fa("mouseenter",function(){const e=$e(t).$implicit;return va().mouseOver(e)}),sa(),ra(3,"div",7),ra(4,"ccf-opacity-slider",8,9),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",10),Jo(7,_1,1,0,"ng-container",11),ra(8,"div",12),Ja(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",Pc(18,w1,t)),ws(1),ja("suborgan",t.level>1),ws(1),tl(n.occurenceData[t.original.id]||0)}}function S1(t,e){1&t&&ca(0)}function C1(t,e){if(1&t){const t=ua();ra(0,"mat-tree-node",13),fa("mouseleave",function(){$e(t);const e=ta(5);return va().mouseOut(),e.reset()}),ra(1,"div"),ra(2,"mat-icon",6),fa("mouseenter",function(){const e=$e(t).$implicit;return va().mouseOver(e)}),sa(),ra(3,"div",7),ra(4,"ccf-opacity-slider",8,14),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",15),ra(7,"mat-icon",16),Ja(8),sa(),sa(),Jo(9,S1,1,0,"ng-container",11),ra(10,"div",12),Ja(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),el(" ",n.control.isExpanded(t)?"expand_less":"expand_more"," "),ws(1),na("ngTemplateOutlet",i)("ngTemplateOutletContext",Pc(22,w1,t)),ws(1),ja("suborgan",t.level>1),ws(1),tl(n.occurenceData[t.original.id]||0)}}const E1=(0,gq.property)("level"),O1=(0,gq.property)("expandable");let T1=(()=>{class t{constructor(t,e){this.cdr=t,this.ga=e,this.atScrollBottom=!1,this.nodeSelected=new Bc,this.nodeChanged=new Bc,this.indent="1.5rem",this.control=new K0(E1,O1),this.flattener=new m1(y1.create,E1,O1,gq.invoke.bind(void 0,this,"getChildren")),this.dataSource=new b1(this.control,this.flattener),this._nodes=void 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;(null==e?void 0:e.length)>=0&&this.selectByIDs(e)}t.rootNode&&this.selectByIDs([t.rootNode.currentValue])}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,gq.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(null==t?void 0:t.original.id)===this.rootNode||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(nc),ea(jW))},t.\u0275cmp=Jt({type:t,selectors:[["ccf-ontology-tree"]],inputs:{ontologyFilter:"ontologyFilter",rootNode:"rootNode",nodes:"nodes",getChildren:"getChildren",occurenceData:"occurenceData",termData:"termData",header:"header"},outputs:{nodeSelected:"nodeSelected",nodeChanged:"nodeChanged"},features:[ye],decls:5,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,"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,v1,2,9,"ng-template",null,1,ru),Jo(3,x1,10,20,"mat-tree-node",2),Jo(4,C1,12,24,"mat-tree-node",3),sa()),2&t&&(ja("header-hidden",!e.header),na("dataSource",e.dataSource)("treeControl",e.control),ws(4),na("matTreeNodeDefWhen",e.isInnerNode))},directives:[p1,u1,c1,h1,T_,jK,Fh,R_,f1],styles:[".ccf-ontology-tree[_ngcontent-%COMP%]{background:none;scrollbar-width:thin;max-height:calc(50vh - 10rem);overflow:auto;overflow-x:hidden}.ccf-ontology-tree.header-hidden[_ngcontent-%COMP%]{max-height:40vh}.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:3rem;width:90%;bottom:0;pointer-events:none}.scroll-gradient.hidden[_ngcontent-%COMP%]{display:none}"],changeDetection:0}),t})();function k1(t,e){if(1&t&&(ra(0,"mat-option",8),ra(1,"span",9),Ja(2),sa(),ra(3,"span",10),Ja(4),sa(),ra(5,"span",11),Ja(6),sa(),sa()),2&t){const t=e.$implicit;na("value",t),ws(2),tl(t.displayLabel[0]),ws(2),tl(t.displayLabel[1]),ws(2),tl(t.displayLabel[2])}}let P1=(()=>{class t{constructor(t,e){this.ontologyService=t,this.ga=e,this.selected=new Bc,this.formControl=new tH(""),this.autoCompleteOpen=!1}ngOnInit(){this.filteredResults$=this.formControl.valueChanges.pipe(ep(t=>"string"==typeof t),lp(""),cp(t=>this.ontologyService.filter(t)),D(t=>(0,gq.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,gq.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(Y0),ea(jW))},t.\u0275cmp=Jt({type:t,selectors:[["ccf-ontology-search"]],inputs:{placeholderText:"placeholderText"},outputs:{selected:"selected"},decls:10,vars:9,consts:[[1,"ccf-ontology-search"],["appearance","outline",1,"field"],["matPrefix","","color","primary",1,"search"],["type","text","matInput","",1,"input",3,"placeholder","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),Ja(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,k1,7,4,"mat-option",7),Dc(9,"async"),sa(),sa(),sa(),sa()),2&t){const t=ta(6);ja("autocomplete-open",e.autoCompleteOpen),ws(4),na("placeholder",e.placeholderText)("formControl",e.formControl)("matAutocomplete",t),ws(1),na("displayWith",e.displayFormatter),ws(3),na("ngForOf",Rc(9,7,e.filteredResults$))}},directives:[cH,IU,sH,QH,T_,$H,E$,uU,m$,MU,pH,h$,kh,wv],pipes:[$h],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 A1=function(t){return[t]};function M1(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",Pc(7,A1,t))("rootNode",t.id)("getChildren",n.ontologySearchService.getChildren)("occurenceData",n.occurenceData)("termData",n.termData)("ontologyFilter",n.ontologyFilter)("header",n.header)}}let I1=(()=>{class t{constructor(t){this.ontologySearchService=t,this.ontologySelection=new Bc}ngOnChanges(t){"treeModel"in t&&this.treeModel&&this.ontologySearchService.setTreeModel(this.treeModel)}selected(t){var e,n;const i=null!==(n=null===(e=this.treeModel)||void 0===e?void 0:e.nodes)&&void 0!==n?n:{};this.tree.expandAndSelect(t,t=>i[t.parent])}}return t.\u0275fac=function(e){return new(e||t)(ea(Y0))},t.\u0275cmp=Jt({type:t,selectors:[["ccf-ontology-selection"]],viewQuery:function(t,e){if(1&t&&Zc(T1,5),2&t){let t;Qc(t=tu())&&(e.tree=t.first)}},inputs:{occurenceData:"occurenceData",termData:"termData",treeModel:"treeModel",ontologyFilter:"ontologyFilter",header:"header",placeholderText:"placeholderText"},outputs:{ontologySelection:"ontologySelection"},features:[xl([Y0]),ye],decls:3,vars:4,consts:[[3,"placeholderText","selected"],["class","tree",3,"nodes","rootNode","getChildren","occurenceData","termData","ontologyFilter","header","nodeSelected",4,"ngIf"],[1,"tree",3,"nodes","rootNode","getChildren","occurenceData","termData","ontologyFilter","header","nodeSelected"]],template:function(t,e){1&t&&(ra(0,"ccf-ontology-search",0),fa("selected",function(t){return e.selected(t)}),sa(),Jo(1,M1,1,9,"ccf-ontology-tree",1),Dc(2,"async")),2&t&&(na("placeholderText",e.placeholderText),ws(1),na("ngIf",Rc(2,2,e.ontologySearchService.rootNode$)))},directives:[P1,Ah,T1],pipes:[$h],styles:[""],changeDetection:0}),t})(),D1=(()=>{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(OZ),ea(_Z),ea(nc))},t.\u0275cmp=Jt({type:t,selectors:[["ccf-drawer-toggle-button"]],hostVars:4,hostBindings:function(t,e){2&t&&(Va(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()}),Ja(1),sa()),2&t&&(ws(1),el(" ",e.icon,"\n"))},directives:[T_],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 R1(t,e){1&t&&(ra(0,"div",7),oa(1,"mat-spinner",8),ra(2,"span",3),Ja(3,"Loading External Site"),sa(),sa())}function N1(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 L1=(()=>{class t{constructor(t){this.sanitizer=t,this.className="ccf-viewer",this.url="",this.closed=new Bc,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(Sd))},t.\u0275cmp=Jt({type:t,selectors:[["ccf-viewer"]],hostVars:2,hostBindings:function(t,e){2&t&&Va(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),Ja(3,"launch"),sa(),ra(4,"span",3),Ja(5,"Open in Portal"),sa(),sa(),ra(6,"button",4),fa("click",function(){return e.closed.emit()}),ra(7,"mat-icon",2),Ja(8,"clear"),sa(),sa(),sa(),Jo(9,R1,4,0,"div",5),Jo(10,N1,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:[N_,T_,R_,Ah,fZ],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 j1(t,e){if(1&t&&oa(0,"div",3),2&t){const t=e.index;ja("line-tick-visible",va().tissueSectionExists(t+1))}}const F1=function(){return[]};let B1=(()=>{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&&Va(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"),Ja(1,"0"),sa(),ra(2,"div",0),Jo(3,j1,1,2,"div",1),oa(4,"div",2),sa(),ra(5,"div"),Ja(6),sa()),2&t&&(ws(3),na("ngForOf",kc(2,F1).constructor(e.totalTissueSections)),ws(3),tl(e.totalTissueSections))},directives:[kh],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 V1(t){return null!==t&&"object"==typeof t&&"constructor"in t&&t.constructor===Object}function z1(t,e){void 0===t&&(t={}),void 0===e&&(e={}),Object.keys(e).forEach(function(n){void 0===t[n]?t[n]=e[n]:V1(e[n])&&V1(t[n])&&Object.keys(e[n]).length>0&&z1(t[n],e[n])})}var U1={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 H1(){var t="undefined"!=typeof document?document:{};return z1(t,U1),t}var $1={document:U1,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 G1(){var t="undefined"!=typeof window?window:{};return z1(t,$1),t}function W1(t){return(W1=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function q1(t,e){return(q1=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function X1(){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 Y1(t,e,n){return(Y1=X1()?Reflect.construct:function(t,e,n){var i=[null];i.push.apply(i,e);var r=new(Function.bind.apply(t,i));return n&&q1(r,n.prototype),r}).apply(null,arguments)}function K1(t){var e="function"==typeof Map?new Map:void 0;return(K1=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 Y1(t,arguments,W1(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),q1(n,t)})(t)}var Q1=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}(K1(Array));function Z1(t){void 0===t&&(t=[]);var e=[];return t.forEach(function(t){Array.isArray(t)?e.push.apply(e,Z1(t)):e.push(t)}),e}function J1(t,e){return Array.prototype.filter.call(t,e)}function t2(t,e){var n=G1(),i=H1(),r=[];if(!e&&t instanceof Q1)return t;if(!t)return new Q1(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=G1(),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=G1();return this[0]?t.getComputedStyle(this[0],null):{}},offset:function(){if(this.length>0){var t=G1(),e=H1(),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=G1();if(1===arguments.length){if("string"!=typeof t){for(n=0;ne-1)return t2([]);if(t<0){var n=e+t;return t2(n<0?[]:[this[n]])}return t2([this[t]])},append:function(){for(var t,e=H1(),n=0;n=0;n-=1)this[e].insertBefore(r.childNodes[n],this[e].childNodes[0])}else if(t instanceof Q1)for(n=0;n0?t?this[0].nextElementSibling&&t2(this[0].nextElementSibling).is(t)?t2([this[0].nextElementSibling]):t2([]):t2(this[0].nextElementSibling?[this[0].nextElementSibling]:[]):t2([])},nextAll:function(t){var e=[],n=this[0];if(!n)return t2([]);for(;n.nextElementSibling;){var i=n.nextElementSibling;t?t2(i).is(t)&&e.push(i):e.push(i),n=i}return t2(e)},prev:function(t){if(this.length>0){var e=this[0];return t?e.previousElementSibling&&t2(e.previousElementSibling).is(t)?t2([e.previousElementSibling]):t2([]):t2(e.previousElementSibling?[e.previousElementSibling]:[])}return t2([])},prevAll:function(t){var e=[],n=this[0];if(!n)return t2([]);for(;n.previousElementSibling;){var i=n.previousElementSibling;t?t2(i).is(t)&&e.push(i):e.push(i),n=i}return t2(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}}()),r2}function g2(t){return void 0===t&&(t={}),s2||(s2=function(t){var e=(void 0===t?{}:t).userAgent,n=f2(),i=G1(),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)),s2}function m2(){return o2||(o2=function(){var t,e=G1();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)}}()),o2}var b2={name:"resize",create:function(){var t=this;d2(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=G1();t.params.resizeObserver&&void 0!==G1().ResizeObserver?t.resize.createObserver():(e.addEventListener("resize",t.resize.resizeHandler),e.addEventListener("orientationchange",t.resize.orientationChangeHandler))},destroy:function(t){var e=G1();t.resize.removeObserver(),e.removeEventListener("resize",t.resize.resizeHandler),e.removeEventListener("orientationchange",t.resize.orientationChangeHandler)}}};function y2(){return(y2=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=a2(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!==H1()&&n!==G1()?(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(d2(r,{isTouched:!0,isMoved:!1,allowTouchCallbacks:!0,isScrolling:void 0,startMoving:void 0}),o.startX=u,o.startY=h,r.touchStartTime=c2(),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&&a2(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 x2(t){var e=H1(),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&&(d2(s,{startX:c,startY:u,currentX:c,currentY:u}),i.touchStartTime=c2()));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&&a2(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:c2()})),n.updateProgress(i.currentTranslate),n.setTranslate(i.currentTranslate))}}}}}}function S2(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=c2(),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=c2(),l2(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||c2()-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 A=(u-a[O])/T,M=Oi.longSwipesMs){if(!i.longSwipes)return void e.slideTo(e.activeIndex);"next"===e.swipeDirection&&e.slideTo(A>=i.longSwipesRatio?O+M:O),"prev"===e.swipeDirection&&e.slideTo(A>1-i.longSwipesRatio?O+M: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+M),"prev"===e.swipeDirection&&e.slideTo(O)):e.slideTo(c.target===e.navigation.nextEl?O+M:O)}}}}function C2(){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 E2(t){var e=this;!e.enabled||e.allowClick||(e.params.preventClicks&&t.preventDefault(),e.params.preventClicksPropagation&&e.animating&&(t.stopPropagation(),t.stopImmediatePropagation()))}function O2(){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 T2=!1;function k2(){}var P2={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 A2(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,P=S/k,A=Math.floor(h/i.slidesPerColumn),M=0;M1){var D=void 0,R=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*k*i.slidesPerGroup)/k),i.slidesPerGroup);N=Math.floor(j/F),I.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=M-(R=Math.floor(M/k))*k,(R>A||R===A&&N===k-1)&&(N+=1)>=k&&(N=0,R+=1)):R=M-(N=Math.floor(M/P))*P;I.css(e("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)T=t.isHorizontal()?I.outerWidth(!0):I.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=I[0];T=U+H+$+G+W+(X.offsetWidth-X.clientWidth)}}V&&(I[0].style.transform=V),z&&(I[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[M]&&(u[M].style[e("width")]=T+"px");u[M]&&(u[M].swiperSlideSize=T),f.push(T),i.centeredSlides?(_=_+T/2+w/2+v,0===w&&0!==M&&(_=_-s/2-v),0===M&&(_=_-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(((E={})[e("width")]=t.virtualSize+i.spaceBetween+"px",E)),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)){C=[];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=a2(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),d2(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);d2(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=a2(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(a2(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(),l2(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(),l2(function(){e.slideTo(s)})):e.slideTo(s)}else e.slideTo(s)}},loop:{loopCreate:function(){var t=this,e=H1(),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=a2(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(a2(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(),d2(t.params,u);var m=t.params.enabled;d2(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=G1(),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=G1();function l(){s&&s()}a2(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 a2(n.el).each(function(e){var i=d2({},n,{el:e});o.push(new t(i))}),o}var a=this;a.__swiper__=!0,a.support=f2(),a.device=g2({userAgent:n.userAgent}),a.browser=m2(),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=d2({},P2);return a.useParams(u),a.params=d2({},u,I2,n),a.originalParams=d2({},a.params),a.passedParams=d2({},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.$=a2,d2(a,{enabled:a.params.enabled,el:e,classNames:[],slides:a2(),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:c2(),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=a2(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=a2(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=H1().createElement("div");r=a2(s),s.className=e.params.wrapperClass,n.append(s),n.children("."+e.params.slideClass).each(function(t){r.append(t)})}return d2(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){d2(I2,t)},t.installModule=function(e){t.prototype.modules||(t.prototype.modules={});var n=e.name||Object.keys(t.prototype.modules).length+"_"+c2();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&&A2(t,n)}(t,0,[{key:"extendedDefaults",get:function(){return I2}},{key:"defaults",get:function(){return P2}}]),t}();Object.keys(M2).forEach(function(t){Object.keys(M2[t]).forEach(function(e){D2.prototype[e]=M2[t][e]})}),D2.use([b2,_2]);var R2=D2;const N2=["prevElRef"],L2=["nextElRef"],j2=["scrollbarElRef"],F2=["paginationElRef"];function B2(t,e){1&t&&(aa(0),oa(1,"div",6,7),oa(3,"div",8,9),la())}function V2(t,e){1&t&&oa(0,"div",10,11)}function z2(t,e){1&t&&oa(0,"div",12,13)}function U2(t,e){}function H2(t,e){1&t&&Jo(0,U2,0,0,"ng-template")}function $2(t,e){}function G2(t,e){1&t&&Jo(0,$2,0,0,"ng-template")}function W2(t,e){}function q2(t,e){1&t&&Jo(0,W2,0,0,"ng-template")}function X2(t,e){}const Y2=function(t){return{$implicit:t}};function K2(t,e){if(1&t&&(ra(0,"div",3),Jo(1,X2,0,0,"ng-template",18),sa()),2&t){const t=va().$implicit;na("ngClass",va(2).zoomContainerClass),ws(1),na("ngTemplateOutlet",t.template)("ngTemplateOutletContext",Pc(3,Y2,t.slideData))}}function Q2(t,e){}function Z2(t,e){if(1&t&&(aa(0),Jo(1,Q2,0,0,"ng-template",18),la()),2&t){const t=va().$implicit;ws(1),na("ngTemplateOutlet",t.template)("ngTemplateOutletContext",Pc(2,Y2,t.slideData))}}function J2(t,e){if(1&t&&(ra(0,"div",15),Jo(1,K2,2,5,"div",16),Jo(2,Z2,2,4,"ng-container",17),sa()),2&t){const t=e.$implicit,n=va().key,i=va();Fa(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 t3(t,e){1&t&&(Jo(0,J2,3,6,"div",14),Dc(1,"async")),2&t&&na("ngForOf",Rc(1,1,e.loopSlides))}const e3=[[["","slot","container-start"]],[["","slot","wrapper-start"]],[["","slot","wrapper-end"]],[["","slot","container-end"]]],n3=function(t){return{loopSlides:t,key:"prepend"}},i3=function(t){return{loopSlides:t,key:""}},r3=function(t){return{loopSlides:t,key:"append"}},s3=["[slot=container-start]","[slot=wrapper-start]","[slot=wrapper-end]","[slot=container-end]"];function o3(t){return"object"==typeof t&&null!==t&&t.constructor&&"Object"===Object.prototype.toString.call(t).slice(8,-1)}function a3(t,e,n){return!0===c3(t)&&e&&!e.el||!("boolean"!=typeof e&&e.el!==(null==n?void 0:n.nativeElement)&&("string"==typeof e.el||"object"==typeof e.el))}function l3(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]||(o3(e[n])&&o3(t[n])&&Object.keys(e[n]).length>0?e[n].__swiper__?t[n]=e[n]:l3(t[n],e[n]):t[n]=e[n]):t[n]=e[n]})}function c3(t){return null!=t&&"false"!=`${t}`}const u3=["pagination","navigation","scrollbar","virtual"];function h3(t,e={}){return o3(t)?t:!0===c3(t)&&e}const d3=["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 p3(t={}){const e={on:{}},n={};l3(e,R2.defaults),l3(e,R2.extendedDefaults),e._emitClasses=!0;const i={};return Object.keys(t).forEach(r=>{const s=r.replace(/^_/,"");void 0!==t[s]&&(d3.indexOf(s)>=0?o3(t[s])?(e[s]={},n[s]={},l3(e[s],t[s]),l3(n[s],t[s])):(e[s]=t[s],n[s]=t[s]):i[s]=t[s])}),{params:e,passedParams:n,rest:i}}let f3=(()=>{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=c3(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(ac))},t.\u0275dir=se({type:t,selectors:[["ng-template","swiperSlide",""]],inputs:{class:"class",zoom:"zoom",virtualIndex:"virtualIndex"}}),t})(),g3=(()=>{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 Bc,this.s__containerClasses=new Bc,this.s__slideClass=new Bc,this.s__swiper=new Bc,this.s_activeIndexChange=new Bc,this.s_afterInit=new Bc,this.s_autoplay=new Bc,this.s_autoplayStart=new Bc,this.s_autoplayStop=new Bc,this.s_beforeDestroy=new Bc,this.s_beforeInit=new Bc,this.s_beforeLoopFix=new Bc,this.s_beforeResize=new Bc,this.s_beforeSlideChangeStart=new Bc,this.s_beforeTransitionStart=new Bc,this.s_breakpoint=new Bc,this.s_changeDirection=new Bc,this.s_click=new Bc,this.s_doubleTap=new Bc,this.s_doubleClick=new Bc,this.s_destroy=new Bc,this.s_fromEdge=new Bc,this.s_hashChange=new Bc,this.s_hashSet=new Bc,this.s_imagesReady=new Bc,this.s_init=new Bc,this.s_keyPress=new Bc,this.s_lazyImageLoad=new Bc,this.s_lazyImageReady=new Bc,this.s_loopFix=new Bc,this.s_momentumBounce=new Bc,this.s_navigationHide=new Bc,this.s_navigationShow=new Bc,this.s_observerUpdate=new Bc,this.s_orientationchange=new Bc,this.s_paginationHide=new Bc,this.s_paginationRender=new Bc,this.s_paginationShow=new Bc,this.s_paginationUpdate=new Bc,this.s_progress=new Bc,this.s_reachBeginning=new Bc,this.s_reachEnd=new Bc,this.s_realIndexChange=new Bc,this.s_resize=new Bc,this.s_scroll=new Bc,this.s_scrollbarDragEnd=new Bc,this.s_scrollbarDragMove=new Bc,this.s_scrollbarDragStart=new Bc,this.s_setTransition=new Bc,this.s_setTranslate=new Bc,this.s_slideChange=new Bc,this.s_slideChangeTransitionEnd=new Bc,this.s_slideChangeTransitionStart=new Bc,this.s_slideNextTransitionEnd=new Bc,this.s_slideNextTransitionStart=new Bc,this.s_slidePrevTransitionEnd=new Bc,this.s_slidePrevTransitionStart=new Bc,this.s_slideResetTransitionStart=new Bc,this.s_slideResetTransitionEnd=new Bc,this.s_sliderMove=new Bc,this.s_sliderFirstMove=new Bc,this.s_slidesLengthChange=new Bc,this.s_slidesGridLengthChange=new Bc,this.s_snapGridLengthChange=new Bc,this.s_snapIndexChange=new Bc,this.s_tap=new Bc,this.s_toEdge=new Bc,this.s_touchEnd=new Bc,this.s_touchMove=new Bc,this.s_touchMoveOpposite=new Bc,this.s_touchStart=new Bc,this.s_transitionEnd=new Bc,this.s_transitionStart=new Bc,this.s_update=new Bc,this.s_zoomChange=new Bc,this.s_swiper=new Bc,this.indexChange=new Bc,this._activeSlides=new A,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=Dd(this.slides.slice(this.slides.length-this.loopedSlides)),this.appendSlides=Dd(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=h3(t,{nextEl:r||null,prevEl:s||null}),this.showNavigation=!(!0!==c3(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=h3(t,{el:n||null}),this.showPagination=a3(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=h3(t,{el:n||null}),this.showScrollbar=a3(t,this._scrollbar,this._scrollbarElRef)}get scrollbar(){return this._scrollbar}set virtual(t){this._virtual=h3(t)}get virtual(){return this._virtual}set index(t){this.setIndex(t)}set config(t){this.updateSwiper(t);const{params:e}=p3(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:Dd(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}=p3(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}=p3(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 R2(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};l3(e.params.virtual,t),l3(e.originalParams.virtual,t)}Xh(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(u3.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=R2.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=o3(this.swiperRef.params[n]);if(Object.keys(this.swiperRef.modules).indexOf(n)>=0){const t=this.swiperRef.modules[n].params[n];i?l3(this.swiperRef.params[n],t):this.swiperRef.params[n]=t}i&&o3(e)?l3(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(Tu),ea(Al),ea(nc),ea(hu))},t.\u0275cmp=Jt({type:t,selectors:[["swiper"],["","swiper",""]],contentQueries:function(t,e,n){if(1&t&&Jc(n,f3,4),2&t){let t;Qc(t=tu())&&(e.slidesEl=t)}},viewQuery:function(t,e){if(1&t&&(Zc(N2,5),Zc(L2,5),Zc(j2,5),Zc(F2,5)),2&t){let t;Qc(t=tu())&&(e.prevElRef=t.first),Qc(t=tu())&&(e.nextElRef=t.first),Qc(t=tu())&&(e.scrollbarElRef=t.first),Qc(t=tu())&&(e.paginationElRef=t.first)}},hostVars:2,hostBindings:function(t,e){2&t&&Va(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:s3,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(e3),xa(0),Jo(1,B2,5,0,"ng-container",0),Jo(2,V2,2,0,"div",1),Jo(3,z2,2,0,"div",2),ra(4,"div",3),xa(5,1),Jo(6,H2,1,0,void 0,4),Jo(7,G2,1,0,void 0,4),Jo(8,q2,1,0,void 0,4),xa(9,2),sa(),xa(10,3),Jo(11,t3,2,3,"ng-template",null,5,ru)),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",Pc(11,n3,e.prependSlides)),ws(1),na("ngTemplateOutlet",t)("ngTemplateOutletContext",Pc(13,i3,e.activeSlides)),ws(1),na("ngTemplateOutlet",t)("ngTemplateOutletContext",Pc(15,r3,e.appendSlides))}},directives:[Ah,Oh,Fh,kh,Rh,Nh,Lh],pipes:[$h],styles:["\n swiper {\n display: block;\n }\n "],encapsulation:2,changeDetection:0}),t})(),m3=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Wh]]}),t})();function b3(t,e){if(1&t){const t=ua();ra(0,"div",7),ra(1,"div",8),Ja(2),sa(),ra(3,"a",9),fa("click",function(){$e(t);const e=va().$implicit;return va().linkClicked.emit(e)}),Ja(4," DATA "),ra(5,"mat-icon"),Ja(6,"open_in_new"),sa(),sa(),sa()}if(2&t){const t=va().$implicit;ws(1),La("background-image","url("+t.thumbnail+")"),ws(1),el(" ",t.technology," ")}}function y3(t,e){1&t&&(aa(0),Jo(1,b3,7,3,"ng-template",6),la())}const v3=(()=>{let t=-1;return()=>(t+=1,t)})();let _3=(()=>{class t{constructor(){this.className="ccf-thumbnail-carousel",this.linkClicked=new Bc,this.uid=v3(),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&&Va(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"),Ja(3,"navigate_before"),sa(),sa(),sa(),ra(4,"swiper",2),Jo(5,y3,2,0,"ng-container",3),sa(),ra(6,"div",4),ra(7,"button",1),oa(8,"div",5),ra(9,"mat-icon"),Ja(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:[R_,T_,g3,kh,f3],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 w3(t,e){if(1&t){const t=ua();ra(0,"mat-icon",14),fa("click",function(){return $e(t),va().toggleExpansion()}),Ja(1),sa()}if(2&t){const t=va();ws(1),tl(t.expanded?"expand_less":"expand_more")}}function x3(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 S3(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 C3(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 E3(t,e){if(1&t){const t=ua();ra(0,"div",22),ra(1,"div",23),ra(2,"mat-icon",24),Ja(3,"bubble_chart"),sa(),ra(4,"div",17),ra(5,"div",8),Ja(6),sa(),ra(7,"div",8),Ja(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),Ja(11,"TISSUE SECTION"),sa(),ra(12,"mat-icon",11),Ja(13,"open_in_new"),sa(),sa(),sa(),Jo(14,C3,2,1,"ng-container",13),sa()}if(2&t){const t=e.$implicit;ws(6),tl(t.label),ws(2),tl(t.description),ws(6),na("ngIf",t.datasets.length>0)}}function O3(t,e){if(1&t){const t=ua();aa(0),ra(1,"div",15),ra(2,"div",16),ra(3,"mat-icon",5),Ja(4,"bubble_chart"),sa(),ra(5,"div",17),ra(6,"div",8),Ja(7),sa(),ra(8,"div",8),Ja(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),Ja(12,"TISSUE BLOCK"),sa(),ra(13,"mat-icon",11),Ja(14,"open_in_new"),sa(),sa(),sa(),Jo(15,x3,1,2,"ccf-tissue-section-vis",18),Jo(16,S3,2,1,"ng-container",13),sa(),Jo(17,E3,15,3,"div",19),la()}if(2&t){const t=va();ws(7),tl(t.tissueBlock.label),ws(2),tl(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 T3=function(t){return{"background-color":t}};let k3=(()=>{class t{constructor(t){this.ga=t,this.clsName="ccf-donor-card",this.selected=!1,this.expanded=!1,this.highlighted=!1,this.checked=new Bc,this.linkClick=new Bc,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(jW))},t.\u0275cmp=Jt({type:t,selectors:[["ccf-donor-card"]],hostVars:2,hostBindings:function(t,e){2&t&&Va(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),Ja(6,"person"),sa(),ra(7,"div",6),ra(8,"div",7),Ja(9),sa(),ra(10,"div",8),Ja(11),sa(),sa(),sa(),ra(12,"div",9),fa("click",function(){return e.linkHandler(e.tissueBlock.donor.link)}),ra(13,"div",10),Ja(14,"DONOR"),sa(),ra(15,"mat-icon",11),Ja(16,"open_in_new"),sa(),sa(),Jo(17,w3,2,1,"mat-icon",12),sa(),sa(),Jo(18,O3,18,5,"ng-container",13)),2&t&&(ws(1),ja("selected",e.selected)("highlighted",e.highlighted),na("ngStyle",Pc(18,T3,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),tl(e.tissueBlock.donor.label),ws(2),tl(e.tissueBlock.donor.description),ws(6),na("ngIf",e.selected),ws(1),na("ngIf",e.expanded))},directives:[jh,_K,T_,Ah,kh,B1,_3],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 P3(t,e){if(1&t&&(ra(0,"div",7),ra(1,"div",8),Ja(2),sa(),ra(3,"div",9),Ja(4),sa(),sa()),2&t){const t=e.$implicit;ws(2),tl(t.count),ws(2),tl(t.label)}}function A3(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 M3=(()=>{class t{constructor(t){this.ga=t,this.linkClicked=new Bc,this.listResultSelected=new Bc,this.listResultDeselected=new Bc,this.itemHovered=new Bc,this.itemUnhovered=new Bc,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(jW))},t.\u0275cmp=Jt({type:t,selectors:[["ccf-results-browser"]],inputs:{listResults:"listResults",aggregateData:"aggregateData",resultLabel:"resultLabel",highlighted:"highlighted",header:"header"},outputs:{linkClicked:"linkClicked",listResultSelected:"listResultSelected",listResultDeselected:"listResultDeselected",itemHovered:"itemHovered",itemUnhovered:"itemUnhovered"},decls:8,vars:7,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),Ja(3),sa(),Jo(4,P3,5,2,"div",3),sa(),ra(5,"div",4),fa("scroll",function(t){return e.onScroll(t)}),Jo(6,A3,2,4,"div",5),sa(),oa(7,"div",6),sa()),2&t&&(ws(3),tl(e.resultLabel),ws(1),na("ngForOf",e.aggregateData),ws(1),ja("header-hidden",!e.header),ws(1),na("ngForOf",e.listResults),ws(1),ja("hidden",!!e.atScrollBottom))},directives:[kh,k3],styles:[".results-browser-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:calc(100% - 3rem);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:column;overflow-y:auto;scrollbar-width:thin;padding-right:.5rem;height:calc(100vh - 20rem)}.results-browser-container[_ngcontent-%COMP%] .results-browser-list.header-hidden[_ngcontent-%COMP%]{height:calc(100vh - 16rem)}.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:3rem;width:95%;bottom:0;pointer-events:none}.results-browser-container[_ngcontent-%COMP%] .scroll-gradient.hidden[_ngcontent-%COMP%]{display:none}"],changeDetection:0}),t})();const I3=["*",[["mat-toolbar-row"]]],D3=["*","mat-toolbar-row"],R3=Xy(class{constructor(t){this._elementRef=t}});let N3=(()=>{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})(),L3=(()=>{class t extends R3{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(Al),ea(Ep),ea(th))},t.\u0275cmp=Jt({type:t,selectors:[["mat-toolbar"]],contentQueries:function(t,e,n){if(1&t&&Jc(n,N3,5),2&t){let t;Qc(t=tu())&&(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:D3,decls:2,vars:0,template:function(t,e){1&t&&(wa(I3),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})(),j3=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Wy],Wy]}),t})();function F3(t,e){if(1&t&&(ra(0,"a",5),Ja(1,"LOGIN"),sa()),2&t){const t=va();ja("disabled",t.loginDisabled||!t.homeUrl),na("href",t.homeUrl+"login",_r)}}function B3(t,e){if(1&t&&(ra(0,"a",5),Ja(1,"LOGOUT"),sa()),2&t){const t=va();ja("disabled",t.loginDisabled||!t.homeUrl),na("href",t.homeUrl+"logout",_r)}}let V3=(()=>{class t{constructor(){this.refreshClicked=new Bc,this.downloadClicked=new Bc}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Jt({type:t,selectors:[["ccf-header"]],inputs:{homeUrl:"homeUrl",loginDisabled:"loginDisabled",logoTooltip:"logoTooltip",loggedIn:"loggedIn",filters:"filters"},outputs:{refreshClicked:"refreshClicked",downloadClicked:"downloadClicked"},decls:6,vars:4,consts:[[1,"ccf-header"],[1,"home",3,"href"],["aria-hidden","false","aria-label","Reset tool","matTooltipPosition","right",1,"logo",3,"matTooltip"],[1,"filler"],["mat-button","","class","authentication","rel","noreferrer noopener","target","_blank",3,"disabled","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,"div",2),sa(),oa(3,"div",3),Jo(4,F3,2,3,"a",4),Jo(5,B3,2,3,"a",4),sa()),2&t&&(ws(1),na("href",e.homeUrl,_r),ws(1),na("matTooltip",e.logoTooltip),ws(2),na("ngIf",!e.loggedIn),ws(1),na("ngIf",e.loggedIn))},directives:[L3,gw,Ah,N_],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%] .home[_ngcontent-%COMP%]{height:100%;width:25rem;align-items:center;display:flex;padding:.25rem 0}.ccf-header[_ngcontent-%COMP%] .logo[_ngcontent-%COMP%]{width:100%;height:50%;background-repeat:no-repeat;background-size:contain}.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}.ccf-header[_ngcontent-%COMP%] .disabled[_ngcontent-%COMP%]{display:none}"],changeDetection:0}),t})();const z3=["bodyUI"];function U3(t,e){if(1&t&&(oa(0,"ccf-header",34),Dc(1,"async"),Dc(2,"async"),Dc(3,"async"),Dc(4,"async")),2&t){const t=va();ja("hide",!1===Rc(1,6,t.header$)),na("logoTooltip",Rc(2,8,t.logoTooltip$))("homeUrl",Rc(3,10,t.homeUrl$))("loggedIn",t.loggedIn)("loginDisabled",Rc(4,12,t.loginDisabled$))}}function H3(t,e){if(1&t){const t=ua();ra(0,"div",35),fa("click",function(){$e(t),va();const e=ta(72);return e.expanded=!e.expanded}),ra(1,"mat-icon",36),Ja(2),sa(),sa()}if(2&t){va();const t=ta(72);ws(2),el(" ",t.expanded?"arrow_drop_up":"arrow_drop_down"," ")}}function $3(t,e){if(1&t){const t=ua();ra(0,"div",35),fa("click",function(){$e(t);const e=va();return e.organListVisible=!e.organListVisible}),ra(1,"mat-icon",37),Ja(2),sa(),sa()}if(2&t){const t=va();ws(2),el(" ",t.organListVisible?"arrow_drop_up":"arrow_drop_down"," ")}}const G3=function(){return{}},W3=function(){return{x:2.2,y:2,z:.4}};class q3{constructor(t,e,n,i,r,s,o,a,l,c,u,h){this.data=n,this.theming=i,this.scene=r,this.listResultsState=s,this.consentService=o,this.snackbar=a,this.dataSource=c,this.globalConfig=u,this.setSelectedSearches=NQ(KQ),this.removeSpatialSearch=NQ(YQ),this.ontologySelectionLabel="body",this.cellTypeSelectionLabel="cell",this.selectionLabel="body | cell",this.organListVisible=!0,this.url="",this.acceptableViewerDomains=RQ.acceptableViewerDomains||[],this.viewerOpen=!1,this.spinnerActive$=this.data.queryStatus$.pipe(D(t=>t===HQ.Running)),this.loadingMessage$=this.data.state$.pipe(T$("statusMessage")),this.theme$=this.globalConfig.getOption("theme"),this.themeMode$=new _p(1),this.header$=this.globalConfig.getOption("header"),this.homeUrl$=this.globalConfig.getOption("homeUrl"),this.logoTooltip$=this.globalConfig.getOption("logoTooltip"),this.loginDisabled$=this.globalConfig.getOption("loginDisabled"),i.initialize(t,e),l.setRootElement(t),n.tissueBlockData$.subscribe(),n.aggregateData$.subscribe(),n.ontologyTermOccurencesData$.subscribe(),n.cellTypeTermOccurencesData$.subscribe(),n.sceneData$.subscribe(),n.filter$.subscribe(),n.technologyFilterData$.subscribe(),n.providerFilterData$.subscribe(),this.ontologyTerms$=n.filter$.pipe(T$("ontologyTerms")),this.cellTypeTerms$=n.filter$.pipe(T$("cellTypeTerms")),z_([this.theme$,this.themeMode$]).subscribe(([t,e])=>{this.theming.setTheme(`${t}-theme-${e}`),h.markForCheck()})}get isLightTheme(){return this.theming.getTheme().endsWith("light")}ngOnInit(){const t=this.snackbar.openFromComponent(ZK,{data:{preClose:()=>{t.dismiss()}},duration:"not-set"===this.consentService.consent?1/0:3e3});window.matchMedia?(window.matchMedia("(prefers-color-scheme: dark)").matches?this.themeMode$.next("dark"):this.themeMode$.next("light"),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",t=>{this.themeMode$.next(t.matches?"dark":"light")})):this.themeMode$.next("light")}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.themeMode$.next(this.isLightTheme?"dark":"light")}ontologySelected(t,e){if(t)return"anatomical-structures"===e?(this.data.updateFilter({ontologyTerms:t.map(t=>t.id)}),this.ontologySelectionLabel=this.createSelectionLabel(t)):(this.data.updateFilter({cellTypeTerms:t.map(t=>t.id)}),this.cellTypeSelectionLabel=this.createSelectionLabel(t)),this.selectionLabel=this.ontologySelectionLabel&&this.cellTypeSelectionLabel?`${this.ontologySelectionLabel} | ${this.cellTypeSelectionLabel}`:this.ontologySelectionLabel?`${this.ontologySelectionLabel}`:this.cellTypeSelectionLabel?`${this.cellTypeSelectionLabel}`:"",void(t[0]&&"body"===t[0].label&&this.resetView());this.data.updateFilter({ontologyTerms:[],cellTypeTerms:[]}),this.ontologySelectionLabel="",this.cellTypeSelectionLabel=""}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}}function X3(t,e){1&t&&oa(0,"ccf-root")}function Y3(t){const e=t=>"string"==typeof t,n=t=>Array.isArray(t)&&t.every(e);if("string"==typeof t){const e=IQ.json(t);if(n(e))return e}else if(n(t))return t;throw new Error("Invalid data sources")}q3.\u0275fac=function(t){return new(t||q3)(ea(Al),ea(No),ea(WQ),ea(kQ),ea(sZ),ea(iZ),ea(VW),ea(aw),ea(OQ),ea(eQ),ea(XK),ea(nc))},q3.\u0275cmp=Jt({type:q3,selectors:[["ccf-root"]],viewQuery:function(t,e){if(1&t&&Zc(z3,5),2&t){let t;Qc(t=tu())&&(e.bodyUI=t.first)}},decls:83,vars:117,consts:[[1,"ccf-app","mat-app-background"],[3,"text","active"],[3,"hide","logoTooltip","homeUrl","loggedIn","loginDisabled",4,"ngIf"],[1,"main-drawers"],["opened","",1,"left-drawer",3,"stateChange"],["left",""],[1,"filter-data"],[3,"filters","drawerExpanded","technologyFilters","providerFilters","spatialSearchFilters","filtersChange","spatialSearchSelected","spatialSearchRemoved"],["filterbox",""],[1,"filter-text"],[1,"sex","filter-tag"],[1,"age","filter-tag"],[1,"bmi","filter-tag"],["placeholderText","Search anatomical structures...",1,"ontology-selection",3,"treeModel","termData","occurenceData","header","ontologySelection"],["placeholderText","Search cell types...",1,"cell-type-selection",3,"treeModel","termData","occurenceData","header","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","CCF Exploration User Interface","documentationUrl","assets/docs/README.md","matTooltip","Open Info"],[3,"listResults","aggregateData","resultLabel","highlighted","header","listResultSelected","listResultDeselected","linkClicked","itemHovered","itemUnhovered"],[1,"selector-drawer"],[1,"organ-selector",3,"multiselect","occurenceData","organList","selectedOrgans","organsChanged"],["selector",""],[1,"close-button-wrapper"],["class","close-button",3,"click",4,"ngIf"],[1,"stage-content",3,"scene","bounds","nodeClick","nodeHoverStart","nodeHoverStop"],["bodyUI",""],[3,"logoTooltip","homeUrl","loggedIn","loginDisabled"],[1,"close-button",3,"click"],["aria-hidden","false","aria-label","Expand carousel drawer",1,"expand-collapse-icon"],["aria-hidden","false","aria-label","Close carousel drawer",1,"expand-collapse-icon"]],template:function(t,e){if(1&t){const t=ua();ra(0,"div",0),oa(1,"ccf-spinner-overlay",1),Dc(2,"async"),Dc(3,"async"),Jo(4,U3,5,14,"ccf-header",2),Dc(5,"async"),ra(6,"ccf-drawer-container",3),Dc(7,"async"),ra(8,"ccf-drawer",4,5),fa("stateChange",function(){return $e(t),ta(13).removeBox()}),ra(10,"div"),ra(11,"div",6),ra(12,"ccf-filters-popover",7,8),fa("filtersChange",function(t){return e.data.updateFilter(t)})("spatialSearchSelected",function(t){return e.setSelectedSearches(t)})("spatialSearchRemoved",function(t){return e.removeSpatialSearch(t)}),Dc(14,"async"),Dc(15,"async"),Dc(16,"async"),Dc(17,"async"),sa(),ra(18,"div",9),ra(19,"div",10),Ja(20,"Sex: "),ra(21,"strong"),Ja(22),Dc(23,"async"),sa(),sa(),ra(24,"div",11),Ja(25,"Age: "),ra(26,"strong"),Ja(27),Dc(28,"async"),Dc(29,"async"),sa(),sa(),ra(30,"div",12),Ja(31,"BMI: "),ra(32,"strong"),Ja(33),Dc(34,"async"),Dc(35,"async"),sa(),sa(),sa(),sa(),ra(36,"ccf-ontology-selection",13),fa("ontologySelection",function(t){return e.ontologySelected(t,"anatomical-structures")}),Dc(37,"async"),Dc(38,"async"),Dc(39,"async"),Dc(40,"async"),sa(),ra(41,"ccf-ontology-selection",14),fa("ontologySelection",function(t){return e.ontologySelected(t,"cell-type")}),Dc(42,"async"),Dc(43,"async"),Dc(44,"async"),Dc(45,"async"),sa(),oa(46,"ccf-drawer-toggle-button"),sa(),sa(),ra(47,"ccf-drawer",15,16),fa("stateChange",function(){return $e(t),ta(13).removeBox()}),ra(49,"ccf-viewer",17),fa("closed",function(){return e.viewerOpen=!1}),sa(),ra(50,"div",18),ra(51,"div",19),ra(52,"button",20),fa("click",function(){$e(t);const e=ta(13),n=ta(48);return e.removeBox(),n.toggleExpanded()}),ra(53,"mat-icon",21),Ja(54),sa(),sa(),ra(55,"button",22),fa("click",function(){return e.toggleScheme()}),ra(56,"mat-icon",21),Ja(57),sa(),sa(),ra(58,"button",23),ra(59,"mat-icon",24),fa("click",function(){$e(t);const n=ta(9),i=ta(48),r=ta(13);return e.reset(n,i,r)}),Ja(60,"refresh "),sa(),sa(),sa(),oa(61,"ccf-info-button",25),sa(),ra(62,"ccf-results-browser",26),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()}),Dc(63,"async"),Dc(64,"async"),Dc(65,"async"),Dc(66,"async"),sa(),oa(67,"ccf-drawer-toggle-button"),sa(),ra(68,"ccf-drawer-content"),Dc(69,"async"),ra(70,"div",27),ra(71,"ccf-organ-selector",28,29),fa("organsChanged",function(t){return e.scene.setSelectedReferenceOrgans(t)}),Dc(73,"async"),Dc(74,"async"),Dc(75,"async"),sa(),sa(),ra(76,"div",30),Jo(77,H3,3,1,"div",31),Jo(78,$3,3,1,"div",31),sa(),oa(79,"ccf-run-spatial-search"),ra(80,"ccf-body-ui",32,33),fa("nodeClick",function(t){return e.scene.sceneNodeClicked(t)})("nodeHoverStart",function(t){return e.scene.sceneNodeHovered(t)})("nodeHoverStop",function(){return e.scene.sceneNodeUnhover()}),Dc(82,"async"),sa(),sa(),sa(),sa()}if(2&t){const t=ta(48),n=ta(72);let i,r,s,o;ws(1),na("text",Rc(2,55,e.loadingMessage$))("active",Rc(3,57,e.spinnerActive$)),ws(3),na("ngIf",!1===Rc(5,59,e.spinnerActive$)),ws(2),ja("header-hidden",!1===Rc(7,61,e.header$)),ws(6),na("filters",Rc(14,63,e.data.filter$))("drawerExpanded",t.expanded)("technologyFilters",Rc(15,65,e.data.technologyFilterData$))("providerFilters",Rc(16,67,e.data.providerFilterData$))("spatialSearchFilters",Rc(17,69,e.selectableSearches$)),ws(10),tl(null==(i=Rc(23,71,e.data.filter$))?null:i.sex),ws(5),nl("",null==(r=Rc(28,73,e.data.filter$))?null:r.ageRange[0],"-",null==(r=Rc(29,75,e.data.filter$))?null:r.ageRange[1],""),ws(6),nl("",null==(s=Rc(34,77,e.data.filter$))?null:s.bmiRange[0],"-",null==(s=Rc(35,79,e.data.filter$))?null:s.bmiRange[1],""),ws(3),na("treeModel",Rc(37,81,e.ontologyTreeModel$))("termData",Rc(38,83,e.data.ontologyTermsFullData$))("occurenceData",Rc(39,85,e.data.ontologyTermOccurencesData$))("header",Rc(40,87,e.header$)),ws(5),na("treeModel",Rc(42,89,e.cellTypeTreeModel$))("termData",Rc(43,91,e.data.cellTypeTermsFullData$))("occurenceData",Rc(44,93,e.data.cellTypeTermOccurencesData$))("header",Rc(45,95,e.header$)),ws(8),ja("opened",e.viewerOpen),na("url",e.url),ws(3),na("matTooltip",t.expanded?"Exit Fullscreen":"Enter Fullscreen"),ws(2),tl(t.expanded?"fullscreen_exit":"fullscreen"),ws(1),na("matTooltip",e.isLightTheme?"Enter Dark Mode":"Enter Light Mode"),ws(2),el("",e.isLightTheme?"brightness_2":"brightness_5"," "),ws(5),na("listResults",Rc(63,97,e.listResultsState.listResults$))("aggregateData",Rc(64,99,e.data.aggregateData$))("resultLabel",e.selectionLabel)("highlighted",Rc(65,101,e.listResultsState.highlightedNodeId$))("header",Rc(66,103,e.header$)),ws(6),ja("header-hidden",!1===Rc(69,105,e.header$)),ws(2),ja("closed",!e.organListVisible)("expanded",n.expanded),ws(1),na("multiselect",!0)("occurenceData",null!==(o=Rc(73,107,e.data.ontologyTermOccurencesData$))&&void 0!==o?o:kc(115,G3))("organList",Rc(74,109,e.scene.referenceOrgans$))("selectedOrgans",Rc(75,111,e.scene.selectedReferenceOrgans$)),ws(5),ja("closed",!e.organListVisible),ws(1),na("ngIf",e.organListVisible),ws(1),na("ngIf",!n.expanded),ws(2),ja("expanded-stage",!e.organListVisible)("selector-expanded",n.expanded),na("scene",Rc(82,113,e.scene.scene$))("bounds",kc(116,W3))}},directives:[mZ,Ah,MZ,OZ,X0,I1,D1,L1,gw,T_,GK,M3,xZ,NK,V0,CK,V3],pipes:[$h],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-header.hide[_ngcontent-%COMP%]{display:none}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%]{height:calc(100% - 5rem);width:100%;opacity:1;overflow:hidden;transform:scale(1)}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container.header-hidden[_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%]{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%]{overflow:hidden;border-radius:.5rem;height:calc(100vh - 4rem)}.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;transition:all .5s ease-in-out;height:5rem;justify-content:start}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .selector-drawer.expanded[_ngcontent-%COMP%]{height:15rem;overflow-y:auto}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .selector-drawer.closed[_ngcontent-%COMP%]{height:1.5rem;top:-5rem}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] ccf-run-spatial-search[_ngcontent-%COMP%]{position:relative;float:right;height:0px;z-index:1;top:.5rem;right:.5rem}.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}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .expanded-stage[_ngcontent-%COMP%]{height:calc(100% - 3rem)}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .selector-expanded[_ngcontent-%COMP%]{height:calc(100% - 16.5rem)}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content.header-hidden[_ngcontent-%COMP%]{height:calc(100vh - 1rem)}.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{overflow:hidden}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] .left-drawer[_ngcontent-%COMP%] .cell-type-selection[_ngcontent-%COMP%] .ccf-ontology-search{margin-top:2rem}.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}.ccf-app[_ngcontent-%COMP%] .right-drawer[_ngcontent-%COMP%] .cff-drawer-inner-container{overflow:hidden}[_ngcontent-%COMP%]::-webkit-scrollbar{width:.5rem}"],changeDetection:0}),vw([iU(qQ.cellTypesTreeModel)],q3.prototype,"cellTypeTreeModel$",void 0),vw([iU(qQ.anatomicalStructuresTreeModel)],q3.prototype,"ontologyTreeModel$",void 0),vw([iU(ZQ.items)],q3.prototype,"selectableSearches$",void 0),vw([XY()],q3.prototype,"setSelectedSearches",void 0),vw([XY()],q3.prototype,"removeSpatialSearch",void 0);let K3=(()=>{class t extends MQ{constructor(t,e){super(t,e,{initialDelay:10,initialConfig:Object.assign(Object.assign(Object.assign({},RQ.dbOptions),globalThis.dbOptions),RQ.customization),parse:{dataSources:Y3,useRemoteApi:IQ.boolean,header:IQ.boolean,loginDisabled:IQ.boolean}})}}return t.\u0275fac=function(e){return new(e||t)(ea(XK),ea(nc))},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",theme:"theme",header:"header",homeUrl:"homeUrl",logoTooltip:"logoTooltip",loginDisabled:"loginDisabled"},features:[jo],decls:1,vars:1,consts:[[4,"ngIf"]],template:function(t,e){1&t&&Jo(0,X3,1,0,"ccf-root",0),2&t&&na("ngIf",e.initialized)},directives:[Ah,q3],encapsulation:2,changeDetection:0}),t})(),Q3=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Wh,L_,k_,j3,yw]]}),t})(),Z3=(()=>{class t extends uQ{constructor(t,e){super(t),this.locator=e}createWorker(t){const e=this.getWorkerUrl(!0);return new Worker(e,{type:"module"})}getWorkerUrl(t){if(t)return new URL(n(88509),n.b);const e=this.locator.prepareExternalUrl("0-es2015.worker.js"),i=new Blob([`importScripts('${e}')`],{type:"application/javascript"});return URL.createObjectURL(i)}}return t.\u0275fac=function(e){return new(e||t)(Ei(XK),Ei(ch))},t.\u0275prov=xt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})(),J3=(()=>{class t extends hQ{selectToken(t){const{useRemoteApi:e,remoteApiEndpoint:n}=t;return e&&n?aQ:"undefined"==typeof Worker||RQ.disableDbWorker?cQ:Z3}}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})(),t5=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({providers:[{provide:du,useValue:kQ.initialize,multi:!0},kQ]}),t})(),e5=(()=>{class t{constructor(t,e){this.accessor=t,this.injector=e}static forRoot(e=[]){return{ngModule:t,providers:[hW,uW,lW,...e]}}}return t.\u0275fac=function(e){return new(e||t)(Ei(hW,2),Ei(uW,2))},t.\u0275mod=ie({type:t}),t.\u0275inj=St({}),t})();const n5=(t,e)=>((t,e)=>new Array(e+1).join("0"))(0,e-t.toString().length)+t;class i5{constructor(t,e,n){this.action=t,this.store=e,this.logWriter=n}dispatched(t){const e=fz(this.action),n=function(t){return n5(t.getHours(),2)+":"+n5(t.getMinutes(),2)+":"+n5(t.getSeconds(),2)+"."+n5(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 r5{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 s5=new oi("NGXS_LOGGER_PLUGIN_OPTIONS");let o5=(()=>{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 r5(this._options),this._store=this._store||this._injector.get(qz);const i=new i5(e,this._store,this._logWriter);return i.dispatched(t),n(t,e).pipe(eg(t=>{i.completed(t)}),Tv(t=>{throw i.errored(t),t}))}}return t.\u0275fac=function(e){return new(e||t)(Ei(s5),Ei(No))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();const a5=new oi("LOGGER_USER_OPTIONS");function l5(t){return Object.assign({},{logger:console,collapsed:!1,disabled:!1,filter:()=>!0},t)}let c5=(()=>{class t{static forRoot(e){return{ngModule:t,providers:[{provide:sz,useClass:o5,multi:!0},{provide:a5,useValue:e},{provide:s5,useFactory:l5,deps:[a5]}]}}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({}),t})();function u5(t,e){return t>=0&&t=e?e:t+e<0?0:t+e}function h5(t,e){if(1&t&&(ra(0,"span"),Ja(1),sa()),2&t){const t=e.$implicit;Fa(t.styles),Va(t.classes),ws(1),el(" ",t.text,"\n")}}let d5=(()=>{class t{constructor(){this.clsName="ccf-decorated-text",this.segments=[]}ngOnChanges(t){("text"in t||"decorations"in t)&&(this.segments=this.createSegments())}createSegments(){const{text:t}=this;if(!t)return[this.makeUndecoratedSegment(t)];const e=this.getNormalizedDecorations();if(0===e.length)return[this.makeUndecoratedSegment(t)];const n=this.createStackOps(e),i=[];let r=[],s=0;0===n[0].index&&(r=this.updateStack(r,n.shift()));for(const o of n)i.push(this.makeDecoratedSegment(t.slice(s,o.index),r)),s=o.index,r=this.updateStack(r,o);return s!==t.length&&i.push(this.makeDecoratedSegment(t.slice(s),r)),i}createStackOps(t){const e={},n=t=>{var n;return null!==(n=e[t])&&void 0!==n?n:e[t]={index:t,added:[],removed:[]}};for(const i of t)n(i.start).added.push(i),n(i.end).removed.push(i);return Object.entries(e).sort((t,e)=>+t[0]-+e[0]).map(t=>t[1])}updateStack(t,e){return t.filter(t=>!e.removed.includes(t)).concat(e.added)}getNormalizedDecorations(){const{decorations:t=[],text:{length:e}}=this;return t.map(t=>function(t,e){var n,i,r,s;return{start:u5(null!==(n=t.start)&&void 0!==n?n:0,e),end:u5(null!==(i=t.end)&&void 0!==i?i:e,e),classes:null!==(r=t.classes)&&void 0!==r?r:[],styles:null!==(s=t.styles)&&void 0!==s?s:{}}}(t,e)).filter(t=>t.startt.concat(e.classes),[]),styles:e.reduce((t,e)=>Object.assign(Object.assign({},t),e.styles),{})}}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Jt({type:t,selectors:[["ccf-decorated-text"]],hostVars:2,hostBindings:function(t,e){2&t&&Va(e.clsName)},inputs:{text:"text",decorations:"decorations"},features:[ye],decls:1,vars:1,consts:[[3,"class","style",4,"ngFor","ngForOf"]],template:function(t,e){1&t&&Jo(0,h5,2,5,"span",0),2&t&&na("ngForOf",e.segments)},directives:[kh],styles:["[_nghost-%COMP%]{display:flex}"],changeDetection:0}),t})();function p5(t,e){if(1&t&&(ra(0,"mat-option"),oa(1,"ccf-decorated-text",8),sa()),2&t){const t=e.$implicit;ws(1),na("text",t.label)("decorations",t.decorations)}}const f5=[[["","matPrefix",""]],[["","matSuffix",""]]],g5=new oi("Maximum number of autocomplete options displayed",{providedIn:"root",factory:()=>10});class m5{constructor(t){this.defaultMaxOptions=t,this.clsName="ccf-text-search",this.placeholder="Search...",this.optionSelected=new Bc,this.controller=new tH,this.options=this.controller.valueChanges.pipe(lp(""),Wd(),cp(this.getOptions)),this.valueChange=this.controller.valueChanges}get value(){return this.controller.value}set value(t){this.controller.setValue(t,{emitEvent:!1})}getOptions(t){return xw(this,void 0,void 0,function*(){const{autoCompleter:e,maxOptions:n=this.defaultMaxOptions}=this;return!e||n<1?[]:U(e(t,n)).pipe(rf(1),D(t=>t.length<=n?t:t.slice(0,n))).toPromise()})}optionDisplay(t){var e;return null!==(e=null==t?void 0:t.label)&&void 0!==e?e:""}optionId(t,e){return e.id}}m5.\u0275fac=function(t){return new(t||m5)(ea(g5))},m5.\u0275cmp=Jt({type:m5,selectors:[["ccf-text-search"]],hostVars:2,hostBindings:function(t,e){2&t&&Va(e.clsName)},inputs:{placeholder:"placeholder",value:"value",maxOptions:"maxOptions",autoCompleter:"autoCompleter"},outputs:{valueChange:"valueChange",optionSelected:"optionSelected"},ngContentSelectors:["[matPrefix]","[matSuffix]"],decls:11,vars:8,consts:[[1,"form"],["appearance","outline",1,"form-field"],["matPrefix",""],["matInput","","type","search",1,"input",3,"placeholder","formControl","matAutocomplete"],[1,"autocomplete",3,"displayWith","optionSelected"],["auto","matAutocomplete"],[4,"ngFor","ngForOf","ngForTrackBy"],["matSuffix",""],[3,"text","decorations"]],template:function(t,e){if(1&t&&(wa(f5),ra(0,"form",0),ra(1,"mat-form-field",1),aa(2,2),xa(3),la(),oa(4,"input",3),ra(5,"mat-autocomplete",4,5),fa("optionSelected",function(t){return e.optionSelected.emit(t)}),Jo(7,p5,2,2,"mat-option",6),Dc(8,"async"),sa(),aa(9,7),xa(10,1),la(),sa(),sa()),2&t){const t=ta(6);ws(4),na("placeholder",e.placeholder)("formControl",e.controller)("matAutocomplete",t),ws(1),na("displayWith",e.optionDisplay),ws(2),na("ngForOf",Rc(8,6,e.options))("ngForTrackBy",e.optionId)}},directives:[cH,IU,sH,QH,$H,E$,uU,m$,MU,pH,h$,kh,WH,wv,d5],pipes:[$h],styles:["[_nghost-%COMP%]{display:block}[_nghost-%COMP%] .form[_ngcontent-%COMP%] .form-field[_ngcontent-%COMP%]{width:100%}[_nghost-%COMP%] .form[_ngcontent-%COMP%] .form-field[_ngcontent-%COMP%] .input[_ngcontent-%COMP%]{margin-left:.5rem}[_nghost-%COMP%] .mat-form-field-appearance-outline .mat-form-field-wrapper{margin:0}[_nghost-%COMP%] .mat-form-field-appearance-outline .mat-form-field-wrapper .mat-form-field-flex{align-items:center}[_nghost-%COMP%] .mat-form-field-appearance-outline .mat-form-field-wrapper .mat-form-field-flex .mat-form-field-infix{height:3rem;border:none}[_nghost-%COMP%] .mat-form-field-appearance-outline .mat-form-field-wrapper .mat-form-field-flex .mat-form-field-suffix{top:0;border:none}"],changeDetection:0}),vw([PV.ak],m5.prototype,"getOptions",null),[{src:"app:skin",organ:"Skin",name:"Skin",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002097"},{src:"app:brain",organ:"Brain",name:"Brain",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000955"},{disabled:!0,src:"app:lymph-nodes",organ:"Lymph Node",name:"Lymph Node",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000029"},{src:"app:lymph-nodes",organ:"Lymph Node",name:"Lymph Node",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002509"},{disabled:!0,src:"app:eye",organ:"Eye",name:"Eye, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000970"},{src:"app:eye",organ:"Eye",name:"Eye, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0004548"},{src:"app:eye",organ:"Eye",name:"Eye, R",side:"right",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0004549"},{disabled:!0,src:"app:fallopian-tube-left",organ:"Fallopian Tube",name:"Fallopian Tube, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0003889"},{src:"app:fallopian-tube-left",organ:"Fallopian Tube",name:"Fallopian Tube, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0001303"},{src:"app:fallopian-tube-right",organ:"Fallopian Tube",name:"Fallopian Tube, R",side:"right",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0001302"},{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, L",side:"left",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"},{disabled:!0,src:"app:knee",organ:"Knee",name:"Knee, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001465"},{src:"app:knee",organ:"Knee",name:"Knee, L",side:"left",hasSex:!0,id:"http://purl.org/sig/ont/fma/fma24978"},{src:"app:knee",organ:"Knee",name:"Knee, R",side:"right",hasSex:!0,id:"http://purl.org/sig/ont/fma/fma24977"},{src:"app:liver",organ:"Liver",name:"Liver",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002107"},{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"},{disabled:!0,src:"app:mammary-gland",organ:"Mammary Gland",name:"Mammary Gland, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0001911"},{src:"app:mammary-gland",organ:"Mammary Gland",name:"Mammary Gland, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.org/sig/ont/fma/fma57991"},{src:"app:mammary-gland",organ:"Mammary Gland",name:"Mammary Gland, R",side:"right",hasSex:!1,sex:"female",id:"http://purl.org/sig/ont/fma/fma57987"},{disabled:!0,src:"app:ovary-left",organ:"Ovary",name:"Ovary, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0000992"},{src:"app:ovary-left",organ:"Ovary",name:"Ovary, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.org/sig/ont/fma/fma7214"},{src:"app:ovary-right",organ:"Ovary",name:"Ovary, R",side:"right",hasSex:!1,sex:"female",id:"http://purl.org/sig/ont/fma/fma7213"},{src:"app:pancreas",organ:"Pancreas",name:"Pancreas",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001264"},{src:"app:pelvis-f",organ:"Pelvis",name:"Pelvis",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001270"},{src:"app:placenta",organ:"Placenta",name:"Placenta",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0001987"},{src:"app:prostate",organ:"Prostate",name:"Prostate",hasSex:!1,sex:"male",id:"http://purl.obolibrary.org/obo/UBERON_0002367",disabled:!0},{src:"app:prostate",organ:"Prostate",name:"Prostate",hasSex:!1,sex:"male",id:"http://purl.obolibrary.org/obo/UBERON_0000079"},{src:"app:small-intestine",organ:"Small Intestine",name:"Small Intestine",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002108"},{src:"app:large-intestine",organ:"Large Intestine",name:"Large Intestine",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000059"},{src:"app:spinal-cord",organ:"Spinal Cord",name:"Spinal Cord",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002240"},{src:"app:spleen",organ:"Spleen",name:"Spleen",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002106"},{src:"app:thymus",organ:"Thymus",name:"Thymus",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002370"},{disabled:!0,src:"app:ureter-left",organ:"Ureter",name:"Ureter, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000056"},{src:"app:ureter-left",organ:"Ureter",name:"Ureter, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001223"},{src:"app:ureter-right",organ:"Ureter",name:"Ureter, R",side:"right",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001222"},{src:"app:bladder",organ:"Urinary Bladder",name:"Urinary Bladder",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001255"},{src:"app:uterus",organ:"Uterus",name:"Uterus",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0000995"},{src:"app:vasculature-thick",organ:"Blood Vasculature",name:"Blood Vasculature",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0004537"},{disabled:!0,src:"app:vasculature-thick",organ:"Blood Vasculature",name:"Blood Vasculature",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002049"}].sort((t,e)=>t.name.localeCompare(e.name)).filter(t=>!0!==t.disabled);let b5=class extends MW{constructor(){super(...arguments),this.optionCache=new Map}get config$(){return this.state$.pipe(IW(),xp(1))}setConfig(t){this.setState(t)}patchConfig(t){this.patchState(t)}getProperty(t){return this.config$.pipe(T$(...t),Wd(),xp(1))}getOption(...t){const e=this.getPathKey(t);if(this.optionCache.has(e))return this.optionCache.get(e);const n=this.config$.pipe(T$(...t),Wd(),xp(1));return this.optionCache.set(e,n),n}getPathKey(t){return`${t.length}:${t.join(".")}`}};b5.\u0275fac=function(){let t;return function(e){return(t||(t=ei(b5)))(e||b5)}}(),b5.\u0275prov=xt({token:b5,factory:b5.\u0275fac}),vw([CW()],b5.prototype,"config$",null),b5=vw([kW(),nU({name:"globalConfig",defaults:null})],b5);const y5="ALLOW_TELEMETRY",v5=_5();function _5(){const t=localStorage.getItem(y5);return null===t?void 0:"true"===t.toLowerCase()}let w5=class extends MW{setAllowTelemetry(t){const e=_5();localStorage.setItem(y5,t.toString()),this.ctx.patchState({allowTelemetry:t}),(void 0!==e||!1===t)&&location.reload()}};w5.\u0275fac=function(){let t;return function(e){return(t||(t=ei(w5)))(e||w5)}}(),w5.\u0275prov=xt({token:w5,factory:w5.\u0275fac}),vw([OW()],w5.prototype,"setAllowTelemetry",null),w5=vw([kW(),nU({name:"tracking",defaults:{allowTelemetry:v5}})],w5);const x5=new A,S5={cacheBusterObserver:x5},C5={cacheBusterObserver:x5,maxCacheCount:4};function E5(t,e,n){return t?{min:t[0]>e?t[0]:void 0,max:t[1]{var e;return Object.assign(Object.assign({},t),{transformMatrix:new VT(null!==(e=t.transformMatrix)&&void 0!==e?e:[])})})}class T5{constructor(t,e){this.api=t,this.globalConfig=e,e.getOption("hubmapToken").subscribe(x5)}getDatabaseStatus(){return this.doRequest(t=>this.api.dbStatus(t))}getProviderNames(){return this.doRequest(t=>this.api.providerNames(t))}getDatasetTechnologyNames(){return this.doRequest(t=>this.api.technologyNames(t))}getOntologyTreeModel(){return this.doRequest(t=>this.api.ontologyTreeModel(t),void 0,{},t=>t)}getCellTypeTreeModel(){return this.doRequest(t=>this.api.cellTypeTreeModel(t),void 0,{},t=>t)}getReferenceOrgans(){return this.doRequest(t=>this.api.referenceOrgans(t),void 0,{},t=>t)}getTissueBlockResults(t){return this.doRequest(t=>this.api.tissueBlocks(t),t,{},t=>t)}getAggregateResults(t){return this.doRequest(t=>this.api.aggregateResults(t),t)}getOntologyTermOccurences(t){return this.doRequest(t=>this.api.ontologyTermOccurences(t),t)}getCellTypeTermOccurences(t){return this.doRequest(t=>this.api.cellTypeTermOccurences(t),t)}getScene(t){return this.doRequest(t=>this.api.scene(t),t,{},O5)}getReferenceOrganScene(t,e){return this.doRequest(t=>this.api.referenceOrganScene(t),e,{organIri:t},O5)}doRequest(t,e,n,i){const{api:r,globalConfig:s}=this,o=Object.assign(Object.assign({},function(t){var e,n;return{age:E5(null==t?void 0:t.ageRange,1,110),bmi:E5(null==t?void 0:t.bmiRange,13,83),sex:null===(n=null===(e=null==t?void 0:t.sex)||void 0===e?void 0:e.toLowerCase)||void 0===n?void 0:n.call(e),ontologyTerms:null==t?void 0:t.ontologyTerms,cellTypeTerms:null==t?void 0:t.cellTypeTerms,providers:null==t?void 0:t.tmc,technologies:null==t?void 0:t.technologies,spatial:null==t?void 0:t.spatialSearches}}(e)),n);return z_([s.getOption("remoteApiEndpoint"),s.getOption("hubmapToken")]).pipe(rf(1),eg(([t,e])=>{r.configuration.basePath=t,e&&(o.token=e)}),cp(()=>t(o)),D(t=>i?i(t):t))}}T5.\u0275fac=function(t){return new(t||T5)(Ei(eq),Ei(b5))},T5.\u0275prov=xt({token:T5,factory:T5.\u0275fac,providedIn:"root"}),vw([QW(S5)],T5.prototype,"getProviderNames",null),vw([QW(S5)],T5.prototype,"getDatasetTechnologyNames",null),vw([QW(S5)],T5.prototype,"getOntologyTreeModel",null),vw([QW(S5)],T5.prototype,"getCellTypeTreeModel",null),vw([QW(S5)],T5.prototype,"getReferenceOrgans",null),vw([QW(C5)],T5.prototype,"getTissueBlockResults",null),vw([QW(C5)],T5.prototype,"getAggregateResults",null),vw([QW(C5)],T5.prototype,"getOntologyTermOccurences",null),vw([QW(C5)],T5.prototype,"getCellTypeTermOccurences",null),vw([QW(C5)],T5.prototype,"getScene",null),vw([QW(C5)],T5.prototype,"getReferenceOrganScene",null);let k5=(()=>{class t{}return t.type="[CallToAction] Learn More",t})(),P5=(()=>{class t{}return t.type="[CallToAction] Open Dialog",t})(),A5=(()=>{class t{}return t.type="[CallToAction] Close Dialog",t})();function M5(t,e){if(1&t&&(ra(0,"div",16),oa(1,"youtube-player",17),sa()),2&t){const t=va(3);ws(1),Sa("videoId",t.videoID)}}function I5(t,e){if(1&t&&(ra(0,"mat-expansion-panel",11),ra(1,"mat-expansion-panel-header"),ra(2,"h2",12),Ja(3),sa(),sa(),ra(4,"div",13),oa(5,"markdown",14),Jo(6,M5,2,1,"div",15),sa(),sa()),2&t){const t=va(),e=t.index,n=t.$implicit;na("expanded",0===e),ws(3),tl(n.title),ws(2),ja("first",0===e),na("data",n.content),ws(1),na("ngIf",0===e)}}function D5(t,e){if(1&t&&(ra(0,"div",9),Jo(1,I5,7,6,"mat-expansion-panel",10),sa()),2&t){const t=e.$implicit;ws(1),na("ngIf",t)}}let R5=(()=>{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(Y$),ea(Q$))},t.\u0275cmp=Jt({type:t,selectors:[["ccf-info-dialog"]],decls:11,vars:2,consts:[[1,"rui-about","wrapper"],[1,"container"],[1,"content"],[1,"header"],["mat-dialog-title","",1,"title"],[1,"close"],[1,"material-icons","close-icon",3,"click"],[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,"div",3),ra(4,"h2",4),Ja(5),sa(),ra(6,"div",5),ra(7,"mat-icon",6),fa("click",function(){return e.close()}),Ja(8,"clear"),sa(),sa(),sa(),ra(9,"mat-dialog-content",7),Jo(10,D5,2,1,"div",8),sa(),sa(),sa(),sa()),2&t&&(ws(5),tl(e.infoTitle),ws(5),na("ngForOf",e.documentationContents))},directives:[rG,T_,sG,kh,Ah,CG,TG,NG,WG],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%] .content[_ngcontent-%COMP%] .header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;height:3rem;margin-bottom:2.25rem;position:relative}.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%]{cursor:pointer;height:3rem;width:3rem;line-height:3rem;text-align:center;transition:.6s}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-size:1.5rem;margin:0 auto;line-height:3rem;height:3rem;justify-self:center;display:flex}.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;display:flex}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .dialog-content[_ngcontent-%COMP%] .variable-binding.first[_ngcontent-%COMP%]{padding-right:1rem;width:73%}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .dialog-content[_ngcontent-%COMP%] .variable-binding[_ngcontent-%COMP%] ul{margin:0}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .dialog-content[_ngcontent-%COMP%] .variable-binding[_ngcontent-%COMP%] img{margin-left:1rem;float:right}.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%}"]}),t})();class N5{get length(){var t,e;return null!==(e=null===(t=N5.storage)||void 0===t?void 0:t.length)&&void 0!==e?e:0}key(t){var e,n;return null!==(n=null===(e=N5.storage)||void 0===e?void 0:e.key(t))&&void 0!==n?n:null}getItem(t,e){var n,i,r;return null!==(r=null!==(i=null===(n=N5.storage)||void 0===n?void 0:n.getItem(t))&&void 0!==i?i:e)&&void 0!==r?r:null}setItem(t,e){var n;try{return null===(n=N5.storage)||void 0===n||n.setItem(t,e),!0}catch(i){return!1}}removeItem(t){var e;null===(e=N5.storage)||void 0===e||e.removeItem(t)}clear(){var t;null===(t=N5.storage)||void 0===t||t.clear()}}N5.storage=(()=>{let t;try{t=window.localStorage;const e="__storage_test__";return t.setItem(e,e),t.removeItem(e),t}catch(e){return e instanceof DOMException&&(22===e.code||1014===e.code||"QuotaExceededError"===e.name||"NS_ERROR_DOM_QUOTA_REACHED"===e.name)&&t&&0!==t.length?t:void 0}})(),N5.\u0275fac=function(t){return new(t||N5)},N5.\u0275prov=xt({token:N5,factory:N5.\u0275fac,providedIn:"root"});let L5=(()=>{class t{constructor(t){this.http=t,this.panelContent=new Jf({content:[],infoTitle:"",videoID:""})}updateData(t,e,n){this.http.get(t,{responseType:"text"}).subscribe(t=>{const i={content:this.parseMarkdown(t),infoTitle:n,videoID:e};this.panelContent.next(i)})}parseMarkdown(t){const e=[],n=t.split("# ");for(const i of n)if(i.length){const t=i.includes("\n\n")?"\n\n":"\r\n\r\n",n=i.split(t);e.push({title:n[0],content:n.splice(1).join(t)})}return e}}return t.\u0275fac=function(e){return new(e||t)(Ei(Jv))},t.\u0275prov=xt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();var j5;const F5="callToActionPopupShown";let B5=j5=class{constructor(t,e,n,i,r){this.dialog=t,this.ga=e,this.storage=n,this.infoService=i,this.http=r}static ctaDatePassed(t,e=Date.now){return+e()>+new Date(t)}ngxsOnInit(t){const{expirationDate:e,popupShown:n}=t.getState(),i=this.storage.getItem(F5,`${n}`),r=j5.ctaDatePassed(e);"true"!==i&&!r&&t.dispatch(new P5)}getDialogData(){return this.http.get("assets/docs/SPATIAL_SEARCH_README.md",{responseType:"text"}).pipe(D(t=>this.infoService.parseMarkdown(t)))}launchLearnMore(t){this.dialog.open(R5,{autoFocus:!1,panelClass:"modal-animated",width:"72rem",data:{title:"Spatial Search",content:t,videoID:"UfxMpzatowE"}})}learnMore(t){return this.dialog.closeAll(),this.ga.event("open_learn_more","call_to_action"),this.getDialogData().pipe(eg(t=>this.launchLearnMore(t)))}open(t){this.dialog.open(U5,{autoFocus:!1,panelClass:"modal-animated",width:"30.75rem",height:"36.688rem"}),this.ga.event("open","call_to_action"),this.storage.setItem(F5,"true"),t.patchState({popupShown:!0})}close(t){this.dialog.closeAll(),this.ga.event("close","call_to_action")}};B5.\u0275fac=function(t){return new(t||B5)(Ei(nG),Ei(jW),Ei(N5),Ei(L5),Ei(Jv))},B5.\u0275prov=xt({token:B5,factory:B5.\u0275fac}),vw([eU(k5)],B5.prototype,"learnMore",null),vw([eU(P5)],B5.prototype,"open",null),vw([eU(A5)],B5.prototype,"close",null),B5=j5=vw([nU({name:"callToAction",defaults:{title:"New to the Exploration User Interface",message:"Spatial Search has arrived!",callToAction:"Learn More",imageUrl:"assets/images/spatial_search.gif",expirationDate:"Dec 1, 2022",popupShown:!1}})],B5);class V5{static title(t){return t.title}static message(t){return t.message}static callToAction(t){return t.callToAction}static imageUrl(t){return t.imageUrl}static expirationDate(t){return t.expirationDate}static popupShown(t){return t.popupShown}}vw([rU([B5])],V5,"title",null),vw([rU([B5])],V5,"message",null),vw([rU([B5])],V5,"callToAction",null),vw([rU([B5])],V5,"imageUrl",null),vw([rU([B5])],V5,"expirationDate",null),vw([rU([B5])],V5,"popupShown",null);let z5=(()=>{class t{constructor(){this.clsName="ccf-call-to-action",this.callToActionClicked=new Bc,this.closeClicked=new Bc}close(){this.closeClicked.emit()}onDialogButtonClick(){this.callToActionClicked.emit()}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Jt({type:t,selectors:[["ccf-call-to-action"]],hostVars:2,hostBindings:function(t,e){2&t&&Va(e.clsName)},inputs:{infoTitle:"infoTitle",imageUrl:"imageUrl",message:"message",callToAction:"callToAction"},outputs:{callToActionClicked:"callToActionClicked",closeClicked:"closeClicked"},decls:13,vars:4,consts:[[1,"rui-about","wrapper"],[1,"container"],[1,"content"],[1,"first-row"],["mat-dialog-title","",1,"title"],[1,"cta-mat-icon","material-icons","close-icon",3,"click"],["mat-card-sm-image","","alt","preview","layout-fill","",1,"cta-image",3,"src"],[1,"mat-typography","dialog-content"],[1,"message"],["mat-button","",1,"mat-button",3,"text","click"]],template:function(t,e){1&t&&(ra(0,"div",0),ra(1,"div",1),ra(2,"div",2),ra(3,"div",3),ra(4,"p",4),Ja(5),sa(),ra(6,"mat-icon",5),fa("click",function(){return e.close()}),Ja(7,"clear"),sa(),sa(),oa(8,"img",6),ra(9,"mat-dialog-content",7),ra(10,"div",8),Ja(11),sa(),ra(12,"a",9),fa("click",function(){return e.onDialogButtonClick()}),sa(),sa(),sa(),sa(),sa()),2&t&&(ws(5),tl(e.infoTitle),ws(3),na("src",e.imageUrl,_r),ws(3),el(" ",e.message,""),ws(1),na("text",e.callToAction))},directives:[rG,T_,QG,sG],styles:["[_nghost-%COMP%] .content[_ngcontent-%COMP%]{display:block;align-content:center;padding-left:1.6rem;padding-right:1.6rem;border-radius:.25rem}[_nghost-%COMP%] .info-button-wrapper[_ngcontent-%COMP%]{border-radius:.25rem;padding:.6rem;transition:.6s}[_nghost-%COMP%] .info-button-wrapper[_ngcontent-%COMP%] .ccf-info-button[_ngcontent-%COMP%]{cursor:pointer;transition:color .6s;font-size:1.2rem;vertical-align:sub}[_nghost-%COMP%] .first-row[_ngcontent-%COMP%]{display:flex;width:100%;line-height:.9rem}[_nghost-%COMP%] .first-row[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{padding-right:7rem;padding-left:.2rem;font-size:.875rem;padding-top:.75rem}[_nghost-%COMP%] .first-row[_ngcontent-%COMP%] .cta-mat-icon[_ngcontent-%COMP%]{height:30%;line-height:3.4rem}[_nghost-%COMP%] .message[_ngcontent-%COMP%]{padding:.5rem}[_nghost-%COMP%] .cta-image[_ngcontent-%COMP%]{align-self:center;-o-object-fit:cover;object-fit:cover;width:100%;border-radius:.25rem}[_nghost-%COMP%] .mat-button[_ngcontent-%COMP%]{background-color:#444a65;font-size:.75rem;position:relative;margin-bottom:1rem;width:100%;height:2rem;color:#fff}"],changeDetection:0}),t})();class U5{constructor(){this.close=()=>new A5,this.learnMore=()=>new k5}}U5.\u0275fac=function(t){return new(t||U5)},U5.\u0275cmp=Jt({type:U5,selectors:[["ccf-call-to-action-behavior"]],decls:5,vars:12,consts:[[3,"infoTitle","message","callToAction","imageUrl","callToActionClicked","closeClicked"]],template:function(t,e){1&t&&(ra(0,"ccf-call-to-action",0),fa("callToActionClicked",function(){return e.learnMore()})("closeClicked",function(){return e.close()}),Dc(1,"async"),Dc(2,"async"),Dc(3,"async"),Dc(4,"async"),sa()),2&t&&na("infoTitle",Rc(1,4,e.title$))("message",Rc(2,6,e.message$))("callToAction",Rc(3,8,e.callToAction$))("imageUrl",Rc(4,10,e.imageUrl$))},directives:[z5],pipes:[$h],styles:[""],changeDetection:0}),vw([iU(V5.title)],U5.prototype,"title$",void 0),vw([iU(V5.message)],U5.prototype,"message$",void 0),vw([iU(V5.callToAction)],U5.prototype,"callToAction$",void 0),vw([iU(V5.imageUrl)],U5.prototype,"imageUrl$",void 0),vw([XY()],U5.prototype,"close",void 0),vw([XY()],U5.prototype,"learnMore",void 0);const H5=[{name:"bladder",namespace:"app",url:"assets/icons/organs/ico-organs-bladder.svg"},{name:"blood",namespace:"app",url:"assets/icons/organs/ico-organs-blood.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:"eye",namespace:"app",url:"assets/icons/organs/ico-organs-eye.svg"},{name:"fallopian-tube-left",namespace:"app",url:"assets/icons/organs/ico-organs-fallopian-tube-left.svg"},{name:"fallopian-tube-right",namespace:"app",url:"assets/icons/organs/ico-organs-fallopian-tube-right.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-right",namespace:"app",url:"assets/icons/organs/ico-organs-kidney-right.svg"},{name:"kidney",namespace:"app",url:"assets/icons/organs/ico-organs-kidney.svg"},{name:"knee",namespace:"app",url:"assets/icons/organs/ico-organs-knee.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-right",namespace:"app",url:"assets/icons/organs/ico-organs-lung-right.svg"},{name:"lung",namespace:"app",url:"assets/icons/organs/ico-organs-lung.svg"},{name:"lymph-nodes",namespace:"app",url:"assets/icons/organs/ico-organs-lymph-nodes.svg"},{name:"mammary-gland",namespace:"app",url:"assets/icons/organs/ico-organs-breast.svg"},{name:"neuron",namespace:"app",url:"assets/icons/organs/ico-organs-neuron.svg"},{name:"ovaries",namespace:"app",url:"assets/icons/organs/ico-organs-ovaries.svg"},{name:"ovary-left",namespace:"app",url:"assets/icons/organs/ico-organs-ovary-left.svg"},{name:"ovary-right",namespace:"app",url:"assets/icons/organs/ico-organs-ovary-right.svg"},{name:"pancreas",namespace:"app",url:"assets/icons/organs/ico-organs-pancreas.svg"},{name:"pelvis-f",namespace:"app",url:"assets/icons/organs/ico-organs-pelvis-f.svg"},{name:"placenta",namespace:"app",url:"assets/icons/organs/ico-organs-placenta.svg"},{name:"prostate",namespace:"app",url:"assets/icons/organs/ico-organs-prostate.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:"spinal-cord",namespace:"app",url:"assets/icons/organs/ico-organs-spinal-cord.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:"ureter-left",namespace:"app",url:"assets/icons/organs/ico-organs-ureter-left.svg"},{name:"ureter-right",namespace:"app",url:"assets/icons/organs/ico-organs-ureter-right.svg"},{name:"uterus",namespace:"app",url:"assets/icons/organs/ico-organs-uterus.svg"},{name:"vasculature-thick",namespace:"app",url:"assets/icons/organs/ico-organs-vasculature-thick.svg"},{name:"vasculature-thin",namespace:"app",url:"assets/icons/organs/ico-organs-vasculature-thin.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 $5=class extends AW{constructor(t,e){super(),this.registry=t;for(const{name:n,namespace:i,url:r,html:s}of H5){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)}};$5.\u0275fac=function(t){return new(t||$5)(Ei(y_,8),Ei(Sd))},$5.\u0275prov=xt({token:$5,factory:$5.\u0275fac}),vw([OW()],$5.prototype,"registerIcon",null),$5=vw([kW(),nU({name:"iconRegistry"})],$5);const G5=[XK,nZ,$5,iZ,WQ,sZ,B5,c0,QQ];let W5=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[e5.forRoot(),tU.forRoot(G5,{developmentMode:!RQ.production,selectorOptions:{injectContainerState:!1}}),YY.forRoot(),c5.forRoot({disabled:RQ.production})]]}),t})(),q5=(()=>{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)(Ei(t,12))},t.\u0275mod=ie({type:t}),t.\u0275inj=St({providers:[{provide:eQ,useExisting:J3}],imports:[[d_,GW.forRoot({gaToken:RQ.googleAnalyticsToken,appName:"eui"}),YK,nq.forRoot(()=>new tq({basePath:RQ.dbOptions.remoteApiEndpoint})),Q3,W5,t5],Q3]}),t})(),X5=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Wh,xK]]}),t})(),Y5=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Wh,ZH,lJ]]}),t})(),K5=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Wh,Wf,ef,ZH,lJ,e0]]}),t})(),Q5=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Wh,L_,k_]]}),t})(),Z5=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Wh,L_,k_,X5,Y5,K5,CQ,Q5]]}),t})(),J5=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Wh,k_,Z5]]}),t})(),t4=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Wh,bH,yH,b$,ZH,O$,k_]]}),t})(),e4=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Wh,L_,k_,yw,g1,FK]]}),t})(),n4=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Wh,t4,e4]]}),t})(),i4=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Wh,t4,e4,n4],t4,e4,n4]}),t})();function r4(){return(r4=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=H1();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=a2(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=a2(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),d2(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))}},o4={name:"navigation",params:{navigation:{nextEl:null,prevEl:null,hideOnClick:!1,disabledClass:"swiper-button-disabled",hiddenClass:"swiper-button-hidden",lockClass:"swiper-button-lock"}},create:function(){p2(this,{navigation:r4({},s4)})},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&&!a2(s).is(r)&&!a2(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 a4=(()=>{class t{constructor(){R2.use([o4])}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Wh,L_,k_,m3]]}),t})(),l4=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Wh]]}),t})(),c4=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Wh,xK,k_,a4,l4]]}),t})(),u4=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Wh,Gp,c4]]}),t})(),h4=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({providers:[{provide:yZ,useValue:bZ}],imports:[[Td,By,k_]]}),t})(),d4=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Wh,gZ]]}),t})(),p4=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Wh,L_,k_,gZ]]}),t})(),f4=(()=>{class t{constructor(t){this.injector=t}ngDoBootstrap(){const t=function(t,e){const n=function(t,e){return e.get(Ol).resolveComponentFactory(t).inputs}(t,e.injector),i=e.strategyFactory||new Kf(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}(K3,{injector:this.injector});customElements.define("ccf-eui",t)}}return t.\u0275fac=function(e){return new(e||t)(Ei(No))},t.\u0275mod=ie({type:t}),t.\u0275inj=St({providers:[{provide:TQ,useValue:"hubmap-theme-light"},{provide:Tf,useExisting:OQ}],imports:[[By,Td,q5,h4,J5,i4,k_,K5,u4,d4,EK,LK,WK,yw,p4,JK,sw,Q5]]}),t})();RQ.production&&function(){if(Bu)throw new Error("Cannot enable prod mode after platform setup.");Fu=!1}(),Ed().bootstrapModule(f4).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},88509:function(t,e,n){"use strict";t.exports=n.p+"7693192ac33f7744a3ca.ts"},9521:function(){},49125:function(){},75307:function(){}},function(t){t(t.s=51316)}]); \ No newline at end of file +var X6e=Object.defineProperty,K6e=Object.defineProperties,q6e=Object.getOwnPropertyDescriptors,YM=Object.getOwnPropertySymbols,bZ=Object.prototype.hasOwnProperty,wZ=Object.prototype.propertyIsEnumerable,Yr=Math.pow,SZ=(t,e,n)=>e in t?X6e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,vt=(t,e)=>{for(var n in e||(e={}))bZ.call(e,n)&&SZ(t,n,e[n]);if(YM)for(var n of YM(e))wZ.call(e,n)&&SZ(t,n,e[n]);return t},zn=(t,e)=>K6e(t,q6e(e)),CZ=(t,e)=>{var n={};for(var i in t)bZ.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&YM)for(var i of YM(t))e.indexOf(i)<0&&wZ.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 C(this,e,n);case"ascii":return E(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 C(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 E(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 A(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 M(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 I(t,e,n,r,s){return e=+e,n>>>=0,s||M(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||M(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||P(t,e,this.length);for(var i=this[t],r=1,s=0;++s>>=0,e>>>=0,n||P(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||P(t,1,this.length),this[t]},o.prototype.readUInt16LE=function(t,e){return t>>>=0,e||P(t,2,this.length),this[t]|this[t+1]<<8},o.prototype.readUInt16BE=function(t,e){return t>>>=0,e||P(t,2,this.length),this[t]<<8|this[t+1]},o.prototype.readUInt32LE=function(t,e){return t>>>=0,e||P(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||P(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||P(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||P(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||P(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},o.prototype.readInt16LE=function(t,e){t>>>=0,e||P(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||P(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||P(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||P(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||P(t,4,this.length),i.read(this,t,!0,23,4)},o.prototype.readFloatBE=function(t,e){return t>>>=0,e||P(t,4,this.length),i.read(this,t,!1,23,4)},o.prototype.readDoubleLE=function(t,e){return t>>>=0,e||P(t,8,this.length),i.read(this,t,!0,52,8)},o.prototype.readDoubleBE=function(t,e){return t>>>=0,e||P(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||A(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||A(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||A(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||A(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||A(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||A(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||A(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);A(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);A(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||A(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||A(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||A(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||A(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||A(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 I(this,t,e,!0,n)},o.prototype.writeFloatBE=function(t,e,n){return I(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"),C={};function E(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=C,C.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=C.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 P=Object.keys(n).sort();for(const l of P){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=C.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=C.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&&(E(t,n,i),o(_[n])||(_[n]={}),r=_[n]),w(r,e,p,{propertyIsArray:!0})}for(const e of p){const n=C.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&&(E(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 C.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={[C.compactIri({activeCtx:t,iri:"@list",relativeTo:{vocab:!0}})]:O},"@index"in e&&(O[C.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"])||C.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={[C.compactIri({activeCtx:t,iri:"@graph",relativeTo:{vocab:!0}})]:O},"@id"in e&&(O[C.compactIri({activeCtx:t,iri:"@id",relativeTo:{vocab:!0}})]=e["@id"]),"@index"in e&&(O[C.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=C.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=C.compactIri({activeCtx:t,iri:"@id",relativeTo:{vocab:!0}});s=O[e],delete O[e]}else if(m.includes("@type")){const r=C.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 C.compact({activeCtx:t,activeProperty:n,element:{"@id":e["@id"]},options:i,compactionMap:f}))}s||(s=C.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=C.compactIri({activeCtx:t,iri:l,relativeTo:{vocab:!0}});w(_,n,p)}else{const n=yield C.compact({activeCtx:t,activeProperty:e,element:p,options:i,compactionMap:f});s(n)&&0===n.length||w(_,l,n)}else{const e=yield C.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=C.compactIri({activeCtx:t,iri:l,relativeTo:{vocab:!0}});w(_,n,e)}}else{let e=x(p).map(t=>C.compactIri({activeCtx:S,iri:t,relativeTo:{vocab:!0}}));1===e.length&&(e=e[0]);const n=C.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=>C.compactIri({activeCtx:t,iri:e,relativeTo:{vocab:!1},base:i.base}));1===e.length&&(e=e[0]),_[C.compactIri({activeCtx:t,iri:"@id",relativeTo:{vocab:!0}})]=e}}return _}return n});return function(e){return t.apply(this,arguments)}}(),C.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)},C.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[C.compactIri({activeCtx:t,iri:"@index",relativeTo:{vocab:!0}})]=n["@index"]),"@type"in n?f[C.compactIri({activeCtx:t,iri:"@type",relativeTo:{vocab:!0}})]=C.compactIri({activeCtx:t,iri:n["@type"],relativeTo:{vocab:!0}}):"@language"in n&&(f[C.compactIri({activeCtx:t,iri:"@language",relativeTo:{vocab:!0}})]=n["@language"]),"@direction"in n&&(f[C.compactIri({activeCtx:t,iri:"@direction",relativeTo:{vocab:!0}})]=n["@direction"]),f[C.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=C.compactIri({activeCtx:t,iri:n["@id"],relativeTo:{vocab:"@vocab"===s},base:i.base});return"@id"===s||"@vocab"===s||"@graph"===r?o:{[C.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"),C={};e.exports=C;const E=/^[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:M,expansionMap:I}){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=I({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(M,t,{vocab:!0}),w(e).map(t=>f(M,t,{base:!0,vocab:!0}))]))),S(D,x.isFrame),_(d,"@type",w(D).map(t=>l(t)?f(M,t,{base:!0,vocab:!0},x):t),{propertyIsArray:x.isFrame});continue}if("@included"===j&&y(t,1.1)){const n=w(yield C.expand({activeCtx:t,activeProperty:e,element:D,options:x,expansionMap:I}));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(E)&&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 C.expand({activeCtx:t,activeProperty:"@reverse",element:D,options:x,expansionMap:I}),"@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:M,typeKey:k,expansionMap:I})}}})).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 P(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 A(t){return M.apply(this,arguments)}function M(){return(M=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 C.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)}C.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 P={};yield O({activeCtx:t,activeProperty:e,expandedActiveProperty:m,element:n,expandedParent:P,options:i,insideList:u,typeKey:T,typeScopedContext:d,expansionMap:p}),S=Object.keys(P);let A=S.length;if("@value"in P){if("@type"in P&&("@language"in P||"@direction"in P))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:P});let s=A-1;if("@type"in P&&(s-=1),"@index"in P&&(s-=1),"@language"in P&&(s-=1),"@direction"in P&&(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:P});const o=null===P["@value"]?[]:w(P["@value"]),c=x(P,"@type");if(!y(t,1.1)||!c.includes("@json")||1!==c.length)if(0===o.length){const r=yield p({unmappedValue:P,activeCtx:t,activeProperty:e,element:n,options:i,insideList:u});P=void 0!==r?r:null}else{if(!o.every(t=>l(t)||a(t))&&"@language"in P)throw new r("Invalid JSON-LD syntax; only strings may be language-tagged.","jsonld.SyntaxError",{code:"invalid language-tagged value",element:P});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:P})}}else if("@type"in P&&!s(P["@type"]))P["@type"]=[P["@type"]];else if("@set"in P||"@list"in P){if(A>1&&(2!==A||!("@index"in P)))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:P});"@set"in P&&(P=P["@set"],S=Object.keys(P),A=S.length)}else if(1===A&&"@language"in P){const r=yield p(P,{unmappedValue:P,activeCtx:t,activeProperty:e,element:n,options:i,insideList:u});P=void 0!==r?r:null}if(o(P)&&!i.keepFreeFloatingNodes&&!u&&(null===e||"@graph"===m)&&(0===A||"@value"in P||"@list"in P||1===A&&"@id"in P)){const r=yield p({unmappedValue:P,activeCtx:t,activeProperty:e,element:n,options:i,insideList:u});P=void 0!==r?r:null}return P});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(zn(vt({},t),{graph:g,embedded:!1}),Object.keys(t.graphMap[g]).sort(),[i],S,"@graph")}"@included"in n&&h.frame(zn(vt({},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(zn(vt({},t),{embedded:!0}),[e["@id"]],s,a,"@list"):v(a,"@list",o.clone(e))}else r.isSubjectReference(i)?h.frame(zn(vt({},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(zn(vt({},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:C,processingMode:E}=t("./context"),{compact:O,compactIri:T}=t("./compact"),{createNodeMap:k,createMergedNodeMap:P,mergeNodeMaps:A}=t("./nodeMap"),M=function(e){const n={},M=new u({max:100});function I(t,n){var i=n,{documentLoader:r=e.documentLoader}=i,s=CZ(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=I(i,{base:_(t)?t:"",compactArrays:!0,compactToRelative:!0,graph:!1,skipExpansion:!1,link:!1,issuer:new l("_:b"),contextResolver:new a({sharedCache:M})})).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=I(n,{keepFreeFloatingNodes:!1,contextResolver:new a({sharedCache:M})})).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 C({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=I(i,{base:_(t)?t:"",contextResolver:new a({sharedCache:M})});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=I(i,{base:_(t)?t:"",embed:"@once",explicit:!1,requireAll:!1,omitDefault:!1,bnodesToClear:[],contextResolver:new a({sharedCache:M})}),_(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=E(s,1.1)),i.hasOwnProperty("pruneBlankNodeIdentifiers")||(i.pruneBlankNodeIdentifiers=E(s,1.1));const o=yield e.expand(t,i),l=vt({},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=E(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=I(n,{base:_(t)?t:"",algorithm:"URDNA2015",skipExpansion:!1,contextResolver:new a({sharedCache:M})}))){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=vt({},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=I(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=I(n,{base:_(t)?t:"",skipExpansion:!1,contextResolver:new a({sharedCache:M})})).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=I(n,{base:_(t)?t:"",contextResolver:new a({sharedCache:M})});const i=yield e.expand(t,n);return P(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=I(i,{contextResolver:new a({sharedCache:M})});const r=yield Promise.all(t.map(t=>{const n=vt({},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=I(n,{base:"",contextResolver:new a({sharedCache:M})}),null===e?S(n):(e=o.clone(e),v(e)&&"@context"in e||(e={"@context":e}),C({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},I=function(){return M(function(){return I()})};M(I),e.exports=I},{"./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.default=n.Variable=n.Triple=n.Term=n.Quad=n.NamedNode=n.Literal=n.DefaultGraph=n.BlankNode=void 0,n.escapeQuotes=_,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.unescapeQuotes=w;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}hashCode(){return 0}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,i=n.length;for(;;){let t,a;for(;t=this._newline.exec(n);)this._comments&&(a=this._comment.exec(t[0]))&&r("comment",a[1],"",this._line,t[0].length),n=n.substr(t[0].length,n.length),i=n.length,this._line++;if(!t&&(t=this._whitespace.exec(n))&&(n=n.substr(t[0].length,n.length)),this._endOfFile.test(n))return e&&(this._comments&&(a=this._comment.exec(n))&&r("comment",a[1],"",this._line,n.length),n=null,r("eof","","",this._line,0)),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 s(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 s(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 s(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)?s(this):this._input=n;const b=g||f[0].length,y=r(h,d,p,l,b);this.previousToken=y,this._previousMarker=h,n=n.substr(b,n.length)}function r(e,r,s,o,a){const l=n?i-n.length:i,c={type:e,value:r,prefix:s,line:o,start:l,end:l+a};return t(null,c),c}function s(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"[":if(this._n3Mode)return this._saveContext("blank",this._graph,this._subject,this._subject=this._blankNode(),null),this._readBlankNodeHead;case"blank":if(!this._n3Mode)return this._error("Disallowed blank node as predicate",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?this._getContextEndReader():null!==this._predicate?this._readObject:e?this._readPredicateOrNamedGraph:this._readPredicateAfterBlank}_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){let c,u,h;const d=!e+!n+!i>1?Object.keys(this._ids):this._entities,p=(0,r.termFromId)(l,this._factory);e&&((c=t,t={})[e]=c[e]);for(const f in t){const e=d[f];if(u=t[f]){n&&((c=u,u={})[n]=c[n]);for(const t in u){const n=d[t];if(h=u[t]){const t=i?i in h?[i]:[]:Object.keys(h);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.readQuads(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){return[...this.readQuads(t,e,n,i)]}*readQuads(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;if(!(c(t)&&!(l=o[t])||c(e)&&!(u=o[e])||c(n)&&!(h=o[n])))for(const r in s)(a=s[r])&&(l?h?yield*this._findInIndex(a.objects,h,l,u,"object","subject","predicate",r,null,!0):yield*this._findInIndex(a.subjects,l,u,null,"subject","predicate","object",r,null,!0):u?yield*this._findInIndex(a.predicates,u,h,null,"predicate","object","subject",r,null,!0):h?yield*this._findInIndex(a.objects,h,null,null,"object","subject","predicate",r,null,!0):yield*this._findInIndex(a.subjects,null,null,null,"subject","predicate","object",r,null,!0))}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,r){for(const s of this.readQuads(e,n,i,r))if(t(s))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.inDefaultGraph=function(t){return s(t.graph)},n.isBlankNode=function(t){return!!t&&"BlankNode"===t.termType},n.isDefaultGraph=s,n.isLiteral=function(t){return!!t&&"Literal"===t.termType},n.isNamedNode=function(t){return!!t&&"NamedNode"===t.termType},n.isVariable=function(t){return!!t&&"Variable"===t.termType},n.prefix=function(t,e){return o({"":t.value||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}function m(t){return t.replace(/[\]\/\(\)\*\+\?\.\\\$]/g,"\\$&")}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._prefixIRIs=Object.create(null),e.prefixes&&this.addPrefixes(e.prefixes),e.baseIRI&&(this._baseMatcher=new RegExp(`^${m(e.baseIRI)}${e.baseIRI.endsWith("/")?"":"[#?]"}`),this._baseLength=e.baseIRI.length))}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._baseMatcher&&this._baseMatcher.test(e)&&(e=e.substr(this._baseLength)),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=m(t),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,"BlankNode",{enumerable:!0,get:function(){return u.BlankNode}}),Object.defineProperty(n,"DataFactory",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(n,"DefaultGraph",{enumerable:!0,get:function(){return u.DefaultGraph}}),Object.defineProperty(n,"Lexer",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(n,"Literal",{enumerable:!0,get:function(){return u.Literal}}),Object.defineProperty(n,"NamedNode",{enumerable:!0,get:function(){return u.NamedNode}}),Object.defineProperty(n,"Parser",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(n,"Quad",{enumerable:!0,get:function(){return u.Quad}}),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,"Term",{enumerable:!0,get:function(){return u.Term}}),Object.defineProperty(n,"Triple",{enumerable:!0,get:function(){return u.Triple}}),n.Util=void 0,Object.defineProperty(n,"Variable",{enumerable:!0,get:function(){return u.Variable}}),Object.defineProperty(n,"Writer",{enumerable:!0,get:function(){return s.default}}),n.default=void 0,Object.defineProperty(n,"termFromId",{enumerable:!0,get:function(){return u.termFromId}}),Object.defineProperty(n,"termToId",{enumerable:!0,get:function(){return u.termToId}});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}}n.default={Lexer:i.default,Parser:r.default,Writer:s.default,Store:o.default,StreamParser:a.default,StreamWriter:l.default,Util:c,DataFactory:u.default,Term:u.Term,NamedNode:u.NamedNode,Literal:u.Literal,BlankNode:u.BlankNode,Variable:u.Variable,DefaultGraph:u.DefaultGraph,Quad:u.Quad,Triple:u.Triple,termFromId:u.termFromId,termToId:u.termToId}},{"./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=vt({},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=vt({},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):I(t,o)):T(t,o,e,!1)}else i||(o.reading=!1,I(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 A(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(M,t))}function M(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 I(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):A(this),null;if(0===(t=P(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},E.prototype._read=function(t){x(this,new _("_read()"))},E.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},E.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?A(this):r.reading||n.nextTick(N,this)),i},E.prototype.removeListener=function(t,e){var i=o.prototype.removeListener.call(this,t,e);return"readable"===t&&n.nextTick(R,this),i},E.prototype.removeAllListeners=function(t){var e=o.prototype.removeAllListeners.apply(this,arguments);return("readable"===t||void 0===t)&&n.nextTick(R,this),e},E.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},E.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},E.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(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(t,e,n){n(new g("_write()"))},E.prototype._writev=null,E.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,I(t,e),i&&(e.finished?n.nextTick(i):t.once("finish",i)),e.ended=!0,t.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(t){!this._writableState||(this._writableState.destroyed=t)}}),E.prototype.destroy=h.destroy,E.prototype._undestroy=h.undestroy,E.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?(M(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:(I(e),">"===s?N(e):"/"===s?e.state=S.OPEN_TAG_SLASH:(g(s)||M(e,"Invalid character in tag name"),e.state=S.ATTRIB));continue;case S.OPEN_TAG_SLASH:">"===s?(N(e,!0),L(e)):(M(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):M(e,"Invalid attribute name");continue;case S.ATTRIB_NAME:"="===s?e.state=S.ATTRIB_VALUE:">"===s?(M(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:M(e,"Invalid attribute name");continue;case S.ATTRIB_NAME_SAW_WHITE:if("="===s)e.state=S.ATTRIB_VALUE;else{if(g(s))continue;M(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):(M(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):(M(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)?(M(e,"No whitespace between attributes"),e.attribName=s,e.attribValue="",e.state=S.ATTRIB_NAME):M(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):M(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:(M(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:P(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 C 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[C]]=C;function E(t,e,n){t[e]&&t[e](n)}function O(t,e,n){t.textNode&&T(t),E(t,e,n)}function T(t){t.textNode=k(t.opt,t.textNode),t.textNode&&E(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 P(t,e){return T(t),t.trackPosition&&(e+="\nLine: "+t.line+"\nColumn: "+t.column+"\nChar: "+t.c),e=new Error(e),t.error=e,E(t,"onerror",e),t}function A(t){return t.sawRoot&&!t.closedRoot&&M(t,"Unclosed root tag"),t.state!==S.BEGIN&&t.state!==S.BEGIN_WHITESPACE&&t.state!==S.TEXT&&P(t,"Unexpected end"),T(t),t.c="",t.closed=!0,E(t,"onend"),s.call(t,t.strict,t.opt),t}function M(t,e){if("object"!=typeof t||!(t instanceof s))throw new Error("bad call to strictFail");t.strict&&P(t,e)}function I(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)M(t,"xml: prefix must be bound to "+l+"\nActual: "+t.attribValue);else if("xmlns"===n&&t.attribValue!==c)M(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&&(M(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;)M(t,"Unexpected close tag");if(e<0)return M(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?(M(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)||(M(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=0?1.2:1))}function i(t,e,n,i,s,o){for(var a=0;a-1);o[++c]=l,a[c]=u,a[c+1]=e}for(l=0,c=0;l{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=A(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):P.call(t,e)},w.prototype.listenerCount=P,w.prototype.eventNames=function(){return this._eventsCount>0?m(this._events):[]},I.prototype.next=function(){if(this.done)return{done:!0};var t=this._next();return t.done&&(this.done=!0),t},"undefined"!=typeof Symbol&&(I.prototype[Symbol.iterator]=function(){return this}),I.of=function(){var t=arguments,e=t.length,n=0;return new I(function(){return n>=e?{done:!0}:{done:!1,value:t[n++]}})},I.empty=function(){var t=new I(null);return t.done=!0,t},I.is=function(t){return t instanceof I||"object"==typeof t&&null!==t&&"function"==typeof t.next};var D=I,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 Ct(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 Et(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 Pt(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 At(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 Mt(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 It(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?It(!1,this,t):Mt(!1,this,t)},i.forEachUntil=function(t){if("function"!=typeof t)throw new L("Graph.forEach: expecting a callback.");this.multi?It(!0,this,t):Mt(!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 At(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 Ct(n,n.undirected,i);if("string"==typeof e)return Ct(n,n[e],i)}var r=new Set;"undirected"!==t&&("out"!==e&&Et(r,n,n.in,i),"in"!==e&&Et(r,n,n.out,i)),"directed"!==t&&Et(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,Pt(r,n,n.in))),"in"!==e&&(i=q(i,Pt(r,n,n.out)))),"directed"!==t&&(i=q(i,Pt(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 P(t,e,n){if(t.indexOf&&!n)return t.indexOf(e);for(var i=0;in[e]}):i.sort()),i}function I(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&&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)},destroy: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)}};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=P(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=A(t.touches),i=A(t.changedTouches);return 12&e&&(n=M(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=A(t.touches),i=this.targetIds;if(3&e&&1===n.length)return i[n[0].identifier]=!0,[n,n];var r,s,o=A(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 Mt.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=Pt(t.direction);e&&(t.additionalEvent=this.options.event+e),this._super.emit.call(this,t)}}),_(Dt,Mt,{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,Mt,{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,Mt,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:30,pointers:1},getTouchAction:function(){return It.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=Pt(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",Ct="A-Z\\xc0-\\xd6\\xd8-\\xde",Et="\\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+"]",Pt="["+wt+"]",At="\\d+",Mt="["+xt+"]",It="["+St+"]",Dt="[^"+_t+Ot+At+xt+St+Ct+"]",Rt="\\ud83c[\\udffb-\\udfff]",Nt="[^"+_t+"]",Lt="(?:\\ud83c[\\udde6-\\uddff]){2}",jt="[\\ud800-\\udbff][\\udc00-\\udfff]",Ft="["+Ct+"]",Bt="(?:"+It+"|"+Dt+")",Vt="(?:"+Ft+"|"+Dt+")",zt="(?:['\u2019](?:d|ll|m|re|s|t|ve))?",Ut="(?:['\u2019](?:D|LL|M|RE|S|T|VE))?",Ht="(?:"+Pt+"|"+Rt+")?",$t="["+Et+"]?",Gt=$t+Ht+"(?:\\u200d(?:"+[Nt,Lt,jt].join("|")+")"+$t+Ht+")*",Wt="(?:"+[Mt,Lt,jt].join("|")+")"+Gt,qt="(?:"+[Nt+Pt+"?",Pt,Lt,jt,Tt].join("|")+")",Xt=RegExp("['\u2019]","g"),Yt=RegExp(Pt,"g"),Kt=RegExp(Rt+"(?="+Rt+")|"+qt+Gt,"g"),Qt=RegExp([Ft+"?"+It+"+"+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_])",At,Wt].join("|"),"g"),Zt=RegExp("[\\u200d"+_t+wt+Et+"]"),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[I]=ne[D]=ne[R]=ne[N]=ne[L]=ne[j]=ne[F]=ne[B]=ne[V]=!0,ne[f]=ne[g]=ne[A]=ne[m]=ne[M]=ne[b]=ne[y]=ne[v]=ne[w]=ne[x]=ne[S]=ne[E]=ne[O]=ne[T]=ne[P]=!1;var ie={};ie[f]=ie[g]=ie[A]=ie[M]=ie[m]=ie[b]=ie[I]=ie[D]=ie[R]=ie[N]=ie[L]=ie[w]=ie[x]=ie[S]=ie[E]=ie[O]=ie[T]=ie[k]=ie[j]=ie[F]=ie[B]=ie[V]=!0,ie[y]=ie[v]=ie[P]=!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,Ct=e.RegExp,Et=e.String,Ot=e.TypeError,Tt=i.prototype,kt=St.prototype,Pt=e["__core-js_shared__"],At=wt.prototype.toString,Mt=kt.hasOwnProperty,It=0,Dt=(n=/[^.]+$/.exec(Pt&&Pt.keys&&Pt.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",Rt=kt.toString,Nt=At.call(St),Lt=ce._,jt=Ct("^"+At.call(Mt).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(Ms){}}(),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"),Cn=os(e,"WeakMap"),En=os(St,"create"),On=Cn&&new Cn,Tn={},kn=Ns(_n),Pn=Ns(wn),An=Ns(xn),Mn=Ns(Sn),In=Ns(Cn),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(Mt.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]&&Mt.call(t,"index")&&(n.index=t.index,n.input=t.input),n}(t),!l)return Cr(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 Er(t,ls(t),e)}(t,function(t,e){return t&&Er(e,Aa(e),t)}(a,t)):function(t,e){return Er(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 A:return vr(t);case m:case b:return new i(+t);case M:return function(t,e){var n=e?vr(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}(t,n);case I: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 E: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?Aa:Pa)(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=Pe(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):Ae(r,a):i||(r[r.length]=a)}return r}var fi=Pr(),gi=Pr(!0);function mi(t,e){return t&&fi(t,e,Pa)}function bi(t,e){return t&&gi(t,e,Pa)}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&&Mt.call(t,e)}function Ci(t,e){return null!=t&&e in St(t)}function Ei(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=Pe(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:Pe(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 As(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 Ps(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 As(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){Mt.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)?Ce:ci)(t,is(e,3))}var yo=Or(function(t,e,n){Mt.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)?Pe: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),[])}),Co=ae||function(){return ce.Date.now()};function Eo(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 Po(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=Co();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=Co(),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(Co())},_}var Ao=Gi(function(t,e){return oi(t,1,e)}),Mo=Gi(function(t,e,n){return oi(t,fa(e)||0,n)});function Io(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(Io.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)}}Io.Cache=Hn;var Ro=gr(function(t,e){var n=(e=1==e.length&&Uo(e[0])?Pe(e[0],qe(is())):Pe(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)&&Mt.call(t,"callee")&&!$t.call(t,"callee")},Uo=i.isArray,Ho=ge?qe(ge):function(t){return Jo(t)&&wi(t)==A};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=Mt.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&At.call(n)==Nt}var ia=ye?qe(ye):function(t){return Jo(t)&&wi(t)==E},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):Cr(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 Er(t,Aa(t))}function ma(t){return null==t?"":rr(t)}var ba=Tr(function(t,e){if(ys(e)||$o(e))Er(e,Pa(e),t);else for(var n in e)Mt.call(e,n)&&Qn(t,n,e[n])}),ya=Tr(function(t,e){Er(e,Aa(e),t)}),va=Tr(function(t,e,n,i){Er(e,Aa(e),t,i)}),_a=Tr(function(t,e,n,i){Er(e,Pa(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}),Er(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 Ea(t,n)})}(t,e)});function Na(t,e){if(null==t)return{};var n=Pe(Jr(t),function(t){return[t]});return e=is(e),Vi(t,n,function(t,n){return e(t,n[0])})}var La=Gr(Pa),ja=Gr(Aa);function Fa(t){return null==t?[]:Xe(t,Pa(t))}var Ba=Mr(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=Mr(function(t,e,n){return t+(n?"-":"")+e.toLowerCase()}),Ha=Mr(function(t,e,n){return t+(n?" ":"")+e.toLowerCase()}),$a=Ar("toLowerCase"),Ga=Mr(function(t,e,n){return t+(n?"_":"")+e.toLowerCase()}),Wa=Mr(function(t,e,n){return t+(n?" ":"")+Xa(e)}),qa=Mr(function(t,e,n){return t+(n?" ":"")+e.toUpperCase()}),Xa=Ar("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(Is){return Xo(Is)?Is:new _t(Is)}}),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 Mi("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=Pa(e),r=yi(e,i);null==n&&(!Zo(e)||!r.length&&i.length)&&(n=e,e=t,t=this,r=yi(e,Pa(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__=Cr(this.__actions__);return r.push({func:i,args:arguments,thisArg:t}),n.__chain__=e,n}return i.apply(t,Ae([this.value()],arguments))})}),t}function ol(){}var al=Fr(Pe),ll=Fr(Ee),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=Eo,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&&Ae(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),Po(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)?Pe(t,Rs):oa(t)?[t]:Cr(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 Eo(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,Aa(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,Pa(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)?Ee: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),Aa)},Ln.forInRight=function(t,e){return null==t?t:gi(t,is(e,3),Aa)},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=Ca,Ln.gt=Bo,Ln.gte=Vo,Ln.has=function(t,e){return null!=t&&us(t,e,Si)},Ln.hasIn=Ea,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)==P},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=Co,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)?Me:He,r=arguments.length<3;return i(t,is(e,4),n,r,li)},Ln.reduceRight=function(t,e,n){var i=Uo(t)?Ie: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=Ct(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=++It;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){Mt.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,Ae([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+"";Mt.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__=Cr(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=Cr(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=Cr(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},A=i.exports.defaults,M=w,I=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:M(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=M(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:I(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=M(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=C,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=E,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,"qs",{enumerable:!0,get:function(){return o.default}});var s=n(41151),o=(l(n(61602)),l(n(97310)));i(n(22344));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)}function l(t,e){if(!e&&t&&t.__esModule)return t;if(null===t||"object"!==r(t)&&"function"!=typeof t)return{default:t};var n=a(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 l=s?Object.getOwnPropertyDescriptor(t,o):null;l&&(l.get||l.set)?Object.defineProperty(i,o,l):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)},51316:function(t,e,n){"use strict";var i={};n.r(i),n.d(i,{decode:function(){return xj},encode:function(){return Cj}});var r={};n.r(r),n.d(r,{decode:function(){return Aj},encode:function(){return Ij}});var s={};n.r(s),n.d(s,{decode:function(){return Dj},encode:function(){return Nj}});var o={};function a(t){return"function"==typeof t}n.r(o),n.d(o,{decode:function(){return jj},encode:function(){return Bj}});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 C(t)}function C(t){return 0===t.length?x:1===t.length?t[0]:function(e){return t.reduce((t,e)=>e(t),e)}}let E=(()=>{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:C(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 P extends v{constructor(t){super(t),this.destination=t}}let A=(()=>{class t extends E{constructor(){super(),this.observers=[],this.closed=!1,this.isStopped=!1,this.hasError=!1,this.thrownError=null}[y](){return new P(this)}lift(t){const e=new M(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 M(t,e),t})();class M extends A{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 I(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 E(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 E(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 E(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 E(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 E?t:new E(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 E)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 E(L(t))}function Q(...t){let e=Number.POSITIVE_INFINITY,n=null,i=t[t.length-1];return I(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 E?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 E{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 P{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 A}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 bt(t){return"string"==typeof t?t:null==t?"":String(t)}function yt(t){return"function"==typeof t?t.name||t.toString():"object"==typeof t&&null!=t&&"function"==typeof t.type?t.type.name||t.type.toString():bt(t)}function _t(t,e){const n=e?` in ${e}`:"";throw new mt("201",`No provider for ${yt(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 Ct(t){return Et(t,Tt)||Et(t,Pt)}function Et(t,e){return t.hasOwnProperty(e)?t[e]:null}function Ot(t){return t&&(t.hasOwnProperty(kt)||t.hasOwnProperty(At))?t[kt]:null}const Tt=lt({"\u0275prov":lt}),kt=lt({"\u0275inj":lt}),Pt=lt({ngInjectableDef:lt}),At=lt({ngInjectorDef:lt});var Mt=(()=>((Mt=Mt||{})[Mt.Default=0]="Default",Mt[Mt.Host=1]="Host",Mt[Mt.Self=2]="Self",Mt[Mt.SkipSelf=4]="SkipSelf",Mt[Mt.Optional=8]="Optional",Mt))();let It;function Dt(t){const e=It;return It=t,e}function Rt(t,e,n){const i=Ct(t);return i&&"root"==i.providedIn?void 0===i.value?i.value=i.factory():i.value:n&Mt.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 Ce="http://www.w3.org/2000/svg";let Ee;function Oe(){return void 0!==Ee?Ee:"undefined"!=typeof document?document:void 0}function Te(t){return!!t.listen}const ke={createRenderer:(t,e)=>Oe()};function Pe(t){for(;Array.isArray(t);)t=t[0];return t}function Ae(t,e){return Pe(e[t])}function Me(t,e){return Pe(e[t.index])}function Ie(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&Mt.SkipSelf){let i=e,r=t;for(;!(i=i.parent,null!==i||n&Mt.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 Ie(t.tView,t.selectedIndex)}function vn(){Ve.lFrame.currentNamespace=Ce}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=Un(t,e),s=t.injectorIndex;if(In(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 Un(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 Hn(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:Xn:e}(n);if("function"==typeof s){if(!cn(e,t,i))return i&Mt.Host?$n(r,n,i):Gn(e,n,i,r);try{const t=s(i);if(null!=t||i&Mt.Optional)return t;_t(n)}finally{fn()}}else if("number"==typeof s){let r=null,o=Vn(t,e),a=-1,l=i&Mt.Host?e[16][6]:null;for((-1===o||i&Mt.SkipSelf)&&(a=-1===o?Un(t,e):e[o+8],-1!==a&&Jn(i,!1)?(r=e[1],o=Dn(a),e=Rn(a,e)):o=-1);-1!==o;){const t=e[1];if(Zn(s,o,t.data)){const t=Yn(o,e,n,r,i,l);if(t!==qn)return t}a=e[o+8],-1!==a&&Jn(i,e[1].data[o+8]===l)&&Zn(s,o,e)?(r=t,o=Dn(a),e=Rn(a,e)):o=-1}}}return Gn(e,n,i,r)}const qn={};function Xn(){return new ti(Ge(),Ue())}function Yn(t,e,n,i,r,s){const o=e[1],a=o.data[t+8],l=Kn(a,o,n,null==i?de(a)&&Nn:i!=o&&0!=(3&a.type),r&Mt.Host&&s===a);return null!==l?Qn(e,o,l,a):qn}function Kn(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 Qn(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}`)}(yt(s[n]));const a=Ln(o.canSeeViewProviders);o.resolving=!0;const l=o.injectImpl?Dt(o.injectImpl):null;cn(t,i,Mt.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 Zn(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 Mi=ki(si("Inject",t=>({token:t})),-1),Ii=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(),bt(t))}function _r(t){const e=xr();return e?e.sanitize(yr.URL,t)||"":qi(t,"URL")?Wi(t):Ji(bt(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 Cr(t,e){t[Sr]=e}function Er(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 Pr=(()=>("undefined"!=typeof requestAnimationFrame&&requestAnimationFrame||setTimeout).bind(Ut))();function Ar(t){return t.ownerDocument.defaultView}function Mr(t){return t.ownerDocument}function Ir(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 Nr(t){const e=t[3];return ue(e)?e[3]:e}function Lr(t){return Fr(t[13])}function jr(t){return Fr(t[4])}function Fr(t){for(;null!==t&&!ue(t);)t=t[4];return t}function Br(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=Pe(i);0===t&&null!==n?null==r?qr(e,n,a):Wr(e,n,a,r||null,!0):1===t&&null!==n?Wr(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!==Pe(n)&&Br(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 Hr(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 $r(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)&&$r(e[1],e),e=e[3];null===e&&(e=t),ce(e)&&$r(e[1],e),n=e&&e[4]}e=n}}(e)}}function $r(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 Cs(t){return t>>17&32767}function Es(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 Ps(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=Lr(t);null!==n;n=jr(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,Mo(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=Mt.Default){this.assertNotDestroyed();const i=Si(this),r=Dt(void 0);try{if(!(n&Mt.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)&&Ct(t);e=n&&this.injectableDefInScope(n)?Mo(Po(t),So):null,this.records.set(t,e)}if(null!=e)return this.hydrate(t,e)}return(n&Mt.Self?Oo():this.parent).get(t,e=n&Mt.Optional&&e===mi?null:e)}catch(s){if("NullInjectorError"===s.name){if((s[yi]=s[yi]||[]).unshift(ut(t)),i)throw s;return Ai(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,Mo(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 Io(t)?Mo(void 0,t.useValue):Mo(Ao(t),So)}(t);if(Do(t)||!0!==t.multi)this.records.get(i);else{let e=this.records.get(i);e||(e=Mo(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=Co,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 Po(t){const e=Ct(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[Pt]);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 Ao(t,e,n){let i;if(Do(t)){const e=ft(t);return me(e)||Po(e)}if(Io(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=()=>Ei(ft(t.useExisting));else{const e=ft(t&&(t.useClass||t.provide));if(!function(t){return!!t.deps}(t))return me(e)||Po(e);i=()=>new e(...Ti(t.deps))}return i}function Mo(t,e,n=!1){return{factory:t,value:e,multi:n?[]:void 0}}function Io(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(Er(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=An(r.hostAttrs,n=An(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:()=>Ei(_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(Pe(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 Pa(t){return t.substring(Ta.value,Ta.valueEnd)}function Aa(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 Ma(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 Ia(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=Ma(e,n))Xa(t,ka(e),Pa(e))}function Va(t){Ha(pi,za,t,!0)}function za(t,e){for(let n=function(t){return Ia(t),Aa(t,Da(t,0,Ta.textEnd))}(e);n>=0;n=Aa(e,n))pi(t,ka(e),!0)}function Ua(t,e,n,i){const r=Ue(),s=He(),o=en(2);s.firstUpdatePass&&Ga(s,t,o,i),e!==_s&&Xo(r,o,e)&&Ya(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 Ha(t,e,n,i){const r=He(),s=en(2);r.firstUpdatePass&&Ga(r,null,s,i);const o=Ue();if(n!==_s&&Xo(o,s,n)){const a=r.data[mn()];if(Za(a,i)&&!$a(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 Ga(t,e,n,i){const r=t.data;if(null===r[n+1]){const s=r[mn()],o=$a(t,n);Za(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=qa(n=Wa(null,t,e,n,i),e.attrs,i),s=null);else{const o=e.directiveStylingLast;if(-1===o||t[o]!==r)if(n=Wa(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[Cs(i)]}(t,e,i);void 0!==n&&Array.isArray(n)&&(n=Wa(null,t,e,n[1],i),n=qa(n,e.attrs,i),function(t,e,n,i){t[Cs(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=Cs(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]=Es(t[i+1])),Ea(t,c,i,!0),Ea(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 Wa(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&&!Qa(h)&&(h=fi(e,i)),Qa(h)&&(a=h,o))return a;const d=t[r+1];r=o?Cs(d):Os(d)}if(null!==e){let t=s?e.residualClasses:e.residualStyles;null!=t&&(a=fi(t,i))}return a}function Qa(t){return void 0!==t}function Za(t,e){return 0!=(t.flags&(e?16:32))}function Ja(t,e=""){const n=Ue(),i=He(),r=t+20,s=i.firstCreatePass?Ms(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 tl(t){return el("",t,""),tl}function el(t,e,n){const i=Ue(),r=Qo(i,t,e,n);return r!==_s&&yo(i,mn(),r),el}function nl(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+bt(n)+i+bt(r)+s:_s}(s,t,e,n,i,r);return o!==_s&&yo(s,mn(),o),nl}function il(t,e,n){Ha(pi,za,Qo(Ue(),t,e,n),!0)}function rl(t,e,n){const i=Ue();return Xo(i,tn(),e)&&$s(He(),yn(),i,t,e,i[11],n,!0),rl}function sl(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 sl}const ol=void 0;var al=["en",[["a","p"],["AM","PM"],ol],[["AM","PM"],ol,ol],[["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"]],ol,[["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"]],ol,[["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}",ol,"{1} 'at' {0}",ol],[".",",",";","%","+","-","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 ll={};function cl(t){const e=function(t){return t.toLowerCase().replace(/_/g,"-")}(t);let n=ul(e);if(n)return n;const i=e.split("-")[0];if(n=ul(i),n)return n;if("en"===i)return al;throw new Error(`Missing locale data for the locale "${t}".`)}function ul(t){return t in ll||(ll[t]=Ut.ng&&Ut.ng.common&&Ut.ng.common.locales&&Ut.ng.common.locales[t]),ll[t]}var hl=(()=>((hl=hl||{})[hl.LocaleId=0]="LocaleId",hl[hl.DayPeriodsFormat=1]="DayPeriodsFormat",hl[hl.DayPeriodsStandalone=2]="DayPeriodsStandalone",hl[hl.DaysFormat=3]="DaysFormat",hl[hl.DaysStandalone=4]="DaysStandalone",hl[hl.MonthsFormat=5]="MonthsFormat",hl[hl.MonthsStandalone=6]="MonthsStandalone",hl[hl.Eras=7]="Eras",hl[hl.FirstDayOfWeek=8]="FirstDayOfWeek",hl[hl.WeekendRange=9]="WeekendRange",hl[hl.DateFormat=10]="DateFormat",hl[hl.TimeFormat=11]="TimeFormat",hl[hl.DateTimeFormat=12]="DateTimeFormat",hl[hl.NumberSymbols=13]="NumberSymbols",hl[hl.NumberFormats=14]="NumberFormats",hl[hl.CurrencyCode=15]="CurrencyCode",hl[hl.CurrencySymbol=16]="CurrencySymbol",hl[hl.CurrencyName=17]="CurrencyName",hl[hl.Currencies=18]="Currencies",hl[hl.Directionality=19]="Directionality",hl[hl.PluralCase=20]="PluralCase",hl[hl.ExtraData=21]="ExtraData",hl))();const dl="en-US";let pl=dl;function fl(t){wt(t,"Expected localeId to be defined"),"string"==typeof t&&(pl=t.toLowerCase().replace(/_/g,"-"))}function gl(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=yl(a,e,r?u:u+d,h);-1===p?(Hn(Fn(c,o),s,a),ml(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=yl(a,e,u+d,h),f=yl(a,e,u,u+d),g=p>=0&&n[p],m=f>=0&&n[f];if(r&&!m||!r&&!g){Hn(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,bl(s,r,i&&!n),s}(r?_l:vl,n.length,r,i,l);!r&&m&&(n[f].providerFactory=u),ml(s,t,e.length,0),e.push(a),c.directiveStart++,c.directiveEnd++,r&&(c.providerIndexes+=1048576),n.push(u),o.push(u)}else ml(s,t,p>-1?p:f,bl(n[r?f:p],l,!r&&i));!r&&i&&m&&n[f].componentProviders++}}}function ml(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 bl(t,e,n){return n&&t.componentProviders++,t.multi.push(e)-1}function yl(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);gl(n,i.data,i.blueprint,r,!0),gl(e,i.data,i.blueprint,r,!1)}}(n,i?i(t):t,e)}}class Sl{}const Cl="ngComponent";class El{resolveComponentFactory(t){throw function(t){const e=Error(`No component factory found for ${ut(t)}. Did you add it to @NgModule.entryComponents?`);return e[Cl]=t,e}(t)}}class Ol{}function Tl(...t){}function kl(t,e){return new Al(Me(t,e))}Ol.NULL=new El;const Pl=function(){return kl(Ge(),Ue())};let Al=(()=>{class t{constructor(t){this.nativeElement=t}}return t.__NG_ELEMENT_ID__=Pl,t})();function Ml(t){return t instanceof Al?t.nativeElement:t}class Il{}let Dl=(()=>{class t{}return t.__NG_ELEMENT_ID__=()=>Rl(),t})();const Rl=function(){const t=Ue(),e=Re(Ge().index,t);return function(t){return t[11]}(ce(e)?e:t)};let Nl=(()=>{class t{}return t.\u0275prov=xt({token:t,providedIn:"root",factory:()=>null}),t})();class Ll{constructor(t){this.full=t,this.major=t.split(".")[0],this.minor=t.split(".")[1],this.patch=t.split(".").slice(2).join(".")}}const jl=new Ll("12.2.5");class Fl{constructor(){}supports(t){return Go(t)}create(t){return new Vl(t)}}const Bl=(t,e)=>e;class Vl{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||Bl}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<$l(n,i,r)?e:n,o=$l(s,i,r),a=s.currentIndex;if(s===n)i--,n=n._nextRemoved;else if(e=e._next,null==s.previousIndex)i++;else{r||(r=[]);const t=o-i,e=a-i;if(t!=e){for(let n=0;n{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 zl(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 Hl),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 Hl),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 zl{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 Ul{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 Hl{constructor(){this.map=new Map}put(t){const e=t.trackById;let n=this.map.get(e);n||(n=new Ul,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 $l(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 ql(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 ql{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 Xl(){return new Yl([new Fl])}let Yl=(()=>{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||Xl()),deps:[[t,new Di,new Ii]]}}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:Xl}),t})();function Kl(){return new Ql([new Gl])}let Ql=(()=>{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||Kl()),deps:[[t,new Di,new Ii]]}}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:Kl}),t})();function Zl(t,e,n,i,r=!1){for(;null!==n;){const s=e[n.index];if(null!==s&&i.push(Pe(s)),ue(s))for(let t=10;t-1&&(Ur(t,n),hi(e,n))}this._attachedToViewContainer=!1}Hr(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 tc extends Jl{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 ec=function(t){return function(t,e,n){if(de(t)&&!n){const n=Re(t.index,e);return new Jl(n,n)}return 47&t.type?new Jl(e[16],e):null}(Ge(),Ue(),16==(16&t))};let nc=(()=>{class t{}return t.__NG_ELEMENT_ID__=ec,t})();const ic=[new Gl],rc=new Yl([new Fl]),sc=new Ql(ic),oc=function(){return uc(Ge(),Ue())};let ac=(()=>{class t{}return t.__NG_ELEMENT_ID__=oc,t})();const lc=ac,cc=class extends lc{constructor(t,e,n){super(),this._declarationLView=t,this._declarationTContainer=e,this.elementRef=n}createEmbeddedView(t){const e=this._declarationTContainer.tViews,n=As(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 Jl(n)}};function uc(t,e){return 4&t.type?new cc(e,t,kl(t,e)):null}class hc{}const dc=function(){return yc(Ge(),Ue())};let pc=(()=>{class t{}return t.__NG_ELEMENT_ID__=dc,t})();const fc=pc,gc=class extends fc{constructor(t,e,n){super(),this._lContainer=t,this._hostTNode=e,this._hostLView=n}get element(){return kl(this._hostTNode,this._hostLView)}get injector(){return new ti(this._hostTNode,this._hostLView)}get parentInjector(){const t=Un(this._hostTNode,this._hostLView);if(In(t)){const e=Rn(t,this._hostLView),n=Dn(t);return new ti(e[1].data[n+8],e)}return new ti(null,this._hostLView)}clear(){for(;this.length>0;)this.remove(this.length-1)}get(t){const e=mc(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(hc,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 gc(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),iPr});class Sc extends Sl{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 wc(this.componentDef.inputs)}get outputs(){return wc(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,vc,r);return s!==vc||i===vc?s:e.get(n,i,r)}}}(t,i.injector):t,s=r.get(Il,ke),o=r.get(Nl,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):Vr(s.createRenderer(null,this.componentDef),l,function(t){const e=t.toLowerCase();return"svg"===e?Ce:"math"===e?"http://www.w3.org/1998/MathML/":null}(l)),u=this.componentDef.onPush?576:528,h=function(t,e){return{components:[],scheduler:t||Pr,clean:ho,playerHandler:e||null,flags:0}}(),d=zs(0,null,null,1,0,null,null,null,null,null),p=As(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=Ms(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=As(n,Vs(e),null,e.onPush?64:16,n[20],a,i,c,s||null,null);return o.firstCreatePass&&(Hn(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",jl.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=Ie(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 Cc(this.componentType,f,kl(g,p),p,g)}}class Cc 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 tc(i),this.componentType=t}get injector(){return new ti(this._tNode,this._rootLView)}destroy(){this.hostView.destroy()}onDestroy(t){this.hostView.onDestroy(t)}}const Ec=new Map;class Oc extends hc{constructor(t,e){super(),this._parent=e,this._bootstrapComponents=[],this.injector=this,this.destroyCbs=[],this.componentFactoryResolver=new _c(this);const n=le(t),i=function(t){return t[Yt]||null}(t);i&&fl(i),this._bootstrapComponents=Ir(n.bootstrap),this._r3Injector=To(t,e,[{provide:hc,useValue:this},{provide:Ol,useValue:this.componentFactoryResolver}],ut(t)),this._r3Injector._resolveInjectorDefTypes(),this.instance=this.get(t)}get(t,e=No.THROW_IF_NOT_FOUND,n=Mt.Default){return t===No||t===hc||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 Tc 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,Ec.get(r),n),Ec.set(r,n));const s=Ir(i.imports);for(const o of s)e.has(o)||(e.add(o),t(o))}(t)}(t)}create(t){return new Oc(this.moduleType,t)}}function kc(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 Pc(t,e,n,i){return Ic(Ue(),Ze(),t,e,n,i)}function Ac(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)):Mc(t,l+3)}(Ue(),Ze(),t,e,n,i,r,s)}function Mc(t,e){const n=t[e];return n===_s?void 0:n}function Ic(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)):Mc(t,o+1)}function Dc(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 Rc(t,e,n){const i=t+20,r=Ue(),s=De(r,i);return jc(r,Lc(r,i)?Ic(r,Ze(),e,s.transform,n,s):s.transform(n))}function Nc(t,e,n,i){const r=t+20,s=Ue(),o=De(s,r);return jc(s,Lc(s,r)?function(t,e,n,i,r,s,o){const a=e+n;return Yo(t,a,r,s)?qo(t,a+2,o?i.call(o,r,s):i(r,s)):Mc(t,a+2)}(s,Ze(),e,o.transform,n,i,o):o.transform(n,i))}function Lc(t,e){return t[1].data[e].pure}function jc(t,e){return $o.isWrapped(e)&&(e=$o.unwrap(e),t[Je()]=_s),e}function Fc(t){return e=>{setTimeout(t,void 0,e)}}const Bc=class extends A{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=Fc(a),o&&(o=Fc(o)),l&&(l=Fc(l)));const c=super.subscribe({next:o,error:a,complete:l});return t instanceof g&&t.add(c),c}};function Vc(){return this._results[Ho()]()}class zc{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=zc.prototype;n[e]||(n[e]=Vc)}get changes(){return this._changes||(this._changes=new Bc)}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=Tl,this.reject=Tl,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)(Ei(su,8))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();const au=new oi("AppId"),lu={provide:au,useFactory:function(){return`${cu()}${cu()}${cu()}`},deps:[]};function cu(){return String.fromCharCode(97+Math.floor(25*Math.random()))}const uu=new oi("Platform Initializer"),hu=new oi("Platform ID"),du=new oi("appBootstrapListener");let pu=(()=>{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 fu=new oi("LocaleId"),gu=new oi("DefaultCurrencyCode");class mu{constructor(t,e){this.ngModuleFactory=t,this.componentFactories=e}}const bu=function(t){return new Tc(t)},yu=bu,vu=function(t){return Promise.resolve(bu(t))},_u=function(t){const e=bu(t),n=Ir(le(t).declarations).reduce((t,e)=>{const n=ae(e);return n&&t.push(new Sc(n)),t},[]);return new mu(e,n)},wu=_u,xu=function(t){return Promise.resolve(_u(t))};let Su=(()=>{class t{constructor(){this.compileModuleSync=yu,this.compileModuleAsync=vu,this.compileModuleAndAllComponentsSync=wu,this.compileModuleAndAllComponentsAsync=xu}clearCache(){}clearCacheFor(t){}getModuleId(t){}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();const Cu=new oi("compilerOptions"),Eu=(()=>Promise.resolve(0))();function Ou(t){"undefined"==typeof Zone?Eu.then(()=>{t&&t.apply(null,null)}):Zone.current.scheduleMicroTask("scheduleMicrotask",t)}class Tu{constructor({enableLongStackTrace:t=!1,shouldCoalesceEventChangeDetection:e=!1,shouldCoalesceRunChangeDetection:n=!1}){if(this.hasPendingMacrotasks=!1,this.hasPendingMicrotasks=!1,this.isStable=!0,this.onUnstable=new Bc(!1),this.onMicrotaskEmpty=new Bc(!1),this.onStable=new Bc(!1),this.onError=new Bc(!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,Au(t),t.isCheckStableRunning=!0,Pu(t),t.isCheckStableRunning=!1},void 0,()=>{},()=>{})),t.fakeTopEventTask.invoke()}),Au(t))}(t)};t._inner=t._inner.fork({name:"angular",properties:{isAngularZone:!0},onInvokeTask:(n,i,r,s,o,a)=>{try{return Mu(t),n.invokeTask(r,s,o,a)}finally{(t.shouldCoalesceEventChangeDetection&&"eventTask"===s.type||t.shouldCoalesceRunChangeDetection)&&e(),Iu(t)}},onInvoke:(n,i,r,s,o,a,l)=>{try{return Mu(t),n.invoke(r,s,o,a,l)}finally{t.shouldCoalesceRunChangeDetection&&e(),Iu(t)}},onHasTask:(e,n,i,r)=>{e.hasTask(i,r),n===i&&("microTask"==r.change?(t._hasPendingMicrotasks=r.microTask,Au(t),Pu(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(!Tu.isInAngularZone())throw new Error("Expected to be in Angular Zone, but it is not!")}static assertNotInAngularZone(){if(Tu.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,ku,Tl,Tl);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 ku={};function Pu(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 Au(t){t.hasPendingMicrotasks=!!(t._hasPendingMicrotasks||(t.shouldCoalesceEventChangeDetection||t.shouldCoalesceRunChangeDetection)&&-1!==t.lastRequestAnimationFrameId)}function Mu(t){t._nesting++,t.isStable&&(t.isStable=!1,t.onUnstable.emit(null))}function Iu(t){t._nesting--,Pu(t)}class Du{constructor(){this.hasPendingMicrotasks=!1,this.hasPendingMacrotasks=!1,this.isStable=!0,this.onUnstable=new Bc,this.onMicrotaskEmpty=new Bc,this.onStable=new Bc,this.onError=new Bc}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 Ru=(()=>{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:()=>{Tu.assertNotInAngularZone(),Ou(()=>{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())Ou(()=>{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)(Ei(Tu))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),Nu=(()=>{class t{constructor(){this._applications=new Map,ju.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 ju.findTestabilityInTree(this,t,e)}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();class Lu{addToWindow(t){}findTestabilityInTree(t,e,n){return null}}let ju=new Lu,Fu=!0,Bu=!1;function Vu(){return Bu=!0,Fu}let zu;const Uu=new oi("AllowMultipleToken");function Hu(t,e,n=[]){const i=`Platform: ${e}`,r=new oi(i);return(e=[])=>{let s=$u();if(!s||s.injector.get(Uu,!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(zu&&!zu.destroyed&&!zu.injector.get(Uu,!1))throw new Error("There can be only one platform. Destroy the previous one to create a new one.");zu=t.get(Gu);const e=t.get(uu,null);e&&e.forEach(t=>t())}(No.create({providers:t,name:i}))}return function(t){const e=$u();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 $u(){return zu&&!zu.destroyed?zu:null}let Gu=(()=>{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 Du:("zone.js"===t?void 0:t)||new Tu({enableLongStackTrace:Vu(),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:Tu,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(()=>{Xu(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(ou);return t.runInitializers(),t.donePromise.then(()=>(fl(s.injector.get(fu,dl)||dl),this._moduleDoBootstrap(s),s))})})}bootstrapModule(t,e=[]){const n=Wu({},e);return function(t,e,n){const i=new Tc(n);return Promise.resolve(i)}(0,0,t).then(t=>this.bootstrapModuleFactory(t,n))}_moduleDoBootstrap(t){const e=t.injector.get(qu);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)(Ei(No))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();function Wu(t,e){return Array.isArray(e)?e.reduce(Wu,t):Object.assign(Object.assign({},t),e)}let qu=(()=>{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 E(t=>{this._stable=this._zone.isStable&&!this._zone.hasPendingMacrotasks&&!this._zone.hasPendingMicrotasks,this._zone.runOutsideAngular(()=>{t.next(this._stable),t.complete()})}),o=new E(t=>{let e;this._zone.runOutsideAngular(()=>{e=this._zone.onStable.subscribe(()=>{Tu.assertNotInAngularZone(),Ou(()=>{!this._stable&&!this._zone.hasPendingMacrotasks&&!this._zone.hasPendingMicrotasks&&(this._stable=!0,t.next(!0))})})});const n=this._zone.onUnstable.subscribe(()=>{Tu.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 Sl?t:this._componentFactoryResolver.resolveComponentFactory(t),this.componentTypes.push(n.componentType);const i=function(t){return t.isBoundToModule}(n)?void 0:this._injector.get(hc),r=n.create(No.NULL,[],e||n.selector,i),s=r.location.nativeElement,o=r.injector.get(Ru,null),a=o&&r.injector.get(Nu);return o&&a&&a.registerApplication(s,o),r.onDestroy(()=>{this.detachView(r.hostView),Xu(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;Xu(this._views,e),e.detachFromAppRef()}_loadComponent(t){this.attachView(t.hostView),this.tick(),this.components.push(t),this._injector.get(du,[]).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)(Ei(Tu),Ei(No),Ei(kr),Ei(Ol),Ei(ou))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();function Xu(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const Yu=Hu(null,"core",[{provide:hu,useValue:"unknown"},{provide:Gu,deps:[No]},{provide:Nu,deps:[]},{provide:pu,deps:[]}]),Ku=[{provide:qu,useClass:qu,deps:[Tu,No,kr,Ol,ou]},{provide:xc,deps:[Tu],useFactory:function(t){let e=[];return t.onStable.subscribe(()=>{for(;e.length;)e.pop()()}),function(t){e.push(t)}}},{provide:ou,useClass:ou,deps:[[new Ii,su]]},{provide:Su,useClass:Su,deps:[]},lu,{provide:Yl,useFactory:function(){return rc},deps:[]},{provide:Ql,useFactory:function(){return sc},deps:[]},{provide:fu,useFactory:function(t){return fl(t=t||"undefined"!=typeof $localize&&$localize.locale||dl),t},deps:[[new Mi(fu),new Ii,new Di]]},{provide:gu,useValue:"USD"}];let Qu=(()=>{class t{constructor(t){}}return t.\u0275fac=function(e){return new(e||t)(Ei(qu))},t.\u0275mod=ie({type:t}),t.\u0275inj=St({providers:Ku}),t})(),Zu=null;function Ju(){return Zu}const th=new oi("DocumentToken");let eh=(()=>{class t{historyGo(t){throw new Error("Not implemented")}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=xt({factory:nh,token:t,providedIn:"platform"}),t})();function nh(){return Ei(ih)}let ih=(()=>{class t extends eh{constructor(t){super(),this._doc=t,this._init()}_init(){this.location=window.location,this._history=window.history}getBaseHrefFromDOM(){return Ju().getBaseHref(this._doc)}onPopState(t){const e=Ju().getGlobalEventTarget(this._doc,"window");return e.addEventListener("popstate",t,!1),()=>e.removeEventListener("popstate",t)}onHashChange(t){const e=Ju().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){rh()?this._history.pushState(t,e,n):this.location.hash=n}replaceState(t,e,n){rh()?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)(Ei(th))},t.\u0275prov=xt({factory:sh,token:t,providedIn:"platform"}),t})();function rh(){return!!window.history.pushState}function sh(){return new ih(Ei(th))}function oh(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 ah(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 lh(t){return t&&"?"!==t[0]?"?"+t:t}let ch=(()=>{class t{historyGo(t){throw new Error("Not implemented")}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=xt({factory:uh,token:t,providedIn:"root"}),t})();function uh(t){const e=Ei(th).location;return new dh(Ei(eh),e&&e.origin||"")}const hh=new oi("appBaseHref");let dh=(()=>{class t extends ch{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 oh(this._baseHref,t)}path(t=!1){const e=this._platformLocation.pathname+lh(this._platformLocation.search),n=this._platformLocation.hash;return n&&t?`${e}${n}`:e}pushState(t,e,n,i){const r=this.prepareExternalUrl(n+lh(i));this._platformLocation.pushState(t,e,r)}replaceState(t,e,n,i){const r=this.prepareExternalUrl(n+lh(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)(Ei(eh),Ei(hh,8))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),ph=(()=>{class t{constructor(t,e){this._subject=new Bc,this._urlChangeListeners=[],this._platformStrategy=t;const n=this._platformStrategy.getBaseHref();this._platformLocation=e,this._baseHref=ah(gh(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+lh(e))}normalize(e){return t.stripTrailingSlash(function(t,e){return t&&e.startsWith(t)?e.substring(t.length):e}(this._baseHref,gh(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+lh(e)),n)}replaceState(t,e="",n=null){this._platformStrategy.replaceState(n,"",t,e),this._notifyUrlChangeListeners(this.prepareExternalUrl(t+lh(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)(Ei(ch),Ei(eh))},t.normalizeQueryParams=lh,t.joinWithSlash=oh,t.stripTrailingSlash=ah,t.\u0275prov=xt({factory:fh,token:t,providedIn:"root"}),t})();function fh(){return new ph(Ei(ch),Ei(eh))}function gh(t){return t.replace(/\/index.html$/,"")}var mh=(()=>((mh=mh||{})[mh.Decimal=0]="Decimal",mh[mh.Percent=1]="Percent",mh[mh.Currency=2]="Currency",mh[mh.Scientific=3]="Scientific",mh))(),bh=(()=>((bh=bh||{})[bh.Zero=0]="Zero",bh[bh.One=1]="One",bh[bh.Two=2]="Two",bh[bh.Few=3]="Few",bh[bh.Many=4]="Many",bh[bh.Other=5]="Other",bh))(),yh=(()=>((yh=yh||{})[yh.Decimal=0]="Decimal",yh[yh.Group=1]="Group",yh[yh.List=2]="List",yh[yh.PercentSign=3]="PercentSign",yh[yh.PlusSign=4]="PlusSign",yh[yh.MinusSign=5]="MinusSign",yh[yh.Exponential=6]="Exponential",yh[yh.SuperscriptingExponent=7]="SuperscriptingExponent",yh[yh.PerMille=8]="PerMille",yh[yh.Infinity=9]="Infinity",yh[yh.NaN=10]="NaN",yh[yh.TimeSeparator=11]="TimeSeparator",yh[yh.CurrencyDecimal=12]="CurrencyDecimal",yh[yh.CurrencyGroup=13]="CurrencyGroup",yh))();function vh(t,e){const n=cl(t),i=n[hl.NumberSymbols][e];if(void 0===i){if(e===yh.CurrencyDecimal)return n[hl.NumberSymbols][yh.Decimal];if(e===yh.CurrencyGroup)return n[hl.NumberSymbols][yh.Group]}return i}const _h=function(t){return cl(t)[hl.PluralCase]},wh=/^(\d+)?\.((\d+)(-(\d+))?)?$/;function xh(t){const e=parseInt(t);if(isNaN(e))throw new Error("Invalid integer literal when parsing "+t);return e}class Sh{}let Ch=(()=>{class t extends Sh{constructor(t){super(),this.locale=t}getPluralCategory(t,e){switch(_h(e||this.locale)(t)){case bh.Zero:return"zero";case bh.One:return"one";case bh.Two:return"two";case bh.Few:return"few";case bh.Many:return"many";default:return"other"}}}return t.\u0275fac=function(e){return new(e||t)(Ei(fu))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();function Eh(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 Oh=(()=>{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(Yl),ea(Ql),ea(Al),ea(Dl))},t.\u0275dir=se({type:t,selectors:[["","ngClass",""]],inputs:{klass:["class","klass"],ngClass:"ngClass"}}),t})();class Th{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 kh=(()=>{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 Th(null,this._ngForOf,-1,-1),null===i?void 0:i),r=new Ph(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 Ph(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(pc),ea(ac),ea(Yl))},t.\u0275dir=se({type:t,selectors:[["","ngFor","","ngForOf",""]],inputs:{ngForOf:"ngForOf",ngForTrackBy:"ngForTrackBy",ngForTemplate:"ngForTemplate"}}),t})();class Ph{constructor(t,e){this.record=t,this.view=e}}let Ah=(()=>{class t{constructor(t,e){this._viewContainer=t,this._context=new Mh,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){Ih("ngIfThen",t),this._thenTemplateRef=t,this._thenViewRef=null,this._updateView()}set ngIfElse(t){Ih("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(pc),ea(ac))},t.\u0275dir=se({type:t,selectors:[["","ngIf",""]],inputs:{ngIf:"ngIf",ngIfThen:"ngIfThen",ngIfElse:"ngIfElse"}}),t})();class Mh{constructor(){this.$implicit=null,this.ngIf=null}}function Ih(t,e){if(e&&!e.createEmbeddedView)throw new Error(`${t} must be a TemplateRef, but received '${ut(e)}'.`)}class Dh{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 Rh=(()=>{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 Dh(t,e)}ngDoCheck(){this._view.enforceState(this.ngSwitch._matchCase(this.ngSwitchCase))}}return t.\u0275fac=function(e){return new(e||t)(ea(pc),ea(ac),ea(Rh,9))},t.\u0275dir=se({type:t,selectors:[["","ngSwitchCase",""]],inputs:{ngSwitchCase:"ngSwitchCase"}}),t})(),Lh=(()=>{class t{constructor(t,e,n){n._addDefault(new Dh(t,e))}}return t.\u0275fac=function(e){return new(e||t)(ea(pc),ea(ac),ea(Rh,9))},t.\u0275dir=se({type:t,selectors:[["","ngSwitchDefault",""]]}),t})(),jh=(()=>{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(Al),ea(Ql),ea(Dl))},t.\u0275dir=se({type:t,selectors:[["","ngStyle",""]],inputs:{ngStyle:"ngStyle"}}),t})(),Fh=(()=>{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(pc))},t.\u0275dir=se({type:t,selectors:[["","ngTemplateOutlet",""]],inputs:{ngTemplateOutletContext:"ngTemplateOutletContext",ngTemplateOutlet:"ngTemplateOutlet"},features:[ye]}),t})();function Bh(t,e){return Error(`InvalidPipeArgument: '${e}' for pipe '${ut(t)}'`)}class Vh{createSubscription(t,e){return t.subscribe({next:e,error:t=>{throw t}})}dispose(t){t.unsubscribe()}onDestroy(t){t.unsubscribe()}}class zh{createSubscription(t,e){return t.then(e,t=>{throw t})}dispose(t){}onDestroy(t){}}const Uh=new zh,Hh=new Vh;let $h=(()=>{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 Uh;if(da(e))return Hh;throw Bh(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(nc,16))},t.\u0275pipe=oe({name:"async",type:t,pure:!1}),t})(),Gh=(()=>{class t{constructor(t){this._locale=t}transform(e,n,i){if(!function(t){return!(null==t||""===t||t!=t)}(e))return null;i=i||this._locale;try{return function(t,e,n){return function(t,e,n,i,r,s,o=!1){let a="",l=!1;if(isFinite(t)){let c=function(t){let e,n,i,r,s,o=Math.abs(t)+"",a=0;for((n=o.indexOf("."))>-1&&(o=o.replace(".","")),(i=o.search(/e/i))>0?(n<0&&(n=i),n+=+o.slice(i+1),o=o.substring(0,i)):n<0&&(n=o.length),i=0;"0"===o.charAt(i);i++);if(i===(s=o.length))e=[0],n=1;else{for(s--;"0"===o.charAt(s);)s--;for(n-=i,e=[],r=0;i<=s;i++,r++)e[r]=Number(o.charAt(i))}return n>22&&(e=e.splice(0,21),a=n-1,n=1),{digits:e,exponent:a,integerLen:n}}(t);o&&(c=function(t){if(0===t.digits[0])return t;const e=t.digits.length-t.integerLen;return t.exponent?t.exponent+=2:(0===e?t.digits.push(0,0):1===e&&t.digits.push(0),t.integerLen+=2),t}(c));let u=e.minInt,h=e.minFrac,d=e.maxFrac;if(s){const t=s.match(wh);if(null===t)throw new Error(`${s} is not a valid digit info`);const e=t[1],n=t[3],i=t[5];null!=e&&(u=xh(e)),null!=n&&(h=xh(n)),null!=i?d=xh(i):null!=n&&h>d&&(d=h)}!function(t,e,n){if(e>n)throw new Error(`The minimum number of digits after fraction (${e}) is higher than the maximum (${n}).`);let i=t.digits,r=i.length-t.integerLen;const s=Math.min(Math.max(e,r),n);let o=s+t.integerLen,a=i[o];if(o>0){i.splice(Math.max(t.integerLen,o));for(let t=o;t=5)if(o-1<0){for(let e=0;e>o;e--)i.unshift(0),t.integerLen++;i.unshift(1),t.integerLen++}else i[o-1]++;for(;r=c?i.pop():l=!1),e>=10?1:0},0);u&&(i.unshift(u),t.integerLen++)}(c,h,d);let p=c.digits,f=c.integerLen;const g=c.exponent;let m=[];for(l=p.every(t=>!t);f0?m=p.splice(f,p.length):(m=p,p=[0]);const b=[];for(p.length>=e.lgSize&&b.unshift(p.splice(-e.lgSize,p.length).join(""));p.length>e.gSize;)b.unshift(p.splice(-e.gSize,p.length).join(""));p.length&&b.unshift(p.join("")),a=b.join(vh(n,i)),m.length&&(a+=vh(n,r)+m.join("")),g&&(a+=vh(n,yh.Exponential)+"+"+g)}else a=vh(n,yh.Infinity);return a=t<0&&!l?e.negPre+a+e.negSuf:e.posPre+a+e.posSuf,a}(t,function(t,e="-"){const n={minInt:1,minFrac:0,maxFrac:0,posPre:"",posSuf:"",negPre:"",negSuf:"",gSize:0,lgSize:0},i=t.split(";"),r=i[0],s=i[1],o=-1!==r.indexOf(".")?r.split("."):[r.substring(0,r.lastIndexOf("0")+1),r.substring(r.lastIndexOf("0")+1)],a=o[0],l=o[1]||"";n.posPre=a.substr(0,a.indexOf("#"));for(let u=0;u{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({providers:[{provide:Sh,useClass:Ch}]}),t})();const qh="browser";function Xh(t){return t===qh}class Yh{}class Kh extends class extends class{}{constructor(){super(...arguments),this.supportsDOMEvents=!0}}{static makeCurrent(){!function(t){Zu||(Zu=t)}(new Kh)}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=(Zh=Zh||document.querySelector("base"),Zh?Zh.getAttribute("href"):null);return null==e?null:function(t){Qh=Qh||document.createElement("a"),Qh.setAttribute("href",t);const e=Qh.pathname;return"/"===e.charAt(0)?e:`/${e}`}(e)}resetBaseElement(){Zh=null}getUserAgent(){return window.navigator.userAgent}getCookie(t){return Eh(document.cookie,t)}}let Qh,Zh=null;const Jh=new oi("TRANSITION_ID"),td=[{provide:su,useFactory:function(t,e,n){return()=>{n.get(ou).donePromise.then(()=>{const n=Ju(),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?Ju().isShadowRoot(e)?this.findTestabilityInTree(t,e.host,!0):this.findTestabilityInTree(t,e.parentElement,!0):null}}let nd=(()=>{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 id=new oi("EventManagerPlugins");let rd=(()=>{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})(),ad=(()=>{class t extends od{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(ld),this._hostNodes.delete(t)}onStylesAdded(t){this._hostNodes.forEach((e,n)=>{this._addStylesToHost(t,n,e)})}ngOnDestroy(){this._hostNodes.forEach(t=>t.forEach(ld))}}return t.\u0275fac=function(e){return new(e||t)(Ei(th))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();function ld(t){Ju().remove(t)}const cd={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/"},ud=/%COMP%/g;function hd(t,e,n){for(let i=0;i{if("__ngUnwrap__"===e)return t;!1===t(e)&&(e.preventDefault(),e.returnValue=!1)}}let pd=(()=>{class t{constructor(t,e,n){this.eventManager=t,this.sharedStylesHost=e,this.appId=n,this.rendererByCompId=new Map,this.defaultRenderer=new fd(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 gd(this.eventManager,this.sharedStylesHost,e,this.appId),this.rendererByCompId.set(e.id,n)),n.applyToHost(t),n}case 1:case jt.ShadowDom:return new md(this.eventManager,this.sharedStylesHost,t,e);default:if(!this.rendererByCompId.has(e.id)){const t=hd(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)(Ei(rd),Ei(ad),Ei(au))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();class fd{constructor(t){this.eventManager=t,this.data=Object.create(null)}destroy(){}createElement(t,e){return e?document.createElementNS(cd[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=cd[i];r?t.setAttributeNS(r,e,n):t.setAttribute(e,n)}else t.setAttribute(e,n)}removeAttribute(t,e,n){if(n){const i=cd[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,dd(n)):this.eventManager.addEventListener(t,e,dd(n))}}class gd extends fd{constructor(t,e,n,i){super(t),this.component=n;const r=hd(i+"-"+n.id,n.styles,[]);e.addStyles(r),this.contentAttr=function(t){return"_ngcontent-%COMP%".replace(ud,t)}(i+"-"+n.id),this.hostAttr=function(t){return"_nghost-%COMP%".replace(ud,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 md extends fd{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=hd(i.id,i.styles,[]);for(let s=0;s{class t extends sd{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)(Ei(th))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();const yd=["alt","control","meta","shift"],vd={"\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"},_d={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"},wd={alt:t=>t.altKey,control:t=>t.ctrlKey,meta:t=>t.metaKey,shift:t=>t.shiftKey};let xd=(()=>{class t extends sd{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(()=>Ju().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(yd.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&&_d.hasOwnProperty(e)&&(e=_d[e]))}return vd[e]||e}(t);return n=n.toLowerCase()," "===n?n="space":"."===n&&(n="dot"),yd.forEach(i=>{i!=n&&wd[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)(Ei(th))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),Sd=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=xt({factory:function(){return Ei(Cd)},token:t,providedIn:"root"}),t})(),Cd=(()=>{class t extends Sd{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)(Ei(th))},t.\u0275prov=xt({factory:function(){return function(t){return new Cd(t.get(th))}(Ei(_o))},token:t,providedIn:"root"}),t})();const Ed=Hu(Yu,"browser",[{provide:hu,useValue:qh},{provide:uu,useValue:function(){Kh.makeCurrent(),ed.init()},multi:!0},{provide:th,useFactory:function(){return function(t){Ee=t}(document),document},deps:[]}]),Od=[[],{provide:xo,useValue:"root"},{provide:kr,useFactory:function(){return new kr},deps:[]},{provide:id,useClass:bd,multi:!0,deps:[th,Tu,hu]},{provide:id,useClass:xd,multi:!0,deps:[th]},[],{provide:pd,useClass:pd,deps:[rd,ad,au]},{provide:Il,useExisting:pd},{provide:od,useExisting:ad},{provide:ad,useClass:ad,deps:[th]},{provide:Ru,useClass:Ru,deps:[Tu]},{provide:rd,useClass:rd,deps:[id,Tu]},{provide:Yh,useClass:nd,deps:[]},[]];let Td=(()=>{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:au,useValue:e.appId},{provide:Jh,useExisting:au},td]}}}return t.\u0275fac=function(e){return new(e||t)(Ei(t,12))},t.\u0275mod=ie({type:t}),t.\u0275inj=St({providers:Od,imports:[Wh,Qu]}),t})();function kd(t){return null!=t&&"false"!=`${t}`}function Pd(t,e=0){return function(t){return!isNaN(parseFloat(t))&&!isNaN(Number(t))}(t)?Number(t):e}function Ad(t){return Array.isArray(t)?t:[t]}function Md(t){return null==t?"":"string"==typeof t?t:`${t}px`}function Id(t){return t instanceof Al?t.nativeElement:t}function Dd(...t){let e=t[t.length-1];return I(e)?(t.pop(),z(t,e)):K(t)}function Rd(t,e,n,i){return a(n)&&(i=n,n=void 0),i?Rd(t,e,n).pipe(D(t=>d(t)?i(...t):i(t))):new E(i=>{Nd(t,e,function(t){i.next(arguments.length>1?Array.prototype.slice.call(arguments):t)},i,n)})}function Nd(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 Bd extends Fd{constructor(t,e=Fd.now){super(t,()=>Bd.delegate&&Bd.delegate!==this?Bd.delegate.now():e()),this.actions=[],this.active=!1,this.scheduled=void 0}schedule(t,e=0,n){return Bd.delegate&&Bd.delegate!==this?Bd.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 Bd{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 Vd=1;const zd=Promise.resolve(),Ud={};function Hd(t){return t in Ud&&(delete Ud[t],!0)}const $d={setImmediate(t){const e=Vd++;return Ud[e]=!0,zd.then(()=>Hd(e)&&t()),e},clearImmediate(t){Hd(t)}};new class extends Bd{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=$d.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&&($d.clearImmediate(e),t.scheduled=void 0)}});function Gd(t){return!!t&&(t instanceof E||"function"==typeof t.lift&&"function"==typeof t.subscribe)}function Wd(t,e){return n=>n.lift(new qd(t,e))}class qd{constructor(t,e){this.compare=t,this.keySelector=e}call(t,e){return e.subscribe(new Xd(t,this.compare,this.keySelector))}}class Xd 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 Yd=new Bd(jd);class Kd{constructor(t){this.durationSelector=t}call(t,e){return e.subscribe(new Qd(t,this.durationSelector))}}class Qd 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 Zd(t){return!d(t)&&t-parseFloat(t)+1>=0}function Jd(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 tp(t,e=Yd){return function(t){return function(e){return e.lift(new Kd(t))}}(()=>function(t=0,e,n){let i=-1;return Zd(e)?i=Number(e)<1?1:Number(e):I(e)&&(n=e),I(n)||(n=Yd),new E(e=>{const r=Zd(t)?t:+t-n.now();return n.schedule(Jd,r,{index:0,period:i,subscriber:e})})}(t,e))}function ep(t,e){return function(n){return n.lift(new np(t,e))}}class np{constructor(t,e){this.predicate=t,this.thisArg=e}call(t,e){return e.subscribe(new ip(t,this.predicate,this.thisArg))}}class ip 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 rp(t){return e=>e.lift(new sp(t))}class sp{constructor(t){this.notifier=t}call(t,e){const n=new op(t),i=G(this.notifier,new H(n));return i&&!n.seenValue?(n.add(i),e.subscribe(n)):n}}class op extends ${constructor(t){super(t),this.seenValue=!1}notifyNext(){this.seenValue=!0,this.complete()}notifyComplete(){}}function ap(...t){return Y(1)(Dd(...t))}function lp(...t){const e=t[t.length-1];return I(e)?(t.pop(),n=>ap(t,n,e)):e=>ap(t,e)}function cp(t,e){return"function"==typeof e?n=>n.pipe(cp((n,i)=>U(t(n,i)).pipe(D((t,r)=>e(n,t,i,r))))):e=>e.lift(new up(t))}class up{constructor(t){this.project=t}call(t,e){return e.subscribe(new hp(t,this.project))}}class hp 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 dp=new class extends Bd{}(class extends jd{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)}}),pp=new E(t=>t.complete());function fp(t){return t?function(t){return new E(e=>t.schedule(()=>e.complete()))}(t):pp}function gp(t,e){return new E(e?n=>e.schedule(mp,0,{error:t,subscriber:n}):e=>e.error(t))}function mp({error:t,subscriber:e}){e.error(t)}class bp{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 Dd(this.value);case"E":return gp(this.error);case"C":return fp()}throw new Error("unexpected notification kind value")}static createNext(t){return void 0!==t?new bp("N",t):bp.undefinedValueNotification}static createError(t){return new bp("E",void 0,t)}static createComplete(){return bp.completeNotification}}bp.completeNotification=new bp("C"),bp.undefinedValueNotification=new bp("N",void 0);class yp 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(yp.dispatch,this.delay,new vp(t,this.destination)))}_next(t){this.scheduleMessage(bp.createNext(t))}_error(t){this.scheduleMessage(bp.createError(t)),this.unsubscribe()}_complete(){this.scheduleMessage(bp.createComplete()),this.unsubscribe()}}class vp{constructor(t,e){this.notification=t,this.destination=e}}class _p extends A{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 wp(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 yp(t,i)),e)for(let o=0;oe&&(s=Math.max(s,r-e)),s>0&&i.splice(0,s),i}}class wp{constructor(t,e){this.time=t,this.value=e}}function xp(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 _p(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 Sp;try{Sp="undefined"!=typeof Intl&&Intl.v8BreakIterator}catch(m){Sp=!1}let Cp,Ep=(()=>{class t{constructor(t){this._platformId=t,this.isBrowser=this._platformId?Xh(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&&!Sp)&&"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)(Ei(hu))},t.\u0275prov=xt({factory:function(){return new t(Ei(hu))},token:t,providedIn:"root"}),t})(),Op=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({}),t})();const Tp=["color","button","checkbox","date","datetime-local","email","file","hidden","image","month","number","password","radio","range","reset","search","submit","tel","text","time","url","week"];function kp(){if(Cp)return Cp;if("object"!=typeof document||!document)return Cp=new Set(Tp),Cp;let t=document.createElement("input");return Cp=new Set(Tp.filter(e=>(t.setAttribute("type",e),t.type===e))),Cp}let Pp,Ap,Mp;function Ip(t){return function(){if(null==Pp&&"undefined"!=typeof window)try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:()=>Pp=!0}))}finally{Pp=Pp||!1}return Pp}()?t:!!t.capture}function Dp(){if(null==Ap){if("object"!=typeof document||!document||"function"!=typeof Element||!Element)return Ap=!1,Ap;if("scrollBehavior"in document.documentElement.style)Ap=!0;else{const t=Element.prototype.scrollTo;Ap=!!t&&!/\{\s*\[native code\]\s*\}/.test(t.toString())}}return Ap}function Rp(t){if(function(){if(null==Mp){const t="undefined"!=typeof document?document.head:null;Mp=!(!t||!t.createShadowRoot&&!t.attachShadow)}return Mp}()){const e=t.getRootNode?t.getRootNode():null;if("undefined"!=typeof ShadowRoot&&ShadowRoot&&e instanceof ShadowRoot)return e}return null}function Np(){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 Lp(t){return t.composedPath?t.composedPath()[0]:t.target}const jp=new oi("cdk-dir-doc",{providedIn:"root",factory:function(){return Oi(th)}});let Fp=(()=>{class t{constructor(t){if(this.value="ltr",this.change=new Bc,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)(Ei(jp,8))},t.\u0275prov=xt({factory:function(){return new t(Ei(jp,8))},token:t,providedIn:"root"}),t})(),Bp=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({}),t})();class Vp{constructor(t=!1,e,n=!0){this._multiple=t,this._emitChanges=n,this._selection=new Set,this._deselectedToEmit=[],this._selectedToEmit=[],this.changed=new A,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 zp=(()=>{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})(),Up=(()=>{class t{constructor(t,e,n){this._ngZone=t,this._platform=e,this._scrolled=new A,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 E(e=>{this._globalSubscription||this._addGlobalListener();const n=t>0?this._scrolled.pipe(tp(t)).subscribe(e):this._scrolled.subscribe(e);return this._scrolledCount++,()=>{n.unsubscribe(),this._scrolledCount--,this._scrolledCount||this._removeGlobalListener()}}):Dd()}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(ep(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=Id(e),i=t.getElementRef().nativeElement;do{if(n==i)return!0}while(n=n.parentElement);return!1}_addGlobalListener(){this._globalSubscription=this._ngZone.runOutsideAngular(()=>Rd(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)(Ei(Tu),Ei(Ep),Ei(th,8))},t.\u0275prov=xt({factory:function(){return new t(Ei(Tu),Ei(Ep),Ei(th,8))},token:t,providedIn:"root"}),t})(),Hp=(()=>{class t{constructor(t,e,n){this._platform=t,this._change=new A,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(tp(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)(Ei(Ep),Ei(Tu),Ei(th,8))},t.\u0275prov=xt({factory:function(){return new t(Ei(Ep),Ei(Tu),Ei(th,8))},token:t,providedIn:"root"}),t})(),$p=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({}),t})(),Gp=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Bp,Op,$p],Bp,$p]}),t})();class Wp{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 qp extends Wp{constructor(t,e,n,i){super(),this.component=t,this.viewContainerRef=e,this.injector=n,this.componentFactoryResolver=i}}class Xp extends Wp{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 Yp extends Wp{constructor(t){super(),this.element=t instanceof Al?t.nativeElement:t}}class Kp{constructor(){this._isDisposed=!1,this.attachDomPortal=null}hasAttached(){return!!this._attachedPortal}attach(t){return t instanceof qp?(this._attachedPortal=t,this.attachComponentPortal(t)):t instanceof Xp?(this._attachedPortal=t,this.attachTemplatePortal(t)):this.attachDomPortal&&t instanceof Yp?(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 Qp extends Kp{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 Zp=(()=>{class t extends Xp{constructor(t,e){super(t,e)}}return t.\u0275fac=function(e){return new(e||t)(ea(ac),ea(pc))},t.\u0275dir=se({type:t,selectors:[["","cdkPortal",""]],exportAs:["cdkPortal"],features:[jo]}),t})(),Jp=(()=>{class t extends Zp{}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:[xl([{provide:Zp,useExisting:t}]),jo]}),t})(),tf=(()=>{class t extends Kp{constructor(t,e,n){super(),this._componentFactoryResolver=t,this._viewContainerRef=e,this._isInitialized=!1,this.attached=new Bc,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(Ol),ea(pc),ea(th))},t.\u0275dir=se({type:t,selectors:[["","cdkPortalOutlet",""]],inputs:{portal:["cdkPortalOutlet","portal"]},outputs:{attached:"attached"},exportAs:["cdkPortalOutlet"],features:[jo]}),t})(),ef=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({}),t})();const nf=(()=>{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 rf(t){return e=>0===t?fp():e.lift(new sf(t))}class sf{constructor(t){if(this.total=t,this.total<0)throw new nf}call(t,e){return e.subscribe(new of(t,this.total))}}class of 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 af(t,e=!1){return n=>n.lift(new lf(t,e))}class lf{constructor(t,e){this.predicate=t,this.inclusive=e}call(t,e){return e.subscribe(new cf(t,this.predicate,this.inclusive))}}class cf 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 uf(t,...e){return e.length?e.some(e=>t[e]):t.altKey||t.shiftKey||t.ctrlKey||t.metaKey}const hf=Dp();class df{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=Md(-this._previousScrollPosition.left),t.style.top=Md(-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"),hf&&(e.scrollBehavior=n.scrollBehavior="auto"),window.scroll(this._previousScrollPosition.left,this._previousScrollPosition.top),hf&&(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 pf{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 ff{enable(){}disable(){}attach(){}}function gf(t,e){return e.some(e=>t.bottome.bottom||t.righte.right)}function mf(t,e){return e.some(e=>t.tope.bottom||t.lefte.right)}class bf{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();gf(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 yf=(()=>{class t{constructor(t,e,n,i){this._scrollDispatcher=t,this._viewportRuler=e,this._ngZone=n,this.noop=()=>new ff,this.close=t=>new pf(this._scrollDispatcher,this._ngZone,this._viewportRuler,t),this.block=()=>new df(this._viewportRuler,this._document),this.reposition=t=>new bf(this._scrollDispatcher,this._viewportRuler,this._ngZone,t),this._document=i}}return t.\u0275fac=function(e){return new(e||t)(Ei(Up),Ei(Hp),Ei(Tu),Ei(th))},t.\u0275prov=xt({factory:function(){return new t(Ei(Up),Ei(Hp),Ei(Tu),Ei(th))},token:t,providedIn:"root"}),t})();class vf{constructor(t){if(this.scrollStrategy=new ff,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 _f{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 wf{constructor(t,e){this.connectionPair=t,this.scrollableViewProperties=e}}let xf=(()=>{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)(Ei(th))},t.\u0275prov=xt({factory:function(){return new t(Ei(th))},token:t,providedIn:"root"}),t})(),Sf=(()=>{class t extends xf{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)(Ei(th))},t.\u0275prov=xt({factory:function(){return new t(Ei(th))},token:t,providedIn:"root"}),t})(),Cf=(()=>{class t extends xf{constructor(t,e){super(t),this._platform=e,this._cursorStyleIsSet=!1,this._clickListener=t=>{const e=Lp(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)(Ei(th),Ei(Ep))},t.\u0275prov=xt({factory:function(){return new t(Ei(th),Ei(Ep))},token:t,providedIn:"root"}),t})();const Ef="undefined"!=typeof window?window:{},Of=void 0!==Ef.__karma__&&!!Ef.__karma__||void 0!==Ef.jasmine&&!!Ef.jasmine||void 0!==Ef.jest&&!!Ef.jest||void 0!==Ef.Mocha&&!!Ef.Mocha;let Tf=(()=>{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||Of){const e=this._document.querySelectorAll(`.${t}[platform="server"], .${t}[platform="test"]`);for(let t=0;tthis._backdropClick.next(t),this._keydownEvents=new A,this._outsidePointerEvents=new A,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(rf(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=Md(this._config.width),t.height=Md(this._config.height),t.minWidth=Md(this._config.minWidth),t.minHeight=Md(this._config.minHeight),t.maxWidth=Md(this._config.maxWidth),t.maxHeight=Md(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;Ad(e).forEach(t=>{t&&(n?i.add(t):i.remove(t))})}_detachContentWhenStable(){this._ngZone.runOutsideAngular(()=>{const t=this._ngZone.onStable.pipe(rp(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 Pf="cdk-overlay-connected-position-bounding-box",Af=/([A-Za-z%]+)$/;class Mf{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 A,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(Pf),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&&If(this._boundingBox.style,{top:"",left:"",right:"",bottom:"",height:"",width:"",alignItems:"",justifyContent:""}),this._pane&&this._resetOverlayElementStyles(),this._overlayRef&&this._overlayRef.hostElement.classList.remove(Pf),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=Rf(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=Df(this._overlayRef.getConfig().minHeight),o=Df(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=Rf(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=Md(n.height),i.top=Md(n.top),i.bottom=Md(n.bottom),i.width=Md(n.width),i.left=Md(n.left),i.right=Md(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=Md(t)),r&&(i.maxWidth=Md(r))}this._lastBoundingBoxSize=n,If(this._boundingBox.style,i)}_resetBoundingBoxStyles(){If(this._boundingBox.style,{top:"0",left:"0",right:"0",bottom:"0",height:"",width:"",alignItems:"",justifyContent:""})}_resetOverlayElementStyles(){If(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();If(n,this._getExactOverlayY(e,t,i)),If(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=Md(s.maxHeight):r&&(n.maxHeight="")),s.maxWidth&&(i?n.maxWidth=Md(s.maxWidth):r&&(n.maxWidth="")),If(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=Md(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=Md(s.x),r}_getScrollVisibility(){const t=this._getOriginRect(),e=this._pane.getBoundingClientRect(),n=this._scrollables.map(t=>t.getElementRef().nativeElement.getBoundingClientRect());return{isOriginClipped:mf(t,n),isOriginOutsideView:gf(t,n),isOverlayClipped:mf(e,n),isOverlayOutsideView:gf(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&&Ad(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 Al)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 If(t,e){for(let n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}function Df(t){if("number"!=typeof t&&null!=t){const[e,n]=t.split(Af);return n&&"px"!==n?null:parseFloat(e)}return t||null}function Rf(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 Nf{constructor(t,e,n,i,r,s,o){this._preferredPositions=[],this._positionStrategy=new Mf(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 _f(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 Lf="cdk-global-overlay-wrapper";class jf{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(Lf),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(Lf),n.justifyContent=n.alignItems=t.marginTop=t.marginBottom=t.marginLeft=t.marginRight=t.position="",this._overlayRef=null,this._isDisposed=!0}}let Ff=(()=>{class t{constructor(t,e,n,i){this._viewportRuler=t,this._document=e,this._platform=n,this._overlayContainer=i}global(){return new jf}connectedTo(t,e,n){return new Nf(e,n,t,this._viewportRuler,this._document,this._platform,this._overlayContainer)}flexibleConnectedTo(t){return new Mf(t,this._viewportRuler,this._document,this._platform,this._overlayContainer)}}return t.\u0275fac=function(e){return new(e||t)(Ei(Hp),Ei(th),Ei(Ep),Ei(Tf))},t.\u0275prov=xt({factory:function(){return new t(Ei(Hp),Ei(th),Ei(Ep),Ei(Tf))},token:t,providedIn:"root"}),t})(),Bf=0,Vf=(()=>{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 vf(t);return r.direction=r.direction||this._directionality.value,new kf(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-"+Bf++,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(qu)),new Qp(t,this._componentFactoryResolver,this._appRef,this._injector,this._document)}}return t.\u0275fac=function(e){return new(e||t)(Ei(yf),Ei(Tf),Ei(Ol),Ei(Ff),Ei(Sf),Ei(No),Ei(Tu),Ei(th),Ei(Fp),Ei(ph),Ei(Cf))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();const zf=[{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"}],Uf=new oi("cdk-connected-overlay-scroll-strategy");let Hf=(()=>{class t{constructor(t){this.elementRef=t}}return t.\u0275fac=function(e){return new(e||t)(ea(Al))},t.\u0275dir=se({type:t,selectors:[["","cdk-overlay-origin",""],["","overlay-origin",""],["","cdkOverlayOrigin",""]],exportAs:["cdkOverlayOrigin"]}),t})(),$f=(()=>{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 Bc,this.positionChange=new Bc,this.attach=new Bc,this.detach=new Bc,this.overlayKeydown=new Bc,this.overlayOutsideClick=new Bc,this._templatePortal=new Xp(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=kd(t)}get lockPosition(){return this._lockPosition}set lockPosition(t){this._lockPosition=kd(t)}get flexibleDimensions(){return this._flexibleDimensions}set flexibleDimensions(t){this._flexibleDimensions=kd(t)}get growAfterOpen(){return this._growAfterOpen}set growAfterOpen(t){this._growAfterOpen=kd(t)}get push(){return this._push}set push(t){this._push=kd(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=zf);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&&!uf(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 vf({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(af(()=>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(Vf),ea(ac),ea(pc),ea(Uf),ea(Fp,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 Gf={provide:Uf,deps:[Vf],useFactory:function(t){return()=>t.scrollStrategies.reposition()}};let Wf=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({providers:[Vf,Gf],imports:[[Bp,ef,Gp],Gp]}),t})();const qf={schedule(t,e){const n=setTimeout(t,e);return()=>clearTimeout(n)},scheduleBeforeRender(t){if("undefined"==typeof window)return qf.schedule(t,0);if(void 0===window.requestAnimationFrame)return qf.schedule(t,16);const e=window.requestAnimationFrame(t);return()=>window.cancelAnimationFrame(e)}};let Xf;function Yf(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(!Xf){const t=Element.prototype;Xf=t.matches||t.matchesSelector||t.mozMatchesSelector||t.msMatchesSelector||t.oMatchesSelector||t.webkitMatchesSelector}return t.nodeType===Node.ELEMENT_NODE&&Xf.call(t,e)}(t,e)||(i=n,0))),i}class Kf{constructor(t,e){this.componentFactory=e.get(Ol).resolveComponentFactory(t)}create(t){return new Qf(this.componentFactory,t)}}class Qf{constructor(t,e){this.componentFactory=t,this.injector=e,this.eventEmitters=new _p(1),this.events=this.eventEmitters.pipe(cp(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(Tu),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=qf.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=qf.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 Jf extends A{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 tg(){}function eg(t,e,n){return function(i){return i.lift(new ng(t,e,n))}}class ng{constructor(t,e,n){this.nextOrObserver=t,this.error=e,this.complete=n}call(t,e){return e.subscribe(new ig(t,this.nextOrObserver,this.error,this.complete))}}class ig extends v{constructor(t,e,n,i){super(t),this._tapNext=tg,this._tapError=tg,this._tapComplete=tg,this._tapError=n||tg,this._tapComplete=i||tg,a(e)?(this._context=this,this._tapNext=e):e&&(this._context=e,this._tapNext=e.next||tg,this._tapError=e.error||tg,this._tapComplete=e.complete||tg)}_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 rg(t,e=Yd){return n=>n.lift(new sg(t,e))}class sg{constructor(t,e){this.dueTime=t,this.scheduler=e}call(t,e){return e.subscribe(new og(t,this.dueTime,this.scheduler))}}class og 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(ag,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 ag(t){t.debouncedNext()}function lg(t){return e=>e.lift(new cg(t))}class cg{constructor(t){this.total=t}call(t,e){return e.subscribe(new ug(t,this.total))}}class ug extends v{constructor(t,e){super(t),this.total=e,this.count=0}_next(t){++this.count>this.total&&this.destination.next(t)}}let hg=(()=>{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})(),dg=(()=>{class t{constructor(t){this._mutationObserverFactory=t,this._observedElements=new Map}ngOnDestroy(){this._observedElements.forEach((t,e)=>this._cleanupObserver(e))}observe(t){const e=Id(t);return new E(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 A,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)(Ei(hg))},t.\u0275prov=xt({factory:function(){return new t(Ei(hg))},token:t,providedIn:"root"}),t})(),pg=(()=>{class t{constructor(t,e,n){this._contentObserver=t,this._elementRef=e,this._ngZone=n,this.event=new Bc,this._disabled=!1,this._currentSubscription=null}get disabled(){return this._disabled}set disabled(t){this._disabled=kd(t),this._disabled?this._unsubscribe():this._subscribe()}get debounce(){return this._debounce}set debounce(t){this._debounce=Pd(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(rg(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(dg),ea(Al),ea(Tu))},t.\u0275dir=se({type:t,selectors:[["","cdkObserveContent",""]],inputs:{disabled:["cdkObserveContentDisabled","disabled"],debounce:"debounce"},outputs:{event:"cdkObserveContent"},exportAs:["cdkObserveContent"]}),t})(),fg=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({providers:[hg]}),t})();function gg(t,e){return(t.getAttribute(e)||"").match(/\S+/g)||[]}const mg="cdk-describedby-message-container",bg="cdk-describedby-message",yg="cdk-describedby-host";let vg=0;const _g=new Map;let wg=null,xg=(()=>{class t{constructor(t){this._document=t}describe(t,e,n){if(!this._canBeDescribed(t,e))return;const i=Sg(e,n);"string"!=typeof e?(Cg(e),_g.set(i,{messageElement:e,referenceCount:0})):_g.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=Sg(e,n);if(this._isElementDescribedByMessage(t,i)&&this._removeMessageReference(t,i),"string"==typeof e){const t=_g.get(i);t&&0===t.referenceCount&&this._deleteMessageElement(i)}wg&&0===wg.childNodes.length&&this._deleteMessagesContainer()}ngOnDestroy(){const t=this._document.querySelectorAll(`[${yg}]`);for(let e=0;e0!=t.indexOf(bg));t.setAttribute("aria-describedby",e.join(" "))}_addMessageReference(t,e){const n=_g.get(e);(function(t,e,n){const i=gg(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(yg,""),n.referenceCount++}_removeMessageReference(t,e){const n=_g.get(e);n.referenceCount--,function(t,e,n){const i=gg(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(yg)}_isElementDescribedByMessage(t,e){const n=gg(t,"aria-describedby"),i=_g.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)(Ei(th))},t.\u0275prov=xt({factory:function(){return new t(Ei(th))},token:t,providedIn:"root"}),t})();function Sg(t,e){return"string"==typeof t?`${e||""}/${t}`:t}function Cg(t){t.id||(t.id=`${bg}-${vg++}`)}class Eg extends class{constructor(t){this._items=t,this._activeItemIndex=-1,this._activeItem=null,this._wrap=!1,this._letterKeyStream=new A,this._typeaheadSubscription=g.EMPTY,this._vertical=!0,this._allowedModifierKeys=[],this._homeAndEnd=!1,this._skipPredicateFn=t=>t.disabled,this._pressedLetters=[],this.tabOut=new A,this.change=new A,t instanceof zc&&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(eg(t=>this._pressedLetters.push(t)),rg(t),ep(()=>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||uf(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 zc?this._items.toArray():this._items}}{setActiveItem(t){this.activeItem&&this.activeItem.setInactiveStyles(),super.setActiveItem(t),this.activeItem&&this.activeItem.setActiveStyles()}}let Og=(()=>{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===kg(e)||!this.isVisible(e)))return!1;let n=t.nodeName.toLowerCase(),i=kg(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")||Tg(t))}(t)&&!this.isDisabled(t)&&((null==e?void 0:e.ignoreVisibility)||this.isVisible(t))}}return t.\u0275fac=function(e){return new(e||t)(Ei(Ep))},t.\u0275prov=xt({factory:function(){return new t(Ei(Ep))},token:t,providedIn:"root"}),t})();function Tg(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 kg(t){if(!Tg(t))return null;const e=parseInt(t.getAttribute("tabindex")||"",10);return isNaN(e)?-1:e}class Pg{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(rf(1)).subscribe(t)}}let Ag=(()=>{class t{constructor(t,e,n){this._checker=t,this._ngZone=e,this._document=n}create(t,e=!1){return new Pg(t,this._checker,this._ngZone,this._document,e)}}return t.\u0275fac=function(e){return new(e||t)(Ei(Og),Ei(Tu),Ei(th))},t.\u0275prov=xt({factory:function(){return new t(Ei(Og),Ei(Tu),Ei(th))},token:t,providedIn:"root"}),t})();function Mg(t){return 0===t.offsetX&&0===t.offsetY}function Ig(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 Dg=new oi("cdk-input-modality-detector-options"),Rg={ignoreKeys:[18,17,224,91,16]},Ng=Ip({passive:!0,capture:!0});let Lg=(()=>{class t{constructor(t,e,n,i){this._platform=t,this._mostRecentTarget=null,this._modality=new Jf(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=Lp(t))},this._onMousedown=t=>{Date.now()-this._lastTouchMs<650||(this._modality.next(Mg(t)?"keyboard":"mouse"),this._mostRecentTarget=Lp(t))},this._onTouchstart=t=>{Ig(t)?this._modality.next("keyboard"):(this._lastTouchMs=Date.now(),this._modality.next("touch"),this._mostRecentTarget=Lp(t))},this._options=Object.assign(Object.assign({},Rg),i),this.modalityDetected=this._modality.pipe(lg(1)),this.modalityChanged=this.modalityDetected.pipe(Wd()),t.isBrowser&&e.runOutsideAngular(()=>{n.addEventListener("keydown",this._onKeydown,Ng),n.addEventListener("mousedown",this._onMousedown,Ng),n.addEventListener("touchstart",this._onTouchstart,Ng)})}get mostRecentModality(){return this._modality.value}ngOnDestroy(){!this._platform.isBrowser||(document.removeEventListener("keydown",this._onKeydown,Ng),document.removeEventListener("mousedown",this._onMousedown,Ng),document.removeEventListener("touchstart",this._onTouchstart,Ng))}}return t.\u0275fac=function(e){return new(e||t)(Ei(Ep),Ei(Tu),Ei(th),Ei(Dg,8))},t.\u0275prov=xt({factory:function(){return new t(Ei(Ep),Ei(Tu),Ei(th),Ei(Dg,8))},token:t,providedIn:"root"}),t})();const jg=new oi("liveAnnouncerElement",{providedIn:"root",factory:function(){return null}}),Fg=new oi("LIVE_ANNOUNCER_DEFAULT_OPTIONS");let Bg=(()=>{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 A,this._rootNodeFocusAndBlurListener=t=>{const e=Lp(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=Id(t);if(!this._platform.isBrowser||1!==n.nodeType)return Dd(null);const i=Rp(n)||this._getDocument(),r=this._elementInfo.get(n);if(r)return e&&(r.checkChildren=!0),r.subject;const s={checkChildren:e,subject:new A,rootNode:i};return this._elementInfo.set(n,s),this._registerGlobalListeners(s),s.subject}stopMonitoring(t){const e=Id(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=Id(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=Lp(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,zg),e.addEventListener("blur",this._rootNodeFocusAndBlurListener,zg)}),this._rootNodeFocusListenerCount.set(e,n+1),1==++this._monitoredElementCount&&(this._ngZone.runOutsideAngular(()=>{this._getWindow().addEventListener("focus",this._windowFocusListener)}),this._inputModalityDetector.modalityDetected.pipe(rp(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,zg),e.removeEventListener("blur",this._rootNodeFocusAndBlurListener,zg),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)(Ei(Tu),Ei(Ep),Ei(Lg),Ei(th,8),Ei(Vg,8))},t.\u0275prov=xt({factory:function(){return new t(Ei(Tu),Ei(Ep),Ei(Lg),Ei(th,8),Ei(Vg,8))},token:t,providedIn:"root"}),t})();const Hg="cdk-high-contrast-black-on-white",$g="cdk-high-contrast-white-on-black",Gg="cdk-high-contrast-active";let Wg=(()=>{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(Gg),t.remove(Hg),t.remove($g),this._hasCheckedHighContrastMode=!0;const e=this.getHighContrastMode();1===e?(t.add(Gg),t.add(Hg)):2===e&&(t.add(Gg),t.add($g))}}}return t.\u0275fac=function(e){return new(e||t)(Ei(Ep),Ei(th))},t.\u0275prov=xt({factory:function(){return new t(Ei(Ep),Ei(th))},token:t,providedIn:"root"}),t})(),qg=(()=>{class t{constructor(t){t._applyBodyHighContrastModeCssClasses()}}return t.\u0275fac=function(e){return new(e||t)(Ei(Wg))},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Op,fg]]}),t})();const Xg=new Ll("12.2.5");class Yg{}const Kg="*";function Qg(t,e){return{type:7,name:t,definitions:e,options:{}}}function Zg(t,e=null){return{type:4,styles:e,timings:t}}function Jg(t,e=null){return{type:2,steps:t,options:e}}function tm(t){return{type:6,styles:t,offset:null}}function em(t,e,n){return{type:0,name:t,styles:e,options:n}}function nm(t){return{type:5,steps:t}}function im(t,e,n=null){return{type:1,expr:t,animation:e,options:n}}function rm(t=null){return{type:9,options:t}}function sm(t,e,n=null){return{type:11,selector:t,animation:e,options:n}}function om(t){Promise.resolve(null).then(t)}class am{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(){om(()=>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 lm{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?om(()=>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 cm(){return"undefined"!=typeof window&&void 0!==window.document}function um(){return"undefined"!=typeof process&&"[object process]"==={}.toString.call(process)}function hm(t){switch(t.length){case 0:return new am;case 1:return t[0];default:return new lm(t)}}function dm(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 Kg: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 pm(t,e,n,i){switch(e){case"start":t.onStart(()=>i(n&&fm(n,"start",t)));break;case"done":t.onDone(()=>i(n&&fm(n,"done",t)));break;case"destroy":t.onDestroy(()=>i(n&&fm(n,"destroy",t)))}}function fm(t,e,n){const i=n.totalTime,r=gm(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 gm(t,e,n,i,r="",s=0,o){return{element:t,triggerName:e,fromState:n,toState:i,phaseName:r,totalTime:s,disabled:!!o}}function mm(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 bm(t){const e=t.indexOf(":");return[t.substring(1,e),t.substr(e+1)]}let ym=(t,e)=>!1,vm=(t,e)=>!1,_m=(t,e,n)=>[];const wm=um();(wm||"undefined"!=typeof Element)&&(ym=cm()?(t,e)=>{for(;e&&e!==document.documentElement;){if(e===t)return!0;e=e.parentNode||e.host}return!1}:(t,e)=>t.contains(e),vm=(()=>{if(wm||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]):vm}})(),_m=(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 Pm=(()=>{class t{validateStyleProperty(t){return Cm(t)}matchesElement(t,e){return Em(t,e)}containsElement(t,e){return Om(t,e)}query(t,e,n){return Tm(t,e,n)}computeStyle(t,e,n){return n||""}animate(t,e,n,i,r,s=[],o){return new am(n,i)}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();class Am{}Am.NOOP=new Pm;const Mm="ng-enter",Im="ng-leave",Dm="ng-trigger",Rm=".ng-trigger",Nm="ng-animating",Lm=".ng-animating";function jm(t){if("number"==typeof t)return t;const e=t.match(/^(-?[\.\d]+)(m?s)/);return!e||e.length<2?0:Fm(parseFloat(e[1]),e[2])}function Fm(t,e){switch(e){case"s":return 1e3*t;default:return t}}function Bm(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=Fm(parseFloat(n[1]),n[2]);const o=n[3];null!=o&&(r=Fm(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 Vm(t,e={}){return Object.keys(t).forEach(n=>{e[n]=t[n]}),e}function zm(t,e,n={}){if(e)for(let i in t)n[i]=t[i];else Vm(t,n);return n}function Um(t,e,n){return n?e+":"+n+";":""}function Hm(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]}),um()&&Hm(t))}function Gm(t,e){t.style&&(Object.keys(e).forEach(e=>{const n=Zm(e);t.style[n]=""}),um()&&Hm(t))}function Wm(t){return Array.isArray(t)?1==t.length?t[0]:Jg(t):t}const qm=new RegExp("{{\\s*(.+?)\\s*}}","g");function Xm(t){let e=[];if("string"==typeof t){let n;for(;n=qm.exec(t);)e.push(n[1]);qm.lastIndex=0}return e}function Ym(t,e,n){const i=t.toString(),r=i.replace(qm,(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 Km(t){const e=[];let n=t.next();for(;!n.done;)e.push(n.value),n=t.next();return e}const Qm=/-+([a-z0-9])/g;function Zm(t){return t.replace(Qm,(...t)=>t[1].toUpperCase())}function Jm(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function tb(t,e){return 0===t||0===e}function eb(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(ab(r,o));"<"==s[0]&&!("*"==r&&"*"==o)&&e.push(ab(o,r))}(t,n,e)):n.push(t),n}const sb=new Set(["true","1"]),ob=new Set(["false","0"]);function ab(t,e){const n=sb.has(t)||ob.has(t),i=sb.has(e)||ob.has(e);return(r,s)=>{let o="*"==t||t==r,a="*"==e||e==s;return!o&&n&&"boolean"==typeof r&&(o=r?sb.has(t):ob.has(t)),!a&&i&&"boolean"==typeof s&&(a=s?sb.has(e):ob.has(e)),o&&a}}const lb=new RegExp("s*:selfs*,?","g");function cb(t,e,n){return new ub(t).build(e,n)}class ub{constructor(t){this._driver=t}build(t,e){const n=new hb(e);return this._resetContextStyleTimingState(n),nb(this,Wm(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(db(t)){const e=t;Object.keys(e).forEach(t=>{Xm(e[t]).forEach(t=>{s.hasOwnProperty(t)||r.add(t)})})}}),r.size){const n=Km(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=nb(this,Wm(t.animation),e);return{type:1,matchers:rb(t.expr,e.errors),animation:n,queryCount:e.queryCount,depCount:e.depCount,options:pb(t.options)}}visitSequence(t,e){return{type:2,steps:t.steps.map(t=>nb(this,t,e)),options:pb(t.options)}}visitGroup(t,e){const n=e.currentTime;let i=0;const r=t.steps.map(t=>{e.currentTime=n;const r=nb(this,t,e);return i=Math.max(i,e.currentTime),r});return e.currentTime=i,{type:3,steps:r,options:pb(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 fb(Bm(t,e).duration,0,"");const i=t;if(i.split(/\s+/).some(t=>"{"==t.charAt(0)&&"{"==t.charAt(1))){const t=fb(0,0,"");return t.dynamic=!0,t.strValue=i,t}return n=n||Bm(i,e),fb(n.duration,n.delay,n.easing)}(t.timings,e.errors);e.currentAnimateTimings=n;let i,r=t.styles?t.styles:tm({});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=tm(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==Kg?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(db(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=Xm(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(db(t)&&t.hasOwnProperty("offset")){const n=t;e=parseFloat(n.offset),delete n.offset}});else if(db(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:nb(this,Wm(t.animation),e),options:pb(t.options)}}visitAnimateChild(t,e){return e.depCount++,{type:9,options:pb(t.options)}}visitAnimateRef(t,e){return{type:10,animation:this.visitReference(t.animation,e),options:pb(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(lb,"")),[t=t.replace(/@\*/g,Rm).replace(/@\w+/g,t=>Rm+"-"+t.substr(1)).replace(/:animating/g,Lm),e]}(t.selector);e.currentQuerySelector=n.length?n+" "+r:r,mm(e.collectedStyles,e.currentQuerySelector,{});const o=nb(this,Wm(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:pb(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"}:Bm(t.timings,e.errors,!0);return{type:12,animation:nb(this,Wm(t.animation),e),timings:n,options:null}}}class hb{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 db(t){return!Array.isArray(t)&&"object"==typeof t}function pb(t){return t?(t=Vm(t)).params&&(t.params=function(t){return t?Vm(t):null}(t.params)):t={},t}function fb(t,e,n){return{duration:t,delay:e,easing:n}}function gb(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 mb{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 bb=new RegExp(":enter","g"),yb=new RegExp(":leave","g");function vb(t,e,n,i,r,s={},o={},a,l,c=[]){return(new _b).buildKeyframes(t,e,n,i,r,s,o,a,l,c)}class _b{buildKeyframes(t,e,n,i,r,s,o,a,l,c=[]){l=l||new mb;const u=new xb(t,e,l,i,r,c,[]);u.options=a,u.currentTimeline.setStyles([s],null,u.errors,a),nb(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()):[gb(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?jm(n.duration):null,s=null!=n.delay?jm(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),nb(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=wb);const t=jm(r.delay);i.delayNextStep(t)}t.steps.length&&(t.steps.forEach(t=>nb(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?jm(t.options.delay):0;t.steps.forEach(s=>{const o=e.createSubContext(t.options);r&&o.delayNextStep(r),nb(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 Bm(e.params?Ym(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?jm(i.delay):0;r&&(6===e.previousNode.type||0==n&&e.currentTimeline.getCurrentStyleProperties().length)&&(e.currentTimeline.snapshotCurrentStyles(),e.previousNode=wb);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),nb(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;nb(this,t.animation,e),e.previousNode=t,n.currentStaggerTime=i.currentTime-c+(i.startTime-n.currentTimeline.startTime)}}const wb={};class xb{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=wb,this.subContextCount=0,this.options={},this.currentQueryIndex=0,this.currentQueryTotal=0,this.currentStaggerTime=0,this.currentTimeline=a||new Sb(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=jm(n.duration)),null!=n.delay&&(i.delay=jm(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]=Ym(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 xb(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=wb,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 Cb(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(bb,"."+this._enterClassName)).replace(yb,"."+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 Sb{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 Sb(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]||Kg,this._currentKeyframe[t]=Kg}),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]=Kg})):zm(t,!1,n)}),n}(t,this._globalTimelineStyles);Object.keys(s).forEach(t=>{const e=Ym(s[t],r,n);this._pendingStyles[t]=e,this._localTimelineStyles.hasOwnProperty(t)||(this._backFill[t]=this._globalTimelineStyles.hasOwnProperty(t)?this._globalTimelineStyles[t]:Kg),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=zm(r,!0);Object.keys(o).forEach(n=>{const i=o[n];"!"==i?t.add(n):i==Kg&&e.add(n)}),n||(o.offset=s/this.duration),i.push(o)});const r=t.size?Km(t.values()):[],s=e.size?Km(e.values()):[];if(n){const t=i[0],e=Vm(t);t.offset=0,e.offset=1,i=[t,e]}return gb(this.element,i,r,s,this.duration,this.startTime,this.easing,!1)}}class Cb extends Sb{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=zm(t[0],!1);a.offset=0,r.push(a);const l=zm(t[0],!1);l.offset=Eb(o),r.push(l);const c=t.length-1;for(let i=1;i<=c;i++){let o=zm(t[i],!1);o.offset=Eb((e+o.offset*n)/s),r.push(o)}n=s,e=0,i="",t=r}return gb(this.element,t,this.preStyleProps,this.postStyleProps,n,e,i,!0)}}function Eb(t,e=3){const n=Math.pow(10,e-1);return Math.round(t*n)/n}class Ob{}class Tb extends Ob{normalizePropertyName(t,e){return Zm(t)}normalizeStyleValue(t,e,n,i){let r="";const s=n.toString().trim();if(kb[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 kb=(()=>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 Pb(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 Ab={};class Mb{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||Ab,d=this.buildStyles(n,o&&o.params||Ab,u),p=a&&a.params||Ab,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?[]:vb(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 Pb(e,this._triggerName,n,i,y,d,f,[],[],m,b,w,u);_.forEach(t=>{const n=t.element,i=mm(m,n,{});t.preStyleProps.forEach(t=>i[t]=!0);const r=mm(b,n,{});t.postStyleProps.forEach(t=>r[t]=!0),n!==e&&g.add(n)});const x=Km(g.values());return Pb(e,this._triggerName,n,i,y,d,f,_,x,m,b,w)}}class Ib{constructor(t,e,n){this.styles=t,this.defaultParams=e,this.normalizer=n}buildStyles(t,e){const n={},i=Vm(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=Ym(s,i,e));const o=this.normalizer.normalizePropertyName(t,e);s=this.normalizer.normalizeStyleValue(t,o,s,e),n[o]=s})}}),n}}class Db{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 Ib(t.style,t.options&&t.options.params||{},n)}),Rb(this.states,"true","1"),Rb(this.states,"false","0"),e.transitions.forEach(e=>{this.transitionFactories.push(new Mb(t,e,this.states))}),this.fallbackTransition=function(t,e,n){return new Mb(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 Rb(t,e,n){t.hasOwnProperty(e)?t.hasOwnProperty(n)||(t[n]=t[e]):t.hasOwnProperty(n)&&(t[e]=t[n])}const Nb=new mb;class Lb{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=cb(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=dm(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=vb(this._driver,e,r,Mm,Im,{},{},n,Nb,i),s.forEach(t=>{const e=mm(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,Kg)})});const a=hm(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=gm(e,"","","");return pm(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 jb="ng-animate-queued",Fb="ng-animate-disabled",Bb=".ng-animate-disabled",Vb=[],zb={namespaceId:"",setForRemoval:!1,setForMove:!1,hasAnimation:!1,removedBeforeQueried:!1},Ub={namespaceId:"",setForMove:!1,setForRemoval:!1,hasAnimation:!1,removedBeforeQueried:!0},Hb="__ng_removed";class $b{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=Vm(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 Gb="void",Wb=new $b(Gb);class qb{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,ey(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=mm(this._elementListeners,t,[]),s={name:e,phase:n,callback:i};r.push(s);const o=mm(this._engine.statesByElement,t,{});return o.hasOwnProperty(e)||(ey(t,Dm),ey(t,Dm+"-"+e),o[e]=Wb),()=>{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 Yb(this.id,e,t);let o=this._engine.statesByElement.get(t);o||(ey(t,Dm),ey(t,Dm+"-"+e),this._engine.statesByElement.set(t,o={}));let a=o[e];const l=new $b(n,this.id);if(!(n&&n.hasOwnProperty("value"))&&a&&l.absorbOptions(a.options),o[e]=l,a||(a=Wb),l.value!==Gb&&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{Gm(t,n),$m(t,i)})}return}const c=mm(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||(ey(t,jb),s.onStart(()=>{ny(t,jb)})),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,Rm,!0);n.forEach(t=>{if(t[Hb])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,Gb,i);n&&s.push(n)}}),s.length)return this._engine.markElementAsRemoved(this.id,t,!0,e),n&&hm(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]||Wb,a=new $b(Gb),l=new Yb(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[Hb];(!i||i===zb)&&(n.afterFlush(()=>this.clearElementCache(t)),n.destroyInnerAnimations(t),n._onRemovalComplete(t,e))}}insertNode(t,e){ey(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=gm(r,n.triggerName,n.fromState.value,n.toState.value);i._data=t,pm(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 Xb{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 qb(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),ey(t,Fb)):this.disabledNodes.has(t)&&(this.disabledNodes.delete(t),ny(t,Fb))}removeNode(t,e,n,i){if(Kb(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[Hb]={namespaceId:t,setForRemoval:i,hasAnimation:n,removedBeforeQueried:!1}}listen(t,e,n,i,r){return Kb(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,Rm,!0);e.forEach(t=>this.destroyActiveAnimationsForElement(t)),0!=this.playersByQueriedElement.size&&(e=this.driver.query(t,Lm,!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 hm(this.players).onDone(()=>t());t()})}processLeaveNode(t){const e=t[Hb];if(e&&e.setForRemoval){if(t[Hb]=zb,e.namespaceId){this.destroyInnerAnimations(t);const n=this._fetchNamespace(e.namespaceId);n&&n.clearElementCache(t)}this._onRemovalComplete(t,e.setForRemoval)}this.driver.matchesElement(t,Bb)&&this.markElementAsDisabled(t,!1),this.driver.query(t,Bb,!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?hm(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 mb,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=Mm+f++;p.set(e,n),t.forEach(t=>ey(t,n))});const g=[],m=new Set,b=new Set;for(let A=0;Am.add(t)):b.add(t))}const y=new Map,v=Jb(h,Array.from(m));v.forEach((t,e)=>{const n=Im+f++;y.set(e,n),t.forEach(t=>ey(t,n))}),t.push(()=>{d.forEach((t,e)=>{const n=p.get(e);t.forEach(t=>ny(t,n))}),v.forEach((t,e)=>{const n=y.get(e);t.forEach(t=>ny(t,n))}),g.forEach(t=>{this.processLeaveNode(t)})});const _=[],w=[];for(let A=this._namespaceList.length-1;A>=0;A--)this._namespaceList[A].drainQueuedTransitions(e).forEach(t=>{const e=t.player,r=t.element;if(_.push(e),this.collectedEnterElements.length){const t=r[Hb];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(()=>Gm(r,f.fromStyles)),e.onDestroy(()=>$m(r,f.toStyles)),void i.push(e);if(t.isFallbackTransition)return e.onStart(()=>Gm(r,f.fromStyles)),e.onDestroy(()=>$m(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=>mm(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=>{mm(x,e,[]).push(t),t.destroy()})});const C=g.filter(t=>sy(t,a,l)),E=new Map;Zb(E,this.driver,b,l,Kg).forEach(t=>{sy(t,a,l)&&C.push(t)});const O=new Map;d.forEach((t,e)=>{Zb(O,this.driver,new Set(t),a,"!")}),C.forEach(t=>{const e=E.get(t),n=O.get(t);E.set(t,Object.assign(Object.assign({},e),n))});const T=[],k=[],P={};s.forEach(t=>{const{element:e,player:s,instruction:o}=t;if(n.has(e)){if(c.has(e))return s.onDestroy(()=>$m(e,o.toStyles)),s.disabled=!0,s.overrideTotalTime(o.totalTime),void i.push(s);let t=P;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,E);if(s.setRealPlayer(n),t===P)T.push(s);else{const e=this.playersByElement.get(t);e&&e.length&&(s.parentPlayer=hm(e)),i.push(s)}}else Gm(e,o.fromStyles),s.onDestroy(()=>$m(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=hm(e);t.setRealPlayer(n)}}),i.forEach(t=>{t.parentPlayer?t.syncPlayerEvents(t.parentPlayer):t.destroy()});for(let A=0;A!t.destroyed);i.length?iy(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[Hb];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==Gb;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=mm(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)})}Gm(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[Hb];if(d&&d.removedBeforeQueried)return new am(e.duration,e.delay);const p=h!==a,f=function(t){const e=[];return ry(t,e),e}((n.get(h)||Vb).map(t=>t.getRealPlayer())).filter(t=>!!t.element&&t.element===h),g=r.get(h),m=s.get(h),b=dm(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 Yb(t,o,h);e.setRealPlayer(y),l.push(e)}return y});l.forEach(t=>{mm(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=>ey(t,Nm));const d=hm(h);return d.onDestroy(()=>{c.forEach(t=>ny(t,Nm)),$m(a,e.toStyles)}),u.forEach(t=>{mm(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 am(t.duration,t.delay)}}class Yb{constructor(t,e,n){this.namespaceId=t,this.triggerName=e,this.element=n,this._player=new am,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=>pm(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){mm(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 Kb(t){return t&&1===t.nodeType}function Qb(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(Qb(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[Hb]=Ub,o.push(i))}),t.set(i,s)});let a=0;return n.forEach(t=>Qb(t,s[a++])),o}function Jb(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 ty="$$classes";function ey(t,e){if(t.classList)t.classList.add(e);else{let n=t[ty];n||(n=t[ty]={}),n[e]=!0}}function ny(t,e){if(t.classList)t.classList.remove(e);else{let n=t[ty];n&&delete n[e]}}function iy(t,e,n){hm(n).onDone(()=>t.processLeaveNode(e))}function ry(t,e){for(let n=0;nr.add(t)):e.set(t,i),n.delete(t),!0}class oy{constructor(t,e,n){this.bodyNode=t,this._driver=e,this._normalizer=n,this._triggerCache={},this.onRemovalComplete=(t,e)=>{},this._transitionEngine=new Xb(t,e,n),this._timelineEngine=new Lb(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=cb(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 Db(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]=bm(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]=bm(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 ay(t,e){let n=null,i=null;return Array.isArray(e)&&e.length?(n=cy(e[0]),e.length>1&&(i=cy(e[e.length-1]))):e&&(n=cy(e)),n||i?new ly(t,n,i):null}class ly{constructor(t,e,n){this._element=t,this._startStyles=e,this._endStyles=n,this._state=0;let i=ly.initialStylesByElement.get(t);i||ly.initialStylesByElement.set(t,i={}),this._initialStyles=i}start(){this._state<1&&(this._startStyles&&$m(this._element,this._startStyles,this._initialStyles),this._state=1)}finish(){this.start(),this._state<2&&($m(this._element,this._initialStyles),this._endStyles&&($m(this._element,this._endStyles),this._endStyles=null),this._state=1)}destroy(){this.finish(),this._state<3&&(ly.initialStylesByElement.delete(this._element),this._startStyles&&(Gm(this._element,this._startStyles),this._endStyles=null),this._endStyles&&(Gm(this._element,this._endStyles),this._endStyles=null),$m(this._element,this._initialStyles),this._state=3)}}function cy(t){let e=null;const n=Object.keys(t);for(let i=0;ithis._handleCallback(t)}apply(){(function(t,e){const n=vy(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(),by(this._element,this._eventFn,!0))}destroy(){this._destroyed||(this._destroyed=!0,this.finish(),function(t,e){const n=vy(t,"").split(","),i=my(n,e);i>=0&&(n.splice(i,1),yy(t,"",n.join(",")))}(this._element,this._name))}}function fy(t,e,n){yy(t,"PlayState",n,gy(t,e))}function gy(t,e){const n=vy(t,"");return n.indexOf(",")>0?my(n.split(","),e):my([n],e)}function my(t,e){for(let n=0;n=0)return n;return-1}function by(t,e,n){n?t.removeEventListener(dy,e):t.addEventListener(dy,e)}function yy(t,e,n,i){const r=hy+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 vy(t,e){return t.style[hy+e]||""}class _y{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 py(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]:ib(this.element,n))})}this.currentSnapshot=t}}class wy extends am{constructor(t,e){super(),this.element=t,this._startingStyles={},this.__initialized=!1,this._styles=km(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 xy{constructor(){this._count=0}validateStyleProperty(t){return Cm(t)}matchesElement(t,e){return Em(t,e)}containsElement(t,e){return Om(t,e)}query(t,e,n){return Tm(t,e,n)}computeStyle(t,e,n){return window.getComputedStyle(t)[e]}buildKeyframeElement(t,e,n){n=n.map(t=>km(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 _y),l={};tb(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=eb(t,e,l));if(0==n)return new wy(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=ay(t,e),p=new _y(t,e,u,n,i,r,c,d);return p.onDestroy(()=>function(t){t.parentNode.removeChild(t)}(h)),p}}class Sy{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]:ib(this.element,e))}),this.currentSnapshot=t}triggerCallback(t){const e="start"==t?this._onStartFns:this._onDoneFns;e.forEach(t=>t()),e.length=0}}class Cy{constructor(){this._isNativeImpl=/\{\s*\[native\s+code\]\s*\}/.test(Ey().toString()),this._cssKeyframesDriver=new xy}validateStyleProperty(t){return Cm(t)}matchesElement(t,e){return Em(t,e)}containsElement(t,e){return Om(t,e)}query(t,e,n){return Tm(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 Sy);tb(n,i)&&c.forEach(t=>{let e=t.currentSnapshot;Object.keys(e).forEach(t=>l[t]=e[t])});const u=ay(t,e=eb(t,e=e.map(t=>zm(t,!1)),l));return new Sy(t,e,a,u)}}function Ey(){return cm()&&Element.prototype.animate||{}}let Oy=(()=>{class t extends Yg{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)?Jg(t):t;return Py(this._renderer,null,e,"register",[n]),new Ty(e,this._renderer)}}return t.\u0275fac=function(e){return new(e||t)(Ei(Il),Ei(th))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();class Ty extends class{}{constructor(t,e){super(),this._id=t,this._renderer=e}create(t,e){return new ky(this._id,t,e||{},this._renderer)}}class ky{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 Py(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 Py(t,e,n,i,r){return t.setProperty(e,`@@${n}:${i}`,r)}const Ay="@.disabled";let My=(()=>{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 Iy("",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 Dy(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)(Ei(Il),Ei(oy),Ei(Tu))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();class Iy{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==Ay?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 Dy extends Iy{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==Ay?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 Ry=(()=>{class t extends oy{constructor(t,e,n){super(t.body,e,n)}ngOnDestroy(){this.flush()}}return t.\u0275fac=function(e){return new(e||t)(Ei(th),Ei(Am),Ei(Ob))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();const Ny=new oi("AnimationModuleType"),Ly=[{provide:Yg,useClass:Oy},{provide:Ob,useFactory:function(){return new Tb}},{provide:oy,useClass:Ry},{provide:Il,useFactory:function(t,e,n){return new My(t,e,n)},deps:[pd,oy,Tu]}],jy=[{provide:Am,useFactory:function(){return"function"==typeof Ey()?new Cy:new xy}},{provide:Ny,useValue:"BrowserAnimations"},...Ly],Fy=[{provide:Am,useClass:Pm},{provide:Ny,useValue:"NoopAnimations"},...Ly];let By=(()=>{class t{static withConfig(e){return{ngModule:t,providers:e.disableAnimations?Fy:jy}}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({providers:jy,imports:[Td]}),t})();function Vy(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 zy(t,e){if(1&t&&(ra(0,"span",5),Ja(1),sa()),2&t){const t=va();ws(1),el("(",t.group.label,")")}}const Uy=["*"],Hy=new Ll("12.2.5"),$y=new oi("mat-sanity-checks",{providedIn:"root",factory:function(){return!0}});let Gy,Wy=(()=>{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!(!Vu()||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")&&Hy.full!==Xg.full&&console.warn("The Angular Material version ("+Hy.full+") does not match the Angular CDK version ("+Xg.full+").\nPlease ensure the versions of these two packages exactly match.")}}return t.\u0275fac=function(e){return new(e||t)(Ei(Wg),Ei($y,8),Ei(th))},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Bp],Bp]}),t})();function qy(t){return class extends t{constructor(...t){super(...t),this._disabled=!1}get disabled(){return this._disabled}set disabled(t){this._disabled=kd(t)}}}function Xy(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 Yy(t){return class extends t{constructor(...t){super(...t),this._disableRipple=!1}get disableRipple(){return this._disableRipple}set disableRipple(t){this._disableRipple=kd(t)}}}function Ky(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?Pd(t):this.defaultTabIndex}}}function Qy(t){return class extends t{constructor(...t){super(...t),this.stateChanges=new A,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{Gy="undefined"!=typeof Intl}catch(m){Gy=!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})(),Jy=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275dir=se({type:t,selectors:[["","mat-line",""],["","matLine",""]],hostAttrs:[1,"mat-line"]}),t})();function tv(t,e,n){const i=t.nativeElement.classList;n?i.add(e):i.remove(e)}let ev=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Wy],Wy]}),t})();class nv{constructor(t,e,n){this._renderer=t,this.element=e,this.config=n,this.state=3}fadeOut(){this._renderer.fadeOutRipple(this)}}const iv={enterDuration:225,exitDuration:150},rv=Ip({passive:!0}),sv=["mousedown","touchstart"],ov=["mouseup","mouseleave","touchend","touchcancel"];class av{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=Id(n))}fadeInRipple(t,e,n={}){const i=this._containerRect=this._containerRect||this._containerElement.getBoundingClientRect(),r=Object.assign(Object.assign({},iv),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 nv(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({},iv),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=Id(t);!e||e===this._triggerElement||(this._removeTriggerEvents(),this._triggerElement=e,this._registerEvents(sv))}handleEvent(t){"mousedown"===t.type?this._onMousedown(t):"touchstart"===t.type?this._onTouchStart(t):this._onPointerUp(),this._pointerUpEventsRegistered||(this._registerEvents(ov),this._pointerUpEventsRegistered=!0)}_onMousedown(t){const e=Mg(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,rv)})})}_removeTriggerEvents(){this._triggerElement&&(sv.forEach(t=>{this._triggerElement.removeEventListener(t,this,rv)}),this._pointerUpEventsRegistered&&ov.forEach(t=>{this._triggerElement.removeEventListener(t,this,rv)}))}}const lv=new oi("mat-ripple-global-options");let cv=(()=>{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 av(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(Al),ea(Tu),ea(Ep),ea(lv,8),ea(Ny,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})(),uv=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Wy,Op],Wy]}),t})(),hv=(()=>{class t{constructor(t){this._animationMode=t,this.state="unchecked",this.disabled=!1}}return t.\u0275fac=function(e){return new(e||t)(ea(Ny,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})(),dv=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Wy]]}),t})();const pv=new oi("MAT_OPTION_PARENT_COMPONENT"),fv=qy(class{});let gv=0,mv=(()=>{class t extends fv{constructor(t){var e;super(),this._labelId="mat-optgroup-label-"+gv++,this._inert=null!==(e=null==t?void 0:t.inertGroups)&&void 0!==e&&e}}return t.\u0275fac=function(e){return new(e||t)(ea(pv,8))},t.\u0275dir=se({type:t,inputs:{label:"label"},features:[jo]}),t})();const bv=new oi("MatOptgroup");let yv=0;class vv{constructor(t,e=!1){this.source=t,this.isUserInput=e}}let _v=(()=>{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-"+yv++,this.onSelectionChange=new Bc,this._stateChanges=new A}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=kd(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)&&!uf(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 vv(this,t))}}return t.\u0275fac=function(e){return new(e||t)(ea(Al),ea(nc),ea(void 0),ea(mv))},t.\u0275dir=se({type:t,inputs:{id:"id",disabled:"disabled",value:"value"},outputs:{onSelectionChange:"onSelectionChange"}}),t})(),wv=(()=>{class t extends _v{constructor(t,e,n,i){super(t,e,n,i)}}return t.\u0275fac=function(e){return new(e||t)(ea(Al),ea(nc),ea(pv,8),ea(bv,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&&(rl("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: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(t,e){1&t&&(wa(),Jo(0,Vy,1,2,"mat-pseudo-checkbox",0),ra(1,"span",1),xa(2),sa(),Jo(3,zy,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:[Ah,cv,hv],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 xv(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 Cv=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[uv,Wh,Wy,dv]]}),t})();function Ev(...t){if(1===t.length){const e=t[0];if(d(e))return Ov(e,null);if(p(e)&&Object.getPrototypeOf(e)===Object.prototype){const t=Object.keys(e);return Ov(t.map(t=>e[t]),t)}}if("function"==typeof t[t.length-1]){const e=t.pop();return Ov(t=1===t.length&&d(t[0])?t[0]:t,null).pipe(D(t=>e(...t)))}return Ov(t,null)}function Ov(t,e){return new E(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 Tv(t){return function(e){const n=new kv(t),i=e.lift(n);return n.caught=i}}class kv{constructor(t){this.selector=t}call(t,e){return e.subscribe(new Pv(t,this.selector,this.caught))}}class Pv 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 Av(t){return e=>e.lift(new Mv(t))}class Mv{constructor(t){this.callback=t}call(t,e){return e.subscribe(new Iv(t,this.callback))}}class Iv extends v{constructor(t,e){super(t),this.add(new g(e))}}class Dv{}class Rv{}class Nv{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 Nv?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 Nv;return e.lazyInit=this.lazyInit&&this.lazyInit instanceof Nv?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 Lv{encodeKey(t){return Bv(t)}encodeValue(t){return Bv(t)}decodeKey(t){return decodeURIComponent(t)}decodeValue(t){return decodeURIComponent(t)}}const jv=/%(\d[a-f0-9])/gi,Fv={40:"@","3A":":",24:"$","2C":",","3B":";","2B":"+","3D":"=","3F":"?","2F":"/"};function Bv(t){return encodeURIComponent(t).replace(jv,(t,e)=>{var n;return null!==(n=Fv[e])&&void 0!==n?n:t})}function Vv(t){return`${t}`}class zv{constructor(t={}){if(this.updates=null,this.cloneFrom=null,this.encoder=t.encoder||new Lv,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 zv({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(Vv(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(Vv(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 Uv{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 Hv(t){return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer}function $v(t){return"undefined"!=typeof Blob&&t instanceof Blob}function Gv(t){return"undefined"!=typeof FormData&&t instanceof FormData}class Wv{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 Nv),this.context||(this.context=new Uv),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 Wv(n,i,s,{params:c,headers:l,context:u,reportProgress:a,responseType:r,withCredentials:o})}}var qv=(()=>((qv=qv||{})[qv.Sent=0]="Sent",qv[qv.UploadProgress=1]="UploadProgress",qv[qv.ResponseHeader=2]="ResponseHeader",qv[qv.DownloadProgress=3]="DownloadProgress",qv[qv.Response=4]="Response",qv[qv.User=5]="User",qv))();class Xv{constructor(t,e=200,n="OK"){this.headers=t.headers||new Nv,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 Yv extends Xv{constructor(t={}){super(t),this.type=qv.ResponseHeader}clone(t={}){return new Yv({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 Kv extends Xv{constructor(t={}){super(t),this.type=qv.Response,this.body=void 0!==t.body?t.body:null}clone(t={}){return new Kv({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 Qv extends Xv{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 Zv(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 Jv=(()=>{class t{constructor(t){this.handler=t}request(t,e,n={}){let i;if(t instanceof Wv)i=t;else{let r,s;r=n.headers instanceof Nv?n.headers:new Nv(n.headers),n.params&&(s=n.params instanceof zv?n.params:new zv({fromObject:n.params})),i=new Wv(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=Dd(i).pipe(function(t,e){return W(t,e,1)}(t=>this.handler.handle(t)));if(t instanceof Wv||"events"===n.observe)return r;const s=r.pipe(ep(t=>t instanceof Kv));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 zv).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,Zv(n,e))}post(t,e,n={}){return this.request("POST",t,Zv(n,e))}put(t,e,n={}){return this.request("PUT",t,Zv(n,e))}}return t.\u0275fac=function(e){return new(e||t)(Ei(Dv))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();class t_{constructor(t,e){this.next=t,this.interceptor=e}handle(t){return this.interceptor.intercept(t,this.next)}}const e_=new oi("HTTP_INTERCEPTORS");let n_=(()=>{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 i_=/^\)\]\}',?\n/;let r_=(()=>{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 E(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 Nv(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 Yv({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(i_,"");try{l=""!==l?JSON.parse(l):null}catch(u){l=t,c&&(c=!1,l={error:u,text:l})}}c?(e.next(new Kv({body:l,headers:i,status:r,statusText:o,url:a||void 0})),e.complete()):e.error(new Qv({error:l,headers:i,status:r,statusText:o,url:a||void 0}))},a=t=>{const{url:i}=s(),r=new Qv({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:qv.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:qv.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:qv.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)(Ei(Yh))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();const s_=new oi("XSRF_COOKIE_NAME"),o_=new oi("XSRF_HEADER_NAME");class a_{}let l_=(()=>{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=Eh(t,this.cookieName),this.lastCookieString=t),this.lastToken}}return t.\u0275fac=function(e){return new(e||t)(Ei(th),Ei(hu),Ei(s_))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),c_=(()=>{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)(Ei(a_),Ei(o_))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),u_=(()=>{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(e_,[]);this.chain=t.reduceRight((t,e)=>new t_(t,e),this.backend)}return this.chain.handle(t)}}return t.\u0275fac=function(e){return new(e||t)(Ei(Rv),Ei(No))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),h_=(()=>{class t{static disable(){return{ngModule:t,providers:[{provide:c_,useClass:n_}]}}static withOptions(e={}){return{ngModule:t,providers:[e.cookieName?{provide:s_,useValue:e.cookieName}:[],e.headerName?{provide:o_,useValue:e.headerName}:[]]}}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({providers:[c_,{provide:e_,useExisting:c_,multi:!0},{provide:a_,useClass:l_},{provide:s_,useValue:"XSRF-TOKEN"},{provide:o_,useValue:"X-XSRF-TOKEN"}]}),t})(),d_=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({providers:[Jv,{provide:Dv,useClass:u_},r_,{provide:Rv,useExisting:r_}],imports:[[h_.withOptions({cookieName:"XSRF-TOKEN",headerName:"X-XSRF-TOKEN"})]]}),t})();const p_=["*"];function f_(t){return Error(`Unable to find icon with the name "${t}"`)}function g_(t){return Error(`The URL provided to MatIconRegistry was not trusted as a resource URL via Angular's DomSanitizer. Attempted URL was "${t}".`)}function m_(t){return Error(`The literal provided to MatIconRegistry was not trusted as safe HTML by Angular's DomSanitizer. Attempted literal was "${t}".`)}class b_{constructor(t,e,n){this.url=t,this.svgText=e,this.options=n}}let y_=(()=>{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 b_(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 m_(n);return this._addSvgIconConfig(t,e,new b_("",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 b_(e,null,n))}addSvgIconSetLiteralInNamespace(t,e,n){const i=this._sanitizer.sanitize(yr.HTML,e);if(!i)throw m_(e);return this._addSvgIconSetConfig(t,new b_("",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 g_(t);const n=this._cachedIconsByUrl.get(e);return n?Dd(v_(n)):this._loadSvgIconFromConfig(new b_(t,null)).pipe(eg(t=>this._cachedIconsByUrl.set(e,t)),D(t=>v_(t)))}getNamedSvgIcon(t,e=""){const n=__(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):gp(f_(n))}ngOnDestroy(){this._resolvers=[],this._svgIconConfigs.clear(),this._iconSetConfigs.clear(),this._cachedIconsByUrl.clear()}_getSvgFromConfig(t){return t.svgText?Dd(v_(this._svgElementFromConfig(t))):this._loadSvgIconFromConfig(t).pipe(D(t=>v_(t)))}_getSvgFromIconSetConfigs(t,e){const n=this._extractIconWithNameFromAnySet(t,e);return n?Dd(n):Ev(e.filter(t=>!t.svgText).map(t=>this._loadSvgIconSetFromConfig(t).pipe(Tv(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)),Dd(null)})))).pipe(D(()=>{const n=this._extractIconWithNameFromAnySet(t,e);if(!n)throw f_(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(eg(e=>t.svgText=e),D(()=>this._svgElementFromConfig(t)))}_loadSvgIconSetFromConfig(t){return t.svgText?Dd(null):this._fetchIcon(t).pipe(eg(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(__(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:""}}}),C_=["clip-path","color-profile","src","cursor","fill","filter","marker","marker-start","marker-mid","marker-end","mask","stroke"],E_=C_.map(t=>`[${t}]`).join(", "),O_=/^url\(['"]?#(.*?)['"]?\)$/;let T_=(()=>{class t extends x_{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=kd(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(E_),n=this._elementsWithExternalReferences=this._elementsWithExternalReferences||new Map;for(let i=0;i{const r=e[i],s=r.getAttribute(t),o=s?s.match(O_):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(rf(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(Al),ea(y_),ii("aria-hidden"),ea(S_),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:p_,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})(),k_=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Wy],Wy]}),t})();const P_=["mat-button",""],A_=["*"],M_=".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",I_=["mat-button","mat-flat-button","mat-icon-button","mat-raised-button","mat-stroked-button","mat-mini-fab","mat-fab"],D_=Xy(qy(Yy(class{constructor(t){this._elementRef=t}})));let R_=(()=>{class t extends D_{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 I_)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(Al),ea(Ug),ea(Ny,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&&Zc(cv,5),2&t){let t;Qc(t=tu())&&(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:P_,ngContentSelectors:A_,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:[cv],styles:[M_],encapsulation:2,changeDetection:0}),t})(),N_=(()=>{class t extends R_{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(Ug),ea(Al),ea(Ny,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:P_,ngContentSelectors:A_,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:[cv],styles:[M_],encapsulation:2,changeDetection:0}),t})(),L_=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[uv,Wy],Wy]}),t})();class j_ 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 F_ 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 B_(t,e,n,i,r=new F_(t,n,i)){if(!r.closed)return e instanceof E?e.subscribe(r):V(e)(r)}const V_={};function z_(...t){let e,n;return I(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 U_(e))}class U_{constructor(t){this.resultSelector=t}call(t,e){return e.subscribe(new H_(t,this.resultSelector))}}class H_ extends j_{constructor(t,e){super(t),this.resultSelector=e,this.active=0,this.values=[],this.observables=[]}_next(t){this.values.push(V_),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):q_}matchMedia(t){return this._platform.WEBKIT&&function(t){if(!$_.has(t))try{G_||(G_=document.createElement("style"),G_.setAttribute("type","text/css"),document.head.appendChild(G_)),G_.sheet&&(G_.sheet.insertRule(`@media ${t} {.fx-query-test{ }}`,0),$_.add(t))}catch(e){console.error(e)}}(t),this._matchMedia(t)}}return t.\u0275fac=function(e){return new(e||t)(Ei(Ep))},t.\u0275prov=xt({factory:function(){return new t(Ei(Ep))},token:t,providedIn:"root"}),t})();function q_(t){return{matches:"all"===t||""===t,media:t,addListener:()=>{},removeListener:()=>{}}}let X_=(()=>{class t{constructor(t,e){this._mediaMatcher=t,this._zone=e,this._queries=new Map,this._destroySubject=new A}ngOnDestroy(){this._destroySubject.next(),this._destroySubject.complete()}isMatched(t){return Y_(Ad(t)).some(t=>this._registerQuery(t).mql.matches)}observe(t){let e=z_(Y_(Ad(t)).map(t=>this._registerQuery(t).observable));return e=ap(e.pipe(rf(1)),e.pipe(lg(1),rg(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 E(t=>{const n=e=>this._zone.run(()=>t.next(e));return e.addListener(n),()=>{e.removeListener(n)}}).pipe(lp(e),D(({matches:e})=>({query:t,matches:e})),rp(this._destroySubject)),mql:e};return this._queries.set(t,n),n}}return t.\u0275fac=function(e){return new(e||t)(Ei(W_),Ei(Tu))},t.\u0275prov=xt({factory:function(){return new t(Ei(W_),Ei(Tu))},token:t,providedIn:"root"}),t})();function Y_(t){return t.map(t=>t.split(",")).reduce((t,e)=>t.concat(e)).map(t=>t.trim())}function K_(t,e){if(1&t){const t=ua();ra(0,"div",1),ra(1,"button",2),fa("click",function(){return $e(t),va().action()}),Ja(2),sa(),sa()}if(2&t){const t=va();ws(2),tl(t.data.action)}}function Q_(t,e){}const Z_=new oi("MatSnackBarData");class J_{constructor(){this.politeness="assertive",this.announcementMessage="",this.duration=0,this.data=null,this.horizontalPosition="center",this.verticalPosition="bottom"}}const tw=Math.pow(2,31)-1;class ew{constructor(t,e){this._overlayRef=e,this._afterDismissed=new A,this._afterOpened=new A,this._onAction=new A,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,tw))}_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 nw=(()=>{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(ew),ea(Z_))},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"),Ja(1),sa(),Jo(2,K_,3,1,"div",0)),2&t&&(ws(1),tl(e.data.message),ws(1),na("ngIf",e.hasAction))},directives:[Ah,R_],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 iw={snackBarState:Qg("state",[em("void, hidden",tm({transform:"scale(0.8)",opacity:0})),em("visible",tm({transform:"scale(1)",opacity:1})),im("* => visible",Zg("150ms cubic-bezier(0, 0, 0.2, 1)")),im("* => void, * => hidden",Zg("75ms cubic-bezier(0.4, 0.0, 1, 1)",tm({opacity:0})))])};let rw=(()=>{class t extends Kp{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 A,this._onExit=new A,this._onEnter=new A,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(rf(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(Tu),ea(Al),ea(nc),ea(Ep),ea(J_))},t.\u0275cmp=Jt({type:t,selectors:[["snack-bar-container"]],viewQuery:function(t,e){if(1&t&&Zc(tf,7),2&t){let t;Qc(t=tu())&&(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&&sl("@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,Q_,0,0,"ng-template",1),sa(),oa(2,"div")),2&t&&(ws(2),Ko("aria-live",e._live)("role",e._role))},directives:[tf],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:[iw.snackBarState]}}),t})(),sw=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Wf,ef,Wh,L_,Wy],Wy]}),t})();const ow=new oi("mat-snack-bar-default-options",{providedIn:"root",factory:function(){return new J_}});let aw=(()=>{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=nw,this.snackBarContainerComponent=rw,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:J_,useValue:e}]}),i=new qp(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 J_),this._defaultConfig),e),i=this._createOverlay(n),r=this._attachSnackBarContainer(i,n),s=new ew(r,i);if(t instanceof ac){const e=new Xp(t,null,{$implicit:n.data,snackBarRef:s});s.instance=r.attachTemplatePortal(e)}else{const e=this._createInjector(n,s),i=new qp(t,void 0,e),o=r.attachComponentPortal(i);s.instance=o.instance}return this._breakpointObserver.observe("(max-width: 599.98px) and (orientation: portrait)").pipe(rp(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 vf;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:ew,useValue:e},{provide:Z_,useValue:t.data}]})}}return t.\u0275fac=function(e){return new(e||t)(Ei(Vf),Ei(Bg),Ei(No),Ei(X_),Ei(t,12),Ei(ow))},t.\u0275prov=xt({factory:function(){return new t(Ei(Vf),Ei(Bg),Ei(_o),Ei(X_),Ei(t,12),Ei(ow))},token:t,providedIn:sw}),t})();const lw={tooltipState:Qg("state",[em("initial, void, hidden",tm({opacity:0,transform:"scale(0)"})),em("visible",tm({transform:"scale(1)"})),im("* => visible",Zg("200ms cubic-bezier(0, 0, 0.2, 1)",nm([tm({opacity:0,transform:"scale(0)",offset:0}),tm({opacity:.5,transform:"scale(0.99)",offset:.5}),tm({opacity:1,transform:"scale(1)",offset:1})]))),im("* => hidden",Zg("100ms cubic-bezier(0, 0, 0.2, 1)",tm({opacity:0})))])},cw="tooltip-panel",uw=Ip({passive:!0}),hw=new oi("mat-tooltip-scroll-strategy"),dw={provide:hw,deps:[Vf],useFactory:function(t){return()=>t.scrollStrategies.reposition({scrollThrottle:20})}},pw=new oi("mat-tooltip-default-options",{providedIn:"root",factory:function(){return{showDelay:0,hideDelay:0,touchendHideDelay:1500}}});let fw=(()=>{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 A,this._handleKeydown=t=>{this._isTooltipVisible()&&27===t.keyCode&&!uf(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(rp(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=kd(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(rp(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,uw)}),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 qp(this._tooltipComponent,this._viewContainerRef),this._tooltipInstance=e.attach(this._portal).instance,this._tooltipInstance.afterHidden().pipe(rp(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(rp(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}-${cw}`,scrollStrategy:this._scrollStrategy()}),this._updatePosition(this._overlayRef),this._overlayRef.detachments().pipe(rp(this._destroyed)).subscribe(()=>this._detach()),this._overlayRef.outsidePointerEvents().pipe(rp(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(rf(1),rp(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}-${cw}-`;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,uw)})}_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(Vf),ea(Al),ea(Up),ea(pc),ea(Tu),ea(Ep),ea(xg),ea(Ug),ea(void 0),ea(Fp),ea(void 0),ea(th))},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})(),gw=(()=>{class t extends fw{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=bw}}return t.\u0275fac=function(e){return new(e||t)(ea(Vf),ea(Al),ea(Up),ea(pc),ea(Tu),ea(Ep),ea(xg),ea(Ug),ea(hw),ea(Fp,8),ea(pw,8),ea(th))},t.\u0275dir=se({type:t,selectors:[["","matTooltip",""]],hostAttrs:[1,"mat-tooltip-trigger"],exportAs:["matTooltip"],features:[jo]}),t})(),mw=(()=>{class t{constructor(t){this._changeDetectorRef=t,this._visibility="initial",this._closeOnInteraction=!1,this._onHide=new A}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(nc))},t.\u0275dir=se({type:t}),t})(),bw=(()=>{class t extends mw{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(nc),ea(X_))},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)}),Dc(1,"async"),Ja(2),sa()),2&t){let t;ja("mat-tooltip-handset",null==(t=Rc(1,5,e._isHandset))?null:t.matches),na("ngClass",e.tooltipClass)("@state",e._visibility),ws(2),tl(e.message)}},directives:[Oh],pipes:[$h],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:[lw.tooltipState]},changeDetection:0}),t})(),yw=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({providers:[dw],imports:[[qg,Wh,Wf,Wy],Wy,$p]}),t})();function vw(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 _w(t,e){return function(n,i){e(n,i,t)}}function ww(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function xw(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 Sw(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 Cw(){return!("object"==typeof process&&"[object process]"===String(process)&&!process.browser)||Sw()}const Ew="undefined"!=typeof __VERSION__?__VERSION__:"untranspiled source",Ow=Cw();class Tw{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 kw(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 Pw={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 Aw(t){return"string"==typeof t?Pw[t.toUpperCase()]||Pw.WHITE:t}function Mw(t,e){if(!t)throw new Error(e||"Assertion failed")}const Iw={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},Dw=Iw.window||Iw.self||Iw.global,Rw=Iw.process||{};function Nw(){let t;if(Ow&&Dw.performance)t=Dw.performance.now();else if(Rw.hrtime){const e=Rw.hrtime();t=1e3*e[0]+e[1]/1e6}else t=Date.now();return t}console;const Lw={debug:Ow&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},jw={enabled:!0,level:0};function Fw(){}const Bw={},Vw={once:!0};function zw(t){for(const e in t)for(const n in t[e])return n||"untitled";return"empty"}let Uw=(()=>{class t{constructor({id:t}={id:""}){this.id=t,this.VERSION=Ew,this._startTs=Nw(),this._deltaTs=Nw(),this.LOG_THROTTLE_TIMEOUT=0,this._storage=new Tw("__probe-".concat(this.id,"__"),jw),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((Nw()-this._startTs).toPrecision(10))}getDelta(){return Number((Nw()-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){Mw(t,e)}warn(t){return this._getLogFunction(0,t,Lw.warn,arguments,Vw)}error(t){return this._getLogFunction(0,t,Lw.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,Lw.log,arguments,{time:!0,once:!0})}log(t,e){return this._getLogFunction(t,e,Lw.debug,arguments)}info(t,e){return this._getLogFunction(t,e,console.info,arguments)}once(t,e){return this._getLogFunction(t,e,Lw.debug||Lw.info,arguments,Vw)}table(t,e,n){return e?this._getLogFunction(t,e,console.table||Fw,n&&[n],{tag:zw(e)}):Fw}image({logLevel:t,priority:e,image:i,message:r="",scale:s=1}){return this._shouldLog(t||e)?Ow?function({image:t,message:e="",scale:n=1}){if("string"==typeof t){const i=new Image;return i.onload=()=>{const t=kw(i,e,n);console.log(...t)},i.src=t,Fw}const i=t.nodeName||"";if("img"===i.toLowerCase())return console.log(...kw(t,e,n)),Fw;if("canvas"===i.toLowerCase()){const i=new Image;return i.onload=()=>console.log(...kw(i,e,n)),i.src=t.toDataURL(),Fw}return Fw}({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)):Fw}({image:i,message:r,scale:s}):Fw}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||Fw)}group(t,e,n={collapsed:!1}){n=$w({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||Fw)}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()>=Hw(t)}_getLogFunction(t,e,n,i=[],r){if(this._shouldLog(t)){r=$w({logLevel:t,message:e,args:i,opts:r}),Mw(n=n||r.method),r.total=this.getTotal(),r.delta=this.getDelta(),this._deltaTs=Nw();const s=r.tag||r.message;if(r.once){if(Bw[s])return Fw;Bw[s]=Nw()}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!Ow&&"string"==typeof t&&(e&&(e=Aw(e),t="\x1b[".concat(e,"m").concat(t,"\x1b[39m")),n&&(e=Aw(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 Fw}}return t.VERSION=Ew,t})();function Hw(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 Mw(Number.isFinite(e)&&e>=0),e}function $w(t){const{logLevel:e,message:n}=t;t.logLevel=Hw(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 Mw("string"===r||"object"===r),Object.assign(t,t.opts)}var Gw=new Uw({id:"deck"});const Ww={DEFAULT:-1,LNGLAT:1,METER_OFFSETS:2,LNGLAT_OFFSETS:3,CARTESIAN:0};Object.defineProperty(Ww,"IDENTITY",{get:()=>Gw.deprecated("COORDINATE_SYSTEM.IDENTITY","COORDINATE_SYSTEM.CARTESIAN")()||0});const qw={WEB_MERCATOR:1,GLOBE:2,WEB_MERCATOR_AUTO_OFFSET:4,IDENTITY:0},Xw={click:{handler:"onClick"},panstart:{handler:"onDragStart"},panmove:{handler:"onDrag"},panend:{handler:"onDragEnd"}},Yw=new Uw({id:"luma.gl"});function Kw(t,e){if(!t)throw new Error(e||"luma.gl: assertion failed.")}function Qw(t){return"undefined"!=typeof WebGLRenderingContext&&t instanceof WebGLRenderingContext||"undefined"!=typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext||Boolean(t&&Number.isFinite(t._version))}function Zw(t){return"undefined"!=typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext||Boolean(t&&2===t._version)}function Jw(t){return Kw(Qw(t),"Invalid WebGLRenderingContext"),t}function tx(t){return Kw(Zw(t),"Requires WebGL2"),t}const ex={};const nx=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{globalThis.console&&globalThis.console.log&&globalThis.console.log("OESVertexArrayObject emulation library context restored"),e.reset_()},!0),this.reset_()};ix.prototype.VERTEX_ARRAY_BINDING_OES=34229,ix.prototype.reset_=function(){if(void 0!==this.vertexArrayObjects)for(let t=0;tZw(t)?void 0:0,lx={3074:t=>Zw(t)?void 0:36064,35723:t=>Zw(t)?void 0:4352,35977:ax,32937:ax,36795:(t,e)=>{const n=Zw(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(ox);return e(n&&n.UNMASKED_VENDOR_WEBGL||7936)},37446:(t,e)=>{const n=t.getExtension(ox);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:ax,35071:ax,37447:ax,36063:(t,e)=>{if(!Zw(t)){const n=t.getExtension(sx);return n?e(n.MAX_COLOR_ATTACHMENTS_WEBGL):0}},35379:ax,35374:ax,35377:ax,34852:t=>{if(!Zw(t)){const e=t.getExtension(sx);return e?e.MAX_DRAW_BUFFERS_WEBGL:0}},36203:t=>t.getExtension(rx)?2147483647:65535,33001:t=>t.getExtension(rx)?16777216:65535,33e3:t=>16777216,37157:ax,35373:ax,35657:ax,36183:ax,37137:ax,34045:ax,35978:ax,35979:ax,35968:ax,35376:ax,35375:ax,35659:ax,37154:ax,35371:ax,35658:ax,35076:ax,35077:ax,35380:ax},cx="ANGLE_instanced_arrays",ux={OES_vertex_array_object:{meta:{suffix:"OES"},createVertexArray:()=>{Kw(!1,"VertexArray requires WebGL2 or OES_vertex_array_object extension")},deleteVertexArray:()=>{},bindVertexArray:()=>{},isVertexArray:()=>!1},[cx]:{meta:{suffix:"ANGLE"},vertexAttribDivisor(t,e){Kw(0===e,"WebGL instanced rendering not supported")},drawElementsInstanced:()=>{},drawArraysInstanced:()=>{}},WEBGL_draw_buffers:{meta:{suffix:"WEBGL"},drawBuffers:()=>{Kw(!1)}},EXT_disjoint_timer_query:{meta:{suffix:"EXT"},createQuery:()=>{Kw(!1)},deleteQuery:()=>{Kw(!1)},beginQuery:()=>{Kw(!1)},endQuery:()=>{},getQuery(t,e){return this.getQueryObject(t,e)},getQueryParameter(t,e){return this.getQueryObject(t,e)},getQueryObject:()=>{}}},hx={readBuffer:(t,e,n)=>{Zw(t)&&e(n)},getVertexAttrib:(t,e,n,i)=>{const{webgl2:r,ext:s}=function(t,e){return{webgl2:Zw(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(!Zw(t))switch(i){case 35967:return 35981;case 35971:case 35382:return 0}return e(n,i)},getInternalformatParameter:(t,e,n,i,r)=>{if(!Zw(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=lx[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 dx(t,{extension:e,target:n,target2:i}){const r=ux[e];Kw(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)}}globalThis.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 ix(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&&dx(t,{extension:n,target:t.luma,target2:t})}(t,ux),function(t,{target:e,target2:n}){Object.keys(hx).forEach(i=>{if("function"==typeof hx[i]){const r=t[i]?t[i].bind(t):()=>{},s=hx[i].bind(null,t,r);e[i]=s,n[i]=s}})}(t,{target:e,target2:t}),e.polyfilled=!0),t};const px={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},fx=(t,e,n)=>e?t.enable(n):t.disable(n),gx=(t,e,n)=>t.hint(n,e),mx=(t,e,n)=>t.pixelStorei(n,e);function bx(t){return Array.isArray(t)||ArrayBuffer.isView(t)}const yx={3042:fx,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:fx,2885:(t,e)=>t.cullFace(e),2929:fx,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:fx,35723:gx,36006:(t,e)=>{const n=Zw(t)?36009:36160;return t.bindFramebuffer(n,e)},2886:(t,e)=>t.frontFace(e),33170:gx,2849:(t,e)=>t.lineWidth(e),32823:fx,32824:"polygonOffset",10752:"polygonOffset",35977:fx,32938:"sampleCoverage",32939:"sampleCoverage",3089:fx,3088:(t,e)=>t.scissor(...e),2960:fx,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:mx,3317:mx,37440:mx,37441:mx,37443:mx,3330:mx,3332:mx,3331:mx,36010:(t,e)=>t.bindFramebuffer(36008,e),3314:mx,32878:mx,3316:mx,3315:mx,32877:mx,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=bx(e)?e:[e,e],t.blendEquationSeparate(...e)},blendFunc:(t,e)=>{e=bx(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=bx(e)?e:[e,e];const[n,i]=e;t.stencilMaskSeparate(1028,n),t.stencilMaskSeparate(1029,i)},stencilFunc:(t,e)=>{e=bx(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=bx(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 vx(t,e,n){return void 0!==e[t]?e[t]:n[t]}const _x={blendEquation:(t,e,n)=>t.blendEquationSeparate(vx(32777,e,n),vx(34877,e,n)),blendFunc:(t,e,n)=>t.blendFuncSeparate(vx(32969,e,n),vx(32968,e,n),vx(32971,e,n),vx(32970,e,n)),polygonOffset:(t,e,n)=>t.polygonOffset(vx(32824,e,n),vx(10752,e,n)),sampleCoverage:(t,e,n)=>t.sampleCoverage(vx(32938,e,n),vx(32939,e,n)),stencilFuncFront:(t,e,n)=>t.stencilFuncSeparate(1028,vx(2962,e,n),vx(2967,e,n),vx(2963,e,n)),stencilFuncBack:(t,e,n)=>t.stencilFuncSeparate(1029,vx(34816,e,n),vx(36003,e,n),vx(36004,e,n)),stencilOpFront:(t,e,n)=>t.stencilOpSeparate(1028,vx(2964,e,n),vx(2965,e,n),vx(2966,e,n)),stencilOpBack:(t,e,n)=>t.stencilOpSeparate(1029,vx(34817,e,n),vx(34818,e,n),vx(34819,e,n))},wx={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]})},xx=(t,e)=>t.isEnabled(e),Sx={3042:xx,2884:xx,2929:xx,3024:xx,32823:xx,32926:xx,32928:xx,3089:xx,2960:xx,35977:xx};function Cx(t){for(const e in t)return!1;return!0}function Ex(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||px)){const n=e,i=Sx[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=Sx[r];i[r]=e?e(t,Number(r)):t.getParameter(Number(r))}return i}(t):Object.assign({},px),this.log=n,this._updateCache=this._updateCache.bind(this),Object.seal(this)}push(t={}){this.stateStack.push({})}pop(){Kw(this.stateStack.length>0),Mx(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){Kw(void 0!==r);const s=t[r],o=this.cache[r];Ex(s,o)||(n=!0,e=o,i&&!(r in i)&&(i[r]=o),this.cache[r]=s)}return{valueChanged:n,oldValue:e}}}function Px(t,e={}){const{enable:n=!0,copyState:i}=e;if(Kw(void 0!==i),!t.state){const{polyfillContext:e}=globalThis;e&&e(t),t.state=new kx(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 n in wx)Tx(t,n,wx[n]);Ox(t,"getParameter"),Ox(t,"isEnabled")}return t.state.enable=n,t}function Ax(t){Kw(t.state),t.state.pop()}function Mx(t,e){if(Kw(Qw(t),"setParameters requires a WebGL context"),Cx(e))return;const n={};for(const r in e){const i=Number(r),s=yx[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)_x[r](t,e,i)}function Ix(t,e,n){if(Cx(e))return n(t);const{nocatch:i=!0}=e;let r;if(function(t){t.state||Px(t,{copyState:!1}),t.state.push()}(t),Mx(t,e),i)r=n(t),Ax(t);else try{r=n(t)}finally{Ax(t)}return r}function Dx(){return!("object"==typeof process&&"[object process]"===String(process)&&!process.browser)||function(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;return!!(e&&e.indexOf("Electron")>=0)}()}function Rx(t){const{luma:e}=t;if(t.canvas&&e){const{clientWidth:n}=e.canvasSizeInfo;return n?t.drawingBufferWidth/n:1}return 1}function Nx(t,e,n=!0){return function(t,e,n,i,r){const s=Lx(t[0],e,n);let o=jx(t[1],e,i,r),a=Lx(t[0]+1,e,n);const l=a===n-1?a:a-1;let c;return a=jx(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,Rx(t),t.drawingBufferWidth,t.drawingBufferHeight,n)}function Lx(t,e,n){return Math.min(Math.round(t*e),n-1)}function jx(t,e,n,i){return i?Math.max(0,n-1-Math.round(t*e)):Math.min(Math.round(t*e),n-1)}const Fx=Dx(),Bx=Fx&&"undefined"!=typeof document,Vx={webgl2:!0,webgl1:!0,throwOnError:!0,manageState:!0,canvas:null,debug:!1,width:800,height:600};function zx(t={}){Kw(Fx,"createGLContext only available in the browser.\nCreate your own headless context or use 'createHeadlessContext' from @luma.gl/test-utils"),t=Object.assign({},Vx,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?(Bx&&"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=Ux(r,t),function(t){const e=Zw(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);Yw.info(1,`${e}${t.debug?" debug":""} context ${n?`(${n.vendor},${n.renderer})`:""}`)()}(r),r):null}function Ux(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({},Vx,e);const{manageState:n,debug:i}=e;return n&&Px(t,{copyState:!1,log:(...t)=>Yw.log(1,...t)()}),Fx&&i&&(globalThis.makeDebugContext?(t=globalThis.makeDebugContext(t,e),Yw.level=Math.max(Yw.level,1)):Yw.warn('WebGL debug mode not activated. import "@luma.gl/debug" to enable.')()),t._instrumented=!0,t}function Hx(){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 $x{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=Hx(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(Hx()-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 Gx{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 $x?t:new $x(e,n)),this.stats[e]}}const Wx="8.5.12",qx=new class{constructor(){this.stats=new Map}get(t){return this.stats.has(t)||this.stats.set(t,new Gx({id:t})),this.stats.get(t)}};if(globalThis.luma&&globalThis.luma.VERSION!==Wx)throw new Error(`luma.gl - multiple VERSIONs detected: ${globalThis.luma.VERSION} vs ${Wx}`);function Xx(t,e){if(!t)throw new Error(e||"luma.gl: assertion failed.")}function Yx(t,e){if("string"!=typeof e)return e;const n=Number(e);if(!isNaN(n))return n;const i=t[e=e.replace(/^.*\./,"")];return Xx(void 0!==i,`Accessing undefined constant GL.${e}`),i}function Kx(t,e){e=Number(e);for(const n in t)if(t[n]===e)return`GL.${n}`;return String(e)}globalThis.luma||(Dx()&&Yw.log(1,`luma.gl ${Wx} - set luma.log.level=1 (or higher) to trace rendering`)(),globalThis.luma=globalThis.luma||{VERSION:Wx,version:Wx,log:Yw,stats:qx,globals:{modules:{},nodeIO:{}}}),globalThis;const Qx={};function Zx(t="id"){return Qx[t]=Qx[t]||1,`${t}-${Qx[t]++}`}function Jx(t){return Xx("number"==typeof t,"Input must be a number"),t&&0==(t&t-1)}function tS(t){let e=!0;for(const n in t){e=!1;break}return e}function eS(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 Yw.removed(`Calling removed method ${e}.${t}: `,r)(),new Error(t)})})}const nS="Resource subclass must define virtual methods";class iS{get[Symbol.toStringTag](){return"Resource"}constructor(t,e={}){Jw(t);const{id:n,userData:i={}}=e;this.gl=t,this.gl2=t,this.id=n||Zx(this[Symbol.toStringTag]),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[Symbol.toStringTag]||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={}){Xx(t=Yx(this.gl,t));const n=(this.constructor.PARAMETERS||{})[t];if(n){const t=Zw(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=Zw(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?Kx(this.gl,a):a;s[i]=this.getParameter(a,t),n&&"GLenum"===e.type&&(s[i]=Kx(this.gl,s[i]))}}return s}setParameter(t,e){Xx(t=Yx(this.gl,t));const n=(this.constructor.PARAMETERS||{})[t];if(n){const t=Zw(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=Yx(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 eS(this,t,e,n)}initialize(t){}_createHandle(){throw new Error(nS)}_deleteHandle(){throw new Error(nS)}_bindHandle(t){throw new Error(nS)}_getOptsFromHandle(){throw new Error(nS)}_getParameter(t,e){throw new Error(nS)}_setParameter(t,e){throw new Error(nS)}_context(){return this.gl.luma=this.gl.luma||{},this.gl.luma}_addStats(){const t=this[Symbol.toStringTag],e=qx.get("Resource Counts");e.get("Resources Created").incrementCount(),e.get(`${t}s Created`).incrementCount(),e.get(`${t}s Active`).incrementCount()}_removeStats(){const t=this[Symbol.toStringTag];qx.get("Resource Counts").get(`${t}s Active`).decrementCount()}_trackAllocatedMemory(t,e=this[Symbol.toStringTag]){const n=qx.get("Memory Usage");n.get("GPU Memory").addCount(t),n.get(`${e} Memory`).addCount(t),this.byteLength=t}_trackDeallocatedMemory(t=this[Symbol.toStringTag]){const e=qx.get("Memory Usage");e.get("GPU Memory").subtractCount(this.byteLength),e.get(`${t} Memory`).subtractCount(this.byteLength),this.byteLength=0}}function rS(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 sS(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 oS({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 uS.getBytesPerElement(this)}get BYTES_PER_VERTEX(){return uS.getBytesPerVertex(this)}_assign(t={}){return void 0!==(t=aS("Accessor",t,cS)).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 hS={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"},dS={removedProps:{},replacedProps:{bytes:"byteLength"},deprecatedProps:hS},pS={removedProps:hS};class fS extends iS{get[Symbol.toStringTag](){return"Buffer"}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/uS.getBytesPerElement(t))}getVertexCount(t=this.accessor){return Math.round(this.byteLength/uS.getBytesPerVertex(t))}initialize(t={}){return ArrayBuffer.isView(t)&&(t={data:t}),Number.isFinite(t)&&(t={byteLength:t}),t=aS("Buffer",t,dS),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=aS("Buffer",t,pS))&&this.setAccessor(t.accessor),this}setAccessor(t){return delete(t=Object.assign({},t)).buffer,this.accessor=new uS(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;Xx(e);const s=this.gl.webgl2?36663:this.target;return this.gl.bindBuffer(s,this.handle),0!==i||void 0!==r?(tx(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 tx(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}={}){tx(this.gl);const r=sS(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 Xx((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):(Xx(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){Xx(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=rS(t);return Xx(r),this.setAccessor(new uS(this.accessor,{type:r})),this}_setByteLength(t,e=this.usage){Xx(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/sS(this.accessor.type||5126,{clamped:!1}).BYTES_PER_ELEMENT;return this.getElementCount()-e}_inferType(t){this.accessor.type||this.setAccessor(new uS(this.accessor,{type:rS(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 Yw.deprecated("Buffer.type","Buffer.accessor.type")(),this.accessor.type}get bytes(){return Yw.deprecated("Buffer.bytes","Buffer.byteLength")(),this.byteLength}setByteLength(t){return Yw.deprecated("setByteLength","reallocate")(),this.reallocate(t)}updateAccessor(t){return Yw.deprecated("updateAccessor(...)","setAccessor(new Accessor(buffer.accessor, ...)")(),this.accessor=new uS(this.accessor,t),this}}const gS={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}},mS={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},bS={5126:4,5125:4,5124:4,5123:2,5122:2,5131:2,5120:1,5121:1},yS=[9729,9728],vS=globalThis.WebGLBuffer||function(){};class _S extends iS{get[Symbol.toStringTag](){return"Texture"}static isSupported(t,e={}){const{format:n,linearFiltering:i}=e;let r=!0;return n&&(r=r&&function(t,e){const n=gS[e];if(!n)return!1;if(void 0===n.gl1&&void 0===n.gl2)return!0;const i=Zw(t)&&n.gl2||n.gl1;return"string"==typeof i?t.getExtension(i):i}(t,n),r=r&&(!i||function(t,e){const n=gS[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=Zx("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()&&(Yw.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=null;({data:l,dataType:g}=this._getDataType({data:l,compressed:p}));let m,b=0;return Ix(this.gl,a,()=>{switch(g){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":m=tx(f),m.bindBuffer(35052,l.handle||l),m.texImage2D(e,i,r,u,h,s,d,c,o),m.bindBuffer(35052,null);break;case"browser-object":Zw(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),b+=n.levelSize;break;default:Xx(!1,"Unknown image data type")}}),this._trackAllocatedMemory("compressed"===g?b:l&&l.byteLength?l.byteLength:this.width*this.height*(mS[this.dataFormat]||4)*(bS[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})),Xx(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 fS&&(n=n.handle),this.gl.bindTexture(this.target,this.handle),Ix(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 vS){const e=tx(this.gl);e.bindBuffer(35052,n),e.texSubImage2D(t,a,i,r,s,o,u,c,d),e.bindBuffer(35052,null)}else Zw(this.gl)?tx(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 Yw.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 fS?{data:t.handle,dataType:"buffer"}:t instanceof vS?{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=gS[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},Xx(i,"Could not deduced texture size"),Xx(void 0===e||i.width===e,"Deduced texture width does not match supplied width"),Xx(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:Xx(!1);break;default:this.gl.texParameteri(this.target,t,e)}return this.gl.bindTexture(this.target,null),this}_isNPOT(){return!(Zw(this.gl)||!this.width||!this.height||Jx(this.width)&&Jx(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===yS.indexOf(e)&&(e=9729);break;case 10242:case 10243:33071!==e&&(e=33071)}return e}}function wS(t,e){return Xx("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 xS extends _S{get[Symbol.toStringTag](){return"Texture2D"}static isSupported(t,e){return _S.isSupported(t,e)}constructor(t,e={}){Jw(t),(e instanceof Promise||"string"==typeof e)&&(e={data:e}),"string"==typeof e.data&&(e=Object.assign({},e,{data:wS(e.data)})),super(t,Object.assign({},e,{target:3553})),this.initialize(e),Object.seal(this)}}const SS="EXT_color_buffer_float";var CS={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:SS,bpp:2},33327:{gl2:SS,bpp:4},34842:{gl2:SS,bpp:8},33326:{gl2:SS,bpp:4},33328:{gl2:SS,bpp:8},34836:{gl2:SS,bpp:16},35898:{gl2:SS,bpp:4}};class ES extends iS{get[Symbol.toStringTag](){return"Renderbuffer"}static isSupported(t,{format:e}={format:null}){return!e||function(t,e,n){const i=n[e];if(!i)return!1;const r=Zw(t)&&i.gl2||i.gl1;return"string"==typeof r?t.getExtension(r):r}(t,e,CS)}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 Xx(t,"Needs format"),this._trackDeallocatedMemory(),this.gl.bindRenderbuffer(36161,this.handle),0!==i&&Zw(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)*CS[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 OS="clear: bad arguments";function TS(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)),Xx(0!==o,OS),Ix(t,s,()=>{t.clear(o)})}function kS(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 PS(t){return function(){var e=this,n=arguments;return new Promise(function(i,r){var s=t.apply(e,n);function o(t){kS(s,i,r,o,a,"next",t)}function a(t){kS(s,i,r,o,a,"throw",t)}o(void 0)})}}const AS=[34069,34070,34071,34072,34073,34074];let MS=(()=>{class t extends _S{get[Symbol.toStringTag](){return"TextureCube"}constructor(t,e={}){Jw(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 PS(function*(){const{gl:l}=a,c=n||i,u=yield Promise.all(AS.map(t=>{const e=c[t];return Promise.all(Array.isArray(e)?e:[e])}));a.bind(),AS.forEach((n,i)=>{u[i].length>1&&!1!==a.opts.mipmaps&&Yw.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=AS,t})();class IS extends _S{get[Symbol.toStringTag](){return"Texture3D"}static isSupported(t){return Zw(t)}constructor(t,e={}){tx(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),Ix(this.gl,u,()=>{ArrayBuffer.isView(c)&&this.gl.texImage3D(this.target,t,e,n,i,r,s,o,a,c),c instanceof fS&&(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*(mS[this.dataFormat]||4)*(bS[this.type]||1),"Texture"),this.loaded=!0,this}}function DS(t,e){Xx(t instanceof xS||t instanceof MS||t instanceof IS);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},e))}function RS(t,e){const{gl:n,width:i,height:r,id:s}=t;return new BS(n,Object.assign({},e,{id:`framebuffer-for-${s}`,width:i,height:r,attachments:{36064:t}}))}function NS(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}=jS(t);Xx(u);const{gl:d,handle:p,attachments:f}=u;a=a||u.width,l=l||u.height,36064===s&&null===p&&(s=1028),Xx(f[s]),c=c||f[s].type,o=function(t,e,n,i,r){if(t)return t;return new(sS(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 Xx(!1),0}}(n))}(o,c,r,a,l),c=c||rS(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 LS(t,{sourceAttachment:e=36064,targetMaxHeight:n=Number.MAX_SAFE_INTEGER}={}){let i=NS(t,{sourceAttachment:e}),{width:r,height:s}=t;for(;s>n;)({data:i,width:r,height:s}=oS({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 Xx(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&&Yw.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){Xx(void 0!==s,"Misspelled framebuffer binding point?");const t=Number(s),e=i[t];let r=e;if(r)if(r instanceof ES)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(BS.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)&&TS(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]}={}){tx(t),Ix(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:Xx(!1,OS)}})}(this.gl,{drawBuffer:e,value:t})}),this.gl.bindFramebuffer(36160,s||null),this}readPixels(t={}){return Yw.error("Framebuffer.readPixels() is no logner supported, use readPixelsToArray(framebuffer)")(),null}readPixelsToBuffer(t={}){return Yw.error("Framebuffer.readPixelsToBuffer()is no logner supported, use readPixelsToBuffer(framebuffer)")(),null}copyToDataUrl(t={}){return Yw.error("Framebuffer.copyToDataUrl() is no logner supported, use copyToDataUrl(framebuffer)")(),null}copyToImage(t={}){return Yw.error("Framebuffer.copyToImage() is no logner supported, use copyToImage(framebuffer)")(),null}copyToTexture(t={}){return Yw.error("Framebuffer.copyToTexture({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null}blit(t={}){return Yw.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=tx(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=Kx(this.gl,i)),i}getAttachmentParameters(t=36064,e,n=this.constructor.ATTACHMENT_PARAMETERS||[]){const i={};for(const r of n)i[e?Kx(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?Kx(this.gl,e):e]=this.getAttachmentParameters(e,t)}return n}show(){return"undefined"!=typeof window&&window.open(LS(this),"luma-debug-texture"),this}log(t=0,e=""){if(t>Yw.level||"undefined"==typeof window)return this;e=e||`Framebuffer ${this.id}`;const n=LS(this,{targetMaxHeight:100});return Yw.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 xS(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 ES(this.gl,{id:`${this.id}-depth-stencil`,format:35056,width:i,height:111}),this.ownResources.push(s[33306])):e?(s=s||{},s[36096]=new ES(this.gl,{id:`${this.id}-depth`,format:33189,width:i,height:r}),this.ownResources.push(s[36096])):n&&Xx(!1),s}_unattach(t){const e=this.attachments[t];!e||(e instanceof ES?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:tx(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:Xx(!1,"Illegal texture type")}r.bindTexture(e.target,null),this.attachments[t]=e}_setReadBuffer(t){const e=function(t){return Zw(t)?t:null}(this.gl);e?e.readBuffer(t):Xx(36064===t||1029===t,FS),this.readBuffer=t}_setDrawBuffers(t){const{gl:e}=this,n=tx(e);if(n)n.drawBuffers(t);else{const n=e.getExtension("WEBGL_draw_buffers");n?n.drawBuffersWEBGL(t):Xx(1===t.length&&(36064===t[0]||1029===t[0]),FS)}this.drawBuffers=t}_getAttachmentParameterFallback(t){const e=function(t){t.luma=t.luma||{},t.luma.caps=t.luma.caps||{};for(const e in VS)void 0===t.luma.caps[e]&&(t.luma.caps[e]=HS(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)}}BS.ATTACHMENT_PARAMETERS=[36049,36048,33296,33298,33299,33300,33301,33302,33303];var VS={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 xS(t,{format:6408,type:5126,dataFormat:6408}),n=new BS(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 zS(t,e){return US(t,e)}function US(t,e){return(e=Array.isArray(e)?e:[e]).every(e=>HS(t,e))}function HS(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=VS[e];let i;Xx(n,e);const r=Zw(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:Xx(!1);return i}(t,e)),t.luma.caps[e]||Yw.log(2,`Feature: ${e} not supported`)(),t.luma.caps[e]}class $S{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()}};const WS=1/Math.PI*180,qS=1/180*Math.PI,XS={};function YS(t,{precision:e=XS.precision||4}={}){return t=function(t){return Math.round(t/XS.EPSILON)*XS.EPSILON}(t),`${parseFloat(t.toPrecision(e))}`}function KS(t){return Array.isArray(t)||ArrayBuffer.isView(t)&&!(t instanceof DataView)}function QS(t,e,n){if(KS(t)){n=n||function(t){return t.clone?t.clone():new Array(t.length)}(t);for(let i=0;it*qS,void 0)}(t)}function JS(t){return function(t,e){return QS(t,t=>t*WS,void 0)}(t)}function tC(t,e,n){return QS(t,t=>Math.max(e,Math.min(n,t)))}function eC(t,e,n){return KS(t)?t.map((t,i)=>eC(t,e[i],n)):n*e+(1-n)*t}function nC(t,e,n){const i=XS.EPSILON;n&&(XS.EPSILON=n);try{if(t===e)return!0;if(KS(t)&&KS(e)){if(t.length!==e.length)return!1;for(let n=0;n0?", ":"")+YS(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&&(LC.length=t.length,i=LC):i=NC,(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 FC(t){return t&&t[Symbol.asyncIterator]}function BC(t,e=(()=>!0)){return Array.isArray(t)?VC(t,e,[]):e(t)?[t]:[]}function VC(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 WC(t,e){return t?(Number.isFinite(t)&&(t={duration:t}),t.type=t.type||"interpolation",vt(vt(vt({},GC[t.type]),e),t)):null}function qC(t,e){return e.getBuffer()?[e.getBuffer(),{divisor:0,size:e.size,normalized:e.settings.normalized}]:e.value}function XC(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 YC(t){t.push(t.shift())}function KC(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 QC({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=KC(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 $C({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===HC||(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=HC}clearNeedsUpdate(){this.state.needsUpdate=!1,this.state.updateRanges=UC}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!==HC}),!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),zC({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 JC={};function tE(t){Gw.level>0&&JC[t]&&JC[t].call(...arguments)}function eE(t,e){if(!t)throw new Error(e||"shadertools: assertion failed.")}const nE="out vec4 transform_output;\nvoid main() {\n transform_output = vec4(0);\n}",iE=`#version 300 es\n${nE}`;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 sE(t={}){const{version:e=100,input:n,inputType:i,output:r}=t;if(!n)return 300===e?iE:e>300?`#version ${e}\n${nE}`:"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 eE(!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 oE extends iS{get[Symbol.toStringTag](){return"TransformFeedback"}static isSupported(t){return Zw(t)}constructor(t,e={}){tx(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,tS(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,Yw.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 fS?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 aE{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 fS?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&&Xx(Zw(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 oE(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],Xx(n[r]instanceof fS)}return{sourceBuffers:e,feedbackBuffers:n}}_createNewBuffer(t,e){const n=new fS(this.gl,e);return this.resources[t]&&this.resources[t].delete(),this.resources[t]=n,n}_getNextIndex(){return(this.currentIndex+1)%2}}function lE(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 cE="vs",uE={[cE]:"#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"},hE="__LUMA_INJECT_DECLARATIONS__",dE=/void\s+main\s*\([^)]*\)\s*\{\n?/,pE=/}\n?[^{}]*$/,fE=[];function gE(t,e,n,i=!1){const r=e===cE;for(const s in n){const e=n[s];e.sort((t,e)=>t.order-e.order),fE.length=e.length;for(let t=0,n=e.length;tt+i));break;case"vs:#main-end":r&&(t=t.replace(pE,t=>i+t));break;case"fs:#decl":r||(t=t.replace(hE,i));break;case"fs:#main-start":r||(t=t.replace(dE,t=>t+i));break;case"fs:#main-end":r||(t=t.replace(pE,t=>i+t));break;default:t=t.replace(s,t=>t+i)}}return t=t.replace(hE,""),i&&(t=t.replace(/\}\s*$/,t=>t+uE[e])),t}function mE(t){const e={};return eE(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 bE={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_",vE="transform_position";const _E={10241:9728,10240:9728,10242:33071,10243:33071};class wE{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[`${yE}${e}`]=[r,s]);for(const o in t)({width:r,height:s}=t[o]),i[`${yE}${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=NS(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 eE(!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 fS(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 BS(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(_E)}_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=DS(t,{parameters:{10241:9728,10240:9728,10242:33071,10243:33071},pixelStore:{37440:!1}});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=`${yE}${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 eE(!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=mE([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){Xx(i);const t=`${yE}${n}`;l=mE([l,{"vs:#decl":`uniform vec2 ${t};\n`,"vs:#main-start":` vec2 ${vE} = transform_getPos(${t});\n gl_Position = vec4(${vE}, 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=mE([t.inject||{},o]);return this.targetTextureType=s,this.samplerTextureMap=a,{vs:i,fs:t._fs||sE({version:lE(i),input:this.targetTextureVarying,inputType:s,output:"transform_output"}),modules:this.hasSourceTextures||this.targetTextureVarying?[bE].concat(t.modules||[]):t.modules,uniforms:r,inject:l}}}const xE={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 SE(t){let e=CE(t);return"object"===e?t?"type"in t?Object.assign({},t,xE[t.type]):"value"in t?(e=CE(t.value),Object.assign({type:e},t,xE[e])):{type:"object",value:t}:{type:"object",value:null}:Object.assign({type:e,value:t},xE[e])}function CE(t){return Array.isArray(t)||ArrayBuffer.isView(t)?"array":typeof t}class EE{constructor({name:t,vs:e,fs:n,dependencies:i=[],uniforms:r,getUniforms:s,deprecations:o=[],defines:a={},inject:l={},vertexShader:c,fragmentShader:u}){eE("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=SE(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:eE(!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&&eE(r.validate(t[i],r),`${this.name}: invalid ${i}`),e[i]=t[i]):e[i]=r.value}return e}}function OE(t){return function(t){const e={},n={};return TE({modules:t,level:0,moduleMap:e,moduleDepth:n}),Object.keys(n).sort((t,e)=>n[e]-n[t]).map(t=>e[t])}(kE(t))}function TE({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 EE||(eE("string"!=typeof t,`Shader module use by name is deprecated. Import shader module '${t}' and use it directly.`),eE(t.name,"shader module has no name"),(t=new EE(t)).dependencies=kE(t.dependencies)),t))}const PE={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]},AE={};function ME(t,e){return t.match(/NVIDIA/i)||e.match(/NVIDIA/i)?"NVIDIA":t.match(/INTEL/i)||e.match(/INTEL/i)?"INTEL":t.match(/AMD/i)||e.match(/AMD/i)||t.match(/ATI/i)||e.match(/ATI/i)?"AMD":"UNKNOWN GPU"}Object.keys(PE).forEach(t=>{AE[t]=t});const IE={};function DE(t,e,n={}){const i=PE[e];if(eE(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 IE)return IE[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),IE[e]=o,o}function RE(t,e){return(e=Array.isArray(e)?e:[e]).every(e=>function(t,e){const n=PE[e];eE(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 eE(!1===r||!0===r),r}(t,e))}function NE(t){return new RegExp(`\\b${t}[ \\t]+(\\w+[ \\t]+\\w+(\\[\\w+\\])?;)`,"g")}const LE=[[/^(#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("]],jE=[...LE,[NE("attribute"),"in $1"],[NE("varying"),"out $1"]],FE=[...LE,[NE("varying"),"in $1"]],BE=[[/^#version[ \t]+300[ \t]+es/,"#version 100"],[/\btexture(2D|2DProj|Cube)Lod\(/g,"texture$1LodEXT("],[/\btexture\(/g,"texture2D("],[/\btextureLod\(/g,"texture2DLodEXT("]],VE=[...BE,[NE("in"),"attribute $1"],[NE("out"),"varying $1"]],zE=[...BE,[NE("in"),"varying $1"]],UE="gl_FragColor",HE=/\bout[ \t]+vec4[ \t]+(\w+)[ \t]*;\n?/,$E=/void\s+main\s*\([^)]*\)\s*\{\n?/;function GE(t,e){for(const[n,i]of e)t=t.replace(n,i);return t}const WE=`\n\n${hE}\n\n`,qE={[cE]:"vertex",fs:"fragment"};function XE(t,{id:e,source:n,type:i,modules:r,defines:s={},hookFunctions:o=[],inject:a={},transpileToGLSL100:l=!1,prologue:c=!0,log:u}){eE("string"==typeof n,"shader source must be a string");const h=i===cE,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}_${qE[n]}\n\n`:""}({id:e,source:n,type:i})}\n${function({type:t}){return`\n#define SHADER_TYPE_${qE[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:ME(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// 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"}}(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 RE(t,AE.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"),RE(t,AE.GLSL_DERIVATIVES)&&DE(t,AE.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"),RE(t,AE.GLSL_FRAG_DATA)&&DE(t,AE.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"),RE(t,AE.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+=WE,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?GE(t,jE):function(t){const e=(t=GE(t,FE)).match(HE);if(e){const n=e[1];t=t.replace(new RegExp(`\\b${UE}\\b`,"g"),n)}else{const e="fragmentColor";t=t.replace($E,t=>`out vec4 ${e};\n${t}`).replace(new RegExp(`\\b${UE}\\b`,"g"),e)}return t}(t);case 100:return n?GE(t,VE):function(t){const e=(t=GE(t,zE)).match(HE);if(e){const n=e[1];t=t.replace(HE,"").replace(new RegExp(`\\b${n}\\b`,"g"),UE)}return t}(t);default:throw new Error(`unknown GLSL version ${e}`)}}(b,l?100:p,h),b}function YE(t){return function(e){const n={};for(const i of t){const t=i.getUniforms(e,n);Object.assign(n,t)}return n}}const KE={5126:uO.bind(null,"uniform1fv",nO,1,hO),35664:uO.bind(null,"uniform2fv",nO,2,hO),35665:uO.bind(null,"uniform3fv",nO,3,hO),35666:uO.bind(null,"uniform4fv",nO,4,hO),5124:uO.bind(null,"uniform1iv",iO,1,hO),35667:uO.bind(null,"uniform2iv",iO,2,hO),35668:uO.bind(null,"uniform3iv",iO,3,hO),35669:uO.bind(null,"uniform4iv",iO,4,hO),35670:uO.bind(null,"uniform1iv",iO,1,hO),35671:uO.bind(null,"uniform2iv",iO,2,hO),35672:uO.bind(null,"uniform3iv",iO,3,hO),35673:uO.bind(null,"uniform4iv",iO,4,hO),35674:uO.bind(null,"uniformMatrix2fv",nO,4,dO),35675:uO.bind(null,"uniformMatrix3fv",nO,9,dO),35676:uO.bind(null,"uniformMatrix4fv",nO,16,dO),35678:cO,35680:cO,5125:uO.bind(null,"uniform1uiv",rO,1,hO),36294:uO.bind(null,"uniform2uiv",rO,2,hO),36295:uO.bind(null,"uniform3uiv",rO,3,hO),36296:uO.bind(null,"uniform4uiv",rO,4,hO),35685:uO.bind(null,"uniformMatrix2x3fv",nO,6,dO),35686:uO.bind(null,"uniformMatrix2x4fv",nO,8,dO),35687:uO.bind(null,"uniformMatrix3x2fv",nO,6,dO),35688:uO.bind(null,"uniformMatrix3x4fv",nO,12,dO),35689:uO.bind(null,"uniformMatrix4x2fv",nO,8,dO),35690:uO.bind(null,"uniformMatrix4x3fv",nO,12,dO),35678:cO,35680:cO,35679:cO,35682:cO,36289:cO,36292:cO,36293:cO,36298:cO,36299:cO,36300:cO,36303:cO,36306:cO,36307:cO,36308:cO,36311:cO},QE={},ZE={},JE={},tO=[0];function eO(t,e,n,i){1===e&&"boolean"==typeof t&&(t=t?1:0),Number.isFinite(t)&&(tO[0]=t,t=tO);const r=t.length;if(r%e&&Yw.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 uO(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{Xx(s===u,"Uniform length cannot change.");for(let t=0;t{const s=String(i+e);return gO(s,r-s.length)+n+t})}(e);return{shaderName:l,errors:fO(s,c),warnings:fO(o,c)}}(t,this.source,this.shaderType,this.id);throw Yw.error(`GLSL compilation errors in ${e}\n${n}`)(),Yw.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 bO extends mO{get[Symbol.toStringTag](){return"VertexShader"}constructor(t,e){"string"==typeof e&&(e={source:e}),super(t,Object.assign({},e,{shaderType:35633}))}_createHandle(){return this.gl.createShader(35633)}}class yO extends mO{get[Symbol.toStringTag](){return"FragmentShader"}constructor(t,e){"string"==typeof e&&(e={source:e}),super(t,Object.assign({},e,{shaderType:35632}))}_createHandle(){return this.gl.createShader(35632)}}const vO=5126,_O=5124,wO=5125,xO={[vO]:[vO,1,"float"],35664:[vO,2,"vec2"],35665:[vO,3,"vec3"],35666:[vO,4,"vec4"],[_O]:[_O,1,"int"],35667:[_O,2,"ivec2"],35668:[_O,3,"ivec3"],35669:[_O,4,"ivec4"],[wO]:[wO,1,"uint"],36294:[wO,2,"uvec2"],36295:[wO,3,"uvec3"],36296:[wO,4,"uvec4"],35670:[vO,1,"bool"],35671:[vO,2,"bvec2"],35672:[vO,3,"bvec3"],35673:[vO,4,"bvec4"],35674:[vO,8,"mat2"],35685:[vO,8,"mat2x3"],35686:[vO,8,"mat2x4"],35675:[vO,12,"mat3"],35687:[vO,12,"mat3x2"],35688:[vO,12,"mat3x4"],35676:[vO,16,"mat4"],35689:[vO,16,"mat4x2"],35690:[vO,16,"mat4x3"]};function SO(t){const e=xO[t];if(!e)return null;const[n,i]=e;return{type:n,components:i}}function CO(t,e){switch(t){case 5120:case 5121:case 5122:case 5123:t=vO}for(const n in xO){const[i,r,s]=xO[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(!Zw(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}=SO(n),o={type:r,size:i*s};this._inferProperties(t,e,o);const a={location:t,name:e,accessor:new uS(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}=SO(n),o={location:t,name:e,accessor:new uS({type:r,size:i*s})};this.varyingInfos.push(o),this.varyingInfosByName[o.name]=o}}const OO=35981,TO=["setVertexArray","setAttributes","setBuffers","unsetBuffers","use","getUniformCount","getUniformInfo","getUniformLocation","getUniformValue","getVarying","getFragDataLocation","getAttachedShaders","getAttributeCount","getAttributeLocation","getAttributeInfo"];class kO extends iS{get[Symbol.toStringTag](){return"Program"}constructor(t,e={}){super(t,e),this.stubRemovedMethods("Program","v6.0",TO),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=OO}=t;return this.hash=e||"",this.vs="string"==typeof n?new bO(this.gl,{id:`${t.id}-vs`,source:n}):n,this.fs="string"==typeof i?new yO(this.gl,{id:`${t.id}-fs`,source:i}):i,Xx(this.vs instanceof bO),Xx(this.fs instanceof yO),this.uniforms={},this._textureUniforms={},r&&r.length>0&&(tx(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)&&(Yw.deprecated("Program.draw({uniforms})","Program.setUniforms(uniforms)")(),this.setUniforms(f||{})),Yw.priority>=t){const i=d?d.id:"default",r=`mode=${Kx(this.gl,e)} verts=${n} instances=${l} indexType=${Kx(this.gl,a)} isInstanced=${c} isIndexed=${o} Framebuffer=${i}`;Yw.log(t,r)()}return Xx(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 Xx(!1),0}}(e);h.begin(t)}this._bindTextures(),Ix(this.gl,p,()=>{o&&c?this.gl2.drawElementsInstanced(e,n,a,i,l):o&&Zw(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={}){Yw.priority>=2&&function(t,e,n){for(const i in t){const r=t[i];if((!n||Boolean(n[i]))&&!aO(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 BS&&(t=t.texture),t instanceof _S)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)&&lO(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 bO({handle:i});break;case 35632:n.fs=new yO({handle:i})}return n}_getParameter(t){return this.gl.getProgramParameter(this.handle,t)}_setId(t){if(!t){const t=this._getName();this.id=Zx(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),Yw.time(4,`linkProgram for ${this._getName()}`)(),t.linkProgram(this.handle),Yw.timeEnd(4,`linkProgram for ${this._getName()}`)(),t.debug||Yw.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=OE(e.modules||[]);return{gl:t,vs:XE(t,Object.assign({},e,{source:n,type:cE,modules:r})),fs:XE(t,Object.assign({},e,{source:i,type:"fs",modules:r})),getUniforms:YE(r)}}(this.gl,{vs:e,fs:n,modules:l,inject:r,defines:i,hookFunctions:this._hookFunctions,transpileToGLSL100:a});this._programCache[b]=new kO(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":Dw.chrome?"Chrome":Dw.safari?"Safari":Dw.mozInnerScreenX?"Firefox":"Unknown"}()}static getDefaultArray(t){return t.luma=t.luma||{},t.luma.defaultVertexArray||(t.luma.defaultVertexArray=new MO(t,{handle:null,isDefaultArray:!0})),t.luma.defaultVertexArray}static getMaxAttributes(t){return MO.MAX_ATTRIBUTES=MO.MAX_ATTRIBUTES||t.getParameter(34921),MO.MAX_ATTRIBUTES}static setConstant(t,e,n){switch(n.constructor){case Float32Array:MO._setConstantFloatArray(t,e,n);break;case Int32Array:MO._setConstantIntArray(t,e,n);break;case Uint32Array:MO._setConstantUintArray(t,e,n);break;default:Xx(!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 MO.getMaxAttributes(this.gl)}initialize(t={}){return this.setProps(t)}setProps(t){return this}setElementBuffer(t=null,e={}){return Xx(!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?(Xx(Zw(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&&!MO.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 fS(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(!AO||AO.byteLength{switch(t){case 34373:return this.gl.getVertexAttribOffset(e,t);default:return this.gl.getVertexAttrib(e,t)}})}}const IO=/^(.+)__LOCATION_([0-9]+)$/,DO=["setBuffers","setGeneric","clearBindings","setLocations","setGenericValues","setDivisor","enable","disable"];class RO{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 MO(t),eS(this,"VertexArray","v6.0",DO),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 fS(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,Yw.once(3,()=>`unused value ${t} in ${this.id}`)(),r;const a=this._getAttributeInfo(o||s);if(!a)return r;const l=uS.resolve(a.accessor,this.accessors[s]||{},n,i),{size:c,type:u}=l;return Xx(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=IO.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 fS)this.setBuffer(t,e);else if(Array.isArray(e)&&e.length&&e[0]instanceof fS)this.setBuffer(t,e[0],e[1]);else if(ArrayBuffer.isView(e)||Array.isArray(e))this.setConstant(t,e);else{if(!(e.buffer instanceof fS))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 fS){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 Yw.deprecated("setElements","setElementBuffer")(),this.setElementBuffer(t,e)}}function NO(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+=NO(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 LO(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 fS){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 ${Kx(r,l)})`:(s=!0,f=`${h} bytes`),{[i]:`${o}${NO(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]:`${NO(a,{size:c,isInteger:s})} (constant)`,"Format ":`${c}x${l} (constant)`}}function jO(t,e){const{type:n,size:i}=e,r=CO(n,i);return r?`${t} (${r.name})`:t}function FO({header:t="Uniforms",program:e,uniforms:n,undefinedOnly:i=!1}){Xx(e);const r=".*Matrix",s={},o=Object.keys(e._uniformSetters).sort();let a=0;for(const u of o)!u.match(".*_.*")&&!u.match(r)&&BO({table:s,header:t,uniforms:n,uniformName:u,undefinedOnly:i})&&a++;for(const u of o)u.match(r)&&BO({table:s,header:t,uniforms:n,uniformName:u,undefinedOnly:i})&&a++;for(const u of o)s[u]||BO({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]:NO(e)})}return{table:s,count:a,unusedTable:c,unusedCount:l}}function BO({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?NO(s):"N/A","Uniform Type":o?s:"NOT PROVIDED"},0))}function VO(t){const{type:e,size:n}=t.accessor,i=CO(e,n);return i?`${i.name} ${t.name}`:t.name}const zO={POSITION:"positions",NORMAL:"normals",COLOR_0:"colors",TEXCOORD_0:"texCoords",TEXCOORD_1:"texCoords1",TEXCOORD_2:"texCoords2"};function UO(t,e){const{attributeMap:n=zO}=e||{};return n&&n[t]||t}function HO(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}Xx(Number.isFinite(e.size),`attribute ${t} needs size`)}const $O=()=>{},GO={};class WO{constructor(t,e={}){const{id:n=Zx("model")}=e;Xx(Qw(t)),this.id=n,this.gl=t,this.id=e.id||Zx("Model"),this.lastLogTime=0,this.animated=!1,this.initialize(e)}initialize(t){this.props={},this.programManager=t.programManager||PO.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={},Xx(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 Xx(Number.isFinite(t)),this.vertexCount=t,this}setInstanceCount(t){return Xx(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=UO(s,undefined);if("indices"===s)r=n;else if(n.constant)i[o]=n.value;else{const e=n.value,r=vt({},n);delete r.value,i[o]=[new fS(t,e),r],HO(s,r)}}if(r){const e=r.value||r;Xx(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 fS(t,{data:e,target:34963}),n]}return i}(this.gl,t),this.vertexArray.setAttributes(this.geometryBuffers),this}setAttributes(t={}){if(tS(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 TS(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),Yw.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&&Yw.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(GO,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(),Yw.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 Yw.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}Xx(t instanceof kO,"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 RO(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 fS&&e.delete()}}_setAnimationProps(t){this.animated&&Xx(t,"Model.draw(): animated uniforms but no animationProps")}_setFeedbackBuffers(t={}){if(tS(t))return this;const{gl:e}=this.program;return this.transformFeedback=this.transformFeedback||new oE(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:Yw.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=LO(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}: ${jO(s.name,a)}`),n[o]=LO(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&&Yw.log("MISSING UNIFORMS",Object.keys(l))(),a>0&&Yw.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 ${VO(i)}`]={[n]:JSON.stringify(i.accessor)});for(const i of t.varyingInfos)i&&(e[`out ${VO(i)}`]={[n]:JSON.stringify(i.accessor)});return e}(this.vertexArray.configuration);Yw.table(t,r)(),Yw.table(t,s)(),Yw.table(t+1,u)(),i&&i.log({logLevel:2,message:`Rendered to ${i.id}`}),Yw.groupEnd(2,`>>> DRAWING MODEL ${this.id}`)()}}class qO{static isSupported(t){return Zw(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();Xx(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 WO(e,Object.assign({},t,{fs:t.fs||sE({version:lE(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!(tS(t.feedbackBuffers)&&tS(t.feedbackMap)&&!(t.varyings&&t.varyings.length>0))})(e)&&(this.bufferTransform=new aE(t,e)),function(t){return!(tS(t._sourceTextures)&&!t._targetTexture&&!t._targetTextureVarying)}(e)&&(this.textureTransform=new wE(t,e)),Xx(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 XO(){}const YO={onStart:XO,onUpdate:XO,onInterrupt:XO,onEnd:XO};class KO{constructor(t){this._inProgress=!1,this._handle=null,this.timeline=t,this.settings={}}get inProgress(){return this._inProgress}start(t){this.cancel(),this.settings=vt(vt({},YO),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 QO={interpolation:class{constructor({gl:t,attribute:e,timeline:n}){this.gl=t,this.type="interpolation",this.transition=new KO(n),this.attribute=e,this.attributeInTransition=new ZC(t,e.settings),this.currentStartIndices=e.startIndices,this.currentLength=0,this.transform=function(t,e){const n=XC(e.size);return new qO(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 fS(t,i),new fS(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;YC(n);const r={numInstances:e,attribute:i,fromLength:this.currentLength,fromStartIndices:this.currentStartIndices,getData:t.enter};for(const s of n)QC(vt({buffer:s},r));this.currentStartIndices=i.startIndices,this.currentLength=KC(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:qC(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 KO(n),this.attribute=e,this.attributeInTransition=new ZC(t,zn(vt({},e.settings),{normalized:!1})),this.currentStartIndices=e.startIndices,this.currentLength=0,this.texture=function(t){return new xS(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 BS(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=XC(e.size);return new qO(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 fS(t,i),new fS(t,i),new fS(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)QC(vt({buffer:s},r));this.currentStartIndices=i.startIndices,this.currentLength=KC(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:qC(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]}}),YC(t),this.attributeInTransition.update({buffer:t[1],value:this.attribute.value}),NS(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 ZO{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=qO.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 Gw.warn("WebGL2 not supported by this browser. Transition for ".concat(t," is disabled."))();i&&this._removeTransition(t);const s=QO[n.type];s?this.transitions[t]=new s({attribute:e,timeline:this.timeline,gl:this.gl}):(Gw.error("unsupported transition type '".concat(n.type,"'"))(),r=!1)}(r||e.needsRedraw())&&(this.needsRedraw=!0,this.transitions[t].start(n,this.numInstances))}}const JO="attributeManager.invalidate";class tT{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 ZO(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;tE("attribute.updateStart",e),e.allocate(n)&&tE("attribute.allocate",e,n),e.updateBuffer(t)&&(this.needsRedraw=!0,tE("attribute.updateEnd",e,n))}}function eT(t,e,n,i,r){const s=e-t;return(n-e)*r+-s*i+s+e}function nT(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=WC(i)))return;const s=iT[i.type];if(!s)return void Gw.error("unsupported transition type '".concat(i.type,"'"))();const o=new s(this.timeline);o.start(zn(vt({},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 sT={COMPONENT:Symbol.for("component"),ASYNC_DEFAULTS:Symbol.for("asyncPropDefaults"),ASYNC_ORIGINAL:Symbol.for("asyncPropOriginal"),ASYNC_RESOLVED:Symbol.for("asyncPropResolved")},{COMPONENT:oT}=sT;function aT(t,e){if(!t.transitions)return null;const n={},i=dT(t);for(const r in t.transitions){const s=i[r],o=s&&s.type;("number"===o||"color"===o||"array"===o)&&cT(t[r],e[r],s)&&(n[r]=!0)}return n}function lT({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=cT(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=cT(t[s],e[s],i[s]);if(n)return"".concat(r,".").concat(s," ").concat(n)}}return null}function cT(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 uT(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(!pT(i[r],n[r])){e=t(i),n=i;break}return e}}function gT(t,e){if(!e)return t;const n=vt(vt({},t),e);if("defines"in e&&(n.defines=vt(vt({},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=vt({},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 mT(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,C=u*g-h*f,E=u*m-d*f,O=u*b-p*f,T=h*m-d*g,k=h*b-p*g,P=d*b-p*m,A=y*P-v*k+_*T+w*O-x*E+S*C;return A?(t[0]=(a*P-l*k+c*T)*(A=1/A),t[1]=(r*k-i*P-s*T)*A,t[2]=(g*S-m*x+b*w)*A,t[3]=(d*x-h*S-p*w)*A,t[4]=(l*O-o*P-c*E)*A,t[5]=(n*P-r*O+s*E)*A,t[6]=(m*_-f*S-b*v)*A,t[7]=(u*S-d*_+p*v)*A,t[8]=(o*k-a*O+c*C)*A,t[9]=(i*O-n*k-s*C)*A,t[10]=(f*x-g*_+b*y)*A,t[11]=(h*_-u*x-p*y)*A,t[12]=(a*E-o*T-l*C)*A,t[13]=(n*T-i*E+r*C)*A,t[14]=(g*v-f*w-m*y)*A,t[15]=(u*w-h*v+d*y)*A,t):null}function bT(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 yT(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 vT(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 _T(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 wT(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 xT(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 ST(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 CT(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;return 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],t}!function(){var t=new hC(4);hC!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0)}();const ET=[0,0,0,0],OT=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0],TT=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],kT=[0,0,0],PT=[0,0,0],AT=fT(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=ET,l=ET,c=t.cameraPosition;const{geospatialOrigin:u,shaderCoordinateOrigin:h,offsetMode:d}=MT(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=ST([],l,o),s=i||s,o=bT([],r,s),o=bT([],o,OT)),{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:kT,project_uScale:t.scale,project_uViewProjectionMatrix:s,project_uCameraPosition:a};if(c){const e=t.getDistanceScales(c);switch(n){case Ww.METER_OFFSETS:p.project_uCommonUnitsPerWorldUnit=e.unitsPerMeter,p.project_uCommonUnitsPerWorldUnit2=e.unitsPerMeter2;break;case Ww.LNGLAT:case Ww.LNGLAT_OFFSETS:p.project_uCommonUnitsPerWorldUnit=e.unitsPerDegree,p.project_uCommonUnitsPerWorldUnit2=e.unitsPerDegree2;break;case Ww.CARTESIAN:p.project_uCommonUnitsPerWorldUnit=[1,1,e.unitsPerMeter[2]],p.project_uCommonUnitsPerWorldUnit2=[0,0,e.unitsPerMeter2[2]]}}return p});function MT(t,e,n=PT){let i,r=n,s=!0;switch(i=e===Ww.LNGLAT_OFFSETS||e===Ww.METER_OFFSETS?n:t.isGeospatial?[Math.fround(t.longitude),Math.fround(t.latitude),0]:null,t.projectionMode){case qw.WEB_MERCATOR:(e===Ww.LNGLAT||e===Ww.CARTESIAN)&&(s=!1);break;case qw.WEB_MERCATOR_AUTO_OFFSET:e===Ww.LNGLAT?r=i:e===Ww.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 qw.IDENTITY:r=t.position.map(Math.fround);break;case qw.GLOBE:s=!1,i=null;break;default:s=!1}return r[2]=r[2]||0,{geospatialOrigin:i,shaderCoordinateOrigin:r,offsetMode:s}}class IT extends rC{get ELEMENTS(){return iC(!1),0}get RANK(){return iC(!1),0}toString(){let t="[";if(XS.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 VT).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 function(t,e,n,i,r){var s,o=1/Math.tan(e/2);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)}(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 mT(this,this),this.check()}multiplyLeft(t){return bT(this,t,this),this.check()}multiplyRight(t){return bT(this,this,t),this.check()}rotateX(t){return _T(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 wT(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,C,E,O,T,k=i[0],P=i[1],A=i[2],M=Math.hypot(k,P,A);Mn?n:t}const $T=Math.log2||function(t){return Math.log(t)*Math.LOG2E};function GT(t,e){if(!t)throw new Error(e||"@math.gl/web-mercator: assertion failed.")}const WT=Math.PI,qT=WT/4,XT=WT/180,KT=180/WT,QT=4003e4,ZT=85.051129;function JT([t,e]){return GT(Number.isFinite(t)),GT(Number.isFinite(e)&&e>=-90&&e<=90,"invalid latitude"),[512*(t*XT+WT)/(2*WT),512*(WT+Math.log(Math.tan(qT+e*XT*.5)))/(2*WT)]}function tk([t,e]){const n=t/512*(2*WT)-WT,i=2*(Math.atan(Math.exp(e/512*(2*WT)-WT))-qT);return[n*KT,i*KT]}function ek({latitude:t,longitude:e,highPrecision:n=!1}){GT(Number.isFinite(t)&&Number.isFinite(e));const i={},r=Math.cos(t*XT),s=512/360,o=s/r,a=512/QT/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=XT*Math.tan(t*XT)/r,n=512/QT*e,l=n/o*a;i.unitsPerDegree2=[0,s*e/2,n],i.unitsPerMeter2=[l,0,l]}return i}function nk(t,e){const[n,i,r]=t,[s,o,a]=e,{unitsPerMeter:l,unitsPerMeter2:c}=ek({longitude:n,latitude:i,highPrecision:!0}),u=JT(t);u[0]+=s*(l[0]+c[0]*o),u[1]+=o*(l[1]+c[1]*o);const h=tk(u),d=(r||0)+(a||0);return Number.isFinite(r)||Number.isFinite(a)?[h[0],h[1],d]:h}function ik(t){return 2*Math.atan(.5/t)*KT}function rk(t,e){const[n,i,r=0]=t;return GT(Number.isFinite(n)&&Number.isFinite(i)&&Number.isFinite(r)),zT(e,[n,i,r,1])}function sk(t,e,n=0){const[i,r,s]=t;if(GT(Number.isFinite(i)&&Number.isFinite(r),"invalid pixel coordinate"),Number.isFinite(s))return zT(e,[i,r,s,1]);const o=zT(e,[i,r,0,1]),a=zT(e,[i,r,1,1]),l=o[2],c=a[2];return NT([],o,a,l===c?0:((n||0)-l)/(c-l))}const ok=Math.PI/180;function ak(t,e,n){const{pixelUnprojectionMatrix:i}=t,r=zT(i,[e,0,1,1]),s=zT(i,[e,t.height,1,1]),o=tk(NT([],r,s,(n*t.distanceScales.unitsPerMeter[2]-r[2])/(s[2]-r[2])));return o[2]=n,o}const lk=Math.PI/180,ck=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],uk=[0,0,0],hk={unitsPerMeter:[1,1,1],metersPerUnit:[1,1,1]};let dk=(()=>{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?qw.WEB_MERCATOR:qw.WEB_MERCATOR_AUTO_OFFSET:qw.IDENTITY}equals(e){return e instanceof t&&(this===e||e.width===this.width&&e.height===this.height&&e.scale===this.scale&&nC(e.projectionMatrix,this.projectionMatrix)&&nC(e.viewMatrix,this.viewMatrix))}project(t,{topLeft:e=!0}={}){const n=rk(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=sk([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?JT(t):t}unprojectFlat(t){return this.isGeospatial?tk(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?ek({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 dk{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}=function({width:t,height:e,fovy:n=ik(1.5),altitude:i,pitch:r=0,nearZMultiplier:s=1,farZMultiplier:o=1}){void 0!==i&&(n=ik(i));const a=.5*n*XT,l=function(t){return.5/Math.tan(.5*t*XT)}(n),c=r*XT,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}}({width:h,height:d,pitch:r,altitude:p,nearZMultiplier:o,farZMultiplier:a});let _=function({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 yT(o,o,[0,0,-i]),_T(o,o,-e*XT),wT(o,o,n*XT),vT(o,o,[r/=t,r,r]),s&&yT(o,o,function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t}([],s)),o}({height:d,pitch:r,bearing:s,scale:f,altitude:p});u&&(_=(new VT).translate([512*u,0,0]).multiplyLeft(_)),super(zn(vt({},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(zn(vt({},this),{worldOffset:r})):this;this._subViewports.push(e)}}return this._subViewports}addMetersToLngLat(t,e){return nk(t,e)}panByPosition(t,e){const n=sk(e,this.pixelUnprojectionMatrix),i=DT([],this.projectFlat(t),RT([],n)),r=DT([],this.center,i),[s,o]=this.unprojectFlat(r);return{longitude:s,latitude:o}}getBounds(t={}){const e=function(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*ok:Math.atan(.5/t.altitude))>(90-t.pitch)*ok-.01?(l=ak(t,0,e),c=ak(t,n,e)):(l=r([0,0],s),c=r([n,0],s)),[o,a,c,l]}(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}=function({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}:GT(Number.isFinite(s.top)&&Number.isFinite(s.bottom)&&Number.isFinite(s.left)&&Number.isFinite(s.right));const h=JT([a,HT(u,-ZT,ZT)]),d=JT([c,HT(l,-ZT,ZT)]),p=[Math.max(Math.abs(d[0]-h[0]),i),Math.max(Math.abs(d[1]-h[1]),i)],f=[t-s.left-s.right-2*Math.abs(o[0]),e-s.top-s.bottom-2*Math.abs(o[1])];GT(f[0]>0&&f[1]>0);const g=f[0]/p[0],m=f[1]/p[1],b=tk([(d[0]+h[0])/2+(s.right-s.left)/2/g,(d[1]+h[1])/2+(s.bottom-s.top)/2/m]),y=Math.min(r,$T(Math.abs(Math.min(g,m))));return GT(Number.isFinite(y)),{longitude:b[0],latitude:b[1],zoom:y}}(vt({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 fk(t,e,n=!1){const i=e.projectPosition(t);if(n&&e instanceof pk){const[n,r,s=0]=t,o=e.getDistanceScales([n,r]);i[2]=s*o.unitsPerMeter[2]}return i}function gk(t,{viewport:e,modelMatrix:n,coordinateSystem:i,coordinateOrigin:r,offsetMode:s}){let[o,a,l=0]=t;switch(n&&([o,a,l]=ST([],[o,a,l,1],n)),i){case Ww.LNGLAT:return fk([o,a,l],e,s);case Ww.LNGLAT_OFFSETS:return fk([o+r[0],a+r[1],l+(r[2]||0)],e,s);case Ww.METER_OFFSETS:return fk(nk(r,[o,a,l]),e,s);case Ww.CARTESIAN:default:return e.isGeospatial?[o+r[0],a+r[1],l+r[2]]:e.projectPosition([o,a,l])}}const mk={10241:9987,10240:9729,10242:33071,10243:33071},bk={},yk={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||xk(t)&&(3===t.length||4===t.length),equal:(t,e,n)=>vk(t,e)},accessor:{validate(t,e){const n=Sk(t);return"function"===n||n===Sk(e.value)},equal:(t,e,n)=>"function"==typeof e||vk(t,e)},array:{validate:(t,e)=>e.optional&&!t||xk(t),equal:(t,e,n)=>n.compare?vk(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 xS)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 xS(n,zn(vt({},e),{parameters:vt(vt(vt({},mk),i),t.props.textureParameters)}));return bk[r.id]=!0,r}(n,t),release:t=>{!function(t){!t||!(t instanceof xS)||bk[t.id]&&(t.delete(),delete bk[t.id])}(t)}}};function vk(t,e){if(t===e)return!0;if(!xk(t)||!xk(e))return!1;const n=t.length;if(n!==e.length)return!1;for(let i=0;i{},this.oldProps=jk,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[Nk]||{},n=t[Rk]||t,i=t[Lk]||{};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(FC(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 PS(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=Dk(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:Bk,ASYNC_RESOLVED:Vk,ASYNC_DEFAULTS:zk}=sT,Uk={};let Hk=0,$k=(()=>{class t{constructor(){this.props=kk.apply(this,arguments),this.id=this.props.id,this.count=Hk++,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[zk])i in e[Vk]?n[i]=e[Vk][i]:i in e[Bk]&&(n[i]=e[Bk][i]);return new this.constructor(vt(vt(vt({},e),n),t))}get stats(){return this.internalState.stats}_initState(){this.internalState=new Fk({})}}return t.componentName="Component",t.defaultProps=Uk,t})();class Gk extends Fk{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 Wk=t=>"function"==typeof t,qk=t=>null!==t&&"object"==typeof t,Xk=t=>qk(t)&&t.constructor==={}.constructor,Yk=t=>t&&"function"==typeof t[Symbol.iterator],Kk=t=>t&&"function"==typeof t[Symbol.asyncIterator],Qk=t=>"undefined"!=typeof Response&&t instanceof Response||t&&t.arrayBuffer&&t.text&&t.json,Zk=t=>"undefined"!=typeof Blob&&t instanceof Blob,Jk=t=>(t=>"undefined"!=typeof ReadableStream&&t instanceof ReadableStream||qk(t)&&Wk(t.tee)&&Wk(t.cancel)&&Wk(t.getReader))(t)||(t=>qk(t)&&Wk(t.read)&&Wk(t.pipe)&&(t=>"boolean"==typeof t)(t.readable))(t);function tP(t,e){if(!t)throw new Error(e||"loader assertion failed.")}function eP(t){var e;return!!t&&(Array.isArray(t)&&(t=t[0]),Array.isArray(null===(e=t)||void 0===e?void 0:e.extensions))}function nP(t){var e,n;let i;return tP(t,"null loader"),tP(eP(t),"invalid loader"),Array.isArray(t)&&(i=t[1],t=zn(vt({},t=t[0]),{options:vt(vt({},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 iP={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},rP=iP.global||iP.self||iP.window||{},sP="object"!=typeof process||"[object process]"!==String(process)||process.browser,oP="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version);oP&&parseFloat(oP[1]);const aP={};function lP(t){for(const e in aP)t.startsWith(e)&&(t=t.replace(e,aP[e]));return!t.startsWith("http://")&&!t.startsWith("https://")&&(t=`${t}`),t}const cP=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,uP=/^([-\w.]+\/[-\w.+]+)/;function hP(t){const e=uP.exec(t);return e?e[1]:t}function dP(t){const e=cP.exec(t);return e?e[1]:""}const pP=/\?.*/;function fP(t){if(Qk(t)){const e=mP(t.url||"");return{url:e,type:hP(t.headers.get("content-type")||"")||dP(e)}}return Zk(t)?{url:mP(t.name||""),type:t.type||""}:"string"==typeof t?{url:mP(t),type:dP(t)}:{url:"",type:""}}function gP(t){return Qk(t)?t.headers["content-length"]||-1:Zk(t)?t.size:"string"==typeof t?t.length:t instanceof ArrayBuffer||ArrayBuffer.isView(t)?t.byteLength:-1}function mP(t){return t.replace(pP,"")}function bP(t){return yP.apply(this,arguments)}function yP(){return(yP=PS(function*(t){if(Qk(t))return t;const e={},n=gP(t);n>=0&&(e["content-length"]=String(n));const{url:i,type:r}=fP(t);r&&(e["content-type"]=r);const s=yield SP(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 vP(t){return _P.apply(this,arguments)}function _P(){return(_P=PS(function*(t){if(!t.ok){const e=yield wP(t);throw new Error(e)}})).apply(this,arguments)}function wP(t){return xP.apply(this,arguments)}function xP(){return(xP=PS(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 SP(t){return CP.apply(this,arguments)}function CP(){return(CP=PS(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,${EP(t.slice(0,5))}`:null})).apply(this,arguments)}function EP(t){let e="";const n=new Uint8Array(t);for(let i=0;i{}}info(){return()=>{}}warn(){return()=>{}}error(){return()=>{}}}const MP={fetch:null,mimeType:void 0,nothrow:!1,log:new class{constructor(){kP(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:[]},IP={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 DP(){rP.loaders=rP.loaders||{};const{loaders:t}=rP;return t._state=t._state||{},t._state}const RP=()=>{const t=DP();return t.globalOptions=t.globalOptions||vt({},MP),t.globalOptions};function NP(t,e,n,i){return n=n||[],function(t,e){jP(t,null,MP,IP,e);for(const n of e)jP(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=vt({},t.options||{});return function(t,e){e&&!("baseUri"in t)&&(t.baseUri=e)}(i,n),null===i.log&&(i.log=new AP),BP(i,RP()),BP(i,e),i}(e,t,i)}function LP(t,e){const n=RP(),i=t||n;return"function"==typeof i.fetch?i.fetch:qk(i.fetch)?t=>OP(t,i):null!=e&&e.fetch?null==e?void 0:e.fetch:OP}function jP(t,e,n,i,r){const s=e||"Top level",o=e?`${e}.`:"";for(const a in t){const l=!e&&qk(t[a]),c="baseUri"===a&&!e,u="workerUrl"===a&&e;if(!(a in n)&&!c&&!u)if(a in i)PP.warn(`${s} loader option '${o}${a}' no longer supported, use '${i[a]}'`)();else if(!l){const t=FP(a,r);PP.warn(`${s} loader option '${o}${a}' not recognized. ${t}`)()}}}function FP(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 BP(t,e){for(const n in e)n in e&&(t[n]=Xk(e[n])&&Xk(t[n])?vt(vt({},t[n]),e[n]):e[n])}function VP(t,e){if(!t)throw new Error(e||"loaders.gl assertion failed.")}function zP(t,e="3.0.12"){return VP(t,"no worker provided"),!(!e||!t.version)}const UP={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},HP=UP.global||UP.self||UP.window||{},$P="object"!=typeof process||"[object process]"!==String(process)||process.browser,GP="function"==typeof importScripts,WP="undefined"!=typeof window&&void 0!==window.orientation,qP="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version),XP=(qP&&parseFloat(qP[1]),new Map);function YP(t){const e=new Blob([t],{type:"application/javascript"});return URL.createObjectURL(e)}function KP(t,e=!0,n){const i=n||new Set;if(t)if(QP(t))i.add(t);else if(QP(t.buffer))i.add(t.buffer);else if(!ArrayBuffer.isView(t)&&e&&"object"==typeof t)for(const r in t)KP(t[r],e,i);return void 0===n?Array.from(i):[]}function QP(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 ZP=()=>{};class JP{static isSupported(){return"undefined"!=typeof Worker}constructor(t){kP(this,"name",void 0),kP(this,"source",void 0),kP(this,"url",void 0),kP(this,"terminated",!1),kP(this,"worker",void 0),kP(this,"onMessage",void 0),kP(this,"onError",void 0),kP(this,"_loadableURL","");const{name:e,source:n,url:i}=t;VP(n||i),this.name=e,this.source=n,this.url=i,this.onMessage=ZP,this.onError=t=>console.log(t),this.worker=this._createBrowserWorker()}destroy(){this.onMessage=ZP,this.onError=ZP,this.worker.terminate(),this.terminated=!0}get isRunning(){return Boolean(this.onMessage)}postMessage(t,e){e=e||KP(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){VP(t.source&&!t.url||!t.source&&t.url);let e=XP.get(t.source||t.url);return e||(t.url&&(e=function(t){return t.startsWith("http")?YP(function(t){return`try {\n importScripts('${t}');\n} catch (error) {\n console.error(error);\n throw error;\n}`}(t)):t}(t.url),XP.set(t.url,e)),t.source&&(e=YP(t.source),XP.set(t.source,e))),VP(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 tA{constructor(t,e){kP(this,"name",void 0),kP(this,"workerThread",void 0),kP(this,"isRunning",void 0),kP(this,"result",void 0),kP(this,"_resolve",void 0),kP(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){VP(this.isRunning),this.isRunning=!1,this._resolve(t)}error(t){VP(this.isRunning),this.isRunning=!1,this._reject(t)}}class eA{constructor(t){kP(this,"name","unnamed"),kP(this,"source",void 0),kP(this,"url",void 0),kP(this,"maxConcurrency",1),kP(this,"maxMobileConcurrency",1),kP(this,"onDebug",()=>{}),kP(this,"reuseWorkers",!0),kP(this,"props",{}),kP(this,"jobQueue",[]),kP(this,"idleQueue",[]),kP(this,"count",0),kP(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=vt(vt({},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 PS(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 PS(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 tA(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 iA{static isSupported(){return JP.isSupported()}static getWorkerFarm(t={}){return iA._workerFarm=iA._workerFarm||new iA({}),iA._workerFarm.setProps(t),iA._workerFarm}constructor(t){kP(this,"props",void 0),kP(this,"workerPools",new Map),this.props=vt({},nA),this.setProps(t),this.workerPools=new Map}destroy(){for(const t of this.workerPools.values())t.destroy()}setProps(t){this.props=vt(vt({},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 eA({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 rA(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 VP(i),i}function sA(t,e){return!!iA.isSupported()&&t.worker&&(null==e?void 0:e.worker)}function oA(t,e,n,i,r){return aA.apply(this,arguments)}function aA(){return(aA=PS(function*(t,e,n,i,r){const s=t.id,o=rA(t,n),a=iA.getWorkerFarm(n).getWorkerPool({name:s,url:o});n=JSON.parse(JSON.stringify(n));const l=yield a.startJob("process-on-worker",lA.bind(null,r));return l.postMessage("process",{input:e,options:n}),yield(yield l.result).result})).apply(this,arguments)}function lA(t,e,n,i){return cA.apply(this,arguments)}function cA(){return(cA=PS(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)}kP(iA,"_workerFarm",void 0);var uA=n(9521);function hA(t){if(function(t){return t&&"object"==typeof t&&t.isBuffer}(t)&&(t=function(t){return uA.toArrayBuffer?uA.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 dA(...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 pA(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 fA(t){return gA.apply(this,arguments)}function gA(){return(gA=PS(function*(t){const e=[];var n,i=!0,r=!1;try{for(var s,o,a=Dk(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 dA(...e)})).apply(this,arguments)}const mA=262144;function bA(t){this.wrapped=t}function yA(t){return new bA(t)}function vA(t){var e,n;function i(e,n){try{var s=t[e](n),o=s.value,a=o instanceof bA;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 _A(t){return function(){return new vA(t.apply(this,arguments))}}function wA(){return(wA=_A(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(OA)}function kA(t,e,n){return PA.apply(this,arguments)}function PA(){return(PA=PS(function*(t,e,n){const i=t instanceof ArrayBuffer||ArrayBuffer.isView(t);if("string"==typeof t||i)return TA(t,e);if(Zk(t)&&(t=yield bP(t)),Qk(t)){const n=t;return yield vP(n),e.binary?yield n.arrayBuffer():yield n.text()}if(Jk(t)&&(t=EA(t,n)),Yk(t)||Kk(t))return fA(t);throw new Error(OA)})).apply(this,arguments)}function AA(t,e,n=null){if(n)return n;const i=vt({fetch:LP(e,t)},t);return Array.isArray(i.loaders)||(i.loaders=null),i}function MA(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 IA=()=>{const t=DP();return t.loaderRegistry=t.loaderRegistry||[],t.loaderRegistry};function DA(t){const e=IA();t=Array.isArray(t)?t:[t];for(const n of t){const t=nP(n);e.find(e=>t===e)||e.unshift(t)}}const RA=/\.([^.]+)$/;function NA(t){return LA.apply(this,arguments)}function LA(){return(LA=PS(function*(t,e=[],n,i){if(!FA(t))return null;let r=jA(t,e,zn(vt({},n),{nothrow:!0}),i);if(r)return r;if(Zk(t)&&(r=jA(t=yield t.slice(0,10).arrayBuffer(),e,n,i)),!(r||null!=n&&n.nothrow))throw new Error(BA(t));return r})).apply(this,arguments)}function jA(t,e=[],n,i){if(!FA(t))return null;if(e&&!Array.isArray(e))return nP(e);let r=[];e&&(r=r.concat(e)),null!=n&&n.ignoreRegisteredLoaders||r.push(...IA()),function(t){for(const e of t)nP(e)}(r);const s=function(t,e,n,i){const{url:r,type:s}=fP(t),o=r||(null==i?void 0:i.url);let a=null;return null!=n&&n.mimeType&&(a=VA(e,null==n?void 0:n.mimeType)),a=a||function(t,e){const n=e&&RA.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||VA(e,s),a=a||function(t,e){if(!e)return null;for(const n of t)if("string"==typeof e){if(zA(e,n))return n}else if(ArrayBuffer.isView(e)){if(UA(e.buffer,e.byteOffset,n))return n}else if(e instanceof ArrayBuffer&&UA(e,0,n))return n;return null}(e,t),a=a||VA(e,null==n?void 0:n.fallbackMimeType),a}(t,r,n,i);if(!(s||null!=n&&n.nothrow))throw new Error(BA(t));return s}function FA(t){return!(t instanceof Response&&204===t.status)}function BA(t){const{url:e,type:n}=fP(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)?HA(t.buffer,t.byteOffset,e):t instanceof ArrayBuffer?HA(t,0,e):""}(t)}", contentType: "${n}"`),e&&(i+=` url: ${e}`),i}function VA(t,e){for(const n of t)if(n.mimeTypes&&n.mimeTypes.includes(e)||e===`application/x.${n.id}`)return n;return null}function zA(t,e){return e.testText?e.testText(t):(Array.isArray(e.tests)?e.tests:[e.tests]).some(e=>t.startsWith(e))}function UA(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 JA=new Uint8ClampedArray(0);const tM={data:{type:"data",value:QA,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=zn(vt({},r),{fetch:zn(vt({},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:XA(t,i),persistent:!1}),l=!0),l?o.subscribe({resourceId:t,onChange:t=>n.internalState.reloadAsyncProp(e,t),consumerId:n.id,requestId:e}):XA(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:Ww.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 eM=(()=>{class t extends $k{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=gk(t,{viewport:e,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem}),[i,r,s]=rk(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=vt({},t);let{coordinateSystem:n}=t;const{viewport:i,coordinateOrigin:r,fromCoordinateSystem:s,fromCoordinateOrigin:o}=t;return n===Ww.DEFAULT&&(n=i.isGeospatial?Ww.LNGLAT:Ww.CARTESIAN),void 0===s&&(e.fromCoordinateSystem=n),void 0===o&&(e.fromCoordinateOrigin=r),e.coordinateSystem=n,e}(e),{geospatialOrigin:l,shaderCoordinateOrigin:c,offsetMode:u}=MT(n,i,r),h=gk(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===Ww.DEFAULT||t===Ww.LNGLAT||t===Ww.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){RC(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=gT(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||!ZA({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(JA.length/3);if(this.internalState.usesPickingColorCache=!0,nKA&&Gw.warn("Layer has too many data objects. Picking might not be able to distinguish all objects.")(),JA=GS.allocate(JA,e,{size:3,copy:!0,maxCount:Math.max(e,KA)});const t=Math.floor(JA.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&&tE("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=lT({newProps:t,oldProps:e,propTypes:dT(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&&hT(t,e,"all"))return{all:!0};const n={};let i=!1;for(const r in t.updateTriggers)"all"!==r&&hT(t,e,r)&&(n[r]=!0,i=n);return i}(t,e)),{dataChanged:i,propsChanged:n,updateTriggersChanged:r,extensionsChanged:uT(t,e),transitionsChanged:aT(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=dT(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 tT(this.context.gl,{id:this.props.id,stats:this.context.stats,timeline:this.context.timeline})}_initState(){RC(!this.internalState&&!this.state),RC(isFinite(this.props.coordinateSystem));const t=this._getAttributeManager();t&&t.addInstanced({instancePickingColors:{type:5121,size:3,noAlloc:!0,update:this.calculateInstancePickingColors}}),this.internalState=new Gk({attributeManager:t,layer:this}),this.clearChangeFlags(),this.state={},Object.defineProperty(this.state,"attributeManager",{get:()=>(Gw.deprecated("layer.state.attributeManager","layer.getAttributeManager()"),t)}),this.internalState.layer=this,this.internalState.uniformTransitions=new rT(this.context.timeline),this.internalState.onAsyncPropUpdated=this._onAsyncPropUpdated.bind(this),this.internalState.setAsyncProps(this.props)}_transferState(t){tE("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=tM,t})(),nM=(()=>{class t extends eM{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=vt(vt({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=BC(t,Boolean),this.internalState.subLayers=t),tE("compositeLayer.renderLayers",this,e,t);for(const n of t)n.parent=this}}return t.layerName="CompositeLayer",t})();const iM=/([0-9]+\.?[0-9]*)(%|px)/;function rM(t){switch(typeof t){case"number":return{position:t,relative:!1};case"string":const e=t.match(iM);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 sM(t,e){return t.relative?Math.round(t.position*e):t.position}function oM(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)&&oM(i,r)))return!1}return!0}class aM{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=dk}=t;RC(!h||h instanceof dk),this.viewportInstance=h,this.id=e||this.constructor.displayName||"view",this.type=d,this.props=zn(vt({},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):oM(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=vt({},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:sM(this._x,t),y:sM(this._y,e),width:sM(this._width,t),height:sM(this._height,e)}}_getControllerProps(t){let e=this.props.controller;return e?!0===e?t:("function"==typeof e&&(e={type:e}),vt(vt({},t),e)):null}_getViewport(t,e){const{type:n}=this;return new n(vt(vt(vt({},t),this.props),e))}_parseDimensions({x:t,y:e,width:n,height:i}){this._x=rM(t),this._y=rM(e),this._width=rM(n),this._height=rM(i)}}const lM=()=>{},cM={transitionEasing:t=>t,transitionInterruption:1,onTransitionStart:lM,onTransitionInterrupt:lM,onTransitionEnd:lM};class uM{constructor(t,e={}){this.ControllerState=t,this.props=vt(vt({},cM),e),this.propsInTransition=null,this.transition=new KO(e.timeline),this.onViewStateChange=e.onViewStateChange||lM,this.onStateChange=e.onStateChange||lM,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=vt(vt({},cM),t),this.props=t,this._shouldIgnoreViewportChange(n,t))return e;if(this._isTransitionEnabled(t)){const{interruption:i,endProps:r}=this.transition.settings,s=vt(vt({},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(vt(vt({},this.props),l)).getViewportProps(),this.onViewStateChange({viewState:this.propsInTransition,oldViewState:this.props})}}const hM=["longitude","latitude","zoom","bearing","pitch"],dM=["longitude","latitude","zoom"];class pM 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)||!nC(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];RC(Number.isFinite(n)||Array.isArray(n),"".concat(e," is required for transition"))})}}{constructor(t={}){super((Array.isArray(t)?t:t.transitionProps)||{compare:hM,extract:hM,required:dM}),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]=eC(t[r]||0,e[r]||0,n);if(e.aroundPosition){const r=this.opts.makeViewport(vt(vt({},e),i));Object.assign(i,r.panByPosition(e.aroundPosition,eC(t.around,e.around,n)))}return i}}const fM={transitionDuration:0},gM={transitionDuration:300,transitionEasing:t=>t,transitionInterruption:1},mM=t=>1-(1-t)*(1-t),bM=["wheel"],yM=["panstart","panmove","panend"],vM=["pinchstart","pinchmove","pinchend"],_M=["tripanstart","tripanmove","tripanend"],wM=["doubletap"],xM=["keydown"];class SM{constructor(t,e={}){this.ControllerState=t,this.controllerState=null,this.controllerStateProps=null,this.eventManager=null,this.transitionManager=new uM(t,zn(vt({},e),{onViewStateChange:this._onTransition.bind(this),onStateChange:this._setInteractionState.bind(this)}));const n=this.linearTransitionProps;this._transition=n&&zn(vt({},gM),{transitionInterpolator:new pM({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(vt(vt({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(bM,c&&n),this.toggleEvents(yM,c&&(i||r)),this.toggleEvents(vM,c&&(o||a)),this.toggleEvents(_M,c&&a),this.toggleEvents(wM,c&&s),this.toggleEvents(xM,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=vt(vt({},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,fM,{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,fM,{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,zn(vt({},this._getTransitionProps()),{transitionDuration:e,transitionEasing:mM}),{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,fM,{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,zn(vt({},this._getTransitionProps()),{transitionDuration:e,transitionEasing:mM}),{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,zn(vt({},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,fM,{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,fM,{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,zn(vt({},this._getTransitionProps()),{transitionDuration:e,transitionEasing:mM}),{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,fM,{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,fM,{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,zn(vt({},this._getTransitionProps({around:i})),{transitionDuration:e,transitionEasing:mM}),{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?zn(vt({},e),{transitionInterpolator:new pM(zn(vt({},t),{transitionProps:this.linearTransitionProps,makeViewport:this.controllerState.makeViewport}))}):e:fM}}class CM{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 EM=[0,0,0];class OM extends CM{constructor({makeViewport:t,width:e,height:n,rotationX:i=0,rotationOrbit:r=0,target:s=EM,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=vt({},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(zn(vt({},this._viewportProps),{zoom:o}));return this._getUpdatedState(vt({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),tC(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 OM(vt(vt(vt({},this._viewportProps),this._state),t))}_applyConstraints(t){const{maxZoom:e,minZoom:n,zoom:i,maxRotationX:r,minRotationX:s,rotationOrbit:o}=t;return t.zoom=tC(i,n,e),t.rotationX=tC(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 TM extends SM{constructor(t){super(OM,t)}get linearTransitionProps(){return["target","zoom","rotationX","rotationOrbit"]}}class kM extends SM{constructor(t){t.dragMode=t.dragMode||"pan",super(OM,t)}_onPanRotate(t){return!1}get linearTransitionProps(){return["target","zoom"]}}const PM=(new VT).lookAt({eye:[0,0,1]});function AM({width:t,height:e,near:n,far:i}){return t=t||1,e=e||1,(new VT).ortho({left:-t/2,right:t/2,bottom:-e/2,top:e/2,near:n,far:i})}class MM extends dk{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(zn(vt({},t),{longitude:null,position:o,viewMatrix:PM.clone().scale([l,l*(a?-1:1),l]),projectionMatrix:AM({width:e,height:n,near:i,far:r}),zoom:s}))}panByPosition(t,e){const n=DT([],t,RT([],sk(e,this.pixelUnprojectionMatrix)));return{target:DT([],this.center,n)}}}let IM=(()=>{class t extends aM{constructor(t){super(zn(vt({},t),{type:MM}))}get controller(){return this._getControllerProps({type:kM})}}return t.displayName="OrthographicView",t})();const DM=Math.PI/180;function RM({height:t,fovy:e,orbitAxis:n,rotationX:i,rotationOrbit:r,zoom:s}){const o=.5/Math.tan(e*DM/2),a="Z"===n?[0,0,1]:[0,1,0],l="Z"===n?[0,-o,0]:[0,0,o],c=(new VT).lookAt({eye:l,up:a});c.rotateX(i*DM),"Z"===n?c.rotateZ(r*DM):c.rotateY(r*DM);const u=Math.pow(2,s)/(t||1);return c.scale(u),c}class NM extends dk{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(zn(vt({},t),{longitude:null,viewMatrix:RM({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]=sk([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 LM=(()=>{class t extends aM{constructor(t={}){const{orbitAxis:e="Z"}=t;super(zn(vt({},t),{orbitAxis:e,type:NM}))}get controller(){return this._getControllerProps({type:TM})}}return t.displayName="OrbitView",t})();const jM=[255,255,255],FM=1;let BM=0;class VM{constructor(t={}){const{color:e=jM}=t,{intensity:n=FM}=t;this.id=t.id||"ambient-".concat(BM++),this.color=e,this.intensity=n,this.type="ambient"}}const zM=[255,255,255],UM=1,HM=[0,0,-1];let $M=0;class GM{constructor(t={}){const{color:e=zM}=t,{intensity:n=UM}=t,{direction:i=HM}=t,{_shadow:r=!1}=t;this.id=t.id||"directional-".concat($M++),this.color=e,this.intensity=n,this.type="directional",this.direction=new OC(i).normalize().toArray(),this.shadow=r}getProjectedLight(){return this}}class WM{constructor(t={}){const{id:e="effect"}=t;this.id=e,this.props=vt({},t)}preRender(){}getModuleParameters(){}cleanup(){}}class qM extends class{constructor(t,e={}){const{id:n="pass"}=e;this.id=n,this.gl=t,this.props=vt({},e)}setProps(t){Object.assign(this.props,t)}render(){}cleanup(){}}{render(t){return Mx(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){Mx(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=XM(),l={viewport:t,isPicking:n.startsWith("picking"),renderPass:n};for(let c=0;cTS(t,e))}const a={totalCount:e.length,visibleCount:0,compositeCount:0,pickableCount:0};Mx(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]||XM(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 YM extends qM{constructor(t,e){super(t,e),this.shadowMap=new xS(t,{width:1,height:1,parameters:{10241:9729,10240:9729,10242:33071,10243:33071}}),this.depthBuffer=new ES(t,{format:33189,width:1,height:1}),this.fbo=new BS(t,{id:"shadowmap",width:1,height:1,attachments:{36064:this.shadowMap,36096:this.depthBuffer}})}render(t){const e=this.fbo;Ix(this.gl,{depthRange:[0,1],depthTest:!0,blend:!1,clearColor:[1,1,1,1]},()=>{const n=t.viewports[0],i=Rx(this.gl),r=n.width*i,s=n.height*i;(r!==e.width||s!==e.height)&&e.resize({width:r,height:s}),super.render(zn(vt({},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 KM=Object.keys(Ww).map(t=>"const int COORDINATE_SYSTEM_".concat(t," = ").concat(Ww[t],";")).join(""),QM=Object.keys(qw).map(t=>"const int PROJECTION_MODE_".concat(t," = ").concat(qw[t],";")).join("");var ZM="".concat(KM,"\n").concat(QM,"\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 JM={};var tI={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:ZM,getUniforms:function(t=JM){return t.viewport?function({viewport:t,devicePixelRatio:e=1,modelMatrix:n=null,coordinateSystem:i=Ww.DEFAULT,coordinateOrigin:r,autoWrapLongitude:s=!1}={}){i===Ww.DEFAULT&&(i=t.isGeospatial?Ww.LNGLAT:Ww.CARTESIAN);const o=AT({viewport:t,devicePixelRatio:e,coordinateSystem:i,coordinateOrigin:r});return o.project_uWrapLongitude=s,o.project_uModelMatrix=n||TT,o}(t):{}}};const eI=fT(function({viewport:t,center:e}){return new VT(t.viewProjectionMatrix).invert().transform(e)}),nI=fT(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=sk([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 OC(t.center).negate()),i=s.map(t=>e.transform(t)),r=(new VT).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}),iI=[0,0,0,1],rI=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0];var sI={name:"shadow",dependencies:[tI],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||iI,shadow_uLightId:t.shadowLightId||0,shadow_uLightCount:t.shadowMatrices.length},i=eI({viewport:t.viewport,center:e.project_uCenter}),r=[],s=nI({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 oI={color:[255,255,255],intensity:1},aI=[{color:[255,255,255],intensity:1,direction:[-1,3,-1]},{color:[255,255,255],intensity:.9,direction:[1,-8,-2.5]}],lI=[0,0,0,200/255];class cI extends WM{constructor(t){super(t),this.ambientLight=null,this.directionalLights=[],this.pointLights=[],this.shadowColor=lI,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=PO.getDefaultProgramManager(t),sI&&this.programManager.addDefaultModule(sI)),this.dummyShadowMap||(this.dummyShadowMap=new xS(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(sI),this.programManager=null)}_createLightMatrix(){const t=[];for(const e of this.directionalLights){const n=(new VT).lookAt({eye:new OC(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=hI++;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 pI{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=XA(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 fI{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 pI(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 gI=[{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"},tI],mI=["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 bI(t){const e=PO.getDefaultProgramManager(t);for(const n of gI)e.addDefaultModule(n);for(const n of mI)e.addShaderHook(n);return e}const yI=Object.seal({layerManager:null,resourceManager:null,deck:null,gl:null,stats:null,shaderCache:null,pickingFBO:null,mousePosition:null,userData:{}});class vI{constructor(t,{deck:e,stats:n,viewport:i,timeline:r}={}){this.lastRenderedLayers=[],this.layers=[],this.resourceManager=new fI({gl:t,protocol:"deck://"}),this.context=zn(vt({},yI),{layerManager:this,gl:t,deck:e,programManager:t&&bI(t),stats:n||new Gx({id:"deck.gl"}),viewport:i||new dk({id:"DEFAULT-INITIAL-VIEWPORT"}),timeline:r||new dI,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){tE("layerManager.setLayers",this,e,t),this.lastRenderedLayers=t,t=BC(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 tE("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]?Gw.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&&Gw.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 _I{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=BC(t,Boolean),this._diffViews(t,this.views)&&this.setNeedsUpdate("views changed"),this.views=t}_setViewState(t){t?(!oM(t,this.viewState)&&this.setNeedsUpdate("viewState changed"),this.viewState=t):Gw.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)(vt({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=zn(vt(vt(vt({},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 wI extends CM{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}={}){RC(Number.isFinite(r)),RC(Number.isFinite(i)),RC(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(zn(vt({},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(zn(vt({},this._viewportProps),{zoom:s}));return this._getUpdatedState(vt({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=vt({},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(vt(vt(vt({makeViewport:this.makeViewport},this._viewportProps),this._state),t))}_applyConstraints(t){const{maxZoom:e,minZoom:n,zoom:i}=t;t.zoom=tC(i,n,e);const{maxPitch:r,minPitch:s,pitch:o}=t;t.pitch=tC(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=UT(n+180,360)-180),(o<-180||o>180)&&(o=UT(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=tk([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 tC(e+Math.log2(t),i,n)}_calculateNewPitchAndBearing({deltaScaleX:t,deltaScaleY:e,startBearing:n,startPitch:i}){e=tC(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 xI extends SM{constructor(t){t.dragMode=t.dragMode||"pan",super(wI,t)}setProps(t){const e=this.controllerStateProps;super.setProps(t),(!e||e.height!==t.height)&&this.updateViewport(new this.ControllerState(vt(vt({makeViewport:this.makeViewport},this.controllerStateProps),this._state)))}get linearTransitionProps(){return["longitude","latitude","zoom","bearing","pitch"]}}let SI=(()=>{class t extends aM{constructor(t){super(zn(vt({},t),{type:pk}))}get controller(){return this._getControllerProps({type:xI})}}return t.displayName="MapView",t})();const CI=new cI;class EI{constructor(){this.effects=[],this._internalEffects=[],this._needsRedraw="Initial render",this.setEffects()}setProps(t){"effects"in t&&(t.effects.length!==this.effects.length||!oM(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 cI)||this._internalEffects.push(CI)}}class OI extends qM{}const TI={blendFunc:[1,0,32771,0],blendEquation:32774};class kI extends qM{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,Ix(p,zn(vt({scissorTest:!0,scissor:[o,a,l,c],clearColor:[0,0,0,0],depthMask:!0,depthTest:!0,depthRange:[0,1],colorMask:[!0,!0,!0,!0]},TI),{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}:zn(vt({},TI),{blend:!0,blendColor:[0,0,0,this.useAlpha?(e+1)/255:1]});return vt(vt({},t.props.parameters),n)}}class PI{constructor(t){this.gl=t,this.layerFilter=null,this.drawPickingColors=!1,this.drawLayersPass=new OI(t),this.pickLayersPass=new kI(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||BS.getDefaultFramebuffer(this.gl),this._preRender(t.effects,t);const n=this.lastPostProcessEffect?this.renderBuffers[0]:t.target,i=e.render(zn(vt({},t),{target:n}));this._postRender(t.effects,t),this.renderCount++,tE("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 BS(this.gl),new BS(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 AI={pickedColor:null,pickedLayer:null,pickedObjectIndex:-1};function MI({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}}Gw.error("Picked non-existent layer. Is picking buffer corrupt?")()}}return AI}function II({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 DI(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=II(t),u=new Map;return u.set(null,c),l.forEach(t=>{let e=vt({},c);t===o&&(e.color=s,e.index=a,e.picked=!0),e=RI({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 RI({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 NI{constructor(t){this.gl=t,this.pickingFBO=null,this.pickLayersPass=new kI(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?vt(vt({},r),u):Object.assign(u,{color:null,object:null,index:-1})}_resizeBuffer(){const{gl:t}=this;return this.pickingFBO||(this.pickingFBO=new BS(t),BS.isSupported(t,{colorBufferFloat:!0})&&(this.depthFBO=new BS(t),this.depthFBO.attach({36064:new xS(t,{format:Zw(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?(Gw.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:II({viewports:n,x:i,y:r})};this._resizeBuffer();const u=Rx(this.gl),h=Nx(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)}):Gw.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=RI({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 NS(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 LI={zIndex:1,position:"absolute",pointerEvents:"none",color:"#a0a7b4",backgroundColor:"#29323c",padding:"10px",top:0,left:0,display:"none"};class jI{constructor(t){const e=t.parentElement;e&&(this.el=document.createElement("div"),this.el.className="deck-tooltip",Object.assign(this.el.style,LI),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 FI(t,e){if(!t)throw new Error(e)}const BI={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},VI=BI.global||BI.self||BI.window,zI="object"!=typeof process||"[object process]"!==String(process)||process.browser,UI="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version),{_parseImageNode:HI}=(UI&&parseFloat(UI[1]),VI),$I="undefined"!=typeof Image,GI="undefined"!=typeof ImageBitmap,WI=Boolean(HI),qI=!!zI||WI;function XI(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 YI(t){switch(XI(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 KI=/^data:image\/svg\+xml/,QI=/\.svg((\?|#).*)?$/;function ZI(t){return t&&(KI.test(t)||QI.test(t))}function JI(t,e){if(ZI(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 tD(t,e)}function tD(t,e){if(ZI(e))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(t)])}function eD(t,e,n){return nD.apply(this,arguments)}function nD(){return(nD=PS(function*(t,e,n){const i=JI(t,n),r=self.URL||self.webkitURL,s="string"!=typeof i&&r.createObjectURL(i);try{return yield iD(s||i,e)}finally{s&&r.revokeObjectURL(s)}})).apply(this,arguments)}function iD(t,e){return rD.apply(this,arguments)}function rD(){return(rD=PS(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 sD={};let oD=!0;function aD(t,e,n){return lD.apply(this,arguments)}function lD(){return(lD=PS(function*(t,e,n){let i;i=ZI(n)?yield eD(t,e,n):tD(t,n);const r=e&&e.imagebitmap;return yield cD(i,r)})).apply(this,arguments)}function cD(t){return uD.apply(this,arguments)}function uD(){return(uD=PS(function*(t,e=null){if((hD(e)||!oD)&&(e=null),e)try{return yield createImageBitmap(t,e)}catch(n){console.warn(n),oD=!1}return yield createImageBitmap(t)})).apply(this,arguments)}function hD(t){for(const e in t||sD)return!1;return!0}const dD=!1,pD=!0;function fD(t){const e=gD(t);return function(t){const e=gD(t);return e.byteLength>=24&&2303741511===e.getUint32(0,dD)?{mimeType:"image/png",width:e.getUint32(16,dD),height:e.getUint32(20,dD)}:null}(e)||function(t){const e=gD(t);if(!(e.byteLength>=3&&65496===e.getUint16(0,dD)&&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,dD)?{mimeType:"image/gif",width:e.getUint16(6,pD),height:e.getUint16(8,pD)}:null}(e)||function(t){const e=gD(t);return e.byteLength>=14&&16973===e.getUint16(0,dD)&&e.getUint32(2,pD)===e.byteLength?{mimeType:"image/bmp",width:e.getUint32(18,pD),height:e.getUint32(22,pD)}:null}(e)}function gD(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 mD(t,e){const{mimeType:n}=fD(t)||{},{_parseImageNode:i}=VI;return FI(i),i(t,n,e)}function bD(){return(bD=PS(function*(t,e,n){const i=((e=e||{}).image||{}).type||"auto",{url:r}=n||{};let s;switch(yD(i)){case"imagebitmap":s=yield aD(t,e,r);break;case"image":s=yield eD(t,e,r);break;case"data":s=yield mD(t,e);break;default:FI(!1)}return"data"===i&&(s=YI(s)),s})).apply(this,arguments)}function yD(t){switch(t){case"auto":case"data":return function(){if(GI)return"imagebitmap";if($I)return"image";if(qI)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}();default:return function(t){switch(t){case"auto":return GI||$I||qI;case"imagebitmap":return GI;case"image":return $I;case"data":return qI;default:throw new Error(`@loaders.gl/images: image ${t} not supported in this environment`)}}(t),t}}const vD={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 bD.apply(this,arguments)},tests:[t=>Boolean(fD(new DataView(t)))],options:{image:{type:"auto",decode:!0}}};var _D=n(84761),wD={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 xD="8.5.8",SD=_D.CO.deck&&_D.CO.deck.VERSION;if(SD&&SD!==xD)throw new Error("deck.gl - multiple versions detected: ".concat(SD," vs ").concat(xD));SD||(Gw.log(1,"deck.gl ".concat(xD))(),_D.CO.deck=Object.assign(_D.CO.deck||{},{VERSION:xD,version:xD,log:Gw,_registerLoggers:function(t){JC=t}}),DA([wD,[vD,{imagebitmap:{premultiplyAlpha:"none"}}]]));var CD=_D.CO.deck;class ED extends iS{get[Symbol.toStringTag](){return"Query"}static isSupported(t,e=[]){const n=Zw(t),i=US(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:Xx(!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 ED.isSupported(this.gl)?this.gl2.createQuery():null}_deleteHandle(){this.gl2.deleteQuery(this.handle)}}const OD=Dx()&&"undefined"!=typeof document;let TD=0;class kD{constructor(t={}){const{onCreateContext:e=(t=>zx(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=qx.get("animation-loop-"+TD++)}=t;let{useDevicePixels:f=!0}=t;"useDevicePixelRatio"in t&&(Yw.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 Xx("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=ED.isSupported(this.gl,["timers"])?new ED(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 PS(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 Yw.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?Ux(this.props.gl,t):this.onCreateContext(t),!Qw(this.gl))throw new Error("AnimationLoop.onCreateContext - illegal context returned");(function(t){Mx(t,px)})(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)&&(Yw.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)&&(Yw.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 BS(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 PD=n(11524),AD=n.n(PD);const MD={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}))}}(AD().MouseInput);const ID=AD().Manager;var DD=AD();const RD=DD?[[DD.Pan,{event:"tripan",pointers:3,threshold:0,enable:!1}],[DD.Rotate,{enable:!1}],[DD.Pinch,{enable:!1}],[DD.Swipe,{enable:!1}],[DD.Pan,{threshold:0,enable:!1}],[DD.Press,{enable:!1}],[DD.Tap,{event:"doubletap",taps:2,enable:!1}],[DD.Tap,{event:"anytap",enable:!1}],[DD.Tap,{enable:!1}]]:null,ND={tripan:["rotate","pinch","pan"],rotate:["pinch"],pinch:["pan"],pan:["press","doubletap","anytap","tap"],doubletap:["anytap"],anytap:["tap"]},LD={doubletap:["tap"]},jD={pointerdown:"pointerdown",pointermove:"pointermove",pointerup:"pointerup",touchstart:"pointerdown",touchmove:"pointermove",touchend:"pointerup",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup"},FD={KEY_EVENTS:["keydown","keyup"],MOUSE_EVENTS:["mousedown","mousemove","mouseup","mouseover","mouseout","mouseleave"],WHEEL_EVENTS:["wheel","mousewheel"]},BD={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"},VD={click:"tap",anyclick:"anytap",dblclick:"doubletap",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup",mouseover:"pointerover",mouseout:"pointerout",mouseleave:"pointerleave"},zD="undefined"!=typeof navigator&&navigator.userAgent?navigator.userAgent.toLowerCase():"",UD="undefined"!=typeof window?window:global;"undefined"!=typeof global?global:window,"undefined"!=typeof document&&document;let HD=!1;try{const t={get passive(){return HD=!0,!0}};UD.addEventListener("test",t,t),UD.removeEventListener("test",t,t)}catch(m){}const $D=-1!==zD.indexOf("firefox"),{WHEEL_EVENTS:GD}=FD,WD=4.000244140625;class qD{constructor(t,e,n={}){this.element=t,this.callback=e,this.options=Object.assign({enable:!0},n),this.events=GD.concat(n.events||[]),this.handleEvent=this.handleEvent.bind(this),this.events.forEach(e=>t.addEventListener(e,this.handleEvent,!!HD&&{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;UD.WheelEvent&&($D&&t.deltaMode===UD.WheelEvent.DOM_DELTA_PIXEL&&(e/=UD.devicePixelRatio),t.deltaMode===UD.WheelEvent.DOM_DELTA_LINE&&(e*=40));const n={x:t.clientX,y:t.clientY};0!==e&&e%WD==0&&(e=Math.floor(e/WD)),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:XD}=FD,YD="pointermove",KD="pointerover",QD="pointerout",ZD="pointerleave";class JD{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=XD.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===YD&&(this.enableMoveEvent=e),t===KD&&(this.enableOverEvent=e),t===QD&&(this.enableOutEvent=e),t===ZD&&(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:KD,srcEvent:t,pointerType:"mouse",target:t.target})}handleOutEvent(t){this.enableOutEvent&&"mouseout"===t.type&&this.callback({type:QD,srcEvent:t,pointerType:"mouse",target:t.target})}handleLeaveEvent(t){this.enableLeaveEvent&&"mouseleave"===t.type&&this.callback({type:ZD,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:YD,srcEvent:t,pointerType:"mouse",target:t.target});break;case"mouseup":this.pressed=!1}}}const{KEY_EVENTS:tR}=FD,eR="keydown";class nR{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=tR.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===eR&&(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:eR,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 iR="contextmenu";class rR{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===iR&&(this.options.enable=e)}handleEvent(t){!this.options.enable||this.callback({type:iR,center:{x:t.clientX,y:t.clientY},srcEvent:t,pointerType:"mouse",target:t.target})}}const sR={pointerdown:1,pointermove:2,pointerup:4,mousedown:1,mousemove:2,mouseup:4},oR={srcElement:"root",priority:0};class aR{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({},oR,n):oR;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&&ND[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 qD(t,this._onOtherEvent,{enable:!1}),this.moveInput=new JD(t,this._onOtherEvent,{enable:!1}),this.keyInput=new nR(t,this._onOtherEvent,{enable:!1,tabIndex:e.tabIndex}),this.contextmenuInput=new rR(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=LD[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=VD[t]||t;let l=o.get(a);l||(l=new aR(this),o.set(a,l),l.recognizerName=BD[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(VD[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=jD[e.type];n&&this.manager.emit(n,t)}_onOtherEvent(t){this.manager.emit(t.type,t)}}function uR(){}const hR={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:uR,onResize:uR,onViewStateChange:uR,onInteractionStateChange:uR,onBeforeRender:uR,onAfterRender:uR,onLoad:uR,onError:(t,e)=>Gw.error(t)(),_onMetrics:null,getCursor:({isDragging:t})=>t?"grabbing":"grab",debug:!1,drawPickingColors:!1};class dR{constructor(t){t=vt(vt({},hR),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&&Gw.warn("View state tracking is disabled. Use either `initialViewState` for auto update or `viewState` for manual update.")(),"IE"===(0,_D.qs)()&&Gw.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 Gx({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&&GS.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&&Gw.removed("onLayerHover","onHover")(),"onLayerClick"in t&&Gw.removed("onLayerClick","onClick")(),t.initialViewState&&!oM(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](vt({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),RC(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 kD({width:e,height:n,useDevicePixels:c,autoResizeDrawingBuffer:u,autoResizeViewport:!1,gl:i,onCreateContext:t=>zx(zn(vt(vt({},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 SI({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,Ux(t,{enable:!0,copyState:!0})),this.tooltip=new jI(this.canvas),Mx(t,{blend:!0,blendFunc:[770,771,1,771],polygonOffsetFill:!0,depthTest:!0,depthFunc:515}),this.props.onWebGLInitialized(t);const e=new dI;e.play(),this.animationLoop.attachTimeline(e),this.eventManager=new cR(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 Xw)this.eventManager.on(i,this._onEvent);this.viewManager=new _I({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 vI(t,{deck:this,stats:this.stats,viewport:n,timeline:e}),this.effectManager=new EI,this.deckRenderer=new PI(t),this.deckPicker=new NI(t),this.setProps(this.props),this._updateCanvasSize(),this.props.onLoad()}_drawLayers(t,e){const{gl:n}=this.layerManager.context;Mx(n,this.props.parameters),this.props.onBeforeRender({gl:n}),this.deckRenderer.renderLayers(vt({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(),Gw.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=zn(vt({},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=Xw[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=qx.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}}dR.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(WM)),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}},dR.defaultProps=hR,dR.VERSION=CD.VERSION;var pR={name:"project32",dependencies:[tI],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"};const fR={pickingSelectedColor:null,pickingHighlightColor:new Uint8Array([0,255,255,255]),pickingActive:!1,pickingAttribute:!1};var gR=vt({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=fR){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 mR={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6};class bR{static get DRAW_MODE(){return mR}constructor(t={}){const{id:e=Zx("geometry"),drawMode:n=mR.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?vt({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,Xx(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?(Xx(!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 Xx(Number.isFinite(n)),n}}const yR=()=>{},vR={10241:9987,10240:9729,10242:33071,10243:33071};function _R(t){return Math.pow(2,Math.ceil(Math.log2(t)))}function wR(t,e,n,i){return n===e.width&&i===e.height?e:(t.canvas.height=i,t.canvas.width=n,t.clearRect(0,0,t.canvas.width,t.canvas.height),t.drawImage(e,0,0,e.width,e.height,0,0,n,i),t.canvas)}function xR(t){return t&&(t.id||t.url)}function SR(t,e,n){for(let i=0;i0){const{mapping:t,xOffset:n,yOffset:i,rowHeight:r,canvasHeight:s}=function({icons:t,buffer:e,mapping:n={},xOffset:i=0,yOffset:r=0,rowHeight:s=0,canvasWidth:o}){let a=[];for(let l=0;lo&&(SR(n,a,r),i=0,r=s+r+e,s=0,a=[]),a.push({icon:c,xOffset:i}),i=i+l+e,s=Math.max(s,t)}}return a.length>0&&SR(n,a,r),{mapping:n,rowHeight:s,xOffset:i,yOffset:r,canvasWidth:o,canvasHeight:_R(s+r+e)}}({icons:e,buffer:this._buffer,canvasWidth:this._canvasWidth,mapping:this._mapping,rowHeight:this._rowHeight,xOffset:this._xOffset,yOffset:this._yOffset});this._rowHeight=r,this._mapping=t,this._xOffset=n,this._yOffset=i,this._canvasHeight=s,this._texture||(this._texture=new xS(this.gl,{width:this._canvasWidth,height:this._canvasHeight,parameters:vR})),this._texture.height!==this._canvasHeight&&(this._texture=function(t,e,n,i){const r=e.width,s=e.height,o=DS(e,{width:n,height:i});return function(t,e,n={}){const{sourceX:i=0,sourceY:r=0,targetMipmaplevel:s=0,targetInternalFormat:o=6408}=n;let{targetX:a,targetY:l,targetZ:c,width:u,height:h}=n;const{framebuffer:d,deleteFramebuffer:p}=jS(t);Xx(d);const{gl:f,handle:g}=d,m=void 0!==a||void 0!==l||void 0!==c;a=a||0,l=l||0,c=c||0;const b=f.bindFramebuffer(36160,g);Xx(e);let y=null;if(e instanceof _S&&(y=e,u=Number.isFinite(u)?u:y.width,h=Number.isFinite(h)?h:y.height,y.bind(0),e=y.target),m)switch(e){case 3553:case 34067:f.copyTexSubImage2D(e,s,a,l,i,r,u,h);break;case 35866:case 32879:tx(f).copyTexSubImage3D(e,s,a,l,c,i,r,u,h)}else f.copyTexImage2D(e,s,o,i,r,u,h,0);y&&y.unbind(),f.bindFramebuffer(36160,b||null),p&&d.delete()}(e,o,{targetY:0,width:r,height:s}),e.delete(),o}(0,this._texture,this._canvasWidth,this._canvasHeight)),this.onUpdate(),this._loadIcons(e)}}_loadIcons(t){const e=this._canvas.getContext("2d");for(const n of t)this._pendingCount++,XA(n.url,vD,this._loadOptions).then(t=>{const i=xR(n),{x:r,y:s,width:o,height:a}=this._mapping[i],l=wR(e,t,o,a);this._texture.setSubImageData({data:l,x:r,y:s,width:o,height:a}),this._texture.generateMipmap(),this.onUpdate()}).catch(t=>{this.onError({url:n.url,source:n.source,sourceIndex:n.sourceIndex,loadOptions:this._loadOptions,error:t})}).finally(()=>{this._pendingCount--})}}const ER=[0,0,0,255],OR={iconAtlas:{type:"image",value:null,async:!0},iconMapping:{type:"object",value:{},async:!0},sizeScale:{type:"number",value:1,min:0},billboard:!0,sizeUnits:"pixels",sizeMinPixels:{type:"number",min:0,value:0},sizeMaxPixels:{type:"number",min:0,value:Number.MAX_SAFE_INTEGER},alphaCutoff:{type:"number",value:.05,min:0,max:1},getPosition:{type:"accessor",value:t=>t.position},getIcon:{type:"accessor",value:t=>t.icon},getColor:{type:"accessor",value:ER},getSize:{type:"accessor",value:1},getAngle:{type:"accessor",value:0},getPixelOffset:{type:"accessor",value:[0,0]},onIconError:{type:"function",value:null,compare:!1,optional:!0}};let TR=(()=>{class t extends eM{getShaders(){return super.getShaders({vs:"#define SHADER_NAME icon-layer-vertex-shader\n\nattribute vec2 positions;\n\nattribute vec3 instancePositions;\nattribute vec3 instancePositions64Low;\nattribute float instanceSizes;\nattribute float instanceAngles;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\nattribute vec4 instanceIconFrames;\nattribute float instanceColorModes;\nattribute vec2 instanceOffsets;\nattribute vec2 instancePixelOffset;\n\nuniform float sizeScale;\nuniform vec2 iconsTextureDim;\nuniform float sizeMinPixels;\nuniform float sizeMaxPixels;\nuniform bool billboard;\n\nvarying float vColorMode;\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\nvarying vec2 uv;\n\nvec2 rotate_by_angle(vec2 vertex, float angle) {\n float angle_radian = angle * PI / 180.0;\n float cos_angle = cos(angle_radian);\n float sin_angle = sin(angle_radian);\n mat2 rotationMatrix = mat2(cos_angle, -sin_angle, sin_angle, cos_angle);\n return rotationMatrix * vertex;\n}\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n geometry.uv = positions;\n geometry.pickingColor = instancePickingColors;\n uv = positions;\n\n vec2 iconSize = instanceIconFrames.zw;\n float sizePixels = clamp(\n project_size_to_pixel(instanceSizes * sizeScale), \n sizeMinPixels, sizeMaxPixels\n );\n float instanceScale = iconSize.y == 0.0 ? 0.0 : sizePixels / iconSize.y;\n vec2 pixelOffset = positions / 2.0 * iconSize + instanceOffsets;\n pixelOffset = rotate_by_angle(pixelOffset, instanceAngles) * instanceScale;\n pixelOffset += instancePixelOffset;\n pixelOffset.y *= -1.0;\n\n if (billboard) {\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, vec3(0.0), geometry.position);\n vec3 offset = vec3(pixelOffset, 0.0);\n DECKGL_FILTER_SIZE(offset, geometry);\n gl_Position.xy += project_pixel_size_to_clipspace(offset.xy);\n\n } else {\n vec3 offset_common = vec3(project_pixel_size(pixelOffset), 0.0);\n DECKGL_FILTER_SIZE(offset_common, geometry);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, offset_common, geometry.position); \n }\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n vTextureCoords = mix(\n instanceIconFrames.xy,\n instanceIconFrames.xy + iconSize,\n (positions.xy + 1.0) / 2.0\n ) / iconsTextureDim;\n\n vColor = instanceColors;\n DECKGL_FILTER_COLOR(vColor, geometry);\n\n vColorMode = instanceColorModes;\n}\n",fs:"#define SHADER_NAME icon-layer-fragment-shader\n\nprecision highp float;\n\nuniform float opacity;\nuniform sampler2D iconsTexture;\nuniform float alphaCutoff;\n\nvarying float vColorMode;\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\nvarying vec2 uv;\n\nvoid main(void) {\n geometry.uv = uv;\n\n vec4 texColor = texture2D(iconsTexture, vTextureCoords);\n vec3 color = mix(texColor.rgb, vColor.rgb, vColorMode);\n float a = texColor.a * opacity * vColor.a;\n\n if (a < alphaCutoff) {\n discard;\n }\n\n gl_FragColor = vec4(color, a);\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:[pR,gR]})}initializeState(){this.state={iconManager:new CR(this.context.gl,{onUpdate:this._onUpdate.bind(this),onError:this._onError.bind(this)})},this.getAttributeManager().addInstanced({instancePositions:{size:3,type:5130,fp64:this.use64bitPositions(),transition:!0,accessor:"getPosition"},instanceSizes:{size:1,transition:!0,accessor:"getSize",defaultValue:1},instanceOffsets:{size:2,accessor:"getIcon",transform:this.getInstanceOffset},instanceIconFrames:{size:4,accessor:"getIcon",transform:this.getInstanceIconFrame},instanceColorModes:{size:1,type:5121,accessor:"getIcon",transform:this.getInstanceColorMode},instanceColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:!0,accessor:"getColor",defaultValue:ER},instanceAngles:{size:1,transition:!0,accessor:"getAngle"},instancePixelOffset:{size:2,transition:!0,accessor:"getPixelOffset"}})}updateState({oldProps:t,props:e,changeFlags:n}){super.updateState({props:e,oldProps:t,changeFlags:n});const i=this.getAttributeManager(),{iconAtlas:r,iconMapping:s,data:o,getIcon:a}=e,{iconManager:l}=this.state;l.setProps({loadOptions:e.loadOptions});let c=!1;if(r||this.internalState.isAsyncPropLoading("iconAtlas")?(t.iconAtlas!==e.iconAtlas&&l.setProps({iconAtlas:r,autoPacking:!1}),t.iconMapping!==e.iconMapping&&(l.setProps({iconMapping:s}),c=!0)):l.setProps({autoPacking:!0}),(n.dataChanged||n.updateTriggersChanged&&(n.updateTriggersChanged.all||n.updateTriggersChanged.getIcon))&&l.setProps({data:o,getIcon:a}),c&&(i.invalidate("instanceOffsets"),i.invalidate("instanceIconFrames"),i.invalidate("instanceColorModes")),n.extensionsChanged){var u;const{gl:t}=this.context;null===(u=this.state.model)||void 0===u||u.delete(),this.state.model=this._getModel(t),i.invalidateAll()}}get isLoaded(){return super.isLoaded&&this.state.iconManager.isLoaded}finalizeState(){super.finalizeState(),this.state.iconManager.finalize()}draw({uniforms:t}){const{sizeScale:e,sizeMinPixels:n,sizeMaxPixels:i,sizeUnits:r,billboard:s,alphaCutoff:o}=this.props,{iconManager:a}=this.state,{viewport:l}=this.context,c=a.getTexture();c&&this.state.model.setUniforms(t).setUniforms({iconsTexture:c,iconsTextureDim:[c.width,c.height],sizeScale:e*("pixels"===r?l.metersPerPixel:1),sizeMinPixels:n,sizeMaxPixels:i,billboard:s,alphaCutoff:o}).draw()}_getModel(t){return new WO(t,zn(vt({},this.getShaders()),{id:this.props.id,geometry:new bR({drawMode:6,attributes:{positions:{size:2,value:new Float32Array([-1,-1,-1,1,1,1,1,-1])}}}),isInstanced:!0}))}_onUpdate(){this.setNeedsRedraw()}_onError(t){const{onIconError:e}=this.getCurrentLayer().props;e?e(t):Gw.error(t.error)()}getInstanceOffset(t){const e=this.state.iconManager.getIconMapping(t);return[e.width/2-e.anchorX||0,e.height/2-e.anchorY||0]}getInstanceColorMode(t){return this.state.iconManager.getIconMapping(t).mask?1:0}getInstanceIconFrame(t){const e=this.state.iconManager.getIconMapping(t);return[e.x||0,e.y||0,e.width||0,e.height||0]}}return t.layerName="IconLayer",t.defaultProps=OR,t})();const kR=[],PR={getIconOffsets:{type:"accessor",value:t=>t.offsets},alphaCutoff:.001,smoothing:.1,outlineWidth:0,outlineColor:{type:"color",value:[0,0,0,255]}};let AR=(()=>{class t extends TR{getShaders(){return zn(vt({},super.getShaders()),{fs:"#define SHADER_NAME multi-icon-layer-fragment-shader\n\nprecision highp float;\n\nuniform float opacity;\nuniform sampler2D iconsTexture;\nuniform float gamma;\nuniform bool sdf;\nuniform float alphaCutoff;\nuniform float buffer;\nuniform float outlineBuffer;\nuniform vec4 outlineColor;\n\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\nvarying vec2 uv;\n\nvoid main(void) {\n geometry.uv = uv;\n\n if (!picking_uActive) {\n float alpha = texture2D(iconsTexture, vTextureCoords).a;\n vec4 color = vColor;\n if (sdf) {\n float distance = alpha;\n alpha = smoothstep(buffer - gamma, buffer + gamma, distance);\n\n if (outlineBuffer > 0.0) {\n float inFill = alpha;\n float inBorder = smoothstep(outlineBuffer - gamma, outlineBuffer + gamma, distance);\n color = mix(outlineColor, vColor, inFill);\n alpha = inBorder;\n }\n }\n float a = alpha * color.a;\n \n if (a < alphaCutoff) {\n discard;\n }\n\n gl_FragColor = vec4(color.rgb, a * opacity);\n }\n\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n"})}initializeState(){super.initializeState(),this.getAttributeManager().addInstanced({instanceOffsets:{size:2,accessor:"getIconOffsets"},instancePickingColors:{type:5121,size:3,accessor:(t,{index:e,target:n})=>this.encodePickingColor(e,n)}})}updateState(t){super.updateState(t);const{props:e,oldProps:n}=t;let{outlineColor:i}=e;i!==n.outlineColor&&(i=i.map(t=>t/255),i[3]=Number.isFinite(i[3])?i[3]:1,this.setState({outlineColor:i})),!e.sdf&&e.outlineWidth&&Gw.warn("".concat(this.id,": fontSettings.sdf is required to render outline"))()}draw(t){const{sdf:e,smoothing:n,outlineWidth:i}=this.props,{outlineColor:r}=this.state;t.uniforms=zn(vt({},t.uniforms),{buffer:.75,outlineBuffer:i?Math.max(n,.75*(1-i)):-1,gamma:n,sdf:Boolean(e),outlineColor:r}),super.draw(t)}getInstanceOffset(t){return t?Array.from(t).map(t=>super.getInstanceOffset(t)):kR}getInstanceColorMode(t){return 1}getInstanceIconFrame(t){return t?Array.from(t).map(t=>super.getInstanceIconFrame(t)):kR}}return t.layerName="MultiIconLayer",t.defaultProps=PR,t})();var MR=n(51002),IR=n.n(MR);const DR=[];function RR(t){return Math.pow(2,Math.ceil(Math.log2(t)))}function NR(t,e,n,i){let r=0;for(let s=e;si&&(oa){let e=NR(t,a,l,r);c+e>i&&(oi&&(e=LR(t,a,l,i,r,s),o=s[s.length-1])),a=l,c+=e}}(t,r,s,n,i,o),o}function FR(t,e,n,i,r,s){let o=0,a=0;for(let l=e;l0,u=[0,0],h=[];let d=0,p=0,f=0;for(let g=0;g<=s;g++){const m=t[g];if(("\n"===m||g===s)&&(f=g),f>p){const s=c?jR(t,n,i,r,p,f):DR;for(let n=0;n<=s.length;n++){const i=0===n?p:s[n-1],c=ne===t);e>=0&&this._order.splice(e,1)}_appendOrder(t){this._order.push(t)}}(3),HR=["fontFamily","fontWeight","characterSet","fontSize","sdf","buffer","cutoff","radius"];function $R(t,e){for(let n=0;n{e in t&&(this.props[e]=t[e])});const e=this._key;this._key=this._getKey();const n=function(t,e){const n=UR.get(t);if(!n)return e;const i=[];let r=Object.keys(n.mapping);r=new Set(r);let s=e;return s instanceof Array&&(s=new Set(s)),s.forEach(t=>{r.has(t)||i.push(t)}),i}(this._key,this.props.characterSet),i=UR.get(this._key);if(i&&0===n.length)return void(this._key!==e&&(this._atlas=i));const r=this._generateFontAtlas(this._key,n,i);this._atlas=r,UR.set(this._key,r)}_generateFontAtlas(t,e,n){const{fontFamily:i,fontWeight:r,fontSize:s,buffer:o,sdf:a,radius:l,cutoff:c}=this.props;let u=n&&n.data;u||(u=document.createElement("canvas"),u.width=1024);const h=u.getContext("2d");GR(h,i,s,r);const{mapping:d,canvasHeight:p,xOffset:f,yOffset:g}=function({characterSet:t,getFontWidth:e,fontHeight:n,buffer:i,maxCanvasWidth:r,mapping:s={},xOffset:o=0,yOffset:a=0}){let l=0,c=o,u=0;for(const d of t)if(!s[d]){const t=e(d,u++);c+t+2*i>r&&(c=0,l++),s[d]={x:c+i,y:a+l*(n+2*i)+i,width:t,height:n},c+=t+2*i}const h=n+2*i;return{mapping:s,xOffset:c,yOffset:a+l*h,canvasHeight:RR(a+(l+1)*h)}}(vt({getFontWidth:t=>h.measureText(t).width,fontHeight:1.2*s,buffer:o,characterSet:e,maxCanvasWidth:1024},n&&{mapping:n.mapping,xOffset:n.xOffset,yOffset:n.yOffset}));if(u.height!==p){const t=h.getImageData(0,0,u.width,u.height);u.height=p,h.putImageData(t,0,0)}if(GR(h,i,s,r),a){const t=new(IR())(s,o,l,c,i,r),n=h.getImageData(0,0,t.size,t.size);for(const i of e)$R(t.draw(i),n),h.putImageData(n,d[i].x-o,d[i].y+o)}else for(const m of e)h.fillText(m,d[m].x,d[m].y+.9*s);return{xOffset:f,yOffset:g,mapping:d,data:u,width:u.width,height:u.height}}_getKey(){const{fontFamily:t,fontWeight:e,fontSize:n,buffer:i,sdf:r,radius:s,cutoff:o}=this.props;return r?"".concat(t," ").concat(e," ").concat(n," ").concat(i," ").concat(s," ").concat(o):"".concat(t," ").concat(e," ").concat(n," ").concat(i)}}const qR={billboard:!0,sizeScale:1,sizeUnits:"pixels",sizeMinPixels:0,sizeMaxPixels:Number.MAX_SAFE_INTEGER,padding:{type:"array",value:[0,0,0,0]},getPosition:{type:"accessor",value:t=>t.position},getSize:{type:"accessor",value:1},getAngle:{type:"accessor",value:0},getPixelOffset:{type:"accessor",value:[0,0]},getBoundingRect:{type:"accessor",value:[0,0,0,0]},getFillColor:{type:"accessor",value:[0,0,0,255]},getLineColor:{type:"accessor",value:[0,0,0,255]},getLineWidth:{type:"accessor",value:1}};let XR=(()=>{class t extends eM{getShaders(){return super.getShaders({vs:"#define SHADER_NAME text-background-layer-vertex-shader\n\nattribute vec2 positions;\n\nattribute vec3 instancePositions;\nattribute vec3 instancePositions64Low;\nattribute vec4 instanceRects;\nattribute float instanceSizes;\nattribute float instanceAngles;\nattribute vec2 instancePixelOffsets;\nattribute float instanceLineWidths;\nattribute vec4 instanceFillColors;\nattribute vec4 instanceLineColors;\nattribute vec3 instancePickingColors;\n\nuniform bool billboard;\nuniform float opacity;\nuniform float sizeScale;\nuniform float sizeMinPixels;\nuniform float sizeMaxPixels;\nuniform vec4 padding;\n\nvarying vec4 vFillColor;\nvarying vec4 vLineColor;\nvarying float vLineWidth;\nvarying vec2 uv;\nvarying vec2 dimensions;\n\nvec2 rotate_by_angle(vec2 vertex, float angle) {\n float angle_radian = radians(angle);\n float cos_angle = cos(angle_radian);\n float sin_angle = sin(angle_radian);\n mat2 rotationMatrix = mat2(cos_angle, -sin_angle, sin_angle, cos_angle);\n return rotationMatrix * vertex;\n}\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n geometry.uv = positions;\n geometry.pickingColor = instancePickingColors;\n uv = positions;\n vLineWidth = instanceLineWidths;\n float sizePixels = clamp(\n project_size_to_pixel(instanceSizes * sizeScale),\n sizeMinPixels, sizeMaxPixels\n );\n\n dimensions = instanceRects.zw * sizePixels + padding.xy + padding.zw;\n\n vec2 pixelOffset = (positions * instanceRects.zw + instanceRects.xy) * sizePixels + mix(-padding.xy, padding.zw, positions);\n pixelOffset = rotate_by_angle(pixelOffset, instanceAngles);\n pixelOffset += instancePixelOffsets;\n pixelOffset.y *= -1.0;\n\n if (billboard) {\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, vec3(0.0), geometry.position);\n vec3 offset = vec3(pixelOffset, 0.0);\n DECKGL_FILTER_SIZE(offset, geometry);\n gl_Position.xy += project_pixel_size_to_clipspace(offset.xy);\n } else {\n vec3 offset_common = vec3(project_pixel_size(pixelOffset), 0.0);\n DECKGL_FILTER_SIZE(offset_common, geometry);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, offset_common, geometry.position);\n }\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n vFillColor = vec4(instanceFillColors.rgb, instanceFillColors.a * opacity);\n DECKGL_FILTER_COLOR(vFillColor, geometry);\n vLineColor = vec4(instanceLineColors.rgb, instanceLineColors.a * opacity);\n DECKGL_FILTER_COLOR(vLineColor, geometry);\n}\n",fs:"#define SHADER_NAME text-background-layer-fragment-shader\n\nprecision highp float;\n\nuniform bool stroked;\n\nvarying vec4 vFillColor;\nvarying vec4 vLineColor;\nvarying float vLineWidth;\nvarying vec2 uv;\nvarying vec2 dimensions;\n\nvoid main(void) {\n geometry.uv = uv;\n\n vec2 pixelPosition = uv * dimensions;\n if (stroked) {\n float distToEdge = min(\n min(pixelPosition.x, dimensions.x - pixelPosition.x),\n min(pixelPosition.y, dimensions.y - pixelPosition.y)\n );\n float isBorder = smoothedge(distToEdge, vLineWidth);\n gl_FragColor = mix(vFillColor, vLineColor, isBorder);\n } else {\n gl_FragColor = vFillColor;\n }\n\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:[pR,gR]})}initializeState(){this.getAttributeManager().addInstanced({instancePositions:{size:3,type:5130,fp64:this.use64bitPositions(),transition:!0,accessor:"getPosition"},instanceSizes:{size:1,transition:!0,accessor:"getSize",defaultValue:1},instanceAngles:{size:1,transition:!0,accessor:"getAngle"},instanceRects:{size:4,accessor:"getBoundingRect"},instancePixelOffsets:{size:2,transition:!0,accessor:"getPixelOffset"},instanceFillColors:{size:4,transition:!0,normalized:!0,type:5121,accessor:"getFillColor",defaultValue:[0,0,0,255]},instanceLineColors:{size:4,transition:!0,normalized:!0,type:5121,accessor:"getLineColor",defaultValue:[0,0,0,255]},instanceLineWidths:{size:1,transition:!0,accessor:"getLineWidth",defaultValue:1}})}updateState({props:t,oldProps:e,changeFlags:n}){if(super.updateState({props:t,oldProps:e,changeFlags:n}),n.extensionsChanged){var i;const{gl:t}=this.context;null===(i=this.state.model)||void 0===i||i.delete(),this.state.model=this._getModel(t),this.getAttributeManager().invalidateAll()}}draw({uniforms:t}){const{viewport:e}=this.context,{billboard:n,sizeScale:i,sizeUnits:r,sizeMinPixels:s,sizeMaxPixels:o,getLineWidth:a}=this.props;let{padding:l}=this.props;const c="pixels"===r?e.metersPerPixel:1;l.length<4&&(l=[l[0],l[1],l[0],l[1]]),this.state.model.setUniforms(t).setUniforms({billboard:n,stroked:Boolean(a),padding:l,sizeScale:i*c,sizeMinPixels:s,sizeMaxPixels:o}).draw()}_getModel(t){return new WO(t,zn(vt({},this.getShaders()),{id:this.props.id,geometry:new bR({drawMode:6,vertexCount:4,attributes:{positions:{size:2,value:new Float32Array([0,0,1,0,1,1,0,1])}}}),isInstanced:!0}))}}return t.layerName="TextBackgroundLayer",t.defaultProps=qR,t})();const YR={fontSize:64,buffer:4,sdf:!1,radius:12,cutoff:.25,smoothing:.1},KR={start:1,middle:0,end:-1},QR={top:1,center:0,bottom:-1},ZR=[0,0,0,255],JR=["fontSize","buffer","sdf","radius","cutoff"],tN={billboard:!0,sizeScale:1,sizeUnits:"pixels",sizeMinPixels:0,sizeMaxPixels:Number.MAX_SAFE_INTEGER,background:!1,getBackgroundColor:{type:"accessor",value:[255,255,255,255]},getBorderColor:{type:"accessor",value:ZR},getBorderWidth:{type:"accessor",value:0},backgroundPadding:{type:"array",value:[0,0,0,0]},characterSet:{type:"object",value:VR},fontFamily:zR,fontWeight:"normal",lineHeight:1,outlineWidth:{type:"number",value:0,min:0},outlineColor:{type:"color",value:ZR},fontSettings:{},wordBreak:"break-word",maxWidth:{type:"number",value:-1},getText:{type:"accessor",value:t=>t.text},getPosition:{type:"accessor",value:t=>t.position},getColor:{type:"accessor",value:ZR},getSize:{type:"accessor",value:32},getAngle:{type:"accessor",value:0},getTextAnchor:{type:"accessor",value:"middle"},getAlignmentBaseline:{type:"accessor",value:"center"},getPixelOffset:{type:"accessor",value:[0,0]},backgroundColor:{deprecatedFor:["background","getBackgroundColor"]}};let eN=(()=>{class t extends nM{initializeState(){this.state={styleVersion:0,fontAtlasManager:new WR}}updateState({props:t,oldProps:e,changeFlags:n}){const i=this.state.characterSet;(n.dataChanged||n.updateTriggersChanged&&(n.updateTriggersChanged.all||n.updateTriggersChanged.getText))&&this._updateText();const r=i!==this.state.characterSet||this._fontChanged(e,t);r&&this._updateFontAtlas(e,t),(r||t.lineHeight!==e.lineHeight||t.wordBreak!==e.wordBreak||t.maxWidth!==e.maxWidth)&&this.setState({styleVersion:this.state.styleVersion+1})}getPickingInfo({info:t}){return t.object=t.index>=0?this.props.data[t.index]:null,t}_updateFontAtlas(t,e){const{fontSettings:n,fontFamily:i,fontWeight:r}=e,{fontAtlasManager:s,characterSet:o}=this.state;s.setProps(zn(vt(vt({},YR),n),{characterSet:o,fontFamily:i,fontWeight:r}))}_fontChanged(t,e){if(t.fontFamily!==e.fontFamily||t.fontWeight!==e.fontWeight)return!0;if(t.fontSettings===e.fontSettings)return!1;const n=t.fontSettings||{},i=e.fontSettings||{};return JR.some(t=>n[t]!==i[t])}_updateText(){const{data:t,characterSet:e}=this.props,n=t.attributes&&t.attributes.getText;let i,{getText:r}=this.props,{startIndices:s}=t;const o="auto"===e&&new Set;if(n&&s){const{texts:e,characterCount:a}=function({value:t,length:e,stride:n,offset:i,startIndices:r,characterSet:s}){const o=t.BYTES_PER_ELEMENT,a=n?n/o:1,l=i?i/o:0,c=r[e]||Math.ceil((t.length-l)/a),u=s&&new Set,h=new Array(e);let d=t;if(a>1||l>0){d=new t.constructor(c);for(let e=0;ee[n]}else{const{iterable:e,objectInfo:n}=jC(t);s=[0],i=0;for(const t of e){n.index++;const e=Array.from(r(t,n)||"");o&&e.forEach(o.add,o),i+=e.length,s.push(i)}}this.setState({getText:r,startIndices:s,numInstances:i,characterSet:o||e})}getBoundingRect(t,e){const n=this.state.fontAtlasManager.mapping,{getText:i}=this.state,{wordBreak:r,maxWidth:s,lineHeight:o,getTextAnchor:a,getAlignmentBaseline:l}=this.props,c=i(t,e)||"",{size:[u,h]}=BR(c,o,r,s,n);return[(KR["function"==typeof a?a(t,e):a]-1)*u/2,(QR["function"==typeof l?l(t,e):l]-1)*h/2,u,h]}getIconOffsets(t,e){const n=this.state.fontAtlasManager.mapping,{getText:i}=this.state,{wordBreak:r,maxWidth:s,lineHeight:o,getTextAnchor:a,getAlignmentBaseline:l}=this.props,c=i(t,e)||"",{x:u,y:h,rowWidth:d,size:[p,f]}=BR(c,o,r,s,n),g=KR["function"==typeof a?a(t,e):a],m=QR["function"==typeof l?l(t,e):l],b=u.length,y=new Array(2*b);let v=0;for(let _=0;_t*e/255)}const sN={name:"lights",vs:nN,fs:nN,getUniforms:function t(e=iN){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?rN(t):[0,0,0],e.forEach((t,e)=>{i[`lighting_uPointLight[${e}].color`]=rN(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`]=rN(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 oN={};const aN={name:"phong-lighting",dependencies:[sN],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=oN){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}}},lN=Math.PI/180,cN=new Float32Array(16),uN=new Float32Array(12);function hN(t,e,n){const i=e[0]*lN,r=e[1]*lN,s=e[2]*lN,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 dN(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 pN={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?(cN.set(a),e=dN(cN)):(e=uN,hN(e,r,s),e.set(o,9)),t.value=new Float32Array(e)}else{let l=e*t.size;const{iterable:g,objectInfo:m}=jC(i,e,n);for(const t of g){let e;m.index++,p?(cN.set(c?a:a(t,m)),e=dN(cN)):(e=uN,hN(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 fN(t,e){return e===Ww.CARTESIAN||e===Ww.METER_OFFSETS||e===Ww.DEFAULT&&!t.isGeospatial}function gN(t,e){(t.COLOR_0||t.colors)&&e||(t.colors={constant:!0,value:new Float32Array([1,1,1])}),Gw.assert(t.positions||t.POSITION,'no "postions" or "POSITION" attribute in mesh')}function mN(t,e){if(t.attributes)return gN(t.attributes,e),t instanceof bR?t:new bR(t);if(t.positions||t.POSITION)return gN(t,e),new bR({attributes:t});throw Error("Invalid mesh")}const bN={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 yN=(()=>{class t extends eM{getShaders(){const t=!Zw(this.context.gl),e={};return zS(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:[pR,aN,gR],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:pN}),this.setState({emptyTexture:new xS(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||fN(e,i),flatShading:!this.state.hasNormals}).draw()}getModel(t){const e=new WO(this.context.gl,zn(vt({},this.getShaders()),{id:this.props.id,geometry:mN(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=bN,t})();const vN={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:[sN]};class _N{constructor(t={}){const{id:e}=t;this.id=e||Zx(this.constructor.name),this.display=!0,this.position=new OC,this.rotation=new OC,this.scale=new OC(1,1,1),this.matrix=new VT,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 Xx(3===t.length,"setPosition requires vector argument"),this.position=t,this}setRotation(t){return Xx(3===t.length,"setRotation requires vector argument"),this.rotation=t,this}setScale(t){return Xx(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){Xx(t),e=e||this.matrix;const n=new VT(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 wN extends _N{constructor(t={}){t=Array.isArray(t)?{children:t}:t;const{children:e=[]}=t;Yw.assert(e.every(t=>t instanceof _N),"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 VT}={}){const n=new VT(e).multiplyRight(this.matrix);for(const i of this.children)i instanceof wN?i.traverse(t,{worldMatrix:n}):t(i,{worldMatrix:n})}}function xN(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=n[0],p=n[1],f=n[2],g=n[3],m=n[4],b=n[5],y=n[6],v=n[7],_=n[8];return t[0]=d*i+p*o+f*c,t[1]=d*r+p*a+f*u,t[2]=d*s+p*l+f*h,t[3]=g*i+m*o+b*c,t[4]=g*r+m*a+b*u,t[5]=g*s+m*l+b*h,t[6]=y*i+v*o+_*c,t[7]=y*r+v*a+_*u,t[8]=y*s+v*l+_*h,t}function SN(t,e,n){var i=n[0],r=n[1];return t[0]=i*e[0],t[1]=i*e[1],t[2]=i*e[2],t[3]=r*e[3],t[4]=r*e[4],t[5]=r*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function CN(){var t=new hC(4);return hC!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function EN(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t}function ON(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 TN(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}function kN(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);return t[0]=i*l+o*a,t[1]=r*l+s*a,t[2]=s*l-r*a,t[3]=o*l-i*a,t}function PN(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);return t[0]=i*l-s*a,t[1]=r*l+o*a,t[2]=s*l+i*a,t[3]=o*l-r*a,t}function AN(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);return t[0]=i*l+r*a,t[1]=r*l-i*a,t[2]=s*l+o*a,t[3]=o*l-s*a,t}function MN(t,e){var n=e[0],i=e[1],r=e[2];return t[0]=n,t[1]=i,t[2]=r,t[3]=Math.sqrt(Math.abs(1-n*n-i*i-r*r)),t}function IN(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];return(s=c*p+u*f+h*g+d*m)<0&&(s=-s,p=-p,f=-f,g=-g,m=-m),1-s>uC?(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,t}function DN(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;return t[0]=-n*a,t[1]=-i*a,t[2]=-r*a,t[3]=s*a,t}function RN(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t}function NN(t,e){var n,i=e[0]+e[4]+e[8];if(i>0)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}return t}var LN=function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t},jN=xT,FN=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]},BN=function(t,e,n,i){var r=e[0],s=e[1],o=e[2],a=e[3];return 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),t},VN=function(t){return Math.hypot(t[0],t[1],t[2],t[3])},zN=function(t){var e=t[0],n=t[1],i=t[2],r=t[3];return e*e+n*n+i*i+r*r},UN=function(){var t=dC(),e=pC(1,0,0),n=pC(0,1,0);return function(i,r,s){var o=fC(r,s);return o<-.999999?(gC(t,e,r),function(t){return Math.hypot(t[0],t[1],t[2])}(t)<1e-6&&gC(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),ON(i,t,Math.PI),i):o>.999999?(i[0]=0,i[1]=0,i[2]=0,i[3]=1,i):(gC(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))}}();CN(),CN(),function(){var t=new hC(9);hC!=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 HN=[0,0,0,1];class $N extends rC{constructor(t=0,e=0,n=0,i=1){super(-0,-0,-0,-0),Array.isArray(t)&&1===arguments.length?this.copy(t):this.set(t,e,n,i)}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this.check()}set(t,e,n,i){return this[0]=t,this[1]=e,this[2]=n,this[3]=i,this.check()}fromMatrix3(t){return NN(this,t),this.check()}identity(){return EN(this),this.check()}fromAxisRotation(t,e){return ON(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]=sC(t)}get y(){return this[1]}set y(t){this[1]=sC(t)}get z(){return this[2]}set z(t){this[2]=sC(t)}get w(){return this[3]}set w(t){this[3]=sC(t)}len(){return VN(this)}lengthSquared(){return zN(this)}dot(t,e){if(void 0!==e)throw new Error("Quaternion.dot only takes one argument");return FN(this,t)}rotationTo(t,e){return UN(this,t,e),this.check()}add(t,e){if(void 0!==e)throw new Error("Quaternion.add only takes one argument");return LN(this,this,t),this.check()}calculateW(){return MN(this,this),this.check()}conjugate(){return RN(this,this),this.check()}invert(){return DN(this,this),this.check()}lerp(t,e,n){return BN(this,t,e,n),this.check()}multiplyRight(t,e){return iC(!e),TN(this,this,t),this.check()}multiplyLeft(t,e){return iC(!e),TN(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 kN(this,this,t),this.check()}rotateY(t){return PN(this,this,t),this.check()}rotateZ(t){return AN(this,this,t),this.check()}scale(t){return jN(this,this,t),this.check()}slerp(t,e,n){switch(arguments.length){case 1:({start:t=HN,target:e,ratio:n}=arguments[0]);break;case 2:[e,n]=arguments,t=this}return IN(this,t,e,n),this.check()}transformVector4(t,e=t){return CT(e,t,this),oC(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)}}const GN={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},WN={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function qN(t){if(!t._animation){const e=WN[t.componentType],n=GN[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;t{(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:Yw.warn(`Bad animation path ${s}`)()}Xx(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){YN.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:qN(t.accessors[e]),interpolation:n,output:qN(t.accessors[i])})),s=e.channels.map(({sampler:e,target:n})=>({sampler:r[e],target:t.nodes[n.node],path:n.path}));return new KN({name:i,channels:s})})}animate(t){this.setTime(t)}setTime(t){this.animations.forEach(e=>e.animate(t))}getAnimations(){return this.animations}}class ZN extends _N{constructor(t,e={}){super(e),this.onBeforeRender=null,this.AfterRender=null,t instanceof WO?(this.model=t,this._setModelNodeProps(e)):this.model=new WO(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 JN{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},zS(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 xS(this.gl,vt({id:t.name||t.id,parameters:vt(vt({},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&&(Yw.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 tL(t,e){return Zw(t)?`#version 300 es\n${e}`:e}const eL={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},nL={modelOptions:{},pbrDebug:!1,imageBasedLightingEnvironment:null,lights:!0,useTangents:!1};class iL{constructor(t,e={}){this.gl=t,this.options=Object.assign({},nL,e)}instantiate(t){return this.gltf=t,(t.scenes||[]).map(t=>this.createScene(t))}createAnimator(){return Array.isArray(this.gltf.animations)?new QN(this.gltf):null}createScene(t){const e=(t.nodes||[]).map(t=>this.createNode(t));return new wN({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 wN({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 VT).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 wN({id:t.name||t.id,children:e});t._mesh=n}return t._mesh}getVertexCount(t){Yw.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 JN(t,e);Yw.info(4,"createGLTFModel defines: ",a.defines)();const l=[];l.push(...a.generatedTextures),l.push(...Object.values(s).map(t=>t.buffer));const c=new ZN(t,Object.assign({id:n,drawMode:i,vertexCount:r,modules:[vN],defines:a.defines,parameters:a.parameters,vs:tL(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:tL(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))),Yw.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 fS(this.gl,{id:`from-${n.id}`,data:n.data||t.value,target:e})),n.lumaBuffers[e]}createAccessor(t,e){return new uS({buffer:e,offset:t.byteOffset||0,stride:t.bufferView.byteStride||0,type:t.componentType,size:eL[t.type]})}createSampler(t){return t}needsPOT(){return!1}}function rL(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 cL(n,this.metadata)}selectAt(...t){const e=t.map(t=>this.fields[t]).filter(Boolean);return new cL(e,this.metadata)}assign(t){let e,n=this.metadata;if(t instanceof cL){const i=t;e=i.fields,n=uL(uL(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 cL(r,n)}}function uL(t,e){return new Map([...t||new Map,...e||new Map])}let hL,dL,pL,fL,gL,mL,bL,yL;!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"}(hL||(hL={}));class vL{static isNull(t){return t&&t.typeId===hL.Null}static isInt(t){return t&&t.typeId===hL.Int}static isFloat(t){return t&&t.typeId===hL.Float}static isBinary(t){return t&&t.typeId===hL.Binary}static isUtf8(t){return t&&t.typeId===hL.Utf8}static isBool(t){return t&&t.typeId===hL.Bool}static isDecimal(t){return t&&t.typeId===hL.Decimal}static isDate(t){return t&&t.typeId===hL.Date}static isTime(t){return t&&t.typeId===hL.Time}static isTimestamp(t){return t&&t.typeId===hL.Timestamp}static isInterval(t){return t&&t.typeId===hL.Interval}static isList(t){return t&&t.typeId===hL.List}static isStruct(t){return t&&t.typeId===hL.Struct}static isUnion(t){return t&&t.typeId===hL.Union}static isFixedSizeBinary(t){return t&&t.typeId===hL.FixedSizeBinary}static isFixedSizeList(t){return t&&t.typeId===hL.FixedSizeList}static isMap(t){return t&&t.typeId===hL.Map}static isDictionary(t){return t&&t.typeId===hL.Dictionary}get typeId(){return hL.NONE}compareTo(t){return this===t}}Symbol,Symbol,dL=Symbol.toStringTag;class _L extends vL{constructor(t,e){super(),kP(this,"isSigned",void 0),kP(this,"bitWidth",void 0),this.isSigned=t,this.bitWidth=e}get typeId(){return hL.Int}get[dL](){return"Int"}toString(){return`${this.isSigned?"I":"Ui"}nt${this.bitWidth}`}}class wL extends _L{constructor(){super(!0,8)}}class xL extends _L{constructor(){super(!0,16)}}class SL extends _L{constructor(){super(!0,32)}}class CL extends _L{constructor(){super(!1,8)}}class EL extends _L{constructor(){super(!1,16)}}class OL extends _L{constructor(){super(!1,32)}}pL=Symbol.toStringTag;class TL extends vL{constructor(t){super(),kP(this,"precision",void 0),this.precision=t}get typeId(){return hL.Float}get[pL](){return"Float"}toString(){return`Float${this.precision}`}}class kL extends TL{constructor(){super(32)}}class PL extends TL{constructor(){super(64)}}Symbol,Symbol,fL=Symbol.toStringTag,gL=Symbol.toStringTag,mL=Symbol.toStringTag,bL=Symbol.toStringTag,yL=Symbol.toStringTag;class AL extends vL{constructor(t,e){super(),kP(this,"listSize",void 0),kP(this,"children",void 0),this.listSize=t,this.children=[e]}get typeId(){return hL.FixedSizeList}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get[yL](){return"FixedSizeList"}toString(){return`FixedSizeList[${this.listSize}]<${this.valueType}>`}}class ML{constructor(t,e,n=!1,i=new Map){kP(this,"name",void 0),kP(this,"type",void 0),kP(this,"nullable",void 0),kP(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 ML(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 IL(t,e,n){const i=n?DL(n.metadata):void 0,r=function(t){switch(t.constructor){case Int8Array:return new wL;case Uint8Array:return new CL;case Int16Array:return new xL;case Uint16Array:return new EL;case Int32Array:return new SL;case Uint32Array:return new OL;case Float32Array:return new kL;case Float64Array:return new PL;default:throw new Error("array type not supported")}}(e.value);return new ML(t,new AL(e.size,new ML("value",r)),!1,i)}function DL(t){const e=new Map;for(const n in t)e.set(`${n}.string`,JSON.stringify(t[n]));return e}const RL={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},NL={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array};class LL{constructor(t){kP(this,"draco",void 0),kP(this,"decoder",void 0),kP(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=DL(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=IL(o,t[o],s[o]);r.push(e)}if(n){const t=IL("indices",n);r.push(t)}return new cL(r,i)}(o.attributes,s,o.indices);return zn(vt({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 jL=n(49125);const FL={};function BL(t){return VL.apply(this,arguments)}function VL(){return(VL=PS(function*(t,e=null,n={}){return e&&(t=zL(t,e,n)),FL[t]=FL[t]||UL(t),yield FL[t]})).apply(this,arguments)}function zL(t,e,n){if(t.startsWith("http"))return t;const i=n.modules||{};return i[t]?i[t]:$P?n.CDN?(VP(n.CDN.startsWith("http")),`${n.CDN}/${e}@3.0.12/dist/libs/${t}`):GP?`../src/libs/${t}`:`modules/${e}/src/libs/${t}`:`modules/${e}/dist/libs/${t}`}function UL(t){return HL.apply(this,arguments)}function HL(){return(HL=PS(function*(t){return t.endsWith("wasm")?yield(yield fetch(t)).arrayBuffer():$P?GP?importScripts(t):$L(yield(yield fetch(t)).text(),t):jL.requireFromFile&&(yield jL.requireFromFile(t))})).apply(this,arguments)}function $L(t,e){if(!$P)return jL.requireFromString&&jL.requireFromString(t,e);if(GP)return eval.call(HP,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 GL="https://www.gstatic.com/draco/versioned/decoders/1.4.1/draco_decoder.js",WL="https://www.gstatic.com/draco/versioned/decoders/1.4.1/draco_wasm_wrapper.js",qL="https://www.gstatic.com/draco/versioned/decoders/1.4.1/draco_decoder.wasm";let XL;function YL(t){return KL.apply(this,arguments)}function KL(){return(KL=PS(function*(t){const e=t.modules||{};return XL=e.draco3d?XL||e.draco3d.createDecoderModule({}).then(t=>({draco:t})):XL||QL(t),yield XL})).apply(this,arguments)}function QL(t){return ZL.apply(this,arguments)}function ZL(){return(ZL=PS(function*(t){let e,n;switch(t.draco&&t.draco.decoderType){case"js":e=yield BL(GL,"draco",t);break;case"wasm":default:[e,n]=yield Promise.all([yield BL(WL,"draco",t),yield BL(qL,"draco",t)])}return e=e||globalThis.DracoDecoderModule,yield JL(e,n)})).apply(this,arguments)}function JL(t,e){const n={};return e&&(n.wasmBinary=e),new Promise(e=>{t(zn(vt({},n),{onModuleLoaded:t=>e({draco:t})}))})}const tj=zn(vt({},lL),{parse:function(t,e){return ej.apply(this,arguments)}});function ej(){return(ej=PS(function*(t,e){const{draco:n}=yield YL(e),i=new LL(n);try{return i.parseSync(t,null==e?void 0:e.draco)}finally{i.destroy()}})).apply(this,arguments)}function nj(t,e){return tP(t>=0),tP(e>0),t+(e-1)&~(e-1)}function ij(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+nj(i.byteLength,4)}const rj=["SCALAR","VEC2","VEC3","VEC4"],sj=[[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Uint32Array,5125],[Float32Array,5126],[Float64Array,5130]],oj=new Map(sj),aj={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},lj={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},cj={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function uj(t){return rj[t-1]||rj[0]}function hj(t){const e=oj.get(t.constructor);if(!e)throw new Error("Illegal typed array");return e}function dj(t,e){const n=cj[t.componentType],i=aj[t.type],r=t.count*i,s=t.count*i*lj[t.componentType];return sL(s>=0&&s<=e.byteLength),{ArrayType:n,length:r,byteLength:s}}const pj={asset:{version:"2.0",generator:"loaders.gl"},buffers:[]};class fj{constructor(t){kP(this,"gltf",void 0),kP(this,"sourceBuffers",void 0),kP(this,"byteLength",void 0),this.gltf=t||{json:vt({},pj),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 sL(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}=dj(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 sL(e),this.json.extensions=this.json.extensions||{},this.json.extensions[t]=e,this.registerUsedExtension(t),e}addRequiredExtension(t,e={}){return sL(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=fD(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;sL(Number.isFinite(e)),this.sourceBuffers=this.sourceBuffers||[],this.sourceBuffers.push(t);const n={buffer:0,byteOffset:this.byteLength,byteLength:e};return this.byteLength+=nj(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:uj(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:hj(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=ij(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*Pj(t){for(const e of t.json.meshes||[])for(const t of e.primitives)yield t}function Aj(t){return Mj.apply(this,arguments)}function Mj(){return(Mj=PS(function*(t){const e=new fj(t),{json:n}=e;e.removeExtension(yj);for(const i of n.materials||[])i.extensions&&i.extensions.KHR_materials_unlit&&(i.unlit=!0),e.removeObjectExtension(i,yj)})).apply(this,arguments)}function Ij(t){const e=new fj(t),{json:n}=e;if(e.materials)for(const i of n.materials||[])i.unlit&&(delete i.unlit,e.addObjectExtension(i,yj,{}),e.addExtension(yj))}function Dj(t){return Rj.apply(this,arguments)}function Rj(){return(Rj=PS(function*(t){const e=new fj(t),{json:n}=e,i=e.getExtension(bj);i&&(e.json.lights=i.lights,e.removeExtension(bj));for(const r of n.nodes||[]){const t=e.getObjectExtension(r,bj);t&&(r.light=t.light),e.removeObjectExtension(r,bj)}})).apply(this,arguments)}function Nj(t){return Lj.apply(this,arguments)}function Lj(){return(Lj=PS(function*(t){const e=new fj(t),{json:n}=e;if(n.lights){const t=e.addExtension(bj);sL(!t.lights),t.lights=n.lights,delete n.lights}if(e.json.lights){for(const t of e.json.lights)e.addObjectExtension(t.node,bj,t);delete e.json.lights}})).apply(this,arguments)}function jj(t){return Fj.apply(this,arguments)}function Fj(){return(Fj=PS(function*(t){const e=new fj(t),{json:n}=e,i=e.getExtension(vj);if(i){const t=zj(i,e);for(const i of n.materials||[]){const n=e.getObjectExtension(i,vj);n&&(i.technique=Object.assign({},n,t[n.technique]),i.technique.values=Uj(i.technique,e)),e.removeObjectExtension(i,vj)}e.removeExtension(vj)}})).apply(this,arguments)}function Bj(t,e){return Vj.apply(this,arguments)}function Vj(){return(Vj=PS(function*(t,e){})).apply(this,arguments)}function zj(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 Uj(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 Hj={KHR_draco_mesh_compression:i,KHR_materials_unlit:r,KHR_lights_punctual:s,KHR_techniques_webgl:o};function $j(t){return Gj.apply(this,arguments)}function Gj(){return(Gj=PS(function*(t,e={},n){for(const r in Hj){var i;const s=(null==e||null===(i=e.gltf)||void 0===i?void 0:i.excludeExtensions)||{};r in s&&!s[r]||(yield Hj[r].decode(t,e,n))}})).apply(this,arguments)}const Wj={accessors:"accessor",animations:"animation",buffers:"buffer",bufferViews:"bufferView",images:"image",materials:"material",meshes:"mesh",nodes:"node",samplers:"sampler",scenes:"scene",skins:"skin",textures:"texture"},qj={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 Xj{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 fj(t),{json:n}=e;for(const i of n.images||[]){const t=e.removeObjectExtension(i,gj);t&&Object.assign(i,t)}n.buffers&&n.buffers[0]&&delete n.buffers[0].uri,e.removeExtension(gj)}(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 Wj)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 Wj)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=qj[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 Yj(t,e={}){return(new Xj).normalize(t,e)}const Kj={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Qj={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},Zj={TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,REPEAT:10497,LINEAR:9729,NEAREST_MIPMAP_LINEAR:9986},Jj={magFilter:Zj.TEXTURE_MAG_FILTER,minFilter:Zj.TEXTURE_MIN_FILTER,wrapS:Zj.TEXTURE_WRAP_S,wrapT:Zj.TEXTURE_WRAP_T},tF={[Zj.TEXTURE_MAG_FILTER]:Zj.LINEAR,[Zj.TEXTURE_MIN_FILTER]:Zj.NEAREST_MIPMAP_LINEAR,[Zj.TEXTURE_WRAP_S]:Zj.REPEAT,[Zj.TEXTURE_WRAP_]:Zj.REPEAT};class eF{postProcess(t,e={}){const{json:n,buffers:i=[],images:r=[],baseUri:s=""}=t;return sL(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=vt({},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=vt({},t.normalTexture),t.normalTexture.texture=this.getTexture(t.normalTexture.index)),t.occlusionTexture&&(t.occlustionTexture=vt({},t.occlustionTexture),t.occlusionTexture.texture=this.getTexture(t.occlusionTexture.index)),t.emissiveTexture&&(t.emmisiveTexture=vt({},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=vt({},t.pbrMetallicRoughness);const e=t.pbrMetallicRoughness;e.baseColorTexture&&(e.baseColorTexture=vt({},e.baseColorTexture),e.baseColorTexture.texture=this.getTexture(e.baseColorTexture.index)),e.metallicRoughnessTexture&&(e.metallicRoughnessTexture=vt({},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 Qj[t]}(t.componentType),t.components=function(t){return Kj[t]}(t.type),t.bytesPerElement=t.bytesPerComponent*t.components,t.bufferView){const e=t.bufferView.buffer,{ArrayType:n,byteLength:i}=dj(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):tF,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 Jj[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 nF(t,e){return(new eF).postProcess(t,e)}const iF=1735152710,rF=!0;function sF(t,e,n,i){const r=new Uint8Array(e.buffer,n,i),s=new TextDecoder("utf8").decode(r);return t.json=JSON.parse(s),nj(i,4)}function oF(t,e,n,i){return t.header.hasBinChunk=!0,t.binChunks.push({byteOffset:n,byteLength:i,arrayBuffer:e.buffer}),nj(i,4)}function aF(t,e){return lF.apply(this,arguments)}function lF(){return(lF=PS(function*(t,e,n=0,i,r){var s,o,a,l;cF(t,e,n,i),Yj(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 uF(t,i,r)),null!=i&&null!==(a=i.gltf)&&void 0!==a&&a.loadImages){const e=dF(t,i,r);c.push(e)}const u=$j(t,i,r);return c.push(u),yield Promise.all(c),null!=i&&null!==(l=i.gltf)&&void 0!==l&&l.postProcess?nF(t,i):t})).apply(this,arguments)}function cF(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=iF}=n,s=i.getUint32(e,!1);return s===r||s===iF}(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)?rL(t.buffer,t.byteOffset,e):t instanceof ArrayBuffer?rL(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,rF),a=r.getUint32(n+8,rF);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){tP(t.header.byteLength>20);const i=e.getUint32(n+0,rF),r=e.getUint32(n+4,rF);return n+=8,tP(0===r),sF(t,e,n,i),(n+=i)+oF(t,e,n,t.header.byteLength)}(t,r,n);case 2:return function(t,e,n,i){return tP(t.header.byteLength>20),function(t,e,n,i){for(;n+8<=t.header.byteLength;){const r=e.getUint32(n+0,rF),s=e.getUint32(n+4,rF);switch(n+=8,s){case 1313821514:sF(t,e,n,r);break;case 5130562:oF(t,e,n,r);break;case 0:i.strict||sF(t,e,n,r);break;case 1:i.strict||oF(t,e,n,r)}n+=nj(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),sL("glTF"===r.type,`Invalid GLB magic string ${r.type}`),t._glb=r,t.json=r.json}else sL(!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 uF(t,e,n){return hF.apply(this,arguments)}function hF(){return(hF=PS(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 vF(()=>e.some(t=>!t.loaded))})).apply(this,arguments)}function vF(t){return _F.apply(this,arguments)}function _F(){return(_F=PS(function*(t){for(;t();)yield new Promise(t=>requestAnimationFrame(t))})).apply(this,arguments)}const wF=[255,255,255,255],xF={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:wF},_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:[mF]};let SF=(()=>{class t extends eM{getShaders(){const t=[pR,gR];return"pbr"===this.props._lighting&&t.push(vN),{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:wF,transition:!0},instanceModelMatrix:pN})}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 _N)n={scenes:[t.scenegraph]};else if(t.scenegraph&&!t.scenegraph.gltf){const i=t.scenegraph,r=function(t,e,n){const i=new iL(t,n);return{scenes:i.instantiate(e),animator:i.createAnimator()}}(e,i,this._getModelOptions());n=vt({gltf:i},r),function(t){return yF.apply(this,arguments)}(r).then(()=>this.setNeedsRedraw())}else t.scenegraph&&(Gw.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 _N?(this._deleteScenegraph(),this._applyAllAttributes(r),this._applyAnimationsProp(r,s,t._animations),this.setState({scenegraph:r,animator:s})):null!==r&&Gw.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):Gw.warn("animation ".concat(t," not found"))()}})}_deleteScenegraph(){const{scenegraph:t}=this.state;t instanceof _N&&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:vt({isInstanced:!0,transpileToGLSL100:!Zw(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:fN(i,l),sceneModelMatrix:u,u_Camera:n.model.getUniforms().project_uCameraPosition}})})}}return t.layerName="ScenegraphLayer",t.defaultProps=xF,t})();class CF extends bR{constructor(t={}){const{id:e=Zx("sphere-geometry")}=t,{indices:n,attributes:i}=function(t){const{nlat:e=10,nlong:n=10}=t;let{radius:i=1}=t;const r=Math.PI-0,s=2*Math.PI-0,o=(e+1)*(n+1);if("number"==typeof i){const t=i;i=(e,n,i,r,s)=>t}const a=new Float32Array(3*o),l=new Float32Array(3*o),c=new Float32Array(2*o),u=new(o>65535?Uint32Array:Uint16Array)(e*n*6);for(let d=0;d<=e;d++)for(let t=0;t<=n;t++){const o=t/n,u=d/e,h=t+d*(n+1),p=2*h,f=3*h,g=s*o,m=r*u,b=Math.sin(g),y=Math.cos(g),v=Math.sin(m),_=y*v,w=Math.cos(m),x=b*v,S=i(_,w,x,o,u);a[f+0]=S*_,a[f+1]=S*w,a[f+2]=S*x,l[f+0]=_,l[f+1]=w,l[f+2]=x,c[p+0]=o,c[p+1]=1-u}const h=n+1;for(let d=0;ds?(a=i,o=1,t=n):t=e+T/s*(n-e),(-2===T||T===s+2)&&(t=0,o=0),a-=i/2;for(let e=0;es?0:n*g,S[E+w[1]]=T<0?-1:T>s?1:m,S[E+w[2]]=T<0||T>s?0:i*g,C[O+0]=e/r,C[O+1]=o,O+=2,E+=3}}for(let T=0;T0){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 jF){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 jF){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 jF){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 jF){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 jF){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=FF,r=1/n;i.set(this.x*r,this.y*r,this.z*r);const s=BF;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(VF),VF.almostEquals(t,e)}clone(){return new jF(this.x,this.y,this.z)}}jF.ZERO=void 0,jF.UNIT_X=void 0,jF.UNIT_Y=void 0,jF.UNIT_Z=void 0,jF.ZERO=new jF(0,0,0),jF.UNIT_X=new jF(1,0,0),jF.UNIT_Y=new jF(0,1,0),jF.UNIT_Z=new jF(0,0,1);const FF=new jF,BF=new jF,VF=new jF;class zF{constructor(t={}){this.lowerBound=void 0,this.upperBound=void 0,this.lowerBound=new jF,this.upperBound=new jF,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=HF;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=HF;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 UF=new jF,HF=[new jF,new jF,new jF,new jF,new jF,new jF,new jF,new jF];class $F{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 jF){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=GF;t.tangents(e,WF),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(Yr(t.length(),2)*Yr(e.length(),2))+t.dot(e),this.normalize()}return this}mult(t,e=new $F){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 $F){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 $F){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 jF){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 $F(this.x,this.y,this.z,this.w)}slerp(t,e,n=new $F){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 $F){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 GF=new jF,WF=new jF,qF={SPHERE:1,PLANE:2,BOX:4,COMPOUND:8,CONVEXPOLYHEDRON:16,HEIGHTFIELD:32,PARTICLE:64,CYLINDER:128,TRIMESH:256};let XF=(()=>{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=qF,t})();class YF{constructor(t={}){this.position=void 0,this.quaternion=void 0,this.position=new jF,this.quaternion=new $F,t.position&&this.position.copy(t.position),t.quaternion&&this.quaternion.copy(t.quaternion)}pointToLocal(t,e){return YF.pointToLocalFrame(this.position,this.quaternion,t,e)}pointToWorld(t,e){return YF.pointToWorldFrame(this.position,this.quaternion,t,e)}vectorToWorldFrame(t,e=new jF){return this.quaternion.vmult(t,e),e}static pointToLocalFrame(t,e,n,i=new jF){return n.vsub(t,i),e.conjugate(KF),KF.vmult(i,i),i}static pointToWorldFrame(t,e,n,i=new jF){return e.vmult(n,i),i.vadd(t,i),i}static vectorToWorldFrame(t,e,n=new jF){return t.vmult(e,n),n}static vectorToLocalFrame(t,e,n,i=new jF){return e.w*=-1,e.vmult(n,i),e.w*=-1,i}}const KF=new $F;class QF extends XF{constructor(t={}){const{vertices:e=[],faces:n=[],normals:i=[],axes:r,boundingSphereRadius:s}=t;super({type:XF.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 jF;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 jF,c=new jF,u=new jF,h=new jF,d=new jF,p=new jF;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){QF.project(this,t,n,i,ZF),QF.project(e,t,r,s,JF);const o=ZF[0],a=ZF[1],l=JF[0],c=JF[1];if(o0?1/e:0,this.material=t.material||null,this.linearDamping="number"==typeof t.linearDamping?t.linearDamping:.01,this.type=e<=0?sB.STATIC:sB.DYNAMIC,typeof t.type==typeof sB.STATIC&&(this.type=t.type),this.allowSleep=void 0===t.allowSleep||t.allowSleep,this.sleepState=sB.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 jF,this.quaternion=new $F,this.initQuaternion=new $F,this.previousQuaternion=new $F,this.interpolatedQuaternion=new $F,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 jF,t.angularVelocity&&this.angularVelocity.copy(t.angularVelocity),this.initAngularVelocity=new jF,this.shapes=[],this.shapeOffsets=[],this.shapeOrientations=[],this.inertia=new jF,this.invInertia=new jF,this.invInertiaWorld=new NF,this.invMassSolve=0,this.invInertiaSolve=new jF,this.invInertiaWorldSolve=new NF,this.fixedRotation=void 0!==t.fixedRotation&&t.fixedRotation,this.angularDamping=void 0!==t.angularDamping?t.angularDamping:.01,this.linearFactor=new jF(1,1,1),t.linearFactor&&this.linearFactor.copy(t.linearFactor),this.angularFactor=new jF(1,1,1),t.angularFactor&&this.angularFactor.copy(t.angularFactor),this.aabb=new zF,this.aabbNeedsUpdate=!0,this.boundingRadius=0,this.wlambda=new jF,this.isTrigger=Boolean(t.isTrigger),t.shape&&this.addShape(t.shape),this.updateMassProperties()}wakeUp(){const t=this.sleepState;this.sleepState=sB.AWAKE,this.wakeUpAfterNarrowphase=!1,t===sB.SLEEPING&&this.dispatchEvent(sB.wakeupEvent)}sleep(){this.sleepState=sB.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=Yr(this.sleepSpeedLimit,2);e===sB.AWAKE&&ni?this.wakeUp():e===sB.SLEEPY&&t-this.timeLastSleepy>this.sleepTimeLimit&&(this.sleep(),this.dispatchEvent(sB.sleepEvent))}}updateSolveMassProperties(){this.sleepState===sB.SLEEPING||this.type===sB.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 jF){return t.vsub(this.position,e),this.quaternion.conjugate().vmult(e,e),e}vectorToLocalFrame(t,e=new jF){return this.quaternion.conjugate().vmult(t,e),e}pointToWorldFrame(t,e=new jF){return this.quaternion.vmult(t,e),e.vadd(this.position,e),e}vectorToWorldFrame(t,e=new jF){return this.quaternion.vmult(t,e),e}addShape(t,e,n){const i=new jF,r=new $F;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=oB,s=aB,o=this.quaternion,a=this.aabb,l=lB;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=cB,n=uB;t.setRotationFromQuaternion(this.quaternion),t.transpose(n),t.scale(e,t),t.mmult(n,this.invInertiaWorld)}}applyForce(t,e=new jF){if(this.type!==sB.DYNAMIC)return;this.sleepState===sB.SLEEPING&&this.wakeUp();const n=hB;e.cross(t,n),this.force.vadd(t,this.force),this.torque.vadd(n,this.torque)}applyLocalForce(t,e=new jF){if(this.type!==sB.DYNAMIC)return;const n=dB,i=pB;this.vectorToWorldFrame(t,n),this.vectorToWorldFrame(e,i),this.applyForce(n,i)}applyTorque(t){this.type===sB.DYNAMIC&&(this.sleepState===sB.SLEEPING&&this.wakeUp(),this.torque.vadd(t,this.torque))}applyImpulse(t,e=new jF){if(this.type!==sB.DYNAMIC)return;this.sleepState===sB.SLEEPING&&this.wakeUp();const n=e,i=fB;i.copy(t),i.scale(this.invMass,i),this.velocity.vadd(i,this.velocity);const r=gB;n.cross(t,r),this.invInertiaWorld.vmult(r,r),this.angularVelocity.vadd(r,this.angularVelocity)}applyLocalImpulse(t,e=new jF){if(this.type!==sB.DYNAMIC)return;const n=mB,i=bB;this.vectorToWorldFrame(t,n),this.vectorToWorldFrame(e,i),this.applyImpulse(n,i)}updateMassProperties(){const t=yB;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),nB.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 jF;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!==sB.DYNAMIC&&this.type!==sB.KINEMATIC||this.sleepState===sB.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()}}sB.idCounter=0,sB.COLLIDE_EVENT_NAME="collide",sB.DYNAMIC=1,sB.STATIC=2,sB.KINEMATIC=4,sB.AWAKE=0,sB.SLEEPY=1,sB.SLEEPING=2,sB.wakeupEvent={type:"wakeup"},sB.sleepyEvent={type:"sleepy"},sB.sleepEvent={type:"sleep"};const oB=new jF,aB=new $F,lB=new zF,cB=new NF,uB=new NF,hB=new jF,dB=new jF,pB=new jF,fB=new jF,gB=new jF,mB=new jF,bB=new jF,yB=new jF;new jF,new jF;class vB{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 jF,this.rayToWorld=new jF,this.hitNormalWorld=new jF,this.hitPointWorld=new jF,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 _B,wB,xB,SB,CB,EB,OB;_B=XF.types.SPHERE,wB=XF.types.PLANE,xB=XF.types.BOX,SB=XF.types.CYLINDER,CB=XF.types.CONVEXPOLYHEDRON,EB=XF.types.HEIGHTFIELD,OB=XF.types.TRIMESH;class TB{get[_B](){return this._intersectSphere}get[wB](){return this._intersectPlane}get[xB](){return this._intersectBox}get[SB](){return this._intersectConvex}get[CB](){return this._intersectConvex}get[EB](){return this._intersectHeightfield}get[OB](){return this._intersectTrimesh}constructor(t=new jF,e=new jF){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 jF,this.precision=1e-4,this.checkCollisionResponse=!0,this.skipBackfaces=!1,this.collisionFilterMask=-1,this.collisionFilterGroup=-1,this.mode=TB.ANY,this.result=new vB,this.hasHit=!1,this.callback=t=>{}}intersectWorld(t,e){return this.mode=e.mode||TB.ANY,this.result=e.result||new vB,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(kB),PB.length=0,t.broadphase.aabbQuery(t,kB,PB),this.intersectBodies(PB),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=IB,r=DB;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 jF(0,0,1);e.vmult(l,l);const c=new jF;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=$B,a=GB,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,RB,r,i,t)}}}}_intersectTrimesh(t,e,n,i,r,s){const o=WB,a=ZB,l=JB,c=GB,u=qB,h=XB,d=YB,p=QB,f=KB,g=t.indices,m=this.from,b=this.to,y=this.direction;l.position.copy(n),l.quaternion.copy(e),YF.vectorToLocalFrame(n,e,y,u),YF.pointToLocalFrame(n,e,m,h),YF.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],NB),NB.vsub(h,c);const l=u.dot(o),d=o.dot(c)/l;if(d<0)continue;u.scale(d,RB),RB.vadd(h,RB),t.getVertex(g[3*s+1],LB),t.getVertex(g[3*s+2],jB);const m=RB.distanceSquared(h);!TB.pointInTriangle(RB,LB,NB,jB)&&!TB.pointInTriangle(RB,NB,LB,jB)||m>v||(YF.vectorToWorldFrame(e,o,f),YF.pointToWorldFrame(n,e,RB,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 TB.ALL:this.hasHit=!0,l.set(s,o,t,e,n,i,a),l.hasHit=!0,this.callback(l);break;case TB.CLOSEST:(a=0&&(u=r*l-s*o)>=0&&c+uDate.now()-t}var PV=n(24517);function AV(t,e,n){e||(e=new VT(VT.IDENTITY));const i=new VT(VT.IDENTITY);if(!t)return!0;if(t.matrix)i.copy(t.matrix);else{if(i.identity(),t.translation&&i.translate(t.translation),t.rotation){const e=new VT(VT.IDENTITY).fromQuaternion(t.rotation);i.multiplyRight(e)}t.scale&&i.scale(t.scale)}const r=new VT(e).multiplyRight(i);if(!1===n(t,r,e))return!1;for(const s of t.nodes||t.children||[])if(!1===AV(s,r,n))return!1;return!0}function MV(){DA([lL,mF])}function IV(t,e){var n;const i=null===(n=e.nodes)||void 0===n?void 0:n.find(e=>e.name===t);if(i){let n=!1;for(const t of e.scenes)n||AV(t,new VT(VT.IDENTITY),(t,e)=>t!==i||(t.matrix=e,t.translation=void 0,t.rotation=void 0,t.scale=void 0,n=!0,!1));return e.scene={id:t,name:t,nodes:[i]},e.scenes=[e.scene],{scene:e.scene,scenes:e.scenes}}return e}function DV(t,e){return xw(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 $A(i,mF,{DracoLoader:tj,gltf:{decompressMeshes:!0,postProcess:!0}});return r.nodes||console.log("WARNING: Empty Scene",n,r),IV(t.scenegraphNode,r)})}function RV(t,e){return xw(this,void 0,void 0,function*(){return IV(t,yield e)})}function NV(t,e,n){if(e&&0!==e.length){let i;switch(n.geometry){case"sphere":i=new CF;break;case"cone":i=new TF;break;case"cylinder":i=new kF;break;case"cube":default:i=new RF}return new yN(Object.assign({id:t,pickable:!0,autoHighlight:!1,highlightColor:[30,136,229,255],coordinateSystem:Ww.CARTESIAN,data:e,mesh:i,wireframe:!1,getTransformMatrix:t=>t.transformMatrix,getColor:t=>t.color||[255,255,255,229.5]},n))}}function LV(t,e,n){if(e&&0!==e.length)return new eN(Object.assign({id:t,pickable:!0,data:e.map(t=>Object.assign(Object.assign({},t),{position:new VT(t.transformMatrix).getTranslation()})),getText:t=>t.text,getPosition:t=>t.position,getColor:t=>t.color},n))}let jV=(()=>{class t extends nM{initializeState(){const{data:t}=this.props;this.setState({data:null!=t?t:[],zoomOpacity:.8,doCollisions:!1}),MV()}renderLayers(){var e,n;const i=this.state,r={sphere:[],cone:[],cylinder:[],cube:[],text:[],wireframe:[],scenegraph:[]};for(const t of i.data){const n=null!==(e=t.geometry)&&void 0!==e?e:"cube";t.scenegraph?r.scenegraph.push(t):void 0!==r[n]&&r[n].push(t)}const s={};for(const a of r.scenegraph)a.scenegraph&&a.scenegraphNode&&!Object.prototype.hasOwnProperty.call(s,a.scenegraph)&&(s[a.scenegraph]=DV({scenegraph:a.scenegraph},t.gltfCache));const o=[];for(const[t,a]of Object.entries(r))if("scenegraph"===t)for(const e of a)o.push(new SF({id:"models-"+e["@id"],opacity:e.zoomBasedOpacity?i.zoomOpacity:void 0!==e.opacity?e.opacity:1,pickable:!e.unpickable,coordinateSystem:Ww.CARTESIAN,data:[e],scenegraph:e.scenegraphNode?RV(e.scenegraphNode,s[e.scenegraph]):e.scenegraph,_lighting:e._lighting,getTransformMatrix:e.transformMatrix,getColor:null!==(n=e.color)&&void 0!==n?n:[0,255,0,127.5],parameters:{depthMask:!e.zoomBasedOpacity&&(void 0===e.opacity||1===e.opacity)}}));else"text"===t?(o.push(LV("text",a.filter(t=>t.unpickable),{pickable:!1})),o.push(LV("textPickable",a.filter(t=>!t.unpickable),{pickable:!0}))):"wireframe"===t?o.push(NV(t,a,{wireframe:!0,pickable:!1,geometry:t})):(o.push(NV(t,a.filter(t=>t.unpickable),{wireframe:!1,pickable:!1,geometry:t})),o.push(NV(`${t}Pickable`,a.filter(t=>!t.unpickable),{wireframe:!1,pickable:!0,geometry:t})));return i.doCollisions&&function(t){xw(this,void 0,void 0,function*(){console.log("Starting Collisioning");const e=t.filter(t=>!t.scenegraph&&"wireframe"!==t.geometry).map(t=>{const e=new VT(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 zF({lowerBound:new jF(...n.map((t,e)=>Math.min(t,i[e]))),upperBound:new jF(...i.map((t,e)=>Math.max(t,n[e])))})}}),n=[];for(const o of t.filter(t=>!!t.scenegraph)){const t=yield XA(o.scenegraph,mF,{DracoLoader:tj,decompress:!0,postProcess:!0});for(const e of t.scenes)AV(e,new VT(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 zF({lowerBound:new jF(...s.map((t,e)=>Math.min(t,a[e]))),upperBound:new jF(...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})}(i.data),o.filter(t=>!!t)}getPickingInfo(t){return t.info}}return t.layerName="BodyUILayer",t.gltfCache={},t})();function FV(t,e=[]){for(const n of t.nodes||t.children||[])e.push(n.name),FV(n,e);return e}let BV=(()=>{class t{constructor(t){var e,n,i,r,s;this.deckProps=t,this.bodyUILayer=new jV({}),this.nodeClickSubject=new A,this.nodeHoverStartSubject=new A,this.nodeHoverStopSubject=new A,this.sceneRotationSubject=new Jf([0,0]),this.nodeDragStartSubject=new A,this.nodeDragSubject=new A,this.nodeDragEndSubject=new A,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 IM({flipY:!1,near:-1e3}):new LM({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 cI({ambientLight:new VM({color:[255,255,255],intensity:10})})]),this.deck=new dR(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 xw(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 VT([.076,0,0,0,0,.076,16875389974302382e-33,0,0,-16875389974302382e-33,.076,0,.49,.034,.11,1]);(function(t,e,n,i){return xw(this,void 0,void 0,function*(){MV();const n=yield DV({scenegraph:t,scenegraphNode:"VHF_Kidney_L_Low1"},undefined),i={},r=[];for(const s of n.scenes)AV(s,e=new VT(e||VT.IDENTITY),(n,s)=>{const o={"@id":n.name||n.id,"@type":"ProcessedNode",transformMatrix:new VT(s),geometry:"wireframe",node:n};if(r.push({"@id":`GLTF:${o["@id"]}`,"@type":"GLTFNode",scenegraph:t,scenegraphNode:o["@id"],transformMatrix:new VT(e||VT.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 zF({lowerBound:new jF(...e.map((t,e)=>Math.min(t,n[e]))),upperBound:new jF(...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 FV(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 jF(.5,.5,.5)),i=t.center=e.clone().vadd(n);t.transformMatrix=new VT(VT.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 VT(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 vw([PV.ZP],t.prototype,"_onHover",null),vw([PV.ZP],t.prototype,"_onClick",null),vw([PV.ZP],t.prototype,"_onViewStateChange",null),vw([PV.ZP],t.prototype,"_onDragStart",null),vw([PV.ZP],t.prototype,"_onDrag",null),vw([PV.ZP],t.prototype,"_onDragEnd",null),t})();function VV(t,e){return t===e}function zV(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 $V=(()=>{class t{constructor(){this.bootstrap$=new _p(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 GV=new oi("INITIAL_STATE_TOKEN");let WV=(()=>{class t{static set(t){this.value=t}static pop(){const t=this.value;return this.value={},t}}return t.value={},t})();const qV=new oi("Internals.StateContextFactory"),XV=new oi("Internals.StateFactory");function YV(t,e){return e?n=>n.pipe(YV((n,i)=>U(t(n,i)).pipe(D((t,r)=>e(n,t,i,r))))):e=>e.lift(new KV(t))}class KV{constructor(t){this.project=t}call(t,e){return e.subscribe(new QV(t,this.project))}}class QV 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 ZV(t=null){return e=>e.lift(new JV(t))}class JV{constructor(t){this.defaultValue=t}call(t,e){return e.subscribe(new tz(t,this.defaultValue))}}class tz 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 ez={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 nz=(()=>{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 Tu.isInAngularZone()?t():this._ngZone.run(t)}runOutsideAngular(t){return Tu.isInAngularZone()?this._ngZone.runOutsideAngular(t):t()}verifyZoneIsNotNooped(t){t instanceof Tu||console.warn(ez.ZONE_WARNING())}}return t.\u0275fac=function(e){return new(e||t)(Ei(Tu),Ei(hu))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();const iz=new oi("ROOT_STATE_TOKEN"),rz=new oi("FEATURE_STATE_TOKEN"),sz=new oi("NGXS_PLUGINS"),oz=new oi("NG_TEST_MODE"),az=new oi("NG_DEV_MODE"),lz="NGXS_META",cz="NGXS_OPTIONS_META",uz="NGXS_SELECTOR_META";let hz=(()=>{class t{constructor(){this.defaultsState={},this.selectorOptions={injectContainerState:!0,suppressErrors:!0},this.compatibility={strictContentSecurityPolicy:!1},this.executionStrategy=nz}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();class dz{constructor(t,e,n){this.previousValue=t,this.currentValue=e,this.firstChange=n}}const pz=new oi("NGXS_EXECUTION_STRATEGY");function fz(t){return t.constructor&&t.constructor.type?t.constructor.type:t.type}const gz=(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},mz=(t,e)=>e.split(".").reduce((t,e)=>t&&t[e],t),bz=t=>t&&"object"==typeof t&&!Array.isArray(t),yz=(t,...e)=>{if(!e.length)return t;const n=e.shift();if(bz(t)&&bz(n))for(const i in n)bz(n[i])?(t[i]||Object.assign(t,{[i]:{}}),yz(t[i],n[i])):Object.assign(t,{[i]:n[i]});return yz(t,...e)};function vz(t){if(!t.hasOwnProperty(lz)){const e={name:null,actions:{},defaults:{},path:null,makeRootSelector:t=>t.getStateGetter(e.name),children:[]};Object.defineProperty(t,lz,{value:e})}return _z(t)}function _z(t){return t[lz]}function wz(t){return t[uz]}function xz(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(t[fz(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 ep(n=>{const i=fz(n.action);return t[i]&&(!e||e[n.status])})}(i,r),n())}}(t,["DISPATCHED"])}function Ez(){return D(t=>t.action)}function Oz(t){return e=>new E(n=>e.subscribe({next(e){t.leave(()=>n.next(e))},error(e){t.leave(()=>n.error(e))},complete(){t.leave(()=>n.complete())}}))}let Tz=(()=>{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)(Ei(pz))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();class kz extends A{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 Pz=(()=>{class t extends kz{}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})(),Az=(()=>{class t extends E{constructor(t,e){super(n=>{const i=t.pipe(Oz(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)(Ei(Pz),Ei(Tz))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();const Mz=t=>(...e)=>t.shift()(...e,(...e)=>Mz(t)(...e));let Iz=(()=>{class t extends Jf{constructor(){super({})}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),Dz=(()=>{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)(Ei(t,12),Ei(sz,8))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),Rz=(()=>{class t extends A{}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})(),Nz=(()=>{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(Oz(this._ngxsExecutionStrategy))}dispatchByEvents(t){return Array.isArray(t)?0===t.length?Dd(this._stateStream.getValue()):Ev(t.map(t=>this.dispatchSingle(t))):this.dispatchSingle(t)}dispatchSingle(t){if(!fz(t))return gp(new Error(`This action doesn't have a type property: ${t.constructor.name}`));const e=this._stateStream.getValue();return Mz([...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(xp())}getActionResultStream(t){return this._actionResults.pipe(ep(e=>e.action===t&&"DISPATCHED"!==e.status),rf(1),xp())}createDispatchObservable(t){return t.pipe(YV(t=>{switch(t.status){case"SUCCESSFUL":return Dd(this._stateStream.getValue());case"ERRORED":return gp(t.error);default:return pp}})).pipe(xp())}}return t.\u0275fac=function(e){return new(e||t)(Ei(No),Ei(Pz),Ei(Rz),Ei(Dz),Ei(Iz),Ei(Tz))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();const Lz=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])&&Lz(t[i])}),t};let jz=(()=>{class t{constructor(t,e){this.isDevMode=t,this.isTestMode=e}}return t.\u0275fac=function(e){return new(e||t)(Ei(az),Ei(oz))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),Fz=(()=>{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(ez.INCORRECT_PRODUCTION()):this.isIncorrectDevelopment&&console.warn(ez.INCORRECT_DEVELOPMENT()))}}return t.\u0275fac=function(e){return new(e||t)(Ei(jz),Ei(hz))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),Bz=(()=>{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=Lz(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)(Ei(Iz),Ei(Nz),Ei(hz),Ei(Fz))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),Vz=(()=>{class t{constructor(t){this._internalStateOperations=t}createStateContext(t){const e=this._internalStateOperations.getRootStateOperations();function n(e){return mz(e,t.path)}function i(n,i){const r=gz(n,t.path,i),s=t.instance;if(s.ngxsOnChanges){const e=Sz(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(ez.PATCHING_ARRAY());if("object"!=typeof t)throw new Error(ez.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)(Ei(Bz))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();class zz{static stateNameErrorMessage(t){return ez.STATE_NAME(t)}static checkCorrectStateName(t){if(!t)throw new Error(ez.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(ez.STATE_UNIQUE(n,t.name,i.name));return n}static getValidStateMeta(t){const e=_z(t);if(!e)throw new Error(ez.STATE_DECORATOR());return e}}zz.stateNameRegex=new RegExp("^[a-zA-Z0-9_]+$");let Uz=(()=>{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=UV(()=>{const t=this;function e(e){const n=t.statePaths[e];return n?xz(n.split("."),t._config):null}return this._parentFactory?this._parentFactory.getRuntimeSelectorContext():{getStateGetter(t){let n=e(t);return n||((...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(zz.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[lz].name};return t.reduce((t,n)=>{const{name:i,children:r}=n[lz];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[lz].name]=e,t),{})}(n),a=[];for(const l of r){const e=o[l],n=s[l],i=e[lz];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)=>gz(t,e.path,e.defaults),{}),states:e}}connectActionHandlers(){null===this._actionsSubscription&&(this._actionsSubscription=this._actions.pipe(ep(t=>"DISPATCHED"===t.status),W(({action:t})=>this.invokeActions(this._actions,t).pipe(D(()=>({action:t,status:"SUCCESSFUL"})),ZV({action:t,status:"CANCELED"}),Tv(e=>Dd({action:t,status:"ERRORED",error:e}))))).subscribe(t=>this._actionResults.next(t)))}invokeActions(t,e){const n=fz(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 E?(r=r.pipe(ZV({})),n.options.cancelUncompleted&&(r=r.pipe(rp(t.pipe(Cz(e)))))):r=Dd({}).pipe(xp()),i.push(r)}catch(r){i.push(gp(r))}}}return i.length||i.push(Dd({})),Ev(i)}addToStatesMap(t){const e=[],n=this.statesByName;for(const i of t){const t=zz.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!==mz(this._initialState,e);return this.statesByName[t]&&n}}return t.\u0275fac=function(e){return new(e||t)(Ei(No),Ei(hz),Ei(t,12),Ei(Pz),Ei(Rz),Ei(Vz),Ei(GV,8))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),Hz=(()=>{class t{constructor(t,e,n){this.internalStateOperations=t,this.stateContextFactory=e,this.bootstrapper=n}ngxsBootstrap(t,e){this.internalStateOperations.getRootStateOperations().dispatch(t).pipe(ep(()=>!!e),eg(()=>this.invokeInit(e.states)),W(()=>this.bootstrapper.appBootstrapped$),ep(t=>!!t)).subscribe(()=>this.invokeBootstrap(e.states))}invokeInit(t){for(const e of t){const t=e.instance;if(t.ngxsOnChanges){const n=Sz(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)(Ei(Bz),Ei(Vz),Ei($V))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();const $z=t=>t&&t.NGXS_SELECTOR_OPTIONS_META||{};function Gz(t,e,n){const i=n&&n.containerClass,r=UV(function(...t){const n=e.apply(i,t);return n instanceof Function?UV.apply(null,[n]):n});Object.setPrototypeOf(r,e);const s=function(t,e){const n=function(t){return t.hasOwnProperty(uz)||Object.defineProperty(t,uz,{value:{makeRootSelector:null,originalFn:null,containerClass:null,selectorName:null,getSelectorOptions:()=>({})}}),wz(t)}(t);n.originalFn=t;let i=()=>({});e&&(n.containerClass=e.containerClass,n.selectorName=e.selectorName,i=e.getSelectorOptions||i);const r=Object.assign({},n);return n.getSelectorOptions=()=>function(t,e){return Object.assign({},$z(t.containerClass)||{},$z(t.originalFn)||{},t.getSelectorOptions()||{},e)}(r,i()),n}(e,n);return s.makeRootSelector=e=>{const{argumentSelectorFunctions:n,selectorOptions:i}=function(t,e,n=[]){const i=e.getSelectorOptions(),r=t.getSelectorOptions(i);return{selectorOptions:r,argumentSelectorFunctions:function(t=[],e,n){const i=[];return n&&(0===t.length||e.injectContainerState)&&_z(n)&&i.push(n),t&&i.push(...t),i}(n,r,e.containerClass).map(e=>Wz(e)(t))}}(e,s,t);return function(t){const e=n.map(e=>e(t));try{return r(...e)}catch(s){if(s instanceof TypeError&&i.suppressErrors)return;throw s}}},r}function Wz(t){const e=wz(t)||_z(t);return e&&e.makeRootSelector||(()=>t)}let qz=(()=>{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),Tv(t=>{const{suppressErrors:e}=this._config.selectorOptions;return t instanceof TypeError&&e?Dd(void 0):gp(t)}),Wd(),Oz(this._internalExecutionStrategy))}selectOnce(t){return this.select(t).pipe(rf(1))}selectSnapshot(t){return this.getStoreBoundSelectorFn(t)(this._stateStream.getValue())}subscribe(t){return this._stateStream.pipe(Oz(this._internalExecutionStrategy)).subscribe(t)}snapshot(){return this._internalStateOperations.getRootStateOperations().getState()}reset(t){return this._internalStateOperations.getRootStateOperations().setState(t)}getStoreBoundSelectorFn(t){return Wz(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)(Ei(Iz),Ei(Bz),Ei(hz),Ei(Tz),Ei(Uz),Ei(GV,8))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),Xz=(()=>{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)(Ei(qz),Ei(hz))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t.store=null,t.config=null,t})();class Yz{static get type(){return"@@INIT"}}class Kz{constructor(t){this.addedStates=t}static get type(){return"@@UPDATE_STATE"}}const Qz=new _p(1);let Zz=(()=>{class t{constructor(e,n,i,r,s=[],o){!function(){try{const t=window.ng,e=!(t.probe&&t.coreTokens)&&Vu();Qz.next(e)}catch(t){Qz.next(!1)}finally{Qz.complete()}}();const a=e.addAndReturnDefaults(s);n.setStateToTheCurrentWithNew(a),e.connectActionHandlers(),o.ngxsBootstrap(new Yz,a)}}return t.\u0275fac=function(e){return new(e||t)(Ei(Uz),Ei(Bz),Ei(qz),Ei(Xz),Ei(iz,8),Ei(Hz))},t.\u0275mod=ie({type:t}),t.\u0275inj=St({}),t})(),Jz=(()=>{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 Kz(a.defaults),a))}static flattenStates(t=[]){return t.reduce((t,e)=>t.concat(e),[])}}return t.\u0275fac=function(e){return new(e||t)(Ei(qz),Ei(Bz),Ei(Uz),Ei(rz,8),Ei(Hz))},t.\u0275mod=ie({type:t}),t.\u0275inj=St({}),t})();class tU{static forRoot(t=[],e={}){return{ngModule:Zz,providers:[Uz,Vz,Az,Pz,$V,Fz,jz,Hz,Nz,Rz,Bz,Tz,qz,Iz,Xz,Dz,...t,...tU.ngxsTokenProviders(t,e)]}}static forFeature(t=[]){return{ngModule:Jz,providers:[Uz,Dz,...t,{provide:rz,multi:!0,useValue:t}]}}static ngxsTokenProviders(t,e){return[{provide:oz,useValue:HV},{provide:az,useValue:Vu},{provide:pz,useClass:e.executionStrategy||nz},{provide:iz,useValue:t},{provide:tU.ROOT_OPTIONS,useValue:e},{provide:hz,useFactory:tU.ngxsConfigFactory,deps:[tU.ROOT_OPTIONS]},{provide:du,useFactory:tU.appBootstrapListenerFactory,multi:!0,deps:[$V]},{provide:GV,useFactory:tU.getInitialState},{provide:qV,useExisting:Vz},{provide:XV,useExisting:Uz}]}static ngxsConfigFactory(t){return yz(new hz,t)}static appBootstrapListenerFactory(t){return()=>t.bootstrap()}static getInitialState(){return WV.pop()}}function eU(t,e){return(n,i)=>{if(n.hasOwnProperty("prototype"))throw new Error(ez.ACTION_DECORATOR());const r=vz(n.constructor);Array.isArray(t)||(t=[t]);for(const s of t){const t=s.type;r.actions[t]||(r.actions[t]=[]),r.actions[t].push({fn:i,options:e||{},type:t})}}}function nU(t){return e=>{!function(t){Qz.subscribe(e=>{e&&(t.\u0275prov||console.warn(ez.UNDECORATED_STATE_IN_IVY(t.name)))})}(e);const n=e,i=vz(n),r=Object.getPrototypeOf(n),s=function(e){return Object.assign({},e[cz]||{},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;zz.checkCorrectStateName(a),n.hasOwnProperty(lz)&&(e.actions=Object.assign({},e.actions,(n[lz]||{}).actions)),e.children=r,e.defaults=s,e.name=a})({meta:i,inheritedStateClass:r,optionsWithInheritance:s}),n[cz]=s}}function iU(t,...e){return function(n,i){const r=i.toString(),s=`__${r}__selector`,o=function(t,e,n=[]){return"string"==typeof(e=e||function(t){const e=t.length-1;return 36===t.charCodeAt(e)?t.slice(0,e):t}(t))?xz(n.length?[e,...n]:e.split("."),Xz.config):e}(r,t,e);Object.defineProperties(n,{[s]:{writable:!0,enumerable:!1,configurable:!0},[r]:{enumerable:!0,configurable:!0,get(){return this[s]||(this[s]=function(t){if(!Xz.store)throw new Error(ez.SELECT_FACTORY_NOT_CONNECTED());return Xz.store.select(t)}(o))}}})}}function rU(t){return(e,n,i)=>{if(!i||null===i.value)throw new Error(ez.SELECTOR_DECORATOR());const r=i.value,s=Gz(t,r,{containerClass:e,selectorName:n.toString(),getSelectorOptions:()=>({})}),o={configurable:!0,get:()=>s};return o.originalFn=r,o}}tU.\u0275fac=function(t){return new(t||tU)},tU.\u0275mod=ie({type:tU}),tU.\u0275inj=St({}),tU.ROOT_OPTIONS=new oi("ROOT_OPTIONS");let sU=(()=>{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(Dl),ea(Al))},t.\u0275dir=se({type:t}),t})(),oU=(()=>{class t extends sU{}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 aU=new oi("NgValueAccessor"),lU={provide:aU,useExisting:pt(()=>uU),multi:!0},cU=new oi("CompositionEventMode");let uU=(()=>{class t extends sU{constructor(t,e,n){super(t,e),this._compositionMode=n,this._composing=!1,null==this._compositionMode&&(this._compositionMode=!function(){const t=Ju()?Ju().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(Dl),ea(Al),ea(cU,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:[xl([lU]),jo]}),t})();const hU=new oi("NgValidators"),dU=new oi("NgAsyncValidators");function pU(t){return null!=t}function fU(t){const e=ha(t)?U(t):t;return pa(e),e}function gU(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 mU(t,e){return e.map(e=>e(t))}function bU(t){return t.map(t=>function(t){return!t.validate}(t)?t:e=>t.validate(e))}function yU(t){return null!=t?function(t){if(!t)return null;const e=t.filter(pU);return 0==e.length?null:function(t){return gU(mU(t,e))}}(bU(t)):null}function vU(t){return null!=t?function(t){if(!t)return null;const e=t.filter(pU);return 0==e.length?null:function(t){return Ev(mU(t,e).map(fU)).pipe(D(gU))}}(bU(t)):null}function _U(t,e){return null===t?[e]:Array.isArray(t)?[...t,e]:[t,e]}function wU(t){return t._rawValidators}function xU(t){return t._rawAsyncValidators}function SU(t){return t?Array.isArray(t)?t:[t]:[]}function CU(t,e){return Array.isArray(t)?t.includes(e):t===e}function EU(t,e){const n=SU(e);return SU(t).forEach(t=>{CU(n,t)||n.push(t)}),n}function OU(t,e){return SU(e).filter(e=>!CU(t,e))}let TU=(()=>{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=yU(this._rawValidators)}_setAsyncValidators(t){this._rawAsyncValidators=t||[],this._composedAsyncValidatorFn=vU(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})(),kU=(()=>{class t extends TU{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 PU extends TU{constructor(){super(...arguments),this._parent=null,this.name=null,this.valueAccessor=null}}class AU{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 MU=(()=>{class t extends AU{constructor(t){super(t)}}return t.\u0275fac=function(e){return new(e||t)(ea(PU,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})(),IU=(()=>{class t extends AU{constructor(t){super(t)}}return t.\u0275fac=function(e){return new(e||t)(ea(kU,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 DU(t,e){LU(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&&FU(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&&FU(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 RU(t,e,n=!0){const i=()=>{};e.valueAccessor&&(e.valueAccessor.registerOnChange(i),e.valueAccessor.registerOnTouched(i)),jU(t,e),t&&(e._invokeOnDestroyCallbacks(),t._registerOnCollectionChange(()=>{}))}function NU(t,e){t.forEach(t=>{t.registerOnValidatorChange&&t.registerOnValidatorChange(e)})}function LU(t,e){const n=wU(t);null!==e.validator?t.setValidators(_U(n,e.validator)):"function"==typeof n&&t.setValidators([n]);const i=xU(t);null!==e.asyncValidator?t.setAsyncValidators(_U(i,e.asyncValidator)):"function"==typeof i&&t.setAsyncValidators([i]);const r=()=>t.updateValueAndValidity();NU(e._rawValidators,r),NU(e._rawAsyncValidators,r)}function jU(t,e){let n=!1;if(null!==t){if(null!==e.validator){const i=wU(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=xU(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 NU(e._rawValidators,i),NU(e._rawAsyncValidators,i),n}function FU(t,e){t._pendingDirty&&t.markAsDirty(),t.setValue(t._pendingValue,{emitModelToViewChange:!1}),e.viewToModelUpdate(t._pendingValue),t._pendingChange=!1}function BU(t,e){LU(t,e)}function VU(t,e){if(!t.hasOwnProperty("model"))return!1;const n=t.model;return!!n.isFirstChange()||!Object.is(e,n.currentValue)}function zU(t,e){t._syncPendingControls(),e.forEach(t=>{const e=t.control;"submit"===e.updateOn&&e._pendingChange&&(t.viewToModelUpdate(e._pendingValue),e._pendingChange=!1)})}function UU(t,e){if(!e)return null;let n,i,r;return Array.isArray(e),e.forEach(t=>{t.constructor===uU?n=t:function(t){return Object.getPrototypeOf(t.constructor)===oU}(t)?i=t:r=t}),r||i||n||null}function HU(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const $U="VALID",GU="INVALID",WU="PENDING",qU="DISABLED";function XU(t){return(ZU(t)?t.validators:t)||null}function YU(t){return Array.isArray(t)?yU(t):t||null}function KU(t,e){return(ZU(e)?e.asyncValidators:t)||null}function QU(t){return Array.isArray(t)?vU(t):t||null}function ZU(t){return null!=t&&!Array.isArray(t)&&"object"==typeof t}class JU{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=YU(this._rawValidators),this._composedAsyncValidatorFn=QU(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===$U}get invalid(){return this.status===GU}get pending(){return this.status==WU}get disabled(){return this.status===qU}get enabled(){return this.status!==qU}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=YU(t)}setAsyncValidators(t){this._rawAsyncValidators=t,this._composedAsyncValidatorFn=QU(t)}addValidators(t){this.setValidators(EU(t,this._rawValidators))}addAsyncValidators(t){this.setAsyncValidators(EU(t,this._rawAsyncValidators))}removeValidators(t){this.setValidators(OU(t,this._rawValidators))}removeAsyncValidators(t){this.setAsyncValidators(OU(t,this._rawAsyncValidators))}hasValidator(t){return CU(this._rawValidators,t)}hasAsyncValidator(t){return CU(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=WU,!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=qU,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=$U,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===$U||this.status===WU)&&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()?qU:$U}_runValidator(){return this.validator?this.validator(this):null}_runAsyncValidator(t){if(this.asyncValidator){this.status=WU,this._hasOwnPendingAsyncValidator=!0;const e=fU(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 eH?i.controls.hasOwnProperty(t)?i.controls[t]:null:i instanceof nH&&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 Bc,this.statusChanges=new Bc}_calculateStatus(){return this._allControlsDisabled()?qU:this.errors?GU:this._hasOwnPendingAsyncValidator||this._anyControlsHaveStatus(WU)?WU:this._anyControlsHaveStatus(GU)?GU:$U}_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){ZU(t)&&null!=t.updateOn&&(this._updateOn=t.updateOn)}_parentMarkedDirty(t){return!t&&!(!this._parent||!this._parent.dirty)&&!this._parent._anyControlsDirty()}}class tH extends JU{constructor(t=null,e,n){super(XU(e),KU(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){HU(this._onChange,t)}registerOnDisabledChange(t){this._onDisabledChange.push(t)}_unregisterOnDisabledChange(t){HU(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 eH extends JU{constructor(t,e,n){super(XU(e),KU(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 tH?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 nH extends JU{constructor(t,e,n){super(XU(e),KU(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 tH?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 iH={provide:kU,useExisting:pt(()=>sH)},rH=(()=>Promise.resolve(null))();let sH=(()=>{class t extends kU{constructor(t,e){super(),this.submitted=!1,this._directives=[],this.ngSubmit=new Bc,this.form=new eH({},yU(t),vU(e))}ngAfterViewInit(){this._setUpdateStrategy()}get formDirective(){return this}get control(){return this.form}get path(){return[]}get controls(){return this.form.controls}addControl(t){rH.then(()=>{const e=this._findContainer(t.path);t.control=e.registerControl(t.name,t.control),DU(t.control,t),t.control.updateValueAndValidity({emitEvent:!1}),this._directives.push(t)})}getControl(t){return this.form.get(t.path)}removeControl(t){rH.then(()=>{const e=this._findContainer(t.path);e&&e.removeControl(t.name),HU(this._directives,t)})}addFormGroup(t){rH.then(()=>{const e=this._findContainer(t.path),n=new eH({});BU(n,t),e.registerControl(t.name,n),n.updateValueAndValidity({emitEvent:!1})})}removeFormGroup(t){rH.then(()=>{const e=this._findContainer(t.path);e&&e.removeControl(t.name)})}getFormGroup(t){return this.form.get(t.path)}updateModel(t,e){rH.then(()=>{this.form.get(t.path).setValue(e)})}setValue(t){this.control.setValue(t)}onSubmit(t){return this.submitted=!0,zU(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(hU,10),ea(dU,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:[xl([iH]),jo]}),t})();const oH={provide:PU,useExisting:pt(()=>lH)},aH=(()=>Promise.resolve(null))();let lH=(()=>{class t extends PU{constructor(t,e,n,i){super(),this.control=new tH,this._registered=!1,this.update=new Bc,this._parent=t,this._setValidators(e),this._setAsyncValidators(n),this.valueAccessor=UU(0,i)}ngOnChanges(t){this._checkForErrors(),this._registered||this._setUpControl(),"isDisabled"in t&&this._updateDisabled(t),VU(t,this.viewModel)&&(this._updateValue(this.model),this.viewModel=this.model)}ngOnDestroy(){this.formDirective&&this.formDirective.removeControl(this)}get path(){return this._parent?function(t,e){return[...e.path,t]}(this.name,this._parent):[this.name]}get formDirective(){return this._parent?this._parent.formDirective:null}viewToModelUpdate(t){this.viewModel=t,this.update.emit(t)}_setUpControl(){this._setUpdateStrategy(),this._isStandalone()?this._setUpStandalone():this.formDirective.addControl(this),this._registered=!0}_setUpdateStrategy(){this.options&&null!=this.options.updateOn&&(this.control._updateOn=this.options.updateOn)}_isStandalone(){return!this._parent||!(!this.options||!this.options.standalone)}_setUpStandalone(){DU(this.control,this),this.control.updateValueAndValidity({emitEvent:!1})}_checkForErrors(){this._isStandalone()||this._checkParentType(),this._checkName()}_checkParentType(){}_checkName(){this.options&&this.options.name&&(this.name=this.options.name),this._isStandalone()}_updateValue(t){aH.then(()=>{this.control.setValue(t,{emitViewToModelChange:!1})})}_updateDisabled(t){const e=t.isDisabled.currentValue,n=""===e||e&&"false"!==e;aH.then(()=>{n&&!this.control.disabled?this.control.disable():!n&&this.control.disabled&&this.control.enable()})}}return t.\u0275fac=function(e){return new(e||t)(ea(kU,9),ea(hU,10),ea(dU,10),ea(aU,10))},t.\u0275dir=se({type:t,selectors:[["","ngModel","",3,"formControlName","",3,"formControl",""]],inputs:{name:"name",isDisabled:["disabled","isDisabled"],model:["ngModel","model"],options:["ngModelOptions","options"]},outputs:{update:"ngModelChange"},exportAs:["ngModel"],features:[xl([oH]),jo,ye]}),t})(),cH=(()=>{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})(),uH=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({}),t})();const hH=new oi("NgModelWithFormControlWarning"),dH={provide:PU,useExisting:pt(()=>pH)};let pH=(()=>{class t extends PU{constructor(t,e,n,i){super(),this._ngModelWarningConfig=i,this.update=new Bc,this._ngModelWarningSent=!1,this._setValidators(t),this._setAsyncValidators(e),this.valueAccessor=UU(0,n)}set isDisabled(t){}ngOnChanges(t){if(this._isControlChanged(t)){const e=t.form.previousValue;e&&RU(e,this,!1),DU(this.form,this),this.control.disabled&&this.valueAccessor.setDisabledState&&this.valueAccessor.setDisabledState(!0),this.form.updateValueAndValidity({emitEvent:!1})}VU(t,this.viewModel)&&(this.form.setValue(this.model),this.viewModel=this.model)}ngOnDestroy(){this.form&&RU(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(hU,10),ea(dU,10),ea(aU,10),ea(hH,8))},t.\u0275dir=se({type:t,selectors:[["","formControl",""]],inputs:{isDisabled:["disabled","isDisabled"],form:["formControl","form"],model:["ngModel","model"]},outputs:{update:"ngModelChange"},exportAs:["ngForm"],features:[xl([dH]),jo,ye]}),t._ngModelWarningSentOnce=!1,t})();const fH={provide:kU,useExisting:pt(()=>gH)};let gH=(()=>{class t extends kU{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 Bc,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&&(jU(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 DU(e,t),e.updateValueAndValidity({emitEvent:!1}),this.directives.push(t),e}getControl(t){return this.form.get(t.path)}removeControl(t){RU(t.control||null,t,!1),HU(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,zU(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&&(RU(e||null,t),n instanceof tH&&(DU(n,t),t.control=n))}),this.form._updateTreeValidity({emitEvent:!1})}_setUpFormContainer(t){const e=this.form.get(t.path);BU(e,t),e.updateValueAndValidity({emitEvent:!1})}_cleanUpFormContainer(t){if(this.form){const e=this.form.get(t.path);e&&function(t,e){return jU(t,e)}(e,t)&&e.updateValueAndValidity({emitEvent:!1})}}_updateRegistrations(){this.form._registerOnCollectionChange(this._onCollectionChange),this._oldForm&&this._oldForm._registerOnCollectionChange(()=>{})}_updateValidators(){LU(this.form,this),this._oldForm&&jU(this._oldForm,this)}_checkFormPresent(){}}return t.\u0275fac=function(e){return new(e||t)(ea(hU,10),ea(dU,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:[xl([fH]),jo,ye]}),t})(),mH=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[uH]]}),t})(),bH=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[mH]}),t})(),yH=(()=>{class t{static withConfig(e){return{ngModule:t,providers:[{provide:hH,useValue:e.warnOnNgModelWithFormControl}]}}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[mH]}),t})();function vH(t){return new E(e=>{let n;try{n=t()}catch(i){return void e.error(i)}return(n?U(n):fp()).subscribe(e)})}const _H=["underline"],wH=["connectionContainer"],xH=["inputContainer"],SH=["label"];function CH(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 EH(t,e){1&t&&(ra(0,"div",19),xa(1,1),sa())}function OH(t,e){if(1&t&&(aa(0),xa(1,2),ra(2,"span"),Ja(3),sa(),la()),2&t){const t=va(2);ws(3),tl(t._control.placeholder)}}function TH(t,e){1&t&&xa(0,3,["*ngSwitchCase","true"])}function kH(t,e){1&t&&(ra(0,"span",23),Ja(1," *"),sa())}function PH(t,e){if(1&t){const t=ua();ra(0,"label",20,21),fa("cdkObserveContent",function(){return $e(t),va().updateOutlineGap()}),Jo(2,OH,4,1,"ng-container",12),Jo(3,TH,1,0,"ng-content",12),Jo(4,kH,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 AH(t,e){1&t&&(ra(0,"div",24),xa(1,4),sa())}function MH(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 IH(t,e){1&t&&(ra(0,"div"),xa(1,5),sa()),2&t&&na("@transitionMessages",va()._subscriptAnimationState)}function DH(t,e){if(1&t&&(ra(0,"div",31),Ja(1),sa()),2&t){const t=va(2);na("id",t._hintLabelId),ws(1),tl(t.hintLabel)}}function RH(t,e){if(1&t&&(ra(0,"div",28),Jo(1,DH,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 NH=["*",[["","matPrefix",""]],[["mat-placeholder"]],[["mat-label"]],[["","matSuffix",""]],[["mat-error"]],[["mat-hint",3,"align","end"]],[["mat-hint","align","end"]]],LH=["*","[matPrefix]","mat-placeholder","mat-label","[matSuffix]","mat-error","mat-hint:not([align='end'])","mat-hint[align='end']"],jH=new oi("MatError"),FH={transitionMessages:Qg("transitionMessages",[em("enter",tm({opacity:1,transform:"translateY(0%)"})),im("void => enter",[tm({opacity:0,transform:"translateY(-5px)"}),Zg("300ms cubic-bezier(0.55, 0, 0.55, 0.2)")])])};let BH=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275dir=se({type:t}),t})();const VH=new oi("MatHint");let zH=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275dir=se({type:t,selectors:[["mat-label"]]}),t})(),UH=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275dir=se({type:t,selectors:[["mat-placeholder"]]}),t})();const HH=new oi("MatPrefix");let $H=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275dir=se({type:t,selectors:[["","matPrefix",""]],features:[xl([{provide:HH,useExisting:t}])]}),t})();const GH=new oi("MatSuffix");let WH=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275dir=se({type:t,selectors:[["","matSuffix",""]],features:[xl([{provide:GH,useExisting:t}])]}),t})(),qH=0;const XH=Xy(class{constructor(t){this._elementRef=t}},"primary"),YH=new oi("MAT_FORM_FIELD_DEFAULT_OPTIONS"),KH=new oi("MatFormField");let QH=(()=>{class t extends XH{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 A,this._showAlwaysAnimate=!1,this._subscriptAnimationState="",this._hintLabel="",this._hintLabelId="mat-hint-"+qH++,this._labelId="mat-form-field-label-"+qH++,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=kd(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(lp(null)).subscribe(()=>{this._validatePlaceholders(),this._syncDescribedByIds(),this._changeDetectorRef.markForCheck()}),t.ngControl&&t.ngControl.valueChanges&&t.ngControl.valueChanges.pipe(rp(this._destroyed)).subscribe(()=>this._changeDetectorRef.markForCheck()),this._ngZone.runOutsideAngular(()=>{this._ngZone.onStable.pipe(rp(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(lp(null)).subscribe(()=>{this._processHints(),this._changeDetectorRef.markForCheck()}),this._errorChildren.changes.pipe(lp(null)).subscribe(()=>{this._syncDescribedByIds(),this._changeDetectorRef.markForCheck()}),this._dir&&this._dir.change.pipe(rp(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,Rd(this._label.nativeElement,"transitionend").pipe(rf(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:[[Wh,Wy,fg],Wy]}),t})();function JH(t,e=Yd){const n=function(t){return t instanceof Date&&!isNaN(+t)}(t)?+t-e.now():Math.abs(t);return t=>t.lift(new t$(n,e))}class t${constructor(t,e){this.delay=t,this.scheduler=e}call(t,e){return e.subscribe(new e$(t,this.delay,this.scheduler))}}class e$ 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(e$.dispatch,this.delay,{source:this,destination:this.destination,scheduler:t}))}scheduleNotification(t){if(!0===this.errored)return;const e=this.scheduler,n=new n$(e.now()+this.delay,t);this.queue.push(n),!1===this.active&&this._schedule(e)}_next(t){this.scheduleNotification(bp.createNext(t))}_error(t){this.errored=!0,this.queue=[],this.destination.error(t),this.unsubscribe()}_complete(){this.scheduleNotification(bp.createComplete()),this.unsubscribe()}}class n${constructor(t,e){this.time=t,this.notification=e}}const i$=["panel"];function r$(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 s$=["*"];let o$=0;class a${constructor(t,e){this.source=t,this.option=e}}const l$=Yy(class{}),c$=new oi("mat-autocomplete-default-options",{providedIn:"root",factory:function(){return{autoActiveFirstOption:!1}}});let u$=(()=>{class t extends l${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 Bc,this.opened=new Bc,this.closed=new Bc,this.optionActivated=new Bc,this._classList={},this.id="mat-autocomplete-"+o$++,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=kd(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 Eg(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 a$(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(nc),ea(Al),ea(c$),ea(Ep))},t.\u0275dir=se({type:t,viewQuery:function(t,e){if(1&t&&(Zc(ac,7),Zc(i$,5)),2&t){let t;Qc(t=tu())&&(e.template=t.first),Qc(t=tu())&&(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})(),h$=(()=>{class t extends u${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&&(Jc(n,bv,5),Jc(n,wv,5)),2&t){let t;Qc(t=tu())&&(e.optionGroups=t),Qc(t=tu())&&(e.options=t)}},hostAttrs:[1,"mat-autocomplete"],inputs:{disableRipple:"disableRipple"},exportAs:["matAutocomplete"],features:[xl([{provide:pv,useExisting:t}]),jo],ngContentSelectors:s$,decls:1,vars:0,consts:[["role","listbox",1,"mat-autocomplete-panel",3,"id","ngClass"],["panel",""]],template:function(t,e){1&t&&(wa(),Jo(0,r$,3,4,"ng-template"))},directives:[Oh],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 d$=new oi("mat-autocomplete-scroll-strategy"),p$={provide:d$,deps:[Vf],useFactory:function(t){return()=>t.scrollStrategies.reposition()}},f$={provide:aU,useExisting:pt(()=>m$),multi:!0};let g$=(()=>{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 A,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=vH(()=>this.autocomplete&&this.autocomplete.options?Q(...this.autocomplete.options.map(t=>t.onSelectionChange)):this._zone.onStable.pipe(rf(1),cp(()=>this.optionSelections))),this._scrollStrategy=s}get autocompleteDisabled(){return this._autocompleteDisabled}set autocompleteDisabled(t){this._autocompleteDisabled=kd(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(ep(()=>this._overlayAttached)),this._closeKeyEventStream,this._getOutsideClickStream(),this._overlayRef?this._overlayRef.detachments().pipe(ep(()=>this._overlayAttached)):Dd()).pipe(D(t=>t instanceof vv?t:null))}get activeOption(){return this.autocomplete&&this.autocomplete._keyManager?this.autocomplete._keyManager.activeItem:null}_getOutsideClickStream(){return Q(Rd(this._document,"click"),Rd(this._document,"auxclick"),Rd(this._document,"touchend")).pipe(ep(t=>{const e=Lp(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&&!uf(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(rf(1)),this.autocomplete.options.changes.pipe(eg(()=>this._positionStrategy.reapplyLastPosition()),JH(0))).pipe(cp(()=>{const t=this.panelOpen;return this._resetActiveItem(),this.autocomplete._setVisibility(),this.panelOpen&&(this._overlayRef.updatePosition(),t!==this.panelOpen&&this.autocomplete.opened.emit()),this.panelClosingActions}),rf(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 Xp(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&&!uf(t)||38===t.keyCode&&uf(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 vf({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=xv(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=Sv(t.offsetTop,t.offsetHeight,e._getScrollTop(),e.panel.nativeElement.offsetHeight);e._setScrollTop(i)}}}}return t.\u0275fac=function(e){return new(e||t)(ea(Al),ea(Vf),ea(pc),ea(Tu),ea(nc),ea(d$),ea(Fp,8),ea(KH,9),ea(th,8),ea(Hp),ea(c$,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})(),m$=(()=>{class t extends g${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:[xl([f$]),jo]}),t})(),b$=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({providers:[p$],imports:[[Wf,Cv,Wy,Wh],$p,Cv,Wy]}),t})();const y$=Ip({passive:!0});let v$=(()=>{class t{constructor(t,e){this._platform=t,this._ngZone=e,this._monitoredElements=new Map}monitor(t){if(!this._platform.isBrowser)return pp;const e=Id(t),n=this._monitoredElements.get(e);if(n)return n.subject;const i=new A,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,y$),e.classList.add("cdk-text-field-autofill-monitored")}),this._monitoredElements.set(e,{subject:i,unlisten:()=>{e.removeEventListener("animationstart",s,y$)}}),i}stopMonitoring(t){const e=Id(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)(Ei(Ep),Ei(Tu))},t.\u0275prov=xt({factory:function(){return new t(Ei(Ep),Ei(Tu))},token:t,providedIn:"root"}),t})(),_$=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Op]]}),t})();const w$=new oi("MAT_INPUT_VALUE_ACCESSOR"),x$=["button","checkbox","file","hidden","image","radio","range","reset","submit"];let S$=0;const C$=Qy(class{constructor(t,e,n,i){this._defaultErrorStateMatcher=t,this._parentForm=e,this._parentFormGroup=n,this.ngControl=i}});let E$=(()=>{class t extends C${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-"+S$++,this.focused=!1,this.stateChanges=new A,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=>kp().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=kd(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=kd(t)}get type(){return this._type}set type(t){this._type=t||"text",this._validateType(),!this._isTextarea&&kp().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=kd(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(){x$.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(Al),ea(Ep),ea(PU,10),ea(sH,8),ea(gH,8),ea(Zy),ea(w$,10),ea(v$),ea(Tu),ea(KH,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&&(rl("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:[xl([{provide:BH,useExisting:t}]),jo,ye]}),t})(),O$=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({providers:[Zy],imports:[[_$,ZH,Wy],_$,ZH]}),t})();function T$(...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;rF$),multi:!0};class L${}const j$=Ky(Xy(qy(class{constructor(t){this._elementRef=t}}),"accent"));let F$=(()=>{class t extends j${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 Bc,this.input=new Bc,this.valueChange=new Bc,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||!B$(t)&&0!==t.button||this._ngZone.run(()=>{this._touchId=B$(t)?function(t,e){for(let n=0;n{if("pointer"===this._isSliding){const e=V$(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&&(!B$(t)||"number"!=typeof this._touchId||z$(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,R$),e.addEventListener("touchstart",this._pointerDown,R$)})}get invert(){return this._invert}set invert(t){this._invert=kd(t)}get max(){return this._max}set max(t){this._max=Pd(t,this._max),this._percent=this._calculatePercentage(this._value),this._changeDetectorRef.markForCheck()}get min(){return this._min}set min(t){this._min=Pd(t,this._min),this._percent=this._calculatePercentage(this._value),this._changeDetectorRef.markForCheck()}get step(){return this._step}set step(t){this._step=Pd(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=kd(t)}get tickInterval(){return this._tickInterval}set tickInterval(t){this._tickInterval="auto"===t?"auto":"number"==typeof t||"string"==typeof t?Pd(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=Pd(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=kd(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,R$),t.removeEventListener("touchstart",this._pointerDown,R$),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||uf(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=B$(t),i=n?"touchend":"mouseup";e.addEventListener(n?"touchmove":"mousemove",this._pointerMove,R$),e.addEventListener(i,this._pointerUp,R$),n&&e.addEventListener("touchcancel",this._pointerUp,R$);const r=this._getWindow();void 0!==r&&r&&r.addEventListener("blur",this._windowBlur)}_removeGlobalEvents(){const t=this._document;t.removeEventListener("mousemove",this._pointerMove,R$),t.removeEventListener("mouseup",this._pointerUp,R$),t.removeEventListener("touchmove",this._pointerMove,R$),t.removeEventListener("touchend",this._pointerUp,R$),t.removeEventListener("touchcancel",this._pointerUp,R$);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 L$;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(Al),ea(Ug),ea(nc),ea(Fp,8),ii("tabindex"),ea(Tu),ea(th),ea(Ny,8))},t.\u0275cmp=Jt({type:t,selectors:[["mat-slider"]],viewQuery:function(t,e){if(1&t&&Zc(D$,5),2&t){let t;Qc(t=tu())&&(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&&(rl("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:[xl([N$]),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),Ja(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),tl(e.displayValue))},directives:[jh],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 B$(t){return"t"===t.type[0]}function V$(t,e){let n;return n=B$(t)?"number"==typeof e?z$(t.touches,e)||z$(t.changedTouches,e):t.touches[0]||t.changedTouches[0]:t,n?{x:n.clientX,y:n.clientY}:void 0}function z$(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:[[Wh,Wy],Wy]}),t})();function H$(t,e){}class $${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 G$={dialogContainer:Qg("dialogContainer",[em("void, exit",tm({opacity:0,transform:"scale(0.7)"})),em("enter",tm({transform:"none"})),im("* => enter",Zg("150ms cubic-bezier(0, 0, 0.2, 1)",tm({transform:"none",opacity:1}))),im("* => void, * => exit",Zg("75ms cubic-bezier(0.4, 0.0, 0.2, 1)",tm({opacity:0})))])};let W$=(()=>{class t extends Kp{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 Bc,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=Np(),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=Np())}_focusDialogContainer(){this._elementRef.nativeElement.focus&&this._elementRef.nativeElement.focus()}_containsFocus(){const t=this._elementRef.nativeElement,e=Np();return t===e||t.contains(e)}}return t.\u0275fac=function(e){return new(e||t)(ea(Al),ea(Ag),ea(nc),ea(th,8),ea($$),ea(Ug))},t.\u0275dir=se({type:t,viewQuery:function(t,e){if(1&t&&Zc(tf,7),2&t){let t;Qc(t=tu())&&(e._portalOutlet=t.first)}},features:[jo]}),t})(),q$=(()=>{class t extends W${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&&(rl("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),sl("@dialogContainer",e._state))},features:[jo],decls:1,vars:0,consts:[["cdkPortalOutlet",""]],template:function(t,e){1&t&&Jo(0,H$,0,0,"ng-template",0)},directives:[tf],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:[G$.dialogContainer]}}),t})(),X$=0;class Y${constructor(t,e,n="mat-dialog-"+X$++){this._overlayRef=t,this._containerInstance=e,this.id=n,this.disableClose=this._containerInstance._config.disableClose,this._afterOpened=new A,this._afterClosed=new A,this._beforeClosed=new A,this._state=0,e._id=n,e._animationStateChanged.pipe(ep(t=>"opened"===t.state),rf(1)).subscribe(()=>{this._afterOpened.next(),this._afterOpened.complete()}),e._animationStateChanged.pipe(ep(t=>"closed"===t.state),rf(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(ep(t=>27===t.keyCode&&!this.disableClose&&!uf(t))).subscribe(t=>{t.preventDefault(),K$(this,"keyboard")}),t.backdropClick().subscribe(()=>{this.disableClose?this._containerInstance._recaptureFocus():K$(this,"mouse")})}close(t){this._result=t,this._containerInstance._animationStateChanged.pipe(ep(t=>"closing"===t.state),rf(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 K$(t,e,n){return void 0!==t._containerInstance&&(t._containerInstance._closeInteractionType=e),t.close(n)}const Q$=new oi("MatDialogData"),Z$=new oi("mat-dialog-default-options"),J$=new oi("mat-dialog-scroll-strategy"),tG={provide:J$,deps:[Vf],useFactory:function(t){return()=>t.scrollStrategies.block()}};let eG=(()=>{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 A,this._afterOpenedAtThisLevel=new A,this._ariaHiddenElements=new Map,this.afterAllClosed=vH(()=>this.openDialogs.length?this._getAfterAllClosed():this._getAfterAllClosed().pipe(lp(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 $$)).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 vf({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:$$,useValue:e}]}),i=new qp(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 ac)e.attachTemplatePortal(new Xp(t,null,{$implicit:i.data,dialogRef:r}));else{const n=this._createInjector(i,r,e),s=e.attachComponentPortal(new qp(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(Fp,null,Mt.Optional))&&r.push({provide:Fp,useValue:{value:t.direction,change:Dd()}}),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(Vf),ea(No),ea(void 0),ea(void 0),ea(Tf),ea(void 0),ea(ai),ea(ai),ea(oi))},t.\u0275dir=se({type:t}),t})(),nG=(()=>{class t extends eG{constructor(t,e,n,i,r,s,o){super(t,e,i,s,o,r,Y$,q$,Q$)}}return t.\u0275fac=function(e){return new(e||t)(Ei(Vf),Ei(No),Ei(ph,8),Ei(Z$,8),Ei(J$),Ei(t,12),Ei(Tf))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),iG=0,rG=(()=>{class t{constructor(t,e,n){this._dialogRef=t,this._elementRef=e,this._dialog=n,this.id="mat-dialog-title-"+iG++}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(Y$,8),ea(Al),ea(nG))},t.\u0275dir=se({type:t,selectors:[["","mat-dialog-title",""],["","matDialogTitle",""]],hostAttrs:[1,"mat-dialog-title"],hostVars:1,hostBindings:function(t,e){2&t&&rl("id",e.id)},inputs:{id:"id"},exportAs:["matDialogTitle"]}),t})(),sG=(()=>{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 oG=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({providers:[nG,tG],imports:[[Wf,ef,Wy],Wy]}),t})();const aG=new oi("CdkAccordion");let lG=0,cG=(()=>{class t{constructor(t,e,n){this.accordion=t,this._changeDetectorRef=e,this._expansionDispatcher=n,this._openCloseAllSubscription=g.EMPTY,this.closed=new Bc,this.opened=new Bc,this.destroyed=new Bc,this.expandedChange=new Bc,this.id="cdk-accordion-child-"+lG++,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=kd(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=kd(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(aG,12),ea(nc),ea(zp))},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:[xl([{provide:aG,useValue:void 0}])]}),t})(),uG=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({}),t})();const hG=["body"];function dG(t,e){}const pG=[[["mat-expansion-panel-header"]],"*",[["mat-action-row"]]],fG=["mat-expansion-panel-header","*","mat-action-row"];function gG(t,e){1&t&&oa(0,"span",2),2&t&&na("@indicatorRotate",va()._getExpandedState())}const mG=[[["mat-panel-title"]],[["mat-panel-description"]],"*"],bG=["mat-panel-title","mat-panel-description","*"],yG=new oi("MAT_ACCORDION"),vG="225ms cubic-bezier(0.4,0.0,0.2,1)",_G={indicatorRotate:Qg("indicatorRotate",[em("collapsed, void",tm({transform:"rotate(0deg)"})),em("expanded",tm({transform:"rotate(180deg)"})),im("expanded <=> collapsed, void => collapsed",Zg(vG))]),bodyExpansion:Qg("bodyExpansion",[em("collapsed, void",tm({height:"0px",visibility:"hidden"})),em("expanded",tm({height:"*",visibility:"visible"})),im("expanded <=> collapsed, void => collapsed",Zg(vG))])};let wG=(()=>{class t{constructor(t){this._template=t}}return t.\u0275fac=function(e){return new(e||t)(ea(ac))},t.\u0275dir=se({type:t,selectors:[["ng-template","matExpansionPanelContent",""]]}),t})(),xG=0;const SG=new oi("MAT_EXPANSION_PANEL_DEFAULT_OPTIONS");let CG=(()=>{class t extends cG{constructor(t,e,n,i,r,s,o){super(t,e,n),this._viewContainerRef=i,this._animationMode=s,this._hideToggle=!1,this.afterExpand=new Bc,this.afterCollapse=new Bc,this._inputChanges=new A,this._headerId="mat-expansion-panel-header-"+xG++,this._bodyAnimationDone=new A,this.accordion=t,this._document=r,this._bodyAnimationDone.pipe(Wd((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=kd(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(lp(null),ep(()=>this.expanded&&!this._portal),rf(1)).subscribe(()=>{this._portal=new Xp(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(yG,12),ea(nc),ea(zp),ea(pc),ea(th),ea(Ny,8),ea(SG,8))},t.\u0275cmp=Jt({type:t,selectors:[["mat-expansion-panel"]],contentQueries:function(t,e,n){if(1&t&&Jc(n,wG,5),2&t){let t;Qc(t=tu())&&(e._lazyContent=t.first)}},viewQuery:function(t,e){if(1&t&&Zc(hG,5),2&t){let t;Qc(t=tu())&&(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:[xl([{provide:yG,useValue:void 0}]),jo,ye],ngContentSelectors:fG,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(pG),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,dG,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:[tf],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:[_G.bodyExpansion]},changeDetection:0}),t})();class EG{}const OG=Ky(EG);let TG=(()=>{class t extends OG{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(ep(t=>!(!t.hideToggle&&!t.togglePosition))):pp;this.tabIndex=parseInt(o||"")||0,this._parentChangeSubscription=Q(t.opened,t.closed,a,t._inputChanges.pipe(ep(t=>!!(t.hideToggle||t.disabled||t.togglePosition)))).subscribe(()=>this._changeDetectorRef.markForCheck()),t.closed.pipe(ep(()=>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:uf(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(CG,1),ea(Al),ea(Ug),ea(nc),ea(SG,8),ea(Ny,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:bG,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(mG),ra(0,"span",0),xa(1),xa(2,1),xa(3,2),sa(),Jo(4,gG,1,1,"span",1)),2&t&&(ws(4),na("ngIf",e._showToggle()))},directives:[Ah],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:[_G.indicatorRotate]},changeDetection:0}),t})(),kG=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Wh,Wy,uG,ef]]}),t})();var PG=n(5478);Object.create(Error.prototype);const AG=["*"];var MG=(()=>(function(t){t.LineHighlight="line-highlight",t.LineNumbers="line-numbers"}(MG||(MG={})),MG))();class IG{}const DG=new oi("SECURITY_CONTEXT");let RG=(()=>{class t{constructor(t,e,n,i,r){this.platform=t,this.securityContext=e,this.http=n,this.sanitizer=r,this.initialMarkedOptions={renderer:new PG.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=PG.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(Xh(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(!Xh(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(!Xh(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(!Xh(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)(Ei(hu),Ei(DG),Ei(Jv,8),Ei(IG,8),Ei(Sd))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),NG=(()=>{class t{constructor(t,e){this.element=t,this.markdownService=e,this.error=new Bc,this.load=new Bc,this.ready=new Bc,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,MG.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:[RG,e&&e.loader||[],e&&e.markedOptions||[],{provide:DG,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 jG(t,e,n){return n?jG(t,e).pipe(D(t=>d(t)?n(...t):n(t))):new E(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 FG(...t){return e=>{let n;return"function"==typeof t[t.length-1]&&(n=t.pop()),e.lift(new BG(t,n))}}class BG{constructor(t,e){this.observables=t,this.project=e}call(t,e){return e.subscribe(new VG(t,this.observables,this.project))}}class VG extends j_{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 zG{constructor(t,e,n=!1){this.accumulator=t,this.seed=e,this.hasSeed=n}call(t,e){return e.subscribe(new UG(t,this.accumulator,this.seed,this.hasSeed))}}class UG 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 HG{constructor(t){this.predicate=t}call(t,e){return e.subscribe(new $G(t,this.predicate))}}class $G 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 GG=["youtubeContainer"];let WG=(()=>{class t{constructor(t,e){this._ngZone=t,this._youtubeContainer=new A,this._destroyed=new A,this._playerChanges=new Jf(void 0),this._videoId=new Jf(void 0),this._height=new Jf(390),this._width=new Jf(640),this._startSeconds=new Jf(void 0),this._endSeconds=new Jf(void 0),this._suggestedQuality=new Jf(void 0),this._playerVars=new Jf(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=Xh(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=Dd(!0);if(!window.YT||!window.YT.Player){const e=new A;this._existingApiReadyCallback=window.onYouTubeIframeAPIReady,window.onYouTubeIframeAPIReady=()=>{this._existingApiReadyCallback&&this._existingApiReadyCallback(),this._ngZone.run(()=>e.next(!0))},t=e.pipe(rf(1),lp(!1))}const e=function(t,e,n,i,r,s,o){const a=z_([e,s]).pipe(FG(z_([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 z_([t,a,Dd(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 U_(e))}(t),function(t){return e=>e.lift(new HG(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 zG(t,e,n))}}(qG,void 0),Wd())}(this._youtubeContainer,this._videoId,t,this._width,this._height,this._playerVars,this._ngZone).pipe(eg(t=>{this._playerChanges.next(t)}),W(t=>t?XG(t)?Dd(t):new E(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=>{XG(t)||t.destroy()})(t)}}).pipe(rf(1),lp(void 0)):Dd(void 0)),rp(this._destroyed),rt(new A));e.subscribe(t=>{this._player=t,t&&this._pendingPlayerState&&this._initializePlayer(t,this._pendingPlayerState),this._pendingPlayerState=void 0}),function(t,e,n){z_([t,e,n]).subscribe(([t,e,n])=>t&&t.setSize(e,n))}(e,this._width,this._height),function(t,e){z_([t,e]).subscribe(([t,e])=>t&&e&&t.setPlaybackQuality(e))}(e,this._suggestedQuality),function(t,e,n,i,r,s){const o=z_([n,i]).pipe(D(([t,e])=>({startSeconds:t,endSeconds:e}))),a=o.pipe(YG(t,t=>!!t&&!function(t){const e=t.getPlayerState();return e!==YT.PlayerState.UNSTARTED&&e!==YT.PlayerState.CUED}(t))),l=e.pipe(YG(t,(t,e)=>!!t&&t.videoId!==e));Q(t.pipe(YG(z_([e,o]),([t,e],n)=>!(!n||t==n.videoId&&!e.startSeconds&&!e.endSeconds))),l,a).pipe(FG(z_([t,e,o,r])),D(([t,e])=>e),rp(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(cp(e=>e?jG(n=>{e.addEventListener(t,n)},n=>{try{e.removeEventListener&&e.removeEventListener(t,n)}catch(i){}}):Dd()),t=>new E(e=>t.subscribe({next:t=>this._ngZone.run(()=>e.next(t)),error:t=>e.error(t),complete:()=>e.complete()})),rp(this._destroyed))}}return t.\u0275fac=function(e){return new(e||t)(ea(Tu),ea(hu))},t.\u0275cmp=Jt({type:t,selectors:[["youtube-player"]],viewQuery:function(t,e){if(1&t&&Zc(GG,5),2&t){let t;Qc(t=tu())&&(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 qG(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 XG(t){return"getPlayerStatus"in t}function YG(t,e){return S(FG(t),ep(([t,n])=>e(n,t)),D(([t])=>t))}let KG=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({}),t})(),QG=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275dir=se({type:t,selectors:[["","mat-card-sm-image",""],["","matCardImageSmall",""]],hostAttrs:[1,"mat-card-sm-image"]}),t})();function ZG(t){return!0===t}function JG(t){return null==t}function tW(t){return!JG(t)}function eW(t){return Boolean(t)}function nW(t){return JG(t)?t:JSON.parse(JSON.stringify(t))}const iW=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])&&iW(t[e])}),t};function rW(t){return tW(t)&&"object"==typeof t&&function(t){return"[object Object]"===Object.prototype.toString.call(t)}(t)}const sW="NGXS_DATA_META",oW="NGXS_META",aW="NGXS_ARGUMENT_REGISTRY_META";let lW=(()=>{class t{constructor(t){this.sequence$=new Jf(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)(Ei(qz,8))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();function cW(t){return t[sW]}let uW=(()=>{class t{constructor(e,n,i){t.store=e.get(qz),t.ngZone=e.get(Tu),t.factory=n,t.context=i,t.computed=e.get(lW)}}return t.store=null,t.computed=null,t.context=null,t.factory=null,t.ngZone=null,t.\u0275fac=function(e){return new(e||t)(Ei(No),Ei(XV),Ei(qV))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();class hW{constructor(){hW.statesCachedMeta.clear()}static createStateContext(t){return uW.context.createStateContext(t)}static ensureMappedState(t){if(JG(uW.factory)||JG(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(tW(t.name)?hW.statesCachedMeta.get(t.name):null)||hW.ensureMeta(t)}static getRepositoryByInstance(t){var e;const n=null!==(e=cW(hW.getStateClassByInstance(t)))&&void 0!==e?e:null;if(JG(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=hW.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=hW.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=tW(t.name)?null===(e=uW.factory.states)||void 0===e?void 0:e.find(e=>e.name===t.name):null;return tW(n)&&tW(t.name)&&hW.statesCachedMeta.set(t.name,n),n}}hW.statesCachedMeta=new Map,hW.\u0275fac=function(t){return new(t||hW)},hW.\u0275prov=xt({token:hW,factory:hW.\u0275fac}),new _p(1);class dW extends Error{constructor(t){super(`Child states can only be added to an object. Cannot convert ${tW(null==t?void 0:t.constructor)?t.constructor.name:t} to PlainObject`)}}function pW(t){var e;return null!==(e=t.NGXS_OPTIONS_META)&&void 0!==e?e:{name:""}}function fW(t){var e;const n=pW(t),i=null!==(e=n.children)&&void 0!==e?e:[],r=nW(void 0===n.defaults?{}:n.defaults);if(i.length){if(rW(r))return function(t,e){return e.reduce((t,e)=>{const n=pW(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()]=fW(e),t},null!=t?t:{})}(r,i);throw new dW(r)}return r}function gW(t){var e;return null!==(e=t.__NGXS_COMPUTED_OPTION__)&&void 0!==e?e:null}function mW(){var t,e;return null!==(e=null===(t=null==uW?void 0:uW.computed)||void 0===t?void 0:t.sequenceValue)&&void 0!==e?e:0}function bW(t){let e=!1;return Gd(t)&&(e=!0),e}function yW(t){return t[aW]}class vW extends Error{constructor(t,e){super(`An argument with the name '${t}' already exists in the method '${e}'`)}}class _W{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(eW(this.argumentMap.has(t))||eW(this.payloadMap.has(t)))throw new vW(t,e)}}function wW(t){return Vu()?iW(t):t}function xW(t){return{enumerable:!0,configurable:!0,get(){const e=cW(t),n=hW.ensureMappedState(e.stateMeta);return hW.createStateContext(n)}}}function SW(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:()=>Vu()?iW(t.getState()):t.getState(),setState(e){t.setState(e)},patchState(e){t.patchState(e)}})}function CW(){return(t,e,n)=>{!function(t,e){if(!function(t,e){var n;let i=t,r=!1;if(rW(i))for(;null!==i;){if(ZG(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 JG(gW(t))&&Object.defineProperties(t,{__NGXS_COMPUTED_OPTION__:{enumerable:!0,configurable:!0,value:new WeakMap}}),gW(t)}(this),n=null==e?void 0:e.get(i);if(ZG(null==n?void 0:n.isObservable))return null==n?void 0:n.value;if(JG(n)||n.sequenceId!==mW()){e.delete(i);const n=i.apply(this,t);return e.set(i,{value:n,sequenceId:mW(),isObservable:bW(n)}),n}return n.value},n}}const EW={cancelUncompleted:!0,insideZone:!1};function OW(t=EW){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=hW.getRepositoryByInstance(n),a=o.operations;let l=a[s];const c=o.stateMeta,u=yW(r);if(JG(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 ZG(t.insideZone)?null===(s=uW.ngZone)||void 0===s||s.run(()=>{i=r.apply(n,e)}):i=r.apply(n,e),Gd(i)?Dd(null).pipe(D(()=>i)):i};const h=hW.createAction(l,e,u),d=uW.store.dispatch(h);return Gd(i)?function(t,e){return Ev([t,e]).pipe(D(t=>t.pop()))}(d,i):i},i}}function TW(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 JG(yW(n))&&Object.defineProperties(n,{[aW]:{enumerable:!0,configurable:!0,value:new _W}}),yW(n)})(e,n).createPayloadType(r,n,i)}}function kW(){return t=>{const e=function(t){if(function(t){return!eW(t)}(t.hasOwnProperty(oW))){const e={name:null,actions:{},defaults:{},path:null,makeRootSelector:t=>t.getStateGetter(e.name),children:[]};Object.defineProperty(t,oW,{value:e})}return function(t){var e;return null===(e=t)||void 0===e?void 0:e[oW]}(t)}(t);if(JG(e.name))throw new Error("@StateRepository should be add before decorator @State");!function(t,e){(function(t){var e;const n=null!==(e=cW(t))&&void 0!==e?e:null;return(JG(n)||(null==n?void 0:n.stateClass)!==t)&&function(t){Object.defineProperty(t,sW,{writable:!0,configurable:!0,enumerable:!0,value:{stateMeta:null,operations:{},stateClass:t}})}(t),cW(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:()=>nW(n)},context:xW(t)})}(t,e,fW(t)),function(t){var e,n;const i=cW(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(tW(r)){const e=`__${r}__selector`;Object.defineProperties(t.prototype,{[e]:{writable:!0,enumerable:!1,configurable:!0},state$:{enumerable:!0,configurable:!0,get(){if(tW(this[e]))return this[e];if(JG(uW.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]=uW.store.select(t).pipe(D(t=>Vu()?iW(t):t),xp({refCount:!0,bufferSize:1})),this[e]}}})}}(t)}}let PW=(()=>{class t{constructor(){this.browserStorageEvents$=new A,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})(),AW=(()=>{class t extends PW{get snapshot(){return wW(this.getState())}get ctx(){return SW(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}),vw([CW(),ww("design:type",Object),ww("design:paramtypes",[])],t.prototype,"snapshot",null),vw([OW(),_w(0,TW("patchValue")),ww("design:type",Function),ww("design:paramtypes",[Object]),ww("design:returntype",void 0)],t.prototype,"patchState",null),vw([OW(),_w(0,TW("stateValue")),ww("design:type",Function),ww("design:paramtypes",[Object]),ww("design:returntype",void 0)],t.prototype,"setState",null),vw([OW(),ww("design:type",Function),ww("design:paramtypes",[]),ww("design:returntype",void 0)],t.prototype,"reset",null),t})(),MW=(()=>{class t extends PW{get snapshot(){return wW(this.getState())}get ctx(){return SW(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}),vw([CW(),ww("design:type",Object),ww("design:paramtypes",[])],t.prototype,"snapshot",null),vw([OW(),_w(0,TW("patchValue")),ww("design:type",Function),ww("design:paramtypes",[Object]),ww("design:returntype",void 0)],t.prototype,"patchState",null),vw([OW(),_w(0,TW("stateValue")),ww("design:type",Function),ww("design:paramtypes",[Object]),ww("design:returntype",void 0)],t.prototype,"setState",null),vw([OW(),ww("design:type",Function),ww("design:paramtypes",[]),ww("design:returntype",void 0)],t.prototype,"reset",null),t})();function IW(){return ep(t=>null!=t)}const DW=new oi("ngx-google-analytics-settings",{factory:()=>({trackingCode:"",enableTracing:!1})}),RW=new oi("ngx-window",{providedIn:"root",factory:()=>function(t){return Xh(t)?window:null}(Oi(hu))}),NW=new oi("ngx-data-layer",{providedIn:"root",factory:()=>function(t){return t?t.dataLayer=t.dataLayer||[]:null}(Oi(RW))}),LW=new oi("ngx-gtag-fn",{providedIn:"root",factory:()=>function(t,e){return t?t.gtag=t.gtag||function(){e.push(arguments)}:null}(Oi(RW),Oi(NW))});let jW=(()=>{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||Vu())&&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)(Ei(DW),Ei(th),Ei(LW))},t.\u0275prov=xt({factory:function(){return new t(Ei(DW),Ei(th),Ei(LW))},token:t,providedIn:"root"}),t})();const FW={provide:su,multi:!0,useFactory:function(t,e,n){return()=>xw(this,void 0,void 0,function*(){var i;if(!t.trackingCode)return void(Vu()||console.error("Empty tracking code for Google Analytics. Make sure to provide one when initializing NgxGoogleAnalyticsModule."));if(!e)return void(Vu()||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||Vu()||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:[DW,LW,th]};new oi("ngx-google-analytics-routing-settings",{factory:()=>({})});let BW=(()=>{class t{static forRoot(e,n=[],i,r,s){return{ngModule:t,providers:[{provide:DW,useValue:{trackingCode:e,initCommands:n,uri:i,enableTracing:r,nonce:s}},FW]}}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[]]}),t})(),VW=(()=>{class t{constructor(){this.consent="not-set",this.consentChange=new _p(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})(),zW=(()=>{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)(Ei(VW),Ei(RW),Ei(DW))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();const UW=new oi("Key under which consent is stored",{providedIn:"root",factory:()=>"ALLOW_TELEMETRY"}),HW=[VW,zW,(()=>{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)(Ei(VW),Ei(UW))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})()];function $W(t){return Object.entries(t).reduce((t,[e,n])=>(null!=n&&(t[e]=`${n}`),t),{})}let GW=(()=>{class t{static forRoot(e){const{providers:n=[]}=BW.forRoot(e.gaToken,function(t){const{appName:e,projectName:n,developmentMode:i}=t;return[{command:"set",values:[$W({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:[...HW,{provide:su,multi:!0,useFactory:()=>()=>{},deps:HW}],imports:[[BW]]}),t})();function WW(t,e,n,i){n&&"function"!=typeof n&&(i=n);const r="function"==typeof n?n:void 0,s=new _p(t,e,i);return t=>rt(()=>s,r)(t)}const qW=(t,e)=>JSON.stringify(t)===JSON.stringify(e),XW=t=>t.map(t=>void 0!==t?JSON.parse(JSON.stringify(t)):t),YW={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},KW=new A;function QW(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 YW.storageStrategy;const n=[];t.cacheModifier&&t.cacheModifier.subscribe(t=>e.addMany(t(e.getAll(r,this)),r,this)),Q(KW.asObservable(),t.cacheBusterObserver?t.cacheBusterObserver:fp()).subscribe(t=>{e.removeAll(r,this),n.length=0}),t.cacheResolver=t.cacheResolver||YW.cacheResolver||qW,t.cacheHasher=t.cacheHasher||YW.cacheHasher||XW,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||YW.maxAge)&&l&&l.created&&((new Date).getTime()-new Date(l.created).getTime()>(t.maxAge||YW.maxAge)?(e.remove?e.remove(o.indexOf(l),l,r,this):e.removeAtIndex(o.indexOf(l),r,this),l=null):(t.slidingExpiration||YW.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=Dd(l.response);return t.async?e.pipe(JH(0)):e}if(c)return c.response;{const l=s.call(this,...i).pipe(Av(()=>{const e=n.find(e=>t.cacheResolver(e.parameters,a));n.splice(n.indexOf(e),1)}),eg(n=>{(!t.shouldCacheDecider||t.shouldCacheDecider(n))&&((!(t.maxCacheCount||YW.maxCacheCount)||1===(t.maxCacheCount||YW.maxCacheCount)||(t.maxCacheCount||YW.maxCacheCount)&&(t.maxCacheCount||YW.maxCacheCount)this.isJsonMime(t));return void 0===e?t[0]:e}selectHeaderAccept(t){if(0===t.length)return;const e=t.find(t=>this.isJsonMime(t));return void 0===e?t[0]:e}isJsonMime(t){const e=new RegExp("^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$","i");return null!==t&&(e.test(t)||"application/json-patch+json"===t.toLowerCase())}lookupCredential(t){const e=this.credentials[t];return"function"==typeof e?e():e}}let eq=(()=>{class t{constructor(t,e,n){this.httpClient=t,this.basePath="/v1",this.defaultHeaders=new Nv,this.configuration=new tq,n&&(this.configuration=n),"string"!=typeof this.configuration.basePath&&("string"!=typeof e&&(e=this.basePath),this.configuration.basePath=e),this.encoder=this.configuration.encoder||new ZW}addToHttpParams(t,e,n){return this.addToHttpParamsRecursive(t,e,n)}addToHttpParamsRecursive(t,e,n){if(null==e)return t;if("object"==typeof e)if(Array.isArray(e))e.forEach(e=>t=this.addToHttpParamsRecursive(t,e,n));else if(e instanceof Date){if(null==n)throw Error("key may not be null if value is Date");t=t.append(n,e.toISOString().substr(0,10))}else Object.keys(e).forEach(i=>t=this.addToHttpParamsRecursive(t,e[i],null!=n?`${n}.${i}`:i));else{if(null==n)throw Error("key may not be null if value is not object or array");t=t.append(n,e)}return t}aggregateResults(t,e="body",n=!1,i){const r=t.age,s=t.ageRange,o=t.bmi,a=t.bmiRange,l=t.cache,c=t.ontologyTerms,u=t.cellTypeTerms,h=t.providers,d=t.sex,p=t.spatial,f=t.technologies,g=t.token;let m=new zv({encoder:this.encoder});null!=r&&(m=this.addToHttpParams(m,r,"age")),null!=s&&(m=this.addToHttpParams(m,s,"age-range")),null!=o&&(m=this.addToHttpParams(m,o,"bmi")),null!=a&&(m=this.addToHttpParams(m,a,"bmi-range")),null!=l&&(m=this.addToHttpParams(m,l,"cache")),c&&c.forEach(t=>{m=this.addToHttpParams(m,t,"ontology-terms")}),u&&u.forEach(t=>{m=this.addToHttpParams(m,t,"cell-type-terms")}),h&&h.forEach(t=>{m=this.addToHttpParams(m,t,"providers")}),null!=d&&(m=this.addToHttpParams(m,d,"sex")),p&&p.forEach(t=>{m=this.addToHttpParams(m,t,"spatial")}),f&&f.forEach(t=>{m=this.addToHttpParams(m,t,"technologies")}),null!=g&&(m=this.addToHttpParams(m,g,"token"));let b=this.defaultHeaders,y=i&&i.httpHeaderAccept;void 0===y&&(y=this.configuration.selectHeaderAccept(["application/json"])),void 0!==y&&(b=b.set("Accept",y));let v=i&&i.context;void 0===v&&(v=new Uv);let _="json";return y&&(_=y.startsWith("text")?"text":this.configuration.isJsonMime(y)?"json":"blob"),this.httpClient.get(`${this.configuration.basePath}/aggregate-results`,{context:v,params:m,responseType:_,withCredentials:this.configuration.withCredentials,headers:b,observe:e,reportProgress:n})}cellTypeTermOccurences(t,e="body",n=!1,i){const r=t.age,s=t.ageRange,o=t.bmi,a=t.bmiRange,l=t.cache,c=t.ontologyTerms,u=t.cellTypeTerms,h=t.providers,d=t.sex,p=t.spatial,f=t.technologies,g=t.token;let m=new zv({encoder:this.encoder});null!=r&&(m=this.addToHttpParams(m,r,"age")),null!=s&&(m=this.addToHttpParams(m,s,"age-range")),null!=o&&(m=this.addToHttpParams(m,o,"bmi")),null!=a&&(m=this.addToHttpParams(m,a,"bmi-range")),null!=l&&(m=this.addToHttpParams(m,l,"cache")),c&&c.forEach(t=>{m=this.addToHttpParams(m,t,"ontology-terms")}),u&&u.forEach(t=>{m=this.addToHttpParams(m,t,"cell-type-terms")}),h&&h.forEach(t=>{m=this.addToHttpParams(m,t,"providers")}),null!=d&&(m=this.addToHttpParams(m,d,"sex")),p&&p.forEach(t=>{m=this.addToHttpParams(m,t,"spatial")}),f&&f.forEach(t=>{m=this.addToHttpParams(m,t,"technologies")}),null!=g&&(m=this.addToHttpParams(m,g,"token"));let b=this.defaultHeaders,y=i&&i.httpHeaderAccept;void 0===y&&(y=this.configuration.selectHeaderAccept(["application/json"])),void 0!==y&&(b=b.set("Accept",y));let v=i&&i.context;void 0===v&&(v=new Uv);let _="json";return y&&(_=y.startsWith("text")?"text":this.configuration.isJsonMime(y)?"json":"blob"),this.httpClient.get(`${this.configuration.basePath}/cell-type-term-occurences`,{context:v,params:m,responseType:_,withCredentials:this.configuration.withCredentials,headers:b,observe:e,reportProgress:n})}cellTypeTreeModel(t,e="body",n=!1,i){const r=t.cache,s=t.token;let o=new zv({encoder:this.encoder});null!=r&&(o=this.addToHttpParams(o,r,"cache")),null!=s&&(o=this.addToHttpParams(o,s,"token"));let a=this.defaultHeaders,l=i&&i.httpHeaderAccept;void 0===l&&(l=this.configuration.selectHeaderAccept(["application/json"])),void 0!==l&&(a=a.set("Accept",l));let c=i&&i.context;void 0===c&&(c=new Uv);let u="json";return l&&(u=l.startsWith("text")?"text":this.configuration.isJsonMime(l)?"json":"blob"),this.httpClient.get(`${this.configuration.basePath}/cell-type-tree-model`,{context:c,params:o,responseType:u,withCredentials:this.configuration.withCredentials,headers:a,observe:e,reportProgress:n})}dbStatus(t,e="body",n=!1,i){const r=t.token;let s=new zv({encoder:this.encoder});null!=r&&(s=this.addToHttpParams(s,r,"token"));let o=this.defaultHeaders,a=i&&i.httpHeaderAccept;void 0===a&&(a=this.configuration.selectHeaderAccept(["application/json"])),void 0!==a&&(o=o.set("Accept",a));let l=i&&i.context;void 0===l&&(l=new Uv);let c="json";return a&&(c=a.startsWith("text")?"text":this.configuration.isJsonMime(a)?"json":"blob"),this.httpClient.get(`${this.configuration.basePath}/db-status`,{context:l,params:s,responseType:c,withCredentials:this.configuration.withCredentials,headers:o,observe:e,reportProgress:n})}getSpatialPlacement(t,e="body",n=!1,i){const r=t.getSpatialPlacementRequest;if(null==r)throw new Error("Required parameter getSpatialPlacementRequest was null or undefined when calling getSpatialPlacement.");let s=this.defaultHeaders,o=i&&i.httpHeaderAccept;void 0===o&&(o=this.configuration.selectHeaderAccept(["application/json"])),void 0!==o&&(s=s.set("Accept",o));let a=i&&i.context;void 0===a&&(a=new Uv);const l=this.configuration.selectHeaderContentType(["application/json"]);void 0!==l&&(s=s.set("Content-Type",l));let c="json";return o&&(c=o.startsWith("text")?"text":this.configuration.isJsonMime(o)?"json":"blob"),this.httpClient.post(`${this.configuration.basePath}/get-spatial-placement`,r,{context:a,responseType:c,withCredentials:this.configuration.withCredentials,headers:s,observe:e,reportProgress:n})}gtexRuiLocations(t,e="body",n=!1,i){const r=t.cache;let s=new zv({encoder:this.encoder});null!=r&&(s=this.addToHttpParams(s,r,"cache"));let o=this.defaultHeaders,a=i&&i.httpHeaderAccept;void 0===a&&(a=this.configuration.selectHeaderAccept(["application/json"])),void 0!==a&&(o=o.set("Accept",a));let l=i&&i.context;void 0===l&&(l=new Uv);let c="json";return a&&(c=a.startsWith("text")?"text":this.configuration.isJsonMime(a)?"json":"blob"),this.httpClient.get(`${this.configuration.basePath}/gtex/rui_locations.jsonld`,{context:l,params:s,responseType:c,withCredentials:this.configuration.withCredentials,headers:o,observe:e,reportProgress:n})}hubmapRuiLocations(t,e="body",n=!1,i){const r=t.cache,s=t.token;let o=new zv({encoder:this.encoder});null!=r&&(o=this.addToHttpParams(o,r,"cache")),null!=s&&(o=this.addToHttpParams(o,s,"token"));let a=this.defaultHeaders,l=i&&i.httpHeaderAccept;void 0===l&&(l=this.configuration.selectHeaderAccept(["application/json"])),void 0!==l&&(a=a.set("Accept",l));let c=i&&i.context;void 0===c&&(c=new Uv);let u="json";return l&&(u=l.startsWith("text")?"text":this.configuration.isJsonMime(l)?"json":"blob"),this.httpClient.get(`${this.configuration.basePath}/hubmap/rui_locations.jsonld`,{context:c,params:o,responseType:u,withCredentials:this.configuration.withCredentials,headers:a,observe:e,reportProgress:n})}ontologyTermOccurences(t,e="body",n=!1,i){const r=t.age,s=t.ageRange,o=t.bmi,a=t.bmiRange,l=t.cache,c=t.ontologyTerms,u=t.cellTypeTerms,h=t.providers,d=t.sex,p=t.spatial,f=t.technologies,g=t.token;let m=new zv({encoder:this.encoder});null!=r&&(m=this.addToHttpParams(m,r,"age")),null!=s&&(m=this.addToHttpParams(m,s,"age-range")),null!=o&&(m=this.addToHttpParams(m,o,"bmi")),null!=a&&(m=this.addToHttpParams(m,a,"bmi-range")),null!=l&&(m=this.addToHttpParams(m,l,"cache")),c&&c.forEach(t=>{m=this.addToHttpParams(m,t,"ontology-terms")}),u&&u.forEach(t=>{m=this.addToHttpParams(m,t,"cell-type-terms")}),h&&h.forEach(t=>{m=this.addToHttpParams(m,t,"providers")}),null!=d&&(m=this.addToHttpParams(m,d,"sex")),p&&p.forEach(t=>{m=this.addToHttpParams(m,t,"spatial")}),f&&f.forEach(t=>{m=this.addToHttpParams(m,t,"technologies")}),null!=g&&(m=this.addToHttpParams(m,g,"token"));let b=this.defaultHeaders,y=i&&i.httpHeaderAccept;void 0===y&&(y=this.configuration.selectHeaderAccept(["application/json"])),void 0!==y&&(b=b.set("Accept",y));let v=i&&i.context;void 0===v&&(v=new Uv);let _="json";return y&&(_=y.startsWith("text")?"text":this.configuration.isJsonMime(y)?"json":"blob"),this.httpClient.get(`${this.configuration.basePath}/ontology-term-occurences`,{context:v,params:m,responseType:_,withCredentials:this.configuration.withCredentials,headers:b,observe:e,reportProgress:n})}ontologyTreeModel(t,e="body",n=!1,i){const r=t.cache,s=t.token;let o=new zv({encoder:this.encoder});null!=r&&(o=this.addToHttpParams(o,r,"cache")),null!=s&&(o=this.addToHttpParams(o,s,"token"));let a=this.defaultHeaders,l=i&&i.httpHeaderAccept;void 0===l&&(l=this.configuration.selectHeaderAccept(["application/json"])),void 0!==l&&(a=a.set("Accept",l));let c=i&&i.context;void 0===c&&(c=new Uv);let u="json";return l&&(u=l.startsWith("text")?"text":this.configuration.isJsonMime(l)?"json":"blob"),this.httpClient.get(`${this.configuration.basePath}/ontology-tree-model`,{context:c,params:o,responseType:u,withCredentials:this.configuration.withCredentials,headers:a,observe:e,reportProgress:n})}providerNames(t,e="body",n=!1,i){const r=t.cache,s=t.token;let o=new zv({encoder:this.encoder});null!=r&&(o=this.addToHttpParams(o,r,"cache")),null!=s&&(o=this.addToHttpParams(o,s,"token"));let a=this.defaultHeaders,l=i&&i.httpHeaderAccept;void 0===l&&(l=this.configuration.selectHeaderAccept(["application/json"])),void 0!==l&&(a=a.set("Accept",l));let c=i&&i.context;void 0===c&&(c=new Uv);let u="json";return l&&(u=l.startsWith("text")?"text":this.configuration.isJsonMime(l)?"json":"blob"),this.httpClient.get(`${this.configuration.basePath}/provider-names`,{context:c,params:o,responseType:u,withCredentials:this.configuration.withCredentials,headers:a,observe:e,reportProgress:n})}referenceOrganScene(t,e="body",n=!1,i){const r=t.organIri;if(null==r)throw new Error("Required parameter organIri was null or undefined when calling referenceOrganScene.");const s=t.age,o=t.ageRange,a=t.bmi,l=t.bmiRange,c=t.cache,u=t.ontologyTerms,h=t.cellTypeTerms,d=t.providers,p=t.sex,f=t.spatial,g=t.technologies,m=t.token;let b=new zv({encoder:this.encoder});null!=s&&(b=this.addToHttpParams(b,s,"age")),null!=o&&(b=this.addToHttpParams(b,o,"age-range")),null!=a&&(b=this.addToHttpParams(b,a,"bmi")),null!=l&&(b=this.addToHttpParams(b,l,"bmi-range")),null!=c&&(b=this.addToHttpParams(b,c,"cache")),u&&u.forEach(t=>{b=this.addToHttpParams(b,t,"ontology-terms")}),h&&h.forEach(t=>{b=this.addToHttpParams(b,t,"cell-type-terms")}),null!=r&&(b=this.addToHttpParams(b,r,"organ-iri")),d&&d.forEach(t=>{b=this.addToHttpParams(b,t,"providers")}),null!=p&&(b=this.addToHttpParams(b,p,"sex")),f&&f.forEach(t=>{b=this.addToHttpParams(b,t,"spatial")}),g&&g.forEach(t=>{b=this.addToHttpParams(b,t,"technologies")}),null!=m&&(b=this.addToHttpParams(b,m,"token"));let y=this.defaultHeaders,v=i&&i.httpHeaderAccept;void 0===v&&(v=this.configuration.selectHeaderAccept(["application/json"])),void 0!==v&&(y=y.set("Accept",v));let _=i&&i.context;void 0===_&&(_=new Uv);let w="json";return v&&(w=v.startsWith("text")?"text":this.configuration.isJsonMime(v)?"json":"blob"),this.httpClient.get(`${this.configuration.basePath}/reference-organ-scene`,{context:_,params:b,responseType:w,withCredentials:this.configuration.withCredentials,headers:y,observe:e,reportProgress:n})}referenceOrgans(t,e="body",n=!1,i){const r=t.cache,s=t.token;let o=new zv({encoder:this.encoder});null!=r&&(o=this.addToHttpParams(o,r,"cache")),null!=s&&(o=this.addToHttpParams(o,s,"token"));let a=this.defaultHeaders,l=i&&i.httpHeaderAccept;void 0===l&&(l=this.configuration.selectHeaderAccept(["application/json"])),void 0!==l&&(a=a.set("Accept",l));let c=i&&i.context;void 0===c&&(c=new Uv);let u="json";return l&&(u=l.startsWith("text")?"text":this.configuration.isJsonMime(l)?"json":"blob"),this.httpClient.get(`${this.configuration.basePath}/reference-organs`,{context:c,params:o,responseType:u,withCredentials:this.configuration.withCredentials,headers:a,observe:e,reportProgress:n})}scene(t,e="body",n=!1,i){const r=t.age,s=t.ageRange,o=t.bmi,a=t.bmiRange,l=t.cache,c=t.ontologyTerms,u=t.cellTypeTerms,h=t.providers,d=t.sex,p=t.spatial,f=t.technologies,g=t.token;let m=new zv({encoder:this.encoder});null!=r&&(m=this.addToHttpParams(m,r,"age")),null!=s&&(m=this.addToHttpParams(m,s,"age-range")),null!=o&&(m=this.addToHttpParams(m,o,"bmi")),null!=a&&(m=this.addToHttpParams(m,a,"bmi-range")),null!=l&&(m=this.addToHttpParams(m,l,"cache")),c&&c.forEach(t=>{m=this.addToHttpParams(m,t,"ontology-terms")}),u&&u.forEach(t=>{m=this.addToHttpParams(m,t,"cell-type-terms")}),h&&h.forEach(t=>{m=this.addToHttpParams(m,t,"providers")}),null!=d&&(m=this.addToHttpParams(m,d,"sex")),p&&p.forEach(t=>{m=this.addToHttpParams(m,t,"spatial")}),f&&f.forEach(t=>{m=this.addToHttpParams(m,t,"technologies")}),null!=g&&(m=this.addToHttpParams(m,g,"token"));let b=this.defaultHeaders,y=i&&i.httpHeaderAccept;void 0===y&&(y=this.configuration.selectHeaderAccept(["application/json"])),void 0!==y&&(b=b.set("Accept",y));let v=i&&i.context;void 0===v&&(v=new Uv);let _="json";return y&&(_=y.startsWith("text")?"text":this.configuration.isJsonMime(y)?"json":"blob"),this.httpClient.get(`${this.configuration.basePath}/scene`,{context:v,params:m,responseType:_,withCredentials:this.configuration.withCredentials,headers:b,observe:e,reportProgress:n})}sparql(t,e="body",n=!1,i){const r=t.query;if(null==r)throw new Error("Required parameter query was null or undefined when calling sparql.");const s=t.token,o=t.format;let a=new zv({encoder:this.encoder});null!=r&&(a=this.addToHttpParams(a,r,"query")),null!=s&&(a=this.addToHttpParams(a,s,"token")),null!=o&&(a=this.addToHttpParams(a,o,"format"));let l=this.defaultHeaders,c=i&&i.httpHeaderAccept;void 0===c&&(c=this.configuration.selectHeaderAccept(["application/json"])),void 0!==c&&(l=l.set("Accept",c));let u=i&&i.context;void 0===u&&(u=new Uv);let h="json";return c&&(h=c.startsWith("text")?"text":this.configuration.isJsonMime(c)?"json":"blob"),this.httpClient.get(`${this.configuration.basePath}/sparql`,{context:u,params:a,responseType:h,withCredentials:this.configuration.withCredentials,headers:l,observe:e,reportProgress:n})}sparqlPost(t,e="body",n=!1,i){const r=t.sparqlQueryRequest;if(null==r)throw new Error("Required parameter sparqlQueryRequest was null or undefined when calling sparqlPost.");const s=t.token,o=t.format;let a=new zv({encoder:this.encoder});null!=s&&(a=this.addToHttpParams(a,s,"token")),null!=o&&(a=this.addToHttpParams(a,o,"format"));let l=this.defaultHeaders,c=i&&i.httpHeaderAccept;void 0===c&&(c=this.configuration.selectHeaderAccept(["application/json"])),void 0!==c&&(l=l.set("Accept",c));let u=i&&i.context;void 0===u&&(u=new Uv);const h=this.configuration.selectHeaderContentType(["application/json","application/x-www-form-urlencoded"]);void 0!==h&&(l=l.set("Content-Type",h));let d="json";return c&&(d=c.startsWith("text")?"text":this.configuration.isJsonMime(c)?"json":"blob"),this.httpClient.post(`${this.configuration.basePath}/sparql`,r,{context:u,params:a,responseType:d,withCredentials:this.configuration.withCredentials,headers:l,observe:e,reportProgress:n})}technologyNames(t,e="body",n=!1,i){const r=t.cache,s=t.token;let o=new zv({encoder:this.encoder});null!=r&&(o=this.addToHttpParams(o,r,"cache")),null!=s&&(o=this.addToHttpParams(o,s,"token"));let a=this.defaultHeaders,l=i&&i.httpHeaderAccept;void 0===l&&(l=this.configuration.selectHeaderAccept(["application/json"])),void 0!==l&&(a=a.set("Accept",l));let c=i&&i.context;void 0===c&&(c=new Uv);let u="json";return l&&(u=l.startsWith("text")?"text":this.configuration.isJsonMime(l)?"json":"blob"),this.httpClient.get(`${this.configuration.basePath}/technology-names`,{context:c,params:o,responseType:u,withCredentials:this.configuration.withCredentials,headers:a,observe:e,reportProgress:n})}tissueBlocks(t,e="body",n=!1,i){const r=t.age,s=t.ageRange,o=t.bmi,a=t.bmiRange,l=t.cache,c=t.ontologyTerms,u=t.cellTypeTerms,h=t.providers,d=t.sex,p=t.spatial,f=t.technologies,g=t.token;let m=new zv({encoder:this.encoder});null!=r&&(m=this.addToHttpParams(m,r,"age")),null!=s&&(m=this.addToHttpParams(m,s,"age-range")),null!=o&&(m=this.addToHttpParams(m,o,"bmi")),null!=a&&(m=this.addToHttpParams(m,a,"bmi-range")),null!=l&&(m=this.addToHttpParams(m,l,"cache")),c&&c.forEach(t=>{m=this.addToHttpParams(m,t,"ontology-terms")}),u&&u.forEach(t=>{m=this.addToHttpParams(m,t,"cell-type-terms")}),h&&h.forEach(t=>{m=this.addToHttpParams(m,t,"providers")}),null!=d&&(m=this.addToHttpParams(m,d,"sex")),p&&p.forEach(t=>{m=this.addToHttpParams(m,t,"spatial")}),f&&f.forEach(t=>{m=this.addToHttpParams(m,t,"technologies")}),null!=g&&(m=this.addToHttpParams(m,g,"token"));let b=this.defaultHeaders,y=i&&i.httpHeaderAccept;void 0===y&&(y=this.configuration.selectHeaderAccept(["application/json"])),void 0!==y&&(b=b.set("Accept",y));let v=i&&i.context;void 0===v&&(v=new Uv);let _="json";return y&&(_=y.startsWith("text")?"text":this.configuration.isJsonMime(y)?"json":"blob"),this.httpClient.get(`${this.configuration.basePath}/tissue-blocks`,{context:v,params:m,responseType:_,withCredentials:this.configuration.withCredentials,headers:b,observe:e,reportProgress:n})}}return t.\u0275fac=function(e){return new(e||t)(Ei(Jv),Ei(JW,8),Ei(tq,8))},t.\u0275prov=xt({factory:function(){return new t(Ei(Jv),Ei(JW,8),Ei(tq,8))},token:t,providedIn:"root"}),t})(),nq=(()=>{class t{constructor(t,e){if(t)throw new Error("CcfApiModule is already loaded. Import in your base AppModule only.");if(!e)throw new Error("You need to import the HttpClientModule in your AppModule! \nSee also https://github.com/angular/angular/issues/20575")}static forRoot(e){return{ngModule:t,providers:[{provide:tq,useFactory:e}]}}}return t.\u0275fac=function(e){return new(e||t)(Ei(t,12),Ei(Jv,8))},t.\u0275mod=ie({type:t}),t.\u0275inj=St({providers:[],imports:[[]]}),t})();function iq(t){return new Promise((e,n)=>{t.oncomplete=t.onsuccess=()=>e(t.result),t.onabort=t.onerror=()=>n(t.error)})}let rq;function sq(){return rq||(rq=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),iq(t)});return(t,i)=>n.then(n=>i(n.transaction(e,t).objectStore(e)))}(0,"keyval")),rq}function oq(t,e=sq()){return e("readonly",e=>iq(e.get(t)))}var aq=n(71440);const lq="Unknown Euler angle order",cq=.99999;class uq extends rC{static get ZYX(){return 0}static get YXZ(){return 1}static get XZY(){return 2}static get ZXY(){return 3}static get YZX(){return 4}static get XYZ(){return 5}static get RollPitchYaw(){return 0}static get DefaultOrder(){return uq.ZYX}static get RotationOrders(){return["ZYX","YXZ","XZY","ZXY","YZX","XYZ"]}static rotationOrder(t){return uq.RotationOrders[t]}get ELEMENTS(){return 4}constructor(t=0,e=0,n=0,i=uq.DefaultOrder){super(-0,-0,-0,-0),arguments.length>0&&Array.isArray(arguments[0])?this.fromVector3(...arguments):this.set(t,e,n,i)}fromQuaternion(t){const[e,n,i,r]=t,s=n*n,o=-2*(s+i*i)+1,a=2*(e*n+r*i);let l=-2*(e*i-r*n);l=l>1?1:l,l=l<-1?-1:l;const c=Math.atan2(2*(n*i+r*e),-2*(e*e+s)+1),u=Math.asin(l),h=Math.atan2(a,o);return new uq(c,u,h,uq.RollPitchYaw)}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=Number.isFinite(t[3])||this.order,this.check()}set(t=0,e=0,n=0,i){return this[0]=t,this[1]=e,this[2]=n,this[3]=Number.isFinite(i)?i:this[3],this.check()}validate(){return function(t){return t>=0&&t<6}(this[3])&&Number.isFinite(this[0])&&Number.isFinite(this[1])&&Number.isFinite(this[2])}toArray(t=[],e=0){return t[e]=this[0],t[e+1]=this[1],t[e+2]=this[2],t}toArray4(t=[],e=0){return t[e]=this[0],t[e+1]=this[1],t[e+2]=this[2],t[e+3]=this[3],t}toVector3(t=[-0,-0,-0]){return t[0]=this[0],t[1]=this[1],t[2]=this[2],t}get x(){return this[0]}set x(t){this[0]=sC(t)}get y(){return this[1]}set y(t){this[1]=sC(t)}get z(){return this[2]}set z(t){this[2]=sC(t)}get alpha(){return this[0]}set alpha(t){this[0]=sC(t)}get beta(){return this[1]}set beta(t){this[1]=sC(t)}get gamma(){return this[2]}set gamma(t){this[2]=sC(t)}get phi(){return this[0]}set phi(t){this[0]=sC(t)}get theta(){return this[1]}set theta(t){this[1]=sC(t)}get psi(){return this[2]}set psi(t){this[2]=sC(t)}get roll(){return this[0]}set roll(t){this[0]=sC(t)}get pitch(){return this[1]}set pitch(t){this[1]=sC(t)}get yaw(){return this[2]}set yaw(t){this[2]=sC(t)}get order(){return this[3]}set order(t){this[3]=function(t){if(t<0&&t>=6)throw new Error(lq);return t}(t)}fromVector3(t,e){return this.set(t[0],t[1],t[2],Number.isFinite(e)?e:this[3])}fromArray(t,e=0){return this[0]=t[0+e],this[1]=t[1+e],this[2]=t[2+e],void 0!==t[3]&&(this[3]=t[3]),this.check()}fromRollPitchYaw(t,e,n){return this.set(t,e,n,uq.ZYX)}fromRotationMatrix(t,e=uq.DefaultOrder){return this._fromRotationMatrix(t,e),this.check()}getRotationMatrix(t){return this._getRotationMatrix(t)}getQuaternion(){const t=new $N;switch(this[4]){case uq.XYZ:return t.rotateX(this[0]).rotateY(this[1]).rotateZ(this[2]);case uq.YXZ:return t.rotateY(this[0]).rotateX(this[1]).rotateZ(this[2]);case uq.ZXY:return t.rotateZ(this[0]).rotateX(this[1]).rotateY(this[2]);case uq.ZYX:return t.rotateZ(this[0]).rotateY(this[1]).rotateX(this[2]);case uq.YZX:return t.rotateY(this[0]).rotateZ(this[1]).rotateX(this[2]);case uq.XZY:return t.rotateX(this[0]).rotateZ(this[1]).rotateY(this[2]);default:throw new Error(lq)}}_fromRotationMatrix(t,e=uq.DefaultOrder){const n=t.elements,i=n[0],r=n[4],s=n[8],o=n[1],a=n[5],l=n[9],c=n[2],u=n[6],h=n[10];switch(e=e||this[3]){case uq.XYZ:this[1]=Math.asin(tC(s,-1,1)),Math.abs(s)1&&void 0!==arguments[1]?arguments[1]:0,n=(_q[t[e+0]]+_q[t[e+1]]+_q[t[e+2]]+_q[t[e+3]]+"-"+_q[t[e+4]]+_q[t[e+5]]+"-"+_q[t[e+6]]+_q[t[e+7]]+"-"+_q[t[e+8]]+_q[t[e+9]]+"-"+_q[t[e+10]]+_q[t[e+11]]+_q[t[e+12]]+_q[t[e+13]]+_q[t[e+14]]+_q[t[e+15]]).toLowerCase();if(!vq(n))throw TypeError("Stringified UUID is invalid");return n}(i)},Sq=n(31609);const Cq=Object.freeze({OUTSIDE:-1,INTERSECTING:0,INSIDE:1}),Eq=(Math,Math,{});function Oq(t,{precision:e=Eq.precision||4}={}){return t=function(t){return Math.round(t/Eq.EPSILON)*Eq.EPSILON}(t),"".concat(parseFloat(t.toPrecision(e)))}function Tq(t){return Array.isArray(t)||ArrayBuffer.isView(t)&&!(t instanceof DataView)}function kq(t,e,n){const i=Eq.EPSILON;n&&(Eq.EPSILON=n);try{if(t===e)return!0;if(Tq(t)&&Tq(e)){if(t.length!==e.length)return!1;for(let n=0;n0?", ":"")+Oq(this[n],t);return"".concat(t.printTypes?this.constructor.name:"","[").concat(e,"]")}equals(t){if(!t||this.length!==t.length)return!1;for(let e=0;e=0&&t=0&&t=s+i)return this.clone();if(i>=s+n)return t.clone();const o=.5*(n+s+i);return Vq.copy(r).scale((-n+o)/s).add(e),this.center.copy(Vq),this.radius=o,this}expand(t){const e=(t=Bq.from(t)).subtract(this.center).magnitude();return e>this.radius&&(this.radius=e),this}transform(t){this.center.transform(t);const e=function(t,e){var n=e[4],i=e[5],r=e[6],s=e[8],o=e[9],a=e[10];return t[0]=Math.hypot(e[0],e[1],e[2]),t[1]=Math.hypot(n,i,r),t[2]=Math.hypot(s,o,a),t}(Bq,t);return this.radius=Math.max(e[0],Math.max(e[1],e[2]))*this.radius,this}distanceSquaredTo(t){const e=this.distanceTo(t);return e*e}distanceTo(t){const e=(t=Bq.from(t)).subtract(this.center);return Math.max(0,e.len()-this.radius)}intersectPlane(t){const e=this.radius,n=t.normal.dot(this.center)+t.distance;return n<-e?Cq.OUTSIDE:n0?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 kN(this,this,t),this.check()}rotateY(t){return PN(this,this,t),this.check()}rotateZ(t){return AN(this,this,t),this.check()}scale(t){return jN(this,this,t),this.check()}slerp(t,e,n){switch(arguments.length){case 1:({start:t=Xq,target:e,ratio:n}=arguments[0]);break;case 2:[e,n]=arguments,t=this}return IN(this,t,e,n),this.check()}transformVector4(t,e=t){return CT(e,t,this),Iq(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)}}const Kq=new Fq,Qq=new Fq,Zq=new Fq,Jq=new Fq,tX=new Fq,eX=new Fq,nX=new Fq;class iX{constructor(t=[0,0,0],e=[0,0,0,0,0,0,0,0,0]){this.center=(new Fq).from(t),this.halfAxes=new qq(e)}get halfSize(){const t=this.halfAxes.getColumn(0),e=this.halfAxes.getColumn(1),n=this.halfAxes.getColumn(2);return[new Fq(t).len(),new Fq(e).len(),new Fq(n).len()]}get quaternion(){const t=this.halfAxes.getColumn(0),e=this.halfAxes.getColumn(1),n=this.halfAxes.getColumn(2),i=new Fq(t).normalize(),r=new Fq(e).normalize(),s=new Fq(n).normalize();return(new Yq).fromMatrix3(new qq([...i,...r,...s]))}fromCenterHalfSizeQuaternion(t,e,n){const i=new Yq(n),r=(new qq).fromQuaternion(i);return r[0]=r[0]*e[0],r[1]=r[1]*e[0],r[2]=r[2]*e[0],r[3]=r[3]*e[1],r[4]=r[4]*e[1],r[5]=r[5]*e[1],r[6]=r[6]*e[2],r[7]=r[7]*e[2],r[8]=r[8]*e[2],this.center=(new Fq).from(t),this.halfAxes=r,this}clone(){return new iX(this.center,this.halfAxes)}equals(t){return this===t||Boolean(t)&&this.center.equals(t.center)&&this.halfAxes.equals(t.halfAxes)}getBoundingSphere(t=new zq){const e=this.halfAxes,n=e.getColumn(0,Zq),i=e.getColumn(1,Jq),r=e.getColumn(2,tX),s=Kq.copy(n).add(i).add(r);return t.center.copy(this.center),t.radius=s.magnitude(),t}intersectPlane(t){const e=this.center,n=t.normal,i=this.halfAxes,r=n.x,s=n.y,o=n.z,a=Math.abs(r*i[0]+s*i[1]+o*i[2])+Math.abs(r*i[3]+s*i[4]+o*i[5])+Math.abs(r*i[6]+s*i[7]+o*i[8]),l=n.dot(e)+t.distance;return l<=-a?Cq.OUTSIDE:l>=a?Cq.INSIDE:Cq.INTERSECTING}distanceTo(t){return Math.sqrt(this.distanceSquaredTo(t))}distanceSquaredTo(t){const e=Qq.from(t).subtract(this.center),n=this.halfAxes,i=n.getColumn(0,Zq),r=n.getColumn(1,Jq),s=n.getColumn(2,tX),o=i.magnitude(),a=r.magnitude(),l=s.magnitude();i.normalize(),r.normalize(),s.normalize();let c,u=0;return c=Math.abs(e.dot(i))-o,c>0&&(u+=c*c),c=Math.abs(e.dot(r))-a,c>0&&(u+=c*c),c=Math.abs(e.dot(s))-l,c>0&&(u+=c*c),u}computePlaneDistances(t,e,n=[-0,-0]){let i=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY;const s=this.center,o=this.halfAxes,a=o.getColumn(0,Zq),l=o.getColumn(1,Jq),c=o.getColumn(2,tX),u=eX.copy(a).add(l).add(c).add(s),h=nX.copy(u).subtract(t);let d=e.dot(h);return i=Math.min(d,i),r=Math.max(d,r),u.copy(s).add(a).add(l).subtract(c),h.copy(u).subtract(t),d=e.dot(h),i=Math.min(d,i),r=Math.max(d,r),u.copy(s).add(a).subtract(l).add(c),h.copy(u).subtract(t),d=e.dot(h),i=Math.min(d,i),r=Math.max(d,r),u.copy(s).add(a).subtract(l).subtract(c),h.copy(u).subtract(t),d=e.dot(h),i=Math.min(d,i),r=Math.max(d,r),s.copy(u).subtract(a).add(l).add(c),h.copy(u).subtract(t),d=e.dot(h),i=Math.min(d,i),r=Math.max(d,r),s.copy(u).subtract(a).add(l).subtract(c),h.copy(u).subtract(t),d=e.dot(h),i=Math.min(d,i),r=Math.max(d,r),s.copy(u).subtract(a).subtract(l).add(c),h.copy(u).subtract(t),d=e.dot(h),i=Math.min(d,i),r=Math.max(d,r),s.copy(u).subtract(a).subtract(l).subtract(c),h.copy(u).subtract(t),d=e.dot(h),i=Math.min(d,i),r=Math.max(d,r),n[0]=i,n[1]=r,n}transform(t){this.center.transformAsPoint(t);const e=this.halfAxes.getColumn(0,Zq);e.transformAsPoint(t);const n=this.halfAxes.getColumn(1,Jq);n.transformAsPoint(t);const i=this.halfAxes.getColumn(2,tX);return i.transformAsPoint(t),this.halfAxes=new qq([...e,...n,...i]),this}getTransform(){throw new Error("not implemented")}}const rX=new Fq,sX=new Fq;class oX{constructor(t=[0,0,1],e=0){this.normal=new Fq,this.distance=-0,this.fromNormalDistance(t,e)}fromNormalDistance(t,e){return Pq(Number.isFinite(e)),this.normal.from(t).normalize(),this.distance=e,this}fromPointNormal(t,e){t=rX.from(t),this.normal.from(e).normalize();const n=-this.normal.dot(t);return this.distance=n,this}fromCoefficients(t,e,n,i){return this.normal.set(t,e,n),Pq(kq(this.normal.len(),1)),this.distance=i,this}clone(t){return new oX(this.normal,this.distance)}equals(t){return kq(this.distance,t.distance)&&kq(this.normal,t.normal)}getPointDistance(t){return this.normal.dot(t)+this.distance}transform(t){const e=sX.copy(this.normal).transformAsVector(t).normalize(),n=this.normal.scale(-this.distance).transform(t);return this.fromPointNormal(n,e)}projectPointOntoPlane(t,e=[0,0,0]){t=rX.from(t);const n=this.getPointDistance(t),i=sX.copy(this.normal).scale(n);return t.subtract(i).to(e)}}function*aX(t,e,n){for(const[i,r]of Object.entries(n))for(const n of(0,aq.readQuads)(t,e,i,null,null)){const t="Literal"===n.object.termType?(0,Sq.fromRdf)(n.object):n.object.id;yield[r,t]}}function lX(t,e,n,i){const r={"@id":e,"@type":n};for(const[s,o]of Object.entries(i))for(const e of(0,aq.readQuads)(t,r["@id"],s,null,null)){const t="Literal"===e.object.termType?(0,Sq.fromRdf)(e.object):e.object.id;r[o]=t}return r}new Fq([1,0,0]),new Fq([0,1,0]),new Fq([0,0,1]),new Fq,new Fq,new oX(new Fq(1,0,0),0),new Fq,new Fq,new Fq,new Fq,new Fq,new Fq,new Fq,new Fq,new Fq,new Fq,new Fq,new Fq,new Fq,new Fq,new Fq,new Fq,new Fq,Math,new qq,new qq,new qq,new qq,new qq,new Fq,new Fq,new Fq,new Fq,new Fq,new qq,new qq,new qq;const cX=aq.Util.prefixes({base:"http://purl.org/ccf/latest/ccf.owl#",ccf:"http://purl.org/ccf/",fma:"http://purl.org/sig/ont/fma/fma",obo:"http://purl.obolibrary.org/obo/",uberon:"http://purl.obolibrary.org/obo/UBERON_",cl:"http://purl.obolibrary.org/obo/CL_",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/",dcterms:"http://purl.org/dc/terms/"},aq.DataFactory),uX={x:cX("rdf"),type:cX("rdf")("type")},hX=(cX("rdfs"),cX("rdfs")("label"),cX("rdfs")("comment"),cX("rdfs")("isDefinedBy"),cX("rdfs")("seeAlso"),cX("ccf")),dX={id:cX("ccf")("has_registration_location"),label:cX("rdfs")("label"),description:cX("rdfs")("comment"),link:hX("url"),sex:hX("sex"),age:hX("age"),bmi:hX("bmi"),Male:aq.DataFactory.literal("Male"),Female:aq.DataFactory.literal("Female"),consortiumName:hX("consortium_name"),providerName:hX("tissue_provider_name"),providerUUID:hX("tissue_provider_uuid"),donor:hX("comes_from"),sections:hX("subdivided_into_sections"),datasets:hX("generates_dataset"),sampleType:hX("sample_type"),TissueBlock:aq.DataFactory.literal("Tissue Block"),TissueSection:aq.DataFactory.literal("Tissue Section"),NonStandard:aq.DataFactory.literal("Non-standard"),sectionCount:hX("section_count"),sectionSize:hX("section_size"),sectionUnits:hX("section_size_unit"),sectionNumber:hX("section_number"),spatialEntity:hX("has_registration_location"),ontologyTerms:hX("has_ontology_term"),cellTypeTerms:hX("has_cell_type_term"),technology:hX("technology"),thumbnail:hX("thumbnail")},pX={x:hX,base:cX("base"),ontologyNode:{label:hX("ccf_pref_label"),parent:hX("ccf_part_of"),children:hX("ccf_part_of"),rui_rank:hX("rui_rank"),synonymLabels:aq.DataFactory.namedNode("http://www.geneontology.org/formats/oboInOwl#hasExactSynonym")},asctb:{part_of:hX("ccf_part_of"),ct_is_a:hX("ccf_ct_isa"),located_in:hX("ccf_located_in"),characterizes:hX("ccf_characterizes")},spatial:{Female:cX("base")("VHFemale"),Male:cX("base")("VHMale"),BothSexes:cX("base")("VHBothSexes"),FemaleOrgans:cX("base")("VHFemaleOrgans"),MaleOrgans:cX("base")("VHMaleOrgans")},SpatialObjectReference:hX("spatial_object_reference"),SpatialEntity:hX("spatial_entity"),SpatialPlacement:hX("spatial_placement"),spatialObjectReference:{file:hX("file_url"),file_format:hX("file_format"),file_subpath:hX("file_subpath")},extractionSet:{label:cX("rdfs")("label"),rui_rank:hX("rui_rank")},spatialEntity:{label:cX("rdfs")("label"),description:cX("rdfs")("comment"),creator:cX("dcterms")("creator"),creator_first_name:hX("creator_first_name"),creator_last_name:hX("creator_last_name"),creator_orcid:hX("creator_orcid"),creation_date:cX("dcterms")("created"),updated_date:hX("updated_date"),ccf_annotations:hX("collides_with"),representation_of:hX("representation_of"),reference_organ:hX("has_reference_organ"),extraction_set_for:hX("extraction_set_for"),extraction_set:hX("has_extraction_set"),sex:hX("organ_owner_sex"),side:hX("organ_side"),rui_rank:hX("rui_rank"),slice_thickness:hX("slice_thickness"),slice_count:hX("slice_count"),x_dimension:hX("x_dimension"),y_dimension:hX("y_dimension"),z_dimension:hX("z_dimension"),dimension_units:hX("dimension_unit"),object:hX("has_object_reference")},spatialPlacement:{source:hX("placement_for"),target:hX("placement_relative_to"),placement_date:cX("dcterms")("created"),x_scaling:hX("x_scaling"),y_scaling:hX("y_scaling"),z_scaling:hX("z_scaling"),scaling_units:hX("scaling_unit"),x_rotation:hX("x_rotation"),y_rotation:hX("y_rotation"),z_rotation:hX("z_rotation"),w_rotation:hX("theta_rotation"),rotation_order:hX("rotation_order"),rotation_units:hX("rotation_unit"),x_translation:hX("x_translation"),y_translation:hX("y_translation"),z_translation:hX("z_translation"),translation_units:hX("translation_unit")}},fX={x:cX("uberon"),body:cX("uberon")("0013702")},gX={x:cX("cl"),cell:cX("cl")("0000000")},mX={x:cX("fma")},bX=(cX("lmha"),{body:fX.body,cell:gX.cell,respiratory_system:fX.x("0001004"),colon:fX.x("0001155"),left_lung:fX.x("0002168"),right_lung:fX.x("0002167"),left_bronchus:fX.x("0002178"),right_bronchus:fX.x("0002177"),kidney:fX.x("0002113"),ureter:fX.x("0000056"),eye:fX.x("0000970"),fallopian_tube:fX.x("0003889"),knee:fX.x("0001465"),ovary:fX.x("0000992"),trachea:fX.x("0003126"),aorta:fX.x("0000947"),blood:fX.x("0000178"),bone_marrow:fX.x("0002371"),male_reproductive_system:fX.x("0000079"),lymph_node:fX.x("0000029"),blood_vasculature:fX.x("0004537"),brain:fX.x("0000955"),eye_left:fX.x("0004548"),eye_right:mX.x("54449"),fallopian_tube_left:fX.x("0001303"),fallopian_tube_right:fX.x("0001302"),heart:fX.x("0000948"),kidney_left:fX.x("0004538"),kidney_right:fX.x("0004539"),knee_left:mX.x("24978"),knee_right:mX.x("24977"),large_intestine:fX.x("0000059"),liver:fX.x("0002107"),lungs:fX.x("0002048"),mesenteric_lymph_node:fX.x("0002509"),ovary_left:mX.x("7214"),ovary_right:mX.x("7213"),pancreas:fX.x("0001264"),pelvis:fX.x("0001270"),prostate_gland:fX.x("0002367"),skin:fX.x("0002097"),small_intestine:fX.x("0002108"),spleen:fX.x("0002106"),thymus:fX.x("0002370"),ureter_left:fX.x("0001223"),ureter_right:fX.x("0001222"),urinary_bladder:fX.x("0001255"),uterus:fX.x("0000995")});function yX(t){const e={};return Object.entries(t).forEach(([t,n])=>{e[n.id]=t}),e}const vX={spatialObjectReference:yX(pX.spatialObjectReference),spatialEntity:yX(pX.spatialEntity),spatialPlacement:yX(pX.spatialPlacement)};function _X(t,e){const n=lX(t,e,"ExtractionSet",vX.spatialEntity);return n.extractionSites=(0,gq.sortBy)(t.getSubjects(pX.spatialEntity.extraction_set,e,null).map(e=>wX(t,e.id)),["rui_rank"]),n}function wX(t,e){const n=lX(t,e,"SpatialEntity",vX.spatialEntity);return n.object&&(n.object=function(t,e){return lX(t,e,"SpatialObjectReference",vX.spatialObjectReference)}(t,n.object)),n.ccf_annotations&&(n.ccf_annotations=t.getObjects(e,pX.spatialEntity.ccf_annotations,null).map(t=>t.id)),t.forSubjects(t=>n.entityId=t.id,dX.spatialEntity,e,null),n}function xX(t,e){const n=lX(t,e,"SpatialPlacement",vX.spatialPlacement);return n.source&&(n.source=wX(t,n.source)),n.target&&(n.target=wX(t,n.target)),n}function SX(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(ZS),o=[n.x_scaling,n.y_scaling,n.z_scaling];return t.translate(r).rotateXYZ(s).scale(o)}class CX{constructor(t){this.db=t,this.createGraph()}createGraph(){this.graph=new dq.DirectedGraph;const t=this.db.store;t.forSubjects(t=>{this.addNode(t.id,"SpatialObjectReference")},uX.type,pX.SpatialObjectReference,null),t.forSubjects(t=>{this.addNode(t.id,"SpatialEntity")},uX.type,pX.SpatialEntity,null);const e={};for(const n of(0,aq.readQuads)(t,null,pX.spatialPlacement.source,null,null))e[n.subject.id]=n.object.id;for(const n of(0,aq.readQuads)(t,null,pX.spatialPlacement.target,null,null)){const t=e[n.subject.id];t&&this.addEdge(n.subject.id,t,n.object.id,"SpatialPlacement")}}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 VT(VT.IDENTITY);if(!this.graph.hasNode(t)||!this.graph.hasNode(e))return;const n=this.db.store,i=new VT(VT.IDENTITY),r=fq()(this.graph,t,e);if(r&&r.length>0){r.reverse();let t="";for(const e of r)t&&SX(i,xX(n,this.graph.getEdgeAttribute(e,t,"id"))),t=e;return i}}getSpatialPlacement(t,e){const n=this.graph.hasNode(t["@id"])?t["@id"]:void 0,i=(0,gq.get)(t,"placement[0]",(0,gq.get)(t,"placement",void 0));let r;if(i&&this.graph.hasNode(i.target)?(r=this.getTransformationMatrix(i.target,e),r&&(r=SX(r,i))):n&&(r=this.getTransformationMatrix(n,e)),r){const n=(new uq).fromRotationMatrix(r,uq.XYZ),i=r.getTranslation().map(t=>1e3*t),s=n.toVector3().map(JS),o=r.getScale().map(t=>t<1&&t>.999999?1:t);return{"@context":"https://hubmapconsortium.github.io/hubmap-ontology/ccf-context.jsonld","@id":`http://purl.org/ccf/1.5/${xq()}_placement`,"@type":"SpatialPlacement",source:t["@id"],target:e,placement_date:(new Date).toISOString().split("T")[0],x_scaling:o[0],y_scaling:o[1],z_scaling:o[2],scaling_units:"ratio",x_rotation:s[0],y_rotation:s[1],z_rotation:s[2],rotation_order:"XYZ",rotation_units:"degree",x_translation:i[0],y_translation:i[1],z_translation:i[2],translation_units:"millimeter"}}}}class EX{constructor(t){this.db=t}getSpatialEntity(t){return wX(this.db.store,t)}getExtractionSets(t){return function(t,e){return(0,gq.sortBy)(t.getSubjects(pX.spatialEntity.extraction_set_for,e,null).map(e=>_X(t,e.id)),["rui_rank"])}(this.db.store,t)}getExtractionSet(t){return _X(this.db.store,t)}getAnatomicalStructures(t){return function(t,e){return(0,gq.sortBy)(t.getSubjects(pX.spatialEntity.reference_organ,e,null).map(e=>wX(t,e.id)).filter(t=>t["@id"]!==e),["rui_rank"])}(this.db.store,t)}getReferenceOrgans(){return function(t){const e=[];return t.forEach(n=>{n.subject.id===n.object.id&&e.push(wX(t,n.subject.id))},null,pX.spatialEntity.reference_organ,null,null),(0,gq.sortBy)(e,["rui_rank"])}(this.db.store)}getReferenceBody(t){let e;switch(null==t?void 0:t.sex){case"Male":e=pX.spatial.Male.id;break;case"Female":e=pX.spatial.Female.id;break;case"Both":default:e=pX.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),n=[];let i=[...this.getReferenceOrganSets(t).map(t=>{const i="http://purl.obolibrary.org/obo/UBERON_0002097"===t.representation_of,r=this.getSceneNode(t,e,{color:[255,255,255,255],opacity:i?.5:.2,unpickable:!0,_lighting:"pbr",zoomBasedOpacity:!i});return i&&r?void n.push(r):r})];return n.length>0&&(i=[...n,...i]),(null==t?void 0:t.debug)&&(i=i.concat([this.getSceneNode(this.getSpatialEntity(pX.base("VHRightKidney").id),e,{color:[0,0,255,127.5],geometry:"wireframe"}),this.getSceneNode(this.getSpatialEntity(pX.base("VHLeftKidney").id),e,{color:[255,0,0,127.5],geometry:"wireframe"}),this.getSceneNode(this.getSpatialEntity(pX.base("VHSpleenCC1").id),e,{color:[0,255,0,127.5],geometry:"wireframe"}),this.getSceneNode(this.getSpatialEntity(pX.base("VHSpleenCC2").id),e,{color:[0,255,0,127.5],geometry:"wireframe"}),this.getSceneNode(this.getSpatialEntity(pX.base("VHSpleenCC3").id),e,{color:[0,255,0,127.5],geometry:"wireframe"})])),i.filter(t=>void 0!==t)}getReferenceOrganScene(t,e){var n,i;const r=void 0!==(null==e?void 0:e.sex)&&"both"!==(null===(n=null==e?void 0:e.sex)||void 0===n?void 0:n.toLowerCase()),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 VT(VT.IDENTITY).rotateX(ZS(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 OX="https://entity.api.hubmapconsortium.org/entities/",TX=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"]),kX={"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"},PX={"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","5c106f29-ea2d-11e9-85e8-0efb3ba9a670":"RTI-General Electric","301615f9-c870-11eb-a8dc-35ce3d8786fe":"TMC-UConn"},AX={"@base":"http://purl.org/ccf/latest/ccf-entity.owl#","@vocab":"http://purl.org/ccf/latest/ccf-entity.owl#",ccf:"http://purl.org/ccf/",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"},cellTypeTerms:{"@id":"has_cell_type_term","@type":"@id"},thumbnail:{"@id":"has_thumbnail"}};class MX{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,PX[t.group_uuid]||(PX[t.group_uuid]=t.group_name);const c=new Date(t.last_modified_timestamp).toLocaleDateString(),u=PX[t.group_uuid]||t.group_name,h=t.created_by_user_displayname;this["@id"]=OX+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,gq.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":OX+t.uuid,"@type":"Sample",label:`Registered ${i}, ${t.created_by_user_displayname}, ${PX[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=PX[t.group_uuid]||t.group_name,a=t.created_by_user_displayname,l=[...t.data_types,(0,gq.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":OX+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,gq.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=>TX.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(TX.has(t))return`assets/thumbnails/TMC-Vanderbilt/DR1/${t}`}}else if("07a29e4c-ed43-11e8-b56a-0e8017bdda58"===t.group_uuid){const e=kX[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,gq.toNumber)(r[1]));for(const u of(0,gq.get)(t,"metadata.organ_donor_data",(0,gq.get)(t,"metadata.living_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,gq.toNumber)(u.data_value):"Body mass index"===u.preferred_term&&(o=(0,gq.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=PX[t.group_uuid]||t.group_name;return{"@id":OX+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;let i,r=t.rui_location;if(r&&("string"==typeof r&&(r=JSON.parse(r)),r.alignment_id?console.log("Detected a deprecated rui_location",t.uuid):r["@id"]&&(i=r)),i){const t=null!==(n=(0,gq.get)(i,["placement","target"]))&&void 0!==n?n:"";t.startsWith("http://purl.org/ccf/latest/ccf.owl#VHSpleenCC")?(0,gq.set)(i,["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,gq.set)(i,["placement","target"],"Male"===e.sex?t.replace("#VH","#VHM")+"_Patch":t.replace("#VH","#VHF")+"_Patch")}return i}getTissueBlock(){return(0,gq.omit)(Object.assign({},this),["data","bad","donor"])}toJsonLd(){return Object.assign(Object.assign({},this.donor),{samples:[this.getTissueBlock()]})}}const IX=["uuid","entity_type","group_uuid","group_name","last_modified_timestamp","created_by_user_displayname","ancestors.entity_type","ancestors.description","ancestors.metadata.organ_donor_data.preferred_term","ancestors.metadata.organ_donor_data.data_value","ancestors.metadata.living_donor_data.preferred_term","ancestors.metadata.living_donor_data.data_value","ancestors.last_modified_timestamp","ancestors.group_uuid","ancestors.group_name","ancestors.created_by_user_displayname","ancestors.uuid","descendants.entity_type","descendants.ingest_metadata.metadata.tissue_id","descendants.last_modified_timestamp","descendants.group_uuid","descendants.group_name","descendants.created_by_user_displayname","descendants.uuid","descendants.data_types","descendants.ingest_metadata.metadata.assay_type","descendants.thumbnail_file","descendants.metadata.files.rel_path","rui_location","specimen_type"],DX={exists:{field:"rui_location"}};function RX(t,e,n){return JSON.stringify({version:!0,from:t,size:e,stored_fields:["*"],script_fields:{},docvalue_fields:[],query:null!=n?n:DX,_source:{includes:IX}})}function NX(t,e){return xw(this,void 0,void 0,function*(){try{const n=yield fetch(t,e);return n.ok?yield n.json():void 0}catch(n){return}})}function LX(t,e,n,i,r="",s=""){return xw(this,void 0,void 0,function*(){let o;if("static"===e?o=yield NX(t):"search-api"===e&&(o=yield function(t,e,n){return xw(this,void 0,void 0,function*(){const i=250,r=function(t){const e=new Headers;return e.append("Content-type","application/json"),t&&e.append("Authorization",`Bearer ${t}`),e}(e),s=RX(0,i,n),o=yield NX(t,{method:"POST",headers:r,body:s});if(!o)return;const a=o.hits.total.value;if(a<=i)return o;const l=[];for(let e=i;e!t))return;const u=c.map(t=>t.hits.hits);return Object.assign(Object.assign({},o),{hits:Object.assign(Object.assign({},o.hits),{hits:o.hits.hits.concat(...u)})})})}(t,i,n)),o)return function(t,e="",n="",i,r=!1){const s={},o=(0,gq.get)(t,"hits.hits",[]).map(t=>(0,gq.get)(t,"_source",{})).sort((t,e)=>t.uuid.localeCompare(e.uuid)).map(t=>new MX(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":AX},t)))),{"@context":AX,"@graph":a}}(o,r,s,i);console.warn(`Unable to load ${t} as HuBMAP Data`)})}function jX(t,e,n){const i=new Set;for(const r of e)for(const e of(0,aq.readQuads)(t,r,n,null,null))i.add(e.object.id);return i}const FX={[pX.spatialEntity.x_dimension.id]:"x",[pX.spatialEntity.y_dimension.id]:"y",[pX.spatialEntity.z_dimension.id]:"z"};function BX(t,e,n,i){const r=e.getTransformationMatrix(n,i);let s;if(r){const e=r.getTranslation(),i=function(t,e){const n=lX(t,e,"Dimensions",FX);return[n.x,n.y,n.z]}(t,n).map(t=>t/1e3/2),o=(new uq).fromRotationMatrix(r,uq.XYZ).toQuaternion().normalize().calculateW();s=(new iX).fromCenterHalfSizeQuaternion(e,i,o)}return s}function VX(t,e,n,i){const{x:r,y:s,z:o,radius:a,target:l}=i,c=new Set,u=a/1e3*(a/1e3);for(const h of n){const n=BX(t,e,h,l);n&&n.distanceSquaredTo([r,s,o].map(t=>t/1e3))<=u&&c.add(h)}return c}function zX(t,e,n){var i,r;const s=new Map,o=new Set;for(const c of e)for(const e of(0,aq.readQuads)(t,c,dX.donor,null,null))o.add(e.object.id),s.has(e.object.id)?null===(i=s.get(e.object.id))||void 0===i||i.push(c):s.set(e.object.id,[c]);const a=n(o),l=new Set;for(const c of a)for(const t of null!==(r=s.get(c))&&void 0!==r?r:[])l.add(t);return l}function UX(t,e,n){var i,r;const s=new Map,o=new Set;for(const c of e)for(const e of(0,aq.readQuads)(t,c,dX.spatialEntity,null,null))o.add(e.object.id),s.has(e.object.id)?null===(i=s.get(e.object.id))||void 0===i||i.push(c):s.set(e.object.id,[c]);const a=n(o),l=new Set;for(const c of a)for(const t of null!==(r=s.get(c))&&void 0!==r?r:[])l.add(t);return l}function HX(t,e){return function(n){t.has(n.id)&&e.add(n.id)}}function $X(t,e,n){const i=new Set;for(const r of n){const n=aq.DataFactory.namedNode(r);t.forSubjects(HX(e,i),pX.spatialEntity.ccf_annotations,n,null)}return i}function GX(t,e){const n=function(t,e){const n=new Map;for(const i of t)for(const t of(0,aq.readQuads)(e,i,dX.spatialEntity,null,null))n.has(t.object.id)?n.get(t.object.id).add(i):n.set(t.object.id,new Set([i]));return n}(t,e),i=new Map;for(const r of n.keys()){const t=n.get(r);for(const n of(0,aq.readQuads)(e,r,pX.spatialEntity.ccf_annotations,null,null))if(i.has(n.object.id)){const e=i.get(n.object.id);t.forEach(t=>e.add(t))}else i.set(n.object.id,new Set(t))}return i}function WX(t,e,n){const i={"@id":e,"@type":"OntologyTreeNode",id:e,parent:"",children:[],synonymLabels:[],label:""},r={[pX.ontologyNode.label.id]:"label",[n]:"parent",[pX.ontologyNode.synonymLabels.id]:"synonymLabels"};for(const[s,o]of aX(t,e,r))"synonymLabels"===s?i.synonymLabels.push(o):i[s]=o;return i.children=t.getSubjects(n,e,null).map(t=>t.id),i}function qX(t,e,n,i){const r={root:e,nodes:{}},s=new Set;for(const a of(0,aq.readQuads)(t,null,i,null,null))s.add(a.subject.id),s.add(a.object.id);for(const a of s)r.nodes[a]=WX(t,a,i);r.nodes[e]||(r.nodes[e]={"@id":e,"@type":"OntologyTreeNode",id:e,label:n,children:[],synonymLabels:[]});const o=t.getSubjects(i,e,null).map(t=>t.id).sort((t,e)=>r.nodes[t].label.localeCompare(r.nodes[e].label));return r.nodes[e].children=o,XX(r),r}function XX(t,e,n=new Set){const i=t.nodes[null!=e?e:t.root];if(i){i.children=i.children.filter(t=>!n.has(t)),i.children.forEach(t=>n.add(t));for(const e of i.children)XX(t,e,n),t.nodes[e]&&(t.nodes[e].parent=i["@id"])}}const YX=(0,gq.memoize)(function(t){const e=qX(t,bX.body.id,"body",pX.asctb.part_of.id);return e.nodes[bX.body.id].children=["http://purl.obolibrary.org/obo/UBERON_0000955","http://purl.obolibrary.org/obo/UBERON_0000029","http://purl.obolibrary.org/obo/UBERON_0000970","http://purl.obolibrary.org/obo/UBERON_0003889","http://purl.obolibrary.org/obo/UBERON_0000948","http://purl.obolibrary.org/obo/UBERON_0002113","http://purl.obolibrary.org/obo/UBERON_0001465","http://purl.obolibrary.org/obo/UBERON_0002107","http://purl.obolibrary.org/obo/UBERON_0002048","http://purl.obolibrary.org/obo/UBERON_0001911","http://purl.obolibrary.org/obo/UBERON_0000992","http://purl.obolibrary.org/obo/UBERON_0001264","http://purl.obolibrary.org/obo/UBERON_0001270","http://purl.obolibrary.org/obo/UBERON_0001987","http://purl.obolibrary.org/obo/UBERON_0002367","http://purl.obolibrary.org/obo/UBERON_0002097","http://purl.obolibrary.org/obo/UBERON_0002108","http://purl.obolibrary.org/obo/UBERON_0002240","http://purl.obolibrary.org/obo/UBERON_0000059","http://purl.obolibrary.org/obo/UBERON_0002106","http://purl.obolibrary.org/obo/UBERON_0002370","http://purl.obolibrary.org/obo/UBERON_0000056","http://purl.obolibrary.org/obo/UBERON_0001255","http://purl.obolibrary.org/obo/UBERON_0000995","http://purl.obolibrary.org/obo/UBERON_0004537"].filter(t=>t in e.nodes),e},()=>""),KX={[dX.label.id]:"label",[dX.description.id]:"description",[dX.link.id]:"link"},QX=Object.assign(Object.assign({},KX),{[dX.providerName.id]:"providerName"}),ZX=Object.assign(Object.assign({},KX),{[dX.technology.id]:"technology",[dX.thumbnail.id]:"thumbnail"}),JX=Object.assign(Object.assign({},KX),{[dX.sampleType.id]:"sampleType",[dX.sectionNumber.id]:"sectionNumber",[dX.datasets.id]:"datasets"}),tY=Object.assign(Object.assign({},KX),{[dX.sampleType.id]:"sampleType",[dX.sectionCount.id]:"sectionCount",[dX.sectionSize.id]:"sectionSize",[dX.sectionUnits.id]:"sectionUnits",[dX.donor.id]:"donor",[dX.spatialEntity.id]:"spatialEntityId",[dX.sections.id]:"sections",[dX.datasets.id]:"datasets"});function eY(t,e){return lX(t,e,"Donor",QX)}function nY(t,e){return lX(t,e,"Dataset",ZX)}function iY(t,e){const n={"@id":e,"@type":"Sample",datasets:[]};for(const[i,r]of aX(t,e,JX))if("datasets"===i){const e=nY(t,r);n[i].push(e)}else n[i]=r;return n}class rY{constructor(t){this.database=t,this.connect()}toJson(){return{status:this.status,message:this.message,checkback:"Ready"===this.status||"Error"===this.status?36e5:2e3,loadTime:this.loadTime}}connect(){this.status="Loading",this.message="Loading database";const t=Date.now();return this.database.connect().then(t=>xw(this,void 0,void 0,function*(){t?(this.message="Building scene",yield this.database.getScene(),this.message="Building tissue block results",yield this.database.getTissueBlockResults(),this.message="Aggregating results",yield this.database.getAggregateResults(),this.status="Ready",this.message="Database successfully loaded"):(this.status="Error",this.message="Unknown error while loading database")})).catch(t=>{var e;this.status="Error",this.message=null!==(e=null==t?void 0:t.message)&&void 0!==e?e:"Unknown error while loading database"}).finally(()=>{this.loadTime=Date.now()-t})}}const sY={"@context":{"@base":"http://purl.org/ccf/","@vocab":"http://purl.org/ccf/",ccf:"http://purl.org/ccf/",rdfs:"http://www.w3.org/2000/01/rdf-schema#",dcterms:"http://purl.org/dc/terms/",label:"rdfs:label",description:"rdfs:comment",link:"ccf:url",sex:"ccf:sex",age:"ccf:age",bmi:"ccf:bmi",consortium_name:"ccf:consortium_name",provider_name:"ccf:tissue_provider_name",provider_uuid:"ccf:tissue_provider_uuid",donor:{"@id":"ccf:comes_from","@type":"@id"},samples:{"@reverse":"donor"},sections:{"@id":"ccf:subdivided_into_sections","@type":"@id"},datasets:{"@id":"ccf:generates_dataset","@type":"@id"},sample_type:"ccf:sample_type",section_count:"ccf:section_count",section_size:"ccf:section_size",section_units:"ccf:section_size_unit",section_number:"ccf:section_number",rui_location:{"@id":"ccf:has_registration_location","@type":"@id"},ccf_annotations:{"@id":"ccf:collides_with","@type":"@id","@container":"@set"},representation_of:{"@id":"ccf:representation_of","@type":"@id"},reference_organ:{"@id":"ccf:has_reference_organ","@type":"@id"},extraction_set_for:{"@id":"ccf:extraction_set_for","@type":"@id"},extraction_set:{"@id":"ccf:has_extraction_set","@type":"@id"},organ_owner_sex:"ccf:organ_owner_sex",side:"ccf:organ_side",rui_rank:"ccf:rui_rank",slice_thickness:"ccf:slice_thickness",slice_count:"ccf:slice_count",object:{"@id":"ccf:has_object_reference","@type":"@id"},creation_date:"dcterms:created",updated_date:"ccf:updated_date",creator:"dcterms:creator",creator_first_name:"ccf:creator_first_name",creator_last_name:"ccf:creator_last_name",placement:{"@reverse":"ccf:placement_for"},placement_date:"dcterms:created",rotation_order:"ccf:rotation_order",dimension_units:"ccf:dimension_unit",rotation_units:"ccf:rotation_unit",scaling_units:"ccf:scaling_unit",translation_units:"ccf:translation_unit",source:{"@id":"ccf:placement_for","@type":"@id"},target:{"@id":"ccf:placement_relative_to","@type":"@id"},x_rotation:"ccf:x_rotation",y_rotation:"ccf:y_rotation",z_rotation:"ccf:z_rotation",x_scaling:"ccf:x_scaling",y_scaling:"ccf:y_scaling",z_scaling:"ccf:z_scaling",x_translation:"ccf:x_translation",y_translation:"ccf:y_translation",z_translation:"ccf:z_translation",x_dimension:"ccf:x_dimension",y_dimension:"ccf:y_dimension",z_dimension:"ccf:z_dimension",ontology_terms:{"@id":"ccf:has_ontology_term","@type":"@id"},technology:"ccf:technology",thumbnail:"ccf:thumbnail",file:"ccf:file_url",file_format:"ccf:file_format",file_subpath:"ccf:file_subpath"}};function oY(t){return JSON.parse(t,(t,e)=>"ccf_annotations"===t&&Array.isArray(e)?e.map(t=>(null==t?void 0:t.startsWith("http://purl.obolibrary.org/obo/FMA_"))?t.replace("http://purl.obolibrary.org/obo/FMA_","http://purl.org/sig/ont/fma/fma"):t):"@context"!==t||!e||"https://hubmapconsortium.github.io/hubmap-ontology/ccf-entity-context.jsonld"!==e&&"https://hubmapconsortium.github.io/hubmap-ontology/ccf-context.jsonld"!==e&&"https://hubmapconsortium.github.io/ccf-ontology/ccf-context.jsonld"!==e&&"http://purl.org/ccf/latest/ccf-entity.owl#"!==e["@base"]?e:sY)}const aY={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 lY{constructor(t=aY){this.options=t,this.store=new aq.Store(void 0,{factory:aq.DataFactory}),this.graph=new CX(this),this.scene=new EX(this)}connect(t,e=!1){return xw(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 xw(this,void 0,void 0,function*(){const t=(new Date).getTime(),e="ccf-database.last_modified",n="ccf-database",i=yield oq(e).catch(()=>{});let r;i&&t-new Date(+i).getTime()>36e5?yield function(t,e=sq()){return e("readwrite",e=>(t.forEach(t=>e.delete(t)),iq(e.transaction)))}([n,e]).catch(()=>{}):r=yield oq(n).catch(()=>{}),r?yield this.deserialize(r):(yield this.doConnect(),function(t,e=sq()){return e("readwrite",e=>(t.forEach(t=>e.put(t[1],t[0])),iq(e.transaction)))}([[n,this.serialize()],[e,""+t]]).catch(()=>{}))})}doConnect(){var t,e;return xw(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.startsWith("{"))this.store=(0,aq.deserializeN3Store)(r,aq.DataFactory);else 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,aq.deserializeN3Store)(t,aq.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(LX(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 xw(this,void 0,void 0,function*(){const n=null!=e?e:this.store;return yield Promise.all(t.map(t=>xw(this,void 0,void 0,function*(){"string"==typeof t?(t.startsWith("http")||t.startsWith("assets/"))&&t.includes("jsonld")?(t=oY(t=yield fetch(t).then(t=>t.text())),yield(0,aq.addJsonLdToStore)(t,n)):t.endsWith("n3")?yield(0,aq.addN3ToStore)(t,n):t.endsWith("rdf")||t.endsWith("owl")||t.endsWith("xml")?yield(0,aq.addRdfXmlToStore)(t,n):(t=oY(t),yield(0,aq.addJsonLdToStore)(t,n)):(t=oY(JSON.stringify(t)),yield(0,aq.addJsonLdToStore)(t,n))}))),this})}synchronize(){return xw(this,void 0,void 0,function*(){return yield new Promise(t=>{setTimeout(t,500)}),this.graph.createGraph(),function(t){var e,n,i;const r=YX(t),s=new Map;for(const{subject:o,object:a}of(0,aq.readQuads)(t,null,pX.spatialEntity.representation_of,null,null)){const t=new Set([a.id]);let i=null===(e=r.nodes[a.id])||void 0===e?void 0:e.parent;for(;i&&!t.has(i);)t.add(i),i=null===(n=r.nodes[i])||void 0===n?void 0:n.parent;s.set(o.id,[...t].map(t=>aq.DataFactory.namedNode(t)))}for(const{object:o}of(0,aq.readQuads)(t,null,dX.spatialEntity,null,null))for(const{subject:e}of(0,aq.readQuads)(t,null,pX.spatialPlacement.source,o,null))for(const{object:n}of(0,aq.readQuads)(t,e,pX.spatialPlacement.target,null,null))for(const e of null!==(i=s.get(n.id))&&void 0!==i?i:[])t.addQuad(aq.DataFactory.namedNode(o.id),pX.spatialEntity.ccf_annotations,e)}(this.store),this})}serialize(){return(0,aq.serializeN3Store)(this.store)}deserialize(t){return xw(this,void 0,void 0,function*(){this.store=(0,aq.deserializeN3Store)(t,aq.DataFactory),this.graph=new CX(this),this.scene=new EX(this),yield new Promise(t=>{setTimeout(t,10)})})}getIds(t={}){return function(t,e,n){var i,r,s,o,a,l,c;let u=function(t){const e=new Set;return t.forSubjects(t=>e.add(t.id),dX.spatialEntity,null,null),e}(t);if(u.size>0&&(u=function(t,e,n=!0){const i=new Set;if(t.forSubjects(HX(e,i),dX.spatialEntity,null,null),!n){const t=new Set;return e.forEach(e=>i.has(e)?void 0:t.add(e)),t}return i}(t,u)),u.size>0&&("Male"===n.sex||"Female"===n.sex)){const e=n.sex;u=zX(t,u,n=>function(t,e,n){const i=new Set;return t.forSubjects(HX(e,i),dX.sex,dX[n],null),i}(t,n,e))}if(u.size>0&&(null===(i=n.tmc)||void 0===i?void 0:i.length)>0&&(u=zX(t,u,e=>function(t,e,n){const i=new Set;for(const r of n){const n=aq.DataFactory.literal(r);t.forSubjects(HX(e,i),dX.providerName,n,null)}return i}(t,e,n.tmc))),u.size>0&&(null===(r=n.technologies)||void 0===r?void 0:r.length)>0&&(u=function(t,e,n){var i,r;const s=new Map,o=new Set,a=new Set(e);for(const u of e)for(const e of(0,aq.readQuads)(t,u,dX.sections,null,null))a.add(e.object.id);for(const u of a)for(const e of(0,aq.readQuads)(t,u,dX.datasets,null,null))o.add(e.object.id),s.has(e.object.id)?null===(i=s.get(e.object.id))||void 0===i||i.push(u):s.set(e.object.id,[u]);const l=n(o),c=new Set;for(const u of l)for(const t of null!==(r=s.get(u))&&void 0!==r?r:[])c.add(t);return c}(t,u,e=>function(t,e,n){const i=new Set;for(const r of n){const n=aq.DataFactory.literal(r);t.forSubjects(HX(e,i),dX.technology,n,null)}return i}(t,e,n.technologies))),u.size>0&&(null===(s=n.spatialSearches)||void 0===s?void 0:s.length)>0&&(u=UX(t,u,i=>function(t,e,n,i){const r=new Set;for(const s of i)VX(t,e,n,s).forEach(t=>r.add(t));return r}(t,e,i,n.spatialSearches))),u.size>0&&(null===(o=n.ontologyTerms)||void 0===o?void 0:o.length)>0){const e=n.ontologyTerms;-1===e.indexOf(bX.body.id)&&(u=UX(t,u,n=>$X(t,n,e)))}if(u.size>0&&(null===(a=n.cellTypeTerms)||void 0===a?void 0:a.length)>0){const e=n.cellTypeTerms;-1===e.indexOf(bX.cell.id)&&(u=UX(t,u,n=>function(t,e,n){const i=new Set;for(const r of n)t.forObjects(t=>{i.add(t.id)},r,pX.asctb.located_in,null),r===bX.cell.id&&i.add(bX.body.id);return $X(t,e,[...i])}(t,n,e)))}if(u.size>0&&2===(null===(l=n.ageRange)||void 0===l?void 0:l.length)&&(0,gq.isFinite)(n.ageRange[0])&&(0,gq.isFinite)(n.ageRange[1])){const e=Math.max(...n.ageRange),i=Math.min(...n.ageRange);1===i&&110===e||(u=zX(t,u,n=>function(t,e,n,i){const r=new Set;for(const s of e)for(const e of(0,aq.readQuads)(t,s,dX.age,null,null)){const t=(0,Sq.fromRdf)(e.object);t>=n&&t<=i&&r.add(s)}return r}(t,n,i,e)))}if(u.size>0&&2===(null===(c=n.bmiRange)||void 0===c?void 0:c.length)&&(0,gq.isFinite)(n.bmiRange[0])&&(0,gq.isFinite)(n.bmiRange[1])){const e=Math.max(...n.bmiRange),i=Math.min(...n.bmiRange);13===i&&83===e||(u=zX(t,u,n=>function(t,e,n,i){const r=new Set;for(const s of e)for(const e of(0,aq.readQuads)(t,s,dX.bmi,null,null)){const t=(0,Sq.fromRdf)(e.object);t>=n&&t<=i&&r.add(s)}return r}(t,n,i,e)))}return u}(this.store,this.graph,t)}get(t){return this.store.getQuads(aq.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=>function(t,e){const n=t.getObjects(aq.DataFactory.namedNode(e),dX.spatialEntity,null);if(n.length>0)return wX(t,n[0].id)}(this.store,t))}getDatabaseStatus(){return xw(this,void 0,void 0,function*(){return this.status||(this.status=new rY(this)),this.status.toJson()})}getDatasetTechnologyNames(){return xw(this,void 0,void 0,function*(){return function(t){const e=new Set;for(const n of(0,aq.readQuads)(t,null,dX.technology,null,null))e.add(n.object.value);return Array.from(e).sort()}(this.store)})}getProviderNames(){return xw(this,void 0,void 0,function*(){return function(t){const e=new Set;for(const n of(0,aq.readQuads)(t,null,dX.providerName,null,null))e.add(n.object.value);return Array.from(e).sort()}(this.store)})}getTissueBlockResults(t){return xw(this,void 0,void 0,function*(){return t=Object.assign(Object.assign({},t),{hasSpatialEntity:!0}),[...this.getIds(t)].map(t=>function(t,e){const n={"@id":e,"@type":"Sample",sections:[],datasets:[]};for(const[i,r]of aX(t,e,tY))if("sections"===i){const e=iY(t,r);n[i].push(e)}else if("datasets"===i){const e=nY(t,r);n[i].push(e)}else n[i]="donor"===i?eY(t,r):r;return n}(this.store,t))})}getAggregateResults(t){return xw(this,void 0,void 0,function*(){return function(t,e){const n=jX(e,t,dX.donor.id),i=jX(e,n,dX.providerUUID.id),r=new Set;for(const a of t)for(const t of(0,aq.readQuads)(e,a,dX.spatialEntity,null,null))r.add(t.subject.id);const s=jX(e,r,dX.sections.id),o=new Set([...jX(e,r,dX.datasets.id),...jX(e,s,dX.datasets.id)]);return 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 xw(this,void 0,void 0,function*(){return function(t,e){const n={};return GX(t,e).forEach((t,e)=>{n[e]=t.size}),n}(this.getIds(t),this.store)})}getCellTypeTermOccurences(t){return xw(this,void 0,void 0,function*(){return function(t,e){var n,i;const r=GX(t,e),s=new Map;for(const a of r.keys()){const t=r.get(a);for(const n of(0,aq.readQuads)(e,null,pX.asctb.located_in,a,null)){const e=n.subject.id;if(s.has(e)){const n=s.get(e);t.forEach(t=>n.add(t))}else s.set(e,new Set(t))}}const o={};return s.forEach((t,e)=>{o[e]=t.size}),o[bX.cell.id]=null!==(i=null===(n=r.get(bX.body.id))||void 0===n?void 0:n.size)&&void 0!==i?i:0,o}(this.getIds(t),this.store)})}getOntologyTreeModel(){return xw(this,void 0,void 0,function*(){return YX(this.store)})}getCellTypeTreeModel(){return xw(this,void 0,void 0,function*(){return function(t){return qX(t,bX.cell.id,"cell",pX.asctb.ct_is_a.id)}(this.store)})}getReferenceOrgans(){return xw(this,void 0,void 0,function*(){return this.scene.getReferenceOrgans()})}getScene(t){return xw(this,void 0,void 0,function*(){return this.graph.createGraph(),this.scene.getScene(t)})}getReferenceOrganScene(t,e){return xw(this,void 0,void 0,function*(){return this.graph.createGraph(),this.scene.getReferenceOrganScene(t,e)})}getSpatialPlacement(t,e){return xw(this,void 0,void 0,function*(){return this.graph.getSpatialPlacement(t,e)})}}const cY=[240,183,98,255],uY=[213,0,0,255],hY=[29,204,101,255],dY=[41,121,255,255],pY=[204,204,204,255],fY=[213,0,0,255],gY=[29,204,101,255],mY=[41,121,255,255];function bY(t,e=!1){const n=t.x_dimension/1e3,i=t.y_dimension/1e3,r=t.z_dimension/1e3,s=.05*Math.max(n,i,r),o=.1*s;return[{"@id":"http://purl.org/ccf/latest/ccf.owl#OriginSphere","@type":"SpatialSceneNode",unpickable:!0,geometry:"sphere",transformMatrix:new VT(VT.IDENTITY).scale(s),color:pY},{"@id":"http://purl.org/ccf/latest/ccf.owl#OriginX","@type":"SpatialSceneNode",unpickable:!0,geometry:"cylinder",transformMatrix:new VT(VT.IDENTITY).translate([n/2,0,0]).rotateZ(ZS(-90)).scale([o,n,o]),color:fY},{"@id":"http://purl.org/ccf/latest/ccf.owl#OriginXCone","@type":"SpatialSceneNode",unpickable:!0,geometry:"cone",transformMatrix:new VT(VT.IDENTITY).translate([n,0,0]).rotateZ(ZS(-90)).scale([s,3*s,s]),color:fY},{"@id":"http://purl.org/ccf/latest/ccf.owl#OriginXALabel","@type":"SpatialSceneNode",unpickable:!0,geometry:"text",text:"A",transformMatrix:new VT(VT.IDENTITY).translate([2*-s,0,0]).scale(s),color:fY},{"@id":"http://purl.org/ccf/latest/ccf.owl#OriginXDLabel","@type":"SpatialSceneNode",unpickable:!0,geometry:"text",text:"D",transformMatrix:new VT(VT.IDENTITY).translate([n+2*s,0,0]).scale(s),color:fY},{"@id":"http://purl.org/ccf/latest/ccf.owl#OriginY","@type":"SpatialSceneNode",unpickable:!0,geometry:"cylinder",transformMatrix:new VT(VT.IDENTITY).translate([0,i/2,0]).scale([o,i,o]),color:gY},{"@id":"http://purl.org/ccf/latest/ccf.owl#OriginYCone","@type":"SpatialSceneNode",unpickable:!0,geometry:"cone",transformMatrix:new VT(VT.IDENTITY).translate([0,i,0]).scale([s,3*s,s]),color:gY},{"@id":"http://purl.org/ccf/latest/ccf.owl#OriginYSLabel","@type":"SpatialSceneNode",unpickable:!0,geometry:"text",text:"S",transformMatrix:new VT(VT.IDENTITY).translate([1.5*s,1.5*s,0]).scale(s),color:gY},{"@id":"http://purl.org/ccf/latest/ccf.owl#OriginYWLabel","@type":"SpatialSceneNode",unpickable:!0,geometry:"text",text:"W",transformMatrix:new VT(VT.IDENTITY).translate([0,i+2*s,0]).scale(s),color:gY},{"@id":"http://purl.org/ccf/latest/ccf.owl#OriginZ","@type":"SpatialSceneNode",unpickable:!0,geometry:"cylinder",transformMatrix:new VT(VT.IDENTITY).translate([0,0,r/2]).rotateX(ZS(90)).scale([o,r,o]),color:mY},{"@id":"http://purl.org/ccf/latest/ccf.owl#OriginZCone","@type":"SpatialSceneNode",unpickable:!0,geometry:"cone",transformMatrix:new VT(VT.IDENTITY).translate([0,0,r]).rotateX(ZS(90)).scale([s,3*s,s]),color:mY},{"@id":"http://purl.org/ccf/latest/ccf.owl#OriginZQLabel","@type":"SpatialSceneNode",unpickable:!0,geometry:"text",text:"Q",transformMatrix:new VT(VT.IDENTITY).translate([1.5*s,1.5*-s,0]).scale(s),color:mY},{"@id":"http://purl.org/ccf/latest/ccf.owl#OriginZELabel","@type":"SpatialSceneNode",unpickable:!0,geometry:"text",text:"E",transformMatrix:new VT(VT.IDENTITY).translate([0,0,r+2*s]).scale(s),color:mY}].filter(t=>e&&"text"===t.geometry&&t.text||!t.text)}const yY=Symbol("Comlink.proxy"),vY=Symbol("Comlink.endpoint"),_Y=Symbol("Comlink.releaseProxy"),wY=Symbol("Comlink.thrown"),xY=t=>"object"==typeof t&&null!==t||"function"==typeof t,SY=new Map([["proxy",{canHandle:t=>xY(t)&&t[yY],serialize(t){const{port1:e,port2:n}=new MessageChannel;return CY(t,e),[n,[n]]},deserialize:t=>(t.start(),OY(t))}],["throw",{canHandle:t=>xY(t)&&wY 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 CY(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(DY);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]]=DY(i.data.value),l=!0;break;case"APPLY":l=n.apply(e,a);break;case"CONSTRUCT":l=function(t){return Object.assign(t,{[yY]:!0})}(new n(...a));break;case"ENDPOINT":{const{port1:e,port2:n}=new MessageChannel;CY(t,n),l=function(t,e){return MY.set(t,e),t}(e,[e])}break;case"RELEASE":l=void 0;break;default:return}}catch(c){l={value:c,[wY]:0}}Promise.resolve(l).catch(t=>({value:t,[wY]:0})).then(t=>{const[i,o]=IY(t);e.postMessage(Object.assign(Object.assign({},i),{id:r}),o),"RELEASE"===s&&(e.removeEventListener("message",n),EY(e))})}),e.start&&e.start()}function EY(t){(function(t){return"MessagePort"===t.constructor.name})(t)&&t.close()}function OY(t,e){return kY(t,[],e)}function TY(t){if(t)throw new Error("Proxy has been released and is not useable")}function kY(t,e=[],n=function(){}){let i=!1;const r=new Proxy(n,{get(n,s){if(TY(i),s===_Y)return()=>RY(t,{type:"RELEASE",path:e.map(t=>t.toString())}).then(()=>{EY(t),i=!0});if("then"===s){if(0===e.length)return{then:()=>r};const n=RY(t,{type:"GET",path:e.map(t=>t.toString())}).then(DY);return n.then.bind(n)}return kY(t,[...e,s])},set(n,r,s){TY(i);const[o,a]=IY(s);return RY(t,{type:"SET",path:[...e,r].map(t=>t.toString()),value:o},a).then(DY)},apply(n,r,s){TY(i);const o=e[e.length-1];if(o===vY)return RY(t,{type:"ENDPOINT"}).then(DY);if("bind"===o)return kY(t,e.slice(0,-1));const[a,l]=AY(s);return RY(t,{type:"APPLY",path:e.map(t=>t.toString()),argumentList:a},l).then(DY)},construct(n,r){TY(i);const[s,o]=AY(r);return RY(t,{type:"CONSTRUCT",path:e.map(t=>t.toString()),argumentList:s},o).then(DY)}});return r}function PY(t){return Array.prototype.concat.apply([],t)}function AY(t){const e=t.map(IY);return[e.map(t=>t[0]),PY(e.map(t=>t[1]))]}const MY=new WeakMap;function IY(t){for(const[e,n]of SY)if(n.canHandle(t)){const[i,r]=n.serialize(t);return[{type:"HANDLER",name:e,value:i},r]}return[{type:"RAW",value:t},MY.get(t)||[]]}function DY(t){switch(t.type){case"HANDLER":return SY.get(t.name).deserialize(t.value);case"RAW":return t.value}}function RY(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)})}class NY extends Error{constructor(){super(...arguments),this.message="NgxsDispatchPluginModule is not imported"}}let LY=null;function jY(t){LY=t}function FY(){if(null===LY)throw new NY;return LY.get(qz)}function BY(){if(null===LY)throw new NY;return LY.get(Tu)}function VY(t,e,n){e.run(()=>t.dispatch(n))}function zY(t,e,n,i){return ha(n)?function(t,e,n){return n.then(n=>(VY(t,e,n),n))}(t,e,n):Gd(n)?function(t,e,n,i){return null!==i&&(n=n.pipe(rp(i.cancelUncompleted$))),n.subscribe({next:n=>VY(t,e,n)}),n}(t,e,n,i):(VY(t,e,n),n)}class UY{constructor(){this.cancelUncompleted$=new A}cancelPreviousAction(){this.cancelUncompleted$.next()}}const HY="\u0275fac",$Y=Symbol("InjectorInstance"),GY=Symbol("FactoryHasBeenDecorated");function WY(t,e){const n=t[$Y];return n?n.get(e):null}const qY={cancelUncompleted:!1};function XY(t=qY){return(e,n,i)=>{let r;const s=function(t){return t?new UY:null}(t.cancelUncompleted);function o(){null!==s&&s.cancelPreviousAction();const t=WY(this,qz)||FY(),e=WY(this,Tu)||BY(),n=r.apply(this,arguments);return e.runOutsideAngular(()=>zY(t,e,n,s))}"function"==typeof(null==i?void 0:i.value)?(r=i.value,i.value=o):Object.defineProperty(e,n,{set:t=>r=t,get:()=>o}),function(t){if(GY in t.constructor.prototype)return;const e=t.constructor;"function"==typeof e[HY]&&function(t){const e=t[HY];if("function"!=typeof e)return;const n=t.\u0275prov||t.\u0275pipe||t.\u0275cmp||t.\u0275dir,i=()=>{const t=e();return t[$Y]=ea(_o),t};n&&(n.factory=i),Object.defineProperty(t,HY,{get:()=>i})}(e),t.constructor.prototype[GY]=!0}(e)}}let YY=(()=>{class t{constructor(t){jY(t.injector),t.onDestroy(()=>{jY(null)})}static forRoot(){return{ngModule:t}}}return t.\u0275fac=function(e){return new(e||t)(Ei(hc))},t.\u0275mod=ie({type:t}),t.\u0275inj=St({}),t})(),KY=(()=>{class t{constructor(){this._vertical=!1,this._inset=!1}get vertical(){return this._vertical}set vertical(t){this._vertical=kd(t)}get inset(){return this._inset}set inset(t){this._inset=kd(t)}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Jt({type:t,selectors:[["mat-divider"]],hostAttrs:["role","separator",1,"mat-divider"],hostVars:7,hostBindings:function(t,e){2&t&&(Ko("aria-orientation",e.vertical?"vertical":"horizontal"),ja("mat-divider-vertical",e.vertical)("mat-divider-horizontal",!e.vertical)("mat-divider-inset",e.inset))},inputs:{vertical:"vertical",inset:"inset"},decls:0,vars:0,template:function(t,e){},styles:[".mat-divider{display:block;margin:0;border-top-width:1px;border-top-style:solid}.mat-divider.mat-divider-vertical{border-top:0;border-right-width:1px;border-right-style:solid}.mat-divider.mat-divider-inset{margin-left:80px}[dir=rtl] .mat-divider.mat-divider-inset{margin-left:auto;margin-right:80px}\n"],encapsulation:2,changeDetection:0}),t})(),QY=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Wy],Wy]}),t})();const ZY=["*"],JY=[[["","mat-list-avatar",""],["","mat-list-icon",""],["","matListAvatar",""],["","matListIcon",""]],[["","mat-line",""],["","matLine",""]],"*"],tK=["[mat-list-avatar], [mat-list-icon], [matListAvatar], [matListIcon]","[mat-line], [matLine]","*"],eK=qy(Yy(class{})),nK=Yy(class{}),iK=new oi("MatList"),rK=new oi("MatNavList");let sK=(()=>{class t extends eK{constructor(t){super(),this._elementRef=t,this._stateChanges=new A,"action-list"===this._getListType()&&t.nativeElement.classList.add("mat-action-list")}_getListType(){const t=this._elementRef.nativeElement.nodeName.toLowerCase();return"mat-list"===t?"list":"mat-action-list"===t?"action-list":null}ngOnChanges(){this._stateChanges.next()}ngOnDestroy(){this._stateChanges.complete()}}return t.\u0275fac=function(e){return new(e||t)(ea(Al))},t.\u0275cmp=Jt({type:t,selectors:[["mat-list"],["mat-action-list"]],hostAttrs:[1,"mat-list","mat-list-base"],inputs:{disableRipple:"disableRipple",disabled:"disabled"},exportAs:["matList"],features:[xl([{provide:iK,useExisting:t}]),jo,ye],ngContentSelectors:ZY,decls:1,vars:0,template:function(t,e){1&t&&(wa(),xa(0))},styles:['.mat-subheader{display:flex;box-sizing:border-box;padding:16px;align-items:center}.mat-list-base .mat-subheader{margin:0}.mat-list-base{padding-top:8px;display:block;-webkit-tap-highlight-color:transparent}.mat-list-base .mat-subheader{height:48px;line-height:16px}.mat-list-base .mat-subheader:first-child{margin-top:-8px}.mat-list-base .mat-list-item,.mat-list-base .mat-list-option{display:block;height:48px;-webkit-tap-highlight-color:transparent;width:100%;padding:0}.mat-list-base .mat-list-item .mat-list-item-content,.mat-list-base .mat-list-option .mat-list-item-content{display:flex;flex-direction:row;align-items:center;box-sizing:border-box;padding:0 16px;position:relative;height:inherit}.mat-list-base .mat-list-item .mat-list-item-content-reverse,.mat-list-base .mat-list-option .mat-list-item-content-reverse{display:flex;align-items:center;padding:0 16px;flex-direction:row-reverse;justify-content:space-around}.mat-list-base .mat-list-item .mat-list-item-ripple,.mat-list-base .mat-list-option .mat-list-item-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none}.mat-list-base .mat-list-item.mat-list-item-with-avatar,.mat-list-base .mat-list-option.mat-list-item-with-avatar{height:56px}.mat-list-base .mat-list-item.mat-2-line,.mat-list-base .mat-list-option.mat-2-line{height:72px}.mat-list-base .mat-list-item.mat-3-line,.mat-list-base .mat-list-option.mat-3-line{height:88px}.mat-list-base .mat-list-item.mat-multi-line,.mat-list-base .mat-list-option.mat-multi-line{height:auto}.mat-list-base .mat-list-item.mat-multi-line .mat-list-item-content,.mat-list-base .mat-list-option.mat-multi-line .mat-list-item-content{padding-top:16px;padding-bottom:16px}.mat-list-base .mat-list-item .mat-list-text,.mat-list-base .mat-list-option .mat-list-text{display:flex;flex-direction:column;flex:auto;box-sizing:border-box;overflow:hidden;padding:0}.mat-list-base .mat-list-item .mat-list-text>*,.mat-list-base .mat-list-option .mat-list-text>*{margin:0;padding:0;font-weight:normal;font-size:inherit}.mat-list-base .mat-list-item .mat-list-text:empty,.mat-list-base .mat-list-option .mat-list-text:empty{display:none}.mat-list-base .mat-list-item.mat-list-item-with-avatar .mat-list-item-content .mat-list-text,.mat-list-base .mat-list-item.mat-list-option .mat-list-item-content .mat-list-text,.mat-list-base .mat-list-option.mat-list-item-with-avatar .mat-list-item-content .mat-list-text,.mat-list-base .mat-list-option.mat-list-option .mat-list-item-content .mat-list-text{padding-right:0;padding-left:16px}[dir=rtl] .mat-list-base .mat-list-item.mat-list-item-with-avatar .mat-list-item-content .mat-list-text,[dir=rtl] .mat-list-base .mat-list-item.mat-list-option .mat-list-item-content .mat-list-text,[dir=rtl] .mat-list-base .mat-list-option.mat-list-item-with-avatar .mat-list-item-content .mat-list-text,[dir=rtl] .mat-list-base .mat-list-option.mat-list-option .mat-list-item-content .mat-list-text{padding-right:16px;padding-left:0}.mat-list-base .mat-list-item.mat-list-item-with-avatar .mat-list-item-content-reverse .mat-list-text,.mat-list-base .mat-list-item.mat-list-option .mat-list-item-content-reverse .mat-list-text,.mat-list-base .mat-list-option.mat-list-item-with-avatar .mat-list-item-content-reverse .mat-list-text,.mat-list-base .mat-list-option.mat-list-option .mat-list-item-content-reverse .mat-list-text{padding-left:0;padding-right:16px}[dir=rtl] .mat-list-base .mat-list-item.mat-list-item-with-avatar .mat-list-item-content-reverse .mat-list-text,[dir=rtl] .mat-list-base .mat-list-item.mat-list-option .mat-list-item-content-reverse .mat-list-text,[dir=rtl] .mat-list-base .mat-list-option.mat-list-item-with-avatar .mat-list-item-content-reverse .mat-list-text,[dir=rtl] .mat-list-base .mat-list-option.mat-list-option .mat-list-item-content-reverse .mat-list-text{padding-right:0;padding-left:16px}.mat-list-base .mat-list-item.mat-list-item-with-avatar.mat-list-option .mat-list-item-content-reverse .mat-list-text,.mat-list-base .mat-list-item.mat-list-item-with-avatar.mat-list-option .mat-list-item-content .mat-list-text,.mat-list-base .mat-list-option.mat-list-item-with-avatar.mat-list-option .mat-list-item-content-reverse .mat-list-text,.mat-list-base .mat-list-option.mat-list-item-with-avatar.mat-list-option .mat-list-item-content .mat-list-text{padding-right:16px;padding-left:16px}.mat-list-base .mat-list-item .mat-list-avatar,.mat-list-base .mat-list-option .mat-list-avatar{flex-shrink:0;width:40px;height:40px;border-radius:50%;object-fit:cover}.mat-list-base .mat-list-item .mat-list-avatar~.mat-divider-inset,.mat-list-base .mat-list-option .mat-list-avatar~.mat-divider-inset{margin-left:72px;width:calc(100% - 72px)}[dir=rtl] .mat-list-base .mat-list-item .mat-list-avatar~.mat-divider-inset,[dir=rtl] .mat-list-base .mat-list-option .mat-list-avatar~.mat-divider-inset{margin-left:auto;margin-right:72px}.mat-list-base .mat-list-item .mat-list-icon,.mat-list-base .mat-list-option .mat-list-icon{flex-shrink:0;width:24px;height:24px;font-size:24px;box-sizing:content-box;border-radius:50%;padding:4px}.mat-list-base .mat-list-item .mat-list-icon~.mat-divider-inset,.mat-list-base .mat-list-option .mat-list-icon~.mat-divider-inset{margin-left:64px;width:calc(100% - 64px)}[dir=rtl] .mat-list-base .mat-list-item .mat-list-icon~.mat-divider-inset,[dir=rtl] .mat-list-base .mat-list-option .mat-list-icon~.mat-divider-inset{margin-left:auto;margin-right:64px}.mat-list-base .mat-list-item .mat-divider,.mat-list-base .mat-list-option .mat-divider{position:absolute;bottom:0;left:0;width:100%;margin:0}[dir=rtl] .mat-list-base .mat-list-item .mat-divider,[dir=rtl] .mat-list-base .mat-list-option .mat-divider{margin-left:auto;margin-right:0}.mat-list-base .mat-list-item .mat-divider.mat-divider-inset,.mat-list-base .mat-list-option .mat-divider.mat-divider-inset{position:absolute}.mat-list-base[dense]{padding-top:4px;display:block}.mat-list-base[dense] .mat-subheader{height:40px;line-height:8px}.mat-list-base[dense] .mat-subheader:first-child{margin-top:-4px}.mat-list-base[dense] .mat-list-item,.mat-list-base[dense] .mat-list-option{display:block;height:40px;-webkit-tap-highlight-color:transparent;width:100%;padding:0}.mat-list-base[dense] .mat-list-item .mat-list-item-content,.mat-list-base[dense] .mat-list-option .mat-list-item-content{display:flex;flex-direction:row;align-items:center;box-sizing:border-box;padding:0 16px;position:relative;height:inherit}.mat-list-base[dense] .mat-list-item .mat-list-item-content-reverse,.mat-list-base[dense] .mat-list-option .mat-list-item-content-reverse{display:flex;align-items:center;padding:0 16px;flex-direction:row-reverse;justify-content:space-around}.mat-list-base[dense] .mat-list-item .mat-list-item-ripple,.mat-list-base[dense] .mat-list-option .mat-list-item-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none}.mat-list-base[dense] .mat-list-item.mat-list-item-with-avatar,.mat-list-base[dense] .mat-list-option.mat-list-item-with-avatar{height:48px}.mat-list-base[dense] .mat-list-item.mat-2-line,.mat-list-base[dense] .mat-list-option.mat-2-line{height:60px}.mat-list-base[dense] .mat-list-item.mat-3-line,.mat-list-base[dense] .mat-list-option.mat-3-line{height:76px}.mat-list-base[dense] .mat-list-item.mat-multi-line,.mat-list-base[dense] .mat-list-option.mat-multi-line{height:auto}.mat-list-base[dense] .mat-list-item.mat-multi-line .mat-list-item-content,.mat-list-base[dense] .mat-list-option.mat-multi-line .mat-list-item-content{padding-top:16px;padding-bottom:16px}.mat-list-base[dense] .mat-list-item .mat-list-text,.mat-list-base[dense] .mat-list-option .mat-list-text{display:flex;flex-direction:column;flex:auto;box-sizing:border-box;overflow:hidden;padding:0}.mat-list-base[dense] .mat-list-item .mat-list-text>*,.mat-list-base[dense] .mat-list-option .mat-list-text>*{margin:0;padding:0;font-weight:normal;font-size:inherit}.mat-list-base[dense] .mat-list-item .mat-list-text:empty,.mat-list-base[dense] .mat-list-option .mat-list-text:empty{display:none}.mat-list-base[dense] .mat-list-item.mat-list-item-with-avatar .mat-list-item-content .mat-list-text,.mat-list-base[dense] .mat-list-item.mat-list-option .mat-list-item-content .mat-list-text,.mat-list-base[dense] .mat-list-option.mat-list-item-with-avatar .mat-list-item-content .mat-list-text,.mat-list-base[dense] .mat-list-option.mat-list-option .mat-list-item-content .mat-list-text{padding-right:0;padding-left:16px}[dir=rtl] .mat-list-base[dense] .mat-list-item.mat-list-item-with-avatar .mat-list-item-content .mat-list-text,[dir=rtl] .mat-list-base[dense] .mat-list-item.mat-list-option .mat-list-item-content .mat-list-text,[dir=rtl] .mat-list-base[dense] .mat-list-option.mat-list-item-with-avatar .mat-list-item-content .mat-list-text,[dir=rtl] .mat-list-base[dense] .mat-list-option.mat-list-option .mat-list-item-content .mat-list-text{padding-right:16px;padding-left:0}.mat-list-base[dense] .mat-list-item.mat-list-item-with-avatar .mat-list-item-content-reverse .mat-list-text,.mat-list-base[dense] .mat-list-item.mat-list-option .mat-list-item-content-reverse .mat-list-text,.mat-list-base[dense] .mat-list-option.mat-list-item-with-avatar .mat-list-item-content-reverse .mat-list-text,.mat-list-base[dense] .mat-list-option.mat-list-option .mat-list-item-content-reverse .mat-list-text{padding-left:0;padding-right:16px}[dir=rtl] .mat-list-base[dense] .mat-list-item.mat-list-item-with-avatar .mat-list-item-content-reverse .mat-list-text,[dir=rtl] .mat-list-base[dense] .mat-list-item.mat-list-option .mat-list-item-content-reverse .mat-list-text,[dir=rtl] .mat-list-base[dense] .mat-list-option.mat-list-item-with-avatar .mat-list-item-content-reverse .mat-list-text,[dir=rtl] .mat-list-base[dense] .mat-list-option.mat-list-option .mat-list-item-content-reverse .mat-list-text{padding-right:0;padding-left:16px}.mat-list-base[dense] .mat-list-item.mat-list-item-with-avatar.mat-list-option .mat-list-item-content-reverse .mat-list-text,.mat-list-base[dense] .mat-list-item.mat-list-item-with-avatar.mat-list-option .mat-list-item-content .mat-list-text,.mat-list-base[dense] .mat-list-option.mat-list-item-with-avatar.mat-list-option .mat-list-item-content-reverse .mat-list-text,.mat-list-base[dense] .mat-list-option.mat-list-item-with-avatar.mat-list-option .mat-list-item-content .mat-list-text{padding-right:16px;padding-left:16px}.mat-list-base[dense] .mat-list-item .mat-list-avatar,.mat-list-base[dense] .mat-list-option .mat-list-avatar{flex-shrink:0;width:36px;height:36px;border-radius:50%;object-fit:cover}.mat-list-base[dense] .mat-list-item .mat-list-avatar~.mat-divider-inset,.mat-list-base[dense] .mat-list-option .mat-list-avatar~.mat-divider-inset{margin-left:68px;width:calc(100% - 68px)}[dir=rtl] .mat-list-base[dense] .mat-list-item .mat-list-avatar~.mat-divider-inset,[dir=rtl] .mat-list-base[dense] .mat-list-option .mat-list-avatar~.mat-divider-inset{margin-left:auto;margin-right:68px}.mat-list-base[dense] .mat-list-item .mat-list-icon,.mat-list-base[dense] .mat-list-option .mat-list-icon{flex-shrink:0;width:20px;height:20px;font-size:20px;box-sizing:content-box;border-radius:50%;padding:4px}.mat-list-base[dense] .mat-list-item .mat-list-icon~.mat-divider-inset,.mat-list-base[dense] .mat-list-option .mat-list-icon~.mat-divider-inset{margin-left:60px;width:calc(100% - 60px)}[dir=rtl] .mat-list-base[dense] .mat-list-item .mat-list-icon~.mat-divider-inset,[dir=rtl] .mat-list-base[dense] .mat-list-option .mat-list-icon~.mat-divider-inset{margin-left:auto;margin-right:60px}.mat-list-base[dense] .mat-list-item .mat-divider,.mat-list-base[dense] .mat-list-option .mat-divider{position:absolute;bottom:0;left:0;width:100%;margin:0}[dir=rtl] .mat-list-base[dense] .mat-list-item .mat-divider,[dir=rtl] .mat-list-base[dense] .mat-list-option .mat-divider{margin-left:auto;margin-right:0}.mat-list-base[dense] .mat-list-item .mat-divider.mat-divider-inset,.mat-list-base[dense] .mat-list-option .mat-divider.mat-divider-inset{position:absolute}.mat-nav-list a{text-decoration:none;color:inherit}.mat-nav-list .mat-list-item{cursor:pointer;outline:none}mat-action-list button{background:none;color:inherit;border:none;font:inherit;outline:inherit;-webkit-tap-highlight-color:transparent;text-align:left}[dir=rtl] mat-action-list button{text-align:right}mat-action-list button::-moz-focus-inner{border:0}mat-action-list .mat-list-item{cursor:pointer;outline:inherit}.mat-list-option:not(.mat-list-item-disabled){cursor:pointer;outline:none}.mat-list-item-disabled{pointer-events:none}.cdk-high-contrast-active .mat-list-item-disabled{opacity:.5}.cdk-high-contrast-active :host .mat-list-item-disabled{opacity:.5}.cdk-high-contrast-active .mat-selection-list:focus{outline-style:dotted}.cdk-high-contrast-active .mat-list-option:hover,.cdk-high-contrast-active .mat-list-option:focus,.cdk-high-contrast-active .mat-nav-list .mat-list-item:hover,.cdk-high-contrast-active .mat-nav-list .mat-list-item:focus,.cdk-high-contrast-active mat-action-list .mat-list-item:hover,.cdk-high-contrast-active mat-action-list .mat-list-item:focus{outline:dotted 1px}.cdk-high-contrast-active .mat-list-single-selected-option::after{content:"";position:absolute;top:50%;right:16px;transform:translateY(-50%);width:10px;height:0;border-bottom:solid 10px;border-radius:10px}.cdk-high-contrast-active [dir=rtl] .mat-list-single-selected-option::after{right:auto;left:16px}@media(hover: none){.mat-list-option:not(.mat-list-single-selected-option):not(.mat-list-item-disabled):hover,.mat-nav-list .mat-list-item:not(.mat-list-item-disabled):hover,.mat-action-list .mat-list-item:not(.mat-list-item-disabled):hover{background:none}}\n'],encapsulation:2,changeDetection:0}),t})(),oK=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275dir=se({type:t,selectors:[["","mat-list-avatar",""],["","matListAvatar",""]],hostAttrs:[1,"mat-list-avatar"]}),t})(),aK=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275dir=se({type:t,selectors:[["","mat-list-icon",""],["","matListIcon",""]],hostAttrs:[1,"mat-list-icon"]}),t})(),lK=(()=>{class t extends nK{constructor(t,e,n,i){super(),this._element=t,this._isInteractiveList=!1,this._destroyed=new A,this._disabled=!1,this._isInteractiveList=!!(n||i&&"action-list"===i._getListType()),this._list=n||i;const r=this._getHostElement();"button"===r.nodeName.toLowerCase()&&!r.hasAttribute("type")&&r.setAttribute("type","button"),this._list&&this._list._stateChanges.pipe(rp(this._destroyed)).subscribe(()=>{e.markForCheck()})}get disabled(){return this._disabled||!(!this._list||!this._list.disabled)}set disabled(t){this._disabled=kd(t)}ngAfterContentInit(){!function(t,e,n="mat"){t.changes.pipe(lp(t)).subscribe(({length:t})=>{tv(e,`${n}-2-line`,!1),tv(e,`${n}-3-line`,!1),tv(e,`${n}-multi-line`,!1),2===t||3===t?tv(e,`${n}-${t}-line`,!0):t>3&&tv(e,`${n}-multi-line`,!0)})}(this._lines,this._element)}ngOnDestroy(){this._destroyed.next(),this._destroyed.complete()}_isRippleDisabled(){return!this._isInteractiveList||this.disableRipple||!(!this._list||!this._list.disableRipple)}_getHostElement(){return this._element.nativeElement}}return t.\u0275fac=function(e){return new(e||t)(ea(Al),ea(nc),ea(rK,8),ea(iK,8))},t.\u0275cmp=Jt({type:t,selectors:[["mat-list-item"],["a","mat-list-item",""],["button","mat-list-item",""]],contentQueries:function(t,e,n){if(1&t&&(Jc(n,oK,5),Jc(n,aK,5),Jc(n,Jy,5)),2&t){let t;Qc(t=tu())&&(e._avatar=t.first),Qc(t=tu())&&(e._icon=t.first),Qc(t=tu())&&(e._lines=t)}},hostAttrs:[1,"mat-list-item","mat-focus-indicator"],hostVars:6,hostBindings:function(t,e){2&t&&ja("mat-list-item-disabled",e.disabled)("mat-list-item-avatar",e._avatar||e._icon)("mat-list-item-with-avatar",e._avatar||e._icon)},inputs:{disableRipple:"disableRipple",disabled:"disabled"},exportAs:["matListItem"],features:[jo],ngContentSelectors:tK,decls:6,vars:2,consts:[[1,"mat-list-item-content"],["mat-ripple","",1,"mat-list-item-ripple",3,"matRippleTrigger","matRippleDisabled"],[1,"mat-list-text"]],template:function(t,e){1&t&&(wa(JY),ra(0,"div",0),oa(1,"div",1),xa(2),ra(3,"div",2),xa(4,1),sa(),xa(5,2),sa()),2&t&&(ws(1),na("matRippleTrigger",e._getHostElement())("matRippleDisabled",e._isRippleDisabled()))},directives:[cv],encapsulation:2,changeDetection:0}),t})(),cK=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[ev,uv,Wy,dv,Wh],ev,Wy,dv,QY]}),t})();const uK=["input"],hK=function(t){return{enterDuration:t}},dK=["*"],pK=new oi("mat-checkbox-default-options",{providedIn:"root",factory:fK});function fK(){return{color:"accent",clickAction:"check-indeterminate"}}let gK=0;const mK=fK(),bK={provide:aU,useExisting:pt(()=>_K),multi:!0};class yK{}const vK=Ky(Xy(Yy(qy(class{constructor(t){this._elementRef=t}}))));let _K=(()=>{class t extends vK{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-"+ ++gK,this.id=this._uniqueId,this.labelPosition="after",this.name=null,this.change=new Bc,this.indeterminateChange=new Bc,this._onTouched=()=>{},this._currentAnimationClass="",this._currentCheckState=0,this._controlValueAccessorChangeFn=()=>{},this._checked=!1,this._disabled=!1,this._indeterminate=!1,this._options=this._options||mK,this.color=this.defaultColor=this._options.color||mK.color,this.tabIndex=parseInt(r)||0}get inputId(){return`${this.id||this._uniqueId}-input`}get required(){return this._required}set required(t){this._required=kd(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=kd(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=kd(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 yK;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(Al),ea(nc),ea(Ug),ea(Tu),ii("tabindex"),ea(Ny,8),ea(pK,8))},t.\u0275cmp=Jt({type:t,selectors:[["mat-checkbox"]],viewQuery:function(t,e){if(1&t&&(Zc(uK,5),Zc(cv,5)),2&t){let t;Qc(t=tu())&&(e._inputElement=t.first),Qc(t=tu())&&(e.ripple=t.first)}},hostAttrs:[1,"mat-checkbox"],hostVars:12,hostBindings:function(t,e){2&t&&(rl("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:[xl([bK]),jo],ngContentSelectors:dK,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),Ja(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",Pc(19,hK,"NoopAnimations"===e._animationMode?0:150))}},directives:[cv,pg],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})(),wK=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({}),t})(),xK=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[uv,Wy,fg,wK],Wy,wK]}),t})();const SK=["bodyCanvas"];let CK=(()=>{class t{constructor(){this.clsName="ccf-body-ui",this.rotationChange=new Bc,this.nodeDrag=new Bc,this.nodeClick=new Bc,this.nodeHoverStart=new Bc,this.nodeHoverStop=new Bc,this.initialized=new Bc,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 xw(this,void 0,void 0,function*(){const e=this.bodyCanvas.nativeElement,n=new BV({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.target&&this.bodyUI.setTarget(this.target),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))],this.initialized.emit()})}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&&Zc(SK,5,Al),2&t){let t;Qc(t=tu())&&(e.bodyCanvas=t.first)}},hostVars:2,hostBindings:function(t,e){2&t&&Va(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",initialized:"initialized"},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})(),EK=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Wh]]}),t})();new oi("Maximum number of autocomplete options displayed",{providedIn:"root",factory:()=>10});const OK=["carouselContainer"],TK=["itemlist"],kK=["itemcontainer"];function PK(t,e){if(1&t){const t=ua();ra(0,"mat-icon",9),fa("touchstart",function(){return $e(t),va().scroll("left")})("touchend",function(){return $e(t),va().stopScroll()})("click",function(){return $e(t),va().shift("left")})("mousedown",function(){return $e(t),va().scroll("left")})("mouseup",function(){return $e(t),va().stopScroll()}),Ja(1,"chevron_left"),sa()}2&t&&ja("disabled",va().onLeft)}function AK(t,e){if(1&t&&(ra(0,"div",15),Ja(1),sa()),2&t){const t=va().$implicit,e=va();ws(1),tl(e.occurenceData[t.id]||0)}}function MK(t,e){if(1&t){const t=ua();ra(0,"div",10),fa("click",function(){const e=$e(t).$implicit;return va().selectOrgan(e)}),oa(1,"mat-icon",11),ra(2,"div",12),ra(3,"div",13),Ja(4),sa(),Jo(5,AK,2,1,"div",14),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),tl(t.name),ws(1),na("ngIf",void 0!==t.numResults)}}function IK(t,e){if(1&t){const t=ua();ra(0,"mat-icon",16),fa("touchstart",function(){return $e(t),va().scroll("right")})("touchend",function(){return $e(t),va().stopScroll()})("click",function(){return $e(t),va().shift("right")})("mousedown",function(){return $e(t),va().scroll("right")})("mouseup",function(){return $e(t),va().stopScroll()}),Ja(1,"chevron_right"),sa()}2&t&&ja("disabled",va().onRight)}const DK=[{src:"app:skin",organ:"Skin",name:"Skin",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002097"},{src:"app:brain",organ:"Brain",name:"Brain",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000955"},{disabled:!0,src:"app:lymph-nodes",organ:"Lymph Node",name:"Lymph Node",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000029"},{src:"app:lymph-nodes",organ:"Lymph Node",name:"Lymph Node",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002509"},{disabled:!0,src:"app:eye",organ:"Eye",name:"Eye, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000970"},{src:"app:eye",organ:"Eye",name:"Eye, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0004548"},{src:"app:eye",organ:"Eye",name:"Eye, R",side:"right",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0004549"},{disabled:!0,src:"app:fallopian-tube-left",organ:"Fallopian Tube",name:"Fallopian Tube, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0003889"},{src:"app:fallopian-tube-left",organ:"Fallopian Tube",name:"Fallopian Tube, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0001303"},{src:"app:fallopian-tube-right",organ:"Fallopian Tube",name:"Fallopian Tube, R",side:"right",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0001302"},{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, L",side:"left",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"},{disabled:!0,src:"app:knee",organ:"Knee",name:"Knee, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001465"},{src:"app:knee",organ:"Knee",name:"Knee, L",side:"left",hasSex:!0,id:"http://purl.org/sig/ont/fma/fma24978"},{src:"app:knee",organ:"Knee",name:"Knee, R",side:"right",hasSex:!0,id:"http://purl.org/sig/ont/fma/fma24977"},{src:"app:liver",organ:"Liver",name:"Liver",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002107"},{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"},{disabled:!0,src:"app:mammary-gland",organ:"Mammary Gland",name:"Mammary Gland, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0001911"},{src:"app:mammary-gland",organ:"Mammary Gland",name:"Mammary Gland, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.org/sig/ont/fma/fma57991"},{src:"app:mammary-gland",organ:"Mammary Gland",name:"Mammary Gland, R",side:"right",hasSex:!1,sex:"female",id:"http://purl.org/sig/ont/fma/fma57987"},{disabled:!0,src:"app:ovary-left",organ:"Ovary",name:"Ovary, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0000992"},{src:"app:ovary-left",organ:"Ovary",name:"Ovary, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.org/sig/ont/fma/fma7214"},{src:"app:ovary-right",organ:"Ovary",name:"Ovary, R",side:"right",hasSex:!1,sex:"female",id:"http://purl.org/sig/ont/fma/fma7213"},{src:"app:pancreas",organ:"Pancreas",name:"Pancreas",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001264"},{src:"app:pelvis-f",organ:"Pelvis",name:"Pelvis",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001270"},{src:"app:placenta",organ:"Placenta",name:"Placenta",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0001987"},{src:"app:prostate",organ:"Prostate",name:"Prostate",hasSex:!1,sex:"male",id:"http://purl.obolibrary.org/obo/UBERON_0002367",disabled:!0},{src:"app:prostate",organ:"Prostate",name:"Prostate",hasSex:!1,sex:"male",id:"http://purl.obolibrary.org/obo/UBERON_0000079"},{src:"app:small-intestine",organ:"Small Intestine",name:"Small Intestine",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002108"},{src:"app:large-intestine",organ:"Large Intestine",name:"Large Intestine",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000059"},{src:"app:spinal-cord",organ:"Spinal Cord",name:"Spinal Cord",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002240"},{src:"app:spleen",organ:"Spleen",name:"Spleen",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002106"},{src:"app:thymus",organ:"Thymus",name:"Thymus",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002370"},{disabled:!0,src:"app:ureter-left",organ:"Ureter",name:"Ureter, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000056"},{src:"app:ureter-left",organ:"Ureter",name:"Ureter, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001223"},{src:"app:ureter-right",organ:"Ureter",name:"Ureter, R",side:"right",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001222"},{src:"app:bladder",organ:"Urinary Bladder",name:"Urinary Bladder",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001255"},{src:"app:uterus",organ:"Uterus",name:"Uterus",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0000995"},{src:"app:vasculature-thick",organ:"Blood Vasculature",name:"Blood Vasculature",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0004537"},{disabled:!0,src:"app:vasculature-thick",organ:"Blood Vasculature",name:"Blood Vasculature",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002049"}].sort((t,e)=>t.name.localeCompare(e.name)),RK=DK.filter(t=>!0!==t.disabled);let NK=(()=>{class t{constructor(){this.clsName="ccf-organ-selector",this.multiselect=!1,this.displayErrors=!1,this.organList=RK,this.selectedOrgans=[],this.expanded=!1,this.organsChanged=new Bc,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 I$.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&&(Zc(OK,7),Zc(TK,7),Zc(kK,7)),2&t){let t;Qc(t=tu())&&(e.carouselContainer=t.first),Qc(t=tu())&&(e.itemList=t.first),Qc(t=tu())&&(e.itemContainer=t.first)}},hostVars:2,hostBindings:function(t,e){2&t&&Va(e.clsName)},inputs:{multiselect:"multiselect",displayErrors:"displayErrors",organList:"organList",selectedOrgans:"selectedOrgans",expanded:"expanded",occurenceData:"occurenceData"},outputs:{organsChanged:"organsChanged"},features:[ye],decls:9,vars:8,consts:[["matTooltip","Select the organ your tissue block is from.",1,"container",3,"matTooltipDisabled"],["carouselContainer",""],["class","carousel-left-icon",3,"disabled","touchstart","touchend","click","mousedown","mouseup",4,"ngIf"],[1,"carousel-item-container"],["itemcontainer",""],[1,"carousel-item-list"],["itemlist",""],["class","carousel-item",3,"disabled","selected","click",4,"ngFor","ngForOf"],["class","carousel-right-icon",3,"disabled","touchstart","touchend","click","mousedown","mouseup",4,"ngIf"],[1,"carousel-left-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"],[1,"carousel-right-icon",3,"touchstart","touchend","click","mousedown","mouseup"]],template:function(t,e){1&t&&(ra(0,"div",0,1),Jo(2,PK,2,2,"mat-icon",2),ra(3,"div",3,4),ra(5,"div",5,6),Jo(7,MK,6,7,"div",7),sa(),sa(),Jo(8,IK,2,2,"mat-icon",8),sa()),2&t&&(ja("expanded",e.expanded)("error",e.error),na("matTooltipDisabled",e.multiselect),ws(2),na("ngIf",!e.expanded),ws(5),na("ngForOf",e.organList),ws(1),na("ngIf",!e.expanded))},directives:[gw,Ah,kh,T_],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:5rem;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}[_nghost-%COMP%] .expanded[_ngcontent-%COMP%] .carousel-item-container[_ngcontent-%COMP%]{width:100%!important}[_nghost-%COMP%] .expanded[_ngcontent-%COMP%] .carousel-item-container[_ngcontent-%COMP%] .carousel-item-list[_ngcontent-%COMP%]{flex-wrap:wrap;overflow:auto;left:0rem!important}[_nghost-%COMP%] .expanded[_ngcontent-%COMP%] .carousel-item-container[_ngcontent-%COMP%] .carousel-item-list[_ngcontent-%COMP%] .carousel-item[_ngcontent-%COMP%]{height:5rem}"]}),t})(),LK=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Wh,k_,yw]]}),t})(),jK=(()=>{class t{constructor(){this.clsName="ccf-opacity-slider",this.opacity=20,this.visible=!0,this.opacityChange=new Bc,this.visibilityToggle=new Bc,this.opacityReset=new Bc}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&&Va(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),Ja(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()}),Ja(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),el("",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:[F$,T_,cv],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})(),FK=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Wh,k_,U$,uv]]}),t})();function BK(t,e){if(1&t&&(ra(0,"div",16),oa(1,"youtube-player",17),sa()),2&t){const t=va(3);ws(1),Sa("videoId",t.videoID)}}function VK(t,e){if(1&t&&(ra(0,"mat-expansion-panel",11),ra(1,"mat-expansion-panel-header"),ra(2,"h2",12),Ja(3),sa(),sa(),ra(4,"div",13),oa(5,"markdown",14),Jo(6,BK,2,1,"div",15),sa(),sa()),2&t){const t=va(),e=t.index,n=t.$implicit;na("expanded",0===e),ws(3),tl(n.title),ws(2),ja("first",0===e),na("data",n.content),ws(1),na("ngIf",0===e)}}function zK(t,e){if(1&t&&(ra(0,"div",9),Jo(1,VK,7,6,"mat-expansion-panel",10),sa()),2&t){const t=e.$implicit;ws(1),na("ngIf",t)}}let UK=(()=>{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(Y$),ea(Q$))},t.\u0275cmp=Jt({type:t,selectors:[["ccf-info-dialog"]],decls:11,vars:2,consts:[[1,"rui-about","wrapper"],[1,"container"],[1,"content"],[1,"header"],["mat-dialog-title","",1,"title"],[1,"close"],[1,"material-icons","close-icon",3,"click"],[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,"div",3),ra(4,"h2",4),Ja(5),sa(),ra(6,"div",5),ra(7,"mat-icon",6),fa("click",function(){return e.close()}),Ja(8,"clear"),sa(),sa(),sa(),ra(9,"mat-dialog-content",7),Jo(10,zK,2,1,"div",8),sa(),sa(),sa(),sa()),2&t&&(ws(5),tl(e.infoTitle),ws(5),na("ngForOf",e.documentationContents))},directives:[rG,T_,sG,kh,Ah,CG,TG,NG,WG],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%] .content[_ngcontent-%COMP%] .header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;height:3rem;margin-bottom:2.25rem;position:relative}.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%]{cursor:pointer;height:3rem;width:3rem;line-height:3rem;text-align:center;transition:.6s}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-size:1.5rem;margin:0 auto;line-height:3rem;height:3rem;justify-self:center;display:flex}.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;display:flex}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .dialog-content[_ngcontent-%COMP%] .variable-binding.first[_ngcontent-%COMP%]{padding-right:1rem;width:73%}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .dialog-content[_ngcontent-%COMP%] .variable-binding[_ngcontent-%COMP%] ul{margin:0}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .dialog-content[_ngcontent-%COMP%] .variable-binding[_ngcontent-%COMP%] img{margin-left:1rem;float:right}.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%}"]}),t})(),HK=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Wh,oG,k_,kG,KG,LG.forRoot({})]]}),t})(),$K=(()=>{class t{constructor(t){this.http=t,this.panelContent=new Jf({content:[],infoTitle:"",videoID:""})}updateData(t,e,n){this.http.get(t,{responseType:"text"}).subscribe(t=>{const i={content:this.parseMarkdown(t),infoTitle:n,videoID:e};this.panelContent.next(i)})}parseMarkdown(t){const e=[],n=t.split("# ");for(const i of n)if(i.length){const t=i.includes("\n\n")?"\n\n":"\r\n\r\n",n=i.split(t);e.push({title:n[0],content:n.splice(1).join(t)})}return e}}return t.\u0275fac=function(e){return new(e||t)(Ei(Jv))},t.\u0275prov=xt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})(),GK=(()=>{class t{constructor(t,e){this.dialog=t,this.infoButtonService=e,this.infoTitle="",this.subscriptions=new g,this.subscriptions.add(e.panelContent.subscribe(t=>{t.content.length&&this.launchInfoDialog(t)}))}ngOnDestroy(){this.subscriptions.unsubscribe()}launchInfoDialog(t){0==this.dialog.openDialogs.length&&this.dialog.open(UK,{autoFocus:!1,panelClass:"modal-animated",width:"72rem",data:{title:t.infoTitle,content:t.content,videoID:t.videoID}})}onDialogButtonClick(){this.infoButtonService.updateData(this.documentationUrl,this.videoID,this.infoTitle)}}return t.\u0275fac=function(e){return new(e||t)(ea(nG),ea($K))},t.\u0275cmp=Jt({type:t,selectors:[["ccf-info-button"]],inputs:{infoTitle:"infoTitle",videoID:"videoID",documentationUrl:"documentationUrl"},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()}),Ja(2," info "),sa(),sa())},directives:[T_],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})(),WK=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Wh,HK,k_,d_]]}),t})(),qK=(()=>{class t{constructor(){this.clsName="ccf-call-to-action",this.callToActionClicked=new Bc,this.closeClicked=new Bc}close(){this.closeClicked.emit()}onDialogButtonClick(){this.callToActionClicked.emit()}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Jt({type:t,selectors:[["ccf-call-to-action"]],hostVars:2,hostBindings:function(t,e){2&t&&Va(e.clsName)},inputs:{infoTitle:"infoTitle",imageUrl:"imageUrl",message:"message",callToAction:"callToAction"},outputs:{callToActionClicked:"callToActionClicked",closeClicked:"closeClicked"},decls:13,vars:4,consts:[[1,"rui-about","wrapper"],[1,"container"],[1,"content"],[1,"first-row"],["mat-dialog-title","",1,"title"],[1,"cta-mat-icon","material-icons","close-icon",3,"click"],["mat-card-sm-image","","alt","preview","layout-fill","",1,"cta-image",3,"src"],[1,"mat-typography","dialog-content"],[1,"message"],["mat-button","",1,"mat-button",3,"text","click"]],template:function(t,e){1&t&&(ra(0,"div",0),ra(1,"div",1),ra(2,"div",2),ra(3,"div",3),ra(4,"p",4),Ja(5),sa(),ra(6,"mat-icon",5),fa("click",function(){return e.close()}),Ja(7,"clear"),sa(),sa(),oa(8,"img",6),ra(9,"mat-dialog-content",7),ra(10,"div",8),Ja(11),sa(),ra(12,"a",9),fa("click",function(){return e.onDialogButtonClick()}),sa(),sa(),sa(),sa(),sa()),2&t&&(ws(5),tl(e.infoTitle),ws(3),na("src",e.imageUrl,_r),ws(3),el(" ",e.message,""),ws(1),na("text",e.callToAction))},directives:[rG,T_,QG,sG],styles:["[_nghost-%COMP%] .content[_ngcontent-%COMP%]{display:block;align-content:center;padding-left:1.6rem;padding-right:1.6rem;border-radius:.25rem}[_nghost-%COMP%] .info-button-wrapper[_ngcontent-%COMP%]{border-radius:.25rem;padding:.6rem;transition:.6s}[_nghost-%COMP%] .info-button-wrapper[_ngcontent-%COMP%] .ccf-info-button[_ngcontent-%COMP%]{cursor:pointer;transition:color .6s;font-size:1.2rem;vertical-align:sub}[_nghost-%COMP%] .first-row[_ngcontent-%COMP%]{display:flex;width:100%;line-height:.9rem}[_nghost-%COMP%] .first-row[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{padding-right:7rem;padding-left:.2rem;font-size:.875rem;padding-top:.75rem}[_nghost-%COMP%] .first-row[_ngcontent-%COMP%] .cta-mat-icon[_ngcontent-%COMP%]{height:30%;line-height:3.4rem}[_nghost-%COMP%] .message[_ngcontent-%COMP%]{padding:.5rem}[_nghost-%COMP%] .cta-image[_ngcontent-%COMP%]{align-self:center;-o-object-fit:cover;object-fit:cover;width:100%;border-radius:.25rem}[_nghost-%COMP%] .mat-button[_ngcontent-%COMP%]{background-color:#444a65;font-size:.75rem;position:relative;margin-bottom:1rem;width:100%;height:2rem;color:#fff}"],changeDetection:0}),t})(),XK=(()=>{let t=class extends MW{constructor(){super(...arguments),this.optionCache=new Map}get config$(){return this.state$.pipe(IW(),xp(1))}setConfig(t){this.setState(t)}patchConfig(t){this.patchState(t)}getProperty(t){return this.config$.pipe(T$(...t),Wd(),xp(1))}getOption(...t){const e=this.getPathKey(t);if(this.optionCache.has(e))return this.optionCache.get(e);const n=this.config$.pipe(T$(...t),Wd(),xp(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}),vw([CW()],t.prototype,"config$",null),t=vw([kW(),nU({name:"globalConfig",defaults:null})],t),t})();!function(){const t=localStorage.getItem("ALLOW_TELEMETRY");null===t||t.toLowerCase()}();let YK=(()=>{class t{constructor(t,e){t&&function(t,e){Rd(t,"mousemove").pipe(function(t,e=Yd,n=k$){return i=>i.lift(new P$(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)(Ei(th),Ei(jW))},t.\u0275mod=ie({type:t}),t.\u0275inj=St({}),t})();function KK(t,e){if(1&t){const t=ua();ra(0,"button",1),fa("click",function(){return $e(t),va().submit(!0)}),Ja(1),sa()}if(2&t){const t=va();ws(1),el(" ","not-set"===t.allowTelemetry?"I understand":"Opt in","\n")}}function QK(t,e){if(1&t){const t=ua();ra(0,"button",1),fa("click",function(){return $e(t),va().submit(!1)}),Ja(1,"Opt out"),sa()}}let ZK=(()=>{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(Al),ea(VW),ea(Z_))},t.\u0275cmp=Jt({type:t,selectors:[["ccf-tracking-popup"]],hostVars:2,hostBindings:function(t,e){2&t&&Va(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"),Ja(1,"We log usage to improve this service."),sa(),Jo(2,KK,2,1,"button",0),Jo(3,QK,2,0,"button",0)),2&t&&(ws(2),na("ngIf",e.showButton("opt-in")),ws(1),na("ngIf",e.showButton("opt-out")))},directives:[Ah,R_],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})(),JK=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Wh,L_]]}),t})();class tQ extends class{getDatabaseStatus(){return this.forwardCall("getDatabaseStatus")}getProviderNames(){return this.forwardCall("getProviderNames")}getDatasetTechnologyNames(){return this.forwardCall("getDatasetTechnologyNames")}getOntologyTreeModel(){return this.forwardCall("getOntologyTreeModel")}getCellTypeTreeModel(){return this.forwardCall("getCellTypeTreeModel")}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)}getCellTypeTermOccurences(t){return this.forwardCall("getCellTypeTermOccurences",t)}getScene(t){return this.forwardCall("getScene",t)}getReferenceOrganScene(t,e){return this.forwardCall("getReferenceOrganScene",t,e)}}{forwardCall(t,...e){return this.impl$.pipe(cp(n=>n[t](...e)))}}let eQ=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();const nQ=new A,iQ={cacheBusterObserver:nQ},rQ={cacheBusterObserver:nQ,maxCacheCount:4};function sQ(t,e,n){return t?{min:t[0]>e?t[0]:void 0,max:t[1]{var e;return Object.assign(Object.assign({},t),{transformMatrix:new VT(null!==(e=t.transformMatrix)&&void 0!==e?e:[])})})}let aQ=(()=>{class t{constructor(t,e){this.api=t,this.globalConfig=e,e.getOption("hubmapToken").subscribe(nQ)}getDatabaseStatus(){return this.doRequest(t=>this.api.dbStatus(t))}getProviderNames(){return this.doRequest(t=>this.api.providerNames(t))}getDatasetTechnologyNames(){return this.doRequest(t=>this.api.technologyNames(t))}getOntologyTreeModel(){return this.doRequest(t=>this.api.ontologyTreeModel(t),void 0,{},t=>t)}getCellTypeTreeModel(){return this.doRequest(t=>this.api.cellTypeTreeModel(t),void 0,{},t=>t)}getReferenceOrgans(){return this.doRequest(t=>this.api.referenceOrgans(t),void 0,{},t=>t)}getTissueBlockResults(t){return this.doRequest(t=>this.api.tissueBlocks(t),t,{},t=>t)}getAggregateResults(t){return this.doRequest(t=>this.api.aggregateResults(t),t)}getOntologyTermOccurences(t){return this.doRequest(t=>this.api.ontologyTermOccurences(t),t)}getCellTypeTermOccurences(t){return this.doRequest(t=>this.api.cellTypeTermOccurences(t),t)}getScene(t){return this.doRequest(t=>this.api.scene(t),t,{},oQ)}getReferenceOrganScene(t,e){return this.doRequest(t=>this.api.referenceOrganScene(t),e,{organIri:t},oQ)}doRequest(t,e,n,i){const{api:r,globalConfig:s}=this,o=Object.assign(Object.assign({},function(t){var e,n;return{age:sQ(null==t?void 0:t.ageRange,1,110),bmi:sQ(null==t?void 0:t.bmiRange,13,83),sex:null===(n=null===(e=null==t?void 0:t.sex)||void 0===e?void 0:e.toLowerCase)||void 0===n?void 0:n.call(e),ontologyTerms:null==t?void 0:t.ontologyTerms,cellTypeTerms:null==t?void 0:t.cellTypeTerms,providers:null==t?void 0:t.tmc,technologies:null==t?void 0:t.technologies,spatial:null==t?void 0:t.spatialSearches}}(e)),n);return z_([s.getOption("remoteApiEndpoint"),s.getOption("hubmapToken")]).pipe(rf(1),eg(([t,e])=>{r.configuration.basePath=t,e&&(o.token=e)}),cp(()=>t(o)),D(t=>i?i(t):t))}}return t.\u0275fac=function(e){return new(e||t)(Ei(eq),Ei(XK))},t.\u0275prov=xt({token:t,factory:t.\u0275fac,providedIn:"root"}),vw([QW(iQ)],t.prototype,"getProviderNames",null),vw([QW(iQ)],t.prototype,"getDatasetTechnologyNames",null),vw([QW(iQ)],t.prototype,"getOntologyTreeModel",null),vw([QW(iQ)],t.prototype,"getCellTypeTreeModel",null),vw([QW(iQ)],t.prototype,"getReferenceOrgans",null),vw([QW(rQ)],t.prototype,"getTissueBlockResults",null),vw([QW(rQ)],t.prototype,"getAggregateResults",null),vw([QW(rQ)],t.prototype,"getOntologyTermOccurences",null),vw([QW(rQ)],t.prototype,"getCellTypeTermOccurences",null),vw([QW(rQ)],t.prototype,"getScene",null),vw([QW(rQ)],t.prototype,"getReferenceOrganScene",null),t})(),lQ=(()=>{class t extends tQ{constructor(t){super(),this.impl$=this.database$=t.config$.pipe(t=>t,ep(t=>Object.keys(t).length>0),cp(t=>function(t,e){return new E(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):pp).subscribe(n);return()=>{s.unsubscribe(),i&&i.unsubscribe()}})}(()=>this.createDatabase(t),e=>this.connectDatabase(e,t))),D(t=>t.database),xp(1))}connectDatabase(t,e){return xw(this,void 0,void 0,function*(){const n=!Vu();return yield t.database.connect(e,n),t})}}return t.\u0275fac=function(e){return new(e||t)(Ei(XK))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),cQ=(()=>{class t extends lQ{createDatabase(t){return{database:new lY(t),unsubscribe:()=>{}}}}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})(),uQ=(()=>{class t extends lQ{createDatabase(t){const e=this.createWorker(t),n=OY(e);return{database:n,unsubscribe:()=>{n[_Y](),e.terminate()}}}}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})(),hQ=(()=>{class t extends tQ{constructor(t,e){super(),this.impl$=t.config$.pipe(t=>t,D(t=>this.selectToken(t)),Wd(),D(t=>e.get(t)),xp(1))}}return t.\u0275fac=function(e){return new(e||t)(Ei(XK),Ei(No))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})(),dQ=(()=>{class t{}return t.type="[CallToAction] Learn More",t})(),pQ=(()=>{class t{}return t.type="[CallToAction] Open Dialog",t})(),fQ=(()=>{class t{}return t.type="[CallToAction] Close Dialog",t})();var gQ;class mQ{get length(){var t,e;return null!==(e=null===(t=mQ.storage)||void 0===t?void 0:t.length)&&void 0!==e?e:0}key(t){var e,n;return null!==(n=null===(e=mQ.storage)||void 0===e?void 0:e.key(t))&&void 0!==n?n:null}getItem(t,e){var n,i,r;return null!==(r=null!==(i=null===(n=mQ.storage)||void 0===n?void 0:n.getItem(t))&&void 0!==i?i:e)&&void 0!==r?r:null}setItem(t,e){var n;try{return null===(n=mQ.storage)||void 0===n||n.setItem(t,e),!0}catch(i){return!1}}removeItem(t){var e;null===(e=mQ.storage)||void 0===e||e.removeItem(t)}clear(){var t;null===(t=mQ.storage)||void 0===t||t.clear()}}mQ.storage=(()=>{let t;try{t=window.localStorage;const e="__storage_test__";return t.setItem(e,e),t.removeItem(e),t}catch(e){return e instanceof DOMException&&(22===e.code||1014===e.code||"QuotaExceededError"===e.name||"NS_ERROR_DOM_QUOTA_REACHED"===e.name)&&t&&0!==t.length?t:void 0}})(),mQ.\u0275fac=function(t){return new(t||mQ)},mQ.\u0275prov=xt({token:mQ,factory:mQ.\u0275fac,providedIn:"root"});const bQ="callToActionPopupShown";let yQ=gQ=class{constructor(t,e,n,i,r){this.dialog=t,this.ga=e,this.storage=n,this.infoService=i,this.http=r}static ctaDatePassed(t,e=Date.now){return+e()>+new Date(t)}ngxsOnInit(t){const{expirationDate:e,popupShown:n}=t.getState(),i=this.storage.getItem(bQ,`${n}`),r=gQ.ctaDatePassed(e);"true"!==i&&!r&&t.dispatch(new pQ)}getDialogData(){return this.http.get("assets/docs/SPATIAL_SEARCH_README.md",{responseType:"text"}).pipe(D(t=>this.infoService.parseMarkdown(t)))}launchLearnMore(t){this.dialog.open(UK,{autoFocus:!1,panelClass:"modal-animated",width:"72rem",data:{title:"Spatial Search",content:t,videoID:"UfxMpzatowE"}})}learnMore(t){return this.dialog.closeAll(),this.ga.event("open_learn_more","call_to_action"),this.getDialogData().pipe(eg(t=>this.launchLearnMore(t)))}open(t){this.dialog.open(_Q,{autoFocus:!1,panelClass:"modal-animated",width:"30.75rem",height:"36.688rem"}),this.ga.event("open","call_to_action"),this.storage.setItem(bQ,"true"),t.patchState({popupShown:!0})}close(t){this.dialog.closeAll(),this.ga.event("close","call_to_action")}};yQ.\u0275fac=function(t){return new(t||yQ)(Ei(nG),Ei(jW),Ei(mQ),Ei($K),Ei(Jv))},yQ.\u0275prov=xt({token:yQ,factory:yQ.\u0275fac}),vw([eU(dQ)],yQ.prototype,"learnMore",null),vw([eU(pQ)],yQ.prototype,"open",null),vw([eU(fQ)],yQ.prototype,"close",null),yQ=gQ=vw([nU({name:"callToAction",defaults:{title:"New to the Exploration User Interface",message:"Spatial Search has arrived!",callToAction:"Learn More",imageUrl:"assets/images/spatial_search.gif",expirationDate:"Dec 1, 2022",popupShown:!1}})],yQ);let vQ=(()=>{class t{static title(t){return t.title}static message(t){return t.message}static callToAction(t){return t.callToAction}static imageUrl(t){return t.imageUrl}static expirationDate(t){return t.expirationDate}static popupShown(t){return t.popupShown}}return vw([rU([yQ])],t,"title",null),vw([rU([yQ])],t,"message",null),vw([rU([yQ])],t,"callToAction",null),vw([rU([yQ])],t,"imageUrl",null),vw([rU([yQ])],t,"expirationDate",null),vw([rU([yQ])],t,"popupShown",null),t})(),_Q=(()=>{class t{constructor(){this.close=()=>new fQ,this.learnMore=()=>new dQ}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Jt({type:t,selectors:[["ccf-call-to-action-behavior"]],decls:5,vars:12,consts:[[3,"infoTitle","message","callToAction","imageUrl","callToActionClicked","closeClicked"]],template:function(t,e){1&t&&(ra(0,"ccf-call-to-action",0),fa("callToActionClicked",function(){return e.learnMore()})("closeClicked",function(){return e.close()}),Dc(1,"async"),Dc(2,"async"),Dc(3,"async"),Dc(4,"async"),sa()),2&t&&na("infoTitle",Rc(1,4,e.title$))("message",Rc(2,6,e.message$))("callToAction",Rc(3,8,e.callToAction$))("imageUrl",Rc(4,10,e.imageUrl$))},directives:[qK],pipes:[$h],styles:[""],changeDetection:0}),vw([iU(vQ.title)],t.prototype,"title$",void 0),vw([iU(vQ.message)],t.prototype,"message$",void 0),vw([iU(vQ.callToAction)],t.prototype,"callToAction$",void 0),vw([iU(vQ.imageUrl)],t.prototype,"imageUrl$",void 0),vw([XY()],t.prototype,"close",void 0),vw([XY()],t.prototype,"learnMore",void 0),t})();function wQ(t,e){if(1&t&&(ra(0,"div",3),Ja(1),sa()),2&t){const t=va();ws(1),el(" ",t.label,"\n")}}function xQ(t,e){if(1&t){const t=ua();ra(0,"mat-list-item",4),ra(1,"div",5),ra(2,"mat-checkbox",6),fa("change",function(e){const n=$e(t).index;return va().updateItemSelection(n,e.checked)}),Ja(3),sa(),oa(4,"div",7),ra(5,"button",8),fa("click",function(){const e=$e(t).index;return va().removeItem(e)}),ra(6,"mat-icon"),Ja(7,"delete_outlined"),sa(),sa(),sa(),sa()}if(2&t){const t=e.$implicit;ws(2),na("checked",t.selected),ws(1),el(" ",t.description," ")}}let SQ=(()=>{class t{constructor(){this.clsName="ccf-spatial-search-list",this.label="",this.items=[],this.selectionChanged=new Bc,this.itemRemoved=new Bc}itemId(t,e){return e.description}updateItemSelection(t,e){const n=this.items=[...this.items];n[t]=Object.assign(Object.assign({},n[t]),{selected:e});const i=n.filter(t=>t.selected);this.selectionChanged.emit(i)}removeItem(t){const e=this.items=[...this.items],[n]=e.splice(t,1);this.itemRemoved.emit(n)}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Jt({type:t,selectors:[["ccf-spatial-search-list"]],hostVars:2,hostBindings:function(t,e){2&t&&Va(e.clsName)},inputs:{label:"label",items:"items"},outputs:{selectionChanged:"selectionChanged",itemRemoved:"itemRemoved"},decls:3,vars:3,consts:[["class","label",4,"ngIf"],[1,"list"],["class","item",4,"ngFor","ngForOf","ngForTrackBy"],[1,"label"],[1,"item"],[1,"item-content"],["labelPosition","after",1,"description",3,"checked","change"],[1,"filler"],["mat-icon-button","",1,"delete",3,"click"]],template:function(t,e){1&t&&(Jo(0,wQ,2,1,"div",0),ra(1,"mat-list",1),Jo(2,xQ,8,2,"mat-list-item",2),sa()),2&t&&(na("ngIf",e.label),ws(2),na("ngForOf",e.items)("ngForTrackBy",e.itemId))},directives:[Ah,sK,kh,lK,_K,R_,T_],styles:["[_nghost-%COMP%]{display:block}[_nghost-%COMP%] .label[_ngcontent-%COMP%]{margin-bottom:.5rem;font-weight:bold}[_nghost-%COMP%] .item[_ngcontent-%COMP%]{height:2rem}[_nghost-%COMP%] .item[_ngcontent-%COMP%] .item-content[_ngcontent-%COMP%]{display:flex;align-items:center;width:100%;height:2rem}[_nghost-%COMP%] .item[_ngcontent-%COMP%] .item-content[_ngcontent-%COMP%] .delete[_ngcontent-%COMP%]{width:2rem;height:2rem;line-height:2rem}[_nghost-%COMP%] .item[_ngcontent-%COMP%] .item-content[_ngcontent-%COMP%] .filler[_ngcontent-%COMP%]{flex-grow:1}[_nghost-%COMP%] .item[_ngcontent-%COMP%] > *{padding:0!important}"],changeDetection:0}),t})(),CQ=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Wh,L_,xK,k_,cK]]}),t})(),EQ=(()=>{class t{constructor(){this.clsName="ccf-xyz-position",this.x=0,this.y=0,this.z=0,this.format="1.0-2"}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Jt({type:t,selectors:[["ccf-xyz-position"]],hostVars:2,hostBindings:function(t,e){2&t&&Va(e.clsName)},inputs:{x:"x",y:"y",z:"z"},decls:9,vars:12,consts:[[1,"line"]],template:function(t,e){1&t&&(ra(0,"span",0),Ja(1),Dc(2,"number"),sa(),ra(3,"span",0),Ja(4),Dc(5,"number"),sa(),ra(6,"span",0),Ja(7),Dc(8,"number"),sa()),2&t&&(ws(1),el("X: ",Nc(2,3,e.x,e.format),""),ws(3),el("Y: ",Nc(5,6,e.y,e.format),""),ws(3),el("Z: ",Nc(8,9,e.z,e.format),""))},pipes:[Gh],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column}[_nghost-%COMP%] .line[_ngcontent-%COMP%]{font-size:1rem;font-weight:400}"],changeDetection:0}),t})(),OQ=(()=>{class t extends Tf{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 TQ=new oi("Default theme class");let kQ=(()=>{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(Dl,null);if(!s)return;const o=i.nativeElement,a=null===(n=r.get(Tf,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)(Ei(TQ,8))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();const PQ={initialConfig:{},parse:{},rename:{}};class AQ{constructor(t,e){this.configState=t,this.storedChanges={},this.options=Object.assign(Object.assign({},PQ),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 MQ=(()=>{class t{constructor(t,e,n={}){this.configState=t,this.cdr=e,this.options=n,this.initialized=!1,this.configManager=new AQ(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 IQ={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}};var DQ;const RQ={production:!0,disableDbWorker:!0,acceptableViewerDomains:["https://portal.hubmapconsortium.org","https://portal.test.hubmapconsortium.org"],dbOptions:{ccfOwlUrl:"https://ccf-api.hubmapconsortium.org/v1/ccf.owl.n3store.json",ccfContextUrl:"https://hubmapconsortium.github.io/ccf-ontology/ccf-context.jsonld",dataSources:["assets/kpmp/data/rui_locations.jsonld","assets/sparc/data/rui_locations.jsonld","assets/gtex/data/rui_locations.jsonld","assets/sea-ad/data/rui_locations.jsonld","assets/allen-institute/data/rui_locations.jsonld"],hubmapDataService:"search-api",hubmapPortalUrl:"https://portal.hubmapconsortium.org/",hubmapDataUrl:"https://search.api.hubmapconsortium.org/v3/entities/search",hubmapAssetsUrl:"https://assets.hubmapconsortium.org",hubmapToken:null!==(DQ=localStorage.getItem("HUBMAP_TOKEN"))&&void 0!==DQ?DQ:"",useRemoteApi:!1,remoteApiEndpoint:"https://ccf-api.hubmapconsortium.org/v1"},customization:{theme:"hubmap",header:!0,homeUrl:"https://portal.hubmapconsortium.org/",logoTooltip:"Human BioMolecular Atlas Project"},googleAnalyticsToken:"portal.hubmapconsortium.org"===window.location.hostname?"G-1WRJHN9FM6":"G-J9HWV9QPJ4"};function NQ(t){return(...e)=>new t(...e)}function LQ(t,e){return n=>n.lift(new jQ(t,e))}class jQ{constructor(t,e){this.keySelector=t,this.flushes=e}call(t,e){return e.subscribe(new FQ(t,this.keySelector,this.flushes))}}class FQ 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))}}class BQ{constructor(t,e){this.count=t,this.source=e}call(t,e){return e.subscribe(new VQ(t,this.count,this.source))}}class VQ extends v{constructor(t,e,n){super(t),this.count=e,this.source=n}complete(){if(!this.isStopped){const{source:t,count:e}=this;if(0===e)return super.complete();e>-1&&(this.count=e-1),t.subscribe(this._unsubscribeAndRecycle())}}}let zQ=(()=>{class t{constructor(t){this.filter=t}}return t.type="[DataState] Update filter",t})();const UQ={sex:"Both",ageRange:[1,110],bmiRange:[13,83],tmc:[],technologies:[],ontologyTerms:["http://purl.obolibrary.org/obo/UBERON_0013702"],cellTypeTerms:["http://purl.obolibrary.org/obo/CL_0000000"],spatialSearches:[]};var HQ=(()=>(function(t){t.Running="running",t.Completed="completed"}(HQ||(HQ={})),HQ))();function $Q(t){return()=>t.next(HQ.Completed)}function GQ(t,e){return n=>n.pipe(cp(t),eg(e),WW(1),Z())}let WQ=class extends AW{constructor(t){super(),this.source=t,this.databaseReady$=this.state$.pipe(T$("status"),LQ(),ep(t=>"Ready"===t)),this._tissueBlockDataQueryStatus$=new _p(1),this._aggregateDataQueryStatus$=new _p(1),this._ontologyTermOccurencesDataQueryStatus$=new _p(1),this._cellTypeTermOccurencesDataQueryStatus$=new _p(1),this._sceneDataQueryStatus$=new _p(1),this._technologyFilterQueryStatus$=new _p(1),this._providerFilterQueryStatus$=new _p(1),this.ontologyTermsFullData$=new _p(1),this.cellTypeTermsFullData$=new _p(1),this.filter$=this.state$.pipe(T$("filter")),this.tissueBlockData$=this.filter$.pipe(GQ(this.tissueBlockData,$Q(this._tissueBlockDataQueryStatus$))),this.aggregateData$=this.filter$.pipe(GQ(this.aggregateData,$Q(this._aggregateDataQueryStatus$))),this.ontologyTermOccurencesData$=this.filter$.pipe(GQ(this.ontologyTermOccurencesData,$Q(this._ontologyTermOccurencesDataQueryStatus$))),this.cellTypeTermOccurencesData$=this.filter$.pipe(GQ(this.cellTypeTermOccurencesData,$Q(this._cellTypeTermOccurencesDataQueryStatus$))),this.sceneData$=this.filter$.pipe(GQ(this.sceneData,$Q(this._sceneDataQueryStatus$))),this.technologyFilterData$=this.filter$.pipe(GQ(this.technologyFilterData,$Q(this._technologyFilterQueryStatus$))),this.providerFilterData$=this.filter$.pipe(GQ(this.providerFilterData,$Q(this._providerFilterQueryStatus$))),this.tissueBlockDataQueryStatus$=this._tissueBlockDataQueryStatus$.pipe(LQ()),this.aggregateDataQueryStatus$=this._aggregateDataQueryStatus$.pipe(LQ()),this.ontologyTermOccurencesDataQueryStatus$=this._ontologyTermOccurencesDataQueryStatus$.pipe(LQ()),this.cellTypeTermOccurencesDataQueryStatus$=this._cellTypeTermOccurencesDataQueryStatus$.pipe(LQ()),this.sceneDataQueryStatus$=this._sceneDataQueryStatus$.pipe(LQ()),this.technologyFilterQueryStatus$=this._technologyFilterQueryStatus$.pipe(LQ()),this.providerFilterQueryStatus$=this._providerFilterQueryStatus$.pipe(LQ()),this.queryStatus$=z_([this.tissueBlockDataQueryStatus$,this.aggregateDataQueryStatus$,this.ontologyTermOccurencesDataQueryStatus$,this.cellTypeTermOccurencesDataQueryStatus$,this.sceneDataQueryStatus$,this.technologyFilterQueryStatus$,this.providerFilterQueryStatus$]).pipe(D(t=>function(t){return t.every(t=>t===HQ.Completed)}(t)?HQ.Completed:HQ.Running),LQ()),this._tissueBlockDataQueryStatus$.next(HQ.Completed),this._aggregateDataQueryStatus$.next(HQ.Completed),this._ontologyTermOccurencesDataQueryStatus$.next(HQ.Completed),this._cellTypeTermOccurencesDataQueryStatus$.next(HQ.Completed),this._sceneDataQueryStatus$.next(HQ.Completed),this._technologyFilterQueryStatus$.next(HQ.Completed),this._providerFilterQueryStatus$.next(HQ.Completed)}ngxsOnInit(){const{ontologyTermsFullData$:t,ontologyTermOccurencesData$:e,cellTypeTermsFullData$:n,cellTypeTermOccurencesData$:i,source:r,snapshot:{filter:s}}=this;s===UQ?(e.pipe(rf(1)).subscribe(t),i.pipe(rf(1)).subscribe(n)):(r.getOntologyTermOccurences().pipe(rf(1)).subscribe(t),r.getCellTypeTermOccurences().pipe(rf(1)).subscribe(n)),this.source.getOntologyTreeModel().pipe(rf(1)).subscribe(t=>this.updateAnatomicalStructuresTreeModel(t)),this.source.getCellTypeTreeModel().pipe(rf(1)).subscribe(t=>this.updateCellTypesTreeModel(t)),this.warmUpDatabase()}warmUpDatabase(){vH(()=>this.source.getDatabaseStatus()).pipe(eg(t=>this.updateStatus(t)),JH(2e3),rf(1)).pipe(function(t=-1){return e=>0===t?fp():e.lift(new BQ(t<0?-1:t-1,e))}(1e3),af(t=>"Loading"===t.status)).subscribe(),this.databaseReady$.pipe(rf(1),eg(()=>{this.updateStatus({status:"Ready",message:"Loading CCF Exploration User Interface (EUI)"})})).subscribe()}updateAnatomicalStructuresTreeModel(t){this.ctx.patchState({anatomicalStructuresTreeModel:t})}updateCellTypesTreeModel(t){this.ctx.patchState({cellTypesTreeModel:t})}updateStatus(t){this.ctx.patchState({status:t.status,statusMessage:t.message})}updateFilter(t){this.ctx.patchState({filter:Object.assign(Object.assign({},this.getState().filter),t)})}updateFilterHandler(t,{filter:e}){this.updateFilter(e)}tissueBlockData(t){return this._tissueBlockDataQueryStatus$.next(HQ.Running),this.databaseReady$.pipe(cp(()=>this.source.getTissueBlockResults(t)))}aggregateData(t){return this._aggregateDataQueryStatus$.next(HQ.Running),this.databaseReady$.pipe(cp(()=>this.source.getAggregateResults(t)))}ontologyTermOccurencesData(t){return this._ontologyTermOccurencesDataQueryStatus$.next(HQ.Running),this.databaseReady$.pipe(cp(()=>this.source.getOntologyTermOccurences(t)))}cellTypeTermOccurencesData(t){return this._cellTypeTermOccurencesDataQueryStatus$.next(HQ.Running),this.databaseReady$.pipe(cp(()=>this.source.getCellTypeTermOccurences(t)))}sceneData(t){return this._sceneDataQueryStatus$.next(HQ.Running),this.databaseReady$.pipe(cp(()=>this.source.getScene(t)))}technologyFilterData(){return this._technologyFilterQueryStatus$.next(HQ.Running),this.databaseReady$.pipe(cp(()=>this.source.getDatasetTechnologyNames()))}providerFilterData(){return this._providerFilterQueryStatus$.next(HQ.Running),this.databaseReady$.pipe(cp(()=>this.source.getProviderNames()))}};WQ.\u0275fac=function(t){return new(t||WQ)(Ei(eQ))},WQ.\u0275prov=xt({token:WQ,factory:WQ.\u0275fac}),vw([OW(),_w(0,TW("treeModel"))],WQ.prototype,"updateAnatomicalStructuresTreeModel",null),vw([OW(),_w(0,TW("treeModel"))],WQ.prototype,"updateCellTypesTreeModel",null),vw([OW(),_w(0,TW("status"))],WQ.prototype,"updateStatus",null),vw([OW(),_w(0,TW("filter"))],WQ.prototype,"updateFilter",null),vw([eU(zQ)],WQ.prototype,"updateFilterHandler",null),vw([PV.ak],WQ.prototype,"tissueBlockData",null),vw([PV.ak],WQ.prototype,"aggregateData",null),vw([PV.ak],WQ.prototype,"ontologyTermOccurencesData",null),vw([PV.ak],WQ.prototype,"cellTypeTermOccurencesData",null),vw([PV.ak],WQ.prototype,"sceneData",null),vw([PV.ak],WQ.prototype,"technologyFilterData",null),vw([PV.ak],WQ.prototype,"providerFilterData",null),WQ=vw([kW(),nU({name:"data",defaults:{filter:UQ,status:"Loading",statusMessage:"Loading database"}})],WQ);class qQ{static filter(t){return t.filter}static anatomicalStructuresTreeModel(t){var e;return null!==(e=t.anatomicalStructuresTreeModel)&&void 0!==e?e:{root:"",nodes:{}}}static cellTypesTreeModel(t){var e;return null!==(e=t.cellTypesTreeModel)&&void 0!==e?e:{root:"",nodes:{}}}}vw([rU([WQ])],qQ,"filter",null),vw([rU([WQ])],qQ,"anatomicalStructuresTreeModel",null),vw([rU([WQ])],qQ,"cellTypesTreeModel",null);let XQ=(()=>{class t{constructor(t,e,n){this.sex=t,this.organName=e,this.search=n}}return t.type="[Spatial Search Filter] Add",t})(),YQ=(()=>{class t{constructor(t){this.id=t}}return t.type="[Spatial Search Filter] Remove",t})(),KQ=(()=>{class t{constructor(t){this.items=t}}return t.type="[Spatial Search Filter] Set selected searches",t})();let QQ=class{addSearch(t,{sex:e,organName:n,search:i}){t.setState(function(t){return function(e){return t&&t.length||!e?Array.isArray(e)?e.concat(t):t:e}}([this.createItem(e,n,i)]))}removeSearch(t,{id:e}){t.setState(function(t){return function(e){let n=-1;if(function(t){return"function"==typeof t}(t)?n=e.findIndex(t):function(t){return"number"==typeof t}(t)&&(n=t),function(t){return Number.isNaN(t)||-1===t}(n))return e;const i=e.slice();return i.splice(n,1),i}}(t=>(null==t?void 0:t.id)===e))}setSelectedSearches(t,{items:e}){const n=new Map(e.map(t=>[t.id,t])),i=t.getState().map(t=>{var e;return null!==(e=n.get(t.id))&&void 0!==e?e:t.selected?Object.assign(Object.assign({},t),{selected:!1}):t});t.setState(i)}createItem(t,e,n){return{id:this.createItemId(n),selected:!0,description:this.createItemDescription(t,e,n),sex:t,search:n}}createItemId(t){const{x:e,y:n,z:i,radius:r,target:s}=t;return`${s}-${r}-${e},${n},${i}`}createItemDescription(t,e,n){const i=t=>t.slice(0,1).toUpperCase()+t.slice(1),{x:r,y:s,z:o,radius:a}=n;return`${i(t)}, ${i(e)}, ${a.toFixed(1)} mm, X: ${r.toFixed(1)}, Y: ${s.toFixed(1)}, Z: ${o.toFixed(1)}`}};QQ.\u0275fac=function(t){return new(t||QQ)},QQ.\u0275prov=xt({token:QQ,factory:QQ.\u0275fac}),vw([eU(XQ)],QQ.prototype,"addSearch",null),vw([eU(YQ)],QQ.prototype,"removeSearch",null),vw([eU(KQ)],QQ.prototype,"setSelectedSearches",null),QQ=vw([nU({name:"spatialSearchFilter",defaults:[]})],QQ);class ZQ{static items(t){return t}static searches(t){return t.map(t=>t.search)}static selectedSearches(t){return t.filter(t=>t.selected).map(t=>t.search)}}vw([rU([QQ])],ZQ,"items",null),vw([rU([ZQ.items])],ZQ,"searches",null),vw([rU([ZQ.items])],ZQ,"selectedSearches",null);const JQ=new RegExp("[^#a-f\\d]","gi"),tZ=new RegExp("^#?[a-f\\d]{3}[a-f\\d]?$|^#?[a-f\\d]{6}([a-f\\d]{2})?$","i"),eZ=["#FF8800","#2979ff","#ffd740","#b92dff","#da326f","#7323e2","#acf32b","#82B1FF","#E040FB","#00E5FF"].map((t,e)=>{const n=function(t,e={}){if("string"!=typeof t||JQ.test(t)||!tZ.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 nZ=class extends MW{constructor(){super(...arguments),this.forcedUnassignment=new A,this.forcedUnassignment$=this.forcedUnassignment.asObservable(),this.colorAssignments$=this.state$.pipe(T$("colorAssignments"),Wd()),this.colorAssignmentsList$=this.state$.pipe(T$("colorAssignmentsList"),Wd())}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}))}};nZ.\u0275fac=function(){let t;return function(e){return(t||(t=ei(nZ)))(e||nZ)}}(),nZ.\u0275prov=xt({token:nZ,factory:nZ.\u0275fac}),vw([OW(),_w(0,TW("key")),_w(1,TW("doReset"))],nZ.prototype,"assignColor",null),vw([OW(),_w(0,TW("key"))],nZ.prototype,"unassignColor",null),nZ=vw([kW(),nU({name:"colors",defaults:{colorPalette:eZ.concat(),colorsAvailable:eZ.concat(),colorAssignments:{},colorAssignmentsList:[]}})],nZ);let iZ=class extends MW{constructor(t,e){super(),this.dataService=t,this.injector=e,this.listResults$=this.state$.pipe(T$("listResults"),Wd()),this.highlightedNodeId$=this.state$.pipe(T$("highlightedNodeId"),Wd())}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(WQ),this.colorAssignments=this.injector.get(nZ),z_([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,gq.sortBy)(n,["rank"]).concat(i)}),eg(t=>this.setListResults(t))).subscribe()}};iZ.\u0275fac=function(t){return new(t||iZ)(Ei(eQ),Ei(No))},iZ.\u0275prov=xt({token:iZ,factory:iZ.\u0275fac}),vw([OW(),_w(0,TW("listResults"))],iZ.prototype,"setListResults",null),iZ=vw([kW(),nU({name:"listResults",defaults:{listResults:[]}})],iZ);const rZ=new Set(["Skin","Heart","Kidney","Spleen"]);let sZ=class extends MW{constructor(t,e){super(),this.dataService=t,this.injector=e,this.referenceOrgans$=this.state$.pipe(T$("referenceOrgans"),Wd()),this.selectedReferenceOrgans$=this.state$.pipe(T$("selectedReferenceOrgans"),Wd()),this.scene$=this.state$.pipe(T$("scene"),Wd()),this.highlightedId$=this.state$.pipe(T$("highlightedId"),Wd())}static referenceOrgans(t){return t.referenceOrgans}static referenceOrganEntities(t){return t.referenceOrganEntities}setSelectedReferenceOrgans(t){this.ctx.patchState({selectedReferenceOrgans:t})}setReferenceOrgans(t){this.ctx.patchState({referenceOrgans:t})}setReferenceOrganEntities(t){this.ctx.patchState({referenceOrganEntities: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(WQ),this.colorAssignments=this.injector.get(nZ),this.listResults=this.injector.get(iZ),this.dataService.getReferenceOrgans().pipe(eg(t=>this.setReferenceOrganEntities(t)),D(t=>{const e=new Set(t.map(t=>t.representation_of));return DK.filter(t=>e.has(t.id)).map(t=>Object.assign(Object.assign({},t),{disabled:!1,numResults:0}))}),rf(1),eg(t=>{this.setReferenceOrgans(t),this.setSelectedReferenceOrgans(t.filter(t=>rZ.has(t.organ)))})).subscribe(),z_([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)}),eg(t=>this.setScene(t))).subscribe()}};function oZ(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 aZ(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 lZ(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 cZ(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())}}sZ.\u0275fac=function(t){return new(t||sZ)(Ei(eQ),Ei(No))},sZ.\u0275prov=xt({token:sZ,factory:sZ.\u0275fac}),vw([OW(),_w(0,TW("selectedReferenceOrgans"))],sZ.prototype,"setSelectedReferenceOrgans",null),vw([OW(),_w(0,TW("referenceOrgans"))],sZ.prototype,"setReferenceOrgans",null),vw([OW(),_w(0,TW("referenceOrganEntities"))],sZ.prototype,"setReferenceOrganEntities",null),vw([OW(),_w(0,TW("scene"))],sZ.prototype,"setScene",null),vw([rU()],sZ,"referenceOrgans",null),vw([rU()],sZ,"referenceOrganEntities",null),sZ=vw([kW(),nU({name:"scene",defaults:{scene:[],referenceOrgans:[],referenceOrganEntities:[],selectedReferenceOrgans:[],selectedAnatomicalStructures:[],anatomicalStructureSettings:{}}})],sZ);const uZ=".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",hZ=Xy(class{constructor(t){this._elementRef=t}},"primary"),dZ=new oi("mat-progress-spinner-default-options",{providedIn:"root",factory:function(){return{diameter:100}}});class pZ extends hZ{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=pZ._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=Pd(t),this._spinnerAnimationLabel=this._getSpinnerAnimationLabel(),!this._fallbackAnimation&&this._styleRoot&&this._attachStyleNode()}get strokeWidth(){return this._strokeWidth||this.diameter/10}set strokeWidth(t){this._strokeWidth=Pd(t)}get value(){return"determinate"===this.mode?this._value:0}set value(t){this._value=Math.max(0,Math.min(100,Pd(t)))}ngOnInit(){const t=this._elementRef.nativeElement;this._styleRoot=Rp(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=pZ._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(".","_")}}pZ.\u0275fac=function(t){return new(t||pZ)(ea(Al),ea(Ep),ea(th,8),ea(Ny,8),ea(dZ))},pZ.\u0275cmp=Jt({type:pZ,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,oZ,1,9,"circle",1),Jo(2,aZ,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:[Rh,Nh],styles:[uZ],encapsulation:2,changeDetection:0}),pZ._diameters=new WeakMap;let fZ=(()=>{class t extends pZ{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(Al),ea(Ep),ea(th,8),ea(Ny,8),ea(dZ))},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,lZ,1,9,"circle",1),Jo(2,cZ,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:[Rh,Nh],styles:[uZ],encapsulation:2,changeDetection:0}),t})(),gZ=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Wy,Wh],Wy]}),t})(),mZ=(()=>{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&&(Va(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),Ja(2),sa()),2&t&&(ws(2),tl(e.text))},directives:[fZ],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 bZ={isolated:!0},yZ=new oi("Message service configuration",{providedIn:"root",factory:()=>bZ});let vZ=(()=>{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(ep(t=>t.source!==this.source))}getMessagesFromSource(t){return this.getMessages().pipe(ep(e=>e.source===t))}getMessagesFromSources(t){return this.getMessages().pipe(ep(e=>t.includes(e.source)))}nextMessageId(){return t.counter++}}return t.counter=0,t})();const _Z=(()=>{class t{constructor(t,e){this.config=t,this.parent=e,this.channel=new A,this.messages=t.isolated||!e?this.channel.asObservable():U([this.channel,e.messages.pipe(af(()=>!this.channel.closed))]).pipe(Y())}ngOnDestroy(){this.channel.complete()}connect(t){return new vZ(t,this.channel,this.messages)}}return t.\u0275fac=function(e){return new(e||t)(Ei(yZ),Ei(t,12))},t.\u0275prov=xt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})(),wZ=["*"];let xZ=(()=>{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(_Z),ea(nc))},t.\u0275cmp=Jt({type:t,selectors:[["ccf-drawer-content"]],hostVars:9,hostBindings:function(t,e){2&t&&(sl("@fadeInOut",e.faded),Va(e.className),La("margin-left",e.leftMargin,"px")("margin-right",e.rightMargin,"px"),ja("cff-drawer-content-animations",e.animationsEnabled))},ngContentSelectors:wZ,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:[Qg("fadeInOut",[em("false",tm({opacity:1})),em("true",tm({opacity:0})),im("false <=> true",Zg("1s"))])]},changeDetection:0}),t})();const SZ=["*"],CZ={params:{width:0,margin:0,margin2:0}};class EZ{constructor(){this.initialized=!1,this.deferred=new Promise(t=>{this.resolve=t})}set(){this.initialized=!0,this.resolve()}wait(){return xw(this,void 0,void 0,function*(){return this.deferred})}valueOf(){return this.initialized}}let OZ=(()=>{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 Bc(!0),this.expandedChange=new Bc(!0),this.stateChange=new Bc(!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 EZ,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(kd(t))}get expanded(){return this._expanded}set expanded(t){this.toggleExpanded(kd(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 xw(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(_Z),ea(nc),ea(Al))},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&&(sl("@openClose",e.openedState)("@expandCollapse",e.expandedStateObj),Va(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:SZ,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:[Qg("openClose",[em("open, open-instant",tm({transform:"none"})),em("closed",tm({})),im("closed => open-instant",Zg(0)),im("closed <=> open, open-instant => closed",Zg(".5s ease-in-out"))]),Qg("expandCollapse",[em("collapsed",tm({})),em("half",tm({width:"calc(50% - {{ margin }}px)"}),CZ),em("extended",tm({width:"calc(100% - {{ width }}px - {{ margin }}px)"}),CZ),em("full",tm({width:"calc(100% - {{ margin }}px - {{ margin2 }}px)"}),CZ),im("* <=> *",Zg(".5s ease-in-out"))])]},changeDetection:0}),t})();function TZ(t,e){1&t&&(ra(0,"ccf-drawer-content"),xa(1,2),sa())}const kZ=[[["ccf-drawer"]],[["ccf-drawer-content"]],"*"],PZ=["ccf-drawer","ccf-drawer-content","*"];function AZ(t){throw new Error(`Multiple drawers in position ${t}`)}let MZ=(()=>{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(lp(null)).subscribe(()=>{const t=this.validateDrawers();this.channel.sendMessage({type:"drawer-containers-changed",drawers:t}),this.cdr.markForCheck()}),this.content1.changes.pipe(lp(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&&AZ("start"),n.length>1&&AZ("end"),[e[0],n[0]]}}return t.\u0275fac=function(e){return new(e||t)(ea(_Z),ea(nc))},t.\u0275cmp=Jt({type:t,selectors:[["ccf-drawer-container"]],contentQueries:function(t,e,n){if(1&t&&(Jc(n,OZ,5),Jc(n,xZ,5)),2&t){let t;Qc(t=tu())&&(e.drawers=t),Qc(t=tu())&&(e.content1=t)}},viewQuery:function(t,e){if(1&t&&Zc(xZ,5),2&t){let t;Qc(t=tu())&&(e.content2=t)}},hostVars:2,hostBindings:function(t,e){2&t&&Va(e.className)},exportAs:["ccfDrawerContainer"],features:[xl([_Z])],ngContentSelectors:PZ,decls:3,vars:1,consts:[[4,"ngIf"]],template:function(t,e){1&t&&(wa(kZ),xa(0),xa(1,1),Jo(2,TZ,2,0,"ccf-drawer-content",0)),2&t&&(ws(2),na("ngIf",!e.hasWrappedContent))},directives:[Ah,xZ],styles:["[_nghost-%COMP%]{display:block;position:relative;z-index:1;overflow:hidden;-webkit-overflow-scrolling:touch}"],changeDetection:0}),t})(),IZ=(()=>{class t{}return t.type="[SpatialSearchUi] Start the Spatial Search flow",t})(),DZ=(()=>{class t{constructor(t){this.sex=t}}return t.type="[SpatialSearchUi] Set sex",t})(),RZ=(()=>{class t{constructor(t){this.organId=t}}return t.type="[SpatialSearchUi] Set organ",t})(),NZ=(()=>{class t{constructor(t){this.position=t}}return t.type="[SpatialSearchUi] Set position",t})(),LZ=(()=>{class t{constructor(t){this.node=t}}return t.type="[SpatialSearchUi] Start moving the position to a scene node",t})(),jZ=(()=>{class t{}return t.type="[SpatialSearchUi] Reset position",t})(),FZ=(()=>{class t{constructor(t){this.radius=t}}return t.type="[SpatialSearchUi] Set radius",t})(),BZ=(()=>{class t{}return t.type="[SpatialSearchUi] Reset radius",t})(),VZ=(()=>{class t{}return t.type="[SpatialSearchUi] Update spatial search data",t})(),zZ=(()=>{class t{}return t.type="[SpatialSearchUi] Generate and add a spatial search",t})(),UZ=(()=>{class t{constructor(t=!0){this.execute=t}}return t.type="[SpatialSearchUi] Set execute search on generate",t})();const HZ=["trigger"],$Z=["panel"];function GZ(t,e){if(1&t&&(ra(0,"span",8),Ja(1),sa()),2&t){const t=va();ws(1),tl(t.placeholder)}}function WZ(t,e){if(1&t&&(ra(0,"span",12),Ja(1),sa()),2&t){const t=va(2);ws(1),tl(t.triggerValue)}}function qZ(t,e){1&t&&xa(0,0,["*ngSwitchCase","true"])}function XZ(t,e){1&t&&(ra(0,"span",9),Jo(1,WZ,2,1,"span",10),Jo(2,qZ,1,0,"ng-content",11),sa()),2&t&&(na("ngSwitch",!!va().customTrigger),ws(2),na("ngSwitchCase",!0))}function YZ(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),il("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 KZ=[[["mat-select-trigger"]],"*"],QZ=["mat-select-trigger","*"],ZZ={transformPanelWrap:Qg("transformPanelWrap",[im("* => void",sm("@transformPanel",[rm()],{optional:!0}))]),transformPanel:Qg("transformPanel",[em("void",tm({transform:"scaleY(0.8)",minWidth:"100%",opacity:0})),em("showing",tm({opacity:1,minWidth:"calc(100% + 32px)",transform:"scaleY(1)"})),em("showing-multiple",tm({opacity:1,minWidth:"calc(100% + 64px)",transform:"scaleY(1)"})),im("void => *",Zg("120ms cubic-bezier(0, 0, 0.2, 1)")),im("* => void",Zg("100ms 25ms linear",tm({opacity:0})))])};let JZ=0;const tJ=new oi("mat-select-scroll-strategy"),eJ=new oi("MAT_SELECT_CONFIG"),nJ={provide:tJ,deps:[Vf],useFactory:function(t){return()=>t.scrollStrategies.reposition()}};class iJ{constructor(t,e){this.source=t,this.value=e}}const rJ=Yy(Ky(qy(Qy(class{constructor(t,e,n,i,r){this._elementRef=t,this._defaultErrorStateMatcher=e,this._parentForm=n,this._parentFormGroup=i,this.ngControl=r}})))),sJ=new oi("MatSelectTrigger");let oJ=(()=>{class t extends rJ{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-"+JZ++,this._triggerAriaLabelledBy=null,this._destroy=new A,this._onChange=()=>{},this._onTouched=()=>{},this._valueId="mat-select-value-"+JZ++,this._panelDoneAnimatingStream=new A,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=vH(()=>{const t=this.options;return t?t.changes.pipe(lp(t),cp(()=>Q(...t.map(t=>t.onSelectionChange)))):this._ngZone.onStable.pipe(rf(1),cp(()=>this.optionSelectionChanges))}),this.openedChange=new Bc,this._openedStream=this.openedChange.pipe(ep(t=>t),D(()=>{})),this._closedStream=this.openedChange.pipe(ep(t=>!t),D(()=>{})),this.selectionChange=new Bc,this.valueChange=new Bc,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=kd(t),this.stateChanges.next()}get multiple(){return this._multiple}set multiple(t){this._multiple=kd(t)}get disableOptionCentering(){return this._disableOptionCentering}set disableOptionCentering(t){this._disableOptionCentering=kd(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=Pd(t)}get id(){return this._id}set id(t){this._id=t||this._uid,this.stateChanges.next()}ngOnInit(){this._selectionModel=new Vp(this.multiple),this.stateChanges.next(),this._panelDoneAnimatingStream.pipe(Wd(),rp(this._destroy)).subscribe(()=>this._panelDoneAnimating(this.panelOpen))}ngAfterContentInit(){this._initKeyManager(),this._selectionModel.changed.pipe(rp(this._destroy)).subscribe(t=>{t.added.forEach(t=>t.select()),t.removed.forEach(t=>t.deselect())}),this.options.changes.pipe(lp(null),rp(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&&!uf(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||uf(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(rf(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 Eg(this.options).withTypeAhead(this._typeaheadDebounceInterval).withVerticalOrientation().withHorizontalOrientation(this._isRtl()?"rtl":"ltr").withHomeAndEnd().withAllowedModifierKeys(["shiftKey"]),this._keyManager.tabOut.pipe(rp(this._destroy)).subscribe(()=>{this.panelOpen&&(!this.multiple&&this._keyManager.activeItem&&this._keyManager.activeItem._selectViaInteraction(),this.focus(),this.close())}),this._keyManager.change.pipe(rp(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(rp(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(rp(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(Hp),ea(nc),ea(Tu),ea(Zy),ea(Al),ea(Fp,8),ea(sH,8),ea(gH,8),ea(KH,8),ea(PU,10),ii("tabindex"),ea(tJ),ea(Bg),ea(eJ,8))},t.\u0275dir=se({type:t,viewQuery:function(t,e){if(1&t&&(Zc(HZ,5),Zc($Z,5),Zc($f,5)),2&t){let t;Qc(t=tu())&&(e.trigger=t.first),Qc(t=tu())&&(e.panel=t.first),Qc(t=tu())&&(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})(),aJ=(()=>{class t extends oJ{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(rp(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(rf(1)).subscribe(()=>{this._triggerFontSize&&this._overlayDir.overlayRef&&this._overlayDir.overlayRef.overlayElement&&(this._overlayDir.overlayRef.overlayElement.style.fontSize=`${this._triggerFontSize}px`)}))}_scrollOptionIntoView(t){const e=xv(t,this.options,this.optionGroups),n=this._getItemHeight();this.panel.nativeElement.scrollTop=0===t&&1===e?0:Sv((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 iJ(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+=xv(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&&(Jc(n,sJ,5),Jc(n,wv,5),Jc(n,bv,5)),2&t){let t;Qc(t=tu())&&(e.customTrigger=t.first),Qc(t=tu())&&(e.options=t),Qc(t=tu())&&(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:[xl([{provide:BH,useExisting:t},{provide:pv,useExisting:t}]),jo],ngContentSelectors:QZ,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(KZ),ra(0,"div",0,1),fa("click",function(){return e.toggle()}),ra(3,"div",2),Jo(4,GZ,2,1,"span",3),Jo(5,XZ,3,2,"span",4),sa(),ra(6,"div",5),oa(7,"div",6),sa(),sa(),Jo(8,YZ,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:[Hf,Rh,Nh,$f,Lh,Oh],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:[ZZ.transformPanelWrap,ZZ.transformPanel]},changeDetection:0}),t})(),lJ=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({providers:[nJ],imports:[[Wh,Wf,Cv,Wy],$p,ZH,Cv,Wy]}),t})();function cJ(t,e){if(1&t&&(ra(0,"mat-option",6),ra(1,"div"),Ja(2),sa(),sa()),2&t){const t=e.$implicit,n=va();na("value",t),ws(1),Va(n.optionsVisible),ws(1),el(" ",t," ")}}let uJ=(()=>{class t{constructor(t){this.ga=t,this.selectionChange=new Bc,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(jW))},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),Ja(4),sa(),ra(5,"mat-select",4),fa("selectionChange",function(t){return e.selectionChanged(t.value)})("openedChange",function(){return e.toggleOptions()}),Jo(6,cJ,3,5,"mat-option",5),sa(),sa(),sa(),sa()),2&t&&(ws(4),el(" ",e.label," "),ws(1),na("value",e.selection),ws(1),na("ngForOf",e.options))},directives:[QH,aJ,kh,wv],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})();var hJ=n(25430),dJ=n(39053),pJ=n(26202);const fJ=["tooltipTemplate"],gJ=["leftOuterSelectionBar"],mJ=["rightOuterSelectionBar"],bJ=["fullBar"],yJ=["selectionBar"],vJ=["minHandle"],_J=["maxHandle"],wJ=["floorLabel"],xJ=["ceilLabel"],SJ=["minHandleLabel"],CJ=["maxHandleLabel"],EJ=["combinedLabel"],OJ=["ticksElement"];function TJ(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 kJ(t,e){1&t&&oa(0,"span",32),2&t&&na("innerHTML",va().$implicit.legend,vr)}const PJ=function(t){return{"ng5-slider-selected":t}};function AJ(t,e){if(1&t&&(ra(0,"span",27),oa(1,"ng5-slider-tooltip-wrapper",28),Jo(2,TJ,1,4,"ng5-slider-tooltip-wrapper",29),Jo(3,kJ,1,1,"span",30),sa()),2&t){const t=e.$implicit,n=va();na("ngClass",Pc(7,PJ,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 MJ(t,e){}function IJ(t,e){1&t&&Jo(0,MJ,0,0,"ng-template")}const DJ=function(t,e,n){return{tooltip:t,placement:e,content:n}};function RJ(t,e){if(1&t&&(aa(0),Jo(1,IJ,1,0,void 0,1),la()),2&t){const t=va();ws(1),na("ngTemplateOutlet",t.template)("ngTemplateOutletContext",Ac(2,DJ,t.tooltip,t.placement,t.content))}}function NJ(t,e){if(1&t&&(aa(0),ra(1,"div",2),Ja(2),sa(),la()),2&t){const t=va();ws(1),Ko("title",t.tooltip)("data-tooltip-placement",t.placement),ws(1),el(" ",t.content," ")}}const LJ={Min:0,Max:1};LJ[LJ.Min]="Min",LJ[LJ.Max]="Max";const jJ={Low:0,High:1,Floor:2,Ceil:3,TickValue:4};jJ[jJ.Low]="Low",jJ[jJ.High]="High",jJ[jJ.Floor]="Floor",jJ[jJ.Ceil]="Ceil",jJ[jJ.TickValue]="TickValue";class FJ{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 BJ{}class VJ{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(VJ.isNullOrUndefined(i)?(0,dJ.tap)(()=>{}):(0,dJ.throttleTime)(i,void 0,{leading:!0,trailing:!0})).subscribe(t=>{n(t)}),r}detachEventListener(t){VJ.isNullOrUndefined(t.eventsSubscription)||(t.eventsSubscription.unsubscribe(),t.eventsSubscription=null),VJ.isNullOrUndefined(t.events)||(t.events.complete(),t.events=null),VJ.isNullOrUndefined(t.teardownCallback)||(t.teardownCallback(),t.teardownCallback=null)}attachEventListener(t,e,n,i){const r=new HJ;return r.eventName=e,r.events=new hJ.xQ,r.teardownCallback=this.renderer.listen(t,e,t=>{r.events.next(t)}),r.eventsSubscription=r.events.pipe(VJ.isNullOrUndefined(i)?(0,dJ.tap)(()=>{}):(0,dJ.throttleTime)(i,void 0,{leading:!0,trailing:!0})).subscribe(t=>{n(t)}),r}}let GJ=(()=>{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 $J(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;VJ.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 VJ.isNullOrUndefined(this.changeDetectionRef)||this.changeDetectionRef.destroyed}}return t.\u0275fac=function(e){return new(e||t)(ea(Al),ea(Dl),ea(nc))},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})(),WJ=(()=>{class t extends GJ{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(Al),ea(Dl),ea(nc))},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})(),qJ=(()=>{class t extends GJ{constructor(t,e,n){super(t,e,n),this._value=null}get value(){return this._value}setValue(t){let e=!1;!this.alwaysHide&&(VJ.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(Al),ea(Dl),ea(nc))},t.\u0275dir=se({type:t,selectors:[["","ng5SliderLabel",""]],features:[jo]}),t})();class XJ{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 YJ{constructor(){this.active=!1,this.value=0,this.difference=0,this.position=0,this.lowLimit=0,this.highLimit=0}}class KJ{static compare(t,e){return!(VJ.isNullOrUndefined(t)&&VJ.isNullOrUndefined(e)||VJ.isNullOrUndefined(t)!==VJ.isNullOrUndefined(e))&&t.value===e.value&&t.highValue===e.highValue}}class QJ extends KJ{static compare(t,e){return!(VJ.isNullOrUndefined(t)&&VJ.isNullOrUndefined(e)||VJ.isNullOrUndefined(t)!==VJ.isNullOrUndefined(e))&&t.value===e.value&&t.highValue===e.highValue&&t.forceChange===e.forceChange}}const ZJ={provide:aU,useExisting:pt(()=>JJ),multi:!0};let JJ=(()=>{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 Bc,this.highValue=null,this.highValueChange=new Bc,this.options=new FJ,this.userChangeStart=new Bc,this.userChange=new Bc,this.userChangeEnd=new Bc,this.initHasRun=!1,this.inputModelChangeSubject=new hJ.xQ,this.inputModelChangeSubscription=null,this.outputModelChangeSubject=new hJ.xQ,this.outputModelChangeSubscription=null,this.viewLowValue=null,this.viewHighValue=null,this.viewOptions=new FJ,this.handleHalfDimension=0,this.maxHandlePosition=0,this.currentTrackingPointer=null,this.currentFocusPointer=null,this.firstKeyDown=!1,this.touchId=null,this.dragging=new YJ,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 $J(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!VJ.isNullOrUndefined(this.value)&&!VJ.isNullOrUndefined(this.highValue)}get showTicks(){return this.viewOptions.showTicks}ngOnInit(){this.viewOptions=new FJ,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){VJ.isNullOrUndefined(t.options)||this.onChangeOptions(),(!VJ.isNullOrUndefined(t.value)||!VJ.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,dJ.distinctUntilChanged)(QJ.compare),(0,dJ.filter)(t=>!t.forceChange&&!t.internalChange),VJ.isNullOrUndefined(t)?(0,dJ.tap)(()=>{}):(0,dJ.throttleTime)(t,void 0,{leading:!0,trailing:!0})).subscribe(t=>this.applyInputModelChange(t))}subscribeOutputModelChangeSubject(t){this.outputModelChangeSubscription=this.outputModelChangeSubject.pipe((0,dJ.distinctUntilChanged)(QJ.compare),VJ.isNullOrUndefined(t)?(0,dJ.tap)(()=>{}):(0,dJ.throttleTime)(t,void 0,{leading:!0,trailing:!0})).subscribe(t=>this.publishOutputModelChange(t))}subscribeResizeObserver(){zJ.isResizeObserverAvailable()&&(this.resizeObserver=new ResizeObserver(()=>this.calculateViewDimensionsAndDetectChanges()),this.resizeObserver.observe(this.elementRef.nativeElement))}unsubscribeResizeObserver(){zJ.isResizeObserverAvailable()&&null!==this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)}unsubscribeOnMove(){VJ.isNullOrUndefined(this.onMoveEventListener)||(this.eventListenerHelper.detachEventListener(this.onMoveEventListener),this.onMoveEventListener=null)}unsubscribeOnEnd(){VJ.isNullOrUndefined(this.onEndEventListener)||(this.eventListenerHelper.detachEventListener(this.onEndEventListener),this.onEndEventListener=null)}unsubscribeInputModelChangeSubject(){VJ.isNullOrUndefined(this.inputModelChangeSubscription)||(this.inputModelChangeSubscription.unsubscribe(),this.inputModelChangeSubscription=null)}unsubscribeOutputModelChangeSubject(){VJ.isNullOrUndefined(this.outputModelChangeSubscription)||(this.outputModelChangeSubscription.unsubscribe(),this.outputModelChangeSubscription=null)}unsubscribeManualRefresh(){VJ.isNullOrUndefined(this.manualRefreshSubscription)||(this.manualRefreshSubscription.unsubscribe(),this.manualRefreshSubscription=null)}unsubscribeTriggerFocus(){VJ.isNullOrUndefined(this.triggerFocusSubscription)||(this.triggerFocusSubscription.unsubscribe(),this.triggerFocusSubscription=null)}getPointerElement(t){return t===LJ.Min?this.minHandleElement:t===LJ.Max?this.maxHandleElement:null}getCurrentTrackingValue(){return this.currentTrackingPointer===LJ.Min?this.viewLowValue:this.currentTrackingPointer===LJ.Max?this.viewHighValue:null}modelValueToViewValue(t){return VJ.isNullOrUndefined(t)?NaN:VJ.isNullOrUndefined(this.viewOptions.stepsArray)||this.viewOptions.bindIndexForStepsArray?+t:VJ.findStepIndex(+t,this.viewOptions.stepsArray)}viewValueToModelValue(t){return VJ.isNullOrUndefined(this.viewOptions.stepsArray)||this.viewOptions.bindIndexForStepsArray?t:this.getStepValue(t)}getStepValue(t){const e=this.viewOptions.stepsArray[t];return VJ.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=!KJ.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),VJ.isNullOrUndefined(this.onChangeCallback)||this.onChangeCallback(this.range?[t.value,t.highValue]:t.value),VJ.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 KJ;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))),!VJ.isNullOrUndefined(this.viewOptions.stepsArray)||!this.viewOptions.enforceRange)return e;if(e.value=UJ.clampToRange(e.value,this.viewOptions.floor,this.viewOptions.ceil),this.range&&(e.highValue=UJ.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);KJ.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 FJ,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||!VJ.isNullOrUndefined(this.viewOptions.ticksArray),this.viewOptions.showTicks&&(!VJ.isNullOrUndefined(this.viewOptions.tickStep)||!VJ.isNullOrUndefined(this.viewOptions.ticksArray))&&(this.intermediateTicks=!0),this.viewOptions.showSelectionBar=this.viewOptions.showSelectionBar||this.viewOptions.showSelectionBarEnd||!VJ.isNullOrUndefined(this.viewOptions.showSelectionBarFromValue),VJ.isNullOrUndefined(this.viewOptions.stepsArray)?this.applyFloorCeilOptions():this.applyStepsArrayOptions(),VJ.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,VJ.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(VJ.isNullOrUndefined(this.viewOptions.step)?this.viewOptions.step=1:(this.viewOptions.step=+this.viewOptions.step,this.viewOptions.step<=0&&(this.viewOptions.step=1)),VJ.isNullOrUndefined(this.viewOptions.ceil)||VJ.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,VJ.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!==LJ.Min&&t!==LJ.Max&&(t=LJ.Min),t===LJ.Min?this.minHandleElement.focus():this.range&&t===LJ.Max&&this.maxHandleElement.focus()}refocusPointerIfNeeded(){VJ.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())VJ.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"),VJ.isNullOrUndefined(this.viewOptions.ariaLabel)?VJ.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",VJ.isNullOrUndefined(this.viewOptions.ariaLabelHigh)?VJ.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,jJ.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,jJ.High),this.maxHandleElement.ariaValueMin=this.viewOptions.floor.toString(),this.maxHandleElement.ariaValueMax=this.viewOptions.ceil.toString())}calculateViewDimensions(){VJ.isNullOrUndefined(this.viewOptions.handleDimension)?this.minHandleElement.calculateDimension():this.minHandleElement.setDimension(this.viewOptions.handleDimension);const t=this.minHandleElement.dimension;this.handleHalfDimension=t/2,VJ.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=VJ.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 XJ;if(r.selected=this.isTickSelected(t),r.style={"-webkit-transform":i,"-moz-transform":i,"-o-transform":i,"-ms-transform":i,transform:i},r.selected&&!VJ.isNullOrUndefined(this.viewOptions.getSelectionBarColor)&&(r.style["background-color"]=this.getSelectionBarColor()),!r.selected&&!VJ.isNullOrUndefined(this.viewOptions.getTickColor)&&(r.style["background-color"]=this.getTickColor(t)),VJ.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,jJ.TickValue),VJ.isNullOrUndefined(this.viewOptions.ticksValuesTooltip)||(r.valueTooltip=this.viewOptions.ticksValuesTooltip(t),r.valueTooltipPlacement=this.viewOptions.vertical?"right":"top")),!VJ.isNullOrUndefined(this.viewOptions.getLegend)){const e=this.viewOptions.getLegend(t);VJ.isNullOrUndefined(e)||(r.legend=e)}return r});if(VJ.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,jJ.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,jJ.Ceil)),this.ceilLabelElement.calculateDimension(),this.ceilLabelElement.setPosition(this.viewOptions.rightToLeft?0:this.fullBarElement.dimension-this.ceilLabelElement.dimension))}updateHandles(t,e){t===LJ.Min?this.updateLowHandle(e):t===LJ.Max&&this.updateHighHandle(e),this.updateSelectionBar(),this.updateTicksScale(),this.range&&this.updateCombinedLabel()}getHandleLabelPos(t,e){const n=t===LJ.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===LJ.Min||!this.viewOptions.rightToLeft&&t===LJ.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,jJ.Low)),this.minHandleLabelElement.setPosition(this.getHandleLabelPos(LJ.Min,t)),VJ.isNullOrUndefined(this.viewOptions.getPointerColor)||(this.minPointerStyle={backgroundColor:this.getPointerColor(LJ.Min)}),this.viewOptions.autoHideLimitLabels&&this.updateFloorAndCeilLabelsVisibility()}updateHighHandle(t){this.maxHandleElement.setPosition(t),this.maxHandleLabelElement.setValue(this.getDisplayValue(this.viewHighValue,jJ.High)),this.maxHandleLabelElement.setPosition(this.getHandleLabelPos(LJ.Max,t)),VJ.isNullOrUndefined(this.viewOptions.getPointerColor)||(this.maxPointerStyle={backgroundColor:this.getPointerColor(LJ.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(VJ.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))),VJ.isNullOrUndefined(this.viewOptions.getSelectionBarColor)){if(!VJ.isNullOrUndefined(this.viewOptions.selectionBarGradient)){const i=VJ.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===LJ.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,jJ.Low),e=this.getDisplayValue(this.viewHighValue,jJ.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!VJ.isNullOrUndefined(this.viewOptions.stepsArray)&&!this.viewOptions.bindIndexForStepsArray&&(t=this.getStepValue(t)),this.viewOptions.translate(t,e)}roundStep(t,e){const n=VJ.isNullOrUndefined(e)?this.viewOptions.step:e;let i=UJ.roundToPrecisionLimit((t-this.viewOptions.floor)/n,this.viewOptions.precisionLimit);return i=Math.round(i)*n,UJ.roundToPrecisionLimit(this.viewOptions.floor+i,this.viewOptions.precisionLimit)}valueToPosition(t){let e=VJ.linearValueToPosition;VJ.isNullOrUndefined(this.viewOptions.customValueToPosition)?this.viewOptions.logScale&&(e=VJ.logValueToPosition):e=this.viewOptions.customValueToPosition;let n=e(t=UJ.clampToRange(t,this.viewOptions.floor,this.viewOptions.ceil),this.viewOptions.floor,this.viewOptions.ceil);return VJ.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=VJ.linearPositionToValue;VJ.isNullOrUndefined(this.viewOptions.customPositionToValue)?this.viewOptions.logScale&&(n=VJ.logPositionToValue):n=this.viewOptions.customPositionToValue;const i=n(e,this.viewOptions.floor,this.viewOptions.ceil);return VJ.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(!VJ.isNullOrUndefined(e))for(let r=0;ri?LJ.Max:this.viewOptions.rightToLeft?e>this.minHandleElement.position?LJ.Min:LJ.Max:ethis.onBarStart(null,t,e,!0,!0,!0)),this.viewOptions.draggableRangeOnly?(this.minHandleElement.on("mousedown",e=>this.onBarStart(LJ.Min,t,e,!0,!0)),this.maxHandleElement.on("mousedown",e=>this.onBarStart(LJ.Max,t,e,!0,!0))):(this.minHandleElement.on("mousedown",t=>this.onStart(LJ.Min,t,!0,!0)),this.range&&this.maxHandleElement.on("mousedown",t=>this.onStart(LJ.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(LJ.Min,t,e,!0,!0)),this.maxHandleElement.onPassive("touchstart",e=>this.onBarStart(LJ.Max,t,e,!0,!0))):(this.minHandleElement.onPassive("touchstart",t=>this.onStart(LJ.Min,t,!0,!0)),this.range&&this.maxHandleElement.onPassive("touchstart",t=>this.onStart(LJ.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(LJ.Min)),this.range&&this.maxHandleElement.on("focus",()=>this.onPointerFocus(LJ.Max)))}unbindEvents(){this.unsubscribeOnMove(),this.unsubscribeOnEnd();for(const t of this.getAllSliderElements())VJ.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(),(!zJ.isTouchEvent(e)||!pJ.Z.hasSupport)&&e.preventDefault(),this.calculateViewDimensions(),VJ.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=zJ.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=zJ.isTouchEvent(e)?this.eventListenerHelper.attachPassiveEventListener(document,"touchend",t):this.eventListenerHelper.attachEventListener(document,"mouseup",t)}this.userChangeStart.emit(this.getChangeContext()),zJ.isTouchEvent(e)&&!VJ.isNullOrUndefined(e.changedTouches)&&VJ.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(zJ.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&&!VJ.isNullOrUndefined(this.viewOptions.tickStep)?this.roundStep(r,this.viewOptions.tickStep):this.roundStep(r)),this.positionTrackingHandle(r)}onEnd(t){zJ.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,VJ.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=VJ.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(VJ.isNullOrUndefined(i)||VJ.isNullOrUndefined(this.currentTrackingPointer))return;t.preventDefault(),this.firstKeyDown&&(this.firstKeyDown=!1,this.userChangeStart.emit(this.getChangeContext()));const r=UJ.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===LJ.Min?(e=s,n=s+t,n>this.viewOptions.ceil&&(n=this.viewOptions.ceil,e=n-t)):this.currentTrackingPointer===LJ.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){!VJ.isNullOrUndefined(this.viewOptions.minLimit)&&tthis.viewOptions.maxLimit&&(t=UJ.roundToPrecisionLimit((e=this.viewOptions.maxLimit)-this.dragging.difference,this.viewOptions.precisionLimit)),this.viewLowValue=t,this.viewHighValue=e,this.applyViewChange(),this.updateHandles(LJ.Min,this.valueToPosition(t)),this.updateHandles(LJ.Max,this.valueToPosition(e))}positionTrackingHandle(t){t=this.applyMinMaxLimit(t),this.range&&(this.viewOptions.pushRange?t=this.applyPushRange(t):(this.viewOptions.noSwitching&&(this.currentTrackingPointer===LJ.Min&&t>this.viewHighValue?t=this.applyMinMaxRange(this.viewHighValue):this.currentTrackingPointer===LJ.Max&&tthis.viewHighValue?(this.viewLowValue=this.viewHighValue,this.applyViewChange(),this.updateHandles(LJ.Min,this.maxHandleElement.position),this.updateAriaAttributes(),this.currentTrackingPointer=LJ.Max,this.minHandleElement.active=!1,this.maxHandleElement.active=!0,this.viewOptions.keyboardSupport&&this.maxHandleElement.focus()):this.currentTrackingPointer===LJ.Max&&tthis.viewOptions.maxLimit?this.viewOptions.maxLimit:t}applyMinMaxRange(t){const e=Math.abs(t-(this.currentTrackingPointer===LJ.Min?this.viewHighValue:this.viewLowValue));if(!VJ.isNullOrUndefined(this.viewOptions.minRange)&&ethis.viewOptions.maxRange){if(this.currentTrackingPointer===LJ.Min)return UJ.roundToPrecisionLimit(this.viewHighValue-this.viewOptions.maxRange,this.viewOptions.precisionLimit);if(this.currentTrackingPointer===LJ.Max)return UJ.roundToPrecisionLimit(this.viewLowValue+this.viewOptions.maxRange,this.viewOptions.precisionLimit)}return t}applyPushRange(t){const e=this.currentTrackingPointer===LJ.Min?this.viewHighValue-t:t-this.viewLowValue,n=VJ.isNullOrUndefined(this.viewOptions.minRange)?this.viewOptions.step:this.viewOptions.minRange,i=this.viewOptions.maxRange;return ei&&(this.currentTrackingPointer===LJ.Min?(this.viewHighValue=UJ.roundToPrecisionLimit(t+i,this.viewOptions.precisionLimit),this.applyViewChange(),this.updateHandles(LJ.Max,this.valueToPosition(this.viewHighValue))):this.currentTrackingPointer===LJ.Max&&(this.viewLowValue=UJ.roundToPrecisionLimit(t-i,this.viewOptions.precisionLimit),this.applyViewChange(),this.updateHandles(LJ.Min,this.valueToPosition(this.viewLowValue))),this.updateAriaAttributes()),t}getChangeContext(){const t=new BJ;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(Dl),ea(Al),ea(nc),ea(Tu))},t.\u0275cmp=Jt({type:t,selectors:[["ng5-slider"]],contentQueries:function(t,e,n){if(1&t&&Jc(n,fJ,5),2&t){let t;Qc(t=tu())&&(e.tooltipTemplate=t.first)}},viewQuery:function(t,e){if(1&t&&(Zc(gJ,5,GJ),Zc(mJ,5,GJ),Zc(bJ,5,GJ),Zc(yJ,5,GJ),Zc(vJ,5,WJ),Zc(_J,5,WJ),Zc(wJ,5,qJ),Zc(xJ,5,qJ),Zc(SJ,5,qJ),Zc(CJ,5,qJ),Zc(EJ,5,qJ),Zc(OJ,5,GJ)),2&t){let t;Qc(t=tu())&&(e.leftOuterSelectionBarElement=t.first),Qc(t=tu())&&(e.rightOuterSelectionBarElement=t.first),Qc(t=tu())&&(e.fullBarElement=t.first),Qc(t=tu())&&(e.selectionBarElement=t.first),Qc(t=tu())&&(e.minHandleElement=t.first),Qc(t=tu())&&(e.maxHandleElement=t.first),Qc(t=tu())&&(e.floorLabelElement=t.first),Qc(t=tu())&&(e.ceilLabelElement=t.first),Qc(t=tu())&&(e.minHandleLabelElement=t.first),Qc(t=tu())&&(e.maxHandleLabelElement=t.first),Qc(t=tu())&&(e.combinedLabelElement=t.first),Qc(t=tu())&&(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,Ar),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:[xl([ZJ]),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,AJ,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[GJ,jh,WJ,qJ,kh,Oh,t0,Ah]},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})(),t0=(()=>{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,RJ,2,6,"ng-container",0),Jo(1,NJ,3,3,"ng-container",0)),2&t&&(na("ngIf",e.template),ws(1),na("ngIf",!e.template))},directives:[Ah,Fh],styles:[".ng5-slider-inner-tooltip[_ngcontent-%COMP%]{height:100%}"]}),t})(),e0=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Wh]]}),t})();const n0=["popover"];function i0(t,e){if(1&t){const t=ua();ra(0,"div",7,8),ra(2,"div"),ra(3,"div",9),Ja(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),Ja(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),il("label min fade-in ",t.contentsVisible,""),ws(2),el(" ",t.options.floor,"> "),ws(1),Sa("value",t.lowValue),ws(1),il("slider fade-in ",t.contentsVisible,""),na("options",t.options)("value",t.lowValue)("highValue",t.highValue),ws(1),il("label max fade-in ",t.contentsVisible,""),ws(2),el(" ",t.options.ceil," "),ws(1),Sa("value",t.highValue)}}let r0=(()=>{class t{constructor(t,e,n){this.element=e,this.ga=n,this.selectionChange=new Bc,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(Vf),ea(Al),ea(jW))},t.\u0275cmp=Jt({type:t,selectors:[["ccf-dual-slider"]],viewQuery:function(t,e){if(1&t&&(Zc(Zp,7),Zc(n0,5,Al)),2&t){let t;Qc(t=tu())&&(e.popoverPortal=t.first),Qc(t=tu())&&(e.popoverElement=t.first)}},hostBindings:function(t,e){1&t&&fa("click",function(t){return e.closeSliderPopover(t.target)},!1,Mr)("touchstart",function(t){return e.closeSliderPopover(t.target)},!1,Mr)},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,i0,11,16,"div",2),ra(3,"mat-form-field",3),fa("click",function(){return e.toggleSliderPopover()}),ra(4,"div",4),ra(5,"span",5),Ja(6),sa(),ra(7,"span",6),Ja(8),sa(),sa(),oa(9,"mat-select"),sa(),sa(),sa()),2&t&&(ws(3),ja("highlight",e.isSliderOpen),ws(3),tl(e.label),ws(2),tl(e.rangeLabel))},directives:[Jp,QH,aJ,JJ],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 s0(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)}),Ja(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),el(" ",t," ")}}let o0=(()=>{class t{constructor(t){this.ga=t,this.selection=[],this.columns=3,this.selectionChange=new Bc}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(jW))},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),Ja(2),sa(),ra(3,"div",2),Jo(4,s0,3,2,"div",3),sa(),sa()),2&t&&(ws(2),tl(e.label),ws(1),ja("three",3===e.columns)("four",4===e.columns),ws(1),na("ngForOf",e.options))},directives:[kh,_K],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%}"],changeDetection:0}),t})();var a0;let l0=(()=>{class t{}return t.type="[SpatialSearchUi] Really update spatial search data",t})(),c0=a0=class{constructor(t,e,n,i){this.dataSource=t,this.store=e,this.ga=i,n.pipe(Cz(VZ),rg(500),eg(()=>e.dispatch(l0))).subscribe()}static organEntity(t,e){const{organId:n,sex:i}=t;return e.find(t=>{var e;return t.representation_of===n&&(null===(e=t.sex)||void 0===e?void 0:e.toLowerCase())===i})}startSpatialSearchFlow(t){const{sex:e,organId:n}=t.getState(),i=null==n?void 0:n.split("/").slice(-1)[0];return this.ga.event("set_organ","spatial_search_ui",`${e}_${i}`),t.dispatch(new DZ(e))}setSex(t,{sex:e}){let{organId:n}=t.getState();t.patchState({sex:e}),this.ga.event("set_sex","spatial_search_ui",e),void 0!==n&&!this.organValidForSex(n,e)&&(n=void 0);const i=Object.assign(Object.assign({},this.store.selectSnapshot(qQ.filter)),{spatialSearches:[]}),r=this.store.selectSnapshot(sZ.referenceOrgans);return this.dataSource.getOntologyTermOccurences(i).pipe(rf(1),eg(e=>{t.patchState({referenceOrgans:r.filter(t=>t.id&&!t.disabled&&e[t.id]>0)}),t.dispatch(new RZ(n))}))}setOrgan(t,{organId:e}){const{sex:n}=t.getState();t.patchState({sex:n,organId:e});const i=null==e?void 0:e.split("/").slice(-1)[0];this.ga.event("set_organ","spatial_search_ui",i);const r=this.store.selectSnapshot(a0.organEntity);if(r&&e&&r.sex){const{x_dimension:n,y_dimension:i,z_dimension:s}=r,o={x:Math.round(n/2),y:Math.round(i/2),z:Math.round(s/2)},a=Math.round(.07*Math.max(n,i,s)),l=this.store.selectSnapshot(qQ.filter),c=Object.assign(Object.assign({},l),{sex:r.sex,ontologyTerms:[e],spatialSearches:[]});return this.dataSource.getReferenceOrganScene(e,c).pipe(rf(1),eg(e=>{t.patchState({position:o,radius:a,defaultPosition:o,radiusSettings:{min:Math.min(a,5),max:Math.floor(Math.max(n,i,s)/1.5),defaultValue:a},organScene:bY(r).concat(e)})}),W(()=>t.dispatch(new VZ)))}}setPosition(t,{position:e}){t.patchState({position:e}),t.dispatch(new VZ);const{x:n,y:i,z:r}=e;this.ga.event("set_position","spatial_search_ui",`${n}_${i}_${r}`)}resetPosition(t){const{defaultPosition:e}=t.getState();t.patchState({position:e}),t.dispatch(new VZ);const{x:n,y:i,z:r}=null!=e?e:{x:0,y:0,z:0};this.ga.event("reset_position","spatial_search_ui",`${n}_${i}_${r}`)}moveToNode(t,{node:e}){const n=new VT(e.transformMatrix),[i,r,s]=n.getTranslation().map(t=>Math.round(1e3*t));return t.dispatch(new NZ({x:i,y:r,z:s}))}setRadius(t,{radius:e}){t.patchState({radius:e}),t.dispatch(new VZ),this.ga.event("set_radius","spatial_search_ui",e.toFixed(1))}resetRadius(t){var e;const{radiusSettings:n}=t.getState(),i=null!==(e=null==n?void 0:n.defaultValue)&&void 0!==e?e:0;t.patchState({radius:i}),t.dispatch(new VZ),this.ga.event("reset_radius","spatial_search_ui",i.toFixed(1))}updateSpatialSearch(t){const{position:e,radius:n}=t.getState(),i=this.store.selectSnapshot(a0.organEntity);if(i&&e&&n&&i.representation_of){const r=this.dataSource,s=i.representation_of,o=this.store.selectSnapshot(qQ.filter),a=Object.assign(Object.assign({},o),{sex:i.sex,ontologyTerms:[s],spatialSearches:[Object.assign(Object.assign({},e),{radius:n,target:i["@id"]})]});return Ev({spatialSearchScene:r.getReferenceOrganScene(s,a).pipe(rf(1)),tissueBlocks:r.getTissueBlockResults(a).pipe(rf(1)),anatomicalStructures:r.getOntologyTermOccurences(a).pipe(rf(1)),cellTypes:r.getCellTypeTermOccurences(a).pipe(rf(1))}).pipe(eg(e=>t.patchState(e)))}}generateSpatialSearch(t){const{position:e,radius:n,sex:i,organId:r,referenceOrgans:s=[],executeSearchOnGeneration:o}=t.getState(),a=this.store.selectSnapshot(a0.organEntity),l=s.find(t=>t.id===r);if(e&&n&&(null==a?void 0:a.representation_of)&&l){const r=Object.assign(Object.assign({},e),{radius:n,target:a["@id"]}),s=[new XQ(i,l.name,r)];if(o){const t=this.store.selectSnapshot(ZQ.selectedSearches);s.push(new zQ({spatialSearches:t.concat(r)}))}return this.ga.event("generate_search","spatial_search_ui"),t.dispatch(s).pipe(eg(()=>t.patchState({sex:"female",organId:void 0})))}}setExecuteSearchOnGenerate(t,{execute:e}){t.patchState({executeSearchOnGeneration:e})}organValidForSex(t,e){const n=this.store.selectSnapshot(sZ.referenceOrgans).find(e=>e.id===t);return n.hasSex||n.sex===e}};c0.\u0275fac=function(t){return new(t||c0)(Ei(eQ),Ei(qz),Ei(Az),Ei(jW))},c0.\u0275prov=xt({token:c0,factory:c0.\u0275fac}),vw([eU(IZ)],c0.prototype,"startSpatialSearchFlow",null),vw([eU(DZ)],c0.prototype,"setSex",null),vw([eU(RZ)],c0.prototype,"setOrgan",null),vw([eU(NZ)],c0.prototype,"setPosition",null),vw([eU(jZ)],c0.prototype,"resetPosition",null),vw([eU(LZ)],c0.prototype,"moveToNode",null),vw([eU(FZ)],c0.prototype,"setRadius",null),vw([eU(BZ)],c0.prototype,"resetRadius",null),vw([eU(l0)],c0.prototype,"updateSpatialSearch",null),vw([eU(zZ)],c0.prototype,"generateSpatialSearch",null),vw([eU(UZ)],c0.prototype,"setExecuteSearchOnGenerate",null),vw([rU([a0,sZ.referenceOrganEntities])],c0,"organEntity",null),c0=a0=vw([nU({name:"spatialSearchUi",defaults:{sex:"female",executeSearchOnGeneration:!0}})],c0);class u0{static sex(t){return t.sex}static referenceOrgans(t){var e;return null!==(e=t.referenceOrgans)&&void 0!==e?e:[]}static organId(t){return t.organId}static organ(t,e){if(void 0!==t)return e.find(e=>e.id===t)}static organs(t,e){return e.filter(e=>this.organMatchesSex(e,t))}static organMatchesSex(t,e){return t.hasSex||t.sex===e}static position(t){var e;return null!==(e=t.position)&&void 0!==e?e:{x:0,y:0,z:0}}static defaultPosition(t){var e;return null!==(e=t.defaultPosition)&&void 0!==e?e:{x:0,y:0,z:0}}static radius(t){var e;return null!==(e=t.radius)&&void 0!==e?e:0}static radiusSettings(t){var e;return null!==(e=t.radiusSettings)&&void 0!==e?e:{min:0,max:0,defaultValue:0}}static scene(t,e,n,i){var r,s;const o=function(t,e){var n;const i=t.x_dimension/1e3,r=t.y_dimension/1e3,s=t.z_dimension/1e3,o=.07*Math.max(i,r,s),a=.05*o,l=2*o,c=4*a;return e=e?Object.assign(Object.assign({},e),{radius:e.radius/1e3,x:e.x/1e3,y:e.y/1e3,z:e.z/1e3}):{target:null!==(n=t.representation_of)&&void 0!==n?n:t["@id"],radius:o,x:i/2,y:r/2,z:s/2},[{"@id":"http://purl.org/ccf/latest/ccf.owl#ProbingSphere","@type":"SpatialSceneNode",unpickable:!1,geometry:"sphere",transformMatrix:new VT(VT.IDENTITY).translate([e.x,e.y,e.z]).scale(e.radius),color:cY},{"@id":"http://purl.org/ccf/latest/ccf.owl#ProbingsphereXD","@type":"SpatialSceneNode",unpickable:!0,geometry:"cylinder",transformMatrix:new VT(VT.IDENTITY).translate([e.x+e.radius+l/2,e.y,e.z]).rotateZ(ZS(-90)).scale([a,l,a]),color:uY},{"@id":"http://purl.org/ccf/latest/ccf.owl#ProbingsphereXDCone","@type":"SpatialSceneNode",unpickable:!0,geometry:"cone",transformMatrix:new VT(VT.IDENTITY).translate([e.x+e.radius+l,e.y,e.z]).rotateZ(ZS(-90)).scale([c,3*c,c]),color:uY},{"@id":"http://purl.org/ccf/latest/ccf.owl#ProbingsphereXDLabel","@type":"SpatialSceneNode",unpickable:!0,geometry:"text",text:"D",transformMatrix:new VT(VT.IDENTITY).translate([e.x+e.radius+l+3*c,e.y,e.z]).scale(c),color:uY},{"@id":"http://purl.org/ccf/latest/ccf.owl#ProbingsphereXA","@type":"SpatialSceneNode",unpickable:!0,geometry:"cylinder",transformMatrix:new VT(VT.IDENTITY).translate([e.x-e.radius-l/2,e.y,e.z]).rotateZ(ZS(-90)).scale([a,l,a]),color:uY},{"@id":"http://purl.org/ccf/latest/ccf.owl#ProbingsphereXACone","@type":"SpatialSceneNode",unpickable:!0,geometry:"cone",transformMatrix:new VT(VT.IDENTITY).translate([e.x-e.radius-l,e.y,e.z]).rotateZ(ZS(90)).scale([c,3*c,c]),color:uY},{"@id":"http://purl.org/ccf/latest/ccf.owl#ProbingsphereXALabel","@type":"SpatialSceneNode",unpickable:!0,geometry:"text",text:"A",transformMatrix:new VT(VT.IDENTITY).translate([e.x-e.radius-l-3.5*c,e.y,e.z]).scale(c),color:uY},{"@id":"http://purl.org/ccf/latest/ccf.owl#ProbingsphereYW","@type":"SpatialSceneNode",unpickable:!0,geometry:"cylinder",transformMatrix:new VT(VT.IDENTITY).translate([e.x,e.y+e.radius+l/2,e.z]).scale([a,l,a]),color:hY},{"@id":"http://purl.org/ccf/latest/ccf.owl#ProbingsphereYWCone","@type":"SpatialSceneNode",unpickable:!0,geometry:"cone",transformMatrix:new VT(VT.IDENTITY).translate([e.x,e.y+e.radius+l,e.z]).scale([c,3*c,c]),color:hY},{"@id":"http://purl.org/ccf/latest/ccf.owl#ProbingsphereYWLabel","@type":"SpatialSceneNode",unpickable:!0,geometry:"text",text:"W",transformMatrix:new VT(VT.IDENTITY).translate([e.x,e.y+e.radius+l+3*c,e.z]).scale(c),color:hY},{"@id":"http://purl.org/ccf/latest/ccf.owl#ProbingsphereYS","@type":"SpatialSceneNode",unpickable:!0,geometry:"cylinder",transformMatrix:new VT(VT.IDENTITY).translate([e.x,e.y-e.radius-l/2,e.z]).scale([a,l,a]),color:hY},{"@id":"http://purl.org/ccf/latest/ccf.owl#ProbingsphereYSCone","@type":"SpatialSceneNode",unpickable:!0,geometry:"cone",transformMatrix:new VT(VT.IDENTITY).translate([e.x,e.y-e.radius-l,e.z]).rotateZ(ZS(180)).scale([c,3*c,c]),color:hY},{"@id":"http://purl.org/ccf/latest/ccf.owl#ProbingsphereYSLabel","@type":"SpatialSceneNode",unpickable:!0,geometry:"text",text:"S",transformMatrix:new VT(VT.IDENTITY).translate([e.x,e.y-e.radius-l-3.5*c,e.z]).scale(c),color:hY},{"@id":"http://purl.org/ccf/latest/ccf.owl#ProbingsphereZE","@type":"SpatialSceneNode",unpickable:!0,geometry:"cylinder",transformMatrix:new VT(VT.IDENTITY).translate([e.x,e.y,e.z+e.radius+l/2]).rotateX(ZS(90)).scale([a,l,a]),color:dY},{"@id":"http://purl.org/ccf/latest/ccf.owl#ProbingsphereZECone","@type":"SpatialSceneNode",unpickable:!0,geometry:"cone",transformMatrix:new VT(VT.IDENTITY).translate([e.x,e.y,e.z+e.radius+l]).rotateX(ZS(90)).scale([c,3*c,c]),color:dY},{"@id":"http://purl.org/ccf/latest/ccf.owl#ProbingsphereZELabel","@type":"SpatialSceneNode",unpickable:!0,geometry:"text",text:"E",transformMatrix:new VT(VT.IDENTITY).translate([e.x,e.y,e.z+e.radius+l+3*c]).scale(c),color:dY},{"@id":"http://purl.org/ccf/latest/ccf.owl#ProbingsphereZQ","@type":"SpatialSceneNode",unpickable:!0,geometry:"cylinder",transformMatrix:new VT(VT.IDENTITY).translate([e.x,e.y,e.z-e.radius-l/2]).rotateX(ZS(-90)).scale([a,l,a]),color:dY},{"@id":"http://purl.org/ccf/latest/ccf.owl#ProbingsphereZQCone","@type":"SpatialSceneNode",unpickable:!0,geometry:"cone",transformMatrix:new VT(VT.IDENTITY).translate([e.x,e.y,e.z-e.radius-l]).rotateX(ZS(-90)).scale([c,3*c,c]),color:dY},{"@id":"http://purl.org/ccf/latest/ccf.owl#ProbingsphereZQLabel","@type":"SpatialSceneNode",unpickable:!0,geometry:"text",text:"Q",transformMatrix:new VT(VT.IDENTITY).translate([e.x,e.y,e.z-e.radius-l-3.5*c]).scale(c),color:dY}]}(e,Object.assign(Object.assign({},n),{radius:i,target:e["@id"]})),a=new Set((null!==(r=t.tissueBlocks)&&void 0!==r?r:[]).map(t=>t.spatialEntityId));return(null!==(s=t.organScene)&&void 0!==s?s:[]).map(t=>(a.has(t["@id"])&&(t=Object.assign(Object.assign({},t),{color:[41,121,255,229.5]})),t)).concat(o)}static sceneBounds(t){const{x_dimension:e,y_dimension:n,z_dimension:i}=t,r=.42*Math.max(e,n,i);return{x:(r+e)/1e3,y:(r+n)/1e3,z:(r+i)/1e3}}static sceneTarget(t){const{x_dimension:e,y_dimension:n,z_dimension:i}=t;return[e/1e3/2,n/1e3/2,i/1e3/2]}static tissueBlocks(t){var e;return null!==(e=t.tissueBlocks)&&void 0!==e?e:[]}static anatomicalStructures(t,e){return this.getTermCounts(t.anatomicalStructures,e)}static cellTypes(t,e){return this.getTermCounts(t.cellTypes,e)}static getTermCounts(t,e){return Object.entries(null!=t?t:{}).filter(([t,e])=>e>0).map(([t,n])=>{var i,r;return{"@id":t,label:null!==(r=null===(i=e.nodes[t])||void 0===i?void 0:i.label)&&void 0!==r?r:t.split("/").slice(-1)[0],count:n}})}}function h0(t,e){if(1&t&&(ra(0,"div",6),ra(1,"mat-icon",7),Ja(2,"person"),sa(),ra(3,"div",8),ra(4,"div",9),Ja(5),sa(),ra(6,"div",9),Ja(7),sa(),sa(),sa()),2&t){const t=e.$implicit;ws(5),tl(t.donor.label),ws(2),tl(t.donor.description)}}u0.organEntity=c0.organEntity,vw([rU([c0])],u0,"sex",null),vw([rU([c0])],u0,"referenceOrgans",null),vw([rU([c0])],u0,"organId",null),vw([rU([u0.organId,u0.referenceOrgans])],u0,"organ",null),vw([rU([u0.sex,u0.referenceOrgans])],u0,"organs",null),vw([rU([c0])],u0,"position",null),vw([rU([c0])],u0,"defaultPosition",null),vw([rU([c0])],u0,"radius",null),vw([rU([c0])],u0,"radiusSettings",null),vw([rU([c0,c0.organEntity,u0.position,u0.radius])],u0,"scene",null),vw([rU([c0.organEntity])],u0,"sceneBounds",null),vw([rU([c0.organEntity])],u0,"sceneTarget",null),vw([rU([c0])],u0,"tissueBlocks",null),vw([rU([c0,qQ.anatomicalStructuresTreeModel])],u0,"anatomicalStructures",null),vw([rU([c0,qQ.cellTypesTreeModel])],u0,"cellTypes",null);let d0=(()=>{class t{constructor(){this.className="ccf-tissue-block-list",this.tissueBlocks=[]}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Jt({type:t,selectors:[["ccf-tissue-block-list"]],hostVars:2,hostBindings:function(t,e){2&t&&Va(e.className)},inputs:{tissueBlocks:"tissueBlocks"},decls:8,vars:2,consts:[[1,"tissue-block-header"],[1,"title"],["mat-icon-button","",1,"info"],["matTooltip","Total quantity of registered Tissue Blocks detected by the Probing Sphere","matTooltipPosition","right"],[1,"tissue-list"],["class","donor",4,"ngFor","ngForOf"],[1,"donor"],[1,"icon"],[1,"donor-info"],[1,"description"]],template:function(t,e){1&t&&(ra(0,"div",0),ra(1,"div",1),Ja(2),sa(),ra(3,"button",2),ra(4,"mat-icon",3),Ja(5,"info"),sa(),sa(),sa(),ra(6,"div",4),Jo(7,h0,8,2,"div",5),sa()),2&t&&(ws(2),el("",e.tissueBlocks.length," Tissue Blocks"),ws(5),na("ngForOf",e.tissueBlocks))},directives:[T_,gw,kh],styles:["[_nghost-%COMP%] .tissue-block-header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;margin-bottom:1rem}[_nghost-%COMP%] .tissue-block-header[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-size:.875rem}[_nghost-%COMP%] .tissue-block-header[_ngcontent-%COMP%] .info[_ngcontent-%COMP%]{padding:0;background:none;border:none;outline:none;border-radius:.25rem;transition:.6s}[_nghost-%COMP%] .tissue-list[_ngcontent-%COMP%]{overflow:auto}[_nghost-%COMP%] .donor[_ngcontent-%COMP%]{min-height:3rem;display:flex;font-size:.75rem;line-height:1rem;align-items:center;flex-grow:1;height:2.5rem;width:22rem;padding:.5rem;box-shadow:0 3px 6px #00000029;cursor:pointer;margin-right:1rem;margin-bottom:.5rem}[_nghost-%COMP%] .donor[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{margin-right:.5rem}[_nghost-%COMP%] .donor[_ngcontent-%COMP%] .donor-info[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-weight:600}[_nghost-%COMP%] .donor[_ngcontent-%COMP%] .donor-info[_ngcontent-%COMP%] .description[_ngcontent-%COMP%]{width:17rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}"],changeDetection:0}),t})();function p0(t,e){if(1&t&&(ra(0,"div",6),ra(1,"div",7),ra(2,"div",8),Ja(3),sa(),ra(4,"div",8),Ja(5),sa(),sa(),sa()),2&t){const t=e.$implicit;ws(3),tl(t.label),ws(2),tl(t.count)}}let f0=(()=>{class t{constructor(){this.className="ccf-term-occurrence-list",this.termList=[]}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Jt({type:t,selectors:[["ccf-term-occurrence-list"]],hostVars:2,hostBindings:function(t,e){2&t&&Va(e.className)},inputs:{termList:"termList",title:"title",toolTipText:"toolTipText"},decls:8,vars:4,consts:[[1,"term-list-header"],[1,"title"],["mat-icon-button","",1,"info"],["matTooltipPosition","right",3,"matTooltip"],[1,"term-list"],["class","donor",4,"ngFor","ngForOf"],[1,"donor"],[1,"term-bloc"],[1,"term-line"]],template:function(t,e){1&t&&(ra(0,"div",0),ra(1,"div",1),Ja(2),sa(),ra(3,"button",2),ra(4,"mat-icon",3),Ja(5,"info"),sa(),sa(),sa(),ra(6,"div",4),Jo(7,p0,6,2,"div",5),sa()),2&t&&(ws(2),nl("",e.termList.length," ",e.title,""),ws(2),Sa("matTooltip",e.toolTipText),ws(3),na("ngForOf",e.termList))},directives:[T_,gw,kh],styles:["[_nghost-%COMP%]{padding-top:1rem}[_nghost-%COMP%] .term-list-header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;margin-bottom:1rem}[_nghost-%COMP%] .term-list-header[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-size:.875rem}[_nghost-%COMP%] .term-list-header[_ngcontent-%COMP%] .counter[_ngcontent-%COMP%]{font-size:1rem}[_nghost-%COMP%] .term-list-header[_ngcontent-%COMP%] .info[_ngcontent-%COMP%]{padding-right:0;background:none;border:none;outline:none;border-radius:.25rem;transition:.6s}[_nghost-%COMP%] .term-list[_ngcontent-%COMP%]{overflow:auto;padding-left:2rem;font-size:1rem}[_nghost-%COMP%] .term-list[_ngcontent-%COMP%] .term-bloc[_ngcontent-%COMP%]{display:flex;justify-content:space-between;margin-bottom:1rem;overflow:auto}[_nghost-%COMP%] .term-list[_ngcontent-%COMP%] .term-line[_ngcontent-%COMP%]{padding-right:2rem}"],changeDetection:0}),t})();function g0(t,e){if(1&t&&(ra(0,"mat-icon",8),Ja(1),sa()),2&t){const t=e.$implicit;ja("active",va().currentKey===t.key),ws(1),el("",t.direction," ")}}function m0(t,e){1&t&&(ra(0,"div",9),Ja(1,"SHIFT"),sa())}let b0=(()=>{class t{constructor(){this.className="ccf-spatial-search-keyboard-ui",this.keyClicked=new Bc,this.keyHovered=new Bc,this.keyMap=[{key:"w",direction:"north"},{key:"s",direction:"south"},{key:"a",direction:"west"},{key:"d",direction:"east"},{key:"e",direction:"north_east"},{key:"q",direction:"south_west"}]}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Jt({type:t,selectors:[["ccf-spatial-search-keyboard-ui"]],hostVars:2,hostBindings:function(t,e){2&t&&Va(e.className)},inputs:{currentKey:"currentKey",shiftPressed:"shiftPressed"},outputs:{keyClicked:"keyClicked",keyHovered:"keyHovered"},decls:18,vars:14,consts:[[1,"direction-arrow"],["class","arrow",3,"active",4,"ngFor","ngForOf"],[1,"keys"],[1,"keyrow"],[1,"key","blue",3,"mousedown","mouseover","mouseout"],[1,"key","green",3,"mousedown","mouseover","mouseout"],[1,"key","red",3,"mousedown","mouseover","mouseout"],["class","shift",4,"ngIf"],[1,"arrow"],[1,"shift"]],template:function(t,e){1&t&&(ra(0,"div",0),Jo(1,g0,2,3,"mat-icon",1),sa(),ra(2,"div",2),ra(3,"div",3),ra(4,"div",4),fa("mousedown",function(){return e.keyClicked.emit("q")})("mouseover",function(){return e.keyHovered.emit("q")})("mouseout",function(){return e.keyHovered.emit()}),Ja(5,"Q"),sa(),ra(6,"div",5),fa("mousedown",function(){return e.keyClicked.emit("w")})("mouseover",function(){return e.keyHovered.emit("w")})("mouseout",function(){return e.keyHovered.emit()}),Ja(7,"W"),sa(),ra(8,"div",4),fa("mousedown",function(){return e.keyClicked.emit("e")})("mouseover",function(){return e.keyHovered.emit("e")})("mouseout",function(){return e.keyHovered.emit()}),Ja(9,"E"),sa(),sa(),ra(10,"div",3),ra(11,"div",6),fa("mousedown",function(){return e.keyClicked.emit("a")})("mouseover",function(){return e.keyHovered.emit("a")})("mouseout",function(){return e.keyHovered.emit()}),Ja(12,"A"),sa(),ra(13,"div",5),fa("mousedown",function(){return e.keyClicked.emit("s")})("mouseover",function(){return e.keyHovered.emit("s")})("mouseout",function(){return e.keyHovered.emit()}),Ja(14,"S"),sa(),ra(15,"div",6),fa("mousedown",function(){return e.keyClicked.emit("d")})("mouseover",function(){return e.keyHovered.emit("d")})("mouseout",function(){return e.keyHovered.emit()}),Ja(16,"D"),sa(),sa(),Jo(17,m0,2,0,"div",7),sa()),2&t&&(ws(1),na("ngForOf",e.keyMap),ws(3),ja("highlighted","q"===e.currentKey),ws(2),ja("highlighted","w"===e.currentKey),ws(2),ja("highlighted","e"===e.currentKey),ws(3),ja("highlighted","a"===e.currentKey),ws(2),ja("highlighted","s"===e.currentKey),ws(2),ja("highlighted","d"===e.currentKey),ws(2),na("ngIf",e.shiftPressed))},directives:[kh,Ah,T_],styles:["[_nghost-%COMP%] .direction-arrow[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(5,.5fr);grid-template-rows:1fr;grid-column-gap:0px;grid-row-gap:0px;margin-bottom:1rem;width:7rem}[_nghost-%COMP%] .direction-arrow[_ngcontent-%COMP%] .arrow[_ngcontent-%COMP%]{grid-area:1/3/2/4;opacity:0;transition:.5s}[_nghost-%COMP%] .direction-arrow[_ngcontent-%COMP%] .arrow.active[_ngcontent-%COMP%]{opacity:1}[_nghost-%COMP%] .keys[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:flex-start;padding:0;grid-gap:.5rem;gap:.5rem;width:7rem;height:7rem;-webkit-user-select:none;-moz-user-select:none;user-select:none}[_nghost-%COMP%] .keys[_ngcontent-%COMP%] .keyrow[_ngcontent-%COMP%]{display:flex;flex-direction:row;justify-content:center;align-items:center;padding:0;grid-gap:.5rem;gap:.5rem}[_nghost-%COMP%] .keys[_ngcontent-%COMP%] .keyrow[_ngcontent-%COMP%] .key[_ngcontent-%COMP%]{display:flex;flex-direction:column;justify-content:center;align-items:center;padding:.25rem;width:2rem;height:2rem;border:2px solid;border-radius:.5rem;cursor:pointer}[_nghost-%COMP%] .keys[_ngcontent-%COMP%] .shift[_ngcontent-%COMP%]{display:flex;flex-direction:column;justify-content:center;align-items:center;padding:.25rem;width:7rem;height:2rem;border:2px solid;border-radius:.5rem}"],changeDetection:0}),t})(),y0=(()=>{class t{constructor(){this.className="ccf-spatial-search-keyboard-ui-behavior",this.delta=1,this.shiftDelta=2,this.changePosition=new Bc,this.shiftPressed=!1}updatePosition(t){if(this.currentDelta=this.shiftPressed?this.shiftDelta:this.delta,"Shift"===t)this.shiftPressed=!0;else{switch(this.currentKey=t.toLowerCase(),this.currentKey){case"q":this.position=Object.assign(Object.assign({},this.position),{z:this.position.z-this.currentDelta});break;case"e":this.position=Object.assign(Object.assign({},this.position),{z:this.position.z+this.currentDelta});break;case"w":this.position=Object.assign(Object.assign({},this.position),{y:this.position.y+this.currentDelta});break;case"s":this.position=Object.assign(Object.assign({},this.position),{y:this.position.y-this.currentDelta});break;case"a":this.position=Object.assign(Object.assign({},this.position),{x:this.position.x-this.currentDelta});break;case"d":this.position=Object.assign(Object.assign({},this.position),{x:this.position.x+this.currentDelta})}this.changePosition.emit(this.position)}}handleKey(t){t.preventDefault(),this.updatePosition(t.key)}keyUp(t){"Shift"===t.key?this.shiftPressed=!1:this.currentKey=void 0}keyClick(t){this.updatePosition(t)}keyHover(t){this.currentKey=t}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Jt({type:t,selectors:[["ccf-spatial-search-keyboard-ui-behavior"]],hostVars:2,hostBindings:function(t,e){1&t&&fa("keydown",function(t){return e.handleKey(t)},!1,Mr)("keyup",function(t){return e.keyUp(t)},!1,Mr),2&t&&Va(e.className)},inputs:{delta:"delta",shiftDelta:"shiftDelta",position:"position"},outputs:{changePosition:"changePosition"},decls:1,vars:2,consts:[[3,"currentKey","shiftPressed","keyClicked","keyHovered"]],template:function(t,e){1&t&&(ra(0,"ccf-spatial-search-keyboard-ui",0),fa("keyClicked",function(t){return e.keyClick(t)})("keyHovered",function(t){return e.keyHover(t)}),sa()),2&t&&na("currentKey",e.currentKey)("shiftPressed",e.shiftPressed)},directives:[b0],encapsulation:2,changeDetection:0}),t})(),v0=(()=>{class t{constructor(){this.className="ccf-spatial-search-ui",this.addSpatialSearch=new Bc,this.resetPosition=new Bc,this.resetSphere=new Bc,this.closeSpatialSearch=new Bc,this.radiusChange=new Bc,this.positionChange=new Bc,this.editReferenceOrganClicked=new Bc,this.infoClicked=new Bc,this.nodeClicked=new Bc}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Jt({type:t,selectors:[["ccf-spatial-search-ui"]],hostVars:2,hostBindings:function(t,e){2&t&&Va(e.className)},inputs:{scene:"scene",sceneBounds:"sceneBounds",sceneTarget:"sceneTarget",sex:"sex",referenceOrgan:"referenceOrgan",radius:"radius",radiusSettings:"radiusSettings",defaultPosition:"defaultPosition",position:"position",tissueBlocks:"tissueBlocks",anatomicalStructures:"anatomicalStructures",cellTypes:"cellTypes"},outputs:{addSpatialSearch:"addSpatialSearch",resetPosition:"resetPosition",resetSphere:"resetSphere",closeSpatialSearch:"closeSpatialSearch",radiusChange:"radiusChange",positionChange:"positionChange",editReferenceOrganClicked:"editReferenceOrganClicked",infoClicked:"infoClicked",nodeClicked:"nodeClicked"},decls:55,vars:27,consts:[[1,"header"],[1,"title"],["mat-icon-button","",1,"info"],[3,"click"],["mat-icon-button","",1,"close"],[1,"content"],[1,"info-panel"],[1,"organ-sex-selection"],[1,"sex"],[1,"label"],[1,"current-sex"],[1,"organ"],[1,"current-organ"],[1,"edit",3,"click"],[1,"radius-slider"],[1,"slider-container"],[1,"slider",3,"max","min","step","value","input"],[1,"text","value"],[1,"reset-buttons"],["mat-button","",1,"reset-sphere","button",3,"click"],["mat-button","",1,"reset-camera","button",3,"click"],[1,"results"],[1,"tissue-block","list",3,"tissueBlocks"],["title","Anatomical Structures","toolTipText","Total quantity of predicted anatomical structures detected by the Probing Sphere",1,"anatomical-structures","list",3,"termList"],["title","Predicted Cell Types from ASCT+B Tables","toolTipText","Total quantity of predicted cell types detected by the Probing Sphere",1,"cell-type","list",3,"termList"],["mat-button","",1,"run-spatial-search","button",3,"click"],[1,"spatial-search-scene"],[1,"primary-scene-wrapper"],[1,"body-ui-hint"],[1,"primary-scene",3,"scene","bounds","target","nodeClick","rotationChange"],["primary",""],[1,"sidebar"],[1,"minimap-scene",3,"interactive","scene","bounds","target","nodeClick"],["minimap",""],[3,"delta","shiftDelta","position","changePosition"],[3,"x","y","z"]],template:function(t,e){if(1&t){const t=ua();ra(0,"div",0),ra(1,"div",1),Ja(2,"Configure Spatial Search"),sa(),ra(3,"button",2),ra(4,"mat-icon",3),fa("click",function(){return e.infoClicked.emit()}),Ja(5,"info"),sa(),sa(),ra(6,"button",4),ra(7,"mat-icon",3),fa("click",function(){return e.closeSpatialSearch.emit()}),Ja(8,"close"),sa(),sa(),sa(),ra(9,"div",5),ra(10,"div",6),ra(11,"div",7),ra(12,"div",8),ra(13,"div",9),Ja(14,"Donor Sex: "),sa(),ra(15,"div",10),Ja(16),sa(),sa(),ra(17,"div",11),ra(18,"div",9),Ja(19,"Organ: "),sa(),ra(20,"div",12),Ja(21),sa(),sa(),ra(22,"div",13),fa("click",function(){return e.editReferenceOrganClicked.emit()}),Ja(23,"Edit"),sa(),sa(),oa(24,"mat-divider"),ra(25,"div",14),ra(26,"div",1),Ja(27,"Probing Sphere Radius"),sa(),ra(28,"div",15),ra(29,"mat-slider",16),fa("input",function(t){return e.radiusChange.emit(t.value)}),sa(),ra(30,"span",17),Ja(31),sa(),sa(),ra(32,"div",18),ra(33,"button",19),fa("click",function(){return e.resetSphere.emit(),e.resetPosition.emit()}),Ja(34,"Reset Probing Sphere"),sa(),ra(35,"button",20),fa("click",function(){$e(t);const n=ta(49),i=ta(52);return n.rotation=n.rotationX=i.rotation=i.rotationX=0,n.target=i.target=e.sceneTarget,n.bounds=i.bounds=e.sceneBounds}),Ja(36,"Reset Camera View"),sa(),sa(),sa(),oa(37,"mat-divider"),ra(38,"div",21),oa(39,"ccf-tissue-block-list",22),oa(40,"ccf-term-occurrence-list",23),oa(41,"ccf-term-occurrence-list",24),sa(),ra(42,"button",25),fa("click",function(){return e.addSpatialSearch.emit()}),Ja(43,"Run Spatial Search"),sa(),sa(),ra(44,"div",26),ra(45,"div",27),ra(46,"div",28),Ja(47,"Use the keyboard or click a Tissue Block to move the Probing Sphere"),sa(),ra(48,"ccf-body-ui",29,30),fa("nodeClick",function(t){return e.nodeClicked.emit(null==t?null:t.node)})("rotationChange",function(e){$e(t);const n=ta(52);return n.rotation=e[0],n.rotationX=e[1]}),sa(),sa(),ra(50,"div",31),ra(51,"ccf-body-ui",32,33),fa("nodeClick",function(t){return e.nodeClicked.emit(null==t?null:t.node)}),sa(),ra(53,"ccf-spatial-search-keyboard-ui-behavior",34),fa("changePosition",function(t){return e.positionChange.emit(t)}),sa(),oa(54,"ccf-xyz-position",35),sa(),sa(),sa()}2&t&&(ws(16),tl(e.sex.charAt(0).toUpperCase()+e.sex.slice(1)),ws(5),tl(e.referenceOrgan.name),ws(8),na("max",e.radiusSettings.max)("min",e.radiusSettings.min)("step",1)("value",e.radius),ws(2),el("",e.radius," mm"),ws(2),ja("disabled",e.radius===e.radiusSettings.defaultValue&&e.position===e.defaultPosition),ws(6),na("tissueBlocks",e.tissueBlocks),ws(1),na("termList",e.anatomicalStructures),ws(1),na("termList",e.cellTypes),ws(1),ja("disabled",0===(null==e.tissueBlocks?null:e.tissueBlocks.length)),ws(6),na("scene",e.scene)("bounds",e.sceneBounds)("target",e.sceneTarget),ws(3),na("interactive",!1)("scene",e.scene)("bounds",e.sceneBounds)("target",e.sceneTarget),ws(2),na("delta",1)("shiftDelta",2)("position",e.position),ws(1),na("x",e.position.x)("y",e.position.y)("z",e.position.z))},directives:[R_,T_,KY,F$,d0,f0,CK,y0,EQ],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;align-items:flex-start;padding:2rem;grid-gap:1rem;gap:1rem;height:95vh;width:78vw;border-radius:.25rem;min-height:45rem;min-width:60rem}[_nghost-%COMP%] .header[_ngcontent-%COMP%]{display:flex;width:100%}[_nghost-%COMP%] .header[_ngcontent-%COMP%] .info[_ngcontent-%COMP%], [_nghost-%COMP%] .header[_ngcontent-%COMP%] .close[_ngcontent-%COMP%]{padding:0;background:none;border:none;cursor:pointer;outline:none;border-radius:.25rem;transition:.6s}[_nghost-%COMP%] .header[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{display:flex;align-items:center;margin-right:1rem}[_nghost-%COMP%] .header[_ngcontent-%COMP%] .close[_ngcontent-%COMP%]{margin-left:auto}[_nghost-%COMP%] .content[_ngcontent-%COMP%]{display:flex;width:100%;height:calc(100% - 3.5rem)}[_nghost-%COMP%] .content[_ngcontent-%COMP%] .button[_ngcontent-%COMP%]{border-width:1px;border-style:solid;border-radius:.25rem;font-size:.875rem;height:2rem;line-height:2rem;transition:.5s}[_nghost-%COMP%] .content[_ngcontent-%COMP%] .button.disabled[_ngcontent-%COMP%]{opacity:.5;pointer-events:none}[_nghost-%COMP%] .content[_ngcontent-%COMP%] .info-panel[_ngcontent-%COMP%]{display:flex;flex-direction:column;margin-right:2rem;grid-gap:1rem;gap:1rem;width:25rem}[_nghost-%COMP%] .content[_ngcontent-%COMP%] .info-panel[_ngcontent-%COMP%] .organ-sex-selection[_ngcontent-%COMP%]{display:flex;font-size:1rem;justify-content:space-between}[_nghost-%COMP%] .content[_ngcontent-%COMP%] .info-panel[_ngcontent-%COMP%] .organ-sex-selection[_ngcontent-%COMP%] .sex[_ngcontent-%COMP%], [_nghost-%COMP%] .content[_ngcontent-%COMP%] .info-panel[_ngcontent-%COMP%] .organ-sex-selection[_ngcontent-%COMP%] .organ[_ngcontent-%COMP%]{display:flex}[_nghost-%COMP%] .content[_ngcontent-%COMP%] .info-panel[_ngcontent-%COMP%] .organ-sex-selection[_ngcontent-%COMP%] .sex[_ngcontent-%COMP%] .label[_ngcontent-%COMP%], [_nghost-%COMP%] .content[_ngcontent-%COMP%] .info-panel[_ngcontent-%COMP%] .organ-sex-selection[_ngcontent-%COMP%] .organ[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{font-weight:300;margin-right:.5rem}[_nghost-%COMP%] .content[_ngcontent-%COMP%] .info-panel[_ngcontent-%COMP%] .organ-sex-selection[_ngcontent-%COMP%] .sex[_ngcontent-%COMP%] .current-sex[_ngcontent-%COMP%], [_nghost-%COMP%] .content[_ngcontent-%COMP%] .info-panel[_ngcontent-%COMP%] .organ-sex-selection[_ngcontent-%COMP%] .sex[_ngcontent-%COMP%] .current-organ[_ngcontent-%COMP%], [_nghost-%COMP%] .content[_ngcontent-%COMP%] .info-panel[_ngcontent-%COMP%] .organ-sex-selection[_ngcontent-%COMP%] .organ[_ngcontent-%COMP%] .current-sex[_ngcontent-%COMP%], [_nghost-%COMP%] .content[_ngcontent-%COMP%] .info-panel[_ngcontent-%COMP%] .organ-sex-selection[_ngcontent-%COMP%] .organ[_ngcontent-%COMP%] .current-organ[_ngcontent-%COMP%]{font-weight:600}[_nghost-%COMP%] .content[_ngcontent-%COMP%] .info-panel[_ngcontent-%COMP%] .organ-sex-selection[_ngcontent-%COMP%] .edit[_ngcontent-%COMP%]{cursor:pointer}[_nghost-%COMP%] .content[_ngcontent-%COMP%] .info-panel[_ngcontent-%COMP%] .radius-slider[_ngcontent-%COMP%]{display:flex;flex-direction:column}[_nghost-%COMP%] .content[_ngcontent-%COMP%] .info-panel[_ngcontent-%COMP%] .radius-slider[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-weight:600;font-size:1rem}[_nghost-%COMP%] .content[_ngcontent-%COMP%] .info-panel[_ngcontent-%COMP%] .radius-slider[_ngcontent-%COMP%] .slider-container[_ngcontent-%COMP%]{display:flex;justify-content:space-between}[_nghost-%COMP%] .content[_ngcontent-%COMP%] .info-panel[_ngcontent-%COMP%] .radius-slider[_ngcontent-%COMP%] .slider-container[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%]{width:19rem}[_nghost-%COMP%] .content[_ngcontent-%COMP%] .info-panel[_ngcontent-%COMP%] .radius-slider[_ngcontent-%COMP%] .slider-container[_ngcontent-%COMP%] .value[_ngcontent-%COMP%]{display:flex;align-items:center;font-size:1rem}[_nghost-%COMP%] .content[_ngcontent-%COMP%] .info-panel[_ngcontent-%COMP%] .radius-slider[_ngcontent-%COMP%] .reset-buttons[_ngcontent-%COMP%]{display:flex;justify-content:space-between}[_nghost-%COMP%] .content[_ngcontent-%COMP%] .info-panel[_ngcontent-%COMP%] .radius-slider[_ngcontent-%COMP%] .reset-buttons[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{width:11.5rem}[_nghost-%COMP%] .content[_ngcontent-%COMP%] .info-panel[_ngcontent-%COMP%] .results[_ngcontent-%COMP%]{height:calc(100% - 15rem - 2px)}[_nghost-%COMP%] .content[_ngcontent-%COMP%] .info-panel[_ngcontent-%COMP%] .results[_ngcontent-%COMP%] .list[_ngcontent-%COMP%]{height:33%;display:flex;flex-direction:column}[_nghost-%COMP%] .content[_ngcontent-%COMP%] .spatial-search-scene[_ngcontent-%COMP%]{display:flex;width:calc(100% - 25rem);background-color:#000;border-radius:.5rem}[_nghost-%COMP%] .content[_ngcontent-%COMP%] .spatial-search-scene[_ngcontent-%COMP%] .primary-scene-wrapper[_ngcontent-%COMP%]{display:flex;flex-direction:column;width:100%;height:100%}[_nghost-%COMP%] .content[_ngcontent-%COMP%] .spatial-search-scene[_ngcontent-%COMP%] .primary-scene-wrapper[_ngcontent-%COMP%] .primary-scene[_ngcontent-%COMP%]{flex:auto;overflow:hidden}[_nghost-%COMP%] .content[_ngcontent-%COMP%] .spatial-search-scene[_ngcontent-%COMP%] .primary-scene-wrapper[_ngcontent-%COMP%] .body-ui-hint[_ngcontent-%COMP%]{color:#fff;font-size:1rem;margin:1rem}[_nghost-%COMP%] .content[_ngcontent-%COMP%] .spatial-search-scene[_ngcontent-%COMP%] .sidebar[_ngcontent-%COMP%] .minimap-scene[_ngcontent-%COMP%]{margin:1.5rem;width:12.75rem;height:11rem}[_nghost-%COMP%] .content[_ngcontent-%COMP%] .spatial-search-scene[_ngcontent-%COMP%] .sidebar[_ngcontent-%COMP%] .minimap-scene[_ngcontent-%COMP%] .body-ui{background-color:#232f3a}[_nghost-%COMP%] .content[_ngcontent-%COMP%] .spatial-search-scene[_ngcontent-%COMP%] .sidebar[_ngcontent-%COMP%] ccf-spatial-search-keyboard-ui-behavior[_ngcontent-%COMP%]{margin:1.5rem;display:flex;justify-content:center}[_nghost-%COMP%] .content[_ngcontent-%COMP%] .spatial-search-scene[_ngcontent-%COMP%] .sidebar[_ngcontent-%COMP%] ccf-xyz-position[_ngcontent-%COMP%]{margin:1.5rem;padding-left:5rem}"],changeDetection:0}),t})();function _0(t,e){if(1&t){const t=ua();ra(0,"ccf-spatial-search-ui",1),fa("addSpatialSearch",function(){return $e(t),va().addSpatialSearch()})("radiusChange",function(e){return $e(t),va().updateRadius(e)})("resetPosition",function(){return $e(t),va().resetPosition()})("resetSphere",function(){return $e(t),va().resetRadius()})("positionChange",function(e){return $e(t),va().updatePosition(e)})("closeSpatialSearch",function(){return $e(t),va().close()})("editReferenceOrganClicked",function(){return $e(t),va().openSpatialSearchConfig()})("infoClicked",function(){return $e(t),va().onDialogButtonClick()})("nodeClicked",function(e){return $e(t),va().moveToNode(e)}),Dc(1,"async"),Dc(2,"async"),Dc(3,"async"),Dc(4,"async"),Dc(5,"async"),Dc(6,"async"),Dc(7,"async"),Dc(8,"async"),Dc(9,"async"),Dc(10,"async"),Dc(11,"async"),sa()}if(2&t){const t=e.ngIf,n=va();na("sex",Rc(1,12,n.sex$))("referenceOrgan",t)("radius",Rc(2,14,n.radius$))("radiusSettings",Rc(3,16,n.radiusSettings$))("defaultPosition",Rc(4,18,n.defaultPosition$))("position",Rc(5,20,n.position$))("scene",Rc(6,22,n.scene$))("sceneBounds",Rc(7,24,n.sceneBounds$))("sceneTarget",Rc(8,26,n.sceneTarget$))("tissueBlocks",Rc(9,28,n.tissueBlocks$))("anatomicalStructures",Rc(10,30,n.anatomicalStructures$))("cellTypes",Rc(11,32,n.cellTypes$))}}class w0{constructor(t,e,n){this.dialogRef=t,this.dialog=e,this.infoService=n,this.updatePosition=NQ(NZ),this.resetPosition=NQ(jZ),this.moveToNode=NQ(LZ),this.updateRadius=NQ(FZ),this.resetRadius=NQ(BZ),this.subscriptions=new g}launchInfoDialog(t){this.subscriptions.unsubscribe(),this.dialog.open(UK,{autoFocus:!1,panelClass:"modal-animated",width:"72rem",data:{title:t.infoTitle,content:t.content,videoID:t.videoID}})}onDialogButtonClick(){this.infoService.updateData("assets/docs/SPATIAL_SEARCH_README.md","UfxMpzatowE","Spatial Search");const t=this.infoService.panelContent.asObservable();this.subscriptions.add(t.subscribe(t=>{t.content.length&&(this.panelData=t,this.launchInfoDialog(this.panelData))}))}close(){this.dialogRef.close()}addSpatialSearch(){return this.close(),new zZ}openSpatialSearchConfig(){this.close(),this.dialog.open(B0)}}w0.\u0275fac=function(t){return new(t||w0)(ea(Y$),ea(nG),ea($K))},w0.\u0275cmp=Jt({type:w0,selectors:[["ccf-spatial-search-ui-behavior"]],decls:2,vars:3,consts:[[3,"sex","referenceOrgan","radius","radiusSettings","defaultPosition","position","scene","sceneBounds","sceneTarget","tissueBlocks","anatomicalStructures","cellTypes","addSpatialSearch","radiusChange","resetPosition","resetSphere","positionChange","closeSpatialSearch","editReferenceOrganClicked","infoClicked","nodeClicked",4,"ngIf"],[3,"sex","referenceOrgan","radius","radiusSettings","defaultPosition","position","scene","sceneBounds","sceneTarget","tissueBlocks","anatomicalStructures","cellTypes","addSpatialSearch","radiusChange","resetPosition","resetSphere","positionChange","closeSpatialSearch","editReferenceOrganClicked","infoClicked","nodeClicked"]],template:function(t,e){1&t&&(Jo(0,_0,12,34,"ccf-spatial-search-ui",0),Dc(1,"async")),2&t&&na("ngIf",Rc(1,1,e.organ$))},directives:[Ah,v0],pipes:[$h],encapsulation:2,changeDetection:0}),vw([iU(u0.scene)],w0.prototype,"scene$",void 0),vw([iU(u0.sceneBounds)],w0.prototype,"sceneBounds$",void 0),vw([iU(u0.sceneTarget)],w0.prototype,"sceneTarget$",void 0),vw([iU(u0.sex)],w0.prototype,"sex$",void 0),vw([iU(u0.organ)],w0.prototype,"organ$",void 0),vw([iU(u0.position)],w0.prototype,"position$",void 0),vw([iU(u0.defaultPosition)],w0.prototype,"defaultPosition$",void 0),vw([iU(u0.radius)],w0.prototype,"radius$",void 0),vw([iU(u0.radiusSettings)],w0.prototype,"radiusSettings$",void 0),vw([iU(u0.tissueBlocks)],w0.prototype,"tissueBlocks$",void 0),vw([iU(u0.anatomicalStructures)],w0.prototype,"anatomicalStructures$",void 0),vw([iU(u0.cellTypes)],w0.prototype,"cellTypes$",void 0),vw([XY()],w0.prototype,"updatePosition",void 0),vw([XY()],w0.prototype,"resetPosition",void 0),vw([XY()],w0.prototype,"moveToNode",void 0),vw([XY()],w0.prototype,"updateRadius",void 0),vw([XY()],w0.prototype,"resetRadius",void 0),vw([XY()],w0.prototype,"addSpatialSearch",null);const x0=["input"],S0=function(t){return{enterDuration:t}},C0=["*"],E0=new oi("mat-radio-default-options",{providedIn:"root",factory:function(){return{color:"accent"}}});let O0=0;const T0={provide:aU,useExisting:pt(()=>M0),multi:!0};class k0{constructor(t,e){this.source=t,this.value=e}}const P0=new oi("MatRadioGroup");let A0=(()=>{class t{constructor(t){this._changeDetector=t,this._value=null,this._name="mat-radio-group-"+O0++,this._selected=null,this._isInitialized=!1,this._labelPosition="after",this._disabled=!1,this._required=!1,this._controlValueAccessorChangeFn=()=>{},this.onTouched=()=>{},this.change=new Bc}get name(){return this._name}set name(t){this._name=t,this._updateRadioButtonNames()}get labelPosition(){return this._labelPosition}set labelPosition(t){this._labelPosition="before"===t?"before":"after",this._markRadiosForCheck()}get value(){return this._value}set value(t){this._value!==t&&(this._value=t,this._updateSelectedRadioFromValue(),this._checkSelectedRadioButton())}_checkSelectedRadioButton(){this._selected&&!this._selected.checked&&(this._selected.checked=!0)}get selected(){return this._selected}set selected(t){this._selected=t,this.value=t?t.value:null,this._checkSelectedRadioButton()}get disabled(){return this._disabled}set disabled(t){this._disabled=kd(t),this._markRadiosForCheck()}get required(){return this._required}set required(t){this._required=kd(t),this._markRadiosForCheck()}ngAfterContentInit(){this._isInitialized=!0}_touch(){this.onTouched&&this.onTouched()}_updateRadioButtonNames(){this._radios&&this._radios.forEach(t=>{t.name=this.name,t._markForCheck()})}_updateSelectedRadioFromValue(){this._radios&&(null===this._selected||this._selected.value!==this._value)&&(this._selected=null,this._radios.forEach(t=>{t.checked=this.value===t.value,t.checked&&(this._selected=t)}))}_emitChangeEvent(){this._isInitialized&&this.change.emit(new k0(this._selected,this._value))}_markRadiosForCheck(){this._radios&&this._radios.forEach(t=>t._markForCheck())}writeValue(t){this.value=t,this._changeDetector.markForCheck()}registerOnChange(t){this._controlValueAccessorChangeFn=t}registerOnTouched(t){this.onTouched=t}setDisabledState(t){this.disabled=t,this._changeDetector.markForCheck()}}return t.\u0275fac=function(e){return new(e||t)(ea(nc))},t.\u0275dir=se({type:t,inputs:{name:"name",labelPosition:"labelPosition",value:"value",selected:"selected",disabled:"disabled",required:"required",color:"color"},outputs:{change:"change"}}),t})(),M0=(()=>{class t extends A0{}return t.\u0275fac=function(){let e;return function(n){return(e||(e=ei(t)))(n||t)}}(),t.\u0275dir=se({type:t,selectors:[["mat-radio-group"]],contentQueries:function(t,e,n){if(1&t&&Jc(n,N0,5),2&t){let t;Qc(t=tu())&&(e._radios=t)}},hostAttrs:["role","radiogroup",1,"mat-radio-group"],exportAs:["matRadioGroup"],features:[xl([T0,{provide:P0,useExisting:t}]),jo]}),t})();class I0{constructor(t){this._elementRef=t}}const D0=Yy(Ky(I0));let R0=(()=>{class t extends D0{constructor(t,e,n,i,r,s,o,a){super(e),this._changeDetector=n,this._focusMonitor=i,this._radioDispatcher=r,this._providerOverride=o,this._uniqueId="mat-radio-"+ ++O0,this.id=this._uniqueId,this.change=new Bc,this._checked=!1,this._value=null,this._removeUniqueSelectionListener=()=>{},this.radioGroup=t,this._noopAnimations="NoopAnimations"===s,a&&(this.tabIndex=Pd(a,0)),this._removeUniqueSelectionListener=r.listen((t,e)=>{t!==this.id&&e===this.name&&(this.checked=!1)})}get checked(){return this._checked}set checked(t){const e=kd(t);this._checked!==e&&(this._checked=e,e&&this.radioGroup&&this.radioGroup.value!==this.value?this.radioGroup.selected=this:!e&&this.radioGroup&&this.radioGroup.value===this.value&&(this.radioGroup.selected=null),e&&this._radioDispatcher.notify(this.id,this.name),this._changeDetector.markForCheck())}get value(){return this._value}set value(t){this._value!==t&&(this._value=t,null!==this.radioGroup&&(this.checked||(this.checked=this.radioGroup.value===t),this.checked&&(this.radioGroup.selected=this)))}get labelPosition(){return this._labelPosition||this.radioGroup&&this.radioGroup.labelPosition||"after"}set labelPosition(t){this._labelPosition=t}get disabled(){return this._disabled||null!==this.radioGroup&&this.radioGroup.disabled}set disabled(t){this._setDisabled(kd(t))}get required(){return this._required||this.radioGroup&&this.radioGroup.required}set required(t){this._required=kd(t)}get color(){return this._color||this.radioGroup&&this.radioGroup.color||this._providerOverride&&this._providerOverride.color||"accent"}set color(t){this._color=t}get inputId(){return`${this.id||this._uniqueId}-input`}focus(t,e){e?this._focusMonitor.focusVia(this._inputElement,e,t):this._inputElement.nativeElement.focus(t)}_markForCheck(){this._changeDetector.markForCheck()}ngOnInit(){this.radioGroup&&(this.checked=this.radioGroup.value===this._value,this.checked&&(this.radioGroup.selected=this),this.name=this.radioGroup.name)}ngAfterViewInit(){this._focusMonitor.monitor(this._elementRef,!0).subscribe(t=>{!t&&this.radioGroup&&this.radioGroup._touch()})}ngOnDestroy(){this._focusMonitor.stopMonitoring(this._elementRef),this._removeUniqueSelectionListener()}_emitChangeEvent(){this.change.emit(new k0(this,this._value))}_isRippleDisabled(){return this.disableRipple||this.disabled}_onInputClick(t){t.stopPropagation()}_onInputInteraction(t){if(t.stopPropagation(),!this.checked&&!this.disabled){const t=this.radioGroup&&this.value!==this.radioGroup.value;this.checked=!0,this._emitChangeEvent(),this.radioGroup&&(this.radioGroup._controlValueAccessorChangeFn(this.value),t&&this.radioGroup._emitChangeEvent())}}_setDisabled(t){this._disabled!==t&&(this._disabled=t,this._changeDetector.markForCheck())}}return t.\u0275fac=function(e){return new(e||t)(ea(A0),ea(Al),ea(nc),ea(Ug),ea(zp),ea(String),ea(void 0),ea(String))},t.\u0275dir=se({type:t,viewQuery:function(t,e){if(1&t&&Zc(x0,5),2&t){let t;Qc(t=tu())&&(e._inputElement=t.first)}},inputs:{id:"id",checked:"checked",value:"value",labelPosition:"labelPosition",disabled:"disabled",required:"required",color:"color",name:"name",ariaLabel:["aria-label","ariaLabel"],ariaLabelledby:["aria-labelledby","ariaLabelledby"],ariaDescribedby:["aria-describedby","ariaDescribedby"]},outputs:{change:"change"},features:[jo]}),t})(),N0=(()=>{class t extends R0{constructor(t,e,n,i,r,s,o,a){super(t,e,n,i,r,s,o,a)}}return t.\u0275fac=function(e){return new(e||t)(ea(P0,8),ea(Al),ea(nc),ea(Ug),ea(zp),ea(Ny,8),ea(E0,8),ii("tabindex"))},t.\u0275cmp=Jt({type:t,selectors:[["mat-radio-button"]],hostAttrs:[1,"mat-radio-button"],hostVars:17,hostBindings:function(t,e){1&t&&fa("focus",function(){return e._inputElement.nativeElement.focus()}),2&t&&(Ko("tabindex",null)("id",e.id)("aria-label",null)("aria-labelledby",null)("aria-describedby",null),ja("mat-radio-checked",e.checked)("mat-radio-disabled",e.disabled)("_mat-animation-noopable",e._noopAnimations)("mat-primary","primary"===e.color)("mat-accent","accent"===e.color)("mat-warn","warn"===e.color))},inputs:{disableRipple:"disableRipple",tabIndex:"tabIndex"},exportAs:["matRadioButton"],features:[jo],ngContentSelectors:C0,decls:13,vars:20,consts:[[1,"mat-radio-label"],["label",""],[1,"mat-radio-container"],[1,"mat-radio-outer-circle"],[1,"mat-radio-inner-circle"],["type","radio",1,"mat-radio-input","cdk-visually-hidden",3,"id","checked","disabled","tabIndex","required","change","click"],["input",""],["mat-ripple","",1,"mat-radio-ripple","mat-focus-indicator",3,"matRippleTrigger","matRippleDisabled","matRippleCentered","matRippleRadius","matRippleAnimation"],[1,"mat-ripple-element","mat-radio-persistent-ripple"],[1,"mat-radio-label-content"],[2,"display","none"]],template:function(t,e){if(1&t&&(wa(),ra(0,"label",0,1),ra(2,"span",2),oa(3,"span",3),oa(4,"span",4),ra(5,"input",5,6),fa("change",function(t){return e._onInputInteraction(t)})("click",function(t){return e._onInputClick(t)}),sa(),ra(7,"span",7),oa(8,"span",8),sa(),sa(),ra(9,"span",9),ra(10,"span",10),Ja(11,"\xa0"),sa(),xa(12),sa(),sa()),2&t){const t=ta(1);Ko("for",e.inputId),ws(5),na("id",e.inputId)("checked",e.checked)("disabled",e.disabled)("tabIndex",e.tabIndex)("required",e.required),Ko("name",e.name)("value",e.value)("aria-label",e.ariaLabel)("aria-labelledby",e.ariaLabelledby)("aria-describedby",e.ariaDescribedby),ws(2),na("matRippleTrigger",t)("matRippleDisabled",e._isRippleDisabled())("matRippleCentered",!0)("matRippleRadius",20)("matRippleAnimation",Pc(18,S0,e._noopAnimations?0:150)),ws(2),ja("mat-radio-label-before","before"==e.labelPosition)}},directives:[cv],styles:[".mat-radio-button{display:inline-block;-webkit-tap-highlight-color:transparent;outline:0}.mat-radio-label{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;display:inline-flex;align-items:center;white-space:nowrap;vertical-align:middle;width:100%}.mat-radio-container{box-sizing:border-box;display:inline-block;position:relative;width:20px;height:20px;flex-shrink:0}.mat-radio-outer-circle{box-sizing:border-box;display:block;height:20px;left:0;position:absolute;top:0;transition:border-color ease 280ms;width:20px;border-width:2px;border-style:solid;border-radius:50%}._mat-animation-noopable .mat-radio-outer-circle{transition:none}.mat-radio-inner-circle{border-radius:50%;box-sizing:border-box;display:block;height:20px;left:0;position:absolute;top:0;opacity:0;transition:transform ease 280ms,background-color ease 280ms,opacity linear 1ms 280ms;width:20px;transform:scale(0.001);-webkit-print-color-adjust:exact;color-adjust:exact}.mat-radio-checked .mat-radio-inner-circle{transform:scale(0.5);opacity:1;transition:transform ease 280ms,background-color ease 280ms}.cdk-high-contrast-active .mat-radio-checked .mat-radio-inner-circle{border:solid 10px}._mat-animation-noopable .mat-radio-inner-circle{transition:none}.mat-radio-label-content{-webkit-user-select:auto;-moz-user-select:auto;-ms-user-select:auto;user-select:auto;display:inline-block;order:0;line-height:inherit;padding-left:8px;padding-right:0}[dir=rtl] .mat-radio-label-content{padding-right:8px;padding-left:0}.mat-radio-label-content.mat-radio-label-before{order:-1;padding-left:0;padding-right:8px}[dir=rtl] .mat-radio-label-content.mat-radio-label-before{padding-right:0;padding-left:8px}.mat-radio-disabled,.mat-radio-disabled .mat-radio-label{cursor:default}.mat-radio-button .mat-radio-ripple{position:absolute;left:calc(50% - 20px);top:calc(50% - 20px);height:40px;width:40px;z-index:1;pointer-events:none}.mat-radio-button .mat-radio-ripple .mat-ripple-element:not(.mat-radio-persistent-ripple){opacity:.16}.mat-radio-persistent-ripple{width:100%;height:100%;transform:none;top:0;left:0}.mat-radio-container:hover .mat-radio-persistent-ripple{opacity:.04}.mat-radio-button:not(.mat-radio-disabled).cdk-keyboard-focused .mat-radio-persistent-ripple,.mat-radio-button:not(.mat-radio-disabled).cdk-program-focused .mat-radio-persistent-ripple{opacity:.12}.mat-radio-persistent-ripple,.mat-radio-disabled .mat-radio-container:hover .mat-radio-persistent-ripple{opacity:0}@media(hover: none){.mat-radio-container:hover .mat-radio-persistent-ripple{display:none}}.mat-radio-input{bottom:0;left:50%}.cdk-high-contrast-active .mat-radio-button:not(.mat-radio-disabled).cdk-keyboard-focused .mat-radio-ripple,.cdk-high-contrast-active .mat-radio-button:not(.mat-radio-disabled).cdk-program-focused .mat-radio-ripple{outline:solid 3px}.cdk-high-contrast-active .mat-radio-disabled{opacity:.5}\n"],encapsulation:2,changeDetection:0}),t})();function L0(t,e){1&t&&(ra(0,"div",7),Ja(1,"Organs"),sa())}function j0(t,e){if(1&t&&(ra(0,"mat-option",17),Ja(1),sa()),2&t){const t=e.$implicit;na("value",t),ws(1),el(" ",t.name," ")}}let F0=(()=>{class t{constructor(){this.className="ccf-spatial-search-config",this.updateSex=new Bc,this.updateOrgan=new Bc,this.buttonClicked=new Bc,this.closeDialog=new Bc,this.infoClicked=new Bc}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Jt({type:t,selectors:[["ccf-spatial-search-config"]],hostVars:2,hostBindings:function(t,e){2&t&&Va(e.className)},inputs:{organs:"organs",selectedOrgan:"selectedOrgan",sex:"sex"},outputs:{updateSex:"updateSex",updateOrgan:"updateOrgan",buttonClicked:"buttonClicked",closeDialog:"closeDialog",infoClicked:"infoClicked"},decls:27,vars:6,consts:[[1,"header"],[1,"header-left"],[1,"title"],["mat-icon-button","",1,"info"],[3,"click"],["mat-icon-button","",1,"close"],[1,"sex-toggle"],[1,"label"],[1,"radio-group",3,"ngModel","ngModelChange","change"],["value","male",1,"radio"],["value","female",1,"radio"],[1,"organ-selector"],["appearance","fill",1,"form-field"],["class","label",4,"ngIf"],["disableOptionCentering","true","panelClass","organ-select",3,"value","valueChange","selectionChange"],["class","organ-select-option",3,"value",4,"ngFor","ngForOf"],["mat-button","",1,"continue-button",3,"click"],[1,"organ-select-option",3,"value"]],template:function(t,e){1&t&&(ra(0,"div",0),ra(1,"div",1),ra(2,"div",2),Ja(3,"Configure Spatial Search"),sa(),ra(4,"button",3),ra(5,"mat-icon",4),fa("click",function(){return e.infoClicked.emit()}),Ja(6,"info"),sa(),sa(),sa(),ra(7,"button",5),ra(8,"mat-icon",4),fa("click",function(){return e.closeDialog.emit()}),Ja(9,"close"),sa(),sa(),sa(),ra(10,"div",6),ra(11,"div",7),Ja(12,"Donor Sex: "),sa(),ra(13,"mat-radio-group",8),fa("ngModelChange",function(t){return e.sex=t})("change",function(t){return e.updateSex.emit(t.value)}),ra(14,"mat-radio-button",9),Ja(15,"Male"),sa(),ra(16,"mat-radio-button",10),Ja(17,"Female"),sa(),sa(),sa(),ra(18,"div",11),ra(19,"div",7),Ja(20,"Select an organ"),sa(),ra(21,"mat-form-field",12),Jo(22,L0,2,0,"div",13),ra(23,"mat-select",14),fa("valueChange",function(t){return e.selectedOrgan=t})("selectionChange",function(t){return e.updateOrgan.emit(t.value)}),Jo(24,j0,2,2,"mat-option",15),sa(),sa(),sa(),ra(25,"button",16),fa("click",function(){return e.buttonClicked.emit()}),Ja(26,"Continue"),sa()),2&t&&(ws(13),na("ngModel",e.sex),ws(9),na("ngIf",!e.selectedOrgan),ws(1),na("value",e.selectedOrgan),ws(1),na("ngForOf",e.organs),ws(1),ja("disabled",!e.selectedOrgan))},directives:[R_,T_,M0,MU,lH,N0,QH,Ah,aJ,kh,wv],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;align-items:flex-start;padding:2rem;grid-gap:2rem;gap:2rem;width:30.5rem;box-shadow:0 25rem 25rem #00000029;border-radius:.25rem;font-size:1rem}[_nghost-%COMP%] .button[_ngcontent-%COMP%]{cursor:pointer}[_nghost-%COMP%] .header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;width:100%;font-size:1.25rem}[_nghost-%COMP%] .header[_ngcontent-%COMP%] .header-left[_ngcontent-%COMP%]{display:flex;align-items:center}[_nghost-%COMP%] .header[_ngcontent-%COMP%] .header-left[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{margin-right:1rem}[_nghost-%COMP%] .header[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{padding:0;background:none;border:none;cursor:pointer;outline:none;border-radius:.25rem;transition:.6s}[_nghost-%COMP%] .sex-toggle[_ngcontent-%COMP%]{display:flex}[_nghost-%COMP%] .sex-toggle[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{margin-right:2rem}[_nghost-%COMP%] .sex-toggle[_ngcontent-%COMP%] .radio[_ngcontent-%COMP%]{margin-right:4rem}[_nghost-%COMP%] .organ-selector[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{height:0rem}[_nghost-%COMP%] .organ-selector[_ngcontent-%COMP%] .mat-form-field-wrapper{padding-bottom:1rem;padding-top:3rem;margin-left:.5rem;width:14rem}[_nghost-%COMP%] .organ-selector[_ngcontent-%COMP%] .mat-form-field-wrapper .mat-form-field-infix{padding:0;border-top:none}[_nghost-%COMP%] .organ-selector[_ngcontent-%COMP%] .mat-form-field-wrapper .mat-form-field-underline{bottom:0rem;height:.125rem}[_nghost-%COMP%] .organ-selector[_ngcontent-%COMP%] .mat-form-field-wrapper .mat-select-arrow-wrapper{transform:translatey(0)}[_nghost-%COMP%] .continue-button[_ngcontent-%COMP%]{display:flex;flex-direction:row;justify-content:center;align-items:center;padding:.25rem 1rem;width:14rem;height:2rem;border-width:1px;border-style:solid;border-radius:.25rem;box-shadow:0 2px 6px #00000029}[_nghost-%COMP%] .continue-button.disabled[_ngcontent-%COMP%]{pointer-events:none;opacity:.5} .organ-select{position:absolute;top:2.5rem;left:-.25rem;border-radius:.5rem;max-height:24.5rem;width:14rem} .organ-select .organ-select-option{height:3.5rem;border-bottom:1px solid}"],changeDetection:0}),t})();class B0{constructor(t,e,n,i){this.dialog=t,this.dialogRef=e,this.spatialSearchDialog=n,this.infoService=i,this.updateSex=NQ(DZ),this.updateOrgan=NQ(RZ),this.subscriptions=new g,this.dialogSubs=new g}buttonClicked(){this.spatialSearchDialog.open(w0),this.close()}close(){this.dialogRef.close()}launchInfoDialog(t){this.dialogSubs.unsubscribe(),this.dialog.open(UK,{autoFocus:!1,panelClass:"modal-animated",width:"72rem",data:{title:t.infoTitle,content:t.content,videoID:t.videoID}})}onDialogButtonClick(){this.infoService.updateData("assets/docs/SPATIAL_SEARCH_README.md","UfxMpzatowE","Spatial Search");const t=this.infoService.panelContent.asObservable();this.dialogSubs.add(t.subscribe(t=>{t.content.length&&(this.panelData=t,this.launchInfoDialog(this.panelData))}))}ngOnDestroy(){this.subscriptions.unsubscribe()}}B0.\u0275fac=function(t){return new(t||B0)(ea(nG),ea(Y$),ea(nG),ea($K))},B0.\u0275cmp=Jt({type:B0,selectors:[["ccf-spatial-search-config-behavior"]],decls:4,vars:9,consts:[[3,"sex","organs","selectedOrgan","updateSex","updateOrgan","closeDialog","buttonClicked","infoClicked"]],template:function(t,e){1&t&&(ra(0,"ccf-spatial-search-config",0),fa("updateSex",function(t){return e.updateSex(t)})("updateOrgan",function(t){return e.updateOrgan(t.id)})("closeDialog",function(){return e.close()})("buttonClicked",function(){return e.buttonClicked()})("infoClicked",function(){return e.onDialogButtonClick()}),Dc(1,"async"),Dc(2,"async"),Dc(3,"async"),sa()),2&t&&na("sex",Rc(1,3,e.sex$))("organs",Rc(2,5,e.organs$))("selectedOrgan",Rc(3,7,e.selectedOrgan$))},directives:[F0],pipes:[$h],encapsulation:2,changeDetection:0}),vw([iU(u0.sex)],B0.prototype,"sex$",void 0),vw([iU(u0.organ)],B0.prototype,"selectedOrgan$",void 0),vw([iU(u0.organs)],B0.prototype,"organs$",void 0),vw([XY()],B0.prototype,"updateSex",void 0),vw([XY()],B0.prototype,"updateOrgan",void 0);let V0=(()=>{class t{constructor(t,e){this.store=t,this.dialog=e,this.className="ccf-run-spatial-search"}startSpatialSearchFlow(){this.store.dispatch(new IZ).pipe(rf(1),eg(()=>this.dialog.open(B0))).subscribe()}}return t.\u0275fac=function(e){return new(e||t)(ea(qz),ea(nG))},t.\u0275cmp=Jt({type:t,selectors:[["ccf-run-spatial-search"]],hostVars:2,hostBindings:function(t,e){2&t&&Va(e.className)},decls:4,vars:0,consts:[["mat-button","",1,"run-spatial-search-button",3,"click"]],template:function(t,e){1&t&&(ra(0,"button",0),fa("click",function(){return e.startSpatialSearchFlow()}),Ja(1," Run Spatial Search "),ra(2,"mat-icon"),Ja(3,"travel_explore"),sa(),sa())},directives:[R_,T_],styles:["[_nghost-%COMP%] .run-spatial-search-button[_ngcontent-%COMP%] .mat-button-wrapper{display:flex;align-items:center}[_nghost-%COMP%] .run-spatial-search-button[_ngcontent-%COMP%] .mat-button-wrapper .mat-icon{margin-left:9.75px}"],changeDetection:0}),t})();function z0(t,e){if(1&t){const t=ua();ra(0,"div",14),ra(1,"ccf-spatial-search-list",15),fa("selectionChanged",function(e){return $e(t),va().updateSearchSelection(e)})("itemRemoved",function(e){return $e(t),va().spatialSearchRemoved.emit(e.id)}),sa(),sa()}if(2&t){const t=va();ja("hidden",t.hidden),ws(1),na("items",t.spatialSearchFilters)}}const U0=function(){return["Both","Male","Female"]},H0=function(){return[1,110]},$0=function(){return[13,83]};let G0=(()=>{class t{constructor(t){this.ga=t,this.spatialSearchFilters=[],this.filtersChange=new Bc,this.spatialSearchSelected=new Bc,this.spatialSearchRemoved=new Bc,this.applyFilters=new Bc}ngOnChanges(t){"spatialSearchFilters"in t&&this.updateSexFromSelection(this.spatialSearchFilters.filter(t=>t.selected))}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.updateSearchSelection(this.spatialSearchFilters.filter(t=>t.selected)),this.ga.event("filters_applied","filter_content"),this.applyFilters.emit(this.filters)}refreshFilters(){this.filters=JSON.parse(JSON.stringify(UQ)),this.ga.event("filters_reset","filter_content"),this.spatialSearchSelected.emit([]),this.filtersChange.emit(this.filters)}updateSearchSelection(t){const e=t.map(t=>t.search);this.spatialSearchSelected.emit(t),this.updateFilter(e,"spatialSearches"),this.updateSexFromSelection(t)}updateSexFromSelection(t){var e;const n=null===(e=this.filters.sex)||void 0===e?void 0:e.toLowerCase(),i=new Set(t.map(t=>t.sex));t.length>0&&(i.size>1||!i.has(n))&&this.updateFilter("Both","sex")}}return t.\u0275fac=function(e){return new(e||t)(ea(jW))},t.\u0275cmp=Jt({type:t,selectors:[["ccf-filters-content"]],inputs:{hidden:"hidden",filters:"filters",technologyFilters:"technologyFilters",providerFilters:"providerFilters",spatialSearchFilters:"spatialSearchFilters"},outputs:{filtersChange:"filtersChange",spatialSearchSelected:"spatialSearchSelected",spatialSearchRemoved:"spatialSearchRemoved",applyFilters:"applyFilters"},features:[ye],decls:17,vars:24,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"],["class","filter spatial-locations",3,"hidden",4,"ngIf"],[1,"button-container"],[1,"right-group"],["mat-button","",1,"outline-button",3,"click"],[1,"refresh-icon"],[1,"icon","refresh",3,"click"],[1,"filter","spatial-locations"],["label","Spatial Locations",3,"items","selectionChanged","itemRemoved"]],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(),Jo(8,z0,2,3,"div",8),ra(9,"div",9),oa(10,"ccf-run-spatial-search"),ra(11,"div",10),ra(12,"button",11),fa("click",function(){return e.applyButtonClick()}),Ja(13,"APPLY FILTERS"),sa(),ra(14,"div",12),ra(15,"mat-icon",13),fa("click",function(){return e.refreshFilters()}),Ja(16,"refresh"),sa(),sa(),sa(),sa()),2&t&&(ja("hidden",e.hidden),ws(1),na("options",kc(21,U0))("selection",null==e.filters?null:e.filters.sex),ws(1),na("valueRange",kc(22,H0))("selection",null==e.filters?null:e.filters.ageRange),ws(1),na("valueRange",kc(23,$0))("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),na("ngIf",e.spatialSearchFilters.length>0),ws(1),ja("hidden",e.hidden))},directives:[uJ,r0,o0,Ah,V0,R_,T_,SQ],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%] button{border-width:1px;border-style:solid}.button-container[_ngcontent-%COMP%]{display:flex;justify-content:space-between;margin-top:2rem}.button-container[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{border-width:1px;border-style:solid}.button-container.hidden[_ngcontent-%COMP%]{opacity:0;transition-duration:.2s}.button-container[_ngcontent-%COMP%] .right-group[_ngcontent-%COMP%]{display:flex;flex-direction:row-reverse;align-items:center}.button-container[_ngcontent-%COMP%] .right-group[_ngcontent-%COMP%] .outline-button[_ngcontent-%COMP%]{box-shadow:.1rem .1rem .2rem #0000001d}.button-container[_ngcontent-%COMP%] .right-group[_ngcontent-%COMP%] .refresh-icon[_ngcontent-%COMP%]{padding:.25rem;border-radius:.25rem;margin-right:1rem;display:flex;justify-content:center;align-items:center;transition:.6s}.button-container[_ngcontent-%COMP%] .right-group[_ngcontent-%COMP%] .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 W0(t,e){1&t&&(ra(0,"div"),ra(1,"mat-icon",7),Ja(2,"close"),sa(),sa())}function q0(t,e){1&t&&oa(0,"mat-icon",8)}class X0{constructor(){this.spatialSearchFilters=[],this.filtersChange=new Bc,this.spatialSearchSelected=new Bc,this.spatialSearchRemoved=new Bc,this.filtersVisible=!1}toggleFilterVisible(){return this.filtersVisible=!this.filtersVisible,new UZ(!1)}removeBox(){return this.filtersVisible=!1,new UZ(!0)}applyFilters(t){this.filters=t,this.filtersChange.emit(t),this.removeBox()}}X0.\u0275fac=function(t){return new(t||X0)},X0.\u0275cmp=Jt({type:X0,selectors:[["ccf-filters-popover"]],inputs:{filters:"filters",drawerExpanded:"drawerExpanded",technologyFilters:"technologyFilters",providerFilters:"providerFilters",spatialSearchFilters:"spatialSearchFilters"},outputs:{filtersChange:"filtersChange",spatialSearchSelected:"spatialSearchSelected",spatialSearchRemoved:"spatialSearchRemoved"},decls:8,vars:15,consts:[[1,"filters-popover"],[1,"show-hide",3,"click"],[4,"ngIf","ngIfElse"],["notShow",""],[1,"popup-container"],[1,"popup-body"],[3,"technologyFilters","providerFilters","spatialSearchFilters","hidden","filters","applyFilters","spatialSearchSelected","spatialSearchRemoved"],[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,W0,3,0,"div",2),Jo(3,q0,1,0,"ng-template",null,3,ru),sa(),ra(5,"div",4),ra(6,"div",5),ra(7,"ccf-filters-content",6),fa("applyFilters",function(t){return e.applyFilters(t)})("spatialSearchSelected",function(t){return e.spatialSearchSelected.emit(t)})("spatialSearchRemoved",function(t){return e.spatialSearchRemoved.emit(t)}),sa(),sa(),sa(),sa()),2&t){const t=ta(4);ja("expanded",e.drawerExpanded),ws(1),ja("open",e.filtersVisible),ws(1),na("ngIf",e.filtersVisible)("ngIfElse",t),ws(3),ja("visible",e.filtersVisible)("hidden",!e.filtersVisible),ws(2),na("technologyFilters",e.technologyFilters)("providerFilters",e.providerFilters)("spatialSearchFilters",e.spatialSearchFilters)("hidden",!e.filtersVisible)("filters",e.filters)}},directives:[Ah,G0,T_],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}.popup-container.visible[_ngcontent-%COMP%]{width:35rem;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}),vw([XY()],X0.prototype,"toggleFilterVisible",null),vw([XY()],X0.prototype,"removeBox",null);class Y0{constructor(){this.treeModel$=new _p(1),this.nodes$=this.treeModel$.pipe(D(t=>Object.values(t.nodes))),this.rootNode$=this.treeModel$.pipe(D(t=>t.nodes[t.root]))}setTreeModel(t){this.treeModel$.next(t),this.treeModel=t}filter(t){return this.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.slice(0,n),t.slice(n,n+e.length),t.slice(n+e.length)]}getChildren(t){var e,n;const i=null!==(n=null===(e=this.treeModel)||void 0===e?void 0:e.nodes)&&void 0!==n?n:{};return(0,gq.at)(i,t.children)}}Y0.\u0275fac=function(t){return new(t||Y0)},Y0.\u0275prov=xt({token:Y0,factory:Y0.\u0275fac}),vw([PV.ak],Y0.prototype,"getChildren",null);class K0 extends class{constructor(){this.expansionModel=new Vp(!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 Q0=new oi("CDK_TREE_NODE_OUTLET_NODE");let Z0=(()=>{class t{constructor(t,e){this.viewContainer=t,this._node=e}}return t.\u0275fac=function(e){return new(e||t)(ea(pc),ea(Q0,8))},t.\u0275dir=se({type:t,selectors:[["","cdkTreeNodeOutlet",""]]}),t})();class J0{constructor(t){this.$implicit=t}}let t1=(()=>{class t{constructor(t){this.template=t}}return t.\u0275fac=function(e){return new(e||t)(ea(ac))},t.\u0275dir=se({type:t,selectors:[["","cdkTreeNodeDef",""]],inputs:{when:["cdkTreeNodeDefWhen","when"]}}),t})(),e1=(()=>{class t{constructor(t,e){this._differs=t,this._changeDetectorRef=e,this._onDestroy=new A,this._levels=new Map,this.viewChange=new Jf({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)?Gd(this._dataSource)?t=this._dataSource:Array.isArray(this._dataSource)&&(t=Dd(this._dataSource)):t=this._dataSource.connect(this),t&&(this._dataSubscription=t.pipe(rp(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 J0(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),n1.mostRecentTreeNode&&(n1.mostRecentTreeNode.data=t)}}return t.\u0275fac=function(e){return new(e||t)(ea(Yl),ea(nc))},t.\u0275cmp=Jt({type:t,selectors:[["cdk-tree"]],contentQueries:function(t,e,n){if(1&t&&Jc(n,t1,5),2&t){let t;Qc(t=tu())&&(e._nodeDefs=t)}},viewQuery:function(t,e){if(1&t&&Zc(Z0,7),2&t){let t;Qc(t=tu())&&(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:[Z0],encapsulation:2}),t})(),n1=(()=>{class t{constructor(e,n){this._elementRef=e,this._tree=n,this._destroyed=new A,this._dataChanges=new A,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&&!i1(e);)e=e.parentElement;return e?e.classList.contains("cdk-nested-tree-node")?Pd(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(Al),ea(e1))},t.\u0275dir=se({type:t,selectors:[["cdk-tree-node"]],inputs:{role:"role"},exportAs:["cdkTreeNode"]}),t.mostRecentTreeNode=null,t})();function i1(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 r1=/([A-Za-z%]+)$/;let s1=(()=>{class t{constructor(t,e,n,i){this._treeNode=t,this._tree=e,this._element=n,this._dir=i,this._destroyed=new A,this.indentUnits="px",this._indent=40,this._setPadding(),i&&i.change.pipe(rp(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=Pd(t,null),this._setPadding()}_setIndentInput(t){let e=t,n="px";if("string"==typeof t){const i=t.split(r1);e=i[0],n=i[1]||n}this.indentUnits=n,this._indent=Pd(e),this._setPadding()}}return t.\u0275fac=function(e){return new(e||t)(ea(n1),ea(e1),ea(Al),ea(Fp,8))},t.\u0275dir=se({type:t,selectors:[["","cdkTreeNodePadding",""]],inputs:{level:["cdkTreeNodePadding","level"],indent:["cdkTreeNodePaddingIndent","indent"]}}),t})(),o1=(()=>{class t{constructor(t,e){this._tree=t,this._treeNode=e,this._recursive=!1}get recursive(){return this._recursive}set recursive(t){this._recursive=kd(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(e1),ea(n1))},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})(),a1=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({}),t})();const l1=Ky(qy(n1));let c1=(()=>{class t extends l1{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(Al),ea(e1),ii("tabindex"))},t.\u0275dir=se({type:t,selectors:[["mat-tree-node"]],inputs:{role:"role",disabled:"disabled",tabIndex:"tabIndex"},exportAs:["matTreeNode"],features:[xl([{provide:n1,useExisting:t}]),jo]}),t})(),u1=(()=>{class t extends t1{}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:[xl([{provide:t1,useExisting:t}]),jo]}),t})(),h1=(()=>{class t extends s1{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:[xl([{provide:s1,useExisting:t}]),jo]}),t})(),d1=(()=>{class t{constructor(t,e){this.viewContainer=t,this._node=e}}return t.\u0275fac=function(e){return new(e||t)(ea(pc),ea(Q0,8))},t.\u0275dir=se({type:t,selectors:[["","matTreeNodeOutlet",""]],features:[xl([{provide:Z0,useExisting:t}])]}),t})(),p1=(()=>{class t extends e1{}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&&Zc(d1,7),2&t){let t;Qc(t=tu())&&(e._nodeOutlet=t.first)}},hostAttrs:["role","tree",1,"mat-tree","cdk-tree"],exportAs:["matTree"],features:[xl([{provide:e1,useExisting:t}]),jo],decls:1,vars:0,consts:[["matTreeNodeOutlet",""]],template:function(t,e){1&t&&ca(0,0)},directives:[d1],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})(),f1=(()=>{class t extends o1{get recursive(){return this._recursive}set recursive(t){this._recursive=kd(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:[xl([{provide:o1,useExisting:t}]),jo]}),t})(),g1=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[a1,Wy],Wy]}),t})();class m1{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(rf(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 b1 extends class{}{constructor(t,e,n){super(),this._treeControl=t,this._treeFlattener=e,this._flattenedData=new Jf([]),this._expandedData=new Jf([]),this._data=new Jf([]),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(){}}class y1{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 y1(t,e)}}function v1(t,e){if(1&t){const t=ua();ra(0,"div",4),fa("click",function(e){const n=$e(t).node,i=va();return i.select(e.ctrlKey,n,!0,!i.isSelected(n))}),Ja(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),tl("colon"===t.label?"large intestine":t.label)}}function _1(t,e){1&t&&ca(0)}const w1=function(t){return{node:t}};function x1(t,e){if(1&t){const t=ua();ra(0,"mat-tree-node",5),fa("mouseleave",function(){$e(t);const e=ta(5);return va().mouseOut(),e.reset()}),ra(1,"div"),ra(2,"mat-icon",6),fa("mouseenter",function(){const e=$e(t).$implicit;return va().mouseOver(e)}),sa(),ra(3,"div",7),ra(4,"ccf-opacity-slider",8,9),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",10),Jo(7,_1,1,0,"ng-container",11),ra(8,"div",12),Ja(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",Pc(18,w1,t)),ws(1),ja("suborgan",t.level>1),ws(1),tl(n.occurenceData[t.original.id]||0)}}function S1(t,e){1&t&&ca(0)}function C1(t,e){if(1&t){const t=ua();ra(0,"mat-tree-node",13),fa("mouseleave",function(){$e(t);const e=ta(5);return va().mouseOut(),e.reset()}),ra(1,"div"),ra(2,"mat-icon",6),fa("mouseenter",function(){const e=$e(t).$implicit;return va().mouseOver(e)}),sa(),ra(3,"div",7),ra(4,"ccf-opacity-slider",8,14),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",15),ra(7,"mat-icon",16),Ja(8),sa(),sa(),Jo(9,S1,1,0,"ng-container",11),ra(10,"div",12),Ja(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),el(" ",n.control.isExpanded(t)?"expand_less":"expand_more"," "),ws(1),na("ngTemplateOutlet",i)("ngTemplateOutletContext",Pc(22,w1,t)),ws(1),ja("suborgan",t.level>1),ws(1),tl(n.occurenceData[t.original.id]||0)}}const E1=(0,gq.property)("level"),O1=(0,gq.property)("expandable");let T1=(()=>{class t{constructor(t,e){this.cdr=t,this.ga=e,this.atScrollBottom=!1,this.nodeSelected=new Bc,this.nodeChanged=new Bc,this.indent="1.5rem",this.control=new K0(E1,O1),this.flattener=new m1(y1.create,E1,O1,gq.invoke.bind(void 0,this,"getChildren")),this.dataSource=new b1(this.control,this.flattener),this._nodes=void 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;(null==e?void 0:e.length)>=0&&this.selectByIDs(e)}t.rootNode&&this.selectByIDs([t.rootNode.currentValue])}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,gq.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(null==t?void 0:t.original.id)===this.rootNode||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(nc),ea(jW))},t.\u0275cmp=Jt({type:t,selectors:[["ccf-ontology-tree"]],inputs:{ontologyFilter:"ontologyFilter",rootNode:"rootNode",nodes:"nodes",getChildren:"getChildren",occurenceData:"occurenceData",termData:"termData",header:"header"},outputs:{nodeSelected:"nodeSelected",nodeChanged:"nodeChanged"},features:[ye],decls:5,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,"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,v1,2,9,"ng-template",null,1,ru),Jo(3,x1,10,20,"mat-tree-node",2),Jo(4,C1,12,24,"mat-tree-node",3),sa()),2&t&&(ja("header-hidden",!e.header),na("dataSource",e.dataSource)("treeControl",e.control),ws(4),na("matTreeNodeDefWhen",e.isInnerNode))},directives:[p1,u1,c1,h1,T_,jK,Fh,R_,f1],styles:[".ccf-ontology-tree[_ngcontent-%COMP%]{background:none;scrollbar-width:thin;max-height:calc(50vh - 10rem);overflow:auto;overflow-x:hidden}.ccf-ontology-tree.header-hidden[_ngcontent-%COMP%]{max-height:40vh}.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:3rem;width:90%;bottom:0;pointer-events:none}.scroll-gradient.hidden[_ngcontent-%COMP%]{display:none}"],changeDetection:0}),t})();function k1(t,e){if(1&t&&(ra(0,"mat-option",8),ra(1,"span",9),Ja(2),sa(),ra(3,"span",10),Ja(4),sa(),ra(5,"span",11),Ja(6),sa(),sa()),2&t){const t=e.$implicit;na("value",t),ws(2),tl(t.displayLabel[0]),ws(2),tl(t.displayLabel[1]),ws(2),tl(t.displayLabel[2])}}let P1=(()=>{class t{constructor(t,e){this.ontologyService=t,this.ga=e,this.selected=new Bc,this.formControl=new tH(""),this.autoCompleteOpen=!1}ngOnInit(){this.filteredResults$=this.formControl.valueChanges.pipe(ep(t=>"string"==typeof t),lp(""),cp(t=>this.ontologyService.filter(t)),D(t=>(0,gq.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,gq.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(Y0),ea(jW))},t.\u0275cmp=Jt({type:t,selectors:[["ccf-ontology-search"]],inputs:{placeholderText:"placeholderText"},outputs:{selected:"selected"},decls:10,vars:9,consts:[[1,"ccf-ontology-search"],["appearance","outline",1,"field"],["matPrefix","","color","primary",1,"search"],["type","text","matInput","",1,"input",3,"placeholder","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),Ja(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,k1,7,4,"mat-option",7),Dc(9,"async"),sa(),sa(),sa(),sa()),2&t){const t=ta(6);ja("autocomplete-open",e.autoCompleteOpen),ws(4),na("placeholder",e.placeholderText)("formControl",e.formControl)("matAutocomplete",t),ws(1),na("displayWith",e.displayFormatter),ws(3),na("ngForOf",Rc(9,7,e.filteredResults$))}},directives:[cH,IU,sH,QH,T_,$H,E$,uU,m$,MU,pH,h$,kh,wv],pipes:[$h],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 A1=function(t){return[t]};function M1(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",Pc(7,A1,t))("rootNode",t.id)("getChildren",n.ontologySearchService.getChildren)("occurenceData",n.occurenceData)("termData",n.termData)("ontologyFilter",n.ontologyFilter)("header",n.header)}}let I1=(()=>{class t{constructor(t){this.ontologySearchService=t,this.ontologySelection=new Bc}ngOnChanges(t){"treeModel"in t&&this.treeModel&&this.ontologySearchService.setTreeModel(this.treeModel)}selected(t){var e,n;const i=null!==(n=null===(e=this.treeModel)||void 0===e?void 0:e.nodes)&&void 0!==n?n:{};this.tree.expandAndSelect(t,t=>i[t.parent])}}return t.\u0275fac=function(e){return new(e||t)(ea(Y0))},t.\u0275cmp=Jt({type:t,selectors:[["ccf-ontology-selection"]],viewQuery:function(t,e){if(1&t&&Zc(T1,5),2&t){let t;Qc(t=tu())&&(e.tree=t.first)}},inputs:{occurenceData:"occurenceData",termData:"termData",treeModel:"treeModel",ontologyFilter:"ontologyFilter",header:"header",placeholderText:"placeholderText"},outputs:{ontologySelection:"ontologySelection"},features:[xl([Y0]),ye],decls:3,vars:4,consts:[[3,"placeholderText","selected"],["class","tree",3,"nodes","rootNode","getChildren","occurenceData","termData","ontologyFilter","header","nodeSelected",4,"ngIf"],[1,"tree",3,"nodes","rootNode","getChildren","occurenceData","termData","ontologyFilter","header","nodeSelected"]],template:function(t,e){1&t&&(ra(0,"ccf-ontology-search",0),fa("selected",function(t){return e.selected(t)}),sa(),Jo(1,M1,1,9,"ccf-ontology-tree",1),Dc(2,"async")),2&t&&(na("placeholderText",e.placeholderText),ws(1),na("ngIf",Rc(2,2,e.ontologySearchService.rootNode$)))},directives:[P1,Ah,T1],pipes:[$h],styles:[""],changeDetection:0}),t})(),D1=(()=>{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(OZ),ea(_Z),ea(nc))},t.\u0275cmp=Jt({type:t,selectors:[["ccf-drawer-toggle-button"]],hostVars:4,hostBindings:function(t,e){2&t&&(Va(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()}),Ja(1),sa()),2&t&&(ws(1),el(" ",e.icon,"\n"))},directives:[T_],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 R1(t,e){1&t&&(ra(0,"div",7),oa(1,"mat-spinner",8),ra(2,"span",3),Ja(3,"Loading External Site"),sa(),sa())}function N1(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 L1=(()=>{class t{constructor(t){this.sanitizer=t,this.className="ccf-viewer",this.url="",this.closed=new Bc,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(Sd))},t.\u0275cmp=Jt({type:t,selectors:[["ccf-viewer"]],hostVars:2,hostBindings:function(t,e){2&t&&Va(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),Ja(3,"launch"),sa(),ra(4,"span",3),Ja(5,"Open in Portal"),sa(),sa(),ra(6,"button",4),fa("click",function(){return e.closed.emit()}),ra(7,"mat-icon",2),Ja(8,"clear"),sa(),sa(),sa(),Jo(9,R1,4,0,"div",5),Jo(10,N1,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:[N_,T_,R_,Ah,fZ],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 j1(t,e){if(1&t&&oa(0,"div",3),2&t){const t=e.index;ja("line-tick-visible",va().tissueSectionExists(t+1))}}const F1=function(){return[]};let B1=(()=>{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&&Va(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"),Ja(1,"0"),sa(),ra(2,"div",0),Jo(3,j1,1,2,"div",1),oa(4,"div",2),sa(),ra(5,"div"),Ja(6),sa()),2&t&&(ws(3),na("ngForOf",kc(2,F1).constructor(e.totalTissueSections)),ws(3),tl(e.totalTissueSections))},directives:[kh],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 V1(t){return null!==t&&"object"==typeof t&&"constructor"in t&&t.constructor===Object}function z1(t,e){void 0===t&&(t={}),void 0===e&&(e={}),Object.keys(e).forEach(function(n){void 0===t[n]?t[n]=e[n]:V1(e[n])&&V1(t[n])&&Object.keys(e[n]).length>0&&z1(t[n],e[n])})}var U1={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 H1(){var t="undefined"!=typeof document?document:{};return z1(t,U1),t}var $1={document:U1,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 G1(){var t="undefined"!=typeof window?window:{};return z1(t,$1),t}function W1(t){return(W1=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function q1(t,e){return(q1=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function X1(){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 Y1(t,e,n){return(Y1=X1()?Reflect.construct:function(t,e,n){var i=[null];i.push.apply(i,e);var r=new(Function.bind.apply(t,i));return n&&q1(r,n.prototype),r}).apply(null,arguments)}function K1(t){var e="function"==typeof Map?new Map:void 0;return(K1=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 Y1(t,arguments,W1(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),q1(n,t)})(t)}var Q1=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}(K1(Array));function Z1(t){void 0===t&&(t=[]);var e=[];return t.forEach(function(t){Array.isArray(t)?e.push.apply(e,Z1(t)):e.push(t)}),e}function J1(t,e){return Array.prototype.filter.call(t,e)}function t2(t,e){var n=G1(),i=H1(),r=[];if(!e&&t instanceof Q1)return t;if(!t)return new Q1(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=G1(),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=G1();return this[0]?t.getComputedStyle(this[0],null):{}},offset:function(){if(this.length>0){var t=G1(),e=H1(),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=G1();if(1===arguments.length){if("string"!=typeof t){for(n=0;ne-1)return t2([]);if(t<0){var n=e+t;return t2(n<0?[]:[this[n]])}return t2([this[t]])},append:function(){for(var t,e=H1(),n=0;n=0;n-=1)this[e].insertBefore(r.childNodes[n],this[e].childNodes[0])}else if(t instanceof Q1)for(n=0;n0?t?this[0].nextElementSibling&&t2(this[0].nextElementSibling).is(t)?t2([this[0].nextElementSibling]):t2([]):t2(this[0].nextElementSibling?[this[0].nextElementSibling]:[]):t2([])},nextAll:function(t){var e=[],n=this[0];if(!n)return t2([]);for(;n.nextElementSibling;){var i=n.nextElementSibling;t?t2(i).is(t)&&e.push(i):e.push(i),n=i}return t2(e)},prev:function(t){if(this.length>0){var e=this[0];return t?e.previousElementSibling&&t2(e.previousElementSibling).is(t)?t2([e.previousElementSibling]):t2([]):t2(e.previousElementSibling?[e.previousElementSibling]:[])}return t2([])},prevAll:function(t){var e=[],n=this[0];if(!n)return t2([]);for(;n.previousElementSibling;){var i=n.previousElementSibling;t?t2(i).is(t)&&e.push(i):e.push(i),n=i}return t2(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}}()),r2}function g2(t){return void 0===t&&(t={}),s2||(s2=function(t){var e=(void 0===t?{}:t).userAgent,n=f2(),i=G1(),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)),s2}function m2(){return o2||(o2=function(){var t,e=G1();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)}}()),o2}var b2={name:"resize",create:function(){var t=this;d2(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=G1();t.params.resizeObserver&&void 0!==G1().ResizeObserver?t.resize.createObserver():(e.addEventListener("resize",t.resize.resizeHandler),e.addEventListener("orientationchange",t.resize.orientationChangeHandler))},destroy:function(t){var e=G1();t.resize.removeObserver(),e.removeEventListener("resize",t.resize.resizeHandler),e.removeEventListener("orientationchange",t.resize.orientationChangeHandler)}}};function y2(){return(y2=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=a2(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!==H1()&&n!==G1()?(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(d2(r,{isTouched:!0,isMoved:!1,allowTouchCallbacks:!0,isScrolling:void 0,startMoving:void 0}),o.startX=u,o.startY=h,r.touchStartTime=c2(),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&&a2(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 x2(t){var e=H1(),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&&(d2(s,{startX:c,startY:u,currentX:c,currentY:u}),i.touchStartTime=c2()));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&&a2(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:c2()})),n.updateProgress(i.currentTranslate),n.setTranslate(i.currentTranslate))}}}}}}function S2(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=c2(),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=c2(),l2(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||c2()-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 A=(u-a[O])/T,M=Oi.longSwipesMs){if(!i.longSwipes)return void e.slideTo(e.activeIndex);"next"===e.swipeDirection&&e.slideTo(A>=i.longSwipesRatio?O+M:O),"prev"===e.swipeDirection&&e.slideTo(A>1-i.longSwipesRatio?O+M: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+M),"prev"===e.swipeDirection&&e.slideTo(O)):e.slideTo(c.target===e.navigation.nextEl?O+M:O)}}}}function C2(){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 E2(t){var e=this;!e.enabled||e.allowClick||(e.params.preventClicks&&t.preventDefault(),e.params.preventClicksPropagation&&e.animating&&(t.stopPropagation(),t.stopImmediatePropagation()))}function O2(){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 T2=!1;function k2(){}var P2={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 A2(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,P=S/k,A=Math.floor(h/i.slidesPerColumn),M=0;M1){var D=void 0,R=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*k*i.slidesPerGroup)/k),i.slidesPerGroup);N=Math.floor(j/F),I.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=M-(R=Math.floor(M/k))*k,(R>A||R===A&&N===k-1)&&(N+=1)>=k&&(N=0,R+=1)):R=M-(N=Math.floor(M/P))*P;I.css(e("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)T=t.isHorizontal()?I.outerWidth(!0):I.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=I[0];T=U+H+$+G+W+(X.offsetWidth-X.clientWidth)}}V&&(I[0].style.transform=V),z&&(I[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[M]&&(u[M].style[e("width")]=T+"px");u[M]&&(u[M].swiperSlideSize=T),f.push(T),i.centeredSlides?(_=_+T/2+w/2+v,0===w&&0!==M&&(_=_-s/2-v),0===M&&(_=_-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(((E={})[e("width")]=t.virtualSize+i.spaceBetween+"px",E)),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)){C=[];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=a2(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),d2(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);d2(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=a2(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(a2(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(),l2(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(),l2(function(){e.slideTo(s)})):e.slideTo(s)}else e.slideTo(s)}},loop:{loopCreate:function(){var t=this,e=H1(),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=a2(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(a2(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(),d2(t.params,u);var m=t.params.enabled;d2(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=G1(),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=G1();function l(){s&&s()}a2(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 a2(n.el).each(function(e){var i=d2({},n,{el:e});o.push(new t(i))}),o}var a=this;a.__swiper__=!0,a.support=f2(),a.device=g2({userAgent:n.userAgent}),a.browser=m2(),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=d2({},P2);return a.useParams(u),a.params=d2({},u,I2,n),a.originalParams=d2({},a.params),a.passedParams=d2({},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.$=a2,d2(a,{enabled:a.params.enabled,el:e,classNames:[],slides:a2(),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:c2(),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=a2(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=a2(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=H1().createElement("div");r=a2(s),s.className=e.params.wrapperClass,n.append(s),n.children("."+e.params.slideClass).each(function(t){r.append(t)})}return d2(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){d2(I2,t)},t.installModule=function(e){t.prototype.modules||(t.prototype.modules={});var n=e.name||Object.keys(t.prototype.modules).length+"_"+c2();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&&A2(t,n)}(t,0,[{key:"extendedDefaults",get:function(){return I2}},{key:"defaults",get:function(){return P2}}]),t}();Object.keys(M2).forEach(function(t){Object.keys(M2[t]).forEach(function(e){D2.prototype[e]=M2[t][e]})}),D2.use([b2,_2]);var R2=D2;const N2=["prevElRef"],L2=["nextElRef"],j2=["scrollbarElRef"],F2=["paginationElRef"];function B2(t,e){1&t&&(aa(0),oa(1,"div",6,7),oa(3,"div",8,9),la())}function V2(t,e){1&t&&oa(0,"div",10,11)}function z2(t,e){1&t&&oa(0,"div",12,13)}function U2(t,e){}function H2(t,e){1&t&&Jo(0,U2,0,0,"ng-template")}function $2(t,e){}function G2(t,e){1&t&&Jo(0,$2,0,0,"ng-template")}function W2(t,e){}function q2(t,e){1&t&&Jo(0,W2,0,0,"ng-template")}function X2(t,e){}const Y2=function(t){return{$implicit:t}};function K2(t,e){if(1&t&&(ra(0,"div",3),Jo(1,X2,0,0,"ng-template",18),sa()),2&t){const t=va().$implicit;na("ngClass",va(2).zoomContainerClass),ws(1),na("ngTemplateOutlet",t.template)("ngTemplateOutletContext",Pc(3,Y2,t.slideData))}}function Q2(t,e){}function Z2(t,e){if(1&t&&(aa(0),Jo(1,Q2,0,0,"ng-template",18),la()),2&t){const t=va().$implicit;ws(1),na("ngTemplateOutlet",t.template)("ngTemplateOutletContext",Pc(2,Y2,t.slideData))}}function J2(t,e){if(1&t&&(ra(0,"div",15),Jo(1,K2,2,5,"div",16),Jo(2,Z2,2,4,"ng-container",17),sa()),2&t){const t=e.$implicit,n=va().key,i=va();Fa(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 t3(t,e){1&t&&(Jo(0,J2,3,6,"div",14),Dc(1,"async")),2&t&&na("ngForOf",Rc(1,1,e.loopSlides))}const e3=[[["","slot","container-start"]],[["","slot","wrapper-start"]],[["","slot","wrapper-end"]],[["","slot","container-end"]]],n3=function(t){return{loopSlides:t,key:"prepend"}},i3=function(t){return{loopSlides:t,key:""}},r3=function(t){return{loopSlides:t,key:"append"}},s3=["[slot=container-start]","[slot=wrapper-start]","[slot=wrapper-end]","[slot=container-end]"];function o3(t){return"object"==typeof t&&null!==t&&t.constructor&&"Object"===Object.prototype.toString.call(t).slice(8,-1)}function a3(t,e,n){return!0===c3(t)&&e&&!e.el||!("boolean"!=typeof e&&e.el!==(null==n?void 0:n.nativeElement)&&("string"==typeof e.el||"object"==typeof e.el))}function l3(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]||(o3(e[n])&&o3(t[n])&&Object.keys(e[n]).length>0?e[n].__swiper__?t[n]=e[n]:l3(t[n],e[n]):t[n]=e[n]):t[n]=e[n]})}function c3(t){return null!=t&&"false"!=`${t}`}const u3=["pagination","navigation","scrollbar","virtual"];function h3(t,e={}){return o3(t)?t:!0===c3(t)&&e}const d3=["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 p3(t={}){const e={on:{}},n={};l3(e,R2.defaults),l3(e,R2.extendedDefaults),e._emitClasses=!0;const i={};return Object.keys(t).forEach(r=>{const s=r.replace(/^_/,"");void 0!==t[s]&&(d3.indexOf(s)>=0?o3(t[s])?(e[s]={},n[s]={},l3(e[s],t[s]),l3(n[s],t[s])):(e[s]=t[s],n[s]=t[s]):i[s]=t[s])}),{params:e,passedParams:n,rest:i}}let f3=(()=>{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=c3(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(ac))},t.\u0275dir=se({type:t,selectors:[["ng-template","swiperSlide",""]],inputs:{class:"class",zoom:"zoom",virtualIndex:"virtualIndex"}}),t})(),g3=(()=>{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 Bc,this.s__containerClasses=new Bc,this.s__slideClass=new Bc,this.s__swiper=new Bc,this.s_activeIndexChange=new Bc,this.s_afterInit=new Bc,this.s_autoplay=new Bc,this.s_autoplayStart=new Bc,this.s_autoplayStop=new Bc,this.s_beforeDestroy=new Bc,this.s_beforeInit=new Bc,this.s_beforeLoopFix=new Bc,this.s_beforeResize=new Bc,this.s_beforeSlideChangeStart=new Bc,this.s_beforeTransitionStart=new Bc,this.s_breakpoint=new Bc,this.s_changeDirection=new Bc,this.s_click=new Bc,this.s_doubleTap=new Bc,this.s_doubleClick=new Bc,this.s_destroy=new Bc,this.s_fromEdge=new Bc,this.s_hashChange=new Bc,this.s_hashSet=new Bc,this.s_imagesReady=new Bc,this.s_init=new Bc,this.s_keyPress=new Bc,this.s_lazyImageLoad=new Bc,this.s_lazyImageReady=new Bc,this.s_loopFix=new Bc,this.s_momentumBounce=new Bc,this.s_navigationHide=new Bc,this.s_navigationShow=new Bc,this.s_observerUpdate=new Bc,this.s_orientationchange=new Bc,this.s_paginationHide=new Bc,this.s_paginationRender=new Bc,this.s_paginationShow=new Bc,this.s_paginationUpdate=new Bc,this.s_progress=new Bc,this.s_reachBeginning=new Bc,this.s_reachEnd=new Bc,this.s_realIndexChange=new Bc,this.s_resize=new Bc,this.s_scroll=new Bc,this.s_scrollbarDragEnd=new Bc,this.s_scrollbarDragMove=new Bc,this.s_scrollbarDragStart=new Bc,this.s_setTransition=new Bc,this.s_setTranslate=new Bc,this.s_slideChange=new Bc,this.s_slideChangeTransitionEnd=new Bc,this.s_slideChangeTransitionStart=new Bc,this.s_slideNextTransitionEnd=new Bc,this.s_slideNextTransitionStart=new Bc,this.s_slidePrevTransitionEnd=new Bc,this.s_slidePrevTransitionStart=new Bc,this.s_slideResetTransitionStart=new Bc,this.s_slideResetTransitionEnd=new Bc,this.s_sliderMove=new Bc,this.s_sliderFirstMove=new Bc,this.s_slidesLengthChange=new Bc,this.s_slidesGridLengthChange=new Bc,this.s_snapGridLengthChange=new Bc,this.s_snapIndexChange=new Bc,this.s_tap=new Bc,this.s_toEdge=new Bc,this.s_touchEnd=new Bc,this.s_touchMove=new Bc,this.s_touchMoveOpposite=new Bc,this.s_touchStart=new Bc,this.s_transitionEnd=new Bc,this.s_transitionStart=new Bc,this.s_update=new Bc,this.s_zoomChange=new Bc,this.s_swiper=new Bc,this.indexChange=new Bc,this._activeSlides=new A,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=Dd(this.slides.slice(this.slides.length-this.loopedSlides)),this.appendSlides=Dd(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=h3(t,{nextEl:r||null,prevEl:s||null}),this.showNavigation=!(!0!==c3(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=h3(t,{el:n||null}),this.showPagination=a3(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=h3(t,{el:n||null}),this.showScrollbar=a3(t,this._scrollbar,this._scrollbarElRef)}get scrollbar(){return this._scrollbar}set virtual(t){this._virtual=h3(t)}get virtual(){return this._virtual}set index(t){this.setIndex(t)}set config(t){this.updateSwiper(t);const{params:e}=p3(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:Dd(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}=p3(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}=p3(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 R2(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};l3(e.params.virtual,t),l3(e.originalParams.virtual,t)}Xh(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(u3.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=R2.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=o3(this.swiperRef.params[n]);if(Object.keys(this.swiperRef.modules).indexOf(n)>=0){const t=this.swiperRef.modules[n].params[n];i?l3(this.swiperRef.params[n],t):this.swiperRef.params[n]=t}i&&o3(e)?l3(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(Tu),ea(Al),ea(nc),ea(hu))},t.\u0275cmp=Jt({type:t,selectors:[["swiper"],["","swiper",""]],contentQueries:function(t,e,n){if(1&t&&Jc(n,f3,4),2&t){let t;Qc(t=tu())&&(e.slidesEl=t)}},viewQuery:function(t,e){if(1&t&&(Zc(N2,5),Zc(L2,5),Zc(j2,5),Zc(F2,5)),2&t){let t;Qc(t=tu())&&(e.prevElRef=t.first),Qc(t=tu())&&(e.nextElRef=t.first),Qc(t=tu())&&(e.scrollbarElRef=t.first),Qc(t=tu())&&(e.paginationElRef=t.first)}},hostVars:2,hostBindings:function(t,e){2&t&&Va(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:s3,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(e3),xa(0),Jo(1,B2,5,0,"ng-container",0),Jo(2,V2,2,0,"div",1),Jo(3,z2,2,0,"div",2),ra(4,"div",3),xa(5,1),Jo(6,H2,1,0,void 0,4),Jo(7,G2,1,0,void 0,4),Jo(8,q2,1,0,void 0,4),xa(9,2),sa(),xa(10,3),Jo(11,t3,2,3,"ng-template",null,5,ru)),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",Pc(11,n3,e.prependSlides)),ws(1),na("ngTemplateOutlet",t)("ngTemplateOutletContext",Pc(13,i3,e.activeSlides)),ws(1),na("ngTemplateOutlet",t)("ngTemplateOutletContext",Pc(15,r3,e.appendSlides))}},directives:[Ah,Oh,Fh,kh,Rh,Nh,Lh],pipes:[$h],styles:["\n swiper {\n display: block;\n }\n "],encapsulation:2,changeDetection:0}),t})(),m3=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Wh]]}),t})();function b3(t,e){if(1&t){const t=ua();ra(0,"div",7),ra(1,"div",8),Ja(2),sa(),ra(3,"a",9),fa("click",function(){$e(t);const e=va().$implicit;return va().linkClicked.emit(e)}),Ja(4," DATA "),ra(5,"mat-icon"),Ja(6,"open_in_new"),sa(),sa(),sa()}if(2&t){const t=va().$implicit;ws(1),La("background-image","url("+t.thumbnail+")"),ws(1),el(" ",t.technology," ")}}function y3(t,e){1&t&&(aa(0),Jo(1,b3,7,3,"ng-template",6),la())}const v3=(()=>{let t=-1;return()=>(t+=1,t)})();let _3=(()=>{class t{constructor(){this.className="ccf-thumbnail-carousel",this.linkClicked=new Bc,this.uid=v3(),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&&Va(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"),Ja(3,"navigate_before"),sa(),sa(),sa(),ra(4,"swiper",2),Jo(5,y3,2,0,"ng-container",3),sa(),ra(6,"div",4),ra(7,"button",1),oa(8,"div",5),ra(9,"mat-icon"),Ja(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:[R_,T_,g3,kh,f3],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 w3(t,e){if(1&t){const t=ua();ra(0,"mat-icon",14),fa("click",function(){return $e(t),va().toggleExpansion()}),Ja(1),sa()}if(2&t){const t=va();ws(1),tl(t.expanded?"expand_less":"expand_more")}}function x3(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 S3(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 C3(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 E3(t,e){if(1&t){const t=ua();ra(0,"div",22),ra(1,"div",23),ra(2,"mat-icon",24),Ja(3,"bubble_chart"),sa(),ra(4,"div",17),ra(5,"div",8),Ja(6),sa(),ra(7,"div",8),Ja(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),Ja(11,"TISSUE SECTION"),sa(),ra(12,"mat-icon",11),Ja(13,"open_in_new"),sa(),sa(),sa(),Jo(14,C3,2,1,"ng-container",13),sa()}if(2&t){const t=e.$implicit;ws(6),tl(t.label),ws(2),tl(t.description),ws(6),na("ngIf",t.datasets.length>0)}}function O3(t,e){if(1&t){const t=ua();aa(0),ra(1,"div",15),ra(2,"div",16),ra(3,"mat-icon",5),Ja(4,"bubble_chart"),sa(),ra(5,"div",17),ra(6,"div",8),Ja(7),sa(),ra(8,"div",8),Ja(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),Ja(12,"TISSUE BLOCK"),sa(),ra(13,"mat-icon",11),Ja(14,"open_in_new"),sa(),sa(),sa(),Jo(15,x3,1,2,"ccf-tissue-section-vis",18),Jo(16,S3,2,1,"ng-container",13),sa(),Jo(17,E3,15,3,"div",19),la()}if(2&t){const t=va();ws(7),tl(t.tissueBlock.label),ws(2),tl(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 T3=function(t){return{"background-color":t}};let k3=(()=>{class t{constructor(t){this.ga=t,this.clsName="ccf-donor-card",this.selected=!1,this.expanded=!1,this.highlighted=!1,this.checked=new Bc,this.linkClick=new Bc,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(jW))},t.\u0275cmp=Jt({type:t,selectors:[["ccf-donor-card"]],hostVars:2,hostBindings:function(t,e){2&t&&Va(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),Ja(6,"person"),sa(),ra(7,"div",6),ra(8,"div",7),Ja(9),sa(),ra(10,"div",8),Ja(11),sa(),sa(),sa(),ra(12,"div",9),fa("click",function(){return e.linkHandler(e.tissueBlock.donor.link)}),ra(13,"div",10),Ja(14,"DONOR"),sa(),ra(15,"mat-icon",11),Ja(16,"open_in_new"),sa(),sa(),Jo(17,w3,2,1,"mat-icon",12),sa(),sa(),Jo(18,O3,18,5,"ng-container",13)),2&t&&(ws(1),ja("selected",e.selected)("highlighted",e.highlighted),na("ngStyle",Pc(18,T3,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),tl(e.tissueBlock.donor.label),ws(2),tl(e.tissueBlock.donor.description),ws(6),na("ngIf",e.selected),ws(1),na("ngIf",e.expanded))},directives:[jh,_K,T_,Ah,kh,B1,_3],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 P3(t,e){if(1&t&&(ra(0,"div",7),ra(1,"div",8),Ja(2),sa(),ra(3,"div",9),Ja(4),sa(),sa()),2&t){const t=e.$implicit;ws(2),tl(t.count),ws(2),tl(t.label)}}function A3(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 M3=(()=>{class t{constructor(t){this.ga=t,this.linkClicked=new Bc,this.listResultSelected=new Bc,this.listResultDeselected=new Bc,this.itemHovered=new Bc,this.itemUnhovered=new Bc,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(jW))},t.\u0275cmp=Jt({type:t,selectors:[["ccf-results-browser"]],inputs:{listResults:"listResults",aggregateData:"aggregateData",resultLabel:"resultLabel",highlighted:"highlighted",header:"header"},outputs:{linkClicked:"linkClicked",listResultSelected:"listResultSelected",listResultDeselected:"listResultDeselected",itemHovered:"itemHovered",itemUnhovered:"itemUnhovered"},decls:8,vars:7,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),Ja(3),sa(),Jo(4,P3,5,2,"div",3),sa(),ra(5,"div",4),fa("scroll",function(t){return e.onScroll(t)}),Jo(6,A3,2,4,"div",5),sa(),oa(7,"div",6),sa()),2&t&&(ws(3),tl(e.resultLabel),ws(1),na("ngForOf",e.aggregateData),ws(1),ja("header-hidden",!e.header),ws(1),na("ngForOf",e.listResults),ws(1),ja("hidden",!!e.atScrollBottom))},directives:[kh,k3],styles:[".results-browser-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:calc(100% - 3rem);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:column;overflow-y:auto;scrollbar-width:thin;padding-right:.5rem;height:calc(100vh - 20rem)}.results-browser-container[_ngcontent-%COMP%] .results-browser-list.header-hidden[_ngcontent-%COMP%]{height:calc(100vh - 16rem)}.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:3rem;width:95%;bottom:0;pointer-events:none}.results-browser-container[_ngcontent-%COMP%] .scroll-gradient.hidden[_ngcontent-%COMP%]{display:none}"],changeDetection:0}),t})();const I3=["*",[["mat-toolbar-row"]]],D3=["*","mat-toolbar-row"],R3=Xy(class{constructor(t){this._elementRef=t}});let N3=(()=>{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})(),L3=(()=>{class t extends R3{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(Al),ea(Ep),ea(th))},t.\u0275cmp=Jt({type:t,selectors:[["mat-toolbar"]],contentQueries:function(t,e,n){if(1&t&&Jc(n,N3,5),2&t){let t;Qc(t=tu())&&(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:D3,decls:2,vars:0,template:function(t,e){1&t&&(wa(I3),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})(),j3=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Wy],Wy]}),t})();function F3(t,e){if(1&t&&(ra(0,"a",5),Ja(1,"LOGIN"),sa()),2&t){const t=va();ja("disabled",t.loginDisabled||!t.homeUrl),na("href",t.homeUrl+"login",_r)}}function B3(t,e){if(1&t&&(ra(0,"a",5),Ja(1,"LOGOUT"),sa()),2&t){const t=va();ja("disabled",t.loginDisabled||!t.homeUrl),na("href",t.homeUrl+"logout",_r)}}let V3=(()=>{class t{constructor(){this.refreshClicked=new Bc,this.downloadClicked=new Bc}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Jt({type:t,selectors:[["ccf-header"]],inputs:{homeUrl:"homeUrl",loginDisabled:"loginDisabled",logoTooltip:"logoTooltip",loggedIn:"loggedIn",filters:"filters"},outputs:{refreshClicked:"refreshClicked",downloadClicked:"downloadClicked"},decls:6,vars:4,consts:[[1,"ccf-header"],[1,"home",3,"href"],["aria-hidden","false","aria-label","Reset tool","matTooltipPosition","right",1,"logo",3,"matTooltip"],[1,"filler"],["mat-button","","class","authentication","rel","noreferrer noopener","target","_blank",3,"disabled","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,"div",2),sa(),oa(3,"div",3),Jo(4,F3,2,3,"a",4),Jo(5,B3,2,3,"a",4),sa()),2&t&&(ws(1),na("href",e.homeUrl,_r),ws(1),na("matTooltip",e.logoTooltip),ws(2),na("ngIf",!e.loggedIn),ws(1),na("ngIf",e.loggedIn))},directives:[L3,gw,Ah,N_],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%] .home[_ngcontent-%COMP%]{height:100%;width:25rem;align-items:center;display:flex;padding:.25rem 0}.ccf-header[_ngcontent-%COMP%] .logo[_ngcontent-%COMP%]{width:100%;height:50%;background-repeat:no-repeat;background-size:contain}.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}.ccf-header[_ngcontent-%COMP%] .disabled[_ngcontent-%COMP%]{display:none}"],changeDetection:0}),t})();const z3=["bodyUI"];function U3(t,e){if(1&t&&(oa(0,"ccf-header",34),Dc(1,"async"),Dc(2,"async"),Dc(3,"async"),Dc(4,"async")),2&t){const t=va();ja("hide",!1===Rc(1,6,t.header$)),na("logoTooltip",Rc(2,8,t.logoTooltip$))("homeUrl",Rc(3,10,t.homeUrl$))("loggedIn",t.loggedIn)("loginDisabled",Rc(4,12,t.loginDisabled$))}}function H3(t,e){if(1&t){const t=ua();ra(0,"div",35),fa("click",function(){$e(t),va();const e=ta(72);return e.expanded=!e.expanded}),ra(1,"mat-icon",36),Ja(2),sa(),sa()}if(2&t){va();const t=ta(72);ws(2),el(" ",t.expanded?"arrow_drop_up":"arrow_drop_down"," ")}}function $3(t,e){if(1&t){const t=ua();ra(0,"div",35),fa("click",function(){$e(t);const e=va();return e.organListVisible=!e.organListVisible}),ra(1,"mat-icon",37),Ja(2),sa(),sa()}if(2&t){const t=va();ws(2),el(" ",t.organListVisible?"arrow_drop_up":"arrow_drop_down"," ")}}const G3=function(){return{}},W3=function(){return{x:2.2,y:2,z:.4}};class q3{constructor(t,e,n,i,r,s,o,a,l,c,u,h){this.data=n,this.theming=i,this.scene=r,this.listResultsState=s,this.consentService=o,this.snackbar=a,this.dataSource=c,this.globalConfig=u,this.setSelectedSearches=NQ(KQ),this.removeSpatialSearch=NQ(YQ),this.ontologySelectionLabel="body",this.cellTypeSelectionLabel="cell",this.selectionLabel="body | cell",this.organListVisible=!0,this.url="",this.acceptableViewerDomains=RQ.acceptableViewerDomains||[],this.viewerOpen=!1,this.spinnerActive$=this.data.queryStatus$.pipe(D(t=>t===HQ.Running)),this.loadingMessage$=this.data.state$.pipe(T$("statusMessage")),this.theme$=this.globalConfig.getOption("theme"),this.themeMode$=new _p(1),this.header$=this.globalConfig.getOption("header"),this.homeUrl$=this.globalConfig.getOption("homeUrl"),this.logoTooltip$=this.globalConfig.getOption("logoTooltip"),this.loginDisabled$=this.globalConfig.getOption("loginDisabled"),i.initialize(t,e),l.setRootElement(t),n.tissueBlockData$.subscribe(),n.aggregateData$.subscribe(),n.ontologyTermOccurencesData$.subscribe(),n.cellTypeTermOccurencesData$.subscribe(),n.sceneData$.subscribe(),n.filter$.subscribe(),n.technologyFilterData$.subscribe(),n.providerFilterData$.subscribe(),this.ontologyTerms$=n.filter$.pipe(T$("ontologyTerms")),this.cellTypeTerms$=n.filter$.pipe(T$("cellTypeTerms")),z_([this.theme$,this.themeMode$]).subscribe(([t,e])=>{this.theming.setTheme(`${t}-theme-${e}`),h.markForCheck()})}get isLightTheme(){return this.theming.getTheme().endsWith("light")}ngOnInit(){const t=this.snackbar.openFromComponent(ZK,{data:{preClose:()=>{t.dismiss()}},duration:"not-set"===this.consentService.consent?1/0:3e3});window.matchMedia?(window.matchMedia("(prefers-color-scheme: dark)").matches?this.themeMode$.next("dark"):this.themeMode$.next("light"),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",t=>{this.themeMode$.next(t.matches?"dark":"light")})):this.themeMode$.next("light")}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.themeMode$.next(this.isLightTheme?"dark":"light")}ontologySelected(t,e){if(t)return"anatomical-structures"===e?(this.data.updateFilter({ontologyTerms:t.map(t=>t.id)}),this.ontologySelectionLabel=this.createSelectionLabel(t)):(this.data.updateFilter({cellTypeTerms:t.map(t=>t.id)}),this.cellTypeSelectionLabel=this.createSelectionLabel(t)),this.selectionLabel=this.ontologySelectionLabel&&this.cellTypeSelectionLabel?`${this.ontologySelectionLabel} | ${this.cellTypeSelectionLabel}`:this.ontologySelectionLabel?`${this.ontologySelectionLabel}`:this.cellTypeSelectionLabel?`${this.cellTypeSelectionLabel}`:"",void(t[0]&&"body"===t[0].label&&this.resetView());this.data.updateFilter({ontologyTerms:[],cellTypeTerms:[]}),this.ontologySelectionLabel="",this.cellTypeSelectionLabel=""}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}}function X3(t,e){1&t&&oa(0,"ccf-root")}function Y3(t){const e=t=>"string"==typeof t,n=t=>Array.isArray(t)&&t.every(e);if("string"==typeof t){const e=IQ.json(t);if(n(e))return e}else if(n(t))return t;throw new Error("Invalid data sources")}q3.\u0275fac=function(t){return new(t||q3)(ea(Al),ea(No),ea(WQ),ea(kQ),ea(sZ),ea(iZ),ea(VW),ea(aw),ea(OQ),ea(eQ),ea(XK),ea(nc))},q3.\u0275cmp=Jt({type:q3,selectors:[["ccf-root"]],viewQuery:function(t,e){if(1&t&&Zc(z3,5),2&t){let t;Qc(t=tu())&&(e.bodyUI=t.first)}},decls:83,vars:117,consts:[[1,"ccf-app","mat-app-background"],[3,"text","active"],[3,"hide","logoTooltip","homeUrl","loggedIn","loginDisabled",4,"ngIf"],[1,"main-drawers"],["opened","",1,"left-drawer",3,"stateChange"],["left",""],[1,"filter-data"],[3,"filters","drawerExpanded","technologyFilters","providerFilters","spatialSearchFilters","filtersChange","spatialSearchSelected","spatialSearchRemoved"],["filterbox",""],[1,"filter-text"],[1,"sex","filter-tag"],[1,"age","filter-tag"],[1,"bmi","filter-tag"],["placeholderText","Search anatomical structures...",1,"ontology-selection",3,"treeModel","termData","occurenceData","header","ontologySelection"],["placeholderText","Search cell types...",1,"cell-type-selection",3,"treeModel","termData","occurenceData","header","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","CCF Exploration User Interface","documentationUrl","assets/docs/README.md","matTooltip","Open Info"],[3,"listResults","aggregateData","resultLabel","highlighted","header","listResultSelected","listResultDeselected","linkClicked","itemHovered","itemUnhovered"],[1,"selector-drawer"],[1,"organ-selector",3,"multiselect","occurenceData","organList","selectedOrgans","organsChanged"],["selector",""],[1,"close-button-wrapper"],["class","close-button",3,"click",4,"ngIf"],[1,"stage-content",3,"scene","bounds","nodeClick","nodeHoverStart","nodeHoverStop"],["bodyUI",""],[3,"logoTooltip","homeUrl","loggedIn","loginDisabled"],[1,"close-button",3,"click"],["aria-hidden","false","aria-label","Expand carousel drawer",1,"expand-collapse-icon"],["aria-hidden","false","aria-label","Close carousel drawer",1,"expand-collapse-icon"]],template:function(t,e){if(1&t){const t=ua();ra(0,"div",0),oa(1,"ccf-spinner-overlay",1),Dc(2,"async"),Dc(3,"async"),Jo(4,U3,5,14,"ccf-header",2),Dc(5,"async"),ra(6,"ccf-drawer-container",3),Dc(7,"async"),ra(8,"ccf-drawer",4,5),fa("stateChange",function(){return $e(t),ta(13).removeBox()}),ra(10,"div"),ra(11,"div",6),ra(12,"ccf-filters-popover",7,8),fa("filtersChange",function(t){return e.data.updateFilter(t)})("spatialSearchSelected",function(t){return e.setSelectedSearches(t)})("spatialSearchRemoved",function(t){return e.removeSpatialSearch(t)}),Dc(14,"async"),Dc(15,"async"),Dc(16,"async"),Dc(17,"async"),sa(),ra(18,"div",9),ra(19,"div",10),Ja(20,"Sex: "),ra(21,"strong"),Ja(22),Dc(23,"async"),sa(),sa(),ra(24,"div",11),Ja(25,"Age: "),ra(26,"strong"),Ja(27),Dc(28,"async"),Dc(29,"async"),sa(),sa(),ra(30,"div",12),Ja(31,"BMI: "),ra(32,"strong"),Ja(33),Dc(34,"async"),Dc(35,"async"),sa(),sa(),sa(),sa(),ra(36,"ccf-ontology-selection",13),fa("ontologySelection",function(t){return e.ontologySelected(t,"anatomical-structures")}),Dc(37,"async"),Dc(38,"async"),Dc(39,"async"),Dc(40,"async"),sa(),ra(41,"ccf-ontology-selection",14),fa("ontologySelection",function(t){return e.ontologySelected(t,"cell-type")}),Dc(42,"async"),Dc(43,"async"),Dc(44,"async"),Dc(45,"async"),sa(),oa(46,"ccf-drawer-toggle-button"),sa(),sa(),ra(47,"ccf-drawer",15,16),fa("stateChange",function(){return $e(t),ta(13).removeBox()}),ra(49,"ccf-viewer",17),fa("closed",function(){return e.viewerOpen=!1}),sa(),ra(50,"div",18),ra(51,"div",19),ra(52,"button",20),fa("click",function(){$e(t);const e=ta(13),n=ta(48);return e.removeBox(),n.toggleExpanded()}),ra(53,"mat-icon",21),Ja(54),sa(),sa(),ra(55,"button",22),fa("click",function(){return e.toggleScheme()}),ra(56,"mat-icon",21),Ja(57),sa(),sa(),ra(58,"button",23),ra(59,"mat-icon",24),fa("click",function(){$e(t);const n=ta(9),i=ta(48),r=ta(13);return e.reset(n,i,r)}),Ja(60,"refresh "),sa(),sa(),sa(),oa(61,"ccf-info-button",25),sa(),ra(62,"ccf-results-browser",26),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()}),Dc(63,"async"),Dc(64,"async"),Dc(65,"async"),Dc(66,"async"),sa(),oa(67,"ccf-drawer-toggle-button"),sa(),ra(68,"ccf-drawer-content"),Dc(69,"async"),ra(70,"div",27),ra(71,"ccf-organ-selector",28,29),fa("organsChanged",function(t){return e.scene.setSelectedReferenceOrgans(t)}),Dc(73,"async"),Dc(74,"async"),Dc(75,"async"),sa(),sa(),ra(76,"div",30),Jo(77,H3,3,1,"div",31),Jo(78,$3,3,1,"div",31),sa(),oa(79,"ccf-run-spatial-search"),ra(80,"ccf-body-ui",32,33),fa("nodeClick",function(t){return e.scene.sceneNodeClicked(t)})("nodeHoverStart",function(t){return e.scene.sceneNodeHovered(t)})("nodeHoverStop",function(){return e.scene.sceneNodeUnhover()}),Dc(82,"async"),sa(),sa(),sa(),sa()}if(2&t){const t=ta(48),n=ta(72);let i,r,s,o;ws(1),na("text",Rc(2,55,e.loadingMessage$))("active",Rc(3,57,e.spinnerActive$)),ws(3),na("ngIf",!1===Rc(5,59,e.spinnerActive$)),ws(2),ja("header-hidden",!1===Rc(7,61,e.header$)),ws(6),na("filters",Rc(14,63,e.data.filter$))("drawerExpanded",t.expanded)("technologyFilters",Rc(15,65,e.data.technologyFilterData$))("providerFilters",Rc(16,67,e.data.providerFilterData$))("spatialSearchFilters",Rc(17,69,e.selectableSearches$)),ws(10),tl(null==(i=Rc(23,71,e.data.filter$))?null:i.sex),ws(5),nl("",null==(r=Rc(28,73,e.data.filter$))?null:r.ageRange[0],"-",null==(r=Rc(29,75,e.data.filter$))?null:r.ageRange[1],""),ws(6),nl("",null==(s=Rc(34,77,e.data.filter$))?null:s.bmiRange[0],"-",null==(s=Rc(35,79,e.data.filter$))?null:s.bmiRange[1],""),ws(3),na("treeModel",Rc(37,81,e.ontologyTreeModel$))("termData",Rc(38,83,e.data.ontologyTermsFullData$))("occurenceData",Rc(39,85,e.data.ontologyTermOccurencesData$))("header",Rc(40,87,e.header$)),ws(5),na("treeModel",Rc(42,89,e.cellTypeTreeModel$))("termData",Rc(43,91,e.data.cellTypeTermsFullData$))("occurenceData",Rc(44,93,e.data.cellTypeTermOccurencesData$))("header",Rc(45,95,e.header$)),ws(8),ja("opened",e.viewerOpen),na("url",e.url),ws(3),na("matTooltip",t.expanded?"Exit Fullscreen":"Enter Fullscreen"),ws(2),tl(t.expanded?"fullscreen_exit":"fullscreen"),ws(1),na("matTooltip",e.isLightTheme?"Enter Dark Mode":"Enter Light Mode"),ws(2),el("",e.isLightTheme?"brightness_2":"brightness_5"," "),ws(5),na("listResults",Rc(63,97,e.listResultsState.listResults$))("aggregateData",Rc(64,99,e.data.aggregateData$))("resultLabel",e.selectionLabel)("highlighted",Rc(65,101,e.listResultsState.highlightedNodeId$))("header",Rc(66,103,e.header$)),ws(6),ja("header-hidden",!1===Rc(69,105,e.header$)),ws(2),ja("closed",!e.organListVisible)("expanded",n.expanded),ws(1),na("multiselect",!0)("occurenceData",null!==(o=Rc(73,107,e.data.ontologyTermOccurencesData$))&&void 0!==o?o:kc(115,G3))("organList",Rc(74,109,e.scene.referenceOrgans$))("selectedOrgans",Rc(75,111,e.scene.selectedReferenceOrgans$)),ws(5),ja("closed",!e.organListVisible),ws(1),na("ngIf",e.organListVisible),ws(1),na("ngIf",!n.expanded),ws(2),ja("expanded-stage",!e.organListVisible)("selector-expanded",n.expanded),na("scene",Rc(82,113,e.scene.scene$))("bounds",kc(116,W3))}},directives:[mZ,Ah,MZ,OZ,X0,I1,D1,L1,gw,T_,GK,M3,xZ,NK,V0,CK,V3],pipes:[$h],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-header.hide[_ngcontent-%COMP%]{display:none}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%]{height:calc(100% - 5rem);width:100%;opacity:1;overflow:hidden;transform:scale(1)}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container.header-hidden[_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%]{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%]{overflow:hidden;border-radius:.5rem;height:calc(100vh - 4rem)}.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;transition:all .5s ease-in-out;height:5rem;justify-content:start}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .selector-drawer.expanded[_ngcontent-%COMP%]{height:15rem;overflow-y:auto}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .selector-drawer.closed[_ngcontent-%COMP%]{height:1.5rem;top:-5rem}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] ccf-run-spatial-search[_ngcontent-%COMP%]{position:relative;float:right;height:0px;z-index:1;top:.5rem;right:.5rem}.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}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .expanded-stage[_ngcontent-%COMP%]{height:calc(100% - 3rem)}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .selector-expanded[_ngcontent-%COMP%]{height:calc(100% - 16.5rem)}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content.header-hidden[_ngcontent-%COMP%]{height:calc(100vh - 1rem)}.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{overflow:hidden}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] .left-drawer[_ngcontent-%COMP%] .cell-type-selection[_ngcontent-%COMP%] .ccf-ontology-search{margin-top:2rem}.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}.ccf-app[_ngcontent-%COMP%] .right-drawer[_ngcontent-%COMP%] .cff-drawer-inner-container{overflow:hidden}[_ngcontent-%COMP%]::-webkit-scrollbar{width:.5rem}"],changeDetection:0}),vw([iU(qQ.cellTypesTreeModel)],q3.prototype,"cellTypeTreeModel$",void 0),vw([iU(qQ.anatomicalStructuresTreeModel)],q3.prototype,"ontologyTreeModel$",void 0),vw([iU(ZQ.items)],q3.prototype,"selectableSearches$",void 0),vw([XY()],q3.prototype,"setSelectedSearches",void 0),vw([XY()],q3.prototype,"removeSpatialSearch",void 0);let K3=(()=>{class t extends MQ{constructor(t,e){super(t,e,{initialDelay:10,initialConfig:Object.assign(Object.assign(Object.assign({},RQ.dbOptions),globalThis.dbOptions),RQ.customization),parse:{dataSources:Y3,useRemoteApi:IQ.boolean,header:IQ.boolean,loginDisabled:IQ.boolean}})}}return t.\u0275fac=function(e){return new(e||t)(ea(XK),ea(nc))},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",theme:"theme",header:"header",homeUrl:"homeUrl",logoTooltip:"logoTooltip",loginDisabled:"loginDisabled"},features:[jo],decls:1,vars:1,consts:[[4,"ngIf"]],template:function(t,e){1&t&&Jo(0,X3,1,0,"ccf-root",0),2&t&&na("ngIf",e.initialized)},directives:[Ah,q3],encapsulation:2,changeDetection:0}),t})(),Q3=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Wh,L_,k_,j3,yw]]}),t})(),Z3=(()=>{class t extends uQ{constructor(t,e){super(t),this.locator=e}createWorker(t){const e=this.getWorkerUrl(!0);return new Worker(e,{type:"module"})}getWorkerUrl(t){if(t)return new URL(n(88509),n.b);const e=this.locator.prepareExternalUrl("0-es2015.worker.js"),i=new Blob([`importScripts('${e}')`],{type:"application/javascript"});return URL.createObjectURL(i)}}return t.\u0275fac=function(e){return new(e||t)(Ei(XK),Ei(ch))},t.\u0275prov=xt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})(),J3=(()=>{class t extends hQ{selectToken(t){const{useRemoteApi:e,remoteApiEndpoint:n}=t;return e&&n?aQ:"undefined"==typeof Worker||RQ.disableDbWorker?cQ:Z3}}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})(),t5=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({providers:[{provide:du,useValue:kQ.initialize,multi:!0},kQ]}),t})(),e5=(()=>{class t{constructor(t,e){this.accessor=t,this.injector=e}static forRoot(e=[]){return{ngModule:t,providers:[hW,uW,lW,...e]}}}return t.\u0275fac=function(e){return new(e||t)(Ei(hW,2),Ei(uW,2))},t.\u0275mod=ie({type:t}),t.\u0275inj=St({}),t})();const n5=(t,e)=>((t,e)=>new Array(e+1).join("0"))(0,e-t.toString().length)+t;class i5{constructor(t,e,n){this.action=t,this.store=e,this.logWriter=n}dispatched(t){const e=fz(this.action),n=function(t){return n5(t.getHours(),2)+":"+n5(t.getMinutes(),2)+":"+n5(t.getSeconds(),2)+"."+n5(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 r5{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 s5=new oi("NGXS_LOGGER_PLUGIN_OPTIONS");let o5=(()=>{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 r5(this._options),this._store=this._store||this._injector.get(qz);const i=new i5(e,this._store,this._logWriter);return i.dispatched(t),n(t,e).pipe(eg(t=>{i.completed(t)}),Tv(t=>{throw i.errored(t),t}))}}return t.\u0275fac=function(e){return new(e||t)(Ei(s5),Ei(No))},t.\u0275prov=xt({token:t,factory:t.\u0275fac}),t})();const a5=new oi("LOGGER_USER_OPTIONS");function l5(t){return Object.assign({},{logger:console,collapsed:!1,disabled:!1,filter:()=>!0},t)}let c5=(()=>{class t{static forRoot(e){return{ngModule:t,providers:[{provide:sz,useClass:o5,multi:!0},{provide:a5,useValue:e},{provide:s5,useFactory:l5,deps:[a5]}]}}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({}),t})();function u5(t,e){return t>=0&&t=e?e:t+e<0?0:t+e}function h5(t,e){if(1&t&&(ra(0,"span"),Ja(1),sa()),2&t){const t=e.$implicit;Fa(t.styles),Va(t.classes),ws(1),el(" ",t.text,"\n")}}let d5=(()=>{class t{constructor(){this.clsName="ccf-decorated-text",this.segments=[]}ngOnChanges(t){("text"in t||"decorations"in t)&&(this.segments=this.createSegments())}createSegments(){const{text:t}=this;if(!t)return[this.makeUndecoratedSegment(t)];const e=this.getNormalizedDecorations();if(0===e.length)return[this.makeUndecoratedSegment(t)];const n=this.createStackOps(e),i=[];let r=[],s=0;0===n[0].index&&(r=this.updateStack(r,n.shift()));for(const o of n)i.push(this.makeDecoratedSegment(t.slice(s,o.index),r)),s=o.index,r=this.updateStack(r,o);return s!==t.length&&i.push(this.makeDecoratedSegment(t.slice(s),r)),i}createStackOps(t){const e={},n=t=>{var n;return null!==(n=e[t])&&void 0!==n?n:e[t]={index:t,added:[],removed:[]}};for(const i of t)n(i.start).added.push(i),n(i.end).removed.push(i);return Object.entries(e).sort((t,e)=>+t[0]-+e[0]).map(t=>t[1])}updateStack(t,e){return t.filter(t=>!e.removed.includes(t)).concat(e.added)}getNormalizedDecorations(){const{decorations:t=[],text:{length:e}}=this;return t.map(t=>function(t,e){var n,i,r,s;return{start:u5(null!==(n=t.start)&&void 0!==n?n:0,e),end:u5(null!==(i=t.end)&&void 0!==i?i:e,e),classes:null!==(r=t.classes)&&void 0!==r?r:[],styles:null!==(s=t.styles)&&void 0!==s?s:{}}}(t,e)).filter(t=>t.startt.concat(e.classes),[]),styles:e.reduce((t,e)=>Object.assign(Object.assign({},t),e.styles),{})}}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Jt({type:t,selectors:[["ccf-decorated-text"]],hostVars:2,hostBindings:function(t,e){2&t&&Va(e.clsName)},inputs:{text:"text",decorations:"decorations"},features:[ye],decls:1,vars:1,consts:[[3,"class","style",4,"ngFor","ngForOf"]],template:function(t,e){1&t&&Jo(0,h5,2,5,"span",0),2&t&&na("ngForOf",e.segments)},directives:[kh],styles:["[_nghost-%COMP%]{display:flex}"],changeDetection:0}),t})();function p5(t,e){if(1&t&&(ra(0,"mat-option"),oa(1,"ccf-decorated-text",8),sa()),2&t){const t=e.$implicit;ws(1),na("text",t.label)("decorations",t.decorations)}}const f5=[[["","matPrefix",""]],[["","matSuffix",""]]],g5=new oi("Maximum number of autocomplete options displayed",{providedIn:"root",factory:()=>10});class m5{constructor(t){this.defaultMaxOptions=t,this.clsName="ccf-text-search",this.placeholder="Search...",this.optionSelected=new Bc,this.controller=new tH,this.options=this.controller.valueChanges.pipe(lp(""),Wd(),cp(this.getOptions)),this.valueChange=this.controller.valueChanges}get value(){return this.controller.value}set value(t){this.controller.setValue(t,{emitEvent:!1})}getOptions(t){return xw(this,void 0,void 0,function*(){const{autoCompleter:e,maxOptions:n=this.defaultMaxOptions}=this;return!e||n<1?[]:U(e(t,n)).pipe(rf(1),D(t=>t.length<=n?t:t.slice(0,n))).toPromise()})}optionDisplay(t){var e;return null!==(e=null==t?void 0:t.label)&&void 0!==e?e:""}optionId(t,e){return e.id}}m5.\u0275fac=function(t){return new(t||m5)(ea(g5))},m5.\u0275cmp=Jt({type:m5,selectors:[["ccf-text-search"]],hostVars:2,hostBindings:function(t,e){2&t&&Va(e.clsName)},inputs:{placeholder:"placeholder",value:"value",maxOptions:"maxOptions",autoCompleter:"autoCompleter"},outputs:{valueChange:"valueChange",optionSelected:"optionSelected"},ngContentSelectors:["[matPrefix]","[matSuffix]"],decls:11,vars:8,consts:[[1,"form"],["appearance","outline",1,"form-field"],["matPrefix",""],["matInput","","type","search",1,"input",3,"placeholder","formControl","matAutocomplete"],[1,"autocomplete",3,"displayWith","optionSelected"],["auto","matAutocomplete"],[4,"ngFor","ngForOf","ngForTrackBy"],["matSuffix",""],[3,"text","decorations"]],template:function(t,e){if(1&t&&(wa(f5),ra(0,"form",0),ra(1,"mat-form-field",1),aa(2,2),xa(3),la(),oa(4,"input",3),ra(5,"mat-autocomplete",4,5),fa("optionSelected",function(t){return e.optionSelected.emit(t)}),Jo(7,p5,2,2,"mat-option",6),Dc(8,"async"),sa(),aa(9,7),xa(10,1),la(),sa(),sa()),2&t){const t=ta(6);ws(4),na("placeholder",e.placeholder)("formControl",e.controller)("matAutocomplete",t),ws(1),na("displayWith",e.optionDisplay),ws(2),na("ngForOf",Rc(8,6,e.options))("ngForTrackBy",e.optionId)}},directives:[cH,IU,sH,QH,$H,E$,uU,m$,MU,pH,h$,kh,WH,wv,d5],pipes:[$h],styles:["[_nghost-%COMP%]{display:block}[_nghost-%COMP%] .form[_ngcontent-%COMP%] .form-field[_ngcontent-%COMP%]{width:100%}[_nghost-%COMP%] .form[_ngcontent-%COMP%] .form-field[_ngcontent-%COMP%] .input[_ngcontent-%COMP%]{margin-left:.5rem}[_nghost-%COMP%] .mat-form-field-appearance-outline .mat-form-field-wrapper{margin:0}[_nghost-%COMP%] .mat-form-field-appearance-outline .mat-form-field-wrapper .mat-form-field-flex{align-items:center}[_nghost-%COMP%] .mat-form-field-appearance-outline .mat-form-field-wrapper .mat-form-field-flex .mat-form-field-infix{height:3rem;border:none}[_nghost-%COMP%] .mat-form-field-appearance-outline .mat-form-field-wrapper .mat-form-field-flex .mat-form-field-suffix{top:0;border:none}"],changeDetection:0}),vw([PV.ak],m5.prototype,"getOptions",null),[{src:"app:skin",organ:"Skin",name:"Skin",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002097"},{src:"app:brain",organ:"Brain",name:"Brain",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000955"},{disabled:!0,src:"app:lymph-nodes",organ:"Lymph Node",name:"Lymph Node",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000029"},{src:"app:lymph-nodes",organ:"Lymph Node",name:"Lymph Node",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002509"},{disabled:!0,src:"app:eye",organ:"Eye",name:"Eye, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000970"},{src:"app:eye",organ:"Eye",name:"Eye, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0004548"},{src:"app:eye",organ:"Eye",name:"Eye, R",side:"right",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0004549"},{disabled:!0,src:"app:fallopian-tube-left",organ:"Fallopian Tube",name:"Fallopian Tube, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0003889"},{src:"app:fallopian-tube-left",organ:"Fallopian Tube",name:"Fallopian Tube, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0001303"},{src:"app:fallopian-tube-right",organ:"Fallopian Tube",name:"Fallopian Tube, R",side:"right",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0001302"},{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, L",side:"left",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"},{disabled:!0,src:"app:knee",organ:"Knee",name:"Knee, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001465"},{src:"app:knee",organ:"Knee",name:"Knee, L",side:"left",hasSex:!0,id:"http://purl.org/sig/ont/fma/fma24978"},{src:"app:knee",organ:"Knee",name:"Knee, R",side:"right",hasSex:!0,id:"http://purl.org/sig/ont/fma/fma24977"},{src:"app:liver",organ:"Liver",name:"Liver",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002107"},{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"},{disabled:!0,src:"app:mammary-gland",organ:"Mammary Gland",name:"Mammary Gland, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0001911"},{src:"app:mammary-gland",organ:"Mammary Gland",name:"Mammary Gland, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.org/sig/ont/fma/fma57991"},{src:"app:mammary-gland",organ:"Mammary Gland",name:"Mammary Gland, R",side:"right",hasSex:!1,sex:"female",id:"http://purl.org/sig/ont/fma/fma57987"},{disabled:!0,src:"app:ovary-left",organ:"Ovary",name:"Ovary, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0000992"},{src:"app:ovary-left",organ:"Ovary",name:"Ovary, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.org/sig/ont/fma/fma7214"},{src:"app:ovary-right",organ:"Ovary",name:"Ovary, R",side:"right",hasSex:!1,sex:"female",id:"http://purl.org/sig/ont/fma/fma7213"},{src:"app:pancreas",organ:"Pancreas",name:"Pancreas",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001264"},{src:"app:pelvis-f",organ:"Pelvis",name:"Pelvis",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001270"},{src:"app:placenta",organ:"Placenta",name:"Placenta",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0001987"},{src:"app:prostate",organ:"Prostate",name:"Prostate",hasSex:!1,sex:"male",id:"http://purl.obolibrary.org/obo/UBERON_0002367",disabled:!0},{src:"app:prostate",organ:"Prostate",name:"Prostate",hasSex:!1,sex:"male",id:"http://purl.obolibrary.org/obo/UBERON_0000079"},{src:"app:small-intestine",organ:"Small Intestine",name:"Small Intestine",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002108"},{src:"app:large-intestine",organ:"Large Intestine",name:"Large Intestine",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000059"},{src:"app:spinal-cord",organ:"Spinal Cord",name:"Spinal Cord",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002240"},{src:"app:spleen",organ:"Spleen",name:"Spleen",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002106"},{src:"app:thymus",organ:"Thymus",name:"Thymus",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002370"},{disabled:!0,src:"app:ureter-left",organ:"Ureter",name:"Ureter, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000056"},{src:"app:ureter-left",organ:"Ureter",name:"Ureter, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001223"},{src:"app:ureter-right",organ:"Ureter",name:"Ureter, R",side:"right",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001222"},{src:"app:bladder",organ:"Urinary Bladder",name:"Urinary Bladder",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001255"},{src:"app:uterus",organ:"Uterus",name:"Uterus",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0000995"},{src:"app:vasculature-thick",organ:"Blood Vasculature",name:"Blood Vasculature",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0004537"},{disabled:!0,src:"app:vasculature-thick",organ:"Blood Vasculature",name:"Blood Vasculature",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002049"}].sort((t,e)=>t.name.localeCompare(e.name)).filter(t=>!0!==t.disabled);let b5=class extends MW{constructor(){super(...arguments),this.optionCache=new Map}get config$(){return this.state$.pipe(IW(),xp(1))}setConfig(t){this.setState(t)}patchConfig(t){this.patchState(t)}getProperty(t){return this.config$.pipe(T$(...t),Wd(),xp(1))}getOption(...t){const e=this.getPathKey(t);if(this.optionCache.has(e))return this.optionCache.get(e);const n=this.config$.pipe(T$(...t),Wd(),xp(1));return this.optionCache.set(e,n),n}getPathKey(t){return`${t.length}:${t.join(".")}`}};b5.\u0275fac=function(){let t;return function(e){return(t||(t=ei(b5)))(e||b5)}}(),b5.\u0275prov=xt({token:b5,factory:b5.\u0275fac}),vw([CW()],b5.prototype,"config$",null),b5=vw([kW(),nU({name:"globalConfig",defaults:null})],b5);const y5="ALLOW_TELEMETRY",v5=_5();function _5(){const t=localStorage.getItem(y5);return null===t?void 0:"true"===t.toLowerCase()}let w5=class extends MW{setAllowTelemetry(t){const e=_5();localStorage.setItem(y5,t.toString()),this.ctx.patchState({allowTelemetry:t}),(void 0!==e||!1===t)&&location.reload()}};w5.\u0275fac=function(){let t;return function(e){return(t||(t=ei(w5)))(e||w5)}}(),w5.\u0275prov=xt({token:w5,factory:w5.\u0275fac}),vw([OW()],w5.prototype,"setAllowTelemetry",null),w5=vw([kW(),nU({name:"tracking",defaults:{allowTelemetry:v5}})],w5);const x5=new A,S5={cacheBusterObserver:x5},C5={cacheBusterObserver:x5,maxCacheCount:4};function E5(t,e,n){return t?{min:t[0]>e?t[0]:void 0,max:t[1]{var e;return Object.assign(Object.assign({},t),{transformMatrix:new VT(null!==(e=t.transformMatrix)&&void 0!==e?e:[])})})}class T5{constructor(t,e){this.api=t,this.globalConfig=e,e.getOption("hubmapToken").subscribe(x5)}getDatabaseStatus(){return this.doRequest(t=>this.api.dbStatus(t))}getProviderNames(){return this.doRequest(t=>this.api.providerNames(t))}getDatasetTechnologyNames(){return this.doRequest(t=>this.api.technologyNames(t))}getOntologyTreeModel(){return this.doRequest(t=>this.api.ontologyTreeModel(t),void 0,{},t=>t)}getCellTypeTreeModel(){return this.doRequest(t=>this.api.cellTypeTreeModel(t),void 0,{},t=>t)}getReferenceOrgans(){return this.doRequest(t=>this.api.referenceOrgans(t),void 0,{},t=>t)}getTissueBlockResults(t){return this.doRequest(t=>this.api.tissueBlocks(t),t,{},t=>t)}getAggregateResults(t){return this.doRequest(t=>this.api.aggregateResults(t),t)}getOntologyTermOccurences(t){return this.doRequest(t=>this.api.ontologyTermOccurences(t),t)}getCellTypeTermOccurences(t){return this.doRequest(t=>this.api.cellTypeTermOccurences(t),t)}getScene(t){return this.doRequest(t=>this.api.scene(t),t,{},O5)}getReferenceOrganScene(t,e){return this.doRequest(t=>this.api.referenceOrganScene(t),e,{organIri:t},O5)}doRequest(t,e,n,i){const{api:r,globalConfig:s}=this,o=Object.assign(Object.assign({},function(t){var e,n;return{age:E5(null==t?void 0:t.ageRange,1,110),bmi:E5(null==t?void 0:t.bmiRange,13,83),sex:null===(n=null===(e=null==t?void 0:t.sex)||void 0===e?void 0:e.toLowerCase)||void 0===n?void 0:n.call(e),ontologyTerms:null==t?void 0:t.ontologyTerms,cellTypeTerms:null==t?void 0:t.cellTypeTerms,providers:null==t?void 0:t.tmc,technologies:null==t?void 0:t.technologies,spatial:null==t?void 0:t.spatialSearches}}(e)),n);return z_([s.getOption("remoteApiEndpoint"),s.getOption("hubmapToken")]).pipe(rf(1),eg(([t,e])=>{r.configuration.basePath=t,e&&(o.token=e)}),cp(()=>t(o)),D(t=>i?i(t):t))}}T5.\u0275fac=function(t){return new(t||T5)(Ei(eq),Ei(b5))},T5.\u0275prov=xt({token:T5,factory:T5.\u0275fac,providedIn:"root"}),vw([QW(S5)],T5.prototype,"getProviderNames",null),vw([QW(S5)],T5.prototype,"getDatasetTechnologyNames",null),vw([QW(S5)],T5.prototype,"getOntologyTreeModel",null),vw([QW(S5)],T5.prototype,"getCellTypeTreeModel",null),vw([QW(S5)],T5.prototype,"getReferenceOrgans",null),vw([QW(C5)],T5.prototype,"getTissueBlockResults",null),vw([QW(C5)],T5.prototype,"getAggregateResults",null),vw([QW(C5)],T5.prototype,"getOntologyTermOccurences",null),vw([QW(C5)],T5.prototype,"getCellTypeTermOccurences",null),vw([QW(C5)],T5.prototype,"getScene",null),vw([QW(C5)],T5.prototype,"getReferenceOrganScene",null);let k5=(()=>{class t{}return t.type="[CallToAction] Learn More",t})(),P5=(()=>{class t{}return t.type="[CallToAction] Open Dialog",t})(),A5=(()=>{class t{}return t.type="[CallToAction] Close Dialog",t})();function M5(t,e){if(1&t&&(ra(0,"div",16),oa(1,"youtube-player",17),sa()),2&t){const t=va(3);ws(1),Sa("videoId",t.videoID)}}function I5(t,e){if(1&t&&(ra(0,"mat-expansion-panel",11),ra(1,"mat-expansion-panel-header"),ra(2,"h2",12),Ja(3),sa(),sa(),ra(4,"div",13),oa(5,"markdown",14),Jo(6,M5,2,1,"div",15),sa(),sa()),2&t){const t=va(),e=t.index,n=t.$implicit;na("expanded",0===e),ws(3),tl(n.title),ws(2),ja("first",0===e),na("data",n.content),ws(1),na("ngIf",0===e)}}function D5(t,e){if(1&t&&(ra(0,"div",9),Jo(1,I5,7,6,"mat-expansion-panel",10),sa()),2&t){const t=e.$implicit;ws(1),na("ngIf",t)}}let R5=(()=>{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(Y$),ea(Q$))},t.\u0275cmp=Jt({type:t,selectors:[["ccf-info-dialog"]],decls:11,vars:2,consts:[[1,"rui-about","wrapper"],[1,"container"],[1,"content"],[1,"header"],["mat-dialog-title","",1,"title"],[1,"close"],[1,"material-icons","close-icon",3,"click"],[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,"div",3),ra(4,"h2",4),Ja(5),sa(),ra(6,"div",5),ra(7,"mat-icon",6),fa("click",function(){return e.close()}),Ja(8,"clear"),sa(),sa(),sa(),ra(9,"mat-dialog-content",7),Jo(10,D5,2,1,"div",8),sa(),sa(),sa(),sa()),2&t&&(ws(5),tl(e.infoTitle),ws(5),na("ngForOf",e.documentationContents))},directives:[rG,T_,sG,kh,Ah,CG,TG,NG,WG],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%] .content[_ngcontent-%COMP%] .header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;height:3rem;margin-bottom:2.25rem;position:relative}.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%]{cursor:pointer;height:3rem;width:3rem;line-height:3rem;text-align:center;transition:.6s}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-size:1.5rem;margin:0 auto;line-height:3rem;height:3rem;justify-self:center;display:flex}.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;display:flex}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .dialog-content[_ngcontent-%COMP%] .variable-binding.first[_ngcontent-%COMP%]{padding-right:1rem;width:73%}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .dialog-content[_ngcontent-%COMP%] .variable-binding[_ngcontent-%COMP%] ul{margin:0}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .dialog-content[_ngcontent-%COMP%] .variable-binding[_ngcontent-%COMP%] img{margin-left:1rem;float:right}.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%}"]}),t})();class N5{get length(){var t,e;return null!==(e=null===(t=N5.storage)||void 0===t?void 0:t.length)&&void 0!==e?e:0}key(t){var e,n;return null!==(n=null===(e=N5.storage)||void 0===e?void 0:e.key(t))&&void 0!==n?n:null}getItem(t,e){var n,i,r;return null!==(r=null!==(i=null===(n=N5.storage)||void 0===n?void 0:n.getItem(t))&&void 0!==i?i:e)&&void 0!==r?r:null}setItem(t,e){var n;try{return null===(n=N5.storage)||void 0===n||n.setItem(t,e),!0}catch(i){return!1}}removeItem(t){var e;null===(e=N5.storage)||void 0===e||e.removeItem(t)}clear(){var t;null===(t=N5.storage)||void 0===t||t.clear()}}N5.storage=(()=>{let t;try{t=window.localStorage;const e="__storage_test__";return t.setItem(e,e),t.removeItem(e),t}catch(e){return e instanceof DOMException&&(22===e.code||1014===e.code||"QuotaExceededError"===e.name||"NS_ERROR_DOM_QUOTA_REACHED"===e.name)&&t&&0!==t.length?t:void 0}})(),N5.\u0275fac=function(t){return new(t||N5)},N5.\u0275prov=xt({token:N5,factory:N5.\u0275fac,providedIn:"root"});let L5=(()=>{class t{constructor(t){this.http=t,this.panelContent=new Jf({content:[],infoTitle:"",videoID:""})}updateData(t,e,n){this.http.get(t,{responseType:"text"}).subscribe(t=>{const i={content:this.parseMarkdown(t),infoTitle:n,videoID:e};this.panelContent.next(i)})}parseMarkdown(t){const e=[],n=t.split("# ");for(const i of n)if(i.length){const t=i.includes("\n\n")?"\n\n":"\r\n\r\n",n=i.split(t);e.push({title:n[0],content:n.splice(1).join(t)})}return e}}return t.\u0275fac=function(e){return new(e||t)(Ei(Jv))},t.\u0275prov=xt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();var j5;const F5="callToActionPopupShown";let B5=j5=class{constructor(t,e,n,i,r){this.dialog=t,this.ga=e,this.storage=n,this.infoService=i,this.http=r}static ctaDatePassed(t,e=Date.now){return+e()>+new Date(t)}ngxsOnInit(t){const{expirationDate:e,popupShown:n}=t.getState(),i=this.storage.getItem(F5,`${n}`),r=j5.ctaDatePassed(e);"true"!==i&&!r&&t.dispatch(new P5)}getDialogData(){return this.http.get("assets/docs/SPATIAL_SEARCH_README.md",{responseType:"text"}).pipe(D(t=>this.infoService.parseMarkdown(t)))}launchLearnMore(t){this.dialog.open(R5,{autoFocus:!1,panelClass:"modal-animated",width:"72rem",data:{title:"Spatial Search",content:t,videoID:"UfxMpzatowE"}})}learnMore(t){return this.dialog.closeAll(),this.ga.event("open_learn_more","call_to_action"),this.getDialogData().pipe(eg(t=>this.launchLearnMore(t)))}open(t){this.dialog.open(U5,{autoFocus:!1,panelClass:"modal-animated",width:"30.75rem",height:"36.688rem"}),this.ga.event("open","call_to_action"),this.storage.setItem(F5,"true"),t.patchState({popupShown:!0})}close(t){this.dialog.closeAll(),this.ga.event("close","call_to_action")}};B5.\u0275fac=function(t){return new(t||B5)(Ei(nG),Ei(jW),Ei(N5),Ei(L5),Ei(Jv))},B5.\u0275prov=xt({token:B5,factory:B5.\u0275fac}),vw([eU(k5)],B5.prototype,"learnMore",null),vw([eU(P5)],B5.prototype,"open",null),vw([eU(A5)],B5.prototype,"close",null),B5=j5=vw([nU({name:"callToAction",defaults:{title:"New to the Exploration User Interface",message:"Spatial Search has arrived!",callToAction:"Learn More",imageUrl:"assets/images/spatial_search.gif",expirationDate:"Dec 1, 2022",popupShown:!1}})],B5);class V5{static title(t){return t.title}static message(t){return t.message}static callToAction(t){return t.callToAction}static imageUrl(t){return t.imageUrl}static expirationDate(t){return t.expirationDate}static popupShown(t){return t.popupShown}}vw([rU([B5])],V5,"title",null),vw([rU([B5])],V5,"message",null),vw([rU([B5])],V5,"callToAction",null),vw([rU([B5])],V5,"imageUrl",null),vw([rU([B5])],V5,"expirationDate",null),vw([rU([B5])],V5,"popupShown",null);let z5=(()=>{class t{constructor(){this.clsName="ccf-call-to-action",this.callToActionClicked=new Bc,this.closeClicked=new Bc}close(){this.closeClicked.emit()}onDialogButtonClick(){this.callToActionClicked.emit()}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Jt({type:t,selectors:[["ccf-call-to-action"]],hostVars:2,hostBindings:function(t,e){2&t&&Va(e.clsName)},inputs:{infoTitle:"infoTitle",imageUrl:"imageUrl",message:"message",callToAction:"callToAction"},outputs:{callToActionClicked:"callToActionClicked",closeClicked:"closeClicked"},decls:13,vars:4,consts:[[1,"rui-about","wrapper"],[1,"container"],[1,"content"],[1,"first-row"],["mat-dialog-title","",1,"title"],[1,"cta-mat-icon","material-icons","close-icon",3,"click"],["mat-card-sm-image","","alt","preview","layout-fill","",1,"cta-image",3,"src"],[1,"mat-typography","dialog-content"],[1,"message"],["mat-button","",1,"mat-button",3,"text","click"]],template:function(t,e){1&t&&(ra(0,"div",0),ra(1,"div",1),ra(2,"div",2),ra(3,"div",3),ra(4,"p",4),Ja(5),sa(),ra(6,"mat-icon",5),fa("click",function(){return e.close()}),Ja(7,"clear"),sa(),sa(),oa(8,"img",6),ra(9,"mat-dialog-content",7),ra(10,"div",8),Ja(11),sa(),ra(12,"a",9),fa("click",function(){return e.onDialogButtonClick()}),sa(),sa(),sa(),sa(),sa()),2&t&&(ws(5),tl(e.infoTitle),ws(3),na("src",e.imageUrl,_r),ws(3),el(" ",e.message,""),ws(1),na("text",e.callToAction))},directives:[rG,T_,QG,sG],styles:["[_nghost-%COMP%] .content[_ngcontent-%COMP%]{display:block;align-content:center;padding-left:1.6rem;padding-right:1.6rem;border-radius:.25rem}[_nghost-%COMP%] .info-button-wrapper[_ngcontent-%COMP%]{border-radius:.25rem;padding:.6rem;transition:.6s}[_nghost-%COMP%] .info-button-wrapper[_ngcontent-%COMP%] .ccf-info-button[_ngcontent-%COMP%]{cursor:pointer;transition:color .6s;font-size:1.2rem;vertical-align:sub}[_nghost-%COMP%] .first-row[_ngcontent-%COMP%]{display:flex;width:100%;line-height:.9rem}[_nghost-%COMP%] .first-row[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{padding-right:7rem;padding-left:.2rem;font-size:.875rem;padding-top:.75rem}[_nghost-%COMP%] .first-row[_ngcontent-%COMP%] .cta-mat-icon[_ngcontent-%COMP%]{height:30%;line-height:3.4rem}[_nghost-%COMP%] .message[_ngcontent-%COMP%]{padding:.5rem}[_nghost-%COMP%] .cta-image[_ngcontent-%COMP%]{align-self:center;-o-object-fit:cover;object-fit:cover;width:100%;border-radius:.25rem}[_nghost-%COMP%] .mat-button[_ngcontent-%COMP%]{background-color:#444a65;font-size:.75rem;position:relative;margin-bottom:1rem;width:100%;height:2rem;color:#fff}"],changeDetection:0}),t})();class U5{constructor(){this.close=()=>new A5,this.learnMore=()=>new k5}}U5.\u0275fac=function(t){return new(t||U5)},U5.\u0275cmp=Jt({type:U5,selectors:[["ccf-call-to-action-behavior"]],decls:5,vars:12,consts:[[3,"infoTitle","message","callToAction","imageUrl","callToActionClicked","closeClicked"]],template:function(t,e){1&t&&(ra(0,"ccf-call-to-action",0),fa("callToActionClicked",function(){return e.learnMore()})("closeClicked",function(){return e.close()}),Dc(1,"async"),Dc(2,"async"),Dc(3,"async"),Dc(4,"async"),sa()),2&t&&na("infoTitle",Rc(1,4,e.title$))("message",Rc(2,6,e.message$))("callToAction",Rc(3,8,e.callToAction$))("imageUrl",Rc(4,10,e.imageUrl$))},directives:[z5],pipes:[$h],styles:[""],changeDetection:0}),vw([iU(V5.title)],U5.prototype,"title$",void 0),vw([iU(V5.message)],U5.prototype,"message$",void 0),vw([iU(V5.callToAction)],U5.prototype,"callToAction$",void 0),vw([iU(V5.imageUrl)],U5.prototype,"imageUrl$",void 0),vw([XY()],U5.prototype,"close",void 0),vw([XY()],U5.prototype,"learnMore",void 0);const H5=[{name:"bladder",namespace:"app",url:"assets/icons/organs/ico-organs-bladder.svg"},{name:"blood",namespace:"app",url:"assets/icons/organs/ico-organs-blood.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:"eye",namespace:"app",url:"assets/icons/organs/ico-organs-eye.svg"},{name:"fallopian-tube-left",namespace:"app",url:"assets/icons/organs/ico-organs-fallopian-tube-left.svg"},{name:"fallopian-tube-right",namespace:"app",url:"assets/icons/organs/ico-organs-fallopian-tube-right.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-right",namespace:"app",url:"assets/icons/organs/ico-organs-kidney-right.svg"},{name:"kidney",namespace:"app",url:"assets/icons/organs/ico-organs-kidney.svg"},{name:"knee",namespace:"app",url:"assets/icons/organs/ico-organs-knee.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-right",namespace:"app",url:"assets/icons/organs/ico-organs-lung-right.svg"},{name:"lung",namespace:"app",url:"assets/icons/organs/ico-organs-lung.svg"},{name:"lymph-nodes",namespace:"app",url:"assets/icons/organs/ico-organs-lymph-nodes.svg"},{name:"mammary-gland",namespace:"app",url:"assets/icons/organs/ico-organs-breast.svg"},{name:"neuron",namespace:"app",url:"assets/icons/organs/ico-organs-neuron.svg"},{name:"ovaries",namespace:"app",url:"assets/icons/organs/ico-organs-ovaries.svg"},{name:"ovary-left",namespace:"app",url:"assets/icons/organs/ico-organs-ovary-left.svg"},{name:"ovary-right",namespace:"app",url:"assets/icons/organs/ico-organs-ovary-right.svg"},{name:"pancreas",namespace:"app",url:"assets/icons/organs/ico-organs-pancreas.svg"},{name:"pelvis-f",namespace:"app",url:"assets/icons/organs/ico-organs-pelvis-f.svg"},{name:"placenta",namespace:"app",url:"assets/icons/organs/ico-organs-placenta.svg"},{name:"prostate",namespace:"app",url:"assets/icons/organs/ico-organs-prostate.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:"spinal-cord",namespace:"app",url:"assets/icons/organs/ico-organs-spinal-cord.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:"ureter-left",namespace:"app",url:"assets/icons/organs/ico-organs-ureter-left.svg"},{name:"ureter-right",namespace:"app",url:"assets/icons/organs/ico-organs-ureter-right.svg"},{name:"uterus",namespace:"app",url:"assets/icons/organs/ico-organs-uterus.svg"},{name:"vasculature-thick",namespace:"app",url:"assets/icons/organs/ico-organs-vasculature-thick.svg"},{name:"vasculature-thin",namespace:"app",url:"assets/icons/organs/ico-organs-vasculature-thin.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 $5=class extends AW{constructor(t,e){super(),this.registry=t;for(const{name:n,namespace:i,url:r,html:s}of H5){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)}};$5.\u0275fac=function(t){return new(t||$5)(Ei(y_,8),Ei(Sd))},$5.\u0275prov=xt({token:$5,factory:$5.\u0275fac}),vw([OW()],$5.prototype,"registerIcon",null),$5=vw([kW(),nU({name:"iconRegistry"})],$5);const G5=[XK,nZ,$5,iZ,WQ,sZ,B5,c0,QQ];let W5=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[e5.forRoot(),tU.forRoot(G5,{developmentMode:!RQ.production,selectorOptions:{injectContainerState:!1}}),YY.forRoot(),c5.forRoot({disabled:RQ.production})]]}),t})(),q5=(()=>{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)(Ei(t,12))},t.\u0275mod=ie({type:t}),t.\u0275inj=St({providers:[{provide:eQ,useExisting:J3}],imports:[[d_,GW.forRoot({gaToken:RQ.googleAnalyticsToken,appName:"eui"}),YK,nq.forRoot(()=>new tq({basePath:RQ.dbOptions.remoteApiEndpoint})),Q3,W5,t5],Q3]}),t})(),X5=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Wh,xK]]}),t})(),Y5=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Wh,ZH,lJ]]}),t})(),K5=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Wh,Wf,ef,ZH,lJ,e0]]}),t})(),Q5=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Wh,L_,k_]]}),t})(),Z5=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Wh,L_,k_,X5,Y5,K5,CQ,Q5]]}),t})(),J5=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Wh,k_,Z5]]}),t})(),t4=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Wh,bH,yH,b$,ZH,O$,k_]]}),t})(),e4=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Wh,L_,k_,yw,g1,FK]]}),t})(),n4=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Wh,t4,e4]]}),t})(),i4=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Wh,t4,e4,n4],t4,e4,n4]}),t})();function r4(){return(r4=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=H1();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=a2(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=a2(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),d2(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))}},o4={name:"navigation",params:{navigation:{nextEl:null,prevEl:null,hideOnClick:!1,disabledClass:"swiper-button-disabled",hiddenClass:"swiper-button-hidden",lockClass:"swiper-button-lock"}},create:function(){p2(this,{navigation:r4({},s4)})},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&&!a2(s).is(r)&&!a2(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 a4=(()=>{class t{constructor(){R2.use([o4])}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Wh,L_,k_,m3]]}),t})(),l4=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Wh]]}),t})(),c4=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Wh,xK,k_,a4,l4]]}),t})(),u4=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Wh,Gp,c4]]}),t})(),h4=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({providers:[{provide:yZ,useValue:bZ}],imports:[[Td,By,k_]]}),t})(),d4=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Wh,gZ]]}),t})(),p4=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=ie({type:t}),t.\u0275inj=St({imports:[[Wh,L_,k_,gZ]]}),t})(),f4=(()=>{class t{constructor(t){this.injector=t}ngDoBootstrap(){const t=function(t,e){const n=function(t,e){return e.get(Ol).resolveComponentFactory(t).inputs}(t,e.injector),i=e.strategyFactory||new Kf(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}(K3,{injector:this.injector});customElements.define("ccf-eui",t)}}return t.\u0275fac=function(e){return new(e||t)(Ei(No))},t.\u0275mod=ie({type:t}),t.\u0275inj=St({providers:[{provide:TQ,useValue:"hubmap-theme-light"},{provide:Tf,useExisting:OQ}],imports:[[By,Td,q5,h4,J5,i4,k_,K5,u4,d4,EK,LK,WK,yw,p4,JK,sw,Q5]]}),t})();RQ.production&&function(){if(Bu)throw new Error("Cannot enable prod mode after platform setup.");Fu=!1}(),Ed().bootstrapModule(f4).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},88509:function(t,e,n){"use strict";t.exports=n.p+"7693192ac33f7744a3ca.ts"},9521:function(){},49125:function(){},75307:function(){}},function(t){t(t.s=51316)}]); \ No newline at end of file diff --git a/main-es5.js b/main-es5.js index c5c4c982b..f34580893 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&&f(e,t)}function s(e){var t=d();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}}),f(i,e)})(e)}function h(e,t,n){return(h=d()?Reflect.construct:function(e,t,n){var i=[null];i.push.apply(i,t);var r=new(Function.bind.apply(e,i));return n&&f(r,n.prototype),r}).apply(null,arguments)}function d(){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 f(e,t){return(f=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 d(e){return e.toString(this.encoding)}function f(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|d(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 d(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 f(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 C(this,t,n);case"latin1":case"binary":return E(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,d=0;dr&&(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 A(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||P(e,t,this.length);for(var i=this[e],r=1,o=0;++o>>=0,t>>>=0,n||P(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||P(e,1,this.length),this[e]},a.prototype.readUInt16LE=function(e,t){return e>>>=0,t||P(e,2,this.length),this[e]|this[e+1]<<8},a.prototype.readUInt16BE=function(e,t){return e>>>=0,t||P(e,2,this.length),this[e]<<8|this[e+1]},a.prototype.readUInt32LE=function(e,t){return e>>>=0,t||P(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||P(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||P(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||P(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||P(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},a.prototype.readInt16LE=function(e,t){e>>>=0,t||P(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||P(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||P(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||P(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||P(e,4,this.length),i.read(this,e,!0,23,4)},a.prototype.readFloatBE=function(e,t){return e>>>=0,t||P(e,4,this.length),i.read(this,e,!1,23,4)},a.prototype.readDoubleLE=function(e,t){return e>>>=0,t||P(e,8,this.length),i.read(this,e,!0,52,8)},a.prototype.readDoubleBE=function(e,t){return e>>>=0,t||P(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||A(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||A(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||A(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||A(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||A(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||A(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},a.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||A(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},a.prototype.writeIntLE=function(e,t,n,i){if(e=+e,t>>>=0,!i){var r=Math.pow(2,8*n-1);A(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);A(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||A(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||A(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||A(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||A(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},a.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||A(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},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 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(e,t,n){var i={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},r=d.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,d=n?-1:1,f=e[t+h];for(h+=d,o=f&(1<<-l)-1,f>>=-l,l+=s;l>0;o=256*o+e[t+h],h+=d,l-=8);for(a=o&(1<<-l)-1,o>>=-l,l+=i;l>0;a=256*a+e[t+h],h+=d,l-=8);if(0===o)o=1-c;else{if(o===u)return a?NaN:1/0*(f?-1:1);a+=Math.pow(2,i),o-=c}return(f?-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,d=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,f=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?d/u:d*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+f]=255&s,f+=p,s/=256,r-=8);for(a=a<0;e[n+f]=255&a,f+=p,a/=256,c-=8);e[n+f-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 d(e){throw new c("Invalid JSON-LD syntax; @context must be an object.","jsonld.SyntaxError",{code:"invalid local context",context:e})}function f(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,d=u.isString,f=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,C=w.process,E=w.processingMode,O=e("./url"),T=O.removeBase,P=O.prependBase,A=e("./util"),M=A.addValue,I=A.asArray,R=A.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,P,A,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(A,z,"@context"),e.t1=f(U),e.t1){e.next=37;break}return e.next=36,C({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(P,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}),$=i.mappings.has(K)?i.mappings.get(K)["@nest"]:null,Q=P,$&&(N(i,$,p),l(P[$])||(P[$]={}),Q=P[$]),M(Q,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=P,ne&&(N(i,ne,p),l(P[ne])||(P[ne]={}),ie=P[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,de=void 0,ie.hasOwnProperty(te)?he=ie[te]:ie[te]=he={},!re.includes("@language")){e.next=96;break}g(ue)&&(ue=ue["@value"]),de=ee["@language"],e.next=138;break;case 96:if(!re.includes("@index")){e.next=117;break}if(fe=x(i,te,"@index")||"@index",pe=D.compactIri({activeCtx:i,iri:fe,relativeTo:{vocab:!0}}),"@index"!==fe){e.next=102;break}de=ee["@index"],delete ue[pe],e.next=115;break;case 102:if(me=void 0,ve=I(ue[fe]||[]),ge=n(ve),de=ge[0],me=ge.slice(1),!d(de)){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[fe],e.abrupt("break",112);case 109:return ue[fe]=me[0],e.abrupt("break",112);case 111:ue[fe]=me;case 112:e.next=115;break;case 114:de=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}}),de=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),de=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:de||(de=D.compactIri({activeCtx:i,iri:"@none",relativeTo:{vocab:!0}})),M(he,de,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(P,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(P,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(Ce in Se=e.sent)i.mappings.has(Ce)&&i.mappings.get(Ce).reverse&&(Ee=Se[Ce],Oe=(x(i,Ce,"@container")||[]).includes("@set")||!p.compactArrays,M(P,Ce,Ee,{propertyIsArray:Oe}),delete Se[Ce]);Object.keys(Se).length>0&&(Te=D.compactIri({activeCtx:i,iri:q,relativeTo:{vocab:!0}}),M(P,Te,Se));case 172:e.next=178;break;case 174:1===(Pe=I(X).map(function(e){return D.compactIri({activeCtx:A,iri:e,relativeTo:{vocab:!0}})})).length&&(Pe=Pe[0]),Ae=D.compactIri({activeCtx:i,iri:"@type",relativeTo:{vocab:!0}}),Me=(x(i,Ae,"@container")||[]).includes("@set")&&E(i,1.1)||c(Pe)&&0===X.length,M(P,Ae,Pe,{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]),P[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:P});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,d=e.base,f=void 0===d?null:d;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 C=0===x.length?y:null,E=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(Q.s();!($=Q.n()).done;){var Z=t($.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){Q.e(te)}finally{Q.f()}return u.vocab?i:"@base"in n?n["@base"]?T(P(f,n["@base"]),i):i:T(f,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,f=1===h||2===h&&"@index"in i&&!l,p="@language"in t,v=d(i["@value"]),m=t.mappings.has(n)&&null===t.mappings.get(n)["@language"];if(f&&"@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,d=s.isUndefined,f=e("./url"),p=f.isAbsolute,g=f.isRelative,m=f.prependBase,y=e("./util"),b=y.asArray,w=y.compareShortestLeast,k=new Map,x=/^@[a-zA-Z]+$/,S={};function C(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 d=e.mappings.get(u);if(d&&d._prefix)return d["@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 E(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=C(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=C(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(/(?::[^:])|\//)&&C(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 P=r.substr(0,w);if(i.hasOwnProperty(P)&&S.createTermDefinition({activeCtx:n,localCtx:i,term:P,defined:o,options:s}),n.mappings.has(P)){var A=r.substr(w+1);y["@id"]=n.mappings.get(P)["@id"]+A}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=C(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&&!d&&(n.protected[r]=!0,y.protected=!0,!E(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 C(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,d=c.get(h);if(null!==d){var f=d["@container"]||"@none";if(f=[].concat(f).sort().join(""),null!==d["@id"]){var p,g=_(b(d["@id"]));try{for(g.s();!(p=g.n()).done;){var m=p.value,y=n[m],k=S.isKeyword(m);if(y)!k&&!d._termHasColon&&o[m].push(h);else if(n[m]=y={},!k&&!d._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[f]||(y[f]={"@language":{},"@type":{},"@any":{}}),a(h,(y=y[f])["@any"],"@none"),d.reverse)a(h,y["@type"],"@reverse");else if("@none"===d["@type"])a(h,y["@any"],"@none"),a(h,y["@language"],"@none"),a(h,y["@type"],"@none");else if("@type"in d)a(h,y["@type"],d["@type"]);else if("@language"in d&&"@direction"in d){var C=d["@language"],E=d["@direction"];a(h,y["@language"],C&&E?"".concat(C,"_").concat(E).toLowerCase():C?C.toLowerCase():E?"_".concat(E):"@null")}else"@language"in d?a(h,y["@language"],(d["@language"]||"@null").toLowerCase()):"@direction"in d?a(h,y["@language"],d["@direction"]?"_".concat(d["@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(d){c.e(d)}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(d(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 d(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,f=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,d(f,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,d=e("./graphTypes"),f=d.isList,p=d.isValue,v=d.isGraph,g=d.isSubject,m=e("./context"),y=m.expandIri,b=m.getContextValue,w=m.isKeyword,k=m.process,x=m.processingMode,S=e("./url").isAbsolute,C=e("./util"),E=C.addValue,O=C.asArray,T=C.getValues,P=C.validateTypeValue,A={};n.exports=A;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,d,v,m,C,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,de,fe,pe,ve,ge,me,ye,be,_e,we,ke,xe,Se,Ce;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:i=n.activeCtx,o=n.activeProperty,h=n.expandedActiveProperty,d=n.element,v=n.expandedParent,m=n.options,C=void 0===m?{}:m,T=n.insideList,M=n.typeKey,D=n.typeScopedContext,N=n.expansionMap,F=Object.keys(d).sort(),B=[],z=d[M]&&"@json"===y(i,a(d[M])?d[M][0]:d[M],{vocab:!0},C),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=d[G],"@context"!==G){e.next=11;break}return e.abrupt("continue",185);case 11:if(null!==(X=y(i,G,{vocab:!0},C))&&(S(X)||w(X))||void 0!==(X=N({unmappedProperty:G,activeCtx:i,activeProperty:o,parent:d,options:C,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(C.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 E(v,"@id",O(q).map(function(e){return c(e)?y(i,e,{base:!0},C):e}),{propertyIsArray:C.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})})]}))),P(q,C.isFrame),E(v,"@type",O(q).map(function(e){return c(e)?y(D,e,{base:!0,vocab:!0},C):e}),{propertyIsArray:C.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,A.expand({activeCtx:i,activeProperty:o,element:q,options:C,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 E(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:E(v,"@value",q,{propertyIsArray:C.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)||C.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();!($=K.n()).done;)Q=$.value,c(Q)&&!Q.match(I)&&console.warn("@language must be valid BCP47: ".concat(Q))}catch(Ee){K.e(Ee)}finally{K.f()}return E(v,"@language",q,{propertyIsArray:C.isFrame}),e.abrupt("continue",185);case 62:if("@direction"!==X){e.next=85;break}if(c(q)||C.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 E(v,"@direction",q,{propertyIsArray:C.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 E(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,A.expand({activeCtx:i,activeProperty:"@reverse",element:q,options:C,expansionMap:N});case 95:if(!("@reverse"in(W=e.sent))){e.next=98;break}for(te in W["@reverse"])E(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"]={}),E(ne,ie,[],{propertyIsArray:!0}),re=W[ie],oe=0;case 107:if(!(oe1?$.slice().sort():$:[$],Z=_(Q),e.prev=81,Z.s();case 83:if((J=Z.n()).done){e.next=93;break}if(ee=J.value,te=b(C,ee,"@context"),e.t5=l(te),e.t5){e.next=91;break}return e.next=90,k({activeCtx:n,localCtx:te,options:f,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:f,insideList:v,typeKey:q,typeScopedContext:C,expansionMap:P});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,P({unmappedValue:ne,activeCtx:n,activeProperty:o,element:h,options:f,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,P(ne,{unmappedValue:ne,activeCtx:n,activeProperty:o,element:h,options:f,insideList:v});case 150:ue=e.sent,ne=void 0!==ue?ue:null;case 152:if(!s(ne)||f.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,P({unmappedValue:ne,activeCtx:n,activeProperty:o,element:h,options:f,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,d=s.getValues(t,l),f=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(d[0])),!o.requireAll)return h}else if("@type"===l){if(u=!1,f){if(d.length>0)return!1;h=!0}else if(1===n["@type"].length&&a.isEmptyObject(n["@type"][0]))h=d.length>0;else{var p,v=_(n["@type"]);try{var g=function(){var e=p.value;h=!(!a.isObject(e)||!("@default"in e))||h||d.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===d.length&&i)return"continue";if(d.length>0&&f)return{v:!1};if(void 0===t){if(d.length>0)return{v:!1};h=!0}else if(r.isList(t)){var c=t["@list"][0];if(r.isList(d[0])){var p=d[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)?d.some(function(e){return S(t,e)}):r.isSubjectReference(t)?d.some(function(n){return x(e,t,n,o)}):!!a.isObject(t)&&d.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,d={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],C=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,d),E=Object.keys(C).sort(),O=_(E);try{var T=function(){var m=w.value,y=C[m];if(null===l?e.uniqueEmbeds=o({},e.graph,{}):e.uniqueEmbeds[e.graph]=e.uniqueEmbeds[e.graph]||{},"@link"===d.embed&&m in x)return k(u,l,x[m]),"continue";var E={"@id":m};if(0===m.indexOf("_:")&&s.addValue(e.bnodeMap,m,E,{propertyIsArray:!0}),x[m]=E,("@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(m)){if(e.embedded&&("@never"===d.embed||v(y,e.graph,e.subjectStack)))return k(u,l,E),"continue";if(e.embedded&&("@first"==d.embed||"@once"==d.embed)&&e.uniqueEmbeds[e.graph].hasOwnProperty(m))return k(u,l,E),"continue";if("@last"===d.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&&f.frame(I(M({},e),{graph:m,embedded:!1}),Object.keys(e.graphMap[m]).sort(),[T],E,"@graph")}"@included"in n&&f.frame(I(M({},e),{embedded:!1}),t,n["@included"],E,"@included");var P,A=_(Object.keys(y).sort());try{for(A.s();!(P=A.n()).done;){var R=P.value;if(i(R)){if(E[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,E,{propertyIsArray:!0})}}catch(re){N.e(re)}finally{N.f()}}}else if(!d.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(d);if(r.isList(B)){var z=n[R]&&n[R][0]&&n[R][0]["@list"]?n[R][0]["@list"]:p(d),U={"@list":[]};k(E,R,U);var H,G=_(B["@list"]);try{for(G.s();!(H=G.n()).done;){var W=H.value;r.isSubjectReference(W)?f.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)?f.frame(I(M({},e),{embedded:!0}),[B["@id"]],V,E,R):S(V[0],B)&&k(E,R,s.clone(B))}}catch(re){F.e(re)}finally{F.f()}}}}catch(re){A.e(re)}finally{A.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 E)){var $="@null";"@default"in K&&($=s.clone(K["@default"])),a.isArray($)||($=[$]),E[Y]=[{"@preserve":$}]}}}catch(re){X.e(re)}finally{X.f()}var Q,Z=_(Object.keys(n["@reverse"]||{}).sort());try{for(Z.s();!(Q=Z.n()).done;)for(var J=Q.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,C,E,O,T,P,A,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,(C="DefaultGraph"===x.graph.termType?"@default":x.graph.value)in y||(y[C]={}),"@default"!==C&&!(C in m)&&(m[C]={"@id":C}),E=y[C],O=x.subject.value,T=x.predicate.value,P=x.object,O in E||(E[O]={"@id":O}),A=E[O],(M=P.termType.endsWith("Node"))&&!(P.value in E)&&(E[P.value]={"@id":P.value}),T!==v||r||!M){e.next=15;break}return u.addValue(A,"@type",P.value,{propertyIsArray:!0}),e.abrupt("continue",17);case 15:I=S(P,c,g),u.addValue(A,T,I,{propertyIsArray:!0}),M&&(P.value===p?("usages"in(R=E[P.value])||(R.usages=[]),R.usages.push({node:A,property:T,value:I})):b[P.value]=!(P.value in b)&&{node:A,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===f&&s.isObject(b[V["@id"]])&&s.isArray(V[d])&&1===V[d].length&&s.isArray(V[f])&&1===V[f].length&&(3===W||4===W&&s.isArray(V["@type"])&&1===V["@type"].length&&V["@type"][0]===l)&&(H.push(V[d][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"),d=e("./expand").expand,f=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,C=e("./context"),P=C.expandIri,A=C.getInitialContext,I=C.process,R=C.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 C(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&&E){var r,o=_(E(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,d,f,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=C(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(A(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]),d=i,i=[];for(f=0;f0)&&i.push(d[f]);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,f,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=C(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=A(i),f=0,p=s;case 16:if(!(f=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",d={};function f(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)},d.parseLinkHeader=function(e){for(var t={},n=e.match(u),i=0;i0}return!1},d.hasValue=function(e,t,n){if(d.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[d].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[f]=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[d]=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[d].has(e)){if(s>this[r])return _(this,this[d].get(e)),!1;var f=this[d].get(e).value;return this[c]&&(this[l]||this[c](e,f.value)),f.now=i,f.maxAge=n,f.value=t,this[o]+=s-f.length,f.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[d].set(e,this[h].head),y(this),!0)}},{key:"has",value:function(e){if(!this[d].has(e))return!1;var t=this[d].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[d].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[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 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.default=n.Variable=n.Triple=n.Term=n.Quad=n.NamedNode=n.Literal=n.DefaultGraph=n.BlankNode=void 0,n.escapeQuotes=O,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!==f.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.unescapeQuotes=T;var i,r,o=(i=e("./IRIs"))&&i.__esModule?i:{default:i},l=e("./N3Util"),h=o.default,d=h.rdf,f=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=f.boolean:"number"==typeof e&&(Number.isFinite(e)?n=Number.isInteger(e)?f.integer:f.double:(n=f.double,Number.isNaN(e)||(e=e>0?"INF":"-INF")))),new k(""===n||n===f.string?'"'.concat(e,'"'):'"'.concat(e,'"^^').concat(n))},defaultGraph:function(){return r},quad:P,triple:P};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:"hashCode",value:function(){return 0}},{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=i.length;;){for(var o=void 0,s=void 0;o=this._newline.exec(i);)this._comments&&(s=this._comment.exec(o[0]))&&_("comment",s[1],"",this._line,o[0].length),i=i.substr(o[0].length,i.length),r=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&&(this._comments&&(s=this._comment.exec(i))&&_("comment",s[1],"",this._line,i.length),i=null,_("eof","","",this._line,0)),this._input=i;var u=this._line,l=i[0],h="",d="",f="",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",d=p[1];else if(p=this._iri.exec(i)){if(null===(d=this._unescape(p[1]))||c.test(d))return w(this);h="IRI"}else i.length>1&&"<"===i[1]?(h="<<",v=2):this._n3Mode&&i.length>1&&"="===i[1]&&(h="inverse",v=2,d=">");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",f="_",d=p[1]);break;case'"':if(p=this._simpleQuotedString.exec(i))d=p[1];else if(d=(n=this._parseLiteral(i)).value,v=n.matchLength,null===d)return w(this);(null!==p||0!==v)&&(h="literal",this._literalClosingPos=0);break;case"'":if(!this._lineMode){var m;if(p=this._simpleApostropheString.exec(i))d=p[1];else if(d=(m=this._parseLiteral(i)).value,v=m.matchLength,null===d)return w(this);(null!==p||0!==v)&&(h="literal",this._literalClosingPos=0)}break;case"?":this._n3Mode&&(p=this._variable.exec(i))&&(h="var",d=p[0]);break;case"@":"literal"===this._previousMarker&&(p=this._langcode.exec(i))?(h="langcode",d=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",d=p[0],f="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",d=p[0],f=a.boolean):g=!0;break;case"a":(p=this._shortPredicates.exec(i))?(h="abbreviation",d="a"):g=!0;break;case"=":this._n3Mode&&i.length>1&&(h="abbreviation",">"!==i[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,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",f=p[1]||"",d=this._unescape(p[2])):(h="prefix",d=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)?w(this):this._input=i;var y=v||p[0].length,b=_(h,d,f,u,y);this.previousToken=b,this._previousMarker=h,i=i.substr(y,i.length)}function _(t,n,o,a,s){var u=i?r-i.length:r,c={type:t,value:n,prefix:o,line:a,start:u,end:u+s};return e(null,c),c}function w(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"[":if(this._n3Mode)return this._saveContext("blank",this._graph,this._subject,this._subject=this._blankNode(),null),this._readBlankNodeHead;case"blank":if(!this._n3Mode)return this._error("Disallowed blank node as predicate",e);default:if(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?this._getContextEndReader():null!==this._predicate?this._readObject:t?this._readPredicateOrNamedGraph:this._readPredicateAfterBlank}},{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:regeneratorRuntime.mark(function e(t,n,i,o,a,s,u,c){var l,h,d,f,p,v,g,m,y,b,_,w;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:f=!n+!i+!o>1?Object.keys(this._ids):this._entities,p=(0,r.termFromId)(c,this._factory),n&&((l=t,t={})[n]=l[n]),e.t0=regeneratorRuntime.keys(t);case 3:if((e.t1=e.t0()).done){e.next=29;break}if(v=e.t1.value,g=f[v],!(h=t[v])){e.next=27;break}i&&((l=h,h={})[i]=l[i]),e.t2=regeneratorRuntime.keys(h);case 9:if((e.t3=e.t2()).done){e.next=27;break}if(m=e.t3.value,y=f[m],!(d=h[m])){e.next=25;break}b=o?o in d?[o]:[]:Object.keys(d),_=0;case 15:if(!(_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,d=t.subject;d&&!c;){for(var f=e.getQuads(null,null,d,null),p=e.getQuads(d,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===f.string)return'"'.concat(t,'"')}else switch(e.datatype.value){case f.string:return'"'.concat(t,'"');case f.boolean:if("true"===t||"false"===t)return t;break;case f.integer:if(/^[+-]?\d+$/.test(t))return t;break;case f.decimal:if(/^[+-]?\d*\.\d+$/.test(t))return t;break;case f.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,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=w(o),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={},f=0,p=_(e.split(c.eoln));try{for(p.s();!(t=p.n()).done;){var v=t.value;if(f++,!c.empty.test(v)){var g=v.match(c.quad);if(null===g)throw new Error("N-Quads parse error on line "+f+".");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(d,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 d=e[h],f={termType:n[d.type],value:d.value};f.termType===s&&(f.datatype={termType:o},"datatype"in d&&(f.datatype.value=d.datatype),"language"in d?("datatype"in d||(f.datatype.value=i),f.language=d.language):"datatype"in d||(f.datatype.value=r)),l[h]=f}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,d=/(?:\\([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 d=l.value;d>i&&t.set(d,!t.get(d))}}catch(f){h.e(f)}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,d,f,p,g,m,y,b,w,k,x,S,C,E,O,T,P,A,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,d=_(l),n.prev=6,d.s();case 8:if((f=d.n()).done){n.next=18;break}if(p=f.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),d.e(n.t1);case 23:return n.prev=23,d.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(!(xf)){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}E=_(w),i.prev=43,E.s();case 45:if((O=E.n()).done){i.next=55;break}return T=O.value,i.next=49,n.hashNDegreeQuads(T,y);case 49:if(P=i.sent,b+=y.getId(T),b+="<".concat(P.hash,">"),y=P.issuer,!(0!==f.length&&b>f)){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),E.e(i.t2);case 60:return i.prev=60,E.f(),i.finish(60);case 63:k||(0===f.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,d=[],f=_(v(u.keys()).sort());try{for(f.s();!(h=f.n()).done;){var p=h.value,g=u.get(p);g.length>1?d.push(g):this.canonicalIssuer.getId(g[0])}}catch(j){f.e(j)}finally{f.f()}for(var m=0,y=d;ml){y=!0;break}}}catch(E){b.e(E)}finally{b.f()}if(!y){var k,x=_(m);try{for(x.s();!(k=x.n()).done;){var S=k.value,C=this.hashNDegreeQuads(S,p);if(g+=p.getId(S),g+="<".concat(C.hash,">"),p=C.issuer,0!==l.length&&g>l){y=!0;break}}}catch(E){x.e(E)}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,d,f;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:d=i.sent,(f=r.get(d))?f.push(h):r.set(d,[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"),d=e("rdf-data-factory"),f=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 d.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,d=!1,f=!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,d=!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,f=!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=f?this.dataFactory.blankNode(h):this.valueToUri(h,t),d&&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 d in e.attributes){var f=e.attributes[d],p=n.expandPrefixedTerm(d,t.ns,this);if(p.uri===n.RDF)switch(p.local){case"resource":if(u)throw this.newParseError("Found both rdf:resource (".concat(f,") and rdf:nodeID (").concat(u,")."));if(a)throw this.newParseError("rdf:parseType is not allowed on property elements with rdf:resource (".concat(f,")"));t.hadChildren=!0,u=f,c=!1;continue;case"datatype":if(s)throw this.newParseError("Found both non-rdf:* property attributes and rdf:datatype (".concat(f,")."));if(a)throw this.newParseError("rdf:parseType is not allowed on property elements with rdf:datatype (".concat(f,")"));t.datatype=this.valueToUri(f,t);continue;case"nodeID":if(s)throw this.newParseError("Found both non-rdf:* property attributes and rdf:nodeID (".concat(f,")."));if(t.hadChildren)throw this.newParseError("Found both rdf:resource and rdf:nodeID (".concat(f,")."));if(a)throw this.newParseError("rdf:parseType is not allowed on property elements with rdf:nodeID (".concat(f,")"));this.validateNcname(f),t.hadChildren=!0,u=f,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"===f){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"===f?(a=!0,t.hadChildren=!0,t.childrenCollectionSubject=t.subject,t.childrenCollectionPredicate=t.predicate,c=!1):"Literal"===f&&(a=!0,t.childrenTagsToString=!0,t.childrenStringTags=[]);continue;case"ID":this.validateNcname(f),t.reifiedStatementId=this.valueToUri("#"+f,t),this.claimNodeId(t.reifiedStatementId);continue}else if(p.uri===n.XML&&"lang"===p.local){t.language=""===f?null:f.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(f));t.hadChildren=!0,s=!0,l.push(this.uriToNamedNode(p.uri+p.local)),h.push(this.dataFactory.literal(f,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=f,f.IRI_REGEX=/^([A-Za-z][A-Za-z0-9+-.]*):[^ "<>{}|\\\[\]`]*$/,f.MIME_TYPE="application/rdf+xml",f.RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#",f.XML="http://www.w3.org/XML/1998/namespace",f.XMLNS="http://www.w3.org/2000/xmlns/",f.DEFAULT_NS={xml:f.XML},f.FORBIDDEN_NODE_ELEMENTS=["RDF","ID","about","bagID","parseType","resource","nodeID","li","aboutEach","aboutEachPrefix"],f.FORBIDDEN_PROPERTY_ELEMENTS=["Description","RDF","ID","about","bagID","parseType","resource","nodeID","aboutEach","aboutEachPrefix"],f.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 A(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):A(this),null;if(0===(e=P(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},C.prototype._read=function(e){k(this,new _("_read()"))},C.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",f),e.removeListener("finish",p),e.removeListener("drain",c),e.removeListener("error",d),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 d(t){o("onerror",t),v(),e.removeListener("error",d),0===a(e,"error")&&k(e,t)}function f(){e.removeListener("finish",p),v()}function p(){o("onfinish"),e.removeListener("close",f),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",d),e.once("close",f),e.once("finish",p),e.emit("pipe",i),r.flowing||(o("pipe resume"),i.resume()),e},C.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?A(this):r.reading||n.nextTick(N,this)),i},C.prototype.removeListener=function(e,t){var i=s.prototype.removeListener.call(this,e,t);return"readable"===e&&n.nextTick(D,this),i},C.prototype.removeAllListeners=function(e){var t=s.prototype.removeAllListeners.apply(this,arguments);return("readable"===e||void 0===e)&&n.nextTick(D,this),t},C.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},C.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},C.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(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(e,t,n){n(new v("_write()"))},C.prototype._writev=null,C.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(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(e){!this._writableState||(this._writableState.destroyed=e)}}),C.prototype.destroy=h.destroy,C.prototype._undestroy=h.undestroy,C.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"),d=Symbol("stream");function f(e,t){return{value:e,done:t}}function p(e){var t=e[a];if(null!==t){var n=e[d].read();null!==n&&(e[l]=null,e[a]=null,e[s]=null,t(f(n,!1)))}}function v(e){n.nextTick(p,e)}var g=Object.getPrototypeOf(function(){}),m=Object.setPrototypeOf((r(i={get stream(){return this[d]},next:function(){var e=this,t=this[u];if(null!==t)return Promise.reject(t);if(this[c])return Promise.resolve(f(void 0,!0));if(this[d].destroyed)return new Promise(function(t,i){n.nextTick(function(){e[u]?i(e[u]):t(f(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(f(void 0,!0)):t[h](n,i)},i)}}(r,this));else{var o=this[d].read();if(null!==o)return Promise.resolve(f(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[d].destroy(null,function(e){e?n(e):t(f(void 0,!0))})})}),i),g);t.exports=function(e){var t,n=Object.create(m,(r(t={},d,{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[d].read();i?(n[l]=null,n[a]=null,n[s]=null,e(f(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(f(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),d=h.lastIndexOf("/");return d>=0&&d"===o?(E(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,E(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&&E(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&&E(t,"oncdata",t.cdata),E(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?(E(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(d,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(d,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="",E(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(d,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:f,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":E(e,"oncdata",e.cdata),e.cdata="";break;case"script":E(e,"onscript",e.script),e.script="";break;default:P(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&&(E(e,"oncdata",e.cdata),e.cdata=""),""!==e.script&&(E(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]/,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]/,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 C(e,t,n){e[t]&&e[t](n)}function E(e,t,n){e.textNode&&O(e),C(e,t,n)}function O(e){e.textNode=T(e.opt,e.textNode),e.textNode&&C(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 P(e,t){return O(e),e.trackPosition&&(t+="\nLine: "+e.line+"\nColumn: "+e.column+"\nChar: "+e.c),t=new Error(t),e.error=t,C(e,"onerror",t),e}function A(e){return e.sawRoot&&!e.closedRoot&&M(e,"Unclosed root tag"),e.state!==x.BEGIN&&e.state!==x.BEGIN_WHITESPACE&&e.state!==x.TEXT&&P(e,"Unexpected end"),O(e),e.c="",e.closed=!0,C(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&&P(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,E(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,E(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){E(e,"onopennamespace",{prefix:t,uri:n.ns[t]})});for(var r=0,o=e.attribList.length;r",e.tagName="",void(e.state=x.SCRIPT);E(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,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=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(){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),i=function(e){t.postMessage(c+e,"*")}):t.MessageChannel?function(){var e=new MessageChannel;e.port1.onmessage=function(e){d(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(){d(t),n.onreadystatechange=null,e.removeChild(n),n=null},e.appendChild(n)}}():i=function(e){setTimeout(d,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=0?1.2:1))}function i(e,t,n,i,o,a){for(var s=0;s-1);a[++c]=u,s[c]=l,s[c+1]=t}for(u=0,c=0;u 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,d=["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 d)!d.hasOwnProperty(e)||(c[d[e]]?this.element.setAttribute(d[e],c[d[e]].substr(1)):this.element.removeAttribute(d[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,d=/\[[\s\t]*?(min|max)-(width|height)[\s\t]*?[~$\^]?=[\s\t]*?"([^"]*?)"[\s\t]*?]/gim;function f(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=d.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"))&&f(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 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 O(e,t,n){var i={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},r=E.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=A(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):P.call(e,t)},w.prototype.listenerCount=P,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 $(e,t){for(var n in t)t[n].forEach(function(t){return e.push(t.key)})}function Q(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 de(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 fe(e,t,n,i){var r=[],o=e?$: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:Q;"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 Ce(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 Ee(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 Pe(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 Ae(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,d=t._nodes.values(),f=t.type;!0!==(i=d.next()).done;){if(r=i.value,"undirected"!==f)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"!==f)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 d(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),d(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 d=new U(i,r,n,u,c,s);return e._edges.set(r,d),o===a?i?(u.undirectedSelfLoops++,e._undirectedSelfLoopCount++):(u.directedSelfLoops++,e._directedSelfLoopCount++):i?(u.undirectedDegree++,c.undirectedDegree++):(u.outDegree++,c.inDegree++),H(e,i,d,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 d,f,p=e._nodes.get(o),v=e._nodes.get(a);if(!n&&(d=e._edges.get(r))){if(d.source.key!==o||d.target.key!==a||i&&(d.source.key!==a||d.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(d.source.key,'", "').concat(d.target.key,'").'));f=d}if(f||e.multi||!p||(f=i?p.undirected[a]:p.out[a]),f)return(c?l:s)?(c?(f.attributes=l(f.attributes),e.emit("edgeAttributesUpdated",{type:"replace",key:f.key,attributes:f.attributes})):(u(f.attributes,s),e.emit("edgeAttributesUpdated",{type:"merge",key:f.key,attributes:f.attributes,data:s})),f.key):f.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,{})),d=new U(i,r,n,p,v,s),e._edges.set(r,d),o===a?i?(p.undirectedSelfLoops++,e._undirectedSelfLoopCount++):(p.directedSelfLoops++,e._directedSelfLoopCount++):i?(p.undirectedDegree++,v.undirectedDegree++):(p.outDegree++,v.inDegree++),H(e,i,d,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 f(s(n),"NodeDataClass",r),f(s(n),"_attributes",{}),f(s(n),"_nodes",new Map),f(s(n),"_edges",new Map),f(s(n),"_directedSize",0),f(s(n),"_undirectedSize",0),f(s(n),"_directedSelfLoopCount",0),f(s(n),"_undirectedSelfLoopCount",0),f(s(n),"_edgeKeyGenerator",t.edgeKeyGenerator||(i=0,function(){return i++})),f(s(n),"_options",t),Fe.forEach(function(e){return f(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?(f=(u=this)._nodes.values(),p=u.type,v="outer",g=null,new R(function e(){var t;if("outer"===v)return!0===(t=f.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),d=0,v="inner-directed",e());if("undirected"===v){if("directed"===p)return v="outer",e();h=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=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,d,f,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,f(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 fe(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 de(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 Ae(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&&Ce(r,n,n.in,i),"in"!==t&&Ce(r,n,n.out,i)),"directed"!==e&&Ce(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 Ee(n,n.undirected,i);if("string"==typeof t)return Ee(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,Pe(r,n,n.in))),"in"!==t&&(i=X(i,Pe(r,n,n.out)))),"directed"!==e&&(i=X(i,Pe(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 $e(e){e.from=function(t,n){var i=u({},t.options,n),r=new e(i);return r.import(t),r}}return $e(Ge),$e(We),$e(qe),$e(Xe),$e(Ye),$e(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,d=Math.abs,f=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 P(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=f(),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=d(l.x)>d(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=d(h.x)>d(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;E(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=d(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&&C(this.element,this.evEl,this.domHandler),this.evTarget&&C(this.target,this.evTarget,this.domHandler),this.evWin&&C(D(this.element),this.evWin,this.domHandler)}};var $={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(e){var t=$[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=P(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=A(e.touches),i=A(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 de(){this.evTarget=he,this.targetIds={},U.apply(this,arguments)}function fe(e,t){var n=A(e.touches),i=this.targetIds;if(3&t&&1===n.length)return i[n[0].identifier]=!0,[n,n];var r,o,a=A(e.changedTouches),s=[],u=this.target;if(o=n.filter(function(e){return E(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=Pe(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=f(),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&&d(t)>this.options.velocity&&4&e.eventType},emit:function(e){var t=Pe(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,$=/<%=([\s\S]+?)%>/g,Q=/\.|\[(?:[^[\]]*|(["'])(?:(?!\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*$/,de=/^[-+]0x[0-9a-f]+$/i,fe=/^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",Ce="\\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",Oe="["+_e+"]",Te="["+Ee+"]",Pe="["+we+"]",Ae="\\d+",Me="["+ke+"]",Ie="["+xe+"]",Re="[^"+_e+Ee+Ae+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="(?:"+Pe+"|"+De+")?",Ge="["+Ce+"]?",We=Ge+He+"(?:\\u200d(?:"+[Ne,Le,je].join("|")+")"+Ge+He+")*",qe="(?:"+[Me,Le,je].join("|")+")"+We,Xe="(?:"+[Ne+Pe+"?",Pe,Le,je,Oe].join("|")+")",Ye=RegExp("['\u2019]","g"),Ke=RegExp(Pe,"g"),$e=RegExp(De+"(?="+De+")|"+Xe+We,"g"),Qe=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_])",Ae,qe].join("|"),"g"),Ze=RegExp("[\\u200d"+_e+we+Ce+"]"),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[A]=nt[g]=nt[M]=nt[m]=nt[y]=nt[b]=nt[w]=nt[k]=nt[x]=nt[C]=nt[E]=nt[O]=nt[P]=!1;var it={};it[p]=it[v]=it[A]=it[M]=it[g]=it[m]=it[I]=it[R]=it[D]=it[N]=it[L]=it[w]=it[k]=it[x]=it[C]=it[E]=it[O]=it[T]=it[j]=it[F]=it[B]=it[V]=!0,it[y]=it[b]=it[P]=!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,dt=ht&&ht.exports===lt,ft=dt&&st.process,pt=function(){try{return ht&&ht.require&&ht.require("util").types||ft&&ft.binding&&ft.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 Qt(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",""":'"',"'":"'"}),dn=function e(t){var n,i=(t=null==t?ct:dn.defaults(ct.Object(),t,dn.pick(ct,et))).Array,ie=t.Date,_e=t.Error,we=t.Function,ke=t.Math,xe=t.Object,Se=t.RegExp,Ce=t.String,Ee=t.TypeError,Oe=i.prototype,Te=xe.prototype,Pe=t["__core-js_shared__"],Ae=we.prototype.toString,Me=Te.hasOwnProperty,Ie=0,Re=(n=/[^.]+$/.exec(Pe&&Pe.keys&&Pe.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",De=Te.toString,Ne=Ae.call(xe),Le=ct._,je=Se("^"+Ae.call(Me).replace(ee,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Fe=dt?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,$e=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,ft=xe.getOwnPropertySymbols,pt=Fe?Fe.isBuffer:r,Dt=t.isFinite,Ut=Oe.join,fn=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"),Cn=ao(xe,"create"),En=Sn&&new Sn,On={},Tn=Lo(_n),Pn=Lo(wn),An=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__=d,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 d=co(e),f=d==b||d==_;if(qa(e))return yr(e,u);if(d==x||d==p||f&&!o){if(s=c||f?{}:ho(e),!u)return c?function(e,t){return Cr(e,uo(e),t)}(e,function(e,t){return e&&Cr(t,As(t),e)}(s,e)):function(e,t){return Cr(e,so(e),t)}(e,ei(s,e))}else{if(!it[d])return o?e:{};s=function(e,t,n){var i=e.constructor;switch(t){case A: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 C:return function(e){var t=new e.constructor(e.source,he.exec(e));return t.lastIndex=e.lastIndex,t}(e);case E:return new i;case T:return function(e){return Dn?xe(Dn.call(e)):{}}(e)}}(e,d,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?As:Ps)(e);return xt(y||e,function(i,r){y&&(i=e[r=i]),Qn(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 Ee(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=Pt(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?fi(s,t-1,n,i,r):At(r,s):i||(r[r.length]=s)}return r}var pi=Pr(),vi=Pr(!0);function gi(e,t){return e&&pi(e,t,Ps)}function mi(e,t){return e&&vi(e,t,Ps)}function yi(e,t){return Et(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 Ci(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 d=e[u];u&&t&&(d=Pt(d,Xt(t))),l=vn(d.length,l),c[u]=!n&&(t||a>=120&&d.length>=120)?new Gn(u&&d):r}d=e[0];var f=-1,p=c[0];e:for(;++f=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:Pt(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 Qr(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 Ee(o);if(a&&!u&&"wrapper"==to(s))var u=new Bn([],!0)}for(i=u?i:n;++i1&&b.reverse(),f&&hu))return!1;var l=a.get(e),h=a.get(t);if(l&&h)return l==t&&h==e;var d=-1,f=!0,p=2&n?new Gn:r;for(a.set(e,t),a.set(t,e);++d-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(f,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 Ao(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 da=Qr(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)}),fa=Er(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=Er(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):Ei(e,t,n)}),a}),_a=Er(function(e,t,n){ti(e,n,t)});function wa(e,t){return(Ua(e)?Pt:Di)(e,io(t,3))}var ka=Er(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,fi(t,1),[])}),Sa=st||function(){return ct.Date.now()};function Ca(e,t,n){return t=n?r:t,qr(e,c,r,r,r,r,t=e&&null==t?e.length:t)}function Ea(e,t){var n;if("function"!=typeof t)throw new Ee(o);return e=ds(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 Pa(e,t,n){var i,a,s,u,c,l,h=0,d=!1,f=!1,p=!0;if("function"!=typeof e)throw new Ee(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),d?v(e):u}function m(e){var n=e-l;return l===r||n>=t||n<0||f&&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 f?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(f)return mr(c),c=Oo(y,t),v(l)}return c===r&&(c=Oo(y,t)),u}return t=ps(t)||0,Za(n)&&(d=!!n.leading,s=(f="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 Aa=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 Ee(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 Ee(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])?Pt(t[0],Xt(io())):Pt(fi(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)==A};function Ga(e){return null!=e&&Qa(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 $a(e){return"number"==typeof e&&e==ds(e)}function Qa(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&&Ae.call(n)==Ne}var is=yt?Xt(yt):function(e){return Ja(e)&&wi(e)==C},rs=bt?Xt(bt):function(e){return Ja(e)&&co(e)==E};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)&&Qa(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==E?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 ds(e){var t=hs(e),n=t%1;return t==t?n?t-n:t:0}function fs(e){return e?ii(ds(e),0,d):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=fe.test(e);return n||ve.test(e)?at(e.slice(2),n?2:8):de.test(e)?NaN:+e}function vs(e){return Cr(e,As(e))}function gs(e){return null==e?"":rr(e)}var ms=Or(function(e,t){if(bo(t)||Ga(t))Cr(t,Ps(t),e);else for(var n in t)Me.call(t,n)&&Qn(e,n,t[n])}),ys=Or(function(e,t){Cr(t,As(t),e)}),bs=Or(function(e,t,n,i){Cr(t,As(t),e,i)}),_s=Or(function(e,t,n,i){Cr(t,Ps(t),e,i)}),ws=Qr(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}),Cr(e,Jr(e),n),i&&(n=ri(n,7,Kr));for(var r=t.length;r--;)ar(n,t[r]);return n}),Ds=Qr(function(e,t){return null==e?{}:function(e,t){return Vi(e,t,function(t,n){return Cs(e,n)})}(e,t)});function Ns(e,t){if(null==e)return{};var n=Pt(Jr(e),function(e){return[e]});return t=io(t),Vi(e,n,function(e,n){return t(e,n[0])})}var Ls=Wr(Ps),js=Wr(As);function Fs(e){return null==e?[]:Yt(e,Ps(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=Ar("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=Ar("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(Qe)||[]}(e):function(e){return e.match(se)||[]}(e):e.match(t)||[]}var $s=Wi(function(e,t){try{return wt(e,r,t)}catch(Ro){return Ya(Ro)?Ro:new _e(Ro)}}),Qs=Qr(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 Ei(n,e,t)}}),ru=Wi(function(e,t){return function(n){return Ei(e,n,t)}});function ou(e,t,n){var i=Ps(t),r=yi(t,i);null==n&&(!Za(t)||!r.length&&i.length)&&(n=t,t=e,e=this,r=yi(t,Ps(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,At([this.value()],arguments))})}),e}function au(){}var su=Fr(Pt),uu=Fr(Ct),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(),du=Vr(!0);function fu(){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 Ee(o);return e=ds(e),function(){if(--e<1)return t.apply(this,arguments)}},Ln.ary=Ca,Ln.assign=ms,Ln.assignIn=ys,Ln.assignInWith=bs,Ln.assignWith=_s,Ln.at=ws,Ln.before=Ea,Ln.bind=Oa,Ln.bindAll=Qs,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(ds(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:ds(i))<0&&(i+=o),i=n>i?0:fs(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 Ee(o);return t=null==t?0:pn(ds(t),0),Wi(function(n){var i=n[t],r=gr(n,0,t);return i&&At(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:ds(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:ds(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 Ee(o);return Za(n)&&(i="leading"in n?!!n.leading:i,r="trailing"in n?!!n.trailing:r),Pa(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)?Pt(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 Ca(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,fr(n))},Ln.updateWith=function(e,t,n,i){return i="function"==typeof i?i:r,null==e?e:sr(e,t,fr(n),i)},Ln.values=Fs,Ln.valuesIn=function(e){return null==e?[]:Yt(e,As(e))},Ln.without=ra,Ln.words=Ks,Ln.wrap=function(e,t){return Na(fr(t),e)},Ln.xor=oa,Ln.xorBy=aa,Ln.xorWith=sa,Ln.zip=ua,Ln.zipObject=function(e,t){return hr(e||[],t||[],Qn)},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=$s,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,Ps(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(ds(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)?Ct: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),As)},Ln.forInRight=function(e,t){return null==e?e:vi(e,io(t,3),As)},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=Cs,Ln.head=Go,Ln.identity=tu,Ln.includes=function(e,t,n,i){e=Ga(e)?e:Fs(e),n=n&&!i?ds(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:ds(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)==P},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=ds(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=fu,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,ds(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=ds(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=ds(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:ds(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=d,i=vn(e,d);t=io(t),e-=d;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 d=l.index;c=c.slice(0,d===r?u:d)}}else if(e.indexOf(rr(o),u)!=u){var f=c.lastIndexOf(o);f>-1&&(c=c.slice(0,f))}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(ds(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,d),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 Ei(n,e,t)})}),Vn.prototype.reject=function(e){return this.filter(Ra(io(e)))},Vn.prototype.slice=function(e,t){e=ds(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=ds(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(d)},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,At([e],s));return i&&d?t[0]:t};l&&n&&"function"==typeof c&&1!=c.length&&(u=l=!1);var d=this.__chain__,f=!!this.__actions__.length,p=a&&!d,v=u&&!f;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,d)}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._=dn,(i=(function(){return dn}).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 d=/(^|[^\[])\^/g,f=/[^\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:C(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],d=t[2],f=d.length>1,p={type:"list",raw:h,ordered:f,start:f?+d.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]):E(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=E(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=E(this.options.mangle?t(r[1]):r[1])):n=E(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=E(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=E(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]):E(r[0]):r[0]:E(this.options.smartypants?n(r[0]):r[0]),{type:"text",raw:r[0],text:i}},e}(),P={exec:function(){}},A=function(e,t){e=e.source||e,t=t||"";var n={replace:function(t,i){return i=(i=i.source||i).replace(d,"$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:P,table:P,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=A(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=A(I.item,"gm").replace(/bull/g,I.bullet).getRegex(),I.listItemStart=A(/^( *)(bull) */).replace("bull",I.bullet).getRegex(),I.list=A(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=A(I.html,"i").replace("comment",I._comment).replace("tag",I._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),I.paragraph=A(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=A(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=A(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=A(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:A("^ *(?: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:P,paragraph:A(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:P,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:P,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~"};R.punctuation=A(R.punctuation).replace(/punctuation/g,R._punctuation).getRegex(),R.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,R.escapedEmSt=/\\\*|\\_/g,R._comment=A(I._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),R.emStrong.lDelim=A(R.emStrong.lDelim).replace(/punct/g,R._punctuation).getRegex(),R.emStrong.rDelimAst=A(R.emStrong.rDelimAst,"g").replace(/punct/g,R._punctuation).getRegex(),R.emStrong.rDelimUnd=A(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=A(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=A(R.tag).replace("comment",R._comment).replace("attribute",R._attribute).getRegex(),R._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,R._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,R._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,R.link=A(R.link).replace("label",R._label).replace("href",R._href).replace("title",R._title).getRegex(),R.reflink=A(R.reflink).replace("label",R._label).getRegex(),R.reflinkSearch=A(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:A(/^!?\[(label)\]\((.*?)\)/).replace("label",R._label).getRegex(),reflink:A(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",R._label).getRegex()}),R.gfm=M({},R.normal,{escape:A(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));)d.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 f="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(f);break}throw new Error(f)}}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(f,"").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,$=X,Q=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 $,this.slugger=new Q}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,d,f,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,d,f);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 de.options=de.setOptions=function(e){return ae(de.defaults,e),le(de.defaults),de},de.getDefaults=ce,de.defaults=he,de.use=function(){for(var e=this,t=arguments.length,n=new Array(t),i=0;iAn error occurred:

    "+ue(i.message+"",!0)+"
    ";throw i}},de.Parser=te,de.parser=te.parse,de.Renderer=ie,de.TextRenderer=re,de.Lexer=ee,de.lexer=ee.lex,de.Tokenizer=ne,de.Slugger=oe,de.parse=de,de}()},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 d(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(d,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(d,n,{subscriber:i,context:o})),this.schedule(e,t))}function d(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 f(t,r,this);if(this.destination.next(o),this.durationSelector){var a=void 0;try{a=this.durationSelector(new f(t,r))}catch(l){return void this.error(l)}this.add(a.subscribe(new d(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),d=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),f=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=f;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(f,i,s))}else this.add(o.schedule(d,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 d(e){var t=e.subscriber,n=e.windowTimeSpan,i=e.window;i&&t.closeWindow(i),e.window=t.openWindow(),this.schedule(e,n)}function f(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,d=0;d-1?h:f,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,"qs",{enumerable:!0,get:function(){return a.default}});var o=n(41151),a=(u(n(61602)),u(n(97310)));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)}function u(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==r(e)&&"function"!=typeof e)return{default:e};var n=s(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 u=o?Object.getOwnPropertyDescriptor(e,a):null;u&&(u.get||u.set)?Object.defineProperty(i,a,u):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)},51316:function(n,i,r){"use strict";var d,f,g,y,w,k,x,S,C,E,O,T=regeneratorRuntime.mark(Mj),A=regeneratorRuntime.mark(zX),R={};r.r(R),r.d(R,{decode:function(){return Sj},encode:function(){return Ej}});var D={};r.r(D),r.d(D,{decode:function(){return Ij},encode:function(){return Dj}});var N={};r.r(N),r.d(N,{decode:function(){return Nj},encode:function(){return jj}});var L={};function j(e){return"function"==typeof e}r.r(L),r.d(L,{decode:function(){return Bj},encode:function(){return zj}});var F=!1,B={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 F&&console.log("RxJS: Back to a better error behavior. Thank you. <3");F=e},get useDeprecatedSynchronousErrorHandling(){return F}};function V(e){setTimeout(function(){throw e},0)}var z={closed:!0,next:function(e){},error:function(e){if(B.useDeprecatedSynchronousErrorHandling)throw e;V(e)},complete:function(){}},U=Array.isArray||function(e){return e&&"number"==typeof e.length};function H(e){return null!==e&&"object"==typeof e}var G,W=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}(),q=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(ke(function(n,i){return ye(e(n,i)).pipe(ce(function(e,r){return t(n,e,i,r)}))},n))}:("number"==typeof t&&(n=t),function(t){return t.lift(new xe(e,n))})}var xe=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 Se(e,this.project,this.concurrent))}}]),e}(),Se=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}(_e);function Ce(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Number.POSITIVE_INFINITY;return ke(Z,e)}function Ee(e,t){return t?me(e,t):new te(de(e))}function Oe(){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 te?t[0]:Ce(i)(Ee(t,r))}function Te(){return function(e){return e.lift(new Pe(e))}}var Pe=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}(K),Me=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 q).add(this.source.subscribe(new Re(this.getSubject(),this))),e.closed&&(this._connection=null,e=q.EMPTY)),e}},{key:"refCount",value:function(){return Te()(this)}}]),n}(te),Ie=function(){var e=Me.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}}}(),Re=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}(oe);function De(e,t){return function(n){var i;if(i="function"==typeof e?e:function(){return e},"function"==typeof t)return n.lift(new Ne(i,t));var r=Object.create(n,Ie);return r.source=n,r.subjectFactory=i,r}}var Ne=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 Le(){return new ae}function je(){return function(e){return Te()(De(Le)(e))}}function Fe(e){for(var t in e)if(e[t]===Fe)return t;throw Error("Could not find renamed property on target object.")}function Be(e,t){for(var n in t)t.hasOwnProperty(n)&&!e.hasOwnProperty(n)&&(e[n]=t[n])}function Ve(e){if("string"==typeof e)return e;if(Array.isArray(e))return"["+e.map(Ve).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 ze(e,t){return null==e||""===e?null===t?"":t:null==t||""===t?e:e+" "+t}var Ue=Fe({__forward_ref__:Fe});function He(e){return e.__forward_ref__=He,e.toString=function(){return Ve(this())},e}function Ge(e){return We(e)?e():e}function We(e){return"function"==typeof e&&e.hasOwnProperty(Ue)&&e.__forward_ref__===He}var qe=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 Xe(e){return"string"==typeof e?e:null==e?"":String(e)}function Ye(e){return"function"==typeof e?e.name||e.toString():"object"==typeof e&&null!=e&&"function"==typeof e.type?e.type.name||e.type.toString():Xe(e)}function Ke(e,t){var n=t?" in ".concat(t):"";throw new qe("201","No provider for ".concat(Ye(e)," found").concat(n))}function $e(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 Ze(e){return Je(e,nt)||Je(e,rt)}function Je(e,t){return e.hasOwnProperty(t)?e[t]:null}function et(e){return e&&(e.hasOwnProperty(it)||e.hasOwnProperty(ot))?e[it]:null}var tt,nt=Fe({"\u0275prov":Fe}),it=Fe({"\u0275inj":Fe}),rt=Fe({ngInjectableDef:Fe}),ot=Fe({ngInjectorDef:Fe}),at=((at=at||{})[at.Default=0]="Default",at[at.Host=1]="Host",at[at.Self=2]="Self",at[at.SkipSelf=4]="SkipSelf",at[at.Optional=8]="Optional",at);function st(e){var t=tt;return tt=e,t}function ut(e,t,n){var i=Ze(e);return i&&"root"==i.providedIn?void 0===i.value?i.value=i.factory():i.value:n&at.Optional?null:void 0!==t?t:void Ke(Ve(e),"Injector")}function ct(e){return{toString:e}.toString()}var lt=((lt=lt||{})[lt.OnPush=0]="OnPush",lt[lt.Default=1]="Default",lt),ht=((ht=ht||{})[ht.Emulated=0]="Emulated",ht[ht.None=2]="None",ht[ht.ShadowDom=3]="ShadowDom",ht),dt="undefined"!=typeof globalThis&&globalThis,ft="undefined"!=typeof window&&window,pt="undefined"!=typeof self&&"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&self,vt="undefined"!=typeof global&&global,gt=dt||vt||ft||pt,mt={},yt=[],bt=Fe({"\u0275cmp":Fe}),_t=Fe({"\u0275dir":Fe}),wt=Fe({"\u0275pipe":Fe}),kt=Fe({"\u0275mod":Fe}),xt=Fe({"\u0275loc":Fe}),St=Fe({"\u0275fac":Fe}),Ct=Fe({__NG_ELEMENT_ID__:Fe}),Et=0;function Ot(e){return ct(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===lt.OnPush,directiveDefs:null,pipeDefs:null,selectors:e.selectors||yt,viewQuery:e.viewQuery||null,features:e.features||null,data:e.data||{},encapsulation:e.encapsulation||ht.Emulated,id:"c",styles:e.styles||yt,_:null,setInput:null,schemas:e.schemas||null,tView:null},i=e.directives,r=e.features,o=e.pipes;return n.id+=Et++,n.inputs=It(e.inputs,t),n.outputs=It(e.outputs),r&&r.forEach(function(e){return e(n)}),n.directiveDefs=i?function(){return("function"==typeof i?i():i).map(Tt)}:null,n.pipeDefs=o?function(){return("function"==typeof o?o():o).map(Pt)}:null,n})}function Tt(e){return Nt(e)||function(e){return e[_t]||null}(e)}function Pt(e){return function(e){return e[wt]||null}(e)}var At={};function Mt(e){return ct(function(){var t={type:e.type,bootstrap:e.bootstrap||yt,declarations:e.declarations||yt,imports:e.imports||yt,exports:e.exports||yt,transitiveCompileScopes:null,schemas:e.schemas||null,id:e.id||null};return null!=e.id&&(At[e.id]=e.type),t})}function It(e,t){if(null==e)return mt;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 Rt=Ot;function Dt(e){return{type:e.type,name:e.name,factory:null,pure:!1!==e.pure,onDestroy:e.type.prototype.ngOnDestroy||null}}function Nt(e){return e[bt]||null}function Lt(e,t){var n=e[kt]||null;if(!n&&!0===t)throw new Error("Type ".concat(Ve(e)," does not have '\u0275mod' property."));return n}function jt(e){return Array.isArray(e)&&"object"==typeof e[1]}function Ft(e){return Array.isArray(e)&&!0===e[1]}function Bt(e){return 0!=(8&e.flags)}function Vt(e){return 2==(2&e.flags)}function zt(e){return 1==(1&e.flags)}function Ut(e){return null!==e.template}function Ht(e){return 0!=(512&e[2])}function Gt(e,t){return e.hasOwnProperty(St)?e[St]:null}var Wt=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 qt(){return Xt}function Xt(e){return e.type.prototype.ngOnChanges&&(e.setInput=Kt),Yt}function Yt(){var e=Qt(this),t=null==e?void 0:e.current;if(t){var n=e.previous;if(n===mt)e.previous=t;else for(var i in t)n[i]=t[i];e.current=null,this.ngOnChanges(t)}}function Kt(e,t,n,i){var r=Qt(e)||function(e,t){return e[$t]=t}(e,{previous:mt,current:null}),o=r.current||(r.current={}),a=r.previous,s=this.declaredInputs[n],u=a[s];o[s]=new Wt(u&&u.currentValue,t,a===mt),e[i]=t}qt.ngInherit=!0;var $t="__ngSimpleChanges__";function Qt(e){return e[$t]||null}var Zt,Jt="http://www.w3.org/2000/svg";function en(){return void 0!==Zt?Zt:"undefined"!=typeof document?document:void 0}function tn(e){return!!e.listen}var nn={createRenderer:function(e,t){return en()}};function rn(e){for(;Array.isArray(e);)e=e[0];return e}function on(e,t){return rn(t[e])}function an(e,t){return rn(t[e.index])}function sn(e,t){return e.data[t]}function un(e,t){return e[t]}function cn(e,t){var n=t[e];return jt(n)?n:n[0]}function ln(e){return 4==(4&e[2])}function hn(e){return 128==(128&e[2])}function dn(e,t){return null==t?null:e[t]}function fn(e){e[18]=0}function pn(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 vn={lFrame:Vn(null),bindingsEnabled:!0,isInCheckNoChangesMode:!1};function gn(){return vn.bindingsEnabled}function mn(){return vn.lFrame.lView}function yn(){return vn.lFrame.tView}function bn(e){return vn.lFrame.contextLView=e,e[8]}function _n(){for(var e=wn();null!==e&&64===e.type;)e=e.parent;return e}function wn(){return vn.lFrame.currentTNode}function kn(e,t){var n=vn.lFrame;n.currentTNode=e,n.isParent=t}function xn(){return vn.lFrame.isParent}function Sn(){vn.lFrame.isParent=!1}function Cn(){return vn.isInCheckNoChangesMode}function En(e){vn.isInCheckNoChangesMode=e}function On(){var e=vn.lFrame,t=e.bindingRootIndex;return-1===t&&(t=e.bindingRootIndex=e.tView.bindingStartIndex),t}function Tn(){return vn.lFrame.bindingIndex}function Pn(){return vn.lFrame.bindingIndex++}function An(e){var t=vn.lFrame,n=t.bindingIndex;return t.bindingIndex=t.bindingIndex+e,n}function Mn(e,t){var n=vn.lFrame;n.bindingIndex=n.bindingRootIndex=e,In(t)}function In(e){vn.lFrame.currentDirectiveIndex=e}function Rn(e){var t=vn.lFrame.currentDirectiveIndex;return-1===t?null:e[t]}function Dn(){return vn.lFrame.currentQueryIndex}function Nn(e){vn.lFrame.currentQueryIndex=e}function Ln(e){var t=e[1];return 2===t.type?t.declTNode:1===t.type?e[6]:null}function jn(e,t,n){if(n&at.SkipSelf){for(var i=t,r=e;!(null!==(i=i.parent)||n&at.Host||(i=Ln(r),null===i||(r=r[15],10&i.type))););if(null===i)return!1;t=i,e=r}var o=vn.lFrame=Bn();return o.currentTNode=t,o.lView=e,!0}function Fn(e){var t=Bn(),n=e[1];vn.lFrame=t,t.currentTNode=n.firstChild,t.lView=e,t.tView=n,t.contextLView=e,t.bindingIndex=n.bindingStartIndex,t.inI18n=!1}function Bn(){var e=vn.lFrame,t=null===e?null:e.child;return null===t?Vn(e):t}function Vn(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 zn(){var e=vn.lFrame;return vn.lFrame=e.parent,e.currentTNode=null,e.lView=null,e}var Un=zn;function Hn(){var e=zn();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 Gn(){return vn.lFrame.selectedIndex}function Wn(e){vn.lFrame.selectedIndex=e}function qn(){var e=vn.lFrame;return sn(e.tView,e.selectedIndex)}function Xn(){vn.lFrame.currentNamespace=Jt}function Yn(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 ei=function e(t,n,i){m(this,e),this.factory=t,this.resolving=!1,this.canSeeViewProviders=n,this.injectImpl=i};function ti(e,t,n){for(var i=tn(e),r=0;rt){a=o-1;break}}}for(;o>16}(e),i=t;n>0;)i=i[15],n--;return i}var ci=!0;function li(e){var t=ci;return ci=e,t}var hi=0;function di(e,t){var n=pi(e,t);if(-1!==n)return n;var i=t[1];i.firstCreatePass&&(e.injectorIndex=t.length,fi(i.data,e),fi(t,null),fi(i.blueprint,null));var r=vi(e,t),o=e.injectorIndex;if(ai(r))for(var a=si(r),s=ui(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 fi(e,t){e.push(0,0,0,0,0,0,0,0,t)}function pi(e,t){return-1===e.injectorIndex||e.parent&&e.parent.injectorIndex===e.injectorIndex||null===t[e.injectorIndex+8]?-1:e.injectorIndex}function vi(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 gi(e,t,n){!function(e,t,n){var i;"string"==typeof n?i=n.charCodeAt(0)||0:n.hasOwnProperty(Ct)&&(i=n[Ct]),null==i&&(i=n[Ct]=hi++);var r=255&i;t.data[e+(r>>5)]|=1<3&&void 0!==arguments[3]?arguments[3]:at.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(Ct)?e[Ct]:void 0;return"number"==typeof t?t>=0?255&t:wi:t}(n);if("function"==typeof o){if(!jn(t,e,i))return i&at.Host?mi(r,n,i):yi(t,n,i,r);try{var a=o(i);if(null!=a||i&at.Optional)return a;Ke(n)}finally{Un()}}else if("number"==typeof o){var s=null,u=pi(e,t),c=-1,l=i&at.Host?t[16][6]:null;for((-1===u||i&at.SkipSelf)&&(-1!==(c=-1===u?vi(e,t):t[u+8])&&Ei(i,!1)?(s=t[1],u=si(c),t=ui(c,t)):u=-1);-1!==u;){var h=t[1];if(Ci(o,u,h.data)){var d=ki(u,t,n,s,i,l);if(d!==_i)return d}-1!==(c=t[u+8])&&Ei(i,t[1].data[u+8]===l)&&Ci(o,u,t)?(s=h,u=si(c),t=ui(c,t)):u=-1}}}return yi(t,n,i,r)}var _i={};function wi(){return new Oi(_n(),mn())}function ki(e,t,n,i,r,o){var a=t[1],s=a.data[e+8],u=xi(s,a,n,null==i?Vt(s)&&ci:i!=a&&0!=(3&s.type),r&at.Host&&o===s);return null!==u?Si(t,a,u,s):_i}function xi(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&&d.type===n)return h}if(r){var f=a[u];if(f&&Ut(f)&&f.type===n)return u}return null}function Si(e,t,n,i){var r=e[n],o=t.data;if(function(e){return e instanceof ei}(r)){var a=r;a.resolving&&function(e,t){throw new qe("200","Circular dependency in DI detected for ".concat(e))}(Ye(o[n]));var s=li(a.canSeeViewProviders);a.resolving=!0;var u=a.injectImpl?st(a.injectImpl):null;jn(e,i,at.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=Xt(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&&st(u),li(s),a.resolving=!1,Un()}}return r}function Ci(e,t,n){return!!(n[t+(e>>5)]&1<=e.length?e.push(n):e.splice(t,0,n)}function Fi(e,t){return t>=e.length-1?e.pop():e.splice(t,1)[0]}function Bi(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 zi(e,t){var n=Ui(e,t);if(n>=0)return e[1|n]}function Ui(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 Hi,Gi={},Wi="__NG_DI_FLAG__",qi="ngTempTokenPath",Xi=/\n/gm,Yi="__source",Ki=Fe({provide:String,useValue:Fe});function $i(e){var t=Hi;return Hi=e,t}function Qi(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:at.Default;if(void 0===Hi)throw new Error("inject() must be called from an injection context");return null===Hi?ut(e,void 0,t):Hi.get(e,t&at.Optional?null:void 0,t)}function Zi(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:at.Default;return(tt||Qi)(Ge(e),t)}var Ji=Zi;function er(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=Ve(t);if(Array.isArray(t))r=t.map(Ve).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):Ve(s)))}r="{".concat(o.join(", "),"}")}return"".concat(n).concat(i?"("+i+")":"","[").concat(r,"]: ").concat(e.replace(Xi,"\n "))}("\n"+e.message,r,n,i),e.ngTokenPath=r,e[qi]=null,e}var rr,or,ar=tr(Ii("Inject",function(e){return{token:e}}),-1),sr=tr(Ii("Optional"),8),ur=tr(Ii("SkipSelf"),4);function cr(e){var t;return(null===(t=function(){if(void 0===rr&&(rr=null,gt.trustedTypes))try{rr=gt.trustedTypes.createPolicy("angular",{createHTML:function(e){return e},createScript:function(e){return e},createScriptURL:function(e){return e}})}catch(e){}return rr}())||void 0===t?void 0:t.createHTML(e))||e}function lr(){if(void 0===or&&(or=null,gt.trustedTypes))try{or=gt.trustedTypes.createPolicy("angular#unsafe-bypass",{createHTML:function(e){return e},createScript:function(e){return e},createScriptURL:function(e){return e}})}catch(G){}return or}function hr(e){var t;return(null===(t=lr())||void 0===t?void 0:t.createHTML(e))||e}function dr(e){var t;return(null===(t=lr())||void 0===t?void 0:t.createScriptURL(e))||e}var fr=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}(),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"HTML"}}]),n}(fr),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"Style"}}]),n}(fr),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"Script"}}]),n}(fr),mr=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}(fr),yr=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}(fr);function br(e){return e instanceof fr?e.changingThisBreaksApplicationSecurity:e}function _r(e,t){var n=wr(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 wr(e){return e instanceof fr&&e.getTypeName()||null}var kr=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(cr(e),"text/html").body;return null===t?this.inertDocumentHelper.getInertBodyElement(e):(t.removeChild(t.firstChild),t)}catch(t){return null}}}]),e}(),xr=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=cr(e),t;var n=this.inertDocument.createElement("body");return n.innerHTML=cr(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();Dr.hasOwnProperty(t)&&!Mr.hasOwnProperty(t)&&(this.buf.push(""))}},{key:"chars",value:function(e){this.buf.push(Ur(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}(),Vr=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,zr=/([^\#-~ |!])/g;function Ur(e){return e.replace(/&/g,"&").replace(Vr,function(e){return"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";"}).replace(zr,function(e){return"&#"+e.charCodeAt(0)+";"}).replace(//g,">")}function Hr(e,t){var n=null;try{Ar=Ar||function(e){var t=new xr(e);return function(){try{return!!(new window.DOMParser).parseFromString(cr(""),"text/html")}catch(e){return!1}}()?new kr(t):t}(e);var i=t?String(t):"";n=Ar.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=Ar.getInertBodyElement(i)}while(i!==o);return cr((new Br).sanitizeChildren(Gr(n)||n))}finally{if(n)for(var a=Gr(n)||n;a.firstChild;)a.removeChild(a.firstChild)}}function Gr(e){return"content"in e&&function(e){return e.nodeType===Node.ELEMENT_NODE&&"TEMPLATE"===e.nodeName}(e)?e.content:null}var Wr=((Wr=Wr||{})[Wr.NONE=0]="NONE",Wr[Wr.HTML=1]="HTML",Wr[Wr.STYLE=2]="STYLE",Wr[Wr.SCRIPT=3]="SCRIPT",Wr[Wr.URL=4]="URL",Wr[Wr.RESOURCE_URL=5]="RESOURCE_URL",Wr);function qr(e){var t=Kr();return t?hr(t.sanitize(Wr.HTML,e)||""):_r(e,"HTML")?hr(br(e)):Hr(en(),Xe(e))}function Xr(e){var t=Kr();return t?t.sanitize(Wr.URL,e)||"":_r(e,"URL")?br(e):Er(Xe(e))}function Yr(e){var t=Kr();if(t)return dr(t.sanitize(Wr.RESOURCE_URL,e)||"");if(_r(e,"ResourceURL"))return dr(br(e));throw new Error("unsafe value used in a resource URL context (see https://g.co/ng/security#xss)")}function Kr(){var e=mn();return e&&e[12]}var $r="__ngContext__";function Qr(e,t){e[$r]=t}function Zr(e){var t=function(e){return e[$r]||null}(e);return t?Array.isArray(t)?t:t.lView:null}function Jr(e){return e.ngOriginalError}function eo(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=Fi(e,10+t);!function(e,t){Mo(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 mo(e,t){if(!(256&t[2])){var n=t[11];tn(n)&&n.destroyNode&&Mo(e,t,n,3,null,null),function(e){var t=e[13];if(!t)return yo(e[1],e);for(;t;){var n=null;if(jt(t))n=t[13];else{var i=t[10];i&&(n=i)}if(!n){for(;t&&!t[4]&&t!==e;)jt(t)&&yo(t[1],t),t=t[3];null===t&&(t=e),jt(t)&&yo(t[1],t),n=t&&t[4]}t=n}}(t)}}function yo(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 d=8&i?h:null;if(d&&-1!==No(d,c,0)||2&i&&c!==h){if(zo(i))return!1;a=!0}}}}else{if(!a&&!zo(i)&&!zo(u))return!1;if(a&&zo(u))continue;a=!1,i=u|1&i}}return zo(i)||a}function zo(e){return 0==(1&e)}function Uo(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&&!zo(a)&&(t+=Wo(o,r),r=""),i=a,o=o||!zo(i);n++}return""!==r&&(t+=Wo(o,r)),t}var Xo={};function Yo(e){Ko(yn(),mn(),Gn()+e,Cn())}function Ko(e,t,n,i){if(!i)if(3==(3&t[2])){var r=e.preOrderCheckHooks;null!==r&&Kn(t,r,n)}else{var o=e.preOrderHooks;null!==o&&$n(t,o,0,n)}Wn(n)}function $o(e,t){return e<<17|t<<2}function Qo(e){return e>>17&32767}function Zo(e){return 2|e}function Jo(e){return(131068&e)>>2}function ea(e,t){return-131069&e|t<<2}function ta(e){return 1|e}function na(e,t){var n=e.contentQueries;if(null!==n)for(var i=0;i20&&Ko(e,t,20,Cn()),n(i,r)}finally{Wn(o)}}function la(e,t,n){if(Bt(t))for(var i=t.directiveEnd,r=t.directiveStart;r2&&void 0!==arguments[2]?arguments[2]:an,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 _a(e,t){null!==e.hostBindings&&e.hostBindings(1,t)}function wa(e,t){t.flags|=2,(e.components||(e.components=[])).push(t.index)}function ka(e,t,n){if(n){if(t.exportAs)for(var i=0;i0&&Ma(n)}}function Ma(e){for(var t=co(e);null!==t;t=lo(t))for(var n=10;n0&&Ma(i)}var o=e[1].components;if(null!==o)for(var a=0;a0&&Ma(s)}}function Ia(e,t){var n=cn(t,e),i=n[1];(function(e,t){for(var n=t.length;n1&&void 0!==arguments[1]?arguments[1]:Gi;if(t===Gi){var n=new Error("NullInjectorError: No provider for ".concat(Ve(e),"!"));throw n.name="NullInjectorError",n}return t}}]),e}(),Ka=new Ri("Set Injector scope."),$a={},Qa={};function Za(){return void 0===qa&&(qa=new Ya),qa}function Ja(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 es(e,n,t||Za(),i)}var es=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&&Li(n,function(e){return r.processProvider(e,t,n)}),Li([t],function(e){return r.processInjectorType(e,[],a)}),this.records.set(Xa,is(void 0,this));var s=this.records.get(Ka);this.scope=null!=s?s.value:null,this.source=o||("object"==typeof t?null:Ve(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]:Gi,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:at.Default;this.assertNotDestroyed();var i=$i(this),r=st(void 0);try{if(!(n&at.SkipSelf)){var o=this.records.get(e);if(void 0===o){var a=function(e){return"function"==typeof e||"object"==typeof e&&e instanceof Ri}(e)&&Ze(e);o=a&&this.injectableDefInScope(a)?is(ts(e),$a):null,this.records.set(e,o)}if(null!=o)return this.hydrate(e,o)}return(n&at.Self?Za():this.parent).get(e,t=n&at.Optional&&t===Gi?null:t)}catch(s){if("NullInjectorError"===s.name){if((s[qi]=s[qi]||[]).unshift(Ve(e)),i)throw s;return ir(s,e,"R3InjectorError",this.source)}throw s}finally{st(r),$i(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(Ve(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=Ge(e)))return!1;var r=et(e),o=null==r&&e.ngModule||void 0,a=void 0===o?e:o,s=-1!==n.indexOf(a);if(void 0!==o&&(r=et(o)),null==r)return!1;if(null!=r.imports&&!s){var u;n.push(a);try{Li(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;Li(r,function(e){return i.processProvider(e,n,r||yt)})},l=0;l0){var n=Bi(t,"?");throw new Error("Can't resolve all parameters for ".concat(Ve(e),": (").concat(n.join(", "),")."))}var i=function(e){var t=e&&(e[nt]||e[rt]);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 ns(e,t,n){var i;if(os(e)){var r=Ge(e);return Gt(r)||ts(r)}if(rs(e))i=function(){return Ge(e.useValue)};else if(function(e){return!(!e||!e.useFactory)}(e))i=function(){return e.useFactory.apply(e,v(er(e.deps||[])))};else if(function(e){return!(!e||!e.useExisting)}(e))i=function(){return Zi(Ge(e.useExisting))};else{var o=Ge(e&&(e.useClass||e.provide));if(!function(e){return!!e.deps}(e))return Gt(o)||ts(o);i=function(){return h(o,v(er(e.deps)))}}return i}function is(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return{factory:e,value:t,multi:n?[]:void 0}}function rs(e){return null!==e&&"object"==typeof e&&Ki in e}function os(e){return"function"==typeof e}var as=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=Ja(e,t,n,i);return r._resolveInjectorDefTypes(),r}({name:n},t,e,n)},ss=function(){function e(){m(this,e)}return b(e,null,[{key:"create",value:function(e,t){return Array.isArray(e)?as(e,t,""):as(e.providers,e.parent,e.name||"")}}]),e}();function us(e,t){Yn(Zr(e)[1],_n())}function cs(e){for(var t=function(e){return Object.getPrototypeOf(e.prototype).constructor}(e.type),n=!0,i=[e];t;){var r=void 0;if(Ut(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=ls(e.inputs),o.declaredInputs=ls(e.declaredInputs),o.outputs=ls(e.outputs);var a=r.hostBindings;a&&fs(e,a);var s=r.viewQuery,u=r.contentQueries;if(s&&hs(e,s),u&&ds(e,u),Be(e.inputs,r.inputs),Be(e.declaredInputs,r.declaredInputs),Be(e.outputs,r.outputs),Ut(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=ri(r.hostAttrs,n=ri(n,r.hostAttrs))}}(i)}function ls(e){return e===mt?{}:e===yt?[]:e}function hs(e,t){var n=e.viewQuery;e.viewQuery=n?function(e,i){t(e,i),n(e,i)}:t}function ds(e,t){var n=e.contentQueries;e.contentQueries=n?function(e,i,r){t(e,i,r),n(e,i,r)}:t}function fs(e,t){var n=e.hostBindings;e.hostBindings=n?function(e,i){t(e,i),n(e,i)}:t}ss.THROW_IF_NOT_FOUND=Gi,ss.NULL=new Ya,ss.\u0275prov=$e({token:ss,providedIn:"any",factory:function(){return Zi(Xa)}}),ss.__NG_ELEMENT_ID__=-1;var ps=null;function vs(){if(!ps){var e=gt.Symbol;if(e&&e.iterator)ps=e.iterator;else for(var t=Object.getOwnPropertyNames(Map.prototype),n=0;n1&&void 0!==arguments[1]?arguments[1]:at.Default,n=mn();return null===n?Zi(e,t):bi(_n(),n,Ge(e),t)}function Ts(e,t,n){var i=mn();return _s(i,Pn(),t)&&ma(yn(),qn(),i,e,t,i[11],n,!1),Ts}function Ps(e,t,n,i,r){var o=r?"class":"style";Ha(e,n,t.inputs[o],o,i)}function As(e,t,n,i){var r=mn(),o=yn(),a=20+e,s=r[11],u=r[a]=po(s,t,vn.lFrame.currentNamespace),c=o.firstCreatePass?function(e,t,n,i,r,o,a){var s=t.consts,u=ra(t,e,2,r,dn(s,o));return ya(t,n,u,dn(s,a)),null!==u.attrs&&Wa(u,u.attrs,!1),null!==u.mergedAttrs&&Wa(u,u.mergedAttrs,!0),null!==t.queries&&t.queries.elementStart(t,u),u}(a,o,r,0,t,n,i):o.data[a];kn(c,!0);var l=c.mergedAttrs;null!==l&&ti(s,u,l);var h=c.classes;null!==h&&Do(s,u,h);var d=c.styles;null!==d&&Ro(s,u,d),64!=(64&c.flags)&&Eo(o,r,u,c),0===vn.lFrame.elementDepthCount&&Qr(u,r),vn.lFrame.elementDepthCount++,zt(c)&&(ha(o,r,c),la(o,c,r)),null!==i&&da(r,c)}function Ms(){var e=_n();xn()?Sn():kn(e=e.parent,!1);var t=e;vn.lFrame.elementDepthCount--;var n=yn();n.firstCreatePass&&(Yn(n,e),Bt(e)&&n.queries.elementEnd(e)),null!=t.classesWithoutHost&&function(e){return 0!=(16&e.flags)}(t)&&Ps(n,t,mn(),t.classesWithoutHost,!0),null!=t.stylesWithoutHost&&function(e){return 0!=(32&e.flags)}(t)&&Ps(n,t,mn(),t.stylesWithoutHost,!1)}function Is(e,t,n,i){As(e,t,n,i),Ms()}function Rs(e,t,n){var i=mn(),r=yn(),o=e+20,a=r.firstCreatePass?function(e,t,n,i,r){var o=t.consts,a=dn(o,i),s=ra(t,e,8,"ng-container",a);return null!==a&&Wa(s,a,!0),ya(t,n,s,dn(o,r)),null!==t.queries&&t.queries.elementStart(t,s),s}(o,r,i,t,n):r.data[o];kn(a,!0);var s=i[o]=i[11].createComment("");Eo(r,i,s,a),Qr(s,i),zt(a)&&(ha(r,i,a),la(r,a,i)),null!=n&&da(i,a)}function Ds(){var e=_n(),t=yn();xn()?Sn():kn(e=e.parent,!1),t.firstCreatePass&&(Yn(t,e),Bt(e)&&t.queries.elementEnd(e))}function Ns(e,t,n){Rs(e,t,n),Ds()}function Ls(){return mn()}function js(e){return!!e&&"function"==typeof e.then}function Fs(e){return!!e&&"function"==typeof e.subscribe}var Bs=Fs;function Vs(e,t,n,i){var r=mn(),o=yn(),a=_n();return Us(o,r,r[11],a,e,t,!!n,i),Vs}function zs(e,t){var n=_n(),i=mn(),r=yn();return Us(r,i,za(Rn(r.data),n,i),n,e,t,!1),zs}function Us(e,t,n,i,r,o,a,s){var u=zt(i),c=e.firstCreatePass&&Va(e),l=t[8],h=Ba(t),d=!0;if(3&i.type||s){var f=an(i,t),p=s?s(f):f,v=h.length,g=s?function(e){return s(rn(e[i.index]))}:i.index;if(tn(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,d=!1;else{o=Gs(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=Gs(i,t,l,o,!0),p.addEventListener(r,o,a),h.push(o),c&&c.push(r,g,v,a)}else o=Gs(i,t,l,o,!1);var b,_=i.outputs;if(d&&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(vn.lFrame.contextLView=function(e,t){for(;e>0;)t=t[15],e--;return t}(e,vn.lFrame.contextLView))[8]}(e)}function qs(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=mn(),r=yn(),o=ra(r,20+e,16,null,n||null);null===o.projection&&(o.projection=t),Sn(),64!=(64&o.flags)&&function(e,t,n){Io(t[11],0,t,n,bo(e,n,t),So(n.parent||t[6],n,t))}(r,i,o)}function Ks(e,t,n){return $s(e,"",t,"",n),Ks}function $s(e,t,n,i,r){var o=mn(),a=xs(o,t,n,i);return a!==Xo&&ma(yn(),qn(),o,e,a,o[11],r,!1),$s}function Qs(e,t,n,i,r){for(var o=e[n+1],a=null===t,s=i?Qo(o):Jo(o),u=!1;0!==s&&(!1===u||a);){var c=e[s+1];Zs(e[s],t)&&(u=!0,e[s+1]=i?ta(c):Zo(c)),s=i?Qo(c):Jo(c)}u&&(e[n+1]=i?Zo(o):ta(o))}function Zs(e,t){return null===e||null==t||(Array.isArray(e)?e[1]:e)===t||!(!Array.isArray(e)||"string"!=typeof t)&&Ui(e,t)>=0}var Js={textEnd:0,key:0,keyEnd:0,value:0,valueEnd:0};function eu(e){return e.substring(Js.key,Js.keyEnd)}function tu(e){return e.substring(Js.value,Js.valueEnd)}function nu(e,t){var n=Js.textEnd;return n===t?-1:(t=Js.keyEnd=function(e,t,n){for(;t32;)t++;return t}(e,Js.key=t,n),ou(e,t,n))}function iu(e,t){var n=Js.textEnd,i=Js.key=ou(e,t,n);return n===i?-1:(i=Js.keyEnd=function(e,t,n){for(var i;t=65&&(-33&i)<=90||i>=48&&i<=57);)t++;return t}(e,i,n),i=au(e,i,n),i=Js.value=ou(e,i,n),i=Js.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),au(e,i,n))}function ru(e){Js.key=0,Js.keyEnd=0,Js.value=0,Js.valueEnd=0,Js.textEnd=e.length}function ou(e,t,n){for(;t=0;n=iu(t,n))_u(e,eu(t),tu(t))}function du(e){vu(Vi,fu,e,!0)}function fu(e,t){for(var n=function(e){return ru(e),nu(e,ou(e,0,Js.textEnd))}(t);n>=0;n=nu(t,n))Vi(e,eu(t),!0)}function pu(e,t,n,i){var r=mn(),o=yn(),a=An(2);o.firstUpdatePass&&mu(o,e,a,i),t!==Xo&&_s(r,a,t)&&wu(o,o.data[Gn()],r,r[11],e,r[a+1]=function(e,t){return null==e||("string"==typeof t?e+=t:"object"==typeof e&&(e=Ve(br(e)))),e}(t,n),i,a)}function vu(e,t,n,i){var r=yn(),o=An(2);r.firstUpdatePass&&mu(r,null,o,i);var a=mn();if(n!==Xo&&_s(a,o,n)){var s=r.data[Gn()];if(Su(s,i)&&!gu(r,o)){var u=i?s.classesWithoutHost:s.stylesWithoutHost;null!==u&&(n=ze(u,n||"")),Ps(r,s,a,n,i)}else!function(e,t,n,i,r,o,a,s){r===Xo&&(r=yt);for(var u=0,c=0,l=0=e.expandoStartIndex}function mu(e,t,n,i){var r=e.data;if(null===r[n+1]){var o=r[Gn()],a=gu(e,n);Su(o,i)&&null===t&&!a&&(t=!1),t=function(e,t,n,i){var r=Rn(e),o=i?t.residualClasses:t.residualStyles;if(null===r)0===(i?t.classBindings:t.styleBindings)&&(n=bu(n=yu(null,e,t,n,i),t.attrs,i),o=null);else{var a=t.directiveStylingLast;if(-1===a||e[a]!==r)if(n=yu(r,e,t,n,i),null===o){var s=function(e,t,n){var i=n?t.classBindings:t.styleBindings;if(0!==Jo(i))return e[Qo(i)]}(e,t,i);void 0!==s&&Array.isArray(s)&&function(e,t,n,i){e[Qo(n?t.classBindings:t.styleBindings)]=i}(e,t,i,s=bu(s=yu(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 d=Qo(e[s+1]);e[i+1]=$o(d,s),0!==d&&(e[d+1]=ea(e[d+1],i)),e[s+1]=function(e,t){return 131071&e|t<<17}(e[s+1],i)}else e[i+1]=$o(s,0),0!==s&&(e[s+1]=ea(e[s+1],i)),s=i;else e[i+1]=$o(u,0),0===s?s=i:e[u+1]=ea(e[u+1],i),u=i;l&&(e[i+1]=Zo(e[i+1])),Qs(e,c,i,!0),Qs(e,c,i,!1),function(e,t,n,i,r){var o=r?e.residualClasses:e.residualStyles;null!=o&&"string"==typeof t&&Ui(o,t)>=0&&(n[i+1]=ta(n[i+1]))}(t,c,e,i,o),a=$o(s,u),o?t.classBindings=a:t.styleBindings=a}(r,o,t,n,a,i)}}function yu(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,d=n[r+1];d===Xo&&(d=h?yt:void 0);var f=h?zi(d,i):l===i?d:void 0;if(c&&!xu(f)&&(f=zi(u,i)),xu(f)&&(a=f,s))return a;var p=e[r+1];r=s?Qo(p):Jo(p)}if(null!==t){var v=o?t.residualClasses:t.residualStyles;null!=v&&(a=zi(v,i))}return a}function xu(e){return void 0!==e}function Su(e,t){return 0!=(e.flags&(t?16:32))}function Cu(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=mn(),i=yn(),r=e+20,o=i.firstCreatePass?ra(i,r,1,t,null):i.data[r],a=n[r]=function(e,t){return tn(e)?e.createText(t):e.createTextNode(t)}(n[11],t);Eo(i,n,a,o),kn(o,!1)}function Eu(e){return Ou("",e,""),Eu}function Ou(e,t,n){var i=mn(),r=xs(i,e,t,n);return r!==Xo&&Ga(i,Gn(),r),Ou}function Tu(e,t,n,i,r){var o=mn(),a=function(e,t,n,i,r,o){var a=ws(e,Tn(),n,r);return An(2),a?t+Xe(n)+i+Xe(r)+o:Xo}(o,e,t,n,i,r);return a!==Xo&&Ga(o,Gn(),a),Tu}function Pu(e,t,n){vu(Vi,fu,xs(mn(),e,t,n),!0)}function Au(e,t,n){var i=mn();return _s(i,Pn(),t)&&ma(yn(),qn(),i,e,t,i[11],n,!0),Au}function Mu(e,t,n){var i=mn();if(_s(i,Pn(),t)){var r=yn(),o=qn();ma(r,o,i,e,t,za(Rn(r.data),o,i),n,!0)}return Mu}var Iu=void 0,Ru=["en",[["a","p"],["AM","PM"],Iu],[["AM","PM"],Iu,Iu],[["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"]],Iu,[["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"]],Iu,[["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}",Iu,"{1} 'at' {0}",Iu],[".",",",";","%","+","-","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}],Du={};function Nu(e){var t=function(e){return e.toLowerCase().replace(/_/g,"-")}(e),n=Lu(t);if(n)return n;var i=t.split("-")[0];if(n=Lu(i))return n;if("en"===i)return Ru;throw new Error('Missing locale data for the locale "'.concat(e,'".'))}function Lu(e){return e in Du||(Du[e]=gt.ng&>.ng.common&>.ng.common.locales&>.ng.common.locales[e]),Du[e]}var ju=((ju=ju||{})[ju.LocaleId=0]="LocaleId",ju[ju.DayPeriodsFormat=1]="DayPeriodsFormat",ju[ju.DayPeriodsStandalone=2]="DayPeriodsStandalone",ju[ju.DaysFormat=3]="DaysFormat",ju[ju.DaysStandalone=4]="DaysStandalone",ju[ju.MonthsFormat=5]="MonthsFormat",ju[ju.MonthsStandalone=6]="MonthsStandalone",ju[ju.Eras=7]="Eras",ju[ju.FirstDayOfWeek=8]="FirstDayOfWeek",ju[ju.WeekendRange=9]="WeekendRange",ju[ju.DateFormat=10]="DateFormat",ju[ju.TimeFormat=11]="TimeFormat",ju[ju.DateTimeFormat=12]="DateTimeFormat",ju[ju.NumberSymbols=13]="NumberSymbols",ju[ju.NumberFormats=14]="NumberFormats",ju[ju.CurrencyCode=15]="CurrencyCode",ju[ju.CurrencySymbol=16]="CurrencySymbol",ju[ju.CurrencyName=17]="CurrencyName",ju[ju.Currencies=18]="Currencies",ju[ju.Directionality=19]="Directionality",ju[ju.PluralCase=20]="PluralCase",ju[ju.ExtraData=21]="ExtraData",ju),Fu="en-US";function Bu(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 Vu(e,t,n,i,r){if(e=Ge(e),Array.isArray(e))for(var o=0;o>20;if(os(e)||!e.multi){var p=new ei(c,r,Os),v=Hu(u,t,r?h:h+f,d);-1===v?(gi(di(l,s),a,u),zu(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=Hu(u,t,h+f,d),m=Hu(u,t,h,h+f),y=g>=0&&n[g],b=m>=0&&n[m];if(r&&!b||!r&&!y){gi(di(l,s),a,u);var _=function(e,t,n,i,r){var o=new ei(e,n,Os);return o.multi=[],o.index=t,o.componentProviders=0,Uu(o,r,i&&!n),o}(r?Wu:Gu,n.length,r,i,c);!r&&b&&(n[m].providerFactory=_),zu(a,e,t.length,0),t.push(u),l.directiveStart++,l.directiveEnd++,r&&(l.providerIndexes+=1048576),n.push(_),s.push(_)}else zu(a,e,g>-1?g:m,Uu(n[r?m:g],c,!r&&i));!r&&i&&b&&n[m].componentProviders++}}}function zu(e,t,n,i){var r=os(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 Uu(e,t,n){return n&&e.componentProviders++,e.multi.push(t)-1}function Hu(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=yn();if(i.firstCreatePass){var r=Ut(e);Vu(n,i.data,i.blueprint,r,!0),Vu(t,i.data,i.blueprint,r,!1)}}(n,i?i(e):e,t)}}}var Yu=function e(){m(this,e)},Ku=function e(){m(this,e)};function $u(){}function Qu(e,t){return new Ju(an(e,t))}Ku.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(Ve(e),". Did you add it to @NgModule.entryComponents?"));return t.ngComponent=e,t}(e)}}]),e}());var Zu=function(){return Qu(_n(),mn())},Ju=function(){var e=function e(t){m(this,e),this.nativeElement=t};return e.__NG_ELEMENT_ID__=Zu,e}();function ec(e){return e instanceof Ju?e.nativeElement:e}var tc=function e(){m(this,e)},nc=function(){var e=function e(){m(this,e)};return e.__NG_ELEMENT_ID__=function(){return ic()},e}(),ic=function(){var e=mn(),t=cn(_n().index,e);return function(e){return e[11]}(jt(t)?t:e)},rc=function(){var e=function e(){m(this,e)};return e.\u0275prov=$e({token:e,providedIn:"root",factory:function(){return null}}),e}(),oc=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(".")},ac=new oc("12.2.5"),sc=function(){function e(){m(this,e)}return b(e,[{key:"supports",value:function(e){return ms(e)}},{key:"create",value:function(e){return new cc(e)}}]),e}(),uc=function(e,t){return t},cc=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||uc}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(rn(o)),Ft(o))for(var a=10;a-1&&(go(e,n),Fi(t,n))}this._attachedToViewContainer=!1}mo(this._lView[1],this._lView)}},{key:"onDestroy",value:function(e){va(this._lView[1],this._lView,null,e)}},{key:"markForCheck",value:function(){Da(this._cdRefInjectingView||this._lView)}},{key:"detach",value:function(){this._lView[2]&=-129}},{key:"reattach",value:function(){this._lView[2]|=128}},{key:"detectChanges",value:function(){Na(this._lView[1],this._lView,this.context)}},{key:"checkNoChanges",value:function(){!function(e,t,n){En(!0);try{Na(e,t,n)}finally{En(!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){Mo(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}(),xc=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(){La(this._view)}},{key:"checkNoChanges",value:function(){!function(e){En(!0);try{La(e)}finally{En(!1)}}(this._view)}},{key:"context",get:function(){return null}}]),n}(kc),Sc=function(e){return function(e,t,n){if(Vt(e)&&!n){var i=cn(e.index,t);return new kc(i,i)}return 47&e.type?new kc(t[16],t):null}(_n(),mn(),16==(16&e))},Cc=function(){var e=function e(){m(this,e)};return e.__NG_ELEMENT_ID__=Sc,e}(),Ec=[new pc],Oc=new yc([new sc]),Tc=new _c(Ec),Pc=function(){return Ic(_n(),mn())},Ac=function(){var e=function e(){m(this,e)};return e.__NG_ELEMENT_ID__=Pc,e}(),Mc=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=ia(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)),aa(t,n,e),new kc(n)}}]),n}(Ac);function Ic(e,t){return 4&e.type?new Mc(t,e,Qu(e,t)):null}var Rc=function e(){m(this,e)},Dc=function(){return Bc(_n(),mn())},Nc=function(){var e=function e(){m(this,e)};return e.__NG_ELEMENT_ID__=Dc,e}(),Lc=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 Qu(this._hostTNode,this._hostLView)}},{key:"injector",get:function(){return new Oi(this._hostTNode,this._hostLView)}},{key:"parentInjector",get:function(){var e=vi(this._hostTNode,this._hostLView);if(ai(e)){var t=ui(e,this._hostLView),n=si(e);return new Oi(t[1].data[n+8],t)}return new Oi(null,this._hostLView)}},{key:"clear",value:function(){for(;this.length>0;)this.remove(this.length-1)}},{key:"get",value:function(e){var t=jc(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(Rc,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 Ft(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}(Nc);function jc(e){return e[8]}function Fc(e){return e[8]||(e[8]=[])}function Bc(e,t){var n,i=t[e.index];if(Ft(i))n=i;else{var r;if(8&e.type)r=rn(i);else{var o=t[11];r=o.createComment("");var a=an(e,t);_o(o,xo(o,a),r,function(e,t){return tn(e)?e.nextSibling(t):t.nextSibling}(o,a),!1)}t[e.index]=n=Pa(i,t,r,e),Ra(t,n)}return new Lc(n,e,t)}var Vc={},zc=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=Nt(e);return new Gc(t,this.ngModule)}}]),n}(Ku);function Uc(e){var t=[];for(var n in e)e.hasOwnProperty(n)&&t.push({propName:e[n],templateName:n});return t}var Hc=new Ri("SCHEDULER_TOKEN",{providedIn:"root",factory:function(){return no}}),Gc=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(qo).join(",")}(e.selectors),r.ngContentSelectors=e.ngContentSelectors?e.ngContentSelectors:[],r.isBoundToModule=!!i,r}return b(n,[{key:"inputs",get:function(){return Uc(this.componentDef.inputs)}},{key:"outputs",get:function(){return Uc(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,Vc,r);return o!==Vc||i===Vc?o:t.get(n,i,r)}}}(e,i.injector):e,s=a.get(tc,nn),u=a.get(rc,null),c=s.createRenderer(null,this.componentDef),l=this.componentDef.selectors[0][0]||"div",h=n?function(e,t,n){if(tn(e))return e.selectRootElement(t,n===ht.ShadowDom);var i="string"==typeof t?e.querySelector(t):t;return i.textContent="",i}(c,n,this.componentDef.encapsulation):po(s.createRenderer(null,this.componentDef),l,function(e){var t=e.toLowerCase();return"svg"===t?Jt:"math"===t?"http://www.w3.org/1998/MathML/":null}(l)),d=this.componentDef.onPush?576:528,f={components:[],scheduler:no,clean:Fa,playerHandler:null,flags:0},p=pa(0,null,null,1,0,null,null,null,null,null),v=ia(null,p,f,d,null,null,s,c,u,a);Fn(v);try{var g=function(e,t,n,i,r,o){var a=n[1];n[20]=e;var s=ra(a,20,2,"#host",null),u=s.mergedAttrs=t.hostAttrs;null!==u&&(Wa(s,u,!0),null!==e&&(ti(r,e,u),null!==s.classes&&Do(r,e,s.classes),null!==s.styles&&Ro(r,e,s.styles)));var c=i.createRenderer(e,t),l=ia(n,fa(t),null,t.onPush?64:16,n[20],s,i,c,null,null);return a.firstCreatePass&&(gi(di(s,n),a,t.type),wa(a,s),xa(s,n.length,1)),Ra(n,l),n[20]=l}(h,this.componentDef,v,s,c);if(h)if(n)ti(c,h,["ng-version",ac.full]);else{var m=function(e){for(var t=[],n=[],i=1,r=2;i0&&Do(c,h,b.join(" "))}if(o=sn(p,20),void 0!==t)for(var _=o.projection=[],w=0;w1&&void 0!==arguments[1]?arguments[1]:ss.THROW_IF_NOT_FOUND,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:at.Default;return e===ss||e===Rc||e===Xa?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}(Rc),Yc=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!==Lt(e)&&function(e){var t=new Set;!function e(n){var i=Lt(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(Ve(t)," vs ").concat(Ve(t.name)))}(r,qc.get(r),n),qc.set(r,n));var o,a=_(oo(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 Xc(this.moduleType,e)}}]),n}(function(){return function e(){m(this,e)}}());function Kc(e,t,n){var i=On()+e,r=mn();return r[i]===Xo?bs(r,i,n?t.call(n):t()):function(e,t){return e[t]}(r,i)}function $c(e,t,n,i){return Zc(mn(),On(),e,t,n,i)}function Qc(e,t){var n=e[t];return n===Xo?void 0:n}function Zc(e,t,n,i,r,o){var a=t+n;return _s(e,a,r)?bs(e,a+1,o?i.call(o,r):i(r)):Qc(e,a+1)}function Jc(e,t){var n,i=yn(),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 qe("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=Gt(n.type)),a=st(Os);try{var s=li(!1),u=o();return li(s),function(e,t,n,i){n>=e.data.length&&(e.data[n]=null,e.blueprint[n]=null),t[n]=i}(i,mn(),r,u),u}finally{st(a)}}function el(e,t,n){var i=e+20,r=mn(),o=un(r,i);return il(r,nl(r,i)?Zc(r,On(),t,o.transform,n,o):o.transform(n))}function tl(e,t,n,i){var r=e+20,o=mn(),a=un(o,r);return il(o,nl(o,r)?function(e,t,n,i,r,o,a){var s=t+n;return ws(e,s,r,o)?bs(e,s+2,a?i.call(a,r,o):i(r,o)):Qc(e,s+2)}(o,On(),t,a.transform,n,i,a):a.transform(n,i))}function nl(e,t){return e[1].data[t].pure}function il(e,t){return gs.isWrapped(t)&&(t=gs.unwrap(t),e[Tn()]=Xo),t}function rl(e){return function(t){setTimeout(e,void 0,t)}}var ol=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=rl(c),u&&(u=rl(u)),l&&(l=rl(l)));var d=e(p(i.prototype),"subscribe",this).call(this,{next:u,error:c,complete:l});return t instanceof q&&t.add(d),d}}]),i}(ae);function al(){return this._results[vs()]()}var sl=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=vs(),i=e.prototype;i[n]||(i[n]=al)}return b(e,[{key:"changes",get:function(){return this._changes||(this._changes=new ol)}},{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=Ni(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},hl=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)(Zi(Xl))},e.\u0275prov=$e({token:e,factory:e.\u0275fac}),e}(),nh=function(){var e=function(){function e(){m(this,e),this._applications=new Map,ih.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 ih.findTestabilityInTree(this,e,t)}}]),e}();return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=$e({token:e,factory:e.\u0275fac}),e}(),ih=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}()),rh=!0,oh=!1;function ah(){return oh=!0,rh}var sh=new Ri("AllowMultipleToken");function uh(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],i="Platform: ".concat(t),r=new Ri(i);return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],o=ch();if(!o||o.injector.get(sh,!1))if(e)e(n.concat(t).concat({provide:r,useValue:!0}));else{var a=n.concat(t).concat({provide:r,useValue:!0},{provide:Ka,useValue:"platform"});!function(e){if(Jl&&!Jl.destroyed&&!Jl.injector.get(sh,!1))throw new Error("There can be only one platform. Destroy the previous one to create a new one.");Jl=e.get(lh);var t=e.get(Al,null);t&&t.forEach(function(e){return e()})}(ss.create({providers:a,name:i}))}return function(e){var t=ch();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 ch(){return Jl&&!Jl.destroyed?Jl:null}var lh=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 eh:("zone.js"===e?void 0:e)||new Xl({enableLongStackTrace:ah(),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:Xl,useValue:i}];return i.run(function(){var o=ss.create({providers:r,parent:n.injector,name:e.moduleType.name}),a=e.create(o),s=a.injector.get(to,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(){fh(n._modules,a),e.unsubscribe()})}),function(e,i,r){try{var o=function(){var e=a.injector.get(El);return e.runInitializers(),e.donePromise.then(function(){return Bu(a.injector.get(Dl,Fu)||Fu),n._moduleDoBootstrap(a),a})}();return js(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}}(s,i)})}},{key:"bootstrapModule",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i=hh({},n);return function(e,t,n){var i=new Yc(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(dh);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(Ve(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)(Zi(ss))},e.\u0275prov=$e({token:e,factory:e.\u0275fac}),e}();function hh(e,t){return Array.isArray(t)?t.reduce(hh,e):Object.assign(Object.assign({},e),t)}var dh=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 te(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 te(function(e){var t;a._zone.runOutsideAngular(function(){t=a._zone.onStable.subscribe(function(){Xl.assertNotInAngularZone(),ql(function(){!a._stable&&!a._zone.hasPendingMacrotasks&&!a._zone.hasPendingMicrotasks&&(a._stable=!0,e.next(!0))})})});var n=a._zone.onUnstable.subscribe(function(){Xl.assertInAngularZone(),a._stable&&(a._stable=!1,a._zone.runOutsideAngular(function(){e.next(!1)}))});return function(){t.unsubscribe(),n.unsubscribe()}});this.isStable=Oe(s,u.pipe(je()))}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 Yu?e:this._componentFactoryResolver.resolveComponentFactory(e),this.componentTypes.push(n.componentType);var r=function(e){return e.isBoundToModule}(n)?void 0:this._injector.get(Rc),o=n.create(ss.NULL,[],t||n.selector,r),a=o.location.nativeElement,s=o.injector.get(th,null),u=s&&o.injector.get(nh);return s&&u&&u.registerApplication(a,s),o.onDestroy(function(){i.detachView(o.hostView),fh(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;fh(this._views,t),t.detachFromAppRef()}},{key:"_loadComponent",value:function(e){this.attachView(e.hostView),this.tick(),this.components.push(e),this._injector.get(Il,[]).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)(Zi(Xl),Zi(ss),Zi(to),Zi(Ku),Zi(El))},e.\u0275prov=$e({token:e,factory:e.\u0275fac}),e}();function fh(e,t){var n=e.indexOf(t);n>-1&&e.splice(n,1)}var ph=uh(null,"core",[{provide:Ml,useValue:"unknown"},{provide:lh,deps:[ss]},{provide:nh,deps:[]},{provide:Rl,deps:[]}]),vh=[{provide:dh,useClass:dh,deps:[Xl,ss,to,Ku,El]},{provide:Hc,deps:[Xl],useFactory:function(e){var t=[];return e.onStable.subscribe(function(){for(;t.length;)t.pop()()}),function(e){t.push(e)}}},{provide:El,useClass:El,deps:[[new sr,Cl]]},{provide:Hl,useClass:Hl,deps:[]},Tl,{provide:yc,useFactory:function(){return Oc},deps:[]},{provide:_c,useFactory:function(){return Tc},deps:[]},{provide:Dl,useFactory:function(e){return Bu(e=e||"undefined"!=typeof $localize&&$localize.locale||Fu),e},deps:[[new ar(Dl),new sr,new ur]]},{provide:Nl,useValue:"USD"}],gh=function(){var e=function e(t){m(this,e)};return e.\u0275fac=function(t){return new(t||e)(Zi(dh))},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({providers:vh}),e}(),mh=null;function yh(){return mh}var bh=new Ri("DocumentToken"),_h=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=$e({factory:wh,token:e,providedIn:"platform"}),e}();function wh(){return Zi(kh)}var kh=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 yh().getBaseHref(this._doc)}},{key:"onPopState",value:function(e){var t=yh().getGlobalEventTarget(this._doc,"window");return t.addEventListener("popstate",e,!1),function(){return t.removeEventListener("popstate",e)}}},{key:"onHashChange",value:function(e){var t=yh().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){xh()?this._history.pushState(e,t,n):this.location.hash=n}},{key:"replaceState",value:function(e,t,n){xh()?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}(_h);return e.\u0275fac=function(t){return new(t||e)(Zi(bh))},e.\u0275prov=$e({factory:Sh,token:e,providedIn:"platform"}),e}();function xh(){return!!window.history.pushState}function Sh(){return new kh(Zi(bh))}function Ch(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 Eh(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 Oh(e){return e&&"?"!==e[0]?"?"+e:e}var Th=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=$e({factory:Ph,token:e,providedIn:"root"}),e}();function Ph(e){var t=Zi(bh).location;return new Mh(Zi(_h),t&&t.origin||"")}var Ah=new Ri("appBaseHref"),Mh=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 Ch(this._baseHref,e)}},{key:"path",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this._platformLocation.pathname+Oh(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+Oh(i));this._platformLocation.pushState(e,t,r)}},{key:"replaceState",value:function(e,t,n,i){var r=this.prepareExternalUrl(n+Oh(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}(Th);return e.\u0275fac=function(t){return new(t||e)(Zi(_h),Zi(Ah,8))},e.\u0275prov=$e({token:e,factory:e.\u0275fac}),e}(),Ih=function(){var e=function(){function e(t,n){var i=this;m(this,e),this._subject=new ol,this._urlChangeListeners=[],this._platformStrategy=t;var r=this._platformStrategy.getBaseHref();this._platformLocation=n,this._baseHref=Eh(Dh(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+Oh(t))}},{key:"normalize",value:function(t){return e.stripTrailingSlash(function(e,t){return e&&t.startsWith(e)?t.substring(e.length):t}(this._baseHref,Dh(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+Oh(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+Oh(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)(Zi(Th),Zi(_h))},e.normalizeQueryParams=Oh,e.joinWithSlash=Ch,e.stripTrailingSlash=Eh,e.\u0275prov=$e({factory:Rh,token:e,providedIn:"root"}),e}();function Rh(){return new Ih(Zi(Th),Zi(_h))}function Dh(e){return e.replace(/\/index.html$/,"")}var Nh=((Nh=Nh||{})[Nh.Decimal=0]="Decimal",Nh[Nh.Percent=1]="Percent",Nh[Nh.Currency=2]="Currency",Nh[Nh.Scientific=3]="Scientific",Nh),Lh=((Lh=Lh||{})[Lh.Zero=0]="Zero",Lh[Lh.One=1]="One",Lh[Lh.Two=2]="Two",Lh[Lh.Few=3]="Few",Lh[Lh.Many=4]="Many",Lh[Lh.Other=5]="Other",Lh),jh=((jh=jh||{})[jh.Decimal=0]="Decimal",jh[jh.Group=1]="Group",jh[jh.List=2]="List",jh[jh.PercentSign=3]="PercentSign",jh[jh.PlusSign=4]="PlusSign",jh[jh.MinusSign=5]="MinusSign",jh[jh.Exponential=6]="Exponential",jh[jh.SuperscriptingExponent=7]="SuperscriptingExponent",jh[jh.PerMille=8]="PerMille",jh[jh.Infinity=9]="Infinity",jh[jh.NaN=10]="NaN",jh[jh.TimeSeparator=11]="TimeSeparator",jh[jh.CurrencyDecimal=12]="CurrencyDecimal",jh[jh.CurrencyGroup=13]="CurrencyGroup",jh);function Fh(e,t){var n=Nu(e),i=n[ju.NumberSymbols][t];if(void 0===i){if(t===jh.CurrencyDecimal)return n[ju.NumberSymbols][jh.Decimal];if(t===jh.CurrencyGroup)return n[ju.NumberSymbols][jh.Group]}return i}var Bh=/^(\d+)?\.((\d+)(-(\d+))?)?$/;function Vh(e){var t=parseInt(e);if(isNaN(t))throw new Error("Invalid integer literal when parsing "+e);return t}var zh=function e(){m(this,e)},Uh=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 Nu(e)[ju.PluralCase]}(t||this.locale)(e)){case Lh.Zero:return"zero";case Lh.One:return"one";case Lh.Two:return"two";case Lh.Few:return"few";case Lh.Many:return"many";default:return"other"}}}]),n}(zh);return e.\u0275fac=function(t){return new(t||e)(Zi(Dl))},e.\u0275prov=$e({token:e,factory:e.\u0275fac}),e}();function Hh(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 Gh=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&&(ms(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(Ve(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)(Os(yc),Os(_c),Os(Ju),Os(nc))},e.\u0275dir=Rt({type:e,selectors:[["","ngClass",""]],inputs:{klass:["class","klass"],ngClass:"ngClass"}}),e}(),Wh=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}(),qh=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 Wh(null,t._ngForOf,-1,-1),null===r?void 0:r),a=new Xh(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 Xh(e,s);n.push(u)}});for(var i=0;i6&&void 0!==arguments[6]&&arguments[6],s="",u=!1;if(isFinite(e)){var c=function(e){var t,n,i,r,o,a=Math.abs(e)+"",s=0;for((n=a.indexOf("."))>-1&&(a=a.replace(".","")),(i=a.search(/e/i))>0?(n<0&&(n=i),n+=+a.slice(i+1),a=a.substring(0,i)):n<0&&(n=a.length),i=0;"0"===a.charAt(i);i++);if(i===(o=a.length))t=[0],n=1;else{for(o--;"0"===a.charAt(o);)o--;for(n-=i,t=[],r=0;i<=o;i++,r++)t[r]=Number(a.charAt(i))}return n>22&&(t=t.splice(0,21),s=n-1,n=1),{digits:t,exponent:s,integerLen:n}}(e);a&&(c=function(e){if(0===e.digits[0])return e;var t=e.digits.length-e.integerLen;return e.exponent?e.exponent+=2:(0===t?e.digits.push(0,0):1===t&&e.digits.push(0),e.integerLen+=2),e}(c));var l=t.minInt,h=t.minFrac,d=t.maxFrac;if(o){var f=o.match(Bh);if(null===f)throw new Error("".concat(o," is not a valid digit info"));var p=f[1],v=f[3],g=f[5];null!=p&&(l=Vh(p)),null!=v&&(h=Vh(v)),null!=g?d=Vh(g):null!=v&&h>d&&(d=h)}!function(e,t,n){if(t>n)throw new Error("The minimum number of digits after fraction (".concat(t,") is higher than the maximum (").concat(n,")."));var i=e.digits,r=i.length-e.integerLen,o=Math.min(Math.max(t,r),n),a=o+e.integerLen,s=i[a];if(a>0){i.splice(Math.max(e.integerLen,a));for(var u=a;u=5)if(a-1<0){for(var l=0;l>a;l--)i.unshift(0),e.integerLen++;i.unshift(1),e.integerLen++}else i[a-1]++;for(;r=d?i.pop():h=!1),t>=10?1:0},0);f&&(i.unshift(f),e.integerLen++)}(c,h,d);var m=c.digits,y=c.integerLen,b=c.exponent,_=[];for(u=m.every(function(e){return!e});y0?_=m.splice(y,m.length):(_=m,m=[0]);var w=[];for(m.length>=t.lgSize&&w.unshift(m.splice(-t.lgSize,m.length).join(""));m.length>t.gSize;)w.unshift(m.splice(-t.gSize,m.length).join(""));m.length&&w.unshift(m.join("")),s=w.join(Fh(n,i)),_.length&&(s+=Fh(n,r)+_.join("")),b&&(s+=Fh(n,jh.Exponential)+"+"+b)}else s=Fh(n,jh.Infinity);return s=e<0&&!u?t.negPre+s+t.negSuf:t.posPre+s+t.posSuf}(e,function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"-",n={minInt:1,minFrac:0,maxFrac:0,posPre:"",posSuf:"",negPre:"",negSuf:"",gSize:0,lgSize:0},i=e.split(";"),r=i[0],o=i[1],a=-1!==r.indexOf(".")?r.split("."):[r.substring(0,r.lastIndexOf("0")+1),r.substring(r.lastIndexOf("0")+1)],s=a[0],u=a[1]||"";n.posPre=s.substr(0,s.indexOf("#"));for(var c=0;c1&&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},gt.getAllAngularTestabilities=function(){return e.getAllTestabilities()},gt.getAllAngularRootElements=function(){return e.getAllRootElements()},gt.frameworkStabilizers||(gt.frameworkStabilizers=[]),gt.frameworkStabilizers.push(function(e){var t=gt.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?yh().isShadowRoot(t)?this.findTestabilityInTree(e,t.host,!0):this.findTestabilityInTree(e,t.parentElement,!0):null}}],[{key:"init",value:function(){!function(e){ih=e}(new e)}}]),e}(),bd=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=$e({token:e,factory:e.\u0275fac}),e}(),_d=new Ri("EventManagerPlugins"),wd=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&&jd.hasOwnProperty(t)&&(t=jd[t]))}return Ld[t]||t}(e);return" "===(n=n.toLowerCase())?n="space":"."===n&&(n="dot"),Nd.forEach(function(i){i!=n&&Fd[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}(kd);return e.\u0275fac=function(t){return new(t||e)(Zi(bh))},e.\u0275prov=$e({token:e,factory:e.\u0275fac}),e}(),Vd=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=$e({factory:function(){return Zi(zd)},token:e,providedIn:"root"}),e}(),zd=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 Wr.NONE:return t;case Wr.HTML:return _r(t,"HTML")?br(t):Hr(this._doc,String(t)).toString();case Wr.STYLE:return _r(t,"Style")?br(t):t;case Wr.SCRIPT:if(_r(t,"Script"))return br(t);throw new Error("unsafe value used in a script context");case Wr.URL:return wr(t),_r(t,"URL")?br(t):Er(String(t));case Wr.RESOURCE_URL:if(_r(t,"ResourceURL"))return br(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 pr(e)}(e)}},{key:"bypassSecurityTrustStyle",value:function(e){return function(e){return new vr(e)}(e)}},{key:"bypassSecurityTrustScript",value:function(e){return function(e){return new gr(e)}(e)}},{key:"bypassSecurityTrustUrl",value:function(e){return function(e){return new mr(e)}(e)}},{key:"bypassSecurityTrustResourceUrl",value:function(e){return function(e){return new yr(e)}(e)}}]),n}(Vd);return e.\u0275fac=function(t){return new(t||e)(Zi(bh))},e.\u0275prov=$e({factory:function(){return function(e){return new zd(e.get(bh))}(Zi(Xa))},token:e,providedIn:"root"}),e}(),Ud=uh(ph,"browser",[{provide:Ml,useValue:ld},{provide:Al,useValue:function(){pd.makeCurrent(),yd.init()},multi:!0},{provide:bh,useFactory:function(){return function(e){Zt=e}(document),document},deps:[]}]),Hd=[[],{provide:Ka,useValue:"root"},{provide:to,useFactory:function(){return new to},deps:[]},{provide:_d,useClass:Dd,multi:!0,deps:[bh,Xl,Ml]},{provide:_d,useClass:Bd,multi:!0,deps:[bh]},[],{provide:Ad,useClass:Ad,deps:[wd,Sd,Ol]},{provide:tc,useExisting:Ad},{provide:xd,useExisting:Sd},{provide:Sd,useClass:Sd,deps:[bh]},{provide:th,useClass:th,deps:[Xl]},{provide:wd,useClass:wd,deps:[_d,Xl]},{provide:fd,useClass:bd,deps:[]},[]],Gd=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:Ol,useValue:t.appId},{provide:gd,useExisting:Ol},md]}}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Zi(e,12))},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({providers:Hd,imports:[cd,gh]}),e}();function Wd(e){return null!=e&&"false"!="".concat(e)}function qd(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 Xd(e){return Array.isArray(e)?e:[e]}function Yd(e){return null==e?"":"string"==typeof e?e:"".concat(e,"px")}function Kd(e){return e instanceof Ju?e.nativeElement:e}function $d(){for(var e=arguments.length,t=new Array(e),n=0;n1?Array.prototype.slice.call(arguments):e)},i,n)})}function Zd(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}(q)),ef=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}(),tf=function(t){a(i,t);var n=s(i);function i(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ef.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}(ef);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}(Jd));var nf=1,rf=Promise.resolve(),of={};function af(e){return e in of&&(delete of[e],!0)}var sf=function(e){var t=nf++;return of[t]=!0,rf.then(function(){return af(t)&&e()}),t},uf=function(e){af(e)};function cf(e){return!!e&&(e instanceof te||"function"==typeof e.lift&&"function"==typeof e.subscribe)}function lf(e,t){return function(n){return n.lift(new hf(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=sf(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&&(uf(n),t.scheduled=void 0)}}]),i}(Jd));var hf=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 df(e,this.compare,this.keySelector))}}]),e}(),df=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}(K),ff=new tf(Jd),pf=function(){function e(t){m(this,e),this.durationSelector=t}return b(e,[{key:"call",value:function(e,t){return t.subscribe(new vf(e,this.durationSelector))}}]),e}(),vf=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=we(t,new be(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}(_e);function gf(e){return!U(e)&&e-parseFloat(e)+1>=0}function mf(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 yf(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ff;return function(e){return function(t){return t.lift(new pf(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 gf(t)?i=Number(t)<1?1:Number(t):ue(t)&&(n=t),ue(n)||(n=ff),new te(function(t){var r=gf(e)?e:+e-n.now();return n.schedule(mf,r,{index:0,period:i,subscriber:t})})}(e,t)})}function bf(e,t){return function(n){return n.lift(new _f(e,t))}}var _f=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 wf(e,this.predicate,this.thisArg))}}]),e}(),wf=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}(K);function kf(e){return function(t){return t.lift(new xf(e))}}var xf=function(){function e(t){m(this,e),this.notifier=t}return b(e,[{key:"call",value:function(e,t){var n=new Sf(e),i=we(this.notifier,new be(n));return i&&!n.seenValue?(n.add(i),t.subscribe(n)):n}}]),e}(),Sf=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}(_e);function Cf(){return Ce(1)($d.apply(void 0,arguments))}function Ef(){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}(Jd)),Mf=new te(function(e){return e.complete()});function If(e){return e?function(e){return new te(function(t){return e.schedule(function(){return t.complete()})})}(e):Mf}function Rf(e,t){return new te(t?function(n){return t.schedule(Df,0,{error:e,subscriber:n})}:function(t){return t.error(e)})}function Df(e){var t=e.error;e.subscriber.error(t)}var Nf=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 $d(this.value);case"E":return Rf(this.error);case"C":return If()}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}();Nf.completeNotification=new Nf("C"),Nf.undefinedValueNotification=new Nf("N",void 0);var Lf,jf=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 Ff(e,this.destination)))}},{key:"_next",value:function(e){this.scheduleMessage(Nf.createNext(e))}},{key:"_error",value:function(e){this.scheduleMessage(Nf.createError(e)),this.unsubscribe()}},{key:"_complete",value:function(){this.scheduleMessage(Nf.createComplete()),this.unsubscribe()}}],[{key:"dispatch",value:function(e){var t=e.notification,n=e.destination;t.observe(n),this.unsubscribe()}}]),n}(K),Ff=function e(t,n){m(this,e),this.notification=t,this.destination=n},Bf=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 Vf(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 ie;if(this.isStopped||this.hasError?t=q.EMPTY:(this.observers.push(e),t=new re(this,e)),r&&e.add(e=new jf(e,r)),n)for(var a=0;at&&(o=Math.max(o,r-t)),o>0&&i.splice(0,o),i}}]),i}(ae),Vf=function e(t,n){m(this,e),this.time=t,this.value=n};function zf(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 Bf(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{Lf="undefined"!=typeof Intl&&Intl.v8BreakIterator}catch(G){Lf=!1}var Uf,Hf,Gf,Wf,qf=function(){var e=function e(t){m(this,e),this._platformId=t,this.isBrowser=this._platformId?hd(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&&!Lf)&&"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)(Zi(Ml))},e.\u0275prov=$e({factory:function(){return new e(Zi(Ml))},token:e,providedIn:"root"}),e}(),Xf=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({}),e}(),Yf=["color","button","checkbox","date","datetime-local","email","file","hidden","image","month","number","password","radio","range","reset","search","submit","tel","text","time","url","week"];function Kf(){if(Uf)return Uf;if("object"!=typeof document||!document)return Uf=new Set(Yf);var e=document.createElement("input");return Uf=new Set(Yf.filter(function(t){return e.setAttribute("type",t),e.type===t}))}function $f(e){return function(){if(null==Hf&&"undefined"!=typeof window)try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:function(){return Hf=!0}}))}finally{Hf=Hf||!1}return Hf}()?e:!!e.capture}function Qf(e){if(function(){if(null==Wf){var e="undefined"!=typeof document?document.head:null;Wf=!(!e||!e.createShadowRoot&&!e.attachShadow)}return Wf}()){var t=e.getRootNode?e.getRootNode():null;if("undefined"!=typeof ShadowRoot&&ShadowRoot&&t instanceof ShadowRoot)return t}return null}function Zf(){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 Jf(e){return e.composedPath?e.composedPath()[0]:e.target}var ep=new Ri("cdk-dir-doc",{providedIn:"root",factory:function(){return Ji(bh)}}),tp=function(){var e=function(){function e(t){if(m(this,e),this.value="ltr",this.change=new ol,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)(Zi(ep,8))},e.\u0275prov=$e({factory:function(){return new e(Zi(ep,8))},token:e,providedIn:"root"}),e}(),np=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({}),e}(),ip=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 ae,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 te(function(n){e._globalSubscription||e._addGlobalListener();var i=t>0?e._scrolled.pipe(yf(t)).subscribe(n):e._scrolled.subscribe(n);return e._scrolledCount++,function(){i.unsubscribe(),e._scrolledCount--,e._scrolledCount||e._removeGlobalListener()}}):$d()}},{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(bf(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=Kd(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 Qd(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)(Zi(Xl),Zi(qf),Zi(bh,8))},e.\u0275prov=$e({factory:function(){return new e(Zi(Xl),Zi(qf),Zi(bh,8))},token:e,providedIn:"root"}),e}(),ap=function(){var e=function(){function e(t,n,i){var r=this;m(this,e),this._platform=t,this._change=new ae,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(yf(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)(Zi(qf),Zi(Xl),Zi(bh,8))},e.\u0275prov=$e({factory:function(){return new e(Zi(qf),Zi(Xl),Zi(bh,8))},token:e,providedIn:"root"}),e}(),sp=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({}),e}(),up=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({imports:[[np,Xf,sp],np,sp]}),e}(),cp=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}(),lp=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}(cp),hp=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}(cp),dp=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 Ju?e.nativeElement:e,i}return n}(cp),fp=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 lp?(this._attachedPortal=e,this.attachComponentPortal(e)):e instanceof hp?(this._attachedPortal=e,this.attachTemplatePortal(e)):this.attachDomPortal&&e instanceof dp?(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}(),pp=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}(fp),vp=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}(hp);return e.\u0275fac=function(t){return new(t||e)(Os(Ac),Os(Nc))},e.\u0275dir=Rt({type:e,selectors:[["","cdkPortal",""]],exportAs:["cdkPortal"],features:[cs]}),e}(),gp=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}(vp);return t.\u0275fac=function(n){return(e||(e=Ti(t)))(n||t)},t.\u0275dir=Rt({type:t,selectors:[["","cdk-portal",""],["","portal",""]],exportAs:["cdkPortal"],features:[Xu([{provide:vp,useExisting:t}]),cs]}),t}(),mp=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 ol,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}(fp);return t.\u0275fac=function(e){return new(e||t)(Os(Ku),Os(Nc),Os(bh))},t.\u0275dir=Rt({type:t,selectors:[["","cdkPortalOutlet",""]],inputs:{portal:["cdkPortalOutlet","portal"]},outputs:{attached:"attached"},exportAs:["cdkPortalOutlet"],features:[cs]}),t}(),yp=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({}),e}(),bp=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 _p(e){return function(t){return 0===e?If():t.lift(new wp(e))}}var wp=function(){function e(t){if(m(this,e),this.total=t,this.total<0)throw new bp}return b(e,[{key:"call",value:function(e,t){return t.subscribe(new kp(e,this.total))}}]),e}(),kp=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}(K);function xp(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return function(n){return n.lift(new Sp(e,t))}}var Sp=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 Cp(e,this.predicate,this.inclusive))}}]),e}(),Cp=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}(K);function Ep(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;it.height||e.scrollWidth>t.width}}]),e}(),Pp=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}(),Ap=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 Ip(e,t){return t.some(function(t){return e.topt.bottom||e.leftt.right})}var Rp=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}(),Dp=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 Ap},this.close=function(e){return new Pp(o._scrollDispatcher,o._ngZone,o._viewportRuler,e)},this.block=function(){return new Tp(o._viewportRuler,o._document)},this.reposition=function(e){return new Rp(o._scrollDispatcher,o._viewportRuler,o._ngZone,e)},this._document=r};return e.\u0275fac=function(t){return new(t||e)(Zi(op),Zi(ap),Zi(Xl),Zi(bh))},e.\u0275prov=$e({factory:function(){return new e(Zi(op),Zi(ap),Zi(Xl),Zi(bh))},token:e,providedIn:"root"}),e}(),Np=function e(t){if(m(this,e),this.scrollStrategy=new Ap,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)(Zi(bh))},e.\u0275prov=$e({factory:function(){return new e(Zi(bh))},token:e,providedIn:"root"}),e}(),Bp=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}(Fp);return t.\u0275fac=function(e){return new(e||t)(Zi(bh))},t.\u0275prov=$e({factory:function(){return new t(Zi(bh))},token:t,providedIn:"root"}),t}(),Vp=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=Jf(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}(Fp);return t.\u0275fac=function(e){return new(e||t)(Zi(bh),Zi(qf))},t.\u0275prov=$e({factory:function(){return new t(Zi(bh),Zi(qf))},token:t,providedIn:"root"}),t}(),zp="undefined"!=typeof window?window:{},Up=void 0!==zp.__karma__&&!!zp.__karma__||void 0!==zp.jasmine&&!!zp.jasmine||void 0!==zp.jest&&!!zp.jest||void 0!==zp.Mocha&&!!zp.Mocha,Hp=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||Up)for(var t=this._document.querySelectorAll(".".concat(e,'[platform="server"], .').concat(e,'[platform="test"]')),n=0;nf&&(f=g,d=v)}}catch(m){p.e(m)}finally{p.f()}return this._isPushed=!1,void this._applyPosition(d.position,d.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&&Yp(this._boundingBox.style,{top:"",left:"",right:"",bottom:"",height:"",width:"",alignItems:"",justifyContent:""}),this._pane&&this._resetOverlayElementStyles(),this._overlayRef&&this._overlayRef.hostElement.classList.remove(Wp),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=$p(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),d=this._subtractOverflows(r.height,c,l),f=h*d;return{visibleArea:f,isCompletelyWithinViewport:r.width*r.height===f,fitsInViewportVertically:d===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=Kp(this._overlayRef.getConfig().minHeight),a=Kp(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=$p(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 d=Math.min(u.right-e.x+u.left,e.x),f=this._lastBoundingBoxSize.width;o=2*d,a=e.x-d,o>f&&!this._isInitialRender&&!this._growAfterOpen&&(a=e.x-f/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=Yd(n.height),i.top=Yd(n.top),i.bottom=Yd(n.bottom),i.width=Yd(n.width),i.left=Yd(n.left),i.right=Yd(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=Yd(r)),o&&(i.maxWidth=Yd(o))}this._lastBoundingBoxSize=n,Yp(this._boundingBox.style,i)}},{key:"_resetBoundingBoxStyles",value:function(){Yp(this._boundingBox.style,{top:"0",left:"0",right:"0",bottom:"0",height:"",width:"",alignItems:"",justifyContent:""})}},{key:"_resetOverlayElementStyles",value:function(){Yp(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();Yp(n,this._getExactOverlayY(t,e,a)),Yp(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=Yd(o.maxHeight):r&&(n.maxHeight="")),o.maxWidth&&(i?n.maxWidth=Yd(o.maxWidth):r&&(n.maxWidth="")),Yp(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=Yd(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=Yd(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:Ip(e,n),isOriginOutsideView:Mp(e,n),isOverlayClipped:Ip(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(Jp),n.justifyContent=n.alignItems=e.marginTop=e.marginBottom=e.marginLeft=e.marginRight=e.position="",this._overlayRef=null,this._isDisposed=!0}}}]),e}(),tv=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 ev}},{key:"connectedTo",value:function(e,t,n){return new Zp(t,n,e,this._viewportRuler,this._document,this._platform,this._overlayContainer)}},{key:"flexibleConnectedTo",value:function(e){return new Xp(e,this._viewportRuler,this._document,this._platform,this._overlayContainer)}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Zi(ap),Zi(bh),Zi(qf),Zi(Hp))},e.\u0275prov=$e({factory:function(){return new e(Zi(ap),Zi(bh),Zi(qf),Zi(Hp))},token:e,providedIn:"root"}),e}(),nv=0,iv=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 Np(e);return r.direction=r.direction||this._directionality.value,new Gp(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-"+nv++,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(dh)),new pp(e,this._componentFactoryResolver,this._appRef,this._injector,this._document)}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Zi(Dp),Zi(Hp),Zi(Ku),Zi(tv),Zi(Bp),Zi(ss),Zi(Xl),Zi(bh),Zi(tp),Zi(Ih),Zi(Vp))},e.\u0275prov=$e({token:e,factory:e.\u0275fac}),e}(),rv=[{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"}],ov=new Ri("cdk-connected-overlay-scroll-strategy"),av=function(){var e=function e(t){m(this,e),this.elementRef=t};return e.\u0275fac=function(t){return new(t||e)(Os(Ju))},e.\u0275dir=Rt({type:e,selectors:[["","cdk-overlay-origin",""],["","overlay-origin",""],["","cdkOverlayOrigin",""]],exportAs:["cdkOverlayOrigin"]}),e}(),sv=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=q.EMPTY,this._attachSubscription=q.EMPTY,this._detachSubscription=q.EMPTY,this._positionSubscription=q.EMPTY,this.viewportMargin=0,this.open=!1,this.disableClose=!1,this.backdropClick=new ol,this.positionChange=new ol,this.attach=new ol,this.detach=new ol,this.overlayKeydown=new ol,this.overlayOutsideClick=new ol,this._templatePortal=new hp(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=Wd(e)}},{key:"lockPosition",get:function(){return this._lockPosition},set:function(e){this._lockPosition=Wd(e)}},{key:"flexibleDimensions",get:function(){return this._flexibleDimensions},set:function(e){this._flexibleDimensions=Wd(e)}},{key:"growAfterOpen",get:function(){return this._growAfterOpen},set:function(e){this._growAfterOpen=Wd(e)}},{key:"push",get:function(){return this._push},set:function(e){this._push=Wd(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=rv);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&&!Ep(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 Np({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(xp(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)(Os(iv),Os(Ac),Os(Nc),Os(ov),Os(tp,8))},e.\u0275dir=Rt({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:[qt]}),e}(),uv={provide:ov,deps:[iv],useFactory:function(e){return function(){return e.scrollStrategies.reposition()}}},cv=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({providers:[iv,uv],imports:[[np,yp,up],up]}),e}(),lv={schedule:function(e,t){var n=setTimeout(e,t);return function(){return clearTimeout(n)}},scheduleBeforeRender:function(e){if("undefined"==typeof window)return lv.schedule(e,0);if(void 0===window.requestAnimationFrame)return lv.schedule(e,16);var t=window.requestAnimationFrame(e);return function(){return window.cancelAnimationFrame(t)}}};function hv(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(!Qp){var n=Element.prototype;Qp=n.matches||n.matchesSelector||n.mozMatchesSelector||n.msMatchesSelector||n.oMatchesSelector||n.webkitMatchesSelector}return e.nodeType===Node.ELEMENT_NODE&&Qp.call(e,t)}(e,t)||(i=n,0))}),i}var dv=function(){function e(t,n){m(this,e),this.componentFactory=n.get(Ku).resolveComponentFactory(t)}return b(e,[{key:"create",value:function(e){return new fv(this.componentFactory,e)}}]),e}(),fv=function(){function e(t,n){m(this,e),this.componentFactory=t,this.injector=n,this.eventEmitters=new Bf(1),this.events=this.eventEmitters.pipe(Of(function(e){return Oe.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(Xl),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=lv.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=ss.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]:ff;return function(n){return n.lift(new wv(e,t))}}var wv=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 kv(e,this.dueTime,this.scheduler))}}]),e}(),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,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(xv,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}(K);function xv(e){e.debouncedNext()}function Sv(e){return function(t){return t.lift(new Cv(e))}}var Cv=function(){function e(t){m(this,e),this.total=t}return b(e,[{key:"call",value:function(e,t){return t.subscribe(new Ev(e,this.total))}}]),e}(),Ev=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}(K),Ov=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=$e({factory:function(){return new e},token:e,providedIn:"root"}),e}(),Tv=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=Kd(e);return new te(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 ae,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)(Zi(Ov))},e.\u0275prov=$e({factory:function(){return new e(Zi(Ov))},token:e,providedIn:"root"}),e}(),Pv=function(){var e=function(){function e(t,n,i){m(this,e),this._contentObserver=t,this._elementRef=n,this._ngZone=i,this.event=new ol,this._disabled=!1,this._currentSubscription=null}return b(e,[{key:"disabled",get:function(){return this._disabled},set:function(e){this._disabled=Wd(e),this._disabled?this._unsubscribe():this._subscribe()}},{key:"debounce",get:function(){return this._debounce},set:function(e){this._debounce=qd(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(_v(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)(Os(Tv),Os(Ju),Os(Xl))},e.\u0275dir=Rt({type:e,selectors:[["","cdkObserveContent",""]],inputs:{disabled:["cdkObserveContentDisabled","disabled"],debounce:"debounce"},outputs:{event:"cdkObserveContent"},exportAs:["cdkObserveContent"]}),e}(),Av=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({providers:[Ov]}),e}();function Mv(e,t){return(e.getAttribute(t)||"").match(/\S+/g)||[]}var Iv="cdk-describedby-message-container",Rv="cdk-describedby-message",Dv="cdk-describedby-host",Nv=0,Lv=new Map,jv=null,Fv=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=Bv(t,n);"string"!=typeof t?(Vv(t),Lv.set(i,{messageElement:t,referenceCount:0})):Lv.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=Bv(t,n);if(this._isElementDescribedByMessage(e,i)&&this._removeMessageReference(e,i),"string"==typeof t){var r=Lv.get(i);r&&0===r.referenceCount&&this._deleteMessageElement(i)}jv&&0===jv.childNodes.length&&this._deleteMessagesContainer()}}},{key:"ngOnDestroy",value:function(){for(var e=this._document.querySelectorAll("[".concat(Dv,"]")),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(mv(function(t){return e._pressedLetters.push(t)}),_v(t),bf(function(){return e._pressedLetters.length>0}),ce(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||Ep(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 sl?this._items.toArray():this._items}}]),e}()),Uv=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===Gv(t)||!this.isVisible(t)))return!1;var n=e.nodeName.toLowerCase(),i=Gv(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")||Hv(e))}(e)&&!this.isDisabled(e)&&((null==t?void 0:t.ignoreVisibility)||this.isVisible(e))}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Zi(qf))},e.\u0275prov=$e({factory:function(){return new e(Zi(qf))},token:e,providedIn:"root"}),e}();function Hv(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 Gv(e){if(!Hv(e))return null;var t=parseInt(e.getAttribute("tabindex")||"",10);return isNaN(t)?-1:t}var Wv=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(_p(1)).subscribe(e)}}]),e}(),qv=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 Wv(e,this._checker,this._ngZone,this._document,t)}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Zi(Uv),Zi(Xl),Zi(bh))},e.\u0275prov=$e({factory:function(){return new e(Zi(Uv),Zi(Xl),Zi(bh))},token:e,providedIn:"root"}),e}();function Xv(e){return 0===e.offsetX&&0===e.offsetY}function Yv(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 Kv=new Ri("cdk-input-modality-detector-options"),$v={ignoreKeys:[18,17,224,91,16]},Qv=$f({passive:!0,capture:!0}),Zv=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 vv(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=Jf(e))},this._onMousedown=function(e){Date.now()-o._lastTouchMs<650||(o._modality.next(Xv(e)?"keyboard":"mouse"),o._mostRecentTarget=Jf(e))},this._onTouchstart=function(e){Yv(e)?o._modality.next("keyboard"):(o._lastTouchMs=Date.now(),o._modality.next("touch"),o._mostRecentTarget=Jf(e))},this._options=Object.assign(Object.assign({},$v),r),this.modalityDetected=this._modality.pipe(Sv(1)),this.modalityChanged=this.modalityDetected.pipe(lf()),t.isBrowser&&n.runOutsideAngular(function(){i.addEventListener("keydown",o._onKeydown,Qv),i.addEventListener("mousedown",o._onMousedown,Qv),i.addEventListener("touchstart",o._onTouchstart,Qv)})}return b(e,[{key:"mostRecentModality",get:function(){return this._modality.value}},{key:"ngOnDestroy",value:function(){!this._platform.isBrowser||(document.removeEventListener("keydown",this._onKeydown,Qv),document.removeEventListener("mousedown",this._onMousedown,Qv),document.removeEventListener("touchstart",this._onTouchstart,Qv))}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Zi(qf),Zi(Xl),Zi(bh),Zi(Kv,8))},e.\u0275prov=$e({factory:function(){return new e(Zi(qf),Zi(Xl),Zi(bh),Zi(Kv,8))},token:e,providedIn:"root"}),e}(),Jv=new Ri("liveAnnouncerElement",{providedIn:"root",factory:function(){return null}}),eg=new Ri("LIVE_ANNOUNCER_DEFAULT_OPTIONS"),tg=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=Kd(e);if(!this._platform.isBrowser||1!==n.nodeType)return $d(null);var i=Qf(n)||this._getDocument(),r=this._elementInfo.get(n);if(r)return t&&(r.checkChildren=!0),r.subject;var o={checkChildren:t,subject:new ae,rootNode:i};return this._elementInfo.set(n,o),this._registerGlobalListeners(o),o.subject}},{key:"stopMonitoring",value:function(e){var t=Kd(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=Kd(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=Jf(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,ig),n.addEventListener("blur",t._rootNodeFocusAndBlurListener,ig)}),this._rootNodeFocusListenerCount.set(n,i+1),1==++this._monitoredElementCount&&(this._ngZone.runOutsideAngular(function(){t._getWindow().addEventListener("focus",t._windowFocusListener)}),this._inputModalityDetector.modalityDetected.pipe(kf(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,ig),t.removeEventListener("blur",this._rootNodeFocusAndBlurListener,ig),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)(Zi(Xl),Zi(qf),Zi(Zv),Zi(bh,8),Zi(ng,8))},e.\u0275prov=$e({factory:function(){return new e(Zi(Xl),Zi(qf),Zi(Zv),Zi(bh,8),Zi(ng,8))},token:e,providedIn:"root"}),e}(),og="cdk-high-contrast-black-on-white",ag="cdk-high-contrast-white-on-black",sg="cdk-high-contrast-active",ug=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(sg),e.remove(og),e.remove(ag),this._hasCheckedHighContrastMode=!0;var t=this.getHighContrastMode();1===t?(e.add(sg),e.add(og)):2===t&&(e.add(sg),e.add(ag))}}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Zi(qf),Zi(bh))},e.\u0275prov=$e({factory:function(){return new e(Zi(qf),Zi(bh))},token:e,providedIn:"root"}),e}(),cg=function(){var e=function e(t){m(this,e),t._applyBodyHighContrastModeCssClasses()};return e.\u0275fac=function(t){return new(t||e)(Zi(ug))},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({imports:[[Xf,Av]]}),e}(),lg=new oc("12.2.5"),hg=function e(){m(this,e)},dg="*";function fg(e,t){return{type:7,name:e,definitions:t,options:{}}}function pg(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return{type:4,styles:t,timings:e}}function vg(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return{type:2,steps:e,options:t}}function gg(e){return{type:6,styles:e,offset:null}}function mg(e,t,n){return{type:0,name:e,styles:t,options:n}}function yg(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return{type:1,expr:e,animation:t,options:n}}function bg(e){Promise.resolve(null).then(e)}var _g=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;bg(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}(),wg=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?bg(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 kg(){return"undefined"!=typeof window&&void 0!==window.document}function xg(){return"undefined"!=typeof process&&"[object process]"==={}.toString.call(process)}function Sg(e){switch(e.length){case 0:return new _g;case 1:return e[0];default:return new wg(e)}}function Cg(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 dg: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 Eg(e,t,n,i){switch(t){case"start":e.onStart(function(){return i(n&&Og(n,"start",e))});break;case"done":e.onDone(function(){return i(n&&Og(n,"done",e))});break;case"destroy":e.onDestroy(function(){return i(n&&Og(n,"destroy",e))})}}function Og(e,t,n){var i=n.totalTime,r=Tg(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 Tg(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 Pg(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 Ag(e){var t=e.indexOf(":");return[e.substring(1,t),e.substr(t+1)]}var Mg=function(e,t){return!1},Ig=function(e,t){return!1},Rg=function(e,t,n){return[]},Dg=xg();(Dg||"undefined"!=typeof Element)&&(Mg=kg()?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)},Ig=function(){if(Dg||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])}:Ig}(),Rg=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 em(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 Jg(e,n);return n}function tm(e,t,n){return n?t+":"+n+";":""}function nm(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(_m(o,s)),"<"==a[0]&&("*"!=o||"*"!=s)&&t.push(_m(s,o))}(e,n,t)}):n.push(e),n}var ym=new Set(["true","1"]),bm=new Set(["false","0"]);function _m(e,t){var n=ym.has(e)||bm.has(e),i=ym.has(t)||bm.has(t);return function(r,o){var a="*"==e||e==r,s="*"==t||t==o;return!a&&n&&"boolean"==typeof r&&(a=r?ym.has(e):bm.has(e)),!s&&i&&"boolean"==typeof o&&(s=o?ym.has(t):bm.has(t)),a&&s}}var wm=new RegExp("s*:selfs*,?","g");function km(e,t,n){return new xm(e).build(t,n)}var xm=function(){function e(t){m(this,e),this._driver=t}return b(e,[{key:"build",value:function(e,t){var n=new Sm(t);return this._resetContextStyleTimingState(n),vm(this,om(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(Cm(e)){var t=e;Object.keys(t).forEach(function(e){sm(t[e]).forEach(function(e){o.hasOwnProperty(e)||r.add(e)})})}}),r.size){var a=cm(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=vm(this,om(e.animation),t);return{type:1,matchers:mm(e.expr,t.errors),animation:n,queryCount:t.queryCount,depCount:t.depCount,options:Em(e.options)}}},{key:"visitSequence",value:function(e,t){var n=this;return{type:2,steps:e.steps.map(function(e){return vm(n,e,t)}),options:Em(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=vm(n,e,t);return r=Math.max(r,t.currentTime),o});return t.currentTime=r,{type:3,steps:o,options:Em(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 Om(Zg(e,t).duration,0,"");var i=e;if(i.split(/\s+/).some(function(e){return"{"==e.charAt(0)&&"{"==e.charAt(1)})){var r=Om(0,0,"");return r.dynamic=!0,r.strValue=i,r}return Om((n=n||Zg(i,t)).duration,n.delay,n.easing)}(e.timings,t.errors);t.currentAnimateTimings=n;var i,r=e.styles?e.styles:gg({});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=gg(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==dg?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(Cm(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=sm(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(Cm(e)&&e.hasOwnProperty("offset")){var n=e;t=parseFloat(n.offset),delete n.offset}});else if(Cm(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==d?1:h*r:o[r],s=a*v;t.currentTime=f+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:vm(this,om(e.animation),t),options:Em(e.options)}}},{key:"visitAnimateChild",value:function(e,t){return t.depCount++,{type:9,options:Em(e.options)}}},{key:"visitAnimateRef",value:function(e,t){return{type:10,animation:this.visitReference(e.animation,t),options:Em(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(wm,"")),[e=e.replace(/@\*/g,Xg).replace(/@\w+/g,function(e){return Xg+"-"+e.substr(1)}).replace(/:animating/g,Kg),t]}(e.selector),2),a=o[0],s=o[1];n.currentQuerySelector=i.length?i+" "+a:a,Pg(n.collectedStyles,n.currentQuerySelector,{});var u=vm(this,om(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:Em(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"}:Zg(e.timings,t.errors,!0);return{type:12,animation:vm(this,om(e.animation),t),timings:n,options:null}}}]),e}(),Sm=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 Cm(e){return!Array.isArray(e)&&"object"==typeof e}function Em(e){return e?(e=Jg(e)).params&&(e.params=function(e){return e?Jg(e):null}(e.params)):e={},e}function Om(e,t,n){return{duration:e,delay:t,easing:n}}function Tm(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 Pm=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}(),Am=new RegExp(":enter","g"),Mm=new RegExp(":leave","g");function Im(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 Rm).buildKeyframes(e,t,n,i,r,o,a,s,u,c)}var Rm=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 Pm;var l=new Nm(e,t,u,i,r,c,[]);l.options=s,l.currentTimeline.setStyles([o],null,l.errors,s),vm(this,n,l);var h=l.timelines.filter(function(e){return e.containsAnimation()});if(h.length&&Object.keys(a).length){var d=h[h.length-1];d.allowOnlyTimelineStyles()||d.setStyles([a],null,l.errors,s)}return h.length?h.map(function(e){return e.buildKeyframes()}):[Tm(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?$g(n.duration):null,o=null!=n.delay?$g(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),vm(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=Dm);var a=$g(o.delay);r.delayNextStep(a)}e.steps.length&&(e.steps.forEach(function(e){return vm(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?$g(e.options.delay):0;e.steps.forEach(function(a){var s=t.createSubContext(e.options);o&&s.delayNextStep(o),vm(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 Zg(t.params?um(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?$g(r.delay):0;o&&(6===t.previousNode.type||0==i&&t.currentTimeline.getCurrentStyleProperties().length)&&(t.currentTimeline.snapshotCurrentStyles(),t.previousNode=Dm);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),vm(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;vm(this,e.animation,t),t.previousNode=e,n.currentStaggerTime=i.currentTime-c+(i.startTime-n.currentTimeline.startTime)}}]),e}(),Dm={},Nm=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=Dm,this.subContextCount=0,this.options={},this.currentQueryIndex=0,this.currentQueryTotal=0,this.currentStaggerTime=0,this.currentTimeline=u||new Lm(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=$g(i.duration)),null!=i.delay&&(r.delay=$g(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]=um(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=Dm,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 jm(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(Am,"."+this._enterClassName)).replace(Mm,"."+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}(),Lm=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]||dg,t._currentKeyframe[e]=dg}),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]=dg}):em(e,!1,i)}),i}(e,this._globalTimelineStyles);Object.keys(a).forEach(function(e){var t=um(a[e],o,n);r._pendingStyles[e]=t,r._localTimelineStyles.hasOwnProperty(e)||(r._backFill[e]=r._globalTimelineStyles.hasOwnProperty(e)?r._globalTimelineStyles[e]:dg),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=em(o,!0);Object.keys(s).forEach(function(e){var i=s[e];"!"==i?t.add(e):i==dg&&n.add(e)}),i||(s.offset=a/e.duration),r.push(s)});var o=t.size?cm(t.values()):[],a=n.size?cm(n.values()):[];if(i){var s=r[0],u=Jg(s);s.offset=0,u.offset=1,r=[s,u]}return Tm(this.element,r,o,a,this.duration,this.startTime,this.easing,!1)}}]),e}(),jm=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=em(e[0],!1);u.offset=0,o.push(u);var c=em(e[0],!1);c.offset=Fm(s),o.push(c);for(var l=e.length-1,h=1;h<=l;h++){var d=em(e[h],!1);d.offset=Fm((n+d.offset*i)/a),o.push(d)}i=a,n=0,r="",e=o}return Tm(this.element,e,this.preStyleProps,this.postStyleProps,i,n,r,!0)}}]),n}(Lm);function Fm(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 Bm=function e(){m(this,e)},Vm=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 hm(e)}},{key:"normalizeStyleValue",value:function(e,t,n,i){var r="",o=n.toString().trim();if(zm[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}(Bm),zm=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 Um(e,t,n,i,r,o,a,s,u,c,l,h,d){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:d}}var Hm={},Gm=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||Hm,d=this.buildStyles(n,a&&a.params||Hm,l),f=s&&s.params||Hm,p=this.buildStyles(i,f,l),v=new Set,g=new Map,m=new Map,y="void"===i,b={params:Object.assign(Object.assign({},h),f)},_=c?[]:Im(e,t,this.ast.animation,r,o,d,p,b,u,l),w=0;if(_.forEach(function(e){w=Math.max(e.duration+e.delay,w)}),l.length)return Um(t,this._triggerName,n,i,y,d,p,[],[],g,m,w,l);_.forEach(function(e){var n=e.element,i=Pg(g,n,{});e.preStyleProps.forEach(function(e){return i[e]=!0});var r=Pg(m,n,{});e.postStyleProps.forEach(function(e){return r[e]=!0}),n!==t&&v.add(n)});var k=cm(v.values());return Um(t,this._triggerName,n,i,y,d,p,_,k,g,m,w)}}]),e}(),Wm=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=Jg(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=um(a,r,t));var s=n.normalizer.normalizePropertyName(e,t);a=n.normalizer.normalizeStyleValue(e,s,a,t),i[s]=a})}}),i}}]),e}(),qm=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 Wm(e.style,e.options&&e.options.params||{},i)}),Xm(this.states,"true","1"),Xm(this.states,"false","0"),n.transitions.forEach(function(e){r.transitionFactories.push(new Gm(t,e,r.states))}),this.fallbackTransition=function(e,t,n){return new Gm(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 Xm(e,t,n){e.hasOwnProperty(t)?e.hasOwnProperty(n)||(e[n]=e[t]):e.hasOwnProperty(n)&&(e[t]=e[n])}var Ym=new Pm,Km=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=km(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=Cg(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=Im(this._driver,t,a,Gg,Wg,{},{},r,Ym,o)).forEach(function(e){var t=Pg(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,dg)})});var u=Sg(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=Tg(t,"","","");return Eg(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}(),$m="ng-animate-queued",Qm="ng-animate-disabled",Zm=".ng-animate-disabled",Jm=[],ey={namespaceId:"",setForRemoval:!1,setForMove:!1,hasAnimation:!1,removedBeforeQueried:!1},ty={namespaceId:"",setForMove:!1,setForRemoval:!1,hasAnimation:!1,removedBeforeQueried:!0},ny="__ng_removed",iy=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=Jg(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}(),ry="void",oy=new iy(ry),ay=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,py(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=Pg(this._elementListeners,e,[]),a={name:t,phase:n,callback:i};o.push(a);var s=Pg(this._engine.statesByElement,e,{});return s.hasOwnProperty(t)||(py(e,qg),py(e,qg+"-"+t),s[t]=oy),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 uy(this.id,t,e),s=this._engine.statesByElement.get(e);s||(py(e,qg),py(e,qg+"-"+t),this._engine.statesByElement.set(e,s={}));var u=s[t],c=new iy(n,this.id);if(!(n&&n.hasOwnProperty("value"))&&u&&c.absorbOptions(u.options),s[t]=c,u||(u=oy),c.value===ry||u.value!==c.value){var l=Pg(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),d=!1;if(!h){if(!r)return;h=o.fallbackTransition,d=!0}return this._engine.totalQueuedPlayers++,this._queue.push({element:e,triggerName:t,transition:h,fromState:u,toState:c,player:a,isFallbackTransition:d}),d||(py(e,$m),a.onStart(function(){vy(e,$m)})),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),py(e,Qm)):this.disabledNodes.has(e)&&(this.disabledNodes.delete(e),vy(e,Qm))}},{key:"removeNode",value:function(e,t,n,i){if(cy(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[ny]={namespaceId:e,setForRemoval:i,hasAnimation:n,removedBeforeQueried:!1}}},{key:"listen",value:function(e,t,n,i,r){return cy(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,Xg,!0);n.forEach(function(e){return t.destroyActiveAnimationsForElement(e)}),0!=this.playersByQueriedElement.size&&(n=this.driver.query(e,Kg,!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 Sg(e.players).onDone(function(){return t()});t()})}},{key:"processLeaveNode",value:function(e){var t=this,n=e[ny];if(n&&n.setForRemoval){if(e[ny]=ey,n.namespaceId){this.destroyInnerAnimations(e);var i=this._fetchNamespace(n.namespaceId);i&&i.clearElementCache(e)}this._onRemovalComplete(e,n.setForRemoval)}this.driver.matchesElement(e,Zm)&&this.markElementAsDisabled(e,!1),this.driver.query(e,Zm,!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(C.push(t),n.collectedEnterElements.length){var l=o[ny];if(l&&l.setForMove)return void t.destroy()}var d=!h||!n.driver.containsElement(h,o),f=x.get(o),v=p.get(o),g=n._buildInstruction(e,i,v,f,d);if(g.errors&&g.errors.length)E.push(g);else{if(d)return t.onStart(function(){return rm(o,g.fromStyles)}),t.onDestroy(function(){return im(o,g.toStyles)}),void r.push(t);if(e.isFallbackTransition)return t.onStart(function(){return rm(o,g.fromStyles)}),t.onDestroy(function(){return im(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 Pg(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(E.length){var T=[];E.forEach(function(e){T.push("@".concat(e.triggerName," has failed due to:\n")),e.errors.forEach(function(e){return T.push("- ".concat(e,"\n"))})}),C.forEach(function(e){return e.destroy()}),this.reportError(T)}var P=new Map,A=new Map;a.forEach(function(e){var t=e.element;i.has(t)&&(A.set(t,t),n._beforeAnimationBuild(e.player.namespaceId,e.instruction,P))}),r.forEach(function(e){var t=e.element;n._getPreviousPlayers(t,!1,e.namespaceId,e.triggerName,null).forEach(function(e){Pg(P,t,[]).push(e),e.destroy()})});var M=m.filter(function(e){return yy(e,u,c)}),I=new Map;hy(I,this.driver,b,c,dg).forEach(function(e){yy(e,u,c)&&M.push(e)});var R=new Map;f.forEach(function(e,t){hy(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 im(t,s.toStyles)}),a.disabled=!0,a.overrideTotalTime(s.totalTime),void r.push(a);var u=L;if(A.size>1){for(var c=t,h=[];c=c.parentNode;){var d=A.get(c);if(d){u=d;break}h.push(c)}h.forEach(function(e){return A.set(e,u)})}var f=n._buildAnimation(a.namespaceId,s,P,o,R,I);if(a.setRealPlayer(f),u===L)D.push(a);else{var p=n.playersByElement.get(u);p&&p.length&&(a.parentPlayer=Sg(p)),r.push(a)}}else rm(t,s.fromStyles),a.onDestroy(function(){return im(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=Sg(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 _g(e.duration,e.delay)}}]),e}(),uy=function(){function e(t,n,i){m(this,e),this.namespaceId=t,this.triggerName=n,this.element=i,this._player=new _g,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 Eg(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){Pg(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 cy(e){return e&&1===e.nodeType}function ly(e,t){var n=e.style.display;return e.style.display=null!=t?t:"none",n}function hy(e,t,n,i,r){var o=[];n.forEach(function(e){return o.push(ly(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[ny]=ty,a.push(i))}),e.set(i,o)});var s=0;return n.forEach(function(e){return ly(e,o[s++])}),a}function dy(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 fy="$$classes";function py(e,t){if(e.classList)e.classList.add(t);else{var n=e[fy];n||(n=e[fy]={}),n[t]=!0}}function vy(e,t){if(e.classList)e.classList.remove(t);else{var n=e[fy];n&&delete n[t]}}function gy(e,t,n){Sg(n).onDone(function(){return e.processLeaveNode(t)})}function my(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 _y(e,t){var n=null,i=null;return Array.isArray(t)&&t.length?(n=ky(t[0]),t.length>1&&(i=ky(t[t.length-1]))):t&&(n=ky(t)),n||i?new wy(e,n,i):null}var wy=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&&im(this._element,this._startStyles,this._initialStyles),this._state=1)}},{key:"finish",value:function(){this.start(),this._state<2&&(im(this._element,this._initialStyles),this._endStyles&&(im(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&&(rm(this._element,this._startStyles),this._endStyles=null),this._endStyles&&(rm(this._element,this._endStyles),this._endStyles=null),im(this._element,this._initialStyles),this._state=3)}}]),e}();function ky(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(),Ay(this._element,this._eventFn,!0))}},{key:"destroy",value:function(){this._destroyed||(this._destroyed=!0,this.finish(),function(e,t){var n=Iy(e,"").split(","),i=Py(n,t);i>=0&&(n.splice(i,1),My(e,"",n.join(",")))}(this._element,this._name))}}]),e}();function Oy(e,t,n){My(e,"PlayState",n,Ty(e,t))}function Ty(e,t){var n=Iy(e,"");return n.indexOf(",")>0?Py(n.split(","),t):Py([n],t)}function Py(e,t){for(var n=0;n=0)return n;return-1}function Ay(e,t,n){n?e.removeEventListener(Cy,t):e.addEventListener(Cy,t)}function My(e,t,n,i){var r=Sy+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 Iy(e,t){return e.style[Sy+t]||""}var Ry=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 Ey(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]:gm(e.element,i))})}this.currentSnapshot=t}}]),e}(),Dy=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=zg(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}(_g),Ny=function(){function e(){m(this,e),this._count=0}return b(e,[{key:"validateStyleProperty",value:function(e){return jg(e)}},{key:"matchesElement",value:function(e,t){return Fg(e,t)}},{key:"containsElement",value:function(e,t){return Bg(e,t)}},{key:"query",value:function(e,t,n){return Vg(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 zg(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 Ry}),s={};fm(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=pm(e,t,s));if(0==n)return new Dy(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=_y(e,t),d=new Ry(e,t,c,n,i,r,u,h);return d.onDestroy(function(){return function(e){e.parentNode.removeChild(e)}(l)}),d}}]),e}(),Ly=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]:gm(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}(),jy=function(){function e(){m(this,e),this._isNativeImpl=/\{\s*\[native\s+code\]\s*\}/.test(Fy().toString()),this._cssKeyframesDriver=new Ny}return b(e,[{key:"validateStyleProperty",value:function(e){return jg(e)}},{key:"matchesElement",value:function(e,t){return Fg(e,t)}},{key:"containsElement",value:function(e,t){return Bg(e,t)}},{key:"query",value:function(e,t,n){return Vg(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 Ly});fm(n,i)&&c.forEach(function(e){var t=e.currentSnapshot;Object.keys(t).forEach(function(e){return u[e]=t[e]})});var l=_y(e,t=pm(e,t=t.map(function(e){return em(e,!1)}),u));return new Ly(e,t,s,l)}}]),e}();function Fy(){return kg()&&Element.prototype.animate||{}}var By=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:ht.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)?vg(e):e;return Uy(this._renderer,null,t,"register",[n]),new Vy(t,this._renderer)}}]),n}(hg);return e.\u0275fac=function(t){return new(t||e)(Zi(tc),Zi(bh))},e.\u0275prov=$e({token:e,factory:e.\u0275fac}),e}(),Vy=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 zy(this._id,e,t||{},this._renderer)}}]),n}(function(){return function e(){m(this,e)}}()),zy=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==Hy?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}(),qy=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==Hy?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}(Wy),Xy=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}(by);return e.\u0275fac=function(t){return new(t||e)(Zi(bh),Zi(Hg),Zi(Bm))},e.\u0275prov=$e({token:e,factory:e.\u0275fac}),e}(),Yy=new Ri("AnimationModuleType"),Ky=[{provide:hg,useClass:By},{provide:Bm,useFactory:function(){return new Vm}},{provide:by,useClass:Xy},{provide:tc,useFactory:function(e,t,n){return new Gy(e,t,n)},deps:[Ad,by,Xl]}],$y=[{provide:Hg,useFactory:function(){return"function"==typeof Fy()?new jy:new Ny}},{provide:Yy,useValue:"BrowserAnimations"}].concat(Ky),Qy=[{provide:Hg,useClass:Ug},{provide:Yy,useValue:"NoopAnimations"}].concat(Ky),Zy=function(){var e=function(){function e(){m(this,e)}return b(e,null,[{key:"withConfig",value:function(t){return{ngModule:e,providers:t.disableAnimations?Qy:$y}}}]),e}();return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({providers:$y,imports:[Gd]}),e}();function Jy(e,t){if(1&e&&Is(0,"mat-pseudo-checkbox",4),2&e){var n=Ws();Ts("state",n.selected?"checked":"unchecked")("disabled",n.disabled)}}function eb(e,t){if(1&e&&(As(0,"span",5),Cu(1),Ms()),2&e){var n=Ws();Yo(1),Ou("(",n.group.label,")")}}var tb=["*"],nb=new oc("12.2.5"),ib=new Ri("mat-sanity-checks",{providedIn:"root",factory:function(){return!0}}),rb=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!(!ah()||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")&&nb.full!==lg.full&&console.warn("The Angular Material version ("+nb.full+") does not match the Angular CDK version ("+lg.full+").\nPlease ensure the versions of these two packages exactly match.")}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Zi(ug),Zi(ib,8),Zi(bh))},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({imports:[[np],np]}),e}();function ob(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({},vb),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 pb(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({},vb),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=Kd(e);!t||t===this._triggerElement||(this._removeTriggerEvents(),this._triggerElement=t,this._registerEvents(mb))}},{key:"handleEvent",value:function(e){"mousedown"===e.type?this._onMousedown(e):"touchstart"===e.type?this._onTouchStart(e):this._onPointerUp(),this._pointerUpEventsRegistered||(this._registerEvents(yb),this._pointerUpEventsRegistered=!0)}},{key:"_onMousedown",value:function(e){var t=Xv(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,gb)})})}},{key:"_removeTriggerEvents",value:function(){var e=this;this._triggerElement&&(mb.forEach(function(t){e._triggerElement.removeEventListener(t,e,gb)}),this._pointerUpEventsRegistered&&yb.forEach(function(t){e._triggerElement.removeEventListener(t,e,gb)}))}}]),e}(),_b=new Ri("mat-ripple-global-options"),wb=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 bb(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)(Os(Ju),Os(Xl),Os(qf),Os(_b,8),Os(Yy,8))},e.\u0275dir=Rt({type:e,selectors:[["","mat-ripple",""],["","matRipple",""]],hostAttrs:[1,"mat-ripple"],hostVars:2,hostBindings:function(e,t){2&e&&cu("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}(),kb=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({imports:[[rb,Xf],rb]}),e}(),xb=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)(Os(Yy,8))},e.\u0275cmp=Ot({type:e,selectors:[["mat-pseudo-checkbox"]],hostAttrs:[1,"mat-pseudo-checkbox"],hostVars:8,hostBindings:function(e,t){2&e&&cu("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}(),Sb=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({imports:[[rb]]}),e}(),Cb=new Ri("MAT_OPTION_PARENT_COMPONENT"),Eb=ob(function(){return function e(){m(this,e)}}()),Ob=0,Tb=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-"+Ob++,i._inert=null!==(r=null==e?void 0:e.inertGroups)&&void 0!==r&&r,i}return n}(Eb);return e.\u0275fac=function(t){return new(t||e)(Os(Cb,8))},e.\u0275dir=Rt({type:e,inputs:{label:"label"},features:[cs]}),e}(),Pb=new Ri("MatOptgroup"),Ab=0,Mb=function e(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];m(this,e),this.source=t,this.isUserInput=n},Ib=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-"+Ab++,this.onSelectionChange=new ol,this._stateChanges=new ae}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=Wd(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)&&!Ep(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 Mb(this,e))}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Os(Ju),Os(Cc),Os(void 0),Os(Tb))},e.\u0275dir=Rt({type:e,inputs:{id:"id",disabled:"disabled",value:"value"},outputs:{onSelectionChange:"onSelectionChange"}}),e}(),Rb=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}(Ib);return e.\u0275fac=function(t){return new(t||e)(Os(Ju),Os(Cc),Os(Cb,8),Os(Pb,8))},e.\u0275cmp=Ot({type:e,selectors:[["mat-option"]],hostAttrs:["role","option",1,"mat-option","mat-focus-indicator"],hostVars:12,hostBindings:function(e,t){1&e&&Vs("click",function(){return t._selectViaInteraction()})("keydown",function(e){return t._handleKeydown(e)}),2&e&&(Au("id",t.id),ks("tabindex",t._getTabIndex())("aria-selected",t._getAriaSelected())("aria-disabled",t.disabled.toString()),cu("mat-selected",t.selected)("mat-option-multiple",t.multiple)("mat-active",t.active)("mat-option-disabled",t.disabled))},exportAs:["matOption"],features:[cs],ngContentSelectors:tb,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&&(Xs(),Cs(0,Jy,1,2,"mat-pseudo-checkbox",0),As(1,"span",1),Ys(2),Ms(),Cs(3,eb,2,1,"span",2),Is(4,"div",3)),2&e&&(Ts("ngIf",t.multiple),Yo(3),Ts("ngIf",t.group&&t.group._inert),Yo(1),Ts("matRippleTrigger",t._getHostElement())("matRippleDisabled",t.disabled||t.disableRipple))},directives:[Yh,wb,xb],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 Db(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 Lb=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({imports:[[kb,cd,rb,Sb]]}),e}();function jb(){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}(),Yb=function(){function e(){m(this,e)}return b(e,[{key:"encodeKey",value:function(e){return Qb(e)}},{key:"encodeValue",value:function(e){return Qb(e)}},{key:"decodeKey",value:function(e){return decodeURIComponent(e)}},{key:"decodeValue",value:function(e){return decodeURIComponent(e)}}]),e}(),Kb=/%(\d[a-f0-9])/gi,$b={40:"@","3A":":",24:"$","2C":",","3B":";","2B":"+","3D":"=","3F":"?","2F":"/"};function Qb(e){return encodeURIComponent(e).replace(Kb,function(e,t){var n;return null!==(n=$b[t])&&void 0!==n?n:e})}function Zb(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 Yb,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(Zb(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(Zb(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}(),e_=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 t_(e){return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer}function n_(e){return"undefined"!=typeof Blob&&e instanceof Blob}function i_(e){return"undefined"!=typeof FormData&&e instanceof FormData}var r_=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 Xb),this.context||(this.context=new e_),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}(),o_=((o_=o_||{})[o_.Sent=0]="Sent",o_[o_.UploadProgress=1]="UploadProgress",o_[o_.ResponseHeader=2]="ResponseHeader",o_[o_.DownloadProgress=3]="DownloadProgress",o_[o_.Response=4]="Response",o_[o_.User=5]="User",o_),a_=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 Xb,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},s_=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=o_.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}(a_),u_=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=o_.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}(a_),c_=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}(a_);function l_(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 h_=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 r_?n=e:(i=a.headers instanceof Xb?a.headers:new Xb(a.headers),a.params&&(r=a.params instanceof Jb?a.params:new Jb({fromObject:a.params})),n=new r_(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=$d(n).pipe(ke(function(e){return o.handler.handle(e)},void 0,1));if(e instanceof r_||"events"===a.observe)return s;var u=s.pipe(bf(function(e){return e instanceof u_}));switch(a.observe||"body"){case"body":switch(n.responseType){case"arraybuffer":return u.pipe(ce(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(ce(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(ce(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(ce(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,l_(n,t))}},{key:"post",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.request("POST",e,l_(n,t))}},{key:"put",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.request("PUT",e,l_(n,t))}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Zi(Wb))},e.\u0275prov=$e({token:e,factory:e.\u0275fac}),e}(),d_=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}(),f_=new Ri("HTTP_INTERCEPTORS"),p_=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=$e({token:e,factory:e.\u0275fac}),e}(),v_=/^\)\]\}',?\n/,g_=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 te(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 Xb(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 s_({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(v_,"");try{c=""!==c?JSON.parse(c):null}catch(d){c=h,l&&(l=!1,c={error:d,text:c})}}l?(n.next(new u_({body:c,headers:r,status:o,statusText:a,url:s||void 0})),n.complete()):n.error(new c_({error:c,headers:r,status:o,statusText:a,url:s||void 0}))},l=function(e){var t=u().url,r=new c_({error:e,status:i.status||0,statusText:i.statusText||"Unknown Error",url:t||void 0});n.error(r)},h=!1,d=function(t){h||(n.next(u()),h=!0);var r={type:o_.DownloadProgress,loaded:t.loaded};t.lengthComputable&&(r.total=t.total),"text"===e.responseType&&!!i.responseText&&(r.partialText=i.responseText),n.next(r)},f=function(e){var t={type:o_.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",d),null!==a&&i.upload&&i.upload.addEventListener("progress",f)),i.send(a),n.next({type:o_.Sent}),function(){i.removeEventListener("error",l),i.removeEventListener("abort",l),i.removeEventListener("load",c),i.removeEventListener("timeout",l),e.reportProgress&&(i.removeEventListener("progress",d),null!==a&&i.upload&&i.upload.removeEventListener("progress",f)),i.readyState!==i.DONE&&i.abort()}})}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Zi(fd))},e.\u0275prov=$e({token:e,factory:e.\u0275fac}),e}(),m_=new Ri("XSRF_COOKIE_NAME"),y_=new Ri("XSRF_HEADER_NAME"),b_=function e(){m(this,e)},__=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=Hh(e,this.cookieName),this.lastCookieString=e),this.lastToken}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Zi(bh),Zi(Ml),Zi(m_))},e.\u0275prov=$e({token:e,factory:e.\u0275fac}),e}(),w_=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)(Zi(b_),Zi(y_))},e.\u0275prov=$e({token:e,factory:e.\u0275fac}),e}(),k_=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(f_,[]);this.chain=t.reduceRight(function(e,t){return new d_(e,t)},this.backend)}return this.chain.handle(e)}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Zi(qb),Zi(ss))},e.\u0275prov=$e({token:e,factory:e.\u0275fac}),e}(),x_=function(){var e=function(){function e(){m(this,e)}return b(e,null,[{key:"disable",value:function(){return{ngModule:e,providers:[{provide:w_,useClass:p_}]}}},{key:"withOptions",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{ngModule:e,providers:[t.cookieName?{provide:m_,useValue:t.cookieName}:[],t.headerName?{provide:y_,useValue:t.headerName}:[]]}}}]),e}();return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({providers:[w_,{provide:f_,useExisting:w_,multi:!0},{provide:b_,useClass:__},{provide:m_,useValue:"XSRF-TOKEN"},{provide:y_,useValue:"X-XSRF-TOKEN"}]}),e}(),S_=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({providers:[h_,{provide:Wb,useClass:k_},g_,{provide:qb,useExisting:g_}],imports:[[x_.withOptions({cookieName:"XSRF-TOKEN",headerName:"X-XSRF-TOKEN"})]]}),e}(),C_=["*"];function E_(e){return Error('Unable to find icon with the name "'.concat(e,'"'))}function O_(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 T_(e){return Error("The literal provided to MatIconRegistry was not trusted as safe HTML by Angular's DomSanitizer. Attempted literal was \"".concat(e,'".'))}var P_=function e(t,n,i){m(this,e),this.url=t,this.svgText=n,this.options=i},A_=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 P_(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(Wr.HTML,n);if(!r)throw T_(n);return this._addSvgIconConfig(e,t,new P_("",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 P_(t,null,n))}},{key:"addSvgIconSetLiteralInNamespace",value:function(e,t,n){var i=this._sanitizer.sanitize(Wr.HTML,t);if(!i)throw T_(t);return this._addSvgIconSetConfig(e,new P_("",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(Wr.RESOURCE_URL,e);if(!n)throw O_(e);var i=this._cachedIconsByUrl.get(n);return i?$d(M_(i)):this._loadSvgIconFromConfig(new P_(e,null)).pipe(mv(function(e){return t._cachedIconsByUrl.set(n,e)}),ce(function(e){return M_(e)}))}},{key:"getNamedSvgIcon",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=I_(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):Rf(E_(n))}},{key:"ngOnDestroy",value:function(){this._resolvers=[],this._svgIconConfigs.clear(),this._iconSetConfigs.clear(),this._cachedIconsByUrl.clear()}},{key:"_getSvgFromConfig",value:function(e){return e.svgText?$d(M_(this._svgElementFromConfig(e))):this._loadSvgIconFromConfig(e).pipe(ce(function(e){return M_(e)}))}},{key:"_getSvgFromIconSetConfigs",value:function(e,t){var n=this,i=this._extractIconWithNameFromAnySet(e,t);return i?$d(i):jb(t.filter(function(e){return!e.svgText}).map(function(e){return n._loadSvgIconSetFromConfig(e).pipe(Bb(function(t){var i="Loading icon set URL: ".concat(n._sanitizer.sanitize(Wr.RESOURCE_URL,e.url)," failed: ").concat(t.message);return n._errorHandler.handleError(new Error(i)),$d(null)}))})).pipe(ce(function(){var i=n._extractIconWithNameFromAnySet(e,t);if(!i)throw E_(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(mv(function(t){return e.svgText=t}),ce(function(){return t._svgElementFromConfig(e)}))}},{key:"_loadSvgIconSetFromConfig",value:function(e){return e.svgText?$d(null):this._fetchIcon(e).pipe(mv(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",G_=["mat-button","mat-flat-button","mat-icon-button","mat-raised-button","mat-stroked-button","mat-mini-fab","mat-fab"],W_=ab(ob(sb(function(){return function e(t){m(this,e),this._elementRef=t}}()))),q_=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=_(G_);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 $_(e,n,i);if(!r.closed)return t instanceof te?t.subscribe(r):ge(t)(r)}var Z_={};function J_(){for(var e=arguments.length,t=new Array(e),n=0;n visible",pg("150ms cubic-bezier(0, 0, 0.2, 1)")),yg("* => void, * => hidden",pg("75ms cubic-bezier(0.4, 0.0, 1, 1)",gg({opacity:0})))])},gw=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 ae,s._onExit=new ae,s._onEnter=new ae,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(_p(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}(fp);return e.\u0275fac=function(t){return new(t||e)(Os(Xl),Os(Ju),Os(Cc),Os(qf),Os(hw))},e.\u0275cmp=Ot({type:e,selectors:[["snack-bar-container"]],viewQuery:function(e,t){var n;(1&e&&yl(mp,7),2&e)&&(ml(n=_l())&&(t._portalOutlet=n.first))},hostAttrs:[1,"mat-snack-bar-container"],hostVars:1,hostBindings:function(e,t){1&e&&zs("@state.done",function(e){return t.onAnimationEnd(e)}),2&e&&Mu("@state",t._animationState)},features:[cs],decls:3,vars:2,consts:[["aria-hidden","true"],["cdkPortalOutlet",""]],template:function(e,t){1&e&&(As(0,"div",0),Cs(1,cw,0,0,"ng-template",1),Ms(),Is(2,"div")),2&e&&(Yo(2),ks("aria-live",t._live)("role",t._role))},directives:[mp],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:[vw.snackBarState]}}),e}(),mw=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({imports:[[cv,yp,cd,Y_,rb],rb]}),e}(),yw=new Ri("mat-snack-bar-default-options",{providedIn:"root",factory:function(){return new hw}}),bw=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=pw,this.snackBarContainerComponent=gw,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=ss.create({parent:t&&t.viewContainerRef&&t.viewContainerRef.injector||this._injector,providers:[{provide:hw,useValue:t}]}),i=new lp(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 hw),this._defaultConfig),t),r=this._createOverlay(i),o=this._attachSnackBarContainer(r,i),a=new fw(o,r);if(e instanceof Ac){var s=new hp(e,null,{$implicit:i.data,snackBarRef:a});a.instance=o.attachTemplatePortal(s)}else{var u=this._createInjector(i,a),c=new lp(e,void 0,u),l=o.attachComponentPortal(c);a.instance=l.instance}return this._breakpointObserver.observe("(max-width: 599.98px) and (orientation: portrait)").pipe(kf(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 Np;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 ss.create({parent:e&&e.viewContainerRef&&e.viewContainerRef.injector||this._injector,providers:[{provide:fw,useValue:t},{provide:lw,useValue:e.data}]})}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Zi(iv),Zi(tg),Zi(ss),Zi(aw),Zi(e,12),Zi(yw))},e.\u0275prov=$e({factory:function(){return new e(Zi(iv),Zi(tg),Zi(Xa),Zi(aw),Zi(e,12),Zi(yw))},token:e,providedIn:mw}),e}(),_w={tooltipState:fg("state",[mg("initial, void, hidden",gg({opacity:0,transform:"scale(0)"})),mg("visible",gg({transform:"scale(1)"})),yg("* => visible",pg("200ms cubic-bezier(0, 0, 0.2, 1)",function(e){return{type:5,steps:e}}([gg({opacity:0,transform:"scale(0)",offset:0}),gg({opacity:.5,transform:"scale(0.99)",offset:.5}),gg({opacity:1,transform:"scale(1)",offset:1})]))),yg("* => hidden",pg("100ms cubic-bezier(0, 0, 0.2, 1)",gg({opacity:0})))])},ww="tooltip-panel",kw=$f({passive:!0}),xw=new Ri("mat-tooltip-scroll-strategy"),Sw={provide:xw,deps:[iv],useFactory:function(e){return function(){return e.scrollStrategies.reposition({scrollThrottle:20})}}},Cw=new Ri("mat-tooltip-default-options",{providedIn:"root",factory:function(){return{showDelay:0,hideDelay:0,touchendHideDelay:1500}}}),Ew=function(){var e=function(){function e(t,n,i,r,o,a,s,u,c,l,h,d){var f=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 ae,this._handleKeydown=function(e){f._isTooltipVisible()&&27===e.keyCode&&!Ep(e)&&(e.preventDefault(),e.stopPropagation(),f._ngZone.run(function(){return f.hide(0)}))},this._scrollStrategy=c,this._document=d,h&&(h.position&&(this.position=h.position),h.touchGestures&&(this.touchGestures=h.touchGestures)),l.change.pipe(kf(this._destroyed)).subscribe(function(){f._overlayRef&&f._updatePosition(f._overlayRef)}),o.runOutsideAngular(function(){n.nativeElement.addEventListener("keydown",f._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=Wd(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(kf(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,kw)}),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 lp(this._tooltipComponent,this._viewContainerRef),this._tooltipInstance=n.attach(this._portal).instance,this._tooltipInstance.afterHidden().pipe(kf(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(kf(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(ww),scrollStrategy:this._scrollStrategy()}),this._updatePosition(this._overlayRef),this._overlayRef.detachments().pipe(kf(this._destroyed)).subscribe(function(){return e._detach()}),this._overlayRef.outsidePointerEvents().pipe(kf(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(_p(1),kf(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(ww,"-");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,kw)})}},{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)(Os(iv),Os(Ju),Os(op),Os(Nc),Os(Xl),Os(qf),Os(Fv),Os(rg),Os(void 0),Os(tp),Os(void 0),Os(bh))},e.\u0275dir=Rt({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}(),Ow=function(){var e=function(e){a(n,e);var t=s(n);function n(e,i,r,o,a,s,u,c,l,h,d,f){var p;return m(this,n),(p=t.call(this,e,i,r,o,a,s,u,c,l,h,d,f))._tooltipComponent=Pw,p}return n}(Ew);return e.\u0275fac=function(t){return new(t||e)(Os(iv),Os(Ju),Os(op),Os(Nc),Os(Xl),Os(qf),Os(Fv),Os(rg),Os(xw),Os(tp,8),Os(Cw,8),Os(bh))},e.\u0275dir=Rt({type:e,selectors:[["","matTooltip",""]],hostAttrs:[1,"mat-tooltip-trigger"],exportAs:["matTooltip"],features:[cs]}),e}(),Tw=function(){var e=function(){function e(t){m(this,e),this._changeDetectorRef=t,this._visibility="initial",this._closeOnInteraction=!1,this._onHide=new ae}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)(Os(Cc))},e.\u0275dir=Rt({type:e}),e}(),Pw=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}(Tw);return e.\u0275fac=function(t){return new(t||e)(Os(Cc),Os(aw))},e.\u0275cmp=Ot({type:e,selectors:[["mat-tooltip-component"]],hostAttrs:["aria-hidden","true"],hostVars:2,hostBindings:function(e,t){2&e&&uu("zoom","visible"===t._visibility?1:null)},features:[cs],decls:3,vars:7,consts:[[1,"mat-tooltip",3,"ngClass"]],template:function(e,t){var n;(1&e&&(As(0,"div",0),Vs("@state.start",function(){return t._animationStart()})("@state.done",function(e){return t._animationDone(e)}),Jc(1,"async"),Cu(2),Ms()),2&e)&&(cu("mat-tooltip-handset",null==(n=el(1,5,t._isHandset))?null:n.matches),Ts("ngClass",t.tooltipClass)("@state",t._visibility),Yo(2),Eu(t.message))},directives:[Gh],pipes:[sd],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:[_w.tooltipState]},changeDetection:0}),e}(),Aw=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({providers:[Sw],imports:[[cg,cd,cv,rb],rb,sp]}),e}();function Mw(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 Iw(e,t){return function(n,i){t(n,i,e)}}function Rw(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function Dw(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 Nw(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 Lw(){return!("object"==typeof process&&"[object process]"===String(process)&&!process.browser)||Nw()}var jw="undefined"!=typeof __VERSION__?__VERSION__:"untranspiled source",Fw=Lw(),Bw=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 Vw(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 zw={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 Uw(e){return"string"==typeof e?zw[e.toUpperCase()]||zw.WHITE:e}function Hw(e,t){if(!e)throw new Error(t||"Assertion failed")}var Gw={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},Ww=Gw.window||Gw.self||Gw.global,qw=Gw.process||{};function Xw(){var e;if(Fw&&Ww.performance)e=Ww.performance.now();else if(qw.hrtime){var t=qw.hrtime();e=1e3*t[0]+t[1]/1e6}else e=Date.now();return e}console;var Yw={debug:Fw&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},Kw={enabled:!0,level:0};function $w(){}var Qw={},Zw={once:!0};function Jw(e){for(var t in e)for(var n in e[t])return n||"untitled";return"empty"}var ek=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=jw,this._startTs=Xw(),this._deltaTs=Xw(),this.LOG_THROTTLE_TIMEOUT=0,this._storage=new Bw("__probe-".concat(this.id,"__"),Kw),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((Xw()-this._startTs).toPrecision(10))}},{key:"getDelta",value:function(){return Number((Xw()-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){Hw(e,t)}},{key:"warn",value:function(e){return this._getLogFunction(0,e,Yw.warn,arguments,Zw)}},{key:"error",value:function(e){return this._getLogFunction(0,e,Yw.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,Yw.log,arguments,{time:!0,once:!0})}},{key:"log",value:function(e,t){return this._getLogFunction(e,t,Yw.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,Yw.debug||Yw.info,arguments,Zw)}},{key:"table",value:function(e,t,n){return t?this._getLogFunction(e,t,console.table||$w,n&&[n],{tag:Jw(t)}):$w}},{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)?Fw?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=Vw(s,r,a);(e=console).log.apply(e,v(t))},s.src=n,$w}var u=n.nodeName||"";if("img"===u.toLowerCase())return(t=console).log.apply(t,v(Vw(n,r,a))),$w;if("canvas"===u.toLowerCase()){var c=new Image;return c.onload=function(){var e;return(e=console).log.apply(e,v(Vw(c,r,a)))},c.src=n.toDataURL(),$w}return $w}({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)})}:$w}({image:i,message:a,scale:u}):$w}},{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||$w)}},{key:"group",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{collapsed:!1},i=n=nk({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||$w)}},{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()>=tk(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=nk({logLevel:e,message:t,args:i,opts:r}),Hw(n=n||r.method),r.total=this.getTotal(),r.delta=this.getDelta(),this._deltaTs=Xw();var a=r.tag||r.message;if(r.once){if(Qw[a])return $w;Qw[a]=Xw()}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!Fw&&"string"==typeof e&&(t&&(t=Uw(t),e="\x1b[".concat(t,"m").concat(e,"\x1b[39m")),n&&(t=Uw(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 $w}}]),e}();return e.VERSION=jw,e}();function tk(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 Hw(Number.isFinite(t)&&t>=0),t}function nk(e){var t=e.logLevel,n=e.message;e.logLevel=tk(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 Hw("string"===r||"object"===r),Object.assign(e,e.opts)}var ik=new ek({id:"deck"}),rk={DEFAULT:-1,LNGLAT:1,METER_OFFSETS:2,LNGLAT_OFFSETS:3,CARTESIAN:0};Object.defineProperty(rk,"IDENTITY",{get:function(){return ik.deprecated("COORDINATE_SYSTEM.IDENTITY","COORDINATE_SYSTEM.CARTESIAN")()||0}});var ok={WEB_MERCATOR:1,GLOBE:2,WEB_MERCATOR_AUTO_OFFSET:4,IDENTITY:0},ak={click:{handler:"onClick"},panstart:{handler:"onDragStart"},panmove:{handler:"onDrag"},panend:{handler:"onDragEnd"}},sk=new ek({id:"luma.gl"});function uk(e,t){if(!e)throw new Error(t||"luma.gl: assertion failed.")}function ck(e){return"undefined"!=typeof WebGLRenderingContext&&e instanceof WebGLRenderingContext||"undefined"!=typeof WebGL2RenderingContext&&e instanceof WebGL2RenderingContext||Boolean(e&&Number.isFinite(e._version))}function lk(e){return"undefined"!=typeof WebGL2RenderingContext&&e instanceof WebGL2RenderingContext||Boolean(e&&2===e._version)}function hk(e){return uk(ck(e),"Invalid WebGLRenderingContext"),e}function dk(e){return uk(lk(e),"Requires WebGL2"),e}var fk={},pk=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||Sk)){var n=t,i=Dk[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=Dk[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({},Sk),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(){uk(this.stateStack.length>0),Uk(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){uk(void 0!==r);var o=e[r],a=this.cache[r];Lk(o,a)||(n=!0,t=a,i&&!(r in i)&&(i[r]=a),this.cache[r]=o)}return{valueChanged:n,oldValue:t}}}]),e}();function Vk(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.enable,i=void 0===n||n,r=t.copyState;if(uk(void 0!==r),!e.state){var o=globalThis.polyfillContext;for(var a in o&&o(e),e.state=new Bk(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),Ik)Fk(e,a,Ik[a]);jk(e,"getParameter"),jk(e,"isEnabled")}return e.state.enable=i,e}function zk(e){uk(e.state),e.state.pop()}function Uk(e,t){if(uk(ck(e),"setParameters requires a WebGL context"),!Nk(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)Mk[s](e,t,a)}}function Hk(e,t,n){if(Nk(t))return n(e);var i,r=t.nocatch,o=void 0===r||r;if(function(e){e.state||Vk(e,{copyState:!1}),e.state.push()}(e),Uk(e,t),o)i=n(e),zk(e);else try{i=n(e)}finally{zk(e)}return i}function Gk(){return!("object"==typeof process&&"[object process]"===String(process)&&!process.browser)||function(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;return!!(t&&t.indexOf("Electron")>=0)}()}function Wk(e){var t=e.luma;if(e.canvas&&t){var n=t.canvasSizeInfo.clientWidth;return n?e.drawingBufferWidth/n:1}return 1}function qk(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return function(e,t,n,i,r){var o,a=Xk(e[0],t,n),s=Yk(e[1],t,i,r),u=Xk(e[0]+1,t,n),c=u===n-1?u:u-1;return u=Yk(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,Wk(e),e.drawingBufferWidth,e.drawingBufferHeight,n)}function Xk(e,t,n){return Math.min(Math.round(e*t),n-1)}function Yk(e,t,n,i){return i?Math.max(0,n-1-Math.round(e*t)):Math.min(Math.round(e*t),n-1)}var Kk=Gk(),$k=Kk&&"undefined"!=typeof document,Qk={webgl2:!0,webgl1:!0,throwOnError:!0,manageState:!0,canvas:null,debug:!1,width:800,height:600};function Zk(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};uk(Kk,"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({},Qk,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?($k&&"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=lk(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);sk.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({},Qk,t),i=n.manageState,r=n.debug;return i&&Vk(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}(),nx=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 tx?e:new tx(t,n)),this.stats[t]}}]),e}(),ix="8.5.12",rx=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 nx({id:e})),this.stats.get(e)}}]),e}());if(globalThis.luma&&globalThis.luma.VERSION!==ix)throw new Error("luma.gl - multiple VERSIONs detected: ".concat(globalThis.luma.VERSION," vs ").concat(ix));function ox(e,t){if(!e)throw new Error(t||"luma.gl: assertion failed.")}function ax(e,t){if("string"!=typeof t)return t;var n=Number(t);if(!isNaN(n))return n;var i=e[t=t.replace(/^.*\./,"")];return ox(void 0!==i,"Accessing undefined constant GL.".concat(t)),i}function sx(e,t){for(var n in t=Number(t),e)if(e[n]===t)return"GL.".concat(n);return String(t)}globalThis.luma||(Gk()&&sk.log(1,"luma.gl ".concat(ix," - set luma.log.level=1 (or higher) to trace rendering"))(),globalThis.luma=globalThis.luma||{VERSION:ix,version:ix,log:sk,stats:rx,globals:{modules:{},nodeIO:{}}}),globalThis;var ux={};function cx(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"id";return ux[e]=ux[e]||1,"".concat(e,"-").concat(ux[e]++)}function lx(e){return ox("number"==typeof e,"Input must be a number"),e&&0==(e&e-1)}function hx(e){var t=!0;for(var n in e){t=!1;break}return t}function dx(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 sk.removed("Calling removed method ".concat(t,".").concat(e,": "),r)(),new Error(e)})})}var fx="Resource subclass must define virtual methods",px=function(e){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};m(this,t),hk(e);var i=n.id,r=n.userData,o=void 0===r?{}:r;this.gl=e,this.gl2=e,this.id=i||cx(this[Symbol.toStringTag]),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(t,[{key:Symbol.toStringTag,get:function(){return"Resource"}},{key:"toString",value:function(){return"".concat(this[Symbol.toStringTag]||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]:{};ox(e=ax(this.gl,e));var n=(this.constructor.PARAMETERS||{})[e];if(n){var i=lk(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=lk(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?sx(this.gl,c):c;a[h]=this.getParameter(c,t),i&&"GLenum"===l.type&&(a[h]=sx(this.gl,a[h]))}}}catch(d){u.e(d)}finally{u.f()}return a}},{key:"setParameter",value:function(e,t){ox(e=ax(this.gl,e));var n=(this.constructor.PARAMETERS||{})[e];if(n){var i=lk(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=ax(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 dx(this,e,t,n)}},{key:"initialize",value:function(e){}},{key:"_createHandle",value:function(){throw new Error(fx)}},{key:"_deleteHandle",value:function(){throw new Error(fx)}},{key:"_bindHandle",value:function(e){throw new Error(fx)}},{key:"_getOptsFromHandle",value:function(){throw new Error(fx)}},{key:"_getParameter",value:function(e,t){throw new Error(fx)}},{key:"_setParameter",value:function(e,t){throw new Error(fx)}},{key:"_context",value:function(){return this.gl.luma=this.gl.luma||{},this.gl.luma}},{key:"_addStats",value:function(){var e=this[Symbol.toStringTag],t=rx.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[Symbol.toStringTag];rx.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[Symbol.toStringTag],n=rx.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[Symbol.toStringTag],t=rx.get("Memory Usage");t.get("GPU Memory").subtractCount(this.byteLength),t.get("".concat(e," Memory")).subtractCount(this.byteLength),this.byteLength=0}}]),t}();function vx(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 gx(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 mx(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=yx("Accessor",e,_x)).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 gx(e.type||5126).BYTES_PER_ELEMENT}},{key:"getBytesPerVertex",value:function(e){return ox(e.size),gx(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,i),(t=n.call(this,e,r)).stubRemovedMethods("Buffer","v6.0",["layout","setLayout","getIndexedParameter"]),t.target=r.target||(t.gl.webgl2?36662:34962),t.initialize(r),Object.seal(c(t)),t}return b(i,[{key:t,get:function(){return"Buffer"}},{key:"getElementCount",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.accessor;return Math.round(this.byteLength/wx.getBytesPerElement(e))}},{key:"getVertexCount",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.accessor;return Math.round(this.byteLength/wx.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=yx("Buffer",e,xx),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=yx("Buffer",e,Sx))&&this.setAccessor(e.accessor),this}},{key:"setAccessor",value:function(e){return delete(e=Object.assign({},e)).buffer,this.accessor=new wx(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;ox(n);var u=this.gl.webgl2?36663:this.target;return this.gl.bindBuffer(u,this.handle),0!==a||void 0!==s?(dk(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 dk(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;dk(this.gl);var c,l,h=gx(this.accessor.type||5126,{clamped:!1}),d=this._getAvailableElementCount(r),f=a;n?c=(l=n.length)-f:l=f+(c=Math.min(d,u||d));var p=Math.min(d,c);return ox((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):(ox(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;ox(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=vx(e);return ox(r),this.setAccessor(new wx(this.accessor,{type:r})),this}},{key:"_setByteLength",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.usage;ox(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/gx(this.accessor.type||5126,{clamped:!1}).BYTES_PER_ELEMENT;return this.getElementCount()-t}},{key:"_inferType",value:function(e){this.accessor.type||this.setAccessor(new wx(this.accessor,{type:vx(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 sk.deprecated("Buffer.type","Buffer.accessor.type")(),this.accessor.type}},{key:"bytes",get:function(){return sk.deprecated("Buffer.bytes","Buffer.byteLength")(),this.byteLength}},{key:"setByteLength",value:function(e){return sk.deprecated("setByteLength","reallocate")(),this.reallocate(e)}},{key:"updateAccessor",value:function(e){return sk.deprecated("updateAccessor(...)","setAccessor(new Accessor(buffer.accessor, ...)")(),this.accessor=new wx(this.accessor,e),this}}]),i}(px,Symbol.toStringTag),Ex={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}},Ox={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},Tx={5126:4,5125:4,5124:4,5123:2,5122:2,5131:2,5120:1,5121:1},Px=[9729,9728],Ax=globalThis.WebGLBuffer||function(){},Mx=function(e,n){a(r,e);var i=s(r);function r(e,t){var n;m(this,r);var o=t.id,a=void 0===o?cx("texture"):o,s=t.handle,u=t.target;return(n=i.call(this,e,{id:a,handle:s})).target=u,n.textureUnit=void 0,n.loaded=!1,n.width=void 0,n.height=void 0,n.depth=void 0,n.format=void 0,n.type=void 0,n.dataFormat=void 0,n.border=void 0,n.textureUnit=void 0,n.mipmaps=void 0,n}return b(r,[{key:n,get:function(){return"Texture"}},{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()?(sk.warn("texture: ".concat(this," is Non-Power-Of-Two, disabling mipmaping"))(),this):(this.mipmaps=!0,this.gl.bindTexture(this.target,this.handle),Hk(this.gl,t,function(){e.gl.generateMipmap(e.target)}),this.gl.bindTexture(this.target,null),this)}},{key:"setImageData",value:function(e){var n;this._trackDeallocatedMemory("Texture");var i=e.target,r=void 0===i?this.target:i,o=e.pixels,a=void 0===o?null:o,s=e.level,u=void 0===s?0:s,c=e.format,l=void 0===c?this.format:c,h=e.border,d=void 0===h?this.border:h,f=e.offset,p=void 0===f?0:f,v=e.parameters,g=void 0===v?{}:v,m=e.data,y=void 0===m?null:m,b=e.type,w=void 0===b?this.type:b,k=e.width,x=void 0===k?this.width:k,S=e.height,C=void 0===S?this.height:S,E=e.dataFormat,O=void 0===E?this.dataFormat:E,T=e.compressed,P=void 0!==T&&T;y||(y=a),n=this._deduceParameters({format:l,type:w,dataFormat:O,compressed:P,data:y,width:x,height:C}),w=n.type,O=n.dataFormat,P=n.compressed,x=n.width,C=n.height;var A=this.gl;A.bindTexture(this.target,this.handle);var M,I=this._getDataType({data:y,compressed:P});y=I.data,M=I.dataType;var R,D=0;return Hk(this.gl,g,function(){switch(M){case"null":A.texImage2D(r,u,l,x,C,d,O,w,y);break;case"typed-array":A.texImage2D(r,u,l,x,C,d,O,w,y,p);break;case"buffer":(R=dk(A)).bindBuffer(35052,y.handle||y),R.texImage2D(r,u,l,x,C,d,O,w,p),R.bindBuffer(35052,null);break;case"browser-object":lk(A)?A.texImage2D(r,u,l,x,C,d,O,w,y):A.texImage2D(r,u,l,O,w,y);break;case"compressed":var e,n=_(y.entries());try{for(n.s();!(e=n.n()).done;){var i=t(e.value,2),o=i[0],a=i[1];A.compressedTexImage2D(r,o,a.format,a.width,a.height,d,a.data),D+=a.levelSize}}catch(s){n.e(s)}finally{n.f()}break;default:ox(!1,"Unknown image data type")}}),this._trackAllocatedMemory("compressed"===M?D:y&&y.byteLength?y.byteLength:this.width*this.height*(Ox[this.dataFormat]||4)*(Tx[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,d=void 0===h?0:h,f=e.width,p=void 0===f?this.width:f,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,C=e.compressed,E=void 0!==C&&C,O=e.offset,T=void 0===O?0:O,P=e.border,A=(void 0===P&&this.border,e.parameters),M=void 0===A?{}:A;if(t=this._deduceParameters({format:_,type:k,dataFormat:S,compressed:E,data:u,width:p,height:g}),k=t.type,S=t.dataFormat,E=t.compressed,p=t.width,g=t.height,ox(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),Hk(this.gl,M,function(){if(E)n.gl.compressedTexSubImage2D(r,y,l,d,p,g,_,u);else if(null===u)n.gl.texSubImage2D(r,y,l,d,p,g,S,k,null);else if(ArrayBuffer.isView(u))n.gl.texSubImage2D(r,y,l,d,p,g,S,k,u,T);else if(u instanceof Ax){var e=dk(n.gl);e.bindBuffer(35052,u),e.texSubImage2D(r,y,l,d,p,g,S,k,T),e.bindBuffer(35052,null)}else lk(n.gl)?dk(n.gl).texSubImage2D(r,y,l,d,p,g,S,k,u):n.gl.texSubImage2D(r,y,l,d,S,k,u)}),this.gl.bindTexture(this.target,null)}},{key:"copyFramebuffer",value:function(){return sk.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 Ax?{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=Ex[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 ox(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"),ox(void 0===t||i.width===t,"Deduced texture width does not match supplied width"),ox(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:ox(!1);break;default:this.gl.texParameteri(this.target,e,t)}return this.gl.bindTexture(this.target,null),this}},{key:"_isNPOT",value:function(){return!(lk(this.gl)||!this.width||!this.height||lx(this.width)&&lx(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===Px.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=Ex[t];if(!n)return!1;if(void 0===n.gl1&&void 0===n.gl2)return!0;var i=lk(e)&&n.gl2||n.gl1;return"string"==typeof i?e.getExtension(i):i}(e,n))&&(!i||function(e,t){var n=Ex[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}}]),r}(px,Symbol.toStringTag);function Ix(e,t){return ox("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 Rx=function(e,t){a(i,e);var n=s(i);function i(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return m(this,i),hk(e),(r instanceof Promise||"string"==typeof r)&&(r={data:r}),"string"==typeof r.data&&(r=Object.assign({},r,{data:Ix(r.data)})),(t=n.call(this,e,Object.assign({},r,{target:3553}))).initialize(r),Object.seal(c(t)),t}return b(i,[{key:t,get:function(){return"Texture2D"}}],[{key:"isSupported",value:function(e,t){return Mx.isSupported(e,t)}}]),i}(Mx,Symbol.toStringTag),Dx="EXT_color_buffer_float",Nx={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:Dx,bpp:2},33327:{gl2:Dx,bpp:4},34842:{gl2:Dx,bpp:8},33326:{gl2:Dx,bpp:4},33328:{gl2:Dx,bpp:8},34836:{gl2:Dx,bpp:16},35898:{gl2:Dx,bpp:4}},Lx=function(e,t){a(i,e);var n=s(i);function i(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return m(this,i),(t=n.call(this,e,r)).initialize(r),Object.seal(c(t)),t}return b(i,[{key:t,get:function(){return"Renderbuffer"}},{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 ox(t,"Needs format"),this._trackDeallocatedMemory(),this.gl.bindRenderbuffer(36161,this.handle),0!==s&&lk(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)*Nx[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=lk(e)&&i.gl2||i.gl1;return"string"==typeof r?e.getExtension(r):r}(e,n,Nx)}},{key:"getSamplesForFormat",value:function(e,t){var n=t.format;return e.getInternalformatParameter(36161,n,32937)}}]),i}(px,Symbol.toStringTag),jx="clear: bad arguments";function Fx(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)),ox(0!==h,jx),Hk(e,l,function(){e.clear(h)})}function Bx(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 Vx(e){return function(){var t=this,n=arguments;return new Promise(function(i,r){var o=e.apply(t,n);function a(e){Bx(o,i,r,a,s,"next",e)}function s(e){Bx(o,i,r,a,s,"throw",e)}a(void 0)})}}var zx=[34069,34070,34071,34072,34073,34074],Ux=function(){var e=function(e,t){a(i,e);var n=s(i);function i(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return m(this,i),hk(e),(t=n.call(this,e,Object.assign({},r,{target:34067}))).initialize(r),Object.seal(c(t)),t}return b(i,[{key:t,get:function(){return"TextureCube"}},{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 Vx(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(zx.map(function(e){var t=s[e];return Promise.all(Array.isArray(t)?t:[t])}));case 4:c=e.sent,h.bind(),zx.forEach(function(e,i){c[i].length>1&&!1!==h.opts.mipmaps&&sk.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,d=void 0===h?5121:h,f=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?f.texImage2D(n,0,l,i,r,u,l,d,p):f.texImage2D(n,0,l,l,d,p),this}}]),i}(Mx,Symbol.toStringTag);return e.FACES=zx,e}(),Hx=function(e,t){a(i,e);var n=s(i);function i(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return m(this,i),dk(e),(t=n.call(this,e,r=Object.assign({depth:1},r,{target:32879,unpackFlipY:!1}))).initialize(r),Object.seal(c(t)),t}return b(i,[{key:t,get:function(){return"Texture3D"}},{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,d=e.format,f=e.type,p=void 0===f?5121:f,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),Hk(this.gl,b,function(){ArrayBuffer.isView(m)&&t.gl.texImage3D(t.target,i,o,a,s,c,h,d,p,m),m instanceof Cx&&(t.gl.bindBuffer(35052,m.handle),t.gl.texImage3D(t.target,i,o,a,s,c,h,d,p,g))}),this._trackAllocatedMemory(m&&m.byteLength?m.byteLength:this.width*this.height*this.depth*(Ox[this.dataFormat]||4)*(Tx[this.type]||1),"Texture"),this.loaded=!0,this}}],[{key:"isSupported",value:function(e){return lk(e)}}]),i}(Mx,Symbol.toStringTag);function Gx(e,t){ox(e instanceof Rx||e instanceof Ux||e instanceof Hx);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},t))}function Wx(e,t){var n=e.gl,i=e.width,r=e.height,o=e.id;return new $x(n,Object.assign({},t,{id:"framebuffer-for-".concat(o),width:i,height:r,attachments:{36064:e}}))}function qx(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,d=t.sourceWidth,f=t.sourceHeight,p=t.sourceType,v=Yx(e),g=v.framebuffer,m=v.deleteFramebuffer;ox(g);var y=g.gl,b=g.handle,_=g.attachments;d=d||g.width,f=f||g.height,36064===c&&null===b&&(c=1028),ox(_[c]),h=function(e,t,n,i,r){return e||new(gx(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 ox(!1),0}}(n))}(h,p=p||_[c].type,s,d,f),p=p||vx(h);var w=y.bindFramebuffer(36160,b);return y.readPixels(i,o,d,f,s,p,h),y.bindFramebuffer(36160,w||null),m&&g.delete(),h}function Xx(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=qx(e,{sourceAttachment:i}),s=e.width,u=e.height;u>o;){var c=mx({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,o),(t=r.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(o,[{key:i,get:function(){return"Framebuffer"}},{key:"MAX_COLOR_ATTACHMENTS",get:function(){var e=dk(this.gl);return e.getParameter(e.MAX_COLOR_ATTACHMENTS)}},{key:"MAX_DRAW_BUFFERS",get:function(){var e=dk(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,d=void 0!==h&&h,f=e.check,p=void 0===f||f,v=e.readBuffer,g=e.drawBuffers;if(ox(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,d,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(o.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 ox(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&&sk.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){ox(void 0!==l,"Misspelled framebuffer binding point?");var h=Number(l),d=u[h],f=d;if(f)if(f instanceof Lx)this._attachRenderbuffer({attachment:h,renderbuffer:f});else if(Array.isArray(d)){var p=t(d,3),v=p[0],g=p[1],m=void 0===g?0:g,y=p[2],b=void 0===y?0:y;f=v,this._attachTexture({attachment:h,texture:v,layer:m,level:b})}else this._attachTexture({attachment:h,texture:f,layer:0,level:0});else this._unattach(h);s&&f&&f.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(o.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)&&Fx(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;dk(e),Hk(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:ox(!1,jx)}})}(e.gl,{drawBuffer:i,value:n})}),this.gl.bindFramebuffer(36160,u||null),this}},{key:"readPixels",value:function(){return sk.error("Framebuffer.readPixels() is no logner supported, use readPixelsToArray(framebuffer)")(),null}},{key:"readPixelsToBuffer",value:function(){return sk.error("Framebuffer.readPixelsToBuffer()is no logner supported, use readPixelsToBuffer(framebuffer)")(),null}},{key:"copyToDataUrl",value:function(){return sk.error("Framebuffer.copyToDataUrl() is no logner supported, use copyToDataUrl(framebuffer)")(),null}},{key:"copyToImage",value:function(){return sk.error("Framebuffer.copyToImage() is no logner supported, use copyToImage(framebuffer)")(),null}},{key:"copyToTexture",value:function(){return sk.error("Framebuffer.copyToTexture({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null}},{key:"blit",value:function(){return sk.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=dk(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=sx(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?sx(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>sk.level||"undefined"==typeof window)return this;t=t||"Framebuffer ".concat(this.id);var n=Xx(this,{targetMaxHeight:100});return sk.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 Rx(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 Lx(this.gl,{id:"".concat(this.id,"-depth-stencil"),format:35056,width:i,height:111}),this.ownResources.push(o[33306])):t?((o=o||{})[36096]=new Lx(this.gl,{id:"".concat(this.id,"-depth"),format:33189,width:i,height:r}),this.ownResources.push(o[36096])):n&&ox(!1),o}},{key:"_unattach",value:function(e){var t=this.attachments[e];!t||(t instanceof Lx?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:dk(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:ox(!1,"Illegal texture type")}a.bindTexture(i.target,null),this.attachments[n]=i}},{key:"_setReadBuffer",value:function(e){var t=function(e){return lk(e)?e:null}(this.gl);t?t.readBuffer(e):ox(36064===e||1029===e,Kx),this.readBuffer=e}},{key:"_setDrawBuffers",value:function(e){var t=this.gl,n=dk(t);if(n)n.drawBuffers(e);else{var i=t.getExtension("WEBGL_draw_buffers");i?i.drawBuffersWEBGL(e):ox(1===e.length&&(36064===e[0]||1029===e[0]),Kx)}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||{},Qx)void 0===e.luma.caps[t]&&(e.luma.caps[t]=eS(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 o(e,{id:"default-framebuffer",handle:null,attachments:{}}),e.luma.defaultFramebuffer}}]),o}(px,Symbol.toStringTag);$x.ATTACHMENT_PARAMETERS=[36049,36048,33296,33298,33299,33300,33301,33302,33303];var Qx={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 Rx(e,{format:6408,type:5126,dataFormat:6408}),n=new $x(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 Zx(e,t){return Jx(e,t)}function Jx(e,t){return(t=Array.isArray(t)?t:[t]).every(function(t){return eS(e,t)})}function eS(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=Qx[t];ox(i,t);var r=lk(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:ox(!1);return n}(e,t)),e.luma.caps[t]||sk.log(2,"Feature: ".concat(t," not supported"))(),e.luma.caps[t]}var tS=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}()),iS=1/Math.PI*180,rS=1/180*Math.PI,oS={};function aS(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.precision,i=void 0===n?oS.precision||4:n;return e=function(e){return Math.round(e/oS.EPSILON)*oS.EPSILON}(e),"".concat(parseFloat(e.toPrecision(i)))}function sS(e){return Array.isArray(e)||ArrayBuffer.isView(e)&&!(e instanceof DataView)}function uS(e,t,n){if(sS(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?", ":"")+aS(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(oS.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&&sS(i)?e.copy(i):(oS.debug&&(gS(i),gS(r),gS(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 oS.debug&&(gS(e.x),gS(e.y),gS(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]=gS(e)}},{key:"angle",value:function(e){return RS(this,e)}},{key:"cross",value:function(e){return ES(this,this,e),this.check()}},{key:"rotateX",value:function(e){var t=e.radians,n=e.origin;return AS(this,this,void 0===n?LS:n,t),this.check()}},{key:"rotateY",value:function(e){var t=e.radians,n=e.origin;return MS(this,this,void 0===n?LS:n,t),this.check()}},{key:"rotateZ",value:function(e){var t=e.radians,n=e.origin;return IS(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 OS(this,this,e),this.check()}},{key:"transformAsVector",value:function(e){return DS(this,this,e),this.check()}},{key:"transformByMatrix3",value:function(e){return TS(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 PS(this,this,e),this.check()}}],[{key:"ZERO",get:function(){return jS.ZERO=jS.ZERO||Object.freeze(new n(0,0,0,0))}}]),n}(_S),BS=new FS;function VS(e,t,n,i){BS.set(e,t,n);var r=BS.len();return{distance:i/r,normal:new FS(-e/r,-t/r,-n/r)}}function zS(e){return e-Math.fround(e)}function US(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;NS=nS.allocate(NS,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=qS,r={index:-1,data:e,target:[]};return e?"function"==typeof e[Symbol.iterator]?i=e:e.length>0&&(XS.length=e.length,i=XS):i=qS,(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 KS(e){return e&&e[Symbol.asyncIterator]}function $S(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){return!0};return Array.isArray(e)?QS(e,t,[]):t(e)?[e]:[]}function QS(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=f)){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(f);(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 tC({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,d=void 0===h?null:h,f=n.transform,p=void 0===f?null:f,v=n.startIndices,g=void 0===v?null:v;return Object.assign(t.settings,{transition:a,noAlloc:u,update:l||d&&t._autoUpdater,accessor:d,transform:p}),Object.assign(t.state,{lastExternalBuffer:null,binaryValue:null,binaryAccessor:null,needsUpdate:!0,needsRedraw:!1,updateRanges:eC,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 iC(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===eC||(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=eC}},{key:"clearNeedsUpdate",value:function(){this.state.needsUpdate=!1,this.state.updateRanges=JS}},{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!==eC}),!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,d=!0;if(l){var f,v=_(u);try{for(v.s();!(f=v.n()).done;){var g=t(f.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?(WS(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,d=0;dl?c.set(x,g):(e._normalizeValue(x,b.target,0),ZS({target:c,source:b.target,start:g,count:S}));g+=S*l}else e._normalizeValue(x,c,g),g+=l}}catch(P){w.e(P)}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&&Zx(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*HS(e):0}},{key:"delete",value:function(){this._buffer&&(this._buffer.delete(),this._buffer=null),nS.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=GS(e,t);return{high:n,low:I(M({},n),{offset:n.offset+4*e.size})}}(this.getAccessor(),t||{});return n[e]=new tS(this,r.high),n["".concat(e,"64Low")]=i?new tS(this,r.low):new Float32Array(this.size),n}if(t){var a=GS(this.getAccessor(),t);return o({},e,new tS(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=HS(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=HS(n);var s=this.buffer,u=this.byteOffset;this.doublePrecision&&a instanceof Float64Array&&(a=US(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?US(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=nS.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&&lC[e]&&(t=lC[e]).call.apply(t,arguments)}function dC(e,t){if(!e)throw new Error(t||"shadertools: assertion failed.")}var fC="out vec4 transform_output;\nvoid main() {\n transform_output = vec4(0);\n}",pC="#version 300 es\n".concat(fC);function vC(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 gC(){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?pC:n>300?"#version ".concat(n,"\n").concat(fC):"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 dC(!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 mC=function(e,t){a(i,e);var n=s(i);function i(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return m(this,i),dk(e),(t=n.call(this,e,r)).initialize(r),t.stubRemovedMethods("TransformFeedback","v6.0",["pause","resume"]),Object.seal(c(t)),t}return b(i,[{key:t,get:function(){return"TransformFeedback"}},{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,hx(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,sk.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 lk(e)}}]),i}(px,Symbol.toStringTag),yC=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&&ox(lk(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 mC(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],ox(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 bC(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 _C="vs",wC=(o(f={},_C,"#ifdef MODULE_LOGDEPTH\n logdepth_adjustPosition(gl_Position);\n#endif\n"),o(f,"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"),f),kC="__LUMA_INJECT_DECLARATIONS__",xC=/void\s+main\s*\([^)]*\)\s*\{\n?/,SC=/}\n?[^{}]*$/,CC=[];function EC(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=t===_C,o=function(t){var i=n[t];i.sort(function(e,t){return e.order-t.order}),CC.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 TC={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},PC="transform_uSize_",AC="transform_position",MC={10241:9728,10240:9728,10242:33071,10243:33071},IC=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(PC).concat(o)]=[n,i]),r){var c;n=(c=r[u]).width,i=c.height,s["".concat(PC).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=qx(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 dC(!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 Rx)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 $x(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(MC)}},{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=Gx(e,{parameters:{10241:9728,10240:9728,10242:33071,10243:33071},pixelStore:{37440:!1}});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 vC(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(PC).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 dC(!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,d=u.inject;h[t]=l,c=OC([c,d]),Object.assign(s,u.samplerTextureMap),o--}}i&&!a&&(a=function(e,t){var n=vC(e,["varying","out"]);return n&&n.name===t?n.type:null}(e,i))}),i){ox(r);var d="".concat(PC).concat(i);c=OC([c,{"vs:#decl":"uniform vec2 ".concat(d,";\n"),"vs:#main-start":" vec2 ".concat(AC," = transform_getPos(").concat(d,");\n gl_Position = vec4(").concat(AC,", 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=OC([e.inject||{},u]);return this.targetTextureType=s,this.samplerTextureMap=c,{vs:o,fs:e._fs||gC({version:bC(o),input:this.targetTextureVarying,inputType:s,output:"transform_output"}),modules:this.hasSourceTextures||this.targetTextureVarying?[TC].concat(e.modules||[]):e.modules,uniforms:a,inject:l}}}]),e}(),RC={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 DC(e){var t=NC(e);return"object"===t?e?"type"in e?Object.assign({},e,RC[e.type]):"value"in e?(t=NC(e.value),Object.assign({type:t},e,RC[t])):{type:"object",value:e}:{type:"object",value:null}:Object.assign({type:t,value:e},RC[t])}function NC(e){return Array.isArray(e)||ArrayBuffer.isView(e)?"array":typeof e}var LC=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,d=void 0===h?{}:h,f=t.inject,p=void 0===f?{}:f,v=t.vertexShader,g=t.fragmentShader;m(this,e),dC("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=d,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=DC(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:dC(!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&&dC(r.validate(e[i],r),"".concat(this.name,": invalid ").concat(i)),t[i]=e[i]):t[i]=r.value}return t}}]),e}();function jC(e){return function(e){var t={},n={};return FC({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]})}(BC(e))}function FC(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=VC[t];if(dC(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 HC)return HC[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),HC[t]=a,a}function WC(e,t){return(t=Array.isArray(t)?t:[t]).every(function(t){return function(e,t){var n=VC[t];dC(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 dC(!1===r||!0===r),r}(e,t)})}function qC(e){return new RegExp("\\b".concat(e,"[ \\t]+(\\w+[ \\t]+\\w+(\\[\\w+\\])?;)"),"g")}var XC=[[/^(#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("]],YC=[].concat(XC,[[qC("attribute"),"in $1"],[qC("varying"),"out $1"]]),KC=[].concat(XC,[[qC("varying"),"in $1"]]),$C=[[/^#version[ \t]+300[ \t]+es/,"#version 100"],[/\btexture(2D|2DProj|Cube)Lod\(/g,"texture$1LodEXT("],[/\btexture\(/g,"texture2D("],[/\btextureLod\(/g,"texture2DLodEXT("]],QC=[].concat($C,[[qC("in"),"attribute $1"],[qC("out"),"varying $1"]]),ZC=[].concat($C,[[qC("in"),"varying $1"]]),JC="gl_FragColor",eE=/\bout[ \t]+vec4[ \t]+(\w+)[ \t]*;\n?/,tE=/void\s+main\s*\([^)]*\)\s*\{\n?/;function nE(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 iE="\n\n".concat(kC,"\n\n"),rE=(o(g={},_C,"vertex"),o(g,"fs","fragment"),g);function oE(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,d=void 0===h?{}:h,f=n.transpileToGLSL100,p=void 0!==f&&f,v=n.prologue,g=void 0===v||v,m=n.log;dC("string"==typeof r,"shader source must be a string");var y=o===_C,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 C,E=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(rE[n],"\n\n"):""}({id:i,source:r,type:o}),"\n").concat((C={type:o},"\n#define SHADER_TYPE_".concat(rE[C.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:UC(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// 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"}}(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 WC(e,zC.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"),WC(e,zC.GLSL_DERIVATIVES)&&GC(e,zC.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"),WC(e,zC.GLSL_FRAG_DATA)&&GC(e,zC.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"),WC(e,zC.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={},P={},A={};for(var M in d){var I="string"==typeof d[M]?{injection:d[M],order:0}:d[M],R=M.match(/^(v|f)s:(#)?([\w-]+)$/);if(R){var D=R[3];R[2]?"decl"===D?P[M]=[I]:A[M]=[I]:T[M]=[I]}else A[M]=[I]}var N,L=_(a);try{for(L.s();!(N=L.n()).done;){var j=N.value;m&&j.checkDeprecations(x,m),E+=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]?P:A;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 E=EC(E+=iE,o,P),E+=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),E=function(e,t,n){switch(t){case 300:return n?nE(e,YC):function(e){var t=(e=nE(e,KC)).match(eE);if(t){var n=t[1];e=e.replace(new RegExp("\\b".concat(JC,"\\b"),"g"),n)}else{var i="fragmentColor";e=e.replace(tE,function(e){return"out vec4 ".concat(i,";\n").concat(e)}).replace(new RegExp("\\b".concat(JC,"\\b"),"g"),i)}return e}(e);case 100:return n?nE(e,QC):function(e){var t=(e=nE(e,ZC)).match(eE);if(t){var n=t[1];e=e.replace(eE,"").replace(new RegExp("\\b".concat(n,"\\b"),"g"),JC)}return e}(e);default:throw new Error("unknown GLSL version ".concat(t))}}(E=EC(E+=x,o,A),p?100:w,y)}function aE(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 sE=(o(y={5126:wE.bind(null,"uniform1fv",fE,1,kE),35664:wE.bind(null,"uniform2fv",fE,2,kE),35665:wE.bind(null,"uniform3fv",fE,3,kE),35666:wE.bind(null,"uniform4fv",fE,4,kE),5124:wE.bind(null,"uniform1iv",pE,1,kE),35667:wE.bind(null,"uniform2iv",pE,2,kE),35668:wE.bind(null,"uniform3iv",pE,3,kE),35669:wE.bind(null,"uniform4iv",pE,4,kE),35670:wE.bind(null,"uniform1iv",pE,1,kE),35671:wE.bind(null,"uniform2iv",pE,2,kE),35672:wE.bind(null,"uniform3iv",pE,3,kE),35673:wE.bind(null,"uniform4iv",pE,4,kE),35674:wE.bind(null,"uniformMatrix2fv",fE,4,xE),35675:wE.bind(null,"uniformMatrix3fv",fE,9,xE),35676:wE.bind(null,"uniformMatrix4fv",fE,16,xE),35678:_E,35680:_E,5125:wE.bind(null,"uniform1uiv",vE,1,kE),36294:wE.bind(null,"uniform2uiv",vE,2,kE),36295:wE.bind(null,"uniform3uiv",vE,3,kE),36296:wE.bind(null,"uniform4uiv",vE,4,kE),35685:wE.bind(null,"uniformMatrix2x3fv",fE,6,xE),35686:wE.bind(null,"uniformMatrix2x4fv",fE,8,xE),35687:wE.bind(null,"uniformMatrix3x2fv",fE,6,xE),35688:wE.bind(null,"uniformMatrix3x4fv",fE,12,xE),35689:wE.bind(null,"uniformMatrix4x2fv",fE,8,xE),35690:wE.bind(null,"uniformMatrix4x3fv",fE,12,xE)},"35678",_E),o(y,"35680",_E),o(y,35679,_E),o(y,35682,_E),o(y,36289,_E),o(y,36292,_E),o(y,36293,_E),o(y,36298,_E),o(y,36299,_E),o(y,36300,_E),o(y,36303,_E),o(y,36306,_E),o(y,36307,_E),o(y,36308,_E),o(y,36311,_E),y),uE={},cE={},lE={},hE=[0];function dE(e,t,n,i){1===t&&"boolean"==typeof e&&(e=e?1:0),Number.isFinite(e)&&(hE[0]=e,e=hE);var r=e.length;if(r%t&&sk.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 CE(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||SE(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 EE(o,r-o.length)+n+e})}(t);return{shaderName:u,errors:CE(o,p),warnings:CE(a,p)}}(t,this.source,this.shaderType,this.id),i=n.shaderName,r=n.errors,o=n.warnings;throw sk.error("GLSL compilation errors in ".concat(i,"\n").concat(r))(),sk.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 ox(!1),"unknown"}}}]),i}(px,Symbol.toStringTag),TE=function(e,t){a(i,e);var n=s(i);function i(e,t){return m(this,i),"string"==typeof t&&(t={source:t}),n.call(this,e,Object.assign({},t,{shaderType:35633}))}return b(i,[{key:t,get:function(){return"VertexShader"}},{key:"_createHandle",value:function(){return this.gl.createShader(35633)}}]),i}(OE,Symbol.toStringTag),PE=function(e,t){a(i,e);var n=s(i);function i(e,t){return m(this,i),"string"==typeof t&&(t={source:t}),n.call(this,e,Object.assign({},t,{shaderType:35632}))}return b(i,[{key:t,get:function(){return"FragmentShader"}},{key:"_createHandle",value:function(){return this.gl.createShader(35632)}}]),i}(OE,Symbol.toStringTag),AE=5126,ME=5124,IE=5125,RE=(o(w={},AE,[AE,1,"float"]),o(w,35664,[AE,2,"vec2"]),o(w,35665,[AE,3,"vec3"]),o(w,35666,[AE,4,"vec4"]),o(w,ME,[ME,1,"int"]),o(w,35667,[ME,2,"ivec2"]),o(w,35668,[ME,3,"ivec3"]),o(w,35669,[ME,4,"ivec4"]),o(w,IE,[IE,1,"uint"]),o(w,36294,[IE,2,"uvec2"]),o(w,36295,[IE,3,"uvec3"]),o(w,36296,[IE,4,"uvec4"]),o(w,35670,[AE,1,"bool"]),o(w,35671,[AE,2,"bvec2"]),o(w,35672,[AE,3,"bvec3"]),o(w,35673,[AE,4,"bvec4"]),o(w,35674,[AE,8,"mat2"]),o(w,35685,[AE,8,"mat2x3"]),o(w,35686,[AE,8,"mat2x4"]),o(w,35675,[AE,12,"mat3"]),o(w,35687,[AE,12,"mat3x2"]),o(w,35688,[AE,12,"mat3x4"]),o(w,35676,[AE,16,"mat4"]),o(w,35689,[AE,16,"mat4x2"]),o(w,35690,[AE,16,"mat4x3"]),w);function DE(e){var n=RE[e];if(!n)return null;var i=t(n,2);return{type:i[0],components:i[1]}}function NE(e,n){switch(e){case 5120:case 5121:case 5122:case 5123:e=AE}for(var i in RE){var r=t(RE[i],3),o=r[0],a=r[1],s=r[2];if(o===e&&a===n)return{glType:i,name:s}}return null}var LE=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(lk(t)){for(var n=t.getProgramParameter(e.handle,35971),i=0;i1&&void 0!==arguments[1]?arguments[1]:{};return m(this,r),(t=i.call(this,e,n)).stubRemovedMethods("Program","v6.0",jE),t._isCached=!1,t.initialize(n),Object.seal(c(t)),t._setId(n.id),t}return b(r,[{key:n,get:function(){return"Program"}},{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 TE(this.gl,{id:"".concat(e.id,"-vs"),source:n}):n,this.fs="string"==typeof i?new PE(this.gl,{id:"".concat(e.id,"-fs"),source:i}):i,ox(this.vs instanceof TE),ox(this.fs instanceof PE),this.uniforms={},this._textureUniforms={},r&&r.length>0&&(dk(this.gl),this.varyings=r,this.gl2.transformFeedbackVaryings(this.handle,r,a)),this._compileAndLink(),this._readUniformLocationsFromLinkedProgram(),this.configuration=new LE(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(r.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,d=e.indexType,f=void 0===d?5123:d,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,C=e.samplers;if((S||C)&&(sk.deprecated("Program.draw({uniforms})","Program.setUniforms(uniforms)")(),this.setUniforms(S||{})),sk.priority>=n){var E=w?w.id:"default",O="mode=".concat(sx(this.gl,r)," verts=").concat(o," instances=").concat(v," indexType=").concat(sx(this.gl,f)," isInstanced=").concat(m," isIndexed=").concat(h," Framebuffer=").concat(E);sk.log(n,O)()}return ox(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 ox(!1),0}}(r);_.begin(e)}t._bindTextures(),Hk(t.gl,x,function(){h&&m?t.gl2.drawElementsInstanced(r,o,f,s,v):h&&lk(t.gl)&&!isNaN(u)&&!isNaN(c)?t.gl2.drawRangeElements(r,u,c,o,f,s):h?t.gl.drawElements(r,o,f,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 sk.priority>=2&&function(e,t,n){for(var i in e){var r=e[i];if((!n||Boolean(n[i]))&&!yE(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 $x&&(r=r.texture),r instanceof Mx)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)&&bE(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 TE({handle:r});break;case 35632:n.fs=new PE({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=cx(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),sk.time(4,"linkProgram for ".concat(this._getName()))(),e.linkProgram(this.handle),sk.timeEnd(4,"linkProgram for ".concat(this._getName()))(),e.debug||sk.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,d=void 0===h?[]:h,f=n.bufferMode,p=void 0===f?35981:f,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=d.map(function(e){return t._getHash(e)}),x=Object.keys(u).sort(),S=Object.keys(l).sort(),C=[],E=[],O=_(x);try{for(O.s();!(e=O.n()).done;){var T=e.value;C.push(this._getHash(T)),C.push(this._getHash(u[T]))}}catch(D){O.e(D)}finally{O.f()}var P,A=_(S);try{for(A.s();!(P=A.n()).done;){var M=P.value;E.push(this._getHash(M)),E.push(this._getHash(l[M]))}}catch(D){A.e(D)}finally{A.f()}var I="".concat(y,"/").concat(b,"D").concat(C.join("/"),"M").concat(w.join("/"),"I").concat(E.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=jC(t.modules||[]);return{gl:e,vs:oE(e,Object.assign({},t,{source:n,type:_C,modules:r})),fs:oE(e,Object.assign({},t,{source:i,type:"fs",modules:r})),getUniforms:aE(r)}}(this.gl,{vs:r,fs:a,modules:m,inject:l,defines:u,hookFunctions:this._hookFunctions,transpileToGLSL100:g});this._programCache[I]=new FE(this.gl,{hash:I,vs:R.vs,fs:R.fs,varyings:d,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,r),(t=i.call(this,e,Object.assign({},n,{id:n.id||n.program&&n.program.id}))).buffer=null,t.bufferValue=null,t.isDefaultArray=n.isDefaultArray||!1,t.gl2=e,t.initialize(n),Object.seal(c(t)),t}return b(r,[{key:n,get:function(){return"VertexArrayObject"}},{key:"delete",value:function(){return e(p(r.prototype),"delete",this).call(this),this.buffer&&this.buffer.delete(),this}},{key:"MAX_ATTRIBUTES",get:function(){return r.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 ox(!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?(ox(lk(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&&!r.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(!VE||VE.byteLength1&&void 0!==arguments[1]?arguments[1]:{};return!t.constantAttributeZero||lk(e)||"Chrome"===function(e){if(!Lw())return"Node";if(Nw(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":Ww.chrome?"Chrome":Ww.safari?"Safari":Ww.mozInnerScreenX?"Firefox":"Unknown"}()}},{key:"getDefaultArray",value:function(e){return e.luma=e.luma||{},e.luma.defaultVertexArray||(e.luma.defaultVertexArray=new r(e,{handle:null,isDefaultArray:!0})),e.luma.defaultVertexArray}},{key:"getMaxAttributes",value:function(e){return r.MAX_ATTRIBUTES=r.MAX_ATTRIBUTES||e.getParameter(34921),r.MAX_ATTRIBUTES}},{key:"setConstant",value:function(e,t,n){switch(n.constructor){case Float32Array:r._setConstantFloatArray(e,t,n);break;case Int32Array:r._setConstantIntArray(e,t,n);break;case Uint32Array:r._setConstantUintArray(e,t,n);break;default:ox(!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:ox(!1)}}},{key:"_setConstantIntArray",value:function(e,t,n){switch(ox(lk(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:ox(!1)}}},{key:"_setConstantUintArray",value:function(e,t,n){switch(ox(lk(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:ox(!1)}}}]),r}(px,Symbol.toStringTag),UE=/^(.+)__LOCATION_([0-9]+)$/,HE=["setBuffers","setGeneric","clearBindings","setLocations","setGenericValues","setDivisor","enable","disable"],GE=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 zE(t),dx(this,"VertexArray","v6.0",HE),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 sk.deprecated("setElements","setElementBuffer")(),this.setElementBuffer(e,t)}}]),e}();function WE(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+=WE(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 qE(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",d=1,f=0,p=0;if(n&&(h=n.type,d=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,f=(p=m.byteLength)/b.BYTES_PER_ELEMENT/d,n?g="".concat(n.divisor>0?"I ":"P "," ").concat(f," (x").concat(d,"=").concat(p," bytes ").concat(sx(s,h),")"):(u=!0,g="".concat(p," bytes")),o(v={},i,"".concat(c).concat(WE(l,{size:d,isInteger:u}))),o(v,"Format ",g),v}return l=t,d=t.length,u=-1!==(h=String(t.constructor.name).replace("Array","")).indexOf("nt"),o(a={},i,"".concat(WE(l,{size:d,isInteger:u})," (constant)")),o(a,"Format ","".concat(d,"x").concat(h," (constant)")),a}function XE(e,t){var n=NE(t.type,t.size);return n?"".concat(e," (").concat(n.name,")"):e}function YE(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;ox(i);var u,c=".*Matrix",l={},h=Object.keys(i._uniformSetters).sort(),d=0,f=_(h);try{for(f.s();!(u=f.n()).done;){var p=u.value;!p.match(".*_.*")&&!p.match(c)&&KE({table:l,header:n,uniforms:r,uniformName:p,undefinedOnly:s})&&d++}}catch(E){f.e(E)}finally{f.f()}var v,g=_(h);try{for(g.s();!(v=g.n()).done;){var m=v.value;m.match(c)&&KE({table:l,header:n,uniforms:r,uniformName:m,undefinedOnly:s})&&d++}}catch(E){g.e(E)}finally{g.f()}var y,b=_(h);try{for(b.s();!(y=b.n()).done;){var w=y.value;l[w]||KE({table:l,header:n,uniforms:r,uniformName:w,undefinedOnly:s})&&d++}}catch(E){b.e(E)}finally{b.f()}var k=0,x={};if(!s)for(var S in r){var C=r[S];l[S]||(k++,x[S]=o({Type:"NOT USED: ".concat(C)},n,WE(C)))}return{table:l,count:d,unusedTable:x,unusedCount:k}}function KE(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?WE(u):"N/A"),o(t,"Uniform Type",c?u:"NOT PROVIDED"),t),0))}function $E(e){var t=e.accessor,n=NE(t.type,t.size);return n?"".concat(n.name," ").concat(e.name):e.name}var QE={POSITION:"positions",NORMAL:"normals",COLOR_0:"colors",TEXCOORD_0:"texCoords",TEXCOORD_1:"texCoords1",TEXCOORD_2:"texCoords2"};function ZE(e,t){var n=(t||{}).attributeMap,i=void 0===n?QE:n;return i&&i[e]||e}function JE(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}ox(Number.isFinite(t.size),"attribute ".concat(e," needs size"))}var eO=function(){},tO={},nO=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?cx("model"):i;ox(ck(t)),this.id=r,this.gl=t,this.id=n.id||cx("Model"),this.lastLogTime=0,this.animated=!1,this.initialize(n)}return b(e,[{key:"initialize",value:function(e){this.props={},this.programManager=e.programManager||BE.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={},ox(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 ox(Number.isFinite(e)),this.vertexCount=e,this}},{key:"setInstanceCount",value:function(e){return ox(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=ZE(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],JE(o,c)}}if(r){var l=r.value||r;ox(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(hx(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 Fx(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,d=void 0===h?{}:h,f=e.vertexArray,p=void 0===f?this.vertexArray:f;this.setAttributes(u),this.updateModuleSettings(i),this.setUniforms(a),sk.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&&sk.warn("Found instanced attributes on non-instanced model",this.id)();var C=this.isInstanced,E=this.instanceCount,O=this.props,T=O.onBeforeRender,P=void 0===T?eO:T,A=O.onAfterRender,M=void 0===A?eO:A;P(),this.program.setUniforms(this.uniforms);var I=this.program.draw(Object.assign(tO,e,{logPriority:t,uniforms:null,framebuffer:r,parameters:d,drawMode:this.getDrawMode(),vertexCount:this.getVertexCount(),vertexArray:p,transformFeedback:l,isIndexed:y,indexType:_,isInstanced:C,instanceCount:E,offset:y?k:0}));return M(),sk.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 sk.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}ox(e instanceof FE,"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 GE(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&&ox(e,"Model.draw(): animated uniforms but no animationProps")}},{key:"_setFeedbackBuffers",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(hx(e))return this;var t=this.program.gl;return this.transformFeedback=this.transformFeedback||new mC(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:sk.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=qE(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(XE(s.name,c))),r[u]=qE(t,o[a],c,i)}}return r}({vertexArray:t,header:"".concat(this.id," attributes"),attributes:this._attributes}),a=YE({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=YE({header:"".concat(this.id," uniforms"),program:this.program,uniforms:Object.assign({},this.program.uniforms,n),undefinedOnly:!0}),h=l.table;l.count>0&&sk.log("MISSING UNIFORMS",Object.keys(h))(),c>0&&sk.log("UNUSED UNIFORMS",Object.keys(u))();var d=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($E(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($E(c))]=o({},i,JSON.stringify(c.accessor)))}}catch(l){u.e(l)}finally{u.f()}return n}(this.vertexArray.configuration);sk.table(e,r)(),sk.table(e,s)(),sk.table(e+1,d)(),i&&i.log({logLevel:2,message:"Rendered to ".concat(i.id)}),sk.groupEnd(2,">>> DRAWING MODEL ".concat(this.id))()}}}]),e}(),iO=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()}ox(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 nO(t,Object.assign({},e,{fs:e.fs||gC({version:bC(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!(hx(e.feedbackBuffers)&&hx(e.feedbackMap)&&!(e.varyings&&e.varyings.length>0))})(t)&&(this.bufferTransform=new yC(e,t)),function(e){return!(hx(e._sourceTextures)&&!e._targetTexture&&!e._targetTextureVarying)}(t)&&(this.textureTransform=new IC(e,t)),ox(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 lk(e)}}]),e}();function rO(){}var oO={onStart:rO,onUpdate:rO,onInterrupt:rO,onEnd:rO},aO=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({},oO),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}(),sO={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 aO(r),this.attribute=i,this.attributeInTransition=new cC(n,i.settings),this.currentStartIndices=i.startIndices,this.currentLength=0,this.transform=function(e,t){var n=oC(t.size);return new iO(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;aC(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;uC(M({buffer:s},o))}}catch(u){a.e(u)}finally{a.f()}this.currentStartIndices=i.startIndices,this.currentLength=sC(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:rC(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 aO(r),this.attribute=i,this.attributeInTransition=new cC(n,I(M({},i.settings),{normalized:!1})),this.currentStartIndices=i.startIndices,this.currentLength=0,this.texture=function(e){return new Rx(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 $x(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=oC(t.size);return new iO(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;uC(M({buffer:s},o))}}catch(u){a.e(u)}finally{a.f()}this.currentStartIndices=r.startIndices,this.currentLength=sC(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:rC(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]}}),aC(e),this.attributeInTransition.update({buffer:e[1],value:this.attribute.value}),qx(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}()},uO=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=iO.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 ik.warn("WebGL2 not supported by this browser. Transition for ".concat(e," is disabled."))();i&&this._removeTransition(e);var o=sO[n.type];o?this.transitions[e]=new o({attribute:t,timeline:this.timeline,gl:this.gl}):(ik.error("unsupported transition type '".concat(n.type,"'"))(),r=!1)}(r||t.needsRedraw())&&(this.needsRedraw=!0,this.transitions[e].start(n,this.numInstances))}}]),e}(),cO="attributeManager.invalidate",lO=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 uO(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,d=!1;for(var f in hC("attributeManager.updateStart",this),this.stats&&this.stats.get("Update Attributes").timeStart(),this.attributes){var p=this.attributes[f],v=p.settings.accessor;p.startIndices=r,s[f]&&ik.removed("props.".concat(f),"data.attributes.".concat(f))(),p.setExternalBuffer(c[f])||p.setBinaryValue(c[v],t.startIndices)||!c[v]&&p.setConstantValue(s[v])||p.needsUpdate()&&(d=!0,this._updateAttribute({attribute:p,numInstances:n,data:t,props:s,context:h})),this.needsRedraw|=p.needsRedraw()}d&&hC("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&&ik.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 cC(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;hC("attribute.updateStart",t),t.allocate(n)&&hC("attribute.allocate",t,n),t.updateBuffer(e)&&(this.needsRedraw=!0,hC("attribute.updateEnd",t,n))}}]),e}();function hO(e,t,n,i,r){var o=t-e;return(n-t)*r+-o*i+o+t}function dO(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=iC(i)){var s=fO[i.type];if(s){var u=new s(this.timeline);u.start(I(M({},i),{fromValue:t,toValue:n})),r.set(e,u)}else ik.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}(),vO={COMPONENT:Symbol.for("component"),ASYNC_DEFAULTS:Symbol.for("asyncPropDefaults"),ASYNC_ORIGINAL:Symbol.for("asyncPropOriginal"),ASYNC_RESOLVED:Symbol.for("asyncPropResolved")},gO=vO.COMPONENT;function mO(e,t){if(!e.transitions)return null;var n={},i=kO(e);for(var r in e.transitions){var o=i[r],a=o&&o.type;("number"===a||"color"===a||"array"===a)&&bO(e[r],t[r],o)&&(n[r]=!0)}return n}function yO(){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],d=t[10],f=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,C=l*g-d*p,E=l*m-f*p,O=h*g-d*v,T=h*m-f*v,P=d*m-f*g,A=y*P-b*T+_*O+w*E-k*C+x*S;return A?(e[0]=(s*P-u*T+c*O)*(A=1/A),e[1]=(r*T-i*P-o*O)*A,e[2]=(v*x-g*k+m*w)*A,e[3]=(d*k-h*x-f*w)*A,e[4]=(u*E-a*P-c*C)*A,e[5]=(n*P-r*E+o*C)*A,e[6]=(g*_-p*x-m*b)*A,e[7]=(l*x-d*_+f*b)*A,e[8]=(a*T-s*E+c*S)*A,e[9]=(i*E-n*T-o*S)*A,e[10]=(p*k-v*_+m*y)*A,e[11]=(h*_-l*k-f*y)*A,e[12]=(s*C-a*O-u*S)*A,e[13]=(n*O-i*C+r*S)*A,e[14]=(v*b-p*w-g*y)*A,e[15]=(l*w-h*b+d*y)*A,e):null}function OO(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],d=t[9],f=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*d+k*g,e[2]=b*o+_*c+w*f+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*d+k*g,e[6]=b*o+_*c+w*f+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*d+k*g,e[10]=b*o+_*c+w*f+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*d+k*g,e[14]=b*o+_*c+w*f+k*m,e[15]=b*a+_*l+w*p+k*y,e}function TO(e,t,n){var i,r,o,a,s,u,c,l,h,d,f,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],d=t[9],f=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]=d,e[10]=f,e[11]=p,e[12]=i*v+s*g+h*m+t[12],e[13]=r*v+u*g+d*m+t[13],e[14]=o*v+c*g+f*m+t[14],e[15]=a*v+l*g+p*m+t[15]),e}function PO(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 AO(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],d=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+d*i,e[8]=c*r-o*i,e[9]=l*r-a*i,e[10]=h*r-s*i,e[11]=d*r-u*i,e}function MO(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],d=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+d*i,e[4]=c*r-o*i,e[5]=l*r-a*i,e[6]=h*r-s*i,e[7]=d*r-u*i,e}function IO(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 RO(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 DO(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,d=c*o+a*r-s*i,f=-a*i-s*r-u*o;return e[0]=l*c+f*-a+h*-u-d*-s,e[1]=h*c+f*-s+d*-a-l*-u,e[2]=d*c+f*-u+l*-s-h*-a,e[3]=t[3],e}!function(){var e=new kS(4);kS!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0)}();var NO=[0,0,0,0],LO=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0],jO=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],FO=[0,0,0],BO=[0,0,0],VO=SO(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=NO,u=NO,c=e.cameraPosition,l=zO(e,t,n),h=l.geospatialOrigin,d=l.shaderCoordinateOrigin;return l.offsetMode&&(u=e.projectPosition(h||d),c=[c[0]-u[0],c[1]-u[1],c[2]-u[2]],u[3]=1,s=RO([],u,a),a=OO([],r,o=i||o),a=OO([],a,LO)),{viewMatrix:o,viewProjectionMatrix:a,projectionCenter:s,originCommon:u,cameraPosCommon:c,shaderCoordinateOrigin:d,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(),d=[t.width*n,t.height*n],f=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:d,project_uDevicePixelRatio:n,project_uFocalDistance:f,project_uCommonUnitsPerMeter:h.unitsPerMeter,project_uCommonUnitsPerWorldUnit:h.unitsPerMeter,project_uCommonUnitsPerWorldUnit2:FO,project_uScale:t.scale,project_uViewProjectionMatrix:a,project_uCameraPosition:u};if(l){var v=t.getDistanceScales(l);switch(i){case rk.METER_OFFSETS:p.project_uCommonUnitsPerWorldUnit=v.unitsPerMeter,p.project_uCommonUnitsPerWorldUnit2=v.unitsPerMeter2;break;case rk.LNGLAT:case rk.LNGLAT_OFFSETS:p.project_uCommonUnitsPerWorldUnit=v.unitsPerDegree,p.project_uCommonUnitsPerWorldUnit2=v.unitsPerDegree2;break;case rk.CARTESIAN:p.project_uCommonUnitsPerWorldUnit=[1,1,v.unitsPerMeter[2]],p.project_uCommonUnitsPerWorldUnit2=[0,0,v.unitsPerMeter2[2]]}}return p});function zO(e,t){var n,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:BO,r=i,o=!0;switch(n=t===rk.LNGLAT_OFFSETS||t===rk.METER_OFFSETS?i:e.isGeospatial?[Math.fround(e.longitude),Math.fround(e.latitude),0]:null,e.projectionMode){case ok.WEB_MERCATOR:(t===rk.LNGLAT||t===rk.CARTESIAN)&&(o=!1);break;case ok.WEB_MERCATOR_AUTO_OFFSET:t===rk.LNGLAT?r=n:t===rk.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 ok.IDENTITY:r=e.position.map(Math.fround);break;case ok.GLOBE:o=!1,n=null;break;default:o=!1}return r[2]=r[2]||0,{geospatialOrigin:n,shaderCoordinateOrigin:r,offsetMode:o}}var UO=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 pS(!1),0}},{key:"RANK",get:function(){return pS(!1),0}},{key:"toString",value:function(){var e="[";if(oS.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 d=s*Math.tan(n/2),f=d*o;return(new i).ortho({left:-f,right:f,bottom:-d,top:d,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 function(e,t,n,i,r){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!=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)}(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],d=e[11],f=e[12],p=e[13],v=e[14],g=e[15];return(t*a-n*o)*(h*g-d*v)-(t*s-i*o)*(l*g-d*p)+(t*u-r*o)*(l*v-h*p)+(n*s-i*a)*(c*g-d*f)-(n*u-r*a)*(c*v-h*f)+(i*u-r*s)*(c*p-l*f)}(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 OO(this,e,this),this.check()}},{key:"multiplyRight",value:function(e){return OO(this,this,e),this.check()}},{key:"rotateX",value:function(e){return AO(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],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]=o*r-c*i,e[1]=a*r-l*i,e[2]=s*r-h*i,e[3]=u*r-d*i,e[8]=o*i+c*r,e[9]=a*i+l*r,e[10]=s*i+h*r,e[11]=u*i+d*r}(this,this,e),this.check()}},{key:"rotateZ",value:function(e){return MO(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,d,f,p,v,g,m,y,b,_,w,k,x,S,C,E,O,T=i[0],P=i[1],A=i[2],M=Math.hypot(T,P,A);Mn?n:e}var eT=Math.log2||function(e){return Math.log(e)*Math.LOG2E};function tT(e,t){if(!e)throw new Error(t||"@math.gl/web-mercator: assertion failed.")}var nT=Math.PI,iT=nT/4,rT=nT/180,oT=180/nT,aT=4003e4,sT=85.051129;function uT(e){var n=t(e,2),i=n[0],r=n[1];return tT(Number.isFinite(i)),tT(Number.isFinite(r)&&r>=-90&&r<=90,"invalid latitude"),[512*(i*rT+nT)/(2*nT),512*(nT+Math.log(Math.tan(iT+r*rT*.5)))/(2*nT)]}function cT(e){var n=t(e,2),i=n[0],r=n[1],o=i/512*(2*nT)-nT,a=2*(Math.atan(Math.exp(r/512*(2*nT)-nT))-iT);return[o*oT,a*oT]}function lT(e){var t=e.latitude,n=e.longitude,i=e.highPrecision,r=void 0!==i&&i;tT(Number.isFinite(t)&&Number.isFinite(n));var o={},a=Math.cos(t*rT),s=512/360,u=s/a,c=512/aT/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=rT*Math.tan(t*rT)/a,h=512/aT*l,d=h/u*c;o.unitsPerDegree2=[0,s*l/2,h],o.unitsPerMeter2=[d,0,d]}return o}function hT(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=lT({longitude:r,latitude:o,highPrecision:!0}),d=h.unitsPerMeter,f=h.unitsPerMeter2,p=uT(e);p[0]+=u*(d[0]+f[0]*c),p[1]+=c*(d[1]+f[1]*c);var v=cT(p),g=(a||0)+(l||0);return Number.isFinite(a)||Number.isFinite(l)?[v[0],v[1],g]:v}function dT(e){return 2*Math.atan(.5/e)*oT}function fT(e,n){var i=t(e,3),r=i[0],o=i[1],a=i[2],s=void 0===a?0:a;return tT(Number.isFinite(r)&&Number.isFinite(o)&&Number.isFinite(s)),QO(n,[r,o,s,1])}function pT(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(tT(Number.isFinite(o)&&Number.isFinite(a),"invalid pixel coordinate"),Number.isFinite(s))return QO(n,[o,a,s,1]);var u=QO(n,[o,a,0,1]),c=QO(n,[o,a,1,1]),l=u[2],h=c[2];return WO([],u,c,l===h?0:((i||0)-l)/(h-l))}var vT=Math.PI/180;function gT(e,t,n){var i=e.pixelUnprojectionMatrix,r=QO(i,[t,0,1,1]),o=QO(i,[t,e.height,1,1]),a=cT(WO([],r,o,(n*e.distanceScales.unitsPerMeter[2]-r[2])/(o[2]-r[2])));return a[2]=n,a}var mT=Math.PI/180,yT=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],bT=[0,0,0],_T={unitsPerMeter:[1,1,1],metersPerUnit:[1,1,1]},wT=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?ok.WEB_MERCATOR:ok.WEB_MERCATOR_AUTO_OFFSET:ok.IDENTITY}},{key:"equals",value:function(t){return t instanceof e&&(this===t||t.width===this.width&&t.height===this.height&&t.scale===this.scale&&fS(t.projectionMatrix,this.projectionMatrix)&&fS(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=fT(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=pT([s,r?u:this.height-u,c],this.pixelUnprojectionMatrix,o&&o*this.distanceScales.unitsPerMeter[2]),h=this.unprojectPosition(l),d=t(h,3),f=d[0],p=d[1],v=d[2];return Number.isFinite(c)?[f,p,v]:Number.isFinite(o)?[f,p,o]:[f,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?uT(e):e}},{key:"unprojectFlat",value:function(e){return this.isGeospatial?cT(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?lT({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,d=void 0===h?0:h,f=t.bearing,p=void 0===f?0:f,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,C=void 0===S?0:S,E=t.width,O=t.height,T=t.altitude,P=void 0===T?1.5:T,A=Math.pow(2,l),R=function(e){var t=e.width,n=e.height,i=e.fovy,r=void 0===i?dT(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=dT(o));var d=.5*r*rT,f=function(e){return.5/Math.tan(.5*e*rT)}(r),p=s*rT,v=Math.sin(d)*f/Math.sin(Math.min(Math.max(Math.PI/2-p-d,.01),Math.PI-.01));return{fov:2*d,aspect:t/n,focalDistance:f,near:c,far:(Math.sin(p)*v+f)*h}}({width:E=E||1,height:O=O||1,pitch:d,altitude:P=Math.max(.75,P),nearZMultiplier:g,farZMultiplier:b}),D=R.fov,N=R.aspect,L=R.focalDistance,j=R.near,F=R.far,B=function(e){var t=e.height,n=e.pitch,i=e.bearing,r=e.scale,o=e.center,a=void 0===o?null:o,s=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];return TO(s,s,[0,0,-e.altitude]),AO(s,s,-n*rT),MO(s,s,i*rT),PO(s,s,[r/=t,r,r]),a&&TO(s,s,function(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}([],a)),s}({height:O,pitch:d,bearing:p,scale:A,altitude:P});return C&&(B=(new $O).translate([512*C,0,0]).multiplyLeft(B)),(e=n.call(this,I(M({},t),{width:E,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=d,e.bearing=p,e.altitude=P,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 hT(e,t)}},{key:"panByPosition",value:function(e,n){var i=pT(n,this.pixelUnprojectionMatrix),r=HO([],this.projectFlat(e),GO([],i)),o=HO([],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=function(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*vT:Math.atan(.5/e.altitude))>(90-e.pitch)*vT-.01?(t=gT(e,0,i),n=gT(e,r,i)):(t=a([0,0],s),n=a([r,0],s)),[u,c,n,t]}(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 n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.width,o=this.height,a=function(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,d=void 0===h?[0,0]:h,f=t(r,2),p=t(f[0],2),v=p[0],g=p[1],m=t(f[1],2),y=m[0],b=m[1];Number.isFinite(l)?l={top:l,bottom:l,left:l,right:l}:tT(Number.isFinite(l.top)&&Number.isFinite(l.bottom)&&Number.isFinite(l.left)&&Number.isFinite(l.right));var _=uT([v,JO(b,-sT,sT)]),w=uT([y,JO(g,-sT,sT)]),k=[Math.max(Math.abs(w[0]-_[0]),a),Math.max(Math.abs(w[1]-_[1]),a)],x=[n-l.left-l.right-2*Math.abs(d[0]),i-l.top-l.bottom-2*Math.abs(d[1])];tT(x[0]>0&&x[1]>0);var S=x[0]/k[0],C=x[1]/k[1],E=cT([(w[0]+_[0])/2+(l.right-l.left)/2/S,(w[1]+_[1])/2+(l.bottom-l.top)/2/C]),O=Math.min(u,eT(Math.abs(Math.min(S,C))));return tT(Number.isFinite(O)),{longitude:E[0],latitude:E[1],zoom:O}}(M({width:r,height:o,bounds:e},n)),s=a.longitude,u=a.latitude,c=a.zoom;return new i({width:r,height:o,longitude:s,latitude:u,zoom:c})}}]),i}(wT);return e.displayName="WebMercatorViewport",e}();function xT(e,n){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=n.projectPosition(e);if(i&&n instanceof kT){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 ST(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],d=c[2],f=void 0===d?0:d;switch(o&&(l=(i=t(RO([],[l,h,f,1],o),3))[0],h=i[1],f=i[2]),a){case rk.LNGLAT:return xT([l,h,f],r,u);case rk.LNGLAT_OFFSETS:return xT([l+s[0],h+s[1],f+(s[2]||0)],r,u);case rk.METER_OFFSETS:return xT(hT(s,[l,h,f]),r,u);case rk.CARTESIAN:default:return r.isGeospatial?[l+s[0],h+s[1],f+s[2]]:r.projectPosition([l,h,f])}}var CT={10241:9987,10240:9729,10242:33071,10243:33071},ET={},OT={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||MT(e)&&(3===e.length||4===e.length)},equal:function(e,t,n){return TT(e,t)}},accessor:{validate:function(e,t){var n=IT(e);return"function"===n||n===IT(t.value)},equal:function(e,t,n){return"function"==typeof t||TT(e,t)}},array:{validate:function(e,t){return t.optional&&!e||MT(e)},equal:function(e,t,n){return n.compare?TT(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 Rx)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 Rx(n,I(M({},t),{parameters:M(M(M({},CT),i),e.props.textureParameters)}));return ET[r.id]=!0,r}(n,e)},release:function(e){!function(e){!e||!(e instanceof Rx)||ET[e.id]&&(e.delete(),delete ET[e.id])}(e)}}};function TT(e,t){if(e===t)return!0;if(!MT(e)||!MT(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=qT,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[GT]||{},n=e[HT]||e,i=e[WT]||{};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(KS(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 Vx(regeneratorRuntime.mark(function i(){var r,o,a,s,u,c,l,h,d,f,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=UT(t);case 8:return i.next=10,p.next();case 10:return l=(d=i.sent).done,i.next=13,d.value;case 13:if(f=i.sent,l){i.next=20;break}v=f,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}(),KT=vO.ASYNC_ORIGINAL,$T=vO.ASYNC_RESOLVED,QT=vO.ASYNC_DEFAULTS,ZT={},JT=0,eP=function(){var e=function(){function e(){m(this,e),this.props=jT.apply(this,arguments),this.id=this.props.id,this.count=JT++,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[QT])i in t[$T]?n[i]=t[$T][i]:i in t[KT]&&(n[i]=t[KT][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 XT({})}}]),e}();return e.componentName="Component",e.defaultProps=ZT,e}(),tP=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}(XT),nP=function(e){return"function"==typeof e},iP=function(e){return null!==e&&"object"==typeof e},rP=function(e){return iP(e)&&e.constructor==={}.constructor},oP=function(e){return e&&"function"==typeof e[Symbol.iterator]},aP=function(e){return e&&"function"==typeof e[Symbol.asyncIterator]},sP=function(e){return"undefined"!=typeof Response&&e instanceof Response||e&&e.arrayBuffer&&e.text&&e.json},uP=function(e){return"undefined"!=typeof Blob&&e instanceof Blob},cP=function(e){return function(e){return"undefined"!=typeof ReadableStream&&e instanceof ReadableStream||iP(e)&&nP(e.tee)&&nP(e.cancel)&&nP(e.getReader)}(e)||function(e){return iP(e)&&nP(e.read)&&nP(e.pipe)&&function(e){return"boolean"==typeof e}(e.readable)}(e)};function lP(e,t){if(!e)throw new Error(t||"loader assertion failed.")}function hP(e){var t;return!!e&&(Array.isArray(e)&&(e=e[0]),Array.isArray(null===(t=e)||void 0===t?void 0:t.extensions))}function dP(e){var t,n,i;return lP(e,"null loader"),lP(hP(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 fP={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},pP=fP.global||fP.self||fP.window||{},vP="object"!=typeof process||"[object process]"!==String(process)||process.browser,gP="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version);gP&&parseFloat(gP[1]);var mP={};function yP(e){for(var t in mP)e.startsWith(t)&&(e=e.replace(t,mP[t]));return!e.startsWith("http://")&&!e.startsWith("https://")&&(e="".concat(e)),e}var bP=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,_P=/^([-\w.]+\/[-\w.+]+)/;function wP(e){var t=_P.exec(e);return t?t[1]:e}function kP(e){var t=bP.exec(e);return t?t[1]:""}var xP=/\?.*/;function SP(e){if(sP(e)){var t=EP(e.url||"");return{url:t,type:wP(e.headers.get("content-type")||"")||kP(t)}}return uP(e)?{url:EP(e.name||""),type:e.type||""}:"string"==typeof e?{url:EP(e),type:kP(e)}:{url:"",type:""}}function CP(e){return sP(e)?e.headers["content-length"]||-1:uP(e)?e.size:"string"==typeof e?e.length:e instanceof ArrayBuffer||ArrayBuffer.isView(e)?e.byteLength:-1}function EP(e){return e.replace(xP,"")}function OP(e){return TP.apply(this,arguments)}function TP(){return(TP=Vx(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(!sP(t)){e.next=2;break}return e.abrupt("return",t);case 2:return n={},(i=CP(t))>=0&&(n["content-length"]=String(i)),r=SP(t),o=r.url,(a=r.type)&&(n["content-type"]=a),e.next=8,RP(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 PP(e){return AP.apply(this,arguments)}function AP(){return(AP=Vx(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,MP(t);case 3:throw n=e.sent,new Error(n);case 5:case"end":return e.stop()}},e)}))).apply(this,arguments)}function MP(e){return IP.apply(this,arguments)}function IP(){return(IP=Vx(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 RP(e){return DP.apply(this,arguments)}function DP(){return(DP=Vx(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(NP(t.slice(0,5))):null);case 8:case"end":return e.stop()}},e)}))).apply(this,arguments)}function NP(e){for(var t="",n=new Uint8Array(e),i=0;i1&&void 0!==arguments[1]?arguments[1]:"3.0.12";return $P(e,"no worker provided"),!(!t||!e.version)}var ZP={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},JP=ZP.global||ZP.self||ZP.window||{},eA="object"!=typeof process||"[object process]"!==String(process)||process.browser,tA="function"==typeof importScripts,nA="undefined"!=typeof window&&void 0!==window.orientation,iA="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version),rA=(iA&&parseFloat(iA[1]),new Map);function oA(e){var t=new Blob([e],{type:"application/javascript"});return URL.createObjectURL(t)}function aA(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(sA(e))i.add(e);else if(sA(e.buffer))i.add(e.buffer);else if(!ArrayBuffer.isView(e)&&t&&"object"==typeof e)for(var r in e)aA(e[r],t,i);return void 0===n?Array.from(i):[]}function sA(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 uA=function(){},cA=function(){function e(t){m(this,e),FP(this,"name",void 0),FP(this,"source",void 0),FP(this,"url",void 0),FP(this,"terminated",!1),FP(this,"worker",void 0),FP(this,"onMessage",void 0),FP(this,"onError",void 0),FP(this,"_loadableURL","");var n=t.name,i=t.source,r=t.url;$P(i||r),this.name=n,this.source=i,this.url=r,this.onMessage=uA,this.onError=function(e){return console.log(e)},this.worker=this._createBrowserWorker()}return b(e,[{key:"destroy",value:function(){this.onMessage=uA,this.onError=uA,this.worker.terminate(),this.terminated=!0}},{key:"isRunning",get:function(){return Boolean(this.onMessage)}},{key:"postMessage",value:function(e,t){t=t||aA(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){$P(e.source&&!e.url||!e.source&&e.url);var t=rA.get(e.source||e.url);return t||(e.url&&(t=function(e){return e.startsWith("http")?oA(function(e){return"try {\n importScripts('".concat(e,"');\n} catch (error) {\n console.error(error);\n throw error;\n}")}(e)):e}(e.url),rA.set(e.url,t)),e.source&&(t=oA(e.source),rA.set(e.source,t))),$P(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}(),lA=function(){function e(t,n){var i=this;m(this,e),FP(this,"name",void 0),FP(this,"workerThread",void 0),FP(this,"isRunning",void 0),FP(this,"result",void 0),FP(this,"_resolve",void 0),FP(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){$P(this.isRunning),this.isRunning=!1,this._resolve(e)}},{key:"error",value:function(e){$P(this.isRunning),this.isRunning=!1,this._reject(e)}}]),e}(),hA=function(){function e(t){m(this,e),FP(this,"name","unnamed"),FP(this,"source",void 0),FP(this,"url",void 0),FP(this,"maxConcurrency",1),FP(this,"maxMobileConcurrency",1),FP(this,"onDebug",function(){}),FP(this,"reuseWorkers",!0),FP(this,"props",{}),FP(this,"jobQueue",[]),FP(this,"idleQueue",[]),FP(this,"count",0),FP(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 Vx(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 Vx(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 lA(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 pA(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 $P(i),i}function vA(e,t){return!!fA.isSupported()&&e.worker&&(null==t?void 0:t.worker)}function gA(e,t,n,i,r){return mA.apply(this,arguments)}function mA(){return(mA=Vx(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=pA(t,i),u=fA.getWorkerFarm(i).getWorkerPool({name:a,url:s}),i=JSON.parse(JSON.stringify(i)),e.next=4,u.startJob("process-on-worker",yA.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 yA(e,t,n,i){return bA.apply(this,arguments)}function bA(){return(bA=Vx(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)}FP(fA,"_workerFarm",void 0);var _A=r(9521);function wA(e){if(function(e){return e&&"object"==typeof e&&e.isBuffer}(e)&&(e=function(e){return _A.toArrayBuffer?_A.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 kA(){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?EA:i,o=0;case 3:if(!(o2&&void 0!==arguments[2]?arguments[2]:null;if(n)return n;var i=M({fetch:qP(t,e)},e);return Array.isArray(i.loaders)||(i.loaders=null),i}function zA(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 UA=function(){var e=HP();return e.loaderRegistry=e.loaderRegistry||[],e.loaderRegistry};function HA(e){var t,n=UA(),i=_(e=Array.isArray(e)?e:[e]);try{var r=function(){var e=dP(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 GA=/\.([^.]+)$/;function WA(e){return qA.apply(this,arguments)}function qA(){return(qA=Vx(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,YA(t)){e.next=5;break}return e.abrupt("return",null);case 5:if(!(o=XA(t,n,I(M({},i),{nothrow:!0}),r))){e.next=8;break}return e.abrupt("return",o);case 8:if(e.t0=uP(t),!e.t0){e.next=18;break}return e.t1=XA,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(KA(t));case 20:return e.abrupt("return",o);case 21:case"end":return e.stop()}},e)}))).apply(this,arguments)}function XA(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(!YA(e))return null;if(n&&!Array.isArray(n))return dP(n);var o=[];n&&(o=o.concat(n)),null!=i&&i.ignoreRegisteredLoaders||(t=o).push.apply(t,v(UA())),function(e){var t,n=_(e);try{for(n.s();!(t=n.n()).done;){dP(t.value)}}catch(i){n.e(i)}finally{n.f()}}(o);var a=function(e,t,n,i){var r=SP(e),o=r.url,a=r.type,s=o||(null==i?void 0:i.url),u=null;return null!=n&&n.mimeType&&(u=$A(t,null==n?void 0:n.mimeType)),u=(u=(u=(u=u||function(e,t){var n=t&&GA.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))||$A(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(QA(t,r))return r}else if(ArrayBuffer.isView(t)){if(ZA(t.buffer,t.byteOffset,r))return r}else if(t instanceof ArrayBuffer&&ZA(t,0,r))return r}}catch(o){i.e(o)}finally{i.f()}return null}(t,e))||$A(t,null==n?void 0:n.fallbackMimeType)}(e,o,i,r);if(!(a||null!=i&&i.nothrow))throw new Error(KA(e));return a}function YA(e){return!(e instanceof Response&&204===e.status)}function KA(e){var t=SP(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)?JA(e.buffer,e.byteOffset,t):e instanceof ArrayBuffer?JA(e,0,t):""}(e),'", contentType: "').concat(i,'"')),n&&(r+=" url: ".concat(n)),r}function $A(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 QA(e,t){return t.testText?t.testText(e):(Array.isArray(t.tests)?t.tests:[t.tests]).some(function(t){return e.startsWith(t)})}function ZA(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(fT(ST(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===rk.DEFAULT&&(n=e.viewport.isGeospatial?rk.LNGLAT:rk.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=zO(i,r,o),l=c.geospatialOrigin,h=c.shaderCoordinateOrigin,d=c.offsetMode,f=ST(e,{viewport:i,modelMatrix:a,coordinateSystem:s,coordinateOrigin:u,offsetMode:d});return d&&function(e,t,n){e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2]}(f,f,i.projectPosition(l||h)),f}(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===rk.DEFAULT||e===rk.LNGLAT||e===rk.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){WS(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=CO(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,d=l.instancePickingColors,f=h||d;f&&(c&&f.constant&&(f.constant=!1,r.invalidate(f.id)),!f.value&&!c&&(f.constant=!0,f.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||!uM({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(cM.length/3);if(this.internalState.usesPickingColorCache=!0,iaM&&ik.warn("Layer has too many data objects. Picking might not be able to distinguish all objects.")(),cM=nS.allocate(cM,n,{size:3,copy:!0,maxCount:Math.max(n,aM)});for(var r=Math.floor(cM.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 lO(this.context.gl,{id:this.props.id,stats:this.context.stats,timeline:this.context.timeline})}},{key:"_initState",value:function(){WS(!this.internalState&&!this.state),WS(isFinite(this.props.coordinateSystem));var e=this._getAttributeManager();e&&e.addInstanced({instancePickingColors:{type:5121,size:3,noAlloc:!0,update:this.calculateInstancePickingColors}}),this.internalState=new tP({attributeManager:e,layer:this}),this.clearChangeFlags(),this.state={},Object.defineProperty(this.state,"attributeManager",{get:function(){return ik.deprecated("layer.state.attributeManager","layer.getAttributeManager()"),e}}),this.internalState.layer=this,this.internalState.uniformTransitions=new pO(this.context.timeline),this.internalState.onAsyncPropUpdated=this._onAsyncPropUpdated.bind(this),this.internalState.setAsyncProps(this.props)}},{key:"_transferState",value:function(e){hC("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}(eP);return e.layerName="Layer",e.defaultProps=lM,e}(),dM=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,d=t.wrapLongitude,f=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:d,positionFormat:f,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 C in b){var E=S[C]||x[C];E&&"accessor"===E.type&&(b[C]=this.getSubLayerAccessor(b[C]))}}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 P=O.value,A=P.getSubLayerProps.call(this,P);A&&Object.assign(y,A,{updateTriggers:Object.assign(y.updateTriggers,A.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=$S(e=this.renderLayers(),Boolean),this.internalState.subLayers=e),hC("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}(hM);return t.layerName="CompositeLayer",t}(),fM=/([0-9]+\.?[0-9]*)(%|px)/;function pM(e){switch(typeof e){case"number":return{position:e,relative:!1};case"string":var t=e.match(fM);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 vM(e,t){return e.relative?Math.round(e.position*t):e.position}function gM(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)&&gM(i,r)))return!1}return!0}var mM=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,d=t.projectionMatrix,f=void 0===d?null:d,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,C=t.type,E=void 0===C?wT:C;WS(!S||S instanceof wT),this.viewportInstance=S,this.id=i||this.constructor.displayName||"view",this.type=E,this.props=I(M({},t),{id:this.id,projectionMatrix:f,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):gM(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:vM(this._x,t),y:vM(this._y,n),width:vM(this._width,t),height:vM(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=pM(t),this._y=pM(n),this._width=pM(i),this._height=pM(r)}}]),e}(),yM=function(){},bM={transitionEasing:function(e){return e},transitionInterruption:1,onTransitionStart:yM,onTransitionInterrupt:yM,onTransitionEnd:yM},_M=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({},bM),n),this.propsInTransition=null,this.transition=new aO(n.timeline),this.onViewStateChange=n.onViewStateChange||yM,this.onStateChange=n.onStateChange||yM,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({},bM),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}(),wM=["longitude","latitude","zoom","bearing","pitch"],kM=["longitude","latitude","zoom"],xM=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:wM,extract:wM,required:kM})).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]=dS(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,dS(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)||!fS(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];WS(Number.isFinite(n)||Array.isArray(n),"".concat(t," is required for transition"))})}}]),e}()),SM={transitionDuration:0},CM={transitionDuration:300,transitionEasing:function(e){return e},transitionInterruption:1},EM=function(e){return 1-(1-e)*(1-e)},OM=["wheel"],TM=["panstart","panmove","panend"],PM=["pinchstart","pinchmove","pinchend"],AM=["tripanstart","tripanmove","tripanend"],MM=["doubletap"],IM=["keydown"],RM=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 _M(t,I(M({},n),{onViewStateChange:this._onTransition.bind(this),onStateChange:this._setInteractionState.bind(this)}));var i=this.linearTransitionProps;this._transition=i&&I(M({},CM),{transitionInterpolator:new xM({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,d=e.touchRotate,f=void 0!==d&&d,p=e.keyboard,v=void 0===p||p,g=Boolean(this.onViewStateChange);this.toggleEvents(OM,g&&i),this.toggleEvents(TM,g&&(o||s)),this.toggleEvents(PM,g&&(h||f)),this.toggleEvents(AM,g&&f),this.toggleEvents(MM,g&&c),this.toggleEvents(IM,g&&v),this.scrollZoom=i,this.dragPan=o,this.dragRotate=s,this.doubleClickZoom=c,this.touchZoom=h,this.touchRotate=f,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,SM,{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,SM,{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:EM}),{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,SM,{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:EM}),{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,SM,{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,SM,{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:EM}),{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,SM,{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,SM,{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:EM}),{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 xM(I(M({},e),{transitionProps:this.linearTransitionProps,makeViewport:this.controllerState.makeViewport}))}):t:SM}}]),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}(),NM=[0,0,0],LM=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,d=void 0===h?NM:h,f=e.zoom,p=void 0===f?0:f,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,C=e.startRotatePos,E=e.startRotationX,O=e.startRotationOrbit,T=e.startZoomPosition,P=e.startZoom;return m(this,n),(i=t.call(this,{width:o,height:a,rotationX:u,rotationOrbit:l,target:d,zoom:p,minRotationX:g,maxRotationX:b,minZoom:w,maxZoom:x}))._state={startPanPosition:S,startRotatePos:C,startRotationX:E,startRotationOrbit:O,startZoomPosition:T,startZoom:P},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,d=h.width,f=h.height;if(!u||!Number.isFinite(c)||!Number.isFinite(l))return this;if(n){var p=(n[0]-u[0])/d;(c<-90||c>90)&&(p*=-1),t={rotationX:c+(n[1]-u[1])/f*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),hS(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=hS(i,n,t),e.rotationX=hS(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),jM=function(e){a(n,e);var t=s(n);function n(e){return m(this,n),t.call(this,LM,e)}return b(n,[{key:"linearTransitionProps",get:function(){return["target","zoom","rotationX","rotationOrbit"]}}]),n}(RM),FM=function(e){a(n,e);var t=s(n);function n(e){return m(this,n),e.dragMode=e.dragMode||"pan",t.call(this,LM,e)}return b(n,[{key:"_onPanRotate",value:function(e){return!1}},{key:"linearTransitionProps",get:function(){return["target","zoom"]}}]),n}(RM),BM=(new $O).lookAt({eye:[0,0,1]});function VM(e){var t=e.width,n=e.height,i=e.near,r=e.far;return t=t||1,n=n||1,(new $O).ortho({left:-t/2,right:t/2,bottom:-n/2,top:n/2,near:i,far:r})}var zM=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,d=void 0===h?[0,0,0]:h,f=e.flipY,p=void 0===f||f,v=Math.pow(2,l);return t.call(this,I(M({},e),{longitude:null,position:d,viewMatrix:BM.clone().scale([v,v*(p?-1:1),v]),projectionMatrix:VM({width:i,height:r,near:a,far:u}),zoom:l}))}return b(n,[{key:"panByPosition",value:function(e,t){var n=HO([],e,GO([],pT(t,this.pixelUnprojectionMatrix)));return{target:HO([],this.center,n)}}}]),n}(wT),UM=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:zM}))}return b(n,[{key:"controller",get:function(){return this._getControllerProps({type:FM})}}]),n}(mM);return e.displayName="OrthographicView",e}(),HM=Math.PI/180;function GM(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*HM/2),u="Z"===i?[0,0,1]:[0,1,0],c="Z"===i?[0,-s,0]:[0,0,s],l=(new $O).lookAt({eye:c,up:u});l.rotateX(r*HM),"Z"===i?l.rotateZ(o*HM):l.rotateY(o*HM);var h=Math.pow(2,a)/(t||1);return l.scale(h),l}var WM=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,d=void 0===h?0:h,f=e.zoom,p=void 0===f?0:f;return(t=n.call(this,I(M({},e),{longitude:null,viewMatrix:GM({height:r,fovy:o,orbitAxis:a,rotationX:l,rotationOrbit:d,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=pT([a,l,c],this.pixelUnprojectionMatrix),d=t(h,3),f=d[0],p=d[1],v=d[2];return[f,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}(wT),qM=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:WM}))}return b(n,[{key:"controller",get:function(){return this._getControllerProps({type:jM})}}]),n}(mM);return e.displayName="OrbitView",e}(),XM=[255,255,255],YM=0,KM=function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};m(this,e);var n=t.color,i=void 0===n?XM:n,r=t.intensity,o=void 0===r?1:r;this.id=t.id||"ambient-".concat(YM++),this.color=i,this.intensity=o,this.type="ambient"},$M=[255,255,255],QM=[0,0,-1],ZM=0,JM=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?$M:n,r=t.intensity,o=void 0===r?1:r,a=t.direction,s=void 0===a?QM:a,u=t._shadow,c=void 0!==u&&u;this.id=t.id||"directional-".concat(ZM++),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}(),eI=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}(),tI=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 Uk(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){Uk(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,d=n&&n[h.id];i(h);var f=this._getDrawLayerParams(h,e);e.view=d;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,f);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=nI(),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 nI(){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]||nI(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 iI=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 Rx(e,{width:1,height:1,parameters:{10241:9729,10240:9729,10242:33071,10243:33071}}),r.depthBuffer=new Lx(e,{format:33189,width:1,height:1}),r.fbo=new $x(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;Hk(this.gl,{depthRange:[0,1],depthTest:!0,blend:!1,clearColor:[1,1,1,1]},function(){var o=t.viewports[0],a=Wk(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}(tI),rI=Object.keys(rk).map(function(e){return"const int COORDINATE_SYSTEM_".concat(e," = ").concat(rk[e],";")}).join(""),oI=Object.keys(ok).map(function(e){return"const int PROJECTION_MODE_".concat(e," = ").concat(ok[e],";")}).join(""),aI="".concat(rI,"\n").concat(oI,"\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"),sI={},uI={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:aI,getUniforms:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:sI;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?rk.DEFAULT:a,u=e.coordinateOrigin,c=e.autoWrapLongitude,l=void 0!==c&&c;s===rk.DEFAULT&&(s=t.isGeospatial?rk.LNGLAT:rk.CARTESIAN);var h=VO({viewport:t,devicePixelRatio:i,coordinateSystem:s,coordinateOrigin:u});return h.project_uWrapLongitude=l,h.project_uModelMatrix=o||jO,h}(e):{}}},cI=SO(function(e){var t=e.viewport,n=e.center;return new $O(t.viewProjectionMatrix).invert().transform(n)}),lI=SO(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=pT([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 $O).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}),hI=[0,0,0,1],dI=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0],fI={name:"shadow",dependencies:[uI],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||hI,shadow_uLightId:e.shadowLightId||0,shadow_uLightCount:e.shadowMatrices.length},i=cI({viewport:e.viewport,center:t.project_uCenter}),r=[],o=lI({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{}}},pI={color:[255,255,255],intensity:1},vI=[{color:[255,255,255],intensity:1,direction:[-1,3,-1]},{color:[255,255,255],intensity:.9,direction:[1,-8,-2.5]}],gI=[0,0,0,200/255],mI=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=gI,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=BE.getDefaultProgramManager(e),fI&&this.programManager.addDefaultModule(fI)),this.dummyShadowMap||(this.dummyShadowMap=new Rx(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=bI++;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}(),wI=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=rM(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}(),kI=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 wI(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 kI({gl:t,protocol:"deck://"}),this.context=I(M({},EI),{layerManager:this,gl:t,deck:i,programManager:t&&CI(t),stats:r||new nx({id:"deck.gl"}),viewport:o||new wT({id:"DEFAULT-INITIAL-VIEWPORT"}),timeline:a||new _I,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){hC("layerManager.setLayers",this,t,e),this.lastRenderedLayers=e;var n,i=_(e=$S(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 hC("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]?ik.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=$S(e,Boolean),this._diffViews(e,this.views)&&this.setNeedsUpdate("views changed"),this.views=e}},{key:"_setViewState",value:function(e){e?(!gM(e,this.viewState)&&this.setNeedsUpdate("viewState changed"),this.viewState=e):ik.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}(),PI=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,d=i.pitch,f=void 0===d?0:d,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,C=i.startPanLngLat,E=i.startZoomLngLat,O=i.startRotatePos,T=i.startBearing,P=i.startPitch,A=i.startZoom,M=i.normalize;return m(this,n),WS(Number.isFinite(u)),WS(Number.isFinite(s)),WS(Number.isFinite(c)),(e=t.call(this,{width:o,height:a,latitude:s,longitude:u,zoom:c,bearing:h,pitch:f,altitude:v,maxZoom:y,minZoom:_,maxPitch:k,minPitch:S,normalize:M}))._state={startPanLngLat:C,startZoomLngLat:E,startRotatePos:O,startBearing:T,startPitch:P,startZoom:A},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=hS(i,n,t);var r=e.maxPitch,o=e.minPitch,a=e.pitch;e.pitch=hS(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=ZO(i+180,360)-180),(c<-180||c>180)&&(c=ZO(c+180,360)-180);var l=eT(n/512);if(o<=l)o=l,r=0;else{var h=n/2/Math.pow(2,o),d=cT([0,h])[1];if(rf&&(r=f)}}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 hS(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=hS(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),AI=function(t){a(i,t);var n=s(i);function i(e){return m(this,i),e.dragMode=e.dragMode||"pan",n.call(this,PI,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}(RM),MI=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:kT}))}return b(n,[{key:"controller",get:function(){return this._getControllerProps({type:AI})}}]),n}(mM);return e.displayName="MapView",e}(),II=new mI,RI=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||!gM(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 mI})||this._internalEffects.push(II)}}]),e}(),DI=function(e){a(n,e);var t=s(n);function n(){return m(this,n),t.apply(this,arguments)}return n}(tI),NI={blendFunc:[1,0,32771,0],blendEquation:32774},LI=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,d=l.y,f=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,Hk(_,I(M({scissorTest:!0,scissor:[h,d,f,v],clearColor:[0,0,0,0],depthMask:!0,depthTest:!0,depthRange:[0,1],colorMask:[!0,!0,!0,!0]},NI),{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({},NI),{blend:!0,blendColor:[0,0,0,this.useAlpha?(t+1)/255:1]});return M(M({},e.props.parameters),n)}}]),i}(tI),jI=function(){function e(t){m(this,e),this.gl=t,this.layerFilter=null,this.drawPickingColors=!1,this.drawLayersPass=new DI(t),this.pickLayersPass=new LI(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||$x.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++,hC("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 $x(this.gl),new $x(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}(),FI={pickedColor:null,pickedLayer:null,pickedObjectIndex:-1};function BI(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,d=-1,f=0,p=0;ph)f+=4*c;else for(var m=0;m=0){var y=m+s-i,b=y*y+g;b<=h&&(h=b,d=f)}f+=4}}if(d>=0){var _=t[d+3]-1,w=t.slice(d,d+4),k=n[_];if(k){var x=k.decodePickingColor(w),S=Math.floor(d/4/c);return{pickedColor:w,pickedLayer:k,pickedObjectIndex:x,pickedX:s+(d/4-S*c),pickedY:u+S}}ik.error("Picked non-existent layer. Is picking buffer corrupt?")()}}return FI}function VI(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 zI(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 d=r.find(function(e){return e.props.id===l});d&&u.unshift(d)}n.layerId=h,n.index=s,n.info=null}}var f=VI(e),p=new Map;return p.set(null,f),u.forEach(function(e){var t=M({},f);e===a&&(t.color=o,t.index=s,t.picked=!0),t=UI({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 UI(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 HI=function(){function e(t){m(this,e),this.gl=t,this.pickingFBO=null,this.pickLayersPass=new LI(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 $x(e),$x.isSupported(e,{colorBufferFloat:!0})&&(this.depthFBO=new $x(e),this.depthFBO.attach({36064:new Rx(e,{format:lk(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?(ik.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,d=e.unproject3D,f=e.onViewportActive;if(!(t=this._getPickable(t)))return{result:[],emptyInfo:VI({viewports:i,x:r,y:o})};this._resizeBuffer();for(var p,v=Wk(this.gl),g=qk(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=[],C={},E=0;E=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)}):ik.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(f),S=0;S=f);S++){var C=w[S],E={color:C.pickedColor,layer:null,index:C.pickedObjectIndex,picked:!0,x:r,y:o,width:s,height:c,pixelRatio:v};E=UI({layer:C.pickedLayer,info:E,mode:h}),k.has(E.object)||k.set(E.object,E)}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,d=o.width,f=o.height,p=new(u?Float32Array:Uint8Array)(d*f*4);return qx(c,{sourceX:l,sourceY:h,sourceWidth:d,sourceHeight:f,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}(),GI={zIndex:1,position:"absolute",pointerEvents:"none",color:"#a0a7b4",backgroundColor:"#29323c",padding:"10px",top:0,left:0,display:"none"},WI=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,GI),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 qI(e,t){if(!e)throw new Error(t)}var XI={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},YI=XI.global||XI.self||XI.window,KI="object"!=typeof process||"[object process]"!==String(process)||process.browser,$I="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version),QI=($I&&parseFloat($I[1]),YI)._parseImageNode,ZI="undefined"!=typeof Image,JI="undefined"!=typeof ImageBitmap,eR=Boolean(QI),tR=!!KI||eR;function nR(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 iR=/^data:image\/svg\+xml/,rR=/\.svg((\?|#).*)?$/;function oR(e){return e&&(iR.test(e)||rR.test(e))}function aR(e,t){if(oR(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 sR(e,t)}function sR(e,t){if(oR(t))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(e)])}function uR(e,t,n){return cR.apply(this,arguments)}function cR(){return(cR=Vx(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=aR(t,i),o=self.URL||self.webkitURL,a="string"!=typeof r&&o.createObjectURL(r),e.prev=1,e.next=4,lR(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 lR(e,t){return hR.apply(this,arguments)}function hR(){return(hR=Vx(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 dR={},fR=!0;function pR(e,t,n){return vR.apply(this,arguments)}function vR(){return(vR=Vx(regeneratorRuntime.mark(function e(t,n,i){var r,o;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!oR(i)){e.next=6;break}return e.next=3,uR(t,n,i);case 3:e.t0=e.sent,e.next=7;break;case 6:e.t0=sR(t,i);case 7:return r=e.t0,o=n&&n.imagebitmap,e.next=11,gR(r,o);case 11:return e.abrupt("return",e.sent);case 12:case"end":return e.stop()}},e)}))).apply(this,arguments)}function gR(e){return mR.apply(this,arguments)}function mR(){return(mR=Vx(regeneratorRuntime.mark(function e(t){var n,i=arguments;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if((yR(n=i.length>1&&void 0!==i[1]?i[1]:null)||!fR)&&(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),fR=!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 yR(e){for(var t in e||dR)return!1;return!0}var bR=!1,_R=!0;function wR(e){var t=kR(e);return function(e){var t=kR(e);return t.byteLength>=24&&2303741511===t.getUint32(0,bR)?{mimeType:"image/png",width:t.getUint32(16,bR),height:t.getUint32(20,bR)}:null}(t)||function(e){var t=kR(e);if(!(t.byteLength>=3&&65496===t.getUint16(0,bR)&&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,bR)?{mimeType:"image/gif",width:t.getUint16(6,_R),height:t.getUint16(8,_R)}:null}(t)||function(e){var t=kR(e);return t.byteLength>=14&&16973===t.getUint16(0,bR)&&t.getUint32(2,_R)===t.byteLength?{mimeType:"image/bmp",width:t.getUint32(18,_R),height:t.getUint32(22,_R)}:null}(t)}function kR(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 xR(e,t){var n=(wR(e)||{}).mimeType,i=YI._parseImageNode;return qI(i),i(e,n,t)}function SR(){return(SR=Vx(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=CR(r),e.next="imagebitmap"===e.t0?4:"image"===e.t0?8:"data"===e.t0?12:16;break;case 4:return e.next=6,pR(t,n,o);case 6:return a=e.sent,e.abrupt("break",17);case 8:return e.next=10,uR(t,n,o);case 10:return a=e.sent,e.abrupt("break",17);case 12:return e.next=14,xR(t,n);case 14:return a=e.sent,e.abrupt("break",17);case 16:qI(!1);case 17:return e.abrupt("return",("data"===r&&(a=nR(a)),a));case 18:case"end":return e.stop()}},e)}))).apply(this,arguments)}function CR(e){switch(e){case"auto":case"data":return function(){if(JI)return"imagebitmap";if(ZI)return"image";if(tR)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}();default:return function(e){switch(e){case"auto":return JI||ZI||tR;case"imagebitmap":return JI;case"image":return ZI;case"data":return tR;default:throw new Error("@loaders.gl/images: image ".concat(e," not supported in this environment"))}}(e),e}}var ER={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 SR.apply(this,arguments)},tests:[function(e){return Boolean(wR(new DataView(e)))}],options:{image:{type:"auto",decode:!0}}},OR=r(84761),TR={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},PR="8.5.8",AR=OR.CO.deck&&OR.CO.deck.VERSION;if(AR&&AR!==PR)throw new Error("deck.gl - multiple versions detected: ".concat(AR," vs ").concat(PR));AR||(ik.log(1,"deck.gl ".concat(PR))(),OR.CO.deck=Object.assign(OR.CO.deck||{},{VERSION:PR,version:PR,log:ik,_registerLoggers:function(e){lC=e}}),HA([TR,[ER,{imagebitmap:{premultiplyAlpha:"none"}}]]));var MR=OR.CO.deck,IR=function(e,t){a(i,e);var n=s(i);function i(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return m(this,i),(t=n.call(this,e,r)).target=null,t._queryPending=!1,t._pollingPromise=null,Object.seal(c(t)),t}return b(i,[{key:t,get:function(){return"Query"}},{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 i.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=lk(e),r=Jx(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:ox(!1)}}}catch(u){a.e(u)}finally{a.f()}return o}}]),i}(px,Symbol.toStringTag),RR=Gk()&&"undefined"!=typeof document,DR=0,NR=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 Zk(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,d=t.onError,f=t.gl,p=void 0===f?null:f,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,C=void 0===S||S,E=t.stats,O=void 0===E?rx.get("animation-loop-"+DR++):E,T=t.useDevicePixels,P=void 0===T||T;"useDevicePixelRatio"in t&&(sk.deprecated("useDevicePixelRatio","useDevicePixels")(),P=t.useDevicePixelRatio),this.props={onCreateContext:i,onAddHTML:o,onInitialize:s,onRender:c,onFinalize:h,onError:d,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:C,useDevicePixels:P}),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 ox("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=IR.isSupported(e.gl,["timers"])?new IR(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 Vx(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 sk.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=RR?new Promise(function(e,t){RR&&"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),!ck(this.gl))throw new Error("AnimationLoop.onCreateContext - illegal context returned");(function(e){Uk(e,Sk)})(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)&&(sk.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)&&(sk.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 $x(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}(),LR=r(11524),jR=r.n(LR),FR={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}))}}(jR().MouseInput);var BR=jR().Manager,VR=jR(),zR=VR?[[VR.Pan,{event:"tripan",pointers:3,threshold:0,enable:!1}],[VR.Rotate,{enable:!1}],[VR.Pinch,{enable:!1}],[VR.Swipe,{enable:!1}],[VR.Pan,{threshold:0,enable:!1}],[VR.Press,{enable:!1}],[VR.Tap,{event:"doubletap",taps:2,enable:!1}],[VR.Tap,{event:"anytap",enable:!1}],[VR.Tap,{enable:!1}]]:null,UR={tripan:["rotate","pinch","pan"],rotate:["pinch"],pinch:["pan"],pan:["press","doubletap","anytap","tap"],doubletap:["anytap"],anytap:["tap"]},HR={doubletap:["tap"]},GR={pointerdown:"pointerdown",pointermove:"pointermove",pointerup:"pointerup",touchstart:"pointerdown",touchmove:"pointermove",touchend:"pointerup",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup"},WR=["keydown","keyup"],qR=["mousedown","mousemove","mouseup","mouseover","mouseout","mouseleave"],XR=["wheel","mousewheel"],YR={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"},KR={click:"tap",anyclick:"anytap",dblclick:"doubletap",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup",mouseover:"pointerover",mouseout:"pointerout",mouseleave:"pointerleave"},$R="undefined"!=typeof navigator&&navigator.userAgent?navigator.userAgent.toLowerCase():"",QR="undefined"!=typeof window?window:global;"undefined"!=typeof global?global:window,"undefined"!=typeof document&&document;var ZR=!1;try{var JR={get passive(){return ZR=!0,!0}};QR.addEventListener("test",JR,JR),QR.removeEventListener("test",JR,JR)}catch(G){}var eD=-1!==$R.indexOf("firefox"),tD=XR,nD=4.000244140625,iD=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=tD.concat(r.events||[]),this.handleEvent=this.handleEvent.bind(this),this.events.forEach(function(e){return t.addEventListener(e,i.handleEvent,!!ZR&&{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;QR.WheelEvent&&(eD&&e.deltaMode===QR.WheelEvent.DOM_DELTA_PIXEL&&(t/=QR.devicePixelRatio),e.deltaMode===QR.WheelEvent.DOM_DELTA_LINE&&(t*=40));var n={x:e.clientX,y:e.clientY};0!==t&&t%nD==0&&(t=Math.floor(t/nD)),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}(),rD=qR,oD="pointermove",aD="pointerover",sD="pointerout",uD="pointerleave",cD=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=rD.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===oD&&(this.enableMoveEvent=t),e===aD&&(this.enableOverEvent=t),e===sD&&(this.enableOutEvent=t),e===uD&&(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:aD,srcEvent:e,pointerType:"mouse",target:e.target})}},{key:"handleOutEvent",value:function(e){this.enableOutEvent&&"mouseout"===e.type&&this.callback({type:sD,srcEvent:e,pointerType:"mouse",target:e.target})}},{key:"handleLeaveEvent",value:function(e){this.enableLeaveEvent&&"mouseleave"===e.type&&this.callback({type:uD,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:oD,srcEvent:e,pointerType:"mouse",target:e.target});break;case"mouseup":this.pressed=!1}}}]),e}(),lD=WR,hD="keydown",dD=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=lD.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===hD&&(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:hD,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}(),fD="contextmenu",pD=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===fD&&(this.options.enable=t)}},{key:"handleEvent",value:function(e){!this.options.enable||this.callback({type:fD,center:{x:e.clientX,y:e.clientY},srcEvent:e,pointerType:"mouse",target:e.target})}}]),e}(),vD={pointerdown:1,pointermove:2,pointerup:4,mousedown:1,mousemove:2,mouseup:4},gD={srcElement:"root",priority:0},mD=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({},gD,n):gD;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({},yD,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||zR}).on("hammer.input",this._onBasicInput),i.recognizers||Object.keys(UR).forEach(function(e){var t=n.manager.get(e);t&&UR[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 iD(e,this._onOtherEvent,{enable:!1}),this.moveInput=new cD(e,this._onOtherEvent,{enable:!1}),this.keyInput=new dD(e,this._onOtherEvent,{enable:!1,tabIndex:i.tabIndex}),this.contextmenuInput=new pD(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(d){u.e(d)}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=HR[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=KR[e]||e,u=a.get(s);u||(u=new mD(this),a.set(s,u),u.recognizerName=YR[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(KR[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=GR[t.type];n&&this.manager.emit(n,e)}},{key:"_onOtherEvent",value:function(e){this.manager.emit(e.type,e)}}]),e}();function _D(){}var wD={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:function(e,t){return ik.error(e)()},_onMetrics:null,getCursor:function(e){return e.isDragging?"grabbing":"grab"},debug:!1,drawPickingColors:!1},kD=function(){function e(t){m(this,e),t=M(M({},wD),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&&ik.warn("View state tracking is disabled. Use either `initialViewState` for auto update or `viewState` for manual update.")(),"IE"===(0,OR.qs)()&&ik.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 nx({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&&nS.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&&ik.removed("onLayerHover","onHover")(),"onLayerClick"in e&&ik.removed("onLayerClick","onClick")(),e.initialViewState&&!gM(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&&WS(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 NR({width:n,height:i,useDevicePixels:l,autoResizeDrawingBuffer:h,autoResizeViewport:!1,gl:r,onCreateContext:function(e){return Zk(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 MI({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 WI(this.canvas),Uk(e,{blend:!0,blendFunc:[770,771,1,771],polygonOffsetFill:!0,depthTest:!0,depthFunc:515}),this.props.onWebGLInitialized(e);var t=new _I;for(var n in t.play(),this.animationLoop.attachTimeline(t),this.eventManager=new bD(this.props.parent||e.canvas,{touchAction:this.props.touchAction,recognizerOptions:this.props.eventRecognizerOptions,events:{pointerdown:this._onPointerDown,pointermove:this._onPointerMove,pointerleave:this._onPointerMove}}),ak)this.eventManager.on(n,this._onEvent);this.viewManager=new TI({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 OI(e,{deck:this,stats:this.stats,viewport:i,timeline:t}),this.effectManager=new RI,this.deckRenderer=new jI(e),this.deckPicker=new HI(e),this.setProps(this.props),this._updateCanvasSize(),this.props.onLoad()}}},{key:"_drawLayers",value:function(e,t){var n=this.layerManager.context.gl;Uk(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(),ik.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=ak[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=rx.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}();kD.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(eI)),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}},kD.defaultProps=wD,kD.VERSION=MR.VERSION;var xD={name:"project32",dependencies:[uI],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"},SD={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]:SD,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}}),ED={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},OD=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?cx("geometry"):n,r=t.drawMode,o=void 0===r?ED.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,ox(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?(ox(!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 ox(Number.isFinite(n)),n}}],[{key:"DRAW_MODE",get:function(){return ED}}]),e}(),TD=function(){},PD={10241:9987,10240:9729,10242:33071,10243:33071};function AD(e){return Math.pow(2,Math.ceil(Math.log2(e)))}function MD(e){return e&&(e.id||e.url)}function ID(e,t,n){for(var i=0;i0){var n=function(e){for(var t=e.icons,n=e.buffer,i=e.mapping,r=void 0===i?{}:i,o=e.xOffset,a=void 0===o?0:o,s=e.yOffset,u=void 0===s?0:s,c=e.rowHeight,l=void 0===c?0:c,h=e.canvasWidth,d=[],f=0;fh&&(ID(r,d,u),a=0,u=l+u+n,l=0,d=[]),d.push({icon:p,xOffset:a}),a=a+g+n,l=Math.max(l,v)}}return d.length>0&&ID(r,d,u),{mapping:r,rowHeight:l,xOffset:a,yOffset:u,canvasWidth:h,canvasHeight:AD(l+u+n)}}({icons:t,buffer:this._buffer,canvasWidth:this._canvasWidth,mapping:this._mapping,rowHeight:this._rowHeight,xOffset:this._xOffset,yOffset:this._yOffset}),i=n.mapping,r=n.xOffset,o=n.yOffset,a=n.rowHeight,s=n.canvasHeight;this._rowHeight=a,this._mapping=i,this._xOffset=r,this._yOffset=o,this._canvasHeight=s,this._texture||(this._texture=new Rx(this.gl,{width:this._canvasWidth,height:this._canvasHeight,parameters:PD})),this._texture.height!==this._canvasHeight&&(this._texture=function(e,t,n,i){var r=t.width,o=t.height,a=Gx(t,{width:n,height:i});return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=n.sourceX,r=void 0===i?0:i,o=n.sourceY,a=void 0===o?0:o,s=n.targetMipmaplevel,u=void 0===s?0:s,c=n.targetInternalFormat,l=void 0===c?6408:c,h=n.targetX,d=n.targetY,f=n.targetZ,p=n.width,v=n.height,g=Yx(e),m=g.framebuffer,y=g.deleteFramebuffer;ox(m);var b=m.gl,_=m.handle,w=void 0!==h||void 0!==d||void 0!==f;h=h||0,d=d||0,f=f||0;var k=b.bindFramebuffer(36160,_);ox(t);var x=null;if(t instanceof Mx&&(x=t,p=Number.isFinite(p)?p:x.width,v=Number.isFinite(v)?v:x.height,x.bind(0),t=x.target),w)switch(t){case 3553:case 34067:b.copyTexSubImage2D(t,u,h,d,r,a,p,v);break;case 35866:case 32879:dk(b).copyTexSubImage3D(t,u,h,d,f,r,a,p,v)}else b.copyTexImage2D(t,u,l,r,a,p,v,0);x&&x.unbind(),b.bindFramebuffer(36160,k||null),y&&m.delete()}(t,a,{targetY:0,width:r,height:o}),t.delete(),a}(0,this._texture,this._canvasWidth,this._canvasHeight)),this.onUpdate(),this._loadIcons(t)}}},{key:"_loadIcons",value:function(e){var t,n=this,i=this._canvas.getContext("2d"),r=_(e);try{var o=function(){var e=t.value;n._pendingCount++,rM(e.url,ER,n._loadOptions).then(function(t){var r=MD(e),o=n._mapping[r],a=o.x,s=o.y,u=o.width,c=o.height,l=function(e,t,n,i){return n===t.width&&i===t.height?t:(e.canvas.height=i,e.canvas.width=n,e.clearRect(0,0,e.canvas.width,e.canvas.height),e.drawImage(t,0,0,t.width,t.height,0,0,n,i),e.canvas)}(i,t,u,c);n._texture.setSubImageData({data:l,x:a,y:s,width:u,height:c}),n._texture.generateMipmap(),n.onUpdate()}).catch(function(t){n.onError({url:e.url,source:e.source,sourceIndex:e.sourceIndex,loadOptions:n._loadOptions,error:t})}).finally(function(){n._pendingCount--})};for(r.s();!(t=r.n()).done;)o()}catch(a){r.e(a)}finally{r.f()}}}]),e}(),DD=[0,0,0,255],ND={iconAtlas:{type:"image",value:null,async:!0},iconMapping:{type:"object",value:{},async:!0},sizeScale:{type:"number",value:1,min:0},billboard:!0,sizeUnits:"pixels",sizeMinPixels:{type:"number",min:0,value:0},sizeMaxPixels:{type:"number",min:0,value:Number.MAX_SAFE_INTEGER},alphaCutoff:{type:"number",value:.05,min:0,max:1},getPosition:{type:"accessor",value:function(e){return e.position}},getIcon:{type:"accessor",value:function(e){return e.icon}},getColor:{type:"accessor",value:DD},getSize:{type:"accessor",value:1},getAngle:{type:"accessor",value:0},getPixelOffset:{type:"accessor",value:[0,0]},onIconError:{type:"function",value:null,compare:!1,optional:!0}},LD=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(){return e(p(i.prototype),"getShaders",this).call(this,{vs:"#define SHADER_NAME icon-layer-vertex-shader\n\nattribute vec2 positions;\n\nattribute vec3 instancePositions;\nattribute vec3 instancePositions64Low;\nattribute float instanceSizes;\nattribute float instanceAngles;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\nattribute vec4 instanceIconFrames;\nattribute float instanceColorModes;\nattribute vec2 instanceOffsets;\nattribute vec2 instancePixelOffset;\n\nuniform float sizeScale;\nuniform vec2 iconsTextureDim;\nuniform float sizeMinPixels;\nuniform float sizeMaxPixels;\nuniform bool billboard;\n\nvarying float vColorMode;\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\nvarying vec2 uv;\n\nvec2 rotate_by_angle(vec2 vertex, float angle) {\n float angle_radian = angle * PI / 180.0;\n float cos_angle = cos(angle_radian);\n float sin_angle = sin(angle_radian);\n mat2 rotationMatrix = mat2(cos_angle, -sin_angle, sin_angle, cos_angle);\n return rotationMatrix * vertex;\n}\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n geometry.uv = positions;\n geometry.pickingColor = instancePickingColors;\n uv = positions;\n\n vec2 iconSize = instanceIconFrames.zw;\n float sizePixels = clamp(\n project_size_to_pixel(instanceSizes * sizeScale), \n sizeMinPixels, sizeMaxPixels\n );\n float instanceScale = iconSize.y == 0.0 ? 0.0 : sizePixels / iconSize.y;\n vec2 pixelOffset = positions / 2.0 * iconSize + instanceOffsets;\n pixelOffset = rotate_by_angle(pixelOffset, instanceAngles) * instanceScale;\n pixelOffset += instancePixelOffset;\n pixelOffset.y *= -1.0;\n\n if (billboard) {\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, vec3(0.0), geometry.position);\n vec3 offset = vec3(pixelOffset, 0.0);\n DECKGL_FILTER_SIZE(offset, geometry);\n gl_Position.xy += project_pixel_size_to_clipspace(offset.xy);\n\n } else {\n vec3 offset_common = vec3(project_pixel_size(pixelOffset), 0.0);\n DECKGL_FILTER_SIZE(offset_common, geometry);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, offset_common, geometry.position); \n }\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n vTextureCoords = mix(\n instanceIconFrames.xy,\n instanceIconFrames.xy + iconSize,\n (positions.xy + 1.0) / 2.0\n ) / iconsTextureDim;\n\n vColor = instanceColors;\n DECKGL_FILTER_COLOR(vColor, geometry);\n\n vColorMode = instanceColorModes;\n}\n",fs:"#define SHADER_NAME icon-layer-fragment-shader\n\nprecision highp float;\n\nuniform float opacity;\nuniform sampler2D iconsTexture;\nuniform float alphaCutoff;\n\nvarying float vColorMode;\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\nvarying vec2 uv;\n\nvoid main(void) {\n geometry.uv = uv;\n\n vec4 texColor = texture2D(iconsTexture, vTextureCoords);\n vec3 color = mix(texColor.rgb, vColor.rgb, vColorMode);\n float a = texColor.a * opacity * vColor.a;\n\n if (a < alphaCutoff) {\n discard;\n }\n\n gl_FragColor = vec4(color, a);\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:[xD,CD]})}},{key:"initializeState",value:function(){this.state={iconManager:new RD(this.context.gl,{onUpdate:this._onUpdate.bind(this),onError:this._onError.bind(this)})},this.getAttributeManager().addInstanced({instancePositions:{size:3,type:5130,fp64:this.use64bitPositions(),transition:!0,accessor:"getPosition"},instanceSizes:{size:1,transition:!0,accessor:"getSize",defaultValue:1},instanceOffsets:{size:2,accessor:"getIcon",transform:this.getInstanceOffset},instanceIconFrames:{size:4,accessor:"getIcon",transform:this.getInstanceIconFrame},instanceColorModes:{size:1,type:5121,accessor:"getIcon",transform:this.getInstanceColorMode},instanceColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:!0,accessor:"getColor",defaultValue:DD},instanceAngles:{size:1,transition:!0,accessor:"getAngle"},instancePixelOffset:{size:2,transition:!0,accessor:"getPixelOffset"}})}},{key:"updateState",value:function(t){var n=t.oldProps,r=t.props,o=t.changeFlags;e(p(i.prototype),"updateState",this).call(this,{props:r,oldProps:n,changeFlags:o});var a=this.getAttributeManager(),s=r.iconAtlas,u=r.iconMapping,c=r.data,l=r.getIcon,h=this.state.iconManager;h.setProps({loadOptions:r.loadOptions});var d=!1;if(s||this.internalState.isAsyncPropLoading("iconAtlas")?(n.iconAtlas!==r.iconAtlas&&h.setProps({iconAtlas:s,autoPacking:!1}),n.iconMapping!==r.iconMapping&&(h.setProps({iconMapping:u}),d=!0)):h.setProps({autoPacking:!0}),(o.dataChanged||o.updateTriggersChanged&&(o.updateTriggersChanged.all||o.updateTriggersChanged.getIcon))&&h.setProps({data:c,getIcon:l}),d&&(a.invalidate("instanceOffsets"),a.invalidate("instanceIconFrames"),a.invalidate("instanceColorModes")),o.extensionsChanged){var f,v=this.context.gl;null===(f=this.state.model)||void 0===f||f.delete(),this.state.model=this._getModel(v),a.invalidateAll()}}},{key:"isLoaded",get:function(){return e(p(i.prototype),"isLoaded",this)&&this.state.iconManager.isLoaded}},{key:"finalizeState",value:function(){e(p(i.prototype),"finalizeState",this).call(this),this.state.iconManager.finalize()}},{key:"draw",value:function(e){var t=e.uniforms,n=this.props,i=n.sizeScale,r=n.sizeMinPixels,o=n.sizeMaxPixels,a=n.sizeUnits,s=n.billboard,u=n.alphaCutoff,c=this.state.iconManager,l=this.context.viewport,h=c.getTexture();h&&this.state.model.setUniforms(t).setUniforms({iconsTexture:h,iconsTextureDim:[h.width,h.height],sizeScale:i*("pixels"===a?l.metersPerPixel:1),sizeMinPixels:r,sizeMaxPixels:o,billboard:s,alphaCutoff:u}).draw()}},{key:"_getModel",value:function(e){return new nO(e,I(M({},this.getShaders()),{id:this.props.id,geometry:new OD({drawMode:6,attributes:{positions:{size:2,value:new Float32Array([-1,-1,-1,1,1,1,1,-1])}}}),isInstanced:!0}))}},{key:"_onUpdate",value:function(){this.setNeedsRedraw()}},{key:"_onError",value:function(e){var t=this.getCurrentLayer().props.onIconError;t?t(e):ik.error(e.error)()}},{key:"getInstanceOffset",value:function(e){var t=this.state.iconManager.getIconMapping(e);return[t.width/2-t.anchorX||0,t.height/2-t.anchorY||0]}},{key:"getInstanceColorMode",value:function(e){return this.state.iconManager.getIconMapping(e).mask?1:0}},{key:"getInstanceIconFrame",value:function(e){var t=this.state.iconManager.getIconMapping(e);return[t.x||0,t.y||0,t.width||0,t.height||0]}}]),i}(hM);return t.layerName="IconLayer",t.defaultProps=ND,t}(),jD=[],FD={getIconOffsets:{type:"accessor",value:function(e){return e.offsets}},alphaCutoff:.001,smoothing:.1,outlineWidth:0,outlineColor:{type:"color",value:[0,0,0,255]}},BD=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(){return I(M({},e(p(i.prototype),"getShaders",this).call(this)),{fs:"#define SHADER_NAME multi-icon-layer-fragment-shader\n\nprecision highp float;\n\nuniform float opacity;\nuniform sampler2D iconsTexture;\nuniform float gamma;\nuniform bool sdf;\nuniform float alphaCutoff;\nuniform float buffer;\nuniform float outlineBuffer;\nuniform vec4 outlineColor;\n\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\nvarying vec2 uv;\n\nvoid main(void) {\n geometry.uv = uv;\n\n if (!picking_uActive) {\n float alpha = texture2D(iconsTexture, vTextureCoords).a;\n vec4 color = vColor;\n if (sdf) {\n float distance = alpha;\n alpha = smoothstep(buffer - gamma, buffer + gamma, distance);\n\n if (outlineBuffer > 0.0) {\n float inFill = alpha;\n float inBorder = smoothstep(outlineBuffer - gamma, outlineBuffer + gamma, distance);\n color = mix(outlineColor, vColor, inFill);\n alpha = inBorder;\n }\n }\n float a = alpha * color.a;\n \n if (a < alphaCutoff) {\n discard;\n }\n\n gl_FragColor = vec4(color.rgb, a * opacity);\n }\n\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n"})}},{key:"initializeState",value:function(){var t=this;e(p(i.prototype),"initializeState",this).call(this),this.getAttributeManager().addInstanced({instanceOffsets:{size:2,accessor:"getIconOffsets"},instancePickingColors:{type:5121,size:3,accessor:function(e,n){var i=n.index,r=n.target;return t.encodePickingColor(i,r)}}})}},{key:"updateState",value:function(t){e(p(i.prototype),"updateState",this).call(this,t);var n=t.props,r=t.oldProps,o=n.outlineColor;o!==r.outlineColor&&((o=o.map(function(e){return e/255}))[3]=Number.isFinite(o[3])?o[3]:1,this.setState({outlineColor:o})),!n.sdf&&n.outlineWidth&&ik.warn("".concat(this.id,": fontSettings.sdf is required to render outline"))()}},{key:"draw",value:function(t){var n=this.props,r=n.sdf,o=n.smoothing,a=n.outlineWidth,s=this.state.outlineColor;t.uniforms=I(M({},t.uniforms),{buffer:.75,outlineBuffer:a?Math.max(o,.75*(1-a)):-1,gamma:o,sdf:Boolean(r),outlineColor:s}),e(p(i.prototype),"draw",this).call(this,t)}},{key:"getInstanceOffset",value:function(t){var n=this;return t?Array.from(t).map(function(t){return e(p(i.prototype),"getInstanceOffset",n).call(n,t)}):jD}},{key:"getInstanceColorMode",value:function(e){return 1}},{key:"getInstanceIconFrame",value:function(t){var n=this;return t?Array.from(t).map(function(t){return e(p(i.prototype),"getInstanceIconFrame",n).call(n,t)}):jD}}]),i}(LD);return t.layerName="MultiIconLayer",t.defaultProps=FD,t}(),VD=r(51002),zD=r.n(VD),UD=[];function HD(e){return Math.pow(2,Math.ceil(Math.log2(e)))}function GD(e,t,n,i){for(var r=0,o=t;oi&&(a4&&void 0!==arguments[4]?arguments[4]:0,o=arguments.length>5?arguments[5]:void 0;void 0===o&&(o=e.length);var a=[];return"break-all"===t?WD(e,r,o,n,i,a):function(e,t,n,i,r,o){for(var a=t,s=t,u=t,c=0,l=t;ls){var h=GD(e,s,u,r);c+h>i&&(ai&&(h=WD(e,s,u,i,r,o),a=o[o.length-1])),s=u,c+=h}}(e,r,o,n,i,a),a}function XD(e,t,n,i,r,o){for(var a=0,s=0,u=t;u0,l=[0,0],h=[],d=0,f=0,p=0,v=0;v<=o;v++){var g=e[v];if(("\n"===g||v===o)&&(p=v),p>f){for(var m=c?qD(e,n,i,r,f,p):UD,y=0;y<=m.length;y++){var b=0===y?f:m[y-1],_=y0&&void 0!==arguments[0]?arguments[0]:5;m(this,e),this.limit=t,this.clear()}return b(e,[{key:"clear",value:function(){this._cache={},this._order=[]}},{key:"get",value:function(e){var t=this._cache[e];return t&&(this._deleteOrder(e),this._appendOrder(e)),t}},{key:"set",value:function(e,t){this._cache[e]?(this.delete(e),this._cache[e]=t,this._appendOrder(e)):(Object.keys(this._cache).length===this.limit&&this.delete(this._order[0]),this._cache[e]=t,this._appendOrder(e))}},{key:"delete",value:function(e){this._cache[e]&&(this._deleteCache(e),this._deleteOrder(e))}},{key:"_deleteCache",value:function(e){delete this._cache[e]}},{key:"_deleteOrder",value:function(e){var t=this._order.findIndex(function(t){return t===e});t>=0&&this._order.splice(t,1)}},{key:"_appendOrder",value:function(e){this._order.push(e)}}]),e}())(3),ZD=["fontFamily","fontWeight","characterSet","fontSize","sdf","buffer","cutoff","radius"];function JD(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};ZD.forEach(function(n){n in t&&(e.props[n]=t[n])});var n=this._key;this._key=this._getKey();var i=function(e,t){var n=QD.get(e);if(!n)return t;var i=[],r=Object.keys(n.mapping);r=new Set(r);var o=t;return o instanceof Array&&(o=new Set(o)),o.forEach(function(e){r.has(e)||i.push(e)}),i}(this._key,this.props.characterSet),r=QD.get(this._key);if(r&&0===i.length)this._key!==n&&(this._atlas=r);else{var o=this._generateFontAtlas(this._key,i,r);this._atlas=o,QD.set(this._key,o)}}},{key:"_generateFontAtlas",value:function(e,t,n){var i=this.props,r=i.fontFamily,o=i.fontWeight,a=i.fontSize,s=i.buffer,u=i.sdf,c=i.radius,l=i.cutoff,h=n&&n.data;h||((h=document.createElement("canvas")).width=1024);var d=h.getContext("2d");eN(d,r,a,o);var f=function(e){var t,n=e.characterSet,i=e.getFontWidth,r=e.fontHeight,o=e.buffer,a=e.maxCanvasWidth,s=e.mapping,u=void 0===s?{}:s,c=e.xOffset,l=void 0===c?0:c,h=e.yOffset,d=void 0===h?0:h,f=0,p=l,v=0,g=_(n);try{for(g.s();!(t=g.n()).done;){var m=t.value;if(!u[m]){var y=i(m,v++);p+y+2*o>a&&(p=0,f++),u[m]={x:p+o,y:d+f*(r+2*o)+o,width:y,height:r},p+=y+2*o}}}catch(w){g.e(w)}finally{g.f()}var b=r+2*o;return{mapping:u,xOffset:p,yOffset:d+f*b,canvasHeight:HD(d+(f+1)*b)}}(M({getFontWidth:function(e){return d.measureText(e).width},fontHeight:1.2*a,buffer:s,characterSet:t,maxCanvasWidth:1024},n&&{mapping:n.mapping,xOffset:n.xOffset,yOffset:n.yOffset})),p=f.mapping,v=f.canvasHeight,g=f.xOffset,m=f.yOffset;if(h.height!==v){var y=d.getImageData(0,0,h.width,h.height);h.height=v,d.putImageData(y,0,0)}if(eN(d,r,a,o),u){var b,w=new(zD())(a,s,c,l,r,o),k=d.getImageData(0,0,w.size,w.size),x=_(t);try{for(x.s();!(b=x.n()).done;){var S=b.value;JD(w.draw(S),k),d.putImageData(k,p[S].x-s,p[S].y+s)}}catch(T){x.e(T)}finally{x.f()}}else{var C,E=_(t);try{for(E.s();!(C=E.n()).done;){var O=C.value;d.fillText(O,p[O].x,p[O].y+.9*a)}}catch(T){E.e(T)}finally{E.f()}}return{xOffset:g,yOffset:m,mapping:p,data:h,width:h.width,height:h.height}}},{key:"_getKey",value:function(){var e=this.props,t=e.fontFamily,n=e.fontWeight,i=e.fontSize,r=e.buffer,o=e.sdf,a=e.radius,s=e.cutoff;return o?"".concat(t," ").concat(n," ").concat(i," ").concat(r," ").concat(a," ").concat(s):"".concat(t," ").concat(n," ").concat(i," ").concat(r)}}]),e}(),nN={billboard:!0,sizeScale:1,sizeUnits:"pixels",sizeMinPixels:0,sizeMaxPixels:Number.MAX_SAFE_INTEGER,padding:{type:"array",value:[0,0,0,0]},getPosition:{type:"accessor",value:function(e){return e.position}},getSize:{type:"accessor",value:1},getAngle:{type:"accessor",value:0},getPixelOffset:{type:"accessor",value:[0,0]},getBoundingRect:{type:"accessor",value:[0,0,0,0]},getFillColor:{type:"accessor",value:[0,0,0,255]},getLineColor:{type:"accessor",value:[0,0,0,255]},getLineWidth:{type:"accessor",value:1}},iN=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(){return e(p(i.prototype),"getShaders",this).call(this,{vs:"#define SHADER_NAME text-background-layer-vertex-shader\n\nattribute vec2 positions;\n\nattribute vec3 instancePositions;\nattribute vec3 instancePositions64Low;\nattribute vec4 instanceRects;\nattribute float instanceSizes;\nattribute float instanceAngles;\nattribute vec2 instancePixelOffsets;\nattribute float instanceLineWidths;\nattribute vec4 instanceFillColors;\nattribute vec4 instanceLineColors;\nattribute vec3 instancePickingColors;\n\nuniform bool billboard;\nuniform float opacity;\nuniform float sizeScale;\nuniform float sizeMinPixels;\nuniform float sizeMaxPixels;\nuniform vec4 padding;\n\nvarying vec4 vFillColor;\nvarying vec4 vLineColor;\nvarying float vLineWidth;\nvarying vec2 uv;\nvarying vec2 dimensions;\n\nvec2 rotate_by_angle(vec2 vertex, float angle) {\n float angle_radian = radians(angle);\n float cos_angle = cos(angle_radian);\n float sin_angle = sin(angle_radian);\n mat2 rotationMatrix = mat2(cos_angle, -sin_angle, sin_angle, cos_angle);\n return rotationMatrix * vertex;\n}\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n geometry.uv = positions;\n geometry.pickingColor = instancePickingColors;\n uv = positions;\n vLineWidth = instanceLineWidths;\n float sizePixels = clamp(\n project_size_to_pixel(instanceSizes * sizeScale),\n sizeMinPixels, sizeMaxPixels\n );\n\n dimensions = instanceRects.zw * sizePixels + padding.xy + padding.zw;\n\n vec2 pixelOffset = (positions * instanceRects.zw + instanceRects.xy) * sizePixels + mix(-padding.xy, padding.zw, positions);\n pixelOffset = rotate_by_angle(pixelOffset, instanceAngles);\n pixelOffset += instancePixelOffsets;\n pixelOffset.y *= -1.0;\n\n if (billboard) {\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, vec3(0.0), geometry.position);\n vec3 offset = vec3(pixelOffset, 0.0);\n DECKGL_FILTER_SIZE(offset, geometry);\n gl_Position.xy += project_pixel_size_to_clipspace(offset.xy);\n } else {\n vec3 offset_common = vec3(project_pixel_size(pixelOffset), 0.0);\n DECKGL_FILTER_SIZE(offset_common, geometry);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, offset_common, geometry.position);\n }\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n vFillColor = vec4(instanceFillColors.rgb, instanceFillColors.a * opacity);\n DECKGL_FILTER_COLOR(vFillColor, geometry);\n vLineColor = vec4(instanceLineColors.rgb, instanceLineColors.a * opacity);\n DECKGL_FILTER_COLOR(vLineColor, geometry);\n}\n",fs:"#define SHADER_NAME text-background-layer-fragment-shader\n\nprecision highp float;\n\nuniform bool stroked;\n\nvarying vec4 vFillColor;\nvarying vec4 vLineColor;\nvarying float vLineWidth;\nvarying vec2 uv;\nvarying vec2 dimensions;\n\nvoid main(void) {\n geometry.uv = uv;\n\n vec2 pixelPosition = uv * dimensions;\n if (stroked) {\n float distToEdge = min(\n min(pixelPosition.x, dimensions.x - pixelPosition.x),\n min(pixelPosition.y, dimensions.y - pixelPosition.y)\n );\n float isBorder = smoothedge(distToEdge, vLineWidth);\n gl_FragColor = mix(vFillColor, vLineColor, isBorder);\n } else {\n gl_FragColor = vFillColor;\n }\n\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:[xD,CD]})}},{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instancePositions:{size:3,type:5130,fp64:this.use64bitPositions(),transition:!0,accessor:"getPosition"},instanceSizes:{size:1,transition:!0,accessor:"getSize",defaultValue:1},instanceAngles:{size:1,transition:!0,accessor:"getAngle"},instanceRects:{size:4,accessor:"getBoundingRect"},instancePixelOffsets:{size:2,transition:!0,accessor:"getPixelOffset"},instanceFillColors:{size:4,transition:!0,normalized:!0,type:5121,accessor:"getFillColor",defaultValue:[0,0,0,255]},instanceLineColors:{size:4,transition:!0,normalized:!0,type:5121,accessor:"getLineColor",defaultValue:[0,0,0,255]},instanceLineWidths:{size:1,transition:!0,accessor:"getLineWidth",defaultValue: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}),o.extensionsChanged){var a,s=this.context.gl;null===(a=this.state.model)||void 0===a||a.delete(),this.state.model=this._getModel(s),this.getAttributeManager().invalidateAll()}}},{key:"draw",value:function(e){var t=e.uniforms,n=this.context.viewport,i=this.props,r=i.billboard,o=i.sizeScale,a=i.sizeUnits,s=i.sizeMinPixels,u=i.sizeMaxPixels,c=i.getLineWidth,l=this.props.padding,h="pixels"===a?n.metersPerPixel:1;l.length<4&&(l=[l[0],l[1],l[0],l[1]]),this.state.model.setUniforms(t).setUniforms({billboard:r,stroked:Boolean(c),padding:l,sizeScale:o*h,sizeMinPixels:s,sizeMaxPixels:u}).draw()}},{key:"_getModel",value:function(e){return new nO(e,I(M({},this.getShaders()),{id:this.props.id,geometry:new OD({drawMode:6,vertexCount:4,attributes:{positions:{size:2,value:new Float32Array([0,0,1,0,1,1,0,1])}}}),isInstanced:!0}))}}]),i}(hM);return t.layerName="TextBackgroundLayer",t.defaultProps=nN,t}(),rN={fontSize:64,buffer:4,sdf:!1,radius:12,cutoff:.25,smoothing:.1},oN={start:1,middle:0,end:-1},aN={top:1,center:0,bottom:-1},sN=[0,0,0,255],uN=["fontSize","buffer","sdf","radius","cutoff"],cN={billboard:!0,sizeScale:1,sizeUnits:"pixels",sizeMinPixels:0,sizeMaxPixels:Number.MAX_SAFE_INTEGER,background:!1,getBackgroundColor:{type:"accessor",value:[255,255,255,255]},getBorderColor:{type:"accessor",value:sN},getBorderWidth:{type:"accessor",value:0},backgroundPadding:{type:"array",value:[0,0,0,0]},characterSet:{type:"object",value:KD},fontFamily:$D,fontWeight:"normal",lineHeight:1,outlineWidth:{type:"number",value:0,min:0},outlineColor:{type:"color",value:sN},fontSettings:{},wordBreak:"break-word",maxWidth:{type:"number",value:-1},getText:{type:"accessor",value:function(e){return e.text}},getPosition:{type:"accessor",value:function(e){return e.position}},getColor:{type:"accessor",value:sN},getSize:{type:"accessor",value:32},getAngle:{type:"accessor",value:0},getTextAnchor:{type:"accessor",value:"middle"},getAlignmentBaseline:{type:"accessor",value:"center"},getPixelOffset:{type:"accessor",value:[0,0]},backgroundColor:{deprecatedFor:["background","getBackgroundColor"]}},lN=function(){var e=function(e){a(i,e);var n=s(i);function i(){return m(this,i),n.apply(this,arguments)}return b(i,[{key:"initializeState",value:function(){this.state={styleVersion:0,fontAtlasManager:new tN}}},{key:"updateState",value:function(e){var t=e.props,n=e.oldProps,i=e.changeFlags,r=this.state.characterSet;(i.dataChanged||i.updateTriggersChanged&&(i.updateTriggersChanged.all||i.updateTriggersChanged.getText))&&this._updateText();var o=r!==this.state.characterSet||this._fontChanged(n,t);o&&this._updateFontAtlas(n,t),(o||t.lineHeight!==n.lineHeight||t.wordBreak!==n.wordBreak||t.maxWidth!==n.maxWidth)&&this.setState({styleVersion:this.state.styleVersion+1})}},{key:"getPickingInfo",value:function(e){var t=e.info;return t.object=t.index>=0?this.props.data[t.index]:null,t}},{key:"_updateFontAtlas",value:function(e,t){var n=t.fontSettings,i=t.fontFamily,r=t.fontWeight,o=this.state,a=o.fontAtlasManager,s=o.characterSet;a.setProps(I(M(M({},rN),n),{characterSet:s,fontFamily:i,fontWeight:r}))}},{key:"_fontChanged",value:function(e,t){if(e.fontFamily!==t.fontFamily||e.fontWeight!==t.fontWeight)return!0;if(e.fontSettings===t.fontSettings)return!1;var n=e.fontSettings||{},i=t.fontSettings||{};return uN.some(function(e){return n[e]!==i[e]})}},{key:"_updateText",value:function(){var e,t=this.props,n=t.data,i=t.characterSet,r=n.attributes&&n.attributes.getText,o=this.props.getText,a=n.startIndices,s="auto"===i&&new Set;if(r&&a){var u=function(e){var t=e.value,n=e.length,i=e.stride,r=e.offset,o=e.startIndices,a=e.characterSet,s=t.BYTES_PER_ELEMENT,u=i?i/s:1,c=r?r/s:0,l=o[n]||Math.ceil((t.length-c)/u),h=a&&new Set,d=new Array(n),f=t;if(u>1||c>0){f=new t.constructor(l);for(var p=0;p0&&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 pN={name:"lights",vs:hN,fs:hN,getUniforms:function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:dN;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?fN(t):[0,0,0],i.forEach(function(e,t){a["lighting_uPointLight[".concat(t,"].color")]=fN(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")]=fN(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}},vN={},gN={name:"phong-lighting",dependencies:[pN],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]:vN;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}}},mN=Math.PI/180,yN=new Float32Array(16),bN=new Float32Array(12);function _N(e,t,n){var i=t[0]*mN,r=t[1]*mN,o=t[2]*mN,a=Math.sin(o),s=Math.sin(i),u=Math.sin(r),c=Math.cos(o),l=Math.cos(i),h=Math.cos(r),d=n[0],f=n[1],p=n[2];e[0]=d*h*l,e[1]=d*u*l,e[2]=d*-s,e[3]=f*(-u*c+h*s*a),e[4]=f*(h*c+u*s*a),e[5]=f*l*a,e[6]=p*(u*a+h*s*c),e[7]=p*(-h*a+u*s*c),e[8]=p*l*c}function wN(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 kN={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,d=Array.isArray(s),f=Array.isArray(a),p=Array.isArray(u),v=h||!l&&Boolean(c(o[0]));e.constant=v?h:f&&d&&p;var g=e.value;if(e.constant){var m;v?(yN.set(c),m=wN(yN)):(_N(m=bN,a,s),m.set(u,9)),e.value=new Float32Array(m)}else{var y,b=n*e.size,w=YS(o,n,i),k=w.iterable,x=w.objectInfo,S=_(k);try{for(S.s();!(y=S.n()).done;){var C=y.value,E=void 0;x.index++,v?(yN.set(h?c:c(C,x)),E=wN(yN)):(_N(E=bN,f?a:a(C,x),d?s:s(C,x)),E.set(p?u:u(C,x),9)),g[b++]=E[0],g[b++]=E[1],g[b++]=E[2],g[b++]=E[3],g[b++]=E[4],g[b++]=E[5],g[b++]=E[6],g[b++]=E[7],g[b++]=E[8],g[b++]=E[9],g[b++]=E[10],g[b++]=E[11]}}catch(O){S.e(O)}finally{S.f()}}}};function xN(e,t){return t===rk.CARTESIAN||t===rk.METER_OFFSETS||t===rk.DEFAULT&&!e.isGeospatial}function SN(e,t){(e.COLOR_0||e.colors)&&t||(e.colors={constant:!0,value:new Float32Array([1,1,1])}),ik.assert(e.positions||e.POSITION,'no "postions" or "POSITION" attribute in mesh')}function CN(e,t){if(e.attributes)return SN(e.attributes,t),e instanceof OD?e:new OD(e);if(e.positions||e.POSITION)return SN(e,t),new OD({attributes:e});throw Error("Invalid mesh")}var EN={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:[]}},ON=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=!lk(this.context.gl),n={};return Zx(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:[xD,gN,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:kN}),this.setState({emptyTexture:new Rx(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||xN(n,o),flatShading:!this.state.hasNormals}).draw()}}},{key:"getModel",value:function(e){var t=new nO(this.context.gl,I(M({},this.getShaders()),{id:this.props.id,geometry:CN(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}(hM);return t.layerName="SimpleMeshLayer",t.defaultProps=EN,t}(),TN={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:[pN]},PN=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};m(this,e);var n=t.id;this.id=n||cx(this.constructor.name),this.display=!0,this.position=new FS,this.rotation=new FS,this.scale=new FS(1,1,1),this.matrix=new $O,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 ox(3===e.length,"setPosition requires vector argument"),this.position=e,this}},{key:"setRotation",value:function(e){return ox(3===e.length,"setRotation requires vector argument"),this.rotation=e,this}},{key:"setScale",value:function(e){return ox(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){ox(e),t=t||this.matrix;var n=new $O(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}(),AN=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 sk.assert(a.every(function(e){return e instanceof PN}),"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 $O:r,a=new $O(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}(PN);function MN(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],d=n[0],f=n[1],p=n[2],v=n[3],g=n[4],m=n[5],y=n[6],b=n[7],_=n[8];return e[0]=d*i+f*a+p*c,e[1]=d*r+f*s+p*l,e[2]=d*o+f*u+p*h,e[3]=v*i+g*a+m*c,e[4]=v*r+g*s+m*l,e[5]=v*o+g*u+m*h,e[6]=y*i+b*a+_*c,e[7]=y*r+b*s+_*l,e[8]=y*o+b*u+_*h,e}function IN(e,t,n){var i=n[0],r=n[1];return e[0]=i*t[0],e[1]=i*t[1],e[2]=i*t[2],e[3]=r*t[3],e[4]=r*t[4],e[5]=r*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function RN(){var e=new kS(4);return kS!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e[3]=1,e}function DN(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e}function NN(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 LN(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}function jN(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);return e[0]=i*u+a*s,e[1]=r*u+o*s,e[2]=o*u-r*s,e[3]=a*u-i*s,e}function FN(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);return e[0]=i*u-o*s,e[1]=r*u+a*s,e[2]=o*u+i*s,e[3]=a*u-r*s,e}function BN(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);return e[0]=i*u+r*s,e[1]=r*u-i*s,e[2]=o*u+a*s,e[3]=a*u-o*s,e}function VN(e,t){var n=t[0],i=t[1],r=t[2];return e[0]=n,e[1]=i,e[2]=r,e[3]=Math.sqrt(Math.abs(1-n*n-i*i-r*r)),e}function zN(e,t,n,i){var r,o,a,s,u,c=t[0],l=t[1],h=t[2],d=t[3],f=n[0],p=n[1],v=n[2],g=n[3];return(o=c*f+l*p+h*v+d*g)<0&&(o=-o,f=-f,p=-p,v=-v,g=-g),1-o>wS?(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*f,e[1]=s*l+u*p,e[2]=s*h+u*v,e[3]=s*d+u*g,e}function UN(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;return e[0]=-n*s,e[1]=-i*s,e[2]=-r*s,e[3]=o*s,e}function HN(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e}function GN(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}return e}var WN=function(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e},qN=IO,XN=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]},YN=function(e,t,n,i){var r=t[0],o=t[1],a=t[2],s=t[3];return 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),e},KN=function(e){return Math.hypot(e[0],e[1],e[2],e[3])},$N=function(e){var t=e[0],n=e[1],i=e[2],r=e[3];return t*t+n*n+i*i+r*r},QN=function(){var e=xS(),t=SS(1,0,0),n=SS(0,1,0);return function(i,r,o){var a=CS(r,o);return a<-.999999?(ES(e,t,r),function(e){return Math.hypot(e[0],e[1],e[2])}(e)<1e-6&&ES(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),NN(i,e,Math.PI),i):a>.999999?(i[0]=0,i[1]=0,i[2]=0,i[3]=1,i):(ES(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))}}();RN(),RN(),function(){var e=new kS(9);kS!=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 ZN=[0,0,0,1],JN=function(e){a(i,e);var n=s(i);function i(){var e,t=arguments.length>0&&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 GN(this,e),this.check()}},{key:"identity",value:function(){return DN(this),this.check()}},{key:"fromAxisRotation",value:function(e,t){return NN(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]=gS(e)}},{key:"y",get:function(){return this[1]},set:function(e){this[1]=gS(e)}},{key:"z",get:function(){return this[2]},set:function(e){this[2]=gS(e)}},{key:"w",get:function(){return this[3]},set:function(e){this[3]=gS(e)}},{key:"len",value:function(){return KN(this)}},{key:"lengthSquared",value:function(){return $N(this)}},{key:"dot",value:function(e,t){if(void 0!==t)throw new Error("Quaternion.dot only takes one argument");return XN(this,e)}},{key:"rotationTo",value:function(e,t){return QN(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 WN(this,this,e),this.check()}},{key:"calculateW",value:function(){return VN(this,this),this.check()}},{key:"conjugate",value:function(){return HN(this,this),this.check()}},{key:"invert",value:function(){return UN(this,this),this.check()}},{key:"lerp",value:function(e,t,n){return YN(this,e,t,n),this.check()}},{key:"multiplyRight",value:function(e,t){return pS(!t),LN(this,this,e),this.check()}},{key:"multiplyLeft",value:function(e,t){return pS(!t),LN(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 jN(this,this,e),this.check()}},{key:"rotateY",value:function(e){return FN(this,this,e),this.check()}},{key:"rotateZ",value:function(e){return BN(this,this,e),this.check()}},{key:"scale",value:function(e){return qN(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?ZN:a,n=o.target,i=o.ratio;break;case 2:n=(r=t(arguments,2))[0],i=r[1],e=this}return zN(this,e,n,i),this.check()}},{key:"transformVector4",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;return DO(t,e,this),mS(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}(vS),eL={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},tL={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function nL(e){if(!e._animation){var t=tL[e.componentType],n=eL[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;s=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:sk.warn("Bad animation path ".concat(i))()}ox(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){rL.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 nO?(t.model=e,t._setModelNodeProps(r)):t.model=new nO(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}(PN),uL=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},Zx(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 Rx(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&&(sk.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 cL(e,t){return lk(e)?"#version 300 es\n".concat(t):t}var lL={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},hL={modelOptions:{},pbrDebug:!1,imageBasedLightingEnvironment:null,lights:!0,useTangents:!1},dL=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({},hL,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 aL(this.gltf):null}},{key:"createScene",value:function(e){var t=this,n=(e.nodes||[]).map(function(e){return t.createNode(e)});return new AN({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 AN({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 $O).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 AN({id:e.name||e.id,children:n});e._mesh=i}return e._mesh}},{key:"getVertexCount",value:function(e){sk.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 uL(e,t);sk.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 sL(e,Object.assign({id:n,drawMode:i,vertexCount:r,modules:[TN],defines:s.defines,parameters:s.parameters,vs:cL(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:cL(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))),sk.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 wx({buffer:t,offset:e.byteOffset||0,stride:e.bufferView.byteStride||0,type:e.componentType,size:lL[e.type]})}},{key:"createSampler",value:function(e){return e}},{key:"needsPOT",value:function(){return!1}}]),e}();function fL(e,t,n){if(e.byteLength<=t+n)return"";for(var i=new DataView(e),r="",o=0;o")}}]),i}(wL,Symbol.toStringTag),RL=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),FP(this,"name",void 0),FP(this,"type",void 0),FP(this,"nullable",void 0),FP(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 DL(e,t,n){var i=n?NL(n.metadata):void 0,r=function(e){switch(e.constructor){case Int8Array:return new xL;case Uint8Array:return new EL;case Int16Array:return new SL;case Uint16Array:return new OL;case Int32Array:return new CL;case Uint32Array:return new TL;case Float32Array:return new AL;case Float64Array:return new ML;default:throw new Error("array type not supported")}}(t.value);return new RL(e,new IL(t.size,new RL("value",r)),!1,i)}function NL(e){var t=new Map;for(var n in e)t.set("".concat(n,".string"),JSON.stringify(e[n]));return t}var LL={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},jL={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array},FL=function(){function e(t){m(this,e),FP(this,"draco",void 0),FP(this,"decoder",void 0),FP(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=d>a?d:a}return[[t,n,i],[r,o,a]]}(u.attributes),l=function(e,t,n){var i=NL(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=DL(a,e[a],o[a]);r.push(s)}if(n){var u=DL("indices",n);r.push(u)}return new bL(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=HL(t,n,i)),VL[t]=VL[t]||GL(t),e.next=6,VL[t];case 6:return e.abrupt("return",e.sent);case 7:case"end":return e.stop()}},e)}))).apply(this,arguments)}function HL(e,t,n){if(e.startsWith("http"))return e;var i=n.modules||{};return i[e]?i[e]:eA?n.CDN?($P(n.CDN.startsWith("http")),"".concat(n.CDN,"/").concat(t,"@3.0.12/dist/libs/").concat(e)):tA?"../src/libs/".concat(e):"modules/".concat(t,"/src/libs/").concat(e):"modules/".concat(t,"/dist/libs/").concat(e)}function GL(e){return WL.apply(this,arguments)}function WL(){return(WL=Vx(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(!eA){e.next=24;break}if(!tA){e.next=13;break}e.t2=importScripts(t),e.next=21;break;case 13:return e.t3=qL,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=BL.requireFromFile,!e.t6){e.next=29;break}return e.next=28,BL.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 qL(e,t){if(!eA)return BL.requireFromString&&BL.requireFromString(e,t);if(tA)return eval.call(JP,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 XL,YL="https://www.gstatic.com/draco/versioned/decoders/1.4.1/draco_decoder.js",KL="https://www.gstatic.com/draco/versioned/decoders/1.4.1/draco_wasm_wrapper.js",$L="https://www.gstatic.com/draco/versioned/decoders/1.4.1/draco_decoder.wasm";function QL(e){return ZL.apply(this,arguments)}function ZL(){return(ZL=Vx(regeneratorRuntime.mark(function e(t){var n;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.modules||{},XL=n.draco3d?XL||n.draco3d.createDecoderModule({}).then(function(e){return{draco:e}}):XL||JL(t),e.next=4,XL;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=Vx(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,zL(YL,"draco",n);case 5:return i=e.sent,e.abrupt("break",21);case 7:return e.t1=Promise,e.next=10,zL(KL,"draco",n);case 10:return e.t2=e.sent,e.next=13,zL($L,"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,tj(i,r);case 24:return e.abrupt("return",e.sent);case 25:case"end":return e.stop()}},e)}))).apply(this,arguments)}function tj(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 nj=I(M({},yL),{parse:function(e,t){return ij.apply(this,arguments)}});function ij(){return(ij=Vx(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,QL(n);case 2:return i=e.sent,r=i.draco,o=new FL(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 rj(e,t){return lP(e>=0),lP(t>0),e+(t-1)&~(t-1)}function oj(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+rj(i.byteLength,4)}var aj=["SCALAR","VEC2","VEC3","VEC4"],sj=[[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Uint32Array,5125],[Float32Array,5126],[Float64Array,5130]],uj=new Map(sj),cj={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},lj={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},hj={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function dj(e){return aj[e-1]||aj[0]}function fj(e){var t=uj.get(e.constructor);if(!t)throw new Error("Illegal typed array");return t}function pj(e,t){var n=hj[e.componentType],i=cj[e.type],r=e.count*i,o=e.count*i*lj[e.componentType];return pL(o>=0&&o<=t.byteLength),{ArrayType:n,length:r,byteLength:o}}var vj={asset:{version:"2.0",generator:"loaders.gl"},buffers:[]},gj=function(){function e(t){m(this,e),FP(this,"gltf",void 0),FP(this,"sourceBuffers",void 0),FP(this,"byteLength",void 0),this.gltf=t||{json:M({},vj),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 pL(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=pj(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 pL(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 pL(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=wR(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;pL(Number.isFinite(t)),this.sourceBuffers=this.sourceBuffers||[],this.sourceBuffers.push(e);var n={buffer:0,byteOffset:this.byteLength,byteLength:t};return this.byteLength+=rj(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:dj(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:fj(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=oj(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:dj(i),componentType:fj(n)}}function Sj(e,t,n){return Cj.apply(this,arguments)}function Cj(){return(Cj=Vx(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 gj(t),a=[],s=_(Mj(o));try{for(s.s();!(u=s.n()).done;)c=u.value,o.getObjectExtension(c,yj)&&a.push(Oj(o,c,n,i))}catch(l){s.e(l)}finally{s.f()}return e.next=7,Promise.all(a);case 7:o.removeExtension(yj);case 8:case"end":return e.stop()}},e)}))).apply(this,arguments)}function Ej(e){var t,n=new gj(e),i=_(n.json.meshes||[]);try{for(i.s();!(t=i.n()).done;){var r=t.value;Pj(r),n.addRequiredExtension(yj)}}catch(o){i.e(o)}finally{i.f()}}function Oj(e,t,n,i){return Tj.apply(this,arguments)}function Tj(){return(Tj=Vx(regeneratorRuntime.mark(function e(n,i,r,o){var a,s,u,c,l,h,d,f,p,v,g,m,y;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(a=n.getObjectExtension(i,yj)){e.next=3;break}return e.abrupt("return");case 3:return s=n.getTypedArrayForBufferView(a.bufferView),u=xA(s.buffer,s.byteOffset),c=o.parse,delete(l=M({},r))["3d-tiles"],e.next=7,c(u,nj,l,o);case 7:for(h=e.sent,d=kj(h.attributes),f=0,p=Object.entries(d);f2&&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({},yj,{bufferView:l,attributes:c})}]}}function Aj(e){if(!e.attributes&&Object.keys(e.attributes).length>0)throw new Error("glTF: Empty primitive detected: Draco decompression failure?")}function Mj(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 Ij(e){return Rj.apply(this,arguments)}function Rj(){return(Rj=Vx(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 gj(t),i=n.json,n.removeExtension(_j),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,_j)}catch(s){r.e(s)}finally{r.f()}case 4:case"end":return e.stop()}},e)}))).apply(this,arguments)}function Dj(e){var t=new gj(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,_j,{}),t.addExtension(_j))}}catch(a){r.e(a)}finally{r.f()}}}function Nj(e){return Lj.apply(this,arguments)}function Lj(){return(Lj=Vx(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 gj(t),i=n.json,(r=n.getExtension(bj))&&(n.json.lights=r.lights,n.removeExtension(bj)),o=_(i.nodes||[]);try{for(o.s();!(a=o.n()).done;)s=a.value,(u=n.getObjectExtension(s,bj))&&(s.light=u.light),n.removeObjectExtension(s,bj)}catch(c){o.e(c)}finally{o.f()}case 4:case"end":return e.stop()}},e)}))).apply(this,arguments)}function jj(e){return Fj.apply(this,arguments)}function Fj(){return(Fj=Vx(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 gj(t),(i=n.json).lights&&(pL(!(r=n.addExtension(bj)).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,bj,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 Bj(e){return Vj.apply(this,arguments)}function Vj(){return(Vj=Vx(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 gj(t),i=n.json,r=n.getExtension(wj)){o=Hj(r,n),a=_(i.materials||[]);try{for(a.s();!(s=a.n()).done;)u=s.value,(c=n.getObjectExtension(u,wj))&&(u.technique=Object.assign({},c,o[c.technique]),u.technique.values=Gj(u.technique,n)),n.removeObjectExtension(u,wj)}catch(l){a.e(l)}finally{a.f()}n.removeExtension(wj)}case 2:case"end":return e.stop()}},e)}))).apply(this,arguments)}function zj(e,t){return Uj.apply(this,arguments)}function Uj(){return(Uj=Vx(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 Hj(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 Gj(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 Wj={KHR_draco_mesh_compression:R,KHR_materials_unlit:D,KHR_lights_punctual:N,KHR_techniques_webgl:L};function qj(e){return Xj.apply(this,arguments)}function Xj(){return(Xj=Vx(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(Wj);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,Wj[r].decode(t,n,i);case 10:e.next=3;break;case 12:case"end":return e.stop()}},e)}))).apply(this,arguments)}var Yj={accessors:"accessor",animations:"animation",buffers:"buffer",bufferViews:"bufferView",images:"image",materials:"material",meshes:"mesh",nodes:"node",samplers:"sampler",scenes:"scene",skins:"skin",textures:"texture"},Kj={accessor:"accessors",animations:"animation",buffer:"buffers",bufferView:"bufferViews",image:"images",material:"materials",mesh:"meshes",node:"nodes",sampler:"samplers",scene:"scenes",skin:"skins",texture:"textures"},$j=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 gj(e),i=n.json,r=_(i.images||[]);try{for(r.s();!(t=r.n()).done;){var o=t.value,a=n.removeObjectExtension(o,mj);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(mj)}(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 Yj)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 Yj)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,d=_(e.scenes);try{for(d.s();!(h=d.n()).done;){var f=h.value;this._convertSceneIds(f)}}catch(p){d.e(p)}finally{d.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=Kj[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 Qj(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(new $j).normalize(e,t)}var Zj={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Jj={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},eF={TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,REPEAT:10497,LINEAR:9729,NEAREST_MIPMAP_LINEAR:9986},tF={magFilter:eF.TEXTURE_MAG_FILTER,minFilter:eF.TEXTURE_MIN_FILTER,wrapS:eF.TEXTURE_WRAP_S,wrapT:eF.TEXTURE_WRAP_T},nF=(o(k={},eF.TEXTURE_MAG_FILTER,eF.LINEAR),o(k,eF.TEXTURE_MIN_FILTER,eF.NEAREST_MIPMAP_LINEAR),o(k,eF.TEXTURE_WRAP_S,eF.REPEAT),o(k,eF.TEXTURE_WRAP_,eF.REPEAT),k),iF=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 pL(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 Jj[e]}(e.componentType),e.components=function(e){return Zj[e]}(e.type),e.bytesPerElement=e.bytesPerComponent*e.components,e.bufferView){var n=e.bufferView.buffer,i=pj(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):nF,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 tF[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 rF(e,t){return(new iF).postProcess(e,t)}var oF=1735152710,aF=!0;function sF(e,t,n,i){var r=new Uint8Array(t.buffer,n,i),o=new TextDecoder("utf8").decode(r);return e.json=JSON.parse(o),rj(i,4)}function uF(e,t,n,i){return e.header.hasBinChunk=!0,e.binChunks.push({byteOffset:n,byteLength:i,arrayBuffer:t.buffer}),rj(i,4)}function cF(e,t){return lF.apply(this,arguments)}function lF(){return(lF=Vx(regeneratorRuntime.mark(function e(t,n){var i,r,o,a,s,u,c,l,h,d,f=arguments;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(i=f.length>2&&void 0!==f[2]?f[2]:0,r=f.length>3?f[3]:void 0,o=f.length>4?f[4]:void 0,hF(t,n,i,r),Qj(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,dF(t,r,o);case 9:if(null==r||null===(u=r.gltf)||void 0===u||!u.loadImages){e.next=12;break}h=pF(t,r,o),l.push(h);case 12:return d=qj(t,r,o),l.push(d),e.next=16,Promise.all(l);case 16:return e.abrupt("return",null!=r&&null!==(c=r.gltf)&&void 0!==c&&c.postProcess?rF(t,r):t);case 17:case"end":return e.stop()}},e)}))).apply(this,arguments)}function hF(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?oF:r,a=i.getUint32(t,!1);return a===o||a===oF}(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)?fL(e.buffer,e.byteOffset,t):e instanceof ArrayBuffer?fL(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,aF),a=i.getUint32(n+8,aF);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){lP(e.header.byteLength>20);var i=t.getUint32(n+0,aF),r=t.getUint32(n+4,aF);return n+=8,lP(0===r),sF(e,t,n,i),(n+=i)+uF(e,t,n,e.header.byteLength)}(e,i,n);case 2:return function(e,t,n,i){return lP(e.header.byteLength>20),function(e,t,n,i){for(;n+8<=e.header.byteLength;){var r=t.getUint32(n+0,aF),o=t.getUint32(n+4,aF);switch(n+=8,o){case 1313821514:sF(e,t,n,r);break;case 5130562:uF(e,t,n,r);break;case 0:i.strict||sF(e,t,n,r);break;case 1:i.strict||uF(e,t,n,r)}n+=rj(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),pL("glTF"===r.type,"Invalid GLB magic string ".concat(r.type)),e._glb=r,e.json=r.json}else pL(!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 dF(e,t,n){return fF.apply(this,arguments)}function fF(){return(fF=Vx(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({},yF.options),n)).gltf=M(M({},yF.options.gltf),n.gltf),r=n.byteOffset,o=void 0===r?0:r,e.next=6,cF({},t,o,n,i);case 6:return e.abrupt("return",e.sent);case 7:case"end":return e.stop()}},e)}))).apply(this,arguments)}function _F(){return(_F=Vx(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,wF(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 wF(e){return kF.apply(this,arguments)}function kF(){return(kF=Vx(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 xF=[255,255,255,255],SF={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:xF},_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:[yF]},CF=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=[xD,CD];return"pbr"===this.props._lighting&&e.push(TN),{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:xF,transition:!0},instanceModelMatrix:kN})}},{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 PN)i={scenes:[e.scenegraph]};else if(e.scenegraph&&!e.scenegraph.gltf){var r=e.scenegraph,o=function(e,t,n){var i=new dL(e,n);return{scenes:i.instantiate(t),animator:i.createAnimator()}}(n,r,this._getModelOptions());i=M({gltf:r},o),function(e){return _F.apply(this,arguments)}(o).then(function(){return t.setNeedsRedraw()})}else e.scenegraph&&(ik.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 PN?(this._deleteScenegraph(),this._applyAllAttributes(s),this._applyAnimationsProp(s,u,e._animations),this.setState({scenegraph:s,animator:u})):null!==s&&ik.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?cx("sphere-geometry"):i,o=function(e){var t=e.nlat,n=void 0===t?10:t,i=e.nlong,r=void 0===i?10:i,o=e.radius,a=void 0===o?1:o,s=Math.PI-0,u=2*Math.PI-0,c=(n+1)*(r+1);if("number"==typeof a){var l=a;a=function(e,t,n,i,r){return l}}for(var h=new Float32Array(3*c),d=new Float32Array(3*c),f=new Float32Array(2*c),p=new(c>65535?Uint32Array:Uint16Array)(n*r*6),v=0;v<=n;v++)for(var g=0;g<=r;g++){var m=g/r,y=v/n,b=g+v*(r+1),_=2*b,w=3*b,k=u*m,x=s*y,S=Math.sin(k),C=Math.cos(k),E=Math.sin(x),O=C*E,T=Math.cos(x),P=S*E,A=a(O,T,P,m,y);h[w+0]=A*O,h[w+1]=A*T,h[w+2]=A*P,d[w+0]=O,d[w+1]=T,d[w+2]=P,f[_+0]=m,f[_+1]=1-y}for(var M=r+1,I=0;I0&&void 0!==arguments[0]?arguments[0]:{};m(this,n);var i=e.id,r=void 0===i?cx("truncated-code-geometry"):i,o=function(e){for(var t=e.bottomRadius,n=void 0===t?0:t,i=e.topRadius,r=void 0===i?0:i,o=e.height,a=void 0===o?1:o,s=e.nradial,u=void 0===s?10:s,c=e.nvertical,l=void 0===c?10:c,h=e.verticalAxis,d=void 0===h?"y":h,f=e.topCap,p=void 0!==f&&f,v=e.bottomCap,g=void 0!==v&&v,m=(p?2:0)+(g?2:0),y=(u+1)*(l+1+m),b=Math.atan2(n-r,a),_=Math.sin,w=Math.cos,k=Math.PI,x=w(b),S=_(b),C=p?-2:0,E=l+(g?2:0),O=u+1,T=new Uint16Array(u*(l+m)*6),P=OF[d],A=new Float32Array(3*y),M=new Float32Array(3*y),I=new Float32Array(2*y),R=0,D=0,N=C;N<=E;N++){var L=void 0,j=N/l,F=a*j;N<0?(F=0,j=1,L=n):N>l?(F=a,j=1,L=r):L=n+N/l*(r-n),(-2===N||N===l+2)&&(L=0,j=0),F-=a/2;for(var B=0;Bl?0:V*x,M[R+P[1]]=N<0?-1:N>l?1:S,M[R+P[2]]=N<0||N>l?0:z*x,I[D+0]=B/u,I[D+1]=j,D+=2,R+=3}}for(var U=0;U0&&void 0!==arguments[0]?arguments[0]:{};m(this,n);var i=e.id,r=void 0===i?cx("cone-geometry"):i,o=e.radius,a=void 0===o?1:o,s=e.cap,u=void 0===s||s;return t.call(this,I(M({},e),{id:r,topRadius:0,topCap:Boolean(u),bottomCap:Boolean(u),bottomRadius:a}))}return n}(TF),AF=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.id,r=void 0===i?cx("cylinder-geometry"):i,o=e.radius,a=void 0===o?1:o;return t.call(this,I(M({},e),{id:r,bottomRadius:a,topRadius:a}))}return n}(TF),MF=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]),IF=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]),RF=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]),DF=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]),NF={POSITION:{size:3,value:new Float32Array(IF)},NORMAL:{size:3,value:new Float32Array(RF)},TEXCOORD_0:{size:2,value:new Float32Array(DF)}},LF=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.id,r=void 0===i?cx("cube-geometry"):i;return t.call(this,I(M({},e),{id:r,indices:{size:1,value:new Uint16Array(MF)},attributes:M(M({},NF),e.attributes)}))}return n}(OD),jF=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 BF,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 BF,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],d=i[6],f=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]=d*v+f*y+p*w,o[7]=d*g+f*b+p*k,o[8]=d*m+f*_+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 BF,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=FF;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}(),FF=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],BF=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 jF([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=VF,r=1/n;i.set(this.x*r,this.y*r,this.z*r);var o=zF;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(UF),UF.almostEquals(e,t)}},{key:"clone",value:function(){return new e(this.x,this.y,this.z)}}]),e}();BF.ZERO=void 0,BF.UNIT_X=void 0,BF.UNIT_Y=void 0,BF.UNIT_Z=void 0,BF.ZERO=new BF(0,0,0),BF.UNIT_X=new BF(1,0,0),BF.UNIT_Y=new BF(0,1,0),BF.UNIT_Z=new BF(0,0,1);var VF=new BF,zF=new BF,UF=new BF,HF=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 BF,this.upperBound=new BF,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=WF;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=WF;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,d=Math.max(Math.max(Math.min(a,s),Math.min(u,c)),Math.min(l,h)),f=Math.min(Math.min(Math.max(a,s),Math.max(u,c)),Math.max(l,h));return!(f<0||d>f)}}]),e}(),GF=new BF,WF=[new BF,new BF,new BF,new BF,new BF,new BF,new BF,new BF],qF=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 BF;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=XF;e.tangents(n,YF),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(P(e.length(),2)*P(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 BF,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,d=-o*n-a*i-s*r;return t.x=c*u+d*-o+l*-s-h*-a,t.y=l*u+d*-a+h*-o-c*-s,t.z=h*u+d*-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,d=this.w,f=t.x,p=t.y,v=t.z,g=t.w;return(r=c*f+l*p+h*v+d*g)<0&&(r=-r,f=-f,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*f,u.y=a*l+s*p,u.z=a*h+s*v,u.w=a*d+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,d=.5*n;return r.x+=d*(o*h+a*l-s*c),r.y+=d*(a*h+s*u-o*l),r.z+=d*(s*h+o*c-a*u),r.w+=d*(-o*u-a*c-s*l),r}}]),e}(),XF=new BF,YF=new BF,KF={SPHERE:1,PLANE:2,BOX:4,COMPOUND:8,CONVEXPOLYHEDRON:16,HEIGHTFIELD:32,PARTICLE:64,CYLINDER:128,TRIMESH:256},$F=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=KF,e}(),QF=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 BF,this.quaternion=new qF,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 BF;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 BF;return n.vsub(e,i),t.conjugate(ZF),ZF.vmult(i,i),i}},{key:"pointToWorldFrame",value:function(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new BF;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 BF;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 BF;return t.w*=-1,t.vmult(n,i),t.w*=-1,i}}]),e}(),ZF=new qF,JF=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:$F.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 BF,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=f,l=d)}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 BF,c=new BF,l=new BF,h=new BF,d=new BF,f=new BF,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,eB),n.project(t,e,o,a,tB);var s=eB[0],u=eB[1],c=tB[0],l=tB[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 BF,d=0;ds)&&(s=f.x),(void 0===o||f.yu)&&(u=f.y),(void 0===a||f.zc)&&(c=f.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 BF,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 BF,o=new BF;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=nB,s=0,u=0,c=iB,l=e.vertices;c.setZero(),QF.vectorToLocalFrame(n,i,t,a),QF.pointToLocalFrame(n,i,c,c);var h=c.dot(a);u=s=l[0].dot(a);for(var d=1;ds&&(s=f),f(s-=h)){var p=u;u=s,s=p}r[0]=s,r[1]=u}}]),n}($F),eB=[],tB=[],nB=new BF,iB=new BF,rB=function(e){a(n,e);var t=s(n);function n(e){var i;return m(this,n),(i=t.call(this,{type:$F.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=BF,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 JF({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 BF;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 BF,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 BF,e.previousPosition=new BF,e.interpolatedPosition=new BF,e.initPosition=new BF,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 BF,i.velocity&&e.velocity.copy(i.velocity),e.initVelocity=new BF,e.force=new BF;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 BF,e.quaternion=new qF,e.initQuaternion=new qF,e.previousQuaternion=new qF,e.interpolatedQuaternion=new qF,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 BF,i.angularVelocity&&e.angularVelocity.copy(i.angularVelocity),e.initAngularVelocity=new BF,e.shapes=[],e.shapeOffsets=[],e.shapeOrientations=[],e.inertia=new BF,e.invInertia=new BF,e.invInertiaWorld=new jF,e.invMassSolve=0,e.invInertiaSolve=new BF,e.invInertiaWorldSolve=new jF,e.fixedRotation=void 0!==i.fixedRotation&&i.fixedRotation,e.angularDamping=void 0!==i.angularDamping?i.angularDamping:.01,e.linearFactor=new BF(1,1,1),i.linearFactor&&e.linearFactor.copy(i.linearFactor),e.angularFactor=new BF(1,1,1),i.angularFactor&&e.angularFactor.copy(i.angularFactor),e.aabb=new HF,e.aabbNeedsUpdate=!0,e.boundingRadius=0,e.wlambda=new BF,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=P(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 BF;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 BF;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 BF;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 BF;return this.quaternion.vmult(e,t),t}},{key:"addShape",value:function(e,t,n){var i=new BF,r=new qF;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=uB,o=cB,a=this.quaternion,s=this.aabb,u=lB,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=hB,i=dB;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 BF;if(this.type===n.DYNAMIC){this.sleepState===n.SLEEPING&&this.wakeUp();var i=fB;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 BF;if(this.type===n.DYNAMIC){var i=pB,r=vB;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 BF;if(this.type===n.DYNAMIC){this.sleepState===n.SLEEPING&&this.wakeUp();var i=t,r=gB;r.copy(e),r.scale(this.invMass,r),this.velocity.vadd(r,this.velocity);var o=mB;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 BF;if(this.type===n.DYNAMIC){var i=yB,r=bB;this.vectorToWorldFrame(e,i),this.vectorToWorldFrame(t,r),this.applyImpulse(i,r)}}},{key:"updateMassProperties",value:function(){var e=_B;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),rB.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 BF;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,d=this.invMass*e;r.x+=s.x*d*h.x,r.y+=s.y*d*h.y,r.z+=s.z*d*h.z;var f=l.elements,p=this.angularFactor,v=u.x*p.x,g=u.y*p.y,m=u.z*p.z;o.x+=e*(f[0]*v+f[1]*g+f[2]*m),o.y+=e*(f[3]*v+f[4]*g+f[5]*m),o.z+=e*(f[6]*v+f[7]*g+f[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 BF,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new BF;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 BF,this.precision=1e-4,this.checkCollisionResponse=!0,this.skipBackfaces=!1,this.collisionFilterMask=-1,this.collisionFilterGroup=-1,this.mode=s.ANY,this.result=new wB,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 wB,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(xB),SB.length=0,e.broadphase.aabbQuery(e,xB,SB),this.intersectBodies(SB),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=OB,r=TB,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 BF(0,0,1);t.vmult(u,u);var c=new BF;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,d),d.vsub(n,f),f.normalize(),this.reportIntersection(f,d,r,i,-1)),this.result.shouldStop)return;v>=0&&v<=1&&(o.lerp(a,v,d),d.vsub(n,f),f.normalize(),this.reportIntersection(f,d,r,i,-1))}}},{key:"_intersectConvex",value:function(e,t,n,i,r,o){for(var a=BB,u=VB,c=o&&o.faceList||null,l=e.faces,h=e.vertices,d=e.faceNormals,f=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,PB,r,i,b)}}}}}},{key:"_intersectTrimesh",value:function(e,t,n,i,r,o){var a=zB,u=XB,c=YB,l=VB,h=UB,d=HB,f=GB,p=qB,v=WB,g=e.indices,m=this.from,y=this.to,b=this.direction;c.position.copy(n),c.quaternion.copy(t),QF.vectorToLocalFrame(n,t,b,h),QF.pointToLocalFrame(n,t,m,d),QF.pointToLocalFrame(n,t,y,f),f.x*=e.scale.x,f.y*=e.scale.y,f.z*=e.scale.z,d.x*=e.scale.x,d.y*=e.scale.y,d.z*=e.scale.z,f.vsub(d,h),h.normalize();var _=d.distanceSquared(f);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],AB),AB.vsub(d,l);var S=h.dot(a),C=a.dot(l)/S;if(!(C<0)){h.scale(C,PB),PB.vadd(d,PB),e.getVertex(g[3*x+1],MB),e.getVertex(g[3*x+2],IB);var E=PB.distanceSquared(d);!s.pointInTriangle(PB,MB,AB,IB)&&!s.pointInTriangle(PB,AB,MB,IB)||E>_||(QF.vectorToWorldFrame(t,a,v),QF.pointToWorldFrame(n,t,PB,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 HF({lowerBound:h(BF,v(o.map(function(e,t){return Math.min(e,a[t])}))),upperBound:h(BF,v(a.map(function(e,t){return Math.max(e,o[t])})))}),gltf:n})}()}}catch(E){a.e(E)}finally{a.f()}}return!0})}catch(E){r.e(E)}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;){d=l.value,f=[],p=_(i);try{for(p.s();!(g=p.n()).done;)m=g.value,d.bbox.overlaps(m.bbox)&&f.push({"@id":m["@id"],name:m.name})}catch(E){p.e(E)}finally{p.f()}f.length>0?s.push({"@id":d.entityId,name:d.name,hits:f}):u.push(d)}}catch(E){c.e(E)}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),cV(r,n)}}catch(o){i.e(o)}finally{i.f()}return n}var lV=function(){var e=function(){function e(t){var n,i,r,o,a,s=this;m(this,e),this.deckProps=t,this.bodyUILayer=new uV({}),this.nodeClickSubject=new ae,this.nodeHoverStartSubject=new ae,this.nodeHoverStopSubject=new ae,this.sceneRotationSubject=new vv([0,0]),this.nodeDragStartSubject=new ae,this.nodeDragSubject=new ae,this.nodeDragEndSubject=new ae,this.nodeClick$=this.nodeClickSubject.pipe(je()),this.nodeHoverStart$=this.nodeHoverStartSubject.pipe(je()),this.nodeHoverStop$=this.nodeHoverStopSubject.pipe(je()),this.sceneRotation$=this.sceneRotationSubject.pipe(je()),this.nodeDragStart$=this.nodeDragStartSubject.pipe(je()),this.nodeDrag$=this.nodeDragSubject.pipe(je()),this.nodeDragEnd$=this.nodeDragEndSubject.pipe(je());var u=Object.assign(Object.assign({},t),{views:["orthographic"===t.camera?new UM({flipY:!1,near:-1e3}):new qM({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 mI({ambientLight:new KM({color:[255,255,255],intensity:10})})]),this.deck=new kD(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 Dw(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 $O([.076,0,0,0,0,.076,16875389974302382e-33,0,0,-16875389974302382e-33,.076,0,.49,.034,.11,1]);(function(e,t,n){return Dw(this,void 0,void 0,regeneratorRuntime.mark(function n(){var i,r,o,a,s,u,c,l,d,f,p,g,m,y,b,w,k,x,S,C;return regeneratorRuntime.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return nV(),n.next=3,rV({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;)tV(s.value,t=new $O(t||$O.IDENTITY),function(n,i){var a={"@id":n.name||n.id,"@type":"ProcessedNode",transformMatrix:new $O(i),geometry:"wireframe",node:n};if(o.push({"@id":"GLTF:".concat(a["@id"]),"@type":"GLTFNode",scenegraph:e,scenegraphNode:a["@id"],transformMatrix:new $O(t||$O.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 HF({lowerBound:h(BF,v(e.map(function(e,n){return Math.min(e,t[n])}))),upperBound:h(BF,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(E){a.e(E)}finally{a.f()}u=_(Object.values(r).filter(function(e){return!e.bbox}));try{for(u.s();!(c=u.n()).done;){l=c.value,d=_(cV(l.node).map(function(e){return r[e]}).filter(function(e){return e.bbox}));try{for(d.s();!(f=d.n()).done;)p=f.value,l.bbox?l.bbox.extend(p.bbox):l.bbox=p.bbox.clone()}catch(E){d.e(E)}finally{d.f()}l.bbox||delete r[l["@id"]]}}catch(E){u.e(E)}finally{u.f()}for(g=0,m=Object.values(r);g1&&void 0!==arguments[1]?arguments[1]:hV,n=null,i=null;function r(){return dV(t,n,arguments)||(i=e.apply(null,arguments)),n=arguments,i}return r.reset=function(){n=null,i=null},r}var pV=fV(function(){var e=ch();if(!e)return!1;var t=e.injector.get(Gl,null);return!!t&&t.some(function(e){return(e&&e.providers||[]).some(function(e){return e&&e.provide&&"MockNgModuleResolver"===e.provide.name||!1})})}),vV=function(){var e=function(){function e(){m(this,e),this.bootstrap$=new Bf(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=$e({token:e,factory:e.\u0275fac}),e}(),gV=new Ri("INITIAL_STATE_TOKEN"),mV=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}(),yV=new Ri("Internals.StateContextFactory"),bV=new Ri("Internals.StateFactory");function _V(e,t){return t?function(n){return n.pipe(_V(function(n,i){return ye(e(n,i)).pipe(ce(function(e,r){return t(n,e,i,r)}))}))}:function(t){return t.lift(new wV(e))}}var wV=function(){function e(t){m(this,e),this.project=t}return b(e,[{key:"call",value:function(e,t){return t.subscribe(new kV(e,this.project))}}]),e}(),kV=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 be(this),n=this.destination;n.add(t);var i=we(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}(_e);function xV(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return function(t){return t.lift(new SV(e))}}var SV=function(){function e(t){m(this,e),this.defaultValue=t}return b(e,[{key:"call",value:function(e,t){return t.subscribe(new CV(e,this.defaultValue))}}]),e}(),CV=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}(K),EV=function(e){return"".concat(e," is not a valid state name. It needs to be a valid object property name.")},OV=function(){return"States must register a 'name' property"},TV=function(e,t,n){return"State name '".concat(e,"' from ").concat(t," already exists in ").concat(n)},PV=function(){return"States must be decorated with @State() decorator"},AV=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 })"},MV=function(){return"RECOMMENDATION: Set developmentMode to true on the NgxsModule when Angular is running in development mode.\nNgxsModule.forRoot(states, { developmentMode: !environment.production })"},IV=function(){return"You have forgotten to import the NGXS module!"},RV=function(){return"@Action() decorator cannot be used with static methods"},DV=function(){return"Selectors only work on methods"},NV=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 })"},LV=function(){return"Patching arrays is not supported."},jV=function(){return"Patching primitives is not supported."},FV=function(e){return"'".concat(e,"' class should be decorated with @Injectable() right after the @State() decorator")},BV=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 Xl.isInAngularZone()?e():this._ngZone.run(e)}},{key:"runOutsideAngular",value:function(e){return Xl.isInAngularZone()?this._ngZone.runOutsideAngular(e):e()}},{key:"verifyZoneIsNotNooped",value:function(e){e instanceof Xl||console.warn(NV())}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Zi(Xl),Zi(Ml))},e.\u0275prov=$e({token:e,factory:e.\u0275fac}),e}(),VV=new Ri("ROOT_STATE_TOKEN"),zV=new Ri("FEATURE_STATE_TOKEN"),UV=new Ri("NGXS_PLUGINS"),HV=new Ri("NG_TEST_MODE"),GV=new Ri("NG_DEV_MODE"),WV="NGXS_META",qV="NGXS_OPTIONS_META",XV="NGXS_SELECTOR_META",YV=function(){var e=function e(){m(this,e),this.defaultsState={},this.selectorOptions={injectContainerState:!0,suppressErrors:!0},this.compatibility={strictContentSecurityPolicy:!1},this.executionStrategy=BV};return e.\u0275prov=$e({token:e,factory:e.\u0275fac=function(t){return new(t||e)}}),e}(),KV=function e(t,n,i){m(this,e),this.previousValue=t,this.currentValue=n,this.firstChange=i},$V=new Ri("NGXS_EXECUTION_STRATEGY");function QV(e){return e.constructor&&e.constructor.type?e.constructor.type:e.type}var ZV=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},JV=function(e,t){return t.split(".").reduce(function(e,t){return e&&e[t]},e)},ez=function(e){return e&&"object"==typeof e&&!Array.isArray(e)},tz=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]:uz,i=function(e){return e.reduce(function(e,t){return e[QV(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 bf(function(n){var i=QV(n.action);return e[i]&&(!t||t[n.status])})}(i,r),n())}}(t,["DISPATCHED"])}function uz(){return ce(function(e){return e.action})}function cz(e){return function(t){return new te(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 lz=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)(Zi($V))},e.\u0275prov=$e({token:e,factory:e.\u0275fac}),e}(),hz=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}(ae),dz=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}(hz);return t.\u0275fac=function(n){return(e||(e=Ti(t)))(n||t)},t.\u0275prov=$e({token:t,factory:t.\u0275fac}),t}(),fz=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(cz(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}(te);return e.\u0275fac=function(t){return new(t||e)(Zi(dz),Zi(lz))},e.\u0275prov=$e({token:e,factory:e.\u0275fac}),e}(),pz=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[WV].name]=t,e},{})}(n),u=[],c=_(o);try{for(c.s();!(i=c.n()).done;){var l=i.value,h=s[l],d=a[l],f=h[WV];this.addRuntimeInfoToMeta(f,d);var p={name:l,path:d,isInitialised:!1,actions:f.actions,instance:this._injector.get(h),defaults:e.cloneDefaults(f.defaults)};this.hasBeenMountedAndBootstrapped(l,d)||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 ZV(e,t.path,t.defaults)},{}),states:t}}},{key:"connectActionHandlers",value:function(){var e=this;null===this._actionsSubscription&&(this._actionsSubscription=this._actions.pipe(bf(function(e){return"DISPATCHED"===e.status}),ke(function(t){var n=t.action;return e.invokeActions(e._actions,n).pipe(ce(function(){return{action:n,status:"SUCCESSFUL"}}),xV({action:n,status:"CANCELED"}),Bb(function(e){return $d({action:n,status:"ERRORED",error:e})}))})).subscribe(function(t){return e._actionResults.next(t)}))}},{key:"invokeActions",value:function(e,t){var n,i=QV(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 d=a.instance[l.fn](h,t);d instanceof Promise&&(d=ye(d)),d instanceof te?(d=d.pipe(xV({})),l.options.cancelUncompleted&&(d=d.pipe(kf(e.pipe(sz(t)))))):d=$d({}).pipe(zf()),r.push(d)}catch(d){r.push(Rf(d))}}}catch(f){c.e(f)}finally{c.f()}}}}catch(f){o.e(f)}finally{o.f()}return r.length||r.push($d({})),jb(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=Sz.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!==JV(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(Sz.getValidStateMeta)}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Zi(ss),Zi(YV),Zi(e,12),Zi(dz),Zi(mz),Zi(xz),Zi(gV,8))},e.\u0275prov=$e({token:e,factory:e.\u0275fac}),e}(),Ez=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(bf(function(){return!!t}),mv(function(){return n.invokeInit(t.states)}),ke(function(){return n.bootstrapper.appBootstrapped$}),bf(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=az(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)(Zi(kz),Zi(xz),Zi(vV))},e.\u0275prov=$e({token:e,factory:e.\u0275fac}),e}(),Oz=function(e){return e&&e.NGXS_SELECTOR_OPTIONS_META||{}};function Tz(e){var t=rz(e)||iz(e);return t&&t.makeRootSelector||function(){return e}}var Pz=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(ce(n),Bb(function(e){var n=t._config.selectorOptions.suppressErrors;return e instanceof TypeError&&n?$d(void 0):Rf(e)}),lf(),cz(this._internalExecutionStrategy))}},{key:"selectOnce",value:function(e){return this.select(e).pipe(_p(1))}},{key:"selectSnapshot",value:function(e){return this.getStoreBoundSelectorFn(e)(this._stateStream.getValue())}},{key:"subscribe",value:function(e){return this._stateStream.pipe(cz(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 Tz(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)(Zi(vz),Zi(kz),Zi(YV),Zi(lz),Zi(Cz),Zi(gV,8))},e.\u0275prov=$e({token:e,factory:e.\u0275fac}),e}(),Az=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)(Zi(Pz),Zi(YV))},e.\u0275prov=$e({token:e,factory:e.\u0275fac}),e.store=null,e.config=null,e}(),Mz=function(){function e(){m(this,e)}return b(e,null,[{key:"type",get:function(){return"@@INIT"}}]),e}(),Iz=function(){function e(t){m(this,e),this.addedStates=t}return b(e,null,[{key:"type",get:function(){return"@@UPDATE_STATE"}}]),e}(),Rz=new Bf(1),Dz=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)&&ah();Rz.next(n)}catch(e){Rz.next(!1)}finally{Rz.complete()}}();var s=t.addAndReturnDefaults(o);n.setStateToTheCurrentWithNew(s),t.connectActionHandlers(),a.ngxsBootstrap(new Mz,s)};return e.\u0275fac=function(t){return new(t||e)(Zi(Cz),Zi(kz),Zi(Pz),Zi(Az),Zi(VV,8),Zi(Ez))},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({}),e}(),Nz=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 Iz(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)(Zi(Pz),Zi(kz),Zi(Cz),Zi(zV,8),Zi(Ez))},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({}),e}(),Lz=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:Dz,providers:[Cz,xz,fz,dz,vV,wz,_z,Ez,yz,mz,kz,lz,Pz,vz,Az,gz].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:Nz,providers:[Cz,gz].concat(v(e),[{provide:zV,multi:!0,useValue:e}])}}},{key:"ngxsTokenProviders",value:function(t,n){return[{provide:HV,useValue:pV},{provide:GV,useValue:ah},{provide:$V,useClass:n.executionStrategy||BV},{provide:VV,useValue:t},{provide:e.ROOT_OPTIONS,useValue:n},{provide:YV,useFactory:e.ngxsConfigFactory,deps:[e.ROOT_OPTIONS]},{provide:Il,useFactory:e.appBootstrapListenerFactory,multi:!0,deps:[vV]},{provide:gV,useFactory:e.getInitialState},{provide:yV,useExisting:xz},{provide:bV,useExisting:Cz}]}},{key:"ngxsConfigFactory",value:function(e){return tz(new YV,e)}},{key:"appBootstrapListenerFactory",value:function(e){return function(){return e.bootstrap()}}},{key:"getInitialState",value:function(){return mV.pop()}}]),e}();function jz(e,t){return function(n,i){if(n.hasOwnProperty("prototype"))throw new Error(RV());var r=nz(n.constructor);Array.isArray(e)||(e=[e]);var o,a=_(e);try{for(a.s();!(o=a.n()).done;){var s=o.value.type;r.actions[s]||(r.actions[s]=[]),r.actions[s].push({fn:i,options:t||{},type:s})}}catch(u){a.e(u)}finally{a.f()}}}function Fz(e){return function(t){!function(e){Rz.subscribe(function(t){t&&(e.\u0275prov||console.warn(FV(e.name)))})}(t);var n=t,i=nz(n),r=Object.getPrototypeOf(n),o=function(t){return Object.assign({},t[qV]||{},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;Sz.checkCorrectStateName(s),n.hasOwnProperty(WV)&&(t.actions=Object.assign({},t.actions,(n[WV]||{}).actions)),t.children=r,t.defaults=o,t.name=s})({meta:i,inheritedStateClass:r,optionsWithInheritance:o}),n[qV]=o}}function Bz(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i2&&void 0!==arguments[2]?arguments[2]:[];return"string"==typeof(t=t||function(e){var t=e.length-1;return 36===e.charCodeAt(t)?e.slice(0,t):e}(e))?oz(n.length?[t].concat(v(n)):t.split("."),Az.config):t}(a,e,n);Object.defineProperties(t,(o(r={},s,{writable:!0,enumerable:!1,configurable:!0}),o(r,a,{enumerable:!0,configurable:!0,get:function(){return this[s]||(this[s]=function(e){if(!Az.store)throw new Error(IV());return Az.store.select(e)}(u))}}),r))}}function Vz(e){return function(t,n,i){if(!i||null===i.value)throw new Error(DV());var r=i.value,o=function(e,t,n){var i=n&&n.containerClass,r=fV(function(){for(var e=arguments.length,n=new Array(e),r=0;r2&&void 0!==arguments[2]?arguments[2]:[],i=t.getSelectorOptions(),r=e.getSelectorOptions(i);return{selectorOptions:r,argumentSelectorFunctions:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,i=[];return n&&(0===e.length||t.injectContainerState)&&iz(n)&&i.push(n),e&&i.push.apply(i,v(e)),i}(n,r,t.containerClass).map(function(t){return Tz(t)(e)})}}(t,o,e),i=n.argumentSelectorFunctions,a=n.selectorOptions;return function(e){var t=i.map(function(t){return t(e)});try{return r.apply(void 0,v(t))}catch(n){if(n instanceof TypeError&&a.suppressErrors)return;throw n}}},r}(e,r,{containerClass:t,selectorName:n.toString(),getSelectorOptions:function(){return{}}}),a={configurable:!0,get:function(){return o}};return a.originalFn=r,a}}Lz.\u0275fac=function(e){return new(e||Lz)},Lz.\u0275mod=Mt({type:Lz}),Lz.\u0275inj=Qe({}),Lz.ROOT_OPTIONS=new Ri("ROOT_OPTIONS");var zz=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)(Os(nc),Os(Ju))},e.\u0275dir=Rt({type:e}),e}(),Uz=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}(zz);return t.\u0275fac=function(n){return(e||(e=Ti(t)))(n||t)},t.\u0275dir=Rt({type:t,features:[cs]}),t}(),Hz=new Ri("NgValueAccessor"),Gz={provide:Hz,useExisting:He(function(){return qz}),multi:!0},Wz=new Ri("CompositionEventMode"),qz=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=yh()?yh().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}(zz);return e.\u0275fac=function(t){return new(t||e)(Os(nc),Os(Ju),Os(Wz,8))},e.\u0275dir=Rt({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&&Vs("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:[Xu([Gz]),cs]}),e}(),Xz=new Ri("NgValidators"),Yz=new Ri("NgAsyncValidators");function Kz(e){return null!=e}function $z(e){var t=js(e)?ye(e):e;return Bs(t),t}function Qz(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 Zz(e,t){return t.map(function(t){return t(e)})}function Jz(e){return e.map(function(e){return function(e){return!e.validate}(e)?e:function(t){return e.validate(t)}})}function eU(e){return null!=e?function(e){if(!e)return null;var t=e.filter(Kz);return 0==t.length?null:function(e){return Qz(Zz(e,t))}}(Jz(e)):null}function tU(e){return null!=e?function(e){if(!e)return null;var t=e.filter(Kz);return 0==t.length?null:function(e){return jb(Zz(e,t).map($z)).pipe(ce(Qz))}}(Jz(e)):null}function nU(e,t){return null===e?[t]:Array.isArray(e)?[].concat(v(e),[t]):[e,t]}function iU(e){return e._rawValidators}function rU(e){return e._rawAsyncValidators}function oU(e){return e?Array.isArray(e)?e:[e]:[]}function aU(e,t){return Array.isArray(e)?e.includes(t):e===t}function sU(e,t){var n=oU(t);return oU(e).forEach(function(e){aU(n,e)||n.push(e)}),n}function uU(e,t){return oU(t).filter(function(t){return!aU(e,t)})}var cU=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=eU(this._rawValidators)}},{key:"_setAsyncValidators",value:function(e){this._rawAsyncValidators=e||[],this._composedAsyncValidatorFn=tU(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=Rt({type:e}),e}(),lU=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}(cU);return t.\u0275fac=function(n){return(e||(e=Ti(t)))(n||t)},t.\u0275dir=Rt({type:t,features:[cs]}),t}(),hU=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}(cU),dU=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}(),fU=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}(dU);return e.\u0275fac=function(t){return new(t||e)(Os(hU,2))},e.\u0275dir=Rt({type:e,selectors:[["","formControlName",""],["","ngModel",""],["","formControl",""]],hostVars:14,hostBindings:function(e,t){2&e&&cu("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:[cs]}),e}(),pU=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}(dU);return e.\u0275fac=function(t){return new(t||e)(Os(lU,10))},e.\u0275dir=Rt({type:e,selectors:[["","formGroupName",""],["","formArrayName",""],["","ngModelGroup",""],["","formGroup",""],["form",3,"ngNoForm",""],["","ngForm",""]],hostVars:16,hostBindings:function(e,t){2&e&&cu("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:[cs]}),e}();function vU(e,t){yU(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&&_U(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&&_U(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 gU(e,t){var n=function(){};t.valueAccessor&&(t.valueAccessor.registerOnChange(n),t.valueAccessor.registerOnTouched(n)),bU(e,t),e&&(t._invokeOnDestroyCallbacks(),e._registerOnCollectionChange(function(){}))}function mU(e,t){e.forEach(function(e){e.registerOnValidatorChange&&e.registerOnValidatorChange(t)})}function yU(e,t){var n=iU(e);null!==t.validator?e.setValidators(nU(n,t.validator)):"function"==typeof n&&e.setValidators([n]);var i=rU(e);null!==t.asyncValidator?e.setAsyncValidators(nU(i,t.asyncValidator)):"function"==typeof i&&e.setAsyncValidators([i]);var r=function(){return e.updateValueAndValidity()};mU(t._rawValidators,r),mU(t._rawAsyncValidators,r)}function bU(e,t){var n=!1;if(null!==e){if(null!==t.validator){var i=iU(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=rU(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 mU(t._rawValidators,s),mU(t._rawAsyncValidators,s),n}function _U(e,t){e._pendingDirty&&e.markAsDirty(),e.setValue(e._pendingValue,{emitModelToViewChange:!1}),t.viewToModelUpdate(e._pendingValue),e._pendingChange=!1}function wU(e,t){yU(e,t)}function kU(e,t){if(!e.hasOwnProperty("model"))return!1;var n=e.model;return!!n.isFirstChange()||!Object.is(t,n.currentValue)}function xU(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 SU(e,t){return t?(Array.isArray(t),t.forEach(function(e){e.constructor===qz?n=e:function(e){return Object.getPrototypeOf(e.constructor)===Uz}(e)?i=e:r=e}),r||i||n||null):null;var n,i,r}function CU(e,t){var n=e.indexOf(t);n>-1&&e.splice(n,1)}var EU="VALID",OU="INVALID",TU="PENDING",PU="DISABLED";function AU(e){return(DU(e)?e.validators:e)||null}function MU(e){return Array.isArray(e)?eU(e):e||null}function IU(e,t){return(DU(t)?t.asyncValidators:e)||null}function RU(e){return Array.isArray(e)?tU(e):e||null}function DU(e){return null!=e&&!Array.isArray(e)&&"object"==typeof e}var NU=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=MU(this._rawValidators),this._composedAsyncValidatorFn=RU(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===EU}},{key:"invalid",get:function(){return this.status===OU}},{key:"pending",get:function(){return this.status==TU}},{key:"disabled",get:function(){return this.status===PU}},{key:"enabled",get:function(){return this.status!==PU}},{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=MU(e)}},{key:"setAsyncValidators",value:function(e){this._rawAsyncValidators=e,this._composedAsyncValidatorFn=RU(e)}},{key:"addValidators",value:function(e){this.setValidators(sU(e,this._rawValidators))}},{key:"addAsyncValidators",value:function(e){this.setAsyncValidators(sU(e,this._rawAsyncValidators))}},{key:"removeValidators",value:function(e){this.setValidators(uU(e,this._rawValidators))}},{key:"removeAsyncValidators",value:function(e){this.setAsyncValidators(uU(e,this._rawAsyncValidators))}},{key:"hasValidator",value:function(e){return aU(this._rawValidators,e)}},{key:"hasAsyncValidator",value:function(e){return aU(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=TU,!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=PU,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=EU,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===EU||this.status===TU)&&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()?PU:EU}},{key:"_runValidator",value:function(){return this.validator?this.validator(this):null}},{key:"_runAsyncValidator",value:function(e){var t=this;if(this.asyncValidator){this.status=TU,this._hasOwnPendingAsyncValidator=!0;var n=$z(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 jU?i.controls.hasOwnProperty(e)?i.controls[e]:null:i instanceof FU&&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 ol,this.statusChanges=new ol}},{key:"_calculateStatus",value:function(){return this._allControlsDisabled()?PU:this.errors?OU:this._hasOwnPendingAsyncValidator||this._anyControlsHaveStatus(TU)?TU:this._anyControlsHaveStatus(OU)?OU:EU}},{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){DU(e)&&null!=e.updateOn&&(this._updateOn=e.updateOn)}},{key:"_parentMarkedDirty",value:function(e){return!e&&!(!this._parent||!this._parent.dirty)&&!this._parent._anyControlsDirty()}}]),e}(),LU=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,AU(r),IU(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){CU(this._onChange,e)}},{key:"registerOnDisabledChange",value:function(e){this._onDisabledChange.push(e)}},{key:"_unregisterOnDisabledChange",value:function(e){CU(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}(NU),jU=function(e){a(n,e);var t=s(n);function n(e,i,r){var o;return m(this,n),(o=t.call(this,AU(i),IU(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 LU?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}(NU),FU=function(e){a(n,e);var t=s(n);function n(e,i,r){var o;return m(this,n),(o=t.call(this,AU(i),IU(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 LU?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}(NU),BU={provide:lU,useExisting:He(function(){return zU})},VU=Promise.resolve(null),zU=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 ol,r.form=new jU({},eU(e),tU(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;VU.then(function(){var n=t._findContainer(e.path);e.control=n.registerControl(e.name,e.control),vU(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;VU.then(function(){var n=t._findContainer(e.path);n&&n.removeControl(e.name),CU(t._directives,e)})}},{key:"addFormGroup",value:function(e){var t=this;VU.then(function(){var n=t._findContainer(e.path),i=new jU({});wU(i,e),n.registerControl(e.name,i),i.updateValueAndValidity({emitEvent:!1})})}},{key:"removeFormGroup",value:function(e){var t=this;VU.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;VU.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,xU(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}(lU);return e.\u0275fac=function(t){return new(t||e)(Os(Xz,10),Os(Yz,10))},e.\u0275dir=Rt({type:e,selectors:[["form",3,"ngNoForm","",3,"formGroup",""],["ng-form"],["","ngForm",""]],hostBindings:function(e,t){1&e&&Vs("submit",function(e){return t.onSubmit(e)})("reset",function(){return t.onReset()})},inputs:{options:["ngFormOptions","options"]},outputs:{ngSubmit:"ngSubmit"},exportAs:["ngForm"],features:[Xu([BU]),cs]}),e}(),UU={provide:hU,useExisting:He(function(){return GU})},HU=Promise.resolve(null),GU=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)).control=new LU,a._registered=!1,a.update=new ol,a._parent=e,a._setValidators(i),a._setAsyncValidators(r),a.valueAccessor=SU(0,o),a}return b(n,[{key:"ngOnChanges",value:function(e){this._checkForErrors(),this._registered||this._setUpControl(),"isDisabled"in e&&this._updateDisabled(e),kU(e,this.viewModel)&&(this._updateValue(this.model),this.viewModel=this.model)}},{key:"ngOnDestroy",value:function(){this.formDirective&&this.formDirective.removeControl(this)}},{key:"path",get:function(){return this._parent?function(e,t){return[].concat(v(t.path),[e])}(this.name,this._parent):[this.name]}},{key:"formDirective",get:function(){return this._parent?this._parent.formDirective:null}},{key:"viewToModelUpdate",value:function(e){this.viewModel=e,this.update.emit(e)}},{key:"_setUpControl",value:function(){this._setUpdateStrategy(),this._isStandalone()?this._setUpStandalone():this.formDirective.addControl(this),this._registered=!0}},{key:"_setUpdateStrategy",value:function(){this.options&&null!=this.options.updateOn&&(this.control._updateOn=this.options.updateOn)}},{key:"_isStandalone",value:function(){return!this._parent||!(!this.options||!this.options.standalone)}},{key:"_setUpStandalone",value:function(){vU(this.control,this),this.control.updateValueAndValidity({emitEvent:!1})}},{key:"_checkForErrors",value:function(){this._isStandalone()||this._checkParentType(),this._checkName()}},{key:"_checkParentType",value:function(){}},{key:"_checkName",value:function(){this.options&&this.options.name&&(this.name=this.options.name),this._isStandalone()}},{key:"_updateValue",value:function(e){var t=this;HU.then(function(){t.control.setValue(e,{emitViewToModelChange:!1})})}},{key:"_updateDisabled",value:function(e){var t=this,n=e.isDisabled.currentValue,i=""===n||n&&"false"!==n;HU.then(function(){i&&!t.control.disabled?t.control.disable():!i&&t.control.disabled&&t.control.enable()})}}]),n}(hU);return e.\u0275fac=function(t){return new(t||e)(Os(lU,9),Os(Xz,10),Os(Yz,10),Os(Hz,10))},e.\u0275dir=Rt({type:e,selectors:[["","ngModel","",3,"formControlName","",3,"formControl",""]],inputs:{name:"name",isDisabled:["disabled","isDisabled"],model:["ngModel","model"],options:["ngModelOptions","options"]},outputs:{update:"ngModelChange"},exportAs:["ngModel"],features:[Xu([UU]),cs,qt]}),e}(),WU=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275dir=Rt({type:e,selectors:[["form",3,"ngNoForm","",3,"ngNativeValidate",""]],hostAttrs:["novalidate",""]}),e}(),qU=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({}),e}(),XU=new Ri("NgModelWithFormControlWarning"),YU={provide:hU,useExisting:He(function(){return KU})},KU=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 ol,a._ngModelWarningSent=!1,a._setValidators(e),a._setAsyncValidators(i),a.valueAccessor=SU(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&&gU(t,this,!1),vU(this.form,this),this.control.disabled&&this.valueAccessor.setDisabledState&&this.valueAccessor.setDisabledState(!0),this.form.updateValueAndValidity({emitEvent:!1})}kU(e,this.viewModel)&&(this.form.setValue(this.model),this.viewModel=this.model)}},{key:"ngOnDestroy",value:function(){this.form&&gU(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}(hU);return e.\u0275fac=function(t){return new(t||e)(Os(Xz,10),Os(Yz,10),Os(Hz,10),Os(XU,8))},e.\u0275dir=Rt({type:e,selectors:[["","formControl",""]],inputs:{isDisabled:["disabled","isDisabled"],form:["formControl","form"],model:["ngModel","model"]},outputs:{update:"ngModelChange"},exportAs:["ngForm"],features:[Xu([YU]),cs,qt]}),e._ngModelWarningSentOnce=!1,e}(),$U={provide:lU,useExisting:He(function(){return QU})},QU=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 ol,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&&(bU(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 vU(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){gU(e.control||null,e,!1),CU(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,xU(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&&(gU(n||null,t),i instanceof LU&&(vU(i,t),t.control=i))}),this.form._updateTreeValidity({emitEvent:!1})}},{key:"_setUpFormContainer",value:function(e){var t=this.form.get(e.path);wU(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 bU(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(){yU(this.form,this),this._oldForm&&bU(this._oldForm,this)}},{key:"_checkFormPresent",value:function(){}}]),n}(lU);return e.\u0275fac=function(t){return new(t||e)(Os(Xz,10),Os(Yz,10))},e.\u0275dir=Rt({type:e,selectors:[["","formGroup",""]],hostBindings:function(e,t){1&e&&Vs("submit",function(e){return t.onSubmit(e)})("reset",function(){return t.onReset()})},inputs:{form:["formGroup","form"]},outputs:{ngSubmit:"ngSubmit"},exportAs:["ngForm"],features:[Xu([$U]),cs,qt]}),e}(),ZU=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({imports:[[qU]]}),e}(),JU=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({imports:[ZU]}),e}(),eH=function(){var e=function(){function e(){m(this,e)}return b(e,null,[{key:"withConfig",value:function(t){return{ngModule:e,providers:[{provide:XU,useValue:t.warnOnNgModelWithFormControl}]}}}]),e}();return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({imports:[ZU]}),e}();function tH(e){return new te(function(t){var n;try{n=e()}catch(i){return void t.error(i)}return(n?ye(n):If()).subscribe(t)})}var nH=["underline"],iH=["connectionContainer"],rH=["inputContainer"],oH=["label"];function aH(e,t){1&e&&(Rs(0),As(1,"div",14),Is(2,"div",15),Is(3,"div",16),Is(4,"div",17),Ms(),As(5,"div",18),Is(6,"div",15),Is(7,"div",16),Is(8,"div",17),Ms(),Ds())}function sH(e,t){1&e&&(As(0,"div",19),Ys(1,1),Ms())}function uH(e,t){if(1&e&&(Rs(0),Ys(1,2),As(2,"span"),Cu(3),Ms(),Ds()),2&e){var n=Ws(2);Yo(3),Eu(n._control.placeholder)}}function cH(e,t){1&e&&Ys(0,3,["*ngSwitchCase","true"])}function lH(e,t){1&e&&(As(0,"span",23),Cu(1," *"),Ms())}function hH(e,t){if(1&e){var n=Ls();As(0,"label",20,21),Vs("cdkObserveContent",function(){return bn(n),Ws().updateOutlineGap()}),Cs(2,uH,4,1,"ng-container",12),Cs(3,cH,1,0,"ng-content",12),Cs(4,lH,2,0,"span",22),Ms()}if(2&e){var i=Ws();cu("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),Ts("cdkObserveContentDisabled","outline"!=i.appearance)("id",i._labelId)("ngSwitch",i._hasLabel()),ks("for",i._control.id)("aria-owns",i._control.id),Yo(2),Ts("ngSwitchCase",!1),Yo(1),Ts("ngSwitchCase",!0),Yo(1),Ts("ngIf",!i.hideRequiredMarker&&i._control.required&&!i._control.disabled)}}function dH(e,t){1&e&&(As(0,"div",24),Ys(1,4),Ms())}function fH(e,t){if(1&e&&(As(0,"div",25,26),Is(2,"span",27),Ms()),2&e){var n=Ws();Yo(2),cu("mat-accent","accent"==n.color)("mat-warn","warn"==n.color)}}function pH(e,t){1&e&&(As(0,"div"),Ys(1,5),Ms()),2&e&&Ts("@transitionMessages",Ws()._subscriptAnimationState)}function vH(e,t){if(1&e&&(As(0,"div",31),Cu(1),Ms()),2&e){var n=Ws(2);Ts("id",n._hintLabelId),Yo(1),Eu(n.hintLabel)}}function gH(e,t){if(1&e&&(As(0,"div",28),Cs(1,vH,2,2,"div",29),Ys(2,6),Is(3,"div",30),Ys(4,7),Ms()),2&e){var n=Ws();Ts("@transitionMessages",n._subscriptAnimationState),Yo(1),Ts("ngIf",n.hintLabel)}}var mH=["*",[["","matPrefix",""]],[["mat-placeholder"]],[["mat-label"]],[["","matSuffix",""]],[["mat-error"]],[["mat-hint",3,"align","end"]],[["mat-hint","align","end"]]],yH=["*","[matPrefix]","mat-placeholder","mat-label","[matSuffix]","mat-error","mat-hint:not([align='end'])","mat-hint[align='end']"],bH=new Ri("MatError"),_H={transitionMessages:fg("transitionMessages",[mg("enter",gg({opacity:1,transform:"translateY(0%)"})),yg("void => enter",[gg({opacity:0,transform:"translateY(-5px)"}),pg("300ms cubic-bezier(0.55, 0, 0.55, 0.2)")])])},wH=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275dir=Rt({type:e}),e}(),kH=new Ri("MatHint"),xH=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275dir=Rt({type:e,selectors:[["mat-label"]]}),e}(),SH=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275dir=Rt({type:e,selectors:[["mat-placeholder"]]}),e}(),CH=new Ri("MatPrefix"),EH=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275dir=Rt({type:e,selectors:[["","matPrefix",""]],features:[Xu([{provide:CH,useExisting:e}])]}),e}(),OH=new Ri("MatSuffix"),TH=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275dir=Rt({type:e,selectors:[["","matSuffix",""]],features:[Xu([{provide:OH,useExisting:e}])]}),e}(),PH=0,AH=ab(function(){return function e(t){m(this,e),this._elementRef=t}}(),"primary"),MH=new Ri("MAT_FORM_FIELD_DEFAULT_OPTIONS"),IH=new Ri("MatFormField"),RH=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 ae,l._showAlwaysAnimate=!1,l._subscriptAnimationState="",l._hintLabel="",l._hintLabelId="mat-hint-"+PH++,l._labelId="mat-form-field-label-"+PH++,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=Wd(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(Ef(null)).subscribe(function(){e._validatePlaceholders(),e._syncDescribedByIds(),e._changeDetectorRef.markForCheck()}),t.ngControl&&t.ngControl.valueChanges&&t.ngControl.valueChanges.pipe(kf(this._destroyed)).subscribe(function(){return e._changeDetectorRef.markForCheck()}),this._ngZone.runOutsideAngular(function(){e._ngZone.onStable.pipe(kf(e._destroyed)).subscribe(function(){e._outlineGapCalculationNeededOnStable&&e.updateOutlineGap()})}),Oe(this._prefixChildren.changes,this._suffixChildren.changes).subscribe(function(){e._outlineGapCalculationNeededOnStable=!0,e._changeDetectorRef.markForCheck()}),this._hintChildren.changes.pipe(Ef(null)).subscribe(function(){e._processHints(),e._changeDetectorRef.markForCheck()}),this._errorChildren.changes.pipe(Ef(null)).subscribe(function(){e._syncDescribedByIds(),e._changeDetectorRef.markForCheck()}),this._dir&&this._dir.change.pipe(kf(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,Qd(this._label.nativeElement,"transitionend").pipe(_p(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 d=0;d1&&void 0!==arguments[1]?arguments[1]:ff,n=function(e){return e instanceof Date&&!isNaN(+e)}(e)?+e-t.now():Math.abs(e);return function(e){return e.lift(new LH(n,t))}}var LH=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 jH(e,this.delay,this.scheduler))}}]),e}(),jH=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 FH(t.now()+this.delay,e);this.queue.push(n),!1===this.active&&this._schedule(t)}}},{key:"_next",value:function(e){this.scheduleNotification(Nf.createNext(e))}},{key:"_error",value:function(e){this.errored=!0,this.queue=[],this.destination.error(e),this.unsubscribe()}},{key:"_complete",value:function(){this.scheduleNotification(Nf.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}(K),FH=function e(t,n){m(this,e),this.time=t,this.notification=n},BH=["panel"];function VH(e,t){if(1&e&&(As(0,"div",0,1),Ys(2),Ms()),2&e){var n=t.id,i=Ws();Ts("id",i.id)("ngClass",i._classList),ks("aria-label",i.ariaLabel||null)("aria-labelledby",i._getPanelAriaLabelledby(n))}}var zH=["*"],UH=0,HH=function e(t,n){m(this,e),this.source=t,this.option=n},GH=sb(function(){return function e(){m(this,e)}}()),WH=new Ri("mat-autocomplete-default-options",{providedIn:"root",factory:function(){return{autoActiveFirstOption:!1}}}),qH=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=q.EMPTY,a.showPanel=!1,a._isOpen=!1,a.displayWith=null,a.optionSelected=new ol,a.opened=new ol,a.closed=new ol,a.optionActivated=new ol,a._classList={},a.id="mat-autocomplete-"+UH++,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=Wd(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 zv(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 HH(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}(GH);return e.\u0275fac=function(t){return new(t||e)(Os(Cc),Os(Ju),Os(WH),Os(qf))},e.\u0275dir=Rt({type:e,viewQuery:function(e,t){var n;(1&e&&(yl(Ac,7),yl(BH,5)),2&e)&&(ml(n=_l())&&(t.template=n.first),ml(n=_l())&&(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:[cs]}),e}(),XH=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}(qH);return t.\u0275fac=function(n){return(e||(e=Ti(t)))(n||t)},t.\u0275cmp=Ot({type:t,selectors:[["mat-autocomplete"]],contentQueries:function(e,t,n){var i;(1&e&&(bl(n,Pb,5),bl(n,Rb,5)),2&e)&&(ml(i=_l())&&(t.optionGroups=i),ml(i=_l())&&(t.options=i))},hostAttrs:[1,"mat-autocomplete"],inputs:{disableRipple:"disableRipple"},exportAs:["matAutocomplete"],features:[Xu([{provide:Cb,useExisting:t}]),cs],ngContentSelectors:zH,decls:1,vars:0,consts:[["role","listbox",1,"mat-autocomplete-panel",3,"id","ngClass"],["panel",""]],template:function(e,t){1&e&&(Xs(),Cs(0,VH,3,4,"ng-template"))},directives:[Gh],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}(),YH=new Ri("mat-autocomplete-scroll-strategy"),KH={provide:YH,deps:[iv],useFactory:function(e){return function(){return e.scrollStrategies.reposition()}}},$H={provide:Hz,useExisting:He(function(){return ZH}),multi:!0},QH=function(){var e=function(){function e(t,n,i,r,o,a,s,u,c,l,h){var d=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=q.EMPTY,this._canOpenOnNextFocus=!0,this._closeKeyEventStream=new ae,this._windowBlurHandler=function(){d._canOpenOnNextFocus=d._document.activeElement!==d._element.nativeElement||d.panelOpen},this._onChange=function(){},this._onTouched=function(){},this.position="auto",this.autocompleteAttribute="off",this._overlayAttached=!1,this.optionSelections=tH(function(){return d.autocomplete&&d.autocomplete.options?Oe.apply(void 0,v(d.autocomplete.options.map(function(e){return e.onSelectionChange}))):d._zone.onStable.pipe(_p(1),Of(function(){return d.optionSelections}))}),this._scrollStrategy=a}return b(e,[{key:"autocompleteDisabled",get:function(){return this._autocompleteDisabled},set:function(e){this._autocompleteDisabled=Wd(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 Oe(this.optionSelections,this.autocomplete._keyManager.tabOut.pipe(bf(function(){return e._overlayAttached})),this._closeKeyEventStream,this._getOutsideClickStream(),this._overlayRef?this._overlayRef.detachments().pipe(bf(function(){return e._overlayAttached})):$d()).pipe(ce(function(e){return e instanceof Mb?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 Oe(Qd(this._document,"click"),Qd(this._document,"auxclick"),Qd(this._document,"touchend")).pipe(bf(function(t){var n=Jf(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&&!Ep(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 Oe(this._zone.onStable.pipe(_p(1)),this.autocomplete.options.changes.pipe(mv(function(){return e._positionStrategy.reapplyLastPosition()}),NH(0))).pipe(Of(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}),_p(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 hp(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&&!Ep(e)||38===e.keyCode&&Ep(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 Np({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=Db(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=Nb(r.offsetTop,r.offsetHeight,t._getScrollTop(),t.panel.nativeElement.offsetHeight);t._setScrollTop(o)}}}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Os(Ju),Os(iv),Os(Nc),Os(Xl),Os(Cc),Os(YH),Os(tp,8),Os(IH,9),Os(bh,8),Os(ap),Os(WH,8))},e.\u0275dir=Rt({type:e,inputs:{position:["matAutocompletePosition","position"],autocompleteAttribute:["autocomplete","autocompleteAttribute"],autocompleteDisabled:["matAutocompleteDisabled","autocompleteDisabled"],autocomplete:["matAutocomplete","autocomplete"],connectedTo:["matAutocompleteConnectedTo","connectedTo"]},features:[qt]}),e}(),ZH=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}(QH);return t.\u0275fac=function(n){return(e||(e=Ti(t)))(n||t)},t.\u0275dir=Rt({type:t,selectors:[["input","matAutocomplete",""],["textarea","matAutocomplete",""]],hostAttrs:[1,"mat-autocomplete-trigger"],hostVars:7,hostBindings:function(e,t){1&e&&Vs("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&&ks("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:[Xu([$H]),cs]}),t}(),JH=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({providers:[KH],imports:[[cv,Lb,rb,cd],sp,Lb,rb]}),e}(),eG=$f({passive:!0}),tG=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 Mf;var n=Kd(e),i=this._monitoredElements.get(n);if(i)return i.subject;var r=new ae,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,eG),n.classList.add("cdk-text-field-autofill-monitored")}),this._monitoredElements.set(n,{subject:r,unlisten:function(){n.removeEventListener("animationstart",a,eG)}}),r}},{key:"stopMonitoring",value:function(e){var t=Kd(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)(Zi(qf),Zi(Xl))},e.\u0275prov=$e({factory:function(){return new e(Zi(qf),Zi(Xl))},token:e,providedIn:"root"}),e}(),nG=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({imports:[[Xf]]}),e}(),iG=new Ri("MAT_INPUT_VALUE_ACCESSOR"),rG=["button","checkbox","file","hidden","image","radio","range","reset","submit"],oG=0,aG=cb(function(){return function e(t,n,i,r){m(this,e),this._defaultErrorStateMatcher=t,this._parentForm=n,this._parentFormGroup=i,this.ngControl=r}}()),sG=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 d;m(this,n),(d=t.call(this,s,o,a,r))._elementRef=e,d._platform=i,d._autofillMonitor=c,d._formField=h,d._uid="mat-input-"+oG++,d.focused=!1,d.stateChanges=new ae,d.controlType="mat-input",d.autofilled=!1,d._disabled=!1,d._required=!1,d._type="text",d._readonly=!1,d._neverEmptyInputTypes=["date","datetime","datetime-local","month","time","week"].filter(function(e){return Kf().has(e)});var f=d._elementRef.nativeElement,p=f.nodeName.toLowerCase();return d._inputValueAccessor=u||f,d._previousNativeValue=d.value,d.id=d.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))})}),d._isServer=!d._platform.isBrowser,d._isNativeSelect="select"===p,d._isTextarea="textarea"===p,d._isInFormField=!!h,d._isNativeSelect&&(d.controlType=f.multiple?"mat-native-select-multiple":"mat-native-select"),d}return b(n,[{key:"disabled",get:function(){return this.ngControl&&null!==this.ngControl.disabled?this.ngControl.disabled:this._disabled},set:function(e){this._disabled=Wd(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=Wd(e)}},{key:"type",get:function(){return this._type},set:function(e){this._type=e||"text",this._validateType(),!this._isTextarea&&Kf().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=Wd(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(){rG.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}(aG);return e.\u0275fac=function(t){return new(t||e)(Os(Ju),Os(qf),Os(hU,10),Os(zU,8),Os(QU,8),Os(lb),Os(iG,10),Os(tG),Os(Xl),Os(IH,8))},e.\u0275dir=Rt({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&&Vs("focus",function(){return t._focusChanged(!0)})("blur",function(){return t._focusChanged(!1)})("input",function(){return t._onInput()}),2&e&&(Au("disabled",t.disabled)("required",t.required),ks("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),cu("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:[Xu([{provide:wH,useExisting:e}]),cs,qt]}),e}(),uG=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({providers:[lb],imports:[[nG,DH,rb],nG,DH]}),e}();function cG(){for(var e=arguments.length,t=new Array(e),n=0;n0&&void 0!==arguments[0]?arguments[0]:this.value,t=new yG;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}(bG);return e.\u0275fac=function(t){return new(t||e)(Os(Ju),Os(rg),Os(Cc),Os(tp,8),Ai("tabindex"),Os(Xl),Os(bh),Os(Yy,8))},e.\u0275cmp=Ot({type:e,selectors:[["mat-slider"]],viewQuery:function(e,t){var n;(1&e&&yl(vG,5),2&e)&&(ml(n=_l())&&(t._sliderWrapper=n.first))},hostAttrs:["role","slider",1,"mat-slider","mat-focus-indicator"],hostVars:29,hostBindings:function(e,t){1&e&&Vs("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&&(Au("tabIndex",t.tabIndex),ks("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"),cu("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:[Xu([mG]),cs],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&&(As(0,"div",0,1),As(2,"div",2),Is(3,"div",3),Is(4,"div",4),Ms(),As(5,"div",5),Is(6,"div",6),Ms(),As(7,"div",7),Is(8,"div",8),Is(9,"div",9),As(10,"div",10),As(11,"span",11),Cu(12),Ms(),Ms(),Ms(),Ms()),2&e&&(Yo(3),Ts("ngStyle",t._getTrackBackgroundStyles()),Yo(1),Ts("ngStyle",t._getTrackFillStyles()),Yo(1),Ts("ngStyle",t._getTicksContainerStyles()),Yo(1),Ts("ngStyle",t._getTicksStyles()),Yo(1),Ts("ngStyle",t._getThumbContainerStyles()),Yo(5),Eu(t.displayValue))},directives:[td],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 wG(e){return"t"===e.type[0]}function kG(e,t){var n;return(n=wG(e)?"number"==typeof t?xG(e.touches,t)||xG(e.changedTouches,t):e.touches[0]||e.changedTouches[0]:e)?{x:n.clientX,y:n.clientY}:void 0}function xG(e,t){for(var n=0;n enter",pg("150ms cubic-bezier(0, 0, 0.2, 1)",gg({transform:"none",opacity:1}))),yg("* => void, * => exit",pg("75ms cubic-bezier(0.4, 0.0, 0.2, 1)",gg({opacity:0})))])},TG=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 ol,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=Zf(),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=Zf())}},{key:"_focusDialogContainer",value:function(){this._elementRef.nativeElement.focus&&this._elementRef.nativeElement.focus()}},{key:"_containsFocus",value:function(){var e=this._elementRef.nativeElement,t=Zf();return e===t||e.contains(t)}}]),n}(fp);return e.\u0275fac=function(t){return new(t||e)(Os(Ju),Os(qv),Os(Cc),Os(bh,8),Os(EG),Os(rg))},e.\u0275dir=Rt({type:e,viewQuery:function(e,t){var n;(1&e&&yl(mp,7),2&e)&&(ml(n=_l())&&(t._portalOutlet=n.first))},features:[cs]}),e}(),PG=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}(TG);return t.\u0275fac=function(n){return(e||(e=Ti(t)))(n||t)},t.\u0275cmp=Ot({type:t,selectors:[["mat-dialog-container"]],hostAttrs:["tabindex","-1","aria-modal","true",1,"mat-dialog-container"],hostVars:6,hostBindings:function(e,t){1&e&&zs("@dialogContainer.start",function(e){return t._onAnimationStart(e)})("@dialogContainer.done",function(e){return t._onAnimationDone(e)}),2&e&&(Au("id",t._id),ks("role",t._config.role)("aria-labelledby",t._config.ariaLabel?null:t._ariaLabelledBy)("aria-label",t._config.ariaLabel)("aria-describedby",t._config.ariaDescribedBy||null),Mu("@dialogContainer",t._state))},features:[cs],decls:1,vars:0,consts:[["cdkPortalOutlet",""]],template:function(e,t){1&e&&Cs(0,CG,0,0,"ng-template",0)},directives:[mp],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:[OG.dialogContainer]}}),t}(),AG=0,MG=function(){function e(t,n){var i=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"mat-dialog-"+AG++;m(this,e),this._overlayRef=t,this._containerInstance=n,this.id=r,this.disableClose=this._containerInstance._config.disableClose,this._afterOpened=new ae,this._afterClosed=new ae,this._beforeClosed=new ae,this._state=0,n._id=r,n._animationStateChanged.pipe(bf(function(e){return"opened"===e.state}),_p(1)).subscribe(function(){i._afterOpened.next(),i._afterOpened.complete()}),n._animationStateChanged.pipe(bf(function(e){return"closed"===e.state}),_p(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(bf(function(e){return 27===e.keyCode&&!i.disableClose&&!Ep(e)})).subscribe(function(e){e.preventDefault(),IG(i,"keyboard")}),t.backdropClick().subscribe(function(){i.disableClose?i._containerInstance._recaptureFocus():IG(i,"mouse")})}return b(e,[{key:"close",value:function(e){var t=this;this._result=e,this._containerInstance._animationStateChanged.pipe(bf(function(e){return"closing"===e.state}),_p(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 IG(e,t,n){return void 0!==e._containerInstance&&(e._containerInstance._closeInteractionType=t),e.close(n)}var RG=new Ri("MatDialogData"),DG=new Ri("mat-dialog-default-options"),NG=new Ri("mat-dialog-scroll-strategy"),LG={provide:NG,deps:[iv],useFactory:function(e){return function(){return e.scrollStrategies.block()}}},jG=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 ae,this._afterOpenedAtThisLevel=new ae,this._ariaHiddenElements=new Map,this.afterAllClosed=tH(function(){return l.openDialogs.length?l._getAfterAllClosed():l._getAfterAllClosed().pipe(Ef(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 EG)).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 Np({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=ss.create({parent:t&&t.viewContainerRef&&t.viewContainerRef.injector||this._injector,providers:[{provide:EG,useValue:t}]}),i=new lp(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 Ac)t.attachTemplatePortal(new hp(e,null,{$implicit:i.data,dialogRef:r}));else{var o=this._createInjector(i,r,t),a=t.attachComponentPortal(new lp(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(tp,null,at.Optional))&&r.push({provide:tp,useValue:{value:e.direction,change:$d()}}),ss.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)(Os(iv),Os(ss),Os(void 0),Os(void 0),Os(Hp),Os(void 0),Os(Di),Os(Di),Os(Ri))},e.\u0275dir=Rt({type:e}),e}(),FG=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,MG,PG,RG)}return n}(jG);return e.\u0275fac=function(t){return new(t||e)(Zi(iv),Zi(ss),Zi(Ih,8),Zi(DG,8),Zi(NG),Zi(e,12),Zi(Hp))},e.\u0275prov=$e({token:e,factory:e.\u0275fac}),e}(),BG=0,VG=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-"+BG++}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)(Os(MG,8),Os(Ju),Os(FG))},e.\u0275dir=Rt({type:e,selectors:[["","mat-dialog-title",""],["","matDialogTitle",""]],hostAttrs:[1,"mat-dialog-title"],hostVars:1,hostBindings:function(e,t){2&e&&Au("id",t.id)},inputs:{id:"id"},exportAs:["matDialogTitle"]}),e}(),zG=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275dir=Rt({type:e,selectors:[["","mat-dialog-content",""],["mat-dialog-content"],["","matDialogContent",""]],hostAttrs:[1,"mat-dialog-content"]}),e}(),UG=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({providers:[FG,LG],imports:[[cv,yp,rb],rb]}),e}(),HG=new Ri("CdkAccordion"),GG=0,WG=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=q.EMPTY,this.closed=new ol,this.opened=new ol,this.destroyed=new ol,this.expandedChange=new ol,this.id="cdk-accordion-child-"+GG++,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=Wd(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=Wd(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)(Os(HG,12),Os(Cc),Os(rp))},e.\u0275dir=Rt({type:e,selectors:[["cdk-accordion-item"],["","cdkAccordionItem",""]],inputs:{expanded:"expanded",disabled:"disabled"},outputs:{closed:"closed",opened:"opened",destroyed:"destroyed",expandedChange:"expandedChange"},exportAs:["cdkAccordionItem"],features:[Xu([{provide:HG,useValue:void 0}])]}),e}(),qG=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({}),e}(),XG=["body"];function YG(e,t){}var KG=[[["mat-expansion-panel-header"]],"*",[["mat-action-row"]]],$G=["mat-expansion-panel-header","*","mat-action-row"];function QG(e,t){1&e&&Is(0,"span",2),2&e&&Ts("@indicatorRotate",Ws()._getExpandedState())}var ZG=[[["mat-panel-title"]],[["mat-panel-description"]],"*"],JG=["mat-panel-title","mat-panel-description","*"],eW=new Ri("MAT_ACCORDION"),tW="225ms cubic-bezier(0.4,0.0,0.2,1)",nW={indicatorRotate:fg("indicatorRotate",[mg("collapsed, void",gg({transform:"rotate(0deg)"})),mg("expanded",gg({transform:"rotate(180deg)"})),yg("expanded <=> collapsed, void => collapsed",pg(tW))]),bodyExpansion:fg("bodyExpansion",[mg("collapsed, void",gg({height:"0px",visibility:"hidden"})),mg("expanded",gg({height:"*",visibility:"visible"})),yg("expanded <=> collapsed, void => collapsed",pg(tW))])},iW=function(){var e=function e(t){m(this,e),this._template=t};return e.\u0275fac=function(t){return new(t||e)(Os(Ac))},e.\u0275dir=Rt({type:e,selectors:[["ng-template","matExpansionPanelContent",""]]}),e}(),rW=0,oW=new Ri("MAT_EXPANSION_PANEL_DEFAULT_OPTIONS"),aW=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 ol,c.afterCollapse=new ol,c._inputChanges=new ae,c._headerId="mat-expansion-panel-header-"+rW++,c._bodyAnimationDone=new ae,c.accordion=e,c._document=a,c._bodyAnimationDone.pipe(lf(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=Wd(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(Ef(null),bf(function(){return e.expanded&&!e._portal}),_p(1)).subscribe(function(){e._portal=new hp(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}(WG);return t.\u0275fac=function(e){return new(e||t)(Os(eW,12),Os(Cc),Os(rp),Os(Nc),Os(bh),Os(Yy,8),Os(oW,8))},t.\u0275cmp=Ot({type:t,selectors:[["mat-expansion-panel"]],contentQueries:function(e,t,n){var i;(1&e&&bl(n,iW,5),2&e)&&(ml(i=_l())&&(t._lazyContent=i.first))},viewQuery:function(e,t){var n;(1&e&&yl(XG,5),2&e)&&(ml(n=_l())&&(t._body=n.first))},hostAttrs:[1,"mat-expansion-panel"],hostVars:6,hostBindings:function(e,t){2&e&&cu("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:[Xu([{provide:eW,useValue:void 0}]),cs,qt],ngContentSelectors:$G,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&&(Xs(KG),Ys(0),As(1,"div",0,1),Vs("@bodyExpansion.done",function(e){return t._bodyAnimationDone.next(e)}),As(3,"div",2),Ys(4,1),Cs(5,YG,0,0,"ng-template",3),Ms(),Ys(6,2),Ms()),2&e&&(Yo(1),Ts("@bodyExpansion",t._getExpandedState())("id",t.id),ks("aria-labelledby",t._headerId),Yo(4),Ts("cdkPortalOutlet",t._portal))},directives:[mp],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:[nW.bodyExpansion]},changeDetection:0}),t}(),sW=ub(function e(){m(this,e)}),uW=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=q.EMPTY;var l=e.accordion?e.accordion._stateChanges.pipe(bf(function(e){return!(!e.hideToggle&&!e.togglePosition)})):Mf;return c.tabIndex=parseInt(u||"")||0,c._parentChangeSubscription=Oe(e.opened,e.closed,l,e._inputChanges.pipe(bf(function(e){return!!(e.hideToggle||e.disabled||e.togglePosition)}))).subscribe(function(){return c._changeDetectorRef.markForCheck()}),e.closed.pipe(bf(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:Ep(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}(sW);return e.\u0275fac=function(t){return new(t||e)(Os(aW,1),Os(Ju),Os(rg),Os(Cc),Os(oW,8),Os(Yy,8),Ai("tabindex"))},e.\u0275cmp=Ot({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&&Vs("click",function(){return t._toggle()})("keydown",function(e){return t._keydown(e)}),2&e&&(ks("id",t.panel._headerId)("tabindex",t.tabIndex)("aria-controls",t._getPanelId())("aria-expanded",t._isExpanded())("aria-disabled",t.panel.disabled),uu("height",t._getHeaderHeight()),cu("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:[cs],ngContentSelectors:JG,decls:5,vars:1,consts:[[1,"mat-content"],["class","mat-expansion-indicator",4,"ngIf"],[1,"mat-expansion-indicator"]],template:function(e,t){1&e&&(Xs(ZG),As(0,"span",0),Ys(1),Ys(2,1),Ys(3,2),Ms(),Cs(4,QG,1,1,"span",1)),2&e&&(Yo(4),Ts("ngIf",t._showToggle()))},directives:[Yh],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:[nW.indicatorRotate]},changeDetection:0}),e}(),cW=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({imports:[[cd,rb,qG,yp]]}),e}(),lW=r(5478);Object.create(Error.prototype);var hW=["*"],dW=(function(e){e.LineHighlight="line-highlight",e.LineNumbers="line-numbers"}(dW||(dW={})),dW),fW=function e(){m(this,e)},pW=new Ri("SECURITY_CONTEXT"),vW=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 lW.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=lW.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(ce(function(n){return t.handleExtension(e,n)}))}},{key:"highlight",value:function(e){if(hd(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(!hd(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(!hd(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(!hd(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)(Zi(Ml),Zi(pW),Zi(h_,8),Zi(fW,8),Zi(Vd))},e.\u0275prov=$e({token:e,factory:e.\u0275fac}),e}(),gW=function(){var e=function(){function e(t,n){m(this,e),this.element=t,this.markdownService=n,this.error=new ol,this.load=new ol,this.ready=new ol,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,dW.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}(K_),kW=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 xW(e,this.accumulator,this.seed,this.hasSeed))}}]),e}(),xW=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}(K),SW=function(){function e(t){m(this,e),this.predicate=t}return b(e,[{key:"call",value:function(e,t){return t.subscribe(new CW(e,this.predicate))}}]),e}(),CW=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}(K),EW=["youtubeContainer"],OW=function(){var e=function(){function e(t,n){m(this,e),this._ngZone=t,this._youtubeContainer=new ae,this._destroyed=new ae,this._playerChanges=new vv(void 0),this._videoId=new vv(void 0),this._height=new vv(390),this._width=new vv(640),this._startSeconds=new vv(void 0),this._endSeconds=new vv(void 0),this._suggestedQuality=new vv(void 0),this._playerVars=new vv(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=hd(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=$d(!0);if(!window.YT||!window.YT.Player){var i=new ae;this._existingApiReadyCallback=window.onYouTubeIframeAPIReady,window.onYouTubeIframeAPIReady=function(){e._existingApiReadyCallback&&e._existingApiReadyCallback(),e._ngZone.run(function(){return i.next(!0)})},n=i.pipe(_p(1),Ef(!1))}var r=function(e,n,i,r,o,a,s){var u=J_([n,a]).pipe(bW(J_([r,o])),ce(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,$d(s)]).pipe(function(e){return J(function(){for(var e=arguments.length,t=new Array(e),n=0;n=2&&(n=!0),function(i){return i.lift(new kW(e,t,n))}}(TW,void 0),lf())}(this._youtubeContainer,this._videoId,n,this._width,this._height,this._playerVars,this._ngZone).pipe(mv(function(t){e._playerChanges.next(t)}),ke(function(e){return e?PW(e)?$d(e):new te(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){PW(e)||e.destroy()}(e)}}).pipe(_p(1),Ef(void 0)):$d(void 0)}),kf(this._destroyed),De(new ae));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(ce(function(e){var n=t(e,2);return{startSeconds:n[0],endSeconds:n[1]}})),u=s.pipe(AW(e,function(e){return!!e&&!function(e){var t=e.getPlayerState();return t!==YT.PlayerState.UNSTARTED&&t!==YT.PlayerState.CUED}(e)})),c=n.pipe(AW(e,function(e,t){return!!e&&e.videoId!==t}));Oe(e.pipe(AW(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(bW(J_([e,n,s,o])),ce(function(e){var n=t(e,2);n[0];return n[1]}),kf(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(Of(function(t){return t?yW(function(n){t.addEventListener(e,n)},function(n){try{t.removeEventListener&&t.removeEventListener(e,n)}catch(i){}}):$d()}),function(e){return new te(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()}})})},kf(this._destroyed))}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Os(Xl),Os(Ml))},e.\u0275cmp=Ot({type:e,selectors:[["youtube-player"]],viewQuery:function(e,t){var n;(1&e&&yl(EW,5),2&e)&&(ml(n=_l())&&(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&&Is(0,"div",null,0)},encapsulation:2,changeDetection:0}),e}();function TW(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 PW(e){return"getPlayerStatus"in e}function AW(e,n){return J(bW(e),bf(function(e){var i=t(e,2),r=i[0],o=i[1];return n(o,r)}),ce(function(e){return t(e,1)[0]}))}var MW=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({}),e}(),IW=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275dir=Rt({type:e,selectors:[["","mat-card-sm-image",""],["","matCardImageSmall",""]],hostAttrs:[1,"mat-card-sm-image"]}),e}();function RW(e){return!0===e}function DW(e){return null==e}function NW(e){return!DW(e)}function LW(e){return Boolean(e)}function jW(e){return DW(e)?e:JSON.parse(JSON.stringify(e))}var FW=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 BW(e){return NW(e)&&"object"==typeof e&&function(e){return"[object Object]"===Object.prototype.toString.call(e)}(e)}var VW="NGXS_DATA_META",zW="NGXS_META",UW="NGXS_ARGUMENT_REGISTRY_META",HW=function(){var e=function(){function e(t){var n=this;m(this,e),this.sequence$=new vv(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)(Zi(Pz,8))},e.\u0275prov=$e({token:e,factory:e.\u0275fac}),e}();function GW(e){return e[VW]}var WW=function(){var e=function e(t,n,i){m(this,e),e.store=t.get(Pz),e.ngZone=t.get(Xl),e.factory=n,e.context=i,e.computed=t.get(HW)};return e.store=null,e.computed=null,e.context=null,e.factory=null,e.ngZone=null,e.\u0275prov=$e({token:e,factory:e.\u0275fac=function(t){return new(t||e)(Zi(ss),Zi(bV),Zi(yV))}}),e}(),qW=function(){function e(){m(this,e),e.statesCachedMeta.clear()}return b(e,null,[{key:"createStateContext",value:function(e){return WW.context.createStateContext(e)}},{key:"ensureMappedState",value:function(t){if(DW(WW.factory)||DW(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(NW(t.name)?e.statesCachedMeta.get(t.name):null)||e.ensureMeta(t)}},{key:"getRepositoryByInstance",value:function(t){var n,i=null!==(n=GW(e.getStateClassByInstance(t)))&&void 0!==n?n:null;if(DW(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=NW(t.name)?null===(n=WW.factory.states)||void 0===n?void 0:n.find(function(e){return e.name===t.name}):null;return NW(i)&&NW(t.name)&&e.statesCachedMeta.set(t.name,i),i}}]),e}();qW.statesCachedMeta=new Map,qW.\u0275fac=function(e){return new(e||qW)},qW.\u0275prov=$e({token:qW,factory:qW.\u0275fac}),new Bf(1);var XW=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(NW(null==e?void 0:e.constructor)?e.constructor.name:e," to PlainObject"))}return n}(l(Error));function YW(e){var t;return null!==(t=e.NGXS_OPTIONS_META)&&void 0!==t?t:{name:""}}function KW(e){var t,n=YW(e),i=null!==(t=n.children)&&void 0!==t?t:[],r=jW(void 0===n.defaults?{}:n.defaults);if(i.length){if(BW(r))return function(e,t){return t.reduce(function(e,t){var n=YW(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()]=KW(t),e},null!=e?e:{})}(r,i);throw new XW(r)}return r}function $W(e){var t;return null!==(t=e.__NGXS_COMPUTED_OPTION__)&&void 0!==t?t:null}function QW(){var e,t;return null!==(t=null===(e=null==WW?void 0:WW.computed)||void 0===e?void 0:e.sequenceValue)&&void 0!==t?t:0}function ZW(e){var t=!1;return cf(e)&&(t=!0),t}function JW(e){return e[UW]}var eq=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)),tq=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(LW(this.argumentMap.has(e))||LW(this.payloadMap.has(e)))throw new eq(e,t)}}]),e}();function nq(e){return ah()?FW(e):e}function iq(e){return{enumerable:!0,configurable:!0,get:function(){var t=GW(e),n=qW.ensureMappedState(t.stateMeta);return qW.createStateContext(n)}}}function rq(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 ah()?FW(e.getState()):e.getState()},setState:function(t){e.setState(t)},patchState:function(t){e.patchState(t)}})}function oq(){return function(e,t,n){!function(e,t){if(!function(e,t){var n,i=e,r=!1;if(BW(i))for(;null!==i;){if(RW(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 DW($W(e))&&Object.defineProperties(e,{__NGXS_COMPUTED_OPTION__:{enumerable:!0,configurable:!0,value:new WeakMap}}),$W(e)}(this),t=null==e?void 0:e.get(i);if(RW(null==t?void 0:t.isObservable))return null==t?void 0:t.value;if(DW(t)||t.sequenceId!==QW()){e.delete(i);for(var n=arguments.length,r=new Array(n),o=0;o0&&void 0!==arguments[0]?arguments[0]:aq;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:pq,useValue:{trackingCode:t,initCommands:n,uri:i,enableTracing:r,nonce:o}},bq]}}}]),e}();return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({imports:[[]]}),e}(),wq=function(){var e=function(){function e(){m(this,e),this.consent="not-set",this.consentChange=new Bf(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=$e({token:e,factory:e.\u0275fac}),e}(),kq=function(){var e=function(){function e(t,n,i){var r=this,o=i.trackingCode;m(this,e),this.window=n,this.subscriptions=new q,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)(Zi(wq),Zi(vq),Zi(pq))},e.\u0275prov=$e({token:e,factory:e.\u0275fac}),e}(),xq=new Ri("Key under which consent is stored",{providedIn:"root",factory:function(){return"ALLOW_TELEMETRY"}}),Sq=[wq,kq,function(){var e=function(){function e(t,n){var i=this;m(this,e),this.key=n,this.subscriptions=new q;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)(Zi(wq),Zi(xq))},e.\u0275prov=$e({token:e,factory:e.\u0275fac}),e}()];function Cq(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 Eq=function(){var e=function(){function e(){m(this,e)}return b(e,null,[{key:"forRoot",value:function(t){var n=_q.forRoot(t.gaToken,function(e){return[{command:"set",values:[Cq({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=Mt({type:e}),e.\u0275inj=Qe({providers:[].concat(Sq,[{provide:Cl,multi:!0,useFactory:function(){return function(){}},deps:Sq}]),imports:[[_q]]}),e}();function Oq(e,t,n,i){n&&"function"!=typeof n&&(i=n);var r="function"==typeof n?n:void 0,o=new Bf(e,t,i);return function(e){return De(function(){return o},r)(e)}}var Tq=function(e,t){return JSON.stringify(e)===JSON.stringify(t)},Pq=function(e){return e.map(function(e){return void 0!==e?JSON.parse(JSON.stringify(e)):e})},Aq={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},Mq=new ae;function Iq(){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 Aq.storageStrategy,u=[];e.cacheModifier&&e.cacheModifier.subscribe(function(e){return s.addMany(e(s.getAll(o,r)),o,r)}),Oe(Mq.asObservable(),e.cacheBusterObserver?e.cacheBusterObserver:If()).subscribe(function(e){s.removeAll(o,r),u.length=0}),e.cacheResolver=e.cacheResolver||Aq.cacheResolver||Tq,e.cacheHasher=e.cacheHasher||Aq.cacheHasher||Pq,i.value=function(){for(var t=this,n=s.getAll(o,this),i=arguments.length,r=new Array(i),c=0;c(e.maxAge||Aq.maxAge)?(s.remove?s.remove(n.indexOf(h),h,o,this):s.removeAtIndex(n.indexOf(h),o,this),h=null):(e.slidingExpiration||Aq.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 f=$d(h.response);return e.async?f.pipe(NH(0)):f}if(d)return d.response;var p=a.call.apply(a,[this].concat(r)).pipe(Ub(function(){var t=u.find(function(t){return e.cacheResolver(t.parameters,l)});u.splice(u.indexOf(t),1)}),mv(function(i){(!e.shouldCacheDecider||e.shouldCacheDecider(i))&&((!(e.maxCacheCount||Aq.maxCacheCount)||1===(e.maxCacheCount||Aq.maxCacheCount)||(e.maxCacheCount||Aq.maxCacheCount)&&(e.maxCacheCount||Aq.maxCacheCount)0&&void 0!==arguments[0]?arguments[0]:{};m(this,e),this.apiKeys=t.apiKeys,this.username=t.username,this.password=t.password,this.accessToken=t.accessToken,this.basePath=t.basePath,this.withCredentials=t.withCredentials,this.encoder=t.encoder,this.credentials=t.credentials?t.credentials:{}}return b(e,[{key:"selectHeaderContentType",value:function(e){var t=this;if(0!==e.length){var n=e.find(function(e){return t.isJsonMime(e)});return void 0===n?e[0]:n}}},{key:"selectHeaderAccept",value:function(e){var t=this;if(0!==e.length){var n=e.find(function(e){return t.isJsonMime(e)});return void 0===n?e[0]:n}}},{key:"isJsonMime",value:function(e){var t=new RegExp("^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$","i");return null!==e&&(t.test(e)||"application/json-patch+json"===e.toLowerCase())}},{key:"lookupCredential",value:function(e){var t=this.credentials[e];return"function"==typeof t?t():t}}]),e}(),jq=function(){var e=function(){function e(t,n,i){m(this,e),this.httpClient=t,this.basePath="/v1",this.defaultHeaders=new Xb,this.configuration=new Lq,i&&(this.configuration=i),"string"!=typeof this.configuration.basePath&&("string"!=typeof n&&(n=this.basePath),this.configuration.basePath=n),this.encoder=this.configuration.encoder||new Dq}return b(e,[{key:"addToHttpParams",value:function(e,t,n){return this.addToHttpParamsRecursive(e,t,n)}},{key:"addToHttpParamsRecursive",value:function(e,t,n){var i=this;if(null==t)return e;if("object"==typeof t)if(Array.isArray(t))t.forEach(function(t){return e=i.addToHttpParamsRecursive(e,t,n)});else if(t instanceof Date){if(null==n)throw Error("key may not be null if value is Date");e=e.append(n,t.toISOString().substr(0,10))}else Object.keys(t).forEach(function(r){return e=i.addToHttpParamsRecursive(e,t[r],null!=n?"".concat(n,".").concat(r):r)});else{if(null==n)throw Error("key may not be null if value is not object or array");e=e.append(n,t)}return e}},{key:"aggregateResults",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"body",i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3?arguments[3]:void 0,o=e.age,a=e.ageRange,s=e.bmi,u=e.bmiRange,c=e.cache,l=e.ontologyTerms,h=e.cellTypeTerms,d=e.providers,f=e.sex,p=e.spatial,v=e.technologies,g=e.token,m=new Jb({encoder:this.encoder});null!=o&&(m=this.addToHttpParams(m,o,"age")),null!=a&&(m=this.addToHttpParams(m,a,"age-range")),null!=s&&(m=this.addToHttpParams(m,s,"bmi")),null!=u&&(m=this.addToHttpParams(m,u,"bmi-range")),null!=c&&(m=this.addToHttpParams(m,c,"cache")),l&&l.forEach(function(e){m=t.addToHttpParams(m,e,"ontology-terms")}),h&&h.forEach(function(e){m=t.addToHttpParams(m,e,"cell-type-terms")}),d&&d.forEach(function(e){m=t.addToHttpParams(m,e,"providers")}),null!=f&&(m=this.addToHttpParams(m,f,"sex")),p&&p.forEach(function(e){m=t.addToHttpParams(m,e,"spatial")}),v&&v.forEach(function(e){m=t.addToHttpParams(m,e,"technologies")}),null!=g&&(m=this.addToHttpParams(m,g,"token"));var y=this.defaultHeaders,b=r&&r.httpHeaderAccept;void 0===b&&(b=this.configuration.selectHeaderAccept(["application/json"])),void 0!==b&&(y=y.set("Accept",b));var _=r&&r.context;void 0===_&&(_=new e_);var w="json";return b&&(w=b.startsWith("text")?"text":this.configuration.isJsonMime(b)?"json":"blob"),this.httpClient.get("".concat(this.configuration.basePath,"/aggregate-results"),{context:_,params:m,responseType:w,withCredentials:this.configuration.withCredentials,headers:y,observe:n,reportProgress:i})}},{key:"cellTypeTermOccurences",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"body",i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3?arguments[3]:void 0,o=e.age,a=e.ageRange,s=e.bmi,u=e.bmiRange,c=e.cache,l=e.ontologyTerms,h=e.cellTypeTerms,d=e.providers,f=e.sex,p=e.spatial,v=e.technologies,g=e.token,m=new Jb({encoder:this.encoder});null!=o&&(m=this.addToHttpParams(m,o,"age")),null!=a&&(m=this.addToHttpParams(m,a,"age-range")),null!=s&&(m=this.addToHttpParams(m,s,"bmi")),null!=u&&(m=this.addToHttpParams(m,u,"bmi-range")),null!=c&&(m=this.addToHttpParams(m,c,"cache")),l&&l.forEach(function(e){m=t.addToHttpParams(m,e,"ontology-terms")}),h&&h.forEach(function(e){m=t.addToHttpParams(m,e,"cell-type-terms")}),d&&d.forEach(function(e){m=t.addToHttpParams(m,e,"providers")}),null!=f&&(m=this.addToHttpParams(m,f,"sex")),p&&p.forEach(function(e){m=t.addToHttpParams(m,e,"spatial")}),v&&v.forEach(function(e){m=t.addToHttpParams(m,e,"technologies")}),null!=g&&(m=this.addToHttpParams(m,g,"token"));var y=this.defaultHeaders,b=r&&r.httpHeaderAccept;void 0===b&&(b=this.configuration.selectHeaderAccept(["application/json"])),void 0!==b&&(y=y.set("Accept",b));var _=r&&r.context;void 0===_&&(_=new e_);var w="json";return b&&(w=b.startsWith("text")?"text":this.configuration.isJsonMime(b)?"json":"blob"),this.httpClient.get("".concat(this.configuration.basePath,"/cell-type-term-occurences"),{context:_,params:m,responseType:w,withCredentials:this.configuration.withCredentials,headers:y,observe:n,reportProgress:i})}},{key:"cellTypeTreeModel",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"body",n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3?arguments[3]:void 0,r=e.cache,o=e.token,a=new Jb({encoder:this.encoder});null!=r&&(a=this.addToHttpParams(a,r,"cache")),null!=o&&(a=this.addToHttpParams(a,o,"token"));var s=this.defaultHeaders,u=i&&i.httpHeaderAccept;void 0===u&&(u=this.configuration.selectHeaderAccept(["application/json"])),void 0!==u&&(s=s.set("Accept",u));var c=i&&i.context;void 0===c&&(c=new e_);var l="json";return u&&(l=u.startsWith("text")?"text":this.configuration.isJsonMime(u)?"json":"blob"),this.httpClient.get("".concat(this.configuration.basePath,"/cell-type-tree-model"),{context:c,params:a,responseType:l,withCredentials:this.configuration.withCredentials,headers:s,observe:t,reportProgress:n})}},{key:"dbStatus",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"body",n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3?arguments[3]:void 0,r=e.token,o=new Jb({encoder:this.encoder});null!=r&&(o=this.addToHttpParams(o,r,"token"));var a=this.defaultHeaders,s=i&&i.httpHeaderAccept;void 0===s&&(s=this.configuration.selectHeaderAccept(["application/json"])),void 0!==s&&(a=a.set("Accept",s));var u=i&&i.context;void 0===u&&(u=new e_);var c="json";return s&&(c=s.startsWith("text")?"text":this.configuration.isJsonMime(s)?"json":"blob"),this.httpClient.get("".concat(this.configuration.basePath,"/db-status"),{context:u,params:o,responseType:c,withCredentials:this.configuration.withCredentials,headers:a,observe:t,reportProgress:n})}},{key:"getSpatialPlacement",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"body",n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3?arguments[3]:void 0,r=e.getSpatialPlacementRequest;if(null==r)throw new Error("Required parameter getSpatialPlacementRequest was null or undefined when calling getSpatialPlacement.");var o=this.defaultHeaders,a=i&&i.httpHeaderAccept;void 0===a&&(a=this.configuration.selectHeaderAccept(["application/json"])),void 0!==a&&(o=o.set("Accept",a));var s=i&&i.context;void 0===s&&(s=new e_);var u=this.configuration.selectHeaderContentType(["application/json"]);void 0!==u&&(o=o.set("Content-Type",u));var c="json";return a&&(c=a.startsWith("text")?"text":this.configuration.isJsonMime(a)?"json":"blob"),this.httpClient.post("".concat(this.configuration.basePath,"/get-spatial-placement"),r,{context:s,responseType:c,withCredentials:this.configuration.withCredentials,headers:o,observe:t,reportProgress:n})}},{key:"gtexRuiLocations",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"body",n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3?arguments[3]:void 0,r=e.cache,o=new Jb({encoder:this.encoder});null!=r&&(o=this.addToHttpParams(o,r,"cache"));var a=this.defaultHeaders,s=i&&i.httpHeaderAccept;void 0===s&&(s=this.configuration.selectHeaderAccept(["application/json"])),void 0!==s&&(a=a.set("Accept",s));var u=i&&i.context;void 0===u&&(u=new e_);var c="json";return s&&(c=s.startsWith("text")?"text":this.configuration.isJsonMime(s)?"json":"blob"),this.httpClient.get("".concat(this.configuration.basePath,"/gtex/rui_locations.jsonld"),{context:u,params:o,responseType:c,withCredentials:this.configuration.withCredentials,headers:a,observe:t,reportProgress:n})}},{key:"hubmapRuiLocations",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"body",n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3?arguments[3]:void 0,r=e.cache,o=e.token,a=new Jb({encoder:this.encoder});null!=r&&(a=this.addToHttpParams(a,r,"cache")),null!=o&&(a=this.addToHttpParams(a,o,"token"));var s=this.defaultHeaders,u=i&&i.httpHeaderAccept;void 0===u&&(u=this.configuration.selectHeaderAccept(["application/json"])),void 0!==u&&(s=s.set("Accept",u));var c=i&&i.context;void 0===c&&(c=new e_);var l="json";return u&&(l=u.startsWith("text")?"text":this.configuration.isJsonMime(u)?"json":"blob"),this.httpClient.get("".concat(this.configuration.basePath,"/hubmap/rui_locations.jsonld"),{context:c,params:a,responseType:l,withCredentials:this.configuration.withCredentials,headers:s,observe:t,reportProgress:n})}},{key:"ontologyTermOccurences",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"body",i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3?arguments[3]:void 0,o=e.age,a=e.ageRange,s=e.bmi,u=e.bmiRange,c=e.cache,l=e.ontologyTerms,h=e.cellTypeTerms,d=e.providers,f=e.sex,p=e.spatial,v=e.technologies,g=e.token,m=new Jb({encoder:this.encoder});null!=o&&(m=this.addToHttpParams(m,o,"age")),null!=a&&(m=this.addToHttpParams(m,a,"age-range")),null!=s&&(m=this.addToHttpParams(m,s,"bmi")),null!=u&&(m=this.addToHttpParams(m,u,"bmi-range")),null!=c&&(m=this.addToHttpParams(m,c,"cache")),l&&l.forEach(function(e){m=t.addToHttpParams(m,e,"ontology-terms")}),h&&h.forEach(function(e){m=t.addToHttpParams(m,e,"cell-type-terms")}),d&&d.forEach(function(e){m=t.addToHttpParams(m,e,"providers")}),null!=f&&(m=this.addToHttpParams(m,f,"sex")),p&&p.forEach(function(e){m=t.addToHttpParams(m,e,"spatial")}),v&&v.forEach(function(e){m=t.addToHttpParams(m,e,"technologies")}),null!=g&&(m=this.addToHttpParams(m,g,"token"));var y=this.defaultHeaders,b=r&&r.httpHeaderAccept;void 0===b&&(b=this.configuration.selectHeaderAccept(["application/json"])),void 0!==b&&(y=y.set("Accept",b));var _=r&&r.context;void 0===_&&(_=new e_);var w="json";return b&&(w=b.startsWith("text")?"text":this.configuration.isJsonMime(b)?"json":"blob"),this.httpClient.get("".concat(this.configuration.basePath,"/ontology-term-occurences"),{context:_,params:m,responseType:w,withCredentials:this.configuration.withCredentials,headers:y,observe:n,reportProgress:i})}},{key:"ontologyTreeModel",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"body",n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3?arguments[3]:void 0,r=e.cache,o=e.token,a=new Jb({encoder:this.encoder});null!=r&&(a=this.addToHttpParams(a,r,"cache")),null!=o&&(a=this.addToHttpParams(a,o,"token"));var s=this.defaultHeaders,u=i&&i.httpHeaderAccept;void 0===u&&(u=this.configuration.selectHeaderAccept(["application/json"])),void 0!==u&&(s=s.set("Accept",u));var c=i&&i.context;void 0===c&&(c=new e_);var l="json";return u&&(l=u.startsWith("text")?"text":this.configuration.isJsonMime(u)?"json":"blob"),this.httpClient.get("".concat(this.configuration.basePath,"/ontology-tree-model"),{context:c,params:a,responseType:l,withCredentials:this.configuration.withCredentials,headers:s,observe:t,reportProgress:n})}},{key:"providerNames",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"body",n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3?arguments[3]:void 0,r=e.cache,o=e.token,a=new Jb({encoder:this.encoder});null!=r&&(a=this.addToHttpParams(a,r,"cache")),null!=o&&(a=this.addToHttpParams(a,o,"token"));var s=this.defaultHeaders,u=i&&i.httpHeaderAccept;void 0===u&&(u=this.configuration.selectHeaderAccept(["application/json"])),void 0!==u&&(s=s.set("Accept",u));var c=i&&i.context;void 0===c&&(c=new e_);var l="json";return u&&(l=u.startsWith("text")?"text":this.configuration.isJsonMime(u)?"json":"blob"),this.httpClient.get("".concat(this.configuration.basePath,"/provider-names"),{context:c,params:a,responseType:l,withCredentials:this.configuration.withCredentials,headers:s,observe:t,reportProgress:n})}},{key:"referenceOrganScene",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"body",i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3?arguments[3]:void 0,o=e.organIri;if(null==o)throw new Error("Required parameter organIri was null or undefined when calling referenceOrganScene.");var a=e.age,s=e.ageRange,u=e.bmi,c=e.bmiRange,l=e.cache,h=e.ontologyTerms,d=e.cellTypeTerms,f=e.providers,p=e.sex,v=e.spatial,g=e.technologies,m=e.token,y=new Jb({encoder:this.encoder});null!=a&&(y=this.addToHttpParams(y,a,"age")),null!=s&&(y=this.addToHttpParams(y,s,"age-range")),null!=u&&(y=this.addToHttpParams(y,u,"bmi")),null!=c&&(y=this.addToHttpParams(y,c,"bmi-range")),null!=l&&(y=this.addToHttpParams(y,l,"cache")),h&&h.forEach(function(e){y=t.addToHttpParams(y,e,"ontology-terms")}),d&&d.forEach(function(e){y=t.addToHttpParams(y,e,"cell-type-terms")}),null!=o&&(y=this.addToHttpParams(y,o,"organ-iri")),f&&f.forEach(function(e){y=t.addToHttpParams(y,e,"providers")}),null!=p&&(y=this.addToHttpParams(y,p,"sex")),v&&v.forEach(function(e){y=t.addToHttpParams(y,e,"spatial")}),g&&g.forEach(function(e){y=t.addToHttpParams(y,e,"technologies")}),null!=m&&(y=this.addToHttpParams(y,m,"token"));var b=this.defaultHeaders,_=r&&r.httpHeaderAccept;void 0===_&&(_=this.configuration.selectHeaderAccept(["application/json"])),void 0!==_&&(b=b.set("Accept",_));var w=r&&r.context;void 0===w&&(w=new e_);var k="json";return _&&(k=_.startsWith("text")?"text":this.configuration.isJsonMime(_)?"json":"blob"),this.httpClient.get("".concat(this.configuration.basePath,"/reference-organ-scene"),{context:w,params:y,responseType:k,withCredentials:this.configuration.withCredentials,headers:b,observe:n,reportProgress:i})}},{key:"referenceOrgans",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"body",n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3?arguments[3]:void 0,r=e.cache,o=e.token,a=new Jb({encoder:this.encoder});null!=r&&(a=this.addToHttpParams(a,r,"cache")),null!=o&&(a=this.addToHttpParams(a,o,"token"));var s=this.defaultHeaders,u=i&&i.httpHeaderAccept;void 0===u&&(u=this.configuration.selectHeaderAccept(["application/json"])),void 0!==u&&(s=s.set("Accept",u));var c=i&&i.context;void 0===c&&(c=new e_);var l="json";return u&&(l=u.startsWith("text")?"text":this.configuration.isJsonMime(u)?"json":"blob"),this.httpClient.get("".concat(this.configuration.basePath,"/reference-organs"),{context:c,params:a,responseType:l,withCredentials:this.configuration.withCredentials,headers:s,observe:t,reportProgress:n})}},{key:"scene",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"body",i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3?arguments[3]:void 0,o=e.age,a=e.ageRange,s=e.bmi,u=e.bmiRange,c=e.cache,l=e.ontologyTerms,h=e.cellTypeTerms,d=e.providers,f=e.sex,p=e.spatial,v=e.technologies,g=e.token,m=new Jb({encoder:this.encoder});null!=o&&(m=this.addToHttpParams(m,o,"age")),null!=a&&(m=this.addToHttpParams(m,a,"age-range")),null!=s&&(m=this.addToHttpParams(m,s,"bmi")),null!=u&&(m=this.addToHttpParams(m,u,"bmi-range")),null!=c&&(m=this.addToHttpParams(m,c,"cache")),l&&l.forEach(function(e){m=t.addToHttpParams(m,e,"ontology-terms")}),h&&h.forEach(function(e){m=t.addToHttpParams(m,e,"cell-type-terms")}),d&&d.forEach(function(e){m=t.addToHttpParams(m,e,"providers")}),null!=f&&(m=this.addToHttpParams(m,f,"sex")),p&&p.forEach(function(e){m=t.addToHttpParams(m,e,"spatial")}),v&&v.forEach(function(e){m=t.addToHttpParams(m,e,"technologies")}),null!=g&&(m=this.addToHttpParams(m,g,"token"));var y=this.defaultHeaders,b=r&&r.httpHeaderAccept;void 0===b&&(b=this.configuration.selectHeaderAccept(["application/json"])),void 0!==b&&(y=y.set("Accept",b));var _=r&&r.context;void 0===_&&(_=new e_);var w="json";return b&&(w=b.startsWith("text")?"text":this.configuration.isJsonMime(b)?"json":"blob"),this.httpClient.get("".concat(this.configuration.basePath,"/scene"),{context:_,params:m,responseType:w,withCredentials:this.configuration.withCredentials,headers:y,observe:n,reportProgress:i})}},{key:"sparql",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"body",n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3?arguments[3]:void 0,r=e.query;if(null==r)throw new Error("Required parameter query was null or undefined when calling sparql.");var o=e.token,a=e.format,s=new Jb({encoder:this.encoder});null!=r&&(s=this.addToHttpParams(s,r,"query")),null!=o&&(s=this.addToHttpParams(s,o,"token")),null!=a&&(s=this.addToHttpParams(s,a,"format"));var u=this.defaultHeaders,c=i&&i.httpHeaderAccept;void 0===c&&(c=this.configuration.selectHeaderAccept(["application/json"])),void 0!==c&&(u=u.set("Accept",c));var l=i&&i.context;void 0===l&&(l=new e_);var h="json";return c&&(h=c.startsWith("text")?"text":this.configuration.isJsonMime(c)?"json":"blob"),this.httpClient.get("".concat(this.configuration.basePath,"/sparql"),{context:l,params:s,responseType:h,withCredentials:this.configuration.withCredentials,headers:u,observe:t,reportProgress:n})}},{key:"sparqlPost",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"body",n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3?arguments[3]:void 0,r=e.sparqlQueryRequest;if(null==r)throw new Error("Required parameter sparqlQueryRequest was null or undefined when calling sparqlPost.");var o=e.token,a=e.format,s=new Jb({encoder:this.encoder});null!=o&&(s=this.addToHttpParams(s,o,"token")),null!=a&&(s=this.addToHttpParams(s,a,"format"));var u=this.defaultHeaders,c=i&&i.httpHeaderAccept;void 0===c&&(c=this.configuration.selectHeaderAccept(["application/json"])),void 0!==c&&(u=u.set("Accept",c));var l=i&&i.context;void 0===l&&(l=new e_);var h=this.configuration.selectHeaderContentType(["application/json","application/x-www-form-urlencoded"]);void 0!==h&&(u=u.set("Content-Type",h));var d="json";return c&&(d=c.startsWith("text")?"text":this.configuration.isJsonMime(c)?"json":"blob"),this.httpClient.post("".concat(this.configuration.basePath,"/sparql"),r,{context:l,params:s,responseType:d,withCredentials:this.configuration.withCredentials,headers:u,observe:t,reportProgress:n})}},{key:"technologyNames",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"body",n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3?arguments[3]:void 0,r=e.cache,o=e.token,a=new Jb({encoder:this.encoder});null!=r&&(a=this.addToHttpParams(a,r,"cache")),null!=o&&(a=this.addToHttpParams(a,o,"token"));var s=this.defaultHeaders,u=i&&i.httpHeaderAccept;void 0===u&&(u=this.configuration.selectHeaderAccept(["application/json"])),void 0!==u&&(s=s.set("Accept",u));var c=i&&i.context;void 0===c&&(c=new e_);var l="json";return u&&(l=u.startsWith("text")?"text":this.configuration.isJsonMime(u)?"json":"blob"),this.httpClient.get("".concat(this.configuration.basePath,"/technology-names"),{context:c,params:a,responseType:l,withCredentials:this.configuration.withCredentials,headers:s,observe:t,reportProgress:n})}},{key:"tissueBlocks",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"body",i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3?arguments[3]:void 0,o=e.age,a=e.ageRange,s=e.bmi,u=e.bmiRange,c=e.cache,l=e.ontologyTerms,h=e.cellTypeTerms,d=e.providers,f=e.sex,p=e.spatial,v=e.technologies,g=e.token,m=new Jb({encoder:this.encoder});null!=o&&(m=this.addToHttpParams(m,o,"age")),null!=a&&(m=this.addToHttpParams(m,a,"age-range")),null!=s&&(m=this.addToHttpParams(m,s,"bmi")),null!=u&&(m=this.addToHttpParams(m,u,"bmi-range")),null!=c&&(m=this.addToHttpParams(m,c,"cache")),l&&l.forEach(function(e){m=t.addToHttpParams(m,e,"ontology-terms")}),h&&h.forEach(function(e){m=t.addToHttpParams(m,e,"cell-type-terms")}),d&&d.forEach(function(e){m=t.addToHttpParams(m,e,"providers")}),null!=f&&(m=this.addToHttpParams(m,f,"sex")),p&&p.forEach(function(e){m=t.addToHttpParams(m,e,"spatial")}),v&&v.forEach(function(e){m=t.addToHttpParams(m,e,"technologies")}),null!=g&&(m=this.addToHttpParams(m,g,"token"));var y=this.defaultHeaders,b=r&&r.httpHeaderAccept;void 0===b&&(b=this.configuration.selectHeaderAccept(["application/json"])),void 0!==b&&(y=y.set("Accept",b));var _=r&&r.context;void 0===_&&(_=new e_);var w="json";return b&&(w=b.startsWith("text")?"text":this.configuration.isJsonMime(b)?"json":"blob"),this.httpClient.get("".concat(this.configuration.basePath,"/tissue-blocks"),{context:_,params:m,responseType:w,withCredentials:this.configuration.withCredentials,headers:y,observe:n,reportProgress:i})}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Zi(h_),Zi(Nq,8),Zi(Lq,8))},e.\u0275prov=$e({factory:function(){return new e(Zi(h_),Zi(Nq,8),Zi(Lq,8))},token:e,providedIn:"root"}),e}(),Fq=function(){var e=function(){function e(t,n){if(m(this,e),t)throw new Error("CcfApiModule is already loaded. Import in your base AppModule only.");if(!n)throw new Error("You need to import the HttpClientModule in your AppModule! \nSee also https://github.com/angular/angular/issues/20575")}return b(e,null,[{key:"forRoot",value:function(t){return{ngModule:e,providers:[{provide:Lq,useFactory:t}]}}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Zi(e,12),Zi(h_,8))},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({providers:[],imports:[[]]}),e}();function Bq(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 Vq(){return Rq||(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)},Bq(t)}),Rq=function(n,i){return t.then(function(t){return i(t.transaction(e,n).objectStore(e))})}),Rq;var e,t}function zq(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Vq();return t("readonly",function(t){return Bq(t.get(e))})}var Uq,Hq=r(71440),Gq="Unknown Euler angle order",Wq=.99999,qq=function(e){a(i,e);var n=s(i);function i(){var e,t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:i.DefaultOrder;return m(this,i),t=n.call(this,-0,-0,-0,-0),arguments.length>0&&Array.isArray(arguments[0])?(e=t).fromVector3.apply(e,arguments):t.set(r,o,a,s),t}return b(i,[{key:"ELEMENTS",get:function(){return 4}},{key:"fromQuaternion",value:function(e){var n=t(e,4),r=n[0],o=n[1],a=n[2],s=n[3],u=o*o,c=-2*(u+a*a)+1,l=2*(r*o+s*a),h=-2*(r*a-s*o);return h=(h=h>1?1:h)<-1?-1:h,new i(Math.atan2(2*(o*a+s*r),-2*(r*r+u)+1),Math.asin(h),Math.atan2(l,c),i.RollPitchYaw)}},{key:"copy",value:function(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=Number.isFinite(e[3])||this.order,this.check()}},{key:"set",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3?arguments[3]:void 0;return this[0]=e,this[1]=t,this[2]=n,this[3]=Number.isFinite(i)?i:this[3],this.check()}},{key:"validate",value:function(){return function(e){return e>=0&&e<6}(this[3])&&Number.isFinite(this[0])&&Number.isFinite(this[1])&&Number.isFinite(this[2])}},{key:"toArray",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[t]=this[0],e[t+1]=this[1],e[t+2]=this[2],e}},{key:"toArray4",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[t]=this[0],e[t+1]=this[1],e[t+2]=this[2],e[t+3]=this[3],e}},{key:"toVector3",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[-0,-0,-0];return e[0]=this[0],e[1]=this[1],e[2]=this[2],e}},{key:"x",get:function(){return this[0]},set:function(e){this[0]=gS(e)}},{key:"y",get:function(){return this[1]},set:function(e){this[1]=gS(e)}},{key:"z",get:function(){return this[2]},set:function(e){this[2]=gS(e)}},{key:"alpha",get:function(){return this[0]},set:function(e){this[0]=gS(e)}},{key:"beta",get:function(){return this[1]},set:function(e){this[1]=gS(e)}},{key:"gamma",get:function(){return this[2]},set:function(e){this[2]=gS(e)}},{key:"phi",get:function(){return this[0]},set:function(e){this[0]=gS(e)}},{key:"theta",get:function(){return this[1]},set:function(e){this[1]=gS(e)}},{key:"psi",get:function(){return this[2]},set:function(e){this[2]=gS(e)}},{key:"roll",get:function(){return this[0]},set:function(e){this[0]=gS(e)}},{key:"pitch",get:function(){return this[1]},set:function(e){this[1]=gS(e)}},{key:"yaw",get:function(){return this[2]},set:function(e){this[2]=gS(e)}},{key:"order",get:function(){return this[3]},set:function(e){this[3]=function(e){if(e<0&&e>=6)throw new Error(Gq);return e}(e)}},{key:"fromVector3",value:function(e,t){return this.set(e[0],e[1],e[2],Number.isFinite(t)?t:this[3])}},{key:"fromArray",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this[0]=e[0+t],this[1]=e[1+t],this[2]=e[2+t],void 0!==e[3]&&(this[3]=e[3]),this.check()}},{key:"fromRollPitchYaw",value:function(e,t,n){return this.set(e,t,n,i.ZYX)}},{key:"fromRotationMatrix",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i.DefaultOrder;return this._fromRotationMatrix(e,t),this.check()}},{key:"getRotationMatrix",value:function(e){return this._getRotationMatrix(e)}},{key:"getQuaternion",value:function(){var e=new JN;switch(this[4]){case i.XYZ:return e.rotateX(this[0]).rotateY(this[1]).rotateZ(this[2]);case i.YXZ:return e.rotateY(this[0]).rotateX(this[1]).rotateZ(this[2]);case i.ZXY:return e.rotateZ(this[0]).rotateX(this[1]).rotateY(this[2]);case i.ZYX:return e.rotateZ(this[0]).rotateY(this[1]).rotateX(this[2]);case i.YZX:return e.rotateY(this[0]).rotateZ(this[1]).rotateX(this[2]);case i.XZY:return e.rotateX(this[0]).rotateZ(this[1]).rotateY(this[2]);default:throw new Error(Gq)}}},{key:"_fromRotationMatrix",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i.DefaultOrder,n=e.elements,r=n[0],o=n[4],a=n[8],s=n[1],u=n[5],c=n[9],l=n[2],h=n[6],d=n[10];switch(t=t||this[3]){case i.XYZ:this[1]=Math.asin(hS(a,-1,1)),Math.abs(a)1&&void 0!==arguments[1]?arguments[1]:0,n=(tX[e[t+0]]+tX[e[t+1]]+tX[e[t+2]]+tX[e[t+3]]+"-"+tX[e[t+4]]+tX[e[t+5]]+"-"+tX[e[t+6]]+tX[e[t+7]]+"-"+tX[e[t+8]]+tX[e[t+9]]+"-"+tX[e[t+10]]+tX[e[t+11]]+tX[e[t+12]]+tX[e[t+13]]+tX[e[t+14]]+tX[e[t+15]]).toLowerCase();if(!eX(n))throw TypeError("Stringified UUID is invalid");return n}(i)},rX=r(31609),oX=Object.freeze({OUTSIDE:-1,INTERSECTING:0,INSIDE:1}),aX=(Math,Math,{});function sX(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.precision,i=void 0===n?aX.precision||4:n;return e=function(e){return Math.round(e/aX.EPSILON)*aX.EPSILON}(e),"".concat(parseFloat(e.toPrecision(i)))}function uX(e){return Array.isArray(e)||ArrayBuffer.isView(e)&&!(e instanceof DataView)}function cX(e,t,n){var i=aX.EPSILON;n&&(aX.EPSILON=n);try{if(e===t)return!0;if(uX(e)&&uX(t)){if(e.length!==t.length)return!1;for(var 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?", ":"")+sX(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(aX.debug&&!function(e,t){if(e.length!==t)return!1;for(var n=0;n0&&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):(aX.debug&&(dX(i),dX(r),dX(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 aX.debug&&(dX(e.x),dX(e.y),dX(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]=dX(e)}},{key:"angle",value:function(e){return RS(this,e)}},{key:"cross",value:function(e){return ES(this,this,e),this.check()}},{key:"rotateX",value:function(e){var t=e.radians,n=e.origin;return AS(this,this,void 0===n?gX:n,t),this.check()}},{key:"rotateY",value:function(e){var t=e.radians,n=e.origin;return MS(this,this,void 0===n?gX:n,t),this.check()}},{key:"rotateZ",value:function(e){var t=e.radians,n=e.origin;return IS(this,this,void 0===n?gX:n,t),this.check()}},{key:"transform",value:function(e){return this.transformAsPoint(e)}},{key:"transformAsPoint",value:function(e){return OS(this,this,e),this.check()}},{key:"transformAsVector",value:function(e){return function(e,t,n){var i=t[0],r=t[1],o=t[2],a=n[3]*i+n[7]*r+n[11]*o||1;e[0]=(n[0]*i+n[4]*r+n[8]*o)/a,e[1]=(n[1]*i+n[5]*r+n[9]*o)/a,e[2]=(n[2]*i+n[6]*r+n[10]*o)/a}(this,this,e),this.check()}},{key:"transformByMatrix3",value:function(e){return TS(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 PS(this,this,e),this.check()}}],[{key:"ZERO",get:function(){return mX.ZERO=mX.ZERO||Object.freeze(new n(0,0,0,0))}}]),n}(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 lX(!1),0}},{key:"copy",value:function(e){return lX(!1),this}},{key:"x",get:function(){return this[0]},set:function(e){this[0]=dX(e)}},{key:"y",get:function(){return this[1]},set:function(e){this[1]=dX(e)}},{key:"len",value:function(){return Math.sqrt(this.lengthSquared())}},{key:"magnitude",value:function(){return this.len()}},{key:"lengthSquared",value:function(){for(var e=0,t=0;t=0&&e=0&&e0&&void 0!==arguments[0]?arguments[0]:[0,0,0],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;m(this,e),this.radius=-0,this.center=new yX,this.fromCenterRadius(t,n)}return b(e,[{key:"fromCenterRadius",value:function(e,t){return this.center.from(e),this.radius=t,this}},{key:"fromCornerPoints",value:function(e,t){return t=bX.from(t),this.center=(new yX).from(e).add(t).scale(.5),this.radius=this.center.distance(t),this}},{key:"equals",value:function(e){return this===e||Boolean(e)&&this.center.equals(e.center)&&this.radius===e.radius}},{key:"clone",value:function(){return new e(this.center,this.radius)}},{key:"union",value:function(e){var t=this.center,n=this.radius,i=e.radius,r=bX.copy(e.center).subtract(t),o=r.magnitude();if(n>=o+i)return this.clone();if(i>=o+n)return e.clone();var a=.5*(n+o+i);return _X.copy(r).scale((-n+a)/o).add(t),this.center.copy(_X),this.radius=a,this}},{key:"expand",value:function(e){var t=(e=bX.from(e)).subtract(this.center).magnitude();return t>this.radius&&(this.radius=t),this}},{key:"transform",value:function(e){this.center.transform(e);var t=function(e,t){var n=t[4],i=t[5],r=t[6],o=t[8],a=t[9],s=t[10];return e[0]=Math.hypot(t[0],t[1],t[2]),e[1]=Math.hypot(n,i,r),e[2]=Math.hypot(o,a,s),e}(bX,e);return this.radius=Math.max(t[0],Math.max(t[1],t[2]))*this.radius,this}},{key:"distanceSquaredTo",value:function(e){var t=this.distanceTo(e);return t*t}},{key:"distanceTo",value:function(e){var t=(e=bX.from(e)).subtract(this.center);return Math.max(0,t.len()-this.radius)}},{key:"intersectPlane",value:function(e){var t=this.radius,n=e.normal.dot(this.center)+e.distance;return n<-t?oX.OUTSIDE:n1&&void 0!==arguments[1]?arguments[1]:new Array(this.RANK).fill(-0),n=e*this.RANK,i=0;i0&&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 GN(this,e),this.check()}},{key:"identity",value:function(){return DN(this),this.check()}},{key:"fromAxisRotation",value:function(e,t){return NN(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]=dX(e)}},{key:"y",get:function(){return this[1]},set:function(e){this[1]=dX(e)}},{key:"z",get:function(){return this[2]},set:function(e){this[2]=dX(e)}},{key:"w",get:function(){return this[3]},set:function(e){this[3]=dX(e)}},{key:"len",value:function(){return KN(this)}},{key:"lengthSquared",value:function(){return $N(this)}},{key:"dot",value:function(e,t){if(void 0!==t)throw new Error("Quaternion.dot only takes one argument");return XN(this,e)}},{key:"rotationTo",value:function(e,t){return QN(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 WN(this,this,e),this.check()}},{key:"calculateW",value:function(){return VN(this,this),this.check()}},{key:"conjugate",value:function(){return HN(this,this),this.check()}},{key:"invert",value:function(){return UN(this,this),this.check()}},{key:"lerp",value:function(e,t,n){return YN(this,e,t,n),this.check()}},{key:"multiplyRight",value:function(e,t){return lX(!t),LN(this,this,e),this.check()}},{key:"multiplyLeft",value:function(e,t){return lX(!t),LN(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 jN(this,this,e),this.check()}},{key:"rotateY",value:function(e){return FN(this,this,e),this.check()}},{key:"rotateZ",value:function(e){return BN(this,this,e),this.check()}},{key:"scale",value:function(e){return qN(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?TX:a,n=o.target,i=o.ratio;break;case 2:n=(r=t(arguments,2))[0],i=r[1],e=this}return zN(this,e,n,i),this.check()}},{key:"transformVector4",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;return DO(t,e,this),fX(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}(hX),AX=new yX,MX=new yX,IX=new yX,RX=new yX,DX=new yX,NX=new yX,LX=new yX,jX=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[0,0,0],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0,0,0,0,0,0,0];m(this,e),this.center=(new yX).from(t),this.halfAxes=new OX(n)}return b(e,[{key:"halfSize",get:function(){var e=this.halfAxes.getColumn(0),t=this.halfAxes.getColumn(1),n=this.halfAxes.getColumn(2);return[new yX(e).len(),new yX(t).len(),new yX(n).len()]}},{key:"quaternion",get:function(){var e=this.halfAxes.getColumn(0),t=this.halfAxes.getColumn(1),n=this.halfAxes.getColumn(2),i=new yX(e).normalize(),r=new yX(t).normalize(),o=new yX(n).normalize();return(new PX).fromMatrix3(new OX([].concat(v(i),v(r),v(o))))}},{key:"fromCenterHalfSizeQuaternion",value:function(e,t,n){var i=new PX(n),r=(new OX).fromQuaternion(i);return r[0]=r[0]*t[0],r[1]=r[1]*t[0],r[2]=r[2]*t[0],r[3]=r[3]*t[1],r[4]=r[4]*t[1],r[5]=r[5]*t[1],r[6]=r[6]*t[2],r[7]=r[7]*t[2],r[8]=r[8]*t[2],this.center=(new yX).from(e),this.halfAxes=r,this}},{key:"clone",value:function(){return new e(this.center,this.halfAxes)}},{key:"equals",value:function(e){return this===e||Boolean(e)&&this.center.equals(e.center)&&this.halfAxes.equals(e.halfAxes)}},{key:"getBoundingSphere",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new wX,t=this.halfAxes,n=t.getColumn(0,IX),i=t.getColumn(1,RX),r=t.getColumn(2,DX),o=AX.copy(n).add(i).add(r);return e.center.copy(this.center),e.radius=o.magnitude(),e}},{key:"intersectPlane",value:function(e){var t=this.center,n=e.normal,i=this.halfAxes,r=n.x,o=n.y,a=n.z,s=Math.abs(r*i[0]+o*i[1]+a*i[2])+Math.abs(r*i[3]+o*i[4]+a*i[5])+Math.abs(r*i[6]+o*i[7]+a*i[8]),u=n.dot(t)+e.distance;return u<=-s?oX.OUTSIDE:u>=s?oX.INSIDE:oX.INTERSECTING}},{key:"distanceTo",value:function(e){return Math.sqrt(this.distanceSquaredTo(e))}},{key:"distanceSquaredTo",value:function(e){var t=MX.from(e).subtract(this.center),n=this.halfAxes,i=n.getColumn(0,IX),r=n.getColumn(1,RX),o=n.getColumn(2,DX),a=i.magnitude(),s=r.magnitude(),u=o.magnitude();i.normalize(),r.normalize(),o.normalize();var c,l=0;return(c=Math.abs(t.dot(i))-a)>0&&(l+=c*c),(c=Math.abs(t.dot(r))-s)>0&&(l+=c*c),(c=Math.abs(t.dot(o))-u)>0&&(l+=c*c),l}},{key:"computePlaneDistances",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[-0,-0],i=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY,o=this.center,a=this.halfAxes,s=a.getColumn(0,IX),u=a.getColumn(1,RX),c=a.getColumn(2,DX),l=NX.copy(s).add(u).add(c).add(o),h=LX.copy(l).subtract(e),d=t.dot(h);return i=Math.min(d,i),r=Math.max(d,r),l.copy(o).add(s).add(u).subtract(c),h.copy(l).subtract(e),d=t.dot(h),i=Math.min(d,i),r=Math.max(d,r),l.copy(o).add(s).subtract(u).add(c),h.copy(l).subtract(e),d=t.dot(h),i=Math.min(d,i),r=Math.max(d,r),l.copy(o).add(s).subtract(u).subtract(c),h.copy(l).subtract(e),d=t.dot(h),i=Math.min(d,i),r=Math.max(d,r),o.copy(l).subtract(s).add(u).add(c),h.copy(l).subtract(e),d=t.dot(h),i=Math.min(d,i),r=Math.max(d,r),o.copy(l).subtract(s).add(u).subtract(c),h.copy(l).subtract(e),d=t.dot(h),i=Math.min(d,i),r=Math.max(d,r),o.copy(l).subtract(s).subtract(u).add(c),h.copy(l).subtract(e),d=t.dot(h),i=Math.min(d,i),r=Math.max(d,r),o.copy(l).subtract(s).subtract(u).subtract(c),h.copy(l).subtract(e),d=t.dot(h),i=Math.min(d,i),r=Math.max(d,r),n[0]=i,n[1]=r,n}},{key:"transform",value:function(e){this.center.transformAsPoint(e);var t=this.halfAxes.getColumn(0,IX);t.transformAsPoint(e);var n=this.halfAxes.getColumn(1,RX);n.transformAsPoint(e);var i=this.halfAxes.getColumn(2,DX);return i.transformAsPoint(e),this.halfAxes=new OX([].concat(v(t),v(n),v(i))),this}},{key:"getTransform",value:function(){throw new Error("not implemented")}}]),e}(),FX=new yX,BX=new yX,VX=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[0,0,1],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;m(this,e),this.normal=new yX,this.distance=-0,this.fromNormalDistance(t,n)}return b(e,[{key:"fromNormalDistance",value:function(e,t){return lX(Number.isFinite(t)),this.normal.from(e).normalize(),this.distance=t,this}},{key:"fromPointNormal",value:function(e,t){e=FX.from(e),this.normal.from(t).normalize();var n=-this.normal.dot(e);return this.distance=n,this}},{key:"fromCoefficients",value:function(e,t,n,i){return this.normal.set(e,t,n),lX(cX(this.normal.len(),1)),this.distance=i,this}},{key:"clone",value:function(t){return new e(this.normal,this.distance)}},{key:"equals",value:function(e){return cX(this.distance,e.distance)&&cX(this.normal,e.normal)}},{key:"getPointDistance",value:function(e){return this.normal.dot(e)+this.distance}},{key:"transform",value:function(e){var t=BX.copy(this.normal).transformAsVector(e).normalize(),n=this.normal.scale(-this.distance).transform(e);return this.fromPointNormal(n,t)}},{key:"projectPointOntoPlane",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];e=FX.from(e);var n=this.getPointDistance(e),i=BX.copy(this.normal).scale(n);return e.subtract(i).to(t)}}]),e}();function zX(e,n,i){var r,o,a,s,u,c,l,h,d;return regeneratorRuntime.wrap(function(f){for(;;)switch(f.prev=f.next){case 0:r=0,o=Object.entries(i);case 1:if(!(r0){r.reverse();var o,a="",s=_(r);try{for(s.s();!(o=s.n()).done;){var u=o.value;a&&iY(i,nY(n,this.graph.getEdgeAttribute(u,a,"id"))),a=u}}catch(c){s.e(c)}finally{s.f()}return i}}}},{key:"getSpatialPlacement",value:function(e,t){var n,i=this.graph.hasNode(e["@id"])?e["@id"]:void 0,r=(0,$q.get)(e,"placement[0]",(0,$q.get)(e,"placement",void 0));if(r&&this.graph.hasNode(r.target)?(n=this.getTransformationMatrix(r.target,t))&&(n=iY(n,r)):i&&(n=this.getTransformationMatrix(i,t)),n){var o=(new qq).fromRotationMatrix(n,qq.XYZ),a=n.getTranslation().map(function(e){return 1e3*e}),s=o.toVector3().map(lS),u=n.getScale().map(function(e){return e<1&&e>.999999?1:e});return{"@context":"https://hubmapconsortium.github.io/hubmap-ontology/ccf-context.jsonld","@id":"http://purl.org/ccf/1.5/".concat(iX(),"_placement"),"@type":"SpatialPlacement",source:e["@id"],target:t,placement_date:(new Date).toISOString().split("T")[0],x_scaling:u[0],y_scaling:u[1],z_scaling:u[2],scaling_units:"ratio",x_rotation:s[0],y_rotation:s[1],z_rotation:s[2],rotation_order:"XYZ",rotation_units:"degree",x_translation:a[0],y_translation:a[1],z_translation:a[2],translation_units:"millimeter"}}}}]),e}(),oY=function(){function e(t){m(this,e),this.db=t}return b(e,[{key:"getSpatialEntity",value:function(e){return tY(this.db.store,e)}},{key:"getExtractionSets",value:function(e){return function(e,t){return(0,$q.sortBy)(e.getSubjects(XX.spatialEntity.extraction_set_for,t,null).map(function(t){return eY(e,t.id)}),["rui_rank"])}(this.db.store,e)}},{key:"getExtractionSet",value:function(e){return eY(this.db.store,e)}},{key:"getAnatomicalStructures",value:function(e){return function(e,t){return(0,$q.sortBy)(e.getSubjects(XX.spatialEntity.reference_organ,t,null).map(function(t){return tY(e,t.id)}).filter(function(e){return e["@id"]!==t}),["rui_rank"])}(this.db.store,e)}},{key:"getReferenceOrgans",value:function(){return function(e){var t=[];return e.forEach(function(n){n.subject.id===n.object.id&&t.push(tY(e,n.subject.id))},null,XX.spatialEntity.reference_organ,null,null),(0,$q.sortBy)(t,["rui_rank"])}(this.db.store)}},{key:"getReferenceBody",value:function(e){var t;switch(null==e?void 0:e.sex){case"Male":t=XX.spatial.Male.id;break;case"Female":t=XX.spatial.Female.id;break;case"Both":default:t=XX.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=[],r=v(this.getReferenceOrganSets(e).map(function(e){var r="http://purl.obolibrary.org/obo/UBERON_0002097"===e.representation_of,o=t.getSceneNode(e,n,{color:[255,255,255,255],opacity:r?.5:.2,unpickable:!0,_lighting:"pbr",zoomBasedOpacity:!r});return r&&o?void i.push(o):o}));return i.length>0&&(r=[].concat(i,v(r))),(null==e?void 0:e.debug)&&(r=r.concat([this.getSceneNode(this.getSpatialEntity(XX.base("VHRightKidney").id),n,{color:[0,0,255,127.5],geometry:"wireframe"}),this.getSceneNode(this.getSpatialEntity(XX.base("VHLeftKidney").id),n,{color:[255,0,0,127.5],geometry:"wireframe"}),this.getSceneNode(this.getSpatialEntity(XX.base("VHSpleenCC1").id),n,{color:[0,255,0,127.5],geometry:"wireframe"}),this.getSceneNode(this.getSpatialEntity(XX.base("VHSpleenCC2").id),n,{color:[0,255,0,127.5],geometry:"wireframe"}),this.getSceneNode(this.getSpatialEntity(XX.base("VHSpleenCC3").id),n,{color:[0,255,0,127.5],geometry:"wireframe"})])),r.filter(function(e){return void 0!==e})}},{key:"getReferenceOrganScene",value:function(e,t){var n,i,r=this,o=void 0!==(null==t?void 0:t.sex)&&"both"!==(null===(n=null==t?void 0:t.sex)||void 0===n?void 0:n.toLowerCase()),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 $O($O.IDENTITY).rotateX(cS(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}(),aY="https://entity.api.hubmapconsortium.org/entities/",sY=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"]),uY={"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"},cY={"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","5c106f29-ea2d-11e9-85e8-0efb3ba9a670":"RTI-General Electric","301615f9-c870-11eb-a8dc-35ce3d8786fe":"TMC-UConn"},lY={"@base":"http://purl.org/ccf/latest/ccf-entity.owl#","@vocab":"http://purl.org/ccf/latest/ccf-entity.owl#",ccf:"http://purl.org/ccf/",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"},cellTypeTerms:{"@id":"has_cell_type_term","@type":"@id"},thumbnail:{"@id":"has_thumbnail"}},hY=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,cY[t.group_uuid]||(cY[t.group_uuid]=t.group_name);var l=new Date(t.last_modified_timestamp).toLocaleDateString(),h=cY[t.group_uuid]||t.group_name,d=t.created_by_user_displayname;this["@id"]=aY+t.uuid,this.label="Registered ".concat(l,", ").concat(d,", ").concat(h),this.link="".concat(o,"browse/sample/").concat(t.uuid);var f={},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);f[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 C=this.getDataset(S,r,o,a),E=(0,$q.get)(S,["ingest_metadata","metadata","tissue_id"]);f[E]?null===(i=f[E].datasets)||void 0===i||i.push(C):v.push(C)}}}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 P=parseFloat((O.slice_thickness||(O.z_dimension||0)/Math.max(this.section_count,1)).toFixed(1));this.section_size=P;var A=O.dimension_units||"millimeter";this.section_units=A,this.description="".concat(T,", ").concat(P," ").concat(A,", ").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(P," ").concat(A,", ").concat(P," ").concat(A,", ").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":aY+e.uuid,"@type":"Sample",label:"Registered ".concat(i,", ").concat(e.created_by_user_displayname,", ").concat(cY[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=cY[e.group_uuid]||e.group_name,u=e.created_by_user_displayname,c=[].concat(v(e.data_types),[(0,$q.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":aY+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,$q.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 sY.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(sY.has(o))return"assets/thumbnails/TMC-Vanderbilt/DR1/".concat(o)}}else if("07a29e4c-ed43-11e8-b56a-0e8017bdda58"===e.group_uuid){var a=uY[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,$q.toNumber)(a[1]));var s,u=_((0,$q.get)(e,"metadata.organ_donor_data",(0,$q.get)(e,"metadata.living_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,$q.toNumber)(c.data_value):"Body mass index"===c.preferred_term&&(o=(0,$q.toNumber)(c.data_value))}}catch(f){u.e(f)}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(),d=cY[e.group_uuid]||e.group_name;return{"@id":aY+e.uuid,"@type":"Donor",label:l,description:"Entered ".concat(h,", ").concat(e.created_by_user_displayname,", ").concat(d),link:"".concat(t,"browse/donor/").concat(e.uuid),age:r,sex:n,bmi:o,consortium_name:"HuBMAP",provider_name:d,provider_uuid:e.group_uuid,samples:[]}}},{key:"getRuiLocation",value:function(e,t){var n,i,r=e.rui_location;if(r&&("string"==typeof r&&(r=JSON.parse(r)),r.alignment_id?console.log("Detected a deprecated rui_location",e.uuid):r["@id"]&&(i=r)),i){var o=null!==(n=(0,$q.get)(i,["placement","target"]))&&void 0!==n?n:"";o.startsWith("http://purl.org/ccf/latest/ccf.owl#VHSpleenCC")?(0,$q.set)(i,["placement","target"],o.replace("#VHSpleenCC","Male"===t.sex?"#VHMSpleenCC":"#VHFSpleenCC")):("http://purl.org/ccf/latest/ccf.owl#VHLeftKidney"===o||"http://purl.org/ccf/latest/ccf.owl#VHRightKidney"===o)&&(0,$q.set)(i,["placement","target"],"Male"===t.sex?o.replace("#VH","#VHM")+"_Patch":o.replace("#VH","#VHF")+"_Patch")}return i}},{key:"getTissueBlock",value:function(){return(0,$q.omit)(Object.assign({},this),["data","bad","donor"])}},{key:"toJsonLd",value:function(){return Object.assign(Object.assign({},this.donor),{samples:[this.getTissueBlock()]})}}]),e}(),dY=["uuid","entity_type","group_uuid","group_name","last_modified_timestamp","created_by_user_displayname","ancestors.entity_type","ancestors.description","ancestors.metadata.organ_donor_data.preferred_term","ancestors.metadata.organ_donor_data.data_value","ancestors.metadata.living_donor_data.preferred_term","ancestors.metadata.living_donor_data.data_value","ancestors.last_modified_timestamp","ancestors.group_uuid","ancestors.group_name","ancestors.created_by_user_displayname","ancestors.uuid","descendants.entity_type","descendants.ingest_metadata.metadata.tissue_id","descendants.last_modified_timestamp","descendants.group_uuid","descendants.group_name","descendants.created_by_user_displayname","descendants.uuid","descendants.data_types","descendants.ingest_metadata.metadata.assay_type","descendants.thumbnail_file","descendants.metadata.files.rel_path","rui_location","specimen_type"],fY={exists:{field:"rui_location"}};function pY(e,t,n){return JSON.stringify({version:!0,from:e,size:t,stored_fields:["*"],script_fields:{},docvalue_fields:[],query:null!=n?n:fY,_source:{includes:dY}})}function vY(e,t){return Dw(this,void 0,void 0,regeneratorRuntime.mark(function n(){var i;return regeneratorRuntime.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,fetch(e,t);case 3:if(!(i=n.sent).ok){n.next=10;break}return n.next=7,i.json();case 7:n.t0=n.sent,n.next=11;break;case 10:n.t0=void 0;case 11:return n.abrupt("return",n.t0);case 14:return n.prev=14,n.t1=n.catch(0),n.abrupt("return");case 17:case"end":return n.stop()}},n,null,[[0,14]])}))}function gY(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 Dw(this,void 0,void 0,regeneratorRuntime.mark(function a(){var s;return regeneratorRuntime.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:if("static"!==t){a.next=6;break}return a.next=3,vY(e);case 3:s=a.sent,a.next=11;break;case 6:if(a.t0="search-api"===t,!a.t0){a.next=11;break}return a.next=10,function(e,t,n){return Dw(this,void 0,void 0,regeneratorRuntime.mark(function i(){var r,o,a,s,u,c,l,h,d,f;return regeneratorRuntime.wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return o=250,a=function(e){var t=new Headers;return t.append("Content-type","application/json"),e&&t.append("Authorization","Bearer ".concat(e)),t}(t),s=pY(0,o,n),i.next=5,vY(e,{method:"POST",headers:a,body:s});case 5:if(u=i.sent){i.next=8;break}return i.abrupt("return");case 8:if(!((c=u.hits.total.value)<=o)){i.next=11;break}return i.abrupt("return",u);case 11:for(l=[],h=o;h1&&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,$q.get)(e,"hits.hits",[]).map(function(e){return(0,$q.get)(e,"_source",{})}).sort(function(e,t){return e.uuid.localeCompare(t.uuid)}).map(function(e){return new hY(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(d){u.e(d)}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(d){o.e(d)}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":lY},e)}))),{"@context":lY,"@graph":h}}(s,r,o,i));case 13:console.warn("Unable to load ".concat(e," as HuBMAP Data"));case 14:case"end":return a.stop()}},a)}))}function mY(e,t,n){var i,r=new Set,o=_(t);try{for(o.s();!(i=o.n()).done;){var a,s=i.value,u=_((0,Hq.readQuads)(e,s,n,null,null));try{for(u.s();!(a=u.n()).done;){var c=a.value;r.add(c.object.id)}}catch(l){u.e(l)}finally{u.f()}}}catch(l){o.e(l)}finally{o.f()}return r}var yY=(o(x={},XX.spatialEntity.x_dimension.id,"x"),o(x,XX.spatialEntity.y_dimension.id,"y"),o(x,XX.spatialEntity.z_dimension.id,"z"),x);function bY(e,t,n,i){var r,o=t.getTransformationMatrix(n,i);if(o){var a=o.getTranslation(),s=function(e,t){var n=UX(e,t,"Dimensions",yY);return[n.x,n.y,n.z]}(e,n).map(function(e){return e/1e3/2}),u=(new qq).fromRotationMatrix(o,qq.XYZ).toQuaternion().normalize().calculateW();r=(new jX).fromCenterHalfSizeQuaternion(a,s,u)}return r}function _Y(e,t,n,i){var r,o=i.x,a=i.y,s=i.z,u=i.radius,c=i.target,l=new Set,h=u/1e3*(u/1e3),d=_(n);try{for(d.s();!(r=d.n()).done;){var f=r.value,p=bY(e,t,f,c);p&&p.distanceSquaredTo([o,a,s].map(function(e){return e/1e3}))<=h&&l.add(f)}}catch(v){d.e(v)}finally{d.f()}return l}function wY(e,t,n){var i,r,o,a=new Map,s=new Set,u=_(t);try{for(u.s();!(o=u.n()).done;){var c,l=o.value,h=_((0,Hq.readQuads)(e,l,qX.donor,null,null));try{for(h.s();!(c=h.n()).done;){var d=c.value;s.add(d.object.id),a.has(d.object.id)?null===(i=a.get(d.object.id))||void 0===i||i.push(l):a.set(d.object.id,[l])}}catch(k){h.e(k)}finally{h.f()}}}catch(k){u.e(k)}finally{u.f()}var f,p=n(s),v=new Set,g=_(p);try{for(g.s();!(f=g.n()).done;){var m,y=f.value,b=_(null!==(r=a.get(y))&&void 0!==r?r:[]);try{for(b.s();!(m=b.n()).done;){var w=m.value;v.add(w)}}catch(k){b.e(k)}finally{b.f()}}}catch(k){g.e(k)}finally{g.f()}return v}function kY(e,t,n){var i,r,o,a=new Map,s=new Set,u=_(t);try{for(u.s();!(o=u.n()).done;){var c,l=o.value,h=_((0,Hq.readQuads)(e,l,qX.spatialEntity,null,null));try{for(h.s();!(c=h.n()).done;){var d=c.value;s.add(d.object.id),a.has(d.object.id)?null===(i=a.get(d.object.id))||void 0===i||i.push(l):a.set(d.object.id,[l])}}catch(k){h.e(k)}finally{h.f()}}}catch(k){u.e(k)}finally{u.f()}var f,p=n(s),v=new Set,g=_(p);try{for(g.s();!(f=g.n()).done;){var m,y=f.value,b=_(null!==(r=a.get(y))&&void 0!==r?r:[]);try{for(b.s();!(m=b.n()).done;){var w=m.value;v.add(w)}}catch(k){b.e(k)}finally{b.f()}}}catch(k){g.e(k)}finally{g.f()}return v}function xY(e,t){return function(n){e.has(n.id)&&t.add(n.id)}}function SY(e,t,n){var i,r=new Set,o=_(n);try{for(o.s();!(i=o.n()).done;){var a=i.value,s=Hq.DataFactory.namedNode(a);e.forSubjects(xY(t,r),XX.spatialEntity.ccf_annotations,s,null)}}catch(u){o.e(u)}finally{o.f()}return r}function CY(e,t){var n,i=function(e,t){var n,i=new Map,r=_(e);try{for(r.s();!(n=r.n()).done;){var o,a=n.value,s=_((0,Hq.readQuads)(t,a,qX.spatialEntity,null,null));try{for(s.s();!(o=s.n()).done;){var u=o.value;i.has(u.object.id)?i.get(u.object.id).add(a):i.set(u.object.id,new Set([a]))}}catch(c){s.e(c)}finally{s.f()}}}catch(c){r.e(c)}finally{r.f()}return i}(e,t),r=new Map,o=_(i.keys());try{for(o.s();!(n=o.n()).done;){var a,s=n.value,u=i.get(s),c=_((0,Hq.readQuads)(t,s,XX.spatialEntity.ccf_annotations,null,null));try{for(c.s();!(a=c.n()).done;){var l=a.value;r.has(l.object.id)?function(){var e=r.get(l.object.id);u.forEach(function(t){return e.add(t)})}():r.set(l.object.id,new Set(u))}}catch(h){c.e(h)}finally{c.f()}}}catch(h){o.e(h)}finally{o.f()}return r}function EY(e,n,i){var r,a,s={"@id":n,"@type":"OntologyTreeNode",id:n,parent:"",children:[],synonymLabels:[],label:""},u=_(zX(e,n,(o(r={},XX.ontologyNode.label.id,"label"),o(r,i,"parent"),o(r,XX.ontologyNode.synonymLabels.id,"synonymLabels"),r)));try{for(u.s();!(a=u.n()).done;){var c=t(a.value,2),l=c[0],h=c[1];"synonymLabels"===l?s.synonymLabels.push(h):s[l]=h}}catch(d){u.e(d)}finally{u.f()}return s.children=e.getSubjects(i,n,null).map(function(e){return e.id}),s}function OY(e,t,n,i){var r,o={root:t,nodes:{}},a=new Set,s=_((0,Hq.readQuads)(e,null,i,null,null));try{for(s.s();!(r=s.n()).done;){var u=r.value;a.add(u.subject.id),a.add(u.object.id)}}catch(f){s.e(f)}finally{s.f()}var c,l=_(a);try{for(l.s();!(c=l.n()).done;){var h=c.value;o.nodes[h]=EY(e,h,i)}}catch(f){l.e(f)}finally{l.f()}o.nodes[t]||(o.nodes[t]={"@id":t,"@type":"OntologyTreeNode",id:t,label:n,children:[],synonymLabels:[]});var d=e.getSubjects(i,t,null).map(function(e){return e.id}).sort(function(e,t){return o.nodes[e].label.localeCompare(o.nodes[t].label)});return o.nodes[t].children=d,TY(o),o}function TY(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Set,i=e.nodes[null!=t?t:e.root];if(i){i.children=i.children.filter(function(e){return!n.has(e)}),i.children.forEach(function(e){return n.add(e)});var r,o=_(i.children);try{for(o.s();!(r=o.n()).done;){var a=r.value;TY(e,a,n),e.nodes[a]&&(e.nodes[a].parent=i["@id"])}}catch(s){o.e(s)}finally{o.f()}}}var PY=(0,$q.memoize)(function(e){var t=OY(e,QX.body.id,"body",XX.asctb.part_of.id);return t.nodes[QX.body.id].children=["http://purl.obolibrary.org/obo/UBERON_0000955","http://purl.obolibrary.org/obo/UBERON_0000029","http://purl.obolibrary.org/obo/UBERON_0000970","http://purl.obolibrary.org/obo/UBERON_0003889","http://purl.obolibrary.org/obo/UBERON_0000948","http://purl.obolibrary.org/obo/UBERON_0002113","http://purl.obolibrary.org/obo/UBERON_0001465","http://purl.obolibrary.org/obo/UBERON_0002107","http://purl.obolibrary.org/obo/UBERON_0002048","http://purl.obolibrary.org/obo/UBERON_0001911","http://purl.obolibrary.org/obo/UBERON_0000992","http://purl.obolibrary.org/obo/UBERON_0001264","http://purl.obolibrary.org/obo/UBERON_0001270","http://purl.obolibrary.org/obo/UBERON_0001987","http://purl.obolibrary.org/obo/UBERON_0002367","http://purl.obolibrary.org/obo/UBERON_0002097","http://purl.obolibrary.org/obo/UBERON_0002108","http://purl.obolibrary.org/obo/UBERON_0002240","http://purl.obolibrary.org/obo/UBERON_0000059","http://purl.obolibrary.org/obo/UBERON_0002106","http://purl.obolibrary.org/obo/UBERON_0002370","http://purl.obolibrary.org/obo/UBERON_0000056","http://purl.obolibrary.org/obo/UBERON_0001255","http://purl.obolibrary.org/obo/UBERON_0000995","http://purl.obolibrary.org/obo/UBERON_0004537"].filter(function(e){return e in t.nodes}),t},function(){return""}),AY=(o(S={},qX.label.id,"label"),o(S,qX.description.id,"description"),o(S,qX.link.id,"link"),S),MY=Object.assign(Object.assign({},AY),o({},qX.providerName.id,"providerName")),IY=Object.assign(Object.assign({},AY),(o(C={},qX.technology.id,"technology"),o(C,qX.thumbnail.id,"thumbnail"),C)),RY=Object.assign(Object.assign({},AY),(o(E={},qX.sampleType.id,"sampleType"),o(E,qX.sectionNumber.id,"sectionNumber"),o(E,qX.datasets.id,"datasets"),E)),DY=Object.assign(Object.assign({},AY),(o(O={},qX.sampleType.id,"sampleType"),o(O,qX.sectionCount.id,"sectionCount"),o(O,qX.sectionSize.id,"sectionSize"),o(O,qX.sectionUnits.id,"sectionUnits"),o(O,qX.donor.id,"donor"),o(O,qX.spatialEntity.id,"spatialEntityId"),o(O,qX.sections.id,"sections"),o(O,qX.datasets.id,"datasets"),O));function NY(e,t){return UX(e,t,"Donor",MY)}function LY(e,t){return UX(e,t,"Dataset",IY)}function jY(e,n){var i,r={"@id":n,"@type":"Sample",datasets:[]},o=_(zX(e,n,RY));try{for(o.s();!(i=o.n()).done;){var a=t(i.value,2),s=a[0],u=a[1];if("datasets"===s){var c=LY(e,u);r[s].push(c)}else r[s]=u}}catch(l){o.e(l)}finally{o.f()}return r}var FY=function(){function e(t){m(this,e),this.database=t,this.connect()}return b(e,[{key:"toJson",value:function(){return{status:this.status,message:this.message,checkback:"Ready"===this.status||"Error"===this.status?36e5:2e3,loadTime:this.loadTime}}},{key:"connect",value:function(){var e=this;this.status="Loading",this.message="Loading database";var t=Date.now();return this.database.connect().then(function(t){return Dw(e,void 0,void 0,regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!t){e.next=14;break}return this.message="Building scene",e.next=4,this.database.getScene();case 4:return this.message="Building tissue block results",e.next=7,this.database.getTissueBlockResults();case 7:return this.message="Aggregating results",e.next=10,this.database.getAggregateResults();case 10:this.status="Ready",this.message="Database successfully loaded",e.next=15;break;case 14:this.status="Error",this.message="Unknown error while loading database";case 15:case"end":return e.stop()}},e,this)}))}).catch(function(t){var n;e.status="Error",e.message=null!==(n=null==t?void 0:t.message)&&void 0!==n?n:"Unknown error while loading database"}).finally(function(){e.loadTime=Date.now()-t})}}]),e}(),BY={"@context":{"@base":"http://purl.org/ccf/","@vocab":"http://purl.org/ccf/",ccf:"http://purl.org/ccf/",rdfs:"http://www.w3.org/2000/01/rdf-schema#",dcterms:"http://purl.org/dc/terms/",label:"rdfs:label",description:"rdfs:comment",link:"ccf:url",sex:"ccf:sex",age:"ccf:age",bmi:"ccf:bmi",consortium_name:"ccf:consortium_name",provider_name:"ccf:tissue_provider_name",provider_uuid:"ccf:tissue_provider_uuid",donor:{"@id":"ccf:comes_from","@type":"@id"},samples:{"@reverse":"donor"},sections:{"@id":"ccf:subdivided_into_sections","@type":"@id"},datasets:{"@id":"ccf:generates_dataset","@type":"@id"},sample_type:"ccf:sample_type",section_count:"ccf:section_count",section_size:"ccf:section_size",section_units:"ccf:section_size_unit",section_number:"ccf:section_number",rui_location:{"@id":"ccf:has_registration_location","@type":"@id"},ccf_annotations:{"@id":"ccf:collides_with","@type":"@id","@container":"@set"},representation_of:{"@id":"ccf:representation_of","@type":"@id"},reference_organ:{"@id":"ccf:has_reference_organ","@type":"@id"},extraction_set_for:{"@id":"ccf:extraction_set_for","@type":"@id"},extraction_set:{"@id":"ccf:has_extraction_set","@type":"@id"},organ_owner_sex:"ccf:organ_owner_sex",side:"ccf:organ_side",rui_rank:"ccf:rui_rank",slice_thickness:"ccf:slice_thickness",slice_count:"ccf:slice_count",object:{"@id":"ccf:has_object_reference","@type":"@id"},creation_date:"dcterms:created",updated_date:"ccf:updated_date",creator:"dcterms:creator",creator_first_name:"ccf:creator_first_name",creator_last_name:"ccf:creator_last_name",placement:{"@reverse":"ccf:placement_for"},placement_date:"dcterms:created",rotation_order:"ccf:rotation_order",dimension_units:"ccf:dimension_unit",rotation_units:"ccf:rotation_unit",scaling_units:"ccf:scaling_unit",translation_units:"ccf:translation_unit",source:{"@id":"ccf:placement_for","@type":"@id"},target:{"@id":"ccf:placement_relative_to","@type":"@id"},x_rotation:"ccf:x_rotation",y_rotation:"ccf:y_rotation",z_rotation:"ccf:z_rotation",x_scaling:"ccf:x_scaling",y_scaling:"ccf:y_scaling",z_scaling:"ccf:z_scaling",x_translation:"ccf:x_translation",y_translation:"ccf:y_translation",z_translation:"ccf:z_translation",x_dimension:"ccf:x_dimension",y_dimension:"ccf:y_dimension",z_dimension:"ccf:z_dimension",ontology_terms:{"@id":"ccf:has_ontology_term","@type":"@id"},technology:"ccf:technology",thumbnail:"ccf:thumbnail",file:"ccf:file_url",file_format:"ccf:file_format",file_subpath:"ccf:file_subpath"}};function VY(e){return JSON.parse(e,function(e,t){return"ccf_annotations"===e&&Array.isArray(t)?t.map(function(e){return(null==e?void 0:e.startsWith("http://purl.obolibrary.org/obo/FMA_"))?e.replace("http://purl.obolibrary.org/obo/FMA_","http://purl.org/sig/ont/fma/fma"):e}):"@context"!==e||!t||"https://hubmapconsortium.github.io/hubmap-ontology/ccf-entity-context.jsonld"!==t&&"https://hubmapconsortium.github.io/hubmap-ontology/ccf-context.jsonld"!==t&&"https://hubmapconsortium.github.io/ccf-ontology/ccf-context.jsonld"!==t&&"http://purl.org/ccf/latest/ccf-entity.owl#"!==t["@base"]?t:BY})}var zY={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"},UY=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:zY;m(this,e),this.options=t,this.store=new Hq.Store(void 0,{factory:Hq.DataFactory}),this.graph=new rY(this),this.scene=new oY(this)}return b(e,[{key:"connect",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Dw(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 Dw(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,zq(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]:Vq();return t("readwrite",function(t){return e.forEach(function(e){return t.delete(e)}),Bq(t.transaction)})}([i,n]).catch(function(){});case 9:e.next=14;break;case 11:return e.next=13,zq(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]:Vq();return t("readwrite",function(t){return e.forEach(function(e){return t.put(e[1],e[0])}),Bq(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 Dw(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).startsWith("{")){n.next=5;break}this.store=(0,Hq.deserializeN3Store)(o,Hq.DataFactory),n.next=13;break;case 5:if(!o.endsWith(".n3store.json")){n.next=12;break}return n.next=8,fetch(o).then(function(e){return e.text()}).catch(function(){return console.log("Couldn't locate serialized store.")});case 8:(a=n.sent)&&(this.store=(0,Hq.deserializeN3Store)(a,Hq.DataFactory)),n.next=13;break;case 12:(null==o?void 0:o.length)>0&&r.push(o);case 13:return this.options.hubmapDataUrl&&(this.options.hubmapDataUrl.endsWith("jsonld")?r.push(this.options.hubmapDataUrl):i.push(gY(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=17,Promise.all(i);case 17:return n.next=19,this.synchronize();case 19:case"end":return n.stop()}},n,this)}))}},{key:"addDataSources",value:function(e,t){return Dw(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 Dw(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=26;break}if(!e.startsWith("http")&&!e.startsWith("assets/")||!e.includes("jsonld")){t.next=11;break}return t.t0=VY,t.next=5,fetch(e).then(function(e){return e.text()});case 5:return t.t1=e=t.sent,e=(0,t.t0)(t.t1),t.next=9,(0,Hq.addJsonLdToStore)(e,i);case 9:t.next=24;break;case 11:if(!e.endsWith("n3")){t.next=16;break}return t.next=14,(0,Hq.addN3ToStore)(e,i);case 14:t.next=24;break;case 16:if(!(e.endsWith("rdf")||e.endsWith("owl")||e.endsWith("xml"))){t.next=21;break}return t.next=19,(0,Hq.addRdfXmlToStore)(e,i);case 19:t.next=24;break;case 21:return e=VY(e),t.next=24,(0,Hq.addJsonLdToStore)(e,i);case 24:t.next=29;break;case 26:return e=VY(JSON.stringify(e)),t.next=29,(0,Hq.addJsonLdToStore)(e,i);case 29: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 Dw(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(),function(e){var t,n,i,r,o=PY(e),a=new Map,s=_((0,Hq.readQuads)(e,null,XX.spatialEntity.representation_of,null,null));try{for(s.s();!(r=s.n()).done;){for(var u=r.value,c=u.subject,l=u.object,h=new Set([l.id]),d=null===(t=o.nodes[l.id])||void 0===t?void 0:t.parent;d&&!h.has(d);)h.add(d),d=null===(n=o.nodes[d])||void 0===n?void 0:n.parent;a.set(c.id,v(h).map(function(e){return Hq.DataFactory.namedNode(e)}))}}catch(O){s.e(O)}finally{s.f()}var f,p=_((0,Hq.readQuads)(e,null,qX.spatialEntity,null,null));try{for(p.s();!(f=p.n()).done;){var g,m=f.value.object,y=_((0,Hq.readQuads)(e,null,XX.spatialPlacement.source,m,null));try{for(y.s();!(g=y.n()).done;){var b,w=g.value.subject,k=_((0,Hq.readQuads)(e,w,XX.spatialPlacement.target,null,null));try{for(k.s();!(b=k.n()).done;){var x,S=b.value.object,C=_(null!==(i=a.get(S.id))&&void 0!==i?i:[]);try{for(C.s();!(x=C.n()).done;){var E=x.value;e.addQuad(Hq.DataFactory.namedNode(m.id),XX.spatialEntity.ccf_annotations,E)}}catch(O){C.e(O)}finally{C.f()}}}catch(O){k.e(O)}finally{k.f()}}}catch(O){y.e(O)}finally{y.f()}}}catch(O){p.e(O)}finally{p.f()}}(this.store),e.abrupt("return",this);case 5:case"end":return e.stop()}},e,this)}))}},{key:"serialize",value:function(){return(0,Hq.serializeN3Store)(this.store)}},{key:"deserialize",value:function(e){return Dw(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,Hq.deserializeN3Store)(e,Hq.DataFactory),this.graph=new rY(this),this.scene=new oY(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,n){var i,r,o,a,s,u,c,l=function(e){var t=new Set;return e.forSubjects(function(e){return t.add(e.id)},qX.spatialEntity,null,null),t}(e);if(l.size>0&&(l=function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=new Set;if(e.forSubjects(xY(t,i),qX.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,l)),l.size>0&&("Male"===n.sex||"Female"===n.sex)){var h=n.sex;l=wY(e,l,function(t){return function(e,t,n){var i=new Set;return e.forSubjects(xY(t,i),qX.sex,qX[n],null),i}(e,t,h)})}if(l.size>0&&(null===(i=n.tmc)||void 0===i?void 0:i.length)>0&&(l=wY(e,l,function(t){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=Hq.DataFactory.literal(a);e.forSubjects(xY(t,r),qX.providerName,s,null)}}catch(u){o.e(u)}finally{o.f()}return r}(e,t,n.tmc)})),l.size>0&&(null===(r=n.technologies)||void 0===r?void 0:r.length)>0&&(l=function(e,t,n){var i,r,o,a=new Map,s=new Set,u=new Set(t),c=_(t);try{for(c.s();!(o=c.n()).done;){var l,h=o.value,d=_((0,Hq.readQuads)(e,h,qX.sections,null,null));try{for(d.s();!(l=d.n()).done;){var f=l.value;u.add(f.object.id)}}catch(P){d.e(P)}finally{d.f()}}}catch(P){c.e(P)}finally{c.f()}var p,v=_(u);try{for(v.s();!(p=v.n()).done;){var g,m=p.value,y=_((0,Hq.readQuads)(e,m,qX.datasets,null,null));try{for(y.s();!(g=y.n()).done;){var b=g.value;s.add(b.object.id),a.has(b.object.id)?null===(i=a.get(b.object.id))||void 0===i||i.push(m):a.set(b.object.id,[m])}}catch(P){y.e(P)}finally{y.f()}}}catch(P){v.e(P)}finally{v.f()}var w,k=n(s),x=new Set,S=_(k);try{for(S.s();!(w=S.n()).done;){var C,E=w.value,O=_(null!==(r=a.get(E))&&void 0!==r?r:[]);try{for(O.s();!(C=O.n()).done;){var T=C.value;x.add(T)}}catch(P){O.e(P)}finally{O.f()}}}catch(P){S.e(P)}finally{S.f()}return x}(e,l,function(t){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=Hq.DataFactory.literal(a);e.forSubjects(xY(t,r),qX.technology,s,null)}}catch(u){o.e(u)}finally{o.f()}return r}(e,t,n.technologies)})),l.size>0&&(null===(o=n.spatialSearches)||void 0===o?void 0:o.length)>0&&(l=kY(e,l,function(i){return function(e,t,n,i){var r,o=new Set,a=_(i);try{for(a.s();!(r=a.n()).done;){_Y(e,t,n,r.value).forEach(function(e){return o.add(e)})}}catch(s){a.e(s)}finally{a.f()}return o}(e,t,i,n.spatialSearches)})),l.size>0&&(null===(a=n.ontologyTerms)||void 0===a?void 0:a.length)>0){var d=n.ontologyTerms;-1===d.indexOf(QX.body.id)&&(l=kY(e,l,function(t){return SY(e,t,d)}))}if(l.size>0&&(null===(s=n.cellTypeTerms)||void 0===s?void 0:s.length)>0){var f=n.cellTypeTerms;-1===f.indexOf(QX.cell.id)&&(l=kY(e,l,function(t){return function(e,t,n){var i,r=new Set,o=_(n);try{for(o.s();!(i=o.n()).done;){var a=i.value;e.forObjects(function(e){r.add(e.id)},a,XX.asctb.located_in,null),a===QX.cell.id&&r.add(QX.body.id)}}catch(s){o.e(s)}finally{o.f()}return SY(e,t,v(r))}(e,t,f)}))}if(l.size>0&&2===(null===(u=n.ageRange)||void 0===u?void 0:u.length)&&(0,$q.isFinite)(n.ageRange[0])&&(0,$q.isFinite)(n.ageRange[1])){var p=Math.max.apply(Math,v(n.ageRange)),g=Math.min.apply(Math,v(n.ageRange));1===g&&110===p||(l=wY(e,l,function(t){return function(e,t,n,i){var r,o=new Set,a=_(t);try{for(a.s();!(r=a.n()).done;){var s,u=r.value,c=_((0,Hq.readQuads)(e,u,qX.age,null,null));try{for(c.s();!(s=c.n()).done;){var l=s.value,h=(0,rX.fromRdf)(l.object);h>=n&&h<=i&&o.add(u)}}catch(d){c.e(d)}finally{c.f()}}}catch(d){a.e(d)}finally{a.f()}return o}(e,t,g,p)}))}if(l.size>0&&2===(null===(c=n.bmiRange)||void 0===c?void 0:c.length)&&(0,$q.isFinite)(n.bmiRange[0])&&(0,$q.isFinite)(n.bmiRange[1])){var m=Math.max.apply(Math,v(n.bmiRange)),y=Math.min.apply(Math,v(n.bmiRange));13===y&&83===m||(l=wY(e,l,function(t){return function(e,t,n,i){var r,o=new Set,a=_(t);try{for(a.s();!(r=a.n()).done;){var s,u=r.value,c=_((0,Hq.readQuads)(e,u,qX.bmi,null,null));try{for(c.s();!(s=c.n()).done;){var l=s.value,h=(0,rX.fromRdf)(l.object);h>=n&&h<=i&&o.add(u)}}catch(d){c.e(d)}finally{c.f()}}}catch(d){a.e(d)}finally{a.f()}return o}(e,t,y,m)}))}return l}(this.store,this.graph,e)}},{key:"get",value:function(e){return this.store.getQuads(Hq.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 function(e,t){var n=e.getObjects(Hq.DataFactory.namedNode(t),qX.spatialEntity,null);if(n.length>0)return tY(e,n[0].id)}(t.store,e)})}},{key:"getDatabaseStatus",value:function(){return Dw(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.status||(this.status=new FY(this)),this.status.toJson()));case 1:case"end":return e.stop()}},e,this)}))}},{key:"getDatasetTechnologyNames",value:function(){return Dw(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,n=new Set,i=_((0,Hq.readQuads)(e,null,qX.technology,null,null));try{for(i.s();!(t=i.n()).done;){var r=t.value;n.add(r.object.value)}}catch(o){i.e(o)}finally{i.f()}return Array.from(n).sort()}(this.store));case 1:case"end":return e.stop()}},e,this)}))}},{key:"getProviderNames",value:function(){return Dw(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,n=new Set,i=_((0,Hq.readQuads)(e,null,qX.providerName,null,null));try{for(i.s();!(t=i.n()).done;){var r=t.value;n.add(r.object.value)}}catch(o){i.e(o)}finally{i.f()}return Array.from(n).sort()}(this.store));case 1:case"end":return e.stop()}},e,this)}))}},{key:"getTissueBlockResults",value:function(e){return Dw(this,void 0,void 0,regeneratorRuntime.mark(function n(){var i=this;return regeneratorRuntime.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",(e=Object.assign(Object.assign({},e),{hasSpatialEntity:!0}),v(this.getIds(e)).map(function(e){return function(e,n){var i,r={"@id":n,"@type":"Sample",sections:[],datasets:[]},o=_(zX(e,n,DY));try{for(o.s();!(i=o.n()).done;){var a=t(i.value,2),s=a[0],u=a[1];if("sections"===s){var c=jY(e,u);r[s].push(c)}else if("datasets"===s){var l=LY(e,u);r[s].push(l)}else r[s]="donor"===s?NY(e,u):u}}catch(h){o.e(h)}finally{o.f()}return r}(i.store,e)})));case 1:case"end":return n.stop()}},n,this)}))}},{key:"getAggregateResults",value:function(e){return Dw(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,r=mY(n,e,qX.donor.id),o=mY(n,r,qX.providerUUID.id),a=new Set,s=_(e);try{for(s.s();!(i=s.n()).done;){var u,c=i.value,l=_((0,Hq.readQuads)(n,c,qX.spatialEntity,null,null));try{for(l.s();!(u=l.n()).done;){var h=u.value;a.add(h.subject.id)}}catch(p){l.e(p)}finally{l.f()}}}catch(p){s.e(p)}finally{s.f()}var d=mY(n,a,qX.sections.id),f=new Set([].concat(v(mY(n,a,qX.datasets.id)),v(mY(n,d,qX.datasets.id))));return Object.entries({"Tissue Data Providers":o.size,Donors:r.size,"Tissue Blocks":a.size,"Tissue Sections":d.size,"Tissue Datasets":f.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 Dw(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={};return CY(e,t).forEach(function(e,t){n[t]=e.size}),n}(this.getIds(e),this.store));case 1:case"end":return t.stop()}},t,this)}))}},{key:"getCellTypeTermOccurences",value:function(e){return Dw(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,i,r,o=CY(e,t),a=new Map,s=_(o.keys());try{for(s.s();!(r=s.n()).done;){var u,c=r.value,l=o.get(c),h=_((0,Hq.readQuads)(t,null,XX.asctb.located_in,c,null));try{for(h.s();!(u=h.n()).done;){var d=u.value.subject.id;a.has(d)?function(){var e=a.get(d);l.forEach(function(t){return e.add(t)})}():a.set(d,new Set(l))}}catch(p){h.e(p)}finally{h.f()}}}catch(p){s.e(p)}finally{s.f()}var f={};return a.forEach(function(e,t){f[t]=e.size}),f[QX.cell.id]=null!==(i=null===(n=o.get(QX.body.id))||void 0===n?void 0:n.size)&&void 0!==i?i:0,f}(this.getIds(e),this.store));case 1:case"end":return t.stop()}},t,this)}))}},{key:"getOntologyTreeModel",value:function(){return Dw(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",PY(this.store));case 1:case"end":return e.stop()}},e,this)}))}},{key:"getCellTypeTreeModel",value:function(){return Dw(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){return OY(e,QX.cell.id,"cell",XX.asctb.ct_is_a.id)}(this.store));case 1:case"end":return e.stop()}},e,this)}))}},{key:"getReferenceOrgans",value:function(){return Dw(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 Dw(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 Dw(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)}))}},{key:"getSpatialPlacement",value:function(e,t){return Dw(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.getSpatialPlacement(e,t));case 1:case"end":return n.stop()}},n,this)}))}}]),e}(),HY=[240,183,98,255],GY=[213,0,0,255],WY=[29,204,101,255],qY=[41,121,255,255],XY=[204,204,204,255],YY=[213,0,0,255],KY=[29,204,101,255],$Y=[41,121,255,255];function QY(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e.x_dimension/1e3,i=e.y_dimension/1e3,r=e.z_dimension/1e3,o=.05*Math.max(n,i,r),a=.1*o;return[{"@id":"http://purl.org/ccf/latest/ccf.owl#OriginSphere","@type":"SpatialSceneNode",unpickable:!0,geometry:"sphere",transformMatrix:new $O($O.IDENTITY).scale(o),color:XY},{"@id":"http://purl.org/ccf/latest/ccf.owl#OriginX","@type":"SpatialSceneNode",unpickable:!0,geometry:"cylinder",transformMatrix:new $O($O.IDENTITY).translate([n/2,0,0]).rotateZ(cS(-90)).scale([a,n,a]),color:YY},{"@id":"http://purl.org/ccf/latest/ccf.owl#OriginXCone","@type":"SpatialSceneNode",unpickable:!0,geometry:"cone",transformMatrix:new $O($O.IDENTITY).translate([n,0,0]).rotateZ(cS(-90)).scale([o,3*o,o]),color:YY},{"@id":"http://purl.org/ccf/latest/ccf.owl#OriginXALabel","@type":"SpatialSceneNode",unpickable:!0,geometry:"text",text:"A",transformMatrix:new $O($O.IDENTITY).translate([2*-o,0,0]).scale(o),color:YY},{"@id":"http://purl.org/ccf/latest/ccf.owl#OriginXDLabel","@type":"SpatialSceneNode",unpickable:!0,geometry:"text",text:"D",transformMatrix:new $O($O.IDENTITY).translate([n+2*o,0,0]).scale(o),color:YY},{"@id":"http://purl.org/ccf/latest/ccf.owl#OriginY","@type":"SpatialSceneNode",unpickable:!0,geometry:"cylinder",transformMatrix:new $O($O.IDENTITY).translate([0,i/2,0]).scale([a,i,a]),color:KY},{"@id":"http://purl.org/ccf/latest/ccf.owl#OriginYCone","@type":"SpatialSceneNode",unpickable:!0,geometry:"cone",transformMatrix:new $O($O.IDENTITY).translate([0,i,0]).scale([o,3*o,o]),color:KY},{"@id":"http://purl.org/ccf/latest/ccf.owl#OriginYSLabel","@type":"SpatialSceneNode",unpickable:!0,geometry:"text",text:"S",transformMatrix:new $O($O.IDENTITY).translate([1.5*o,1.5*o,0]).scale(o),color:KY},{"@id":"http://purl.org/ccf/latest/ccf.owl#OriginYWLabel","@type":"SpatialSceneNode",unpickable:!0,geometry:"text",text:"W",transformMatrix:new $O($O.IDENTITY).translate([0,i+2*o,0]).scale(o),color:KY},{"@id":"http://purl.org/ccf/latest/ccf.owl#OriginZ","@type":"SpatialSceneNode",unpickable:!0,geometry:"cylinder",transformMatrix:new $O($O.IDENTITY).translate([0,0,r/2]).rotateX(cS(90)).scale([a,r,a]),color:$Y},{"@id":"http://purl.org/ccf/latest/ccf.owl#OriginZCone","@type":"SpatialSceneNode",unpickable:!0,geometry:"cone",transformMatrix:new $O($O.IDENTITY).translate([0,0,r]).rotateX(cS(90)).scale([o,3*o,o]),color:$Y},{"@id":"http://purl.org/ccf/latest/ccf.owl#OriginZQLabel","@type":"SpatialSceneNode",unpickable:!0,geometry:"text",text:"Q",transformMatrix:new $O($O.IDENTITY).translate([1.5*o,1.5*-o,0]).scale(o),color:$Y},{"@id":"http://purl.org/ccf/latest/ccf.owl#OriginZELabel","@type":"SpatialSceneNode",unpickable:!0,geometry:"text",text:"E",transformMatrix:new $O($O.IDENTITY).translate([0,0,r+2*o]).scale(o),color:$Y}].filter(function(e){return t&&"text"===e.geometry&&e.text||!e.text})}var ZY=Symbol("Comlink.proxy"),JY=Symbol("Comlink.endpoint"),eK=Symbol("Comlink.releaseProxy"),tK=Symbol("Comlink.thrown"),nK=function(e){return"object"==typeof e&&null!==e||"function"==typeof e},iK=new Map([["proxy",{canHandle:function(e){return nK(e)&&e[ZY]},serialize:function(e){var t=new MessageChannel,n=t.port1,i=t.port2;return rK(e,n),[i,[i]]},deserialize:function(e){return e.start(),aK(e)}}],["throw",{canHandle:function(e){return nK(e)&&tK 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 rK(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,d=(r.data.argumentList||[]).map(fK);try{var f=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":f[l.slice(-1)[0]]=fK(r.data.value),a=!0;break;case"APPLY":a=p.apply(f,d);break;case"CONSTRUCT":a=function(e){return Object.assign(e,o({},ZY,!0))}(h(p,v(d)));break;case"ENDPOINT":var g=new MessageChannel,m=g.port1,y=g.port2;rK(e,y),a=function(e,t){return hK.set(e,t),e}(m,[m]);break;case"RELEASE":a=void 0;break;default:return}}catch(f){a=o({value:f},tK,0)}Promise.resolve(a).catch(function(e){return o({value:e},tK,0)}).then(function(e){var r=t(dK(e),2),o=r[0],a=r[1];n.postMessage(Object.assign(Object.assign({},o),{id:u}),a),"RELEASE"===c&&(n.removeEventListener("message",i),oK(n))})}}),n.start&&n.start()}function oK(e){(function(e){return"MessagePort"===e.constructor.name})(e)&&e.close()}function aK(e,t){return uK(e,[],t)}function sK(e){if(e)throw new Error("Proxy has been released and is not useable")}function uK(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(sK(r),i===eK)return function(){return pK(e,{type:"RELEASE",path:n.map(function(e){return e.toString()})}).then(function(){oK(e),r=!0})};if("then"===i){if(0===n.length)return{then:function(){return o}};var a=pK(e,{type:"GET",path:n.map(function(e){return e.toString()})}).then(fK);return a.then.bind(a)}return uK(e,[].concat(v(n),[i]))},set:function(i,o,a){sK(r);var s=t(dK(a),2),u=s[0],c=s[1];return pK(e,{type:"SET",path:[].concat(v(n),[o]).map(function(e){return e.toString()}),value:u},c).then(fK)},apply:function(i,o,a){sK(r);var s=n[n.length-1];if(s===JY)return pK(e,{type:"ENDPOINT"}).then(fK);if("bind"===s)return uK(e,n.slice(0,-1));var u=t(lK(a),2),c=u[0],l=u[1];return pK(e,{type:"APPLY",path:n.map(function(e){return e.toString()}),argumentList:c},l).then(fK)},construct:function(i,o){sK(r);var a=t(lK(o),2),s=a[0],u=a[1];return pK(e,{type:"CONSTRUCT",path:n.map(function(e){return e.toString()}),argumentList:s},u).then(fK)}});return o}function cK(e){return Array.prototype.concat.apply([],e)}function lK(e){var t=e.map(dK);return[t.map(function(e){return e[0]}),cK(t.map(function(e){return e[1]}))]}var hK=new WeakMap;function dK(e){var n,i=_(iK);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},hK.get(e)||[]]}function fK(e){switch(e.type){case"HANDLER":return iK.get(e.name).deserialize(e.value);case"RAW":return e.value}}function pK(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)})}var vK=function(e){a(n,e);var t=s(n);function n(){var e;return m(this,n),(e=t.apply(this,arguments)).message="NgxsDispatchPluginModule is not imported",e}return n}(l(Error)),gK=null;function mK(e){gK=e}function yK(){if(null===gK)throw new vK;return gK.get(Pz)}function bK(){if(null===gK)throw new vK;return gK.get(Xl)}function _K(e,t,n){t.run(function(){return e.dispatch(n)})}function wK(e,t,n,i){return js(n)?function(e,t,n){return n.then(function(n){return _K(e,t,n),n})}(e,t,n):cf(n)?function(e,t,n,i){return null!==i&&(n=n.pipe(kf(i.cancelUncompleted$))),n.subscribe({next:function(n){return _K(e,t,n)}}),n}(e,t,n,i):(_K(e,t,n),n)}var kK=function(){function e(){m(this,e),this.cancelUncompleted$=new ae}return b(e,[{key:"cancelPreviousAction",value:function(){this.cancelUncompleted$.next()}}]),e}(),xK="\u0275fac",SK=Symbol("InjectorInstance"),CK=Symbol("FactoryHasBeenDecorated");function EK(e,t){var n=e[SK];return n?n.get(t):null}var OK={cancelUncompleted:!1};function TK(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:OK;return function(t,n,i){var r,o=function(e){return e?new kK:null}(e.cancelUncompleted);function a(){null!==o&&o.cancelPreviousAction();var e=EK(this,Pz)||yK(),t=EK(this,Xl)||bK(),n=r.apply(this,arguments);return t.runOutsideAngular(function(){return wK(e,t,n,o)})}"function"==typeof(null==i?void 0:i.value)?(r=i.value,i.value=a):Object.defineProperty(t,n,{set:function(e){return r=e},get:function(){return a}}),function(e){if(!(CK in e.constructor.prototype)){var t=e.constructor;"function"==typeof t[xK]&&function(e){var t=e[xK];if("function"==typeof t){var n=e.\u0275prov||e.\u0275pipe||e.\u0275cmp||e.\u0275dir,i=function(){var e=t();return e[SK]=Os(Xa),e};n&&(n.factory=i),Object.defineProperty(e,xK,{get:function(){return i}})}}(t),e.constructor.prototype[CK]=!0}}(t)}}var PK=function(){var e=function(){function e(t){m(this,e),mK(t.injector),t.onDestroy(function(){mK(null)})}return b(e,null,[{key:"forRoot",value:function(){return{ngModule:e}}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Zi(Rc))},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({}),e}(),AK=function(){var e=function(){function e(){m(this,e),this._vertical=!1,this._inset=!1}return b(e,[{key:"vertical",get:function(){return this._vertical},set:function(e){this._vertical=Wd(e)}},{key:"inset",get:function(){return this._inset},set:function(e){this._inset=Wd(e)}}]),e}();return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=Ot({type:e,selectors:[["mat-divider"]],hostAttrs:["role","separator",1,"mat-divider"],hostVars:7,hostBindings:function(e,t){2&e&&(ks("aria-orientation",t.vertical?"vertical":"horizontal"),cu("mat-divider-vertical",t.vertical)("mat-divider-horizontal",!t.vertical)("mat-divider-inset",t.inset))},inputs:{vertical:"vertical",inset:"inset"},decls:0,vars:0,template:function(e,t){},styles:[".mat-divider{display:block;margin:0;border-top-width:1px;border-top-style:solid}.mat-divider.mat-divider-vertical{border-top:0;border-right-width:1px;border-right-style:solid}.mat-divider.mat-divider-inset{margin-left:80px}[dir=rtl] .mat-divider.mat-divider-inset{margin-left:auto;margin-right:80px}\n"],encapsulation:2,changeDetection:0}),e}(),MK=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({imports:[[rb],rb]}),e}(),IK=["*"],RK=[[["","mat-list-avatar",""],["","mat-list-icon",""],["","matListAvatar",""],["","matListIcon",""]],[["","mat-line",""],["","matLine",""]],"*"],DK=["[mat-list-avatar], [mat-list-icon], [matListAvatar], [matListIcon]","[mat-line], [matLine]","*"],NK=ob(sb(function(){return function e(){m(this,e)}}())),LK=sb(function(){return function e(){m(this,e)}}()),jK=new Ri("MatList"),FK=new Ri("MatNavList"),BK=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))._elementRef=e,i._stateChanges=new ae,"action-list"===i._getListType()&&e.nativeElement.classList.add("mat-action-list"),i}return b(n,[{key:"_getListType",value:function(){var e=this._elementRef.nativeElement.nodeName.toLowerCase();return"mat-list"===e?"list":"mat-action-list"===e?"action-list":null}},{key:"ngOnChanges",value:function(){this._stateChanges.next()}},{key:"ngOnDestroy",value:function(){this._stateChanges.complete()}}]),n}(NK);return e.\u0275fac=function(t){return new(t||e)(Os(Ju))},e.\u0275cmp=Ot({type:e,selectors:[["mat-list"],["mat-action-list"]],hostAttrs:[1,"mat-list","mat-list-base"],inputs:{disableRipple:"disableRipple",disabled:"disabled"},exportAs:["matList"],features:[Xu([{provide:jK,useExisting:e}]),cs,qt],ngContentSelectors:IK,decls:1,vars:0,template:function(e,t){1&e&&(Xs(),Ys(0))},styles:['.mat-subheader{display:flex;box-sizing:border-box;padding:16px;align-items:center}.mat-list-base .mat-subheader{margin:0}.mat-list-base{padding-top:8px;display:block;-webkit-tap-highlight-color:transparent}.mat-list-base .mat-subheader{height:48px;line-height:16px}.mat-list-base .mat-subheader:first-child{margin-top:-8px}.mat-list-base .mat-list-item,.mat-list-base .mat-list-option{display:block;height:48px;-webkit-tap-highlight-color:transparent;width:100%;padding:0}.mat-list-base .mat-list-item .mat-list-item-content,.mat-list-base .mat-list-option .mat-list-item-content{display:flex;flex-direction:row;align-items:center;box-sizing:border-box;padding:0 16px;position:relative;height:inherit}.mat-list-base .mat-list-item .mat-list-item-content-reverse,.mat-list-base .mat-list-option .mat-list-item-content-reverse{display:flex;align-items:center;padding:0 16px;flex-direction:row-reverse;justify-content:space-around}.mat-list-base .mat-list-item .mat-list-item-ripple,.mat-list-base .mat-list-option .mat-list-item-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none}.mat-list-base .mat-list-item.mat-list-item-with-avatar,.mat-list-base .mat-list-option.mat-list-item-with-avatar{height:56px}.mat-list-base .mat-list-item.mat-2-line,.mat-list-base .mat-list-option.mat-2-line{height:72px}.mat-list-base .mat-list-item.mat-3-line,.mat-list-base .mat-list-option.mat-3-line{height:88px}.mat-list-base .mat-list-item.mat-multi-line,.mat-list-base .mat-list-option.mat-multi-line{height:auto}.mat-list-base .mat-list-item.mat-multi-line .mat-list-item-content,.mat-list-base .mat-list-option.mat-multi-line .mat-list-item-content{padding-top:16px;padding-bottom:16px}.mat-list-base .mat-list-item .mat-list-text,.mat-list-base .mat-list-option .mat-list-text{display:flex;flex-direction:column;flex:auto;box-sizing:border-box;overflow:hidden;padding:0}.mat-list-base .mat-list-item .mat-list-text>*,.mat-list-base .mat-list-option .mat-list-text>*{margin:0;padding:0;font-weight:normal;font-size:inherit}.mat-list-base .mat-list-item .mat-list-text:empty,.mat-list-base .mat-list-option .mat-list-text:empty{display:none}.mat-list-base .mat-list-item.mat-list-item-with-avatar .mat-list-item-content .mat-list-text,.mat-list-base .mat-list-item.mat-list-option .mat-list-item-content .mat-list-text,.mat-list-base .mat-list-option.mat-list-item-with-avatar .mat-list-item-content .mat-list-text,.mat-list-base .mat-list-option.mat-list-option .mat-list-item-content .mat-list-text{padding-right:0;padding-left:16px}[dir=rtl] .mat-list-base .mat-list-item.mat-list-item-with-avatar .mat-list-item-content .mat-list-text,[dir=rtl] .mat-list-base .mat-list-item.mat-list-option .mat-list-item-content .mat-list-text,[dir=rtl] .mat-list-base .mat-list-option.mat-list-item-with-avatar .mat-list-item-content .mat-list-text,[dir=rtl] .mat-list-base .mat-list-option.mat-list-option .mat-list-item-content .mat-list-text{padding-right:16px;padding-left:0}.mat-list-base .mat-list-item.mat-list-item-with-avatar .mat-list-item-content-reverse .mat-list-text,.mat-list-base .mat-list-item.mat-list-option .mat-list-item-content-reverse .mat-list-text,.mat-list-base .mat-list-option.mat-list-item-with-avatar .mat-list-item-content-reverse .mat-list-text,.mat-list-base .mat-list-option.mat-list-option .mat-list-item-content-reverse .mat-list-text{padding-left:0;padding-right:16px}[dir=rtl] .mat-list-base .mat-list-item.mat-list-item-with-avatar .mat-list-item-content-reverse .mat-list-text,[dir=rtl] .mat-list-base .mat-list-item.mat-list-option .mat-list-item-content-reverse .mat-list-text,[dir=rtl] .mat-list-base .mat-list-option.mat-list-item-with-avatar .mat-list-item-content-reverse .mat-list-text,[dir=rtl] .mat-list-base .mat-list-option.mat-list-option .mat-list-item-content-reverse .mat-list-text{padding-right:0;padding-left:16px}.mat-list-base .mat-list-item.mat-list-item-with-avatar.mat-list-option .mat-list-item-content-reverse .mat-list-text,.mat-list-base .mat-list-item.mat-list-item-with-avatar.mat-list-option .mat-list-item-content .mat-list-text,.mat-list-base .mat-list-option.mat-list-item-with-avatar.mat-list-option .mat-list-item-content-reverse .mat-list-text,.mat-list-base .mat-list-option.mat-list-item-with-avatar.mat-list-option .mat-list-item-content .mat-list-text{padding-right:16px;padding-left:16px}.mat-list-base .mat-list-item .mat-list-avatar,.mat-list-base .mat-list-option .mat-list-avatar{flex-shrink:0;width:40px;height:40px;border-radius:50%;object-fit:cover}.mat-list-base .mat-list-item .mat-list-avatar~.mat-divider-inset,.mat-list-base .mat-list-option .mat-list-avatar~.mat-divider-inset{margin-left:72px;width:calc(100% - 72px)}[dir=rtl] .mat-list-base .mat-list-item .mat-list-avatar~.mat-divider-inset,[dir=rtl] .mat-list-base .mat-list-option .mat-list-avatar~.mat-divider-inset{margin-left:auto;margin-right:72px}.mat-list-base .mat-list-item .mat-list-icon,.mat-list-base .mat-list-option .mat-list-icon{flex-shrink:0;width:24px;height:24px;font-size:24px;box-sizing:content-box;border-radius:50%;padding:4px}.mat-list-base .mat-list-item .mat-list-icon~.mat-divider-inset,.mat-list-base .mat-list-option .mat-list-icon~.mat-divider-inset{margin-left:64px;width:calc(100% - 64px)}[dir=rtl] .mat-list-base .mat-list-item .mat-list-icon~.mat-divider-inset,[dir=rtl] .mat-list-base .mat-list-option .mat-list-icon~.mat-divider-inset{margin-left:auto;margin-right:64px}.mat-list-base .mat-list-item .mat-divider,.mat-list-base .mat-list-option .mat-divider{position:absolute;bottom:0;left:0;width:100%;margin:0}[dir=rtl] .mat-list-base .mat-list-item .mat-divider,[dir=rtl] .mat-list-base .mat-list-option .mat-divider{margin-left:auto;margin-right:0}.mat-list-base .mat-list-item .mat-divider.mat-divider-inset,.mat-list-base .mat-list-option .mat-divider.mat-divider-inset{position:absolute}.mat-list-base[dense]{padding-top:4px;display:block}.mat-list-base[dense] .mat-subheader{height:40px;line-height:8px}.mat-list-base[dense] .mat-subheader:first-child{margin-top:-4px}.mat-list-base[dense] .mat-list-item,.mat-list-base[dense] .mat-list-option{display:block;height:40px;-webkit-tap-highlight-color:transparent;width:100%;padding:0}.mat-list-base[dense] .mat-list-item .mat-list-item-content,.mat-list-base[dense] .mat-list-option .mat-list-item-content{display:flex;flex-direction:row;align-items:center;box-sizing:border-box;padding:0 16px;position:relative;height:inherit}.mat-list-base[dense] .mat-list-item .mat-list-item-content-reverse,.mat-list-base[dense] .mat-list-option .mat-list-item-content-reverse{display:flex;align-items:center;padding:0 16px;flex-direction:row-reverse;justify-content:space-around}.mat-list-base[dense] .mat-list-item .mat-list-item-ripple,.mat-list-base[dense] .mat-list-option .mat-list-item-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none}.mat-list-base[dense] .mat-list-item.mat-list-item-with-avatar,.mat-list-base[dense] .mat-list-option.mat-list-item-with-avatar{height:48px}.mat-list-base[dense] .mat-list-item.mat-2-line,.mat-list-base[dense] .mat-list-option.mat-2-line{height:60px}.mat-list-base[dense] .mat-list-item.mat-3-line,.mat-list-base[dense] .mat-list-option.mat-3-line{height:76px}.mat-list-base[dense] .mat-list-item.mat-multi-line,.mat-list-base[dense] .mat-list-option.mat-multi-line{height:auto}.mat-list-base[dense] .mat-list-item.mat-multi-line .mat-list-item-content,.mat-list-base[dense] .mat-list-option.mat-multi-line .mat-list-item-content{padding-top:16px;padding-bottom:16px}.mat-list-base[dense] .mat-list-item .mat-list-text,.mat-list-base[dense] .mat-list-option .mat-list-text{display:flex;flex-direction:column;flex:auto;box-sizing:border-box;overflow:hidden;padding:0}.mat-list-base[dense] .mat-list-item .mat-list-text>*,.mat-list-base[dense] .mat-list-option .mat-list-text>*{margin:0;padding:0;font-weight:normal;font-size:inherit}.mat-list-base[dense] .mat-list-item .mat-list-text:empty,.mat-list-base[dense] .mat-list-option .mat-list-text:empty{display:none}.mat-list-base[dense] .mat-list-item.mat-list-item-with-avatar .mat-list-item-content .mat-list-text,.mat-list-base[dense] .mat-list-item.mat-list-option .mat-list-item-content .mat-list-text,.mat-list-base[dense] .mat-list-option.mat-list-item-with-avatar .mat-list-item-content .mat-list-text,.mat-list-base[dense] .mat-list-option.mat-list-option .mat-list-item-content .mat-list-text{padding-right:0;padding-left:16px}[dir=rtl] .mat-list-base[dense] .mat-list-item.mat-list-item-with-avatar .mat-list-item-content .mat-list-text,[dir=rtl] .mat-list-base[dense] .mat-list-item.mat-list-option .mat-list-item-content .mat-list-text,[dir=rtl] .mat-list-base[dense] .mat-list-option.mat-list-item-with-avatar .mat-list-item-content .mat-list-text,[dir=rtl] .mat-list-base[dense] .mat-list-option.mat-list-option .mat-list-item-content .mat-list-text{padding-right:16px;padding-left:0}.mat-list-base[dense] .mat-list-item.mat-list-item-with-avatar .mat-list-item-content-reverse .mat-list-text,.mat-list-base[dense] .mat-list-item.mat-list-option .mat-list-item-content-reverse .mat-list-text,.mat-list-base[dense] .mat-list-option.mat-list-item-with-avatar .mat-list-item-content-reverse .mat-list-text,.mat-list-base[dense] .mat-list-option.mat-list-option .mat-list-item-content-reverse .mat-list-text{padding-left:0;padding-right:16px}[dir=rtl] .mat-list-base[dense] .mat-list-item.mat-list-item-with-avatar .mat-list-item-content-reverse .mat-list-text,[dir=rtl] .mat-list-base[dense] .mat-list-item.mat-list-option .mat-list-item-content-reverse .mat-list-text,[dir=rtl] .mat-list-base[dense] .mat-list-option.mat-list-item-with-avatar .mat-list-item-content-reverse .mat-list-text,[dir=rtl] .mat-list-base[dense] .mat-list-option.mat-list-option .mat-list-item-content-reverse .mat-list-text{padding-right:0;padding-left:16px}.mat-list-base[dense] .mat-list-item.mat-list-item-with-avatar.mat-list-option .mat-list-item-content-reverse .mat-list-text,.mat-list-base[dense] .mat-list-item.mat-list-item-with-avatar.mat-list-option .mat-list-item-content .mat-list-text,.mat-list-base[dense] .mat-list-option.mat-list-item-with-avatar.mat-list-option .mat-list-item-content-reverse .mat-list-text,.mat-list-base[dense] .mat-list-option.mat-list-item-with-avatar.mat-list-option .mat-list-item-content .mat-list-text{padding-right:16px;padding-left:16px}.mat-list-base[dense] .mat-list-item .mat-list-avatar,.mat-list-base[dense] .mat-list-option .mat-list-avatar{flex-shrink:0;width:36px;height:36px;border-radius:50%;object-fit:cover}.mat-list-base[dense] .mat-list-item .mat-list-avatar~.mat-divider-inset,.mat-list-base[dense] .mat-list-option .mat-list-avatar~.mat-divider-inset{margin-left:68px;width:calc(100% - 68px)}[dir=rtl] .mat-list-base[dense] .mat-list-item .mat-list-avatar~.mat-divider-inset,[dir=rtl] .mat-list-base[dense] .mat-list-option .mat-list-avatar~.mat-divider-inset{margin-left:auto;margin-right:68px}.mat-list-base[dense] .mat-list-item .mat-list-icon,.mat-list-base[dense] .mat-list-option .mat-list-icon{flex-shrink:0;width:20px;height:20px;font-size:20px;box-sizing:content-box;border-radius:50%;padding:4px}.mat-list-base[dense] .mat-list-item .mat-list-icon~.mat-divider-inset,.mat-list-base[dense] .mat-list-option .mat-list-icon~.mat-divider-inset{margin-left:60px;width:calc(100% - 60px)}[dir=rtl] .mat-list-base[dense] .mat-list-item .mat-list-icon~.mat-divider-inset,[dir=rtl] .mat-list-base[dense] .mat-list-option .mat-list-icon~.mat-divider-inset{margin-left:auto;margin-right:60px}.mat-list-base[dense] .mat-list-item .mat-divider,.mat-list-base[dense] .mat-list-option .mat-divider{position:absolute;bottom:0;left:0;width:100%;margin:0}[dir=rtl] .mat-list-base[dense] .mat-list-item .mat-divider,[dir=rtl] .mat-list-base[dense] .mat-list-option .mat-divider{margin-left:auto;margin-right:0}.mat-list-base[dense] .mat-list-item .mat-divider.mat-divider-inset,.mat-list-base[dense] .mat-list-option .mat-divider.mat-divider-inset{position:absolute}.mat-nav-list a{text-decoration:none;color:inherit}.mat-nav-list .mat-list-item{cursor:pointer;outline:none}mat-action-list button{background:none;color:inherit;border:none;font:inherit;outline:inherit;-webkit-tap-highlight-color:transparent;text-align:left}[dir=rtl] mat-action-list button{text-align:right}mat-action-list button::-moz-focus-inner{border:0}mat-action-list .mat-list-item{cursor:pointer;outline:inherit}.mat-list-option:not(.mat-list-item-disabled){cursor:pointer;outline:none}.mat-list-item-disabled{pointer-events:none}.cdk-high-contrast-active .mat-list-item-disabled{opacity:.5}.cdk-high-contrast-active :host .mat-list-item-disabled{opacity:.5}.cdk-high-contrast-active .mat-selection-list:focus{outline-style:dotted}.cdk-high-contrast-active .mat-list-option:hover,.cdk-high-contrast-active .mat-list-option:focus,.cdk-high-contrast-active .mat-nav-list .mat-list-item:hover,.cdk-high-contrast-active .mat-nav-list .mat-list-item:focus,.cdk-high-contrast-active mat-action-list .mat-list-item:hover,.cdk-high-contrast-active mat-action-list .mat-list-item:focus{outline:dotted 1px}.cdk-high-contrast-active .mat-list-single-selected-option::after{content:"";position:absolute;top:50%;right:16px;transform:translateY(-50%);width:10px;height:0;border-bottom:solid 10px;border-radius:10px}.cdk-high-contrast-active [dir=rtl] .mat-list-single-selected-option::after{right:auto;left:16px}@media(hover: none){.mat-list-option:not(.mat-list-single-selected-option):not(.mat-list-item-disabled):hover,.mat-nav-list .mat-list-item:not(.mat-list-item-disabled):hover,.mat-action-list .mat-list-item:not(.mat-list-item-disabled):hover{background:none}}\n'],encapsulation:2,changeDetection:0}),e}(),VK=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275dir=Rt({type:e,selectors:[["","mat-list-avatar",""],["","matListAvatar",""]],hostAttrs:[1,"mat-list-avatar"]}),e}(),zK=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275dir=Rt({type:e,selectors:[["","mat-list-icon",""],["","matListIcon",""]],hostAttrs:[1,"mat-list-icon"]}),e}(),UK=function(){var e=function(e){a(n,e);var t=s(n);function n(e,i,r,o){var a;m(this,n),(a=t.call(this))._element=e,a._isInteractiveList=!1,a._destroyed=new ae,a._disabled=!1,a._isInteractiveList=!!(r||o&&"action-list"===o._getListType()),a._list=r||o;var s=a._getHostElement();return"button"===s.nodeName.toLowerCase()&&!s.hasAttribute("type")&&s.setAttribute("type","button"),a._list&&a._list._stateChanges.pipe(kf(a._destroyed)).subscribe(function(){i.markForCheck()}),a}return b(n,[{key:"disabled",get:function(){return this._disabled||!(!this._list||!this._list.disabled)},set:function(e){this._disabled=Wd(e)}},{key:"ngAfterContentInit",value:function(){!function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"mat";e.changes.pipe(Ef(e)).subscribe(function(e){var i=e.length;db(t,"".concat(n,"-2-line"),!1),db(t,"".concat(n,"-3-line"),!1),db(t,"".concat(n,"-multi-line"),!1),2===i||3===i?db(t,"".concat(n,"-").concat(i,"-line"),!0):i>3&&db(t,"".concat(n,"-multi-line"),!0)})}(this._lines,this._element)}},{key:"ngOnDestroy",value:function(){this._destroyed.next(),this._destroyed.complete()}},{key:"_isRippleDisabled",value:function(){return!this._isInteractiveList||this.disableRipple||!(!this._list||!this._list.disableRipple)}},{key:"_getHostElement",value:function(){return this._element.nativeElement}}]),n}(LK);return e.\u0275fac=function(t){return new(t||e)(Os(Ju),Os(Cc),Os(FK,8),Os(jK,8))},e.\u0275cmp=Ot({type:e,selectors:[["mat-list-item"],["a","mat-list-item",""],["button","mat-list-item",""]],contentQueries:function(e,t,n){var i;(1&e&&(bl(n,VK,5),bl(n,zK,5),bl(n,hb,5)),2&e)&&(ml(i=_l())&&(t._avatar=i.first),ml(i=_l())&&(t._icon=i.first),ml(i=_l())&&(t._lines=i))},hostAttrs:[1,"mat-list-item","mat-focus-indicator"],hostVars:6,hostBindings:function(e,t){2&e&&cu("mat-list-item-disabled",t.disabled)("mat-list-item-avatar",t._avatar||t._icon)("mat-list-item-with-avatar",t._avatar||t._icon)},inputs:{disableRipple:"disableRipple",disabled:"disabled"},exportAs:["matListItem"],features:[cs],ngContentSelectors:DK,decls:6,vars:2,consts:[[1,"mat-list-item-content"],["mat-ripple","",1,"mat-list-item-ripple",3,"matRippleTrigger","matRippleDisabled"],[1,"mat-list-text"]],template:function(e,t){1&e&&(Xs(RK),As(0,"div",0),Is(1,"div",1),Ys(2),As(3,"div",2),Ys(4,1),Ms(),Ys(5,2),Ms()),2&e&&(Yo(1),Ts("matRippleTrigger",t._getHostElement())("matRippleDisabled",t._isRippleDisabled()))},directives:[wb],encapsulation:2,changeDetection:0}),e}(),HK=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({imports:[[fb,kb,rb,Sb,cd],fb,rb,Sb,MK]}),e}(),GK=["input"],WK=function(e){return{enterDuration:e}},qK=["*"],XK=new Ri("mat-checkbox-default-options",{providedIn:"root",factory:YK});function YK(){return{color:"accent",clickAction:"check-indeterminate"}}var KK=0,$K={color:"accent",clickAction:"check-indeterminate"},QK={provide:Hz,useExisting:He(function(){return e$}),multi:!0},ZK=function e(){m(this,e)},JK=ub(ab(sb(ob(function(){return function e(t){m(this,e),this._elementRef=t}}())))),e$=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-"+ ++KK,c.id=c._uniqueId,c.labelPosition="after",c.name=null,c.change=new ol,c.indeterminateChange=new ol,c._onTouched=function(){},c._currentAnimationClass="",c._currentCheckState=0,c._controlValueAccessorChangeFn=function(){},c._checked=!1,c._disabled=!1,c._indeterminate=!1,c._options=c._options||$K,c.color=c.defaultColor=c._options.color||$K.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=Wd(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=Wd(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=Wd(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 ZK;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}(JK);return e.\u0275fac=function(t){return new(t||e)(Os(Ju),Os(Cc),Os(rg),Os(Xl),Ai("tabindex"),Os(Yy,8),Os(XK,8))},e.\u0275cmp=Ot({type:e,selectors:[["mat-checkbox"]],viewQuery:function(e,t){var n;(1&e&&(yl(GK,5),yl(wb,5)),2&e)&&(ml(n=_l())&&(t._inputElement=n.first),ml(n=_l())&&(t.ripple=n.first))},hostAttrs:[1,"mat-checkbox"],hostVars:12,hostBindings:function(e,t){2&e&&(Au("id",t.id),ks("tabindex",null),cu("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:[Xu([QK]),cs],ngContentSelectors:qK,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&&(Xs(),As(0,"label",0,1),As(2,"span",2),As(3,"input",3,4),Vs("change",function(e){return t._onInteractionEvent(e)})("click",function(e){return t._onInputClick(e)}),Ms(),As(5,"span",5),Is(6,"span",6),Ms(),Is(7,"span",7),As(8,"span",8),Xn(),As(9,"svg",9),Is(10,"path",10),Ms(),vn.lFrame.currentNamespace=null,Is(11,"span",11),Ms(),Ms(),As(12,"span",12,13),Vs("cdkObserveContent",function(){return t._onLabelTextChange()}),As(14,"span",14),Cu(15,"\xa0"),Ms(),Ys(16),Ms(),Ms()),2&e){var n=Es(1),i=Es(13);ks("for",t.inputId),Yo(2),cu("mat-checkbox-inner-container-no-side-margin",!i.textContent||!i.textContent.trim()),Yo(1),Ts("id",t.inputId)("required",t.required)("checked",t.checked)("disabled",t.disabled)("tabIndex",t.tabIndex),ks("value",t.value)("name",t.name)("aria-label",t.ariaLabel||null)("aria-labelledby",t.ariaLabelledby)("aria-checked",t._getAriaChecked())("aria-describedby",t.ariaDescribedby),Yo(2),Ts("matRippleTrigger",n)("matRippleDisabled",t._isRippleDisabled())("matRippleRadius",20)("matRippleCentered",!0)("matRippleAnimation",$c(19,WK,"NoopAnimations"===t._animationMode?0:150))}},directives:[wb,Pv],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}(),t$=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({}),e}(),n$=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({imports:[[kb,rb,Av,t$],rb,t$]}),e}(),i$=["bodyCanvas"],r$=function(){var e=function(){function e(){m(this,e),this.clsName="ccf-body-ui",this.rotationChange=new ol,this.nodeDrag=new ol,this.nodeClick=new ol,this.nodeHoverStart=new ol,this.nodeHoverStop=new ol,this.initialized=new ol,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 Dw(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 lV({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.target&&this.bodyUI.setTarget(this.target),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)})],this.initialized.emit();case 11: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=Ot({type:e,selectors:[["ccf-body-ui"]],viewQuery:function(e,t){var n;(1&e&&yl(i$,5,Ju),2&e)&&(ml(n=_l())&&(t.bodyCanvas=n.first))},hostVars:2,hostBindings:function(e,t){2&e&&du(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",initialized:"initialized"},decls:2,vars:0,consts:[[1,"body-ui"],["bodyCanvas",""]],template:function(e,t){1&e&&Is(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}(),o$=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({imports:[[cd]]}),e}();new Ri("Maximum number of autocomplete options displayed",{providedIn:"root",factory:function(){return 10}});var a$=["carouselContainer"],s$=["itemlist"],u$=["itemcontainer"];function c$(e,t){if(1&e){var n=Ls();As(0,"mat-icon",9),Vs("touchstart",function(){return bn(n),Ws().scroll("left")})("touchend",function(){return bn(n),Ws().stopScroll()})("click",function(){return bn(n),Ws().shift("left")})("mousedown",function(){return bn(n),Ws().scroll("left")})("mouseup",function(){return bn(n),Ws().stopScroll()}),Cu(1,"chevron_left"),Ms()}2&e&&cu("disabled",Ws().onLeft)}function l$(e,t){if(1&e&&(As(0,"div",15),Cu(1),Ms()),2&e){var n=Ws().$implicit,i=Ws();Yo(1),Eu(i.occurenceData[n.id]||0)}}function h$(e,t){if(1&e){var n=Ls();As(0,"div",10),Vs("click",function(){var e=bn(n).$implicit;return Ws().selectOrgan(e)}),Is(1,"mat-icon",11),As(2,"div",12),As(3,"div",13),Cu(4),Ms(),Cs(5,l$,2,1,"div",14),Ms(),Ms()}if(2&e){var i=t.$implicit,r=Ws();cu("disabled",i.disabled)("selected",r.isSelected(i)),Yo(1),Ks("svgIcon",i.src),Yo(3),Eu(i.name),Yo(1),Ts("ngIf",void 0!==i.numResults)}}function d$(e,t){if(1&e){var n=Ls();As(0,"mat-icon",16),Vs("touchstart",function(){return bn(n),Ws().scroll("right")})("touchend",function(){return bn(n),Ws().stopScroll()})("click",function(){return bn(n),Ws().shift("right")})("mousedown",function(){return bn(n),Ws().scroll("right")})("mouseup",function(){return bn(n),Ws().stopScroll()}),Cu(1,"chevron_right"),Ms()}2&e&&cu("disabled",Ws().onRight)}var f$=[{src:"app:skin",organ:"Skin",name:"Skin",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002097"},{src:"app:brain",organ:"Brain",name:"Brain",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000955"},{disabled:!0,src:"app:lymph-nodes",organ:"Lymph Node",name:"Lymph Node",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000029"},{src:"app:lymph-nodes",organ:"Lymph Node",name:"Lymph Node",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002509"},{disabled:!0,src:"app:eye",organ:"Eye",name:"Eye, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000970"},{src:"app:eye",organ:"Eye",name:"Eye, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0004548"},{src:"app:eye",organ:"Eye",name:"Eye, R",side:"right",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0004549"},{disabled:!0,src:"app:fallopian-tube-left",organ:"Fallopian Tube",name:"Fallopian Tube, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0003889"},{src:"app:fallopian-tube-left",organ:"Fallopian Tube",name:"Fallopian Tube, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0001303"},{src:"app:fallopian-tube-right",organ:"Fallopian Tube",name:"Fallopian Tube, R",side:"right",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0001302"},{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, L",side:"left",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"},{disabled:!0,src:"app:knee",organ:"Knee",name:"Knee, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001465"},{src:"app:knee",organ:"Knee",name:"Knee, L",side:"left",hasSex:!0,id:"http://purl.org/sig/ont/fma/fma24978"},{src:"app:knee",organ:"Knee",name:"Knee, R",side:"right",hasSex:!0,id:"http://purl.org/sig/ont/fma/fma24977"},{src:"app:liver",organ:"Liver",name:"Liver",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002107"},{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"},{disabled:!0,src:"app:mammary-gland",organ:"Mammary Gland",name:"Mammary Gland, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0001911"},{src:"app:mammary-gland",organ:"Mammary Gland",name:"Mammary Gland, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.org/sig/ont/fma/fma57991"},{src:"app:mammary-gland",organ:"Mammary Gland",name:"Mammary Gland, R",side:"right",hasSex:!1,sex:"female",id:"http://purl.org/sig/ont/fma/fma57987"},{disabled:!0,src:"app:ovary-left",organ:"Ovary",name:"Ovary, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0000992"},{src:"app:ovary-left",organ:"Ovary",name:"Ovary, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.org/sig/ont/fma/fma7214"},{src:"app:ovary-right",organ:"Ovary",name:"Ovary, R",side:"right",hasSex:!1,sex:"female",id:"http://purl.org/sig/ont/fma/fma7213"},{src:"app:pancreas",organ:"Pancreas",name:"Pancreas",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001264"},{src:"app:pelvis-f",organ:"Pelvis",name:"Pelvis",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001270"},{src:"app:placenta",organ:"Placenta",name:"Placenta",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0001987"},{src:"app:prostate",organ:"Prostate",name:"Prostate",hasSex:!1,sex:"male",id:"http://purl.obolibrary.org/obo/UBERON_0002367",disabled:!0},{src:"app:prostate",organ:"Prostate",name:"Prostate",hasSex:!1,sex:"male",id:"http://purl.obolibrary.org/obo/UBERON_0000079"},{src:"app:small-intestine",organ:"Small Intestine",name:"Small Intestine",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002108"},{src:"app:large-intestine",organ:"Large Intestine",name:"Large Intestine",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000059"},{src:"app:spinal-cord",organ:"Spinal Cord",name:"Spinal Cord",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002240"},{src:"app:spleen",organ:"Spleen",name:"Spleen",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002106"},{src:"app:thymus",organ:"Thymus",name:"Thymus",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002370"},{disabled:!0,src:"app:ureter-left",organ:"Ureter",name:"Ureter, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000056"},{src:"app:ureter-left",organ:"Ureter",name:"Ureter, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001223"},{src:"app:ureter-right",organ:"Ureter",name:"Ureter, R",side:"right",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001222"},{src:"app:bladder",organ:"Urinary Bladder",name:"Urinary Bladder",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001255"},{src:"app:uterus",organ:"Uterus",name:"Uterus",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0000995"},{src:"app:vasculature-thick",organ:"Blood Vasculature",name:"Blood Vasculature",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0004537"},{disabled:!0,src:"app:vasculature-thick",organ:"Blood Vasculature",name:"Blood Vasculature",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002049"}].sort(function(e,t){return e.name.localeCompare(t.name)}),p$=f$.filter(function(e){return!0!==e.disabled}),v$=function(){var e=function(){function e(){m(this,e),this.clsName="ccf-organ-selector",this.multiselect=!1,this.displayErrors=!1,this.organList=p$,this.selectedOrgans=[],this.expanded=!1,this.organsChanged=new ol,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 pG.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=Ot({type:e,selectors:[["ccf-organ-selector"]],viewQuery:function(e,t){var n;(1&e&&(yl(a$,7),yl(s$,7),yl(u$,7)),2&e)&&(ml(n=_l())&&(t.carouselContainer=n.first),ml(n=_l())&&(t.itemList=n.first),ml(n=_l())&&(t.itemContainer=n.first))},hostVars:2,hostBindings:function(e,t){2&e&&du(t.clsName)},inputs:{multiselect:"multiselect",displayErrors:"displayErrors",organList:"organList",selectedOrgans:"selectedOrgans",expanded:"expanded",occurenceData:"occurenceData"},outputs:{organsChanged:"organsChanged"},features:[qt],decls:9,vars:8,consts:[["matTooltip","Select the organ your tissue block is from.",1,"container",3,"matTooltipDisabled"],["carouselContainer",""],["class","carousel-left-icon",3,"disabled","touchstart","touchend","click","mousedown","mouseup",4,"ngIf"],[1,"carousel-item-container"],["itemcontainer",""],[1,"carousel-item-list"],["itemlist",""],["class","carousel-item",3,"disabled","selected","click",4,"ngFor","ngForOf"],["class","carousel-right-icon",3,"disabled","touchstart","touchend","click","mousedown","mouseup",4,"ngIf"],[1,"carousel-left-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"],[1,"carousel-right-icon",3,"touchstart","touchend","click","mousedown","mouseup"]],template:function(e,t){1&e&&(As(0,"div",0,1),Cs(2,c$,2,2,"mat-icon",2),As(3,"div",3,4),As(5,"div",5,6),Cs(7,h$,6,7,"div",7),Ms(),Ms(),Cs(8,d$,2,2,"mat-icon",8),Ms()),2&e&&(cu("expanded",t.expanded)("error",t.error),Ts("matTooltipDisabled",t.multiselect),Yo(2),Ts("ngIf",!t.expanded),Yo(5),Ts("ngForOf",t.organList),Yo(1),Ts("ngIf",!t.expanded))},directives:[Ow,Yh,qh,B_],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:5rem;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}[_nghost-%COMP%] .expanded[_ngcontent-%COMP%] .carousel-item-container[_ngcontent-%COMP%]{width:100%!important}[_nghost-%COMP%] .expanded[_ngcontent-%COMP%] .carousel-item-container[_ngcontent-%COMP%] .carousel-item-list[_ngcontent-%COMP%]{flex-wrap:wrap;overflow:auto;left:0rem!important}[_nghost-%COMP%] .expanded[_ngcontent-%COMP%] .carousel-item-container[_ngcontent-%COMP%] .carousel-item-list[_ngcontent-%COMP%] .carousel-item[_ngcontent-%COMP%]{height:5rem}"]}),e}(),g$=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({imports:[[cd,V_,Aw]]}),e}(),m$=function(){var e=function(){function e(){m(this,e),this.clsName="ccf-opacity-slider",this.opacity=20,this.visible=!0,this.opacityChange=new ol,this.visibilityToggle=new ol,this.opacityReset=new ol}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=Ot({type:e,selectors:[["ccf-opacity-slider"]],hostVars:2,hostBindings:function(e,t){2&e&&du(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&&(As(0,"div",0),As(1,"div",1),As(2,"mat-slider",2),Vs("input",function(e){return t.changeOpacity(e.value)}),Ms(),As(3,"span",3),Cu(4),Ms(),Ms(),As(5,"div",4),As(6,"mat-icon",5),Vs("click",function(){return t.toggleVisibility()}),Ms(),As(7,"mat-icon",6),Vs("click",function(){return t.toggleVisibility()}),Ms(),As(8,"mat-icon",7),Vs("click",function(){return t.resetOpacity()}),Cu(9,"refresh"),Ms(),Ms(),Ms()),2&e&&(Yo(2),cu("disabled",!t.visible),Ts("step",1)("min",0)("max",100)("value",t.opacity),Yo(2),Ou("",t.opacity,"%"),Yo(2),cu("hidden",t.visible),Ts("matRippleCentered",!0)("matRippleUnbounded",!0),Yo(1),cu("hidden",!t.visible),Ts("matRippleCentered",!0)("matRippleUnbounded",!0),Yo(1),Ts("matRippleCentered",!0)("matRippleUnbounded",!0))},directives:[_G,B_,wb],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}(),y$=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({imports:[[cd,V_,SG,kb]]}),e}();function b$(e,t){if(1&e&&(As(0,"div",16),Is(1,"youtube-player",17),Ms()),2&e){var n=Ws(3);Yo(1),Ks("videoId",n.videoID)}}function _$(e,t){if(1&e&&(As(0,"mat-expansion-panel",11),As(1,"mat-expansion-panel-header"),As(2,"h2",12),Cu(3),Ms(),Ms(),As(4,"div",13),Is(5,"markdown",14),Cs(6,b$,2,1,"div",15),Ms(),Ms()),2&e){var n=Ws(),i=n.index,r=n.$implicit;Ts("expanded",0===i),Yo(3),Eu(r.title),Yo(2),cu("first",0===i),Ts("data",r.content),Yo(1),Ts("ngIf",0===i)}}function w$(e,t){if(1&e&&(As(0,"div",9),Cs(1,_$,7,6,"mat-expansion-panel",10),Ms()),2&e){var n=t.$implicit;Yo(1),Ts("ngIf",n)}}var k$=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)(Os(MG),Os(RG))},e.\u0275cmp=Ot({type:e,selectors:[["ccf-info-dialog"]],decls:11,vars:2,consts:[[1,"rui-about","wrapper"],[1,"container"],[1,"content"],[1,"header"],["mat-dialog-title","",1,"title"],[1,"close"],[1,"material-icons","close-icon",3,"click"],[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&&(As(0,"div",0),As(1,"div",1),As(2,"div",2),As(3,"div",3),As(4,"h2",4),Cu(5),Ms(),As(6,"div",5),As(7,"mat-icon",6),Vs("click",function(){return t.close()}),Cu(8,"clear"),Ms(),Ms(),Ms(),As(9,"mat-dialog-content",7),Cs(10,w$,2,1,"div",8),Ms(),Ms(),Ms(),Ms()),2&e&&(Yo(5),Eu(t.infoTitle),Yo(5),Ts("ngForOf",t.documentationContents))},directives:[VG,B_,zG,qh,Yh,aW,uW,gW,OW],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%] .content[_ngcontent-%COMP%] .header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;height:3rem;margin-bottom:2.25rem;position:relative}.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%]{cursor:pointer;height:3rem;width:3rem;line-height:3rem;text-align:center;transition:.6s}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-size:1.5rem;margin:0 auto;line-height:3rem;height:3rem;justify-self:center;display:flex}.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;display:flex}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .dialog-content[_ngcontent-%COMP%] .variable-binding.first[_ngcontent-%COMP%]{padding-right:1rem;width:73%}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .dialog-content[_ngcontent-%COMP%] .variable-binding[_ngcontent-%COMP%] ul{margin:0}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .dialog-content[_ngcontent-%COMP%] .variable-binding[_ngcontent-%COMP%] img{margin-left:1rem;float:right}.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%}"]}),e}(),x$=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({imports:[[cd,UG,V_,cW,MW,mW.forRoot({})]]}),e}(),S$=function(){var e=function(){function e(t){m(this,e),this.http=t,this.panelContent=new vv({content:[],infoTitle:"",videoID:""})}return b(e,[{key:"updateData",value:function(e,t,n){var i=this;this.http.get(e,{responseType:"text"}).subscribe(function(e){var r={content:i.parseMarkdown(e),infoTitle:n,videoID:t};i.panelContent.next(r)})}},{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.includes("\n\n")?"\n\n":"\r\n\r\n",a=r.split(o);n.push({title:a[0],content:a.splice(1).join(o)})}}}catch(s){i.e(s)}finally{i.f()}return n}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Zi(h_))},e.\u0275prov=$e({token:e,factory:e.\u0275fac,providedIn:"root"}),e}(),C$=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 q,this.subscriptions.add(n.panelContent.subscribe(function(e){e.content.length&&i.launchInfoDialog(e)}))}return b(e,[{key:"ngOnDestroy",value:function(){this.subscriptions.unsubscribe()}},{key:"launchInfoDialog",value:function(e){0==this.dialog.openDialogs.length&&this.dialog.open(k$,{autoFocus:!1,panelClass:"modal-animated",width:"72rem",data:{title:e.infoTitle,content:e.content,videoID:e.videoID}})}},{key:"onDialogButtonClick",value:function(){this.infoButtonService.updateData(this.documentationUrl,this.videoID,this.infoTitle)}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Os(FG),Os(S$))},e.\u0275cmp=Ot({type:e,selectors:[["ccf-info-button"]],inputs:{infoTitle:"infoTitle",videoID:"videoID",documentationUrl:"documentationUrl"},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&&(As(0,"div",0),As(1,"mat-icon",1),Vs("click",function(){return t.onDialogButtonClick()}),Cu(2," info "),Ms(),Ms())},directives:[B_],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}(),E$=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({imports:[[cd,x$,V_,S_]]}),e}(),O$=function(){var e=function(){function e(){m(this,e),this.clsName="ccf-call-to-action",this.callToActionClicked=new ol,this.closeClicked=new ol}return b(e,[{key:"close",value:function(){this.closeClicked.emit()}},{key:"onDialogButtonClick",value:function(){this.callToActionClicked.emit()}}]),e}();return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=Ot({type:e,selectors:[["ccf-call-to-action"]],hostVars:2,hostBindings:function(e,t){2&e&&du(t.clsName)},inputs:{infoTitle:"infoTitle",imageUrl:"imageUrl",message:"message",callToAction:"callToAction"},outputs:{callToActionClicked:"callToActionClicked",closeClicked:"closeClicked"},decls:13,vars:4,consts:[[1,"rui-about","wrapper"],[1,"container"],[1,"content"],[1,"first-row"],["mat-dialog-title","",1,"title"],[1,"cta-mat-icon","material-icons","close-icon",3,"click"],["mat-card-sm-image","","alt","preview","layout-fill","",1,"cta-image",3,"src"],[1,"mat-typography","dialog-content"],[1,"message"],["mat-button","",1,"mat-button",3,"text","click"]],template:function(e,t){1&e&&(As(0,"div",0),As(1,"div",1),As(2,"div",2),As(3,"div",3),As(4,"p",4),Cu(5),Ms(),As(6,"mat-icon",5),Vs("click",function(){return t.close()}),Cu(7,"clear"),Ms(),Ms(),Is(8,"img",6),As(9,"mat-dialog-content",7),As(10,"div",8),Cu(11),Ms(),As(12,"a",9),Vs("click",function(){return t.onDialogButtonClick()}),Ms(),Ms(),Ms(),Ms(),Ms()),2&e&&(Yo(5),Eu(t.infoTitle),Yo(3),Ts("src",t.imageUrl,Xr),Yo(3),Ou(" ",t.message,""),Yo(1),Ts("text",t.callToAction))},directives:[VG,B_,IW,zG],styles:["[_nghost-%COMP%] .content[_ngcontent-%COMP%]{display:block;align-content:center;padding-left:1.6rem;padding-right:1.6rem;border-radius:.25rem}[_nghost-%COMP%] .info-button-wrapper[_ngcontent-%COMP%]{border-radius:.25rem;padding:.6rem;transition:.6s}[_nghost-%COMP%] .info-button-wrapper[_ngcontent-%COMP%] .ccf-info-button[_ngcontent-%COMP%]{cursor:pointer;transition:color .6s;font-size:1.2rem;vertical-align:sub}[_nghost-%COMP%] .first-row[_ngcontent-%COMP%]{display:flex;width:100%;line-height:.9rem}[_nghost-%COMP%] .first-row[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{padding-right:7rem;padding-left:.2rem;font-size:.875rem;padding-top:.75rem}[_nghost-%COMP%] .first-row[_ngcontent-%COMP%] .cta-mat-icon[_ngcontent-%COMP%]{height:30%;line-height:3.4rem}[_nghost-%COMP%] .message[_ngcontent-%COMP%]{padding:.5rem}[_nghost-%COMP%] .cta-image[_ngcontent-%COMP%]{align-self:center;-o-object-fit:cover;object-fit:cover;width:100%;border-radius:.25rem}[_nghost-%COMP%] .mat-button[_ngcontent-%COMP%]{background-color:#444a65;font-size:.75rem;position:relative;margin-bottom:1rem;width:100%;height:2rem;color:#fff}"],changeDetection:0}),e}(),T$=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(fq(),zf(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(cG.apply(void 0,v(e)),lf(),zf(1))}},{key:"getOption",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n1&&void 0!==arguments[1]?arguments[1]:ff,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:lG;return function(i){return i.lift(new hG(e,t,n.leading,n.trailing))}}(1e3),ce(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)(Zi(bh),Zi(yq))},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({}),e}();function A$(e,t){if(1&e){var n=Ls();As(0,"button",1),Vs("click",function(){return bn(n),Ws().submit(!0)}),Cu(1),Ms()}if(2&e){var i=Ws();Yo(1),Ou(" ","not-set"===i.allowTelemetry?"I understand":"Opt in","\n")}}function M$(e,t){if(1&e){var n=Ls();As(0,"button",1),Vs("click",function(){return bn(n),Ws().submit(!1)}),Cu(1,"Opt out"),Ms()}}var I$=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)(Os(Ju),Os(wq),Os(lw))},e.\u0275cmp=Ot({type:e,selectors:[["ccf-tracking-popup"]],hostVars:2,hostBindings:function(e,t){2&e&&du(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&&(As(0,"p"),Cu(1,"We log usage to improve this service."),Ms(),Cs(2,A$,2,1,"button",0),Cs(3,M$,2,0,"button",0)),2&e&&(Yo(2),Ts("ngIf",t.showButton("opt-in")),Yo(1),Ts("ngIf",t.showButton("opt-out")))},directives:[Yh,q_],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}(),R$=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({imports:[[cd,Y_]]}),e}(),D$=function(e){a(n,e);var t=s(n);function n(){return m(this,n),t.apply(this,arguments)}return b(n,[{key:"forwardCall",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;it?e[0]:void 0,max:e[1]0}),Of(function(e){return function(e,t){return new te(function(n){var i,r;try{i=e()}catch(a){return void n.error(a)}try{r=t(i)}catch(a){return void n.error(a)}var o=(r?ye(r):Mf).subscribe(n);return function(){o.unsubscribe(),i&&i.unsubscribe()}})}(function(){return i.createDatabase(e)},function(t){return i.connectDatabase(t,e)})}),ce(function(e){return e.database}),zf(1)),i}return b(n,[{key:"connectDatabase",value:function(e,t){return Dw(this,void 0,void 0,regeneratorRuntime.mark(function n(){var i;return regeneratorRuntime.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return i=!ah(),n.next=3,e.database.connect(t,i);case 3:return n.abrupt("return",e);case 4:case"end":return n.stop()}},n)}))}}]),n}(D$);return e.\u0275fac=function(t){return new(t||e)(Zi(T$))},e.\u0275prov=$e({token:e,factory:e.\u0275fac}),e}(),G$=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:"createDatabase",value:function(e){return{database:new UY(e),unsubscribe:function(){}}}}]),n}(H$);return t.\u0275fac=function(n){return(e||(e=Ti(t)))(n||t)},t.\u0275prov=$e({token:t,factory:t.\u0275fac,providedIn:"root"}),t}(),W$=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:"createDatabase",value:function(e){var t=this.createWorker(e),n=aK(t);return{database:n,unsubscribe:function(){n[eK](),t.terminate()}}}}]),n}(H$);return t.\u0275fac=function(n){return(e||(e=Ti(t)))(n||t)},t.\u0275prov=$e({token:t,factory:t.\u0275fac}),t}(),q$=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)).impl$=e.config$.pipe(function(e){return e},ce(function(e){return r.selectToken(e)}),lf(),ce(function(e){return i.get(e)}),zf(1)),r}return n}(D$);return e.\u0275fac=function(t){return new(t||e)(Zi(T$),Zi(ss))},e.\u0275prov=$e({token:e,factory:e.\u0275fac}),e}(),X$=function(){var e=function e(){m(this,e)};return e.type="[CallToAction] Learn More",e}(),Y$=function(){var e=function e(){m(this,e)};return e.type="[CallToAction] Open Dialog",e}(),K$=function(){var e=function e(){m(this,e)};return e.type="[CallToAction] Close Dialog",e}(),$$=function(){function e(){m(this,e)}return b(e,[{key:"length",get:function(){var t,n;return null!==(n=null===(t=e.storage)||void 0===t?void 0:t.length)&&void 0!==n?n:0}},{key:"key",value:function(t){var n,i;return null!==(i=null===(n=e.storage)||void 0===n?void 0:n.key(t))&&void 0!==i?i:null}},{key:"getItem",value:function(t,n){var i,r,o;return null!==(o=null!==(r=null===(i=e.storage)||void 0===i?void 0:i.getItem(t))&&void 0!==r?r:n)&&void 0!==o?o:null}},{key:"setItem",value:function(t,n){var i;try{return null===(i=e.storage)||void 0===i||i.setItem(t,n),!0}catch(r){return!1}}},{key:"removeItem",value:function(t){var n;null===(n=e.storage)||void 0===n||n.removeItem(t)}},{key:"clear",value:function(){var t;null===(t=e.storage)||void 0===t||t.clear()}}]),e}();$$.storage=function(){var e;try{e=window.localStorage;var t="__storage_test__";return e.setItem(t,t),e.removeItem(t),e}catch(t){return t instanceof DOMException&&(22===t.code||1014===t.code||"QuotaExceededError"===t.name||"NS_ERROR_DOM_QUOTA_REACHED"===t.name)&&e&&0!==e.length?e:void 0}}(),$$.\u0275fac=function(e){return new(e||$$)},$$.\u0275prov=$e({token:$$,factory:$$.\u0275fac,providedIn:"root"});var Q$="callToActionPopupShown",Z$=z$=function(){function e(t,n,i,r,o){m(this,e),this.dialog=t,this.ga=n,this.storage=i,this.infoService=r,this.http=o}return b(e,[{key:"ngxsOnInit",value:function(e){var t=e.getState(),n=t.expirationDate,i=t.popupShown,r=this.storage.getItem(Q$,"".concat(i)),o=z$.ctaDatePassed(n);"true"!==r&&!o&&e.dispatch(new Y$)}},{key:"getDialogData",value:function(){var e=this;return this.http.get("assets/docs/SPATIAL_SEARCH_README.md",{responseType:"text"}).pipe(ce(function(t){return e.infoService.parseMarkdown(t)}))}},{key:"launchLearnMore",value:function(e){this.dialog.open(k$,{autoFocus:!1,panelClass:"modal-animated",width:"72rem",data:{title:"Spatial Search",content:e,videoID:"UfxMpzatowE"}})}},{key:"learnMore",value:function(e){var t=this;return this.dialog.closeAll(),this.ga.event("open_learn_more","call_to_action"),this.getDialogData().pipe(mv(function(e){return t.launchLearnMore(e)}))}},{key:"open",value:function(e){this.dialog.open(eQ,{autoFocus:!1,panelClass:"modal-animated",width:"30.75rem",height:"36.688rem"}),this.ga.event("open","call_to_action"),this.storage.setItem(Q$,"true"),e.patchState({popupShown:!0})}},{key:"close",value:function(e){this.dialog.closeAll(),this.ga.event("close","call_to_action")}}],[{key:"ctaDatePassed",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Date.now;return+t()>+new Date(e)}}]),e}();Z$.\u0275fac=function(e){return new(e||Z$)(Zi(FG),Zi(yq),Zi($$),Zi(S$),Zi(h_))},Z$.\u0275prov=$e({token:Z$,factory:Z$.\u0275fac}),Mw([jz(X$)],Z$.prototype,"learnMore",null),Mw([jz(Y$)],Z$.prototype,"open",null),Mw([jz(K$)],Z$.prototype,"close",null),Z$=z$=Mw([Fz({name:"callToAction",defaults:{title:"New to the Exploration User Interface",message:"Spatial Search has arrived!",callToAction:"Learn More",imageUrl:"assets/images/spatial_search.gif",expirationDate:"Dec 1, 2022",popupShown:!1}})],Z$);var J$=function(){var e=function(){function e(){m(this,e)}return b(e,null,[{key:"title",value:function(e){return e.title}},{key:"message",value:function(e){return e.message}},{key:"callToAction",value:function(e){return e.callToAction}},{key:"imageUrl",value:function(e){return e.imageUrl}},{key:"expirationDate",value:function(e){return e.expirationDate}},{key:"popupShown",value:function(e){return e.popupShown}}]),e}();return Mw([Vz([Z$])],e,"title",null),Mw([Vz([Z$])],e,"message",null),Mw([Vz([Z$])],e,"callToAction",null),Mw([Vz([Z$])],e,"imageUrl",null),Mw([Vz([Z$])],e,"expirationDate",null),Mw([Vz([Z$])],e,"popupShown",null),e}(),eQ=function(){var e=function e(){m(this,e),this.close=function(){return new K$},this.learnMore=function(){return new X$}};return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=Ot({type:e,selectors:[["ccf-call-to-action-behavior"]],decls:5,vars:12,consts:[[3,"infoTitle","message","callToAction","imageUrl","callToActionClicked","closeClicked"]],template:function(e,t){1&e&&(As(0,"ccf-call-to-action",0),Vs("callToActionClicked",function(){return t.learnMore()})("closeClicked",function(){return t.close()}),Jc(1,"async"),Jc(2,"async"),Jc(3,"async"),Jc(4,"async"),Ms()),2&e&&Ts("infoTitle",el(1,4,t.title$))("message",el(2,6,t.message$))("callToAction",el(3,8,t.callToAction$))("imageUrl",el(4,10,t.imageUrl$))},directives:[O$],pipes:[sd],styles:[""],changeDetection:0}),Mw([Bz(J$.title)],e.prototype,"title$",void 0),Mw([Bz(J$.message)],e.prototype,"message$",void 0),Mw([Bz(J$.callToAction)],e.prototype,"callToAction$",void 0),Mw([Bz(J$.imageUrl)],e.prototype,"imageUrl$",void 0),Mw([TK()],e.prototype,"close",void 0),Mw([TK()],e.prototype,"learnMore",void 0),e}();function tQ(e,t){if(1&e&&(As(0,"div",3),Cu(1),Ms()),2&e){var n=Ws();Yo(1),Ou(" ",n.label,"\n")}}function nQ(e,t){if(1&e){var n=Ls();As(0,"mat-list-item",4),As(1,"div",5),As(2,"mat-checkbox",6),Vs("change",function(e){var t=bn(n).index;return Ws().updateItemSelection(t,e.checked)}),Cu(3),Ms(),Is(4,"div",7),As(5,"button",8),Vs("click",function(){var e=bn(n).index;return Ws().removeItem(e)}),As(6,"mat-icon"),Cu(7,"delete_outlined"),Ms(),Ms(),Ms(),Ms()}if(2&e){var i=t.$implicit;Yo(2),Ts("checked",i.selected),Yo(1),Ou(" ",i.description," ")}}var iQ,rQ=function(){var e=function(){function e(){m(this,e),this.clsName="ccf-spatial-search-list",this.label="",this.items=[],this.selectionChanged=new ol,this.itemRemoved=new ol}return b(e,[{key:"itemId",value:function(e,t){return t.description}},{key:"updateItemSelection",value:function(e,t){var n=this.items=v(this.items);n[e]=Object.assign(Object.assign({},n[e]),{selected:t});var i=n.filter(function(e){return e.selected});this.selectionChanged.emit(i)}},{key:"removeItem",value:function(e){var n=t((this.items=v(this.items)).splice(e,1),1)[0];this.itemRemoved.emit(n)}}]),e}();return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=Ot({type:e,selectors:[["ccf-spatial-search-list"]],hostVars:2,hostBindings:function(e,t){2&e&&du(t.clsName)},inputs:{label:"label",items:"items"},outputs:{selectionChanged:"selectionChanged",itemRemoved:"itemRemoved"},decls:3,vars:3,consts:[["class","label",4,"ngIf"],[1,"list"],["class","item",4,"ngFor","ngForOf","ngForTrackBy"],[1,"label"],[1,"item"],[1,"item-content"],["labelPosition","after",1,"description",3,"checked","change"],[1,"filler"],["mat-icon-button","",1,"delete",3,"click"]],template:function(e,t){1&e&&(Cs(0,tQ,2,1,"div",0),As(1,"mat-list",1),Cs(2,nQ,8,2,"mat-list-item",2),Ms()),2&e&&(Ts("ngIf",t.label),Yo(2),Ts("ngForOf",t.items)("ngForTrackBy",t.itemId))},directives:[Yh,BK,qh,UK,e$,q_,B_],styles:["[_nghost-%COMP%]{display:block}[_nghost-%COMP%] .label[_ngcontent-%COMP%]{margin-bottom:.5rem;font-weight:bold}[_nghost-%COMP%] .item[_ngcontent-%COMP%]{height:2rem}[_nghost-%COMP%] .item[_ngcontent-%COMP%] .item-content[_ngcontent-%COMP%]{display:flex;align-items:center;width:100%;height:2rem}[_nghost-%COMP%] .item[_ngcontent-%COMP%] .item-content[_ngcontent-%COMP%] .delete[_ngcontent-%COMP%]{width:2rem;height:2rem;line-height:2rem}[_nghost-%COMP%] .item[_ngcontent-%COMP%] .item-content[_ngcontent-%COMP%] .filler[_ngcontent-%COMP%]{flex-grow:1}[_nghost-%COMP%] .item[_ngcontent-%COMP%] > *{padding:0!important}"],changeDetection:0}),e}(),oQ=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({imports:[[cd,Y_,n$,V_,HK]]}),e}(),aQ=function(){var e=function e(){m(this,e),this.clsName="ccf-xyz-position",this.x=0,this.y=0,this.z=0,this.format="1.0-2"};return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=Ot({type:e,selectors:[["ccf-xyz-position"]],hostVars:2,hostBindings:function(e,t){2&e&&du(t.clsName)},inputs:{x:"x",y:"y",z:"z"},decls:9,vars:12,consts:[[1,"line"]],template:function(e,t){1&e&&(As(0,"span",0),Cu(1),Jc(2,"number"),Ms(),As(3,"span",0),Cu(4),Jc(5,"number"),Ms(),As(6,"span",0),Cu(7),Jc(8,"number"),Ms()),2&e&&(Yo(1),Ou("X: ",tl(2,3,t.x,t.format),""),Yo(3),Ou("Y: ",tl(5,6,t.y,t.format),""),Yo(3),Ou("Z: ",tl(8,9,t.z,t.format),""))},pipes:[ud],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column}[_nghost-%COMP%] .line[_ngcontent-%COMP%]{font-size:1rem;font-weight:400}"],changeDetection:0}),e}(),sQ=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}(Hp);return n.\u0275fac=function(e){return(t||(t=Ti(n)))(e||n)},n.\u0275prov=$e({token:n,factory:n.\u0275fac,providedIn:"root"}),n}(),uQ=new Ri("Default theme class"),cQ=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(nc,null);if(o){var a=i.nativeElement,s=null===(t=r.get(Hp,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)(Zi(uQ,8))},e.\u0275prov=$e({token:e,factory:e.\u0275fac}),e}(),lQ={initialConfig:{},parse:{},rename:{}},hQ=function(){function e(t,n){m(this,e),this.configState=t,this.storedChanges={},this.options=Object.assign(Object.assign({},lQ),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-1&&(this.count=n-1),t.subscribe(this._unsubscribeAndRecycle())}}}]),i}(K),wQ=function(){var e=function e(t){m(this,e),this.filter=t};return e.type="[DataState] Update filter",e}(),kQ={sex:"Both",ageRange:[1,110],bmiRange:[13,83],tmc:[],technologies:[],ontologyTerms:["http://purl.obolibrary.org/obo/UBERON_0013702"],cellTypeTerms:["http://purl.obolibrary.org/obo/CL_0000000"],spatialSearches:[]},xQ=(function(e){e.Running="running",e.Completed="completed"}(xQ||(xQ={})),xQ);function SQ(e){return function(){return e.next(xQ.Completed)}}function CQ(e,t){return function(n){return n.pipe(Of(e),mv(t),Oq(1),Te())}}var EQ=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.databaseReady$=i.state$.pipe(cG("status"),gQ(),bf(function(e){return"Ready"===e})),i._tissueBlockDataQueryStatus$=new Bf(1),i._aggregateDataQueryStatus$=new Bf(1),i._ontologyTermOccurencesDataQueryStatus$=new Bf(1),i._cellTypeTermOccurencesDataQueryStatus$=new Bf(1),i._sceneDataQueryStatus$=new Bf(1),i._technologyFilterQueryStatus$=new Bf(1),i._providerFilterQueryStatus$=new Bf(1),i.ontologyTermsFullData$=new Bf(1),i.cellTypeTermsFullData$=new Bf(1),i.filter$=i.state$.pipe(cG("filter")),i.tissueBlockData$=i.filter$.pipe(CQ(i.tissueBlockData,SQ(i._tissueBlockDataQueryStatus$))),i.aggregateData$=i.filter$.pipe(CQ(i.aggregateData,SQ(i._aggregateDataQueryStatus$))),i.ontologyTermOccurencesData$=i.filter$.pipe(CQ(i.ontologyTermOccurencesData,SQ(i._ontologyTermOccurencesDataQueryStatus$))),i.cellTypeTermOccurencesData$=i.filter$.pipe(CQ(i.cellTypeTermOccurencesData,SQ(i._cellTypeTermOccurencesDataQueryStatus$))),i.sceneData$=i.filter$.pipe(CQ(i.sceneData,SQ(i._sceneDataQueryStatus$))),i.technologyFilterData$=i.filter$.pipe(CQ(i.technologyFilterData,SQ(i._technologyFilterQueryStatus$))),i.providerFilterData$=i.filter$.pipe(CQ(i.providerFilterData,SQ(i._providerFilterQueryStatus$))),i.tissueBlockDataQueryStatus$=i._tissueBlockDataQueryStatus$.pipe(gQ()),i.aggregateDataQueryStatus$=i._aggregateDataQueryStatus$.pipe(gQ()),i.ontologyTermOccurencesDataQueryStatus$=i._ontologyTermOccurencesDataQueryStatus$.pipe(gQ()),i.cellTypeTermOccurencesDataQueryStatus$=i._cellTypeTermOccurencesDataQueryStatus$.pipe(gQ()),i.sceneDataQueryStatus$=i._sceneDataQueryStatus$.pipe(gQ()),i.technologyFilterQueryStatus$=i._technologyFilterQueryStatus$.pipe(gQ()),i.providerFilterQueryStatus$=i._providerFilterQueryStatus$.pipe(gQ()),i.queryStatus$=J_([i.tissueBlockDataQueryStatus$,i.aggregateDataQueryStatus$,i.ontologyTermOccurencesDataQueryStatus$,i.cellTypeTermOccurencesDataQueryStatus$,i.sceneDataQueryStatus$,i.technologyFilterQueryStatus$,i.providerFilterQueryStatus$]).pipe(ce(function(e){return function(e){return e.every(function(e){return e===xQ.Completed})}(e)?xQ.Completed:xQ.Running}),gQ()),i._tissueBlockDataQueryStatus$.next(xQ.Completed),i._aggregateDataQueryStatus$.next(xQ.Completed),i._ontologyTermOccurencesDataQueryStatus$.next(xQ.Completed),i._cellTypeTermOccurencesDataQueryStatus$.next(xQ.Completed),i._sceneDataQueryStatus$.next(xQ.Completed),i._technologyFilterQueryStatus$.next(xQ.Completed),i._providerFilterQueryStatus$.next(xQ.Completed),i}return b(n,[{key:"ngxsOnInit",value:function(){var e=this,t=this.ontologyTermsFullData$,n=this.ontologyTermOccurencesData$,i=this.cellTypeTermsFullData$,r=this.cellTypeTermOccurencesData$,o=this.source;this.snapshot.filter===kQ?(n.pipe(_p(1)).subscribe(t),r.pipe(_p(1)).subscribe(i)):(o.getOntologyTermOccurences().pipe(_p(1)).subscribe(t),o.getCellTypeTermOccurences().pipe(_p(1)).subscribe(i)),this.source.getOntologyTreeModel().pipe(_p(1)).subscribe(function(t){return e.updateAnatomicalStructuresTreeModel(t)}),this.source.getCellTypeTreeModel().pipe(_p(1)).subscribe(function(t){return e.updateCellTypesTreeModel(t)}),this.warmUpDatabase()}},{key:"warmUpDatabase",value:function(){var e=this;tH(function(){return e.source.getDatabaseStatus()}).pipe(mv(function(t){return e.updateStatus(t)}),NH(2e3),_p(1)).pipe(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;return function(t){return 0===e?If():t.lift(new bQ(e<0?-1:e-1,t))}}(1e3),xp(function(e){return"Loading"===e.status})).subscribe(),this.databaseReady$.pipe(_p(1),mv(function(){e.updateStatus({status:"Ready",message:"Loading CCF Exploration User Interface (EUI)"})})).subscribe()}},{key:"updateAnatomicalStructuresTreeModel",value:function(e){this.ctx.patchState({anatomicalStructuresTreeModel:e})}},{key:"updateCellTypesTreeModel",value:function(e){this.ctx.patchState({cellTypesTreeModel:e})}},{key:"updateStatus",value:function(e){this.ctx.patchState({status:e.status,statusMessage:e.message})}},{key:"updateFilter",value:function(e){this.ctx.patchState({filter:Object.assign(Object.assign({},this.getState().filter),e)})}},{key:"updateFilterHandler",value:function(e,t){var n=t.filter;this.updateFilter(n)}},{key:"tissueBlockData",value:function(e){var t=this;return this._tissueBlockDataQueryStatus$.next(xQ.Running),this.databaseReady$.pipe(Of(function(){return t.source.getTissueBlockResults(e)}))}},{key:"aggregateData",value:function(e){var t=this;return this._aggregateDataQueryStatus$.next(xQ.Running),this.databaseReady$.pipe(Of(function(){return t.source.getAggregateResults(e)}))}},{key:"ontologyTermOccurencesData",value:function(e){var t=this;return this._ontologyTermOccurencesDataQueryStatus$.next(xQ.Running),this.databaseReady$.pipe(Of(function(){return t.source.getOntologyTermOccurences(e)}))}},{key:"cellTypeTermOccurencesData",value:function(e){var t=this;return this._cellTypeTermOccurencesDataQueryStatus$.next(xQ.Running),this.databaseReady$.pipe(Of(function(){return t.source.getCellTypeTermOccurences(e)}))}},{key:"sceneData",value:function(e){var t=this;return this._sceneDataQueryStatus$.next(xQ.Running),this.databaseReady$.pipe(Of(function(){return t.source.getScene(e)}))}},{key:"technologyFilterData",value:function(){var e=this;return this._technologyFilterQueryStatus$.next(xQ.Running),this.databaseReady$.pipe(Of(function(){return e.source.getDatasetTechnologyNames()}))}},{key:"providerFilterData",value:function(){var e=this;return this._providerFilterQueryStatus$.next(xQ.Running),this.databaseReady$.pipe(Of(function(){return e.source.getProviderNames()}))}}]),n}(hq);EQ.\u0275fac=function(e){return new(e||EQ)(Zi(N$))},EQ.\u0275prov=$e({token:EQ,factory:EQ.\u0275fac}),Mw([sq(),Iw(0,uq("treeModel"))],EQ.prototype,"updateAnatomicalStructuresTreeModel",null),Mw([sq(),Iw(0,uq("treeModel"))],EQ.prototype,"updateCellTypesTreeModel",null),Mw([sq(),Iw(0,uq("status"))],EQ.prototype,"updateStatus",null),Mw([sq(),Iw(0,uq("filter"))],EQ.prototype,"updateFilter",null),Mw([jz(wQ)],EQ.prototype,"updateFilterHandler",null),Mw([eV.ak],EQ.prototype,"tissueBlockData",null),Mw([eV.ak],EQ.prototype,"aggregateData",null),Mw([eV.ak],EQ.prototype,"ontologyTermOccurencesData",null),Mw([eV.ak],EQ.prototype,"cellTypeTermOccurencesData",null),Mw([eV.ak],EQ.prototype,"sceneData",null),Mw([eV.ak],EQ.prototype,"technologyFilterData",null),Mw([eV.ak],EQ.prototype,"providerFilterData",null),EQ=Mw([cq(),Fz({name:"data",defaults:{filter:kQ,status:"Loading",statusMessage:"Loading database"}})],EQ);var OQ=function(){function e(){m(this,e)}return b(e,null,[{key:"filter",value:function(e){return e.filter}},{key:"anatomicalStructuresTreeModel",value:function(e){var t;return null!==(t=e.anatomicalStructuresTreeModel)&&void 0!==t?t:{root:"",nodes:{}}}},{key:"cellTypesTreeModel",value:function(e){var t;return null!==(t=e.cellTypesTreeModel)&&void 0!==t?t:{root:"",nodes:{}}}}]),e}();Mw([Vz([EQ])],OQ,"filter",null),Mw([Vz([EQ])],OQ,"anatomicalStructuresTreeModel",null),Mw([Vz([EQ])],OQ,"cellTypesTreeModel",null);var TQ=function(){var e=function e(t,n,i){m(this,e),this.sex=t,this.organName=n,this.search=i};return e.type="[Spatial Search Filter] Add",e}(),PQ=function(){var e=function e(t){m(this,e),this.id=t};return e.type="[Spatial Search Filter] Remove",e}(),AQ=function(){var e=function e(t){m(this,e),this.items=t};return e.type="[Spatial Search Filter] Set selected searches",e}(),MQ=function(){function e(){m(this,e)}return b(e,[{key:"addSearch",value:function(e,t){var n=t.sex,i=t.organName,r=t.search;e.setState(function(e){return function(t){return e&&e.length||!t?Array.isArray(t)?t.concat(e):e:t}}([this.createItem(n,i,r)]))}},{key:"removeSearch",value:function(e,t){var n=t.id;e.setState(function(e){return function(t){var n=-1;if(function(e){return"function"==typeof e}(e)?n=t.findIndex(e):function(e){return"number"==typeof e}(e)&&(n=e),function(e){return Number.isNaN(e)||-1===e}(n))return t;var i=t.slice();return i.splice(n,1),i}}(function(e){return(null==e?void 0:e.id)===n}))}},{key:"setSelectedSearches",value:function(e,t){var n=t.items,i=new Map(n.map(function(e){return[e.id,e]})),r=e.getState().map(function(e){var t;return null!==(t=i.get(e.id))&&void 0!==t?t:e.selected?Object.assign(Object.assign({},e),{selected:!1}):e});e.setState(r)}},{key:"createItem",value:function(e,t,n){return{id:this.createItemId(n),selected:!0,description:this.createItemDescription(e,t,n),sex:e,search:n}}},{key:"createItemId",value:function(e){var t=e.x,n=e.y,i=e.z,r=e.radius,o=e.target;return"".concat(o,"-").concat(r,"-").concat(t,",").concat(n,",").concat(i)}},{key:"createItemDescription",value:function(e,t,n){var i=function(e){return e.slice(0,1).toUpperCase()+e.slice(1)},r=n.x,o=n.y,a=n.z,s=n.radius;return"".concat(i(e),", ").concat(i(t),", ").concat(s.toFixed(1)," mm, X: ").concat(r.toFixed(1),", Y: ").concat(o.toFixed(1),", Z: ").concat(a.toFixed(1))}}]),e}();MQ.\u0275fac=function(e){return new(e||MQ)},MQ.\u0275prov=$e({token:MQ,factory:MQ.\u0275fac}),Mw([jz(TQ)],MQ.prototype,"addSearch",null),Mw([jz(PQ)],MQ.prototype,"removeSearch",null),Mw([jz(AQ)],MQ.prototype,"setSelectedSearches",null),MQ=Mw([Fz({name:"spatialSearchFilter",defaults:[]})],MQ);var IQ=function(){function e(){m(this,e)}return b(e,null,[{key:"items",value:function(e){return e}},{key:"searches",value:function(e){return e.map(function(e){return e.search})}},{key:"selectedSearches",value:function(e){return e.filter(function(e){return e.selected}).map(function(e){return e.search})}}]),e}();Mw([Vz([MQ])],IQ,"items",null),Mw([Vz([IQ.items])],IQ,"searches",null),Mw([Vz([IQ.items])],IQ,"selectedSearches",null);var RQ=new RegExp("[^#a-f\\d]","gi"),DQ=new RegExp("^#?[a-f\\d]{3}[a-f\\d]?$|^#?[a-f\\d]{6}([a-f\\d]{2})?$","i"),NQ=["#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||RQ.test(e)||!DQ.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}}),LQ=function(e){a(n,e);var t=s(n);function n(){var e;return m(this,n),(e=t.apply(this,arguments)).forcedUnassignment=new ae,e.forcedUnassignment$=e.forcedUnassignment.asObservable(),e.colorAssignments$=e.state$.pipe(cG("colorAssignments"),lf()),e.colorAssignmentsList$=e.state$.pipe(cG("colorAssignmentsList"),lf()),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}(dq);LQ.\u0275fac=function(){var e;return function(t){return(e||(e=Ti(LQ)))(t||LQ)}}(),LQ.\u0275prov=$e({token:LQ,factory:LQ.\u0275fac}),Mw([sq(),Iw(0,uq("key")),Iw(1,uq("doReset"))],LQ.prototype,"assignColor",null),Mw([sq(),Iw(0,uq("key"))],LQ.prototype,"unassignColor",null),LQ=Mw([cq(),Fz({name:"colors",defaults:{colorPalette:NQ.concat(),colorsAvailable:NQ.concat(),colorAssignments:{},colorAssignmentsList:[]}})],LQ);var jQ=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(cG("listResults"),lf()),n.highlightedNodeId$=n.state$.pipe(cG("highlightedNodeId"),lf()),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(EQ),this.colorAssignments=this.injector.get(LQ),J_([this.dataState.tissueBlockData$,this.colorAssignments.colorAssignments$]).pipe(ce(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,$q.sortBy)(a,["rank"]).concat(s)}),mv(function(e){return n.setListResults(e)})).subscribe()}}]),r}(dq);jQ.\u0275fac=function(e){return new(e||jQ)(Zi(N$),Zi(ss))},jQ.\u0275prov=$e({token:jQ,factory:jQ.\u0275fac}),Mw([sq(),Iw(0,uq("listResults"))],jQ.prototype,"setListResults",null),jQ=Mw([cq(),Fz({name:"listResults",defaults:{listResults:[]}})],jQ);var FQ=new Set(["Skin","Heart","Kidney","Spleen"]),BQ=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(cG("referenceOrgans"),lf()),n.selectedReferenceOrgans$=n.state$.pipe(cG("selectedReferenceOrgans"),lf()),n.scene$=n.state$.pipe(cG("scene"),lf()),n.highlightedId$=n.state$.pipe(cG("highlightedId"),lf()),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:"setReferenceOrganEntities",value:function(e){this.ctx.patchState({referenceOrganEntities: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(EQ),this.colorAssignments=this.injector.get(LQ),this.listResults=this.injector.get(jQ),this.dataService.getReferenceOrgans().pipe(mv(function(e){return n.setReferenceOrganEntities(e)}),ce(function(e){var t=new Set(e.map(function(e){return e.representation_of}));return f$.filter(function(e){return t.has(e.id)}).map(function(e){return Object.assign(Object.assign({},e),{disabled:!1,numResults:0})})}),_p(1),mv(function(e){n.setReferenceOrgans(e),n.setSelectedReferenceOrgans(e.filter(function(e){return FQ.has(e.organ)}))})).subscribe(),J_([this.dataState.sceneData$,this.selectedReferenceOrgans$,this.colorAssignments.colorAssignments$,this.dataService.getReferenceOrgans(),this.listResults.highlightedNodeId$]).pipe(ce(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})}),mv(function(e){return n.setScene(e)})).subscribe()}}],[{key:"referenceOrgans",value:function(e){return e.referenceOrgans}},{key:"referenceOrganEntities",value:function(e){return e.referenceOrganEntities}}]),r}(dq);function VQ(e,t){if(1&e&&(Xn(),Is(0,"circle",3)),2&e){var n=Ws();uu("animation-name","mat-progress-spinner-stroke-rotate-"+n._spinnerAnimationLabel)("stroke-dashoffset",n._getStrokeDashOffset(),"px")("stroke-dasharray",n._getStrokeCircumference(),"px")("stroke-width",n._getCircleStrokeWidth(),"%"),ks("r",n._getCircleRadius())}}function zQ(e,t){if(1&e&&(Xn(),Is(0,"circle",3)),2&e){var n=Ws();uu("stroke-dashoffset",n._getStrokeDashOffset(),"px")("stroke-dasharray",n._getStrokeCircumference(),"px")("stroke-width",n._getCircleStrokeWidth(),"%"),ks("r",n._getCircleRadius())}}function UQ(e,t){if(1&e&&(Xn(),Is(0,"circle",3)),2&e){var n=Ws();uu("animation-name","mat-progress-spinner-stroke-rotate-"+n._spinnerAnimationLabel)("stroke-dashoffset",n._getStrokeDashOffset(),"px")("stroke-dasharray",n._getStrokeCircumference(),"px")("stroke-width",n._getCircleStrokeWidth(),"%"),ks("r",n._getCircleRadius())}}function HQ(e,t){if(1&e&&(Xn(),Is(0,"circle",3)),2&e){var n=Ws();uu("stroke-dashoffset",n._getStrokeDashOffset(),"px")("stroke-dasharray",n._getStrokeCircumference(),"px")("stroke-width",n._getCircleStrokeWidth(),"%"),ks("r",n._getCircleRadius())}}BQ.\u0275fac=function(e){return new(e||BQ)(Zi(N$),Zi(ss))},BQ.\u0275prov=$e({token:BQ,factory:BQ.\u0275fac}),Mw([sq(),Iw(0,uq("selectedReferenceOrgans"))],BQ.prototype,"setSelectedReferenceOrgans",null),Mw([sq(),Iw(0,uq("referenceOrgans"))],BQ.prototype,"setReferenceOrgans",null),Mw([sq(),Iw(0,uq("referenceOrganEntities"))],BQ.prototype,"setReferenceOrganEntities",null),Mw([sq(),Iw(0,uq("scene"))],BQ.prototype,"setScene",null),Mw([Vz()],BQ,"referenceOrgans",null),Mw([Vz()],BQ,"referenceOrganEntities",null),BQ=Mw([cq(),Fz({name:"scene",defaults:{scene:[],referenceOrgans:[],referenceOrganEntities:[],selectedReferenceOrgans:[],selectedAnatomicalStructures:[],anatomicalStructureSettings:{}}})],BQ);var GQ=".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",WQ=ab(function(){return function e(t){m(this,e),this._elementRef=t}}(),"primary"),qQ=new Ri("mat-progress-spinner-default-options",{providedIn:"root",factory:function(){return{diameter:100}}}),XQ=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=qd(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=qd(e)}},{key:"value",get:function(){return"determinate"===this.mode?this._value:0},set:function(e){this._value=Math.max(0,Math.min(100,qd(e)))}},{key:"ngOnInit",value:function(){var e=this._elementRef.nativeElement;this._styleRoot=Qf(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}(WQ);XQ.\u0275fac=function(e){return new(e||XQ)(Os(Ju),Os(qf),Os(bh,8),Os(Yy,8),Os(qQ))},XQ.\u0275cmp=Ot({type:XQ,selectors:[["mat-progress-spinner"]],hostAttrs:["role","progressbar","tabindex","-1",1,"mat-progress-spinner"],hostVars:10,hostBindings:function(e,t){2&e&&(ks("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),uu("width",t.diameter,"px")("height",t.diameter,"px"),cu("_mat-animation-noopable",t._noopAnimations))},inputs:{color:"color",mode:"mode",diameter:"diameter",strokeWidth:"strokeWidth",value:"value"},exportAs:["matProgressSpinner"],features:[cs],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&&(Xn(),As(0,"svg",0),Cs(1,VQ,1,9,"circle",1),Cs(2,zQ,1,7,"circle",2),Ms()),2&e&&(uu("width",t.diameter,"px")("height",t.diameter,"px"),Ts("ngSwitch","indeterminate"===t.mode),ks("viewBox",t._getViewBox()),Yo(1),Ts("ngSwitchCase",!0),Yo(1),Ts("ngSwitchCase",!1))},directives:[Zh,Jh],styles:[GQ],encapsulation:2,changeDetection:0}),XQ._diameters=new WeakMap;var YQ=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}(XQ);return e.\u0275fac=function(t){return new(t||e)(Os(Ju),Os(qf),Os(bh,8),Os(Yy,8),Os(qQ))},e.\u0275cmp=Ot({type:e,selectors:[["mat-spinner"]],hostAttrs:["role","progressbar","mode","indeterminate",1,"mat-spinner","mat-progress-spinner"],hostVars:6,hostBindings:function(e,t){2&e&&(uu("width",t.diameter,"px")("height",t.diameter,"px"),cu("_mat-animation-noopable",t._noopAnimations))},inputs:{color:"color"},features:[cs],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&&(Xn(),As(0,"svg",0),Cs(1,UQ,1,9,"circle",1),Cs(2,HQ,1,7,"circle",2),Ms()),2&e&&(uu("width",t.diameter,"px")("height",t.diameter,"px"),Ts("ngSwitch","indeterminate"===t.mode),ks("viewBox",t._getViewBox()),Yo(1),Ts("ngSwitchCase",!0),Yo(1),Ts("ngSwitchCase",!1))},directives:[Zh,Jh],styles:[GQ],encapsulation:2,changeDetection:0}),e}(),KQ=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({imports:[[rb,cd],rb]}),e}(),$Q=function(){var e=function e(){m(this,e),this.className="ccf-spinner-overlay",this.active=!1};return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=Ot({type:e,selectors:[["ccf-spinner-overlay"]],hostVars:4,hostBindings:function(e,t){2&e&&(du(t.className),cu("active",t.active))},inputs:{active:"active",text:"text"},decls:3,vars:1,consts:[[1,"content"]],template:function(e,t){1&e&&(Is(0,"mat-spinner"),As(1,"div",0),Cu(2),Ms()),2&e&&(Yo(2),Eu(t.text))},directives:[YQ],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}),e}(),QQ={isolated:!0},ZQ=new Ri("Message service configuration",{providedIn:"root",factory:function(){return QQ}}),JQ=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(bf(function(t){return t.source!==e.source}))}},{key:"getMessagesFromSource",value:function(e){return this.getMessages().pipe(bf(function(t){return t.source===e}))}},{key:"getMessagesFromSources",value:function(e){return this.getMessages().pipe(bf(function(t){return e.includes(t.source)}))}},{key:"nextMessageId",value:function(){return e.counter++}}]),e}();return e.counter=0,e}(),eZ=function(){var e=function(){function e(t,n){var i=this;m(this,e),this.config=t,this.parent=n,this.channel=new ae,this.messages=t.isolated||!n?this.channel.asObservable():ye([this.channel,n.messages.pipe(xp(function(){return!i.channel.closed}))]).pipe(Ce())}return b(e,[{key:"ngOnDestroy",value:function(){this.channel.complete()}},{key:"connect",value:function(e){return new JQ(e,this.channel,this.messages)}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Zi(ZQ),Zi(e,12))},e.\u0275prov=$e({token:e,factory:e.\u0275fac,providedIn:"root"}),e}(),tZ=["*"],nZ=function(){var e=function(){function e(t,n){var i=this;m(this,e),this.className="ccf-drawer-content",this.animationsEnabled=!1,this.leftMargin=0,this.rightMargin=0,this.faded=!1,this.drawers=[],this.subscriptions=new q;var r=t.connect(this).getMessages();this.subscriptions.add(r.subscribe(function(e){i.handleMessage(e)&&n.markForCheck()}))}return b(e,[{key:"ngOnDestroy",value:function(){this.subscriptions.unsubscribe()}},{key:"handleMessage",value:function(e){switch(e.payload.type){case"drawer-containers-changed":return this.drawers=e.payload.drawers,this.updateFaded(),!0;case"drawer-initialized":return this.animationsEnabled=!0,!0;case"drawer-toggled":var t=e.source.position,n=e.payload,i=n.opened,r=n.width,o=n.margin;return this.updateMargin(t,i,r,o),this.updateFaded(),!0;default:return!1}}},{key:"updateMargin",value:function(e,t,n,i){var r=t?n+i:i;"start"===e?this.leftMargin=r:this.rightMargin=r}},{key:"updateFaded",value:function(){var e=t(this.drawers,2),n=e[0],i=e[1];this.faded=(null==n?void 0:n.opened)&&(null==n?void 0:n.expanded)||(null==i?void 0:i.opened)&&(null==i?void 0:i.expanded)}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Os(eZ),Os(Cc))},e.\u0275cmp=Ot({type:e,selectors:[["ccf-drawer-content"]],hostVars:9,hostBindings:function(e,t){2&e&&(Mu("@fadeInOut",t.faded),du(t.className),uu("margin-left",t.leftMargin,"px")("margin-right",t.rightMargin,"px"),cu("cff-drawer-content-animations",t.animationsEnabled))},ngContentSelectors:tZ,decls:1,vars:0,template:function(e,t){1&e&&(Xs(),Ys(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:[fg("fadeInOut",[mg("false",gg({opacity:1})),mg("true",gg({opacity:0})),yg("false <=> true",pg("1s"))])]},changeDetection:0}),e}(),iZ=["*"],rZ={params:{width:0,margin:0,margin2:0}},oZ=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 Dw(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}(),aZ=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 ol(!0),this.expandedChange=new ol(!0),this.stateChange=new ol(!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 oZ,this.subscriptions=new q,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(Wd(e))}},{key:"expanded",get:function(){return this._expanded},set:function(e){this.toggleExpanded(Wd(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 Dw(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)(Os(eZ),Os(Cc),Os(Ju))},e.\u0275cmp=Ot({type:e,selectors:[["ccf-drawer"]],hostVars:10,hostBindings:function(e,t){1&e&&zs("@openClose.done",function(){return t.closeOpenDone()})("@expandCollapse.done",function(){return t.expandCollapseDone()}),2&e&&(Mu("@openClose",t.openedState)("@expandCollapse",t.expandedStateObj),du(t.className),cu("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:iZ,decls:2,vars:0,consts:[[1,"cff-drawer-inner-container"]],template:function(e,t){1&e&&(Xs(),As(0,"div",0),Ys(1),Ms())},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:[fg("openClose",[mg("open, open-instant",gg({transform:"none"})),mg("closed",gg({})),yg("closed => open-instant",pg(0)),yg("closed <=> open, open-instant => closed",pg(".5s ease-in-out"))]),fg("expandCollapse",[mg("collapsed",gg({})),mg("half",gg({width:"calc(50% - {{ margin }}px)"}),rZ),mg("extended",gg({width:"calc(100% - {{ width }}px - {{ margin }}px)"}),rZ),mg("full",gg({width:"calc(100% - {{ margin }}px - {{ margin2 }}px)"}),rZ),yg("* <=> *",pg(".5s ease-in-out"))])]},changeDetection:0}),e}();function sZ(e,t){1&e&&(As(0,"ccf-drawer-content"),Ys(1,2),Ms())}var uZ=[[["ccf-drawer"]],[["ccf-drawer-content"]],"*"],cZ=["ccf-drawer","ccf-drawer-content","*"];function lZ(e){throw new Error("Multiple drawers in position ".concat(e))}var hZ=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 q,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(Ef(null)).subscribe(function(){var t=e.validateDrawers();e.channel.sendMessage({type:"drawer-containers-changed",drawers:t}),e.cdr.markForCheck()}),this.content1.changes.pipe(Ef(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&&lZ("start"),n.length>1&&lZ("end"),[t[0],n[0]]}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Os(eZ),Os(Cc))},e.\u0275cmp=Ot({type:e,selectors:[["ccf-drawer-container"]],contentQueries:function(e,t,n){var i;(1&e&&(bl(n,aZ,5),bl(n,nZ,5)),2&e)&&(ml(i=_l())&&(t.drawers=i),ml(i=_l())&&(t.content1=i))},viewQuery:function(e,t){var n;(1&e&&yl(nZ,5),2&e)&&(ml(n=_l())&&(t.content2=n))},hostVars:2,hostBindings:function(e,t){2&e&&du(t.className)},exportAs:["ccfDrawerContainer"],features:[Xu([eZ])],ngContentSelectors:cZ,decls:3,vars:1,consts:[[4,"ngIf"]],template:function(e,t){1&e&&(Xs(uZ),Ys(0),Ys(1,1),Cs(2,sZ,2,0,"ccf-drawer-content",0)),2&e&&(Yo(2),Ts("ngIf",!t.hasWrappedContent))},directives:[Yh,nZ],styles:["[_nghost-%COMP%]{display:block;position:relative;z-index:1;overflow:hidden;-webkit-overflow-scrolling:touch}"],changeDetection:0}),e}(),dZ=function(){var e=function e(){m(this,e)};return e.type="[SpatialSearchUi] Start the Spatial Search flow",e}(),fZ=function(){var e=function e(t){m(this,e),this.sex=t};return e.type="[SpatialSearchUi] Set sex",e}(),pZ=function(){var e=function e(t){m(this,e),this.organId=t};return e.type="[SpatialSearchUi] Set organ",e}(),vZ=function(){var e=function e(t){m(this,e),this.position=t};return e.type="[SpatialSearchUi] Set position",e}(),gZ=function(){var e=function e(t){m(this,e),this.node=t};return e.type="[SpatialSearchUi] Start moving the position to a scene node",e}(),mZ=function(){var e=function e(){m(this,e)};return e.type="[SpatialSearchUi] Reset position",e}(),yZ=function(){var e=function e(t){m(this,e),this.radius=t};return e.type="[SpatialSearchUi] Set radius",e}(),bZ=function(){var e=function e(){m(this,e)};return e.type="[SpatialSearchUi] Reset radius",e}(),_Z=function(){var e=function e(){m(this,e)};return e.type="[SpatialSearchUi] Update spatial search data",e}(),wZ=function(){var e=function e(){m(this,e)};return e.type="[SpatialSearchUi] Generate and add a spatial search",e}(),kZ=function(){var e=function e(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];m(this,e),this.execute=t};return e.type="[SpatialSearchUi] Set execute search on generate",e}(),xZ=["trigger"],SZ=["panel"];function CZ(e,t){if(1&e&&(As(0,"span",8),Cu(1),Ms()),2&e){var n=Ws();Yo(1),Eu(n.placeholder)}}function EZ(e,t){if(1&e&&(As(0,"span",12),Cu(1),Ms()),2&e){var n=Ws(2);Yo(1),Eu(n.triggerValue)}}function OZ(e,t){1&e&&Ys(0,0,["*ngSwitchCase","true"])}function TZ(e,t){1&e&&(As(0,"span",9),Cs(1,EZ,2,1,"span",10),Cs(2,OZ,1,0,"ng-content",11),Ms()),2&e&&(Ts("ngSwitch",!!Ws().customTrigger),Yo(2),Ts("ngSwitchCase",!0))}function PZ(e,t){if(1&e){var n=Ls();As(0,"div",13),As(1,"div",14,15),Vs("@transformPanel.done",function(e){return bn(n),Ws()._panelDoneAnimatingStream.next(e.toState)})("keydown",function(e){return bn(n),Ws()._handleKeydown(e)}),Ys(3,1),Ms(),Ms()}if(2&e){var i=Ws();Ts("@transformPanelWrap",void 0),Yo(1),Pu("mat-select-panel ",i._getPanelTheme(),""),uu("transform-origin",i._transformOrigin)("font-size",i._triggerFontSize,"px"),Ts("ngClass",i.panelClass)("@transformPanel",i.multiple?"showing-multiple":"showing"),ks("id",i.id+"-panel")("aria-multiselectable",i.multiple)("aria-label",i.ariaLabel||null)("aria-labelledby",i._getPanelAriaLabelledby())}}var AZ=[[["mat-select-trigger"]],"*"],MZ=["mat-select-trigger","*"],IZ={transformPanelWrap:fg("transformPanelWrap",[yg("* => 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:fg("transformPanel",[mg("void",gg({transform:"scaleY(0.8)",minWidth:"100%",opacity:0})),mg("showing",gg({opacity:1,minWidth:"calc(100% + 32px)",transform:"scaleY(1)"})),mg("showing-multiple",gg({opacity:1,minWidth:"calc(100% + 64px)",transform:"scaleY(1)"})),yg("void => *",pg("120ms cubic-bezier(0, 0, 0.2, 1)")),yg("* => void",pg("100ms 25ms linear",gg({opacity:0})))])},RZ=0,DZ=new Ri("mat-select-scroll-strategy"),NZ=new Ri("MAT_SELECT_CONFIG"),LZ={provide:DZ,deps:[iv],useFactory:function(e){return function(){return e.scrollStrategies.reposition()}}},jZ=function e(t,n){m(this,e),this.source=t,this.value=n},FZ=sb(ub(ob(cb(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}}())))),BZ=new Ri("MatSelectTrigger"),VZ=function(){var e=function(e){a(n,e);var t=s(n);function n(e,i,r,o,a,s,u,l,h,d,f,p,g,y){var b,_,w,k;return m(this,n),(b=t.call(this,a,o,u,l,d))._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-"+RZ++,b._triggerAriaLabelledBy=null,b._destroy=new ae,b._onChange=function(){},b._onTouched=function(){},b._valueId="mat-select-value-"+RZ++,b._panelDoneAnimatingStream=new ae,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=tH(function(){var e=b.options;return e?e.changes.pipe(Ef(e),Of(function(){return Oe.apply(void 0,v(e.map(function(e){return e.onSelectionChange})))})):b._ngZone.onStable.pipe(_p(1),Of(function(){return b.optionSelectionChanges}))}),b.openedChange=new ol,b._openedStream=b.openedChange.pipe(bf(function(e){return e}),ce(function(){})),b._closedStream=b.openedChange.pipe(bf(function(e){return!e}),ce(function(){})),b.selectionChange=new ol,b.valueChange=new ol,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(f)||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=Wd(e),this.stateChanges.next()}},{key:"multiple",get:function(){return this._multiple},set:function(e){this._multiple=Wd(e)}},{key:"disableOptionCentering",get:function(){return this._disableOptionCentering},set:function(e){this._disableOptionCentering=Wd(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=qd(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 ip(this.multiple),this.stateChanges.next(),this._panelDoneAnimatingStream.pipe(lf(),kf(this._destroy)).subscribe(function(){return e._panelDoneAnimating(e.panelOpen)})}},{key:"ngAfterContentInit",value:function(){var e=this;this._initKeyManager(),this._selectionModel.changed.pipe(kf(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(Ef(null),kf(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&&!Ep(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||Ep(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(_p(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 zv(this.options).withTypeAhead(this._typeaheadDebounceInterval).withVerticalOrientation().withHorizontalOrientation(this._isRtl()?"rtl":"ltr").withHomeAndEnd().withAllowedModifierKeys(["shiftKey"]),this._keyManager.tabOut.pipe(kf(this._destroy)).subscribe(function(){e.panelOpen&&(!e.multiple&&e._keyManager.activeItem&&e._keyManager.activeItem._selectViaInteraction(),e.focus(),e.close())}),this._keyManager.change.pipe(kf(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=Oe(this.options.changes,this._destroy);this.optionSelectionChanges.pipe(kf(t)).subscribe(function(t){e._onSelect(t.source,t.isUserInput),t.isUserInput&&!e.multiple&&e._panelOpen&&(e.close(),e.focus())}),Oe.apply(void 0,v(this.options.map(function(e){return e._stateChanges}))).pipe(kf(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}(FZ);return e.\u0275fac=function(t){return new(t||e)(Os(ap),Os(Cc),Os(Xl),Os(lb),Os(Ju),Os(tp,8),Os(zU,8),Os(QU,8),Os(IH,8),Os(hU,10),Ai("tabindex"),Os(DZ),Os(tg),Os(NZ,8))},e.\u0275dir=Rt({type:e,viewQuery:function(e,t){var n;(1&e&&(yl(xZ,5),yl(SZ,5),yl(sv,5)),2&e)&&(ml(n=_l())&&(t.trigger=n.first),ml(n=_l())&&(t.panel=n.first),ml(n=_l())&&(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:[cs,qt]}),e}(),zZ=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(kf(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(_p(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=Db(e,this.options,this.optionGroups),n=this._getItemHeight();this.panel.nativeElement.scrollTop=0===e&&1===t?0:Nb((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 jZ(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+=Db(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}(VZ);return n.\u0275fac=function(e){return(t||(t=Ti(n)))(e||n)},n.\u0275cmp=Ot({type:n,selectors:[["mat-select"]],contentQueries:function(e,t,n){var i;(1&e&&(bl(n,BZ,5),bl(n,Rb,5),bl(n,Pb,5)),2&e)&&(ml(i=_l())&&(t.customTrigger=i.first),ml(i=_l())&&(t.options=i),ml(i=_l())&&(t.optionGroups=i))},hostAttrs:["role","combobox","aria-autocomplete","none","aria-haspopup","true",1,"mat-select"],hostVars:20,hostBindings:function(e,t){1&e&&Vs("keydown",function(e){return t._handleKeydown(e)})("focus",function(){return t._onFocus()})("blur",function(){return t._onBlur()}),2&e&&(ks("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()),cu("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:[Xu([{provide:wH,useExisting:n},{provide:Cb,useExisting:n}]),cs],ngContentSelectors:MZ,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&&(Xs(AZ),As(0,"div",0,1),Vs("click",function(){return t.toggle()}),As(3,"div",2),Cs(4,CZ,2,1,"span",3),Cs(5,TZ,3,2,"span",4),Ms(),As(6,"div",5),Is(7,"div",6),Ms(),Ms(),Cs(8,PZ,4,14,"ng-template",7),Vs("backdropClick",function(){return t.close()})("attach",function(){return t._onAttached()})("detach",function(){return t.close()})),2&e){var n=Es(1);ks("aria-owns",t.panelOpen?t.id+"-panel":null),Yo(3),Ts("ngSwitch",t.empty),ks("id",t._valueId),Yo(1),Ts("ngSwitchCase",!0),Yo(1),Ts("ngSwitchCase",!1),Yo(3),Ts("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:[av,Zh,Jh,sv,ed,Gh],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:[IZ.transformPanelWrap,IZ.transformPanel]},changeDetection:0}),n}(),UZ=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({providers:[LZ],imports:[[cd,cv,Lb,rb],sp,DH,Lb,rb]}),e}();function HZ(e,t){if(1&e&&(As(0,"mat-option",6),As(1,"div"),Cu(2),Ms(),Ms()),2&e){var n=t.$implicit,i=Ws();Ts("value",n),Yo(1),du(i.optionsVisible),Yo(1),Ou(" ",n," ")}}var GZ=function(){var e=function(){function e(t){m(this,e),this.ga=t,this.selectionChange=new ol,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)(Os(yq))},e.\u0275cmp=Ot({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&&(As(0,"div",0),As(1,"div",1),As(2,"mat-form-field",2),As(3,"div",3),Cu(4),Ms(),As(5,"mat-select",4),Vs("selectionChange",function(e){return t.selectionChanged(e.value)})("openedChange",function(){return t.toggleOptions()}),Cs(6,HZ,3,5,"mat-option",5),Ms(),Ms(),Ms(),Ms()),2&e&&(Yo(4),Ou(" ",t.label," "),Yo(1),Ts("value",t.selection),Yo(1),Ts("ngForOf",t.options))},directives:[RH,zZ,qh,Rb],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}(),WZ=r(25430),qZ=r(39053),XZ=r(26202),YZ=["tooltipTemplate"],KZ=["leftOuterSelectionBar"],$Z=["rightOuterSelectionBar"],QZ=["fullBar"],ZZ=["selectionBar"],JZ=["minHandle"],eJ=["maxHandle"],tJ=["floorLabel"],nJ=["ceilLabel"],iJ=["minHandleLabel"],rJ=["maxHandleLabel"],oJ=["combinedLabel"],aJ=["ticksElement"];function sJ(e,t){if(1&e&&Is(0,"ng5-slider-tooltip-wrapper",31),2&e){var n=Ws().$implicit;Ts("template",Ws().tooltipTemplate)("tooltip",n.valueTooltip)("placement",n.valueTooltipPlacement)("content",n.value)}}function uJ(e,t){1&e&&Is(0,"span",32),2&e&&Ts("innerHTML",Ws().$implicit.legend,qr)}var cJ=function(e){return{"ng5-slider-selected":e}};function lJ(e,t){if(1&e&&(As(0,"span",27),Is(1,"ng5-slider-tooltip-wrapper",28),Cs(2,sJ,1,4,"ng5-slider-tooltip-wrapper",29),Cs(3,uJ,1,1,"span",30),Ms()),2&e){var n=t.$implicit,i=Ws();Ts("ngClass",$c(7,cJ,n.selected))("ngStyle",n.style),Yo(1),Ts("template",i.tooltipTemplate)("tooltip",n.tooltip)("placement",n.tooltipPlacement),Yo(1),Ts("ngIf",null!=n.value),Yo(1),Ts("ngIf",null!=n.legend)}}function hJ(e,t){}function dJ(e,t){1&e&&Cs(0,hJ,0,0,"ng-template")}var fJ=function(e,t,n){return{tooltip:e,placement:t,content:n}};function pJ(e,t){if(1&e&&(Rs(0),Cs(1,dJ,1,0,void 0,1),Ds()),2&e){var n=Ws();Yo(1),Ts("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=ws(e,t,n,i);return _s(e,t+2,r)||o}(e,u,r,o,a)?bs(e,u+3,s?i.call(s,r,o,a):i(r,o,a)):Qc(e,u+3)}(mn(),On(),e,t,n,i,r,o)}(2,fJ,n.tooltip,n.placement,n.content))}}function vJ(e,t){if(1&e&&(Rs(0),As(1,"div",2),Cu(2),Ms(),Ds()),2&e){var n=Ws();Yo(1),ks("title",n.tooltip)("data-tooltip-placement",n.placement),Yo(1),Ou(" ",n.content," ")}}var gJ={Min:0,Max:1};gJ[gJ.Min]="Min",gJ[gJ.Max]="Max";var mJ={Low:0,High:1,Floor:2,Ceil:3,TickValue:4};mJ[mJ.Low]="Low",mJ[mJ.High]="High",mJ[mJ.Floor]="Floor",mJ[mJ.Ceil]="Ceil",mJ[mJ.TickValue]="TickValue";var yJ=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},bJ=function e(){m(this,e)},_J=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}(CJ);return e.\u0275fac=function(t){return new(t||e)(Os(Ju),Os(nc),Os(Cc))},e.\u0275dir=Rt({type:e,selectors:[["","ng5SliderLabel",""]],features:[cs]}),e}(),TJ=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},PJ=function e(){m(this,e),this.active=!1,this.value=0,this.difference=0,this.position=0,this.lowLimit=0,this.highLimit=0},AJ=function(){function e(){m(this,e)}return b(e,null,[{key:"compare",value:function(e,t){return!(_J.isNullOrUndefined(e)&&_J.isNullOrUndefined(t)||_J.isNullOrUndefined(e)!==_J.isNullOrUndefined(t))&&e.value===t.value&&e.highValue===t.highValue}}]),e}(),MJ=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!(_J.isNullOrUndefined(e)&&_J.isNullOrUndefined(t)||_J.isNullOrUndefined(e)!==_J.isNullOrUndefined(t))&&e.value===t.value&&e.highValue===t.highValue&&e.forceChange===t.forceChange}}]),n}(AJ),IJ={provide:Hz,useExisting:He(function(){return RJ}),multi:!0},RJ=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 ol,this.highValue=null,this.highValueChange=new ol,this.options=new yJ,this.userChangeStart=new ol,this.userChange=new ol,this.userChangeEnd=new ol,this.initHasRun=!1,this.inputModelChangeSubject=new WZ.xQ,this.inputModelChangeSubscription=null,this.outputModelChangeSubject=new WZ.xQ,this.outputModelChangeSubscription=null,this.viewLowValue=null,this.viewHighValue=null,this.viewOptions=new yJ,this.handleHalfDimension=0,this.maxHandlePosition=0,this.currentTrackingPointer=null,this.currentFocusPointer=null,this.firstKeyDown=!1,this.touchId=null,this.dragging=new PJ,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 SJ(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!_J.isNullOrUndefined(this.value)&&!_J.isNullOrUndefined(this.highValue)}},{key:"showTicks",get:function(){return this.viewOptions.showTicks}},{key:"ngOnInit",value:function(){this.viewOptions=new yJ,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){_J.isNullOrUndefined(e.options)||this.onChangeOptions(),(!_J.isNullOrUndefined(e.value)||!_J.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,qZ.distinctUntilChanged)(MJ.compare),(0,qZ.filter)(function(e){return!e.forceChange&&!e.internalChange}),_J.isNullOrUndefined(e)?(0,qZ.tap)(function(){}):(0,qZ.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,qZ.distinctUntilChanged)(MJ.compare),_J.isNullOrUndefined(e)?(0,qZ.tap)(function(){}):(0,qZ.throttleTime)(e,void 0,{leading:!0,trailing:!0})).subscribe(function(e){return t.publishOutputModelChange(e)})}},{key:"subscribeResizeObserver",value:function(){var e=this;wJ.isResizeObserverAvailable()&&(this.resizeObserver=new ResizeObserver(function(){return e.calculateViewDimensionsAndDetectChanges()}),this.resizeObserver.observe(this.elementRef.nativeElement))}},{key:"unsubscribeResizeObserver",value:function(){wJ.isResizeObserverAvailable()&&null!==this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)}},{key:"unsubscribeOnMove",value:function(){_J.isNullOrUndefined(this.onMoveEventListener)||(this.eventListenerHelper.detachEventListener(this.onMoveEventListener),this.onMoveEventListener=null)}},{key:"unsubscribeOnEnd",value:function(){_J.isNullOrUndefined(this.onEndEventListener)||(this.eventListenerHelper.detachEventListener(this.onEndEventListener),this.onEndEventListener=null)}},{key:"unsubscribeInputModelChangeSubject",value:function(){_J.isNullOrUndefined(this.inputModelChangeSubscription)||(this.inputModelChangeSubscription.unsubscribe(),this.inputModelChangeSubscription=null)}},{key:"unsubscribeOutputModelChangeSubject",value:function(){_J.isNullOrUndefined(this.outputModelChangeSubscription)||(this.outputModelChangeSubscription.unsubscribe(),this.outputModelChangeSubscription=null)}},{key:"unsubscribeManualRefresh",value:function(){_J.isNullOrUndefined(this.manualRefreshSubscription)||(this.manualRefreshSubscription.unsubscribe(),this.manualRefreshSubscription=null)}},{key:"unsubscribeTriggerFocus",value:function(){_J.isNullOrUndefined(this.triggerFocusSubscription)||(this.triggerFocusSubscription.unsubscribe(),this.triggerFocusSubscription=null)}},{key:"getPointerElement",value:function(e){return e===gJ.Min?this.minHandleElement:e===gJ.Max?this.maxHandleElement:null}},{key:"getCurrentTrackingValue",value:function(){return this.currentTrackingPointer===gJ.Min?this.viewLowValue:this.currentTrackingPointer===gJ.Max?this.viewHighValue:null}},{key:"modelValueToViewValue",value:function(e){return _J.isNullOrUndefined(e)?NaN:_J.isNullOrUndefined(this.viewOptions.stepsArray)||this.viewOptions.bindIndexForStepsArray?+e:_J.findStepIndex(+e,this.viewOptions.stepsArray)}},{key:"viewValueToModelValue",value:function(e){return _J.isNullOrUndefined(this.viewOptions.stepsArray)||this.viewOptions.bindIndexForStepsArray?e:this.getStepValue(e)}},{key:"getStepValue",value:function(e){var t=this.viewOptions.stepsArray[e];return _J.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=!AJ.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),_J.isNullOrUndefined(t.onChangeCallback)||t.onChangeCallback(t.range?[e.value,e.highValue]:e.value),_J.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 AJ;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))),!_J.isNullOrUndefined(this.viewOptions.stepsArray)||!this.viewOptions.enforceRange)return t;if(t.value=kJ.clampToRange(t.value,this.viewOptions.floor,this.viewOptions.ceil),this.range&&(t.highValue=kJ.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);AJ.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 yJ,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||!_J.isNullOrUndefined(this.viewOptions.ticksArray),this.viewOptions.showTicks&&(!_J.isNullOrUndefined(this.viewOptions.tickStep)||!_J.isNullOrUndefined(this.viewOptions.ticksArray))&&(this.intermediateTicks=!0),this.viewOptions.showSelectionBar=this.viewOptions.showSelectionBar||this.viewOptions.showSelectionBarEnd||!_J.isNullOrUndefined(this.viewOptions.showSelectionBarFromValue),_J.isNullOrUndefined(this.viewOptions.stepsArray)?this.applyFloorCeilOptions():this.applyStepsArrayOptions(),_J.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,_J.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(_J.isNullOrUndefined(this.viewOptions.step)?this.viewOptions.step=1:(this.viewOptions.step=+this.viewOptions.step,this.viewOptions.step<=0&&(this.viewOptions.step=1)),_J.isNullOrUndefined(this.viewOptions.ceil)||_J.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,_J.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!==gJ.Min&&e!==gJ.Max&&(e=gJ.Min),e===gJ.Min?this.minHandleElement.focus():this.range&&e===gJ.Max&&this.maxHandleElement.focus()}},{key:"refocusPointerIfNeeded",value:function(){_J.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;_J.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"),_J.isNullOrUndefined(this.viewOptions.ariaLabel)?_J.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",_J.isNullOrUndefined(this.viewOptions.ariaLabelHigh)?_J.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,mJ.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,mJ.High),this.maxHandleElement.ariaValueMin=this.viewOptions.floor.toString(),this.maxHandleElement.ariaValueMax=this.viewOptions.ceil.toString())}},{key:"calculateViewDimensions",value:function(){_J.isNullOrUndefined(this.viewOptions.handleDimension)?this.minHandleElement.calculateDimension():this.minHandleElement.setDimension(this.viewOptions.handleDimension);var e=this.minHandleElement.dimension;this.handleHalfDimension=e/2,_J.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=_J.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 TJ;if(o.selected=e.isTickSelected(t),o.style={"-webkit-transform":r,"-moz-transform":r,"-o-transform":r,"-ms-transform":r,transform:r},o.selected&&!_J.isNullOrUndefined(e.viewOptions.getSelectionBarColor)&&(o.style["background-color"]=e.getSelectionBarColor()),!o.selected&&!_J.isNullOrUndefined(e.viewOptions.getTickColor)&&(o.style["background-color"]=e.getTickColor(t)),_J.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,mJ.TickValue),_J.isNullOrUndefined(e.viewOptions.ticksValuesTooltip)||(o.valueTooltip=e.viewOptions.ticksValuesTooltip(t),o.valueTooltipPlacement=e.viewOptions.vertical?"right":"top")),!_J.isNullOrUndefined(e.viewOptions.getLegend)){var a=e.viewOptions.getLegend(t);_J.isNullOrUndefined(a)||(o.legend=a)}return o});if(_J.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,mJ.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,mJ.Ceil)),this.ceilLabelElement.calculateDimension(),this.ceilLabelElement.setPosition(this.viewOptions.rightToLeft?0:this.fullBarElement.dimension-this.ceilLabelElement.dimension))}},{key:"updateHandles",value:function(e,t){e===gJ.Min?this.updateLowHandle(t):e===gJ.Max&&this.updateHighHandle(t),this.updateSelectionBar(),this.updateTicksScale(),this.range&&this.updateCombinedLabel()}},{key:"getHandleLabelPos",value:function(e,t){var n=e===gJ.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===gJ.Min||!this.viewOptions.rightToLeft&&e===gJ.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,mJ.Low)),this.minHandleLabelElement.setPosition(this.getHandleLabelPos(gJ.Min,e)),_J.isNullOrUndefined(this.viewOptions.getPointerColor)||(this.minPointerStyle={backgroundColor:this.getPointerColor(gJ.Min)}),this.viewOptions.autoHideLimitLabels&&this.updateFloorAndCeilLabelsVisibility()}},{key:"updateHighHandle",value:function(e){this.maxHandleElement.setPosition(e),this.maxHandleLabelElement.setValue(this.getDisplayValue(this.viewHighValue,mJ.High)),this.maxHandleLabelElement.setPosition(this.getHandleLabelPos(gJ.Max,e)),_J.isNullOrUndefined(this.viewOptions.getPointerColor)||(this.maxPointerStyle={backgroundColor:this.getPointerColor(gJ.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(_J.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))),_J.isNullOrUndefined(this.viewOptions.getSelectionBarColor)){if(!_J.isNullOrUndefined(this.viewOptions.selectionBarGradient)){var a=_J.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===gJ.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,mJ.Low),t=this.getDisplayValue(this.viewHighValue,mJ.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!_J.isNullOrUndefined(this.viewOptions.stepsArray)&&!this.viewOptions.bindIndexForStepsArray&&(e=this.getStepValue(e)),this.viewOptions.translate(e,t)}},{key:"roundStep",value:function(e,t){var n=_J.isNullOrUndefined(t)?this.viewOptions.step:t,i=kJ.roundToPrecisionLimit((e-this.viewOptions.floor)/n,this.viewOptions.precisionLimit);return i=Math.round(i)*n,kJ.roundToPrecisionLimit(this.viewOptions.floor+i,this.viewOptions.precisionLimit)}},{key:"valueToPosition",value:function(e){var t=_J.linearValueToPosition;_J.isNullOrUndefined(this.viewOptions.customValueToPosition)?this.viewOptions.logScale&&(t=_J.logValueToPosition):t=this.viewOptions.customValueToPosition;var n=t(e=kJ.clampToRange(e,this.viewOptions.floor,this.viewOptions.ceil),this.viewOptions.floor,this.viewOptions.ceil);return _J.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=_J.linearPositionToValue;_J.isNullOrUndefined(this.viewOptions.customPositionToValue)?this.viewOptions.logScale&&(n=_J.logPositionToValue):n=this.viewOptions.customPositionToValue;var i=n(t,this.viewOptions.floor,this.viewOptions.ceil);return _J.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(!_J.isNullOrUndefined(t))for(var r=0;ri?gJ.Max:this.viewOptions.rightToLeft?t>this.minHandleElement.position?gJ.Min:gJ.Max:t=this.maxHandlePosition?o=this.viewOptions.rightToLeft?this.viewOptions.floor:this.viewOptions.ceil:(o=this.positionToValue(a),o=t&&!_J.isNullOrUndefined(this.viewOptions.tickStep)?this.roundStep(o,this.viewOptions.tickStep):this.roundStep(o)),this.positionTrackingHandle(o)}},{key:"onEnd",value:function(e){wJ.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,_J.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=_J.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(!_J.isNullOrUndefined(i)&&!_J.isNullOrUndefined(this.currentTrackingPointer)){e.preventDefault(),this.firstKeyDown&&(this.firstKeyDown=!1,this.userChangeStart.emit(this.getChangeContext()));var r=kJ.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===gJ.Min?(a=o,(s=o+u)>this.viewOptions.ceil&&(a=(s=this.viewOptions.ceil)-u)):this.currentTrackingPointer===gJ.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){!_J.isNullOrUndefined(this.viewOptions.minLimit)&&ethis.viewOptions.maxLimit&&(e=kJ.roundToPrecisionLimit((t=this.viewOptions.maxLimit)-this.dragging.difference,this.viewOptions.precisionLimit)),this.viewLowValue=e,this.viewHighValue=t,this.applyViewChange(),this.updateHandles(gJ.Min,this.valueToPosition(e)),this.updateHandles(gJ.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===gJ.Min&&e>this.viewHighValue?e=this.applyMinMaxRange(this.viewHighValue):this.currentTrackingPointer===gJ.Max&&ethis.viewHighValue?(this.viewLowValue=this.viewHighValue,this.applyViewChange(),this.updateHandles(gJ.Min,this.maxHandleElement.position),this.updateAriaAttributes(),this.currentTrackingPointer=gJ.Max,this.minHandleElement.active=!1,this.maxHandleElement.active=!0,this.viewOptions.keyboardSupport&&this.maxHandleElement.focus()):this.currentTrackingPointer===gJ.Max&&ethis.viewOptions.maxLimit?this.viewOptions.maxLimit:e}},{key:"applyMinMaxRange",value:function(e){var t=Math.abs(e-(this.currentTrackingPointer===gJ.Min?this.viewHighValue:this.viewLowValue));if(!_J.isNullOrUndefined(this.viewOptions.minRange)&&tthis.viewOptions.maxRange){if(this.currentTrackingPointer===gJ.Min)return kJ.roundToPrecisionLimit(this.viewHighValue-this.viewOptions.maxRange,this.viewOptions.precisionLimit);if(this.currentTrackingPointer===gJ.Max)return kJ.roundToPrecisionLimit(this.viewLowValue+this.viewOptions.maxRange,this.viewOptions.precisionLimit)}return e}},{key:"applyPushRange",value:function(e){var t=this.currentTrackingPointer===gJ.Min?this.viewHighValue-e:e-this.viewLowValue,n=_J.isNullOrUndefined(this.viewOptions.minRange)?this.viewOptions.step:this.viewOptions.minRange,i=this.viewOptions.maxRange;return ti&&(this.currentTrackingPointer===gJ.Min?(this.viewHighValue=kJ.roundToPrecisionLimit(e+i,this.viewOptions.precisionLimit),this.applyViewChange(),this.updateHandles(gJ.Max,this.valueToPosition(this.viewHighValue))):this.currentTrackingPointer===gJ.Max&&(this.viewLowValue=kJ.roundToPrecisionLimit(e-i,this.viewOptions.precisionLimit),this.applyViewChange(),this.updateHandles(gJ.Min,this.valueToPosition(this.viewLowValue))),this.updateAriaAttributes()),e}},{key:"getChangeContext",value:function(){var e=new bJ;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)(Os(nc),Os(Ju),Os(Cc),Os(Xl))},e.\u0275cmp=Ot({type:e,selectors:[["ng5-slider"]],contentQueries:function(e,t,n){var i;(1&e&&bl(n,YZ,5),2&e)&&(ml(i=_l())&&(t.tooltipTemplate=i.first))},viewQuery:function(e,t){var n;(1&e&&(yl(KZ,5,CJ),yl($Z,5,CJ),yl(QZ,5,CJ),yl(ZZ,5,CJ),yl(JZ,5,EJ),yl(eJ,5,EJ),yl(tJ,5,OJ),yl(nJ,5,OJ),yl(iJ,5,OJ),yl(rJ,5,OJ),yl(oJ,5,OJ),yl(aJ,5,CJ)),2&e)&&(ml(n=_l())&&(t.leftOuterSelectionBarElement=n.first),ml(n=_l())&&(t.rightOuterSelectionBarElement=n.first),ml(n=_l())&&(t.fullBarElement=n.first),ml(n=_l())&&(t.selectionBarElement=n.first),ml(n=_l())&&(t.minHandleElement=n.first),ml(n=_l())&&(t.maxHandleElement=n.first),ml(n=_l())&&(t.floorLabelElement=n.first),ml(n=_l())&&(t.ceilLabelElement=n.first),ml(n=_l())&&(t.minHandleLabelElement=n.first),ml(n=_l())&&(t.maxHandleLabelElement=n.first),ml(n=_l())&&(t.combinedLabelElement=n.first),ml(n=_l())&&(t.ticksElement=n.first))},hostAttrs:[1,"ng5-slider"],hostVars:5,hostBindings:function(e,t){1&e&&Vs("resize",function(e){return t.onResize(e)},!1,io),2&e&&(ks("disabled",t.sliderElementDisabledAttr),cu("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:[Xu([IJ]),qt],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&&(As(0,"span",0,1),Is(2,"span",2),Ms(),As(3,"span",3,4),Is(5,"span",2),Ms(),As(6,"span",5,6),Is(8,"span",2),Ms(),As(9,"span",7,8),Is(11,"span",9),Ms(),Is(12,"span",10,11),Is(14,"span",12,13),Is(16,"span",14,15),Is(18,"span",16,17),Is(20,"span",18,19),Is(22,"span",20,21),Is(24,"span",22,23),As(26,"span",24,25),Cs(28,lJ,4,9,"span",26),Ms()),2&e&&(Yo(6),cu("ng5-slider-transparent",t.fullBarTransparentClass),Yo(3),cu("ng5-slider-draggable",t.selectionBarDraggableClass),Yo(2),Ts("ngStyle",t.barStyle),Yo(1),Ts("ngStyle",t.minPointerStyle),Yo(2),uu("display",t.range?"inherit":"none"),Ts("ngStyle",t.maxPointerStyle),Yo(12),cu("ng5-slider-ticks-values-under",t.ticksUnderValuesClass),Ts("hidden",!t.showTicks),Yo(2),Ts("ngForOf",t.ticks))},directives:function(){return[CJ,td,EJ,OJ,qh,Gh,DJ,Yh]},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}(),DJ=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=Ot({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&&(Cs(0,pJ,2,6,"ng-container",0),Cs(1,vJ,3,3,"ng-container",0)),2&e&&(Ts("ngIf",t.template),Yo(1),Ts("ngIf",!t.template))},directives:[Yh,nd],styles:[".ng5-slider-inner-tooltip[_ngcontent-%COMP%]{height:100%}"]}),e}(),NJ=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({imports:[[cd]]}),e}(),LJ=["popover"];function jJ(e,t){if(1&e){var n=Ls();As(0,"div",7,8),As(2,"div"),As(3,"div",9),Cu(4),Ms(),As(5,"input",10),Vs("keyup",function(e){return bn(n),Ws().onKeyLow(e)}),Ms(),Ms(),As(6,"ng5-slider",11),Vs("valueChange",function(e){return bn(n),Ws().lowValue=e})("highValueChange",function(e){return bn(n),Ws().highValue=e})("userChangeEnd",function(){return bn(n),Ws().sliderValueChanged()}),Ms(),As(7,"div"),As(8,"div",12),Cu(9),Ms(),As(10,"input",13),Vs("keyup",function(e){return bn(n),Ws().onKeyHigh(e)}),Ms(),Ms(),Ms()}if(2&e){var i=Ws();Yo(2),Pu("label min fade-in ",i.contentsVisible,""),Yo(2),Ou(" ",i.options.floor,"> "),Yo(1),Ks("value",i.lowValue),Yo(1),Pu("slider fade-in ",i.contentsVisible,""),Ts("options",i.options)("value",i.lowValue)("highValue",i.highValue),Yo(1),Pu("label max fade-in ",i.contentsVisible,""),Yo(2),Ou(" ",i.options.ceil," "),Yo(1),Ks("value",i.highValue)}}var FJ=function(){var e=function(){function e(t,n,i){m(this,e),this.element=n,this.ga=i,this.selectionChange=new ol,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)(Os(iv),Os(Ju),Os(yq))},e.\u0275cmp=Ot({type:e,selectors:[["ccf-dual-slider"]],viewQuery:function(e,t){var n;(1&e&&(yl(vp,7),yl(LJ,5,Ju)),2&e)&&(ml(n=_l())&&(t.popoverPortal=n.first),ml(n=_l())&&(t.popoverElement=n.first))},hostBindings:function(e,t){1&e&&Vs("click",function(e){return t.closeSliderPopover(e.target)},!1,ro)("touchstart",function(e){return t.closeSliderPopover(e.target)},!1,ro)},inputs:{label:"label",valueRange:"valueRange",selection:"selection"},outputs:{selectionChange:"selectionChange"},features:[qt],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&&(As(0,"div",0),As(1,"div",1),Cs(2,jJ,11,16,"div",2),As(3,"mat-form-field",3),Vs("click",function(){return t.toggleSliderPopover()}),As(4,"div",4),As(5,"span",5),Cu(6),Ms(),As(7,"span",6),Cu(8),Ms(),Ms(),Is(9,"mat-select"),Ms(),Ms(),Ms()),2&e&&(Yo(3),cu("highlight",t.isSliderOpen),Yo(3),Eu(t.label),Yo(2),Eu(t.rangeLabel))},directives:[gp,RH,zZ,RJ],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 BJ(e,t){if(1&e){var n=Ls();As(0,"div",4),As(1,"mat-checkbox",5),Vs("change",function(e){var t=bn(n).$implicit;return Ws().filterOnChange(e,t)}),Cu(2),Ms(),Ms()}if(2&e){var i=t.$implicit,r=Ws();Yo(1),Ts("checked",null==r.selection?null:r.selection.includes(i)),Yo(1),Ou(" ",i," ")}}var VJ,zJ=function(){var e=function(){function e(t){m(this,e),this.ga=t,this.selection=[],this.columns=3,this.selectionChange=new ol}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)(Os(yq))},e.\u0275cmp=Ot({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&&(As(0,"div",0),As(1,"div",1),Cu(2),Ms(),As(3,"div",2),Cs(4,BJ,3,2,"div",3),Ms(),Ms()),2&e&&(Yo(2),Eu(t.label),Yo(1),cu("three",3===t.columns)("four",4===t.columns),Yo(1),Ts("ngForOf",t.options))},directives:[qh,e$],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%}"],changeDetection:0}),e}(),UJ=function(){var e=function e(){m(this,e)};return e.type="[SpatialSearchUi] Really update spatial search data",e}(),HJ=VJ=function(){function e(t,n,i,r){m(this,e),this.dataSource=t,this.store=n,this.ga=r,i.pipe(sz(_Z),_v(500),mv(function(){return n.dispatch(UJ)})).subscribe()}return b(e,[{key:"startSpatialSearchFlow",value:function(e){var t=e.getState(),n=t.sex,i=t.organId,r=null==i?void 0:i.split("/").slice(-1)[0];return this.ga.event("set_organ","spatial_search_ui","".concat(n,"_").concat(r)),e.dispatch(new fZ(n))}},{key:"setSex",value:function(e,t){var n=t.sex,i=e.getState().organId;e.patchState({sex:n}),this.ga.event("set_sex","spatial_search_ui",n),void 0!==i&&!this.organValidForSex(i,n)&&(i=void 0);var r=Object.assign(Object.assign({},this.store.selectSnapshot(OQ.filter)),{spatialSearches:[]}),o=this.store.selectSnapshot(BQ.referenceOrgans);return this.dataSource.getOntologyTermOccurences(r).pipe(_p(1),mv(function(t){e.patchState({referenceOrgans:o.filter(function(e){return e.id&&!e.disabled&&t[e.id]>0})}),e.dispatch(new pZ(i))}))}},{key:"setOrgan",value:function(e,t){var n=t.organId,i=e.getState().sex;e.patchState({sex:i,organId:n});var r=null==n?void 0:n.split("/").slice(-1)[0];this.ga.event("set_organ","spatial_search_ui",r);var o=this.store.selectSnapshot(VJ.organEntity);if(o&&n&&o.sex){var a=o.x_dimension,s=o.y_dimension,u=o.z_dimension,c={x:Math.round(a/2),y:Math.round(s/2),z:Math.round(u/2)},l=Math.round(.07*Math.max(a,s,u)),h=this.store.selectSnapshot(OQ.filter),d=Object.assign(Object.assign({},h),{sex:o.sex,ontologyTerms:[n],spatialSearches:[]});return this.dataSource.getReferenceOrganScene(n,d).pipe(_p(1),mv(function(t){e.patchState({position:c,radius:l,defaultPosition:c,radiusSettings:{min:Math.min(l,5),max:Math.floor(Math.max(a,s,u)/1.5),defaultValue:l},organScene:QY(o).concat(t)})}),ke(function(){return e.dispatch(new _Z)}))}}},{key:"setPosition",value:function(e,t){var n=t.position;e.patchState({position:n}),e.dispatch(new _Z);var i=n.x,r=n.y,o=n.z;this.ga.event("set_position","spatial_search_ui","".concat(i,"_").concat(r,"_").concat(o))}},{key:"resetPosition",value:function(e){var t=e.getState().defaultPosition;e.patchState({position:t}),e.dispatch(new _Z);var n=null!=t?t:{x:0,y:0,z:0},i=n.x,r=n.y,o=n.z;this.ga.event("reset_position","spatial_search_ui","".concat(i,"_").concat(r,"_").concat(o))}},{key:"moveToNode",value:function(e,n){var i=n.node,r=t(new $O(i.transformMatrix).getTranslation().map(function(e){return Math.round(1e3*e)}),3),o=r[0],a=r[1],s=r[2];return e.dispatch(new vZ({x:o,y:a,z:s}))}},{key:"setRadius",value:function(e,t){var n=t.radius;e.patchState({radius:n}),e.dispatch(new _Z),this.ga.event("set_radius","spatial_search_ui",n.toFixed(1))}},{key:"resetRadius",value:function(e){var t,n=e.getState().radiusSettings,i=null!==(t=null==n?void 0:n.defaultValue)&&void 0!==t?t:0;e.patchState({radius:i}),e.dispatch(new _Z),this.ga.event("reset_radius","spatial_search_ui",i.toFixed(1))}},{key:"updateSpatialSearch",value:function(e){var t=e.getState(),n=t.position,i=t.radius,r=this.store.selectSnapshot(VJ.organEntity);if(r&&n&&i&&r.representation_of){var o=this.dataSource,a=r.representation_of,s=this.store.selectSnapshot(OQ.filter),u=Object.assign(Object.assign({},s),{sex:r.sex,ontologyTerms:[a],spatialSearches:[Object.assign(Object.assign({},n),{radius:i,target:r["@id"]})]});return jb({spatialSearchScene:o.getReferenceOrganScene(a,u).pipe(_p(1)),tissueBlocks:o.getTissueBlockResults(u).pipe(_p(1)),anatomicalStructures:o.getOntologyTermOccurences(u).pipe(_p(1)),cellTypes:o.getCellTypeTermOccurences(u).pipe(_p(1))}).pipe(mv(function(t){return e.patchState(t)}))}}},{key:"generateSpatialSearch",value:function(e){var t=e.getState(),n=t.position,i=t.radius,r=t.sex,o=t.organId,a=t.referenceOrgans,s=void 0===a?[]:a,u=t.executeSearchOnGeneration,c=this.store.selectSnapshot(VJ.organEntity),l=s.find(function(e){return e.id===o});if(n&&i&&(null==c?void 0:c.representation_of)&&l){var h=Object.assign(Object.assign({},n),{radius:i,target:c["@id"]}),d=[new TQ(r,l.name,h)];if(u){var f=this.store.selectSnapshot(IQ.selectedSearches);d.push(new wQ({spatialSearches:f.concat(h)}))}return this.ga.event("generate_search","spatial_search_ui"),e.dispatch(d).pipe(mv(function(){return e.patchState({sex:"female",organId:void 0})}))}}},{key:"setExecuteSearchOnGenerate",value:function(e,t){var n=t.execute;e.patchState({executeSearchOnGeneration:n})}},{key:"organValidForSex",value:function(e,t){var n=this.store.selectSnapshot(BQ.referenceOrgans).find(function(t){return t.id===e});return n.hasSex||n.sex===t}}],[{key:"organEntity",value:function(e,t){var n=e.organId,i=e.sex;return t.find(function(e){var t;return e.representation_of===n&&(null===(t=e.sex)||void 0===t?void 0:t.toLowerCase())===i})}}]),e}();HJ.\u0275fac=function(e){return new(e||HJ)(Zi(N$),Zi(Pz),Zi(fz),Zi(yq))},HJ.\u0275prov=$e({token:HJ,factory:HJ.\u0275fac}),Mw([jz(dZ)],HJ.prototype,"startSpatialSearchFlow",null),Mw([jz(fZ)],HJ.prototype,"setSex",null),Mw([jz(pZ)],HJ.prototype,"setOrgan",null),Mw([jz(vZ)],HJ.prototype,"setPosition",null),Mw([jz(mZ)],HJ.prototype,"resetPosition",null),Mw([jz(gZ)],HJ.prototype,"moveToNode",null),Mw([jz(yZ)],HJ.prototype,"setRadius",null),Mw([jz(bZ)],HJ.prototype,"resetRadius",null),Mw([jz(UJ)],HJ.prototype,"updateSpatialSearch",null),Mw([jz(wZ)],HJ.prototype,"generateSpatialSearch",null),Mw([jz(kZ)],HJ.prototype,"setExecuteSearchOnGenerate",null),Mw([Vz([VJ,BQ.referenceOrganEntities])],HJ,"organEntity",null),HJ=VJ=Mw([Fz({name:"spatialSearchUi",defaults:{sex:"female",executeSearchOnGeneration:!0}})],HJ);var GJ=function(){function e(){m(this,e)}return b(e,null,[{key:"sex",value:function(e){return e.sex}},{key:"referenceOrgans",value:function(e){var t;return null!==(t=e.referenceOrgans)&&void 0!==t?t:[]}},{key:"organId",value:function(e){return e.organId}},{key:"organ",value:function(e,t){if(void 0!==e)return t.find(function(t){return t.id===e})}},{key:"organs",value:function(e,t){var n=this;return t.filter(function(t){return n.organMatchesSex(t,e)})}},{key:"organMatchesSex",value:function(e,t){return e.hasSex||e.sex===t}},{key:"position",value:function(e){var t;return null!==(t=e.position)&&void 0!==t?t:{x:0,y:0,z:0}}},{key:"defaultPosition",value:function(e){var t;return null!==(t=e.defaultPosition)&&void 0!==t?t:{x:0,y:0,z:0}}},{key:"radius",value:function(e){var t;return null!==(t=e.radius)&&void 0!==t?t:0}},{key:"radiusSettings",value:function(e){var t;return null!==(t=e.radiusSettings)&&void 0!==t?t:{min:0,max:0,defaultValue:0}}},{key:"scene",value:function(e,t,n,i){var r,o,a=function(e,t){var n,i=e.x_dimension/1e3,r=e.y_dimension/1e3,o=e.z_dimension/1e3,a=.07*Math.max(i,r,o),s=.05*a,u=2*a,c=4*s;return t=t?Object.assign(Object.assign({},t),{radius:t.radius/1e3,x:t.x/1e3,y:t.y/1e3,z:t.z/1e3}):{target:null!==(n=e.representation_of)&&void 0!==n?n:e["@id"],radius:a,x:i/2,y:r/2,z:o/2},[{"@id":"http://purl.org/ccf/latest/ccf.owl#ProbingSphere","@type":"SpatialSceneNode",unpickable:!1,geometry:"sphere",transformMatrix:new $O($O.IDENTITY).translate([t.x,t.y,t.z]).scale(t.radius),color:HY},{"@id":"http://purl.org/ccf/latest/ccf.owl#ProbingsphereXD","@type":"SpatialSceneNode",unpickable:!0,geometry:"cylinder",transformMatrix:new $O($O.IDENTITY).translate([t.x+t.radius+u/2,t.y,t.z]).rotateZ(cS(-90)).scale([s,u,s]),color:GY},{"@id":"http://purl.org/ccf/latest/ccf.owl#ProbingsphereXDCone","@type":"SpatialSceneNode",unpickable:!0,geometry:"cone",transformMatrix:new $O($O.IDENTITY).translate([t.x+t.radius+u,t.y,t.z]).rotateZ(cS(-90)).scale([c,3*c,c]),color:GY},{"@id":"http://purl.org/ccf/latest/ccf.owl#ProbingsphereXDLabel","@type":"SpatialSceneNode",unpickable:!0,geometry:"text",text:"D",transformMatrix:new $O($O.IDENTITY).translate([t.x+t.radius+u+3*c,t.y,t.z]).scale(c),color:GY},{"@id":"http://purl.org/ccf/latest/ccf.owl#ProbingsphereXA","@type":"SpatialSceneNode",unpickable:!0,geometry:"cylinder",transformMatrix:new $O($O.IDENTITY).translate([t.x-t.radius-u/2,t.y,t.z]).rotateZ(cS(-90)).scale([s,u,s]),color:GY},{"@id":"http://purl.org/ccf/latest/ccf.owl#ProbingsphereXACone","@type":"SpatialSceneNode",unpickable:!0,geometry:"cone",transformMatrix:new $O($O.IDENTITY).translate([t.x-t.radius-u,t.y,t.z]).rotateZ(cS(90)).scale([c,3*c,c]),color:GY},{"@id":"http://purl.org/ccf/latest/ccf.owl#ProbingsphereXALabel","@type":"SpatialSceneNode",unpickable:!0,geometry:"text",text:"A",transformMatrix:new $O($O.IDENTITY).translate([t.x-t.radius-u-3.5*c,t.y,t.z]).scale(c),color:GY},{"@id":"http://purl.org/ccf/latest/ccf.owl#ProbingsphereYW","@type":"SpatialSceneNode",unpickable:!0,geometry:"cylinder",transformMatrix:new $O($O.IDENTITY).translate([t.x,t.y+t.radius+u/2,t.z]).scale([s,u,s]),color:WY},{"@id":"http://purl.org/ccf/latest/ccf.owl#ProbingsphereYWCone","@type":"SpatialSceneNode",unpickable:!0,geometry:"cone",transformMatrix:new $O($O.IDENTITY).translate([t.x,t.y+t.radius+u,t.z]).scale([c,3*c,c]),color:WY},{"@id":"http://purl.org/ccf/latest/ccf.owl#ProbingsphereYWLabel","@type":"SpatialSceneNode",unpickable:!0,geometry:"text",text:"W",transformMatrix:new $O($O.IDENTITY).translate([t.x,t.y+t.radius+u+3*c,t.z]).scale(c),color:WY},{"@id":"http://purl.org/ccf/latest/ccf.owl#ProbingsphereYS","@type":"SpatialSceneNode",unpickable:!0,geometry:"cylinder",transformMatrix:new $O($O.IDENTITY).translate([t.x,t.y-t.radius-u/2,t.z]).scale([s,u,s]),color:WY},{"@id":"http://purl.org/ccf/latest/ccf.owl#ProbingsphereYSCone","@type":"SpatialSceneNode",unpickable:!0,geometry:"cone",transformMatrix:new $O($O.IDENTITY).translate([t.x,t.y-t.radius-u,t.z]).rotateZ(cS(180)).scale([c,3*c,c]),color:WY},{"@id":"http://purl.org/ccf/latest/ccf.owl#ProbingsphereYSLabel","@type":"SpatialSceneNode",unpickable:!0,geometry:"text",text:"S",transformMatrix:new $O($O.IDENTITY).translate([t.x,t.y-t.radius-u-3.5*c,t.z]).scale(c),color:WY},{"@id":"http://purl.org/ccf/latest/ccf.owl#ProbingsphereZE","@type":"SpatialSceneNode",unpickable:!0,geometry:"cylinder",transformMatrix:new $O($O.IDENTITY).translate([t.x,t.y,t.z+t.radius+u/2]).rotateX(cS(90)).scale([s,u,s]),color:qY},{"@id":"http://purl.org/ccf/latest/ccf.owl#ProbingsphereZECone","@type":"SpatialSceneNode",unpickable:!0,geometry:"cone",transformMatrix:new $O($O.IDENTITY).translate([t.x,t.y,t.z+t.radius+u]).rotateX(cS(90)).scale([c,3*c,c]),color:qY},{"@id":"http://purl.org/ccf/latest/ccf.owl#ProbingsphereZELabel","@type":"SpatialSceneNode",unpickable:!0,geometry:"text",text:"E",transformMatrix:new $O($O.IDENTITY).translate([t.x,t.y,t.z+t.radius+u+3*c]).scale(c),color:qY},{"@id":"http://purl.org/ccf/latest/ccf.owl#ProbingsphereZQ","@type":"SpatialSceneNode",unpickable:!0,geometry:"cylinder",transformMatrix:new $O($O.IDENTITY).translate([t.x,t.y,t.z-t.radius-u/2]).rotateX(cS(-90)).scale([s,u,s]),color:qY},{"@id":"http://purl.org/ccf/latest/ccf.owl#ProbingsphereZQCone","@type":"SpatialSceneNode",unpickable:!0,geometry:"cone",transformMatrix:new $O($O.IDENTITY).translate([t.x,t.y,t.z-t.radius-u]).rotateX(cS(-90)).scale([c,3*c,c]),color:qY},{"@id":"http://purl.org/ccf/latest/ccf.owl#ProbingsphereZQLabel","@type":"SpatialSceneNode",unpickable:!0,geometry:"text",text:"Q",transformMatrix:new $O($O.IDENTITY).translate([t.x,t.y,t.z-t.radius-u-3.5*c]).scale(c),color:qY}]}(t,Object.assign(Object.assign({},n),{radius:i,target:t["@id"]})),s=new Set((null!==(r=e.tissueBlocks)&&void 0!==r?r:[]).map(function(e){return e.spatialEntityId}));return(null!==(o=e.organScene)&&void 0!==o?o:[]).map(function(e){return s.has(e["@id"])&&(e=Object.assign(Object.assign({},e),{color:[41,121,255,229.5]})),e}).concat(a)}},{key:"sceneBounds",value:function(e){var t=e.x_dimension,n=e.y_dimension,i=e.z_dimension,r=.42*Math.max(t,n,i);return{x:(r+t)/1e3,y:(r+n)/1e3,z:(r+i)/1e3}}},{key:"sceneTarget",value:function(e){return[e.x_dimension/1e3/2,e.y_dimension/1e3/2,e.z_dimension/1e3/2]}},{key:"tissueBlocks",value:function(e){var t;return null!==(t=e.tissueBlocks)&&void 0!==t?t:[]}},{key:"anatomicalStructures",value:function(e,t){return this.getTermCounts(e.anatomicalStructures,t)}},{key:"cellTypes",value:function(e,t){return this.getTermCounts(e.cellTypes,t)}},{key:"getTermCounts",value:function(e,n){return Object.entries(null!=e?e:{}).filter(function(e){var n=t(e,2);n[0];return n[1]>0}).map(function(e){var i,r,o=t(e,2),a=o[0],s=o[1];return{"@id":a,label:null!==(r=null===(i=n.nodes[a])||void 0===i?void 0:i.label)&&void 0!==r?r:a.split("/").slice(-1)[0],count:s}})}}]),e}();function WJ(e,t){if(1&e&&(As(0,"div",6),As(1,"mat-icon",7),Cu(2,"person"),Ms(),As(3,"div",8),As(4,"div",9),Cu(5),Ms(),As(6,"div",9),Cu(7),Ms(),Ms(),Ms()),2&e){var n=t.$implicit;Yo(5),Eu(n.donor.label),Yo(2),Eu(n.donor.description)}}GJ.organEntity=HJ.organEntity,Mw([Vz([HJ])],GJ,"sex",null),Mw([Vz([HJ])],GJ,"referenceOrgans",null),Mw([Vz([HJ])],GJ,"organId",null),Mw([Vz([GJ.organId,GJ.referenceOrgans])],GJ,"organ",null),Mw([Vz([GJ.sex,GJ.referenceOrgans])],GJ,"organs",null),Mw([Vz([HJ])],GJ,"position",null),Mw([Vz([HJ])],GJ,"defaultPosition",null),Mw([Vz([HJ])],GJ,"radius",null),Mw([Vz([HJ])],GJ,"radiusSettings",null),Mw([Vz([HJ,HJ.organEntity,GJ.position,GJ.radius])],GJ,"scene",null),Mw([Vz([HJ.organEntity])],GJ,"sceneBounds",null),Mw([Vz([HJ.organEntity])],GJ,"sceneTarget",null),Mw([Vz([HJ])],GJ,"tissueBlocks",null),Mw([Vz([HJ,OQ.anatomicalStructuresTreeModel])],GJ,"anatomicalStructures",null),Mw([Vz([HJ,OQ.cellTypesTreeModel])],GJ,"cellTypes",null);var qJ=function(){var e=function e(){m(this,e),this.className="ccf-tissue-block-list",this.tissueBlocks=[]};return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=Ot({type:e,selectors:[["ccf-tissue-block-list"]],hostVars:2,hostBindings:function(e,t){2&e&&du(t.className)},inputs:{tissueBlocks:"tissueBlocks"},decls:8,vars:2,consts:[[1,"tissue-block-header"],[1,"title"],["mat-icon-button","",1,"info"],["matTooltip","Total quantity of registered Tissue Blocks detected by the Probing Sphere","matTooltipPosition","right"],[1,"tissue-list"],["class","donor",4,"ngFor","ngForOf"],[1,"donor"],[1,"icon"],[1,"donor-info"],[1,"description"]],template:function(e,t){1&e&&(As(0,"div",0),As(1,"div",1),Cu(2),Ms(),As(3,"button",2),As(4,"mat-icon",3),Cu(5,"info"),Ms(),Ms(),Ms(),As(6,"div",4),Cs(7,WJ,8,2,"div",5),Ms()),2&e&&(Yo(2),Ou("",t.tissueBlocks.length," Tissue Blocks"),Yo(5),Ts("ngForOf",t.tissueBlocks))},directives:[B_,Ow,qh],styles:["[_nghost-%COMP%] .tissue-block-header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;margin-bottom:1rem}[_nghost-%COMP%] .tissue-block-header[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-size:.875rem}[_nghost-%COMP%] .tissue-block-header[_ngcontent-%COMP%] .info[_ngcontent-%COMP%]{padding:0;background:none;border:none;outline:none;border-radius:.25rem;transition:.6s}[_nghost-%COMP%] .tissue-list[_ngcontent-%COMP%]{overflow:auto}[_nghost-%COMP%] .donor[_ngcontent-%COMP%]{min-height:3rem;display:flex;font-size:.75rem;line-height:1rem;align-items:center;flex-grow:1;height:2.5rem;width:22rem;padding:.5rem;box-shadow:0 3px 6px #00000029;cursor:pointer;margin-right:1rem;margin-bottom:.5rem}[_nghost-%COMP%] .donor[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{margin-right:.5rem}[_nghost-%COMP%] .donor[_ngcontent-%COMP%] .donor-info[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-weight:600}[_nghost-%COMP%] .donor[_ngcontent-%COMP%] .donor-info[_ngcontent-%COMP%] .description[_ngcontent-%COMP%]{width:17rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}"],changeDetection:0}),e}();function XJ(e,t){if(1&e&&(As(0,"div",6),As(1,"div",7),As(2,"div",8),Cu(3),Ms(),As(4,"div",8),Cu(5),Ms(),Ms(),Ms()),2&e){var n=t.$implicit;Yo(3),Eu(n.label),Yo(2),Eu(n.count)}}var YJ=function(){var e=function e(){m(this,e),this.className="ccf-term-occurrence-list",this.termList=[]};return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=Ot({type:e,selectors:[["ccf-term-occurrence-list"]],hostVars:2,hostBindings:function(e,t){2&e&&du(t.className)},inputs:{termList:"termList",title:"title",toolTipText:"toolTipText"},decls:8,vars:4,consts:[[1,"term-list-header"],[1,"title"],["mat-icon-button","",1,"info"],["matTooltipPosition","right",3,"matTooltip"],[1,"term-list"],["class","donor",4,"ngFor","ngForOf"],[1,"donor"],[1,"term-bloc"],[1,"term-line"]],template:function(e,t){1&e&&(As(0,"div",0),As(1,"div",1),Cu(2),Ms(),As(3,"button",2),As(4,"mat-icon",3),Cu(5,"info"),Ms(),Ms(),Ms(),As(6,"div",4),Cs(7,XJ,6,2,"div",5),Ms()),2&e&&(Yo(2),Tu("",t.termList.length," ",t.title,""),Yo(2),Ks("matTooltip",t.toolTipText),Yo(3),Ts("ngForOf",t.termList))},directives:[B_,Ow,qh],styles:["[_nghost-%COMP%]{padding-top:1rem}[_nghost-%COMP%] .term-list-header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;margin-bottom:1rem}[_nghost-%COMP%] .term-list-header[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-size:.875rem}[_nghost-%COMP%] .term-list-header[_ngcontent-%COMP%] .counter[_ngcontent-%COMP%]{font-size:1rem}[_nghost-%COMP%] .term-list-header[_ngcontent-%COMP%] .info[_ngcontent-%COMP%]{padding-right:0;background:none;border:none;outline:none;border-radius:.25rem;transition:.6s}[_nghost-%COMP%] .term-list[_ngcontent-%COMP%]{overflow:auto;padding-left:2rem;font-size:1rem}[_nghost-%COMP%] .term-list[_ngcontent-%COMP%] .term-bloc[_ngcontent-%COMP%]{display:flex;justify-content:space-between;margin-bottom:1rem;overflow:auto}[_nghost-%COMP%] .term-list[_ngcontent-%COMP%] .term-line[_ngcontent-%COMP%]{padding-right:2rem}"],changeDetection:0}),e}();function KJ(e,t){if(1&e&&(As(0,"mat-icon",8),Cu(1),Ms()),2&e){var n=t.$implicit;cu("active",Ws().currentKey===n.key),Yo(1),Ou("",n.direction," ")}}function $J(e,t){1&e&&(As(0,"div",9),Cu(1,"SHIFT"),Ms())}var QJ=function(){var e=function e(){m(this,e),this.className="ccf-spatial-search-keyboard-ui",this.keyClicked=new ol,this.keyHovered=new ol,this.keyMap=[{key:"w",direction:"north"},{key:"s",direction:"south"},{key:"a",direction:"west"},{key:"d",direction:"east"},{key:"e",direction:"north_east"},{key:"q",direction:"south_west"}]};return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=Ot({type:e,selectors:[["ccf-spatial-search-keyboard-ui"]],hostVars:2,hostBindings:function(e,t){2&e&&du(t.className)},inputs:{currentKey:"currentKey",shiftPressed:"shiftPressed"},outputs:{keyClicked:"keyClicked",keyHovered:"keyHovered"},decls:18,vars:14,consts:[[1,"direction-arrow"],["class","arrow",3,"active",4,"ngFor","ngForOf"],[1,"keys"],[1,"keyrow"],[1,"key","blue",3,"mousedown","mouseover","mouseout"],[1,"key","green",3,"mousedown","mouseover","mouseout"],[1,"key","red",3,"mousedown","mouseover","mouseout"],["class","shift",4,"ngIf"],[1,"arrow"],[1,"shift"]],template:function(e,t){1&e&&(As(0,"div",0),Cs(1,KJ,2,3,"mat-icon",1),Ms(),As(2,"div",2),As(3,"div",3),As(4,"div",4),Vs("mousedown",function(){return t.keyClicked.emit("q")})("mouseover",function(){return t.keyHovered.emit("q")})("mouseout",function(){return t.keyHovered.emit()}),Cu(5,"Q"),Ms(),As(6,"div",5),Vs("mousedown",function(){return t.keyClicked.emit("w")})("mouseover",function(){return t.keyHovered.emit("w")})("mouseout",function(){return t.keyHovered.emit()}),Cu(7,"W"),Ms(),As(8,"div",4),Vs("mousedown",function(){return t.keyClicked.emit("e")})("mouseover",function(){return t.keyHovered.emit("e")})("mouseout",function(){return t.keyHovered.emit()}),Cu(9,"E"),Ms(),Ms(),As(10,"div",3),As(11,"div",6),Vs("mousedown",function(){return t.keyClicked.emit("a")})("mouseover",function(){return t.keyHovered.emit("a")})("mouseout",function(){return t.keyHovered.emit()}),Cu(12,"A"),Ms(),As(13,"div",5),Vs("mousedown",function(){return t.keyClicked.emit("s")})("mouseover",function(){return t.keyHovered.emit("s")})("mouseout",function(){return t.keyHovered.emit()}),Cu(14,"S"),Ms(),As(15,"div",6),Vs("mousedown",function(){return t.keyClicked.emit("d")})("mouseover",function(){return t.keyHovered.emit("d")})("mouseout",function(){return t.keyHovered.emit()}),Cu(16,"D"),Ms(),Ms(),Cs(17,$J,2,0,"div",7),Ms()),2&e&&(Yo(1),Ts("ngForOf",t.keyMap),Yo(3),cu("highlighted","q"===t.currentKey),Yo(2),cu("highlighted","w"===t.currentKey),Yo(2),cu("highlighted","e"===t.currentKey),Yo(3),cu("highlighted","a"===t.currentKey),Yo(2),cu("highlighted","s"===t.currentKey),Yo(2),cu("highlighted","d"===t.currentKey),Yo(2),Ts("ngIf",t.shiftPressed))},directives:[qh,Yh,B_],styles:["[_nghost-%COMP%] .direction-arrow[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(5,.5fr);grid-template-rows:1fr;grid-column-gap:0px;grid-row-gap:0px;margin-bottom:1rem;width:7rem}[_nghost-%COMP%] .direction-arrow[_ngcontent-%COMP%] .arrow[_ngcontent-%COMP%]{grid-area:1/3/2/4;opacity:0;transition:.5s}[_nghost-%COMP%] .direction-arrow[_ngcontent-%COMP%] .arrow.active[_ngcontent-%COMP%]{opacity:1}[_nghost-%COMP%] .keys[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:flex-start;padding:0;grid-gap:.5rem;gap:.5rem;width:7rem;height:7rem;-webkit-user-select:none;-moz-user-select:none;user-select:none}[_nghost-%COMP%] .keys[_ngcontent-%COMP%] .keyrow[_ngcontent-%COMP%]{display:flex;flex-direction:row;justify-content:center;align-items:center;padding:0;grid-gap:.5rem;gap:.5rem}[_nghost-%COMP%] .keys[_ngcontent-%COMP%] .keyrow[_ngcontent-%COMP%] .key[_ngcontent-%COMP%]{display:flex;flex-direction:column;justify-content:center;align-items:center;padding:.25rem;width:2rem;height:2rem;border:2px solid;border-radius:.5rem;cursor:pointer}[_nghost-%COMP%] .keys[_ngcontent-%COMP%] .shift[_ngcontent-%COMP%]{display:flex;flex-direction:column;justify-content:center;align-items:center;padding:.25rem;width:7rem;height:2rem;border:2px solid;border-radius:.5rem}"],changeDetection:0}),e}(),ZJ=function(){var e=function(){function e(){m(this,e),this.className="ccf-spatial-search-keyboard-ui-behavior",this.delta=1,this.shiftDelta=2,this.changePosition=new ol,this.shiftPressed=!1}return b(e,[{key:"updatePosition",value:function(e){if(this.currentDelta=this.shiftPressed?this.shiftDelta:this.delta,"Shift"===e)this.shiftPressed=!0;else{switch(this.currentKey=e.toLowerCase(),this.currentKey){case"q":this.position=Object.assign(Object.assign({},this.position),{z:this.position.z-this.currentDelta});break;case"e":this.position=Object.assign(Object.assign({},this.position),{z:this.position.z+this.currentDelta});break;case"w":this.position=Object.assign(Object.assign({},this.position),{y:this.position.y+this.currentDelta});break;case"s":this.position=Object.assign(Object.assign({},this.position),{y:this.position.y-this.currentDelta});break;case"a":this.position=Object.assign(Object.assign({},this.position),{x:this.position.x-this.currentDelta});break;case"d":this.position=Object.assign(Object.assign({},this.position),{x:this.position.x+this.currentDelta})}this.changePosition.emit(this.position)}}},{key:"handleKey",value:function(e){e.preventDefault(),this.updatePosition(e.key)}},{key:"keyUp",value:function(e){"Shift"===e.key?this.shiftPressed=!1:this.currentKey=void 0}},{key:"keyClick",value:function(e){this.updatePosition(e)}},{key:"keyHover",value:function(e){this.currentKey=e}}]),e}();return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=Ot({type:e,selectors:[["ccf-spatial-search-keyboard-ui-behavior"]],hostVars:2,hostBindings:function(e,t){1&e&&Vs("keydown",function(e){return t.handleKey(e)},!1,ro)("keyup",function(e){return t.keyUp(e)},!1,ro),2&e&&du(t.className)},inputs:{delta:"delta",shiftDelta:"shiftDelta",position:"position"},outputs:{changePosition:"changePosition"},decls:1,vars:2,consts:[[3,"currentKey","shiftPressed","keyClicked","keyHovered"]],template:function(e,t){1&e&&(As(0,"ccf-spatial-search-keyboard-ui",0),Vs("keyClicked",function(e){return t.keyClick(e)})("keyHovered",function(e){return t.keyHover(e)}),Ms()),2&e&&Ts("currentKey",t.currentKey)("shiftPressed",t.shiftPressed)},directives:[QJ],encapsulation:2,changeDetection:0}),e}(),JJ=function(){var e=function e(){m(this,e),this.className="ccf-spatial-search-ui",this.addSpatialSearch=new ol,this.resetPosition=new ol,this.resetSphere=new ol,this.closeSpatialSearch=new ol,this.radiusChange=new ol,this.positionChange=new ol,this.editReferenceOrganClicked=new ol,this.infoClicked=new ol,this.nodeClicked=new ol};return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=Ot({type:e,selectors:[["ccf-spatial-search-ui"]],hostVars:2,hostBindings:function(e,t){2&e&&du(t.className)},inputs:{scene:"scene",sceneBounds:"sceneBounds",sceneTarget:"sceneTarget",sex:"sex",referenceOrgan:"referenceOrgan",radius:"radius",radiusSettings:"radiusSettings",defaultPosition:"defaultPosition",position:"position",tissueBlocks:"tissueBlocks",anatomicalStructures:"anatomicalStructures",cellTypes:"cellTypes"},outputs:{addSpatialSearch:"addSpatialSearch",resetPosition:"resetPosition",resetSphere:"resetSphere",closeSpatialSearch:"closeSpatialSearch",radiusChange:"radiusChange",positionChange:"positionChange",editReferenceOrganClicked:"editReferenceOrganClicked",infoClicked:"infoClicked",nodeClicked:"nodeClicked"},decls:55,vars:27,consts:[[1,"header"],[1,"title"],["mat-icon-button","",1,"info"],[3,"click"],["mat-icon-button","",1,"close"],[1,"content"],[1,"info-panel"],[1,"organ-sex-selection"],[1,"sex"],[1,"label"],[1,"current-sex"],[1,"organ"],[1,"current-organ"],[1,"edit",3,"click"],[1,"radius-slider"],[1,"slider-container"],[1,"slider",3,"max","min","step","value","input"],[1,"text","value"],[1,"reset-buttons"],["mat-button","",1,"reset-sphere","button",3,"click"],["mat-button","",1,"reset-camera","button",3,"click"],[1,"results"],[1,"tissue-block","list",3,"tissueBlocks"],["title","Anatomical Structures","toolTipText","Total quantity of predicted anatomical structures detected by the Probing Sphere",1,"anatomical-structures","list",3,"termList"],["title","Predicted Cell Types from ASCT+B Tables","toolTipText","Total quantity of predicted cell types detected by the Probing Sphere",1,"cell-type","list",3,"termList"],["mat-button","",1,"run-spatial-search","button",3,"click"],[1,"spatial-search-scene"],[1,"primary-scene-wrapper"],[1,"body-ui-hint"],[1,"primary-scene",3,"scene","bounds","target","nodeClick","rotationChange"],["primary",""],[1,"sidebar"],[1,"minimap-scene",3,"interactive","scene","bounds","target","nodeClick"],["minimap",""],[3,"delta","shiftDelta","position","changePosition"],[3,"x","y","z"]],template:function(e,t){if(1&e){var n=Ls();As(0,"div",0),As(1,"div",1),Cu(2,"Configure Spatial Search"),Ms(),As(3,"button",2),As(4,"mat-icon",3),Vs("click",function(){return t.infoClicked.emit()}),Cu(5,"info"),Ms(),Ms(),As(6,"button",4),As(7,"mat-icon",3),Vs("click",function(){return t.closeSpatialSearch.emit()}),Cu(8,"close"),Ms(),Ms(),Ms(),As(9,"div",5),As(10,"div",6),As(11,"div",7),As(12,"div",8),As(13,"div",9),Cu(14,"Donor Sex: "),Ms(),As(15,"div",10),Cu(16),Ms(),Ms(),As(17,"div",11),As(18,"div",9),Cu(19,"Organ: "),Ms(),As(20,"div",12),Cu(21),Ms(),Ms(),As(22,"div",13),Vs("click",function(){return t.editReferenceOrganClicked.emit()}),Cu(23,"Edit"),Ms(),Ms(),Is(24,"mat-divider"),As(25,"div",14),As(26,"div",1),Cu(27,"Probing Sphere Radius"),Ms(),As(28,"div",15),As(29,"mat-slider",16),Vs("input",function(e){return t.radiusChange.emit(e.value)}),Ms(),As(30,"span",17),Cu(31),Ms(),Ms(),As(32,"div",18),As(33,"button",19),Vs("click",function(){return t.resetSphere.emit(),t.resetPosition.emit()}),Cu(34,"Reset Probing Sphere"),Ms(),As(35,"button",20),Vs("click",function(){bn(n);var e=Es(49),i=Es(52);return e.rotation=e.rotationX=i.rotation=i.rotationX=0,e.target=i.target=t.sceneTarget,e.bounds=i.bounds=t.sceneBounds}),Cu(36,"Reset Camera View"),Ms(),Ms(),Ms(),Is(37,"mat-divider"),As(38,"div",21),Is(39,"ccf-tissue-block-list",22),Is(40,"ccf-term-occurrence-list",23),Is(41,"ccf-term-occurrence-list",24),Ms(),As(42,"button",25),Vs("click",function(){return t.addSpatialSearch.emit()}),Cu(43,"Run Spatial Search"),Ms(),Ms(),As(44,"div",26),As(45,"div",27),As(46,"div",28),Cu(47,"Use the keyboard or click a Tissue Block to move the Probing Sphere"),Ms(),As(48,"ccf-body-ui",29,30),Vs("nodeClick",function(e){return t.nodeClicked.emit(null==e?null:e.node)})("rotationChange",function(e){bn(n);var t=Es(52);return t.rotation=e[0],t.rotationX=e[1]}),Ms(),Ms(),As(50,"div",31),As(51,"ccf-body-ui",32,33),Vs("nodeClick",function(e){return t.nodeClicked.emit(null==e?null:e.node)}),Ms(),As(53,"ccf-spatial-search-keyboard-ui-behavior",34),Vs("changePosition",function(e){return t.positionChange.emit(e)}),Ms(),Is(54,"ccf-xyz-position",35),Ms(),Ms(),Ms()}2&e&&(Yo(16),Eu(t.sex.charAt(0).toUpperCase()+t.sex.slice(1)),Yo(5),Eu(t.referenceOrgan.name),Yo(8),Ts("max",t.radiusSettings.max)("min",t.radiusSettings.min)("step",1)("value",t.radius),Yo(2),Ou("",t.radius," mm"),Yo(2),cu("disabled",t.radius===t.radiusSettings.defaultValue&&t.position===t.defaultPosition),Yo(6),Ts("tissueBlocks",t.tissueBlocks),Yo(1),Ts("termList",t.anatomicalStructures),Yo(1),Ts("termList",t.cellTypes),Yo(1),cu("disabled",0===(null==t.tissueBlocks?null:t.tissueBlocks.length)),Yo(6),Ts("scene",t.scene)("bounds",t.sceneBounds)("target",t.sceneTarget),Yo(3),Ts("interactive",!1)("scene",t.scene)("bounds",t.sceneBounds)("target",t.sceneTarget),Yo(2),Ts("delta",1)("shiftDelta",2)("position",t.position),Yo(1),Ts("x",t.position.x)("y",t.position.y)("z",t.position.z))},directives:[q_,B_,AK,_G,qJ,YJ,r$,ZJ,aQ],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;align-items:flex-start;padding:2rem;grid-gap:1rem;gap:1rem;height:95vh;width:78vw;border-radius:.25rem;min-height:45rem;min-width:60rem}[_nghost-%COMP%] .header[_ngcontent-%COMP%]{display:flex;width:100%}[_nghost-%COMP%] .header[_ngcontent-%COMP%] .info[_ngcontent-%COMP%], [_nghost-%COMP%] .header[_ngcontent-%COMP%] .close[_ngcontent-%COMP%]{padding:0;background:none;border:none;cursor:pointer;outline:none;border-radius:.25rem;transition:.6s}[_nghost-%COMP%] .header[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{display:flex;align-items:center;margin-right:1rem}[_nghost-%COMP%] .header[_ngcontent-%COMP%] .close[_ngcontent-%COMP%]{margin-left:auto}[_nghost-%COMP%] .content[_ngcontent-%COMP%]{display:flex;width:100%;height:calc(100% - 3.5rem)}[_nghost-%COMP%] .content[_ngcontent-%COMP%] .button[_ngcontent-%COMP%]{border-width:1px;border-style:solid;border-radius:.25rem;font-size:.875rem;height:2rem;line-height:2rem;transition:.5s}[_nghost-%COMP%] .content[_ngcontent-%COMP%] .button.disabled[_ngcontent-%COMP%]{opacity:.5;pointer-events:none}[_nghost-%COMP%] .content[_ngcontent-%COMP%] .info-panel[_ngcontent-%COMP%]{display:flex;flex-direction:column;margin-right:2rem;grid-gap:1rem;gap:1rem;width:25rem}[_nghost-%COMP%] .content[_ngcontent-%COMP%] .info-panel[_ngcontent-%COMP%] .organ-sex-selection[_ngcontent-%COMP%]{display:flex;font-size:1rem;justify-content:space-between}[_nghost-%COMP%] .content[_ngcontent-%COMP%] .info-panel[_ngcontent-%COMP%] .organ-sex-selection[_ngcontent-%COMP%] .sex[_ngcontent-%COMP%], [_nghost-%COMP%] .content[_ngcontent-%COMP%] .info-panel[_ngcontent-%COMP%] .organ-sex-selection[_ngcontent-%COMP%] .organ[_ngcontent-%COMP%]{display:flex}[_nghost-%COMP%] .content[_ngcontent-%COMP%] .info-panel[_ngcontent-%COMP%] .organ-sex-selection[_ngcontent-%COMP%] .sex[_ngcontent-%COMP%] .label[_ngcontent-%COMP%], [_nghost-%COMP%] .content[_ngcontent-%COMP%] .info-panel[_ngcontent-%COMP%] .organ-sex-selection[_ngcontent-%COMP%] .organ[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{font-weight:300;margin-right:.5rem}[_nghost-%COMP%] .content[_ngcontent-%COMP%] .info-panel[_ngcontent-%COMP%] .organ-sex-selection[_ngcontent-%COMP%] .sex[_ngcontent-%COMP%] .current-sex[_ngcontent-%COMP%], [_nghost-%COMP%] .content[_ngcontent-%COMP%] .info-panel[_ngcontent-%COMP%] .organ-sex-selection[_ngcontent-%COMP%] .sex[_ngcontent-%COMP%] .current-organ[_ngcontent-%COMP%], [_nghost-%COMP%] .content[_ngcontent-%COMP%] .info-panel[_ngcontent-%COMP%] .organ-sex-selection[_ngcontent-%COMP%] .organ[_ngcontent-%COMP%] .current-sex[_ngcontent-%COMP%], [_nghost-%COMP%] .content[_ngcontent-%COMP%] .info-panel[_ngcontent-%COMP%] .organ-sex-selection[_ngcontent-%COMP%] .organ[_ngcontent-%COMP%] .current-organ[_ngcontent-%COMP%]{font-weight:600}[_nghost-%COMP%] .content[_ngcontent-%COMP%] .info-panel[_ngcontent-%COMP%] .organ-sex-selection[_ngcontent-%COMP%] .edit[_ngcontent-%COMP%]{cursor:pointer}[_nghost-%COMP%] .content[_ngcontent-%COMP%] .info-panel[_ngcontent-%COMP%] .radius-slider[_ngcontent-%COMP%]{display:flex;flex-direction:column}[_nghost-%COMP%] .content[_ngcontent-%COMP%] .info-panel[_ngcontent-%COMP%] .radius-slider[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-weight:600;font-size:1rem}[_nghost-%COMP%] .content[_ngcontent-%COMP%] .info-panel[_ngcontent-%COMP%] .radius-slider[_ngcontent-%COMP%] .slider-container[_ngcontent-%COMP%]{display:flex;justify-content:space-between}[_nghost-%COMP%] .content[_ngcontent-%COMP%] .info-panel[_ngcontent-%COMP%] .radius-slider[_ngcontent-%COMP%] .slider-container[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%]{width:19rem}[_nghost-%COMP%] .content[_ngcontent-%COMP%] .info-panel[_ngcontent-%COMP%] .radius-slider[_ngcontent-%COMP%] .slider-container[_ngcontent-%COMP%] .value[_ngcontent-%COMP%]{display:flex;align-items:center;font-size:1rem}[_nghost-%COMP%] .content[_ngcontent-%COMP%] .info-panel[_ngcontent-%COMP%] .radius-slider[_ngcontent-%COMP%] .reset-buttons[_ngcontent-%COMP%]{display:flex;justify-content:space-between}[_nghost-%COMP%] .content[_ngcontent-%COMP%] .info-panel[_ngcontent-%COMP%] .radius-slider[_ngcontent-%COMP%] .reset-buttons[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{width:11.5rem}[_nghost-%COMP%] .content[_ngcontent-%COMP%] .info-panel[_ngcontent-%COMP%] .results[_ngcontent-%COMP%]{height:calc(100% - 15rem - 2px)}[_nghost-%COMP%] .content[_ngcontent-%COMP%] .info-panel[_ngcontent-%COMP%] .results[_ngcontent-%COMP%] .list[_ngcontent-%COMP%]{height:33%;display:flex;flex-direction:column}[_nghost-%COMP%] .content[_ngcontent-%COMP%] .spatial-search-scene[_ngcontent-%COMP%]{display:flex;width:calc(100% - 25rem);background-color:#000;border-radius:.5rem}[_nghost-%COMP%] .content[_ngcontent-%COMP%] .spatial-search-scene[_ngcontent-%COMP%] .primary-scene-wrapper[_ngcontent-%COMP%]{display:flex;flex-direction:column;width:100%;height:100%}[_nghost-%COMP%] .content[_ngcontent-%COMP%] .spatial-search-scene[_ngcontent-%COMP%] .primary-scene-wrapper[_ngcontent-%COMP%] .primary-scene[_ngcontent-%COMP%]{flex:auto;overflow:hidden}[_nghost-%COMP%] .content[_ngcontent-%COMP%] .spatial-search-scene[_ngcontent-%COMP%] .primary-scene-wrapper[_ngcontent-%COMP%] .body-ui-hint[_ngcontent-%COMP%]{color:#fff;font-size:1rem;margin:1rem}[_nghost-%COMP%] .content[_ngcontent-%COMP%] .spatial-search-scene[_ngcontent-%COMP%] .sidebar[_ngcontent-%COMP%] .minimap-scene[_ngcontent-%COMP%]{margin:1.5rem;width:12.75rem;height:11rem}[_nghost-%COMP%] .content[_ngcontent-%COMP%] .spatial-search-scene[_ngcontent-%COMP%] .sidebar[_ngcontent-%COMP%] .minimap-scene[_ngcontent-%COMP%] .body-ui{background-color:#232f3a}[_nghost-%COMP%] .content[_ngcontent-%COMP%] .spatial-search-scene[_ngcontent-%COMP%] .sidebar[_ngcontent-%COMP%] ccf-spatial-search-keyboard-ui-behavior[_ngcontent-%COMP%]{margin:1.5rem;display:flex;justify-content:center}[_nghost-%COMP%] .content[_ngcontent-%COMP%] .spatial-search-scene[_ngcontent-%COMP%] .sidebar[_ngcontent-%COMP%] ccf-xyz-position[_ngcontent-%COMP%]{margin:1.5rem;padding-left:5rem}"],changeDetection:0}),e}();function e0(e,t){if(1&e){var n=Ls();As(0,"ccf-spatial-search-ui",1),Vs("addSpatialSearch",function(){return bn(n),Ws().addSpatialSearch()})("radiusChange",function(e){return bn(n),Ws().updateRadius(e)})("resetPosition",function(){return bn(n),Ws().resetPosition()})("resetSphere",function(){return bn(n),Ws().resetRadius()})("positionChange",function(e){return bn(n),Ws().updatePosition(e)})("closeSpatialSearch",function(){return bn(n),Ws().close()})("editReferenceOrganClicked",function(){return bn(n),Ws().openSpatialSearchConfig()})("infoClicked",function(){return bn(n),Ws().onDialogButtonClick()})("nodeClicked",function(e){return bn(n),Ws().moveToNode(e)}),Jc(1,"async"),Jc(2,"async"),Jc(3,"async"),Jc(4,"async"),Jc(5,"async"),Jc(6,"async"),Jc(7,"async"),Jc(8,"async"),Jc(9,"async"),Jc(10,"async"),Jc(11,"async"),Ms()}if(2&e){var i=t.ngIf,r=Ws();Ts("sex",el(1,12,r.sex$))("referenceOrgan",i)("radius",el(2,14,r.radius$))("radiusSettings",el(3,16,r.radiusSettings$))("defaultPosition",el(4,18,r.defaultPosition$))("position",el(5,20,r.position$))("scene",el(6,22,r.scene$))("sceneBounds",el(7,24,r.sceneBounds$))("sceneTarget",el(8,26,r.sceneTarget$))("tissueBlocks",el(9,28,r.tissueBlocks$))("anatomicalStructures",el(10,30,r.anatomicalStructures$))("cellTypes",el(11,32,r.cellTypes$))}}var t0=function(){function e(t,n,i){m(this,e),this.dialogRef=t,this.dialog=n,this.infoService=i,this.updatePosition=vQ(vZ),this.resetPosition=vQ(mZ),this.moveToNode=vQ(gZ),this.updateRadius=vQ(yZ),this.resetRadius=vQ(bZ),this.subscriptions=new q}return b(e,[{key:"launchInfoDialog",value:function(e){this.subscriptions.unsubscribe(),this.dialog.open(k$,{autoFocus:!1,panelClass:"modal-animated",width:"72rem",data:{title:e.infoTitle,content:e.content,videoID:e.videoID}})}},{key:"onDialogButtonClick",value:function(){var e=this;this.infoService.updateData("assets/docs/SPATIAL_SEARCH_README.md","UfxMpzatowE","Spatial Search");var t=this.infoService.panelContent.asObservable();this.subscriptions.add(t.subscribe(function(t){t.content.length&&(e.panelData=t,e.launchInfoDialog(e.panelData))}))}},{key:"close",value:function(){this.dialogRef.close()}},{key:"addSpatialSearch",value:function(){return this.close(),new wZ}},{key:"openSpatialSearchConfig",value:function(){this.close(),this.dialog.open(y0)}}]),e}();t0.\u0275fac=function(e){return new(e||t0)(Os(MG),Os(FG),Os(S$))},t0.\u0275cmp=Ot({type:t0,selectors:[["ccf-spatial-search-ui-behavior"]],decls:2,vars:3,consts:[[3,"sex","referenceOrgan","radius","radiusSettings","defaultPosition","position","scene","sceneBounds","sceneTarget","tissueBlocks","anatomicalStructures","cellTypes","addSpatialSearch","radiusChange","resetPosition","resetSphere","positionChange","closeSpatialSearch","editReferenceOrganClicked","infoClicked","nodeClicked",4,"ngIf"],[3,"sex","referenceOrgan","radius","radiusSettings","defaultPosition","position","scene","sceneBounds","sceneTarget","tissueBlocks","anatomicalStructures","cellTypes","addSpatialSearch","radiusChange","resetPosition","resetSphere","positionChange","closeSpatialSearch","editReferenceOrganClicked","infoClicked","nodeClicked"]],template:function(e,t){1&e&&(Cs(0,e0,12,34,"ccf-spatial-search-ui",0),Jc(1,"async")),2&e&&Ts("ngIf",el(1,1,t.organ$))},directives:[Yh,JJ],pipes:[sd],encapsulation:2,changeDetection:0}),Mw([Bz(GJ.scene)],t0.prototype,"scene$",void 0),Mw([Bz(GJ.sceneBounds)],t0.prototype,"sceneBounds$",void 0),Mw([Bz(GJ.sceneTarget)],t0.prototype,"sceneTarget$",void 0),Mw([Bz(GJ.sex)],t0.prototype,"sex$",void 0),Mw([Bz(GJ.organ)],t0.prototype,"organ$",void 0),Mw([Bz(GJ.position)],t0.prototype,"position$",void 0),Mw([Bz(GJ.defaultPosition)],t0.prototype,"defaultPosition$",void 0),Mw([Bz(GJ.radius)],t0.prototype,"radius$",void 0),Mw([Bz(GJ.radiusSettings)],t0.prototype,"radiusSettings$",void 0),Mw([Bz(GJ.tissueBlocks)],t0.prototype,"tissueBlocks$",void 0),Mw([Bz(GJ.anatomicalStructures)],t0.prototype,"anatomicalStructures$",void 0),Mw([Bz(GJ.cellTypes)],t0.prototype,"cellTypes$",void 0),Mw([TK()],t0.prototype,"updatePosition",void 0),Mw([TK()],t0.prototype,"resetPosition",void 0),Mw([TK()],t0.prototype,"moveToNode",void 0),Mw([TK()],t0.prototype,"updateRadius",void 0),Mw([TK()],t0.prototype,"resetRadius",void 0),Mw([TK()],t0.prototype,"addSpatialSearch",null);var n0=["input"],i0=function(e){return{enterDuration:e}},r0=["*"],o0=new Ri("mat-radio-default-options",{providedIn:"root",factory:function(){return{color:"accent"}}}),a0=0,s0={provide:Hz,useExisting:He(function(){return h0}),multi:!0},u0=function e(t,n){m(this,e),this.source=t,this.value=n},c0=new Ri("MatRadioGroup"),l0=function(){var e=function(){function e(t){m(this,e),this._changeDetector=t,this._value=null,this._name="mat-radio-group-"+a0++,this._selected=null,this._isInitialized=!1,this._labelPosition="after",this._disabled=!1,this._required=!1,this._controlValueAccessorChangeFn=function(){},this.onTouched=function(){},this.change=new ol}return b(e,[{key:"name",get:function(){return this._name},set:function(e){this._name=e,this._updateRadioButtonNames()}},{key:"labelPosition",get:function(){return this._labelPosition},set:function(e){this._labelPosition="before"===e?"before":"after",this._markRadiosForCheck()}},{key:"value",get:function(){return this._value},set:function(e){this._value!==e&&(this._value=e,this._updateSelectedRadioFromValue(),this._checkSelectedRadioButton())}},{key:"_checkSelectedRadioButton",value:function(){this._selected&&!this._selected.checked&&(this._selected.checked=!0)}},{key:"selected",get:function(){return this._selected},set:function(e){this._selected=e,this.value=e?e.value:null,this._checkSelectedRadioButton()}},{key:"disabled",get:function(){return this._disabled},set:function(e){this._disabled=Wd(e),this._markRadiosForCheck()}},{key:"required",get:function(){return this._required},set:function(e){this._required=Wd(e),this._markRadiosForCheck()}},{key:"ngAfterContentInit",value:function(){this._isInitialized=!0}},{key:"_touch",value:function(){this.onTouched&&this.onTouched()}},{key:"_updateRadioButtonNames",value:function(){var e=this;this._radios&&this._radios.forEach(function(t){t.name=e.name,t._markForCheck()})}},{key:"_updateSelectedRadioFromValue",value:function(){var e=this;this._radios&&(null===this._selected||this._selected.value!==this._value)&&(this._selected=null,this._radios.forEach(function(t){t.checked=e.value===t.value,t.checked&&(e._selected=t)}))}},{key:"_emitChangeEvent",value:function(){this._isInitialized&&this.change.emit(new u0(this._selected,this._value))}},{key:"_markRadiosForCheck",value:function(){this._radios&&this._radios.forEach(function(e){return e._markForCheck()})}},{key:"writeValue",value:function(e){this.value=e,this._changeDetector.markForCheck()}},{key:"registerOnChange",value:function(e){this._controlValueAccessorChangeFn=e}},{key:"registerOnTouched",value:function(e){this.onTouched=e}},{key:"setDisabledState",value:function(e){this.disabled=e,this._changeDetector.markForCheck()}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Os(Cc))},e.\u0275dir=Rt({type:e,inputs:{name:"name",labelPosition:"labelPosition",value:"value",selected:"selected",disabled:"disabled",required:"required",color:"color"},outputs:{change:"change"}}),e}(),h0=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}(l0);return t.\u0275fac=function(n){return(e||(e=Ti(t)))(n||t)},t.\u0275dir=Rt({type:t,selectors:[["mat-radio-group"]],contentQueries:function(e,t,n){var i;(1&e&&bl(n,p0,5),2&e)&&(ml(i=_l())&&(t._radios=i))},hostAttrs:["role","radiogroup",1,"mat-radio-group"],exportAs:["matRadioGroup"],features:[Xu([s0,{provide:c0,useExisting:t}]),cs]}),t}(),d0=sb(ub(function e(t){m(this,e),this._elementRef=t})),f0=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,i))._changeDetector=r,l._focusMonitor=o,l._radioDispatcher=a,l._providerOverride=u,l._uniqueId="mat-radio-"+ ++a0,l.id=l._uniqueId,l.change=new ol,l._checked=!1,l._value=null,l._removeUniqueSelectionListener=function(){},l.radioGroup=e,l._noopAnimations="NoopAnimations"===s,c&&(l.tabIndex=qd(c,0)),l._removeUniqueSelectionListener=a.listen(function(e,t){e!==l.id&&t===l.name&&(l.checked=!1)}),l}return b(n,[{key:"checked",get:function(){return this._checked},set:function(e){var t=Wd(e);this._checked!==t&&(this._checked=t,t&&this.radioGroup&&this.radioGroup.value!==this.value?this.radioGroup.selected=this:!t&&this.radioGroup&&this.radioGroup.value===this.value&&(this.radioGroup.selected=null),t&&this._radioDispatcher.notify(this.id,this.name),this._changeDetector.markForCheck())}},{key:"value",get:function(){return this._value},set:function(e){this._value!==e&&(this._value=e,null!==this.radioGroup&&(this.checked||(this.checked=this.radioGroup.value===e),this.checked&&(this.radioGroup.selected=this)))}},{key:"labelPosition",get:function(){return this._labelPosition||this.radioGroup&&this.radioGroup.labelPosition||"after"},set:function(e){this._labelPosition=e}},{key:"disabled",get:function(){return this._disabled||null!==this.radioGroup&&this.radioGroup.disabled},set:function(e){this._setDisabled(Wd(e))}},{key:"required",get:function(){return this._required||this.radioGroup&&this.radioGroup.required},set:function(e){this._required=Wd(e)}},{key:"color",get:function(){return this._color||this.radioGroup&&this.radioGroup.color||this._providerOverride&&this._providerOverride.color||"accent"},set:function(e){this._color=e}},{key:"inputId",get:function(){return"".concat(this.id||this._uniqueId,"-input")}},{key:"focus",value:function(e,t){t?this._focusMonitor.focusVia(this._inputElement,t,e):this._inputElement.nativeElement.focus(e)}},{key:"_markForCheck",value:function(){this._changeDetector.markForCheck()}},{key:"ngOnInit",value:function(){this.radioGroup&&(this.checked=this.radioGroup.value===this._value,this.checked&&(this.radioGroup.selected=this),this.name=this.radioGroup.name)}},{key:"ngAfterViewInit",value:function(){var e=this;this._focusMonitor.monitor(this._elementRef,!0).subscribe(function(t){!t&&e.radioGroup&&e.radioGroup._touch()})}},{key:"ngOnDestroy",value:function(){this._focusMonitor.stopMonitoring(this._elementRef),this._removeUniqueSelectionListener()}},{key:"_emitChangeEvent",value:function(){this.change.emit(new u0(this,this._value))}},{key:"_isRippleDisabled",value:function(){return this.disableRipple||this.disabled}},{key:"_onInputClick",value:function(e){e.stopPropagation()}},{key:"_onInputInteraction",value:function(e){if(e.stopPropagation(),!this.checked&&!this.disabled){var t=this.radioGroup&&this.value!==this.radioGroup.value;this.checked=!0,this._emitChangeEvent(),this.radioGroup&&(this.radioGroup._controlValueAccessorChangeFn(this.value),t&&this.radioGroup._emitChangeEvent())}}},{key:"_setDisabled",value:function(e){this._disabled!==e&&(this._disabled=e,this._changeDetector.markForCheck())}}]),n}(d0);return e.\u0275fac=function(t){return new(t||e)(Os(l0),Os(Ju),Os(Cc),Os(rg),Os(rp),Os(String),Os(void 0),Os(String))},e.\u0275dir=Rt({type:e,viewQuery:function(e,t){var n;(1&e&&yl(n0,5),2&e)&&(ml(n=_l())&&(t._inputElement=n.first))},inputs:{id:"id",checked:"checked",value:"value",labelPosition:"labelPosition",disabled:"disabled",required:"required",color:"color",name:"name",ariaLabel:["aria-label","ariaLabel"],ariaLabelledby:["aria-labelledby","ariaLabelledby"],ariaDescribedby:["aria-describedby","ariaDescribedby"]},outputs:{change:"change"},features:[cs]}),e}(),p0=function(){var e=function(e){a(n,e);var t=s(n);function n(e,i,r,o,a,s,u,c){return m(this,n),t.call(this,e,i,r,o,a,s,u,c)}return n}(f0);return e.\u0275fac=function(t){return new(t||e)(Os(c0,8),Os(Ju),Os(Cc),Os(rg),Os(rp),Os(Yy,8),Os(o0,8),Ai("tabindex"))},e.\u0275cmp=Ot({type:e,selectors:[["mat-radio-button"]],hostAttrs:[1,"mat-radio-button"],hostVars:17,hostBindings:function(e,t){1&e&&Vs("focus",function(){return t._inputElement.nativeElement.focus()}),2&e&&(ks("tabindex",null)("id",t.id)("aria-label",null)("aria-labelledby",null)("aria-describedby",null),cu("mat-radio-checked",t.checked)("mat-radio-disabled",t.disabled)("_mat-animation-noopable",t._noopAnimations)("mat-primary","primary"===t.color)("mat-accent","accent"===t.color)("mat-warn","warn"===t.color))},inputs:{disableRipple:"disableRipple",tabIndex:"tabIndex"},exportAs:["matRadioButton"],features:[cs],ngContentSelectors:r0,decls:13,vars:20,consts:[[1,"mat-radio-label"],["label",""],[1,"mat-radio-container"],[1,"mat-radio-outer-circle"],[1,"mat-radio-inner-circle"],["type","radio",1,"mat-radio-input","cdk-visually-hidden",3,"id","checked","disabled","tabIndex","required","change","click"],["input",""],["mat-ripple","",1,"mat-radio-ripple","mat-focus-indicator",3,"matRippleTrigger","matRippleDisabled","matRippleCentered","matRippleRadius","matRippleAnimation"],[1,"mat-ripple-element","mat-radio-persistent-ripple"],[1,"mat-radio-label-content"],[2,"display","none"]],template:function(e,t){if(1&e&&(Xs(),As(0,"label",0,1),As(2,"span",2),Is(3,"span",3),Is(4,"span",4),As(5,"input",5,6),Vs("change",function(e){return t._onInputInteraction(e)})("click",function(e){return t._onInputClick(e)}),Ms(),As(7,"span",7),Is(8,"span",8),Ms(),Ms(),As(9,"span",9),As(10,"span",10),Cu(11,"\xa0"),Ms(),Ys(12),Ms(),Ms()),2&e){var n=Es(1);ks("for",t.inputId),Yo(5),Ts("id",t.inputId)("checked",t.checked)("disabled",t.disabled)("tabIndex",t.tabIndex)("required",t.required),ks("name",t.name)("value",t.value)("aria-label",t.ariaLabel)("aria-labelledby",t.ariaLabelledby)("aria-describedby",t.ariaDescribedby),Yo(2),Ts("matRippleTrigger",n)("matRippleDisabled",t._isRippleDisabled())("matRippleCentered",!0)("matRippleRadius",20)("matRippleAnimation",$c(18,i0,t._noopAnimations?0:150)),Yo(2),cu("mat-radio-label-before","before"==t.labelPosition)}},directives:[wb],styles:[".mat-radio-button{display:inline-block;-webkit-tap-highlight-color:transparent;outline:0}.mat-radio-label{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;display:inline-flex;align-items:center;white-space:nowrap;vertical-align:middle;width:100%}.mat-radio-container{box-sizing:border-box;display:inline-block;position:relative;width:20px;height:20px;flex-shrink:0}.mat-radio-outer-circle{box-sizing:border-box;display:block;height:20px;left:0;position:absolute;top:0;transition:border-color ease 280ms;width:20px;border-width:2px;border-style:solid;border-radius:50%}._mat-animation-noopable .mat-radio-outer-circle{transition:none}.mat-radio-inner-circle{border-radius:50%;box-sizing:border-box;display:block;height:20px;left:0;position:absolute;top:0;opacity:0;transition:transform ease 280ms,background-color ease 280ms,opacity linear 1ms 280ms;width:20px;transform:scale(0.001);-webkit-print-color-adjust:exact;color-adjust:exact}.mat-radio-checked .mat-radio-inner-circle{transform:scale(0.5);opacity:1;transition:transform ease 280ms,background-color ease 280ms}.cdk-high-contrast-active .mat-radio-checked .mat-radio-inner-circle{border:solid 10px}._mat-animation-noopable .mat-radio-inner-circle{transition:none}.mat-radio-label-content{-webkit-user-select:auto;-moz-user-select:auto;-ms-user-select:auto;user-select:auto;display:inline-block;order:0;line-height:inherit;padding-left:8px;padding-right:0}[dir=rtl] .mat-radio-label-content{padding-right:8px;padding-left:0}.mat-radio-label-content.mat-radio-label-before{order:-1;padding-left:0;padding-right:8px}[dir=rtl] .mat-radio-label-content.mat-radio-label-before{padding-right:0;padding-left:8px}.mat-radio-disabled,.mat-radio-disabled .mat-radio-label{cursor:default}.mat-radio-button .mat-radio-ripple{position:absolute;left:calc(50% - 20px);top:calc(50% - 20px);height:40px;width:40px;z-index:1;pointer-events:none}.mat-radio-button .mat-radio-ripple .mat-ripple-element:not(.mat-radio-persistent-ripple){opacity:.16}.mat-radio-persistent-ripple{width:100%;height:100%;transform:none;top:0;left:0}.mat-radio-container:hover .mat-radio-persistent-ripple{opacity:.04}.mat-radio-button:not(.mat-radio-disabled).cdk-keyboard-focused .mat-radio-persistent-ripple,.mat-radio-button:not(.mat-radio-disabled).cdk-program-focused .mat-radio-persistent-ripple{opacity:.12}.mat-radio-persistent-ripple,.mat-radio-disabled .mat-radio-container:hover .mat-radio-persistent-ripple{opacity:0}@media(hover: none){.mat-radio-container:hover .mat-radio-persistent-ripple{display:none}}.mat-radio-input{bottom:0;left:50%}.cdk-high-contrast-active .mat-radio-button:not(.mat-radio-disabled).cdk-keyboard-focused .mat-radio-ripple,.cdk-high-contrast-active .mat-radio-button:not(.mat-radio-disabled).cdk-program-focused .mat-radio-ripple{outline:solid 3px}.cdk-high-contrast-active .mat-radio-disabled{opacity:.5}\n"],encapsulation:2,changeDetection:0}),e}();function v0(e,t){1&e&&(As(0,"div",7),Cu(1,"Organs"),Ms())}function g0(e,t){if(1&e&&(As(0,"mat-option",17),Cu(1),Ms()),2&e){var n=t.$implicit;Ts("value",n),Yo(1),Ou(" ",n.name," ")}}var m0=function(){var e=function e(){m(this,e),this.className="ccf-spatial-search-config",this.updateSex=new ol,this.updateOrgan=new ol,this.buttonClicked=new ol,this.closeDialog=new ol,this.infoClicked=new ol};return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=Ot({type:e,selectors:[["ccf-spatial-search-config"]],hostVars:2,hostBindings:function(e,t){2&e&&du(t.className)},inputs:{organs:"organs",selectedOrgan:"selectedOrgan",sex:"sex"},outputs:{updateSex:"updateSex",updateOrgan:"updateOrgan",buttonClicked:"buttonClicked",closeDialog:"closeDialog",infoClicked:"infoClicked"},decls:27,vars:6,consts:[[1,"header"],[1,"header-left"],[1,"title"],["mat-icon-button","",1,"info"],[3,"click"],["mat-icon-button","",1,"close"],[1,"sex-toggle"],[1,"label"],[1,"radio-group",3,"ngModel","ngModelChange","change"],["value","male",1,"radio"],["value","female",1,"radio"],[1,"organ-selector"],["appearance","fill",1,"form-field"],["class","label",4,"ngIf"],["disableOptionCentering","true","panelClass","organ-select",3,"value","valueChange","selectionChange"],["class","organ-select-option",3,"value",4,"ngFor","ngForOf"],["mat-button","",1,"continue-button",3,"click"],[1,"organ-select-option",3,"value"]],template:function(e,t){1&e&&(As(0,"div",0),As(1,"div",1),As(2,"div",2),Cu(3,"Configure Spatial Search"),Ms(),As(4,"button",3),As(5,"mat-icon",4),Vs("click",function(){return t.infoClicked.emit()}),Cu(6,"info"),Ms(),Ms(),Ms(),As(7,"button",5),As(8,"mat-icon",4),Vs("click",function(){return t.closeDialog.emit()}),Cu(9,"close"),Ms(),Ms(),Ms(),As(10,"div",6),As(11,"div",7),Cu(12,"Donor Sex: "),Ms(),As(13,"mat-radio-group",8),Vs("ngModelChange",function(e){return t.sex=e})("change",function(e){return t.updateSex.emit(e.value)}),As(14,"mat-radio-button",9),Cu(15,"Male"),Ms(),As(16,"mat-radio-button",10),Cu(17,"Female"),Ms(),Ms(),Ms(),As(18,"div",11),As(19,"div",7),Cu(20,"Select an organ"),Ms(),As(21,"mat-form-field",12),Cs(22,v0,2,0,"div",13),As(23,"mat-select",14),Vs("valueChange",function(e){return t.selectedOrgan=e})("selectionChange",function(e){return t.updateOrgan.emit(e.value)}),Cs(24,g0,2,2,"mat-option",15),Ms(),Ms(),Ms(),As(25,"button",16),Vs("click",function(){return t.buttonClicked.emit()}),Cu(26,"Continue"),Ms()),2&e&&(Yo(13),Ts("ngModel",t.sex),Yo(9),Ts("ngIf",!t.selectedOrgan),Yo(1),Ts("value",t.selectedOrgan),Yo(1),Ts("ngForOf",t.organs),Yo(1),cu("disabled",!t.selectedOrgan))},directives:[q_,B_,h0,fU,GU,p0,RH,Yh,zZ,qh,Rb],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;align-items:flex-start;padding:2rem;grid-gap:2rem;gap:2rem;width:30.5rem;box-shadow:0 25rem 25rem #00000029;border-radius:.25rem;font-size:1rem}[_nghost-%COMP%] .button[_ngcontent-%COMP%]{cursor:pointer}[_nghost-%COMP%] .header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;width:100%;font-size:1.25rem}[_nghost-%COMP%] .header[_ngcontent-%COMP%] .header-left[_ngcontent-%COMP%]{display:flex;align-items:center}[_nghost-%COMP%] .header[_ngcontent-%COMP%] .header-left[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{margin-right:1rem}[_nghost-%COMP%] .header[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{padding:0;background:none;border:none;cursor:pointer;outline:none;border-radius:.25rem;transition:.6s}[_nghost-%COMP%] .sex-toggle[_ngcontent-%COMP%]{display:flex}[_nghost-%COMP%] .sex-toggle[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{margin-right:2rem}[_nghost-%COMP%] .sex-toggle[_ngcontent-%COMP%] .radio[_ngcontent-%COMP%]{margin-right:4rem}[_nghost-%COMP%] .organ-selector[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{height:0rem}[_nghost-%COMP%] .organ-selector[_ngcontent-%COMP%] .mat-form-field-wrapper{padding-bottom:1rem;padding-top:3rem;margin-left:.5rem;width:14rem}[_nghost-%COMP%] .organ-selector[_ngcontent-%COMP%] .mat-form-field-wrapper .mat-form-field-infix{padding:0;border-top:none}[_nghost-%COMP%] .organ-selector[_ngcontent-%COMP%] .mat-form-field-wrapper .mat-form-field-underline{bottom:0rem;height:.125rem}[_nghost-%COMP%] .organ-selector[_ngcontent-%COMP%] .mat-form-field-wrapper .mat-select-arrow-wrapper{transform:translatey(0)}[_nghost-%COMP%] .continue-button[_ngcontent-%COMP%]{display:flex;flex-direction:row;justify-content:center;align-items:center;padding:.25rem 1rem;width:14rem;height:2rem;border-width:1px;border-style:solid;border-radius:.25rem;box-shadow:0 2px 6px #00000029}[_nghost-%COMP%] .continue-button.disabled[_ngcontent-%COMP%]{pointer-events:none;opacity:.5} .organ-select{position:absolute;top:2.5rem;left:-.25rem;border-radius:.5rem;max-height:24.5rem;width:14rem} .organ-select .organ-select-option{height:3.5rem;border-bottom:1px solid}"],changeDetection:0}),e}(),y0=function(){function e(t,n,i,r){m(this,e),this.dialog=t,this.dialogRef=n,this.spatialSearchDialog=i,this.infoService=r,this.updateSex=vQ(fZ),this.updateOrgan=vQ(pZ),this.subscriptions=new q,this.dialogSubs=new q}return b(e,[{key:"buttonClicked",value:function(){this.spatialSearchDialog.open(t0),this.close()}},{key:"close",value:function(){this.dialogRef.close()}},{key:"launchInfoDialog",value:function(e){this.dialogSubs.unsubscribe(),this.dialog.open(k$,{autoFocus:!1,panelClass:"modal-animated",width:"72rem",data:{title:e.infoTitle,content:e.content,videoID:e.videoID}})}},{key:"onDialogButtonClick",value:function(){var e=this;this.infoService.updateData("assets/docs/SPATIAL_SEARCH_README.md","UfxMpzatowE","Spatial Search");var t=this.infoService.panelContent.asObservable();this.dialogSubs.add(t.subscribe(function(t){t.content.length&&(e.panelData=t,e.launchInfoDialog(e.panelData))}))}},{key:"ngOnDestroy",value:function(){this.subscriptions.unsubscribe()}}]),e}();y0.\u0275fac=function(e){return new(e||y0)(Os(FG),Os(MG),Os(FG),Os(S$))},y0.\u0275cmp=Ot({type:y0,selectors:[["ccf-spatial-search-config-behavior"]],decls:4,vars:9,consts:[[3,"sex","organs","selectedOrgan","updateSex","updateOrgan","closeDialog","buttonClicked","infoClicked"]],template:function(e,t){1&e&&(As(0,"ccf-spatial-search-config",0),Vs("updateSex",function(e){return t.updateSex(e)})("updateOrgan",function(e){return t.updateOrgan(e.id)})("closeDialog",function(){return t.close()})("buttonClicked",function(){return t.buttonClicked()})("infoClicked",function(){return t.onDialogButtonClick()}),Jc(1,"async"),Jc(2,"async"),Jc(3,"async"),Ms()),2&e&&Ts("sex",el(1,3,t.sex$))("organs",el(2,5,t.organs$))("selectedOrgan",el(3,7,t.selectedOrgan$))},directives:[m0],pipes:[sd],encapsulation:2,changeDetection:0}),Mw([Bz(GJ.sex)],y0.prototype,"sex$",void 0),Mw([Bz(GJ.organ)],y0.prototype,"selectedOrgan$",void 0),Mw([Bz(GJ.organs)],y0.prototype,"organs$",void 0),Mw([TK()],y0.prototype,"updateSex",void 0),Mw([TK()],y0.prototype,"updateOrgan",void 0);var b0=function(){var e=function(){function e(t,n){m(this,e),this.store=t,this.dialog=n,this.className="ccf-run-spatial-search"}return b(e,[{key:"startSpatialSearchFlow",value:function(){var e=this;this.store.dispatch(new dZ).pipe(_p(1),mv(function(){return e.dialog.open(y0)})).subscribe()}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Os(Pz),Os(FG))},e.\u0275cmp=Ot({type:e,selectors:[["ccf-run-spatial-search"]],hostVars:2,hostBindings:function(e,t){2&e&&du(t.className)},decls:4,vars:0,consts:[["mat-button","",1,"run-spatial-search-button",3,"click"]],template:function(e,t){1&e&&(As(0,"button",0),Vs("click",function(){return t.startSpatialSearchFlow()}),Cu(1," Run Spatial Search "),As(2,"mat-icon"),Cu(3,"travel_explore"),Ms(),Ms())},directives:[q_,B_],styles:["[_nghost-%COMP%] .run-spatial-search-button[_ngcontent-%COMP%] .mat-button-wrapper{display:flex;align-items:center}[_nghost-%COMP%] .run-spatial-search-button[_ngcontent-%COMP%] .mat-button-wrapper .mat-icon{margin-left:9.75px}"],changeDetection:0}),e}();function _0(e,t){if(1&e){var n=Ls();As(0,"div",14),As(1,"ccf-spatial-search-list",15),Vs("selectionChanged",function(e){return bn(n),Ws().updateSearchSelection(e)})("itemRemoved",function(e){return bn(n),Ws().spatialSearchRemoved.emit(e.id)}),Ms(),Ms()}if(2&e){var i=Ws();cu("hidden",i.hidden),Yo(1),Ts("items",i.spatialSearchFilters)}}var w0=function(){return["Both","Male","Female"]},k0=function(){return[1,110]},x0=function(){return[13,83]},S0=function(){var e=function(){function e(t){m(this,e),this.ga=t,this.spatialSearchFilters=[],this.filtersChange=new ol,this.spatialSearchSelected=new ol,this.spatialSearchRemoved=new ol,this.applyFilters=new ol}return b(e,[{key:"ngOnChanges",value:function(e){"spatialSearchFilters"in e&&this.updateSexFromSelection(this.spatialSearchFilters.filter(function(e){return e.selected}))}},{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.updateSearchSelection(this.spatialSearchFilters.filter(function(e){return e.selected})),this.ga.event("filters_applied","filter_content"),this.applyFilters.emit(this.filters)}},{key:"refreshFilters",value:function(){this.filters=JSON.parse(JSON.stringify(kQ)),this.ga.event("filters_reset","filter_content"),this.spatialSearchSelected.emit([]),this.filtersChange.emit(this.filters)}},{key:"updateSearchSelection",value:function(e){var t=e.map(function(e){return e.search});this.spatialSearchSelected.emit(e),this.updateFilter(t,"spatialSearches"),this.updateSexFromSelection(e)}},{key:"updateSexFromSelection",value:function(e){var t,n=null===(t=this.filters.sex)||void 0===t?void 0:t.toLowerCase(),i=new Set(e.map(function(e){return e.sex}));e.length>0&&(i.size>1||!i.has(n))&&this.updateFilter("Both","sex")}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Os(yq))},e.\u0275cmp=Ot({type:e,selectors:[["ccf-filters-content"]],inputs:{hidden:"hidden",filters:"filters",technologyFilters:"technologyFilters",providerFilters:"providerFilters",spatialSearchFilters:"spatialSearchFilters"},outputs:{filtersChange:"filtersChange",spatialSearchSelected:"spatialSearchSelected",spatialSearchRemoved:"spatialSearchRemoved",applyFilters:"applyFilters"},features:[qt],decls:17,vars:24,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"],["class","filter spatial-locations",3,"hidden",4,"ngIf"],[1,"button-container"],[1,"right-group"],["mat-button","",1,"outline-button",3,"click"],[1,"refresh-icon"],[1,"icon","refresh",3,"click"],[1,"filter","spatial-locations"],["label","Spatial Locations",3,"items","selectionChanged","itemRemoved"]],template:function(e,t){1&e&&(As(0,"div",0),As(1,"ccf-dropdown",1),Vs("selectionChange",function(e){return t.updateFilter(e,"sex")}),Ms(),As(2,"ccf-dual-slider",2),Vs("selectionChange",function(e){return t.updateFilter(e,"ageRange")}),Ms(),As(3,"ccf-dual-slider",3),Vs("selectionChange",function(e){return t.updateFilter(e,"bmiRange")}),Ms(),Ms(),As(4,"div",4),As(5,"ccf-checkbox",5),Vs("selectionChange",function(e){return t.updateFilter(e,"technologies")}),Ms(),Ms(),As(6,"div",6),As(7,"ccf-checkbox",7),Vs("selectionChange",function(e){return t.updateFilter(e,"tmc")}),Ms(),Ms(),Cs(8,_0,2,3,"div",8),As(9,"div",9),Is(10,"ccf-run-spatial-search"),As(11,"div",10),As(12,"button",11),Vs("click",function(){return t.applyButtonClick()}),Cu(13,"APPLY FILTERS"),Ms(),As(14,"div",12),As(15,"mat-icon",13),Vs("click",function(){return t.refreshFilters()}),Cu(16,"refresh"),Ms(),Ms(),Ms(),Ms()),2&e&&(cu("hidden",t.hidden),Yo(1),Ts("options",Kc(21,w0))("selection",null==t.filters?null:t.filters.sex),Yo(1),Ts("valueRange",Kc(22,k0))("selection",null==t.filters?null:t.filters.ageRange),Yo(1),Ts("valueRange",Kc(23,x0))("selection",null==t.filters?null:t.filters.bmiRange),Yo(1),cu("hidden",t.hidden),Yo(1),Ts("columns",4)("options",t.technologyFilters)("selection",null==t.filters?null:t.filters.technologies),Yo(1),cu("hidden",t.hidden),Yo(1),Ts("columns",3)("options",t.providerFilters)("selection",null==t.filters?null:t.filters.tmc),Yo(1),Ts("ngIf",t.spatialSearchFilters.length>0),Yo(1),cu("hidden",t.hidden))},directives:[GZ,FJ,zJ,Yh,b0,q_,B_,rQ],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%] button{border-width:1px;border-style:solid}.button-container[_ngcontent-%COMP%]{display:flex;justify-content:space-between;margin-top:2rem}.button-container[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{border-width:1px;border-style:solid}.button-container.hidden[_ngcontent-%COMP%]{opacity:0;transition-duration:.2s}.button-container[_ngcontent-%COMP%] .right-group[_ngcontent-%COMP%]{display:flex;flex-direction:row-reverse;align-items:center}.button-container[_ngcontent-%COMP%] .right-group[_ngcontent-%COMP%] .outline-button[_ngcontent-%COMP%]{box-shadow:.1rem .1rem .2rem #0000001d}.button-container[_ngcontent-%COMP%] .right-group[_ngcontent-%COMP%] .refresh-icon[_ngcontent-%COMP%]{padding:.25rem;border-radius:.25rem;margin-right:1rem;display:flex;justify-content:center;align-items:center;transition:.6s}.button-container[_ngcontent-%COMP%] .right-group[_ngcontent-%COMP%] .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 C0(e,t){1&e&&(As(0,"div"),As(1,"mat-icon",7),Cu(2,"close"),Ms(),Ms())}function E0(e,t){1&e&&Is(0,"mat-icon",8)}var O0=function(){function e(){m(this,e),this.spatialSearchFilters=[],this.filtersChange=new ol,this.spatialSearchSelected=new ol,this.spatialSearchRemoved=new ol,this.filtersVisible=!1}return b(e,[{key:"toggleFilterVisible",value:function(){return this.filtersVisible=!this.filtersVisible,new kZ(!1)}},{key:"removeBox",value:function(){return this.filtersVisible=!1,new kZ(!0)}},{key:"applyFilters",value:function(e){this.filters=e,this.filtersChange.emit(e),this.removeBox()}}]),e}();O0.\u0275fac=function(e){return new(e||O0)},O0.\u0275cmp=Ot({type:O0,selectors:[["ccf-filters-popover"]],inputs:{filters:"filters",drawerExpanded:"drawerExpanded",technologyFilters:"technologyFilters",providerFilters:"providerFilters",spatialSearchFilters:"spatialSearchFilters"},outputs:{filtersChange:"filtersChange",spatialSearchSelected:"spatialSearchSelected",spatialSearchRemoved:"spatialSearchRemoved"},decls:8,vars:15,consts:[[1,"filters-popover"],[1,"show-hide",3,"click"],[4,"ngIf","ngIfElse"],["notShow",""],[1,"popup-container"],[1,"popup-body"],[3,"technologyFilters","providerFilters","spatialSearchFilters","hidden","filters","applyFilters","spatialSearchSelected","spatialSearchRemoved"],[1,"icon"],["svgIcon","filter",1,"icon","funnel"]],template:function(e,t){if(1&e&&(As(0,"div",0),As(1,"button",1),Vs("click",function(){return t.toggleFilterVisible()}),Cs(2,C0,3,0,"div",2),Cs(3,E0,1,0,"ng-template",null,3,Sl),Ms(),As(5,"div",4),As(6,"div",5),As(7,"ccf-filters-content",6),Vs("applyFilters",function(e){return t.applyFilters(e)})("spatialSearchSelected",function(e){return t.spatialSearchSelected.emit(e)})("spatialSearchRemoved",function(e){return t.spatialSearchRemoved.emit(e)}),Ms(),Ms(),Ms(),Ms()),2&e){var n=Es(4);cu("expanded",t.drawerExpanded),Yo(1),cu("open",t.filtersVisible),Yo(1),Ts("ngIf",t.filtersVisible)("ngIfElse",n),Yo(3),cu("visible",t.filtersVisible)("hidden",!t.filtersVisible),Yo(2),Ts("technologyFilters",t.technologyFilters)("providerFilters",t.providerFilters)("spatialSearchFilters",t.spatialSearchFilters)("hidden",!t.filtersVisible)("filters",t.filters)}},directives:[Yh,S0,B_],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}.popup-container.visible[_ngcontent-%COMP%]{width:35rem;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}),Mw([TK()],O0.prototype,"toggleFilterVisible",null),Mw([TK()],O0.prototype,"removeBox",null);var T0=function(){function e(){m(this,e),this.treeModel$=new Bf(1),this.nodes$=this.treeModel$.pipe(ce(function(e){return Object.values(e.nodes)})),this.rootNode$=this.treeModel$.pipe(ce(function(e){return e.nodes[e.root]}))}return b(e,[{key:"setTreeModel",value:function(e){this.treeModel$.next(e),this.treeModel=e}},{key:"filter",value:function(e){var t=this;return this.nodes$.pipe(ce(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.slice(0,n),e.slice(n,n+t.length),e.slice(n+t.length)]}},{key:"getChildren",value:function(e){var t,n,i=null!==(n=null===(t=this.treeModel)||void 0===t?void 0:t.nodes)&&void 0!==n?n:{};return(0,$q.at)(i,e.children)}}]),e}();T0.\u0275fac=function(e){return new(e||T0)},T0.\u0275prov=$e({token:T0,factory:T0.\u0275fac}),Mw([eV.ak],T0.prototype,"getChildren",null);var P0=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 I0(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),N0.mostRecentTreeNode&&(N0.mostRecentTreeNode.data=e)}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Os(yc),Os(Cc))},e.\u0275cmp=Ot({type:e,selectors:[["cdk-tree"]],contentQueries:function(e,t,n){var i;(1&e&&bl(n,R0,5),2&e)&&(ml(i=_l())&&(t._nodeDefs=i))},viewQuery:function(e,t){var n;(1&e&&yl(M0,7),2&e)&&(ml(n=_l())&&(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&&Ns(0,0)},directives:[M0],encapsulation:2}),e}(),N0=function(){var e=function(){function e(t,n){m(this,e),this._elementRef=t,this._tree=n,this._destroyed=new ae,this._dataChanges=new ae,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&&!L0(t);)t=t.parentElement;return t?t.classList.contains("cdk-nested-tree-node")?qd(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)(Os(Ju),Os(D0))},e.\u0275dir=Rt({type:e,selectors:[["cdk-tree-node"]],inputs:{role:"role"},exportAs:["cdkTreeNode"]}),e.mostRecentTreeNode=null,e}();function L0(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 j0=/([A-Za-z%]+)$/,F0=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 ae,this.indentUnits="px",this._indent=40,this._setPadding(),r&&r.change.pipe(kf(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=qd(e,null),this._setPadding()}},{key:"_setIndentInput",value:function(e){var t=e,n="px";if("string"==typeof e){var i=e.split(j0);t=i[0],n=i[1]||n}this.indentUnits=n,this._indent=qd(t),this._setPadding()}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Os(N0),Os(D0),Os(Ju),Os(tp,8))},e.\u0275dir=Rt({type:e,selectors:[["","cdkTreeNodePadding",""]],inputs:{level:["cdkTreeNodePadding","level"],indent:["cdkTreeNodePaddingIndent","indent"]}}),e}(),B0=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=Wd(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)(Os(D0),Os(N0))},e.\u0275dir=Rt({type:e,selectors:[["","cdkTreeNodeToggle",""]],hostBindings:function(e,t){1&e&&Vs("click",function(e){return t._toggle(e)})},inputs:{recursive:["cdkTreeNodeToggleRecursive","recursive"]}}),e}(),V0=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({}),e}(),z0=ub(ob(N0)),U0=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}(z0);return t.\u0275fac=function(e){return new(e||t)(Os(Ju),Os(D0),Ai("tabindex"))},t.\u0275dir=Rt({type:t,selectors:[["mat-tree-node"]],inputs:{role:"role",disabled:"disabled",tabIndex:"tabIndex"},exportAs:["matTreeNode"],features:[Xu([{provide:N0,useExisting:t}]),cs]}),t}(),H0=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}(R0);return t.\u0275fac=function(n){return(e||(e=Ti(t)))(n||t)},t.\u0275dir=Rt({type:t,selectors:[["","matTreeNodeDef",""]],inputs:{when:["matTreeNodeDefWhen","when"],data:["matTreeNode","data"]},features:[Xu([{provide:R0,useExisting:t}]),cs]}),t}(),G0=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}(F0);return t.\u0275fac=function(n){return(e||(e=Ti(t)))(n||t)},t.\u0275dir=Rt({type:t,selectors:[["","matTreeNodePadding",""]],inputs:{level:["matTreeNodePadding","level"],indent:["matTreeNodePaddingIndent","indent"]},features:[Xu([{provide:F0,useExisting:t}]),cs]}),t}(),W0=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)(Os(Nc),Os(A0,8))},e.\u0275dir=Rt({type:e,selectors:[["","matTreeNodeOutlet",""]],features:[Xu([{provide:M0,useExisting:e}])]}),e}(),q0=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}(D0);return t.\u0275fac=function(n){return(e||(e=Ti(t)))(n||t)},t.\u0275cmp=Ot({type:t,selectors:[["mat-tree"]],viewQuery:function(e,t){var n;(1&e&&yl(W0,7),2&e)&&(ml(n=_l())&&(t._nodeOutlet=n.first))},hostAttrs:["role","tree",1,"mat-tree","cdk-tree"],exportAs:["matTree"],features:[Xu([{provide:D0,useExisting:t}]),cs],decls:1,vars:0,consts:[["matTreeNodeOutlet",""]],template:function(e,t){1&e&&Ns(0,0)},directives:[W0],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}(),X0=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=Wd(e)}}]),n}(B0);return t.\u0275fac=function(n){return(e||(e=Ti(t)))(n||t)},t.\u0275dir=Rt({type:t,selectors:[["","matTreeNodeToggle",""]],inputs:{recursive:["matTreeNodeToggleRecursive","recursive"]},features:[Xu([{provide:B0,useExisting:t}]),cs]}),t}(),Y0=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({imports:[[V0,rb],rb]}),e}(),K0=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(_p(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}(),$0=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 vv([]),o._expandedData=new vv([]),o._data=new vv([]),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 Oe(e.viewChange,this._treeControl.expansionModel.changed,this._flattenedData).pipe(ce(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)}}()),Q0=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 Z0(e,t){if(1&e){var n=Ls();As(0,"div",4),Vs("click",function(e){var t=bn(n).node,i=Ws();return i.select(e.ctrlKey,t,!0,!i.isSelected(t))}),Cu(1),Ms()}if(2&e){var i=t.node,r=Ws();cu("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)),Yo(1),Eu("colon"===i.label?"large intestine":i.label)}}function J0(e,t){1&e&&Ns(0)}var e1=function(e){return{node:e}};function t1(e,t){if(1&e){var n=Ls();As(0,"mat-tree-node",5),Vs("mouseleave",function(){bn(n);var e=Es(5);return Ws().mouseOut(),e.reset()}),As(1,"div"),As(2,"mat-icon",6),Vs("mouseenter",function(){var e=bn(n).$implicit;return Ws().mouseOver(e)}),Ms(),As(3,"div",7),As(4,"ccf-opacity-slider",8,9),Vs("opacityChange",function(e){var t=bn(n).$implicit;return Ws().updateOpacity(t,e)})("opacityReset",function(){var e=bn(n).$implicit;return Ws().resetNode(e)})("visibilityToggle",function(){var e=bn(n).$implicit;return Ws().toggleVisibility(e)}),Ms(),Ms(),Ms(),Is(6,"div",10),Cs(7,J0,1,0,"ng-container",11),As(8,"div",12),Cu(9),Ms(),Ms()}if(2&e){var i=t.$implicit,r=Ws(),o=Es(2);Ts("matTreeNodePaddingIndent",r.indent),Yo(1),uu("display",-1!==i.opacity?"none":"block"),Yo(1),uu("left",r.getLeftIndent(i.level)),cu("fade",!0!==i.visible),Yo(1),uu("left",r.getLeftIndent(i.level)),cu("hidden",i.label!==(null==r.highlightedNode?null:r.highlightedNode.label)),Yo(1),Ts("visible",i.visible)("opacity",i.opacity),Yo(3),Ts("ngTemplateOutlet",o)("ngTemplateOutletContext",$c(18,e1,i)),Yo(1),cu("suborgan",i.level>1),Yo(1),Eu(r.occurenceData[i.original.id]||0)}}function n1(e,t){1&e&&Ns(0)}function i1(e,t){if(1&e){var n=Ls();As(0,"mat-tree-node",13),Vs("mouseleave",function(){bn(n);var e=Es(5);return Ws().mouseOut(),e.reset()}),As(1,"div"),As(2,"mat-icon",6),Vs("mouseenter",function(){var e=bn(n).$implicit;return Ws().mouseOver(e)}),Ms(),As(3,"div",7),As(4,"ccf-opacity-slider",8,14),Vs("opacityChange",function(e){var t=bn(n).$implicit;return Ws().updateOpacity(t,e)})("opacityReset",function(){var e=bn(n).$implicit;return Ws().resetNode(e)})("visibilityToggle",function(){var e=bn(n).$implicit;return Ws().toggleVisibility(e)}),Ms(),Ms(),Ms(),As(6,"button",15),As(7,"mat-icon",16),Cu(8),Ms(),Ms(),Cs(9,n1,1,0,"ng-container",11),As(10,"div",12),Cu(11),Ms(),Ms()}if(2&e){var i=t.$implicit,r=Ws(),o=Es(2);Ts("matTreeNodePaddingIndent",r.indent),Yo(1),uu("display",-1!==i.opacity?"none":"block"),Yo(1),uu("left",r.getLeftIndent(i.level)),cu("fade",!0!==i.visible),Yo(1),uu("left",r.getLeftIndent(i.level)),cu("hidden",i.label!==(null==r.highlightedNode?null:r.highlightedNode.label)),Yo(1),Ts("visible",i.visible)("opacity",i.opacity),Yo(2),cu("hidden",i.label===(null==r.highlightedNode?null:r.highlightedNode.label)),Ss("aria-label","Toggle ",i.label,""),Yo(2),Ou(" ",r.control.isExpanded(i)?"expand_less":"expand_more"," "),Yo(1),Ts("ngTemplateOutlet",o)("ngTemplateOutletContext",$c(22,e1,i)),Yo(1),cu("suborgan",i.level>1),Yo(1),Eu(r.occurenceData[i.original.id]||0)}}var r1=(0,$q.property)("level"),o1=(0,$q.property)("expandable"),a1=function(){var e=function(){function e(t,n){m(this,e),this.cdr=t,this.ga=n,this.atScrollBottom=!1,this.nodeSelected=new ol,this.nodeChanged=new ol,this.indent="1.5rem",this.control=new P0(r1,o1),this.flattener=new K0(Q0.create,r1,o1,$q.invoke.bind(void 0,this,"getChildren")),this.dataSource=new $0(this.control,this.flattener),this._nodes=void 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;(null==t?void 0:t.length)>=0&&this.selectByIDs(t)}e.rootNode&&this.selectByIDs([e.rootNode.currentValue])}},{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,$q.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 d=l.value;o.expand(d)}}catch(f){h.e(f)}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(null==e?void 0:e.original.id)===this.rootNode||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)(Os(Cc),Os(yq))},e.\u0275cmp=Ot({type:e,selectors:[["ccf-ontology-tree"]],inputs:{ontologyFilter:"ontologyFilter",rootNode:"rootNode",nodes:"nodes",getChildren:"getChildren",occurenceData:"occurenceData",termData:"termData",header:"header"},outputs:{nodeSelected:"nodeSelected",nodeChanged:"nodeChanged"},features:[qt],decls:5,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,"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&&(As(0,"mat-tree",0),Vs("scroll",function(e){return t.onScroll(e)}),Cs(1,Z0,2,9,"ng-template",null,1,Sl),Cs(3,t1,10,20,"mat-tree-node",2),Cs(4,i1,12,24,"mat-tree-node",3),Ms()),2&e&&(cu("header-hidden",!t.header),Ts("dataSource",t.dataSource)("treeControl",t.control),Yo(4),Ts("matTreeNodeDefWhen",t.isInnerNode))},directives:[q0,H0,U0,G0,B_,m$,nd,q_,X0],styles:[".ccf-ontology-tree[_ngcontent-%COMP%]{background:none;scrollbar-width:thin;max-height:calc(50vh - 10rem);overflow:auto;overflow-x:hidden}.ccf-ontology-tree.header-hidden[_ngcontent-%COMP%]{max-height:40vh}.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:3rem;width:90%;bottom:0;pointer-events:none}.scroll-gradient.hidden[_ngcontent-%COMP%]{display:none}"],changeDetection:0}),e}();function s1(e,t){if(1&e&&(As(0,"mat-option",8),As(1,"span",9),Cu(2),Ms(),As(3,"span",10),Cu(4),Ms(),As(5,"span",11),Cu(6),Ms(),Ms()),2&e){var n=t.$implicit;Ts("value",n),Yo(2),Eu(n.displayLabel[0]),Yo(2),Eu(n.displayLabel[1]),Yo(2),Eu(n.displayLabel[2])}}var u1=function(){var e=function(){function e(t,n){m(this,e),this.ontologyService=t,this.ga=n,this.selected=new ol,this.formControl=new LU(""),this.autoCompleteOpen=!1}return b(e,[{key:"ngOnInit",value:function(){var e=this;this.filteredResults$=this.formControl.valueChanges.pipe(bf(function(e){return"string"==typeof e}),Ef(""),Of(function(t){return e.ontologyService.filter(t)}),ce(function(t){return(0,$q.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,$q.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)(Os(T0),Os(yq))},e.\u0275cmp=Ot({type:e,selectors:[["ccf-ontology-search"]],inputs:{placeholderText:"placeholderText"},outputs:{selected:"selected"},decls:10,vars:9,consts:[[1,"ccf-ontology-search"],["appearance","outline",1,"field"],["matPrefix","","color","primary",1,"search"],["type","text","matInput","",1,"input",3,"placeholder","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&&(As(0,"form",0),As(1,"mat-form-field",1),As(2,"mat-icon",2),Cu(3,"search"),Ms(),Is(4,"input",3),As(5,"mat-autocomplete",4,5),Vs("optionSelected",function(e){return t.onSelect(e)})("opened",function(){return t.autoCompleteOpen=!0})("closed",function(){return t.autoCompleteOpen=!1}),As(7,"div",6),Cs(8,s1,7,4,"mat-option",7),Jc(9,"async"),Ms(),Ms(),Ms(),Ms()),2&e){var n=Es(6);cu("autocomplete-open",t.autoCompleteOpen),Yo(4),Ts("placeholder",t.placeholderText)("formControl",t.formControl)("matAutocomplete",n),Yo(1),Ts("displayWith",t.displayFormatter),Yo(3),Ts("ngForOf",el(9,7,t.filteredResults$))}},directives:[WU,pU,zU,RH,B_,EH,sG,qz,ZH,fU,KU,XH,qh,Rb],pipes:[sd],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}(),c1=function(e){return[e]};function l1(e,t){if(1&e){var n=Ls();As(0,"ccf-ontology-tree",2),Vs("nodeSelected",function(e){return bn(n),Ws().ontologySelection.emit(e)}),Ms()}if(2&e){var i=t.ngIf,r=Ws();Ts("nodes",$c(7,c1,i))("rootNode",i.id)("getChildren",r.ontologySearchService.getChildren)("occurenceData",r.occurenceData)("termData",r.termData)("ontologyFilter",r.ontologyFilter)("header",r.header)}}var h1=function(){var e=function(){function e(t){m(this,e),this.ontologySearchService=t,this.ontologySelection=new ol}return b(e,[{key:"ngOnChanges",value:function(e){"treeModel"in e&&this.treeModel&&this.ontologySearchService.setTreeModel(this.treeModel)}},{key:"selected",value:function(e){var t,n,i=null!==(n=null===(t=this.treeModel)||void 0===t?void 0:t.nodes)&&void 0!==n?n:{};this.tree.expandAndSelect(e,function(e){return i[e.parent]})}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Os(T0))},e.\u0275cmp=Ot({type:e,selectors:[["ccf-ontology-selection"]],viewQuery:function(e,t){var n;(1&e&&yl(a1,5),2&e)&&(ml(n=_l())&&(t.tree=n.first))},inputs:{occurenceData:"occurenceData",termData:"termData",treeModel:"treeModel",ontologyFilter:"ontologyFilter",header:"header",placeholderText:"placeholderText"},outputs:{ontologySelection:"ontologySelection"},features:[Xu([T0]),qt],decls:3,vars:4,consts:[[3,"placeholderText","selected"],["class","tree",3,"nodes","rootNode","getChildren","occurenceData","termData","ontologyFilter","header","nodeSelected",4,"ngIf"],[1,"tree",3,"nodes","rootNode","getChildren","occurenceData","termData","ontologyFilter","header","nodeSelected"]],template:function(e,t){1&e&&(As(0,"ccf-ontology-search",0),Vs("selected",function(e){return t.selected(e)}),Ms(),Cs(1,l1,1,9,"ccf-ontology-tree",1),Jc(2,"async")),2&e&&(Ts("placeholderText",t.placeholderText),Yo(1),Ts("ngIf",el(2,2,t.ontologySearchService.rootNode$)))},directives:[u1,Yh,a1],pipes:[sd],styles:[""],changeDetection:0}),e}(),d1=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 q;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)(Os(aZ),Os(eZ),Os(Cc))},e.\u0275cmp=Ot({type:e,selectors:[["ccf-drawer-toggle-button"]],hostVars:4,hostBindings:function(e,t){2&e&&(du(t.className),cu("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&&(As(0,"mat-icon",0),Vs("click",function(){return t.toggle()}),Cu(1),Ms()),2&e&&(Yo(1),Ou(" ",t.icon,"\n"))},directives:[B_],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 f1(e,t){1&e&&(As(0,"div",7),Is(1,"mat-spinner",8),As(2,"span",3),Cu(3,"Loading External Site"),Ms(),Ms())}function p1(e,t){if(1&e){var n=Ls();As(0,"iframe",9),Vs("load",function(){return bn(n),Ws().loading=!1}),Ms()}2&e&&ks("src",Ws().safeUrl,Yr)}var v1=function(){var e=function(){function e(t){m(this,e),this.sanitizer=t,this.className="ccf-viewer",this.url="",this.closed=new ol,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)(Os(Vd))},e.\u0275cmp=Ot({type:e,selectors:[["ccf-viewer"]],hostVars:2,hostBindings:function(e,t){2&e&&du(t.className)},inputs:{url:"url"},outputs:{closed:"closed"},features:[qt],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&&(As(0,"div",0),As(1,"a",1),As(2,"mat-icon",2),Cu(3,"launch"),Ms(),As(4,"span",3),Cu(5,"Open in Portal"),Ms(),Ms(),As(6,"button",4),Vs("click",function(){return t.closed.emit()}),As(7,"mat-icon",2),Cu(8,"clear"),Ms(),Ms(),Ms(),Cs(9,f1,4,0,"div",5),Cs(10,p1,1,1,"iframe",6)),2&e&&(Yo(1),Ts("href",t.safeUrl,Xr)("disabled",!t.safeUrl),Yo(8),Ts("ngIf",t.loading),Yo(1),Ts("ngIf",t.safeUrl))},directives:[X_,B_,q_,Yh,YQ],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 g1(e,t){if(1&e&&Is(0,"div",3),2&e){var n=t.index;cu("line-tick-visible",Ws().tissueSectionExists(n+1))}}var m1=function(){return[]},y1=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=Ot({type:e,selectors:[["ccf-tissue-section-vis"]],hostVars:2,hostBindings:function(e,t){2&e&&du(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&&(As(0,"div"),Cu(1,"0"),Ms(),As(2,"div",0),Cs(3,g1,1,2,"div",1),Is(4,"div",2),Ms(),As(5,"div"),Cu(6),Ms()),2&e&&(Yo(3),Ts("ngForOf",Kc(2,m1).constructor(t.totalTissueSections)),Yo(3),Eu(t.totalTissueSections))},directives:[qh],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 b1(e){return null!==e&&"object"==typeof e&&"constructor"in e&&e.constructor===Object}function _1(e,t){void 0===e&&(e={}),void 0===t&&(t={}),Object.keys(t).forEach(function(n){void 0===e[n]?e[n]=t[n]:b1(t[n])&&b1(e[n])&&Object.keys(t[n]).length>0&&_1(e[n],t[n])})}var w1={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 k1(){var e="undefined"!=typeof document?document:{};return _1(e,w1),e}var x1={document:w1,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 S1(){var e="undefined"!=typeof window?window:{};return _1(e,x1),e}function C1(e){return(C1=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function E1(e,t){return(E1=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function O1(){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(G){return!1}}function T1(e,t,n){return(T1=O1()?Reflect.construct:function(e,t,n){var i=[null];i.push.apply(i,t);var r=new(Function.bind.apply(e,i));return n&&E1(r,n.prototype),r}).apply(null,arguments)}function P1(e){var t="function"==typeof Map?new Map:void 0;return(P1=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 T1(e,arguments,C1(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),E1(n,e)})(e)}var A1=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}(P1(Array));function M1(e){void 0===e&&(e=[]);var t=[];return e.forEach(function(e){Array.isArray(e)?t.push.apply(t,M1(e)):t.push(e)}),t}function I1(e,t){return Array.prototype.filter.call(e,t)}function R1(e,t){var n=S1(),i=k1(),r=[];if(!t&&e instanceof A1)return e;if(!e)return new A1(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;f-=1){var p=d[f];o&&p.listener===o||o&&p.listener&&p.listener.dom7proxy&&p.listener.dom7proxy===o?(h.removeEventListener(c,p.proxyListener,a),d.splice(f,1)):o||(h.removeEventListener(c,p.proxyListener,a),d.splice(f,1))}}return this},trigger:function(){for(var e=S1(),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=S1();return this[0]?e.getComputedStyle(this[0],null):{}},offset:function(){if(this.length>0){var e=S1(),t=k1(),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=S1();if(1===arguments.length){if("string"!=typeof e){for(n=0;nt-1)return R1([]);if(e<0){var n=t+e;return R1(n<0?[]:[this[n]])}return R1([this[e]])},append:function(){for(var e,t=k1(),n=0;n=0;n-=1)this[t].insertBefore(r.childNodes[n],this[t].childNodes[0])}else if(e instanceof A1)for(n=0;n0?e?this[0].nextElementSibling&&R1(this[0].nextElementSibling).is(e)?R1([this[0].nextElementSibling]):R1([]):R1(this[0].nextElementSibling?[this[0].nextElementSibling]:[]):R1([])},nextAll:function(e){var t=[],n=this[0];if(!n)return R1([]);for(;n.nextElementSibling;){var i=n.nextElementSibling;e?R1(i).is(e)&&t.push(i):t.push(i),n=i}return R1(t)},prev:function(e){if(this.length>0){var t=this[0];return e?t.previousElementSibling&&R1(t.previousElementSibling).is(e)?R1([t.previousElementSibling]):R1([]):R1(t.previousElementSibling?[t.previousElementSibling]:[])}return R1([])},prevAll:function(e){var t=[],n=this[0];if(!n)return R1([]);for(;n.previousElementSibling;){var i=n.previousElementSibling;e?R1(i).is(e)&&t.push(i):t.push(i),n=i}return R1(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}}()),j1}function Y1(e){return void 0===e&&(e={}),F1||(F1=function(e){var t=(void 0===e?{}:e).userAgent,n=X1(),i=S1(),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_]+))?/),d=!l&&o.match(/(iPhone\sOS|iOS)\s([\d_]+)/),f="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&&!f&&(a.os="android",a.android=!0),(l||d||h)&&(a.os="ios",a.ios=!0),a}(e)),F1}function K1(){return B1||(B1=function(){var e,t=S1();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)}}()),B1}var $1={name:"resize",create:function(){var e=this;W1(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=S1();e.params.resizeObserver&&void 0!==S1().ResizeObserver?e.resize.createObserver():(t.addEventListener("resize",e.resize.resizeHandler),t.addEventListener("orientationchange",e.resize.orientationChangeHandler))},destroy:function(e){var t=S1();e.resize.removeObserver(),t.removeEventListener("resize",e.resize.resizeHandler),t.removeEventListener("orientationchange",e.resize.orientationChangeHandler)}}};function Q1(){return(Q1=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=V1(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!==k1()&&n!==S1()?(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,d=o.edgeSwipeDetection||o.iOSEdgeSwipeDetection,f=o.edgeSwipeThreshold||o.iOSEdgeSwipeThreshold;if(d&&(l<=f||l>=i.innerWidth-f)){if("prevent"!==d)return;e.preventDefault()}if(W1(r,{isTouched:!0,isMoved:!1,allowTouchCallbacks:!0,isScrolling:void 0,startMoving:void 0}),a.startX=l,a.startY=h,r.touchStartTime=U1(),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&&V1(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 t2(e){var t=k1(),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&&(W1(o,{startX:c,startY:l,currentX:c,currentY:l}),i.touchStartTime=U1()));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&&V1(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,d=o.currentY-o.startY;if(!(n.params.threshold&&Math.sqrt(Math.pow(h,2)+Math.pow(d,2))=25&&(f=180*Math.atan2(Math.abs(d),Math.abs(h))/Math.PI,i.isScrolling=n.isHorizontal()?f>r.touchAngle:90-f>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:d;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:U1()})),n.updateProgress(i.currentTranslate),n.setTranslate(i.currentTranslate))}}}}}}function n2(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=U1(),d=h-n.touchStartTime;if(t.allowClick&&(t.updateClickedSlide(c),t.emit("tap click",c),d<300&&h-n.lastClickTime<300&&t.emit("doubleTap doubleClick",c)),n.lastClickTime=U1(),z1(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 f=n.velocities.pop(),p=n.velocities.pop(),v=f.time-p.time;t.velocity=(f.position-p.position)/v,t.velocity/=2,Math.abs(t.velocity)150||U1()-f.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 E=0,O=t.slidesSizesGrid[0],T=0;T=s[T]&&l=s[T]&&(E=T,O=s[s.length-1]-s[s.length-2])}var A=(l-s[E])/O,M=Ei.longSwipesMs){if(!i.longSwipes)return void t.slideTo(t.activeIndex);"next"===t.swipeDirection&&t.slideTo(A>=i.longSwipesRatio?E+M:E),"prev"===t.swipeDirection&&t.slideTo(A>1-i.longSwipesRatio?E+M:E)}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(E+M),"prev"===t.swipeDirection&&t.slideTo(E)):t.slideTo(c.target===t.navigation.nextEl?E+M:E)}}}}function i2(){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 r2(e){var t=this;!t.enabled||t.allowClick||(t.params.preventClicks&&e.preventDefault(),t.params.preventClicksPropagation&&t.animating&&(e.stopPropagation(),e.stopImmediatePropagation()))}function o2(){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 a2=!1;function s2(){}var u2={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 c2={modular:{useParams:function(e){var t=this;!t.modules||Object.keys(t.modules).forEach(function(n){var i=t.modules[n];i.params&&W1(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,P=x/T,A=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>A||D===A&&N===T-1)&&(N+=1)>=T&&(N=0,D+=1)):D=M-(N=Math.floor(M/P))*P;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&&d.push(_),f.push(_)):(i.roundLengths&&(_=Math.floor(_)),(k-Math.min(e.params.slidesPerGroupSkip,k))%e.params.slidesPerGroup==0&&d.push(_),f.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(((C={})[t("width")]=e.virtualSize+i.spaceBetween+"px",C)),i.slidesPerColumn>1&&(e.virtualSize=(O+i.spaceBetween)*x,e.virtualSize=Math.ceil(e.virtualSize/i.slidesPerColumn)-i.spaceBetween,r.css(((E={})[t("width")]=e.virtualSize+i.spaceBetween+"px",E)),i.centeredSlides)){S=[];for(var K=0;K1&&d.push(e.virtualSize-o)}if(0===d.length&&(d=[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;d=d.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=V1(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),W1(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 d=Math.min(a.slidesPerGroupSkip,l);t=d+Math.floor((l-d)/a.slidesPerGroup)}if(t>=o.length&&(t=o.length-1),l!==s){var f=parseInt(n.slides.eq(l).attr("data-swiper-slide-index")||l,10);W1(n,{snapIndex:t,realIndex:f,previousIndex:s,activeIndex:l}),n.emit("activeIndexChange"),n.emit("snapIndexChange"),u!==f&&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=V1(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),(d||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!==d&&(!a.allowSlideNext&&ya.translate&&y>a.maxTranslate()&&(d||0)!==s))return!1;if(m=s>d?"next":s=e&&(d=e)}),void 0!==d&&(c=a.indexOf(d))<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(V1(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(),z1(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(),z1(function(){t.slideTo(o)})):t.slideTo(o)}else t.slideTo(o)}},loop:{loopCreate:function(){var e=this,t=k1(),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=V1(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(V1(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 d=0;d1,d=l.slidesPerColumn>1,f=o.enabled;h&&!d?(a.removeClass(o.containerModifierClass+"multirow "+o.containerModifierClass+"multirow-column"),e.emitContainerClasses()):!h&&d&&(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(),W1(e.params,l);var g=e.params.enabled;W1(e,{allowTouchMove:e.params.allowTouchMove,allowSlideNext:e.params.allowSlideNext,allowSlidePrev:e.params.allowSlidePrev}),f&&!g?e.disable():!f&&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=S1(),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=S1();function u(){o&&o()}V1(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 V1(n.el).each(function(t){var i=W1({},n,{el:t});a.push(new e(i))}),a}var s=this;s.__swiper__=!0,s.support=X1(),s.device=Y1({userAgent:n.userAgent}),s.browser=K1(),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=W1({},u2);return s.useParams(l),s.params=W1({},l,l2,n),s.originalParams=W1({},s.params),s.passedParams=W1({},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.$=V1,W1(s,{enabled:s.params.enabled,el:t,classNames:[],slides:V1(),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:U1(),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=V1(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=V1(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=k1().createElement("div");r=V1(o),o.className=t.params.wrapperClass,n.append(o),n.children("."+t.params.slideClass).each(function(e){r.append(e)})}return W1(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){W1(l2,e)},e.installModule=function(t){e.prototype.modules||(e.prototype.modules={});var n=t.name||Object.keys(e.prototype.modules).length+"_"+U1();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]:V2(e[n],t[n]):e[n]=t[n]):e[n]=t[n]})}function z2(e){return null!=e&&"false"!="".concat(e)}var U2=["pagination","navigation","scrollbar","virtual"];function H2(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return F2(e)?e:!0===z2(e)&&t}var G2=["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 W2(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={on:{}},n={};V2(t,d2.defaults),V2(t,d2.extendedDefaults),t._emitClasses=!0;var i={};return Object.keys(e).forEach(function(r){var o=r.replace(/^_/,"");void 0!==e[o]&&(G2.indexOf(o)>=0?F2(e[o])?(t[o]={},n[o]={},V2(t[o],e[o]),V2(n[o],e[o])):(t[o]=e[o],n[o]=e[o]):i[o]=e[o])}),{params:t,passedParams:n,rest:i}}var q2=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=z2(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)(Os(Ac))},e.\u0275dir=Rt({type:e,selectors:[["ng-template","swiperSlide",""]],inputs:{class:"class",zoom:"zoom",virtualIndex:"virtualIndex"}}),e}(),X2=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 ol,this.s__containerClasses=new ol,this.s__slideClass=new ol,this.s__swiper=new ol,this.s_activeIndexChange=new ol,this.s_afterInit=new ol,this.s_autoplay=new ol,this.s_autoplayStart=new ol,this.s_autoplayStop=new ol,this.s_beforeDestroy=new ol,this.s_beforeInit=new ol,this.s_beforeLoopFix=new ol,this.s_beforeResize=new ol,this.s_beforeSlideChangeStart=new ol,this.s_beforeTransitionStart=new ol,this.s_breakpoint=new ol,this.s_changeDirection=new ol,this.s_click=new ol,this.s_doubleTap=new ol,this.s_doubleClick=new ol,this.s_destroy=new ol,this.s_fromEdge=new ol,this.s_hashChange=new ol,this.s_hashSet=new ol,this.s_imagesReady=new ol,this.s_init=new ol,this.s_keyPress=new ol,this.s_lazyImageLoad=new ol,this.s_lazyImageReady=new ol,this.s_loopFix=new ol,this.s_momentumBounce=new ol,this.s_navigationHide=new ol,this.s_navigationShow=new ol,this.s_observerUpdate=new ol,this.s_orientationchange=new ol,this.s_paginationHide=new ol,this.s_paginationRender=new ol,this.s_paginationShow=new ol,this.s_paginationUpdate=new ol,this.s_progress=new ol,this.s_reachBeginning=new ol,this.s_reachEnd=new ol,this.s_realIndexChange=new ol,this.s_resize=new ol,this.s_scroll=new ol,this.s_scrollbarDragEnd=new ol,this.s_scrollbarDragMove=new ol,this.s_scrollbarDragStart=new ol,this.s_setTransition=new ol,this.s_setTranslate=new ol,this.s_slideChange=new ol,this.s_slideChangeTransitionEnd=new ol,this.s_slideChangeTransitionStart=new ol,this.s_slideNextTransitionEnd=new ol,this.s_slideNextTransitionStart=new ol,this.s_slidePrevTransitionEnd=new ol,this.s_slidePrevTransitionStart=new ol,this.s_slideResetTransitionStart=new ol,this.s_slideResetTransitionEnd=new ol,this.s_sliderMove=new ol,this.s_sliderFirstMove=new ol,this.s_slidesLengthChange=new ol,this.s_slidesGridLengthChange=new ol,this.s_snapGridLengthChange=new ol,this.s_snapIndexChange=new ol,this.s_tap=new ol,this.s_toEdge=new ol,this.s_touchEnd=new ol,this.s_touchMove=new ol,this.s_touchMoveOpposite=new ol,this.s_touchStart=new ol,this.s_transitionEnd=new ol,this.s_transitionStart=new ol,this.s_update=new ol,this.s_zoomChange=new ol,this.s_swiper=new ol,this.indexChange=new ol,this._activeSlides=new ae,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=$d(a.slides.slice(a.slides.length-a.loopedSlides)),a.appendSlides=$d(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=H2(e,{nextEl:r||null,prevEl:o||null}),this.showNavigation=!(!0!==z2(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=H2(e,{el:n||null}),this.showPagination=B2(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=H2(e,{el:n||null}),this.showScrollbar=B2(e,this._scrollbar,this._scrollbarElRef)}},{key:"virtual",get:function(){return this._virtual},set:function(e){this._virtual=H2(e)}},{key:"index",set:function(e){this.setIndex(e)}},{key:"config",set:function(e){this.updateSwiper(e);var t=W2(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:$d(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=W2(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=W2(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=d2.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=F2(this.swiperRef.params[n]);if(Object.keys(this.swiperRef.modules).indexOf(n)>=0){var r=this.swiperRef.modules[n].params[n];i?V2(this.swiperRef.params[n],r):this.swiperRef.params[n]=r}i&&F2(t)?V2(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)(Os(Xl),Os(Ju),Os(Cc),Os(Ml))},e.\u0275cmp=Ot({type:e,selectors:[["swiper"],["","swiper",""]],contentQueries:function(e,t,n){var i;(1&e&&bl(n,q2,4),2&e)&&(ml(i=_l())&&(t.slidesEl=i))},viewQuery:function(e,t){var n;(1&e&&(yl(f2,5),yl(p2,5),yl(v2,5),yl(g2,5)),2&e)&&(ml(n=_l())&&(t.prevElRef=n.first),ml(n=_l())&&(t.nextElRef=n.first),ml(n=_l())&&(t.scrollbarElRef=n.first),ml(n=_l())&&(t.paginationElRef=n.first))},hostVars:2,hostBindings:function(e,t){2&e&&du(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:[qt],ngContentSelectors:j2,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&&(Xs(R2),Ys(0),Cs(1,m2,5,0,"ng-container",0),Cs(2,y2,2,0,"div",1),Cs(3,b2,2,0,"div",2),As(4,"div",3),Ys(5,1),Cs(6,w2,1,0,void 0,4),Cs(7,x2,1,0,void 0,4),Cs(8,C2,1,0,void 0,4),Ys(9,2),Ms(),Ys(10,3),Cs(11,I2,2,3,"ng-template",null,5,Sl)),2&e){var n=Es(12);Yo(1),Ts("ngIf",t.navigation&&t.showNavigation),Yo(1),Ts("ngIf",t.scrollbar&&t.showScrollbar),Yo(1),Ts("ngIf",t.pagination&&t.showPagination),Yo(1),Ts("ngClass",t.wrapperClass),ks("id",t.id),Yo(2),Ts("ngTemplateOutlet",n)("ngTemplateOutletContext",$c(11,D2,t.prependSlides)),Yo(1),Ts("ngTemplateOutlet",n)("ngTemplateOutletContext",$c(13,N2,t.activeSlides)),Yo(1),Ts("ngTemplateOutlet",n)("ngTemplateOutletContext",$c(15,L2,t.appendSlides))}},directives:[Yh,Gh,nd,qh,Zh,Jh,ed],pipes:[sd],styles:["\n swiper {\n display: block;\n }\n "],encapsulation:2,changeDetection:0}),e}(),Y2=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({imports:[[cd]]}),e}();function K2(e,t){if(1&e){var n=Ls();As(0,"div",7),As(1,"div",8),Cu(2),Ms(),As(3,"a",9),Vs("click",function(){bn(n);var e=Ws().$implicit;return Ws().linkClicked.emit(e)}),Cu(4," DATA "),As(5,"mat-icon"),Cu(6,"open_in_new"),Ms(),Ms(),Ms()}if(2&e){var i=Ws().$implicit;Yo(1),uu("background-image","url("+i.thumbnail+")"),Yo(1),Ou(" ",i.technology," ")}}function $2(e,t){1&e&&(Rs(0),Cs(1,K2,7,3,"ng-template",6),Ds())}var Q2=function(){var e=-1;return function(){return e+=1}}(),Z2=function(){var e=function(){function e(){m(this,e),this.className="ccf-thumbnail-carousel",this.linkClicked=new ol,this.uid=Q2(),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=Ot({type:e,selectors:[["ccf-thumbnail-carousel"]],hostVars:2,hostBindings:function(e,t){2&e&&du(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&&(As(0,"div",0),As(1,"button",1),As(2,"mat-icon"),Cu(3,"navigate_before"),Ms(),Ms(),Ms(),As(4,"swiper",2),Cs(5,$2,2,0,"ng-container",3),Ms(),As(6,"div",4),As(7,"button",1),Is(8,"div",5),As(9,"mat-icon"),Cu(10,"navigate_next"),Ms(),Ms(),Ms()),2&e&&(Yo(1),ks("id",t.prevButtonId),Yo(3),Ts("config",t.config)("navigation",t.navigation),Yo(1),Ts("ngForOf",t.data)("ngForTrackBy",t.itemId),Yo(2),ks("id",t.nextButtonId))},directives:[q_,B_,X2,qh,q2],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 J2(e,t){if(1&e){var n=Ls();As(0,"mat-icon",14),Vs("click",function(){return bn(n),Ws().toggleExpansion()}),Cu(1),Ms()}if(2&e){var i=Ws();Yo(1),Eu(i.expanded?"expand_less":"expand_more")}}function e3(e,t){if(1&e&&Is(0,"ccf-tissue-section-vis",20),2&e){var n=Ws(2);Ts("totalTissueSections",n.tissueBlock.sectionCount)("tissueSections",n.tissueBlock.sections)}}function t3(e,t){if(1&e){var n=Ls();Rs(0),As(1,"ccf-thumbnail-carousel",21),Vs("linkClicked",function(e){return bn(n),Ws(2).linkHandler(e.link)}),Ms(),Ds()}if(2&e){var i=Ws(2);Yo(1),Ts("data",i.tissueBlock.datasets)}}function n3(e,t){if(1&e){var n=Ls();Rs(0),As(1,"ccf-thumbnail-carousel",21),Vs("linkClicked",function(e){return bn(n),Ws(3).linkHandler(e.link)}),Ms(),Ds()}if(2&e){var i=Ws().$implicit;Yo(1),Ts("data",i.datasets)}}function i3(e,t){if(1&e){var n=Ls();As(0,"div",22),As(1,"div",23),As(2,"mat-icon",24),Cu(3,"bubble_chart"),Ms(),As(4,"div",17),As(5,"div",8),Cu(6),Ms(),As(7,"div",8),Cu(8),Ms(),Ms(),As(9,"div",9),Vs("click",function(){var e=bn(n).$implicit;return Ws(2).linkHandler(e.link)}),As(10,"div",10),Cu(11,"TISSUE SECTION"),Ms(),As(12,"mat-icon",11),Cu(13,"open_in_new"),Ms(),Ms(),Ms(),Cs(14,n3,2,1,"ng-container",13),Ms()}if(2&e){var i=t.$implicit;Yo(6),Eu(i.label),Yo(2),Eu(i.description),Yo(6),Ts("ngIf",i.datasets.length>0)}}function r3(e,t){if(1&e){var n=Ls();Rs(0),As(1,"div",15),As(2,"div",16),As(3,"mat-icon",5),Cu(4,"bubble_chart"),Ms(),As(5,"div",17),As(6,"div",8),Cu(7),Ms(),As(8,"div",8),Cu(9),Ms(),Ms(),As(10,"div",9),Vs("click",function(){bn(n);var e=Ws();return e.linkHandler(e.tissueBlock.link)}),As(11,"div",10),Cu(12,"TISSUE BLOCK"),Ms(),As(13,"mat-icon",11),Cu(14,"open_in_new"),Ms(),Ms(),Ms(),Cs(15,e3,1,2,"ccf-tissue-section-vis",18),Cs(16,t3,2,1,"ng-container",13),Ms(),Cs(17,i3,15,3,"div",19),Ds()}if(2&e){var i=Ws();Yo(7),Eu(i.tissueBlock.label),Yo(2),Eu(i.tissueBlock.description),Yo(6),Ts("ngIf",i.tissueBlock.sections.length>1),Yo(1),Ts("ngIf",i.tissueBlock.datasets.length>0),Yo(1),Ts("ngForOf",i.tissueBlock.sections)}}var o3=function(e){return{"background-color":e}},a3=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 ol,this.linkClick=new ol,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)(Os(yq))},e.\u0275cmp=Ot({type:e,selectors:[["ccf-donor-card"]],hostVars:2,hostBindings:function(e,t){2&e&&du(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&&(As(0,"div",0),As(1,"div",1),Vs("click",function(){return t.handleCheckbox()}),Is(2,"mat-checkbox",2),Ms(),As(3,"div",3),As(4,"div",4),As(5,"mat-icon",5),Cu(6,"person"),Ms(),As(7,"div",6),As(8,"div",7),Cu(9),Ms(),As(10,"div",8),Cu(11),Ms(),Ms(),Ms(),As(12,"div",9),Vs("click",function(){return t.linkHandler(t.tissueBlock.donor.link)}),As(13,"div",10),Cu(14,"DONOR"),Ms(),As(15,"mat-icon",11),Cu(16,"open_in_new"),Ms(),Ms(),Cs(17,J2,2,1,"mat-icon",12),Ms(),Ms(),Cs(18,r3,18,5,"ng-container",13)),2&e&&(Yo(1),cu("selected",t.selected)("highlighted",t.highlighted),Ts("ngStyle",$c(18,o3,t.selected?t.color:"transparent")),Yo(1),cu("checkselected",t.selected),Ts("checked",t.selected),Yo(1),cu("hover-enabled",t.selected)("expanded",t.expanded)("highlighted",t.highlighted),Yo(6),Eu(t.tissueBlock.donor.label),Yo(2),Eu(t.tissueBlock.donor.description),Yo(6),Ts("ngIf",t.selected),Yo(1),Ts("ngIf",t.expanded))},directives:[td,e$,B_,Yh,qh,y1,Z2],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 s3(e,t){if(1&e&&(As(0,"div",7),As(1,"div",8),Cu(2),Ms(),As(3,"div",9),Cu(4),Ms(),Ms()),2&e){var n=t.$implicit;Yo(2),Eu(n.count),Yo(2),Eu(n.label)}}function u3(e,t){if(1&e){var n=Ls();As(0,"div",10),Vs("mouseenter",function(){var e=bn(n).$implicit;return Ws().handleHover(e.tissueBlock.spatialEntityId)})("mouseleave",function(){return bn(n),Ws().handleUnhover()}),As(1,"ccf-donor-card",11),Vs("checked",function(e){var t=bn(n).$implicit;return Ws().handleSelection(t,e)})("linkClick",function(e){return bn(n),Ws().handleLinkClick(e)}),Ms(),Ms()}if(2&e){var i=t.$implicit,r=Ws();Yo(1),Ts("tissueBlock",i.tissueBlock)("selected",i.selected)("color",i.color)("highlighted",i.tissueBlock.spatialEntityId===r.highlighted)}}var c3=function(){var e=function(){function e(t){m(this,e),this.ga=t,this.linkClicked=new ol,this.listResultSelected=new ol,this.listResultDeselected=new ol,this.itemHovered=new ol,this.itemUnhovered=new ol,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)(Os(yq))},e.\u0275cmp=Ot({type:e,selectors:[["ccf-results-browser"]],inputs:{listResults:"listResults",aggregateData:"aggregateData",resultLabel:"resultLabel",highlighted:"highlighted",header:"header"},outputs:{linkClicked:"linkClicked",listResultSelected:"listResultSelected",listResultDeselected:"listResultDeselected",itemHovered:"itemHovered",itemUnhovered:"itemUnhovered"},decls:8,vars:7,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&&(As(0,"div",0),As(1,"div",1),As(2,"div",2),Cu(3),Ms(),Cs(4,s3,5,2,"div",3),Ms(),As(5,"div",4),Vs("scroll",function(e){return t.onScroll(e)}),Cs(6,u3,2,4,"div",5),Ms(),Is(7,"div",6),Ms()),2&e&&(Yo(3),Eu(t.resultLabel),Yo(1),Ts("ngForOf",t.aggregateData),Yo(1),cu("header-hidden",!t.header),Yo(1),Ts("ngForOf",t.listResults),Yo(1),cu("hidden",!!t.atScrollBottom))},directives:[qh,a3],styles:[".results-browser-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:calc(100% - 3rem);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:column;overflow-y:auto;scrollbar-width:thin;padding-right:.5rem;height:calc(100vh - 20rem)}.results-browser-container[_ngcontent-%COMP%] .results-browser-list.header-hidden[_ngcontent-%COMP%]{height:calc(100vh - 16rem)}.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:3rem;width:95%;bottom:0;pointer-events:none}.results-browser-container[_ngcontent-%COMP%] .scroll-gradient.hidden[_ngcontent-%COMP%]{display:none}"],changeDetection:0}),e}(),l3=["*",[["mat-toolbar-row"]]],h3=["*","mat-toolbar-row"],d3=ab(function(){return function e(t){m(this,e),this._elementRef=t}}()),f3=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275dir=Rt({type:e,selectors:[["mat-toolbar-row"]],hostAttrs:[1,"mat-toolbar-row"],exportAs:["matToolbarRow"]}),e}(),p3=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}(d3);return e.\u0275fac=function(t){return new(t||e)(Os(Ju),Os(qf),Os(bh))},e.\u0275cmp=Ot({type:e,selectors:[["mat-toolbar"]],contentQueries:function(e,t,n){var i;(1&e&&bl(n,f3,5),2&e)&&(ml(i=_l())&&(t._toolbarRows=i))},hostAttrs:[1,"mat-toolbar"],hostVars:4,hostBindings:function(e,t){2&e&&cu("mat-toolbar-multiple-rows",t._toolbarRows.length>0)("mat-toolbar-single-row",0===t._toolbarRows.length)},inputs:{color:"color"},exportAs:["matToolbar"],features:[cs],ngContentSelectors:h3,decls:2,vars:0,template:function(e,t){1&e&&(Xs(l3),Ys(0),Ys(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}(),v3=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({imports:[[rb],rb]}),e}();function g3(e,t){if(1&e&&(As(0,"a",5),Cu(1,"LOGIN"),Ms()),2&e){var n=Ws();cu("disabled",n.loginDisabled||!n.homeUrl),Ts("href",n.homeUrl+"login",Xr)}}function m3(e,t){if(1&e&&(As(0,"a",5),Cu(1,"LOGOUT"),Ms()),2&e){var n=Ws();cu("disabled",n.loginDisabled||!n.homeUrl),Ts("href",n.homeUrl+"logout",Xr)}}var y3=function(){var e=function e(){m(this,e),this.refreshClicked=new ol,this.downloadClicked=new ol};return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=Ot({type:e,selectors:[["ccf-header"]],inputs:{homeUrl:"homeUrl",loginDisabled:"loginDisabled",logoTooltip:"logoTooltip",loggedIn:"loggedIn",filters:"filters"},outputs:{refreshClicked:"refreshClicked",downloadClicked:"downloadClicked"},decls:6,vars:4,consts:[[1,"ccf-header"],[1,"home",3,"href"],["aria-hidden","false","aria-label","Reset tool","matTooltipPosition","right",1,"logo",3,"matTooltip"],[1,"filler"],["mat-button","","class","authentication","rel","noreferrer noopener","target","_blank",3,"disabled","href",4,"ngIf"],["mat-button","","rel","noreferrer noopener","target","_blank",1,"authentication",3,"href"]],template:function(e,t){1&e&&(As(0,"mat-toolbar",0),As(1,"a",1),Is(2,"div",2),Ms(),Is(3,"div",3),Cs(4,g3,2,3,"a",4),Cs(5,m3,2,3,"a",4),Ms()),2&e&&(Yo(1),Ts("href",t.homeUrl,Xr),Yo(1),Ts("matTooltip",t.logoTooltip),Yo(2),Ts("ngIf",!t.loggedIn),Yo(1),Ts("ngIf",t.loggedIn))},directives:[p3,Ow,Yh,X_],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%] .home[_ngcontent-%COMP%]{height:100%;width:25rem;align-items:center;display:flex;padding:.25rem 0}.ccf-header[_ngcontent-%COMP%] .logo[_ngcontent-%COMP%]{width:100%;height:50%;background-repeat:no-repeat;background-size:contain}.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}.ccf-header[_ngcontent-%COMP%] .disabled[_ngcontent-%COMP%]{display:none}"],changeDetection:0}),e}(),b3=["bodyUI"];function _3(e,t){if(1&e&&(Is(0,"ccf-header",34),Jc(1,"async"),Jc(2,"async"),Jc(3,"async"),Jc(4,"async")),2&e){var n=Ws();cu("hide",!1===el(1,6,n.header$)),Ts("logoTooltip",el(2,8,n.logoTooltip$))("homeUrl",el(3,10,n.homeUrl$))("loggedIn",n.loggedIn)("loginDisabled",el(4,12,n.loginDisabled$))}}function w3(e,t){if(1&e){var n=Ls();As(0,"div",35),Vs("click",function(){bn(n),Ws();var e=Es(72);return e.expanded=!e.expanded}),As(1,"mat-icon",36),Cu(2),Ms(),Ms()}if(2&e){Ws();var i=Es(72);Yo(2),Ou(" ",i.expanded?"arrow_drop_up":"arrow_drop_down"," ")}}function k3(e,t){if(1&e){var n=Ls();As(0,"div",35),Vs("click",function(){bn(n);var e=Ws();return e.organListVisible=!e.organListVisible}),As(1,"mat-icon",37),Cu(2),Ms(),Ms()}if(2&e){var i=Ws();Yo(2),Ou(" ",i.organListVisible?"arrow_drop_up":"arrow_drop_down"," ")}}var x3=function(){return{}},S3=function(){return{x:2.2,y:2,z:.4}},C3=function(){function e(n,i,r,o,a,s,u,c,l,h,d,f){var p=this;m(this,e),this.data=r,this.theming=o,this.scene=a,this.listResultsState=s,this.consentService=u,this.snackbar=c,this.dataSource=h,this.globalConfig=d,this.setSelectedSearches=vQ(AQ),this.removeSpatialSearch=vQ(PQ),this.ontologySelectionLabel="body",this.cellTypeSelectionLabel="cell",this.selectionLabel="body | cell",this.organListVisible=!0,this.url="",this.acceptableViewerDomains=pQ.acceptableViewerDomains||[],this.viewerOpen=!1,this.spinnerActive$=this.data.queryStatus$.pipe(ce(function(e){return e===xQ.Running})),this.loadingMessage$=this.data.state$.pipe(cG("statusMessage")),this.theme$=this.globalConfig.getOption("theme"),this.themeMode$=new Bf(1),this.header$=this.globalConfig.getOption("header"),this.homeUrl$=this.globalConfig.getOption("homeUrl"),this.logoTooltip$=this.globalConfig.getOption("logoTooltip"),this.loginDisabled$=this.globalConfig.getOption("loginDisabled"),o.initialize(n,i),l.setRootElement(n),r.tissueBlockData$.subscribe(),r.aggregateData$.subscribe(),r.ontologyTermOccurencesData$.subscribe(),r.cellTypeTermOccurencesData$.subscribe(),r.sceneData$.subscribe(),r.filter$.subscribe(),r.technologyFilterData$.subscribe(),r.providerFilterData$.subscribe(),this.ontologyTerms$=r.filter$.pipe(cG("ontologyTerms")),this.cellTypeTerms$=r.filter$.pipe(cG("cellTypeTerms")),J_([this.theme$,this.themeMode$]).subscribe(function(e){var n=t(e,2),i=n[0],r=n[1];p.theming.setTheme("".concat(i,"-theme-").concat(r)),f.markForCheck()})}return b(e,[{key:"isLightTheme",get:function(){return this.theming.getTheme().endsWith("light")}},{key:"ngOnInit",value:function(){var e=this,t=this.snackbar.openFromComponent(I$,{data:{preClose:function(){t.dismiss()}},duration:"not-set"===this.consentService.consent?1/0:3e3});window.matchMedia?(window.matchMedia("(prefers-color-scheme: dark)").matches?this.themeMode$.next("dark"):this.themeMode$.next("light"),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",function(t){e.themeMode$.next(t.matches?"dark":"light")})):this.themeMode$.next("light")}},{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.themeMode$.next(this.isLightTheme?"dark":"light")}},{key:"ontologySelected",value:function(e,t){if(e)return"anatomical-structures"===t?(this.data.updateFilter({ontologyTerms:e.map(function(e){return e.id})}),this.ontologySelectionLabel=this.createSelectionLabel(e)):(this.data.updateFilter({cellTypeTerms:e.map(function(e){return e.id})}),this.cellTypeSelectionLabel=this.createSelectionLabel(e)),this.selectionLabel=this.ontologySelectionLabel&&this.cellTypeSelectionLabel?"".concat(this.ontologySelectionLabel," | ").concat(this.cellTypeSelectionLabel):this.ontologySelectionLabel?"".concat(this.ontologySelectionLabel):this.cellTypeSelectionLabel?"".concat(this.cellTypeSelectionLabel):"",void(e[0]&&"body"===e[0].label&&this.resetView());this.data.updateFilter({ontologyTerms:[],cellTypeTerms:[]}),this.ontologySelectionLabel="",this.cellTypeSelectionLabel=""}},{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}();function E3(e,t){1&e&&Is(0,"ccf-root")}function O3(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=fQ.json(e);if(n(i))return i}else if(n(e))return e;throw new Error("Invalid data sources")}C3.\u0275fac=function(e){return new(e||C3)(Os(Ju),Os(ss),Os(EQ),Os(cQ),Os(BQ),Os(jQ),Os(wq),Os(bw),Os(sQ),Os(N$),Os(T$),Os(Cc))},C3.\u0275cmp=Ot({type:C3,selectors:[["ccf-root"]],viewQuery:function(e,t){var n;(1&e&&yl(b3,5),2&e)&&(ml(n=_l())&&(t.bodyUI=n.first))},decls:83,vars:117,consts:[[1,"ccf-app","mat-app-background"],[3,"text","active"],[3,"hide","logoTooltip","homeUrl","loggedIn","loginDisabled",4,"ngIf"],[1,"main-drawers"],["opened","",1,"left-drawer",3,"stateChange"],["left",""],[1,"filter-data"],[3,"filters","drawerExpanded","technologyFilters","providerFilters","spatialSearchFilters","filtersChange","spatialSearchSelected","spatialSearchRemoved"],["filterbox",""],[1,"filter-text"],[1,"sex","filter-tag"],[1,"age","filter-tag"],[1,"bmi","filter-tag"],["placeholderText","Search anatomical structures...",1,"ontology-selection",3,"treeModel","termData","occurenceData","header","ontologySelection"],["placeholderText","Search cell types...",1,"cell-type-selection",3,"treeModel","termData","occurenceData","header","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","CCF Exploration User Interface","documentationUrl","assets/docs/README.md","matTooltip","Open Info"],[3,"listResults","aggregateData","resultLabel","highlighted","header","listResultSelected","listResultDeselected","linkClicked","itemHovered","itemUnhovered"],[1,"selector-drawer"],[1,"organ-selector",3,"multiselect","occurenceData","organList","selectedOrgans","organsChanged"],["selector",""],[1,"close-button-wrapper"],["class","close-button",3,"click",4,"ngIf"],[1,"stage-content",3,"scene","bounds","nodeClick","nodeHoverStart","nodeHoverStop"],["bodyUI",""],[3,"logoTooltip","homeUrl","loggedIn","loginDisabled"],[1,"close-button",3,"click"],["aria-hidden","false","aria-label","Expand carousel drawer",1,"expand-collapse-icon"],["aria-hidden","false","aria-label","Close carousel drawer",1,"expand-collapse-icon"]],template:function(e,t){if(1&e){var n=Ls();As(0,"div",0),Is(1,"ccf-spinner-overlay",1),Jc(2,"async"),Jc(3,"async"),Cs(4,_3,5,14,"ccf-header",2),Jc(5,"async"),As(6,"ccf-drawer-container",3),Jc(7,"async"),As(8,"ccf-drawer",4,5),Vs("stateChange",function(){return bn(n),Es(13).removeBox()}),As(10,"div"),As(11,"div",6),As(12,"ccf-filters-popover",7,8),Vs("filtersChange",function(e){return t.data.updateFilter(e)})("spatialSearchSelected",function(e){return t.setSelectedSearches(e)})("spatialSearchRemoved",function(e){return t.removeSpatialSearch(e)}),Jc(14,"async"),Jc(15,"async"),Jc(16,"async"),Jc(17,"async"),Ms(),As(18,"div",9),As(19,"div",10),Cu(20,"Sex: "),As(21,"strong"),Cu(22),Jc(23,"async"),Ms(),Ms(),As(24,"div",11),Cu(25,"Age: "),As(26,"strong"),Cu(27),Jc(28,"async"),Jc(29,"async"),Ms(),Ms(),As(30,"div",12),Cu(31,"BMI: "),As(32,"strong"),Cu(33),Jc(34,"async"),Jc(35,"async"),Ms(),Ms(),Ms(),Ms(),As(36,"ccf-ontology-selection",13),Vs("ontologySelection",function(e){return t.ontologySelected(e,"anatomical-structures")}),Jc(37,"async"),Jc(38,"async"),Jc(39,"async"),Jc(40,"async"),Ms(),As(41,"ccf-ontology-selection",14),Vs("ontologySelection",function(e){return t.ontologySelected(e,"cell-type")}),Jc(42,"async"),Jc(43,"async"),Jc(44,"async"),Jc(45,"async"),Ms(),Is(46,"ccf-drawer-toggle-button"),Ms(),Ms(),As(47,"ccf-drawer",15,16),Vs("stateChange",function(){return bn(n),Es(13).removeBox()}),As(49,"ccf-viewer",17),Vs("closed",function(){return t.viewerOpen=!1}),Ms(),As(50,"div",18),As(51,"div",19),As(52,"button",20),Vs("click",function(){bn(n);var e=Es(13),t=Es(48);return e.removeBox(),t.toggleExpanded()}),As(53,"mat-icon",21),Cu(54),Ms(),Ms(),As(55,"button",22),Vs("click",function(){return t.toggleScheme()}),As(56,"mat-icon",21),Cu(57),Ms(),Ms(),As(58,"button",23),As(59,"mat-icon",24),Vs("click",function(){bn(n);var e=Es(9),i=Es(48),r=Es(13);return t.reset(e,i,r)}),Cu(60,"refresh "),Ms(),Ms(),Ms(),Is(61,"ccf-info-button",25),Ms(),As(62,"ccf-results-browser",26),Vs("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()}),Jc(63,"async"),Jc(64,"async"),Jc(65,"async"),Jc(66,"async"),Ms(),Is(67,"ccf-drawer-toggle-button"),Ms(),As(68,"ccf-drawer-content"),Jc(69,"async"),As(70,"div",27),As(71,"ccf-organ-selector",28,29),Vs("organsChanged",function(e){return t.scene.setSelectedReferenceOrgans(e)}),Jc(73,"async"),Jc(74,"async"),Jc(75,"async"),Ms(),Ms(),As(76,"div",30),Cs(77,w3,3,1,"div",31),Cs(78,k3,3,1,"div",31),Ms(),Is(79,"ccf-run-spatial-search"),As(80,"ccf-body-ui",32,33),Vs("nodeClick",function(e){return t.scene.sceneNodeClicked(e)})("nodeHoverStart",function(e){return t.scene.sceneNodeHovered(e)})("nodeHoverStop",function(){return t.scene.sceneNodeUnhover()}),Jc(82,"async"),Ms(),Ms(),Ms(),Ms()}if(2&e){var i,r,o,a,s=Es(48),u=Es(72);Yo(1),Ts("text",el(2,55,t.loadingMessage$))("active",el(3,57,t.spinnerActive$)),Yo(3),Ts("ngIf",!1===el(5,59,t.spinnerActive$)),Yo(2),cu("header-hidden",!1===el(7,61,t.header$)),Yo(6),Ts("filters",el(14,63,t.data.filter$))("drawerExpanded",s.expanded)("technologyFilters",el(15,65,t.data.technologyFilterData$))("providerFilters",el(16,67,t.data.providerFilterData$))("spatialSearchFilters",el(17,69,t.selectableSearches$)),Yo(10),Eu(null==(i=el(23,71,t.data.filter$))?null:i.sex),Yo(5),Tu("",null==(r=el(28,73,t.data.filter$))?null:r.ageRange[0],"-",null==(r=el(29,75,t.data.filter$))?null:r.ageRange[1],""),Yo(6),Tu("",null==(o=el(34,77,t.data.filter$))?null:o.bmiRange[0],"-",null==(o=el(35,79,t.data.filter$))?null:o.bmiRange[1],""),Yo(3),Ts("treeModel",el(37,81,t.ontologyTreeModel$))("termData",el(38,83,t.data.ontologyTermsFullData$))("occurenceData",el(39,85,t.data.ontologyTermOccurencesData$))("header",el(40,87,t.header$)),Yo(5),Ts("treeModel",el(42,89,t.cellTypeTreeModel$))("termData",el(43,91,t.data.cellTypeTermsFullData$))("occurenceData",el(44,93,t.data.cellTypeTermOccurencesData$))("header",el(45,95,t.header$)),Yo(8),cu("opened",t.viewerOpen),Ts("url",t.url),Yo(3),Ts("matTooltip",s.expanded?"Exit Fullscreen":"Enter Fullscreen"),Yo(2),Eu(s.expanded?"fullscreen_exit":"fullscreen"),Yo(1),Ts("matTooltip",t.isLightTheme?"Enter Dark Mode":"Enter Light Mode"),Yo(2),Ou("",t.isLightTheme?"brightness_2":"brightness_5"," "),Yo(5),Ts("listResults",el(63,97,t.listResultsState.listResults$))("aggregateData",el(64,99,t.data.aggregateData$))("resultLabel",t.selectionLabel)("highlighted",el(65,101,t.listResultsState.highlightedNodeId$))("header",el(66,103,t.header$)),Yo(6),cu("header-hidden",!1===el(69,105,t.header$)),Yo(2),cu("closed",!t.organListVisible)("expanded",u.expanded),Yo(1),Ts("multiselect",!0)("occurenceData",null!==(a=el(73,107,t.data.ontologyTermOccurencesData$))&&void 0!==a?a:Kc(115,x3))("organList",el(74,109,t.scene.referenceOrgans$))("selectedOrgans",el(75,111,t.scene.selectedReferenceOrgans$)),Yo(5),cu("closed",!t.organListVisible),Yo(1),Ts("ngIf",t.organListVisible),Yo(1),Ts("ngIf",!u.expanded),Yo(2),cu("expanded-stage",!t.organListVisible)("selector-expanded",u.expanded),Ts("scene",el(82,113,t.scene.scene$))("bounds",Kc(116,S3))}},directives:[$Q,Yh,hZ,aZ,O0,h1,d1,v1,Ow,B_,C$,c3,nZ,v$,b0,r$,y3],pipes:[sd],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-header.hide[_ngcontent-%COMP%]{display:none}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%]{height:calc(100% - 5rem);width:100%;opacity:1;overflow:hidden;transform:scale(1)}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container.header-hidden[_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%]{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%]{overflow:hidden;border-radius:.5rem;height:calc(100vh - 4rem)}.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;transition:all .5s ease-in-out;height:5rem;justify-content:start}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .selector-drawer.expanded[_ngcontent-%COMP%]{height:15rem;overflow-y:auto}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .selector-drawer.closed[_ngcontent-%COMP%]{height:1.5rem;top:-5rem}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] ccf-run-spatial-search[_ngcontent-%COMP%]{position:relative;float:right;height:0px;z-index:1;top:.5rem;right:.5rem}.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}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .expanded-stage[_ngcontent-%COMP%]{height:calc(100% - 3rem)}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .selector-expanded[_ngcontent-%COMP%]{height:calc(100% - 16.5rem)}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content.header-hidden[_ngcontent-%COMP%]{height:calc(100vh - 1rem)}.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{overflow:hidden}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] .left-drawer[_ngcontent-%COMP%] .cell-type-selection[_ngcontent-%COMP%] .ccf-ontology-search{margin-top:2rem}.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}.ccf-app[_ngcontent-%COMP%] .right-drawer[_ngcontent-%COMP%] .cff-drawer-inner-container{overflow:hidden}[_ngcontent-%COMP%]::-webkit-scrollbar{width:.5rem}"],changeDetection:0}),Mw([Bz(OQ.cellTypesTreeModel)],C3.prototype,"cellTypeTreeModel$",void 0),Mw([Bz(OQ.anatomicalStructuresTreeModel)],C3.prototype,"ontologyTreeModel$",void 0),Mw([Bz(IQ.items)],C3.prototype,"selectableSearches$",void 0),Mw([TK()],C3.prototype,"setSelectedSearches",void 0),Mw([TK()],C3.prototype,"removeSpatialSearch",void 0);var T3=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(Object.assign({},pQ.dbOptions),globalThis.dbOptions),pQ.customization),parse:{dataSources:O3,useRemoteApi:fQ.boolean,header:fQ.boolean,loginDisabled:fQ.boolean}})}return n}(dQ);return e.\u0275fac=function(t){return new(t||e)(Os(T$),Os(Cc))},e.\u0275cmp=Ot({type:e,selectors:[["ccf-root-wc"]],inputs:{dataSources:"dataSources",hubmapDataService:"hubmapDataService",hubmapDataUrl:"hubmapDataUrl",hubmapAssetUrl:"hubmapAssetUrl",hubmapToken:"hubmapToken",hubmapPortalUrl:"hubmapPortalUrl",useRemoteApi:"useRemoteApi",remoteApiEndpoint:"remoteApiEndpoint",theme:"theme",header:"header",homeUrl:"homeUrl",logoTooltip:"logoTooltip",loginDisabled:"loginDisabled"},features:[cs],decls:1,vars:1,consts:[[4,"ngIf"]],template:function(e,t){1&e&&Cs(0,E3,1,0,"ccf-root",0),2&e&&Ts("ngIf",t.initialized)},directives:[Yh,C3],encapsulation:2,changeDetection:0}),e}(),P3=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({imports:[[cd,Y_,V_,v3,Aw]]}),e}(),A3=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)).locator=i,r}return b(n,[{key:"createWorker",value:function(e){var t=this.getWorkerUrl(!0);return new Worker(t,{type:"module"})}},{key:"getWorkerUrl",value:function(e){if(e)return new URL(r(88509),r.b);var t=this.locator.prepareExternalUrl("0-es2015.worker.js"),n=new Blob(["importScripts('".concat(t,"')")],{type:"application/javascript"});return URL.createObjectURL(n)}}]),n}(W$);return e.\u0275fac=function(t){return new(t||e)(Zi(T$),Zi(Th))},e.\u0275prov=$e({token:e,factory:e.\u0275fac,providedIn:"root"}),e}(),M3=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:"selectToken",value:function(e){var t=e.useRemoteApi,n=e.remoteApiEndpoint;return t&&n?U$:"undefined"==typeof Worker||pQ.disableDbWorker?G$:A3}}]),n}(q$);return t.\u0275fac=function(n){return(e||(e=Ti(t)))(n||t)},t.\u0275prov=$e({token:t,factory:t.\u0275fac,providedIn:"root"}),t}(),I3=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({providers:[{provide:Il,useValue:cQ.initialize,multi:!0},cQ]}),e}(),R3=function(){var e=function(){function e(t,n){m(this,e),this.accessor=t,this.injector=n}return b(e,null,[{key:"forRoot",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return{ngModule:e,providers:[qW,WW,HW].concat(v(t))}}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Zi(qW,2),Zi(WW,2))},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({}),e}(),D3=function(e,t){return function(e,t){return new Array(t+1).join("0")}(0,t-e.toString().length)+e},N3=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=QV(this.action),n=function(e){return D3(e.getHours(),2)+":"+D3(e.getMinutes(),2)+":"+D3(e.getSeconds(),2)+"."+D3(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}(),L3=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}(),j3=new Ri("NGXS_LOGGER_PLUGIN_OPTIONS"),F3=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 L3(this._options),this._store=this._store||this._injector.get(Pz);var i=new N3(t,this._store,this._logWriter);return i.dispatched(e),n(e,t).pipe(mv(function(e){i.completed(e)}),Bb(function(e){throw i.errored(e),e}))}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Zi(j3),Zi(ss))},e.\u0275prov=$e({token:e,factory:e.\u0275fac}),e}(),B3=new Ri("LOGGER_USER_OPTIONS");function V3(e){return Object.assign({},{logger:console,collapsed:!1,disabled:!1,filter:function(){return!0}},e)}var z3=function(){var e=function(){function e(){m(this,e)}return b(e,null,[{key:"forRoot",value:function(t){return{ngModule:e,providers:[{provide:UV,useClass:F3,multi:!0},{provide:B3,useValue:t},{provide:j3,useFactory:V3,deps:[B3]}]}}}]),e}();return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({}),e}();function U3(e,t){return e>=0&&e=t?t:e+t<0?0:e+t}function H3(e,t){if(1&e&&(As(0,"span"),Cu(1),Ms()),2&e){var n=t.$implicit;lu(n.styles),du(n.classes),Yo(1),Ou(" ",n.text,"\n")}}var G3=function(){var e=function(){function e(){m(this,e),this.clsName="ccf-decorated-text",this.segments=[]}return b(e,[{key:"ngOnChanges",value:function(e){("text"in e||"decorations"in e)&&(this.segments=this.createSegments())}},{key:"createSegments",value:function(){var e=this.text;if(!e)return[this.makeUndecoratedSegment(e)];var t=this.getNormalizedDecorations();if(0===t.length)return[this.makeUndecoratedSegment(e)];var n=this.createStackOps(t),i=[],r=[],o=0;0===n[0].index&&(r=this.updateStack(r,n.shift()));var a,s=_(n);try{for(s.s();!(a=s.n()).done;){var u=a.value;i.push(this.makeDecoratedSegment(e.slice(o,u.index),r)),o=u.index,r=this.updateStack(r,u)}}catch(c){s.e(c)}finally{s.f()}return o!==e.length&&i.push(this.makeDecoratedSegment(e.slice(o),r)),i}},{key:"createStackOps",value:function(e){var t,n={},i=function(e){var t;return null!==(t=n[e])&&void 0!==t?t:n[e]={index:e,added:[],removed:[]}},r=_(e);try{for(r.s();!(t=r.n()).done;){var o=t.value;i(o.start).added.push(o),i(o.end).removed.push(o)}}catch(a){r.e(a)}finally{r.f()}return Object.entries(n).sort(function(e,t){return+e[0]-+t[0]}).map(function(e){return e[1]})}},{key:"updateStack",value:function(e,t){return e.filter(function(e){return!t.removed.includes(e)}).concat(t.added)}},{key:"getNormalizedDecorations",value:function(){var e=this.decorations,t=void 0===e?[]:e,n=this.text.length;return t.map(function(e){return function(e,t){var n,i,r,o;return{start:U3(null!==(n=e.start)&&void 0!==n?n:0,t),end:U3(null!==(i=e.end)&&void 0!==i?i:t,t),classes:null!==(r=e.classes)&&void 0!==r?r:[],styles:null!==(o=e.styles)&&void 0!==o?o:{}}}(e,n)}).filter(function(e){return e.startt?e[0]:void 0,max:e[1]1&&void 0!==arguments[1]?arguments[1]:Date.now;return+t()>+new Date(e)}}]),e}();m5.\u0275fac=function(e){return new(e||m5)(Zi(FG),Zi(yq),Zi(f5),Zi(v5),Zi(h_))},m5.\u0275prov=$e({token:m5,factory:m5.\u0275fac}),Mw([jz(a5)],m5.prototype,"learnMore",null),Mw([jz(s5)],m5.prototype,"open",null),Mw([jz(u5)],m5.prototype,"close",null),m5=p5=Mw([Fz({name:"callToAction",defaults:{title:"New to the Exploration User Interface",message:"Spatial Search has arrived!",callToAction:"Learn More",imageUrl:"assets/images/spatial_search.gif",expirationDate:"Dec 1, 2022",popupShown:!1}})],m5);var y5=function(){function e(){m(this,e)}return b(e,null,[{key:"title",value:function(e){return e.title}},{key:"message",value:function(e){return e.message}},{key:"callToAction",value:function(e){return e.callToAction}},{key:"imageUrl",value:function(e){return e.imageUrl}},{key:"expirationDate",value:function(e){return e.expirationDate}},{key:"popupShown",value:function(e){return e.popupShown}}]),e}();Mw([Vz([m5])],y5,"title",null),Mw([Vz([m5])],y5,"message",null),Mw([Vz([m5])],y5,"callToAction",null),Mw([Vz([m5])],y5,"imageUrl",null),Mw([Vz([m5])],y5,"expirationDate",null),Mw([Vz([m5])],y5,"popupShown",null);var b5=function(){var e=function(){function e(){m(this,e),this.clsName="ccf-call-to-action",this.callToActionClicked=new ol,this.closeClicked=new ol}return b(e,[{key:"close",value:function(){this.closeClicked.emit()}},{key:"onDialogButtonClick",value:function(){this.callToActionClicked.emit()}}]),e}();return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=Ot({type:e,selectors:[["ccf-call-to-action"]],hostVars:2,hostBindings:function(e,t){2&e&&du(t.clsName)},inputs:{infoTitle:"infoTitle",imageUrl:"imageUrl",message:"message",callToAction:"callToAction"},outputs:{callToActionClicked:"callToActionClicked",closeClicked:"closeClicked"},decls:13,vars:4,consts:[[1,"rui-about","wrapper"],[1,"container"],[1,"content"],[1,"first-row"],["mat-dialog-title","",1,"title"],[1,"cta-mat-icon","material-icons","close-icon",3,"click"],["mat-card-sm-image","","alt","preview","layout-fill","",1,"cta-image",3,"src"],[1,"mat-typography","dialog-content"],[1,"message"],["mat-button","",1,"mat-button",3,"text","click"]],template:function(e,t){1&e&&(As(0,"div",0),As(1,"div",1),As(2,"div",2),As(3,"div",3),As(4,"p",4),Cu(5),Ms(),As(6,"mat-icon",5),Vs("click",function(){return t.close()}),Cu(7,"clear"),Ms(),Ms(),Is(8,"img",6),As(9,"mat-dialog-content",7),As(10,"div",8),Cu(11),Ms(),As(12,"a",9),Vs("click",function(){return t.onDialogButtonClick()}),Ms(),Ms(),Ms(),Ms(),Ms()),2&e&&(Yo(5),Eu(t.infoTitle),Yo(3),Ts("src",t.imageUrl,Xr),Yo(3),Ou(" ",t.message,""),Yo(1),Ts("text",t.callToAction))},directives:[VG,B_,IW,zG],styles:["[_nghost-%COMP%] .content[_ngcontent-%COMP%]{display:block;align-content:center;padding-left:1.6rem;padding-right:1.6rem;border-radius:.25rem}[_nghost-%COMP%] .info-button-wrapper[_ngcontent-%COMP%]{border-radius:.25rem;padding:.6rem;transition:.6s}[_nghost-%COMP%] .info-button-wrapper[_ngcontent-%COMP%] .ccf-info-button[_ngcontent-%COMP%]{cursor:pointer;transition:color .6s;font-size:1.2rem;vertical-align:sub}[_nghost-%COMP%] .first-row[_ngcontent-%COMP%]{display:flex;width:100%;line-height:.9rem}[_nghost-%COMP%] .first-row[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{padding-right:7rem;padding-left:.2rem;font-size:.875rem;padding-top:.75rem}[_nghost-%COMP%] .first-row[_ngcontent-%COMP%] .cta-mat-icon[_ngcontent-%COMP%]{height:30%;line-height:3.4rem}[_nghost-%COMP%] .message[_ngcontent-%COMP%]{padding:.5rem}[_nghost-%COMP%] .cta-image[_ngcontent-%COMP%]{align-self:center;-o-object-fit:cover;object-fit:cover;width:100%;border-radius:.25rem}[_nghost-%COMP%] .mat-button[_ngcontent-%COMP%]{background-color:#444a65;font-size:.75rem;position:relative;margin-bottom:1rem;width:100%;height:2rem;color:#fff}"],changeDetection:0}),e}(),_5=function e(){m(this,e),this.close=function(){return new u5},this.learnMore=function(){return new a5}};_5.\u0275fac=function(e){return new(e||_5)},_5.\u0275cmp=Ot({type:_5,selectors:[["ccf-call-to-action-behavior"]],decls:5,vars:12,consts:[[3,"infoTitle","message","callToAction","imageUrl","callToActionClicked","closeClicked"]],template:function(e,t){1&e&&(As(0,"ccf-call-to-action",0),Vs("callToActionClicked",function(){return t.learnMore()})("closeClicked",function(){return t.close()}),Jc(1,"async"),Jc(2,"async"),Jc(3,"async"),Jc(4,"async"),Ms()),2&e&&Ts("infoTitle",el(1,4,t.title$))("message",el(2,6,t.message$))("callToAction",el(3,8,t.callToAction$))("imageUrl",el(4,10,t.imageUrl$))},directives:[b5],pipes:[sd],styles:[""],changeDetection:0}),Mw([Bz(y5.title)],_5.prototype,"title$",void 0),Mw([Bz(y5.message)],_5.prototype,"message$",void 0),Mw([Bz(y5.callToAction)],_5.prototype,"callToAction$",void 0),Mw([Bz(y5.imageUrl)],_5.prototype,"imageUrl$",void 0),Mw([TK()],_5.prototype,"close",void 0),Mw([TK()],_5.prototype,"learnMore",void 0);var w5=[{name:"bladder",namespace:"app",url:"assets/icons/organs/ico-organs-bladder.svg"},{name:"blood",namespace:"app",url:"assets/icons/organs/ico-organs-blood.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:"eye",namespace:"app",url:"assets/icons/organs/ico-organs-eye.svg"},{name:"fallopian-tube-left",namespace:"app",url:"assets/icons/organs/ico-organs-fallopian-tube-left.svg"},{name:"fallopian-tube-right",namespace:"app",url:"assets/icons/organs/ico-organs-fallopian-tube-right.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-right",namespace:"app",url:"assets/icons/organs/ico-organs-kidney-right.svg"},{name:"kidney",namespace:"app",url:"assets/icons/organs/ico-organs-kidney.svg"},{name:"knee",namespace:"app",url:"assets/icons/organs/ico-organs-knee.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-right",namespace:"app",url:"assets/icons/organs/ico-organs-lung-right.svg"},{name:"lung",namespace:"app",url:"assets/icons/organs/ico-organs-lung.svg"},{name:"lymph-nodes",namespace:"app",url:"assets/icons/organs/ico-organs-lymph-nodes.svg"},{name:"mammary-gland",namespace:"app",url:"assets/icons/organs/ico-organs-breast.svg"},{name:"neuron",namespace:"app",url:"assets/icons/organs/ico-organs-neuron.svg"},{name:"ovaries",namespace:"app",url:"assets/icons/organs/ico-organs-ovaries.svg"},{name:"ovary-left",namespace:"app",url:"assets/icons/organs/ico-organs-ovary-left.svg"},{name:"ovary-right",namespace:"app",url:"assets/icons/organs/ico-organs-ovary-right.svg"},{name:"pancreas",namespace:"app",url:"assets/icons/organs/ico-organs-pancreas.svg"},{name:"pelvis-f",namespace:"app",url:"assets/icons/organs/ico-organs-pelvis-f.svg"},{name:"placenta",namespace:"app",url:"assets/icons/organs/ico-organs-placenta.svg"},{name:"prostate",namespace:"app",url:"assets/icons/organs/ico-organs-prostate.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:"spinal-cord",namespace:"app",url:"assets/icons/organs/ico-organs-spinal-cord.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:"ureter-left",namespace:"app",url:"assets/icons/organs/ico-organs-ureter-left.svg"},{name:"ureter-right",namespace:"app",url:"assets/icons/organs/ico-organs-ureter-right.svg"},{name:"uterus",namespace:"app",url:"assets/icons/organs/ico-organs-uterus.svg"},{name:"vasculature-thick",namespace:"app",url:"assets/icons/organs/ico-organs-vasculature-thick.svg"},{name:"vasculature-thin",namespace:"app",url:"assets/icons/organs/ico-organs-vasculature-thin.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"}],k5=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=_(w5);try{for(a.s();!(o=a.n()).done;){var s=o.value,u=s.name,c=s.namespace,l=s.url,h=s.html,d={name:u,namespace:c,url:l&&i.bypassSecurityTrustResourceUrl(l),html:h&&i.bypassSecurityTrustHtml(h)};r.registerIconImpl(d)}}catch(f){a.e(f)}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}(hq);k5.\u0275fac=function(e){return new(e||k5)(Zi(A_,8),Zi(Vd))},k5.\u0275prov=$e({token:k5,factory:k5.\u0275fac}),Mw([sq()],k5.prototype,"registerIcon",null),k5=Mw([cq(),Fz({name:"iconRegistry"})],k5);var x5=[T$,LQ,k5,jQ,EQ,BQ,m5,HJ,MQ],S5=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({imports:[[R3.forRoot(),Lz.forRoot(x5,{developmentMode:!pQ.production,selectorOptions:{injectContainerState:!1}}),PK.forRoot(),z3.forRoot({disabled:pQ.production})]]}),e}(),C5=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)(Zi(e,12))},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({providers:[{provide:N$,useExisting:M3}],imports:[[S_,Eq.forRoot({gaToken:pQ.googleAnalyticsToken,appName:"eui"}),P$,Fq.forRoot(function(){return new Lq({basePath:pQ.dbOptions.remoteApiEndpoint})}),P3,S5,I3],P3]}),e}(),E5=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({imports:[[cd,n$]]}),e}(),O5=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({imports:[[cd,DH,UZ]]}),e}(),T5=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({imports:[[cd,cv,yp,DH,UZ,NJ]]}),e}(),P5=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({imports:[[cd,Y_,V_]]}),e}(),A5=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({imports:[[cd,Y_,V_,E5,O5,T5,oQ,P5]]}),e}(),M5=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({imports:[[cd,V_,A5]]}),e}(),I5=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({imports:[[cd,JU,eH,JH,DH,uG,V_]]}),e}(),R5=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({imports:[[cd,Y_,V_,Aw,Y0,y$]]}),e}(),D5=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({imports:[[cd,I5,R5]]}),e}(),N5=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({imports:[[cd,I5,R5,D5],I5,R5,D5]}),e}();function L5(){return(L5=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=k1();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=V1(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=V1(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),W1(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))}},F5={name:"navigation",params:{navigation:{nextEl:null,prevEl:null,hideOnClick:!1,disabledClass:"swiper-button-disabled",hiddenClass:"swiper-button-hidden",lockClass:"swiper-button-lock"}},create:function(){q1(this,{navigation:L5({},j5)})},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&&!V1(o).is(r)&&!V1(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)}}}},B5=function(){var e=function e(){m(this,e),d2.use([F5])};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({imports:[[cd,Y_,V_,Y2]]}),e}(),V5=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({imports:[[cd]]}),e}(),z5=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({imports:[[cd,n$,V_,B5,V5]]}),e}(),U5=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({imports:[[cd,up,z5]]}),e}(),H5=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({providers:[{provide:ZQ,useValue:QQ}],imports:[[Gd,Zy,V_]]}),e}(),G5=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({imports:[[cd,KQ]]}),e}(),W5=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({imports:[[cd,Y_,V_,KQ]]}),e}(),q5=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(Ku).resolveComponentFactory(e).inputs}(e,t.injector),i=t.strategyFactory||new dv(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}(pv);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}(T3,{injector:this.injector});customElements.define("ccf-eui",e)}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Zi(ss))},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({providers:[{provide:uQ,useValue:"hubmap-theme-light"},{provide:Hp,useExisting:sQ}],imports:[[Zy,Gd,C5,H5,M5,N5,V_,T5,U5,G5,o$,g$,E$,Aw,W5,R$,mw,P5]]}),e}();pQ.production&&function(){if(oh)throw new Error("Cannot enable prod mode after platform setup.");rh=!1}(),Ud().bootstrapModule(q5).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},88509:function(e,t,n){"use strict";e.exports=n.p+"7693192ac33f7744a3ca.ts"},9521:function(){},49125:function(){},75307:function(){}},function(e){e(e.s=51316)}])}(); \ 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&&f(e,t)}function s(e){var t=d();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}}),f(i,e)})(e)}function h(e,t,n){return(h=d()?Reflect.construct:function(e,t,n){var i=[null];i.push.apply(i,t);var r=new(Function.bind.apply(e,i));return n&&f(r,n.prototype),r}).apply(null,arguments)}function d(){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 f(e,t){return(f=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 d(e){return e.toString(this.encoding)}function f(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|d(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 d(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 f(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 C(this,t,n);case"latin1":case"binary":return E(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,d=0;dr&&(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 A(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||P(e,t,this.length);for(var i=this[e],r=1,o=0;++o>>=0,t>>>=0,n||P(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||P(e,1,this.length),this[e]},a.prototype.readUInt16LE=function(e,t){return e>>>=0,t||P(e,2,this.length),this[e]|this[e+1]<<8},a.prototype.readUInt16BE=function(e,t){return e>>>=0,t||P(e,2,this.length),this[e]<<8|this[e+1]},a.prototype.readUInt32LE=function(e,t){return e>>>=0,t||P(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||P(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||P(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||P(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||P(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},a.prototype.readInt16LE=function(e,t){e>>>=0,t||P(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||P(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||P(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||P(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||P(e,4,this.length),i.read(this,e,!0,23,4)},a.prototype.readFloatBE=function(e,t){return e>>>=0,t||P(e,4,this.length),i.read(this,e,!1,23,4)},a.prototype.readDoubleLE=function(e,t){return e>>>=0,t||P(e,8,this.length),i.read(this,e,!0,52,8)},a.prototype.readDoubleBE=function(e,t){return e>>>=0,t||P(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||A(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||A(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||A(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||A(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||A(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||A(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},a.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||A(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},a.prototype.writeIntLE=function(e,t,n,i){if(e=+e,t>>>=0,!i){var r=Math.pow(2,8*n-1);A(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);A(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||A(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||A(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||A(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||A(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},a.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||A(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},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 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(e,t,n){var i={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},r=d.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,d=n?-1:1,f=e[t+h];for(h+=d,o=f&(1<<-l)-1,f>>=-l,l+=s;l>0;o=256*o+e[t+h],h+=d,l-=8);for(a=o&(1<<-l)-1,o>>=-l,l+=i;l>0;a=256*a+e[t+h],h+=d,l-=8);if(0===o)o=1-c;else{if(o===u)return a?NaN:1/0*(f?-1:1);a+=Math.pow(2,i),o-=c}return(f?-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,d=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,f=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?d/u:d*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+f]=255&s,f+=p,s/=256,r-=8);for(a=a<0;e[n+f]=255&a,f+=p,a/=256,c-=8);e[n+f-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 d(e){throw new c("Invalid JSON-LD syntax; @context must be an object.","jsonld.SyntaxError",{code:"invalid local context",context:e})}function f(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,d=u.isString,f=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,C=w.process,E=w.processingMode,O=e("./url"),T=O.removeBase,P=O.prependBase,A=e("./util"),M=A.addValue,I=A.asArray,R=A.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,P,A,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(A,z,"@context"),e.t1=f(U),e.t1){e.next=37;break}return e.next=36,C({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(P,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}),$=i.mappings.has(K)?i.mappings.get(K)["@nest"]:null,Q=P,$&&(N(i,$,p),l(P[$])||(P[$]={}),Q=P[$]),M(Q,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=P,ne&&(N(i,ne,p),l(P[ne])||(P[ne]={}),ie=P[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,de=void 0,ie.hasOwnProperty(te)?he=ie[te]:ie[te]=he={},!re.includes("@language")){e.next=96;break}g(ue)&&(ue=ue["@value"]),de=ee["@language"],e.next=138;break;case 96:if(!re.includes("@index")){e.next=117;break}if(fe=x(i,te,"@index")||"@index",pe=D.compactIri({activeCtx:i,iri:fe,relativeTo:{vocab:!0}}),"@index"!==fe){e.next=102;break}de=ee["@index"],delete ue[pe],e.next=115;break;case 102:if(me=void 0,ve=I(ue[fe]||[]),ge=n(ve),de=ge[0],me=ge.slice(1),!d(de)){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[fe],e.abrupt("break",112);case 109:return ue[fe]=me[0],e.abrupt("break",112);case 111:ue[fe]=me;case 112:e.next=115;break;case 114:de=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}}),de=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),de=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:de||(de=D.compactIri({activeCtx:i,iri:"@none",relativeTo:{vocab:!0}})),M(he,de,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(P,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(P,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(Ce in Se=e.sent)i.mappings.has(Ce)&&i.mappings.get(Ce).reverse&&(Ee=Se[Ce],Oe=(x(i,Ce,"@container")||[]).includes("@set")||!p.compactArrays,M(P,Ce,Ee,{propertyIsArray:Oe}),delete Se[Ce]);Object.keys(Se).length>0&&(Te=D.compactIri({activeCtx:i,iri:q,relativeTo:{vocab:!0}}),M(P,Te,Se));case 172:e.next=178;break;case 174:1===(Pe=I(X).map(function(e){return D.compactIri({activeCtx:A,iri:e,relativeTo:{vocab:!0}})})).length&&(Pe=Pe[0]),Ae=D.compactIri({activeCtx:i,iri:"@type",relativeTo:{vocab:!0}}),Me=(x(i,Ae,"@container")||[]).includes("@set")&&E(i,1.1)||c(Pe)&&0===X.length,M(P,Ae,Pe,{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]),P[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:P});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,d=e.base,f=void 0===d?null:d;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 C=0===x.length?y:null,E=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(Q.s();!($=Q.n()).done;){var Z=t($.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){Q.e(te)}finally{Q.f()}return u.vocab?i:"@base"in n?n["@base"]?T(P(f,n["@base"]),i):i:T(f,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,f=1===h||2===h&&"@index"in i&&!l,p="@language"in t,v=d(i["@value"]),m=t.mappings.has(n)&&null===t.mappings.get(n)["@language"];if(f&&"@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,d=s.isUndefined,f=e("./url"),p=f.isAbsolute,g=f.isRelative,m=f.prependBase,y=e("./util"),b=y.asArray,w=y.compareShortestLeast,k=new Map,x=/^@[a-zA-Z]+$/,S={};function C(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 d=e.mappings.get(u);if(d&&d._prefix)return d["@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 E(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=C(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=C(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(/(?::[^:])|\//)&&C(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 P=r.substr(0,w);if(i.hasOwnProperty(P)&&S.createTermDefinition({activeCtx:n,localCtx:i,term:P,defined:o,options:s}),n.mappings.has(P)){var A=r.substr(w+1);y["@id"]=n.mappings.get(P)["@id"]+A}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=C(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&&!d&&(n.protected[r]=!0,y.protected=!0,!E(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 C(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,d=c.get(h);if(null!==d){var f=d["@container"]||"@none";if(f=[].concat(f).sort().join(""),null!==d["@id"]){var p,g=_(b(d["@id"]));try{for(g.s();!(p=g.n()).done;){var m=p.value,y=n[m],k=S.isKeyword(m);if(y)!k&&!d._termHasColon&&o[m].push(h);else if(n[m]=y={},!k&&!d._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[f]||(y[f]={"@language":{},"@type":{},"@any":{}}),a(h,(y=y[f])["@any"],"@none"),d.reverse)a(h,y["@type"],"@reverse");else if("@none"===d["@type"])a(h,y["@any"],"@none"),a(h,y["@language"],"@none"),a(h,y["@type"],"@none");else if("@type"in d)a(h,y["@type"],d["@type"]);else if("@language"in d&&"@direction"in d){var C=d["@language"],E=d["@direction"];a(h,y["@language"],C&&E?"".concat(C,"_").concat(E).toLowerCase():C?C.toLowerCase():E?"_".concat(E):"@null")}else"@language"in d?a(h,y["@language"],(d["@language"]||"@null").toLowerCase()):"@direction"in d?a(h,y["@language"],d["@direction"]?"_".concat(d["@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(d){c.e(d)}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(d(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 d(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,f=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,d(f,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,d=e("./graphTypes"),f=d.isList,p=d.isValue,v=d.isGraph,g=d.isSubject,m=e("./context"),y=m.expandIri,b=m.getContextValue,w=m.isKeyword,k=m.process,x=m.processingMode,S=e("./url").isAbsolute,C=e("./util"),E=C.addValue,O=C.asArray,T=C.getValues,P=C.validateTypeValue,A={};n.exports=A;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,d,v,m,C,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,de,fe,pe,ve,ge,me,ye,be,_e,we,ke,xe,Se,Ce;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:i=n.activeCtx,o=n.activeProperty,h=n.expandedActiveProperty,d=n.element,v=n.expandedParent,m=n.options,C=void 0===m?{}:m,T=n.insideList,M=n.typeKey,D=n.typeScopedContext,N=n.expansionMap,F=Object.keys(d).sort(),B=[],z=d[M]&&"@json"===y(i,a(d[M])?d[M][0]:d[M],{vocab:!0},C),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=d[G],"@context"!==G){e.next=11;break}return e.abrupt("continue",185);case 11:if(null!==(X=y(i,G,{vocab:!0},C))&&(S(X)||w(X))||void 0!==(X=N({unmappedProperty:G,activeCtx:i,activeProperty:o,parent:d,options:C,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(C.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 E(v,"@id",O(q).map(function(e){return c(e)?y(i,e,{base:!0},C):e}),{propertyIsArray:C.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})})]}))),P(q,C.isFrame),E(v,"@type",O(q).map(function(e){return c(e)?y(D,e,{base:!0,vocab:!0},C):e}),{propertyIsArray:C.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,A.expand({activeCtx:i,activeProperty:o,element:q,options:C,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 E(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:E(v,"@value",q,{propertyIsArray:C.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)||C.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();!($=K.n()).done;)Q=$.value,c(Q)&&!Q.match(I)&&console.warn("@language must be valid BCP47: ".concat(Q))}catch(Ee){K.e(Ee)}finally{K.f()}return E(v,"@language",q,{propertyIsArray:C.isFrame}),e.abrupt("continue",185);case 62:if("@direction"!==X){e.next=85;break}if(c(q)||C.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 E(v,"@direction",q,{propertyIsArray:C.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 E(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,A.expand({activeCtx:i,activeProperty:"@reverse",element:q,options:C,expansionMap:N});case 95:if(!("@reverse"in(W=e.sent))){e.next=98;break}for(te in W["@reverse"])E(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"]={}),E(ne,ie,[],{propertyIsArray:!0}),re=W[ie],oe=0;case 107:if(!(oe1?$.slice().sort():$:[$],Z=_(Q),e.prev=81,Z.s();case 83:if((J=Z.n()).done){e.next=93;break}if(ee=J.value,te=b(C,ee,"@context"),e.t5=l(te),e.t5){e.next=91;break}return e.next=90,k({activeCtx:n,localCtx:te,options:f,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:f,insideList:v,typeKey:q,typeScopedContext:C,expansionMap:P});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,P({unmappedValue:ne,activeCtx:n,activeProperty:o,element:h,options:f,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,P(ne,{unmappedValue:ne,activeCtx:n,activeProperty:o,element:h,options:f,insideList:v});case 150:ue=e.sent,ne=void 0!==ue?ue:null;case 152:if(!s(ne)||f.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,P({unmappedValue:ne,activeCtx:n,activeProperty:o,element:h,options:f,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,d=s.getValues(t,l),f=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(d[0])),!o.requireAll)return h}else if("@type"===l){if(u=!1,f){if(d.length>0)return!1;h=!0}else if(1===n["@type"].length&&a.isEmptyObject(n["@type"][0]))h=d.length>0;else{var p,v=_(n["@type"]);try{var g=function(){var e=p.value;h=!(!a.isObject(e)||!("@default"in e))||h||d.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===d.length&&i)return"continue";if(d.length>0&&f)return{v:!1};if(void 0===t){if(d.length>0)return{v:!1};h=!0}else if(r.isList(t)){var c=t["@list"][0];if(r.isList(d[0])){var p=d[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)?d.some(function(e){return S(t,e)}):r.isSubjectReference(t)?d.some(function(n){return x(e,t,n,o)}):!!a.isObject(t)&&d.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,d={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],C=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,d),E=Object.keys(C).sort(),O=_(E);try{var T=function(){var m=w.value,y=C[m];if(null===l?e.uniqueEmbeds=o({},e.graph,{}):e.uniqueEmbeds[e.graph]=e.uniqueEmbeds[e.graph]||{},"@link"===d.embed&&m in x)return k(u,l,x[m]),"continue";var E={"@id":m};if(0===m.indexOf("_:")&&s.addValue(e.bnodeMap,m,E,{propertyIsArray:!0}),x[m]=E,("@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(m)){if(e.embedded&&("@never"===d.embed||v(y,e.graph,e.subjectStack)))return k(u,l,E),"continue";if(e.embedded&&("@first"==d.embed||"@once"==d.embed)&&e.uniqueEmbeds[e.graph].hasOwnProperty(m))return k(u,l,E),"continue";if("@last"===d.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&&f.frame(I(M({},e),{graph:m,embedded:!1}),Object.keys(e.graphMap[m]).sort(),[T],E,"@graph")}"@included"in n&&f.frame(I(M({},e),{embedded:!1}),t,n["@included"],E,"@included");var P,A=_(Object.keys(y).sort());try{for(A.s();!(P=A.n()).done;){var R=P.value;if(i(R)){if(E[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,E,{propertyIsArray:!0})}}catch(re){N.e(re)}finally{N.f()}}}else if(!d.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(d);if(r.isList(B)){var z=n[R]&&n[R][0]&&n[R][0]["@list"]?n[R][0]["@list"]:p(d),U={"@list":[]};k(E,R,U);var H,G=_(B["@list"]);try{for(G.s();!(H=G.n()).done;){var W=H.value;r.isSubjectReference(W)?f.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)?f.frame(I(M({},e),{embedded:!0}),[B["@id"]],V,E,R):S(V[0],B)&&k(E,R,s.clone(B))}}catch(re){F.e(re)}finally{F.f()}}}}catch(re){A.e(re)}finally{A.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 E)){var $="@null";"@default"in K&&($=s.clone(K["@default"])),a.isArray($)||($=[$]),E[Y]=[{"@preserve":$}]}}}catch(re){X.e(re)}finally{X.f()}var Q,Z=_(Object.keys(n["@reverse"]||{}).sort());try{for(Z.s();!(Q=Z.n()).done;)for(var J=Q.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,C,E,O,T,P,A,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,(C="DefaultGraph"===x.graph.termType?"@default":x.graph.value)in y||(y[C]={}),"@default"!==C&&!(C in m)&&(m[C]={"@id":C}),E=y[C],O=x.subject.value,T=x.predicate.value,P=x.object,O in E||(E[O]={"@id":O}),A=E[O],(M=P.termType.endsWith("Node"))&&!(P.value in E)&&(E[P.value]={"@id":P.value}),T!==v||r||!M){e.next=15;break}return u.addValue(A,"@type",P.value,{propertyIsArray:!0}),e.abrupt("continue",17);case 15:I=S(P,c,g),u.addValue(A,T,I,{propertyIsArray:!0}),M&&(P.value===p?("usages"in(R=E[P.value])||(R.usages=[]),R.usages.push({node:A,property:T,value:I})):b[P.value]=!(P.value in b)&&{node:A,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===f&&s.isObject(b[V["@id"]])&&s.isArray(V[d])&&1===V[d].length&&s.isArray(V[f])&&1===V[f].length&&(3===W||4===W&&s.isArray(V["@type"])&&1===V["@type"].length&&V["@type"][0]===l)&&(H.push(V[d][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"),d=e("./expand").expand,f=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,C=e("./context"),P=C.expandIri,A=C.getInitialContext,I=C.process,R=C.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 C(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&&E){var r,o=_(E(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,d,f,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=C(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(A(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]),d=i,i=[];for(f=0;f0)&&i.push(d[f]);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,f,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=C(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=A(i),f=0,p=s;case 16:if(!(f=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",d={};function f(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)},d.parseLinkHeader=function(e){for(var t={},n=e.match(u),i=0;i0}return!1},d.hasValue=function(e,t,n){if(d.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[d].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[f]=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[d]=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[d].has(e)){if(s>this[r])return _(this,this[d].get(e)),!1;var f=this[d].get(e).value;return this[c]&&(this[l]||this[c](e,f.value)),f.now=i,f.maxAge=n,f.value=t,this[o]+=s-f.length,f.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[d].set(e,this[h].head),y(this),!0)}},{key:"has",value:function(e){if(!this[d].has(e))return!1;var t=this[d].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[d].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[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 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.default=n.Variable=n.Triple=n.Term=n.Quad=n.NamedNode=n.Literal=n.DefaultGraph=n.BlankNode=void 0,n.escapeQuotes=O,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!==f.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.unescapeQuotes=T;var i,r,o=(i=e("./IRIs"))&&i.__esModule?i:{default:i},l=e("./N3Util"),h=o.default,d=h.rdf,f=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=f.boolean:"number"==typeof e&&(Number.isFinite(e)?n=Number.isInteger(e)?f.integer:f.double:(n=f.double,Number.isNaN(e)||(e=e>0?"INF":"-INF")))),new k(""===n||n===f.string?'"'.concat(e,'"'):'"'.concat(e,'"^^').concat(n))},defaultGraph:function(){return r},quad:P,triple:P};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:"hashCode",value:function(){return 0}},{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=i.length;;){for(var o=void 0,s=void 0;o=this._newline.exec(i);)this._comments&&(s=this._comment.exec(o[0]))&&_("comment",s[1],"",this._line,o[0].length),i=i.substr(o[0].length,i.length),r=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&&(this._comments&&(s=this._comment.exec(i))&&_("comment",s[1],"",this._line,i.length),i=null,_("eof","","",this._line,0)),this._input=i;var u=this._line,l=i[0],h="",d="",f="",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",d=p[1];else if(p=this._iri.exec(i)){if(null===(d=this._unescape(p[1]))||c.test(d))return w(this);h="IRI"}else i.length>1&&"<"===i[1]?(h="<<",v=2):this._n3Mode&&i.length>1&&"="===i[1]&&(h="inverse",v=2,d=">");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",f="_",d=p[1]);break;case'"':if(p=this._simpleQuotedString.exec(i))d=p[1];else if(d=(n=this._parseLiteral(i)).value,v=n.matchLength,null===d)return w(this);(null!==p||0!==v)&&(h="literal",this._literalClosingPos=0);break;case"'":if(!this._lineMode){var m;if(p=this._simpleApostropheString.exec(i))d=p[1];else if(d=(m=this._parseLiteral(i)).value,v=m.matchLength,null===d)return w(this);(null!==p||0!==v)&&(h="literal",this._literalClosingPos=0)}break;case"?":this._n3Mode&&(p=this._variable.exec(i))&&(h="var",d=p[0]);break;case"@":"literal"===this._previousMarker&&(p=this._langcode.exec(i))?(h="langcode",d=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",d=p[0],f="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",d=p[0],f=a.boolean):g=!0;break;case"a":(p=this._shortPredicates.exec(i))?(h="abbreviation",d="a"):g=!0;break;case"=":this._n3Mode&&i.length>1&&(h="abbreviation",">"!==i[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,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",f=p[1]||"",d=this._unescape(p[2])):(h="prefix",d=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)?w(this):this._input=i;var y=v||p[0].length,b=_(h,d,f,u,y);this.previousToken=b,this._previousMarker=h,i=i.substr(y,i.length)}function _(t,n,o,a,s){var u=i?r-i.length:r,c={type:t,value:n,prefix:o,line:a,start:u,end:u+s};return e(null,c),c}function w(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"[":if(this._n3Mode)return this._saveContext("blank",this._graph,this._subject,this._subject=this._blankNode(),null),this._readBlankNodeHead;case"blank":if(!this._n3Mode)return this._error("Disallowed blank node as predicate",e);default:if(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?this._getContextEndReader():null!==this._predicate?this._readObject:t?this._readPredicateOrNamedGraph:this._readPredicateAfterBlank}},{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:regeneratorRuntime.mark(function e(t,n,i,o,a,s,u,c){var l,h,d,f,p,v,g,m,y,b,_,w;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:f=!n+!i+!o>1?Object.keys(this._ids):this._entities,p=(0,r.termFromId)(c,this._factory),n&&((l=t,t={})[n]=l[n]),e.t0=regeneratorRuntime.keys(t);case 3:if((e.t1=e.t0()).done){e.next=29;break}if(v=e.t1.value,g=f[v],!(h=t[v])){e.next=27;break}i&&((l=h,h={})[i]=l[i]),e.t2=regeneratorRuntime.keys(h);case 9:if((e.t3=e.t2()).done){e.next=27;break}if(m=e.t3.value,y=f[m],!(d=h[m])){e.next=25;break}b=o?o in d?[o]:[]:Object.keys(d),_=0;case 15:if(!(_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,d=t.subject;d&&!c;){for(var f=e.getQuads(null,null,d,null),p=e.getQuads(d,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===f.string)return'"'.concat(t,'"')}else switch(e.datatype.value){case f.string:return'"'.concat(t,'"');case f.boolean:if("true"===t||"false"===t)return t;break;case f.integer:if(/^[+-]?\d+$/.test(t))return t;break;case f.decimal:if(/^[+-]?\d*\.\d+$/.test(t))return t;break;case f.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,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=w(o),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={},f=0,p=_(e.split(c.eoln));try{for(p.s();!(t=p.n()).done;){var v=t.value;if(f++,!c.empty.test(v)){var g=v.match(c.quad);if(null===g)throw new Error("N-Quads parse error on line "+f+".");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(d,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 d=e[h],f={termType:n[d.type],value:d.value};f.termType===s&&(f.datatype={termType:o},"datatype"in d&&(f.datatype.value=d.datatype),"language"in d?("datatype"in d||(f.datatype.value=i),f.language=d.language):"datatype"in d||(f.datatype.value=r)),l[h]=f}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,d=/(?:\\([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 d=l.value;d>i&&t.set(d,!t.get(d))}}catch(f){h.e(f)}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,d,f,p,g,m,y,b,w,k,x,S,C,E,O,T,P,A,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,d=_(l),n.prev=6,d.s();case 8:if((f=d.n()).done){n.next=18;break}if(p=f.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),d.e(n.t1);case 23:return n.prev=23,d.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(!(xf)){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}E=_(w),i.prev=43,E.s();case 45:if((O=E.n()).done){i.next=55;break}return T=O.value,i.next=49,n.hashNDegreeQuads(T,y);case 49:if(P=i.sent,b+=y.getId(T),b+="<".concat(P.hash,">"),y=P.issuer,!(0!==f.length&&b>f)){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),E.e(i.t2);case 60:return i.prev=60,E.f(),i.finish(60);case 63:k||(0===f.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,d=[],f=_(v(u.keys()).sort());try{for(f.s();!(h=f.n()).done;){var p=h.value,g=u.get(p);g.length>1?d.push(g):this.canonicalIssuer.getId(g[0])}}catch(j){f.e(j)}finally{f.f()}for(var m=0,y=d;ml){y=!0;break}}}catch(E){b.e(E)}finally{b.f()}if(!y){var k,x=_(m);try{for(x.s();!(k=x.n()).done;){var S=k.value,C=this.hashNDegreeQuads(S,p);if(g+=p.getId(S),g+="<".concat(C.hash,">"),p=C.issuer,0!==l.length&&g>l){y=!0;break}}}catch(E){x.e(E)}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,d,f;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:d=i.sent,(f=r.get(d))?f.push(h):r.set(d,[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"),d=e("rdf-data-factory"),f=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 d.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,d=!1,f=!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,d=!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,f=!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=f?this.dataFactory.blankNode(h):this.valueToUri(h,t),d&&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 d in e.attributes){var f=e.attributes[d],p=n.expandPrefixedTerm(d,t.ns,this);if(p.uri===n.RDF)switch(p.local){case"resource":if(u)throw this.newParseError("Found both rdf:resource (".concat(f,") and rdf:nodeID (").concat(u,")."));if(a)throw this.newParseError("rdf:parseType is not allowed on property elements with rdf:resource (".concat(f,")"));t.hadChildren=!0,u=f,c=!1;continue;case"datatype":if(s)throw this.newParseError("Found both non-rdf:* property attributes and rdf:datatype (".concat(f,")."));if(a)throw this.newParseError("rdf:parseType is not allowed on property elements with rdf:datatype (".concat(f,")"));t.datatype=this.valueToUri(f,t);continue;case"nodeID":if(s)throw this.newParseError("Found both non-rdf:* property attributes and rdf:nodeID (".concat(f,")."));if(t.hadChildren)throw this.newParseError("Found both rdf:resource and rdf:nodeID (".concat(f,")."));if(a)throw this.newParseError("rdf:parseType is not allowed on property elements with rdf:nodeID (".concat(f,")"));this.validateNcname(f),t.hadChildren=!0,u=f,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"===f){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"===f?(a=!0,t.hadChildren=!0,t.childrenCollectionSubject=t.subject,t.childrenCollectionPredicate=t.predicate,c=!1):"Literal"===f&&(a=!0,t.childrenTagsToString=!0,t.childrenStringTags=[]);continue;case"ID":this.validateNcname(f),t.reifiedStatementId=this.valueToUri("#"+f,t),this.claimNodeId(t.reifiedStatementId);continue}else if(p.uri===n.XML&&"lang"===p.local){t.language=""===f?null:f.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(f));t.hadChildren=!0,s=!0,l.push(this.uriToNamedNode(p.uri+p.local)),h.push(this.dataFactory.literal(f,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=f,f.IRI_REGEX=/^([A-Za-z][A-Za-z0-9+-.]*):[^ "<>{}|\\\[\]`]*$/,f.MIME_TYPE="application/rdf+xml",f.RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#",f.XML="http://www.w3.org/XML/1998/namespace",f.XMLNS="http://www.w3.org/2000/xmlns/",f.DEFAULT_NS={xml:f.XML},f.FORBIDDEN_NODE_ELEMENTS=["RDF","ID","about","bagID","parseType","resource","nodeID","li","aboutEach","aboutEachPrefix"],f.FORBIDDEN_PROPERTY_ELEMENTS=["Description","RDF","ID","about","bagID","parseType","resource","nodeID","aboutEach","aboutEachPrefix"],f.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 A(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):A(this),null;if(0===(e=P(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},C.prototype._read=function(e){k(this,new _("_read()"))},C.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",f),e.removeListener("finish",p),e.removeListener("drain",c),e.removeListener("error",d),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 d(t){o("onerror",t),v(),e.removeListener("error",d),0===a(e,"error")&&k(e,t)}function f(){e.removeListener("finish",p),v()}function p(){o("onfinish"),e.removeListener("close",f),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",d),e.once("close",f),e.once("finish",p),e.emit("pipe",i),r.flowing||(o("pipe resume"),i.resume()),e},C.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?A(this):r.reading||n.nextTick(N,this)),i},C.prototype.removeListener=function(e,t){var i=s.prototype.removeListener.call(this,e,t);return"readable"===e&&n.nextTick(D,this),i},C.prototype.removeAllListeners=function(e){var t=s.prototype.removeAllListeners.apply(this,arguments);return("readable"===e||void 0===e)&&n.nextTick(D,this),t},C.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},C.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},C.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(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(e,t,n){n(new v("_write()"))},C.prototype._writev=null,C.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(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(e){!this._writableState||(this._writableState.destroyed=e)}}),C.prototype.destroy=h.destroy,C.prototype._undestroy=h.undestroy,C.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"),d=Symbol("stream");function f(e,t){return{value:e,done:t}}function p(e){var t=e[a];if(null!==t){var n=e[d].read();null!==n&&(e[l]=null,e[a]=null,e[s]=null,t(f(n,!1)))}}function v(e){n.nextTick(p,e)}var g=Object.getPrototypeOf(function(){}),m=Object.setPrototypeOf((r(i={get stream(){return this[d]},next:function(){var e=this,t=this[u];if(null!==t)return Promise.reject(t);if(this[c])return Promise.resolve(f(void 0,!0));if(this[d].destroyed)return new Promise(function(t,i){n.nextTick(function(){e[u]?i(e[u]):t(f(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(f(void 0,!0)):t[h](n,i)},i)}}(r,this));else{var o=this[d].read();if(null!==o)return Promise.resolve(f(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[d].destroy(null,function(e){e?n(e):t(f(void 0,!0))})})}),i),g);t.exports=function(e){var t,n=Object.create(m,(r(t={},d,{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[d].read();i?(n[l]=null,n[a]=null,n[s]=null,e(f(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(f(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),d=h.lastIndexOf("/");return d>=0&&d"===o?(E(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,E(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&&E(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&&E(t,"oncdata",t.cdata),E(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?(E(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(d,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(d,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="",E(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(d,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:f,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":E(e,"oncdata",e.cdata),e.cdata="";break;case"script":E(e,"onscript",e.script),e.script="";break;default:P(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&&(E(e,"oncdata",e.cdata),e.cdata=""),""!==e.script&&(E(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]/,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]/,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 C(e,t,n){e[t]&&e[t](n)}function E(e,t,n){e.textNode&&O(e),C(e,t,n)}function O(e){e.textNode=T(e.opt,e.textNode),e.textNode&&C(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 P(e,t){return O(e),e.trackPosition&&(t+="\nLine: "+e.line+"\nColumn: "+e.column+"\nChar: "+e.c),t=new Error(t),e.error=t,C(e,"onerror",t),e}function A(e){return e.sawRoot&&!e.closedRoot&&M(e,"Unclosed root tag"),e.state!==x.BEGIN&&e.state!==x.BEGIN_WHITESPACE&&e.state!==x.TEXT&&P(e,"Unexpected end"),O(e),e.c="",e.closed=!0,C(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&&P(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,E(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,E(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){E(e,"onopennamespace",{prefix:t,uri:n.ns[t]})});for(var r=0,o=e.attribList.length;r",e.tagName="",void(e.state=x.SCRIPT);E(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,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=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(){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),i=function(e){t.postMessage(c+e,"*")}):t.MessageChannel?function(){var e=new MessageChannel;e.port1.onmessage=function(e){d(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(){d(t),n.onreadystatechange=null,e.removeChild(n),n=null},e.appendChild(n)}}():i=function(e){setTimeout(d,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=0?1.2:1))}function i(e,t,n,i,o,a){for(var s=0;s-1);a[++c]=u,s[c]=l,s[c+1]=t}for(u=0,c=0;u 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,d=["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 d)!d.hasOwnProperty(e)||(c[d[e]]?this.element.setAttribute(d[e],c[d[e]].substr(1)):this.element.removeAttribute(d[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,d=/\[[\s\t]*?(min|max)-(width|height)[\s\t]*?[~$\^]?=[\s\t]*?"([^"]*?)"[\s\t]*?]/gim;function f(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=d.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"))&&f(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 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 O(e,t,n){var i={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},r=E.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=A(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):P.call(e,t)},w.prototype.listenerCount=P,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 $(e,t){for(var n in t)t[n].forEach(function(t){return e.push(t.key)})}function Q(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 de(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 fe(e,t,n,i){var r=[],o=e?$: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:Q;"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 Ce(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 Ee(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 Pe(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 Ae(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,d=t._nodes.values(),f=t.type;!0!==(i=d.next()).done;){if(r=i.value,"undirected"!==f)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"!==f)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 d(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),d(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 d=new U(i,r,n,u,c,s);return e._edges.set(r,d),o===a?i?(u.undirectedSelfLoops++,e._undirectedSelfLoopCount++):(u.directedSelfLoops++,e._directedSelfLoopCount++):i?(u.undirectedDegree++,c.undirectedDegree++):(u.outDegree++,c.inDegree++),H(e,i,d,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 d,f,p=e._nodes.get(o),v=e._nodes.get(a);if(!n&&(d=e._edges.get(r))){if(d.source.key!==o||d.target.key!==a||i&&(d.source.key!==a||d.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(d.source.key,'", "').concat(d.target.key,'").'));f=d}if(f||e.multi||!p||(f=i?p.undirected[a]:p.out[a]),f)return(c?l:s)?(c?(f.attributes=l(f.attributes),e.emit("edgeAttributesUpdated",{type:"replace",key:f.key,attributes:f.attributes})):(u(f.attributes,s),e.emit("edgeAttributesUpdated",{type:"merge",key:f.key,attributes:f.attributes,data:s})),f.key):f.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,{})),d=new U(i,r,n,p,v,s),e._edges.set(r,d),o===a?i?(p.undirectedSelfLoops++,e._undirectedSelfLoopCount++):(p.directedSelfLoops++,e._directedSelfLoopCount++):i?(p.undirectedDegree++,v.undirectedDegree++):(p.outDegree++,v.inDegree++),H(e,i,d,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 f(s(n),"NodeDataClass",r),f(s(n),"_attributes",{}),f(s(n),"_nodes",new Map),f(s(n),"_edges",new Map),f(s(n),"_directedSize",0),f(s(n),"_undirectedSize",0),f(s(n),"_directedSelfLoopCount",0),f(s(n),"_undirectedSelfLoopCount",0),f(s(n),"_edgeKeyGenerator",t.edgeKeyGenerator||(i=0,function(){return i++})),f(s(n),"_options",t),Fe.forEach(function(e){return f(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?(f=(u=this)._nodes.values(),p=u.type,v="outer",g=null,new R(function e(){var t;if("outer"===v)return!0===(t=f.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),d=0,v="inner-directed",e());if("undirected"===v){if("directed"===p)return v="outer",e();h=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=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,d,f,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,f(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 fe(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 de(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 Ae(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&&Ce(r,n,n.in,i),"in"!==t&&Ce(r,n,n.out,i)),"directed"!==e&&Ce(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 Ee(n,n.undirected,i);if("string"==typeof t)return Ee(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,Pe(r,n,n.in))),"in"!==t&&(i=X(i,Pe(r,n,n.out)))),"directed"!==e&&(i=X(i,Pe(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 $e(e){e.from=function(t,n){var i=u({},t.options,n),r=new e(i);return r.import(t),r}}return $e(Ge),$e(We),$e(qe),$e(Xe),$e(Ye),$e(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,d=Math.abs,f=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 P(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=f(),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=d(l.x)>d(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=d(h.x)>d(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;E(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=d(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&&C(this.element,this.evEl,this.domHandler),this.evTarget&&C(this.target,this.evTarget,this.domHandler),this.evWin&&C(D(this.element),this.evWin,this.domHandler)}};var $={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(e){var t=$[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=P(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=A(e.touches),i=A(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 de(){this.evTarget=he,this.targetIds={},U.apply(this,arguments)}function fe(e,t){var n=A(e.touches),i=this.targetIds;if(3&t&&1===n.length)return i[n[0].identifier]=!0,[n,n];var r,o,a=A(e.changedTouches),s=[],u=this.target;if(o=n.filter(function(e){return E(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=Pe(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=f(),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&&d(t)>this.options.velocity&&4&e.eventType},emit:function(e){var t=Pe(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,$=/<%=([\s\S]+?)%>/g,Q=/\.|\[(?:[^[\]]*|(["'])(?:(?!\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*$/,de=/^[-+]0x[0-9a-f]+$/i,fe=/^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",Ce="\\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",Oe="["+_e+"]",Te="["+Ee+"]",Pe="["+we+"]",Ae="\\d+",Me="["+ke+"]",Ie="["+xe+"]",Re="[^"+_e+Ee+Ae+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="(?:"+Pe+"|"+De+")?",Ge="["+Ce+"]?",We=Ge+He+"(?:\\u200d(?:"+[Ne,Le,je].join("|")+")"+Ge+He+")*",qe="(?:"+[Me,Le,je].join("|")+")"+We,Xe="(?:"+[Ne+Pe+"?",Pe,Le,je,Oe].join("|")+")",Ye=RegExp("['\u2019]","g"),Ke=RegExp(Pe,"g"),$e=RegExp(De+"(?="+De+")|"+Xe+We,"g"),Qe=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_])",Ae,qe].join("|"),"g"),Ze=RegExp("[\\u200d"+_e+we+Ce+"]"),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[A]=nt[g]=nt[M]=nt[m]=nt[y]=nt[b]=nt[w]=nt[k]=nt[x]=nt[C]=nt[E]=nt[O]=nt[P]=!1;var it={};it[p]=it[v]=it[A]=it[M]=it[g]=it[m]=it[I]=it[R]=it[D]=it[N]=it[L]=it[w]=it[k]=it[x]=it[C]=it[E]=it[O]=it[T]=it[j]=it[F]=it[B]=it[V]=!0,it[y]=it[b]=it[P]=!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,dt=ht&&ht.exports===lt,ft=dt&&st.process,pt=function(){try{return ht&&ht.require&&ht.require("util").types||ft&&ft.binding&&ft.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 Qt(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",""":'"',"'":"'"}),dn=function e(t){var n,i=(t=null==t?ct:dn.defaults(ct.Object(),t,dn.pick(ct,et))).Array,ie=t.Date,_e=t.Error,we=t.Function,ke=t.Math,xe=t.Object,Se=t.RegExp,Ce=t.String,Ee=t.TypeError,Oe=i.prototype,Te=xe.prototype,Pe=t["__core-js_shared__"],Ae=we.prototype.toString,Me=Te.hasOwnProperty,Ie=0,Re=(n=/[^.]+$/.exec(Pe&&Pe.keys&&Pe.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",De=Te.toString,Ne=Ae.call(xe),Le=ct._,je=Se("^"+Ae.call(Me).replace(ee,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Fe=dt?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,$e=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,ft=xe.getOwnPropertySymbols,pt=Fe?Fe.isBuffer:r,Dt=t.isFinite,Ut=Oe.join,fn=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"),Cn=ao(xe,"create"),En=Sn&&new Sn,On={},Tn=Lo(_n),Pn=Lo(wn),An=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__=d,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 d=co(e),f=d==b||d==_;if(qa(e))return yr(e,u);if(d==x||d==p||f&&!o){if(s=c||f?{}:ho(e),!u)return c?function(e,t){return Cr(e,uo(e),t)}(e,function(e,t){return e&&Cr(t,As(t),e)}(s,e)):function(e,t){return Cr(e,so(e),t)}(e,ei(s,e))}else{if(!it[d])return o?e:{};s=function(e,t,n){var i=e.constructor;switch(t){case A: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 C:return function(e){var t=new e.constructor(e.source,he.exec(e));return t.lastIndex=e.lastIndex,t}(e);case E:return new i;case T:return function(e){return Dn?xe(Dn.call(e)):{}}(e)}}(e,d,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?As:Ps)(e);return xt(y||e,function(i,r){y&&(i=e[r=i]),Qn(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 Ee(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=Pt(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?fi(s,t-1,n,i,r):At(r,s):i||(r[r.length]=s)}return r}var pi=Pr(),vi=Pr(!0);function gi(e,t){return e&&pi(e,t,Ps)}function mi(e,t){return e&&vi(e,t,Ps)}function yi(e,t){return Et(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 Ci(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 d=e[u];u&&t&&(d=Pt(d,Xt(t))),l=vn(d.length,l),c[u]=!n&&(t||a>=120&&d.length>=120)?new Gn(u&&d):r}d=e[0];var f=-1,p=c[0];e:for(;++f=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:Pt(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 Qr(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 Ee(o);if(a&&!u&&"wrapper"==to(s))var u=new Bn([],!0)}for(i=u?i:n;++i1&&b.reverse(),f&&hu))return!1;var l=a.get(e),h=a.get(t);if(l&&h)return l==t&&h==e;var d=-1,f=!0,p=2&n?new Gn:r;for(a.set(e,t),a.set(t,e);++d-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(f,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 Ao(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 da=Qr(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)}),fa=Er(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=Er(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):Ei(e,t,n)}),a}),_a=Er(function(e,t,n){ti(e,n,t)});function wa(e,t){return(Ua(e)?Pt:Di)(e,io(t,3))}var ka=Er(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,fi(t,1),[])}),Sa=st||function(){return ct.Date.now()};function Ca(e,t,n){return t=n?r:t,qr(e,c,r,r,r,r,t=e&&null==t?e.length:t)}function Ea(e,t){var n;if("function"!=typeof t)throw new Ee(o);return e=ds(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 Pa(e,t,n){var i,a,s,u,c,l,h=0,d=!1,f=!1,p=!0;if("function"!=typeof e)throw new Ee(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),d?v(e):u}function m(e){var n=e-l;return l===r||n>=t||n<0||f&&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 f?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(f)return mr(c),c=Oo(y,t),v(l)}return c===r&&(c=Oo(y,t)),u}return t=ps(t)||0,Za(n)&&(d=!!n.leading,s=(f="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 Aa=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 Ee(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 Ee(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])?Pt(t[0],Xt(io())):Pt(fi(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)==A};function Ga(e){return null!=e&&Qa(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 $a(e){return"number"==typeof e&&e==ds(e)}function Qa(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&&Ae.call(n)==Ne}var is=yt?Xt(yt):function(e){return Ja(e)&&wi(e)==C},rs=bt?Xt(bt):function(e){return Ja(e)&&co(e)==E};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)&&Qa(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==E?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 ds(e){var t=hs(e),n=t%1;return t==t?n?t-n:t:0}function fs(e){return e?ii(ds(e),0,d):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=fe.test(e);return n||ve.test(e)?at(e.slice(2),n?2:8):de.test(e)?NaN:+e}function vs(e){return Cr(e,As(e))}function gs(e){return null==e?"":rr(e)}var ms=Or(function(e,t){if(bo(t)||Ga(t))Cr(t,Ps(t),e);else for(var n in t)Me.call(t,n)&&Qn(e,n,t[n])}),ys=Or(function(e,t){Cr(t,As(t),e)}),bs=Or(function(e,t,n,i){Cr(t,As(t),e,i)}),_s=Or(function(e,t,n,i){Cr(t,Ps(t),e,i)}),ws=Qr(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}),Cr(e,Jr(e),n),i&&(n=ri(n,7,Kr));for(var r=t.length;r--;)ar(n,t[r]);return n}),Ds=Qr(function(e,t){return null==e?{}:function(e,t){return Vi(e,t,function(t,n){return Cs(e,n)})}(e,t)});function Ns(e,t){if(null==e)return{};var n=Pt(Jr(e),function(e){return[e]});return t=io(t),Vi(e,n,function(e,n){return t(e,n[0])})}var Ls=Wr(Ps),js=Wr(As);function Fs(e){return null==e?[]:Yt(e,Ps(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=Ar("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=Ar("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(Qe)||[]}(e):function(e){return e.match(se)||[]}(e):e.match(t)||[]}var $s=Wi(function(e,t){try{return wt(e,r,t)}catch(Ro){return Ya(Ro)?Ro:new _e(Ro)}}),Qs=Qr(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 Ei(n,e,t)}}),ru=Wi(function(e,t){return function(n){return Ei(e,n,t)}});function ou(e,t,n){var i=Ps(t),r=yi(t,i);null==n&&(!Za(t)||!r.length&&i.length)&&(n=t,t=e,e=this,r=yi(t,Ps(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,At([this.value()],arguments))})}),e}function au(){}var su=Fr(Pt),uu=Fr(Ct),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(),du=Vr(!0);function fu(){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 Ee(o);return e=ds(e),function(){if(--e<1)return t.apply(this,arguments)}},Ln.ary=Ca,Ln.assign=ms,Ln.assignIn=ys,Ln.assignInWith=bs,Ln.assignWith=_s,Ln.at=ws,Ln.before=Ea,Ln.bind=Oa,Ln.bindAll=Qs,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(ds(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:ds(i))<0&&(i+=o),i=n>i?0:fs(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 Ee(o);return t=null==t?0:pn(ds(t),0),Wi(function(n){var i=n[t],r=gr(n,0,t);return i&&At(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:ds(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:ds(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 Ee(o);return Za(n)&&(i="leading"in n?!!n.leading:i,r="trailing"in n?!!n.trailing:r),Pa(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)?Pt(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 Ca(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,fr(n))},Ln.updateWith=function(e,t,n,i){return i="function"==typeof i?i:r,null==e?e:sr(e,t,fr(n),i)},Ln.values=Fs,Ln.valuesIn=function(e){return null==e?[]:Yt(e,As(e))},Ln.without=ra,Ln.words=Ks,Ln.wrap=function(e,t){return Na(fr(t),e)},Ln.xor=oa,Ln.xorBy=aa,Ln.xorWith=sa,Ln.zip=ua,Ln.zipObject=function(e,t){return hr(e||[],t||[],Qn)},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=$s,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,Ps(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(ds(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)?Ct: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),As)},Ln.forInRight=function(e,t){return null==e?e:vi(e,io(t,3),As)},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=Cs,Ln.head=Go,Ln.identity=tu,Ln.includes=function(e,t,n,i){e=Ga(e)?e:Fs(e),n=n&&!i?ds(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:ds(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)==P},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=ds(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=fu,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,ds(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=ds(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=ds(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:ds(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=d,i=vn(e,d);t=io(t),e-=d;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 d=l.index;c=c.slice(0,d===r?u:d)}}else if(e.indexOf(rr(o),u)!=u){var f=c.lastIndexOf(o);f>-1&&(c=c.slice(0,f))}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(ds(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,d),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 Ei(n,e,t)})}),Vn.prototype.reject=function(e){return this.filter(Ra(io(e)))},Vn.prototype.slice=function(e,t){e=ds(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=ds(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(d)},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,At([e],s));return i&&d?t[0]:t};l&&n&&"function"==typeof c&&1!=c.length&&(u=l=!1);var d=this.__chain__,f=!!this.__actions__.length,p=a&&!d,v=u&&!f;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,d)}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._=dn,(i=(function(){return dn}).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 d=/(^|[^\[])\^/g,f=/[^\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:C(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],d=t[2],f=d.length>1,p={type:"list",raw:h,ordered:f,start:f?+d.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]):E(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=E(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=E(this.options.mangle?t(r[1]):r[1])):n=E(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=E(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=E(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]):E(r[0]):r[0]:E(this.options.smartypants?n(r[0]):r[0]),{type:"text",raw:r[0],text:i}},e}(),P={exec:function(){}},A=function(e,t){e=e.source||e,t=t||"";var n={replace:function(t,i){return i=(i=i.source||i).replace(d,"$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:P,table:P,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=A(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=A(I.item,"gm").replace(/bull/g,I.bullet).getRegex(),I.listItemStart=A(/^( *)(bull) */).replace("bull",I.bullet).getRegex(),I.list=A(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=A(I.html,"i").replace("comment",I._comment).replace("tag",I._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),I.paragraph=A(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=A(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=A(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=A(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:A("^ *(?: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:P,paragraph:A(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:P,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:P,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~"};R.punctuation=A(R.punctuation).replace(/punctuation/g,R._punctuation).getRegex(),R.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,R.escapedEmSt=/\\\*|\\_/g,R._comment=A(I._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),R.emStrong.lDelim=A(R.emStrong.lDelim).replace(/punct/g,R._punctuation).getRegex(),R.emStrong.rDelimAst=A(R.emStrong.rDelimAst,"g").replace(/punct/g,R._punctuation).getRegex(),R.emStrong.rDelimUnd=A(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=A(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=A(R.tag).replace("comment",R._comment).replace("attribute",R._attribute).getRegex(),R._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,R._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,R._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,R.link=A(R.link).replace("label",R._label).replace("href",R._href).replace("title",R._title).getRegex(),R.reflink=A(R.reflink).replace("label",R._label).getRegex(),R.reflinkSearch=A(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:A(/^!?\[(label)\]\((.*?)\)/).replace("label",R._label).getRegex(),reflink:A(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",R._label).getRegex()}),R.gfm=M({},R.normal,{escape:A(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));)d.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 f="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(f);break}throw new Error(f)}}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(f,"").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,$=X,Q=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 $,this.slugger=new Q}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,d,f,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,d,f);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 de.options=de.setOptions=function(e){return ae(de.defaults,e),le(de.defaults),de},de.getDefaults=ce,de.defaults=he,de.use=function(){for(var e=this,t=arguments.length,n=new Array(t),i=0;iAn error occurred:

    "+ue(i.message+"",!0)+"
    ";throw i}},de.Parser=te,de.parser=te.parse,de.Renderer=ie,de.TextRenderer=re,de.Lexer=ee,de.lexer=ee.lex,de.Tokenizer=ne,de.Slugger=oe,de.parse=de,de}()},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 d(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(d,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(d,n,{subscriber:i,context:o})),this.schedule(e,t))}function d(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 f(t,r,this);if(this.destination.next(o),this.durationSelector){var a=void 0;try{a=this.durationSelector(new f(t,r))}catch(l){return void this.error(l)}this.add(a.subscribe(new d(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),d=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),f=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=f;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(f,i,s))}else this.add(o.schedule(d,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 d(e){var t=e.subscriber,n=e.windowTimeSpan,i=e.window;i&&t.closeWindow(i),e.window=t.openWindow(),this.schedule(e,n)}function f(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,d=0;d-1?h:f,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,"qs",{enumerable:!0,get:function(){return a.default}});var o=n(41151),a=(u(n(61602)),u(n(97310)));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)}function u(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==r(e)&&"function"!=typeof e)return{default:e};var n=s(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 u=o?Object.getOwnPropertyDescriptor(e,a):null;u&&(u.get||u.set)?Object.defineProperty(i,a,u):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)},51316:function(n,i,r){"use strict";var d,f,g,y,w,k,x,S,C,E,O,T=regeneratorRuntime.mark(Mj),A=regeneratorRuntime.mark(zX),R={};r.r(R),r.d(R,{decode:function(){return Sj},encode:function(){return Ej}});var D={};r.r(D),r.d(D,{decode:function(){return Ij},encode:function(){return Dj}});var N={};r.r(N),r.d(N,{decode:function(){return Nj},encode:function(){return jj}});var L={};function j(e){return"function"==typeof e}r.r(L),r.d(L,{decode:function(){return Bj},encode:function(){return zj}});var F=!1,B={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 F&&console.log("RxJS: Back to a better error behavior. Thank you. <3");F=e},get useDeprecatedSynchronousErrorHandling(){return F}};function V(e){setTimeout(function(){throw e},0)}var z={closed:!0,next:function(e){},error:function(e){if(B.useDeprecatedSynchronousErrorHandling)throw e;V(e)},complete:function(){}},U=Array.isArray||function(e){return e&&"number"==typeof e.length};function H(e){return null!==e&&"object"==typeof e}var G,W=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}(),q=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(ke(function(n,i){return ye(e(n,i)).pipe(ce(function(e,r){return t(n,e,i,r)}))},n))}:("number"==typeof t&&(n=t),function(t){return t.lift(new xe(e,n))})}var xe=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 Se(e,this.project,this.concurrent))}}]),e}(),Se=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}(_e);function Ce(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Number.POSITIVE_INFINITY;return ke(Z,e)}function Ee(e,t){return t?me(e,t):new te(de(e))}function Oe(){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 te?t[0]:Ce(i)(Ee(t,r))}function Te(){return function(e){return e.lift(new Pe(e))}}var Pe=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}(K),Me=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 q).add(this.source.subscribe(new Re(this.getSubject(),this))),e.closed&&(this._connection=null,e=q.EMPTY)),e}},{key:"refCount",value:function(){return Te()(this)}}]),n}(te),Ie=function(){var e=Me.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}}}(),Re=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}(oe);function De(e,t){return function(n){var i;if(i="function"==typeof e?e:function(){return e},"function"==typeof t)return n.lift(new Ne(i,t));var r=Object.create(n,Ie);return r.source=n,r.subjectFactory=i,r}}var Ne=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 Le(){return new ae}function je(){return function(e){return Te()(De(Le)(e))}}function Fe(e){for(var t in e)if(e[t]===Fe)return t;throw Error("Could not find renamed property on target object.")}function Be(e,t){for(var n in t)t.hasOwnProperty(n)&&!e.hasOwnProperty(n)&&(e[n]=t[n])}function Ve(e){if("string"==typeof e)return e;if(Array.isArray(e))return"["+e.map(Ve).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 ze(e,t){return null==e||""===e?null===t?"":t:null==t||""===t?e:e+" "+t}var Ue=Fe({__forward_ref__:Fe});function He(e){return e.__forward_ref__=He,e.toString=function(){return Ve(this())},e}function Ge(e){return We(e)?e():e}function We(e){return"function"==typeof e&&e.hasOwnProperty(Ue)&&e.__forward_ref__===He}var qe=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 Xe(e){return"string"==typeof e?e:null==e?"":String(e)}function Ye(e){return"function"==typeof e?e.name||e.toString():"object"==typeof e&&null!=e&&"function"==typeof e.type?e.type.name||e.type.toString():Xe(e)}function Ke(e,t){var n=t?" in ".concat(t):"";throw new qe("201","No provider for ".concat(Ye(e)," found").concat(n))}function $e(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 Ze(e){return Je(e,nt)||Je(e,rt)}function Je(e,t){return e.hasOwnProperty(t)?e[t]:null}function et(e){return e&&(e.hasOwnProperty(it)||e.hasOwnProperty(ot))?e[it]:null}var tt,nt=Fe({"\u0275prov":Fe}),it=Fe({"\u0275inj":Fe}),rt=Fe({ngInjectableDef:Fe}),ot=Fe({ngInjectorDef:Fe}),at=((at=at||{})[at.Default=0]="Default",at[at.Host=1]="Host",at[at.Self=2]="Self",at[at.SkipSelf=4]="SkipSelf",at[at.Optional=8]="Optional",at);function st(e){var t=tt;return tt=e,t}function ut(e,t,n){var i=Ze(e);return i&&"root"==i.providedIn?void 0===i.value?i.value=i.factory():i.value:n&at.Optional?null:void 0!==t?t:void Ke(Ve(e),"Injector")}function ct(e){return{toString:e}.toString()}var lt=((lt=lt||{})[lt.OnPush=0]="OnPush",lt[lt.Default=1]="Default",lt),ht=((ht=ht||{})[ht.Emulated=0]="Emulated",ht[ht.None=2]="None",ht[ht.ShadowDom=3]="ShadowDom",ht),dt="undefined"!=typeof globalThis&&globalThis,ft="undefined"!=typeof window&&window,pt="undefined"!=typeof self&&"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&self,vt="undefined"!=typeof global&&global,gt=dt||vt||ft||pt,mt={},yt=[],bt=Fe({"\u0275cmp":Fe}),_t=Fe({"\u0275dir":Fe}),wt=Fe({"\u0275pipe":Fe}),kt=Fe({"\u0275mod":Fe}),xt=Fe({"\u0275loc":Fe}),St=Fe({"\u0275fac":Fe}),Ct=Fe({__NG_ELEMENT_ID__:Fe}),Et=0;function Ot(e){return ct(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===lt.OnPush,directiveDefs:null,pipeDefs:null,selectors:e.selectors||yt,viewQuery:e.viewQuery||null,features:e.features||null,data:e.data||{},encapsulation:e.encapsulation||ht.Emulated,id:"c",styles:e.styles||yt,_:null,setInput:null,schemas:e.schemas||null,tView:null},i=e.directives,r=e.features,o=e.pipes;return n.id+=Et++,n.inputs=It(e.inputs,t),n.outputs=It(e.outputs),r&&r.forEach(function(e){return e(n)}),n.directiveDefs=i?function(){return("function"==typeof i?i():i).map(Tt)}:null,n.pipeDefs=o?function(){return("function"==typeof o?o():o).map(Pt)}:null,n})}function Tt(e){return Nt(e)||function(e){return e[_t]||null}(e)}function Pt(e){return function(e){return e[wt]||null}(e)}var At={};function Mt(e){return ct(function(){var t={type:e.type,bootstrap:e.bootstrap||yt,declarations:e.declarations||yt,imports:e.imports||yt,exports:e.exports||yt,transitiveCompileScopes:null,schemas:e.schemas||null,id:e.id||null};return null!=e.id&&(At[e.id]=e.type),t})}function It(e,t){if(null==e)return mt;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 Rt=Ot;function Dt(e){return{type:e.type,name:e.name,factory:null,pure:!1!==e.pure,onDestroy:e.type.prototype.ngOnDestroy||null}}function Nt(e){return e[bt]||null}function Lt(e,t){var n=e[kt]||null;if(!n&&!0===t)throw new Error("Type ".concat(Ve(e)," does not have '\u0275mod' property."));return n}function jt(e){return Array.isArray(e)&&"object"==typeof e[1]}function Ft(e){return Array.isArray(e)&&!0===e[1]}function Bt(e){return 0!=(8&e.flags)}function Vt(e){return 2==(2&e.flags)}function zt(e){return 1==(1&e.flags)}function Ut(e){return null!==e.template}function Ht(e){return 0!=(512&e[2])}function Gt(e,t){return e.hasOwnProperty(St)?e[St]:null}var Wt=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 qt(){return Xt}function Xt(e){return e.type.prototype.ngOnChanges&&(e.setInput=Kt),Yt}function Yt(){var e=Qt(this),t=null==e?void 0:e.current;if(t){var n=e.previous;if(n===mt)e.previous=t;else for(var i in t)n[i]=t[i];e.current=null,this.ngOnChanges(t)}}function Kt(e,t,n,i){var r=Qt(e)||function(e,t){return e[$t]=t}(e,{previous:mt,current:null}),o=r.current||(r.current={}),a=r.previous,s=this.declaredInputs[n],u=a[s];o[s]=new Wt(u&&u.currentValue,t,a===mt),e[i]=t}qt.ngInherit=!0;var $t="__ngSimpleChanges__";function Qt(e){return e[$t]||null}var Zt,Jt="http://www.w3.org/2000/svg";function en(){return void 0!==Zt?Zt:"undefined"!=typeof document?document:void 0}function tn(e){return!!e.listen}var nn={createRenderer:function(e,t){return en()}};function rn(e){for(;Array.isArray(e);)e=e[0];return e}function on(e,t){return rn(t[e])}function an(e,t){return rn(t[e.index])}function sn(e,t){return e.data[t]}function un(e,t){return e[t]}function cn(e,t){var n=t[e];return jt(n)?n:n[0]}function ln(e){return 4==(4&e[2])}function hn(e){return 128==(128&e[2])}function dn(e,t){return null==t?null:e[t]}function fn(e){e[18]=0}function pn(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 vn={lFrame:Vn(null),bindingsEnabled:!0,isInCheckNoChangesMode:!1};function gn(){return vn.bindingsEnabled}function mn(){return vn.lFrame.lView}function yn(){return vn.lFrame.tView}function bn(e){return vn.lFrame.contextLView=e,e[8]}function _n(){for(var e=wn();null!==e&&64===e.type;)e=e.parent;return e}function wn(){return vn.lFrame.currentTNode}function kn(e,t){var n=vn.lFrame;n.currentTNode=e,n.isParent=t}function xn(){return vn.lFrame.isParent}function Sn(){vn.lFrame.isParent=!1}function Cn(){return vn.isInCheckNoChangesMode}function En(e){vn.isInCheckNoChangesMode=e}function On(){var e=vn.lFrame,t=e.bindingRootIndex;return-1===t&&(t=e.bindingRootIndex=e.tView.bindingStartIndex),t}function Tn(){return vn.lFrame.bindingIndex}function Pn(){return vn.lFrame.bindingIndex++}function An(e){var t=vn.lFrame,n=t.bindingIndex;return t.bindingIndex=t.bindingIndex+e,n}function Mn(e,t){var n=vn.lFrame;n.bindingIndex=n.bindingRootIndex=e,In(t)}function In(e){vn.lFrame.currentDirectiveIndex=e}function Rn(e){var t=vn.lFrame.currentDirectiveIndex;return-1===t?null:e[t]}function Dn(){return vn.lFrame.currentQueryIndex}function Nn(e){vn.lFrame.currentQueryIndex=e}function Ln(e){var t=e[1];return 2===t.type?t.declTNode:1===t.type?e[6]:null}function jn(e,t,n){if(n&at.SkipSelf){for(var i=t,r=e;!(null!==(i=i.parent)||n&at.Host||(i=Ln(r),null===i||(r=r[15],10&i.type))););if(null===i)return!1;t=i,e=r}var o=vn.lFrame=Bn();return o.currentTNode=t,o.lView=e,!0}function Fn(e){var t=Bn(),n=e[1];vn.lFrame=t,t.currentTNode=n.firstChild,t.lView=e,t.tView=n,t.contextLView=e,t.bindingIndex=n.bindingStartIndex,t.inI18n=!1}function Bn(){var e=vn.lFrame,t=null===e?null:e.child;return null===t?Vn(e):t}function Vn(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 zn(){var e=vn.lFrame;return vn.lFrame=e.parent,e.currentTNode=null,e.lView=null,e}var Un=zn;function Hn(){var e=zn();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 Gn(){return vn.lFrame.selectedIndex}function Wn(e){vn.lFrame.selectedIndex=e}function qn(){var e=vn.lFrame;return sn(e.tView,e.selectedIndex)}function Xn(){vn.lFrame.currentNamespace=Jt}function Yn(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 ei=function e(t,n,i){m(this,e),this.factory=t,this.resolving=!1,this.canSeeViewProviders=n,this.injectImpl=i};function ti(e,t,n){for(var i=tn(e),r=0;rt){a=o-1;break}}}for(;o>16}(e),i=t;n>0;)i=i[15],n--;return i}var ci=!0;function li(e){var t=ci;return ci=e,t}var hi=0;function di(e,t){var n=pi(e,t);if(-1!==n)return n;var i=t[1];i.firstCreatePass&&(e.injectorIndex=t.length,fi(i.data,e),fi(t,null),fi(i.blueprint,null));var r=vi(e,t),o=e.injectorIndex;if(ai(r))for(var a=si(r),s=ui(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 fi(e,t){e.push(0,0,0,0,0,0,0,0,t)}function pi(e,t){return-1===e.injectorIndex||e.parent&&e.parent.injectorIndex===e.injectorIndex||null===t[e.injectorIndex+8]?-1:e.injectorIndex}function vi(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 gi(e,t,n){!function(e,t,n){var i;"string"==typeof n?i=n.charCodeAt(0)||0:n.hasOwnProperty(Ct)&&(i=n[Ct]),null==i&&(i=n[Ct]=hi++);var r=255&i;t.data[e+(r>>5)]|=1<3&&void 0!==arguments[3]?arguments[3]:at.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(Ct)?e[Ct]:void 0;return"number"==typeof t?t>=0?255&t:wi:t}(n);if("function"==typeof o){if(!jn(t,e,i))return i&at.Host?mi(r,n,i):yi(t,n,i,r);try{var a=o(i);if(null!=a||i&at.Optional)return a;Ke(n)}finally{Un()}}else if("number"==typeof o){var s=null,u=pi(e,t),c=-1,l=i&at.Host?t[16][6]:null;for((-1===u||i&at.SkipSelf)&&(-1!==(c=-1===u?vi(e,t):t[u+8])&&Ei(i,!1)?(s=t[1],u=si(c),t=ui(c,t)):u=-1);-1!==u;){var h=t[1];if(Ci(o,u,h.data)){var d=ki(u,t,n,s,i,l);if(d!==_i)return d}-1!==(c=t[u+8])&&Ei(i,t[1].data[u+8]===l)&&Ci(o,u,t)?(s=h,u=si(c),t=ui(c,t)):u=-1}}}return yi(t,n,i,r)}var _i={};function wi(){return new Oi(_n(),mn())}function ki(e,t,n,i,r,o){var a=t[1],s=a.data[e+8],u=xi(s,a,n,null==i?Vt(s)&&ci:i!=a&&0!=(3&s.type),r&at.Host&&o===s);return null!==u?Si(t,a,u,s):_i}function xi(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&&d.type===n)return h}if(r){var f=a[u];if(f&&Ut(f)&&f.type===n)return u}return null}function Si(e,t,n,i){var r=e[n],o=t.data;if(function(e){return e instanceof ei}(r)){var a=r;a.resolving&&function(e,t){throw new qe("200","Circular dependency in DI detected for ".concat(e))}(Ye(o[n]));var s=li(a.canSeeViewProviders);a.resolving=!0;var u=a.injectImpl?st(a.injectImpl):null;jn(e,i,at.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=Xt(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&&st(u),li(s),a.resolving=!1,Un()}}return r}function Ci(e,t,n){return!!(n[t+(e>>5)]&1<=e.length?e.push(n):e.splice(t,0,n)}function Fi(e,t){return t>=e.length-1?e.pop():e.splice(t,1)[0]}function Bi(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 zi(e,t){var n=Ui(e,t);if(n>=0)return e[1|n]}function Ui(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 Hi,Gi={},Wi="__NG_DI_FLAG__",qi="ngTempTokenPath",Xi=/\n/gm,Yi="__source",Ki=Fe({provide:String,useValue:Fe});function $i(e){var t=Hi;return Hi=e,t}function Qi(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:at.Default;if(void 0===Hi)throw new Error("inject() must be called from an injection context");return null===Hi?ut(e,void 0,t):Hi.get(e,t&at.Optional?null:void 0,t)}function Zi(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:at.Default;return(tt||Qi)(Ge(e),t)}var Ji=Zi;function er(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=Ve(t);if(Array.isArray(t))r=t.map(Ve).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):Ve(s)))}r="{".concat(o.join(", "),"}")}return"".concat(n).concat(i?"("+i+")":"","[").concat(r,"]: ").concat(e.replace(Xi,"\n "))}("\n"+e.message,r,n,i),e.ngTokenPath=r,e[qi]=null,e}var rr,or,ar=tr(Ii("Inject",function(e){return{token:e}}),-1),sr=tr(Ii("Optional"),8),ur=tr(Ii("SkipSelf"),4);function cr(e){var t;return(null===(t=function(){if(void 0===rr&&(rr=null,gt.trustedTypes))try{rr=gt.trustedTypes.createPolicy("angular",{createHTML:function(e){return e},createScript:function(e){return e},createScriptURL:function(e){return e}})}catch(e){}return rr}())||void 0===t?void 0:t.createHTML(e))||e}function lr(){if(void 0===or&&(or=null,gt.trustedTypes))try{or=gt.trustedTypes.createPolicy("angular#unsafe-bypass",{createHTML:function(e){return e},createScript:function(e){return e},createScriptURL:function(e){return e}})}catch(G){}return or}function hr(e){var t;return(null===(t=lr())||void 0===t?void 0:t.createHTML(e))||e}function dr(e){var t;return(null===(t=lr())||void 0===t?void 0:t.createScriptURL(e))||e}var fr=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}(),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"HTML"}}]),n}(fr),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"Style"}}]),n}(fr),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"Script"}}]),n}(fr),mr=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}(fr),yr=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}(fr);function br(e){return e instanceof fr?e.changingThisBreaksApplicationSecurity:e}function _r(e,t){var n=wr(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 wr(e){return e instanceof fr&&e.getTypeName()||null}var kr=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(cr(e),"text/html").body;return null===t?this.inertDocumentHelper.getInertBodyElement(e):(t.removeChild(t.firstChild),t)}catch(t){return null}}}]),e}(),xr=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=cr(e),t;var n=this.inertDocument.createElement("body");return n.innerHTML=cr(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();Dr.hasOwnProperty(t)&&!Mr.hasOwnProperty(t)&&(this.buf.push(""))}},{key:"chars",value:function(e){this.buf.push(Ur(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}(),Vr=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,zr=/([^\#-~ |!])/g;function Ur(e){return e.replace(/&/g,"&").replace(Vr,function(e){return"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";"}).replace(zr,function(e){return"&#"+e.charCodeAt(0)+";"}).replace(//g,">")}function Hr(e,t){var n=null;try{Ar=Ar||function(e){var t=new xr(e);return function(){try{return!!(new window.DOMParser).parseFromString(cr(""),"text/html")}catch(e){return!1}}()?new kr(t):t}(e);var i=t?String(t):"";n=Ar.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=Ar.getInertBodyElement(i)}while(i!==o);return cr((new Br).sanitizeChildren(Gr(n)||n))}finally{if(n)for(var a=Gr(n)||n;a.firstChild;)a.removeChild(a.firstChild)}}function Gr(e){return"content"in e&&function(e){return e.nodeType===Node.ELEMENT_NODE&&"TEMPLATE"===e.nodeName}(e)?e.content:null}var Wr=((Wr=Wr||{})[Wr.NONE=0]="NONE",Wr[Wr.HTML=1]="HTML",Wr[Wr.STYLE=2]="STYLE",Wr[Wr.SCRIPT=3]="SCRIPT",Wr[Wr.URL=4]="URL",Wr[Wr.RESOURCE_URL=5]="RESOURCE_URL",Wr);function qr(e){var t=Kr();return t?hr(t.sanitize(Wr.HTML,e)||""):_r(e,"HTML")?hr(br(e)):Hr(en(),Xe(e))}function Xr(e){var t=Kr();return t?t.sanitize(Wr.URL,e)||"":_r(e,"URL")?br(e):Er(Xe(e))}function Yr(e){var t=Kr();if(t)return dr(t.sanitize(Wr.RESOURCE_URL,e)||"");if(_r(e,"ResourceURL"))return dr(br(e));throw new Error("unsafe value used in a resource URL context (see https://g.co/ng/security#xss)")}function Kr(){var e=mn();return e&&e[12]}var $r="__ngContext__";function Qr(e,t){e[$r]=t}function Zr(e){var t=function(e){return e[$r]||null}(e);return t?Array.isArray(t)?t:t.lView:null}function Jr(e){return e.ngOriginalError}function eo(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=Fi(e,10+t);!function(e,t){Mo(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 mo(e,t){if(!(256&t[2])){var n=t[11];tn(n)&&n.destroyNode&&Mo(e,t,n,3,null,null),function(e){var t=e[13];if(!t)return yo(e[1],e);for(;t;){var n=null;if(jt(t))n=t[13];else{var i=t[10];i&&(n=i)}if(!n){for(;t&&!t[4]&&t!==e;)jt(t)&&yo(t[1],t),t=t[3];null===t&&(t=e),jt(t)&&yo(t[1],t),n=t&&t[4]}t=n}}(t)}}function yo(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 d=8&i?h:null;if(d&&-1!==No(d,c,0)||2&i&&c!==h){if(zo(i))return!1;a=!0}}}}else{if(!a&&!zo(i)&&!zo(u))return!1;if(a&&zo(u))continue;a=!1,i=u|1&i}}return zo(i)||a}function zo(e){return 0==(1&e)}function Uo(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&&!zo(a)&&(t+=Wo(o,r),r=""),i=a,o=o||!zo(i);n++}return""!==r&&(t+=Wo(o,r)),t}var Xo={};function Yo(e){Ko(yn(),mn(),Gn()+e,Cn())}function Ko(e,t,n,i){if(!i)if(3==(3&t[2])){var r=e.preOrderCheckHooks;null!==r&&Kn(t,r,n)}else{var o=e.preOrderHooks;null!==o&&$n(t,o,0,n)}Wn(n)}function $o(e,t){return e<<17|t<<2}function Qo(e){return e>>17&32767}function Zo(e){return 2|e}function Jo(e){return(131068&e)>>2}function ea(e,t){return-131069&e|t<<2}function ta(e){return 1|e}function na(e,t){var n=e.contentQueries;if(null!==n)for(var i=0;i20&&Ko(e,t,20,Cn()),n(i,r)}finally{Wn(o)}}function la(e,t,n){if(Bt(t))for(var i=t.directiveEnd,r=t.directiveStart;r2&&void 0!==arguments[2]?arguments[2]:an,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 _a(e,t){null!==e.hostBindings&&e.hostBindings(1,t)}function wa(e,t){t.flags|=2,(e.components||(e.components=[])).push(t.index)}function ka(e,t,n){if(n){if(t.exportAs)for(var i=0;i0&&Ma(n)}}function Ma(e){for(var t=co(e);null!==t;t=lo(t))for(var n=10;n0&&Ma(i)}var o=e[1].components;if(null!==o)for(var a=0;a0&&Ma(s)}}function Ia(e,t){var n=cn(t,e),i=n[1];(function(e,t){for(var n=t.length;n1&&void 0!==arguments[1]?arguments[1]:Gi;if(t===Gi){var n=new Error("NullInjectorError: No provider for ".concat(Ve(e),"!"));throw n.name="NullInjectorError",n}return t}}]),e}(),Ka=new Ri("Set Injector scope."),$a={},Qa={};function Za(){return void 0===qa&&(qa=new Ya),qa}function Ja(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 es(e,n,t||Za(),i)}var es=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&&Li(n,function(e){return r.processProvider(e,t,n)}),Li([t],function(e){return r.processInjectorType(e,[],a)}),this.records.set(Xa,is(void 0,this));var s=this.records.get(Ka);this.scope=null!=s?s.value:null,this.source=o||("object"==typeof t?null:Ve(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]:Gi,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:at.Default;this.assertNotDestroyed();var i=$i(this),r=st(void 0);try{if(!(n&at.SkipSelf)){var o=this.records.get(e);if(void 0===o){var a=function(e){return"function"==typeof e||"object"==typeof e&&e instanceof Ri}(e)&&Ze(e);o=a&&this.injectableDefInScope(a)?is(ts(e),$a):null,this.records.set(e,o)}if(null!=o)return this.hydrate(e,o)}return(n&at.Self?Za():this.parent).get(e,t=n&at.Optional&&t===Gi?null:t)}catch(s){if("NullInjectorError"===s.name){if((s[qi]=s[qi]||[]).unshift(Ve(e)),i)throw s;return ir(s,e,"R3InjectorError",this.source)}throw s}finally{st(r),$i(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(Ve(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=Ge(e)))return!1;var r=et(e),o=null==r&&e.ngModule||void 0,a=void 0===o?e:o,s=-1!==n.indexOf(a);if(void 0!==o&&(r=et(o)),null==r)return!1;if(null!=r.imports&&!s){var u;n.push(a);try{Li(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;Li(r,function(e){return i.processProvider(e,n,r||yt)})},l=0;l0){var n=Bi(t,"?");throw new Error("Can't resolve all parameters for ".concat(Ve(e),": (").concat(n.join(", "),")."))}var i=function(e){var t=e&&(e[nt]||e[rt]);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 ns(e,t,n){var i;if(os(e)){var r=Ge(e);return Gt(r)||ts(r)}if(rs(e))i=function(){return Ge(e.useValue)};else if(function(e){return!(!e||!e.useFactory)}(e))i=function(){return e.useFactory.apply(e,v(er(e.deps||[])))};else if(function(e){return!(!e||!e.useExisting)}(e))i=function(){return Zi(Ge(e.useExisting))};else{var o=Ge(e&&(e.useClass||e.provide));if(!function(e){return!!e.deps}(e))return Gt(o)||ts(o);i=function(){return h(o,v(er(e.deps)))}}return i}function is(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return{factory:e,value:t,multi:n?[]:void 0}}function rs(e){return null!==e&&"object"==typeof e&&Ki in e}function os(e){return"function"==typeof e}var as=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=Ja(e,t,n,i);return r._resolveInjectorDefTypes(),r}({name:n},t,e,n)},ss=function(){function e(){m(this,e)}return b(e,null,[{key:"create",value:function(e,t){return Array.isArray(e)?as(e,t,""):as(e.providers,e.parent,e.name||"")}}]),e}();function us(e,t){Yn(Zr(e)[1],_n())}function cs(e){for(var t=function(e){return Object.getPrototypeOf(e.prototype).constructor}(e.type),n=!0,i=[e];t;){var r=void 0;if(Ut(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=ls(e.inputs),o.declaredInputs=ls(e.declaredInputs),o.outputs=ls(e.outputs);var a=r.hostBindings;a&&fs(e,a);var s=r.viewQuery,u=r.contentQueries;if(s&&hs(e,s),u&&ds(e,u),Be(e.inputs,r.inputs),Be(e.declaredInputs,r.declaredInputs),Be(e.outputs,r.outputs),Ut(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=ri(r.hostAttrs,n=ri(n,r.hostAttrs))}}(i)}function ls(e){return e===mt?{}:e===yt?[]:e}function hs(e,t){var n=e.viewQuery;e.viewQuery=n?function(e,i){t(e,i),n(e,i)}:t}function ds(e,t){var n=e.contentQueries;e.contentQueries=n?function(e,i,r){t(e,i,r),n(e,i,r)}:t}function fs(e,t){var n=e.hostBindings;e.hostBindings=n?function(e,i){t(e,i),n(e,i)}:t}ss.THROW_IF_NOT_FOUND=Gi,ss.NULL=new Ya,ss.\u0275prov=$e({token:ss,providedIn:"any",factory:function(){return Zi(Xa)}}),ss.__NG_ELEMENT_ID__=-1;var ps=null;function vs(){if(!ps){var e=gt.Symbol;if(e&&e.iterator)ps=e.iterator;else for(var t=Object.getOwnPropertyNames(Map.prototype),n=0;n1&&void 0!==arguments[1]?arguments[1]:at.Default,n=mn();return null===n?Zi(e,t):bi(_n(),n,Ge(e),t)}function Ts(e,t,n){var i=mn();return _s(i,Pn(),t)&&ma(yn(),qn(),i,e,t,i[11],n,!1),Ts}function Ps(e,t,n,i,r){var o=r?"class":"style";Ha(e,n,t.inputs[o],o,i)}function As(e,t,n,i){var r=mn(),o=yn(),a=20+e,s=r[11],u=r[a]=po(s,t,vn.lFrame.currentNamespace),c=o.firstCreatePass?function(e,t,n,i,r,o,a){var s=t.consts,u=ra(t,e,2,r,dn(s,o));return ya(t,n,u,dn(s,a)),null!==u.attrs&&Wa(u,u.attrs,!1),null!==u.mergedAttrs&&Wa(u,u.mergedAttrs,!0),null!==t.queries&&t.queries.elementStart(t,u),u}(a,o,r,0,t,n,i):o.data[a];kn(c,!0);var l=c.mergedAttrs;null!==l&&ti(s,u,l);var h=c.classes;null!==h&&Do(s,u,h);var d=c.styles;null!==d&&Ro(s,u,d),64!=(64&c.flags)&&Eo(o,r,u,c),0===vn.lFrame.elementDepthCount&&Qr(u,r),vn.lFrame.elementDepthCount++,zt(c)&&(ha(o,r,c),la(o,c,r)),null!==i&&da(r,c)}function Ms(){var e=_n();xn()?Sn():kn(e=e.parent,!1);var t=e;vn.lFrame.elementDepthCount--;var n=yn();n.firstCreatePass&&(Yn(n,e),Bt(e)&&n.queries.elementEnd(e)),null!=t.classesWithoutHost&&function(e){return 0!=(16&e.flags)}(t)&&Ps(n,t,mn(),t.classesWithoutHost,!0),null!=t.stylesWithoutHost&&function(e){return 0!=(32&e.flags)}(t)&&Ps(n,t,mn(),t.stylesWithoutHost,!1)}function Is(e,t,n,i){As(e,t,n,i),Ms()}function Rs(e,t,n){var i=mn(),r=yn(),o=e+20,a=r.firstCreatePass?function(e,t,n,i,r){var o=t.consts,a=dn(o,i),s=ra(t,e,8,"ng-container",a);return null!==a&&Wa(s,a,!0),ya(t,n,s,dn(o,r)),null!==t.queries&&t.queries.elementStart(t,s),s}(o,r,i,t,n):r.data[o];kn(a,!0);var s=i[o]=i[11].createComment("");Eo(r,i,s,a),Qr(s,i),zt(a)&&(ha(r,i,a),la(r,a,i)),null!=n&&da(i,a)}function Ds(){var e=_n(),t=yn();xn()?Sn():kn(e=e.parent,!1),t.firstCreatePass&&(Yn(t,e),Bt(e)&&t.queries.elementEnd(e))}function Ns(e,t,n){Rs(e,t,n),Ds()}function Ls(){return mn()}function js(e){return!!e&&"function"==typeof e.then}function Fs(e){return!!e&&"function"==typeof e.subscribe}var Bs=Fs;function Vs(e,t,n,i){var r=mn(),o=yn(),a=_n();return Us(o,r,r[11],a,e,t,!!n,i),Vs}function zs(e,t){var n=_n(),i=mn(),r=yn();return Us(r,i,za(Rn(r.data),n,i),n,e,t,!1),zs}function Us(e,t,n,i,r,o,a,s){var u=zt(i),c=e.firstCreatePass&&Va(e),l=t[8],h=Ba(t),d=!0;if(3&i.type||s){var f=an(i,t),p=s?s(f):f,v=h.length,g=s?function(e){return s(rn(e[i.index]))}:i.index;if(tn(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,d=!1;else{o=Gs(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=Gs(i,t,l,o,!0),p.addEventListener(r,o,a),h.push(o),c&&c.push(r,g,v,a)}else o=Gs(i,t,l,o,!1);var b,_=i.outputs;if(d&&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(vn.lFrame.contextLView=function(e,t){for(;e>0;)t=t[15],e--;return t}(e,vn.lFrame.contextLView))[8]}(e)}function qs(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=mn(),r=yn(),o=ra(r,20+e,16,null,n||null);null===o.projection&&(o.projection=t),Sn(),64!=(64&o.flags)&&function(e,t,n){Io(t[11],0,t,n,bo(e,n,t),So(n.parent||t[6],n,t))}(r,i,o)}function Ks(e,t,n){return $s(e,"",t,"",n),Ks}function $s(e,t,n,i,r){var o=mn(),a=xs(o,t,n,i);return a!==Xo&&ma(yn(),qn(),o,e,a,o[11],r,!1),$s}function Qs(e,t,n,i,r){for(var o=e[n+1],a=null===t,s=i?Qo(o):Jo(o),u=!1;0!==s&&(!1===u||a);){var c=e[s+1];Zs(e[s],t)&&(u=!0,e[s+1]=i?ta(c):Zo(c)),s=i?Qo(c):Jo(c)}u&&(e[n+1]=i?Zo(o):ta(o))}function Zs(e,t){return null===e||null==t||(Array.isArray(e)?e[1]:e)===t||!(!Array.isArray(e)||"string"!=typeof t)&&Ui(e,t)>=0}var Js={textEnd:0,key:0,keyEnd:0,value:0,valueEnd:0};function eu(e){return e.substring(Js.key,Js.keyEnd)}function tu(e){return e.substring(Js.value,Js.valueEnd)}function nu(e,t){var n=Js.textEnd;return n===t?-1:(t=Js.keyEnd=function(e,t,n){for(;t32;)t++;return t}(e,Js.key=t,n),ou(e,t,n))}function iu(e,t){var n=Js.textEnd,i=Js.key=ou(e,t,n);return n===i?-1:(i=Js.keyEnd=function(e,t,n){for(var i;t=65&&(-33&i)<=90||i>=48&&i<=57);)t++;return t}(e,i,n),i=au(e,i,n),i=Js.value=ou(e,i,n),i=Js.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),au(e,i,n))}function ru(e){Js.key=0,Js.keyEnd=0,Js.value=0,Js.valueEnd=0,Js.textEnd=e.length}function ou(e,t,n){for(;t=0;n=iu(t,n))_u(e,eu(t),tu(t))}function du(e){vu(Vi,fu,e,!0)}function fu(e,t){for(var n=function(e){return ru(e),nu(e,ou(e,0,Js.textEnd))}(t);n>=0;n=nu(t,n))Vi(e,eu(t),!0)}function pu(e,t,n,i){var r=mn(),o=yn(),a=An(2);o.firstUpdatePass&&mu(o,e,a,i),t!==Xo&&_s(r,a,t)&&wu(o,o.data[Gn()],r,r[11],e,r[a+1]=function(e,t){return null==e||("string"==typeof t?e+=t:"object"==typeof e&&(e=Ve(br(e)))),e}(t,n),i,a)}function vu(e,t,n,i){var r=yn(),o=An(2);r.firstUpdatePass&&mu(r,null,o,i);var a=mn();if(n!==Xo&&_s(a,o,n)){var s=r.data[Gn()];if(Su(s,i)&&!gu(r,o)){var u=i?s.classesWithoutHost:s.stylesWithoutHost;null!==u&&(n=ze(u,n||"")),Ps(r,s,a,n,i)}else!function(e,t,n,i,r,o,a,s){r===Xo&&(r=yt);for(var u=0,c=0,l=0=e.expandoStartIndex}function mu(e,t,n,i){var r=e.data;if(null===r[n+1]){var o=r[Gn()],a=gu(e,n);Su(o,i)&&null===t&&!a&&(t=!1),t=function(e,t,n,i){var r=Rn(e),o=i?t.residualClasses:t.residualStyles;if(null===r)0===(i?t.classBindings:t.styleBindings)&&(n=bu(n=yu(null,e,t,n,i),t.attrs,i),o=null);else{var a=t.directiveStylingLast;if(-1===a||e[a]!==r)if(n=yu(r,e,t,n,i),null===o){var s=function(e,t,n){var i=n?t.classBindings:t.styleBindings;if(0!==Jo(i))return e[Qo(i)]}(e,t,i);void 0!==s&&Array.isArray(s)&&function(e,t,n,i){e[Qo(n?t.classBindings:t.styleBindings)]=i}(e,t,i,s=bu(s=yu(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 d=Qo(e[s+1]);e[i+1]=$o(d,s),0!==d&&(e[d+1]=ea(e[d+1],i)),e[s+1]=function(e,t){return 131071&e|t<<17}(e[s+1],i)}else e[i+1]=$o(s,0),0!==s&&(e[s+1]=ea(e[s+1],i)),s=i;else e[i+1]=$o(u,0),0===s?s=i:e[u+1]=ea(e[u+1],i),u=i;l&&(e[i+1]=Zo(e[i+1])),Qs(e,c,i,!0),Qs(e,c,i,!1),function(e,t,n,i,r){var o=r?e.residualClasses:e.residualStyles;null!=o&&"string"==typeof t&&Ui(o,t)>=0&&(n[i+1]=ta(n[i+1]))}(t,c,e,i,o),a=$o(s,u),o?t.classBindings=a:t.styleBindings=a}(r,o,t,n,a,i)}}function yu(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,d=n[r+1];d===Xo&&(d=h?yt:void 0);var f=h?zi(d,i):l===i?d:void 0;if(c&&!xu(f)&&(f=zi(u,i)),xu(f)&&(a=f,s))return a;var p=e[r+1];r=s?Qo(p):Jo(p)}if(null!==t){var v=o?t.residualClasses:t.residualStyles;null!=v&&(a=zi(v,i))}return a}function xu(e){return void 0!==e}function Su(e,t){return 0!=(e.flags&(t?16:32))}function Cu(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=mn(),i=yn(),r=e+20,o=i.firstCreatePass?ra(i,r,1,t,null):i.data[r],a=n[r]=function(e,t){return tn(e)?e.createText(t):e.createTextNode(t)}(n[11],t);Eo(i,n,a,o),kn(o,!1)}function Eu(e){return Ou("",e,""),Eu}function Ou(e,t,n){var i=mn(),r=xs(i,e,t,n);return r!==Xo&&Ga(i,Gn(),r),Ou}function Tu(e,t,n,i,r){var o=mn(),a=function(e,t,n,i,r,o){var a=ws(e,Tn(),n,r);return An(2),a?t+Xe(n)+i+Xe(r)+o:Xo}(o,e,t,n,i,r);return a!==Xo&&Ga(o,Gn(),a),Tu}function Pu(e,t,n){vu(Vi,fu,xs(mn(),e,t,n),!0)}function Au(e,t,n){var i=mn();return _s(i,Pn(),t)&&ma(yn(),qn(),i,e,t,i[11],n,!0),Au}function Mu(e,t,n){var i=mn();if(_s(i,Pn(),t)){var r=yn(),o=qn();ma(r,o,i,e,t,za(Rn(r.data),o,i),n,!0)}return Mu}var Iu=void 0,Ru=["en",[["a","p"],["AM","PM"],Iu],[["AM","PM"],Iu,Iu],[["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"]],Iu,[["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"]],Iu,[["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}",Iu,"{1} 'at' {0}",Iu],[".",",",";","%","+","-","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}],Du={};function Nu(e){var t=function(e){return e.toLowerCase().replace(/_/g,"-")}(e),n=Lu(t);if(n)return n;var i=t.split("-")[0];if(n=Lu(i))return n;if("en"===i)return Ru;throw new Error('Missing locale data for the locale "'.concat(e,'".'))}function Lu(e){return e in Du||(Du[e]=gt.ng&>.ng.common&>.ng.common.locales&>.ng.common.locales[e]),Du[e]}var ju=((ju=ju||{})[ju.LocaleId=0]="LocaleId",ju[ju.DayPeriodsFormat=1]="DayPeriodsFormat",ju[ju.DayPeriodsStandalone=2]="DayPeriodsStandalone",ju[ju.DaysFormat=3]="DaysFormat",ju[ju.DaysStandalone=4]="DaysStandalone",ju[ju.MonthsFormat=5]="MonthsFormat",ju[ju.MonthsStandalone=6]="MonthsStandalone",ju[ju.Eras=7]="Eras",ju[ju.FirstDayOfWeek=8]="FirstDayOfWeek",ju[ju.WeekendRange=9]="WeekendRange",ju[ju.DateFormat=10]="DateFormat",ju[ju.TimeFormat=11]="TimeFormat",ju[ju.DateTimeFormat=12]="DateTimeFormat",ju[ju.NumberSymbols=13]="NumberSymbols",ju[ju.NumberFormats=14]="NumberFormats",ju[ju.CurrencyCode=15]="CurrencyCode",ju[ju.CurrencySymbol=16]="CurrencySymbol",ju[ju.CurrencyName=17]="CurrencyName",ju[ju.Currencies=18]="Currencies",ju[ju.Directionality=19]="Directionality",ju[ju.PluralCase=20]="PluralCase",ju[ju.ExtraData=21]="ExtraData",ju),Fu="en-US";function Bu(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 Vu(e,t,n,i,r){if(e=Ge(e),Array.isArray(e))for(var o=0;o>20;if(os(e)||!e.multi){var p=new ei(c,r,Os),v=Hu(u,t,r?h:h+f,d);-1===v?(gi(di(l,s),a,u),zu(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=Hu(u,t,h+f,d),m=Hu(u,t,h,h+f),y=g>=0&&n[g],b=m>=0&&n[m];if(r&&!b||!r&&!y){gi(di(l,s),a,u);var _=function(e,t,n,i,r){var o=new ei(e,n,Os);return o.multi=[],o.index=t,o.componentProviders=0,Uu(o,r,i&&!n),o}(r?Wu:Gu,n.length,r,i,c);!r&&b&&(n[m].providerFactory=_),zu(a,e,t.length,0),t.push(u),l.directiveStart++,l.directiveEnd++,r&&(l.providerIndexes+=1048576),n.push(_),s.push(_)}else zu(a,e,g>-1?g:m,Uu(n[r?m:g],c,!r&&i));!r&&i&&b&&n[m].componentProviders++}}}function zu(e,t,n,i){var r=os(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 Uu(e,t,n){return n&&e.componentProviders++,e.multi.push(t)-1}function Hu(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=yn();if(i.firstCreatePass){var r=Ut(e);Vu(n,i.data,i.blueprint,r,!0),Vu(t,i.data,i.blueprint,r,!1)}}(n,i?i(e):e,t)}}}var Yu=function e(){m(this,e)},Ku=function e(){m(this,e)};function $u(){}function Qu(e,t){return new Ju(an(e,t))}Ku.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(Ve(e),". Did you add it to @NgModule.entryComponents?"));return t.ngComponent=e,t}(e)}}]),e}());var Zu=function(){return Qu(_n(),mn())},Ju=function(){var e=function e(t){m(this,e),this.nativeElement=t};return e.__NG_ELEMENT_ID__=Zu,e}();function ec(e){return e instanceof Ju?e.nativeElement:e}var tc=function e(){m(this,e)},nc=function(){var e=function e(){m(this,e)};return e.__NG_ELEMENT_ID__=function(){return ic()},e}(),ic=function(){var e=mn(),t=cn(_n().index,e);return function(e){return e[11]}(jt(t)?t:e)},rc=function(){var e=function e(){m(this,e)};return e.\u0275prov=$e({token:e,providedIn:"root",factory:function(){return null}}),e}(),oc=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(".")},ac=new oc("12.2.5"),sc=function(){function e(){m(this,e)}return b(e,[{key:"supports",value:function(e){return ms(e)}},{key:"create",value:function(e){return new cc(e)}}]),e}(),uc=function(e,t){return t},cc=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||uc}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(rn(o)),Ft(o))for(var a=10;a-1&&(go(e,n),Fi(t,n))}this._attachedToViewContainer=!1}mo(this._lView[1],this._lView)}},{key:"onDestroy",value:function(e){va(this._lView[1],this._lView,null,e)}},{key:"markForCheck",value:function(){Da(this._cdRefInjectingView||this._lView)}},{key:"detach",value:function(){this._lView[2]&=-129}},{key:"reattach",value:function(){this._lView[2]|=128}},{key:"detectChanges",value:function(){Na(this._lView[1],this._lView,this.context)}},{key:"checkNoChanges",value:function(){!function(e,t,n){En(!0);try{Na(e,t,n)}finally{En(!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){Mo(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}(),xc=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(){La(this._view)}},{key:"checkNoChanges",value:function(){!function(e){En(!0);try{La(e)}finally{En(!1)}}(this._view)}},{key:"context",get:function(){return null}}]),n}(kc),Sc=function(e){return function(e,t,n){if(Vt(e)&&!n){var i=cn(e.index,t);return new kc(i,i)}return 47&e.type?new kc(t[16],t):null}(_n(),mn(),16==(16&e))},Cc=function(){var e=function e(){m(this,e)};return e.__NG_ELEMENT_ID__=Sc,e}(),Ec=[new pc],Oc=new yc([new sc]),Tc=new _c(Ec),Pc=function(){return Ic(_n(),mn())},Ac=function(){var e=function e(){m(this,e)};return e.__NG_ELEMENT_ID__=Pc,e}(),Mc=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=ia(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)),aa(t,n,e),new kc(n)}}]),n}(Ac);function Ic(e,t){return 4&e.type?new Mc(t,e,Qu(e,t)):null}var Rc=function e(){m(this,e)},Dc=function(){return Bc(_n(),mn())},Nc=function(){var e=function e(){m(this,e)};return e.__NG_ELEMENT_ID__=Dc,e}(),Lc=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 Qu(this._hostTNode,this._hostLView)}},{key:"injector",get:function(){return new Oi(this._hostTNode,this._hostLView)}},{key:"parentInjector",get:function(){var e=vi(this._hostTNode,this._hostLView);if(ai(e)){var t=ui(e,this._hostLView),n=si(e);return new Oi(t[1].data[n+8],t)}return new Oi(null,this._hostLView)}},{key:"clear",value:function(){for(;this.length>0;)this.remove(this.length-1)}},{key:"get",value:function(e){var t=jc(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(Rc,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 Ft(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}(Nc);function jc(e){return e[8]}function Fc(e){return e[8]||(e[8]=[])}function Bc(e,t){var n,i=t[e.index];if(Ft(i))n=i;else{var r;if(8&e.type)r=rn(i);else{var o=t[11];r=o.createComment("");var a=an(e,t);_o(o,xo(o,a),r,function(e,t){return tn(e)?e.nextSibling(t):t.nextSibling}(o,a),!1)}t[e.index]=n=Pa(i,t,r,e),Ra(t,n)}return new Lc(n,e,t)}var Vc={},zc=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=Nt(e);return new Gc(t,this.ngModule)}}]),n}(Ku);function Uc(e){var t=[];for(var n in e)e.hasOwnProperty(n)&&t.push({propName:e[n],templateName:n});return t}var Hc=new Ri("SCHEDULER_TOKEN",{providedIn:"root",factory:function(){return no}}),Gc=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(qo).join(",")}(e.selectors),r.ngContentSelectors=e.ngContentSelectors?e.ngContentSelectors:[],r.isBoundToModule=!!i,r}return b(n,[{key:"inputs",get:function(){return Uc(this.componentDef.inputs)}},{key:"outputs",get:function(){return Uc(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,Vc,r);return o!==Vc||i===Vc?o:t.get(n,i,r)}}}(e,i.injector):e,s=a.get(tc,nn),u=a.get(rc,null),c=s.createRenderer(null,this.componentDef),l=this.componentDef.selectors[0][0]||"div",h=n?function(e,t,n){if(tn(e))return e.selectRootElement(t,n===ht.ShadowDom);var i="string"==typeof t?e.querySelector(t):t;return i.textContent="",i}(c,n,this.componentDef.encapsulation):po(s.createRenderer(null,this.componentDef),l,function(e){var t=e.toLowerCase();return"svg"===t?Jt:"math"===t?"http://www.w3.org/1998/MathML/":null}(l)),d=this.componentDef.onPush?576:528,f={components:[],scheduler:no,clean:Fa,playerHandler:null,flags:0},p=pa(0,null,null,1,0,null,null,null,null,null),v=ia(null,p,f,d,null,null,s,c,u,a);Fn(v);try{var g=function(e,t,n,i,r,o){var a=n[1];n[20]=e;var s=ra(a,20,2,"#host",null),u=s.mergedAttrs=t.hostAttrs;null!==u&&(Wa(s,u,!0),null!==e&&(ti(r,e,u),null!==s.classes&&Do(r,e,s.classes),null!==s.styles&&Ro(r,e,s.styles)));var c=i.createRenderer(e,t),l=ia(n,fa(t),null,t.onPush?64:16,n[20],s,i,c,null,null);return a.firstCreatePass&&(gi(di(s,n),a,t.type),wa(a,s),xa(s,n.length,1)),Ra(n,l),n[20]=l}(h,this.componentDef,v,s,c);if(h)if(n)ti(c,h,["ng-version",ac.full]);else{var m=function(e){for(var t=[],n=[],i=1,r=2;i0&&Do(c,h,b.join(" "))}if(o=sn(p,20),void 0!==t)for(var _=o.projection=[],w=0;w1&&void 0!==arguments[1]?arguments[1]:ss.THROW_IF_NOT_FOUND,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:at.Default;return e===ss||e===Rc||e===Xa?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}(Rc),Yc=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!==Lt(e)&&function(e){var t=new Set;!function e(n){var i=Lt(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(Ve(t)," vs ").concat(Ve(t.name)))}(r,qc.get(r),n),qc.set(r,n));var o,a=_(oo(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 Xc(this.moduleType,e)}}]),n}(function(){return function e(){m(this,e)}}());function Kc(e,t,n){var i=On()+e,r=mn();return r[i]===Xo?bs(r,i,n?t.call(n):t()):function(e,t){return e[t]}(r,i)}function $c(e,t,n,i){return Zc(mn(),On(),e,t,n,i)}function Qc(e,t){var n=e[t];return n===Xo?void 0:n}function Zc(e,t,n,i,r,o){var a=t+n;return _s(e,a,r)?bs(e,a+1,o?i.call(o,r):i(r)):Qc(e,a+1)}function Jc(e,t){var n,i=yn(),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 qe("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=Gt(n.type)),a=st(Os);try{var s=li(!1),u=o();return li(s),function(e,t,n,i){n>=e.data.length&&(e.data[n]=null,e.blueprint[n]=null),t[n]=i}(i,mn(),r,u),u}finally{st(a)}}function el(e,t,n){var i=e+20,r=mn(),o=un(r,i);return il(r,nl(r,i)?Zc(r,On(),t,o.transform,n,o):o.transform(n))}function tl(e,t,n,i){var r=e+20,o=mn(),a=un(o,r);return il(o,nl(o,r)?function(e,t,n,i,r,o,a){var s=t+n;return ws(e,s,r,o)?bs(e,s+2,a?i.call(a,r,o):i(r,o)):Qc(e,s+2)}(o,On(),t,a.transform,n,i,a):a.transform(n,i))}function nl(e,t){return e[1].data[t].pure}function il(e,t){return gs.isWrapped(t)&&(t=gs.unwrap(t),e[Tn()]=Xo),t}function rl(e){return function(t){setTimeout(e,void 0,t)}}var ol=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=rl(c),u&&(u=rl(u)),l&&(l=rl(l)));var d=e(p(i.prototype),"subscribe",this).call(this,{next:u,error:c,complete:l});return t instanceof q&&t.add(d),d}}]),i}(ae);function al(){return this._results[vs()]()}var sl=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=vs(),i=e.prototype;i[n]||(i[n]=al)}return b(e,[{key:"changes",get:function(){return this._changes||(this._changes=new ol)}},{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=Ni(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},hl=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)(Zi(Xl))},e.\u0275prov=$e({token:e,factory:e.\u0275fac}),e}(),nh=function(){var e=function(){function e(){m(this,e),this._applications=new Map,ih.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 ih.findTestabilityInTree(this,e,t)}}]),e}();return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=$e({token:e,factory:e.\u0275fac}),e}(),ih=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}()),rh=!0,oh=!1;function ah(){return oh=!0,rh}var sh=new Ri("AllowMultipleToken");function uh(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],i="Platform: ".concat(t),r=new Ri(i);return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],o=ch();if(!o||o.injector.get(sh,!1))if(e)e(n.concat(t).concat({provide:r,useValue:!0}));else{var a=n.concat(t).concat({provide:r,useValue:!0},{provide:Ka,useValue:"platform"});!function(e){if(Jl&&!Jl.destroyed&&!Jl.injector.get(sh,!1))throw new Error("There can be only one platform. Destroy the previous one to create a new one.");Jl=e.get(lh);var t=e.get(Al,null);t&&t.forEach(function(e){return e()})}(ss.create({providers:a,name:i}))}return function(e){var t=ch();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 ch(){return Jl&&!Jl.destroyed?Jl:null}var lh=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 eh:("zone.js"===e?void 0:e)||new Xl({enableLongStackTrace:ah(),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:Xl,useValue:i}];return i.run(function(){var o=ss.create({providers:r,parent:n.injector,name:e.moduleType.name}),a=e.create(o),s=a.injector.get(to,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(){fh(n._modules,a),e.unsubscribe()})}),function(e,i,r){try{var o=function(){var e=a.injector.get(El);return e.runInitializers(),e.donePromise.then(function(){return Bu(a.injector.get(Dl,Fu)||Fu),n._moduleDoBootstrap(a),a})}();return js(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}}(s,i)})}},{key:"bootstrapModule",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i=hh({},n);return function(e,t,n){var i=new Yc(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(dh);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(Ve(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)(Zi(ss))},e.\u0275prov=$e({token:e,factory:e.\u0275fac}),e}();function hh(e,t){return Array.isArray(t)?t.reduce(hh,e):Object.assign(Object.assign({},e),t)}var dh=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 te(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 te(function(e){var t;a._zone.runOutsideAngular(function(){t=a._zone.onStable.subscribe(function(){Xl.assertNotInAngularZone(),ql(function(){!a._stable&&!a._zone.hasPendingMacrotasks&&!a._zone.hasPendingMicrotasks&&(a._stable=!0,e.next(!0))})})});var n=a._zone.onUnstable.subscribe(function(){Xl.assertInAngularZone(),a._stable&&(a._stable=!1,a._zone.runOutsideAngular(function(){e.next(!1)}))});return function(){t.unsubscribe(),n.unsubscribe()}});this.isStable=Oe(s,u.pipe(je()))}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 Yu?e:this._componentFactoryResolver.resolveComponentFactory(e),this.componentTypes.push(n.componentType);var r=function(e){return e.isBoundToModule}(n)?void 0:this._injector.get(Rc),o=n.create(ss.NULL,[],t||n.selector,r),a=o.location.nativeElement,s=o.injector.get(th,null),u=s&&o.injector.get(nh);return s&&u&&u.registerApplication(a,s),o.onDestroy(function(){i.detachView(o.hostView),fh(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;fh(this._views,t),t.detachFromAppRef()}},{key:"_loadComponent",value:function(e){this.attachView(e.hostView),this.tick(),this.components.push(e),this._injector.get(Il,[]).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)(Zi(Xl),Zi(ss),Zi(to),Zi(Ku),Zi(El))},e.\u0275prov=$e({token:e,factory:e.\u0275fac}),e}();function fh(e,t){var n=e.indexOf(t);n>-1&&e.splice(n,1)}var ph=uh(null,"core",[{provide:Ml,useValue:"unknown"},{provide:lh,deps:[ss]},{provide:nh,deps:[]},{provide:Rl,deps:[]}]),vh=[{provide:dh,useClass:dh,deps:[Xl,ss,to,Ku,El]},{provide:Hc,deps:[Xl],useFactory:function(e){var t=[];return e.onStable.subscribe(function(){for(;t.length;)t.pop()()}),function(e){t.push(e)}}},{provide:El,useClass:El,deps:[[new sr,Cl]]},{provide:Hl,useClass:Hl,deps:[]},Tl,{provide:yc,useFactory:function(){return Oc},deps:[]},{provide:_c,useFactory:function(){return Tc},deps:[]},{provide:Dl,useFactory:function(e){return Bu(e=e||"undefined"!=typeof $localize&&$localize.locale||Fu),e},deps:[[new ar(Dl),new sr,new ur]]},{provide:Nl,useValue:"USD"}],gh=function(){var e=function e(t){m(this,e)};return e.\u0275fac=function(t){return new(t||e)(Zi(dh))},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({providers:vh}),e}(),mh=null;function yh(){return mh}var bh=new Ri("DocumentToken"),_h=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=$e({factory:wh,token:e,providedIn:"platform"}),e}();function wh(){return Zi(kh)}var kh=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 yh().getBaseHref(this._doc)}},{key:"onPopState",value:function(e){var t=yh().getGlobalEventTarget(this._doc,"window");return t.addEventListener("popstate",e,!1),function(){return t.removeEventListener("popstate",e)}}},{key:"onHashChange",value:function(e){var t=yh().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){xh()?this._history.pushState(e,t,n):this.location.hash=n}},{key:"replaceState",value:function(e,t,n){xh()?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}(_h);return e.\u0275fac=function(t){return new(t||e)(Zi(bh))},e.\u0275prov=$e({factory:Sh,token:e,providedIn:"platform"}),e}();function xh(){return!!window.history.pushState}function Sh(){return new kh(Zi(bh))}function Ch(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 Eh(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 Oh(e){return e&&"?"!==e[0]?"?"+e:e}var Th=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=$e({factory:Ph,token:e,providedIn:"root"}),e}();function Ph(e){var t=Zi(bh).location;return new Mh(Zi(_h),t&&t.origin||"")}var Ah=new Ri("appBaseHref"),Mh=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 Ch(this._baseHref,e)}},{key:"path",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this._platformLocation.pathname+Oh(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+Oh(i));this._platformLocation.pushState(e,t,r)}},{key:"replaceState",value:function(e,t,n,i){var r=this.prepareExternalUrl(n+Oh(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}(Th);return e.\u0275fac=function(t){return new(t||e)(Zi(_h),Zi(Ah,8))},e.\u0275prov=$e({token:e,factory:e.\u0275fac}),e}(),Ih=function(){var e=function(){function e(t,n){var i=this;m(this,e),this._subject=new ol,this._urlChangeListeners=[],this._platformStrategy=t;var r=this._platformStrategy.getBaseHref();this._platformLocation=n,this._baseHref=Eh(Dh(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+Oh(t))}},{key:"normalize",value:function(t){return e.stripTrailingSlash(function(e,t){return e&&t.startsWith(e)?t.substring(e.length):t}(this._baseHref,Dh(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+Oh(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+Oh(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)(Zi(Th),Zi(_h))},e.normalizeQueryParams=Oh,e.joinWithSlash=Ch,e.stripTrailingSlash=Eh,e.\u0275prov=$e({factory:Rh,token:e,providedIn:"root"}),e}();function Rh(){return new Ih(Zi(Th),Zi(_h))}function Dh(e){return e.replace(/\/index.html$/,"")}var Nh=((Nh=Nh||{})[Nh.Decimal=0]="Decimal",Nh[Nh.Percent=1]="Percent",Nh[Nh.Currency=2]="Currency",Nh[Nh.Scientific=3]="Scientific",Nh),Lh=((Lh=Lh||{})[Lh.Zero=0]="Zero",Lh[Lh.One=1]="One",Lh[Lh.Two=2]="Two",Lh[Lh.Few=3]="Few",Lh[Lh.Many=4]="Many",Lh[Lh.Other=5]="Other",Lh),jh=((jh=jh||{})[jh.Decimal=0]="Decimal",jh[jh.Group=1]="Group",jh[jh.List=2]="List",jh[jh.PercentSign=3]="PercentSign",jh[jh.PlusSign=4]="PlusSign",jh[jh.MinusSign=5]="MinusSign",jh[jh.Exponential=6]="Exponential",jh[jh.SuperscriptingExponent=7]="SuperscriptingExponent",jh[jh.PerMille=8]="PerMille",jh[jh.Infinity=9]="Infinity",jh[jh.NaN=10]="NaN",jh[jh.TimeSeparator=11]="TimeSeparator",jh[jh.CurrencyDecimal=12]="CurrencyDecimal",jh[jh.CurrencyGroup=13]="CurrencyGroup",jh);function Fh(e,t){var n=Nu(e),i=n[ju.NumberSymbols][t];if(void 0===i){if(t===jh.CurrencyDecimal)return n[ju.NumberSymbols][jh.Decimal];if(t===jh.CurrencyGroup)return n[ju.NumberSymbols][jh.Group]}return i}var Bh=/^(\d+)?\.((\d+)(-(\d+))?)?$/;function Vh(e){var t=parseInt(e);if(isNaN(t))throw new Error("Invalid integer literal when parsing "+e);return t}var zh=function e(){m(this,e)},Uh=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 Nu(e)[ju.PluralCase]}(t||this.locale)(e)){case Lh.Zero:return"zero";case Lh.One:return"one";case Lh.Two:return"two";case Lh.Few:return"few";case Lh.Many:return"many";default:return"other"}}}]),n}(zh);return e.\u0275fac=function(t){return new(t||e)(Zi(Dl))},e.\u0275prov=$e({token:e,factory:e.\u0275fac}),e}();function Hh(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 Gh=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&&(ms(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(Ve(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)(Os(yc),Os(_c),Os(Ju),Os(nc))},e.\u0275dir=Rt({type:e,selectors:[["","ngClass",""]],inputs:{klass:["class","klass"],ngClass:"ngClass"}}),e}(),Wh=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}(),qh=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 Wh(null,t._ngForOf,-1,-1),null===r?void 0:r),a=new Xh(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 Xh(e,s);n.push(u)}});for(var i=0;i6&&void 0!==arguments[6]&&arguments[6],s="",u=!1;if(isFinite(e)){var c=function(e){var t,n,i,r,o,a=Math.abs(e)+"",s=0;for((n=a.indexOf("."))>-1&&(a=a.replace(".","")),(i=a.search(/e/i))>0?(n<0&&(n=i),n+=+a.slice(i+1),a=a.substring(0,i)):n<0&&(n=a.length),i=0;"0"===a.charAt(i);i++);if(i===(o=a.length))t=[0],n=1;else{for(o--;"0"===a.charAt(o);)o--;for(n-=i,t=[],r=0;i<=o;i++,r++)t[r]=Number(a.charAt(i))}return n>22&&(t=t.splice(0,21),s=n-1,n=1),{digits:t,exponent:s,integerLen:n}}(e);a&&(c=function(e){if(0===e.digits[0])return e;var t=e.digits.length-e.integerLen;return e.exponent?e.exponent+=2:(0===t?e.digits.push(0,0):1===t&&e.digits.push(0),e.integerLen+=2),e}(c));var l=t.minInt,h=t.minFrac,d=t.maxFrac;if(o){var f=o.match(Bh);if(null===f)throw new Error("".concat(o," is not a valid digit info"));var p=f[1],v=f[3],g=f[5];null!=p&&(l=Vh(p)),null!=v&&(h=Vh(v)),null!=g?d=Vh(g):null!=v&&h>d&&(d=h)}!function(e,t,n){if(t>n)throw new Error("The minimum number of digits after fraction (".concat(t,") is higher than the maximum (").concat(n,")."));var i=e.digits,r=i.length-e.integerLen,o=Math.min(Math.max(t,r),n),a=o+e.integerLen,s=i[a];if(a>0){i.splice(Math.max(e.integerLen,a));for(var u=a;u=5)if(a-1<0){for(var l=0;l>a;l--)i.unshift(0),e.integerLen++;i.unshift(1),e.integerLen++}else i[a-1]++;for(;r=d?i.pop():h=!1),t>=10?1:0},0);f&&(i.unshift(f),e.integerLen++)}(c,h,d);var m=c.digits,y=c.integerLen,b=c.exponent,_=[];for(u=m.every(function(e){return!e});y0?_=m.splice(y,m.length):(_=m,m=[0]);var w=[];for(m.length>=t.lgSize&&w.unshift(m.splice(-t.lgSize,m.length).join(""));m.length>t.gSize;)w.unshift(m.splice(-t.gSize,m.length).join(""));m.length&&w.unshift(m.join("")),s=w.join(Fh(n,i)),_.length&&(s+=Fh(n,r)+_.join("")),b&&(s+=Fh(n,jh.Exponential)+"+"+b)}else s=Fh(n,jh.Infinity);return s=e<0&&!u?t.negPre+s+t.negSuf:t.posPre+s+t.posSuf}(e,function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"-",n={minInt:1,minFrac:0,maxFrac:0,posPre:"",posSuf:"",negPre:"",negSuf:"",gSize:0,lgSize:0},i=e.split(";"),r=i[0],o=i[1],a=-1!==r.indexOf(".")?r.split("."):[r.substring(0,r.lastIndexOf("0")+1),r.substring(r.lastIndexOf("0")+1)],s=a[0],u=a[1]||"";n.posPre=s.substr(0,s.indexOf("#"));for(var c=0;c1&&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},gt.getAllAngularTestabilities=function(){return e.getAllTestabilities()},gt.getAllAngularRootElements=function(){return e.getAllRootElements()},gt.frameworkStabilizers||(gt.frameworkStabilizers=[]),gt.frameworkStabilizers.push(function(e){var t=gt.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?yh().isShadowRoot(t)?this.findTestabilityInTree(e,t.host,!0):this.findTestabilityInTree(e,t.parentElement,!0):null}}],[{key:"init",value:function(){!function(e){ih=e}(new e)}}]),e}(),bd=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=$e({token:e,factory:e.\u0275fac}),e}(),_d=new Ri("EventManagerPlugins"),wd=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&&jd.hasOwnProperty(t)&&(t=jd[t]))}return Ld[t]||t}(e);return" "===(n=n.toLowerCase())?n="space":"."===n&&(n="dot"),Nd.forEach(function(i){i!=n&&Fd[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}(kd);return e.\u0275fac=function(t){return new(t||e)(Zi(bh))},e.\u0275prov=$e({token:e,factory:e.\u0275fac}),e}(),Vd=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=$e({factory:function(){return Zi(zd)},token:e,providedIn:"root"}),e}(),zd=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 Wr.NONE:return t;case Wr.HTML:return _r(t,"HTML")?br(t):Hr(this._doc,String(t)).toString();case Wr.STYLE:return _r(t,"Style")?br(t):t;case Wr.SCRIPT:if(_r(t,"Script"))return br(t);throw new Error("unsafe value used in a script context");case Wr.URL:return wr(t),_r(t,"URL")?br(t):Er(String(t));case Wr.RESOURCE_URL:if(_r(t,"ResourceURL"))return br(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 pr(e)}(e)}},{key:"bypassSecurityTrustStyle",value:function(e){return function(e){return new vr(e)}(e)}},{key:"bypassSecurityTrustScript",value:function(e){return function(e){return new gr(e)}(e)}},{key:"bypassSecurityTrustUrl",value:function(e){return function(e){return new mr(e)}(e)}},{key:"bypassSecurityTrustResourceUrl",value:function(e){return function(e){return new yr(e)}(e)}}]),n}(Vd);return e.\u0275fac=function(t){return new(t||e)(Zi(bh))},e.\u0275prov=$e({factory:function(){return function(e){return new zd(e.get(bh))}(Zi(Xa))},token:e,providedIn:"root"}),e}(),Ud=uh(ph,"browser",[{provide:Ml,useValue:ld},{provide:Al,useValue:function(){pd.makeCurrent(),yd.init()},multi:!0},{provide:bh,useFactory:function(){return function(e){Zt=e}(document),document},deps:[]}]),Hd=[[],{provide:Ka,useValue:"root"},{provide:to,useFactory:function(){return new to},deps:[]},{provide:_d,useClass:Dd,multi:!0,deps:[bh,Xl,Ml]},{provide:_d,useClass:Bd,multi:!0,deps:[bh]},[],{provide:Ad,useClass:Ad,deps:[wd,Sd,Ol]},{provide:tc,useExisting:Ad},{provide:xd,useExisting:Sd},{provide:Sd,useClass:Sd,deps:[bh]},{provide:th,useClass:th,deps:[Xl]},{provide:wd,useClass:wd,deps:[_d,Xl]},{provide:fd,useClass:bd,deps:[]},[]],Gd=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:Ol,useValue:t.appId},{provide:gd,useExisting:Ol},md]}}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Zi(e,12))},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({providers:Hd,imports:[cd,gh]}),e}();function Wd(e){return null!=e&&"false"!="".concat(e)}function qd(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 Xd(e){return Array.isArray(e)?e:[e]}function Yd(e){return null==e?"":"string"==typeof e?e:"".concat(e,"px")}function Kd(e){return e instanceof Ju?e.nativeElement:e}function $d(){for(var e=arguments.length,t=new Array(e),n=0;n1?Array.prototype.slice.call(arguments):e)},i,n)})}function Zd(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}(q)),ef=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}(),tf=function(t){a(i,t);var n=s(i);function i(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ef.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}(ef);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}(Jd));var nf=1,rf=Promise.resolve(),of={};function af(e){return e in of&&(delete of[e],!0)}var sf=function(e){var t=nf++;return of[t]=!0,rf.then(function(){return af(t)&&e()}),t},uf=function(e){af(e)};function cf(e){return!!e&&(e instanceof te||"function"==typeof e.lift&&"function"==typeof e.subscribe)}function lf(e,t){return function(n){return n.lift(new hf(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=sf(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&&(uf(n),t.scheduled=void 0)}}]),i}(Jd));var hf=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 df(e,this.compare,this.keySelector))}}]),e}(),df=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}(K),ff=new tf(Jd),pf=function(){function e(t){m(this,e),this.durationSelector=t}return b(e,[{key:"call",value:function(e,t){return t.subscribe(new vf(e,this.durationSelector))}}]),e}(),vf=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=we(t,new be(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}(_e);function gf(e){return!U(e)&&e-parseFloat(e)+1>=0}function mf(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 yf(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ff;return function(e){return function(t){return t.lift(new pf(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 gf(t)?i=Number(t)<1?1:Number(t):ue(t)&&(n=t),ue(n)||(n=ff),new te(function(t){var r=gf(e)?e:+e-n.now();return n.schedule(mf,r,{index:0,period:i,subscriber:t})})}(e,t)})}function bf(e,t){return function(n){return n.lift(new _f(e,t))}}var _f=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 wf(e,this.predicate,this.thisArg))}}]),e}(),wf=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}(K);function kf(e){return function(t){return t.lift(new xf(e))}}var xf=function(){function e(t){m(this,e),this.notifier=t}return b(e,[{key:"call",value:function(e,t){var n=new Sf(e),i=we(this.notifier,new be(n));return i&&!n.seenValue?(n.add(i),t.subscribe(n)):n}}]),e}(),Sf=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}(_e);function Cf(){return Ce(1)($d.apply(void 0,arguments))}function Ef(){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}(Jd)),Mf=new te(function(e){return e.complete()});function If(e){return e?function(e){return new te(function(t){return e.schedule(function(){return t.complete()})})}(e):Mf}function Rf(e,t){return new te(t?function(n){return t.schedule(Df,0,{error:e,subscriber:n})}:function(t){return t.error(e)})}function Df(e){var t=e.error;e.subscriber.error(t)}var Nf=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 $d(this.value);case"E":return Rf(this.error);case"C":return If()}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}();Nf.completeNotification=new Nf("C"),Nf.undefinedValueNotification=new Nf("N",void 0);var Lf,jf=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 Ff(e,this.destination)))}},{key:"_next",value:function(e){this.scheduleMessage(Nf.createNext(e))}},{key:"_error",value:function(e){this.scheduleMessage(Nf.createError(e)),this.unsubscribe()}},{key:"_complete",value:function(){this.scheduleMessage(Nf.createComplete()),this.unsubscribe()}}],[{key:"dispatch",value:function(e){var t=e.notification,n=e.destination;t.observe(n),this.unsubscribe()}}]),n}(K),Ff=function e(t,n){m(this,e),this.notification=t,this.destination=n},Bf=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 Vf(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 ie;if(this.isStopped||this.hasError?t=q.EMPTY:(this.observers.push(e),t=new re(this,e)),r&&e.add(e=new jf(e,r)),n)for(var a=0;at&&(o=Math.max(o,r-t)),o>0&&i.splice(0,o),i}}]),i}(ae),Vf=function e(t,n){m(this,e),this.time=t,this.value=n};function zf(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 Bf(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{Lf="undefined"!=typeof Intl&&Intl.v8BreakIterator}catch(G){Lf=!1}var Uf,Hf,Gf,Wf,qf=function(){var e=function e(t){m(this,e),this._platformId=t,this.isBrowser=this._platformId?hd(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&&!Lf)&&"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)(Zi(Ml))},e.\u0275prov=$e({factory:function(){return new e(Zi(Ml))},token:e,providedIn:"root"}),e}(),Xf=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({}),e}(),Yf=["color","button","checkbox","date","datetime-local","email","file","hidden","image","month","number","password","radio","range","reset","search","submit","tel","text","time","url","week"];function Kf(){if(Uf)return Uf;if("object"!=typeof document||!document)return Uf=new Set(Yf);var e=document.createElement("input");return Uf=new Set(Yf.filter(function(t){return e.setAttribute("type",t),e.type===t}))}function $f(e){return function(){if(null==Hf&&"undefined"!=typeof window)try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:function(){return Hf=!0}}))}finally{Hf=Hf||!1}return Hf}()?e:!!e.capture}function Qf(e){if(function(){if(null==Wf){var e="undefined"!=typeof document?document.head:null;Wf=!(!e||!e.createShadowRoot&&!e.attachShadow)}return Wf}()){var t=e.getRootNode?e.getRootNode():null;if("undefined"!=typeof ShadowRoot&&ShadowRoot&&t instanceof ShadowRoot)return t}return null}function Zf(){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 Jf(e){return e.composedPath?e.composedPath()[0]:e.target}var ep=new Ri("cdk-dir-doc",{providedIn:"root",factory:function(){return Ji(bh)}}),tp=function(){var e=function(){function e(t){if(m(this,e),this.value="ltr",this.change=new ol,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)(Zi(ep,8))},e.\u0275prov=$e({factory:function(){return new e(Zi(ep,8))},token:e,providedIn:"root"}),e}(),np=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({}),e}(),ip=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 ae,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 te(function(n){e._globalSubscription||e._addGlobalListener();var i=t>0?e._scrolled.pipe(yf(t)).subscribe(n):e._scrolled.subscribe(n);return e._scrolledCount++,function(){i.unsubscribe(),e._scrolledCount--,e._scrolledCount||e._removeGlobalListener()}}):$d()}},{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(bf(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=Kd(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 Qd(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)(Zi(Xl),Zi(qf),Zi(bh,8))},e.\u0275prov=$e({factory:function(){return new e(Zi(Xl),Zi(qf),Zi(bh,8))},token:e,providedIn:"root"}),e}(),ap=function(){var e=function(){function e(t,n,i){var r=this;m(this,e),this._platform=t,this._change=new ae,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(yf(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)(Zi(qf),Zi(Xl),Zi(bh,8))},e.\u0275prov=$e({factory:function(){return new e(Zi(qf),Zi(Xl),Zi(bh,8))},token:e,providedIn:"root"}),e}(),sp=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({}),e}(),up=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({imports:[[np,Xf,sp],np,sp]}),e}(),cp=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}(),lp=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}(cp),hp=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}(cp),dp=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 Ju?e.nativeElement:e,i}return n}(cp),fp=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 lp?(this._attachedPortal=e,this.attachComponentPortal(e)):e instanceof hp?(this._attachedPortal=e,this.attachTemplatePortal(e)):this.attachDomPortal&&e instanceof dp?(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}(),pp=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}(fp),vp=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}(hp);return e.\u0275fac=function(t){return new(t||e)(Os(Ac),Os(Nc))},e.\u0275dir=Rt({type:e,selectors:[["","cdkPortal",""]],exportAs:["cdkPortal"],features:[cs]}),e}(),gp=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}(vp);return t.\u0275fac=function(n){return(e||(e=Ti(t)))(n||t)},t.\u0275dir=Rt({type:t,selectors:[["","cdk-portal",""],["","portal",""]],exportAs:["cdkPortal"],features:[Xu([{provide:vp,useExisting:t}]),cs]}),t}(),mp=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 ol,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}(fp);return t.\u0275fac=function(e){return new(e||t)(Os(Ku),Os(Nc),Os(bh))},t.\u0275dir=Rt({type:t,selectors:[["","cdkPortalOutlet",""]],inputs:{portal:["cdkPortalOutlet","portal"]},outputs:{attached:"attached"},exportAs:["cdkPortalOutlet"],features:[cs]}),t}(),yp=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({}),e}(),bp=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 _p(e){return function(t){return 0===e?If():t.lift(new wp(e))}}var wp=function(){function e(t){if(m(this,e),this.total=t,this.total<0)throw new bp}return b(e,[{key:"call",value:function(e,t){return t.subscribe(new kp(e,this.total))}}]),e}(),kp=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}(K);function xp(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return function(n){return n.lift(new Sp(e,t))}}var Sp=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 Cp(e,this.predicate,this.inclusive))}}]),e}(),Cp=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}(K);function Ep(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;it.height||e.scrollWidth>t.width}}]),e}(),Pp=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}(),Ap=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 Ip(e,t){return t.some(function(t){return e.topt.bottom||e.leftt.right})}var Rp=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}(),Dp=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 Ap},this.close=function(e){return new Pp(o._scrollDispatcher,o._ngZone,o._viewportRuler,e)},this.block=function(){return new Tp(o._viewportRuler,o._document)},this.reposition=function(e){return new Rp(o._scrollDispatcher,o._viewportRuler,o._ngZone,e)},this._document=r};return e.\u0275fac=function(t){return new(t||e)(Zi(op),Zi(ap),Zi(Xl),Zi(bh))},e.\u0275prov=$e({factory:function(){return new e(Zi(op),Zi(ap),Zi(Xl),Zi(bh))},token:e,providedIn:"root"}),e}(),Np=function e(t){if(m(this,e),this.scrollStrategy=new Ap,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)(Zi(bh))},e.\u0275prov=$e({factory:function(){return new e(Zi(bh))},token:e,providedIn:"root"}),e}(),Bp=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}(Fp);return t.\u0275fac=function(e){return new(e||t)(Zi(bh))},t.\u0275prov=$e({factory:function(){return new t(Zi(bh))},token:t,providedIn:"root"}),t}(),Vp=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=Jf(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}(Fp);return t.\u0275fac=function(e){return new(e||t)(Zi(bh),Zi(qf))},t.\u0275prov=$e({factory:function(){return new t(Zi(bh),Zi(qf))},token:t,providedIn:"root"}),t}(),zp="undefined"!=typeof window?window:{},Up=void 0!==zp.__karma__&&!!zp.__karma__||void 0!==zp.jasmine&&!!zp.jasmine||void 0!==zp.jest&&!!zp.jest||void 0!==zp.Mocha&&!!zp.Mocha,Hp=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||Up)for(var t=this._document.querySelectorAll(".".concat(e,'[platform="server"], .').concat(e,'[platform="test"]')),n=0;nf&&(f=g,d=v)}}catch(m){p.e(m)}finally{p.f()}return this._isPushed=!1,void this._applyPosition(d.position,d.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&&Yp(this._boundingBox.style,{top:"",left:"",right:"",bottom:"",height:"",width:"",alignItems:"",justifyContent:""}),this._pane&&this._resetOverlayElementStyles(),this._overlayRef&&this._overlayRef.hostElement.classList.remove(Wp),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=$p(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),d=this._subtractOverflows(r.height,c,l),f=h*d;return{visibleArea:f,isCompletelyWithinViewport:r.width*r.height===f,fitsInViewportVertically:d===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=Kp(this._overlayRef.getConfig().minHeight),a=Kp(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=$p(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 d=Math.min(u.right-e.x+u.left,e.x),f=this._lastBoundingBoxSize.width;o=2*d,a=e.x-d,o>f&&!this._isInitialRender&&!this._growAfterOpen&&(a=e.x-f/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=Yd(n.height),i.top=Yd(n.top),i.bottom=Yd(n.bottom),i.width=Yd(n.width),i.left=Yd(n.left),i.right=Yd(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=Yd(r)),o&&(i.maxWidth=Yd(o))}this._lastBoundingBoxSize=n,Yp(this._boundingBox.style,i)}},{key:"_resetBoundingBoxStyles",value:function(){Yp(this._boundingBox.style,{top:"0",left:"0",right:"0",bottom:"0",height:"",width:"",alignItems:"",justifyContent:""})}},{key:"_resetOverlayElementStyles",value:function(){Yp(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();Yp(n,this._getExactOverlayY(t,e,a)),Yp(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=Yd(o.maxHeight):r&&(n.maxHeight="")),o.maxWidth&&(i?n.maxWidth=Yd(o.maxWidth):r&&(n.maxWidth="")),Yp(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=Yd(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=Yd(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:Ip(e,n),isOriginOutsideView:Mp(e,n),isOverlayClipped:Ip(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(Jp),n.justifyContent=n.alignItems=e.marginTop=e.marginBottom=e.marginLeft=e.marginRight=e.position="",this._overlayRef=null,this._isDisposed=!0}}}]),e}(),tv=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 ev}},{key:"connectedTo",value:function(e,t,n){return new Zp(t,n,e,this._viewportRuler,this._document,this._platform,this._overlayContainer)}},{key:"flexibleConnectedTo",value:function(e){return new Xp(e,this._viewportRuler,this._document,this._platform,this._overlayContainer)}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Zi(ap),Zi(bh),Zi(qf),Zi(Hp))},e.\u0275prov=$e({factory:function(){return new e(Zi(ap),Zi(bh),Zi(qf),Zi(Hp))},token:e,providedIn:"root"}),e}(),nv=0,iv=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 Np(e);return r.direction=r.direction||this._directionality.value,new Gp(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-"+nv++,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(dh)),new pp(e,this._componentFactoryResolver,this._appRef,this._injector,this._document)}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Zi(Dp),Zi(Hp),Zi(Ku),Zi(tv),Zi(Bp),Zi(ss),Zi(Xl),Zi(bh),Zi(tp),Zi(Ih),Zi(Vp))},e.\u0275prov=$e({token:e,factory:e.\u0275fac}),e}(),rv=[{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"}],ov=new Ri("cdk-connected-overlay-scroll-strategy"),av=function(){var e=function e(t){m(this,e),this.elementRef=t};return e.\u0275fac=function(t){return new(t||e)(Os(Ju))},e.\u0275dir=Rt({type:e,selectors:[["","cdk-overlay-origin",""],["","overlay-origin",""],["","cdkOverlayOrigin",""]],exportAs:["cdkOverlayOrigin"]}),e}(),sv=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=q.EMPTY,this._attachSubscription=q.EMPTY,this._detachSubscription=q.EMPTY,this._positionSubscription=q.EMPTY,this.viewportMargin=0,this.open=!1,this.disableClose=!1,this.backdropClick=new ol,this.positionChange=new ol,this.attach=new ol,this.detach=new ol,this.overlayKeydown=new ol,this.overlayOutsideClick=new ol,this._templatePortal=new hp(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=Wd(e)}},{key:"lockPosition",get:function(){return this._lockPosition},set:function(e){this._lockPosition=Wd(e)}},{key:"flexibleDimensions",get:function(){return this._flexibleDimensions},set:function(e){this._flexibleDimensions=Wd(e)}},{key:"growAfterOpen",get:function(){return this._growAfterOpen},set:function(e){this._growAfterOpen=Wd(e)}},{key:"push",get:function(){return this._push},set:function(e){this._push=Wd(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=rv);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&&!Ep(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 Np({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(xp(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)(Os(iv),Os(Ac),Os(Nc),Os(ov),Os(tp,8))},e.\u0275dir=Rt({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:[qt]}),e}(),uv={provide:ov,deps:[iv],useFactory:function(e){return function(){return e.scrollStrategies.reposition()}}},cv=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({providers:[iv,uv],imports:[[np,yp,up],up]}),e}(),lv={schedule:function(e,t){var n=setTimeout(e,t);return function(){return clearTimeout(n)}},scheduleBeforeRender:function(e){if("undefined"==typeof window)return lv.schedule(e,0);if(void 0===window.requestAnimationFrame)return lv.schedule(e,16);var t=window.requestAnimationFrame(e);return function(){return window.cancelAnimationFrame(t)}}};function hv(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(!Qp){var n=Element.prototype;Qp=n.matches||n.matchesSelector||n.mozMatchesSelector||n.msMatchesSelector||n.oMatchesSelector||n.webkitMatchesSelector}return e.nodeType===Node.ELEMENT_NODE&&Qp.call(e,t)}(e,t)||(i=n,0))}),i}var dv=function(){function e(t,n){m(this,e),this.componentFactory=n.get(Ku).resolveComponentFactory(t)}return b(e,[{key:"create",value:function(e){return new fv(this.componentFactory,e)}}]),e}(),fv=function(){function e(t,n){m(this,e),this.componentFactory=t,this.injector=n,this.eventEmitters=new Bf(1),this.events=this.eventEmitters.pipe(Of(function(e){return Oe.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(Xl),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=lv.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=ss.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]:ff;return function(n){return n.lift(new wv(e,t))}}var wv=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 kv(e,this.dueTime,this.scheduler))}}]),e}(),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,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(xv,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}(K);function xv(e){e.debouncedNext()}function Sv(e){return function(t){return t.lift(new Cv(e))}}var Cv=function(){function e(t){m(this,e),this.total=t}return b(e,[{key:"call",value:function(e,t){return t.subscribe(new Ev(e,this.total))}}]),e}(),Ev=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}(K),Ov=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=$e({factory:function(){return new e},token:e,providedIn:"root"}),e}(),Tv=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=Kd(e);return new te(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 ae,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)(Zi(Ov))},e.\u0275prov=$e({factory:function(){return new e(Zi(Ov))},token:e,providedIn:"root"}),e}(),Pv=function(){var e=function(){function e(t,n,i){m(this,e),this._contentObserver=t,this._elementRef=n,this._ngZone=i,this.event=new ol,this._disabled=!1,this._currentSubscription=null}return b(e,[{key:"disabled",get:function(){return this._disabled},set:function(e){this._disabled=Wd(e),this._disabled?this._unsubscribe():this._subscribe()}},{key:"debounce",get:function(){return this._debounce},set:function(e){this._debounce=qd(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(_v(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)(Os(Tv),Os(Ju),Os(Xl))},e.\u0275dir=Rt({type:e,selectors:[["","cdkObserveContent",""]],inputs:{disabled:["cdkObserveContentDisabled","disabled"],debounce:"debounce"},outputs:{event:"cdkObserveContent"},exportAs:["cdkObserveContent"]}),e}(),Av=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({providers:[Ov]}),e}();function Mv(e,t){return(e.getAttribute(t)||"").match(/\S+/g)||[]}var Iv="cdk-describedby-message-container",Rv="cdk-describedby-message",Dv="cdk-describedby-host",Nv=0,Lv=new Map,jv=null,Fv=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=Bv(t,n);"string"!=typeof t?(Vv(t),Lv.set(i,{messageElement:t,referenceCount:0})):Lv.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=Bv(t,n);if(this._isElementDescribedByMessage(e,i)&&this._removeMessageReference(e,i),"string"==typeof t){var r=Lv.get(i);r&&0===r.referenceCount&&this._deleteMessageElement(i)}jv&&0===jv.childNodes.length&&this._deleteMessagesContainer()}}},{key:"ngOnDestroy",value:function(){for(var e=this._document.querySelectorAll("[".concat(Dv,"]")),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(mv(function(t){return e._pressedLetters.push(t)}),_v(t),bf(function(){return e._pressedLetters.length>0}),ce(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||Ep(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 sl?this._items.toArray():this._items}}]),e}()),Uv=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===Gv(t)||!this.isVisible(t)))return!1;var n=e.nodeName.toLowerCase(),i=Gv(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")||Hv(e))}(e)&&!this.isDisabled(e)&&((null==t?void 0:t.ignoreVisibility)||this.isVisible(e))}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Zi(qf))},e.\u0275prov=$e({factory:function(){return new e(Zi(qf))},token:e,providedIn:"root"}),e}();function Hv(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 Gv(e){if(!Hv(e))return null;var t=parseInt(e.getAttribute("tabindex")||"",10);return isNaN(t)?-1:t}var Wv=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(_p(1)).subscribe(e)}}]),e}(),qv=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 Wv(e,this._checker,this._ngZone,this._document,t)}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Zi(Uv),Zi(Xl),Zi(bh))},e.\u0275prov=$e({factory:function(){return new e(Zi(Uv),Zi(Xl),Zi(bh))},token:e,providedIn:"root"}),e}();function Xv(e){return 0===e.offsetX&&0===e.offsetY}function Yv(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 Kv=new Ri("cdk-input-modality-detector-options"),$v={ignoreKeys:[18,17,224,91,16]},Qv=$f({passive:!0,capture:!0}),Zv=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 vv(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=Jf(e))},this._onMousedown=function(e){Date.now()-o._lastTouchMs<650||(o._modality.next(Xv(e)?"keyboard":"mouse"),o._mostRecentTarget=Jf(e))},this._onTouchstart=function(e){Yv(e)?o._modality.next("keyboard"):(o._lastTouchMs=Date.now(),o._modality.next("touch"),o._mostRecentTarget=Jf(e))},this._options=Object.assign(Object.assign({},$v),r),this.modalityDetected=this._modality.pipe(Sv(1)),this.modalityChanged=this.modalityDetected.pipe(lf()),t.isBrowser&&n.runOutsideAngular(function(){i.addEventListener("keydown",o._onKeydown,Qv),i.addEventListener("mousedown",o._onMousedown,Qv),i.addEventListener("touchstart",o._onTouchstart,Qv)})}return b(e,[{key:"mostRecentModality",get:function(){return this._modality.value}},{key:"ngOnDestroy",value:function(){!this._platform.isBrowser||(document.removeEventListener("keydown",this._onKeydown,Qv),document.removeEventListener("mousedown",this._onMousedown,Qv),document.removeEventListener("touchstart",this._onTouchstart,Qv))}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Zi(qf),Zi(Xl),Zi(bh),Zi(Kv,8))},e.\u0275prov=$e({factory:function(){return new e(Zi(qf),Zi(Xl),Zi(bh),Zi(Kv,8))},token:e,providedIn:"root"}),e}(),Jv=new Ri("liveAnnouncerElement",{providedIn:"root",factory:function(){return null}}),eg=new Ri("LIVE_ANNOUNCER_DEFAULT_OPTIONS"),tg=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=Kd(e);if(!this._platform.isBrowser||1!==n.nodeType)return $d(null);var i=Qf(n)||this._getDocument(),r=this._elementInfo.get(n);if(r)return t&&(r.checkChildren=!0),r.subject;var o={checkChildren:t,subject:new ae,rootNode:i};return this._elementInfo.set(n,o),this._registerGlobalListeners(o),o.subject}},{key:"stopMonitoring",value:function(e){var t=Kd(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=Kd(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=Jf(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,ig),n.addEventListener("blur",t._rootNodeFocusAndBlurListener,ig)}),this._rootNodeFocusListenerCount.set(n,i+1),1==++this._monitoredElementCount&&(this._ngZone.runOutsideAngular(function(){t._getWindow().addEventListener("focus",t._windowFocusListener)}),this._inputModalityDetector.modalityDetected.pipe(kf(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,ig),t.removeEventListener("blur",this._rootNodeFocusAndBlurListener,ig),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)(Zi(Xl),Zi(qf),Zi(Zv),Zi(bh,8),Zi(ng,8))},e.\u0275prov=$e({factory:function(){return new e(Zi(Xl),Zi(qf),Zi(Zv),Zi(bh,8),Zi(ng,8))},token:e,providedIn:"root"}),e}(),og="cdk-high-contrast-black-on-white",ag="cdk-high-contrast-white-on-black",sg="cdk-high-contrast-active",ug=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(sg),e.remove(og),e.remove(ag),this._hasCheckedHighContrastMode=!0;var t=this.getHighContrastMode();1===t?(e.add(sg),e.add(og)):2===t&&(e.add(sg),e.add(ag))}}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Zi(qf),Zi(bh))},e.\u0275prov=$e({factory:function(){return new e(Zi(qf),Zi(bh))},token:e,providedIn:"root"}),e}(),cg=function(){var e=function e(t){m(this,e),t._applyBodyHighContrastModeCssClasses()};return e.\u0275fac=function(t){return new(t||e)(Zi(ug))},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({imports:[[Xf,Av]]}),e}(),lg=new oc("12.2.5"),hg=function e(){m(this,e)},dg="*";function fg(e,t){return{type:7,name:e,definitions:t,options:{}}}function pg(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return{type:4,styles:t,timings:e}}function vg(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return{type:2,steps:e,options:t}}function gg(e){return{type:6,styles:e,offset:null}}function mg(e,t,n){return{type:0,name:e,styles:t,options:n}}function yg(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return{type:1,expr:e,animation:t,options:n}}function bg(e){Promise.resolve(null).then(e)}var _g=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;bg(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}(),wg=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?bg(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 kg(){return"undefined"!=typeof window&&void 0!==window.document}function xg(){return"undefined"!=typeof process&&"[object process]"==={}.toString.call(process)}function Sg(e){switch(e.length){case 0:return new _g;case 1:return e[0];default:return new wg(e)}}function Cg(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 dg: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 Eg(e,t,n,i){switch(t){case"start":e.onStart(function(){return i(n&&Og(n,"start",e))});break;case"done":e.onDone(function(){return i(n&&Og(n,"done",e))});break;case"destroy":e.onDestroy(function(){return i(n&&Og(n,"destroy",e))})}}function Og(e,t,n){var i=n.totalTime,r=Tg(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 Tg(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 Pg(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 Ag(e){var t=e.indexOf(":");return[e.substring(1,t),e.substr(t+1)]}var Mg=function(e,t){return!1},Ig=function(e,t){return!1},Rg=function(e,t,n){return[]},Dg=xg();(Dg||"undefined"!=typeof Element)&&(Mg=kg()?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)},Ig=function(){if(Dg||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])}:Ig}(),Rg=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 em(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 Jg(e,n);return n}function tm(e,t,n){return n?t+":"+n+";":""}function nm(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(_m(o,s)),"<"==a[0]&&("*"!=o||"*"!=s)&&t.push(_m(s,o))}(e,n,t)}):n.push(e),n}var ym=new Set(["true","1"]),bm=new Set(["false","0"]);function _m(e,t){var n=ym.has(e)||bm.has(e),i=ym.has(t)||bm.has(t);return function(r,o){var a="*"==e||e==r,s="*"==t||t==o;return!a&&n&&"boolean"==typeof r&&(a=r?ym.has(e):bm.has(e)),!s&&i&&"boolean"==typeof o&&(s=o?ym.has(t):bm.has(t)),a&&s}}var wm=new RegExp("s*:selfs*,?","g");function km(e,t,n){return new xm(e).build(t,n)}var xm=function(){function e(t){m(this,e),this._driver=t}return b(e,[{key:"build",value:function(e,t){var n=new Sm(t);return this._resetContextStyleTimingState(n),vm(this,om(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(Cm(e)){var t=e;Object.keys(t).forEach(function(e){sm(t[e]).forEach(function(e){o.hasOwnProperty(e)||r.add(e)})})}}),r.size){var a=cm(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=vm(this,om(e.animation),t);return{type:1,matchers:mm(e.expr,t.errors),animation:n,queryCount:t.queryCount,depCount:t.depCount,options:Em(e.options)}}},{key:"visitSequence",value:function(e,t){var n=this;return{type:2,steps:e.steps.map(function(e){return vm(n,e,t)}),options:Em(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=vm(n,e,t);return r=Math.max(r,t.currentTime),o});return t.currentTime=r,{type:3,steps:o,options:Em(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 Om(Zg(e,t).duration,0,"");var i=e;if(i.split(/\s+/).some(function(e){return"{"==e.charAt(0)&&"{"==e.charAt(1)})){var r=Om(0,0,"");return r.dynamic=!0,r.strValue=i,r}return Om((n=n||Zg(i,t)).duration,n.delay,n.easing)}(e.timings,t.errors);t.currentAnimateTimings=n;var i,r=e.styles?e.styles:gg({});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=gg(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==dg?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(Cm(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=sm(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(Cm(e)&&e.hasOwnProperty("offset")){var n=e;t=parseFloat(n.offset),delete n.offset}});else if(Cm(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==d?1:h*r:o[r],s=a*v;t.currentTime=f+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:vm(this,om(e.animation),t),options:Em(e.options)}}},{key:"visitAnimateChild",value:function(e,t){return t.depCount++,{type:9,options:Em(e.options)}}},{key:"visitAnimateRef",value:function(e,t){return{type:10,animation:this.visitReference(e.animation,t),options:Em(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(wm,"")),[e=e.replace(/@\*/g,Xg).replace(/@\w+/g,function(e){return Xg+"-"+e.substr(1)}).replace(/:animating/g,Kg),t]}(e.selector),2),a=o[0],s=o[1];n.currentQuerySelector=i.length?i+" "+a:a,Pg(n.collectedStyles,n.currentQuerySelector,{});var u=vm(this,om(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:Em(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"}:Zg(e.timings,t.errors,!0);return{type:12,animation:vm(this,om(e.animation),t),timings:n,options:null}}}]),e}(),Sm=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 Cm(e){return!Array.isArray(e)&&"object"==typeof e}function Em(e){return e?(e=Jg(e)).params&&(e.params=function(e){return e?Jg(e):null}(e.params)):e={},e}function Om(e,t,n){return{duration:e,delay:t,easing:n}}function Tm(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 Pm=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}(),Am=new RegExp(":enter","g"),Mm=new RegExp(":leave","g");function Im(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 Rm).buildKeyframes(e,t,n,i,r,o,a,s,u,c)}var Rm=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 Pm;var l=new Nm(e,t,u,i,r,c,[]);l.options=s,l.currentTimeline.setStyles([o],null,l.errors,s),vm(this,n,l);var h=l.timelines.filter(function(e){return e.containsAnimation()});if(h.length&&Object.keys(a).length){var d=h[h.length-1];d.allowOnlyTimelineStyles()||d.setStyles([a],null,l.errors,s)}return h.length?h.map(function(e){return e.buildKeyframes()}):[Tm(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?$g(n.duration):null,o=null!=n.delay?$g(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),vm(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=Dm);var a=$g(o.delay);r.delayNextStep(a)}e.steps.length&&(e.steps.forEach(function(e){return vm(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?$g(e.options.delay):0;e.steps.forEach(function(a){var s=t.createSubContext(e.options);o&&s.delayNextStep(o),vm(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 Zg(t.params?um(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?$g(r.delay):0;o&&(6===t.previousNode.type||0==i&&t.currentTimeline.getCurrentStyleProperties().length)&&(t.currentTimeline.snapshotCurrentStyles(),t.previousNode=Dm);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),vm(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;vm(this,e.animation,t),t.previousNode=e,n.currentStaggerTime=i.currentTime-c+(i.startTime-n.currentTimeline.startTime)}}]),e}(),Dm={},Nm=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=Dm,this.subContextCount=0,this.options={},this.currentQueryIndex=0,this.currentQueryTotal=0,this.currentStaggerTime=0,this.currentTimeline=u||new Lm(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=$g(i.duration)),null!=i.delay&&(r.delay=$g(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]=um(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=Dm,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 jm(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(Am,"."+this._enterClassName)).replace(Mm,"."+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}(),Lm=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]||dg,t._currentKeyframe[e]=dg}),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]=dg}):em(e,!1,i)}),i}(e,this._globalTimelineStyles);Object.keys(a).forEach(function(e){var t=um(a[e],o,n);r._pendingStyles[e]=t,r._localTimelineStyles.hasOwnProperty(e)||(r._backFill[e]=r._globalTimelineStyles.hasOwnProperty(e)?r._globalTimelineStyles[e]:dg),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=em(o,!0);Object.keys(s).forEach(function(e){var i=s[e];"!"==i?t.add(e):i==dg&&n.add(e)}),i||(s.offset=a/e.duration),r.push(s)});var o=t.size?cm(t.values()):[],a=n.size?cm(n.values()):[];if(i){var s=r[0],u=Jg(s);s.offset=0,u.offset=1,r=[s,u]}return Tm(this.element,r,o,a,this.duration,this.startTime,this.easing,!1)}}]),e}(),jm=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=em(e[0],!1);u.offset=0,o.push(u);var c=em(e[0],!1);c.offset=Fm(s),o.push(c);for(var l=e.length-1,h=1;h<=l;h++){var d=em(e[h],!1);d.offset=Fm((n+d.offset*i)/a),o.push(d)}i=a,n=0,r="",e=o}return Tm(this.element,e,this.preStyleProps,this.postStyleProps,i,n,r,!0)}}]),n}(Lm);function Fm(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 Bm=function e(){m(this,e)},Vm=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 hm(e)}},{key:"normalizeStyleValue",value:function(e,t,n,i){var r="",o=n.toString().trim();if(zm[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}(Bm),zm=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 Um(e,t,n,i,r,o,a,s,u,c,l,h,d){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:d}}var Hm={},Gm=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||Hm,d=this.buildStyles(n,a&&a.params||Hm,l),f=s&&s.params||Hm,p=this.buildStyles(i,f,l),v=new Set,g=new Map,m=new Map,y="void"===i,b={params:Object.assign(Object.assign({},h),f)},_=c?[]:Im(e,t,this.ast.animation,r,o,d,p,b,u,l),w=0;if(_.forEach(function(e){w=Math.max(e.duration+e.delay,w)}),l.length)return Um(t,this._triggerName,n,i,y,d,p,[],[],g,m,w,l);_.forEach(function(e){var n=e.element,i=Pg(g,n,{});e.preStyleProps.forEach(function(e){return i[e]=!0});var r=Pg(m,n,{});e.postStyleProps.forEach(function(e){return r[e]=!0}),n!==t&&v.add(n)});var k=cm(v.values());return Um(t,this._triggerName,n,i,y,d,p,_,k,g,m,w)}}]),e}(),Wm=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=Jg(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=um(a,r,t));var s=n.normalizer.normalizePropertyName(e,t);a=n.normalizer.normalizeStyleValue(e,s,a,t),i[s]=a})}}),i}}]),e}(),qm=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 Wm(e.style,e.options&&e.options.params||{},i)}),Xm(this.states,"true","1"),Xm(this.states,"false","0"),n.transitions.forEach(function(e){r.transitionFactories.push(new Gm(t,e,r.states))}),this.fallbackTransition=function(e,t,n){return new Gm(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 Xm(e,t,n){e.hasOwnProperty(t)?e.hasOwnProperty(n)||(e[n]=e[t]):e.hasOwnProperty(n)&&(e[t]=e[n])}var Ym=new Pm,Km=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=km(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=Cg(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=Im(this._driver,t,a,Gg,Wg,{},{},r,Ym,o)).forEach(function(e){var t=Pg(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,dg)})});var u=Sg(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=Tg(t,"","","");return Eg(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}(),$m="ng-animate-queued",Qm="ng-animate-disabled",Zm=".ng-animate-disabled",Jm=[],ey={namespaceId:"",setForRemoval:!1,setForMove:!1,hasAnimation:!1,removedBeforeQueried:!1},ty={namespaceId:"",setForMove:!1,setForRemoval:!1,hasAnimation:!1,removedBeforeQueried:!0},ny="__ng_removed",iy=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=Jg(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}(),ry="void",oy=new iy(ry),ay=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,py(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=Pg(this._elementListeners,e,[]),a={name:t,phase:n,callback:i};o.push(a);var s=Pg(this._engine.statesByElement,e,{});return s.hasOwnProperty(t)||(py(e,qg),py(e,qg+"-"+t),s[t]=oy),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 uy(this.id,t,e),s=this._engine.statesByElement.get(e);s||(py(e,qg),py(e,qg+"-"+t),this._engine.statesByElement.set(e,s={}));var u=s[t],c=new iy(n,this.id);if(!(n&&n.hasOwnProperty("value"))&&u&&c.absorbOptions(u.options),s[t]=c,u||(u=oy),c.value===ry||u.value!==c.value){var l=Pg(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),d=!1;if(!h){if(!r)return;h=o.fallbackTransition,d=!0}return this._engine.totalQueuedPlayers++,this._queue.push({element:e,triggerName:t,transition:h,fromState:u,toState:c,player:a,isFallbackTransition:d}),d||(py(e,$m),a.onStart(function(){vy(e,$m)})),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),py(e,Qm)):this.disabledNodes.has(e)&&(this.disabledNodes.delete(e),vy(e,Qm))}},{key:"removeNode",value:function(e,t,n,i){if(cy(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[ny]={namespaceId:e,setForRemoval:i,hasAnimation:n,removedBeforeQueried:!1}}},{key:"listen",value:function(e,t,n,i,r){return cy(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,Xg,!0);n.forEach(function(e){return t.destroyActiveAnimationsForElement(e)}),0!=this.playersByQueriedElement.size&&(n=this.driver.query(e,Kg,!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 Sg(e.players).onDone(function(){return t()});t()})}},{key:"processLeaveNode",value:function(e){var t=this,n=e[ny];if(n&&n.setForRemoval){if(e[ny]=ey,n.namespaceId){this.destroyInnerAnimations(e);var i=this._fetchNamespace(n.namespaceId);i&&i.clearElementCache(e)}this._onRemovalComplete(e,n.setForRemoval)}this.driver.matchesElement(e,Zm)&&this.markElementAsDisabled(e,!1),this.driver.query(e,Zm,!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(C.push(t),n.collectedEnterElements.length){var l=o[ny];if(l&&l.setForMove)return void t.destroy()}var d=!h||!n.driver.containsElement(h,o),f=x.get(o),v=p.get(o),g=n._buildInstruction(e,i,v,f,d);if(g.errors&&g.errors.length)E.push(g);else{if(d)return t.onStart(function(){return rm(o,g.fromStyles)}),t.onDestroy(function(){return im(o,g.toStyles)}),void r.push(t);if(e.isFallbackTransition)return t.onStart(function(){return rm(o,g.fromStyles)}),t.onDestroy(function(){return im(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 Pg(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(E.length){var T=[];E.forEach(function(e){T.push("@".concat(e.triggerName," has failed due to:\n")),e.errors.forEach(function(e){return T.push("- ".concat(e,"\n"))})}),C.forEach(function(e){return e.destroy()}),this.reportError(T)}var P=new Map,A=new Map;a.forEach(function(e){var t=e.element;i.has(t)&&(A.set(t,t),n._beforeAnimationBuild(e.player.namespaceId,e.instruction,P))}),r.forEach(function(e){var t=e.element;n._getPreviousPlayers(t,!1,e.namespaceId,e.triggerName,null).forEach(function(e){Pg(P,t,[]).push(e),e.destroy()})});var M=m.filter(function(e){return yy(e,u,c)}),I=new Map;hy(I,this.driver,b,c,dg).forEach(function(e){yy(e,u,c)&&M.push(e)});var R=new Map;f.forEach(function(e,t){hy(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 im(t,s.toStyles)}),a.disabled=!0,a.overrideTotalTime(s.totalTime),void r.push(a);var u=L;if(A.size>1){for(var c=t,h=[];c=c.parentNode;){var d=A.get(c);if(d){u=d;break}h.push(c)}h.forEach(function(e){return A.set(e,u)})}var f=n._buildAnimation(a.namespaceId,s,P,o,R,I);if(a.setRealPlayer(f),u===L)D.push(a);else{var p=n.playersByElement.get(u);p&&p.length&&(a.parentPlayer=Sg(p)),r.push(a)}}else rm(t,s.fromStyles),a.onDestroy(function(){return im(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=Sg(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 _g(e.duration,e.delay)}}]),e}(),uy=function(){function e(t,n,i){m(this,e),this.namespaceId=t,this.triggerName=n,this.element=i,this._player=new _g,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 Eg(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){Pg(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 cy(e){return e&&1===e.nodeType}function ly(e,t){var n=e.style.display;return e.style.display=null!=t?t:"none",n}function hy(e,t,n,i,r){var o=[];n.forEach(function(e){return o.push(ly(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[ny]=ty,a.push(i))}),e.set(i,o)});var s=0;return n.forEach(function(e){return ly(e,o[s++])}),a}function dy(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 fy="$$classes";function py(e,t){if(e.classList)e.classList.add(t);else{var n=e[fy];n||(n=e[fy]={}),n[t]=!0}}function vy(e,t){if(e.classList)e.classList.remove(t);else{var n=e[fy];n&&delete n[t]}}function gy(e,t,n){Sg(n).onDone(function(){return e.processLeaveNode(t)})}function my(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 _y(e,t){var n=null,i=null;return Array.isArray(t)&&t.length?(n=ky(t[0]),t.length>1&&(i=ky(t[t.length-1]))):t&&(n=ky(t)),n||i?new wy(e,n,i):null}var wy=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&&im(this._element,this._startStyles,this._initialStyles),this._state=1)}},{key:"finish",value:function(){this.start(),this._state<2&&(im(this._element,this._initialStyles),this._endStyles&&(im(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&&(rm(this._element,this._startStyles),this._endStyles=null),this._endStyles&&(rm(this._element,this._endStyles),this._endStyles=null),im(this._element,this._initialStyles),this._state=3)}}]),e}();function ky(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(),Ay(this._element,this._eventFn,!0))}},{key:"destroy",value:function(){this._destroyed||(this._destroyed=!0,this.finish(),function(e,t){var n=Iy(e,"").split(","),i=Py(n,t);i>=0&&(n.splice(i,1),My(e,"",n.join(",")))}(this._element,this._name))}}]),e}();function Oy(e,t,n){My(e,"PlayState",n,Ty(e,t))}function Ty(e,t){var n=Iy(e,"");return n.indexOf(",")>0?Py(n.split(","),t):Py([n],t)}function Py(e,t){for(var n=0;n=0)return n;return-1}function Ay(e,t,n){n?e.removeEventListener(Cy,t):e.addEventListener(Cy,t)}function My(e,t,n,i){var r=Sy+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 Iy(e,t){return e.style[Sy+t]||""}var Ry=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 Ey(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]:gm(e.element,i))})}this.currentSnapshot=t}}]),e}(),Dy=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=zg(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}(_g),Ny=function(){function e(){m(this,e),this._count=0}return b(e,[{key:"validateStyleProperty",value:function(e){return jg(e)}},{key:"matchesElement",value:function(e,t){return Fg(e,t)}},{key:"containsElement",value:function(e,t){return Bg(e,t)}},{key:"query",value:function(e,t,n){return Vg(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 zg(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 Ry}),s={};fm(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=pm(e,t,s));if(0==n)return new Dy(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=_y(e,t),d=new Ry(e,t,c,n,i,r,u,h);return d.onDestroy(function(){return function(e){e.parentNode.removeChild(e)}(l)}),d}}]),e}(),Ly=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]:gm(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}(),jy=function(){function e(){m(this,e),this._isNativeImpl=/\{\s*\[native\s+code\]\s*\}/.test(Fy().toString()),this._cssKeyframesDriver=new Ny}return b(e,[{key:"validateStyleProperty",value:function(e){return jg(e)}},{key:"matchesElement",value:function(e,t){return Fg(e,t)}},{key:"containsElement",value:function(e,t){return Bg(e,t)}},{key:"query",value:function(e,t,n){return Vg(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 Ly});fm(n,i)&&c.forEach(function(e){var t=e.currentSnapshot;Object.keys(t).forEach(function(e){return u[e]=t[e]})});var l=_y(e,t=pm(e,t=t.map(function(e){return em(e,!1)}),u));return new Ly(e,t,s,l)}}]),e}();function Fy(){return kg()&&Element.prototype.animate||{}}var By=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:ht.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)?vg(e):e;return Uy(this._renderer,null,t,"register",[n]),new Vy(t,this._renderer)}}]),n}(hg);return e.\u0275fac=function(t){return new(t||e)(Zi(tc),Zi(bh))},e.\u0275prov=$e({token:e,factory:e.\u0275fac}),e}(),Vy=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 zy(this._id,e,t||{},this._renderer)}}]),n}(function(){return function e(){m(this,e)}}()),zy=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==Hy?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}(),qy=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==Hy?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}(Wy),Xy=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}(by);return e.\u0275fac=function(t){return new(t||e)(Zi(bh),Zi(Hg),Zi(Bm))},e.\u0275prov=$e({token:e,factory:e.\u0275fac}),e}(),Yy=new Ri("AnimationModuleType"),Ky=[{provide:hg,useClass:By},{provide:Bm,useFactory:function(){return new Vm}},{provide:by,useClass:Xy},{provide:tc,useFactory:function(e,t,n){return new Gy(e,t,n)},deps:[Ad,by,Xl]}],$y=[{provide:Hg,useFactory:function(){return"function"==typeof Fy()?new jy:new Ny}},{provide:Yy,useValue:"BrowserAnimations"}].concat(Ky),Qy=[{provide:Hg,useClass:Ug},{provide:Yy,useValue:"NoopAnimations"}].concat(Ky),Zy=function(){var e=function(){function e(){m(this,e)}return b(e,null,[{key:"withConfig",value:function(t){return{ngModule:e,providers:t.disableAnimations?Qy:$y}}}]),e}();return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({providers:$y,imports:[Gd]}),e}();function Jy(e,t){if(1&e&&Is(0,"mat-pseudo-checkbox",4),2&e){var n=Ws();Ts("state",n.selected?"checked":"unchecked")("disabled",n.disabled)}}function eb(e,t){if(1&e&&(As(0,"span",5),Cu(1),Ms()),2&e){var n=Ws();Yo(1),Ou("(",n.group.label,")")}}var tb=["*"],nb=new oc("12.2.5"),ib=new Ri("mat-sanity-checks",{providedIn:"root",factory:function(){return!0}}),rb=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!(!ah()||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")&&nb.full!==lg.full&&console.warn("The Angular Material version ("+nb.full+") does not match the Angular CDK version ("+lg.full+").\nPlease ensure the versions of these two packages exactly match.")}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Zi(ug),Zi(ib,8),Zi(bh))},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({imports:[[np],np]}),e}();function ob(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({},vb),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 pb(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({},vb),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=Kd(e);!t||t===this._triggerElement||(this._removeTriggerEvents(),this._triggerElement=t,this._registerEvents(mb))}},{key:"handleEvent",value:function(e){"mousedown"===e.type?this._onMousedown(e):"touchstart"===e.type?this._onTouchStart(e):this._onPointerUp(),this._pointerUpEventsRegistered||(this._registerEvents(yb),this._pointerUpEventsRegistered=!0)}},{key:"_onMousedown",value:function(e){var t=Xv(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,gb)})})}},{key:"_removeTriggerEvents",value:function(){var e=this;this._triggerElement&&(mb.forEach(function(t){e._triggerElement.removeEventListener(t,e,gb)}),this._pointerUpEventsRegistered&&yb.forEach(function(t){e._triggerElement.removeEventListener(t,e,gb)}))}}]),e}(),_b=new Ri("mat-ripple-global-options"),wb=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 bb(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)(Os(Ju),Os(Xl),Os(qf),Os(_b,8),Os(Yy,8))},e.\u0275dir=Rt({type:e,selectors:[["","mat-ripple",""],["","matRipple",""]],hostAttrs:[1,"mat-ripple"],hostVars:2,hostBindings:function(e,t){2&e&&cu("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}(),kb=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({imports:[[rb,Xf],rb]}),e}(),xb=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)(Os(Yy,8))},e.\u0275cmp=Ot({type:e,selectors:[["mat-pseudo-checkbox"]],hostAttrs:[1,"mat-pseudo-checkbox"],hostVars:8,hostBindings:function(e,t){2&e&&cu("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}(),Sb=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({imports:[[rb]]}),e}(),Cb=new Ri("MAT_OPTION_PARENT_COMPONENT"),Eb=ob(function(){return function e(){m(this,e)}}()),Ob=0,Tb=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-"+Ob++,i._inert=null!==(r=null==e?void 0:e.inertGroups)&&void 0!==r&&r,i}return n}(Eb);return e.\u0275fac=function(t){return new(t||e)(Os(Cb,8))},e.\u0275dir=Rt({type:e,inputs:{label:"label"},features:[cs]}),e}(),Pb=new Ri("MatOptgroup"),Ab=0,Mb=function e(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];m(this,e),this.source=t,this.isUserInput=n},Ib=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-"+Ab++,this.onSelectionChange=new ol,this._stateChanges=new ae}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=Wd(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)&&!Ep(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 Mb(this,e))}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Os(Ju),Os(Cc),Os(void 0),Os(Tb))},e.\u0275dir=Rt({type:e,inputs:{id:"id",disabled:"disabled",value:"value"},outputs:{onSelectionChange:"onSelectionChange"}}),e}(),Rb=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}(Ib);return e.\u0275fac=function(t){return new(t||e)(Os(Ju),Os(Cc),Os(Cb,8),Os(Pb,8))},e.\u0275cmp=Ot({type:e,selectors:[["mat-option"]],hostAttrs:["role","option",1,"mat-option","mat-focus-indicator"],hostVars:12,hostBindings:function(e,t){1&e&&Vs("click",function(){return t._selectViaInteraction()})("keydown",function(e){return t._handleKeydown(e)}),2&e&&(Au("id",t.id),ks("tabindex",t._getTabIndex())("aria-selected",t._getAriaSelected())("aria-disabled",t.disabled.toString()),cu("mat-selected",t.selected)("mat-option-multiple",t.multiple)("mat-active",t.active)("mat-option-disabled",t.disabled))},exportAs:["matOption"],features:[cs],ngContentSelectors:tb,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&&(Xs(),Cs(0,Jy,1,2,"mat-pseudo-checkbox",0),As(1,"span",1),Ys(2),Ms(),Cs(3,eb,2,1,"span",2),Is(4,"div",3)),2&e&&(Ts("ngIf",t.multiple),Yo(3),Ts("ngIf",t.group&&t.group._inert),Yo(1),Ts("matRippleTrigger",t._getHostElement())("matRippleDisabled",t.disabled||t.disableRipple))},directives:[Yh,wb,xb],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 Db(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 Lb=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({imports:[[kb,cd,rb,Sb]]}),e}();function jb(){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}(),Yb=function(){function e(){m(this,e)}return b(e,[{key:"encodeKey",value:function(e){return Qb(e)}},{key:"encodeValue",value:function(e){return Qb(e)}},{key:"decodeKey",value:function(e){return decodeURIComponent(e)}},{key:"decodeValue",value:function(e){return decodeURIComponent(e)}}]),e}(),Kb=/%(\d[a-f0-9])/gi,$b={40:"@","3A":":",24:"$","2C":",","3B":";","2B":"+","3D":"=","3F":"?","2F":"/"};function Qb(e){return encodeURIComponent(e).replace(Kb,function(e,t){var n;return null!==(n=$b[t])&&void 0!==n?n:e})}function Zb(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 Yb,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(Zb(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(Zb(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}(),e_=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 t_(e){return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer}function n_(e){return"undefined"!=typeof Blob&&e instanceof Blob}function i_(e){return"undefined"!=typeof FormData&&e instanceof FormData}var r_=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 Xb),this.context||(this.context=new e_),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}(),o_=((o_=o_||{})[o_.Sent=0]="Sent",o_[o_.UploadProgress=1]="UploadProgress",o_[o_.ResponseHeader=2]="ResponseHeader",o_[o_.DownloadProgress=3]="DownloadProgress",o_[o_.Response=4]="Response",o_[o_.User=5]="User",o_),a_=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 Xb,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},s_=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=o_.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}(a_),u_=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=o_.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}(a_),c_=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}(a_);function l_(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 h_=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 r_?n=e:(i=a.headers instanceof Xb?a.headers:new Xb(a.headers),a.params&&(r=a.params instanceof Jb?a.params:new Jb({fromObject:a.params})),n=new r_(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=$d(n).pipe(ke(function(e){return o.handler.handle(e)},void 0,1));if(e instanceof r_||"events"===a.observe)return s;var u=s.pipe(bf(function(e){return e instanceof u_}));switch(a.observe||"body"){case"body":switch(n.responseType){case"arraybuffer":return u.pipe(ce(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(ce(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(ce(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(ce(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,l_(n,t))}},{key:"post",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.request("POST",e,l_(n,t))}},{key:"put",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.request("PUT",e,l_(n,t))}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Zi(Wb))},e.\u0275prov=$e({token:e,factory:e.\u0275fac}),e}(),d_=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}(),f_=new Ri("HTTP_INTERCEPTORS"),p_=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=$e({token:e,factory:e.\u0275fac}),e}(),v_=/^\)\]\}',?\n/,g_=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 te(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 Xb(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 s_({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(v_,"");try{c=""!==c?JSON.parse(c):null}catch(d){c=h,l&&(l=!1,c={error:d,text:c})}}l?(n.next(new u_({body:c,headers:r,status:o,statusText:a,url:s||void 0})),n.complete()):n.error(new c_({error:c,headers:r,status:o,statusText:a,url:s||void 0}))},l=function(e){var t=u().url,r=new c_({error:e,status:i.status||0,statusText:i.statusText||"Unknown Error",url:t||void 0});n.error(r)},h=!1,d=function(t){h||(n.next(u()),h=!0);var r={type:o_.DownloadProgress,loaded:t.loaded};t.lengthComputable&&(r.total=t.total),"text"===e.responseType&&!!i.responseText&&(r.partialText=i.responseText),n.next(r)},f=function(e){var t={type:o_.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",d),null!==a&&i.upload&&i.upload.addEventListener("progress",f)),i.send(a),n.next({type:o_.Sent}),function(){i.removeEventListener("error",l),i.removeEventListener("abort",l),i.removeEventListener("load",c),i.removeEventListener("timeout",l),e.reportProgress&&(i.removeEventListener("progress",d),null!==a&&i.upload&&i.upload.removeEventListener("progress",f)),i.readyState!==i.DONE&&i.abort()}})}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Zi(fd))},e.\u0275prov=$e({token:e,factory:e.\u0275fac}),e}(),m_=new Ri("XSRF_COOKIE_NAME"),y_=new Ri("XSRF_HEADER_NAME"),b_=function e(){m(this,e)},__=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=Hh(e,this.cookieName),this.lastCookieString=e),this.lastToken}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Zi(bh),Zi(Ml),Zi(m_))},e.\u0275prov=$e({token:e,factory:e.\u0275fac}),e}(),w_=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)(Zi(b_),Zi(y_))},e.\u0275prov=$e({token:e,factory:e.\u0275fac}),e}(),k_=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(f_,[]);this.chain=t.reduceRight(function(e,t){return new d_(e,t)},this.backend)}return this.chain.handle(e)}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Zi(qb),Zi(ss))},e.\u0275prov=$e({token:e,factory:e.\u0275fac}),e}(),x_=function(){var e=function(){function e(){m(this,e)}return b(e,null,[{key:"disable",value:function(){return{ngModule:e,providers:[{provide:w_,useClass:p_}]}}},{key:"withOptions",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{ngModule:e,providers:[t.cookieName?{provide:m_,useValue:t.cookieName}:[],t.headerName?{provide:y_,useValue:t.headerName}:[]]}}}]),e}();return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({providers:[w_,{provide:f_,useExisting:w_,multi:!0},{provide:b_,useClass:__},{provide:m_,useValue:"XSRF-TOKEN"},{provide:y_,useValue:"X-XSRF-TOKEN"}]}),e}(),S_=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({providers:[h_,{provide:Wb,useClass:k_},g_,{provide:qb,useExisting:g_}],imports:[[x_.withOptions({cookieName:"XSRF-TOKEN",headerName:"X-XSRF-TOKEN"})]]}),e}(),C_=["*"];function E_(e){return Error('Unable to find icon with the name "'.concat(e,'"'))}function O_(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 T_(e){return Error("The literal provided to MatIconRegistry was not trusted as safe HTML by Angular's DomSanitizer. Attempted literal was \"".concat(e,'".'))}var P_=function e(t,n,i){m(this,e),this.url=t,this.svgText=n,this.options=i},A_=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 P_(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(Wr.HTML,n);if(!r)throw T_(n);return this._addSvgIconConfig(e,t,new P_("",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 P_(t,null,n))}},{key:"addSvgIconSetLiteralInNamespace",value:function(e,t,n){var i=this._sanitizer.sanitize(Wr.HTML,t);if(!i)throw T_(t);return this._addSvgIconSetConfig(e,new P_("",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(Wr.RESOURCE_URL,e);if(!n)throw O_(e);var i=this._cachedIconsByUrl.get(n);return i?$d(M_(i)):this._loadSvgIconFromConfig(new P_(e,null)).pipe(mv(function(e){return t._cachedIconsByUrl.set(n,e)}),ce(function(e){return M_(e)}))}},{key:"getNamedSvgIcon",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=I_(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):Rf(E_(n))}},{key:"ngOnDestroy",value:function(){this._resolvers=[],this._svgIconConfigs.clear(),this._iconSetConfigs.clear(),this._cachedIconsByUrl.clear()}},{key:"_getSvgFromConfig",value:function(e){return e.svgText?$d(M_(this._svgElementFromConfig(e))):this._loadSvgIconFromConfig(e).pipe(ce(function(e){return M_(e)}))}},{key:"_getSvgFromIconSetConfigs",value:function(e,t){var n=this,i=this._extractIconWithNameFromAnySet(e,t);return i?$d(i):jb(t.filter(function(e){return!e.svgText}).map(function(e){return n._loadSvgIconSetFromConfig(e).pipe(Bb(function(t){var i="Loading icon set URL: ".concat(n._sanitizer.sanitize(Wr.RESOURCE_URL,e.url)," failed: ").concat(t.message);return n._errorHandler.handleError(new Error(i)),$d(null)}))})).pipe(ce(function(){var i=n._extractIconWithNameFromAnySet(e,t);if(!i)throw E_(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(mv(function(t){return e.svgText=t}),ce(function(){return t._svgElementFromConfig(e)}))}},{key:"_loadSvgIconSetFromConfig",value:function(e){return e.svgText?$d(null):this._fetchIcon(e).pipe(mv(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",G_=["mat-button","mat-flat-button","mat-icon-button","mat-raised-button","mat-stroked-button","mat-mini-fab","mat-fab"],W_=ab(ob(sb(function(){return function e(t){m(this,e),this._elementRef=t}}()))),q_=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=_(G_);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 $_(e,n,i);if(!r.closed)return t instanceof te?t.subscribe(r):ge(t)(r)}var Z_={};function J_(){for(var e=arguments.length,t=new Array(e),n=0;n visible",pg("150ms cubic-bezier(0, 0, 0.2, 1)")),yg("* => void, * => hidden",pg("75ms cubic-bezier(0.4, 0.0, 1, 1)",gg({opacity:0})))])},gw=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 ae,s._onExit=new ae,s._onEnter=new ae,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(_p(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}(fp);return e.\u0275fac=function(t){return new(t||e)(Os(Xl),Os(Ju),Os(Cc),Os(qf),Os(hw))},e.\u0275cmp=Ot({type:e,selectors:[["snack-bar-container"]],viewQuery:function(e,t){var n;(1&e&&yl(mp,7),2&e)&&(ml(n=_l())&&(t._portalOutlet=n.first))},hostAttrs:[1,"mat-snack-bar-container"],hostVars:1,hostBindings:function(e,t){1&e&&zs("@state.done",function(e){return t.onAnimationEnd(e)}),2&e&&Mu("@state",t._animationState)},features:[cs],decls:3,vars:2,consts:[["aria-hidden","true"],["cdkPortalOutlet",""]],template:function(e,t){1&e&&(As(0,"div",0),Cs(1,cw,0,0,"ng-template",1),Ms(),Is(2,"div")),2&e&&(Yo(2),ks("aria-live",t._live)("role",t._role))},directives:[mp],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:[vw.snackBarState]}}),e}(),mw=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({imports:[[cv,yp,cd,Y_,rb],rb]}),e}(),yw=new Ri("mat-snack-bar-default-options",{providedIn:"root",factory:function(){return new hw}}),bw=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=pw,this.snackBarContainerComponent=gw,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=ss.create({parent:t&&t.viewContainerRef&&t.viewContainerRef.injector||this._injector,providers:[{provide:hw,useValue:t}]}),i=new lp(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 hw),this._defaultConfig),t),r=this._createOverlay(i),o=this._attachSnackBarContainer(r,i),a=new fw(o,r);if(e instanceof Ac){var s=new hp(e,null,{$implicit:i.data,snackBarRef:a});a.instance=o.attachTemplatePortal(s)}else{var u=this._createInjector(i,a),c=new lp(e,void 0,u),l=o.attachComponentPortal(c);a.instance=l.instance}return this._breakpointObserver.observe("(max-width: 599.98px) and (orientation: portrait)").pipe(kf(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 Np;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 ss.create({parent:e&&e.viewContainerRef&&e.viewContainerRef.injector||this._injector,providers:[{provide:fw,useValue:t},{provide:lw,useValue:e.data}]})}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Zi(iv),Zi(tg),Zi(ss),Zi(aw),Zi(e,12),Zi(yw))},e.\u0275prov=$e({factory:function(){return new e(Zi(iv),Zi(tg),Zi(Xa),Zi(aw),Zi(e,12),Zi(yw))},token:e,providedIn:mw}),e}(),_w={tooltipState:fg("state",[mg("initial, void, hidden",gg({opacity:0,transform:"scale(0)"})),mg("visible",gg({transform:"scale(1)"})),yg("* => visible",pg("200ms cubic-bezier(0, 0, 0.2, 1)",function(e){return{type:5,steps:e}}([gg({opacity:0,transform:"scale(0)",offset:0}),gg({opacity:.5,transform:"scale(0.99)",offset:.5}),gg({opacity:1,transform:"scale(1)",offset:1})]))),yg("* => hidden",pg("100ms cubic-bezier(0, 0, 0.2, 1)",gg({opacity:0})))])},ww="tooltip-panel",kw=$f({passive:!0}),xw=new Ri("mat-tooltip-scroll-strategy"),Sw={provide:xw,deps:[iv],useFactory:function(e){return function(){return e.scrollStrategies.reposition({scrollThrottle:20})}}},Cw=new Ri("mat-tooltip-default-options",{providedIn:"root",factory:function(){return{showDelay:0,hideDelay:0,touchendHideDelay:1500}}}),Ew=function(){var e=function(){function e(t,n,i,r,o,a,s,u,c,l,h,d){var f=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 ae,this._handleKeydown=function(e){f._isTooltipVisible()&&27===e.keyCode&&!Ep(e)&&(e.preventDefault(),e.stopPropagation(),f._ngZone.run(function(){return f.hide(0)}))},this._scrollStrategy=c,this._document=d,h&&(h.position&&(this.position=h.position),h.touchGestures&&(this.touchGestures=h.touchGestures)),l.change.pipe(kf(this._destroyed)).subscribe(function(){f._overlayRef&&f._updatePosition(f._overlayRef)}),o.runOutsideAngular(function(){n.nativeElement.addEventListener("keydown",f._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=Wd(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(kf(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,kw)}),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 lp(this._tooltipComponent,this._viewContainerRef),this._tooltipInstance=n.attach(this._portal).instance,this._tooltipInstance.afterHidden().pipe(kf(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(kf(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(ww),scrollStrategy:this._scrollStrategy()}),this._updatePosition(this._overlayRef),this._overlayRef.detachments().pipe(kf(this._destroyed)).subscribe(function(){return e._detach()}),this._overlayRef.outsidePointerEvents().pipe(kf(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(_p(1),kf(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(ww,"-");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,kw)})}},{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)(Os(iv),Os(Ju),Os(op),Os(Nc),Os(Xl),Os(qf),Os(Fv),Os(rg),Os(void 0),Os(tp),Os(void 0),Os(bh))},e.\u0275dir=Rt({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}(),Ow=function(){var e=function(e){a(n,e);var t=s(n);function n(e,i,r,o,a,s,u,c,l,h,d,f){var p;return m(this,n),(p=t.call(this,e,i,r,o,a,s,u,c,l,h,d,f))._tooltipComponent=Pw,p}return n}(Ew);return e.\u0275fac=function(t){return new(t||e)(Os(iv),Os(Ju),Os(op),Os(Nc),Os(Xl),Os(qf),Os(Fv),Os(rg),Os(xw),Os(tp,8),Os(Cw,8),Os(bh))},e.\u0275dir=Rt({type:e,selectors:[["","matTooltip",""]],hostAttrs:[1,"mat-tooltip-trigger"],exportAs:["matTooltip"],features:[cs]}),e}(),Tw=function(){var e=function(){function e(t){m(this,e),this._changeDetectorRef=t,this._visibility="initial",this._closeOnInteraction=!1,this._onHide=new ae}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)(Os(Cc))},e.\u0275dir=Rt({type:e}),e}(),Pw=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}(Tw);return e.\u0275fac=function(t){return new(t||e)(Os(Cc),Os(aw))},e.\u0275cmp=Ot({type:e,selectors:[["mat-tooltip-component"]],hostAttrs:["aria-hidden","true"],hostVars:2,hostBindings:function(e,t){2&e&&uu("zoom","visible"===t._visibility?1:null)},features:[cs],decls:3,vars:7,consts:[[1,"mat-tooltip",3,"ngClass"]],template:function(e,t){var n;(1&e&&(As(0,"div",0),Vs("@state.start",function(){return t._animationStart()})("@state.done",function(e){return t._animationDone(e)}),Jc(1,"async"),Cu(2),Ms()),2&e)&&(cu("mat-tooltip-handset",null==(n=el(1,5,t._isHandset))?null:n.matches),Ts("ngClass",t.tooltipClass)("@state",t._visibility),Yo(2),Eu(t.message))},directives:[Gh],pipes:[sd],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:[_w.tooltipState]},changeDetection:0}),e}(),Aw=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({providers:[Sw],imports:[[cg,cd,cv,rb],rb,sp]}),e}();function Mw(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 Iw(e,t){return function(n,i){t(n,i,e)}}function Rw(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function Dw(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 Nw(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 Lw(){return!("object"==typeof process&&"[object process]"===String(process)&&!process.browser)||Nw()}var jw="undefined"!=typeof __VERSION__?__VERSION__:"untranspiled source",Fw=Lw(),Bw=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 Vw(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 zw={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 Uw(e){return"string"==typeof e?zw[e.toUpperCase()]||zw.WHITE:e}function Hw(e,t){if(!e)throw new Error(t||"Assertion failed")}var Gw={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},Ww=Gw.window||Gw.self||Gw.global,qw=Gw.process||{};function Xw(){var e;if(Fw&&Ww.performance)e=Ww.performance.now();else if(qw.hrtime){var t=qw.hrtime();e=1e3*t[0]+t[1]/1e6}else e=Date.now();return e}console;var Yw={debug:Fw&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},Kw={enabled:!0,level:0};function $w(){}var Qw={},Zw={once:!0};function Jw(e){for(var t in e)for(var n in e[t])return n||"untitled";return"empty"}var ek=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=jw,this._startTs=Xw(),this._deltaTs=Xw(),this.LOG_THROTTLE_TIMEOUT=0,this._storage=new Bw("__probe-".concat(this.id,"__"),Kw),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((Xw()-this._startTs).toPrecision(10))}},{key:"getDelta",value:function(){return Number((Xw()-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){Hw(e,t)}},{key:"warn",value:function(e){return this._getLogFunction(0,e,Yw.warn,arguments,Zw)}},{key:"error",value:function(e){return this._getLogFunction(0,e,Yw.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,Yw.log,arguments,{time:!0,once:!0})}},{key:"log",value:function(e,t){return this._getLogFunction(e,t,Yw.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,Yw.debug||Yw.info,arguments,Zw)}},{key:"table",value:function(e,t,n){return t?this._getLogFunction(e,t,console.table||$w,n&&[n],{tag:Jw(t)}):$w}},{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)?Fw?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=Vw(s,r,a);(e=console).log.apply(e,v(t))},s.src=n,$w}var u=n.nodeName||"";if("img"===u.toLowerCase())return(t=console).log.apply(t,v(Vw(n,r,a))),$w;if("canvas"===u.toLowerCase()){var c=new Image;return c.onload=function(){var e;return(e=console).log.apply(e,v(Vw(c,r,a)))},c.src=n.toDataURL(),$w}return $w}({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)})}:$w}({image:i,message:a,scale:u}):$w}},{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||$w)}},{key:"group",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{collapsed:!1},i=n=nk({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||$w)}},{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()>=tk(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=nk({logLevel:e,message:t,args:i,opts:r}),Hw(n=n||r.method),r.total=this.getTotal(),r.delta=this.getDelta(),this._deltaTs=Xw();var a=r.tag||r.message;if(r.once){if(Qw[a])return $w;Qw[a]=Xw()}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!Fw&&"string"==typeof e&&(t&&(t=Uw(t),e="\x1b[".concat(t,"m").concat(e,"\x1b[39m")),n&&(t=Uw(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 $w}}]),e}();return e.VERSION=jw,e}();function tk(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 Hw(Number.isFinite(t)&&t>=0),t}function nk(e){var t=e.logLevel,n=e.message;e.logLevel=tk(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 Hw("string"===r||"object"===r),Object.assign(e,e.opts)}var ik=new ek({id:"deck"}),rk={DEFAULT:-1,LNGLAT:1,METER_OFFSETS:2,LNGLAT_OFFSETS:3,CARTESIAN:0};Object.defineProperty(rk,"IDENTITY",{get:function(){return ik.deprecated("COORDINATE_SYSTEM.IDENTITY","COORDINATE_SYSTEM.CARTESIAN")()||0}});var ok={WEB_MERCATOR:1,GLOBE:2,WEB_MERCATOR_AUTO_OFFSET:4,IDENTITY:0},ak={click:{handler:"onClick"},panstart:{handler:"onDragStart"},panmove:{handler:"onDrag"},panend:{handler:"onDragEnd"}},sk=new ek({id:"luma.gl"});function uk(e,t){if(!e)throw new Error(t||"luma.gl: assertion failed.")}function ck(e){return"undefined"!=typeof WebGLRenderingContext&&e instanceof WebGLRenderingContext||"undefined"!=typeof WebGL2RenderingContext&&e instanceof WebGL2RenderingContext||Boolean(e&&Number.isFinite(e._version))}function lk(e){return"undefined"!=typeof WebGL2RenderingContext&&e instanceof WebGL2RenderingContext||Boolean(e&&2===e._version)}function hk(e){return uk(ck(e),"Invalid WebGLRenderingContext"),e}function dk(e){return uk(lk(e),"Requires WebGL2"),e}var fk={},pk=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||Sk)){var n=t,i=Dk[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=Dk[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({},Sk),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(){uk(this.stateStack.length>0),Uk(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){uk(void 0!==r);var o=e[r],a=this.cache[r];Lk(o,a)||(n=!0,t=a,i&&!(r in i)&&(i[r]=a),this.cache[r]=o)}return{valueChanged:n,oldValue:t}}}]),e}();function Vk(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.enable,i=void 0===n||n,r=t.copyState;if(uk(void 0!==r),!e.state){var o=globalThis.polyfillContext;for(var a in o&&o(e),e.state=new Bk(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),Ik)Fk(e,a,Ik[a]);jk(e,"getParameter"),jk(e,"isEnabled")}return e.state.enable=i,e}function zk(e){uk(e.state),e.state.pop()}function Uk(e,t){if(uk(ck(e),"setParameters requires a WebGL context"),!Nk(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)Mk[s](e,t,a)}}function Hk(e,t,n){if(Nk(t))return n(e);var i,r=t.nocatch,o=void 0===r||r;if(function(e){e.state||Vk(e,{copyState:!1}),e.state.push()}(e),Uk(e,t),o)i=n(e),zk(e);else try{i=n(e)}finally{zk(e)}return i}function Gk(){return!("object"==typeof process&&"[object process]"===String(process)&&!process.browser)||function(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;return!!(t&&t.indexOf("Electron")>=0)}()}function Wk(e){var t=e.luma;if(e.canvas&&t){var n=t.canvasSizeInfo.clientWidth;return n?e.drawingBufferWidth/n:1}return 1}function qk(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return function(e,t,n,i,r){var o,a=Xk(e[0],t,n),s=Yk(e[1],t,i,r),u=Xk(e[0]+1,t,n),c=u===n-1?u:u-1;return u=Yk(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,Wk(e),e.drawingBufferWidth,e.drawingBufferHeight,n)}function Xk(e,t,n){return Math.min(Math.round(e*t),n-1)}function Yk(e,t,n,i){return i?Math.max(0,n-1-Math.round(e*t)):Math.min(Math.round(e*t),n-1)}var Kk=Gk(),$k=Kk&&"undefined"!=typeof document,Qk={webgl2:!0,webgl1:!0,throwOnError:!0,manageState:!0,canvas:null,debug:!1,width:800,height:600};function Zk(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};uk(Kk,"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({},Qk,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?($k&&"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=lk(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);sk.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({},Qk,t),i=n.manageState,r=n.debug;return i&&Vk(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}(),nx=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 tx?e:new tx(t,n)),this.stats[t]}}]),e}(),ix="8.5.12",rx=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 nx({id:e})),this.stats.get(e)}}]),e}());if(globalThis.luma&&globalThis.luma.VERSION!==ix)throw new Error("luma.gl - multiple VERSIONs detected: ".concat(globalThis.luma.VERSION," vs ").concat(ix));function ox(e,t){if(!e)throw new Error(t||"luma.gl: assertion failed.")}function ax(e,t){if("string"!=typeof t)return t;var n=Number(t);if(!isNaN(n))return n;var i=e[t=t.replace(/^.*\./,"")];return ox(void 0!==i,"Accessing undefined constant GL.".concat(t)),i}function sx(e,t){for(var n in t=Number(t),e)if(e[n]===t)return"GL.".concat(n);return String(t)}globalThis.luma||(Gk()&&sk.log(1,"luma.gl ".concat(ix," - set luma.log.level=1 (or higher) to trace rendering"))(),globalThis.luma=globalThis.luma||{VERSION:ix,version:ix,log:sk,stats:rx,globals:{modules:{},nodeIO:{}}}),globalThis;var ux={};function cx(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"id";return ux[e]=ux[e]||1,"".concat(e,"-").concat(ux[e]++)}function lx(e){return ox("number"==typeof e,"Input must be a number"),e&&0==(e&e-1)}function hx(e){var t=!0;for(var n in e){t=!1;break}return t}function dx(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 sk.removed("Calling removed method ".concat(t,".").concat(e,": "),r)(),new Error(e)})})}var fx="Resource subclass must define virtual methods",px=function(e){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};m(this,t),hk(e);var i=n.id,r=n.userData,o=void 0===r?{}:r;this.gl=e,this.gl2=e,this.id=i||cx(this[Symbol.toStringTag]),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(t,[{key:Symbol.toStringTag,get:function(){return"Resource"}},{key:"toString",value:function(){return"".concat(this[Symbol.toStringTag]||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]:{};ox(e=ax(this.gl,e));var n=(this.constructor.PARAMETERS||{})[e];if(n){var i=lk(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=lk(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?sx(this.gl,c):c;a[h]=this.getParameter(c,t),i&&"GLenum"===l.type&&(a[h]=sx(this.gl,a[h]))}}}catch(d){u.e(d)}finally{u.f()}return a}},{key:"setParameter",value:function(e,t){ox(e=ax(this.gl,e));var n=(this.constructor.PARAMETERS||{})[e];if(n){var i=lk(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=ax(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 dx(this,e,t,n)}},{key:"initialize",value:function(e){}},{key:"_createHandle",value:function(){throw new Error(fx)}},{key:"_deleteHandle",value:function(){throw new Error(fx)}},{key:"_bindHandle",value:function(e){throw new Error(fx)}},{key:"_getOptsFromHandle",value:function(){throw new Error(fx)}},{key:"_getParameter",value:function(e,t){throw new Error(fx)}},{key:"_setParameter",value:function(e,t){throw new Error(fx)}},{key:"_context",value:function(){return this.gl.luma=this.gl.luma||{},this.gl.luma}},{key:"_addStats",value:function(){var e=this[Symbol.toStringTag],t=rx.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[Symbol.toStringTag];rx.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[Symbol.toStringTag],n=rx.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[Symbol.toStringTag],t=rx.get("Memory Usage");t.get("GPU Memory").subtractCount(this.byteLength),t.get("".concat(e," Memory")).subtractCount(this.byteLength),this.byteLength=0}}]),t}();function vx(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 gx(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 mx(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=yx("Accessor",e,_x)).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 gx(e.type||5126).BYTES_PER_ELEMENT}},{key:"getBytesPerVertex",value:function(e){return ox(e.size),gx(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,i),(t=n.call(this,e,r)).stubRemovedMethods("Buffer","v6.0",["layout","setLayout","getIndexedParameter"]),t.target=r.target||(t.gl.webgl2?36662:34962),t.initialize(r),Object.seal(c(t)),t}return b(i,[{key:t,get:function(){return"Buffer"}},{key:"getElementCount",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.accessor;return Math.round(this.byteLength/wx.getBytesPerElement(e))}},{key:"getVertexCount",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.accessor;return Math.round(this.byteLength/wx.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=yx("Buffer",e,xx),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=yx("Buffer",e,Sx))&&this.setAccessor(e.accessor),this}},{key:"setAccessor",value:function(e){return delete(e=Object.assign({},e)).buffer,this.accessor=new wx(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;ox(n);var u=this.gl.webgl2?36663:this.target;return this.gl.bindBuffer(u,this.handle),0!==a||void 0!==s?(dk(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 dk(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;dk(this.gl);var c,l,h=gx(this.accessor.type||5126,{clamped:!1}),d=this._getAvailableElementCount(r),f=a;n?c=(l=n.length)-f:l=f+(c=Math.min(d,u||d));var p=Math.min(d,c);return ox((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):(ox(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;ox(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=vx(e);return ox(r),this.setAccessor(new wx(this.accessor,{type:r})),this}},{key:"_setByteLength",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.usage;ox(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/gx(this.accessor.type||5126,{clamped:!1}).BYTES_PER_ELEMENT;return this.getElementCount()-t}},{key:"_inferType",value:function(e){this.accessor.type||this.setAccessor(new wx(this.accessor,{type:vx(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 sk.deprecated("Buffer.type","Buffer.accessor.type")(),this.accessor.type}},{key:"bytes",get:function(){return sk.deprecated("Buffer.bytes","Buffer.byteLength")(),this.byteLength}},{key:"setByteLength",value:function(e){return sk.deprecated("setByteLength","reallocate")(),this.reallocate(e)}},{key:"updateAccessor",value:function(e){return sk.deprecated("updateAccessor(...)","setAccessor(new Accessor(buffer.accessor, ...)")(),this.accessor=new wx(this.accessor,e),this}}]),i}(px,Symbol.toStringTag),Ex={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}},Ox={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},Tx={5126:4,5125:4,5124:4,5123:2,5122:2,5131:2,5120:1,5121:1},Px=[9729,9728],Ax=globalThis.WebGLBuffer||function(){},Mx=function(e,n){a(r,e);var i=s(r);function r(e,t){var n;m(this,r);var o=t.id,a=void 0===o?cx("texture"):o,s=t.handle,u=t.target;return(n=i.call(this,e,{id:a,handle:s})).target=u,n.textureUnit=void 0,n.loaded=!1,n.width=void 0,n.height=void 0,n.depth=void 0,n.format=void 0,n.type=void 0,n.dataFormat=void 0,n.border=void 0,n.textureUnit=void 0,n.mipmaps=void 0,n}return b(r,[{key:n,get:function(){return"Texture"}},{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()?(sk.warn("texture: ".concat(this," is Non-Power-Of-Two, disabling mipmaping"))(),this):(this.mipmaps=!0,this.gl.bindTexture(this.target,this.handle),Hk(this.gl,t,function(){e.gl.generateMipmap(e.target)}),this.gl.bindTexture(this.target,null),this)}},{key:"setImageData",value:function(e){var n;this._trackDeallocatedMemory("Texture");var i=e.target,r=void 0===i?this.target:i,o=e.pixels,a=void 0===o?null:o,s=e.level,u=void 0===s?0:s,c=e.format,l=void 0===c?this.format:c,h=e.border,d=void 0===h?this.border:h,f=e.offset,p=void 0===f?0:f,v=e.parameters,g=void 0===v?{}:v,m=e.data,y=void 0===m?null:m,b=e.type,w=void 0===b?this.type:b,k=e.width,x=void 0===k?this.width:k,S=e.height,C=void 0===S?this.height:S,E=e.dataFormat,O=void 0===E?this.dataFormat:E,T=e.compressed,P=void 0!==T&&T;y||(y=a),n=this._deduceParameters({format:l,type:w,dataFormat:O,compressed:P,data:y,width:x,height:C}),w=n.type,O=n.dataFormat,P=n.compressed,x=n.width,C=n.height;var A=this.gl;A.bindTexture(this.target,this.handle);var M,I=this._getDataType({data:y,compressed:P});y=I.data,M=I.dataType;var R,D=0;return Hk(this.gl,g,function(){switch(M){case"null":A.texImage2D(r,u,l,x,C,d,O,w,y);break;case"typed-array":A.texImage2D(r,u,l,x,C,d,O,w,y,p);break;case"buffer":(R=dk(A)).bindBuffer(35052,y.handle||y),R.texImage2D(r,u,l,x,C,d,O,w,p),R.bindBuffer(35052,null);break;case"browser-object":lk(A)?A.texImage2D(r,u,l,x,C,d,O,w,y):A.texImage2D(r,u,l,O,w,y);break;case"compressed":var e,n=_(y.entries());try{for(n.s();!(e=n.n()).done;){var i=t(e.value,2),o=i[0],a=i[1];A.compressedTexImage2D(r,o,a.format,a.width,a.height,d,a.data),D+=a.levelSize}}catch(s){n.e(s)}finally{n.f()}break;default:ox(!1,"Unknown image data type")}}),this._trackAllocatedMemory("compressed"===M?D:y&&y.byteLength?y.byteLength:this.width*this.height*(Ox[this.dataFormat]||4)*(Tx[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,d=void 0===h?0:h,f=e.width,p=void 0===f?this.width:f,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,C=e.compressed,E=void 0!==C&&C,O=e.offset,T=void 0===O?0:O,P=e.border,A=(void 0===P&&this.border,e.parameters),M=void 0===A?{}:A;if(t=this._deduceParameters({format:_,type:k,dataFormat:S,compressed:E,data:u,width:p,height:g}),k=t.type,S=t.dataFormat,E=t.compressed,p=t.width,g=t.height,ox(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),Hk(this.gl,M,function(){if(E)n.gl.compressedTexSubImage2D(r,y,l,d,p,g,_,u);else if(null===u)n.gl.texSubImage2D(r,y,l,d,p,g,S,k,null);else if(ArrayBuffer.isView(u))n.gl.texSubImage2D(r,y,l,d,p,g,S,k,u,T);else if(u instanceof Ax){var e=dk(n.gl);e.bindBuffer(35052,u),e.texSubImage2D(r,y,l,d,p,g,S,k,T),e.bindBuffer(35052,null)}else lk(n.gl)?dk(n.gl).texSubImage2D(r,y,l,d,p,g,S,k,u):n.gl.texSubImage2D(r,y,l,d,S,k,u)}),this.gl.bindTexture(this.target,null)}},{key:"copyFramebuffer",value:function(){return sk.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 Ax?{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=Ex[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 ox(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"),ox(void 0===t||i.width===t,"Deduced texture width does not match supplied width"),ox(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:ox(!1);break;default:this.gl.texParameteri(this.target,e,t)}return this.gl.bindTexture(this.target,null),this}},{key:"_isNPOT",value:function(){return!(lk(this.gl)||!this.width||!this.height||lx(this.width)&&lx(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===Px.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=Ex[t];if(!n)return!1;if(void 0===n.gl1&&void 0===n.gl2)return!0;var i=lk(e)&&n.gl2||n.gl1;return"string"==typeof i?e.getExtension(i):i}(e,n))&&(!i||function(e,t){var n=Ex[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}}]),r}(px,Symbol.toStringTag);function Ix(e,t){return ox("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 Rx=function(e,t){a(i,e);var n=s(i);function i(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return m(this,i),hk(e),(r instanceof Promise||"string"==typeof r)&&(r={data:r}),"string"==typeof r.data&&(r=Object.assign({},r,{data:Ix(r.data)})),(t=n.call(this,e,Object.assign({},r,{target:3553}))).initialize(r),Object.seal(c(t)),t}return b(i,[{key:t,get:function(){return"Texture2D"}}],[{key:"isSupported",value:function(e,t){return Mx.isSupported(e,t)}}]),i}(Mx,Symbol.toStringTag),Dx="EXT_color_buffer_float",Nx={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:Dx,bpp:2},33327:{gl2:Dx,bpp:4},34842:{gl2:Dx,bpp:8},33326:{gl2:Dx,bpp:4},33328:{gl2:Dx,bpp:8},34836:{gl2:Dx,bpp:16},35898:{gl2:Dx,bpp:4}},Lx=function(e,t){a(i,e);var n=s(i);function i(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return m(this,i),(t=n.call(this,e,r)).initialize(r),Object.seal(c(t)),t}return b(i,[{key:t,get:function(){return"Renderbuffer"}},{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 ox(t,"Needs format"),this._trackDeallocatedMemory(),this.gl.bindRenderbuffer(36161,this.handle),0!==s&&lk(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)*Nx[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=lk(e)&&i.gl2||i.gl1;return"string"==typeof r?e.getExtension(r):r}(e,n,Nx)}},{key:"getSamplesForFormat",value:function(e,t){var n=t.format;return e.getInternalformatParameter(36161,n,32937)}}]),i}(px,Symbol.toStringTag),jx="clear: bad arguments";function Fx(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)),ox(0!==h,jx),Hk(e,l,function(){e.clear(h)})}function Bx(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 Vx(e){return function(){var t=this,n=arguments;return new Promise(function(i,r){var o=e.apply(t,n);function a(e){Bx(o,i,r,a,s,"next",e)}function s(e){Bx(o,i,r,a,s,"throw",e)}a(void 0)})}}var zx=[34069,34070,34071,34072,34073,34074],Ux=function(){var e=function(e,t){a(i,e);var n=s(i);function i(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return m(this,i),hk(e),(t=n.call(this,e,Object.assign({},r,{target:34067}))).initialize(r),Object.seal(c(t)),t}return b(i,[{key:t,get:function(){return"TextureCube"}},{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 Vx(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(zx.map(function(e){var t=s[e];return Promise.all(Array.isArray(t)?t:[t])}));case 4:c=e.sent,h.bind(),zx.forEach(function(e,i){c[i].length>1&&!1!==h.opts.mipmaps&&sk.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,d=void 0===h?5121:h,f=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?f.texImage2D(n,0,l,i,r,u,l,d,p):f.texImage2D(n,0,l,l,d,p),this}}]),i}(Mx,Symbol.toStringTag);return e.FACES=zx,e}(),Hx=function(e,t){a(i,e);var n=s(i);function i(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return m(this,i),dk(e),(t=n.call(this,e,r=Object.assign({depth:1},r,{target:32879,unpackFlipY:!1}))).initialize(r),Object.seal(c(t)),t}return b(i,[{key:t,get:function(){return"Texture3D"}},{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,d=e.format,f=e.type,p=void 0===f?5121:f,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),Hk(this.gl,b,function(){ArrayBuffer.isView(m)&&t.gl.texImage3D(t.target,i,o,a,s,c,h,d,p,m),m instanceof Cx&&(t.gl.bindBuffer(35052,m.handle),t.gl.texImage3D(t.target,i,o,a,s,c,h,d,p,g))}),this._trackAllocatedMemory(m&&m.byteLength?m.byteLength:this.width*this.height*this.depth*(Ox[this.dataFormat]||4)*(Tx[this.type]||1),"Texture"),this.loaded=!0,this}}],[{key:"isSupported",value:function(e){return lk(e)}}]),i}(Mx,Symbol.toStringTag);function Gx(e,t){ox(e instanceof Rx||e instanceof Ux||e instanceof Hx);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},t))}function Wx(e,t){var n=e.gl,i=e.width,r=e.height,o=e.id;return new $x(n,Object.assign({},t,{id:"framebuffer-for-".concat(o),width:i,height:r,attachments:{36064:e}}))}function qx(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,d=t.sourceWidth,f=t.sourceHeight,p=t.sourceType,v=Yx(e),g=v.framebuffer,m=v.deleteFramebuffer;ox(g);var y=g.gl,b=g.handle,_=g.attachments;d=d||g.width,f=f||g.height,36064===c&&null===b&&(c=1028),ox(_[c]),h=function(e,t,n,i,r){return e||new(gx(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 ox(!1),0}}(n))}(h,p=p||_[c].type,s,d,f),p=p||vx(h);var w=y.bindFramebuffer(36160,b);return y.readPixels(i,o,d,f,s,p,h),y.bindFramebuffer(36160,w||null),m&&g.delete(),h}function Xx(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=qx(e,{sourceAttachment:i}),s=e.width,u=e.height;u>o;){var c=mx({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,o),(t=r.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(o,[{key:i,get:function(){return"Framebuffer"}},{key:"MAX_COLOR_ATTACHMENTS",get:function(){var e=dk(this.gl);return e.getParameter(e.MAX_COLOR_ATTACHMENTS)}},{key:"MAX_DRAW_BUFFERS",get:function(){var e=dk(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,d=void 0!==h&&h,f=e.check,p=void 0===f||f,v=e.readBuffer,g=e.drawBuffers;if(ox(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,d,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(o.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 ox(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&&sk.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){ox(void 0!==l,"Misspelled framebuffer binding point?");var h=Number(l),d=u[h],f=d;if(f)if(f instanceof Lx)this._attachRenderbuffer({attachment:h,renderbuffer:f});else if(Array.isArray(d)){var p=t(d,3),v=p[0],g=p[1],m=void 0===g?0:g,y=p[2],b=void 0===y?0:y;f=v,this._attachTexture({attachment:h,texture:v,layer:m,level:b})}else this._attachTexture({attachment:h,texture:f,layer:0,level:0});else this._unattach(h);s&&f&&f.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(o.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)&&Fx(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;dk(e),Hk(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:ox(!1,jx)}})}(e.gl,{drawBuffer:i,value:n})}),this.gl.bindFramebuffer(36160,u||null),this}},{key:"readPixels",value:function(){return sk.error("Framebuffer.readPixels() is no logner supported, use readPixelsToArray(framebuffer)")(),null}},{key:"readPixelsToBuffer",value:function(){return sk.error("Framebuffer.readPixelsToBuffer()is no logner supported, use readPixelsToBuffer(framebuffer)")(),null}},{key:"copyToDataUrl",value:function(){return sk.error("Framebuffer.copyToDataUrl() is no logner supported, use copyToDataUrl(framebuffer)")(),null}},{key:"copyToImage",value:function(){return sk.error("Framebuffer.copyToImage() is no logner supported, use copyToImage(framebuffer)")(),null}},{key:"copyToTexture",value:function(){return sk.error("Framebuffer.copyToTexture({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null}},{key:"blit",value:function(){return sk.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=dk(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=sx(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?sx(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>sk.level||"undefined"==typeof window)return this;t=t||"Framebuffer ".concat(this.id);var n=Xx(this,{targetMaxHeight:100});return sk.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 Rx(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 Lx(this.gl,{id:"".concat(this.id,"-depth-stencil"),format:35056,width:i,height:111}),this.ownResources.push(o[33306])):t?((o=o||{})[36096]=new Lx(this.gl,{id:"".concat(this.id,"-depth"),format:33189,width:i,height:r}),this.ownResources.push(o[36096])):n&&ox(!1),o}},{key:"_unattach",value:function(e){var t=this.attachments[e];!t||(t instanceof Lx?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:dk(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:ox(!1,"Illegal texture type")}a.bindTexture(i.target,null),this.attachments[n]=i}},{key:"_setReadBuffer",value:function(e){var t=function(e){return lk(e)?e:null}(this.gl);t?t.readBuffer(e):ox(36064===e||1029===e,Kx),this.readBuffer=e}},{key:"_setDrawBuffers",value:function(e){var t=this.gl,n=dk(t);if(n)n.drawBuffers(e);else{var i=t.getExtension("WEBGL_draw_buffers");i?i.drawBuffersWEBGL(e):ox(1===e.length&&(36064===e[0]||1029===e[0]),Kx)}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||{},Qx)void 0===e.luma.caps[t]&&(e.luma.caps[t]=eS(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 o(e,{id:"default-framebuffer",handle:null,attachments:{}}),e.luma.defaultFramebuffer}}]),o}(px,Symbol.toStringTag);$x.ATTACHMENT_PARAMETERS=[36049,36048,33296,33298,33299,33300,33301,33302,33303];var Qx={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 Rx(e,{format:6408,type:5126,dataFormat:6408}),n=new $x(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 Zx(e,t){return Jx(e,t)}function Jx(e,t){return(t=Array.isArray(t)?t:[t]).every(function(t){return eS(e,t)})}function eS(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=Qx[t];ox(i,t);var r=lk(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:ox(!1);return n}(e,t)),e.luma.caps[t]||sk.log(2,"Feature: ".concat(t," not supported"))(),e.luma.caps[t]}var tS=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}()),iS=1/Math.PI*180,rS=1/180*Math.PI,oS={};function aS(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.precision,i=void 0===n?oS.precision||4:n;return e=function(e){return Math.round(e/oS.EPSILON)*oS.EPSILON}(e),"".concat(parseFloat(e.toPrecision(i)))}function sS(e){return Array.isArray(e)||ArrayBuffer.isView(e)&&!(e instanceof DataView)}function uS(e,t,n){if(sS(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?", ":"")+aS(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(oS.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&&sS(i)?e.copy(i):(oS.debug&&(gS(i),gS(r),gS(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 oS.debug&&(gS(e.x),gS(e.y),gS(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]=gS(e)}},{key:"angle",value:function(e){return RS(this,e)}},{key:"cross",value:function(e){return ES(this,this,e),this.check()}},{key:"rotateX",value:function(e){var t=e.radians,n=e.origin;return AS(this,this,void 0===n?LS:n,t),this.check()}},{key:"rotateY",value:function(e){var t=e.radians,n=e.origin;return MS(this,this,void 0===n?LS:n,t),this.check()}},{key:"rotateZ",value:function(e){var t=e.radians,n=e.origin;return IS(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 OS(this,this,e),this.check()}},{key:"transformAsVector",value:function(e){return DS(this,this,e),this.check()}},{key:"transformByMatrix3",value:function(e){return TS(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 PS(this,this,e),this.check()}}],[{key:"ZERO",get:function(){return jS.ZERO=jS.ZERO||Object.freeze(new n(0,0,0,0))}}]),n}(_S),BS=new FS;function VS(e,t,n,i){BS.set(e,t,n);var r=BS.len();return{distance:i/r,normal:new FS(-e/r,-t/r,-n/r)}}function zS(e){return e-Math.fround(e)}function US(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;NS=nS.allocate(NS,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=qS,r={index:-1,data:e,target:[]};return e?"function"==typeof e[Symbol.iterator]?i=e:e.length>0&&(XS.length=e.length,i=XS):i=qS,(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 KS(e){return e&&e[Symbol.asyncIterator]}function $S(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){return!0};return Array.isArray(e)?QS(e,t,[]):t(e)?[e]:[]}function QS(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=f)){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(f);(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 tC({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,d=void 0===h?null:h,f=n.transform,p=void 0===f?null:f,v=n.startIndices,g=void 0===v?null:v;return Object.assign(t.settings,{transition:a,noAlloc:u,update:l||d&&t._autoUpdater,accessor:d,transform:p}),Object.assign(t.state,{lastExternalBuffer:null,binaryValue:null,binaryAccessor:null,needsUpdate:!0,needsRedraw:!1,updateRanges:eC,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 iC(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===eC||(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=eC}},{key:"clearNeedsUpdate",value:function(){this.state.needsUpdate=!1,this.state.updateRanges=JS}},{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!==eC}),!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,d=!0;if(l){var f,v=_(u);try{for(v.s();!(f=v.n()).done;){var g=t(f.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?(WS(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,d=0;dl?c.set(x,g):(e._normalizeValue(x,b.target,0),ZS({target:c,source:b.target,start:g,count:S}));g+=S*l}else e._normalizeValue(x,c,g),g+=l}}catch(P){w.e(P)}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&&Zx(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*HS(e):0}},{key:"delete",value:function(){this._buffer&&(this._buffer.delete(),this._buffer=null),nS.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=GS(e,t);return{high:n,low:I(M({},n),{offset:n.offset+4*e.size})}}(this.getAccessor(),t||{});return n[e]=new tS(this,r.high),n["".concat(e,"64Low")]=i?new tS(this,r.low):new Float32Array(this.size),n}if(t){var a=GS(this.getAccessor(),t);return o({},e,new tS(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=HS(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=HS(n);var s=this.buffer,u=this.byteOffset;this.doublePrecision&&a instanceof Float64Array&&(a=US(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?US(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=nS.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&&lC[e]&&(t=lC[e]).call.apply(t,arguments)}function dC(e,t){if(!e)throw new Error(t||"shadertools: assertion failed.")}var fC="out vec4 transform_output;\nvoid main() {\n transform_output = vec4(0);\n}",pC="#version 300 es\n".concat(fC);function vC(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 gC(){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?pC:n>300?"#version ".concat(n,"\n").concat(fC):"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 dC(!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 mC=function(e,t){a(i,e);var n=s(i);function i(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return m(this,i),dk(e),(t=n.call(this,e,r)).initialize(r),t.stubRemovedMethods("TransformFeedback","v6.0",["pause","resume"]),Object.seal(c(t)),t}return b(i,[{key:t,get:function(){return"TransformFeedback"}},{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,hx(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,sk.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 lk(e)}}]),i}(px,Symbol.toStringTag),yC=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&&ox(lk(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 mC(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],ox(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 bC(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 _C="vs",wC=(o(f={},_C,"#ifdef MODULE_LOGDEPTH\n logdepth_adjustPosition(gl_Position);\n#endif\n"),o(f,"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"),f),kC="__LUMA_INJECT_DECLARATIONS__",xC=/void\s+main\s*\([^)]*\)\s*\{\n?/,SC=/}\n?[^{}]*$/,CC=[];function EC(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=t===_C,o=function(t){var i=n[t];i.sort(function(e,t){return e.order-t.order}),CC.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 TC={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},PC="transform_uSize_",AC="transform_position",MC={10241:9728,10240:9728,10242:33071,10243:33071},IC=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(PC).concat(o)]=[n,i]),r){var c;n=(c=r[u]).width,i=c.height,s["".concat(PC).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=qx(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 dC(!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 Rx)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 $x(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(MC)}},{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=Gx(e,{parameters:{10241:9728,10240:9728,10242:33071,10243:33071},pixelStore:{37440:!1}});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 vC(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(PC).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 dC(!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,d=u.inject;h[t]=l,c=OC([c,d]),Object.assign(s,u.samplerTextureMap),o--}}i&&!a&&(a=function(e,t){var n=vC(e,["varying","out"]);return n&&n.name===t?n.type:null}(e,i))}),i){ox(r);var d="".concat(PC).concat(i);c=OC([c,{"vs:#decl":"uniform vec2 ".concat(d,";\n"),"vs:#main-start":" vec2 ".concat(AC," = transform_getPos(").concat(d,");\n gl_Position = vec4(").concat(AC,", 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=OC([e.inject||{},u]);return this.targetTextureType=s,this.samplerTextureMap=c,{vs:o,fs:e._fs||gC({version:bC(o),input:this.targetTextureVarying,inputType:s,output:"transform_output"}),modules:this.hasSourceTextures||this.targetTextureVarying?[TC].concat(e.modules||[]):e.modules,uniforms:a,inject:l}}}]),e}(),RC={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 DC(e){var t=NC(e);return"object"===t?e?"type"in e?Object.assign({},e,RC[e.type]):"value"in e?(t=NC(e.value),Object.assign({type:t},e,RC[t])):{type:"object",value:e}:{type:"object",value:null}:Object.assign({type:t,value:e},RC[t])}function NC(e){return Array.isArray(e)||ArrayBuffer.isView(e)?"array":typeof e}var LC=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,d=void 0===h?{}:h,f=t.inject,p=void 0===f?{}:f,v=t.vertexShader,g=t.fragmentShader;m(this,e),dC("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=d,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=DC(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:dC(!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&&dC(r.validate(e[i],r),"".concat(this.name,": invalid ").concat(i)),t[i]=e[i]):t[i]=r.value}return t}}]),e}();function jC(e){return function(e){var t={},n={};return FC({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]})}(BC(e))}function FC(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=VC[t];if(dC(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 HC)return HC[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),HC[t]=a,a}function WC(e,t){return(t=Array.isArray(t)?t:[t]).every(function(t){return function(e,t){var n=VC[t];dC(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 dC(!1===r||!0===r),r}(e,t)})}function qC(e){return new RegExp("\\b".concat(e,"[ \\t]+(\\w+[ \\t]+\\w+(\\[\\w+\\])?;)"),"g")}var XC=[[/^(#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("]],YC=[].concat(XC,[[qC("attribute"),"in $1"],[qC("varying"),"out $1"]]),KC=[].concat(XC,[[qC("varying"),"in $1"]]),$C=[[/^#version[ \t]+300[ \t]+es/,"#version 100"],[/\btexture(2D|2DProj|Cube)Lod\(/g,"texture$1LodEXT("],[/\btexture\(/g,"texture2D("],[/\btextureLod\(/g,"texture2DLodEXT("]],QC=[].concat($C,[[qC("in"),"attribute $1"],[qC("out"),"varying $1"]]),ZC=[].concat($C,[[qC("in"),"varying $1"]]),JC="gl_FragColor",eE=/\bout[ \t]+vec4[ \t]+(\w+)[ \t]*;\n?/,tE=/void\s+main\s*\([^)]*\)\s*\{\n?/;function nE(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 iE="\n\n".concat(kC,"\n\n"),rE=(o(g={},_C,"vertex"),o(g,"fs","fragment"),g);function oE(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,d=void 0===h?{}:h,f=n.transpileToGLSL100,p=void 0!==f&&f,v=n.prologue,g=void 0===v||v,m=n.log;dC("string"==typeof r,"shader source must be a string");var y=o===_C,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 C,E=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(rE[n],"\n\n"):""}({id:i,source:r,type:o}),"\n").concat((C={type:o},"\n#define SHADER_TYPE_".concat(rE[C.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:UC(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// 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"}}(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 WC(e,zC.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"),WC(e,zC.GLSL_DERIVATIVES)&&GC(e,zC.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"),WC(e,zC.GLSL_FRAG_DATA)&&GC(e,zC.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"),WC(e,zC.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={},P={},A={};for(var M in d){var I="string"==typeof d[M]?{injection:d[M],order:0}:d[M],R=M.match(/^(v|f)s:(#)?([\w-]+)$/);if(R){var D=R[3];R[2]?"decl"===D?P[M]=[I]:A[M]=[I]:T[M]=[I]}else A[M]=[I]}var N,L=_(a);try{for(L.s();!(N=L.n()).done;){var j=N.value;m&&j.checkDeprecations(x,m),E+=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]?P:A;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 E=EC(E+=iE,o,P),E+=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),E=function(e,t,n){switch(t){case 300:return n?nE(e,YC):function(e){var t=(e=nE(e,KC)).match(eE);if(t){var n=t[1];e=e.replace(new RegExp("\\b".concat(JC,"\\b"),"g"),n)}else{var i="fragmentColor";e=e.replace(tE,function(e){return"out vec4 ".concat(i,";\n").concat(e)}).replace(new RegExp("\\b".concat(JC,"\\b"),"g"),i)}return e}(e);case 100:return n?nE(e,QC):function(e){var t=(e=nE(e,ZC)).match(eE);if(t){var n=t[1];e=e.replace(eE,"").replace(new RegExp("\\b".concat(n,"\\b"),"g"),JC)}return e}(e);default:throw new Error("unknown GLSL version ".concat(t))}}(E=EC(E+=x,o,A),p?100:w,y)}function aE(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 sE=(o(y={5126:wE.bind(null,"uniform1fv",fE,1,kE),35664:wE.bind(null,"uniform2fv",fE,2,kE),35665:wE.bind(null,"uniform3fv",fE,3,kE),35666:wE.bind(null,"uniform4fv",fE,4,kE),5124:wE.bind(null,"uniform1iv",pE,1,kE),35667:wE.bind(null,"uniform2iv",pE,2,kE),35668:wE.bind(null,"uniform3iv",pE,3,kE),35669:wE.bind(null,"uniform4iv",pE,4,kE),35670:wE.bind(null,"uniform1iv",pE,1,kE),35671:wE.bind(null,"uniform2iv",pE,2,kE),35672:wE.bind(null,"uniform3iv",pE,3,kE),35673:wE.bind(null,"uniform4iv",pE,4,kE),35674:wE.bind(null,"uniformMatrix2fv",fE,4,xE),35675:wE.bind(null,"uniformMatrix3fv",fE,9,xE),35676:wE.bind(null,"uniformMatrix4fv",fE,16,xE),35678:_E,35680:_E,5125:wE.bind(null,"uniform1uiv",vE,1,kE),36294:wE.bind(null,"uniform2uiv",vE,2,kE),36295:wE.bind(null,"uniform3uiv",vE,3,kE),36296:wE.bind(null,"uniform4uiv",vE,4,kE),35685:wE.bind(null,"uniformMatrix2x3fv",fE,6,xE),35686:wE.bind(null,"uniformMatrix2x4fv",fE,8,xE),35687:wE.bind(null,"uniformMatrix3x2fv",fE,6,xE),35688:wE.bind(null,"uniformMatrix3x4fv",fE,12,xE),35689:wE.bind(null,"uniformMatrix4x2fv",fE,8,xE),35690:wE.bind(null,"uniformMatrix4x3fv",fE,12,xE)},"35678",_E),o(y,"35680",_E),o(y,35679,_E),o(y,35682,_E),o(y,36289,_E),o(y,36292,_E),o(y,36293,_E),o(y,36298,_E),o(y,36299,_E),o(y,36300,_E),o(y,36303,_E),o(y,36306,_E),o(y,36307,_E),o(y,36308,_E),o(y,36311,_E),y),uE={},cE={},lE={},hE=[0];function dE(e,t,n,i){1===t&&"boolean"==typeof e&&(e=e?1:0),Number.isFinite(e)&&(hE[0]=e,e=hE);var r=e.length;if(r%t&&sk.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 CE(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||SE(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 EE(o,r-o.length)+n+e})}(t);return{shaderName:u,errors:CE(o,p),warnings:CE(a,p)}}(t,this.source,this.shaderType,this.id),i=n.shaderName,r=n.errors,o=n.warnings;throw sk.error("GLSL compilation errors in ".concat(i,"\n").concat(r))(),sk.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 ox(!1),"unknown"}}}]),i}(px,Symbol.toStringTag),TE=function(e,t){a(i,e);var n=s(i);function i(e,t){return m(this,i),"string"==typeof t&&(t={source:t}),n.call(this,e,Object.assign({},t,{shaderType:35633}))}return b(i,[{key:t,get:function(){return"VertexShader"}},{key:"_createHandle",value:function(){return this.gl.createShader(35633)}}]),i}(OE,Symbol.toStringTag),PE=function(e,t){a(i,e);var n=s(i);function i(e,t){return m(this,i),"string"==typeof t&&(t={source:t}),n.call(this,e,Object.assign({},t,{shaderType:35632}))}return b(i,[{key:t,get:function(){return"FragmentShader"}},{key:"_createHandle",value:function(){return this.gl.createShader(35632)}}]),i}(OE,Symbol.toStringTag),AE=5126,ME=5124,IE=5125,RE=(o(w={},AE,[AE,1,"float"]),o(w,35664,[AE,2,"vec2"]),o(w,35665,[AE,3,"vec3"]),o(w,35666,[AE,4,"vec4"]),o(w,ME,[ME,1,"int"]),o(w,35667,[ME,2,"ivec2"]),o(w,35668,[ME,3,"ivec3"]),o(w,35669,[ME,4,"ivec4"]),o(w,IE,[IE,1,"uint"]),o(w,36294,[IE,2,"uvec2"]),o(w,36295,[IE,3,"uvec3"]),o(w,36296,[IE,4,"uvec4"]),o(w,35670,[AE,1,"bool"]),o(w,35671,[AE,2,"bvec2"]),o(w,35672,[AE,3,"bvec3"]),o(w,35673,[AE,4,"bvec4"]),o(w,35674,[AE,8,"mat2"]),o(w,35685,[AE,8,"mat2x3"]),o(w,35686,[AE,8,"mat2x4"]),o(w,35675,[AE,12,"mat3"]),o(w,35687,[AE,12,"mat3x2"]),o(w,35688,[AE,12,"mat3x4"]),o(w,35676,[AE,16,"mat4"]),o(w,35689,[AE,16,"mat4x2"]),o(w,35690,[AE,16,"mat4x3"]),w);function DE(e){var n=RE[e];if(!n)return null;var i=t(n,2);return{type:i[0],components:i[1]}}function NE(e,n){switch(e){case 5120:case 5121:case 5122:case 5123:e=AE}for(var i in RE){var r=t(RE[i],3),o=r[0],a=r[1],s=r[2];if(o===e&&a===n)return{glType:i,name:s}}return null}var LE=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(lk(t)){for(var n=t.getProgramParameter(e.handle,35971),i=0;i1&&void 0!==arguments[1]?arguments[1]:{};return m(this,r),(t=i.call(this,e,n)).stubRemovedMethods("Program","v6.0",jE),t._isCached=!1,t.initialize(n),Object.seal(c(t)),t._setId(n.id),t}return b(r,[{key:n,get:function(){return"Program"}},{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 TE(this.gl,{id:"".concat(e.id,"-vs"),source:n}):n,this.fs="string"==typeof i?new PE(this.gl,{id:"".concat(e.id,"-fs"),source:i}):i,ox(this.vs instanceof TE),ox(this.fs instanceof PE),this.uniforms={},this._textureUniforms={},r&&r.length>0&&(dk(this.gl),this.varyings=r,this.gl2.transformFeedbackVaryings(this.handle,r,a)),this._compileAndLink(),this._readUniformLocationsFromLinkedProgram(),this.configuration=new LE(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(r.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,d=e.indexType,f=void 0===d?5123:d,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,C=e.samplers;if((S||C)&&(sk.deprecated("Program.draw({uniforms})","Program.setUniforms(uniforms)")(),this.setUniforms(S||{})),sk.priority>=n){var E=w?w.id:"default",O="mode=".concat(sx(this.gl,r)," verts=").concat(o," instances=").concat(v," indexType=").concat(sx(this.gl,f)," isInstanced=").concat(m," isIndexed=").concat(h," Framebuffer=").concat(E);sk.log(n,O)()}return ox(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 ox(!1),0}}(r);_.begin(e)}t._bindTextures(),Hk(t.gl,x,function(){h&&m?t.gl2.drawElementsInstanced(r,o,f,s,v):h&&lk(t.gl)&&!isNaN(u)&&!isNaN(c)?t.gl2.drawRangeElements(r,u,c,o,f,s):h?t.gl.drawElements(r,o,f,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 sk.priority>=2&&function(e,t,n){for(var i in e){var r=e[i];if((!n||Boolean(n[i]))&&!yE(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 $x&&(r=r.texture),r instanceof Mx)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)&&bE(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 TE({handle:r});break;case 35632:n.fs=new PE({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=cx(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),sk.time(4,"linkProgram for ".concat(this._getName()))(),e.linkProgram(this.handle),sk.timeEnd(4,"linkProgram for ".concat(this._getName()))(),e.debug||sk.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,d=void 0===h?[]:h,f=n.bufferMode,p=void 0===f?35981:f,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=d.map(function(e){return t._getHash(e)}),x=Object.keys(u).sort(),S=Object.keys(l).sort(),C=[],E=[],O=_(x);try{for(O.s();!(e=O.n()).done;){var T=e.value;C.push(this._getHash(T)),C.push(this._getHash(u[T]))}}catch(D){O.e(D)}finally{O.f()}var P,A=_(S);try{for(A.s();!(P=A.n()).done;){var M=P.value;E.push(this._getHash(M)),E.push(this._getHash(l[M]))}}catch(D){A.e(D)}finally{A.f()}var I="".concat(y,"/").concat(b,"D").concat(C.join("/"),"M").concat(w.join("/"),"I").concat(E.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=jC(t.modules||[]);return{gl:e,vs:oE(e,Object.assign({},t,{source:n,type:_C,modules:r})),fs:oE(e,Object.assign({},t,{source:i,type:"fs",modules:r})),getUniforms:aE(r)}}(this.gl,{vs:r,fs:a,modules:m,inject:l,defines:u,hookFunctions:this._hookFunctions,transpileToGLSL100:g});this._programCache[I]=new FE(this.gl,{hash:I,vs:R.vs,fs:R.fs,varyings:d,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,r),(t=i.call(this,e,Object.assign({},n,{id:n.id||n.program&&n.program.id}))).buffer=null,t.bufferValue=null,t.isDefaultArray=n.isDefaultArray||!1,t.gl2=e,t.initialize(n),Object.seal(c(t)),t}return b(r,[{key:n,get:function(){return"VertexArrayObject"}},{key:"delete",value:function(){return e(p(r.prototype),"delete",this).call(this),this.buffer&&this.buffer.delete(),this}},{key:"MAX_ATTRIBUTES",get:function(){return r.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 ox(!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?(ox(lk(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&&!r.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(!VE||VE.byteLength1&&void 0!==arguments[1]?arguments[1]:{};return!t.constantAttributeZero||lk(e)||"Chrome"===function(e){if(!Lw())return"Node";if(Nw(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":Ww.chrome?"Chrome":Ww.safari?"Safari":Ww.mozInnerScreenX?"Firefox":"Unknown"}()}},{key:"getDefaultArray",value:function(e){return e.luma=e.luma||{},e.luma.defaultVertexArray||(e.luma.defaultVertexArray=new r(e,{handle:null,isDefaultArray:!0})),e.luma.defaultVertexArray}},{key:"getMaxAttributes",value:function(e){return r.MAX_ATTRIBUTES=r.MAX_ATTRIBUTES||e.getParameter(34921),r.MAX_ATTRIBUTES}},{key:"setConstant",value:function(e,t,n){switch(n.constructor){case Float32Array:r._setConstantFloatArray(e,t,n);break;case Int32Array:r._setConstantIntArray(e,t,n);break;case Uint32Array:r._setConstantUintArray(e,t,n);break;default:ox(!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:ox(!1)}}},{key:"_setConstantIntArray",value:function(e,t,n){switch(ox(lk(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:ox(!1)}}},{key:"_setConstantUintArray",value:function(e,t,n){switch(ox(lk(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:ox(!1)}}}]),r}(px,Symbol.toStringTag),UE=/^(.+)__LOCATION_([0-9]+)$/,HE=["setBuffers","setGeneric","clearBindings","setLocations","setGenericValues","setDivisor","enable","disable"],GE=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 zE(t),dx(this,"VertexArray","v6.0",HE),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 sk.deprecated("setElements","setElementBuffer")(),this.setElementBuffer(e,t)}}]),e}();function WE(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+=WE(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 qE(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",d=1,f=0,p=0;if(n&&(h=n.type,d=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,f=(p=m.byteLength)/b.BYTES_PER_ELEMENT/d,n?g="".concat(n.divisor>0?"I ":"P "," ").concat(f," (x").concat(d,"=").concat(p," bytes ").concat(sx(s,h),")"):(u=!0,g="".concat(p," bytes")),o(v={},i,"".concat(c).concat(WE(l,{size:d,isInteger:u}))),o(v,"Format ",g),v}return l=t,d=t.length,u=-1!==(h=String(t.constructor.name).replace("Array","")).indexOf("nt"),o(a={},i,"".concat(WE(l,{size:d,isInteger:u})," (constant)")),o(a,"Format ","".concat(d,"x").concat(h," (constant)")),a}function XE(e,t){var n=NE(t.type,t.size);return n?"".concat(e," (").concat(n.name,")"):e}function YE(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;ox(i);var u,c=".*Matrix",l={},h=Object.keys(i._uniformSetters).sort(),d=0,f=_(h);try{for(f.s();!(u=f.n()).done;){var p=u.value;!p.match(".*_.*")&&!p.match(c)&&KE({table:l,header:n,uniforms:r,uniformName:p,undefinedOnly:s})&&d++}}catch(E){f.e(E)}finally{f.f()}var v,g=_(h);try{for(g.s();!(v=g.n()).done;){var m=v.value;m.match(c)&&KE({table:l,header:n,uniforms:r,uniformName:m,undefinedOnly:s})&&d++}}catch(E){g.e(E)}finally{g.f()}var y,b=_(h);try{for(b.s();!(y=b.n()).done;){var w=y.value;l[w]||KE({table:l,header:n,uniforms:r,uniformName:w,undefinedOnly:s})&&d++}}catch(E){b.e(E)}finally{b.f()}var k=0,x={};if(!s)for(var S in r){var C=r[S];l[S]||(k++,x[S]=o({Type:"NOT USED: ".concat(C)},n,WE(C)))}return{table:l,count:d,unusedTable:x,unusedCount:k}}function KE(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?WE(u):"N/A"),o(t,"Uniform Type",c?u:"NOT PROVIDED"),t),0))}function $E(e){var t=e.accessor,n=NE(t.type,t.size);return n?"".concat(n.name," ").concat(e.name):e.name}var QE={POSITION:"positions",NORMAL:"normals",COLOR_0:"colors",TEXCOORD_0:"texCoords",TEXCOORD_1:"texCoords1",TEXCOORD_2:"texCoords2"};function ZE(e,t){var n=(t||{}).attributeMap,i=void 0===n?QE:n;return i&&i[e]||e}function JE(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}ox(Number.isFinite(t.size),"attribute ".concat(e," needs size"))}var eO=function(){},tO={},nO=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?cx("model"):i;ox(ck(t)),this.id=r,this.gl=t,this.id=n.id||cx("Model"),this.lastLogTime=0,this.animated=!1,this.initialize(n)}return b(e,[{key:"initialize",value:function(e){this.props={},this.programManager=e.programManager||BE.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={},ox(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 ox(Number.isFinite(e)),this.vertexCount=e,this}},{key:"setInstanceCount",value:function(e){return ox(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=ZE(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],JE(o,c)}}if(r){var l=r.value||r;ox(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(hx(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 Fx(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,d=void 0===h?{}:h,f=e.vertexArray,p=void 0===f?this.vertexArray:f;this.setAttributes(u),this.updateModuleSettings(i),this.setUniforms(a),sk.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&&sk.warn("Found instanced attributes on non-instanced model",this.id)();var C=this.isInstanced,E=this.instanceCount,O=this.props,T=O.onBeforeRender,P=void 0===T?eO:T,A=O.onAfterRender,M=void 0===A?eO:A;P(),this.program.setUniforms(this.uniforms);var I=this.program.draw(Object.assign(tO,e,{logPriority:t,uniforms:null,framebuffer:r,parameters:d,drawMode:this.getDrawMode(),vertexCount:this.getVertexCount(),vertexArray:p,transformFeedback:l,isIndexed:y,indexType:_,isInstanced:C,instanceCount:E,offset:y?k:0}));return M(),sk.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 sk.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}ox(e instanceof FE,"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 GE(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&&ox(e,"Model.draw(): animated uniforms but no animationProps")}},{key:"_setFeedbackBuffers",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(hx(e))return this;var t=this.program.gl;return this.transformFeedback=this.transformFeedback||new mC(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:sk.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=qE(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(XE(s.name,c))),r[u]=qE(t,o[a],c,i)}}return r}({vertexArray:t,header:"".concat(this.id," attributes"),attributes:this._attributes}),a=YE({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=YE({header:"".concat(this.id," uniforms"),program:this.program,uniforms:Object.assign({},this.program.uniforms,n),undefinedOnly:!0}),h=l.table;l.count>0&&sk.log("MISSING UNIFORMS",Object.keys(h))(),c>0&&sk.log("UNUSED UNIFORMS",Object.keys(u))();var d=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($E(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($E(c))]=o({},i,JSON.stringify(c.accessor)))}}catch(l){u.e(l)}finally{u.f()}return n}(this.vertexArray.configuration);sk.table(e,r)(),sk.table(e,s)(),sk.table(e+1,d)(),i&&i.log({logLevel:2,message:"Rendered to ".concat(i.id)}),sk.groupEnd(2,">>> DRAWING MODEL ".concat(this.id))()}}}]),e}(),iO=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()}ox(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 nO(t,Object.assign({},e,{fs:e.fs||gC({version:bC(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!(hx(e.feedbackBuffers)&&hx(e.feedbackMap)&&!(e.varyings&&e.varyings.length>0))})(t)&&(this.bufferTransform=new yC(e,t)),function(e){return!(hx(e._sourceTextures)&&!e._targetTexture&&!e._targetTextureVarying)}(t)&&(this.textureTransform=new IC(e,t)),ox(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 lk(e)}}]),e}();function rO(){}var oO={onStart:rO,onUpdate:rO,onInterrupt:rO,onEnd:rO},aO=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({},oO),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}(),sO={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 aO(r),this.attribute=i,this.attributeInTransition=new cC(n,i.settings),this.currentStartIndices=i.startIndices,this.currentLength=0,this.transform=function(e,t){var n=oC(t.size);return new iO(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;aC(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;uC(M({buffer:s},o))}}catch(u){a.e(u)}finally{a.f()}this.currentStartIndices=i.startIndices,this.currentLength=sC(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:rC(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 aO(r),this.attribute=i,this.attributeInTransition=new cC(n,I(M({},i.settings),{normalized:!1})),this.currentStartIndices=i.startIndices,this.currentLength=0,this.texture=function(e){return new Rx(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 $x(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=oC(t.size);return new iO(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;uC(M({buffer:s},o))}}catch(u){a.e(u)}finally{a.f()}this.currentStartIndices=r.startIndices,this.currentLength=sC(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:rC(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]}}),aC(e),this.attributeInTransition.update({buffer:e[1],value:this.attribute.value}),qx(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}()},uO=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=iO.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 ik.warn("WebGL2 not supported by this browser. Transition for ".concat(e," is disabled."))();i&&this._removeTransition(e);var o=sO[n.type];o?this.transitions[e]=new o({attribute:t,timeline:this.timeline,gl:this.gl}):(ik.error("unsupported transition type '".concat(n.type,"'"))(),r=!1)}(r||t.needsRedraw())&&(this.needsRedraw=!0,this.transitions[e].start(n,this.numInstances))}}]),e}(),cO="attributeManager.invalidate",lO=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 uO(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,d=!1;for(var f in hC("attributeManager.updateStart",this),this.stats&&this.stats.get("Update Attributes").timeStart(),this.attributes){var p=this.attributes[f],v=p.settings.accessor;p.startIndices=r,s[f]&&ik.removed("props.".concat(f),"data.attributes.".concat(f))(),p.setExternalBuffer(c[f])||p.setBinaryValue(c[v],t.startIndices)||!c[v]&&p.setConstantValue(s[v])||p.needsUpdate()&&(d=!0,this._updateAttribute({attribute:p,numInstances:n,data:t,props:s,context:h})),this.needsRedraw|=p.needsRedraw()}d&&hC("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&&ik.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 cC(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;hC("attribute.updateStart",t),t.allocate(n)&&hC("attribute.allocate",t,n),t.updateBuffer(e)&&(this.needsRedraw=!0,hC("attribute.updateEnd",t,n))}}]),e}();function hO(e,t,n,i,r){var o=t-e;return(n-t)*r+-o*i+o+t}function dO(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=iC(i)){var s=fO[i.type];if(s){var u=new s(this.timeline);u.start(I(M({},i),{fromValue:t,toValue:n})),r.set(e,u)}else ik.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}(),vO={COMPONENT:Symbol.for("component"),ASYNC_DEFAULTS:Symbol.for("asyncPropDefaults"),ASYNC_ORIGINAL:Symbol.for("asyncPropOriginal"),ASYNC_RESOLVED:Symbol.for("asyncPropResolved")},gO=vO.COMPONENT;function mO(e,t){if(!e.transitions)return null;var n={},i=kO(e);for(var r in e.transitions){var o=i[r],a=o&&o.type;("number"===a||"color"===a||"array"===a)&&bO(e[r],t[r],o)&&(n[r]=!0)}return n}function yO(){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],d=t[10],f=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,C=l*g-d*p,E=l*m-f*p,O=h*g-d*v,T=h*m-f*v,P=d*m-f*g,A=y*P-b*T+_*O+w*E-k*C+x*S;return A?(e[0]=(s*P-u*T+c*O)*(A=1/A),e[1]=(r*T-i*P-o*O)*A,e[2]=(v*x-g*k+m*w)*A,e[3]=(d*k-h*x-f*w)*A,e[4]=(u*E-a*P-c*C)*A,e[5]=(n*P-r*E+o*C)*A,e[6]=(g*_-p*x-m*b)*A,e[7]=(l*x-d*_+f*b)*A,e[8]=(a*T-s*E+c*S)*A,e[9]=(i*E-n*T-o*S)*A,e[10]=(p*k-v*_+m*y)*A,e[11]=(h*_-l*k-f*y)*A,e[12]=(s*C-a*O-u*S)*A,e[13]=(n*O-i*C+r*S)*A,e[14]=(v*b-p*w-g*y)*A,e[15]=(l*w-h*b+d*y)*A,e):null}function OO(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],d=t[9],f=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*d+k*g,e[2]=b*o+_*c+w*f+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*d+k*g,e[6]=b*o+_*c+w*f+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*d+k*g,e[10]=b*o+_*c+w*f+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*d+k*g,e[14]=b*o+_*c+w*f+k*m,e[15]=b*a+_*l+w*p+k*y,e}function TO(e,t,n){var i,r,o,a,s,u,c,l,h,d,f,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],d=t[9],f=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]=d,e[10]=f,e[11]=p,e[12]=i*v+s*g+h*m+t[12],e[13]=r*v+u*g+d*m+t[13],e[14]=o*v+c*g+f*m+t[14],e[15]=a*v+l*g+p*m+t[15]),e}function PO(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 AO(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],d=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+d*i,e[8]=c*r-o*i,e[9]=l*r-a*i,e[10]=h*r-s*i,e[11]=d*r-u*i,e}function MO(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],d=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+d*i,e[4]=c*r-o*i,e[5]=l*r-a*i,e[6]=h*r-s*i,e[7]=d*r-u*i,e}function IO(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 RO(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 DO(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,d=c*o+a*r-s*i,f=-a*i-s*r-u*o;return e[0]=l*c+f*-a+h*-u-d*-s,e[1]=h*c+f*-s+d*-a-l*-u,e[2]=d*c+f*-u+l*-s-h*-a,e[3]=t[3],e}!function(){var e=new kS(4);kS!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0)}();var NO=[0,0,0,0],LO=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0],jO=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],FO=[0,0,0],BO=[0,0,0],VO=SO(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=NO,u=NO,c=e.cameraPosition,l=zO(e,t,n),h=l.geospatialOrigin,d=l.shaderCoordinateOrigin;return l.offsetMode&&(u=e.projectPosition(h||d),c=[c[0]-u[0],c[1]-u[1],c[2]-u[2]],u[3]=1,s=RO([],u,a),a=OO([],r,o=i||o),a=OO([],a,LO)),{viewMatrix:o,viewProjectionMatrix:a,projectionCenter:s,originCommon:u,cameraPosCommon:c,shaderCoordinateOrigin:d,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(),d=[t.width*n,t.height*n],f=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:d,project_uDevicePixelRatio:n,project_uFocalDistance:f,project_uCommonUnitsPerMeter:h.unitsPerMeter,project_uCommonUnitsPerWorldUnit:h.unitsPerMeter,project_uCommonUnitsPerWorldUnit2:FO,project_uScale:t.scale,project_uViewProjectionMatrix:a,project_uCameraPosition:u};if(l){var v=t.getDistanceScales(l);switch(i){case rk.METER_OFFSETS:p.project_uCommonUnitsPerWorldUnit=v.unitsPerMeter,p.project_uCommonUnitsPerWorldUnit2=v.unitsPerMeter2;break;case rk.LNGLAT:case rk.LNGLAT_OFFSETS:p.project_uCommonUnitsPerWorldUnit=v.unitsPerDegree,p.project_uCommonUnitsPerWorldUnit2=v.unitsPerDegree2;break;case rk.CARTESIAN:p.project_uCommonUnitsPerWorldUnit=[1,1,v.unitsPerMeter[2]],p.project_uCommonUnitsPerWorldUnit2=[0,0,v.unitsPerMeter2[2]]}}return p});function zO(e,t){var n,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:BO,r=i,o=!0;switch(n=t===rk.LNGLAT_OFFSETS||t===rk.METER_OFFSETS?i:e.isGeospatial?[Math.fround(e.longitude),Math.fround(e.latitude),0]:null,e.projectionMode){case ok.WEB_MERCATOR:(t===rk.LNGLAT||t===rk.CARTESIAN)&&(o=!1);break;case ok.WEB_MERCATOR_AUTO_OFFSET:t===rk.LNGLAT?r=n:t===rk.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 ok.IDENTITY:r=e.position.map(Math.fround);break;case ok.GLOBE:o=!1,n=null;break;default:o=!1}return r[2]=r[2]||0,{geospatialOrigin:n,shaderCoordinateOrigin:r,offsetMode:o}}var UO=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 pS(!1),0}},{key:"RANK",get:function(){return pS(!1),0}},{key:"toString",value:function(){var e="[";if(oS.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 d=s*Math.tan(n/2),f=d*o;return(new i).ortho({left:-f,right:f,bottom:-d,top:d,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 function(e,t,n,i,r){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!=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)}(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],d=e[11],f=e[12],p=e[13],v=e[14],g=e[15];return(t*a-n*o)*(h*g-d*v)-(t*s-i*o)*(l*g-d*p)+(t*u-r*o)*(l*v-h*p)+(n*s-i*a)*(c*g-d*f)-(n*u-r*a)*(c*v-h*f)+(i*u-r*s)*(c*p-l*f)}(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 OO(this,e,this),this.check()}},{key:"multiplyRight",value:function(e){return OO(this,this,e),this.check()}},{key:"rotateX",value:function(e){return AO(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],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]=o*r-c*i,e[1]=a*r-l*i,e[2]=s*r-h*i,e[3]=u*r-d*i,e[8]=o*i+c*r,e[9]=a*i+l*r,e[10]=s*i+h*r,e[11]=u*i+d*r}(this,this,e),this.check()}},{key:"rotateZ",value:function(e){return MO(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,d,f,p,v,g,m,y,b,_,w,k,x,S,C,E,O,T=i[0],P=i[1],A=i[2],M=Math.hypot(T,P,A);Mn?n:e}var eT=Math.log2||function(e){return Math.log(e)*Math.LOG2E};function tT(e,t){if(!e)throw new Error(t||"@math.gl/web-mercator: assertion failed.")}var nT=Math.PI,iT=nT/4,rT=nT/180,oT=180/nT,aT=4003e4,sT=85.051129;function uT(e){var n=t(e,2),i=n[0],r=n[1];return tT(Number.isFinite(i)),tT(Number.isFinite(r)&&r>=-90&&r<=90,"invalid latitude"),[512*(i*rT+nT)/(2*nT),512*(nT+Math.log(Math.tan(iT+r*rT*.5)))/(2*nT)]}function cT(e){var n=t(e,2),i=n[0],r=n[1],o=i/512*(2*nT)-nT,a=2*(Math.atan(Math.exp(r/512*(2*nT)-nT))-iT);return[o*oT,a*oT]}function lT(e){var t=e.latitude,n=e.longitude,i=e.highPrecision,r=void 0!==i&&i;tT(Number.isFinite(t)&&Number.isFinite(n));var o={},a=Math.cos(t*rT),s=512/360,u=s/a,c=512/aT/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=rT*Math.tan(t*rT)/a,h=512/aT*l,d=h/u*c;o.unitsPerDegree2=[0,s*l/2,h],o.unitsPerMeter2=[d,0,d]}return o}function hT(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=lT({longitude:r,latitude:o,highPrecision:!0}),d=h.unitsPerMeter,f=h.unitsPerMeter2,p=uT(e);p[0]+=u*(d[0]+f[0]*c),p[1]+=c*(d[1]+f[1]*c);var v=cT(p),g=(a||0)+(l||0);return Number.isFinite(a)||Number.isFinite(l)?[v[0],v[1],g]:v}function dT(e){return 2*Math.atan(.5/e)*oT}function fT(e,n){var i=t(e,3),r=i[0],o=i[1],a=i[2],s=void 0===a?0:a;return tT(Number.isFinite(r)&&Number.isFinite(o)&&Number.isFinite(s)),QO(n,[r,o,s,1])}function pT(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(tT(Number.isFinite(o)&&Number.isFinite(a),"invalid pixel coordinate"),Number.isFinite(s))return QO(n,[o,a,s,1]);var u=QO(n,[o,a,0,1]),c=QO(n,[o,a,1,1]),l=u[2],h=c[2];return WO([],u,c,l===h?0:((i||0)-l)/(h-l))}var vT=Math.PI/180;function gT(e,t,n){var i=e.pixelUnprojectionMatrix,r=QO(i,[t,0,1,1]),o=QO(i,[t,e.height,1,1]),a=cT(WO([],r,o,(n*e.distanceScales.unitsPerMeter[2]-r[2])/(o[2]-r[2])));return a[2]=n,a}var mT=Math.PI/180,yT=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],bT=[0,0,0],_T={unitsPerMeter:[1,1,1],metersPerUnit:[1,1,1]},wT=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?ok.WEB_MERCATOR:ok.WEB_MERCATOR_AUTO_OFFSET:ok.IDENTITY}},{key:"equals",value:function(t){return t instanceof e&&(this===t||t.width===this.width&&t.height===this.height&&t.scale===this.scale&&fS(t.projectionMatrix,this.projectionMatrix)&&fS(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=fT(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=pT([s,r?u:this.height-u,c],this.pixelUnprojectionMatrix,o&&o*this.distanceScales.unitsPerMeter[2]),h=this.unprojectPosition(l),d=t(h,3),f=d[0],p=d[1],v=d[2];return Number.isFinite(c)?[f,p,v]:Number.isFinite(o)?[f,p,o]:[f,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?uT(e):e}},{key:"unprojectFlat",value:function(e){return this.isGeospatial?cT(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?lT({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,d=void 0===h?0:h,f=t.bearing,p=void 0===f?0:f,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,C=void 0===S?0:S,E=t.width,O=t.height,T=t.altitude,P=void 0===T?1.5:T,A=Math.pow(2,l),R=function(e){var t=e.width,n=e.height,i=e.fovy,r=void 0===i?dT(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=dT(o));var d=.5*r*rT,f=function(e){return.5/Math.tan(.5*e*rT)}(r),p=s*rT,v=Math.sin(d)*f/Math.sin(Math.min(Math.max(Math.PI/2-p-d,.01),Math.PI-.01));return{fov:2*d,aspect:t/n,focalDistance:f,near:c,far:(Math.sin(p)*v+f)*h}}({width:E=E||1,height:O=O||1,pitch:d,altitude:P=Math.max(.75,P),nearZMultiplier:g,farZMultiplier:b}),D=R.fov,N=R.aspect,L=R.focalDistance,j=R.near,F=R.far,B=function(e){var t=e.height,n=e.pitch,i=e.bearing,r=e.scale,o=e.center,a=void 0===o?null:o,s=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];return TO(s,s,[0,0,-e.altitude]),AO(s,s,-n*rT),MO(s,s,i*rT),PO(s,s,[r/=t,r,r]),a&&TO(s,s,function(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}([],a)),s}({height:O,pitch:d,bearing:p,scale:A,altitude:P});return C&&(B=(new $O).translate([512*C,0,0]).multiplyLeft(B)),(e=n.call(this,I(M({},t),{width:E,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=d,e.bearing=p,e.altitude=P,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 hT(e,t)}},{key:"panByPosition",value:function(e,n){var i=pT(n,this.pixelUnprojectionMatrix),r=HO([],this.projectFlat(e),GO([],i)),o=HO([],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=function(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*vT:Math.atan(.5/e.altitude))>(90-e.pitch)*vT-.01?(t=gT(e,0,i),n=gT(e,r,i)):(t=a([0,0],s),n=a([r,0],s)),[u,c,n,t]}(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 n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.width,o=this.height,a=function(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,d=void 0===h?[0,0]:h,f=t(r,2),p=t(f[0],2),v=p[0],g=p[1],m=t(f[1],2),y=m[0],b=m[1];Number.isFinite(l)?l={top:l,bottom:l,left:l,right:l}:tT(Number.isFinite(l.top)&&Number.isFinite(l.bottom)&&Number.isFinite(l.left)&&Number.isFinite(l.right));var _=uT([v,JO(b,-sT,sT)]),w=uT([y,JO(g,-sT,sT)]),k=[Math.max(Math.abs(w[0]-_[0]),a),Math.max(Math.abs(w[1]-_[1]),a)],x=[n-l.left-l.right-2*Math.abs(d[0]),i-l.top-l.bottom-2*Math.abs(d[1])];tT(x[0]>0&&x[1]>0);var S=x[0]/k[0],C=x[1]/k[1],E=cT([(w[0]+_[0])/2+(l.right-l.left)/2/S,(w[1]+_[1])/2+(l.bottom-l.top)/2/C]),O=Math.min(u,eT(Math.abs(Math.min(S,C))));return tT(Number.isFinite(O)),{longitude:E[0],latitude:E[1],zoom:O}}(M({width:r,height:o,bounds:e},n)),s=a.longitude,u=a.latitude,c=a.zoom;return new i({width:r,height:o,longitude:s,latitude:u,zoom:c})}}]),i}(wT);return e.displayName="WebMercatorViewport",e}();function xT(e,n){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=n.projectPosition(e);if(i&&n instanceof kT){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 ST(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],d=c[2],f=void 0===d?0:d;switch(o&&(l=(i=t(RO([],[l,h,f,1],o),3))[0],h=i[1],f=i[2]),a){case rk.LNGLAT:return xT([l,h,f],r,u);case rk.LNGLAT_OFFSETS:return xT([l+s[0],h+s[1],f+(s[2]||0)],r,u);case rk.METER_OFFSETS:return xT(hT(s,[l,h,f]),r,u);case rk.CARTESIAN:default:return r.isGeospatial?[l+s[0],h+s[1],f+s[2]]:r.projectPosition([l,h,f])}}var CT={10241:9987,10240:9729,10242:33071,10243:33071},ET={},OT={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||MT(e)&&(3===e.length||4===e.length)},equal:function(e,t,n){return TT(e,t)}},accessor:{validate:function(e,t){var n=IT(e);return"function"===n||n===IT(t.value)},equal:function(e,t,n){return"function"==typeof t||TT(e,t)}},array:{validate:function(e,t){return t.optional&&!e||MT(e)},equal:function(e,t,n){return n.compare?TT(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 Rx)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 Rx(n,I(M({},t),{parameters:M(M(M({},CT),i),e.props.textureParameters)}));return ET[r.id]=!0,r}(n,e)},release:function(e){!function(e){!e||!(e instanceof Rx)||ET[e.id]&&(e.delete(),delete ET[e.id])}(e)}}};function TT(e,t){if(e===t)return!0;if(!MT(e)||!MT(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=qT,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[GT]||{},n=e[HT]||e,i=e[WT]||{};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(KS(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 Vx(regeneratorRuntime.mark(function i(){var r,o,a,s,u,c,l,h,d,f,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=UT(t);case 8:return i.next=10,p.next();case 10:return l=(d=i.sent).done,i.next=13,d.value;case 13:if(f=i.sent,l){i.next=20;break}v=f,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}(),KT=vO.ASYNC_ORIGINAL,$T=vO.ASYNC_RESOLVED,QT=vO.ASYNC_DEFAULTS,ZT={},JT=0,eP=function(){var e=function(){function e(){m(this,e),this.props=jT.apply(this,arguments),this.id=this.props.id,this.count=JT++,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[QT])i in t[$T]?n[i]=t[$T][i]:i in t[KT]&&(n[i]=t[KT][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 XT({})}}]),e}();return e.componentName="Component",e.defaultProps=ZT,e}(),tP=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}(XT),nP=function(e){return"function"==typeof e},iP=function(e){return null!==e&&"object"==typeof e},rP=function(e){return iP(e)&&e.constructor==={}.constructor},oP=function(e){return e&&"function"==typeof e[Symbol.iterator]},aP=function(e){return e&&"function"==typeof e[Symbol.asyncIterator]},sP=function(e){return"undefined"!=typeof Response&&e instanceof Response||e&&e.arrayBuffer&&e.text&&e.json},uP=function(e){return"undefined"!=typeof Blob&&e instanceof Blob},cP=function(e){return function(e){return"undefined"!=typeof ReadableStream&&e instanceof ReadableStream||iP(e)&&nP(e.tee)&&nP(e.cancel)&&nP(e.getReader)}(e)||function(e){return iP(e)&&nP(e.read)&&nP(e.pipe)&&function(e){return"boolean"==typeof e}(e.readable)}(e)};function lP(e,t){if(!e)throw new Error(t||"loader assertion failed.")}function hP(e){var t;return!!e&&(Array.isArray(e)&&(e=e[0]),Array.isArray(null===(t=e)||void 0===t?void 0:t.extensions))}function dP(e){var t,n,i;return lP(e,"null loader"),lP(hP(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 fP={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},pP=fP.global||fP.self||fP.window||{},vP="object"!=typeof process||"[object process]"!==String(process)||process.browser,gP="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version);gP&&parseFloat(gP[1]);var mP={};function yP(e){for(var t in mP)e.startsWith(t)&&(e=e.replace(t,mP[t]));return!e.startsWith("http://")&&!e.startsWith("https://")&&(e="".concat(e)),e}var bP=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,_P=/^([-\w.]+\/[-\w.+]+)/;function wP(e){var t=_P.exec(e);return t?t[1]:e}function kP(e){var t=bP.exec(e);return t?t[1]:""}var xP=/\?.*/;function SP(e){if(sP(e)){var t=EP(e.url||"");return{url:t,type:wP(e.headers.get("content-type")||"")||kP(t)}}return uP(e)?{url:EP(e.name||""),type:e.type||""}:"string"==typeof e?{url:EP(e),type:kP(e)}:{url:"",type:""}}function CP(e){return sP(e)?e.headers["content-length"]||-1:uP(e)?e.size:"string"==typeof e?e.length:e instanceof ArrayBuffer||ArrayBuffer.isView(e)?e.byteLength:-1}function EP(e){return e.replace(xP,"")}function OP(e){return TP.apply(this,arguments)}function TP(){return(TP=Vx(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(!sP(t)){e.next=2;break}return e.abrupt("return",t);case 2:return n={},(i=CP(t))>=0&&(n["content-length"]=String(i)),r=SP(t),o=r.url,(a=r.type)&&(n["content-type"]=a),e.next=8,RP(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 PP(e){return AP.apply(this,arguments)}function AP(){return(AP=Vx(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,MP(t);case 3:throw n=e.sent,new Error(n);case 5:case"end":return e.stop()}},e)}))).apply(this,arguments)}function MP(e){return IP.apply(this,arguments)}function IP(){return(IP=Vx(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 RP(e){return DP.apply(this,arguments)}function DP(){return(DP=Vx(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(NP(t.slice(0,5))):null);case 8:case"end":return e.stop()}},e)}))).apply(this,arguments)}function NP(e){for(var t="",n=new Uint8Array(e),i=0;i1&&void 0!==arguments[1]?arguments[1]:"3.0.12";return $P(e,"no worker provided"),!(!t||!e.version)}var ZP={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},JP=ZP.global||ZP.self||ZP.window||{},eA="object"!=typeof process||"[object process]"!==String(process)||process.browser,tA="function"==typeof importScripts,nA="undefined"!=typeof window&&void 0!==window.orientation,iA="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version),rA=(iA&&parseFloat(iA[1]),new Map);function oA(e){var t=new Blob([e],{type:"application/javascript"});return URL.createObjectURL(t)}function aA(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(sA(e))i.add(e);else if(sA(e.buffer))i.add(e.buffer);else if(!ArrayBuffer.isView(e)&&t&&"object"==typeof e)for(var r in e)aA(e[r],t,i);return void 0===n?Array.from(i):[]}function sA(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 uA=function(){},cA=function(){function e(t){m(this,e),FP(this,"name",void 0),FP(this,"source",void 0),FP(this,"url",void 0),FP(this,"terminated",!1),FP(this,"worker",void 0),FP(this,"onMessage",void 0),FP(this,"onError",void 0),FP(this,"_loadableURL","");var n=t.name,i=t.source,r=t.url;$P(i||r),this.name=n,this.source=i,this.url=r,this.onMessage=uA,this.onError=function(e){return console.log(e)},this.worker=this._createBrowserWorker()}return b(e,[{key:"destroy",value:function(){this.onMessage=uA,this.onError=uA,this.worker.terminate(),this.terminated=!0}},{key:"isRunning",get:function(){return Boolean(this.onMessage)}},{key:"postMessage",value:function(e,t){t=t||aA(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){$P(e.source&&!e.url||!e.source&&e.url);var t=rA.get(e.source||e.url);return t||(e.url&&(t=function(e){return e.startsWith("http")?oA(function(e){return"try {\n importScripts('".concat(e,"');\n} catch (error) {\n console.error(error);\n throw error;\n}")}(e)):e}(e.url),rA.set(e.url,t)),e.source&&(t=oA(e.source),rA.set(e.source,t))),$P(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}(),lA=function(){function e(t,n){var i=this;m(this,e),FP(this,"name",void 0),FP(this,"workerThread",void 0),FP(this,"isRunning",void 0),FP(this,"result",void 0),FP(this,"_resolve",void 0),FP(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){$P(this.isRunning),this.isRunning=!1,this._resolve(e)}},{key:"error",value:function(e){$P(this.isRunning),this.isRunning=!1,this._reject(e)}}]),e}(),hA=function(){function e(t){m(this,e),FP(this,"name","unnamed"),FP(this,"source",void 0),FP(this,"url",void 0),FP(this,"maxConcurrency",1),FP(this,"maxMobileConcurrency",1),FP(this,"onDebug",function(){}),FP(this,"reuseWorkers",!0),FP(this,"props",{}),FP(this,"jobQueue",[]),FP(this,"idleQueue",[]),FP(this,"count",0),FP(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 Vx(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 Vx(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 lA(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 pA(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 $P(i),i}function vA(e,t){return!!fA.isSupported()&&e.worker&&(null==t?void 0:t.worker)}function gA(e,t,n,i,r){return mA.apply(this,arguments)}function mA(){return(mA=Vx(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=pA(t,i),u=fA.getWorkerFarm(i).getWorkerPool({name:a,url:s}),i=JSON.parse(JSON.stringify(i)),e.next=4,u.startJob("process-on-worker",yA.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 yA(e,t,n,i){return bA.apply(this,arguments)}function bA(){return(bA=Vx(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)}FP(fA,"_workerFarm",void 0);var _A=r(9521);function wA(e){if(function(e){return e&&"object"==typeof e&&e.isBuffer}(e)&&(e=function(e){return _A.toArrayBuffer?_A.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 kA(){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?EA:i,o=0;case 3:if(!(o2&&void 0!==arguments[2]?arguments[2]:null;if(n)return n;var i=M({fetch:qP(t,e)},e);return Array.isArray(i.loaders)||(i.loaders=null),i}function zA(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 UA=function(){var e=HP();return e.loaderRegistry=e.loaderRegistry||[],e.loaderRegistry};function HA(e){var t,n=UA(),i=_(e=Array.isArray(e)?e:[e]);try{var r=function(){var e=dP(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 GA=/\.([^.]+)$/;function WA(e){return qA.apply(this,arguments)}function qA(){return(qA=Vx(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,YA(t)){e.next=5;break}return e.abrupt("return",null);case 5:if(!(o=XA(t,n,I(M({},i),{nothrow:!0}),r))){e.next=8;break}return e.abrupt("return",o);case 8:if(e.t0=uP(t),!e.t0){e.next=18;break}return e.t1=XA,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(KA(t));case 20:return e.abrupt("return",o);case 21:case"end":return e.stop()}},e)}))).apply(this,arguments)}function XA(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(!YA(e))return null;if(n&&!Array.isArray(n))return dP(n);var o=[];n&&(o=o.concat(n)),null!=i&&i.ignoreRegisteredLoaders||(t=o).push.apply(t,v(UA())),function(e){var t,n=_(e);try{for(n.s();!(t=n.n()).done;){dP(t.value)}}catch(i){n.e(i)}finally{n.f()}}(o);var a=function(e,t,n,i){var r=SP(e),o=r.url,a=r.type,s=o||(null==i?void 0:i.url),u=null;return null!=n&&n.mimeType&&(u=$A(t,null==n?void 0:n.mimeType)),u=(u=(u=(u=u||function(e,t){var n=t&&GA.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))||$A(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(QA(t,r))return r}else if(ArrayBuffer.isView(t)){if(ZA(t.buffer,t.byteOffset,r))return r}else if(t instanceof ArrayBuffer&&ZA(t,0,r))return r}}catch(o){i.e(o)}finally{i.f()}return null}(t,e))||$A(t,null==n?void 0:n.fallbackMimeType)}(e,o,i,r);if(!(a||null!=i&&i.nothrow))throw new Error(KA(e));return a}function YA(e){return!(e instanceof Response&&204===e.status)}function KA(e){var t=SP(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)?JA(e.buffer,e.byteOffset,t):e instanceof ArrayBuffer?JA(e,0,t):""}(e),'", contentType: "').concat(i,'"')),n&&(r+=" url: ".concat(n)),r}function $A(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 QA(e,t){return t.testText?t.testText(e):(Array.isArray(t.tests)?t.tests:[t.tests]).some(function(t){return e.startsWith(t)})}function ZA(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(fT(ST(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===rk.DEFAULT&&(n=e.viewport.isGeospatial?rk.LNGLAT:rk.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=zO(i,r,o),l=c.geospatialOrigin,h=c.shaderCoordinateOrigin,d=c.offsetMode,f=ST(e,{viewport:i,modelMatrix:a,coordinateSystem:s,coordinateOrigin:u,offsetMode:d});return d&&function(e,t,n){e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2]}(f,f,i.projectPosition(l||h)),f}(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===rk.DEFAULT||e===rk.LNGLAT||e===rk.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){WS(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=CO(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,d=l.instancePickingColors,f=h||d;f&&(c&&f.constant&&(f.constant=!1,r.invalidate(f.id)),!f.value&&!c&&(f.constant=!0,f.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||!uM({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(cM.length/3);if(this.internalState.usesPickingColorCache=!0,iaM&&ik.warn("Layer has too many data objects. Picking might not be able to distinguish all objects.")(),cM=nS.allocate(cM,n,{size:3,copy:!0,maxCount:Math.max(n,aM)});for(var r=Math.floor(cM.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 lO(this.context.gl,{id:this.props.id,stats:this.context.stats,timeline:this.context.timeline})}},{key:"_initState",value:function(){WS(!this.internalState&&!this.state),WS(isFinite(this.props.coordinateSystem));var e=this._getAttributeManager();e&&e.addInstanced({instancePickingColors:{type:5121,size:3,noAlloc:!0,update:this.calculateInstancePickingColors}}),this.internalState=new tP({attributeManager:e,layer:this}),this.clearChangeFlags(),this.state={},Object.defineProperty(this.state,"attributeManager",{get:function(){return ik.deprecated("layer.state.attributeManager","layer.getAttributeManager()"),e}}),this.internalState.layer=this,this.internalState.uniformTransitions=new pO(this.context.timeline),this.internalState.onAsyncPropUpdated=this._onAsyncPropUpdated.bind(this),this.internalState.setAsyncProps(this.props)}},{key:"_transferState",value:function(e){hC("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}(eP);return e.layerName="Layer",e.defaultProps=lM,e}(),dM=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,d=t.wrapLongitude,f=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:d,positionFormat:f,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 C in b){var E=S[C]||x[C];E&&"accessor"===E.type&&(b[C]=this.getSubLayerAccessor(b[C]))}}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 P=O.value,A=P.getSubLayerProps.call(this,P);A&&Object.assign(y,A,{updateTriggers:Object.assign(y.updateTriggers,A.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=$S(e=this.renderLayers(),Boolean),this.internalState.subLayers=e),hC("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}(hM);return t.layerName="CompositeLayer",t}(),fM=/([0-9]+\.?[0-9]*)(%|px)/;function pM(e){switch(typeof e){case"number":return{position:e,relative:!1};case"string":var t=e.match(fM);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 vM(e,t){return e.relative?Math.round(e.position*t):e.position}function gM(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)&&gM(i,r)))return!1}return!0}var mM=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,d=t.projectionMatrix,f=void 0===d?null:d,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,C=t.type,E=void 0===C?wT:C;WS(!S||S instanceof wT),this.viewportInstance=S,this.id=i||this.constructor.displayName||"view",this.type=E,this.props=I(M({},t),{id:this.id,projectionMatrix:f,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):gM(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:vM(this._x,t),y:vM(this._y,n),width:vM(this._width,t),height:vM(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=pM(t),this._y=pM(n),this._width=pM(i),this._height=pM(r)}}]),e}(),yM=function(){},bM={transitionEasing:function(e){return e},transitionInterruption:1,onTransitionStart:yM,onTransitionInterrupt:yM,onTransitionEnd:yM},_M=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({},bM),n),this.propsInTransition=null,this.transition=new aO(n.timeline),this.onViewStateChange=n.onViewStateChange||yM,this.onStateChange=n.onStateChange||yM,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({},bM),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}(),wM=["longitude","latitude","zoom","bearing","pitch"],kM=["longitude","latitude","zoom"],xM=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:wM,extract:wM,required:kM})).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]=dS(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,dS(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)||!fS(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];WS(Number.isFinite(n)||Array.isArray(n),"".concat(t," is required for transition"))})}}]),e}()),SM={transitionDuration:0},CM={transitionDuration:300,transitionEasing:function(e){return e},transitionInterruption:1},EM=function(e){return 1-(1-e)*(1-e)},OM=["wheel"],TM=["panstart","panmove","panend"],PM=["pinchstart","pinchmove","pinchend"],AM=["tripanstart","tripanmove","tripanend"],MM=["doubletap"],IM=["keydown"],RM=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 _M(t,I(M({},n),{onViewStateChange:this._onTransition.bind(this),onStateChange:this._setInteractionState.bind(this)}));var i=this.linearTransitionProps;this._transition=i&&I(M({},CM),{transitionInterpolator:new xM({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,d=e.touchRotate,f=void 0!==d&&d,p=e.keyboard,v=void 0===p||p,g=Boolean(this.onViewStateChange);this.toggleEvents(OM,g&&i),this.toggleEvents(TM,g&&(o||s)),this.toggleEvents(PM,g&&(h||f)),this.toggleEvents(AM,g&&f),this.toggleEvents(MM,g&&c),this.toggleEvents(IM,g&&v),this.scrollZoom=i,this.dragPan=o,this.dragRotate=s,this.doubleClickZoom=c,this.touchZoom=h,this.touchRotate=f,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,SM,{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,SM,{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:EM}),{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,SM,{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:EM}),{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,SM,{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,SM,{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:EM}),{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,SM,{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,SM,{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:EM}),{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 xM(I(M({},e),{transitionProps:this.linearTransitionProps,makeViewport:this.controllerState.makeViewport}))}):t:SM}}]),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}(),NM=[0,0,0],LM=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,d=void 0===h?NM:h,f=e.zoom,p=void 0===f?0:f,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,C=e.startRotatePos,E=e.startRotationX,O=e.startRotationOrbit,T=e.startZoomPosition,P=e.startZoom;return m(this,n),(i=t.call(this,{width:o,height:a,rotationX:u,rotationOrbit:l,target:d,zoom:p,minRotationX:g,maxRotationX:b,minZoom:w,maxZoom:x}))._state={startPanPosition:S,startRotatePos:C,startRotationX:E,startRotationOrbit:O,startZoomPosition:T,startZoom:P},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,d=h.width,f=h.height;if(!u||!Number.isFinite(c)||!Number.isFinite(l))return this;if(n){var p=(n[0]-u[0])/d;(c<-90||c>90)&&(p*=-1),t={rotationX:c+(n[1]-u[1])/f*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),hS(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=hS(i,n,t),e.rotationX=hS(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),jM=function(e){a(n,e);var t=s(n);function n(e){return m(this,n),t.call(this,LM,e)}return b(n,[{key:"linearTransitionProps",get:function(){return["target","zoom","rotationX","rotationOrbit"]}}]),n}(RM),FM=function(e){a(n,e);var t=s(n);function n(e){return m(this,n),e.dragMode=e.dragMode||"pan",t.call(this,LM,e)}return b(n,[{key:"_onPanRotate",value:function(e){return!1}},{key:"linearTransitionProps",get:function(){return["target","zoom"]}}]),n}(RM),BM=(new $O).lookAt({eye:[0,0,1]});function VM(e){var t=e.width,n=e.height,i=e.near,r=e.far;return t=t||1,n=n||1,(new $O).ortho({left:-t/2,right:t/2,bottom:-n/2,top:n/2,near:i,far:r})}var zM=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,d=void 0===h?[0,0,0]:h,f=e.flipY,p=void 0===f||f,v=Math.pow(2,l);return t.call(this,I(M({},e),{longitude:null,position:d,viewMatrix:BM.clone().scale([v,v*(p?-1:1),v]),projectionMatrix:VM({width:i,height:r,near:a,far:u}),zoom:l}))}return b(n,[{key:"panByPosition",value:function(e,t){var n=HO([],e,GO([],pT(t,this.pixelUnprojectionMatrix)));return{target:HO([],this.center,n)}}}]),n}(wT),UM=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:zM}))}return b(n,[{key:"controller",get:function(){return this._getControllerProps({type:FM})}}]),n}(mM);return e.displayName="OrthographicView",e}(),HM=Math.PI/180;function GM(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*HM/2),u="Z"===i?[0,0,1]:[0,1,0],c="Z"===i?[0,-s,0]:[0,0,s],l=(new $O).lookAt({eye:c,up:u});l.rotateX(r*HM),"Z"===i?l.rotateZ(o*HM):l.rotateY(o*HM);var h=Math.pow(2,a)/(t||1);return l.scale(h),l}var WM=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,d=void 0===h?0:h,f=e.zoom,p=void 0===f?0:f;return(t=n.call(this,I(M({},e),{longitude:null,viewMatrix:GM({height:r,fovy:o,orbitAxis:a,rotationX:l,rotationOrbit:d,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=pT([a,l,c],this.pixelUnprojectionMatrix),d=t(h,3),f=d[0],p=d[1],v=d[2];return[f,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}(wT),qM=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:WM}))}return b(n,[{key:"controller",get:function(){return this._getControllerProps({type:jM})}}]),n}(mM);return e.displayName="OrbitView",e}(),XM=[255,255,255],YM=0,KM=function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};m(this,e);var n=t.color,i=void 0===n?XM:n,r=t.intensity,o=void 0===r?1:r;this.id=t.id||"ambient-".concat(YM++),this.color=i,this.intensity=o,this.type="ambient"},$M=[255,255,255],QM=[0,0,-1],ZM=0,JM=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?$M:n,r=t.intensity,o=void 0===r?1:r,a=t.direction,s=void 0===a?QM:a,u=t._shadow,c=void 0!==u&&u;this.id=t.id||"directional-".concat(ZM++),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}(),eI=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}(),tI=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 Uk(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){Uk(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,d=n&&n[h.id];i(h);var f=this._getDrawLayerParams(h,e);e.view=d;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,f);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=nI(),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 nI(){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]||nI(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 iI=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 Rx(e,{width:1,height:1,parameters:{10241:9729,10240:9729,10242:33071,10243:33071}}),r.depthBuffer=new Lx(e,{format:33189,width:1,height:1}),r.fbo=new $x(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;Hk(this.gl,{depthRange:[0,1],depthTest:!0,blend:!1,clearColor:[1,1,1,1]},function(){var o=t.viewports[0],a=Wk(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}(tI),rI=Object.keys(rk).map(function(e){return"const int COORDINATE_SYSTEM_".concat(e," = ").concat(rk[e],";")}).join(""),oI=Object.keys(ok).map(function(e){return"const int PROJECTION_MODE_".concat(e," = ").concat(ok[e],";")}).join(""),aI="".concat(rI,"\n").concat(oI,"\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"),sI={},uI={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:aI,getUniforms:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:sI;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?rk.DEFAULT:a,u=e.coordinateOrigin,c=e.autoWrapLongitude,l=void 0!==c&&c;s===rk.DEFAULT&&(s=t.isGeospatial?rk.LNGLAT:rk.CARTESIAN);var h=VO({viewport:t,devicePixelRatio:i,coordinateSystem:s,coordinateOrigin:u});return h.project_uWrapLongitude=l,h.project_uModelMatrix=o||jO,h}(e):{}}},cI=SO(function(e){var t=e.viewport,n=e.center;return new $O(t.viewProjectionMatrix).invert().transform(n)}),lI=SO(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=pT([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 $O).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}),hI=[0,0,0,1],dI=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0],fI={name:"shadow",dependencies:[uI],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||hI,shadow_uLightId:e.shadowLightId||0,shadow_uLightCount:e.shadowMatrices.length},i=cI({viewport:e.viewport,center:t.project_uCenter}),r=[],o=lI({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{}}},pI={color:[255,255,255],intensity:1},vI=[{color:[255,255,255],intensity:1,direction:[-1,3,-1]},{color:[255,255,255],intensity:.9,direction:[1,-8,-2.5]}],gI=[0,0,0,200/255],mI=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=gI,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=BE.getDefaultProgramManager(e),fI&&this.programManager.addDefaultModule(fI)),this.dummyShadowMap||(this.dummyShadowMap=new Rx(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=bI++;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}(),wI=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=rM(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}(),kI=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 wI(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 kI({gl:t,protocol:"deck://"}),this.context=I(M({},EI),{layerManager:this,gl:t,deck:i,programManager:t&&CI(t),stats:r||new nx({id:"deck.gl"}),viewport:o||new wT({id:"DEFAULT-INITIAL-VIEWPORT"}),timeline:a||new _I,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){hC("layerManager.setLayers",this,t,e),this.lastRenderedLayers=e;var n,i=_(e=$S(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 hC("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]?ik.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=$S(e,Boolean),this._diffViews(e,this.views)&&this.setNeedsUpdate("views changed"),this.views=e}},{key:"_setViewState",value:function(e){e?(!gM(e,this.viewState)&&this.setNeedsUpdate("viewState changed"),this.viewState=e):ik.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}(),PI=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,d=i.pitch,f=void 0===d?0:d,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,C=i.startPanLngLat,E=i.startZoomLngLat,O=i.startRotatePos,T=i.startBearing,P=i.startPitch,A=i.startZoom,M=i.normalize;return m(this,n),WS(Number.isFinite(u)),WS(Number.isFinite(s)),WS(Number.isFinite(c)),(e=t.call(this,{width:o,height:a,latitude:s,longitude:u,zoom:c,bearing:h,pitch:f,altitude:v,maxZoom:y,minZoom:_,maxPitch:k,minPitch:S,normalize:M}))._state={startPanLngLat:C,startZoomLngLat:E,startRotatePos:O,startBearing:T,startPitch:P,startZoom:A},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=hS(i,n,t);var r=e.maxPitch,o=e.minPitch,a=e.pitch;e.pitch=hS(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=ZO(i+180,360)-180),(c<-180||c>180)&&(c=ZO(c+180,360)-180);var l=eT(n/512);if(o<=l)o=l,r=0;else{var h=n/2/Math.pow(2,o),d=cT([0,h])[1];if(rf&&(r=f)}}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 hS(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=hS(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),AI=function(t){a(i,t);var n=s(i);function i(e){return m(this,i),e.dragMode=e.dragMode||"pan",n.call(this,PI,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}(RM),MI=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:kT}))}return b(n,[{key:"controller",get:function(){return this._getControllerProps({type:AI})}}]),n}(mM);return e.displayName="MapView",e}(),II=new mI,RI=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||!gM(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 mI})||this._internalEffects.push(II)}}]),e}(),DI=function(e){a(n,e);var t=s(n);function n(){return m(this,n),t.apply(this,arguments)}return n}(tI),NI={blendFunc:[1,0,32771,0],blendEquation:32774},LI=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,d=l.y,f=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,Hk(_,I(M({scissorTest:!0,scissor:[h,d,f,v],clearColor:[0,0,0,0],depthMask:!0,depthTest:!0,depthRange:[0,1],colorMask:[!0,!0,!0,!0]},NI),{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({},NI),{blend:!0,blendColor:[0,0,0,this.useAlpha?(t+1)/255:1]});return M(M({},e.props.parameters),n)}}]),i}(tI),jI=function(){function e(t){m(this,e),this.gl=t,this.layerFilter=null,this.drawPickingColors=!1,this.drawLayersPass=new DI(t),this.pickLayersPass=new LI(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||$x.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++,hC("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 $x(this.gl),new $x(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}(),FI={pickedColor:null,pickedLayer:null,pickedObjectIndex:-1};function BI(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,d=-1,f=0,p=0;ph)f+=4*c;else for(var m=0;m=0){var y=m+s-i,b=y*y+g;b<=h&&(h=b,d=f)}f+=4}}if(d>=0){var _=t[d+3]-1,w=t.slice(d,d+4),k=n[_];if(k){var x=k.decodePickingColor(w),S=Math.floor(d/4/c);return{pickedColor:w,pickedLayer:k,pickedObjectIndex:x,pickedX:s+(d/4-S*c),pickedY:u+S}}ik.error("Picked non-existent layer. Is picking buffer corrupt?")()}}return FI}function VI(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 zI(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 d=r.find(function(e){return e.props.id===l});d&&u.unshift(d)}n.layerId=h,n.index=s,n.info=null}}var f=VI(e),p=new Map;return p.set(null,f),u.forEach(function(e){var t=M({},f);e===a&&(t.color=o,t.index=s,t.picked=!0),t=UI({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 UI(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 HI=function(){function e(t){m(this,e),this.gl=t,this.pickingFBO=null,this.pickLayersPass=new LI(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 $x(e),$x.isSupported(e,{colorBufferFloat:!0})&&(this.depthFBO=new $x(e),this.depthFBO.attach({36064:new Rx(e,{format:lk(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?(ik.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,d=e.unproject3D,f=e.onViewportActive;if(!(t=this._getPickable(t)))return{result:[],emptyInfo:VI({viewports:i,x:r,y:o})};this._resizeBuffer();for(var p,v=Wk(this.gl),g=qk(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=[],C={},E=0;E=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)}):ik.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(f),S=0;S=f);S++){var C=w[S],E={color:C.pickedColor,layer:null,index:C.pickedObjectIndex,picked:!0,x:r,y:o,width:s,height:c,pixelRatio:v};E=UI({layer:C.pickedLayer,info:E,mode:h}),k.has(E.object)||k.set(E.object,E)}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,d=o.width,f=o.height,p=new(u?Float32Array:Uint8Array)(d*f*4);return qx(c,{sourceX:l,sourceY:h,sourceWidth:d,sourceHeight:f,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}(),GI={zIndex:1,position:"absolute",pointerEvents:"none",color:"#a0a7b4",backgroundColor:"#29323c",padding:"10px",top:0,left:0,display:"none"},WI=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,GI),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 qI(e,t){if(!e)throw new Error(t)}var XI={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},YI=XI.global||XI.self||XI.window,KI="object"!=typeof process||"[object process]"!==String(process)||process.browser,$I="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version),QI=($I&&parseFloat($I[1]),YI)._parseImageNode,ZI="undefined"!=typeof Image,JI="undefined"!=typeof ImageBitmap,eR=Boolean(QI),tR=!!KI||eR;function nR(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 iR=/^data:image\/svg\+xml/,rR=/\.svg((\?|#).*)?$/;function oR(e){return e&&(iR.test(e)||rR.test(e))}function aR(e,t){if(oR(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 sR(e,t)}function sR(e,t){if(oR(t))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(e)])}function uR(e,t,n){return cR.apply(this,arguments)}function cR(){return(cR=Vx(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=aR(t,i),o=self.URL||self.webkitURL,a="string"!=typeof r&&o.createObjectURL(r),e.prev=1,e.next=4,lR(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 lR(e,t){return hR.apply(this,arguments)}function hR(){return(hR=Vx(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 dR={},fR=!0;function pR(e,t,n){return vR.apply(this,arguments)}function vR(){return(vR=Vx(regeneratorRuntime.mark(function e(t,n,i){var r,o;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!oR(i)){e.next=6;break}return e.next=3,uR(t,n,i);case 3:e.t0=e.sent,e.next=7;break;case 6:e.t0=sR(t,i);case 7:return r=e.t0,o=n&&n.imagebitmap,e.next=11,gR(r,o);case 11:return e.abrupt("return",e.sent);case 12:case"end":return e.stop()}},e)}))).apply(this,arguments)}function gR(e){return mR.apply(this,arguments)}function mR(){return(mR=Vx(regeneratorRuntime.mark(function e(t){var n,i=arguments;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if((yR(n=i.length>1&&void 0!==i[1]?i[1]:null)||!fR)&&(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),fR=!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 yR(e){for(var t in e||dR)return!1;return!0}var bR=!1,_R=!0;function wR(e){var t=kR(e);return function(e){var t=kR(e);return t.byteLength>=24&&2303741511===t.getUint32(0,bR)?{mimeType:"image/png",width:t.getUint32(16,bR),height:t.getUint32(20,bR)}:null}(t)||function(e){var t=kR(e);if(!(t.byteLength>=3&&65496===t.getUint16(0,bR)&&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,bR)?{mimeType:"image/gif",width:t.getUint16(6,_R),height:t.getUint16(8,_R)}:null}(t)||function(e){var t=kR(e);return t.byteLength>=14&&16973===t.getUint16(0,bR)&&t.getUint32(2,_R)===t.byteLength?{mimeType:"image/bmp",width:t.getUint32(18,_R),height:t.getUint32(22,_R)}:null}(t)}function kR(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 xR(e,t){var n=(wR(e)||{}).mimeType,i=YI._parseImageNode;return qI(i),i(e,n,t)}function SR(){return(SR=Vx(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=CR(r),e.next="imagebitmap"===e.t0?4:"image"===e.t0?8:"data"===e.t0?12:16;break;case 4:return e.next=6,pR(t,n,o);case 6:return a=e.sent,e.abrupt("break",17);case 8:return e.next=10,uR(t,n,o);case 10:return a=e.sent,e.abrupt("break",17);case 12:return e.next=14,xR(t,n);case 14:return a=e.sent,e.abrupt("break",17);case 16:qI(!1);case 17:return e.abrupt("return",("data"===r&&(a=nR(a)),a));case 18:case"end":return e.stop()}},e)}))).apply(this,arguments)}function CR(e){switch(e){case"auto":case"data":return function(){if(JI)return"imagebitmap";if(ZI)return"image";if(tR)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}();default:return function(e){switch(e){case"auto":return JI||ZI||tR;case"imagebitmap":return JI;case"image":return ZI;case"data":return tR;default:throw new Error("@loaders.gl/images: image ".concat(e," not supported in this environment"))}}(e),e}}var ER={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 SR.apply(this,arguments)},tests:[function(e){return Boolean(wR(new DataView(e)))}],options:{image:{type:"auto",decode:!0}}},OR=r(84761),TR={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},PR="8.5.8",AR=OR.CO.deck&&OR.CO.deck.VERSION;if(AR&&AR!==PR)throw new Error("deck.gl - multiple versions detected: ".concat(AR," vs ").concat(PR));AR||(ik.log(1,"deck.gl ".concat(PR))(),OR.CO.deck=Object.assign(OR.CO.deck||{},{VERSION:PR,version:PR,log:ik,_registerLoggers:function(e){lC=e}}),HA([TR,[ER,{imagebitmap:{premultiplyAlpha:"none"}}]]));var MR=OR.CO.deck,IR=function(e,t){a(i,e);var n=s(i);function i(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return m(this,i),(t=n.call(this,e,r)).target=null,t._queryPending=!1,t._pollingPromise=null,Object.seal(c(t)),t}return b(i,[{key:t,get:function(){return"Query"}},{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 i.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=lk(e),r=Jx(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:ox(!1)}}}catch(u){a.e(u)}finally{a.f()}return o}}]),i}(px,Symbol.toStringTag),RR=Gk()&&"undefined"!=typeof document,DR=0,NR=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 Zk(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,d=t.onError,f=t.gl,p=void 0===f?null:f,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,C=void 0===S||S,E=t.stats,O=void 0===E?rx.get("animation-loop-"+DR++):E,T=t.useDevicePixels,P=void 0===T||T;"useDevicePixelRatio"in t&&(sk.deprecated("useDevicePixelRatio","useDevicePixels")(),P=t.useDevicePixelRatio),this.props={onCreateContext:i,onAddHTML:o,onInitialize:s,onRender:c,onFinalize:h,onError:d,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:C,useDevicePixels:P}),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 ox("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=IR.isSupported(e.gl,["timers"])?new IR(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 Vx(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 sk.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=RR?new Promise(function(e,t){RR&&"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),!ck(this.gl))throw new Error("AnimationLoop.onCreateContext - illegal context returned");(function(e){Uk(e,Sk)})(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)&&(sk.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)&&(sk.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 $x(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}(),LR=r(11524),jR=r.n(LR),FR={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}))}}(jR().MouseInput);var BR=jR().Manager,VR=jR(),zR=VR?[[VR.Pan,{event:"tripan",pointers:3,threshold:0,enable:!1}],[VR.Rotate,{enable:!1}],[VR.Pinch,{enable:!1}],[VR.Swipe,{enable:!1}],[VR.Pan,{threshold:0,enable:!1}],[VR.Press,{enable:!1}],[VR.Tap,{event:"doubletap",taps:2,enable:!1}],[VR.Tap,{event:"anytap",enable:!1}],[VR.Tap,{enable:!1}]]:null,UR={tripan:["rotate","pinch","pan"],rotate:["pinch"],pinch:["pan"],pan:["press","doubletap","anytap","tap"],doubletap:["anytap"],anytap:["tap"]},HR={doubletap:["tap"]},GR={pointerdown:"pointerdown",pointermove:"pointermove",pointerup:"pointerup",touchstart:"pointerdown",touchmove:"pointermove",touchend:"pointerup",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup"},WR=["keydown","keyup"],qR=["mousedown","mousemove","mouseup","mouseover","mouseout","mouseleave"],XR=["wheel","mousewheel"],YR={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"},KR={click:"tap",anyclick:"anytap",dblclick:"doubletap",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup",mouseover:"pointerover",mouseout:"pointerout",mouseleave:"pointerleave"},$R="undefined"!=typeof navigator&&navigator.userAgent?navigator.userAgent.toLowerCase():"",QR="undefined"!=typeof window?window:global;"undefined"!=typeof global?global:window,"undefined"!=typeof document&&document;var ZR=!1;try{var JR={get passive(){return ZR=!0,!0}};QR.addEventListener("test",JR,JR),QR.removeEventListener("test",JR,JR)}catch(G){}var eD=-1!==$R.indexOf("firefox"),tD=XR,nD=4.000244140625,iD=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=tD.concat(r.events||[]),this.handleEvent=this.handleEvent.bind(this),this.events.forEach(function(e){return t.addEventListener(e,i.handleEvent,!!ZR&&{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;QR.WheelEvent&&(eD&&e.deltaMode===QR.WheelEvent.DOM_DELTA_PIXEL&&(t/=QR.devicePixelRatio),e.deltaMode===QR.WheelEvent.DOM_DELTA_LINE&&(t*=40));var n={x:e.clientX,y:e.clientY};0!==t&&t%nD==0&&(t=Math.floor(t/nD)),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}(),rD=qR,oD="pointermove",aD="pointerover",sD="pointerout",uD="pointerleave",cD=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=rD.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===oD&&(this.enableMoveEvent=t),e===aD&&(this.enableOverEvent=t),e===sD&&(this.enableOutEvent=t),e===uD&&(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:aD,srcEvent:e,pointerType:"mouse",target:e.target})}},{key:"handleOutEvent",value:function(e){this.enableOutEvent&&"mouseout"===e.type&&this.callback({type:sD,srcEvent:e,pointerType:"mouse",target:e.target})}},{key:"handleLeaveEvent",value:function(e){this.enableLeaveEvent&&"mouseleave"===e.type&&this.callback({type:uD,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:oD,srcEvent:e,pointerType:"mouse",target:e.target});break;case"mouseup":this.pressed=!1}}}]),e}(),lD=WR,hD="keydown",dD=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=lD.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===hD&&(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:hD,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}(),fD="contextmenu",pD=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===fD&&(this.options.enable=t)}},{key:"handleEvent",value:function(e){!this.options.enable||this.callback({type:fD,center:{x:e.clientX,y:e.clientY},srcEvent:e,pointerType:"mouse",target:e.target})}}]),e}(),vD={pointerdown:1,pointermove:2,pointerup:4,mousedown:1,mousemove:2,mouseup:4},gD={srcElement:"root",priority:0},mD=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({},gD,n):gD;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({},yD,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||zR}).on("hammer.input",this._onBasicInput),i.recognizers||Object.keys(UR).forEach(function(e){var t=n.manager.get(e);t&&UR[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 iD(e,this._onOtherEvent,{enable:!1}),this.moveInput=new cD(e,this._onOtherEvent,{enable:!1}),this.keyInput=new dD(e,this._onOtherEvent,{enable:!1,tabIndex:i.tabIndex}),this.contextmenuInput=new pD(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(d){u.e(d)}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=HR[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=KR[e]||e,u=a.get(s);u||(u=new mD(this),a.set(s,u),u.recognizerName=YR[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(KR[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=GR[t.type];n&&this.manager.emit(n,e)}},{key:"_onOtherEvent",value:function(e){this.manager.emit(e.type,e)}}]),e}();function _D(){}var wD={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:function(e,t){return ik.error(e)()},_onMetrics:null,getCursor:function(e){return e.isDragging?"grabbing":"grab"},debug:!1,drawPickingColors:!1},kD=function(){function e(t){m(this,e),t=M(M({},wD),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&&ik.warn("View state tracking is disabled. Use either `initialViewState` for auto update or `viewState` for manual update.")(),"IE"===(0,OR.qs)()&&ik.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 nx({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&&nS.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&&ik.removed("onLayerHover","onHover")(),"onLayerClick"in e&&ik.removed("onLayerClick","onClick")(),e.initialViewState&&!gM(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&&WS(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 NR({width:n,height:i,useDevicePixels:l,autoResizeDrawingBuffer:h,autoResizeViewport:!1,gl:r,onCreateContext:function(e){return Zk(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 MI({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 WI(this.canvas),Uk(e,{blend:!0,blendFunc:[770,771,1,771],polygonOffsetFill:!0,depthTest:!0,depthFunc:515}),this.props.onWebGLInitialized(e);var t=new _I;for(var n in t.play(),this.animationLoop.attachTimeline(t),this.eventManager=new bD(this.props.parent||e.canvas,{touchAction:this.props.touchAction,recognizerOptions:this.props.eventRecognizerOptions,events:{pointerdown:this._onPointerDown,pointermove:this._onPointerMove,pointerleave:this._onPointerMove}}),ak)this.eventManager.on(n,this._onEvent);this.viewManager=new TI({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 OI(e,{deck:this,stats:this.stats,viewport:i,timeline:t}),this.effectManager=new RI,this.deckRenderer=new jI(e),this.deckPicker=new HI(e),this.setProps(this.props),this._updateCanvasSize(),this.props.onLoad()}}},{key:"_drawLayers",value:function(e,t){var n=this.layerManager.context.gl;Uk(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(),ik.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=ak[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=rx.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}();kD.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(eI)),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}},kD.defaultProps=wD,kD.VERSION=MR.VERSION;var xD={name:"project32",dependencies:[uI],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"},SD={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]:SD,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}}),ED={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},OD=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?cx("geometry"):n,r=t.drawMode,o=void 0===r?ED.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,ox(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?(ox(!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 ox(Number.isFinite(n)),n}}],[{key:"DRAW_MODE",get:function(){return ED}}]),e}(),TD=function(){},PD={10241:9987,10240:9729,10242:33071,10243:33071};function AD(e){return Math.pow(2,Math.ceil(Math.log2(e)))}function MD(e){return e&&(e.id||e.url)}function ID(e,t,n){for(var i=0;i0){var n=function(e){for(var t=e.icons,n=e.buffer,i=e.mapping,r=void 0===i?{}:i,o=e.xOffset,a=void 0===o?0:o,s=e.yOffset,u=void 0===s?0:s,c=e.rowHeight,l=void 0===c?0:c,h=e.canvasWidth,d=[],f=0;fh&&(ID(r,d,u),a=0,u=l+u+n,l=0,d=[]),d.push({icon:p,xOffset:a}),a=a+g+n,l=Math.max(l,v)}}return d.length>0&&ID(r,d,u),{mapping:r,rowHeight:l,xOffset:a,yOffset:u,canvasWidth:h,canvasHeight:AD(l+u+n)}}({icons:t,buffer:this._buffer,canvasWidth:this._canvasWidth,mapping:this._mapping,rowHeight:this._rowHeight,xOffset:this._xOffset,yOffset:this._yOffset}),i=n.mapping,r=n.xOffset,o=n.yOffset,a=n.rowHeight,s=n.canvasHeight;this._rowHeight=a,this._mapping=i,this._xOffset=r,this._yOffset=o,this._canvasHeight=s,this._texture||(this._texture=new Rx(this.gl,{width:this._canvasWidth,height:this._canvasHeight,parameters:PD})),this._texture.height!==this._canvasHeight&&(this._texture=function(e,t,n,i){var r=t.width,o=t.height,a=Gx(t,{width:n,height:i});return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=n.sourceX,r=void 0===i?0:i,o=n.sourceY,a=void 0===o?0:o,s=n.targetMipmaplevel,u=void 0===s?0:s,c=n.targetInternalFormat,l=void 0===c?6408:c,h=n.targetX,d=n.targetY,f=n.targetZ,p=n.width,v=n.height,g=Yx(e),m=g.framebuffer,y=g.deleteFramebuffer;ox(m);var b=m.gl,_=m.handle,w=void 0!==h||void 0!==d||void 0!==f;h=h||0,d=d||0,f=f||0;var k=b.bindFramebuffer(36160,_);ox(t);var x=null;if(t instanceof Mx&&(x=t,p=Number.isFinite(p)?p:x.width,v=Number.isFinite(v)?v:x.height,x.bind(0),t=x.target),w)switch(t){case 3553:case 34067:b.copyTexSubImage2D(t,u,h,d,r,a,p,v);break;case 35866:case 32879:dk(b).copyTexSubImage3D(t,u,h,d,f,r,a,p,v)}else b.copyTexImage2D(t,u,l,r,a,p,v,0);x&&x.unbind(),b.bindFramebuffer(36160,k||null),y&&m.delete()}(t,a,{targetY:0,width:r,height:o}),t.delete(),a}(0,this._texture,this._canvasWidth,this._canvasHeight)),this.onUpdate(),this._loadIcons(t)}}},{key:"_loadIcons",value:function(e){var t,n=this,i=this._canvas.getContext("2d"),r=_(e);try{var o=function(){var e=t.value;n._pendingCount++,rM(e.url,ER,n._loadOptions).then(function(t){var r=MD(e),o=n._mapping[r],a=o.x,s=o.y,u=o.width,c=o.height,l=function(e,t,n,i){return n===t.width&&i===t.height?t:(e.canvas.height=i,e.canvas.width=n,e.clearRect(0,0,e.canvas.width,e.canvas.height),e.drawImage(t,0,0,t.width,t.height,0,0,n,i),e.canvas)}(i,t,u,c);n._texture.setSubImageData({data:l,x:a,y:s,width:u,height:c}),n._texture.generateMipmap(),n.onUpdate()}).catch(function(t){n.onError({url:e.url,source:e.source,sourceIndex:e.sourceIndex,loadOptions:n._loadOptions,error:t})}).finally(function(){n._pendingCount--})};for(r.s();!(t=r.n()).done;)o()}catch(a){r.e(a)}finally{r.f()}}}]),e}(),DD=[0,0,0,255],ND={iconAtlas:{type:"image",value:null,async:!0},iconMapping:{type:"object",value:{},async:!0},sizeScale:{type:"number",value:1,min:0},billboard:!0,sizeUnits:"pixels",sizeMinPixels:{type:"number",min:0,value:0},sizeMaxPixels:{type:"number",min:0,value:Number.MAX_SAFE_INTEGER},alphaCutoff:{type:"number",value:.05,min:0,max:1},getPosition:{type:"accessor",value:function(e){return e.position}},getIcon:{type:"accessor",value:function(e){return e.icon}},getColor:{type:"accessor",value:DD},getSize:{type:"accessor",value:1},getAngle:{type:"accessor",value:0},getPixelOffset:{type:"accessor",value:[0,0]},onIconError:{type:"function",value:null,compare:!1,optional:!0}},LD=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(){return e(p(i.prototype),"getShaders",this).call(this,{vs:"#define SHADER_NAME icon-layer-vertex-shader\n\nattribute vec2 positions;\n\nattribute vec3 instancePositions;\nattribute vec3 instancePositions64Low;\nattribute float instanceSizes;\nattribute float instanceAngles;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\nattribute vec4 instanceIconFrames;\nattribute float instanceColorModes;\nattribute vec2 instanceOffsets;\nattribute vec2 instancePixelOffset;\n\nuniform float sizeScale;\nuniform vec2 iconsTextureDim;\nuniform float sizeMinPixels;\nuniform float sizeMaxPixels;\nuniform bool billboard;\n\nvarying float vColorMode;\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\nvarying vec2 uv;\n\nvec2 rotate_by_angle(vec2 vertex, float angle) {\n float angle_radian = angle * PI / 180.0;\n float cos_angle = cos(angle_radian);\n float sin_angle = sin(angle_radian);\n mat2 rotationMatrix = mat2(cos_angle, -sin_angle, sin_angle, cos_angle);\n return rotationMatrix * vertex;\n}\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n geometry.uv = positions;\n geometry.pickingColor = instancePickingColors;\n uv = positions;\n\n vec2 iconSize = instanceIconFrames.zw;\n float sizePixels = clamp(\n project_size_to_pixel(instanceSizes * sizeScale), \n sizeMinPixels, sizeMaxPixels\n );\n float instanceScale = iconSize.y == 0.0 ? 0.0 : sizePixels / iconSize.y;\n vec2 pixelOffset = positions / 2.0 * iconSize + instanceOffsets;\n pixelOffset = rotate_by_angle(pixelOffset, instanceAngles) * instanceScale;\n pixelOffset += instancePixelOffset;\n pixelOffset.y *= -1.0;\n\n if (billboard) {\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, vec3(0.0), geometry.position);\n vec3 offset = vec3(pixelOffset, 0.0);\n DECKGL_FILTER_SIZE(offset, geometry);\n gl_Position.xy += project_pixel_size_to_clipspace(offset.xy);\n\n } else {\n vec3 offset_common = vec3(project_pixel_size(pixelOffset), 0.0);\n DECKGL_FILTER_SIZE(offset_common, geometry);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, offset_common, geometry.position); \n }\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n vTextureCoords = mix(\n instanceIconFrames.xy,\n instanceIconFrames.xy + iconSize,\n (positions.xy + 1.0) / 2.0\n ) / iconsTextureDim;\n\n vColor = instanceColors;\n DECKGL_FILTER_COLOR(vColor, geometry);\n\n vColorMode = instanceColorModes;\n}\n",fs:"#define SHADER_NAME icon-layer-fragment-shader\n\nprecision highp float;\n\nuniform float opacity;\nuniform sampler2D iconsTexture;\nuniform float alphaCutoff;\n\nvarying float vColorMode;\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\nvarying vec2 uv;\n\nvoid main(void) {\n geometry.uv = uv;\n\n vec4 texColor = texture2D(iconsTexture, vTextureCoords);\n vec3 color = mix(texColor.rgb, vColor.rgb, vColorMode);\n float a = texColor.a * opacity * vColor.a;\n\n if (a < alphaCutoff) {\n discard;\n }\n\n gl_FragColor = vec4(color, a);\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:[xD,CD]})}},{key:"initializeState",value:function(){this.state={iconManager:new RD(this.context.gl,{onUpdate:this._onUpdate.bind(this),onError:this._onError.bind(this)})},this.getAttributeManager().addInstanced({instancePositions:{size:3,type:5130,fp64:this.use64bitPositions(),transition:!0,accessor:"getPosition"},instanceSizes:{size:1,transition:!0,accessor:"getSize",defaultValue:1},instanceOffsets:{size:2,accessor:"getIcon",transform:this.getInstanceOffset},instanceIconFrames:{size:4,accessor:"getIcon",transform:this.getInstanceIconFrame},instanceColorModes:{size:1,type:5121,accessor:"getIcon",transform:this.getInstanceColorMode},instanceColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:!0,accessor:"getColor",defaultValue:DD},instanceAngles:{size:1,transition:!0,accessor:"getAngle"},instancePixelOffset:{size:2,transition:!0,accessor:"getPixelOffset"}})}},{key:"updateState",value:function(t){var n=t.oldProps,r=t.props,o=t.changeFlags;e(p(i.prototype),"updateState",this).call(this,{props:r,oldProps:n,changeFlags:o});var a=this.getAttributeManager(),s=r.iconAtlas,u=r.iconMapping,c=r.data,l=r.getIcon,h=this.state.iconManager;h.setProps({loadOptions:r.loadOptions});var d=!1;if(s||this.internalState.isAsyncPropLoading("iconAtlas")?(n.iconAtlas!==r.iconAtlas&&h.setProps({iconAtlas:s,autoPacking:!1}),n.iconMapping!==r.iconMapping&&(h.setProps({iconMapping:u}),d=!0)):h.setProps({autoPacking:!0}),(o.dataChanged||o.updateTriggersChanged&&(o.updateTriggersChanged.all||o.updateTriggersChanged.getIcon))&&h.setProps({data:c,getIcon:l}),d&&(a.invalidate("instanceOffsets"),a.invalidate("instanceIconFrames"),a.invalidate("instanceColorModes")),o.extensionsChanged){var f,v=this.context.gl;null===(f=this.state.model)||void 0===f||f.delete(),this.state.model=this._getModel(v),a.invalidateAll()}}},{key:"isLoaded",get:function(){return e(p(i.prototype),"isLoaded",this)&&this.state.iconManager.isLoaded}},{key:"finalizeState",value:function(){e(p(i.prototype),"finalizeState",this).call(this),this.state.iconManager.finalize()}},{key:"draw",value:function(e){var t=e.uniforms,n=this.props,i=n.sizeScale,r=n.sizeMinPixels,o=n.sizeMaxPixels,a=n.sizeUnits,s=n.billboard,u=n.alphaCutoff,c=this.state.iconManager,l=this.context.viewport,h=c.getTexture();h&&this.state.model.setUniforms(t).setUniforms({iconsTexture:h,iconsTextureDim:[h.width,h.height],sizeScale:i*("pixels"===a?l.metersPerPixel:1),sizeMinPixels:r,sizeMaxPixels:o,billboard:s,alphaCutoff:u}).draw()}},{key:"_getModel",value:function(e){return new nO(e,I(M({},this.getShaders()),{id:this.props.id,geometry:new OD({drawMode:6,attributes:{positions:{size:2,value:new Float32Array([-1,-1,-1,1,1,1,1,-1])}}}),isInstanced:!0}))}},{key:"_onUpdate",value:function(){this.setNeedsRedraw()}},{key:"_onError",value:function(e){var t=this.getCurrentLayer().props.onIconError;t?t(e):ik.error(e.error)()}},{key:"getInstanceOffset",value:function(e){var t=this.state.iconManager.getIconMapping(e);return[t.width/2-t.anchorX||0,t.height/2-t.anchorY||0]}},{key:"getInstanceColorMode",value:function(e){return this.state.iconManager.getIconMapping(e).mask?1:0}},{key:"getInstanceIconFrame",value:function(e){var t=this.state.iconManager.getIconMapping(e);return[t.x||0,t.y||0,t.width||0,t.height||0]}}]),i}(hM);return t.layerName="IconLayer",t.defaultProps=ND,t}(),jD=[],FD={getIconOffsets:{type:"accessor",value:function(e){return e.offsets}},alphaCutoff:.001,smoothing:.1,outlineWidth:0,outlineColor:{type:"color",value:[0,0,0,255]}},BD=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(){return I(M({},e(p(i.prototype),"getShaders",this).call(this)),{fs:"#define SHADER_NAME multi-icon-layer-fragment-shader\n\nprecision highp float;\n\nuniform float opacity;\nuniform sampler2D iconsTexture;\nuniform float gamma;\nuniform bool sdf;\nuniform float alphaCutoff;\nuniform float buffer;\nuniform float outlineBuffer;\nuniform vec4 outlineColor;\n\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\nvarying vec2 uv;\n\nvoid main(void) {\n geometry.uv = uv;\n\n if (!picking_uActive) {\n float alpha = texture2D(iconsTexture, vTextureCoords).a;\n vec4 color = vColor;\n if (sdf) {\n float distance = alpha;\n alpha = smoothstep(buffer - gamma, buffer + gamma, distance);\n\n if (outlineBuffer > 0.0) {\n float inFill = alpha;\n float inBorder = smoothstep(outlineBuffer - gamma, outlineBuffer + gamma, distance);\n color = mix(outlineColor, vColor, inFill);\n alpha = inBorder;\n }\n }\n float a = alpha * color.a;\n \n if (a < alphaCutoff) {\n discard;\n }\n\n gl_FragColor = vec4(color.rgb, a * opacity);\n }\n\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n"})}},{key:"initializeState",value:function(){var t=this;e(p(i.prototype),"initializeState",this).call(this),this.getAttributeManager().addInstanced({instanceOffsets:{size:2,accessor:"getIconOffsets"},instancePickingColors:{type:5121,size:3,accessor:function(e,n){var i=n.index,r=n.target;return t.encodePickingColor(i,r)}}})}},{key:"updateState",value:function(t){e(p(i.prototype),"updateState",this).call(this,t);var n=t.props,r=t.oldProps,o=n.outlineColor;o!==r.outlineColor&&((o=o.map(function(e){return e/255}))[3]=Number.isFinite(o[3])?o[3]:1,this.setState({outlineColor:o})),!n.sdf&&n.outlineWidth&&ik.warn("".concat(this.id,": fontSettings.sdf is required to render outline"))()}},{key:"draw",value:function(t){var n=this.props,r=n.sdf,o=n.smoothing,a=n.outlineWidth,s=this.state.outlineColor;t.uniforms=I(M({},t.uniforms),{buffer:.75,outlineBuffer:a?Math.max(o,.75*(1-a)):-1,gamma:o,sdf:Boolean(r),outlineColor:s}),e(p(i.prototype),"draw",this).call(this,t)}},{key:"getInstanceOffset",value:function(t){var n=this;return t?Array.from(t).map(function(t){return e(p(i.prototype),"getInstanceOffset",n).call(n,t)}):jD}},{key:"getInstanceColorMode",value:function(e){return 1}},{key:"getInstanceIconFrame",value:function(t){var n=this;return t?Array.from(t).map(function(t){return e(p(i.prototype),"getInstanceIconFrame",n).call(n,t)}):jD}}]),i}(LD);return t.layerName="MultiIconLayer",t.defaultProps=FD,t}(),VD=r(51002),zD=r.n(VD),UD=[];function HD(e){return Math.pow(2,Math.ceil(Math.log2(e)))}function GD(e,t,n,i){for(var r=0,o=t;oi&&(a4&&void 0!==arguments[4]?arguments[4]:0,o=arguments.length>5?arguments[5]:void 0;void 0===o&&(o=e.length);var a=[];return"break-all"===t?WD(e,r,o,n,i,a):function(e,t,n,i,r,o){for(var a=t,s=t,u=t,c=0,l=t;ls){var h=GD(e,s,u,r);c+h>i&&(ai&&(h=WD(e,s,u,i,r,o),a=o[o.length-1])),s=u,c+=h}}(e,r,o,n,i,a),a}function XD(e,t,n,i,r,o){for(var a=0,s=0,u=t;u0,l=[0,0],h=[],d=0,f=0,p=0,v=0;v<=o;v++){var g=e[v];if(("\n"===g||v===o)&&(p=v),p>f){for(var m=c?qD(e,n,i,r,f,p):UD,y=0;y<=m.length;y++){var b=0===y?f:m[y-1],_=y0&&void 0!==arguments[0]?arguments[0]:5;m(this,e),this.limit=t,this.clear()}return b(e,[{key:"clear",value:function(){this._cache={},this._order=[]}},{key:"get",value:function(e){var t=this._cache[e];return t&&(this._deleteOrder(e),this._appendOrder(e)),t}},{key:"set",value:function(e,t){this._cache[e]?(this.delete(e),this._cache[e]=t,this._appendOrder(e)):(Object.keys(this._cache).length===this.limit&&this.delete(this._order[0]),this._cache[e]=t,this._appendOrder(e))}},{key:"delete",value:function(e){this._cache[e]&&(this._deleteCache(e),this._deleteOrder(e))}},{key:"_deleteCache",value:function(e){delete this._cache[e]}},{key:"_deleteOrder",value:function(e){var t=this._order.findIndex(function(t){return t===e});t>=0&&this._order.splice(t,1)}},{key:"_appendOrder",value:function(e){this._order.push(e)}}]),e}())(3),ZD=["fontFamily","fontWeight","characterSet","fontSize","sdf","buffer","cutoff","radius"];function JD(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};ZD.forEach(function(n){n in t&&(e.props[n]=t[n])});var n=this._key;this._key=this._getKey();var i=function(e,t){var n=QD.get(e);if(!n)return t;var i=[],r=Object.keys(n.mapping);r=new Set(r);var o=t;return o instanceof Array&&(o=new Set(o)),o.forEach(function(e){r.has(e)||i.push(e)}),i}(this._key,this.props.characterSet),r=QD.get(this._key);if(r&&0===i.length)this._key!==n&&(this._atlas=r);else{var o=this._generateFontAtlas(this._key,i,r);this._atlas=o,QD.set(this._key,o)}}},{key:"_generateFontAtlas",value:function(e,t,n){var i=this.props,r=i.fontFamily,o=i.fontWeight,a=i.fontSize,s=i.buffer,u=i.sdf,c=i.radius,l=i.cutoff,h=n&&n.data;h||((h=document.createElement("canvas")).width=1024);var d=h.getContext("2d");eN(d,r,a,o);var f=function(e){var t,n=e.characterSet,i=e.getFontWidth,r=e.fontHeight,o=e.buffer,a=e.maxCanvasWidth,s=e.mapping,u=void 0===s?{}:s,c=e.xOffset,l=void 0===c?0:c,h=e.yOffset,d=void 0===h?0:h,f=0,p=l,v=0,g=_(n);try{for(g.s();!(t=g.n()).done;){var m=t.value;if(!u[m]){var y=i(m,v++);p+y+2*o>a&&(p=0,f++),u[m]={x:p+o,y:d+f*(r+2*o)+o,width:y,height:r},p+=y+2*o}}}catch(w){g.e(w)}finally{g.f()}var b=r+2*o;return{mapping:u,xOffset:p,yOffset:d+f*b,canvasHeight:HD(d+(f+1)*b)}}(M({getFontWidth:function(e){return d.measureText(e).width},fontHeight:1.2*a,buffer:s,characterSet:t,maxCanvasWidth:1024},n&&{mapping:n.mapping,xOffset:n.xOffset,yOffset:n.yOffset})),p=f.mapping,v=f.canvasHeight,g=f.xOffset,m=f.yOffset;if(h.height!==v){var y=d.getImageData(0,0,h.width,h.height);h.height=v,d.putImageData(y,0,0)}if(eN(d,r,a,o),u){var b,w=new(zD())(a,s,c,l,r,o),k=d.getImageData(0,0,w.size,w.size),x=_(t);try{for(x.s();!(b=x.n()).done;){var S=b.value;JD(w.draw(S),k),d.putImageData(k,p[S].x-s,p[S].y+s)}}catch(T){x.e(T)}finally{x.f()}}else{var C,E=_(t);try{for(E.s();!(C=E.n()).done;){var O=C.value;d.fillText(O,p[O].x,p[O].y+.9*a)}}catch(T){E.e(T)}finally{E.f()}}return{xOffset:g,yOffset:m,mapping:p,data:h,width:h.width,height:h.height}}},{key:"_getKey",value:function(){var e=this.props,t=e.fontFamily,n=e.fontWeight,i=e.fontSize,r=e.buffer,o=e.sdf,a=e.radius,s=e.cutoff;return o?"".concat(t," ").concat(n," ").concat(i," ").concat(r," ").concat(a," ").concat(s):"".concat(t," ").concat(n," ").concat(i," ").concat(r)}}]),e}(),nN={billboard:!0,sizeScale:1,sizeUnits:"pixels",sizeMinPixels:0,sizeMaxPixels:Number.MAX_SAFE_INTEGER,padding:{type:"array",value:[0,0,0,0]},getPosition:{type:"accessor",value:function(e){return e.position}},getSize:{type:"accessor",value:1},getAngle:{type:"accessor",value:0},getPixelOffset:{type:"accessor",value:[0,0]},getBoundingRect:{type:"accessor",value:[0,0,0,0]},getFillColor:{type:"accessor",value:[0,0,0,255]},getLineColor:{type:"accessor",value:[0,0,0,255]},getLineWidth:{type:"accessor",value:1}},iN=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(){return e(p(i.prototype),"getShaders",this).call(this,{vs:"#define SHADER_NAME text-background-layer-vertex-shader\n\nattribute vec2 positions;\n\nattribute vec3 instancePositions;\nattribute vec3 instancePositions64Low;\nattribute vec4 instanceRects;\nattribute float instanceSizes;\nattribute float instanceAngles;\nattribute vec2 instancePixelOffsets;\nattribute float instanceLineWidths;\nattribute vec4 instanceFillColors;\nattribute vec4 instanceLineColors;\nattribute vec3 instancePickingColors;\n\nuniform bool billboard;\nuniform float opacity;\nuniform float sizeScale;\nuniform float sizeMinPixels;\nuniform float sizeMaxPixels;\nuniform vec4 padding;\n\nvarying vec4 vFillColor;\nvarying vec4 vLineColor;\nvarying float vLineWidth;\nvarying vec2 uv;\nvarying vec2 dimensions;\n\nvec2 rotate_by_angle(vec2 vertex, float angle) {\n float angle_radian = radians(angle);\n float cos_angle = cos(angle_radian);\n float sin_angle = sin(angle_radian);\n mat2 rotationMatrix = mat2(cos_angle, -sin_angle, sin_angle, cos_angle);\n return rotationMatrix * vertex;\n}\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n geometry.uv = positions;\n geometry.pickingColor = instancePickingColors;\n uv = positions;\n vLineWidth = instanceLineWidths;\n float sizePixels = clamp(\n project_size_to_pixel(instanceSizes * sizeScale),\n sizeMinPixels, sizeMaxPixels\n );\n\n dimensions = instanceRects.zw * sizePixels + padding.xy + padding.zw;\n\n vec2 pixelOffset = (positions * instanceRects.zw + instanceRects.xy) * sizePixels + mix(-padding.xy, padding.zw, positions);\n pixelOffset = rotate_by_angle(pixelOffset, instanceAngles);\n pixelOffset += instancePixelOffsets;\n pixelOffset.y *= -1.0;\n\n if (billboard) {\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, vec3(0.0), geometry.position);\n vec3 offset = vec3(pixelOffset, 0.0);\n DECKGL_FILTER_SIZE(offset, geometry);\n gl_Position.xy += project_pixel_size_to_clipspace(offset.xy);\n } else {\n vec3 offset_common = vec3(project_pixel_size(pixelOffset), 0.0);\n DECKGL_FILTER_SIZE(offset_common, geometry);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, offset_common, geometry.position);\n }\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n vFillColor = vec4(instanceFillColors.rgb, instanceFillColors.a * opacity);\n DECKGL_FILTER_COLOR(vFillColor, geometry);\n vLineColor = vec4(instanceLineColors.rgb, instanceLineColors.a * opacity);\n DECKGL_FILTER_COLOR(vLineColor, geometry);\n}\n",fs:"#define SHADER_NAME text-background-layer-fragment-shader\n\nprecision highp float;\n\nuniform bool stroked;\n\nvarying vec4 vFillColor;\nvarying vec4 vLineColor;\nvarying float vLineWidth;\nvarying vec2 uv;\nvarying vec2 dimensions;\n\nvoid main(void) {\n geometry.uv = uv;\n\n vec2 pixelPosition = uv * dimensions;\n if (stroked) {\n float distToEdge = min(\n min(pixelPosition.x, dimensions.x - pixelPosition.x),\n min(pixelPosition.y, dimensions.y - pixelPosition.y)\n );\n float isBorder = smoothedge(distToEdge, vLineWidth);\n gl_FragColor = mix(vFillColor, vLineColor, isBorder);\n } else {\n gl_FragColor = vFillColor;\n }\n\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:[xD,CD]})}},{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instancePositions:{size:3,type:5130,fp64:this.use64bitPositions(),transition:!0,accessor:"getPosition"},instanceSizes:{size:1,transition:!0,accessor:"getSize",defaultValue:1},instanceAngles:{size:1,transition:!0,accessor:"getAngle"},instanceRects:{size:4,accessor:"getBoundingRect"},instancePixelOffsets:{size:2,transition:!0,accessor:"getPixelOffset"},instanceFillColors:{size:4,transition:!0,normalized:!0,type:5121,accessor:"getFillColor",defaultValue:[0,0,0,255]},instanceLineColors:{size:4,transition:!0,normalized:!0,type:5121,accessor:"getLineColor",defaultValue:[0,0,0,255]},instanceLineWidths:{size:1,transition:!0,accessor:"getLineWidth",defaultValue: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}),o.extensionsChanged){var a,s=this.context.gl;null===(a=this.state.model)||void 0===a||a.delete(),this.state.model=this._getModel(s),this.getAttributeManager().invalidateAll()}}},{key:"draw",value:function(e){var t=e.uniforms,n=this.context.viewport,i=this.props,r=i.billboard,o=i.sizeScale,a=i.sizeUnits,s=i.sizeMinPixels,u=i.sizeMaxPixels,c=i.getLineWidth,l=this.props.padding,h="pixels"===a?n.metersPerPixel:1;l.length<4&&(l=[l[0],l[1],l[0],l[1]]),this.state.model.setUniforms(t).setUniforms({billboard:r,stroked:Boolean(c),padding:l,sizeScale:o*h,sizeMinPixels:s,sizeMaxPixels:u}).draw()}},{key:"_getModel",value:function(e){return new nO(e,I(M({},this.getShaders()),{id:this.props.id,geometry:new OD({drawMode:6,vertexCount:4,attributes:{positions:{size:2,value:new Float32Array([0,0,1,0,1,1,0,1])}}}),isInstanced:!0}))}}]),i}(hM);return t.layerName="TextBackgroundLayer",t.defaultProps=nN,t}(),rN={fontSize:64,buffer:4,sdf:!1,radius:12,cutoff:.25,smoothing:.1},oN={start:1,middle:0,end:-1},aN={top:1,center:0,bottom:-1},sN=[0,0,0,255],uN=["fontSize","buffer","sdf","radius","cutoff"],cN={billboard:!0,sizeScale:1,sizeUnits:"pixels",sizeMinPixels:0,sizeMaxPixels:Number.MAX_SAFE_INTEGER,background:!1,getBackgroundColor:{type:"accessor",value:[255,255,255,255]},getBorderColor:{type:"accessor",value:sN},getBorderWidth:{type:"accessor",value:0},backgroundPadding:{type:"array",value:[0,0,0,0]},characterSet:{type:"object",value:KD},fontFamily:$D,fontWeight:"normal",lineHeight:1,outlineWidth:{type:"number",value:0,min:0},outlineColor:{type:"color",value:sN},fontSettings:{},wordBreak:"break-word",maxWidth:{type:"number",value:-1},getText:{type:"accessor",value:function(e){return e.text}},getPosition:{type:"accessor",value:function(e){return e.position}},getColor:{type:"accessor",value:sN},getSize:{type:"accessor",value:32},getAngle:{type:"accessor",value:0},getTextAnchor:{type:"accessor",value:"middle"},getAlignmentBaseline:{type:"accessor",value:"center"},getPixelOffset:{type:"accessor",value:[0,0]},backgroundColor:{deprecatedFor:["background","getBackgroundColor"]}},lN=function(){var e=function(e){a(i,e);var n=s(i);function i(){return m(this,i),n.apply(this,arguments)}return b(i,[{key:"initializeState",value:function(){this.state={styleVersion:0,fontAtlasManager:new tN}}},{key:"updateState",value:function(e){var t=e.props,n=e.oldProps,i=e.changeFlags,r=this.state.characterSet;(i.dataChanged||i.updateTriggersChanged&&(i.updateTriggersChanged.all||i.updateTriggersChanged.getText))&&this._updateText();var o=r!==this.state.characterSet||this._fontChanged(n,t);o&&this._updateFontAtlas(n,t),(o||t.lineHeight!==n.lineHeight||t.wordBreak!==n.wordBreak||t.maxWidth!==n.maxWidth)&&this.setState({styleVersion:this.state.styleVersion+1})}},{key:"getPickingInfo",value:function(e){var t=e.info;return t.object=t.index>=0?this.props.data[t.index]:null,t}},{key:"_updateFontAtlas",value:function(e,t){var n=t.fontSettings,i=t.fontFamily,r=t.fontWeight,o=this.state,a=o.fontAtlasManager,s=o.characterSet;a.setProps(I(M(M({},rN),n),{characterSet:s,fontFamily:i,fontWeight:r}))}},{key:"_fontChanged",value:function(e,t){if(e.fontFamily!==t.fontFamily||e.fontWeight!==t.fontWeight)return!0;if(e.fontSettings===t.fontSettings)return!1;var n=e.fontSettings||{},i=t.fontSettings||{};return uN.some(function(e){return n[e]!==i[e]})}},{key:"_updateText",value:function(){var e,t=this.props,n=t.data,i=t.characterSet,r=n.attributes&&n.attributes.getText,o=this.props.getText,a=n.startIndices,s="auto"===i&&new Set;if(r&&a){var u=function(e){var t=e.value,n=e.length,i=e.stride,r=e.offset,o=e.startIndices,a=e.characterSet,s=t.BYTES_PER_ELEMENT,u=i?i/s:1,c=r?r/s:0,l=o[n]||Math.ceil((t.length-c)/u),h=a&&new Set,d=new Array(n),f=t;if(u>1||c>0){f=new t.constructor(l);for(var p=0;p0&&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 pN={name:"lights",vs:hN,fs:hN,getUniforms:function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:dN;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?fN(t):[0,0,0],i.forEach(function(e,t){a["lighting_uPointLight[".concat(t,"].color")]=fN(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")]=fN(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}},vN={},gN={name:"phong-lighting",dependencies:[pN],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]:vN;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}}},mN=Math.PI/180,yN=new Float32Array(16),bN=new Float32Array(12);function _N(e,t,n){var i=t[0]*mN,r=t[1]*mN,o=t[2]*mN,a=Math.sin(o),s=Math.sin(i),u=Math.sin(r),c=Math.cos(o),l=Math.cos(i),h=Math.cos(r),d=n[0],f=n[1],p=n[2];e[0]=d*h*l,e[1]=d*u*l,e[2]=d*-s,e[3]=f*(-u*c+h*s*a),e[4]=f*(h*c+u*s*a),e[5]=f*l*a,e[6]=p*(u*a+h*s*c),e[7]=p*(-h*a+u*s*c),e[8]=p*l*c}function wN(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 kN={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,d=Array.isArray(s),f=Array.isArray(a),p=Array.isArray(u),v=h||!l&&Boolean(c(o[0]));e.constant=v?h:f&&d&&p;var g=e.value;if(e.constant){var m;v?(yN.set(c),m=wN(yN)):(_N(m=bN,a,s),m.set(u,9)),e.value=new Float32Array(m)}else{var y,b=n*e.size,w=YS(o,n,i),k=w.iterable,x=w.objectInfo,S=_(k);try{for(S.s();!(y=S.n()).done;){var C=y.value,E=void 0;x.index++,v?(yN.set(h?c:c(C,x)),E=wN(yN)):(_N(E=bN,f?a:a(C,x),d?s:s(C,x)),E.set(p?u:u(C,x),9)),g[b++]=E[0],g[b++]=E[1],g[b++]=E[2],g[b++]=E[3],g[b++]=E[4],g[b++]=E[5],g[b++]=E[6],g[b++]=E[7],g[b++]=E[8],g[b++]=E[9],g[b++]=E[10],g[b++]=E[11]}}catch(O){S.e(O)}finally{S.f()}}}};function xN(e,t){return t===rk.CARTESIAN||t===rk.METER_OFFSETS||t===rk.DEFAULT&&!e.isGeospatial}function SN(e,t){(e.COLOR_0||e.colors)&&t||(e.colors={constant:!0,value:new Float32Array([1,1,1])}),ik.assert(e.positions||e.POSITION,'no "postions" or "POSITION" attribute in mesh')}function CN(e,t){if(e.attributes)return SN(e.attributes,t),e instanceof OD?e:new OD(e);if(e.positions||e.POSITION)return SN(e,t),new OD({attributes:e});throw Error("Invalid mesh")}var EN={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:[]}},ON=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=!lk(this.context.gl),n={};return Zx(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:[xD,gN,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:kN}),this.setState({emptyTexture:new Rx(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||xN(n,o),flatShading:!this.state.hasNormals}).draw()}}},{key:"getModel",value:function(e){var t=new nO(this.context.gl,I(M({},this.getShaders()),{id:this.props.id,geometry:CN(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}(hM);return t.layerName="SimpleMeshLayer",t.defaultProps=EN,t}(),TN={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:[pN]},PN=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};m(this,e);var n=t.id;this.id=n||cx(this.constructor.name),this.display=!0,this.position=new FS,this.rotation=new FS,this.scale=new FS(1,1,1),this.matrix=new $O,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 ox(3===e.length,"setPosition requires vector argument"),this.position=e,this}},{key:"setRotation",value:function(e){return ox(3===e.length,"setRotation requires vector argument"),this.rotation=e,this}},{key:"setScale",value:function(e){return ox(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){ox(e),t=t||this.matrix;var n=new $O(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}(),AN=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 sk.assert(a.every(function(e){return e instanceof PN}),"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 $O:r,a=new $O(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}(PN);function MN(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],d=n[0],f=n[1],p=n[2],v=n[3],g=n[4],m=n[5],y=n[6],b=n[7],_=n[8];return e[0]=d*i+f*a+p*c,e[1]=d*r+f*s+p*l,e[2]=d*o+f*u+p*h,e[3]=v*i+g*a+m*c,e[4]=v*r+g*s+m*l,e[5]=v*o+g*u+m*h,e[6]=y*i+b*a+_*c,e[7]=y*r+b*s+_*l,e[8]=y*o+b*u+_*h,e}function IN(e,t,n){var i=n[0],r=n[1];return e[0]=i*t[0],e[1]=i*t[1],e[2]=i*t[2],e[3]=r*t[3],e[4]=r*t[4],e[5]=r*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function RN(){var e=new kS(4);return kS!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e[3]=1,e}function DN(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e}function NN(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 LN(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}function jN(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);return e[0]=i*u+a*s,e[1]=r*u+o*s,e[2]=o*u-r*s,e[3]=a*u-i*s,e}function FN(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);return e[0]=i*u-o*s,e[1]=r*u+a*s,e[2]=o*u+i*s,e[3]=a*u-r*s,e}function BN(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);return e[0]=i*u+r*s,e[1]=r*u-i*s,e[2]=o*u+a*s,e[3]=a*u-o*s,e}function VN(e,t){var n=t[0],i=t[1],r=t[2];return e[0]=n,e[1]=i,e[2]=r,e[3]=Math.sqrt(Math.abs(1-n*n-i*i-r*r)),e}function zN(e,t,n,i){var r,o,a,s,u,c=t[0],l=t[1],h=t[2],d=t[3],f=n[0],p=n[1],v=n[2],g=n[3];return(o=c*f+l*p+h*v+d*g)<0&&(o=-o,f=-f,p=-p,v=-v,g=-g),1-o>wS?(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*f,e[1]=s*l+u*p,e[2]=s*h+u*v,e[3]=s*d+u*g,e}function UN(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;return e[0]=-n*s,e[1]=-i*s,e[2]=-r*s,e[3]=o*s,e}function HN(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e}function GN(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}return e}var WN=function(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e},qN=IO,XN=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]},YN=function(e,t,n,i){var r=t[0],o=t[1],a=t[2],s=t[3];return 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),e},KN=function(e){return Math.hypot(e[0],e[1],e[2],e[3])},$N=function(e){var t=e[0],n=e[1],i=e[2],r=e[3];return t*t+n*n+i*i+r*r},QN=function(){var e=xS(),t=SS(1,0,0),n=SS(0,1,0);return function(i,r,o){var a=CS(r,o);return a<-.999999?(ES(e,t,r),function(e){return Math.hypot(e[0],e[1],e[2])}(e)<1e-6&&ES(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),NN(i,e,Math.PI),i):a>.999999?(i[0]=0,i[1]=0,i[2]=0,i[3]=1,i):(ES(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))}}();RN(),RN(),function(){var e=new kS(9);kS!=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 ZN=[0,0,0,1],JN=function(e){a(i,e);var n=s(i);function i(){var e,t=arguments.length>0&&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 GN(this,e),this.check()}},{key:"identity",value:function(){return DN(this),this.check()}},{key:"fromAxisRotation",value:function(e,t){return NN(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]=gS(e)}},{key:"y",get:function(){return this[1]},set:function(e){this[1]=gS(e)}},{key:"z",get:function(){return this[2]},set:function(e){this[2]=gS(e)}},{key:"w",get:function(){return this[3]},set:function(e){this[3]=gS(e)}},{key:"len",value:function(){return KN(this)}},{key:"lengthSquared",value:function(){return $N(this)}},{key:"dot",value:function(e,t){if(void 0!==t)throw new Error("Quaternion.dot only takes one argument");return XN(this,e)}},{key:"rotationTo",value:function(e,t){return QN(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 WN(this,this,e),this.check()}},{key:"calculateW",value:function(){return VN(this,this),this.check()}},{key:"conjugate",value:function(){return HN(this,this),this.check()}},{key:"invert",value:function(){return UN(this,this),this.check()}},{key:"lerp",value:function(e,t,n){return YN(this,e,t,n),this.check()}},{key:"multiplyRight",value:function(e,t){return pS(!t),LN(this,this,e),this.check()}},{key:"multiplyLeft",value:function(e,t){return pS(!t),LN(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 jN(this,this,e),this.check()}},{key:"rotateY",value:function(e){return FN(this,this,e),this.check()}},{key:"rotateZ",value:function(e){return BN(this,this,e),this.check()}},{key:"scale",value:function(e){return qN(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?ZN:a,n=o.target,i=o.ratio;break;case 2:n=(r=t(arguments,2))[0],i=r[1],e=this}return zN(this,e,n,i),this.check()}},{key:"transformVector4",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;return DO(t,e,this),mS(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}(vS),eL={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},tL={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function nL(e){if(!e._animation){var t=tL[e.componentType],n=eL[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;s=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:sk.warn("Bad animation path ".concat(i))()}ox(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){rL.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 nO?(t.model=e,t._setModelNodeProps(r)):t.model=new nO(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}(PN),uL=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},Zx(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 Rx(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&&(sk.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 cL(e,t){return lk(e)?"#version 300 es\n".concat(t):t}var lL={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},hL={modelOptions:{},pbrDebug:!1,imageBasedLightingEnvironment:null,lights:!0,useTangents:!1},dL=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({},hL,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 aL(this.gltf):null}},{key:"createScene",value:function(e){var t=this,n=(e.nodes||[]).map(function(e){return t.createNode(e)});return new AN({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 AN({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 $O).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 AN({id:e.name||e.id,children:n});e._mesh=i}return e._mesh}},{key:"getVertexCount",value:function(e){sk.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 uL(e,t);sk.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 sL(e,Object.assign({id:n,drawMode:i,vertexCount:r,modules:[TN],defines:s.defines,parameters:s.parameters,vs:cL(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:cL(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))),sk.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 wx({buffer:t,offset:e.byteOffset||0,stride:e.bufferView.byteStride||0,type:e.componentType,size:lL[e.type]})}},{key:"createSampler",value:function(e){return e}},{key:"needsPOT",value:function(){return!1}}]),e}();function fL(e,t,n){if(e.byteLength<=t+n)return"";for(var i=new DataView(e),r="",o=0;o")}}]),i}(wL,Symbol.toStringTag),RL=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),FP(this,"name",void 0),FP(this,"type",void 0),FP(this,"nullable",void 0),FP(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 DL(e,t,n){var i=n?NL(n.metadata):void 0,r=function(e){switch(e.constructor){case Int8Array:return new xL;case Uint8Array:return new EL;case Int16Array:return new SL;case Uint16Array:return new OL;case Int32Array:return new CL;case Uint32Array:return new TL;case Float32Array:return new AL;case Float64Array:return new ML;default:throw new Error("array type not supported")}}(t.value);return new RL(e,new IL(t.size,new RL("value",r)),!1,i)}function NL(e){var t=new Map;for(var n in e)t.set("".concat(n,".string"),JSON.stringify(e[n]));return t}var LL={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},jL={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array},FL=function(){function e(t){m(this,e),FP(this,"draco",void 0),FP(this,"decoder",void 0),FP(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=d>a?d:a}return[[t,n,i],[r,o,a]]}(u.attributes),l=function(e,t,n){var i=NL(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=DL(a,e[a],o[a]);r.push(s)}if(n){var u=DL("indices",n);r.push(u)}return new bL(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=HL(t,n,i)),VL[t]=VL[t]||GL(t),e.next=6,VL[t];case 6:return e.abrupt("return",e.sent);case 7:case"end":return e.stop()}},e)}))).apply(this,arguments)}function HL(e,t,n){if(e.startsWith("http"))return e;var i=n.modules||{};return i[e]?i[e]:eA?n.CDN?($P(n.CDN.startsWith("http")),"".concat(n.CDN,"/").concat(t,"@3.0.12/dist/libs/").concat(e)):tA?"../src/libs/".concat(e):"modules/".concat(t,"/src/libs/").concat(e):"modules/".concat(t,"/dist/libs/").concat(e)}function GL(e){return WL.apply(this,arguments)}function WL(){return(WL=Vx(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(!eA){e.next=24;break}if(!tA){e.next=13;break}e.t2=importScripts(t),e.next=21;break;case 13:return e.t3=qL,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=BL.requireFromFile,!e.t6){e.next=29;break}return e.next=28,BL.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 qL(e,t){if(!eA)return BL.requireFromString&&BL.requireFromString(e,t);if(tA)return eval.call(JP,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 XL,YL="https://www.gstatic.com/draco/versioned/decoders/1.4.1/draco_decoder.js",KL="https://www.gstatic.com/draco/versioned/decoders/1.4.1/draco_wasm_wrapper.js",$L="https://www.gstatic.com/draco/versioned/decoders/1.4.1/draco_decoder.wasm";function QL(e){return ZL.apply(this,arguments)}function ZL(){return(ZL=Vx(regeneratorRuntime.mark(function e(t){var n;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.modules||{},XL=n.draco3d?XL||n.draco3d.createDecoderModule({}).then(function(e){return{draco:e}}):XL||JL(t),e.next=4,XL;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=Vx(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,zL(YL,"draco",n);case 5:return i=e.sent,e.abrupt("break",21);case 7:return e.t1=Promise,e.next=10,zL(KL,"draco",n);case 10:return e.t2=e.sent,e.next=13,zL($L,"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,tj(i,r);case 24:return e.abrupt("return",e.sent);case 25:case"end":return e.stop()}},e)}))).apply(this,arguments)}function tj(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 nj=I(M({},yL),{parse:function(e,t){return ij.apply(this,arguments)}});function ij(){return(ij=Vx(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,QL(n);case 2:return i=e.sent,r=i.draco,o=new FL(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 rj(e,t){return lP(e>=0),lP(t>0),e+(t-1)&~(t-1)}function oj(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+rj(i.byteLength,4)}var aj=["SCALAR","VEC2","VEC3","VEC4"],sj=[[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Uint32Array,5125],[Float32Array,5126],[Float64Array,5130]],uj=new Map(sj),cj={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},lj={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},hj={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function dj(e){return aj[e-1]||aj[0]}function fj(e){var t=uj.get(e.constructor);if(!t)throw new Error("Illegal typed array");return t}function pj(e,t){var n=hj[e.componentType],i=cj[e.type],r=e.count*i,o=e.count*i*lj[e.componentType];return pL(o>=0&&o<=t.byteLength),{ArrayType:n,length:r,byteLength:o}}var vj={asset:{version:"2.0",generator:"loaders.gl"},buffers:[]},gj=function(){function e(t){m(this,e),FP(this,"gltf",void 0),FP(this,"sourceBuffers",void 0),FP(this,"byteLength",void 0),this.gltf=t||{json:M({},vj),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 pL(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=pj(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 pL(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 pL(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=wR(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;pL(Number.isFinite(t)),this.sourceBuffers=this.sourceBuffers||[],this.sourceBuffers.push(e);var n={buffer:0,byteOffset:this.byteLength,byteLength:t};return this.byteLength+=rj(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:dj(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:fj(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=oj(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:dj(i),componentType:fj(n)}}function Sj(e,t,n){return Cj.apply(this,arguments)}function Cj(){return(Cj=Vx(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 gj(t),a=[],s=_(Mj(o));try{for(s.s();!(u=s.n()).done;)c=u.value,o.getObjectExtension(c,yj)&&a.push(Oj(o,c,n,i))}catch(l){s.e(l)}finally{s.f()}return e.next=7,Promise.all(a);case 7:o.removeExtension(yj);case 8:case"end":return e.stop()}},e)}))).apply(this,arguments)}function Ej(e){var t,n=new gj(e),i=_(n.json.meshes||[]);try{for(i.s();!(t=i.n()).done;){var r=t.value;Pj(r),n.addRequiredExtension(yj)}}catch(o){i.e(o)}finally{i.f()}}function Oj(e,t,n,i){return Tj.apply(this,arguments)}function Tj(){return(Tj=Vx(regeneratorRuntime.mark(function e(n,i,r,o){var a,s,u,c,l,h,d,f,p,v,g,m,y;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(a=n.getObjectExtension(i,yj)){e.next=3;break}return e.abrupt("return");case 3:return s=n.getTypedArrayForBufferView(a.bufferView),u=xA(s.buffer,s.byteOffset),c=o.parse,delete(l=M({},r))["3d-tiles"],e.next=7,c(u,nj,l,o);case 7:for(h=e.sent,d=kj(h.attributes),f=0,p=Object.entries(d);f2&&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({},yj,{bufferView:l,attributes:c})}]}}function Aj(e){if(!e.attributes&&Object.keys(e.attributes).length>0)throw new Error("glTF: Empty primitive detected: Draco decompression failure?")}function Mj(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 Ij(e){return Rj.apply(this,arguments)}function Rj(){return(Rj=Vx(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 gj(t),i=n.json,n.removeExtension(_j),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,_j)}catch(s){r.e(s)}finally{r.f()}case 4:case"end":return e.stop()}},e)}))).apply(this,arguments)}function Dj(e){var t=new gj(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,_j,{}),t.addExtension(_j))}}catch(a){r.e(a)}finally{r.f()}}}function Nj(e){return Lj.apply(this,arguments)}function Lj(){return(Lj=Vx(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 gj(t),i=n.json,(r=n.getExtension(bj))&&(n.json.lights=r.lights,n.removeExtension(bj)),o=_(i.nodes||[]);try{for(o.s();!(a=o.n()).done;)s=a.value,(u=n.getObjectExtension(s,bj))&&(s.light=u.light),n.removeObjectExtension(s,bj)}catch(c){o.e(c)}finally{o.f()}case 4:case"end":return e.stop()}},e)}))).apply(this,arguments)}function jj(e){return Fj.apply(this,arguments)}function Fj(){return(Fj=Vx(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 gj(t),(i=n.json).lights&&(pL(!(r=n.addExtension(bj)).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,bj,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 Bj(e){return Vj.apply(this,arguments)}function Vj(){return(Vj=Vx(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 gj(t),i=n.json,r=n.getExtension(wj)){o=Hj(r,n),a=_(i.materials||[]);try{for(a.s();!(s=a.n()).done;)u=s.value,(c=n.getObjectExtension(u,wj))&&(u.technique=Object.assign({},c,o[c.technique]),u.technique.values=Gj(u.technique,n)),n.removeObjectExtension(u,wj)}catch(l){a.e(l)}finally{a.f()}n.removeExtension(wj)}case 2:case"end":return e.stop()}},e)}))).apply(this,arguments)}function zj(e,t){return Uj.apply(this,arguments)}function Uj(){return(Uj=Vx(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 Hj(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 Gj(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 Wj={KHR_draco_mesh_compression:R,KHR_materials_unlit:D,KHR_lights_punctual:N,KHR_techniques_webgl:L};function qj(e){return Xj.apply(this,arguments)}function Xj(){return(Xj=Vx(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(Wj);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,Wj[r].decode(t,n,i);case 10:e.next=3;break;case 12:case"end":return e.stop()}},e)}))).apply(this,arguments)}var Yj={accessors:"accessor",animations:"animation",buffers:"buffer",bufferViews:"bufferView",images:"image",materials:"material",meshes:"mesh",nodes:"node",samplers:"sampler",scenes:"scene",skins:"skin",textures:"texture"},Kj={accessor:"accessors",animations:"animation",buffer:"buffers",bufferView:"bufferViews",image:"images",material:"materials",mesh:"meshes",node:"nodes",sampler:"samplers",scene:"scenes",skin:"skins",texture:"textures"},$j=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 gj(e),i=n.json,r=_(i.images||[]);try{for(r.s();!(t=r.n()).done;){var o=t.value,a=n.removeObjectExtension(o,mj);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(mj)}(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 Yj)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 Yj)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,d=_(e.scenes);try{for(d.s();!(h=d.n()).done;){var f=h.value;this._convertSceneIds(f)}}catch(p){d.e(p)}finally{d.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=Kj[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 Qj(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(new $j).normalize(e,t)}var Zj={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Jj={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},eF={TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,REPEAT:10497,LINEAR:9729,NEAREST_MIPMAP_LINEAR:9986},tF={magFilter:eF.TEXTURE_MAG_FILTER,minFilter:eF.TEXTURE_MIN_FILTER,wrapS:eF.TEXTURE_WRAP_S,wrapT:eF.TEXTURE_WRAP_T},nF=(o(k={},eF.TEXTURE_MAG_FILTER,eF.LINEAR),o(k,eF.TEXTURE_MIN_FILTER,eF.NEAREST_MIPMAP_LINEAR),o(k,eF.TEXTURE_WRAP_S,eF.REPEAT),o(k,eF.TEXTURE_WRAP_,eF.REPEAT),k),iF=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 pL(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 Jj[e]}(e.componentType),e.components=function(e){return Zj[e]}(e.type),e.bytesPerElement=e.bytesPerComponent*e.components,e.bufferView){var n=e.bufferView.buffer,i=pj(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):nF,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 tF[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 rF(e,t){return(new iF).postProcess(e,t)}var oF=1735152710,aF=!0;function sF(e,t,n,i){var r=new Uint8Array(t.buffer,n,i),o=new TextDecoder("utf8").decode(r);return e.json=JSON.parse(o),rj(i,4)}function uF(e,t,n,i){return e.header.hasBinChunk=!0,e.binChunks.push({byteOffset:n,byteLength:i,arrayBuffer:t.buffer}),rj(i,4)}function cF(e,t){return lF.apply(this,arguments)}function lF(){return(lF=Vx(regeneratorRuntime.mark(function e(t,n){var i,r,o,a,s,u,c,l,h,d,f=arguments;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(i=f.length>2&&void 0!==f[2]?f[2]:0,r=f.length>3?f[3]:void 0,o=f.length>4?f[4]:void 0,hF(t,n,i,r),Qj(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,dF(t,r,o);case 9:if(null==r||null===(u=r.gltf)||void 0===u||!u.loadImages){e.next=12;break}h=pF(t,r,o),l.push(h);case 12:return d=qj(t,r,o),l.push(d),e.next=16,Promise.all(l);case 16:return e.abrupt("return",null!=r&&null!==(c=r.gltf)&&void 0!==c&&c.postProcess?rF(t,r):t);case 17:case"end":return e.stop()}},e)}))).apply(this,arguments)}function hF(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?oF:r,a=i.getUint32(t,!1);return a===o||a===oF}(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)?fL(e.buffer,e.byteOffset,t):e instanceof ArrayBuffer?fL(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,aF),a=i.getUint32(n+8,aF);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){lP(e.header.byteLength>20);var i=t.getUint32(n+0,aF),r=t.getUint32(n+4,aF);return n+=8,lP(0===r),sF(e,t,n,i),(n+=i)+uF(e,t,n,e.header.byteLength)}(e,i,n);case 2:return function(e,t,n,i){return lP(e.header.byteLength>20),function(e,t,n,i){for(;n+8<=e.header.byteLength;){var r=t.getUint32(n+0,aF),o=t.getUint32(n+4,aF);switch(n+=8,o){case 1313821514:sF(e,t,n,r);break;case 5130562:uF(e,t,n,r);break;case 0:i.strict||sF(e,t,n,r);break;case 1:i.strict||uF(e,t,n,r)}n+=rj(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),pL("glTF"===r.type,"Invalid GLB magic string ".concat(r.type)),e._glb=r,e.json=r.json}else pL(!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 dF(e,t,n){return fF.apply(this,arguments)}function fF(){return(fF=Vx(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({},yF.options),n)).gltf=M(M({},yF.options.gltf),n.gltf),r=n.byteOffset,o=void 0===r?0:r,e.next=6,cF({},t,o,n,i);case 6:return e.abrupt("return",e.sent);case 7:case"end":return e.stop()}},e)}))).apply(this,arguments)}function _F(){return(_F=Vx(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,wF(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 wF(e){return kF.apply(this,arguments)}function kF(){return(kF=Vx(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 xF=[255,255,255,255],SF={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:xF},_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:[yF]},CF=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=[xD,CD];return"pbr"===this.props._lighting&&e.push(TN),{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:xF,transition:!0},instanceModelMatrix:kN})}},{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 PN)i={scenes:[e.scenegraph]};else if(e.scenegraph&&!e.scenegraph.gltf){var r=e.scenegraph,o=function(e,t,n){var i=new dL(e,n);return{scenes:i.instantiate(t),animator:i.createAnimator()}}(n,r,this._getModelOptions());i=M({gltf:r},o),function(e){return _F.apply(this,arguments)}(o).then(function(){return t.setNeedsRedraw()})}else e.scenegraph&&(ik.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 PN?(this._deleteScenegraph(),this._applyAllAttributes(s),this._applyAnimationsProp(s,u,e._animations),this.setState({scenegraph:s,animator:u})):null!==s&&ik.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?cx("sphere-geometry"):i,o=function(e){var t=e.nlat,n=void 0===t?10:t,i=e.nlong,r=void 0===i?10:i,o=e.radius,a=void 0===o?1:o,s=Math.PI-0,u=2*Math.PI-0,c=(n+1)*(r+1);if("number"==typeof a){var l=a;a=function(e,t,n,i,r){return l}}for(var h=new Float32Array(3*c),d=new Float32Array(3*c),f=new Float32Array(2*c),p=new(c>65535?Uint32Array:Uint16Array)(n*r*6),v=0;v<=n;v++)for(var g=0;g<=r;g++){var m=g/r,y=v/n,b=g+v*(r+1),_=2*b,w=3*b,k=u*m,x=s*y,S=Math.sin(k),C=Math.cos(k),E=Math.sin(x),O=C*E,T=Math.cos(x),P=S*E,A=a(O,T,P,m,y);h[w+0]=A*O,h[w+1]=A*T,h[w+2]=A*P,d[w+0]=O,d[w+1]=T,d[w+2]=P,f[_+0]=m,f[_+1]=1-y}for(var M=r+1,I=0;I0&&void 0!==arguments[0]?arguments[0]:{};m(this,n);var i=e.id,r=void 0===i?cx("truncated-code-geometry"):i,o=function(e){for(var t=e.bottomRadius,n=void 0===t?0:t,i=e.topRadius,r=void 0===i?0:i,o=e.height,a=void 0===o?1:o,s=e.nradial,u=void 0===s?10:s,c=e.nvertical,l=void 0===c?10:c,h=e.verticalAxis,d=void 0===h?"y":h,f=e.topCap,p=void 0!==f&&f,v=e.bottomCap,g=void 0!==v&&v,m=(p?2:0)+(g?2:0),y=(u+1)*(l+1+m),b=Math.atan2(n-r,a),_=Math.sin,w=Math.cos,k=Math.PI,x=w(b),S=_(b),C=p?-2:0,E=l+(g?2:0),O=u+1,T=new Uint16Array(u*(l+m)*6),P=OF[d],A=new Float32Array(3*y),M=new Float32Array(3*y),I=new Float32Array(2*y),R=0,D=0,N=C;N<=E;N++){var L=void 0,j=N/l,F=a*j;N<0?(F=0,j=1,L=n):N>l?(F=a,j=1,L=r):L=n+N/l*(r-n),(-2===N||N===l+2)&&(L=0,j=0),F-=a/2;for(var B=0;Bl?0:V*x,M[R+P[1]]=N<0?-1:N>l?1:S,M[R+P[2]]=N<0||N>l?0:z*x,I[D+0]=B/u,I[D+1]=j,D+=2,R+=3}}for(var U=0;U0&&void 0!==arguments[0]?arguments[0]:{};m(this,n);var i=e.id,r=void 0===i?cx("cone-geometry"):i,o=e.radius,a=void 0===o?1:o,s=e.cap,u=void 0===s||s;return t.call(this,I(M({},e),{id:r,topRadius:0,topCap:Boolean(u),bottomCap:Boolean(u),bottomRadius:a}))}return n}(TF),AF=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.id,r=void 0===i?cx("cylinder-geometry"):i,o=e.radius,a=void 0===o?1:o;return t.call(this,I(M({},e),{id:r,bottomRadius:a,topRadius:a}))}return n}(TF),MF=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]),IF=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]),RF=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]),DF=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]),NF={POSITION:{size:3,value:new Float32Array(IF)},NORMAL:{size:3,value:new Float32Array(RF)},TEXCOORD_0:{size:2,value:new Float32Array(DF)}},LF=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.id,r=void 0===i?cx("cube-geometry"):i;return t.call(this,I(M({},e),{id:r,indices:{size:1,value:new Uint16Array(MF)},attributes:M(M({},NF),e.attributes)}))}return n}(OD),jF=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 BF,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 BF,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],d=i[6],f=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]=d*v+f*y+p*w,o[7]=d*g+f*b+p*k,o[8]=d*m+f*_+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 BF,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=FF;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}(),FF=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],BF=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 jF([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=VF,r=1/n;i.set(this.x*r,this.y*r,this.z*r);var o=zF;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(UF),UF.almostEquals(e,t)}},{key:"clone",value:function(){return new e(this.x,this.y,this.z)}}]),e}();BF.ZERO=void 0,BF.UNIT_X=void 0,BF.UNIT_Y=void 0,BF.UNIT_Z=void 0,BF.ZERO=new BF(0,0,0),BF.UNIT_X=new BF(1,0,0),BF.UNIT_Y=new BF(0,1,0),BF.UNIT_Z=new BF(0,0,1);var VF=new BF,zF=new BF,UF=new BF,HF=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 BF,this.upperBound=new BF,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=WF;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=WF;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,d=Math.max(Math.max(Math.min(a,s),Math.min(u,c)),Math.min(l,h)),f=Math.min(Math.min(Math.max(a,s),Math.max(u,c)),Math.max(l,h));return!(f<0||d>f)}}]),e}(),GF=new BF,WF=[new BF,new BF,new BF,new BF,new BF,new BF,new BF,new BF],qF=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 BF;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=XF;e.tangents(n,YF),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(P(e.length(),2)*P(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 BF,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,d=-o*n-a*i-s*r;return t.x=c*u+d*-o+l*-s-h*-a,t.y=l*u+d*-a+h*-o-c*-s,t.z=h*u+d*-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,d=this.w,f=t.x,p=t.y,v=t.z,g=t.w;return(r=c*f+l*p+h*v+d*g)<0&&(r=-r,f=-f,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*f,u.y=a*l+s*p,u.z=a*h+s*v,u.w=a*d+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,d=.5*n;return r.x+=d*(o*h+a*l-s*c),r.y+=d*(a*h+s*u-o*l),r.z+=d*(s*h+o*c-a*u),r.w+=d*(-o*u-a*c-s*l),r}}]),e}(),XF=new BF,YF=new BF,KF={SPHERE:1,PLANE:2,BOX:4,COMPOUND:8,CONVEXPOLYHEDRON:16,HEIGHTFIELD:32,PARTICLE:64,CYLINDER:128,TRIMESH:256},$F=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=KF,e}(),QF=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 BF,this.quaternion=new qF,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 BF;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 BF;return n.vsub(e,i),t.conjugate(ZF),ZF.vmult(i,i),i}},{key:"pointToWorldFrame",value:function(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new BF;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 BF;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 BF;return t.w*=-1,t.vmult(n,i),t.w*=-1,i}}]),e}(),ZF=new qF,JF=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:$F.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 BF,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=f,l=d)}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 BF,c=new BF,l=new BF,h=new BF,d=new BF,f=new BF,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,eB),n.project(t,e,o,a,tB);var s=eB[0],u=eB[1],c=tB[0],l=tB[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 BF,d=0;ds)&&(s=f.x),(void 0===o||f.yu)&&(u=f.y),(void 0===a||f.zc)&&(c=f.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 BF,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 BF,o=new BF;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=nB,s=0,u=0,c=iB,l=e.vertices;c.setZero(),QF.vectorToLocalFrame(n,i,t,a),QF.pointToLocalFrame(n,i,c,c);var h=c.dot(a);u=s=l[0].dot(a);for(var d=1;ds&&(s=f),f(s-=h)){var p=u;u=s,s=p}r[0]=s,r[1]=u}}]),n}($F),eB=[],tB=[],nB=new BF,iB=new BF,rB=function(e){a(n,e);var t=s(n);function n(e){var i;return m(this,n),(i=t.call(this,{type:$F.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=BF,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 JF({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 BF;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 BF,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 BF,e.previousPosition=new BF,e.interpolatedPosition=new BF,e.initPosition=new BF,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 BF,i.velocity&&e.velocity.copy(i.velocity),e.initVelocity=new BF,e.force=new BF;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 BF,e.quaternion=new qF,e.initQuaternion=new qF,e.previousQuaternion=new qF,e.interpolatedQuaternion=new qF,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 BF,i.angularVelocity&&e.angularVelocity.copy(i.angularVelocity),e.initAngularVelocity=new BF,e.shapes=[],e.shapeOffsets=[],e.shapeOrientations=[],e.inertia=new BF,e.invInertia=new BF,e.invInertiaWorld=new jF,e.invMassSolve=0,e.invInertiaSolve=new BF,e.invInertiaWorldSolve=new jF,e.fixedRotation=void 0!==i.fixedRotation&&i.fixedRotation,e.angularDamping=void 0!==i.angularDamping?i.angularDamping:.01,e.linearFactor=new BF(1,1,1),i.linearFactor&&e.linearFactor.copy(i.linearFactor),e.angularFactor=new BF(1,1,1),i.angularFactor&&e.angularFactor.copy(i.angularFactor),e.aabb=new HF,e.aabbNeedsUpdate=!0,e.boundingRadius=0,e.wlambda=new BF,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=P(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 BF;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 BF;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 BF;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 BF;return this.quaternion.vmult(e,t),t}},{key:"addShape",value:function(e,t,n){var i=new BF,r=new qF;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=uB,o=cB,a=this.quaternion,s=this.aabb,u=lB,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=hB,i=dB;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 BF;if(this.type===n.DYNAMIC){this.sleepState===n.SLEEPING&&this.wakeUp();var i=fB;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 BF;if(this.type===n.DYNAMIC){var i=pB,r=vB;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 BF;if(this.type===n.DYNAMIC){this.sleepState===n.SLEEPING&&this.wakeUp();var i=t,r=gB;r.copy(e),r.scale(this.invMass,r),this.velocity.vadd(r,this.velocity);var o=mB;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 BF;if(this.type===n.DYNAMIC){var i=yB,r=bB;this.vectorToWorldFrame(e,i),this.vectorToWorldFrame(t,r),this.applyImpulse(i,r)}}},{key:"updateMassProperties",value:function(){var e=_B;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),rB.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 BF;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,d=this.invMass*e;r.x+=s.x*d*h.x,r.y+=s.y*d*h.y,r.z+=s.z*d*h.z;var f=l.elements,p=this.angularFactor,v=u.x*p.x,g=u.y*p.y,m=u.z*p.z;o.x+=e*(f[0]*v+f[1]*g+f[2]*m),o.y+=e*(f[3]*v+f[4]*g+f[5]*m),o.z+=e*(f[6]*v+f[7]*g+f[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 BF,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new BF;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 BF,this.precision=1e-4,this.checkCollisionResponse=!0,this.skipBackfaces=!1,this.collisionFilterMask=-1,this.collisionFilterGroup=-1,this.mode=s.ANY,this.result=new wB,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 wB,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(xB),SB.length=0,e.broadphase.aabbQuery(e,xB,SB),this.intersectBodies(SB),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=OB,r=TB,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 BF(0,0,1);t.vmult(u,u);var c=new BF;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,d),d.vsub(n,f),f.normalize(),this.reportIntersection(f,d,r,i,-1)),this.result.shouldStop)return;v>=0&&v<=1&&(o.lerp(a,v,d),d.vsub(n,f),f.normalize(),this.reportIntersection(f,d,r,i,-1))}}},{key:"_intersectConvex",value:function(e,t,n,i,r,o){for(var a=BB,u=VB,c=o&&o.faceList||null,l=e.faces,h=e.vertices,d=e.faceNormals,f=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,PB,r,i,b)}}}}}},{key:"_intersectTrimesh",value:function(e,t,n,i,r,o){var a=zB,u=XB,c=YB,l=VB,h=UB,d=HB,f=GB,p=qB,v=WB,g=e.indices,m=this.from,y=this.to,b=this.direction;c.position.copy(n),c.quaternion.copy(t),QF.vectorToLocalFrame(n,t,b,h),QF.pointToLocalFrame(n,t,m,d),QF.pointToLocalFrame(n,t,y,f),f.x*=e.scale.x,f.y*=e.scale.y,f.z*=e.scale.z,d.x*=e.scale.x,d.y*=e.scale.y,d.z*=e.scale.z,f.vsub(d,h),h.normalize();var _=d.distanceSquared(f);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],AB),AB.vsub(d,l);var S=h.dot(a),C=a.dot(l)/S;if(!(C<0)){h.scale(C,PB),PB.vadd(d,PB),e.getVertex(g[3*x+1],MB),e.getVertex(g[3*x+2],IB);var E=PB.distanceSquared(d);!s.pointInTriangle(PB,MB,AB,IB)&&!s.pointInTriangle(PB,AB,MB,IB)||E>_||(QF.vectorToWorldFrame(t,a,v),QF.pointToWorldFrame(n,t,PB,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 HF({lowerBound:h(BF,v(o.map(function(e,t){return Math.min(e,a[t])}))),upperBound:h(BF,v(a.map(function(e,t){return Math.max(e,o[t])})))}),gltf:n})}()}}catch(E){a.e(E)}finally{a.f()}}return!0})}catch(E){r.e(E)}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;){d=l.value,f=[],p=_(i);try{for(p.s();!(g=p.n()).done;)m=g.value,d.bbox.overlaps(m.bbox)&&f.push({"@id":m["@id"],name:m.name})}catch(E){p.e(E)}finally{p.f()}f.length>0?s.push({"@id":d.entityId,name:d.name,hits:f}):u.push(d)}}catch(E){c.e(E)}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),cV(r,n)}}catch(o){i.e(o)}finally{i.f()}return n}var lV=function(){var e=function(){function e(t){var n,i,r,o,a,s=this;m(this,e),this.deckProps=t,this.bodyUILayer=new uV({}),this.nodeClickSubject=new ae,this.nodeHoverStartSubject=new ae,this.nodeHoverStopSubject=new ae,this.sceneRotationSubject=new vv([0,0]),this.nodeDragStartSubject=new ae,this.nodeDragSubject=new ae,this.nodeDragEndSubject=new ae,this.nodeClick$=this.nodeClickSubject.pipe(je()),this.nodeHoverStart$=this.nodeHoverStartSubject.pipe(je()),this.nodeHoverStop$=this.nodeHoverStopSubject.pipe(je()),this.sceneRotation$=this.sceneRotationSubject.pipe(je()),this.nodeDragStart$=this.nodeDragStartSubject.pipe(je()),this.nodeDrag$=this.nodeDragSubject.pipe(je()),this.nodeDragEnd$=this.nodeDragEndSubject.pipe(je());var u=Object.assign(Object.assign({},t),{views:["orthographic"===t.camera?new UM({flipY:!1,near:-1e3}):new qM({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 mI({ambientLight:new KM({color:[255,255,255],intensity:10})})]),this.deck=new kD(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 Dw(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 $O([.076,0,0,0,0,.076,16875389974302382e-33,0,0,-16875389974302382e-33,.076,0,.49,.034,.11,1]);(function(e,t,n,i){return Dw(this,void 0,void 0,regeneratorRuntime.mark(function n(){var i,r,o,a,s,u,c,l,d,f,p,g,m,y,b,w,k,x,S,C;return regeneratorRuntime.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return nV(),n.next=3,rV({scenegraph:e,scenegraphNode:"VHF_Kidney_L_Low1"},void 0);case 3:i=n.sent,r={},o=[],a=_(i.scenes);try{for(a.s();!(s=a.n()).done;)tV(s.value,t=new $O(t||$O.IDENTITY),function(n,i){var a={"@id":n.name||n.id,"@type":"ProcessedNode",transformMatrix:new $O(i),geometry:"wireframe",node:n};if(o.push({"@id":"GLTF:".concat(a["@id"]),"@type":"GLTFNode",scenegraph:e,scenegraphNode:a["@id"],transformMatrix:new $O(t||$O.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 HF({lowerBound:h(BF,v(e.map(function(e,n){return Math.min(e,t[n])}))),upperBound:h(BF,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(E){a.e(E)}finally{a.f()}u=_(Object.values(r).filter(function(e){return!e.bbox}));try{for(u.s();!(c=u.n()).done;){l=c.value,d=_(cV(l.node).map(function(e){return r[e]}).filter(function(e){return e.bbox}));try{for(d.s();!(f=d.n()).done;)p=f.value,l.bbox?l.bbox.extend(p.bbox):l.bbox=p.bbox.clone()}catch(E){d.e(E)}finally{d.f()}l.bbox||delete r[l["@id"]]}}catch(E){u.e(E)}finally{u.f()}for(g=0,m=Object.values(r);g1&&void 0!==arguments[1]?arguments[1]:hV,n=null,i=null;function r(){return dV(t,n,arguments)||(i=e.apply(null,arguments)),n=arguments,i}return r.reset=function(){n=null,i=null},r}var pV=fV(function(){var e=ch();if(!e)return!1;var t=e.injector.get(Gl,null);return!!t&&t.some(function(e){return(e&&e.providers||[]).some(function(e){return e&&e.provide&&"MockNgModuleResolver"===e.provide.name||!1})})}),vV=function(){var e=function(){function e(){m(this,e),this.bootstrap$=new Bf(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=$e({token:e,factory:e.\u0275fac}),e}(),gV=new Ri("INITIAL_STATE_TOKEN"),mV=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}(),yV=new Ri("Internals.StateContextFactory"),bV=new Ri("Internals.StateFactory");function _V(e,t){return t?function(n){return n.pipe(_V(function(n,i){return ye(e(n,i)).pipe(ce(function(e,r){return t(n,e,i,r)}))}))}:function(t){return t.lift(new wV(e))}}var wV=function(){function e(t){m(this,e),this.project=t}return b(e,[{key:"call",value:function(e,t){return t.subscribe(new kV(e,this.project))}}]),e}(),kV=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 be(this),n=this.destination;n.add(t);var i=we(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}(_e);function xV(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return function(t){return t.lift(new SV(e))}}var SV=function(){function e(t){m(this,e),this.defaultValue=t}return b(e,[{key:"call",value:function(e,t){return t.subscribe(new CV(e,this.defaultValue))}}]),e}(),CV=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}(K),EV=function(e){return"".concat(e," is not a valid state name. It needs to be a valid object property name.")},OV=function(){return"States must register a 'name' property"},TV=function(e,t,n){return"State name '".concat(e,"' from ").concat(t," already exists in ").concat(n)},PV=function(){return"States must be decorated with @State() decorator"},AV=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 })"},MV=function(){return"RECOMMENDATION: Set developmentMode to true on the NgxsModule when Angular is running in development mode.\nNgxsModule.forRoot(states, { developmentMode: !environment.production })"},IV=function(){return"You have forgotten to import the NGXS module!"},RV=function(){return"@Action() decorator cannot be used with static methods"},DV=function(){return"Selectors only work on methods"},NV=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 })"},LV=function(){return"Patching arrays is not supported."},jV=function(){return"Patching primitives is not supported."},FV=function(e){return"'".concat(e,"' class should be decorated with @Injectable() right after the @State() decorator")},BV=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 Xl.isInAngularZone()?e():this._ngZone.run(e)}},{key:"runOutsideAngular",value:function(e){return Xl.isInAngularZone()?this._ngZone.runOutsideAngular(e):e()}},{key:"verifyZoneIsNotNooped",value:function(e){e instanceof Xl||console.warn(NV())}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Zi(Xl),Zi(Ml))},e.\u0275prov=$e({token:e,factory:e.\u0275fac}),e}(),VV=new Ri("ROOT_STATE_TOKEN"),zV=new Ri("FEATURE_STATE_TOKEN"),UV=new Ri("NGXS_PLUGINS"),HV=new Ri("NG_TEST_MODE"),GV=new Ri("NG_DEV_MODE"),WV="NGXS_META",qV="NGXS_OPTIONS_META",XV="NGXS_SELECTOR_META",YV=function(){var e=function e(){m(this,e),this.defaultsState={},this.selectorOptions={injectContainerState:!0,suppressErrors:!0},this.compatibility={strictContentSecurityPolicy:!1},this.executionStrategy=BV};return e.\u0275prov=$e({token:e,factory:e.\u0275fac=function(t){return new(t||e)}}),e}(),KV=function e(t,n,i){m(this,e),this.previousValue=t,this.currentValue=n,this.firstChange=i},$V=new Ri("NGXS_EXECUTION_STRATEGY");function QV(e){return e.constructor&&e.constructor.type?e.constructor.type:e.type}var ZV=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},JV=function(e,t){return t.split(".").reduce(function(e,t){return e&&e[t]},e)},ez=function(e){return e&&"object"==typeof e&&!Array.isArray(e)},tz=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]:uz,i=function(e){return e.reduce(function(e,t){return e[QV(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 bf(function(n){var i=QV(n.action);return e[i]&&(!t||t[n.status])})}(i,r),n())}}(t,["DISPATCHED"])}function uz(){return ce(function(e){return e.action})}function cz(e){return function(t){return new te(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 lz=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)(Zi($V))},e.\u0275prov=$e({token:e,factory:e.\u0275fac}),e}(),hz=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}(ae),dz=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}(hz);return t.\u0275fac=function(n){return(e||(e=Ti(t)))(n||t)},t.\u0275prov=$e({token:t,factory:t.\u0275fac}),t}(),fz=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(cz(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}(te);return e.\u0275fac=function(t){return new(t||e)(Zi(dz),Zi(lz))},e.\u0275prov=$e({token:e,factory:e.\u0275fac}),e}(),pz=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[WV].name]=t,e},{})}(n),u=[],c=_(o);try{for(c.s();!(i=c.n()).done;){var l=i.value,h=s[l],d=a[l],f=h[WV];this.addRuntimeInfoToMeta(f,d);var p={name:l,path:d,isInitialised:!1,actions:f.actions,instance:this._injector.get(h),defaults:e.cloneDefaults(f.defaults)};this.hasBeenMountedAndBootstrapped(l,d)||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 ZV(e,t.path,t.defaults)},{}),states:t}}},{key:"connectActionHandlers",value:function(){var e=this;null===this._actionsSubscription&&(this._actionsSubscription=this._actions.pipe(bf(function(e){return"DISPATCHED"===e.status}),ke(function(t){var n=t.action;return e.invokeActions(e._actions,n).pipe(ce(function(){return{action:n,status:"SUCCESSFUL"}}),xV({action:n,status:"CANCELED"}),Bb(function(e){return $d({action:n,status:"ERRORED",error:e})}))})).subscribe(function(t){return e._actionResults.next(t)}))}},{key:"invokeActions",value:function(e,t){var n,i=QV(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 d=a.instance[l.fn](h,t);d instanceof Promise&&(d=ye(d)),d instanceof te?(d=d.pipe(xV({})),l.options.cancelUncompleted&&(d=d.pipe(kf(e.pipe(sz(t)))))):d=$d({}).pipe(zf()),r.push(d)}catch(d){r.push(Rf(d))}}}catch(f){c.e(f)}finally{c.f()}}}}catch(f){o.e(f)}finally{o.f()}return r.length||r.push($d({})),jb(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=Sz.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!==JV(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(Sz.getValidStateMeta)}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Zi(ss),Zi(YV),Zi(e,12),Zi(dz),Zi(mz),Zi(xz),Zi(gV,8))},e.\u0275prov=$e({token:e,factory:e.\u0275fac}),e}(),Ez=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(bf(function(){return!!t}),mv(function(){return n.invokeInit(t.states)}),ke(function(){return n.bootstrapper.appBootstrapped$}),bf(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=az(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)(Zi(kz),Zi(xz),Zi(vV))},e.\u0275prov=$e({token:e,factory:e.\u0275fac}),e}(),Oz=function(e){return e&&e.NGXS_SELECTOR_OPTIONS_META||{}};function Tz(e){var t=rz(e)||iz(e);return t&&t.makeRootSelector||function(){return e}}var Pz=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(ce(n),Bb(function(e){var n=t._config.selectorOptions.suppressErrors;return e instanceof TypeError&&n?$d(void 0):Rf(e)}),lf(),cz(this._internalExecutionStrategy))}},{key:"selectOnce",value:function(e){return this.select(e).pipe(_p(1))}},{key:"selectSnapshot",value:function(e){return this.getStoreBoundSelectorFn(e)(this._stateStream.getValue())}},{key:"subscribe",value:function(e){return this._stateStream.pipe(cz(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 Tz(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)(Zi(vz),Zi(kz),Zi(YV),Zi(lz),Zi(Cz),Zi(gV,8))},e.\u0275prov=$e({token:e,factory:e.\u0275fac}),e}(),Az=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)(Zi(Pz),Zi(YV))},e.\u0275prov=$e({token:e,factory:e.\u0275fac}),e.store=null,e.config=null,e}(),Mz=function(){function e(){m(this,e)}return b(e,null,[{key:"type",get:function(){return"@@INIT"}}]),e}(),Iz=function(){function e(t){m(this,e),this.addedStates=t}return b(e,null,[{key:"type",get:function(){return"@@UPDATE_STATE"}}]),e}(),Rz=new Bf(1),Dz=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)&&ah();Rz.next(n)}catch(e){Rz.next(!1)}finally{Rz.complete()}}();var s=t.addAndReturnDefaults(o);n.setStateToTheCurrentWithNew(s),t.connectActionHandlers(),a.ngxsBootstrap(new Mz,s)};return e.\u0275fac=function(t){return new(t||e)(Zi(Cz),Zi(kz),Zi(Pz),Zi(Az),Zi(VV,8),Zi(Ez))},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({}),e}(),Nz=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 Iz(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)(Zi(Pz),Zi(kz),Zi(Cz),Zi(zV,8),Zi(Ez))},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({}),e}(),Lz=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:Dz,providers:[Cz,xz,fz,dz,vV,wz,_z,Ez,yz,mz,kz,lz,Pz,vz,Az,gz].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:Nz,providers:[Cz,gz].concat(v(e),[{provide:zV,multi:!0,useValue:e}])}}},{key:"ngxsTokenProviders",value:function(t,n){return[{provide:HV,useValue:pV},{provide:GV,useValue:ah},{provide:$V,useClass:n.executionStrategy||BV},{provide:VV,useValue:t},{provide:e.ROOT_OPTIONS,useValue:n},{provide:YV,useFactory:e.ngxsConfigFactory,deps:[e.ROOT_OPTIONS]},{provide:Il,useFactory:e.appBootstrapListenerFactory,multi:!0,deps:[vV]},{provide:gV,useFactory:e.getInitialState},{provide:yV,useExisting:xz},{provide:bV,useExisting:Cz}]}},{key:"ngxsConfigFactory",value:function(e){return tz(new YV,e)}},{key:"appBootstrapListenerFactory",value:function(e){return function(){return e.bootstrap()}}},{key:"getInitialState",value:function(){return mV.pop()}}]),e}();function jz(e,t){return function(n,i){if(n.hasOwnProperty("prototype"))throw new Error(RV());var r=nz(n.constructor);Array.isArray(e)||(e=[e]);var o,a=_(e);try{for(a.s();!(o=a.n()).done;){var s=o.value.type;r.actions[s]||(r.actions[s]=[]),r.actions[s].push({fn:i,options:t||{},type:s})}}catch(u){a.e(u)}finally{a.f()}}}function Fz(e){return function(t){!function(e){Rz.subscribe(function(t){t&&(e.\u0275prov||console.warn(FV(e.name)))})}(t);var n=t,i=nz(n),r=Object.getPrototypeOf(n),o=function(t){return Object.assign({},t[qV]||{},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;Sz.checkCorrectStateName(s),n.hasOwnProperty(WV)&&(t.actions=Object.assign({},t.actions,(n[WV]||{}).actions)),t.children=r,t.defaults=o,t.name=s})({meta:i,inheritedStateClass:r,optionsWithInheritance:o}),n[qV]=o}}function Bz(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i2&&void 0!==arguments[2]?arguments[2]:[];return"string"==typeof(t=t||function(e){var t=e.length-1;return 36===e.charCodeAt(t)?e.slice(0,t):e}(e))?oz(n.length?[t].concat(v(n)):t.split("."),Az.config):t}(a,e,n);Object.defineProperties(t,(o(r={},s,{writable:!0,enumerable:!1,configurable:!0}),o(r,a,{enumerable:!0,configurable:!0,get:function(){return this[s]||(this[s]=function(e){if(!Az.store)throw new Error(IV());return Az.store.select(e)}(u))}}),r))}}function Vz(e){return function(t,n,i){if(!i||null===i.value)throw new Error(DV());var r=i.value,o=function(e,t,n){var i=n&&n.containerClass,r=fV(function(){for(var e=arguments.length,n=new Array(e),r=0;r2&&void 0!==arguments[2]?arguments[2]:[],i=t.getSelectorOptions(),r=e.getSelectorOptions(i);return{selectorOptions:r,argumentSelectorFunctions:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,i=[];return n&&(0===e.length||t.injectContainerState)&&iz(n)&&i.push(n),e&&i.push.apply(i,v(e)),i}(n,r,t.containerClass).map(function(t){return Tz(t)(e)})}}(t,o,e),i=n.argumentSelectorFunctions,a=n.selectorOptions;return function(e){var t=i.map(function(t){return t(e)});try{return r.apply(void 0,v(t))}catch(n){if(n instanceof TypeError&&a.suppressErrors)return;throw n}}},r}(e,r,{containerClass:t,selectorName:n.toString(),getSelectorOptions:function(){return{}}}),a={configurable:!0,get:function(){return o}};return a.originalFn=r,a}}Lz.\u0275fac=function(e){return new(e||Lz)},Lz.\u0275mod=Mt({type:Lz}),Lz.\u0275inj=Qe({}),Lz.ROOT_OPTIONS=new Ri("ROOT_OPTIONS");var zz=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)(Os(nc),Os(Ju))},e.\u0275dir=Rt({type:e}),e}(),Uz=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}(zz);return t.\u0275fac=function(n){return(e||(e=Ti(t)))(n||t)},t.\u0275dir=Rt({type:t,features:[cs]}),t}(),Hz=new Ri("NgValueAccessor"),Gz={provide:Hz,useExisting:He(function(){return qz}),multi:!0},Wz=new Ri("CompositionEventMode"),qz=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=yh()?yh().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}(zz);return e.\u0275fac=function(t){return new(t||e)(Os(nc),Os(Ju),Os(Wz,8))},e.\u0275dir=Rt({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&&Vs("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:[Xu([Gz]),cs]}),e}(),Xz=new Ri("NgValidators"),Yz=new Ri("NgAsyncValidators");function Kz(e){return null!=e}function $z(e){var t=js(e)?ye(e):e;return Bs(t),t}function Qz(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 Zz(e,t){return t.map(function(t){return t(e)})}function Jz(e){return e.map(function(e){return function(e){return!e.validate}(e)?e:function(t){return e.validate(t)}})}function eU(e){return null!=e?function(e){if(!e)return null;var t=e.filter(Kz);return 0==t.length?null:function(e){return Qz(Zz(e,t))}}(Jz(e)):null}function tU(e){return null!=e?function(e){if(!e)return null;var t=e.filter(Kz);return 0==t.length?null:function(e){return jb(Zz(e,t).map($z)).pipe(ce(Qz))}}(Jz(e)):null}function nU(e,t){return null===e?[t]:Array.isArray(e)?[].concat(v(e),[t]):[e,t]}function iU(e){return e._rawValidators}function rU(e){return e._rawAsyncValidators}function oU(e){return e?Array.isArray(e)?e:[e]:[]}function aU(e,t){return Array.isArray(e)?e.includes(t):e===t}function sU(e,t){var n=oU(t);return oU(e).forEach(function(e){aU(n,e)||n.push(e)}),n}function uU(e,t){return oU(t).filter(function(t){return!aU(e,t)})}var cU=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=eU(this._rawValidators)}},{key:"_setAsyncValidators",value:function(e){this._rawAsyncValidators=e||[],this._composedAsyncValidatorFn=tU(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=Rt({type:e}),e}(),lU=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}(cU);return t.\u0275fac=function(n){return(e||(e=Ti(t)))(n||t)},t.\u0275dir=Rt({type:t,features:[cs]}),t}(),hU=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}(cU),dU=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}(),fU=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}(dU);return e.\u0275fac=function(t){return new(t||e)(Os(hU,2))},e.\u0275dir=Rt({type:e,selectors:[["","formControlName",""],["","ngModel",""],["","formControl",""]],hostVars:14,hostBindings:function(e,t){2&e&&cu("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:[cs]}),e}(),pU=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}(dU);return e.\u0275fac=function(t){return new(t||e)(Os(lU,10))},e.\u0275dir=Rt({type:e,selectors:[["","formGroupName",""],["","formArrayName",""],["","ngModelGroup",""],["","formGroup",""],["form",3,"ngNoForm",""],["","ngForm",""]],hostVars:16,hostBindings:function(e,t){2&e&&cu("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:[cs]}),e}();function vU(e,t){yU(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&&_U(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&&_U(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 gU(e,t){var n=function(){};t.valueAccessor&&(t.valueAccessor.registerOnChange(n),t.valueAccessor.registerOnTouched(n)),bU(e,t),e&&(t._invokeOnDestroyCallbacks(),e._registerOnCollectionChange(function(){}))}function mU(e,t){e.forEach(function(e){e.registerOnValidatorChange&&e.registerOnValidatorChange(t)})}function yU(e,t){var n=iU(e);null!==t.validator?e.setValidators(nU(n,t.validator)):"function"==typeof n&&e.setValidators([n]);var i=rU(e);null!==t.asyncValidator?e.setAsyncValidators(nU(i,t.asyncValidator)):"function"==typeof i&&e.setAsyncValidators([i]);var r=function(){return e.updateValueAndValidity()};mU(t._rawValidators,r),mU(t._rawAsyncValidators,r)}function bU(e,t){var n=!1;if(null!==e){if(null!==t.validator){var i=iU(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=rU(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 mU(t._rawValidators,s),mU(t._rawAsyncValidators,s),n}function _U(e,t){e._pendingDirty&&e.markAsDirty(),e.setValue(e._pendingValue,{emitModelToViewChange:!1}),t.viewToModelUpdate(e._pendingValue),e._pendingChange=!1}function wU(e,t){yU(e,t)}function kU(e,t){if(!e.hasOwnProperty("model"))return!1;var n=e.model;return!!n.isFirstChange()||!Object.is(t,n.currentValue)}function xU(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 SU(e,t){return t?(Array.isArray(t),t.forEach(function(e){e.constructor===qz?n=e:function(e){return Object.getPrototypeOf(e.constructor)===Uz}(e)?i=e:r=e}),r||i||n||null):null;var n,i,r}function CU(e,t){var n=e.indexOf(t);n>-1&&e.splice(n,1)}var EU="VALID",OU="INVALID",TU="PENDING",PU="DISABLED";function AU(e){return(DU(e)?e.validators:e)||null}function MU(e){return Array.isArray(e)?eU(e):e||null}function IU(e,t){return(DU(t)?t.asyncValidators:e)||null}function RU(e){return Array.isArray(e)?tU(e):e||null}function DU(e){return null!=e&&!Array.isArray(e)&&"object"==typeof e}var NU=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=MU(this._rawValidators),this._composedAsyncValidatorFn=RU(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===EU}},{key:"invalid",get:function(){return this.status===OU}},{key:"pending",get:function(){return this.status==TU}},{key:"disabled",get:function(){return this.status===PU}},{key:"enabled",get:function(){return this.status!==PU}},{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=MU(e)}},{key:"setAsyncValidators",value:function(e){this._rawAsyncValidators=e,this._composedAsyncValidatorFn=RU(e)}},{key:"addValidators",value:function(e){this.setValidators(sU(e,this._rawValidators))}},{key:"addAsyncValidators",value:function(e){this.setAsyncValidators(sU(e,this._rawAsyncValidators))}},{key:"removeValidators",value:function(e){this.setValidators(uU(e,this._rawValidators))}},{key:"removeAsyncValidators",value:function(e){this.setAsyncValidators(uU(e,this._rawAsyncValidators))}},{key:"hasValidator",value:function(e){return aU(this._rawValidators,e)}},{key:"hasAsyncValidator",value:function(e){return aU(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=TU,!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=PU,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=EU,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===EU||this.status===TU)&&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()?PU:EU}},{key:"_runValidator",value:function(){return this.validator?this.validator(this):null}},{key:"_runAsyncValidator",value:function(e){var t=this;if(this.asyncValidator){this.status=TU,this._hasOwnPendingAsyncValidator=!0;var n=$z(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 jU?i.controls.hasOwnProperty(e)?i.controls[e]:null:i instanceof FU&&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 ol,this.statusChanges=new ol}},{key:"_calculateStatus",value:function(){return this._allControlsDisabled()?PU:this.errors?OU:this._hasOwnPendingAsyncValidator||this._anyControlsHaveStatus(TU)?TU:this._anyControlsHaveStatus(OU)?OU:EU}},{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){DU(e)&&null!=e.updateOn&&(this._updateOn=e.updateOn)}},{key:"_parentMarkedDirty",value:function(e){return!e&&!(!this._parent||!this._parent.dirty)&&!this._parent._anyControlsDirty()}}]),e}(),LU=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,AU(r),IU(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){CU(this._onChange,e)}},{key:"registerOnDisabledChange",value:function(e){this._onDisabledChange.push(e)}},{key:"_unregisterOnDisabledChange",value:function(e){CU(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}(NU),jU=function(e){a(n,e);var t=s(n);function n(e,i,r){var o;return m(this,n),(o=t.call(this,AU(i),IU(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 LU?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}(NU),FU=function(e){a(n,e);var t=s(n);function n(e,i,r){var o;return m(this,n),(o=t.call(this,AU(i),IU(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 LU?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}(NU),BU={provide:lU,useExisting:He(function(){return zU})},VU=Promise.resolve(null),zU=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 ol,r.form=new jU({},eU(e),tU(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;VU.then(function(){var n=t._findContainer(e.path);e.control=n.registerControl(e.name,e.control),vU(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;VU.then(function(){var n=t._findContainer(e.path);n&&n.removeControl(e.name),CU(t._directives,e)})}},{key:"addFormGroup",value:function(e){var t=this;VU.then(function(){var n=t._findContainer(e.path),i=new jU({});wU(i,e),n.registerControl(e.name,i),i.updateValueAndValidity({emitEvent:!1})})}},{key:"removeFormGroup",value:function(e){var t=this;VU.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;VU.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,xU(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}(lU);return e.\u0275fac=function(t){return new(t||e)(Os(Xz,10),Os(Yz,10))},e.\u0275dir=Rt({type:e,selectors:[["form",3,"ngNoForm","",3,"formGroup",""],["ng-form"],["","ngForm",""]],hostBindings:function(e,t){1&e&&Vs("submit",function(e){return t.onSubmit(e)})("reset",function(){return t.onReset()})},inputs:{options:["ngFormOptions","options"]},outputs:{ngSubmit:"ngSubmit"},exportAs:["ngForm"],features:[Xu([BU]),cs]}),e}(),UU={provide:hU,useExisting:He(function(){return GU})},HU=Promise.resolve(null),GU=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)).control=new LU,a._registered=!1,a.update=new ol,a._parent=e,a._setValidators(i),a._setAsyncValidators(r),a.valueAccessor=SU(0,o),a}return b(n,[{key:"ngOnChanges",value:function(e){this._checkForErrors(),this._registered||this._setUpControl(),"isDisabled"in e&&this._updateDisabled(e),kU(e,this.viewModel)&&(this._updateValue(this.model),this.viewModel=this.model)}},{key:"ngOnDestroy",value:function(){this.formDirective&&this.formDirective.removeControl(this)}},{key:"path",get:function(){return this._parent?function(e,t){return[].concat(v(t.path),[e])}(this.name,this._parent):[this.name]}},{key:"formDirective",get:function(){return this._parent?this._parent.formDirective:null}},{key:"viewToModelUpdate",value:function(e){this.viewModel=e,this.update.emit(e)}},{key:"_setUpControl",value:function(){this._setUpdateStrategy(),this._isStandalone()?this._setUpStandalone():this.formDirective.addControl(this),this._registered=!0}},{key:"_setUpdateStrategy",value:function(){this.options&&null!=this.options.updateOn&&(this.control._updateOn=this.options.updateOn)}},{key:"_isStandalone",value:function(){return!this._parent||!(!this.options||!this.options.standalone)}},{key:"_setUpStandalone",value:function(){vU(this.control,this),this.control.updateValueAndValidity({emitEvent:!1})}},{key:"_checkForErrors",value:function(){this._isStandalone()||this._checkParentType(),this._checkName()}},{key:"_checkParentType",value:function(){}},{key:"_checkName",value:function(){this.options&&this.options.name&&(this.name=this.options.name),this._isStandalone()}},{key:"_updateValue",value:function(e){var t=this;HU.then(function(){t.control.setValue(e,{emitViewToModelChange:!1})})}},{key:"_updateDisabled",value:function(e){var t=this,n=e.isDisabled.currentValue,i=""===n||n&&"false"!==n;HU.then(function(){i&&!t.control.disabled?t.control.disable():!i&&t.control.disabled&&t.control.enable()})}}]),n}(hU);return e.\u0275fac=function(t){return new(t||e)(Os(lU,9),Os(Xz,10),Os(Yz,10),Os(Hz,10))},e.\u0275dir=Rt({type:e,selectors:[["","ngModel","",3,"formControlName","",3,"formControl",""]],inputs:{name:"name",isDisabled:["disabled","isDisabled"],model:["ngModel","model"],options:["ngModelOptions","options"]},outputs:{update:"ngModelChange"},exportAs:["ngModel"],features:[Xu([UU]),cs,qt]}),e}(),WU=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275dir=Rt({type:e,selectors:[["form",3,"ngNoForm","",3,"ngNativeValidate",""]],hostAttrs:["novalidate",""]}),e}(),qU=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({}),e}(),XU=new Ri("NgModelWithFormControlWarning"),YU={provide:hU,useExisting:He(function(){return KU})},KU=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 ol,a._ngModelWarningSent=!1,a._setValidators(e),a._setAsyncValidators(i),a.valueAccessor=SU(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&&gU(t,this,!1),vU(this.form,this),this.control.disabled&&this.valueAccessor.setDisabledState&&this.valueAccessor.setDisabledState(!0),this.form.updateValueAndValidity({emitEvent:!1})}kU(e,this.viewModel)&&(this.form.setValue(this.model),this.viewModel=this.model)}},{key:"ngOnDestroy",value:function(){this.form&&gU(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}(hU);return e.\u0275fac=function(t){return new(t||e)(Os(Xz,10),Os(Yz,10),Os(Hz,10),Os(XU,8))},e.\u0275dir=Rt({type:e,selectors:[["","formControl",""]],inputs:{isDisabled:["disabled","isDisabled"],form:["formControl","form"],model:["ngModel","model"]},outputs:{update:"ngModelChange"},exportAs:["ngForm"],features:[Xu([YU]),cs,qt]}),e._ngModelWarningSentOnce=!1,e}(),$U={provide:lU,useExisting:He(function(){return QU})},QU=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 ol,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&&(bU(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 vU(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){gU(e.control||null,e,!1),CU(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,xU(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&&(gU(n||null,t),i instanceof LU&&(vU(i,t),t.control=i))}),this.form._updateTreeValidity({emitEvent:!1})}},{key:"_setUpFormContainer",value:function(e){var t=this.form.get(e.path);wU(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 bU(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(){yU(this.form,this),this._oldForm&&bU(this._oldForm,this)}},{key:"_checkFormPresent",value:function(){}}]),n}(lU);return e.\u0275fac=function(t){return new(t||e)(Os(Xz,10),Os(Yz,10))},e.\u0275dir=Rt({type:e,selectors:[["","formGroup",""]],hostBindings:function(e,t){1&e&&Vs("submit",function(e){return t.onSubmit(e)})("reset",function(){return t.onReset()})},inputs:{form:["formGroup","form"]},outputs:{ngSubmit:"ngSubmit"},exportAs:["ngForm"],features:[Xu([$U]),cs,qt]}),e}(),ZU=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({imports:[[qU]]}),e}(),JU=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({imports:[ZU]}),e}(),eH=function(){var e=function(){function e(){m(this,e)}return b(e,null,[{key:"withConfig",value:function(t){return{ngModule:e,providers:[{provide:XU,useValue:t.warnOnNgModelWithFormControl}]}}}]),e}();return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({imports:[ZU]}),e}();function tH(e){return new te(function(t){var n;try{n=e()}catch(i){return void t.error(i)}return(n?ye(n):If()).subscribe(t)})}var nH=["underline"],iH=["connectionContainer"],rH=["inputContainer"],oH=["label"];function aH(e,t){1&e&&(Rs(0),As(1,"div",14),Is(2,"div",15),Is(3,"div",16),Is(4,"div",17),Ms(),As(5,"div",18),Is(6,"div",15),Is(7,"div",16),Is(8,"div",17),Ms(),Ds())}function sH(e,t){1&e&&(As(0,"div",19),Ys(1,1),Ms())}function uH(e,t){if(1&e&&(Rs(0),Ys(1,2),As(2,"span"),Cu(3),Ms(),Ds()),2&e){var n=Ws(2);Yo(3),Eu(n._control.placeholder)}}function cH(e,t){1&e&&Ys(0,3,["*ngSwitchCase","true"])}function lH(e,t){1&e&&(As(0,"span",23),Cu(1," *"),Ms())}function hH(e,t){if(1&e){var n=Ls();As(0,"label",20,21),Vs("cdkObserveContent",function(){return bn(n),Ws().updateOutlineGap()}),Cs(2,uH,4,1,"ng-container",12),Cs(3,cH,1,0,"ng-content",12),Cs(4,lH,2,0,"span",22),Ms()}if(2&e){var i=Ws();cu("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),Ts("cdkObserveContentDisabled","outline"!=i.appearance)("id",i._labelId)("ngSwitch",i._hasLabel()),ks("for",i._control.id)("aria-owns",i._control.id),Yo(2),Ts("ngSwitchCase",!1),Yo(1),Ts("ngSwitchCase",!0),Yo(1),Ts("ngIf",!i.hideRequiredMarker&&i._control.required&&!i._control.disabled)}}function dH(e,t){1&e&&(As(0,"div",24),Ys(1,4),Ms())}function fH(e,t){if(1&e&&(As(0,"div",25,26),Is(2,"span",27),Ms()),2&e){var n=Ws();Yo(2),cu("mat-accent","accent"==n.color)("mat-warn","warn"==n.color)}}function pH(e,t){1&e&&(As(0,"div"),Ys(1,5),Ms()),2&e&&Ts("@transitionMessages",Ws()._subscriptAnimationState)}function vH(e,t){if(1&e&&(As(0,"div",31),Cu(1),Ms()),2&e){var n=Ws(2);Ts("id",n._hintLabelId),Yo(1),Eu(n.hintLabel)}}function gH(e,t){if(1&e&&(As(0,"div",28),Cs(1,vH,2,2,"div",29),Ys(2,6),Is(3,"div",30),Ys(4,7),Ms()),2&e){var n=Ws();Ts("@transitionMessages",n._subscriptAnimationState),Yo(1),Ts("ngIf",n.hintLabel)}}var mH=["*",[["","matPrefix",""]],[["mat-placeholder"]],[["mat-label"]],[["","matSuffix",""]],[["mat-error"]],[["mat-hint",3,"align","end"]],[["mat-hint","align","end"]]],yH=["*","[matPrefix]","mat-placeholder","mat-label","[matSuffix]","mat-error","mat-hint:not([align='end'])","mat-hint[align='end']"],bH=new Ri("MatError"),_H={transitionMessages:fg("transitionMessages",[mg("enter",gg({opacity:1,transform:"translateY(0%)"})),yg("void => enter",[gg({opacity:0,transform:"translateY(-5px)"}),pg("300ms cubic-bezier(0.55, 0, 0.55, 0.2)")])])},wH=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275dir=Rt({type:e}),e}(),kH=new Ri("MatHint"),xH=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275dir=Rt({type:e,selectors:[["mat-label"]]}),e}(),SH=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275dir=Rt({type:e,selectors:[["mat-placeholder"]]}),e}(),CH=new Ri("MatPrefix"),EH=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275dir=Rt({type:e,selectors:[["","matPrefix",""]],features:[Xu([{provide:CH,useExisting:e}])]}),e}(),OH=new Ri("MatSuffix"),TH=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275dir=Rt({type:e,selectors:[["","matSuffix",""]],features:[Xu([{provide:OH,useExisting:e}])]}),e}(),PH=0,AH=ab(function(){return function e(t){m(this,e),this._elementRef=t}}(),"primary"),MH=new Ri("MAT_FORM_FIELD_DEFAULT_OPTIONS"),IH=new Ri("MatFormField"),RH=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 ae,l._showAlwaysAnimate=!1,l._subscriptAnimationState="",l._hintLabel="",l._hintLabelId="mat-hint-"+PH++,l._labelId="mat-form-field-label-"+PH++,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=Wd(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(Ef(null)).subscribe(function(){e._validatePlaceholders(),e._syncDescribedByIds(),e._changeDetectorRef.markForCheck()}),t.ngControl&&t.ngControl.valueChanges&&t.ngControl.valueChanges.pipe(kf(this._destroyed)).subscribe(function(){return e._changeDetectorRef.markForCheck()}),this._ngZone.runOutsideAngular(function(){e._ngZone.onStable.pipe(kf(e._destroyed)).subscribe(function(){e._outlineGapCalculationNeededOnStable&&e.updateOutlineGap()})}),Oe(this._prefixChildren.changes,this._suffixChildren.changes).subscribe(function(){e._outlineGapCalculationNeededOnStable=!0,e._changeDetectorRef.markForCheck()}),this._hintChildren.changes.pipe(Ef(null)).subscribe(function(){e._processHints(),e._changeDetectorRef.markForCheck()}),this._errorChildren.changes.pipe(Ef(null)).subscribe(function(){e._syncDescribedByIds(),e._changeDetectorRef.markForCheck()}),this._dir&&this._dir.change.pipe(kf(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,Qd(this._label.nativeElement,"transitionend").pipe(_p(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 d=0;d1&&void 0!==arguments[1]?arguments[1]:ff,n=function(e){return e instanceof Date&&!isNaN(+e)}(e)?+e-t.now():Math.abs(e);return function(e){return e.lift(new LH(n,t))}}var LH=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 jH(e,this.delay,this.scheduler))}}]),e}(),jH=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 FH(t.now()+this.delay,e);this.queue.push(n),!1===this.active&&this._schedule(t)}}},{key:"_next",value:function(e){this.scheduleNotification(Nf.createNext(e))}},{key:"_error",value:function(e){this.errored=!0,this.queue=[],this.destination.error(e),this.unsubscribe()}},{key:"_complete",value:function(){this.scheduleNotification(Nf.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}(K),FH=function e(t,n){m(this,e),this.time=t,this.notification=n},BH=["panel"];function VH(e,t){if(1&e&&(As(0,"div",0,1),Ys(2),Ms()),2&e){var n=t.id,i=Ws();Ts("id",i.id)("ngClass",i._classList),ks("aria-label",i.ariaLabel||null)("aria-labelledby",i._getPanelAriaLabelledby(n))}}var zH=["*"],UH=0,HH=function e(t,n){m(this,e),this.source=t,this.option=n},GH=sb(function(){return function e(){m(this,e)}}()),WH=new Ri("mat-autocomplete-default-options",{providedIn:"root",factory:function(){return{autoActiveFirstOption:!1}}}),qH=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=q.EMPTY,a.showPanel=!1,a._isOpen=!1,a.displayWith=null,a.optionSelected=new ol,a.opened=new ol,a.closed=new ol,a.optionActivated=new ol,a._classList={},a.id="mat-autocomplete-"+UH++,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=Wd(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 zv(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 HH(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}(GH);return e.\u0275fac=function(t){return new(t||e)(Os(Cc),Os(Ju),Os(WH),Os(qf))},e.\u0275dir=Rt({type:e,viewQuery:function(e,t){var n;(1&e&&(yl(Ac,7),yl(BH,5)),2&e)&&(ml(n=_l())&&(t.template=n.first),ml(n=_l())&&(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:[cs]}),e}(),XH=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}(qH);return t.\u0275fac=function(n){return(e||(e=Ti(t)))(n||t)},t.\u0275cmp=Ot({type:t,selectors:[["mat-autocomplete"]],contentQueries:function(e,t,n){var i;(1&e&&(bl(n,Pb,5),bl(n,Rb,5)),2&e)&&(ml(i=_l())&&(t.optionGroups=i),ml(i=_l())&&(t.options=i))},hostAttrs:[1,"mat-autocomplete"],inputs:{disableRipple:"disableRipple"},exportAs:["matAutocomplete"],features:[Xu([{provide:Cb,useExisting:t}]),cs],ngContentSelectors:zH,decls:1,vars:0,consts:[["role","listbox",1,"mat-autocomplete-panel",3,"id","ngClass"],["panel",""]],template:function(e,t){1&e&&(Xs(),Cs(0,VH,3,4,"ng-template"))},directives:[Gh],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}(),YH=new Ri("mat-autocomplete-scroll-strategy"),KH={provide:YH,deps:[iv],useFactory:function(e){return function(){return e.scrollStrategies.reposition()}}},$H={provide:Hz,useExisting:He(function(){return ZH}),multi:!0},QH=function(){var e=function(){function e(t,n,i,r,o,a,s,u,c,l,h){var d=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=q.EMPTY,this._canOpenOnNextFocus=!0,this._closeKeyEventStream=new ae,this._windowBlurHandler=function(){d._canOpenOnNextFocus=d._document.activeElement!==d._element.nativeElement||d.panelOpen},this._onChange=function(){},this._onTouched=function(){},this.position="auto",this.autocompleteAttribute="off",this._overlayAttached=!1,this.optionSelections=tH(function(){return d.autocomplete&&d.autocomplete.options?Oe.apply(void 0,v(d.autocomplete.options.map(function(e){return e.onSelectionChange}))):d._zone.onStable.pipe(_p(1),Of(function(){return d.optionSelections}))}),this._scrollStrategy=a}return b(e,[{key:"autocompleteDisabled",get:function(){return this._autocompleteDisabled},set:function(e){this._autocompleteDisabled=Wd(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 Oe(this.optionSelections,this.autocomplete._keyManager.tabOut.pipe(bf(function(){return e._overlayAttached})),this._closeKeyEventStream,this._getOutsideClickStream(),this._overlayRef?this._overlayRef.detachments().pipe(bf(function(){return e._overlayAttached})):$d()).pipe(ce(function(e){return e instanceof Mb?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 Oe(Qd(this._document,"click"),Qd(this._document,"auxclick"),Qd(this._document,"touchend")).pipe(bf(function(t){var n=Jf(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&&!Ep(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 Oe(this._zone.onStable.pipe(_p(1)),this.autocomplete.options.changes.pipe(mv(function(){return e._positionStrategy.reapplyLastPosition()}),NH(0))).pipe(Of(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}),_p(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 hp(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&&!Ep(e)||38===e.keyCode&&Ep(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 Np({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=Db(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=Nb(r.offsetTop,r.offsetHeight,t._getScrollTop(),t.panel.nativeElement.offsetHeight);t._setScrollTop(o)}}}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Os(Ju),Os(iv),Os(Nc),Os(Xl),Os(Cc),Os(YH),Os(tp,8),Os(IH,9),Os(bh,8),Os(ap),Os(WH,8))},e.\u0275dir=Rt({type:e,inputs:{position:["matAutocompletePosition","position"],autocompleteAttribute:["autocomplete","autocompleteAttribute"],autocompleteDisabled:["matAutocompleteDisabled","autocompleteDisabled"],autocomplete:["matAutocomplete","autocomplete"],connectedTo:["matAutocompleteConnectedTo","connectedTo"]},features:[qt]}),e}(),ZH=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}(QH);return t.\u0275fac=function(n){return(e||(e=Ti(t)))(n||t)},t.\u0275dir=Rt({type:t,selectors:[["input","matAutocomplete",""],["textarea","matAutocomplete",""]],hostAttrs:[1,"mat-autocomplete-trigger"],hostVars:7,hostBindings:function(e,t){1&e&&Vs("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&&ks("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:[Xu([$H]),cs]}),t}(),JH=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({providers:[KH],imports:[[cv,Lb,rb,cd],sp,Lb,rb]}),e}(),eG=$f({passive:!0}),tG=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 Mf;var n=Kd(e),i=this._monitoredElements.get(n);if(i)return i.subject;var r=new ae,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,eG),n.classList.add("cdk-text-field-autofill-monitored")}),this._monitoredElements.set(n,{subject:r,unlisten:function(){n.removeEventListener("animationstart",a,eG)}}),r}},{key:"stopMonitoring",value:function(e){var t=Kd(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)(Zi(qf),Zi(Xl))},e.\u0275prov=$e({factory:function(){return new e(Zi(qf),Zi(Xl))},token:e,providedIn:"root"}),e}(),nG=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({imports:[[Xf]]}),e}(),iG=new Ri("MAT_INPUT_VALUE_ACCESSOR"),rG=["button","checkbox","file","hidden","image","radio","range","reset","submit"],oG=0,aG=cb(function(){return function e(t,n,i,r){m(this,e),this._defaultErrorStateMatcher=t,this._parentForm=n,this._parentFormGroup=i,this.ngControl=r}}()),sG=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 d;m(this,n),(d=t.call(this,s,o,a,r))._elementRef=e,d._platform=i,d._autofillMonitor=c,d._formField=h,d._uid="mat-input-"+oG++,d.focused=!1,d.stateChanges=new ae,d.controlType="mat-input",d.autofilled=!1,d._disabled=!1,d._required=!1,d._type="text",d._readonly=!1,d._neverEmptyInputTypes=["date","datetime","datetime-local","month","time","week"].filter(function(e){return Kf().has(e)});var f=d._elementRef.nativeElement,p=f.nodeName.toLowerCase();return d._inputValueAccessor=u||f,d._previousNativeValue=d.value,d.id=d.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))})}),d._isServer=!d._platform.isBrowser,d._isNativeSelect="select"===p,d._isTextarea="textarea"===p,d._isInFormField=!!h,d._isNativeSelect&&(d.controlType=f.multiple?"mat-native-select-multiple":"mat-native-select"),d}return b(n,[{key:"disabled",get:function(){return this.ngControl&&null!==this.ngControl.disabled?this.ngControl.disabled:this._disabled},set:function(e){this._disabled=Wd(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=Wd(e)}},{key:"type",get:function(){return this._type},set:function(e){this._type=e||"text",this._validateType(),!this._isTextarea&&Kf().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=Wd(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(){rG.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}(aG);return e.\u0275fac=function(t){return new(t||e)(Os(Ju),Os(qf),Os(hU,10),Os(zU,8),Os(QU,8),Os(lb),Os(iG,10),Os(tG),Os(Xl),Os(IH,8))},e.\u0275dir=Rt({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&&Vs("focus",function(){return t._focusChanged(!0)})("blur",function(){return t._focusChanged(!1)})("input",function(){return t._onInput()}),2&e&&(Au("disabled",t.disabled)("required",t.required),ks("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),cu("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:[Xu([{provide:wH,useExisting:e}]),cs,qt]}),e}(),uG=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({providers:[lb],imports:[[nG,DH,rb],nG,DH]}),e}();function cG(){for(var e=arguments.length,t=new Array(e),n=0;n0&&void 0!==arguments[0]?arguments[0]:this.value,t=new yG;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}(bG);return e.\u0275fac=function(t){return new(t||e)(Os(Ju),Os(rg),Os(Cc),Os(tp,8),Ai("tabindex"),Os(Xl),Os(bh),Os(Yy,8))},e.\u0275cmp=Ot({type:e,selectors:[["mat-slider"]],viewQuery:function(e,t){var n;(1&e&&yl(vG,5),2&e)&&(ml(n=_l())&&(t._sliderWrapper=n.first))},hostAttrs:["role","slider",1,"mat-slider","mat-focus-indicator"],hostVars:29,hostBindings:function(e,t){1&e&&Vs("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&&(Au("tabIndex",t.tabIndex),ks("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"),cu("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:[Xu([mG]),cs],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&&(As(0,"div",0,1),As(2,"div",2),Is(3,"div",3),Is(4,"div",4),Ms(),As(5,"div",5),Is(6,"div",6),Ms(),As(7,"div",7),Is(8,"div",8),Is(9,"div",9),As(10,"div",10),As(11,"span",11),Cu(12),Ms(),Ms(),Ms(),Ms()),2&e&&(Yo(3),Ts("ngStyle",t._getTrackBackgroundStyles()),Yo(1),Ts("ngStyle",t._getTrackFillStyles()),Yo(1),Ts("ngStyle",t._getTicksContainerStyles()),Yo(1),Ts("ngStyle",t._getTicksStyles()),Yo(1),Ts("ngStyle",t._getThumbContainerStyles()),Yo(5),Eu(t.displayValue))},directives:[td],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 wG(e){return"t"===e.type[0]}function kG(e,t){var n;return(n=wG(e)?"number"==typeof t?xG(e.touches,t)||xG(e.changedTouches,t):e.touches[0]||e.changedTouches[0]:e)?{x:n.clientX,y:n.clientY}:void 0}function xG(e,t){for(var n=0;n enter",pg("150ms cubic-bezier(0, 0, 0.2, 1)",gg({transform:"none",opacity:1}))),yg("* => void, * => exit",pg("75ms cubic-bezier(0.4, 0.0, 0.2, 1)",gg({opacity:0})))])},TG=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 ol,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=Zf(),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=Zf())}},{key:"_focusDialogContainer",value:function(){this._elementRef.nativeElement.focus&&this._elementRef.nativeElement.focus()}},{key:"_containsFocus",value:function(){var e=this._elementRef.nativeElement,t=Zf();return e===t||e.contains(t)}}]),n}(fp);return e.\u0275fac=function(t){return new(t||e)(Os(Ju),Os(qv),Os(Cc),Os(bh,8),Os(EG),Os(rg))},e.\u0275dir=Rt({type:e,viewQuery:function(e,t){var n;(1&e&&yl(mp,7),2&e)&&(ml(n=_l())&&(t._portalOutlet=n.first))},features:[cs]}),e}(),PG=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}(TG);return t.\u0275fac=function(n){return(e||(e=Ti(t)))(n||t)},t.\u0275cmp=Ot({type:t,selectors:[["mat-dialog-container"]],hostAttrs:["tabindex","-1","aria-modal","true",1,"mat-dialog-container"],hostVars:6,hostBindings:function(e,t){1&e&&zs("@dialogContainer.start",function(e){return t._onAnimationStart(e)})("@dialogContainer.done",function(e){return t._onAnimationDone(e)}),2&e&&(Au("id",t._id),ks("role",t._config.role)("aria-labelledby",t._config.ariaLabel?null:t._ariaLabelledBy)("aria-label",t._config.ariaLabel)("aria-describedby",t._config.ariaDescribedBy||null),Mu("@dialogContainer",t._state))},features:[cs],decls:1,vars:0,consts:[["cdkPortalOutlet",""]],template:function(e,t){1&e&&Cs(0,CG,0,0,"ng-template",0)},directives:[mp],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:[OG.dialogContainer]}}),t}(),AG=0,MG=function(){function e(t,n){var i=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"mat-dialog-"+AG++;m(this,e),this._overlayRef=t,this._containerInstance=n,this.id=r,this.disableClose=this._containerInstance._config.disableClose,this._afterOpened=new ae,this._afterClosed=new ae,this._beforeClosed=new ae,this._state=0,n._id=r,n._animationStateChanged.pipe(bf(function(e){return"opened"===e.state}),_p(1)).subscribe(function(){i._afterOpened.next(),i._afterOpened.complete()}),n._animationStateChanged.pipe(bf(function(e){return"closed"===e.state}),_p(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(bf(function(e){return 27===e.keyCode&&!i.disableClose&&!Ep(e)})).subscribe(function(e){e.preventDefault(),IG(i,"keyboard")}),t.backdropClick().subscribe(function(){i.disableClose?i._containerInstance._recaptureFocus():IG(i,"mouse")})}return b(e,[{key:"close",value:function(e){var t=this;this._result=e,this._containerInstance._animationStateChanged.pipe(bf(function(e){return"closing"===e.state}),_p(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 IG(e,t,n){return void 0!==e._containerInstance&&(e._containerInstance._closeInteractionType=t),e.close(n)}var RG=new Ri("MatDialogData"),DG=new Ri("mat-dialog-default-options"),NG=new Ri("mat-dialog-scroll-strategy"),LG={provide:NG,deps:[iv],useFactory:function(e){return function(){return e.scrollStrategies.block()}}},jG=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 ae,this._afterOpenedAtThisLevel=new ae,this._ariaHiddenElements=new Map,this.afterAllClosed=tH(function(){return l.openDialogs.length?l._getAfterAllClosed():l._getAfterAllClosed().pipe(Ef(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 EG)).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 Np({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=ss.create({parent:t&&t.viewContainerRef&&t.viewContainerRef.injector||this._injector,providers:[{provide:EG,useValue:t}]}),i=new lp(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 Ac)t.attachTemplatePortal(new hp(e,null,{$implicit:i.data,dialogRef:r}));else{var o=this._createInjector(i,r,t),a=t.attachComponentPortal(new lp(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(tp,null,at.Optional))&&r.push({provide:tp,useValue:{value:e.direction,change:$d()}}),ss.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)(Os(iv),Os(ss),Os(void 0),Os(void 0),Os(Hp),Os(void 0),Os(Di),Os(Di),Os(Ri))},e.\u0275dir=Rt({type:e}),e}(),FG=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,MG,PG,RG)}return n}(jG);return e.\u0275fac=function(t){return new(t||e)(Zi(iv),Zi(ss),Zi(Ih,8),Zi(DG,8),Zi(NG),Zi(e,12),Zi(Hp))},e.\u0275prov=$e({token:e,factory:e.\u0275fac}),e}(),BG=0,VG=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-"+BG++}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)(Os(MG,8),Os(Ju),Os(FG))},e.\u0275dir=Rt({type:e,selectors:[["","mat-dialog-title",""],["","matDialogTitle",""]],hostAttrs:[1,"mat-dialog-title"],hostVars:1,hostBindings:function(e,t){2&e&&Au("id",t.id)},inputs:{id:"id"},exportAs:["matDialogTitle"]}),e}(),zG=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275dir=Rt({type:e,selectors:[["","mat-dialog-content",""],["mat-dialog-content"],["","matDialogContent",""]],hostAttrs:[1,"mat-dialog-content"]}),e}(),UG=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({providers:[FG,LG],imports:[[cv,yp,rb],rb]}),e}(),HG=new Ri("CdkAccordion"),GG=0,WG=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=q.EMPTY,this.closed=new ol,this.opened=new ol,this.destroyed=new ol,this.expandedChange=new ol,this.id="cdk-accordion-child-"+GG++,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=Wd(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=Wd(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)(Os(HG,12),Os(Cc),Os(rp))},e.\u0275dir=Rt({type:e,selectors:[["cdk-accordion-item"],["","cdkAccordionItem",""]],inputs:{expanded:"expanded",disabled:"disabled"},outputs:{closed:"closed",opened:"opened",destroyed:"destroyed",expandedChange:"expandedChange"},exportAs:["cdkAccordionItem"],features:[Xu([{provide:HG,useValue:void 0}])]}),e}(),qG=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({}),e}(),XG=["body"];function YG(e,t){}var KG=[[["mat-expansion-panel-header"]],"*",[["mat-action-row"]]],$G=["mat-expansion-panel-header","*","mat-action-row"];function QG(e,t){1&e&&Is(0,"span",2),2&e&&Ts("@indicatorRotate",Ws()._getExpandedState())}var ZG=[[["mat-panel-title"]],[["mat-panel-description"]],"*"],JG=["mat-panel-title","mat-panel-description","*"],eW=new Ri("MAT_ACCORDION"),tW="225ms cubic-bezier(0.4,0.0,0.2,1)",nW={indicatorRotate:fg("indicatorRotate",[mg("collapsed, void",gg({transform:"rotate(0deg)"})),mg("expanded",gg({transform:"rotate(180deg)"})),yg("expanded <=> collapsed, void => collapsed",pg(tW))]),bodyExpansion:fg("bodyExpansion",[mg("collapsed, void",gg({height:"0px",visibility:"hidden"})),mg("expanded",gg({height:"*",visibility:"visible"})),yg("expanded <=> collapsed, void => collapsed",pg(tW))])},iW=function(){var e=function e(t){m(this,e),this._template=t};return e.\u0275fac=function(t){return new(t||e)(Os(Ac))},e.\u0275dir=Rt({type:e,selectors:[["ng-template","matExpansionPanelContent",""]]}),e}(),rW=0,oW=new Ri("MAT_EXPANSION_PANEL_DEFAULT_OPTIONS"),aW=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 ol,c.afterCollapse=new ol,c._inputChanges=new ae,c._headerId="mat-expansion-panel-header-"+rW++,c._bodyAnimationDone=new ae,c.accordion=e,c._document=a,c._bodyAnimationDone.pipe(lf(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=Wd(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(Ef(null),bf(function(){return e.expanded&&!e._portal}),_p(1)).subscribe(function(){e._portal=new hp(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}(WG);return t.\u0275fac=function(e){return new(e||t)(Os(eW,12),Os(Cc),Os(rp),Os(Nc),Os(bh),Os(Yy,8),Os(oW,8))},t.\u0275cmp=Ot({type:t,selectors:[["mat-expansion-panel"]],contentQueries:function(e,t,n){var i;(1&e&&bl(n,iW,5),2&e)&&(ml(i=_l())&&(t._lazyContent=i.first))},viewQuery:function(e,t){var n;(1&e&&yl(XG,5),2&e)&&(ml(n=_l())&&(t._body=n.first))},hostAttrs:[1,"mat-expansion-panel"],hostVars:6,hostBindings:function(e,t){2&e&&cu("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:[Xu([{provide:eW,useValue:void 0}]),cs,qt],ngContentSelectors:$G,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&&(Xs(KG),Ys(0),As(1,"div",0,1),Vs("@bodyExpansion.done",function(e){return t._bodyAnimationDone.next(e)}),As(3,"div",2),Ys(4,1),Cs(5,YG,0,0,"ng-template",3),Ms(),Ys(6,2),Ms()),2&e&&(Yo(1),Ts("@bodyExpansion",t._getExpandedState())("id",t.id),ks("aria-labelledby",t._headerId),Yo(4),Ts("cdkPortalOutlet",t._portal))},directives:[mp],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:[nW.bodyExpansion]},changeDetection:0}),t}(),sW=ub(function e(){m(this,e)}),uW=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=q.EMPTY;var l=e.accordion?e.accordion._stateChanges.pipe(bf(function(e){return!(!e.hideToggle&&!e.togglePosition)})):Mf;return c.tabIndex=parseInt(u||"")||0,c._parentChangeSubscription=Oe(e.opened,e.closed,l,e._inputChanges.pipe(bf(function(e){return!!(e.hideToggle||e.disabled||e.togglePosition)}))).subscribe(function(){return c._changeDetectorRef.markForCheck()}),e.closed.pipe(bf(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:Ep(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}(sW);return e.\u0275fac=function(t){return new(t||e)(Os(aW,1),Os(Ju),Os(rg),Os(Cc),Os(oW,8),Os(Yy,8),Ai("tabindex"))},e.\u0275cmp=Ot({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&&Vs("click",function(){return t._toggle()})("keydown",function(e){return t._keydown(e)}),2&e&&(ks("id",t.panel._headerId)("tabindex",t.tabIndex)("aria-controls",t._getPanelId())("aria-expanded",t._isExpanded())("aria-disabled",t.panel.disabled),uu("height",t._getHeaderHeight()),cu("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:[cs],ngContentSelectors:JG,decls:5,vars:1,consts:[[1,"mat-content"],["class","mat-expansion-indicator",4,"ngIf"],[1,"mat-expansion-indicator"]],template:function(e,t){1&e&&(Xs(ZG),As(0,"span",0),Ys(1),Ys(2,1),Ys(3,2),Ms(),Cs(4,QG,1,1,"span",1)),2&e&&(Yo(4),Ts("ngIf",t._showToggle()))},directives:[Yh],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:[nW.indicatorRotate]},changeDetection:0}),e}(),cW=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({imports:[[cd,rb,qG,yp]]}),e}(),lW=r(5478);Object.create(Error.prototype);var hW=["*"],dW=(function(e){e.LineHighlight="line-highlight",e.LineNumbers="line-numbers"}(dW||(dW={})),dW),fW=function e(){m(this,e)},pW=new Ri("SECURITY_CONTEXT"),vW=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 lW.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=lW.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(ce(function(n){return t.handleExtension(e,n)}))}},{key:"highlight",value:function(e){if(hd(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(!hd(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(!hd(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(!hd(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)(Zi(Ml),Zi(pW),Zi(h_,8),Zi(fW,8),Zi(Vd))},e.\u0275prov=$e({token:e,factory:e.\u0275fac}),e}(),gW=function(){var e=function(){function e(t,n){m(this,e),this.element=t,this.markdownService=n,this.error=new ol,this.load=new ol,this.ready=new ol,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,dW.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}(K_),kW=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 xW(e,this.accumulator,this.seed,this.hasSeed))}}]),e}(),xW=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}(K),SW=function(){function e(t){m(this,e),this.predicate=t}return b(e,[{key:"call",value:function(e,t){return t.subscribe(new CW(e,this.predicate))}}]),e}(),CW=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}(K),EW=["youtubeContainer"],OW=function(){var e=function(){function e(t,n){m(this,e),this._ngZone=t,this._youtubeContainer=new ae,this._destroyed=new ae,this._playerChanges=new vv(void 0),this._videoId=new vv(void 0),this._height=new vv(390),this._width=new vv(640),this._startSeconds=new vv(void 0),this._endSeconds=new vv(void 0),this._suggestedQuality=new vv(void 0),this._playerVars=new vv(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=hd(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=$d(!0);if(!window.YT||!window.YT.Player){var i=new ae;this._existingApiReadyCallback=window.onYouTubeIframeAPIReady,window.onYouTubeIframeAPIReady=function(){e._existingApiReadyCallback&&e._existingApiReadyCallback(),e._ngZone.run(function(){return i.next(!0)})},n=i.pipe(_p(1),Ef(!1))}var r=function(e,n,i,r,o,a,s){var u=J_([n,a]).pipe(bW(J_([r,o])),ce(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,$d(s)]).pipe(function(e){return J(function(){for(var e=arguments.length,t=new Array(e),n=0;n=2&&(n=!0),function(i){return i.lift(new kW(e,t,n))}}(TW,void 0),lf())}(this._youtubeContainer,this._videoId,n,this._width,this._height,this._playerVars,this._ngZone).pipe(mv(function(t){e._playerChanges.next(t)}),ke(function(e){return e?PW(e)?$d(e):new te(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){PW(e)||e.destroy()}(e)}}).pipe(_p(1),Ef(void 0)):$d(void 0)}),kf(this._destroyed),De(new ae));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(ce(function(e){var n=t(e,2);return{startSeconds:n[0],endSeconds:n[1]}})),u=s.pipe(AW(e,function(e){return!!e&&!function(e){var t=e.getPlayerState();return t!==YT.PlayerState.UNSTARTED&&t!==YT.PlayerState.CUED}(e)})),c=n.pipe(AW(e,function(e,t){return!!e&&e.videoId!==t}));Oe(e.pipe(AW(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(bW(J_([e,n,s,o])),ce(function(e){var n=t(e,2);n[0];return n[1]}),kf(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(Of(function(t){return t?yW(function(n){t.addEventListener(e,n)},function(n){try{t.removeEventListener&&t.removeEventListener(e,n)}catch(i){}}):$d()}),function(e){return new te(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()}})})},kf(this._destroyed))}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Os(Xl),Os(Ml))},e.\u0275cmp=Ot({type:e,selectors:[["youtube-player"]],viewQuery:function(e,t){var n;(1&e&&yl(EW,5),2&e)&&(ml(n=_l())&&(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&&Is(0,"div",null,0)},encapsulation:2,changeDetection:0}),e}();function TW(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 PW(e){return"getPlayerStatus"in e}function AW(e,n){return J(bW(e),bf(function(e){var i=t(e,2),r=i[0],o=i[1];return n(o,r)}),ce(function(e){return t(e,1)[0]}))}var MW=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({}),e}(),IW=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275dir=Rt({type:e,selectors:[["","mat-card-sm-image",""],["","matCardImageSmall",""]],hostAttrs:[1,"mat-card-sm-image"]}),e}();function RW(e){return!0===e}function DW(e){return null==e}function NW(e){return!DW(e)}function LW(e){return Boolean(e)}function jW(e){return DW(e)?e:JSON.parse(JSON.stringify(e))}var FW=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 BW(e){return NW(e)&&"object"==typeof e&&function(e){return"[object Object]"===Object.prototype.toString.call(e)}(e)}var VW="NGXS_DATA_META",zW="NGXS_META",UW="NGXS_ARGUMENT_REGISTRY_META",HW=function(){var e=function(){function e(t){var n=this;m(this,e),this.sequence$=new vv(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)(Zi(Pz,8))},e.\u0275prov=$e({token:e,factory:e.\u0275fac}),e}();function GW(e){return e[VW]}var WW=function(){var e=function e(t,n,i){m(this,e),e.store=t.get(Pz),e.ngZone=t.get(Xl),e.factory=n,e.context=i,e.computed=t.get(HW)};return e.store=null,e.computed=null,e.context=null,e.factory=null,e.ngZone=null,e.\u0275prov=$e({token:e,factory:e.\u0275fac=function(t){return new(t||e)(Zi(ss),Zi(bV),Zi(yV))}}),e}(),qW=function(){function e(){m(this,e),e.statesCachedMeta.clear()}return b(e,null,[{key:"createStateContext",value:function(e){return WW.context.createStateContext(e)}},{key:"ensureMappedState",value:function(t){if(DW(WW.factory)||DW(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(NW(t.name)?e.statesCachedMeta.get(t.name):null)||e.ensureMeta(t)}},{key:"getRepositoryByInstance",value:function(t){var n,i=null!==(n=GW(e.getStateClassByInstance(t)))&&void 0!==n?n:null;if(DW(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=NW(t.name)?null===(n=WW.factory.states)||void 0===n?void 0:n.find(function(e){return e.name===t.name}):null;return NW(i)&&NW(t.name)&&e.statesCachedMeta.set(t.name,i),i}}]),e}();qW.statesCachedMeta=new Map,qW.\u0275fac=function(e){return new(e||qW)},qW.\u0275prov=$e({token:qW,factory:qW.\u0275fac}),new Bf(1);var XW=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(NW(null==e?void 0:e.constructor)?e.constructor.name:e," to PlainObject"))}return n}(l(Error));function YW(e){var t;return null!==(t=e.NGXS_OPTIONS_META)&&void 0!==t?t:{name:""}}function KW(e){var t,n=YW(e),i=null!==(t=n.children)&&void 0!==t?t:[],r=jW(void 0===n.defaults?{}:n.defaults);if(i.length){if(BW(r))return function(e,t){return t.reduce(function(e,t){var n=YW(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()]=KW(t),e},null!=e?e:{})}(r,i);throw new XW(r)}return r}function $W(e){var t;return null!==(t=e.__NGXS_COMPUTED_OPTION__)&&void 0!==t?t:null}function QW(){var e,t;return null!==(t=null===(e=null==WW?void 0:WW.computed)||void 0===e?void 0:e.sequenceValue)&&void 0!==t?t:0}function ZW(e){var t=!1;return cf(e)&&(t=!0),t}function JW(e){return e[UW]}var eq=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)),tq=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(LW(this.argumentMap.has(e))||LW(this.payloadMap.has(e)))throw new eq(e,t)}}]),e}();function nq(e){return ah()?FW(e):e}function iq(e){return{enumerable:!0,configurable:!0,get:function(){var t=GW(e),n=qW.ensureMappedState(t.stateMeta);return qW.createStateContext(n)}}}function rq(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 ah()?FW(e.getState()):e.getState()},setState:function(t){e.setState(t)},patchState:function(t){e.patchState(t)}})}function oq(){return function(e,t,n){!function(e,t){if(!function(e,t){var n,i=e,r=!1;if(BW(i))for(;null!==i;){if(RW(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 DW($W(e))&&Object.defineProperties(e,{__NGXS_COMPUTED_OPTION__:{enumerable:!0,configurable:!0,value:new WeakMap}}),$W(e)}(this),t=null==e?void 0:e.get(i);if(RW(null==t?void 0:t.isObservable))return null==t?void 0:t.value;if(DW(t)||t.sequenceId!==QW()){e.delete(i);for(var n=arguments.length,r=new Array(n),o=0;o0&&void 0!==arguments[0]?arguments[0]:aq;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:pq,useValue:{trackingCode:t,initCommands:n,uri:i,enableTracing:r,nonce:o}},bq]}}}]),e}();return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({imports:[[]]}),e}(),wq=function(){var e=function(){function e(){m(this,e),this.consent="not-set",this.consentChange=new Bf(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=$e({token:e,factory:e.\u0275fac}),e}(),kq=function(){var e=function(){function e(t,n,i){var r=this,o=i.trackingCode;m(this,e),this.window=n,this.subscriptions=new q,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)(Zi(wq),Zi(vq),Zi(pq))},e.\u0275prov=$e({token:e,factory:e.\u0275fac}),e}(),xq=new Ri("Key under which consent is stored",{providedIn:"root",factory:function(){return"ALLOW_TELEMETRY"}}),Sq=[wq,kq,function(){var e=function(){function e(t,n){var i=this;m(this,e),this.key=n,this.subscriptions=new q;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)(Zi(wq),Zi(xq))},e.\u0275prov=$e({token:e,factory:e.\u0275fac}),e}()];function Cq(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 Eq=function(){var e=function(){function e(){m(this,e)}return b(e,null,[{key:"forRoot",value:function(t){var n=_q.forRoot(t.gaToken,function(e){return[{command:"set",values:[Cq({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=Mt({type:e}),e.\u0275inj=Qe({providers:[].concat(Sq,[{provide:Cl,multi:!0,useFactory:function(){return function(){}},deps:Sq}]),imports:[[_q]]}),e}();function Oq(e,t,n,i){n&&"function"!=typeof n&&(i=n);var r="function"==typeof n?n:void 0,o=new Bf(e,t,i);return function(e){return De(function(){return o},r)(e)}}var Tq=function(e,t){return JSON.stringify(e)===JSON.stringify(t)},Pq=function(e){return e.map(function(e){return void 0!==e?JSON.parse(JSON.stringify(e)):e})},Aq={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},Mq=new ae;function Iq(){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 Aq.storageStrategy,u=[];e.cacheModifier&&e.cacheModifier.subscribe(function(e){return s.addMany(e(s.getAll(o,r)),o,r)}),Oe(Mq.asObservable(),e.cacheBusterObserver?e.cacheBusterObserver:If()).subscribe(function(e){s.removeAll(o,r),u.length=0}),e.cacheResolver=e.cacheResolver||Aq.cacheResolver||Tq,e.cacheHasher=e.cacheHasher||Aq.cacheHasher||Pq,i.value=function(){for(var t=this,n=s.getAll(o,this),i=arguments.length,r=new Array(i),c=0;c(e.maxAge||Aq.maxAge)?(s.remove?s.remove(n.indexOf(h),h,o,this):s.removeAtIndex(n.indexOf(h),o,this),h=null):(e.slidingExpiration||Aq.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 f=$d(h.response);return e.async?f.pipe(NH(0)):f}if(d)return d.response;var p=a.call.apply(a,[this].concat(r)).pipe(Ub(function(){var t=u.find(function(t){return e.cacheResolver(t.parameters,l)});u.splice(u.indexOf(t),1)}),mv(function(i){(!e.shouldCacheDecider||e.shouldCacheDecider(i))&&((!(e.maxCacheCount||Aq.maxCacheCount)||1===(e.maxCacheCount||Aq.maxCacheCount)||(e.maxCacheCount||Aq.maxCacheCount)&&(e.maxCacheCount||Aq.maxCacheCount)0&&void 0!==arguments[0]?arguments[0]:{};m(this,e),this.apiKeys=t.apiKeys,this.username=t.username,this.password=t.password,this.accessToken=t.accessToken,this.basePath=t.basePath,this.withCredentials=t.withCredentials,this.encoder=t.encoder,this.credentials=t.credentials?t.credentials:{}}return b(e,[{key:"selectHeaderContentType",value:function(e){var t=this;if(0!==e.length){var n=e.find(function(e){return t.isJsonMime(e)});return void 0===n?e[0]:n}}},{key:"selectHeaderAccept",value:function(e){var t=this;if(0!==e.length){var n=e.find(function(e){return t.isJsonMime(e)});return void 0===n?e[0]:n}}},{key:"isJsonMime",value:function(e){var t=new RegExp("^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$","i");return null!==e&&(t.test(e)||"application/json-patch+json"===e.toLowerCase())}},{key:"lookupCredential",value:function(e){var t=this.credentials[e];return"function"==typeof t?t():t}}]),e}(),jq=function(){var e=function(){function e(t,n,i){m(this,e),this.httpClient=t,this.basePath="/v1",this.defaultHeaders=new Xb,this.configuration=new Lq,i&&(this.configuration=i),"string"!=typeof this.configuration.basePath&&("string"!=typeof n&&(n=this.basePath),this.configuration.basePath=n),this.encoder=this.configuration.encoder||new Dq}return b(e,[{key:"addToHttpParams",value:function(e,t,n){return this.addToHttpParamsRecursive(e,t,n)}},{key:"addToHttpParamsRecursive",value:function(e,t,n){var i=this;if(null==t)return e;if("object"==typeof t)if(Array.isArray(t))t.forEach(function(t){return e=i.addToHttpParamsRecursive(e,t,n)});else if(t instanceof Date){if(null==n)throw Error("key may not be null if value is Date");e=e.append(n,t.toISOString().substr(0,10))}else Object.keys(t).forEach(function(r){return e=i.addToHttpParamsRecursive(e,t[r],null!=n?"".concat(n,".").concat(r):r)});else{if(null==n)throw Error("key may not be null if value is not object or array");e=e.append(n,t)}return e}},{key:"aggregateResults",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"body",i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3?arguments[3]:void 0,o=e.age,a=e.ageRange,s=e.bmi,u=e.bmiRange,c=e.cache,l=e.ontologyTerms,h=e.cellTypeTerms,d=e.providers,f=e.sex,p=e.spatial,v=e.technologies,g=e.token,m=new Jb({encoder:this.encoder});null!=o&&(m=this.addToHttpParams(m,o,"age")),null!=a&&(m=this.addToHttpParams(m,a,"age-range")),null!=s&&(m=this.addToHttpParams(m,s,"bmi")),null!=u&&(m=this.addToHttpParams(m,u,"bmi-range")),null!=c&&(m=this.addToHttpParams(m,c,"cache")),l&&l.forEach(function(e){m=t.addToHttpParams(m,e,"ontology-terms")}),h&&h.forEach(function(e){m=t.addToHttpParams(m,e,"cell-type-terms")}),d&&d.forEach(function(e){m=t.addToHttpParams(m,e,"providers")}),null!=f&&(m=this.addToHttpParams(m,f,"sex")),p&&p.forEach(function(e){m=t.addToHttpParams(m,e,"spatial")}),v&&v.forEach(function(e){m=t.addToHttpParams(m,e,"technologies")}),null!=g&&(m=this.addToHttpParams(m,g,"token"));var y=this.defaultHeaders,b=r&&r.httpHeaderAccept;void 0===b&&(b=this.configuration.selectHeaderAccept(["application/json"])),void 0!==b&&(y=y.set("Accept",b));var _=r&&r.context;void 0===_&&(_=new e_);var w="json";return b&&(w=b.startsWith("text")?"text":this.configuration.isJsonMime(b)?"json":"blob"),this.httpClient.get("".concat(this.configuration.basePath,"/aggregate-results"),{context:_,params:m,responseType:w,withCredentials:this.configuration.withCredentials,headers:y,observe:n,reportProgress:i})}},{key:"cellTypeTermOccurences",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"body",i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3?arguments[3]:void 0,o=e.age,a=e.ageRange,s=e.bmi,u=e.bmiRange,c=e.cache,l=e.ontologyTerms,h=e.cellTypeTerms,d=e.providers,f=e.sex,p=e.spatial,v=e.technologies,g=e.token,m=new Jb({encoder:this.encoder});null!=o&&(m=this.addToHttpParams(m,o,"age")),null!=a&&(m=this.addToHttpParams(m,a,"age-range")),null!=s&&(m=this.addToHttpParams(m,s,"bmi")),null!=u&&(m=this.addToHttpParams(m,u,"bmi-range")),null!=c&&(m=this.addToHttpParams(m,c,"cache")),l&&l.forEach(function(e){m=t.addToHttpParams(m,e,"ontology-terms")}),h&&h.forEach(function(e){m=t.addToHttpParams(m,e,"cell-type-terms")}),d&&d.forEach(function(e){m=t.addToHttpParams(m,e,"providers")}),null!=f&&(m=this.addToHttpParams(m,f,"sex")),p&&p.forEach(function(e){m=t.addToHttpParams(m,e,"spatial")}),v&&v.forEach(function(e){m=t.addToHttpParams(m,e,"technologies")}),null!=g&&(m=this.addToHttpParams(m,g,"token"));var y=this.defaultHeaders,b=r&&r.httpHeaderAccept;void 0===b&&(b=this.configuration.selectHeaderAccept(["application/json"])),void 0!==b&&(y=y.set("Accept",b));var _=r&&r.context;void 0===_&&(_=new e_);var w="json";return b&&(w=b.startsWith("text")?"text":this.configuration.isJsonMime(b)?"json":"blob"),this.httpClient.get("".concat(this.configuration.basePath,"/cell-type-term-occurences"),{context:_,params:m,responseType:w,withCredentials:this.configuration.withCredentials,headers:y,observe:n,reportProgress:i})}},{key:"cellTypeTreeModel",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"body",n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3?arguments[3]:void 0,r=e.cache,o=e.token,a=new Jb({encoder:this.encoder});null!=r&&(a=this.addToHttpParams(a,r,"cache")),null!=o&&(a=this.addToHttpParams(a,o,"token"));var s=this.defaultHeaders,u=i&&i.httpHeaderAccept;void 0===u&&(u=this.configuration.selectHeaderAccept(["application/json"])),void 0!==u&&(s=s.set("Accept",u));var c=i&&i.context;void 0===c&&(c=new e_);var l="json";return u&&(l=u.startsWith("text")?"text":this.configuration.isJsonMime(u)?"json":"blob"),this.httpClient.get("".concat(this.configuration.basePath,"/cell-type-tree-model"),{context:c,params:a,responseType:l,withCredentials:this.configuration.withCredentials,headers:s,observe:t,reportProgress:n})}},{key:"dbStatus",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"body",n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3?arguments[3]:void 0,r=e.token,o=new Jb({encoder:this.encoder});null!=r&&(o=this.addToHttpParams(o,r,"token"));var a=this.defaultHeaders,s=i&&i.httpHeaderAccept;void 0===s&&(s=this.configuration.selectHeaderAccept(["application/json"])),void 0!==s&&(a=a.set("Accept",s));var u=i&&i.context;void 0===u&&(u=new e_);var c="json";return s&&(c=s.startsWith("text")?"text":this.configuration.isJsonMime(s)?"json":"blob"),this.httpClient.get("".concat(this.configuration.basePath,"/db-status"),{context:u,params:o,responseType:c,withCredentials:this.configuration.withCredentials,headers:a,observe:t,reportProgress:n})}},{key:"getSpatialPlacement",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"body",n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3?arguments[3]:void 0,r=e.getSpatialPlacementRequest;if(null==r)throw new Error("Required parameter getSpatialPlacementRequest was null or undefined when calling getSpatialPlacement.");var o=this.defaultHeaders,a=i&&i.httpHeaderAccept;void 0===a&&(a=this.configuration.selectHeaderAccept(["application/json"])),void 0!==a&&(o=o.set("Accept",a));var s=i&&i.context;void 0===s&&(s=new e_);var u=this.configuration.selectHeaderContentType(["application/json"]);void 0!==u&&(o=o.set("Content-Type",u));var c="json";return a&&(c=a.startsWith("text")?"text":this.configuration.isJsonMime(a)?"json":"blob"),this.httpClient.post("".concat(this.configuration.basePath,"/get-spatial-placement"),r,{context:s,responseType:c,withCredentials:this.configuration.withCredentials,headers:o,observe:t,reportProgress:n})}},{key:"gtexRuiLocations",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"body",n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3?arguments[3]:void 0,r=e.cache,o=new Jb({encoder:this.encoder});null!=r&&(o=this.addToHttpParams(o,r,"cache"));var a=this.defaultHeaders,s=i&&i.httpHeaderAccept;void 0===s&&(s=this.configuration.selectHeaderAccept(["application/json"])),void 0!==s&&(a=a.set("Accept",s));var u=i&&i.context;void 0===u&&(u=new e_);var c="json";return s&&(c=s.startsWith("text")?"text":this.configuration.isJsonMime(s)?"json":"blob"),this.httpClient.get("".concat(this.configuration.basePath,"/gtex/rui_locations.jsonld"),{context:u,params:o,responseType:c,withCredentials:this.configuration.withCredentials,headers:a,observe:t,reportProgress:n})}},{key:"hubmapRuiLocations",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"body",n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3?arguments[3]:void 0,r=e.cache,o=e.token,a=new Jb({encoder:this.encoder});null!=r&&(a=this.addToHttpParams(a,r,"cache")),null!=o&&(a=this.addToHttpParams(a,o,"token"));var s=this.defaultHeaders,u=i&&i.httpHeaderAccept;void 0===u&&(u=this.configuration.selectHeaderAccept(["application/json"])),void 0!==u&&(s=s.set("Accept",u));var c=i&&i.context;void 0===c&&(c=new e_);var l="json";return u&&(l=u.startsWith("text")?"text":this.configuration.isJsonMime(u)?"json":"blob"),this.httpClient.get("".concat(this.configuration.basePath,"/hubmap/rui_locations.jsonld"),{context:c,params:a,responseType:l,withCredentials:this.configuration.withCredentials,headers:s,observe:t,reportProgress:n})}},{key:"ontologyTermOccurences",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"body",i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3?arguments[3]:void 0,o=e.age,a=e.ageRange,s=e.bmi,u=e.bmiRange,c=e.cache,l=e.ontologyTerms,h=e.cellTypeTerms,d=e.providers,f=e.sex,p=e.spatial,v=e.technologies,g=e.token,m=new Jb({encoder:this.encoder});null!=o&&(m=this.addToHttpParams(m,o,"age")),null!=a&&(m=this.addToHttpParams(m,a,"age-range")),null!=s&&(m=this.addToHttpParams(m,s,"bmi")),null!=u&&(m=this.addToHttpParams(m,u,"bmi-range")),null!=c&&(m=this.addToHttpParams(m,c,"cache")),l&&l.forEach(function(e){m=t.addToHttpParams(m,e,"ontology-terms")}),h&&h.forEach(function(e){m=t.addToHttpParams(m,e,"cell-type-terms")}),d&&d.forEach(function(e){m=t.addToHttpParams(m,e,"providers")}),null!=f&&(m=this.addToHttpParams(m,f,"sex")),p&&p.forEach(function(e){m=t.addToHttpParams(m,e,"spatial")}),v&&v.forEach(function(e){m=t.addToHttpParams(m,e,"technologies")}),null!=g&&(m=this.addToHttpParams(m,g,"token"));var y=this.defaultHeaders,b=r&&r.httpHeaderAccept;void 0===b&&(b=this.configuration.selectHeaderAccept(["application/json"])),void 0!==b&&(y=y.set("Accept",b));var _=r&&r.context;void 0===_&&(_=new e_);var w="json";return b&&(w=b.startsWith("text")?"text":this.configuration.isJsonMime(b)?"json":"blob"),this.httpClient.get("".concat(this.configuration.basePath,"/ontology-term-occurences"),{context:_,params:m,responseType:w,withCredentials:this.configuration.withCredentials,headers:y,observe:n,reportProgress:i})}},{key:"ontologyTreeModel",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"body",n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3?arguments[3]:void 0,r=e.cache,o=e.token,a=new Jb({encoder:this.encoder});null!=r&&(a=this.addToHttpParams(a,r,"cache")),null!=o&&(a=this.addToHttpParams(a,o,"token"));var s=this.defaultHeaders,u=i&&i.httpHeaderAccept;void 0===u&&(u=this.configuration.selectHeaderAccept(["application/json"])),void 0!==u&&(s=s.set("Accept",u));var c=i&&i.context;void 0===c&&(c=new e_);var l="json";return u&&(l=u.startsWith("text")?"text":this.configuration.isJsonMime(u)?"json":"blob"),this.httpClient.get("".concat(this.configuration.basePath,"/ontology-tree-model"),{context:c,params:a,responseType:l,withCredentials:this.configuration.withCredentials,headers:s,observe:t,reportProgress:n})}},{key:"providerNames",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"body",n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3?arguments[3]:void 0,r=e.cache,o=e.token,a=new Jb({encoder:this.encoder});null!=r&&(a=this.addToHttpParams(a,r,"cache")),null!=o&&(a=this.addToHttpParams(a,o,"token"));var s=this.defaultHeaders,u=i&&i.httpHeaderAccept;void 0===u&&(u=this.configuration.selectHeaderAccept(["application/json"])),void 0!==u&&(s=s.set("Accept",u));var c=i&&i.context;void 0===c&&(c=new e_);var l="json";return u&&(l=u.startsWith("text")?"text":this.configuration.isJsonMime(u)?"json":"blob"),this.httpClient.get("".concat(this.configuration.basePath,"/provider-names"),{context:c,params:a,responseType:l,withCredentials:this.configuration.withCredentials,headers:s,observe:t,reportProgress:n})}},{key:"referenceOrganScene",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"body",i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3?arguments[3]:void 0,o=e.organIri;if(null==o)throw new Error("Required parameter organIri was null or undefined when calling referenceOrganScene.");var a=e.age,s=e.ageRange,u=e.bmi,c=e.bmiRange,l=e.cache,h=e.ontologyTerms,d=e.cellTypeTerms,f=e.providers,p=e.sex,v=e.spatial,g=e.technologies,m=e.token,y=new Jb({encoder:this.encoder});null!=a&&(y=this.addToHttpParams(y,a,"age")),null!=s&&(y=this.addToHttpParams(y,s,"age-range")),null!=u&&(y=this.addToHttpParams(y,u,"bmi")),null!=c&&(y=this.addToHttpParams(y,c,"bmi-range")),null!=l&&(y=this.addToHttpParams(y,l,"cache")),h&&h.forEach(function(e){y=t.addToHttpParams(y,e,"ontology-terms")}),d&&d.forEach(function(e){y=t.addToHttpParams(y,e,"cell-type-terms")}),null!=o&&(y=this.addToHttpParams(y,o,"organ-iri")),f&&f.forEach(function(e){y=t.addToHttpParams(y,e,"providers")}),null!=p&&(y=this.addToHttpParams(y,p,"sex")),v&&v.forEach(function(e){y=t.addToHttpParams(y,e,"spatial")}),g&&g.forEach(function(e){y=t.addToHttpParams(y,e,"technologies")}),null!=m&&(y=this.addToHttpParams(y,m,"token"));var b=this.defaultHeaders,_=r&&r.httpHeaderAccept;void 0===_&&(_=this.configuration.selectHeaderAccept(["application/json"])),void 0!==_&&(b=b.set("Accept",_));var w=r&&r.context;void 0===w&&(w=new e_);var k="json";return _&&(k=_.startsWith("text")?"text":this.configuration.isJsonMime(_)?"json":"blob"),this.httpClient.get("".concat(this.configuration.basePath,"/reference-organ-scene"),{context:w,params:y,responseType:k,withCredentials:this.configuration.withCredentials,headers:b,observe:n,reportProgress:i})}},{key:"referenceOrgans",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"body",n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3?arguments[3]:void 0,r=e.cache,o=e.token,a=new Jb({encoder:this.encoder});null!=r&&(a=this.addToHttpParams(a,r,"cache")),null!=o&&(a=this.addToHttpParams(a,o,"token"));var s=this.defaultHeaders,u=i&&i.httpHeaderAccept;void 0===u&&(u=this.configuration.selectHeaderAccept(["application/json"])),void 0!==u&&(s=s.set("Accept",u));var c=i&&i.context;void 0===c&&(c=new e_);var l="json";return u&&(l=u.startsWith("text")?"text":this.configuration.isJsonMime(u)?"json":"blob"),this.httpClient.get("".concat(this.configuration.basePath,"/reference-organs"),{context:c,params:a,responseType:l,withCredentials:this.configuration.withCredentials,headers:s,observe:t,reportProgress:n})}},{key:"scene",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"body",i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3?arguments[3]:void 0,o=e.age,a=e.ageRange,s=e.bmi,u=e.bmiRange,c=e.cache,l=e.ontologyTerms,h=e.cellTypeTerms,d=e.providers,f=e.sex,p=e.spatial,v=e.technologies,g=e.token,m=new Jb({encoder:this.encoder});null!=o&&(m=this.addToHttpParams(m,o,"age")),null!=a&&(m=this.addToHttpParams(m,a,"age-range")),null!=s&&(m=this.addToHttpParams(m,s,"bmi")),null!=u&&(m=this.addToHttpParams(m,u,"bmi-range")),null!=c&&(m=this.addToHttpParams(m,c,"cache")),l&&l.forEach(function(e){m=t.addToHttpParams(m,e,"ontology-terms")}),h&&h.forEach(function(e){m=t.addToHttpParams(m,e,"cell-type-terms")}),d&&d.forEach(function(e){m=t.addToHttpParams(m,e,"providers")}),null!=f&&(m=this.addToHttpParams(m,f,"sex")),p&&p.forEach(function(e){m=t.addToHttpParams(m,e,"spatial")}),v&&v.forEach(function(e){m=t.addToHttpParams(m,e,"technologies")}),null!=g&&(m=this.addToHttpParams(m,g,"token"));var y=this.defaultHeaders,b=r&&r.httpHeaderAccept;void 0===b&&(b=this.configuration.selectHeaderAccept(["application/json"])),void 0!==b&&(y=y.set("Accept",b));var _=r&&r.context;void 0===_&&(_=new e_);var w="json";return b&&(w=b.startsWith("text")?"text":this.configuration.isJsonMime(b)?"json":"blob"),this.httpClient.get("".concat(this.configuration.basePath,"/scene"),{context:_,params:m,responseType:w,withCredentials:this.configuration.withCredentials,headers:y,observe:n,reportProgress:i})}},{key:"sparql",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"body",n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3?arguments[3]:void 0,r=e.query;if(null==r)throw new Error("Required parameter query was null or undefined when calling sparql.");var o=e.token,a=e.format,s=new Jb({encoder:this.encoder});null!=r&&(s=this.addToHttpParams(s,r,"query")),null!=o&&(s=this.addToHttpParams(s,o,"token")),null!=a&&(s=this.addToHttpParams(s,a,"format"));var u=this.defaultHeaders,c=i&&i.httpHeaderAccept;void 0===c&&(c=this.configuration.selectHeaderAccept(["application/json"])),void 0!==c&&(u=u.set("Accept",c));var l=i&&i.context;void 0===l&&(l=new e_);var h="json";return c&&(h=c.startsWith("text")?"text":this.configuration.isJsonMime(c)?"json":"blob"),this.httpClient.get("".concat(this.configuration.basePath,"/sparql"),{context:l,params:s,responseType:h,withCredentials:this.configuration.withCredentials,headers:u,observe:t,reportProgress:n})}},{key:"sparqlPost",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"body",n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3?arguments[3]:void 0,r=e.sparqlQueryRequest;if(null==r)throw new Error("Required parameter sparqlQueryRequest was null or undefined when calling sparqlPost.");var o=e.token,a=e.format,s=new Jb({encoder:this.encoder});null!=o&&(s=this.addToHttpParams(s,o,"token")),null!=a&&(s=this.addToHttpParams(s,a,"format"));var u=this.defaultHeaders,c=i&&i.httpHeaderAccept;void 0===c&&(c=this.configuration.selectHeaderAccept(["application/json"])),void 0!==c&&(u=u.set("Accept",c));var l=i&&i.context;void 0===l&&(l=new e_);var h=this.configuration.selectHeaderContentType(["application/json","application/x-www-form-urlencoded"]);void 0!==h&&(u=u.set("Content-Type",h));var d="json";return c&&(d=c.startsWith("text")?"text":this.configuration.isJsonMime(c)?"json":"blob"),this.httpClient.post("".concat(this.configuration.basePath,"/sparql"),r,{context:l,params:s,responseType:d,withCredentials:this.configuration.withCredentials,headers:u,observe:t,reportProgress:n})}},{key:"technologyNames",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"body",n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3?arguments[3]:void 0,r=e.cache,o=e.token,a=new Jb({encoder:this.encoder});null!=r&&(a=this.addToHttpParams(a,r,"cache")),null!=o&&(a=this.addToHttpParams(a,o,"token"));var s=this.defaultHeaders,u=i&&i.httpHeaderAccept;void 0===u&&(u=this.configuration.selectHeaderAccept(["application/json"])),void 0!==u&&(s=s.set("Accept",u));var c=i&&i.context;void 0===c&&(c=new e_);var l="json";return u&&(l=u.startsWith("text")?"text":this.configuration.isJsonMime(u)?"json":"blob"),this.httpClient.get("".concat(this.configuration.basePath,"/technology-names"),{context:c,params:a,responseType:l,withCredentials:this.configuration.withCredentials,headers:s,observe:t,reportProgress:n})}},{key:"tissueBlocks",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"body",i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3?arguments[3]:void 0,o=e.age,a=e.ageRange,s=e.bmi,u=e.bmiRange,c=e.cache,l=e.ontologyTerms,h=e.cellTypeTerms,d=e.providers,f=e.sex,p=e.spatial,v=e.technologies,g=e.token,m=new Jb({encoder:this.encoder});null!=o&&(m=this.addToHttpParams(m,o,"age")),null!=a&&(m=this.addToHttpParams(m,a,"age-range")),null!=s&&(m=this.addToHttpParams(m,s,"bmi")),null!=u&&(m=this.addToHttpParams(m,u,"bmi-range")),null!=c&&(m=this.addToHttpParams(m,c,"cache")),l&&l.forEach(function(e){m=t.addToHttpParams(m,e,"ontology-terms")}),h&&h.forEach(function(e){m=t.addToHttpParams(m,e,"cell-type-terms")}),d&&d.forEach(function(e){m=t.addToHttpParams(m,e,"providers")}),null!=f&&(m=this.addToHttpParams(m,f,"sex")),p&&p.forEach(function(e){m=t.addToHttpParams(m,e,"spatial")}),v&&v.forEach(function(e){m=t.addToHttpParams(m,e,"technologies")}),null!=g&&(m=this.addToHttpParams(m,g,"token"));var y=this.defaultHeaders,b=r&&r.httpHeaderAccept;void 0===b&&(b=this.configuration.selectHeaderAccept(["application/json"])),void 0!==b&&(y=y.set("Accept",b));var _=r&&r.context;void 0===_&&(_=new e_);var w="json";return b&&(w=b.startsWith("text")?"text":this.configuration.isJsonMime(b)?"json":"blob"),this.httpClient.get("".concat(this.configuration.basePath,"/tissue-blocks"),{context:_,params:m,responseType:w,withCredentials:this.configuration.withCredentials,headers:y,observe:n,reportProgress:i})}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Zi(h_),Zi(Nq,8),Zi(Lq,8))},e.\u0275prov=$e({factory:function(){return new e(Zi(h_),Zi(Nq,8),Zi(Lq,8))},token:e,providedIn:"root"}),e}(),Fq=function(){var e=function(){function e(t,n){if(m(this,e),t)throw new Error("CcfApiModule is already loaded. Import in your base AppModule only.");if(!n)throw new Error("You need to import the HttpClientModule in your AppModule! \nSee also https://github.com/angular/angular/issues/20575")}return b(e,null,[{key:"forRoot",value:function(t){return{ngModule:e,providers:[{provide:Lq,useFactory:t}]}}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Zi(e,12),Zi(h_,8))},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({providers:[],imports:[[]]}),e}();function Bq(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 Vq(){return Rq||(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)},Bq(t)}),Rq=function(n,i){return t.then(function(t){return i(t.transaction(e,n).objectStore(e))})}),Rq;var e,t}function zq(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Vq();return t("readonly",function(t){return Bq(t.get(e))})}var Uq,Hq=r(71440),Gq="Unknown Euler angle order",Wq=.99999,qq=function(e){a(i,e);var n=s(i);function i(){var e,t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:i.DefaultOrder;return m(this,i),t=n.call(this,-0,-0,-0,-0),arguments.length>0&&Array.isArray(arguments[0])?(e=t).fromVector3.apply(e,arguments):t.set(r,o,a,s),t}return b(i,[{key:"ELEMENTS",get:function(){return 4}},{key:"fromQuaternion",value:function(e){var n=t(e,4),r=n[0],o=n[1],a=n[2],s=n[3],u=o*o,c=-2*(u+a*a)+1,l=2*(r*o+s*a),h=-2*(r*a-s*o);return h=(h=h>1?1:h)<-1?-1:h,new i(Math.atan2(2*(o*a+s*r),-2*(r*r+u)+1),Math.asin(h),Math.atan2(l,c),i.RollPitchYaw)}},{key:"copy",value:function(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=Number.isFinite(e[3])||this.order,this.check()}},{key:"set",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3?arguments[3]:void 0;return this[0]=e,this[1]=t,this[2]=n,this[3]=Number.isFinite(i)?i:this[3],this.check()}},{key:"validate",value:function(){return function(e){return e>=0&&e<6}(this[3])&&Number.isFinite(this[0])&&Number.isFinite(this[1])&&Number.isFinite(this[2])}},{key:"toArray",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[t]=this[0],e[t+1]=this[1],e[t+2]=this[2],e}},{key:"toArray4",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[t]=this[0],e[t+1]=this[1],e[t+2]=this[2],e[t+3]=this[3],e}},{key:"toVector3",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[-0,-0,-0];return e[0]=this[0],e[1]=this[1],e[2]=this[2],e}},{key:"x",get:function(){return this[0]},set:function(e){this[0]=gS(e)}},{key:"y",get:function(){return this[1]},set:function(e){this[1]=gS(e)}},{key:"z",get:function(){return this[2]},set:function(e){this[2]=gS(e)}},{key:"alpha",get:function(){return this[0]},set:function(e){this[0]=gS(e)}},{key:"beta",get:function(){return this[1]},set:function(e){this[1]=gS(e)}},{key:"gamma",get:function(){return this[2]},set:function(e){this[2]=gS(e)}},{key:"phi",get:function(){return this[0]},set:function(e){this[0]=gS(e)}},{key:"theta",get:function(){return this[1]},set:function(e){this[1]=gS(e)}},{key:"psi",get:function(){return this[2]},set:function(e){this[2]=gS(e)}},{key:"roll",get:function(){return this[0]},set:function(e){this[0]=gS(e)}},{key:"pitch",get:function(){return this[1]},set:function(e){this[1]=gS(e)}},{key:"yaw",get:function(){return this[2]},set:function(e){this[2]=gS(e)}},{key:"order",get:function(){return this[3]},set:function(e){this[3]=function(e){if(e<0&&e>=6)throw new Error(Gq);return e}(e)}},{key:"fromVector3",value:function(e,t){return this.set(e[0],e[1],e[2],Number.isFinite(t)?t:this[3])}},{key:"fromArray",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this[0]=e[0+t],this[1]=e[1+t],this[2]=e[2+t],void 0!==e[3]&&(this[3]=e[3]),this.check()}},{key:"fromRollPitchYaw",value:function(e,t,n){return this.set(e,t,n,i.ZYX)}},{key:"fromRotationMatrix",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i.DefaultOrder;return this._fromRotationMatrix(e,t),this.check()}},{key:"getRotationMatrix",value:function(e){return this._getRotationMatrix(e)}},{key:"getQuaternion",value:function(){var e=new JN;switch(this[4]){case i.XYZ:return e.rotateX(this[0]).rotateY(this[1]).rotateZ(this[2]);case i.YXZ:return e.rotateY(this[0]).rotateX(this[1]).rotateZ(this[2]);case i.ZXY:return e.rotateZ(this[0]).rotateX(this[1]).rotateY(this[2]);case i.ZYX:return e.rotateZ(this[0]).rotateY(this[1]).rotateX(this[2]);case i.YZX:return e.rotateY(this[0]).rotateZ(this[1]).rotateX(this[2]);case i.XZY:return e.rotateX(this[0]).rotateZ(this[1]).rotateY(this[2]);default:throw new Error(Gq)}}},{key:"_fromRotationMatrix",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i.DefaultOrder,n=e.elements,r=n[0],o=n[4],a=n[8],s=n[1],u=n[5],c=n[9],l=n[2],h=n[6],d=n[10];switch(t=t||this[3]){case i.XYZ:this[1]=Math.asin(hS(a,-1,1)),Math.abs(a)1&&void 0!==arguments[1]?arguments[1]:0,n=(tX[e[t+0]]+tX[e[t+1]]+tX[e[t+2]]+tX[e[t+3]]+"-"+tX[e[t+4]]+tX[e[t+5]]+"-"+tX[e[t+6]]+tX[e[t+7]]+"-"+tX[e[t+8]]+tX[e[t+9]]+"-"+tX[e[t+10]]+tX[e[t+11]]+tX[e[t+12]]+tX[e[t+13]]+tX[e[t+14]]+tX[e[t+15]]).toLowerCase();if(!eX(n))throw TypeError("Stringified UUID is invalid");return n}(i)},rX=r(31609),oX=Object.freeze({OUTSIDE:-1,INTERSECTING:0,INSIDE:1}),aX=(Math,Math,{});function sX(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.precision,i=void 0===n?aX.precision||4:n;return e=function(e){return Math.round(e/aX.EPSILON)*aX.EPSILON}(e),"".concat(parseFloat(e.toPrecision(i)))}function uX(e){return Array.isArray(e)||ArrayBuffer.isView(e)&&!(e instanceof DataView)}function cX(e,t,n){var i=aX.EPSILON;n&&(aX.EPSILON=n);try{if(e===t)return!0;if(uX(e)&&uX(t)){if(e.length!==t.length)return!1;for(var 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?", ":"")+sX(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(aX.debug&&!function(e,t){if(e.length!==t)return!1;for(var n=0;n0&&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):(aX.debug&&(dX(i),dX(r),dX(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 aX.debug&&(dX(e.x),dX(e.y),dX(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]=dX(e)}},{key:"angle",value:function(e){return RS(this,e)}},{key:"cross",value:function(e){return ES(this,this,e),this.check()}},{key:"rotateX",value:function(e){var t=e.radians,n=e.origin;return AS(this,this,void 0===n?gX:n,t),this.check()}},{key:"rotateY",value:function(e){var t=e.radians,n=e.origin;return MS(this,this,void 0===n?gX:n,t),this.check()}},{key:"rotateZ",value:function(e){var t=e.radians,n=e.origin;return IS(this,this,void 0===n?gX:n,t),this.check()}},{key:"transform",value:function(e){return this.transformAsPoint(e)}},{key:"transformAsPoint",value:function(e){return OS(this,this,e),this.check()}},{key:"transformAsVector",value:function(e){return function(e,t,n){var i=t[0],r=t[1],o=t[2],a=n[3]*i+n[7]*r+n[11]*o||1;e[0]=(n[0]*i+n[4]*r+n[8]*o)/a,e[1]=(n[1]*i+n[5]*r+n[9]*o)/a,e[2]=(n[2]*i+n[6]*r+n[10]*o)/a}(this,this,e),this.check()}},{key:"transformByMatrix3",value:function(e){return TS(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 PS(this,this,e),this.check()}}],[{key:"ZERO",get:function(){return mX.ZERO=mX.ZERO||Object.freeze(new n(0,0,0,0))}}]),n}(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 lX(!1),0}},{key:"copy",value:function(e){return lX(!1),this}},{key:"x",get:function(){return this[0]},set:function(e){this[0]=dX(e)}},{key:"y",get:function(){return this[1]},set:function(e){this[1]=dX(e)}},{key:"len",value:function(){return Math.sqrt(this.lengthSquared())}},{key:"magnitude",value:function(){return this.len()}},{key:"lengthSquared",value:function(){for(var e=0,t=0;t=0&&e=0&&e0&&void 0!==arguments[0]?arguments[0]:[0,0,0],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;m(this,e),this.radius=-0,this.center=new yX,this.fromCenterRadius(t,n)}return b(e,[{key:"fromCenterRadius",value:function(e,t){return this.center.from(e),this.radius=t,this}},{key:"fromCornerPoints",value:function(e,t){return t=bX.from(t),this.center=(new yX).from(e).add(t).scale(.5),this.radius=this.center.distance(t),this}},{key:"equals",value:function(e){return this===e||Boolean(e)&&this.center.equals(e.center)&&this.radius===e.radius}},{key:"clone",value:function(){return new e(this.center,this.radius)}},{key:"union",value:function(e){var t=this.center,n=this.radius,i=e.radius,r=bX.copy(e.center).subtract(t),o=r.magnitude();if(n>=o+i)return this.clone();if(i>=o+n)return e.clone();var a=.5*(n+o+i);return _X.copy(r).scale((-n+a)/o).add(t),this.center.copy(_X),this.radius=a,this}},{key:"expand",value:function(e){var t=(e=bX.from(e)).subtract(this.center).magnitude();return t>this.radius&&(this.radius=t),this}},{key:"transform",value:function(e){this.center.transform(e);var t=function(e,t){var n=t[4],i=t[5],r=t[6],o=t[8],a=t[9],s=t[10];return e[0]=Math.hypot(t[0],t[1],t[2]),e[1]=Math.hypot(n,i,r),e[2]=Math.hypot(o,a,s),e}(bX,e);return this.radius=Math.max(t[0],Math.max(t[1],t[2]))*this.radius,this}},{key:"distanceSquaredTo",value:function(e){var t=this.distanceTo(e);return t*t}},{key:"distanceTo",value:function(e){var t=(e=bX.from(e)).subtract(this.center);return Math.max(0,t.len()-this.radius)}},{key:"intersectPlane",value:function(e){var t=this.radius,n=e.normal.dot(this.center)+e.distance;return n<-t?oX.OUTSIDE:n1&&void 0!==arguments[1]?arguments[1]:new Array(this.RANK).fill(-0),n=e*this.RANK,i=0;i0&&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 GN(this,e),this.check()}},{key:"identity",value:function(){return DN(this),this.check()}},{key:"fromAxisRotation",value:function(e,t){return NN(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]=dX(e)}},{key:"y",get:function(){return this[1]},set:function(e){this[1]=dX(e)}},{key:"z",get:function(){return this[2]},set:function(e){this[2]=dX(e)}},{key:"w",get:function(){return this[3]},set:function(e){this[3]=dX(e)}},{key:"len",value:function(){return KN(this)}},{key:"lengthSquared",value:function(){return $N(this)}},{key:"dot",value:function(e,t){if(void 0!==t)throw new Error("Quaternion.dot only takes one argument");return XN(this,e)}},{key:"rotationTo",value:function(e,t){return QN(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 WN(this,this,e),this.check()}},{key:"calculateW",value:function(){return VN(this,this),this.check()}},{key:"conjugate",value:function(){return HN(this,this),this.check()}},{key:"invert",value:function(){return UN(this,this),this.check()}},{key:"lerp",value:function(e,t,n){return YN(this,e,t,n),this.check()}},{key:"multiplyRight",value:function(e,t){return lX(!t),LN(this,this,e),this.check()}},{key:"multiplyLeft",value:function(e,t){return lX(!t),LN(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 jN(this,this,e),this.check()}},{key:"rotateY",value:function(e){return FN(this,this,e),this.check()}},{key:"rotateZ",value:function(e){return BN(this,this,e),this.check()}},{key:"scale",value:function(e){return qN(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?TX:a,n=o.target,i=o.ratio;break;case 2:n=(r=t(arguments,2))[0],i=r[1],e=this}return zN(this,e,n,i),this.check()}},{key:"transformVector4",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;return DO(t,e,this),fX(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}(hX),AX=new yX,MX=new yX,IX=new yX,RX=new yX,DX=new yX,NX=new yX,LX=new yX,jX=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[0,0,0],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0,0,0,0,0,0,0];m(this,e),this.center=(new yX).from(t),this.halfAxes=new OX(n)}return b(e,[{key:"halfSize",get:function(){var e=this.halfAxes.getColumn(0),t=this.halfAxes.getColumn(1),n=this.halfAxes.getColumn(2);return[new yX(e).len(),new yX(t).len(),new yX(n).len()]}},{key:"quaternion",get:function(){var e=this.halfAxes.getColumn(0),t=this.halfAxes.getColumn(1),n=this.halfAxes.getColumn(2),i=new yX(e).normalize(),r=new yX(t).normalize(),o=new yX(n).normalize();return(new PX).fromMatrix3(new OX([].concat(v(i),v(r),v(o))))}},{key:"fromCenterHalfSizeQuaternion",value:function(e,t,n){var i=new PX(n),r=(new OX).fromQuaternion(i);return r[0]=r[0]*t[0],r[1]=r[1]*t[0],r[2]=r[2]*t[0],r[3]=r[3]*t[1],r[4]=r[4]*t[1],r[5]=r[5]*t[1],r[6]=r[6]*t[2],r[7]=r[7]*t[2],r[8]=r[8]*t[2],this.center=(new yX).from(e),this.halfAxes=r,this}},{key:"clone",value:function(){return new e(this.center,this.halfAxes)}},{key:"equals",value:function(e){return this===e||Boolean(e)&&this.center.equals(e.center)&&this.halfAxes.equals(e.halfAxes)}},{key:"getBoundingSphere",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new wX,t=this.halfAxes,n=t.getColumn(0,IX),i=t.getColumn(1,RX),r=t.getColumn(2,DX),o=AX.copy(n).add(i).add(r);return e.center.copy(this.center),e.radius=o.magnitude(),e}},{key:"intersectPlane",value:function(e){var t=this.center,n=e.normal,i=this.halfAxes,r=n.x,o=n.y,a=n.z,s=Math.abs(r*i[0]+o*i[1]+a*i[2])+Math.abs(r*i[3]+o*i[4]+a*i[5])+Math.abs(r*i[6]+o*i[7]+a*i[8]),u=n.dot(t)+e.distance;return u<=-s?oX.OUTSIDE:u>=s?oX.INSIDE:oX.INTERSECTING}},{key:"distanceTo",value:function(e){return Math.sqrt(this.distanceSquaredTo(e))}},{key:"distanceSquaredTo",value:function(e){var t=MX.from(e).subtract(this.center),n=this.halfAxes,i=n.getColumn(0,IX),r=n.getColumn(1,RX),o=n.getColumn(2,DX),a=i.magnitude(),s=r.magnitude(),u=o.magnitude();i.normalize(),r.normalize(),o.normalize();var c,l=0;return(c=Math.abs(t.dot(i))-a)>0&&(l+=c*c),(c=Math.abs(t.dot(r))-s)>0&&(l+=c*c),(c=Math.abs(t.dot(o))-u)>0&&(l+=c*c),l}},{key:"computePlaneDistances",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[-0,-0],i=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY,o=this.center,a=this.halfAxes,s=a.getColumn(0,IX),u=a.getColumn(1,RX),c=a.getColumn(2,DX),l=NX.copy(s).add(u).add(c).add(o),h=LX.copy(l).subtract(e),d=t.dot(h);return i=Math.min(d,i),r=Math.max(d,r),l.copy(o).add(s).add(u).subtract(c),h.copy(l).subtract(e),d=t.dot(h),i=Math.min(d,i),r=Math.max(d,r),l.copy(o).add(s).subtract(u).add(c),h.copy(l).subtract(e),d=t.dot(h),i=Math.min(d,i),r=Math.max(d,r),l.copy(o).add(s).subtract(u).subtract(c),h.copy(l).subtract(e),d=t.dot(h),i=Math.min(d,i),r=Math.max(d,r),o.copy(l).subtract(s).add(u).add(c),h.copy(l).subtract(e),d=t.dot(h),i=Math.min(d,i),r=Math.max(d,r),o.copy(l).subtract(s).add(u).subtract(c),h.copy(l).subtract(e),d=t.dot(h),i=Math.min(d,i),r=Math.max(d,r),o.copy(l).subtract(s).subtract(u).add(c),h.copy(l).subtract(e),d=t.dot(h),i=Math.min(d,i),r=Math.max(d,r),o.copy(l).subtract(s).subtract(u).subtract(c),h.copy(l).subtract(e),d=t.dot(h),i=Math.min(d,i),r=Math.max(d,r),n[0]=i,n[1]=r,n}},{key:"transform",value:function(e){this.center.transformAsPoint(e);var t=this.halfAxes.getColumn(0,IX);t.transformAsPoint(e);var n=this.halfAxes.getColumn(1,RX);n.transformAsPoint(e);var i=this.halfAxes.getColumn(2,DX);return i.transformAsPoint(e),this.halfAxes=new OX([].concat(v(t),v(n),v(i))),this}},{key:"getTransform",value:function(){throw new Error("not implemented")}}]),e}(),FX=new yX,BX=new yX,VX=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[0,0,1],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;m(this,e),this.normal=new yX,this.distance=-0,this.fromNormalDistance(t,n)}return b(e,[{key:"fromNormalDistance",value:function(e,t){return lX(Number.isFinite(t)),this.normal.from(e).normalize(),this.distance=t,this}},{key:"fromPointNormal",value:function(e,t){e=FX.from(e),this.normal.from(t).normalize();var n=-this.normal.dot(e);return this.distance=n,this}},{key:"fromCoefficients",value:function(e,t,n,i){return this.normal.set(e,t,n),lX(cX(this.normal.len(),1)),this.distance=i,this}},{key:"clone",value:function(t){return new e(this.normal,this.distance)}},{key:"equals",value:function(e){return cX(this.distance,e.distance)&&cX(this.normal,e.normal)}},{key:"getPointDistance",value:function(e){return this.normal.dot(e)+this.distance}},{key:"transform",value:function(e){var t=BX.copy(this.normal).transformAsVector(e).normalize(),n=this.normal.scale(-this.distance).transform(e);return this.fromPointNormal(n,t)}},{key:"projectPointOntoPlane",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];e=FX.from(e);var n=this.getPointDistance(e),i=BX.copy(this.normal).scale(n);return e.subtract(i).to(t)}}]),e}();function zX(e,n,i){var r,o,a,s,u,c,l,h,d;return regeneratorRuntime.wrap(function(f){for(;;)switch(f.prev=f.next){case 0:r=0,o=Object.entries(i);case 1:if(!(r0){r.reverse();var o,a="",s=_(r);try{for(s.s();!(o=s.n()).done;){var u=o.value;a&&iY(i,nY(n,this.graph.getEdgeAttribute(u,a,"id"))),a=u}}catch(c){s.e(c)}finally{s.f()}return i}}}},{key:"getSpatialPlacement",value:function(e,t){var n,i=this.graph.hasNode(e["@id"])?e["@id"]:void 0,r=(0,$q.get)(e,"placement[0]",(0,$q.get)(e,"placement",void 0));if(r&&this.graph.hasNode(r.target)?(n=this.getTransformationMatrix(r.target,t))&&(n=iY(n,r)):i&&(n=this.getTransformationMatrix(i,t)),n){var o=(new qq).fromRotationMatrix(n,qq.XYZ),a=n.getTranslation().map(function(e){return 1e3*e}),s=o.toVector3().map(lS),u=n.getScale().map(function(e){return e<1&&e>.999999?1:e});return{"@context":"https://hubmapconsortium.github.io/hubmap-ontology/ccf-context.jsonld","@id":"http://purl.org/ccf/1.5/".concat(iX(),"_placement"),"@type":"SpatialPlacement",source:e["@id"],target:t,placement_date:(new Date).toISOString().split("T")[0],x_scaling:u[0],y_scaling:u[1],z_scaling:u[2],scaling_units:"ratio",x_rotation:s[0],y_rotation:s[1],z_rotation:s[2],rotation_order:"XYZ",rotation_units:"degree",x_translation:a[0],y_translation:a[1],z_translation:a[2],translation_units:"millimeter"}}}}]),e}(),oY=function(){function e(t){m(this,e),this.db=t}return b(e,[{key:"getSpatialEntity",value:function(e){return tY(this.db.store,e)}},{key:"getExtractionSets",value:function(e){return function(e,t){return(0,$q.sortBy)(e.getSubjects(XX.spatialEntity.extraction_set_for,t,null).map(function(t){return eY(e,t.id)}),["rui_rank"])}(this.db.store,e)}},{key:"getExtractionSet",value:function(e){return eY(this.db.store,e)}},{key:"getAnatomicalStructures",value:function(e){return function(e,t){return(0,$q.sortBy)(e.getSubjects(XX.spatialEntity.reference_organ,t,null).map(function(t){return tY(e,t.id)}).filter(function(e){return e["@id"]!==t}),["rui_rank"])}(this.db.store,e)}},{key:"getReferenceOrgans",value:function(){return function(e){var t=[];return e.forEach(function(n){n.subject.id===n.object.id&&t.push(tY(e,n.subject.id))},null,XX.spatialEntity.reference_organ,null,null),(0,$q.sortBy)(t,["rui_rank"])}(this.db.store)}},{key:"getReferenceBody",value:function(e){var t;switch(null==e?void 0:e.sex){case"Male":t=XX.spatial.Male.id;break;case"Female":t=XX.spatial.Female.id;break;case"Both":default:t=XX.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=[],r=v(this.getReferenceOrganSets(e).map(function(e){var r="http://purl.obolibrary.org/obo/UBERON_0002097"===e.representation_of,o=t.getSceneNode(e,n,{color:[255,255,255,255],opacity:r?.5:.2,unpickable:!0,_lighting:"pbr",zoomBasedOpacity:!r});return r&&o?void i.push(o):o}));return i.length>0&&(r=[].concat(i,v(r))),(null==e?void 0:e.debug)&&(r=r.concat([this.getSceneNode(this.getSpatialEntity(XX.base("VHRightKidney").id),n,{color:[0,0,255,127.5],geometry:"wireframe"}),this.getSceneNode(this.getSpatialEntity(XX.base("VHLeftKidney").id),n,{color:[255,0,0,127.5],geometry:"wireframe"}),this.getSceneNode(this.getSpatialEntity(XX.base("VHSpleenCC1").id),n,{color:[0,255,0,127.5],geometry:"wireframe"}),this.getSceneNode(this.getSpatialEntity(XX.base("VHSpleenCC2").id),n,{color:[0,255,0,127.5],geometry:"wireframe"}),this.getSceneNode(this.getSpatialEntity(XX.base("VHSpleenCC3").id),n,{color:[0,255,0,127.5],geometry:"wireframe"})])),r.filter(function(e){return void 0!==e})}},{key:"getReferenceOrganScene",value:function(e,t){var n,i,r=this,o=void 0!==(null==t?void 0:t.sex)&&"both"!==(null===(n=null==t?void 0:t.sex)||void 0===n?void 0:n.toLowerCase()),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 $O($O.IDENTITY).rotateX(cS(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}(),aY="https://entity.api.hubmapconsortium.org/entities/",sY=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"]),uY={"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"},cY={"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","5c106f29-ea2d-11e9-85e8-0efb3ba9a670":"RTI-General Electric","301615f9-c870-11eb-a8dc-35ce3d8786fe":"TMC-UConn"},lY={"@base":"http://purl.org/ccf/latest/ccf-entity.owl#","@vocab":"http://purl.org/ccf/latest/ccf-entity.owl#",ccf:"http://purl.org/ccf/",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"},cellTypeTerms:{"@id":"has_cell_type_term","@type":"@id"},thumbnail:{"@id":"has_thumbnail"}},hY=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,cY[t.group_uuid]||(cY[t.group_uuid]=t.group_name);var l=new Date(t.last_modified_timestamp).toLocaleDateString(),h=cY[t.group_uuid]||t.group_name,d=t.created_by_user_displayname;this["@id"]=aY+t.uuid,this.label="Registered ".concat(l,", ").concat(d,", ").concat(h),this.link="".concat(o,"browse/sample/").concat(t.uuid);var f={},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);f[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 C=this.getDataset(S,r,o,a),E=(0,$q.get)(S,["ingest_metadata","metadata","tissue_id"]);f[E]?null===(i=f[E].datasets)||void 0===i||i.push(C):v.push(C)}}}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 P=parseFloat((O.slice_thickness||(O.z_dimension||0)/Math.max(this.section_count,1)).toFixed(1));this.section_size=P;var A=O.dimension_units||"millimeter";this.section_units=A,this.description="".concat(T,", ").concat(P," ").concat(A,", ").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(P," ").concat(A,", ").concat(P," ").concat(A,", ").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":aY+e.uuid,"@type":"Sample",label:"Registered ".concat(i,", ").concat(e.created_by_user_displayname,", ").concat(cY[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=cY[e.group_uuid]||e.group_name,u=e.created_by_user_displayname,c=[].concat(v(e.data_types),[(0,$q.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":aY+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,$q.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 sY.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(sY.has(o))return"assets/thumbnails/TMC-Vanderbilt/DR1/".concat(o)}}else if("07a29e4c-ed43-11e8-b56a-0e8017bdda58"===e.group_uuid){var a=uY[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,$q.toNumber)(a[1]));var s,u=_((0,$q.get)(e,"metadata.organ_donor_data",(0,$q.get)(e,"metadata.living_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,$q.toNumber)(c.data_value):"Body mass index"===c.preferred_term&&(o=(0,$q.toNumber)(c.data_value))}}catch(f){u.e(f)}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(),d=cY[e.group_uuid]||e.group_name;return{"@id":aY+e.uuid,"@type":"Donor",label:l,description:"Entered ".concat(h,", ").concat(e.created_by_user_displayname,", ").concat(d),link:"".concat(t,"browse/donor/").concat(e.uuid),age:r,sex:n,bmi:o,consortium_name:"HuBMAP",provider_name:d,provider_uuid:e.group_uuid,samples:[]}}},{key:"getRuiLocation",value:function(e,t){var n,i,r=e.rui_location;if(r&&("string"==typeof r&&(r=JSON.parse(r)),r.alignment_id?console.log("Detected a deprecated rui_location",e.uuid):r["@id"]&&(i=r)),i){var o=null!==(n=(0,$q.get)(i,["placement","target"]))&&void 0!==n?n:"";o.startsWith("http://purl.org/ccf/latest/ccf.owl#VHSpleenCC")?(0,$q.set)(i,["placement","target"],o.replace("#VHSpleenCC","Male"===t.sex?"#VHMSpleenCC":"#VHFSpleenCC")):("http://purl.org/ccf/latest/ccf.owl#VHLeftKidney"===o||"http://purl.org/ccf/latest/ccf.owl#VHRightKidney"===o)&&(0,$q.set)(i,["placement","target"],"Male"===t.sex?o.replace("#VH","#VHM")+"_Patch":o.replace("#VH","#VHF")+"_Patch")}return i}},{key:"getTissueBlock",value:function(){return(0,$q.omit)(Object.assign({},this),["data","bad","donor"])}},{key:"toJsonLd",value:function(){return Object.assign(Object.assign({},this.donor),{samples:[this.getTissueBlock()]})}}]),e}(),dY=["uuid","entity_type","group_uuid","group_name","last_modified_timestamp","created_by_user_displayname","ancestors.entity_type","ancestors.description","ancestors.metadata.organ_donor_data.preferred_term","ancestors.metadata.organ_donor_data.data_value","ancestors.metadata.living_donor_data.preferred_term","ancestors.metadata.living_donor_data.data_value","ancestors.last_modified_timestamp","ancestors.group_uuid","ancestors.group_name","ancestors.created_by_user_displayname","ancestors.uuid","descendants.entity_type","descendants.ingest_metadata.metadata.tissue_id","descendants.last_modified_timestamp","descendants.group_uuid","descendants.group_name","descendants.created_by_user_displayname","descendants.uuid","descendants.data_types","descendants.ingest_metadata.metadata.assay_type","descendants.thumbnail_file","descendants.metadata.files.rel_path","rui_location","specimen_type"],fY={exists:{field:"rui_location"}};function pY(e,t,n){return JSON.stringify({version:!0,from:e,size:t,stored_fields:["*"],script_fields:{},docvalue_fields:[],query:null!=n?n:fY,_source:{includes:dY}})}function vY(e,t){return Dw(this,void 0,void 0,regeneratorRuntime.mark(function n(){var i;return regeneratorRuntime.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,fetch(e,t);case 3:if(!(i=n.sent).ok){n.next=10;break}return n.next=7,i.json();case 7:n.t0=n.sent,n.next=11;break;case 10:n.t0=void 0;case 11:return n.abrupt("return",n.t0);case 14:return n.prev=14,n.t1=n.catch(0),n.abrupt("return");case 17:case"end":return n.stop()}},n,null,[[0,14]])}))}function gY(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 Dw(this,void 0,void 0,regeneratorRuntime.mark(function a(){var s;return regeneratorRuntime.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:if("static"!==t){a.next=6;break}return a.next=3,vY(e);case 3:s=a.sent,a.next=11;break;case 6:if(a.t0="search-api"===t,!a.t0){a.next=11;break}return a.next=10,function(e,t,n){return Dw(this,void 0,void 0,regeneratorRuntime.mark(function i(){var r,o,a,s,u,c,l,h,d,f;return regeneratorRuntime.wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return o=250,a=function(e){var t=new Headers;return t.append("Content-type","application/json"),e&&t.append("Authorization","Bearer ".concat(e)),t}(t),s=pY(0,o,n),i.next=5,vY(e,{method:"POST",headers:a,body:s});case 5:if(u=i.sent){i.next=8;break}return i.abrupt("return");case 8:if(!((c=u.hits.total.value)<=o)){i.next=11;break}return i.abrupt("return",u);case 11:for(l=[],h=o;h1&&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,$q.get)(e,"hits.hits",[]).map(function(e){return(0,$q.get)(e,"_source",{})}).sort(function(e,t){return e.uuid.localeCompare(t.uuid)}).map(function(e){return new hY(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(d){u.e(d)}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(d){o.e(d)}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":lY},e)}))),{"@context":lY,"@graph":h}}(s,r,o,i));case 13:console.warn("Unable to load ".concat(e," as HuBMAP Data"));case 14:case"end":return a.stop()}},a)}))}function mY(e,t,n){var i,r=new Set,o=_(t);try{for(o.s();!(i=o.n()).done;){var a,s=i.value,u=_((0,Hq.readQuads)(e,s,n,null,null));try{for(u.s();!(a=u.n()).done;){var c=a.value;r.add(c.object.id)}}catch(l){u.e(l)}finally{u.f()}}}catch(l){o.e(l)}finally{o.f()}return r}var yY=(o(x={},XX.spatialEntity.x_dimension.id,"x"),o(x,XX.spatialEntity.y_dimension.id,"y"),o(x,XX.spatialEntity.z_dimension.id,"z"),x);function bY(e,t,n,i){var r,o=t.getTransformationMatrix(n,i);if(o){var a=o.getTranslation(),s=function(e,t){var n=UX(e,t,"Dimensions",yY);return[n.x,n.y,n.z]}(e,n).map(function(e){return e/1e3/2}),u=(new qq).fromRotationMatrix(o,qq.XYZ).toQuaternion().normalize().calculateW();r=(new jX).fromCenterHalfSizeQuaternion(a,s,u)}return r}function _Y(e,t,n,i){var r,o=i.x,a=i.y,s=i.z,u=i.radius,c=i.target,l=new Set,h=u/1e3*(u/1e3),d=_(n);try{for(d.s();!(r=d.n()).done;){var f=r.value,p=bY(e,t,f,c);p&&p.distanceSquaredTo([o,a,s].map(function(e){return e/1e3}))<=h&&l.add(f)}}catch(v){d.e(v)}finally{d.f()}return l}function wY(e,t,n){var i,r,o,a=new Map,s=new Set,u=_(t);try{for(u.s();!(o=u.n()).done;){var c,l=o.value,h=_((0,Hq.readQuads)(e,l,qX.donor,null,null));try{for(h.s();!(c=h.n()).done;){var d=c.value;s.add(d.object.id),a.has(d.object.id)?null===(i=a.get(d.object.id))||void 0===i||i.push(l):a.set(d.object.id,[l])}}catch(k){h.e(k)}finally{h.f()}}}catch(k){u.e(k)}finally{u.f()}var f,p=n(s),v=new Set,g=_(p);try{for(g.s();!(f=g.n()).done;){var m,y=f.value,b=_(null!==(r=a.get(y))&&void 0!==r?r:[]);try{for(b.s();!(m=b.n()).done;){var w=m.value;v.add(w)}}catch(k){b.e(k)}finally{b.f()}}}catch(k){g.e(k)}finally{g.f()}return v}function kY(e,t,n){var i,r,o,a=new Map,s=new Set,u=_(t);try{for(u.s();!(o=u.n()).done;){var c,l=o.value,h=_((0,Hq.readQuads)(e,l,qX.spatialEntity,null,null));try{for(h.s();!(c=h.n()).done;){var d=c.value;s.add(d.object.id),a.has(d.object.id)?null===(i=a.get(d.object.id))||void 0===i||i.push(l):a.set(d.object.id,[l])}}catch(k){h.e(k)}finally{h.f()}}}catch(k){u.e(k)}finally{u.f()}var f,p=n(s),v=new Set,g=_(p);try{for(g.s();!(f=g.n()).done;){var m,y=f.value,b=_(null!==(r=a.get(y))&&void 0!==r?r:[]);try{for(b.s();!(m=b.n()).done;){var w=m.value;v.add(w)}}catch(k){b.e(k)}finally{b.f()}}}catch(k){g.e(k)}finally{g.f()}return v}function xY(e,t){return function(n){e.has(n.id)&&t.add(n.id)}}function SY(e,t,n){var i,r=new Set,o=_(n);try{for(o.s();!(i=o.n()).done;){var a=i.value,s=Hq.DataFactory.namedNode(a);e.forSubjects(xY(t,r),XX.spatialEntity.ccf_annotations,s,null)}}catch(u){o.e(u)}finally{o.f()}return r}function CY(e,t){var n,i=function(e,t){var n,i=new Map,r=_(e);try{for(r.s();!(n=r.n()).done;){var o,a=n.value,s=_((0,Hq.readQuads)(t,a,qX.spatialEntity,null,null));try{for(s.s();!(o=s.n()).done;){var u=o.value;i.has(u.object.id)?i.get(u.object.id).add(a):i.set(u.object.id,new Set([a]))}}catch(c){s.e(c)}finally{s.f()}}}catch(c){r.e(c)}finally{r.f()}return i}(e,t),r=new Map,o=_(i.keys());try{for(o.s();!(n=o.n()).done;){var a,s=n.value,u=i.get(s),c=_((0,Hq.readQuads)(t,s,XX.spatialEntity.ccf_annotations,null,null));try{for(c.s();!(a=c.n()).done;){var l=a.value;r.has(l.object.id)?function(){var e=r.get(l.object.id);u.forEach(function(t){return e.add(t)})}():r.set(l.object.id,new Set(u))}}catch(h){c.e(h)}finally{c.f()}}}catch(h){o.e(h)}finally{o.f()}return r}function EY(e,n,i){var r,a,s={"@id":n,"@type":"OntologyTreeNode",id:n,parent:"",children:[],synonymLabels:[],label:""},u=_(zX(e,n,(o(r={},XX.ontologyNode.label.id,"label"),o(r,i,"parent"),o(r,XX.ontologyNode.synonymLabels.id,"synonymLabels"),r)));try{for(u.s();!(a=u.n()).done;){var c=t(a.value,2),l=c[0],h=c[1];"synonymLabels"===l?s.synonymLabels.push(h):s[l]=h}}catch(d){u.e(d)}finally{u.f()}return s.children=e.getSubjects(i,n,null).map(function(e){return e.id}),s}function OY(e,t,n,i){var r,o={root:t,nodes:{}},a=new Set,s=_((0,Hq.readQuads)(e,null,i,null,null));try{for(s.s();!(r=s.n()).done;){var u=r.value;a.add(u.subject.id),a.add(u.object.id)}}catch(f){s.e(f)}finally{s.f()}var c,l=_(a);try{for(l.s();!(c=l.n()).done;){var h=c.value;o.nodes[h]=EY(e,h,i)}}catch(f){l.e(f)}finally{l.f()}o.nodes[t]||(o.nodes[t]={"@id":t,"@type":"OntologyTreeNode",id:t,label:n,children:[],synonymLabels:[]});var d=e.getSubjects(i,t,null).map(function(e){return e.id}).sort(function(e,t){return o.nodes[e].label.localeCompare(o.nodes[t].label)});return o.nodes[t].children=d,TY(o),o}function TY(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Set,i=e.nodes[null!=t?t:e.root];if(i){i.children=i.children.filter(function(e){return!n.has(e)}),i.children.forEach(function(e){return n.add(e)});var r,o=_(i.children);try{for(o.s();!(r=o.n()).done;){var a=r.value;TY(e,a,n),e.nodes[a]&&(e.nodes[a].parent=i["@id"])}}catch(s){o.e(s)}finally{o.f()}}}var PY=(0,$q.memoize)(function(e){var t=OY(e,QX.body.id,"body",XX.asctb.part_of.id);return t.nodes[QX.body.id].children=["http://purl.obolibrary.org/obo/UBERON_0000955","http://purl.obolibrary.org/obo/UBERON_0000029","http://purl.obolibrary.org/obo/UBERON_0000970","http://purl.obolibrary.org/obo/UBERON_0003889","http://purl.obolibrary.org/obo/UBERON_0000948","http://purl.obolibrary.org/obo/UBERON_0002113","http://purl.obolibrary.org/obo/UBERON_0001465","http://purl.obolibrary.org/obo/UBERON_0002107","http://purl.obolibrary.org/obo/UBERON_0002048","http://purl.obolibrary.org/obo/UBERON_0001911","http://purl.obolibrary.org/obo/UBERON_0000992","http://purl.obolibrary.org/obo/UBERON_0001264","http://purl.obolibrary.org/obo/UBERON_0001270","http://purl.obolibrary.org/obo/UBERON_0001987","http://purl.obolibrary.org/obo/UBERON_0002367","http://purl.obolibrary.org/obo/UBERON_0002097","http://purl.obolibrary.org/obo/UBERON_0002108","http://purl.obolibrary.org/obo/UBERON_0002240","http://purl.obolibrary.org/obo/UBERON_0000059","http://purl.obolibrary.org/obo/UBERON_0002106","http://purl.obolibrary.org/obo/UBERON_0002370","http://purl.obolibrary.org/obo/UBERON_0000056","http://purl.obolibrary.org/obo/UBERON_0001255","http://purl.obolibrary.org/obo/UBERON_0000995","http://purl.obolibrary.org/obo/UBERON_0004537"].filter(function(e){return e in t.nodes}),t},function(){return""}),AY=(o(S={},qX.label.id,"label"),o(S,qX.description.id,"description"),o(S,qX.link.id,"link"),S),MY=Object.assign(Object.assign({},AY),o({},qX.providerName.id,"providerName")),IY=Object.assign(Object.assign({},AY),(o(C={},qX.technology.id,"technology"),o(C,qX.thumbnail.id,"thumbnail"),C)),RY=Object.assign(Object.assign({},AY),(o(E={},qX.sampleType.id,"sampleType"),o(E,qX.sectionNumber.id,"sectionNumber"),o(E,qX.datasets.id,"datasets"),E)),DY=Object.assign(Object.assign({},AY),(o(O={},qX.sampleType.id,"sampleType"),o(O,qX.sectionCount.id,"sectionCount"),o(O,qX.sectionSize.id,"sectionSize"),o(O,qX.sectionUnits.id,"sectionUnits"),o(O,qX.donor.id,"donor"),o(O,qX.spatialEntity.id,"spatialEntityId"),o(O,qX.sections.id,"sections"),o(O,qX.datasets.id,"datasets"),O));function NY(e,t){return UX(e,t,"Donor",MY)}function LY(e,t){return UX(e,t,"Dataset",IY)}function jY(e,n){var i,r={"@id":n,"@type":"Sample",datasets:[]},o=_(zX(e,n,RY));try{for(o.s();!(i=o.n()).done;){var a=t(i.value,2),s=a[0],u=a[1];if("datasets"===s){var c=LY(e,u);r[s].push(c)}else r[s]=u}}catch(l){o.e(l)}finally{o.f()}return r}var FY=function(){function e(t){m(this,e),this.database=t,this.connect()}return b(e,[{key:"toJson",value:function(){return{status:this.status,message:this.message,checkback:"Ready"===this.status||"Error"===this.status?36e5:2e3,loadTime:this.loadTime}}},{key:"connect",value:function(){var e=this;this.status="Loading",this.message="Loading database";var t=Date.now();return this.database.connect().then(function(t){return Dw(e,void 0,void 0,regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!t){e.next=14;break}return this.message="Building scene",e.next=4,this.database.getScene();case 4:return this.message="Building tissue block results",e.next=7,this.database.getTissueBlockResults();case 7:return this.message="Aggregating results",e.next=10,this.database.getAggregateResults();case 10:this.status="Ready",this.message="Database successfully loaded",e.next=15;break;case 14:this.status="Error",this.message="Unknown error while loading database";case 15:case"end":return e.stop()}},e,this)}))}).catch(function(t){var n;e.status="Error",e.message=null!==(n=null==t?void 0:t.message)&&void 0!==n?n:"Unknown error while loading database"}).finally(function(){e.loadTime=Date.now()-t})}}]),e}(),BY={"@context":{"@base":"http://purl.org/ccf/","@vocab":"http://purl.org/ccf/",ccf:"http://purl.org/ccf/",rdfs:"http://www.w3.org/2000/01/rdf-schema#",dcterms:"http://purl.org/dc/terms/",label:"rdfs:label",description:"rdfs:comment",link:"ccf:url",sex:"ccf:sex",age:"ccf:age",bmi:"ccf:bmi",consortium_name:"ccf:consortium_name",provider_name:"ccf:tissue_provider_name",provider_uuid:"ccf:tissue_provider_uuid",donor:{"@id":"ccf:comes_from","@type":"@id"},samples:{"@reverse":"donor"},sections:{"@id":"ccf:subdivided_into_sections","@type":"@id"},datasets:{"@id":"ccf:generates_dataset","@type":"@id"},sample_type:"ccf:sample_type",section_count:"ccf:section_count",section_size:"ccf:section_size",section_units:"ccf:section_size_unit",section_number:"ccf:section_number",rui_location:{"@id":"ccf:has_registration_location","@type":"@id"},ccf_annotations:{"@id":"ccf:collides_with","@type":"@id","@container":"@set"},representation_of:{"@id":"ccf:representation_of","@type":"@id"},reference_organ:{"@id":"ccf:has_reference_organ","@type":"@id"},extraction_set_for:{"@id":"ccf:extraction_set_for","@type":"@id"},extraction_set:{"@id":"ccf:has_extraction_set","@type":"@id"},organ_owner_sex:"ccf:organ_owner_sex",side:"ccf:organ_side",rui_rank:"ccf:rui_rank",slice_thickness:"ccf:slice_thickness",slice_count:"ccf:slice_count",object:{"@id":"ccf:has_object_reference","@type":"@id"},creation_date:"dcterms:created",updated_date:"ccf:updated_date",creator:"dcterms:creator",creator_first_name:"ccf:creator_first_name",creator_last_name:"ccf:creator_last_name",placement:{"@reverse":"ccf:placement_for"},placement_date:"dcterms:created",rotation_order:"ccf:rotation_order",dimension_units:"ccf:dimension_unit",rotation_units:"ccf:rotation_unit",scaling_units:"ccf:scaling_unit",translation_units:"ccf:translation_unit",source:{"@id":"ccf:placement_for","@type":"@id"},target:{"@id":"ccf:placement_relative_to","@type":"@id"},x_rotation:"ccf:x_rotation",y_rotation:"ccf:y_rotation",z_rotation:"ccf:z_rotation",x_scaling:"ccf:x_scaling",y_scaling:"ccf:y_scaling",z_scaling:"ccf:z_scaling",x_translation:"ccf:x_translation",y_translation:"ccf:y_translation",z_translation:"ccf:z_translation",x_dimension:"ccf:x_dimension",y_dimension:"ccf:y_dimension",z_dimension:"ccf:z_dimension",ontology_terms:{"@id":"ccf:has_ontology_term","@type":"@id"},technology:"ccf:technology",thumbnail:"ccf:thumbnail",file:"ccf:file_url",file_format:"ccf:file_format",file_subpath:"ccf:file_subpath"}};function VY(e){return JSON.parse(e,function(e,t){return"ccf_annotations"===e&&Array.isArray(t)?t.map(function(e){return(null==e?void 0:e.startsWith("http://purl.obolibrary.org/obo/FMA_"))?e.replace("http://purl.obolibrary.org/obo/FMA_","http://purl.org/sig/ont/fma/fma"):e}):"@context"!==e||!t||"https://hubmapconsortium.github.io/hubmap-ontology/ccf-entity-context.jsonld"!==t&&"https://hubmapconsortium.github.io/hubmap-ontology/ccf-context.jsonld"!==t&&"https://hubmapconsortium.github.io/ccf-ontology/ccf-context.jsonld"!==t&&"http://purl.org/ccf/latest/ccf-entity.owl#"!==t["@base"]?t:BY})}var zY={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"},UY=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:zY;m(this,e),this.options=t,this.store=new Hq.Store(void 0,{factory:Hq.DataFactory}),this.graph=new rY(this),this.scene=new oY(this)}return b(e,[{key:"connect",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Dw(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 Dw(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,zq(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]:Vq();return t("readwrite",function(t){return e.forEach(function(e){return t.delete(e)}),Bq(t.transaction)})}([i,n]).catch(function(){});case 9:e.next=14;break;case 11:return e.next=13,zq(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]:Vq();return t("readwrite",function(t){return e.forEach(function(e){return t.put(e[1],e[0])}),Bq(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 Dw(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).startsWith("{")){n.next=5;break}this.store=(0,Hq.deserializeN3Store)(o,Hq.DataFactory),n.next=13;break;case 5:if(!o.endsWith(".n3store.json")){n.next=12;break}return n.next=8,fetch(o).then(function(e){return e.text()}).catch(function(){return console.log("Couldn't locate serialized store.")});case 8:(a=n.sent)&&(this.store=(0,Hq.deserializeN3Store)(a,Hq.DataFactory)),n.next=13;break;case 12:(null==o?void 0:o.length)>0&&r.push(o);case 13:return this.options.hubmapDataUrl&&(this.options.hubmapDataUrl.endsWith("jsonld")?r.push(this.options.hubmapDataUrl):i.push(gY(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=17,Promise.all(i);case 17:return n.next=19,this.synchronize();case 19:case"end":return n.stop()}},n,this)}))}},{key:"addDataSources",value:function(e,t){return Dw(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 Dw(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=26;break}if(!e.startsWith("http")&&!e.startsWith("assets/")||!e.includes("jsonld")){t.next=11;break}return t.t0=VY,t.next=5,fetch(e).then(function(e){return e.text()});case 5:return t.t1=e=t.sent,e=(0,t.t0)(t.t1),t.next=9,(0,Hq.addJsonLdToStore)(e,i);case 9:t.next=24;break;case 11:if(!e.endsWith("n3")){t.next=16;break}return t.next=14,(0,Hq.addN3ToStore)(e,i);case 14:t.next=24;break;case 16:if(!(e.endsWith("rdf")||e.endsWith("owl")||e.endsWith("xml"))){t.next=21;break}return t.next=19,(0,Hq.addRdfXmlToStore)(e,i);case 19:t.next=24;break;case 21:return e=VY(e),t.next=24,(0,Hq.addJsonLdToStore)(e,i);case 24:t.next=29;break;case 26:return e=VY(JSON.stringify(e)),t.next=29,(0,Hq.addJsonLdToStore)(e,i);case 29: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 Dw(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(),function(e){var t,n,i,r,o=PY(e),a=new Map,s=_((0,Hq.readQuads)(e,null,XX.spatialEntity.representation_of,null,null));try{for(s.s();!(r=s.n()).done;){for(var u=r.value,c=u.subject,l=u.object,h=new Set([l.id]),d=null===(t=o.nodes[l.id])||void 0===t?void 0:t.parent;d&&!h.has(d);)h.add(d),d=null===(n=o.nodes[d])||void 0===n?void 0:n.parent;a.set(c.id,v(h).map(function(e){return Hq.DataFactory.namedNode(e)}))}}catch(O){s.e(O)}finally{s.f()}var f,p=_((0,Hq.readQuads)(e,null,qX.spatialEntity,null,null));try{for(p.s();!(f=p.n()).done;){var g,m=f.value.object,y=_((0,Hq.readQuads)(e,null,XX.spatialPlacement.source,m,null));try{for(y.s();!(g=y.n()).done;){var b,w=g.value.subject,k=_((0,Hq.readQuads)(e,w,XX.spatialPlacement.target,null,null));try{for(k.s();!(b=k.n()).done;){var x,S=b.value.object,C=_(null!==(i=a.get(S.id))&&void 0!==i?i:[]);try{for(C.s();!(x=C.n()).done;){var E=x.value;e.addQuad(Hq.DataFactory.namedNode(m.id),XX.spatialEntity.ccf_annotations,E)}}catch(O){C.e(O)}finally{C.f()}}}catch(O){k.e(O)}finally{k.f()}}}catch(O){y.e(O)}finally{y.f()}}}catch(O){p.e(O)}finally{p.f()}}(this.store),e.abrupt("return",this);case 5:case"end":return e.stop()}},e,this)}))}},{key:"serialize",value:function(){return(0,Hq.serializeN3Store)(this.store)}},{key:"deserialize",value:function(e){return Dw(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,Hq.deserializeN3Store)(e,Hq.DataFactory),this.graph=new rY(this),this.scene=new oY(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,n){var i,r,o,a,s,u,c,l=function(e){var t=new Set;return e.forSubjects(function(e){return t.add(e.id)},qX.spatialEntity,null,null),t}(e);if(l.size>0&&(l=function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=new Set;if(e.forSubjects(xY(t,i),qX.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,l)),l.size>0&&("Male"===n.sex||"Female"===n.sex)){var h=n.sex;l=wY(e,l,function(t){return function(e,t,n){var i=new Set;return e.forSubjects(xY(t,i),qX.sex,qX[n],null),i}(e,t,h)})}if(l.size>0&&(null===(i=n.tmc)||void 0===i?void 0:i.length)>0&&(l=wY(e,l,function(t){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=Hq.DataFactory.literal(a);e.forSubjects(xY(t,r),qX.providerName,s,null)}}catch(u){o.e(u)}finally{o.f()}return r}(e,t,n.tmc)})),l.size>0&&(null===(r=n.technologies)||void 0===r?void 0:r.length)>0&&(l=function(e,t,n){var i,r,o,a=new Map,s=new Set,u=new Set(t),c=_(t);try{for(c.s();!(o=c.n()).done;){var l,h=o.value,d=_((0,Hq.readQuads)(e,h,qX.sections,null,null));try{for(d.s();!(l=d.n()).done;){var f=l.value;u.add(f.object.id)}}catch(P){d.e(P)}finally{d.f()}}}catch(P){c.e(P)}finally{c.f()}var p,v=_(u);try{for(v.s();!(p=v.n()).done;){var g,m=p.value,y=_((0,Hq.readQuads)(e,m,qX.datasets,null,null));try{for(y.s();!(g=y.n()).done;){var b=g.value;s.add(b.object.id),a.has(b.object.id)?null===(i=a.get(b.object.id))||void 0===i||i.push(m):a.set(b.object.id,[m])}}catch(P){y.e(P)}finally{y.f()}}}catch(P){v.e(P)}finally{v.f()}var w,k=n(s),x=new Set,S=_(k);try{for(S.s();!(w=S.n()).done;){var C,E=w.value,O=_(null!==(r=a.get(E))&&void 0!==r?r:[]);try{for(O.s();!(C=O.n()).done;){var T=C.value;x.add(T)}}catch(P){O.e(P)}finally{O.f()}}}catch(P){S.e(P)}finally{S.f()}return x}(e,l,function(t){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=Hq.DataFactory.literal(a);e.forSubjects(xY(t,r),qX.technology,s,null)}}catch(u){o.e(u)}finally{o.f()}return r}(e,t,n.technologies)})),l.size>0&&(null===(o=n.spatialSearches)||void 0===o?void 0:o.length)>0&&(l=kY(e,l,function(i){return function(e,t,n,i){var r,o=new Set,a=_(i);try{for(a.s();!(r=a.n()).done;){_Y(e,t,n,r.value).forEach(function(e){return o.add(e)})}}catch(s){a.e(s)}finally{a.f()}return o}(e,t,i,n.spatialSearches)})),l.size>0&&(null===(a=n.ontologyTerms)||void 0===a?void 0:a.length)>0){var d=n.ontologyTerms;-1===d.indexOf(QX.body.id)&&(l=kY(e,l,function(t){return SY(e,t,d)}))}if(l.size>0&&(null===(s=n.cellTypeTerms)||void 0===s?void 0:s.length)>0){var f=n.cellTypeTerms;-1===f.indexOf(QX.cell.id)&&(l=kY(e,l,function(t){return function(e,t,n){var i,r=new Set,o=_(n);try{for(o.s();!(i=o.n()).done;){var a=i.value;e.forObjects(function(e){r.add(e.id)},a,XX.asctb.located_in,null),a===QX.cell.id&&r.add(QX.body.id)}}catch(s){o.e(s)}finally{o.f()}return SY(e,t,v(r))}(e,t,f)}))}if(l.size>0&&2===(null===(u=n.ageRange)||void 0===u?void 0:u.length)&&(0,$q.isFinite)(n.ageRange[0])&&(0,$q.isFinite)(n.ageRange[1])){var p=Math.max.apply(Math,v(n.ageRange)),g=Math.min.apply(Math,v(n.ageRange));1===g&&110===p||(l=wY(e,l,function(t){return function(e,t,n,i){var r,o=new Set,a=_(t);try{for(a.s();!(r=a.n()).done;){var s,u=r.value,c=_((0,Hq.readQuads)(e,u,qX.age,null,null));try{for(c.s();!(s=c.n()).done;){var l=s.value,h=(0,rX.fromRdf)(l.object);h>=n&&h<=i&&o.add(u)}}catch(d){c.e(d)}finally{c.f()}}}catch(d){a.e(d)}finally{a.f()}return o}(e,t,g,p)}))}if(l.size>0&&2===(null===(c=n.bmiRange)||void 0===c?void 0:c.length)&&(0,$q.isFinite)(n.bmiRange[0])&&(0,$q.isFinite)(n.bmiRange[1])){var m=Math.max.apply(Math,v(n.bmiRange)),y=Math.min.apply(Math,v(n.bmiRange));13===y&&83===m||(l=wY(e,l,function(t){return function(e,t,n,i){var r,o=new Set,a=_(t);try{for(a.s();!(r=a.n()).done;){var s,u=r.value,c=_((0,Hq.readQuads)(e,u,qX.bmi,null,null));try{for(c.s();!(s=c.n()).done;){var l=s.value,h=(0,rX.fromRdf)(l.object);h>=n&&h<=i&&o.add(u)}}catch(d){c.e(d)}finally{c.f()}}}catch(d){a.e(d)}finally{a.f()}return o}(e,t,y,m)}))}return l}(this.store,this.graph,e)}},{key:"get",value:function(e){return this.store.getQuads(Hq.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 function(e,t){var n=e.getObjects(Hq.DataFactory.namedNode(t),qX.spatialEntity,null);if(n.length>0)return tY(e,n[0].id)}(t.store,e)})}},{key:"getDatabaseStatus",value:function(){return Dw(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.status||(this.status=new FY(this)),this.status.toJson()));case 1:case"end":return e.stop()}},e,this)}))}},{key:"getDatasetTechnologyNames",value:function(){return Dw(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,n=new Set,i=_((0,Hq.readQuads)(e,null,qX.technology,null,null));try{for(i.s();!(t=i.n()).done;){var r=t.value;n.add(r.object.value)}}catch(o){i.e(o)}finally{i.f()}return Array.from(n).sort()}(this.store));case 1:case"end":return e.stop()}},e,this)}))}},{key:"getProviderNames",value:function(){return Dw(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,n=new Set,i=_((0,Hq.readQuads)(e,null,qX.providerName,null,null));try{for(i.s();!(t=i.n()).done;){var r=t.value;n.add(r.object.value)}}catch(o){i.e(o)}finally{i.f()}return Array.from(n).sort()}(this.store));case 1:case"end":return e.stop()}},e,this)}))}},{key:"getTissueBlockResults",value:function(e){return Dw(this,void 0,void 0,regeneratorRuntime.mark(function n(){var i=this;return regeneratorRuntime.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",(e=Object.assign(Object.assign({},e),{hasSpatialEntity:!0}),v(this.getIds(e)).map(function(e){return function(e,n){var i,r={"@id":n,"@type":"Sample",sections:[],datasets:[]},o=_(zX(e,n,DY));try{for(o.s();!(i=o.n()).done;){var a=t(i.value,2),s=a[0],u=a[1];if("sections"===s){var c=jY(e,u);r[s].push(c)}else if("datasets"===s){var l=LY(e,u);r[s].push(l)}else r[s]="donor"===s?NY(e,u):u}}catch(h){o.e(h)}finally{o.f()}return r}(i.store,e)})));case 1:case"end":return n.stop()}},n,this)}))}},{key:"getAggregateResults",value:function(e){return Dw(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,r=mY(n,e,qX.donor.id),o=mY(n,r,qX.providerUUID.id),a=new Set,s=_(e);try{for(s.s();!(i=s.n()).done;){var u,c=i.value,l=_((0,Hq.readQuads)(n,c,qX.spatialEntity,null,null));try{for(l.s();!(u=l.n()).done;){var h=u.value;a.add(h.subject.id)}}catch(p){l.e(p)}finally{l.f()}}}catch(p){s.e(p)}finally{s.f()}var d=mY(n,a,qX.sections.id),f=new Set([].concat(v(mY(n,a,qX.datasets.id)),v(mY(n,d,qX.datasets.id))));return Object.entries({"Tissue Data Providers":o.size,Donors:r.size,"Tissue Blocks":a.size,"Tissue Sections":d.size,"Tissue Datasets":f.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 Dw(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={};return CY(e,t).forEach(function(e,t){n[t]=e.size}),n}(this.getIds(e),this.store));case 1:case"end":return t.stop()}},t,this)}))}},{key:"getCellTypeTermOccurences",value:function(e){return Dw(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,i,r,o=CY(e,t),a=new Map,s=_(o.keys());try{for(s.s();!(r=s.n()).done;){var u,c=r.value,l=o.get(c),h=_((0,Hq.readQuads)(t,null,XX.asctb.located_in,c,null));try{for(h.s();!(u=h.n()).done;){var d=u.value.subject.id;a.has(d)?function(){var e=a.get(d);l.forEach(function(t){return e.add(t)})}():a.set(d,new Set(l))}}catch(p){h.e(p)}finally{h.f()}}}catch(p){s.e(p)}finally{s.f()}var f={};return a.forEach(function(e,t){f[t]=e.size}),f[QX.cell.id]=null!==(i=null===(n=o.get(QX.body.id))||void 0===n?void 0:n.size)&&void 0!==i?i:0,f}(this.getIds(e),this.store));case 1:case"end":return t.stop()}},t,this)}))}},{key:"getOntologyTreeModel",value:function(){return Dw(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",PY(this.store));case 1:case"end":return e.stop()}},e,this)}))}},{key:"getCellTypeTreeModel",value:function(){return Dw(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){return OY(e,QX.cell.id,"cell",XX.asctb.ct_is_a.id)}(this.store));case 1:case"end":return e.stop()}},e,this)}))}},{key:"getReferenceOrgans",value:function(){return Dw(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 Dw(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 Dw(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)}))}},{key:"getSpatialPlacement",value:function(e,t){return Dw(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.getSpatialPlacement(e,t));case 1:case"end":return n.stop()}},n,this)}))}}]),e}(),HY=[240,183,98,255],GY=[213,0,0,255],WY=[29,204,101,255],qY=[41,121,255,255],XY=[204,204,204,255],YY=[213,0,0,255],KY=[29,204,101,255],$Y=[41,121,255,255];function QY(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e.x_dimension/1e3,i=e.y_dimension/1e3,r=e.z_dimension/1e3,o=.05*Math.max(n,i,r),a=.1*o;return[{"@id":"http://purl.org/ccf/latest/ccf.owl#OriginSphere","@type":"SpatialSceneNode",unpickable:!0,geometry:"sphere",transformMatrix:new $O($O.IDENTITY).scale(o),color:XY},{"@id":"http://purl.org/ccf/latest/ccf.owl#OriginX","@type":"SpatialSceneNode",unpickable:!0,geometry:"cylinder",transformMatrix:new $O($O.IDENTITY).translate([n/2,0,0]).rotateZ(cS(-90)).scale([a,n,a]),color:YY},{"@id":"http://purl.org/ccf/latest/ccf.owl#OriginXCone","@type":"SpatialSceneNode",unpickable:!0,geometry:"cone",transformMatrix:new $O($O.IDENTITY).translate([n,0,0]).rotateZ(cS(-90)).scale([o,3*o,o]),color:YY},{"@id":"http://purl.org/ccf/latest/ccf.owl#OriginXALabel","@type":"SpatialSceneNode",unpickable:!0,geometry:"text",text:"A",transformMatrix:new $O($O.IDENTITY).translate([2*-o,0,0]).scale(o),color:YY},{"@id":"http://purl.org/ccf/latest/ccf.owl#OriginXDLabel","@type":"SpatialSceneNode",unpickable:!0,geometry:"text",text:"D",transformMatrix:new $O($O.IDENTITY).translate([n+2*o,0,0]).scale(o),color:YY},{"@id":"http://purl.org/ccf/latest/ccf.owl#OriginY","@type":"SpatialSceneNode",unpickable:!0,geometry:"cylinder",transformMatrix:new $O($O.IDENTITY).translate([0,i/2,0]).scale([a,i,a]),color:KY},{"@id":"http://purl.org/ccf/latest/ccf.owl#OriginYCone","@type":"SpatialSceneNode",unpickable:!0,geometry:"cone",transformMatrix:new $O($O.IDENTITY).translate([0,i,0]).scale([o,3*o,o]),color:KY},{"@id":"http://purl.org/ccf/latest/ccf.owl#OriginYSLabel","@type":"SpatialSceneNode",unpickable:!0,geometry:"text",text:"S",transformMatrix:new $O($O.IDENTITY).translate([1.5*o,1.5*o,0]).scale(o),color:KY},{"@id":"http://purl.org/ccf/latest/ccf.owl#OriginYWLabel","@type":"SpatialSceneNode",unpickable:!0,geometry:"text",text:"W",transformMatrix:new $O($O.IDENTITY).translate([0,i+2*o,0]).scale(o),color:KY},{"@id":"http://purl.org/ccf/latest/ccf.owl#OriginZ","@type":"SpatialSceneNode",unpickable:!0,geometry:"cylinder",transformMatrix:new $O($O.IDENTITY).translate([0,0,r/2]).rotateX(cS(90)).scale([a,r,a]),color:$Y},{"@id":"http://purl.org/ccf/latest/ccf.owl#OriginZCone","@type":"SpatialSceneNode",unpickable:!0,geometry:"cone",transformMatrix:new $O($O.IDENTITY).translate([0,0,r]).rotateX(cS(90)).scale([o,3*o,o]),color:$Y},{"@id":"http://purl.org/ccf/latest/ccf.owl#OriginZQLabel","@type":"SpatialSceneNode",unpickable:!0,geometry:"text",text:"Q",transformMatrix:new $O($O.IDENTITY).translate([1.5*o,1.5*-o,0]).scale(o),color:$Y},{"@id":"http://purl.org/ccf/latest/ccf.owl#OriginZELabel","@type":"SpatialSceneNode",unpickable:!0,geometry:"text",text:"E",transformMatrix:new $O($O.IDENTITY).translate([0,0,r+2*o]).scale(o),color:$Y}].filter(function(e){return t&&"text"===e.geometry&&e.text||!e.text})}var ZY=Symbol("Comlink.proxy"),JY=Symbol("Comlink.endpoint"),eK=Symbol("Comlink.releaseProxy"),tK=Symbol("Comlink.thrown"),nK=function(e){return"object"==typeof e&&null!==e||"function"==typeof e},iK=new Map([["proxy",{canHandle:function(e){return nK(e)&&e[ZY]},serialize:function(e){var t=new MessageChannel,n=t.port1,i=t.port2;return rK(e,n),[i,[i]]},deserialize:function(e){return e.start(),aK(e)}}],["throw",{canHandle:function(e){return nK(e)&&tK 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 rK(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,d=(r.data.argumentList||[]).map(fK);try{var f=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":f[l.slice(-1)[0]]=fK(r.data.value),a=!0;break;case"APPLY":a=p.apply(f,d);break;case"CONSTRUCT":a=function(e){return Object.assign(e,o({},ZY,!0))}(h(p,v(d)));break;case"ENDPOINT":var g=new MessageChannel,m=g.port1,y=g.port2;rK(e,y),a=function(e,t){return hK.set(e,t),e}(m,[m]);break;case"RELEASE":a=void 0;break;default:return}}catch(f){a=o({value:f},tK,0)}Promise.resolve(a).catch(function(e){return o({value:e},tK,0)}).then(function(e){var r=t(dK(e),2),o=r[0],a=r[1];n.postMessage(Object.assign(Object.assign({},o),{id:u}),a),"RELEASE"===c&&(n.removeEventListener("message",i),oK(n))})}}),n.start&&n.start()}function oK(e){(function(e){return"MessagePort"===e.constructor.name})(e)&&e.close()}function aK(e,t){return uK(e,[],t)}function sK(e){if(e)throw new Error("Proxy has been released and is not useable")}function uK(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(sK(r),i===eK)return function(){return pK(e,{type:"RELEASE",path:n.map(function(e){return e.toString()})}).then(function(){oK(e),r=!0})};if("then"===i){if(0===n.length)return{then:function(){return o}};var a=pK(e,{type:"GET",path:n.map(function(e){return e.toString()})}).then(fK);return a.then.bind(a)}return uK(e,[].concat(v(n),[i]))},set:function(i,o,a){sK(r);var s=t(dK(a),2),u=s[0],c=s[1];return pK(e,{type:"SET",path:[].concat(v(n),[o]).map(function(e){return e.toString()}),value:u},c).then(fK)},apply:function(i,o,a){sK(r);var s=n[n.length-1];if(s===JY)return pK(e,{type:"ENDPOINT"}).then(fK);if("bind"===s)return uK(e,n.slice(0,-1));var u=t(lK(a),2),c=u[0],l=u[1];return pK(e,{type:"APPLY",path:n.map(function(e){return e.toString()}),argumentList:c},l).then(fK)},construct:function(i,o){sK(r);var a=t(lK(o),2),s=a[0],u=a[1];return pK(e,{type:"CONSTRUCT",path:n.map(function(e){return e.toString()}),argumentList:s},u).then(fK)}});return o}function cK(e){return Array.prototype.concat.apply([],e)}function lK(e){var t=e.map(dK);return[t.map(function(e){return e[0]}),cK(t.map(function(e){return e[1]}))]}var hK=new WeakMap;function dK(e){var n,i=_(iK);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},hK.get(e)||[]]}function fK(e){switch(e.type){case"HANDLER":return iK.get(e.name).deserialize(e.value);case"RAW":return e.value}}function pK(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)})}var vK=function(e){a(n,e);var t=s(n);function n(){var e;return m(this,n),(e=t.apply(this,arguments)).message="NgxsDispatchPluginModule is not imported",e}return n}(l(Error)),gK=null;function mK(e){gK=e}function yK(){if(null===gK)throw new vK;return gK.get(Pz)}function bK(){if(null===gK)throw new vK;return gK.get(Xl)}function _K(e,t,n){t.run(function(){return e.dispatch(n)})}function wK(e,t,n,i){return js(n)?function(e,t,n){return n.then(function(n){return _K(e,t,n),n})}(e,t,n):cf(n)?function(e,t,n,i){return null!==i&&(n=n.pipe(kf(i.cancelUncompleted$))),n.subscribe({next:function(n){return _K(e,t,n)}}),n}(e,t,n,i):(_K(e,t,n),n)}var kK=function(){function e(){m(this,e),this.cancelUncompleted$=new ae}return b(e,[{key:"cancelPreviousAction",value:function(){this.cancelUncompleted$.next()}}]),e}(),xK="\u0275fac",SK=Symbol("InjectorInstance"),CK=Symbol("FactoryHasBeenDecorated");function EK(e,t){var n=e[SK];return n?n.get(t):null}var OK={cancelUncompleted:!1};function TK(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:OK;return function(t,n,i){var r,o=function(e){return e?new kK:null}(e.cancelUncompleted);function a(){null!==o&&o.cancelPreviousAction();var e=EK(this,Pz)||yK(),t=EK(this,Xl)||bK(),n=r.apply(this,arguments);return t.runOutsideAngular(function(){return wK(e,t,n,o)})}"function"==typeof(null==i?void 0:i.value)?(r=i.value,i.value=a):Object.defineProperty(t,n,{set:function(e){return r=e},get:function(){return a}}),function(e){if(!(CK in e.constructor.prototype)){var t=e.constructor;"function"==typeof t[xK]&&function(e){var t=e[xK];if("function"==typeof t){var n=e.\u0275prov||e.\u0275pipe||e.\u0275cmp||e.\u0275dir,i=function(){var e=t();return e[SK]=Os(Xa),e};n&&(n.factory=i),Object.defineProperty(e,xK,{get:function(){return i}})}}(t),e.constructor.prototype[CK]=!0}}(t)}}var PK=function(){var e=function(){function e(t){m(this,e),mK(t.injector),t.onDestroy(function(){mK(null)})}return b(e,null,[{key:"forRoot",value:function(){return{ngModule:e}}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Zi(Rc))},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({}),e}(),AK=function(){var e=function(){function e(){m(this,e),this._vertical=!1,this._inset=!1}return b(e,[{key:"vertical",get:function(){return this._vertical},set:function(e){this._vertical=Wd(e)}},{key:"inset",get:function(){return this._inset},set:function(e){this._inset=Wd(e)}}]),e}();return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=Ot({type:e,selectors:[["mat-divider"]],hostAttrs:["role","separator",1,"mat-divider"],hostVars:7,hostBindings:function(e,t){2&e&&(ks("aria-orientation",t.vertical?"vertical":"horizontal"),cu("mat-divider-vertical",t.vertical)("mat-divider-horizontal",!t.vertical)("mat-divider-inset",t.inset))},inputs:{vertical:"vertical",inset:"inset"},decls:0,vars:0,template:function(e,t){},styles:[".mat-divider{display:block;margin:0;border-top-width:1px;border-top-style:solid}.mat-divider.mat-divider-vertical{border-top:0;border-right-width:1px;border-right-style:solid}.mat-divider.mat-divider-inset{margin-left:80px}[dir=rtl] .mat-divider.mat-divider-inset{margin-left:auto;margin-right:80px}\n"],encapsulation:2,changeDetection:0}),e}(),MK=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({imports:[[rb],rb]}),e}(),IK=["*"],RK=[[["","mat-list-avatar",""],["","mat-list-icon",""],["","matListAvatar",""],["","matListIcon",""]],[["","mat-line",""],["","matLine",""]],"*"],DK=["[mat-list-avatar], [mat-list-icon], [matListAvatar], [matListIcon]","[mat-line], [matLine]","*"],NK=ob(sb(function(){return function e(){m(this,e)}}())),LK=sb(function(){return function e(){m(this,e)}}()),jK=new Ri("MatList"),FK=new Ri("MatNavList"),BK=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))._elementRef=e,i._stateChanges=new ae,"action-list"===i._getListType()&&e.nativeElement.classList.add("mat-action-list"),i}return b(n,[{key:"_getListType",value:function(){var e=this._elementRef.nativeElement.nodeName.toLowerCase();return"mat-list"===e?"list":"mat-action-list"===e?"action-list":null}},{key:"ngOnChanges",value:function(){this._stateChanges.next()}},{key:"ngOnDestroy",value:function(){this._stateChanges.complete()}}]),n}(NK);return e.\u0275fac=function(t){return new(t||e)(Os(Ju))},e.\u0275cmp=Ot({type:e,selectors:[["mat-list"],["mat-action-list"]],hostAttrs:[1,"mat-list","mat-list-base"],inputs:{disableRipple:"disableRipple",disabled:"disabled"},exportAs:["matList"],features:[Xu([{provide:jK,useExisting:e}]),cs,qt],ngContentSelectors:IK,decls:1,vars:0,template:function(e,t){1&e&&(Xs(),Ys(0))},styles:['.mat-subheader{display:flex;box-sizing:border-box;padding:16px;align-items:center}.mat-list-base .mat-subheader{margin:0}.mat-list-base{padding-top:8px;display:block;-webkit-tap-highlight-color:transparent}.mat-list-base .mat-subheader{height:48px;line-height:16px}.mat-list-base .mat-subheader:first-child{margin-top:-8px}.mat-list-base .mat-list-item,.mat-list-base .mat-list-option{display:block;height:48px;-webkit-tap-highlight-color:transparent;width:100%;padding:0}.mat-list-base .mat-list-item .mat-list-item-content,.mat-list-base .mat-list-option .mat-list-item-content{display:flex;flex-direction:row;align-items:center;box-sizing:border-box;padding:0 16px;position:relative;height:inherit}.mat-list-base .mat-list-item .mat-list-item-content-reverse,.mat-list-base .mat-list-option .mat-list-item-content-reverse{display:flex;align-items:center;padding:0 16px;flex-direction:row-reverse;justify-content:space-around}.mat-list-base .mat-list-item .mat-list-item-ripple,.mat-list-base .mat-list-option .mat-list-item-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none}.mat-list-base .mat-list-item.mat-list-item-with-avatar,.mat-list-base .mat-list-option.mat-list-item-with-avatar{height:56px}.mat-list-base .mat-list-item.mat-2-line,.mat-list-base .mat-list-option.mat-2-line{height:72px}.mat-list-base .mat-list-item.mat-3-line,.mat-list-base .mat-list-option.mat-3-line{height:88px}.mat-list-base .mat-list-item.mat-multi-line,.mat-list-base .mat-list-option.mat-multi-line{height:auto}.mat-list-base .mat-list-item.mat-multi-line .mat-list-item-content,.mat-list-base .mat-list-option.mat-multi-line .mat-list-item-content{padding-top:16px;padding-bottom:16px}.mat-list-base .mat-list-item .mat-list-text,.mat-list-base .mat-list-option .mat-list-text{display:flex;flex-direction:column;flex:auto;box-sizing:border-box;overflow:hidden;padding:0}.mat-list-base .mat-list-item .mat-list-text>*,.mat-list-base .mat-list-option .mat-list-text>*{margin:0;padding:0;font-weight:normal;font-size:inherit}.mat-list-base .mat-list-item .mat-list-text:empty,.mat-list-base .mat-list-option .mat-list-text:empty{display:none}.mat-list-base .mat-list-item.mat-list-item-with-avatar .mat-list-item-content .mat-list-text,.mat-list-base .mat-list-item.mat-list-option .mat-list-item-content .mat-list-text,.mat-list-base .mat-list-option.mat-list-item-with-avatar .mat-list-item-content .mat-list-text,.mat-list-base .mat-list-option.mat-list-option .mat-list-item-content .mat-list-text{padding-right:0;padding-left:16px}[dir=rtl] .mat-list-base .mat-list-item.mat-list-item-with-avatar .mat-list-item-content .mat-list-text,[dir=rtl] .mat-list-base .mat-list-item.mat-list-option .mat-list-item-content .mat-list-text,[dir=rtl] .mat-list-base .mat-list-option.mat-list-item-with-avatar .mat-list-item-content .mat-list-text,[dir=rtl] .mat-list-base .mat-list-option.mat-list-option .mat-list-item-content .mat-list-text{padding-right:16px;padding-left:0}.mat-list-base .mat-list-item.mat-list-item-with-avatar .mat-list-item-content-reverse .mat-list-text,.mat-list-base .mat-list-item.mat-list-option .mat-list-item-content-reverse .mat-list-text,.mat-list-base .mat-list-option.mat-list-item-with-avatar .mat-list-item-content-reverse .mat-list-text,.mat-list-base .mat-list-option.mat-list-option .mat-list-item-content-reverse .mat-list-text{padding-left:0;padding-right:16px}[dir=rtl] .mat-list-base .mat-list-item.mat-list-item-with-avatar .mat-list-item-content-reverse .mat-list-text,[dir=rtl] .mat-list-base .mat-list-item.mat-list-option .mat-list-item-content-reverse .mat-list-text,[dir=rtl] .mat-list-base .mat-list-option.mat-list-item-with-avatar .mat-list-item-content-reverse .mat-list-text,[dir=rtl] .mat-list-base .mat-list-option.mat-list-option .mat-list-item-content-reverse .mat-list-text{padding-right:0;padding-left:16px}.mat-list-base .mat-list-item.mat-list-item-with-avatar.mat-list-option .mat-list-item-content-reverse .mat-list-text,.mat-list-base .mat-list-item.mat-list-item-with-avatar.mat-list-option .mat-list-item-content .mat-list-text,.mat-list-base .mat-list-option.mat-list-item-with-avatar.mat-list-option .mat-list-item-content-reverse .mat-list-text,.mat-list-base .mat-list-option.mat-list-item-with-avatar.mat-list-option .mat-list-item-content .mat-list-text{padding-right:16px;padding-left:16px}.mat-list-base .mat-list-item .mat-list-avatar,.mat-list-base .mat-list-option .mat-list-avatar{flex-shrink:0;width:40px;height:40px;border-radius:50%;object-fit:cover}.mat-list-base .mat-list-item .mat-list-avatar~.mat-divider-inset,.mat-list-base .mat-list-option .mat-list-avatar~.mat-divider-inset{margin-left:72px;width:calc(100% - 72px)}[dir=rtl] .mat-list-base .mat-list-item .mat-list-avatar~.mat-divider-inset,[dir=rtl] .mat-list-base .mat-list-option .mat-list-avatar~.mat-divider-inset{margin-left:auto;margin-right:72px}.mat-list-base .mat-list-item .mat-list-icon,.mat-list-base .mat-list-option .mat-list-icon{flex-shrink:0;width:24px;height:24px;font-size:24px;box-sizing:content-box;border-radius:50%;padding:4px}.mat-list-base .mat-list-item .mat-list-icon~.mat-divider-inset,.mat-list-base .mat-list-option .mat-list-icon~.mat-divider-inset{margin-left:64px;width:calc(100% - 64px)}[dir=rtl] .mat-list-base .mat-list-item .mat-list-icon~.mat-divider-inset,[dir=rtl] .mat-list-base .mat-list-option .mat-list-icon~.mat-divider-inset{margin-left:auto;margin-right:64px}.mat-list-base .mat-list-item .mat-divider,.mat-list-base .mat-list-option .mat-divider{position:absolute;bottom:0;left:0;width:100%;margin:0}[dir=rtl] .mat-list-base .mat-list-item .mat-divider,[dir=rtl] .mat-list-base .mat-list-option .mat-divider{margin-left:auto;margin-right:0}.mat-list-base .mat-list-item .mat-divider.mat-divider-inset,.mat-list-base .mat-list-option .mat-divider.mat-divider-inset{position:absolute}.mat-list-base[dense]{padding-top:4px;display:block}.mat-list-base[dense] .mat-subheader{height:40px;line-height:8px}.mat-list-base[dense] .mat-subheader:first-child{margin-top:-4px}.mat-list-base[dense] .mat-list-item,.mat-list-base[dense] .mat-list-option{display:block;height:40px;-webkit-tap-highlight-color:transparent;width:100%;padding:0}.mat-list-base[dense] .mat-list-item .mat-list-item-content,.mat-list-base[dense] .mat-list-option .mat-list-item-content{display:flex;flex-direction:row;align-items:center;box-sizing:border-box;padding:0 16px;position:relative;height:inherit}.mat-list-base[dense] .mat-list-item .mat-list-item-content-reverse,.mat-list-base[dense] .mat-list-option .mat-list-item-content-reverse{display:flex;align-items:center;padding:0 16px;flex-direction:row-reverse;justify-content:space-around}.mat-list-base[dense] .mat-list-item .mat-list-item-ripple,.mat-list-base[dense] .mat-list-option .mat-list-item-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none}.mat-list-base[dense] .mat-list-item.mat-list-item-with-avatar,.mat-list-base[dense] .mat-list-option.mat-list-item-with-avatar{height:48px}.mat-list-base[dense] .mat-list-item.mat-2-line,.mat-list-base[dense] .mat-list-option.mat-2-line{height:60px}.mat-list-base[dense] .mat-list-item.mat-3-line,.mat-list-base[dense] .mat-list-option.mat-3-line{height:76px}.mat-list-base[dense] .mat-list-item.mat-multi-line,.mat-list-base[dense] .mat-list-option.mat-multi-line{height:auto}.mat-list-base[dense] .mat-list-item.mat-multi-line .mat-list-item-content,.mat-list-base[dense] .mat-list-option.mat-multi-line .mat-list-item-content{padding-top:16px;padding-bottom:16px}.mat-list-base[dense] .mat-list-item .mat-list-text,.mat-list-base[dense] .mat-list-option .mat-list-text{display:flex;flex-direction:column;flex:auto;box-sizing:border-box;overflow:hidden;padding:0}.mat-list-base[dense] .mat-list-item .mat-list-text>*,.mat-list-base[dense] .mat-list-option .mat-list-text>*{margin:0;padding:0;font-weight:normal;font-size:inherit}.mat-list-base[dense] .mat-list-item .mat-list-text:empty,.mat-list-base[dense] .mat-list-option .mat-list-text:empty{display:none}.mat-list-base[dense] .mat-list-item.mat-list-item-with-avatar .mat-list-item-content .mat-list-text,.mat-list-base[dense] .mat-list-item.mat-list-option .mat-list-item-content .mat-list-text,.mat-list-base[dense] .mat-list-option.mat-list-item-with-avatar .mat-list-item-content .mat-list-text,.mat-list-base[dense] .mat-list-option.mat-list-option .mat-list-item-content .mat-list-text{padding-right:0;padding-left:16px}[dir=rtl] .mat-list-base[dense] .mat-list-item.mat-list-item-with-avatar .mat-list-item-content .mat-list-text,[dir=rtl] .mat-list-base[dense] .mat-list-item.mat-list-option .mat-list-item-content .mat-list-text,[dir=rtl] .mat-list-base[dense] .mat-list-option.mat-list-item-with-avatar .mat-list-item-content .mat-list-text,[dir=rtl] .mat-list-base[dense] .mat-list-option.mat-list-option .mat-list-item-content .mat-list-text{padding-right:16px;padding-left:0}.mat-list-base[dense] .mat-list-item.mat-list-item-with-avatar .mat-list-item-content-reverse .mat-list-text,.mat-list-base[dense] .mat-list-item.mat-list-option .mat-list-item-content-reverse .mat-list-text,.mat-list-base[dense] .mat-list-option.mat-list-item-with-avatar .mat-list-item-content-reverse .mat-list-text,.mat-list-base[dense] .mat-list-option.mat-list-option .mat-list-item-content-reverse .mat-list-text{padding-left:0;padding-right:16px}[dir=rtl] .mat-list-base[dense] .mat-list-item.mat-list-item-with-avatar .mat-list-item-content-reverse .mat-list-text,[dir=rtl] .mat-list-base[dense] .mat-list-item.mat-list-option .mat-list-item-content-reverse .mat-list-text,[dir=rtl] .mat-list-base[dense] .mat-list-option.mat-list-item-with-avatar .mat-list-item-content-reverse .mat-list-text,[dir=rtl] .mat-list-base[dense] .mat-list-option.mat-list-option .mat-list-item-content-reverse .mat-list-text{padding-right:0;padding-left:16px}.mat-list-base[dense] .mat-list-item.mat-list-item-with-avatar.mat-list-option .mat-list-item-content-reverse .mat-list-text,.mat-list-base[dense] .mat-list-item.mat-list-item-with-avatar.mat-list-option .mat-list-item-content .mat-list-text,.mat-list-base[dense] .mat-list-option.mat-list-item-with-avatar.mat-list-option .mat-list-item-content-reverse .mat-list-text,.mat-list-base[dense] .mat-list-option.mat-list-item-with-avatar.mat-list-option .mat-list-item-content .mat-list-text{padding-right:16px;padding-left:16px}.mat-list-base[dense] .mat-list-item .mat-list-avatar,.mat-list-base[dense] .mat-list-option .mat-list-avatar{flex-shrink:0;width:36px;height:36px;border-radius:50%;object-fit:cover}.mat-list-base[dense] .mat-list-item .mat-list-avatar~.mat-divider-inset,.mat-list-base[dense] .mat-list-option .mat-list-avatar~.mat-divider-inset{margin-left:68px;width:calc(100% - 68px)}[dir=rtl] .mat-list-base[dense] .mat-list-item .mat-list-avatar~.mat-divider-inset,[dir=rtl] .mat-list-base[dense] .mat-list-option .mat-list-avatar~.mat-divider-inset{margin-left:auto;margin-right:68px}.mat-list-base[dense] .mat-list-item .mat-list-icon,.mat-list-base[dense] .mat-list-option .mat-list-icon{flex-shrink:0;width:20px;height:20px;font-size:20px;box-sizing:content-box;border-radius:50%;padding:4px}.mat-list-base[dense] .mat-list-item .mat-list-icon~.mat-divider-inset,.mat-list-base[dense] .mat-list-option .mat-list-icon~.mat-divider-inset{margin-left:60px;width:calc(100% - 60px)}[dir=rtl] .mat-list-base[dense] .mat-list-item .mat-list-icon~.mat-divider-inset,[dir=rtl] .mat-list-base[dense] .mat-list-option .mat-list-icon~.mat-divider-inset{margin-left:auto;margin-right:60px}.mat-list-base[dense] .mat-list-item .mat-divider,.mat-list-base[dense] .mat-list-option .mat-divider{position:absolute;bottom:0;left:0;width:100%;margin:0}[dir=rtl] .mat-list-base[dense] .mat-list-item .mat-divider,[dir=rtl] .mat-list-base[dense] .mat-list-option .mat-divider{margin-left:auto;margin-right:0}.mat-list-base[dense] .mat-list-item .mat-divider.mat-divider-inset,.mat-list-base[dense] .mat-list-option .mat-divider.mat-divider-inset{position:absolute}.mat-nav-list a{text-decoration:none;color:inherit}.mat-nav-list .mat-list-item{cursor:pointer;outline:none}mat-action-list button{background:none;color:inherit;border:none;font:inherit;outline:inherit;-webkit-tap-highlight-color:transparent;text-align:left}[dir=rtl] mat-action-list button{text-align:right}mat-action-list button::-moz-focus-inner{border:0}mat-action-list .mat-list-item{cursor:pointer;outline:inherit}.mat-list-option:not(.mat-list-item-disabled){cursor:pointer;outline:none}.mat-list-item-disabled{pointer-events:none}.cdk-high-contrast-active .mat-list-item-disabled{opacity:.5}.cdk-high-contrast-active :host .mat-list-item-disabled{opacity:.5}.cdk-high-contrast-active .mat-selection-list:focus{outline-style:dotted}.cdk-high-contrast-active .mat-list-option:hover,.cdk-high-contrast-active .mat-list-option:focus,.cdk-high-contrast-active .mat-nav-list .mat-list-item:hover,.cdk-high-contrast-active .mat-nav-list .mat-list-item:focus,.cdk-high-contrast-active mat-action-list .mat-list-item:hover,.cdk-high-contrast-active mat-action-list .mat-list-item:focus{outline:dotted 1px}.cdk-high-contrast-active .mat-list-single-selected-option::after{content:"";position:absolute;top:50%;right:16px;transform:translateY(-50%);width:10px;height:0;border-bottom:solid 10px;border-radius:10px}.cdk-high-contrast-active [dir=rtl] .mat-list-single-selected-option::after{right:auto;left:16px}@media(hover: none){.mat-list-option:not(.mat-list-single-selected-option):not(.mat-list-item-disabled):hover,.mat-nav-list .mat-list-item:not(.mat-list-item-disabled):hover,.mat-action-list .mat-list-item:not(.mat-list-item-disabled):hover{background:none}}\n'],encapsulation:2,changeDetection:0}),e}(),VK=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275dir=Rt({type:e,selectors:[["","mat-list-avatar",""],["","matListAvatar",""]],hostAttrs:[1,"mat-list-avatar"]}),e}(),zK=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275dir=Rt({type:e,selectors:[["","mat-list-icon",""],["","matListIcon",""]],hostAttrs:[1,"mat-list-icon"]}),e}(),UK=function(){var e=function(e){a(n,e);var t=s(n);function n(e,i,r,o){var a;m(this,n),(a=t.call(this))._element=e,a._isInteractiveList=!1,a._destroyed=new ae,a._disabled=!1,a._isInteractiveList=!!(r||o&&"action-list"===o._getListType()),a._list=r||o;var s=a._getHostElement();return"button"===s.nodeName.toLowerCase()&&!s.hasAttribute("type")&&s.setAttribute("type","button"),a._list&&a._list._stateChanges.pipe(kf(a._destroyed)).subscribe(function(){i.markForCheck()}),a}return b(n,[{key:"disabled",get:function(){return this._disabled||!(!this._list||!this._list.disabled)},set:function(e){this._disabled=Wd(e)}},{key:"ngAfterContentInit",value:function(){!function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"mat";e.changes.pipe(Ef(e)).subscribe(function(e){var i=e.length;db(t,"".concat(n,"-2-line"),!1),db(t,"".concat(n,"-3-line"),!1),db(t,"".concat(n,"-multi-line"),!1),2===i||3===i?db(t,"".concat(n,"-").concat(i,"-line"),!0):i>3&&db(t,"".concat(n,"-multi-line"),!0)})}(this._lines,this._element)}},{key:"ngOnDestroy",value:function(){this._destroyed.next(),this._destroyed.complete()}},{key:"_isRippleDisabled",value:function(){return!this._isInteractiveList||this.disableRipple||!(!this._list||!this._list.disableRipple)}},{key:"_getHostElement",value:function(){return this._element.nativeElement}}]),n}(LK);return e.\u0275fac=function(t){return new(t||e)(Os(Ju),Os(Cc),Os(FK,8),Os(jK,8))},e.\u0275cmp=Ot({type:e,selectors:[["mat-list-item"],["a","mat-list-item",""],["button","mat-list-item",""]],contentQueries:function(e,t,n){var i;(1&e&&(bl(n,VK,5),bl(n,zK,5),bl(n,hb,5)),2&e)&&(ml(i=_l())&&(t._avatar=i.first),ml(i=_l())&&(t._icon=i.first),ml(i=_l())&&(t._lines=i))},hostAttrs:[1,"mat-list-item","mat-focus-indicator"],hostVars:6,hostBindings:function(e,t){2&e&&cu("mat-list-item-disabled",t.disabled)("mat-list-item-avatar",t._avatar||t._icon)("mat-list-item-with-avatar",t._avatar||t._icon)},inputs:{disableRipple:"disableRipple",disabled:"disabled"},exportAs:["matListItem"],features:[cs],ngContentSelectors:DK,decls:6,vars:2,consts:[[1,"mat-list-item-content"],["mat-ripple","",1,"mat-list-item-ripple",3,"matRippleTrigger","matRippleDisabled"],[1,"mat-list-text"]],template:function(e,t){1&e&&(Xs(RK),As(0,"div",0),Is(1,"div",1),Ys(2),As(3,"div",2),Ys(4,1),Ms(),Ys(5,2),Ms()),2&e&&(Yo(1),Ts("matRippleTrigger",t._getHostElement())("matRippleDisabled",t._isRippleDisabled()))},directives:[wb],encapsulation:2,changeDetection:0}),e}(),HK=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({imports:[[fb,kb,rb,Sb,cd],fb,rb,Sb,MK]}),e}(),GK=["input"],WK=function(e){return{enterDuration:e}},qK=["*"],XK=new Ri("mat-checkbox-default-options",{providedIn:"root",factory:YK});function YK(){return{color:"accent",clickAction:"check-indeterminate"}}var KK=0,$K={color:"accent",clickAction:"check-indeterminate"},QK={provide:Hz,useExisting:He(function(){return e$}),multi:!0},ZK=function e(){m(this,e)},JK=ub(ab(sb(ob(function(){return function e(t){m(this,e),this._elementRef=t}}())))),e$=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-"+ ++KK,c.id=c._uniqueId,c.labelPosition="after",c.name=null,c.change=new ol,c.indeterminateChange=new ol,c._onTouched=function(){},c._currentAnimationClass="",c._currentCheckState=0,c._controlValueAccessorChangeFn=function(){},c._checked=!1,c._disabled=!1,c._indeterminate=!1,c._options=c._options||$K,c.color=c.defaultColor=c._options.color||$K.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=Wd(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=Wd(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=Wd(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 ZK;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}(JK);return e.\u0275fac=function(t){return new(t||e)(Os(Ju),Os(Cc),Os(rg),Os(Xl),Ai("tabindex"),Os(Yy,8),Os(XK,8))},e.\u0275cmp=Ot({type:e,selectors:[["mat-checkbox"]],viewQuery:function(e,t){var n;(1&e&&(yl(GK,5),yl(wb,5)),2&e)&&(ml(n=_l())&&(t._inputElement=n.first),ml(n=_l())&&(t.ripple=n.first))},hostAttrs:[1,"mat-checkbox"],hostVars:12,hostBindings:function(e,t){2&e&&(Au("id",t.id),ks("tabindex",null),cu("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:[Xu([QK]),cs],ngContentSelectors:qK,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&&(Xs(),As(0,"label",0,1),As(2,"span",2),As(3,"input",3,4),Vs("change",function(e){return t._onInteractionEvent(e)})("click",function(e){return t._onInputClick(e)}),Ms(),As(5,"span",5),Is(6,"span",6),Ms(),Is(7,"span",7),As(8,"span",8),Xn(),As(9,"svg",9),Is(10,"path",10),Ms(),vn.lFrame.currentNamespace=null,Is(11,"span",11),Ms(),Ms(),As(12,"span",12,13),Vs("cdkObserveContent",function(){return t._onLabelTextChange()}),As(14,"span",14),Cu(15,"\xa0"),Ms(),Ys(16),Ms(),Ms()),2&e){var n=Es(1),i=Es(13);ks("for",t.inputId),Yo(2),cu("mat-checkbox-inner-container-no-side-margin",!i.textContent||!i.textContent.trim()),Yo(1),Ts("id",t.inputId)("required",t.required)("checked",t.checked)("disabled",t.disabled)("tabIndex",t.tabIndex),ks("value",t.value)("name",t.name)("aria-label",t.ariaLabel||null)("aria-labelledby",t.ariaLabelledby)("aria-checked",t._getAriaChecked())("aria-describedby",t.ariaDescribedby),Yo(2),Ts("matRippleTrigger",n)("matRippleDisabled",t._isRippleDisabled())("matRippleRadius",20)("matRippleCentered",!0)("matRippleAnimation",$c(19,WK,"NoopAnimations"===t._animationMode?0:150))}},directives:[wb,Pv],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}(),t$=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({}),e}(),n$=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({imports:[[kb,rb,Av,t$],rb,t$]}),e}(),i$=["bodyCanvas"],r$=function(){var e=function(){function e(){m(this,e),this.clsName="ccf-body-ui",this.rotationChange=new ol,this.nodeDrag=new ol,this.nodeClick=new ol,this.nodeHoverStart=new ol,this.nodeHoverStop=new ol,this.initialized=new ol,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 Dw(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 lV({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.target&&this.bodyUI.setTarget(this.target),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)})],this.initialized.emit();case 11: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=Ot({type:e,selectors:[["ccf-body-ui"]],viewQuery:function(e,t){var n;(1&e&&yl(i$,5,Ju),2&e)&&(ml(n=_l())&&(t.bodyCanvas=n.first))},hostVars:2,hostBindings:function(e,t){2&e&&du(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",initialized:"initialized"},decls:2,vars:0,consts:[[1,"body-ui"],["bodyCanvas",""]],template:function(e,t){1&e&&Is(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}(),o$=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({imports:[[cd]]}),e}();new Ri("Maximum number of autocomplete options displayed",{providedIn:"root",factory:function(){return 10}});var a$=["carouselContainer"],s$=["itemlist"],u$=["itemcontainer"];function c$(e,t){if(1&e){var n=Ls();As(0,"mat-icon",9),Vs("touchstart",function(){return bn(n),Ws().scroll("left")})("touchend",function(){return bn(n),Ws().stopScroll()})("click",function(){return bn(n),Ws().shift("left")})("mousedown",function(){return bn(n),Ws().scroll("left")})("mouseup",function(){return bn(n),Ws().stopScroll()}),Cu(1,"chevron_left"),Ms()}2&e&&cu("disabled",Ws().onLeft)}function l$(e,t){if(1&e&&(As(0,"div",15),Cu(1),Ms()),2&e){var n=Ws().$implicit,i=Ws();Yo(1),Eu(i.occurenceData[n.id]||0)}}function h$(e,t){if(1&e){var n=Ls();As(0,"div",10),Vs("click",function(){var e=bn(n).$implicit;return Ws().selectOrgan(e)}),Is(1,"mat-icon",11),As(2,"div",12),As(3,"div",13),Cu(4),Ms(),Cs(5,l$,2,1,"div",14),Ms(),Ms()}if(2&e){var i=t.$implicit,r=Ws();cu("disabled",i.disabled)("selected",r.isSelected(i)),Yo(1),Ks("svgIcon",i.src),Yo(3),Eu(i.name),Yo(1),Ts("ngIf",void 0!==i.numResults)}}function d$(e,t){if(1&e){var n=Ls();As(0,"mat-icon",16),Vs("touchstart",function(){return bn(n),Ws().scroll("right")})("touchend",function(){return bn(n),Ws().stopScroll()})("click",function(){return bn(n),Ws().shift("right")})("mousedown",function(){return bn(n),Ws().scroll("right")})("mouseup",function(){return bn(n),Ws().stopScroll()}),Cu(1,"chevron_right"),Ms()}2&e&&cu("disabled",Ws().onRight)}var f$=[{src:"app:skin",organ:"Skin",name:"Skin",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002097"},{src:"app:brain",organ:"Brain",name:"Brain",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000955"},{disabled:!0,src:"app:lymph-nodes",organ:"Lymph Node",name:"Lymph Node",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000029"},{src:"app:lymph-nodes",organ:"Lymph Node",name:"Lymph Node",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002509"},{disabled:!0,src:"app:eye",organ:"Eye",name:"Eye, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000970"},{src:"app:eye",organ:"Eye",name:"Eye, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0004548"},{src:"app:eye",organ:"Eye",name:"Eye, R",side:"right",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0004549"},{disabled:!0,src:"app:fallopian-tube-left",organ:"Fallopian Tube",name:"Fallopian Tube, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0003889"},{src:"app:fallopian-tube-left",organ:"Fallopian Tube",name:"Fallopian Tube, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0001303"},{src:"app:fallopian-tube-right",organ:"Fallopian Tube",name:"Fallopian Tube, R",side:"right",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0001302"},{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, L",side:"left",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"},{disabled:!0,src:"app:knee",organ:"Knee",name:"Knee, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001465"},{src:"app:knee",organ:"Knee",name:"Knee, L",side:"left",hasSex:!0,id:"http://purl.org/sig/ont/fma/fma24978"},{src:"app:knee",organ:"Knee",name:"Knee, R",side:"right",hasSex:!0,id:"http://purl.org/sig/ont/fma/fma24977"},{src:"app:liver",organ:"Liver",name:"Liver",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002107"},{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"},{disabled:!0,src:"app:mammary-gland",organ:"Mammary Gland",name:"Mammary Gland, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0001911"},{src:"app:mammary-gland",organ:"Mammary Gland",name:"Mammary Gland, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.org/sig/ont/fma/fma57991"},{src:"app:mammary-gland",organ:"Mammary Gland",name:"Mammary Gland, R",side:"right",hasSex:!1,sex:"female",id:"http://purl.org/sig/ont/fma/fma57987"},{disabled:!0,src:"app:ovary-left",organ:"Ovary",name:"Ovary, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0000992"},{src:"app:ovary-left",organ:"Ovary",name:"Ovary, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.org/sig/ont/fma/fma7214"},{src:"app:ovary-right",organ:"Ovary",name:"Ovary, R",side:"right",hasSex:!1,sex:"female",id:"http://purl.org/sig/ont/fma/fma7213"},{src:"app:pancreas",organ:"Pancreas",name:"Pancreas",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001264"},{src:"app:pelvis-f",organ:"Pelvis",name:"Pelvis",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001270"},{src:"app:placenta",organ:"Placenta",name:"Placenta",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0001987"},{src:"app:prostate",organ:"Prostate",name:"Prostate",hasSex:!1,sex:"male",id:"http://purl.obolibrary.org/obo/UBERON_0002367",disabled:!0},{src:"app:prostate",organ:"Prostate",name:"Prostate",hasSex:!1,sex:"male",id:"http://purl.obolibrary.org/obo/UBERON_0000079"},{src:"app:small-intestine",organ:"Small Intestine",name:"Small Intestine",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002108"},{src:"app:large-intestine",organ:"Large Intestine",name:"Large Intestine",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000059"},{src:"app:spinal-cord",organ:"Spinal Cord",name:"Spinal Cord",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002240"},{src:"app:spleen",organ:"Spleen",name:"Spleen",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002106"},{src:"app:thymus",organ:"Thymus",name:"Thymus",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002370"},{disabled:!0,src:"app:ureter-left",organ:"Ureter",name:"Ureter, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000056"},{src:"app:ureter-left",organ:"Ureter",name:"Ureter, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001223"},{src:"app:ureter-right",organ:"Ureter",name:"Ureter, R",side:"right",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001222"},{src:"app:bladder",organ:"Urinary Bladder",name:"Urinary Bladder",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001255"},{src:"app:uterus",organ:"Uterus",name:"Uterus",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0000995"},{src:"app:vasculature-thick",organ:"Blood Vasculature",name:"Blood Vasculature",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0004537"},{disabled:!0,src:"app:vasculature-thick",organ:"Blood Vasculature",name:"Blood Vasculature",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002049"}].sort(function(e,t){return e.name.localeCompare(t.name)}),p$=f$.filter(function(e){return!0!==e.disabled}),v$=function(){var e=function(){function e(){m(this,e),this.clsName="ccf-organ-selector",this.multiselect=!1,this.displayErrors=!1,this.organList=p$,this.selectedOrgans=[],this.expanded=!1,this.organsChanged=new ol,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 pG.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=Ot({type:e,selectors:[["ccf-organ-selector"]],viewQuery:function(e,t){var n;(1&e&&(yl(a$,7),yl(s$,7),yl(u$,7)),2&e)&&(ml(n=_l())&&(t.carouselContainer=n.first),ml(n=_l())&&(t.itemList=n.first),ml(n=_l())&&(t.itemContainer=n.first))},hostVars:2,hostBindings:function(e,t){2&e&&du(t.clsName)},inputs:{multiselect:"multiselect",displayErrors:"displayErrors",organList:"organList",selectedOrgans:"selectedOrgans",expanded:"expanded",occurenceData:"occurenceData"},outputs:{organsChanged:"organsChanged"},features:[qt],decls:9,vars:8,consts:[["matTooltip","Select the organ your tissue block is from.",1,"container",3,"matTooltipDisabled"],["carouselContainer",""],["class","carousel-left-icon",3,"disabled","touchstart","touchend","click","mousedown","mouseup",4,"ngIf"],[1,"carousel-item-container"],["itemcontainer",""],[1,"carousel-item-list"],["itemlist",""],["class","carousel-item",3,"disabled","selected","click",4,"ngFor","ngForOf"],["class","carousel-right-icon",3,"disabled","touchstart","touchend","click","mousedown","mouseup",4,"ngIf"],[1,"carousel-left-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"],[1,"carousel-right-icon",3,"touchstart","touchend","click","mousedown","mouseup"]],template:function(e,t){1&e&&(As(0,"div",0,1),Cs(2,c$,2,2,"mat-icon",2),As(3,"div",3,4),As(5,"div",5,6),Cs(7,h$,6,7,"div",7),Ms(),Ms(),Cs(8,d$,2,2,"mat-icon",8),Ms()),2&e&&(cu("expanded",t.expanded)("error",t.error),Ts("matTooltipDisabled",t.multiselect),Yo(2),Ts("ngIf",!t.expanded),Yo(5),Ts("ngForOf",t.organList),Yo(1),Ts("ngIf",!t.expanded))},directives:[Ow,Yh,qh,B_],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:5rem;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}[_nghost-%COMP%] .expanded[_ngcontent-%COMP%] .carousel-item-container[_ngcontent-%COMP%]{width:100%!important}[_nghost-%COMP%] .expanded[_ngcontent-%COMP%] .carousel-item-container[_ngcontent-%COMP%] .carousel-item-list[_ngcontent-%COMP%]{flex-wrap:wrap;overflow:auto;left:0rem!important}[_nghost-%COMP%] .expanded[_ngcontent-%COMP%] .carousel-item-container[_ngcontent-%COMP%] .carousel-item-list[_ngcontent-%COMP%] .carousel-item[_ngcontent-%COMP%]{height:5rem}"]}),e}(),g$=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({imports:[[cd,V_,Aw]]}),e}(),m$=function(){var e=function(){function e(){m(this,e),this.clsName="ccf-opacity-slider",this.opacity=20,this.visible=!0,this.opacityChange=new ol,this.visibilityToggle=new ol,this.opacityReset=new ol}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=Ot({type:e,selectors:[["ccf-opacity-slider"]],hostVars:2,hostBindings:function(e,t){2&e&&du(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&&(As(0,"div",0),As(1,"div",1),As(2,"mat-slider",2),Vs("input",function(e){return t.changeOpacity(e.value)}),Ms(),As(3,"span",3),Cu(4),Ms(),Ms(),As(5,"div",4),As(6,"mat-icon",5),Vs("click",function(){return t.toggleVisibility()}),Ms(),As(7,"mat-icon",6),Vs("click",function(){return t.toggleVisibility()}),Ms(),As(8,"mat-icon",7),Vs("click",function(){return t.resetOpacity()}),Cu(9,"refresh"),Ms(),Ms(),Ms()),2&e&&(Yo(2),cu("disabled",!t.visible),Ts("step",1)("min",0)("max",100)("value",t.opacity),Yo(2),Ou("",t.opacity,"%"),Yo(2),cu("hidden",t.visible),Ts("matRippleCentered",!0)("matRippleUnbounded",!0),Yo(1),cu("hidden",!t.visible),Ts("matRippleCentered",!0)("matRippleUnbounded",!0),Yo(1),Ts("matRippleCentered",!0)("matRippleUnbounded",!0))},directives:[_G,B_,wb],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}(),y$=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({imports:[[cd,V_,SG,kb]]}),e}();function b$(e,t){if(1&e&&(As(0,"div",16),Is(1,"youtube-player",17),Ms()),2&e){var n=Ws(3);Yo(1),Ks("videoId",n.videoID)}}function _$(e,t){if(1&e&&(As(0,"mat-expansion-panel",11),As(1,"mat-expansion-panel-header"),As(2,"h2",12),Cu(3),Ms(),Ms(),As(4,"div",13),Is(5,"markdown",14),Cs(6,b$,2,1,"div",15),Ms(),Ms()),2&e){var n=Ws(),i=n.index,r=n.$implicit;Ts("expanded",0===i),Yo(3),Eu(r.title),Yo(2),cu("first",0===i),Ts("data",r.content),Yo(1),Ts("ngIf",0===i)}}function w$(e,t){if(1&e&&(As(0,"div",9),Cs(1,_$,7,6,"mat-expansion-panel",10),Ms()),2&e){var n=t.$implicit;Yo(1),Ts("ngIf",n)}}var k$=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)(Os(MG),Os(RG))},e.\u0275cmp=Ot({type:e,selectors:[["ccf-info-dialog"]],decls:11,vars:2,consts:[[1,"rui-about","wrapper"],[1,"container"],[1,"content"],[1,"header"],["mat-dialog-title","",1,"title"],[1,"close"],[1,"material-icons","close-icon",3,"click"],[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&&(As(0,"div",0),As(1,"div",1),As(2,"div",2),As(3,"div",3),As(4,"h2",4),Cu(5),Ms(),As(6,"div",5),As(7,"mat-icon",6),Vs("click",function(){return t.close()}),Cu(8,"clear"),Ms(),Ms(),Ms(),As(9,"mat-dialog-content",7),Cs(10,w$,2,1,"div",8),Ms(),Ms(),Ms(),Ms()),2&e&&(Yo(5),Eu(t.infoTitle),Yo(5),Ts("ngForOf",t.documentationContents))},directives:[VG,B_,zG,qh,Yh,aW,uW,gW,OW],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%] .content[_ngcontent-%COMP%] .header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;height:3rem;margin-bottom:2.25rem;position:relative}.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%]{cursor:pointer;height:3rem;width:3rem;line-height:3rem;text-align:center;transition:.6s}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-size:1.5rem;margin:0 auto;line-height:3rem;height:3rem;justify-self:center;display:flex}.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;display:flex}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .dialog-content[_ngcontent-%COMP%] .variable-binding.first[_ngcontent-%COMP%]{padding-right:1rem;width:73%}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .dialog-content[_ngcontent-%COMP%] .variable-binding[_ngcontent-%COMP%] ul{margin:0}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .dialog-content[_ngcontent-%COMP%] .variable-binding[_ngcontent-%COMP%] img{margin-left:1rem;float:right}.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%}"]}),e}(),x$=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({imports:[[cd,UG,V_,cW,MW,mW.forRoot({})]]}),e}(),S$=function(){var e=function(){function e(t){m(this,e),this.http=t,this.panelContent=new vv({content:[],infoTitle:"",videoID:""})}return b(e,[{key:"updateData",value:function(e,t,n){var i=this;this.http.get(e,{responseType:"text"}).subscribe(function(e){var r={content:i.parseMarkdown(e),infoTitle:n,videoID:t};i.panelContent.next(r)})}},{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.includes("\n\n")?"\n\n":"\r\n\r\n",a=r.split(o);n.push({title:a[0],content:a.splice(1).join(o)})}}}catch(s){i.e(s)}finally{i.f()}return n}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Zi(h_))},e.\u0275prov=$e({token:e,factory:e.\u0275fac,providedIn:"root"}),e}(),C$=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 q,this.subscriptions.add(n.panelContent.subscribe(function(e){e.content.length&&i.launchInfoDialog(e)}))}return b(e,[{key:"ngOnDestroy",value:function(){this.subscriptions.unsubscribe()}},{key:"launchInfoDialog",value:function(e){0==this.dialog.openDialogs.length&&this.dialog.open(k$,{autoFocus:!1,panelClass:"modal-animated",width:"72rem",data:{title:e.infoTitle,content:e.content,videoID:e.videoID}})}},{key:"onDialogButtonClick",value:function(){this.infoButtonService.updateData(this.documentationUrl,this.videoID,this.infoTitle)}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Os(FG),Os(S$))},e.\u0275cmp=Ot({type:e,selectors:[["ccf-info-button"]],inputs:{infoTitle:"infoTitle",videoID:"videoID",documentationUrl:"documentationUrl"},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&&(As(0,"div",0),As(1,"mat-icon",1),Vs("click",function(){return t.onDialogButtonClick()}),Cu(2," info "),Ms(),Ms())},directives:[B_],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}(),E$=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({imports:[[cd,x$,V_,S_]]}),e}(),O$=function(){var e=function(){function e(){m(this,e),this.clsName="ccf-call-to-action",this.callToActionClicked=new ol,this.closeClicked=new ol}return b(e,[{key:"close",value:function(){this.closeClicked.emit()}},{key:"onDialogButtonClick",value:function(){this.callToActionClicked.emit()}}]),e}();return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=Ot({type:e,selectors:[["ccf-call-to-action"]],hostVars:2,hostBindings:function(e,t){2&e&&du(t.clsName)},inputs:{infoTitle:"infoTitle",imageUrl:"imageUrl",message:"message",callToAction:"callToAction"},outputs:{callToActionClicked:"callToActionClicked",closeClicked:"closeClicked"},decls:13,vars:4,consts:[[1,"rui-about","wrapper"],[1,"container"],[1,"content"],[1,"first-row"],["mat-dialog-title","",1,"title"],[1,"cta-mat-icon","material-icons","close-icon",3,"click"],["mat-card-sm-image","","alt","preview","layout-fill","",1,"cta-image",3,"src"],[1,"mat-typography","dialog-content"],[1,"message"],["mat-button","",1,"mat-button",3,"text","click"]],template:function(e,t){1&e&&(As(0,"div",0),As(1,"div",1),As(2,"div",2),As(3,"div",3),As(4,"p",4),Cu(5),Ms(),As(6,"mat-icon",5),Vs("click",function(){return t.close()}),Cu(7,"clear"),Ms(),Ms(),Is(8,"img",6),As(9,"mat-dialog-content",7),As(10,"div",8),Cu(11),Ms(),As(12,"a",9),Vs("click",function(){return t.onDialogButtonClick()}),Ms(),Ms(),Ms(),Ms(),Ms()),2&e&&(Yo(5),Eu(t.infoTitle),Yo(3),Ts("src",t.imageUrl,Xr),Yo(3),Ou(" ",t.message,""),Yo(1),Ts("text",t.callToAction))},directives:[VG,B_,IW,zG],styles:["[_nghost-%COMP%] .content[_ngcontent-%COMP%]{display:block;align-content:center;padding-left:1.6rem;padding-right:1.6rem;border-radius:.25rem}[_nghost-%COMP%] .info-button-wrapper[_ngcontent-%COMP%]{border-radius:.25rem;padding:.6rem;transition:.6s}[_nghost-%COMP%] .info-button-wrapper[_ngcontent-%COMP%] .ccf-info-button[_ngcontent-%COMP%]{cursor:pointer;transition:color .6s;font-size:1.2rem;vertical-align:sub}[_nghost-%COMP%] .first-row[_ngcontent-%COMP%]{display:flex;width:100%;line-height:.9rem}[_nghost-%COMP%] .first-row[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{padding-right:7rem;padding-left:.2rem;font-size:.875rem;padding-top:.75rem}[_nghost-%COMP%] .first-row[_ngcontent-%COMP%] .cta-mat-icon[_ngcontent-%COMP%]{height:30%;line-height:3.4rem}[_nghost-%COMP%] .message[_ngcontent-%COMP%]{padding:.5rem}[_nghost-%COMP%] .cta-image[_ngcontent-%COMP%]{align-self:center;-o-object-fit:cover;object-fit:cover;width:100%;border-radius:.25rem}[_nghost-%COMP%] .mat-button[_ngcontent-%COMP%]{background-color:#444a65;font-size:.75rem;position:relative;margin-bottom:1rem;width:100%;height:2rem;color:#fff}"],changeDetection:0}),e}(),T$=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(fq(),zf(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(cG.apply(void 0,v(e)),lf(),zf(1))}},{key:"getOption",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n1&&void 0!==arguments[1]?arguments[1]:ff,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:lG;return function(i){return i.lift(new hG(e,t,n.leading,n.trailing))}}(1e3),ce(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)(Zi(bh),Zi(yq))},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({}),e}();function A$(e,t){if(1&e){var n=Ls();As(0,"button",1),Vs("click",function(){return bn(n),Ws().submit(!0)}),Cu(1),Ms()}if(2&e){var i=Ws();Yo(1),Ou(" ","not-set"===i.allowTelemetry?"I understand":"Opt in","\n")}}function M$(e,t){if(1&e){var n=Ls();As(0,"button",1),Vs("click",function(){return bn(n),Ws().submit(!1)}),Cu(1,"Opt out"),Ms()}}var I$=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)(Os(Ju),Os(wq),Os(lw))},e.\u0275cmp=Ot({type:e,selectors:[["ccf-tracking-popup"]],hostVars:2,hostBindings:function(e,t){2&e&&du(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&&(As(0,"p"),Cu(1,"We log usage to improve this service."),Ms(),Cs(2,A$,2,1,"button",0),Cs(3,M$,2,0,"button",0)),2&e&&(Yo(2),Ts("ngIf",t.showButton("opt-in")),Yo(1),Ts("ngIf",t.showButton("opt-out")))},directives:[Yh,q_],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}(),R$=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({imports:[[cd,Y_]]}),e}(),D$=function(e){a(n,e);var t=s(n);function n(){return m(this,n),t.apply(this,arguments)}return b(n,[{key:"forwardCall",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;it?e[0]:void 0,max:e[1]0}),Of(function(e){return function(e,t){return new te(function(n){var i,r;try{i=e()}catch(a){return void n.error(a)}try{r=t(i)}catch(a){return void n.error(a)}var o=(r?ye(r):Mf).subscribe(n);return function(){o.unsubscribe(),i&&i.unsubscribe()}})}(function(){return i.createDatabase(e)},function(t){return i.connectDatabase(t,e)})}),ce(function(e){return e.database}),zf(1)),i}return b(n,[{key:"connectDatabase",value:function(e,t){return Dw(this,void 0,void 0,regeneratorRuntime.mark(function n(){var i;return regeneratorRuntime.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return i=!ah(),n.next=3,e.database.connect(t,i);case 3:return n.abrupt("return",e);case 4:case"end":return n.stop()}},n)}))}}]),n}(D$);return e.\u0275fac=function(t){return new(t||e)(Zi(T$))},e.\u0275prov=$e({token:e,factory:e.\u0275fac}),e}(),G$=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:"createDatabase",value:function(e){return{database:new UY(e),unsubscribe:function(){}}}}]),n}(H$);return t.\u0275fac=function(n){return(e||(e=Ti(t)))(n||t)},t.\u0275prov=$e({token:t,factory:t.\u0275fac,providedIn:"root"}),t}(),W$=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:"createDatabase",value:function(e){var t=this.createWorker(e),n=aK(t);return{database:n,unsubscribe:function(){n[eK](),t.terminate()}}}}]),n}(H$);return t.\u0275fac=function(n){return(e||(e=Ti(t)))(n||t)},t.\u0275prov=$e({token:t,factory:t.\u0275fac}),t}(),q$=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)).impl$=e.config$.pipe(function(e){return e},ce(function(e){return r.selectToken(e)}),lf(),ce(function(e){return i.get(e)}),zf(1)),r}return n}(D$);return e.\u0275fac=function(t){return new(t||e)(Zi(T$),Zi(ss))},e.\u0275prov=$e({token:e,factory:e.\u0275fac}),e}(),X$=function(){var e=function e(){m(this,e)};return e.type="[CallToAction] Learn More",e}(),Y$=function(){var e=function e(){m(this,e)};return e.type="[CallToAction] Open Dialog",e}(),K$=function(){var e=function e(){m(this,e)};return e.type="[CallToAction] Close Dialog",e}(),$$=function(){function e(){m(this,e)}return b(e,[{key:"length",get:function(){var t,n;return null!==(n=null===(t=e.storage)||void 0===t?void 0:t.length)&&void 0!==n?n:0}},{key:"key",value:function(t){var n,i;return null!==(i=null===(n=e.storage)||void 0===n?void 0:n.key(t))&&void 0!==i?i:null}},{key:"getItem",value:function(t,n){var i,r,o;return null!==(o=null!==(r=null===(i=e.storage)||void 0===i?void 0:i.getItem(t))&&void 0!==r?r:n)&&void 0!==o?o:null}},{key:"setItem",value:function(t,n){var i;try{return null===(i=e.storage)||void 0===i||i.setItem(t,n),!0}catch(r){return!1}}},{key:"removeItem",value:function(t){var n;null===(n=e.storage)||void 0===n||n.removeItem(t)}},{key:"clear",value:function(){var t;null===(t=e.storage)||void 0===t||t.clear()}}]),e}();$$.storage=function(){var e;try{e=window.localStorage;var t="__storage_test__";return e.setItem(t,t),e.removeItem(t),e}catch(t){return t instanceof DOMException&&(22===t.code||1014===t.code||"QuotaExceededError"===t.name||"NS_ERROR_DOM_QUOTA_REACHED"===t.name)&&e&&0!==e.length?e:void 0}}(),$$.\u0275fac=function(e){return new(e||$$)},$$.\u0275prov=$e({token:$$,factory:$$.\u0275fac,providedIn:"root"});var Q$="callToActionPopupShown",Z$=z$=function(){function e(t,n,i,r,o){m(this,e),this.dialog=t,this.ga=n,this.storage=i,this.infoService=r,this.http=o}return b(e,[{key:"ngxsOnInit",value:function(e){var t=e.getState(),n=t.expirationDate,i=t.popupShown,r=this.storage.getItem(Q$,"".concat(i)),o=z$.ctaDatePassed(n);"true"!==r&&!o&&e.dispatch(new Y$)}},{key:"getDialogData",value:function(){var e=this;return this.http.get("assets/docs/SPATIAL_SEARCH_README.md",{responseType:"text"}).pipe(ce(function(t){return e.infoService.parseMarkdown(t)}))}},{key:"launchLearnMore",value:function(e){this.dialog.open(k$,{autoFocus:!1,panelClass:"modal-animated",width:"72rem",data:{title:"Spatial Search",content:e,videoID:"UfxMpzatowE"}})}},{key:"learnMore",value:function(e){var t=this;return this.dialog.closeAll(),this.ga.event("open_learn_more","call_to_action"),this.getDialogData().pipe(mv(function(e){return t.launchLearnMore(e)}))}},{key:"open",value:function(e){this.dialog.open(eQ,{autoFocus:!1,panelClass:"modal-animated",width:"30.75rem",height:"36.688rem"}),this.ga.event("open","call_to_action"),this.storage.setItem(Q$,"true"),e.patchState({popupShown:!0})}},{key:"close",value:function(e){this.dialog.closeAll(),this.ga.event("close","call_to_action")}}],[{key:"ctaDatePassed",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Date.now;return+t()>+new Date(e)}}]),e}();Z$.\u0275fac=function(e){return new(e||Z$)(Zi(FG),Zi(yq),Zi($$),Zi(S$),Zi(h_))},Z$.\u0275prov=$e({token:Z$,factory:Z$.\u0275fac}),Mw([jz(X$)],Z$.prototype,"learnMore",null),Mw([jz(Y$)],Z$.prototype,"open",null),Mw([jz(K$)],Z$.prototype,"close",null),Z$=z$=Mw([Fz({name:"callToAction",defaults:{title:"New to the Exploration User Interface",message:"Spatial Search has arrived!",callToAction:"Learn More",imageUrl:"assets/images/spatial_search.gif",expirationDate:"Dec 1, 2022",popupShown:!1}})],Z$);var J$=function(){var e=function(){function e(){m(this,e)}return b(e,null,[{key:"title",value:function(e){return e.title}},{key:"message",value:function(e){return e.message}},{key:"callToAction",value:function(e){return e.callToAction}},{key:"imageUrl",value:function(e){return e.imageUrl}},{key:"expirationDate",value:function(e){return e.expirationDate}},{key:"popupShown",value:function(e){return e.popupShown}}]),e}();return Mw([Vz([Z$])],e,"title",null),Mw([Vz([Z$])],e,"message",null),Mw([Vz([Z$])],e,"callToAction",null),Mw([Vz([Z$])],e,"imageUrl",null),Mw([Vz([Z$])],e,"expirationDate",null),Mw([Vz([Z$])],e,"popupShown",null),e}(),eQ=function(){var e=function e(){m(this,e),this.close=function(){return new K$},this.learnMore=function(){return new X$}};return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=Ot({type:e,selectors:[["ccf-call-to-action-behavior"]],decls:5,vars:12,consts:[[3,"infoTitle","message","callToAction","imageUrl","callToActionClicked","closeClicked"]],template:function(e,t){1&e&&(As(0,"ccf-call-to-action",0),Vs("callToActionClicked",function(){return t.learnMore()})("closeClicked",function(){return t.close()}),Jc(1,"async"),Jc(2,"async"),Jc(3,"async"),Jc(4,"async"),Ms()),2&e&&Ts("infoTitle",el(1,4,t.title$))("message",el(2,6,t.message$))("callToAction",el(3,8,t.callToAction$))("imageUrl",el(4,10,t.imageUrl$))},directives:[O$],pipes:[sd],styles:[""],changeDetection:0}),Mw([Bz(J$.title)],e.prototype,"title$",void 0),Mw([Bz(J$.message)],e.prototype,"message$",void 0),Mw([Bz(J$.callToAction)],e.prototype,"callToAction$",void 0),Mw([Bz(J$.imageUrl)],e.prototype,"imageUrl$",void 0),Mw([TK()],e.prototype,"close",void 0),Mw([TK()],e.prototype,"learnMore",void 0),e}();function tQ(e,t){if(1&e&&(As(0,"div",3),Cu(1),Ms()),2&e){var n=Ws();Yo(1),Ou(" ",n.label,"\n")}}function nQ(e,t){if(1&e){var n=Ls();As(0,"mat-list-item",4),As(1,"div",5),As(2,"mat-checkbox",6),Vs("change",function(e){var t=bn(n).index;return Ws().updateItemSelection(t,e.checked)}),Cu(3),Ms(),Is(4,"div",7),As(5,"button",8),Vs("click",function(){var e=bn(n).index;return Ws().removeItem(e)}),As(6,"mat-icon"),Cu(7,"delete_outlined"),Ms(),Ms(),Ms(),Ms()}if(2&e){var i=t.$implicit;Yo(2),Ts("checked",i.selected),Yo(1),Ou(" ",i.description," ")}}var iQ,rQ=function(){var e=function(){function e(){m(this,e),this.clsName="ccf-spatial-search-list",this.label="",this.items=[],this.selectionChanged=new ol,this.itemRemoved=new ol}return b(e,[{key:"itemId",value:function(e,t){return t.description}},{key:"updateItemSelection",value:function(e,t){var n=this.items=v(this.items);n[e]=Object.assign(Object.assign({},n[e]),{selected:t});var i=n.filter(function(e){return e.selected});this.selectionChanged.emit(i)}},{key:"removeItem",value:function(e){var n=t((this.items=v(this.items)).splice(e,1),1)[0];this.itemRemoved.emit(n)}}]),e}();return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=Ot({type:e,selectors:[["ccf-spatial-search-list"]],hostVars:2,hostBindings:function(e,t){2&e&&du(t.clsName)},inputs:{label:"label",items:"items"},outputs:{selectionChanged:"selectionChanged",itemRemoved:"itemRemoved"},decls:3,vars:3,consts:[["class","label",4,"ngIf"],[1,"list"],["class","item",4,"ngFor","ngForOf","ngForTrackBy"],[1,"label"],[1,"item"],[1,"item-content"],["labelPosition","after",1,"description",3,"checked","change"],[1,"filler"],["mat-icon-button","",1,"delete",3,"click"]],template:function(e,t){1&e&&(Cs(0,tQ,2,1,"div",0),As(1,"mat-list",1),Cs(2,nQ,8,2,"mat-list-item",2),Ms()),2&e&&(Ts("ngIf",t.label),Yo(2),Ts("ngForOf",t.items)("ngForTrackBy",t.itemId))},directives:[Yh,BK,qh,UK,e$,q_,B_],styles:["[_nghost-%COMP%]{display:block}[_nghost-%COMP%] .label[_ngcontent-%COMP%]{margin-bottom:.5rem;font-weight:bold}[_nghost-%COMP%] .item[_ngcontent-%COMP%]{height:2rem}[_nghost-%COMP%] .item[_ngcontent-%COMP%] .item-content[_ngcontent-%COMP%]{display:flex;align-items:center;width:100%;height:2rem}[_nghost-%COMP%] .item[_ngcontent-%COMP%] .item-content[_ngcontent-%COMP%] .delete[_ngcontent-%COMP%]{width:2rem;height:2rem;line-height:2rem}[_nghost-%COMP%] .item[_ngcontent-%COMP%] .item-content[_ngcontent-%COMP%] .filler[_ngcontent-%COMP%]{flex-grow:1}[_nghost-%COMP%] .item[_ngcontent-%COMP%] > *{padding:0!important}"],changeDetection:0}),e}(),oQ=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({imports:[[cd,Y_,n$,V_,HK]]}),e}(),aQ=function(){var e=function e(){m(this,e),this.clsName="ccf-xyz-position",this.x=0,this.y=0,this.z=0,this.format="1.0-2"};return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=Ot({type:e,selectors:[["ccf-xyz-position"]],hostVars:2,hostBindings:function(e,t){2&e&&du(t.clsName)},inputs:{x:"x",y:"y",z:"z"},decls:9,vars:12,consts:[[1,"line"]],template:function(e,t){1&e&&(As(0,"span",0),Cu(1),Jc(2,"number"),Ms(),As(3,"span",0),Cu(4),Jc(5,"number"),Ms(),As(6,"span",0),Cu(7),Jc(8,"number"),Ms()),2&e&&(Yo(1),Ou("X: ",tl(2,3,t.x,t.format),""),Yo(3),Ou("Y: ",tl(5,6,t.y,t.format),""),Yo(3),Ou("Z: ",tl(8,9,t.z,t.format),""))},pipes:[ud],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column}[_nghost-%COMP%] .line[_ngcontent-%COMP%]{font-size:1rem;font-weight:400}"],changeDetection:0}),e}(),sQ=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}(Hp);return n.\u0275fac=function(e){return(t||(t=Ti(n)))(e||n)},n.\u0275prov=$e({token:n,factory:n.\u0275fac,providedIn:"root"}),n}(),uQ=new Ri("Default theme class"),cQ=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(nc,null);if(o){var a=i.nativeElement,s=null===(t=r.get(Hp,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)(Zi(uQ,8))},e.\u0275prov=$e({token:e,factory:e.\u0275fac}),e}(),lQ={initialConfig:{},parse:{},rename:{}},hQ=function(){function e(t,n){m(this,e),this.configState=t,this.storedChanges={},this.options=Object.assign(Object.assign({},lQ),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-1&&(this.count=n-1),t.subscribe(this._unsubscribeAndRecycle())}}}]),i}(K),wQ=function(){var e=function e(t){m(this,e),this.filter=t};return e.type="[DataState] Update filter",e}(),kQ={sex:"Both",ageRange:[1,110],bmiRange:[13,83],tmc:[],technologies:[],ontologyTerms:["http://purl.obolibrary.org/obo/UBERON_0013702"],cellTypeTerms:["http://purl.obolibrary.org/obo/CL_0000000"],spatialSearches:[]},xQ=(function(e){e.Running="running",e.Completed="completed"}(xQ||(xQ={})),xQ);function SQ(e){return function(){return e.next(xQ.Completed)}}function CQ(e,t){return function(n){return n.pipe(Of(e),mv(t),Oq(1),Te())}}var EQ=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.databaseReady$=i.state$.pipe(cG("status"),gQ(),bf(function(e){return"Ready"===e})),i._tissueBlockDataQueryStatus$=new Bf(1),i._aggregateDataQueryStatus$=new Bf(1),i._ontologyTermOccurencesDataQueryStatus$=new Bf(1),i._cellTypeTermOccurencesDataQueryStatus$=new Bf(1),i._sceneDataQueryStatus$=new Bf(1),i._technologyFilterQueryStatus$=new Bf(1),i._providerFilterQueryStatus$=new Bf(1),i.ontologyTermsFullData$=new Bf(1),i.cellTypeTermsFullData$=new Bf(1),i.filter$=i.state$.pipe(cG("filter")),i.tissueBlockData$=i.filter$.pipe(CQ(i.tissueBlockData,SQ(i._tissueBlockDataQueryStatus$))),i.aggregateData$=i.filter$.pipe(CQ(i.aggregateData,SQ(i._aggregateDataQueryStatus$))),i.ontologyTermOccurencesData$=i.filter$.pipe(CQ(i.ontologyTermOccurencesData,SQ(i._ontologyTermOccurencesDataQueryStatus$))),i.cellTypeTermOccurencesData$=i.filter$.pipe(CQ(i.cellTypeTermOccurencesData,SQ(i._cellTypeTermOccurencesDataQueryStatus$))),i.sceneData$=i.filter$.pipe(CQ(i.sceneData,SQ(i._sceneDataQueryStatus$))),i.technologyFilterData$=i.filter$.pipe(CQ(i.technologyFilterData,SQ(i._technologyFilterQueryStatus$))),i.providerFilterData$=i.filter$.pipe(CQ(i.providerFilterData,SQ(i._providerFilterQueryStatus$))),i.tissueBlockDataQueryStatus$=i._tissueBlockDataQueryStatus$.pipe(gQ()),i.aggregateDataQueryStatus$=i._aggregateDataQueryStatus$.pipe(gQ()),i.ontologyTermOccurencesDataQueryStatus$=i._ontologyTermOccurencesDataQueryStatus$.pipe(gQ()),i.cellTypeTermOccurencesDataQueryStatus$=i._cellTypeTermOccurencesDataQueryStatus$.pipe(gQ()),i.sceneDataQueryStatus$=i._sceneDataQueryStatus$.pipe(gQ()),i.technologyFilterQueryStatus$=i._technologyFilterQueryStatus$.pipe(gQ()),i.providerFilterQueryStatus$=i._providerFilterQueryStatus$.pipe(gQ()),i.queryStatus$=J_([i.tissueBlockDataQueryStatus$,i.aggregateDataQueryStatus$,i.ontologyTermOccurencesDataQueryStatus$,i.cellTypeTermOccurencesDataQueryStatus$,i.sceneDataQueryStatus$,i.technologyFilterQueryStatus$,i.providerFilterQueryStatus$]).pipe(ce(function(e){return function(e){return e.every(function(e){return e===xQ.Completed})}(e)?xQ.Completed:xQ.Running}),gQ()),i._tissueBlockDataQueryStatus$.next(xQ.Completed),i._aggregateDataQueryStatus$.next(xQ.Completed),i._ontologyTermOccurencesDataQueryStatus$.next(xQ.Completed),i._cellTypeTermOccurencesDataQueryStatus$.next(xQ.Completed),i._sceneDataQueryStatus$.next(xQ.Completed),i._technologyFilterQueryStatus$.next(xQ.Completed),i._providerFilterQueryStatus$.next(xQ.Completed),i}return b(n,[{key:"ngxsOnInit",value:function(){var e=this,t=this.ontologyTermsFullData$,n=this.ontologyTermOccurencesData$,i=this.cellTypeTermsFullData$,r=this.cellTypeTermOccurencesData$,o=this.source;this.snapshot.filter===kQ?(n.pipe(_p(1)).subscribe(t),r.pipe(_p(1)).subscribe(i)):(o.getOntologyTermOccurences().pipe(_p(1)).subscribe(t),o.getCellTypeTermOccurences().pipe(_p(1)).subscribe(i)),this.source.getOntologyTreeModel().pipe(_p(1)).subscribe(function(t){return e.updateAnatomicalStructuresTreeModel(t)}),this.source.getCellTypeTreeModel().pipe(_p(1)).subscribe(function(t){return e.updateCellTypesTreeModel(t)}),this.warmUpDatabase()}},{key:"warmUpDatabase",value:function(){var e=this;tH(function(){return e.source.getDatabaseStatus()}).pipe(mv(function(t){return e.updateStatus(t)}),NH(2e3),_p(1)).pipe(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;return function(t){return 0===e?If():t.lift(new bQ(e<0?-1:e-1,t))}}(1e3),xp(function(e){return"Loading"===e.status})).subscribe(),this.databaseReady$.pipe(_p(1),mv(function(){e.updateStatus({status:"Ready",message:"Loading CCF Exploration User Interface (EUI)"})})).subscribe()}},{key:"updateAnatomicalStructuresTreeModel",value:function(e){this.ctx.patchState({anatomicalStructuresTreeModel:e})}},{key:"updateCellTypesTreeModel",value:function(e){this.ctx.patchState({cellTypesTreeModel:e})}},{key:"updateStatus",value:function(e){this.ctx.patchState({status:e.status,statusMessage:e.message})}},{key:"updateFilter",value:function(e){this.ctx.patchState({filter:Object.assign(Object.assign({},this.getState().filter),e)})}},{key:"updateFilterHandler",value:function(e,t){var n=t.filter;this.updateFilter(n)}},{key:"tissueBlockData",value:function(e){var t=this;return this._tissueBlockDataQueryStatus$.next(xQ.Running),this.databaseReady$.pipe(Of(function(){return t.source.getTissueBlockResults(e)}))}},{key:"aggregateData",value:function(e){var t=this;return this._aggregateDataQueryStatus$.next(xQ.Running),this.databaseReady$.pipe(Of(function(){return t.source.getAggregateResults(e)}))}},{key:"ontologyTermOccurencesData",value:function(e){var t=this;return this._ontologyTermOccurencesDataQueryStatus$.next(xQ.Running),this.databaseReady$.pipe(Of(function(){return t.source.getOntologyTermOccurences(e)}))}},{key:"cellTypeTermOccurencesData",value:function(e){var t=this;return this._cellTypeTermOccurencesDataQueryStatus$.next(xQ.Running),this.databaseReady$.pipe(Of(function(){return t.source.getCellTypeTermOccurences(e)}))}},{key:"sceneData",value:function(e){var t=this;return this._sceneDataQueryStatus$.next(xQ.Running),this.databaseReady$.pipe(Of(function(){return t.source.getScene(e)}))}},{key:"technologyFilterData",value:function(){var e=this;return this._technologyFilterQueryStatus$.next(xQ.Running),this.databaseReady$.pipe(Of(function(){return e.source.getDatasetTechnologyNames()}))}},{key:"providerFilterData",value:function(){var e=this;return this._providerFilterQueryStatus$.next(xQ.Running),this.databaseReady$.pipe(Of(function(){return e.source.getProviderNames()}))}}]),n}(hq);EQ.\u0275fac=function(e){return new(e||EQ)(Zi(N$))},EQ.\u0275prov=$e({token:EQ,factory:EQ.\u0275fac}),Mw([sq(),Iw(0,uq("treeModel"))],EQ.prototype,"updateAnatomicalStructuresTreeModel",null),Mw([sq(),Iw(0,uq("treeModel"))],EQ.prototype,"updateCellTypesTreeModel",null),Mw([sq(),Iw(0,uq("status"))],EQ.prototype,"updateStatus",null),Mw([sq(),Iw(0,uq("filter"))],EQ.prototype,"updateFilter",null),Mw([jz(wQ)],EQ.prototype,"updateFilterHandler",null),Mw([eV.ak],EQ.prototype,"tissueBlockData",null),Mw([eV.ak],EQ.prototype,"aggregateData",null),Mw([eV.ak],EQ.prototype,"ontologyTermOccurencesData",null),Mw([eV.ak],EQ.prototype,"cellTypeTermOccurencesData",null),Mw([eV.ak],EQ.prototype,"sceneData",null),Mw([eV.ak],EQ.prototype,"technologyFilterData",null),Mw([eV.ak],EQ.prototype,"providerFilterData",null),EQ=Mw([cq(),Fz({name:"data",defaults:{filter:kQ,status:"Loading",statusMessage:"Loading database"}})],EQ);var OQ=function(){function e(){m(this,e)}return b(e,null,[{key:"filter",value:function(e){return e.filter}},{key:"anatomicalStructuresTreeModel",value:function(e){var t;return null!==(t=e.anatomicalStructuresTreeModel)&&void 0!==t?t:{root:"",nodes:{}}}},{key:"cellTypesTreeModel",value:function(e){var t;return null!==(t=e.cellTypesTreeModel)&&void 0!==t?t:{root:"",nodes:{}}}}]),e}();Mw([Vz([EQ])],OQ,"filter",null),Mw([Vz([EQ])],OQ,"anatomicalStructuresTreeModel",null),Mw([Vz([EQ])],OQ,"cellTypesTreeModel",null);var TQ=function(){var e=function e(t,n,i){m(this,e),this.sex=t,this.organName=n,this.search=i};return e.type="[Spatial Search Filter] Add",e}(),PQ=function(){var e=function e(t){m(this,e),this.id=t};return e.type="[Spatial Search Filter] Remove",e}(),AQ=function(){var e=function e(t){m(this,e),this.items=t};return e.type="[Spatial Search Filter] Set selected searches",e}(),MQ=function(){function e(){m(this,e)}return b(e,[{key:"addSearch",value:function(e,t){var n=t.sex,i=t.organName,r=t.search;e.setState(function(e){return function(t){return e&&e.length||!t?Array.isArray(t)?t.concat(e):e:t}}([this.createItem(n,i,r)]))}},{key:"removeSearch",value:function(e,t){var n=t.id;e.setState(function(e){return function(t){var n=-1;if(function(e){return"function"==typeof e}(e)?n=t.findIndex(e):function(e){return"number"==typeof e}(e)&&(n=e),function(e){return Number.isNaN(e)||-1===e}(n))return t;var i=t.slice();return i.splice(n,1),i}}(function(e){return(null==e?void 0:e.id)===n}))}},{key:"setSelectedSearches",value:function(e,t){var n=t.items,i=new Map(n.map(function(e){return[e.id,e]})),r=e.getState().map(function(e){var t;return null!==(t=i.get(e.id))&&void 0!==t?t:e.selected?Object.assign(Object.assign({},e),{selected:!1}):e});e.setState(r)}},{key:"createItem",value:function(e,t,n){return{id:this.createItemId(n),selected:!0,description:this.createItemDescription(e,t,n),sex:e,search:n}}},{key:"createItemId",value:function(e){var t=e.x,n=e.y,i=e.z,r=e.radius,o=e.target;return"".concat(o,"-").concat(r,"-").concat(t,",").concat(n,",").concat(i)}},{key:"createItemDescription",value:function(e,t,n){var i=function(e){return e.slice(0,1).toUpperCase()+e.slice(1)},r=n.x,o=n.y,a=n.z,s=n.radius;return"".concat(i(e),", ").concat(i(t),", ").concat(s.toFixed(1)," mm, X: ").concat(r.toFixed(1),", Y: ").concat(o.toFixed(1),", Z: ").concat(a.toFixed(1))}}]),e}();MQ.\u0275fac=function(e){return new(e||MQ)},MQ.\u0275prov=$e({token:MQ,factory:MQ.\u0275fac}),Mw([jz(TQ)],MQ.prototype,"addSearch",null),Mw([jz(PQ)],MQ.prototype,"removeSearch",null),Mw([jz(AQ)],MQ.prototype,"setSelectedSearches",null),MQ=Mw([Fz({name:"spatialSearchFilter",defaults:[]})],MQ);var IQ=function(){function e(){m(this,e)}return b(e,null,[{key:"items",value:function(e){return e}},{key:"searches",value:function(e){return e.map(function(e){return e.search})}},{key:"selectedSearches",value:function(e){return e.filter(function(e){return e.selected}).map(function(e){return e.search})}}]),e}();Mw([Vz([MQ])],IQ,"items",null),Mw([Vz([IQ.items])],IQ,"searches",null),Mw([Vz([IQ.items])],IQ,"selectedSearches",null);var RQ=new RegExp("[^#a-f\\d]","gi"),DQ=new RegExp("^#?[a-f\\d]{3}[a-f\\d]?$|^#?[a-f\\d]{6}([a-f\\d]{2})?$","i"),NQ=["#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||RQ.test(e)||!DQ.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}}),LQ=function(e){a(n,e);var t=s(n);function n(){var e;return m(this,n),(e=t.apply(this,arguments)).forcedUnassignment=new ae,e.forcedUnassignment$=e.forcedUnassignment.asObservable(),e.colorAssignments$=e.state$.pipe(cG("colorAssignments"),lf()),e.colorAssignmentsList$=e.state$.pipe(cG("colorAssignmentsList"),lf()),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}(dq);LQ.\u0275fac=function(){var e;return function(t){return(e||(e=Ti(LQ)))(t||LQ)}}(),LQ.\u0275prov=$e({token:LQ,factory:LQ.\u0275fac}),Mw([sq(),Iw(0,uq("key")),Iw(1,uq("doReset"))],LQ.prototype,"assignColor",null),Mw([sq(),Iw(0,uq("key"))],LQ.prototype,"unassignColor",null),LQ=Mw([cq(),Fz({name:"colors",defaults:{colorPalette:NQ.concat(),colorsAvailable:NQ.concat(),colorAssignments:{},colorAssignmentsList:[]}})],LQ);var jQ=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(cG("listResults"),lf()),n.highlightedNodeId$=n.state$.pipe(cG("highlightedNodeId"),lf()),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(EQ),this.colorAssignments=this.injector.get(LQ),J_([this.dataState.tissueBlockData$,this.colorAssignments.colorAssignments$]).pipe(ce(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,$q.sortBy)(a,["rank"]).concat(s)}),mv(function(e){return n.setListResults(e)})).subscribe()}}]),r}(dq);jQ.\u0275fac=function(e){return new(e||jQ)(Zi(N$),Zi(ss))},jQ.\u0275prov=$e({token:jQ,factory:jQ.\u0275fac}),Mw([sq(),Iw(0,uq("listResults"))],jQ.prototype,"setListResults",null),jQ=Mw([cq(),Fz({name:"listResults",defaults:{listResults:[]}})],jQ);var FQ=new Set(["Skin","Heart","Kidney","Spleen"]),BQ=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(cG("referenceOrgans"),lf()),n.selectedReferenceOrgans$=n.state$.pipe(cG("selectedReferenceOrgans"),lf()),n.scene$=n.state$.pipe(cG("scene"),lf()),n.highlightedId$=n.state$.pipe(cG("highlightedId"),lf()),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:"setReferenceOrganEntities",value:function(e){this.ctx.patchState({referenceOrganEntities: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(EQ),this.colorAssignments=this.injector.get(LQ),this.listResults=this.injector.get(jQ),this.dataService.getReferenceOrgans().pipe(mv(function(e){return n.setReferenceOrganEntities(e)}),ce(function(e){var t=new Set(e.map(function(e){return e.representation_of}));return f$.filter(function(e){return t.has(e.id)}).map(function(e){return Object.assign(Object.assign({},e),{disabled:!1,numResults:0})})}),_p(1),mv(function(e){n.setReferenceOrgans(e),n.setSelectedReferenceOrgans(e.filter(function(e){return FQ.has(e.organ)}))})).subscribe(),J_([this.dataState.sceneData$,this.selectedReferenceOrgans$,this.colorAssignments.colorAssignments$,this.dataService.getReferenceOrgans(),this.listResults.highlightedNodeId$]).pipe(ce(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})}),mv(function(e){return n.setScene(e)})).subscribe()}}],[{key:"referenceOrgans",value:function(e){return e.referenceOrgans}},{key:"referenceOrganEntities",value:function(e){return e.referenceOrganEntities}}]),r}(dq);function VQ(e,t){if(1&e&&(Xn(),Is(0,"circle",3)),2&e){var n=Ws();uu("animation-name","mat-progress-spinner-stroke-rotate-"+n._spinnerAnimationLabel)("stroke-dashoffset",n._getStrokeDashOffset(),"px")("stroke-dasharray",n._getStrokeCircumference(),"px")("stroke-width",n._getCircleStrokeWidth(),"%"),ks("r",n._getCircleRadius())}}function zQ(e,t){if(1&e&&(Xn(),Is(0,"circle",3)),2&e){var n=Ws();uu("stroke-dashoffset",n._getStrokeDashOffset(),"px")("stroke-dasharray",n._getStrokeCircumference(),"px")("stroke-width",n._getCircleStrokeWidth(),"%"),ks("r",n._getCircleRadius())}}function UQ(e,t){if(1&e&&(Xn(),Is(0,"circle",3)),2&e){var n=Ws();uu("animation-name","mat-progress-spinner-stroke-rotate-"+n._spinnerAnimationLabel)("stroke-dashoffset",n._getStrokeDashOffset(),"px")("stroke-dasharray",n._getStrokeCircumference(),"px")("stroke-width",n._getCircleStrokeWidth(),"%"),ks("r",n._getCircleRadius())}}function HQ(e,t){if(1&e&&(Xn(),Is(0,"circle",3)),2&e){var n=Ws();uu("stroke-dashoffset",n._getStrokeDashOffset(),"px")("stroke-dasharray",n._getStrokeCircumference(),"px")("stroke-width",n._getCircleStrokeWidth(),"%"),ks("r",n._getCircleRadius())}}BQ.\u0275fac=function(e){return new(e||BQ)(Zi(N$),Zi(ss))},BQ.\u0275prov=$e({token:BQ,factory:BQ.\u0275fac}),Mw([sq(),Iw(0,uq("selectedReferenceOrgans"))],BQ.prototype,"setSelectedReferenceOrgans",null),Mw([sq(),Iw(0,uq("referenceOrgans"))],BQ.prototype,"setReferenceOrgans",null),Mw([sq(),Iw(0,uq("referenceOrganEntities"))],BQ.prototype,"setReferenceOrganEntities",null),Mw([sq(),Iw(0,uq("scene"))],BQ.prototype,"setScene",null),Mw([Vz()],BQ,"referenceOrgans",null),Mw([Vz()],BQ,"referenceOrganEntities",null),BQ=Mw([cq(),Fz({name:"scene",defaults:{scene:[],referenceOrgans:[],referenceOrganEntities:[],selectedReferenceOrgans:[],selectedAnatomicalStructures:[],anatomicalStructureSettings:{}}})],BQ);var GQ=".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",WQ=ab(function(){return function e(t){m(this,e),this._elementRef=t}}(),"primary"),qQ=new Ri("mat-progress-spinner-default-options",{providedIn:"root",factory:function(){return{diameter:100}}}),XQ=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=qd(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=qd(e)}},{key:"value",get:function(){return"determinate"===this.mode?this._value:0},set:function(e){this._value=Math.max(0,Math.min(100,qd(e)))}},{key:"ngOnInit",value:function(){var e=this._elementRef.nativeElement;this._styleRoot=Qf(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}(WQ);XQ.\u0275fac=function(e){return new(e||XQ)(Os(Ju),Os(qf),Os(bh,8),Os(Yy,8),Os(qQ))},XQ.\u0275cmp=Ot({type:XQ,selectors:[["mat-progress-spinner"]],hostAttrs:["role","progressbar","tabindex","-1",1,"mat-progress-spinner"],hostVars:10,hostBindings:function(e,t){2&e&&(ks("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),uu("width",t.diameter,"px")("height",t.diameter,"px"),cu("_mat-animation-noopable",t._noopAnimations))},inputs:{color:"color",mode:"mode",diameter:"diameter",strokeWidth:"strokeWidth",value:"value"},exportAs:["matProgressSpinner"],features:[cs],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&&(Xn(),As(0,"svg",0),Cs(1,VQ,1,9,"circle",1),Cs(2,zQ,1,7,"circle",2),Ms()),2&e&&(uu("width",t.diameter,"px")("height",t.diameter,"px"),Ts("ngSwitch","indeterminate"===t.mode),ks("viewBox",t._getViewBox()),Yo(1),Ts("ngSwitchCase",!0),Yo(1),Ts("ngSwitchCase",!1))},directives:[Zh,Jh],styles:[GQ],encapsulation:2,changeDetection:0}),XQ._diameters=new WeakMap;var YQ=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}(XQ);return e.\u0275fac=function(t){return new(t||e)(Os(Ju),Os(qf),Os(bh,8),Os(Yy,8),Os(qQ))},e.\u0275cmp=Ot({type:e,selectors:[["mat-spinner"]],hostAttrs:["role","progressbar","mode","indeterminate",1,"mat-spinner","mat-progress-spinner"],hostVars:6,hostBindings:function(e,t){2&e&&(uu("width",t.diameter,"px")("height",t.diameter,"px"),cu("_mat-animation-noopable",t._noopAnimations))},inputs:{color:"color"},features:[cs],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&&(Xn(),As(0,"svg",0),Cs(1,UQ,1,9,"circle",1),Cs(2,HQ,1,7,"circle",2),Ms()),2&e&&(uu("width",t.diameter,"px")("height",t.diameter,"px"),Ts("ngSwitch","indeterminate"===t.mode),ks("viewBox",t._getViewBox()),Yo(1),Ts("ngSwitchCase",!0),Yo(1),Ts("ngSwitchCase",!1))},directives:[Zh,Jh],styles:[GQ],encapsulation:2,changeDetection:0}),e}(),KQ=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({imports:[[rb,cd],rb]}),e}(),$Q=function(){var e=function e(){m(this,e),this.className="ccf-spinner-overlay",this.active=!1};return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=Ot({type:e,selectors:[["ccf-spinner-overlay"]],hostVars:4,hostBindings:function(e,t){2&e&&(du(t.className),cu("active",t.active))},inputs:{active:"active",text:"text"},decls:3,vars:1,consts:[[1,"content"]],template:function(e,t){1&e&&(Is(0,"mat-spinner"),As(1,"div",0),Cu(2),Ms()),2&e&&(Yo(2),Eu(t.text))},directives:[YQ],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}),e}(),QQ={isolated:!0},ZQ=new Ri("Message service configuration",{providedIn:"root",factory:function(){return QQ}}),JQ=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(bf(function(t){return t.source!==e.source}))}},{key:"getMessagesFromSource",value:function(e){return this.getMessages().pipe(bf(function(t){return t.source===e}))}},{key:"getMessagesFromSources",value:function(e){return this.getMessages().pipe(bf(function(t){return e.includes(t.source)}))}},{key:"nextMessageId",value:function(){return e.counter++}}]),e}();return e.counter=0,e}(),eZ=function(){var e=function(){function e(t,n){var i=this;m(this,e),this.config=t,this.parent=n,this.channel=new ae,this.messages=t.isolated||!n?this.channel.asObservable():ye([this.channel,n.messages.pipe(xp(function(){return!i.channel.closed}))]).pipe(Ce())}return b(e,[{key:"ngOnDestroy",value:function(){this.channel.complete()}},{key:"connect",value:function(e){return new JQ(e,this.channel,this.messages)}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Zi(ZQ),Zi(e,12))},e.\u0275prov=$e({token:e,factory:e.\u0275fac,providedIn:"root"}),e}(),tZ=["*"],nZ=function(){var e=function(){function e(t,n){var i=this;m(this,e),this.className="ccf-drawer-content",this.animationsEnabled=!1,this.leftMargin=0,this.rightMargin=0,this.faded=!1,this.drawers=[],this.subscriptions=new q;var r=t.connect(this).getMessages();this.subscriptions.add(r.subscribe(function(e){i.handleMessage(e)&&n.markForCheck()}))}return b(e,[{key:"ngOnDestroy",value:function(){this.subscriptions.unsubscribe()}},{key:"handleMessage",value:function(e){switch(e.payload.type){case"drawer-containers-changed":return this.drawers=e.payload.drawers,this.updateFaded(),!0;case"drawer-initialized":return this.animationsEnabled=!0,!0;case"drawer-toggled":var t=e.source.position,n=e.payload,i=n.opened,r=n.width,o=n.margin;return this.updateMargin(t,i,r,o),this.updateFaded(),!0;default:return!1}}},{key:"updateMargin",value:function(e,t,n,i){var r=t?n+i:i;"start"===e?this.leftMargin=r:this.rightMargin=r}},{key:"updateFaded",value:function(){var e=t(this.drawers,2),n=e[0],i=e[1];this.faded=(null==n?void 0:n.opened)&&(null==n?void 0:n.expanded)||(null==i?void 0:i.opened)&&(null==i?void 0:i.expanded)}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Os(eZ),Os(Cc))},e.\u0275cmp=Ot({type:e,selectors:[["ccf-drawer-content"]],hostVars:9,hostBindings:function(e,t){2&e&&(Mu("@fadeInOut",t.faded),du(t.className),uu("margin-left",t.leftMargin,"px")("margin-right",t.rightMargin,"px"),cu("cff-drawer-content-animations",t.animationsEnabled))},ngContentSelectors:tZ,decls:1,vars:0,template:function(e,t){1&e&&(Xs(),Ys(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:[fg("fadeInOut",[mg("false",gg({opacity:1})),mg("true",gg({opacity:0})),yg("false <=> true",pg("1s"))])]},changeDetection:0}),e}(),iZ=["*"],rZ={params:{width:0,margin:0,margin2:0}},oZ=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 Dw(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}(),aZ=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 ol(!0),this.expandedChange=new ol(!0),this.stateChange=new ol(!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 oZ,this.subscriptions=new q,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(Wd(e))}},{key:"expanded",get:function(){return this._expanded},set:function(e){this.toggleExpanded(Wd(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 Dw(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)(Os(eZ),Os(Cc),Os(Ju))},e.\u0275cmp=Ot({type:e,selectors:[["ccf-drawer"]],hostVars:10,hostBindings:function(e,t){1&e&&zs("@openClose.done",function(){return t.closeOpenDone()})("@expandCollapse.done",function(){return t.expandCollapseDone()}),2&e&&(Mu("@openClose",t.openedState)("@expandCollapse",t.expandedStateObj),du(t.className),cu("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:iZ,decls:2,vars:0,consts:[[1,"cff-drawer-inner-container"]],template:function(e,t){1&e&&(Xs(),As(0,"div",0),Ys(1),Ms())},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:[fg("openClose",[mg("open, open-instant",gg({transform:"none"})),mg("closed",gg({})),yg("closed => open-instant",pg(0)),yg("closed <=> open, open-instant => closed",pg(".5s ease-in-out"))]),fg("expandCollapse",[mg("collapsed",gg({})),mg("half",gg({width:"calc(50% - {{ margin }}px)"}),rZ),mg("extended",gg({width:"calc(100% - {{ width }}px - {{ margin }}px)"}),rZ),mg("full",gg({width:"calc(100% - {{ margin }}px - {{ margin2 }}px)"}),rZ),yg("* <=> *",pg(".5s ease-in-out"))])]},changeDetection:0}),e}();function sZ(e,t){1&e&&(As(0,"ccf-drawer-content"),Ys(1,2),Ms())}var uZ=[[["ccf-drawer"]],[["ccf-drawer-content"]],"*"],cZ=["ccf-drawer","ccf-drawer-content","*"];function lZ(e){throw new Error("Multiple drawers in position ".concat(e))}var hZ=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 q,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(Ef(null)).subscribe(function(){var t=e.validateDrawers();e.channel.sendMessage({type:"drawer-containers-changed",drawers:t}),e.cdr.markForCheck()}),this.content1.changes.pipe(Ef(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&&lZ("start"),n.length>1&&lZ("end"),[t[0],n[0]]}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Os(eZ),Os(Cc))},e.\u0275cmp=Ot({type:e,selectors:[["ccf-drawer-container"]],contentQueries:function(e,t,n){var i;(1&e&&(bl(n,aZ,5),bl(n,nZ,5)),2&e)&&(ml(i=_l())&&(t.drawers=i),ml(i=_l())&&(t.content1=i))},viewQuery:function(e,t){var n;(1&e&&yl(nZ,5),2&e)&&(ml(n=_l())&&(t.content2=n))},hostVars:2,hostBindings:function(e,t){2&e&&du(t.className)},exportAs:["ccfDrawerContainer"],features:[Xu([eZ])],ngContentSelectors:cZ,decls:3,vars:1,consts:[[4,"ngIf"]],template:function(e,t){1&e&&(Xs(uZ),Ys(0),Ys(1,1),Cs(2,sZ,2,0,"ccf-drawer-content",0)),2&e&&(Yo(2),Ts("ngIf",!t.hasWrappedContent))},directives:[Yh,nZ],styles:["[_nghost-%COMP%]{display:block;position:relative;z-index:1;overflow:hidden;-webkit-overflow-scrolling:touch}"],changeDetection:0}),e}(),dZ=function(){var e=function e(){m(this,e)};return e.type="[SpatialSearchUi] Start the Spatial Search flow",e}(),fZ=function(){var e=function e(t){m(this,e),this.sex=t};return e.type="[SpatialSearchUi] Set sex",e}(),pZ=function(){var e=function e(t){m(this,e),this.organId=t};return e.type="[SpatialSearchUi] Set organ",e}(),vZ=function(){var e=function e(t){m(this,e),this.position=t};return e.type="[SpatialSearchUi] Set position",e}(),gZ=function(){var e=function e(t){m(this,e),this.node=t};return e.type="[SpatialSearchUi] Start moving the position to a scene node",e}(),mZ=function(){var e=function e(){m(this,e)};return e.type="[SpatialSearchUi] Reset position",e}(),yZ=function(){var e=function e(t){m(this,e),this.radius=t};return e.type="[SpatialSearchUi] Set radius",e}(),bZ=function(){var e=function e(){m(this,e)};return e.type="[SpatialSearchUi] Reset radius",e}(),_Z=function(){var e=function e(){m(this,e)};return e.type="[SpatialSearchUi] Update spatial search data",e}(),wZ=function(){var e=function e(){m(this,e)};return e.type="[SpatialSearchUi] Generate and add a spatial search",e}(),kZ=function(){var e=function e(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];m(this,e),this.execute=t};return e.type="[SpatialSearchUi] Set execute search on generate",e}(),xZ=["trigger"],SZ=["panel"];function CZ(e,t){if(1&e&&(As(0,"span",8),Cu(1),Ms()),2&e){var n=Ws();Yo(1),Eu(n.placeholder)}}function EZ(e,t){if(1&e&&(As(0,"span",12),Cu(1),Ms()),2&e){var n=Ws(2);Yo(1),Eu(n.triggerValue)}}function OZ(e,t){1&e&&Ys(0,0,["*ngSwitchCase","true"])}function TZ(e,t){1&e&&(As(0,"span",9),Cs(1,EZ,2,1,"span",10),Cs(2,OZ,1,0,"ng-content",11),Ms()),2&e&&(Ts("ngSwitch",!!Ws().customTrigger),Yo(2),Ts("ngSwitchCase",!0))}function PZ(e,t){if(1&e){var n=Ls();As(0,"div",13),As(1,"div",14,15),Vs("@transformPanel.done",function(e){return bn(n),Ws()._panelDoneAnimatingStream.next(e.toState)})("keydown",function(e){return bn(n),Ws()._handleKeydown(e)}),Ys(3,1),Ms(),Ms()}if(2&e){var i=Ws();Ts("@transformPanelWrap",void 0),Yo(1),Pu("mat-select-panel ",i._getPanelTheme(),""),uu("transform-origin",i._transformOrigin)("font-size",i._triggerFontSize,"px"),Ts("ngClass",i.panelClass)("@transformPanel",i.multiple?"showing-multiple":"showing"),ks("id",i.id+"-panel")("aria-multiselectable",i.multiple)("aria-label",i.ariaLabel||null)("aria-labelledby",i._getPanelAriaLabelledby())}}var AZ=[[["mat-select-trigger"]],"*"],MZ=["mat-select-trigger","*"],IZ={transformPanelWrap:fg("transformPanelWrap",[yg("* => 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:fg("transformPanel",[mg("void",gg({transform:"scaleY(0.8)",minWidth:"100%",opacity:0})),mg("showing",gg({opacity:1,minWidth:"calc(100% + 32px)",transform:"scaleY(1)"})),mg("showing-multiple",gg({opacity:1,minWidth:"calc(100% + 64px)",transform:"scaleY(1)"})),yg("void => *",pg("120ms cubic-bezier(0, 0, 0.2, 1)")),yg("* => void",pg("100ms 25ms linear",gg({opacity:0})))])},RZ=0,DZ=new Ri("mat-select-scroll-strategy"),NZ=new Ri("MAT_SELECT_CONFIG"),LZ={provide:DZ,deps:[iv],useFactory:function(e){return function(){return e.scrollStrategies.reposition()}}},jZ=function e(t,n){m(this,e),this.source=t,this.value=n},FZ=sb(ub(ob(cb(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}}())))),BZ=new Ri("MatSelectTrigger"),VZ=function(){var e=function(e){a(n,e);var t=s(n);function n(e,i,r,o,a,s,u,l,h,d,f,p,g,y){var b,_,w,k;return m(this,n),(b=t.call(this,a,o,u,l,d))._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-"+RZ++,b._triggerAriaLabelledBy=null,b._destroy=new ae,b._onChange=function(){},b._onTouched=function(){},b._valueId="mat-select-value-"+RZ++,b._panelDoneAnimatingStream=new ae,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=tH(function(){var e=b.options;return e?e.changes.pipe(Ef(e),Of(function(){return Oe.apply(void 0,v(e.map(function(e){return e.onSelectionChange})))})):b._ngZone.onStable.pipe(_p(1),Of(function(){return b.optionSelectionChanges}))}),b.openedChange=new ol,b._openedStream=b.openedChange.pipe(bf(function(e){return e}),ce(function(){})),b._closedStream=b.openedChange.pipe(bf(function(e){return!e}),ce(function(){})),b.selectionChange=new ol,b.valueChange=new ol,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(f)||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=Wd(e),this.stateChanges.next()}},{key:"multiple",get:function(){return this._multiple},set:function(e){this._multiple=Wd(e)}},{key:"disableOptionCentering",get:function(){return this._disableOptionCentering},set:function(e){this._disableOptionCentering=Wd(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=qd(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 ip(this.multiple),this.stateChanges.next(),this._panelDoneAnimatingStream.pipe(lf(),kf(this._destroy)).subscribe(function(){return e._panelDoneAnimating(e.panelOpen)})}},{key:"ngAfterContentInit",value:function(){var e=this;this._initKeyManager(),this._selectionModel.changed.pipe(kf(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(Ef(null),kf(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&&!Ep(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||Ep(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(_p(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 zv(this.options).withTypeAhead(this._typeaheadDebounceInterval).withVerticalOrientation().withHorizontalOrientation(this._isRtl()?"rtl":"ltr").withHomeAndEnd().withAllowedModifierKeys(["shiftKey"]),this._keyManager.tabOut.pipe(kf(this._destroy)).subscribe(function(){e.panelOpen&&(!e.multiple&&e._keyManager.activeItem&&e._keyManager.activeItem._selectViaInteraction(),e.focus(),e.close())}),this._keyManager.change.pipe(kf(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=Oe(this.options.changes,this._destroy);this.optionSelectionChanges.pipe(kf(t)).subscribe(function(t){e._onSelect(t.source,t.isUserInput),t.isUserInput&&!e.multiple&&e._panelOpen&&(e.close(),e.focus())}),Oe.apply(void 0,v(this.options.map(function(e){return e._stateChanges}))).pipe(kf(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}(FZ);return e.\u0275fac=function(t){return new(t||e)(Os(ap),Os(Cc),Os(Xl),Os(lb),Os(Ju),Os(tp,8),Os(zU,8),Os(QU,8),Os(IH,8),Os(hU,10),Ai("tabindex"),Os(DZ),Os(tg),Os(NZ,8))},e.\u0275dir=Rt({type:e,viewQuery:function(e,t){var n;(1&e&&(yl(xZ,5),yl(SZ,5),yl(sv,5)),2&e)&&(ml(n=_l())&&(t.trigger=n.first),ml(n=_l())&&(t.panel=n.first),ml(n=_l())&&(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:[cs,qt]}),e}(),zZ=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(kf(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(_p(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=Db(e,this.options,this.optionGroups),n=this._getItemHeight();this.panel.nativeElement.scrollTop=0===e&&1===t?0:Nb((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 jZ(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+=Db(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}(VZ);return n.\u0275fac=function(e){return(t||(t=Ti(n)))(e||n)},n.\u0275cmp=Ot({type:n,selectors:[["mat-select"]],contentQueries:function(e,t,n){var i;(1&e&&(bl(n,BZ,5),bl(n,Rb,5),bl(n,Pb,5)),2&e)&&(ml(i=_l())&&(t.customTrigger=i.first),ml(i=_l())&&(t.options=i),ml(i=_l())&&(t.optionGroups=i))},hostAttrs:["role","combobox","aria-autocomplete","none","aria-haspopup","true",1,"mat-select"],hostVars:20,hostBindings:function(e,t){1&e&&Vs("keydown",function(e){return t._handleKeydown(e)})("focus",function(){return t._onFocus()})("blur",function(){return t._onBlur()}),2&e&&(ks("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()),cu("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:[Xu([{provide:wH,useExisting:n},{provide:Cb,useExisting:n}]),cs],ngContentSelectors:MZ,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&&(Xs(AZ),As(0,"div",0,1),Vs("click",function(){return t.toggle()}),As(3,"div",2),Cs(4,CZ,2,1,"span",3),Cs(5,TZ,3,2,"span",4),Ms(),As(6,"div",5),Is(7,"div",6),Ms(),Ms(),Cs(8,PZ,4,14,"ng-template",7),Vs("backdropClick",function(){return t.close()})("attach",function(){return t._onAttached()})("detach",function(){return t.close()})),2&e){var n=Es(1);ks("aria-owns",t.panelOpen?t.id+"-panel":null),Yo(3),Ts("ngSwitch",t.empty),ks("id",t._valueId),Yo(1),Ts("ngSwitchCase",!0),Yo(1),Ts("ngSwitchCase",!1),Yo(3),Ts("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:[av,Zh,Jh,sv,ed,Gh],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:[IZ.transformPanelWrap,IZ.transformPanel]},changeDetection:0}),n}(),UZ=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({providers:[LZ],imports:[[cd,cv,Lb,rb],sp,DH,Lb,rb]}),e}();function HZ(e,t){if(1&e&&(As(0,"mat-option",6),As(1,"div"),Cu(2),Ms(),Ms()),2&e){var n=t.$implicit,i=Ws();Ts("value",n),Yo(1),du(i.optionsVisible),Yo(1),Ou(" ",n," ")}}var GZ=function(){var e=function(){function e(t){m(this,e),this.ga=t,this.selectionChange=new ol,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)(Os(yq))},e.\u0275cmp=Ot({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&&(As(0,"div",0),As(1,"div",1),As(2,"mat-form-field",2),As(3,"div",3),Cu(4),Ms(),As(5,"mat-select",4),Vs("selectionChange",function(e){return t.selectionChanged(e.value)})("openedChange",function(){return t.toggleOptions()}),Cs(6,HZ,3,5,"mat-option",5),Ms(),Ms(),Ms(),Ms()),2&e&&(Yo(4),Ou(" ",t.label," "),Yo(1),Ts("value",t.selection),Yo(1),Ts("ngForOf",t.options))},directives:[RH,zZ,qh,Rb],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}(),WZ=r(25430),qZ=r(39053),XZ=r(26202),YZ=["tooltipTemplate"],KZ=["leftOuterSelectionBar"],$Z=["rightOuterSelectionBar"],QZ=["fullBar"],ZZ=["selectionBar"],JZ=["minHandle"],eJ=["maxHandle"],tJ=["floorLabel"],nJ=["ceilLabel"],iJ=["minHandleLabel"],rJ=["maxHandleLabel"],oJ=["combinedLabel"],aJ=["ticksElement"];function sJ(e,t){if(1&e&&Is(0,"ng5-slider-tooltip-wrapper",31),2&e){var n=Ws().$implicit;Ts("template",Ws().tooltipTemplate)("tooltip",n.valueTooltip)("placement",n.valueTooltipPlacement)("content",n.value)}}function uJ(e,t){1&e&&Is(0,"span",32),2&e&&Ts("innerHTML",Ws().$implicit.legend,qr)}var cJ=function(e){return{"ng5-slider-selected":e}};function lJ(e,t){if(1&e&&(As(0,"span",27),Is(1,"ng5-slider-tooltip-wrapper",28),Cs(2,sJ,1,4,"ng5-slider-tooltip-wrapper",29),Cs(3,uJ,1,1,"span",30),Ms()),2&e){var n=t.$implicit,i=Ws();Ts("ngClass",$c(7,cJ,n.selected))("ngStyle",n.style),Yo(1),Ts("template",i.tooltipTemplate)("tooltip",n.tooltip)("placement",n.tooltipPlacement),Yo(1),Ts("ngIf",null!=n.value),Yo(1),Ts("ngIf",null!=n.legend)}}function hJ(e,t){}function dJ(e,t){1&e&&Cs(0,hJ,0,0,"ng-template")}var fJ=function(e,t,n){return{tooltip:e,placement:t,content:n}};function pJ(e,t){if(1&e&&(Rs(0),Cs(1,dJ,1,0,void 0,1),Ds()),2&e){var n=Ws();Yo(1),Ts("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=ws(e,t,n,i);return _s(e,t+2,r)||o}(e,u,r,o,a)?bs(e,u+3,s?i.call(s,r,o,a):i(r,o,a)):Qc(e,u+3)}(mn(),On(),e,t,n,i,r,o)}(2,fJ,n.tooltip,n.placement,n.content))}}function vJ(e,t){if(1&e&&(Rs(0),As(1,"div",2),Cu(2),Ms(),Ds()),2&e){var n=Ws();Yo(1),ks("title",n.tooltip)("data-tooltip-placement",n.placement),Yo(1),Ou(" ",n.content," ")}}var gJ={Min:0,Max:1};gJ[gJ.Min]="Min",gJ[gJ.Max]="Max";var mJ={Low:0,High:1,Floor:2,Ceil:3,TickValue:4};mJ[mJ.Low]="Low",mJ[mJ.High]="High",mJ[mJ.Floor]="Floor",mJ[mJ.Ceil]="Ceil",mJ[mJ.TickValue]="TickValue";var yJ=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},bJ=function e(){m(this,e)},_J=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}(CJ);return e.\u0275fac=function(t){return new(t||e)(Os(Ju),Os(nc),Os(Cc))},e.\u0275dir=Rt({type:e,selectors:[["","ng5SliderLabel",""]],features:[cs]}),e}(),TJ=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},PJ=function e(){m(this,e),this.active=!1,this.value=0,this.difference=0,this.position=0,this.lowLimit=0,this.highLimit=0},AJ=function(){function e(){m(this,e)}return b(e,null,[{key:"compare",value:function(e,t){return!(_J.isNullOrUndefined(e)&&_J.isNullOrUndefined(t)||_J.isNullOrUndefined(e)!==_J.isNullOrUndefined(t))&&e.value===t.value&&e.highValue===t.highValue}}]),e}(),MJ=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!(_J.isNullOrUndefined(e)&&_J.isNullOrUndefined(t)||_J.isNullOrUndefined(e)!==_J.isNullOrUndefined(t))&&e.value===t.value&&e.highValue===t.highValue&&e.forceChange===t.forceChange}}]),n}(AJ),IJ={provide:Hz,useExisting:He(function(){return RJ}),multi:!0},RJ=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 ol,this.highValue=null,this.highValueChange=new ol,this.options=new yJ,this.userChangeStart=new ol,this.userChange=new ol,this.userChangeEnd=new ol,this.initHasRun=!1,this.inputModelChangeSubject=new WZ.xQ,this.inputModelChangeSubscription=null,this.outputModelChangeSubject=new WZ.xQ,this.outputModelChangeSubscription=null,this.viewLowValue=null,this.viewHighValue=null,this.viewOptions=new yJ,this.handleHalfDimension=0,this.maxHandlePosition=0,this.currentTrackingPointer=null,this.currentFocusPointer=null,this.firstKeyDown=!1,this.touchId=null,this.dragging=new PJ,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 SJ(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!_J.isNullOrUndefined(this.value)&&!_J.isNullOrUndefined(this.highValue)}},{key:"showTicks",get:function(){return this.viewOptions.showTicks}},{key:"ngOnInit",value:function(){this.viewOptions=new yJ,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){_J.isNullOrUndefined(e.options)||this.onChangeOptions(),(!_J.isNullOrUndefined(e.value)||!_J.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,qZ.distinctUntilChanged)(MJ.compare),(0,qZ.filter)(function(e){return!e.forceChange&&!e.internalChange}),_J.isNullOrUndefined(e)?(0,qZ.tap)(function(){}):(0,qZ.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,qZ.distinctUntilChanged)(MJ.compare),_J.isNullOrUndefined(e)?(0,qZ.tap)(function(){}):(0,qZ.throttleTime)(e,void 0,{leading:!0,trailing:!0})).subscribe(function(e){return t.publishOutputModelChange(e)})}},{key:"subscribeResizeObserver",value:function(){var e=this;wJ.isResizeObserverAvailable()&&(this.resizeObserver=new ResizeObserver(function(){return e.calculateViewDimensionsAndDetectChanges()}),this.resizeObserver.observe(this.elementRef.nativeElement))}},{key:"unsubscribeResizeObserver",value:function(){wJ.isResizeObserverAvailable()&&null!==this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)}},{key:"unsubscribeOnMove",value:function(){_J.isNullOrUndefined(this.onMoveEventListener)||(this.eventListenerHelper.detachEventListener(this.onMoveEventListener),this.onMoveEventListener=null)}},{key:"unsubscribeOnEnd",value:function(){_J.isNullOrUndefined(this.onEndEventListener)||(this.eventListenerHelper.detachEventListener(this.onEndEventListener),this.onEndEventListener=null)}},{key:"unsubscribeInputModelChangeSubject",value:function(){_J.isNullOrUndefined(this.inputModelChangeSubscription)||(this.inputModelChangeSubscription.unsubscribe(),this.inputModelChangeSubscription=null)}},{key:"unsubscribeOutputModelChangeSubject",value:function(){_J.isNullOrUndefined(this.outputModelChangeSubscription)||(this.outputModelChangeSubscription.unsubscribe(),this.outputModelChangeSubscription=null)}},{key:"unsubscribeManualRefresh",value:function(){_J.isNullOrUndefined(this.manualRefreshSubscription)||(this.manualRefreshSubscription.unsubscribe(),this.manualRefreshSubscription=null)}},{key:"unsubscribeTriggerFocus",value:function(){_J.isNullOrUndefined(this.triggerFocusSubscription)||(this.triggerFocusSubscription.unsubscribe(),this.triggerFocusSubscription=null)}},{key:"getPointerElement",value:function(e){return e===gJ.Min?this.minHandleElement:e===gJ.Max?this.maxHandleElement:null}},{key:"getCurrentTrackingValue",value:function(){return this.currentTrackingPointer===gJ.Min?this.viewLowValue:this.currentTrackingPointer===gJ.Max?this.viewHighValue:null}},{key:"modelValueToViewValue",value:function(e){return _J.isNullOrUndefined(e)?NaN:_J.isNullOrUndefined(this.viewOptions.stepsArray)||this.viewOptions.bindIndexForStepsArray?+e:_J.findStepIndex(+e,this.viewOptions.stepsArray)}},{key:"viewValueToModelValue",value:function(e){return _J.isNullOrUndefined(this.viewOptions.stepsArray)||this.viewOptions.bindIndexForStepsArray?e:this.getStepValue(e)}},{key:"getStepValue",value:function(e){var t=this.viewOptions.stepsArray[e];return _J.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=!AJ.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),_J.isNullOrUndefined(t.onChangeCallback)||t.onChangeCallback(t.range?[e.value,e.highValue]:e.value),_J.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 AJ;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))),!_J.isNullOrUndefined(this.viewOptions.stepsArray)||!this.viewOptions.enforceRange)return t;if(t.value=kJ.clampToRange(t.value,this.viewOptions.floor,this.viewOptions.ceil),this.range&&(t.highValue=kJ.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);AJ.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 yJ,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||!_J.isNullOrUndefined(this.viewOptions.ticksArray),this.viewOptions.showTicks&&(!_J.isNullOrUndefined(this.viewOptions.tickStep)||!_J.isNullOrUndefined(this.viewOptions.ticksArray))&&(this.intermediateTicks=!0),this.viewOptions.showSelectionBar=this.viewOptions.showSelectionBar||this.viewOptions.showSelectionBarEnd||!_J.isNullOrUndefined(this.viewOptions.showSelectionBarFromValue),_J.isNullOrUndefined(this.viewOptions.stepsArray)?this.applyFloorCeilOptions():this.applyStepsArrayOptions(),_J.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,_J.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(_J.isNullOrUndefined(this.viewOptions.step)?this.viewOptions.step=1:(this.viewOptions.step=+this.viewOptions.step,this.viewOptions.step<=0&&(this.viewOptions.step=1)),_J.isNullOrUndefined(this.viewOptions.ceil)||_J.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,_J.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!==gJ.Min&&e!==gJ.Max&&(e=gJ.Min),e===gJ.Min?this.minHandleElement.focus():this.range&&e===gJ.Max&&this.maxHandleElement.focus()}},{key:"refocusPointerIfNeeded",value:function(){_J.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;_J.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"),_J.isNullOrUndefined(this.viewOptions.ariaLabel)?_J.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",_J.isNullOrUndefined(this.viewOptions.ariaLabelHigh)?_J.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,mJ.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,mJ.High),this.maxHandleElement.ariaValueMin=this.viewOptions.floor.toString(),this.maxHandleElement.ariaValueMax=this.viewOptions.ceil.toString())}},{key:"calculateViewDimensions",value:function(){_J.isNullOrUndefined(this.viewOptions.handleDimension)?this.minHandleElement.calculateDimension():this.minHandleElement.setDimension(this.viewOptions.handleDimension);var e=this.minHandleElement.dimension;this.handleHalfDimension=e/2,_J.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=_J.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 TJ;if(o.selected=e.isTickSelected(t),o.style={"-webkit-transform":r,"-moz-transform":r,"-o-transform":r,"-ms-transform":r,transform:r},o.selected&&!_J.isNullOrUndefined(e.viewOptions.getSelectionBarColor)&&(o.style["background-color"]=e.getSelectionBarColor()),!o.selected&&!_J.isNullOrUndefined(e.viewOptions.getTickColor)&&(o.style["background-color"]=e.getTickColor(t)),_J.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,mJ.TickValue),_J.isNullOrUndefined(e.viewOptions.ticksValuesTooltip)||(o.valueTooltip=e.viewOptions.ticksValuesTooltip(t),o.valueTooltipPlacement=e.viewOptions.vertical?"right":"top")),!_J.isNullOrUndefined(e.viewOptions.getLegend)){var a=e.viewOptions.getLegend(t);_J.isNullOrUndefined(a)||(o.legend=a)}return o});if(_J.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,mJ.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,mJ.Ceil)),this.ceilLabelElement.calculateDimension(),this.ceilLabelElement.setPosition(this.viewOptions.rightToLeft?0:this.fullBarElement.dimension-this.ceilLabelElement.dimension))}},{key:"updateHandles",value:function(e,t){e===gJ.Min?this.updateLowHandle(t):e===gJ.Max&&this.updateHighHandle(t),this.updateSelectionBar(),this.updateTicksScale(),this.range&&this.updateCombinedLabel()}},{key:"getHandleLabelPos",value:function(e,t){var n=e===gJ.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===gJ.Min||!this.viewOptions.rightToLeft&&e===gJ.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,mJ.Low)),this.minHandleLabelElement.setPosition(this.getHandleLabelPos(gJ.Min,e)),_J.isNullOrUndefined(this.viewOptions.getPointerColor)||(this.minPointerStyle={backgroundColor:this.getPointerColor(gJ.Min)}),this.viewOptions.autoHideLimitLabels&&this.updateFloorAndCeilLabelsVisibility()}},{key:"updateHighHandle",value:function(e){this.maxHandleElement.setPosition(e),this.maxHandleLabelElement.setValue(this.getDisplayValue(this.viewHighValue,mJ.High)),this.maxHandleLabelElement.setPosition(this.getHandleLabelPos(gJ.Max,e)),_J.isNullOrUndefined(this.viewOptions.getPointerColor)||(this.maxPointerStyle={backgroundColor:this.getPointerColor(gJ.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(_J.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))),_J.isNullOrUndefined(this.viewOptions.getSelectionBarColor)){if(!_J.isNullOrUndefined(this.viewOptions.selectionBarGradient)){var a=_J.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===gJ.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,mJ.Low),t=this.getDisplayValue(this.viewHighValue,mJ.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!_J.isNullOrUndefined(this.viewOptions.stepsArray)&&!this.viewOptions.bindIndexForStepsArray&&(e=this.getStepValue(e)),this.viewOptions.translate(e,t)}},{key:"roundStep",value:function(e,t){var n=_J.isNullOrUndefined(t)?this.viewOptions.step:t,i=kJ.roundToPrecisionLimit((e-this.viewOptions.floor)/n,this.viewOptions.precisionLimit);return i=Math.round(i)*n,kJ.roundToPrecisionLimit(this.viewOptions.floor+i,this.viewOptions.precisionLimit)}},{key:"valueToPosition",value:function(e){var t=_J.linearValueToPosition;_J.isNullOrUndefined(this.viewOptions.customValueToPosition)?this.viewOptions.logScale&&(t=_J.logValueToPosition):t=this.viewOptions.customValueToPosition;var n=t(e=kJ.clampToRange(e,this.viewOptions.floor,this.viewOptions.ceil),this.viewOptions.floor,this.viewOptions.ceil);return _J.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=_J.linearPositionToValue;_J.isNullOrUndefined(this.viewOptions.customPositionToValue)?this.viewOptions.logScale&&(n=_J.logPositionToValue):n=this.viewOptions.customPositionToValue;var i=n(t,this.viewOptions.floor,this.viewOptions.ceil);return _J.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(!_J.isNullOrUndefined(t))for(var r=0;ri?gJ.Max:this.viewOptions.rightToLeft?t>this.minHandleElement.position?gJ.Min:gJ.Max:t=this.maxHandlePosition?o=this.viewOptions.rightToLeft?this.viewOptions.floor:this.viewOptions.ceil:(o=this.positionToValue(a),o=t&&!_J.isNullOrUndefined(this.viewOptions.tickStep)?this.roundStep(o,this.viewOptions.tickStep):this.roundStep(o)),this.positionTrackingHandle(o)}},{key:"onEnd",value:function(e){wJ.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,_J.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=_J.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(!_J.isNullOrUndefined(i)&&!_J.isNullOrUndefined(this.currentTrackingPointer)){e.preventDefault(),this.firstKeyDown&&(this.firstKeyDown=!1,this.userChangeStart.emit(this.getChangeContext()));var r=kJ.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===gJ.Min?(a=o,(s=o+u)>this.viewOptions.ceil&&(a=(s=this.viewOptions.ceil)-u)):this.currentTrackingPointer===gJ.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){!_J.isNullOrUndefined(this.viewOptions.minLimit)&&ethis.viewOptions.maxLimit&&(e=kJ.roundToPrecisionLimit((t=this.viewOptions.maxLimit)-this.dragging.difference,this.viewOptions.precisionLimit)),this.viewLowValue=e,this.viewHighValue=t,this.applyViewChange(),this.updateHandles(gJ.Min,this.valueToPosition(e)),this.updateHandles(gJ.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===gJ.Min&&e>this.viewHighValue?e=this.applyMinMaxRange(this.viewHighValue):this.currentTrackingPointer===gJ.Max&&ethis.viewHighValue?(this.viewLowValue=this.viewHighValue,this.applyViewChange(),this.updateHandles(gJ.Min,this.maxHandleElement.position),this.updateAriaAttributes(),this.currentTrackingPointer=gJ.Max,this.minHandleElement.active=!1,this.maxHandleElement.active=!0,this.viewOptions.keyboardSupport&&this.maxHandleElement.focus()):this.currentTrackingPointer===gJ.Max&&ethis.viewOptions.maxLimit?this.viewOptions.maxLimit:e}},{key:"applyMinMaxRange",value:function(e){var t=Math.abs(e-(this.currentTrackingPointer===gJ.Min?this.viewHighValue:this.viewLowValue));if(!_J.isNullOrUndefined(this.viewOptions.minRange)&&tthis.viewOptions.maxRange){if(this.currentTrackingPointer===gJ.Min)return kJ.roundToPrecisionLimit(this.viewHighValue-this.viewOptions.maxRange,this.viewOptions.precisionLimit);if(this.currentTrackingPointer===gJ.Max)return kJ.roundToPrecisionLimit(this.viewLowValue+this.viewOptions.maxRange,this.viewOptions.precisionLimit)}return e}},{key:"applyPushRange",value:function(e){var t=this.currentTrackingPointer===gJ.Min?this.viewHighValue-e:e-this.viewLowValue,n=_J.isNullOrUndefined(this.viewOptions.minRange)?this.viewOptions.step:this.viewOptions.minRange,i=this.viewOptions.maxRange;return ti&&(this.currentTrackingPointer===gJ.Min?(this.viewHighValue=kJ.roundToPrecisionLimit(e+i,this.viewOptions.precisionLimit),this.applyViewChange(),this.updateHandles(gJ.Max,this.valueToPosition(this.viewHighValue))):this.currentTrackingPointer===gJ.Max&&(this.viewLowValue=kJ.roundToPrecisionLimit(e-i,this.viewOptions.precisionLimit),this.applyViewChange(),this.updateHandles(gJ.Min,this.valueToPosition(this.viewLowValue))),this.updateAriaAttributes()),e}},{key:"getChangeContext",value:function(){var e=new bJ;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)(Os(nc),Os(Ju),Os(Cc),Os(Xl))},e.\u0275cmp=Ot({type:e,selectors:[["ng5-slider"]],contentQueries:function(e,t,n){var i;(1&e&&bl(n,YZ,5),2&e)&&(ml(i=_l())&&(t.tooltipTemplate=i.first))},viewQuery:function(e,t){var n;(1&e&&(yl(KZ,5,CJ),yl($Z,5,CJ),yl(QZ,5,CJ),yl(ZZ,5,CJ),yl(JZ,5,EJ),yl(eJ,5,EJ),yl(tJ,5,OJ),yl(nJ,5,OJ),yl(iJ,5,OJ),yl(rJ,5,OJ),yl(oJ,5,OJ),yl(aJ,5,CJ)),2&e)&&(ml(n=_l())&&(t.leftOuterSelectionBarElement=n.first),ml(n=_l())&&(t.rightOuterSelectionBarElement=n.first),ml(n=_l())&&(t.fullBarElement=n.first),ml(n=_l())&&(t.selectionBarElement=n.first),ml(n=_l())&&(t.minHandleElement=n.first),ml(n=_l())&&(t.maxHandleElement=n.first),ml(n=_l())&&(t.floorLabelElement=n.first),ml(n=_l())&&(t.ceilLabelElement=n.first),ml(n=_l())&&(t.minHandleLabelElement=n.first),ml(n=_l())&&(t.maxHandleLabelElement=n.first),ml(n=_l())&&(t.combinedLabelElement=n.first),ml(n=_l())&&(t.ticksElement=n.first))},hostAttrs:[1,"ng5-slider"],hostVars:5,hostBindings:function(e,t){1&e&&Vs("resize",function(e){return t.onResize(e)},!1,io),2&e&&(ks("disabled",t.sliderElementDisabledAttr),cu("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:[Xu([IJ]),qt],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&&(As(0,"span",0,1),Is(2,"span",2),Ms(),As(3,"span",3,4),Is(5,"span",2),Ms(),As(6,"span",5,6),Is(8,"span",2),Ms(),As(9,"span",7,8),Is(11,"span",9),Ms(),Is(12,"span",10,11),Is(14,"span",12,13),Is(16,"span",14,15),Is(18,"span",16,17),Is(20,"span",18,19),Is(22,"span",20,21),Is(24,"span",22,23),As(26,"span",24,25),Cs(28,lJ,4,9,"span",26),Ms()),2&e&&(Yo(6),cu("ng5-slider-transparent",t.fullBarTransparentClass),Yo(3),cu("ng5-slider-draggable",t.selectionBarDraggableClass),Yo(2),Ts("ngStyle",t.barStyle),Yo(1),Ts("ngStyle",t.minPointerStyle),Yo(2),uu("display",t.range?"inherit":"none"),Ts("ngStyle",t.maxPointerStyle),Yo(12),cu("ng5-slider-ticks-values-under",t.ticksUnderValuesClass),Ts("hidden",!t.showTicks),Yo(2),Ts("ngForOf",t.ticks))},directives:function(){return[CJ,td,EJ,OJ,qh,Gh,DJ,Yh]},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}(),DJ=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=Ot({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&&(Cs(0,pJ,2,6,"ng-container",0),Cs(1,vJ,3,3,"ng-container",0)),2&e&&(Ts("ngIf",t.template),Yo(1),Ts("ngIf",!t.template))},directives:[Yh,nd],styles:[".ng5-slider-inner-tooltip[_ngcontent-%COMP%]{height:100%}"]}),e}(),NJ=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({imports:[[cd]]}),e}(),LJ=["popover"];function jJ(e,t){if(1&e){var n=Ls();As(0,"div",7,8),As(2,"div"),As(3,"div",9),Cu(4),Ms(),As(5,"input",10),Vs("keyup",function(e){return bn(n),Ws().onKeyLow(e)}),Ms(),Ms(),As(6,"ng5-slider",11),Vs("valueChange",function(e){return bn(n),Ws().lowValue=e})("highValueChange",function(e){return bn(n),Ws().highValue=e})("userChangeEnd",function(){return bn(n),Ws().sliderValueChanged()}),Ms(),As(7,"div"),As(8,"div",12),Cu(9),Ms(),As(10,"input",13),Vs("keyup",function(e){return bn(n),Ws().onKeyHigh(e)}),Ms(),Ms(),Ms()}if(2&e){var i=Ws();Yo(2),Pu("label min fade-in ",i.contentsVisible,""),Yo(2),Ou(" ",i.options.floor,"> "),Yo(1),Ks("value",i.lowValue),Yo(1),Pu("slider fade-in ",i.contentsVisible,""),Ts("options",i.options)("value",i.lowValue)("highValue",i.highValue),Yo(1),Pu("label max fade-in ",i.contentsVisible,""),Yo(2),Ou(" ",i.options.ceil," "),Yo(1),Ks("value",i.highValue)}}var FJ=function(){var e=function(){function e(t,n,i){m(this,e),this.element=n,this.ga=i,this.selectionChange=new ol,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)(Os(iv),Os(Ju),Os(yq))},e.\u0275cmp=Ot({type:e,selectors:[["ccf-dual-slider"]],viewQuery:function(e,t){var n;(1&e&&(yl(vp,7),yl(LJ,5,Ju)),2&e)&&(ml(n=_l())&&(t.popoverPortal=n.first),ml(n=_l())&&(t.popoverElement=n.first))},hostBindings:function(e,t){1&e&&Vs("click",function(e){return t.closeSliderPopover(e.target)},!1,ro)("touchstart",function(e){return t.closeSliderPopover(e.target)},!1,ro)},inputs:{label:"label",valueRange:"valueRange",selection:"selection"},outputs:{selectionChange:"selectionChange"},features:[qt],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&&(As(0,"div",0),As(1,"div",1),Cs(2,jJ,11,16,"div",2),As(3,"mat-form-field",3),Vs("click",function(){return t.toggleSliderPopover()}),As(4,"div",4),As(5,"span",5),Cu(6),Ms(),As(7,"span",6),Cu(8),Ms(),Ms(),Is(9,"mat-select"),Ms(),Ms(),Ms()),2&e&&(Yo(3),cu("highlight",t.isSliderOpen),Yo(3),Eu(t.label),Yo(2),Eu(t.rangeLabel))},directives:[gp,RH,zZ,RJ],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 BJ(e,t){if(1&e){var n=Ls();As(0,"div",4),As(1,"mat-checkbox",5),Vs("change",function(e){var t=bn(n).$implicit;return Ws().filterOnChange(e,t)}),Cu(2),Ms(),Ms()}if(2&e){var i=t.$implicit,r=Ws();Yo(1),Ts("checked",null==r.selection?null:r.selection.includes(i)),Yo(1),Ou(" ",i," ")}}var VJ,zJ=function(){var e=function(){function e(t){m(this,e),this.ga=t,this.selection=[],this.columns=3,this.selectionChange=new ol}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)(Os(yq))},e.\u0275cmp=Ot({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&&(As(0,"div",0),As(1,"div",1),Cu(2),Ms(),As(3,"div",2),Cs(4,BJ,3,2,"div",3),Ms(),Ms()),2&e&&(Yo(2),Eu(t.label),Yo(1),cu("three",3===t.columns)("four",4===t.columns),Yo(1),Ts("ngForOf",t.options))},directives:[qh,e$],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%}"],changeDetection:0}),e}(),UJ=function(){var e=function e(){m(this,e)};return e.type="[SpatialSearchUi] Really update spatial search data",e}(),HJ=VJ=function(){function e(t,n,i,r){m(this,e),this.dataSource=t,this.store=n,this.ga=r,i.pipe(sz(_Z),_v(500),mv(function(){return n.dispatch(UJ)})).subscribe()}return b(e,[{key:"startSpatialSearchFlow",value:function(e){var t=e.getState(),n=t.sex,i=t.organId,r=null==i?void 0:i.split("/").slice(-1)[0];return this.ga.event("set_organ","spatial_search_ui","".concat(n,"_").concat(r)),e.dispatch(new fZ(n))}},{key:"setSex",value:function(e,t){var n=t.sex,i=e.getState().organId;e.patchState({sex:n}),this.ga.event("set_sex","spatial_search_ui",n),void 0!==i&&!this.organValidForSex(i,n)&&(i=void 0);var r=Object.assign(Object.assign({},this.store.selectSnapshot(OQ.filter)),{spatialSearches:[]}),o=this.store.selectSnapshot(BQ.referenceOrgans);return this.dataSource.getOntologyTermOccurences(r).pipe(_p(1),mv(function(t){e.patchState({referenceOrgans:o.filter(function(e){return e.id&&!e.disabled&&t[e.id]>0})}),e.dispatch(new pZ(i))}))}},{key:"setOrgan",value:function(e,t){var n=t.organId,i=e.getState().sex;e.patchState({sex:i,organId:n});var r=null==n?void 0:n.split("/").slice(-1)[0];this.ga.event("set_organ","spatial_search_ui",r);var o=this.store.selectSnapshot(VJ.organEntity);if(o&&n&&o.sex){var a=o.x_dimension,s=o.y_dimension,u=o.z_dimension,c={x:Math.round(a/2),y:Math.round(s/2),z:Math.round(u/2)},l=Math.round(.07*Math.max(a,s,u)),h=this.store.selectSnapshot(OQ.filter),d=Object.assign(Object.assign({},h),{sex:o.sex,ontologyTerms:[n],spatialSearches:[]});return this.dataSource.getReferenceOrganScene(n,d).pipe(_p(1),mv(function(t){e.patchState({position:c,radius:l,defaultPosition:c,radiusSettings:{min:Math.min(l,5),max:Math.floor(Math.max(a,s,u)/1.5),defaultValue:l},organScene:QY(o).concat(t)})}),ke(function(){return e.dispatch(new _Z)}))}}},{key:"setPosition",value:function(e,t){var n=t.position;e.patchState({position:n}),e.dispatch(new _Z);var i=n.x,r=n.y,o=n.z;this.ga.event("set_position","spatial_search_ui","".concat(i,"_").concat(r,"_").concat(o))}},{key:"resetPosition",value:function(e){var t=e.getState().defaultPosition;e.patchState({position:t}),e.dispatch(new _Z);var n=null!=t?t:{x:0,y:0,z:0},i=n.x,r=n.y,o=n.z;this.ga.event("reset_position","spatial_search_ui","".concat(i,"_").concat(r,"_").concat(o))}},{key:"moveToNode",value:function(e,n){var i=n.node,r=t(new $O(i.transformMatrix).getTranslation().map(function(e){return Math.round(1e3*e)}),3),o=r[0],a=r[1],s=r[2];return e.dispatch(new vZ({x:o,y:a,z:s}))}},{key:"setRadius",value:function(e,t){var n=t.radius;e.patchState({radius:n}),e.dispatch(new _Z),this.ga.event("set_radius","spatial_search_ui",n.toFixed(1))}},{key:"resetRadius",value:function(e){var t,n=e.getState().radiusSettings,i=null!==(t=null==n?void 0:n.defaultValue)&&void 0!==t?t:0;e.patchState({radius:i}),e.dispatch(new _Z),this.ga.event("reset_radius","spatial_search_ui",i.toFixed(1))}},{key:"updateSpatialSearch",value:function(e){var t=e.getState(),n=t.position,i=t.radius,r=this.store.selectSnapshot(VJ.organEntity);if(r&&n&&i&&r.representation_of){var o=this.dataSource,a=r.representation_of,s=this.store.selectSnapshot(OQ.filter),u=Object.assign(Object.assign({},s),{sex:r.sex,ontologyTerms:[a],spatialSearches:[Object.assign(Object.assign({},n),{radius:i,target:r["@id"]})]});return jb({spatialSearchScene:o.getReferenceOrganScene(a,u).pipe(_p(1)),tissueBlocks:o.getTissueBlockResults(u).pipe(_p(1)),anatomicalStructures:o.getOntologyTermOccurences(u).pipe(_p(1)),cellTypes:o.getCellTypeTermOccurences(u).pipe(_p(1))}).pipe(mv(function(t){return e.patchState(t)}))}}},{key:"generateSpatialSearch",value:function(e){var t=e.getState(),n=t.position,i=t.radius,r=t.sex,o=t.organId,a=t.referenceOrgans,s=void 0===a?[]:a,u=t.executeSearchOnGeneration,c=this.store.selectSnapshot(VJ.organEntity),l=s.find(function(e){return e.id===o});if(n&&i&&(null==c?void 0:c.representation_of)&&l){var h=Object.assign(Object.assign({},n),{radius:i,target:c["@id"]}),d=[new TQ(r,l.name,h)];if(u){var f=this.store.selectSnapshot(IQ.selectedSearches);d.push(new wQ({spatialSearches:f.concat(h)}))}return this.ga.event("generate_search","spatial_search_ui"),e.dispatch(d).pipe(mv(function(){return e.patchState({sex:"female",organId:void 0})}))}}},{key:"setExecuteSearchOnGenerate",value:function(e,t){var n=t.execute;e.patchState({executeSearchOnGeneration:n})}},{key:"organValidForSex",value:function(e,t){var n=this.store.selectSnapshot(BQ.referenceOrgans).find(function(t){return t.id===e});return n.hasSex||n.sex===t}}],[{key:"organEntity",value:function(e,t){var n=e.organId,i=e.sex;return t.find(function(e){var t;return e.representation_of===n&&(null===(t=e.sex)||void 0===t?void 0:t.toLowerCase())===i})}}]),e}();HJ.\u0275fac=function(e){return new(e||HJ)(Zi(N$),Zi(Pz),Zi(fz),Zi(yq))},HJ.\u0275prov=$e({token:HJ,factory:HJ.\u0275fac}),Mw([jz(dZ)],HJ.prototype,"startSpatialSearchFlow",null),Mw([jz(fZ)],HJ.prototype,"setSex",null),Mw([jz(pZ)],HJ.prototype,"setOrgan",null),Mw([jz(vZ)],HJ.prototype,"setPosition",null),Mw([jz(mZ)],HJ.prototype,"resetPosition",null),Mw([jz(gZ)],HJ.prototype,"moveToNode",null),Mw([jz(yZ)],HJ.prototype,"setRadius",null),Mw([jz(bZ)],HJ.prototype,"resetRadius",null),Mw([jz(UJ)],HJ.prototype,"updateSpatialSearch",null),Mw([jz(wZ)],HJ.prototype,"generateSpatialSearch",null),Mw([jz(kZ)],HJ.prototype,"setExecuteSearchOnGenerate",null),Mw([Vz([VJ,BQ.referenceOrganEntities])],HJ,"organEntity",null),HJ=VJ=Mw([Fz({name:"spatialSearchUi",defaults:{sex:"female",executeSearchOnGeneration:!0}})],HJ);var GJ=function(){function e(){m(this,e)}return b(e,null,[{key:"sex",value:function(e){return e.sex}},{key:"referenceOrgans",value:function(e){var t;return null!==(t=e.referenceOrgans)&&void 0!==t?t:[]}},{key:"organId",value:function(e){return e.organId}},{key:"organ",value:function(e,t){if(void 0!==e)return t.find(function(t){return t.id===e})}},{key:"organs",value:function(e,t){var n=this;return t.filter(function(t){return n.organMatchesSex(t,e)})}},{key:"organMatchesSex",value:function(e,t){return e.hasSex||e.sex===t}},{key:"position",value:function(e){var t;return null!==(t=e.position)&&void 0!==t?t:{x:0,y:0,z:0}}},{key:"defaultPosition",value:function(e){var t;return null!==(t=e.defaultPosition)&&void 0!==t?t:{x:0,y:0,z:0}}},{key:"radius",value:function(e){var t;return null!==(t=e.radius)&&void 0!==t?t:0}},{key:"radiusSettings",value:function(e){var t;return null!==(t=e.radiusSettings)&&void 0!==t?t:{min:0,max:0,defaultValue:0}}},{key:"scene",value:function(e,t,n,i){var r,o,a=function(e,t){var n,i=e.x_dimension/1e3,r=e.y_dimension/1e3,o=e.z_dimension/1e3,a=.07*Math.max(i,r,o),s=.05*a,u=2*a,c=4*s;return t=t?Object.assign(Object.assign({},t),{radius:t.radius/1e3,x:t.x/1e3,y:t.y/1e3,z:t.z/1e3}):{target:null!==(n=e.representation_of)&&void 0!==n?n:e["@id"],radius:a,x:i/2,y:r/2,z:o/2},[{"@id":"http://purl.org/ccf/latest/ccf.owl#ProbingSphere","@type":"SpatialSceneNode",unpickable:!1,geometry:"sphere",transformMatrix:new $O($O.IDENTITY).translate([t.x,t.y,t.z]).scale(t.radius),color:HY},{"@id":"http://purl.org/ccf/latest/ccf.owl#ProbingsphereXD","@type":"SpatialSceneNode",unpickable:!0,geometry:"cylinder",transformMatrix:new $O($O.IDENTITY).translate([t.x+t.radius+u/2,t.y,t.z]).rotateZ(cS(-90)).scale([s,u,s]),color:GY},{"@id":"http://purl.org/ccf/latest/ccf.owl#ProbingsphereXDCone","@type":"SpatialSceneNode",unpickable:!0,geometry:"cone",transformMatrix:new $O($O.IDENTITY).translate([t.x+t.radius+u,t.y,t.z]).rotateZ(cS(-90)).scale([c,3*c,c]),color:GY},{"@id":"http://purl.org/ccf/latest/ccf.owl#ProbingsphereXDLabel","@type":"SpatialSceneNode",unpickable:!0,geometry:"text",text:"D",transformMatrix:new $O($O.IDENTITY).translate([t.x+t.radius+u+3*c,t.y,t.z]).scale(c),color:GY},{"@id":"http://purl.org/ccf/latest/ccf.owl#ProbingsphereXA","@type":"SpatialSceneNode",unpickable:!0,geometry:"cylinder",transformMatrix:new $O($O.IDENTITY).translate([t.x-t.radius-u/2,t.y,t.z]).rotateZ(cS(-90)).scale([s,u,s]),color:GY},{"@id":"http://purl.org/ccf/latest/ccf.owl#ProbingsphereXACone","@type":"SpatialSceneNode",unpickable:!0,geometry:"cone",transformMatrix:new $O($O.IDENTITY).translate([t.x-t.radius-u,t.y,t.z]).rotateZ(cS(90)).scale([c,3*c,c]),color:GY},{"@id":"http://purl.org/ccf/latest/ccf.owl#ProbingsphereXALabel","@type":"SpatialSceneNode",unpickable:!0,geometry:"text",text:"A",transformMatrix:new $O($O.IDENTITY).translate([t.x-t.radius-u-3.5*c,t.y,t.z]).scale(c),color:GY},{"@id":"http://purl.org/ccf/latest/ccf.owl#ProbingsphereYW","@type":"SpatialSceneNode",unpickable:!0,geometry:"cylinder",transformMatrix:new $O($O.IDENTITY).translate([t.x,t.y+t.radius+u/2,t.z]).scale([s,u,s]),color:WY},{"@id":"http://purl.org/ccf/latest/ccf.owl#ProbingsphereYWCone","@type":"SpatialSceneNode",unpickable:!0,geometry:"cone",transformMatrix:new $O($O.IDENTITY).translate([t.x,t.y+t.radius+u,t.z]).scale([c,3*c,c]),color:WY},{"@id":"http://purl.org/ccf/latest/ccf.owl#ProbingsphereYWLabel","@type":"SpatialSceneNode",unpickable:!0,geometry:"text",text:"W",transformMatrix:new $O($O.IDENTITY).translate([t.x,t.y+t.radius+u+3*c,t.z]).scale(c),color:WY},{"@id":"http://purl.org/ccf/latest/ccf.owl#ProbingsphereYS","@type":"SpatialSceneNode",unpickable:!0,geometry:"cylinder",transformMatrix:new $O($O.IDENTITY).translate([t.x,t.y-t.radius-u/2,t.z]).scale([s,u,s]),color:WY},{"@id":"http://purl.org/ccf/latest/ccf.owl#ProbingsphereYSCone","@type":"SpatialSceneNode",unpickable:!0,geometry:"cone",transformMatrix:new $O($O.IDENTITY).translate([t.x,t.y-t.radius-u,t.z]).rotateZ(cS(180)).scale([c,3*c,c]),color:WY},{"@id":"http://purl.org/ccf/latest/ccf.owl#ProbingsphereYSLabel","@type":"SpatialSceneNode",unpickable:!0,geometry:"text",text:"S",transformMatrix:new $O($O.IDENTITY).translate([t.x,t.y-t.radius-u-3.5*c,t.z]).scale(c),color:WY},{"@id":"http://purl.org/ccf/latest/ccf.owl#ProbingsphereZE","@type":"SpatialSceneNode",unpickable:!0,geometry:"cylinder",transformMatrix:new $O($O.IDENTITY).translate([t.x,t.y,t.z+t.radius+u/2]).rotateX(cS(90)).scale([s,u,s]),color:qY},{"@id":"http://purl.org/ccf/latest/ccf.owl#ProbingsphereZECone","@type":"SpatialSceneNode",unpickable:!0,geometry:"cone",transformMatrix:new $O($O.IDENTITY).translate([t.x,t.y,t.z+t.radius+u]).rotateX(cS(90)).scale([c,3*c,c]),color:qY},{"@id":"http://purl.org/ccf/latest/ccf.owl#ProbingsphereZELabel","@type":"SpatialSceneNode",unpickable:!0,geometry:"text",text:"E",transformMatrix:new $O($O.IDENTITY).translate([t.x,t.y,t.z+t.radius+u+3*c]).scale(c),color:qY},{"@id":"http://purl.org/ccf/latest/ccf.owl#ProbingsphereZQ","@type":"SpatialSceneNode",unpickable:!0,geometry:"cylinder",transformMatrix:new $O($O.IDENTITY).translate([t.x,t.y,t.z-t.radius-u/2]).rotateX(cS(-90)).scale([s,u,s]),color:qY},{"@id":"http://purl.org/ccf/latest/ccf.owl#ProbingsphereZQCone","@type":"SpatialSceneNode",unpickable:!0,geometry:"cone",transformMatrix:new $O($O.IDENTITY).translate([t.x,t.y,t.z-t.radius-u]).rotateX(cS(-90)).scale([c,3*c,c]),color:qY},{"@id":"http://purl.org/ccf/latest/ccf.owl#ProbingsphereZQLabel","@type":"SpatialSceneNode",unpickable:!0,geometry:"text",text:"Q",transformMatrix:new $O($O.IDENTITY).translate([t.x,t.y,t.z-t.radius-u-3.5*c]).scale(c),color:qY}]}(t,Object.assign(Object.assign({},n),{radius:i,target:t["@id"]})),s=new Set((null!==(r=e.tissueBlocks)&&void 0!==r?r:[]).map(function(e){return e.spatialEntityId}));return(null!==(o=e.organScene)&&void 0!==o?o:[]).map(function(e){return s.has(e["@id"])&&(e=Object.assign(Object.assign({},e),{color:[41,121,255,229.5]})),e}).concat(a)}},{key:"sceneBounds",value:function(e){var t=e.x_dimension,n=e.y_dimension,i=e.z_dimension,r=.42*Math.max(t,n,i);return{x:(r+t)/1e3,y:(r+n)/1e3,z:(r+i)/1e3}}},{key:"sceneTarget",value:function(e){return[e.x_dimension/1e3/2,e.y_dimension/1e3/2,e.z_dimension/1e3/2]}},{key:"tissueBlocks",value:function(e){var t;return null!==(t=e.tissueBlocks)&&void 0!==t?t:[]}},{key:"anatomicalStructures",value:function(e,t){return this.getTermCounts(e.anatomicalStructures,t)}},{key:"cellTypes",value:function(e,t){return this.getTermCounts(e.cellTypes,t)}},{key:"getTermCounts",value:function(e,n){return Object.entries(null!=e?e:{}).filter(function(e){var n=t(e,2);n[0];return n[1]>0}).map(function(e){var i,r,o=t(e,2),a=o[0],s=o[1];return{"@id":a,label:null!==(r=null===(i=n.nodes[a])||void 0===i?void 0:i.label)&&void 0!==r?r:a.split("/").slice(-1)[0],count:s}})}}]),e}();function WJ(e,t){if(1&e&&(As(0,"div",6),As(1,"mat-icon",7),Cu(2,"person"),Ms(),As(3,"div",8),As(4,"div",9),Cu(5),Ms(),As(6,"div",9),Cu(7),Ms(),Ms(),Ms()),2&e){var n=t.$implicit;Yo(5),Eu(n.donor.label),Yo(2),Eu(n.donor.description)}}GJ.organEntity=HJ.organEntity,Mw([Vz([HJ])],GJ,"sex",null),Mw([Vz([HJ])],GJ,"referenceOrgans",null),Mw([Vz([HJ])],GJ,"organId",null),Mw([Vz([GJ.organId,GJ.referenceOrgans])],GJ,"organ",null),Mw([Vz([GJ.sex,GJ.referenceOrgans])],GJ,"organs",null),Mw([Vz([HJ])],GJ,"position",null),Mw([Vz([HJ])],GJ,"defaultPosition",null),Mw([Vz([HJ])],GJ,"radius",null),Mw([Vz([HJ])],GJ,"radiusSettings",null),Mw([Vz([HJ,HJ.organEntity,GJ.position,GJ.radius])],GJ,"scene",null),Mw([Vz([HJ.organEntity])],GJ,"sceneBounds",null),Mw([Vz([HJ.organEntity])],GJ,"sceneTarget",null),Mw([Vz([HJ])],GJ,"tissueBlocks",null),Mw([Vz([HJ,OQ.anatomicalStructuresTreeModel])],GJ,"anatomicalStructures",null),Mw([Vz([HJ,OQ.cellTypesTreeModel])],GJ,"cellTypes",null);var qJ=function(){var e=function e(){m(this,e),this.className="ccf-tissue-block-list",this.tissueBlocks=[]};return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=Ot({type:e,selectors:[["ccf-tissue-block-list"]],hostVars:2,hostBindings:function(e,t){2&e&&du(t.className)},inputs:{tissueBlocks:"tissueBlocks"},decls:8,vars:2,consts:[[1,"tissue-block-header"],[1,"title"],["mat-icon-button","",1,"info"],["matTooltip","Total quantity of registered Tissue Blocks detected by the Probing Sphere","matTooltipPosition","right"],[1,"tissue-list"],["class","donor",4,"ngFor","ngForOf"],[1,"donor"],[1,"icon"],[1,"donor-info"],[1,"description"]],template:function(e,t){1&e&&(As(0,"div",0),As(1,"div",1),Cu(2),Ms(),As(3,"button",2),As(4,"mat-icon",3),Cu(5,"info"),Ms(),Ms(),Ms(),As(6,"div",4),Cs(7,WJ,8,2,"div",5),Ms()),2&e&&(Yo(2),Ou("",t.tissueBlocks.length," Tissue Blocks"),Yo(5),Ts("ngForOf",t.tissueBlocks))},directives:[B_,Ow,qh],styles:["[_nghost-%COMP%] .tissue-block-header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;margin-bottom:1rem}[_nghost-%COMP%] .tissue-block-header[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-size:.875rem}[_nghost-%COMP%] .tissue-block-header[_ngcontent-%COMP%] .info[_ngcontent-%COMP%]{padding:0;background:none;border:none;outline:none;border-radius:.25rem;transition:.6s}[_nghost-%COMP%] .tissue-list[_ngcontent-%COMP%]{overflow:auto}[_nghost-%COMP%] .donor[_ngcontent-%COMP%]{min-height:3rem;display:flex;font-size:.75rem;line-height:1rem;align-items:center;flex-grow:1;height:2.5rem;width:22rem;padding:.5rem;box-shadow:0 3px 6px #00000029;cursor:pointer;margin-right:1rem;margin-bottom:.5rem}[_nghost-%COMP%] .donor[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{margin-right:.5rem}[_nghost-%COMP%] .donor[_ngcontent-%COMP%] .donor-info[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-weight:600}[_nghost-%COMP%] .donor[_ngcontent-%COMP%] .donor-info[_ngcontent-%COMP%] .description[_ngcontent-%COMP%]{width:17rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}"],changeDetection:0}),e}();function XJ(e,t){if(1&e&&(As(0,"div",6),As(1,"div",7),As(2,"div",8),Cu(3),Ms(),As(4,"div",8),Cu(5),Ms(),Ms(),Ms()),2&e){var n=t.$implicit;Yo(3),Eu(n.label),Yo(2),Eu(n.count)}}var YJ=function(){var e=function e(){m(this,e),this.className="ccf-term-occurrence-list",this.termList=[]};return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=Ot({type:e,selectors:[["ccf-term-occurrence-list"]],hostVars:2,hostBindings:function(e,t){2&e&&du(t.className)},inputs:{termList:"termList",title:"title",toolTipText:"toolTipText"},decls:8,vars:4,consts:[[1,"term-list-header"],[1,"title"],["mat-icon-button","",1,"info"],["matTooltipPosition","right",3,"matTooltip"],[1,"term-list"],["class","donor",4,"ngFor","ngForOf"],[1,"donor"],[1,"term-bloc"],[1,"term-line"]],template:function(e,t){1&e&&(As(0,"div",0),As(1,"div",1),Cu(2),Ms(),As(3,"button",2),As(4,"mat-icon",3),Cu(5,"info"),Ms(),Ms(),Ms(),As(6,"div",4),Cs(7,XJ,6,2,"div",5),Ms()),2&e&&(Yo(2),Tu("",t.termList.length," ",t.title,""),Yo(2),Ks("matTooltip",t.toolTipText),Yo(3),Ts("ngForOf",t.termList))},directives:[B_,Ow,qh],styles:["[_nghost-%COMP%]{padding-top:1rem}[_nghost-%COMP%] .term-list-header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;margin-bottom:1rem}[_nghost-%COMP%] .term-list-header[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-size:.875rem}[_nghost-%COMP%] .term-list-header[_ngcontent-%COMP%] .counter[_ngcontent-%COMP%]{font-size:1rem}[_nghost-%COMP%] .term-list-header[_ngcontent-%COMP%] .info[_ngcontent-%COMP%]{padding-right:0;background:none;border:none;outline:none;border-radius:.25rem;transition:.6s}[_nghost-%COMP%] .term-list[_ngcontent-%COMP%]{overflow:auto;padding-left:2rem;font-size:1rem}[_nghost-%COMP%] .term-list[_ngcontent-%COMP%] .term-bloc[_ngcontent-%COMP%]{display:flex;justify-content:space-between;margin-bottom:1rem;overflow:auto}[_nghost-%COMP%] .term-list[_ngcontent-%COMP%] .term-line[_ngcontent-%COMP%]{padding-right:2rem}"],changeDetection:0}),e}();function KJ(e,t){if(1&e&&(As(0,"mat-icon",8),Cu(1),Ms()),2&e){var n=t.$implicit;cu("active",Ws().currentKey===n.key),Yo(1),Ou("",n.direction," ")}}function $J(e,t){1&e&&(As(0,"div",9),Cu(1,"SHIFT"),Ms())}var QJ=function(){var e=function e(){m(this,e),this.className="ccf-spatial-search-keyboard-ui",this.keyClicked=new ol,this.keyHovered=new ol,this.keyMap=[{key:"w",direction:"north"},{key:"s",direction:"south"},{key:"a",direction:"west"},{key:"d",direction:"east"},{key:"e",direction:"north_east"},{key:"q",direction:"south_west"}]};return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=Ot({type:e,selectors:[["ccf-spatial-search-keyboard-ui"]],hostVars:2,hostBindings:function(e,t){2&e&&du(t.className)},inputs:{currentKey:"currentKey",shiftPressed:"shiftPressed"},outputs:{keyClicked:"keyClicked",keyHovered:"keyHovered"},decls:18,vars:14,consts:[[1,"direction-arrow"],["class","arrow",3,"active",4,"ngFor","ngForOf"],[1,"keys"],[1,"keyrow"],[1,"key","blue",3,"mousedown","mouseover","mouseout"],[1,"key","green",3,"mousedown","mouseover","mouseout"],[1,"key","red",3,"mousedown","mouseover","mouseout"],["class","shift",4,"ngIf"],[1,"arrow"],[1,"shift"]],template:function(e,t){1&e&&(As(0,"div",0),Cs(1,KJ,2,3,"mat-icon",1),Ms(),As(2,"div",2),As(3,"div",3),As(4,"div",4),Vs("mousedown",function(){return t.keyClicked.emit("q")})("mouseover",function(){return t.keyHovered.emit("q")})("mouseout",function(){return t.keyHovered.emit()}),Cu(5,"Q"),Ms(),As(6,"div",5),Vs("mousedown",function(){return t.keyClicked.emit("w")})("mouseover",function(){return t.keyHovered.emit("w")})("mouseout",function(){return t.keyHovered.emit()}),Cu(7,"W"),Ms(),As(8,"div",4),Vs("mousedown",function(){return t.keyClicked.emit("e")})("mouseover",function(){return t.keyHovered.emit("e")})("mouseout",function(){return t.keyHovered.emit()}),Cu(9,"E"),Ms(),Ms(),As(10,"div",3),As(11,"div",6),Vs("mousedown",function(){return t.keyClicked.emit("a")})("mouseover",function(){return t.keyHovered.emit("a")})("mouseout",function(){return t.keyHovered.emit()}),Cu(12,"A"),Ms(),As(13,"div",5),Vs("mousedown",function(){return t.keyClicked.emit("s")})("mouseover",function(){return t.keyHovered.emit("s")})("mouseout",function(){return t.keyHovered.emit()}),Cu(14,"S"),Ms(),As(15,"div",6),Vs("mousedown",function(){return t.keyClicked.emit("d")})("mouseover",function(){return t.keyHovered.emit("d")})("mouseout",function(){return t.keyHovered.emit()}),Cu(16,"D"),Ms(),Ms(),Cs(17,$J,2,0,"div",7),Ms()),2&e&&(Yo(1),Ts("ngForOf",t.keyMap),Yo(3),cu("highlighted","q"===t.currentKey),Yo(2),cu("highlighted","w"===t.currentKey),Yo(2),cu("highlighted","e"===t.currentKey),Yo(3),cu("highlighted","a"===t.currentKey),Yo(2),cu("highlighted","s"===t.currentKey),Yo(2),cu("highlighted","d"===t.currentKey),Yo(2),Ts("ngIf",t.shiftPressed))},directives:[qh,Yh,B_],styles:["[_nghost-%COMP%] .direction-arrow[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(5,.5fr);grid-template-rows:1fr;grid-column-gap:0px;grid-row-gap:0px;margin-bottom:1rem;width:7rem}[_nghost-%COMP%] .direction-arrow[_ngcontent-%COMP%] .arrow[_ngcontent-%COMP%]{grid-area:1/3/2/4;opacity:0;transition:.5s}[_nghost-%COMP%] .direction-arrow[_ngcontent-%COMP%] .arrow.active[_ngcontent-%COMP%]{opacity:1}[_nghost-%COMP%] .keys[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:flex-start;padding:0;grid-gap:.5rem;gap:.5rem;width:7rem;height:7rem;-webkit-user-select:none;-moz-user-select:none;user-select:none}[_nghost-%COMP%] .keys[_ngcontent-%COMP%] .keyrow[_ngcontent-%COMP%]{display:flex;flex-direction:row;justify-content:center;align-items:center;padding:0;grid-gap:.5rem;gap:.5rem}[_nghost-%COMP%] .keys[_ngcontent-%COMP%] .keyrow[_ngcontent-%COMP%] .key[_ngcontent-%COMP%]{display:flex;flex-direction:column;justify-content:center;align-items:center;padding:.25rem;width:2rem;height:2rem;border:2px solid;border-radius:.5rem;cursor:pointer}[_nghost-%COMP%] .keys[_ngcontent-%COMP%] .shift[_ngcontent-%COMP%]{display:flex;flex-direction:column;justify-content:center;align-items:center;padding:.25rem;width:7rem;height:2rem;border:2px solid;border-radius:.5rem}"],changeDetection:0}),e}(),ZJ=function(){var e=function(){function e(){m(this,e),this.className="ccf-spatial-search-keyboard-ui-behavior",this.delta=1,this.shiftDelta=2,this.changePosition=new ol,this.shiftPressed=!1}return b(e,[{key:"updatePosition",value:function(e){if(this.currentDelta=this.shiftPressed?this.shiftDelta:this.delta,"Shift"===e)this.shiftPressed=!0;else{switch(this.currentKey=e.toLowerCase(),this.currentKey){case"q":this.position=Object.assign(Object.assign({},this.position),{z:this.position.z-this.currentDelta});break;case"e":this.position=Object.assign(Object.assign({},this.position),{z:this.position.z+this.currentDelta});break;case"w":this.position=Object.assign(Object.assign({},this.position),{y:this.position.y+this.currentDelta});break;case"s":this.position=Object.assign(Object.assign({},this.position),{y:this.position.y-this.currentDelta});break;case"a":this.position=Object.assign(Object.assign({},this.position),{x:this.position.x-this.currentDelta});break;case"d":this.position=Object.assign(Object.assign({},this.position),{x:this.position.x+this.currentDelta})}this.changePosition.emit(this.position)}}},{key:"handleKey",value:function(e){e.preventDefault(),this.updatePosition(e.key)}},{key:"keyUp",value:function(e){"Shift"===e.key?this.shiftPressed=!1:this.currentKey=void 0}},{key:"keyClick",value:function(e){this.updatePosition(e)}},{key:"keyHover",value:function(e){this.currentKey=e}}]),e}();return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=Ot({type:e,selectors:[["ccf-spatial-search-keyboard-ui-behavior"]],hostVars:2,hostBindings:function(e,t){1&e&&Vs("keydown",function(e){return t.handleKey(e)},!1,ro)("keyup",function(e){return t.keyUp(e)},!1,ro),2&e&&du(t.className)},inputs:{delta:"delta",shiftDelta:"shiftDelta",position:"position"},outputs:{changePosition:"changePosition"},decls:1,vars:2,consts:[[3,"currentKey","shiftPressed","keyClicked","keyHovered"]],template:function(e,t){1&e&&(As(0,"ccf-spatial-search-keyboard-ui",0),Vs("keyClicked",function(e){return t.keyClick(e)})("keyHovered",function(e){return t.keyHover(e)}),Ms()),2&e&&Ts("currentKey",t.currentKey)("shiftPressed",t.shiftPressed)},directives:[QJ],encapsulation:2,changeDetection:0}),e}(),JJ=function(){var e=function e(){m(this,e),this.className="ccf-spatial-search-ui",this.addSpatialSearch=new ol,this.resetPosition=new ol,this.resetSphere=new ol,this.closeSpatialSearch=new ol,this.radiusChange=new ol,this.positionChange=new ol,this.editReferenceOrganClicked=new ol,this.infoClicked=new ol,this.nodeClicked=new ol};return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=Ot({type:e,selectors:[["ccf-spatial-search-ui"]],hostVars:2,hostBindings:function(e,t){2&e&&du(t.className)},inputs:{scene:"scene",sceneBounds:"sceneBounds",sceneTarget:"sceneTarget",sex:"sex",referenceOrgan:"referenceOrgan",radius:"radius",radiusSettings:"radiusSettings",defaultPosition:"defaultPosition",position:"position",tissueBlocks:"tissueBlocks",anatomicalStructures:"anatomicalStructures",cellTypes:"cellTypes"},outputs:{addSpatialSearch:"addSpatialSearch",resetPosition:"resetPosition",resetSphere:"resetSphere",closeSpatialSearch:"closeSpatialSearch",radiusChange:"radiusChange",positionChange:"positionChange",editReferenceOrganClicked:"editReferenceOrganClicked",infoClicked:"infoClicked",nodeClicked:"nodeClicked"},decls:55,vars:27,consts:[[1,"header"],[1,"title"],["mat-icon-button","",1,"info"],[3,"click"],["mat-icon-button","",1,"close"],[1,"content"],[1,"info-panel"],[1,"organ-sex-selection"],[1,"sex"],[1,"label"],[1,"current-sex"],[1,"organ"],[1,"current-organ"],[1,"edit",3,"click"],[1,"radius-slider"],[1,"slider-container"],[1,"slider",3,"max","min","step","value","input"],[1,"text","value"],[1,"reset-buttons"],["mat-button","",1,"reset-sphere","button",3,"click"],["mat-button","",1,"reset-camera","button",3,"click"],[1,"results"],[1,"tissue-block","list",3,"tissueBlocks"],["title","Anatomical Structures","toolTipText","Total quantity of predicted anatomical structures detected by the Probing Sphere",1,"anatomical-structures","list",3,"termList"],["title","Predicted Cell Types from ASCT+B Tables","toolTipText","Total quantity of predicted cell types detected by the Probing Sphere",1,"cell-type","list",3,"termList"],["mat-button","",1,"run-spatial-search","button",3,"click"],[1,"spatial-search-scene"],[1,"primary-scene-wrapper"],[1,"body-ui-hint"],[1,"primary-scene",3,"scene","bounds","target","nodeClick","rotationChange"],["primary",""],[1,"sidebar"],[1,"minimap-scene",3,"interactive","scene","bounds","target","nodeClick"],["minimap",""],[3,"delta","shiftDelta","position","changePosition"],[3,"x","y","z"]],template:function(e,t){if(1&e){var n=Ls();As(0,"div",0),As(1,"div",1),Cu(2,"Configure Spatial Search"),Ms(),As(3,"button",2),As(4,"mat-icon",3),Vs("click",function(){return t.infoClicked.emit()}),Cu(5,"info"),Ms(),Ms(),As(6,"button",4),As(7,"mat-icon",3),Vs("click",function(){return t.closeSpatialSearch.emit()}),Cu(8,"close"),Ms(),Ms(),Ms(),As(9,"div",5),As(10,"div",6),As(11,"div",7),As(12,"div",8),As(13,"div",9),Cu(14,"Donor Sex: "),Ms(),As(15,"div",10),Cu(16),Ms(),Ms(),As(17,"div",11),As(18,"div",9),Cu(19,"Organ: "),Ms(),As(20,"div",12),Cu(21),Ms(),Ms(),As(22,"div",13),Vs("click",function(){return t.editReferenceOrganClicked.emit()}),Cu(23,"Edit"),Ms(),Ms(),Is(24,"mat-divider"),As(25,"div",14),As(26,"div",1),Cu(27,"Probing Sphere Radius"),Ms(),As(28,"div",15),As(29,"mat-slider",16),Vs("input",function(e){return t.radiusChange.emit(e.value)}),Ms(),As(30,"span",17),Cu(31),Ms(),Ms(),As(32,"div",18),As(33,"button",19),Vs("click",function(){return t.resetSphere.emit(),t.resetPosition.emit()}),Cu(34,"Reset Probing Sphere"),Ms(),As(35,"button",20),Vs("click",function(){bn(n);var e=Es(49),i=Es(52);return e.rotation=e.rotationX=i.rotation=i.rotationX=0,e.target=i.target=t.sceneTarget,e.bounds=i.bounds=t.sceneBounds}),Cu(36,"Reset Camera View"),Ms(),Ms(),Ms(),Is(37,"mat-divider"),As(38,"div",21),Is(39,"ccf-tissue-block-list",22),Is(40,"ccf-term-occurrence-list",23),Is(41,"ccf-term-occurrence-list",24),Ms(),As(42,"button",25),Vs("click",function(){return t.addSpatialSearch.emit()}),Cu(43,"Run Spatial Search"),Ms(),Ms(),As(44,"div",26),As(45,"div",27),As(46,"div",28),Cu(47,"Use the keyboard or click a Tissue Block to move the Probing Sphere"),Ms(),As(48,"ccf-body-ui",29,30),Vs("nodeClick",function(e){return t.nodeClicked.emit(null==e?null:e.node)})("rotationChange",function(e){bn(n);var t=Es(52);return t.rotation=e[0],t.rotationX=e[1]}),Ms(),Ms(),As(50,"div",31),As(51,"ccf-body-ui",32,33),Vs("nodeClick",function(e){return t.nodeClicked.emit(null==e?null:e.node)}),Ms(),As(53,"ccf-spatial-search-keyboard-ui-behavior",34),Vs("changePosition",function(e){return t.positionChange.emit(e)}),Ms(),Is(54,"ccf-xyz-position",35),Ms(),Ms(),Ms()}2&e&&(Yo(16),Eu(t.sex.charAt(0).toUpperCase()+t.sex.slice(1)),Yo(5),Eu(t.referenceOrgan.name),Yo(8),Ts("max",t.radiusSettings.max)("min",t.radiusSettings.min)("step",1)("value",t.radius),Yo(2),Ou("",t.radius," mm"),Yo(2),cu("disabled",t.radius===t.radiusSettings.defaultValue&&t.position===t.defaultPosition),Yo(6),Ts("tissueBlocks",t.tissueBlocks),Yo(1),Ts("termList",t.anatomicalStructures),Yo(1),Ts("termList",t.cellTypes),Yo(1),cu("disabled",0===(null==t.tissueBlocks?null:t.tissueBlocks.length)),Yo(6),Ts("scene",t.scene)("bounds",t.sceneBounds)("target",t.sceneTarget),Yo(3),Ts("interactive",!1)("scene",t.scene)("bounds",t.sceneBounds)("target",t.sceneTarget),Yo(2),Ts("delta",1)("shiftDelta",2)("position",t.position),Yo(1),Ts("x",t.position.x)("y",t.position.y)("z",t.position.z))},directives:[q_,B_,AK,_G,qJ,YJ,r$,ZJ,aQ],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;align-items:flex-start;padding:2rem;grid-gap:1rem;gap:1rem;height:95vh;width:78vw;border-radius:.25rem;min-height:45rem;min-width:60rem}[_nghost-%COMP%] .header[_ngcontent-%COMP%]{display:flex;width:100%}[_nghost-%COMP%] .header[_ngcontent-%COMP%] .info[_ngcontent-%COMP%], [_nghost-%COMP%] .header[_ngcontent-%COMP%] .close[_ngcontent-%COMP%]{padding:0;background:none;border:none;cursor:pointer;outline:none;border-radius:.25rem;transition:.6s}[_nghost-%COMP%] .header[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{display:flex;align-items:center;margin-right:1rem}[_nghost-%COMP%] .header[_ngcontent-%COMP%] .close[_ngcontent-%COMP%]{margin-left:auto}[_nghost-%COMP%] .content[_ngcontent-%COMP%]{display:flex;width:100%;height:calc(100% - 3.5rem)}[_nghost-%COMP%] .content[_ngcontent-%COMP%] .button[_ngcontent-%COMP%]{border-width:1px;border-style:solid;border-radius:.25rem;font-size:.875rem;height:2rem;line-height:2rem;transition:.5s}[_nghost-%COMP%] .content[_ngcontent-%COMP%] .button.disabled[_ngcontent-%COMP%]{opacity:.5;pointer-events:none}[_nghost-%COMP%] .content[_ngcontent-%COMP%] .info-panel[_ngcontent-%COMP%]{display:flex;flex-direction:column;margin-right:2rem;grid-gap:1rem;gap:1rem;width:25rem}[_nghost-%COMP%] .content[_ngcontent-%COMP%] .info-panel[_ngcontent-%COMP%] .organ-sex-selection[_ngcontent-%COMP%]{display:flex;font-size:1rem;justify-content:space-between}[_nghost-%COMP%] .content[_ngcontent-%COMP%] .info-panel[_ngcontent-%COMP%] .organ-sex-selection[_ngcontent-%COMP%] .sex[_ngcontent-%COMP%], [_nghost-%COMP%] .content[_ngcontent-%COMP%] .info-panel[_ngcontent-%COMP%] .organ-sex-selection[_ngcontent-%COMP%] .organ[_ngcontent-%COMP%]{display:flex}[_nghost-%COMP%] .content[_ngcontent-%COMP%] .info-panel[_ngcontent-%COMP%] .organ-sex-selection[_ngcontent-%COMP%] .sex[_ngcontent-%COMP%] .label[_ngcontent-%COMP%], [_nghost-%COMP%] .content[_ngcontent-%COMP%] .info-panel[_ngcontent-%COMP%] .organ-sex-selection[_ngcontent-%COMP%] .organ[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{font-weight:300;margin-right:.5rem}[_nghost-%COMP%] .content[_ngcontent-%COMP%] .info-panel[_ngcontent-%COMP%] .organ-sex-selection[_ngcontent-%COMP%] .sex[_ngcontent-%COMP%] .current-sex[_ngcontent-%COMP%], [_nghost-%COMP%] .content[_ngcontent-%COMP%] .info-panel[_ngcontent-%COMP%] .organ-sex-selection[_ngcontent-%COMP%] .sex[_ngcontent-%COMP%] .current-organ[_ngcontent-%COMP%], [_nghost-%COMP%] .content[_ngcontent-%COMP%] .info-panel[_ngcontent-%COMP%] .organ-sex-selection[_ngcontent-%COMP%] .organ[_ngcontent-%COMP%] .current-sex[_ngcontent-%COMP%], [_nghost-%COMP%] .content[_ngcontent-%COMP%] .info-panel[_ngcontent-%COMP%] .organ-sex-selection[_ngcontent-%COMP%] .organ[_ngcontent-%COMP%] .current-organ[_ngcontent-%COMP%]{font-weight:600}[_nghost-%COMP%] .content[_ngcontent-%COMP%] .info-panel[_ngcontent-%COMP%] .organ-sex-selection[_ngcontent-%COMP%] .edit[_ngcontent-%COMP%]{cursor:pointer}[_nghost-%COMP%] .content[_ngcontent-%COMP%] .info-panel[_ngcontent-%COMP%] .radius-slider[_ngcontent-%COMP%]{display:flex;flex-direction:column}[_nghost-%COMP%] .content[_ngcontent-%COMP%] .info-panel[_ngcontent-%COMP%] .radius-slider[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-weight:600;font-size:1rem}[_nghost-%COMP%] .content[_ngcontent-%COMP%] .info-panel[_ngcontent-%COMP%] .radius-slider[_ngcontent-%COMP%] .slider-container[_ngcontent-%COMP%]{display:flex;justify-content:space-between}[_nghost-%COMP%] .content[_ngcontent-%COMP%] .info-panel[_ngcontent-%COMP%] .radius-slider[_ngcontent-%COMP%] .slider-container[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%]{width:19rem}[_nghost-%COMP%] .content[_ngcontent-%COMP%] .info-panel[_ngcontent-%COMP%] .radius-slider[_ngcontent-%COMP%] .slider-container[_ngcontent-%COMP%] .value[_ngcontent-%COMP%]{display:flex;align-items:center;font-size:1rem}[_nghost-%COMP%] .content[_ngcontent-%COMP%] .info-panel[_ngcontent-%COMP%] .radius-slider[_ngcontent-%COMP%] .reset-buttons[_ngcontent-%COMP%]{display:flex;justify-content:space-between}[_nghost-%COMP%] .content[_ngcontent-%COMP%] .info-panel[_ngcontent-%COMP%] .radius-slider[_ngcontent-%COMP%] .reset-buttons[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{width:11.5rem}[_nghost-%COMP%] .content[_ngcontent-%COMP%] .info-panel[_ngcontent-%COMP%] .results[_ngcontent-%COMP%]{height:calc(100% - 15rem - 2px)}[_nghost-%COMP%] .content[_ngcontent-%COMP%] .info-panel[_ngcontent-%COMP%] .results[_ngcontent-%COMP%] .list[_ngcontent-%COMP%]{height:33%;display:flex;flex-direction:column}[_nghost-%COMP%] .content[_ngcontent-%COMP%] .spatial-search-scene[_ngcontent-%COMP%]{display:flex;width:calc(100% - 25rem);background-color:#000;border-radius:.5rem}[_nghost-%COMP%] .content[_ngcontent-%COMP%] .spatial-search-scene[_ngcontent-%COMP%] .primary-scene-wrapper[_ngcontent-%COMP%]{display:flex;flex-direction:column;width:100%;height:100%}[_nghost-%COMP%] .content[_ngcontent-%COMP%] .spatial-search-scene[_ngcontent-%COMP%] .primary-scene-wrapper[_ngcontent-%COMP%] .primary-scene[_ngcontent-%COMP%]{flex:auto;overflow:hidden}[_nghost-%COMP%] .content[_ngcontent-%COMP%] .spatial-search-scene[_ngcontent-%COMP%] .primary-scene-wrapper[_ngcontent-%COMP%] .body-ui-hint[_ngcontent-%COMP%]{color:#fff;font-size:1rem;margin:1rem}[_nghost-%COMP%] .content[_ngcontent-%COMP%] .spatial-search-scene[_ngcontent-%COMP%] .sidebar[_ngcontent-%COMP%] .minimap-scene[_ngcontent-%COMP%]{margin:1.5rem;width:12.75rem;height:11rem}[_nghost-%COMP%] .content[_ngcontent-%COMP%] .spatial-search-scene[_ngcontent-%COMP%] .sidebar[_ngcontent-%COMP%] .minimap-scene[_ngcontent-%COMP%] .body-ui{background-color:#232f3a}[_nghost-%COMP%] .content[_ngcontent-%COMP%] .spatial-search-scene[_ngcontent-%COMP%] .sidebar[_ngcontent-%COMP%] ccf-spatial-search-keyboard-ui-behavior[_ngcontent-%COMP%]{margin:1.5rem;display:flex;justify-content:center}[_nghost-%COMP%] .content[_ngcontent-%COMP%] .spatial-search-scene[_ngcontent-%COMP%] .sidebar[_ngcontent-%COMP%] ccf-xyz-position[_ngcontent-%COMP%]{margin:1.5rem;padding-left:5rem}"],changeDetection:0}),e}();function e0(e,t){if(1&e){var n=Ls();As(0,"ccf-spatial-search-ui",1),Vs("addSpatialSearch",function(){return bn(n),Ws().addSpatialSearch()})("radiusChange",function(e){return bn(n),Ws().updateRadius(e)})("resetPosition",function(){return bn(n),Ws().resetPosition()})("resetSphere",function(){return bn(n),Ws().resetRadius()})("positionChange",function(e){return bn(n),Ws().updatePosition(e)})("closeSpatialSearch",function(){return bn(n),Ws().close()})("editReferenceOrganClicked",function(){return bn(n),Ws().openSpatialSearchConfig()})("infoClicked",function(){return bn(n),Ws().onDialogButtonClick()})("nodeClicked",function(e){return bn(n),Ws().moveToNode(e)}),Jc(1,"async"),Jc(2,"async"),Jc(3,"async"),Jc(4,"async"),Jc(5,"async"),Jc(6,"async"),Jc(7,"async"),Jc(8,"async"),Jc(9,"async"),Jc(10,"async"),Jc(11,"async"),Ms()}if(2&e){var i=t.ngIf,r=Ws();Ts("sex",el(1,12,r.sex$))("referenceOrgan",i)("radius",el(2,14,r.radius$))("radiusSettings",el(3,16,r.radiusSettings$))("defaultPosition",el(4,18,r.defaultPosition$))("position",el(5,20,r.position$))("scene",el(6,22,r.scene$))("sceneBounds",el(7,24,r.sceneBounds$))("sceneTarget",el(8,26,r.sceneTarget$))("tissueBlocks",el(9,28,r.tissueBlocks$))("anatomicalStructures",el(10,30,r.anatomicalStructures$))("cellTypes",el(11,32,r.cellTypes$))}}var t0=function(){function e(t,n,i){m(this,e),this.dialogRef=t,this.dialog=n,this.infoService=i,this.updatePosition=vQ(vZ),this.resetPosition=vQ(mZ),this.moveToNode=vQ(gZ),this.updateRadius=vQ(yZ),this.resetRadius=vQ(bZ),this.subscriptions=new q}return b(e,[{key:"launchInfoDialog",value:function(e){this.subscriptions.unsubscribe(),this.dialog.open(k$,{autoFocus:!1,panelClass:"modal-animated",width:"72rem",data:{title:e.infoTitle,content:e.content,videoID:e.videoID}})}},{key:"onDialogButtonClick",value:function(){var e=this;this.infoService.updateData("assets/docs/SPATIAL_SEARCH_README.md","UfxMpzatowE","Spatial Search");var t=this.infoService.panelContent.asObservable();this.subscriptions.add(t.subscribe(function(t){t.content.length&&(e.panelData=t,e.launchInfoDialog(e.panelData))}))}},{key:"close",value:function(){this.dialogRef.close()}},{key:"addSpatialSearch",value:function(){return this.close(),new wZ}},{key:"openSpatialSearchConfig",value:function(){this.close(),this.dialog.open(y0)}}]),e}();t0.\u0275fac=function(e){return new(e||t0)(Os(MG),Os(FG),Os(S$))},t0.\u0275cmp=Ot({type:t0,selectors:[["ccf-spatial-search-ui-behavior"]],decls:2,vars:3,consts:[[3,"sex","referenceOrgan","radius","radiusSettings","defaultPosition","position","scene","sceneBounds","sceneTarget","tissueBlocks","anatomicalStructures","cellTypes","addSpatialSearch","radiusChange","resetPosition","resetSphere","positionChange","closeSpatialSearch","editReferenceOrganClicked","infoClicked","nodeClicked",4,"ngIf"],[3,"sex","referenceOrgan","radius","radiusSettings","defaultPosition","position","scene","sceneBounds","sceneTarget","tissueBlocks","anatomicalStructures","cellTypes","addSpatialSearch","radiusChange","resetPosition","resetSphere","positionChange","closeSpatialSearch","editReferenceOrganClicked","infoClicked","nodeClicked"]],template:function(e,t){1&e&&(Cs(0,e0,12,34,"ccf-spatial-search-ui",0),Jc(1,"async")),2&e&&Ts("ngIf",el(1,1,t.organ$))},directives:[Yh,JJ],pipes:[sd],encapsulation:2,changeDetection:0}),Mw([Bz(GJ.scene)],t0.prototype,"scene$",void 0),Mw([Bz(GJ.sceneBounds)],t0.prototype,"sceneBounds$",void 0),Mw([Bz(GJ.sceneTarget)],t0.prototype,"sceneTarget$",void 0),Mw([Bz(GJ.sex)],t0.prototype,"sex$",void 0),Mw([Bz(GJ.organ)],t0.prototype,"organ$",void 0),Mw([Bz(GJ.position)],t0.prototype,"position$",void 0),Mw([Bz(GJ.defaultPosition)],t0.prototype,"defaultPosition$",void 0),Mw([Bz(GJ.radius)],t0.prototype,"radius$",void 0),Mw([Bz(GJ.radiusSettings)],t0.prototype,"radiusSettings$",void 0),Mw([Bz(GJ.tissueBlocks)],t0.prototype,"tissueBlocks$",void 0),Mw([Bz(GJ.anatomicalStructures)],t0.prototype,"anatomicalStructures$",void 0),Mw([Bz(GJ.cellTypes)],t0.prototype,"cellTypes$",void 0),Mw([TK()],t0.prototype,"updatePosition",void 0),Mw([TK()],t0.prototype,"resetPosition",void 0),Mw([TK()],t0.prototype,"moveToNode",void 0),Mw([TK()],t0.prototype,"updateRadius",void 0),Mw([TK()],t0.prototype,"resetRadius",void 0),Mw([TK()],t0.prototype,"addSpatialSearch",null);var n0=["input"],i0=function(e){return{enterDuration:e}},r0=["*"],o0=new Ri("mat-radio-default-options",{providedIn:"root",factory:function(){return{color:"accent"}}}),a0=0,s0={provide:Hz,useExisting:He(function(){return h0}),multi:!0},u0=function e(t,n){m(this,e),this.source=t,this.value=n},c0=new Ri("MatRadioGroup"),l0=function(){var e=function(){function e(t){m(this,e),this._changeDetector=t,this._value=null,this._name="mat-radio-group-"+a0++,this._selected=null,this._isInitialized=!1,this._labelPosition="after",this._disabled=!1,this._required=!1,this._controlValueAccessorChangeFn=function(){},this.onTouched=function(){},this.change=new ol}return b(e,[{key:"name",get:function(){return this._name},set:function(e){this._name=e,this._updateRadioButtonNames()}},{key:"labelPosition",get:function(){return this._labelPosition},set:function(e){this._labelPosition="before"===e?"before":"after",this._markRadiosForCheck()}},{key:"value",get:function(){return this._value},set:function(e){this._value!==e&&(this._value=e,this._updateSelectedRadioFromValue(),this._checkSelectedRadioButton())}},{key:"_checkSelectedRadioButton",value:function(){this._selected&&!this._selected.checked&&(this._selected.checked=!0)}},{key:"selected",get:function(){return this._selected},set:function(e){this._selected=e,this.value=e?e.value:null,this._checkSelectedRadioButton()}},{key:"disabled",get:function(){return this._disabled},set:function(e){this._disabled=Wd(e),this._markRadiosForCheck()}},{key:"required",get:function(){return this._required},set:function(e){this._required=Wd(e),this._markRadiosForCheck()}},{key:"ngAfterContentInit",value:function(){this._isInitialized=!0}},{key:"_touch",value:function(){this.onTouched&&this.onTouched()}},{key:"_updateRadioButtonNames",value:function(){var e=this;this._radios&&this._radios.forEach(function(t){t.name=e.name,t._markForCheck()})}},{key:"_updateSelectedRadioFromValue",value:function(){var e=this;this._radios&&(null===this._selected||this._selected.value!==this._value)&&(this._selected=null,this._radios.forEach(function(t){t.checked=e.value===t.value,t.checked&&(e._selected=t)}))}},{key:"_emitChangeEvent",value:function(){this._isInitialized&&this.change.emit(new u0(this._selected,this._value))}},{key:"_markRadiosForCheck",value:function(){this._radios&&this._radios.forEach(function(e){return e._markForCheck()})}},{key:"writeValue",value:function(e){this.value=e,this._changeDetector.markForCheck()}},{key:"registerOnChange",value:function(e){this._controlValueAccessorChangeFn=e}},{key:"registerOnTouched",value:function(e){this.onTouched=e}},{key:"setDisabledState",value:function(e){this.disabled=e,this._changeDetector.markForCheck()}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Os(Cc))},e.\u0275dir=Rt({type:e,inputs:{name:"name",labelPosition:"labelPosition",value:"value",selected:"selected",disabled:"disabled",required:"required",color:"color"},outputs:{change:"change"}}),e}(),h0=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}(l0);return t.\u0275fac=function(n){return(e||(e=Ti(t)))(n||t)},t.\u0275dir=Rt({type:t,selectors:[["mat-radio-group"]],contentQueries:function(e,t,n){var i;(1&e&&bl(n,p0,5),2&e)&&(ml(i=_l())&&(t._radios=i))},hostAttrs:["role","radiogroup",1,"mat-radio-group"],exportAs:["matRadioGroup"],features:[Xu([s0,{provide:c0,useExisting:t}]),cs]}),t}(),d0=sb(ub(function e(t){m(this,e),this._elementRef=t})),f0=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,i))._changeDetector=r,l._focusMonitor=o,l._radioDispatcher=a,l._providerOverride=u,l._uniqueId="mat-radio-"+ ++a0,l.id=l._uniqueId,l.change=new ol,l._checked=!1,l._value=null,l._removeUniqueSelectionListener=function(){},l.radioGroup=e,l._noopAnimations="NoopAnimations"===s,c&&(l.tabIndex=qd(c,0)),l._removeUniqueSelectionListener=a.listen(function(e,t){e!==l.id&&t===l.name&&(l.checked=!1)}),l}return b(n,[{key:"checked",get:function(){return this._checked},set:function(e){var t=Wd(e);this._checked!==t&&(this._checked=t,t&&this.radioGroup&&this.radioGroup.value!==this.value?this.radioGroup.selected=this:!t&&this.radioGroup&&this.radioGroup.value===this.value&&(this.radioGroup.selected=null),t&&this._radioDispatcher.notify(this.id,this.name),this._changeDetector.markForCheck())}},{key:"value",get:function(){return this._value},set:function(e){this._value!==e&&(this._value=e,null!==this.radioGroup&&(this.checked||(this.checked=this.radioGroup.value===e),this.checked&&(this.radioGroup.selected=this)))}},{key:"labelPosition",get:function(){return this._labelPosition||this.radioGroup&&this.radioGroup.labelPosition||"after"},set:function(e){this._labelPosition=e}},{key:"disabled",get:function(){return this._disabled||null!==this.radioGroup&&this.radioGroup.disabled},set:function(e){this._setDisabled(Wd(e))}},{key:"required",get:function(){return this._required||this.radioGroup&&this.radioGroup.required},set:function(e){this._required=Wd(e)}},{key:"color",get:function(){return this._color||this.radioGroup&&this.radioGroup.color||this._providerOverride&&this._providerOverride.color||"accent"},set:function(e){this._color=e}},{key:"inputId",get:function(){return"".concat(this.id||this._uniqueId,"-input")}},{key:"focus",value:function(e,t){t?this._focusMonitor.focusVia(this._inputElement,t,e):this._inputElement.nativeElement.focus(e)}},{key:"_markForCheck",value:function(){this._changeDetector.markForCheck()}},{key:"ngOnInit",value:function(){this.radioGroup&&(this.checked=this.radioGroup.value===this._value,this.checked&&(this.radioGroup.selected=this),this.name=this.radioGroup.name)}},{key:"ngAfterViewInit",value:function(){var e=this;this._focusMonitor.monitor(this._elementRef,!0).subscribe(function(t){!t&&e.radioGroup&&e.radioGroup._touch()})}},{key:"ngOnDestroy",value:function(){this._focusMonitor.stopMonitoring(this._elementRef),this._removeUniqueSelectionListener()}},{key:"_emitChangeEvent",value:function(){this.change.emit(new u0(this,this._value))}},{key:"_isRippleDisabled",value:function(){return this.disableRipple||this.disabled}},{key:"_onInputClick",value:function(e){e.stopPropagation()}},{key:"_onInputInteraction",value:function(e){if(e.stopPropagation(),!this.checked&&!this.disabled){var t=this.radioGroup&&this.value!==this.radioGroup.value;this.checked=!0,this._emitChangeEvent(),this.radioGroup&&(this.radioGroup._controlValueAccessorChangeFn(this.value),t&&this.radioGroup._emitChangeEvent())}}},{key:"_setDisabled",value:function(e){this._disabled!==e&&(this._disabled=e,this._changeDetector.markForCheck())}}]),n}(d0);return e.\u0275fac=function(t){return new(t||e)(Os(l0),Os(Ju),Os(Cc),Os(rg),Os(rp),Os(String),Os(void 0),Os(String))},e.\u0275dir=Rt({type:e,viewQuery:function(e,t){var n;(1&e&&yl(n0,5),2&e)&&(ml(n=_l())&&(t._inputElement=n.first))},inputs:{id:"id",checked:"checked",value:"value",labelPosition:"labelPosition",disabled:"disabled",required:"required",color:"color",name:"name",ariaLabel:["aria-label","ariaLabel"],ariaLabelledby:["aria-labelledby","ariaLabelledby"],ariaDescribedby:["aria-describedby","ariaDescribedby"]},outputs:{change:"change"},features:[cs]}),e}(),p0=function(){var e=function(e){a(n,e);var t=s(n);function n(e,i,r,o,a,s,u,c){return m(this,n),t.call(this,e,i,r,o,a,s,u,c)}return n}(f0);return e.\u0275fac=function(t){return new(t||e)(Os(c0,8),Os(Ju),Os(Cc),Os(rg),Os(rp),Os(Yy,8),Os(o0,8),Ai("tabindex"))},e.\u0275cmp=Ot({type:e,selectors:[["mat-radio-button"]],hostAttrs:[1,"mat-radio-button"],hostVars:17,hostBindings:function(e,t){1&e&&Vs("focus",function(){return t._inputElement.nativeElement.focus()}),2&e&&(ks("tabindex",null)("id",t.id)("aria-label",null)("aria-labelledby",null)("aria-describedby",null),cu("mat-radio-checked",t.checked)("mat-radio-disabled",t.disabled)("_mat-animation-noopable",t._noopAnimations)("mat-primary","primary"===t.color)("mat-accent","accent"===t.color)("mat-warn","warn"===t.color))},inputs:{disableRipple:"disableRipple",tabIndex:"tabIndex"},exportAs:["matRadioButton"],features:[cs],ngContentSelectors:r0,decls:13,vars:20,consts:[[1,"mat-radio-label"],["label",""],[1,"mat-radio-container"],[1,"mat-radio-outer-circle"],[1,"mat-radio-inner-circle"],["type","radio",1,"mat-radio-input","cdk-visually-hidden",3,"id","checked","disabled","tabIndex","required","change","click"],["input",""],["mat-ripple","",1,"mat-radio-ripple","mat-focus-indicator",3,"matRippleTrigger","matRippleDisabled","matRippleCentered","matRippleRadius","matRippleAnimation"],[1,"mat-ripple-element","mat-radio-persistent-ripple"],[1,"mat-radio-label-content"],[2,"display","none"]],template:function(e,t){if(1&e&&(Xs(),As(0,"label",0,1),As(2,"span",2),Is(3,"span",3),Is(4,"span",4),As(5,"input",5,6),Vs("change",function(e){return t._onInputInteraction(e)})("click",function(e){return t._onInputClick(e)}),Ms(),As(7,"span",7),Is(8,"span",8),Ms(),Ms(),As(9,"span",9),As(10,"span",10),Cu(11,"\xa0"),Ms(),Ys(12),Ms(),Ms()),2&e){var n=Es(1);ks("for",t.inputId),Yo(5),Ts("id",t.inputId)("checked",t.checked)("disabled",t.disabled)("tabIndex",t.tabIndex)("required",t.required),ks("name",t.name)("value",t.value)("aria-label",t.ariaLabel)("aria-labelledby",t.ariaLabelledby)("aria-describedby",t.ariaDescribedby),Yo(2),Ts("matRippleTrigger",n)("matRippleDisabled",t._isRippleDisabled())("matRippleCentered",!0)("matRippleRadius",20)("matRippleAnimation",$c(18,i0,t._noopAnimations?0:150)),Yo(2),cu("mat-radio-label-before","before"==t.labelPosition)}},directives:[wb],styles:[".mat-radio-button{display:inline-block;-webkit-tap-highlight-color:transparent;outline:0}.mat-radio-label{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;display:inline-flex;align-items:center;white-space:nowrap;vertical-align:middle;width:100%}.mat-radio-container{box-sizing:border-box;display:inline-block;position:relative;width:20px;height:20px;flex-shrink:0}.mat-radio-outer-circle{box-sizing:border-box;display:block;height:20px;left:0;position:absolute;top:0;transition:border-color ease 280ms;width:20px;border-width:2px;border-style:solid;border-radius:50%}._mat-animation-noopable .mat-radio-outer-circle{transition:none}.mat-radio-inner-circle{border-radius:50%;box-sizing:border-box;display:block;height:20px;left:0;position:absolute;top:0;opacity:0;transition:transform ease 280ms,background-color ease 280ms,opacity linear 1ms 280ms;width:20px;transform:scale(0.001);-webkit-print-color-adjust:exact;color-adjust:exact}.mat-radio-checked .mat-radio-inner-circle{transform:scale(0.5);opacity:1;transition:transform ease 280ms,background-color ease 280ms}.cdk-high-contrast-active .mat-radio-checked .mat-radio-inner-circle{border:solid 10px}._mat-animation-noopable .mat-radio-inner-circle{transition:none}.mat-radio-label-content{-webkit-user-select:auto;-moz-user-select:auto;-ms-user-select:auto;user-select:auto;display:inline-block;order:0;line-height:inherit;padding-left:8px;padding-right:0}[dir=rtl] .mat-radio-label-content{padding-right:8px;padding-left:0}.mat-radio-label-content.mat-radio-label-before{order:-1;padding-left:0;padding-right:8px}[dir=rtl] .mat-radio-label-content.mat-radio-label-before{padding-right:0;padding-left:8px}.mat-radio-disabled,.mat-radio-disabled .mat-radio-label{cursor:default}.mat-radio-button .mat-radio-ripple{position:absolute;left:calc(50% - 20px);top:calc(50% - 20px);height:40px;width:40px;z-index:1;pointer-events:none}.mat-radio-button .mat-radio-ripple .mat-ripple-element:not(.mat-radio-persistent-ripple){opacity:.16}.mat-radio-persistent-ripple{width:100%;height:100%;transform:none;top:0;left:0}.mat-radio-container:hover .mat-radio-persistent-ripple{opacity:.04}.mat-radio-button:not(.mat-radio-disabled).cdk-keyboard-focused .mat-radio-persistent-ripple,.mat-radio-button:not(.mat-radio-disabled).cdk-program-focused .mat-radio-persistent-ripple{opacity:.12}.mat-radio-persistent-ripple,.mat-radio-disabled .mat-radio-container:hover .mat-radio-persistent-ripple{opacity:0}@media(hover: none){.mat-radio-container:hover .mat-radio-persistent-ripple{display:none}}.mat-radio-input{bottom:0;left:50%}.cdk-high-contrast-active .mat-radio-button:not(.mat-radio-disabled).cdk-keyboard-focused .mat-radio-ripple,.cdk-high-contrast-active .mat-radio-button:not(.mat-radio-disabled).cdk-program-focused .mat-radio-ripple{outline:solid 3px}.cdk-high-contrast-active .mat-radio-disabled{opacity:.5}\n"],encapsulation:2,changeDetection:0}),e}();function v0(e,t){1&e&&(As(0,"div",7),Cu(1,"Organs"),Ms())}function g0(e,t){if(1&e&&(As(0,"mat-option",17),Cu(1),Ms()),2&e){var n=t.$implicit;Ts("value",n),Yo(1),Ou(" ",n.name," ")}}var m0=function(){var e=function e(){m(this,e),this.className="ccf-spatial-search-config",this.updateSex=new ol,this.updateOrgan=new ol,this.buttonClicked=new ol,this.closeDialog=new ol,this.infoClicked=new ol};return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=Ot({type:e,selectors:[["ccf-spatial-search-config"]],hostVars:2,hostBindings:function(e,t){2&e&&du(t.className)},inputs:{organs:"organs",selectedOrgan:"selectedOrgan",sex:"sex"},outputs:{updateSex:"updateSex",updateOrgan:"updateOrgan",buttonClicked:"buttonClicked",closeDialog:"closeDialog",infoClicked:"infoClicked"},decls:27,vars:6,consts:[[1,"header"],[1,"header-left"],[1,"title"],["mat-icon-button","",1,"info"],[3,"click"],["mat-icon-button","",1,"close"],[1,"sex-toggle"],[1,"label"],[1,"radio-group",3,"ngModel","ngModelChange","change"],["value","male",1,"radio"],["value","female",1,"radio"],[1,"organ-selector"],["appearance","fill",1,"form-field"],["class","label",4,"ngIf"],["disableOptionCentering","true","panelClass","organ-select",3,"value","valueChange","selectionChange"],["class","organ-select-option",3,"value",4,"ngFor","ngForOf"],["mat-button","",1,"continue-button",3,"click"],[1,"organ-select-option",3,"value"]],template:function(e,t){1&e&&(As(0,"div",0),As(1,"div",1),As(2,"div",2),Cu(3,"Configure Spatial Search"),Ms(),As(4,"button",3),As(5,"mat-icon",4),Vs("click",function(){return t.infoClicked.emit()}),Cu(6,"info"),Ms(),Ms(),Ms(),As(7,"button",5),As(8,"mat-icon",4),Vs("click",function(){return t.closeDialog.emit()}),Cu(9,"close"),Ms(),Ms(),Ms(),As(10,"div",6),As(11,"div",7),Cu(12,"Donor Sex: "),Ms(),As(13,"mat-radio-group",8),Vs("ngModelChange",function(e){return t.sex=e})("change",function(e){return t.updateSex.emit(e.value)}),As(14,"mat-radio-button",9),Cu(15,"Male"),Ms(),As(16,"mat-radio-button",10),Cu(17,"Female"),Ms(),Ms(),Ms(),As(18,"div",11),As(19,"div",7),Cu(20,"Select an organ"),Ms(),As(21,"mat-form-field",12),Cs(22,v0,2,0,"div",13),As(23,"mat-select",14),Vs("valueChange",function(e){return t.selectedOrgan=e})("selectionChange",function(e){return t.updateOrgan.emit(e.value)}),Cs(24,g0,2,2,"mat-option",15),Ms(),Ms(),Ms(),As(25,"button",16),Vs("click",function(){return t.buttonClicked.emit()}),Cu(26,"Continue"),Ms()),2&e&&(Yo(13),Ts("ngModel",t.sex),Yo(9),Ts("ngIf",!t.selectedOrgan),Yo(1),Ts("value",t.selectedOrgan),Yo(1),Ts("ngForOf",t.organs),Yo(1),cu("disabled",!t.selectedOrgan))},directives:[q_,B_,h0,fU,GU,p0,RH,Yh,zZ,qh,Rb],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;align-items:flex-start;padding:2rem;grid-gap:2rem;gap:2rem;width:30.5rem;box-shadow:0 25rem 25rem #00000029;border-radius:.25rem;font-size:1rem}[_nghost-%COMP%] .button[_ngcontent-%COMP%]{cursor:pointer}[_nghost-%COMP%] .header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;width:100%;font-size:1.25rem}[_nghost-%COMP%] .header[_ngcontent-%COMP%] .header-left[_ngcontent-%COMP%]{display:flex;align-items:center}[_nghost-%COMP%] .header[_ngcontent-%COMP%] .header-left[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{margin-right:1rem}[_nghost-%COMP%] .header[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{padding:0;background:none;border:none;cursor:pointer;outline:none;border-radius:.25rem;transition:.6s}[_nghost-%COMP%] .sex-toggle[_ngcontent-%COMP%]{display:flex}[_nghost-%COMP%] .sex-toggle[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{margin-right:2rem}[_nghost-%COMP%] .sex-toggle[_ngcontent-%COMP%] .radio[_ngcontent-%COMP%]{margin-right:4rem}[_nghost-%COMP%] .organ-selector[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{height:0rem}[_nghost-%COMP%] .organ-selector[_ngcontent-%COMP%] .mat-form-field-wrapper{padding-bottom:1rem;padding-top:3rem;margin-left:.5rem;width:14rem}[_nghost-%COMP%] .organ-selector[_ngcontent-%COMP%] .mat-form-field-wrapper .mat-form-field-infix{padding:0;border-top:none}[_nghost-%COMP%] .organ-selector[_ngcontent-%COMP%] .mat-form-field-wrapper .mat-form-field-underline{bottom:0rem;height:.125rem}[_nghost-%COMP%] .organ-selector[_ngcontent-%COMP%] .mat-form-field-wrapper .mat-select-arrow-wrapper{transform:translatey(0)}[_nghost-%COMP%] .continue-button[_ngcontent-%COMP%]{display:flex;flex-direction:row;justify-content:center;align-items:center;padding:.25rem 1rem;width:14rem;height:2rem;border-width:1px;border-style:solid;border-radius:.25rem;box-shadow:0 2px 6px #00000029}[_nghost-%COMP%] .continue-button.disabled[_ngcontent-%COMP%]{pointer-events:none;opacity:.5} .organ-select{position:absolute;top:2.5rem;left:-.25rem;border-radius:.5rem;max-height:24.5rem;width:14rem} .organ-select .organ-select-option{height:3.5rem;border-bottom:1px solid}"],changeDetection:0}),e}(),y0=function(){function e(t,n,i,r){m(this,e),this.dialog=t,this.dialogRef=n,this.spatialSearchDialog=i,this.infoService=r,this.updateSex=vQ(fZ),this.updateOrgan=vQ(pZ),this.subscriptions=new q,this.dialogSubs=new q}return b(e,[{key:"buttonClicked",value:function(){this.spatialSearchDialog.open(t0),this.close()}},{key:"close",value:function(){this.dialogRef.close()}},{key:"launchInfoDialog",value:function(e){this.dialogSubs.unsubscribe(),this.dialog.open(k$,{autoFocus:!1,panelClass:"modal-animated",width:"72rem",data:{title:e.infoTitle,content:e.content,videoID:e.videoID}})}},{key:"onDialogButtonClick",value:function(){var e=this;this.infoService.updateData("assets/docs/SPATIAL_SEARCH_README.md","UfxMpzatowE","Spatial Search");var t=this.infoService.panelContent.asObservable();this.dialogSubs.add(t.subscribe(function(t){t.content.length&&(e.panelData=t,e.launchInfoDialog(e.panelData))}))}},{key:"ngOnDestroy",value:function(){this.subscriptions.unsubscribe()}}]),e}();y0.\u0275fac=function(e){return new(e||y0)(Os(FG),Os(MG),Os(FG),Os(S$))},y0.\u0275cmp=Ot({type:y0,selectors:[["ccf-spatial-search-config-behavior"]],decls:4,vars:9,consts:[[3,"sex","organs","selectedOrgan","updateSex","updateOrgan","closeDialog","buttonClicked","infoClicked"]],template:function(e,t){1&e&&(As(0,"ccf-spatial-search-config",0),Vs("updateSex",function(e){return t.updateSex(e)})("updateOrgan",function(e){return t.updateOrgan(e.id)})("closeDialog",function(){return t.close()})("buttonClicked",function(){return t.buttonClicked()})("infoClicked",function(){return t.onDialogButtonClick()}),Jc(1,"async"),Jc(2,"async"),Jc(3,"async"),Ms()),2&e&&Ts("sex",el(1,3,t.sex$))("organs",el(2,5,t.organs$))("selectedOrgan",el(3,7,t.selectedOrgan$))},directives:[m0],pipes:[sd],encapsulation:2,changeDetection:0}),Mw([Bz(GJ.sex)],y0.prototype,"sex$",void 0),Mw([Bz(GJ.organ)],y0.prototype,"selectedOrgan$",void 0),Mw([Bz(GJ.organs)],y0.prototype,"organs$",void 0),Mw([TK()],y0.prototype,"updateSex",void 0),Mw([TK()],y0.prototype,"updateOrgan",void 0);var b0=function(){var e=function(){function e(t,n){m(this,e),this.store=t,this.dialog=n,this.className="ccf-run-spatial-search"}return b(e,[{key:"startSpatialSearchFlow",value:function(){var e=this;this.store.dispatch(new dZ).pipe(_p(1),mv(function(){return e.dialog.open(y0)})).subscribe()}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Os(Pz),Os(FG))},e.\u0275cmp=Ot({type:e,selectors:[["ccf-run-spatial-search"]],hostVars:2,hostBindings:function(e,t){2&e&&du(t.className)},decls:4,vars:0,consts:[["mat-button","",1,"run-spatial-search-button",3,"click"]],template:function(e,t){1&e&&(As(0,"button",0),Vs("click",function(){return t.startSpatialSearchFlow()}),Cu(1," Run Spatial Search "),As(2,"mat-icon"),Cu(3,"travel_explore"),Ms(),Ms())},directives:[q_,B_],styles:["[_nghost-%COMP%] .run-spatial-search-button[_ngcontent-%COMP%] .mat-button-wrapper{display:flex;align-items:center}[_nghost-%COMP%] .run-spatial-search-button[_ngcontent-%COMP%] .mat-button-wrapper .mat-icon{margin-left:9.75px}"],changeDetection:0}),e}();function _0(e,t){if(1&e){var n=Ls();As(0,"div",14),As(1,"ccf-spatial-search-list",15),Vs("selectionChanged",function(e){return bn(n),Ws().updateSearchSelection(e)})("itemRemoved",function(e){return bn(n),Ws().spatialSearchRemoved.emit(e.id)}),Ms(),Ms()}if(2&e){var i=Ws();cu("hidden",i.hidden),Yo(1),Ts("items",i.spatialSearchFilters)}}var w0=function(){return["Both","Male","Female"]},k0=function(){return[1,110]},x0=function(){return[13,83]},S0=function(){var e=function(){function e(t){m(this,e),this.ga=t,this.spatialSearchFilters=[],this.filtersChange=new ol,this.spatialSearchSelected=new ol,this.spatialSearchRemoved=new ol,this.applyFilters=new ol}return b(e,[{key:"ngOnChanges",value:function(e){"spatialSearchFilters"in e&&this.updateSexFromSelection(this.spatialSearchFilters.filter(function(e){return e.selected}))}},{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.updateSearchSelection(this.spatialSearchFilters.filter(function(e){return e.selected})),this.ga.event("filters_applied","filter_content"),this.applyFilters.emit(this.filters)}},{key:"refreshFilters",value:function(){this.filters=JSON.parse(JSON.stringify(kQ)),this.ga.event("filters_reset","filter_content"),this.spatialSearchSelected.emit([]),this.filtersChange.emit(this.filters)}},{key:"updateSearchSelection",value:function(e){var t=e.map(function(e){return e.search});this.spatialSearchSelected.emit(e),this.updateFilter(t,"spatialSearches"),this.updateSexFromSelection(e)}},{key:"updateSexFromSelection",value:function(e){var t,n=null===(t=this.filters.sex)||void 0===t?void 0:t.toLowerCase(),i=new Set(e.map(function(e){return e.sex}));e.length>0&&(i.size>1||!i.has(n))&&this.updateFilter("Both","sex")}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Os(yq))},e.\u0275cmp=Ot({type:e,selectors:[["ccf-filters-content"]],inputs:{hidden:"hidden",filters:"filters",technologyFilters:"technologyFilters",providerFilters:"providerFilters",spatialSearchFilters:"spatialSearchFilters"},outputs:{filtersChange:"filtersChange",spatialSearchSelected:"spatialSearchSelected",spatialSearchRemoved:"spatialSearchRemoved",applyFilters:"applyFilters"},features:[qt],decls:17,vars:24,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"],["class","filter spatial-locations",3,"hidden",4,"ngIf"],[1,"button-container"],[1,"right-group"],["mat-button","",1,"outline-button",3,"click"],[1,"refresh-icon"],[1,"icon","refresh",3,"click"],[1,"filter","spatial-locations"],["label","Spatial Locations",3,"items","selectionChanged","itemRemoved"]],template:function(e,t){1&e&&(As(0,"div",0),As(1,"ccf-dropdown",1),Vs("selectionChange",function(e){return t.updateFilter(e,"sex")}),Ms(),As(2,"ccf-dual-slider",2),Vs("selectionChange",function(e){return t.updateFilter(e,"ageRange")}),Ms(),As(3,"ccf-dual-slider",3),Vs("selectionChange",function(e){return t.updateFilter(e,"bmiRange")}),Ms(),Ms(),As(4,"div",4),As(5,"ccf-checkbox",5),Vs("selectionChange",function(e){return t.updateFilter(e,"technologies")}),Ms(),Ms(),As(6,"div",6),As(7,"ccf-checkbox",7),Vs("selectionChange",function(e){return t.updateFilter(e,"tmc")}),Ms(),Ms(),Cs(8,_0,2,3,"div",8),As(9,"div",9),Is(10,"ccf-run-spatial-search"),As(11,"div",10),As(12,"button",11),Vs("click",function(){return t.applyButtonClick()}),Cu(13,"APPLY FILTERS"),Ms(),As(14,"div",12),As(15,"mat-icon",13),Vs("click",function(){return t.refreshFilters()}),Cu(16,"refresh"),Ms(),Ms(),Ms(),Ms()),2&e&&(cu("hidden",t.hidden),Yo(1),Ts("options",Kc(21,w0))("selection",null==t.filters?null:t.filters.sex),Yo(1),Ts("valueRange",Kc(22,k0))("selection",null==t.filters?null:t.filters.ageRange),Yo(1),Ts("valueRange",Kc(23,x0))("selection",null==t.filters?null:t.filters.bmiRange),Yo(1),cu("hidden",t.hidden),Yo(1),Ts("columns",4)("options",t.technologyFilters)("selection",null==t.filters?null:t.filters.technologies),Yo(1),cu("hidden",t.hidden),Yo(1),Ts("columns",3)("options",t.providerFilters)("selection",null==t.filters?null:t.filters.tmc),Yo(1),Ts("ngIf",t.spatialSearchFilters.length>0),Yo(1),cu("hidden",t.hidden))},directives:[GZ,FJ,zJ,Yh,b0,q_,B_,rQ],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%] button{border-width:1px;border-style:solid}.button-container[_ngcontent-%COMP%]{display:flex;justify-content:space-between;margin-top:2rem}.button-container[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{border-width:1px;border-style:solid}.button-container.hidden[_ngcontent-%COMP%]{opacity:0;transition-duration:.2s}.button-container[_ngcontent-%COMP%] .right-group[_ngcontent-%COMP%]{display:flex;flex-direction:row-reverse;align-items:center}.button-container[_ngcontent-%COMP%] .right-group[_ngcontent-%COMP%] .outline-button[_ngcontent-%COMP%]{box-shadow:.1rem .1rem .2rem #0000001d}.button-container[_ngcontent-%COMP%] .right-group[_ngcontent-%COMP%] .refresh-icon[_ngcontent-%COMP%]{padding:.25rem;border-radius:.25rem;margin-right:1rem;display:flex;justify-content:center;align-items:center;transition:.6s}.button-container[_ngcontent-%COMP%] .right-group[_ngcontent-%COMP%] .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 C0(e,t){1&e&&(As(0,"div"),As(1,"mat-icon",7),Cu(2,"close"),Ms(),Ms())}function E0(e,t){1&e&&Is(0,"mat-icon",8)}var O0=function(){function e(){m(this,e),this.spatialSearchFilters=[],this.filtersChange=new ol,this.spatialSearchSelected=new ol,this.spatialSearchRemoved=new ol,this.filtersVisible=!1}return b(e,[{key:"toggleFilterVisible",value:function(){return this.filtersVisible=!this.filtersVisible,new kZ(!1)}},{key:"removeBox",value:function(){return this.filtersVisible=!1,new kZ(!0)}},{key:"applyFilters",value:function(e){this.filters=e,this.filtersChange.emit(e),this.removeBox()}}]),e}();O0.\u0275fac=function(e){return new(e||O0)},O0.\u0275cmp=Ot({type:O0,selectors:[["ccf-filters-popover"]],inputs:{filters:"filters",drawerExpanded:"drawerExpanded",technologyFilters:"technologyFilters",providerFilters:"providerFilters",spatialSearchFilters:"spatialSearchFilters"},outputs:{filtersChange:"filtersChange",spatialSearchSelected:"spatialSearchSelected",spatialSearchRemoved:"spatialSearchRemoved"},decls:8,vars:15,consts:[[1,"filters-popover"],[1,"show-hide",3,"click"],[4,"ngIf","ngIfElse"],["notShow",""],[1,"popup-container"],[1,"popup-body"],[3,"technologyFilters","providerFilters","spatialSearchFilters","hidden","filters","applyFilters","spatialSearchSelected","spatialSearchRemoved"],[1,"icon"],["svgIcon","filter",1,"icon","funnel"]],template:function(e,t){if(1&e&&(As(0,"div",0),As(1,"button",1),Vs("click",function(){return t.toggleFilterVisible()}),Cs(2,C0,3,0,"div",2),Cs(3,E0,1,0,"ng-template",null,3,Sl),Ms(),As(5,"div",4),As(6,"div",5),As(7,"ccf-filters-content",6),Vs("applyFilters",function(e){return t.applyFilters(e)})("spatialSearchSelected",function(e){return t.spatialSearchSelected.emit(e)})("spatialSearchRemoved",function(e){return t.spatialSearchRemoved.emit(e)}),Ms(),Ms(),Ms(),Ms()),2&e){var n=Es(4);cu("expanded",t.drawerExpanded),Yo(1),cu("open",t.filtersVisible),Yo(1),Ts("ngIf",t.filtersVisible)("ngIfElse",n),Yo(3),cu("visible",t.filtersVisible)("hidden",!t.filtersVisible),Yo(2),Ts("technologyFilters",t.technologyFilters)("providerFilters",t.providerFilters)("spatialSearchFilters",t.spatialSearchFilters)("hidden",!t.filtersVisible)("filters",t.filters)}},directives:[Yh,S0,B_],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}.popup-container.visible[_ngcontent-%COMP%]{width:35rem;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}),Mw([TK()],O0.prototype,"toggleFilterVisible",null),Mw([TK()],O0.prototype,"removeBox",null);var T0=function(){function e(){m(this,e),this.treeModel$=new Bf(1),this.nodes$=this.treeModel$.pipe(ce(function(e){return Object.values(e.nodes)})),this.rootNode$=this.treeModel$.pipe(ce(function(e){return e.nodes[e.root]}))}return b(e,[{key:"setTreeModel",value:function(e){this.treeModel$.next(e),this.treeModel=e}},{key:"filter",value:function(e){var t=this;return this.nodes$.pipe(ce(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.slice(0,n),e.slice(n,n+t.length),e.slice(n+t.length)]}},{key:"getChildren",value:function(e){var t,n,i=null!==(n=null===(t=this.treeModel)||void 0===t?void 0:t.nodes)&&void 0!==n?n:{};return(0,$q.at)(i,e.children)}}]),e}();T0.\u0275fac=function(e){return new(e||T0)},T0.\u0275prov=$e({token:T0,factory:T0.\u0275fac}),Mw([eV.ak],T0.prototype,"getChildren",null);var P0=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 I0(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),N0.mostRecentTreeNode&&(N0.mostRecentTreeNode.data=e)}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Os(yc),Os(Cc))},e.\u0275cmp=Ot({type:e,selectors:[["cdk-tree"]],contentQueries:function(e,t,n){var i;(1&e&&bl(n,R0,5),2&e)&&(ml(i=_l())&&(t._nodeDefs=i))},viewQuery:function(e,t){var n;(1&e&&yl(M0,7),2&e)&&(ml(n=_l())&&(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&&Ns(0,0)},directives:[M0],encapsulation:2}),e}(),N0=function(){var e=function(){function e(t,n){m(this,e),this._elementRef=t,this._tree=n,this._destroyed=new ae,this._dataChanges=new ae,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&&!L0(t);)t=t.parentElement;return t?t.classList.contains("cdk-nested-tree-node")?qd(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)(Os(Ju),Os(D0))},e.\u0275dir=Rt({type:e,selectors:[["cdk-tree-node"]],inputs:{role:"role"},exportAs:["cdkTreeNode"]}),e.mostRecentTreeNode=null,e}();function L0(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 j0=/([A-Za-z%]+)$/,F0=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 ae,this.indentUnits="px",this._indent=40,this._setPadding(),r&&r.change.pipe(kf(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=qd(e,null),this._setPadding()}},{key:"_setIndentInput",value:function(e){var t=e,n="px";if("string"==typeof e){var i=e.split(j0);t=i[0],n=i[1]||n}this.indentUnits=n,this._indent=qd(t),this._setPadding()}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Os(N0),Os(D0),Os(Ju),Os(tp,8))},e.\u0275dir=Rt({type:e,selectors:[["","cdkTreeNodePadding",""]],inputs:{level:["cdkTreeNodePadding","level"],indent:["cdkTreeNodePaddingIndent","indent"]}}),e}(),B0=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=Wd(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)(Os(D0),Os(N0))},e.\u0275dir=Rt({type:e,selectors:[["","cdkTreeNodeToggle",""]],hostBindings:function(e,t){1&e&&Vs("click",function(e){return t._toggle(e)})},inputs:{recursive:["cdkTreeNodeToggleRecursive","recursive"]}}),e}(),V0=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({}),e}(),z0=ub(ob(N0)),U0=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}(z0);return t.\u0275fac=function(e){return new(e||t)(Os(Ju),Os(D0),Ai("tabindex"))},t.\u0275dir=Rt({type:t,selectors:[["mat-tree-node"]],inputs:{role:"role",disabled:"disabled",tabIndex:"tabIndex"},exportAs:["matTreeNode"],features:[Xu([{provide:N0,useExisting:t}]),cs]}),t}(),H0=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}(R0);return t.\u0275fac=function(n){return(e||(e=Ti(t)))(n||t)},t.\u0275dir=Rt({type:t,selectors:[["","matTreeNodeDef",""]],inputs:{when:["matTreeNodeDefWhen","when"],data:["matTreeNode","data"]},features:[Xu([{provide:R0,useExisting:t}]),cs]}),t}(),G0=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}(F0);return t.\u0275fac=function(n){return(e||(e=Ti(t)))(n||t)},t.\u0275dir=Rt({type:t,selectors:[["","matTreeNodePadding",""]],inputs:{level:["matTreeNodePadding","level"],indent:["matTreeNodePaddingIndent","indent"]},features:[Xu([{provide:F0,useExisting:t}]),cs]}),t}(),W0=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)(Os(Nc),Os(A0,8))},e.\u0275dir=Rt({type:e,selectors:[["","matTreeNodeOutlet",""]],features:[Xu([{provide:M0,useExisting:e}])]}),e}(),q0=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}(D0);return t.\u0275fac=function(n){return(e||(e=Ti(t)))(n||t)},t.\u0275cmp=Ot({type:t,selectors:[["mat-tree"]],viewQuery:function(e,t){var n;(1&e&&yl(W0,7),2&e)&&(ml(n=_l())&&(t._nodeOutlet=n.first))},hostAttrs:["role","tree",1,"mat-tree","cdk-tree"],exportAs:["matTree"],features:[Xu([{provide:D0,useExisting:t}]),cs],decls:1,vars:0,consts:[["matTreeNodeOutlet",""]],template:function(e,t){1&e&&Ns(0,0)},directives:[W0],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}(),X0=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=Wd(e)}}]),n}(B0);return t.\u0275fac=function(n){return(e||(e=Ti(t)))(n||t)},t.\u0275dir=Rt({type:t,selectors:[["","matTreeNodeToggle",""]],inputs:{recursive:["matTreeNodeToggleRecursive","recursive"]},features:[Xu([{provide:B0,useExisting:t}]),cs]}),t}(),Y0=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({imports:[[V0,rb],rb]}),e}(),K0=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(_p(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}(),$0=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 vv([]),o._expandedData=new vv([]),o._data=new vv([]),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 Oe(e.viewChange,this._treeControl.expansionModel.changed,this._flattenedData).pipe(ce(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)}}()),Q0=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 Z0(e,t){if(1&e){var n=Ls();As(0,"div",4),Vs("click",function(e){var t=bn(n).node,i=Ws();return i.select(e.ctrlKey,t,!0,!i.isSelected(t))}),Cu(1),Ms()}if(2&e){var i=t.node,r=Ws();cu("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)),Yo(1),Eu("colon"===i.label?"large intestine":i.label)}}function J0(e,t){1&e&&Ns(0)}var e1=function(e){return{node:e}};function t1(e,t){if(1&e){var n=Ls();As(0,"mat-tree-node",5),Vs("mouseleave",function(){bn(n);var e=Es(5);return Ws().mouseOut(),e.reset()}),As(1,"div"),As(2,"mat-icon",6),Vs("mouseenter",function(){var e=bn(n).$implicit;return Ws().mouseOver(e)}),Ms(),As(3,"div",7),As(4,"ccf-opacity-slider",8,9),Vs("opacityChange",function(e){var t=bn(n).$implicit;return Ws().updateOpacity(t,e)})("opacityReset",function(){var e=bn(n).$implicit;return Ws().resetNode(e)})("visibilityToggle",function(){var e=bn(n).$implicit;return Ws().toggleVisibility(e)}),Ms(),Ms(),Ms(),Is(6,"div",10),Cs(7,J0,1,0,"ng-container",11),As(8,"div",12),Cu(9),Ms(),Ms()}if(2&e){var i=t.$implicit,r=Ws(),o=Es(2);Ts("matTreeNodePaddingIndent",r.indent),Yo(1),uu("display",-1!==i.opacity?"none":"block"),Yo(1),uu("left",r.getLeftIndent(i.level)),cu("fade",!0!==i.visible),Yo(1),uu("left",r.getLeftIndent(i.level)),cu("hidden",i.label!==(null==r.highlightedNode?null:r.highlightedNode.label)),Yo(1),Ts("visible",i.visible)("opacity",i.opacity),Yo(3),Ts("ngTemplateOutlet",o)("ngTemplateOutletContext",$c(18,e1,i)),Yo(1),cu("suborgan",i.level>1),Yo(1),Eu(r.occurenceData[i.original.id]||0)}}function n1(e,t){1&e&&Ns(0)}function i1(e,t){if(1&e){var n=Ls();As(0,"mat-tree-node",13),Vs("mouseleave",function(){bn(n);var e=Es(5);return Ws().mouseOut(),e.reset()}),As(1,"div"),As(2,"mat-icon",6),Vs("mouseenter",function(){var e=bn(n).$implicit;return Ws().mouseOver(e)}),Ms(),As(3,"div",7),As(4,"ccf-opacity-slider",8,14),Vs("opacityChange",function(e){var t=bn(n).$implicit;return Ws().updateOpacity(t,e)})("opacityReset",function(){var e=bn(n).$implicit;return Ws().resetNode(e)})("visibilityToggle",function(){var e=bn(n).$implicit;return Ws().toggleVisibility(e)}),Ms(),Ms(),Ms(),As(6,"button",15),As(7,"mat-icon",16),Cu(8),Ms(),Ms(),Cs(9,n1,1,0,"ng-container",11),As(10,"div",12),Cu(11),Ms(),Ms()}if(2&e){var i=t.$implicit,r=Ws(),o=Es(2);Ts("matTreeNodePaddingIndent",r.indent),Yo(1),uu("display",-1!==i.opacity?"none":"block"),Yo(1),uu("left",r.getLeftIndent(i.level)),cu("fade",!0!==i.visible),Yo(1),uu("left",r.getLeftIndent(i.level)),cu("hidden",i.label!==(null==r.highlightedNode?null:r.highlightedNode.label)),Yo(1),Ts("visible",i.visible)("opacity",i.opacity),Yo(2),cu("hidden",i.label===(null==r.highlightedNode?null:r.highlightedNode.label)),Ss("aria-label","Toggle ",i.label,""),Yo(2),Ou(" ",r.control.isExpanded(i)?"expand_less":"expand_more"," "),Yo(1),Ts("ngTemplateOutlet",o)("ngTemplateOutletContext",$c(22,e1,i)),Yo(1),cu("suborgan",i.level>1),Yo(1),Eu(r.occurenceData[i.original.id]||0)}}var r1=(0,$q.property)("level"),o1=(0,$q.property)("expandable"),a1=function(){var e=function(){function e(t,n){m(this,e),this.cdr=t,this.ga=n,this.atScrollBottom=!1,this.nodeSelected=new ol,this.nodeChanged=new ol,this.indent="1.5rem",this.control=new P0(r1,o1),this.flattener=new K0(Q0.create,r1,o1,$q.invoke.bind(void 0,this,"getChildren")),this.dataSource=new $0(this.control,this.flattener),this._nodes=void 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;(null==t?void 0:t.length)>=0&&this.selectByIDs(t)}e.rootNode&&this.selectByIDs([e.rootNode.currentValue])}},{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,$q.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 d=l.value;o.expand(d)}}catch(f){h.e(f)}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(null==e?void 0:e.original.id)===this.rootNode||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)(Os(Cc),Os(yq))},e.\u0275cmp=Ot({type:e,selectors:[["ccf-ontology-tree"]],inputs:{ontologyFilter:"ontologyFilter",rootNode:"rootNode",nodes:"nodes",getChildren:"getChildren",occurenceData:"occurenceData",termData:"termData",header:"header"},outputs:{nodeSelected:"nodeSelected",nodeChanged:"nodeChanged"},features:[qt],decls:5,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,"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&&(As(0,"mat-tree",0),Vs("scroll",function(e){return t.onScroll(e)}),Cs(1,Z0,2,9,"ng-template",null,1,Sl),Cs(3,t1,10,20,"mat-tree-node",2),Cs(4,i1,12,24,"mat-tree-node",3),Ms()),2&e&&(cu("header-hidden",!t.header),Ts("dataSource",t.dataSource)("treeControl",t.control),Yo(4),Ts("matTreeNodeDefWhen",t.isInnerNode))},directives:[q0,H0,U0,G0,B_,m$,nd,q_,X0],styles:[".ccf-ontology-tree[_ngcontent-%COMP%]{background:none;scrollbar-width:thin;max-height:calc(50vh - 10rem);overflow:auto;overflow-x:hidden}.ccf-ontology-tree.header-hidden[_ngcontent-%COMP%]{max-height:40vh}.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:3rem;width:90%;bottom:0;pointer-events:none}.scroll-gradient.hidden[_ngcontent-%COMP%]{display:none}"],changeDetection:0}),e}();function s1(e,t){if(1&e&&(As(0,"mat-option",8),As(1,"span",9),Cu(2),Ms(),As(3,"span",10),Cu(4),Ms(),As(5,"span",11),Cu(6),Ms(),Ms()),2&e){var n=t.$implicit;Ts("value",n),Yo(2),Eu(n.displayLabel[0]),Yo(2),Eu(n.displayLabel[1]),Yo(2),Eu(n.displayLabel[2])}}var u1=function(){var e=function(){function e(t,n){m(this,e),this.ontologyService=t,this.ga=n,this.selected=new ol,this.formControl=new LU(""),this.autoCompleteOpen=!1}return b(e,[{key:"ngOnInit",value:function(){var e=this;this.filteredResults$=this.formControl.valueChanges.pipe(bf(function(e){return"string"==typeof e}),Ef(""),Of(function(t){return e.ontologyService.filter(t)}),ce(function(t){return(0,$q.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,$q.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)(Os(T0),Os(yq))},e.\u0275cmp=Ot({type:e,selectors:[["ccf-ontology-search"]],inputs:{placeholderText:"placeholderText"},outputs:{selected:"selected"},decls:10,vars:9,consts:[[1,"ccf-ontology-search"],["appearance","outline",1,"field"],["matPrefix","","color","primary",1,"search"],["type","text","matInput","",1,"input",3,"placeholder","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&&(As(0,"form",0),As(1,"mat-form-field",1),As(2,"mat-icon",2),Cu(3,"search"),Ms(),Is(4,"input",3),As(5,"mat-autocomplete",4,5),Vs("optionSelected",function(e){return t.onSelect(e)})("opened",function(){return t.autoCompleteOpen=!0})("closed",function(){return t.autoCompleteOpen=!1}),As(7,"div",6),Cs(8,s1,7,4,"mat-option",7),Jc(9,"async"),Ms(),Ms(),Ms(),Ms()),2&e){var n=Es(6);cu("autocomplete-open",t.autoCompleteOpen),Yo(4),Ts("placeholder",t.placeholderText)("formControl",t.formControl)("matAutocomplete",n),Yo(1),Ts("displayWith",t.displayFormatter),Yo(3),Ts("ngForOf",el(9,7,t.filteredResults$))}},directives:[WU,pU,zU,RH,B_,EH,sG,qz,ZH,fU,KU,XH,qh,Rb],pipes:[sd],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}(),c1=function(e){return[e]};function l1(e,t){if(1&e){var n=Ls();As(0,"ccf-ontology-tree",2),Vs("nodeSelected",function(e){return bn(n),Ws().ontologySelection.emit(e)}),Ms()}if(2&e){var i=t.ngIf,r=Ws();Ts("nodes",$c(7,c1,i))("rootNode",i.id)("getChildren",r.ontologySearchService.getChildren)("occurenceData",r.occurenceData)("termData",r.termData)("ontologyFilter",r.ontologyFilter)("header",r.header)}}var h1=function(){var e=function(){function e(t){m(this,e),this.ontologySearchService=t,this.ontologySelection=new ol}return b(e,[{key:"ngOnChanges",value:function(e){"treeModel"in e&&this.treeModel&&this.ontologySearchService.setTreeModel(this.treeModel)}},{key:"selected",value:function(e){var t,n,i=null!==(n=null===(t=this.treeModel)||void 0===t?void 0:t.nodes)&&void 0!==n?n:{};this.tree.expandAndSelect(e,function(e){return i[e.parent]})}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Os(T0))},e.\u0275cmp=Ot({type:e,selectors:[["ccf-ontology-selection"]],viewQuery:function(e,t){var n;(1&e&&yl(a1,5),2&e)&&(ml(n=_l())&&(t.tree=n.first))},inputs:{occurenceData:"occurenceData",termData:"termData",treeModel:"treeModel",ontologyFilter:"ontologyFilter",header:"header",placeholderText:"placeholderText"},outputs:{ontologySelection:"ontologySelection"},features:[Xu([T0]),qt],decls:3,vars:4,consts:[[3,"placeholderText","selected"],["class","tree",3,"nodes","rootNode","getChildren","occurenceData","termData","ontologyFilter","header","nodeSelected",4,"ngIf"],[1,"tree",3,"nodes","rootNode","getChildren","occurenceData","termData","ontologyFilter","header","nodeSelected"]],template:function(e,t){1&e&&(As(0,"ccf-ontology-search",0),Vs("selected",function(e){return t.selected(e)}),Ms(),Cs(1,l1,1,9,"ccf-ontology-tree",1),Jc(2,"async")),2&e&&(Ts("placeholderText",t.placeholderText),Yo(1),Ts("ngIf",el(2,2,t.ontologySearchService.rootNode$)))},directives:[u1,Yh,a1],pipes:[sd],styles:[""],changeDetection:0}),e}(),d1=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 q;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)(Os(aZ),Os(eZ),Os(Cc))},e.\u0275cmp=Ot({type:e,selectors:[["ccf-drawer-toggle-button"]],hostVars:4,hostBindings:function(e,t){2&e&&(du(t.className),cu("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&&(As(0,"mat-icon",0),Vs("click",function(){return t.toggle()}),Cu(1),Ms()),2&e&&(Yo(1),Ou(" ",t.icon,"\n"))},directives:[B_],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 f1(e,t){1&e&&(As(0,"div",7),Is(1,"mat-spinner",8),As(2,"span",3),Cu(3,"Loading External Site"),Ms(),Ms())}function p1(e,t){if(1&e){var n=Ls();As(0,"iframe",9),Vs("load",function(){return bn(n),Ws().loading=!1}),Ms()}2&e&&ks("src",Ws().safeUrl,Yr)}var v1=function(){var e=function(){function e(t){m(this,e),this.sanitizer=t,this.className="ccf-viewer",this.url="",this.closed=new ol,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)(Os(Vd))},e.\u0275cmp=Ot({type:e,selectors:[["ccf-viewer"]],hostVars:2,hostBindings:function(e,t){2&e&&du(t.className)},inputs:{url:"url"},outputs:{closed:"closed"},features:[qt],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&&(As(0,"div",0),As(1,"a",1),As(2,"mat-icon",2),Cu(3,"launch"),Ms(),As(4,"span",3),Cu(5,"Open in Portal"),Ms(),Ms(),As(6,"button",4),Vs("click",function(){return t.closed.emit()}),As(7,"mat-icon",2),Cu(8,"clear"),Ms(),Ms(),Ms(),Cs(9,f1,4,0,"div",5),Cs(10,p1,1,1,"iframe",6)),2&e&&(Yo(1),Ts("href",t.safeUrl,Xr)("disabled",!t.safeUrl),Yo(8),Ts("ngIf",t.loading),Yo(1),Ts("ngIf",t.safeUrl))},directives:[X_,B_,q_,Yh,YQ],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 g1(e,t){if(1&e&&Is(0,"div",3),2&e){var n=t.index;cu("line-tick-visible",Ws().tissueSectionExists(n+1))}}var m1=function(){return[]},y1=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=Ot({type:e,selectors:[["ccf-tissue-section-vis"]],hostVars:2,hostBindings:function(e,t){2&e&&du(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&&(As(0,"div"),Cu(1,"0"),Ms(),As(2,"div",0),Cs(3,g1,1,2,"div",1),Is(4,"div",2),Ms(),As(5,"div"),Cu(6),Ms()),2&e&&(Yo(3),Ts("ngForOf",Kc(2,m1).constructor(t.totalTissueSections)),Yo(3),Eu(t.totalTissueSections))},directives:[qh],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 b1(e){return null!==e&&"object"==typeof e&&"constructor"in e&&e.constructor===Object}function _1(e,t){void 0===e&&(e={}),void 0===t&&(t={}),Object.keys(t).forEach(function(n){void 0===e[n]?e[n]=t[n]:b1(t[n])&&b1(e[n])&&Object.keys(t[n]).length>0&&_1(e[n],t[n])})}var w1={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 k1(){var e="undefined"!=typeof document?document:{};return _1(e,w1),e}var x1={document:w1,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 S1(){var e="undefined"!=typeof window?window:{};return _1(e,x1),e}function C1(e){return(C1=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function E1(e,t){return(E1=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function O1(){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(G){return!1}}function T1(e,t,n){return(T1=O1()?Reflect.construct:function(e,t,n){var i=[null];i.push.apply(i,t);var r=new(Function.bind.apply(e,i));return n&&E1(r,n.prototype),r}).apply(null,arguments)}function P1(e){var t="function"==typeof Map?new Map:void 0;return(P1=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 T1(e,arguments,C1(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),E1(n,e)})(e)}var A1=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}(P1(Array));function M1(e){void 0===e&&(e=[]);var t=[];return e.forEach(function(e){Array.isArray(e)?t.push.apply(t,M1(e)):t.push(e)}),t}function I1(e,t){return Array.prototype.filter.call(e,t)}function R1(e,t){var n=S1(),i=k1(),r=[];if(!t&&e instanceof A1)return e;if(!e)return new A1(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;f-=1){var p=d[f];o&&p.listener===o||o&&p.listener&&p.listener.dom7proxy&&p.listener.dom7proxy===o?(h.removeEventListener(c,p.proxyListener,a),d.splice(f,1)):o||(h.removeEventListener(c,p.proxyListener,a),d.splice(f,1))}}return this},trigger:function(){for(var e=S1(),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=S1();return this[0]?e.getComputedStyle(this[0],null):{}},offset:function(){if(this.length>0){var e=S1(),t=k1(),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=S1();if(1===arguments.length){if("string"!=typeof e){for(n=0;nt-1)return R1([]);if(e<0){var n=t+e;return R1(n<0?[]:[this[n]])}return R1([this[e]])},append:function(){for(var e,t=k1(),n=0;n=0;n-=1)this[t].insertBefore(r.childNodes[n],this[t].childNodes[0])}else if(e instanceof A1)for(n=0;n0?e?this[0].nextElementSibling&&R1(this[0].nextElementSibling).is(e)?R1([this[0].nextElementSibling]):R1([]):R1(this[0].nextElementSibling?[this[0].nextElementSibling]:[]):R1([])},nextAll:function(e){var t=[],n=this[0];if(!n)return R1([]);for(;n.nextElementSibling;){var i=n.nextElementSibling;e?R1(i).is(e)&&t.push(i):t.push(i),n=i}return R1(t)},prev:function(e){if(this.length>0){var t=this[0];return e?t.previousElementSibling&&R1(t.previousElementSibling).is(e)?R1([t.previousElementSibling]):R1([]):R1(t.previousElementSibling?[t.previousElementSibling]:[])}return R1([])},prevAll:function(e){var t=[],n=this[0];if(!n)return R1([]);for(;n.previousElementSibling;){var i=n.previousElementSibling;e?R1(i).is(e)&&t.push(i):t.push(i),n=i}return R1(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}}()),j1}function Y1(e){return void 0===e&&(e={}),F1||(F1=function(e){var t=(void 0===e?{}:e).userAgent,n=X1(),i=S1(),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_]+))?/),d=!l&&o.match(/(iPhone\sOS|iOS)\s([\d_]+)/),f="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&&!f&&(a.os="android",a.android=!0),(l||d||h)&&(a.os="ios",a.ios=!0),a}(e)),F1}function K1(){return B1||(B1=function(){var e,t=S1();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)}}()),B1}var $1={name:"resize",create:function(){var e=this;W1(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=S1();e.params.resizeObserver&&void 0!==S1().ResizeObserver?e.resize.createObserver():(t.addEventListener("resize",e.resize.resizeHandler),t.addEventListener("orientationchange",e.resize.orientationChangeHandler))},destroy:function(e){var t=S1();e.resize.removeObserver(),t.removeEventListener("resize",e.resize.resizeHandler),t.removeEventListener("orientationchange",e.resize.orientationChangeHandler)}}};function Q1(){return(Q1=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=V1(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!==k1()&&n!==S1()?(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,d=o.edgeSwipeDetection||o.iOSEdgeSwipeDetection,f=o.edgeSwipeThreshold||o.iOSEdgeSwipeThreshold;if(d&&(l<=f||l>=i.innerWidth-f)){if("prevent"!==d)return;e.preventDefault()}if(W1(r,{isTouched:!0,isMoved:!1,allowTouchCallbacks:!0,isScrolling:void 0,startMoving:void 0}),a.startX=l,a.startY=h,r.touchStartTime=U1(),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&&V1(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 t2(e){var t=k1(),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&&(W1(o,{startX:c,startY:l,currentX:c,currentY:l}),i.touchStartTime=U1()));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&&V1(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,d=o.currentY-o.startY;if(!(n.params.threshold&&Math.sqrt(Math.pow(h,2)+Math.pow(d,2))=25&&(f=180*Math.atan2(Math.abs(d),Math.abs(h))/Math.PI,i.isScrolling=n.isHorizontal()?f>r.touchAngle:90-f>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:d;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:U1()})),n.updateProgress(i.currentTranslate),n.setTranslate(i.currentTranslate))}}}}}}function n2(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=U1(),d=h-n.touchStartTime;if(t.allowClick&&(t.updateClickedSlide(c),t.emit("tap click",c),d<300&&h-n.lastClickTime<300&&t.emit("doubleTap doubleClick",c)),n.lastClickTime=U1(),z1(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 f=n.velocities.pop(),p=n.velocities.pop(),v=f.time-p.time;t.velocity=(f.position-p.position)/v,t.velocity/=2,Math.abs(t.velocity)150||U1()-f.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 E=0,O=t.slidesSizesGrid[0],T=0;T=s[T]&&l=s[T]&&(E=T,O=s[s.length-1]-s[s.length-2])}var A=(l-s[E])/O,M=Ei.longSwipesMs){if(!i.longSwipes)return void t.slideTo(t.activeIndex);"next"===t.swipeDirection&&t.slideTo(A>=i.longSwipesRatio?E+M:E),"prev"===t.swipeDirection&&t.slideTo(A>1-i.longSwipesRatio?E+M:E)}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(E+M),"prev"===t.swipeDirection&&t.slideTo(E)):t.slideTo(c.target===t.navigation.nextEl?E+M:E)}}}}function i2(){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 r2(e){var t=this;!t.enabled||t.allowClick||(t.params.preventClicks&&e.preventDefault(),t.params.preventClicksPropagation&&t.animating&&(e.stopPropagation(),e.stopImmediatePropagation()))}function o2(){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 a2=!1;function s2(){}var u2={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 c2={modular:{useParams:function(e){var t=this;!t.modules||Object.keys(t.modules).forEach(function(n){var i=t.modules[n];i.params&&W1(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,P=x/T,A=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>A||D===A&&N===T-1)&&(N+=1)>=T&&(N=0,D+=1)):D=M-(N=Math.floor(M/P))*P;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&&d.push(_),f.push(_)):(i.roundLengths&&(_=Math.floor(_)),(k-Math.min(e.params.slidesPerGroupSkip,k))%e.params.slidesPerGroup==0&&d.push(_),f.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(((C={})[t("width")]=e.virtualSize+i.spaceBetween+"px",C)),i.slidesPerColumn>1&&(e.virtualSize=(O+i.spaceBetween)*x,e.virtualSize=Math.ceil(e.virtualSize/i.slidesPerColumn)-i.spaceBetween,r.css(((E={})[t("width")]=e.virtualSize+i.spaceBetween+"px",E)),i.centeredSlides)){S=[];for(var K=0;K1&&d.push(e.virtualSize-o)}if(0===d.length&&(d=[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;d=d.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=V1(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),W1(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 d=Math.min(a.slidesPerGroupSkip,l);t=d+Math.floor((l-d)/a.slidesPerGroup)}if(t>=o.length&&(t=o.length-1),l!==s){var f=parseInt(n.slides.eq(l).attr("data-swiper-slide-index")||l,10);W1(n,{snapIndex:t,realIndex:f,previousIndex:s,activeIndex:l}),n.emit("activeIndexChange"),n.emit("snapIndexChange"),u!==f&&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=V1(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),(d||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!==d&&(!a.allowSlideNext&&ya.translate&&y>a.maxTranslate()&&(d||0)!==s))return!1;if(m=s>d?"next":s=e&&(d=e)}),void 0!==d&&(c=a.indexOf(d))<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(V1(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(),z1(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(),z1(function(){t.slideTo(o)})):t.slideTo(o)}else t.slideTo(o)}},loop:{loopCreate:function(){var e=this,t=k1(),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=V1(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(V1(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 d=0;d1,d=l.slidesPerColumn>1,f=o.enabled;h&&!d?(a.removeClass(o.containerModifierClass+"multirow "+o.containerModifierClass+"multirow-column"),e.emitContainerClasses()):!h&&d&&(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(),W1(e.params,l);var g=e.params.enabled;W1(e,{allowTouchMove:e.params.allowTouchMove,allowSlideNext:e.params.allowSlideNext,allowSlidePrev:e.params.allowSlidePrev}),f&&!g?e.disable():!f&&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=S1(),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=S1();function u(){o&&o()}V1(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 V1(n.el).each(function(t){var i=W1({},n,{el:t});a.push(new e(i))}),a}var s=this;s.__swiper__=!0,s.support=X1(),s.device=Y1({userAgent:n.userAgent}),s.browser=K1(),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=W1({},u2);return s.useParams(l),s.params=W1({},l,l2,n),s.originalParams=W1({},s.params),s.passedParams=W1({},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.$=V1,W1(s,{enabled:s.params.enabled,el:t,classNames:[],slides:V1(),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:U1(),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=V1(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=V1(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=k1().createElement("div");r=V1(o),o.className=t.params.wrapperClass,n.append(o),n.children("."+t.params.slideClass).each(function(e){r.append(e)})}return W1(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){W1(l2,e)},e.installModule=function(t){e.prototype.modules||(e.prototype.modules={});var n=t.name||Object.keys(e.prototype.modules).length+"_"+U1();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]:V2(e[n],t[n]):e[n]=t[n]):e[n]=t[n]})}function z2(e){return null!=e&&"false"!="".concat(e)}var U2=["pagination","navigation","scrollbar","virtual"];function H2(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return F2(e)?e:!0===z2(e)&&t}var G2=["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 W2(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={on:{}},n={};V2(t,d2.defaults),V2(t,d2.extendedDefaults),t._emitClasses=!0;var i={};return Object.keys(e).forEach(function(r){var o=r.replace(/^_/,"");void 0!==e[o]&&(G2.indexOf(o)>=0?F2(e[o])?(t[o]={},n[o]={},V2(t[o],e[o]),V2(n[o],e[o])):(t[o]=e[o],n[o]=e[o]):i[o]=e[o])}),{params:t,passedParams:n,rest:i}}var q2=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=z2(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)(Os(Ac))},e.\u0275dir=Rt({type:e,selectors:[["ng-template","swiperSlide",""]],inputs:{class:"class",zoom:"zoom",virtualIndex:"virtualIndex"}}),e}(),X2=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 ol,this.s__containerClasses=new ol,this.s__slideClass=new ol,this.s__swiper=new ol,this.s_activeIndexChange=new ol,this.s_afterInit=new ol,this.s_autoplay=new ol,this.s_autoplayStart=new ol,this.s_autoplayStop=new ol,this.s_beforeDestroy=new ol,this.s_beforeInit=new ol,this.s_beforeLoopFix=new ol,this.s_beforeResize=new ol,this.s_beforeSlideChangeStart=new ol,this.s_beforeTransitionStart=new ol,this.s_breakpoint=new ol,this.s_changeDirection=new ol,this.s_click=new ol,this.s_doubleTap=new ol,this.s_doubleClick=new ol,this.s_destroy=new ol,this.s_fromEdge=new ol,this.s_hashChange=new ol,this.s_hashSet=new ol,this.s_imagesReady=new ol,this.s_init=new ol,this.s_keyPress=new ol,this.s_lazyImageLoad=new ol,this.s_lazyImageReady=new ol,this.s_loopFix=new ol,this.s_momentumBounce=new ol,this.s_navigationHide=new ol,this.s_navigationShow=new ol,this.s_observerUpdate=new ol,this.s_orientationchange=new ol,this.s_paginationHide=new ol,this.s_paginationRender=new ol,this.s_paginationShow=new ol,this.s_paginationUpdate=new ol,this.s_progress=new ol,this.s_reachBeginning=new ol,this.s_reachEnd=new ol,this.s_realIndexChange=new ol,this.s_resize=new ol,this.s_scroll=new ol,this.s_scrollbarDragEnd=new ol,this.s_scrollbarDragMove=new ol,this.s_scrollbarDragStart=new ol,this.s_setTransition=new ol,this.s_setTranslate=new ol,this.s_slideChange=new ol,this.s_slideChangeTransitionEnd=new ol,this.s_slideChangeTransitionStart=new ol,this.s_slideNextTransitionEnd=new ol,this.s_slideNextTransitionStart=new ol,this.s_slidePrevTransitionEnd=new ol,this.s_slidePrevTransitionStart=new ol,this.s_slideResetTransitionStart=new ol,this.s_slideResetTransitionEnd=new ol,this.s_sliderMove=new ol,this.s_sliderFirstMove=new ol,this.s_slidesLengthChange=new ol,this.s_slidesGridLengthChange=new ol,this.s_snapGridLengthChange=new ol,this.s_snapIndexChange=new ol,this.s_tap=new ol,this.s_toEdge=new ol,this.s_touchEnd=new ol,this.s_touchMove=new ol,this.s_touchMoveOpposite=new ol,this.s_touchStart=new ol,this.s_transitionEnd=new ol,this.s_transitionStart=new ol,this.s_update=new ol,this.s_zoomChange=new ol,this.s_swiper=new ol,this.indexChange=new ol,this._activeSlides=new ae,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=$d(a.slides.slice(a.slides.length-a.loopedSlides)),a.appendSlides=$d(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=H2(e,{nextEl:r||null,prevEl:o||null}),this.showNavigation=!(!0!==z2(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=H2(e,{el:n||null}),this.showPagination=B2(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=H2(e,{el:n||null}),this.showScrollbar=B2(e,this._scrollbar,this._scrollbarElRef)}},{key:"virtual",get:function(){return this._virtual},set:function(e){this._virtual=H2(e)}},{key:"index",set:function(e){this.setIndex(e)}},{key:"config",set:function(e){this.updateSwiper(e);var t=W2(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:$d(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=W2(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=W2(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=d2.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=F2(this.swiperRef.params[n]);if(Object.keys(this.swiperRef.modules).indexOf(n)>=0){var r=this.swiperRef.modules[n].params[n];i?V2(this.swiperRef.params[n],r):this.swiperRef.params[n]=r}i&&F2(t)?V2(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)(Os(Xl),Os(Ju),Os(Cc),Os(Ml))},e.\u0275cmp=Ot({type:e,selectors:[["swiper"],["","swiper",""]],contentQueries:function(e,t,n){var i;(1&e&&bl(n,q2,4),2&e)&&(ml(i=_l())&&(t.slidesEl=i))},viewQuery:function(e,t){var n;(1&e&&(yl(f2,5),yl(p2,5),yl(v2,5),yl(g2,5)),2&e)&&(ml(n=_l())&&(t.prevElRef=n.first),ml(n=_l())&&(t.nextElRef=n.first),ml(n=_l())&&(t.scrollbarElRef=n.first),ml(n=_l())&&(t.paginationElRef=n.first))},hostVars:2,hostBindings:function(e,t){2&e&&du(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:[qt],ngContentSelectors:j2,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&&(Xs(R2),Ys(0),Cs(1,m2,5,0,"ng-container",0),Cs(2,y2,2,0,"div",1),Cs(3,b2,2,0,"div",2),As(4,"div",3),Ys(5,1),Cs(6,w2,1,0,void 0,4),Cs(7,x2,1,0,void 0,4),Cs(8,C2,1,0,void 0,4),Ys(9,2),Ms(),Ys(10,3),Cs(11,I2,2,3,"ng-template",null,5,Sl)),2&e){var n=Es(12);Yo(1),Ts("ngIf",t.navigation&&t.showNavigation),Yo(1),Ts("ngIf",t.scrollbar&&t.showScrollbar),Yo(1),Ts("ngIf",t.pagination&&t.showPagination),Yo(1),Ts("ngClass",t.wrapperClass),ks("id",t.id),Yo(2),Ts("ngTemplateOutlet",n)("ngTemplateOutletContext",$c(11,D2,t.prependSlides)),Yo(1),Ts("ngTemplateOutlet",n)("ngTemplateOutletContext",$c(13,N2,t.activeSlides)),Yo(1),Ts("ngTemplateOutlet",n)("ngTemplateOutletContext",$c(15,L2,t.appendSlides))}},directives:[Yh,Gh,nd,qh,Zh,Jh,ed],pipes:[sd],styles:["\n swiper {\n display: block;\n }\n "],encapsulation:2,changeDetection:0}),e}(),Y2=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({imports:[[cd]]}),e}();function K2(e,t){if(1&e){var n=Ls();As(0,"div",7),As(1,"div",8),Cu(2),Ms(),As(3,"a",9),Vs("click",function(){bn(n);var e=Ws().$implicit;return Ws().linkClicked.emit(e)}),Cu(4," DATA "),As(5,"mat-icon"),Cu(6,"open_in_new"),Ms(),Ms(),Ms()}if(2&e){var i=Ws().$implicit;Yo(1),uu("background-image","url("+i.thumbnail+")"),Yo(1),Ou(" ",i.technology," ")}}function $2(e,t){1&e&&(Rs(0),Cs(1,K2,7,3,"ng-template",6),Ds())}var Q2=function(){var e=-1;return function(){return e+=1}}(),Z2=function(){var e=function(){function e(){m(this,e),this.className="ccf-thumbnail-carousel",this.linkClicked=new ol,this.uid=Q2(),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=Ot({type:e,selectors:[["ccf-thumbnail-carousel"]],hostVars:2,hostBindings:function(e,t){2&e&&du(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&&(As(0,"div",0),As(1,"button",1),As(2,"mat-icon"),Cu(3,"navigate_before"),Ms(),Ms(),Ms(),As(4,"swiper",2),Cs(5,$2,2,0,"ng-container",3),Ms(),As(6,"div",4),As(7,"button",1),Is(8,"div",5),As(9,"mat-icon"),Cu(10,"navigate_next"),Ms(),Ms(),Ms()),2&e&&(Yo(1),ks("id",t.prevButtonId),Yo(3),Ts("config",t.config)("navigation",t.navigation),Yo(1),Ts("ngForOf",t.data)("ngForTrackBy",t.itemId),Yo(2),ks("id",t.nextButtonId))},directives:[q_,B_,X2,qh,q2],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 J2(e,t){if(1&e){var n=Ls();As(0,"mat-icon",14),Vs("click",function(){return bn(n),Ws().toggleExpansion()}),Cu(1),Ms()}if(2&e){var i=Ws();Yo(1),Eu(i.expanded?"expand_less":"expand_more")}}function e3(e,t){if(1&e&&Is(0,"ccf-tissue-section-vis",20),2&e){var n=Ws(2);Ts("totalTissueSections",n.tissueBlock.sectionCount)("tissueSections",n.tissueBlock.sections)}}function t3(e,t){if(1&e){var n=Ls();Rs(0),As(1,"ccf-thumbnail-carousel",21),Vs("linkClicked",function(e){return bn(n),Ws(2).linkHandler(e.link)}),Ms(),Ds()}if(2&e){var i=Ws(2);Yo(1),Ts("data",i.tissueBlock.datasets)}}function n3(e,t){if(1&e){var n=Ls();Rs(0),As(1,"ccf-thumbnail-carousel",21),Vs("linkClicked",function(e){return bn(n),Ws(3).linkHandler(e.link)}),Ms(),Ds()}if(2&e){var i=Ws().$implicit;Yo(1),Ts("data",i.datasets)}}function i3(e,t){if(1&e){var n=Ls();As(0,"div",22),As(1,"div",23),As(2,"mat-icon",24),Cu(3,"bubble_chart"),Ms(),As(4,"div",17),As(5,"div",8),Cu(6),Ms(),As(7,"div",8),Cu(8),Ms(),Ms(),As(9,"div",9),Vs("click",function(){var e=bn(n).$implicit;return Ws(2).linkHandler(e.link)}),As(10,"div",10),Cu(11,"TISSUE SECTION"),Ms(),As(12,"mat-icon",11),Cu(13,"open_in_new"),Ms(),Ms(),Ms(),Cs(14,n3,2,1,"ng-container",13),Ms()}if(2&e){var i=t.$implicit;Yo(6),Eu(i.label),Yo(2),Eu(i.description),Yo(6),Ts("ngIf",i.datasets.length>0)}}function r3(e,t){if(1&e){var n=Ls();Rs(0),As(1,"div",15),As(2,"div",16),As(3,"mat-icon",5),Cu(4,"bubble_chart"),Ms(),As(5,"div",17),As(6,"div",8),Cu(7),Ms(),As(8,"div",8),Cu(9),Ms(),Ms(),As(10,"div",9),Vs("click",function(){bn(n);var e=Ws();return e.linkHandler(e.tissueBlock.link)}),As(11,"div",10),Cu(12,"TISSUE BLOCK"),Ms(),As(13,"mat-icon",11),Cu(14,"open_in_new"),Ms(),Ms(),Ms(),Cs(15,e3,1,2,"ccf-tissue-section-vis",18),Cs(16,t3,2,1,"ng-container",13),Ms(),Cs(17,i3,15,3,"div",19),Ds()}if(2&e){var i=Ws();Yo(7),Eu(i.tissueBlock.label),Yo(2),Eu(i.tissueBlock.description),Yo(6),Ts("ngIf",i.tissueBlock.sections.length>1),Yo(1),Ts("ngIf",i.tissueBlock.datasets.length>0),Yo(1),Ts("ngForOf",i.tissueBlock.sections)}}var o3=function(e){return{"background-color":e}},a3=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 ol,this.linkClick=new ol,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)(Os(yq))},e.\u0275cmp=Ot({type:e,selectors:[["ccf-donor-card"]],hostVars:2,hostBindings:function(e,t){2&e&&du(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&&(As(0,"div",0),As(1,"div",1),Vs("click",function(){return t.handleCheckbox()}),Is(2,"mat-checkbox",2),Ms(),As(3,"div",3),As(4,"div",4),As(5,"mat-icon",5),Cu(6,"person"),Ms(),As(7,"div",6),As(8,"div",7),Cu(9),Ms(),As(10,"div",8),Cu(11),Ms(),Ms(),Ms(),As(12,"div",9),Vs("click",function(){return t.linkHandler(t.tissueBlock.donor.link)}),As(13,"div",10),Cu(14,"DONOR"),Ms(),As(15,"mat-icon",11),Cu(16,"open_in_new"),Ms(),Ms(),Cs(17,J2,2,1,"mat-icon",12),Ms(),Ms(),Cs(18,r3,18,5,"ng-container",13)),2&e&&(Yo(1),cu("selected",t.selected)("highlighted",t.highlighted),Ts("ngStyle",$c(18,o3,t.selected?t.color:"transparent")),Yo(1),cu("checkselected",t.selected),Ts("checked",t.selected),Yo(1),cu("hover-enabled",t.selected)("expanded",t.expanded)("highlighted",t.highlighted),Yo(6),Eu(t.tissueBlock.donor.label),Yo(2),Eu(t.tissueBlock.donor.description),Yo(6),Ts("ngIf",t.selected),Yo(1),Ts("ngIf",t.expanded))},directives:[td,e$,B_,Yh,qh,y1,Z2],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 s3(e,t){if(1&e&&(As(0,"div",7),As(1,"div",8),Cu(2),Ms(),As(3,"div",9),Cu(4),Ms(),Ms()),2&e){var n=t.$implicit;Yo(2),Eu(n.count),Yo(2),Eu(n.label)}}function u3(e,t){if(1&e){var n=Ls();As(0,"div",10),Vs("mouseenter",function(){var e=bn(n).$implicit;return Ws().handleHover(e.tissueBlock.spatialEntityId)})("mouseleave",function(){return bn(n),Ws().handleUnhover()}),As(1,"ccf-donor-card",11),Vs("checked",function(e){var t=bn(n).$implicit;return Ws().handleSelection(t,e)})("linkClick",function(e){return bn(n),Ws().handleLinkClick(e)}),Ms(),Ms()}if(2&e){var i=t.$implicit,r=Ws();Yo(1),Ts("tissueBlock",i.tissueBlock)("selected",i.selected)("color",i.color)("highlighted",i.tissueBlock.spatialEntityId===r.highlighted)}}var c3=function(){var e=function(){function e(t){m(this,e),this.ga=t,this.linkClicked=new ol,this.listResultSelected=new ol,this.listResultDeselected=new ol,this.itemHovered=new ol,this.itemUnhovered=new ol,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)(Os(yq))},e.\u0275cmp=Ot({type:e,selectors:[["ccf-results-browser"]],inputs:{listResults:"listResults",aggregateData:"aggregateData",resultLabel:"resultLabel",highlighted:"highlighted",header:"header"},outputs:{linkClicked:"linkClicked",listResultSelected:"listResultSelected",listResultDeselected:"listResultDeselected",itemHovered:"itemHovered",itemUnhovered:"itemUnhovered"},decls:8,vars:7,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&&(As(0,"div",0),As(1,"div",1),As(2,"div",2),Cu(3),Ms(),Cs(4,s3,5,2,"div",3),Ms(),As(5,"div",4),Vs("scroll",function(e){return t.onScroll(e)}),Cs(6,u3,2,4,"div",5),Ms(),Is(7,"div",6),Ms()),2&e&&(Yo(3),Eu(t.resultLabel),Yo(1),Ts("ngForOf",t.aggregateData),Yo(1),cu("header-hidden",!t.header),Yo(1),Ts("ngForOf",t.listResults),Yo(1),cu("hidden",!!t.atScrollBottom))},directives:[qh,a3],styles:[".results-browser-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:calc(100% - 3rem);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:column;overflow-y:auto;scrollbar-width:thin;padding-right:.5rem;height:calc(100vh - 20rem)}.results-browser-container[_ngcontent-%COMP%] .results-browser-list.header-hidden[_ngcontent-%COMP%]{height:calc(100vh - 16rem)}.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:3rem;width:95%;bottom:0;pointer-events:none}.results-browser-container[_ngcontent-%COMP%] .scroll-gradient.hidden[_ngcontent-%COMP%]{display:none}"],changeDetection:0}),e}(),l3=["*",[["mat-toolbar-row"]]],h3=["*","mat-toolbar-row"],d3=ab(function(){return function e(t){m(this,e),this._elementRef=t}}()),f3=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275dir=Rt({type:e,selectors:[["mat-toolbar-row"]],hostAttrs:[1,"mat-toolbar-row"],exportAs:["matToolbarRow"]}),e}(),p3=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}(d3);return e.\u0275fac=function(t){return new(t||e)(Os(Ju),Os(qf),Os(bh))},e.\u0275cmp=Ot({type:e,selectors:[["mat-toolbar"]],contentQueries:function(e,t,n){var i;(1&e&&bl(n,f3,5),2&e)&&(ml(i=_l())&&(t._toolbarRows=i))},hostAttrs:[1,"mat-toolbar"],hostVars:4,hostBindings:function(e,t){2&e&&cu("mat-toolbar-multiple-rows",t._toolbarRows.length>0)("mat-toolbar-single-row",0===t._toolbarRows.length)},inputs:{color:"color"},exportAs:["matToolbar"],features:[cs],ngContentSelectors:h3,decls:2,vars:0,template:function(e,t){1&e&&(Xs(l3),Ys(0),Ys(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}(),v3=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({imports:[[rb],rb]}),e}();function g3(e,t){if(1&e&&(As(0,"a",5),Cu(1,"LOGIN"),Ms()),2&e){var n=Ws();cu("disabled",n.loginDisabled||!n.homeUrl),Ts("href",n.homeUrl+"login",Xr)}}function m3(e,t){if(1&e&&(As(0,"a",5),Cu(1,"LOGOUT"),Ms()),2&e){var n=Ws();cu("disabled",n.loginDisabled||!n.homeUrl),Ts("href",n.homeUrl+"logout",Xr)}}var y3=function(){var e=function e(){m(this,e),this.refreshClicked=new ol,this.downloadClicked=new ol};return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=Ot({type:e,selectors:[["ccf-header"]],inputs:{homeUrl:"homeUrl",loginDisabled:"loginDisabled",logoTooltip:"logoTooltip",loggedIn:"loggedIn",filters:"filters"},outputs:{refreshClicked:"refreshClicked",downloadClicked:"downloadClicked"},decls:6,vars:4,consts:[[1,"ccf-header"],[1,"home",3,"href"],["aria-hidden","false","aria-label","Reset tool","matTooltipPosition","right",1,"logo",3,"matTooltip"],[1,"filler"],["mat-button","","class","authentication","rel","noreferrer noopener","target","_blank",3,"disabled","href",4,"ngIf"],["mat-button","","rel","noreferrer noopener","target","_blank",1,"authentication",3,"href"]],template:function(e,t){1&e&&(As(0,"mat-toolbar",0),As(1,"a",1),Is(2,"div",2),Ms(),Is(3,"div",3),Cs(4,g3,2,3,"a",4),Cs(5,m3,2,3,"a",4),Ms()),2&e&&(Yo(1),Ts("href",t.homeUrl,Xr),Yo(1),Ts("matTooltip",t.logoTooltip),Yo(2),Ts("ngIf",!t.loggedIn),Yo(1),Ts("ngIf",t.loggedIn))},directives:[p3,Ow,Yh,X_],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%] .home[_ngcontent-%COMP%]{height:100%;width:25rem;align-items:center;display:flex;padding:.25rem 0}.ccf-header[_ngcontent-%COMP%] .logo[_ngcontent-%COMP%]{width:100%;height:50%;background-repeat:no-repeat;background-size:contain}.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}.ccf-header[_ngcontent-%COMP%] .disabled[_ngcontent-%COMP%]{display:none}"],changeDetection:0}),e}(),b3=["bodyUI"];function _3(e,t){if(1&e&&(Is(0,"ccf-header",34),Jc(1,"async"),Jc(2,"async"),Jc(3,"async"),Jc(4,"async")),2&e){var n=Ws();cu("hide",!1===el(1,6,n.header$)),Ts("logoTooltip",el(2,8,n.logoTooltip$))("homeUrl",el(3,10,n.homeUrl$))("loggedIn",n.loggedIn)("loginDisabled",el(4,12,n.loginDisabled$))}}function w3(e,t){if(1&e){var n=Ls();As(0,"div",35),Vs("click",function(){bn(n),Ws();var e=Es(72);return e.expanded=!e.expanded}),As(1,"mat-icon",36),Cu(2),Ms(),Ms()}if(2&e){Ws();var i=Es(72);Yo(2),Ou(" ",i.expanded?"arrow_drop_up":"arrow_drop_down"," ")}}function k3(e,t){if(1&e){var n=Ls();As(0,"div",35),Vs("click",function(){bn(n);var e=Ws();return e.organListVisible=!e.organListVisible}),As(1,"mat-icon",37),Cu(2),Ms(),Ms()}if(2&e){var i=Ws();Yo(2),Ou(" ",i.organListVisible?"arrow_drop_up":"arrow_drop_down"," ")}}var x3=function(){return{}},S3=function(){return{x:2.2,y:2,z:.4}},C3=function(){function e(n,i,r,o,a,s,u,c,l,h,d,f){var p=this;m(this,e),this.data=r,this.theming=o,this.scene=a,this.listResultsState=s,this.consentService=u,this.snackbar=c,this.dataSource=h,this.globalConfig=d,this.setSelectedSearches=vQ(AQ),this.removeSpatialSearch=vQ(PQ),this.ontologySelectionLabel="body",this.cellTypeSelectionLabel="cell",this.selectionLabel="body | cell",this.organListVisible=!0,this.url="",this.acceptableViewerDomains=pQ.acceptableViewerDomains||[],this.viewerOpen=!1,this.spinnerActive$=this.data.queryStatus$.pipe(ce(function(e){return e===xQ.Running})),this.loadingMessage$=this.data.state$.pipe(cG("statusMessage")),this.theme$=this.globalConfig.getOption("theme"),this.themeMode$=new Bf(1),this.header$=this.globalConfig.getOption("header"),this.homeUrl$=this.globalConfig.getOption("homeUrl"),this.logoTooltip$=this.globalConfig.getOption("logoTooltip"),this.loginDisabled$=this.globalConfig.getOption("loginDisabled"),o.initialize(n,i),l.setRootElement(n),r.tissueBlockData$.subscribe(),r.aggregateData$.subscribe(),r.ontologyTermOccurencesData$.subscribe(),r.cellTypeTermOccurencesData$.subscribe(),r.sceneData$.subscribe(),r.filter$.subscribe(),r.technologyFilterData$.subscribe(),r.providerFilterData$.subscribe(),this.ontologyTerms$=r.filter$.pipe(cG("ontologyTerms")),this.cellTypeTerms$=r.filter$.pipe(cG("cellTypeTerms")),J_([this.theme$,this.themeMode$]).subscribe(function(e){var n=t(e,2),i=n[0],r=n[1];p.theming.setTheme("".concat(i,"-theme-").concat(r)),f.markForCheck()})}return b(e,[{key:"isLightTheme",get:function(){return this.theming.getTheme().endsWith("light")}},{key:"ngOnInit",value:function(){var e=this,t=this.snackbar.openFromComponent(I$,{data:{preClose:function(){t.dismiss()}},duration:"not-set"===this.consentService.consent?1/0:3e3});window.matchMedia?(window.matchMedia("(prefers-color-scheme: dark)").matches?this.themeMode$.next("dark"):this.themeMode$.next("light"),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",function(t){e.themeMode$.next(t.matches?"dark":"light")})):this.themeMode$.next("light")}},{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.themeMode$.next(this.isLightTheme?"dark":"light")}},{key:"ontologySelected",value:function(e,t){if(e)return"anatomical-structures"===t?(this.data.updateFilter({ontologyTerms:e.map(function(e){return e.id})}),this.ontologySelectionLabel=this.createSelectionLabel(e)):(this.data.updateFilter({cellTypeTerms:e.map(function(e){return e.id})}),this.cellTypeSelectionLabel=this.createSelectionLabel(e)),this.selectionLabel=this.ontologySelectionLabel&&this.cellTypeSelectionLabel?"".concat(this.ontologySelectionLabel," | ").concat(this.cellTypeSelectionLabel):this.ontologySelectionLabel?"".concat(this.ontologySelectionLabel):this.cellTypeSelectionLabel?"".concat(this.cellTypeSelectionLabel):"",void(e[0]&&"body"===e[0].label&&this.resetView());this.data.updateFilter({ontologyTerms:[],cellTypeTerms:[]}),this.ontologySelectionLabel="",this.cellTypeSelectionLabel=""}},{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}();function E3(e,t){1&e&&Is(0,"ccf-root")}function O3(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=fQ.json(e);if(n(i))return i}else if(n(e))return e;throw new Error("Invalid data sources")}C3.\u0275fac=function(e){return new(e||C3)(Os(Ju),Os(ss),Os(EQ),Os(cQ),Os(BQ),Os(jQ),Os(wq),Os(bw),Os(sQ),Os(N$),Os(T$),Os(Cc))},C3.\u0275cmp=Ot({type:C3,selectors:[["ccf-root"]],viewQuery:function(e,t){var n;(1&e&&yl(b3,5),2&e)&&(ml(n=_l())&&(t.bodyUI=n.first))},decls:83,vars:117,consts:[[1,"ccf-app","mat-app-background"],[3,"text","active"],[3,"hide","logoTooltip","homeUrl","loggedIn","loginDisabled",4,"ngIf"],[1,"main-drawers"],["opened","",1,"left-drawer",3,"stateChange"],["left",""],[1,"filter-data"],[3,"filters","drawerExpanded","technologyFilters","providerFilters","spatialSearchFilters","filtersChange","spatialSearchSelected","spatialSearchRemoved"],["filterbox",""],[1,"filter-text"],[1,"sex","filter-tag"],[1,"age","filter-tag"],[1,"bmi","filter-tag"],["placeholderText","Search anatomical structures...",1,"ontology-selection",3,"treeModel","termData","occurenceData","header","ontologySelection"],["placeholderText","Search cell types...",1,"cell-type-selection",3,"treeModel","termData","occurenceData","header","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","CCF Exploration User Interface","documentationUrl","assets/docs/README.md","matTooltip","Open Info"],[3,"listResults","aggregateData","resultLabel","highlighted","header","listResultSelected","listResultDeselected","linkClicked","itemHovered","itemUnhovered"],[1,"selector-drawer"],[1,"organ-selector",3,"multiselect","occurenceData","organList","selectedOrgans","organsChanged"],["selector",""],[1,"close-button-wrapper"],["class","close-button",3,"click",4,"ngIf"],[1,"stage-content",3,"scene","bounds","nodeClick","nodeHoverStart","nodeHoverStop"],["bodyUI",""],[3,"logoTooltip","homeUrl","loggedIn","loginDisabled"],[1,"close-button",3,"click"],["aria-hidden","false","aria-label","Expand carousel drawer",1,"expand-collapse-icon"],["aria-hidden","false","aria-label","Close carousel drawer",1,"expand-collapse-icon"]],template:function(e,t){if(1&e){var n=Ls();As(0,"div",0),Is(1,"ccf-spinner-overlay",1),Jc(2,"async"),Jc(3,"async"),Cs(4,_3,5,14,"ccf-header",2),Jc(5,"async"),As(6,"ccf-drawer-container",3),Jc(7,"async"),As(8,"ccf-drawer",4,5),Vs("stateChange",function(){return bn(n),Es(13).removeBox()}),As(10,"div"),As(11,"div",6),As(12,"ccf-filters-popover",7,8),Vs("filtersChange",function(e){return t.data.updateFilter(e)})("spatialSearchSelected",function(e){return t.setSelectedSearches(e)})("spatialSearchRemoved",function(e){return t.removeSpatialSearch(e)}),Jc(14,"async"),Jc(15,"async"),Jc(16,"async"),Jc(17,"async"),Ms(),As(18,"div",9),As(19,"div",10),Cu(20,"Sex: "),As(21,"strong"),Cu(22),Jc(23,"async"),Ms(),Ms(),As(24,"div",11),Cu(25,"Age: "),As(26,"strong"),Cu(27),Jc(28,"async"),Jc(29,"async"),Ms(),Ms(),As(30,"div",12),Cu(31,"BMI: "),As(32,"strong"),Cu(33),Jc(34,"async"),Jc(35,"async"),Ms(),Ms(),Ms(),Ms(),As(36,"ccf-ontology-selection",13),Vs("ontologySelection",function(e){return t.ontologySelected(e,"anatomical-structures")}),Jc(37,"async"),Jc(38,"async"),Jc(39,"async"),Jc(40,"async"),Ms(),As(41,"ccf-ontology-selection",14),Vs("ontologySelection",function(e){return t.ontologySelected(e,"cell-type")}),Jc(42,"async"),Jc(43,"async"),Jc(44,"async"),Jc(45,"async"),Ms(),Is(46,"ccf-drawer-toggle-button"),Ms(),Ms(),As(47,"ccf-drawer",15,16),Vs("stateChange",function(){return bn(n),Es(13).removeBox()}),As(49,"ccf-viewer",17),Vs("closed",function(){return t.viewerOpen=!1}),Ms(),As(50,"div",18),As(51,"div",19),As(52,"button",20),Vs("click",function(){bn(n);var e=Es(13),t=Es(48);return e.removeBox(),t.toggleExpanded()}),As(53,"mat-icon",21),Cu(54),Ms(),Ms(),As(55,"button",22),Vs("click",function(){return t.toggleScheme()}),As(56,"mat-icon",21),Cu(57),Ms(),Ms(),As(58,"button",23),As(59,"mat-icon",24),Vs("click",function(){bn(n);var e=Es(9),i=Es(48),r=Es(13);return t.reset(e,i,r)}),Cu(60,"refresh "),Ms(),Ms(),Ms(),Is(61,"ccf-info-button",25),Ms(),As(62,"ccf-results-browser",26),Vs("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()}),Jc(63,"async"),Jc(64,"async"),Jc(65,"async"),Jc(66,"async"),Ms(),Is(67,"ccf-drawer-toggle-button"),Ms(),As(68,"ccf-drawer-content"),Jc(69,"async"),As(70,"div",27),As(71,"ccf-organ-selector",28,29),Vs("organsChanged",function(e){return t.scene.setSelectedReferenceOrgans(e)}),Jc(73,"async"),Jc(74,"async"),Jc(75,"async"),Ms(),Ms(),As(76,"div",30),Cs(77,w3,3,1,"div",31),Cs(78,k3,3,1,"div",31),Ms(),Is(79,"ccf-run-spatial-search"),As(80,"ccf-body-ui",32,33),Vs("nodeClick",function(e){return t.scene.sceneNodeClicked(e)})("nodeHoverStart",function(e){return t.scene.sceneNodeHovered(e)})("nodeHoverStop",function(){return t.scene.sceneNodeUnhover()}),Jc(82,"async"),Ms(),Ms(),Ms(),Ms()}if(2&e){var i,r,o,a,s=Es(48),u=Es(72);Yo(1),Ts("text",el(2,55,t.loadingMessage$))("active",el(3,57,t.spinnerActive$)),Yo(3),Ts("ngIf",!1===el(5,59,t.spinnerActive$)),Yo(2),cu("header-hidden",!1===el(7,61,t.header$)),Yo(6),Ts("filters",el(14,63,t.data.filter$))("drawerExpanded",s.expanded)("technologyFilters",el(15,65,t.data.technologyFilterData$))("providerFilters",el(16,67,t.data.providerFilterData$))("spatialSearchFilters",el(17,69,t.selectableSearches$)),Yo(10),Eu(null==(i=el(23,71,t.data.filter$))?null:i.sex),Yo(5),Tu("",null==(r=el(28,73,t.data.filter$))?null:r.ageRange[0],"-",null==(r=el(29,75,t.data.filter$))?null:r.ageRange[1],""),Yo(6),Tu("",null==(o=el(34,77,t.data.filter$))?null:o.bmiRange[0],"-",null==(o=el(35,79,t.data.filter$))?null:o.bmiRange[1],""),Yo(3),Ts("treeModel",el(37,81,t.ontologyTreeModel$))("termData",el(38,83,t.data.ontologyTermsFullData$))("occurenceData",el(39,85,t.data.ontologyTermOccurencesData$))("header",el(40,87,t.header$)),Yo(5),Ts("treeModel",el(42,89,t.cellTypeTreeModel$))("termData",el(43,91,t.data.cellTypeTermsFullData$))("occurenceData",el(44,93,t.data.cellTypeTermOccurencesData$))("header",el(45,95,t.header$)),Yo(8),cu("opened",t.viewerOpen),Ts("url",t.url),Yo(3),Ts("matTooltip",s.expanded?"Exit Fullscreen":"Enter Fullscreen"),Yo(2),Eu(s.expanded?"fullscreen_exit":"fullscreen"),Yo(1),Ts("matTooltip",t.isLightTheme?"Enter Dark Mode":"Enter Light Mode"),Yo(2),Ou("",t.isLightTheme?"brightness_2":"brightness_5"," "),Yo(5),Ts("listResults",el(63,97,t.listResultsState.listResults$))("aggregateData",el(64,99,t.data.aggregateData$))("resultLabel",t.selectionLabel)("highlighted",el(65,101,t.listResultsState.highlightedNodeId$))("header",el(66,103,t.header$)),Yo(6),cu("header-hidden",!1===el(69,105,t.header$)),Yo(2),cu("closed",!t.organListVisible)("expanded",u.expanded),Yo(1),Ts("multiselect",!0)("occurenceData",null!==(a=el(73,107,t.data.ontologyTermOccurencesData$))&&void 0!==a?a:Kc(115,x3))("organList",el(74,109,t.scene.referenceOrgans$))("selectedOrgans",el(75,111,t.scene.selectedReferenceOrgans$)),Yo(5),cu("closed",!t.organListVisible),Yo(1),Ts("ngIf",t.organListVisible),Yo(1),Ts("ngIf",!u.expanded),Yo(2),cu("expanded-stage",!t.organListVisible)("selector-expanded",u.expanded),Ts("scene",el(82,113,t.scene.scene$))("bounds",Kc(116,S3))}},directives:[$Q,Yh,hZ,aZ,O0,h1,d1,v1,Ow,B_,C$,c3,nZ,v$,b0,r$,y3],pipes:[sd],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-header.hide[_ngcontent-%COMP%]{display:none}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%]{height:calc(100% - 5rem);width:100%;opacity:1;overflow:hidden;transform:scale(1)}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container.header-hidden[_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%]{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%]{overflow:hidden;border-radius:.5rem;height:calc(100vh - 4rem)}.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;transition:all .5s ease-in-out;height:5rem;justify-content:start}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .selector-drawer.expanded[_ngcontent-%COMP%]{height:15rem;overflow-y:auto}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .selector-drawer.closed[_ngcontent-%COMP%]{height:1.5rem;top:-5rem}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] ccf-run-spatial-search[_ngcontent-%COMP%]{position:relative;float:right;height:0px;z-index:1;top:.5rem;right:.5rem}.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}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .expanded-stage[_ngcontent-%COMP%]{height:calc(100% - 3rem)}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .selector-expanded[_ngcontent-%COMP%]{height:calc(100% - 16.5rem)}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content.header-hidden[_ngcontent-%COMP%]{height:calc(100vh - 1rem)}.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{overflow:hidden}.ccf-app[_ngcontent-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] .left-drawer[_ngcontent-%COMP%] .cell-type-selection[_ngcontent-%COMP%] .ccf-ontology-search{margin-top:2rem}.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}.ccf-app[_ngcontent-%COMP%] .right-drawer[_ngcontent-%COMP%] .cff-drawer-inner-container{overflow:hidden}[_ngcontent-%COMP%]::-webkit-scrollbar{width:.5rem}"],changeDetection:0}),Mw([Bz(OQ.cellTypesTreeModel)],C3.prototype,"cellTypeTreeModel$",void 0),Mw([Bz(OQ.anatomicalStructuresTreeModel)],C3.prototype,"ontologyTreeModel$",void 0),Mw([Bz(IQ.items)],C3.prototype,"selectableSearches$",void 0),Mw([TK()],C3.prototype,"setSelectedSearches",void 0),Mw([TK()],C3.prototype,"removeSpatialSearch",void 0);var T3=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(Object.assign({},pQ.dbOptions),globalThis.dbOptions),pQ.customization),parse:{dataSources:O3,useRemoteApi:fQ.boolean,header:fQ.boolean,loginDisabled:fQ.boolean}})}return n}(dQ);return e.\u0275fac=function(t){return new(t||e)(Os(T$),Os(Cc))},e.\u0275cmp=Ot({type:e,selectors:[["ccf-root-wc"]],inputs:{dataSources:"dataSources",hubmapDataService:"hubmapDataService",hubmapDataUrl:"hubmapDataUrl",hubmapAssetUrl:"hubmapAssetUrl",hubmapToken:"hubmapToken",hubmapPortalUrl:"hubmapPortalUrl",useRemoteApi:"useRemoteApi",remoteApiEndpoint:"remoteApiEndpoint",theme:"theme",header:"header",homeUrl:"homeUrl",logoTooltip:"logoTooltip",loginDisabled:"loginDisabled"},features:[cs],decls:1,vars:1,consts:[[4,"ngIf"]],template:function(e,t){1&e&&Cs(0,E3,1,0,"ccf-root",0),2&e&&Ts("ngIf",t.initialized)},directives:[Yh,C3],encapsulation:2,changeDetection:0}),e}(),P3=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({imports:[[cd,Y_,V_,v3,Aw]]}),e}(),A3=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)).locator=i,r}return b(n,[{key:"createWorker",value:function(e){var t=this.getWorkerUrl(!0);return new Worker(t,{type:"module"})}},{key:"getWorkerUrl",value:function(e){if(e)return new URL(r(88509),r.b);var t=this.locator.prepareExternalUrl("0-es2015.worker.js"),n=new Blob(["importScripts('".concat(t,"')")],{type:"application/javascript"});return URL.createObjectURL(n)}}]),n}(W$);return e.\u0275fac=function(t){return new(t||e)(Zi(T$),Zi(Th))},e.\u0275prov=$e({token:e,factory:e.\u0275fac,providedIn:"root"}),e}(),M3=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:"selectToken",value:function(e){var t=e.useRemoteApi,n=e.remoteApiEndpoint;return t&&n?U$:"undefined"==typeof Worker||pQ.disableDbWorker?G$:A3}}]),n}(q$);return t.\u0275fac=function(n){return(e||(e=Ti(t)))(n||t)},t.\u0275prov=$e({token:t,factory:t.\u0275fac,providedIn:"root"}),t}(),I3=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({providers:[{provide:Il,useValue:cQ.initialize,multi:!0},cQ]}),e}(),R3=function(){var e=function(){function e(t,n){m(this,e),this.accessor=t,this.injector=n}return b(e,null,[{key:"forRoot",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return{ngModule:e,providers:[qW,WW,HW].concat(v(t))}}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Zi(qW,2),Zi(WW,2))},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({}),e}(),D3=function(e,t){return function(e,t){return new Array(t+1).join("0")}(0,t-e.toString().length)+e},N3=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=QV(this.action),n=function(e){return D3(e.getHours(),2)+":"+D3(e.getMinutes(),2)+":"+D3(e.getSeconds(),2)+"."+D3(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}(),L3=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}(),j3=new Ri("NGXS_LOGGER_PLUGIN_OPTIONS"),F3=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 L3(this._options),this._store=this._store||this._injector.get(Pz);var i=new N3(t,this._store,this._logWriter);return i.dispatched(e),n(e,t).pipe(mv(function(e){i.completed(e)}),Bb(function(e){throw i.errored(e),e}))}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Zi(j3),Zi(ss))},e.\u0275prov=$e({token:e,factory:e.\u0275fac}),e}(),B3=new Ri("LOGGER_USER_OPTIONS");function V3(e){return Object.assign({},{logger:console,collapsed:!1,disabled:!1,filter:function(){return!0}},e)}var z3=function(){var e=function(){function e(){m(this,e)}return b(e,null,[{key:"forRoot",value:function(t){return{ngModule:e,providers:[{provide:UV,useClass:F3,multi:!0},{provide:B3,useValue:t},{provide:j3,useFactory:V3,deps:[B3]}]}}}]),e}();return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({}),e}();function U3(e,t){return e>=0&&e=t?t:e+t<0?0:e+t}function H3(e,t){if(1&e&&(As(0,"span"),Cu(1),Ms()),2&e){var n=t.$implicit;lu(n.styles),du(n.classes),Yo(1),Ou(" ",n.text,"\n")}}var G3=function(){var e=function(){function e(){m(this,e),this.clsName="ccf-decorated-text",this.segments=[]}return b(e,[{key:"ngOnChanges",value:function(e){("text"in e||"decorations"in e)&&(this.segments=this.createSegments())}},{key:"createSegments",value:function(){var e=this.text;if(!e)return[this.makeUndecoratedSegment(e)];var t=this.getNormalizedDecorations();if(0===t.length)return[this.makeUndecoratedSegment(e)];var n=this.createStackOps(t),i=[],r=[],o=0;0===n[0].index&&(r=this.updateStack(r,n.shift()));var a,s=_(n);try{for(s.s();!(a=s.n()).done;){var u=a.value;i.push(this.makeDecoratedSegment(e.slice(o,u.index),r)),o=u.index,r=this.updateStack(r,u)}}catch(c){s.e(c)}finally{s.f()}return o!==e.length&&i.push(this.makeDecoratedSegment(e.slice(o),r)),i}},{key:"createStackOps",value:function(e){var t,n={},i=function(e){var t;return null!==(t=n[e])&&void 0!==t?t:n[e]={index:e,added:[],removed:[]}},r=_(e);try{for(r.s();!(t=r.n()).done;){var o=t.value;i(o.start).added.push(o),i(o.end).removed.push(o)}}catch(a){r.e(a)}finally{r.f()}return Object.entries(n).sort(function(e,t){return+e[0]-+t[0]}).map(function(e){return e[1]})}},{key:"updateStack",value:function(e,t){return e.filter(function(e){return!t.removed.includes(e)}).concat(t.added)}},{key:"getNormalizedDecorations",value:function(){var e=this.decorations,t=void 0===e?[]:e,n=this.text.length;return t.map(function(e){return function(e,t){var n,i,r,o;return{start:U3(null!==(n=e.start)&&void 0!==n?n:0,t),end:U3(null!==(i=e.end)&&void 0!==i?i:t,t),classes:null!==(r=e.classes)&&void 0!==r?r:[],styles:null!==(o=e.styles)&&void 0!==o?o:{}}}(e,n)}).filter(function(e){return e.startt?e[0]:void 0,max:e[1]1&&void 0!==arguments[1]?arguments[1]:Date.now;return+t()>+new Date(e)}}]),e}();m5.\u0275fac=function(e){return new(e||m5)(Zi(FG),Zi(yq),Zi(f5),Zi(v5),Zi(h_))},m5.\u0275prov=$e({token:m5,factory:m5.\u0275fac}),Mw([jz(a5)],m5.prototype,"learnMore",null),Mw([jz(s5)],m5.prototype,"open",null),Mw([jz(u5)],m5.prototype,"close",null),m5=p5=Mw([Fz({name:"callToAction",defaults:{title:"New to the Exploration User Interface",message:"Spatial Search has arrived!",callToAction:"Learn More",imageUrl:"assets/images/spatial_search.gif",expirationDate:"Dec 1, 2022",popupShown:!1}})],m5);var y5=function(){function e(){m(this,e)}return b(e,null,[{key:"title",value:function(e){return e.title}},{key:"message",value:function(e){return e.message}},{key:"callToAction",value:function(e){return e.callToAction}},{key:"imageUrl",value:function(e){return e.imageUrl}},{key:"expirationDate",value:function(e){return e.expirationDate}},{key:"popupShown",value:function(e){return e.popupShown}}]),e}();Mw([Vz([m5])],y5,"title",null),Mw([Vz([m5])],y5,"message",null),Mw([Vz([m5])],y5,"callToAction",null),Mw([Vz([m5])],y5,"imageUrl",null),Mw([Vz([m5])],y5,"expirationDate",null),Mw([Vz([m5])],y5,"popupShown",null);var b5=function(){var e=function(){function e(){m(this,e),this.clsName="ccf-call-to-action",this.callToActionClicked=new ol,this.closeClicked=new ol}return b(e,[{key:"close",value:function(){this.closeClicked.emit()}},{key:"onDialogButtonClick",value:function(){this.callToActionClicked.emit()}}]),e}();return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=Ot({type:e,selectors:[["ccf-call-to-action"]],hostVars:2,hostBindings:function(e,t){2&e&&du(t.clsName)},inputs:{infoTitle:"infoTitle",imageUrl:"imageUrl",message:"message",callToAction:"callToAction"},outputs:{callToActionClicked:"callToActionClicked",closeClicked:"closeClicked"},decls:13,vars:4,consts:[[1,"rui-about","wrapper"],[1,"container"],[1,"content"],[1,"first-row"],["mat-dialog-title","",1,"title"],[1,"cta-mat-icon","material-icons","close-icon",3,"click"],["mat-card-sm-image","","alt","preview","layout-fill","",1,"cta-image",3,"src"],[1,"mat-typography","dialog-content"],[1,"message"],["mat-button","",1,"mat-button",3,"text","click"]],template:function(e,t){1&e&&(As(0,"div",0),As(1,"div",1),As(2,"div",2),As(3,"div",3),As(4,"p",4),Cu(5),Ms(),As(6,"mat-icon",5),Vs("click",function(){return t.close()}),Cu(7,"clear"),Ms(),Ms(),Is(8,"img",6),As(9,"mat-dialog-content",7),As(10,"div",8),Cu(11),Ms(),As(12,"a",9),Vs("click",function(){return t.onDialogButtonClick()}),Ms(),Ms(),Ms(),Ms(),Ms()),2&e&&(Yo(5),Eu(t.infoTitle),Yo(3),Ts("src",t.imageUrl,Xr),Yo(3),Ou(" ",t.message,""),Yo(1),Ts("text",t.callToAction))},directives:[VG,B_,IW,zG],styles:["[_nghost-%COMP%] .content[_ngcontent-%COMP%]{display:block;align-content:center;padding-left:1.6rem;padding-right:1.6rem;border-radius:.25rem}[_nghost-%COMP%] .info-button-wrapper[_ngcontent-%COMP%]{border-radius:.25rem;padding:.6rem;transition:.6s}[_nghost-%COMP%] .info-button-wrapper[_ngcontent-%COMP%] .ccf-info-button[_ngcontent-%COMP%]{cursor:pointer;transition:color .6s;font-size:1.2rem;vertical-align:sub}[_nghost-%COMP%] .first-row[_ngcontent-%COMP%]{display:flex;width:100%;line-height:.9rem}[_nghost-%COMP%] .first-row[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{padding-right:7rem;padding-left:.2rem;font-size:.875rem;padding-top:.75rem}[_nghost-%COMP%] .first-row[_ngcontent-%COMP%] .cta-mat-icon[_ngcontent-%COMP%]{height:30%;line-height:3.4rem}[_nghost-%COMP%] .message[_ngcontent-%COMP%]{padding:.5rem}[_nghost-%COMP%] .cta-image[_ngcontent-%COMP%]{align-self:center;-o-object-fit:cover;object-fit:cover;width:100%;border-radius:.25rem}[_nghost-%COMP%] .mat-button[_ngcontent-%COMP%]{background-color:#444a65;font-size:.75rem;position:relative;margin-bottom:1rem;width:100%;height:2rem;color:#fff}"],changeDetection:0}),e}(),_5=function e(){m(this,e),this.close=function(){return new u5},this.learnMore=function(){return new a5}};_5.\u0275fac=function(e){return new(e||_5)},_5.\u0275cmp=Ot({type:_5,selectors:[["ccf-call-to-action-behavior"]],decls:5,vars:12,consts:[[3,"infoTitle","message","callToAction","imageUrl","callToActionClicked","closeClicked"]],template:function(e,t){1&e&&(As(0,"ccf-call-to-action",0),Vs("callToActionClicked",function(){return t.learnMore()})("closeClicked",function(){return t.close()}),Jc(1,"async"),Jc(2,"async"),Jc(3,"async"),Jc(4,"async"),Ms()),2&e&&Ts("infoTitle",el(1,4,t.title$))("message",el(2,6,t.message$))("callToAction",el(3,8,t.callToAction$))("imageUrl",el(4,10,t.imageUrl$))},directives:[b5],pipes:[sd],styles:[""],changeDetection:0}),Mw([Bz(y5.title)],_5.prototype,"title$",void 0),Mw([Bz(y5.message)],_5.prototype,"message$",void 0),Mw([Bz(y5.callToAction)],_5.prototype,"callToAction$",void 0),Mw([Bz(y5.imageUrl)],_5.prototype,"imageUrl$",void 0),Mw([TK()],_5.prototype,"close",void 0),Mw([TK()],_5.prototype,"learnMore",void 0);var w5=[{name:"bladder",namespace:"app",url:"assets/icons/organs/ico-organs-bladder.svg"},{name:"blood",namespace:"app",url:"assets/icons/organs/ico-organs-blood.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:"eye",namespace:"app",url:"assets/icons/organs/ico-organs-eye.svg"},{name:"fallopian-tube-left",namespace:"app",url:"assets/icons/organs/ico-organs-fallopian-tube-left.svg"},{name:"fallopian-tube-right",namespace:"app",url:"assets/icons/organs/ico-organs-fallopian-tube-right.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-right",namespace:"app",url:"assets/icons/organs/ico-organs-kidney-right.svg"},{name:"kidney",namespace:"app",url:"assets/icons/organs/ico-organs-kidney.svg"},{name:"knee",namespace:"app",url:"assets/icons/organs/ico-organs-knee.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-right",namespace:"app",url:"assets/icons/organs/ico-organs-lung-right.svg"},{name:"lung",namespace:"app",url:"assets/icons/organs/ico-organs-lung.svg"},{name:"lymph-nodes",namespace:"app",url:"assets/icons/organs/ico-organs-lymph-nodes.svg"},{name:"mammary-gland",namespace:"app",url:"assets/icons/organs/ico-organs-breast.svg"},{name:"neuron",namespace:"app",url:"assets/icons/organs/ico-organs-neuron.svg"},{name:"ovaries",namespace:"app",url:"assets/icons/organs/ico-organs-ovaries.svg"},{name:"ovary-left",namespace:"app",url:"assets/icons/organs/ico-organs-ovary-left.svg"},{name:"ovary-right",namespace:"app",url:"assets/icons/organs/ico-organs-ovary-right.svg"},{name:"pancreas",namespace:"app",url:"assets/icons/organs/ico-organs-pancreas.svg"},{name:"pelvis-f",namespace:"app",url:"assets/icons/organs/ico-organs-pelvis-f.svg"},{name:"placenta",namespace:"app",url:"assets/icons/organs/ico-organs-placenta.svg"},{name:"prostate",namespace:"app",url:"assets/icons/organs/ico-organs-prostate.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:"spinal-cord",namespace:"app",url:"assets/icons/organs/ico-organs-spinal-cord.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:"ureter-left",namespace:"app",url:"assets/icons/organs/ico-organs-ureter-left.svg"},{name:"ureter-right",namespace:"app",url:"assets/icons/organs/ico-organs-ureter-right.svg"},{name:"uterus",namespace:"app",url:"assets/icons/organs/ico-organs-uterus.svg"},{name:"vasculature-thick",namespace:"app",url:"assets/icons/organs/ico-organs-vasculature-thick.svg"},{name:"vasculature-thin",namespace:"app",url:"assets/icons/organs/ico-organs-vasculature-thin.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"}],k5=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=_(w5);try{for(a.s();!(o=a.n()).done;){var s=o.value,u=s.name,c=s.namespace,l=s.url,h=s.html,d={name:u,namespace:c,url:l&&i.bypassSecurityTrustResourceUrl(l),html:h&&i.bypassSecurityTrustHtml(h)};r.registerIconImpl(d)}}catch(f){a.e(f)}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}(hq);k5.\u0275fac=function(e){return new(e||k5)(Zi(A_,8),Zi(Vd))},k5.\u0275prov=$e({token:k5,factory:k5.\u0275fac}),Mw([sq()],k5.prototype,"registerIcon",null),k5=Mw([cq(),Fz({name:"iconRegistry"})],k5);var x5=[T$,LQ,k5,jQ,EQ,BQ,m5,HJ,MQ],S5=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({imports:[[R3.forRoot(),Lz.forRoot(x5,{developmentMode:!pQ.production,selectorOptions:{injectContainerState:!1}}),PK.forRoot(),z3.forRoot({disabled:pQ.production})]]}),e}(),C5=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)(Zi(e,12))},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({providers:[{provide:N$,useExisting:M3}],imports:[[S_,Eq.forRoot({gaToken:pQ.googleAnalyticsToken,appName:"eui"}),P$,Fq.forRoot(function(){return new Lq({basePath:pQ.dbOptions.remoteApiEndpoint})}),P3,S5,I3],P3]}),e}(),E5=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({imports:[[cd,n$]]}),e}(),O5=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({imports:[[cd,DH,UZ]]}),e}(),T5=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({imports:[[cd,cv,yp,DH,UZ,NJ]]}),e}(),P5=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({imports:[[cd,Y_,V_]]}),e}(),A5=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({imports:[[cd,Y_,V_,E5,O5,T5,oQ,P5]]}),e}(),M5=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({imports:[[cd,V_,A5]]}),e}(),I5=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({imports:[[cd,JU,eH,JH,DH,uG,V_]]}),e}(),R5=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({imports:[[cd,Y_,V_,Aw,Y0,y$]]}),e}(),D5=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({imports:[[cd,I5,R5]]}),e}(),N5=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({imports:[[cd,I5,R5,D5],I5,R5,D5]}),e}();function L5(){return(L5=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=k1();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=V1(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=V1(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),W1(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))}},F5={name:"navigation",params:{navigation:{nextEl:null,prevEl:null,hideOnClick:!1,disabledClass:"swiper-button-disabled",hiddenClass:"swiper-button-hidden",lockClass:"swiper-button-lock"}},create:function(){q1(this,{navigation:L5({},j5)})},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&&!V1(o).is(r)&&!V1(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)}}}},B5=function(){var e=function e(){m(this,e),d2.use([F5])};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({imports:[[cd,Y_,V_,Y2]]}),e}(),V5=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({imports:[[cd]]}),e}(),z5=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({imports:[[cd,n$,V_,B5,V5]]}),e}(),U5=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({imports:[[cd,up,z5]]}),e}(),H5=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({providers:[{provide:ZQ,useValue:QQ}],imports:[[Gd,Zy,V_]]}),e}(),G5=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({imports:[[cd,KQ]]}),e}(),W5=function(){var e=function e(){m(this,e)};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({imports:[[cd,Y_,V_,KQ]]}),e}(),q5=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(Ku).resolveComponentFactory(e).inputs}(e,t.injector),i=t.strategyFactory||new dv(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}(pv);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}(T3,{injector:this.injector});customElements.define("ccf-eui",e)}}]),e}();return e.\u0275fac=function(t){return new(t||e)(Zi(ss))},e.\u0275mod=Mt({type:e}),e.\u0275inj=Qe({providers:[{provide:uQ,useValue:"hubmap-theme-light"},{provide:Hp,useExisting:sQ}],imports:[[Zy,Gd,C5,H5,M5,N5,V_,T5,U5,G5,o$,g$,E$,Aw,W5,R$,mw,P5]]}),e}();pQ.production&&function(){if(oh)throw new Error("Cannot enable prod mode after platform setup.");rh=!1}(),Ud().bootstrapModule(q5).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},88509:function(e,t,n){"use strict";e.exports=n.p+"7693192ac33f7744a3ca.ts"},9521:function(){},49125:function(){},75307:function(){}},function(e){e(e.s=51316)}])}(); \ No newline at end of file diff --git a/organ-info/index.html b/organ-info/index.html index df90a8890..63178bf10 100644 --- a/organ-info/index.html +++ b/organ-info/index.html @@ -4,7 +4,7 @@ - + diff --git a/organ-info/main.js b/organ-info/main.js index 5e1a2362d..8e9b365bf 100644 --- a/organ-info/main.js +++ b/organ-info/main.js @@ -1 +1 @@ -var JFe=Object.defineProperty,e2e=Object.defineProperties,t2e=Object.getOwnPropertyDescriptors,S1=Object.getOwnPropertySymbols,Oq=Object.prototype.hasOwnProperty,Rq=Object.prototype.propertyIsEnumerable,Er=Math.pow,Pq=(Ut,it,et)=>it in Ut?JFe(Ut,it,{enumerable:!0,configurable:!0,writable:!0,value:et}):Ut[it]=et,ot=(Ut,it)=>{for(var et in it||(it={}))Oq.call(it,et)&&Pq(Ut,et,it[et]);if(S1)for(var et of S1(it))Rq.call(it,et)&&Pq(Ut,et,it[et]);return Ut},Sn=(Ut,it)=>e2e(Ut,t2e(it)),Nq=(Ut,it)=>{var et={};for(var yt in Ut)Oq.call(Ut,yt)&&it.indexOf(yt)<0&&(et[yt]=Ut[yt]);if(null!=Ut&&S1)for(var yt of S1(Ut))it.indexOf(yt)<0&&Rq.call(Ut,yt)&&(et[yt]=Ut[yt]);return et};(self.webpackChunkccf_ui=self.webpackChunkccf_ui||[]).push([[179],{1440:(Ut,it,et)=>{var yt=et(1052).default;Ut.exports=function Y(Se,he,W){function j(H,v){if(!he[H]){if(!Se[H]){if(k)return k(H,!0);var R=new Error("Cannot find module '"+H+"'");throw R.code="MODULE_NOT_FOUND",R}var T=he[H]={exports:{}};Se[H][0].call(T.exports,function(b){return j(Se[H][1][b]||b)},T,T.exports,Y,Se,he,W)}return he[H].exports}for(var k=void 0,Q=0;Q0&&G[G.length-1])&&(6===_t[0]||2===_t[0])){qe=0;continue}if(3===_t[0]&&(!G||_t[1]>G[0]&&_t[1]0?ue-4:ue;for($=0;$>16&255,O[K++]=P>>8&255,O[K++]=255&P;return 2===I&&(P=j[z.charCodeAt($)]<<2|j[z.charCodeAt($+1)]>>4,O[K++]=255&P),1===I&&(P=j[z.charCodeAt($)]<<10|j[z.charCodeAt($+1)]<<4|j[z.charCodeAt($+2)]>>2,O[K++]=P>>8&255,O[K++]=255&P),O},he.fromByteArray=function(z){for(var P,X=z.length,ue=X%3,I=[],O=16383,K=0,E=X-ue;KE?E:K+O));return 1===ue?I.push(W[(P=z[X-1])>>2]+W[P<<4&63]+"=="):2===ue&&I.push(W[(P=(z[X-2]<<8)+z[X-1])>>10]+W[P>>4&63]+W[P<<2&63]+"="),I.join("")};for(var W=[],j=[],k="undefined"!=typeof Uint8Array?Uint8Array:Array,Q="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",H=0,v=Q.length;H0)throw new Error("Invalid string. Length must be a multiple of 4");var X=z.indexOf("=");return-1===X&&(X=P),[X,X===P?0:4-X%4]}function y(z){return W[z>>18&63]+W[z>>12&63]+W[z>>6&63]+W[63&z]}function S(z,P,X){for(var I=[],O=P;O>5==6?2:I>>4==14?3:I>>3==30?4:I>>6==2?-1:-2}function T(I){var O=this.lastTotal-this.lastNeed,K=function(I,O,K){if(128!=(192&O[0]))return I.lastNeed=0,"\ufffd";if(I.lastNeed>1&&O.length>1){if(128!=(192&O[1]))return I.lastNeed=1,"\ufffd";if(I.lastNeed>2&&O.length>2&&128!=(192&O[2]))return I.lastNeed=2,"\ufffd"}}(this,I);return void 0!==K?K:this.lastNeed<=I.length?(I.copy(this.lastChar,O,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(I.copy(this.lastChar,O,0,I.length),void(this.lastNeed-=I.length))}function S(I,O){if((I.length-O)%2==0){var K=I.toString("utf16le",O);if(K){var E=K.charCodeAt(K.length-1);if(E>=55296&&E<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=I[I.length-2],this.lastChar[1]=I[I.length-1],K.slice(0,-1)}return K}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=I[I.length-1],I.toString("utf16le",O,I.length-1)}function A(I){var O=I&&I.length?this.write(I):"";return this.lastNeed?O+this.lastChar.toString("utf16le",0,this.lastTotal-this.lastNeed):O}function z(I,O){var K=(I.length-O)%3;return 0===K?I.toString("base64",O):(this.lastNeed=3-K,this.lastTotal=3,1===K?this.lastChar[0]=I[I.length-1]:(this.lastChar[0]=I[I.length-2],this.lastChar[1]=I[I.length-1]),I.toString("base64",O,I.length-K))}function P(I){var O=I&&I.length?this.write(I):"";return this.lastNeed?O+this.lastChar.toString("base64",0,3-this.lastNeed):O}function X(I){return I.toString(this.encoding)}function ue(I){return I&&I.length?this.write(I):""}he.StringDecoder=H,H.prototype.write=function(I){if(0===I.length)return"";var O,K;if(this.lastNeed){if(void 0===(O=this.fillLast(I)))return"";K=this.lastNeed,this.lastNeed=0}else K=0;return K=0?($>0&&(I.lastNeed=$-1),$):--E=0?($>0&&(I.lastNeed=$-2),$):--E=0?($>0&&(2===$?$=0:I.lastNeed=$-3),$):0}(this,I,O);if(!this.lastNeed)return I.toString("utf8",O);this.lastTotal=K;var E=I.length-(K-this.lastNeed);return I.copy(this.lastChar,0,E),I.toString("utf8",O,E)},H.prototype.fillLast=function(I){if(this.lastNeed<=I.length)return I.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);I.copy(this.lastChar,this.lastTotal-this.lastNeed,0,I.length),this.lastNeed-=I.length}},{"safe-buffer":4}],6:[function(Y,Se,he){(function(W){(function(){"use strict";var j=Y("base64-js"),k=Y("ieee754");he.Buffer=C,he.SlowBuffer=function(B){return+B!=B&&(B=0),C.alloc(+B)},he.INSPECT_MAX_BYTES=50;var Q=2147483647;function v(B){if(B>Q)throw new RangeError('The value "'+B+'" is invalid for option "size"');var N=new Uint8Array(B);return N.__proto__=C.prototype,N}function C(B,N,V){if("number"==typeof B){if("string"==typeof N)throw new TypeError('The "string" argument must be of type string. Received type number');return y(B)}return R(B,N,V)}function R(B,N,V){if("string"==typeof B)return function(B,N){if(("string"!=typeof N||""===N)&&(N="utf8"),!C.isEncoding(N))throw new TypeError("Unknown encoding: "+N);var V=0|I(B,N),Re=v(V),Ze=Re.write(B,N);return Ze!==V&&(Re=Re.slice(0,Ze)),Re}(B,N);if(ArrayBuffer.isView(B))return A(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,N,V){if(N<0||B.byteLength=Q)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Q.toString(16)+" bytes");return 0|B}function I(B,N){if(C.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 V=B.length,Re=arguments.length>2&&!0===arguments[2];if(!Re&&0===V)return 0;for(var Ze=!1;;)switch(N){case"ascii":case"latin1":case"binary":return V;case"utf8":case"utf-8":return G(B).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*V;case"hex":return V>>>1;case"base64":return je(B).length;default:if(Ze)return Re?-1:G(B).length;N=(""+N).toLowerCase(),Ze=!0}}function O(B,N,V){var Re=!1;if((void 0===N||N<0)&&(N=0),N>this.length||((void 0===V||V>this.length)&&(V=this.length),V<=0)||(V>>>=0)<=(N>>>=0))return"";for(B||(B="utf8");;)switch(B){case"hex":return tt(this,N,V);case"utf8":case"utf-8":return ye(this,N,V);case"ascii":return st(this,N,V);case"latin1":case"binary":return Qe(this,N,V);case"base64":return ne(this,N,V);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Xe(this,N,V);default:if(Re)throw new TypeError("Unknown encoding: "+B);B=(B+"").toLowerCase(),Re=!0}}function K(B,N,V){var Re=B[N];B[N]=B[V],B[V]=Re}function E(B,N,V,Re,Ze){if(0===B.length)return-1;if("string"==typeof V?(Re=V,V=0):V>2147483647?V=2147483647:V<-2147483648&&(V=-2147483648),we(V=+V)&&(V=Ze?0:B.length-1),V<0&&(V=B.length+V),V>=B.length){if(Ze)return-1;V=B.length-1}else if(V<0){if(!Ze)return-1;V=0}if("string"==typeof N&&(N=C.from(N,Re)),C.isBuffer(N))return 0===N.length?-1:$(B,N,V,Re,Ze);if("number"==typeof N)return N&=255,"function"==typeof Uint8Array.prototype.indexOf?Ze?Uint8Array.prototype.indexOf.call(B,N,V):Uint8Array.prototype.lastIndexOf.call(B,N,V):$(B,[N],V,Re,Ze);throw new TypeError("val must be string, number or Buffer")}function $(B,N,V,Re,Ze){var Yn,Tt=1,kt=B.length,In=N.length;if(void 0!==Re&&("ucs2"===(Re=String(Re).toLowerCase())||"ucs-2"===Re||"utf16le"===Re||"utf-16le"===Re)){if(B.length<2||N.length<2)return-1;Tt=2,kt/=2,In/=2,V/=2}function Nn(Ls,fs){return 1===Tt?Ls[fs]:Ls.readUInt16BE(fs*Tt)}if(Ze){var Mi=-1;for(Yn=V;Ynkt&&(V=kt-In),Yn=V;Yn>=0;Yn--){for(var xi=!0,Xr=0;XrZe&&(Re=Ze):Re=Ze;var Tt=N.length;Re>Tt/2&&(Re=Tt/2);for(var kt=0;kt>8,Tt.push(V%256),Tt.push(Re);return Tt}(N,B.length-V),B,V,Re)}function ne(B,N,V){return j.fromByteArray(0===N&&V===B.length?B:B.slice(N,V))}function ye(B,N,V){V=Math.min(B.length,V);for(var Re=[],Ze=N;Ze239?4:Tt>223?3:Tt>191?2:1;if(Ze+In<=V)switch(In){case 1:Tt<128&&(kt=Tt);break;case 2:128==(192&(Nn=B[Ze+1]))&&(xi=(31&Tt)<<6|63&Nn)>127&&(kt=xi);break;case 3:Yn=B[Ze+2],128==(192&(Nn=B[Ze+1]))&&128==(192&Yn)&&(xi=(15&Tt)<<12|(63&Nn)<<6|63&Yn)>2047&&(xi<55296||xi>57343)&&(kt=xi);break;case 4:Yn=B[Ze+2],Mi=B[Ze+3],128==(192&(Nn=B[Ze+1]))&&128==(192&Yn)&&128==(192&Mi)&&(xi=(15&Tt)<<18|(63&Nn)<<12|(63&Yn)<<6|63&Mi)>65535&&xi<1114112&&(kt=xi)}null===kt?(kt=65533,In=1):kt>65535&&(Re.push((kt-=65536)>>>10&1023|55296),kt=56320|1023&kt),Re.push(kt),Ze+=In}return function(B){var N=B.length;if(N<=4096)return String.fromCharCode.apply(String,B);for(var V="",Re=0;ReV&&(N+=" ... "),""},C.prototype.compare=function(N,V,Re,Ze,Tt){if(pt(N,Uint8Array)&&(N=C.from(N,N.offset,N.byteLength)),!C.isBuffer(N))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof N);if(void 0===V&&(V=0),void 0===Re&&(Re=N?N.length:0),void 0===Ze&&(Ze=0),void 0===Tt&&(Tt=this.length),V<0||Re>N.length||Ze<0||Tt>this.length)throw new RangeError("out of range index");if(Ze>=Tt&&V>=Re)return 0;if(Ze>=Tt)return-1;if(V>=Re)return 1;if(this===N)return 0;for(var kt=(Tt>>>=0)-(Ze>>>=0),In=(Re>>>=0)-(V>>>=0),Nn=Math.min(kt,In),Yn=this.slice(Ze,Tt),Mi=N.slice(V,Re),xi=0;xi>>=0,isFinite(Re)?(Re>>>=0,void 0===Ze&&(Ze="utf8")):(Ze=Re,Re=void 0)}var Tt=this.length-V;if((void 0===Re||Re>Tt)&&(Re=Tt),N.length>0&&(Re<0||V<0)||V>this.length)throw new RangeError("Attempt to write outside buffer bounds");Ze||(Ze="utf8");for(var kt=!1;;)switch(Ze){case"hex":return Z(this,N,V,Re);case"utf8":case"utf-8":return ae(this,N,V,Re);case"ascii":return oe(this,N,V,Re);case"latin1":case"binary":return te(this,N,V,Re);case"base64":return Te(this,N,V,Re);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return me(this,N,V,Re);default:if(kt)throw new TypeError("Unknown encoding: "+Ze);Ze=(""+Ze).toLowerCase(),kt=!0}},C.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function st(B,N,V){var Re="";V=Math.min(B.length,V);for(var Ze=N;ZeRe)&&(V=Re);for(var Ze="",Tt=N;TtV)throw new RangeError("Trying to access beyond buffer length")}function Le(B,N,V,Re,Ze,Tt){if(!C.isBuffer(B))throw new TypeError('"buffer" argument must be a Buffer instance');if(N>Ze||NB.length)throw new RangeError("Index out of range")}function Ke(B,N,V,Re,Ze,Tt){if(V+Re>B.length)throw new RangeError("Index out of range");if(V<0)throw new RangeError("Index out of range")}function Me(B,N,V,Re,Ze){return N=+N,V>>>=0,Ze||Ke(B,0,V,4),k.write(B,N,V,Re,23,4),V+4}function Ue(B,N,V,Re,Ze){return N=+N,V>>>=0,Ze||Ke(B,0,V,8),k.write(B,N,V,Re,52,8),V+8}C.prototype.slice=function(N,V){var Re=this.length;(N=~~N)<0?(N+=Re)<0&&(N=0):N>Re&&(N=Re),(V=void 0===V?Re:~~V)<0?(V+=Re)<0&&(V=0):V>Re&&(V=Re),V>>=0,V>>>=0,Re||ze(N,V,this.length);for(var Ze=this[N],Tt=1,kt=0;++kt>>=0,V>>>=0,Re||ze(N,V,this.length);for(var Ze=this[N+--V],Tt=1;V>0&&(Tt*=256);)Ze+=this[N+--V]*Tt;return Ze},C.prototype.readUInt8=function(N,V){return N>>>=0,V||ze(N,1,this.length),this[N]},C.prototype.readUInt16LE=function(N,V){return N>>>=0,V||ze(N,2,this.length),this[N]|this[N+1]<<8},C.prototype.readUInt16BE=function(N,V){return N>>>=0,V||ze(N,2,this.length),this[N]<<8|this[N+1]},C.prototype.readUInt32LE=function(N,V){return N>>>=0,V||ze(N,4,this.length),(this[N]|this[N+1]<<8|this[N+2]<<16)+16777216*this[N+3]},C.prototype.readUInt32BE=function(N,V){return N>>>=0,V||ze(N,4,this.length),16777216*this[N]+(this[N+1]<<16|this[N+2]<<8|this[N+3])},C.prototype.readIntLE=function(N,V,Re){N>>>=0,V>>>=0,Re||ze(N,V,this.length);for(var Ze=this[N],Tt=1,kt=0;++kt=(Tt*=128)&&(Ze-=Math.pow(2,8*V)),Ze},C.prototype.readIntBE=function(N,V,Re){N>>>=0,V>>>=0,Re||ze(N,V,this.length);for(var Ze=V,Tt=1,kt=this[N+--Ze];Ze>0&&(Tt*=256);)kt+=this[N+--Ze]*Tt;return kt>=(Tt*=128)&&(kt-=Math.pow(2,8*V)),kt},C.prototype.readInt8=function(N,V){return N>>>=0,V||ze(N,1,this.length),128&this[N]?-1*(255-this[N]+1):this[N]},C.prototype.readInt16LE=function(N,V){N>>>=0,V||ze(N,2,this.length);var Re=this[N]|this[N+1]<<8;return 32768&Re?4294901760|Re:Re},C.prototype.readInt16BE=function(N,V){N>>>=0,V||ze(N,2,this.length);var Re=this[N+1]|this[N]<<8;return 32768&Re?4294901760|Re:Re},C.prototype.readInt32LE=function(N,V){return N>>>=0,V||ze(N,4,this.length),this[N]|this[N+1]<<8|this[N+2]<<16|this[N+3]<<24},C.prototype.readInt32BE=function(N,V){return N>>>=0,V||ze(N,4,this.length),this[N]<<24|this[N+1]<<16|this[N+2]<<8|this[N+3]},C.prototype.readFloatLE=function(N,V){return N>>>=0,V||ze(N,4,this.length),k.read(this,N,!0,23,4)},C.prototype.readFloatBE=function(N,V){return N>>>=0,V||ze(N,4,this.length),k.read(this,N,!1,23,4)},C.prototype.readDoubleLE=function(N,V){return N>>>=0,V||ze(N,8,this.length),k.read(this,N,!0,52,8)},C.prototype.readDoubleBE=function(N,V){return N>>>=0,V||ze(N,8,this.length),k.read(this,N,!1,52,8)},C.prototype.writeUIntLE=function(N,V,Re,Ze){N=+N,V>>>=0,Re>>>=0,Ze||Le(this,N,V,Re,Math.pow(2,8*Re)-1,0);var kt=1,In=0;for(this[V]=255&N;++In>>=0,Re>>>=0,Ze||Le(this,N,V,Re,Math.pow(2,8*Re)-1,0);var kt=Re-1,In=1;for(this[V+kt]=255&N;--kt>=0&&(In*=256);)this[V+kt]=N/In&255;return V+Re},C.prototype.writeUInt8=function(N,V,Re){return N=+N,V>>>=0,Re||Le(this,N,V,1,255,0),this[V]=255&N,V+1},C.prototype.writeUInt16LE=function(N,V,Re){return N=+N,V>>>=0,Re||Le(this,N,V,2,65535,0),this[V]=255&N,this[V+1]=N>>>8,V+2},C.prototype.writeUInt16BE=function(N,V,Re){return N=+N,V>>>=0,Re||Le(this,N,V,2,65535,0),this[V]=N>>>8,this[V+1]=255&N,V+2},C.prototype.writeUInt32LE=function(N,V,Re){return N=+N,V>>>=0,Re||Le(this,N,V,4,4294967295,0),this[V+3]=N>>>24,this[V+2]=N>>>16,this[V+1]=N>>>8,this[V]=255&N,V+4},C.prototype.writeUInt32BE=function(N,V,Re){return N=+N,V>>>=0,Re||Le(this,N,V,4,4294967295,0),this[V]=N>>>24,this[V+1]=N>>>16,this[V+2]=N>>>8,this[V+3]=255&N,V+4},C.prototype.writeIntLE=function(N,V,Re,Ze){if(N=+N,V>>>=0,!Ze){var Tt=Math.pow(2,8*Re-1);Le(this,N,V,Re,Tt-1,-Tt)}var kt=0,In=1,Nn=0;for(this[V]=255&N;++kt>0)-Nn&255;return V+Re},C.prototype.writeIntBE=function(N,V,Re,Ze){if(N=+N,V>>>=0,!Ze){var Tt=Math.pow(2,8*Re-1);Le(this,N,V,Re,Tt-1,-Tt)}var kt=Re-1,In=1,Nn=0;for(this[V+kt]=255&N;--kt>=0&&(In*=256);)N<0&&0===Nn&&0!==this[V+kt+1]&&(Nn=1),this[V+kt]=(N/In>>0)-Nn&255;return V+Re},C.prototype.writeInt8=function(N,V,Re){return N=+N,V>>>=0,Re||Le(this,N,V,1,127,-128),N<0&&(N=255+N+1),this[V]=255&N,V+1},C.prototype.writeInt16LE=function(N,V,Re){return N=+N,V>>>=0,Re||Le(this,N,V,2,32767,-32768),this[V]=255&N,this[V+1]=N>>>8,V+2},C.prototype.writeInt16BE=function(N,V,Re){return N=+N,V>>>=0,Re||Le(this,N,V,2,32767,-32768),this[V]=N>>>8,this[V+1]=255&N,V+2},C.prototype.writeInt32LE=function(N,V,Re){return N=+N,V>>>=0,Re||Le(this,N,V,4,2147483647,-2147483648),this[V]=255&N,this[V+1]=N>>>8,this[V+2]=N>>>16,this[V+3]=N>>>24,V+4},C.prototype.writeInt32BE=function(N,V,Re){return N=+N,V>>>=0,Re||Le(this,N,V,4,2147483647,-2147483648),N<0&&(N=4294967295+N+1),this[V]=N>>>24,this[V+1]=N>>>16,this[V+2]=N>>>8,this[V+3]=255&N,V+4},C.prototype.writeFloatLE=function(N,V,Re){return Me(this,N,V,!0,Re)},C.prototype.writeFloatBE=function(N,V,Re){return Me(this,N,V,!1,Re)},C.prototype.writeDoubleLE=function(N,V,Re){return Ue(this,N,V,!0,Re)},C.prototype.writeDoubleBE=function(N,V,Re){return Ue(this,N,V,!1,Re)},C.prototype.copy=function(N,V,Re,Ze){if(!C.isBuffer(N))throw new TypeError("argument should be a Buffer");if(Re||(Re=0),!Ze&&0!==Ze&&(Ze=this.length),V>=N.length&&(V=N.length),V||(V=0),Ze>0&&Ze=this.length)throw new RangeError("Index out of range");if(Ze<0)throw new RangeError("sourceEnd out of bounds");Ze>this.length&&(Ze=this.length),N.length-V=0;--kt)N[kt+V]=this[kt+Re];else Uint8Array.prototype.set.call(N,this.subarray(Re,Ze),V);return Tt},C.prototype.fill=function(N,V,Re,Ze){if("string"==typeof N){if("string"==typeof V?(Ze=V,V=0,Re=this.length):"string"==typeof Re&&(Ze=Re,Re=this.length),void 0!==Ze&&"string"!=typeof Ze)throw new TypeError("encoding must be a string");if("string"==typeof Ze&&!C.isEncoding(Ze))throw new TypeError("Unknown encoding: "+Ze);if(1===N.length){var Tt=N.charCodeAt(0);("utf8"===Ze&&Tt<128||"latin1"===Ze)&&(N=Tt)}}else"number"==typeof N&&(N&=255);if(V<0||this.length>>=0,Re=void 0===Re?this.length:Re>>>0,N||(N=0),"number"==typeof N)for(kt=V;kt55295&&V<57344){if(!Ze){if(V>56319){(N-=3)>-1&&Tt.push(239,191,189);continue}if(kt+1===Re){(N-=3)>-1&&Tt.push(239,191,189);continue}Ze=V;continue}if(V<56320){(N-=3)>-1&&Tt.push(239,191,189),Ze=V;continue}V=65536+(Ze-55296<<10|V-56320)}else Ze&&(N-=3)>-1&&Tt.push(239,191,189);if(Ze=null,V<128){if((N-=1)<0)break;Tt.push(V)}else if(V<2048){if((N-=2)<0)break;Tt.push(V>>6|192,63&V|128)}else if(V<65536){if((N-=3)<0)break;Tt.push(V>>12|224,V>>6&63|128,63&V|128)}else{if(!(V<1114112))throw new Error("Invalid code point");if((N-=4)<0)break;Tt.push(V>>18|240,V>>12&63|128,V>>6&63|128,63&V|128)}}return Tt}function je(B){return j.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 _t(B,N,V,Re){for(var Ze=0;Ze=N.length||Ze>=B.length);++Ze)N[Ze+V]=B[Ze];return Ze}function pt(B,N){return B instanceof N||null!=B&&null!=B.constructor&&null!=B.constructor.name&&B.constructor.name===N.name}function we(B){return B!=B}}).call(this)}).call(this,Y("buffer").Buffer)},{"base64-js":2,buffer:6,ieee754:9}],7:[function(Y,Se,he){"use strict";Se.exports=function W(j){return null===j||"object"!=typeof j||null!=j.toJSON?JSON.stringify(j):Array.isArray(j)?"["+j.reduce((k,Q,H)=>k+(0===H?"":",")+W(void 0===Q||"symbol"==typeof Q?null:Q),"")+"]":"{"+Object.keys(j).sort().reduce((k,Q,H)=>void 0===j[Q]||"symbol"==typeof j[Q]?k:k+(0===k.length?"":",")+W(Q)+":"+W(j[Q]),"")+"}"}},{}],8:[function(Y,Se,he){"use strict";var k,W="object"==typeof Reflect?Reflect:null,j=W&&"function"==typeof W.apply?W.apply:function($,Z,ae){return Function.prototype.apply.call($,Z,ae)};k=W&&"function"==typeof W.ownKeys?W.ownKeys:Object.getOwnPropertySymbols?function($){return Object.getOwnPropertyNames($).concat(Object.getOwnPropertySymbols($))}:function($){return Object.getOwnPropertyNames($)};var H=Number.isNaN||function($){return $!=$};function v(){v.init.call(this)}Se.exports=v,Se.exports.once=function(E,$){return new Promise(function(Z,ae){function oe(Te){E.removeListener($,te),ae(Te)}function te(){"function"==typeof E.removeListener&&E.removeListener("error",oe),Z([].slice.call(arguments))}K(E,$,te,{once:!0}),"error"!==$&&function(E,$,Z){"function"==typeof E.on&&K(E,"error",$,Z)}(E,oe,{once:!0})})},v.EventEmitter=v,v.prototype._events=void 0,v.prototype._eventsCount=0,v.prototype._maxListeners=void 0;var C=10;function R(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?v.defaultMaxListeners:E._maxListeners}function b(E,$,Z,ae){var oe,te,Te;if(R(Z),void 0===(te=E._events)?(te=E._events=Object.create(null),E._eventsCount=0):(void 0!==te.newListener&&(E.emit("newListener",$,Z.listener?Z.listener:Z),te=E._events),Te=te[$]),void 0===Te)Te=te[$]=Z,++E._eventsCount;else if("function"==typeof Te?Te=te[$]=ae?[Z,Te]:[Te,Z]:ae?Te.unshift(Z):Te.push(Z),(oe=T(E))>0&&Te.length>oe&&!Te.warned){Te.warned=!0;var me=new Error("Possible EventEmitter memory leak detected. "+Te.length+" "+String($)+" listeners added. Use emitter.setMaxListeners() to increase limit");me.name="MaxListenersExceededWarning",me.emitter=E,me.type=$,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 S(E,$,Z){var ae={fired:!1,wrapFn:void 0,target:E,type:$,listener:Z},oe=y.bind(ae);return oe.listener=Z,ae.wrapFn=oe,oe}function A(E,$,Z){var ae=E._events;if(void 0===ae)return[];var oe=ae[$];return void 0===oe?[]:"function"==typeof oe?Z?[oe.listener||oe]:[oe]:Z?function(E){for(var $=new Array(E.length),Z=0;Z<$.length;++Z)$[Z]=E[Z].listener||E[Z];return $}(oe):P(oe,oe.length)}function z(E){var $=this._events;if(void 0!==$){var Z=$[E];if("function"==typeof Z)return 1;if(void 0!==Z)return Z.length}return 0}function P(E,$){for(var Z=new Array($),ae=0;ae<$;++ae)Z[ae]=E[ae];return Z}function K(E,$,Z,ae){if("function"==typeof E.on)ae.once?E.once($,Z):E.on($,Z);else{if("function"!=typeof E.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof E);E.addEventListener($,function oe(te){ae.once&&E.removeEventListener($,oe),Z(te)})}}Object.defineProperty(v,"defaultMaxListeners",{enumerable:!0,get:function(){return C},set:function(E){if("number"!=typeof E||E<0||H(E))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+E+".");C=E}}),v.init=function(){(void 0===this._events||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},v.prototype.setMaxListeners=function($){if("number"!=typeof $||$<0||H($))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+$+".");return this._maxListeners=$,this},v.prototype.getMaxListeners=function(){return T(this)},v.prototype.emit=function($){for(var Z=[],ae=1;ae0&&(Te=Z[0]),Te instanceof Error)throw Te;var me=new Error("Unhandled error."+(Te?" ("+Te.message+")":""));throw me.context=Te,me}var ne=te[$];if(void 0===ne)return!1;if("function"==typeof ne)j(ne,this,Z);else{var ye=ne.length,Oe=P(ne,ye);for(ae=0;ae=0;Te--)if(ae[Te]===Z||ae[Te].listener===Z){me=ae[Te].listener,te=Te;break}if(te<0)return this;0===te?ae.shift():function(E,$){for(;$+1=0;oe--)this.removeListener($,Z[oe]);return this},v.prototype.listeners=function($){return A(this,$,!0)},v.prototype.rawListeners=function($){return A(this,$,!1)},v.listenerCount=function(E,$){return"function"==typeof E.listenerCount?E.listenerCount($):z.call(E,$)},v.prototype.listenerCount=z,v.prototype.eventNames=function(){return this._eventsCount>0?k(this._events):[]}},{}],9:[function(Y,Se,he){he.read=function(W,j,k,Q,H){var v,C,R=8*H-Q-1,T=(1<>1,y=-7,S=k?H-1:0,A=k?-1:1,z=W[j+S];for(S+=A,v=z&(1<<-y)-1,z>>=-y,y+=R;y>0;v=256*v+W[j+S],S+=A,y-=8);for(C=v&(1<<-y)-1,v>>=-y,y+=Q;y>0;C=256*C+W[j+S],S+=A,y-=8);if(0===v)v=1-b;else{if(v===T)return C?NaN:1/0*(z?-1:1);C+=Math.pow(2,Q),v-=b}return(z?-1:1)*C*Math.pow(2,v-Q)},he.write=function(W,j,k,Q,H,v){var C,R,T,b=8*v-H-1,y=(1<>1,A=23===H?Math.pow(2,-24)-Math.pow(2,-77):0,z=Q?0:v-1,P=Q?1:-1,X=j<0||0===j&&1/j<0?1:0;for(j=Math.abs(j),isNaN(j)||j===1/0?(R=isNaN(j)?1:0,C=y):(C=Math.floor(Math.log(j)/Math.LN2),j*(T=Math.pow(2,-C))<1&&(C--,T*=2),(j+=C+S>=1?A/T:A*Math.pow(2,1-S))*T>=2&&(C++,T/=2),C+S>=y?(R=0,C=y):C+S>=1?(R=(j*T-1)*Math.pow(2,H),C+=S):(R=j*Math.pow(2,S-1)*Math.pow(2,H),C=0));H>=8;W[k+z]=255&R,z+=P,R/=256,H-=8);for(C=C<0;W[k+z]=255&C,z+=P,C/=256,b-=8);W[k+z-P]|=128*X}},{}],10:[function(Y,Se,he){Se.exports="function"==typeof Object.create?function(j,k){k&&(j.super_=k,j.prototype=Object.create(k.prototype,{constructor:{value:j,enumerable:!1,writable:!0,configurable:!0}}))}:function(j,k){if(k){j.super_=k;var Q=function(){};Q.prototype=k.prototype,j.prototype=new Q,j.prototype.constructor=j}}},{}],11:[function(Y,Se,he){"use strict";const{isArray:W,isObject:j,isString:k}=Y("./types"),{asArray:Q}=Y("./util"),{prependBase:H}=Y("./url"),v=Y("./JsonLdError"),C=Y("./ResolvedContext");function T(y){throw new v("Invalid JSON-LD syntax; @context must be an object.","jsonld.SyntaxError",{code:"invalid local context",context:y})}function b({context:y,base:S}){if(!y)return;const A=y["@context"];if(k(A))y["@context"]=H(S,A);else if(W(A))for(let z=0;z10)throw new v("Maximum number of @context URLs exceeded.","jsonld.ContextUrlError",{code:"json-ld-1.0"===S.processingMode?"loading remote context failed":"context overflow",max:10});if(P.has(A))throw new v("Cyclical @context URLs detected.","jsonld.ContextUrlError",{code:"json-ld-1.0"===S.processingMode?"recursive context inclusion":"context overflow",url:A});let X,ue;P.add(A);try{ue=yield z(A),X=ue.document||null,k(X)&&(X=JSON.parse(X))}catch(I){throw new v("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:A,cause:I})}if(!j(X))throw new v("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:A});return X="@context"in X?{"@context":X["@context"]}:{"@context":{}},ue.contextUrl&&(W(X["@context"])||(X["@context"]=[X["@context"]]),X["@context"].push(ue.contextUrl)),{context:X,remoteDoc:ue}})()}}},{"./JsonLdError":12,"./ResolvedContext":16,"./types":30,"./url":31,"./util":32}],12:[function(Y,Se,he){"use strict";Se.exports=class extends Error{constructor(j="An unspecified JSON-LD error occurred.",k="jsonld.Error",Q={}){super(j),this.name=k,this.message=j,this.details=Q}}},{}],13:[function(Y,Se,he){"use strict";Se.exports=W=>{class j{toString(){return"[object JsonLdProcessor]"}}return Object.defineProperty(j,"prototype",{writable:!1,enumerable:!1}),Object.defineProperty(j.prototype,"constructor",{writable:!0,enumerable:!1,configurable:!0,value:j}),j.compact=function(k,Q){return arguments.length<2?Promise.reject(new TypeError("Could not compact, too few arguments.")):W.compact(k,Q)},j.expand=function(k){return arguments.length<1?Promise.reject(new TypeError("Could not expand, too few arguments.")):W.expand(k)},j.flatten=function(k){return arguments.length<1?Promise.reject(new TypeError("Could not flatten, too few arguments.")):W.flatten(k)},j}},{}],14:[function(Y,Se,he){"use strict";Se.exports=Y("rdf-canonize").NQuads},{"rdf-canonize":46}],15:[function(Y,Se,he){"use strict";Se.exports=class{constructor(){this._requests={}}wrapLoader(j){const k=this;return k._loader=j,function(){return k.add.apply(k,arguments)}}add(j){var k=this;return yt(function*(){let Q=k._requests[j];if(Q)return Promise.resolve(Q);Q=k._requests[j]=k._loader(j);try{return yield Q}finally{delete k._requests[j]}})()}}},{}],16:[function(Y,Se,he){"use strict";const W=Y("lru-cache");Se.exports=class{constructor({document:Q}){this.document=Q,this.cache=new W({max:10})}getProcessed(Q){return this.cache.get(Q)}setProcessed(Q,H){this.cache.set(Q,H)}}},{"lru-cache":33}],17:[function(Y,Se,he){"use strict";const W=Y("./JsonLdError"),{isArray:j,isObject:k,isString:Q,isUndefined:H}=Y("./types"),{isList:v,isValue:C,isGraph:R,isSimpleGraph:T,isSubjectReference:b}=Y("./graphTypes"),{expandIri:y,getContextValue:S,isKeyword:A,process:z,processingMode:P}=Y("./context"),{removeBase:X,prependBase:ue}=Y("./url"),{addValue:I,asArray:O,compareShortestLeast:K}=Y("./util"),E={};function Z(ae,oe,te){if("@nest"!==y(ae,oe,{vocab:!0},te))throw new W("JSON-LD compact error; nested property must have an @nest value resolving to @nest.","jsonld.SyntaxError",{code:"invalid @nest value"})}Se.exports=E,E.compact=function(){var ae=yt(function*({activeCtx:oe,activeProperty:te=null,element:Te,options:me={},compactionMap:ne=(()=>{})}){if(j(Te)){let Oe=[];for(let $e=0;$e1&&(tt=Array.from(tt).sort());const Xe=oe;for(const Le of tt){const Ke=E.compactIri({activeCtx:Xe,iri:Le,relativeTo:{vocab:!0}}),Me=S(st,Ke,"@context");H(Me)||(oe=yield z({activeCtx:oe,localCtx:Me,options:me,propagate:!1}))}const ze=Object.keys(Te).sort();for(const Le of ze){const Ke=Te[Le];if("@id"!==Le)if("@type"!==Le)if("@reverse"!==Le)if("@preserve"!==Le)if("@index"!==Le)if("@graph"!==Le&&"@list"!==Le&&"@included"!==Le&&A(Le)){const Me=E.compactIri({activeCtx:oe,iri:Le,relativeTo:{vocab:!0}});I($e,Me,Ke)}else{if(!j(Ke))throw new W("JSON-LD expansion error; expanded value must be an array.","jsonld.SyntaxError");if(0===Ke.length){const Me=E.compactIri({activeCtx:oe,iri:Le,value:Ke,relativeTo:{vocab:!0},reverse:Oe}),Ue=oe.mappings.has(Me)?oe.mappings.get(Me)["@nest"]:null;let qe=$e;Ue&&(Z(oe,Ue,me),k($e[Ue])||($e[Ue]={}),qe=$e[Ue]),I(qe,Me,Ke,{propertyIsArray:!0})}for(const Me of Ke){const Ue=E.compactIri({activeCtx:oe,iri:Le,value:Me,relativeTo:{vocab:!0},reverse:Oe}),qe=oe.mappings.has(Ue)?oe.mappings.get(Ue)["@nest"]:null;let ke=$e;qe&&(Z(oe,qe,me),k($e[qe])||($e[qe]={}),ke=$e[qe]);const q=S(oe,Ue,"@container")||[],G=R(Me),pe=v(Me);let de;pe?de=Me["@list"]:G&&(de=Me["@graph"]);let je=yield E.compact({activeCtx:oe,activeProperty:Ue,element:pe||G?de:Me,options:me,compactionMap:ne});if(pe){if(j(je)||(je=[je]),q.includes("@list")){I(ke,Ue,je,{valueIsArray:!0,allowDuplicate:!0});continue}je={[E.compactIri({activeCtx:oe,iri:"@list",relativeTo:{vocab:!0}})]:je},"@index"in Me&&(je[E.compactIri({activeCtx:oe,iri:"@index",relativeTo:{vocab:!0}})]=Me["@index"])}if(G)if(q.includes("@graph")&&(q.includes("@id")||q.includes("@index")&&T(Me))){let _t;ke.hasOwnProperty(Ue)?_t=ke[Ue]:ke[Ue]=_t={};const pt=(q.includes("@id")?Me["@id"]:Me["@index"])||E.compactIri({activeCtx:oe,iri:"@none",relativeTo:{vocab:!0}});I(_t,pt,je,{propertyIsArray:!me.compactArrays||q.includes("@set")})}else q.includes("@graph")&&T(Me)?(j(je)&&je.length>1&&(je={"@included":je}),I(ke,Ue,je,{propertyIsArray:!me.compactArrays||q.includes("@set")})):(j(je)&&1===je.length&&me.compactArrays&&(je=je[0]),je={[E.compactIri({activeCtx:oe,iri:"@graph",relativeTo:{vocab:!0}})]:je},"@id"in Me&&(je[E.compactIri({activeCtx:oe,iri:"@id",relativeTo:{vocab:!0}})]=Me["@id"]),"@index"in Me&&(je[E.compactIri({activeCtx:oe,iri:"@index",relativeTo:{vocab:!0}})]=Me["@index"]),I(ke,Ue,je,{propertyIsArray:!me.compactArrays||q.includes("@set")}));else if(q.includes("@language")||q.includes("@index")||q.includes("@id")||q.includes("@type")){let _t,pt;if(ke.hasOwnProperty(Ue)?_t=ke[Ue]:ke[Ue]=_t={},q.includes("@language"))C(je)&&(je=je["@value"]),pt=Me["@language"];else if(q.includes("@index")){const we=S(oe,Ue,"@index")||"@index",B=E.compactIri({activeCtx:oe,iri:we,relativeTo:{vocab:!0}});if("@index"===we)pt=Me["@index"],delete je[B];else{let N;if([pt,...N]=O(je[we]||[]),Q(pt))switch(N.length){case 0:delete je[we];break;case 1:je[we]=N[0];break;default:je[we]=N}else pt=null}}else if(q.includes("@id")){const we=E.compactIri({activeCtx:oe,iri:"@id",relativeTo:{vocab:!0}});pt=je[we],delete je[we]}else if(q.includes("@type")){const we=E.compactIri({activeCtx:oe,iri:"@type",relativeTo:{vocab:!0}});let B;switch([pt,...B]=O(je[we]||[]),B.length){case 0:delete je[we];break;case 1:je[we]=B[0];break;default:je[we]=B}1===Object.keys(je).length&&"@id"in Me&&(je=yield E.compact({activeCtx:oe,activeProperty:Ue,element:{"@id":Me["@id"]},options:me,compactionMap:ne}))}pt||(pt=E.compactIri({activeCtx:oe,iri:"@none",relativeTo:{vocab:!0}})),I(_t,pt,je,{propertyIsArray:q.includes("@set")})}else{const _t=!me.compactArrays||q.includes("@set")||q.includes("@list")||j(je)&&0===je.length||"@list"===Le||"@graph"===Le;I(ke,Ue,je,{propertyIsArray:_t})}}}else{if((S(oe,te,"@container")||[]).includes("@index"))continue;const Ue=E.compactIri({activeCtx:oe,iri:Le,relativeTo:{vocab:!0}});I($e,Ue,Ke)}else{const Me=yield E.compact({activeCtx:oe,activeProperty:te,element:Ke,options:me,compactionMap:ne});j(Me)&&0===Me.length||I($e,Le,Me)}else{const Me=yield E.compact({activeCtx:oe,activeProperty:"@reverse",element:Ke,options:me,compactionMap:ne});for(const Ue in Me)if(oe.mappings.has(Ue)&&oe.mappings.get(Ue).reverse){const qe=Me[Ue],q=(S(oe,Ue,"@container")||[]).includes("@set")||!me.compactArrays;I($e,Ue,qe,{propertyIsArray:q}),delete Me[Ue]}if(Object.keys(Me).length>0){const Ue=E.compactIri({activeCtx:oe,iri:Le,relativeTo:{vocab:!0}});I($e,Ue,Me)}}else{let Me=O(Ke).map(G=>E.compactIri({activeCtx:st,iri:G,relativeTo:{vocab:!0}}));1===Me.length&&(Me=Me[0]);const Ue=E.compactIri({activeCtx:oe,iri:"@type",relativeTo:{vocab:!0}}),q=(S(oe,Ue,"@container")||[]).includes("@set")&&P(oe,1.1)||j(Me)&&0===Ke.length;I($e,Ue,Me,{propertyIsArray:q})}else{let Me=O(Ke).map(qe=>E.compactIri({activeCtx:oe,iri:qe,relativeTo:{vocab:!1},base:me.base}));1===Me.length&&(Me=Me[0]),$e[E.compactIri({activeCtx:oe,iri:"@id",relativeTo:{vocab:!0}})]=Me}}return $e}return Te});return function(oe){return ae.apply(this,arguments)}}(),E.compactIri=({activeCtx:ae,iri:oe,value:te=null,relativeTo:Te={vocab:!1},reverse:me=!1,base:ne=null})=>{if(null===oe)return oe;ae.isPropertyTermScoped&&ae.previousContext&&(ae=ae.previousContext);const ye=ae.getInverse();if(A(oe)&&oe in ye&&"@none"in ye[oe]&&"@type"in ye[oe]["@none"]&&"@none"in ye[oe]["@none"]["@type"])return ye[oe]["@none"]["@type"]["@none"];if(Te.vocab&&oe in ye){const tt=ae["@language"]||"@none",Xe=[];k(te)&&"@index"in te&&!("@graph"in te)&&Xe.push("@index","@index@set"),k(te)&&"@preserve"in te&&(te=te["@preserve"][0]),R(te)?("@index"in te&&Xe.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in te&&Xe.push("@graph@id","@graph@id@set"),Xe.push("@graph","@graph@set","@set"),"@index"in te||Xe.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in te||Xe.push("@graph@id","@graph@id@set")):k(te)&&!C(te)&&Xe.push("@id","@id@set","@type","@set@type");let ze="@language",Le="@null";if(me)ze="@type",Le="@reverse",Xe.push("@set");else if(v(te)){"@index"in te||Xe.push("@list");const Me=te["@list"];if(0===Me.length)ze="@any",Le="@none";else{let Ue=0===Me.length?tt:null,qe=null;for(let ke=0;kest.includes("_"));$e&&ye.push($e.replace(/^[^_]+_/,"_"))}ye.push("@none");const Oe=ae.inverse[oe];for(const $e of Te){if(!($e in Oe))continue;const st=Oe[$e][me];for(const Qe of ye)if(Qe in st)return st[Qe]}return null}(ae,oe,te,Xe,ze,Le);if(null!==Ke)return Ke}if(Te.vocab&&"@vocab"in ae){const tt=ae["@vocab"];if(0===oe.indexOf(tt)&&oe!==tt){const Xe=oe.substr(tt.length);if(!ae.mappings.has(Xe))return Xe}}let Oe=null;const $e=[];let st=ae.fastCurieMap;const Qe=oe.length-1;for(let tt=0;tt=0;--tt){const Xe=$e[tt],ze=Xe.terms;for(const Le of ze){const Ke=Le+":"+oe.substr(Xe.iri.length);ae.mappings.get(Le)._prefix&&(!ae.mappings.has(Ke)||null===te&&ae.mappings.get(Ke)["@id"]===oe)&&(null===Oe||K(Ke,Oe)<0)&&(Oe=Ke)}}if(null!==Oe)return Oe;for(const[tt,Xe]of ae.mappings)if(Xe&&Xe._prefix&&oe.startsWith(tt+":"))throw new W(`Absolute IRI "${oe}" confused with prefix "${tt}".`,"jsonld.SyntaxError",{code:"IRI confused with prefix",context:ae});return Te.vocab?oe:"@base"in ae?ae["@base"]?X(ue(ne,ae["@base"]),oe):oe:X(ne,oe)},E.compactValue=({activeCtx:ae,activeProperty:oe,value:te,options:Te})=>{if(C(te)){const Oe=S(ae,oe,"@type"),$e=S(ae,oe,"@language"),st=S(ae,oe,"@direction"),Qe=S(ae,oe,"@container")||[],tt="@index"in te&&!Qe.includes("@index");if(!tt&&"@none"!==Oe&&(te["@type"]===Oe||"@language"in te&&te["@language"]===$e&&"@direction"in te&&te["@direction"]===st||"@language"in te&&te["@language"]===$e||"@direction"in te&&te["@direction"]===st))return te["@value"];const Xe=Object.keys(te).length,ze=1===Xe||2===Xe&&"@index"in te&&!tt,Le="@language"in ae,Ke=Q(te["@value"]),Me=ae.mappings.has(oe)&&null===ae.mappings.get(oe)["@language"];if(ze&&"@none"!==Oe&&(!Le||!Ke||Me))return te["@value"];const Ue={};return tt&&(Ue[E.compactIri({activeCtx:ae,iri:"@index",relativeTo:{vocab:!0}})]=te["@index"]),"@type"in te?Ue[E.compactIri({activeCtx:ae,iri:"@type",relativeTo:{vocab:!0}})]=E.compactIri({activeCtx:ae,iri:te["@type"],relativeTo:{vocab:!0}}):"@language"in te&&(Ue[E.compactIri({activeCtx:ae,iri:"@language",relativeTo:{vocab:!0}})]=te["@language"]),"@direction"in te&&(Ue[E.compactIri({activeCtx:ae,iri:"@direction",relativeTo:{vocab:!0}})]=te["@direction"]),Ue[E.compactIri({activeCtx:ae,iri:"@value",relativeTo:{vocab:!0}})]=te["@value"],Ue}const me=y(ae,oe,{vocab:!0},Te),ne=S(ae,oe,"@type"),ye=E.compactIri({activeCtx:ae,iri:te["@id"],relativeTo:{vocab:"@vocab"===ne},base:Te.base});return"@id"===ne||"@vocab"===ne||"@graph"===me?ye:{[E.compactIri({activeCtx:ae,iri:"@id",relativeTo:{vocab:!0}})]:ye}}},{"./JsonLdError":12,"./context":19,"./graphTypes":25,"./types":30,"./url":31,"./util":32}],18:[function(Y,Se,he){"use strict";const W="http://www.w3.org/1999/02/22-rdf-syntax-ns#",j="http://www.w3.org/2001/XMLSchema#";Se.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:j,XSD_BOOLEAN:j+"boolean",XSD_DOUBLE:j+"double",XSD_INTEGER:j+"integer",XSD_STRING:j+"string"}},{}],19:[function(Y,Se,he){"use strict";const W=Y("./util"),j=Y("./JsonLdError"),{isArray:k,isObject:Q,isString:H,isUndefined:v}=Y("./types"),{isAbsolute:C,isRelative:R,prependBase:T}=Y("./url"),{asArray:b,compareShortestLeast:y}=Y("./util"),S=new Map,z=/^@[a-zA-Z]+$/,P={};function X(I,O,K,E,$,Z){if(null===O||!H(O)||P.isKeyword(O))return O;if(O.match(z))return null;if(E&&E.hasOwnProperty(O)&&!0!==$.get(O)&&P.createTermDefinition({activeCtx:I,localCtx:E,term:O,defined:$,options:Z}),(K=K||{}).vocab){const oe=I.mappings.get(O);if(null===oe)return null;if(Q(oe)&&"@id"in oe)return oe["@id"]}const ae=O.indexOf(":");if(ae>0){const oe=O.substr(0,ae),te=O.substr(ae+1);if("_"===oe||0===te.indexOf("//"))return O;E&&E.hasOwnProperty(oe)&&P.createTermDefinition({activeCtx:I,localCtx:E,term:oe,defined:$,options:Z});const Te=I.mappings.get(oe);if(Te&&Te._prefix)return Te["@id"]+te;if(C(O))return O}if(K.vocab&&"@vocab"in I)return I["@vocab"]+O;if(K.base&&"@base"in I){if(I["@base"])return T(T(Z.base,I["@base"]),O)}else if(K.base)return T(Z.base,O);return O}function ue(I,O){if(!I||"object"!=typeof I||!O||"object"!=typeof O)return I===O;const K=Array.isArray(I);if(K!==Array.isArray(O))return!1;if(K){if(I.length!==O.length)return!1;for(let Z=0;Z{if(E.has(K)){if(E.get(K))return;throw new j("Cyclical context definition detected.","jsonld.CyclicalContext",{code:"cyclic IRI mapping",context:O,term:K})}let ae;if(E.set(K,!1),O.hasOwnProperty(K)&&(ae=O[K]),"@type"===K&&Q(ae)&&"@set"===(ae["@container"]||"@set")&&P.processingMode(I,1.1)){const Oe=["@container","@id","@protected"],$e=Object.keys(ae);if(0===$e.length||$e.some(st=>!Oe.includes(st)))throw new j("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:O,term:K})}else{if(P.isKeyword(K))throw new j("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:O,term:K});if(K.match(z))return void console.warn('WARNING: terms beginning with "@" are reserved for future use and ignored',{term:K});if(""===K)throw new j("Invalid JSON-LD syntax; a term cannot be an empty string.","jsonld.SyntaxError",{code:"invalid term definition",context:O})}const oe=I.mappings.get(K);I.mappings.has(K)&&I.mappings.delete(K);let te=!1;if((H(ae)||null===ae)&&(te=!0,ae={"@id":ae}),!Q(ae))throw new j("Invalid JSON-LD syntax; @context term values must be strings or objects.","jsonld.SyntaxError",{code:"invalid term definition",context:O});const Te={};I.mappings.set(K,Te),Te.reverse=!1;const me=["@container","@id","@language","@reverse","@type"];P.processingMode(I,1.1)&&me.push("@context","@direction","@index","@nest","@prefix","@protected");for(const Oe in ae)if(!me.includes(Oe))throw new j("Invalid JSON-LD syntax; a term definition must not contain "+Oe,"jsonld.SyntaxError",{code:"invalid term definition",context:O});const ne=K.indexOf(":");if(Te._termHasColon=ne>0,"@reverse"in ae){if("@id"in ae)throw new j("Invalid JSON-LD syntax; a @reverse term definition must not contain @id.","jsonld.SyntaxError",{code:"invalid reverse property",context:O});if("@nest"in ae)throw new j("Invalid JSON-LD syntax; a @reverse term definition must not contain @nest.","jsonld.SyntaxError",{code:"invalid reverse property",context:O});const Oe=ae["@reverse"];if(!H(Oe))throw new j("Invalid JSON-LD syntax; a @context @reverse value must be a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:O});if(!P.isKeyword(Oe)&&Oe.match(z))return console.warn('WARNING: values beginning with "@" are reserved for future use and ignored',{reverse:Oe}),void(oe?I.mappings.set(K,oe):I.mappings.delete(K));const $e=X(I,Oe,{vocab:!0,base:!1},O,E,$);if(!C($e))throw new j("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:O});Te["@id"]=$e,Te.reverse=!0}else if("@id"in ae){let Oe=ae["@id"];if(Oe&&!H(Oe))throw new j("Invalid JSON-LD syntax; a @context @id value must be an array of strings or a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:O});if(null===Oe)Te["@id"]=null;else{if(!P.isKeyword(Oe)&&Oe.match(z))return console.warn('WARNING: values beginning with "@" are reserved for future use and ignored',{id:Oe}),void(oe?I.mappings.set(K,oe):I.mappings.delete(K));if(Oe!==K){if(Oe=X(I,Oe,{vocab:!0,base:!1},O,E,$),!C(Oe)&&!P.isKeyword(Oe))throw new j("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:O});if(K.match(/(?::[^:])|\//)&&X(I,K,{vocab:!0,base:!1},O,new Map(E).set(K,!0),$)!==Oe)throw new j("Invalid JSON-LD syntax; term in form of IRI must expand to definition.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:O});Te["@id"]=Oe,Te._prefix=te&&!Te._termHasColon&&Oe.match(/[:\/\?#\[\]@]$/)}}}if(!("@id"in Te))if(Te._termHasColon){const Oe=K.substr(0,ne);if(O.hasOwnProperty(Oe)&&P.createTermDefinition({activeCtx:I,localCtx:O,term:Oe,defined:E,options:$}),I.mappings.has(Oe)){const $e=K.substr(ne+1);Te["@id"]=I.mappings.get(Oe)["@id"]+$e}else Te["@id"]=K}else if("@type"===K)Te["@id"]=K;else{if(!("@vocab"in I))throw new j("Invalid JSON-LD syntax; @context terms must define an @id.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:O,term:K});Te["@id"]=I["@vocab"]+K}if((!0===ae["@protected"]||!0===E.get("@protected")&&!1!==ae["@protected"])&&(I.protected[K]=!0,Te.protected=!0),E.set(K,!0),"@type"in ae){let Oe=ae["@type"];if(!H(Oe))throw new j("Invalid JSON-LD syntax; an @context @type value must be a string.","jsonld.SyntaxError",{code:"invalid type mapping",context:O});if("@json"===Oe||"@none"===Oe){if(P.processingMode(I,1))throw new j(`Invalid JSON-LD syntax; an @context @type value must not be "${Oe}" in JSON-LD 1.0 mode.`,"jsonld.SyntaxError",{code:"invalid type mapping",context:O})}else if("@id"!==Oe&&"@vocab"!==Oe){if(Oe=X(I,Oe,{vocab:!0,base:!1},O,E,$),!C(Oe))throw new j("Invalid JSON-LD syntax; an @context @type value must be an absolute IRI.","jsonld.SyntaxError",{code:"invalid type mapping",context:O});if(0===Oe.indexOf("_:"))throw new j("Invalid JSON-LD syntax; an @context @type value must be an IRI, not a blank node identifier.","jsonld.SyntaxError",{code:"invalid type mapping",context:O})}Te["@type"]=Oe}if("@container"in ae){const Oe=H(ae["@container"])?[ae["@container"]]:ae["@container"]||[],$e=["@list","@set","@index","@language"];let st=!0;const Qe=Oe.includes("@set");if(P.processingMode(I,1.1)){if($e.push("@graph","@id","@type"),Oe.includes("@list")){if(1!==Oe.length)throw new j("Invalid JSON-LD syntax; @context @container with @list must have no other values","jsonld.SyntaxError",{code:"invalid container mapping",context:O})}else if(Oe.includes("@graph")){if(Oe.some(tt=>"@graph"!==tt&&"@id"!==tt&&"@index"!==tt&&"@set"!==tt))throw new j("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:O})}else st&=Oe.length<=(Qe?2:1);if(Oe.includes("@type")&&(Te["@type"]=Te["@type"]||"@id",!["@id","@vocab"].includes(Te["@type"])))throw new j("Invalid JSON-LD syntax; container: @type requires @type to be @id or @vocab.","jsonld.SyntaxError",{code:"invalid type mapping",context:O})}else st&=!k(ae["@container"]),st&=Oe.length<=1;if(st&=Oe.every(tt=>$e.includes(tt)),st&=!(Qe&&Oe.includes("@list")),!st)throw new j("Invalid JSON-LD syntax; @context @container value must be one of the following: "+$e.join(", "),"jsonld.SyntaxError",{code:"invalid container mapping",context:O});if(Te.reverse&&!Oe.every(tt=>["@index","@set"].includes(tt)))throw new j("Invalid JSON-LD syntax; @context @container value for a @reverse type definition must be @index or @set.","jsonld.SyntaxError",{code:"invalid reverse property",context:O});Te["@container"]=Oe}if("@index"in ae){if(!("@container"in ae)||!Te["@container"].includes("@index"))throw new j(`Invalid JSON-LD syntax; @index without @index in @container: "${ae["@index"]}" on term "${K}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:O});if(!H(ae["@index"])||0===ae["@index"].indexOf("@"))throw new j(`Invalid JSON-LD syntax; @index must expand to an IRI: "${ae["@index"]}" on term "${K}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:O});Te["@index"]=ae["@index"]}if("@context"in ae&&(Te["@context"]=ae["@context"]),"@language"in ae&&!("@type"in ae)){let Oe=ae["@language"];if(null!==Oe&&!H(Oe))throw new j("Invalid JSON-LD syntax; @context @language value must be a string or null.","jsonld.SyntaxError",{code:"invalid language mapping",context:O});null!==Oe&&(Oe=Oe.toLowerCase()),Te["@language"]=Oe}if("@prefix"in ae){if(K.match(/:|\//))throw new j("Invalid JSON-LD syntax; @context @prefix used on a compact IRI term","jsonld.SyntaxError",{code:"invalid term definition",context:O});if(P.isKeyword(Te["@id"]))throw new j("Invalid JSON-LD syntax; keywords may not be used as prefixes","jsonld.SyntaxError",{code:"invalid term definition",context:O});if("boolean"!=typeof ae["@prefix"])throw new j("Invalid JSON-LD syntax; @context value for @prefix must be boolean","jsonld.SyntaxError",{code:"invalid @prefix value",context:O});Te._prefix=!0===ae["@prefix"]}if("@direction"in ae){const Oe=ae["@direction"];if(null!==Oe&&"ltr"!==Oe&&"rtl"!==Oe)throw new j('Invalid JSON-LD syntax; @direction value must be null, "ltr", or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",context:O});Te["@direction"]=Oe}if("@nest"in ae){const Oe=ae["@nest"];if(!H(Oe)||"@nest"!==Oe&&0===Oe.indexOf("@"))throw new j("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:O});Te["@nest"]=Oe}const ye=Te["@id"];if("@context"===ye||"@preserve"===ye)throw new j("Invalid JSON-LD syntax; @context and @preserve cannot be aliased.","jsonld.SyntaxError",{code:"invalid keyword alias",context:O});if(oe&&oe.protected&&!Z&&(I.protected[K]=!0,Te.protected=!0,!ue(oe,Te))){const Oe=$&&$.protectedMode||"error";if("error"===Oe)throw new j(`Invalid JSON-LD syntax; tried to redefine "${K}" which is a protected term.`,"jsonld.SyntaxError",{code:"protected term redefinition",context:O,term:K});if("warn"===Oe)return void console.warn("WARNING: protected term redefinition",{term:K});throw new j("Invalid protectedMode.","jsonld.SyntaxError",{code:"invalid protected mode",context:O,term:K,protectedMode:Oe})}},P.expandIri=(I,O,K,E)=>X(I,O,K,void 0,void 0,E),P.getInitialContext=I=>{const O=JSON.stringify({processingMode:I.processingMode}),K=S.get(O);if(K)return K;const E={processingMode:I.processingMode,mappings:new Map,inverse:null,getInverse:function(){const Te=this;if(Te.inverse)return Te.inverse;const me=Te.inverse={},ne=Te.fastCurieMap={},ye={},Oe=(Te["@language"]||"@none").toLowerCase(),$e=Te["@direction"],st=Te.mappings,Qe=[...st.keys()].sort(y);for(const tt of Qe){const Xe=st.get(tt);if(null===Xe)continue;let ze=Xe["@container"]||"@none";if(ze=[].concat(ze).sort().join(""),null===Xe["@id"])continue;const Le=b(Xe["@id"]);for(const Ke of Le){let Me=me[Ke];const Ue=P.isKeyword(Ke);if(Me)!Ue&&!Xe._termHasColon&&ye[Ke].push(tt);else if(me[Ke]=Me={},!Ue&&!Xe._termHasColon){ye[Ke]=[tt];const qe={iri:Ke,terms:ye[Ke]};Ke[0]in ne?ne[Ke[0]].push(qe):ne[Ke[0]]=[qe]}if(Me[ze]||(Me[ze]={"@language":{},"@type":{},"@any":{}}),Me=Me[ze],ae(tt,Me["@any"],"@none"),Xe.reverse)ae(tt,Me["@type"],"@reverse");else if("@none"===Xe["@type"])ae(tt,Me["@any"],"@none"),ae(tt,Me["@language"],"@none"),ae(tt,Me["@type"],"@none");else if("@type"in Xe)ae(tt,Me["@type"],Xe["@type"]);else if("@language"in Xe&&"@direction"in Xe){const qe=Xe["@language"],ke=Xe["@direction"];ae(tt,Me["@language"],qe&&ke?`${qe}_${ke}`.toLowerCase():qe?qe.toLowerCase():ke?`_${ke}`:"@null")}else"@language"in Xe?ae(tt,Me["@language"],(Xe["@language"]||"@null").toLowerCase()):"@direction"in Xe?ae(tt,Me["@language"],Xe["@direction"]?`_${Xe["@direction"]}`:"@none"):$e?(ae(tt,Me["@language"],`_${$e}`),ae(tt,Me["@language"],"@none"),ae(tt,Me["@type"],"@none")):(ae(tt,Me["@language"],Oe),ae(tt,Me["@language"],"@none"),ae(tt,Me["@type"],"@none"))}}for(const tt in ne)Z(ne,tt,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===S.size&&S.clear(),S.set(O,E),E;function Z(Te,me,ne){const ye=Te[me],Oe=Te[me]={};let $e,st;for(const Qe of ye)$e=Qe.iri,st=ne>=$e.length?"":$e[ne],st in Oe?Oe[st].push(Qe):Oe[st]=[Qe];for(const Qe in Oe)""!==Qe&&Z(Oe,Qe,ne+1)}function ae(Te,me,ne){me.hasOwnProperty(ne)||(me[ne]=Te)}},P.getContextValue=(I,O,K)=>{if(null===O)return"@context"===K?void 0:null;if(I.mappings.has(O)){const E=I.mappings.get(O);if(v(K))return E;if(E.hasOwnProperty(K))return E[K]}return"@language"===K&&K in I||"@direction"===K&&K in I?I[K]:"@context"!==K?null:void 0},P.processingMode=(I,O)=>O.toString()>="1.1"?!I.processingMode||I.processingMode>="json-ld-"+O.toString():"json-ld-1.0"===I.processingMode,P.isKeyword=I=>{if(!H(I)||"@"!==I[0])return!1;switch(I){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,Se,he){"use strict";const{parseLinkHeader:W,buildHeaders:j}=Y("../util"),{LINK_HEADER_CONTEXT:k}=Y("../constants"),Q=Y("../JsonLdError"),H=Y("../RequestQueue"),{prependBase:v}=Y("../url"),C=/(^|(\r\n))link:/i;function R(T,b,y){const S=new(T=T||XMLHttpRequest);return new Promise((A,z)=>{S.onload=()=>A(S),S.onerror=P=>z(P),S.open("GET",b,!0);for(const P in y)S.setRequestHeader(P,y[P]);S.send()})}Se.exports=({secure:T,headers:b={},xhr:y}={headers:{}})=>{return b=j(b),(new H).wrapLoader(A);function A(P){return z.apply(this,arguments)}function z(){return(z=yt(function*(P){if(0!==P.indexOf("http:")&&0!==P.indexOf("https:"))throw new Q('URL could not be dereferenced; only "http" and "https" URLs are supported.',"jsonld.InvalidUrl",{code:"loading document failed",url:P});if(T&&0!==P.indexOf("https"))throw new Q('URL could not be dereferenced; secure mode is enabled and the URL\'s scheme is not "https".',"jsonld.InvalidUrl",{code:"loading document failed",url:P});let X;try{X=yield R(y,P,b)}catch(E){throw new Q("URL could not be dereferenced, an error occurred.","jsonld.LoadDocumentError",{code:"loading document failed",url:P,cause:E})}if(X.status>=400)throw new Q("URL could not be dereferenced: "+X.statusText,"jsonld.LoadDocumentError",{code:"loading document failed",url:P,httpStatusCode:X.status});let ue={contextUrl:null,documentUrl:P,document:X.response},I=null;const O=X.getResponseHeader("Content-Type");let K;if(C.test(X.getAllResponseHeaders())&&(K=X.getResponseHeader("Link")),K&&"application/ld+json"!==O){const E=W(K),$=E[k];if(Array.isArray($))throw new Q("URL could not be dereferenced, it has more than one associated HTTP Link Header.","jsonld.InvalidUrl",{code:"multiple context link headers",url:P});$&&(ue.contextUrl=$.target),I=E.alternate,I&&"application/ld+json"==I.type&&!(O||"").match(/^application\/(\w*\+)?json$/)&&(ue=yield A(v(P,I.target)))}return ue})).apply(this,arguments)}}},{"../JsonLdError":12,"../RequestQueue":15,"../constants":18,"../url":31,"../util":32}],21:[function(Y,Se,he){"use strict";const W=Y("./JsonLdError"),{isArray:j,isObject:k,isEmptyObject:Q,isString:H,isUndefined:v}=Y("./types"),{isList:C,isValue:R,isGraph:T,isSubject:b}=Y("./graphTypes"),{expandIri:y,getContextValue:S,isKeyword:A,process:z,processingMode:P}=Y("./context"),{isAbsolute:X}=Y("./url"),{addValue:ue,asArray:I,getValues:O,validateTypeValue:K}=Y("./util"),E={};Se.exports=E;const $=/^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$/;function Z(ne){return ae.apply(this,arguments)}function ae(){return(ae=yt(function*({activeCtx:ne,activeProperty:ye,expandedActiveProperty:Oe,element:$e,expandedParent:st,options:Qe={},insideList:tt,typeKey:Xe,typeScopedContext:ze,expansionMap:Le}){const Ke=Object.keys($e).sort(),Me=[];let Ue;const qe=$e[Xe]&&"@json"===y(ne,j($e[Xe])?$e[Xe][0]:$e[Xe],{vocab:!0},Qe);for(const ke of Ke){let G,q=$e[ke];if("@context"===ke)continue;let pe=y(ne,ke,{vocab:!0},Qe);if((null===pe||!X(pe)&&!A(pe))&&(pe=Le({unmappedProperty:ke,activeCtx:ne,activeProperty:ye,parent:$e,options:Qe,insideList:tt,value:q,expandedParent:st}),void 0===pe))continue;if(A(pe)){if("@reverse"===Oe)throw new W("Invalid JSON-LD syntax; a keyword cannot be used as a @reverse property.","jsonld.SyntaxError",{code:"invalid reverse property map",value:q});if(pe in st&&"@included"!==pe&&"@type"!==pe)throw new W("Invalid JSON-LD syntax; colliding keywords detected.","jsonld.SyntaxError",{code:"colliding keywords",keyword:pe})}if("@id"===pe){if(!H(q)){if(!Qe.isFrame)throw new W('Invalid JSON-LD syntax; "@id" value must a string.',"jsonld.SyntaxError",{code:"invalid @id value",value:q});if(k(q)){if(!Q(q))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:q})}else{if(!j(q))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:q});if(!q.every(pt=>H(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:q})}}ue(st,"@id",I(q).map(pt=>H(pt)?y(ne,pt,{base:!0},Qe):pt),{propertyIsArray:Qe.isFrame});continue}if("@type"===pe){k(q)&&(q=Object.fromEntries(Object.entries(q).map(([pt,we])=>[y(ze,pt,{vocab:!0}),I(we).map(B=>y(ze,B,{base:!0,vocab:!0}))]))),K(q,Qe.isFrame),ue(st,"@type",I(q).map(pt=>H(pt)?y(ze,pt,{base:!0,vocab:!0},Qe):pt),{propertyIsArray:Qe.isFrame});continue}if("@included"===pe&&P(ne,1.1)){const pt=I(yield E.expand({activeCtx:ne,activeProperty:ye,element:q,options:Qe,expansionMap:Le}));if(!pt.every(we=>b(we)))throw new W("Invalid JSON-LD syntax; values of @included must expand to node objects.","jsonld.SyntaxError",{code:"invalid @included value",value:q});ue(st,"@included",pt,{propertyIsArray:!0});continue}if("@graph"===pe&&!k(q)&&!j(q))throw new W('Invalid JSON-LD syntax; "@graph" value must not be an object or an array.',"jsonld.SyntaxError",{code:"invalid @graph value",value:q});if("@value"===pe){Ue=q,qe&&P(ne,1.1)?st["@value"]=q:ue(st,"@value",q,{propertyIsArray:Qe.isFrame});continue}if("@language"===pe){if(null===q)continue;if(!H(q)&&!Qe.isFrame)throw new W('Invalid JSON-LD syntax; "@language" value must be a string.',"jsonld.SyntaxError",{code:"invalid language-tagged string",value:q});q=I(q).map(pt=>H(pt)?pt.toLowerCase():pt);for(const pt of q)H(pt)&&!pt.match($)&&console.warn(`@language must be valid BCP47: ${pt}`);ue(st,"@language",q,{propertyIsArray:Qe.isFrame});continue}if("@direction"===pe){if(!H(q)&&!Qe.isFrame)throw new W('Invalid JSON-LD syntax; "@direction" value must be a string.',"jsonld.SyntaxError",{code:"invalid base direction",value:q});q=I(q);for(const pt of q)if(H(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:q});ue(st,"@direction",q,{propertyIsArray:Qe.isFrame});continue}if("@index"===pe){if(!H(q))throw new W('Invalid JSON-LD syntax; "@index" value must be a string.',"jsonld.SyntaxError",{code:"invalid @index value",value:q});ue(st,"@index",q);continue}if("@reverse"===pe){if(!k(q))throw new W('Invalid JSON-LD syntax; "@reverse" value must be an object.',"jsonld.SyntaxError",{code:"invalid @reverse value",value:q});if(G=yield E.expand({activeCtx:ne,activeProperty:"@reverse",element:q,options:Qe,expansionMap:Le}),"@reverse"in G)for(const we in G["@reverse"])ue(st,we,G["@reverse"][we],{propertyIsArray:!0});let pt=st["@reverse"]||null;for(const we in G){if("@reverse"===we)continue;null===pt&&(pt=st["@reverse"]={}),ue(pt,we,[],{propertyIsArray:!0});const B=G[we];for(let N=0;N"@id"===pt||"@index"===pt)&&(G=I(G).map(pt=>({"@graph":I(pt)}))),de.mappings.has(ke)&&de.mappings.get(ke).reverse){const pt=st["@reverse"]=st["@reverse"]||{};G=I(G);for(let we=0;we"@value"===y(ne,pe,{vocab:!0},Qe)))throw new W("Invalid JSON-LD syntax; nested value must be a node object.","jsonld.SyntaxError",{code:"invalid @nest value",value:G});yield Z({activeCtx:ne,activeProperty:ye,expandedActiveProperty:Oe,element:G,expandedParent:st,options:Qe,insideList:tt,typeScopedContext:ze,typeKey:Xe,expansionMap:Le})}}})).apply(this,arguments)}function oe({activeCtx:ne,activeProperty:ye,value:Oe,options:$e}){if(null==Oe)return null;const st=y(ne,ye,{vocab:!0},$e);if("@id"===st)return y(ne,Oe,{base:!0},$e);if("@type"===st)return y(ne,Oe,{vocab:!0,base:!0},$e);const Qe=S(ne,ye,"@type");if(("@id"===Qe||"@graph"===st)&&H(Oe))return{"@id":y(ne,Oe,{base:!0},$e)};if("@vocab"===Qe&&H(Oe))return{"@id":y(ne,Oe,{vocab:!0,base:!0},$e)};if(A(st))return Oe;const tt={};if(Qe&&!["@id","@vocab","@none"].includes(Qe))tt["@type"]=Qe;else if(H(Oe)){const Xe=S(ne,ye,"@language");null!==Xe&&(tt["@language"]=Xe);const ze=S(ne,ye,"@direction");null!==ze&&(tt["@direction"]=ze)}return["boolean","number","string"].includes(typeof Oe)||(Oe=Oe.toString()),tt["@value"]=Oe,tt}function te(ne,ye,Oe,$e){const st=[],Qe=Object.keys(ye).sort();for(const tt of Qe){const Xe=y(ne,tt,{vocab:!0},$e);let ze=ye[tt];j(ze)||(ze=[ze]);for(const Le of ze){if(null===Le)continue;if(!H(Le))throw new W("Invalid JSON-LD syntax; language map values must be strings.","jsonld.SyntaxError",{code:"invalid language map value",languageMap:ye});const Ke={"@value":Le};"@none"!==Xe&&(Ke["@language"]=tt.toLowerCase()),Oe&&(Ke["@direction"]=Oe),st.push(Ke)}}return st}function Te(ne){return me.apply(this,arguments)}function me(){return(me=yt(function*({activeCtx:ne,options:ye,activeProperty:Oe,value:$e,expansionMap:st,asGraph:Qe,indexKey:tt,propertyIndex:Xe}){const ze=[],Le=Object.keys($e).sort(),Ke="@type"===tt;for(let Me of Le){if(Ke){const ke=S(ne,Me,"@context");v(ke)||(ne=yield z({activeCtx:ne,localCtx:ke,propagate:!1,options:ye}))}let qe,Ue=$e[Me];j(Ue)||(Ue=[Ue]),Ue=yield E.expand({activeCtx:ne,activeProperty:Oe,element:Ue,options:ye,insideList:!1,insideIndex:!0,expansionMap:st}),qe=Xe?"@none"===Me?"@none":oe({activeCtx:ne,activeProperty:tt,value:Me,options:ye}):y(ne,Me,{vocab:!0},ye),"@id"===tt?Me=y(ne,Me,{base:!0},ye):Ke&&(Me=qe);for(let ke of Ue){if(Qe&&!T(ke)&&(ke={"@graph":[ke]}),"@type"===tt)"@none"===qe||(ke["@type"]=ke["@type"]?[Me].concat(ke["@type"]):[Me]);else{if(R(ke)&&!["@language","@type","@index"].includes(tt))throw new W(`Invalid JSON-LD syntax; Attempt to add illegal key to value object: "${tt}".`,"jsonld.SyntaxError",{code:"invalid value object",value:ke});Xe?"@none"!==qe&&ue(ke,Xe,qe,{propertyIsArray:!0,prependValue:!0}):"@none"!==qe&&!(tt in ke)&&(ke[tt]=Me)}ze.push(ke)}}return ze})).apply(this,arguments)}E.expand=function(){var ne=yt(function*({activeCtx:ye,activeProperty:Oe=null,element:$e,options:st={},insideList:Qe=!1,insideIndex:tt=!1,typeScopedContext:Xe=null,expansionMap:ze=(()=>{})}){if(null==$e)return null;if("@default"===Oe&&(st=Object.assign({},st,{isFrame:!1})),!j($e)&&!k($e)){if(!Qe&&(null===Oe||"@graph"===y(ye,Oe,{vocab:!0},st))){const G=yield ze({unmappedValue:$e,activeCtx:ye,activeProperty:Oe,options:st,insideList:Qe});return void 0===G?null:G}return oe({activeCtx:ye,activeProperty:Oe,value:$e,options:st})}if(j($e)){let G=[];const pe=S(ye,Oe,"@container")||[];Qe=Qe||pe.includes("@list");for(let de=0;de<$e.length;++de){let je=yield E.expand({activeCtx:ye,activeProperty:Oe,element:$e[de],options:st,expansionMap:ze,insideIndex:tt,typeScopedContext:Xe});Qe&&j(je)&&(je={"@list":je}),(null!==je||(je=yield ze({unmappedValue:$e[de],activeCtx:ye,activeProperty:Oe,parent:$e,index:de,options:st,expandedParent:G,insideList:Qe}),void 0!==je))&&(j(je)?G=G.concat(je):G.push(je))}return G}const Le=y(ye,Oe,{vocab:!0},st),Ke=S(ye,Oe,"@context");Xe=Xe||(ye.previousContext?ye:null);let Me=Object.keys($e).sort(),Ue=!tt;if(Ue&&Xe&&Me.length<=2&&!Me.includes("@context"))for(const G of Me){const pe=y(Xe,G,{vocab:!0},st);if("@value"===pe){Ue=!1,ye=Xe;break}if("@id"===pe&&1===Me.length){Ue=!1;break}}Ue&&(ye=ye.revertToPreviousContext()),v(Ke)||(ye=yield z({activeCtx:ye,localCtx:Ke,propagate:!0,overrideProtected:!0,options:st})),"@context"in $e&&(ye=yield z({activeCtx:ye,localCtx:$e["@context"],options:st})),Xe=ye;let qe=null;for(const G of Me)if("@type"===y(ye,G,{vocab:!0},st)){qe=qe||G;const de=$e[G],je=Array.isArray(de)?de.length>1?de.slice().sort():de:[de];for(const _t of je){const pt=S(Xe,_t,"@context");v(pt)||(ye=yield z({activeCtx:ye,localCtx:pt,options:st,propagate:!1}))}}let ke={};yield Z({activeCtx:ye,activeProperty:Oe,expandedActiveProperty:Le,element:$e,expandedParent:ke,options:st,insideList:Qe,typeKey:qe,typeScopedContext:Xe,expansionMap:ze}),Me=Object.keys(ke);let q=Me.length;if("@value"in ke){if("@type"in ke&&("@language"in ke||"@direction"in ke))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:ke});let G=q-1;if("@type"in ke&&(G-=1),"@index"in ke&&(G-=1),"@language"in ke&&(G-=1),"@direction"in ke&&(G-=1),0!==G)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:ke});const pe=null===ke["@value"]?[]:I(ke["@value"]),de=O(ke,"@type");if(!P(ye,1.1)||!de.includes("@json")||1!==de.length)if(0===pe.length){const je=yield ze({unmappedValue:ke,activeCtx:ye,activeProperty:Oe,element:$e,options:st,insideList:Qe});ke=void 0!==je?je:null}else{if(!pe.every(je=>H(je)||Q(je))&&"@language"in ke)throw new W("Invalid JSON-LD syntax; only strings may be language-tagged.","jsonld.SyntaxError",{code:"invalid language-tagged value",element:ke});if(!de.every(je=>X(je)&&!(H(je)&&0===je.indexOf("_:"))||Q(je)))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:ke})}}else if("@type"in ke&&!j(ke["@type"]))ke["@type"]=[ke["@type"]];else if("@set"in ke||"@list"in ke){if(q>1&&(2!==q||!("@index"in ke)))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:ke});"@set"in ke&&(ke=ke["@set"],Me=Object.keys(ke),q=Me.length)}else if(1===q&&"@language"in ke){const G=yield ze(ke,{unmappedValue:ke,activeCtx:ye,activeProperty:Oe,element:$e,options:st,insideList:Qe});ke=void 0!==G?G:null}if(k(ke)&&!st.keepFreeFloatingNodes&&!Qe&&(null===Oe||"@graph"===Le)&&(0===q||"@value"in ke||"@list"in ke||1===q&&"@id"in ke)){const G=yield ze({unmappedValue:ke,activeCtx:ye,activeProperty:Oe,element:$e,options:st,insideList:Qe});ke=void 0!==G?G:null}return ke});return function(ye){return ne.apply(this,arguments)}}()},{"./JsonLdError":12,"./context":19,"./graphTypes":25,"./types":30,"./url":31,"./util":32}],22:[function(Y,Se,he){"use strict";const{isSubjectReference:W}=Y("./graphTypes"),{createMergedNodeMap:j}=Y("./nodeMap"),k={};Se.exports=k,k.flatten=Q=>{const H=j(Q),v=[],C=Object.keys(H).sort();for(let R=0;R=0;--ae){const oe=Z[ae];if(oe.graph===$&&oe.subject["@id"]===E["@id"])return!0}return!1}function S(E,$,Z){const ae="@"+Z;let oe=ae in E?E[ae][0]:$[Z];if("embed"===Z)if(!0===oe)oe="@once";else if(!1===oe)oe="@never";else if("@always"!==oe&&"@never"!==oe&&"@link"!==oe&&"@first"!==oe&&"@last"!==oe&&"@once"!==oe)throw new v("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:E});return oe}function A(E){if(!k.isArray(E)||1!==E.length||!k.isObject(E[0]))throw new v("Invalid JSON-LD syntax; a JSON-LD frame must be a single object.","jsonld.SyntaxError",{frame:E});if("@id"in E[0])for(const $ of Q.asArray(E[0]["@id"]))if(!k.isObject($)&&!H.isAbsolute($)||k.isString($)&&0===$.indexOf("_:"))throw new v("Invalid JSON-LD syntax; invalid @id in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:E});if("@type"in E[0])for(const $ of Q.asArray(E[0]["@type"]))if(!k.isObject($)&&!H.isAbsolute($)||k.isString($)&&0===$.indexOf("_:"))throw new v("Invalid JSON-LD syntax; invalid @type in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:E})}function P(E,$,Z,ae){let oe=!0,te=!1;for(const Te in Z){let me=!1;const ne=Q.getValues($,Te),ye=0===Q.getValues(Z,Te).length;if("@id"===Te){if(k.isEmptyObject(Z["@id"][0]||{})?me=!0:Z["@id"].length>=0&&(me=Z["@id"].includes(ne[0])),!ae.requireAll)return me}else if("@type"===Te){if(oe=!1,ye){if(ne.length>0)return!1;me=!0}else if(1===Z["@type"].length&&k.isEmptyObject(Z["@type"][0]))me=ne.length>0;else for(const Oe of Z["@type"])me=!(!k.isObject(Oe)||!("@default"in Oe))||me||ne.some($e=>$e===Oe);if(!ae.requireAll)return me}else{if(W(Te))continue;{const Oe=Q.getValues(Z,Te)[0];let $e=!1;if(Oe&&(A([Oe]),$e="@default"in Oe),oe=!1,0===ne.length&&$e)continue;if(ne.length>0&&ye)return!1;if(void 0===Oe){if(ne.length>0)return!1;me=!0}else if(j.isList(Oe)){const st=Oe["@list"][0];if(j.isList(ne[0])){const Qe=ne[0]["@list"];j.isValue(st)?me=Qe.some(tt=>K(st,tt)):(j.isSubject(st)||j.isSubjectReference(st))&&(me=Qe.some(tt=>O(E,st,tt,ae)))}}else me=j.isValue(Oe)?ne.some(st=>K(Oe,st)):j.isSubjectReference(Oe)?ne.some(st=>O(E,Oe,st,ae)):!!k.isObject(Oe)&&ne.length>0}}if(!me&&ae.requireAll)return!1;te=te||me}return oe||te}function X(E,$){const Z=E.uniqueEmbeds[E.graph],ae=Z[$],oe=ae.parent,te=ae.property,Te={"@id":$};if(k.isArray(oe)){for(let ne=0;ne{const ye=Object.keys(Z);for(const Oe of ye)Oe in Z&&k.isObject(Z[Oe].parent)&&Z[Oe].parent["@id"]===ne&&(delete Z[Oe],me(Oe))};me($)}function ue(E,$){if(k.isArray(E))return E.map(Z=>ue(Z,$));if(k.isObject(E)){if("@preserve"in E)return E["@preserve"][0];if(j.isValue(E))return E;if(j.isList(E))return E["@list"]=ue(E["@list"],$),E;if("@id"in E){const Z=E["@id"];if($.link.hasOwnProperty(Z)){const ae=$.link[Z].indexOf(E);if(-1!==ae)return $.link[Z][ae];$.link[Z].push(E)}else $.link[Z]=[E]}for(const Z in E)"@id"===Z&&$.bnodesToClear.includes(E[Z])?delete E["@id"]:E[Z]=ue(E[Z],$)}return E}function I(E,$,Z){k.isObject(E)?Q.addValue(E,$,Z,{propertyIsArray:!0}):E.push(Z)}function O(E,$,Z,ae){if(!("@id"in Z))return!1;const oe=E.subjects[Z["@id"]];return oe&&P(E,oe,$,ae)}function K(E,$){const Z=$["@value"],ae=$["@type"],oe=$["@language"],te=E["@value"]?k.isArray(E["@value"])?E["@value"]:[E["@value"]]:[],Te=E["@type"]?k.isArray(E["@type"])?E["@type"]:[E["@type"]]:[],me=E["@language"]?k.isArray(E["@language"])?E["@language"]:[E["@language"]]:[];return 0===te.length&&0===Te.length&&0===me.length||!(!te.includes(Z)&&!k.isEmptyObject(te[0])||!(!ae&&0===Te.length||Te.includes(ae)||ae&&k.isEmptyObject(Te[0]))||!(!oe&&0===me.length||me.includes(oe)||oe&&k.isEmptyObject(me[0])))}Se.exports=T,T.frameMergedOrDefault=(E,$,Z)=>{const ae={options:Z,embedded:!1,graph:"@default",graphMap:{"@default":{}},subjectStack:[],link:{},bnodeMap:{}},oe=new Q.IdentifierIssuer("_:b");C(E,ae.graphMap,"@default",oe),Z.merged&&(ae.graphMap["@merged"]=R(ae.graphMap),ae.graph="@merged"),ae.subjects=ae.graphMap[ae.graph];const te=[];return T.frame(ae,Object.keys(ae.subjects).sort(),$,te),Z.pruneBlankNodeIdentifiers&&(Z.bnodesToClear=Object.keys(ae.bnodeMap).filter(Te=>1===ae.bnodeMap[Te].length)),Z.link={},ue(te,Z)},T.frame=(E,$,Z,ae,oe=null)=>{A(Z);const te=E.options,Te={embed:S(Z=Z[0],te,"embed"),explicit:S(Z,te,"explicit"),requireAll:S(Z,te,"requireAll")};E.link.hasOwnProperty(E.graph)||(E.link[E.graph]={});const me=E.link[E.graph],ne=function(E,$,Z,ae){const oe={};for(const te of $){const Te=E.graphMap[E.graph][te];P(E,Te,Z,ae)&&(oe[te]=Te)}return oe}(E,$,Z,Te),ye=Object.keys(ne).sort();for(const Oe of ye){const $e=ne[Oe];if(null===oe?E.uniqueEmbeds={[E.graph]:{}}:E.uniqueEmbeds[E.graph]=E.uniqueEmbeds[E.graph]||{},"@link"===Te.embed&&Oe in me){I(ae,oe,me[Oe]);continue}const st={"@id":Oe};if(0===Oe.indexOf("_:")&&Q.addValue(E.bnodeMap,Oe,st,{propertyIsArray:!0}),me[Oe]=st,("@first"===Te.embed||"@last"===Te.embed)&&E.is11)throw new v("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:Z});if(E.embedded||!E.uniqueEmbeds[E.graph].hasOwnProperty(Oe)){if(E.embedded&&("@never"===Te.embed||y($e,E.graph,E.subjectStack))){I(ae,oe,st);continue}if(E.embedded&&("@first"==Te.embed||"@once"==Te.embed)&&E.uniqueEmbeds[E.graph].hasOwnProperty(Oe)){I(ae,oe,st);continue}if("@last"===Te.embed&&Oe in E.uniqueEmbeds[E.graph]&&X(E,Oe),E.uniqueEmbeds[E.graph][Oe]={parent:ae,property:oe},E.subjectStack.push({subject:$e,graph:E.graph}),Oe in E.graphMap){let Qe=!1,tt=null;"@graph"in Z?(tt=Z["@graph"][0],Qe=!("@merged"===Oe||"@default"===Oe),k.isObject(tt)||(tt={})):(Qe="@merged"!==E.graph,tt={}),Qe&&T.frame(Sn(ot({},E),{graph:Oe,embedded:!1}),Object.keys(E.graphMap[Oe]).sort(),[tt],st,"@graph")}"@included"in Z&&T.frame(Sn(ot({},E),{embedded:!1}),$,Z["@included"],st,"@included");for(const Qe of Object.keys($e).sort())if(W(Qe)){if(st[Qe]=Q.clone($e[Qe]),"@type"===Qe)for(const tt of $e["@type"])0===tt.indexOf("_:")&&Q.addValue(E.bnodeMap,tt,st,{propertyIsArray:!0})}else if(!Te.explicit||Qe in Z)for(const tt of $e[Qe]){const Xe=Qe in Z?Z[Qe]:b(Te);if(j.isList(tt)){const ze=Z[Qe]&&Z[Qe][0]&&Z[Qe][0]["@list"]?Z[Qe][0]["@list"]:b(Te),Le={"@list":[]};I(st,Qe,Le);const Ke=tt["@list"];for(const Me of Ke)j.isSubjectReference(Me)?T.frame(Sn(ot({},E),{embedded:!0}),[Me["@id"]],ze,Le,"@list"):I(Le,"@list",Q.clone(Me))}else j.isSubjectReference(tt)?T.frame(Sn(ot({},E),{embedded:!0}),[tt["@id"]],Xe,st,Qe):K(Xe[0],tt)&&I(st,Qe,Q.clone(tt))}for(const Qe of Object.keys(Z).sort()){if("@type"===Qe){if(!k.isObject(Z[Qe][0])||!("@default"in Z[Qe][0]))continue}else if(W(Qe))continue;const tt=Z[Qe][0]||{};if(!S(tt,te,"omitDefault")&&!(Qe in st)){let ze="@null";"@default"in tt&&(ze=Q.clone(tt["@default"])),k.isArray(ze)||(ze=[ze]),st[Qe]=[{"@preserve":ze}]}}for(const Qe of Object.keys(Z["@reverse"]||{}).sort()){const tt=Z["@reverse"][Qe];for(const Xe of Object.keys(E.subjects))Q.getValues(E.subjects[Xe],Qe).some(Le=>Le["@id"]===Oe)&&(st["@reverse"]=st["@reverse"]||{},Q.addValue(st["@reverse"],Qe,[],{propertyIsArray:!0}),T.frame(Sn(ot({},E),{embedded:!0}),[Xe],tt,st["@reverse"][Qe],oe))}I(ae,oe,st),E.subjectStack.pop()}}},T.cleanupNull=(E,$)=>{if(k.isArray(E))return E.map(ae=>T.cleanupNull(ae,$)).filter(ae=>ae);if("@null"===E)return null;if(k.isObject(E)){if("@id"in E){const Z=E["@id"];if($.link.hasOwnProperty(Z)){const ae=$.link[Z].indexOf(E);if(-1!==ae)return $.link[Z][ae];$.link[Z].push(E)}else $.link[Z]=[E]}for(const Z in E)E[Z]=T.cleanupNull(E[Z],$)}return E}},{"./JsonLdError":12,"./context":19,"./graphTypes":25,"./nodeMap":27,"./types":30,"./url":31,"./util":32}],24:[function(Y,Se,he){"use strict";const W=Y("./JsonLdError"),j=Y("./graphTypes"),k=Y("./types"),Q=Y("./util"),{RDF_LIST:H,RDF_FIRST:v,RDF_REST:C,RDF_NIL:R,RDF_TYPE:T,RDF_JSON_LITERAL:b,XSD_BOOLEAN:y,XSD_DOUBLE:S,XSD_INTEGER:A,XSD_STRING:z}=Y("./constants"),P=/^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$/,X={};function ue(I,O,K){if(I.termType.endsWith("Node"))return{"@id":I.value};const E={"@value":I.value};if(I.language)E["@language"]=I.language;else{let $=I.datatype.value;if($||($=z),$===b){$="@json";try{E["@value"]=JSON.parse(E["@value"])}catch(Z){throw new W("JSON literal could not be parsed.","jsonld.InvalidJsonLiteral",{code:"invalid JSON literal",value:E["@value"],cause:Z})}}if(O){if($===y)"true"===E["@value"]?E["@value"]=!0:"false"===E["@value"]&&(E["@value"]=!1);else if(k.isNumeric(E["@value"]))if($===A){const Z=parseInt(E["@value"],10);Z.toFixed(0)===E["@value"]&&(E["@value"]=Z)}else $===S&&(E["@value"]=parseFloat(E["@value"]));[y,A,S,z].includes($)||(E["@type"]=$)}else if("i18n-datatype"===K&&$.startsWith("https://www.w3.org/ns/i18n#")){const[,Z,ae]=$.split(/[#_]/);Z.length>0&&(E["@language"]=Z,Z.match(P)||console.warn(`@language must be valid BCP47: ${Z}`)),E["@direction"]=ae}else $!==z&&(E["@type"]=$)}return E}Se.exports=X,X.fromRDF=function(){var I=yt(function*(O,{useRdfType:K=!1,useNativeTypes:E=!1,rdfDirection:$=null}){const Z={},ae={"@default":Z},oe={};for(const me of O){const ne="DefaultGraph"===me.graph.termType?"@default":me.graph.value;ne in ae||(ae[ne]={}),"@default"!==ne&&!(ne in Z)&&(Z[ne]={"@id":ne});const ye=ae[ne],Oe=me.subject.value,$e=me.predicate.value,st=me.object;Oe in ye||(ye[Oe]={"@id":Oe});const Qe=ye[Oe],tt=st.termType.endsWith("Node");if(tt&&!(st.value in ye)&&(ye[st.value]={"@id":st.value}),$e===T&&!K&&tt){Q.addValue(Qe,"@type",st.value,{propertyIsArray:!0});continue}const Xe=ue(st,E,$);if(Q.addValue(Qe,$e,Xe,{propertyIsArray:!0}),tt)if(st.value===R){const ze=ye[st.value];"usages"in ze||(ze.usages=[]),ze.usages.push({node:Qe,property:$e,value:Xe})}else oe[st.value]=!(st.value in oe)&&{node:Qe,property:$e,value:Xe}}for(const me in ae){const ne=ae[me];if(!(R in ne))continue;const ye=ne[R];if(ye.usages){for(let Oe of ye.usages){let $e=Oe.node,st=Oe.property,Qe=Oe.value;const tt=[],Xe=[];let ze=Object.keys($e).length;for(;st===C&&k.isObject(oe[$e["@id"]])&&k.isArray($e[v])&&1===$e[v].length&&k.isArray($e[C])&&1===$e[C].length&&(3===ze||4===ze&&k.isArray($e["@type"])&&1===$e["@type"].length&&$e["@type"][0]===H)&&(tt.push($e[v][0]),Xe.push($e["@id"]),Oe=oe[$e["@id"]],$e=Oe.node,st=Oe.property,Qe=Oe.value,ze=Object.keys($e).length,j.isBlankNode($e)););delete Qe["@id"],Qe["@list"]=tt.reverse();for(const Le of Xe)delete ne[Le]}delete ye.usages}}const te=[],Te=Object.keys(Z).sort();for(const me of Te){const ne=Z[me];if(me in ae){const ye=ne["@graph"]=[],Oe=ae[me],$e=Object.keys(Oe).sort();for(const st of $e){const Qe=Oe[st];j.isSubjectReference(Qe)||ye.push(Qe)}}j.isSubjectReference(ne)||te.push(ne)}return te});return function(O,K){return I.apply(this,arguments)}}()},{"./JsonLdError":12,"./constants":18,"./graphTypes":25,"./types":30,"./util":32}],25:[function(Y,Se,he){"use strict";const W=Y("./types"),j={};Se.exports=j,j.isSubject=k=>!(!W.isObject(k)||"@value"in k||"@set"in k||"@list"in k)&&(Object.keys(k).length>1||!("@id"in k)),j.isSubjectReference=k=>W.isObject(k)&&1===Object.keys(k).length&&"@id"in k,j.isValue=k=>W.isObject(k)&&"@value"in k,j.isList=k=>W.isObject(k)&&"@list"in k,j.isGraph=k=>W.isObject(k)&&"@graph"in k&&1===Object.keys(k).filter(Q=>"@id"!==Q&&"@index"!==Q).length,j.isSimpleGraph=k=>j.isGraph(k)&&!("@id"in k),j.isBlankNode=k=>!!W.isObject(k)&&("@id"in k?0===k["@id"].indexOf("_:"):0===Object.keys(k).length||!("@value"in k||"@set"in k||"@list"in k))},{"./types":30}],26:[function(Y,Se,he){const W=Y("rdf-canonize"),j=Y("./platform"),k=Y("./util"),Q=Y("./ContextResolver"),H=k.IdentifierIssuer,v=Y("./JsonLdError"),C=Y("lru-cache"),R=Y("./NQuads"),{expand:T}=Y("./expand"),{flatten:b}=Y("./flatten"),{fromRDF:y}=Y("./fromRdf"),{toRDF:S}=Y("./toRdf"),{frameMergedOrDefault:A,cleanupNull:z}=Y("./frame"),{isArray:P,isObject:X,isString:ue}=Y("./types"),{isSubjectReference:I}=Y("./graphTypes"),{expandIri:O,getInitialContext:K,process:E,processingMode:$}=Y("./context"),{compact:Z,compactIri:ae}=Y("./compact"),{createNodeMap:oe,createMergedNodeMap:te,mergeNodeMaps:Te}=Y("./nodeMap"),me=function(ye){const Oe={},st=new C({max:100});function Qe(tt,Le){var Ke=Le,{documentLoader:Xe=ye.documentLoader}=Ke,ze=Nq(Ke,["documentLoader"]);return Object.assign({},{documentLoader:Xe},ze,tt)}return ye.compact=function(){var tt=yt(function*(Xe,ze,Le){if(arguments.length<2)throw new TypeError("Could not compact, too few arguments.");if(null===ze)throw new v("The compaction context must not be null.","jsonld.CompactError",{code:"invalid local context"});if(null===Xe)return null;let Ke;(Le=Qe(Le,{base:ue(Xe)?Xe:"",compactArrays:!0,compactToRelative:!0,graph:!1,skipExpansion:!1,link:!1,issuer:new H("_:b"),contextResolver:new Q({sharedCache:st})})).link&&(Le.skipExpansion=!0),Le.compactToRelative||delete Le.base,Ke=Le.skipExpansion?Xe:yield ye.expand(Xe,Le);const Me=yield ye.processContext(K(Le),ze,Le);let Ue=yield Z({activeCtx:Me,element:Ke,options:Le,compactionMap:Le.compactionMap});Le.compactArrays&&!Le.graph&&P(Ue)?1===Ue.length?Ue=Ue[0]:0===Ue.length&&(Ue={}):Le.graph&&X(Ue)&&(Ue=[Ue]),X(ze)&&"@context"in ze&&(ze=ze["@context"]),ze=k.clone(ze),P(ze)||(ze=[ze]);const qe=ze;ze=[];for(let q=0;q0)&&ze.push(qe[q]);const ke=ze.length>0;if(1===ze.length&&(ze=ze[0]),P(Ue)){const q=ae({activeCtx:Me,iri:"@graph",relativeTo:{vocab:!0}}),G=Ue;Ue={},ke&&(Ue["@context"]=ze),Ue[q]=G}else if(X(Ue)&&ke){const q=Ue;Ue={"@context":ze};for(const G in q)Ue[G]=q[G]}return Ue});return function(Xe,ze,Le){return tt.apply(this,arguments)}}(),ye.expand=function(){var tt=yt(function*(Xe,ze){if(arguments.length<1)throw new TypeError("Could not expand, too few arguments.");!1===(ze=Qe(ze,{keepFreeFloatingNodes:!1,contextResolver:new Q({sharedCache:st})})).expansionMap&&(ze.expansionMap=void 0);const Le={},Ke=[];if("expandContext"in ze){const ke=k.clone(ze.expandContext);Le.expandContext=X(ke)&&"@context"in ke?ke:{"@context":ke},Ke.push(Le.expandContext)}let Me;if(ue(Xe)){const ke=yield ye.get(Xe,ze);Me=ke.documentUrl,Le.input=ke.document,ke.contextUrl&&(Le.remoteContext={"@context":ke.contextUrl},Ke.push(Le.remoteContext))}else Le.input=k.clone(Xe);"base"in ze||(ze.base=Me||"");let Ue=K(ze);for(const ke of Ke)Ue=yield E({activeCtx:Ue,localCtx:ke,options:ze});let qe=yield T({activeCtx:Ue,element:Le.input,options:ze,expansionMap:ze.expansionMap});return X(qe)&&"@graph"in qe&&1===Object.keys(qe).length?qe=qe["@graph"]:null===qe&&(qe=[]),P(qe)||(qe=[qe]),qe});return function(Xe,ze){return tt.apply(this,arguments)}}(),ye.flatten=function(){var tt=yt(function*(Xe,ze,Le){if(arguments.length<1)return new TypeError("Could not flatten, too few arguments.");ze="function"==typeof ze?null:ze||null,Le=Qe(Le,{base:ue(Xe)?Xe:"",contextResolver:new Q({sharedCache:st})});const Ke=yield ye.expand(Xe,Le),Me=b(Ke);return null===ze?Me:(Le.graph=!0,Le.skipExpansion=!0,yield ye.compact(Me,ze,Le))});return function(Xe,ze,Le){return tt.apply(this,arguments)}}(),ye.frame=function(){var tt=yt(function*(Xe,ze,Le){if(arguments.length<2)throw new TypeError("Could not frame, too few arguments.");if(Le=Qe(Le,{base:ue(Xe)?Xe:"",embed:"@once",explicit:!1,requireAll:!1,omitDefault:!1,bnodesToClear:[],contextResolver:new Q({sharedCache:st})}),ue(ze)){const de=yield ye.get(ze,Le);if(ze=de.document,de.contextUrl){let je=ze["@context"];je?P(je)?je.push(de.contextUrl):je=[je,de.contextUrl]:je=de.contextUrl,ze["@context"]=je}}const Ke=ze&&ze["@context"]||{},Me=yield ye.processContext(K(Le),Ke,Le);Le.hasOwnProperty("omitGraph")||(Le.omitGraph=$(Me,1.1)),Le.hasOwnProperty("pruneBlankNodeIdentifiers")||(Le.pruneBlankNodeIdentifiers=$(Me,1.1));const Ue=yield ye.expand(Xe,Le),qe=ot({},Le);qe.isFrame=!0,qe.keepFreeFloatingNodes=!0;const ke=yield ye.expand(ze,qe),q=Object.keys(ze).map(de=>O(Me,de,{vocab:!0}));qe.merged=!q.includes("@graph"),qe.is11=$(Me,1.1);const G=A(Ue,ke,qe);qe.graph=!Le.omitGraph,qe.skipExpansion=!0,qe.link={},qe.framing=!0;let pe=yield ye.compact(G,Ke,qe);return qe.link={},pe=z(pe,qe),pe});return function(Xe,ze,Le){return tt.apply(this,arguments)}}(),ye.link=function(){var tt=yt(function*(Xe,ze,Le){const Ke={};return ze&&(Ke["@context"]=ze),Ke["@embed"]="@link",ye.frame(Xe,Ke,Le)});return function(Xe,ze,Le){return tt.apply(this,arguments)}}(),ye.normalize=ye.canonize=function(){var tt=yt(function*(Xe,ze){if(arguments.length<1)throw new TypeError("Could not canonize, too few arguments.");if("inputFormat"in(ze=Qe(ze,{base:ue(Xe)?Xe:"",algorithm:"URDNA2015",skipExpansion:!1,contextResolver:new Q({sharedCache:st})}))){if("application/n-quads"!==ze.inputFormat&&"application/nquads"!==ze.inputFormat)throw new v("Unknown canonicalization input format.","jsonld.CanonizeError");const Me=R.parse(Xe);return W.canonize(Me,ze)}const Le=ot({},ze);delete Le.format,Le.produceGeneralizedRdf=!1;const Ke=yield ye.toRDF(Xe,Le);return W.canonize(Ke,ze)});return function(Xe,ze){return tt.apply(this,arguments)}}(),ye.fromRDF=function(){var tt=yt(function*(Xe,ze){if(arguments.length<1)throw new TypeError("Could not convert from RDF, too few arguments.");ze=Qe(ze,{format:ue(Xe)?"application/n-quads":void 0});const{format:Le}=ze;let{rdfParser:Ke}=ze;if(Le){if(Ke=Ke||Oe[Le],!Ke)throw new v("Unknown input format.","jsonld.UnknownFormat",{format:Le})}else Ke=()=>Xe;const Me=yield Ke(Xe);return y(Me,ze)});return function(Xe,ze){return tt.apply(this,arguments)}}(),ye.toRDF=function(){var tt=yt(function*(Xe,ze){if(arguments.length<1)throw new TypeError("Could not convert to RDF, too few arguments.");let Le;Le=(ze=Qe(ze,{base:ue(Xe)?Xe:"",skipExpansion:!1,contextResolver:new Q({sharedCache:st})})).skipExpansion?Xe:yield ye.expand(Xe,ze);const Ke=S(Le,ze);if(ze.format){if("application/n-quads"===ze.format||"application/nquads"===ze.format)return R.serialize(Ke);throw new v("Unknown output format.","jsonld.UnknownFormat",{format:ze.format})}return Ke});return function(Xe,ze){return tt.apply(this,arguments)}}(),ye.createNodeMap=function(){var tt=yt(function*(Xe,ze){if(arguments.length<1)throw new TypeError("Could not create node map, too few arguments.");ze=Qe(ze,{base:ue(Xe)?Xe:"",contextResolver:new Q({sharedCache:st})});const Le=yield ye.expand(Xe,ze);return te(Le,ze)});return function(Xe,ze){return tt.apply(this,arguments)}}(),ye.merge=function(){var tt=yt(function*(Xe,ze,Le){if(arguments.length<1)throw new TypeError("Could not merge, too few arguments.");if(!P(Xe))throw new TypeError('Could not merge, "docs" must be an array.');ze="function"==typeof ze?null:ze||null,Le=Qe(Le,{contextResolver:new Q({sharedCache:st})});const Ke=yield Promise.all(Xe.map(de=>{const je=ot({},Le);return ye.expand(de,je)}));let Me=!0;"mergeNodes"in Le&&(Me=Le.mergeNodes);const Ue=Le.issuer||new H("_:b"),qe={"@default":{}};for(let de=0;deye._documentLoader,set:tt=>ye._documentLoader=tt}),ye.documentLoader=function(){var tt=yt(function*(Xe){throw new v("Could not retrieve a JSON-LD document from the URL. URL dereferencing not implemented.","jsonld.LoadDocumentError",{code:"loading document failed",url:Xe})});return function(Xe){return tt.apply(this,arguments)}}(),ye.get=function(){var tt=yt(function*(Xe,ze){let Le;Le="function"==typeof ze.documentLoader?ze.documentLoader:ye.documentLoader;const Ke=yield Le(Xe);try{if(!Ke.document)throw new v("No remote document found at the given URL.","jsonld.NullRemoteDocument");ue(Ke.document)&&(Ke.document=JSON.parse(Ke.document))}catch(Me){throw new v("Could not retrieve a JSON-LD document from the URL.","jsonld.LoadDocumentError",{code:"loading document failed",cause:Me,remoteDoc:Ke})}return Ke});return function(Xe,ze){return tt.apply(this,arguments)}}(),ye.processContext=function(){var tt=yt(function*(Xe,ze,Le){return Le=Qe(Le,{base:"",contextResolver:new Q({sharedCache:st})}),null===ze?K(Le):(ze=k.clone(ze),X(ze)&&"@context"in ze||(ze={"@context":ze}),E({activeCtx:Xe,localCtx:ze,options:Le}))});return function(Xe,ze,Le){return tt.apply(this,arguments)}}(),ye.getContextValue=Y("./context").getContextValue,ye.documentLoaders={},ye.useDocumentLoader=function(tt){if(!(tt in ye.documentLoaders))throw new v('Unknown document loader type: "'+tt+'"',"jsonld.UnknownDocumentLoader",{type:tt});ye.documentLoader=ye.documentLoaders[tt].apply(ye,Array.prototype.slice.call(arguments,1))},ye.registerRDFParser=function(tt,Xe){Oe[tt]=Xe},ye.unregisterRDFParser=function(tt){delete Oe[tt]},ye.registerRDFParser("application/n-quads",R.parse),ye.registerRDFParser("application/nquads",R.parse),ye.url=Y("./url"),ye.util=k,Object.assign(ye,k),ye.promises=ye,ye.RequestQueue=Y("./RequestQueue"),ye.JsonLdProcessor=Y("./JsonLdProcessor")(ye),j.setupGlobals(ye),j.setupDocumentLoaders(ye),ye},ne=function(){return me(function(){return ne()})};me(ne),Se.exports=ne},{"./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,Se,he){"use strict";const{isKeyword:W}=Y("./context"),j=Y("./graphTypes"),k=Y("./types"),Q=Y("./util"),H=Y("./JsonLdError"),v={};Se.exports=v,v.createMergedNodeMap=(C,R)=>{const T=(R=R||{}).issuer||new Q.IdentifierIssuer("_:b"),b={"@default":{}};return v.createNodeMap(C,b,"@default",T),v.mergeNodeMaps(b)},v.createNodeMap=(C,R,T,b,y,S)=>{if(k.isArray(C)){for(const X of C)v.createNodeMap(X,R,T,b,void 0,S);return}if(!k.isObject(C))return void(S&&S.push(C));if(j.isValue(C)){if("@type"in C){let X=C["@type"];0===X.indexOf("_:")&&(C["@type"]=X=b.getId(X))}return void(S&&S.push(C))}if(S&&j.isList(C)){const X=[];return v.createNodeMap(C["@list"],R,T,b,y,X),void S.push({"@list":X})}if("@type"in C){const X=C["@type"];for(const ue of X)0===ue.indexOf("_:")&&b.getId(ue)}k.isUndefined(y)&&(y=j.isBlankNode(C)?b.getId(C["@id"]):C["@id"]),S&&S.push({"@id":y});const A=R[T],z=A[y]=A[y]||{};z["@id"]=y;const P=Object.keys(C).sort();for(let X of P){if("@id"===X)continue;if("@reverse"===X){const I={"@id":y},O=C["@reverse"];for(const K in O){const E=O[K];for(const $ of E){let Z=$["@id"];j.isBlankNode($)&&(Z=b.getId(Z)),v.createNodeMap($,R,T,b,Z),Q.addValue(A[Z],K,I,{propertyIsArray:!0,allowDuplicate:!1})}}continue}if("@graph"===X){y in R||(R[y]={}),v.createNodeMap(C[X],R,y,b);continue}if("@included"===X){v.createNodeMap(C[X],R,T,b);continue}if("@type"!==X&&W(X)){if("@index"===X&&X in z&&(C[X]!==z[X]||C[X]["@id"]!==z[X]["@id"]))throw new H("Invalid JSON-LD syntax; conflicting @index property detected.","jsonld.SyntaxError",{code:"conflicting indexes",subject:z});z[X]=C[X];continue}const ue=C[X];if(0===X.indexOf("_:")&&(X=b.getId(X)),0!==ue.length)for(let I of ue)if("@type"===X&&(I=0===I.indexOf("_:")?b.getId(I):I),j.isSubject(I)||j.isSubjectReference(I)){if("@id"in I&&!I["@id"])continue;const O=j.isBlankNode(I)?b.getId(I["@id"]):I["@id"];Q.addValue(z,X,{"@id":O},{propertyIsArray:!0,allowDuplicate:!1}),v.createNodeMap(I,R,T,b,O)}else if(j.isValue(I))Q.addValue(z,X,I,{propertyIsArray:!0,allowDuplicate:!1});else if(j.isList(I)){const O=[];v.createNodeMap(I["@list"],R,T,b,y,O),I={"@list":O},Q.addValue(z,X,I,{propertyIsArray:!0,allowDuplicate:!1})}else v.createNodeMap(I,R,T,b,y),Q.addValue(z,X,I,{propertyIsArray:!0,allowDuplicate:!1});else Q.addValue(z,X,[],{propertyIsArray:!0})}},v.mergeNodeMapGraphs=C=>{const R={};for(const T of Object.keys(C).sort())for(const b of Object.keys(C[T]).sort()){const y=C[T][b];b in R||(R[b]={"@id":b});const S=R[b];for(const A of Object.keys(y).sort())if(W(A)&&"@type"!==A)S[A]=Q.clone(y[A]);else for(const z of y[A])Q.addValue(S,A,Q.clone(z),{propertyIsArray:!0,allowDuplicate:!1})}return R},v.mergeNodeMaps=C=>{const R=C["@default"],T=Object.keys(C).sort();for(const b of T){if("@default"===b)continue;const y=C[b];let S=R[b];S?"@graph"in S||(S["@graph"]=[]):R[b]=S={"@id":b,"@graph":[]};const A=S["@graph"];for(const z of Object.keys(y).sort()){const P=y[z];j.isSubjectReference(P)||A.push(P)}}return R}},{"./JsonLdError":12,"./context":19,"./graphTypes":25,"./types":30,"./util":32}],28:[function(Y,Se,he){"use strict";const W=Y("./documentLoaders/xhr"),j={};Se.exports=j,j.setupDocumentLoaders=function(k){"undefined"!=typeof XMLHttpRequest&&(k.documentLoaders.xhr=W,k.useDocumentLoader("xhr"))},j.setupGlobals=function(k){void 0===globalThis.JsonLdProcessor&&Object.defineProperty(globalThis,"JsonLdProcessor",{writable:!0,enumerable:!1,configurable:!0,value:k.JsonLdProcessor})}},{"./documentLoaders/xhr":20}],29:[function(Y,Se,he){"use strict";const{createNodeMap:W}=Y("./nodeMap"),{isKeyword:j}=Y("./context"),k=Y("./graphTypes"),Q=Y("canonicalize"),H=Y("./types"),v=Y("./util"),{RDF_FIRST:C,RDF_REST:R,RDF_NIL:T,RDF_TYPE:b,RDF_JSON_LITERAL:y,RDF_LANGSTRING:S,XSD_BOOLEAN:A,XSD_DOUBLE:z,XSD_INTEGER:P,XSD_STRING:X}=Y("./constants"),{isAbsolute:ue}=Y("./url"),I={};function O($,Z,ae,oe,te){const Te=Object.keys(Z).sort();for(const me of Te){const ne=Z[me],ye=Object.keys(ne).sort();for(let Oe of ye){const $e=ne[Oe];if("@type"===Oe)Oe=b;else if(j(Oe))continue;for(const st of $e){const Qe={termType:me.startsWith("_:")?"BlankNode":"NamedNode",value:me};if(!ue(me))continue;const tt={termType:Oe.startsWith("_:")?"BlankNode":"NamedNode",value:Oe};if(!ue(Oe)||"BlankNode"===tt.termType&&!te.produceGeneralizedRdf)continue;const Xe=E(st,oe,$,ae,te.rdfDirection);Xe&&$.push({subject:Qe,predicate:tt,object:Xe,graph:ae})}}}}function E($,Z,ae,oe,te){const Te={};if(k.isValue($)){Te.termType="Literal",Te.value=void 0,Te.datatype={termType:"NamedNode"};let me=$["@value"];const ne=$["@type"]||null;"@json"===ne?(Te.value=Q(me),Te.datatype.value=y):H.isBoolean(me)?(Te.value=me.toString(),Te.datatype.value=ne||A):H.isDouble(me)||ne===z?(H.isDouble(me)||(me=parseFloat(me)),Te.value=me.toExponential(15).replace(/(\d)0*e\+?/,"$1E"),Te.datatype.value=ne||z):H.isNumber(me)?(Te.value=me.toFixed(0),Te.datatype.value=ne||P):"i18n-datatype"===te&&"@direction"in $?(Te.datatype.value="https://www.w3.org/ns/i18n#"+($["@language"]||"")+`_${$["@direction"]}`,Te.value=me):"@language"in $?(Te.value=me,Te.datatype.value=ne||S,Te.language=$["@language"]):(Te.value=me,Te.datatype.value=ne||X)}else if(k.isList($)){const me=function($,Z,ae,oe,te){const Te={termType:"NamedNode",value:C},me={termType:"NamedNode",value:R},ne={termType:"NamedNode",value:T},ye=$.pop(),Oe=ye?{termType:"BlankNode",value:Z.getId()}:ne;let $e=Oe;for(const st of $){const Qe=E(st,Z,ae,oe,te),tt={termType:"BlankNode",value:Z.getId()};ae.push({subject:$e,predicate:Te,object:Qe,graph:oe}),ae.push({subject:$e,predicate:me,object:tt,graph:oe}),$e=tt}if(ye){const st=E(ye,Z,ae,oe,te);ae.push({subject:$e,predicate:Te,object:st,graph:oe}),ae.push({subject:$e,predicate:me,object:ne,graph:oe})}return Oe}($["@list"],Z,ae,oe,te);Te.termType=me.termType,Te.value=me.value}else{const me=H.isObject($)?$["@id"]:$;Te.termType=me.startsWith("_:")?"BlankNode":"NamedNode",Te.value=me}return"NamedNode"!==Te.termType||ue(Te.value)?Te:null}Se.exports=I,I.toRDF=($,Z)=>{const ae=new v.IdentifierIssuer("_:b"),oe={"@default":{}};W($,oe,"@default",ae);const te=[],Te=Object.keys(oe).sort();for(const me of Te){let ne;if("@default"===me)ne={termType:"DefaultGraph",value:""};else{if(!ue(me))continue;ne=me.startsWith("_:")?{termType:"BlankNode"}:{termType:"NamedNode"},ne.value=me}O(te,oe[me],ne,ae,Z)}return te}},{"./constants":18,"./context":19,"./graphTypes":25,"./nodeMap":27,"./types":30,"./url":31,"./util":32,canonicalize:7}],30:[function(Y,Se,he){"use strict";const W={};Se.exports=W,W.isArray=Array.isArray,W.isBoolean=j=>"boolean"==typeof j||"[object Boolean]"===Object.prototype.toString.call(j),W.isDouble=j=>W.isNumber(j)&&(-1!==String(j).indexOf(".")||Math.abs(j)>=1e21),W.isEmptyObject=j=>W.isObject(j)&&0===Object.keys(j).length,W.isNumber=j=>"number"==typeof j||"[object Number]"===Object.prototype.toString.call(j),W.isNumeric=j=>!isNaN(parseFloat(j))&&isFinite(j),W.isObject=j=>"[object Object]"===Object.prototype.toString.call(j),W.isString=j=>"string"==typeof j||"[object String]"===Object.prototype.toString.call(j),W.isUndefined=j=>void 0===j},{}],31:[function(Y,Se,he){"use strict";const W=Y("./types"),j={};Se.exports=j,j.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*))?))?(?:(((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/}},j.parse=(Q,H)=>{const v={},C=j.parsers[H||"full"],R=C.regex.exec(Q);let T=C.keys.length;for(;T--;)v[C.keys[T]]=void 0===R[T]?null:R[T];return("https"===v.scheme&&"443"===v.port||"http"===v.scheme&&"80"===v.port)&&(v.href=v.href.replace(":"+v.port,""),v.authority=v.authority.replace(":"+v.port,""),v.port=null),v.normalizedPath=j.removeDotSegments(v.path),v},j.prependBase=(Q,H)=>{if(null===Q||j.isAbsolute(H))return H;(!Q||W.isString(Q))&&(Q=j.parse(Q||""));const v=j.parse(H),C={protocol:Q.protocol||""};if(null!==v.authority)C.authority=v.authority,C.path=v.path,C.query=v.query;else if(C.authority=Q.authority,""===v.path)C.path=Q.path,C.query=null!==v.query?v.query:Q.query;else{if(0===v.path.indexOf("/"))C.path=v.path;else{let T=Q.path;T=T.substr(0,T.lastIndexOf("/")+1),(T.length>0||Q.authority)&&"/"!==T.substr(-1)&&(T+="/"),T+=v.path,C.path=T}C.query=v.query}""!==v.path&&(C.path=j.removeDotSegments(C.path));let R=C.protocol;return null!==C.authority&&(R+="//"+C.authority),R+=C.path,null!==C.query&&(R+="?"+C.query),null!==v.fragment&&(R+="#"+v.fragment),""===R&&(R="./"),R},j.removeBase=(Q,H)=>{if(null===Q)return H;(!Q||W.isString(Q))&&(Q=j.parse(Q||""));let v="";if(""!==Q.href?v+=(Q.protocol||"")+"//"+(Q.authority||""):H.indexOf("//")&&(v+="//"),0!==H.indexOf(v))return H;const C=j.parse(H.substr(v.length)),R=Q.normalizedPath.split("/"),T=C.normalizedPath.split("/"),b=C.fragment||C.query?0:1;for(;R.length>0&&T.length>b&&R[0]===T[0];)R.shift(),T.shift();let y="";if(R.length>0){R.pop();for(let S=0;S{if(0===Q.length)return"";const H=Q.split("/"),v=[];for(;H.length>0;){const C=H.shift(),R=0===H.length;"."!==C?".."!==C?v.push(C):(v.pop(),R&&v.push("")):R&&v.push("")}return"/"===Q[0]&&v.length>0&&""!==v[0]&&v.unshift(""),1===v.length&&""===v[0]?"/":v.join("/")};const k=/^([A-Za-z][A-Za-z0-9+-.]*|_):[^\s]*$/;j.isAbsolute=Q=>W.isString(Q)&&k.test(Q),j.isRelative=Q=>W.isString(Q)},{"./types":30}],32:[function(Y,Se,he){"use strict";const W=Y("./graphTypes"),j=Y("./types"),k=Y("rdf-canonize").IdentifierIssuer,Q=Y("./JsonLdError"),H=/(?:<[^>]*?>|"[^"]*?"|[^,])+/g,v=/\s*<([^>]*?)>\s*(?:;\s*(.*))?/,C=/(.*?)=(?:(?:"([^"]*?)")|([^"]*?))\s*(?:(?:;\s*)|$)/g,R_headers={accept:"application/ld+json, application/json"},T={};function b(y,S){if(j.isArray(S))for(let A=0;A{if(Object.keys(y).some(A=>"accept"===A.toLowerCase()))throw new RangeError('Accept header may not be specified; only "'+R_headers.accept+'" is supported.');return Object.assign({Accept:R_headers.accept},y)},T.parseLinkHeader=y=>{const S={},A=y.match(H);for(let z=0;z{if(!(j.isString(y)||j.isArray(y)&&y.every(A=>j.isString(A)))){if(S&&j.isObject(y))switch(Object.keys(y).length){case 0:return;case 1:if("@default"in y&&T.asArray(y["@default"]).every(A=>j.isString(A)))return}throw new Q('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,S)=>{if(y.hasOwnProperty(S)){const A=y[S];return!j.isArray(A)||A.length>0}return!1},T.hasValue=(y,S,A)=>{if(T.hasProperty(y,S)){let z=y[S];const P=W.isList(z);if(j.isArray(z)||P){P&&(z=z["@list"]);for(let X=0;X{if("propertyIsArray"in(z=z||{})||(z.propertyIsArray=!1),"valueIsArray"in z||(z.valueIsArray=!1),"allowDuplicate"in z||(z.allowDuplicate=!0),"prependValue"in z||(z.prependValue=!1),z.valueIsArray)y[S]=A;else if(j.isArray(A)){0===A.length&&z.propertyIsArray&&!y.hasOwnProperty(S)&&(y[S]=[]),z.prependValue&&(A=A.concat(y[S]),y[S]=[]);for(let P=0;P[].concat(y[S]||[]),T.removeProperty=(y,S)=>{delete y[S]},T.removeValue=(y,S,A,z)=>{"propertyIsArray"in(z=z||{})||(z.propertyIsArray=!1);const P=T.getValues(y,S).filter(X=>!T.compareValues(X,A));0===P.length?T.removeProperty(y,S):y[S]=1!==P.length||z.propertyIsArray?P:P[0]},T.relabelBlankNodes=(y,S)=>b((S=S||{}).issuer||new k("_:b"),y),T.compareValues=(y,S)=>!!(y===S||W.isValue(y)&&W.isValue(S)&&y["@value"]===S["@value"]&&y["@type"]===S["@type"]&&y["@language"]===S["@language"]&&y["@index"]===S["@index"])||!!(j.isObject(y)&&"@id"in y&&j.isObject(S)&&"@id"in S)&&y["@id"]===S["@id"],T.compareShortestLeast=(y,S)=>y.length1;const z=(K,E,$)=>{const Z=K[b].get(E);if(Z){const ae=Z.value;if(P(K,ae)){if(ue(K,Z),!K[H])return}else $&&(K[y]&&(Z.value.now=Date.now()),K[T].unshiftNode(Z));return ae.value}},P=(K,E)=>{if(!E||!E.maxAge&&!K[v])return!1;const $=Date.now()-E.now;return E.maxAge?$>E.maxAge:K[v]&&$>K[v]},X=K=>{if(K[k]>K[j])for(let E=K[T].tail;K[k]>K[j]&&null!==E;){const $=E.prev;ue(K,E),E=$}},ue=(K,E)=>{if(E){const $=E.value;K[C]&&K[C]($.key,$.value),K[k]-=$.length,K[b].delete($.key),K[T].removeNode(E)}};class I{constructor(E,$,Z,ae,oe){this.key=E,this.value=$,this.length=Z,this.now=ae,this.maxAge=oe||0}}const O=(K,E,$,Z)=>{let ae=$.value;P(K,ae)&&(ue(K,$),K[H]||(ae=void 0)),ae&&E.call(Z,ae.value,ae.key,K)};Se.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[j]=E.max||1/0;const Z=E.length||S;if(this[Q]="function"!=typeof Z?S:Z,this[H]=E.stale||!1,E.maxAge&&"number"!=typeof E.maxAge)throw new TypeError("maxAge must be a number");this[v]=E.maxAge||0,this[C]=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[j]=E||1/0,X(this)}get max(){return this[j]}set allowStale(E){this[H]=!!E}get allowStale(){return this[H]}set maxAge(E){if("number"!=typeof E)throw new TypeError("maxAge must be a non-negative number");this[v]=E,X(this)}get maxAge(){return this[v]}set lengthCalculator(E){"function"!=typeof E&&(E=S),E!==this[Q]&&(this[Q]=E,this[k]=0,this[T].forEach($=>{$.length=this[Q]($.value,$.key),this[k]+=$.length})),X(this)}get lengthCalculator(){return this[Q]}get length(){return this[k]}get itemCount(){return this[T].length}rforEach(E,$){$=$||this;for(let Z=this[T].tail;null!==Z;){const ae=Z.prev;O(this,E,Z,$),Z=ae}}forEach(E,$){$=$||this;for(let Z=this[T].head;null!==Z;){const ae=Z.next;O(this,E,Z,$),Z=ae}}keys(){return this[T].toArray().map(E=>E.key)}values(){return this[T].toArray().map(E=>E.value)}reset(){this[C]&&this[T]&&this[T].length&&this[T].forEach(E=>this[C](E.key,E.value)),this[b]=new Map,this[T]=new W,this[k]=0}dump(){return this[T].map(E=>!P(this,E)&&{k:E.key,v:E.value,e:E.now+(E.maxAge||0)}).toArray().filter(E=>E)}dumpLru(){return this[T]}set(E,$,Z){if((Z=Z||this[v])&&"number"!=typeof Z)throw new TypeError("maxAge must be a number");const ae=Z?Date.now():0,oe=this[Q]($,E);if(this[b].has(E)){if(oe>this[j])return ue(this,this[b].get(E)),!1;const me=this[b].get(E).value;return this[C]&&(this[R]||this[C](E,me.value)),me.now=ae,me.maxAge=Z,me.value=$,this[k]+=oe-me.length,me.length=oe,this.get(E),X(this),!0}const te=new I(E,$,oe,ae,Z);return te.length>this[j]?(this[C]&&this[C](E,$),!1):(this[k]+=te.length,this[T].unshift(te),this[b].set(E,this[T].head),X(this),!0)}has(E){if(!this[b].has(E))return!1;const $=this[b].get(E).value;return!P(this,$)}get(E){return z(this,E,!0)}peek(E){return z(this,E,!1)}pop(){const E=this[T].tail;return E?(ue(this,E),E.value):null}del(E){ue(this,this[b].get(E))}load(E){this.reset();const $=Date.now();for(let Z=E.length-1;Z>=0;Z--){const ae=E[Z],oe=ae.e||0;if(0===oe)this.set(ae.k,ae.v);else{const te=oe-$;te>0&&this.set(ae.k,ae.v,te)}}}prune(){this[b].forEach((E,$)=>z(this,$,!1))}}},{yallist:92}],34:[function(Y,Se,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#",j="http://www.w3.org/2001/XMLSchema#",k="http://www.w3.org/2000/10/swap/";he.default={xsd:{decimal:`${j}decimal`,boolean:`${j}boolean`,double:`${j}double`,integer:`${j}integer`,string:`${j}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:`${k}reify#forSome`,forAll:`${k}reify#forAll`},log:{implies:`${k}log#implies`}}},{}],35:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.default=he.Variable=he.Triple=he.Term=he.Quad=he.NamedNode=he.Literal=he.DefaultGraph=he.BlankNode=void 0,he.escapeQuotes=E,he.termFromId=function I(ne,ye){if(ye=ye||b,!ne)return ye.defaultGraph();switch(ne[0]){case"?":return ye.variable(ne.substr(1));case"_":return ye.blankNode(ne.substr(2));case'"':if(ye===b)return new z(ne);if('"'===ne[ne.length-1])return ye.literal(ne.substr(1,ne.length-2));const Oe=ne.lastIndexOf('"',ne.length-1);return ye.literal(ne.substr(1,Oe-1),"@"===ne[Oe+1]?ne.substr(Oe+2):ye.namedNode(ne.substr(Oe+3)));case"<":const $e=T.exec(ne);return ye.quad(I($($e[1]),ye),I($($e[2]),ye),I($($e[3]),ye),$e[4]&&I($($e[4]),ye));default:return ye.namedNode(ne)}},he.termToId=function O(ne){if("string"==typeof ne)return ne;if(ne instanceof S&&"Quad"!==ne.termType)return ne.id;if(!ne)return v.id;switch(ne.termType){case"NamedNode":return ne.value;case"BlankNode":return`_:${ne.value}`;case"Variable":return`?${ne.value}`;case"DefaultGraph":return"";case"Literal":return`"${ne.value}"${ne.language?`@${ne.language}`:ne.datatype&&ne.datatype.value!==H.string?`^^${ne.datatype.value}`:""}`;case"Quad":return`<<${E(O(ne.subject))} ${E(O(ne.predicate))} ${E(O(ne.object))}${(0,j.isDefaultGraph)(ne.graph)?"":` ${O(ne.graph)}`}>>`;default:throw new Error(`Unexpected termType: ${ne.termType}`)}},he.unescapeQuotes=$;var ne,W=(ne=Y("./IRIs"))&&ne.__esModule?ne:{default:ne},j=Y("./N3Util");const{rdf:Q,xsd:H}=W.default;let v,C=0;const R=/^"(.*".*)(?="[^"]*$)/,T=/^<<("(?:""|[^"])*"[^ ]*|[^ ]+) ("(?:""|[^"])*"[^ ]*|[^ ]+) ("(?:""|[^"])*"[^ ]*|[^ ]+) ?("(?:""|[^"])*"[^ ]*|[^ ]+)?>>$/,b={namedNode:function(ne){return new A(ne)},blankNode:function(ne){return new P(ne||"n3-"+C++)},variable:function(ne){return new X(ne)},literal:function(ne,ye){if("string"==typeof ye)return new z(`"${ne}"@${ye.toLowerCase()}`);let Oe=ye?ye.value:"";return""===Oe&&("boolean"==typeof ne?Oe=H.boolean:"number"==typeof ne&&(Number.isFinite(ne)?Oe=Number.isInteger(ne)?H.integer:H.double:(Oe=H.double,Number.isNaN(ne)||(ne=ne>0?"INF":"-INF")))),new z(""===Oe||Oe===H.string?`"${ne}"`:`"${ne}"^^${Oe}`)},defaultGraph:function(){return v},quad:me,triple:me};he.default=b;class S{constructor(ye){this.id=ye}get value(){return this.id}equals(ye){return ye instanceof S?this.id===ye.id:!!ye&&this.termType===ye.termType&&this.value===ye.value}hashCode(){return 0}toJSON(){return{termType:this.termType,value:this.value}}}he.Term=S;class A extends S{get termType(){return"NamedNode"}}he.NamedNode=A;class z extends S{get termType(){return"Literal"}get value(){return this.id.substring(1,this.id.lastIndexOf('"'))}get language(){const ye=this.id;let Oe=ye.lastIndexOf('"')+1;return Oe`"${Oe.replace(/"/g,'""')}`)}function $(ne){return ne.replace(R,(ye,Oe)=>`"${Oe.replace(/""/g,'"')}`)}function me(ne,ye,Oe,$e){return new K(ne,ye,Oe,$e)}he.Triple=he.Quad=K},{"./IRIs":34,"./N3Util":41}],36:[function(Y,Se,he){(function(W){(function(){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.default=void 0;var j=Q(Y("./IRIs")),k=Q(Y("queue-microtask"));function Q(S){return S&&S.__esModule?S:{default:S}}const{xsd:H}=j.default,v=/\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{8})|\\([^])/g,C={"\\":"\\","'":"'",'"':'"',n:"\n",r:"\r",t:"\t",f:"\f",b:"\b",_:"_","~":"~",".":".","-":"-","!":"!",$:"$","&":"&","(":"(",")":")","*":"*","+":"+",",":",",";":";","=":"=","/":"/","?":"?","#":"#","@":"@","%":"%"},R=/[\x00-\x20<>\\"\{\}\|\^\`]/,T={_iri:!0,_unescapedIri:!0,_simpleQuotedString:!0,_langcode:!0,_blank:!0,_newline:!0,_comment:!0,_whitespace:!0,_endOfFile:!0},b=/$0^/;he.default=class{constructor(A){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=!!(A=A||{}).lineMode){this._n3Mode=!1;for(const z in this)!(z in T)&&this[z]instanceof RegExp&&(this[z]=b)}else this._n3Mode=!1!==A.n3;this._comments=!!A.comments,this._literalClosingPos=0}_tokenizeToEnd(A,z){let P=this._input,X=P.length;for(;;){let O,K;for(;O=this._newline.exec(P);)this._comments&&(K=this._comment.exec(O[0]))&&ue("comment",K[1],"",this._line,O[0].length),P=P.substr(O[0].length,P.length),X=P.length,this._line++;if(!O&&(O=this._whitespace.exec(P))&&(P=P.substr(O[0].length,P.length)),this._endOfFile.test(P))return z&&(this._comments&&(K=this._comment.exec(P))&&ue("comment",K[1],"",this._line,P.length),P=null,ue("eof","","",this._line,0)),this._input=P;const E=this._line,$=P[0];let Z="",ae="",oe="",te=null,Te=0,me=!1;switch($){case"^":if(P.length<3)break;if("^"!==P[1]){this._n3Mode&&(Te=1,Z="^");break}if(this._previousMarker="^^",P=P.substr(2),"<"!==P[0]){me=!0;break}case"<":if(te=this._unescapedIri.exec(P))Z="IRI",ae=te[1];else if(te=this._iri.exec(P)){if(ae=this._unescape(te[1]),null===ae||R.test(ae))return I(this);Z="IRI"}else P.length>1&&"<"===P[1]?(Z="<<",Te=2):this._n3Mode&&P.length>1&&"="===P[1]&&(Z="inverse",Te=2,ae=">");break;case">":P.length>1&&">"===P[1]&&(Z=">>",Te=2);break;case"_":((te=this._blank.exec(P))||z&&(te=this._blank.exec(`${P} `)))&&(Z="blank",oe="_",ae=te[1]);break;case'"':if(te=this._simpleQuotedString.exec(P))ae=te[1];else if(({value:ae,matchLength:Te}=this._parseLiteral(P)),null===ae)return I(this);(null!==te||0!==Te)&&(Z="literal",this._literalClosingPos=0);break;case"'":if(!this._lineMode){if(te=this._simpleApostropheString.exec(P))ae=te[1];else if(({value:ae,matchLength:Te}=this._parseLiteral(P)),null===ae)return I(this);(null!==te||0!==Te)&&(Z="literal",this._literalClosingPos=0)}break;case"?":this._n3Mode&&(te=this._variable.exec(P))&&(Z="var",ae=te[0]);break;case"@":"literal"===this._previousMarker&&(te=this._langcode.exec(P))?(Z="langcode",ae=te[1]):(te=this._keyword.exec(P))&&(Z=te[0]);break;case".":if(1===P.length?z:P[1]<"0"||P[1]>"9"){Z=".",Te=1;break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"+":case"-":(te=this._number.exec(P)||z&&(te=this._number.exec(`${P} `)))&&(Z="literal",ae=te[0],oe="string"==typeof te[1]?H.double:"string"==typeof te[2]?H.decimal:H.integer);break;case"B":case"b":case"p":case"P":case"G":case"g":(te=this._sparqlKeyword.exec(P))?Z=te[0].toUpperCase():me=!0;break;case"f":case"t":(te=this._boolean.exec(P))?(Z="literal",ae=te[0],oe=H.boolean):me=!0;break;case"a":(te=this._shortPredicates.exec(P))?(Z="abbreviation",ae="a"):me=!0;break;case"=":this._n3Mode&&P.length>1&&(Z="abbreviation",">"!==P[1]?(Te=1,ae="="):(Te=2,ae=">"));break;case"!":if(!this._n3Mode)break;case",":case";":case"[":case"]":case"(":case")":case"{":case"}":this._lineMode||(Te=1,Z=$);break;default:me=!0}if(me&&("@prefix"!==this._previousMarker&&"PREFIX"!==this._previousMarker||!(te=this._prefix.exec(P))?((te=this._prefixed.exec(P))||z&&(te=this._prefixed.exec(`${P} `)))&&(Z="prefixed",oe=te[1]||"",ae=this._unescape(te[2])):(Z="prefix",ae=te[1]||"")),"^^"===this._previousMarker)switch(Z){case"prefixed":Z="type";break;case"IRI":Z="typeIRI";break;default:Z=""}if(!Z)return z||!/^'''|^"""/.test(P)&&/\n|\r/.test(P)?I(this):this._input=P;const ne=Te||te[0].length,ye=ue(Z,ae,oe,E,ne);this.previousToken=ye,this._previousMarker=Z,P=P.substr(ne,P.length)}function ue(O,K,E,$,Z){const ae=P?X-P.length:X,te={type:O,value:K,prefix:E,line:$,start:ae,end:ae+Z};return A(null,te),te}function I(O){A(O._syntaxError(/^\S*/.exec(P)[0]))}}_unescape(A){let z=!1;const P=A.replace(v,(X,ue,I,O)=>{if("string"==typeof ue)return String.fromCharCode(Number.parseInt(ue,16));if("string"==typeof I){let K=Number.parseInt(I,16);return K<=65535?String.fromCharCode(Number.parseInt(I,16)):String.fromCharCode(55296+((K-=65536)>>10),56320+(1023&K))}return O in C?C[O]:(z=!0,"")});return z?null:P}_parseLiteral(A){if(A.length>=3){const z=A.match(/^(?:"""|"|'''|'|)/)[0],P=z.length;let X=Math.max(this._literalClosingPos,P);for(;(X=A.indexOf(z,X))>0;){let ue=0;for(;"\\"===A[X-ue-1];)ue++;if(ue%2==0){const I=A.substring(P,X),O=I.split(/\r\n|\r|\n/).length-1,K=X+P;if(1===P&&0!==O||3===P&&this._lineMode)break;return this._line+=O,{value:this._unescape(I),matchLength:K}}X++}this._literalClosingPos=A.length-P+1}return{value:"",matchLength:0}}_syntaxError(A){this._input=null;const z=new Error(`Unexpected "${A}" on line ${this._line}.`);return z.context={token:void 0,line:this._line,previousToken:this.previousToken},z}_readStartingBom(A){return A.startsWith("\ufeff")?A.substr(1):A}tokenize(A,z){if(this._line=1,"string"==typeof A){if(this._input=this._readStartingBom(A),"function"!=typeof z){const P=[];let X;if(this._tokenizeToEnd((ue,I)=>ue?X=ue:P.push(I),!0),X)throw X;return P}(0,k.default)(()=>this._tokenizeToEnd(z,!0))}else this._pendingBuffer=null,"function"==typeof A.setEncoding&&A.setEncoding("utf8"),A.on("data",P=>{null!==this._input&&0!==P.length&&(this._pendingBuffer&&(P=W.concat([this._pendingBuffer,P]),this._pendingBuffer=null),128&P[P.length-1]?this._pendingBuffer=P:(void 0===this._input?this._input=this._readStartingBom("string"==typeof P?P:P.toString()):this._input+=P,this._tokenizeToEnd(z,!1)))}),A.on("end",()=>{"string"==typeof this._input&&this._tokenizeToEnd(z,!0)}),A.on("error",z)}}}).call(this)}).call(this,Y("buffer").Buffer)},{"./IRIs":34,buffer:6,"queue-microtask":45}],37:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.default=void 0;var W=Q(Y("./N3Lexer")),j=Q(Y("./N3DataFactory")),k=Q(Y("./IRIs"));function Q(T){return T&&T.__esModule?T:{default:T}}let H=0;class v{constructor(b){this._contextStack=[],this._graph=null,this._setBase((b=b||{}).baseIRI),b.factory&&R(this,b.factory);const y="string"==typeof b.format?b.format.match(/\w*$/)[0].toLowerCase():"",S=/turtle/.test(y),A=/trig/.test(y),z=/triple/.test(y),P=/quad/.test(y),X=this._n3Mode=/n3/.test(y),ue=z||P;(this._supportsNamedGraphs=!(S||X))||(this._readPredicateOrNamedGraph=this._readPredicate),this._supportsQuads=!(S||A||z||X),this._supportsRDFStar=""===y||/star|\*$/.test(y),ue&&(this._resolveRelativeIRI=I=>null),this._blankNodePrefix="string"!=typeof b.blankNodePrefix?"":b.blankNodePrefix.replace(/^(?!_:)/,"_:"),this._lexer=b.lexer||new W.default({lineMode:ue,n3:X}),this._explicitQuantifiers=!!b.explicitQuantifiers}static _resetBlankNodePrefix(){H=0}_setBase(b){if(b){const y=b.indexOf("#");y>=0&&(b=b.substr(0,y)),this._base=b,this._basePath=b.indexOf("/")<0?b:b.replace(/[^\/?]*(?:\?.*)?$/,""),b=b.match(/^(?:([a-z][a-z0-9+.-]*:))?(?:\/\/[^\/]*)?/i),this._baseRoot=b[0],this._baseScheme=b[1]}else this._base="",this._basePath=""}_saveContext(b,y,S,A,z){const P=this._n3Mode;this._contextStack.push({subject:S,predicate:A,object:z,graph:y,type:b,inverse:!!P&&this._inversePredicate,blankPrefix:P?this._prefixes._:"",quantified:P?this._quantified:null}),P&&(this._inversePredicate=!1,this._prefixes._=this._graph?`${this._graph.id.substr(2)}.`:".",this._quantified=Object.create(this._quantified))}_restoreContext(){const b=this._contextStack.pop(),y=this._n3Mode;this._subject=b.subject,this._predicate=b.predicate,this._object=b.object,this._graph=b.graph,y&&(this._inversePredicate=b.inverse,this._prefixes._=b.blankPrefix,this._quantified=b.quantified)}_readInTopContext(b){switch(b.type){case"eof":return null!==this._graph?this._error("Unclosed graph",b):(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(b)}}_readEntity(b,y){let S;switch(b.type){case"IRI":case"typeIRI":const A=this._resolveIRI(b.value);if(null===A)return this._error("Invalid IRI",b);S=this._namedNode(A);break;case"type":case"prefixed":const z=this._prefixes[b.prefix];if(void 0===z)return this._error(`Undefined prefix "${b.prefix}:"`,b);S=this._namedNode(z+b.value);break;case"blank":S=this._blankNode(this._prefixes[b.prefix]+b.value);break;case"var":S=this._variable(b.value.substr(1));break;default:return this._error(`Expected entity but got ${b.type}`,b)}return!y&&this._n3Mode&&S.id in this._quantified&&(S=this._quantified[S.id]),S}_readSubject(b){switch(this._predicate=null,b.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",b);case"}":return this._readPunctuation(b);case"@forSome":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORSOME,this._quantifier=this._blankNode,this._readQuantifierList):this._error('Unexpected "@forSome"',b);case"@forAll":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORALL,this._quantifier=this._variable,this._readQuantifierList):this._error('Unexpected "@forAll"',b);case"literal":if(!this._n3Mode)return this._error("Unexpected literal",b);if(0===b.prefix.length)return this._literalValue=b.value,this._completeSubjectLiteral;this._subject=this._literal(b.value,this._namedNode(b.prefix));break;case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,null,null,null),this._graph=null,this._readSubject):this._error("Unexpected RDF* syntax",b);default:if(void 0===(this._subject=this._readEntity(b)))return;if(this._n3Mode)return this._getPathReader(this._readPredicateOrNamedGraph)}return this._readPredicateOrNamedGraph}_readPredicate(b){const y=b.type;switch(y){case"inverse":this._inversePredicate=!0;case"abbreviation":this._predicate=this.ABBREVIATIONS[b.value];break;case".":case"]":case"}":return null===this._predicate?this._error(`Unexpected ${y}`,b):(this._subject=null,"]"===y?this._readBlankNodeTail(b):this._readPunctuation(b));case";":return null!==this._predicate?this._readPredicate:this._error("Expected predicate but got ;",b);case"[":if(this._n3Mode)return this._saveContext("blank",this._graph,this._subject,this._subject=this._blankNode(),null),this._readBlankNodeHead;case"blank":if(!this._n3Mode)return this._error("Disallowed blank node as predicate",b);default:if(void 0===(this._predicate=this._readEntity(b)))return}return this._readObject}_readObject(b){switch(b.type){case"literal":if(0===b.prefix.length)return this._literalValue=b.value,this._readDataTypeOrLang;this._object=this._literal(b.value,this._namedNode(b.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",b);case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,this._subject,this._predicate,null),this._graph=null,this._readSubject):this._error("Unexpected RDF* syntax",b);default:if(void 0===(this._object=this._readEntity(b)))return;if(this._n3Mode)return this._getPathReader(this._getContextEndReader())}return this._getContextEndReader()}_readPredicateOrNamedGraph(b){return"{"===b.type?this._readGraph(b):this._readPredicate(b)}_readGraph(b){return"{"!==b.type?this._error(`Expected graph but got ${b.type}`,b):(this._graph=this._subject,this._subject=null,this._readSubject)}_readBlankNodeHead(b){return"]"===b.type?(this._subject=null,this._readBlankNodeTail(b)):(this._predicate=null,this._readPredicate(b))}_readBlankNodeTail(b){if("]"!==b.type)return this._readBlankNodePunctuation(b);null!==this._subject&&this._emit(this._subject,this._predicate,this._object,this._graph);const y=null===this._predicate;return this._restoreContext(),null!==this._object?this._getContextEndReader():null!==this._predicate?this._readObject:y?this._readPredicateOrNamedGraph:this._readPredicateAfterBlank}_readPredicateAfterBlank(b){switch(b.type){case".":case"}":return this._subject=null,this._readPunctuation(b);default:return this._readPredicate(b)}}_readListItem(b){let y=null,S=null,A=this._readListItem;const z=this._subject,P=this._contextStack,X=P[P.length-1];switch(b.type){case"[":this._saveContext("blank",this._graph,S=this._blankNode(),this.RDF_FIRST,this._subject=y=this._blankNode()),A=this._readBlankNodeHead;break;case"(":this._saveContext("list",this._graph,S=this._blankNode(),this.RDF_FIRST,this.RDF_NIL),this._subject=null;break;case")":if(this._restoreContext(),0!==P.length&&"list"===P[P.length-1].type&&this._emit(this._subject,this._predicate,this._object,this._graph),null===this._predicate){if(A=this._readPredicate,this._subject===this.RDF_NIL)return A}else if(A=this._getContextEndReader(),this._object===this.RDF_NIL)return A;S=this.RDF_NIL;break;case"literal":0===b.prefix.length?(this._literalValue=b.value,A=this._readListItemDataTypeOrLang):(y=this._literal(b.value,this._namedNode(b.prefix)),A=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",b);default:if(void 0===(y=this._readEntity(b)))return}if(null===S&&(this._subject=S=this._blankNode()),null===z?null===X.predicate?X.subject=S:X.object=S:this._emit(z,this.RDF_REST,S,this._graph),null!==y){if(this._n3Mode&&("IRI"===b.type||"prefixed"===b.type))return this._saveContext("item",this._graph,S,this.RDF_FIRST,y),this._subject=y,this._predicate=null,this._getPathReader(this._readListItem);this._emit(S,this.RDF_FIRST,y,this._graph)}return A}_readDataTypeOrLang(b){return this._completeObjectLiteral(b,!1)}_readListItemDataTypeOrLang(b){return this._completeObjectLiteral(b,!0)}_completeLiteral(b){let y=this._literal(this._literalValue);switch(b.type){case"type":case"typeIRI":const S=this._readEntity(b);if(void 0===S)return;y=this._literal(this._literalValue,S),b=null;break;case"langcode":y=this._literal(this._literalValue,b.value),b=null}return{token:b,literal:y}}_completeSubjectLiteral(b){return this._subject=this._completeLiteral(b).literal,this._readPredicateOrNamedGraph}_completeObjectLiteral(b,y){const S=this._completeLiteral(b);if(S)return this._object=S.literal,y&&this._emit(this._subject,this.RDF_FIRST,this._object,this._graph),null===S.token?this._getContextEndReader():(this._readCallback=this._getContextEndReader(),this._readCallback(S.token))}_readFormulaTail(b){return"}"!==b.type?this._readPunctuation(b):(null!==this._subject&&this._emit(this._subject,this._predicate,this._object,this._graph),this._restoreContext(),null===this._object?this._readPredicate:this._getContextEndReader())}_readPunctuation(b){let y,S=this._graph;const A=this._subject,z=this._inversePredicate;switch(b.type){case"}":if(null===this._graph)return this._error("Unexpected graph closing",b);if(this._n3Mode)return this._readFormulaTail(b);this._graph=null;case".":this._subject=null,y=this._contextStack.length?this._readSubject:this._readInTopContext,z&&(this._inversePredicate=!1);break;case";":y=this._readPredicate;break;case",":y=this._readObject;break;default:if(this._supportsQuads&&null===this._graph&&void 0!==(S=this._readEntity(b))){y=this._readQuadPunctuation;break}return this._error(`Expected punctuation to follow "${this._object.id}"`,b)}if(null!==A){const P=this._predicate,X=this._object;z?this._emit(X,P,A,S):this._emit(A,P,X,S)}return y}_readBlankNodePunctuation(b){let y;switch(b.type){case";":y=this._readPredicate;break;case",":y=this._readObject;break;default:return this._error(`Expected punctuation to follow "${this._object.id}"`,b)}return this._emit(this._subject,this._predicate,this._object,this._graph),y}_readQuadPunctuation(b){return"."!==b.type?this._error("Expected dot to follow quad",b):this._readInTopContext}_readPrefix(b){return"prefix"!==b.type?this._error("Expected prefix to follow @prefix",b):(this._prefix=b.value,this._readPrefixIRI)}_readPrefixIRI(b){if("IRI"!==b.type)return this._error(`Expected IRI to follow prefix "${this._prefix}:"`,b);const y=this._readEntity(b);return this._prefixes[this._prefix]=y.value,this._prefixCallback(this._prefix,y),this._readDeclarationPunctuation}_readBaseIRI(b){const y="IRI"===b.type&&this._resolveIRI(b.value);return y?(this._setBase(y),this._readDeclarationPunctuation):this._error("Expected valid IRI to follow base declaration",b)}_readNamedGraphLabel(b){switch(b.type){case"IRI":case"blank":case"prefixed":return this._readSubject(b),this._readGraph;case"[":return this._readNamedGraphBlankLabel;default:return this._error("Invalid graph label",b)}}_readNamedGraphBlankLabel(b){return"]"!==b.type?this._error("Invalid graph label",b):(this._subject=this._blankNode(),this._readGraph)}_readDeclarationPunctuation(b){return this._sparqlStyle?(this._sparqlStyle=!1,this._readInTopContext(b)):"."!==b.type?this._error("Expected declaration to end with a dot",b):this._readInTopContext}_readQuantifierList(b){let y;switch(b.type){case"IRI":case"prefixed":if(void 0!==(y=this._readEntity(b,!0)))break;default:return this._error(`Unexpected ${b.type}`,b)}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(b){return","===b.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(b))}_getPathReader(b){return this._afterPath=b,this._readPath}_readPath(b){switch(b.type){case"!":return this._readForwardPath;case"^":return this._readBackwardPath;default:const y=this._contextStack,S=y.length&&y[y.length-1];if(S&&"item"===S.type){const A=this._subject;this._restoreContext(),this._emit(this._subject,this.RDF_FIRST,A,this._graph)}return this._afterPath(b)}}_readForwardPath(b){let y,S;const A=this._blankNode();if(void 0!==(S=this._readEntity(b)))return null===this._predicate?(y=this._subject,this._subject=A):(y=this._object,this._object=A),this._emit(y,S,A,this._graph),this._readPath}_readBackwardPath(b){const y=this._blankNode();let S,A;if(void 0!==(S=this._readEntity(b)))return null===this._predicate?(A=this._subject,this._subject=y):(A=this._object,this._object=y),this._emit(y,S,A,this._graph),this._readPath}_readRDFStarTailOrGraph(b){return">>"!==b.type?this._supportsQuads&&null===this._graph&&void 0!==(this._graph=this._readEntity(b))?this._readRDFStarTail:this._error(`Expected >> to follow "${this._object.id}"`,b):this._readRDFStarTail(b)}_readRDFStarTail(b){if(">>"!==b.type)return this._error(`Expected >> but got ${b.type}`,b);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 b=this._contextStack;if(!b.length)return this._readPunctuation;switch(b[b.length-1].type){case"blank":return this._readBlankNodeTail;case"list":return this._readListItem;case"formula":return this._readFormulaTail;case"<<":return this._readRDFStarTailOrGraph}}_emit(b,y,S,A){this._callback(null,this._quad(b,y,S,A||this.DEFAULTGRAPH))}_error(b,y){const S=new Error(`${b} on line ${y.line}.`);S.context={token:y,line:y.line,previousToken:this._lexer.previousToken},this._callback(S),this._callback=C}_resolveIRI(b){return/^[a-z][a-z0-9+.-]*:/i.test(b)?b:this._resolveRelativeIRI(b)}_resolveRelativeIRI(b){if(!b.length)return this._base;switch(b[0]){case"#":return this._base+b;case"?":return this._base.replace(/(?:\?.*)?$/,b);case"/":return("/"===b[1]?this._baseScheme:this._baseRoot)+this._removeDotSegments(b);default:return/^[^/:]*:/.test(b)?null:this._removeDotSegments(this._basePath+b)}}_removeDotSegments(b){if(!/(^|\/)\.\.?($|[/#?])/.test(b))return b;const y=b.length;let S="",A=-1,z=-1,P=0,X="/";for(;A=z&&(S=S.substr(0,P)),"/"!==X)return`${S}/${b.substr(A+1)}`;P=A+1}}}X=b[++A]}return S+b.substring(P)}parse(b,y,S){if(this._readCallback=this._readInTopContext,this._sparqlStyle=!1,this._prefixes=Object.create(null),this._prefixes._=this._blankNodePrefix?this._blankNodePrefix.substr(2):`b${H++}_`,this._prefixCallback=S||C,this._inversePredicate=!1,this._quantified=Object.create(null),!y){const A=[];let z;if(this._callback=(P,X)=>{P?z=P:X&&A.push(X)},this._lexer.tokenize(b).every(P=>this._readCallback=this._readCallback(P)),z)throw z;return A}this._callback=y,this._lexer.tokenize(b,(A,z)=>{null!==A?(this._callback(A),this._callback=C):this._readCallback&&(this._readCallback=this._readCallback(z))})}}function C(){}function R(T,b){const y=b.namedNode;T._namedNode=y,T._blankNode=b.blankNode,T._literal=b.literal,T._variable=b.variable,T._quad=b.quad,T.DEFAULTGRAPH=b.defaultGraph(),T.RDF_FIRST=y(k.default.rdf.first),T.RDF_REST=y(k.default.rdf.rest),T.RDF_NIL=y(k.default.rdf.nil),T.N3_FORALL=y(k.default.r.forAll),T.N3_FORSOME=y(k.default.r.forSome),T.ABBREVIATIONS={a:y(k.default.rdf.type),"=":y(k.default.owl.sameAs),">":y(k.default.log.implies)},T.QUANTIFIERS_GRAPH=y("urn:n3:quantifiers")}he.default=v,R(v.prototype,j.default)},{"./IRIs":34,"./N3DataFactory":35,"./N3Lexer":36}],38:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.default=void 0;var b,W=function(b,y){if(!y&&b&&b.__esModule)return b;if(null===b||"object"!=typeof b&&"function"!=typeof b)return{default:b};var S=H(y);if(S&&S.has(b))return S.get(b);var A={},z=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var P in b)if("default"!==P&&Object.prototype.hasOwnProperty.call(b,P)){var X=z?Object.getOwnPropertyDescriptor(b,P):null;X&&(X.get||X.set)?Object.defineProperty(A,P,X):A[P]=b[P]}return A.default=b,S&&S.set(b,A),A}(Y("./N3DataFactory")),j=Y("readable-stream"),k=(b=Y("./IRIs"))&&b.__esModule?b:{default:b};function H(b){if("function"!=typeof WeakMap)return null;var y=new WeakMap,S=new WeakMap;return(H=function(A){return A?S:y})(b)}class C{constructor(y,S){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,!S&&y&&!y[0]&&(S=y,y=null),this._factory=(S=S||{}).factory||W.default,y&&this.addQuads(y)}get size(){let y=this._size;if(null!==y)return y;y=0;const S=this._graphs;let A,z;for(const P in S)for(const X in A=S[P].subjects)for(const ue in z=A[X])y+=Object.keys(z[ue]).length;return this._size=y}_addToIndex(y,S,A,z){const P=y[S]||(y[S]={}),X=P[A]||(P[A]={}),ue=z in X;return ue||(X[z]=null),!ue}_removeFromIndex(y,S,A,z){const P=y[S],X=P[A];delete X[z];for(const ue in X)return;delete P[A];for(const ue in P)return;delete y[S]}*_findInIndex(y,S,A,z,P,X,ue,I){let O,K,E;const Z=!S+!A+!z>1?Object.keys(this._ids):this._entities,ae=(0,W.termFromId)(I,this._factory);S&&((O=y,y={})[S]=O[S]);for(const oe in y){const te=Z[oe];if(K=y[oe]){A&&((O=K,K={})[A]=O[A]);for(const Te in K){const me=Z[Te];if(E=K[Te]){const ne=z?z in E?[z]:[]:Object.keys(E);for(let ye=0;ye{A in S||(S[A]=!0,y((0,W.termFromId)(this._entities[A],this._factory)))}}add(y){return this.addQuad(y),this}addQuad(y,S,A,z){S||(z=y.graph,A=y.object,S=y.predicate,y=y.subject),y=(0,W.termToId)(y),S=(0,W.termToId)(S),A=(0,W.termToId)(A),z=(0,W.termToId)(z);let P=this._graphs[z];P||(P=this._graphs[z]={subjects:{},predicates:{},objects:{}},Object.freeze(P));const X=this._ids,ue=this._entities;y=X[y]||(X[ue[++this._id]=y]=this._id),S=X[S]||(X[ue[++this._id]=S]=this._id),A=X[A]||(X[ue[++this._id]=A]=this._id);const I=this._addToIndex(P.subjects,y,S,A);return this._addToIndex(P.predicates,S,A,y),this._addToIndex(P.objects,A,y,S),this._size=null,I}addQuads(y){for(let S=0;S{this.addQuad(S)}),y}removeQuad(y,S,A,z){S||(z=y.graph,A=y.object,S=y.predicate,y=y.subject),y=(0,W.termToId)(y),S=(0,W.termToId)(S),A=(0,W.termToId)(A),z=(0,W.termToId)(z);const P=this._ids,X=this._graphs;let ue,I,O;if(!((y=P[y])&&(S=P[S])&&(A=P[A])&&(ue=X[z])&&(I=ue.subjects[y])&&(O=I[S])&&A in O))return!1;for(y in this._removeFromIndex(ue.subjects,y,S,A),this._removeFromIndex(ue.predicates,S,A,y),this._removeFromIndex(ue.objects,A,y,S),null!==this._size&&this._size--,ue.subjects)return!0;return delete X[z],!0}removeQuads(y){for(let S=0;S{this.removeQuad(S)}),y}removeMatches(y,S,A,z){const P=new j.Readable({objectMode:!0});return P._read=()=>{for(const X of this.readQuads(y,S,A,z))P.push(X);P.push(null)},this.remove(P)}deleteGraph(y){return this.removeMatches(null,null,null,y)}getQuads(y,S,A,z){return[...this.readQuads(y,S,A,z)]}*readQuads(y,S,A,z){y=y&&(0,W.termToId)(y),S=S&&(0,W.termToId)(S),A=A&&(0,W.termToId)(A),z=z&&(0,W.termToId)(z);const P=this._getGraphs(z),X=this._ids;let ue,I,O,K;if(!(R(y)&&!(I=X[y])||R(S)&&!(O=X[S])||R(A)&&!(K=X[A])))for(const E in P)(ue=P[E])&&(I?K?yield*this._findInIndex(ue.objects,K,I,O,"object","subject","predicate",E,null,!0):yield*this._findInIndex(ue.subjects,I,O,null,"subject","predicate","object",E,null,!0):O?yield*this._findInIndex(ue.predicates,O,K,null,"predicate","object","subject",E,null,!0):K?yield*this._findInIndex(ue.objects,K,null,null,"object","subject","predicate",E,null,!0):yield*this._findInIndex(ue.subjects,null,null,null,"subject","predicate","object",E,null,!0))}match(y,S,A,z){return new T(this,y,S,A,z)}countQuads(y,S,A,z){y=y&&(0,W.termToId)(y),S=S&&(0,W.termToId)(S),A=A&&(0,W.termToId)(A),z=z&&(0,W.termToId)(z);const P=this._getGraphs(z),X=this._ids;let I,O,K,E,ue=0;if(R(y)&&!(O=X[y])||R(S)&&!(K=X[S])||R(A)&&!(E=X[A]))return 0;for(const $ in P)(I=P[$])&&(ue+=y?A?this._countInIndex(I.objects,E,O,K):this._countInIndex(I.subjects,O,K,E):S?this._countInIndex(I.predicates,K,E,O):this._countInIndex(I.objects,E,O,K));return ue}forEach(y,S,A,z,P){this.some(X=>(y(X),!1),S,A,z,P)}every(y,S,A,z,P){let X=!1;const ue=!this.some(I=>(X=!0,!y(I)),S,A,z,P);return X&&ue}some(y,S,A,z,P){for(const X of this.readQuads(S,A,z,P))if(y(X))return!0;return!1}getSubjects(y,S,A){const z=[];return this.forSubjects(P=>{z.push(P)},y,S,A),z}forSubjects(y,S,A,z){S=S&&(0,W.termToId)(S),A=A&&(0,W.termToId)(A),z=z&&(0,W.termToId)(z);const P=this._ids,X=this._getGraphs(z);let ue,I,O;if(y=this._uniqueEntities(y),!(R(S)&&!(I=P[S])||R(A)&&!(O=P[A])))for(z in X)(ue=X[z])&&(I?O?this._loopBy2Keys(ue.predicates,I,O,y):this._loopByKey1(ue.subjects,I,y):O?this._loopByKey0(ue.objects,O,y):this._loop(ue.subjects,y))}getPredicates(y,S,A){const z=[];return this.forPredicates(P=>{z.push(P)},y,S,A),z}forPredicates(y,S,A,z){S=S&&(0,W.termToId)(S),A=A&&(0,W.termToId)(A),z=z&&(0,W.termToId)(z);const P=this._ids,X=this._getGraphs(z);let ue,I,O;if(y=this._uniqueEntities(y),!(R(S)&&!(I=P[S])||R(A)&&!(O=P[A])))for(z in X)(ue=X[z])&&(I?O?this._loopBy2Keys(ue.objects,O,I,y):this._loopByKey0(ue.subjects,I,y):O?this._loopByKey1(ue.predicates,O,y):this._loop(ue.predicates,y))}getObjects(y,S,A){const z=[];return this.forObjects(P=>{z.push(P)},y,S,A),z}forObjects(y,S,A,z){S=S&&(0,W.termToId)(S),A=A&&(0,W.termToId)(A),z=z&&(0,W.termToId)(z);const P=this._ids,X=this._getGraphs(z);let ue,I,O;if(y=this._uniqueEntities(y),!(R(S)&&!(I=P[S])||R(A)&&!(O=P[A])))for(z in X)(ue=X[z])&&(I?O?this._loopBy2Keys(ue.subjects,I,O,y):this._loopByKey1(ue.objects,I,y):O?this._loopByKey0(ue.predicates,O,y):this._loop(ue.objects,y))}getGraphs(y,S,A){const z=[];return this.forGraphs(P=>{z.push(P)},y,S,A),z}forGraphs(y,S,A,z){for(const P in this._graphs)this.some(X=>(y(X.graph),!0),S,A,z,P)}createBlankNode(y){let S,A;if(y)for(S=y=`_:${y}`,A=1;this._ids[S];)S=y+A++;else do{S="_:b"+this._blankNodeIndex++}while(this._ids[S]);return this._ids[S]=++this._id,this._entities[this._id]=S,this._factory.blankNode(S.substr(2))}extractLists({remove:y=!1,ignoreErrors:S=!1}={}){const A={},z=S?()=>!0:(ue,I)=>{throw new Error(`${ue.value} ${I}`)},P=this.getQuads(null,k.default.rdf.rest,k.default.rdf.nil,null),X=y?[...P]:[];return P.forEach(ue=>{const I=[];let K,E,O=!1;const $=ue.graph;let Z=ue.subject;for(;Z&&!O;){const ae=this.getQuads(null,null,Z,null),oe=this.getQuads(Z,null,null,null);let te,Te=null,me=null,ne=null;for(let ye=0;ye{switch(b){case"data":R=y;break;case"end":T=y}}},(b,y)=>{b&&this.emit("error",b)||y&&this.push(y)},(b,y)=>{this.emit("prefix",b,y)}),this._transform=(b,y,S)=>{R(b),S()},this._flush=b=>{T(),b()}}import(v){return v.on("data",C=>{this.write(C)}),v.on("end",()=>{this.end()}),v.on("error",C=>{this.emit("error",C)}),this}}},{"./N3Parser":37,"readable-stream":81}],40:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.default=void 0;var H,W=Y("readable-stream"),j=(H=Y("./N3Writer"))&&H.__esModule?H:{default:H};he.default=class extends W.Transform{constructor(v){super({encoding:"utf8",writableObjectMode:!0});const C=this._writer=new j.default({write:(R,T,b)=>{this.push(R),b&&b()},end:R=>{this.push(null),R&&R()}},v);this._transform=(R,T,b)=>{C.addQuad(R,b)},this._flush=R=>{C.end(R)}}import(v){return v.on("data",C=>{this.write(C)}),v.on("end",()=>{this.end()}),v.on("error",C=>{this.emit("error",C)}),v.on("prefix",(C,R)=>{this._writer.addPrefix(C,R)}),this}}},{"./N3Writer":42,"readable-stream":81}],41:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.inDefaultGraph=function(y){return C(y.graph)},he.isBlankNode=function(y){return!!y&&"BlankNode"===y.termType},he.isDefaultGraph=C,he.isLiteral=function(y){return!!y&&"Literal"===y.termType},he.isNamedNode=function(y){return!!y&&"NamedNode"===y.termType},he.isVariable=function(y){return!!y&&"Variable"===y.termType},he.prefix=function(y,S){return b({"":y.value||y},S)("")},he.prefixes=b;var y,W=(y=Y("./N3DataFactory"))&&y.__esModule?y:{default:y};function C(y){return!!y&&"DefaultGraph"===y.termType}function b(y,S){const A=Object.create(null);for(const P in y)z(P,y[P]);function z(P,X){if("string"==typeof X){const ue=Object.create(null);A[P]=I=>ue[I]||(ue[I]=S.namedNode(X+I))}else if(!(P in A))throw new Error(`Unknown prefix: ${P}`);return A[P]}return S=S||W.default,z}},{"./N3DataFactory":35}],42:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.default=void 0;var ue,W=(ue=Y("./IRIs"))&&ue.__esModule?ue:{default:ue},j=function(ue,I){if(!I&&ue&&ue.__esModule)return ue;if(null===ue||"object"!=typeof ue&&"function"!=typeof ue)return{default:ue};var O=Q(I);if(O&&O.has(ue))return O.get(ue);var K={},E=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var $ in ue)if("default"!==$&&Object.prototype.hasOwnProperty.call(ue,$)){var Z=E?Object.getOwnPropertyDescriptor(ue,$):null;Z&&(Z.get||Z.set)?Object.defineProperty(K,$,Z):K[$]=ue[$]}return K.default=ue,O&&O.set(ue,K),K}(Y("./N3DataFactory")),k=Y("./N3Util");function Q(ue){if("function"!=typeof WeakMap)return null;var I=new WeakMap,O=new WeakMap;return(Q=function(K){return K?O:I})(ue)}const C=j.default.defaultGraph(),{rdf:R,xsd:T}=W.default,b=/["\\\t\n\r\b\f\u0000-\u0019\ud800-\udbff]/,y=/["\\\t\n\r\b\f\u0000-\u0019]|[\ud800-\udbff][\udc00-\udfff]/g,S={"\\":"\\\\",'"':'\\"',"\t":"\\t","\n":"\\n","\r":"\\r","\b":"\\b","\f":"\\f"};class A extends j.Term{equals(){return!1}}function P(ue){let I=S[ue];return void 0===I&&(1===ue.length?(I=ue.charCodeAt(0).toString(16),I="\\u0000".substr(0,6-I.length)+I):(I=(1024*(ue.charCodeAt(0)-55296)+ue.charCodeAt(1)+9216).toString(16),I="\\U00000000".substr(0,10-I.length)+I)),I}function X(ue){return ue.replace(/[\]\/\(\)\*\+\?\.\\\$]/g,"\\$&")}he.default=class{constructor(I,O){if(this._prefixRegex=/$0^/,I&&"function"!=typeof I.write&&(O=I,I=null),this._lists=(O=O||{}).lists,I)this._outputStream=I,this._endStream=void 0===O.end||!!O.end;else{let K="";this._outputStream={write(E,$,Z){K+=E,Z&&Z()},end:E=>{E&&E(null,K)}},this._endStream=!0}this._subject=null,/triple|quad/i.test(O.format)?(this._lineMode=!0,this._writeQuad=this._writeQuadLine):(this._lineMode=!1,this._graph=C,this._prefixIRIs=Object.create(null),O.prefixes&&this.addPrefixes(O.prefixes),O.baseIRI&&(this._baseMatcher=new RegExp(`^${X(O.baseIRI)}${O.baseIRI.endsWith("/")?"":"[#?]"}`),this._baseLength=O.baseIRI.length))}get _inDefaultGraph(){return C.equals(this._graph)}_write(I,O){this._outputStream.write(I,"utf8",O)}_writeQuad(I,O,K,E,$){try{E.equals(this._graph)||(this._write((null===this._subject?"":this._inDefaultGraph?".\n":"\n}\n")+(C.equals(E)?"":`${this._encodeIriOrBlank(E)} {\n`)),this._graph=E,this._subject=null),I.equals(this._subject)?O.equals(this._predicate)?this._write(`, ${this._encodeObject(K)}`,$):this._write(`;\n ${this._encodePredicate(this._predicate=O)} ${this._encodeObject(K)}`,$):this._write(`${(null===this._subject?"":".\n")+this._encodeSubject(this._subject=I)} ${this._encodePredicate(this._predicate=O)} ${this._encodeObject(K)}`,$)}catch(Z){$&&$(Z)}}_writeQuadLine(I,O,K,E,$){delete this._prefixMatch,this._write(this.quadToString(I,O,K,E),$)}quadToString(I,O,K,E){return`${this._encodeSubject(I)} ${this._encodeIriOrBlank(O)} ${this._encodeObject(K)}${E&&E.value?` ${this._encodeIriOrBlank(E)} .\n`:" .\n"}`}quadsToString(I){return I.map(O=>this.quadToString(O.subject,O.predicate,O.object,O.graph)).join("")}_encodeSubject(I){return"Quad"===I.termType?this._encodeQuad(I):this._encodeIriOrBlank(I)}_encodeIriOrBlank(I){if("NamedNode"!==I.termType)return this._lists&&I.value in this._lists&&(I=this.list(this._lists[I.value])),"id"in I?I.id:`_:${I.value}`;let O=I.value;this._baseMatcher&&this._baseMatcher.test(O)&&(O=O.substr(this._baseLength)),b.test(O)&&(O=O.replace(y,P));const K=this._prefixRegex.exec(O);return K?K[1]?this._prefixIRIs[K[1]]+K[2]:O:`<${O}>`}_encodeLiteral(I){let O=I.value;if(b.test(O)&&(O=O.replace(y,P)),I.language)return`"${O}"@${I.language}`;if(this._lineMode){if(I.datatype.value===T.string)return`"${O}"`}else switch(I.datatype.value){case T.string:return`"${O}"`;case T.boolean:if("true"===O||"false"===O)return O;break;case T.integer:if(/^[+-]?\d+$/.test(O))return O;break;case T.decimal:if(/^[+-]?\d*\.\d+$/.test(O))return O;break;case T.double:if(/^[+-]?(?:\d+\.\d*|\.?\d+)[eE][+-]?\d+$/.test(O))return O}return`"${O}"^^${this._encodeIriOrBlank(I.datatype)}`}_encodePredicate(I){return I.value===R.type?"a":this._encodeIriOrBlank(I)}_encodeObject(I){switch(I.termType){case"Quad":return this._encodeQuad(I);case"Literal":return this._encodeLiteral(I);default:return this._encodeIriOrBlank(I)}}_encodeQuad({subject:I,predicate:O,object:K,graph:E}){return`<<${this._encodeSubject(I)} ${this._encodePredicate(O)} ${this._encodeObject(K)}${(0,k.isDefaultGraph)(E)?"":` ${this._encodeIriOrBlank(E)}`}>>`}_blockedWrite(){throw new Error("Cannot write because the writer has been closed.")}addQuad(I,O,K,E,$){void 0===K?this._writeQuad(I.subject,I.predicate,I.object,I.graph,O):"function"==typeof E?this._writeQuad(I,O,K,C,E):this._writeQuad(I,O,K,E||C,$)}addQuads(I){for(let O=0;O.\n`)}if(K){let E="",$="";for(const Z in this._prefixIRIs)E+=E?`|${Z}`:Z,$+=($?"|":"")+this._prefixIRIs[Z];E=X(E),this._prefixRegex=new RegExp(`^(?:${$})[^/]*$|^(${E})([a-zA-Z][\\-_a-zA-Z0-9]*)$`)}this._write(K?"\n":"",O)}blank(I,O){let E,$,K=I;switch(void 0===I?K=[]:I.termType?K=[{predicate:I,object:O}]:"length"in I||(K=[I]),$=K.length){case 0:return new A("[]");case 1:if(E=K[0],!(E.object instanceof A))return new A(`[ ${this._encodePredicate(E.predicate)} ${this._encodeObject(E.object)} ]`);default:let Z="[";for(let ae=0;ae<$;ae++)E=K[ae],E.predicate.equals(I)?Z+=`, ${this._encodeObject(E.object)}`:(Z+=`${(ae?";\n ":"\n ")+this._encodePredicate(E.predicate)} ${this._encodeObject(E.object)}`,I=E.predicate);return new A(`${Z}\n]`)}}list(I){const O=I&&I.length||0,K=new Array(O);for(let E=0;E{O=null,I(K,E)});if(this._endStream)try{return this._outputStream.end(O)}catch(K){}O&&O()}}},{"./IRIs":34,"./N3DataFactory":35,"./N3Util":41}],43:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),Object.defineProperty(he,"BlankNode",{enumerable:!0,get:function(){return R.BlankNode}}),Object.defineProperty(he,"DataFactory",{enumerable:!0,get:function(){return R.default}}),Object.defineProperty(he,"DefaultGraph",{enumerable:!0,get:function(){return R.DefaultGraph}}),Object.defineProperty(he,"Lexer",{enumerable:!0,get:function(){return W.default}}),Object.defineProperty(he,"Literal",{enumerable:!0,get:function(){return R.Literal}}),Object.defineProperty(he,"NamedNode",{enumerable:!0,get:function(){return R.NamedNode}}),Object.defineProperty(he,"Parser",{enumerable:!0,get:function(){return j.default}}),Object.defineProperty(he,"Quad",{enumerable:!0,get:function(){return R.Quad}}),Object.defineProperty(he,"Store",{enumerable:!0,get:function(){return Q.default}}),Object.defineProperty(he,"StreamParser",{enumerable:!0,get:function(){return H.default}}),Object.defineProperty(he,"StreamWriter",{enumerable:!0,get:function(){return v.default}}),Object.defineProperty(he,"Term",{enumerable:!0,get:function(){return R.Term}}),Object.defineProperty(he,"Triple",{enumerable:!0,get:function(){return R.Triple}}),he.Util=void 0,Object.defineProperty(he,"Variable",{enumerable:!0,get:function(){return R.Variable}}),Object.defineProperty(he,"Writer",{enumerable:!0,get:function(){return k.default}}),he.default=void 0,Object.defineProperty(he,"termFromId",{enumerable:!0,get:function(){return R.termFromId}}),Object.defineProperty(he,"termToId",{enumerable:!0,get:function(){return R.termToId}});var W=y(Y("./N3Lexer")),j=y(Y("./N3Parser")),k=y(Y("./N3Writer")),Q=y(Y("./N3Store")),H=y(Y("./N3StreamParser")),v=y(Y("./N3StreamWriter")),C=b(Y("./N3Util"));he.Util=C;var R=b(Y("./N3DataFactory"));function T(A){if("function"!=typeof WeakMap)return null;var z=new WeakMap,P=new WeakMap;return(T=function(X){return X?P:z})(A)}function b(A,z){if(!z&&A&&A.__esModule)return A;if(null===A||"object"!=typeof A&&"function"!=typeof A)return{default:A};var P=T(z);if(P&&P.has(A))return P.get(A);var X={},ue=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var I in A)if("default"!==I&&Object.prototype.hasOwnProperty.call(A,I)){var O=ue?Object.getOwnPropertyDescriptor(A,I):null;O&&(O.get||O.set)?Object.defineProperty(X,I,O):X[I]=A[I]}return X.default=A,P&&P.set(A,X),X}function y(A){return A&&A.__esModule?A:{default:A}}he.default={Lexer:W.default,Parser:j.default,Writer:k.default,Store:Q.default,StreamParser:H.default,StreamWriter:v.default,Util:C,DataFactory:R.default,Term:R.Term,NamedNode:R.NamedNode,Literal:R.Literal,BlankNode:R.BlankNode,Variable:R.Variable,DefaultGraph:R.DefaultGraph,Quad:R.Quad,Triple:R.Triple,termFromId:R.termFromId,termToId:R.termToId}},{"./N3DataFactory":35,"./N3Lexer":36,"./N3Parser":37,"./N3Store":38,"./N3StreamParser":39,"./N3StreamWriter":40,"./N3Util":41,"./N3Writer":42}],44:[function(Y,Se,he){var j,k,W=Se.exports={};function Q(){throw new Error("setTimeout has not been defined")}function H(){throw new Error("clearTimeout has not been defined")}function v(X){if(j===setTimeout)return setTimeout(X,0);if((j===Q||!j)&&setTimeout)return j=setTimeout,setTimeout(X,0);try{return j(X,0)}catch(ue){try{return j.call(null,X,0)}catch(I){return j.call(this,X,0)}}}!function(){try{j="function"==typeof setTimeout?setTimeout:Q}catch(X){j=Q}try{k="function"==typeof clearTimeout?clearTimeout:H}catch(X){k=H}}();var b,R=[],T=!1,y=-1;function S(){!T||!b||(T=!1,b.length?R=b.concat(R):y=-1,R.length&&A())}function A(){if(!T){var X=v(S);T=!0;for(var ue=R.length;ue;){for(b=R,R=[];++y1)for(var I=1;I(j||(j=Promise.resolve())).then(k).catch(Q=>setTimeout(()=>{throw Q},0))}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],46:[function(Y,Se,he){Se.exports=Y("./lib")},{"./lib":55}],47:[function(Y,Se,he){"use strict";Se.exports=class kq{constructor(j,k=new Map,Q=0){this.prefix=j,this._existing=k,this.counter=Q}clone(){const{prefix:j,_existing:k,counter:Q}=this;return new kq(j,new Map(k),Q)}getId(j){const k=j&&this._existing.get(j);if(k)return k;const Q=this.prefix+this.counter;return this.counter++,j&&this._existing.set(j,Q),Q}hasId(j){return this._existing.has(j)}getOldIds(){return[...this._existing.keys()]}}},{}],48:[function(Y,Se,he){"use strict";Y("setimmediate");const W=self.crypto||self.msCrypto;Se.exports=class{constructor(k){if(!W||!W.subtle)throw new Error("crypto.subtle not found.");if("sha256"===k)this.algorithm={name:"SHA-256"};else{if("sha1"!==k)throw new Error(`Unsupport algorithm "${k}".`);this.algorithm={name:"SHA-1"}}this._content=""}update(k){this._content+=k}digest(){var k=this;return yt(function*(){const Q=(new TextEncoder).encode(k._content),H=new Uint8Array(yield W.subtle.digest(k.algorithm,Q));let v="";for(let C=0;C]*)>)|(_:(?:[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]*$'),Se.exports=class nF{static parse(X){const ue=[],I={},O=X.split(T.eoln);let K=0;for(const E of O){if(K++,T.empty.test(E))continue;const $=E.match(T.quad);if(null===$)throw new Error("N-Quads parse error on line "+K+".");const Z={subject:null,predicate:null,object:null,graph:null};if(Z.subject=void 0!==$[1]?{termType:H,value:$[1]}:{termType:v,value:$[2]},Z.predicate={termType:H,value:$[3]},void 0!==$[4]?Z.object={termType:H,value:$[4]}:void 0!==$[5]?Z.object={termType:v,value:$[5]}:(Z.object={termType:C,value:void 0,datatype:{termType:H}},void 0!==$[7]?Z.object.datatype.value=$[7]:void 0!==$[8]?(Z.object.datatype.value=k,Z.object.language=$[8]):Z.object.datatype.value=Q,Z.object.value=$[6].replace(A,function(X,ue,I,O){if(ue)switch(ue){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(I)return String.fromCharCode(parseInt(I,16));if(O)throw new Error("Unsupported U escape")})),Z.graph=void 0!==$[9]?{termType:H,value:$[9]}:void 0!==$[10]?{termType:v,value:$[10]}:{termType:R,value:""},Z.graph.value in I){let ae=!0;const oe=I[Z.graph.value];for(const te of oe)if(b(te,Z)){ae=!1;break}ae&&(oe.push(Z),ue.push(Z))}else I[Z.graph.value]=[Z],ue.push(Z)}return ue}static serialize(X){Array.isArray(X)||(X=nF.legacyDatasetToQuads(X));const ue=[];for(const I of X)ue.push(nF.serializeQuad(I));return ue.sort().join("")}static serializeQuad(X){const ue=X.subject,O=X.object,K=X.graph;let E="";return E+=ue.termType===H?`<${ue.value}>`:`${ue.value}`,E+=` <${X.predicate.value}> `,O.termType===H?E+=`<${O.value}>`:O.termType===v?E+=O.value:(E+=`"${P=O.value,P.replace(y,function(X){switch(X){case'"':return'\\"';case"\\":return"\\\\";case"\n":return"\\n";case"\r":return"\\r"}})}"`,O.datatype.value===k?O.language&&(E+=`@${O.language}`):O.datatype.value!==Q&&(E+=`^^<${O.datatype.value}>`)),K.termType===H?E+=` <${K.value}>`:K.termType===v&&(E+=` ${K.value}`),E+=" .\n",E;var P}static legacyDatasetToQuads(X){const ue=[],I={"blank node":v,IRI:H,literal:C};for(const O in X)X[O].forEach(E=>{const $={};for(const Z in E){const ae=E[Z],oe={termType:I[ae.type],value:ae.value};oe.termType===C&&(oe.datatype={termType:H},"datatype"in ae&&(oe.datatype.value=ae.datatype),"language"in ae?("datatype"in ae||(oe.datatype.value=k),oe.language=ae.language):"datatype"in ae||(oe.datatype.value=Q)),$[Z]=oe}$.graph="@default"===O?{termType:R,value:""}:{termType:O.startsWith("_:")?v:H,value:O},ue.push($)});return ue}};const y=/["\\\n\r]/g;const A=/(?:\\([tbnrf"'\\]))|(?:\\u([0-9A-Fa-f]{4}))|(?:\\U([0-9A-Fa-f]{8}))/g},{}],50:[function(Y,Se,he){"use strict";Se.exports=class{constructor(j){this.current=j.sort(),this.done=!1,this.dir=new Map;for(let k=0;kH)&&(b&&R>0&&T>j[R-1]||!b&&Rj[R+1])&&(H=T,v=R)}if(null===H)this.done=!0;else{const R=k.get(H)?v-1:v+1;j[v]=j[R],j[R]=H;for(const T of j)T>H&&k.set(T,!k.get(T))}return Q}}},{}],51:[function(Y,Se,he){(function(W){(function(){"use strict";const j=Y("./IdentifierIssuer"),k=Y("./MessageDigest"),Q=Y("./Permuter"),H=Y("./NQuads");function v(C,R){return C.hashR.hash?1:0}Se.exports=class{constructor(){this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new j("_:c14n"),this.hashAlgorithm="sha256",this.quads=null}main(R){var T=this;return yt(function*(){T.quads=R;for(const X of R)T._addBlankNodeQuadInfo({quad:X,component:X.subject}),T._addBlankNodeQuadInfo({quad:X,component:X.object}),T._addBlankNodeQuadInfo({quad:X,component:X.graph});const b=new Map,y=[...T.blankNodeInfo.keys()];let S=0;for(const X of y)++S%100==0&&(yield T._yield()),yield T._hashAndTrackBlankNode({id:X,hashToBlankNodes:b});const A=[...b.keys()].sort(),z=[];for(const X of A){const ue=b.get(X);ue.length>1?z.push(ue):T.canonicalIssuer.getId(ue[0])}for(const X of z){const ue=[];for(const I of X){if(T.canonicalIssuer.hasId(I))continue;const O=new j("_:b");O.getId(I);const K=yield T.hashNDegreeQuads(I,O);ue.push(K)}ue.sort(v);for(const I of ue){const O=I.issuer.getOldIds();for(const K of O)T.canonicalIssuer.getId(K)}}const P=[];for(const X of T.quads){const ue=ot({},X);ue.subject=T._useCanonicalId({component:ue.subject}),ue.object=T._useCanonicalId({component:ue.object}),ue.graph=T._useCanonicalId({component:ue.graph}),P.push(H.serializeQuad(ue))}return P.sort(),P.join("")})()}hashFirstDegreeQuads(R){var T=this;return yt(function*(){const b=[],y=T.blankNodeInfo.get(R),S=y.quads;for(const z of S){const P={subject:null,predicate:z.predicate,object:null,graph:null};P.subject=T.modifyFirstDegreeComponent(R,z.subject,"subject"),P.object=T.modifyFirstDegreeComponent(R,z.object,"object"),P.graph=T.modifyFirstDegreeComponent(R,z.graph,"graph"),b.push(H.serializeQuad(P))}b.sort();const A=new k(T.hashAlgorithm);for(const z of b)A.update(z);return y.hash=yield A.digest(),y.hash})()}hashRelatedBlankNode(R,T,b,y){var S=this;return yt(function*(){let A;A=S.canonicalIssuer.hasId(R)?S.canonicalIssuer.getId(R):b.hasId(R)?b.getId(R):S.blankNodeInfo.get(R).hash;const z=new k(S.hashAlgorithm);return z.update(y),"g"!==y&&z.update(S.getRelatedPredicate(T)),z.update(A),z.digest()})()}hashNDegreeQuads(R,T){var b=this;return yt(function*(){const y=new k(b.hashAlgorithm),S=yield b.createHashToRelated(R,T),A=[...S.keys()].sort();for(const z of A){y.update(z);let X,P="";const ue=new Q(S.get(z));let I=0;for(;ue.hasNext();){const O=ue.next();++I%3==0&&(yield b._yield());let K=T.clone(),E="";const $=[];let Z=!1;for(const ae of O)if(b.canonicalIssuer.hasId(ae)?E+=b.canonicalIssuer.getId(ae):(K.hasId(ae)||$.push(ae),E+=K.getId(ae)),0!==P.length&&E>P){Z=!0;break}if(!Z){for(const ae of $){const oe=yield b.hashNDegreeQuads(ae,K);if(E+=K.getId(ae),E+=`<${oe.hash}>`,K=oe.issuer,0!==P.length&&E>P){Z=!0;break}}Z||(0===P.length||E`}createHashToRelated(R,T){var b=this;return yt(function*(){const y=new Map,S=b.blankNodeInfo.get(R).quads;let A=0;for(const z of S)++A%100==0&&(yield b._yield()),yield Promise.all([b._addRelatedBlankNodeHash({quad:z,component:z.subject,position:"s",id:R,issuer:T,hashToRelated:y}),b._addRelatedBlankNodeHash({quad:z,component:z.object,position:"o",id:R,issuer:T,hashToRelated:y}),b._addRelatedBlankNodeHash({quad:z,component:z.graph,position:"g",id:R,issuer:T,hashToRelated:y})]);return y})()}_hashAndTrackBlankNode({id:R,hashToBlankNodes:T}){var b=this;return yt(function*(){const y=yield b.hashFirstDegreeQuads(R),S=T.get(y);S?S.push(R):T.set(y,[R])})()}_addBlankNodeQuadInfo({quad:R,component:T}){if("BlankNode"!==T.termType)return;const b=T.value,y=this.blankNodeInfo.get(b);y?y.quads.add(R):this.blankNodeInfo.set(b,{quads:new Set([R]),hash:null})}_addRelatedBlankNodeHash({quad:R,component:T,position:b,id:y,issuer:S,hashToRelated:A}){var z=this;return yt(function*(){if("BlankNode"!==T.termType||T.value===y)return;const P=T.value,X=yield z.hashRelatedBlankNode(P,R,S,b),ue=A.get(X);ue?ue.push(P):A.set(X,[P])})()}_useCanonicalId({component:R}){return"BlankNode"!==R.termType||R.value.startsWith(this.canonicalIssuer.prefix)?R:{termType:"BlankNode",value:this.canonicalIssuer.getId(R.value)}}_yield(){return yt(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,Se,he){"use strict";const W=Y("./IdentifierIssuer"),j=Y("./MessageDigest"),k=Y("./Permuter"),Q=Y("./NQuads");function H(v,C){return v.hashC.hash?1:0}Se.exports=class{constructor(){this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new W("_:c14n"),this.hashAlgorithm="sha256",this.quads=null}main(C){this.quads=C;for(const A of C)this._addBlankNodeQuadInfo({quad:A,component:A.subject}),this._addBlankNodeQuadInfo({quad:A,component:A.object}),this._addBlankNodeQuadInfo({quad:A,component:A.graph});const R=new Map,T=[...this.blankNodeInfo.keys()];for(const A of T)this._hashAndTrackBlankNode({id:A,hashToBlankNodes:R});const b=[...R.keys()].sort(),y=[];for(const A of b){const z=R.get(A);z.length>1?y.push(z):this.canonicalIssuer.getId(z[0])}for(const A of y){const z=[];for(const P of A){if(this.canonicalIssuer.hasId(P))continue;const X=new W("_:b");X.getId(P);const ue=this.hashNDegreeQuads(P,X);z.push(ue)}z.sort(H);for(const P of z){const X=P.issuer.getOldIds();for(const ue of X)this.canonicalIssuer.getId(ue)}}const S=[];for(const A of this.quads){const z=ot({},A);z.subject=this._useCanonicalId({component:z.subject}),z.object=this._useCanonicalId({component:z.object}),z.graph=this._useCanonicalId({component:z.graph}),S.push(Q.serializeQuad(z))}return S.sort(),S.join("")}hashFirstDegreeQuads(C){const R=[],T=this.blankNodeInfo.get(C),b=T.quads;for(const S of b){const A={subject:null,predicate:S.predicate,object:null,graph:null};A.subject=this.modifyFirstDegreeComponent(C,S.subject,"subject"),A.object=this.modifyFirstDegreeComponent(C,S.object,"object"),A.graph=this.modifyFirstDegreeComponent(C,S.graph,"graph"),R.push(Q.serializeQuad(A))}R.sort();const y=new j(this.hashAlgorithm);for(const S of R)y.update(S);return T.hash=y.digest(),T.hash}hashRelatedBlankNode(C,R,T,b){let y;y=this.canonicalIssuer.hasId(C)?this.canonicalIssuer.getId(C):T.hasId(C)?T.getId(C):this.blankNodeInfo.get(C).hash;const S=new j(this.hashAlgorithm);return S.update(b),"g"!==b&&S.update(this.getRelatedPredicate(R)),S.update(y),S.digest()}hashNDegreeQuads(C,R){const T=new j(this.hashAlgorithm),b=this.createHashToRelated(C,R),y=[...b.keys()].sort();for(const S of y){T.update(S);let z,A="";const P=new k(b.get(S));for(;P.hasNext();){const X=P.next();let ue=R.clone(),I="";const O=[];let K=!1;for(const E of X)if(this.canonicalIssuer.hasId(E)?I+=this.canonicalIssuer.getId(E):(ue.hasId(E)||O.push(E),I+=ue.getId(E)),0!==A.length&&I>A){K=!0;break}if(!K){for(const E of O){const $=this.hashNDegreeQuads(E,ue);if(I+=ue.getId(E),I+=`<${$.hash}>`,ue=$.issuer,0!==A.length&&I>A){K=!0;break}}K||(0===A.length||I`}createHashToRelated(C,R){const T=new Map,b=this.blankNodeInfo.get(C).quads;for(const y of b)this._addRelatedBlankNodeHash({quad:y,component:y.subject,position:"s",id:C,issuer:R,hashToRelated:T}),this._addRelatedBlankNodeHash({quad:y,component:y.object,position:"o",id:C,issuer:R,hashToRelated:T}),this._addRelatedBlankNodeHash({quad:y,component:y.graph,position:"g",id:C,issuer:R,hashToRelated:T});return T}_hashAndTrackBlankNode({id:C,hashToBlankNodes:R}){const T=this.hashFirstDegreeQuads(C),b=R.get(T);b?b.push(C):R.set(T,[C])}_addBlankNodeQuadInfo({quad:C,component:R}){if("BlankNode"!==R.termType)return;const T=R.value,b=this.blankNodeInfo.get(T);b?b.quads.add(C):this.blankNodeInfo.set(T,{quads:new Set([C]),hash:null})}_addRelatedBlankNodeHash({quad:C,component:R,position:T,id:b,issuer:y,hashToRelated:S}){if("BlankNode"!==R.termType||R.value===b)return;const A=R.value,z=this.hashRelatedBlankNode(A,C,y,T),P=S.get(z);P?P.push(A):S.set(z,[A])}_useCanonicalId({component:C}){return"BlankNode"!==C.termType||C.value.startsWith(this.canonicalIssuer.prefix)?C:{termType:"BlankNode",value:this.canonicalIssuer.getId(C.value)}}}},{"./IdentifierIssuer":47,"./MessageDigest":48,"./NQuads":49,"./Permuter":50}],53:[function(Y,Se,he){"use strict";const W=Y("./URDNA2015");Se.exports=class extends W{constructor(){super(),this.name="URGNA2012",this.hashAlgorithm="sha1"}modifyFirstDegreeComponent(k,Q,H){return"BlankNode"!==Q.termType?Q:"graph"===H?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:Q.value===k?"_:a":"_:z"}}getRelatedPredicate(k){return k.predicate.value}createHashToRelated(k,Q){var H=this;return yt(function*(){const v=new Map,C=H.blankNodeInfo.get(k).quads;let R=0;for(const T of C){let b,y;if("BlankNode"===T.subject.termType&&T.subject.value!==k)y=T.subject.value,b="p";else{if("BlankNode"!==T.object.termType||T.object.value===k)continue;y=T.object.value,b="r"}++R%100==0&&(yield H._yield());const S=yield H.hashRelatedBlankNode(y,T,Q,b),A=v.get(S);A?A.push(y):v.set(S,[y])}return v})()}}},{"./URDNA2015":51}],54:[function(Y,Se,he){"use strict";const W=Y("./URDNA2015Sync");Se.exports=class extends W{constructor(){super(),this.name="URGNA2012",this.hashAlgorithm="sha1"}modifyFirstDegreeComponent(k,Q,H){return"BlankNode"!==Q.termType?Q:"graph"===H?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:Q.value===k?"_:a":"_:z"}}getRelatedPredicate(k){return k.predicate.value}createHashToRelated(k,Q){const H=new Map,v=this.blankNodeInfo.get(k).quads;for(const C of v){let R,T;if("BlankNode"===C.subject.termType&&C.subject.value!==k)T=C.subject.value,R="p";else{if("BlankNode"!==C.object.termType||C.object.value===k)continue;T=C.object.value,R="r"}const b=this.hashRelatedBlankNode(T,C,Q,R),y=H.get(b);y?y.push(T):H.set(b,[T])}return H}}},{"./URDNA2015Sync":52}],55:[function(Y,Se,he){"use strict";const W=Y("./URDNA2015"),j=Y("./URGNA2012"),k=Y("./URDNA2015Sync"),Q=Y("./URGNA2012Sync");let H;try{H=Y("rdf-canonize-native")}catch(C){}const v={};Se.exports=v,v.NQuads=Y("./NQuads"),v.IdentifierIssuer=Y("./IdentifierIssuer"),v._rdfCanonizeNative=function(C){return C&&(H=C),H},v.canonize=function(){var C=yt(function*(R,T){if(Array.isArray(R)||(R=v.NQuads.legacyDatasetToQuads(R)),T.useNative){if(!H)throw new Error("rdf-canonize-native not available");return new Promise((b,y)=>H.canonize(R,T,(S,A)=>S?y(S):b(A)))}if("URDNA2015"===T.algorithm)return new W(T).main(R);if("URGNA2012"===T.algorithm)return new j(T).main(R);throw"algorithm"in T?new Error("Invalid RDF Dataset Canonicalization algorithm: "+T.algorithm):new Error("No RDF Dataset Canonicalization algorithm specified.")});return function(R,T){return C.apply(this,arguments)}}(),v._canonizeSync=function(C,R){if(Array.isArray(C)||(C=v.NQuads.legacyDatasetToQuads(C)),R.useNative){if(H)return H.canonizeSync(C,R);throw new Error("rdf-canonize-native not available")}if("URDNA2015"===R.algorithm)return new k(R).main(C);if("URGNA2012"===R.algorithm)return new Q(R).main(C);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,Se,he){"use strict";var W=this&&this.__createBinding||(Object.create?function(k,Q,H,v){void 0===v&&(v=H),Object.defineProperty(k,v,{enumerable:!0,get:function(){return Q[H]}})}:function(k,Q,H,v){void 0===v&&(v=H),k[v]=Q[H]}),j=this&&this.__exportStar||function(k,Q){for(var H in k)"default"!==H&&!Object.prototype.hasOwnProperty.call(Q,H)&&W(Q,k,H)};Object.defineProperty(he,"__esModule",{value:!0}),j(Y("./lib/BlankNode"),he),j(Y("./lib/DataFactory"),he),j(Y("./lib/DefaultGraph"),he),j(Y("./lib/Literal"),he),j(Y("./lib/NamedNode"),he),j(Y("./lib/Quad"),he),j(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,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.BlankNode=void 0;he.BlankNode=class{constructor(k){this.termType="BlankNode",this.value=k}equals(k){return!!k&&"BlankNode"===k.termType&&k.value===this.value}}},{}],58:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.DataFactory=void 0;const W=Y("./BlankNode"),j=Y("./DefaultGraph"),k=Y("./Literal"),Q=Y("./NamedNode"),H=Y("./Quad"),v=Y("./Variable");let C=0;he.DataFactory=class{constructor(b){this.blankNodeCounter=0,this.blankNodePrefix=(b=b||{}).blankNodePrefix||`df_${C++}_`}namedNode(b){return new Q.NamedNode(b)}blankNode(b){return new W.BlankNode(b||`${this.blankNodePrefix}${this.blankNodeCounter++}`)}literal(b,y){return new k.Literal(b,y)}variable(b){return new v.Variable(b)}defaultGraph(){return j.DefaultGraph.INSTANCE}quad(b,y,S,A){return new H.Quad(b,y,S,A||this.defaultGraph())}fromTerm(b){switch(b.termType){case"NamedNode":return this.namedNode(b.value);case"BlankNode":return this.blankNode(b.value);case"Literal":return b.language?this.literal(b.value,b.language):b.datatype.equals(k.Literal.XSD_STRING)?this.literal(b.value):this.literal(b.value,this.fromTerm(b.datatype));case"Variable":return this.variable(b.value);case"DefaultGraph":return this.defaultGraph();case"Quad":return this.quad(this.fromTerm(b.subject),this.fromTerm(b.predicate),this.fromTerm(b.object),this.fromTerm(b.graph))}}fromQuad(b){return this.fromTerm(b)}resetBlankNodeCounter(){this.blankNodeCounter=0}}},{"./BlankNode":57,"./DefaultGraph":59,"./Literal":60,"./NamedNode":61,"./Quad":62,"./Variable":63}],59:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.DefaultGraph=void 0;class W{constructor(){this.termType="DefaultGraph",this.value=""}equals(k){return!!k&&"DefaultGraph"===k.termType}}he.DefaultGraph=W,W.INSTANCE=new W},{}],60:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.Literal=void 0;const W=Y("./NamedNode");class j{constructor(Q,H){this.termType="Literal",this.value=Q,"string"==typeof H?(this.language=H,this.datatype=j.RDF_LANGUAGE_STRING):H?(this.language="",this.datatype=H):(this.language="",this.datatype=j.XSD_STRING)}equals(Q){return!!Q&&"Literal"===Q.termType&&Q.value===this.value&&Q.language===this.language&&Q.datatype.equals(this.datatype)}}he.Literal=j,j.RDF_LANGUAGE_STRING=new W.NamedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),j.XSD_STRING=new W.NamedNode("http://www.w3.org/2001/XMLSchema#string")},{"./NamedNode":61}],61:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.NamedNode=void 0;he.NamedNode=class{constructor(k){this.termType="NamedNode",this.value=k}equals(k){return!!k&&"NamedNode"===k.termType&&k.value===this.value}}},{}],62:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.Quad=void 0;he.Quad=class{constructor(k,Q,H,v){this.termType="Quad",this.value="",this.subject=k,this.predicate=Q,this.object=H,this.graph=v}equals(k){return!!k&&("Quad"===k.termType||!k.termType)&&this.subject.equals(k.subject)&&this.predicate.equals(k.predicate)&&this.object.equals(k.object)&&this.graph.equals(k.graph)}}},{}],63:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.Variable=void 0;he.Variable=class{constructor(k){this.termType="Variable",this.value=k}equals(k){return!!k&&"Variable"===k.termType&&k.value===this.value}}},{}],64:[function(Y,Se,he){"use strict";var W=this&&this.__createBinding||(Object.create?function(k,Q,H,v){void 0===v&&(v=H),Object.defineProperty(k,v,{enumerable:!0,get:function(){return Q[H]}})}:function(k,Q,H,v){void 0===v&&(v=H),k[v]=Q[H]}),j=this&&this.__exportStar||function(k,Q){for(var H in k)"default"!==H&&!Object.prototype.hasOwnProperty.call(Q,H)&&W(Q,k,H)};Object.defineProperty(he,"__esModule",{value:!0}),j(Y("./lib/RdfXmlParser"),he)},{"./lib/RdfXmlParser":66}],65:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.ParseError=void 0;class W extends Error{constructor(k,Q){const H=k.saxStream._parser;super(k.trackPosition?`Line ${H.line+1} column ${H.column+1}: ${Q}`:Q)}}he.ParseError=W},{}],66:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.ParseType=he.RdfXmlParser=void 0;const W=Y("relative-to-absolute-iri"),j=Y("sax"),k=Y("stream"),Q=Y("./ParseError"),H=Y("rdf-data-factory");class v extends k.Transform{constructor(T){super({readableObjectMode:!0}),this.activeTagStack=[],this.nodeIds={},T&&(Object.assign(this,T),this.options=T),this.dataFactory||(this.dataFactory=new H.DataFactory),this.baseIRI||(this.baseIRI=""),this.defaultGraph||(this.defaultGraph=this.dataFactory.defaultGraph()),this.saxStream=j.createStream(this.strict,{xmlns:!1,position:this.trackPosition}),this.strict||(this.saxStream._parser.looseCase="toString"),this.attachSaxListeners()}static parseNamespace(T,b){const y={};let S=!1;for(const z in T.attributes)z.startsWith("xmlns")&&(5===z.length?(S=!0,y[""]=T.attributes[z]):":"===z.charAt(5)&&(S=!0,y[z.substr(6)]=T.attributes[z]));const A=b&&b.ns?b.ns:[v.DEFAULT_NS];return S?A.concat([y]):A}static expandPrefixedTerm(T,b,y){const S=T.indexOf(":");let A,z;S>=0?(A=T.substr(0,S),z=T.substr(S+1)):(A="",z=T);let P=null,X=null;for(let ue=b.length-1;ue>=0;ue--){const I=b[ue][A];if(I){P=I;break}X||(X=b[ue][""])}if(!P){if(A&&"xmlns"!==A)throw new Q.ParseError(y,`The prefix '${A}' in term '${T}' was not bound.`);P=X||""}return{prefix:A,local:z,uri:P}}static isValidIri(T){return v.IRI_REGEX.test(T)}import(T){const b=new k.PassThrough({readableObjectMode:!0});T.on("error",S=>y.emit("error",S)),T.on("data",S=>b.push(S)),T.on("end",()=>b.push(null));const y=b.pipe(new v(this.options));return y}_transform(T,b,y){try{this.saxStream.write(T,b)}catch(S){return y(S)}y()}newParseError(T){return new Q.ParseError(this,T)}valueToUri(T,b){return this.uriToNamedNode(W.resolve(T,b.baseIRI))}uriToNamedNode(T){if(!v.isValidIri(T))throw this.newParseError(`Invalid URI: ${T}`);return this.dataFactory.namedNode(T)}validateNcname(T){if(!v.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 b=this.activeTagStack.length?this.activeTagStack[this.activeTagStack.length-1]:null;let y=C.RESOURCE;if(b&&(b.hadChildren=!0,y=b.childrenParseType),b&&b.childrenStringTags){const A=T.name;let z="";for(const I in T.attributes)z+=` ${I}="${T.attributes[I]}"`;b.childrenStringTags.push(`<${A}${z}>`);const ue={childrenStringTags:b.childrenStringTags};return ue.childrenStringEmitClosingTag=``,void this.activeTagStack.push(ue)}const S={};b?(S.language=b.language,S.baseIRI=b.baseIRI):S.baseIRI=this.baseIRI,this.activeTagStack.push(S),S.ns=v.parseNamespace(T,b),y===C.RESOURCE?this.onTagResource(T,S,b,!b):this.onTagProperty(T,S,b)}onTagResource(T,b,y,S){const A=v.expandPrefixedTerm(T.name,b.ns,this);b.childrenParseType=C.PROPERTY;let z=!0;if(A.uri===v.RDF){if(!S&&v.FORBIDDEN_NODE_ELEMENTS.indexOf(A.local)>=0)throw this.newParseError(`Illegal node element name: ${A.local}`);switch(A.local){case"RDF":b.childrenParseType=C.RESOURCE;case"Description":z=!1}}const P=[],X=[];let ue=null,I=!1,O=!1,K=null;for(const E in T.attributes){const $=T.attributes[E],Z=v.expandPrefixedTerm(E,b.ns,this);if(y&&Z.uri===v.RDF)switch(Z.local){case"about":if(ue)throw this.newParseError(`Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ${$} and ${ue} where found.`);ue=$;continue;case"ID":if(ue)throw this.newParseError(`Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ${$} and ${ue} where found.`);this.validateNcname($),ue="#"+$,I=!0;continue;case"nodeID":if(ue)throw this.newParseError(`Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ${$} and ${ue} where found.`);this.validateNcname($),ue=$,O=!0;continue;case"bagID":throw this.newParseError("rdf:bagID is not supported.");case"type":K=$;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(Z.uri===v.XML){if("lang"===Z.local){b.language=""===$?null:$.toLowerCase();continue}if("base"===Z.local){b.baseIRI=W.resolve($,b.baseIRI);continue}}"xml"!==Z.prefix&&Z.uri&&(P.push(this.uriToNamedNode(Z.uri+Z.local)),X.push($))}if(null!==ue&&(b.subject=O?this.dataFactory.blankNode(ue):this.valueToUri(ue,b),I&&this.claimNodeId(b.subject)),b.subject||(b.subject=this.dataFactory.blankNode()),z){const E=this.uriToNamedNode(A.uri+A.local);this.emitTriple(b.subject,this.dataFactory.namedNode(v.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(v.RDF+"first"),b.subject,b.reifiedStatementId),y.childrenCollectionSubject=E,y.childrenCollectionPredicate=this.dataFactory.namedNode(v.RDF+"rest")}else{this.emitTriple(y.subject,y.predicate,b.subject,y.reifiedStatementId);for(let E=0;E=0)throw this.newParseError(`Illegal property element name: ${S.local}`);b.predicateSubPredicates=[],b.predicateSubObjects=[];let A=!1,z=!1,P=null,X=!0;const ue=[],I=[];for(const O in T.attributes){const K=T.attributes[O],E=v.expandPrefixedTerm(O,b.ns,this);if(E.uri===v.RDF)switch(E.local){case"resource":if(P)throw this.newParseError(`Found both rdf:resource (${K}) and rdf:nodeID (${P}).`);if(A)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:resource (${K})`);b.hadChildren=!0,P=K,X=!1;continue;case"datatype":if(z)throw this.newParseError(`Found both non-rdf:* property attributes and rdf:datatype (${K}).`);if(A)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:datatype (${K})`);b.datatype=this.valueToUri(K,b);continue;case"nodeID":if(z)throw this.newParseError(`Found both non-rdf:* property attributes and rdf:nodeID (${K}).`);if(b.hadChildren)throw this.newParseError(`Found both rdf:resource and rdf:nodeID (${K}).`);if(A)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:nodeID (${K})`);this.validateNcname(K),b.hadChildren=!0,P=K,X=!0;continue;case"bagID":throw this.newParseError("rdf:bagID is not supported.");case"parseType":if(z)throw this.newParseError("rdf:parseType is not allowed when non-rdf:* property attributes are present");if(b.datatype)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:datatype (${b.datatype.value})`);if(P)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:nodeID or rdf:resource (${P})`);if("Resource"===K){A=!0,b.childrenParseType=C.PROPERTY;const $=this.dataFactory.blankNode();this.emitTriple(b.subject,b.predicate,$,b.reifiedStatementId),b.subject=$,b.predicate=null}else"Collection"===K?(A=!0,b.hadChildren=!0,b.childrenCollectionSubject=b.subject,b.childrenCollectionPredicate=b.predicate,X=!1):"Literal"===K&&(A=!0,b.childrenTagsToString=!0,b.childrenStringTags=[]);continue;case"ID":this.validateNcname(K),b.reifiedStatementId=this.valueToUri("#"+K,b),this.claimNodeId(b.reifiedStatementId);continue}else if(E.uri===v.XML&&"lang"===E.local){b.language=""===K?null:K.toLowerCase();continue}if("xml"!==E.prefix&&"xmlns"!==E.prefix&&E.uri){if(A||b.datatype)throw this.newParseError(`Found illegal rdf:* properties on property element with attribute: ${K}`);b.hadChildren=!0,z=!0,ue.push(this.uriToNamedNode(E.uri+E.local)),I.push(this.dataFactory.literal(K,b.datatype||b.language))}}if(null!==P){const O=b.subject;b.subject=X?this.dataFactory.blankNode(P):this.valueToUri(P,b),this.emitTriple(O,b.predicate,b.subject,b.reifiedStatementId);for(let K=0;K/g,(b,y,S)=>(this.saxStream._parser.ENTITIES[y]=S,""))}}var C,R;he.RdfXmlParser=v,v.IRI_REGEX=/^([A-Za-z][A-Za-z0-9+-.]*):[^ "<>{}|\\\[\]`]*$/,v.MIME_TYPE="application/rdf+xml",v.RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#",v.XML="http://www.w3.org/XML/1998/namespace",v.XMLNS="http://www.w3.org/2000/xmlns/",v.DEFAULT_NS={xml:v.XML},v.FORBIDDEN_NODE_ELEMENTS=["RDF","ID","about","bagID","parseType","resource","nodeID","li","aboutEach","aboutEachPrefix"],v.FORBIDDEN_PROPERTY_ELEMENTS=["Description","RDF","ID","about","bagID","parseType","resource","nodeID","aboutEach","aboutEachPrefix"],v.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=C=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,Se,he){"use strict";var j={};function k(R,T,b){b||(b=Error);var S=function(A){function z(P,X,ue){return A.call(this,function(A,z,P){return"string"==typeof T?T:T(A,z,P)}(P,X,ue))||this}return function(R,T){R.prototype=Object.create(T.prototype),R.prototype.constructor=R,R.__proto__=T}(z,A),z}(b);S.prototype.name=b.name,S.prototype.code=R,j[R]=S}function Q(R,T){if(Array.isArray(R)){var b=R.length;return R=R.map(function(y){return String(y)}),b>2?"one of ".concat(T," ").concat(R.slice(0,b-1).join(", "),", or ")+R[b-1]:2===b?"one of ".concat(T," ").concat(R[0]," or ").concat(R[1]):"of ".concat(T," ").concat(R[0])}return"of ".concat(T," ").concat(String(R))}k("ERR_INVALID_OPT_VALUE",function(R,T){return'The value "'+T+'" is invalid for option "'+R+'"'},TypeError),k("ERR_INVALID_ARG_TYPE",function(R,T,b){var y,S;if("string"==typeof T&&function(R,T,b){return R.substr(!b||b<0?0:+b,T.length)===T}(T,"not ")?(y="must not be",T=T.replace(/^not /,"")):y="must be",function(R,T,b){return(void 0===b||b>R.length)&&(b=R.length),R.substring(b-T.length,b)===T}(R," argument"))S="The ".concat(R," ").concat(y," ").concat(Q(T,"type"));else{var A=function(R,T,b){return"number"!=typeof b&&(b=0),!(b+T.length>R.length)&&-1!==R.indexOf(T,b)}(R,".")?"property":"argument";S='The "'.concat(R,'" ').concat(A," ").concat(y," ").concat(Q(T,"type"))}return S+". Received type ".concat(typeof b)},TypeError),k("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),k("ERR_METHOD_NOT_IMPLEMENTED",function(R){return"The "+R+" method is not implemented"}),k("ERR_STREAM_PREMATURE_CLOSE","Premature close"),k("ERR_STREAM_DESTROYED",function(R){return"Cannot call "+R+" after a stream was destroyed"}),k("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),k("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),k("ERR_STREAM_WRITE_AFTER_END","write after end"),k("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),k("ERR_UNKNOWN_ENCODING",function(R){return"Unknown encoding: "+R},TypeError),k("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),Se.exports.codes=j},{}],68:[function(Y,Se,he){(function(W){(function(){"use strict";var j=Object.keys||function(y){var S=[];for(var A in y)S.push(A);return S};Se.exports=R;var k=Y("./_stream_readable"),Q=Y("./_stream_writable");Y("inherits")(R,k);for(var H=j(Q.prototype),v=0;v0)if("string"!=typeof B&&!Ze.objectMode&&Object.getPrototypeOf(B)!==C.prototype&&(B=function(we){return C.from(we)}(B)),V)Ze.endEmitted?oe(we,new E):Oe(we,Ze,B,!0);else if(Ze.ended)oe(we,new O);else{if(Ze.destroyed)return!1;Ze.reading=!1,Ze.decoder&&!N?(B=Ze.decoder.write(B),Ze.objectMode||0!==B.length?Oe(we,Ze,B,!1):Ke(we,Ze)):Oe(we,Ze,B,!1)}else V||(Ze.reading=!1,Ke(we,Ze));return!Ze.ended&&(Ze.lengthB.highWaterMark&&(B.highWaterMark=function(we){return we>=st?we=st:(we--,we|=we>>>1,we|=we>>>2,we|=we>>>4,we|=we>>>8,we|=we>>>16,we++),we}(we)),we<=B.length?we:B.ended?B.length:(B.needReadable=!0,0))}function ze(we){var B=we._readableState;S("emitReadable",B.needReadable,B.emittedReadable),B.needReadable=!1,B.emittedReadable||(S("emitReadable",B.flowing),B.emittedReadable=!0,W.nextTick(Le,we))}function Le(we){var B=we._readableState;S("emitReadable_",B.destroyed,B.length,B.ended),!B.destroyed&&(B.length||B.ended)&&(we.emit("readable"),B.emittedReadable=!1),B.needReadable=!B.flowing&&!B.ended&&B.length<=B.highWaterMark,pe(we)}function Ke(we,B){B.readingMore||(B.readingMore=!0,W.nextTick(Me,we,B))}function Me(we,B){for(;!B.reading&&!B.ended&&(B.length0,B.resumeScheduled&&!B.paused?B.flowing=!0:we.listenerCount("data")>0&&we.resume()}function ke(we){S("readable nexttick read 0"),we.read(0)}function G(we,B){S("resume",B.reading),B.reading||we.read(0),B.resumeScheduled=!1,we.emit("resume"),pe(we),B.flowing&&!B.reading&&we.read(0)}function pe(we){var B=we._readableState;for(S("flow",B.flowing);B.flowing&&null!==we.read(););}function de(we,B){return 0===B.length?null:(B.objectMode?N=B.buffer.shift():!we||we>=B.length?(N=B.decoder?B.buffer.join(""):1===B.buffer.length?B.buffer.first():B.buffer.concat(B.length),B.buffer.clear()):N=B.buffer.consume(we,B.decoder),N);var N}function je(we){var B=we._readableState;S("endReadable",B.endEmitted),B.endEmitted||(B.ended=!0,W.nextTick(_t,B,we))}function _t(we,B){if(S("endReadableNT",we.endEmitted,we.length),!we.endEmitted&&0===we.length&&(we.endEmitted=!0,B.readable=!1,B.emit("end"),we.autoDestroy)){var N=B._writableState;(!N||N.autoDestroy&&N.finished)&&B.destroy()}}function pt(we,B){for(var N=0,V=we.length;N=B.highWaterMark:B.length>0)||B.ended))return S("read: emitReadable",B.length,B.ended),0===B.length&&B.ended?je(this):ze(this),null;if(0===(we=tt(we,B))&&B.ended)return 0===B.length&&je(this),null;var Re,V=B.needReadable;return S("need readable",V),(0===B.length||B.length-we0?de(we,B):null)?(B.needReadable=B.length<=B.highWaterMark,we=0):(B.length-=we,B.awaitDrain=0),0===B.length&&(B.ended||(B.needReadable=!0),N!==we&&B.ended&&je(this)),null!==Re&&this.emit("data",Re),Re},ne.prototype._read=function(we){oe(this,new K("_read()"))},ne.prototype.pipe=function(we,B){var N=this,V=this._readableState;switch(V.pipesCount){case 0:V.pipes=we;break;case 1:V.pipes=[V.pipes,we];break;default:V.pipes.push(we)}V.pipesCount+=1,S("pipe count=%d opts=%j",V.pipesCount,B);var Ze=B&&!1===B.end||we===W.stdout||we===W.stderr?fs:kt;function Tt(Bs,Kr){S("onunpipe"),Bs===N&&Kr&&!1===Kr.hasUnpiped&&(Kr.hasUnpiped=!0,S("cleanup"),we.removeListener("close",Xr),we.removeListener("finish",Ls),we.removeListener("drain",In),we.removeListener("error",xi),we.removeListener("unpipe",Tt),N.removeListener("end",kt),N.removeListener("end",fs),N.removeListener("data",Mi),Nn=!0,V.awaitDrain&&(!we._writableState||we._writableState.needDrain)&&In())}function kt(){S("onend"),we.end()}V.endEmitted?W.nextTick(Ze):N.once("end",Ze),we.on("unpipe",Tt);var In=function(we){return function(){var N=we._readableState;S("pipeOnDrain",N.awaitDrain),N.awaitDrain&&N.awaitDrain--,0===N.awaitDrain&&H(we,"data")&&(N.flowing=!0,pe(we))}}(N);we.on("drain",In);var Nn=!1;function Mi(Bs){S("ondata");var Kr=we.write(Bs);S("dest.write",Kr),!1===Kr&&((1===V.pipesCount&&V.pipes===we||V.pipesCount>1&&-1!==pt(V.pipes,we))&&!Nn&&(S("false write response, pause",V.awaitDrain),V.awaitDrain++),N.pause())}function xi(Bs){S("onerror",Bs),fs(),we.removeListener("error",xi),0===H(we,"error")&&oe(we,Bs)}function Xr(){we.removeListener("finish",Ls),fs()}function Ls(){S("onfinish"),we.removeListener("close",Xr),fs()}function fs(){S("unpipe"),N.unpipe(we)}return N.on("data",Mi),function(we,B,N){if("function"==typeof we.prependListener)return we.prependListener(B,N);we._events&&we._events[B]?Array.isArray(we._events[B])?we._events[B].unshift(N):we._events[B]=[N,we._events[B]]:we.on(B,N)}(we,"error",xi),we.once("close",Xr),we.once("finish",Ls),we.emit("pipe",N),V.flowing||(S("pipe resume"),N.resume()),we},ne.prototype.unpipe=function(we){var B=this._readableState,N={hasUnpiped:!1};if(0===B.pipesCount)return this;if(1===B.pipesCount)return we&&we!==B.pipes||(we||(we=B.pipes),B.pipes=null,B.pipesCount=0,B.flowing=!1,we&&we.emit("unpipe",this,N)),this;if(!we){var V=B.pipes,Re=B.pipesCount;B.pipes=null,B.pipesCount=0,B.flowing=!1;for(var Ze=0;Ze0,!1!==V.flowing&&this.resume()):"readable"===we&&!V.endEmitted&&!V.readableListening&&(V.readableListening=V.needReadable=!0,V.flowing=!1,V.emittedReadable=!1,S("on readable",V.length,V.reading),V.length?ze(this):V.reading||W.nextTick(ke,this)),N},ne.prototype.removeListener=function(we,B){var N=v.prototype.removeListener.call(this,we,B);return"readable"===we&&W.nextTick(qe,this),N},ne.prototype.removeAllListeners=function(we){var B=v.prototype.removeAllListeners.apply(this,arguments);return("readable"===we||void 0===we)&&W.nextTick(qe,this),B},ne.prototype.resume=function(){var we=this._readableState;return we.flowing||(S("resume"),we.flowing=!we.readableListening,function(we,B){B.resumeScheduled||(B.resumeScheduled=!0,W.nextTick(G,we,B))}(this,we)),we.paused=!1,this},ne.prototype.pause=function(){return S("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(S("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},ne.prototype.wrap=function(we){var B=this,N=this._readableState,V=!1;for(var Re in we.on("end",function(){if(S("wrapped end"),N.decoder&&!N.ended){var Tt=N.decoder.end();Tt&&Tt.length&&B.push(Tt)}B.push(null)}),we.on("data",function(Tt){S("wrapped data"),N.decoder&&(Tt=N.decoder.write(Tt)),N.objectMode&&null==Tt||!(N.objectMode||Tt&&Tt.length)||B.push(Tt)||(V=!0,we.pause())}),we)void 0===this[Re]&&"function"==typeof we[Re]&&(this[Re]=function(kt){return function(){return we[kt].apply(we,arguments)}}(Re));for(var Ze=0;Ze-1))throw new Z(de);return this._writableState.defaultEncoding=de,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(pe,de,je){je(new ue("_write()"))},me.prototype._writev=null,me.prototype.end=function(pe,de,je){var _t=this._writableState;return"function"==typeof pe?(je=pe,pe=null,de=null):"function"==typeof de&&(je=de,de=null),null!=pe&&this.write(pe,de),_t.corked&&(_t.corked=1,this.uncork()),_t.ending||function(pe,de,je){de.ending=!0,ke(pe,de),je&&(de.finished?W.nextTick(je):pe.once("finish",je)),de.ended=!0,pe.writable=!1}(this,_t,je),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(de){!this._writableState||(this._writableState.destroyed=de)}}),me.prototype.destroy=S.destroy,me.prototype._undestroy=S.undestroy,me.prototype._destroy=function(pe,de){de(pe)}}).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,Se,he){(function(W){(function(){"use strict";var j;function k(O,K,E){return K in O?Object.defineProperty(O,K,{value:E,enumerable:!0,configurable:!0,writable:!0}):O[K]=E,O}var Q=Y("./end-of-stream"),H=Symbol("lastResolve"),v=Symbol("lastReject"),C=Symbol("error"),R=Symbol("ended"),T=Symbol("lastPromise"),b=Symbol("handlePromise"),y=Symbol("stream");function S(O,K){return{value:O,done:K}}function A(O){var K=O[H];if(null!==K){var E=O[y].read();null!==E&&(O[T]=null,O[H]=null,O[v]=null,K(S(E,!1)))}}function z(O){W.nextTick(A,O)}var X=Object.getPrototypeOf(function(){}),ue=Object.setPrototypeOf((k(j={get stream(){return this[y]},next:function(){var K=this,E=this[C];if(null!==E)return Promise.reject(E);if(this[R])return Promise.resolve(S(void 0,!0));if(this[y].destroyed)return new Promise(function(oe,te){W.nextTick(function(){K[C]?te(K[C]):oe(S(void 0,!0))})});var Z,$=this[T];if($)Z=new Promise(function(O,K){return function(E,$){O.then(function(){K[R]?E(S(void 0,!0)):K[b](E,$)},$)}}($,this));else{var ae=this[y].read();if(null!==ae)return Promise.resolve(S(ae,!1));Z=new Promise(this[b])}return this[T]=Z,Z}},Symbol.asyncIterator,function(){return this}),k(j,"return",function(){var K=this;return new Promise(function(E,$){K[y].destroy(null,function(Z){Z?$(Z):E(S(void 0,!0))})})}),j),X);Se.exports=function(K){var E,$=Object.create(ue,(k(E={},y,{value:K,writable:!0}),k(E,H,{value:null,writable:!0}),k(E,v,{value:null,writable:!0}),k(E,C,{value:null,writable:!0}),k(E,R,{value:K._readableState.endEmitted,writable:!0}),k(E,b,{value:function(ae,oe){var te=$[y].read();te?($[T]=null,$[H]=null,$[v]=null,ae(S(te,!1))):($[H]=ae,$[v]=oe)},writable:!0}),E));return $[T]=null,Q(K,function(Z){if(Z&&"ERR_STREAM_PREMATURE_CLOSE"!==Z.code){var ae=$[v];return null!==ae&&($[T]=null,$[H]=null,$[v]=null,ae(Z)),void($[C]=Z)}var oe=$[H];null!==oe&&($[T]=null,$[H]=null,$[v]=null,oe(S(void 0,!0))),$[R]=!0}),K.on("readable",z.bind(null,$)),$}}).call(this)}).call(this,Y("_process"))},{"./end-of-stream":76,_process:44}],74:[function(Y,Se,he){"use strict";function W(A,z){var P=Object.keys(A);if(Object.getOwnPropertySymbols){var X=Object.getOwnPropertySymbols(A);z&&(X=X.filter(function(ue){return Object.getOwnPropertyDescriptor(A,ue).enumerable})),P.push.apply(P,X)}return P}function k(A,z,P){return z in A?Object.defineProperty(A,z,{value:P,enumerable:!0,configurable:!0,writable:!0}):A[z]=P,A}function H(A,z){for(var P=0;P0?this.tail.next=X:this.head=X,this.tail=X,++this.length}},{key:"unshift",value:function(P){var X={data:P,next:this.head};0===this.length&&(this.tail=X),this.head=X,++this.length}},{key:"shift",value:function(){if(0!==this.length){var P=this.head.data;return this.head=1===this.length?this.tail=null:this.head.next,--this.length,P}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(P){if(0===this.length)return"";for(var X=this.head,ue=""+X.data;X=X.next;)ue+=P+X.data;return ue}},{key:"concat",value:function(P){if(0===this.length)return R.alloc(0);for(var X=R.allocUnsafe(P>>>0),ue=this.head,I=0;ue;)S(ue.data,X,I),I+=ue.data.length,ue=ue.next;return X}},{key:"consume",value:function(P,X){var ue;return PO.length?O.length:P;if(I+=K===O.length?O:O.slice(0,P),0==(P-=K)){K===O.length?(++ue,this.head=X.next?X.next:this.tail=null):(this.head=X,X.data=O.slice(K));break}++ue}return this.length-=ue,I}},{key:"_getBuffer",value:function(P){var X=R.allocUnsafe(P),ue=this.head,I=1;for(ue.data.copy(X),P-=ue.data.length;ue=ue.next;){var O=ue.data,K=P>O.length?O.length:P;if(O.copy(X,X.length-P,0,K),0==(P-=K)){K===O.length?(++I,this.head=ue.next?ue.next:this.tail=null):(this.head=ue,ue.data=O.slice(K));break}++I}return this.length-=I,X}},{key:y,value:function(P,X){return b(this,function(A){for(var z=1;z0,function(Z){ue||(ue=Z),Z&&I.forEach(T),!E&&(I.forEach(T),X(ue))})});return z.reduce(b)}},{"../../../errors":67,"./end-of-stream":76}],79:[function(Y,Se,he){"use strict";var W=Y("../../../errors").codes.ERR_INVALID_OPT_VALUE;Se.exports={getHighWaterMark:function(Q,H,v,C){var R=function(Q,H,v){return null!=Q.highWaterMark?Q.highWaterMark:H?Q[v]:null}(H,C,v);if(null!=R){if(!isFinite(R)||Math.floor(R)!==R||R<0)throw new W(C?v:"highWaterMark",R);return Math.floor(R)}return Q.objectMode?16:16384}}},{"../../../errors":67}],80:[function(Y,Se,he){Se.exports=Y("events").EventEmitter},{events:8}],81:[function(Y,Se,he){(he=Se.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,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),function(j){for(var k in j)he.hasOwnProperty(k)||(he[k]=j[k])}(Y("./lib/Resolve"))},{"./lib/Resolve":83}],83:[function(Y,Se,he){"use strict";function j(H){const v=[];let C=0;for(;CR.join("")).join("/")}function k(H,v){let C=v+1;v>=0?"/"===H[v+1]&&"/"===H[v+2]&&(C=v+3):"/"===H[0]&&"/"===H[1]&&(C=2);const R=H.indexOf("/",C);return R<0?H:H.substr(0,R)+j(H.substr(R))}function Q(H){return!H||"#"===H||"?"===H||"/"===H}Object.defineProperty(he,"__esModule",{value:!0}),he.resolve=function(H,v){const C=(v=v||"").indexOf("#");if(C>0&&(v=v.substr(0,C)),!H.length){if(v.indexOf(":")<0)throw new Error(`Found invalid baseIRI '${v}' for value '${H}'`);return v}if(H.startsWith("?")){const z=v.indexOf("?");return z>0&&(v=v.substr(0,z)),v+H}if(H.startsWith("#"))return v+H;if(!v.length){const z=H.indexOf(":");if(z<0)throw new Error(`Found invalid relative IRI '${H}' for a missing baseIRI`);return k(H,z)}const R=H.indexOf(":");if(R>=0)return k(H,R);const T=v.indexOf(":");if(T<0)throw new Error(`Found invalid baseIRI '${v}' for value '${H}'`);const b=v.substr(0,T+1);if(0===H.indexOf("//"))return b+k(H,R);let y;if(v.indexOf("//",T)===T+1){if(y=v.indexOf("/",T+3),y<0)return v.length>T+3?v+"/"+k(H,R):b+k(H,R)}else if(y=v.indexOf("/",T+1),y<0)return b+k(H,R);if(0===H.indexOf("/"))return v.substr(0,y)+j(H);let S=v.substr(y);const A=S.lastIndexOf("/");return A>=0&&A"===de?(ne(G,"onsgmldeclaration",G.sgmlDecl),G.sgmlDecl="",G.state=te.TEXT):($(de)&&(G.state=te.SGML_DECL_QUOTED),G.sgmlDecl+=de);continue;case te.SGML_DECL_QUOTED:de===G.q&&(G.state=te.SGML_DECL,G.q=""),G.sgmlDecl+=de;continue;case te.DOCTYPE:">"===de?(G.state=te.TEXT,ne(G,"ondoctype",G.doctype),G.doctype=!0):(G.doctype+=de,"["===de?G.state=te.DOCTYPE_DTD:$(de)&&(G.state=te.DOCTYPE_QUOTED,G.q=de));continue;case te.DOCTYPE_QUOTED:G.doctype+=de,de===G.q&&(G.q="",G.state=te.DOCTYPE);continue;case te.DOCTYPE_DTD:G.doctype+=de,"]"===de?G.state=te.DOCTYPE:$(de)&&(G.state=te.DOCTYPE_DTD_QUOTED,G.q=de);continue;case te.DOCTYPE_DTD_QUOTED:G.doctype+=de,de===G.q&&(G.state=te.DOCTYPE_DTD,G.q="");continue;case te.COMMENT:"-"===de?G.state=te.COMMENT_ENDING:G.comment+=de;continue;case te.COMMENT_ENDING:"-"===de?(G.state=te.COMMENT_ENDED,G.comment=Oe(G.opt,G.comment),G.comment&&ne(G,"oncomment",G.comment),G.comment=""):(G.comment+="-"+de,G.state=te.COMMENT);continue;case te.COMMENT_ENDED:">"!==de?(Qe(G,"Malformed comment"),G.comment+="--"+de,G.state=te.COMMENT):G.state=te.TEXT;continue;case te.CDATA:"]"===de?G.state=te.CDATA_ENDING:G.cdata+=de;continue;case te.CDATA_ENDING:"]"===de?G.state=te.CDATA_ENDING_2:(G.cdata+="]"+de,G.state=te.CDATA);continue;case te.CDATA_ENDING_2:">"===de?(G.cdata&&ne(G,"oncdata",G.cdata),ne(G,"onclosecdata"),G.cdata="",G.state=te.TEXT):"]"===de?G.cdata+="]":(G.cdata+="]]"+de,G.state=te.CDATA);continue;case te.PROC_INST:"?"===de?G.state=te.PROC_INST_ENDING:E(de)?G.state=te.PROC_INST_BODY:G.procInstName+=de;continue;case te.PROC_INST_BODY:if(!G.procInstBody&&E(de))continue;"?"===de?G.state=te.PROC_INST_ENDING:G.procInstBody+=de;continue;case te.PROC_INST_ENDING:">"===de?(ne(G,"onprocessinginstruction",{name:G.procInstName,body:G.procInstBody}),G.procInstName=G.procInstBody="",G.state=te.TEXT):(G.procInstBody+="?"+de,G.state=te.PROC_INST_BODY);continue;case te.OPEN_TAG:ae(I,de)?G.tagName+=de:(tt(G),">"===de?Le(G):"/"===de?G.state=te.OPEN_TAG_SLASH:(E(de)||Qe(G,"Invalid character in tag name"),G.state=te.ATTRIB));continue;case te.OPEN_TAG_SLASH:">"===de?(Le(G,!0),Ke(G)):(Qe(G,"Forward-slash in opening tag not followed by >"),G.state=te.ATTRIB);continue;case te.ATTRIB:if(E(de))continue;">"===de?Le(G):"/"===de?G.state=te.OPEN_TAG_SLASH:ae(ue,de)?(G.attribName=de,G.attribValue="",G.state=te.ATTRIB_NAME):Qe(G,"Invalid attribute name");continue;case te.ATTRIB_NAME:"="===de?G.state=te.ATTRIB_VALUE:">"===de?(Qe(G,"Attribute without value"),G.attribValue=G.attribName,ze(G),Le(G)):E(de)?G.state=te.ATTRIB_NAME_SAW_WHITE:ae(I,de)?G.attribName+=de:Qe(G,"Invalid attribute name");continue;case te.ATTRIB_NAME_SAW_WHITE:if("="===de)G.state=te.ATTRIB_VALUE;else{if(E(de))continue;Qe(G,"Attribute without value"),G.tag.attributes[G.attribName]="",G.attribValue="",ne(G,"onattribute",{name:G.attribName,value:""}),G.attribName="",">"===de?Le(G):ae(ue,de)?(G.attribName=de,G.state=te.ATTRIB_NAME):(Qe(G,"Invalid attribute name"),G.state=te.ATTRIB)}continue;case te.ATTRIB_VALUE:if(E(de))continue;$(de)?(G.q=de,G.state=te.ATTRIB_VALUE_QUOTED):(Qe(G,"Unquoted attribute value"),G.state=te.ATTRIB_VALUE_UNQUOTED,G.attribValue=de);continue;case te.ATTRIB_VALUE_QUOTED:if(de!==G.q){"&"===de?G.state=te.ATTRIB_VALUE_ENTITY_Q:G.attribValue+=de;continue}ze(G),G.q="",G.state=te.ATTRIB_VALUE_CLOSED;continue;case te.ATTRIB_VALUE_CLOSED:E(de)?G.state=te.ATTRIB:">"===de?Le(G):"/"===de?G.state=te.OPEN_TAG_SLASH:ae(ue,de)?(Qe(G,"No whitespace between attributes"),G.attribName=de,G.attribValue="",G.state=te.ATTRIB_NAME):Qe(G,"Invalid attribute name");continue;case te.ATTRIB_VALUE_UNQUOTED:if(!Z(de)){"&"===de?G.state=te.ATTRIB_VALUE_ENTITY_U:G.attribValue+=de;continue}ze(G),">"===de?Le(G):G.state=te.ATTRIB;continue;case te.CLOSE_TAG:if(G.tagName)">"===de?Ke(G):ae(I,de)?G.tagName+=de:G.script?(G.script+=""===de?Ke(G):Qe(G,"Invalid characters in closing tag");continue;case te.TEXT_ENTITY:case te.ATTRIB_VALUE_ENTITY_Q:case te.ATTRIB_VALUE_ENTITY_U:var pt,we;switch(G.state){case te.TEXT_ENTITY:pt=te.TEXT,we="textNode";break;case te.ATTRIB_VALUE_ENTITY_Q:pt=te.ATTRIB_VALUE_QUOTED,we="attribValue";break;case te.ATTRIB_VALUE_ENTITY_U:pt=te.ATTRIB_VALUE_UNQUOTED,we="attribValue"}";"===de?(G[we]+=Me(G),G.entity="",G.state=pt):ae(G.entity.length?K:O,de)?G.entity+=de:(Qe(G,"Invalid character in entity name"),G[we]+="&"+G.entity+de,G.entity="",G.state=pt);continue;default:throw new Error(G,"Unknown state: "+G.state)}return G.position>=G.bufferCheckPosition&&function(q){for(var G=Math.max(j.MAX_BUFFER_LENGTH,10),pe=0,de=0,je=k.length;deG)switch(k[de]){case"textNode":ye(q);break;case"cdata":ne(q,"oncdata",q.cdata),q.cdata="";break;case"script":ne(q,"onscript",q.script),q.script="";break;default:$e(q,"Max buffer length exceeded: "+k[de])}pe=Math.max(pe,_t)}q.bufferCheckPosition=j.MAX_BUFFER_LENGTH-pe+q.position}(G),G},resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){!function(q){ye(q),""!==q.cdata&&(ne(q,"oncdata",q.cdata),q.cdata=""),""!==q.script&&(ne(q,"onscript",q.script),q.script="")}(this)}};try{R=Y("stream").Stream}catch(q){R=function(){}}var T=j.EVENTS.filter(function(q){return"error"!==q&&"end"!==q});function y(q,G){if(!(this instanceof y))return new y(q,G);R.apply(this),this._parser=new Q(q,G),this.writable=!0,this.readable=!0;var pe=this;this._parser.onend=function(){pe.emit("end")},this._parser.onerror=function(de){pe.emit("error",de),pe._parser.error=null},this._decoder=null,T.forEach(function(de){Object.defineProperty(pe,"on"+de,{get:function(){return pe._parser["on"+de]},set:function(je){if(!je)return pe.removeAllListeners(de),pe._parser["on"+de]=je,je;pe.on(de,je)},enumerable:!0,configurable:!1})})}(y.prototype=Object.create(R.prototype,{constructor:{value:y}})).write=function(q){if("function"==typeof W&&"function"==typeof W.isBuffer&&W.isBuffer(q)){if(!this._decoder){var G=Y("string_decoder").StringDecoder;this._decoder=new G("utf8")}q=this._decoder.write(q)}return this._parser.write(q.toString()),this.emit("data",q),!0},y.prototype.end=function(q){return q&&q.length&&this.write(q),this._parser.end(),!0},y.prototype.on=function(q,G){var pe=this;return!pe._parser["on"+q]&&-1!==T.indexOf(q)&&(pe._parser["on"+q]=function(){var de=1===arguments.length?[arguments[0]]:Array.apply(null,arguments);de.splice(0,0,q),pe.emit.apply(pe,de)}),R.prototype.on.call(pe,q,G)};var z="http://www.w3.org/XML/1998/namespace",P="http://www.w3.org/2000/xmlns/",X={xml:z,xmlns:P},ue=/[:_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]/,I=/[:_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-]/,O=/[#:_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]/,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\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;function E(q){return" "===q||"\n"===q||"\r"===q||"\t"===q}function $(q){return'"'===q||"'"===q}function Z(q){return">"===q||E(q)}function ae(q,G){return q.test(G)}function oe(q,G){return!ae(q,G)}var q,G,pe,te=0;for(var Te in j.STATE={BEGIN:te++,BEGIN_WHITESPACE:te++,TEXT:te++,TEXT_ENTITY:te++,OPEN_WAKA:te++,SGML_DECL:te++,SGML_DECL_QUOTED:te++,DOCTYPE:te++,DOCTYPE_QUOTED:te++,DOCTYPE_DTD:te++,DOCTYPE_DTD_QUOTED:te++,COMMENT_STARTING:te++,COMMENT:te++,COMMENT_ENDING:te++,COMMENT_ENDED:te++,CDATA:te++,CDATA_ENDING:te++,CDATA_ENDING_2:te++,PROC_INST:te++,PROC_INST_BODY:te++,PROC_INST_ENDING:te++,OPEN_TAG:te++,OPEN_TAG_SLASH:te++,ATTRIB:te++,ATTRIB_NAME:te++,ATTRIB_NAME_SAW_WHITE:te++,ATTRIB_VALUE:te++,ATTRIB_VALUE_QUOTED:te++,ATTRIB_VALUE_CLOSED:te++,ATTRIB_VALUE_UNQUOTED:te++,ATTRIB_VALUE_ENTITY_Q:te++,ATTRIB_VALUE_ENTITY_U:te++,CLOSE_TAG:te++,CLOSE_TAG_SAW_WHITE:te++,SCRIPT:te++,SCRIPT_ENDING:te++},j.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},j.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(j.ENTITIES).forEach(function(q){var G=j.ENTITIES[q],pe="number"==typeof G?String.fromCharCode(G):G;j.ENTITIES[q]=pe}),j.STATE)j.STATE[j.STATE[Te]]=Te;function me(q,G,pe){q[G]&&q[G](pe)}function ne(q,G,pe){q.textNode&&ye(q),me(q,G,pe)}function ye(q){q.textNode=Oe(q.opt,q.textNode),q.textNode&&me(q,"ontext",q.textNode),q.textNode=""}function Oe(q,G){return q.trim&&(G=G.trim()),q.normalize&&(G=G.replace(/\s+/g," ")),G}function $e(q,G){return ye(q),q.trackPosition&&(G+="\nLine: "+q.line+"\nColumn: "+q.column+"\nChar: "+q.c),G=new Error(G),q.error=G,me(q,"onerror",G),q}function st(q){return q.sawRoot&&!q.closedRoot&&Qe(q,"Unclosed root tag"),q.state!==te.BEGIN&&q.state!==te.BEGIN_WHITESPACE&&q.state!==te.TEXT&&$e(q,"Unexpected end"),ye(q),q.c="",q.closed=!0,me(q,"onend"),Q.call(q,q.strict,q.opt),q}function Qe(q,G){if("object"!=typeof q||!(q instanceof Q))throw new Error("bad call to strictFail");q.strict&&$e(q,G)}function tt(q){q.strict||(q.tagName=q.tagName[q.looseCase]());var G=q.tags[q.tags.length-1]||q,pe=q.tag={name:q.tagName,attributes:{}};q.opt.xmlns&&(pe.ns=G.ns),q.attribList.length=0,ne(q,"onopentagstart",pe)}function Xe(q,G){var de=q.indexOf(":")<0?["",q]:q.split(":"),je=de[0],_t=de[1];return G&&"xmlns"===q&&(je="xmlns",_t=""),{prefix:je,local:_t}}function ze(q){if(q.strict||(q.attribName=q.attribName[q.looseCase]()),-1!==q.attribList.indexOf(q.attribName)||q.tag.attributes.hasOwnProperty(q.attribName))q.attribName=q.attribValue="";else{if(q.opt.xmlns){var G=Xe(q.attribName,!0),de=G.local;if("xmlns"===G.prefix)if("xml"===de&&q.attribValue!==z)Qe(q,"xml: prefix must be bound to "+z+"\nActual: "+q.attribValue);else if("xmlns"===de&&q.attribValue!==P)Qe(q,"xmlns: prefix must be bound to "+P+"\nActual: "+q.attribValue);else{var je=q.tag,_t=q.tags[q.tags.length-1]||q;je.ns===_t.ns&&(je.ns=Object.create(_t.ns)),je.ns[de]=q.attribValue}q.attribList.push([q.attribName,q.attribValue])}else q.tag.attributes[q.attribName]=q.attribValue,ne(q,"onattribute",{name:q.attribName,value:q.attribValue});q.attribName=q.attribValue=""}}function Le(q,G){if(q.opt.xmlns){var pe=q.tag,de=Xe(q.tagName);pe.prefix=de.prefix,pe.local=de.local,pe.uri=pe.ns[de.prefix]||"",pe.prefix&&!pe.uri&&(Qe(q,"Unbound namespace prefix: "+JSON.stringify(q.tagName)),pe.uri=de.prefix),pe.ns&&(q.tags[q.tags.length-1]||q).ns!==pe.ns&&Object.keys(pe.ns).forEach(function(In){ne(q,"onopennamespace",{prefix:In,uri:pe.ns[In]})});for(var _t=0,pt=q.attribList.length;_t",q.tagName="",void(q.state=te.SCRIPT);ne(q,"onscript",q.script),q.script=""}var G=q.tags.length,pe=q.tagName;q.strict||(pe=pe[q.looseCase]());for(var de=pe;G--&&q.tags[G].name!==de;)Qe(q,"Unexpected close tag");if(G<0)return Qe(q,"Unmatched closing tag: "+q.tagName),q.textNode+="",void(q.state=te.TEXT);q.tagName=pe;for(var _t=q.tags.length;_t-- >G;){var pt=q.tag=q.tags.pop();q.tagName=q.tag.name,ne(q,"onclosetag",q.tagName);var we={};for(var B in pt.ns)we[B]=pt.ns[B];q.opt.xmlns&&pt.ns!==(q.tags[q.tags.length-1]||q).ns&&Object.keys(pt.ns).forEach(function(V){ne(q,"onclosenamespace",{prefix:V,uri:pt.ns[V]})})}0===G&&(q.closedRoot=!0),q.tagName=q.attribValue=q.attribName="",q.attribList.length=0,q.state=te.TEXT}function Me(q){var de,G=q.entity,pe=G.toLowerCase(),je="";return q.ENTITIES[G]?q.ENTITIES[G]:q.ENTITIES[pe]?q.ENTITIES[pe]:("#"===(G=pe).charAt(0)&&("x"===G.charAt(1)?(G=G.slice(2),je=(de=parseInt(G,16)).toString(16)):(G=G.slice(1),je=(de=parseInt(G,10)).toString(10))),G=G.replace(/^0+/,""),isNaN(de)||je.toLowerCase()!==G?(Qe(q,"Invalid character entity"),"&"+q.entity+";"):String.fromCodePoint(de))}function Ue(q,G){"<"===G?(q.state=te.OPEN_WAKA,q.startTagPosition=q.position):E(G)||(Qe(q,"Non-whitespace before first tag."),q.textNode=G,q.state=te.TEXT)}function qe(q,G){var pe="";return G1114111||G(V)!==V)throw RangeError("Invalid code point: "+V);V<=65535?je.push(V):je.push(55296+((V-=65536)>>10),V%1024+56320),(we+1===B||je.length>de)&&(N+=q.apply(null,je),je.length=0)}return N},Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:pe,configurable:!0,writable:!0}):String.fromCodePoint=pe)}(void 0===he?this.sax={}:he)}).call(this)}).call(this,Y("buffer").Buffer)},{buffer:6,stream:87,string_decoder:5}],86:[function(Y,Se,he){(function(W,j){(function(){!function(k,Q){"use strict";if(!k.setImmediate){var T,H=1,v={},C=!1,R=k.document,K=Object.getPrototypeOf&&Object.getPrototypeOf(k);K=K&&K.setTimeout?K:k,"[object process]"==={}.toString.call(k.process)?T=function(E){W.nextTick(function(){A(E)})}:function(){if(k.postMessage&&!k.importScripts){var E=!0,$=k.onmessage;return k.onmessage=function(){E=!1},k.postMessage("","*"),k.onmessage=$,E}}()?(E="setImmediate$"+Math.random()+"$",$=function(Z){Z.source===k&&"string"==typeof Z.data&&0===Z.data.indexOf(E)&&A(+Z.data.slice(E.length))},k.addEventListener?k.addEventListener("message",$,!1):k.attachEvent("onmessage",$),T=function(Z){k.postMessage(E+Z,"*")}):k.MessageChannel?function(){var E=new MessageChannel;E.port1.onmessage=function($){A($.data)},T=function($){E.port2.postMessage($)}}():R&&"onreadystatechange"in R.createElement("script")?function(){var E=R.documentElement;T=function($){var Z=R.createElement("script");Z.onreadystatechange=function(){A($),Z.onreadystatechange=null,E.removeChild(Z),Z=null},E.appendChild(Z)}}():T=function(E){setTimeout(A,0,E)},K.setImmediate=function(E){"function"!=typeof E&&(E=new Function(""+E));for(var $=new Array(arguments.length-1),Z=0;Z<$.length;Z++)$[Z]=arguments[Z+1];return v[H]={callback:E,args:$},T(H),H++},K.clearImmediate=y}var E,$;function y(E){delete v[E]}function A(E){if(C)setTimeout(A,0,E);else{var $=v[E];if($){C=!0;try{!function(E){var $=E.callback,Z=E.args;switch(Z.length){case 0:$();break;case 1:$(Z[0]);break;case 2:$(Z[0],Z[1]);break;case 3:$(Z[0],Z[1],Z[2]);break;default:$.apply(void 0,Z)}}($)}finally{y(E),C=!1}}}}}("undefined"==typeof self?void 0===j?this:j:self)}).call(this)}).call(this,Y("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:44}],87:[function(Y,Se,he){Se.exports=k;var W=Y("events").EventEmitter;function k(){W.call(this)}Y("inherits")(k,W),k.Readable=Y("readable-stream/lib/_stream_readable.js"),k.Writable=Y("readable-stream/lib/_stream_writable.js"),k.Duplex=Y("readable-stream/lib/_stream_duplex.js"),k.Transform=Y("readable-stream/lib/_stream_transform.js"),k.PassThrough=Y("readable-stream/lib/_stream_passthrough.js"),k.finished=Y("readable-stream/lib/internal/streams/end-of-stream.js"),k.pipeline=Y("readable-stream/lib/internal/streams/pipeline.js"),k.Stream=k,k.prototype.pipe=function(Q,H){var v=this;function C(z){Q.writable&&!1===Q.write(z)&&v.pause&&v.pause()}function R(){v.readable&&v.resume&&v.resume()}v.on("data",C),Q.on("drain",R),!Q._isStdio&&(!H||!1!==H.end)&&(v.on("end",b),v.on("close",y));var T=!1;function b(){T||(T=!0,Q.end())}function y(){T||(T=!0,"function"==typeof Q.destroy&&Q.destroy())}function S(z){if(A(),0===W.listenerCount(this,"error"))throw z}function A(){v.removeListener("data",C),Q.removeListener("drain",R),v.removeListener("end",b),v.removeListener("close",y),v.removeListener("error",S),Q.removeListener("error",S),v.removeListener("end",A),v.removeListener("close",A),Q.removeListener("close",A)}return v.on("error",S),Q.on("error",S),v.on("end",A),v.on("close",A),Q.on("close",A),Q.emit("pipe",v),Q}},{events:8,inherits:10,"readable-stream/lib/_stream_duplex.js":68,"readable-stream/lib/_stream_passthrough.js":69,"readable-stream/lib/_stream_readable.js":70,"readable-stream/lib/_stream_transform.js":71,"readable-stream/lib/_stream_writable.js":72,"readable-stream/lib/internal/streams/end-of-stream.js":76,"readable-stream/lib/internal/streams/pipeline.js":78}],88:[function(Y,Se,he){arguments[4][5][0].apply(he,arguments)},{dup:5,"safe-buffer":84}],89:[function(Y,Se,he){(function(W,j){(function(){var k=Y("process/browser.js").nextTick,Q=Function.prototype.apply,H=Array.prototype.slice,v={},C=0;function R(T,b){this._id=T,this._clearFn=b}he.setTimeout=function(){return new R(Q.call(setTimeout,window,arguments),clearTimeout)},he.setInterval=function(){return new R(Q.call(setInterval,window,arguments),clearInterval)},he.clearTimeout=he.clearInterval=function(T){T.close()},R.prototype.unref=R.prototype.ref=function(){},R.prototype.close=function(){this._clearFn.call(window,this._id)},he.enroll=function(T,b){clearTimeout(T._idleTimeoutId),T._idleTimeout=b},he.unenroll=function(T){clearTimeout(T._idleTimeoutId),T._idleTimeout=-1},he._unrefActive=he.active=function(T){clearTimeout(T._idleTimeoutId);var b=T._idleTimeout;b>=0&&(T._idleTimeoutId=setTimeout(function(){T._onTimeout&&T._onTimeout()},b))},he.setImmediate="function"==typeof W?W:function(T){var b=C++,y=!(arguments.length<2)&&H.call(arguments,1);return v[b]=!0,k(function(){v[b]&&(y?T.apply(null,y):T.call(null),he.clearImmediate(b))}),b},he.clearImmediate="function"==typeof j?j:function(T){delete v[T]}}).call(this)}).call(this,Y("timers").setImmediate,Y("timers").clearImmediate)},{"process/browser.js":44,timers:89}],90:[function(Y,Se,he){(function(W){(function(){function k(Q){try{if(!W.localStorage)return!1}catch(v){return!1}var H=W.localStorage[Q];return null!=H&&"true"===String(H).toLowerCase()}Se.exports=function(Q,H){if(k("noDeprecation"))return Q;var v=!1;return function(){if(!v){if(k("throwDeprecation"))throw new Error(H);k("traceDeprecation")?console.trace(H):console.warn(H),v=!0}return Q.apply(this,arguments)}}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],91:[function(Y,Se,he){"use strict";Se.exports=function(W){W.prototype[Symbol.iterator]=function*(){for(let j=this.head;j;j=j.next)yield j.value}}},{}],92:[function(Y,Se,he){"use strict";function W(v){var C=this;if(C instanceof W||(C=new W),C.tail=null,C.head=null,C.length=0,v&&"function"==typeof v.forEach)v.forEach(function(b){C.push(b)});else if(arguments.length>0)for(var R=0,T=arguments.length;R1)R=C;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");T=this.head.next,R=this.head.value}for(var b=0;null!==T;b++)R=v(R,T.value,b),T=T.next;return R},W.prototype.reduceReverse=function(v,C){var R,T=this.tail;if(arguments.length>1)R=C;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");T=this.tail.prev,R=this.tail.value}for(var b=this.length-1;null!==T;b--)R=v(R,T.value,b),T=T.prev;return R},W.prototype.toArray=function(){for(var v=new Array(this.length),C=0,R=this.head;null!==R;C++)v[C]=R.value,R=R.next;return v},W.prototype.toArrayReverse=function(){for(var v=new Array(this.length),C=0,R=this.tail;null!==R;C++)v[C]=R.value,R=R.prev;return v},W.prototype.slice=function(v,C){(C=C||this.length)<0&&(C+=this.length),(v=v||0)<0&&(v+=this.length);var R=new W;if(Cthis.length&&(C=this.length);for(var T=0,b=this.head;null!==b&&Tthis.length&&(C=this.length);for(var T=this.length,b=this.tail;null!==b&&T>C;T--)b=b.prev;for(;null!==b&&T>v;T--,b=b.prev)R.push(b.value);return R},W.prototype.splice=function(v,C,...R){v>this.length&&(v=this.length-1),v<0&&(v=this.length+v);for(var T=0,b=this.head;null!==b&&T{"use strict";Ut.exports=et,Ut.exports.default=et;var it=1e20;function et(Y,Se,he,W,j,k){this.fontSize=Y||24,this.buffer=void 0===Se?3:Se,this.cutoff=W||.25,this.fontFamily=j||"sans-serif",this.fontWeight=k||"normal",this.radius=he||8;var Q=this.size=this.fontSize+2*this.buffer,H=Q+2*this.buffer;this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=Q,this.ctx=this.canvas.getContext("2d"),this.ctx.font=this.fontWeight+" "+this.fontSize+"px "+this.fontFamily,this.ctx.textAlign="left",this.ctx.fillStyle="black",this.gridOuter=new Float64Array(H*H),this.gridInner=new Float64Array(H*H),this.f=new Float64Array(H),this.z=new Float64Array(H+1),this.v=new Uint16Array(H),this.useMetrics=void 0!==this.ctx.measureText("A").actualBoundingBoxLeft,this.middle=Math.round(Q/2*(navigator.userAgent.indexOf("Gecko/")>=0?1.2:1))}function Dt(Y,Se,he,W,j,k){for(var Q=0;Q-1);k[++v]=H,Q[v]=C,Q[v+1]=it}for(H=0,v=0;H{Ut.exports=function(et,yt){var ee=yt.length;if(0!==ee){var Dt=et.length;et.length+=ee;for(var dt=0;dt{"use strict";var yt=(()=>{return(Dt=yt||(yt={})).typeOfFunction="function",Dt.boolTrue=!0,yt;var Dt})();function ee(Dt,dt,Y){if(!Y||typeof Y.value!==yt.typeOfFunction)throw new TypeError("Only methods can be decorated with @bind. <"+dt+"> is not a method!");return{configurable:yt.boolTrue,get:function(){var Se=Y.value.bind(this);return Object.defineProperty(this,dt,{value:Se,configurable:yt.boolTrue,writable:yt.boolTrue}),Se}}}it.ak=ee,it.ZP=ee},7266:(Ut,it,et)=>{Ut.exports={ResizeSensor:et(9835),ElementQueries:et(4845)}},4845:function(Ut,it,et){"use strict";var yt,ee,Dt;"undefined"!=typeof window&&window,ee=[et(9835)],void 0!==(Dt="function"==typeof(yt=function(dt){var Y=function(){var he,W={},j=[];function k(I){I||(I=document.documentElement);var O=window.getComputedStyle(I,null).fontSize;return parseFloat(O)||16}function H(I,O){var K=O.split(/\d/),E=K[K.length-1];switch(O=parseFloat(O),E){case"px":return O;case"em":return O*k(I);case"rem":return O*k();case"vw":return O*document.documentElement.clientWidth/100;case"vh":return O*document.documentElement.clientHeight/100;case"vmin":case"vmax":var $=document.documentElement.clientWidth/100,Z=document.documentElement.clientHeight/100;return O*(0,Math["vmin"===E?"min":"max"])($,Z);default:return O}}function v(I,O){this.element=I;var K,E,$,Z,ae,oe,te,Te,me=["min-width","min-height","max-width","max-height"];this.call=function(){for(K in $=function(I){if(!I.getBoundingClientRect)return{width:I.offsetWidth,height:I.offsetHeight};var O=I.getBoundingClientRect();return{width:Math.round(O.width),height:Math.round(O.height)}}(this.element),oe={},W[O])!W[O].hasOwnProperty(K)||(Z=H(this.element,(E=W[O][K]).value),ae="width"===E.property?$.width:$.height,te="","min"===E.mode&&ae>=Z&&(te+=E.value),"max"===E.mode&&ae<=Z&&(te+=E.value),oe[Te=E.mode+"-"+E.property]||(oe[Te]=""),te&&-1===(" "+oe[Te]+" ").indexOf(" "+te+" ")&&(oe[Te]+=" "+te));for(var ne in me)!me.hasOwnProperty(ne)||(oe[me[ne]]?this.element.setAttribute(me[ne],oe[me[ne]].substr(1)):this.element.removeAttribute(me[ne]))}}function C(I,O){I.elementQueriesSetupInformation||(I.elementQueriesSetupInformation=new v(I,O)),I.elementQueriesSensor||(I.elementQueriesSensor=new dt(I,function(){I.elementQueriesSetupInformation.call()}))}function R(I,O,K,E){if(void 0===W[I]){W[I]=[];var $=j.length;he.innerHTML+="\n"+I+" {animation: 0.1s element-queries;}",he.innerHTML+="\n"+I+" > .resize-sensor {min-width: "+$+"px;}",j.push(I)}W[I].push({mode:O,property:K,value:E})}function T(I){var O;if(document.querySelectorAll&&(O=I?I.querySelectorAll.bind(I):document.querySelectorAll.bind(document)),!O&&"undefined"!=typeof $$&&(O=$$),!O&&"undefined"!=typeof jQuery&&(O=jQuery),!O)throw"No document.querySelectorAll, jQuery or Mootools's $$ found.";return O}function y(I){var O=[],K=[],E=[],$=0,Z=-1,ae=[];for(var oe in I.children)if(I.children.hasOwnProperty(oe)&&I.children[oe].tagName&&"img"===I.children[oe].tagName.toLowerCase()){O.push(I.children[oe]);var te=I.children[oe].getAttribute("min-width")||I.children[oe].getAttribute("data-min-width"),Te=I.children[oe].getAttribute("data-src")||I.children[oe].getAttribute("url");E.push(Te),K.push({minWidth:te}),te?I.children[oe].style.display="none":($=O.length-1,I.children[oe].style.display="block")}function ne(){var Oe,ye=!1;for(Oe in O)!O.hasOwnProperty(Oe)||K[Oe].minWidth&&I.offsetWidth>K[Oe].minWidth&&(ye=Oe);if(ye||(ye=$),Z!==ye)if(ae[ye])O[Z].style.display="none",O[ye].style.display="block",Z=ye;else{var $e=new Image;$e.onload=function(){O[ye].src=E[ye],O[Z].style.display="none",O[ye].style.display="block",ae[ye]=!0,Z=ye},$e.src=E[ye]}else O[ye].src=E[ye]}Z=$,I.resizeSensorInstance=new dt(I,ne),ne()}var A=/,?[\s\t]*([^,\n]*?)((?:\[[\s\t]*?(?:min|max)-(?:width|height)[\s\t]*?[~$\^]?=[\s\t]*?"[^"]*?"[\s\t]*?])+)([^,\n\s\{]*)/gim,z=/\[[\s\t]*?(min|max)-(width|height)[\s\t]*?[~$\^]?=[\s\t]*?"([^"]*?)"[\s\t]*?]/gim;function P(I){var O,K,E,$;for(I=I.replace(/'/g,'"');null!==(O=A.exec(I));)for(K=O[1]+O[3],E=O[2];null!==($=z.exec(E));)R(K,$[1],$[2],$[3])}function X(I){var O="";if(I)if("string"==typeof I)(-1!==(I=I.toLowerCase()).indexOf("min-width")||-1!==I.indexOf("max-width"))&&P(I);else for(var K=0,E=I.length;K 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),ue=!0);for(var O=0,K=document.styleSheets.length;O{var yt=et(3910),ee=et(9369),Dt=et(322);function dt(Q,H,v){if(!yt(Q))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(!Q.hasNode(H))throw new Error('graphology-shortest-path: the "'+H+'" source node does not exist in the given graph.');if(!Q.hasNode(v))throw new Error('graphology-shortest-path: the "'+v+'" target node does not exist in the given graph.');if((H=""+H)==(v=""+v))return[H];var C=Q.inboundNeighbors.bind(Q),R=Q.outboundNeighbors.bind(Q),T={},b={};T[H]=null,b[v]=null;var A,z,P,X,ue,I,O,K,y=[H],S=[v],E=!1;e:for(;y.length&&S.length;)if(y.length<=S.length){for(A=y,y=[],ue=0,O=A.length;ue{Ut.exports=function(et){return null!==et&&"object"==typeof et&&"function"==typeof et.addUndirectedEdgeWithKey&&"function"==typeof et.dropNode&&"boolean"==typeof et.multi}},698:function(Ut){Ut.exports=function(){"use strict";function it(re){return(it="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(fe){return typeof fe}:function(fe){return fe&&"function"==typeof Symbol&&fe.constructor===Symbol&&fe!==Symbol.prototype?"symbol":typeof fe})(re)}function et(re,fe){re.prototype=Object.create(fe.prototype),re.prototype.constructor=re,ee(re,fe)}function yt(re){return(yt=Object.setPrototypeOf?Object.getPrototypeOf:function(fe){return fe.__proto__||Object.getPrototypeOf(fe)})(re)}function ee(re,fe){return(ee=Object.setPrototypeOf||function(se,M){return se.__proto__=M,se})(re,fe)}function Dt(){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(re){return!1}}function dt(re,fe,se){return(dt=Dt()?Reflect.construct:function(M,L,J){var Ee=[null];Ee.push.apply(Ee,L);var Fe=new(Function.bind.apply(M,Ee));return J&&ee(Fe,J.prototype),Fe}).apply(null,arguments)}function Y(re){var fe="function"==typeof Map?new Map:void 0;return(Y=function(se){if(null===se||-1===Function.toString.call(se).indexOf("[native code]"))return se;if("function"!=typeof se)throw new TypeError("Super expression must either be null or a function");if(void 0!==fe){if(fe.has(se))return fe.get(se);fe.set(se,L)}function L(){return dt(se,arguments,yt(this).constructor)}return L.prototype=Object.create(se.prototype,{constructor:{value:L,enumerable:!1,writable:!0,configurable:!0}}),ee(L,se)})(re)}function Se(re){if(void 0===re)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return re}var he=function(){for(var re=arguments[0],fe=1,se=arguments.length;fe0&&Ee.length>L&&!Ee.warned){Ee.warned=!0;var nt=new Error("Possible EventEmitter memory leak detected. "+Ee.length+" "+String(fe)+" listeners added. Use emitter.setMaxListeners() to increase limit");nt.name="MaxListenersExceededWarning",nt.emitter=re,nt.type=fe,nt.count=Ee.length,console&&console.warn&&console.warn(nt)}return re}function I(){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(re,fe,se){var M={fired:!1,wrapFn:void 0,target:re,type:fe,listener:se},L=I.bind(M);return L.listener=se,M.wrapFn=L,L}function K(re,fe,se){var M=re._events;if(void 0===M)return[];var L=M[fe];return void 0===L?[]:"function"==typeof L?se?[L.listener||L]:[L]:se?function(J){for(var Ee=new Array(J.length),Fe=0;Fe0&&(J=fe[0]),J instanceof Error)throw J;var Ee=new Error("Unhandled error."+(J?" ("+J.message+")":""));throw Ee.context=J,Ee}var Fe=L[re];if(void 0===Fe)return!1;if("function"==typeof Fe)y(Fe,this,fe);else{var nt=Fe.length,Pt=$(Fe,nt);for(se=0;se=0;J--)if(se[J]===fe||se[J].listener===fe){Ee=se[J].listener,L=J;break}if(L<0)return this;0===L?se.shift():function(Fe,nt){for(;nt+1=0;M--)this.removeListener(re,fe[M]);return this},A.prototype.listeners=function(re){return K(this,re,!0)},A.prototype.rawListeners=function(re){return K(this,re,!1)},A.listenerCount=function(re,fe){return"function"==typeof re.listenerCount?re.listenerCount(fe):E.call(re,fe)},A.prototype.listenerCount=E,A.prototype.eventNames=function(){return this._eventsCount>0?R(this._events):[]},ae.prototype.next=function(){if(this.done)return{done:!0};var re=this._next();return re.done&&(this.done=!0),re},"undefined"!=typeof Symbol&&(ae.prototype[Symbol.iterator]=function(){return this}),ae.of=function(){var re=arguments,fe=re.length,se=0;return new ae(function(){return se>=fe?{done:!0}:{done:!1,value:re[se++]}})},ae.empty=function(){var re=new ae(null);return re.done=!0,re},ae.is=function(re){return re instanceof ae||"object"==typeof re&&null!==re&&"function"==typeof re.next};var oe=ae,te=function(re,fe){for(var se,M=arguments.length>1?fe:1/0,L=M!==1/0?new Array(M):[],J=0;;){if(J===M)return L;if((se=re.next()).done)return J!==fe?L.slice(0,J):L;L[J++]=se.value}},Te=function(re){function fe(se,M){var L;return(L=re.call(this)||this).name="GraphError",L.message=se||"",L.data=M||{},L}return et(fe,re),fe}(Y(Error)),me=function(re){function fe(se,M){var L;return(L=re.call(this,se,M)||this).name="InvalidArgumentsGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(Se(L),fe.prototype.constructor),L}return et(fe,re),fe}(Te),ne=function(re){function fe(se,M){var L;return(L=re.call(this,se,M)||this).name="NotFoundGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(Se(L),fe.prototype.constructor),L}return et(fe,re),fe}(Te),ye=function(re){function fe(se,M){var L;return(L=re.call(this,se,M)||this).name="UsageGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(Se(L),fe.prototype.constructor),L}return et(fe,re),fe}(Te);function Oe(re,fe){this.key=re,this.attributes=fe,this.inDegree=0,this.outDegree=0,this.undirectedDegree=0,this.directedSelfLoops=0,this.undirectedSelfLoops=0,this.in={},this.out={},this.undirected={}}function $e(re,fe){this.key=re,this.attributes=fe,this.inDegree=0,this.outDegree=0,this.directedSelfLoops=0,this.in={},this.out={}}function st(re,fe){this.key=re,this.attributes=fe,this.undirectedDegree=0,this.undirectedSelfLoops=0,this.undirected={}}function Qe(re,fe,se,M,L,J){this.key=fe,this.attributes=J,this.undirected=re,this.source=M,this.target=L,this.generatedKey=se}function tt(re,fe,se,M,L,J,Ee){var Fe,nt,Pt="out",We="in";if(fe&&(Pt=We="undirected"),re.multi){if(void 0===(nt=(Fe=J[Pt])[L])&&(nt=new Set,Fe[L]=nt),nt.add(se),M===L&&fe)return;void 0===(Fe=Ee[We])[M]&&(Fe[M]=nt)}else{if(J[Pt][L]=se,M===L&&fe)return;Ee[We][M]=se}}function Xe(re,fe,se){var M=re.multi,L=se.source,J=se.target,Ee=L.key,Fe=J.key,nt=L[fe?"undirected":"out"],Pt=fe?"undirected":"in";if(Fe in nt)if(M){var We=nt[Fe];1===We.size?(delete nt[Fe],delete J[Pt][Ee]):We.delete(se)}else delete nt[Fe];M||delete J[Pt][Ee]}$e.prototype.upgradeToMixed=function(){this.undirectedDegree=0,this.undirectedSelfLoops=0,this.undirected={}},st.prototype.upgradeToMixed=function(){this.inDegree=0,this.outDegree=0,this.directedSelfLoops=0,this.in={},this.out={}};var ze=[{name:function(re){return"get".concat(re,"Attribute")},attacher:function(re,fe,se){re.prototype[fe]=function(M,L){var J;if("mixed"!==this.type&&"mixed"!==se&&se!==this.type)throw new ye("Graph.".concat(fe,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new ye("Graph.".concat(fe,": 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 Ee=""+M,Fe=""+L;if(L=arguments[2],!(J=W(this,Ee,Fe,se)))throw new ne("Graph.".concat(fe,': could not find an edge for the given path ("').concat(Ee,'" - "').concat(Fe,'").'))}else if(!(J=this._edges.get(M=""+M)))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" edge in the graph.'));if("mixed"!==se&&J.undirected!==("undirected"===se))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" ').concat(se," edge in the graph."));return J.attributes[L]}}},{name:function(re){return"get".concat(re,"Attributes")},attacher:function(re,fe,se){re.prototype[fe]=function(M){var L;if("mixed"!==this.type&&"mixed"!==se&&se!==this.type)throw new ye("Graph.".concat(fe,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>1){if(this.multi)throw new ye("Graph.".concat(fe,": 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 J=""+M,Ee=""+arguments[1];if(!(L=W(this,J,Ee,se)))throw new ne("Graph.".concat(fe,': could not find an edge for the given path ("').concat(J,'" - "').concat(Ee,'").'))}else if(!(L=this._edges.get(M=""+M)))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" edge in the graph.'));if("mixed"!==se&&L.undirected!==("undirected"===se))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" ').concat(se," edge in the graph."));return L.attributes}}},{name:function(re){return"has".concat(re,"Attribute")},attacher:function(re,fe,se){re.prototype[fe]=function(M,L){var J;if("mixed"!==this.type&&"mixed"!==se&&se!==this.type)throw new ye("Graph.".concat(fe,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new ye("Graph.".concat(fe,": 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 Ee=""+M,Fe=""+L;if(L=arguments[2],!(J=W(this,Ee,Fe,se)))throw new ne("Graph.".concat(fe,': could not find an edge for the given path ("').concat(Ee,'" - "').concat(Fe,'").'))}else if(!(J=this._edges.get(M=""+M)))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" edge in the graph.'));if("mixed"!==se&&J.undirected!==("undirected"===se))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" ').concat(se," edge in the graph."));return J.attributes.hasOwnProperty(L)}}},{name:function(re){return"set".concat(re,"Attribute")},attacher:function(re,fe,se){re.prototype[fe]=function(M,L,J){var Ee;if("mixed"!==this.type&&"mixed"!==se&&se!==this.type)throw new ye("Graph.".concat(fe,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>3){if(this.multi)throw new ye("Graph.".concat(fe,": 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=""+M,nt=""+L;if(L=arguments[2],J=arguments[3],!(Ee=W(this,Fe,nt,se)))throw new ne("Graph.".concat(fe,': could not find an edge for the given path ("').concat(Fe,'" - "').concat(nt,'").'))}else if(!(Ee=this._edges.get(M=""+M)))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" edge in the graph.'));if("mixed"!==se&&Ee.undirected!==("undirected"===se))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" ').concat(se," edge in the graph."));return Ee.attributes[L]=J,this.emit("edgeAttributesUpdated",{key:Ee.key,type:"set",attributes:Ee.attributes,name:L}),this}}},{name:function(re){return"update".concat(re,"Attribute")},attacher:function(re,fe,se){re.prototype[fe]=function(M,L,J){var Ee;if("mixed"!==this.type&&"mixed"!==se&&se!==this.type)throw new ye("Graph.".concat(fe,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>3){if(this.multi)throw new ye("Graph.".concat(fe,": 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=""+M,nt=""+L;if(L=arguments[2],J=arguments[3],!(Ee=W(this,Fe,nt,se)))throw new ne("Graph.".concat(fe,': could not find an edge for the given path ("').concat(Fe,'" - "').concat(nt,'").'))}else if(!(Ee=this._edges.get(M=""+M)))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" edge in the graph.'));if("function"!=typeof J)throw new me("Graph.".concat(fe,": updater should be a function."));if("mixed"!==se&&Ee.undirected!==("undirected"===se))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" ').concat(se," edge in the graph."));return Ee.attributes[L]=J(Ee.attributes[L]),this.emit("edgeAttributesUpdated",{key:Ee.key,type:"set",attributes:Ee.attributes,name:L}),this}}},{name:function(re){return"remove".concat(re,"Attribute")},attacher:function(re,fe,se){re.prototype[fe]=function(M,L){var J;if("mixed"!==this.type&&"mixed"!==se&&se!==this.type)throw new ye("Graph.".concat(fe,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new ye("Graph.".concat(fe,": 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 Ee=""+M,Fe=""+L;if(L=arguments[2],!(J=W(this,Ee,Fe,se)))throw new ne("Graph.".concat(fe,': could not find an edge for the given path ("').concat(Ee,'" - "').concat(Fe,'").'))}else if(!(J=this._edges.get(M=""+M)))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" edge in the graph.'));if("mixed"!==se&&J.undirected!==("undirected"===se))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" ').concat(se," edge in the graph."));return delete J.attributes[L],this.emit("edgeAttributesUpdated",{key:J.key,type:"remove",attributes:J.attributes,name:L}),this}}},{name:function(re){return"replace".concat(re,"Attributes")},attacher:function(re,fe,se){re.prototype[fe]=function(M,L){var J;if("mixed"!==this.type&&"mixed"!==se&&se!==this.type)throw new ye("Graph.".concat(fe,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new ye("Graph.".concat(fe,": 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 Ee=""+M,Fe=""+L;if(L=arguments[2],!(J=W(this,Ee,Fe,se)))throw new ne("Graph.".concat(fe,': could not find an edge for the given path ("').concat(Ee,'" - "').concat(Fe,'").'))}else if(!(J=this._edges.get(M=""+M)))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" edge in the graph.'));if(!k(L))throw new me("Graph.".concat(fe,": provided attributes are not a plain object."));if("mixed"!==se&&J.undirected!==("undirected"===se))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" ').concat(se," edge in the graph."));return J.attributes=L,this.emit("edgeAttributesUpdated",{key:J.key,type:"replace",attributes:J.attributes}),this}}},{name:function(re){return"merge".concat(re,"Attributes")},attacher:function(re,fe,se){re.prototype[fe]=function(M,L){var J;if("mixed"!==this.type&&"mixed"!==se&&se!==this.type)throw new ye("Graph.".concat(fe,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new ye("Graph.".concat(fe,": 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 Ee=""+M,Fe=""+L;if(L=arguments[2],!(J=W(this,Ee,Fe,se)))throw new ne("Graph.".concat(fe,': could not find an edge for the given path ("').concat(Ee,'" - "').concat(Fe,'").'))}else if(!(J=this._edges.get(M=""+M)))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" edge in the graph.'));if(!k(L))throw new me("Graph.".concat(fe,": provided attributes are not a plain object."));if("mixed"!==se&&J.undirected!==("undirected"===se))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" ').concat(se," edge in the graph."));return he(J.attributes,L),this.emit("edgeAttributesUpdated",{key:J.key,type:"merge",attributes:J.attributes,data:L}),this}}}],Le=oe,Ke=function(){var re,fe=arguments,se=-1;return new Le(function M(){if(!re){if(++se>=fe.length)return{done:!0};re=fe[se]}var L=re.next();return L.done?(re=null,M()):L})},Me=[{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(re,fe){for(var se in fe)re.push(fe[se].key)}function qe(re,fe){for(var se in fe)fe[se].forEach(function(M){return re.push(M.key)})}function ke(re,fe,se){for(var M in re)if(M!==se){var L=re[M];fe(L.key,L.attributes,L.source.key,L.target.key,L.source.attributes,L.target.attributes,L.undirected,L.generatedKey)}}function q(re,fe,se){for(var M in re)M!==se&&re[M].forEach(function(L){return fe(L.key,L.attributes,L.source.key,L.target.key,L.source.attributes,L.target.attributes,L.undirected,L.generatedKey)})}function G(re,fe,se){for(var M in re)if(M!==se){var L=re[M];if(fe(L.key,L.attributes,L.source.key,L.target.key,L.source.attributes,L.target.attributes,L.undirected,L.generatedKey))return!0}return!1}function pe(re,fe,se){var M,L,J,Ee,Fe;for(var nt in re)if(nt!==se)for(M=re[nt].values();!0!==(L=M.next()).done;)if(Ee=(J=L.value).source,fe(J.key,J.attributes,Ee.key,(Fe=J.target).key,Ee.attributes,Fe.attributes,J.undirected,J.generatedKey))return!0;return!1}function de(re,fe){var se=Object.keys(re),M=se.length,L=null,J=0;return new oe(function Ee(){var Fe;if(L){var nt=L.next();if(nt.done)return L=null,J++,Ee();Fe=nt.value}else{if(J>=M)return{done:!0};var Pt=se[J];if(Pt===fe)return J++,Ee();if((Fe=re[Pt])instanceof Set)return L=Fe.values(),Ee();J++}return{done:!1,value:[Fe.key,Fe.attributes,Fe.source.key,Fe.target.key,Fe.source.attributes,Fe.target.attributes]}})}function je(re,fe,se){var M=fe[se];M&&re.push(M.key)}function _t(re,fe,se){var M=fe[se];M&&M.forEach(function(L){return re.push(L.key)})}function pt(re,fe,se){var M=re[fe];if(M){var L=M.source,J=M.target;se(M.key,M.attributes,L.key,J.key,L.attributes,J.attributes,M.undirected,M.generatedKey)}}function we(re,fe,se){var M=re[fe];M&&M.forEach(function(L){return se(L.key,L.attributes,L.source.key,L.target.key,L.source.attributes,L.target.attributes,L.undirected,L.generatedKey)})}function B(re,fe,se){var M=re[fe];if(M){var L=M.source,J=M.target;return se(M.key,M.attributes,L.key,J.key,L.attributes,J.attributes,M.undirected,M.generatedKey)}}function N(re,fe,se){var M=re[fe];if(M){for(var L,J,Ee=M.values();!0!==(L=Ee.next()).done;)if(se((J=L.value).key,J.attributes,J.source.key,J.target.key,J.source.attributes,J.target.attributes,J.undirected,J.generatedKey))return!0;return!1}}function V(re,fe){var se=re[fe];if(se instanceof Set){var M=se.values();return new oe(function(){var L=M.next();if(L.done)return L;var J=L.value;return{done:!1,value:[J.key,J.attributes,J.source.key,J.target.key,J.source.attributes,J.target.attributes]}})}return oe.of([se.key,se.attributes,se.source.key,se.target.key,se.source.attributes,se.target.attributes])}function Re(re,fe){if(0===re.size)return[];if("mixed"===fe||fe===re.type)return"function"==typeof Array.from?Array.from(re._edges.keys()):te(re._edges.keys(),re._edges.size);for(var se,M,J=new Array("undirected"===fe?re.undirectedSize:re.directedSize),Ee="undirected"===fe,Fe=re._edges.values(),nt=0;!0!==(se=Fe.next()).done;)(M=se.value).undirected===Ee&&(J[nt++]=M.key);return J}function Ze(re,fe,se){if(0!==re.size)for(var M,L,J="mixed"!==fe&&fe!==re.type,Ee="undirected"===fe,Fe=re._edges.values();!0!==(M=Fe.next()).done;)if(L=M.value,!J||L.undirected===Ee){var qt=L.source,St=L.target;se(L.key,L.attributes,qt.key,St.key,qt.attributes,St.attributes,L.undirected,L.generatedKey)}}function Tt(re,fe,se){if(0!==re.size)for(var M,L,J="mixed"!==fe&&fe!==re.type,Ee="undirected"===fe,Fe=re._edges.values();!0!==(M=Fe.next()).done;)if(L=M.value,!J||L.undirected===Ee){var qt=L.source,St=L.target;if(se(L.key,L.attributes,qt.key,St.key,qt.attributes,St.attributes,L.undirected,L.generatedKey))break}}function kt(re,fe){if(0===re.size)return oe.empty();var se="mixed"!==fe&&fe!==re.type,M="undirected"===fe,L=re._edges.values();return new oe(function(){for(var J,Ee;;){if((J=L.next()).done)return J;if(Ee=J.value,!se||Ee.undirected===M)break}return{value:[Ee.key,Ee.attributes,Ee.source.key,Ee.target.key,Ee.source.attributes,Ee.target.attributes],done:!1}})}function In(re,fe,se,M){var L=[],J=re?qe:Ue;return"undirected"!==fe&&("out"!==se&&J(L,M.in),"in"!==se&&J(L,M.out),!se&&M.directedSelfLoops>0&&L.splice(L.lastIndexOf(M.key),1)),"directed"!==fe&&J(L,M.undirected),L}function Nn(re,fe,se,M,L){var J=re?q:ke;"undirected"!==fe&&("out"!==se&&J(M.in,L),"in"!==se&&J(M.out,L,se?null:M.key)),"directed"!==fe&&J(M.undirected,L)}function Yn(re,fe,se,M,L){var J=re?pe:G;"undirected"!==fe&&("out"!==se&&J(M.in,L)||"in"!==se&&J(M.out,L,se?null:M.key))||"directed"===fe||J(M.undirected,L)}function Mi(re,fe,se){var M=oe.empty();return"undirected"!==re&&("out"!==fe&&void 0!==se.in&&(M=Ke(M,de(se.in))),"in"!==fe&&void 0!==se.out&&(M=Ke(M,de(se.out,fe?null:se.key)))),"directed"!==re&&void 0!==se.undirected&&(M=Ke(M,de(se.undirected))),M}function xi(re,fe,se,M,L){var J=fe?_t:je,Ee=[];return"undirected"!==re&&(void 0!==M.in&&"out"!==se&&J(Ee,M.in,L),void 0!==M.out&&"in"!==se&&J(Ee,M.out,L),!se&&M.directedSelfLoops>0&&Ee.splice(Ee.lastIndexOf(M.key),1)),"directed"!==re&&void 0!==M.undirected&&J(Ee,M.undirected,L),Ee}function Xr(re,fe,se,M,L,J){var Ee=fe?we:pt;"undirected"!==re&&(void 0!==M.in&&"out"!==se&&Ee(M.in,L,J),M.key!==L&&void 0!==M.out&&"in"!==se&&Ee(M.out,L,J)),"directed"!==re&&void 0!==M.undirected&&Ee(M.undirected,L,J)}function Ls(re,fe,se,M,L,J){var Ee=fe?N:B;"undirected"!==re&&(void 0!==M.in&&"out"!==se&&Ee(M.in,L,J)||M.key!==L&&void 0!==M.out&&"in"!==se&&Ee(M.out,L,J,se?null:M.key))||"directed"===re||void 0===M.undirected||Ee(M.undirected,L,J)}function fs(re,fe,se,M){var L=oe.empty();return"undirected"!==re&&(void 0!==se.in&&"out"!==fe&&M in se.in&&(L=Ke(L,V(se.in,M))),void 0!==se.out&&"in"!==fe&&M in se.out&&(L=Ke(L,V(se.out,M)))),"directed"!==re&&void 0!==se.undirected&&M in se.undirected&&(L=Ke(L,V(se.undirected,M))),L}var Bs=[{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 Kr(re,fe){if(void 0!==fe)for(var se in fe)re.add(se)}function xa(re,fe,se){if("mixed"!==re){if("undirected"===re)return Object.keys(se.undirected);if("string"==typeof fe)return Object.keys(se[fe])}var M=new Set;return"undirected"!==re&&("out"!==fe&&Kr(M,se.in),"in"!==fe&&Kr(M,se.out)),"directed"!==re&&Kr(M,se.undirected),te(M.values(),M.size)}function kl(re,fe,se){for(var M in fe){var L=fe[M];L instanceof Set&&(L=L.values().next().value);var J=L.source,Fe=J===re?L.target:J;se(Fe.key,Fe.attributes)}}function Sa(re,fe,se,M){for(var L in se){var J=se[L];J instanceof Set&&(J=J.values().next().value);var Ee=J.source,nt=Ee===fe?J.target:Ee;re.has(nt.key)||(re.add(nt.key),M(nt.key,nt.attributes))}}function ws(re,fe,se){for(var M in fe){var L=fe[M];L instanceof Set&&(L=L.values().next().value);var J=L.source,Fe=J===re?L.target:J;if(se(Fe.key,Fe.attributes))return!0}return!1}function en(re,fe,se,M){for(var L in se){var J=se[L];J instanceof Set&&(J=J.values().next().value);var Ee=J.source,nt=Ee===fe?J.target:Ee;if(!re.has(nt.key)&&(re.add(nt.key),M(nt.key,nt.attributes)))return!0}return!1}function nl(re,fe){var se=Object.keys(fe),M=se.length,L=0;return new oe(function(){if(L>=M)return{done:!0};var J=fe[se[L++]];J instanceof Set&&(J=J.values().next().value);var Ee=J.source,nt=Ee===re?J.target:Ee;return{done:!1,value:[nt.key,nt.attributes]}})}function rt(re,fe,se){var M=Object.keys(se),L=M.length,J=0;return new oe(function Ee(){if(J>=L)return{done:!0};var Fe=se[M[J++]];Fe instanceof Set&&(Fe=Fe.values().next().value);var nt=Fe.source,We=nt===fe?Fe.target:nt;return re.has(We.key)?Ee():(re.add(We.key),{done:!1,value:[We.key,We.attributes]})})}function lt(re,fe,se,M,L){var J=re._nodes.get(M);if("undirected"!==fe){if("out"!==se&&void 0!==J.in)for(var Ee in J.in)if(Ee===L)return!0;if("in"!==se&&void 0!==J.out)for(var Fe in J.out)if(Fe===L)return!0}if("directed"!==fe&&void 0!==J.undirected)for(var nt in J.undirected)if(nt===L)return!0;return!1}function Be(re,fe,se){for(var M,L,J,Ee,Fe,nt,Pt,We=fe._nodes.values(),qt=fe.type;!0!==(M=We.next()).done;){if(L=M.value,"undirected"!==qt)for(J in Ee=L.out)if(nt=(Fe=Ee[J]).target,Pt=se(L.key,nt.key,L.attributes,nt.attributes,Fe.key,Fe.attributes,Fe.undirected,Fe.generatedKey),re&&Pt)return;if("directed"!==qt)for(J in Ee=L.undirected)if((nt=(Fe=Ee[J]).target).key!==J&&(nt=Fe.source),Pt=se(L.key,nt.key,L.attributes,nt.attributes,Fe.key,Fe.attributes,Fe.undirected,Fe.generatedKey),re&&Pt)return}}function ut(re,fe,se){for(var M,L,J,Ee,Fe,nt,Pt,We,qt,St=fe._nodes.values(),vn=fe.type;!0!==(M=St.next()).done;){if(L=M.value,"undirected"!==vn)for(J in nt=L.out)for(Ee=nt[J].values();!0!==(Fe=Ee.next()).done;)if(We=(Pt=Fe.value).target,qt=se(L.key,We.key,L.attributes,We.attributes,Pt.key,Pt.attributes,Pt.undirected,Pt.generatedKey),re&&qt)return;if("directed"!==vn)for(J in nt=L.undirected)for(Ee=nt[J].values();!0!==(Fe=Ee.next()).done;)if((We=(Pt=Fe.value).target).key!==J&&(We=Pt.source),qt=se(L.key,We.key,L.attributes,We.attributes,Pt.key,Pt.attributes,Pt.undirected,Pt.generatedKey),re&&qt)return}}function Je(re,fe){var se={key:re};return Q(fe.attributes)||(se.attributes=he({},fe.attributes)),se}function Mt(re,fe){var se={source:fe.source.key,target:fe.target.key};return fe.generatedKey||(se.key=re),Q(fe.attributes)||(se.attributes=he({},fe.attributes)),fe.undirected&&(se.undirected=!0),se}function It(re){return k(re)?"key"in re?!("attributes"in re)||k(re.attributes)&&null!==re.attributes?null:"invalid-attributes":"no-key":"not-object"}function Ot(re){return k(re)?"source"in re?"target"in re?!("attributes"in re)||k(re.attributes)&&null!==re.attributes?"undirected"in re&&"boolean"!=typeof re.undirected?"invalid-undirected":null:"invalid-attributes":"no-target":"no-source":"not-object"}var Qt=new Set(["directed","undirected","mixed"]),zn=new Set(["domain","_events","_eventsCount","_maxListeners"]),ci={allowSelfLoops:!0,edgeKeyGenerator:null,multi:!1,type:"mixed"};function Rn(re,fe,se){var M=new re.NodeDataClass(fe,se);return re._nodes.set(fe,M),re.emit("nodeAdded",{key:fe,attributes:se}),M}function bn(re,fe,se,M,L,J,Ee,Fe){if(!M&&"undirected"===re.type)throw new ye("Graph.".concat(fe,": you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead."));if(M&&"directed"===re.type)throw new ye("Graph.".concat(fe,": you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead."));if(Fe&&!k(Fe))throw new me("Graph.".concat(fe,': invalid attributes. Expecting an object but got "').concat(Fe,'"'));if(J=""+J,Ee=""+Ee,Fe=Fe||{},!re.allowSelfLoops&&J===Ee)throw new ye("Graph.".concat(fe,': source & target are the same ("').concat(J,"\"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false."));var nt=re._nodes.get(J),Pt=re._nodes.get(Ee);if(!nt)throw new ne("Graph.".concat(fe,': source node "').concat(J,'" not found.'));if(!Pt)throw new ne("Graph.".concat(fe,': target node "').concat(Ee,'" not found.'));var We={key:null,undirected:M,source:J,target:Ee,attributes:Fe};if(se&&(L=re._edgeKeyGenerator(We)),re._edges.has(L=""+L))throw new ye("Graph.".concat(fe,': the "').concat(L,'" edge already exists in the graph.'));if(!re.multi&&(M?void 0!==nt.undirected[Ee]:void 0!==nt.out[Ee]))throw new ye("Graph.".concat(fe,': an edge linking "').concat(J,'" to "').concat(Ee,"\" 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 qt=new Qe(M,L,se,nt,Pt,Fe);return re._edges.set(L,qt),J===Ee?M?(nt.undirectedSelfLoops++,re._undirectedSelfLoopCount++):(nt.directedSelfLoops++,re._directedSelfLoopCount++):M?(nt.undirectedDegree++,Pt.undirectedDegree++):(nt.outDegree++,Pt.inDegree++),tt(re,M,qt,J,Ee,nt,Pt),M?re._undirectedSize++:re._directedSize++,We.key=L,re.emit("edgeAdded",We),L}function Xn(re,fe,se,M,L,J,Ee,Fe,nt){if(!M&&"undirected"===re.type)throw new ye("Graph.".concat(fe,": you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead."));if(M&&"directed"===re.type)throw new ye("Graph.".concat(fe,": you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead."));if(Fe)if(nt){if("function"!=typeof Fe)throw new me("Graph.".concat(fe,': invalid updater function. Expecting a function but got "').concat(Fe,'"'))}else if(!k(Fe))throw new me("Graph.".concat(fe,': invalid attributes. Expecting an object but got "').concat(Fe,'"'));var Pt;if(J=""+J,Ee=""+Ee,nt&&(Pt=Fe,Fe=void 0),!re.allowSelfLoops&&J===Ee)throw new ye("Graph.".concat(fe,': source & target are the same ("').concat(J,"\"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false."));var We,qt,St=re._nodes.get(J),vn=re._nodes.get(Ee);if(!se&&(We=re._edges.get(L))){if(We.source.key!==J||We.target.key!==Ee||M&&(We.source.key!==Ee||We.target.key!==J))throw new ye("Graph.".concat(fe,': inconsistency detected when attempting to merge the "').concat(L,'" edge with "').concat(J,'" source & "').concat(Ee,'" target vs. ("').concat(We.source.key,'", "').concat(We.target.key,'").'));qt=We}if(qt||re.multi||!St||(qt=M?St.undirected[Ee]:St.out[Ee]),qt)return(nt?Pt:Fe)?(nt?(qt.attributes=Pt(qt.attributes),re.emit("edgeAttributesUpdated",{type:"replace",key:qt.key,attributes:qt.attributes})):(he(qt.attributes,Fe),re.emit("edgeAttributesUpdated",{type:"merge",key:qt.key,attributes:qt.attributes,data:Fe})),qt.key):qt.key;Fe=Fe||{},nt&&Pt&&(Fe=Pt(Fe));var Zr={key:null,undirected:M,source:J,target:Ee,attributes:Fe};if(se&&(L=re._edgeKeyGenerator(Zr)),re._edges.has(L=""+L))throw new ye("Graph.".concat(fe,': the "').concat(L,'" edge already exists in the graph.'));return St||(St=Rn(re,J,{}),J===Ee&&(vn=St)),vn||(vn=Rn(re,Ee,{})),We=new Qe(M,L,se,St,vn,Fe),re._edges.set(L,We),J===Ee?M?(St.undirectedSelfLoops++,re._undirectedSelfLoopCount++):(St.directedSelfLoops++,re._directedSelfLoopCount++):M?(St.undirectedDegree++,vn.undirectedDegree++):(St.outDegree++,vn.inDegree++),tt(re,M,We,J,Ee,St,vn),M?re._undirectedSize++:re._directedSize++,Zr.key=L,re.emit("edgeAdded",Zr),L}var re,Cn=function(re){function fe(M){var L;if(L=re.call(this)||this,(M=he({},ci,M)).edgeKeyGenerator&&"function"!=typeof M.edgeKeyGenerator)throw new me("Graph.constructor: invalid 'edgeKeyGenerator' option. Expecting a function but got \"".concat(M.edgeKeyGenerator,'".'));if("boolean"!=typeof M.multi)throw new me("Graph.constructor: invalid 'multi' option. Expecting a boolean but got \"".concat(M.multi,'".'));if(!Qt.has(M.type))throw new me('Graph.constructor: invalid \'type\' option. Should be one of "mixed", "directed" or "undirected" but got "'.concat(M.type,'".'));if("boolean"!=typeof M.allowSelfLoops)throw new me("Graph.constructor: invalid 'allowSelfLoops' option. Expecting a boolean but got \"".concat(M.allowSelfLoops,'".'));var J,Ee="mixed"===M.type?Oe:"directed"===M.type?$e:st;return H(Se(L),"NodeDataClass",Ee),H(Se(L),"_attributes",{}),H(Se(L),"_nodes",new Map),H(Se(L),"_edges",new Map),H(Se(L),"_directedSize",0),H(Se(L),"_undirectedSize",0),H(Se(L),"_directedSelfLoopCount",0),H(Se(L),"_undirectedSelfLoopCount",0),H(Se(L),"_edgeKeyGenerator",M.edgeKeyGenerator||(J=0,function(){return J++})),H(Se(L),"_options",M),zn.forEach(function(Fe){return H(Se(L),Fe,L[Fe])}),v(Se(L),"order",function(){return L._nodes.size}),v(Se(L),"size",function(){return L._edges.size}),v(Se(L),"directedSize",function(){return L._directedSize}),v(Se(L),"undirectedSize",function(){return L._undirectedSize}),v(Se(L),"selfLoopCount",function(){return L._directedSelfLoopCount+L._undirectedSelfLoopCount}),v(Se(L),"directedSelfLoopCount",function(){return L._directedSelfLoopCount}),v(Se(L),"undirectedSelfLoopCount",function(){return L._undirectedSelfLoopCount}),v(Se(L),"multi",L._options.multi),v(Se(L),"type",L._options.type),v(Se(L),"allowSelfLoops",L._options.allowSelfLoops),v(Se(L),"implementation",function(){return"graphology"}),L}et(fe,re);var se=fe.prototype;return se.hasNode=function(M){return this._nodes.has(""+M)},se.hasDirectedEdge=function(M,L){if("undirected"===this.type)return!1;if(1===arguments.length){var Ee=this._edges.get(""+M);return!!Ee&&!Ee.undirected}if(2===arguments.length){L=""+L;var Fe=this._nodes.get(M=""+M);if(!Fe)return!1;var nt=Fe.out[L];return!(!nt||this.multi&&!nt.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."))},se.hasUndirectedEdge=function(M,L){if("directed"===this.type)return!1;if(1===arguments.length){var Ee=this._edges.get(""+M);return!!Ee&&Ee.undirected}if(2===arguments.length){L=""+L;var Fe=this._nodes.get(M=""+M);if(!Fe)return!1;var nt=Fe.undirected[L];return!(!nt||this.multi&&!nt.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."))},se.hasEdge=function(M,L){if(1===arguments.length)return this._edges.has(""+M);if(2===arguments.length){L=""+L;var Ee=this._nodes.get(M=""+M);if(!Ee)return!1;var Fe=void 0!==Ee.out&&Ee.out[L];return Fe||(Fe=void 0!==Ee.undirected&&Ee.undirected[L]),!(!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."))},se.directedEdge=function(M,L){if("undirected"!==this.type){if(M=""+M,L=""+L,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 J=this._nodes.get(M);if(!J)throw new ne('Graph.directedEdge: could not find the "'.concat(M,'" source node in the graph.'));if(!this._nodes.has(L))throw new ne('Graph.directedEdge: could not find the "'.concat(L,'" target node in the graph.'));var Ee=J.out&&J.out[L]||void 0;return Ee?Ee.key:void 0}},se.undirectedEdge=function(M,L){if("directed"!==this.type){if(M=""+M,L=""+L,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 J=this._nodes.get(M);if(!J)throw new ne('Graph.undirectedEdge: could not find the "'.concat(M,'" source node in the graph.'));if(!this._nodes.has(L))throw new ne('Graph.undirectedEdge: could not find the "'.concat(L,'" target node in the graph.'));var Ee=J.undirected&&J.undirected[L]||void 0;return Ee?Ee.key:void 0}},se.edge=function(M,L){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.");L=""+L;var J=this._nodes.get(M=""+M);if(!J)throw new ne('Graph.edge: could not find the "'.concat(M,'" source node in the graph.'));if(!this._nodes.has(L))throw new ne('Graph.edge: could not find the "'.concat(L,'" target node in the graph.'));var Ee=J.out&&J.out[L]||J.undirected&&J.undirected[L]||void 0;if(Ee)return Ee.key},se.inDegree=function(M){var L=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof L)throw new me('Graph.inDegree: Expecting a boolean but got "'.concat(L,'" for the second parameter (allowing self-loops to be counted).'));var J=this._nodes.get(M=""+M);if(!J)throw new ne('Graph.inDegree: could not find the "'.concat(M,'" node in the graph.'));return"undirected"===this.type?0:J.inDegree+(L?J.directedSelfLoops:0)},se.outDegree=function(M){var L=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof L)throw new me('Graph.outDegree: Expecting a boolean but got "'.concat(L,'" for the second parameter (allowing self-loops to be counted).'));var J=this._nodes.get(M=""+M);if(!J)throw new ne('Graph.outDegree: could not find the "'.concat(M,'" node in the graph.'));return"undirected"===this.type?0:J.outDegree+(L?J.directedSelfLoops:0)},se.directedDegree=function(M){var L=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof L)throw new me('Graph.directedDegree: Expecting a boolean but got "'.concat(L,'" for the second parameter (allowing self-loops to be counted).'));var J=this._nodes.get(M=""+M);if(!J)throw new ne('Graph.directedDegree: could not find the "'.concat(M,'" node in the graph.'));if("undirected"===this.type)return 0;var Ee=L?J.directedSelfLoops:0;return J.inDegree+Ee+(J.outDegree+Ee)},se.undirectedDegree=function(M){var L=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof L)throw new me('Graph.undirectedDegree: Expecting a boolean but got "'.concat(L,'" for the second parameter (allowing self-loops to be counted).'));var J=this._nodes.get(M=""+M);if(!J)throw new ne('Graph.undirectedDegree: could not find the "'.concat(M,'" node in the graph.'));return"directed"===this.type?0:J.undirectedDegree+2*(L?J.undirectedSelfLoops:0)},se.degree=function(M){var L=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof L)throw new me('Graph.degree: Expecting a boolean but got "'.concat(L,'" for the second parameter (allowing self-loops to be counted).'));var J=this._nodes.get(M=""+M);if(!J)throw new ne('Graph.degree: could not find the "'.concat(M,'" node in the graph.'));var Ee=0,Fe=0;return"directed"!==this.type&&(L&&(Fe=J.undirectedSelfLoops),Ee+=J.undirectedDegree+2*Fe),"undirected"!==this.type&&(L&&(Fe=J.directedSelfLoops),Ee+=J.inDegree+J.outDegree+2*Fe),Ee},se.source=function(M){var L=this._edges.get(M=""+M);if(!L)throw new ne('Graph.source: could not find the "'.concat(M,'" edge in the graph.'));return L.source.key},se.target=function(M){var L=this._edges.get(M=""+M);if(!L)throw new ne('Graph.target: could not find the "'.concat(M,'" edge in the graph.'));return L.target.key},se.extremities=function(M){var L=this._edges.get(M=""+M);if(!L)throw new ne('Graph.extremities: could not find the "'.concat(M,'" edge in the graph.'));return[L.source.key,L.target.key]},se.opposite=function(M,L){M=""+M;var J=this._edges.get(L=""+L);if(!J)throw new ne('Graph.opposite: could not find the "'.concat(L,'" edge in the graph.'));var Ee=J.source.key,Fe=J.target.key;if(M!==Ee&&M!==Fe)throw new ne('Graph.opposite: the "'.concat(M,'" node is not attached to the "').concat(L,'" edge (').concat(Ee,", ").concat(Fe,")."));return M===Ee?Fe:Ee},se.hasExtremity=function(M,L){L=""+L;var J=this._edges.get(M=""+M);if(!J)throw new ne('Graph.hasExtremity: could not find the "'.concat(M,'" edge in the graph.'));return J.source.key===L||J.target.key===L},se.isUndirected=function(M){var L=this._edges.get(M=""+M);if(!L)throw new ne('Graph.isUndirected: could not find the "'.concat(M,'" edge in the graph.'));return L.undirected},se.isDirected=function(M){var L=this._edges.get(M=""+M);if(!L)throw new ne('Graph.isDirected: could not find the "'.concat(M,'" edge in the graph.'));return!L.undirected},se.isSelfLoop=function(M){var L=this._edges.get(M=""+M);if(!L)throw new ne('Graph.isSelfLoop: could not find the "'.concat(M,'" edge in the graph.'));return L.source===L.target},se.hasGeneratedKey=function(M){var L=this._edges.get(M=""+M);if(!L)throw new ne('Graph.hasGeneratedKey: could not find the "'.concat(M,'" edge in the graph.'));return L.generatedKey},se.addNode=function(M,L){return function(J,Ee,Fe){if(Fe&&!k(Fe))throw new me('Graph.addNode: invalid attributes. Expecting an object but got "'.concat(Fe,'"'));if(Fe=Fe||{},J._nodes.has(Ee=""+Ee))throw new ye('Graph.addNode: the "'.concat(Ee,'" node already exist in the graph.'));var nt=new J.NodeDataClass(Ee,Fe);return J._nodes.set(Ee,nt),J.emit("nodeAdded",{key:Ee,attributes:Fe}),nt}(this,M,L).key},se.mergeNode=function(M,L){if(L&&!k(L))throw new me('Graph.mergeNode: invalid attributes. Expecting an object but got "'.concat(L,'"'));L=L||{};var J=this._nodes.get(M=""+M);return J?(L&&(he(J.attributes,L),this.emit("nodeAttributesUpdated",{type:"merge",key:M,attributes:J.attributes,data:L})),M):(J=new this.NodeDataClass(M,L),this._nodes.set(M,J),this.emit("nodeAdded",{key:M,attributes:L}),M)},se.updateNode=function(M,L){if(L&&"function"!=typeof L)throw new me('Graph.updateNode: invalid updater function. Expecting a function but got "'.concat(L,'"'));var J=this._nodes.get(M=""+M);if(J)return L&&(J.attributes=L(J.attributes),this.emit("nodeAttributesUpdated",{type:"replace",key:M,attributes:J.attributes})),M;var Fe=L?L({}):{};return J=new this.NodeDataClass(M,Fe),this._nodes.set(M,J),this.emit("nodeAdded",{key:M,attributes:Fe}),M},se.dropNode=function(M){var L=this,J=this._nodes.get(M=""+M);if(!J)throw new ne('Graph.dropNode: could not find the "'.concat(M,'" node in the graph.'));this.forEachEdge(M,function(Ee){L.dropEdge(Ee)}),this._nodes.delete(M),this.emit("nodeDropped",{key:M,attributes:J.attributes})},se.dropEdge=function(M){var L;if(arguments.length>1){var J=""+arguments[0],Ee=""+arguments[1];if(!(L=W(this,J,Ee,this.type)))throw new ne('Graph.dropEdge: could not find the "'.concat(J,'" -> "').concat(Ee,'" edge in the graph.'))}else if(!(L=this._edges.get(M=""+M)))throw new ne('Graph.dropEdge: could not find the "'.concat(M,'" edge in the graph.'));this._edges.delete(L.key);var nt=L.source,Pt=L.target,We=L.attributes,qt=L.undirected;return nt===Pt?qt?(nt.undirectedSelfLoops--,this._undirectedSelfLoopCount--):(nt.directedSelfLoops--,this._directedSelfLoopCount--):qt?(nt.undirectedDegree--,Pt.undirectedDegree--):(nt.outDegree--,Pt.inDegree--),Xe(this,qt,L),qt?this._undirectedSize--:this._directedSize--,this.emit("edgeDropped",{key:M,attributes:We,source:nt.key,target:Pt.key,undirected:qt}),this},se.clear=function(){this._edges.clear(),this._nodes.clear(),this.emit("cleared")},se.clearEdges=function(){this._edges.clear(),this.clearIndex(),this.emit("edgesCleared")},se.getAttribute=function(M){return this._attributes[M]},se.getAttributes=function(){return this._attributes},se.hasAttribute=function(M){return this._attributes.hasOwnProperty(M)},se.setAttribute=function(M,L){return this._attributes[M]=L,this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:M}),this},se.updateAttribute=function(M,L){if("function"!=typeof L)throw new me("Graph.updateAttribute: updater should be a function.");return this._attributes[M]=L(this._attributes[M]),this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:M}),this},se.removeAttribute=function(M){return delete this._attributes[M],this.emit("attributesUpdated",{type:"remove",attributes:this._attributes,name:M}),this},se.replaceAttributes=function(M){if(!k(M))throw new me("Graph.replaceAttributes: provided attributes are not a plain object.");return this._attributes=M,this.emit("attributesUpdated",{type:"replace",attributes:this._attributes}),this},se.mergeAttributes=function(M){if(!k(M))throw new me("Graph.mergeAttributes: provided attributes are not a plain object.");return he(this._attributes,M),this.emit("attributesUpdated",{type:"merge",attributes:this._attributes,data:M}),this},se.getNodeAttribute=function(M,L){var J=this._nodes.get(M=""+M);if(!J)throw new ne('Graph.getNodeAttribute: could not find the "'.concat(M,'" node in the graph.'));return J.attributes[L]},se.getNodeAttributes=function(M){var L=this._nodes.get(M=""+M);if(!L)throw new ne('Graph.getNodeAttributes: could not find the "'.concat(M,'" node in the graph.'));return L.attributes},se.hasNodeAttribute=function(M,L){var J=this._nodes.get(M=""+M);if(!J)throw new ne('Graph.hasNodeAttribute: could not find the "'.concat(M,'" node in the graph.'));return J.attributes.hasOwnProperty(L)},se.setNodeAttribute=function(M,L,J){var Ee=this._nodes.get(M=""+M);if(!Ee)throw new ne('Graph.setNodeAttribute: could not find the "'.concat(M,'" 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 Ee.attributes[L]=J,this.emit("nodeAttributesUpdated",{key:M,type:"set",attributes:Ee.attributes,name:L}),this},se.updateNodeAttribute=function(M,L,J){var Ee=this._nodes.get(M=""+M);if(!Ee)throw new ne('Graph.updateNodeAttribute: could not find the "'.concat(M,'" 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 J)throw new me("Graph.updateAttribute: updater should be a function.");var Fe=Ee.attributes,nt=J(Fe[L]);return Fe[L]=nt,this.emit("nodeAttributesUpdated",{key:M,type:"set",attributes:Ee.attributes,name:L}),this},se.removeNodeAttribute=function(M,L){var J=this._nodes.get(M=""+M);if(!J)throw new ne('Graph.hasNodeAttribute: could not find the "'.concat(M,'" node in the graph.'));return delete J.attributes[L],this.emit("nodeAttributesUpdated",{key:M,type:"remove",attributes:J.attributes,name:L}),this},se.replaceNodeAttributes=function(M,L){var J=this._nodes.get(M=""+M);if(!J)throw new ne('Graph.replaceNodeAttributes: could not find the "'.concat(M,'" node in the graph.'));if(!k(L))throw new me("Graph.replaceNodeAttributes: provided attributes are not a plain object.");return J.attributes=L,this.emit("nodeAttributesUpdated",{key:M,type:"replace",attributes:J.attributes}),this},se.mergeNodeAttributes=function(M,L){var J=this._nodes.get(M=""+M);if(!J)throw new ne('Graph.mergeNodeAttributes: could not find the "'.concat(M,'" node in the graph.'));if(!k(L))throw new me("Graph.mergeNodeAttributes: provided attributes are not a plain object.");return he(J.attributes,L),this.emit("nodeAttributesUpdated",{key:M,type:"merge",attributes:J.attributes,data:L}),this},se.updateEachNodeAttributes=function(M,L){if("function"!=typeof M)throw new me("Graph.updateEachNodeAttributes: expecting an updater function.");if(L&&!C(L))throw new me("Graph.updateEachNodeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");for(var J,Ee,Fe=this._nodes.values();!0!==(J=Fe.next()).done;)(Ee=J.value).attributes=M(Ee.key,Ee.attributes);this.emit("eachNodeAttributesUpdated",{hints:L||null})},se.updateEachEdgeAttributes=function(M,L){if("function"!=typeof M)throw new me("Graph.updateEachEdgeAttributes: expecting an updater function.");if(L&&!C(L))throw new me("Graph.updateEachEdgeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");for(var J,Ee,Fe=this._edges.values();!0!==(J=Fe.next()).done;)(Ee=J.value).attributes=M(Ee.key,Ee.attributes);this.emit("eachEdgeAttributesUpdated",{hints:L||null})},se.forEach=function(M){if("function"!=typeof M)throw new me("Graph.forEach: expecting a callback.");this.multi?ut(!1,this,M):Be(!1,this,M)},se.forEachUntil=function(M){if("function"!=typeof M)throw new me("Graph.forEach: expecting a callback.");this.multi?ut(!0,this,M):Be(!0,this,M)},se.adjacency=function(){return this.multi?(nt=(M=this)._nodes.values(),Pt=M.type,We="outer",qt=null,new oe(function St(){var vn;if("outer"===We)return!0===(vn=nt.next()).done?vn:(L=vn.value,We="directed",St());if("directed"===We)return"undirected"===Pt?(We="undirected",St()):(Ee=L.out,J=Object.keys(L.out),Fe=0,We="inner-directed",St());if("undirected"===We){if("directed"===Pt)return We="outer",St();Ee=L.undirected,J=Object.keys(L.undirected),Fe=0,We="inner-undirected"}if(!qt&&Fe>=J.length)return We="inner-undirected"===We?"outer":"undirected",St();if(!qt){var Es=J[Fe++];return qt=Ee[Es].values(),St()}if((vn=qt.next()).done)return qt=null,St();var Zr=vn.value,Js=Zr.target;return"inner-undirected"===We&&Js.key===L.key&&(Js=Zr.source),{done:!1,value:[L.key,Js.key,L.attributes,Js.attributes,Zr.key,Zr.attributes]}})):(Fl=(St=this)._nodes.values(),fo=St.type,Br="outer",new oe(function Vs(){var Ac;if("outer"===Br)return!0===(Ac=Fl.next()).done?Ac:(vn=Ac.value,Br="directed",Vs());if("directed"===Br)return"undirected"===fo?(Br="undirected",Vs()):(Zr=vn.out,Es=Object.keys(vn.out),Js=0,Br="inner-directed",Vs());if("undirected"===Br){if("directed"===fo)return Br="outer",Vs();Zr=vn.undirected,Es=Object.keys(vn.undirected),Js=0,Br="inner-undirected"}if(Js>=Es.length)return Br="inner-undirected"===Br?"outer":"undirected",Vs();var xn=Es[Js++],po=Zr[xn],Ll=po.target;return"inner-undirected"===Br&&Ll.key===vn.key&&(Ll=po.source),{done:!1,value:[vn.key,Ll.key,vn.attributes,Ll.attributes,po.key,po.attributes]}}));var St,vn,Es,Zr,Js,Fl,fo,Br,M,L,J,Ee,Fe,nt,Pt,We,qt},se.nodes=function(){return"function"==typeof Array.from?Array.from(this._nodes.keys()):te(this._nodes.keys(),this._nodes.size)},se.forEachNode=function(M){if("function"!=typeof M)throw new me("Graph.forEachNode: expecting a callback.");this._nodes.forEach(function(L,J){M(J,L.attributes)})},se.forEachNodeUntil=function(M){if("function"!=typeof M)throw new me("Graph.forEachNode: expecting a callback.");for(var L,J,Ee=this._nodes.values();!0!==(L=Ee.next())&&!M((J=L.value).key,J.attributes););},se.nodeEntries=function(){var M=this._nodes.values();return new oe(function(){var L=M.next();if(L.done)return L;var J=L.value;return{value:[J.key,J.attributes],done:!1}})},se.exportNode=function(M){var L=this._nodes.get(M=""+M);if(!L)throw new ne('Graph.exportNode: could not find the "'.concat(M,'" node in the graph.'));return Je(M,L)},se.exportEdge=function(M){var L=this._edges.get(M=""+M);if(!L)throw new ne('Graph.exportEdge: could not find the "'.concat(M,'" edge in the graph.'));return Mt(M,L)},se.export=function(){var M=new Array(this._nodes.size),L=0;this._nodes.forEach(function(Ee,Fe){M[L++]=Je(Fe,Ee)});var J=new Array(this._edges.size);return L=0,this._edges.forEach(function(Ee,Fe){J[L++]=Mt(Fe,Ee)}),{attributes:this.getAttributes(),nodes:M,edges:J,options:{type:this.type,multi:this.multi,allowSelfLoops:this.allowSelfLoops}}},se.importNode=function(M){var L=arguments.length>1&&void 0!==arguments[1]&&arguments[1],J=It(M);if(J){if("not-object"===J)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"===J)throw new me("Graph.importNode: no key provided.");if("invalid-attributes"===J)throw new me("Graph.importNode: invalid attributes. Attributes should be a plain object, null or omitted.")}var Ee=M.key,Fe=M.attributes,nt=void 0===Fe?{}:Fe;return L?this.mergeNode(Ee,nt):this.addNode(Ee,nt),this},se.importEdge=function(M){var L=arguments.length>1&&void 0!==arguments[1]&&arguments[1],J=Ot(M);if(J){if("not-object"===J)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"===J)throw new me("Graph.importEdge: missing souce.");if("no-target"===J)throw new me("Graph.importEdge: missing target.");if("invalid-attributes"===J)throw new me("Graph.importEdge: invalid attributes. Attributes should be a plain object, null or omitted.");if("invalid-undirected"===J)throw new me("Graph.importEdge: invalid undirected. Undirected should be boolean or omitted.")}var Ee=M.source,Fe=M.target,nt=M.attributes,Pt=void 0===nt?{}:nt,We=M.undirected,qt=void 0!==We&&We;return"key"in M?(L?qt?this.mergeUndirectedEdgeWithKey:this.mergeDirectedEdgeWithKey:qt?this.addUndirectedEdgeWithKey:this.addDirectedEdgeWithKey).call(this,M.key,Ee,Fe,Pt):(L?qt?this.mergeUndirectedEdge:this.mergeDirectedEdge:qt?this.addUndirectedEdge:this.addDirectedEdge).call(this,Ee,Fe,Pt),this},se.import=function(M){var L,J,Ee,Fe=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(j(M))return this.import(M.export(),Fe),this;if(!k(M))throw new me("Graph.import: invalid argument. Expecting a serialized graph or, alternatively, a Graph instance.");if(M.attributes){if(!k(M.attributes))throw new me("Graph.import: invalid attributes. Expecting a plain object.");Fe?this.mergeAttributes(M.attributes):this.replaceAttributes(M.attributes)}if(M.nodes){if(Ee=M.nodes,!Array.isArray(Ee))throw new me("Graph.import: invalid nodes. Expecting an array.");for(L=0,J=Ee.length;LJ)){var Pt=new Set;Pt.add(L.undirected[nt]),L.undirected[nt]=Pt,M._nodes.get(nt).undirected[J]=Pt}})),this;var M},se.clearIndex=function(){return this._nodes.forEach(function(M){void 0!==M.in&&(M.in={},M.out={}),void 0!==M.undirected&&(M.undirected={})}),this},se.toJSON=function(){return this.export()},se.toString=function(){return"[object Graph]"},se.inspect=function(){var M=this,L={};this._nodes.forEach(function(Pt,We){L[We]=Pt.attributes});var J={},Ee={};this._edges.forEach(function(Pt,We){var qt=Pt.undirected?"--":"->",St="",vn="(".concat(Pt.source.key,")").concat(qt,"(").concat(Pt.target.key,")");Pt.generatedKey?M.multi&&(void 0===Ee[vn]?Ee[vn]=0:Ee[vn]++,St+="".concat(Ee[vn],". ")):St+="[".concat(We,"]: "),J[St+=vn]=Pt.attributes});var Fe={};for(var nt in this)this.hasOwnProperty(nt)&&!zn.has(nt)&&"function"!=typeof this[nt]&&(Fe[nt]=this[nt]);return Fe.attributes=this._attributes,Fe.nodes=L,Fe.edges=J,H(Fe,"constructor",this.constructor),Fe},fe}(T.exports.EventEmitter);"undefined"!=typeof Symbol&&(Cn.prototype[Symbol.for("nodejs.util.inspect.custom")]=Cn.prototype.inspect),[{name:function(re){return"".concat(re,"Edge")},generateKey:!0},{name:function(re){return"".concat(re,"DirectedEdge")},generateKey:!0,type:"directed"},{name:function(re){return"".concat(re,"UndirectedEdge")},generateKey:!0,type:"undirected"},{name:function(re){return"".concat(re,"EdgeWithKey")}},{name:function(re){return"".concat(re,"DirectedEdgeWithKey")},type:"directed"},{name:function(re){return"".concat(re,"UndirectedEdgeWithKey")},type:"undirected"}].forEach(function(re){["add","merge","update"].forEach(function(fe){var se=re.name(fe),M="add"===fe?bn:Xn;Cn.prototype[se]=re.generateKey?function(L,J,Ee){return M(this,se,!0,"undirected"===(re.type||this.type),null,L,J,Ee,"update"===fe)}:function(L,J,Ee,Fe){return M(this,se,!1,"undirected"===(re.type||this.type),L,J,Ee,Fe,"update"===fe)}})}),"undefined"!=typeof Symbol&&(Cn.prototype[Symbol.iterator]=Cn.prototype.adjacency),re=Cn,ze.forEach(function(fe){var se=fe.name,M=fe.attacher;M(re,se("Edge"),"mixed"),M(re,se("DirectedEdge"),"directed"),M(re,se("UndirectedEdge"),"undirected")}),function(re){Me.forEach(function(fe){var M,L,J,Ee;J=(M=fe).type,Ee=M.direction,re.prototype[L=M.name]=function(Fe,nt){if("mixed"!==J&&"mixed"!==this.type&&J!==this.type)return[];if(!arguments.length)return Re(this,J);if(1===arguments.length){var Pt=this._nodes.get(Fe=""+Fe);if(void 0===Pt)throw new ne("Graph.".concat(L,': could not find the "').concat(Fe,'" node in the graph.'));return In(this.multi,"mixed"===J?this.type:J,Ee,Pt)}if(2===arguments.length){nt=""+nt;var We=this._nodes.get(Fe=""+Fe);if(!We)throw new ne("Graph.".concat(L,': could not find the "').concat(Fe,'" source node in the graph.'));if(!this._nodes.has(nt))throw new ne("Graph.".concat(L,': could not find the "').concat(nt,'" target node in the graph.'));return xi(J,this.multi,Ee,We,nt)}throw new me("Graph.".concat(L,": too many arguments (expecting 0, 1 or 2 and got ").concat(arguments.length,")."))},function(se,M){var L=M.name,J=M.type,Ee=M.direction,Fe="forEach"+L[0].toUpperCase()+L.slice(1,-1);se.prototype[Fe]=function(nt,Pt,We){if("mixed"===J||"mixed"===this.type||J===this.type){if(1===arguments.length)return Ze(this,J,We=nt);if(2===arguments.length){We=Pt;var qt=this._nodes.get(nt=""+nt);if(void 0===qt)throw new ne("Graph.".concat(Fe,': could not find the "').concat(nt,'" node in the graph.'));return Nn(this.multi,"mixed"===J?this.type:J,Ee,qt,We)}if(3===arguments.length){Pt=""+Pt;var St=this._nodes.get(nt=""+nt);if(!St)throw new ne("Graph.".concat(Fe,': could not find the "').concat(nt,'" source node in the graph.'));if(!this._nodes.has(Pt))throw new ne("Graph.".concat(Fe,': could not find the "').concat(Pt,'" target node in the graph.'));return Xr(J,this.multi,Ee,St,Pt,We)}throw new me("Graph.".concat(Fe,": too many arguments (expecting 1, 2 or 3 and got ").concat(arguments.length,")."))}}}(re,fe),function(se,M){var L=M.name,J=M.type,Ee=M.direction,Fe="forEach"+L[0].toUpperCase()+L.slice(1,-1)+"Until";se.prototype[Fe]=function(nt,Pt,We){if("mixed"===J||"mixed"===this.type||J===this.type){if(1===arguments.length)return Tt(this,J,We=nt);if(2===arguments.length){We=Pt;var qt=this._nodes.get(nt=""+nt);if(void 0===qt)throw new ne("Graph.".concat(Fe,': could not find the "').concat(nt,'" node in the graph.'));return Yn(this.multi,"mixed"===J?this.type:J,Ee,qt,We)}if(3===arguments.length){Pt=""+Pt;var St=this._nodes.get(nt=""+nt);if(!St)throw new ne("Graph.".concat(Fe,': could not find the "').concat(nt,'" source node in the graph.'));if(!this._nodes.has(Pt))throw new ne("Graph.".concat(Fe,': could not find the "').concat(Pt,'" target node in the graph.'));return Ls(J,this.multi,Ee,St,Pt,We)}throw new me("Graph.".concat(Fe,": too many arguments (expecting 1, 2 or 3 and got ").concat(arguments.length,")."))}}}(re,fe),function(se,M){var J=M.type,Ee=M.direction,Fe=M.name.slice(0,-1)+"Entries";se.prototype[Fe]=function(nt,Pt){if("mixed"!==J&&"mixed"!==this.type&&J!==this.type)return oe.empty();if(!arguments.length)return kt(this,J);if(1===arguments.length){var We=this._nodes.get(nt=""+nt);if(!We)throw new ne("Graph.".concat(Fe,': could not find the "').concat(nt,'" node in the graph.'));return Mi(J,Ee,We)}if(2===arguments.length){Pt=""+Pt;var qt=this._nodes.get(nt=""+nt);if(!qt)throw new ne("Graph.".concat(Fe,': could not find the "').concat(nt,'" source node in the graph.'));if(!this._nodes.has(Pt))throw new ne("Graph.".concat(Fe,': could not find the "').concat(Pt,'" target node in the graph.'));return fs(J,Ee,qt,Pt)}throw new me("Graph.".concat(Fe,": too many arguments (expecting 0, 1 or 2 and got ").concat(arguments.length,")."))}}(re,fe)})}(Cn),function(re){Bs.forEach(function(fe){var M,L,J,Ee;J=(M=fe).type,Ee=M.direction,re.prototype[L=M.name]=function(Fe){if("mixed"!==J&&"mixed"!==this.type&&J!==this.type)return[];if(2===arguments.length){var nt=""+arguments[0],Pt=""+arguments[1];if(!this._nodes.has(nt))throw new ne("Graph.".concat(L,': could not find the "').concat(nt,'" node in the graph.'));if(!this._nodes.has(Pt))throw new ne("Graph.".concat(L,': could not find the "').concat(Pt,'" node in the graph.'));return lt(this,J,Ee,nt,Pt)}if(1===arguments.length){var We=this._nodes.get(Fe=""+Fe);if(void 0===We)throw new ne("Graph.".concat(L,': could not find the "').concat(Fe,'" node in the graph.'));return xa("mixed"===J?this.type:J,Ee,We)}throw new me("Graph.".concat(L,": invalid number of arguments (expecting 1 or 2 and got ").concat(arguments.length,")."))},function(re,fe){var se=fe.name,M=fe.type,L=fe.direction,J="forEach"+se[0].toUpperCase()+se.slice(1,-1);re.prototype[J]=function(Ee,Fe){if("mixed"===M||"mixed"===this.type||M===this.type){var nt=this._nodes.get(Ee=""+Ee);if(void 0===nt)throw new ne("Graph.".concat(J,': could not find the "').concat(Ee,'" node in the graph.'));!function(Pt,We,qt,St){if("mixed"!==Pt){if("undirected"===Pt)return kl(qt,qt.undirected,St);if("string"==typeof We)return kl(qt,qt[We],St)}var vn=new Set;"undirected"!==Pt&&("out"!==We&&Sa(vn,qt,qt.in,St),"in"!==We&&Sa(vn,qt,qt.out,St)),"directed"!==Pt&&Sa(vn,qt,qt.undirected,St)}("mixed"===M?this.type:M,L,nt,Fe)}}}(re,fe),function(re,fe){var se=fe.name,M=fe.type,L=fe.direction,J="forEach"+se[0].toUpperCase()+se.slice(1,-1)+"Until";re.prototype[J]=function(Ee,Fe){if("mixed"===M||"mixed"===this.type||M===this.type){var nt=this._nodes.get(Ee=""+Ee);if(void 0===nt)throw new ne("Graph.".concat(J,': could not find the "').concat(Ee,'" node in the graph.'));!function(Pt,We,qt,St){if("mixed"!==Pt){if("undirected"===Pt)return ws(qt,qt.undirected,St);if("string"==typeof We)return ws(qt,qt[We],St)}var vn=new Set;"undirected"!==Pt&&("out"!==We&&en(vn,qt,qt.in,St)||"in"!==We&&en(vn,qt,qt.out,St))||"directed"===Pt||en(vn,qt,qt.undirected,St)}("mixed"===M?this.type:M,L,nt,Fe)}}}(re,fe),function(re,fe){var M=fe.type,L=fe.direction,J=fe.name.slice(0,-1)+"Entries";re.prototype[J]=function(Ee){if("mixed"!==M&&"mixed"!==this.type&&M!==this.type)return oe.empty();var Fe=this._nodes.get(Ee=""+Ee);if(void 0===Fe)throw new ne("Graph.".concat(J,': could not find the "').concat(Ee,'" node in the graph.'));return function(nt,Pt,We){if("mixed"!==nt){if("undirected"===nt)return nl(We,We.undirected);if("string"==typeof Pt)return nl(We,We[Pt])}var qt=oe.empty(),St=new Set;return"undirected"!==nt&&("out"!==Pt&&(qt=Ke(qt,rt(St,We,We.in))),"in"!==Pt&&(qt=Ke(qt,rt(St,We,We.out)))),"directed"!==nt&&(qt=Ke(qt,rt(St,We,We.undirected))),qt}("mixed"===M?this.type:M,L,Fe)}}(re,fe)})}(Cn);var rr=function(re){function fe(se){var M=he({type:"directed"},se);if("multi"in M&&!1!==M.multi)throw new me("DirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if("directed"!==M.type)throw new me('DirectedGraph.from: inconsistent "'+M.type+'" type in given options!');return re.call(this,M)||this}return et(fe,re),fe}(Cn),sr=function(re){function fe(se){var M=he({type:"undirected"},se);if("multi"in M&&!1!==M.multi)throw new me("UndirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if("undirected"!==M.type)throw new me('UndirectedGraph.from: inconsistent "'+M.type+'" type in given options!');return re.call(this,M)||this}return et(fe,re),fe}(Cn),Qn=function(re){function fe(se){var M=he({multi:!0},se);if("multi"in M&&!0!==M.multi)throw new me("MultiGraph.from: inconsistent indication that the graph should be simple in given options!");return re.call(this,M)||this}return et(fe,re),fe}(Cn),Wi=function(re){function fe(se){var M=he({type:"directed",multi:!0},se);if("multi"in M&&!0!==M.multi)throw new me("MultiDirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if("directed"!==M.type)throw new me('MultiDirectedGraph.from: inconsistent "'+M.type+'" type in given options!');return re.call(this,M)||this}return et(fe,re),fe}(Cn),Ca=function(re){function fe(se){var M=he({type:"undirected",multi:!0},se);if("multi"in M&&!0!==M.multi)throw new me("MultiUndirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if("undirected"!==M.type)throw new me('MultiUndirectedGraph.from: inconsistent "'+M.type+'" type in given options!');return re.call(this,M)||this}return et(fe,re),fe}(Cn);function Qr(re){re.from=function(fe,se){var M=he({},fe.options,se),L=new re(M);return L.import(fe),L}}return Qr(Cn),Qr(rr),Qr(sr),Qr(Qn),Qr(Wi),Qr(Ca),Cn.Graph=Cn,Cn.DirectedGraph=rr,Cn.UndirectedGraph=sr,Cn.MultiGraph=Qn,Cn.MultiDirectedGraph=Wi,Cn.MultiUndirectedGraph=Ca,Cn.InvalidArgumentsGraphError=me,Cn.NotFoundGraphError=ne,Cn.UsageGraphError=ye,Cn}()},1524:(Ut,it,et)=>{var yt;!function(ee,Dt,dt,Y){"use strict";var T,Se=["","webkit","Moz","MS","ms","o"],he=Dt.createElement("div"),j=Math.round,k=Math.abs,Q=Date.now;function H(be,De,Ge){return setTimeout(A(be,Ge),De)}function v(be,De,Ge){return!!Array.isArray(be)&&(C(be,Ge[De],Ge),!0)}function C(be,De,Ge){var vt;if(be)if(be.forEach)be.forEach(De,Ge);else if(be.length!==Y)for(vt=0;vt\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",ui=ee.console&&(ee.console.warn||ee.console.log);return ui&&ui.call(ee.console,vt,Xt),be.apply(this,arguments)}}T="function"!=typeof Object.assign?function(De){if(De===Y||null===De)throw new TypeError("Cannot convert undefined or null to object");for(var Ge=Object(De),vt=1;vt-1}function K(be){return be.trim().split(/\s+/g)}function E(be,De,Ge){if(be.indexOf&&!Ge)return be.indexOf(De);for(var vt=0;vtxs[De]}):vt.sort()),vt}function ae(be,De){for(var Ge,vt,$t=De[0].toUpperCase()+De.slice(1),Xt=0;Xt1&&!Ge.firstMultiple?Ge.firstMultiple=Tt(De):1===$t&&(Ge.firstMultiple=!1);var Xt=Ge.firstInput,ui=Ge.firstMultiple,Vr=ui?ui.center:Xt.center,Jr=De.center=kt(vt);De.timeStamp=Q(),De.deltaTime=De.timeStamp-Xt.timeStamp,De.angle=Mi(Vr,Jr),De.distance=Yn(Vr,Jr),function(be,De){var Ge=De.center,vt=be.offsetDelta||{},$t=be.prevDelta||{},Xt=be.prevInput||{};(1===De.eventType||4===Xt.eventType)&&($t=be.prevDelta={x:Xt.deltaX||0,y:Xt.deltaY||0},vt=be.offsetDelta={x:Ge.x,y:Ge.y}),De.deltaX=$t.x+(Ge.x-vt.x),De.deltaY=$t.y+(Ge.y-vt.y)}(Ge,De),De.offsetDirection=Nn(De.deltaX,De.deltaY);var xs=In(De.deltaTime,De.deltaX,De.deltaY);De.overallVelocityX=xs.x,De.overallVelocityY=xs.y,De.overallVelocity=k(xs.x)>k(xs.y)?xs.x:xs.y,De.scale=ui?function(be,De){return Yn(De[0],De[1],pt)/Yn(be[0],be[1],pt)}(ui.pointers,vt):1,De.rotation=ui?function(be,De){return Mi(De[1],De[0],pt)+Mi(be[1],be[0],pt)}(ui.pointers,vt):0,De.maxPointers=Ge.prevInput?De.pointers.length>Ge.prevInput.maxPointers?De.pointers.length:Ge.prevInput.maxPointers:De.pointers.length,function(be,De){var $t,Xt,ui,Vr,Ge=be.lastInterval||De,vt=De.timeStamp-Ge.timeStamp;if(8!=De.eventType&&(vt>25||Ge.velocity===Y)){var Jr=De.deltaX-Ge.deltaX,xs=De.deltaY-Ge.deltaY,Zn=In(vt,Jr,xs);Xt=Zn.x,ui=Zn.y,$t=k(Zn.x)>k(Zn.y)?Zn.x:Zn.y,Vr=Nn(Jr,xs),be.lastInterval=De}else $t=Ge.velocity,Xt=Ge.velocityX,ui=Ge.velocityY,Vr=Ge.direction;De.velocity=$t,De.velocityX=Xt,De.velocityY=ui,De.direction=Vr}(Ge,De);var Zn=be.element;I(De.srcEvent.target,Zn)&&(Zn=De.srcEvent.target),De.target=Zn}(be,Ge),be.emit("hammer.input",Ge),be.recognize(Ge),be.session.prevInput=Ge}function Tt(be){for(var De=[],Ge=0;Ge=k(De)?be<0?2:4:De<0?8:16}function Yn(be,De,Ge){Ge||(Ge=_t);var vt=De[Ge[0]]-be[Ge[0]],$t=De[Ge[1]]-be[Ge[1]];return Math.sqrt(vt*vt+$t*$t)}function Mi(be,De,Ge){return Ge||(Ge=_t),180*Math.atan2(De[Ge[1]]-be[Ge[1]],De[Ge[0]]-be[Ge[0]])/Math.PI}we.prototype={handler:function(){},init:function(){this.evEl&&X(this.element,this.evEl,this.domHandler),this.evTarget&&X(this.target,this.evTarget,this.domHandler),this.evWin&&X(Te(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&ue(this.element,this.evEl,this.domHandler),this.evTarget&&ue(this.target,this.evTarget,this.domHandler),this.evWin&&ue(Te(this.element),this.evWin,this.domHandler)}};var Ls={mousedown:1,mousemove:2,mouseup:4},fs="mousedown",Bs="mousemove mouseup";function Kr(){this.evEl=fs,this.evWin=Bs,this.pressed=!1,we.apply(this,arguments)}S(Kr,we,{handler:function(De){var Ge=Ls[De.type];1&Ge&&0===De.button&&(this.pressed=!0),2&Ge&&1!==De.which&&(Ge=4),this.pressed&&(4&Ge&&(this.pressed=!1),this.callback(this.manager,Ge,{pointers:[De],changedPointers:[De],pointerType:Qe,srcEvent:De}))}});var xa={pointerdown:1,pointermove:2,pointerup:4,pointercancel:8,pointerout:8},kl={2:$e,3:"pen",4:Qe,5:"kinect"},Sa="pointerdown",ws="pointermove pointerup pointercancel";function en(){this.evEl=Sa,this.evWin=ws,we.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}ee.MSPointerEvent&&!ee.PointerEvent&&(Sa="MSPointerDown",ws="MSPointerMove MSPointerUp MSPointerCancel"),S(en,we,{handler:function(De){var Ge=this.store,vt=!1,$t=De.type.toLowerCase().replace("ms",""),Xt=xa[$t],ui=kl[De.pointerType]||De.pointerType,Vr=ui==$e,Jr=E(Ge,De.pointerId,"pointerId");1&Xt&&(0===De.button||Vr)?Jr<0&&(Ge.push(De),Jr=Ge.length-1):12&Xt&&(vt=!0),!(Jr<0)&&(Ge[Jr]=De,this.callback(this.manager,Xt,{pointers:Ge,changedPointers:[De],pointerType:ui,srcEvent:De}),vt&&Ge.splice(Jr,1))}});var nl={touchstart:1,touchmove:2,touchend:4,touchcancel:8},rt="touchstart",lt="touchstart touchmove touchend touchcancel";function ht(){this.evTarget=rt,this.evWin=lt,this.started=!1,we.apply(this,arguments)}function ge(be,De){var Ge=$(be.touches),vt=$(be.changedTouches);return 12&De&&(Ge=Z(Ge.concat(vt),"identifier",!0)),[Ge,vt]}S(ht,we,{handler:function(De){var Ge=nl[De.type];if(1===Ge&&(this.started=!0),this.started){var vt=ge.call(this,De,Ge);12&Ge&&vt[0].length-vt[1].length==0&&(this.started=!1),this.callback(this.manager,Ge,{pointers:vt[0],changedPointers:vt[1],pointerType:$e,srcEvent:De})}}});var ve={touchstart:1,touchmove:2,touchend:4,touchcancel:8},Be="touchstart touchmove touchend touchcancel";function ut(){this.evTarget=Be,this.targetIds={},we.apply(this,arguments)}function Je(be,De){var Ge=$(be.touches),vt=this.targetIds;if(3&De&&1===Ge.length)return vt[Ge[0].identifier]=!0,[Ge,Ge];var $t,Xt,ui=$(be.changedTouches),Vr=[],Jr=this.target;if(Xt=Ge.filter(function(xs){return I(xs.target,Jr)}),1===De)for($t=0;$t-1&&vt.splice(Xt,1)},2500)}}function ci(be){for(var De=be.srcEvent.clientX,Ge=be.srcEvent.clientY,vt=0;vt-1&&this.requireFail.splice(De,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(be){return!!this.simultaneous[be.id]},emit:function(be){var De=this,Ge=this.state;function vt($t){De.manager.emit($t,be)}Ge<8&&vt(De.options.event+We(Ge)),vt(De.options.event),be.additionalEvent&&vt(be.additionalEvent),Ge>=8&&vt(De.options.event+We(Ge))},tryEmit:function(be){if(this.canEmit())return this.emit(be);this.state=32},canEmit:function(){for(var be=0;beDe.threshold&&$t&De.direction},attrTest:function(be){return vn.prototype.attrTest.call(this,be)&&(2&this.state||!(2&this.state)&&this.directionTest(be))},emit:function(be){this.pX=be.deltaX,this.pY=be.deltaY;var De=qt(be.direction);De&&(be.additionalEvent=this.options.event+De),this._super.emit.call(this,be)}}),S(Zr,vn,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[sr]},attrTest:function(be){return this._super.attrTest.call(this,be)&&(Math.abs(be.scale-1)>this.options.threshold||2&this.state)},emit:function(be){1!==be.scale&&(be.additionalEvent=this.options.event+(be.scale<1?"in":"out")),this._super.emit.call(this,be)}}),S(Js,Pt,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return["auto"]},process:function(be){var De=this.options,Ge=be.pointers.length===De.pointers,vt=be.distanceDe.time;if(this._input=be,!vt||!Ge||12&be.eventType&&!$t)this.reset();else if(1&be.eventType)this.reset(),this._timer=H(function(){this.state=8,this.tryEmit()},De.time,this);else if(4&be.eventType)return 8;return 32},reset:function(){clearTimeout(this._timer)},emit:function(be){8===this.state&&(be&&4&be.eventType?this.manager.emit(this.options.event+"up",be):(this._input.timeStamp=Q(),this.manager.emit(this.options.event,this._input)))}}),S(Fl,vn,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[sr]},attrTest:function(be){return this._super.attrTest.call(this,be)&&(Math.abs(be.rotation)>this.options.threshold||2&this.state)}}),S(fo,vn,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:30,pointers:1},getTouchAction:function(){return Es.prototype.getTouchAction.call(this)},attrTest:function(be){var Ge,De=this.options.direction;return 30&De?Ge=be.overallVelocity:6&De?Ge=be.overallVelocityX:24&De&&(Ge=be.overallVelocityY),this._super.attrTest.call(this,be)&&De&be.offsetDirection&&be.distance>this.options.threshold&&be.maxPointers==this.options.pointers&&k(Ge)>this.options.velocity&&4&be.eventType},emit:function(be){var De=qt(be.offsetDirection);De&&this.manager.emit(this.options.event+De,be),this.manager.emit(this.options.event,be)}}),S(Br,Pt,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[rr]},process:function(be){var De=this.options,Ge=be.pointers.length===De.pointers,vt=be.distance"']/g,ws=RegExp(kl.source),en=RegExp(Sa.source),nl=/<%-([\s\S]+?)%>/g,rt=/<%([\s\S]+?)%>/g,lt=/<%=([\s\S]+?)%>/g,ht=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ge=/^\w*$/,ve=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Be=/[\\^$.*+?()[\]{}|]/g,ut=RegExp(Be.source),Je=/^\s+/,Mt=/\s/,It=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Ot=/\{\n\/\* \[wrapped with (.+)\] \*/,Qt=/,? & /,zn=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ci=/[()=,{}\[\]\/\s]/,Rn=/\\(\\)?/g,bn=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Xn=/\w*$/,Cn=/^[-+]0x[0-9a-f]+$/i,rr=/^0b[01]+$/i,sr=/^\[object .+?Constructor\]$/,Qn=/^0o[0-7]+$/i,Wi=/^(?:0|[1-9]\d*)$/,Ca=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Qr=/($^)/,re=/['\n\r\u2028\u2029\\]/g,fe="\\ud800-\\udfff",J="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Ee="\\u2700-\\u27bf",Fe="a-z\\xdf-\\xf6\\xf8-\\xff",St="A-Z\\xc0-\\xd6\\xd8-\\xde",vn="\\ufe0e\\ufe0f",Es="\\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",Js="["+fe+"]",Fl="["+Es+"]",fo="["+J+"]",Br="\\d+",Vs="["+Ee+"]",Ac="["+Fe+"]",xn="[^"+fe+Es+Br+Ee+Fe+St+"]",po="\\ud83c[\\udffb-\\udfff]",Ta="[^"+fe+"]",Ed="(?:\\ud83c[\\udde6-\\uddff]){2}",be="[\\ud800-\\udbff][\\udc00-\\udfff]",De="["+St+"]",vt="(?:"+Ac+"|"+xn+")",$t="(?:"+De+"|"+xn+")",Xt="(?:['\u2019](?:d|ll|m|re|s|t|ve))?",ui="(?:['\u2019](?:D|LL|M|RE|S|T|VE))?",Vr="(?:"+fo+"|"+po+")?",Jr="["+vn+"]?",C1=Jr+Vr+"(?:\\u200d(?:"+[Ta,Ed,be].join("|")+")"+Jr+Vr+")*",xd="(?:"+[Vs,Ed,be].join("|")+")"+C1,er="(?:"+[Ta+fo+"?",fo,Ed,be,Js].join("|")+")",fp=RegExp("['\u2019]","g"),n_=RegExp(fo,"g"),Oh=RegExp(po+"(?="+po+")|"+er+C1,"g"),iv=RegExp([De+"?"+Ac+"+"+Xt+"(?="+[Fl,De,"$"].join("|")+")",$t+"+"+ui+"(?="+[Fl,De+vt,"$"].join("|")+")",De+"?"+vt+"+"+Xt,De+"+"+ui,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Br,xd].join("|"),"g"),T1=RegExp("[\\u200d"+fe+J+vn+"]"),Bl=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Rh=["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"],A1=-1,rn={};rn[kt]=rn[In]=rn[Nn]=rn[Yn]=rn[Mi]=rn[xi]=rn[Xr]=rn[Ls]=rn[fs]=!0,rn[Qe]=rn[tt]=rn[Ze]=rn[ze]=rn[Tt]=rn[Le]=rn[Me]=rn[Ue]=rn[ke]=rn[q]=rn[pe]=rn[_t]=rn[pt]=rn[we]=rn[V]=!1;var or={};or[Qe]=or[tt]=or[Ze]=or[Tt]=or[ze]=or[Le]=or[kt]=or[In]=or[Nn]=or[Yn]=or[Mi]=or[ke]=or[q]=or[pe]=or[_t]=or[pt]=or[we]=or[B]=or[xi]=or[Xr]=or[Ls]=or[fs]=!0,or[Me]=or[Ue]=or[V]=!1;var tn={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},M1=parseFloat,av=parseInt,Nt="object"==typeof global&&global&&global.Object===Object&&global,js="object"==typeof self&&self&&self.Object===Object&&self,Ui=Nt||js||Function("return this")(),Vl=it&&!it.nodeType&&it,Aa=Vl&&Ut&&!Ut.nodeType&&Ut,No=Aa&&Aa.exports===Vl,i_=No&&Nt.process,xr=function(){try{return Aa&&Aa.require&&Aa.require("util").types||i_&&i_.binding&&i_.binding("util")}catch(Rt){}}(),an=xr&&xr.isArrayBuffer,hi=xr&&xr.isDate,ur=xr&&xr.isMap,go=xr&&xr.isRegExp,Mc=xr&&xr.isSet,ss=xr&&xr.isTypedArray;function os(at,Rt,Ct){switch(Ct.length){case 0:return at.call(Rt);case 1:return at.call(Rt,Ct[0]);case 2:return at.call(Rt,Ct[0],Ct[1]);case 3:return at.call(Rt,Ct[0],Ct[1],Ct[2])}return at.apply(Rt,Ct)}function jr(at,Rt,Ct,hn){for(var Mn=-1,Li=null==at?0:at.length;++Mn-1}function Ph(at,Rt,Ct){for(var hn=-1,Mn=null==at?0:at.length;++hn-1;);return Ct}function R1(at,Rt){for(var Ct=at.length;Ct--&&il(Rt,at[Ct],0)>-1;);return Ct}function rF(at,Rt){for(var Ct=at.length,hn=0;Ct--;)at[Ct]===Rt&&++hn;return hn}var sF=Jo({\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"}),oF=Jo({"&":"&","<":"<",">":">",'"':""","'":"'"});function aF(at){return"\\"+tn[at]}function Fh(at){return T1.test(at)}function cv(at){var Rt=-1,Ct=Array(at.size);return at.forEach(function(hn,Mn){Ct[++Rt]=[Mn,hn]}),Ct}function P1(at,Rt){return function(Ct){return at(Rt(Ct))}}function xu(at,Rt){for(var Ct=-1,hn=at.length,Mn=0,Li=[];++Ct",""":'"',"'":"'"}),Bh=function at(Rt){var d,Ct=(Rt=null==Rt?Ui:Bh.defaults(Ui.Object(),Rt,Bh.pick(Ui,Rh))).Array,hn=Rt.Date,Mn=Rt.Error,Li=Rt.Function,es=Rt.Math,Yi=Rt.Object,u_=Rt.RegExp,d_=Rt.String,Ia=Rt.TypeError,dr=Ct.prototype,Su=Yi.prototype,gp=Rt["__core-js_shared__"],Sr=Li.prototype.toString,Xi=Su.hasOwnProperty,fF=0,Vh=(d=/[^.]+$/.exec(gp&&gp.keys&&gp.keys.IE_PROTO||""))?"Symbol(src)_1."+d:"",eo=Su.toString,F1=Sr.call(Yi),h_=Ui._,Dd=u_("^"+Sr.call(Xi).replace(Be,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),zs=No?Rt.Buffer:ee,Ul=Rt.Symbol,Id=Rt.Uint8Array,hv=zs?zs.allocUnsafe:ee,Oa=P1(Yi.getPrototypeOf,Yi),f_=Yi.create,mp=Su.propertyIsEnumerable,Ln=dr.splice,L1=Ul?Ul.isConcatSpreadable:ee,jh=Ul?Ul.iterator:ee,Cu=Ul?Ul.toStringTag:ee,_p=function(){try{var d=jc(Yi,"defineProperty");return d({},"",{}),d}catch(p){}}(),fv=Rt.clearTimeout!==Ui.clearTimeout&&Rt.clearTimeout,B1=hn&&hn.now!==Ui.Date.now&&hn.now,V1=Rt.setTimeout!==Ui.setTimeout&&Rt.setTimeout,Vt=es.ceil,Si=es.floor,_r=Yi.getOwnPropertySymbols,as=zs?zs.isBuffer:ee,p_=Rt.isFinite,Uh=dr.join,sl=P1(Yi.keys,Yi),zr=es.max,ps=es.min,pF=hn.now,j1=Rt.parseInt,zh=es.random,yp=dr.reverse,Cs=jc(Rt,"DataView"),mo=jc(Rt,"Map"),bp=jc(Rt,"Promise"),Ra=jc(Rt,"Set"),Fo=jc(Rt,"WeakMap"),Hh=jc(Yi,"create"),Gh=Fo&&new Fo,Od={},U1=Lu(Cs),g_=Lu(mo),m_=Lu(bp),pv=Lu(Ra),__=Lu(Fo),vp=Ul?Ul.prototype:ee,Rd=vp?vp.valueOf:ee,$h=vp?vp.toString:ee;function xe(d){if(Ar(d)&&!On(d)&&!(d instanceof fi)){if(d instanceof Lo)return d;if(Xi.call(d,"__wrapped__"))return sf(d)}return new Lo(d)}var Tu=function(){function d(){}return function(p){if(!Tr(p))return{};if(f_)return f_(p);d.prototype=p;var _=new d;return d.prototype=ee,_}}();function Wh(){}function Lo(d,p){this.__wrapped__=d,this.__actions__=[],this.__chain__=!!p,this.__index__=0,this.__values__=ee}function fi(d){this.__wrapped__=d,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=ye,this.__views__=[]}function _o(d){var p=-1,_=null==d?0:d.length;for(this.clear();++p<_;){var F=d[p];this.set(F[0],F[1])}}function zl(d){var p=-1,_=null==d?0:d.length;for(this.clear();++p<_;){var F=d[p];this.set(F[0],F[1])}}function ol(d){var p=-1,_=null==d?0:d.length;for(this.clear();++p<_;){var F=d[p];this.set(F[0],F[1])}}function Pa(d){var p=-1,_=null==d?0:d.length;for(this.__data__=new ol;++p<_;)this.add(d[p])}function Na(d){var p=this.__data__=new zl(d);this.size=p.size}function Yh(d,p){var _=On(d),F=!_&&gl(d),le=!_&&!F&&ml(d),Ae=!_&&!F&&!le&&df(d),He=_||F||le||Ae,Ye=He?Md(d.length,d_):[],ct=Ye.length;for(var Ft in d)(p||Xi.call(d,Ft))&&(!He||!("length"==Ft||le&&("offset"==Ft||"parent"==Ft)||Ae&&("buffer"==Ft||"byteLength"==Ft||"byteOffset"==Ft)||jo(Ft,ct)))&&Ye.push(Ft);return Ye}function w_(d){var p=d.length;return p?d[Hl(0,p-1)]:ee}function yv(d,p){return qd(no(d),Au(p,0,d.length))}function Pd(d){return qd(no(d))}function E_(d,p,_){(_!==ee&&!Dn(d[p],_)||_===ee&&!(p in d))&&ll(d,p,_)}function al(d,p,_){var F=d[p];(!Xi.call(d,p)||!Dn(F,_)||_===ee&&!(p in d))&&ll(d,p,_)}function Nd(d,p){for(var _=d.length;_--;)if(Dn(d[_][0],p))return _;return-1}function Cp(d,p,_,F){return Pc(d,function(le,Ae,He){p(F,le,_(le),He)}),F}function Q1(d,p){return d&&Fa(p,Is(p),d)}function ll(d,p,_){"__proto__"==p&&_p?_p(d,p,{configurable:!0,enumerable:!0,value:_,writable:!0}):d[p]=_}function x_(d,p){for(var _=-1,F=p.length,le=Ct(F),Ae=null==d;++_=p?d:p)),d}function Hs(d,p,_,F,le,Ae){var He,Ye=1&p,ct=2&p,Ft=4&p;if(_&&(He=le?_(d,F,le,Ae):_(d)),He!==ee)return He;if(!Tr(d))return d;var Lt=On(d);if(Lt){if(He=function(d){var p=d.length,_=new d.constructor(p);return p&&"string"==typeof d[0]&&Xi.call(d,"index")&&(_.index=d.index,_.input=d.input),_}(d),!Ye)return no(d,He)}else{var Gt=$s(d),nn=Gt==Ue||Gt==qe;if(ml(d))return Pp(d,Ye);if(Gt==pe||Gt==Qe||nn&&!le){if(He=ct||nn?{}:Uv(d),!Ye)return ct?function(d,p){return Fa(d,Bv(d),p)}(d,function(d,p){return d&&Fa(p,ro(p),d)}(He,d)):function(d,p){return Fa(d,V_(d),p)}(d,Q1(He,d))}else{if(!or[Gt])return le?d:{};He=function(d,p,_){var F=d.constructor;switch(p){case Ze:return Pu(d);case ze:case Le:return new F(+d);case Tt:return function(d,p){var _=p?Pu(d.buffer):d.buffer;return new d.constructor(_,d.byteOffset,d.byteLength)}(d,_);case kt:case In:case Nn:case Yn:case Mi:case xi:case Xr:case Ls:case fs:return N_(d,_);case ke:return new F;case q:case we:return new F(d);case _t:return function(d){var p=new d.constructor(d.source,Xn.exec(d));return p.lastIndex=d.lastIndex,p}(d);case pt:return new F;case B:return function(d){return Rd?Yi(Rd.call(d)):{}}(d)}}(d,Gt,Ye)}}Ae||(Ae=new Na);var wn=Ae.get(d);if(wn)return wn;Ae.set(d,He),yA(d)?d.forEach(function(Bn){He.add(Hs(Bn,p,_,Bn,d,Ae))}):pA(d)&&d.forEach(function(Bn,mi){He.set(mi,Hs(Bn,p,_,mi,d,Ae))});var gi=Lt?ee:(Ft?ct?L_:ql:ct?ro:Is)(d);return Us(gi||d,function(Bn,mi){gi&&(Bn=d[mi=Bn]),al(He,mi,Hs(Bn,p,_,mi,d,Ae))}),He}function Tp(d,p,_){var F=_.length;if(null==d)return!F;for(d=Yi(d);F--;){var le=_[F],He=d[le];if(He===ee&&!(le in d)||!(0,p[le])(He))return!1}return!0}function Xh(d,p,_){if("function"!=typeof d)throw new Ia(Se);return nf(function(){d.apply(ee,_)},p)}function Rc(d,p,_,F){var le=-1,Ae=jl,He=!0,Ye=d.length,ct=[],Ft=p.length;if(!Ye)return ct;_&&(p=qi(p,ta(_))),F?(Ae=Ph,He=!1):p.length>=200&&(Ae=kh,He=!1,p=new Pa(p));e:for(;++le-1},zl.prototype.set=function(d,p){var _=this.__data__,F=Nd(_,d);return F<0?(++this.size,_.push([d,p])):_[F][1]=p,this},ol.prototype.clear=function(){this.size=0,this.__data__={hash:new _o,map:new(mo||zl),string:new _o}},ol.prototype.delete=function(d){var p=Gs(this,d).delete(d);return this.size-=p?1:0,p},ol.prototype.get=function(d){return Gs(this,d).get(d)},ol.prototype.has=function(d){return Gs(this,d).has(d)},ol.prototype.set=function(d,p){var _=Gs(this,d),F=_.size;return _.set(d,p),this.size+=_.size==F?0:1,this},Pa.prototype.add=Pa.prototype.push=function(d){return this.__data__.set(d,W),this},Pa.prototype.has=function(d){return this.__data__.has(d)},Na.prototype.clear=function(){this.__data__=new zl,this.size=0},Na.prototype.delete=function(d){var p=this.__data__,_=p.delete(d);return this.size=p.size,_},Na.prototype.get=function(d){return this.__data__.get(d)},Na.prototype.has=function(d){return this.__data__.has(d)},Na.prototype.set=function(d,p){var _=this.__data__;if(_ instanceof zl){var F=_.__data__;if(!mo||F.length<199)return F.push([d,p]),this.size=++_.size,this;_=this.__data__=new ol(F)}return _.set(d,p),this.size=_.size,this};var Pc=dl(cl),C_=dl(Ap,!0);function vv(d,p){var _=!0;return Pc(d,function(F,le,Ae){return _=!!p(F,le,Ae)}),_}function Kh(d,p,_){for(var F=-1,le=d.length;++F0&&_(Ye)?p>1?Ts(Ye,p-1,_,F,le):Ur(le,Ye):F||(le[le.length]=Ye)}return le}var kd=Dv(),Fd=Dv(!0);function cl(d,p){return d&&kd(d,p,Is)}function Ap(d,p){return d&&Fd(d,p,Is)}function Qh(d,p){return Ma(p,function(_){return ua(d[_])})}function na(d,p){for(var _=0,F=(p=Lc(p,d)).length;null!=d&&_p}function Ld(d,p){return null!=d&&Xi.call(d,p)}function Bd(d,p){return null!=d&&p in Yi(d)}function Mu(d,p,_){for(var F=_?Ph:jl,le=d[0].length,Ae=d.length,He=Ae,Ye=Ct(Ae),ct=1/0,Ft=[];He--;){var Lt=d[He];He&&p&&(Lt=qi(Lt,ta(p))),ct=ps(Lt.length,ct),Ye[He]=!_&&(p||le>=120&&Lt.length>=120)?new Pa(He&&Lt):ee}Lt=d[0];var Gt=-1,nn=Ye[0];e:for(;++Gt=Ye?ct:ct*("desc"==_[F]?-1:1)}return d.index-p.index}(Ae,He,_)});Ct--;)at[Ct]=at[Ct].value;return at}(nT(d,function(Ae,He,Ye){return{criteria:qi(p,function(Ft){return Ft(Ae)}),index:++F,value:Ae}}))}function Cv(d,p,_){for(var F=-1,le=p.length,Ae={};++F-1;)Ye!==d&&Ln.call(Ye,ct,1),Ln.call(d,ct,1);return d}function Jh(d,p){for(var _=d?p.length:0,F=_-1;_--;){var le=p[_];if(_==F||le!==Ae){var Ae=le;jo(le)?Ln.call(d,le,1):Iu(d,le)}}return d}function Hl(d,p){return d+Si(zh()*(p-d+1))}function Dp(d,p){var _="";if(!d||p<1||p>Te)return _;do{p%2&&(_+=d),(p=Si(p/2))&&(d+=d)}while(p);return _}function pi(d,p){return Hp(yT(d,p,so),d+"")}function rT(d){return w_(nh(d))}function xF(d,p){var _=nh(d);return qd(_,Au(p,0,_.length))}function Ip(d,p,_,F){if(!Tr(d))return d;for(var le=-1,Ae=(p=Lc(p,d)).length,He=Ae-1,Ye=d;null!=Ye&&++lele?0:le+p),(_=_>le?le:_)<0&&(_+=le),le=p>_?0:_-p>>>0,p>>>=0;for(var Ae=Ct(le);++F>>1,He=d[Ae];null!==He&&!da(He)&&(_?He<=p:He=200){var Ft=p?null:F_(d);if(Ft)return a_(Ft);He=!1,le=kh,ct=new Pa}else ct=p?[]:Ye;e:for(;++F=F?d:Ms(d,p,_)}var aT=fv||function(d){return Ui.clearTimeout(d)};function Pp(d,p){if(p)return d.slice();var _=d.length,F=hv?hv(_):new d.constructor(_);return d.copy(F),F}function Pu(d){var p=new d.constructor(d.byteLength);return new Id(p).set(new Id(d)),p}function N_(d,p){var _=p?Pu(d.buffer):d.buffer;return new d.constructor(_,d.byteOffset,d.length)}function Bc(d,p){if(d!==p){var _=d!==ee,F=null===d,le=d==d,Ae=da(d),He=p!==ee,Ye=null===p,ct=p==p,Ft=da(p);if(!Ye&&!Ft&&!Ae&&d>p||Ae&&He&&ct&&!Ye&&!Ft||F&&He&&ct||!_&&ct||!le)return 1;if(!F&&!Ae&&!Ft&&d1?_[le-1]:ee,He=le>2?_[2]:ee;for(Ae=d.length>3&&"function"==typeof Ae?(le--,Ae):ee,He&&Ws(_[0],_[1],He)&&(Ae=le<3?ee:Ae,le=1),p=Yi(p);++F-1?le[Ae?p[He]:He]:ee}}function ku(d){return hl(function(p){var _=p.length,F=_,le=Lo.prototype.thru;for(d&&p.reverse();F--;){var Ae=p[F];if("function"!=typeof Ae)throw new Ia(Se);if(le&&!He&&"wrapper"==jp(Ae))var He=new Lo([],!0)}for(F=He?F:_;++F<_;){var Ye=jp(Ae=p[F]),ct="wrapper"==Ye?B_(Ae):ee;He=ct&&Up(ct[0])&&424==ct[1]&&!ct[4].length&&1==ct[9]?He[jp(ct[0])].apply(He,ct[3]):1==Ae.length&&Up(Ae)?He[Ye]():He.thru(Ae)}return function(){var Ft=arguments,Lt=Ft[0];if(He&&1==Ft.length&&On(Lt))return He.plant(Lt).value();for(var Gt=0,nn=_?p[Gt].apply(this,Ft):Lt;++Gt<_;)nn=p[Gt].call(this,nn);return nn}})}function Vc(d,p,_,F,le,Ae,He,Ye,ct,Ft){var Lt=p&X,Gt=1&p,nn=2&p,wn=24&p,Fn=512&p,gi=nn?ee:Gd(d);return function Bn(){for(var mi=arguments.length,Di=Ct(mi),wo=mi;wo--;)Di[wo]=arguments[wo];if(wn)var qs=Wd(Bn),ha=rF(Di,qs);if(F&&(Di=zd(Di,F,le,wn)),Ae&&(Di=Mv(Di,Ae,He,wn)),mi-=ha,wn&&mi1&&Di.reverse(),Lt&&ctYe))return!1;var Ft=Ae.get(d),Lt=Ae.get(p);if(Ft&&Lt)return Ft==p&&Lt==d;var Gt=-1,nn=!0,wn=2&_?new Pa:ee;for(Ae.set(d,p),Ae.set(p,d);++Gt-1&&d%1==0&&d1?"& ":"")+p[F],p=p.join(_>2?", ":" "),d.replace(It,"{\n/* [wrapped with "+p+"] */\n")}(F,function(d,p){return Us(st,function(_){var F="_."+_[0];p&_[1]&&!jl(d,F)&&d.push(F)}),d.sort()}(function(d){var p=d.match(Ot);return p?p[1].split(Qt):[]}(F),_)))}function $_(d){var p=0,_=0;return function(){var F=pF(),le=16-(F-_);if(_=F,le>0){if(++p>=800)return arguments[0]}else p=0;return d.apply(ee,arguments)}}function qd(d,p){var _=-1,F=d.length,le=F-1;for(p=p===ee?F:p;++_1?d[p-1]:ee;return _="function"==typeof _?(d.pop(),_):ee,HT(d,_)});function ty(d){var p=xe(d);return p.__chain__=!0,p}function Xd(d,p){return p(d)}var ny=hl(function(d){var p=d.length,_=p?d[0]:0,F=this.__wrapped__,le=function(Ae){return x_(Ae,d)};return!(p>1||this.__actions__.length)&&F instanceof fi&&jo(_)?((F=F.slice(_,+_+(p?1:0))).__actions__.push({func:Xd,args:[le],thisArg:ee}),new Lo(F,this.__chain__).thru(function(Ae){return p&&!Ae.length&&Ae.push(ee),Ae})):this.thru(le)}),WT=ts(function(d,p,_){Xi.call(d,_)?++d[_]:ll(d,_,1)}),KT=Ov(q_),QT=Ov(Y_);function oy(d,p){return(On(d)?Us:Pc)(d,kn(p,3))}function Wp(d,p){return(On(d)?Sd:C_)(d,kn(p,3))}var JT=ts(function(d,p,_){Xi.call(d,_)?d[_].push(p):ll(d,_,[p])}),cw=pi(function(d,p,_){var F=-1,le="function"==typeof p,Ae=bo(d)?Ct(d.length):[];return Pc(d,function(He){Ae[++F]=le?os(p,He,_):ka(He,p,_)}),Ae}),uw=ts(function(d,p,_){ll(d,_,p)});function pl(d,p){return(On(d)?qi:nT)(d,kn(p,3))}var hw=ts(function(d,p,_){d[_?0:1].push(p)},function(){return[[],[]]}),Yp=pi(function(d,p){if(null==d)return[];var _=p.length;return _>1&&Ws(d,p[0],p[1])?p=[]:_>2&&Ws(p[0],p[1],p[2])&&(p=[p[0]]),Zh(d,Ts(p,1),[])}),Bu=B1||function(){return Ui.Date.now()};function Xp(d,p,_){return p=_?ee:p,Wl(d,X,ee,ee,ee,ee,p=d&&null==p?d.length:p)}function ly(d,p){var _;if("function"!=typeof p)throw new Ia(Se);return d=ti(d),function(){return--d>0&&(_=p.apply(this,arguments)),d<=1&&(p=ee),_}}var cf=pi(function(d,p,_){var F=1;if(_.length){var le=xu(_,Wd(cf));F|=z}return Wl(d,F,p,_,le)}),Qd=pi(function(d,p,_){var F=3;if(_.length){var le=xu(_,Wd(Qd));F|=z}return Wl(p,F,d,_,le)});function bw(d,p,_){var F,le,Ae,He,Ye,ct,Ft=0,Lt=!1,Gt=!1,nn=!0;if("function"!=typeof d)throw new Ia(Se);function wn(Gi){var bl=F,Gc=le;return F=le=ee,Ft=Gi,He=d.apply(Gc,bl)}function Fn(Gi){return Ft=Gi,Ye=nf(mi,p),Lt?wn(Gi):He}function Bn(Gi){var bl=Gi-ct;return ct===ee||bl>=p||bl<0||Gt&&Gi-Ft>=Ae}function mi(){var Gi=Bu();if(Bn(Gi))return Di(Gi);Ye=nf(mi,function(Gi){var aM=p-(Gi-ct);return Gt?ps(aM,Ae-(Gi-Ft)):aM}(Gi))}function Di(Gi){return Ye=ee,nn&&F?wn(Gi):(F=le=ee,He)}function ha(){var Gi=Bu(),bl=Bn(Gi);if(F=arguments,le=this,ct=Gi,bl){if(Ye===ee)return Fn(ct);if(Gt)return aT(Ye),Ye=nf(mi,p),wn(ct)}return Ye===ee&&(Ye=nf(mi,p)),He}return p=vo(p)||0,Tr(_)&&(Lt=!!_.leading,Ae=(Gt="maxWait"in _)?zr(vo(_.maxWait)||0,p):Ae,nn="trailing"in _?!!_.trailing:nn),ha.cancel=function(){Ye!==ee&&aT(Ye),Ft=0,F=ct=le=Ye=ee},ha.flush=function(){return Ye===ee?He:Di(Bu())},ha}var iA=pi(function(d,p){return Xh(d,1,p)}),vw=pi(function(d,p,_){return Xh(d,vo(p)||0,_)});function uf(d,p){if("function"!=typeof d||null!=p&&"function"!=typeof p)throw new Ia(Se);var _=function(){var F=arguments,le=p?p.apply(this,F):F[0],Ae=_.cache;if(Ae.has(le))return Ae.get(le);var He=d.apply(this,F);return _.cache=Ae.set(le,He)||Ae,He};return _.cache=new(uf.Cache||ol),_}function dy(d){if("function"!=typeof d)throw new Ia(Se);return function(){var p=arguments;switch(p.length){case 0:return!d.call(this);case 1:return!d.call(this,p[0]);case 2:return!d.call(this,p[0],p[1]);case 3:return!d.call(this,p[0],p[1],p[2])}return!d.apply(this,p)}}uf.Cache=ol;var rA=oT(function(d,p){var _=(p=1==p.length&&On(p[0])?qi(p[0],ta(kn())):qi(Ts(p,1),ta(kn()))).length;return pi(function(F){for(var le=-1,Ae=ps(F.length,_);++le=p}),gl=Z1(function(){return arguments}())?Z1:function(d){return Ar(d)&&Xi.call(d,"callee")&&!mp.call(d,"callee")},On=Ct.isArray,Tw=an?ta(an):function(d){return Ar(d)&&As(d)==Ze};function bo(d){return null!=d&&fy(d.length)&&!ua(d)}function Cr(d){return Ar(d)&&bo(d)}var ml=as||Fy,Aw=hi?ta(hi):function(d){return Ar(d)&&As(d)==Le};function Ba(d){if(!Ar(d))return!1;var p=As(d);return p==Me||"[object DOMException]"==p||"string"==typeof d.message&&"string"==typeof d.name&&!Jp(d)}function ua(d){if(!Tr(d))return!1;var p=As(d);return p==Ue||p==qe||"[object AsyncFunction]"==p||"[object Proxy]"==p}function Zp(d){return"number"==typeof d&&d==ti(d)}function fy(d){return"number"==typeof d&&d>-1&&d%1==0&&d<=Te}function Tr(d){var p=typeof d;return null!=d&&("object"==p||"function"==p)}function Ar(d){return null!=d&&"object"==typeof d}var pA=ur?ta(ur):function(d){return Ar(d)&&$s(d)==ke};function _A(d){return"number"==typeof d||Ar(d)&&As(d)==q}function Jp(d){if(!Ar(d)||As(d)!=pe)return!1;var p=Oa(d);if(null===p)return!0;var _=Xi.call(p,"constructor")&&p.constructor;return"function"==typeof _&&_ instanceof _&&Sr.call(_)==F1}var Ow=go?ta(go):function(d){return Ar(d)&&As(d)==_t},yA=Mc?ta(Mc):function(d){return Ar(d)&&$s(d)==pt};function gy(d){return"string"==typeof d||!On(d)&&Ar(d)&&As(d)==we}function da(d){return"symbol"==typeof d||Ar(d)&&As(d)==B}var df=ss?ta(ss):function(d){return Ar(d)&&fy(d.length)&&!!rn[As(d)]},Uc=Lp(Sv),my=Lp(function(d,p){return d<=p});function Rw(d){if(!d)return[];if(bo(d))return gy(d)?rl(d):no(d);if(jh&&d[jh])return function(at){for(var Rt,Ct=[];!(Rt=at.next()).done;)Ct.push(Rt.value);return Ct}(d[jh]());var p=$s(d);return(p==ke?cv:p==pt?a_:nh)(d)}function _l(d){return d?(d=vo(d))===te||d===-te?17976931348623157e292*(d<0?-1:1):d==d?d:0:0===d?d:0}function ti(d){var p=_l(d),_=p%1;return p==p?_?p-_:p:0}function _y(d){return d?Au(ti(d),0,ye):0}function vo(d){if("number"==typeof d)return d;if(da(d))return NaN;if(Tr(d)){var p="function"==typeof d.valueOf?d.valueOf():d;d=Tr(p)?p+"":p}if("string"!=typeof d)return 0===d?d:+d;d=lv(d);var _=rr.test(d);return _||Qn.test(d)?av(d.slice(2),_?2:8):Cn.test(d)?NaN:+d}function Pw(d){return Fa(d,ro(d))}function Hi(d){return null==d?"":Vo(d)}var bA=Gl(function(d,p){if(zp(p)||bo(p))Fa(p,Is(p),d);else for(var _ in p)Xi.call(p,_)&&al(d,_,p[_])}),vA=Gl(function(d,p){Fa(p,ro(p),d)}),Zd=Gl(function(d,p,_,F){Fa(p,ro(p),d,F)}),wA=Gl(function(d,p,_,F){Fa(p,Is(p),d,F)}),Nw=hl(x_),xA=pi(function(d,p){d=Yi(d);var _=-1,F=p.length,le=F>2?p[2]:ee;for(le&&Ws(p[0],p[1],le)&&(F=1);++_1),Ae}),Fa(d,L_(d),_),F&&(_=Hs(_,7,Bp));for(var le=p.length;le--;)Iu(_,p[le]);return _}),MA=hl(function(d,p){return null==d?{}:function(d,p){return Cv(d,p,function(_,F){return eg(d,F)})}(d,p)});function Uw(d,p){if(null==d)return{};var _=qi(L_(d),function(F){return[F]});return p=kn(p),Cv(d,_,function(F,le){return p(F,le[0])})}var DA=Fu(Is),Hw=Fu(ro);function nh(d){return null==d?[]:o_(d,Is(d))}var NA=$l(function(d,p,_){return p=p.toLowerCase(),d+(_?wy(p):p)});function wy(d){return ig(Hi(d).toLowerCase())}function Ey(d){return(d=Hi(d))&&d.replace(Ca,sF).replace(n_,"")}var FA=$l(function(d,p,_){return d+(_?"-":"")+p.toLowerCase()}),LA=$l(function(d,p,_){return d+(_?" ":"")+p.toLowerCase()}),GF=Np("toLowerCase"),zA=$l(function(d,p,_){return d+(_?"_":"")+p.toLowerCase()}),Cy=$l(function(d,p,_){return d+(_?" ":"")+ig(p)}),Xw=$l(function(d,p,_){return d+(_?" ":"")+p.toUpperCase()}),ig=Np("toUpperCase");function Dy(d,p,_){return d=Hi(d),(p=_?ee:p)===ee?function(at){return Bl.test(at)}(d)?function(at){return at.match(iv)||[]}(d):function(at){return at.match(zn)||[]}(d):d.match(p)||[]}var Iy=pi(function(d,p){try{return os(d,ee,p)}catch(_){return Ba(_)?_:new Mn(_)}}),Kw=hl(function(d,p){return Us(p,function(_){_=si(_),ll(d,_,cf(d[_],d))}),d});function Oy(d){return function(){return d}}var WF=ku(),Vu=ku(!0);function so(d){return d}function ju(d){return tT("function"==typeof d?d:Hs(d,1))}var Ry=pi(function(d,p){return function(_){return ka(_,d,p)}}),Qw=pi(function(d,p){return function(_){return ka(d,_,p)}});function Py(d,p,_){var F=Is(p),le=Qh(p,F);null==_&&(!Tr(p)||!le.length&&F.length)&&(_=p,p=d,d=this,le=Qh(p,Is(p)));var Ae=!(Tr(_)&&"chain"in _&&!_.chain),He=ua(d);return Us(le,function(Ye){var ct=p[Ye];d[Ye]=ct,He&&(d.prototype[Ye]=function(){var Ft=this.__chain__;if(Ae||Ft){var Lt=d(this.__wrapped__),Gt=Lt.__actions__=no(this.__actions__);return Gt.push({func:ct,args:arguments,thisArg:d}),Lt.__chain__=Ft,Lt}return ct.apply(d,Ur([this.value()],arguments))})}),d}function Ny(){}var XA=kp(qi),KA=kp(ri),Jw=kp(ko);function Uu(d){return oa(d)?r_(si(d)):function(d){return function(p){return na(p,d)}}(d)}var QA=Pv(),ZA=Pv(!0);function Hc(){return[]}function Fy(){return!1}var Hn=k_(function(d,p){return d+p},0),Ly=$d("ceil"),YF=k_(function(d,p){return d/p},1),Kl=$d("floor"),iE=k_(function(d,p){return d*p},1),rE=$d("round"),sE=k_(function(d,p){return d-p},0);return xe.after=function(d,p){if("function"!=typeof p)throw new Ia(Se);return d=ti(d),function(){if(--d<1)return p.apply(this,arguments)}},xe.ary=Xp,xe.assign=bA,xe.assignIn=vA,xe.assignInWith=Zd,xe.assignWith=wA,xe.at=Nw,xe.before=ly,xe.bind=cf,xe.bindAll=Kw,xe.bindKey=Qd,xe.castArray=function(){if(!arguments.length)return[];var d=arguments[0];return On(d)?d:[d]},xe.chain=ty,xe.chunk=function(d,p,_){p=(_?Ws(d,p,_):p===ee)?1:zr(ti(p),0);var F=null==d?0:d.length;if(!F||p<1)return[];for(var le=0,Ae=0,He=Ct(Vt(F/p));lele?0:le+_),(F=F===ee||F>le?le:ti(F))<0&&(F+=le),F=_>F?0:_y(F);_>>0)?(d=Hi(d))&&("string"==typeof p||null!=p&&!Ow(p))&&!(p=Vo(p))&&Fh(d)?ul(rl(d),0,_):d.split(p,_):[]},xe.spread=function(d,p){if("function"!=typeof d)throw new Ia(Se);return p=null==p?0:zr(ti(p),0),pi(function(_){var F=_[p],le=ul(_,0,p);return F&&Ur(le,F),os(d,this,le)})},xe.tail=function(d){var p=null==d?0:d.length;return p?Ms(d,1,p):[]},xe.take=function(d,p,_){return d&&d.length?Ms(d,0,(p=_||p===ee?1:ti(p))<0?0:p):[]},xe.takeRight=function(d,p,_){var F=null==d?0:d.length;return F?Ms(d,(p=F-(p=_||p===ee?1:ti(p)))<0?0:p,F):[]},xe.takeRightWhile=function(d,p){return d&&d.length?Ou(d,kn(p,3),!1,!0):[]},xe.takeWhile=function(d,p){return d&&d.length?Ou(d,kn(p,3)):[]},xe.tap=function(d,p){return p(d),d},xe.throttle=function(d,p,_){var F=!0,le=!0;if("function"!=typeof d)throw new Ia(Se);return Tr(_)&&(F="leading"in _?!!_.leading:F,le="trailing"in _?!!_.trailing:le),bw(d,p,{leading:F,maxWait:p,trailing:le})},xe.thru=Xd,xe.toArray=Rw,xe.toPairs=DA,xe.toPairsIn=Hw,xe.toPath=function(d){return On(d)?qi(d,si):da(d)?[d]:no($v(Hi(d)))},xe.toPlainObject=Pw,xe.transform=function(d,p,_){var F=On(d),le=F||ml(d)||df(d);if(p=kn(p,4),null==_){var Ae=d&&d.constructor;_=le?F?new Ae:[]:Tr(d)&&ua(Ae)?Tu(Oa(d)):{}}return(le?Us:cl)(d,function(He,Ye,ct){return p(_,He,Ye,ct)}),_},xe.unary=function(d){return Xp(d,1)},xe.union=tw,xe.unionBy=jT,xe.unionWith=UT,xe.uniq=function(d){return d&&d.length?kc(d):[]},xe.uniqBy=function(d,p){return d&&d.length?kc(d,kn(p,2)):[]},xe.uniqWith=function(d,p){return p="function"==typeof p?p:ee,d&&d.length?kc(d,ee,p):[]},xe.unset=function(d,p){return null==d||Iu(d,p)},xe.unzip=nw,xe.unzipWith=HT,xe.update=function(d,p,_){return null==d?d:Op(d,p,P_(_))},xe.updateWith=function(d,p,_,F){return F="function"==typeof F?F:ee,null==d?d:Op(d,p,P_(_),F)},xe.values=nh,xe.valuesIn=function(d){return null==d?[]:o_(d,ro(d))},xe.without=iw,xe.words=Dy,xe.wrap=function(d,p){return Kp(P_(p),d)},xe.xor=PF,xe.xorBy=Uo,xe.xorWith=J_,xe.zip=ey,xe.zipObject=function(d,p){return Rp(d||[],p||[],al)},xe.zipObjectDeep=function(d,p){return Rp(d||[],p||[],Ip)},xe.zipWith=lf,xe.entries=DA,xe.entriesIn=Hw,xe.extend=vA,xe.extendWith=Zd,Py(xe,xe),xe.add=Hn,xe.attempt=Iy,xe.camelCase=NA,xe.capitalize=wy,xe.ceil=Ly,xe.clamp=function(d,p,_){return _===ee&&(_=p,p=ee),_!==ee&&(_=(_=vo(_))==_?_:0),p!==ee&&(p=(p=vo(p))==p?p:0),Au(vo(d),p,_)},xe.clone=function(d){return Hs(d,4)},xe.cloneDeep=function(d){return Hs(d,5)},xe.cloneDeepWith=function(d,p){return Hs(d,5,p="function"==typeof p?p:ee)},xe.cloneWith=function(d,p){return Hs(d,4,p="function"==typeof p?p:ee)},xe.conformsTo=function(d,p){return null==p||Tp(d,p,Is(p))},xe.deburr=Ey,xe.defaultTo=function(d,p){return null==d||d!=d?p:d},xe.divide=YF,xe.endsWith=function(d,p,_){d=Hi(d),p=Vo(p);var F=d.length,le=_=_===ee?F:Au(ti(_),0,F);return(_-=p.length)>=0&&d.slice(_,le)==p},xe.eq=Dn,xe.escape=function(d){return(d=Hi(d))&&en.test(d)?d.replace(Sa,oF):d},xe.escapeRegExp=function(d){return(d=Hi(d))&&ut.test(d)?d.replace(Be,"\\$&"):d},xe.every=function(d,p,_){var F=On(d)?ri:vv;return _&&Ws(d,p,_)&&(p=ee),F(d,kn(p,3))},xe.find=KT,xe.findIndex=q_,xe.findKey=function(d,p){return Nh(d,kn(p,3),cl)},xe.findLast=QT,xe.findLastIndex=Y_,xe.findLastKey=function(d,p){return Nh(d,kn(p,3),Ap)},xe.floor=Kl,xe.forEach=oy,xe.forEachRight=Wp,xe.forIn=function(d,p){return null==d?d:kd(d,kn(p,3),ro)},xe.forInRight=function(d,p){return null==d?d:Fd(d,kn(p,3),ro)},xe.forOwn=function(d,p){return d&&cl(d,kn(p,3))},xe.forOwnRight=function(d,p){return d&&Ap(d,kn(p,3))},xe.get=pf,xe.gt=zt,xe.gte=Cw,xe.has=function(d,p){return null!=d&&jv(d,p,Ld)},xe.hasIn=eg,xe.head=qv,xe.identity=so,xe.includes=function(d,p,_,F){d=bo(d)?d:nh(d),_=_&&!F?ti(_):0;var le=d.length;return _<0&&(_=zr(le+_,0)),gy(d)?_<=le&&d.indexOf(p,_)>-1:!!le&&il(d,p,_)>-1},xe.indexOf=function(d,p,_){var F=null==d?0:d.length;if(!F)return-1;var le=null==_?0:ti(_);return le<0&&(le=zr(F+le,0)),il(d,p,le)},xe.inRange=function(d,p,_){return p=_l(p),_===ee?(_=p,p=0):_=_l(_),function(d,p,_){return d>=ps(p,_)&&d=-Te&&d<=Te},xe.isSet=yA,xe.isString=gy,xe.isSymbol=da,xe.isTypedArray=df,xe.isUndefined=function(d){return d===ee},xe.isWeakMap=function(d){return Ar(d)&&$s(d)==V},xe.isWeakSet=function(d){return Ar(d)&&"[object WeakSet]"==As(d)},xe.join=function(d,p){return null==d?"":Uh.call(d,p)},xe.kebabCase=FA,xe.last=aa,xe.lastIndexOf=function(d,p,_){var F=null==d?0:d.length;if(!F)return-1;var le=F;return _!==ee&&(le=(le=ti(_))<0?zr(F+le,0):ps(le,F-1)),p==p?function(at,Rt,Ct){for(var hn=Ct+1;hn--;)if(at[hn]===Rt)return hn;return hn}(d,p,le):Td(d,Dc,le,!0)},xe.lowerCase=LA,xe.lowerFirst=GF,xe.lt=Uc,xe.lte=my,xe.max=function(d){return d&&d.length?Kh(d,so,yo):ee},xe.maxBy=function(d,p){return d&&d.length?Kh(d,kn(p,2),yo):ee},xe.mean=function(d){return Ss(d,so)},xe.meanBy=function(d,p){return Ss(d,kn(p,2))},xe.min=function(d){return d&&d.length?Kh(d,so,Sv):ee},xe.minBy=function(d,p){return d&&d.length?Kh(d,kn(p,2),Sv):ee},xe.stubArray=Hc,xe.stubFalse=Fy,xe.stubObject=function(){return{}},xe.stubString=function(){return""},xe.stubTrue=function(){return!0},xe.multiply=iE,xe.nth=function(d,p){return d&&d.length?Du(d,ti(p)):ee},xe.noConflict=function(){return Ui._===this&&(Ui._=h_),this},xe.noop=Ny,xe.now=Bu,xe.pad=function(d,p,_){d=Hi(d);var F=(p=ti(p))?Lh(d):0;if(!p||F>=p)return d;var le=(p-F)/2;return Fp(Si(le),_)+d+Fp(Vt(le),_)},xe.padEnd=function(d,p,_){d=Hi(d);var F=(p=ti(p))?Lh(d):0;return p&&Fp){var F=d;d=p,p=F}if(_||d%1||p%1){var le=zh();return ps(d+le*(p-d+M1("1e-"+((le+"").length-1))),p)}return Hl(d,p)},xe.reduce=function(d,p,_){var F=On(d)?Eu:ea,le=arguments.length<3;return F(d,kn(p,4),_,le,Pc)},xe.reduceRight=function(d,p,_){var F=On(d)?Cd:ea,le=arguments.length<3;return F(d,kn(p,4),_,le,C_)},xe.repeat=function(d,p,_){return p=(_?Ws(d,p,_):p===ee)?1:ti(p),Dp(Hi(d),p)},xe.replace=function(){var d=arguments,p=Hi(d[0]);return d.length<3?p:p.replace(d[1],d[2])},xe.result=function(d,p,_){var F=-1,le=(p=Lc(p,d)).length;for(le||(le=1,d=ee);++FTe)return[];var _=ye,F=ps(d,ye);p=kn(p),d-=ye;for(var le=Md(F,p);++_=Ae)return d;var Ye=_-Lh(F);if(Ye<1)return F;var ct=He?ul(He,0,Ye).join(""):d.slice(0,Ye);if(le===ee)return ct+F;if(He&&(Ye+=ct.length-Ye),Ow(le)){if(d.slice(Ye).search(le)){var Ft,Lt=ct;for(le.global||(le=u_(le.source,Hi(Xn.exec(le))+"g")),le.lastIndex=0;Ft=le.exec(Lt);)var Gt=Ft.index;ct=ct.slice(0,Gt===ee?Ye:Gt)}}else if(d.indexOf(Vo(le),Ye)!=Ye){var nn=ct.lastIndexOf(le);nn>-1&&(ct=ct.slice(0,nn))}return ct+F},xe.unescape=function(d){return(d=Hi(d))&&ws.test(d)?d.replace(kl,c_):d},xe.uniqueId=function(d){var p=++fF;return Hi(d)+p},xe.upperCase=Xw,xe.upperFirst=ig,xe.each=oy,xe.eachRight=Wp,xe.first=qv,Py(xe,function(){var d={};return cl(xe,function(p,_){Xi.call(xe.prototype,_)||(d[_]=p)}),d}(),{chain:!1}),xe.VERSION="4.17.21",Us(["bind","bindKey","curry","curryRight","partial","partialRight"],function(d){xe[d].placeholder=xe}),Us(["drop","take"],function(d,p){fi.prototype[d]=function(_){_=_===ee?1:zr(ti(_),0);var F=this.__filtered__&&!p?new fi(this):this.clone();return F.__filtered__?F.__takeCount__=ps(_,F.__takeCount__):F.__views__.push({size:ps(_,ye),type:d+(F.__dir__<0?"Right":"")}),F},fi.prototype[d+"Right"]=function(_){return this.reverse()[d](_).reverse()}}),Us(["filter","map","takeWhile"],function(d,p){var _=p+1,F=1==_||3==_;fi.prototype[d]=function(le){var Ae=this.clone();return Ae.__iteratees__.push({iteratee:kn(le,3),type:_}),Ae.__filtered__=Ae.__filtered__||F,Ae}}),Us(["head","last"],function(d,p){var _="take"+(p?"Right":"");fi.prototype[d]=function(){return this[_](1).value()[0]}}),Us(["initial","tail"],function(d,p){var _="drop"+(p?"":"Right");fi.prototype[d]=function(){return this.__filtered__?new fi(this):this[_](1)}}),fi.prototype.compact=function(){return this.filter(so)},fi.prototype.find=function(d){return this.filter(d).head()},fi.prototype.findLast=function(d){return this.reverse().find(d)},fi.prototype.invokeMap=pi(function(d,p){return"function"==typeof d?new fi(this):this.map(function(_){return ka(_,d,p)})}),fi.prototype.reject=function(d){return this.filter(dy(kn(d)))},fi.prototype.slice=function(d,p){d=ti(d);var _=this;return _.__filtered__&&(d>0||p<0)?new fi(_):(d<0?_=_.takeRight(-d):d&&(_=_.drop(d)),p!==ee&&(_=(p=ti(p))<0?_.dropRight(-p):_.take(p-d)),_)},fi.prototype.takeRightWhile=function(d){return this.reverse().takeWhile(d).reverse()},fi.prototype.toArray=function(){return this.take(ye)},cl(fi.prototype,function(d,p){var _=/^(?:filter|find|map|reject)|While$/.test(p),F=/^(?:head|last)$/.test(p),le=xe[F?"take"+("last"==p?"Right":""):p],Ae=F||/^find/.test(p);!le||(xe.prototype[p]=function(){var He=this.__wrapped__,Ye=F?[1]:arguments,ct=He instanceof fi,Ft=Ye[0],Lt=ct||On(He),Gt=function(mi){var Di=le.apply(xe,Ur([mi],Ye));return F&&nn?Di[0]:Di};Lt&&_&&"function"==typeof Ft&&1!=Ft.length&&(ct=Lt=!1);var nn=this.__chain__,wn=!!this.__actions__.length,Fn=Ae&&!nn,gi=ct&&!wn;if(!Ae&&Lt){He=gi?He:new fi(this);var Bn=d.apply(He,Ye);return Bn.__actions__.push({func:Xd,args:[Gt],thisArg:ee}),new Lo(Bn,nn)}return Fn&&gi?d.apply(this,Ye):(Bn=this.thru(Gt),Fn?F?Bn.value()[0]:Bn.value():Bn)})}),Us(["pop","push","shift","sort","splice","unshift"],function(d){var p=dr[d],_=/^(?:push|sort|unshift)$/.test(d)?"tap":"thru",F=/^(?:pop|shift)$/.test(d);xe.prototype[d]=function(){var le=arguments;if(F&&!this.__chain__){var Ae=this.value();return p.apply(On(Ae)?Ae:[],le)}return this[_](function(He){return p.apply(On(He)?He:[],le)})}}),cl(fi.prototype,function(d,p){var _=xe[p];if(_){var F=_.name+"";Xi.call(Od,F)||(Od[F]=[]),Od[F].push({name:p,func:_})}}),Od[Vc(ee,2).name]=[{name:"wrapper",func:ee}],fi.prototype.clone=function(){var d=new fi(this.__wrapped__);return d.__actions__=no(this.__actions__),d.__dir__=this.__dir__,d.__filtered__=this.__filtered__,d.__iteratees__=no(this.__iteratees__),d.__takeCount__=this.__takeCount__,d.__views__=no(this.__views__),d},fi.prototype.reverse=function(){if(this.__filtered__){var d=new fi(this);d.__dir__=-1,d.__filtered__=!0}else(d=this.clone()).__dir__*=-1;return d},fi.prototype.value=function(){var d=this.__wrapped__.value(),p=this.__dir__,_=On(d),F=p<0,le=_?d.length:0,Ae=function(d,p,_){for(var F=-1,le=_.length;++F=this.__values__.length;return{done:d,value:d?ee:this.__values__[this.__index__++]}},xe.prototype.plant=function(d){for(var p,_=this;_ instanceof Wh;){var F=sf(_);F.__index__=0,F.__values__=ee,p?le.__wrapped__=F:p=F;var le=F;_=_.__wrapped__}return le.__wrapped__=d,p},xe.prototype.reverse=function(){var d=this.__wrapped__;if(d instanceof fi){var p=d;return this.__actions__.length&&(p=new fi(this)),(p=p.reverse()).__actions__.push({func:Xd,args:[Z_],thisArg:ee}),new Lo(p,this.__chain__)}return this.thru(Z_)},xe.prototype.toJSON=xe.prototype.valueOf=xe.prototype.value=function(){return sT(this.__wrapped__,this.__actions__)},xe.prototype.first=xe.prototype.head,jh&&(xe.prototype[jh]=function(){return this}),xe}();Ui._=Bh,(yt=function(){return Bh}.call(it,et,it,Ut))!==ee&&(Ut.exports=yt)}.call(this)},5478:function(Ut){Ut.exports=function(){"use strict";function it(rt,lt){for(var ht=0;htrt.length)&&(lt=rt.length);for(var ht=0,ge=new Array(lt);ht=rt.length?{done:!0}:{done:!1,value:rt[ge++]}}}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 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}}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:Y,changeDefaults:function(rt){dt.exports.defaults=rt}};var he=/[&<>"']/,W=/[&<>"']/g,j=/[<>"']|&(?!#?\w+;)/,k=/[<>"']|&(?!#?\w+;)/g,Q={"&":"&","<":"<",">":">",'"':""","'":"'"},H=function(lt){return Q[lt]};var C=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function R(rt){return rt.replace(C,function(lt,ht){return"colon"===(ht=ht.toLowerCase())?":":"#"===ht.charAt(0)?"x"===ht.charAt(1)?String.fromCharCode(parseInt(ht.substring(2),16)):String.fromCharCode(+ht.substring(1)):""})}var T=/(^|[^\[])\^/g;var y=/[^\w:]/g,S=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;var z={},P=/^[^:]+:\/*[^/]*$/,X=/^([^:]+:)[\s\S]*$/,ue=/^([^:]+:\/*[^/]*)[\s\S]*$/;function I(rt,lt){z[" "+rt]||(z[" "+rt]=P.test(rt)?rt+"/":$(rt,"/",!0));var ht=-1===(rt=z[" "+rt]).indexOf(":");return"//"===lt.substring(0,2)?ht?lt:rt.replace(X,"$1")+lt:"/"===lt.charAt(0)?ht?lt:rt.replace(ue,"$1")+lt:rt+lt}function $(rt,lt,ht){var ge=rt.length;if(0===ge)return"";for(var ve=0;ve1;)1<&&(ht+=rt),lt>>=1,rt+=rt;return ht+rt},Te=dt.exports.defaults,me=$,ne=function(rt,lt){var ge=rt.replace(/\|/g,function(Be,ut,Je){for(var Mt=!1,It=ut;--It>=0&&"\\"===Je[It];)Mt=!Mt;return Mt?"|":" |"}).split(/ \|/),ve=0;if(ge.length>lt)ge.splice(lt);else for(;ge.length1?{type:"space",raw:ve[0]}:{raw:"\n"}},lt.code=function(ge){var ve=this.rules.block.code.exec(ge);if(ve){var Be=ve[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:ve[0],codeBlockStyle:"indented",text:this.options.pedantic?Be:me(Be,"\n")}}},lt.fences=function(ge){var ve=this.rules.block.fences.exec(ge);if(ve){var Be=ve[0],ut=function(rt,lt){var ht=rt.match(/^(\s+)(?:```)/);if(null===ht)return lt;var ge=ht[1];return lt.split("\n").map(function(ve){var Be=ve.match(/^\s+/);return null===Be?ve:Be[0].length>=ge.length?ve.slice(ge.length):ve}).join("\n")}(Be,ve[3]||"");return{type:"code",raw:Be,lang:ve[2]?ve[2].trim():ve[2],text:ut}}},lt.heading=function(ge){var ve=this.rules.block.heading.exec(ge);if(ve){var Be=ve[2].trim();if(/#$/.test(Be)){var ut=me(Be,"#");(this.options.pedantic||!ut||/ $/.test(ut))&&(Be=ut.trim())}return{type:"heading",raw:ve[0],depth:ve[1].length,text:Be}}},lt.nptable=function(ge){var ve=this.rules.block.nptable.exec(ge);if(ve){var Be={type:"table",header:ne(ve[1].replace(/^ *| *\| *$/g,"")),align:ve[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ve[3]?ve[3].replace(/\n$/,"").split("\n"):[],raw:ve[0]};if(Be.header.length===Be.align.length){var Je,ut=Be.align.length;for(Je=0;Je ?/gm,"");return{type:"blockquote",raw:ve[0],text:Be}}},lt.list=function(ge){var ve=this.rules.block.list.exec(ge);if(ve){var Qt,zn,ci,Rn,bn,Xn,Cn,rr,sr,Be=ve[0],ut=ve[2],Je=ut.length>1,Mt={type:"list",raw:Be,ordered:Je,start:Je?+ut.slice(0,-1):"",loose:!1,items:[]},It=ve[0].match(this.rules.block.item),Ot=!1,Qn=It.length;ci=this.rules.block.listItemStart.exec(It[0]);for(var Wi=0;Wici[1].length:Rn[1].length>=ci[0].length||Rn[1].length>3){It.splice(Wi,2,It[Wi]+(!this.options.pedantic&&Rn[1].length/i.test(ut[0])&&(ve=!1),!Be&&/^<(pre|code|kbd|script)(\s|>)/i.test(ut[0])?Be=!0:Be&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(ut[0])&&(Be=!1),{type:this.options.sanitize?"text":"html",raw:ut[0],inLink:ve,inRawBlock:Be,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ut[0]):ye(ut[0]):ut[0]}},lt.link=function(ge){var ve=this.rules.inline.link.exec(ge);if(ve){var Be=ve[2].trim();if(!this.options.pedantic&&/^$/.test(Be))return;var ut=me(Be.slice(0,-1),"\\");if((Be.length-ut.length)%2==0)return}else{var Je=Oe(ve[2],"()");if(Je>-1){var It=(0===ve[0].indexOf("!")?5:4)+ve[1].length+Je;ve[2]=ve[2].substring(0,Je),ve[0]=ve[0].substring(0,It).trim(),ve[3]=""}}var Ot=ve[2],Qt="";if(this.options.pedantic){var zn=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Ot);zn&&(Ot=zn[1],Qt=zn[3])}else Qt=ve[3]?ve[3].slice(1,-1):"";return Ot=Ot.trim(),/^$/.test(Be)?Ot.slice(1):Ot.slice(1,-1)),$e(ve,{href:Ot&&Ot.replace(this.rules.inline._escapes,"$1"),title:Qt&&Qt.replace(this.rules.inline._escapes,"$1")},ve[0])}},lt.reflink=function(ge,ve){var Be;if((Be=this.rules.inline.reflink.exec(ge))||(Be=this.rules.inline.nolink.exec(ge))){var ut=(Be[2]||Be[1]).replace(/\s+/g," ");if(!(ut=ve[ut.toLowerCase()])||!ut.href){var Je=Be[0].charAt(0);return{type:"text",raw:Je,text:Je}}return $e(Be,ut,Be[0])}},lt.emStrong=function(ge,ve,Be){void 0===Be&&(Be="");var ut=this.rules.inline.emStrong.lDelim.exec(ge);if(ut&&(!ut[3]||!Be.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 Je=ut[1]||ut[2]||"";if(!Je||Je&&(""===Be||this.rules.inline.punctuation.exec(Be))){var It,Ot,Mt=ut[0].length-1,Qt=Mt,zn=0,ci="*"===ut[0][0]?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(ci.lastIndex=0,ve=ve.slice(-1*ge.length+Mt);null!=(ut=ci.exec(ve));)if(It=ut[1]||ut[2]||ut[3]||ut[4]||ut[5]||ut[6]){if(Ot=It.length,ut[3]||ut[4]){Qt+=Ot;continue}if((ut[5]||ut[6])&&Mt%3&&!((Mt+Ot)%3)){zn+=Ot;continue}if(!((Qt-=Ot)>0))return Ot=Math.min(Ot,Ot+Qt+zn),Math.min(Mt,Ot)%2?{type:"em",raw:ge.slice(0,Mt+ut.index+Ot+1),text:ge.slice(1,Mt+ut.index+Ot)}:{type:"strong",raw:ge.slice(0,Mt+ut.index+Ot+1),text:ge.slice(2,Mt+ut.index+Ot-1)}}}}},lt.codespan=function(ge){var ve=this.rules.inline.code.exec(ge);if(ve){var Be=ve[2].replace(/\n/g," "),ut=/[^ ]/.test(Be),Je=/^ /.test(Be)&&/ $/.test(Be);return ut&&Je&&(Be=Be.substring(1,Be.length-1)),Be=ye(Be,!0),{type:"codespan",raw:ve[0],text:Be}}},lt.br=function(ge){var ve=this.rules.inline.br.exec(ge);if(ve)return{type:"br",raw:ve[0]}},lt.del=function(ge){var ve=this.rules.inline.del.exec(ge);if(ve)return{type:"del",raw:ve[0],text:ve[2]}},lt.autolink=function(ge,ve){var ut,Je,Be=this.rules.inline.autolink.exec(ge);if(Be)return Je="@"===Be[2]?"mailto:"+(ut=ye(this.options.mangle?ve(Be[1]):Be[1])):ut=ye(Be[1]),{type:"link",raw:Be[0],text:ut,href:Je,tokens:[{type:"text",raw:ut,text:ut}]}},lt.url=function(ge,ve){var Be;if(Be=this.rules.inline.url.exec(ge)){var ut,Je;if("@"===Be[2])Je="mailto:"+(ut=ye(this.options.mangle?ve(Be[0]):Be[0]));else{var Mt;do{Mt=Be[0],Be[0]=this.rules.inline._backpedal.exec(Be[0])[0]}while(Mt!==Be[0]);ut=ye(Be[0]),Je="www."===Be[1]?"http://"+ut:ut}return{type:"link",raw:Be[0],text:ut,href:Je,tokens:[{type:"text",raw:ut,text:ut}]}}},lt.inlineText=function(ge,ve,Be){var Je,ut=this.rules.inline.text.exec(ge);if(ut)return Je=ve?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ut[0]):ye(ut[0]):ut[0]:ye(this.options.smartypants?Be(ut[0]):ut[0]),{type:"text",raw:ut[0],text:Je}},rt}(),tt=te_noopTest,Xe=te_edit,ze=te_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:tt,table:tt,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=Xe(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=Xe(Le.item,"gm").replace(/bull/g,Le.bullet).getRegex(),Le.listItemStart=Xe(/^( *)(bull) */).replace("bull",Le.bullet).getRegex(),Le.list=Xe(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=Xe(Le.html,"i").replace("comment",Le._comment).replace("tag",Le._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Le.paragraph=Xe(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=Xe(Le.blockquote).replace("paragraph",Le.paragraph).getRegex(),Le.normal=ze({},Le),Le.gfm=ze({},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=Xe(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=Xe(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=ze({},Le.normal,{html:Xe("^ *(?: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:tt,paragraph:Xe(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 Ke={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:tt,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:tt,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~"};Ke.punctuation=Xe(Ke.punctuation).replace(/punctuation/g,Ke._punctuation).getRegex(),Ke.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,Ke.escapedEmSt=/\\\*|\\_/g,Ke._comment=Xe(Le._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),Ke.emStrong.lDelim=Xe(Ke.emStrong.lDelim).replace(/punct/g,Ke._punctuation).getRegex(),Ke.emStrong.rDelimAst=Xe(Ke.emStrong.rDelimAst,"g").replace(/punct/g,Ke._punctuation).getRegex(),Ke.emStrong.rDelimUnd=Xe(Ke.emStrong.rDelimUnd,"g").replace(/punct/g,Ke._punctuation).getRegex(),Ke._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,Ke._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,Ke._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])?)+(?![-_])/,Ke.autolink=Xe(Ke.autolink).replace("scheme",Ke._scheme).replace("email",Ke._email).getRegex(),Ke._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,Ke.tag=Xe(Ke.tag).replace("comment",Ke._comment).replace("attribute",Ke._attribute).getRegex(),Ke._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Ke._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,Ke._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,Ke.link=Xe(Ke.link).replace("label",Ke._label).replace("href",Ke._href).replace("title",Ke._title).getRegex(),Ke.reflink=Xe(Ke.reflink).replace("label",Ke._label).getRegex(),Ke.reflinkSearch=Xe(Ke.reflinkSearch,"g").replace("reflink",Ke.reflink).replace("nolink",Ke.nolink).getRegex(),Ke.normal=ze({},Ke),Ke.pedantic=ze({},Ke.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:Xe(/^!?\[(label)\]\((.*?)\)/).replace("label",Ke._label).getRegex(),reflink:Xe(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Ke._label).getRegex()}),Ke.gfm=ze({},Ke.normal,{escape:Xe(Ke.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&&(ge="x"+ge.toString(16)),lt+="&#"+ge+";";return lt}var je=function(){function rt(ht){this.tokens=[],this.tokens.links=Object.create(null),this.options=ht||qe,this.options.tokenizer=this.options.tokenizer||new Ue,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var ge={block:ke.normal,inline:q.normal};this.options.pedantic?(ge.block=ke.pedantic,ge.inline=q.pedantic):this.options.gfm&&(ge.block=ke.gfm,ge.inline=this.options.breaks?q.breaks:q.gfm),this.tokenizer.rules=ge}rt.lex=function(ge,ve){return new rt(ve).lex(ge)},rt.lexInline=function(ge,ve){return new rt(ve).inlineTokens(ge)};var lt=rt.prototype;return lt.lex=function(ge){return ge=ge.replace(/\r\n|\r/g,"\n").replace(/\t/g," "),this.blockTokens(ge,this.tokens,!0),this.inline(this.tokens),this.tokens},lt.blockTokens=function(ge,ve,Be){var Je,Mt,It,Ot,Qt,zn,ut=this;for(void 0===ve&&(ve=[]),void 0===Be&&(Be=!0),this.options.pedantic&&(ge=ge.replace(/^ +$/gm,""));ge;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(function(Rn){return!!(Je=Rn.call(ut,ge,ve))&&(ge=ge.substring(Je.raw.length),ve.push(Je),!0)}))){if(Je=this.tokenizer.space(ge)){ge=ge.substring(Je.raw.length),Je.type&&ve.push(Je);continue}if(Je=this.tokenizer.code(ge)){ge=ge.substring(Je.raw.length),(Ot=ve[ve.length-1])&&"paragraph"===Ot.type?(Ot.raw+="\n"+Je.raw,Ot.text+="\n"+Je.text):ve.push(Je);continue}if(Je=this.tokenizer.fences(ge)){ge=ge.substring(Je.raw.length),ve.push(Je);continue}if(Je=this.tokenizer.heading(ge)){ge=ge.substring(Je.raw.length),ve.push(Je);continue}if(Je=this.tokenizer.nptable(ge)){ge=ge.substring(Je.raw.length),ve.push(Je);continue}if(Je=this.tokenizer.hr(ge)){ge=ge.substring(Je.raw.length),ve.push(Je);continue}if(Je=this.tokenizer.blockquote(ge)){ge=ge.substring(Je.raw.length),Je.tokens=this.blockTokens(Je.text,[],Be),ve.push(Je);continue}if(Je=this.tokenizer.list(ge)){for(ge=ge.substring(Je.raw.length),It=Je.items.length,Mt=0;Mt=0&&(Rn=Math.min(Rn,Xn))}),Rn<1/0&&Rn>=0&&(Qt=ge.substring(0,Rn+1))}(),Be&&(Je=this.tokenizer.paragraph(Qt))){Ot=ve[ve.length-1],zn&&"paragraph"===Ot.type?(Ot.raw+="\n"+Je.raw,Ot.text+="\n"+Je.text):ve.push(Je),zn=Qt.length!==ge.length,ge=ge.substring(Je.raw.length);continue}if(Je=this.tokenizer.text(ge)){ge=ge.substring(Je.raw.length),(Ot=ve[ve.length-1])&&"text"===Ot.type?(Ot.raw+="\n"+Je.raw,Ot.text+="\n"+Je.text):ve.push(Je);continue}if(ge){var ci="Infinite loop on byte: "+ge.charCodeAt(0);if(this.options.silent){console.error(ci);break}throw new Error(ci)}}return ve},lt.inline=function(ge){var ve,Be,ut,Je,Mt,It,Ot=ge.length;for(ve=0;ve0)for(;null!=(zn=this.tokenizer.rules.inline.reflinkSearch.exec(Qt));)bn.includes(zn[0].slice(zn[0].lastIndexOf("[")+1,-1))&&(Qt=Qt.slice(0,zn.index)+"["+G("a",zn[0].length-2)+"]"+Qt.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(zn=this.tokenizer.rules.inline.blockSkip.exec(Qt));)Qt=Qt.slice(0,zn.index)+"["+G("a",zn[0].length-2)+"]"+Qt.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(zn=this.tokenizer.rules.inline.escapedEmSt.exec(Qt));)Qt=Qt.slice(0,zn.index)+"++"+Qt.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;ge;)if(ci||(Rn=""),ci=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(function(Cn){return!!(Mt=Cn.call(Je,ge,ve))&&(ge=ge.substring(Mt.raw.length),ve.push(Mt),!0)}))){if(Mt=this.tokenizer.escape(ge)){ge=ge.substring(Mt.raw.length),ve.push(Mt);continue}if(Mt=this.tokenizer.tag(ge,Be,ut)){ge=ge.substring(Mt.raw.length),Be=Mt.inLink,ut=Mt.inRawBlock,(It=ve[ve.length-1])&&"text"===Mt.type&&"text"===It.type?(It.raw+=Mt.raw,It.text+=Mt.text):ve.push(Mt);continue}if(Mt=this.tokenizer.link(ge)){ge=ge.substring(Mt.raw.length),"link"===Mt.type&&(Mt.tokens=this.inlineTokens(Mt.text,[],!0,ut)),ve.push(Mt);continue}if(Mt=this.tokenizer.reflink(ge,this.tokens.links)){ge=ge.substring(Mt.raw.length),It=ve[ve.length-1],"link"===Mt.type?(Mt.tokens=this.inlineTokens(Mt.text,[],!0,ut),ve.push(Mt)):It&&"text"===Mt.type&&"text"===It.type?(It.raw+=Mt.raw,It.text+=Mt.text):ve.push(Mt);continue}if(Mt=this.tokenizer.emStrong(ge,Qt,Rn)){ge=ge.substring(Mt.raw.length),Mt.tokens=this.inlineTokens(Mt.text,[],Be,ut),ve.push(Mt);continue}if(Mt=this.tokenizer.codespan(ge)){ge=ge.substring(Mt.raw.length),ve.push(Mt);continue}if(Mt=this.tokenizer.br(ge)){ge=ge.substring(Mt.raw.length),ve.push(Mt);continue}if(Mt=this.tokenizer.del(ge)){ge=ge.substring(Mt.raw.length),Mt.tokens=this.inlineTokens(Mt.text,[],Be,ut),ve.push(Mt);continue}if(Mt=this.tokenizer.autolink(ge,de)){ge=ge.substring(Mt.raw.length),ve.push(Mt);continue}if(!Be&&(Mt=this.tokenizer.url(ge,de))){ge=ge.substring(Mt.raw.length),ve.push(Mt);continue}if(Ot=ge,this.options.extensions&&this.options.extensions.startInline&&function(){var Cn=1/0,rr=ge.slice(1),sr=void 0;Je.options.extensions.startInline.forEach(function(Qn){"number"==typeof(sr=Qn.call(this,rr))&&sr>=0&&(Cn=Math.min(Cn,sr))}),Cn<1/0&&Cn>=0&&(Ot=ge.substring(0,Cn+1))}(),Mt=this.tokenizer.inlineText(Ot,ut,pe)){ge=ge.substring(Mt.raw.length),"_"!==Mt.raw.slice(-1)&&(Rn=Mt.raw.slice(-1)),ci=!0,(It=ve[ve.length-1])&&"text"===It.type?(It.raw+=Mt.raw,It.text+=Mt.text):ve.push(Mt);continue}if(ge){var Xn="Infinite loop on byte: "+ge.charCodeAt(0);if(this.options.silent){console.error(Xn);break}throw new Error(Xn)}}return ve},function(rt,lt,ht){lt&&it(rt.prototype,lt),ht&&it(rt,ht)}(rt,null,[{key:"rules",get:function(){return{block:ke,inline:q}}}]),rt}(),_t=dt.exports.defaults,pt=te_cleanUrl,we=te_escape,B=function(){function rt(ht){this.options=ht||_t}var lt=rt.prototype;return lt.code=function(ge,ve,Be){var ut=(ve||"").match(/\S*/)[0];if(this.options.highlight){var Je=this.options.highlight(ge,ut);null!=Je&&Je!==ge&&(Be=!0,ge=Je)}return ge=ge.replace(/\n$/,"")+"\n",ut?'
    '+(Be?ge:we(ge,!0))+"
    \n":"
    "+(Be?ge:we(ge,!0))+"
    \n"},lt.blockquote=function(ge){return"
    \n"+ge+"
    \n"},lt.html=function(ge){return ge},lt.heading=function(ge,ve,Be,ut){return this.options.headerIds?"'+ge+"\n":""+ge+"\n"},lt.hr=function(){return this.options.xhtml?"
    \n":"
    \n"},lt.list=function(ge,ve,Be){var ut=ve?"ol":"ul";return"<"+ut+(ve&&1!==Be?' start="'+Be+'"':"")+">\n"+ge+"\n"},lt.listitem=function(ge){return"
  • "+ge+"
  • \n"},lt.checkbox=function(ge){return" "},lt.paragraph=function(ge){return"

    "+ge+"

    \n"},lt.table=function(ge,ve){return ve&&(ve=""+ve+""),"\n\n"+ge+"\n"+ve+"
    \n"},lt.tablerow=function(ge){return"\n"+ge+"\n"},lt.tablecell=function(ge,ve){var Be=ve.header?"th":"td";return(ve.align?"<"+Be+' align="'+ve.align+'">':"<"+Be+">")+ge+"\n"},lt.strong=function(ge){return""+ge+""},lt.em=function(ge){return""+ge+""},lt.codespan=function(ge){return""+ge+""},lt.br=function(){return this.options.xhtml?"
    ":"
    "},lt.del=function(ge){return""+ge+""},lt.link=function(ge,ve,Be){if(null===(ge=pt(this.options.sanitize,this.options.baseUrl,ge)))return Be;var ut='"+Be+""},lt.image=function(ge,ve,Be){if(null===(ge=pt(this.options.sanitize,this.options.baseUrl,ge)))return Be;var ut=''+Be+'":">")},lt.text=function(ge){return ge},rt}(),N=function(){function rt(){}var lt=rt.prototype;return lt.strong=function(ge){return ge},lt.em=function(ge){return ge},lt.codespan=function(ge){return ge},lt.del=function(ge){return ge},lt.html=function(ge){return ge},lt.text=function(ge){return ge},lt.link=function(ge,ve,Be){return""+Be},lt.image=function(ge,ve,Be){return""+Be},lt.br=function(){return""},rt}(),V=function(){function rt(){this.seen={}}var lt=rt.prototype;return lt.serialize=function(ge){return ge.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")},lt.getNextSafeSlug=function(ge,ve){var Be=ge,ut=0;if(this.seen.hasOwnProperty(Be)){ut=this.seen[ge];do{Be=ge+"-"+ ++ut}while(this.seen.hasOwnProperty(Be))}return ve||(this.seen[ge]=ut,this.seen[Be]=0),Be},lt.slug=function(ge,ve){void 0===ve&&(ve={});var Be=this.serialize(ge);return this.getNextSafeSlug(Be,ve.dryrun)},rt}(),Re=B,Ze=N,Tt=V,kt=dt.exports.defaults,In=te_unescape,Yn=je,Mi=function(){function rt(ht){this.options=ht||kt,this.options.renderer=this.options.renderer||new Re,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Ze,this.slugger=new Tt}rt.parse=function(ge,ve){return new rt(ve).parse(ge)},rt.parseInline=function(ge,ve){return new rt(ve).parseInline(ge)};var lt=rt.prototype;return lt.parse=function(ge,ve){void 0===ve&&(ve=!0);var ut,Je,Mt,It,Ot,Qt,zn,ci,Rn,bn,Xn,Cn,rr,sr,Qn,Wi,Ca,Qr,re,Be="",fe=ge.length;for(ut=0;ut0&&"text"===Qn.tokens[0].type?(Qn.tokens[0].text=Qr+" "+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=Qr+" "+Qn.tokens[0].tokens[0].text)):Qn.tokens.unshift({type:"text",text:Qr}):sr+=Qr),sr+=this.parse(Qn.tokens,rr),Rn+=this.renderer.listitem(sr,Ca,Wi);Be+=this.renderer.list(Rn,Xn,Cn);continue;case"html":Be+=this.renderer.html(bn.text);continue;case"paragraph":Be+=this.renderer.paragraph(this.parseInline(bn.tokens));continue;case"text":for(Rn=bn.tokens?this.parseInline(bn.tokens):bn.text;ut+1An error occurred:

    "+xa(Mt.message+"",!0)+"
    ";throw Mt}}return en.options=en.setOptions=function(rt){return Bs(en.defaults,rt),Sa(en.defaults),en},en.getDefaults=kl,en.defaults=ws,en.use=function(){for(var rt=this,lt=arguments.length,ht=new Array(lt),ge=0;geAn error occurred:

    "+xa(ge.message+"",!0)+"
    ";throw ge}},en.Parser=Mi,en.parser=Mi.parse,en.Renderer=Xr,en.TextRenderer=Ls,en.Lexer=Yn,en.lexer=Yn.lex,en.Tokenizer=xi,en.Slugger=fs,en.parse=en,en}()},9369:(Ut,it,et)=>{var yt=et(6284),ee=et(7830);function Dt(){this.clear()}Dt.prototype.clear=function(){this.items=[],this.offset=0,this.size=0},Dt.prototype.enqueue=function(dt){return this.items.push(dt),++this.size},Dt.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}},Dt.prototype.peek=function(){if(this.size)return this.items[this.offset]},Dt.prototype.forEach=function(dt,Y){Y=arguments.length>1?Y:this;for(var Se=this.offset,he=0,W=this.items.length;Se=dt.length)return{done:!0};var Se=dt[Y];return Y++,{value:Se,done:!1}})},Dt.prototype.entries=function(){var dt=this.items,Y=this.offset,Se=0;return new yt(function(){if(Y>=dt.length)return{done:!0};var he=dt[Y];return Y++,{value:[Se++,he],done:!1}})},"undefined"!=typeof Symbol&&(Dt.prototype[Symbol.iterator]=Dt.prototype.values),Dt.prototype.toString=function(){return this.toArray().join(",")},Dt.prototype.toJSON=function(){return this.toArray()},Dt.prototype.inspect=function(){var dt=this.toArray();return Object.defineProperty(dt,"constructor",{value:Dt,enumerable:!1}),dt},"undefined"!=typeof Symbol&&(Dt.prototype[Symbol.for("nodejs.util.inspect.custom")]=Dt.prototype.inspect),Dt.from=function(dt){var Y=new Dt;return ee(dt,function(Se){Y.enqueue(Se)}),Y},Dt.of=function(){return Dt.from(arguments)},Ut.exports=Dt},7830:Ut=>{var it="undefined"!=typeof ArrayBuffer,et="undefined"!=typeof Symbol;function yt(ee,Dt){var dt,Y,Se,he,W;if(!ee)throw new Error("obliterator/forEach: invalid iterable.");if("function"!=typeof Dt)throw new Error("obliterator/forEach: expecting a callback.");if(Array.isArray(ee)||it&&ArrayBuffer.isView(ee)||"string"==typeof ee||"[object Arguments]"===ee.toString())for(Se=0,he=ee.length;Se{function it(et){Object.defineProperty(this,"_next",{writable:!1,enumerable:!1,value:et}),this.done=!1}it.prototype.next=function(){if(this.done)return{done:!0};var et=this._next();return et.done&&(this.done=!0),et},"undefined"!=typeof Symbol&&(it.prototype[Symbol.iterator]=function(){return this}),it.of=function(){var et=arguments,yt=et.length,ee=0;return new it(function(){return ee>=yt?{done:!0}:{done:!1,value:et[ee++]}})},it.empty=function(){var et=new it(null);return et.done=!0,et},it.is=function(et){return et instanceof it||"object"==typeof et&&null!==et&&"function"==typeof et.next},Ut.exports=it},7310:(Ut,it,et)=>{"use strict";var yt=et(1948);Object.defineProperty(it,"__esModule",{value:!0}),it.isMobile=function(){return void 0!==ee.window.orientation},it.default=function(he){if(!he&&!(0,Dt.default)())return"Node";if((0,dt.default)(he))return"Electron";var W="undefined"!=typeof navigator?navigator:{},j=he||W.userAgent||"";if(j.indexOf("Edge")>-1)return"Edge";var k=-1!==j.indexOf("MSIE "),Q=-1!==j.indexOf("Trident/");return k||Q?"IE":ee.window.chrome?"Chrome":ee.window.safari?"Safari":ee.window.mozInnerScreenX?"Firefox":"Unknown"};var ee=et(1151),Dt=yt(et(1602)),dt=yt(et(2344))},1151:(Ut,it,et)=>{"use strict";var yt=et(1948);Object.defineProperty(it,"__esModule",{value:!0}),it.console=it.process=it.document=it.global=it.window=it.self=void 0;var ee=yt(et(4321)),Dt={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,ee.default)(process))&&process};it.self=Dt.self||Dt.window||Dt.global,it.window=Dt.window||Dt.self||Dt.global,it.global=Dt.global||Dt.self||Dt.window,it.document=Dt.document||{},it.process=Dt.process||{};var j=console;it.console=j},4761:(Ut,it,et)=>{"use strict";var ee=et(1948),Dt=et(4321);Object.defineProperty(it,"CO",{enumerable:!0,get:function(){return dt.global}}),Object.defineProperty(it,"qs",{enumerable:!0,get:function(){return Se.default}});var dt=et(1151),Se=(j(et(1602)),j(et(7310)));ee(et(2344));function W(k){if("function"!=typeof WeakMap)return null;var Q=new WeakMap,H=new WeakMap;return(W=function(C){return C?H:Q})(k)}function j(k,Q){if(!Q&&k&&k.__esModule)return k;if(null===k||"object"!==Dt(k)&&"function"!=typeof k)return{default:k};var H=W(Q);if(H&&H.has(k))return H.get(k);var v={},C=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var R in k)if("default"!==R&&Object.prototype.hasOwnProperty.call(k,R)){var T=C?Object.getOwnPropertyDescriptor(k,R):null;T&&(T.get||T.set)?Object.defineProperty(v,R,T):v[R]=k[R]}return v.default=k,H&&H.set(k,v),v}},1602:(Ut,it,et)=>{"use strict";var yt=et(1948);Object.defineProperty(it,"__esModule",{value:!0}),it.default=dt,it.isBrowserMainThread=function(){return dt()&&"undefined"!=typeof document};var ee=yt(et(4321)),Dt=yt(et(2344));function dt(){return!("object"===("undefined"==typeof process?"undefined":(0,ee.default)(process))&&"[object process]"===String(process)&&!process.browser)||(0,Dt.default)()}},2344:(Ut,it,et)=>{"use strict";var yt=et(1948);Object.defineProperty(it,"__esModule",{value:!0}),it.default=function(dt){if("undefined"!=typeof window&&"object"===(0,ee.default)(window.process)&&"renderer"===window.process.type||"undefined"!=typeof process&&"object"===(0,ee.default)(process.versions)&&Boolean(process.versions.electron))return!0;var Y="object"===("undefined"==typeof navigator?"undefined":(0,ee.default)(navigator))&&"string"==typeof navigator.userAgent&&navigator.userAgent,Se=dt||Y;return!!(Se&&Se.indexOf("Electron")>=0)};var ee=yt(et(4321))},6991:function(Ut,it,et){"use strict";var yt=this&&this.__createBinding||(Object.create?function(Dt,dt,Y,Se){void 0===Se&&(Se=Y),Object.defineProperty(Dt,Se,{enumerable:!0,get:function(){return dt[Y]}})}:function(Dt,dt,Y,Se){void 0===Se&&(Se=Y),Dt[Se]=dt[Y]}),ee=this&&this.__exportStar||function(Dt,dt){for(var Y in Dt)"default"!==Y&&!Object.prototype.hasOwnProperty.call(dt,Y)&&yt(dt,Dt,Y)};Object.defineProperty(it,"__esModule",{value:!0}),ee(et(4180),it),ee(et(5103),it),ee(et(8965),it),ee(et(2595),it),ee(et(2417),it),ee(et(2451),it),ee(et(7735),it)},4180:(Ut,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.BlankNode=void 0,it.BlankNode=class{constructor(ee){this.termType="BlankNode",this.value=ee}equals(ee){return!!ee&&"BlankNode"===ee.termType&&ee.value===this.value}}},5103:(Ut,it,et)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.DataFactory=void 0;const yt=et(4180),ee=et(8965),Dt=et(2595),dt=et(2417),Y=et(2451),Se=et(7735);let he=0;it.DataFactory=class{constructor(k){this.blankNodeCounter=0,this.blankNodePrefix=(k=k||{}).blankNodePrefix||`df_${he++}_`}namedNode(k){return new dt.NamedNode(k)}blankNode(k){return new yt.BlankNode(k||`${this.blankNodePrefix}${this.blankNodeCounter++}`)}literal(k,Q){return new Dt.Literal(k,Q)}variable(k){return new Se.Variable(k)}defaultGraph(){return ee.DefaultGraph.INSTANCE}quad(k,Q,H,v){return new Y.Quad(k,Q,H,v||this.defaultGraph())}fromTerm(k){switch(k.termType){case"NamedNode":return this.namedNode(k.value);case"BlankNode":return this.blankNode(k.value);case"Literal":return k.language?this.literal(k.value,k.language):k.datatype.equals(Dt.Literal.XSD_STRING)?this.literal(k.value):this.literal(k.value,this.fromTerm(k.datatype));case"Variable":return this.variable(k.value);case"DefaultGraph":return this.defaultGraph();case"Quad":return this.quad(this.fromTerm(k.subject),this.fromTerm(k.predicate),this.fromTerm(k.object),this.fromTerm(k.graph))}}fromQuad(k){return this.fromTerm(k)}resetBlankNodeCounter(){this.blankNodeCounter=0}}},8965:(Ut,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.DefaultGraph=void 0;class et{constructor(){this.termType="DefaultGraph",this.value=""}equals(ee){return!!ee&&"DefaultGraph"===ee.termType}}it.DefaultGraph=et,et.INSTANCE=new et},2595:(Ut,it,et)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.Literal=void 0;const yt=et(2417);class ee{constructor(dt,Y){this.termType="Literal",this.value=dt,"string"==typeof Y?(this.language=Y,this.datatype=ee.RDF_LANGUAGE_STRING):Y?(this.language="",this.datatype=Y):(this.language="",this.datatype=ee.XSD_STRING)}equals(dt){return!!dt&&"Literal"===dt.termType&&dt.value===this.value&&dt.language===this.language&&dt.datatype.equals(this.datatype)}}it.Literal=ee,ee.RDF_LANGUAGE_STRING=new yt.NamedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),ee.XSD_STRING=new yt.NamedNode("http://www.w3.org/2001/XMLSchema#string")},2417:(Ut,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.NamedNode=void 0,it.NamedNode=class{constructor(ee){this.termType="NamedNode",this.value=ee}equals(ee){return!!ee&&"NamedNode"===ee.termType&&ee.value===this.value}}},2451:(Ut,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.Quad=void 0,it.Quad=class{constructor(ee,Dt,dt,Y){this.termType="Quad",this.value="",this.subject=ee,this.predicate=Dt,this.object=dt,this.graph=Y}equals(ee){return!!ee&&("Quad"===ee.termType||!ee.termType)&&this.subject.equals(ee.subject)&&this.predicate.equals(ee.predicate)&&this.object.equals(ee.object)&&this.graph.equals(ee.graph)}}},7735:(Ut,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.Variable=void 0,it.Variable=class{constructor(ee){this.termType="Variable",this.value=ee}equals(ee){return!!ee&&"Variable"===ee.termType&&ee.value===this.value}}},1609:function(Ut,it,et){"use strict";var yt=this&&this.__createBinding||(Object.create?function(v,C,R,T){void 0===T&&(T=R),Object.defineProperty(v,T,{enumerable:!0,get:function(){return C[R]}})}:function(v,C,R,T){void 0===T&&(T=R),v[T]=C[R]}),ee=this&&this.__exportStar||function(v,C){for(var R in v)"default"!==R&&!Object.prototype.hasOwnProperty.call(C,R)&&yt(C,v,R)};Object.defineProperty(it,"__esModule",{value:!0}),it.getSupportedJavaScriptPrimitives=it.getSupportedRdfDatatypes=it.getTermRaw=it.toRdf=it.fromRdf=void 0;const Dt=et(6991),dt=et(9938),Y=et(6060);ee(et(9938),it),ee(et(8871),it),ee(et(6060),it);const Se=new Dt.DataFactory,he=new Y.Translator;function W(v,C){return he.fromRdf(v,C)}he.registerHandler(new dt.TypeHandlerString,dt.TypeHandlerString.TYPES.map(v=>Se.namedNode(v)),["string"]),he.registerHandler(new dt.TypeHandlerBoolean,[dt.TypeHandlerBoolean.TYPE].map(v=>Se.namedNode(v)),["boolean"]),he.registerHandler(new dt.TypeHandlerNumberDouble,dt.TypeHandlerNumberDouble.TYPES.map(v=>Se.namedNode(v)),["number"]),he.registerHandler(new dt.TypeHandlerNumberInteger,dt.TypeHandlerNumberInteger.TYPES.map(v=>Se.namedNode(v)),["number"]),he.registerHandler(new dt.TypeHandlerDate,dt.TypeHandlerDate.TYPES.map(v=>Se.namedNode(v)),["object"]),it.fromRdf=W,it.toRdf=function(v,C){return C&&"namedNode"in C&&(C={dataFactory:C}),(C=C||{})&&!C.dataFactory&&(C.dataFactory=Se),he.toRdf(v,C)},it.getTermRaw=function(v,C){return"Literal"===v.termType?W(v,C):v.value},it.getSupportedRdfDatatypes=function(){return he.getSupportedRdfDatatypes()},it.getSupportedJavaScriptPrimitives=function(){return he.getSupportedJavaScriptPrimitives()}},8871:(Ut,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0})},6060:(Ut,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(ee){throw new Error(`Invalid RDF ${ee.datatype.value} value: '${ee.value}'`)}registerHandler(ee,Dt,dt){for(const Y of Dt)this.supportedRdfDatatypes.push(Y),this.fromRdfHandlers[Y.value]=ee;for(const Y of dt){let Se=this.toRdfHandlers[Y];Se||(this.toRdfHandlers[Y]=Se=[]),Se.push(ee)}}fromRdf(ee,Dt){const dt=this.fromRdfHandlers[ee.datatype.value];return dt?dt.fromRdf(ee,Dt):ee.value}toRdf(ee,Dt){const dt=this.toRdfHandlers[typeof ee];if(dt)for(const Y of dt){const Se=Y.toRdf(ee,Dt);if(Se)return Se}throw new Error(`Invalid JavaScript value: '${ee}'`)}getSupportedRdfDatatypes(){return this.supportedRdfDatatypes}getSupportedJavaScriptPrimitives(){return Object.keys(this.toRdfHandlers)}}},727:(Ut,it,et)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.TypeHandlerBoolean=void 0;const yt=et(6060);class ee{fromRdf(dt,Y){switch(dt.value){case"true":return!0;case"false":return!1;case"1":return!0;case"0":return!1}return Y&&yt.Translator.incorrectRdfDataType(dt),!1}toRdf(dt,{datatype:Y,dataFactory:Se}){return Se.literal(dt?"true":"false",Y||Se.namedNode(ee.TYPE))}}it.TypeHandlerBoolean=ee,ee.TYPE="http://www.w3.org/2001/XMLSchema#boolean"},2525:(Ut,it,et)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.TypeHandlerDate=void 0;const yt=et(6060);class ee{fromRdf(dt,Y){switch(Y&&!dt.value.match(ee.VALIDATORS[dt.datatype.value.substr(33,dt.datatype.value.length)])&&yt.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 Se=dt.value.split("-");return new Date(0,parseInt(Se[0],10)-1,parseInt(Se[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:Y,dataFactory:Se}){if(Y=Y||Se.namedNode(ee.TYPES[0]),!(dt instanceof Date))return null;const he=dt;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 Se.literal(W,Y)}}it.TypeHandlerDate=ee,ee.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"],ee.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]$/}},8554:(Ut,it,et)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.TypeHandlerNumberDouble=void 0;const yt=et(6060);class ee{fromRdf(dt,Y){const Se=parseFloat(dt.value);return Y&&isNaN(Se)&&yt.Translator.incorrectRdfDataType(dt),Se}toRdf(dt,{datatype:Y,dataFactory:Se}){return Y=Y||Se.namedNode(ee.TYPES[0]),isNaN(dt)?Se.literal("NaN",Y):isFinite(dt)?dt%1==0?null:Se.literal(dt.toExponential(15).replace(/(\d)0*e\+?/,"$1E"),Y):Se.literal(dt>0?"INF":"-INF",Y)}}it.TypeHandlerNumberDouble=ee,ee.TYPES=["http://www.w3.org/2001/XMLSchema#double","http://www.w3.org/2001/XMLSchema#decimal","http://www.w3.org/2001/XMLSchema#float"]},7750:(Ut,it,et)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.TypeHandlerNumberInteger=void 0;const yt=et(6060);class ee{fromRdf(dt,Y){const Se=parseInt(dt.value,10);return Y&&(isNaN(Se)||dt.value.indexOf(".")>=0)&&yt.Translator.incorrectRdfDataType(dt),Se}toRdf(dt,{datatype:Y,dataFactory:Se}){return Se.literal(String(dt),Y||Se.namedNode(dt<=ee.MAX_INT&&dt>=ee.MIN_INT?ee.TYPES[0]:ee.TYPES[1]))}}it.TypeHandlerNumberInteger=ee,ee.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"],ee.MAX_INT=2147483647,ee.MIN_INT=-2147483648},4608:(Ut,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.TypeHandlerString=void 0;class et{fromRdf(ee){return ee.value}toRdf(ee,{datatype:Dt,dataFactory:dt}){return dt.literal(ee,Dt)}}it.TypeHandlerString=et,et.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(Ut,it,et){"use strict";var yt=this&&this.__createBinding||(Object.create?function(Dt,dt,Y,Se){void 0===Se&&(Se=Y),Object.defineProperty(Dt,Se,{enumerable:!0,get:function(){return dt[Y]}})}:function(Dt,dt,Y,Se){void 0===Se&&(Se=Y),Dt[Se]=dt[Y]}),ee=this&&this.__exportStar||function(Dt,dt){for(var Y in Dt)"default"!==Y&&!Object.prototype.hasOwnProperty.call(dt,Y)&&yt(dt,Dt,Y)};Object.defineProperty(it,"__esModule",{value:!0}),ee(et(727),it),ee(et(2525),it),ee(et(8554),it),ee(et(7750),it),ee(et(4608),it)},2829:(Ut,it,et)=>{"use strict";var yt={};et.r(yt),et.d(yt,{decode:()=>Ume,encode:()=>zme});var ee={};et.r(ee),et.d(ee,{decode:()=>qme,encode:()=>Yme});var Dt={};et.r(Dt),et.d(Dt,{decode:()=>Xme,encode:()=>Kme});var dt={};function Y(n){return"function"==typeof n}et.r(dt),et.d(dt,{decode:()=>Qme,encode:()=>Zme});let Se=!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 Se&&console.log("RxJS: Back to a better error behavior. Thank you. <3");Se=n},get useDeprecatedSynchronousErrorHandling(){return Se}};function W(n){setTimeout(()=>{throw n},0)}const j={closed:!0,next(n){},error(n){if(he.useDeprecatedSynchronousErrorHandling)throw n;W(n)},complete(){}},k=Array.isArray||(n=>n&&"number"==typeof n.length);function Q(n){return null!==n&&"object"==typeof n}const v=(()=>{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 C{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 C)t.remove(this);else if(null!==t)for(let o=0;oe.concat(t instanceof v?t.errors:t),[])}C.EMPTY=((n=new C).closed=!0,n);const T="function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random();class y extends C{constructor(e,t,i){switch(super(),this.syncErrorValue=null,this.syncErrorThrown=!1,this.syncErrorThrowable=!1,this.isStopped=!1,arguments.length){case 0:this.destination=j;break;case 1:if(!e){this.destination=j;break}if("object"==typeof e){e instanceof y?(this.syncErrorThrowable=e.syncErrorThrowable,this.destination=e,e.add(this)):(this.syncErrorThrowable=!0,this.destination=new S(this,e));break}default:this.syncErrorThrowable=!0,this.destination=new S(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 S 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!==j&&(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 P="function"==typeof Symbol&&Symbol.observable||"@@observable";function X(n){return n}function ue(...n){return I(n)}function I(n){return 0===n.length?X:1===n.length?n[0]:function(t){return n.reduce((i,r)=>r(i),t)}}let O=(()=>{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(j)}(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=K(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)}[P](){return this}pipe(...t){return 0===t.length?this:I(t)(this)}toPromise(t){return new(t=K(t))((i,r)=>{let s;this.subscribe(o=>s=o,o=>r(o),()=>i(s))})}}return n.create=e=>new n(e),n})();function K(n){if(n||(n=he.Promise||Promise),!n)throw new Error("no Promise impl found");return n}const $=(()=>{function n(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return n.prototype=Object.create(Error.prototype),n})();class Z extends C{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 ae extends y{constructor(e){super(e),this.destination=e}}let oe=(()=>{class n extends O{constructor(){super(),this.observers=[],this.closed=!1,this.isStopped=!1,this.hasError=!1,this.thrownError=null}[T](){return new ae(this)}lift(t){const i=new te(this,this);return i.operator=t,i}next(t){if(this.closed)throw new $;if(!this.isStopped){const{observers:i}=this,r=i.length,s=i.slice();for(let o=0;onew te(e,t),n})();class te extends oe{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):C.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 ne(n,e))}}class ne{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 Oe=n=>e=>{for(let t=0,i=n.length;tn&&"number"==typeof n.length&&"function"!=typeof n;function Ke(n){return!!n&&"function"!=typeof n.subscribe&&"function"==typeof n.then}const Me=n=>{if(n&&"function"==typeof n[P])return(n=>e=>{const t=n[P]();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 Oe(n);if(Ke(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[Qe])return(n=>e=>{const t=n[Qe]();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 ${Q(n)?"an invalid object":`'${n}'`} where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.`;throw new TypeError(t)}};function ke(n,e){return new O(t=>{const i=new C;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 je(n,e){return e?function(n,e){if(null!=n){if(function(n){return n&&"function"==typeof n[P]}(n))return function(n,e){return new O(t=>{const i=new C;return i.add(e.schedule(()=>{const r=n[P]();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(Ke(n))return function(n,e){return new O(t=>{const i=new C;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 ke(n,e);if(function(n){return n&&"function"==typeof n[Qe]}(n)||"string"==typeof n)return function(n,e){if(!n)throw new Error("Iterable cannot be null");return new O(t=>{const i=new C;let r;return i.add(()=>{r&&"function"==typeof r.return&&r.return()}),i.add(e.schedule(()=>{r=n[Qe](),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 O?n:new O(Me(n))}class _t 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 we extends y{notifyNext(e){this.destination.next(e)}notifyError(e){this.destination.error(e)}notifyComplete(){this.destination.complete()}}function N(n,e){if(e.closed)return;if(n instanceof O)return n.subscribe(e);let t;try{t=Me(n)(e)}catch(i){e.error(i)}return t}function V(n,e,t=Number.POSITIVE_INFINITY){return"function"==typeof e?i=>i.pipe(V((r,s)=>je(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 Ze(e,this.project,this.concurrent))}}class Ze extends we{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 kt(n=Number.POSITIVE_INFINITY){return V(X,n)}function In(n,e){return e?ke(n,e):new O(Oe(n))}function Nn(...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 O?n[0]:kt(e)(In(n,t))}function Yn(){return function(e){return e.lift(new Mi(e))}}class Mi{constructor(e){this.connectable=e}call(e,t){const{connectable:i}=this;i._refCount++;const r=new xi(e,i),s=t.subscribe(r);return r.closed||(r.connection=i.connect()),s}}class xi 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 Xr extends O{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 C,e.add(this.source.subscribe(new fs(this.getSubject(),this))),e.closed&&(this._connection=null,e=C.EMPTY)),e}refCount(){return Yn()(this)}}const Ls=(()=>{const n=Xr.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 fs extends ae{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()}}}function xa(n,e){return function(i){let r;if(r="function"==typeof n?n:function(){return n},"function"==typeof e)return i.lift(new kl(r,e));const s=Object.create(i,Ls);return s.source=i,s.subjectFactory=r,s}}class kl{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 Sa(){return new oe}function ws(){return n=>Yn()(xa(Sa)(n))}function en(n){for(let e in n)if(n[e]===en)return e;throw Error("Could not find renamed property on target object.")}function nl(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 lt(n,e){return null==n||""===n?null===e?"":e:null==e||""===e?n:n+" "+e}const ht=en({__forward_ref__:en});function ge(n){return n.__forward_ref__=ge,n.toString=function(){return rt(this())},n}function ve(n){return Be(n)?n():n}function Be(n){return"function"==typeof n&&n.hasOwnProperty(ht)&&n.__forward_ref__===ge}class Je extends Error{constructor(e,t){super(function(n,e){return`${n?`NG0${n}: `:""}${e}`}(e,t)),this.code=e}}function Ot(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():Ot(n)}function bn(n,e){const t=e?` in ${e}`:"";throw new Je("201",`No provider for ${Qt(n)} found${t}`)}function J(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 St(n){return{providers:n.providers||[],imports:n.imports||[]}}function vn(n){return Es(n,fo)||Es(n,Vs)}function Es(n,e){return n.hasOwnProperty(e)?n[e]:null}function Fl(n){return n&&(n.hasOwnProperty(Br)||n.hasOwnProperty(Ac))?n[Br]:null}const fo=en({\u0275prov:en}),Br=en({\u0275inj:en}),Vs=en({ngInjectableDef:en}),Ac=en({ngInjectorDef:en});var xn=(()=>((xn=xn||{})[xn.Default=0]="Default",xn[xn.Host=1]="Host",xn[xn.Self=2]="Self",xn[xn.SkipSelf=4]="SkipSelf",xn[xn.Optional=8]="Optional",xn))();let po;function Ta(n){const e=po;return po=n,e}function Ed(n,e,t){const i=vn(n);return i&&"root"==i.providedIn?void 0===i.value?i.value=i.factory():i.value:t&xn.Optional?null:void 0!==e?e:void bn(rt(n),"Injector")}function De(n){return{toString:n}.toString()}var Ge=(()=>((Ge=Ge||{})[Ge.OnPush=0]="OnPush",Ge[Ge.Default=1]="Default",Ge))(),Xt=(()=>((Xt=Xt||{})[Xt.Emulated=0]="Emulated",Xt[Xt.None=2]="None",Xt[Xt.ShadowDom=3]="ShadowDom",Xt))();const ui="undefined"!=typeof globalThis&&globalThis,Vr="undefined"!=typeof window&&window,Jr="undefined"!=typeof self&&"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&self,xs="undefined"!=typeof global&&global,Zn=ui||xs||Vr||Jr,xd={},er=[],fp=en({\u0275cmp:en}),n_=en({\u0275dir:en}),Oh=en({\u0275pipe:en}),iv=en({\u0275mod:en}),T1=en({\u0275loc:en}),Bl=en({\u0275fac:en}),Rh=en({__NG_ELEMENT_ID__:en});let A1=0;function rn(n){return De(()=>{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===Ge.OnPush,directiveDefs:null,pipeDefs:null,selectors:n.selectors||er,viewQuery:n.viewQuery||null,features:n.features||null,data:n.data||{},encapsulation:n.encapsulation||Xt.Emulated,id:"c",styles:n.styles||er,_:null,setInput:null,schemas:n.schemas||null,tView:null},r=n.directives,s=n.features,o=n.pipes;return i.id+=A1++,i.inputs=av(n.inputs,t),i.outputs=av(n.outputs),s&&s.forEach(a=>a(i)),i.directiveDefs=r?()=>("function"==typeof r?r():r).map(rv):null,i.pipeDefs=o?()=>("function"==typeof o?o():o).map(sv):null,i})}function rv(n){return Ui(n)||function(n){return n[n_]||null}(n)}function sv(n){return function(n){return n[Oh]||null}(n)}const ov={};function tn(n){return De(()=>{const e={type:n.type,bootstrap:n.bootstrap||er,declarations:n.declarations||er,imports:n.imports||er,exports:n.exports||er,transitiveCompileScopes:null,schemas:n.schemas||null,id:n.id||null};return null!=n.id&&(ov[n.id]=n.type),e})}function av(n,e){if(null==n)return xd;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 Nt=rn;function js(n){return{type:n.type,name:n.name,factory:null,pure:!1!==n.pure,onDestroy:n.type.prototype.ngOnDestroy||null}}function Ui(n){return n[fp]||null}function No(n,e){const t=n[iv]||null;if(!t&&!0===e)throw new Error(`Type ${rt(n)} does not have '\u0275mod' property.`);return t}function Jo(n){return Array.isArray(n)&&"object"==typeof n[1]}function ea(n){return Array.isArray(n)&&!0===n[1]}function s_(n){return 0!=(8&n.flags)}function Ad(n){return 2==(2&n.flags)}function Md(n){return 1==(1&n.flags)}function Da(n){return null!==n.template}function lv(n){return 0!=(512&n[2])}function Ic(n,e){return n.hasOwnProperty(Bl)?n[Bl]:null}class c_{constructor(e,t,i){this.previousValue=e,this.currentValue=t,this.firstChange=i}isFirstChange(){return this.firstChange}}function Fi(){return dv}function dv(n){return n.type.prototype.ngOnChanges&&(n.setInput=k1),N1}function N1(){const n=at(this),e=null==n?void 0:n.current;if(e){const t=n.previous;if(t===xd)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=at(n)||function(n,e){return n[Bh]=e}(n,{previous:xd,current:null}),s=r.current||(r.current={}),o=r.previous,a=this.declaredInputs[t],l=o[a];s[a]=new c_(l&&l.currentValue,e,o===xd),n[i]=e}Fi.ngInherit=!0;const Bh="__ngSimpleChanges__";function at(n){return n[Bh]||null}let Yi;function dr(n){return!!n.listen}const Su={createRenderer:(n,e)=>void 0!==Yi?Yi:"undefined"!=typeof document?document:void 0};function Sr(n){for(;Array.isArray(n);)n=n[0];return n}function Vh(n,e){return Sr(e[n])}function eo(n,e){return Sr(e[n.index])}function h_(n,e){return n.data[e]}function Dd(n,e){return n[e]}function zs(n,e){const t=e[n];return Jo(t)?t:t[0]}function Ul(n){return 4==(4&n[2])}function Id(n){return 128==(128&n[2])}function Oa(n,e){return null==e?null:n[e]}function f_(n){n[18]=0}function mp(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:Tu(null),bindingsEnabled:!0,isInCheckNoChangesMode:!1};function fv(){return Ln.bindingsEnabled}function Vt(){return Ln.lFrame.lView}function Si(){return Ln.lFrame.tView}function _r(n){return Ln.lFrame.contextLView=n,n[8]}function as(){let n=p_();for(;null!==n&&64===n.type;)n=n.parent;return n}function p_(){return Ln.lFrame.currentTNode}function sl(n,e){const t=Ln.lFrame;t.currentTNode=n,t.isParent=e}function zr(){return Ln.lFrame.isParent}function ps(){Ln.lFrame.isParent=!1}function zh(){return Ln.isInCheckNoChangesMode}function yp(n){Ln.isInCheckNoChangesMode=n}function Cs(){const n=Ln.lFrame;let e=n.bindingRootIndex;return-1===e&&(e=n.bindingRootIndex=n.tView.bindingStartIndex),e}function Ra(){return Ln.lFrame.bindingIndex++}function Fo(n){const e=Ln.lFrame,t=e.bindingIndex;return e.bindingIndex=e.bindingIndex+n,t}function Od(n,e){const t=Ln.lFrame;t.bindingIndex=t.bindingRootIndex=n,g_(e)}function g_(n){Ln.lFrame.currentDirectiveIndex=n}function m_(n){const e=Ln.lFrame.currentDirectiveIndex;return-1===e?null:n[e]}function pv(){return Ln.lFrame.currentQueryIndex}function __(n){Ln.lFrame.currentQueryIndex=n}function vp(n){const e=n[1];return 2===e.type?e.declTNode:1===e.type?n[6]:null}function Rd(n,e,t){if(t&xn.SkipSelf){let r=e,s=n;for(;!(r=r.parent,null!==r||t&xn.Host||(r=vp(s),null===r||(s=s[15],10&r.type))););if(null===r)return!1;e=r,n=s}const i=Ln.lFrame=xe();return i.currentTNode=e,i.lView=n,!0}function $h(n){const e=xe(),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 xe(){const n=Ln.lFrame,e=null===n?null:n.child;return null===e?Tu(n):e}function Tu(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 Wh(){const n=Ln.lFrame;return Ln.lFrame=n.parent,n.currentTNode=null,n.lView=null,n}const Lo=Wh;function fi(){const n=Wh();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 to(){return Ln.lFrame.selectedIndex}function _o(n){Ln.lFrame.selectedIndex=n}function Nr(){const n=Ln.lFrame;return h_(n.tView,n.selectedIndex)}function wp(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 qh{constructor(e,t,i){this.factory=e,this.resolving=!1,this.canSeeViewProviders=t,this.injectImpl=i}}function Sp(n,e,t){const i=dr(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 Nd=!0;function Cp(n){const e=Nd;return Nd=n,e}let x_=0;function Hs(n,e){const t=Tp(n,e);if(-1!==t)return t;const i=e[1];i.firstCreatePass&&(n.injectorIndex=e.length,S_(i.data,n),S_(e,null),S_(i.blueprint,null));const r=Xh(n,e),s=n.injectorIndex;if(yv(r)){const o=Pd(r),a=al(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 S_(n,e){n.push(0,0,0,0,0,0,0,0,e)}function Tp(n,e){return-1===n.injectorIndex||n.parent&&n.parent.injectorIndex===n.injectorIndex||null===e[n.injectorIndex+8]?-1:n.injectorIndex}function Xh(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 Rc(n,e,t){!function(n,e,t){let i;"string"==typeof t?i=t.charCodeAt(0)||0:t.hasOwnProperty(Rh)&&(i=t[Rh]),null==i&&(i=t[Rh]=x_++);const r=255&i;e.data[n+(r>>5)]|=1<=0?255&e:Ev:e}(t);if("function"==typeof s){if(!Rd(e,n,i))return i&xn.Host?C_(r,t,i):vv(e,t,i,r);try{const o=s(i);if(null!=o||i&xn.Optional)return o;bn(t)}finally{Lo()}}else if("number"==typeof s){let o=null,a=Tp(n,e),l=-1,c=i&xn.Host?e[16][6]:null;for((-1===a||i&xn.SkipSelf)&&(l=-1===a?Xh(n,e):e[a+8],-1!==l&&Qh(i,!1)?(o=e[1],a=Pd(l),e=al(l,e)):a=-1);-1!==a;){const u=e[1];if(Ap(s,a,u.data)){const h=Ts(a,e,t,o,i,c);if(h!==wv)return h}l=e[a+8],-1!==l&&Qh(i,e[1].data[a+8]===c)&&Ap(s,a,e)?(o=u,a=Pd(l),e=al(l,e)):a=-1}}}return vv(e,t,i,r)}const wv={};function Ev(){return new na(as(),Vt())}function Ts(n,e,t,i,r,s){const o=e[1],a=o.data[n+8],u=kd(a,o,t,null==i?Ad(a)&&Nd:i!=o&&0!=(3&a.type),r&xn.Host&&s===a);return null!==u?Fd(e,o,u,a):wv}function kd(n,e,t,i,r){const s=n.providerIndexes,o=e.data,a=1048575&s,l=n.directiveStart,u=s>>20,f=r?a+u:n.directiveEnd;for(let g=i?a:a+u;g=l&&m.type===t)return g}if(r){const g=o[l];if(g&&Da(g)&&g.type===t)return l}return null}function Fd(n,e,t,i){let r=n[t];const s=e.data;if(function(n){return n instanceof qh}(r)){const o=r;o.resolving&&function(n,e){throw new Je("200",`Circular dependency in DI detected for ${n}`)}(Qt(s[t]));const a=Cp(o.canSeeViewProviders);o.resolving=!0;const l=o.injectImpl?Ta(o.injectImpl):null;Rd(n,i,xn.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=dv(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&&Ta(l),Cp(a),o.resolving=!1,Lo()}}return r}function Ap(n,e,t){return!!(t[e+(n>>5)]&1<{const e=n.prototype.constructor,t=e[Bl]||As(e),i=Object.prototype;let r=Object.getPrototypeOf(n.prototype).constructor;for(;r&&r!==i;){const s=r[Bl]||As(r);if(s&&s!==t)return s;r=Object.getPrototypeOf(r)}return s=>new s})}function As(n){return Be(n)?()=>{const e=As(ve(n));return e&&e()}:Ic(n)}function yo(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{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,u){const h=l.hasOwnProperty(Bd)?l[Bd]:Object.defineProperty(l,Bd,{value:[]})[Bd];for(;h.length<=u;)h.push(null);return(h[u]=h[u]||[]).push(o),l}}return t&&(r.prototype=Object.create(t.prototype)),r.prototype.ngMetadataName=n,r.annotationCls=r,r})}class Ht{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}`}}const Du=Function;function ia(n,e){void 0===e&&(e=n);for(let t=0;tArray.isArray(t)?ra(t,e):e(t))}function Jh(n,e,t){e>=n.length?n.push(t):n.splice(e,0,t)}function Hl(n,e){return e>=n.length-1?n.pop():n.splice(e,1)[0]}function Nc(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 O_(n,e){const t=Ms(n,e);if(t>=0)return n[1|t]}function Ms(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(Lc,"\n ")}`}("\n"+n.message,r,t,i),n.ngTokenPath=r,n[Fc]=null,n}const Hd=zd(ka("Inject",n=>({token:n})),-1),ts=zd(ka("Optional"),8),dl=zd(ka("SkipSelf"),4);let $d;function Fu(n){var e;return(null===(e=function(){if(void 0===$d&&($d=null,Zn.trustedTypes))try{$d=Zn.trustedTypes.createPolicy("angular",{createHTML:n=>n,createScript:n=>n,createScriptURL:n=>n})}catch(n){}return $d}())||void 0===e?void 0:e.createHTML(n))||n}class ql{constructor(e){this.changingThisBreaksApplicationSecurity=e}toString(){return`SafeValue must use [property]=binding: ${this.changingThisBreaksApplicationSecurity} (see https://g.co/ng/security#xss)`}}class L_ extends ql{getTypeName(){return"HTML"}}class B_ extends ql{getTypeName(){return"Style"}}class jp extends ql{getTypeName(){return"Script"}}class Wd extends ql{getTypeName(){return"URL"}}class kn extends ql{getTypeName(){return"ResourceURL"}}function Gs(n){return n instanceof ql?n.changingThisBreaksApplicationSecurity:n}function sa(n,e){const t=jc(n);if(null!=t&&t!==e){if("ResourceURL"===t&&"URL"===e)return!0;throw new Error(`Required a safe ${e}, got a ${t} (see https://g.co/ng/security#xss)`)}return t===e}function jc(n){return n instanceof ql&&n.getTypeName()||null}class jv{constructor(e){this.inertDocumentHelper=e}getInertBodyElement(e){e=""+e;try{const t=(new window.DOMParser).parseFromString(Fu(e),"text/html").body;return null===t?this.inertDocumentHelper.getInertBodyElement(e):(t.removeChild(t.firstChild),t)}catch(t){return null}}}class fT{constructor(e){if(this.defaultDoc=e,this.inertDocument=this.defaultDoc.implementation.createHTMLDocument("sanitization-inert"),null==this.inertDocument.body){const t=this.inertDocument.createElement("html");this.inertDocument.appendChild(t);const i=this.inertDocument.createElement("body");t.appendChild(i)}}getInertBodyElement(e){const t=this.inertDocument.createElement("template");if("content"in t)return t.innerHTML=Fu(e),t;const i=this.inertDocument.createElement("body");return i.innerHTML=Fu(e),this.defaultDoc.documentMode&&this.stripCustomNsAttrs(i),i}stripCustomNsAttrs(e){const t=e.attributes;for(let r=t.length-1;0jo(e.trim())).join(", ")}function oa(n){const e={};for(const t of n.split(","))e[t]=!0;return e}function tf(...n){const e={};for(const t of n)for(const i in t)t.hasOwnProperty(i)&&(e[i]=!0);return e}const Up=oa("area,br,col,hr,img,wbr"),zv=oa("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr"),Hv=oa("rp,rt"),j_=tf(Up,tf(zv,oa("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")),tf(Hv,oa("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")),tf(Hv,zv)),U_=oa("background,cite,href,itemtype,longdesc,poster,src,xlink:href"),z_=oa("srcset"),H_=tf(U_,z_,oa("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"),oa("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")),bT=oa("script,style,template");class G_{constructor(){this.sanitizedSomething=!1,this.buf=[]}sanitizeChildren(e){let t=e.firstChild,i=!0;for(;t;)if(t.nodeType===Node.ELEMENT_NODE?i=this.startElement(t):t.nodeType===Node.TEXT_NODE?this.chars(t.nodeValue):this.sanitizedSomething=!0,i&&t.firstChild)t=t.firstChild;else for(;t;){t.nodeType===Node.ELEMENT_NODE&&this.endElement(t);let r=this.checkClobberedElement(t,t.nextSibling);if(r){t=r;break}t=this.checkClobberedElement(t,t.parentNode)}return this.buf.join("")}startElement(e){const t=e.nodeName.toLowerCase();if(!j_.hasOwnProperty(t))return this.sanitizedSomething=!0,!bT.hasOwnProperty(t);this.buf.push("<"),this.buf.push(t);const i=e.attributes;for(let r=0;r"),!0}endElement(e){const t=e.nodeName.toLowerCase();j_.hasOwnProperty(t)&&!Up.hasOwnProperty(t)&&(this.buf.push(""))}chars(e){this.buf.push(Hp(e))}checkClobberedElement(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: ${e.outerHTML}`);return t}}const Gv=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,nf=/([^\#-~ |!])/g;function Hp(n){return n.replace(/&/g,"&").replace(Gv,function(e){return"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";"}).replace(nf,function(e){return"&#"+e.charCodeAt(0)+";"}).replace(//g,">")}let rf;function $_(n,e){let t=null;try{rf=rf||function(n){const e=new fT(n);return function(){try{return!!(new window.DOMParser).parseFromString(Fu(""),"text/html")}catch(n){return!1}}()?new jv(e):e}(n);let i=e?String(e):"";t=rf.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=t.innerHTML,t=rf.getInertBodyElement(i)}while(i!==s);return Fu((new G_).sanitizeChildren(qd(t)||t))}finally{if(t){const i=qd(t)||t;for(;i.firstChild;)i.removeChild(i.firstChild)}}}function qd(n){return"content"in n&&function(n){return n.nodeType===Node.ELEMENT_NODE&&"TEMPLATE"===n.nodeName}(n)?n.content:null}var si=(()=>((si=si||{})[si.NONE=0]="NONE",si[si.HTML=1]="HTML",si[si.STYLE=2]="STYLE",si[si.SCRIPT=3]="SCRIPT",si[si.URL=4]="URL",si[si.RESOURCE_URL=5]="RESOURCE_URL",si))();function sf(n){const e=function(){const n=Vt();return n&&n[12]}();return e?e.sanitize(si.URL,n)||"":sa(n,"URL")?Gs(n):jo(Ot(n))}const Y_="__ngContext__";function Ds(n,e){n[Y_]=e}function X_(n){const e=function(n){return n[Y_]||null}(n);return e?Array.isArray(e)?e:e.lView:null}function Gp(n){return n.ngOriginalError}function RT(n,...e){n.error(...e)}class la{constructor(){this._console=console}handleError(e){const t=this._findOriginalError(e),i=this._findContext(e),r=function(n){return n&&n.ngErrorLogger||RT}(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(Gp(e)):null}_findOriginalError(e){let t=e&&Gp(e);for(;t&&Gp(t);)t=Gp(t);return t||null}}const tw=(()=>("undefined"!=typeof requestAnimationFrame&&requestAnimationFrame||setTimeout).bind(Zn))();function fl(n){return n instanceof Function?n():n}var Uo=(()=>((Uo=Uo||{})[Uo.Important=1]="Important",Uo[Uo.DashCase=2]="DashCase",Uo))();function ey(n,e){return undefined(n,e)}function lf(n){const e=n[3];return ea(e)?e[3]:e}function Xd(n){return ow(n[13])}function ny(n){return ow(n[4])}function ow(n){for(;null!==n&&!ea(n);)n=n[4];return n}function Kd(n,e,t,i,r){if(null!=i){let s,o=!1;ea(i)?s=i:Jo(i)&&(o=!0,i=i[0]);const a=Sr(i);0===n&&null!==t?null==r?dw(e,t,a):pl(e,t,a,r||null,!0):1===n&&null!==t?pl(e,t,a,r||null,!0):2===n?function(n,e,t){const i=qp(n,e);i&&function(n,e,t,i){dr(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!==Sr(t)&&Kd(e,n,i,s,r);for(let a=10;a0&&(n[t-1][4]=i[4]);const s=Hl(n,10+e);!function(n,e){Qd(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 oy(n,e){if(!(256&e[2])){const t=e[11];dr(t)&&t.destroyNode&&Qd(n,e,t,3,null,null),function(n){let e=n[13];if(!e)return Wp(n[1],n);for(;e;){let t=null;if(Jo(e))t=e[13];else{const i=e[10];i&&(t=i)}if(!t){for(;e&&!e[4]&&e!==n;)Jo(e)&&Wp(e[1],e),e=e[3];null===e&&(e=n),Jo(e)&&Wp(e[1],e),t=e&&e[4]}e=t}}(e)}}function Wp(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[h+1].toLowerCase();const g=8&i?f:null;if(g&&-1!==uf(g,c,0)||2&i&&c!==f){if(La(i))return!1;o=!0}}}}else{if(!o&&!La(i)&&!La(l))return!1;if(o&&La(l))continue;o=!1,i=l|1&i}}return La(i)||o}function La(n){return 0==(1&n)}function oA(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&&!La(o)&&(e+=Sw(s,r),r=""),i=o,s=s||!La(i);t++}return""!==r&&(e+=Sw(s,r)),e}const Dn={};function zt(n){Cw(Si(),Vt(),to()+n,zh())}function Cw(n,e,t,i){if(!i)if(3==(3&e[2])){const s=n.preOrderCheckHooks;null!==s&&Ep(e,s,t)}else{const s=n.preOrderHooks;null!==s&&xp(e,s,0,t)}_o(t)}function gl(n,e){return n<<17|e<<2}function On(n){return n>>17&32767}function Cr(n){return 2|n}function Yl(n){return(131068&n)>>2}function ml(n,e){return-131069&n|e<<2}function hy(n){return 1|n}function Nw(n,e){const t=n.contentQueries;if(null!==t)for(let i=0;i20&&Cw(n,e,20,zh()),t(i,r)}finally{_o(s)}}function pf(n,e,t){!fv()||(function(n,e,t,i){const r=t.directiveStart,s=t.directiveEnd;n.firstCreatePass||Hs(t,e),Ds(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 $w(n,e){null!==n.hostBindings&&n.hostBindings(1,e)}function Ww(n,e){e.flags|=2,(n.components||(n.components=[])).push(e.index)}function NA(n,e,t){if(t){if(e.exportAs)for(let i=0;i0&&Sy(t)}}function Sy(n){for(let i=Xd(n);null!==i;i=ny(i))for(let r=10;r0&&Sy(s)}const t=n[1].components;if(null!==t)for(let i=0;i0&&Sy(r)}}function UA(n,e){const t=zs(e,n),i=t[1];(function(n,e){for(let t=e.length;tPromise.resolve(null))();function Xw(n){return n[7]||(n[7]=[])}function ig(n){return n.cleanup||(n.cleanup=[])}function Dy(n,e,t){return(null===n||Da(n))&&(t=function(n){for(;Array.isArray(n);){if("object"==typeof n[1])return n;n=n[0]}return null}(t[e.index])),t[11]}function Iy(n,e){const t=n[9],i=t?t.get(la,null):null;i&&i.handleError(e)}function Kw(n,e,t,i,r){for(let s=0;sthis.processProvider(a,e,t)),ra([e],a=>this.processInjectorType(a,[],s)),this.records.set(Vu,Uu(void 0,this));const o=this.records.get(ju);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=Ru,i=xn.Default){this.assertNotDestroyed();const r=Ud(this),s=Ta(void 0);try{if(!(i&xn.SkipSelf)){let a=this.records.get(e);if(void 0===a){const l=function(n){return"function"==typeof n||"object"==typeof n&&n instanceof Ht}(e)&&vn(e);a=l&&this.injectableDefInScope(l)?Uu(ky(e),gf):null,this.records.set(e,a)}if(null!=a)return this.hydrate(e,a)}return(i&xn.Self?Qw():this.parent).get(e,t=i&xn.Optional&&t===Ru?null:t)}catch(o){if("NullInjectorError"===o.name){if((o[Fc]=o[Fc]||[]).unshift(rt(e)),r)throw o;return no(o,e,"R3InjectorError",this.source)}throw o}finally{Ta(s),Ud(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=Fl(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=Fl(s)),null==r)return!1;if(null!=r.imports&&!a){let u;i.push(o);try{ra(r.imports,h=>{this.processInjectorType(h,t,i)&&(void 0===u&&(u=[]),u.push(h))})}finally{}if(void 0!==u)for(let h=0;hthis.processProvider(m,f,g||er))}}this.injectorDefTypes.add(o);const l=Ic(o)||(()=>new o);this.records.set(o,Uu(l,gf));const c=r.providers;if(null!=c&&!a){const u=e;ra(c,h=>this.processProvider(h,u,c))}return void 0!==s&&void 0!==e.providers}processProvider(e,t,i){let r=Hc(e=ve(e))?e:ve(e&&e.provide);const s=function(n,e,t){return eE(n)?Uu(void 0,n.useValue):Uu(Jw(n),gf)}(e);if(Hc(e)||!0!==e.multi)this.records.get(r);else{let o=this.records.get(r);o||(o=Uu(void 0,gf,!0),o.factory=()=>Nu(o.multi),this.records.set(r,o)),r=e,o.multi.push(e)}this.records.set(r,s)}hydrate(e,t){return t.value===gf&&(t.value=YA,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 ky(n){const e=vn(n),t=null!==e?e.factory:Ic(n);if(null!==t)return t;if(n instanceof Ht)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=Nc(e,"?");throw new Error(`Can't resolve all parameters for ${rt(n)}: (${i.join(", ")}).`)}const t=function(n){const e=n&&(n[fo]||n[Vs]);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 Jw(n,e,t){let i;if(Hc(n)){const r=ve(n);return Ic(r)||ky(r)}if(eE(n))i=()=>ve(n.useValue);else if(function(n){return!(!n||!n.useFactory)}(n))i=()=>n.useFactory(...Nu(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 Ic(r)||ky(r);i=()=>new r(...Nu(n.deps))}return i}function Uu(n,e,t=!1){return{factory:n,value:e,multi:t?[]:void 0}}function eE(n){return null!==n&&"object"==typeof n&&Pp in n}function Hc(n){return"function"==typeof n}const tE=function(n,e,t){return function(n,e=null,t=null,i){const r=Zw(n,e,t,i);return r._resolveInjectorDefTypes(),r}({name:t},e,n,t)};class Hn{static create(e,t){return Array.isArray(e)?tE(e,t,""):tE(e.providers,e.parent,e.name||"")}}function Fq(n,e){wp(X_(n)[1],as())}function En(n){let e=function(n){return Object.getPrototypeOf(n.prototype).constructor}(n.type),t=!0;const i=[n];for(;e;){let r;if(Da(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=lM(n.inputs),o.declaredInputs=lM(n.declaredInputs),o.outputs=lM(n.outputs);const a=r.hostBindings;a&&jq(n,a);const l=r.viewQuery,c=r.contentQueries;if(l&&Bq(n,l),c&&Vq(n,c),nl(n.inputs,r.inputs),nl(n.declaredInputs,r.declaredInputs),nl(n.outputs,r.outputs),Da(r)&&r.data.animation){const u=n.data;u.animation=(u.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=Yh(r.hostAttrs,t=Yh(t,r.hostAttrs))}}(i)}function lM(n){return n===xd?{}:n===er?[]:n}function Bq(n,e){const t=n.viewQuery;n.viewQuery=t?(i,r)=>{e(i,r),t(i,r)}:e}function Vq(n,e){const t=n.contentQueries;n.contentQueries=t?(i,r,s)=>{e(i,r,s),t(i,r,s)}:e}function jq(n,e){const t=n.hostBindings;n.hostBindings=t?(i,r)=>{e(i,r),t(i,r)}:e}Hn.THROW_IF_NOT_FOUND=Ru,Hn.NULL=new so,Hn.\u0275prov=We({token:Hn,providedIn:"any",factory:()=>Ie(Vu)}),Hn.__NG_ELEMENT_ID__=-1;let oE=null;function sg(){if(!oE){const n=Zn.Symbol;if(n&&n.iterator)oE=n.iterator;else{const e=Object.getOwnPropertyNames(Map.prototype);for(let t=0;ta(Sr(_e[i.index])):i.index;if(dr(t)){let _e=null;if(!a&&l&&(_e=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!==_e)(_e.__ngLastListenerFn__||_e).__ngNextListenerFn__=s,_e.__ngLastListenerFn__=s,g=!1;else{s=gM(i,e,h,s,!1);const Pe=t.listen(U,r,s);f.push(s,Pe),u&&u.push(r,ie,D,D+1)}}else s=gM(i,e,h,s,!0),U.addEventListener(r,s,o),f.push(s),u&&u.push(r,ie,D,o)}else s=gM(i,e,h,s,!1);const m=i.outputs;let w;if(g&&null!==m&&(w=m[r])){const x=w.length;if(x)for(let U=0;U0;)e=e[15],n--;return e}(n,Ln.lFrame.contextLView))[8]}(n)}function vY(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 Os={textEnd:0,key:0,keyEnd:0,value:0,valueEnd:0};function k2(n){return n.substring(Os.key,Os.keyEnd)}function F2(n,e){const t=Os.textEnd;return t===e?-1:(e=Os.keyEnd=function(n,e,t){for(;e32;)e++;return e}(n,Os.key=e,t),bg(n,e,t))}function bg(n,e,t){for(;e=0;t=F2(e,t))Bo(n,k2(e),!0)}function Jl(n,e,t,i){const r=Vt(),s=Si(),o=Fo(2);s.firstUpdatePass&&z2(s,n,o,i),e!==Dn&&Eo(r,o,e)&&G2(s,s.data[to()],r,r[11],n,r[o+1]=function(n,e){return null==n||("string"==typeof e?n+=e:"object"==typeof n&&(n=rt(Gs(n)))),n}(e,t),i,o)}function U2(n,e){return e>=n.expandoStartIndex}function z2(n,e,t,i){const r=n.data;if(null===r[t+1]){const s=r[to()],o=U2(n,t);W2(s,i)&&null===e&&!o&&(e=!1),e=function(n,e,t,i){const r=m_(n);let s=i?e.residualClasses:e.residualStyles;if(null===r)0===(i?e.classBindings:e.styleBindings)&&(t=Hy(t=_M(null,n,e,t,i),e.attrs,i),s=null);else{const o=e.directiveStylingLast;if(-1===o||n[o]!==r)if(t=_M(r,n,e,t,i),null===s){let l=function(n,e,t){const i=t?e.classBindings:e.styleBindings;if(0!==Yl(i))return n[On(i)]}(n,e,i);void 0!==l&&Array.isArray(l)&&(l=_M(null,n,e,l[1],i),l=Hy(l,e.attrs,i),function(n,e,t,i){n[On(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 u=t;if(r)if(0!==l){const f=On(n[a+1]);n[i+1]=gl(f,a),0!==f&&(n[f+1]=ml(n[f+1],i)),n[a+1]=function(n,e){return 131071&n|e<<17}(n[a+1],i)}else n[i+1]=gl(a,0),0!==a&&(n[a+1]=ml(n[a+1],i)),a=i;else n[i+1]=gl(l,0),0===a?a=i:n[l+1]=ml(n[l+1],i),l=i;c&&(n[i+1]=Cr(n[i+1])),N2(n,u,i,!0),N2(n,u,i,!1),function(n,e,t,i,r){const s=r?n.residualClasses:n.residualStyles;null!=s&&"string"==typeof e&&Ms(s,e)>=0&&(t[i+1]=hy(t[i+1]))}(e,u,n,i,s),o=gl(a,l),s?e.classBindings=o:e.styleBindings=o}(r,s,e,t,o,i)}}function _M(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),u=c?l[1]:l,h=null===u;let f=t[r+1];f===Dn&&(f=h?er:void 0);let g=h?O_(f,i):u===i?f:void 0;if(c&&!hE(g)&&(g=O_(l,i)),hE(g)&&(a=g,o))return a;const m=n[r+1];r=o?On(m):Yl(m)}if(null!==e){let l=s?e.residualClasses:e.residualStyles;null!=l&&(a=O_(l,i))}return a}function hE(n){return void 0!==n}function W2(n,e){return 0!=(n.flags&(e?16:32))}function Jn(n,e=""){const t=Vt(),i=Si(),r=n+20,s=i.firstCreatePass?Jd(i,r,1,e,null):i.data[r],o=t[r]=function(n,e){return dr(n)?n.createText(e):n.createTextNode(e)}(t[11],e);Yp(i,t,o,s),sl(s,!1)}function gs(n){return xo("",n,""),gs}function xo(n,e,t){const i=Vt(),r=ag(i,n,e,t);return r!==Dn&&Xl(i,to(),r),xo}function qc(n,e,t){const i=Vt();return Eo(i,Ra(),e)&&zo(Si(),Nr(),i,n,e,i[11],t,!0),qc}function fE(n,e,t){const i=Vt();if(Eo(i,Ra(),e)){const s=Si(),o=Nr();zo(s,o,i,n,e,Dy(m_(s.data),o,i),t,!0)}return fE}const _f=void 0;var iX=["en",[["a","p"],["AM","PM"],_f],[["AM","PM"],_f,_f],[["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"]],_f,[["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"]],_f,[["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}",_f,"{1} 'at' {0}",_f],[".",",",";","%","+","-","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 vg={};function uL(n){return n in vg||(vg[n]=Zn.ng&&Zn.ng.common&&Zn.ng.common.locales&&Zn.ng.common.locales[n]),vg[n]}var un=(()=>((un=un||{})[un.LocaleId=0]="LocaleId",un[un.DayPeriodsFormat=1]="DayPeriodsFormat",un[un.DayPeriodsStandalone=2]="DayPeriodsStandalone",un[un.DaysFormat=3]="DaysFormat",un[un.DaysStandalone=4]="DaysStandalone",un[un.MonthsFormat=5]="MonthsFormat",un[un.MonthsStandalone=6]="MonthsStandalone",un[un.Eras=7]="Eras",un[un.FirstDayOfWeek=8]="FirstDayOfWeek",un[un.WeekendRange=9]="WeekendRange",un[un.DateFormat=10]="DateFormat",un[un.TimeFormat=11]="TimeFormat",un[un.DateTimeFormat=12]="DateTimeFormat",un[un.NumberSymbols=13]="NumberSymbols",un[un.NumberFormats=14]="NumberFormats",un[un.CurrencyCode=15]="CurrencyCode",un[un.CurrencySymbol=16]="CurrencySymbol",un[un.CurrencyName=17]="CurrencyName",un[un.Currencies=18]="Currencies",un[un.Directionality=19]="Directionality",un[un.PluralCase=20]="PluralCase",un[un.ExtraData=21]="ExtraData",un))();const pE="en-US";let dL=pE;function bM(n){J(n,"Expected localeId to be defined"),"string"==typeof n&&(dL=n.toLowerCase().replace(/_/g,"-"))}function EM(n,e,t,i,r){if(n=ve(n),Array.isArray(n))for(let s=0;s>20;if(Hc(n)||!n.multi){const g=new qh(l,r,Ce),m=SM(a,e,r?u:u+f,h);-1===m?(Rc(Hs(c,o),s,a),xM(s,n,e.length),e.push(a),c.directiveStart++,c.directiveEnd++,r&&(c.providerIndexes+=1048576),t.push(g),o.push(g)):(t[m]=g,o[m]=g)}else{const g=SM(a,e,u+f,h),m=SM(a,e,u,u+f),w=g>=0&&t[g],x=m>=0&&t[m];if(r&&!x||!r&&!w){Rc(Hs(c,o),s,a);const U=function(n,e,t,i,r){const s=new qh(n,t,Ce);return s.multi=[],s.index=e,s.componentProviders=0,kL(s,r,i&&!t),s}(r?eK:JX,t.length,r,i,l);!r&&x&&(t[m].providerFactory=U),xM(s,n,e.length,0),e.push(a),c.directiveStart++,c.directiveEnd++,r&&(c.providerIndexes+=1048576),t.push(U),o.push(U)}else xM(s,n,g>-1?g:m,kL(t[r?m:g],l,!r&&i));!r&&i&&x&&t[m].componentProviders++}}}function xM(n,e,t,i){const r=Hc(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 kL(n,e,t){return t&&n.componentProviders++,n.multi.push(e)-1}function SM(n,e,t,i){for(let r=t;r{t.providersResolver=(i,r)=>function(n,e,t){const i=Si();if(i.firstCreatePass){const r=Da(n);EM(t,i.data,i.blueprint,r,!0),EM(e,i.data,i.blueprint,r,!1)}}(i,r?r(n):n,e)}}class FL{}const BL="ngComponent";class iK{resolveComponentFactory(e){throw function(n){const e=Error(`No component factory found for ${rt(n)}. Did you add it to @NgModule.entryComponents?`);return e[BL]=n,e}(e)}}class El{}function bE(...n){}function Eg(n,e){return new gn(eo(n,e))}El.NULL=new iK;const oK=function(){return Eg(as(),Vt())};let gn=(()=>{class n{constructor(t){this.nativeElement=t}}return n.__NG_ELEMENT_ID__=oK,n})();function VL(n){return n instanceof gn?n.nativeElement:n}class yf{}let AM=(()=>{class n{}return n.\u0275prov=We({token:n,providedIn:"root",factory:()=>null}),n})();class Hu{constructor(e){this.full=e,this.major=e.split(".")[0],this.minor=e.split(".")[1],this.patch=e.split(".").slice(2).join(".")}}const jL=new Hu("12.2.5");class UL{constructor(){}supports(e){return jy(e)}create(e){return new hK(e)}}const dK=(n,e)=>e;class hK{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||dK}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 fK(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 zL),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 zL),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 fK{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 pK{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 zL{constructor(){this.map=new Map}put(e){const t=e.trackById;let i=this.map.get(t);i||(i=new pK,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 HL(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 mK(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 mK{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 $L(){return new xg([new UL])}let xg=(()=>{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||$L()),deps:[[n,new dl,new ts]]}}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:$L}),n})();function WL(){return new Sg([new GL])}let Sg=(()=>{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||WL()),deps:[[n,new dl,new ts]]}}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:WL}),n})();function vE(n,e,t,i,r=!1){for(;null!==t;){const s=e[t.index];if(null!==s&&i.push(Sr(s)),ea(s))for(let a=10;a-1&&(sy(e,i),Hl(t,i))}this._attachedToViewContainer=!1}oy(this._lView[1],this._lView)}onDestroy(e){Bw(this._lView[1],this._lView,null,e)}markForCheck(){Cy(this._cdRefInjectingView||this._lView)}detach(){this._lView[2]&=-129}reattach(){this._lView[2]|=128}detectChanges(){Ay(this._lView[1],this._lView,this.context)}checkNoChanges(){!function(n,e,t){yp(!0);try{Ay(n,e,t)}finally{yp(!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){Qd(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 yK extends Yy{constructor(e){super(e),this._view=e}detectChanges(){Yw(this._view)}checkNoChanges(){!function(n){yp(!0);try{Yw(n)}finally{yp(!1)}}(this._view)}get context(){return null}}const vK=function(n){return function(n,e,t){if(Ad(n)&&!t){const i=zs(n.index,e);return new Yy(i,i)}return 47&n.type?new Yy(e[16],e):null}(as(),Vt(),16==(16&n))};let Mr=(()=>{class n{}return n.__NG_ELEMENT_ID__=vK,n})();const xK=[new GL],CK=new xg([new UL]),TK=new Sg(xK),MK=function(){return wE(as(),Vt())};let Go=(()=>{class n{}return n.__NG_ELEMENT_ID__=MK,n})();const DK=Go,IK=class extends DK{constructor(e,t,i){super(),this._declarationLView=e,this._declarationTContainer=t,this.elementRef=i}createEmbeddedView(e){const t=this._declarationTContainer.tViews,i=hf(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)),ff(t,i,e),new Yy(i)}};function wE(n,e){return 4&n.type?new IK(e,n,Eg(n,e)):null}class Yc{}const PK=function(){return KL(as(),Vt())};let Rs=(()=>{class n{}return n.__NG_ELEMENT_ID__=PK,n})();const kK=Rs,YL=class extends kK{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 na(this._hostTNode,this._hostLView)}get parentInjector(){const e=Xh(this._hostTNode,this._hostLView);if(yv(e)){const t=al(e,this._hostLView),i=Pd(e);return new na(t[1].data[i+8],t)}return new na(null,this._hostLView)}clear(){for(;this.length>0;)this.remove(this.length-1)}get(e){const t=XL(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(Yc,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 ea(n[3])}(i)){const u=this.indexOf(e);if(-1!==u)this.detach(u);else{const h=i[3],f=new YL(h,h[6],h[3]);f.detach(f.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),itw});class b3 extends FL{constructor(e,t){super(),this.componentDef=e,this.ngModule=t,this.componentType=e.type,this.selector=function(n){return n.map(dA).join(",")}(e.selectors),this.ngContentSelectors=e.ngContentSelectors?e.ngContentSelectors:[],this.isBoundToModule=!!t}get inputs(){return y3(this.componentDef.inputs)}get outputs(){return y3(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,Mg,r);return s!==Mg||i===Mg?s:e.get(t,i,r)}}}(e,r.injector):e,o=s.get(yf,Su),a=s.get(AM,null),l=o.createRenderer(null,this.componentDef),c=this.componentDef.selectors[0][0]||"div",u=i?function(n,e,t){if(dr(n))return n.selectRootElement(e,t===Xt.ShadowDom);let i="string"==typeof e?n.querySelector(e):e;return i.textContent="",i}(l,i,this.componentDef.encapsulation):ry(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)),h=this.componentDef.onPush?576:528,f=function(n,e){return{components:[],scheduler:n||tw,clean:WA,playerHandler:e||null,flags:0}}(),g=tg(0,null,null,1,0,null,null,null,null,null),m=hf(null,g,f,h,null,null,o,l,a,s);let w,x;$h(m);try{const U=function(n,e,t,i,r,s){const o=t[1];t[20]=n;const l=Jd(o,20,2,"#host",null),c=l.mergedAttrs=e.hostAttrs;null!==c&&(rg(l,c,!0),null!==n&&(Sp(r,n,c),null!==l.classes&&uy(r,n,l.classes),null!==l.styles&&vw(r,n,l.styles)));const u=i.createRenderer(n,e),h=hf(t,eg(e),null,e.onPush?64:16,t[20],l,i,u,s||null,null);return o.firstCreatePass&&(Rc(Hs(l,t),o,e.type),Ww(o,l),wy(l,t.length,1)),ng(t,h),t[20]=h}(u,this.componentDef,m,o,l);if(u)if(i)Sp(l,u,["ng-version",jL.full]);else{const{attrs:D,classes:ie}=function(n){const e=[],t=[];let i=1,r=2;for(;i0&&uy(l,u,ie.join(" "))}if(x=h_(g,20),void 0!==t){const D=x.projection=[];for(let ie=0;iel(o,e)),e.contentQueries){const l=as();e.contentQueries(1,o,l.directiveStart)}const a=as();return!s.firstCreatePass||null===e.hostBindings&&null===e.hostAttrs||(_o(a.index),Gw(t[1],a,0,a.directiveStart,a.directiveEnd,e),$w(e,o)),o}(U,this.componentDef,m,f,[Fq]),ff(g,m,null)}finally{fi()}return new NQ(this.componentType,w,Eg(x,m),m,x)}}class NQ 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 yK(r),this.componentType=e}get injector(){return new na(this._tNode,this._rootLView)}destroy(){this.hostView.destroy()}onDestroy(e){this.hostView.onDestroy(e)}}const Dg=new Map;class LQ extends Yc{constructor(e,t){super(),this._parent=t,this._bootstrapComponents=[],this.injector=this,this.destroyCbs=[],this.componentFactoryResolver=new _3(this);const i=No(e),r=function(n){return n[T1]||null}(e);r&&bM(r),this._bootstrapComponents=fl(i.bootstrap),this._r3Injector=Zw(e,t,[{provide:Yc,useValue:this},{provide:El,useValue:this.componentFactoryResolver}],rt(e)),this._r3Injector._resolveInjectorDefTypes(),this.instance=this.get(e)}get(e,t=Hn.THROW_IF_NOT_FOUND,i=xn.Default){return e===Hn||e===Yc||e===Vu?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 UM extends class{}{constructor(e){super(),this.moduleType=e,null!==No(e)&&function(n){const e=new Set;!function t(i){const r=No(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,Dg.get(s),i),Dg.set(s,i));const o=fl(r.imports);for(const a of o)e.has(a)||(e.add(a),t(a))}(n)}(e)}create(e){return new LQ(this.moduleType,e)}}function TE(n,e,t){const i=Cs()+n,r=Vt();return r[i]===Dn?$c(r,i,t?e.call(t):e()):function(n,e){return n[e]}(r,i)}function E3(n,e,t,i,r,s){const o=e+t;return Eo(n,o,r)?$c(n,o+1,s?i.call(s,r):i(r)):function(n,e){const t=n[e];return t===Dn?void 0:t}(n,o+1)}function Ps(n,e){const t=Si();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 Je("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=Ic(i.type)),o=Ta(Ce);try{const a=Cp(!1),l=s();return Cp(a),function(n,e,t,i){t>=n.data.length&&(n.data[t]=null,n.blueprint[t]=null),e[t]=i}(t,Vt(),r,l),l}finally{Ta(o)}}function To(n,e,t){const i=n+20,r=Vt(),s=Dd(r,i);return function(n,e){Ql.isWrapped(e)&&(e=Ql.unwrap(e),n[Ln.lFrame.bindingIndex]=Dn);return e}(r,function(n,e){return n[1].data[e].pure}(r,i)?E3(r,Cs(),e,s.transform,t,s):s.transform(t))}function HM(n){return e=>{setTimeout(n,void 0,e)}}const ln=class extends oe{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 h=e;a=null===(r=h.next)||void 0===r?void 0:r.bind(h),l=null===(s=h.error)||void 0===s?void 0:s.bind(h),c=null===(o=h.complete)||void 0===o?void 0:o.bind(h)}this.__isAsync&&(l=HM(l),a&&(a=HM(a)),c&&(c=HM(c)));const u=super.subscribe({next:a,error:l,complete:c});return e instanceof C&&e.add(u),u}};function QQ(){return this._results[sg()]()}class wf{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=sg(),i=wf.prototype;i[t]||(i[t]=QQ)}get changes(){return this._changes||(this._changes=new ln)}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=ia(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],u=e[-l];for(let h=10;h{class n{constructor(t){this.appInits=t,this.resolve=bE,this.reject=bE,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(Ef,8))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const a0=new Ht("AppId"),PZ={provide:a0,useFactory:function(){return`${eD()}${eD()}${eD()}`},deps:[]};function eD(){return String.fromCharCode(97+Math.floor(25*Math.random()))}const X3=new Ht("Platform Initializer"),Xc=new Ht("Platform ID"),IE=new Ht("appBootstrapListener");let OE=(()=>{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 Gu=new Ht("LocaleId"),K3=new Ht("DefaultCurrencyCode");class kZ{constructor(e,t){this.ngModuleFactory=e,this.componentFactories=t}}const tD=function(n){return new UM(n)},FZ=tD,LZ=function(n){return Promise.resolve(tD(n))},Q3=function(n){const e=tD(n),i=fl(No(n).declarations).reduce((r,s)=>{const o=Ui(s);return o&&r.push(new b3(o)),r},[]);return new kZ(e,i)},BZ=Q3,VZ=function(n){return Promise.resolve(Q3(n))};let xf=(()=>{class n{constructor(){this.compileModuleSync=FZ,this.compileModuleAsync=LZ,this.compileModuleAndAllComponentsSync=BZ,this.compileModuleAndAllComponentsAsync=VZ}clearCache(){}clearCacheFor(t){}getModuleId(t){}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const Z3=new Ht("compilerOptions"),UZ=(()=>Promise.resolve(0))();function nD(n){"undefined"==typeof Zone?UZ.then(()=>{n&&n.apply(null,null)}):Zone.current.scheduleMicroTask("scheduleMicrotask",n)}class pn{constructor({enableLongStackTrace:e=!1,shouldCoalesceEventChangeDetection:t=!1,shouldCoalesceRunChangeDetection:i=!1}){if(this.hasPendingMacrotasks=!1,this.hasPendingMicrotasks=!1,this.isStable=!0,this.onUnstable=new ln(!1),this.onMicrotaskEmpty=new ln(!1),this.onStable=new ln(!1),this.onError=new ln(!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=Zn.requestAnimationFrame,e=Zn.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(Zn,()=>{n.fakeTopEventTask||(n.fakeTopEventTask=Zone.root.scheduleEventTask("fakeTopEventTask",()=>{n.lastRequestAnimationFrameId=-1,rD(n),n.isCheckStableRunning=!0,iD(n),n.isCheckStableRunning=!1},void 0,()=>{},()=>{})),n.fakeTopEventTask.invoke()}),rD(n))}(n)};n._inner=n._inner.fork({name:"angular",properties:{isAngularZone:!0},onInvokeTask:(t,i,r,s,o,a)=>{try{return J3(n),t.invokeTask(r,s,o,a)}finally{(n.shouldCoalesceEventChangeDetection&&"eventTask"===s.type||n.shouldCoalesceRunChangeDetection)&&e(),eB(n)}},onInvoke:(t,i,r,s,o,a,l)=>{try{return J3(n),t.invoke(r,s,o,a,l)}finally{n.shouldCoalesceRunChangeDetection&&e(),eB(n)}},onHasTask:(t,i,r,s)=>{t.hasTask(r,s),i===r&&("microTask"==s.change?(n._hasPendingMicrotasks=s.microTask,rD(n),iD(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(!pn.isInAngularZone())throw new Error("Expected to be in Angular Zone, but it is not!")}static assertNotInAngularZone(){if(pn.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,HZ,bE,bE);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 HZ={};function iD(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 rD(n){n.hasPendingMicrotasks=!!(n._hasPendingMicrotasks||(n.shouldCoalesceEventChangeDetection||n.shouldCoalesceRunChangeDetection)&&-1!==n.lastRequestAnimationFrameId)}function J3(n){n._nesting++,n.isStable&&(n.isStable=!1,n.onUnstable.emit(null))}function eB(n){n._nesting--,iD(n)}class WZ{constructor(){this.hasPendingMicrotasks=!1,this.hasPendingMacrotasks=!1,this.isStable=!0,this.onUnstable=new ln,this.onMicrotaskEmpty=new ln,this.onStable=new ln,this.onError=new ln}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 sD=(()=>{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:()=>{pn.assertNotInAngularZone(),nD(()=>{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())nD(()=>{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(pn))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),tB=(()=>{class n{constructor(){this._applications=new Map,oD.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 oD.findTestabilityInTree(this,t,i)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();class qZ{addToWindow(e){}findTestabilityInTree(e,t,i){return null}}let oD=new qZ,nB=!0,iB=!1;function fa(){return iB=!0,nB}let ic;const rB=new Ht("AllowMultipleToken");function sB(n,e,t=[]){const i=`Platform: ${e}`,r=new Ht(i);return(s=[])=>{let o=lD();if(!o||o.injector.get(rB,!1))if(n)n(t.concat(s).concat({provide:r,useValue:!0}));else{const a=t.concat(s).concat({provide:r,useValue:!0},{provide:ju,useValue:"platform"});!function(n){if(ic&&!ic.destroyed&&!ic.injector.get(rB,!1))throw new Error("There can be only one platform. Destroy the previous one to create a new one.");ic=n.get(oB);const e=n.get(X3,null);e&&e.forEach(t=>t())}(Hn.create({providers:a,name:i}))}return function(n){const e=lD();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 lD(){return ic&&!ic.destroyed?ic:null}let oB=(()=>{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 WZ:("zone.js"===n?void 0:n)||new pn({enableLongStackTrace:fa(),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:pn,useValue:a}];return a.run(()=>{const c=Hn.create({providers:l,parent:this.injector,name:t.moduleType.name}),u=t.create(c),h=u.injector.get(la,null);if(!h)throw new Error("No ErrorHandler. Is platform module (BrowserModule) included?");return a.runOutsideAngular(()=>{const f=a.onError.subscribe({next:g=>{h.handleError(g)}});u.onDestroy(()=>{cD(this._modules,u),f.unsubscribe()})}),function(n,e,t){try{const i=t();return yg(i)?i.catch(r=>{throw e.runOutsideAngular(()=>n.handleError(r)),r}):i}catch(i){throw e.runOutsideAngular(()=>n.handleError(i)),i}}(h,a,()=>{const f=u.injector.get(Og);return f.runInitializers(),f.donePromise.then(()=>(bM(u.injector.get(Gu,pE)||pE),this._moduleDoBootstrap(u),u))})})}bootstrapModule(t,i=[]){const r=aB({},i);return function(n,e,t){const i=new UM(t);return Promise.resolve(i)}(0,0,t).then(s=>this.bootstrapModuleFactory(s,r))}_moduleDoBootstrap(t){const i=t.injector.get(sh);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 aB(n,e){return Array.isArray(e)?e.reduce(aB,n):Object.assign(Object.assign({},n),e)}let sh=(()=>{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 O(c=>{this._stable=this._zone.isStable&&!this._zone.hasPendingMacrotasks&&!this._zone.hasPendingMicrotasks,this._zone.runOutsideAngular(()=>{c.next(this._stable),c.complete()})}),l=new O(c=>{let u;this._zone.runOutsideAngular(()=>{u=this._zone.onStable.subscribe(()=>{pn.assertNotInAngularZone(),nD(()=>{!this._stable&&!this._zone.hasPendingMacrotasks&&!this._zone.hasPendingMicrotasks&&(this._stable=!0,c.next(!0))})})});const h=this._zone.onUnstable.subscribe(()=>{pn.assertInAngularZone(),this._stable&&(this._stable=!1,this._zone.runOutsideAngular(()=>{c.next(!1)}))});return()=>{u.unsubscribe(),h.unsubscribe()}});this.isStable=Nn(a,l.pipe(ws()))}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 FL?t:this._componentFactoryResolver.resolveComponentFactory(t),this.componentTypes.push(r.componentType);const s=function(n){return n.isBoundToModule}(r)?void 0:this._injector.get(Yc),a=r.create(Hn.NULL,[],i||r.selector,s),l=a.location.nativeElement,c=a.injector.get(sD,null),u=c&&a.injector.get(tB);return c&&u&&u.registerApplication(l,c),a.onDestroy(()=>{this.detachView(a.hostView),cD(this.components,a),u&&u.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;cD(this._views,i),i.detachFromAppRef()}_loadComponent(t){this.attachView(t.hostView),this.tick(),this.components.push(t),this._injector.get(IE,[]).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(pn),Ie(Hn),Ie(la),Ie(El),Ie(Og))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();function cD(n,e){const t=n.indexOf(e);t>-1&&n.splice(t,1)}const vJ=sB(null,"core",[{provide:Xc,useValue:"unknown"},{provide:oB,deps:[Hn]},{provide:tB,deps:[]},{provide:OE,deps:[]}]),CJ=[{provide:sh,useClass:sh,deps:[pn,Hn,la,El,Og]},{provide:OQ,deps:[pn],useFactory:function(n){let e=[];return n.onStable.subscribe(()=>{for(;e.length;)e.pop()()}),function(t){e.push(t)}}},{provide:Og,useClass:Og,deps:[[new ts,Ef]]},{provide:xf,useClass:xf,deps:[]},PZ,{provide:xg,useFactory:function(){return CK},deps:[]},{provide:Sg,useFactory:function(){return TK},deps:[]},{provide:Gu,useFactory:function(n){return bM(n=n||"undefined"!=typeof $localize&&$localize.locale||pE),n},deps:[[new Hd(Gu),new ts,new dl]]},{provide:K3,useValue:"USD"}];let AJ=(()=>{class n{constructor(t){}}return n.\u0275fac=function(t){return new(t||n)(Ie(sh))},n.\u0275mod=tn({type:n}),n.\u0275inj=St({providers:CJ}),n})(),zE=null;function Kc(){return zE}const fn=new Ht("DocumentToken");let Tf=(()=>{class n{historyGo(t){throw new Error("Not implemented")}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({factory:Tee,token:n,providedIn:"platform"}),n})();function Tee(){return Ie(kB)}let kB=(()=>{class n extends Tf{constructor(t){super(),this._doc=t,this._init()}_init(){this.location=window.location,this._history=window.history}getBaseHrefFromDOM(){return Kc().getBaseHref(this._doc)}onPopState(t){const i=Kc().getGlobalEventTarget(this._doc,"window");return i.addEventListener("popstate",t,!1),()=>i.removeEventListener("popstate",t)}onHashChange(t){const i=Kc().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){FB()?this._history.pushState(t,i,r):this.location.hash=r}replaceState(t,i,r){FB()?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(fn))},n.\u0275prov=We({factory:Mee,token:n,providedIn:"platform"}),n})();function FB(){return!!window.history.pushState}function Mee(){return new kB(Ie(fn))}function SD(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}function LB(n){const e=n.match(/#|\?|$/),t=e&&e.index||n.length;return n.slice(0,t-("/"===n[t-1]?1:0))+n.slice(t)}function Wu(n){return n&&"?"!==n[0]?"?"+n:n}let Ng=(()=>{class n{historyGo(t){throw new Error("Not implemented")}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({factory:Dee,token:n,providedIn:"root"}),n})();function Dee(n){const e=Ie(fn).location;return new BB(Ie(Tf),e&&e.origin||"")}const CD=new Ht("appBaseHref");let BB=(()=>{class n extends Ng{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 SD(this._baseHref,t)}path(t=!1){const i=this._platformLocation.pathname+Wu(this._platformLocation.search),r=this._platformLocation.hash;return r&&t?`${i}${r}`:i}pushState(t,i,r,s){const o=this.prepareExternalUrl(r+Wu(s));this._platformLocation.pushState(t,i,o)}replaceState(t,i,r,s){const o=this.prepareExternalUrl(r+Wu(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(Tf),Ie(CD,8))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),kg=(()=>{class n{constructor(t,i){this._subject=new ln,this._urlChangeListeners=[],this._platformStrategy=t;const r=this._platformStrategy.getBaseHref();this._platformLocation=i,this._baseHref=LB(VB(r)),this._platformStrategy.onPopState(s=>{this._subject.emit({url:this.path(!0),pop:!0,state:s.state,type:s.type})})}path(t=!1){return this.normalize(this._platformStrategy.path(t))}getState(){return this._platformLocation.getState()}isCurrentPathEqualTo(t,i=""){return this.path()==this.normalize(t+Wu(i))}normalize(t){return n.stripTrailingSlash(function(n,e){return n&&e.startsWith(n)?e.substring(n.length):e}(this._baseHref,VB(t)))}prepareExternalUrl(t){return t&&"/"!==t[0]&&(t="/"+t),this._platformStrategy.prepareExternalUrl(t)}go(t,i="",r=null){this._platformStrategy.pushState(r,"",t,i),this._notifyUrlChangeListeners(this.prepareExternalUrl(t+Wu(i)),r)}replaceState(t,i="",r=null){this._platformStrategy.replaceState(r,"",t,i),this._notifyUrlChangeListeners(this.prepareExternalUrl(t+Wu(i)),r)}forward(){this._platformStrategy.forward()}back(){this._platformStrategy.back()}historyGo(t=0){var i,r;null===(r=(i=this._platformStrategy).historyGo)||void 0===r||r.call(i,t)}onUrlChange(t){this._urlChangeListeners.push(t),this._urlChangeSubscription||(this._urlChangeSubscription=this.subscribe(i=>{this._notifyUrlChangeListeners(i.url,i.state)}))}_notifyUrlChangeListeners(t="",i){this._urlChangeListeners.forEach(r=>r(t,i))}subscribe(t,i,r){return this._subject.subscribe({next:t,error:i,complete:r})}}return n.\u0275fac=function(t){return new(t||n)(Ie(Ng),Ie(Tf))},n.normalizeQueryParams=Wu,n.joinWithSlash=SD,n.stripTrailingSlash=LB,n.\u0275prov=We({factory:Oee,token:n,providedIn:"root"}),n})();function Oee(){return new kg(Ie(Ng),Ie(Tf))}function VB(n){return n.replace(/\/index.html$/,"")}var ms=(()=>((ms=ms||{})[ms.Zero=0]="Zero",ms[ms.One=1]="One",ms[ms.Two=2]="Two",ms[ms.Few=3]="Few",ms[ms.Many=4]="Many",ms[ms.Other=5]="Other",ms))();const Vee=function(n){return function(n){const e=function(n){return n.toLowerCase().replace(/_/g,"-")}(n);let t=uL(e);if(t)return t;const i=e.split("-")[0];if(t=uL(i),t)return t;if("en"===i)return iX;throw new Error(`Missing locale data for the locale "${n}".`)}(n)[un.PluralCase]};class ZE{}let pte=(()=>{class n extends ZE{constructor(t){super(),this.locale=t}getPluralCategory(t,i){switch(Vee(i||this.locale)(t)){case ms.Zero:return"zero";case ms.One:return"one";case ms.Two:return"two";case ms.Few:return"few";case ms.Many:return"many";default:return"other"}}}return n.\u0275fac=function(t){return new(t||n)(Ie(Gu))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();function YB(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}class mte{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 Yu=(()=>{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 mte(null,this._ngForOf,-1,-1),null===o?void 0:o),l=new XB(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 XB(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)(Ce(Rs),Ce(Go),Ce(xg))},n.\u0275dir=Nt({type:n,selectors:[["","ngFor","","ngForOf",""]],inputs:{ngForOf:"ngForOf",ngForTrackBy:"ngForTrackBy",ngForTemplate:"ngForTemplate"}}),n})();class XB{constructor(e,t){this.record=e,this.view=t}}let ac=(()=>{class n{constructor(t,i){this._viewContainer=t,this._context=new yte,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){KB("ngIfThen",t),this._thenTemplateRef=t,this._thenViewRef=null,this._updateView()}set ngIfElse(t){KB("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)(Ce(Rs),Ce(Go))},n.\u0275dir=Nt({type:n,selectors:[["","ngIf",""]],inputs:{ngIf:"ngIf",ngIfThen:"ngIfThen",ngIfElse:"ngIfElse"}}),n})();class yte{constructor(){this.$implicit=null,this.ngIf=null}}function KB(n,e){if(e&&!e.createEmbeddedView)throw new Error(`${n} must be a TemplateRef, but received '${rt(e)}'.`)}class Ete{createSubscription(e,t){return e.subscribe({next:t,error:i=>{throw i}})}dispose(e){e.unsubscribe()}onDestroy(e){e.unsubscribe()}}class xte{createSubscription(e,t){return e.then(t,i=>{throw i})}dispose(e){}onDestroy(e){}}const Ste=new xte,Cte=new Ete;let g0=(()=>{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(yg(t))return Ste;if(x2(t))return Cte;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)(Ce(Mr,16))},n.\u0275pipe=js({name:"async",type:n,pure:!1}),n})(),fr=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=tn({type:n}),n.\u0275inj=St({providers:[{provide:ZE,useClass:pte}]}),n})();const iV="browser";function Af(n){return n===iV}class oV{}class BD extends class extends class{}{constructor(){super(...arguments),this.supportsDOMEvents=!0}}{static makeCurrent(){!function(n){zE||(zE=n)}(new BD)}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=(m0=m0||document.querySelector("base"),m0?m0.getAttribute("href"):null);return null==t?null:function(n){ex=ex||document.createElement("a"),ex.setAttribute("href",n);const e=ex.pathname;return"/"===e.charAt(0)?e:`/${e}`}(t)}resetBaseElement(){m0=null}getUserAgent(){return window.navigator.userAgent}getCookie(e){return YB(document.cookie,e)}}let ex,m0=null;const aV=new Ht("TRANSITION_ID"),Xte=[{provide:Ef,useFactory:function(n,e,t){return()=>{t.get(Og).donePromise.then(()=>{const i=Kc(),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},Zn.getAllAngularTestabilities=()=>e.getAllTestabilities(),Zn.getAllAngularRootElements=()=>e.getAllRootElements(),Zn.frameworkStabilizers||(Zn.frameworkStabilizers=[]),Zn.frameworkStabilizers.push(i=>{const r=Zn.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?Kc().isShadowRoot(t)?this.findTestabilityInTree(e,t.host,!0):this.findTestabilityInTree(e,t.parentElement,!0):null}}let Kte=(()=>{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 _0=new Ht("EventManagerPlugins");let nx=(()=>{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})(),y0=(()=>{class n extends cV{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(uV),this._hostNodes.delete(t)}onStylesAdded(t){this._hostNodes.forEach((i,r)=>{this._addStylesToHost(t,r,i)})}ngOnDestroy(){this._hostNodes.forEach(t=>t.forEach(uV))}}return n.\u0275fac=function(t){return new(t||n)(Ie(fn))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();function uV(n){Kc().remove(n)}const UD={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/"},zD=/%COMP%/g;function ix(n,e,t){for(let i=0;i{if("__ngUnwrap__"===e)return n;!1===n(e)&&(e.preventDefault(),e.returnValue=!1)}}let rx=(()=>{class n{constructor(t,i,r){this.eventManager=t,this.sharedStylesHost=i,this.appId=r,this.rendererByCompId=new Map,this.defaultRenderer=new HD(t)}createRenderer(t,i){if(!t||!i)return this.defaultRenderer;switch(i.encapsulation){case Xt.Emulated:{let r=this.rendererByCompId.get(i.id);return r||(r=new dne(this.eventManager,this.sharedStylesHost,i,this.appId),this.rendererByCompId.set(i.id,r)),r.applyToHost(t),r}case 1:case Xt.ShadowDom:return new hne(this.eventManager,this.sharedStylesHost,t,i);default:if(!this.rendererByCompId.has(i.id)){const r=ix(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(nx),Ie(y0),Ie(a0))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();class HD{constructor(e){this.eventManager=e,this.data=Object.create(null)}destroy(){}createElement(e,t){return t?document.createElementNS(UD[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=UD[r];s?e.setAttributeNS(s,t,i):e.setAttribute(t,i)}else e.setAttribute(t,i)}removeAttribute(e,t,i){if(i){const r=UD[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&(Uo.DashCase|Uo.Important)?e.style.setProperty(t,i,r&Uo.Important?"important":""):e.style[t]=i}removeStyle(e,t,i){i&Uo.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,fV(i)):this.eventManager.addEventListener(e,t,fV(i))}}class dne extends HD{constructor(e,t,i,r){super(e),this.component=i;const s=ix(r+"-"+i.id,i.styles,[]);t.addStyles(s),this.contentAttr=function(n){return"_ngcontent-%COMP%".replace(zD,n)}(r+"-"+i.id),this.hostAttr=function(n){return"_nghost-%COMP%".replace(zD,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 hne extends HD{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=ix(r.id,r.styles,[]);for(let o=0;o{class n extends jD{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(fn))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const mV=["alt","control","meta","shift"],vne={"\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"},_V={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"},wne={alt:n=>n.altKey,control:n=>n.ctrlKey,meta:n=>n.metaKey,shift:n=>n.shiftKey};let Ene=(()=>{class n extends jD{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(()=>Kc().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(mV.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&&_V.hasOwnProperty(e)&&(e=_V[e]))}return vne[e]||e}(t);return r=r.toLowerCase()," "===r?r="space":"."===r&&(r="dot"),mV.forEach(s=>{s!=r&&wne[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(fn))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),Mf=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({factory:function(){return Ie($D)},token:n,providedIn:"root"}),n})(),$D=(()=>{class n extends Mf{constructor(t){super(),this._doc=t}sanitize(t,i){if(null==i)return null;switch(t){case si.NONE:return i;case si.HTML:return sa(i,"HTML")?Gs(i):$_(this._doc,String(i)).toString();case si.STYLE:return sa(i,"Style")?Gs(i):i;case si.SCRIPT:if(sa(i,"Script"))return Gs(i);throw new Error("unsafe value used in a script context");case si.URL:return jc(i),sa(i,"URL")?Gs(i):jo(String(i));case si.RESOURCE_URL:if(sa(i,"ResourceURL"))return Gs(i);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(n){return new L_(n)}(t)}bypassSecurityTrustStyle(t){return function(n){return new B_(n)}(t)}bypassSecurityTrustScript(t){return function(n){return new jp(n)}(t)}bypassSecurityTrustUrl(t){return function(n){return new Wd(n)}(t)}bypassSecurityTrustResourceUrl(t){return function(n){return new kn(n)}(t)}}return n.\u0275fac=function(t){return new(t||n)(Ie(fn))},n.\u0275prov=We({factory:function(){return function(n){return new $D(n.get(fn))}(Ie(Vu))},token:n,providedIn:"root"}),n})();const Ine=sB(vJ,"browser",[{provide:Xc,useValue:iV},{provide:X3,useValue:function(){BD.makeCurrent(),VD.init()},multi:!0},{provide:fn,useFactory:function(){return function(n){Yi=n}(document),document},deps:[]}]),One=[[],{provide:ju,useValue:"root"},{provide:la,useFactory:function(){return new la},deps:[]},{provide:_0,useClass:fne,multi:!0,deps:[fn,pn,Xc]},{provide:_0,useClass:Ene,multi:!0,deps:[fn]},[],{provide:rx,useClass:rx,deps:[nx,y0,a0]},{provide:yf,useExisting:rx},{provide:cV,useExisting:y0},{provide:y0,useClass:y0,deps:[fn]},{provide:sD,useClass:sD,deps:[pn]},{provide:nx,useClass:nx,deps:[_0,pn]},{provide:oV,useClass:Kte,deps:[]},[]];let WD=(()=>{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:a0,useValue:t.appId},{provide:aV,useExisting:a0},Xte]}}}return n.\u0275fac=function(t){return new(t||n)(Ie(n,12))},n.\u0275mod=tn({type:n}),n.\u0275inj=St({providers:One,imports:[fr,AJ]}),n})();"undefined"!=typeof window&&window;class Vne extends C{constructor(e,t){super()}schedule(e,t=0){return this}}class sx extends Vne{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 bV=(()=>{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 cc extends bV{constructor(e,t=bV.now){super(e,()=>cc.delegate&&cc.delegate!==this?cc.delegate.now():t()),this.actions=[],this.active=!1,this.scheduled=void 0}schedule(e,t=0,i){return cc.delegate&&cc.delegate!==this?cc.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 zne=new class extends cc{}(class extends sx{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)}}),Qc=new O(n=>n.complete());function b0(n){return n?function(n){return new O(e=>n.schedule(()=>e.complete()))}(n):Qc}function sn(...n){let e=n[n.length-1];return Te(e)?(n.pop(),ke(n,e)):In(n)}function Fg(n,e){return new O(e?t=>e.schedule(Gne,0,{error:n,subscriber:t}):t=>t.error(n))}function Gne({error:n,subscriber:e}){e.error(n)}class ga{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 sn(this.value);case"E":return Fg(this.error);case"C":return b0()}throw new Error("unexpected notification kind value")}static createNext(e){return void 0!==e?new ga("N",e):ga.undefinedValueNotification}static createError(e){return new ga("E",void 0,e)}static createComplete(){return ga.completeNotification}}ga.completeNotification=new ga("C"),ga.undefinedValueNotification=new ga("N",void 0);class ox 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(ox.dispatch,this.delay,new Wne(e,this.destination)))}_next(e){this.scheduleMessage(ga.createNext(e))}_error(e){this.scheduleMessage(ga.createError(e)),this.unsubscribe()}_complete(){this.scheduleMessage(ga.createComplete()),this.unsubscribe()}}class Wne{constructor(e,t){this.notification=e,this.destination=t}}class Df extends oe{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 qne(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 $;if(this.isStopped||this.hasError?o=C.EMPTY:(this.observers.push(e),o=new Z(this,e)),r&&e.add(e=new ox(e,r)),t)for(let a=0;at&&(o=Math.max(o,s-t)),o>0&&r.splice(0,o),r}}class qne{constructor(e,t){this.time=e,this.value=t}}function is(n,e){return"function"==typeof e?t=>t.pipe(is((i,r)=>je(n(i,r)).pipe(me((s,o)=>e(i,s,r,o))))):t=>t.lift(new Yne(n))}class Yne{constructor(e){this.project=e}call(e,t){return t.subscribe(new Xne(e,this.project))}}class Xne extends we{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 _t(this),r=this.destination;r.add(i),this.innerSubscription=N(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 ax={schedule(n,e){const t=setTimeout(n,e);return()=>clearTimeout(t)},scheduleBeforeRender(n){if("undefined"==typeof window)return ax.schedule(n,0);if(void 0===window.requestAnimationFrame)return ax.schedule(n,16);const e=window.requestAnimationFrame(n);return()=>window.cancelAnimationFrame(e)}};let YD;function sie(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(!YD){const t=Element.prototype;YD=t.matches||t.matchesSelector||t.mozMatchesSelector||t.msMatchesSelector||t.oMatchesSelector||t.webkitMatchesSelector}return n.nodeType===Node.ELEMENT_NODE&&YD.call(n,e)}(n,r)||(i=s,0))),i}class aie{constructor(e,t){this.componentFactory=t.get(El).resolveComponentFactory(e)}create(e){return new lie(this.componentFactory,e)}}class lie{constructor(e,t){this.componentFactory=e,this.injector=t,this.eventEmitters=new Df(1),this.events=this.eventEmitters.pipe(is(i=>Nn(...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(pn),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=ax.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=ax.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 c_(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 cie extends HTMLElement{constructor(){super(...arguments),this.ngElementEventsSubscription=null}}const die={initialConfig:{},parse:{},rename:{}};class hie{constructor(e,t){this.configState=e,this.storedChanges={},this.options=Object.assign(Object.assign({},die),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,u=null!==(s=o[e])&&void 0!==s?s:o[l];if(null==c)delete i[l];else if(u)try{i[l]=u(c)}catch(h){console.warn(`Failed to parse ${e} = ${c}`,h.message)}else i[l]=c}}let fie=(()=>{class n{constructor(t,i,r={}){this.configState=t,this.cdr=i,this.options=r,this.initialized=!1,this.configManager=new hie(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=Nt({type:n,features:[Fi]}),n})();const XD={boolean:n=>"false"!=`${n}`,json:n=>"string"==typeof n?JSON.parse(n):n,function:n=>{if("function"!=typeof n)throw new Error("Expected a javascript function");return n}};var KD;const If={production:!0,disableDbWorker:!0,acceptableViewerDomains:["https://portal.hubmapconsortium.org","https://portal.test.hubmapconsortium.org"],dbOptions:{ccfOwlUrl:"https://r5i95k35v5.us-east-2.awsapprunner.com/v1/ccf.owl.n3store.json",ccfContextUrl:"https://hubmapconsortium.github.io/ccf-ontology/ccf-context.jsonld",dataSources:["https://cdn.jsdelivr.net/gh/hubmapconsortium/ccf-ui@staging/assets/kpmp/data/rui_locations.jsonld","https://cdn.jsdelivr.net/gh/hubmapconsortium/ccf-ui@staging/assets/sparc/data/rui_locations.jsonld"],hubmapDataService:"",hubmapPortalUrl:"",hubmapDataUrl:"",hubmapAssetsUrl:"",hubmapToken:null!==(KD=localStorage.getItem("HUBMAP_TOKEN"))&&void 0!==KD?KD:"",useRemoteApi:!1,remoteApiEndpoint:"https://r5i95k35v5.us-east-2.awsapprunner.com/v1"},googleAnalyticsToken:"G-ERNVZ1Q4KE"};function Ei(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 wV(n,e){return function(t,i){e(t,i,n)}}function uc(n,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(n,e)}function Bi(n,e,t,i){return new(t||(t=Promise))(function(s,o){function a(u){try{c(i.next(u))}catch(h){o(h)}}function l(u){try{c(i.throw(u))}catch(h){o(h)}}function c(u){u.done?s(u.value):function(s){return s instanceof t?s:new t(function(o){o(s)})}(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})}function SV(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 ZD(){return!("object"==typeof process&&"[object process]"===String(process)&&!process.browser)||SV()}const CV="undefined"!=typeof __VERSION__?__VERSION__:"untranspiled source",cx=ZD();class _ie{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 JD(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 TV={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 AV(n){return"string"==typeof n?TV[n.toUpperCase()]||TV.WHITE:n}function ux(n,e){if(!n)throw new Error(e||"Assertion failed")}const dc={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},v0=dc.window||dc.self||dc.global,MV=dc.process||{};function Lg(){let n;if(cx&&v0.performance)n=v0.performance.now();else if(MV.hrtime){const e=MV.hrtime();n=1e3*e[0]+e[1]/1e6}else n=Date.now();return n}console;const Bg={debug:cx&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},Sie={enabled:!0,level:0};function Al(){}const DV={},IV={once:!0};function Cie(n){for(const e in n)for(const t in n[e])return t||"untitled";return"empty"}let eI=(()=>{class n{constructor({id:t}={id:""}){this.id=t,this.VERSION=CV,this._startTs=Lg(),this._deltaTs=Lg(),this.LOG_THROTTLE_TIMEOUT=0,this._storage=new _ie("__probe-".concat(this.id,"__"),Sie),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((Lg()-this._startTs).toPrecision(10))}getDelta(){return Number((Lg()-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){ux(t,i)}warn(t){return this._getLogFunction(0,t,Bg.warn,arguments,IV)}error(t){return this._getLogFunction(0,t,Bg.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,Bg.log,arguments,{time:!0,once:!0})}log(t,i){return this._getLogFunction(t,i,Bg.debug,arguments)}info(t,i){return this._getLogFunction(t,i,console.info,arguments)}once(t,i){return this._getLogFunction(t,i,Bg.debug||Bg.info,arguments,IV)}table(t,i,r){return i?this._getLogFunction(t,i,console.table||Al,r&&[r],{tag:Cie(i)}):Al}image({logLevel:t,priority:i,image:r,message:s="",scale:o=1}){return this._shouldLog(t||i)?cx?function({image:n,message:e="",scale:t=1}){if("string"==typeof n){const r=new Image;return r.onload=()=>{const s=JD(r,e,t);console.log(...s)},r.src=n,Al}const i=n.nodeName||"";if("img"===i.toLowerCase())return console.log(...JD(n,e,t)),Al;if("canvas"===i.toLowerCase()){const r=new Image;return r.onload=()=>console.log(...JD(r,e,t)),r.src=n.toDataURL(),Al}return Al}({image:r,message:s,scale:o}):function({image:n,message:e="",scale:t=1}){let i=null;try{i=et(5307)}catch(r){}return i?()=>i(n,{fit:"box",width:"".concat(Math.round(80*t),"%")}).then(r=>console.log(r)):Al}({image:r,message:s,scale:o}):Al}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||Al)}group(t,i,r={collapsed:!1}){r=RV({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||Al)}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()>=OV(t)}_getLogFunction(t,i,r,s=[],o){if(this._shouldLog(t)){o=RV({logLevel:t,message:i,args:s,opts:o}),ux(r=r||o.method),o.total=this.getTotal(),o.delta=this.getDelta(),this._deltaTs=Lg();const a=o.tag||o.message;if(o.once){if(DV[a])return Al;DV[a]=Lg()}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!cx&&"string"==typeof n&&(e&&(e=AV(e),n="\x1b[".concat(e,"m").concat(n,"\x1b[39m")),t&&(e=AV(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 Al}}return n.VERSION=CV,n})();function OV(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 ux(Number.isFinite(e)&&e>=0),e}function RV(n){const{logLevel:e,message:t}=n;n.logLevel=OV(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 ux("string"===r||"object"===r),Object.assign(n,n.opts)}const Ri=new eI({id:"deck"}),Vi={DEFAULT:-1,LNGLAT:1,METER_OFFSETS:2,LNGLAT_OFFSETS:3,CARTESIAN:0};Object.defineProperty(Vi,"IDENTITY",{get:()=>Ri.deprecated("COORDINATE_SYSTEM.IDENTITY","COORDINATE_SYSTEM.CARTESIAN")()||0});const Zc={WEB_MERCATOR:1,GLOBE:2,WEB_MERCATOR_AUTO_OFFSET:4,IDENTITY:0},PV={click:{handler:"onClick"},panstart:{handler:"onDragStart"},panmove:{handler:"onDrag"},panend:{handler:"onDragEnd"}},mn=new eI({id:"luma.gl"});function qo(n,e){if(!n)throw new Error(e||"luma.gl: assertion failed.")}function dx(n){return"undefined"!=typeof WebGLRenderingContext&&n instanceof WebGLRenderingContext||"undefined"!=typeof WebGL2RenderingContext&&n instanceof WebGL2RenderingContext||Boolean(n&&Number.isFinite(n._version))}function Ci(n){return"undefined"!=typeof WebGL2RenderingContext&&n instanceof WebGL2RenderingContext||Boolean(n&&2===n._version)}function hx(n){return qo(dx(n),"Invalid WebGLRenderingContext"),n}function Ao(n){return qo(Ci(n),"Requires WebGL2"),n}const w0={};const E0=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{globalThis.console&&globalThis.console.log&&globalThis.console.log("OESVertexArrayObject emulation library context restored"),t.reset_()},!0),this.reset_()};Of.prototype.VERTEX_ARRAY_BINDING_OES=34229,Of.prototype.reset_=function(){if(void 0!==this.vertexArrayObjects)for(let i=0;iCi(n)?void 0:0,Wie={3074:n=>Ci(n)?void 0:36064,35723:n=>Ci(n)?void 0:4352,35977:br,32937:br,36795:(n,e)=>{const t=Ci(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(FV);return e(t&&t.UNMASKED_VENDOR_WEBGL||7936)},37446:(n,e)=>{const t=n.getExtension(FV);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:br,35071:br,37447:br,36063:(n,e)=>{if(!Ci(n)){const t=n.getExtension(kV);return t?e(t.MAX_COLOR_ATTACHMENTS_WEBGL):0}},35379:br,35374:br,35377:br,34852:n=>{if(!Ci(n)){const e=n.getExtension(kV);return e?e.MAX_DRAW_BUFFERS_WEBGL:0}},36203:n=>n.getExtension(NV)?2147483647:65535,33001:n=>n.getExtension(NV)?16777216:65535,33e3:n=>16777216,37157:br,35373:br,35657:br,36183:br,37137:br,34045:br,35978:br,35979:br,35968:br,35376:br,35375:br,35659:br,37154:br,35371:br,35658:br,35076:br,35077:br,35380:br},LV="ANGLE_instanced_arrays",BV={OES_vertex_array_object:{meta:{suffix:"OES"},createVertexArray:()=>{qo(!1,"VertexArray requires WebGL2 or OES_vertex_array_object extension")},deleteVertexArray:()=>{},bindVertexArray:()=>{},isVertexArray:()=>!1},[LV]:{meta:{suffix:"ANGLE"},vertexAttribDivisor(n,e){qo(0===e,"WebGL instanced rendering not supported")},drawElementsInstanced:()=>{},drawArraysInstanced:()=>{}},WEBGL_draw_buffers:{meta:{suffix:"WEBGL"},drawBuffers:()=>{qo(!1)}},EXT_disjoint_timer_query:{meta:{suffix:"EXT"},createQuery:()=>{qo(!1)},deleteQuery:()=>{qo(!1)},beginQuery:()=>{qo(!1)},endQuery:()=>{},getQuery(n,e){return this.getQueryObject(n,e)},getQueryParameter(n,e){return this.getQueryObject(n,e)},getQueryObject:()=>{}}},tI={readBuffer:(n,e,t)=>{Ci(n)&&e(t)},getVertexAttrib:(n,e,t,i)=>{const{webgl2:r,ext:s}=function(n,e){return{webgl2:Ci(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(!Ci(n))switch(i){case 35967:return 35981;case 35971:case 35382:return 0}return e(t,i)},getInternalformatParameter:(n,e,t,i,r)=>{if(!Ci(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=Wie[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 rre(n,{extension:e,target:t,target2:i}){const r=BV[e];qo(r);const{meta:s={}}=r,{suffix:o=""}=s,a=n.getExtension(e);for(const l of Object.keys(r)){const c=`${l}${o}`;let u=null;"meta"===l||"function"==typeof n[l]||(a&&"function"==typeof a[c]?u=(...h)=>a[c](...h):"function"==typeof r[l]&&(u=r[l].bind(t))),u&&(t[l]=u,i[l]=u)}}globalThis.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 Of(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&&rre(n,{extension:t,target:n.luma,target2:n})}(n,BV),function(n,{target:e,target2:t}){Object.keys(tI).forEach(i=>{if("function"==typeof tI[i]){const r=n[i]?n[i].bind(n):()=>{},s=tI[i].bind(null,n,r);e[i]=s,t[i]=s}})}(n,{target:e,target2:n}),e.polyfilled=!0),n};const nI={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},lh=(n,e,t)=>e?n.enable(t):n.disable(t),VV=(n,e,t)=>n.hint(t,e),ja=(n,e,t)=>n.pixelStorei(t,e);function x0(n){return Array.isArray(n)||ArrayBuffer.isView(n)}const are={3042:lh,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:lh,2885:(n,e)=>n.cullFace(e),2929:lh,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:lh,35723:VV,36006:(n,e)=>{const t=Ci(n)?36009:36160;return n.bindFramebuffer(t,e)},2886:(n,e)=>n.frontFace(e),33170:VV,2849:(n,e)=>n.lineWidth(e),32823:lh,32824:"polygonOffset",10752:"polygonOffset",35977:lh,32938:"sampleCoverage",32939:"sampleCoverage",3089:lh,3088:(n,e)=>n.scissor(...e),2960:lh,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:ja,3317:ja,37440:ja,37441:ja,37443:ja,3330:ja,3332:ja,3331:ja,36010:(n,e)=>n.bindFramebuffer(36008,e),3314:ja,32878:ja,3316:ja,3315:ja,32877:ja,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=x0(e)?e:[e,e],n.blendEquationSeparate(...e)},blendFunc:(n,e)=>{e=x0(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=x0(e)?e:[e,e];const[t,i]=e;n.stencilMaskSeparate(1028,t),n.stencilMaskSeparate(1029,i)},stencilFunc:(n,e)=>{e=x0(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=x0(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 rs(n,e,t){return void 0!==e[n]?e[n]:t[n]}const lre={blendEquation:(n,e,t)=>n.blendEquationSeparate(rs(32777,e,t),rs(34877,e,t)),blendFunc:(n,e,t)=>n.blendFuncSeparate(rs(32969,e,t),rs(32968,e,t),rs(32971,e,t),rs(32970,e,t)),polygonOffset:(n,e,t)=>n.polygonOffset(rs(32824,e,t),rs(10752,e,t)),sampleCoverage:(n,e,t)=>n.sampleCoverage(rs(32938,e,t),rs(32939,e,t)),stencilFuncFront:(n,e,t)=>n.stencilFuncSeparate(1028,rs(2962,e,t),rs(2967,e,t),rs(2963,e,t)),stencilFuncBack:(n,e,t)=>n.stencilFuncSeparate(1029,rs(34816,e,t),rs(36003,e,t),rs(36004,e,t)),stencilOpFront:(n,e,t)=>n.stencilOpSeparate(1028,rs(2964,e,t),rs(2965,e,t),rs(2966,e,t)),stencilOpBack:(n,e,t)=>n.stencilOpSeparate(1029,rs(34817,e,t),rs(34818,e,t),rs(34819,e,t))},jV={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]})},Jc=(n,e)=>n.isEnabled(e),UV={3042:Jc,2884:Jc,2929:Jc,3024:Jc,32823:Jc,32926:Jc,32928:Jc,3089:Jc,2960:Jc,35977:Jc};function zV(n){for(const e in n)return!1;return!0}function cre(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||nI)){const r=e,s=UV[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=UV[r];i[r]=s?s(n,Number(r)):n.getParameter(Number(r))}return i}(e):Object.assign({},nI),this.log=i,this._updateCache=this._updateCache.bind(this),Object.seal(this)}push(e={}){this.stateStack.push({})}pop(){qo(this.stateStack.length>0),Xu(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){qo(void 0!==s);const o=e[s],a=this.cache[s];cre(o,a)||(t=!0,i=a,r&&!(s in r)&&(r[s]=a),this.cache[s]=o)}return{valueChanged:t,oldValue:i}}}function GV(n,e={}){const{enable:t=!0,copyState:i}=e;if(qo(void 0!==i),!n.state){const{polyfillContext:r}=globalThis;r&&r(n),n.state=new hre(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 s in jV)ure(n,s,jV[s]);HV(n,"getParameter"),HV(n,"isEnabled")}return n.state.enable=t,n}function $V(n){qo(n.state),n.state.pop()}function Xu(n,e){if(qo(dx(n),"setParameters requires a WebGL context"),zV(e))return;const t={};for(const r in e){const s=Number(r),o=are[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)lre[r](n,e,i)}function hc(n,e,t){if(zV(e))return t(n);const{nocatch:i=!0}=e;let r;if(function(n){n.state||GV(n,{copyState:!1}),n.state.push()}(n),Xu(n,e),i)r=t(n),$V(n);else try{r=t(n)}finally{$V(n)}return r}function fx(){return!("object"==typeof process&&"[object process]"===String(process)&&!process.browser)||function(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;return!!(e&&e.indexOf("Electron")>=0)}()}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 iI(n,e,t=!0){return function(n,e,t,i,r){const s=WV(n[0],e,t);let o=qV(n[1],e,i,r),a=WV(n[0]+1,e,t);const l=a===t-1?a:a-1;let c;return a=qV(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 WV(n,e,t){return Math.min(Math.round(n*e),t-1)}function qV(n,e,t,i){return i?Math.max(0,t-1-Math.round(n*e)):Math.min(Math.round(n*e),t-1)}const rI=fx(),bre=rI&&"undefined"!=typeof document,YV={webgl2:!0,webgl1:!0,throwOnError:!0,manageState:!0,canvas:null,debug:!1,width:800,height:600};function XV(n={}){qo(rI,"createGLContext only available in the browser.\nCreate your own headless context or use 'createHeadlessContext' from @luma.gl/test-utils"),n=Object.assign({},YV,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?(bre&&"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=sI(r,n),function(n){const e=Ci(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);mn.info(1,`${e}${n.debug?" debug":""} context ${t?`(${t.vendor},${t.renderer})`:""}`)()}(r),r):null}function sI(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({},YV,e);const{manageState:t,debug:i}=e;return t&&GV(n,{copyState:!1,log:(...r)=>mn.log(1,...r)()}),rI&&i&&(globalThis.makeDebugContext?(n=globalThis.makeDebugContext(n,e),mn.level=Math.max(mn.level,1)):mn.warn('WebGL debug mode not activated. import "@luma.gl/debug" to enable.')()),n._instrumented=!0,n}function KV(){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 QV{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=KV(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(KV()-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 oI{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 QV?e:new QV(t,i)),this.stats[t]}}const S0="8.5.12",Rf=new class{constructor(){this.stats=new Map}get(e){return this.stats.has(e)||this.stats.set(e,new oI({id:e})),this.stats.get(e)}};if(globalThis.luma&&globalThis.luma.VERSION!==S0)throw new Error(`luma.gl - multiple VERSIONs detected: ${globalThis.luma.VERSION} vs ${S0}`);function on(n,e){if(!n)throw new Error(e||"luma.gl: assertion failed.")}function aI(n,e){if("string"!=typeof e)return e;const t=Number(e);if(!isNaN(t))return t;const i=n[e=e.replace(/^.*\./,"")];return on(void 0!==i,`Accessing undefined constant GL.${e}`),i}function ch(n,e){e=Number(e);for(const t in n)if(n[t]===e)return`GL.${t}`;return String(e)}globalThis.luma||(fx()&&mn.log(1,`luma.gl ${S0} - set luma.log.level=1 (or higher) to trace rendering`)(),globalThis.luma=globalThis.luma||{VERSION:S0,version:S0,log:mn,stats:Rf,globals:{modules:{},nodeIO:{}}}),globalThis;const lI={};function ma(n="id"){return lI[n]=lI[n]||1,`${n}-${lI[n]++}`}function ZV(n){return on("number"==typeof n,"Input must be a number"),n&&0==(n&n-1)}function jg(n){let e=!0;for(const t in n){e=!1;break}return e}function JV(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 mn.removed(`Calling removed method ${e}.${o}: `,r)(),new Error(o)})})}const Ug="Resource subclass must define virtual methods";class Ku{get[Symbol.toStringTag](){return"Resource"}constructor(e,t={}){hx(e);const{id:i,userData:r={}}=t;this.gl=e,this.gl2=e,this.id=i||ma(this[Symbol.toStringTag]),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[Symbol.toStringTag]||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={}){on(e=aI(this.gl,e));const r=(this.constructor.PARAMETERS||{})[e];if(r){const s=Ci(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=Ci(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 h=i?ch(this.gl,l):l;o[h]=this.getParameter(l,e),i&&"GLenum"===c.type&&(o[h]=ch(this.gl,o[h]))}}return o}setParameter(e,t){on(e=aI(this.gl,e));const r=(this.constructor.PARAMETERS||{})[e];if(r){const s=Ci(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=aI(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 JV(this,e,t,i)}initialize(e){}_createHandle(){throw new Error(Ug)}_deleteHandle(){throw new Error(Ug)}_bindHandle(e){throw new Error(Ug)}_getOptsFromHandle(){throw new Error(Ug)}_getParameter(e,t){throw new Error(Ug)}_setParameter(e,t){throw new Error(Ug)}_context(){return this.gl.luma=this.gl.luma||{},this.gl.luma}_addStats(){const e=this[Symbol.toStringTag],t=Rf.get("Resource Counts");t.get("Resources Created").incrementCount(),t.get(`${e}s Created`).incrementCount(),t.get(`${e}s Active`).incrementCount()}_removeStats(){const e=this[Symbol.toStringTag];Rf.get("Resource Counts").get(`${e}s Active`).decrementCount()}_trackAllocatedMemory(e,t=this[Symbol.toStringTag]){const i=Rf.get("Memory Usage");i.get("GPU Memory").addCount(e),i.get(`${t} Memory`).addCount(e),this.byteLength=e}_trackDeallocatedMemory(e=this[Symbol.toStringTag]){const t=Rf.get("Memory Usage");t.get("GPU Memory").subtractCount(this.byteLength),t.get(`${e} Memory`).subtractCount(this.byteLength),this.byteLength=0}}function cI(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 C0(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 Ore({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 _a.getBytesPerElement(this)}get BYTES_PER_VERTEX(){return _a.getBytesPerVertex(this)}_assign(e={}){return void 0!==(e=uI("Accessor",e,Pre)).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"},Nre={removedProps:{},replacedProps:{bytes:"byteLength"},deprecatedProps:tj},kre={removedProps:tj};class lr extends Ku{get[Symbol.toStringTag](){return"Buffer"}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/_a.getBytesPerElement(e))}getVertexCount(e=this.accessor){return Math.round(this.byteLength/_a.getBytesPerVertex(e))}initialize(e={}){return ArrayBuffer.isView(e)&&(e={data:e}),Number.isFinite(e)&&(e={byteLength:e}),e=uI("Buffer",e,Nre),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=uI("Buffer",e,kre))&&this.setAccessor(e.accessor),this}setAccessor(e){return delete(e=Object.assign({},e)).buffer,this.accessor=new _a(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;on(t);const o=this.gl.webgl2?36663:this.target;return this.gl.bindBuffer(o,this.handle),0!==r||void 0!==s?(Ao(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 Ao(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}={}){Ao(this.gl);const s=C0(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 u=Math.min(o,l);return on((r=r||u)<=u),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):(on(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){on(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=cI(e);return on(s),this.setAccessor(new _a(this.accessor,{type:s})),this}_setByteLength(e,t=this.usage){on(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/C0(this.accessor.type||5126,{clamped:!1}).BYTES_PER_ELEMENT;return this.getElementCount()-i}_inferType(e){this.accessor.type||this.setAccessor(new _a(this.accessor,{type:cI(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 mn.deprecated("Buffer.type","Buffer.accessor.type")(),this.accessor.type}get bytes(){return mn.deprecated("Buffer.bytes","Buffer.byteLength")(),this.byteLength}setByteLength(e){return mn.deprecated("setByteLength","reallocate")(),this.reallocate(e)}updateAccessor(e){return mn.deprecated("updateAccessor(...)","setAccessor(new Accessor(buffer.accessor, ...)")(),this.accessor=new _a(this.accessor,e),this}}const dI={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}},nj={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},ij={5126:4,5125:4,5124:4,5123:2,5122:2,5131:2,5120:1,5121:1},Bre=[9729,9728],rj=globalThis.WebGLBuffer||function(){};class Pf extends Ku{get[Symbol.toStringTag](){return"Texture"}static isSupported(e,t={}){const{format:i,linearFiltering:r}=t;let s=!0;return i&&(s=s&&function(n,e){const t=dI[e];if(!t)return!1;if(void 0===t.gl1&&void 0===t.gl2)return!0;const i=Ci(n)&&t.gl2||t.gl1;return"string"==typeof i?n.getExtension(i):i}(e,i),s=s&&(!r||function(n,e){const t=dI[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=ma("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(D=>this.initialize(Object.assign({},e,{pixels:D,data:D}))),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:u}=e;t||(t=r);let{width:h,height:f,dataFormat:g,type:m,compressed:w=!1,mipmaps:x=!0}=e;const{depth:U=0}=e;return({width:h,height:f,compressed:w,dataFormat:g,type:m}=this._deduceParameters({format:s,type:m,dataFormat:g,compressed:w,data:t,width:h,height:f})),this.width=h,this.height=f,this.depth=U,this.format=s,this.type=m,this.dataFormat=g,this.border=o,this.textureUnit=u,Number.isFinite(this.textureUnit)&&(this.gl.activeTexture(33984+this.textureUnit),this.gl.bindTexture(this.target,this.handle)),x&&this._isNPOT()&&(mn.warn(`texture: ${this} is Non-Power-Of-Two, disabling mipmaping`)(),x=!1,this._updateForNPOT(l)),this.mipmaps=x,this.setImageData({data:t,width:h,height:f,depth:U,format:s,type:m,dataFormat:g,border:o,mipmaps:x,parameters:c,compressed:w}),x&&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:u=this.type,width:h=this.width,height:f=this.height,dataFormat:g=this.dataFormat,compressed:m=!1}=e;c||(c=i),({type:u,dataFormat:g,compressed:m,width:h,height:f}=this._deduceParameters({format:s,type:u,dataFormat:g,compressed:m,data:c,width:h,height:f}));const{gl:w}=this;w.bindTexture(this.target,this.handle);let x=null;({data:c,dataType:x}=this._getDataType({data:c,compressed:m}));let U,D=0;return hc(this.gl,l,()=>{switch(x){case"null":w.texImage2D(t,r,s,h,f,o,g,u,c);break;case"typed-array":w.texImage2D(t,r,s,h,f,o,g,u,c,a);break;case"buffer":U=Ao(w),U.bindBuffer(35052,c.handle||c),U.texImage2D(t,r,s,h,f,o,g,u,a),U.bindBuffer(35052,null);break;case"browser-object":Ci(w)?w.texImage2D(t,r,s,h,f,o,g,u,c):w.texImage2D(t,r,s,g,u,c);break;case"compressed":for(const[ie,_e]of c.entries())w.compressedTexImage2D(t,ie,_e.format,_e.width,_e.height,o,_e.data),D+=_e.levelSize;break;default:on(!1,"Unknown image data type")}}),this._trackAllocatedMemory("compressed"===x?D:c&&c.byteLength?c.byteLength:this.width*this.height*(nj[this.dataFormat]||4)*(ij[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:u=this.type,dataFormat:h=this.dataFormat,compressed:f=!1,offset:g=0,border:m=this.border,parameters:w={}}){if(({type:u,dataFormat:h,compressed:f,width:o,height:a}=this._deduceParameters({format:c,type:u,dataFormat:h,compressed:f,data:i,width:o,height:a})),on(0===this.depth,"texSubImage not supported for 3D textures"),i||(i=t),i&&i.data){const x=i;i=x.data,o=x.shape[0],a=x.shape[1]}i instanceof lr&&(i=i.handle),this.gl.bindTexture(this.target,this.handle),hc(this.gl,w,()=>{if(f)this.gl.compressedTexSubImage2D(e,l,r,s,o,a,c,i);else if(null===i)this.gl.texSubImage2D(e,l,r,s,o,a,h,u,null);else if(ArrayBuffer.isView(i))this.gl.texSubImage2D(e,l,r,s,o,a,h,u,i,g);else if(i instanceof rj){const x=Ao(this.gl);x.bindBuffer(35052,i),x.texSubImage2D(e,l,r,s,o,a,h,u,g),x.bindBuffer(35052,null)}else Ci(this.gl)?Ao(this.gl).texSubImage2D(e,l,r,s,o,a,h,u,i):this.gl.texSubImage2D(e,l,r,s,h,u,i)}),this.gl.bindTexture(this.target,null)}copyFramebuffer(e={}){return mn.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 lr?{data:e.handle,dataType:"buffer"}:e instanceof rj?{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=dI[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},on(r,"Could not deduced texture size"),on(void 0===t||r.width===t,"Deduced texture width does not match supplied width"),on(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:on(!1);break;default:this.gl.texParameteri(this.target,e,t)}return this.gl.bindTexture(this.target,null),this}_isNPOT(){return!(Ci(this.gl)||!this.width||!this.height||ZV(this.width)&&ZV(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===Bre.indexOf(t)&&(t=9729);break;case 10242:case 10243:33071!==t&&(t=33071)}return t}}function Vre(n,e){return on("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 ya extends Pf{get[Symbol.toStringTag](){return"Texture2D"}static isSupported(e,t){return Pf.isSupported(e,t)}constructor(e,t={}){hx(e),(t instanceof Promise||"string"==typeof t)&&(t={data:t}),"string"==typeof t.data&&(t=Object.assign({},t,{data:Vre(t.data)})),super(e,Object.assign({},t,{target:3553})),this.initialize(t),Object.seal(this)}}const Nf="EXT_color_buffer_float",sj={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:Nf,bpp:2},33327:{gl2:Nf,bpp:4},34842:{gl2:Nf,bpp:8},33326:{gl2:Nf,bpp:4},33328:{gl2:Nf,bpp:8},34836:{gl2:Nf,bpp:16},35898:{gl2:Nf,bpp:4}};class zg extends Ku{get[Symbol.toStringTag](){return"Renderbuffer"}static isSupported(e,{format:t}={format:null}){return!t||function(n,e,t){const i=t[e];if(!i)return!1;const r=Ci(n)&&i.gl2||i.gl1;return"string"==typeof r?n.getExtension(r):r}(e,t,sj)}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 on(e,"Needs format"),this._trackDeallocatedMemory(),this.gl.bindRenderbuffer(36161,this.handle),0!==r&&Ci(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)*sj[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 uj="clear: bad arguments";function fI(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)),on(0!==o,uj),hc(n,s,()=>{n.clear(o)})}function dj(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 li(n){return function(){var e=this,t=arguments;return new Promise(function(i,r){var s=n.apply(e,t);function o(l){dj(s,i,r,o,a,"next",l)}function a(l){dj(s,i,r,o,a,"throw",l)}o(void 0)})}}const pI=[34069,34070,34071,34072,34073,34074];let Wre=(()=>{class n extends Pf{get[Symbol.toStringTag](){return"TextureCube"}constructor(t,i={}){hx(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 li(function*(){const{gl:u}=c,h=r||s,f=yield Promise.all(pI.map(g=>{const m=h[g];return Promise.all(Array.isArray(m)?m:[m])}));c.bind(),pI.forEach((g,m)=>{f[m].length>1&&!1!==c.opts.mipmaps&&mn.warn(`${c.id} has mipmap and multiple LODs.`)(),f[m].forEach((w,x)=>{t&&i?u.texImage2D(g,x,a,t,i,o,a,l,w):u.texImage2D(g,x,a,a,l,w)})}),c.unbind()})()}setImageDataForFace(t){const{face:i,width:r,height:s,pixels:o,data:a,border:l=0,format:c=6408,type:u=5121}=t,{gl:h}=this,f=o||a;return this.bind(),f instanceof Promise?f.then(g=>this.setImageDataForFace(Object.assign({},t,{face:i,data:g,pixels:g}))):this.width||this.height?h.texImage2D(i,0,c,r,s,l,c,u,f):h.texImage2D(i,0,c,c,u,f),this}}return n.FACES=pI,n})();class qre extends Pf{get[Symbol.toStringTag](){return"Texture3D"}static isSupported(e){return Ci(e)}constructor(e,t={}){Ao(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:u,parameters:h={}}){return this._trackDeallocatedMemory("Texture"),this.gl.bindTexture(this.target,this.handle),hc(this.gl,h,()=>{ArrayBuffer.isView(u)&&this.gl.texImage3D(this.target,e,t,i,r,s,o,a,l,u),u instanceof lr&&(this.gl.bindBuffer(35052,u.handle),this.gl.texImage3D(this.target,e,t,i,r,s,o,a,l,c))}),this._trackAllocatedMemory(u&&u.byteLength?u.byteLength:this.width*this.height*this.depth*(nj[this.dataFormat]||4)*(ij[this.type]||1),"Texture"),this.loaded=!0,this}}function hj(n,e){on(n instanceof ya||n instanceof Wre||n instanceof qre);const t=n.constructor,{gl:i,width:r,height:s,format:o,type:a,dataFormat:l,border:c,mipmaps:u}=n;return new t(i,Object.assign({width:r,height:s,format:o,type:a,dataFormat:l,border:c,mipmaps:u},e))}function Yre(n,e){const{gl:t,width:i,height:r,id:s}=n;return new ks(t,Object.assign({},e,{id:`framebuffer-for-${s}`,width:i,height:r,attachments:{36064:n}}))}function px(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:u,deleteFramebuffer:h}=T0(n);on(u);const{gl:f,handle:g,attachments:m}=u;a=a||u.width,l=l||u.height,36064===s&&null===g&&(s=1028),on(m[s]),c=c||m[s].type,o=function(n,e,t,i,r){if(n)return n;return new(C0(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 on(!1),0}}(t))}(o,c,r,a,l),c=c||cI(o);const w=f.bindFramebuffer(36160,g);return f.readPixels(t,i,a,l,r,c,o),f.bindFramebuffer(36160,w||null),h&&u.delete(),o}function gI(n,{sourceAttachment:e=36064,targetMaxHeight:t=Number.MAX_SAFE_INTEGER}={}){let i=px(n,{sourceAttachment:e}),{width:r,height:s}=n;for(;s>t;)({data:i,width:r,height:s}=Ore({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 u in i){const h=i[u];(Array.isArray(h)?h[0]:h).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 on(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&&mn.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){on(void 0!==o,"Misspelled framebuffer binding point?");const a=Number(o),l=r[a];let c=l;if(c)if(c instanceof zg)this._attachRenderbuffer({attachment:a,renderbuffer:c});else if(Array.isArray(l)){const[u,h=0,f=0]=l;c=u,this._attachTexture({attachment:a,texture:u,layer:h,level:f})}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(ks.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)&&fI(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]}={}){Ao(n),hc(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:on(!1,uj)}})}(this.gl,{drawBuffer:l,value:a})}),this.gl.bindFramebuffer(36160,o||null),this}readPixels(e={}){return mn.error("Framebuffer.readPixels() is no logner supported, use readPixelsToArray(framebuffer)")(),null}readPixelsToBuffer(e={}){return mn.error("Framebuffer.readPixelsToBuffer()is no logner supported, use readPixelsToBuffer(framebuffer)")(),null}copyToDataUrl(e={}){return mn.error("Framebuffer.copyToDataUrl() is no logner supported, use copyToDataUrl(framebuffer)")(),null}copyToImage(e={}){return mn.error("Framebuffer.copyToImage() is no logner supported, use copyToImage(framebuffer)")(),null}copyToTexture(e={}){return mn.error("Framebuffer.copyToTexture({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null}blit(e={}){return mn.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=Ao(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=ch(this.gl,r)),r}getAttachmentParameters(e=36064,t,i=this.constructor.ATTACHMENT_PARAMETERS||[]){const r={};for(const s of i)r[t?ch(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?ch(this.gl,s):s]=this.getAttachmentParameters(s,e)}return i}show(){return"undefined"!=typeof window&&window.open(gI(this),"luma-debug-texture"),this}log(e=0,t=""){if(e>mn.level||"undefined"==typeof window)return this;t=t||`Framebuffer ${this.id}`;const i=gI(this,{targetMaxHeight:100});return mn.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 ya(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 zg(this.gl,{id:`${this.id}-depth-stencil`,format:35056,width:r,height:111}),this.ownResources.push(o[33306])):t?(o=o||{},o[36096]=new zg(this.gl,{id:`${this.id}-depth`,format:33189,width:r,height:s}),this.ownResources.push(o[36096])):i&&on(!1),o}_unattach(e){const t=this.attachments[e];!t||(t instanceof zg?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:Ao(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:on(!1,"Illegal texture type")}s.bindTexture(t.target,null),this.attachments[e]=t}_setReadBuffer(e){const t=function(n){return Ci(n)?n:null}(this.gl);t?t.readBuffer(e):on(36064===e||1029===e,fj),this.readBuffer=e}_setDrawBuffers(e){const{gl:t}=this,i=Ao(t);if(i)i.drawBuffers(e);else{const r=t.getExtension("WEBGL_draw_buffers");r?r.drawBuffersWEBGL(e):on(1===e.length&&(36064===e[0]||1029===e[0]),fj)}this.drawBuffers=e}_getAttachmentParameterFallback(e){const t=function(n){n.luma=n.luma||{},n.luma.caps=n.luma.caps||{};for(const e in pj)void 0===n.luma.caps[e]&&(n.luma.caps[e]=mj(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)}}ks.ATTACHMENT_PARAMETERS=[36049,36048,33296,33298,33299,33300,33301,33302,33303];const pj={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 ya(n,{format:6408,type:5126,dataFormat:6408}),t=new ks(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 mI(n,e){return gj(n,e)}function gj(n,e){return(e=Array.isArray(e)?e:[e]).every(t=>mj(n,t))}function mj(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=pj[e];let i;on(t,e);const r=Ci(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:on(!1);return i}(n,e)),n.luma.caps[e]||mn.log(2,`Feature: ${e} not supported`)(),n.luma.caps[e]}class _I{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()}},ose=1/Math.PI*180,ase=1/180*Math.PI,Dr={};function cse(n,{precision:e=Dr.precision||4}={}){return n=function(n){return Math.round(n/Dr.EPSILON)*Dr.EPSILON}(n),`${parseFloat(n.toPrecision(e))}`}function uh(n){return Array.isArray(n)||ArrayBuffer.isView(n)&&!(n instanceof DataView)}function Qu(n,e,t){if(uh(n)){t=t||function(n){return n.clone?n.clone():new Array(n.length)}(n);for(let i=0;it*ase,void 0)}(n)}function dse(n){return function(n,e){return Qu(n,t=>t*ose,void 0)}(n)}function Ua(n,e,t){return Qu(n,i=>Math.max(e,Math.min(t,i)))}function gx(n,e,t){return uh(n)?n.map((i,r)=>gx(i,e[r],t)):t*e+(1-t)*n}function M0(n,e,t){const i=Dr.EPSILON;t&&(Dr.EPSILON=t);try{if(n===e)return!0;if(uh(n)&&uh(e)){if(n.length!==e.length)return!1;for(let r=0;r0?", ":"")+cse(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&&(Rj.length=n.length,i=Rj):i=Oj,(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 Pj(n){return n&&n[Symbol.asyncIterator]}function xI(n,e=(()=>!0)){return Array.isArray(n)?Nj(n,e,[]):e(n)?[n]:[]}function Nj(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 kj(n,e){return n?(Number.isFinite(n)&&(n={duration:n}),n.type=n.type||"interpolation",ot(ot(ot({},Bse[n.type]),e),n)):null}function Fj(n,e){return e.getBuffer()?[e.getBuffer(),{divisor:0,size:e.size,normalized:e.settings.normalized}]:e.value}function Lj(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 Bj(n){n.push(n.shift())}function CI(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 Vj({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,u=r&&c,h=CI(t,e),f=t.state.constant;if(!u&&i>=h)return;const g=f?t.value:t.getBuffer().getData({srcByteOffset:l});if(t.settings.normalized&&!f){const U=s;s=(D,ie)=>t._normalizeConstant(U(D,ie))}const m=f?(U,D)=>s(g,D):(U,D)=>s(g.subarray(U,U+a),D),w=n.getData({length:i}),x=new Float32Array(h);(function({source:n,target:e,size:t,getData:i,sourceStartIndices:r,targetStartIndices:s}){if(!Array.isArray(s))return SI({source:n,target:e,size:t,getData:i}),e;let o=0,a=0;const l=i&&((u,h)=>i(u+a,h)),c=Math.min(r.length,s.length);for(let u=1;u(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===vx||(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=vx}clearNeedsUpdate(){this.state.needsUpdate=!1,this.state.updateRanges=kse}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!==vx}),!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,u]of s)o.call(r,this,{data:t,startRow:c,endRow:u,props:i,numInstances:e});if(this.value)if(this.constant||this.buffer.byteLength{if(!r){const x=h*a+l;for(let U=0;Uu?c.set(ie,w):(e._normalizeValue(ie,U.target,0),Nse({target:c,source:U.target,start:w,count:_e}));w+=_e*u}else e._normalizeValue(ie,c,w),w+=u}}_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 AI={};function Do(n){Ri.level>0&&AI[n]&&AI[n].call(...arguments)}function za(n,e){if(!n)throw new Error(e||"shadertools: assertion failed.")}const jj="out vec4 transform_output;\nvoid main() {\n transform_output = vec4(0);\n}",Use=`#version 300 es\n${jj}`;function Uj(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 zj(n={}){const{version:e=100,input:t,inputType:i,output:r}=n;if(!t)return 300===e?Use:e>300?`#version ${e}\n${jj}`:"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 za(!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 Hj extends Ku{get[Symbol.toStringTag](){return"TransformFeedback"}static isSupported(e){return Ci(e)}constructor(e,t={}){Ao(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,jg(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,mn.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 lr?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 $se{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 lr?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&&on(Ci(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 Hj(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],on(i[s]instanceof lr)}return{sourceBuffers:t,feedbackBuffers:i}}_createNewBuffer(e,t){const i=new lr(this.gl,t);return this.resources[e]&&this.resources[e].delete(),this.resources[e]=i,i}_getNextIndex(){return(this.currentIndex+1)%2}}function Gj(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 R0="vs",Yse={[R0]:"#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"},wx="__LUMA_INJECT_DECLARATIONS__",$j=/void\s+main\s*\([^)]*\)\s*\{\n?/,Wj=/}\n?[^{}]*$/,DI=[];function qj(n,e,t,i=!1){const r=e===R0;for(const s in t){const o=t[s];o.sort((l,c)=>l.order-c.order),DI.length=o.length;for(let l=0,c=o.length;ll+a));break;case"vs:#main-end":r&&(n=n.replace(Wj,l=>a+l));break;case"fs:#decl":r||(n=n.replace(wx,a));break;case"fs:#main-start":r||(n=n.replace($j,l=>l+a));break;case"fs:#main-end":r||(n=n.replace(Wj,l=>a+l));break;default:n=n.replace(s,l=>l+a)}}return n=n.replace(wx,""),i&&(n=n.replace(/\}\s*$/,s=>s+Yse[e])),n}function II(n){const e={};return za(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 Xse={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},Ex="transform_uSize_",Yj="transform_position";const ioe={10241:9728,10240:9728,10242:33071,10243:33071};class soe{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 h in this.samplerTextureMap)a[h]=i[this.samplerTextureMap[h]];this._setSourceTextureParameters();const u=function({sourceTextureMap:n,targetTextureVarying:e,targetTexture:t}){const i={};let r,s;e&&(({width:r,height:s}=t),i[`${Ex}${e}`]=[r,s]);for(const o in n)({width:r,height:s}=n[o]),i[`${Ex}${o}`]=[r,s];return i}({sourceTextureMap:i,targetTextureVarying:this.targetTextureVarying,targetTexture:s});Object.assign(a,u)}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=px(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 za(!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 lr(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 ks(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(ioe)}_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=hj(e,{parameters:{10241:9728,10240:9728,10242:33071,10243:33071},pixelStore:{37440:!1}});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 u=l.split("\n"),h=u.slice();if(u.forEach((f,g,m)=>{if(s>0){const w=function(n,e){const t={},i=function(n){return Uj(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=`${Ex}${n}`;return{samplerName:e,sizeName:t,uniformDeclerations:` uniform sampler2D ${e};\n uniform vec2 ${t};`}}(s),h=` ${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 za(!1),null}}(r)};\n`;return t[a]=s,{updatedLine:o,inject:{"vs:#decl":c,"vs:#main-start":h},samplerTextureMap:t}}return null}(f,e);if(w){const{updatedLine:x,inject:U}=w;h[g]=x,c=II([c,U]),Object.assign(a,w.samplerTextureMap),s--}}t&&!o&&(o=function(n,e){const t=Uj(n,["varying","out"]);return t&&t.name===e?t.type:null}(f,t))}),t){on(i);const f=`${Ex}${t}`;c=II([c,{"vs:#decl":`uniform vec2 ${f};\n`,"vs:#main-start":` vec2 ${Yj} = transform_getPos(${f});\n gl_Position = vec4(${Yj}, 0, 1.);\n`}])}l=h.join("\n")}return{vs:l,targetTextureType:o,inject:c,samplerTextureMap:a}}({vs:e.vs,sourceTextureMap:t,targetTextureVarying:this.targetTextureVarying,targetTexture:i}),c=II([e.inject||{},a]);return this.targetTextureType=o,this.samplerTextureMap=l,{vs:r,fs:e._fs||zj({version:Gj(r),input:this.targetTextureVarying,inputType:o,output:"transform_output"}),modules:this.hasSourceTextures||this.targetTextureVarying?[Xse].concat(e.modules||[]):e.modules,uniforms:s,inject:c}}}const OI={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 aoe(n){let e=Xj(n);return"object"===e?n?"type"in n?Object.assign({},n,OI[n.type]):"value"in n?(e=Xj(n.value),Object.assign({type:e},n,OI[e])):{type:"object",value:n}:{type:"object",value:null}:Object.assign({type:e,value:n},OI[e])}function Xj(n){return Array.isArray(n)||ArrayBuffer.isView(n)?"array":typeof n}class RI{constructor({name:e,vs:t,fs:i,dependencies:r=[],uniforms:s,getUniforms:o,deprecations:a=[],defines:l={},inject:c={},vertexShader:u,fragmentShader:h}){za("string"==typeof e),this.name=e,this.vs=t||u,this.fs=i||h,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=aoe(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:za(!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&&za(s.validate(e[r],s),`${this.name}: invalid ${r}`),t[r]=e[r]):t[r]=s.value}return t}}function doe(n){return function(n){const e={},t={};return PI({modules:n,level:0,moduleMap:e,moduleDepth:t}),Object.keys(t).sort((i,r)=>t[r]-t[i]).map(i=>e[i])}(Qj(n))}function PI({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 RI||(za("string"!=typeof t,`Shader module use by name is deprecated. Import shader module '${t}' and use it directly.`),za(t.name,"shader module has no name"),(t=new RI(t)).dependencies=Qj(t.dependencies)),t))}const NI={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]},kf={};function boe(n,e){return n.match(/NVIDIA/i)||e.match(/NVIDIA/i)?"NVIDIA":n.match(/INTEL/i)||e.match(/INTEL/i)?"INTEL":n.match(/AMD/i)||e.match(/AMD/i)||n.match(/ATI/i)||e.match(/ATI/i)?"AMD":"UNKNOWN GPU"}Object.keys(NI).forEach(n=>{kf[n]=n});const kI={};function Zj(n,e,t={}){const i=NI[e];if(za(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 kI)return kI[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),kI[e]=l,l}function xx(n,e){return(e=Array.isArray(e)?e:[e]).every(t=>function(n,e){const t=NI[e];za(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 za(!1===r||!0===r),r}(n,t))}function Gg(n){return new RegExp(`\\b${n}[ \\t]+(\\w+[ \\t]+\\w+(\\[\\w+\\])?;)`,"g")}const Jj=[[/^(#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("]],xoe=[...Jj,[Gg("attribute"),"in $1"],[Gg("varying"),"out $1"]],Soe=[...Jj,[Gg("varying"),"in $1"]],eU=[[/^#version[ \t]+300[ \t]+es/,"#version 100"],[/\btexture(2D|2DProj|Cube)Lod\(/g,"texture$1LodEXT("],[/\btexture\(/g,"texture2D("],[/\btextureLod\(/g,"texture2DLodEXT("]],Coe=[...eU,[Gg("in"),"attribute $1"],[Gg("out"),"varying $1"]],Toe=[...eU,[Gg("in"),"varying $1"]],FI="gl_FragColor",LI=/\bout[ \t]+vec4[ \t]+(\w+)[ \t]*;\n?/,Aoe=/void\s+main\s*\([^)]*\)\s*\{\n?/;function Sx(n,e){for(const[t,i]of e)n=n.replace(t,i);return n}const Ooe=`\n\n${wx}\n\n`,tU={[R0]:"vertex",fs:"fragment"};function nU(n,{id:e,source:t,type:i,modules:r,defines:s={},hookFunctions:o=[],inject:a={},transpileToGLSL100:l=!1,prologue:c=!0,log:u}){za("string"==typeof t,"shader source must be a string");const h=i===R0,f=t.split("\n");let g=100,m="",w=t;0===f[0].indexOf("#version ")?(g=300,m=f[0],w=f.slice(1).join("\n")):m=`#version ${g}`;const x={};r.forEach(Ne=>{Object.assign(x,Ne.getDefines())}),Object.assign(x,s);let U=c?`${m}\n${function({id:n,source:e,type:t}){return n&&"string"==typeof n&&-1===e.indexOf("SHADER_NAME")?`\n#define SHADER_NAME ${n}_${tU[t]}\n\n`:""}({id:e,source:t,type:i})}\n${function({type:n}){return`\n#define SHADER_TYPE_${tU[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:boe(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// 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"}}(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 xx(n,kf.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"),xx(n,kf.GLSL_DERIVATIVES)&&Zj(n,kf.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"),xx(n,kf.GLSL_FRAG_DATA)&&Zj(n,kf.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"),xx(n,kf.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}(x)}\n${h?"":"precision highp float;\n\n"}\n`:`${m}\n`;const D=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),ie={},_e={},Pe={};for(const Ne in a){const Ve="string"==typeof a[Ne]?{injection:a[Ne],order:0}:a[Ne],bt=Ne.match(/^(v|f)s:(#)?([\w-]+)$/);if(bt){const At=bt[3];bt[2]?"decl"===At?_e[Ne]=[Ve]:Pe[Ne]=[Ve]:ie[Ne]=[Ve]}else Pe[Ne]=[Ve]}for(const Ne of r){u&&Ne.checkDeprecations(w,u),U+=Ne.getModuleSource(i,g);const bt=Ne.injections[i];for(const xt in bt){const At=xt.match(/^(v|f)s:#([\w-]+)$/);if(At){const Wt="decl"===At[2]?_e:Pe;Wt[xt]=Wt[xt]||[],Wt[xt].push(bt[xt])}else ie[xt]=ie[xt]||[],ie[xt].push(bt[xt])}}return U+=Ooe,U=qj(U,i,_e),U+=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}(D[i],ie),U+=w,U=qj(U,i,Pe),U=function(n,e,t){switch(e){case 300:return t?Sx(n,xoe):function(n){const e=(n=Sx(n,Soe)).match(LI);if(e){const t=e[1];n=n.replace(new RegExp(`\\b${FI}\\b`,"g"),t)}else{const t="fragmentColor";n=n.replace(Aoe,i=>`out vec4 ${t};\n${i}`).replace(new RegExp(`\\b${FI}\\b`,"g"),t)}return n}(n);case 100:return t?Sx(n,Coe):function(n){const e=(n=Sx(n,Toe)).match(LI);if(e){const t=e[1];n=n.replace(LI,"").replace(new RegExp(`\\b${t}\\b`,"g"),FI)}return n}(n);default:throw new Error(`unknown GLSL version ${e}`)}}(U,l?100:g,h),U}function Noe(n){return function(t){const i={};for(const r of n){const s=r.getUniforms(t,i);Object.assign(i,s)}return i}}const joe={5126:Ir.bind(null,"uniform1fv",Ha,1,Io),35664:Ir.bind(null,"uniform2fv",Ha,2,Io),35665:Ir.bind(null,"uniform3fv",Ha,3,Io),35666:Ir.bind(null,"uniform4fv",Ha,4,Io),5124:Ir.bind(null,"uniform1iv",dh,1,Io),35667:Ir.bind(null,"uniform2iv",dh,2,Io),35668:Ir.bind(null,"uniform3iv",dh,3,Io),35669:Ir.bind(null,"uniform4iv",dh,4,Io),35670:Ir.bind(null,"uniform1iv",dh,1,Io),35671:Ir.bind(null,"uniform2iv",dh,2,Io),35672:Ir.bind(null,"uniform3iv",dh,3,Io),35673:Ir.bind(null,"uniform4iv",dh,4,Io),35674:Ir.bind(null,"uniformMatrix2fv",Ha,4,Ju),35675:Ir.bind(null,"uniformMatrix3fv",Ha,9,Ju),35676:Ir.bind(null,"uniformMatrix4fv",Ha,16,Ju),35678:oo,35680:oo,5125:Ir.bind(null,"uniform1uiv",Cx,1,Io),36294:Ir.bind(null,"uniform2uiv",Cx,2,Io),36295:Ir.bind(null,"uniform3uiv",Cx,3,Io),36296:Ir.bind(null,"uniform4uiv",Cx,4,Io),35685:Ir.bind(null,"uniformMatrix2x3fv",Ha,6,Ju),35686:Ir.bind(null,"uniformMatrix2x4fv",Ha,8,Ju),35687:Ir.bind(null,"uniformMatrix3x2fv",Ha,6,Ju),35688:Ir.bind(null,"uniformMatrix3x4fv",Ha,12,Ju),35689:Ir.bind(null,"uniformMatrix4x2fv",Ha,8,Ju),35690:Ir.bind(null,"uniformMatrix4x3fv",Ha,12,Ju),35678:oo,35680:oo,35679:oo,35682:oo,36289:oo,36292:oo,36293:oo,36298:oo,36299:oo,36300:oo,36303:oo,36306:oo,36307:oo,36308:oo,36311:oo},Uoe={},zoe={},Hoe={},iU=[0];function BI(n,e,t,i){1===e&&"boolean"==typeof n&&(n=n?1:0),Number.isFinite(n)&&(iU[0]=n,n=iU);const r=n.length;if(r%e&&mn.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 Ir(n,e,t,i){let r=null,s=null;return(o,a,l)=>{const c=e(l,t),u=c.length;let h=!1;if(null===r)r=new Float32Array(u),s=u,h=!0;else{on(s===u,"Uniform length cannot change.");for(let f=0;f{const a=String(o+e);return aU(a,r-a.length)+t+s})}(e);return{shaderName:l,errors:oU(s,c),warnings:oU(o,c)}}(i,this.source,this.shaderType,this.id);throw mn.error(`GLSL compilation errors in ${r}\n${s}`)(),mn.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 VI extends P0{get[Symbol.toStringTag](){return"VertexShader"}constructor(e,t){"string"==typeof t&&(t={source:t}),super(e,Object.assign({},t,{shaderType:35633}))}_createHandle(){return this.gl.createShader(35633)}}class jI extends P0{get[Symbol.toStringTag](){return"FragmentShader"}constructor(e,t){"string"==typeof t&&(t={source:t}),super(e,Object.assign({},t,{shaderType:35632}))}_createHandle(){return this.gl.createShader(35632)}}const Fs=5126,N0=5124,k0=5125,UI={[Fs]:[Fs,1,"float"],35664:[Fs,2,"vec2"],35665:[Fs,3,"vec3"],35666:[Fs,4,"vec4"],[N0]:[N0,1,"int"],35667:[N0,2,"ivec2"],35668:[N0,3,"ivec3"],35669:[N0,4,"ivec4"],[k0]:[k0,1,"uint"],36294:[k0,2,"uvec2"],36295:[k0,3,"uvec3"],36296:[k0,4,"uvec4"],35670:[Fs,1,"bool"],35671:[Fs,2,"bvec2"],35672:[Fs,3,"bvec3"],35673:[Fs,4,"bvec4"],35674:[Fs,8,"mat2"],35685:[Fs,8,"mat2x3"],35686:[Fs,8,"mat2x4"],35675:[Fs,12,"mat3"],35687:[Fs,12,"mat3x2"],35688:[Fs,12,"mat3x4"],35676:[Fs,16,"mat4"],35689:[Fs,16,"mat4x2"],35690:[Fs,16,"mat4x3"]};function fU(n){const e=UI[n];if(!e)return null;const[t,i]=e;return{type:t,components:i}}function pU(n,e){switch(n){case 5120:case 5121:case 5122:case 5123:n=Fs}for(const t in UI){const[i,r,s]=UI[t];if(i===n&&r===e)return{glType:t,name:s}}return null}class Aae{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(!Ci(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}=fU(i),a={type:s,size:r*o};this._inferProperties(e,t,a);const l={location:e,name:t,accessor:new _a(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}=fU(i),l={location:e,name:t,accessor:new _a({type:s,size:r*o})};this.varyingInfos.push(l),this.varyingInfosByName[l.name]=l}}const Mae=35981,Dae=["setVertexArray","setAttributes","setBuffers","unsetBuffers","use","getUniformCount","getUniformInfo","getUniformLocation","getUniformValue","getVarying","getFragDataLocation","getAttachedShaders","getAttributeCount","getAttributeLocation","getAttributeInfo"];class mU extends Ku{get[Symbol.toStringTag](){return"Program"}constructor(e,t={}){super(e,t),this.stubRemovedMethods("Program","v6.0",Dae),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=Mae}=e;return this.hash=t||"",this.vs="string"==typeof i?new VI(this.gl,{id:`${e.id}-vs`,source:i}):i,this.fs="string"==typeof r?new jI(this.gl,{id:`${e.id}-fs`,source:r}):r,on(this.vs instanceof VI),on(this.fs instanceof jI),this.uniforms={},this._textureUniforms={},s&&s.length>0&&(Ao(this.gl),this.varyings=s,this.gl2.transformFeedbackVaryings(this.handle,s,o)),this._compileAndLink(),this._readUniformLocationsFromLinkedProgram(),this.configuration=new Aae(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:u=c>0,vertexArray:h=null,transformFeedback:f,framebuffer:g,parameters:m={},uniforms:w,samplers:x}){if((w||x)&&(mn.deprecated("Program.draw({uniforms})","Program.setUniforms(uniforms)")(),this.setUniforms(w||{})),mn.priority>=e){const U=g?g.id:"default",D=`mode=${ch(this.gl,t)} verts=${i} instances=${c} indexType=${ch(this.gl,l)} isInstanced=${u} isIndexed=${a} Framebuffer=${U}`;mn.log(e,D)()}return on(h),this.gl.useProgram(this.handle),!(!this._areTexturesRenderable()||0===i||u&&0===c||(h.bindForDraw(i,c,()=>{if(void 0!==g&&(m=Object.assign({},m,{framebuffer:g})),f){const U=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 on(!1),0}}(t);f.begin(U)}this._bindTextures(),hc(this.gl,m,()=>{a&&u?this.gl2.drawElementsInstanced(t,i,l,r,c):a&&Ci(this.gl)&&!isNaN(s)&&!isNaN(o)?this.gl2.drawRangeElements(t,s,o,i,l,r):a?this.gl.drawElements(t,i,l,r):u?this.gl2.drawArraysInstanced(t,r,i,c):this.gl.drawArrays(t,r,i)}),f&&f.end()}),0))}setUniforms(e={}){mn.priority>=2&&function(n,e,t){for(const i in n){const r=n[i];if((!t||Boolean(t[i]))&&!Woe(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 ks&&(s=s.texture),s instanceof Pf)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)&&qoe(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 VI({handle:r});break;case 35632:i.fs=new jI({handle:r})}return i}_getParameter(e){return this.gl.getProgramParameter(this.handle,e)}_setId(e){if(!e){const t=this._getName();this.id=ma(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),mn.time(4,`linkProgram for ${this._getName()}`)(),e.linkProgram(this.handle),mn.timeEnd(4,`linkProgram for ${this._getName()}`)(),e.debug||mn.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),u=this._getHash(t),h=this._getHash(i),f=c.map(ie=>this._getHash(ie.name)).sort(),g=o.map(ie=>this._getHash(ie)),m=Object.keys(r).sort(),w=Object.keys(s).sort(),x=[],U=[];for(const ie of m)x.push(this._getHash(ie)),x.push(this._getHash(r[ie]));for(const ie of w)U.push(this._getHash(ie)),U.push(this._getHash(s[ie]));const D=`${u}/${h}D${x.join("/")}M${f.join("/")}I${U.join("/")}V${g.join("/")}H${this.stateHash}B${a}${l?"T":""}`;if(!this._programCache[D]){const ie=function(n,e){const{vs:t,fs:i}=e,r=doe(e.modules||[]);return{gl:n,vs:nU(n,Object.assign({},e,{source:t,type:R0,modules:r})),fs:nU(n,Object.assign({},e,{source:i,type:"fs",modules:r})),getUniforms:Noe(r)}}(this.gl,{vs:t,fs:i,modules:c,inject:s,defines:r,hookFunctions:this._hookFunctions,transpileToGLSL100:l});this._programCache[D]=new mU(this.gl,{hash:D,vs:ie.vs,fs:ie.fs,varyings:o,bufferMode:a}),this._getUniforms[D]=ie.getUniforms||(_e=>{}),this._useCounts[D]=0}return this._useCounts[D]++,this._programCache[D]}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":v0.chrome?"Chrome":v0.safari?"Safari":v0.mozInnerScreenX?"Firefox":"Unknown"}()}static getDefaultArray(e){return e.luma=e.luma||{},e.luma.defaultVertexArray||(e.luma.defaultVertexArray=new Ga(e,{handle:null,isDefaultArray:!0})),e.luma.defaultVertexArray}static getMaxAttributes(e){return Ga.MAX_ATTRIBUTES=Ga.MAX_ATTRIBUTES||e.getParameter(34921),Ga.MAX_ATTRIBUTES}static setConstant(e,t,i){switch(i.constructor){case Float32Array:Ga._setConstantFloatArray(e,t,i);break;case Int32Array:Ga._setConstantIntArray(e,t,i);break;case Uint32Array:Ga._setConstantUintArray(e,t,i);break;default:on(!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 Ga.getMaxAttributes(this.gl)}initialize(e={}){return this.setProps(e)}setProps(e){return this}setElementBuffer(e=null,t={}){return on(!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:u}=i,{gl:h,gl2:f}=this;return e=Number(e),this.bind(()=>{h.bindBuffer(34962,t.handle),c?(on(Ci(h)),f.vertexAttribIPointer(e,r,s,o,a)):h.vertexAttribPointer(e,r,s,l,o,a),h.enableVertexAttribArray(e),f.vertexAttribDivisor(e,u||0)}),this}enable(e,t=!0){return!t&&0===e&&!Ga.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 lr(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(!Mx||Mx.byteLength{switch(e){case 34373:return this.gl.getVertexAttribOffset(t,e);default:return this.gl.getVertexAttrib(t,e)}})}}const Fae=/^(.+)__LOCATION_([0-9]+)$/,Lae=["setBuffers","setGeneric","clearBindings","setLocations","setGenericValues","setDivisor","enable","disable"];class Bae{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 Ga(e),JV(this,"VertexArray","v6.0",Lae),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 lr(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,mn.once(3,()=>`unused value ${e} in ${this.id}`)(),s;const l=this._getAttributeInfo(a||o);if(!l)return s;const u=_a.resolve(l.accessor,this.accessors[o]||{},i,r),{size:h,type:f}=u;return on(Number.isFinite(h)&&Number.isFinite(f)),{location:o,accessor:u}}_getAttributeInfo(e){return this.configuration&&this.configuration.getAttributeInfo(e)}_getAttributeIndex(e){const t=Number(e);if(Number.isFinite(t))return{location:t};const i=Fae.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 lr)this.setBuffer(e,t);else if(Array.isArray(t)&&t.length&&t[0]instanceof lr)this.setBuffer(e,t[0],t[1]);else if(ArrayBuffer.isView(t)||Array.isArray(t))this.setConstant(e,t);else{if(!(t.buffer instanceof lr))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 lr){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 mn.deprecated("setElements","setElementBuffer")(),this.setElementBuffer(e,t)}}function L0(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+=L0(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 _U(n,e,t,i){const{gl:r}=n;if(!e)return{[i]:"null","Format ":"N/A"};let c,u,h,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 lr){const f=e,{data:g,changed:m}=f.getDebugData();let w;return u=m?"*":"",h=g,l=f.byteLength,a=l/g.BYTES_PER_ELEMENT/o,t?w=`${t.divisor>0?"I ":"P "} ${a} (x${o}=${l} bytes ${ch(r,s)})`:(c=!0,w=`${l} bytes`),{[i]:`${u}${L0(h,{size:o,isInteger:c})}`,"Format ":w}}return h=e,o=e.length,s=String(e.constructor.name).replace("Array",""),c=-1!==s.indexOf("nt"),{[i]:`${L0(h,{size:o,isInteger:c})} (constant)`,"Format ":`${o}x${s} (constant)`}}function Uae(n,e){const{type:t,size:i}=e,r=pU(t,i);return r?`${n} (${r.name})`:n}function yU({header:n="Uniforms",program:e,uniforms:t,undefinedOnly:i=!1}){on(e);const s=".*Matrix",a={},l=Object.keys(e._uniformSetters).sort();let c=0;for(const f of l)!f.match(".*_.*")&&!f.match(s)&&zI({table:a,header:n,uniforms:t,uniformName:f,undefinedOnly:i})&&c++;for(const f of l)f.match(s)&&zI({table:a,header:n,uniforms:t,uniformName:f,undefinedOnly:i})&&c++;for(const f of l)a[f]||zI({table:a,header:n,uniforms:t,uniformName:f,undefinedOnly:i})&&c++;let u=0;const h={};if(!i)for(const f in t){const g=t[f];a[f]||(u++,h[f]={Type:`NOT USED: ${g}`,[n]:L0(g)})}return{table:a,count:c,unusedTable:h,unusedCount:u}}function zI({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?L0(s):"N/A","Uniform Type":o?s:"NOT PROVIDED"},0))}function bU(n){const{type:e,size:t}=n.accessor,i=pU(e,t);return i?`${i.name} ${n.name}`:n.name}const Gae={POSITION:"positions",NORMAL:"normals",COLOR_0:"colors",TEXCOORD_0:"texCoords",TEXCOORD_1:"texCoords1",TEXCOORD_2:"texCoords2"};function Wae(n,e){const{attributeMap:t=Gae}=e||{};return t&&t[n]||n}function qae(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}on(Number.isFinite(e.size),`attribute ${n} needs size`)}const vU=()=>{},Kae={};class Yg{constructor(e,t={}){const{id:i=ma("model")}=t;on(dx(e)),this.id=i,this.gl=e,this.id=t.id||ma("Model"),this.lastLogTime=0,this.animated=!1,this.initialize(t)}initialize(e){this.props={},this.programManager=e.programManager||F0.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:u}=e;this.programProps={program:t,vs:i,fs:r,modules:s,defines:o,inject:a,varyings:l,bufferMode:c,transpileToGLSL100:u},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={},on(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:u}=e;this.programProps={program:t,vs:i,fs:r,modules:s,defines:o,inject:a,varyings:l,bufferMode:c,transpileToGLSL100:u},this._programDirty=!0}getUniforms(){return this.uniforms}setDrawMode(e){return this.drawMode=e,this}setVertexCount(e){return on(Number.isFinite(e)),this.vertexCount=e,this}setInstanceCount(e){return on(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=Wae(s,undefined);if("indices"===s)r=o;else if(o.constant)i[a]=o.value;else{const l=o.value,c=ot({},o);delete c.value,i[a]=[new lr(n,l),c],qae(s,c)}}if(r){const s=r.value||r;on(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 lr(n,{data:s,target:34963}),o]}return i}(this.gl,e),this.vertexArray.setAttributes(this.geometryBuffers),this}setAttributes(e={}){if(jg(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 fI(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),mn.priority>=2&&(c=this._logDrawCallStart(2));const u=this.vertexArray.getDrawParams(),{isIndexed:h=u.isIndexed,indexType:f=u.indexType,indexOffset:g=u.indexOffset,vertexArrayInstanced:m=u.isInstanced}=this.props;m&&!this.isInstanced&&mn.warn("Found instanced attributes on non-instanced model",this.id)();const{isInstanced:w,instanceCount:x}=this,{onBeforeRender:U=vU,onAfterRender:D=vU}=this.props;U(),this.program.setUniforms(this.uniforms);const ie=this.program.draw(Object.assign(Kae,e,{logPriority:c,uniforms:null,framebuffer:i,parameters:a,drawMode:this.getDrawMode(),vertexCount:this.getVertexCount(),vertexArray:l,transformFeedback:o,isIndexed:h,indexType:f,isInstanced:w,instanceCount:x,offset:h?g:0}));return D(),mn.priority>=2&&this._logDrawCallEnd(c,l,i),ie}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 mn.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:u}=this.programProps;t=this.programManager.get({vs:i,fs:r,modules:s,inject:o,defines:a,varyings:l,bufferMode:c,transpileToGLSL100:u}),this.program&&this._managedProgram&&this.programManager.release(this.program),this._programManagerState=this.programManager.stateHash,this._managedProgram=!0}on(t instanceof mU,"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 Bae(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 lr&&t.delete()}}_setAnimationProps(e){this.animated&&on(e,"Model.draw(): animated uniforms but no animationProps")}_setFeedbackBuffers(e={}){if(jg(e))return this;const{gl:t}=this.program;return this.transformFeedback=this.transformFeedback||new Hj(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:mn.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=_U(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}: ${Uae(s.name,a)}`),t[o]=_U(n,i[r],a,e)}}return t}({vertexArray:t,header:`${this.id} attributes`,attributes:this._attributes}),{table:o,unusedTable:a,unusedCount:l}=yU({header:`${this.id} uniforms`,program:this.program,uniforms:Object.assign({},this.program.uniforms,i)}),{table:c,count:u}=yU({header:`${this.id} uniforms`,program:this.program,uniforms:Object.assign({},this.program.uniforms,i),undefinedOnly:!0});u>0&&mn.log("MISSING UNIFORMS",Object.keys(c))(),l>0&&mn.log("UNUSED UNIFORMS",Object.keys(a))();const h=function(n){const e={},t=`Accessors for ${n.id}`;for(const i of n.attributeInfos)i&&(e[`in ${bU(i)}`]={[t]:JSON.stringify(i.accessor)});for(const i of n.varyingInfos)i&&(e[`out ${bU(i)}`]={[t]:JSON.stringify(i.accessor)});return e}(this.vertexArray.configuration);mn.table(e,s)(),mn.table(e,o)(),mn.table(e+1,h)(),r&&r.log({logLevel:2,message:`Rendered to ${r.id}`}),mn.groupEnd(2,`>>> DRAWING MODEL ${this.id}`)()}}class HI{static isSupported(e){return Ci(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();on(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 Yg(t,Object.assign({},e,{fs:e.fs||zj({version:Gj(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!(jg(n.feedbackBuffers)&&jg(n.feedbackMap)&&!(n.varyings&&n.varyings.length>0))})(t)&&(this.bufferTransform=new $se(e,t)),function(n){return!(jg(n._sourceTextures)&&!n._targetTexture&&!n._targetTextureVarying)}(t)&&(this.textureTransform=new soe(e,t)),on(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 Dx(){}const Jae={onStart:Dx,onUpdate:Dx,onInterrupt:Dx,onEnd:Dx};class B0{constructor(e){this._inProgress=!1,this._handle=null,this.timeline=e,this.settings={}}get inProgress(){return this._inProgress}start(e){this.cancel(),this.settings=ot(ot({},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 ale={interpolation:class{constructor({gl:e,attribute:t,timeline:i}){this.gl=e,this.type="interpolation",this.transition=new B0(i),this.attribute=t,this.attributeInTransition=new TI(e,t.settings),this.currentStartIndices=t.startIndices,this.currentLength=0,this.transform=function(n,e){const t=Lj(e.size);return new HI(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 lr(e,r),new lr(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;Bj(r);const o={numInstances:t,attribute:s,fromLength:this.currentLength,fromStartIndices:this.currentStartIndices,getData:e.enter};for(const a of r)Vj(ot({buffer:a},o));this.currentStartIndices=s.startIndices,this.currentLength=CI(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:Fj(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 B0(i),this.attribute=t,this.attributeInTransition=new TI(e,Sn(ot({},t.settings),{normalized:!1})),this.currentStartIndices=t.startIndices,this.currentLength=0,this.texture=function(n){return new ya(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 ks(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=Lj(e.size);return new HI(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 lr(e,r),new lr(e,r),new lr(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)Vj(ot({buffer:a},o));this.currentStartIndices=s.startIndices,this.currentLength=CI(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:Fj(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]}}),Bj(e),this.attributeInTransition.update({buffer:e[1],value:this.attribute.value}),px(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 lle{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=HI.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 Ri.warn("WebGL2 not supported by this browser. Transition for ".concat(e," is disabled."))();r&&this._removeTransition(e);const o=ale[i.type];o?this.transitions[e]=new o({attribute:t,timeline:this.timeline,gl:this.gl}):(Ri.error("unsupported transition type '".concat(i.type,"'"))(),s=!1)}(s||t.needsRedraw())&&(this.needsRedraw=!0,this.transitions[e].start(i,this.numInstances))}}const wU="attributeManager.invalidate";class ple{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 lle(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;Do("attribute.updateStart",t),t.allocate(i)&&Do("attribute.allocate",t,i),t.updateBuffer(e)&&(this.needsRedraw=!0,Do("attribute.updateEnd",t,i))}}function xU(n,e,t,i,r){const s=e-n;return(t-e)*r+-s*i+s+e}function SU(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=kj(r)))return;const o=yle[r.type];if(!o)return void Ri.error("unsupported transition type '".concat(r.type,"'"))();const a=new o(this.timeline);a.start(Sn(ot({},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 Ix={COMPONENT:Symbol.for("component"),ASYNC_DEFAULTS:Symbol.for("asyncPropDefaults"),ASYNC_ORIGINAL:Symbol.for("asyncPropOriginal"),ASYNC_RESOLVED:Symbol.for("asyncPropResolved")},{COMPONENT:vle}=Ix;function xle(n,e){if(!n.transitions)return null;const t={},i=$I(n);for(const r in n.transitions){const s=i[r],o=s&&s.type;("number"===o||"color"===o||"array"===o)&&GI(n[r],e[r],s)&&(t[r]=!0)}return t}function CU({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=GI(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=GI(n[s],e[s],i[s]);if(o)return"".concat(r,".").concat(s," ").concat(o)}}return null}function GI(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 Tle(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(!Rle(i[r],e[r])){t=n(i),e=i;break}return t}}function Ple(n,e){if(!e)return n;const t=ot(ot({},n),e);if("defines"in e&&(t.defines=ot(ot({},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=ot({},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 WI(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],u=e[8],h=e[9],f=e[10],g=e[11],m=e[12],w=e[13],x=e[14],U=e[15],D=t*a-i*o,ie=t*l-r*o,_e=t*c-s*o,Pe=i*l-r*a,Ne=i*c-s*a,Ve=r*c-s*l,bt=u*w-h*m,xt=u*x-f*m,At=u*U-g*m,Bt=h*x-f*w,Wt=h*U-g*w,gt=f*U-g*x,mt=D*gt-ie*Wt+_e*Bt+Pe*At-Ne*xt+Ve*bt;return mt?(n[0]=(a*gt-l*Wt+c*Bt)*(mt=1/mt),n[1]=(r*Wt-i*gt-s*Bt)*mt,n[2]=(w*Ve-x*Ne+U*Pe)*mt,n[3]=(f*Ne-h*Ve-g*Pe)*mt,n[4]=(l*At-o*gt-c*xt)*mt,n[5]=(t*gt-r*At+s*xt)*mt,n[6]=(x*_e-m*Ve-U*ie)*mt,n[7]=(u*Ve-f*_e+g*ie)*mt,n[8]=(o*Wt-a*At+c*bt)*mt,n[9]=(i*At-t*Wt-s*bt)*mt,n[10]=(m*Ne-w*_e+U*D)*mt,n[11]=(h*_e-u*Ne-g*D)*mt,n[12]=(a*xt-o*Bt-l*bt)*mt,n[13]=(t*Bt-i*xt+r*bt)*mt,n[14]=(w*ie-m*Pe-x*D)*mt,n[15]=(u*Pe-h*ie+f*D)*mt,n):null}function Ff(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],u=e[7],h=e[8],f=e[9],g=e[10],m=e[11],w=e[12],x=e[13],U=e[14],D=e[15],ie=t[0],_e=t[1],Pe=t[2],Ne=t[3];return n[0]=ie*i+_e*a+Pe*h+Ne*w,n[1]=ie*r+_e*l+Pe*f+Ne*x,n[2]=ie*s+_e*c+Pe*g+Ne*U,n[3]=ie*o+_e*u+Pe*m+Ne*D,n[4]=(ie=t[4])*i+(_e=t[5])*a+(Pe=t[6])*h+(Ne=t[7])*w,n[5]=ie*r+_e*l+Pe*f+Ne*x,n[6]=ie*s+_e*c+Pe*g+Ne*U,n[7]=ie*o+_e*u+Pe*m+Ne*D,n[8]=(ie=t[8])*i+(_e=t[9])*a+(Pe=t[10])*h+(Ne=t[11])*w,n[9]=ie*r+_e*l+Pe*f+Ne*x,n[10]=ie*s+_e*c+Pe*g+Ne*U,n[11]=ie*o+_e*u+Pe*m+Ne*D,n[12]=(ie=t[12])*i+(_e=t[13])*a+(Pe=t[14])*h+(Ne=t[15])*w,n[13]=ie*r+_e*l+Pe*f+Ne*x,n[14]=ie*s+_e*c+Pe*g+Ne*U,n[15]=ie*o+_e*u+Pe*m+Ne*D,n}function Rx(n,e,t){var o,a,l,c,u,h,f,g,m,w,x,U,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],u=e[4],h=e[5],f=e[6],g=e[7],m=e[8],w=e[9],x=e[10],U=e[11],n[0]=o=e[0],n[1]=a,n[2]=l,n[3]=c,n[4]=u,n[5]=h,n[6]=f,n[7]=g,n[8]=m,n[9]=w,n[10]=x,n[11]=U,n[12]=o*i+u*r+m*s+e[12],n[13]=a*i+h*r+w*s+e[13],n[14]=l*i+f*r+x*s+e[14],n[15]=c*i+g*r+U*s+e[15]),n}function Px(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 AU(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],u=e[9],h=e[10],f=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+u*i,n[6]=a*r+h*i,n[7]=l*r+f*i,n[8]=c*r-s*i,n[9]=u*r-o*i,n[10]=h*r-a*i,n[11]=f*r-l*i,n}function MU(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],u=e[5],h=e[6],f=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+u*i,n[2]=a*r+h*i,n[3]=l*r+f*i,n[4]=c*r-s*i,n[5]=u*r-o*i,n[6]=h*r-a*i,n[7]=f*r-l*i,n}function IU(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 Nx(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 OU(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],u=c*i+a*s-l*r,h=c*r+l*i-o*s,f=c*s+o*r-a*i,g=-o*i-a*r-l*s;return n[0]=u*c+g*-o+h*-l-f*-a,n[1]=h*c+g*-a+f*-o-u*-l,n[2]=f*c+g*-l+u*-a-h*-o,n[3]=e[3],n}!function(){var n=new ba(4);ba!=Float32Array&&(n[0]=0,n[1]=0,n[2]=0,n[3]=0)}();const RU=[0,0,0,0],rce=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0],sce=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],oce=[0,0,0],ace=[0,0,0],lce=Ox(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=RU,l=RU,c=n.cameraPosition;const{geospatialOrigin:u,shaderCoordinateOrigin:h,offsetMode:f}=PU(n,e,t);return f&&(l=n.projectPosition(u||h),c=[c[0]-l[0],c[1]-l[1],c[2]-l[2]],l[3]=1,a=Nx([],l,o),s=i||s,o=Ff([],r,s),o=Ff([],o,rce)),{viewMatrix:s,viewProjectionMatrix:o,projectionCenter:a,originCommon:l,cameraPosCommon:c,shaderCoordinateOrigin:h,geospatialOrigin:u}}(n,t,i),u=n.getDistanceScales(),h=[n.width*e,n.height*e],f=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:h,project_uDevicePixelRatio:e,project_uFocalDistance:f,project_uCommonUnitsPerMeter:u.unitsPerMeter,project_uCommonUnitsPerWorldUnit:u.unitsPerMeter,project_uCommonUnitsPerWorldUnit2:oce,project_uScale:n.scale,project_uViewProjectionMatrix:s,project_uCameraPosition:a};if(c){const m=n.getDistanceScales(c);switch(t){case Vi.METER_OFFSETS:g.project_uCommonUnitsPerWorldUnit=m.unitsPerMeter,g.project_uCommonUnitsPerWorldUnit2=m.unitsPerMeter2;break;case Vi.LNGLAT:case Vi.LNGLAT_OFFSETS:g.project_uCommonUnitsPerWorldUnit=m.unitsPerDegree,g.project_uCommonUnitsPerWorldUnit2=m.unitsPerDegree2;break;case Vi.CARTESIAN:g.project_uCommonUnitsPerWorldUnit=[1,1,m.unitsPerMeter[2]],g.project_uCommonUnitsPerWorldUnit2=[0,0,m.unitsPerMeter2[2]]}}return g});function PU(n,e,t=ace){let r,i=t,s=!0;switch(r=e===Vi.LNGLAT_OFFSETS||e===Vi.METER_OFFSETS?t:n.isGeospatial?[Math.fround(n.longitude),Math.fround(n.latitude),0]:null,n.projectionMode){case Zc.WEB_MERCATOR:(e===Vi.LNGLAT||e===Vi.CARTESIAN)&&(s=!1);break;case Zc.WEB_MERCATOR_AUTO_OFFSET:e===Vi.LNGLAT?i=r:e===Vi.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 Zc.IDENTITY:i=n.position.map(Math.fround);break;case Zc.GLOBE:s=!1,r=null;break;default:s=!1}return i[2]=i[2]||0,{geospatialOrigin:r,shaderCoordinateOrigin:i,offsetMode:s}}class hce extends mx{get ELEMENTS(){return Zu(!1),0}get RANK(){return Zu(!1),0}toString(){let e="[";if(Dr.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 qn).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 function(n,e,t,i,r){var o,s=1/Math.tan(e/2);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)}(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],u=n[9],h=n[10],f=n[11],g=n[12],m=n[13],w=n[14],x=n[15];return(e*o-t*s)*(h*x-f*w)-(e*a-i*s)*(u*x-f*m)+(e*l-r*s)*(u*w-h*m)+(t*a-i*o)*(c*x-f*g)-(t*l-r*o)*(c*w-h*g)+(i*l-r*a)*(c*m-u*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 WI(this,this),this.check()}multiplyLeft(e){return Ff(this,e,this),this.check()}multiplyRight(e){return Ff(this,this,e),this.check()}rotateX(e){return AU(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],u=e[9],h=e[10],f=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-u*i,n[2]=a*r-h*i,n[3]=l*r-f*i,n[8]=s*i+c*r,n[9]=o*i+u*r,n[10]=a*i+h*r,n[11]=l*i+f*r}(this,this,e),this.check()}rotateZ(e){return MU(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,u,h,f,g,m,w,x,U,D,ie,_e,Pe,Ne,Ve,bt,xt,At,Bt,Wt,gt,mt,jt,r=i[0],s=i[1],o=i[2],a=Math.hypot(r,s,o);at?t:n}const qI=Math.log2||function(n){return Math.log(n)*Math.LOG2E};function ed(n,e){if(!n)throw new Error(e||"@math.gl/web-mercator: assertion failed.")}const pc=Math.PI,VU=pc/4,gc=pc/180,YI=180/pc,XI=4003e4,Fx=85.051129;function Lx([n,e]){return ed(Number.isFinite(n)),ed(Number.isFinite(e)&&e>=-90&&e<=90,"invalid latitude"),[512*(n*gc+pc)/(2*pc),512*(pc+Math.log(Math.tan(VU+e*gc*.5)))/(2*pc)]}function Zg([n,e]){const t=n/512*(2*pc)-pc,i=2*(Math.atan(Math.exp(e/512*(2*pc)-pc))-VU);return[t*YI,i*YI]}function KI({latitude:n,longitude:e,highPrecision:t=!1}){ed(Number.isFinite(n)&&Number.isFinite(e));const i={},s=Math.cos(n*gc),o=512/360,a=o/s,l=512/XI/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=gc*Math.tan(n*gc)/s,h=512/XI*c,f=h/a*l;i.unitsPerDegree2=[0,o*c/2,h],i.unitsPerMeter2=[f,0,f]}return i}function jU(n,e){const[t,i,r]=n,[s,o,a]=e,{unitsPerMeter:l,unitsPerMeter2:c}=KI({longitude:t,latitude:i,highPrecision:!0}),u=Lx(n);u[0]+=s*(l[0]+c[0]*o),u[1]+=o*(l[1]+c[1]*o);const h=Zg(u),f=(r||0)+(a||0);return Number.isFinite(r)||Number.isFinite(a)?[h[0],h[1],f]:h}function zU(n){return 2*Math.atan(.5/n)*YI}function HU(n,e){const[t,i,r=0]=n;return ed(Number.isFinite(t)&&Number.isFinite(i)&&Number.isFinite(r)),Qg(e,[t,i,r,1])}function j0(n,e,t=0){const[i,r,s]=n;if(ed(Number.isFinite(i)&&Number.isFinite(r),"invalid pixel coordinate"),Number.isFinite(s))return Qg(e,[i,r,s,1]);const o=Qg(e,[i,r,0,1]),a=Qg(e,[i,r,1,1]),l=o[2],c=a[2];return kU([],o,a,l===c?0:((t||0)-l)/(c-l))}const GU=Math.PI/180;function $U(n,e,t){const{pixelUnprojectionMatrix:i}=n,r=Qg(i,[e,0,1,1]),s=Qg(i,[e,n.height,1,1]),c=Zg(kU([],r,s,(t*n.distanceScales.unitsPerMeter[2]-r[2])/(s[2]-r[2])));return c[2]=t,c}const Dce=Math.PI/180,Ice=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],ZI=[0,0,0],Rce={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?Zc.WEB_MERCATOR:Zc.WEB_MERCATOR_AUTO_OFFSET:Zc.IDENTITY}equals(t){return t instanceof n&&(this===t||t.width===this.width&&t.height===this.height&&t.scale===this.scale&&M0(t.projectionMatrix,this.projectionMatrix)&&M0(t.viewMatrix,this.viewMatrix))}project(t,{topLeft:i=!0}={}){const s=HU(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,u=j0([s,i?o:this.height-o,a],this.pixelUnprojectionMatrix,r&&r*this.distanceScales.unitsPerMeter[2]),[h,f,g]=this.unprojectPosition(u);return Number.isFinite(a)?[h,f,g]:Number.isFinite(r)?[h,f,r]:[h,f]}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?Lx(t):t}unprojectFlat(t){return this.isGeospatial?Zg(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?KI({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:u=!1,repeat:h=!1,worldOffset:f=0}=t;let{width:g,height:m,altitude:w=1.5}=t;const x=Math.pow(2,s);g=g||1,m=m||1,w=Math.max(.75,w);const{fov:U,aspect:D,focalDistance:ie,near:_e,far:Pe}=function({width:n,height:e,fovy:t=zU(1.5),altitude:i,pitch:r=0,nearZMultiplier:s=1,farZMultiplier:o=1}){void 0!==i&&(t=zU(i));const a=.5*t*gc,l=function(n){return.5/Math.tan(.5*n*gc)}(t),c=r*gc,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:n/e,focalDistance:l,near:s,far:(Math.sin(c)*u+l)*o}}({width:g,height:m,pitch:o,altitude:w,nearZMultiplier:l,farZMultiplier:c});let Ne=function({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 Rx(o,o,[0,0,-i]),AU(o,o,-e*gc),MU(o,o,t*gc),Px(o,o,[r/=n,r,r]),s&&Rx(o,o,function(n,e){return n[0]=-e[0],n[1]=-e[1],n[2]=-e[2],n}([],s)),o}({height:m,pitch:o,bearing:a,scale:x,altitude:w});f&&(Ne=(new qn).translate([512*f,0,0]).multiplyLeft(Ne)),super(Sn(ot({},t),{width:g,height:m,viewMatrix:Ne,longitude:r,latitude:i,zoom:s,orthographic:u,fovyRadians:U,aspect:D,focalDistance:ie,near:_e,far:Pe})),this.latitude=i,this.longitude=r,this.zoom=s,this.pitch=o,this.bearing=a,this.altitude=w,this.orthographic=u,this._subViewports=h?[]: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(Sn(ot({},this),{worldOffset:s})):this;this._subViewports.push(o)}}return this._subViewports}addMetersToLngLat(t,i){return jU(t,i)}panByPosition(t,i){const r=j0(i,this.pixelUnprojectionMatrix),o=kx([],this.projectFlat(t),NU([],r)),a=kx([],this.center,o),[l,c]=this.unprojectFlat(a);return{longitude:l,latitude:c}}getBounds(t={}){const i=function(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*GU:Math.atan(.5/n.altitude))>(90-n.pitch)*GU-.01?(l=$U(n,0,e),c=$U(n,t,e)):(l=r([0,0],s),c=r([t,0],s)),[o,a,c,l]}(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}=function({width:n,height:e,bounds:t,minExtent:i=0,maxZoom:r=24,padding:s=0,offset:o=[0,0]}){const[[a,l],[c,u]]=t;Number.isFinite(s)?s={top:s,bottom:s,left:s,right:s}:ed(Number.isFinite(s.top)&&Number.isFinite(s.bottom)&&Number.isFinite(s.left)&&Number.isFinite(s.right));const h=Lx([a,BU(u,-Fx,Fx)]),f=Lx([c,BU(l,-Fx,Fx)]),g=[Math.max(Math.abs(f[0]-h[0]),i),Math.max(Math.abs(f[1]-h[1]),i)],m=[n-s.left-s.right-2*Math.abs(o[0]),e-s.top-s.bottom-2*Math.abs(o[1])];ed(m[0]>0&&m[1]>0);const w=m[0]/g[0],x=m[1]/g[1],_e=Zg([(f[0]+h[0])/2+(s.right-s.left)/2/w,(f[1]+h[1])/2+(s.bottom-s.top)/2/x]),Pe=Math.min(r,qI(Math.abs(Math.min(w,x))));return ed(Number.isFinite(Pe)),{longitude:_e[0],latitude:_e[1],zoom:Pe}}(ot({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 JI(n,e,t=!1){const i=e.projectPosition(n);if(t&&e instanceof KU){const[r,s,o=0]=n,a=e.getDistanceScales([r,s]);i[2]=o*a.unitsPerMeter[2]}return i}function QU(n,{viewport:e,modelMatrix:t,coordinateSystem:i,coordinateOrigin:r,offsetMode:s}){let[o,a,l=0]=n;switch(t&&([o,a,l]=Nx([],[o,a,l,1],t)),i){case Vi.LNGLAT:return JI([o,a,l],e,s);case Vi.LNGLAT_OFFSETS:return JI([o+r[0],a+r[1],l+(r[2]||0)],e,s);case Vi.METER_OFFSETS:return JI(jU(r,[o,a,l]),e,s);case Vi.CARTESIAN:default:return e.isGeospatial?[o+r[0],a+r[1],l+r[2]]:e.projectPosition([o,a,l])}}const kce={10241:9987,10240:9729,10242:33071,10243:33071},eO={},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||z0(n)&&(3===n.length||4===n.length),equal:(n,e,t)=>tO(n,e)},accessor:{validate(n,e){const t=Bx(n);return"function"===t||t===Bx(e.value)},equal:(n,e,t)=>"function"==typeof e||tO(n,e)},array:{validate:(n,e)=>e.optional&&!n||z0(n),equal:(n,e,t)=>t.compare?tO(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 ya)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 ya(t,Sn(ot({},e),{parameters:ot(ot(ot({},kce),i),n.props.textureParameters)}));return eO[r.id]=!0,r}(t,n),release:n=>{!function(n){!n||!(n instanceof ya)||eO[n.id]&&(n.delete(),delete eO[n.id])}(n)}}};function tO(n,e){if(n===e)return!0;if(!z0(n)||!z0(e))return!1;const t=n.length;if(t!==e.length)return!1;for(let i=0;i{},this.oldProps=Qce,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[Xce]||{},i=e[Yce]||e,r=e[Kce]||{};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(Pj(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 li(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 h,c=!0,u=!1;try{for(var g,m,f=iO(t);c=(g=yield f.next()).done,m=yield g.value,!c;c=!0){const x=m,{dataTransform:U}=i.component?i.component.props:{};a=U?U(x,a):a.concat(x),Object.defineProperty(a,"__diff",{enumerable:!1,value:[{startRow:l,endRow:a.length}]}),l=a.length,i._setAsyncPropValue(e,a,o)}}catch(x){u=!0,h=x}finally{try{!c&&null!=f.return&&(yield f.return())}finally{if(u)throw h}}const w=null===(r=i.layer)||void 0===r?void 0:r.props.onDataLoad;w&&w(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:tz,ASYNC_RESOLVED:nz,ASYNC_DEFAULTS:Zce}=Ix,Jce={};let eue=0,tue=(()=>{class n{constructor(){this.props=Uce.apply(this,arguments),this.id=this.props.id,this.count=eue++,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[Zce])s in i[nz]?r[s]=i[nz][s]:s in i[tz]&&(r[s]=i[tz][s]);return new this.constructor(ot(ot(ot({},i),r),t))}get stats(){return this.internalState.stats}_initState(){this.internalState=new ez({})}}return n.componentName="Component",n.defaultProps=Jce,n})();class nue extends ez{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 mc=n=>"function"==typeof n,hh=n=>null!==n&&"object"==typeof n,rz=n=>hh(n)&&n.constructor==={}.constructor,iue=n=>n&&"function"==typeof n[Symbol.iterator],rue=n=>n&&"function"==typeof n[Symbol.asyncIterator],G0=n=>"undefined"!=typeof Response&&n instanceof Response||n&&n.arrayBuffer&&n.text&&n.json,em=n=>"undefined"!=typeof Blob&&n instanceof Blob,sz=n=>(n=>"undefined"!=typeof ReadableStream&&n instanceof ReadableStream||hh(n)&&mc(n.tee)&&mc(n.cancel)&&mc(n.getReader))(n)||(n=>hh(n)&&mc(n.read)&&mc(n.pipe)&&(n=>"boolean"==typeof n)(n.readable))(n);function Lf(n,e){if(!n)throw new Error(e||"loader assertion failed.")}function rO(n){var e;return!!n&&(Array.isArray(n)&&(n=n[0]),Array.isArray(null===(e=n)||void 0===e?void 0:e.extensions))}function sO(n){var e,t;let i;return Lf(n,"null loader"),Lf(rO(n),"invalid loader"),Array.isArray(n)&&(i=n[1],n=Sn(ot({},n=n[0]),{options:ot(ot({},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 tu={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},oO=tu.global||tu.self||tu.window||{},uue="object"!=typeof process||"[object process]"!==String(process)||process.browser,oz="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version);oz&&parseFloat(oz[1]);const lO={};function due(n){for(const e in lO)n.startsWith(e)&&(n=n.replace(e,lO[e]));return!n.startsWith("http://")&&!n.startsWith("https://")&&(n=`${n}`),n}const hue=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,fue=/^([-\w.]+\/[-\w.+]+)/;function pue(n){const e=fue.exec(n);return e?e[1]:n}function az(n){const e=hue.exec(n);return e?e[1]:""}const gue=/\?.*/;function zx(n){if(G0(n)){const e=cO(n.url||"");return{url:e,type:pue(n.headers.get("content-type")||"")||az(e)}}return em(n)?{url:cO(n.name||""),type:n.type||""}:"string"==typeof n?{url:cO(n),type:az(n)}:{url:"",type:""}}function mue(n){return G0(n)?n.headers["content-length"]||-1:em(n)?n.size:"string"==typeof n?n.length:n instanceof ArrayBuffer||ArrayBuffer.isView(n)?n.byteLength:-1}function cO(n){return n.replace(gue,"")}function lz(n){return uO.apply(this,arguments)}function uO(){return(uO=li(function*(n){if(G0(n))return n;const e={},t=mue(n);t>=0&&(e["content-length"]=String(t));const{url:i,type:r}=zx(n);r&&(e["content-type"]=r);const s=yield bue(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 _ue(n){return dO.apply(this,arguments)}function dO(){return(dO=li(function*(n){if(!n.ok){const e=yield yue(n);throw new Error(e)}})).apply(this,arguments)}function yue(n){return hO.apply(this,arguments)}function hO(){return(hO=li(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 bue(n){return fO.apply(this,arguments)}function fO(){return(fO=li(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,${vue(n.slice(0,5))}`:null})).apply(this,arguments)}function vue(n){let e="";const t=new Uint8Array(n);for(let i=0;i{}}info(){return()=>{}}warn(){return()=>{}}error(){return()=>{}}}const dz={fetch:null,mimeType:void 0,nothrow:!1,log:new class{constructor(){Kn(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:[]},xue={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 gO(){oO.loaders=oO.loaders||{};const{loaders:n}=oO;return n._state=n._state||{},n._state}const mO=()=>{const n=gO();return n.globalOptions=n.globalOptions||ot({},dz),n.globalOptions};function Sue(n,e,t,i){return t=t||[],function(n,e){fz(n,null,dz,xue,e);for(const t of e)fz(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=ot({},n.options||{});return function(n,e){e&&!("baseUri"in n)&&(n.baseUri=e)}(r,t),null===r.log&&(r.log=new wue),gz(r,mO()),gz(r,e),r}(e,n,i)}function hz(n,e){const t=mO(),i=n||t;return"function"==typeof i.fetch?i.fetch:hh(i.fetch)?r=>cz(r,i):null!=e&&e.fetch?null==e?void 0:e.fetch:cz}function fz(n,e,t,i,r){const s=e||"Top level",o=e?`${e}.`:"";for(const a in n){const l=!e&&hh(n[a]),c="baseUri"===a&&!e,u="workerUrl"===a&&e;if(!(a in t)&&!c&&!u)if(a in i)uz.warn(`${s} loader option '${o}${a}' no longer supported, use '${i[a]}'`)();else if(!l){const h=Tue(a,r);uz.warn(`${s} loader option '${o}${a}' not recognized. ${h}`)()}}}function Tue(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 gz(n,e){for(const t in e)t in e&&(n[t]=rz(e[t])&&rz(n[t])?ot(ot({},n[t]),e[t]):e[t])}function nu(n,e){if(!n)throw new Error(e||"loaders.gl assertion failed.")}function Due(n,e="3.0.12"){return nu(n,"no worker provided"),!(!e||!n.version)}const iu={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},Iue=iu.global||iu.self||iu.window||{},_O="object"!=typeof process||"[object process]"!==String(process)||process.browser,yO="function"==typeof importScripts,Oue="undefined"!=typeof window&&void 0!==window.orientation,mz="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version),bO=(mz&&parseFloat(mz[1]),new Map);function _z(n){const e=new Blob([n],{type:"application/javascript"});return URL.createObjectURL(e)}function yz(n,e=!0,t){const i=t||new Set;if(n)if(bz(n))i.add(n);else if(bz(n.buffer))i.add(n.buffer);else if(!ArrayBuffer.isView(n)&&e&&"object"==typeof n)for(const r in n)yz(n[r],e,i);return void 0===t?Array.from(i):[]}function bz(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 vO=()=>{};class vz{static isSupported(){return"undefined"!=typeof Worker}constructor(e){Kn(this,"name",void 0),Kn(this,"source",void 0),Kn(this,"url",void 0),Kn(this,"terminated",!1),Kn(this,"worker",void 0),Kn(this,"onMessage",void 0),Kn(this,"onError",void 0),Kn(this,"_loadableURL","");const{name:t,source:i,url:r}=e;nu(i||r),this.name=t,this.source=i,this.url=r,this.onMessage=vO,this.onError=s=>console.log(s),this.worker=this._createBrowserWorker()}destroy(){this.onMessage=vO,this.onError=vO,this.worker.terminate(),this.terminated=!0}get isRunning(){return Boolean(this.onMessage)}postMessage(e,t){t=t||yz(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){nu(n.source&&!n.url||!n.source&&n.url);let e=bO.get(n.source||n.url);return e||(n.url&&(e=function(n){return n.startsWith("http")?_z(function(n){return`try {\n importScripts('${n}');\n} catch (error) {\n console.error(error);\n throw error;\n}`}(n)):n}(n.url),bO.set(n.url,e)),n.source&&(e=_z(n.source),bO.set(n.source,e))),nu(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 kue{constructor(e,t){Kn(this,"name",void 0),Kn(this,"workerThread",void 0),Kn(this,"isRunning",void 0),Kn(this,"result",void 0),Kn(this,"_resolve",void 0),Kn(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){nu(this.isRunning),this.isRunning=!1,this._resolve(e)}error(e){nu(this.isRunning),this.isRunning=!1,this._reject(e)}}class Fue{constructor(e){Kn(this,"name","unnamed"),Kn(this,"source",void 0),Kn(this,"url",void 0),Kn(this,"maxConcurrency",1),Kn(this,"maxMobileConcurrency",1),Kn(this,"onDebug",()=>{}),Kn(this,"reuseWorkers",!0),Kn(this,"props",{}),Kn(this,"jobQueue",[]),Kn(this,"idleQueue",[]),Kn(this,"count",0),Kn(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=ot(ot({},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 li(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 li(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 kue(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 td{static isSupported(){return vz.isSupported()}static getWorkerFarm(e={}){return td._workerFarm=td._workerFarm||new td({}),td._workerFarm.setProps(e),td._workerFarm}constructor(e){Kn(this,"props",void 0),Kn(this,"workerPools",new Map),this.props=ot({},Lue),this.setProps(e),this.workerPools=new Map}destroy(){for(const e of this.workerPools.values())e.destroy()}setProps(e){this.props=ot(ot({},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 Fue({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 Vue(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 nu(r),r}function jue(n,e){return!!td.isSupported()&&n.worker&&(null==e?void 0:e.worker)}function Uue(n,e,t,i,r){return wO.apply(this,arguments)}function wO(){return(wO=li(function*(n,e,t,i,r){const s=n.id,o=Vue(n,t),l=td.getWorkerFarm(t).getWorkerPool({name:s,url:o});t=JSON.parse(JSON.stringify(t));const c=yield l.startJob("process-on-worker",zue.bind(null,r));return c.postMessage("process",{input:e,options:t}),yield(yield c.result).result})).apply(this,arguments)}function zue(n,e,t,i){return EO.apply(this,arguments)}function EO(){return(EO=li(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)}Kn(td,"_workerFarm",void 0);var Ez=et(9521);function xz(n){if(function(n){return n&&"object"==typeof n&&n.isBuffer}(n)&&(n=function(n){return Ez.toArrayBuffer?Ez.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 Wue(...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 Sz(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 que(n){return SO.apply(this,arguments)}function SO(){return(SO=li(function*(n){const e=[];var r,t=!0,i=!1;try{for(var o,a,s=iO(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 Wue(...e)})).apply(this,arguments)}const Kue=262144;function Cz(n){this.wrapped=n}function $0(n){return new Cz(n)}function W0(n){var e,t;function r(o,a){try{var l=n[o](a),c=l.value,u=c instanceof Cz;Promise.resolve(u?c.wrapped:c).then(function(h){u?r("return"===o?"return":"next",h):s(l.done?"return":"normal",h)},function(h){r("throw",h)})}catch(h){s("throw",h)}}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 u={key:o,arg:a,resolve:l,reject:c,next:null};t?t=t.next=u:(e=t=u,r(o,a))})},"function"!=typeof n.return&&(this.return=void 0)}function TO(n){return function(){return new W0(n.apply(this,arguments))}}function AO(){return(AO=TO(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(IO)}function rde(n,e,t){return OO.apply(this,arguments)}function OO(){return(OO=li(function*(n,e,t){const i=n instanceof ArrayBuffer||ArrayBuffer.isView(n);if("string"==typeof n||i)return ide(n,e);if(em(n)&&(n=yield lz(n)),G0(n)){const r=n;return yield _ue(r),e.binary?yield r.arrayBuffer():yield r.text()}if(sz(n)&&(n=nde(n,t)),iue(n)||rue(n))return que(n);throw new Error(IO)})).apply(this,arguments)}function ode(n,e,t=null){if(t)return t;const i=ot({fetch:hz(e,n)},n);return Array.isArray(i.loaders)||(i.loaders=null),i}function ade(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 Az=()=>{const n=gO();return n.loaderRegistry=n.loaderRegistry||[],n.loaderRegistry};function Mz(n){const e=Az();n=Array.isArray(n)?n:[n];for(const t of n){const i=sO(t);e.find(r=>i===r)||e.unshift(i)}}const cde=/\.([^.]+)$/;function ude(n){return NO.apply(this,arguments)}function NO(){return(NO=li(function*(n,e=[],t,i){if(!Iz(n))return null;let r=Dz(n,e,Sn(ot({},t),{nothrow:!0}),i);if(r)return r;if(em(n)&&(r=Dz(n=yield n.slice(0,10).arrayBuffer(),e,t,i)),!(r||null!=t&&t.nothrow))throw new Error(Oz(n));return r})).apply(this,arguments)}function Dz(n,e=[],t,i){if(!Iz(n))return null;if(e&&!Array.isArray(e))return sO(e);let r=[];e&&(r=r.concat(e)),null!=t&&t.ignoreRegisteredLoaders||r.push(...Az()),function(n){for(const e of n)sO(e)}(r);const s=function(n,e,t,i){const{url:r,type:s}=zx(n),o=r||(null==i?void 0:i.url);let a=null;return null!=t&&t.mimeType&&(a=kO(e,null==t?void 0:t.mimeType)),a=a||function(n,e){const t=e&&cde.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||kO(e,s),a=a||function(n,e){if(!e)return null;for(const t of n)if("string"==typeof e){if(mde(e,t))return t}else if(ArrayBuffer.isView(e)){if(Rz(e.buffer,e.byteOffset,t))return t}else if(e instanceof ArrayBuffer&&Rz(e,0,t))return t;return null}(e,n),a=a||kO(e,null==t?void 0:t.fallbackMimeType),a}(n,r,t,i);if(!(s||null!=t&&t.nothrow))throw new Error(Oz(n));return s}function Iz(n){return!(n instanceof Response&&204===n.status)}function Oz(n){const{url:e,type:t}=zx(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)?FO(n.buffer,n.byteOffset,e):n instanceof ArrayBuffer?FO(n,0,e):""}(n)}", contentType: "${t}"`),e&&(i+=` url: ${e}`),i}function kO(n,e){for(const t of n)if(t.mimeTypes&&t.mimeTypes.includes(e)||e===`application/x.${t.id}`)return t;return null}function mde(n,e){return e.testText?e.testText(n):(Array.isArray(e.tests)?e.tests:[e.tests]).some(i=>n.startsWith(i))}function Rz(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 ru=new Uint8ClampedArray(0);const Ade={data:{type:"data",value:Cde,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=Sn(ot({},r),{fetch:Sn(ot({},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:q0(n,i),persistent:!1}),l=!0),l?o.subscribe({resourceId:n,onChange:c=>t.internalState.reloadAsyncProp(e,c),consumerId:t.id,requestId:e}):q0(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:Vi.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 Y0=(()=>{class n extends tue{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=QU(t,{viewport:i,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem}),[s,o,a]=HU(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=ot({},n);let{coordinateSystem:t}=n;const{viewport:i,coordinateOrigin:r,fromCoordinateSystem:s,fromCoordinateOrigin:o}=n;return t===Vi.DEFAULT&&(t=i.isGeospatial?Vi.LNGLAT:Vi.CARTESIAN),void 0===s&&(e.fromCoordinateSystem=t),void 0===o&&(e.fromCoordinateOrigin=r),e.coordinateSystem=t,e}(e),{geospatialOrigin:l,shaderCoordinateOrigin:c,offsetMode:u}=PU(t,i,r),h=QU(n,{viewport:t,modelMatrix:s,coordinateSystem:o,coordinateOrigin:a,offsetMode:u});u&&function(n,e,t){n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2]}(h,h,t.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===Vi.DEFAULT||t===Vi.LNGLAT||t===Vi.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){fc(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=Ple(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 u of c)o.invalidateAll(u);else o.invalidateAll()}const l=i.highlightedObjectIndex>=0||i.pickable;if((t.highlightedObjectIndex>=0||t.pickable)!==l&&o){const{pickingColors:c,instancePickingColors:u}=o.attributes,h=c||u;h&&(l&&h.constant&&(h.constant=!1,o.invalidate(h.id)),!h.value&&!l&&(h.constant=!0,h.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||!Tde({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(ru.length/3);if(this.internalState.usesPickingColorCache=!0,rPz&&Ri.warn("Layer has too many data objects. Picking might not be able to distinguish all objects.")(),ru=A0.allocate(ru,i,{size:3,copy:!0,maxCount:Math.max(i,Pz)});const s=Math.floor(ru.length/3),o=[];for(let a=r;a{const c={moduleParameters:t,uniforms:i,parameters:r,context:this.context};for(const u of this.props.extensions)u.draw.call(this,c,u);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&&Do("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=CU({newProps:n,oldProps:e,propTypes:$I(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&&TU(n,e,"all"))return{all:!0};const t={};let i=!1;for(const r in n.updateTriggers)"all"!==r&&TU(n,e,r)&&(t[r]=!0,i=t);return i}(n,e)),{dataChanged:i,propsChanged:t,updateTriggersChanged:r,extensionsChanged:Tle(n,e),transitionsChanged:xle(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=$I(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 ple(this.context.gl,{id:this.props.id,stats:this.context.stats,timeline:this.context.timeline})}_initState(){fc(!this.internalState&&!this.state),fc(isFinite(this.props.coordinateSystem));const t=this._getAttributeManager();t&&t.addInstanced({instancePickingColors:{type:5121,size:3,noAlloc:!0,update:this.calculateInstancePickingColors}}),this.internalState=new nue({attributeManager:t,layer:this}),this.clearChangeFlags(),this.state={},Object.defineProperty(this.state,"attributeManager",{get:()=>(Ri.deprecated("layer.state.attributeManager","layer.getAttributeManager()"),t)}),this.internalState.layer=this,this.internalState.uniformTransitions=new ble(this.context.timeline),this.internalState.onAsyncPropUpdated=this._onAsyncPropUpdated.bind(this),this.internalState.setAsyncProps(this.props)}_transferState(t){Do("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=Ade,n})(),Nz=(()=>{class n extends Y0{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:u,coordinateSystem:h,coordinateOrigin:f,wrapLongitude:g,positionFormat:m,modelMatrix:w,extensions:x,fetch:U,_subLayerProps:D}=this.props,ie={opacity:i,pickable:r,visible:s,parameters:o,getPolygonOffset:a,highlightedObjectIndex:l,autoHighlight:c,highlightColor:u,coordinateSystem:h,coordinateOrigin:f,wrapLongitude:g,positionFormat:m,modelMatrix:w,extensions:x,fetch:U},_e=D&&D[t.id],Pe=_e&&_e.updateTriggers,Ne=t.id||"sublayer";if(_e){const Ve=this.constructor._propTypes,bt=t.type?t.type._propTypes:{};for(const xt in _e){const At=bt[xt]||Ve[xt];At&&"accessor"===At.type&&(_e[xt]=this.getSubLayerAccessor(_e[xt]))}}Object.assign(ie,t,_e),ie.id="".concat(this.props.id,"-").concat(Ne),ie.updateTriggers=ot(ot({all:this.props.updateTriggers.all},t.updateTriggers),Pe);for(const Ve of x){const bt=Ve.getSubLayerProps.call(this,Ve);bt&&Object.assign(ie,bt,{updateTriggers:Object.assign(ie.updateTriggers,bt.updateTriggers)})}return ie}_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=xI(t,Boolean),this.internalState.subLayers=t),Do("compositeLayer.renderLayers",this,i,t);for(const r of t)r.parent=this}}return n.layerName="CompositeLayer",n})();const Dde=/([0-9]+\.?[0-9]*)(%|px)/;function Gx(n){switch(typeof n){case"number":return{position:n,relative:!1};case"string":const e=n.match(Dde);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 $x(n,e){return n.relative?Math.round(n.position*e):n.position}function X0(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)&&X0(i,r)))return!1}return!0}class jO{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:u=1e3,modelMatrix:h=null,viewportInstance:f=null,type:g=Jg}=e;fc(!f||f instanceof Jg),this.viewportInstance=f,this.id=t||this.constructor.displayName||"view",this.type=g,this.props=Sn(ot({},e),{id:this.id,projectionMatrix:a,fovy:l,near:c,far:u,modelMatrix:h}),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):X0(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=ot({},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:$x(this._x,e),y:$x(this._y,t),width:$x(this._width,e),height:$x(this._height,t)}}_getControllerProps(e){let t=this.props.controller;return t?!0===t?e:("function"==typeof t&&(t={type:t}),ot(ot({},e),t)):null}_getViewport(e,t){const{type:i}=this;return new i(ot(ot(ot({},e),this.props),t))}_parseDimensions({x:e,y:t,width:i,height:r}){this._x=Gx(e),this._y=Gx(t),this._width=Gx(i),this._height=Gx(r)}}const K0=()=>{},kz={transitionEasing:n=>n,transitionInterruption:1,onTransitionStart:K0,onTransitionInterrupt:K0,onTransitionEnd:K0};class Ide{constructor(e,t={}){this.ControllerState=e,this.props=ot(ot({},kz),t),this.propsInTransition=null,this.transition=new B0(t.timeline),this.onViewStateChange=t.onViewStateChange||K0,this.onStateChange=t.onStateChange||K0,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=ot(ot({},kz),e),this.props=e,this._shouldIgnoreViewportChange(i,e))return t;if(this._isTransitionEnabled(e)){const{interruption:r,endProps:s}=this.transition.settings,o=ot(ot({},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(ot(ot({},this.props),c)).getViewportProps(),this.onViewStateChange({viewState:this.propsInTransition,oldViewState:this.props})}}const Fz=["longitude","latitude","zoom","bearing","pitch"],Rde=["longitude","latitude","zoom"];class Lz 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)||!M0(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];fc(Number.isFinite(i)||Array.isArray(i),"".concat(t," is required for transition"))})}}{constructor(e={}){super((Array.isArray(e)?e:e.transitionProps)||{compare:Fz,extract:Fz,required:Rde}),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]=gx(e[s]||0,t[s]||0,i);if(t.aroundPosition){const s=this.opts.makeViewport(ot(ot({},t),r));Object.assign(r,s.panByPosition(t.aroundPosition,gx(e.around,t.around,i)))}return r}}const fh={transitionDuration:0},Pde={transitionDuration:300,transitionEasing:n=>n,transitionInterruption:1},qx=n=>1-(1-n)*(1-n),tm_WHEEL=["wheel"],tm_PAN=["panstart","panmove","panend"],tm_PINCH=["pinchstart","pinchmove","pinchend"],tm_TRIPLE_PAN=["tripanstart","tripanmove","tripanend"],tm_DOUBLE_TAP=["doubletap"],tm_KEYBOARD=["keydown"];class UO{constructor(e,t={}){this.ControllerState=e,this.controllerState=null,this.controllerStateProps=null,this.eventManager=null,this.transitionManager=new Ide(e,Sn(ot({},t),{onViewStateChange:this._onTransition.bind(this),onStateChange:this._setInteractionState.bind(this)}));const i=this.linearTransitionProps;this._transition=i&&Sn(ot({},Pde),{transitionInterpolator:new Lz({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(ot(ot({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,u=Boolean(this.onViewStateChange);this.toggleEvents(tm_WHEEL,u&&i),this.toggleEvents(tm_PAN,u&&(r||s)),this.toggleEvents(tm_PINCH,u&&(a||l)),this.toggleEvents(tm_TRIPLE_PAN,u&&l),this.toggleEvents(tm_DOUBLE_TAP,u&&o),this.toggleEvents(tm_KEYBOARD,u&&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=ot(ot({},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,fh,{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,fh,{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,Sn(ot({},this._getTransitionProps()),{transitionDuration:t,transitionEasing:qx}),{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,fh,{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,Sn(ot({},this._getTransitionProps()),{transitionDuration:t,transitionEasing:qx}),{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,Sn(ot({},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,fh,{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,fh,{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,Sn(ot({},this._getTransitionProps()),{transitionDuration:t,transitionEasing:qx}),{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,fh,{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,fh,{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,Sn(ot({},this._getTransitionProps({around:r})),{transitionDuration:t,transitionEasing:qx}),{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?Sn(ot({},t),{transitionInterpolator:new Lz(Sn(ot({},e),{transitionProps:this.linearTransitionProps,makeViewport:this.controllerState.makeViewport}))}):t:fh}}class Bz{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 ph_target=[0,0,0];class Yx extends Bz{constructor({makeViewport:e,width:t,height:i,rotationX:r=0,rotationOrbit:s=0,target:o=ph_target,zoom:a=0,minRotationX:l=-90,maxRotationX:c=90,minZoom:u=-(1/0),maxZoom:h=Infinity,startPanPosition:f,startRotatePos:g,startRotationX:m,startRotationOrbit:w,startZoomPosition:x,startZoom:U}){super({width:t,height:i,rotationX:r,rotationOrbit:s,target:o,zoom:a,minRotationX:l,maxRotationX:c,minZoom:u,maxZoom:h}),this._state={startPanPosition:f,startRotatePos:g,startRotationX:m,startRotationOrbit:w,startZoomPosition:x,startZoom:U},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 u=(e[0]-r[0])/a;(s<-90||s>90)&&(u*=-1),c={rotationX:s+(e[1]-r[1])/l*180,rotationOrbit:o+180*u}}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=ot({},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(Sn(ot({},this._viewportProps),{zoom:a}));return this._getUpdatedState(ot({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),Ua(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 Yx(ot(ot(ot({},this._viewportProps),this._state),e))}_applyConstraints(e){const{maxZoom:t,minZoom:i,zoom:r,maxRotationX:s,minRotationX:o,rotationOrbit:a}=e;return e.zoom=Ua(r,i,t),e.rotationX=Ua(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 kde extends UO{constructor(e){super(Yx,e)}get linearTransitionProps(){return["target","zoom","rotationX","rotationOrbit"]}}class Fde extends UO{constructor(e){e.dragMode=e.dragMode||"pan",super(Yx,e)}_onPanRotate(e){return!1}get linearTransitionProps(){return["target","zoom"]}}const Lde=(new qn).lookAt({eye:[0,0,1]});function Bde({width:n,height:e,near:t,far:i}){return n=n||1,e=e||1,(new qn).ortho({left:-n/2,right:n/2,bottom:-e/2,top:e/2,near:t,far:i})}class Vde 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(Sn(ot({},e),{longitude:null,position:a,viewMatrix:Lde.clone().scale([c,c*(l?-1:1),c]),projectionMatrix:Bde({width:t,height:i,near:r,far:s}),zoom:o}))}panByPosition(e,t){const r=kx([],e,NU([],j0(t,this.pixelUnprojectionMatrix)));return{target:kx([],this.center,r)}}}let jde=(()=>{class n extends jO{constructor(t){super(Sn(ot({},t),{type:Vde}))}get controller(){return this._getControllerProps({type:Fde})}}return n.displayName="OrthographicView",n})();const Xx=Math.PI/180;function Ude({height:n,fovy:e,orbitAxis:t,rotationX:i,rotationOrbit:r,zoom:s}){const o=.5/Math.tan(e*Xx/2),a="Z"===t?[0,0,1]:[0,1,0],l="Z"===t?[0,-o,0]:[0,0,o],c=(new qn).lookAt({eye:l,up:a});c.rotateX(i*Xx),"Z"===t?c.rotateZ(r*Xx):c.rotateY(r*Xx);const u=Math.pow(2,s)/(n||1);return c.scale(u),c}class zde 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(Sn(ot({},e),{longitude:null,viewMatrix:Ude({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]=j0([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 Hde=(()=>{class n extends jO{constructor(t={}){const{orbitAxis:i="Z"}=t;super(Sn(ot({},t),{orbitAxis:i,type:zde}))}get controller(){return this._getControllerProps({type:kde})}}return n.displayName="OrbitView",n})();const Gde=[255,255,255],$de=1;let Wde=0;class Vz{constructor(e={}){const{color:t=Gde}=e,{intensity:i=$de}=e;this.id=e.id||"ambient-".concat(Wde++),this.color=t,this.intensity=i,this.type="ambient"}}const qde=[255,255,255],Yde=1,Xde=[0,0,-1];let Kde=0;class jz{constructor(e={}){const{color:t=qde}=e,{intensity:i=Yde}=e,{direction:r=Xde}=e,{_shadow:s=!1}=e;this.id=e.id||"directional-".concat(Kde++),this.color=t,this.intensity=i,this.type="directional",this.direction=new Mo(r).normalize().toArray(),this.shadow=s}getProjectedLight(){return this}}class Uz{constructor(e={}){const{id:t="effect"}=e;this.id=t,this.props=ot({},e)}preRender(){}getModuleParameters(){}cleanup(){}}class zO extends class{constructor(e,t={}){const{id:i="pass"}=t;this.id=i,this.gl=e,this.props=ot({},t)}setProps(e){Object.assign(this.props,e)}render(){}cleanup(){}}{render(e){return Xu(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){Xu(n,{viewport:[0,0,n.drawingBufferWidth,n.drawingBufferHeight]}),n.clear(16640)}(o);const a=[];for(const l of t){const c=l.viewport||l,u=i&&i[c.id];r(c);const h=this._getDrawLayerParams(c,e);e.view=u;const f=c.subViewports||[c];for(const g of f){e.viewport=g;const m=this._drawLayersInViewport(o,e,h);a.push(m)}}return a}_getDrawLayerParams(e,{layers:t,pass:i,layerFilter:r,effects:s,moduleParameters:o}){const a=[],l=zz(),c={viewport:e,isPicking:i.startsWith("picking"),renderPass:i};for(let u=0;ufI(e,c))}const l={totalCount:t.length,visibleCount:0,compositeCount:0,pickableCount:0};Xu(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 u=t[l]=t[l]||zz(e[l],e);c=u(r,s),t[a]=u}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 ehe extends zO{constructor(e,t){super(e,t),this.shadowMap=new ya(e,{width:1,height:1,parameters:{10241:9729,10240:9729,10242:33071,10243:33071}}),this.depthBuffer=new zg(e,{format:33189,width:1,height:1}),this.fbo=new ks(e,{id:"shadowmap",width:1,height:1,attachments:{36064:this.shadowMap,36096:this.depthBuffer}})}render(e){const t=this.fbo;hc(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(Sn(ot({},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 nhe=Object.keys(Vi).map(n=>"const int COORDINATE_SYSTEM_".concat(n," = ").concat(Vi[n],";")).join(""),ihe=Object.keys(Zc).map(n=>"const int PROJECTION_MODE_".concat(n," = ").concat(Zc[n],";")).join(""),rhe="".concat(nhe,"\n").concat(ihe,"\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"),she={},HO={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:rhe,getUniforms:function(n=she){return n.viewport?function({viewport:n,devicePixelRatio:e=1,modelMatrix:t=null,coordinateSystem:i=Vi.DEFAULT,coordinateOrigin:r,autoWrapLongitude:s=!1}={}){i===Vi.DEFAULT&&(i=n.isGeospatial?Vi.LNGLAT:Vi.CARTESIAN);const o=lce({viewport:n,devicePixelRatio:e,coordinateSystem:i,coordinateOrigin:r});return o.project_uWrapLongitude=s,o.project_uModelMatrix=t||sce,o}(n):{}}},che=Ox(function({viewport:n,center:e}){return new qn(n.viewProjectionMatrix).invert().transform(e)}),uhe=Ox(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=j0([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(u=>a.transform(u)),c=(new qn).ortho({left:Math.min(...l.map(u=>u[0])),right:Math.max(...l.map(u=>u[0])),bottom:Math.min(...l.map(u=>u[1])),top:Math.max(...l.map(u=>u[1])),near:Math.min(...l.map(u=>-u[2])),far:Math.max(...l.map(u=>-u[2]))});t.push(c.multiplyRight(o))}return t}),dhe=[0,0,0,1],hhe=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0],GO={name:"shadow",dependencies:[HO],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||dhe,shadow_uLightId:n.shadowLightId||0,shadow_uLightCount:n.shadowMatrices.length},i=che({viewport:n.viewport,center:e.project_uCenter}),r=[],s=uhe({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{}}},_he={color:[255,255,255],intensity:1},Hz=[{color:[255,255,255],intensity:1,direction:[-1,3,-1]},{color:[255,255,255],intensity:.9,direction:[1,-8,-2.5]}],yhe=[0,0,0,200/255];class $O extends Uz{constructor(e){super(e),this.ambientLight=null,this.directionalLights=[],this.pointLights=[],this.shadowColor=yhe,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=F0.getDefaultProgramManager(e),GO&&this.programManager.addDefaultModule(GO)),this.dummyShadowMap||(this.dummyShadowMap=new ya(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(GO),this.programManager=null)}_createLightMatrix(){const e=[];for(const t of this.directionalLights){const i=(new qn).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=vhe++;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 whe{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=q0(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 Ehe{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 whe(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 xhe=[{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"},HO],She=["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 Che(n){const e=F0.getDefaultProgramManager(n);for(const t of xhe)e.addDefaultModule(t);for(const t of She)e.addShaderHook(t);return e}const Mhe=Object.seal({layerManager:null,resourceManager:null,deck:null,gl:null,stats:null,shaderCache:null,pickingFBO:null,mousePosition:null,userData:{}});class Dhe{constructor(e,{deck:t,stats:i,viewport:r,timeline:s}={}){this.lastRenderedLayers=[],this.layers=[],this.resourceManager=new Ehe({gl:e,protocol:"deck://"}),this.context=Sn(ot({},Mhe),{layerManager:this,gl:e,deck:t,programManager:e&&Che(e),stats:i||new oI({id:"deck.gl"}),viewport:r||new Jg({id:"DEFAULT-INITIAL-VIEWPORT"}),timeline:s||new Gz,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){Do("layerManager.setLayers",this,t,e),this.lastRenderedLayers=e,e=xI(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 Do("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]?Ri.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&&Ri.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 Ihe{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=xI(e,Boolean),this._diffViews(e,this.views)&&this.setNeedsUpdate("views changed"),this.views=e}_setViewState(e){e?(!X0(e,this.viewState)&&this.setNeedsUpdate("viewState changed"),this.viewState=e):Ri.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)(ot({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=Sn(ot(ot(ot({},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 u=r[a.id];a.controller&&!u&&(s=!0),(s||!a.controller)&&u&&(u.finalize(),u=null),this.controllers[a.id]=this._updateController(a,l,c,u),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 Rhe extends Bz{constructor({makeViewport:e,width:t,height:i,latitude:r,longitude:s,zoom:o,bearing:a=0,pitch:l=0,altitude:c=1.5,maxZoom:u=20,minZoom:h=0,maxPitch:f=60,minPitch:g=0,startPanLngLat:m,startZoomLngLat:w,startRotatePos:x,startBearing:U,startPitch:D,startZoom:ie,normalize:_e}={}){fc(Number.isFinite(s)),fc(Number.isFinite(r)),fc(Number.isFinite(o)),super({width:t,height:i,latitude:r,longitude:s,zoom:o,bearing:a,pitch:l,altitude:c,maxZoom:u,minZoom:h,maxPitch:f,minPitch:g,normalize:_e}),this._state={startPanLngLat:m,startZoomLngLat:w,startRotatePos:x,startBearing:U,startPitch:D,startZoom:ie},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(Sn(ot({},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(Sn(ot({},this._viewportProps),{zoom:o}));return this._getUpdatedState(ot({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=ot({},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(ot(ot(ot({makeViewport:this.makeViewport},this._viewportProps),this._state),e))}_applyConstraints(e){const{maxZoom:t,minZoom:i,zoom:r}=e;e.zoom=Ua(r,i,t);const{maxPitch:s,minPitch:o,pitch:a}=e;e.pitch=Ua(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=LU(t+180,360)-180),(o<-180||o>180)&&(o=LU(o+180,360)-180);const a=qI(e/512);if(r<=a)r=a,i=0;else{const l=e/2/Math.pow(2,r),c=Zg([0,l])[1];if(iu&&(i=u)}}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 Ua(t+Math.log2(e),r,i)}_calculateNewPitchAndBearing({deltaScaleX:e,deltaScaleY:t,startBearing:i,startPitch:r}){t=Ua(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 u=0;return r>0?Math.abs(l-o)>5&&(u=r/(o-l)*1.2):r<0&&o>5&&(u=1-s/o),u=Math.min(1,Math.max(-1,u)),{deltaScaleX:c,deltaScaleY:u}}}class Phe extends UO{constructor(e){e.dragMode=e.dragMode||"pan",super(Rhe,e)}setProps(e){const t=this.controllerStateProps;super.setProps(e),(!t||t.height!==e.height)&&this.updateViewport(new this.ControllerState(ot(ot({makeViewport:this.makeViewport},this.controllerStateProps),this._state)))}get linearTransitionProps(){return["longitude","latitude","zoom","bearing","pitch"]}}let Nhe=(()=>{class n extends jO{constructor(t){super(Sn(ot({},t),{type:KU}))}get controller(){return this._getControllerProps({type:Phe})}}return n.displayName="MapView",n})();const khe=new $O;class Fhe{constructor(){this.effects=[],this._internalEffects=[],this._needsRedraw="Initial render",this.setEffects()}setProps(e){"effects"in e&&(e.effects.length!==this.effects.length||!X0(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 $O)||this._internalEffects.push(khe)}}class Lhe extends zO{}const Wz={blendFunc:[1,0,32771,0],blendEquation:32774};class qz extends zO{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:u},pass:h="picking",redrawReason:f,pickZ:g}){const m=this.gl;return this.pickZ=g,hc(m,Sn(ot({scissorTest:!0,scissor:[a,l,c,u],clearColor:[0,0,0,0],depthMask:!0,depthTest:!0,depthRange:[0,1],colorMask:[!0,!0,!0,!0]},Wz),{blend:!g}),()=>{super.render({target:o,layers:e,layerFilter:t,views:i,viewports:r,onViewportActive:s,pass:h,redrawReason:f})})}shouldDrawLayer(e){return e.props.pickable}getModuleParameters(){return{pickingActive:1,pickingAttribute:this.pickZ,lightSources:{}}}getLayerParameters(e,t){const i=this.pickZ?{blend:!1}:Sn(ot({},Wz),{blend:!0,blendColor:[0,0,0,this.useAlpha?(t+1)/255:1]});return ot(ot({},e.props.parameters),i)}}class Vhe{constructor(e){this.gl=e,this.layerFilter=null,this.drawPickingColors=!1,this.drawLayersPass=new Lhe(e),this.pickLayersPass=new qz(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||ks.getDefaultFramebuffer(this.gl),this._preRender(e.effects,e);const i=this.lastPostProcessEffect?this.renderBuffers[0]:e.target,r=t.render(Sn(ot({},e),{target:i}));this._postRender(e.effects,e),this.renderCount++,Do("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 ks(this.gl),new ks(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 jhe={pickedColor:null,pickedLayer:null,pickedObjectIndex:-1};function Uhe({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 u=r*r,h=-1,f=0;for(let g=0;gu)f+=4*l;else for(let x=0;x=0){const D=x+o-t,ie=D*D+w;ie<=u&&(u=ie,h=f)}f+=4}}if(h>=0){const g=n[h+3]-1,m=n.slice(h,h+4),w=e[g];if(w){const x=w.decodePickingColor(m),U=Math.floor(h/4/l);return{pickedColor:m,pickedLayer:w,pickedObjectIndex:x,pickedX:o+(h/4-U*l),pickedY:a+U}}Ri.error("Picked non-existent layer. Is picking buffer corrupt?")()}}return jhe}function Yz({pickInfo:n,mode:e,viewports:t,layerFilter:i,pixelRatio:r,x:s,y:o,z:a}){const l=n&&n.pickedLayer,u=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&&(f=>i({layer:l,viewport:f,isPicking:!0,renderPass:"picking:".concat(e)}))),h=u&&u.unproject([s-u.x,o-u.y],{targetZ:a});return{color:null,layer:null,viewport:u,index:-1,picked:!1,x:s,y:o,pixel:[s,o],coordinate:h,devicePixel:n&&[n.pickedX,n.pickedY],pixelRatio:r}}function Hhe(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 h=t.index,f=t.layerId,g=o&&o.props.id;if(g!==f||a!==h){if(g!==f){const m=r.find(w=>w.props.id===f);m&&l.unshift(m)}t.layerId=g,t.index=a,t.info=null}}const c=Yz(n),u=new Map;return u.set(null,c),l.forEach(h=>{let f=ot({},c);h===o&&(f.color=s,f.index=a,f.picked=!0),f=Xz({layer:h,info:f,mode:i}),h===o&&"hover"===i&&(t.info=f),u.set(f.layer.id,f),"hover"===i&&f.layer.updateAutoHighlight(f)}),u}function Xz({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 $he{constructor(e){this.gl=e,this.pickingFBO=null,this.pickLayersPass=new qz(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(f=>f.id===o):null,c=a&&r.find(f=>f.id===a)||r[0],u=c&&c.unproject([e-c.x,t-c.y]),h={x:e,y:t,viewport:c,coordinate:u,layer:l};return l?ot(ot({},s),h):Object.assign(h,{color:null,object:null,index:-1})}_resizeBuffer(){const{gl:e}=this;return this.pickingFBO||(this.pickingFBO=new ks(e),ks.isSupported(e,{colorBufferFloat:!0})&&(this.depthFBO=new ks(e),this.depthFBO.attach({36064:new ya(e,{format:Ci(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?(Ri.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:u}){if(!(e=this._getPickable(e)))return{result:[],emptyInfo:Yz({viewports:i,x:r,y:s})};this._resizeBuffer();const h=Vg(this.gl),f=iI(this.gl,[r,s],!0),g=[f.x+Math.floor(f.width/2),f.y+Math.floor(f.height/2)],m=Math.round(o*h),{width:w,height:x}=this.pickingFBO,U=this._getPickingRect({deviceX:g[0],deviceY:g[1],deviceRadius:m,deviceWidth:w,deviceHeight:x});let D;const ie=[],_e={};for(let Pe=0;Pe=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)}):Ri.error("Picked non-existent layer. Is picking buffer corrupt?")()}}}return Array.from(t.values())}({pickedColors:this._drawAndSample({layers:e,views:t,viewports:i,onViewportActive:u,deviceRect:{x:g,y:U,width:w.x+w.width-g,height:m-U},pass:"picking:".concat(l),redrawReason:l}),layers:e}),Pe=new Map,Ne=Number.isFinite(c);for(let Ve=0;Ve<_e.length&&!(Ne&&Pe.size>=c);Ve++){const bt=_e[Ve];let xt={color:bt.pickedColor,layer:null,index:bt.pickedObjectIndex,picked:!0,x:r,y:s,width:o,height:a,pixelRatio:h};xt=Xz({layer:bt.pickedLayer,info:xt,mode:l}),Pe.has(xt.object)||Pe.set(xt.object,xt)}return Array.from(Pe.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:u,y:h,width:f,height:g}=s,m=new(l?Float32Array:Uint8Array)(f*g*4);return px(c,{sourceX:u,sourceY:h,sourceWidth:f,sourceHeight:g,target:m}),m}_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 Whe={zIndex:1,position:"absolute",pointerEvents:"none",color:"#a0a7b4",backgroundColor:"#29323c",padding:"10px",top:0,left:0,display:"none"};class qhe{constructor(e){const t=e.parentElement;t&&(this.el=document.createElement("div"),this.el.className="deck-tooltip",Object.assign(this.el.style,Whe),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 Kz(n,e){if(!n)throw new Error(e)}const su={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},Qz=su.global||su.self||su.window,Xhe="object"!=typeof process||"[object process]"!==String(process)||process.browser,Zz="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version),{_parseImageNode:Khe}=(Zz&&parseFloat(Zz[1]),Qz),WO="undefined"!=typeof Image,qO="undefined"!=typeof ImageBitmap,Qhe=Boolean(Khe),YO=!!Xhe||Qhe;function Jz(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 e4(n){switch(Jz(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 efe=/^data:image\/svg\+xml/,tfe=/\.svg((\?|#).*)?$/;function XO(n){return n&&(efe.test(n)||tfe.test(n))}function nfe(n,e){if(XO(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 n4(n,e)}function n4(n,e){if(XO(e))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(n)])}function i4(n,e,t){return KO.apply(this,arguments)}function KO(){return(KO=li(function*(n,e,t){const i=nfe(n,t),r=self.URL||self.webkitURL,s="string"!=typeof i&&r.createObjectURL(i);try{return yield ife(s||i,e)}finally{s&&r.revokeObjectURL(s)}})).apply(this,arguments)}function ife(n,e){return QO.apply(this,arguments)}function QO(){return(QO=li(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 rfe={};let r4=!0;function sfe(n,e,t){return ZO.apply(this,arguments)}function ZO(){return(ZO=li(function*(n,e,t){let i;i=XO(t)?yield i4(n,e,t):n4(n,t);const r=e&&e.imagebitmap;return yield ofe(i,r)})).apply(this,arguments)}function ofe(n){return JO.apply(this,arguments)}function JO(){return(JO=li(function*(n,e=null){if((afe(e)||!r4)&&(e=null),e)try{return yield createImageBitmap(n,e)}catch(t){console.warn(t),r4=!1}return yield createImageBitmap(n)})).apply(this,arguments)}function afe(n){for(const e in n||rfe)return!1;return!0}const ou=!1,Q0=!0;function eR(n){const e=Z0(n);return function(n){const e=Z0(n);return e.byteLength>=24&&2303741511===e.getUint32(0,ou)?{mimeType:"image/png",width:e.getUint32(16,ou),height:e.getUint32(20,ou)}:null}(e)||function(n){const e=Z0(n);if(!(e.byteLength>=3&&65496===e.getUint16(0,ou)&&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,ou)?{mimeType:"image/gif",width:e.getUint16(6,Q0),height:e.getUint16(8,Q0)}:null}(e)||function(n){const e=Z0(n);return e.byteLength>=14&&16973===e.getUint16(0,ou)&&e.getUint32(2,Q0)===e.byteLength?{mimeType:"image/bmp",width:e.getUint32(18,Q0),height:e.getUint32(22,Q0)}:null}(e)}function Z0(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 ffe(n,e){const{mimeType:t}=eR(n)||{},{_parseImageNode:i}=Qz;return Kz(i),i(n,t,e)}function tR(){return(tR=li(function*(n,e,t){const r=((e=e||{}).image||{}).type||"auto",{url:s}=t||{};let a;switch(gfe(r)){case"imagebitmap":a=yield sfe(n,e,s);break;case"image":a=yield i4(n,e,s);break;case"data":a=yield ffe(n,e);break;default:Kz(!1)}return"data"===r&&(a=e4(a)),a})).apply(this,arguments)}function gfe(n){switch(n){case"auto":case"data":return function(){if(qO)return"imagebitmap";if(WO)return"image";if(YO)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}();default:return function(n){switch(n){case"auto":return qO||WO||YO;case"imagebitmap":return qO;case"image":return WO;case"data":return YO;default:throw new Error(`@loaders.gl/images: image ${n} not supported in this environment`)}}(n),n}}const nR={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 tR.apply(this,arguments)},tests:[n=>Boolean(eR(new DataView(n)))],options:{image:{type:"auto",decode:!0}}};var nm=et(4761);const _fe={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},J0="8.5.8",Kx=nm.CO.deck&&nm.CO.deck.VERSION;if(Kx&&Kx!==J0)throw new Error("deck.gl - multiple versions detected: ".concat(Kx," vs ").concat(J0));Kx||(Ri.log(1,"deck.gl ".concat(J0))(),nm.CO.deck=Object.assign(nm.CO.deck||{},{VERSION:J0,version:J0,log:Ri,_registerLoggers:function(n){AI=n}}),Mz([_fe,[nR,{imagebitmap:{premultiplyAlpha:"none"}}]]));const yfe=nm.CO.deck;class Qx extends Ku{get[Symbol.toStringTag](){return"Query"}static isSupported(e,t=[]){const i=Ci(e),r=gj(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:on(!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 Qx.isSupported(this.gl)?this.gl2.createQuery():null}_deleteHandle(){this.gl2.deleteQuery(this.handle)}}const s4=fx()&&"undefined"!=typeof document;let Mfe=0;class Dfe{constructor(e={}){const{onCreateContext:t=(x=>XV(x)),onAddHTML:i=null,onInitialize:r=(()=>{}),onRender:s=(()=>{}),onFinalize:o=(()=>{}),onError:a,gl:l=null,glOptions:c={},debug:u=!1,createFramebuffer:h=!1,autoResizeViewport:f=!0,autoResizeDrawingBuffer:g=!0,stats:m=Rf.get("animation-loop-"+Mfe++)}=e;let{useDevicePixels:w=!0}=e;"useDevicePixelRatio"in e&&(mn.deprecated("useDevicePixelRatio","useDevicePixels")(),w=e.useDevicePixelRatio),this.props={onCreateContext:t,onAddHTML:i,onInitialize:r,onRender:s,onFinalize:o,onError:a,gl:l,glOptions:c,debug:u,createFramebuffer:h},this.gl=l,this.needsRedraw=null,this.timeline=null,this.stats=m,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:f,autoResizeDrawingBuffer:g,useDevicePixels:w}),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 on("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=Qx.isSupported(this.gl,["timers"])?new Qx(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 li(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 mn.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=s4?new Promise((e,t)=>{s4&&"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?sI(this.props.gl,e):this.onCreateContext(e),!dx(this.gl))throw new Error("AnimationLoop.onCreateContext - illegal context returned");(function(n){Xu(n,nI)})(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)&&(mn.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)&&(mn.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 ks(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 Ife=et(1524),Zx=et.n(Ife);const Ofe={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}))}}(Zx().MouseInput);const kfe=Zx().Manager,au=Zx(),Ffe=au?[[au.Pan,{event:"tripan",pointers:3,threshold:0,enable:!1}],[au.Rotate,{enable:!1}],[au.Pinch,{enable:!1}],[au.Swipe,{enable:!1}],[au.Pan,{threshold:0,enable:!1}],[au.Press,{enable:!1}],[au.Tap,{event:"doubletap",taps:2,enable:!1}],[au.Tap,{event:"anytap",enable:!1}],[au.Tap,{enable:!1}]]:null,l4={tripan:["rotate","pinch","pan"],rotate:["pinch"],pinch:["pan"],pan:["press","doubletap","anytap","tap"],doubletap:["anytap"],anytap:["tap"]},Lfe={doubletap:["tap"]},Bfe={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"]},Vfe={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"},c4={click:"tap",anyclick:"anytap",dblclick:"doubletap",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup",mouseover:"pointerover",mouseout:"pointerout",mouseleave:"pointerleave"},jfe="undefined"!=typeof navigator&&navigator.userAgent?navigator.userAgent.toLowerCase():"",im="undefined"!=typeof window?window:global;"undefined"!=typeof global?global:window,"undefined"!=typeof document&&document;let u4=!1;try{const n={get passive(){return u4=!0,!0}};im.addEventListener("test",n,n),im.removeEventListener("test",n,n)}catch(n){}const Ufe=-1!==jfe.indexOf("firefox"),{WHEEL_EVENTS:zfe}=rR,h4=4.000244140625;class $fe{constructor(e,t,i={}){this.element=e,this.callback=t,this.options=Object.assign({enable:!0},i),this.events=zfe.concat(i.events||[]),this.handleEvent=this.handleEvent.bind(this),this.events.forEach(r=>e.addEventListener(r,this.handleEvent,!!u4&&{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;im.WheelEvent&&(Ufe&&e.deltaMode===im.WheelEvent.DOM_DELTA_PIXEL&&(t/=im.devicePixelRatio),e.deltaMode===im.WheelEvent.DOM_DELTA_LINE&&(t*=40));const i={x:e.clientX,y:e.clientY};0!==t&&t%h4==0&&(t=Math.floor(t/h4)),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:Wfe}=rR,f4="pointermove",p4="pointerover",g4="pointerout",m4="pointerleave";class qfe{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=Wfe.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===f4&&(this.enableMoveEvent=t),e===p4&&(this.enableOverEvent=t),e===g4&&(this.enableOutEvent=t),e===m4&&(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:p4,srcEvent:e,pointerType:"mouse",target:e.target})}handleOutEvent(e){this.enableOutEvent&&"mouseout"===e.type&&this.callback({type:g4,srcEvent:e,pointerType:"mouse",target:e.target})}handleLeaveEvent(e){this.enableLeaveEvent&&"mouseleave"===e.type&&this.callback({type:m4,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:f4,srcEvent:e,pointerType:"mouse",target:e.target});break;case"mouseup":this.pressed=!1}}}const{KEY_EVENTS:Yfe}=rR,_4="keydown";class Xfe{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=Yfe.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===_4&&(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:_4,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 b4="contextmenu";class Kfe{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===b4&&(this.options.enable=t)}handleEvent(e){!this.options.enable||this.callback({type:b4,center:{x:e.clientX,y:e.clientY},srcEvent:e,pointerType:"mouse",target:e.target})}}const Qfe={pointerdown:1,pointermove:2,pointerup:4,mousedown:1,mousemove:2,mouseup:4},v4={srcElement:"root",priority:0};class cpe{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({},v4,i):v4;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 u=l.length-1;for(;u>=0&&!(l[u].priority>=c.priority);)u--;l.splice(u+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&&l4[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 $fe(e,this._onOtherEvent,{enable:!1}),this.moveInput=new qfe(e,this._onOtherEvent,{enable:!1}),this.keyInput=new Xfe(e,this._onOtherEvent,{enable:!1,tabIndex:t.tabIndex}),this.contextmenuInput=new Kfe(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=Lfe[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 u in e)this._addEventHandler(u,e[u],i,r,s);return}const{manager:o,events:a}=this,l=c4[e]||e;let c=a.get(l);c||(c=new cpe(this),a.set(l,c),c.recognizerName=Vfe[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(c4[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=Bfe[t.type];i&&this.manager.emit(i,e)}_onOtherEvent(e){this.manager.emit(e.type,e)}}function Vf(){}const w4={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:Vf,onResize:Vf,onViewStateChange:Vf,onInteractionStateChange:Vf,onBeforeRender:Vf,onAfterRender:Vf,onLoad:Vf,onError:(n,e)=>Ri.error(n)(),_onMetrics:null,getCursor:({isDragging:n})=>n?"grabbing":"grab",debug:!1,drawPickingColors:!1};class eS{constructor(e){e=ot(ot({},w4),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&&Ri.warn("View state tracking is disabled. Use either `initialViewState` for auto update or `viewState` for manual update.")(),"IE"===(0,nm.qs)()&&Ri.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 oI({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&&A0.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&&Ri.removed("onLayerHover","onHover")(),"onLayerClick"in e&&Ri.removed("onLayerClick","onClick")(),e.initialViewState&&!X0(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](ot({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),fc(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:u,autoResizeDrawingBuffer:h}=e;return new Dfe({width:t,height:i,useDevicePixels:u,autoResizeDrawingBuffer:h,autoResizeViewport:!1,gl:r,onCreateContext:f=>XV(Sn(ot(ot({},s),f),{canvas:this.canvas,debug:o,onContextLost:()=>this._onContextLost()})),onInitialize:f=>this._setGLContext(f.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 Nhe({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,sI(e,{enable:!0,copyState:!0})),this.tooltip=new qhe(this.canvas),Xu(e,{blend:!0,blendFunc:[770,771,1,771],polygonOffsetFill:!0,depthTest:!0,depthFunc:515}),this.props.onWebGLInitialized(e);const t=new Gz;t.play(),this.animationLoop.attachTimeline(t),this.eventManager=new dpe(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 PV)this.eventManager.on(r,this._onEvent);this.viewManager=new Ihe({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 Dhe(e,{deck:this,stats:this.stats,viewport:i,timeline:t}),this.effectManager=new Fhe,this.deckRenderer=new Vhe(e),this.deckPicker=new $he(e),this.setProps(this.props),this._updateCanvasSize(),this.props.onLoad()}_drawLayers(e,t){const{gl:i}=this.layerManager.context;Xu(i,this.props.parameters),this.props.onBeforeRender({gl:i}),this.deckRenderer.renderLayers(ot({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(),Ri.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=Sn(ot({},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=PV[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=Rf.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}}eS.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(Uz)),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}},eS.defaultProps=w4,eS.VERSION=yfe.VERSION;const tS={name:"project32",dependencies:[HO],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"},gpe={pickingSelectedColor:null,pickingHighlightColor:new Uint8Array([0,255,255,255]),pickingActive:!1,pickingAttribute:!1},nS=ot({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=gpe){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}}),E4={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6};class gh{static get DRAW_MODE(){return E4}constructor(e={}){const{id:t=ma("geometry"),drawMode:i=E4.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?ot({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,on(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?(on(!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 on(Number.isFinite(i)),i}}const x4=()=>{},wpe={10241:9987,10240:9729,10242:33071,10243:33071};function Epe(n){return Math.pow(2,Math.ceil(Math.log2(n)))}function xpe(n,e,t,i){return t===e.width&&i===e.height?e:(n.canvas.height=i,n.canvas.width=t,n.clearRect(0,0,n.canvas.width,n.canvas.height),n.drawImage(e,0,0,e.width,e.height,0,0,t,i),n.canvas)}function eb(n){return n&&(n.id||n.url)}function S4(n,e,t){for(let i=0;i0){const{mapping:i,xOffset:r,yOffset:s,rowHeight:o,canvasHeight:a}=function({icons:n,buffer:e,mapping:t={},xOffset:i=0,yOffset:r=0,rowHeight:s=0,canvasWidth:o}){let a=[];for(let l=0;lo&&(S4(t,a,r),i=0,r=s+r+e,s=0,a=[]),a.push({icon:c,xOffset:i}),i=i+f+e,s=Math.max(s,h)}}return a.length>0&&S4(t,a,r),{mapping:t,rowHeight:s,xOffset:i,yOffset:r,canvasWidth:o,canvasHeight:Epe(s+r+e)}}({icons:t,buffer:this._buffer,canvasWidth:this._canvasWidth,mapping:this._mapping,rowHeight:this._rowHeight,xOffset:this._xOffset,yOffset:this._yOffset});this._rowHeight=o,this._mapping=i,this._xOffset=r,this._yOffset=s,this._canvasHeight=a,this._texture||(this._texture=new ya(this.gl,{width:this._canvasWidth,height:this._canvasHeight,parameters:wpe})),this._texture.height!==this._canvasHeight&&(this._texture=function(n,e,t,i){const r=e.width,s=e.height,o=hj(e,{width:t,height:i});return function(n,e,t={}){const{sourceX:i=0,sourceY:r=0,targetMipmaplevel:s=0,targetInternalFormat:o=6408}=t;let{targetX:a,targetY:l,targetZ:c,width:u,height:h}=t;const{framebuffer:f,deleteFramebuffer:g}=T0(n);on(f);const{gl:m,handle:w}=f,x=void 0!==a||void 0!==l||void 0!==c;a=a||0,l=l||0,c=c||0;const U=m.bindFramebuffer(36160,w);on(e);let D=null;if(e instanceof Pf&&(D=e,u=Number.isFinite(u)?u:D.width,h=Number.isFinite(h)?h:D.height,D.bind(0),e=D.target),x)switch(e){case 3553:case 34067:m.copyTexSubImage2D(e,s,a,l,i,r,u,h);break;case 35866:case 32879:Ao(m).copyTexSubImage3D(e,s,a,l,c,i,r,u,h)}else m.copyTexImage2D(e,s,o,i,r,u,h,0);D&&D.unbind(),m.bindFramebuffer(36160,U||null),g&&f.delete()}(e,o,{targetY:0,width:r,height:s}),e.delete(),o}(0,this._texture,this._canvasWidth,this._canvasHeight)),this.onUpdate(),this._loadIcons(t)}}_loadIcons(e){const t=this._canvas.getContext("2d");for(const i of e)this._pendingCount++,q0(i.url,nR,this._loadOptions).then(r=>{const s=eb(i),{x:o,y:a,width:l,height:c}=this._mapping[s],u=xpe(t,r,l,c);this._texture.setSubImageData({data:u,x:o,y:a,width:l,height:c}),this._texture.generateMipmap(),this.onUpdate()}).catch(r=>{this.onError({url:i.url,source:i.source,sourceIndex:i.sourceIndex,loadOptions:this._loadOptions,error:r})}).finally(()=>{this._pendingCount--})}}const C4=[0,0,0,255],Mpe={iconAtlas:{type:"image",value:null,async:!0},iconMapping:{type:"object",value:{},async:!0},sizeScale:{type:"number",value:1,min:0},billboard:!0,sizeUnits:"pixels",sizeMinPixels:{type:"number",min:0,value:0},sizeMaxPixels:{type:"number",min:0,value:Number.MAX_SAFE_INTEGER},alphaCutoff:{type:"number",value:.05,min:0,max:1},getPosition:{type:"accessor",value:n=>n.position},getIcon:{type:"accessor",value:n=>n.icon},getColor:{type:"accessor",value:C4},getSize:{type:"accessor",value:1},getAngle:{type:"accessor",value:0},getPixelOffset:{type:"accessor",value:[0,0]},onIconError:{type:"function",value:null,compare:!1,optional:!0}};let Dpe=(()=>{class n extends Y0{getShaders(){return super.getShaders({vs:"#define SHADER_NAME icon-layer-vertex-shader\n\nattribute vec2 positions;\n\nattribute vec3 instancePositions;\nattribute vec3 instancePositions64Low;\nattribute float instanceSizes;\nattribute float instanceAngles;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\nattribute vec4 instanceIconFrames;\nattribute float instanceColorModes;\nattribute vec2 instanceOffsets;\nattribute vec2 instancePixelOffset;\n\nuniform float sizeScale;\nuniform vec2 iconsTextureDim;\nuniform float sizeMinPixels;\nuniform float sizeMaxPixels;\nuniform bool billboard;\n\nvarying float vColorMode;\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\nvarying vec2 uv;\n\nvec2 rotate_by_angle(vec2 vertex, float angle) {\n float angle_radian = angle * PI / 180.0;\n float cos_angle = cos(angle_radian);\n float sin_angle = sin(angle_radian);\n mat2 rotationMatrix = mat2(cos_angle, -sin_angle, sin_angle, cos_angle);\n return rotationMatrix * vertex;\n}\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n geometry.uv = positions;\n geometry.pickingColor = instancePickingColors;\n uv = positions;\n\n vec2 iconSize = instanceIconFrames.zw;\n float sizePixels = clamp(\n project_size_to_pixel(instanceSizes * sizeScale), \n sizeMinPixels, sizeMaxPixels\n );\n float instanceScale = iconSize.y == 0.0 ? 0.0 : sizePixels / iconSize.y;\n vec2 pixelOffset = positions / 2.0 * iconSize + instanceOffsets;\n pixelOffset = rotate_by_angle(pixelOffset, instanceAngles) * instanceScale;\n pixelOffset += instancePixelOffset;\n pixelOffset.y *= -1.0;\n\n if (billboard) {\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, vec3(0.0), geometry.position);\n vec3 offset = vec3(pixelOffset, 0.0);\n DECKGL_FILTER_SIZE(offset, geometry);\n gl_Position.xy += project_pixel_size_to_clipspace(offset.xy);\n\n } else {\n vec3 offset_common = vec3(project_pixel_size(pixelOffset), 0.0);\n DECKGL_FILTER_SIZE(offset_common, geometry);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, offset_common, geometry.position); \n }\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n vTextureCoords = mix(\n instanceIconFrames.xy,\n instanceIconFrames.xy + iconSize,\n (positions.xy + 1.0) / 2.0\n ) / iconsTextureDim;\n\n vColor = instanceColors;\n DECKGL_FILTER_COLOR(vColor, geometry);\n\n vColorMode = instanceColorModes;\n}\n",fs:"#define SHADER_NAME icon-layer-fragment-shader\n\nprecision highp float;\n\nuniform float opacity;\nuniform sampler2D iconsTexture;\nuniform float alphaCutoff;\n\nvarying float vColorMode;\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\nvarying vec2 uv;\n\nvoid main(void) {\n geometry.uv = uv;\n\n vec4 texColor = texture2D(iconsTexture, vTextureCoords);\n vec3 color = mix(texColor.rgb, vColor.rgb, vColorMode);\n float a = texColor.a * opacity * vColor.a;\n\n if (a < alphaCutoff) {\n discard;\n }\n\n gl_FragColor = vec4(color, a);\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:[tS,nS]})}initializeState(){this.state={iconManager:new Ape(this.context.gl,{onUpdate:this._onUpdate.bind(this),onError:this._onError.bind(this)})},this.getAttributeManager().addInstanced({instancePositions:{size:3,type:5130,fp64:this.use64bitPositions(),transition:!0,accessor:"getPosition"},instanceSizes:{size:1,transition:!0,accessor:"getSize",defaultValue:1},instanceOffsets:{size:2,accessor:"getIcon",transform:this.getInstanceOffset},instanceIconFrames:{size:4,accessor:"getIcon",transform:this.getInstanceIconFrame},instanceColorModes:{size:1,type:5121,accessor:"getIcon",transform:this.getInstanceColorMode},instanceColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:!0,accessor:"getColor",defaultValue:C4},instanceAngles:{size:1,transition:!0,accessor:"getAngle"},instancePixelOffset:{size:2,transition:!0,accessor:"getPixelOffset"}})}updateState({oldProps:t,props:i,changeFlags:r}){super.updateState({props:i,oldProps:t,changeFlags:r});const s=this.getAttributeManager(),{iconAtlas:o,iconMapping:a,data:l,getIcon:c}=i,{iconManager:u}=this.state;u.setProps({loadOptions:i.loadOptions});let h=!1;if(o||this.internalState.isAsyncPropLoading("iconAtlas")?(t.iconAtlas!==i.iconAtlas&&u.setProps({iconAtlas:o,autoPacking:!1}),t.iconMapping!==i.iconMapping&&(u.setProps({iconMapping:a}),h=!0)):u.setProps({autoPacking:!0}),(r.dataChanged||r.updateTriggersChanged&&(r.updateTriggersChanged.all||r.updateTriggersChanged.getIcon))&&u.setProps({data:l,getIcon:c}),h&&(s.invalidate("instanceOffsets"),s.invalidate("instanceIconFrames"),s.invalidate("instanceColorModes")),r.extensionsChanged){var g;const{gl:m}=this.context;null===(g=this.state.model)||void 0===g||g.delete(),this.state.model=this._getModel(m),s.invalidateAll()}}get isLoaded(){return super.isLoaded&&this.state.iconManager.isLoaded}finalizeState(){super.finalizeState(),this.state.iconManager.finalize()}draw({uniforms:t}){const{sizeScale:i,sizeMinPixels:r,sizeMaxPixels:s,sizeUnits:o,billboard:a,alphaCutoff:l}=this.props,{iconManager:c}=this.state,{viewport:u}=this.context,h=c.getTexture();h&&this.state.model.setUniforms(t).setUniforms({iconsTexture:h,iconsTextureDim:[h.width,h.height],sizeScale:i*("pixels"===o?u.metersPerPixel:1),sizeMinPixels:r,sizeMaxPixels:s,billboard:a,alphaCutoff:l}).draw()}_getModel(t){return new Yg(t,Sn(ot({},this.getShaders()),{id:this.props.id,geometry:new gh({drawMode:6,attributes:{positions:{size:2,value:new Float32Array([-1,-1,-1,1,1,1,1,-1])}}}),isInstanced:!0}))}_onUpdate(){this.setNeedsRedraw()}_onError(t){const{onIconError:i}=this.getCurrentLayer().props;i?i(t):Ri.error(t.error)()}getInstanceOffset(t){const i=this.state.iconManager.getIconMapping(t);return[i.width/2-i.anchorX||0,i.height/2-i.anchorY||0]}getInstanceColorMode(t){return this.state.iconManager.getIconMapping(t).mask?1:0}getInstanceIconFrame(t){const i=this.state.iconManager.getIconMapping(t);return[i.x||0,i.y||0,i.width||0,i.height||0]}}return n.layerName="IconLayer",n.defaultProps=Mpe,n})();const A4=[],Ope={getIconOffsets:{type:"accessor",value:n=>n.offsets},alphaCutoff:.001,smoothing:.1,outlineWidth:0,outlineColor:{type:"color",value:[0,0,0,255]}};let Rpe=(()=>{class n extends Dpe{getShaders(){return Sn(ot({},super.getShaders()),{fs:"#define SHADER_NAME multi-icon-layer-fragment-shader\n\nprecision highp float;\n\nuniform float opacity;\nuniform sampler2D iconsTexture;\nuniform float gamma;\nuniform bool sdf;\nuniform float alphaCutoff;\nuniform float buffer;\nuniform float outlineBuffer;\nuniform vec4 outlineColor;\n\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\nvarying vec2 uv;\n\nvoid main(void) {\n geometry.uv = uv;\n\n if (!picking_uActive) {\n float alpha = texture2D(iconsTexture, vTextureCoords).a;\n vec4 color = vColor;\n if (sdf) {\n float distance = alpha;\n alpha = smoothstep(buffer - gamma, buffer + gamma, distance);\n\n if (outlineBuffer > 0.0) {\n float inFill = alpha;\n float inBorder = smoothstep(outlineBuffer - gamma, outlineBuffer + gamma, distance);\n color = mix(outlineColor, vColor, inFill);\n alpha = inBorder;\n }\n }\n float a = alpha * color.a;\n \n if (a < alphaCutoff) {\n discard;\n }\n\n gl_FragColor = vec4(color.rgb, a * opacity);\n }\n\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n"})}initializeState(){super.initializeState(),this.getAttributeManager().addInstanced({instanceOffsets:{size:2,accessor:"getIconOffsets"},instancePickingColors:{type:5121,size:3,accessor:(i,{index:r,target:s})=>this.encodePickingColor(r,s)}})}updateState(t){super.updateState(t);const{props:i,oldProps:r}=t;let{outlineColor:s}=i;s!==r.outlineColor&&(s=s.map(o=>o/255),s[3]=Number.isFinite(s[3])?s[3]:1,this.setState({outlineColor:s})),!i.sdf&&i.outlineWidth&&Ri.warn("".concat(this.id,": fontSettings.sdf is required to render outline"))()}draw(t){const{sdf:i,smoothing:r,outlineWidth:s}=this.props,{outlineColor:o}=this.state;t.uniforms=Sn(ot({},t.uniforms),{buffer:.75,outlineBuffer:s?Math.max(r,.75*(1-s)):-1,gamma:r,sdf:Boolean(i),outlineColor:o}),super.draw(t)}getInstanceOffset(t){return t?Array.from(t).map(i=>super.getInstanceOffset(i)):A4}getInstanceColorMode(t){return 1}getInstanceIconFrame(t){return t?Array.from(t).map(i=>super.getInstanceIconFrame(i)):A4}}return n.layerName="MultiIconLayer",n.defaultProps=Ope,n})();var Ppe=et(1002),Npe=et.n(Ppe);const Fpe=[];function Lpe(n){return Math.pow(2,Math.ceil(Math.log2(n)))}function M4(n,e,t,i){let r=0;for(let s=e;si&&(oa){let h=M4(n,a,l,r);c+h>i&&(oi&&(h=D4(n,a,l,i,r,s),o=s[s.length-1])),a=l,c+=h}}(n,r,s,t,i,o),o}function Upe(n,e,t,i,r,s){let o=0,a=0;for(let l=e;l0,u=[0,0],h=[];let f=0,g=0,m=0;for(let w=0;w<=s;w++){const x=n[w];if(("\n"===x||w===s)&&(m=w),m>g){const U=c?jpe(n,t,i,r,g,m):Fpe;for(let D=0;D<=U.length;D++){const ie=0===D?g:U[D-1],_e=Di===e);t>=0&&this._order.splice(t,1)}_appendOrder(e){this._order.push(e)}}(3),qpe=["fontFamily","fontWeight","characterSet","fontSize","sdf","buffer","cutoff","radius"];function Xpe(n,e){for(let t=0;t{o in e&&(this.props[o]=e[o])});const t=this._key;this._key=this._getKey();const i=function(n,e){const t=aR.get(n);if(!t)return e;const i=[];let s=Object.keys(t.mapping);s=new Set(s);let o=e;return o instanceof Array&&(o=new Set(o)),o.forEach(a=>{s.has(a)||i.push(a)}),i}(this._key,this.props.characterSet),r=aR.get(this._key);if(r&&0===i.length)return void(this._key!==t&&(this._atlas=r));const s=this._generateFontAtlas(this._key,i,r);this._atlas=s,aR.set(this._key,s)}_generateFontAtlas(e,t,i){const{fontFamily:r,fontWeight:s,fontSize:o,buffer:a,sdf:l,radius:c,cutoff:u}=this.props;let h=i&&i.data;h||(h=document.createElement("canvas"),h.width=1024);const f=h.getContext("2d");j4(f,r,o,s);const{mapping:g,canvasHeight:m,xOffset:w,yOffset:x}=function({characterSet:n,getFontWidth:e,fontHeight:t,buffer:i,maxCanvasWidth:r,mapping:s={},xOffset:o=0,yOffset:a=0}){let l=0,c=o,u=0;for(const f of n)if(!s[f]){const g=e(f,u++);c+g+2*i>r&&(c=0,l++),s[f]={x:c+i,y:a+l*(t+2*i)+i,width:g,height:t},c+=g+2*i}const h=t+2*i;return{mapping:s,xOffset:c,yOffset:a+l*h,canvasHeight:Lpe(a+(l+1)*h)}}(ot({getFontWidth:U=>f.measureText(U).width,fontHeight:1.2*o,buffer:a,characterSet:t,maxCanvasWidth:1024},i&&{mapping:i.mapping,xOffset:i.xOffset,yOffset:i.yOffset}));if(h.height!==m){const U=f.getImageData(0,0,h.width,h.height);h.height=m,f.putImageData(U,0,0)}if(j4(f,r,o,s),l){const U=new(Npe())(o,a,c,u,r,s),D=f.getImageData(0,0,U.size,U.size);for(const ie of t)Xpe(U.draw(ie),D),f.putImageData(D,g[ie].x-a,g[ie].y+a)}else for(const U of t)f.fillText(U,g[U].x,g[U].y+.9*o);return{xOffset:w,yOffset:x,mapping:g,data:h,width:h.width,height:h.height}}_getKey(){const{fontFamily:e,fontWeight:t,fontSize:i,buffer:r,sdf:s,radius:o,cutoff:a}=this.props;return s?"".concat(e," ").concat(t," ").concat(i," ").concat(r," ").concat(o," ").concat(a):"".concat(e," ").concat(t," ").concat(i," ").concat(r)}}const Jpe={billboard:!0,sizeScale:1,sizeUnits:"pixels",sizeMinPixels:0,sizeMaxPixels:Number.MAX_SAFE_INTEGER,padding:{type:"array",value:[0,0,0,0]},getPosition:{type:"accessor",value:n=>n.position},getSize:{type:"accessor",value:1},getAngle:{type:"accessor",value:0},getPixelOffset:{type:"accessor",value:[0,0]},getBoundingRect:{type:"accessor",value:[0,0,0,0]},getFillColor:{type:"accessor",value:[0,0,0,255]},getLineColor:{type:"accessor",value:[0,0,0,255]},getLineWidth:{type:"accessor",value:1}};let ege=(()=>{class n extends Y0{getShaders(){return super.getShaders({vs:"#define SHADER_NAME text-background-layer-vertex-shader\n\nattribute vec2 positions;\n\nattribute vec3 instancePositions;\nattribute vec3 instancePositions64Low;\nattribute vec4 instanceRects;\nattribute float instanceSizes;\nattribute float instanceAngles;\nattribute vec2 instancePixelOffsets;\nattribute float instanceLineWidths;\nattribute vec4 instanceFillColors;\nattribute vec4 instanceLineColors;\nattribute vec3 instancePickingColors;\n\nuniform bool billboard;\nuniform float opacity;\nuniform float sizeScale;\nuniform float sizeMinPixels;\nuniform float sizeMaxPixels;\nuniform vec4 padding;\n\nvarying vec4 vFillColor;\nvarying vec4 vLineColor;\nvarying float vLineWidth;\nvarying vec2 uv;\nvarying vec2 dimensions;\n\nvec2 rotate_by_angle(vec2 vertex, float angle) {\n float angle_radian = radians(angle);\n float cos_angle = cos(angle_radian);\n float sin_angle = sin(angle_radian);\n mat2 rotationMatrix = mat2(cos_angle, -sin_angle, sin_angle, cos_angle);\n return rotationMatrix * vertex;\n}\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n geometry.uv = positions;\n geometry.pickingColor = instancePickingColors;\n uv = positions;\n vLineWidth = instanceLineWidths;\n float sizePixels = clamp(\n project_size_to_pixel(instanceSizes * sizeScale),\n sizeMinPixels, sizeMaxPixels\n );\n\n dimensions = instanceRects.zw * sizePixels + padding.xy + padding.zw;\n\n vec2 pixelOffset = (positions * instanceRects.zw + instanceRects.xy) * sizePixels + mix(-padding.xy, padding.zw, positions);\n pixelOffset = rotate_by_angle(pixelOffset, instanceAngles);\n pixelOffset += instancePixelOffsets;\n pixelOffset.y *= -1.0;\n\n if (billboard) {\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, vec3(0.0), geometry.position);\n vec3 offset = vec3(pixelOffset, 0.0);\n DECKGL_FILTER_SIZE(offset, geometry);\n gl_Position.xy += project_pixel_size_to_clipspace(offset.xy);\n } else {\n vec3 offset_common = vec3(project_pixel_size(pixelOffset), 0.0);\n DECKGL_FILTER_SIZE(offset_common, geometry);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, offset_common, geometry.position);\n }\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n vFillColor = vec4(instanceFillColors.rgb, instanceFillColors.a * opacity);\n DECKGL_FILTER_COLOR(vFillColor, geometry);\n vLineColor = vec4(instanceLineColors.rgb, instanceLineColors.a * opacity);\n DECKGL_FILTER_COLOR(vLineColor, geometry);\n}\n",fs:"#define SHADER_NAME text-background-layer-fragment-shader\n\nprecision highp float;\n\nuniform bool stroked;\n\nvarying vec4 vFillColor;\nvarying vec4 vLineColor;\nvarying float vLineWidth;\nvarying vec2 uv;\nvarying vec2 dimensions;\n\nvoid main(void) {\n geometry.uv = uv;\n\n vec2 pixelPosition = uv * dimensions;\n if (stroked) {\n float distToEdge = min(\n min(pixelPosition.x, dimensions.x - pixelPosition.x),\n min(pixelPosition.y, dimensions.y - pixelPosition.y)\n );\n float isBorder = smoothedge(distToEdge, vLineWidth);\n gl_FragColor = mix(vFillColor, vLineColor, isBorder);\n } else {\n gl_FragColor = vFillColor;\n }\n\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:[tS,nS]})}initializeState(){this.getAttributeManager().addInstanced({instancePositions:{size:3,type:5130,fp64:this.use64bitPositions(),transition:!0,accessor:"getPosition"},instanceSizes:{size:1,transition:!0,accessor:"getSize",defaultValue:1},instanceAngles:{size:1,transition:!0,accessor:"getAngle"},instanceRects:{size:4,accessor:"getBoundingRect"},instancePixelOffsets:{size:2,transition:!0,accessor:"getPixelOffset"},instanceFillColors:{size:4,transition:!0,normalized:!0,type:5121,accessor:"getFillColor",defaultValue:[0,0,0,255]},instanceLineColors:{size:4,transition:!0,normalized:!0,type:5121,accessor:"getLineColor",defaultValue:[0,0,0,255]},instanceLineWidths:{size:1,transition:!0,accessor:"getLineWidth",defaultValue:1}})}updateState({props:t,oldProps:i,changeFlags:r}){if(super.updateState({props:t,oldProps:i,changeFlags:r}),r.extensionsChanged){var s;const{gl:o}=this.context;null===(s=this.state.model)||void 0===s||s.delete(),this.state.model=this._getModel(o),this.getAttributeManager().invalidateAll()}}draw({uniforms:t}){const{viewport:i}=this.context,{billboard:r,sizeScale:s,sizeUnits:o,sizeMinPixels:a,sizeMaxPixels:l,getLineWidth:c}=this.props;let{padding:u}=this.props;const h="pixels"===o?i.metersPerPixel:1;u.length<4&&(u=[u[0],u[1],u[0],u[1]]),this.state.model.setUniforms(t).setUniforms({billboard:r,stroked:Boolean(c),padding:u,sizeScale:s*h,sizeMinPixels:a,sizeMaxPixels:l}).draw()}_getModel(t){return new Yg(t,Sn(ot({},this.getShaders()),{id:this.props.id,geometry:new gh({drawMode:6,vertexCount:4,attributes:{positions:{size:2,value:new Float32Array([0,0,1,0,1,1,0,1])}}}),isInstanced:!0}))}}return n.layerName="TextBackgroundLayer",n.defaultProps=Jpe,n})();const U4={fontSize:64,buffer:4,sdf:!1,radius:12,cutoff:.25,smoothing:.1},z4={start:1,middle:0,end:-1},H4={top:1,center:0,bottom:-1},lR=[0,0,0,255],nge=["fontSize","buffer","sdf","radius","cutoff"],ige={billboard:!0,sizeScale:1,sizeUnits:"pixels",sizeMinPixels:0,sizeMaxPixels:Number.MAX_SAFE_INTEGER,background:!1,getBackgroundColor:{type:"accessor",value:[255,255,255,255]},getBorderColor:{type:"accessor",value:lR},getBorderWidth:{type:"accessor",value:0},backgroundPadding:{type:"array",value:[0,0,0,0]},characterSet:{type:"object",value:O4},fontFamily:R4,fontWeight:"normal",lineHeight:1,outlineWidth:{type:"number",value:0,min:0},outlineColor:{type:"color",value:lR},fontSettings:{},wordBreak:"break-word",maxWidth:{type:"number",value:-1},getText:{type:"accessor",value:n=>n.text},getPosition:{type:"accessor",value:n=>n.position},getColor:{type:"accessor",value:lR},getSize:{type:"accessor",value:32},getAngle:{type:"accessor",value:0},getTextAnchor:{type:"accessor",value:"middle"},getAlignmentBaseline:{type:"accessor",value:"center"},getPixelOffset:{type:"accessor",value:[0,0]},backgroundColor:{deprecatedFor:["background","getBackgroundColor"]}};let rge=(()=>{class n extends Nz{initializeState(){this.state={styleVersion:0,fontAtlasManager:new Kpe}}updateState({props:t,oldProps:i,changeFlags:r}){const o=this.state.characterSet;(r.dataChanged||r.updateTriggersChanged&&(r.updateTriggersChanged.all||r.updateTriggersChanged.getText))&&this._updateText();const a=o!==this.state.characterSet||this._fontChanged(i,t);a&&this._updateFontAtlas(i,t),(a||t.lineHeight!==i.lineHeight||t.wordBreak!==i.wordBreak||t.maxWidth!==i.maxWidth)&&this.setState({styleVersion:this.state.styleVersion+1})}getPickingInfo({info:t}){return t.object=t.index>=0?this.props.data[t.index]:null,t}_updateFontAtlas(t,i){const{fontSettings:r,fontFamily:s,fontWeight:o}=i,{fontAtlasManager:a,characterSet:l}=this.state;a.setProps(Sn(ot(ot({},U4),r),{characterSet:l,fontFamily:s,fontWeight:o}))}_fontChanged(t,i){if(t.fontFamily!==i.fontFamily||t.fontWeight!==i.fontWeight)return!0;if(t.fontSettings===i.fontSettings)return!1;const r=t.fontSettings||{},s=i.fontSettings||{};return nge.some(o=>r[o]!==s[o])}_updateText(){const{data:t,characterSet:i}=this.props,r=t.attributes&&t.attributes.getText;let a,{getText:s}=this.props,{startIndices:o}=t;const l="auto"===i&&new Set;if(r&&o){const{texts:c,characterCount:u}=function({value:n,length:e,stride:t,offset:i,startIndices:r,characterSet:s}){const o=n.BYTES_PER_ELEMENT,a=t?t/o:1,l=i?i/o:0,c=r[e]||Math.ceil((n.length-l)/a),u=s&&new Set,h=new Array(e);let f=n;if(a>1||l>0){f=new n.constructor(c);for(let g=0;gc[f]}else{const{iterable:c,objectInfo:u}=bx(t);o=[0],a=0;for(const h of c){u.index++;const f=Array.from(s(h,u)||"");l&&f.forEach(l.add,l),a+=f.length,o.push(a)}}this.setState({getText:s,startIndices:o,numInstances:a,characterSet:l||i})}getBoundingRect(t,i){const r=this.state.fontAtlasManager.mapping,{getText:s}=this.state,{wordBreak:o,maxWidth:a,lineHeight:l,getTextAnchor:c,getAlignmentBaseline:u}=this.props,h=s(t,i)||"",{size:[f,g]}=I4(h,l,o,a,r);return[(z4["function"==typeof c?c(t,i):c]-1)*f/2,(H4["function"==typeof u?u(t,i):u]-1)*g/2,f,g]}getIconOffsets(t,i){const r=this.state.fontAtlasManager.mapping,{getText:s}=this.state,{wordBreak:o,maxWidth:a,lineHeight:l,getTextAnchor:c,getAlignmentBaseline:u}=this.props,h=s(t,i)||"",{x:f,y:g,rowWidth:m,size:[w,x]}=I4(h,l,o,a,r),U=z4["function"==typeof c?c(t,i):c],D=H4["function"==typeof u?u(t,i):u],ie=f.length,_e=new Array(2*ie);let Pe=0;for(let Ne=0;Net*e/255)}const uR={name:"lights",vs:G4,fs:G4,getUniforms:function $4(n=sge){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?cR(n):[0,0,0],e.forEach((r,s)=>{i[`lighting_uPointLight[${s}].color`]=cR(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`]=cR(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 $4({lightSources:e})}return{}},defines:{MAX_LIGHTS:3}},age={};const cge={name:"phong-lighting",dependencies:[uR],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=age){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}}},dR=Math.PI/180,iS=new Float32Array(16),Y4=new Float32Array(12);function X4(n,e,t){const i=e[0]*dR,r=e[1]*dR,s=e[2]*dR,o=Math.sin(s),a=Math.sin(i),l=Math.sin(r),c=Math.cos(s),u=Math.cos(i),h=Math.cos(r),f=t[0],g=t[1],m=t[2];n[0]=f*h*u,n[1]=f*l*u,n[2]=f*-a,n[3]=g*(-l*c+h*a*o),n[4]=g*(h*c+l*a*o),n[5]=g*u*o,n[6]=m*(l*o+h*a*c),n[7]=m*(-h*o+l*a*c),n[8]=m*u*c}function K4(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 Q4={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,u=Array.isArray(s),h=Array.isArray(r),f=Array.isArray(o),g=c||!l&&Boolean(a(i[0]));n.constant=g?c:h&&u&&f;const m=n.value;if(n.constant){let w;g?(iS.set(a),w=K4(iS)):(w=Y4,X4(w,r,s),w.set(o,9)),n.value=new Float32Array(w)}else{let w=e*n.size;const{iterable:x,objectInfo:U}=bx(i,e,t);for(const D of x){let ie;U.index++,g?(iS.set(c?a:a(D,U)),ie=K4(iS)):(ie=Y4,X4(ie,h?r:r(D,U),u?s:s(D,U)),ie.set(f?o:o(D,U),9)),m[w++]=ie[0],m[w++]=ie[1],m[w++]=ie[2],m[w++]=ie[3],m[w++]=ie[4],m[w++]=ie[5],m[w++]=ie[6],m[w++]=ie[7],m[w++]=ie[8],m[w++]=ie[9],m[w++]=ie[10],m[w++]=ie[11]}}}};function Z4(n,e){return e===Vi.CARTESIAN||e===Vi.METER_OFFSETS||e===Vi.DEFAULT&&!n.isGeospatial}function J4(n,e){(n.COLOR_0||n.colors)&&e||(n.colors={constant:!0,value:new Float32Array([1,1,1])}),Ri.assert(n.positions||n.POSITION,'no "postions" or "POSITION" attribute in mesh')}function hge(n,e){if(n.attributes)return J4(n.attributes,e),n instanceof gh?n:new gh(n);if(n.positions||n.POSITION)return J4(n,e),new gh({attributes:n});throw Error("Invalid mesh")}const fge={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 pge=(()=>{class n extends Y0{getShaders(){const t=!Ci(this.context.gl),i={};return mI(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:[tS,cge,nS],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:Q4}),this.setState({emptyTexture:new ya(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||Z4(i,s),flatShading:!this.state.hasNormals}).draw()}getModel(t){const i=new Yg(this.context.gl,Sn(ot({},this.getShaders()),{id:this.props.id,geometry:hge(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=fge,n})();const eH={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:[uR]};class rm{constructor(e={}){const{id:t}=e;this.id=t||ma(this.constructor.name),this.display=!0,this.position=new Mo,this.rotation=new Mo,this.scale=new Mo(1,1,1),this.matrix=new qn,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 on(3===e.length,"setPosition requires vector argument"),this.position=e,this}setRotation(e){return on(3===e.length,"setRotation requires vector argument"),this.rotation=e,this}setScale(e){return on(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){on(e),t=t||this.matrix;const i=new qn(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 tb extends rm{constructor(e={}){e=Array.isArray(e)?{children:e}:e;const{children:t=[]}=e;mn.assert(t.every(i=>i instanceof rm),"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 qn}={}){const i=new qn(t).multiplyRight(this.matrix);for(const r of this.children)r instanceof tb?r.traverse(e,{worldMatrix:i}):e(r,{worldMatrix:i})}}function tH(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],u=e[7],h=e[8],f=t[0],g=t[1],m=t[2],w=t[3],x=t[4],U=t[5],D=t[6],ie=t[7],_e=t[8];return n[0]=f*i+g*o+m*c,n[1]=f*r+g*a+m*u,n[2]=f*s+g*l+m*h,n[3]=w*i+x*o+U*c,n[4]=w*r+x*a+U*u,n[5]=w*s+x*l+U*h,n[6]=D*i+ie*o+_e*c,n[7]=D*r+ie*a+_e*u,n[8]=D*s+ie*l+_e*h,n}function nH(n,e,t){var i=t[0],r=t[1];return n[0]=i*e[0],n[1]=i*e[1],n[2]=i*e[2],n[3]=r*e[3],n[4]=r*e[4],n[5]=r*e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n}function iH(){var n=new ba(4);return ba!=Float32Array&&(n[0]=0,n[1]=0,n[2]=0),n[3]=1,n}function rH(n){return n[0]=0,n[1]=0,n[2]=0,n[3]=1,n}function hR(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 rS(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],u=t[3];return n[0]=i*u+o*a+r*c-s*l,n[1]=r*u+o*l+s*a-i*c,n[2]=s*u+o*c+i*l-r*a,n[3]=o*u-i*a-r*l-s*c,n}function sH(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);return n[0]=i*l+o*a,n[1]=r*l+s*a,n[2]=s*l-r*a,n[3]=o*l-i*a,n}function oH(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);return n[0]=i*l-s*a,n[1]=r*l+o*a,n[2]=s*l+i*a,n[3]=o*l-r*a,n}function aH(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);return n[0]=i*l+r*a,n[1]=r*l-i*a,n[2]=s*l+o*a,n[3]=o*l-s*a,n}function lH(n,e){var t=e[0],i=e[1],r=e[2];return n[0]=t,n[1]=i,n[2]=r,n[3]=Math.sqrt(Math.abs(1-t*t-i*i-r*r)),n}function nb(n,e,t,i){var f,g,m,w,x,r=e[0],s=e[1],o=e[2],a=e[3],l=t[0],c=t[1],u=t[2],h=t[3];return(g=r*l+s*c+o*u+a*h)<0&&(g=-g,l=-l,c=-c,u=-u,h=-h),1-g>eu?(f=Math.acos(g),m=Math.sin(f),w=Math.sin((1-i)*f)/m,x=Math.sin(i*f)/m):(w=1-i,x=i),n[0]=w*r+x*l,n[1]=w*s+x*c,n[2]=w*o+x*u,n[3]=w*a+x*h,n}function cH(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;return n[0]=-t*a,n[1]=-i*a,n[2]=-r*a,n[3]=s*a,n}function uH(n,e){return n[0]=-e[0],n[1]=-e[1],n[2]=-e[2],n[3]=e[3],n}function fR(n,e){var i,t=e[0]+e[4]+e[8];if(t>0)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}return n}var dH=function(n,e,t){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n},pR=IU,gR=function(n,e){return n[0]*e[0]+n[1]*e[1]+n[2]*e[2]+n[3]*e[3]},hH=function(n,e,t,i){var r=e[0],s=e[1],o=e[2],a=e[3];return 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),n},fH=function(n){return Math.hypot(n[0],n[1],n[2],n[3])},pH=function(n){var e=n[0],t=n[1],i=n[2],r=n[3];return e*e+t*t+i*i+r*r},mH=function(){var n=bj(),e=vj(1,0,0),t=vj(0,1,0);return function(i,r,s){var o=wj(r,s);return o<-.999999?(D0(n,e,r),function(n){return Math.hypot(n[0],n[1],n[2])}(n)<1e-6&&D0(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),hR(i,n,Math.PI),i):o>.999999?(i[0]=0,i[1]=0,i[2]=0,i[3]=1,i):(D0(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))}}();iH(),iH(),function(){var n=new ba(9);ba!=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 Sge=[0,0,0,1];class mR extends mx{constructor(e=0,t=0,i=0,r=1){super(-0,-0,-0,-0),Array.isArray(e)&&1===arguments.length?this.copy(e):this.set(e,t,i,r)}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this.check()}set(e,t,i,r){return this[0]=e,this[1]=t,this[2]=i,this[3]=r,this.check()}fromMatrix3(e){return fR(this,e),this.check()}identity(){return rH(this),this.check()}fromAxisRotation(e,t){return hR(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]=nr(e)}get y(){return this[1]}set y(e){this[1]=nr(e)}get z(){return this[2]}set z(e){this[2]=nr(e)}get w(){return this[3]}set w(e){this[3]=nr(e)}len(){return fH(this)}lengthSquared(){return pH(this)}dot(e,t){if(void 0!==t)throw new Error("Quaternion.dot only takes one argument");return gR(this,e)}rotationTo(e,t){return mH(this,e,t),this.check()}add(e,t){if(void 0!==t)throw new Error("Quaternion.add only takes one argument");return dH(this,this,e),this.check()}calculateW(){return lH(this,this),this.check()}conjugate(){return uH(this,this),this.check()}invert(){return cH(this,this),this.check()}lerp(e,t,i){return hH(this,e,t,i),this.check()}multiplyRight(e,t){return Zu(!t),rS(this,this,e),this.check()}multiplyLeft(e,t){return Zu(!t),rS(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 sH(this,this,e),this.check()}rotateY(e){return oH(this,this,e),this.check()}rotateZ(e){return aH(this,this,e),this.check()}scale(e){return pR(this,this,e),this.check()}slerp(e,t,i){switch(arguments.length){case 1:({start:e=Sge,target:t,ratio:i}=arguments[0]);break;case 2:[t,i]=arguments,e=this}return nb(this,e,t,i),this.check()}transformVector4(e,t=e){return OU(t,e,this),_x(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)}}const Cge={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Tge={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function _H(n){if(!n._animation){const e=Tge[n.componentType],t=Cge[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;l{(function(n,{input:e,interpolation:t,output:i},r,s){const a=n%e[e.length-1],l=e.findIndex(f=>f>=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:mn.warn(`Bad animation path ${s}`)()}on(r[s].length===i[c].length);const u=e[c],h=e[l];switch(t){case"STEP":!function(n,e,t){for(let i=0;iu&&function(n,e,t,i,r){if("rotation"===e){_R.slerp({start:t,target:i,ratio:r});for(let s=0;s<_R.length;s++)n[e][s]=_R[s]}else for(let s=0;su&&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:_H(e.accessors[a]),interpolation:l,output:_H(e.accessors[c])})),o=t.channels.map(({sampler:a,target:l})=>({sampler:s[a],target:e.nodes[l.node],path:l.path}));return new Pge({name:r,channels:o})})}animate(e){this.setTime(e)}setTime(e){this.animations.forEach(t=>t.animate(e))}getAnimations(){return this.animations}}class kge extends rm{constructor(e,t={}){super(t),this.onBeforeRender=null,this.AfterRender=null,e instanceof Yg?(this.model=e,this._setModelNodeProps(t)):this.model=new Yg(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 Fge{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},mI(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 ya(this.gl,ot({id:e.name||e.id,parameters:ot(ot({},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&&(mn.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 yH(n,e){return Ci(n)?`#version 300 es\n${e}`:e}const jge={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Uge={modelOptions:{},pbrDebug:!1,imageBasedLightingEnvironment:null,lights:!0,useTangents:!1};class zge{constructor(e,t={}){this.gl=e,this.options=Object.assign({},Uge,t)}instantiate(e){return this.gltf=e,(e.scenes||[]).map(i=>this.createScene(i))}createAnimator(){return Array.isArray(this.gltf.animations)?new Nge(this.gltf):null}createScene(e){const i=(e.nodes||[]).map(s=>this.createNode(s));return new tb({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 tb({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 qn).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 tb({id:e.name||e.id,children:i});e._mesh=r}return e._mesh}getVertexCount(e){mn.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 Fge(n,e);mn.info(4,"createGLTFModel defines: ",a.defines)();const l=[];l.push(...a.generatedTextures),l.push(...Object.values(s).map(u=>u.buffer));const c=new kge(n,Object.assign({id:t,drawMode:i,vertexCount:r,modules:[eH],defines:a.defines,parameters:a.parameters,vs:yH(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:yH(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))),mn.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 lr(this.gl,{id:`from-${i.id}`,data:i.data||e.value,target:t})),i.lumaBuffers[t]}createAccessor(e,t){return new _a({buffer:t,offset:e.byteOffset||0,stride:e.bufferView.byteStride||0,type:e.componentType,size:jge[e.type]})}createSampler(e){return e}needsPOT(){return!1}}function bH(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 sm(i,this.metadata)}selectAt(...e){const t=e.map(i=>this.fields[i]).filter(Boolean);return new sm(t,this.metadata)}assign(e){let t,i=this.metadata;if(e instanceof sm){const o=e;t=o.fields,i=xH(xH(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 sm(s,i)}}function xH(n,e){return new Map([...n||new Map,...e||new Map])}let kr,SH,CH,TH,AH,MH,DH,IH;!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"}(kr||(kr={}));class yR{static isNull(e){return e&&e.typeId===kr.Null}static isInt(e){return e&&e.typeId===kr.Int}static isFloat(e){return e&&e.typeId===kr.Float}static isBinary(e){return e&&e.typeId===kr.Binary}static isUtf8(e){return e&&e.typeId===kr.Utf8}static isBool(e){return e&&e.typeId===kr.Bool}static isDecimal(e){return e&&e.typeId===kr.Decimal}static isDate(e){return e&&e.typeId===kr.Date}static isTime(e){return e&&e.typeId===kr.Time}static isTimestamp(e){return e&&e.typeId===kr.Timestamp}static isInterval(e){return e&&e.typeId===kr.Interval}static isList(e){return e&&e.typeId===kr.List}static isStruct(e){return e&&e.typeId===kr.Struct}static isUnion(e){return e&&e.typeId===kr.Union}static isFixedSizeBinary(e){return e&&e.typeId===kr.FixedSizeBinary}static isFixedSizeList(e){return e&&e.typeId===kr.FixedSizeList}static isMap(e){return e&&e.typeId===kr.Map}static isDictionary(e){return e&&e.typeId===kr.Dictionary}get typeId(){return kr.NONE}compareTo(e){return this===e}}Symbol,Symbol,SH=Symbol.toStringTag;class om extends yR{constructor(e,t){super(),Kn(this,"isSigned",void 0),Kn(this,"bitWidth",void 0),this.isSigned=e,this.bitWidth=t}get typeId(){return kr.Int}get[SH](){return"Int"}toString(){return`${this.isSigned?"I":"Ui"}nt${this.bitWidth}`}}class Zge extends om{constructor(){super(!0,8)}}class Jge extends om{constructor(){super(!0,16)}}class eme extends om{constructor(){super(!0,32)}}class tme extends om{constructor(){super(!1,8)}}class nme extends om{constructor(){super(!1,16)}}class ime extends om{constructor(){super(!1,32)}}CH=Symbol.toStringTag;class OH extends yR{constructor(e){super(),Kn(this,"precision",void 0),this.precision=e}get typeId(){return kr.Float}get[CH](){return"Float"}toString(){return`Float${this.precision}`}}class rme extends OH{constructor(){super(32)}}class sme extends OH{constructor(){super(64)}}Symbol,Symbol,TH=Symbol.toStringTag,AH=Symbol.toStringTag,MH=Symbol.toStringTag,DH=Symbol.toStringTag,IH=Symbol.toStringTag;class ome extends yR{constructor(e,t){super(),Kn(this,"listSize",void 0),Kn(this,"children",void 0),this.listSize=e,this.children=[t]}get typeId(){return kr.FixedSizeList}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get[IH](){return"FixedSizeList"}toString(){return`FixedSizeList[${this.listSize}]<${this.valueType}>`}}class sS{constructor(e,t,i=!1,r=new Map){Kn(this,"name",void 0),Kn(this,"type",void 0),Kn(this,"nullable",void 0),Kn(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 sS(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 RH(n,e,t){const i=t?PH(t.metadata):void 0,r=function(n){switch(n.constructor){case Int8Array:return new Zge;case Uint8Array:return new tme;case Int16Array:return new Jge;case Uint16Array:return new nme;case Int32Array:return new eme;case Uint32Array:return new ime;case Float32Array:return new rme;case Float64Array:return new sme;default:throw new Error("array type not supported")}}(e.value);return new sS(n,new ome(e.size,new sS("value",r)),!1,i)}function PH(n){const e=new Map;for(const t in n)e.set(`${t}.string`,JSON.stringify(n[t]));return e}const NH={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},ume={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array};class hme{constructor(e){Kn(this,"draco",void 0),Kn(this,"decoder",void 0),Kn(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 f=`DRACO decompression failed: ${o.error_msg()}`;throw new Error(f)}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?u:r,s=h>s?h:s,o=f>o?f:o}return[[e,t,i],[r,s,o]]}(l.attributes),u=function(n,e,t){const i=PH(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=RH(o,n[o],s[o]);r.push(l)}if(t){const o=RH("indices",t);r.push(o)}return new sm(r,i)}(l.attributes,a,l.indices);return Sn(ot({loader:"draco",loaderData:a,header:{vertexCount:s.num_points(),boundingBox:c}},l),{schema:u})}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 oS=et(9125);const ER={};function xR(n){return SR.apply(this,arguments)}function SR(){return(SR=li(function*(n,e=null,t={}){return e&&(n=_me(n,e,t)),ER[n]=ER[n]||yme(n),yield ER[n]})).apply(this,arguments)}function _me(n,e,t){if(n.startsWith("http"))return n;const i=t.modules||{};return i[n]?i[n]:_O?t.CDN?(nu(t.CDN.startsWith("http")),`${t.CDN}/${e}@3.0.12/dist/libs/${n}`):yO?`../src/libs/${n}`:`modules/${e}/src/libs/${n}`:`modules/${e}/dist/libs/${n}`}function yme(n){return CR.apply(this,arguments)}function CR(){return(CR=li(function*(n){return n.endsWith("wasm")?yield(yield fetch(n)).arrayBuffer():_O?yO?importScripts(n):bme(yield(yield fetch(n)).text(),n):oS.requireFromFile&&(yield oS.requireFromFile(n))})).apply(this,arguments)}function bme(n,e){if(!_O)return oS.requireFromString&&oS.requireFromString(n,e);if(yO)return eval.call(Iue,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 vme="https://www.gstatic.com/draco/versioned/decoders/1.4.1/draco_decoder.js",wme="https://www.gstatic.com/draco/versioned/decoders/1.4.1/draco_wasm_wrapper.js",Eme="https://www.gstatic.com/draco/versioned/decoders/1.4.1/draco_decoder.wasm";let ib;function Sme(n){return TR.apply(this,arguments)}function TR(){return(TR=li(function*(n){const e=n.modules||{};return ib=e.draco3d?ib||e.draco3d.createDecoderModule({}).then(t=>({draco:t})):ib||Cme(n),yield ib})).apply(this,arguments)}function Cme(n){return MR.apply(this,arguments)}function MR(){return(MR=li(function*(n){let e,t;switch(n.draco&&n.draco.decoderType){case"js":e=yield xR(vme,"draco",n);break;case"wasm":default:[e,t]=yield Promise.all([yield xR(wme,"draco",n),yield xR(Eme,"draco",n)])}return e=e||globalThis.DracoDecoderModule,yield Tme(e,t)})).apply(this,arguments)}function Tme(n,e){const t={};return e&&(t.wasmBinary=e),new Promise(i=>{n(Sn(ot({},t),{onModuleLoaded:r=>i({draco:r})}))})}const IR=Sn(ot({},EH),{parse:function(n,e){return OR.apply(this,arguments)}});function OR(){return(OR=li(function*(n,e){const{draco:t}=yield Sme(e),i=new hme(t);try{return i.parseSync(n,null==e?void 0:e.draco)}finally{i.destroy()}})).apply(this,arguments)}function sb(n,e){return Lf(n>=0),Lf(e>0),n+(e-1)&~(e-1)}function Dme(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+sb(i.byteLength,4)}const kH=["SCALAR","VEC2","VEC3","VEC4"],Ime=[[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Uint32Array,5125],[Float32Array,5126],[Float64Array,5130]],Ome=new Map(Ime),Rme={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Pme={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},Nme={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function FH(n){return kH[n-1]||kH[0]}function LH(n){const e=Ome.get(n.constructor);if(!e)throw new Error("Illegal typed array");return e}function BH(n,e){const t=Nme[n.componentType],i=Rme[n.type],s=n.count*i,o=n.count*i*Pme[n.componentType];return $a(o>=0&&o<=e.byteLength),{ArrayType:t,length:s,byteLength:o}}const kme={asset:{version:"2.0",generator:"loaders.gl"},buffers:[]};class _h{constructor(e){Kn(this,"gltf",void 0),Kn(this,"sourceBuffers",void 0),Kn(this,"byteLength",void 0),this.gltf=e||{json:ot({},kme),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 $a(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}=BH(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 $a(t),this.json.extensions=this.json.extensions||{},this.json.extensions[e]=t,this.registerUsedExtension(e),t}addRequiredExtension(e,t={}){return $a(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=eR(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;$a(Number.isFinite(t)),this.sourceBuffers=this.sourceBuffers||[],this.sourceBuffers.push(e);const i={buffer:0,byteOffset:this.byteLength,byteLength:t};return this.byteLength+=sb(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:FH(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:LH(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=Dme(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*Wme(n){for(const e of n.json.meshes||[])for(const t of e.primitives)yield t}function qme(n){return NR.apply(this,arguments)}function NR(){return(NR=li(function*(n){const e=new _h(n),{json:t}=e;e.removeExtension(lS);for(const i of t.materials||[])i.extensions&&i.extensions.KHR_materials_unlit&&(i.unlit=!0),e.removeObjectExtension(i,lS)})).apply(this,arguments)}function Yme(n){const e=new _h(n),{json:t}=e;if(e.materials)for(const i of t.materials||[])i.unlit&&(delete i.unlit,e.addObjectExtension(i,lS,{}),e.addExtension(lS))}function Xme(n){return kR.apply(this,arguments)}function kR(){return(kR=li(function*(n){const e=new _h(n),{json:t}=e,i=e.getExtension(am);i&&(e.json.lights=i.lights,e.removeExtension(am));for(const r of t.nodes||[]){const s=e.getObjectExtension(r,am);s&&(r.light=s.light),e.removeObjectExtension(r,am)}})).apply(this,arguments)}function Kme(n){return FR.apply(this,arguments)}function FR(){return(FR=li(function*(n){const e=new _h(n),{json:t}=e;if(t.lights){const i=e.addExtension(am);$a(!i.lights),i.lights=t.lights,delete t.lights}if(e.json.lights){for(const i of e.json.lights)e.addObjectExtension(i.node,am,i);delete e.json.lights}})).apply(this,arguments)}function Qme(n){return LR.apply(this,arguments)}function LR(){return(LR=li(function*(n){const e=new _h(n),{json:t}=e,i=e.getExtension(cS);if(i){const r=Jme(i,e);for(const s of t.materials||[]){const o=e.getObjectExtension(s,cS);o&&(s.technique=Object.assign({},o,r[o.technique]),s.technique.values=e_e(s.technique,e)),e.removeObjectExtension(s,cS)}e.removeExtension(cS)}})).apply(this,arguments)}function Zme(n,e){return BR.apply(this,arguments)}function BR(){return(BR=li(function*(n,e){})).apply(this,arguments)}function Jme(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 e_e(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 UH={KHR_draco_mesh_compression:yt,KHR_materials_unlit:ee,KHR_lights_punctual:Dt,KHR_techniques_webgl:dt};function t_e(n){return VR.apply(this,arguments)}function VR(){return(VR=li(function*(n,e={},t){for(const r in UH){var i;const s=(null==e||null===(i=e.gltf)||void 0===i?void 0:i.excludeExtensions)||{};r in s&&!s[r]||(yield UH[r].decode(n,e,t))}})).apply(this,arguments)}const zH={accessors:"accessor",animations:"animation",buffers:"buffer",bufferViews:"bufferView",images:"image",materials:"material",meshes:"mesh",nodes:"node",samplers:"sampler",scenes:"scene",skins:"skin",textures:"texture"},i_e={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 r_e{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 _h(n),{json:t}=e;for(const i of t.images||[]){const r=e.removeObjectExtension(i,VH);r&&Object.assign(i,r)}t.buffers&&t.buffers[0]&&delete t.buffers[0].uri,e.removeExtension(VH)}(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 zH)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 zH)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=i_e[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 s_e(n,e={}){return(new r_e).normalize(n,e)}const o_e={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},a_e={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},Ml={TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,REPEAT:10497,LINEAR:9729,NEAREST_MIPMAP_LINEAR:9986},l_e={magFilter:Ml.TEXTURE_MAG_FILTER,minFilter:Ml.TEXTURE_MIN_FILTER,wrapS:Ml.TEXTURE_WRAP_S,wrapT:Ml.TEXTURE_WRAP_T},c_e={[Ml.TEXTURE_MAG_FILTER]:Ml.LINEAR,[Ml.TEXTURE_MIN_FILTER]:Ml.NEAREST_MIPMAP_LINEAR,[Ml.TEXTURE_WRAP_S]:Ml.REPEAT,[Ml.TEXTURE_WRAP_]:Ml.REPEAT};class h_e{postProcess(e,t={}){const{json:i,buffers:r=[],images:s=[],baseUri:o=""}=e;return $a(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=ot({},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=ot({},e.normalTexture),e.normalTexture.texture=this.getTexture(e.normalTexture.index)),e.occlusionTexture&&(e.occlustionTexture=ot({},e.occlustionTexture),e.occlusionTexture.texture=this.getTexture(e.occlusionTexture.index)),e.emissiveTexture&&(e.emmisiveTexture=ot({},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=ot({},e.pbrMetallicRoughness);const i=e.pbrMetallicRoughness;i.baseColorTexture&&(i.baseColorTexture=ot({},i.baseColorTexture),i.baseColorTexture.texture=this.getTexture(i.baseColorTexture.index)),i.metallicRoughnessTexture&&(i.metallicRoughnessTexture=ot({},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 a_e[n]}(e.componentType),e.components=function(n){return o_e[n]}(e.type),e.bytesPerElement=e.bytesPerComponent*e.components,e.bufferView){const i=e.bufferView.buffer,{ArrayType:r,byteLength:s}=BH(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):c_e,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 l_e[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 f_e(n,e){return(new h_e).postProcess(n,e)}const HH=1735152710,lm=!0;function UR(n,e,t,i){const r=new Uint8Array(e.buffer,t,i),o=new TextDecoder("utf8").decode(r);return n.json=JSON.parse(o),sb(i,4)}function zR(n,e,t,i){return n.header.hasBinChunk=!0,n.binChunks.push({byteOffset:t,byteLength:i,arrayBuffer:e.buffer}),sb(i,4)}function C_e(n,e){return HR.apply(this,arguments)}function HR(){return(HR=li(function*(n,e,t=0,i,r){var s,o,a,l;T_e(n,e,t,i),s_e(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 A_e(n,i,r)),null!=i&&null!==(a=i.gltf)&&void 0!==a&&a.loadImages){const h=M_e(n,i,r);c.push(h)}const u=t_e(n,i,r);return c.push(u),yield Promise.all(c),null!=i&&null!==(l=i.gltf)&&void 0!==l&&l.postProcess?f_e(n,i):n})).apply(this,arguments)}function T_e(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=HH}=t,s=i.getUint32(e,!1);return s===r||s===HH}(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)?bH(n.buffer,n.byteOffset,e):n instanceof ArrayBuffer?bH(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,lm),a=r.getUint32(t+8,lm);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){Lf(n.header.byteLength>20);const i=e.getUint32(t+0,lm),r=e.getUint32(t+4,lm);return t+=8,Lf(0===r),UR(n,e,t,i),(t+=i)+zR(n,e,t,n.header.byteLength)}(n,r,t);case 2:return function(n,e,t,i){return Lf(n.header.byteLength>20),function(n,e,t,i){for(;t+8<=n.header.byteLength;){const r=e.getUint32(t+0,lm),s=e.getUint32(t+4,lm);switch(t+=8,s){case 1313821514:UR(n,e,t,r);break;case 5130562:zR(n,e,t,r);break;case 0:i.strict||UR(n,e,t,r);break;case 1:i.strict||zR(n,e,t,r)}t+=sb(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),$a("glTF"===o.type,`Invalid GLB magic string ${o.type}`),n._glb=o,n.json=o.json}else $a(!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 A_e(n,e,t){return GR.apply(this,arguments)}function GR(){return(GR=li(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 R_e(()=>e.some(t=>!t.loaded))})).apply(this,arguments)}function R_e(n){return XR.apply(this,arguments)}function XR(){return(XR=li(function*(n){for(;n();)yield new Promise(e=>requestAnimationFrame(e))})).apply(this,arguments)}const GH=[255,255,255,255],k_e={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:GH},_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:[cm]};let F_e=(()=>{class n extends Y0{getShaders(){const t=[tS,nS];return"pbr"===this.props._lighting&&t.push(eH),{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:GH,transition:!0},instanceModelMatrix:Q4})}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 rm)r={scenes:[t.scenegraph]};else if(t.scenegraph&&!t.scenegraph.gltf){const l=t.scenegraph,c=function(n,e,t){const i=new zge(n,t);return{scenes:i.instantiate(e),animator:i.createAnimator()}}(i,l,this._getModelOptions());r=ot({gltf:l},c),function(n){return YR.apply(this,arguments)}(c).then(()=>this.setNeedsRedraw())}else t.scenegraph&&(Ri.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 rm?(this._deleteScenegraph(),this._applyAllAttributes(o),this._applyAnimationsProp(o,a,t._animations),this.setState({scenegraph:o,animator:a})):null!==o&&Ri.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):Ri.warn("animation ".concat(o," not found"))()}})}_deleteScenegraph(){const{scenegraph:t}=this.state;t instanceof rm&&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:ot({isInstanced:!0,transpileToGLSL100:!Ci(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:u}=this.props,h=this.getNumInstances();this.state.scenegraph.traverse((f,{worldMatrix:g})=>{f.model.setInstanceCount(h),f.updateModuleSettings(t),f.draw({parameters:i,uniforms:{sizeScale:o,opacity:c,sizeMinPixels:a,sizeMaxPixels:l,composeModelMatrix:Z4(s,u),sceneModelMatrix:g,u_Camera:f.model.getUniforms().project_uCameraPosition}})})}}return n.layerName="ScenegraphLayer",n.defaultProps=k_e,n})();class L_e extends gh{constructor(e={}){const{id:t=ma("sphere-geometry")}=e,{indices:i,attributes:r}=function(n){const{nlat:e=10,nlong:t=10}=n;let{radius:i=1}=n;const o=Math.PI-0,c=2*Math.PI-0,u=(e+1)*(t+1);if("number"==typeof i){const U=i;i=(D,ie,_e,Pe,Ne)=>U}const h=new Float32Array(3*u),f=new Float32Array(3*u),g=new Float32Array(2*u),w=new(u>65535?Uint32Array:Uint16Array)(e*t*6);for(let U=0;U<=e;U++)for(let D=0;D<=t;D++){const ie=D/t,_e=U/e,Pe=D+U*(t+1),Ne=2*Pe,Ve=3*Pe,bt=c*ie,xt=o*_e,At=Math.sin(bt),Bt=Math.cos(bt),Wt=Math.sin(xt),mt=Bt*Wt,jt=Math.cos(xt),ft=At*Wt,Yt=i(mt,jt,ft,ie,_e);h[Ve+0]=Yt*mt,h[Ve+1]=Yt*jt,h[Ve+2]=Yt*ft,f[Ve+0]=mt,f[Ve+1]=jt,f[Ve+2]=ft,g[Ne+0]=ie,g[Ne+1]=1-_e}const x=t+1;for(let U=0;Us?(gt=i,Wt=1,mt=t):mt=e+Bt/s*(t-e),(-2===Bt||Bt===s+2)&&(mt=0,Wt=0),gt-=i/2;for(let jt=0;jts?0:ft*w,Ve[xt+Pe[1]]=Bt<0?-1:Bt>s?1:x,Ve[xt+Pe[2]]=Bt<0||Bt>s?0:Yt*w,bt[At+0]=jt/r,bt[At+1]=Wt,At+=2,xt+=3}}for(let Bt=0;Bt0){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 ce){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 ce){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 ce){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 ce){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 ce){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=K_e,s=1/i;r.set(this.x*s,this.y*s,this.z*s);const o=Q_e;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(WH),WH.almostEquals(e,t)}clone(){return new ce(this.x,this.y,this.z)}}ce.ZERO=void 0,ce.UNIT_X=void 0,ce.UNIT_Y=void 0,ce.UNIT_Z=void 0,ce.ZERO=new ce(0,0,0),ce.UNIT_X=new ce(1,0,0),ce.UNIT_Y=new ce(0,1,0),ce.UNIT_Z=new ce(0,0,1);const K_e=new ce,Q_e=new ce,WH=new ce;class pr{constructor(e={}){this.lowerBound=void 0,this.upperBound=void 0,this.lowerBound=new ce,this.upperBound=new ce,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,u=this.upperBound;e.copy(c),t.set(u.x,c.y,c.z),i.set(u.x,u.y,c.z),r.set(c.x,u.y,u.z),s.set(u.x,c.y,u.z),o.set(c.x,u.y,c.z),a.set(c.x,c.y,u.z),l.copy(u)}toLocalFrame(e,t){const i=YH;this.getCorners(i[0],i[1],i[2],i[3],i[4],i[5],i[6],i[7]);for(let f=0;8!==f;f++){const g=i[f];e.pointToLocal(g,g)}return t.setFromPoints(i)}toWorldFrame(e,t){const i=YH;this.getCorners(i[0],i[1],i[2],i[3],i[4],i[5],i[6],i[7]);for(let f=0;8!==f;f++){const g=i[f];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,u=(this.upperBound.y-i.y)*s,h=(this.lowerBound.z-i.z)*o,f=(this.upperBound.z-i.z)*o,g=Math.max(Math.max(Math.min(a,l),Math.min(c,u)),Math.min(h,f)),m=Math.min(Math.min(Math.max(a,l),Math.max(c,u)),Math.max(h,f));return!(m<0||g>m)}}const qH=new ce,YH=[new ce,new ce,new ce,new ce,new ce,new ce,new ce,new ce];class us{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 ce){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=J_e;e.tangents(i,eye),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(Er(e.length(),2)*Er(t.length(),2))+e.dot(t),this.normalize()}return this}mult(e,t=new us){const i=this.x,r=this.y,s=this.z,o=this.w,a=e.x,l=e.y,c=e.z,u=e.w;return t.x=i*u+o*a+r*c-s*l,t.y=r*u+o*l+s*a-i*c,t.z=s*u+o*c+i*l-r*a,t.w=o*u-i*a-r*l-s*c,t}inverse(e=new us){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 us){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 ce){const i=e.x,r=e.y,s=e.z,o=this.x,a=this.y,l=this.z,c=this.w,u=c*i+a*s-l*r,h=c*r+l*i-o*s,f=c*s+o*r-a*i,g=-o*i-a*r-l*s;return t.x=u*c+g*-o+h*-l-f*-a,t.y=h*c+g*-a+f*-o-u*-l,t.z=f*c+g*-l+u*-a-h*-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 u=o*a+l*c;if(u>.499&&(i=2*Math.atan2(o,c),r=Math.PI/2,s=0),u<-.499&&(i=-2*Math.atan2(o,c),r=-Math.PI/2,s=0),void 0===i){const h=o*o,g=l*l;i=Math.atan2(2*a*c-2*o*l,1-a*a*2-2*g),r=Math.asin(2*u),s=Math.atan2(2*o*c-2*a*l,1-2*h-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),u=Math.sin(i/2);return"XYZ"===r?(this.x=l*o*a+s*c*u,this.y=s*c*a-l*o*u,this.z=s*o*u+l*c*a,this.w=s*o*a-l*c*u):"YXZ"===r?(this.x=l*o*a+s*c*u,this.y=s*c*a-l*o*u,this.z=s*o*u-l*c*a,this.w=s*o*a+l*c*u):"ZXY"===r?(this.x=l*o*a-s*c*u,this.y=s*c*a+l*o*u,this.z=s*o*u+l*c*a,this.w=s*o*a-l*c*u):"ZYX"===r?(this.x=l*o*a-s*c*u,this.y=s*c*a+l*o*u,this.z=s*o*u-l*c*a,this.w=s*o*a+l*c*u):"YZX"===r?(this.x=l*o*a+s*c*u,this.y=s*c*a+l*o*u,this.z=s*o*u-l*c*a,this.w=s*o*a-l*c*u):"XZY"===r&&(this.x=l*o*a-s*c*u,this.y=s*c*a-l*o*u,this.z=s*o*u+l*c*a,this.w=s*o*a+l*c*u),this}clone(){return new us(this.x,this.y,this.z,this.w)}slerp(e,t,i=new us){const r=this.x,s=this.y,o=this.z,a=this.w;let f,g,m,w,x,l=e.x,c=e.y,u=e.z,h=e.w;return g=r*l+s*c+o*u+a*h,g<0&&(g=-g,l=-l,c=-c,u=-u,h=-h),1-g>1e-6?(f=Math.acos(g),m=Math.sin(f),w=Math.sin((1-t)*f)/m,x=Math.sin(t*f)/m):(w=1-t,x=t),i.x=w*r+x*l,i.y=w*s+x*c,i.z=w*o+x*u,i.w=w*a+x*h,i}integrate(e,t,i,r=new us){const s=e.x*i.x,o=e.y*i.y,a=e.z*i.z,l=this.x,c=this.y,u=this.z,h=this.w,f=.5*t;return r.x+=f*(s*h+o*u-a*c),r.y+=f*(o*h+a*l-s*u),r.z+=f*(a*h+s*c-o*l),r.w+=f*(-s*l-o*c-a*u),r}}const J_e=new ce,eye=new ce,tye={SPHERE:1,PLANE:2,BOX:4,COMPOUND:8,CONVEXPOLYHEDRON:16,HEIGHTFIELD:32,PARTICLE:64,CYLINDER:128,TRIMESH:256};let _n=(()=>{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=tye,n})();class $i{constructor(e={}){this.position=void 0,this.quaternion=void 0,this.position=new ce,this.quaternion=new us,e.position&&this.position.copy(e.position),e.quaternion&&this.quaternion.copy(e.quaternion)}pointToLocal(e,t){return $i.pointToLocalFrame(this.position,this.quaternion,e,t)}pointToWorld(e,t){return $i.pointToWorldFrame(this.position,this.quaternion,e,t)}vectorToWorldFrame(e,t=new ce){return this.quaternion.vmult(e,t),t}static pointToLocalFrame(e,t,i,r=new ce){return i.vsub(e,r),t.conjugate(KH),KH.vmult(r,r),r}static pointToWorldFrame(e,t,i,r=new ce){return t.vmult(i,r),r.vadd(e,r),r}static vectorToWorldFrame(e,t,i=new ce){return e.vmult(t,i),i}static vectorToLocalFrame(e,t,i,r=new ce){return t.w*=-1,t.vmult(i,r),t.w*=-1,r}}const KH=new us;class jf extends _n{constructor(e={}){const{vertices:t=[],faces:i=[],normals:r=[],axes:s,boundingSphereRadius:o}=e;super({type:_n.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 ce;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 u=!1;for(let h=0;h!==i.length;h++)if(i[h].almostEquals(r)||i[h].almostEquals(r)){u=!0;break}u||i.push(r.clone())}}}computeNormals(){this.faceNormals.length=this.faces.length;for(let e=0;ef&&(f=w,h=m)}const g=[];for(let m=0;m=0&&this.clipFaceAgainstHull(o,e,t,g,a,l,c)}findSeparatingAxis(e,t,i,r,s,o,a,l){const c=new ce,u=new ce,h=new ce,f=new ce,g=new ce,m=new ce;let w=Number.MAX_VALUE;const x=this;if(x.uniqueAxes)for(let U=0;U!==x.uniqueAxes.length;U++){i.vmult(x.uniqueAxes[U],c);const D=x.testSepAxis(c,e,t,i,r,s);if(!1===D)return!1;D0&&o.negate(o),!0}testSepAxis(e,t,i,r,s,o){jf.project(this,e,i,r,KR),jf.project(t,e,s,o,QR);const l=KR[0],c=KR[1],u=QR[0],h=QR[1];if(l0?1/t:0,this.material=e.material||null,this.linearDamping="number"==typeof e.linearDamping?e.linearDamping:.01,this.type=t<=0?yn.STATIC:yn.DYNAMIC,typeof e.type==typeof yn.STATIC&&(this.type=e.type),this.allowSleep=void 0===e.allowSleep||e.allowSleep,this.sleepState=yn.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 ce,this.quaternion=new us,this.initQuaternion=new us,this.previousQuaternion=new us,this.interpolatedQuaternion=new us,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 ce,e.angularVelocity&&this.angularVelocity.copy(e.angularVelocity),this.initAngularVelocity=new ce,this.shapes=[],this.shapeOffsets=[],this.shapeOrientations=[],this.inertia=new ce,this.invInertia=new ce,this.invInertiaWorld=new lu,this.invMassSolve=0,this.invInertiaSolve=new ce,this.invInertiaWorldSolve=new lu,this.fixedRotation=void 0!==e.fixedRotation&&e.fixedRotation,this.angularDamping=void 0!==e.angularDamping?e.angularDamping:.01,this.linearFactor=new ce(1,1,1),e.linearFactor&&this.linearFactor.copy(e.linearFactor),this.angularFactor=new ce(1,1,1),e.angularFactor&&this.angularFactor.copy(e.angularFactor),this.aabb=new pr,this.aabbNeedsUpdate=!0,this.boundingRadius=0,this.wlambda=new ce,this.isTrigger=Boolean(e.isTrigger),e.shape&&this.addShape(e.shape),this.updateMassProperties()}wakeUp(){const e=this.sleepState;this.sleepState=yn.AWAKE,this.wakeUpAfterNarrowphase=!1,e===yn.SLEEPING&&this.dispatchEvent(yn.wakeupEvent)}sleep(){this.sleepState=yn.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=Er(this.sleepSpeedLimit,2);t===yn.AWAKE&&ir?this.wakeUp():t===yn.SLEEPY&&e-this.timeLastSleepy>this.sleepTimeLimit&&(this.sleep(),this.dispatchEvent(yn.sleepEvent))}}updateSolveMassProperties(){this.sleepState===yn.SLEEPING||this.type===yn.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 ce){return e.vsub(this.position,t),this.quaternion.conjugate().vmult(t,t),t}vectorToLocalFrame(e,t=new ce){return this.quaternion.conjugate().vmult(e,t),t}pointToWorldFrame(e,t=new ce){return this.quaternion.vmult(e,t),t.vadd(this.position,t),t}vectorToWorldFrame(e,t=new ce){return this.quaternion.vmult(e,t),t}addShape(e,t,i){const r=new ce,s=new us;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=rye,o=sye,a=this.quaternion,l=this.aabb,c=oye;for(let u=0;u!==r;u++){const h=e[u];a.vmult(t[u],s),s.vadd(this.position,s),a.mult(i[u],o),h.calculateWorldAABB(s,o,c.lowerBound,c.upperBound),0===u?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=aye,r=lye;i.setRotationFromQuaternion(this.quaternion),i.transpose(r),i.scale(t,i),i.mmult(r,this.invInertiaWorld)}}applyForce(e,t=new ce){if(this.type!==yn.DYNAMIC)return;this.sleepState===yn.SLEEPING&&this.wakeUp();const i=cye;t.cross(e,i),this.force.vadd(e,this.force),this.torque.vadd(i,this.torque)}applyLocalForce(e,t=new ce){if(this.type!==yn.DYNAMIC)return;const i=uye,r=dye;this.vectorToWorldFrame(e,i),this.vectorToWorldFrame(t,r),this.applyForce(i,r)}applyTorque(e){this.type===yn.DYNAMIC&&(this.sleepState===yn.SLEEPING&&this.wakeUp(),this.torque.vadd(e,this.torque))}applyImpulse(e,t=new ce){if(this.type!==yn.DYNAMIC)return;this.sleepState===yn.SLEEPING&&this.wakeUp();const i=t,r=hye;r.copy(e),r.scale(this.invMass,r),this.velocity.vadd(r,this.velocity);const s=fye;i.cross(e,s),this.invInertiaWorld.vmult(s,s),this.angularVelocity.vadd(s,this.angularVelocity)}applyLocalImpulse(e,t=new ce){if(this.type!==yn.DYNAMIC)return;const i=pye,r=gye;this.vectorToWorldFrame(e,i),this.vectorToWorldFrame(t,r),this.applyImpulse(i,r)}updateMassProperties(){const e=mye;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),dS.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 ce;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!==yn.DYNAMIC&&this.type!==yn.KINEMATIC||this.sleepState===yn.SLEEPING)return;const r=this.velocity,s=this.angularVelocity,o=this.position,a=this.force,l=this.torque,c=this.quaternion,h=this.invInertiaWorld,f=this.linearFactor,g=this.invMass*e;r.x+=a.x*g*f.x,r.y+=a.y*g*f.y,r.z+=a.z*g*f.z;const m=h.elements,w=this.angularFactor,x=l.x*w.x,U=l.y*w.y,D=l.z*w.z;s.x+=e*(m[0]*x+m[1]*U+m[2]*D),s.y+=e*(m[3]*x+m[4]*U+m[5]*D),s.z+=e*(m[6]*x+m[7]*U+m[8]*D),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()}}yn.idCounter=0,yn.COLLIDE_EVENT_NAME="collide",yn.DYNAMIC=1,yn.STATIC=2,yn.KINEMATIC=4,yn.AWAKE=0,yn.SLEEPY=1,yn.SLEEPING=2,yn.wakeupEvent={type:"wakeup"},yn.sleepyEvent={type:"sleepy"},yn.sleepEvent={type:"sleep"};const rye=new ce,sye=new us,oye=new pr,aye=new lu,lye=new lu,cye=new ce,uye=new ce,dye=new ce,hye=new ce,fye=new ce,pye=new ce,gye=new ce,mye=new ce;new ce,new ce;class hS{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 ce,this.rayToWorld=new ce,this.hitNormalWorld=new ce,this.hitPointWorld=new ce,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 QH,ZH,JH,e8,t8,n8,i8;QH=_n.types.SPHERE,ZH=_n.types.PLANE,JH=_n.types.BOX,e8=_n.types.CYLINDER,t8=_n.types.CONVEXPOLYHEDRON,n8=_n.types.HEIGHTFIELD,i8=_n.types.TRIMESH;class ys{get[QH](){return this._intersectSphere}get[ZH](){return this._intersectPlane}get[JH](){return this._intersectBox}get[e8](){return this._intersectConvex}get[t8](){return this._intersectConvex}get[n8](){return this._intersectHeightfield}get[i8](){return this._intersectTrimesh}constructor(e=new ce,t=new ce){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 ce,this.precision=1e-4,this.checkCollisionResponse=!0,this.skipBackfaces=!1,this.collisionFilterMask=-1,this.collisionFilterGroup=-1,this.mode=ys.ANY,this.result=new hS,this.hasHit=!1,this.callback=i=>{}}intersectWorld(e,t){return this.mode=t.mode||ys.ANY,this.result=t.result||new hS,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(r8),tP.length=0,e.broadphase.aabbQuery(e,r8,tP),this.intersectBodies(tP),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=xye,s=Sye;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 ce(0,0,1);t.vmult(c,c);const u=new ce;o.vsub(i,u);const h=u.dot(c);if(a.vsub(i,u),h*u.dot(c)>0||o.distanceTo(a)=0&&w<=1&&(o.lerp(a,w,g),g.vsub(i,m),m.normalize(),this.reportIntersection(m,g,s,r,-1)),this.result.shouldStop)return;x>=0&&x<=1&&(o.lerp(a,x,g),g.vsub(i,m),m.normalize(),this.reportIntersection(m,g,s,r,-1))}}_intersectConvex(e,t,i,r,s,o){const a=Dye,l=o8,c=o&&o.faceList||null,u=e.faces,h=e.vertices,f=e.faceNormals,g=this.direction,m=this.from,x=m.distanceTo(this.to),U=c?c.length:u.length,D=this.result;for(let ie=0;!D.shouldStop&&iex||this.reportIntersection(a,va,s,r,_e)}}}}_intersectTrimesh(e,t,i,r,s,o){const a=Iye,l=Fye,c=Lye,u=o8,h=Oye,f=Rye,g=Pye,m=kye,w=Nye,x=e.indices,U=this.from,D=this.to,ie=this.direction;c.position.copy(i),c.quaternion.copy(t),$i.vectorToLocalFrame(i,t,ie,h),$i.pointToLocalFrame(i,t,U,f),$i.pointToLocalFrame(i,t,D,g),g.x*=e.scale.x,g.y*=e.scale.y,g.z*=e.scale.z,f.x*=e.scale.x,f.y*=e.scale.y,f.z*=e.scale.z,g.vsub(f,h),h.normalize();const _e=f.distanceSquared(g);e.tree.rayQuery(this,c,l);for(let Pe=0,Ne=l.length;!this.result.shouldStop&&Pe!==Ne;Pe++){const Ve=l[Pe];e.getNormal(Ve,a),e.getVertex(x[3*Ve],_c),_c.vsub(f,u);const bt=h.dot(a),xt=a.dot(u)/bt;if(xt<0)continue;h.scale(xt,va),va.vadd(f,va),e.getVertex(x[3*Ve+1],uu),e.getVertex(x[3*Ve+2],du);const At=va.distanceSquared(f);!ys.pointInTriangle(va,uu,_c,du)&&!ys.pointInTriangle(va,_c,uu,du)||At>_e||($i.vectorToWorldFrame(t,a,w),$i.pointToWorldFrame(i,t,va,m),this.reportIntersection(w,m,s,r,Ve))}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 ys.ALL:this.hasHit=!0,c.set(o,a,e,t,i,r,l),c.hasHit=!0,this.callback(c);break;case ys.CLOSEST:(l=0&&(h=s*c-o*a)>=0&&u+hDate.now()-n}var $f=et(4517);class Fr extends oe{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 $;return this._value}next(e){super.next(this._value=e)}}function fm(n,e,t){e||(e=new qn(qn.IDENTITY));const i=new qn(qn.IDENTITY);if(!n)return!0;if(n.matrix)i.copy(n.matrix);else{if(i.identity(),n.translation&&i.translate(n.translation),n.rotation){const s=new qn(qn.IDENTITY).fromQuaternion(n.rotation);i.multiplyRight(s)}n.scale&&i.scale(n.scale)}const r=new qn(e).multiplyRight(i);if(!1===t(n,r,e))return!1;for(const s of n.nodes||n.children||[])if(!1===fm(s,r,t))return!1;return!0}function Q8(){Mz([EH,cm])}function Z8(n,e){var t;const i=null===(t=e.nodes)||void 0===t?void 0:t.find(r=>r.name===n);if(i){let r=!1;for(const s of e.scenes)r||fm(s,new qn(qn.IDENTITY),(o,a)=>o!==i||(o.matrix=a,o.translation=void 0,o.rotation=void 0,o.scale=void 0,r=!0,!1));return e.scene={id:n,name:n,nodes:[i]},e.scenes=[e.scene],{scene:e.scene,scenes:e.scenes}}return e}function sP(n,e){return Bi(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 Hx(i,cm,{DracoLoader:IR,gltf:{decompressMeshes:!0,postProcess:!0}});return r.nodes||console.log("WARNING: Empty Scene",t,r),Z8(n.scenegraphNode,r)})}function Bve(n,e){return Bi(this,void 0,void 0,function*(){return Z8(n,yield e)})}function oP(n,e,t){if(e&&0!==e.length){let i;switch(t.geometry){case"sphere":i=new L_e;break;case"cone":i=new U_e;break;case"cylinder":i=new z_e;break;case"cube":default:i=new Y_e}return new pge(Object.assign({id:n,pickable:!0,autoHighlight:!1,highlightColor:[30,136,229,255],coordinateSystem:Vi.CARTESIAN,data:e,mesh:i,wireframe:!1,getTransformMatrix:r=>r.transformMatrix,getColor:r=>r.color||[255,255,255,229.5]},t))}}function J8(n,e,t){if(e&&0!==e.length)return new rge(Object.assign({id:n,pickable:!0,data:e.map(i=>Object.assign(Object.assign({},i),{position:new qn(i.transformMatrix).getTranslation()})),getText:i=>i.text,getPosition:i=>i.position,getColor:i=>i.color},t))}let jve=(()=>{class n extends Nz{initializeState(){const{data:t}=this.props;this.setState({data:null!=t?t:[],zoomOpacity:.8,doCollisions:!1}),Q8()}renderLayers(){var t,i;const r=this.state,s={sphere:[],cone:[],cylinder:[],cube:[],text:[],wireframe:[],scenegraph:[]};for(const l of r.data){const c=null!==(t=l.geometry)&&void 0!==t?t:"cube";l.scenegraph?s.scenegraph.push(l):void 0!==s[c]&&s[c].push(l)}const o={};for(const l of s.scenegraph)l.scenegraph&&l.scenegraphNode&&!Object.prototype.hasOwnProperty.call(o,l.scenegraph)&&(o[l.scenegraph]=sP({scenegraph:l.scenegraph},n.gltfCache));const a=[];for(const[l,c]of Object.entries(s))if("scenegraph"===l)for(const u of c)a.push(new F_e({id:"models-"+u["@id"],opacity:u.zoomBasedOpacity?r.zoomOpacity:void 0!==u.opacity?u.opacity:1,pickable:!u.unpickable,coordinateSystem:Vi.CARTESIAN,data:[u],scenegraph:u.scenegraphNode?Bve(u.scenegraphNode,o[u.scenegraph]):u.scenegraph,_lighting:u._lighting,getTransformMatrix:u.transformMatrix,getColor:null!==(i=u.color)&&void 0!==i?i:[0,255,0,127.5],parameters:{depthMask:!u.zoomBasedOpacity&&(void 0===u.opacity||1===u.opacity)}}));else"text"===l?(a.push(J8("text",c.filter(u=>u.unpickable),{pickable:!1})),a.push(J8("textPickable",c.filter(u=>!u.unpickable),{pickable:!0}))):"wireframe"===l?a.push(oP(l,c,{wireframe:!0,pickable:!1,geometry:l})):(a.push(oP(l,c.filter(u=>u.unpickable),{wireframe:!1,pickable:!1,geometry:l})),a.push(oP(`${l}Pickable`,c.filter(u=>!u.unpickable),{wireframe:!1,pickable:!0,geometry:l})));return r.doCollisions&&function(n){Bi(this,void 0,void 0,function*(){console.log("Starting Collisioning");const e=n.filter(o=>!o.scenegraph&&"wireframe"!==o.geometry).map(o=>{const a=new qn(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 pr({lowerBound:new ce(...l.map((u,h)=>Math.min(u,c[h]))),upperBound:new ce(...c.map((u,h)=>Math.max(u,l[h])))})}}),t=[];for(const o of n.filter(a=>!!a.scenegraph)){const a=yield q0(o.scenegraph,cm,{DracoLoader:IR,decompress:!0,postProcess:!0});for(const l of a.scenes)fm(l,new qn(o.transformMatrix),(c,u)=>{if(c.mesh&&c.mesh.primitives&&c.mesh.primitives.length>0)for(const h of c.mesh.primitives)if(h.attributes.POSITION&&h.attributes.POSITION.min){const f=u.transformAsPoint(h.attributes.POSITION.min,[]),g=u.transformAsPoint(h.attributes.POSITION.max,[]);t.push({"@id":o["@id"],name:c.name,entityId:o.entityId,bbox:new pr({lowerBound:new ce(...f.map((m,w)=>Math.min(m,g[w]))),upperBound:new ce(...g.map((m,w)=>Math.max(m,f[w])))}),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})}(r.data),a.filter(l=>!!l)}getPickingInfo(t){return t.info}}return n.layerName="BodyUILayer",n.gltfCache={},n})();function e5(n,e=[]){for(const t of n.nodes||n.children||[])e.push(t.name),e5(t,e);return e}let zve=(()=>{class n{constructor(t){var i,r,s,o,a;this.deckProps=t,this.bodyUILayer=new jve({}),this.nodeClickSubject=new oe,this.nodeHoverStartSubject=new oe,this.nodeHoverStopSubject=new oe,this.sceneRotationSubject=new Fr([0,0]),this.nodeDragStartSubject=new oe,this.nodeDragSubject=new oe,this.nodeDragEndSubject=new oe,this.nodeClick$=this.nodeClickSubject.pipe(ws()),this.nodeHoverStart$=this.nodeHoverStartSubject.pipe(ws()),this.nodeHoverStop$=this.nodeHoverStopSubject.pipe(ws()),this.sceneRotation$=this.sceneRotationSubject.pipe(ws()),this.nodeDragStart$=this.nodeDragStartSubject.pipe(ws()),this.nodeDrag$=this.nodeDragSubject.pipe(ws()),this.nodeDragEnd$=this.nodeDragEndSubject.pipe(ws());const l=Object.assign(Object.assign({},t),{views:["orthographic"===t.camera?new jde({flipY:!1,near:-1e3}):new Hde({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 u;return null!==(u=this.cursor)&&void 0!==u?u:c.isDragging?"grabbing":"grab"}});t.legacyLighting&&(l.effects=[new $O({ambientLight:new Vz({color:[255,255,255],intensity:10})})]),this.deck=new eS(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 Bi(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 qn([.076,0,0,0,0,.076,16875389974302382e-33,0,0,-16875389974302382e-33,.076,0,.49,.034,.11,1]);(function(n,e,t){return Bi(this,void 0,void 0,function*(){Q8();const i=yield sP({scenegraph:n,scenegraphNode:"VHF_Kidney_L_Low1"}),r={},s=[];for(const o of i.scenes)fm(o,e=new qn(e||qn.IDENTITY),(a,l)=>{const c={"@id":a.name||a.id,"@type":"ProcessedNode",transformMatrix:new qn(l),geometry:"wireframe",node:a};if(s.push({"@id":`GLTF:${c["@id"]}`,"@type":"GLTFNode",scenegraph:n,scenegraphNode:c["@id"],transformMatrix:new qn(e||qn.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 u of a.mesh.primitives)if(u.attributes.POSITION&&u.attributes.POSITION.min){const h=l.transformAsPoint(u.attributes.POSITION.min,[]),f=l.transformAsPoint(u.attributes.POSITION.max,[]);c.bbox=new pr({lowerBound:new ce(...h.map((g,m)=>Math.min(g,f[m]))),upperBound:new ce(...f.map((g,m)=>Math.max(g,h[m])))})}return r[c["@id"]]=c,!0});for(const o of Object.values(r).filter(a=>!a.bbox)){for(const a of e5(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,u=(o.size=o.bbox.upperBound.clone().vsub(a)).clone().vmul(new ce(.5,.5,.5)),h=o.center=a.clone().vadd(u);o.transformMatrix=new qn(qn.IDENTITY).translate(h.toArray()).scale(u.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 qn(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 Ei([$f.ZP],n.prototype,"_onHover",null),Ei([$f.ZP],n.prototype,"_onClick",null),Ei([$f.ZP],n.prototype,"_onViewStateChange",null),Ei([$f.ZP],n.prototype,"_onDragStart",null),Ei([$f.ZP],n.prototype,"_onDrag",null),Ei([$f.ZP],n.prototype,"_onDragEnd",null),n})();class t5 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 Hve 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 n5(n,e,t,i,r=new Hve(n,t,i)){if(!r.closed)return e instanceof O?e.subscribe(r):Me(e)(r)}const i5={};function yc(...n){let e,t;return Te(n[n.length-1])&&(t=n.pop()),"function"==typeof n[n.length-1]&&(e=n.pop()),1===n.length&&k(n[0])&&(n=n[0]),In(n,t).lift(new r5(e))}class r5{constructor(e){this.resultSelector=e}call(e,t){return t.subscribe(new Gve(e,this.resultSelector))}}class Gve extends t5{constructor(e,t){super(e),this.resultSelector=t,this.active=0,this.values=[],this.observables=[]}_next(e){this.values.push(i5),this.observables.push(e)}_complete(){const e=this.observables,t=e.length;if(0===t)this.destination.complete();else{this.active=t,this.toRespond=t;for(let i=0;i(i&&i.providers||[]).some(s=>s&&s.provide&&"MockNgModuleResolver"===s.provide.name||!1))});let aP=(()=>{class n{constructor(){this.bootstrap$=new Df(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 lP=new Ht("INITIAL_STATE_TOKEN");let Kve=(()=>{class n{static set(t){this.value=t}static pop(){const t=this.value;return this.value={},t}}return n.value={},n})();const s5=new Ht("Internals.StateContextFactory"),o5=new Ht("Internals.StateFactory");function fb(...n){if(1===n.length){const e=n[0];if(k(e))return ES(e,null);if(Q(e)&&Object.getPrototypeOf(e)===Object.prototype){const t=Object.keys(e);return ES(t.map(i=>e[i]),t)}}if("function"==typeof n[n.length-1]){const e=n.pop();return ES(n=1===n.length&&k(n[0])?n[0]:n,null).pipe(me(t=>e(...t)))}return ES(n,null)}function ES(n,e){return new O(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]=u},error:u=>t.error(u),complete:()=>{s++,(s===i||!c)&&(o===i&&t.next(e?e.reduce((u,h,f)=>(u[h]=r[f],u),{}):r),t.complete())}}))}})}function Ki(n,e){return function(i){return i.lift(new Qve(n,e))}}class Qve{constructor(e,t){this.predicate=e,this.thisArg=t}call(e,t){return t.subscribe(new Zve(e,this.predicate,this.thisArg))}}class Zve 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 Wa(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(u){let h;s++,!r||a?(a=!1,r=new Df(n,e,i),h=r.subscribe(this),o=u.subscribe({next(f){r.next(f)},error(f){a=!0,r.error(f)},complete(){l=!0,o=void 0,r.complete()}}),l&&(o=void 0)):h=r.subscribe(this),this.add(()=>{s--,h.unsubscribe(),h=void 0,o&&!l&&t&&0===s&&(o.unsubscribe(),o=void 0,r=void 0)})}}(i))}const a5=(()=>{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 qr(n){return e=>0===n?b0():e.lift(new ewe(n))}class ewe{constructor(e){if(this.total=e,this.total<0)throw new a5}call(e,t){return t.subscribe(new twe(e,this.total))}}class twe 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 l5(n,e){return e?t=>t.pipe(l5((i,r)=>je(n(i,r)).pipe(me((s,o)=>e(i,s,r,o))))):t=>t.lift(new nwe(n))}class nwe{constructor(e){this.project=e}call(e,t){return t.subscribe(new iwe(e,this.project))}}class iwe extends we{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 _t(this),i=this.destination;i.add(t);const r=N(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 xS(n=null){return e=>e.lift(new rwe(n))}class rwe{constructor(e){this.defaultValue=e}call(e,t){return t.subscribe(new swe(e,this.defaultValue))}}class swe 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 bc(n){return function(t){const i=new owe(n),r=t.lift(i);return i.caught=r}}class owe{constructor(e){this.selector=e}call(e,t){return t.subscribe(new awe(e,this.selector,this.caught))}}class awe extends we{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 _t(this);this.add(i);const r=N(t,i);r!==i&&this.add(r)}}}function gr(n){return e=>e.lift(new lwe(n))}class lwe{constructor(e){this.notifier=e}call(e,t){const i=new cwe(e),r=N(this.notifier,new _t(i));return r&&!i.seenValue?(i.add(r),t.subscribe(i)):i}}class cwe extends we{constructor(e){super(e),this.seenValue=!1}notifyNext(){this.seenValue=!0,this.complete()}notifyComplete(){}}function bh(){}function cr(n,e,t){return function(r){return r.lift(new uwe(n,e,t))}}class uwe{constructor(e,t,i){this.nextOrObserver=e,this.error=t,this.complete=i}call(e,t){return t.subscribe(new dwe(e,this.nextOrObserver,this.error,this.complete))}}class dwe extends y{constructor(e,t,i,r){super(e),this._tapNext=bh,this._tapError=bh,this._tapComplete=bh,this._tapError=i||bh,this._tapComplete=r||bh,Y(t)?(this._context=this,this._tapNext=t):t&&(this._context=t,this._tapNext=t.next||bh,this._tapError=t.error||bh,this._tapComplete=t.complete||bh)}_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 ld(n,e){return t=>t.lift(new hwe(n,e))}class hwe{constructor(e,t){this.compare=e,this.keySelector=t}call(e,t){return t.subscribe(new fwe(e,this.compare,this.keySelector))}}class fwe 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 qa={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 c5=(()=>{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 pn.isInAngularZone()?t():this._ngZone.run(t)}runOutsideAngular(t){return pn.isInAngularZone()?this._ngZone.runOutsideAngular(t):t()}verifyZoneIsNotNooped(t){t instanceof pn||console.warn(qa.ZONE_WARNING())}}return n.\u0275fac=function(t){return new(t||n)(Ie(pn),Ie(Xc))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const u5=new Ht("ROOT_STATE_TOKEN"),d5=new Ht("FEATURE_STATE_TOKEN"),h5=new Ht("NGXS_PLUGINS"),f5=new Ht("NG_TEST_MODE"),p5=new Ht("NG_DEV_MODE"),cd="NGXS_META",g5="NGXS_OPTIONS_META",cP="NGXS_SELECTOR_META";let Wf=(()=>{class n{constructor(){this.defaultsState={},this.selectorOptions={injectContainerState:!0,suppressErrors:!0},this.compatibility={strictContentSecurityPolicy:!1},this.executionStrategy=c5}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();class pwe{constructor(e,t,i){this.previousValue=e,this.currentValue=t,this.firstChange=i}}const m5=new Ht("NGXS_EXECUTION_STRATEGY");function qf(n){return n.constructor&&n.constructor.type?n.constructor.type:n.type}const _5=(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},SS=(n,e)=>e.split(".").reduce((t,i)=>t&&t[i],n),uP=n=>n&&"object"==typeof n&&!Array.isArray(n),dP=(n,...e)=>{if(!e.length)return n;const t=e.shift();if(uP(n)&&uP(t))for(const i in t)uP(t[i])?(n[i]||Object.assign(n,{[i]:{}}),dP(n[i],t[i])):Object.assign(n,{[i]:t[i]});return dP(n,...e)};function hP(n){if(!n.hasOwnProperty(cd)){const e={name:null,actions:{},defaults:{},path:null,makeRootSelector:t=>t.getStateGetter(e.name),children:[]};Object.defineProperty(n,cd,{value:e})}return pb(n)}function pb(n){return n[cd]}function pP(n){return n[cP]}function y5(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(e[qf(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 Ki(t=>{const i=qf(t.action);return n[i]&&(!e||e[t.status])})}(i,r),t())}}(n,["DISPATCHED"])}function Cwe(){return me(n=>n.action)}function CS(n){return e=>new O(t=>e.subscribe({next(i){n.leave(()=>t.next(i))},error(i){n.leave(()=>t.error(i))},complete(){n.leave(()=>t.complete())}}))}let TS=(()=>{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(m5))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();class Mwe extends oe{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 AS=(()=>{class n extends Mwe{}return n.\u0275fac=function(){let e;return function(i){return(e||(e=zi(n)))(i||n)}}(),n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),Dwe=(()=>{class n extends O{constructor(t,i){super(r=>{const s=t.pipe(CS(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(AS),Ie(TS))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const v5=n=>(...e)=>n.shift()(...e,(...i)=>v5(n)(...i));let MS=(()=>{class n extends Fr{constructor(){super({})}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),gP=(()=>{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(h5,8))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),mP=(()=>{class n extends oe{}return n.\u0275fac=function(){let e;return function(i){return(e||(e=zi(n)))(i||n)}}(),n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),w5=(()=>{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(la),this._errorHandler.handleError(r)}catch(s){}})}),i.pipe(CS(this._ngxsExecutionStrategy))}dispatchByEvents(t){return Array.isArray(t)?0===t.length?sn(this._stateStream.getValue()):fb(t.map(i=>this.dispatchSingle(i))):this.dispatchSingle(t)}dispatchSingle(t){if(!qf(t))return Fg(new Error(`This action doesn't have a type property: ${t.constructor.name}`));const r=this._stateStream.getValue();return v5([...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(Wa())}getActionResultStream(t){return this._actionResults.pipe(Ki(i=>i.action===t&&"DISPATCHED"!==i.status),qr(1),Wa())}createDispatchObservable(t){return t.pipe(l5(i=>{switch(i.status){case"SUCCESSFUL":return sn(this._stateStream.getValue());case"ERRORED":return Fg(i.error);default:return Qc}})).pipe(Wa())}}return n.\u0275fac=function(t){return new(t||n)(Ie(Hn),Ie(AS),Ie(mP),Ie(gP),Ie(MS),Ie(TS))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const E5=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])&&E5(n[i])}),n};let x5=(()=>{class n{constructor(t,i){this.isDevMode=t,this.isTestMode=i}}return n.\u0275fac=function(t){return new(t||n)(Ie(p5),Ie(f5))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),S5=(()=>{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(qa.INCORRECT_PRODUCTION()):this.isIncorrectDevelopment&&console.warn(qa.INCORRECT_DEVELOPMENT()))}}return n.\u0275fac=function(t){return new(t||n)(Ie(x5),Ie(Wf))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),gm=(()=>{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=E5(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(MS),Ie(w5),Ie(Wf),Ie(S5))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),DS=(()=>{class n{constructor(t){this._internalStateOperations=t}createStateContext(t){const i=this._internalStateOperations.getRootStateOperations();function r(l){return SS(l,t.path)}function s(l,c){const u=_5(l,t.path,c),h=t.instance;if(h.ngxsOnChanges){const f=b5(t,{currentAppState:l,newAppState:u});h.ngxsOnChanges(f)}return i.setState(u),u}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(qa.PATCHING_ARRAY());if("object"!=typeof n)throw new Error(qa.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(gm))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();class IS{static stateNameErrorMessage(e){return qa.STATE_NAME(e)}static checkCorrectStateName(e){if(!e)throw new Error(qa.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(qa.STATE_UNIQUE(r,e.name,s.name));return r}static getValidStateMeta(e){const t=pb(e);if(!t)throw new Error(qa.STATE_DECORATOR());return t}}IS.stateNameRegex=new RegExp("^[a-zA-Z0-9_]+$");let mm=(()=>{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=wS(()=>{const c=this;function u(f){const g=c.statePaths[f];return g?y5(g.split("."),c._config):null}return this._parentFactory?this._parentFactory.getRuntimeSelectorContext():{getStateGetter(f){let g=u(f);return g||((...m)=>(g||(g=u(f)),g?g(...m):void 0))},getSelectorOptions:f=>Object.assign({},c._config.selectorOptions,f||{})}})}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(IS.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[cd].name};return n.reduce((t,i)=>{const{name:r,children:s}=i[cd];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[cd].name]=t,e),{})}(i),l=[];for(const c of s){const u=a[c],h=o[c],f=u[cd];this.addRuntimeInfoToMeta(f,h);const g={name:c,path:h,isInitialised:!1,actions:f.actions,instance:this._injector.get(u),defaults:n.cloneDefaults(f.defaults)};this.hasBeenMountedAndBootstrapped(c,h)||l.push(g),this.states.push(g)}return l}addAndReturnDefaults(t){const r=this.add(t||[]);return{defaults:r.reduce((o,a)=>_5(o,a.path,a.defaults),{}),states:r}}connectActionHandlers(){null===this._actionsSubscription&&(this._actionsSubscription=this._actions.pipe(Ki(t=>"DISPATCHED"===t.status),V(({action:t})=>this.invokeActions(this._actions,t).pipe(me(()=>({action:t,status:"SUCCESSFUL"})),xS({action:t,status:"CANCELED"}),bc(i=>sn({action:t,status:"ERRORED",error:i}))))).subscribe(t=>this._actionResults.next(t)))}invokeActions(t,i){const r=qf(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 u=o.instance[l.fn](c,i);u instanceof Promise&&(u=je(u)),u instanceof O?(u=u.pipe(xS({})),l.options.cancelUncompleted&&(u=u.pipe(gr(t.pipe(Ewe(i)))))):u=sn({}).pipe(Wa()),s.push(u)}catch(u){s.push(Fg(u))}}}return s.length||s.push(sn({})),fb(s)}addToStatesMap(t){const i=[],r=this.statesByName;for(const s of t){const o=IS.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!==SS(this._initialState,i);return this.statesByName[t]&&r}}return n.\u0275fac=function(t){return new(t||n)(Ie(Hn),Ie(Wf),Ie(n,12),Ie(AS),Ie(mP),Ie(DS),Ie(lP,8))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),_P=(()=>{class n{constructor(t,i,r){this.internalStateOperations=t,this.stateContextFactory=i,this.bootstrapper=r}ngxsBootstrap(t,i){this.internalStateOperations.getRootStateOperations().dispatch(t).pipe(Ki(()=>!!i),cr(()=>this.invokeInit(i.states)),V(()=>this.bootstrapper.appBootstrapped$),Ki(r=>!!r)).subscribe(()=>this.invokeBootstrap(i.states))}invokeInit(t){for(const i of t){const r=i.instance;if(r.ngxsOnChanges){const a=b5(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(gm),Ie(DS),Ie(aP))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const OS_getOptions=n=>n&&n.NGXS_SELECTOR_OPTIONS_META||{};function Owe(n,e,t){const i=t&&t.containerClass,s=wS(function(...c){const u=e.apply(i,c);return u instanceof Function?wS.apply(null,[u]):u});Object.setPrototypeOf(s,e);const o=function(n,e){const t=function(n){return n.hasOwnProperty(cP)||Object.defineProperty(n,cP,{value:{makeRootSelector:null,originalFn:null,containerClass:null,selectorName:null,getSelectorOptions:()=>({})}}),pP(n)}(n);t.originalFn=n;let i=()=>({});e&&(t.containerClass=e.containerClass,t.selectorName=e.selectorName,i=e.getSelectorOptions||i);const r=Object.assign({},t);return t.getSelectorOptions=()=>function(n,e){return Object.assign({},OS_getOptions(n.containerClass)||{},OS_getOptions(n.originalFn)||{},n.getSelectorOptions()||{},e)}(r,i()),t}(e,t);return o.makeRootSelector=l=>{const{argumentSelectorFunctions:c,selectorOptions:u}=function(n,e,t=[]){const i=e.getSelectorOptions(),r=n.getSelectorOptions(i);return{selectorOptions:r,argumentSelectorFunctions:function(n=[],e,t){const i=[];return t&&(0===n.length||e.injectContainerState)&&pb(t)&&i.push(t),n&&i.push(...n),i}(t,r,e.containerClass).map(a=>T5(a)(n))}}(l,o,n);return function(f){const g=c.map(m=>m(f));try{return s(...g)}catch(m){if(m instanceof TypeError&&u.suppressErrors)return;throw m}}},s}function T5(n){const e=pP(n)||pb(n);return e&&e.makeRootSelector||(()=>n)}let hu=(()=>{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),bc(r=>{const{suppressErrors:s}=this._config.selectorOptions;return r instanceof TypeError&&s?sn(void 0):Fg(r)}),ld(),CS(this._internalExecutionStrategy))}selectOnce(t){return this.select(t).pipe(qr(1))}selectSnapshot(t){return this.getStoreBoundSelectorFn(t)(this._stateStream.getValue())}subscribe(t){return this._stateStream.pipe(CS(this._internalExecutionStrategy)).subscribe(t)}snapshot(){return this._internalStateOperations.getRootStateOperations().getState()}reset(t){return this._internalStateOperations.getRootStateOperations().setState(t)}getStoreBoundSelectorFn(t){return T5(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(MS),Ie(gm),Ie(Wf),Ie(TS),Ie(mm),Ie(lP,8))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),gb=(()=>{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(hu),Ie(Wf))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n.store=null,n.config=null,n})();class Fwe{static get type(){return"@@INIT"}}class Lwe{constructor(e){this.addedStates=e}static get type(){return"@@UPDATE_STATE"}}const RS=new Df(1);let Vwe=(()=>{class n{constructor(t,i,r,s,o=[],a){!function(){try{const n=window.ng,t=!(n.probe&&n.coreTokens)&&fa();RS.next(t)}catch(n){RS.next(!1)}finally{RS.complete()}}();const l=t.addAndReturnDefaults(o);i.setStateToTheCurrentWithNew(l),t.connectActionHandlers(),a.ngxsBootstrap(new Fwe,l)}}return n.\u0275fac=function(t){return new(t||n)(Ie(mm),Ie(gm),Ie(hu),Ie(gb),Ie(u5,8),Ie(_P))},n.\u0275mod=tn({type:n}),n.\u0275inj=St({}),n})(),jwe=(()=>{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 Lwe(l.defaults),l))}static flattenStates(t=[]){return t.reduce((i,r)=>i.concat(r),[])}}return n.\u0275fac=function(t){return new(t||n)(Ie(hu),Ie(gm),Ie(mm),Ie(d5,8),Ie(_P))},n.\u0275mod=tn({type:n}),n.\u0275inj=St({}),n})();class Yo{static forRoot(e=[],t={}){return{ngModule:Vwe,providers:[mm,DS,Dwe,AS,aP,S5,x5,_P,w5,mP,gm,TS,hu,MS,gb,gP,...e,...Yo.ngxsTokenProviders(e,t)]}}static forFeature(e=[]){return{ngModule:jwe,providers:[mm,gP,...e,{provide:d5,multi:!0,useValue:e}]}}static ngxsTokenProviders(e,t){return[{provide:f5,useValue:Xve},{provide:p5,useValue:fa},{provide:m5,useClass:t.executionStrategy||c5},{provide:u5,useValue:e},{provide:Yo.ROOT_OPTIONS,useValue:t},{provide:Wf,useFactory:Yo.ngxsConfigFactory,deps:[Yo.ROOT_OPTIONS]},{provide:IE,useFactory:Yo.appBootstrapListenerFactory,multi:!0,deps:[aP]},{provide:lP,useFactory:Yo.getInitialState},{provide:s5,useExisting:DS},{provide:o5,useExisting:mm}]}static ngxsConfigFactory(e){return dP(new Wf,e)}static appBootstrapListenerFactory(e){return()=>e.bootstrap()}static getInitialState(){return Kve.pop()}}function yP(n,e){return(t,i)=>{if(t.hasOwnProperty("prototype"))throw new Error(qa.ACTION_DECORATOR());const s=hP(t.constructor);Array.isArray(n)||(n=[n]);for(const o of n){const a=o.type;s.actions[a]||(s.actions[a]=[]),s.actions[a].push({fn:i,options:e||{},type:a})}}}function A5(n){return i=>{!function(n){RS.subscribe(e=>{e&&(n.\u0275prov||console.warn(qa.UNDECORATED_STATE_IN_IVY(n.name)))})}(i);const r=i,s=hP(r),o=Object.getPrototypeOf(r),a=function(i){return Object.assign({},i[g5]||{},n)}(o);(function(i){const{meta:r,inheritedStateClass:s,optionsWithInheritance:o}=i,{children:a,defaults:l,name:c}=o,u="string"==typeof c?c:c&&c.getName()||null;IS.checkCorrectStateName(u),s.hasOwnProperty(cd)&&(r.actions=Object.assign({},r.actions,(s[cd]||{}).actions)),r.children=a,r.defaults=l,r.name=u})({meta:s,inheritedStateClass:o,optionsWithInheritance:a}),r[g5]=a}}function PS(n,...e){return function(t,i){const r=i.toString(),s=`__${r}__selector`,o=function(n,e,t=[]){return"string"==typeof(e=e||function(n){const e=n.length-1;return 36===n.charCodeAt(e)?n.slice(0,e):n}(n))?y5(t.length?[e,...t]:e.split("."),gb.config):e}(r,n,e);Object.defineProperties(t,{[s]:{writable:!0,enumerable:!1,configurable:!0},[r]:{enumerable:!0,configurable:!0,get(){return this[s]||(this[s]=function(n){if(!gb.store)throw new Error(qa.SELECT_FACTORY_NOT_CONNECTED());return gb.store.select(n)}(o))}}})}}function _m(n){return(e,t,i)=>{if(!i||null===i.value)throw new Error(qa.SELECTOR_DECORATOR());const s=i.value,o=Owe(n,s,{containerClass:e,selectorName:t.toString(),getSelectorOptions:()=>({})}),a={configurable:!0,get:()=>o};return a.originalFn=s,a}}Yo.\u0275fac=function(e){return new(e||Yo)},Yo.\u0275mod=tn({type:Yo}),Yo.\u0275inj=St({}),Yo.ROOT_OPTIONS=new Ht("ROOT_OPTIONS");const Xo=new Ht("NgValueAccessor");function Dl(n,...e){return e.length?e.some(t=>n[t]):n.altKey||n.shiftKey||n.ctrlKey||n.metaKey}const qS=new cc(sx);class YEe{constructor(e,t){this.dueTime=e,this.scheduler=t}call(e,t){return t.subscribe(new XEe(e,this.dueTime,this.scheduler))}}class XEe 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(KEe,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 KEe(n){n.debouncedNext()}class QEe{constructor(e){this.total=e}call(e,t){return t.subscribe(new ZEe(e,this.total))}}class ZEe extends y{constructor(e,t){super(e),this.total=t,this.count=0}_next(e){++this.count>this.total&&this.destination.next(e)}}function bi(n){return null!=n&&"false"!=`${n}`}function Ya(n,e=0){return function(n){return!isNaN(parseFloat(n))&&!isNaN(Number(n))}(n)?Number(n):e}function YS(n){return Array.isArray(n)?n:[n]}function bs(n){return null==n?"":"string"==typeof n?n:`${n}px`}function dd(n){return n instanceof gn?n.nativeElement:n}let zP;try{zP="undefined"!=typeof Intl&&Intl.v8BreakIterator}catch(n){zP=!1}let Cb,Xf,HP,Qi=(()=>{class n{constructor(t){this._platformId=t,this.isBrowser=this._platformId?Af(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&&!zP)&&"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(Xc))},n.\u0275prov=We({factory:function(){return new n(Ie(Xc))},token:n,providedIn:"root"}),n})(),Sb=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=tn({type:n}),n.\u0275inj=St({}),n})();function vm(n){return function(){if(null==Cb&&"undefined"!=typeof window)try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:()=>Cb=!0}))}finally{Cb=Cb||!1}return Cb}()?n:!!n.capture}function F6(){if(null==Xf){if("object"!=typeof document||!document||"function"!=typeof Element||!Element)return Xf=!1,Xf;if("scrollBehavior"in document.documentElement.style)Xf=!0;else{const n=Element.prototype.scrollTo;Xf=!!n&&!/\{\s*\[native code\]\s*\}/.test(n.toString())}}return Xf}function KS(){let n="undefined"!=typeof document&&document?document.activeElement:null;for(;n&&n.shadowRoot;){const e=n.shadowRoot.activeElement;if(e===n)break;n=e}return n}function Kf(n){return n.composedPath?n.composedPath()[0]:n.target}let GP=(()=>{class n{create(t){return"undefined"==typeof MutationObserver?null:new MutationObserver(t)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({factory:function(){return new n},token:n,providedIn:"root"}),n})(),L6=(()=>{class n{constructor(t){this._mutationObserverFactory=t,this._observedElements=new Map}ngOnDestroy(){this._observedElements.forEach((t,i)=>this._cleanupObserver(i))}observe(t){const i=dd(t);return new O(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 oe,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(GP))},n.\u0275prov=We({factory:function(){return new n(Ie(GP))},token:n,providedIn:"root"}),n})(),$P=(()=>{class n{constructor(t,i,r){this._contentObserver=t,this._elementRef=i,this._ngZone=r,this.event=new ln,this._disabled=!1,this._currentSubscription=null}get disabled(){return this._disabled}set disabled(t){this._disabled=bi(t),this._disabled?this._unsubscribe():this._subscribe()}get debounce(){return this._debounce}set debounce(t){this._debounce=Ya(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=qS){return t=>t.lift(new YEe(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)(Ce(L6),Ce(gn),Ce(pn))},n.\u0275dir=Nt({type:n,selectors:[["","cdkObserveContent",""]],inputs:{disabled:["cdkObserveContentDisabled","disabled"],debounce:"debounce"},outputs:{event:"cdkObserveContent"},exportAs:["cdkObserveContent"]}),n})(),QS=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=tn({type:n}),n.\u0275inj=St({providers:[GP]}),n})(),$6=(()=>{class n{constructor(t){this._platform=t}isDisabled(t){return t.hasAttribute("disabled")}isVisible(t){return function(n){return!!(n.offsetWidth||n.offsetHeight||"function"==typeof n.getClientRects&&n.getClientRects().length)}(t)&&"visible"===getComputedStyle(t).visibility}isTabbable(t){if(!this._platform.isBrowser)return!1;const i=function(n){try{return n.frameElement}catch(e){return null}}(function(n){return n.ownerDocument&&n.ownerDocument.defaultView||window}(t));if(i&&(-1===q6(i)||!this.isVisible(i)))return!1;let r=t.nodeName.toLowerCase(),s=q6(t);return t.hasAttribute("contenteditable")?-1!==s:!("iframe"===r||"object"===r||this._platform.WEBKIT&&this._platform.IOS&&!function(n){let e=n.nodeName.toLowerCase(),t="input"===e&&n.type;return"text"===t||"password"===t||"select"===e||"textarea"===e}(t))&&("audio"===r?!!t.hasAttribute("controls")&&-1!==s:"video"===r?-1!==s&&(null!==s||this._platform.FIREFOX||t.hasAttribute("controls")):t.tabIndex>=0)}isFocusable(t,i){return function(n){return!function(n){return function(n){return"input"==n.nodeName.toLowerCase()}(n)&&"hidden"==n.type}(n)&&(function(n){let e=n.nodeName.toLowerCase();return"input"===e||"select"===e||"button"===e||"textarea"===e}(n)||function(n){return function(n){return"a"==n.nodeName.toLowerCase()}(n)&&n.hasAttribute("href")}(n)||n.hasAttribute("contenteditable")||W6(n))}(t)&&!this.isDisabled(t)&&((null==i?void 0:i.ignoreVisibility)||this.isVisible(t))}}return n.\u0275fac=function(t){return new(t||n)(Ie(Qi))},n.\u0275prov=We({factory:function(){return new n(Ie(Qi))},token:n,providedIn:"root"}),n})();function W6(n){if(!n.hasAttribute("tabindex")||void 0===n.tabIndex)return!1;let e=n.getAttribute("tabindex");return"-32768"!=e&&!(!e||isNaN(parseInt(e,10)))}function q6(n){if(!W6(n))return null;const e=parseInt(n.getAttribute("tabindex")||"",10);return isNaN(e)?-1:e}class yxe{constructor(e,t,i,r,s=!1){this._element=e,this._checker=t,this._ngZone=i,this._document=r,this._hasAttached=!1,this.startAnchorListener=()=>this.focusLastTabbableElement(),this.endAnchorListener=()=>this.focusFirstTabbableElement(),this._enabled=!0,s||this.attachAnchors()}get enabled(){return this._enabled}set enabled(e){this._enabled=e,this._startAnchor&&this._endAnchor&&(this._toggleAnchorTabIndex(e,this._startAnchor),this._toggleAnchorTabIndex(e,this._endAnchor))}destroy(){const 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}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(e){return new Promise(t=>{this._executeOnStable(()=>t(this.focusInitialElement(e)))})}focusFirstTabbableElementWhenReady(e){return new Promise(t=>{this._executeOnStable(()=>t(this.focusFirstTabbableElement(e)))})}focusLastTabbableElementWhenReady(e){return new Promise(t=>{this._executeOnStable(()=>t(this.focusLastTabbableElement(e)))})}_getRegionBoundary(e){let t=this._element.querySelectorAll(`[cdk-focus-region-${e}], [cdkFocusRegion${e}], [cdk-focus-${e}]`);for(let i=0;i=0;i--){let r=t[i].nodeType===this._document.ELEMENT_NODE?this._getLastTabbableElement(t[i]):null;if(r)return r}return null}_createAnchor(){const 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}_toggleAnchorTabIndex(e,t){e?t.setAttribute("tabindex","0"):t.removeAttribute("tabindex")}toggleAnchors(e){this._startAnchor&&this._endAnchor&&(this._toggleAnchorTabIndex(e,this._startAnchor),this._toggleAnchorTabIndex(e,this._endAnchor))}_executeOnStable(e){this._ngZone.isStable?e():this._ngZone.onStable.pipe(qr(1)).subscribe(e)}}let Y6=(()=>{class n{constructor(t,i,r){this._checker=t,this._ngZone=i,this._document=r}create(t,i=!1){return new yxe(t,this._checker,this._ngZone,this._document,i)}}return n.\u0275fac=function(t){return new(t||n)(Ie($6),Ie(pn),Ie(fn))},n.\u0275prov=We({factory:function(){return new n(Ie($6),Ie(pn),Ie(fn))},token:n,providedIn:"root"}),n})();function X6(n){return 0===n.offsetX&&0===n.offsetY}function K6(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 Q6=new Ht("cdk-input-modality-detector-options"),xxe={ignoreKeys:[18,17,224,91,16]},wm=vm({passive:!0,capture:!0});let J6=(()=>{class n{constructor(t,i,r,s){this._platform=t,this._mostRecentTarget=null,this._modality=new Fr(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=Kf(o))},this._onMousedown=o=>{Date.now()-this._lastTouchMs<650||(this._modality.next(X6(o)?"keyboard":"mouse"),this._mostRecentTarget=Kf(o))},this._onTouchstart=o=>{K6(o)?this._modality.next("keyboard"):(this._lastTouchMs=Date.now(),this._modality.next("touch"),this._mostRecentTarget=Kf(o))},this._options=Object.assign(Object.assign({},xxe),s),this.modalityDetected=this._modality.pipe(function(n){return e=>e.lift(new QEe(n))}(1)),this.modalityChanged=this.modalityDetected.pipe(ld()),t.isBrowser&&i.runOutsideAngular(()=>{r.addEventListener("keydown",this._onKeydown,wm),r.addEventListener("mousedown",this._onMousedown,wm),r.addEventListener("touchstart",this._onTouchstart,wm)})}get mostRecentModality(){return this._modality.value}ngOnDestroy(){!this._platform.isBrowser||(document.removeEventListener("keydown",this._onKeydown,wm),document.removeEventListener("mousedown",this._onMousedown,wm),document.removeEventListener("touchstart",this._onTouchstart,wm))}}return n.\u0275fac=function(t){return new(t||n)(Ie(Qi),Ie(pn),Ie(fn),Ie(Q6,8))},n.\u0275prov=We({factory:function(){return new n(Ie(Qi),Ie(pn),Ie(fn),Ie(Q6,8))},token:n,providedIn:"root"}),n})();const nG=new Ht("cdk-focus-monitor-default-options"),eC=vm({passive:!0,capture:!0});let vc=(()=>{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 oe,this._rootNodeFocusAndBlurListener=a=>{const l=Kf(a),c="focus"===a.type?this._onFocus:this._onBlur;for(let u=l;u;u=u.parentElement)c.call(this,a,u)},this._document=s,this._detectionMode=(null==o?void 0:o.detectionMode)||0}monitor(t,i=!1){const r=dd(t);if(!this._platform.isBrowser||1!==r.nodeType)return sn(null);const s=function(n){if(function(){if(null==HP){const n="undefined"!=typeof document?document.head:null;HP=!(!n||!n.createShadowRoot&&!n.attachShadow)}return HP}()){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 oe,rootNode:s};return this._elementInfo.set(r,a),this._registerGlobalListeners(a),a.subject}stopMonitoring(t){const i=dd(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=dd(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=Kf(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,eC),i.addEventListener("blur",this._rootNodeFocusAndBlurListener,eC)}),this._rootNodeFocusListenerCount.set(i,r+1),1==++this._monitoredElementCount&&(this._ngZone.runOutsideAngular(()=>{this._getWindow().addEventListener("focus",this._windowFocusListener)}),this._inputModalityDetector.modalityDetected.pipe(gr(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,eC),i.removeEventListener("blur",this._rootNodeFocusAndBlurListener,eC),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(pn),Ie(Qi),Ie(J6),Ie(fn,8),Ie(nG,8))},n.\u0275prov=We({factory:function(){return new n(Ie(pn),Ie(Qi),Ie(J6),Ie(fn,8),Ie(nG,8))},token:n,providedIn:"root"}),n})();const iG="cdk-high-contrast-black-on-white",rG="cdk-high-contrast-white-on-black",qP="cdk-high-contrast-active";let sG=(()=>{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(qP),t.remove(iG),t.remove(rG),this._hasCheckedHighContrastMode=!0;const i=this.getHighContrastMode();1===i?(t.add(qP),t.add(iG)):2===i&&(t.add(qP),t.add(rG))}}}return n.\u0275fac=function(t){return new(t||n)(Ie(Qi),Ie(fn))},n.\u0275prov=We({factory:function(){return new n(Ie(Qi),Ie(fn))},token:n,providedIn:"root"}),n})();const oG=new Ht("cdk-dir-doc",{providedIn:"root",factory:function(){return Bc(fn)}});let Il=(()=>{class n{constructor(t){if(this.value="ltr",this.change=new ln,t){const r=t.documentElement?t.documentElement.dir:null,s=(t.body?t.body.dir:null)||r;this.value="ltr"===s||"rtl"===s?s:"ltr"}}ngOnDestroy(){this.change.complete()}}return n.\u0275fac=function(t){return new(t||n)(Ie(oG,8))},n.\u0275prov=We({factory:function(){return new n(Ie(oG,8))},token:n,providedIn:"root"}),n})(),Ab=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=tn({type:n}),n.\u0275inj=St({}),n})();const aG=new Hu("12.2.5");function tC(...n){return kt(1)(sn(...n))}function Oo(...n){const e=n[n.length-1];return Te(e)?(n.pop(),t=>tC(n,t,e)):t=>tC(n,t)}function Em(n,e){return{type:7,name:n,definitions:e,options:{}}}function fd(n,e=null){return{type:4,styles:e,timings:n}}function ds(n){return{type:6,styles:n,offset:null}}function wc(n,e,t){return{type:0,name:n,styles:e,options:t}}function pd(n,e,t=null){return{type:1,expr:n,animation:e,options:t}}function uG(n){Promise.resolve(null).then(n)}class xm{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(){uG(()=>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 hG(){return"undefined"!=typeof window&&void 0!==window.document}function XP(){return"undefined"!=typeof process&&"[object process]"==={}.toString.call(process)}let JP=(n,e)=>!1,eN=(n,e)=>!1,gG=(n,e,t)=>[];const mG=XP();(mG||"undefined"!=typeof Element)&&(JP=hG()?(n,e)=>{for(;e&&e!==document.documentElement;){if(e===n)return!0;e=e.parentNode||e.host}return!1}:(n,e)=>n.contains(e),eN=(()=>{if(mG||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]):eN}})(),gG=(n,e,t)=>{let i=[];if(t){const r=n.querySelectorAll(e);for(let s=0;s{class n{validateStyleProperty(t){return tN(t)}matchesElement(t,i){return nN(t,i)}containsElement(t,i){return iN(t,i)}query(t,i,r){return rN(t,i,r)}computeStyle(t,i,r){return r||""}animate(t,i,r,s,o,a=[],l){return new xm(r,s)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();class nC{}nC.NOOP=new bG;function xG(n,e,t){return t?e+":"+t+";":""}function SG(n){let e="";for(let t=0;t{const r=cN(i);t&&!t.hasOwnProperty(i)&&(t[i]=n.style[r]),n.style[r]=e[i]}),XP()&&SG(n))}function Jf(n,e){n.style&&(Object.keys(e).forEach(t=>{const i=cN(t);n.style[i]=""}),XP()&&SG(n))}const Lxe=/-+([a-z0-9])/g;function cN(n){return n.replace(Lxe,(...e)=>e[1].toUpperCase())}function Bxe(n){return n.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}class Tm{constructor(e,t,i){this._element=e,this._startStyles=t,this._endStyles=i,this._state=0;let r=Tm.initialStylesByElement.get(e);r||Tm.initialStylesByElement.set(e,r={}),this._initialStyles=r}start(){this._state<1&&(this._startStyles&&pu(this._element,this._startStyles,this._initialStyles),this._state=1)}finish(){this.start(),this._state<2&&(pu(this._element,this._initialStyles),this._endStyles&&(pu(this._element,this._endStyles),this._endStyles=null),this._state=1)}destroy(){this.finish(),this._state<3&&(Tm.initialStylesByElement.delete(this._element),this._startStyles&&(Jf(this._element,this._startStyles),this._endStyles=null),this._endStyles&&(Jf(this._element,this._endStyles),this._endStyles=null),pu(this._element,this._initialStyles),this._state=3)}}Tm.initialStylesByElement=new WeakMap;const Qa=new Ht("AnimationModuleType"),l$=new Hu("12.2.5"),sCe=new Ht("mat-sanity-checks",{providedIn:"root",factory:function(){return!0}});let tp,ji=(()=>{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!(!fa()||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")&&l$.full!==aG.full&&console.warn("The Angular Material version ("+l$.full+") does not match the Angular CDK version ("+aG.full+").\nPlease ensure the versions of these two packages exactly match.")}}return n.\u0275fac=function(t){return new(t||n)(Ie(sG),Ie(sCe,8),Ie(fn))},n.\u0275mod=tn({type:n}),n.\u0275inj=St({imports:[[Ab],Ab]}),n})();function Am(n){return class extends n{constructor(...e){super(...e),this._disabled=!1}get disabled(){return this._disabled}set disabled(e){this._disabled=bi(e)}}}function Mm(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 Ch(n){return class extends n{constructor(...e){super(...e),this._disableRipple=!1}get disableRipple(){return this._disableRipple}set disableRipple(e){this._disableRipple=bi(e)}}}function wC(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?Ya(t):this.defaultTabIndex}}}try{tp="undefined"!=typeof Intl}catch(n){tp=!1}class yCe{constructor(e,t,i){this._renderer=e,this.element=t,this.config=i,this.state=3}fadeOut(){this._renderer.fadeOutRipple(this)}}const p$={enterDuration:225,exitDuration:150},SN=vm({passive:!0}),g$=["mousedown","touchstart"],m$=["mouseup","mouseleave","touchend","touchcancel"];class vCe{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=dd(i))}fadeInRipple(e,t,i={}){const r=this._containerRect=this._containerRect||this._containerElement.getBoundingClientRect(),s=Object.assign(Object.assign({},p$),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,u=document.createElement("div");u.classList.add("mat-ripple-element"),u.style.left=a-o+"px",u.style.top=l-o+"px",u.style.height=2*o+"px",u.style.width=2*o+"px",null!=i.color&&(u.style.backgroundColor=i.color),u.style.transitionDuration=`${c}ms`,this._containerElement.appendChild(u),function(n){window.getComputedStyle(n).getPropertyValue("opacity")}(u),u.style.transform="scale(1)";const h=new yCe(this,u,i);return h.state=0,this._activeRipples.add(h),i.persistent||(this._mostRecentTransientRipple=h),this._runTimeoutOutsideZone(()=>{const f=h===this._mostRecentTransientRipple;h.state=1,!i.persistent&&(!f||!this._isPointerDown)&&h.fadeOut()},c),h}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({},p$),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=dd(e);!t||t===this._triggerElement||(this._removeTriggerEvents(),this._triggerElement=t,this._registerEvents(g$))}handleEvent(e){"mousedown"===e.type?this._onMousedown(e):"touchstart"===e.type?this._onTouchStart(e):this._onPointerUp(),this._pointerUpEventsRegistered||(this._registerEvents(m$),this._pointerUpEventsRegistered=!0)}_onMousedown(e){const t=X6(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,SN)})})}_removeTriggerEvents(){this._triggerElement&&(g$.forEach(e=>{this._triggerElement.removeEventListener(e,this,SN)}),this._pointerUpEventsRegistered&&m$.forEach(e=>{this._triggerElement.removeEventListener(e,this,SN)}))}}const xCe=new Ht("mat-ripple-global-options");let gu=(()=>{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 vCe(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)(Ce(gn),Ce(pn),Ce(Qi),Ce(xCe,8),Ce(Qa,8))},n.\u0275dir=Nt({type:n,selectors:[["","mat-ripple",""],["","matRipple",""]],hostAttrs:[1,"mat-ripple"],hostVars:2,hostBindings:function(t,i){2&t&&ai("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})(),Dm=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=tn({type:n}),n.\u0275inj=St({imports:[[ji,Sb],ji]}),n})();function gd(n,e,t,i){return Y(t)&&(i=t,t=void 0),i?gd(n,e,t).pipe(me(r=>k(r)?i(...r):i(r))):new O(r=>{E$(n,e,function(o){r.next(arguments.length>1?Array.prototype.slice.call(arguments):o)},r,t)})}function E$(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;o0?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 FCe=1;const LCe=Promise.resolve(),SC={};function x$(n){return n in SC&&(delete SC[n],!0)}const S$={setImmediate(n){const e=FCe++;return SC[e]=!0,LCe.then(()=>x$(e)&&n()),e},clearImmediate(n){x$(n)}};new class extends cc{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=S$.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&&(S$.clearImmediate(t),e.scheduled=void 0)}});function Im(n){return!!n&&(n instanceof O||"function"==typeof n.lift&&"function"==typeof n.subscribe)}class zCe{constructor(e){this.durationSelector=e}call(e,t){return t.subscribe(new HCe(e,this.durationSelector))}}class HCe extends we{constructor(e,t){super(e),this.durationSelector=t,this.hasValue=!1}_next(e){if(this.value=e,this.hasValue=!0,!this.throttled){let t;try{const{durationSelector:r}=this;t=r(e)}catch(r){return this.destination.error(r)}const i=N(t,new _t(this));!i||i.closed?this.clearThrottle():this.add(this.throttled=i)}}clearThrottle(){const{value:e,hasValue:t,throttled:i}=this;i&&(this.remove(i),this.throttled=void 0,i.unsubscribe()),t&&(this.value=void 0,this.hasValue=!1,this.destination.next(e))}notifyNext(){this.clearThrottle()}notifyComplete(){this.clearThrottle()}}function C$(n){return!k(n)&&n-parseFloat(n)+1>=0}function $Ce(n){const{index:e,period:t,subscriber:i}=n;if(i.next(e),!i.closed){if(-1===t)return i.complete();n.index=e+1,this.schedule(n,t)}}function CC(n,e=qS){return function(n){return function(t){return t.lift(new zCe(n))}}(()=>function(n=0,e,t){let i=-1;return C$(e)?i=Number(e)<1?1:Number(e):Te(e)&&(t=e),Te(t)||(t=qS),new O(r=>{const s=C$(n)?n:+n-t.now();return t.schedule($Ce,s,{index:0,period:i,subscriber:r})})}(n,e))}let A$=(()=>{class n{constructor(){this._listeners=[]}notify(t,i){for(let r of this._listeners)r(t,i)}listen(t){return this._listeners.push(t),()=>{this._listeners=this._listeners.filter(i=>t!==i)}}ngOnDestroy(){this._listeners=[]}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({factory:function(){return new n},token:n,providedIn:"root"}),n})(),Om=(()=>{class n{constructor(t,i,r){this._ngZone=t,this._platform=i,this._scrolled=new oe,this._globalSubscription=null,this._scrolledCount=0,this.scrollContainers=new Map,this._document=r}register(t){this.scrollContainers.has(t)||this.scrollContainers.set(t,t.elementScrolled().subscribe(()=>this._scrolled.next(t)))}deregister(t){const i=this.scrollContainers.get(t);i&&(i.unsubscribe(),this.scrollContainers.delete(t))}scrolled(t=20){return this._platform.isBrowser?new O(i=>{this._globalSubscription||this._addGlobalListener();const r=t>0?this._scrolled.pipe(CC(t)).subscribe(i):this._scrolled.subscribe(i);return this._scrolledCount++,()=>{r.unsubscribe(),this._scrolledCount--,this._scrolledCount||this._removeGlobalListener()}}):sn()}ngOnDestroy(){this._removeGlobalListener(),this.scrollContainers.forEach((t,i)=>this.deregister(i)),this._scrolled.complete()}ancestorScrolled(t,i){const r=this.getAncestorScrollContainers(t);return this.scrolled(i).pipe(Ki(s=>!s||r.indexOf(s)>-1))}getAncestorScrollContainers(t){const i=[];return this.scrollContainers.forEach((r,s)=>{this._scrollableContainsElement(s,t)&&i.push(s)}),i}_getWindow(){return this._document.defaultView||window}_scrollableContainsElement(t,i){let r=dd(i),s=t.getElementRef().nativeElement;do{if(r==s)return!0}while(r=r.parentElement);return!1}_addGlobalListener(){this._globalSubscription=this._ngZone.runOutsideAngular(()=>gd(this._getWindow().document,"scroll").subscribe(()=>this._scrolled.next()))}_removeGlobalListener(){this._globalSubscription&&(this._globalSubscription.unsubscribe(),this._globalSubscription=null)}}return n.\u0275fac=function(t){return new(t||n)(Ie(pn),Ie(Qi),Ie(fn,8))},n.\u0275prov=We({factory:function(){return new n(Ie(pn),Ie(Qi),Ie(fn,8))},token:n,providedIn:"root"}),n})(),Rm=(()=>{class n{constructor(t,i,r){this._platform=t,this._change=new oe,this._changeListener=s=>{this._change.next(s)},this._document=r,i.runOutsideAngular(()=>{if(t.isBrowser){const s=this._getWindow();s.addEventListener("resize",this._changeListener),s.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:i,height:r}=this.getViewportSize();return{top:t.top,left:t.left,bottom:t.top+r,right:t.left+i,height:r,width:i}}getViewportScrollPosition(){if(!this._platform.isBrowser)return{top:0,left:0};const t=this._document,i=this._getWindow(),r=t.documentElement,s=r.getBoundingClientRect();return{top:-s.top||t.body.scrollTop||i.scrollY||r.scrollTop||0,left:-s.left||t.body.scrollLeft||i.scrollX||r.scrollLeft||0}}change(t=20){return t>0?this._change.pipe(CC(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 n.\u0275fac=function(t){return new(t||n)(Ie(Qi),Ie(pn),Ie(fn,8))},n.\u0275prov=We({factory:function(){return new n(Ie(Qi),Ie(pn),Ie(fn,8))},token:n,providedIn:"root"}),n})();class MN{attach(e){return this._attachedHost=e,e.attach(this)}detach(){let e=this._attachedHost;null!=e&&(this._attachedHost=null,e.detach())}get isAttached(){return null!=this._attachedHost}setAttachedHost(e){this._attachedHost=e}}class AC extends MN{constructor(e,t,i,r){super(),this.component=e,this.viewContainerRef=t,this.injector=i,this.componentFactoryResolver=r}}class Pm extends MN{constructor(e,t,i){super(),this.templateRef=e,this.viewContainerRef=t,this.context=i}get origin(){return this.templateRef.elementRef}attach(e,t=this.context){return this.context=t,super.attach(e)}detach(){return this.context=void 0,super.detach()}}class l1e extends MN{constructor(e){super(),this.element=e instanceof gn?e.nativeElement:e}}class MC{constructor(){this._isDisposed=!1,this.attachDomPortal=null}hasAttached(){return!!this._attachedPortal}attach(e){return e instanceof AC?(this._attachedPortal=e,this.attachComponentPortal(e)):e instanceof Pm?(this._attachedPortal=e,this.attachTemplatePortal(e)):this.attachDomPortal&&e instanceof l1e?(this._attachedPortal=e,this.attachDomPortal(e)):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(e){this._disposeFn=e}_invokeDisposeFn(){this._disposeFn&&(this._disposeFn(),this._disposeFn=null)}}class c1e extends MC{constructor(e,t,i,r,s){super(),this.outletElement=e,this._componentFactoryResolver=t,this._appRef=i,this._defaultInjector=r,this.attachDomPortal=o=>{const a=o.element,l=this._document.createComment("dom-portal");a.parentNode.insertBefore(l,a),this.outletElement.appendChild(a),this._attachedPortal=o,super.setDisposeFn(()=>{l.parentNode&&l.parentNode.replaceChild(a,l)})},this._document=s}attachComponentPortal(e){const i=(e.componentFactoryResolver||this._componentFactoryResolver).resolveComponentFactory(e.component);let r;return e.viewContainerRef?(r=e.viewContainerRef.createComponent(i,e.viewContainerRef.length,e.injector||e.viewContainerRef.injector),this.setDisposeFn(()=>r.destroy())):(r=i.create(e.injector||this._defaultInjector),this._appRef.attachView(r.hostView),this.setDisposeFn(()=>{this._appRef.detachView(r.hostView),r.destroy()})),this.outletElement.appendChild(this._getComponentRootNode(r)),this._attachedPortal=e,r}attachTemplatePortal(e){let t=e.viewContainerRef,i=t.createEmbeddedView(e.templateRef,e.context);return i.rootNodes.forEach(r=>this.outletElement.appendChild(r)),i.detectChanges(),this.setDisposeFn(()=>{let r=t.indexOf(i);-1!==r&&t.remove(r)}),this._attachedPortal=e,i}dispose(){super.dispose(),null!=this.outletElement.parentNode&&this.outletElement.parentNode.removeChild(this.outletElement)}_getComponentRootNode(e){return e.hostView.rootNodes[0]}}let np=(()=>{class n extends MC{constructor(t,i,r){super(),this._componentFactoryResolver=t,this._viewContainerRef=i,this._isInitialized=!1,this.attached=new ln,this.attachDomPortal=s=>{const o=s.element,a=this._document.createComment("dom-portal");s.setAttachedHost(this),o.parentNode.insertBefore(a,o),this._getRootNode().appendChild(o),this._attachedPortal=s,super.setDisposeFn(()=>{a.parentNode&&a.parentNode.replaceChild(o,a)})},this._document=r}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 i=null!=t.viewContainerRef?t.viewContainerRef:this._viewContainerRef,s=(t.componentFactoryResolver||this._componentFactoryResolver).resolveComponentFactory(t.component),o=i.createComponent(s,i.length,t.injector||i.injector);return i!==this._viewContainerRef&&this._getRootNode().appendChild(o.hostView.rootNodes[0]),super.setDisposeFn(()=>o.destroy()),this._attachedPortal=t,this._attachedRef=o,this.attached.emit(o),o}attachTemplatePortal(t){t.setAttachedHost(this);const i=this._viewContainerRef.createEmbeddedView(t.templateRef,t.context);return super.setDisposeFn(()=>this._viewContainerRef.clear()),this._attachedPortal=t,this._attachedRef=i,this.attached.emit(i),i}_getRootNode(){const t=this._viewContainerRef.element.nativeElement;return t.nodeType===t.ELEMENT_NODE?t:t.parentNode}}return n.\u0275fac=function(t){return new(t||n)(Ce(El),Ce(Rs),Ce(fn))},n.\u0275dir=Nt({type:n,selectors:[["","cdkPortalOutlet",""]],inputs:{portal:["cdkPortalOutlet","portal"]},outputs:{attached:"attached"},exportAs:["cdkPortalOutlet"],features:[En]}),n})();const N$=F6();class f1e{constructor(e,t){this._viewportRuler=e,this._previousHTMLStyles={top:"",left:""},this._isEnabled=!1,this._document=t}attach(){}enable(){if(this._canBeEnabled()){const e=this._document.documentElement;this._previousScrollPosition=this._viewportRuler.getViewportScrollPosition(),this._previousHTMLStyles.left=e.style.left||"",this._previousHTMLStyles.top=e.style.top||"",e.style.left=bs(-this._previousScrollPosition.left),e.style.top=bs(-this._previousScrollPosition.top),e.classList.add("cdk-global-scrollblock"),this._isEnabled=!0}}disable(){if(this._isEnabled){const e=this._document.documentElement,i=e.style,r=this._document.body.style,s=i.scrollBehavior||"",o=r.scrollBehavior||"";this._isEnabled=!1,i.left=this._previousHTMLStyles.left,i.top=this._previousHTMLStyles.top,e.classList.remove("cdk-global-scrollblock"),N$&&(i.scrollBehavior=r.scrollBehavior="auto"),window.scroll(this._previousScrollPosition.left,this._previousScrollPosition.top),N$&&(i.scrollBehavior=s,r.scrollBehavior=o)}}_canBeEnabled(){if(this._document.documentElement.classList.contains("cdk-global-scrollblock")||this._isEnabled)return!1;const t=this._document.body,i=this._viewportRuler.getViewportSize();return t.scrollHeight>i.height||t.scrollWidth>i.width}}class p1e{constructor(e,t,i,r){this._scrollDispatcher=e,this._ngZone=t,this._viewportRuler=i,this._config=r,this._scrollSubscription=null,this._detach=()=>{this.disable(),this._overlayRef.hasAttached()&&this._ngZone.run(()=>this._overlayRef.detach())}}attach(e){this._overlayRef=e}enable(){if(this._scrollSubscription)return;const e=this._scrollDispatcher.scrolled(0);this._config&&this._config.threshold&&this._config.threshold>1?(this._initialScrollPosition=this._viewportRuler.getViewportScrollPosition().top,this._scrollSubscription=e.subscribe(()=>{const t=this._viewportRuler.getViewportScrollPosition().top;Math.abs(t-this._initialScrollPosition)>this._config.threshold?this._detach():this._overlayRef.updatePosition()})):this._scrollSubscription=e.subscribe(this._detach)}disable(){this._scrollSubscription&&(this._scrollSubscription.unsubscribe(),this._scrollSubscription=null)}detach(){this.disable(),this._overlayRef=null}}class k${enable(){}disable(){}attach(){}}function DN(n,e){return e.some(t=>n.bottomt.bottom||n.rightt.right)}function F$(n,e){return e.some(t=>n.topt.bottom||n.leftt.right)}class g1e{constructor(e,t,i,r){this._scrollDispatcher=e,this._viewportRuler=t,this._ngZone=i,this._config=r,this._scrollSubscription=null}attach(e){this._overlayRef=e}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:i,height:r}=this._viewportRuler.getViewportSize();DN(t,[{width:i,height:r,bottom:r,right:i,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 m1e=(()=>{class n{constructor(t,i,r,s){this._scrollDispatcher=t,this._viewportRuler=i,this._ngZone=r,this.noop=()=>new k$,this.close=o=>new p1e(this._scrollDispatcher,this._ngZone,this._viewportRuler,o),this.block=()=>new f1e(this._viewportRuler,this._document),this.reposition=o=>new g1e(this._scrollDispatcher,this._viewportRuler,this._ngZone,o),this._document=s}}return n.\u0275fac=function(t){return new(t||n)(Ie(Om),Ie(Rm),Ie(pn),Ie(fn))},n.\u0275prov=We({factory:function(){return new n(Ie(Om),Ie(Rm),Ie(pn),Ie(fn))},token:n,providedIn:"root"}),n})();class IC{constructor(e){if(this.scrollStrategy=new k$,this.panelClass="",this.hasBackdrop=!1,this.backdropClass="cdk-overlay-dark-backdrop",this.disposeOnNavigation=!1,e){const t=Object.keys(e);for(const i of t)void 0!==e[i]&&(this[i]=e[i])}}}class _1e{constructor(e,t,i,r,s){this.offsetX=i,this.offsetY=r,this.panelClass=s,this.originX=e.originX,this.originY=e.originY,this.overlayX=t.overlayX,this.overlayY=t.overlayY}}class y1e{constructor(e,t){this.connectionPair=e,this.scrollableViewProperties=t}}let L$=(()=>{class n{constructor(t){this._attachedOverlays=[],this._document=t}ngOnDestroy(){this.detach()}add(t){this.remove(t),this._attachedOverlays.push(t)}remove(t){const i=this._attachedOverlays.indexOf(t);i>-1&&this._attachedOverlays.splice(i,1),0===this._attachedOverlays.length&&this.detach()}}return n.\u0275fac=function(t){return new(t||n)(Ie(fn))},n.\u0275prov=We({factory:function(){return new n(Ie(fn))},token:n,providedIn:"root"}),n})(),b1e=(()=>{class n extends L${constructor(t){super(t),this._keydownListener=i=>{const r=this._attachedOverlays;for(let s=r.length-1;s>-1;s--)if(r[s]._keydownEvents.observers.length>0){r[s]._keydownEvents.next(i);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 n.\u0275fac=function(t){return new(t||n)(Ie(fn))},n.\u0275prov=We({factory:function(){return new n(Ie(fn))},token:n,providedIn:"root"}),n})(),v1e=(()=>{class n extends L${constructor(t,i){super(t),this._platform=i,this._cursorStyleIsSet=!1,this._clickListener=r=>{const s=Kf(r),o=this._attachedOverlays.slice();for(let a=o.length-1;a>-1;a--){const l=o[a];if(!(l._outsidePointerEvents.observers.length<1)&&l.hasAttached()){if(l.overlayElement.contains(s))break;l._outsidePointerEvents.next(r)}}}}add(t){if(super.add(t),!this._isAttached){const i=this._document.body;i.addEventListener("click",this._clickListener,!0),i.addEventListener("auxclick",this._clickListener,!0),i.addEventListener("contextmenu",this._clickListener,!0),this._platform.IOS&&!this._cursorStyleIsSet&&(this._cursorOriginalValue=i.style.cursor,i.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 n.\u0275fac=function(t){return new(t||n)(Ie(fn),Ie(Qi))},n.\u0275prov=We({factory:function(){return new n(Ie(fn),Ie(Qi))},token:n,providedIn:"root"}),n})();const Th="undefined"!=typeof window?window:{},B$=void 0!==Th.__karma__&&!!Th.__karma__||void 0!==Th.jasmine&&!!Th.jasmine||void 0!==Th.jest&&!!Th.jest||void 0!==Th.Mocha&&!!Th.Mocha;let Ob=(()=>{class n{constructor(t,i){this._platform=i,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||B$){const r=this._document.querySelectorAll(`.${t}[platform="server"], .${t}[platform="test"]`);for(let s=0;sthis._backdropClick.next(u),this._keydownEvents=new oe,this._outsidePointerEvents=new oe,r.scrollStrategy&&(this._scrollStrategy=r.scrollStrategy,this._scrollStrategy.attach(this)),this._positionStrategy=r.positionStrategy}get overlayElement(){return this._pane}get backdropElement(){return this._backdropElement}get hostElement(){return this._host}attach(e){let t=this._portalOutlet.attach(e);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(qr(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),t}detach(){if(!this.hasAttached())return;this.detachBackdrop(),this._togglePointerEvents(!1),this._positionStrategy&&this._positionStrategy.detach&&this._positionStrategy.detach(),this._scrollStrategy&&this._scrollStrategy.disable();const e=this._portalOutlet.detach();return this._detachments.next(),this._keyboardDispatcher.remove(this),this._detachContentWhenStable(),this._locationChanges.unsubscribe(),this._outsideClickDispatcher.remove(this),e}dispose(){const e=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,e&&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(e){e!==this._positionStrategy&&(this._positionStrategy&&this._positionStrategy.dispose(),this._positionStrategy=e,this.hasAttached()&&(e.attach(this),this.updatePosition()))}updateSize(e){this._config=Object.assign(Object.assign({},this._config),e),this._updateElementSize()}setDirection(e){this._config=Object.assign(Object.assign({},this._config),{direction:e}),this._updateElementDirection()}addPanelClass(e){this._pane&&this._toggleClasses(this._pane,e,!0)}removePanelClass(e){this._pane&&this._toggleClasses(this._pane,e,!1)}getDirection(){const e=this._config.direction;return e?"string"==typeof e?e:e.value:"ltr"}updateScrollStrategy(e){e!==this._scrollStrategy&&(this._disposeScrollStrategy(),this._scrollStrategy=e,this.hasAttached()&&(e.attach(this),e.enable()))}_updateElementDirection(){this._host.setAttribute("dir",this.getDirection())}_updateElementSize(){if(!this._pane)return;const e=this._pane.style;e.width=bs(this._config.width),e.height=bs(this._config.height),e.minWidth=bs(this._config.minWidth),e.minHeight=bs(this._config.minHeight),e.maxWidth=bs(this._config.maxWidth),e.maxHeight=bs(this._config.maxHeight)}_togglePointerEvents(e){this._pane.style.pointerEvents=e?"":"none"}_attachBackdrop(){const e="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(e)})}):this._backdropElement.classList.add(e)}_updateStackingOrder(){this._host.nextSibling&&this._host.parentNode.appendChild(this._host)}detachBackdrop(){let e=this._backdropElement;if(!e)return;let t,i=()=>{e&&(e.removeEventListener("click",this._backdropClickHandler),e.removeEventListener("transitionend",i),e.parentNode&&e.parentNode.removeChild(e)),this._backdropElement==e&&(this._backdropElement=null),this._config.backdropClass&&this._toggleClasses(e,this._config.backdropClass,!1),clearTimeout(t)};e.classList.remove("cdk-overlay-backdrop-showing"),this._ngZone.runOutsideAngular(()=>{e.addEventListener("transitionend",i)}),e.style.pointerEvents="none",t=this._ngZone.runOutsideAngular(()=>setTimeout(i,500))}_toggleClasses(e,t,i){const r=e.classList;YS(t).forEach(s=>{s&&(i?r.add(s):r.remove(s))})}_detachContentWhenStable(){this._ngZone.runOutsideAngular(()=>{const e=this._ngZone.onStable.pipe(gr(Nn(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)),e.unsubscribe())})})}_disposeScrollStrategy(){const e=this._scrollStrategy;e&&(e.disable(),e.detach&&e.detach())}}const V$="cdk-overlay-connected-position-bounding-box",E1e=/([A-Za-z%]+)$/;class j${constructor(e,t,i,r,s){this._viewportRuler=t,this._document=i,this._platform=r,this._overlayContainer=s,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 oe,this._resizeSubscription=C.EMPTY,this._offsetX=0,this._offsetY=0,this._appliedPanelClasses=[],this.positionChanges=this._positionChanges,this.setOrigin(e)}get positions(){return this._preferredPositions}attach(e){this._validatePositions(),e.hostElement.classList.add(V$),this._overlayRef=e,this._boundingBox=e.hostElement,this._pane=e.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 e=this._originRect,t=this._overlayRect,i=this._viewportRect,r=[];let s;for(let o of this._preferredPositions){let a=this._getOriginPoint(e,o),l=this._getOverlayPoint(a,t,o),c=this._getOverlayFit(l,t,i,o);if(c.isCompletelyWithinViewport)return this._isPushed=!1,void this._applyPosition(o,a);this._canFitWithFlexibleDimensions(c,l,i)?r.push({position:o,origin:a,overlayRect:t,boundingBoxRect:this._calculateBoundingBoxRect(a,o)}):(!s||s.overlayFit.visibleAreaa&&(a=c,o=l)}return this._isPushed=!1,void this._applyPosition(o.position,o.origin)}if(this._canPush)return this._isPushed=!0,void this._applyPosition(s.position,s.originPoint);this._applyPosition(s.position,s.originPoint)}detach(){this._clearPanelClasses(),this._lastPosition=null,this._previousPushAmount=null,this._resizeSubscription.unsubscribe()}dispose(){this._isDisposed||(this._boundingBox&&ip(this._boundingBox.style,{top:"",left:"",right:"",bottom:"",height:"",width:"",alignItems:"",justifyContent:""}),this._pane&&this._resetOverlayElementStyles(),this._overlayRef&&this._overlayRef.hostElement.classList.remove(V$),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 e=this._lastPosition||this._preferredPositions[0],t=this._getOriginPoint(this._originRect,e);this._applyPosition(e,t)}}withScrollableContainers(e){return this._scrollables=e,this}withPositions(e){return this._preferredPositions=e,-1===e.indexOf(this._lastPosition)&&(this._lastPosition=null),this._validatePositions(),this}withViewportMargin(e){return this._viewportMargin=e,this}withFlexibleDimensions(e=!0){return this._hasFlexibleDimensions=e,this}withGrowAfterOpen(e=!0){return this._growAfterOpen=e,this}withPush(e=!0){return this._canPush=e,this}withLockedPosition(e=!0){return this._positionLocked=e,this}setOrigin(e){return this._origin=e,this}withDefaultOffsetX(e){return this._offsetX=e,this}withDefaultOffsetY(e){return this._offsetY=e,this}withTransformOriginOn(e){return this._transformOriginSelector=e,this}_getOriginPoint(e,t){let i,r;if("center"==t.originX)i=e.left+e.width/2;else{const s=this._isRtl()?e.right:e.left,o=this._isRtl()?e.left:e.right;i="start"==t.originX?s:o}return r="center"==t.originY?e.top+e.height/2:"top"==t.originY?e.top:e.bottom,{x:i,y:r}}_getOverlayPoint(e,t,i){let r,s;return r="center"==i.overlayX?-t.width/2:"start"===i.overlayX?this._isRtl()?-t.width:0:this._isRtl()?0:-t.width,s="center"==i.overlayY?-t.height/2:"top"==i.overlayY?0:-t.height,{x:e.x+r,y:e.y+s}}_getOverlayFit(e,t,i,r){const s=z$(t);let{x:o,y:a}=e,l=this._getOffset(r,"x"),c=this._getOffset(r,"y");l&&(o+=l),c&&(a+=c);let f=0-a,g=a+s.height-i.height,m=this._subtractOverflows(s.width,0-o,o+s.width-i.width),w=this._subtractOverflows(s.height,f,g),x=m*w;return{visibleArea:x,isCompletelyWithinViewport:s.width*s.height===x,fitsInViewportVertically:w===s.height,fitsInViewportHorizontally:m==s.width}}_canFitWithFlexibleDimensions(e,t,i){if(this._hasFlexibleDimensions){const r=i.bottom-t.y,s=i.right-t.x,o=U$(this._overlayRef.getConfig().minHeight),a=U$(this._overlayRef.getConfig().minWidth),c=e.fitsInViewportHorizontally||null!=a&&a<=s;return(e.fitsInViewportVertically||null!=o&&o<=r)&&c}return!1}_pushOverlayOnScreen(e,t,i){if(this._previousPushAmount&&this._positionLocked)return{x:e.x+this._previousPushAmount.x,y:e.y+this._previousPushAmount.y};const r=z$(t),s=this._viewportRect,o=Math.max(e.x+r.width-s.width,0),a=Math.max(e.y+r.height-s.height,0),l=Math.max(s.top-i.top-e.y,0),c=Math.max(s.left-i.left-e.x,0);let u=0,h=0;return u=r.width<=s.width?c||-o:e.xm&&!this._isInitialRender&&!this._growAfterOpen&&(o=e.y-m/2)}if("end"===t.overlayX&&!r||"start"===t.overlayX&&r)f=i.width-e.x+this._viewportMargin,u=e.x-this._viewportMargin;else if("start"===t.overlayX&&!r||"end"===t.overlayX&&r)h=e.x,u=i.right-e.x;else{const g=Math.min(i.right-e.x+i.left,e.x),m=this._lastBoundingBoxSize.width;u=2*g,h=e.x-g,u>m&&!this._isInitialRender&&!this._growAfterOpen&&(h=e.x-m/2)}return{top:o,left:h,bottom:a,right:f,width:u,height:s}}_setBoundingBoxStyles(e,t){const i=this._calculateBoundingBoxRect(e,t);!this._isInitialRender&&!this._growAfterOpen&&(i.height=Math.min(i.height,this._lastBoundingBoxSize.height),i.width=Math.min(i.width,this._lastBoundingBoxSize.width));const r={};if(this._hasExactPosition())r.top=r.left="0",r.bottom=r.right=r.maxHeight=r.maxWidth="",r.width=r.height="100%";else{const s=this._overlayRef.getConfig().maxHeight,o=this._overlayRef.getConfig().maxWidth;r.height=bs(i.height),r.top=bs(i.top),r.bottom=bs(i.bottom),r.width=bs(i.width),r.left=bs(i.left),r.right=bs(i.right),r.alignItems="center"===t.overlayX?"center":"end"===t.overlayX?"flex-end":"flex-start",r.justifyContent="center"===t.overlayY?"center":"bottom"===t.overlayY?"flex-end":"flex-start",s&&(r.maxHeight=bs(s)),o&&(r.maxWidth=bs(o))}this._lastBoundingBoxSize=i,ip(this._boundingBox.style,r)}_resetBoundingBoxStyles(){ip(this._boundingBox.style,{top:"0",left:"0",right:"0",bottom:"0",height:"",width:"",alignItems:"",justifyContent:""})}_resetOverlayElementStyles(){ip(this._pane.style,{top:"",left:"",bottom:"",right:"",position:"",transform:""})}_setOverlayElementStyles(e,t){const i={},r=this._hasExactPosition(),s=this._hasFlexibleDimensions,o=this._overlayRef.getConfig();if(r){const u=this._viewportRuler.getViewportScrollPosition();ip(i,this._getExactOverlayY(t,e,u)),ip(i,this._getExactOverlayX(t,e,u))}else i.position="static";let a="",l=this._getOffset(t,"x"),c=this._getOffset(t,"y");l&&(a+=`translateX(${l}px) `),c&&(a+=`translateY(${c}px)`),i.transform=a.trim(),o.maxHeight&&(r?i.maxHeight=bs(o.maxHeight):s&&(i.maxHeight="")),o.maxWidth&&(r?i.maxWidth=bs(o.maxWidth):s&&(i.maxWidth="")),ip(this._pane.style,i)}_getExactOverlayY(e,t,i){let r={top:"",bottom:""},s=this._getOverlayPoint(t,this._overlayRect,e);this._isPushed&&(s=this._pushOverlayOnScreen(s,this._overlayRect,i));let o=this._overlayContainer.getContainerElement().getBoundingClientRect().top;return s.y-=o,"bottom"===e.overlayY?r.bottom=this._document.documentElement.clientHeight-(s.y+this._overlayRect.height)+"px":r.top=bs(s.y),r}_getExactOverlayX(e,t,i){let o,r={left:"",right:""},s=this._getOverlayPoint(t,this._overlayRect,e);return this._isPushed&&(s=this._pushOverlayOnScreen(s,this._overlayRect,i)),o=this._isRtl()?"end"===e.overlayX?"left":"right":"end"===e.overlayX?"right":"left","right"===o?r.right=this._document.documentElement.clientWidth-(s.x+this._overlayRect.width)+"px":r.left=bs(s.x),r}_getScrollVisibility(){const e=this._getOriginRect(),t=this._pane.getBoundingClientRect(),i=this._scrollables.map(r=>r.getElementRef().nativeElement.getBoundingClientRect());return{isOriginClipped:F$(e,i),isOriginOutsideView:DN(e,i),isOverlayClipped:F$(t,i),isOverlayOutsideView:DN(t,i)}}_subtractOverflows(e,...t){return t.reduce((i,r)=>i-Math.max(r,0),e)}_getNarrowedViewportRect(){const e=this._document.documentElement.clientWidth,t=this._document.documentElement.clientHeight,i=this._viewportRuler.getViewportScrollPosition();return{top:i.top+this._viewportMargin,left:i.left+this._viewportMargin,right:i.left+e-this._viewportMargin,bottom:i.top+t-this._viewportMargin,width:e-2*this._viewportMargin,height:t-2*this._viewportMargin}}_isRtl(){return"rtl"===this._overlayRef.getDirection()}_hasExactPosition(){return!this._hasFlexibleDimensions||this._isPushed}_getOffset(e,t){return"x"===t?null==e.offsetX?this._offsetX:e.offsetX:null==e.offsetY?this._offsetY:e.offsetY}_validatePositions(){}_addPanelClasses(e){this._pane&&YS(e).forEach(t=>{""!==t&&-1===this._appliedPanelClasses.indexOf(t)&&(this._appliedPanelClasses.push(t),this._pane.classList.add(t))})}_clearPanelClasses(){this._pane&&(this._appliedPanelClasses.forEach(e=>{this._pane.classList.remove(e)}),this._appliedPanelClasses=[])}_getOriginRect(){const e=this._origin;if(e instanceof gn)return e.nativeElement.getBoundingClientRect();if(e instanceof Element)return e.getBoundingClientRect();const t=e.width||0,i=e.height||0;return{top:e.y,bottom:e.y+i,left:e.x,right:e.x+t,height:i,width:t}}}function ip(n,e){for(let t in e)e.hasOwnProperty(t)&&(n[t]=e[t]);return n}function U$(n){if("number"!=typeof n&&null!=n){const[e,t]=n.split(E1e);return t&&"px"!==t?null:parseFloat(e)}return n||null}function z$(n){return{top:Math.floor(n.top),right:Math.floor(n.right),bottom:Math.floor(n.bottom),left:Math.floor(n.left),width:Math.floor(n.width),height:Math.floor(n.height)}}class x1e{constructor(e,t,i,r,s,o,a){this._preferredPositions=[],this._positionStrategy=new j$(i,r,s,o,a).withFlexibleDimensions(!1).withPush(!1).withViewportMargin(0),this.withFallbackPosition(e,t),this.onPositionChange=this._positionStrategy.positionChanges}get positions(){return this._preferredPositions}attach(e){this._overlayRef=e,this._positionStrategy.attach(e),this._direction&&(e.setDirection(this._direction),this._direction=null)}dispose(){this._positionStrategy.dispose()}detach(){this._positionStrategy.detach()}apply(){this._positionStrategy.apply()}recalculateLastPosition(){this._positionStrategy.reapplyLastPosition()}withScrollableContainers(e){this._positionStrategy.withScrollableContainers(e)}withFallbackPosition(e,t,i,r){const s=new _1e(e,t,i,r);return this._preferredPositions.push(s),this._positionStrategy.withPositions(this._preferredPositions),this}withDirection(e){return this._overlayRef?this._overlayRef.setDirection(e):this._direction=e,this}withOffsetX(e){return this._positionStrategy.withDefaultOffsetX(e),this}withOffsetY(e){return this._positionStrategy.withDefaultOffsetY(e),this}withLockedPosition(e){return this._positionStrategy.withLockedPosition(e),this}withPositions(e){return this._preferredPositions=e.slice(),this._positionStrategy.withPositions(this._preferredPositions),this}setOrigin(e){return this._positionStrategy.setOrigin(e),this}}const H$="cdk-global-overlay-wrapper";class S1e{constructor(){this._cssPosition="static",this._topOffset="",this._bottomOffset="",this._leftOffset="",this._rightOffset="",this._alignItems="",this._justifyContent="",this._width="",this._height=""}attach(e){const t=e.getConfig();this._overlayRef=e,this._width&&!t.width&&e.updateSize({width:this._width}),this._height&&!t.height&&e.updateSize({height:this._height}),e.hostElement.classList.add(H$),this._isDisposed=!1}top(e=""){return this._bottomOffset="",this._topOffset=e,this._alignItems="flex-start",this}left(e=""){return this._rightOffset="",this._leftOffset=e,this._justifyContent="flex-start",this}bottom(e=""){return this._topOffset="",this._bottomOffset=e,this._alignItems="flex-end",this}right(e=""){return this._leftOffset="",this._rightOffset=e,this._justifyContent="flex-end",this}width(e=""){return this._overlayRef?this._overlayRef.updateSize({width:e}):this._width=e,this}height(e=""){return this._overlayRef?this._overlayRef.updateSize({height:e}):this._height=e,this}centerHorizontally(e=""){return this.left(e),this._justifyContent="center",this}centerVertically(e=""){return this.top(e),this._alignItems="center",this}apply(){if(!this._overlayRef||!this._overlayRef.hasAttached())return;const e=this._overlayRef.overlayElement.style,t=this._overlayRef.hostElement.style,i=this._overlayRef.getConfig(),{width:r,height:s,maxWidth:o,maxHeight:a}=i,l=!("100%"!==r&&"100vw"!==r||o&&"100%"!==o&&"100vw"!==o),c=!("100%"!==s&&"100vh"!==s||a&&"100%"!==a&&"100vh"!==a);e.position=this._cssPosition,e.marginLeft=l?"0":this._leftOffset,e.marginTop=c?"0":this._topOffset,e.marginBottom=this._bottomOffset,e.marginRight=this._rightOffset,l?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=c?"flex-start":this._alignItems}dispose(){if(this._isDisposed||!this._overlayRef)return;const e=this._overlayRef.overlayElement.style,t=this._overlayRef.hostElement,i=t.style;t.classList.remove(H$),i.justifyContent=i.alignItems=e.marginTop=e.marginBottom=e.marginLeft=e.marginRight=e.position="",this._overlayRef=null,this._isDisposed=!0}}let C1e=(()=>{class n{constructor(t,i,r,s){this._viewportRuler=t,this._document=i,this._platform=r,this._overlayContainer=s}global(){return new S1e}connectedTo(t,i,r){return new x1e(i,r,t,this._viewportRuler,this._document,this._platform,this._overlayContainer)}flexibleConnectedTo(t){return new j$(t,this._viewportRuler,this._document,this._platform,this._overlayContainer)}}return n.\u0275fac=function(t){return new(t||n)(Ie(Rm),Ie(fn),Ie(Qi),Ie(Ob))},n.\u0275prov=We({factory:function(){return new n(Ie(Rm),Ie(fn),Ie(Qi),Ie(Ob))},token:n,providedIn:"root"}),n})(),T1e=0,Ec=(()=>{class n{constructor(t,i,r,s,o,a,l,c,u,h,f){this.scrollStrategies=t,this._overlayContainer=i,this._componentFactoryResolver=r,this._positionBuilder=s,this._keyboardDispatcher=o,this._injector=a,this._ngZone=l,this._document=c,this._directionality=u,this._location=h,this._outsideClickDispatcher=f}create(t){const i=this._createHostElement(),r=this._createPaneElement(i),s=this._createPortalOutlet(r),o=new IC(t);return o.direction=o.direction||this._directionality.value,new w1e(s,i,r,o,this._ngZone,this._keyboardDispatcher,this._document,this._location,this._outsideClickDispatcher)}position(){return this._positionBuilder}_createPaneElement(t){const i=this._document.createElement("div");return i.id="cdk-overlay-"+T1e++,i.classList.add("cdk-overlay-pane"),t.appendChild(i),i}_createHostElement(){const t=this._document.createElement("div");return this._overlayContainer.getContainerElement().appendChild(t),t}_createPortalOutlet(t){return this._appRef||(this._appRef=this._injector.get(sh)),new c1e(t,this._componentFactoryResolver,this._appRef,this._injector,this._document)}}return n.\u0275fac=function(t){return new(t||n)(Ie(m1e),Ie(Ob),Ie(El),Ie(C1e),Ie(b1e),Ie(Hn),Ie(pn),Ie(fn),Ie(Il),Ie(kg),Ie(v1e))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();class rTe{constructor(e,t){this.delay=e,this.scheduler=t}call(e,t){return t.subscribe(new PN(e,this.delay,this.scheduler))}}class PN extends y{constructor(e,t,i){super(e),this.delay=t,this.scheduler=i,this.queue=[],this.active=!1,this.errored=!1}static dispatch(e){const t=e.source,i=t.queue,r=e.scheduler,s=e.destination;for(;i.length>0&&i[0].time-r.now()<=0;)i.shift().notification.observe(s);if(i.length>0){const o=Math.max(0,i[0].time-r.now());this.schedule(e,o)}else this.unsubscribe(),t.active=!1}_schedule(e){this.active=!0,this.destination.add(e.schedule(PN.dispatch,this.delay,{source:this,destination:this.destination,scheduler:e}))}scheduleNotification(e){if(!0===this.errored)return;const t=this.scheduler,i=new sTe(t.now()+this.delay,e);this.queue.push(i),!1===this.active&&this._schedule(t)}_next(e){this.scheduleNotification(ga.createNext(e))}_error(e){this.errored=!0,this.queue=[],this.destination.error(e),this.unsubscribe()}_complete(){this.scheduleNotification(ga.createComplete()),this.unsubscribe()}}class sTe{constructor(e,t){this.time=e,this.notification=t}}function oW(...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;se.lift(new WTe(n))}et(7266);class WTe{constructor(e){this.callback=e}call(e,t){return t.subscribe(new qTe(e,this.callback))}}class qTe extends y{constructor(e,t){super(e),this.add(new C(t))}}class fW{}class pW{}class mu{constructor(e){this.normalizedNames=new Map,this.lazyUpdate=null,e?this.lazyInit="string"==typeof e?()=>{this.headers=new Map,e.split("\n").forEach(t=>{const i=t.indexOf(":");if(i>0){const r=t.slice(0,i),s=r.toLowerCase(),o=t.slice(i+1).trim();this.maybeSetNormalizedName(r,s),this.headers.has(s)?this.headers.get(s).push(o):this.headers.set(s,[o])}})}:()=>{this.headers=new Map,Object.keys(e).forEach(t=>{let i=e[t];const r=t.toLowerCase();"string"==typeof i&&(i=[i]),i.length>0&&(this.headers.set(r,i),this.maybeSetNormalizedName(t,r))})}:this.headers=new Map}has(e){return this.init(),this.headers.has(e.toLowerCase())}get(e){this.init();const t=this.headers.get(e.toLowerCase());return t&&t.length>0?t[0]:null}keys(){return this.init(),Array.from(this.normalizedNames.values())}getAll(e){return this.init(),this.headers.get(e.toLowerCase())||null}append(e,t){return this.clone({name:e,value:t,op:"a"})}set(e,t){return this.clone({name:e,value:t,op:"s"})}delete(e,t){return this.clone({name:e,value:t,op:"d"})}maybeSetNormalizedName(e,t){this.normalizedNames.has(t)||this.normalizedNames.set(t,e)}init(){this.lazyInit&&(this.lazyInit instanceof mu?this.copyFrom(this.lazyInit):this.lazyInit(),this.lazyInit=null,this.lazyUpdate&&(this.lazyUpdate.forEach(e=>this.applyUpdate(e)),this.lazyUpdate=null))}copyFrom(e){e.init(),Array.from(e.headers.keys()).forEach(t=>{this.headers.set(t,e.headers.get(t)),this.normalizedNames.set(t,e.normalizedNames.get(t))})}clone(e){const t=new mu;return t.lazyInit=this.lazyInit&&this.lazyInit instanceof mu?this.lazyInit:this,t.lazyUpdate=(this.lazyUpdate||[]).concat([e]),t}applyUpdate(e){const t=e.name.toLowerCase();switch(e.op){case"a":case"s":let i=e.value;if("string"==typeof i&&(i=[i]),0===i.length)return;this.maybeSetNormalizedName(e.name,t);const r=("a"===e.op?this.headers.get(t):void 0)||[];r.push(...i),this.headers.set(t,r);break;case"d":const s=e.value;if(s){let o=this.headers.get(t);if(!o)return;o=o.filter(a=>-1===s.indexOf(a)),0===o.length?(this.headers.delete(t),this.normalizedNames.delete(t)):this.headers.set(t,o)}else this.headers.delete(t),this.normalizedNames.delete(t)}}forEach(e){this.init(),Array.from(this.normalizedNames.keys()).forEach(t=>e(this.normalizedNames.get(t),this.headers.get(t)))}}class YTe{encodeKey(e){return gW(e)}encodeValue(e){return gW(e)}decodeKey(e){return decodeURIComponent(e)}decodeValue(e){return decodeURIComponent(e)}}const KTe=/%(\d[a-f0-9])/gi,QTe={40:"@","3A":":",24:"$","2C":",","3B":";","2B":"+","3D":"=","3F":"?","2F":"/"};function gW(n){return encodeURIComponent(n).replace(KTe,(e,t)=>{var i;return null!==(i=QTe[t])&&void 0!==i?i:e})}function mW(n){return`${n}`}class Lr{constructor(e={}){if(this.updates=null,this.cloneFrom=null,this.encoder=e.encoder||new YTe,e.fromString){if(e.fromObject)throw new Error("Cannot specify both fromString and fromObject.");this.map=function(n,e){const t=new Map;return n.length>0&&n.replace(/^\?/,"").split("&").forEach(r=>{const s=r.indexOf("="),[o,a]=-1==s?[e.decodeKey(r),""]:[e.decodeKey(r.slice(0,s)),e.decodeValue(r.slice(s+1))],l=t.get(o)||[];l.push(a),t.set(o,l)}),t}(e.fromString,this.encoder)}else e.fromObject?(this.map=new Map,Object.keys(e.fromObject).forEach(t=>{const i=e.fromObject[t];this.map.set(t,Array.isArray(i)?i:[i])})):this.map=null}has(e){return this.init(),this.map.has(e)}get(e){this.init();const t=this.map.get(e);return t?t[0]:null}getAll(e){return this.init(),this.map.get(e)||null}keys(){return this.init(),Array.from(this.map.keys())}append(e,t){return this.clone({param:e,value:t,op:"a"})}appendAll(e){const t=[];return Object.keys(e).forEach(i=>{const r=e[i];Array.isArray(r)?r.forEach(s=>{t.push({param:i,value:s,op:"a"})}):t.push({param:i,value:r,op:"a"})}),this.clone(t)}set(e,t){return this.clone({param:e,value:t,op:"s"})}delete(e,t){return this.clone({param:e,value:t,op:"d"})}toString(){return this.init(),this.keys().map(e=>{const t=this.encoder.encodeKey(e);return this.map.get(e).map(i=>t+"="+this.encoder.encodeValue(i)).join("&")}).filter(e=>""!==e).join("&")}clone(e){const t=new Lr({encoder:this.encoder});return t.cloneFrom=this.cloneFrom||this,t.updates=(this.updates||[]).concat(e),t}init(){null===this.map&&(this.map=new Map),null!==this.cloneFrom&&(this.cloneFrom.init(),this.cloneFrom.keys().forEach(e=>this.map.set(e,this.cloneFrom.map.get(e))),this.updates.forEach(e=>{switch(e.op){case"a":case"s":const t=("a"===e.op?this.map.get(e.param):void 0)||[];t.push(mW(e.value)),this.map.set(e.param,t);break;case"d":if(void 0===e.value){this.map.delete(e.param);break}{let i=this.map.get(e.param)||[];const r=i.indexOf(mW(e.value));-1!==r&&i.splice(r,1),i.length>0?this.map.set(e.param,i):this.map.delete(e.param)}}}),this.cloneFrom=this.updates=null)}}class Zs{constructor(){this.map=new Map}set(e,t){return this.map.set(e,t),this}get(e){return this.map.has(e)||this.map.set(e,e.defaultValue()),this.map.get(e)}delete(e){return this.map.delete(e),this}keys(){return this.map.keys()}}function _W(n){return"undefined"!=typeof ArrayBuffer&&n instanceof ArrayBuffer}function yW(n){return"undefined"!=typeof Blob&&n instanceof Blob}function bW(n){return"undefined"!=typeof FormData&&n instanceof FormData}class Rb{constructor(e,t,i,r){let s;if(this.url=t,this.body=null,this.reportProgress=!1,this.withCredentials=!1,this.responseType="json",this.method=e.toUpperCase(),function(n){switch(n){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,s=r):s=i,s&&(this.reportProgress=!!s.reportProgress,this.withCredentials=!!s.withCredentials,s.responseType&&(this.responseType=s.responseType),s.headers&&(this.headers=s.headers),s.context&&(this.context=s.context),s.params&&(this.params=s.params)),this.headers||(this.headers=new mu),this.context||(this.context=new Zs),this.params){const o=this.params.toString();if(0===o.length)this.urlWithParams=t;else{const a=t.indexOf("?");this.urlWithParams=t+(-1===a?"?":af.set(g,e.setHeaders[g]),c)),e.setParams&&(u=Object.keys(e.setParams).reduce((f,g)=>f.set(g,e.setParams[g]),u)),new Rb(i,r,o,{params:u,headers:c,context:h,reportProgress:l,responseType:s,withCredentials:a})}}var vs=(()=>((vs=vs||{})[vs.Sent=0]="Sent",vs[vs.UploadProgress=1]="UploadProgress",vs[vs.ResponseHeader=2]="ResponseHeader",vs[vs.DownloadProgress=3]="DownloadProgress",vs[vs.Response=4]="Response",vs[vs.User=5]="User",vs))();class kN{constructor(e,t=200,i="OK"){this.headers=e.headers||new mu,this.status=void 0!==e.status?e.status:t,this.statusText=e.statusText||i,this.url=e.url||null,this.ok=this.status>=200&&this.status<300}}class FN extends kN{constructor(e={}){super(e),this.type=vs.ResponseHeader}clone(e={}){return new FN({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})}}class RC extends kN{constructor(e={}){super(e),this.type=vs.Response,this.body=void 0!==e.body?e.body:null}clone(e={}){return new RC({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})}}class vW extends kN{constructor(e){super(e,0,"Unknown Error"),this.name="HttpErrorResponse",this.ok=!1,this.message=this.status>=200&&this.status<300?`Http failure during parsing for ${e.url||"(unknown url)"}`:`Http failure response for ${e.url||"(unknown url)"}: ${e.status} ${e.statusText}`,this.error=e.error||null}}function LN(n,e){return{body:e,headers:n.headers,context:n.context,observe:n.observe,params:n.params,reportProgress:n.reportProgress,responseType:n.responseType,withCredentials:n.withCredentials}}let _u=(()=>{class n{constructor(t){this.handler=t}request(t,i,r={}){let s;if(t instanceof Rb)s=t;else{let l,c;l=r.headers instanceof mu?r.headers:new mu(r.headers),r.params&&(c=r.params instanceof Lr?r.params:new Lr({fromObject:r.params})),s=new Rb(t,i,void 0!==r.body?r.body:null,{headers:l,context:r.context,params:c,reportProgress:r.reportProgress,responseType:r.responseType||"json",withCredentials:r.withCredentials})}const o=sn(s).pipe(function(n,e){return V(n,e,1)}(l=>this.handler.handle(l)));if(t instanceof Rb||"events"===r.observe)return o;const a=o.pipe(Ki(l=>l instanceof RC));switch(r.observe||"body"){case"body":switch(s.responseType){case"arraybuffer":return a.pipe(me(l=>{if(null!==l.body&&!(l.body instanceof ArrayBuffer))throw new Error("Response is not an ArrayBuffer.");return l.body}));case"blob":return a.pipe(me(l=>{if(null!==l.body&&!(l.body instanceof Blob))throw new Error("Response is not a Blob.");return l.body}));case"text":return a.pipe(me(l=>{if(null!==l.body&&"string"!=typeof l.body)throw new Error("Response is not a string.");return l.body}));case"json":default:return a.pipe(me(l=>l.body))}case"response":return a;default:throw new Error(`Unreachable: unhandled observe type ${r.observe}}`)}}delete(t,i={}){return this.request("DELETE",t,i)}get(t,i={}){return this.request("GET",t,i)}head(t,i={}){return this.request("HEAD",t,i)}jsonp(t,i){return this.request("JSONP",t,{params:(new Lr).append(i,"JSONP_CALLBACK"),observe:"body",responseType:"json"})}options(t,i={}){return this.request("OPTIONS",t,i)}patch(t,i,r={}){return this.request("PATCH",t,LN(r,i))}post(t,i,r={}){return this.request("POST",t,LN(r,i))}put(t,i,r={}){return this.request("PUT",t,LN(r,i))}}return n.\u0275fac=function(t){return new(t||n)(Ie(fW))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();class wW{constructor(e,t){this.next=e,this.interceptor=t}handle(e){return this.interceptor.intercept(e,this.next)}}const EW=new Ht("HTTP_INTERCEPTORS");let eAe=(()=>{class n{intercept(t,i){return i.handle(t)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const tAe=/^\)\]\}',?\n/;let xW=(()=>{class n{constructor(t){this.xhrFactory=t}handle(t){if("JSONP"===t.method)throw new Error("Attempted to construct Jsonp request without HttpClientJsonpModule installed.");return new O(i=>{const r=this.xhrFactory.build();if(r.open(t.method,t.urlWithParams),t.withCredentials&&(r.withCredentials=!0),t.headers.forEach((g,m)=>r.setRequestHeader(g,m.join(","))),t.headers.has("Accept")||r.setRequestHeader("Accept","application/json, text/plain, */*"),!t.headers.has("Content-Type")){const g=t.detectContentTypeHeader();null!==g&&r.setRequestHeader("Content-Type",g)}if(t.responseType){const g=t.responseType.toLowerCase();r.responseType="json"!==g?g:"text"}const s=t.serializeBody();let o=null;const a=()=>{if(null!==o)return o;const g=1223===r.status?204:r.status,m=r.statusText||"OK",w=new mu(r.getAllResponseHeaders()),x=function(n){return"responseURL"in n&&n.responseURL?n.responseURL:/^X-Request-URL:/m.test(n.getAllResponseHeaders())?n.getResponseHeader("X-Request-URL"):null}(r)||t.url;return o=new FN({headers:w,status:g,statusText:m,url:x}),o},l=()=>{let{headers:g,status:m,statusText:w,url:x}=a(),U=null;204!==m&&(U=void 0===r.response?r.responseText:r.response),0===m&&(m=U?200:0);let D=m>=200&&m<300;if("json"===t.responseType&&"string"==typeof U){const ie=U;U=U.replace(tAe,"");try{U=""!==U?JSON.parse(U):null}catch(_e){U=ie,D&&(D=!1,U={error:_e,text:U})}}D?(i.next(new RC({body:U,headers:g,status:m,statusText:w,url:x||void 0})),i.complete()):i.error(new vW({error:U,headers:g,status:m,statusText:w,url:x||void 0}))},c=g=>{const{url:m}=a(),w=new vW({error:g,status:r.status||0,statusText:r.statusText||"Unknown Error",url:m||void 0});i.error(w)};let u=!1;const h=g=>{u||(i.next(a()),u=!0);let m={type:vs.DownloadProgress,loaded:g.loaded};g.lengthComputable&&(m.total=g.total),"text"===t.responseType&&!!r.responseText&&(m.partialText=r.responseText),i.next(m)},f=g=>{let m={type:vs.UploadProgress,loaded:g.loaded};g.lengthComputable&&(m.total=g.total),i.next(m)};return r.addEventListener("load",l),r.addEventListener("error",c),r.addEventListener("timeout",c),r.addEventListener("abort",c),t.reportProgress&&(r.addEventListener("progress",h),null!==s&&r.upload&&r.upload.addEventListener("progress",f)),r.send(s),i.next({type:vs.Sent}),()=>{r.removeEventListener("error",c),r.removeEventListener("abort",c),r.removeEventListener("load",l),r.removeEventListener("timeout",c),t.reportProgress&&(r.removeEventListener("progress",h),null!==s&&r.upload&&r.upload.removeEventListener("progress",f)),r.readyState!==r.DONE&&r.abort()}})}}return n.\u0275fac=function(t){return new(t||n)(Ie(oV))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const BN=new Ht("XSRF_COOKIE_NAME"),VN=new Ht("XSRF_HEADER_NAME");class SW{}let iAe=(()=>{class n{constructor(t,i,r){this.doc=t,this.platform=i,this.cookieName=r,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=YB(t,this.cookieName),this.lastCookieString=t),this.lastToken}}return n.\u0275fac=function(t){return new(t||n)(Ie(fn),Ie(Xc),Ie(BN))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),jN=(()=>{class n{constructor(t,i){this.tokenService=t,this.headerName=i}intercept(t,i){const r=t.url.toLowerCase();if("GET"===t.method||"HEAD"===t.method||r.startsWith("http://")||r.startsWith("https://"))return i.handle(t);const s=this.tokenService.getToken();return null!==s&&!t.headers.has(this.headerName)&&(t=t.clone({headers:t.headers.set(this.headerName,s)})),i.handle(t)}}return n.\u0275fac=function(t){return new(t||n)(Ie(SW),Ie(VN))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),rAe=(()=>{class n{constructor(t,i){this.backend=t,this.injector=i,this.chain=null}handle(t){if(null===this.chain){const i=this.injector.get(EW,[]);this.chain=i.reduceRight((r,s)=>new wW(r,s),this.backend)}return this.chain.handle(t)}}return n.\u0275fac=function(t){return new(t||n)(Ie(pW),Ie(Hn))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),sAe=(()=>{class n{static disable(){return{ngModule:n,providers:[{provide:jN,useClass:eAe}]}}static withOptions(t={}){return{ngModule:n,providers:[t.cookieName?{provide:BN,useValue:t.cookieName}:[],t.headerName?{provide:VN,useValue:t.headerName}:[]]}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=tn({type:n}),n.\u0275inj=St({providers:[jN,{provide:EW,useExisting:jN,multi:!0},{provide:SW,useClass:iAe},{provide:BN,useValue:"XSRF-TOKEN"},{provide:VN,useValue:"X-XSRF-TOKEN"}]}),n})(),CW=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=tn({type:n}),n.\u0275inj=St({providers:[_u,{provide:fW,useClass:rAe},xW,{provide:pW,useExisting:xW}],imports:[[sAe.withOptions({cookieName:"XSRF-TOKEN",headerName:"X-XSRF-TOKEN"})]]}),n})();const oAe=["*"];function TW(n){return Error(`Unable to find icon with the name "${n}"`)}function AW(n){return Error(`The URL provided to MatIconRegistry was not trusted as a resource URL via Angular's DomSanitizer. Attempted URL was "${n}".`)}function MW(n){return Error(`The literal provided to MatIconRegistry was not trusted as safe HTML by Angular's DomSanitizer. Attempted literal was "${n}".`)}class rp{constructor(e,t,i){this.url=e,this.svgText=t,this.options=i}}let PC=(()=>{class n{constructor(t,i,r,s){this._httpClient=t,this._sanitizer=i,this._errorHandler=s,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=r}addSvgIcon(t,i,r){return this.addSvgIconInNamespace("",t,i,r)}addSvgIconLiteral(t,i,r){return this.addSvgIconLiteralInNamespace("",t,i,r)}addSvgIconInNamespace(t,i,r,s){return this._addSvgIconConfig(t,i,new rp(r,null,s))}addSvgIconResolver(t){return this._resolvers.push(t),this}addSvgIconLiteralInNamespace(t,i,r,s){const o=this._sanitizer.sanitize(si.HTML,r);if(!o)throw MW(r);return this._addSvgIconConfig(t,i,new rp("",o,s))}addSvgIconSet(t,i){return this.addSvgIconSetInNamespace("",t,i)}addSvgIconSetLiteral(t,i){return this.addSvgIconSetLiteralInNamespace("",t,i)}addSvgIconSetInNamespace(t,i,r){return this._addSvgIconSetConfig(t,new rp(i,null,r))}addSvgIconSetLiteralInNamespace(t,i,r){const s=this._sanitizer.sanitize(si.HTML,i);if(!s)throw MW(i);return this._addSvgIconSetConfig(t,new rp("",s,r))}registerFontClassAlias(t,i=t){return this._fontCssClassesByAlias.set(t,i),this}classNameForFontAlias(t){return this._fontCssClassesByAlias.get(t)||t}setDefaultFontSetClass(t){return this._defaultFontSetClass=t,this}getDefaultFontSetClass(){return this._defaultFontSetClass}getSvgIconFromUrl(t){const i=this._sanitizer.sanitize(si.RESOURCE_URL,t);if(!i)throw AW(t);const r=this._cachedIconsByUrl.get(i);return r?sn(NC(r)):this._loadSvgIconFromConfig(new rp(t,null)).pipe(cr(s=>this._cachedIconsByUrl.set(i,s)),me(s=>NC(s)))}getNamedSvgIcon(t,i=""){const r=DW(i,t);let s=this._svgIconConfigs.get(r);if(s)return this._getSvgFromConfig(s);if(s=this._getIconConfigFromResolvers(i,t),s)return this._svgIconConfigs.set(r,s),this._getSvgFromConfig(s);const o=this._iconSetConfigs.get(i);return o?this._getSvgFromIconSetConfigs(t,o):Fg(TW(r))}ngOnDestroy(){this._resolvers=[],this._svgIconConfigs.clear(),this._iconSetConfigs.clear(),this._cachedIconsByUrl.clear()}_getSvgFromConfig(t){return t.svgText?sn(NC(this._svgElementFromConfig(t))):this._loadSvgIconFromConfig(t).pipe(me(i=>NC(i)))}_getSvgFromIconSetConfigs(t,i){const r=this._extractIconWithNameFromAnySet(t,i);return r?sn(r):fb(i.filter(o=>!o.svgText).map(o=>this._loadSvgIconSetFromConfig(o).pipe(bc(a=>{const c=`Loading icon set URL: ${this._sanitizer.sanitize(si.RESOURCE_URL,o.url)} failed: ${a.message}`;return this._errorHandler.handleError(new Error(c)),sn(null)})))).pipe(me(()=>{const o=this._extractIconWithNameFromAnySet(t,i);if(!o)throw TW(t);return o}))}_extractIconWithNameFromAnySet(t,i){for(let r=i.length-1;r>=0;r--){const s=i[r];if(s.svgText&&s.svgText.indexOf(t)>-1){const o=this._svgElementFromConfig(s),a=this._extractSvgIconFromSet(o,t,s.options);if(a)return a}}return null}_loadSvgIconFromConfig(t){return this._fetchIcon(t).pipe(cr(i=>t.svgText=i),me(()=>this._svgElementFromConfig(t)))}_loadSvgIconSetFromConfig(t){return t.svgText?sn(null):this._fetchIcon(t).pipe(cr(i=>t.svgText=i))}_extractSvgIconFromSet(t,i,r){const s=t.querySelector(`[id="${i}"]`);if(!s)return null;const o=s.cloneNode(!0);if(o.removeAttribute("id"),"svg"===o.nodeName.toLowerCase())return this._setSvgAttributes(o,r);if("symbol"===o.nodeName.toLowerCase())return this._setSvgAttributes(this._toSvgElement(o),r);const a=this._svgElementFromString("");return a.appendChild(o),this._setSvgAttributes(a,r)}_svgElementFromString(t){const i=this._document.createElement("DIV");i.innerHTML=t;const r=i.querySelector("svg");if(!r)throw Error(" tag not found");return r}_toSvgElement(t){const i=this._svgElementFromString(""),r=t.attributes;for(let s=0;sthis._inProgressUrlFetches.delete(a)),ws());return this._inProgressUrlFetches.set(a,c),c}_addSvgIconConfig(t,i,r){return this._svgIconConfigs.set(DW(t,i),r),this}_addSvgIconSetConfig(t,i){const r=this._iconSetConfigs.get(t);return r?r.push(i):this._iconSetConfigs.set(t,[i]),this}_svgElementFromConfig(t){if(!t.svgElement){const i=this._svgElementFromString(t.svgText);this._setSvgAttributes(i,t.options),t.svgElement=i}return t.svgElement}_getIconConfigFromResolvers(t,i){for(let r=0;re?e.pathname+e.search:""}}}),IW=["clip-path","color-profile","src","cursor","fill","filter","marker","marker-start","marker-mid","marker-end","mask","stroke"],pAe=IW.map(n=>`[${n}]`).join(", "),gAe=/^url\(['"]?#(.*?)['"]?\)$/;let Fm=(()=>{class n extends uAe{constructor(t,i,r,s,o){super(t),this._iconRegistry=i,this._location=s,this._errorHandler=o,this._inline=!1,this._currentIconFetch=C.EMPTY,r||t.nativeElement.setAttribute("aria-hidden","true")}get inline(){return this._inline}set inline(t){this._inline=bi(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 i=this._cleanupFontValue(t);i!==this._fontSet&&(this._fontSet=i,this._updateFontIconClasses())}get fontIcon(){return this._fontIcon}set fontIcon(t){const i=this._cleanupFontValue(t);i!==this._fontIcon&&(this._fontIcon=i,this._updateFontIconClasses())}_splitIconName(t){if(!t)return["",""];const i=t.split(":");switch(i.length){case 1:return["",i[0]];case 2:return i;default:throw Error(`Invalid icon name: "${t}"`)}}ngOnInit(){this._updateFontIconClasses()}ngAfterViewChecked(){const t=this._elementsWithExternalReferences;if(t&&t.size){const i=this._location.getPathname();i!==this._previousPath&&(this._previousPath=i,this._prependPathToReferences(i))}}ngOnDestroy(){this._currentIconFetch.unsubscribe(),this._elementsWithExternalReferences&&this._elementsWithExternalReferences.clear()}_usingFontIcon(){return!this.svgIcon}_setSvgElement(t){this._clearSvgElement();const i=t.querySelectorAll("style");for(let s=0;s{r.forEach(o=>{s.setAttribute(o.name,`url('${t}#${o.value}')`)})})}_cacheChildrenWithExternalReferences(t){const i=t.querySelectorAll(pAe),r=this._elementsWithExternalReferences=this._elementsWithExternalReferences||new Map;for(let s=0;s{const a=i[s],l=a.getAttribute(o),c=l?l.match(gAe):null;if(c){let u=r.get(a);u||(u=[],r.set(a,u)),u.push({name:o,value:c[1]})}})}_updateSvgIcon(t){if(this._svgNamespace=null,this._svgName=null,this._currentIconFetch.unsubscribe(),t){const[i,r]=this._splitIconName(t);i&&(this._svgNamespace=i),r&&(this._svgName=r),this._currentIconFetch=this._iconRegistry.getNamedSvgIcon(r,i).pipe(qr(1)).subscribe(s=>this._setSvgElement(s),s=>{this._errorHandler.handleError(new Error(`Error retrieving icon ${i}:${r}! ${s.message}`))})}}}return n.\u0275fac=function(t){return new(t||n)(Ce(gn),Ce(PC),yo("aria-hidden"),Ce(dAe),Ce(la))},n.\u0275cmp=rn({type:n,selectors:[["mat-icon"]],hostAttrs:["role","img",1,"mat-icon","notranslate"],hostVars:7,hostBindings:function(t,i){2&t&&(Ii("data-mat-icon-type",i._usingFontIcon()?"font":"svg")("data-mat-icon-name",i._svgName||i.fontIcon)("data-mat-icon-namespace",i._svgNamespace||i.fontSet),ai("mat-icon-inline",i.inline)("mat-icon-no-color","primary"!==i.color&&"accent"!==i.color&&"warn"!==i.color))},inputs:{color:"color",inline:"inline",svgIcon:"svgIcon",fontSet:"fontSet",fontIcon:"fontIcon"},exportAs:["matIcon"],features:[En],ngContentSelectors:oAe,decls:1,vars:0,template:function(t,i){1&t&&(Hr(),oi(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}),n})();function TAe(n,e){}class zN{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 AAe={dialogContainer:Em("dialogContainer",[wc("void, exit",ds({opacity:0,transform:"scale(0.7)"})),wc("enter",ds({transform:"none"})),pd("* => enter",fd("150ms cubic-bezier(0, 0, 0.2, 1)",ds({transform:"none",opacity:1}))),pd("* => void, * => exit",fd("75ms cubic-bezier(0.4, 0.0, 0.2, 1)",ds({opacity:0})))])};let MAe=(()=>{class n extends MC{constructor(t,i,r,s,o,a){super(),this._elementRef=t,this._focusTrapFactory=i,this._changeDetectorRef=r,this._config=o,this._focusMonitor=a,this._animationStateChanged=new ln,this._elementFocusedBeforeDialogWasOpened=null,this._closeInteractionType=null,this.attachDomPortal=l=>(this._portalOutlet.hasAttached(),this._portalOutlet.attachDomPortal(l)),this._ariaLabelledBy=o.ariaLabelledBy||null,this._document=s}_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 i=KS(),r=this._elementRef.nativeElement;(!i||i===this._document.body||i===r||r.contains(i))&&(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=KS())}_focusDialogContainer(){this._elementRef.nativeElement.focus&&this._elementRef.nativeElement.focus()}_containsFocus(){const t=this._elementRef.nativeElement,i=KS();return t===i||t.contains(i)}}return n.\u0275fac=function(t){return new(t||n)(Ce(gn),Ce(Y6),Ce(Mr),Ce(fn,8),Ce(zN),Ce(vc))},n.\u0275dir=Nt({type:n,viewQuery:function(t,i){if(1&t&&hr(np,7),2&t){let r;Gn(r=$n())&&(i._portalOutlet=r.first)}},features:[En]}),n})(),DAe=(()=>{class n extends MAe{constructor(){super(...arguments),this._state="enter"}_onAnimationDone({toState:t,totalTime:i}){"enter"===t?(this._trapFocus(),this._animationStateChanged.next({state:"opened",totalTime:i})):"exit"===t&&(this._restoreFocus(),this._animationStateChanged.next({state:"closed",totalTime:i}))}_onAnimationStart({toState:t,totalTime:i}){"enter"===t?this._animationStateChanged.next({state:"opening",totalTime:i}):("exit"===t||"void"===t)&&this._animationStateChanged.next({state:"closing",totalTime:i})}_startExitAnimation(){this._state="exit",this._changeDetectorRef.markForCheck()}}return n.\u0275fac=function(){let e;return function(i){return(e||(e=zi(n)))(i||n)}}(),n.\u0275cmp=rn({type:n,selectors:[["mat-dialog-container"]],hostAttrs:["tabindex","-1","aria-modal","true",1,"mat-dialog-container"],hostVars:6,hostBindings:function(t,i){1&t&&uE("@dialogContainer.start",function(s){return i._onAnimationStart(s)})("@dialogContainer.done",function(s){return i._onAnimationDone(s)}),2&t&&(qc("id",i._id),Ii("role",i._config.role)("aria-labelledby",i._config.ariaLabel?null:i._ariaLabelledBy)("aria-label",i._config.ariaLabel)("aria-describedby",i._config.ariaDescribedBy||null),fE("@dialogContainer",i._state))},features:[En],decls:1,vars:0,consts:[["cdkPortalOutlet",""]],template:function(t,i){1&t&&wi(0,TAe,0,0,"ng-template",0)},directives:[np],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:[AAe.dialogContainer]}}),n})(),IAe=0;class kC{constructor(e,t,i="mat-dialog-"+IAe++){this._overlayRef=e,this._containerInstance=t,this.id=i,this.disableClose=this._containerInstance._config.disableClose,this._afterOpened=new oe,this._afterClosed=new oe,this._beforeClosed=new oe,this._state=0,t._id=i,t._animationStateChanged.pipe(Ki(r=>"opened"===r.state),qr(1)).subscribe(()=>{this._afterOpened.next(),this._afterOpened.complete()}),t._animationStateChanged.pipe(Ki(r=>"closed"===r.state),qr(1)).subscribe(()=>{clearTimeout(this._closeFallbackTimeout),this._finishDialogClose()}),e.detachments().subscribe(()=>{this._beforeClosed.next(this._result),this._beforeClosed.complete(),this._afterClosed.next(this._result),this._afterClosed.complete(),this.componentInstance=null,this._overlayRef.dispose()}),e.keydownEvents().pipe(Ki(r=>27===r.keyCode&&!this.disableClose&&!Dl(r))).subscribe(r=>{r.preventDefault(),HN(this,"keyboard")}),e.backdropClick().subscribe(()=>{this.disableClose?this._containerInstance._recaptureFocus():HN(this,"mouse")})}close(e){this._result=e,this._containerInstance._animationStateChanged.pipe(Ki(t=>"closing"===t.state),qr(1)).subscribe(t=>{this._beforeClosed.next(e),this._beforeClosed.complete(),this._overlayRef.detachBackdrop(),this._closeFallbackTimeout=setTimeout(()=>this._finishDialogClose(),t.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(e){let 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}updateSize(e="",t=""){return this._overlayRef.updateSize({width:e,height:t}),this._overlayRef.updatePosition(),this}addPanelClass(e){return this._overlayRef.addPanelClass(e),this}removePanelClass(e){return this._overlayRef.removePanelClass(e),this}getState(){return this._state}_finishDialogClose(){this._state=2,this._overlayRef.dispose()}_getPositionStrategy(){return this._overlayRef.getConfig().positionStrategy}}function HN(n,e,t){return void 0!==n._containerInstance&&(n._containerInstance._closeInteractionType=e),n.close(t)}const PW=new Ht("MatDialogData"),OAe=new Ht("mat-dialog-default-options"),NW=new Ht("mat-dialog-scroll-strategy");let NAe=(()=>{class n{constructor(t,i,r,s,o,a,l,c,u){this._overlay=t,this._injector=i,this._defaultOptions=r,this._parentDialog=s,this._overlayContainer=o,this._dialogRefConstructor=l,this._dialogContainerType=c,this._dialogDataToken=u,this._openDialogsAtThisLevel=[],this._afterAllClosedAtThisLevel=new oe,this._afterOpenedAtThisLevel=new oe,this._ariaHiddenElements=new Map,this.afterAllClosed=function(n){return new O(e=>{let t;try{t=n()}catch(r){return void e.error(r)}return(t?je(t):b0()).subscribe(e)})}(()=>this.openDialogs.length?this._getAfterAllClosed():this._getAfterAllClosed().pipe(Oo(void 0))),this._scrollStrategy=a}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,i){(i=function(n,e){return Object.assign(Object.assign({},e),n)}(i,this._defaultOptions||new zN)).id&&this.getDialogById(i.id);const r=this._createOverlay(i),s=this._attachDialogContainer(r,i),o=this._attachDialogContent(t,s,r,i);return this.openDialogs.length||this._hideNonDialogContentFromAssistiveTechnology(),this.openDialogs.push(o),o.afterClosed().subscribe(()=>this._removeOpenDialog(o)),this.afterOpened.next(o),s._initializeWithAttachedContent(),o}closeAll(){this._closeDialogs(this.openDialogs)}getDialogById(t){return this.openDialogs.find(i=>i.id===t)}ngOnDestroy(){this._closeDialogs(this._openDialogsAtThisLevel),this._afterAllClosedAtThisLevel.complete(),this._afterOpenedAtThisLevel.complete()}_createOverlay(t){const i=this._getOverlayConfig(t);return this._overlay.create(i)}_getOverlayConfig(t){const i=new IC({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&&(i.backdropClass=t.backdropClass),i}_attachDialogContainer(t,i){const s=Hn.create({parent:i&&i.viewContainerRef&&i.viewContainerRef.injector||this._injector,providers:[{provide:zN,useValue:i}]}),o=new AC(this._dialogContainerType,i.viewContainerRef,s,i.componentFactoryResolver);return t.attach(o).instance}_attachDialogContent(t,i,r,s){const o=new this._dialogRefConstructor(r,i,s.id);if(t instanceof Go)i.attachTemplatePortal(new Pm(t,null,{$implicit:s.data,dialogRef:o}));else{const a=this._createInjector(s,o,i),l=i.attachComponentPortal(new AC(t,s.viewContainerRef,a));o.componentInstance=l.instance}return o.updateSize(s.width,s.height).updatePosition(s.position),o}_createInjector(t,i,r){const s=t&&t.viewContainerRef&&t.viewContainerRef.injector,o=[{provide:this._dialogContainerType,useValue:r},{provide:this._dialogDataToken,useValue:t.data},{provide:this._dialogRefConstructor,useValue:i}];return t.direction&&(!s||!s.get(Il,null,xn.Optional))&&o.push({provide:Il,useValue:{value:t.direction,change:sn()}}),Hn.create({parent:s||this._injector,providers:o})}_removeOpenDialog(t){const i=this.openDialogs.indexOf(t);i>-1&&(this.openDialogs.splice(i,1),this.openDialogs.length||(this._ariaHiddenElements.forEach((r,s)=>{r?s.setAttribute("aria-hidden",r):s.removeAttribute("aria-hidden")}),this._ariaHiddenElements.clear(),this._getAfterAllClosed().next()))}_hideNonDialogContentFromAssistiveTechnology(){const t=this._overlayContainer.getContainerElement();if(t.parentElement){const i=t.parentElement.children;for(let r=i.length-1;r>-1;r--){let s=i[r];s!==t&&"SCRIPT"!==s.nodeName&&"STYLE"!==s.nodeName&&!s.hasAttribute("aria-live")&&(this._ariaHiddenElements.set(s,s.getAttribute("aria-hidden")),s.setAttribute("aria-hidden","true"))}}}_closeDialogs(t){let i=t.length;for(;i--;)t[i].close()}}return n.\u0275fac=function(t){return new(t||n)(Ce(Ec),Ce(Hn),Ce(void 0),Ce(void 0),Ce(Ob),Ce(void 0),Ce(Du),Ce(Du),Ce(Ht))},n.\u0275dir=Nt({type:n}),n})(),Nb=(()=>{class n extends NAe{constructor(t,i,r,s,o,a,l){super(t,i,s,a,l,o,kC,DAe,PW)}}return n.\u0275fac=function(t){return new(t||n)(Ie(Ec),Ie(Hn),Ie(kg,8),Ie(OAe,8),Ie(NW),Ie(n,12),Ie(Ob))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),FAe=0,kW=(()=>{class n{constructor(t,i,r){this._dialogRef=t,this._elementRef=i,this._dialog=r,this.id="mat-dialog-title-"+FAe++}ngOnInit(){this._dialogRef||(this._dialogRef=function(n,e){let t=n.nativeElement.parentElement;for(;t&&!t.classList.contains("mat-dialog-container");)t=t.parentElement;return t?e.find(i=>i.id===t.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 n.\u0275fac=function(t){return new(t||n)(Ce(kC,8),Ce(gn),Ce(Nb))},n.\u0275dir=Nt({type:n,selectors:[["","mat-dialog-title",""],["","matDialogTitle",""]],hostAttrs:[1,"mat-dialog-title"],hostVars:1,hostBindings:function(t,i){2&t&&qc("id",i.id)},inputs:{id:"id"},exportAs:["matDialogTitle"]}),n})(),FW=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275dir=Nt({type:n,selectors:[["","mat-dialog-content",""],["mat-dialog-content"],["","matDialogContent",""]],hostAttrs:[1,"mat-dialog-content"]}),n})();const $N=new Ht("CdkAccordion");let VAe=0,UAe=(()=>{class n{constructor(t,i,r){this.accordion=t,this._changeDetectorRef=i,this._expansionDispatcher=r,this._openCloseAllSubscription=C.EMPTY,this.closed=new ln,this.opened=new ln,this.destroyed=new ln,this.expandedChange=new ln,this.id="cdk-accordion-child-"+VAe++,this._expanded=!1,this._disabled=!1,this._removeUniqueSelectionListener=()=>{},this._removeUniqueSelectionListener=r.listen((s,o)=>{this.accordion&&!this.accordion.multi&&this.accordion.id===o&&this.id!==s&&(this.expanded=!1)}),this.accordion&&(this._openCloseAllSubscription=this._subscribeToOpenCloseAllActions())}get expanded(){return this._expanded}set expanded(t){t=bi(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=bi(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 n.\u0275fac=function(t){return new(t||n)(Ce($N,12),Ce(Mr),Ce(A$))},n.\u0275dir=Nt({type:n,selectors:[["cdk-accordion-item"],["","cdkAccordionItem",""]],inputs:{expanded:"expanded",disabled:"disabled"},outputs:{closed:"closed",opened:"opened",destroyed:"destroyed",expandedChange:"expandedChange"},exportAs:["cdkAccordionItem"],features:[Vn([{provide:$N,useValue:void 0}])]}),n})();const HAe=["body"];function GAe(n,e){}const $Ae=[[["mat-expansion-panel-header"]],"*",[["mat-action-row"]]],WAe=["mat-expansion-panel-header","*","mat-action-row"];function qAe(n,e){1&n&&ni(0,"span",2),2&n&&Jt("@indicatorRotate",_i()._getExpandedState())}const YAe=[[["mat-panel-title"]],[["mat-panel-description"]],"*"],XAe=["mat-panel-title","mat-panel-description","*"],WN=new Ht("MAT_ACCORDION"),BW="225ms cubic-bezier(0.4,0.0,0.2,1)",VW={indicatorRotate:Em("indicatorRotate",[wc("collapsed, void",ds({transform:"rotate(0deg)"})),wc("expanded",ds({transform:"rotate(180deg)"})),pd("expanded <=> collapsed, void => collapsed",fd(BW))]),bodyExpansion:Em("bodyExpansion",[wc("collapsed, void",ds({height:"0px",visibility:"hidden"})),wc("expanded",ds({height:"*",visibility:"visible"})),pd("expanded <=> collapsed, void => collapsed",fd(BW))])};let KAe=(()=>{class n{constructor(t){this._template=t}}return n.\u0275fac=function(t){return new(t||n)(Ce(Go))},n.\u0275dir=Nt({type:n,selectors:[["ng-template","matExpansionPanelContent",""]]}),n})(),QAe=0;const jW=new Ht("MAT_EXPANSION_PANEL_DEFAULT_OPTIONS");let UW=(()=>{class n extends UAe{constructor(t,i,r,s,o,a,l){super(t,i,r),this._viewContainerRef=s,this._animationMode=a,this._hideToggle=!1,this.afterExpand=new ln,this.afterCollapse=new ln,this._inputChanges=new oe,this._headerId="mat-expansion-panel-header-"+QAe++,this._bodyAnimationDone=new oe,this.accordion=t,this._document=o,this._bodyAnimationDone.pipe(ld((c,u)=>c.fromState===u.fromState&&c.toState===u.toState)).subscribe(c=>{"void"!==c.fromState&&("expanded"===c.toState?this.afterExpand.emit():"collapsed"===c.toState&&this.afterCollapse.emit())}),l&&(this.hideToggle=l.hideToggle)}get hideToggle(){return this._hideToggle||this.accordion&&this.accordion.hideToggle}set hideToggle(t){this._hideToggle=bi(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(Oo(null),Ki(()=>this.expanded&&!this._portal),qr(1)).subscribe(()=>{this._portal=new Pm(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,i=this._body.nativeElement;return t===i||i.contains(t)}return!1}}return n.\u0275fac=function(t){return new(t||n)(Ce(WN,12),Ce(Mr),Ce(A$),Ce(Rs),Ce(fn),Ce(Qa,8),Ce(jW,8))},n.\u0275cmp=rn({type:n,selectors:[["mat-expansion-panel"]],contentQueries:function(t,i,r){if(1&t&&function(n,e,t,i){const r=Si();if(r.firstCreatePass){const s=as();I3(r,new A3(e,t,i),s.index),function(n,e){const t=n.contentQueries||(n.contentQueries=[]);e!==(t.length?t[t.length-1]:-1)&&t.push(n.queries.length-1,e)}(r,n),2==(2&t)&&(r.staticContentQueries=!0)}D3(r,Vt(),t)}(r,KAe,5),2&t){let s;Gn(s=$n())&&(i._lazyContent=s.first)}},viewQuery:function(t,i){if(1&t&&hr(HAe,5),2&t){let r;Gn(r=$n())&&(i._body=r.first)}},hostAttrs:[1,"mat-expansion-panel"],hostVars:6,hostBindings:function(t,i){2&t&&ai("mat-expanded",i.expanded)("_mat-animation-noopable","NoopAnimations"===i._animationMode)("mat-expansion-panel-spacing",i._hasSpacing())},inputs:{disabled:"disabled",expanded:"expanded",hideToggle:"hideToggle",togglePosition:"togglePosition"},outputs:{opened:"opened",closed:"closed",expandedChange:"expandedChange",afterExpand:"afterExpand",afterCollapse:"afterCollapse"},exportAs:["matExpansionPanel"],features:[Vn([{provide:WN,useValue:void 0}]),En,Fi],ngContentSelectors:WAe,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,i){1&t&&(Hr($Ae),oi(0),wt(1,"div",0,1),Tn("@bodyExpansion.done",function(s){return i._bodyAnimationDone.next(s)}),wt(3,"div",2),oi(4,1),wi(5,GAe,0,0,"ng-template",3),Et(),oi(6,2),Et()),2&t&&(zt(1),Jt("@bodyExpansion",i._getExpandedState())("id",i.id),Ii("aria-labelledby",i._headerId),zt(4),Jt("cdkPortalOutlet",i._portal))},directives:[np],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:[VW.bodyExpansion]},changeDetection:0}),n})();class JAe{}const eMe=wC(JAe);let zW=(()=>{class n extends eMe{constructor(t,i,r,s,o,a,l){super(),this.panel=t,this._element=i,this._focusMonitor=r,this._changeDetectorRef=s,this._animationMode=a,this._parentChangeSubscription=C.EMPTY;const c=t.accordion?t.accordion._stateChanges.pipe(Ki(u=>!(!u.hideToggle&&!u.togglePosition))):Qc;this.tabIndex=parseInt(l||"")||0,this._parentChangeSubscription=Nn(t.opened,t.closed,c,t._inputChanges.pipe(Ki(u=>!!(u.hideToggle||u.disabled||u.togglePosition)))).subscribe(()=>this._changeDetectorRef.markForCheck()),t.closed.pipe(Ki(()=>t._containsFocus())).subscribe(()=>r.focusVia(i,"program")),o&&(this.expandedHeight=o.expandedHeight,this.collapsedHeight=o.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:Dl(t)||(t.preventDefault(),this._toggle());break;default:return void(this.panel.accordion&&this.panel.accordion._handleHeaderKeydown(t))}}focus(t,i){t?this._focusMonitor.focusVia(this._element,t,i):this._element.nativeElement.focus(i)}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 n.\u0275fac=function(t){return new(t||n)(Ce(UW,1),Ce(gn),Ce(vc),Ce(Mr),Ce(jW,8),Ce(Qa,8),yo("tabindex"))},n.\u0275cmp=rn({type:n,selectors:[["mat-expansion-panel-header"]],hostAttrs:["role","button",1,"mat-expansion-panel-header","mat-focus-indicator"],hostVars:15,hostBindings:function(t,i){1&t&&Tn("click",function(){return i._toggle()})("keydown",function(s){return i._keydown(s)}),2&t&&(Ii("id",i.panel._headerId)("tabindex",i.tabIndex)("aria-controls",i._getPanelId())("aria-expanded",i._isExpanded())("aria-disabled",i.panel.disabled),zy("height",i._getHeaderHeight()),ai("mat-expanded",i._isExpanded())("mat-expansion-toggle-indicator-after","after"===i._getTogglePosition())("mat-expansion-toggle-indicator-before","before"===i._getTogglePosition())("_mat-animation-noopable","NoopAnimations"===i._animationMode))},inputs:{tabIndex:"tabIndex",expandedHeight:"expandedHeight",collapsedHeight:"collapsedHeight"},features:[En],ngContentSelectors:XAe,decls:5,vars:1,consts:[[1,"mat-content"],["class","mat-expansion-indicator",4,"ngIf"],[1,"mat-expansion-indicator"]],template:function(t,i){1&t&&(Hr(YAe),wt(0,"span",0),oi(1),oi(2,1),oi(3,2),Et(),wi(4,qAe,1,1,"span",1)),2&t&&(zt(4),Jt("ngIf",i._showToggle()))},directives:[ac],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:[VW.indicatorRotate]},changeDetection:0}),n})();var HW=et(5478);Object.create(Error.prototype);const sMe=["*"];var LC=(()=>(function(n){n.LineHighlight="line-highlight",n.LineNumbers="line-numbers"}(LC||(LC={})),LC))();class aMe{}const $W=new Ht("SECURITY_CONTEXT");let qN=(()=>{class n{constructor(t,i,r,s,o){this.platform=t,this.securityContext=i,this.http=r,this.sanitizer=o,this.initialMarkedOptions={renderer:new HW.Renderer},this.options=s}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,i=!1,r=!1,s=this.options){const o=this.trimIndentation(t),a=i?this.decodeHtml(o):o,l=r?this.renderEmoji(a):a,c=HW.parse(l,s);return this.sanitizer.sanitize(this.securityContext,c)||""}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(me(i=>this.handleExtension(t,i)))}highlight(t){if(Af(this.platform)&&"undefined"!=typeof Prism){t||(t=document);const i=t.querySelectorAll('pre code:not([class*="language-"])');Array.prototype.forEach.call(i,r=>r.classList.add("language-none")),Prism.highlightAllUnder(t)}}renderKatex(t,i){if(!Af(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,(r,s)=>katex.renderToString(s,i))}decodeHtml(t){if(!Af(this.platform))return t;const i=document.createElement("textarea");return i.innerHTML=t,i.value}handleExtension(t,i){const r=t?t.split("?")[0].split(".").splice(-1).join():"";return"md"!==r?"```"+r+"\n"+i+"\n```":i}renderEmoji(t){if(!Af(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 i;return t.split("\n").map(r=>{let s=i;return r.length>0&&(s=isNaN(s)?r.search(/\S|$/):Math.min(r.search(/\S|$/),s)),isNaN(i)&&(i=s),s?r.substring(s):r}).join("\n")}}return n.\u0275fac=function(t){return new(t||n)(Ie(Xc),Ie($W),Ie(_u,8),Ie(aMe,8),Ie(Mf))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),WW=(()=>{class n{constructor(t,i){this.element=t,this.markdownService=i,this.error=new ln,this.load=new ln,this.ready=new ln,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,i=!1){let r=this.markdownService.compile(t,i,this.emoji);r=this.katex?this.markdownService.renderKatex(r,this.katexOptions):r,this.element.nativeElement.innerHTML=r,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,LC.LineNumbers),this.setPluginOptions(this.element.nativeElement,{dataStart:this.start}))}setPluginClass(t,i){const r=t.querySelectorAll("pre");for(let s=0;s{const a=i[o];if(a){const l=this.toLispCase(o);r.item(s).setAttribute(l,a.toString())}})}toLispCase(t){const i=t.match(/([A-Z])/g);if(!i)return t;let r=t.toString();for(let s=0,o=i.length;sk(i)?t(...i):t(i))):new O(i=>{const r=(...o)=>i.next(1===o.length?o[0]:o);let s;try{s=n(r)}catch(o){return void i.error(o)}if(Y(e))return()=>e(r,s)})}function YN(...n){return e=>{let t;return"function"==typeof n[n.length-1]&&(t=n.pop()),e.lift(new pMe(n,t))}}class pMe{constructor(e,t){this.observables=e,this.project=t}call(e,t){return t.subscribe(new gMe(e,this.observables,this.project))}}class gMe extends t5{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)}}class mMe{constructor(e,t,i=!1){this.accumulator=e,this.seed=t,this.hasSeed=i}call(e,t){return t.subscribe(new _Me(e,this.accumulator,this.seed,this.hasSeed))}}class _Me extends y{constructor(e,t,i,r){super(e),this.accumulator=t,this._seed=i,this.hasSeed=r,this.index=0}get seed(){return this._seed}set seed(e){this.hasSeed=!0,this._seed=e}_next(e){if(this.hasSeed)return this._tryNext(e);this.seed=e,this.destination.next(e)}_tryNext(e){const t=this.index++;let i;try{i=this.accumulator(this.seed,e,t)}catch(r){this.destination.error(r)}this.seed=i,this.destination.next(i)}}class vMe{constructor(e){this.predicate=e}call(e,t){return t.subscribe(new wMe(e,this.predicate))}}class wMe extends y{constructor(e,t){super(e),this.predicate=t,this.skipping=!0,this.index=0}_next(e){const t=this.destination;this.skipping&&this.tryCallPredicate(e),this.skipping||t.next(e)}tryCallPredicate(e){try{const t=this.predicate(e,this.index++);this.skipping=Boolean(t)}catch(t){this.destination.error(t)}}}const EMe=["youtubeContainer"];let KW=(()=>{class n{constructor(t,i){this._ngZone=t,this._youtubeContainer=new oe,this._destroyed=new oe,this._playerChanges=new Fr(void 0),this._videoId=new Fr(void 0),this._height=new Fr(390),this._width=new Fr(640),this._startSeconds=new Fr(void 0),this._endSeconds=new Fr(void 0),this._suggestedQuality=new Fr(void 0),this._playerVars=new Fr(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=Af(i)}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=sn(!0);if(!window.YT||!window.YT.Player){const r=new oe;this._existingApiReadyCallback=window.onYouTubeIframeAPIReady,window.onYouTubeIframeAPIReady=()=>{this._existingApiReadyCallback&&this._existingApiReadyCallback(),this._ngZone.run(()=>r.next(!0))},t=r.pipe(qr(1),Oo(!1))}const i=function(n,e,t,i,r,s,o){const a=yc([e,s]).pipe(YN(yc([i,r])),me(([l,c])=>{const[u,h]=l,[f,g]=c;return u?{videoId:u,playerVars:h,width:f,height:g}:void 0}));return yc([n,a,sn(o)]).pipe(function(n){return ue(function(...n){let e=null;return"function"==typeof n[n.length-1]&&(e=n.pop()),1===n.length&&k(n[0])&&(n=n[0].slice()),t=>t.lift.call(je([t,...n]),new r5(e))}(n),function(n){return e=>e.lift(new vMe(n))}(([e,t])=>!t),me(([e])=>e))}(t),function(n,e){let t=!1;return arguments.length>=2&&(t=!0),function(r){return r.lift(new mMe(n,e,t))}}(MMe,void 0),ld())}(this._youtubeContainer,this._videoId,t,this._width,this._height,this._playerVars,this._ngZone).pipe(cr(r=>{this._playerChanges.next(r)}),V(e=>e?QW(e)?sn(e):new O(t=>{let i=!1,r=!1;const s=o=>{r=!0,i||(o.target.removeEventListener("onReady",s),t.next(o.target))};return e.addEventListener("onReady",s),()=>{i=!0,r||(r=>{QW(r)||r.destroy()})(e)}}).pipe(qr(1),Oo(void 0)):sn(void 0)),gr(this._destroyed),xa(new oe));i.subscribe(r=>{this._player=r,r&&this._pendingPlayerState&&this._initializePlayer(r,this._pendingPlayerState),this._pendingPlayerState=void 0}),function(n,e,t){yc([n,e,t]).subscribe(([i,r,s])=>i&&i.setSize(r,s))}(i,this._width,this._height),function(n,e){yc([n,e]).subscribe(([t,i])=>t&&i&&t.setPlaybackQuality(i))}(i,this._suggestedQuality),function(n,e,t,i,r,s){const o=yc([t,i]).pipe(me(([u,h])=>({startSeconds:u,endSeconds:h}))),a=o.pipe(KN(n,u=>!!u&&!function(n){const e=n.getPlayerState();return e!==YT.PlayerState.UNSTARTED&&e!==YT.PlayerState.CUED}(u))),l=e.pipe(KN(n,(u,h)=>!!u&&u.videoId!==h));Nn(n.pipe(KN(yc([e,o]),([u,h],f)=>!(!f||u==f.videoId&&!h.startSeconds&&!h.endSeconds))),l,a).pipe(YN(yc([n,e,o,r])),me(([u,h])=>h),gr(s)).subscribe(([u,h,f,g])=>{!h||!u||(u.videoId=h,u.cueVideoById(Object.assign({videoId:h,suggestedQuality:g},f)))})}(i,this._videoId,this._startSeconds,this._endSeconds,this._suggestedQuality,this._destroyed),i.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,i){this._player?this._player.seekTo(t,i):this._getPendingState().seek={seconds:t,allowSeekAhead:i}}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,i){const{playbackState:r,playbackRate:s,volume:o,muted:a,seek:l}=i;switch(r){case YT.PlayerState.PLAYING:t.playVideo();break;case YT.PlayerState.PAUSED:t.pauseVideo();break;case YT.PlayerState.CUED:t.stopVideo()}null!=s&&t.setPlaybackRate(s),null!=o&&t.setVolume(o),null!=a&&(a?t.mute():t.unMute()),null!=l&&t.seekTo(l.seconds,l.allowSeekAhead)}_getLazyEmitter(t){return this._playerChanges.pipe(is(i=>i?qW(r=>{i.addEventListener(t,r)},r=>{try{i.removeEventListener&&i.removeEventListener(t,r)}catch(s){}}):sn()),i=>new O(r=>i.subscribe({next:s=>this._ngZone.run(()=>r.next(s)),error:s=>r.error(s),complete:()=>r.complete()})),gr(this._destroyed))}}return n.\u0275fac=function(t){return new(t||n)(Ce(pn),Ce(Xc))},n.\u0275cmp=rn({type:n,selectors:[["youtube-player"]],viewQuery:function(t,i){if(1&t&&hr(EMe,5),2&t){let r;Gn(r=$n())&&(i.youtubeContainer=r.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,i){1&t&&ni(0,"div",null,0)},encapsulation:2,changeDetection:0}),n})();function MMe(n,[e,t,i]){if(n&&t&&n.playerVars!==t.playerVars)n.destroy();else{if(!t)return void(n&&n.destroy());if(n)return n}const r=i.runOutsideAngular(()=>new YT.Player(e,t));return r.videoId=t.videoId,r.playerVars=t.playerVars,r}function QW(n){return"getPlayerStatus"in n}function KN(n,e){return ue(YN(n),Ki(([t,i])=>e(i,t)),me(([t])=>t))}let BMe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275dir=Nt({type:n,selectors:[["","mat-card-sm-image",""],["","matCardImageSmall",""]],hostAttrs:[1,"mat-card-sm-image"]}),n})();function Fb(n){return!0===n}function Za(n){return null==n}function Ja(n){return!Za(n)}function QN(n){return Boolean(n)}function t7(n){return Za(n)?n:JSON.parse(JSON.stringify(n))}const VC=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])&&VC(n[o])}),n};function n7(n){return Ja(n)&&"object"==typeof n&&function(n){return"[object Object]"===Object.prototype.toString.call(n)}(n)}const s7="NGXS_DATA_META",JN="NGXS_META",o7="NGXS_ARGUMENT_REGISTRY_META";let a7=(()=>{class n{constructor(t){this.sequence$=new Fr(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(hu,8))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();function Lb(n){return n[s7]}let el=(()=>{class n{constructor(t,i,r){n.store=t.get(hu),n.ngZone=t.get(pn),n.factory=i,n.context=r,n.computed=t.get(a7)}}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(o5),Ie(s5))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();class hs{constructor(){hs.statesCachedMeta.clear()}static createStateContext(e){return el.context.createStateContext(e)}static ensureMappedState(e){if(Za(el.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(Ja(e.name)?hs.statesCachedMeta.get(e.name):null)||hs.ensureMeta(e)}static getRepositoryByInstance(e){var t;const r=null!==(t=Lb(hs.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=hs.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=hs.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=Ja(e.name)?null===(t=el.factory.states)||void 0===t?void 0:t.find(r=>r.name===e.name):null;return Ja(i)&&Ja(e.name)&&hs.statesCachedMeta.set(e.name,i),i}}hs.statesCachedMeta=new Map,hs.\u0275fac=function(e){return new(e||hs)},hs.\u0275prov=We({token:hs,factory:hs.\u0275fac}),new Df(1);class sDe extends Error{constructor(e){super(`Child states can only be added to an object. Cannot convert ${Ja(null==e?void 0:e.constructor)?e.constructor.name:e} to PlainObject`)}}function l7(n){var e;return null!==(e=n.NGXS_OPTIONS_META)&&void 0!==e?e:{name:""}}function c7(n){var e;const t=l7(n),i=null!==(e=t.children)&&void 0!==e?e:[],s=t7(void 0===t.defaults?{}:t.defaults);if(i.length){if(n7(s))return function(n,e){return e.reduce((t,i)=>{const r=l7(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()]=c7(i),t},null!=n?n:{})}(s,i);throw new sDe(s)}return s}function d7(n){var e;return null!==(e=n.__NGXS_COMPUTED_OPTION__)&&void 0!==e?e:null}function h7(){var n,e;return null!==(e=null===(n=null==el?void 0:el.computed)||void 0===n?void 0:n.sequenceValue)&&void 0!==e?e:0}function cDe(n){let e=!1;return Im(n)&&(e=!0),e}function ek(n){return n[o7]}class uDe extends Error{constructor(e,t){super(`An argument with the name '${e}' already exists in the method '${t}'`)}}class dDe{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(QN(this.argumentMap.has(e))||QN(this.payloadMap.has(e)))throw new uDe(e,t)}}function _De(n){return{enumerable:!0,configurable:!0,get(){const e=Lb(n),t=hs.ensureMappedState(e.stateMeta);return hs.createStateContext(t)}}}function f7(){return(n,e,t)=>{!function(n,e){if(!function(n,e){var t;let i=n,r=!1;if(n7(i))for(;null!==i;){if(Fb(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(d7(n))&&Object.defineProperties(n,{__NGXS_COMPUTED_OPTION__:{enumerable:!0,configurable:!0,value:new WeakMap}}),d7(n)}(this),o=null==s?void 0:s.get(i);if(Fb(null==o?void 0:o.isObservable))return null==o?void 0:o.value;if(Za(o)||o.sequenceId!==h7()){s.delete(i);const l=i.apply(this,r);return s.set(i,{value:l,sequenceId:h7(),isObservable:cDe(l)}),l}return o.value},t}}const xDe={cancelUncompleted:!0,insideZone:!1};function tk(n=xDe){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=hs.getRepositoryByInstance(a),u=c.operations;let h=u[s];const f=c.stateMeta,g=ek(r);if(Za(h)){const D=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),ie=function(n){const{statePath:e,argumentsNames:t,methodName:i,argumentRegistry:r}=n;let s="";for(let o=0;o{var D;return Fb(n.insideZone)?null===(D=el.ngZone)||void 0===D||D.run(()=>{l=r.apply(a,o)}):l=r.apply(a,o),Im(l)?sn(null).pipe(me(()=>l)):l};const x=hs.createAction(h,o,g),U=el.store.dispatch(x);return Im(l)?function(n,e){return fb([n,e]).pipe(me(t=>t.pop()))}(U,l):l},i}}function p7(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(ek(t))&&Object.defineProperties(t,{[o7]:{enumerable:!0,configurable:!0,value:new dDe}}),ek(t)})(e,t).createPayloadType(r,t,i)}}function CDe(){return n=>{const e=function(n){if(function(n){return!QN(n)}(n.hasOwnProperty(JN))){const e={name:null,actions:{},defaults:{},path:null,makeRootSelector:t=>t.getStateGetter(e.name),children:[]};Object.defineProperty(n,JN,{value:e})}return function(n){var e;return null===(e=n)||void 0===e?void 0:e[JN]}(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=Lb(n))&&void 0!==e?e:null;return(Za(t)||(null==t?void 0:t.stateClass)!==n)&&function(n){Object.defineProperty(n,s7,{writable:!0,configurable:!0,enumerable:!0,value:{stateMeta:null,operations:{},stateClass:n}})}(n),Lb(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:()=>t7(t)},context:_De(n)})}(n,e,c7(n)),function(n){var e,t;const i=Lb(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(Ja(r)){const s=`__${r}__selector`;Object.defineProperties(n.prototype,{[s]:{writable:!0,enumerable:!1,configurable:!0},state$:{enumerable:!0,configurable:!0,get(){if(Ja(this[s]))return this[s];if(Za(el.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]=el.store.select(n).pipe(me(o=>fa()?VC(o):o),Wa({refCount:!0,bufferSize:1})),this[s]}}})}}(n)}}let ADe=(()=>{class n{constructor(){this.browserStorageEvents$=new oe,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})(),MDe=(()=>{class n extends ADe{get snapshot(){return function(n){return fa()?VC(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:()=>fa()?VC(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=zi(n)))(i||n)}}(),n.\u0275prov=We({token:n,factory:n.\u0275fac}),Ei([f7(),uc("design:type",Object),uc("design:paramtypes",[])],n.prototype,"snapshot",null),Ei([tk(),wV(0,p7("patchValue")),uc("design:type",Function),uc("design:paramtypes",[Object]),uc("design:returntype",void 0)],n.prototype,"patchState",null),Ei([tk(),wV(0,p7("stateValue")),uc("design:type",Function),uc("design:paramtypes",[Object]),uc("design:returntype",void 0)],n.prototype,"setState",null),Ei([tk(),uc("design:type",Function),uc("design:paramtypes",[]),uc("design:returntype",void 0)],n.prototype,"reset",null),n})(),g9=(()=>{class n{constructor(){}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275dir=Nt({type:n,selectors:[["","gaEvent","","gaCategory",""],["","gaCategory",""]],inputs:{gaCategory:"gaCategory"},exportAs:["gaCategory"]}),n})();const zm=new Ht("ngx-google-analytics-settings",{factory:()=>({trackingCode:"",enableTracing:!1})}),Sk=new Ht("ngx-window",{providedIn:"root",factory:()=>function(n){return Af(n)?window:null}(Bc(Xc))}),jOe=new Ht("ngx-data-layer",{providedIn:"root",factory:()=>function(n){return n?n.dataLayer=n.dataLayer||[]:null}(Bc(Sk))}),Ck=new Ht("ngx-gtag-fn",{providedIn:"root",factory:()=>function(n,e){return n?n.gtag=n.gtag||function(){e.push(arguments)}:null}(Bc(Sk),Bc(jOe))});let qb=(()=>{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||fa())&&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(zm),Ie(fn),Ie(Ck))},n.\u0275prov=We({factory:function(){return new n(Ie(zm),Ie(fn),Ie(Ck))},token:n,providedIn:"root"}),n})(),m9=(()=>{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=gd(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){(fa()||this.settings.enableTracing)&&console&&console.warn&&console.warn(t)}}return n.\u0275fac=function(t){return new(t||n)(Ce(g9,8),Ce(qb),Ce(zm),Ce(gn))},n.\u0275dir=Nt({type:n,selectors:[["","gaEvent",""]],inputs:{gaBind:"gaBind",gaAction:"gaAction",gaLabel:"gaLabel",label:"label",gaValue:"gaValue",gaInteraction:"gaInteraction",gaEvent:"gaEvent"},exportAs:["gaEvent"]}),n})();const zOe={provide:Ef,multi:!0,useFactory:function(n,e,t){return()=>Bi(this,void 0,void 0,function*(){var i;if(!n.trackingCode)return void(fa()||console.error("Empty tracking code for Google Analytics. Make sure to provide one when initializing NgxGoogleAnalyticsModule."));if(!e)return void(fa()||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||fa()||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:[zm,Ck,fn]};new Ht("ngx-google-analytics-routing-settings",{factory:()=>({})});let r1=(()=>{class n{static forRoot(t,i=[],r,s,o){return{ngModule:n,providers:[{provide:zm,useValue:{trackingCode:t,initCommands:i,uri:r,enableTracing:s,nonce:o}},zOe]}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=tn({type:n}),n.\u0275inj=St({imports:[[]]}),n})(),o1=(()=>{class n{constructor(){this.consent="not-set",this.consentChange=new Df(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=We({token:n,factory:n.\u0275fac}),n})(),tRe=(()=>{class n{constructor(t,i,{trackingCode:r}){this.window=i,this.subscriptions=new C,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(o1),Ie(Sk),Ie(zm))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const nRe=new Ht("Key under which consent is stored",{providedIn:"root",factory:()=>"ALLOW_TELEMETRY"}),S9=[o1,tRe,(()=>{class n{constructor(t,i){this.key=i,this.subscriptions=new C;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(o1),Ie(nRe))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})()];function rRe(n){return Object.entries(n).reduce((e,[t,i])=>(null!=i&&(e[t]=`${i}`),e),{})}let oRe=(()=>{class n{static forRoot(t){const{providers:i=[]}=r1.forRoot(t.gaToken,function(n){const{appName:e,projectName:t,developmentMode:i}=n;return[{command:"set",values:[rRe({appName:e,projectName:t,developmentMode:i})]}]}(t));return{ngModule:n,providers:i}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=tn({type:n}),n.\u0275inj=St({providers:[...S9,{provide:Ef,multi:!0,useFactory:()=>()=>{},deps:S9}],imports:[[r1]]}),n})();const uRe=(n,e)=>JSON.stringify(n)===JSON.stringify(e),dRe=n=>n.map(e=>void 0!==e?JSON.parse(JSON.stringify(e)):e),xc={storageStrategy:class extends class{}{constructor(){super(...arguments),this.cachePairs=[]}add(e,t,i){this.cachePairs.push(e)}addMany(e){this.cachePairs=e}updateAtIndex(e,t){Object.assign(this.cachePairs[e],t)}update(e,t){Object.assign(this.cachePairs[e],t)}getAll(){return this.cachePairs}removeAtIndex(e){this.cachePairs.splice(e,1)}remove(e){this.cachePairs.splice(e,1)}removeAll(){this.cachePairs.length=0}},globalCacheKey:"CACHE_STORAGE",promiseImplementation:Promise},hRe=new oe;function Sc(n={}){return function(e,t,i){const r=n.cacheKey||e.constructor.name+"#"+t,s=i.value;if(i&&i.value){let o=n.storageStrategy?new n.storageStrategy:new xc.storageStrategy;const a=[];n.cacheModifier&&n.cacheModifier.subscribe(u=>o.addMany(u(o.getAll(r,this)),r,this)),Nn(hRe.asObservable(),n.cacheBusterObserver?n.cacheBusterObserver:b0()).subscribe(u=>{o.removeAll(r,this),a.length=0}),n.cacheResolver=n.cacheResolver||xc.cacheResolver||uRe,n.cacheHasher=n.cacheHasher||xc.cacheHasher||dRe,i.value=function(...u){const h=o.getAll(r,this);let f=n.cacheHasher(u),g=h.find(w=>n.cacheResolver(w.parameters,f));const m=a.find(w=>n.cacheResolver(w.parameters,f));if((n.maxAge||xc.maxAge)&&g&&g.created&&((new Date).getTime()-new Date(g.created).getTime()>(n.maxAge||xc.maxAge)?(o.remove?o.remove(h.indexOf(g),g,r,this):o.removeAtIndex(h.indexOf(g),r,this),g=null):(n.slidingExpiration||xc.slidingExpiration)&&(g.created=new Date,o.update?o.update(h.indexOf(g),g,r,this):o.updateAtIndex(h.indexOf(g),g,r,this))),g){const w=sn(g.response);return n.async?w.pipe(function(n,e=qS){const i=function(n){return n instanceof Date&&!isNaN(+n)}(n)?+n-e.now():Math.abs(n);return r=>r.lift(new rTe(i,e))}(0)):w}if(m)return m.response;{const w=s.call(this,...u).pipe(NN(()=>{const x=a.find(U=>n.cacheResolver(U.parameters,f));a.splice(a.indexOf(x),1)}),cr(x=>{(!n.shouldCacheDecider||n.shouldCacheDecider(x))&&((!(n.maxCacheCount||xc.maxCacheCount)||1===(n.maxCacheCount||xc.maxCacheCount)||(n.maxCacheCount||xc.maxCacheCount)&&(n.maxCacheCount||xc.maxCacheCount)xa(()=>s,undefined)(o)}(),Yn());return a.push({parameters:f,response:w,created:new Date}),w}}}return i}}class fRe{encodeKey(e){return encodeURIComponent(e)}encodeValue(e){return encodeURIComponent(e)}decodeKey(e){return decodeURIComponent(e)}decodeValue(e){return decodeURIComponent(e)}}const C9=new Ht("basePath");class Yb{constructor(e={}){this.apiKeys=e.apiKeys,this.username=e.username,this.password=e.password,this.accessToken=e.accessToken,this.basePath=e.basePath,this.withCredentials=e.withCredentials,this.encoder=e.encoder,this.credentials=e.credentials?e.credentials:{}}selectHeaderContentType(e){if(0===e.length)return;const t=e.find(i=>this.isJsonMime(i));return void 0===t?e[0]:t}selectHeaderAccept(e){if(0===e.length)return;const t=e.find(i=>this.isJsonMime(i));return void 0===t?e[0]:t}isJsonMime(e){const t=new RegExp("^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$","i");return null!==e&&(t.test(e)||"application/json-patch+json"===e.toLowerCase())}lookupCredential(e){const t=this.credentials[e];return"function"==typeof t?t():t}}let T9=(()=>{class n{constructor(t,i,r){this.httpClient=t,this.basePath="/v1",this.defaultHeaders=new mu,this.configuration=new Yb,r&&(this.configuration=r),"string"!=typeof this.configuration.basePath&&("string"!=typeof i&&(i=this.basePath),this.configuration.basePath=i),this.encoder=this.configuration.encoder||new fRe}addToHttpParams(t,i,r){return this.addToHttpParamsRecursive(t,i,r)}addToHttpParamsRecursive(t,i,r){if(null==i)return t;if("object"==typeof i)if(Array.isArray(i))i.forEach(s=>t=this.addToHttpParamsRecursive(t,s,r));else if(i instanceof Date){if(null==r)throw Error("key may not be null if value is Date");t=t.append(r,i.toISOString().substr(0,10))}else Object.keys(i).forEach(s=>t=this.addToHttpParamsRecursive(t,i[s],null!=r?`${r}.${s}`:s));else{if(null==r)throw Error("key may not be null if value is not object or array");t=t.append(r,i)}return t}aggregateResults(t,i="body",r=!1,s){const o=t.age,a=t.ageRange,l=t.bmi,c=t.bmiRange,u=t.cache,h=t.ontologyTerms,f=t.cellTypeTerms,g=t.providers,m=t.sex,w=t.spatial,x=t.technologies,U=t.token;let D=new Lr({encoder:this.encoder});null!=o&&(D=this.addToHttpParams(D,o,"age")),null!=a&&(D=this.addToHttpParams(D,a,"age-range")),null!=l&&(D=this.addToHttpParams(D,l,"bmi")),null!=c&&(D=this.addToHttpParams(D,c,"bmi-range")),null!=u&&(D=this.addToHttpParams(D,u,"cache")),h&&h.forEach(Ve=>{D=this.addToHttpParams(D,Ve,"ontology-terms")}),f&&f.forEach(Ve=>{D=this.addToHttpParams(D,Ve,"cell-type-terms")}),g&&g.forEach(Ve=>{D=this.addToHttpParams(D,Ve,"providers")}),null!=m&&(D=this.addToHttpParams(D,m,"sex")),w&&w.forEach(Ve=>{D=this.addToHttpParams(D,Ve,"spatial")}),x&&x.forEach(Ve=>{D=this.addToHttpParams(D,Ve,"technologies")}),null!=U&&(D=this.addToHttpParams(D,U,"token"));let ie=this.defaultHeaders,_e=s&&s.httpHeaderAccept;void 0===_e&&(_e=this.configuration.selectHeaderAccept(["application/json"])),void 0!==_e&&(ie=ie.set("Accept",_e));let Pe=s&&s.context;void 0===Pe&&(Pe=new Zs);let Ne="json";return _e&&(Ne=_e.startsWith("text")?"text":this.configuration.isJsonMime(_e)?"json":"blob"),this.httpClient.get(`${this.configuration.basePath}/aggregate-results`,{context:Pe,params:D,responseType:Ne,withCredentials:this.configuration.withCredentials,headers:ie,observe:i,reportProgress:r})}cellTypeTermOccurences(t,i="body",r=!1,s){const o=t.age,a=t.ageRange,l=t.bmi,c=t.bmiRange,u=t.cache,h=t.ontologyTerms,f=t.cellTypeTerms,g=t.providers,m=t.sex,w=t.spatial,x=t.technologies,U=t.token;let D=new Lr({encoder:this.encoder});null!=o&&(D=this.addToHttpParams(D,o,"age")),null!=a&&(D=this.addToHttpParams(D,a,"age-range")),null!=l&&(D=this.addToHttpParams(D,l,"bmi")),null!=c&&(D=this.addToHttpParams(D,c,"bmi-range")),null!=u&&(D=this.addToHttpParams(D,u,"cache")),h&&h.forEach(Ve=>{D=this.addToHttpParams(D,Ve,"ontology-terms")}),f&&f.forEach(Ve=>{D=this.addToHttpParams(D,Ve,"cell-type-terms")}),g&&g.forEach(Ve=>{D=this.addToHttpParams(D,Ve,"providers")}),null!=m&&(D=this.addToHttpParams(D,m,"sex")),w&&w.forEach(Ve=>{D=this.addToHttpParams(D,Ve,"spatial")}),x&&x.forEach(Ve=>{D=this.addToHttpParams(D,Ve,"technologies")}),null!=U&&(D=this.addToHttpParams(D,U,"token"));let ie=this.defaultHeaders,_e=s&&s.httpHeaderAccept;void 0===_e&&(_e=this.configuration.selectHeaderAccept(["application/json"])),void 0!==_e&&(ie=ie.set("Accept",_e));let Pe=s&&s.context;void 0===Pe&&(Pe=new Zs);let Ne="json";return _e&&(Ne=_e.startsWith("text")?"text":this.configuration.isJsonMime(_e)?"json":"blob"),this.httpClient.get(`${this.configuration.basePath}/cell-type-term-occurences`,{context:Pe,params:D,responseType:Ne,withCredentials:this.configuration.withCredentials,headers:ie,observe:i,reportProgress:r})}cellTypeTreeModel(t,i="body",r=!1,s){const o=t.cache,a=t.token;let l=new Lr({encoder:this.encoder});null!=o&&(l=this.addToHttpParams(l,o,"cache")),null!=a&&(l=this.addToHttpParams(l,a,"token"));let c=this.defaultHeaders,u=s&&s.httpHeaderAccept;void 0===u&&(u=this.configuration.selectHeaderAccept(["application/json"])),void 0!==u&&(c=c.set("Accept",u));let h=s&&s.context;void 0===h&&(h=new Zs);let f="json";return u&&(f=u.startsWith("text")?"text":this.configuration.isJsonMime(u)?"json":"blob"),this.httpClient.get(`${this.configuration.basePath}/cell-type-tree-model`,{context:h,params:l,responseType:f,withCredentials:this.configuration.withCredentials,headers:c,observe:i,reportProgress:r})}dbStatus(t,i="body",r=!1,s){const o=t.token;let a=new Lr({encoder:this.encoder});null!=o&&(a=this.addToHttpParams(a,o,"token"));let l=this.defaultHeaders,c=s&&s.httpHeaderAccept;void 0===c&&(c=this.configuration.selectHeaderAccept(["application/json"])),void 0!==c&&(l=l.set("Accept",c));let u=s&&s.context;void 0===u&&(u=new Zs);let h="json";return c&&(h=c.startsWith("text")?"text":this.configuration.isJsonMime(c)?"json":"blob"),this.httpClient.get(`${this.configuration.basePath}/db-status`,{context:u,params:a,responseType:h,withCredentials:this.configuration.withCredentials,headers:l,observe:i,reportProgress:r})}getSpatialPlacement(t,i="body",r=!1,s){const o=t.getSpatialPlacementRequest;if(null==o)throw new Error("Required parameter getSpatialPlacementRequest was null or undefined when calling getSpatialPlacement.");let a=this.defaultHeaders,l=s&&s.httpHeaderAccept;void 0===l&&(l=this.configuration.selectHeaderAccept(["application/json"])),void 0!==l&&(a=a.set("Accept",l));let c=s&&s.context;void 0===c&&(c=new Zs);const h=this.configuration.selectHeaderContentType(["application/json"]);void 0!==h&&(a=a.set("Content-Type",h));let f="json";return l&&(f=l.startsWith("text")?"text":this.configuration.isJsonMime(l)?"json":"blob"),this.httpClient.post(`${this.configuration.basePath}/get-spatial-placement`,o,{context:c,responseType:f,withCredentials:this.configuration.withCredentials,headers:a,observe:i,reportProgress:r})}gtexRuiLocations(t,i="body",r=!1,s){const o=t.cache;let a=new Lr({encoder:this.encoder});null!=o&&(a=this.addToHttpParams(a,o,"cache"));let l=this.defaultHeaders,c=s&&s.httpHeaderAccept;void 0===c&&(c=this.configuration.selectHeaderAccept(["application/json"])),void 0!==c&&(l=l.set("Accept",c));let u=s&&s.context;void 0===u&&(u=new Zs);let h="json";return c&&(h=c.startsWith("text")?"text":this.configuration.isJsonMime(c)?"json":"blob"),this.httpClient.get(`${this.configuration.basePath}/gtex/rui_locations.jsonld`,{context:u,params:a,responseType:h,withCredentials:this.configuration.withCredentials,headers:l,observe:i,reportProgress:r})}hubmapRuiLocations(t,i="body",r=!1,s){const o=t.cache,a=t.token;let l=new Lr({encoder:this.encoder});null!=o&&(l=this.addToHttpParams(l,o,"cache")),null!=a&&(l=this.addToHttpParams(l,a,"token"));let c=this.defaultHeaders,u=s&&s.httpHeaderAccept;void 0===u&&(u=this.configuration.selectHeaderAccept(["application/json"])),void 0!==u&&(c=c.set("Accept",u));let h=s&&s.context;void 0===h&&(h=new Zs);let f="json";return u&&(f=u.startsWith("text")?"text":this.configuration.isJsonMime(u)?"json":"blob"),this.httpClient.get(`${this.configuration.basePath}/hubmap/rui_locations.jsonld`,{context:h,params:l,responseType:f,withCredentials:this.configuration.withCredentials,headers:c,observe:i,reportProgress:r})}ontologyTermOccurences(t,i="body",r=!1,s){const o=t.age,a=t.ageRange,l=t.bmi,c=t.bmiRange,u=t.cache,h=t.ontologyTerms,f=t.cellTypeTerms,g=t.providers,m=t.sex,w=t.spatial,x=t.technologies,U=t.token;let D=new Lr({encoder:this.encoder});null!=o&&(D=this.addToHttpParams(D,o,"age")),null!=a&&(D=this.addToHttpParams(D,a,"age-range")),null!=l&&(D=this.addToHttpParams(D,l,"bmi")),null!=c&&(D=this.addToHttpParams(D,c,"bmi-range")),null!=u&&(D=this.addToHttpParams(D,u,"cache")),h&&h.forEach(Ve=>{D=this.addToHttpParams(D,Ve,"ontology-terms")}),f&&f.forEach(Ve=>{D=this.addToHttpParams(D,Ve,"cell-type-terms")}),g&&g.forEach(Ve=>{D=this.addToHttpParams(D,Ve,"providers")}),null!=m&&(D=this.addToHttpParams(D,m,"sex")),w&&w.forEach(Ve=>{D=this.addToHttpParams(D,Ve,"spatial")}),x&&x.forEach(Ve=>{D=this.addToHttpParams(D,Ve,"technologies")}),null!=U&&(D=this.addToHttpParams(D,U,"token"));let ie=this.defaultHeaders,_e=s&&s.httpHeaderAccept;void 0===_e&&(_e=this.configuration.selectHeaderAccept(["application/json"])),void 0!==_e&&(ie=ie.set("Accept",_e));let Pe=s&&s.context;void 0===Pe&&(Pe=new Zs);let Ne="json";return _e&&(Ne=_e.startsWith("text")?"text":this.configuration.isJsonMime(_e)?"json":"blob"),this.httpClient.get(`${this.configuration.basePath}/ontology-term-occurences`,{context:Pe,params:D,responseType:Ne,withCredentials:this.configuration.withCredentials,headers:ie,observe:i,reportProgress:r})}ontologyTreeModel(t,i="body",r=!1,s){const o=t.cache,a=t.token;let l=new Lr({encoder:this.encoder});null!=o&&(l=this.addToHttpParams(l,o,"cache")),null!=a&&(l=this.addToHttpParams(l,a,"token"));let c=this.defaultHeaders,u=s&&s.httpHeaderAccept;void 0===u&&(u=this.configuration.selectHeaderAccept(["application/json"])),void 0!==u&&(c=c.set("Accept",u));let h=s&&s.context;void 0===h&&(h=new Zs);let f="json";return u&&(f=u.startsWith("text")?"text":this.configuration.isJsonMime(u)?"json":"blob"),this.httpClient.get(`${this.configuration.basePath}/ontology-tree-model`,{context:h,params:l,responseType:f,withCredentials:this.configuration.withCredentials,headers:c,observe:i,reportProgress:r})}providerNames(t,i="body",r=!1,s){const o=t.cache,a=t.token;let l=new Lr({encoder:this.encoder});null!=o&&(l=this.addToHttpParams(l,o,"cache")),null!=a&&(l=this.addToHttpParams(l,a,"token"));let c=this.defaultHeaders,u=s&&s.httpHeaderAccept;void 0===u&&(u=this.configuration.selectHeaderAccept(["application/json"])),void 0!==u&&(c=c.set("Accept",u));let h=s&&s.context;void 0===h&&(h=new Zs);let f="json";return u&&(f=u.startsWith("text")?"text":this.configuration.isJsonMime(u)?"json":"blob"),this.httpClient.get(`${this.configuration.basePath}/provider-names`,{context:h,params:l,responseType:f,withCredentials:this.configuration.withCredentials,headers:c,observe:i,reportProgress:r})}referenceOrganScene(t,i="body",r=!1,s){const o=t.organIri;if(null==o)throw new Error("Required parameter organIri was null or undefined when calling referenceOrganScene.");const a=t.age,l=t.ageRange,c=t.bmi,u=t.bmiRange,h=t.cache,f=t.ontologyTerms,g=t.cellTypeTerms,m=t.providers,w=t.sex,x=t.spatial,U=t.technologies,D=t.token;let ie=new Lr({encoder:this.encoder});null!=a&&(ie=this.addToHttpParams(ie,a,"age")),null!=l&&(ie=this.addToHttpParams(ie,l,"age-range")),null!=c&&(ie=this.addToHttpParams(ie,c,"bmi")),null!=u&&(ie=this.addToHttpParams(ie,u,"bmi-range")),null!=h&&(ie=this.addToHttpParams(ie,h,"cache")),f&&f.forEach(bt=>{ie=this.addToHttpParams(ie,bt,"ontology-terms")}),g&&g.forEach(bt=>{ie=this.addToHttpParams(ie,bt,"cell-type-terms")}),null!=o&&(ie=this.addToHttpParams(ie,o,"organ-iri")),m&&m.forEach(bt=>{ie=this.addToHttpParams(ie,bt,"providers")}),null!=w&&(ie=this.addToHttpParams(ie,w,"sex")),x&&x.forEach(bt=>{ie=this.addToHttpParams(ie,bt,"spatial")}),U&&U.forEach(bt=>{ie=this.addToHttpParams(ie,bt,"technologies")}),null!=D&&(ie=this.addToHttpParams(ie,D,"token"));let _e=this.defaultHeaders,Pe=s&&s.httpHeaderAccept;void 0===Pe&&(Pe=this.configuration.selectHeaderAccept(["application/json"])),void 0!==Pe&&(_e=_e.set("Accept",Pe));let Ne=s&&s.context;void 0===Ne&&(Ne=new Zs);let Ve="json";return Pe&&(Ve=Pe.startsWith("text")?"text":this.configuration.isJsonMime(Pe)?"json":"blob"),this.httpClient.get(`${this.configuration.basePath}/reference-organ-scene`,{context:Ne,params:ie,responseType:Ve,withCredentials:this.configuration.withCredentials,headers:_e,observe:i,reportProgress:r})}referenceOrgans(t,i="body",r=!1,s){const o=t.cache,a=t.token;let l=new Lr({encoder:this.encoder});null!=o&&(l=this.addToHttpParams(l,o,"cache")),null!=a&&(l=this.addToHttpParams(l,a,"token"));let c=this.defaultHeaders,u=s&&s.httpHeaderAccept;void 0===u&&(u=this.configuration.selectHeaderAccept(["application/json"])),void 0!==u&&(c=c.set("Accept",u));let h=s&&s.context;void 0===h&&(h=new Zs);let f="json";return u&&(f=u.startsWith("text")?"text":this.configuration.isJsonMime(u)?"json":"blob"),this.httpClient.get(`${this.configuration.basePath}/reference-organs`,{context:h,params:l,responseType:f,withCredentials:this.configuration.withCredentials,headers:c,observe:i,reportProgress:r})}scene(t,i="body",r=!1,s){const o=t.age,a=t.ageRange,l=t.bmi,c=t.bmiRange,u=t.cache,h=t.ontologyTerms,f=t.cellTypeTerms,g=t.providers,m=t.sex,w=t.spatial,x=t.technologies,U=t.token;let D=new Lr({encoder:this.encoder});null!=o&&(D=this.addToHttpParams(D,o,"age")),null!=a&&(D=this.addToHttpParams(D,a,"age-range")),null!=l&&(D=this.addToHttpParams(D,l,"bmi")),null!=c&&(D=this.addToHttpParams(D,c,"bmi-range")),null!=u&&(D=this.addToHttpParams(D,u,"cache")),h&&h.forEach(Ve=>{D=this.addToHttpParams(D,Ve,"ontology-terms")}),f&&f.forEach(Ve=>{D=this.addToHttpParams(D,Ve,"cell-type-terms")}),g&&g.forEach(Ve=>{D=this.addToHttpParams(D,Ve,"providers")}),null!=m&&(D=this.addToHttpParams(D,m,"sex")),w&&w.forEach(Ve=>{D=this.addToHttpParams(D,Ve,"spatial")}),x&&x.forEach(Ve=>{D=this.addToHttpParams(D,Ve,"technologies")}),null!=U&&(D=this.addToHttpParams(D,U,"token"));let ie=this.defaultHeaders,_e=s&&s.httpHeaderAccept;void 0===_e&&(_e=this.configuration.selectHeaderAccept(["application/json"])),void 0!==_e&&(ie=ie.set("Accept",_e));let Pe=s&&s.context;void 0===Pe&&(Pe=new Zs);let Ne="json";return _e&&(Ne=_e.startsWith("text")?"text":this.configuration.isJsonMime(_e)?"json":"blob"),this.httpClient.get(`${this.configuration.basePath}/scene`,{context:Pe,params:D,responseType:Ne,withCredentials:this.configuration.withCredentials,headers:ie,observe:i,reportProgress:r})}sparql(t,i="body",r=!1,s){const o=t.query;if(null==o)throw new Error("Required parameter query was null or undefined when calling sparql.");const a=t.token,l=t.format;let c=new Lr({encoder:this.encoder});null!=o&&(c=this.addToHttpParams(c,o,"query")),null!=a&&(c=this.addToHttpParams(c,a,"token")),null!=l&&(c=this.addToHttpParams(c,l,"format"));let u=this.defaultHeaders,h=s&&s.httpHeaderAccept;void 0===h&&(h=this.configuration.selectHeaderAccept(["application/json"])),void 0!==h&&(u=u.set("Accept",h));let f=s&&s.context;void 0===f&&(f=new Zs);let g="json";return h&&(g=h.startsWith("text")?"text":this.configuration.isJsonMime(h)?"json":"blob"),this.httpClient.get(`${this.configuration.basePath}/sparql`,{context:f,params:c,responseType:g,withCredentials:this.configuration.withCredentials,headers:u,observe:i,reportProgress:r})}sparqlPost(t,i="body",r=!1,s){const o=t.sparqlQueryRequest;if(null==o)throw new Error("Required parameter sparqlQueryRequest was null or undefined when calling sparqlPost.");const a=t.token,l=t.format;let c=new Lr({encoder:this.encoder});null!=a&&(c=this.addToHttpParams(c,a,"token")),null!=l&&(c=this.addToHttpParams(c,l,"format"));let u=this.defaultHeaders,h=s&&s.httpHeaderAccept;void 0===h&&(h=this.configuration.selectHeaderAccept(["application/json"])),void 0!==h&&(u=u.set("Accept",h));let f=s&&s.context;void 0===f&&(f=new Zs);const m=this.configuration.selectHeaderContentType(["application/json","application/x-www-form-urlencoded"]);void 0!==m&&(u=u.set("Content-Type",m));let w="json";return h&&(w=h.startsWith("text")?"text":this.configuration.isJsonMime(h)?"json":"blob"),this.httpClient.post(`${this.configuration.basePath}/sparql`,o,{context:f,params:c,responseType:w,withCredentials:this.configuration.withCredentials,headers:u,observe:i,reportProgress:r})}technologyNames(t,i="body",r=!1,s){const o=t.cache,a=t.token;let l=new Lr({encoder:this.encoder});null!=o&&(l=this.addToHttpParams(l,o,"cache")),null!=a&&(l=this.addToHttpParams(l,a,"token"));let c=this.defaultHeaders,u=s&&s.httpHeaderAccept;void 0===u&&(u=this.configuration.selectHeaderAccept(["application/json"])),void 0!==u&&(c=c.set("Accept",u));let h=s&&s.context;void 0===h&&(h=new Zs);let f="json";return u&&(f=u.startsWith("text")?"text":this.configuration.isJsonMime(u)?"json":"blob"),this.httpClient.get(`${this.configuration.basePath}/technology-names`,{context:h,params:l,responseType:f,withCredentials:this.configuration.withCredentials,headers:c,observe:i,reportProgress:r})}tissueBlocks(t,i="body",r=!1,s){const o=t.age,a=t.ageRange,l=t.bmi,c=t.bmiRange,u=t.cache,h=t.ontologyTerms,f=t.cellTypeTerms,g=t.providers,m=t.sex,w=t.spatial,x=t.technologies,U=t.token;let D=new Lr({encoder:this.encoder});null!=o&&(D=this.addToHttpParams(D,o,"age")),null!=a&&(D=this.addToHttpParams(D,a,"age-range")),null!=l&&(D=this.addToHttpParams(D,l,"bmi")),null!=c&&(D=this.addToHttpParams(D,c,"bmi-range")),null!=u&&(D=this.addToHttpParams(D,u,"cache")),h&&h.forEach(Ve=>{D=this.addToHttpParams(D,Ve,"ontology-terms")}),f&&f.forEach(Ve=>{D=this.addToHttpParams(D,Ve,"cell-type-terms")}),g&&g.forEach(Ve=>{D=this.addToHttpParams(D,Ve,"providers")}),null!=m&&(D=this.addToHttpParams(D,m,"sex")),w&&w.forEach(Ve=>{D=this.addToHttpParams(D,Ve,"spatial")}),x&&x.forEach(Ve=>{D=this.addToHttpParams(D,Ve,"technologies")}),null!=U&&(D=this.addToHttpParams(D,U,"token"));let ie=this.defaultHeaders,_e=s&&s.httpHeaderAccept;void 0===_e&&(_e=this.configuration.selectHeaderAccept(["application/json"])),void 0!==_e&&(ie=ie.set("Accept",_e));let Pe=s&&s.context;void 0===Pe&&(Pe=new Zs);let Ne="json";return _e&&(Ne=_e.startsWith("text")?"text":this.configuration.isJsonMime(_e)?"json":"blob"),this.httpClient.get(`${this.configuration.basePath}/tissue-blocks`,{context:Pe,params:D,responseType:Ne,withCredentials:this.configuration.withCredentials,headers:ie,observe:i,reportProgress:r})}}return n.\u0275fac=function(t){return new(t||n)(Ie(_u),Ie(C9,8),Ie(Yb,8))},n.\u0275prov=We({factory:function(){return new n(Ie(_u),Ie(C9,8),Ie(Yb,8))},token:n,providedIn:"root"}),n})(),pRe=(()=>{class n{constructor(t,i){if(t)throw new Error("CcfApiModule is already loaded. Import in your base AppModule only.");if(!i)throw new Error("You need to import the HttpClientModule in your AppModule! \nSee also https://github.com/angular/angular/issues/20575")}static forRoot(t){return{ngModule:n,providers:[{provide:Yb,useFactory:t}]}}}return n.\u0275fac=function(t){return new(t||n)(Ie(n,12),Ie(_u,8))},n.\u0275mod=tn({type:n}),n.\u0275inj=St({providers:[],imports:[[]]}),n})();function vu(n){return new Promise((e,t)=>{n.oncomplete=n.onsuccess=()=>e(n.result),n.onabort=n.onerror=()=>t(n.error)})}let Ak;function Cc(){return Ak||(Ak=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),vu(i)});return(i,r)=>t.then(s=>r(s.transaction(e,i).objectStore(e)))}(0,"keyval")),Ak}function A9(n,e=Cc()){return e("readonly",t=>vu(t.get(n)))}var Un=et(1440);const a1="Unknown Euler angle order",Hm=.99999;class Zi extends mx{static get ZYX(){return 0}static get YXZ(){return 1}static get XZY(){return 2}static get ZXY(){return 3}static get YZX(){return 4}static get XYZ(){return 5}static get RollPitchYaw(){return 0}static get DefaultOrder(){return Zi.ZYX}static get RotationOrders(){return["ZYX","YXZ","XZY","ZXY","YZX","XYZ"]}static rotationOrder(e){return Zi.RotationOrders[e]}get ELEMENTS(){return 4}constructor(e=0,t=0,i=0,r=Zi.DefaultOrder){super(-0,-0,-0,-0),arguments.length>0&&Array.isArray(arguments[0])?this.fromVector3(...arguments):this.set(e,t,i,r)}fromQuaternion(e){const[t,i,r,s]=e,o=i*i,a=-2*(o+r*r)+1,l=2*(t*i+s*r);let c=-2*(t*r-s*i);c=c>1?1:c,c=c<-1?-1:c;const f=Math.atan2(2*(i*r+s*t),-2*(t*t+o)+1),g=Math.asin(c),m=Math.atan2(l,a);return new Zi(f,g,m,Zi.RollPitchYaw)}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=Number.isFinite(e[3])||this.order,this.check()}set(e=0,t=0,i=0,r){return this[0]=e,this[1]=t,this[2]=i,this[3]=Number.isFinite(r)?r:this[3],this.check()}validate(){return function(n){return n>=0&&n<6}(this[3])&&Number.isFinite(this[0])&&Number.isFinite(this[1])&&Number.isFinite(this[2])}toArray(e=[],t=0){return e[t]=this[0],e[t+1]=this[1],e[t+2]=this[2],e}toArray4(e=[],t=0){return e[t]=this[0],e[t+1]=this[1],e[t+2]=this[2],e[t+3]=this[3],e}toVector3(e=[-0,-0,-0]){return e[0]=this[0],e[1]=this[1],e[2]=this[2],e}get x(){return this[0]}set x(e){this[0]=nr(e)}get y(){return this[1]}set y(e){this[1]=nr(e)}get z(){return this[2]}set z(e){this[2]=nr(e)}get alpha(){return this[0]}set alpha(e){this[0]=nr(e)}get beta(){return this[1]}set beta(e){this[1]=nr(e)}get gamma(){return this[2]}set gamma(e){this[2]=nr(e)}get phi(){return this[0]}set phi(e){this[0]=nr(e)}get theta(){return this[1]}set theta(e){this[1]=nr(e)}get psi(){return this[2]}set psi(e){this[2]=nr(e)}get roll(){return this[0]}set roll(e){this[0]=nr(e)}get pitch(){return this[1]}set pitch(e){this[1]=nr(e)}get yaw(){return this[2]}set yaw(e){this[2]=nr(e)}get order(){return this[3]}set order(e){this[3]=function(n){if(n<0&&n>=6)throw new Error(a1);return n}(e)}fromVector3(e,t){return this.set(e[0],e[1],e[2],Number.isFinite(t)?t:this[3])}fromArray(e,t=0){return this[0]=e[0+t],this[1]=e[1+t],this[2]=e[2+t],void 0!==e[3]&&(this[3]=e[3]),this.check()}fromRollPitchYaw(e,t,i){return this.set(e,t,i,Zi.ZYX)}fromRotationMatrix(e,t=Zi.DefaultOrder){return this._fromRotationMatrix(e,t),this.check()}getRotationMatrix(e){return this._getRotationMatrix(e)}getQuaternion(){const e=new mR;switch(this[4]){case Zi.XYZ:return e.rotateX(this[0]).rotateY(this[1]).rotateZ(this[2]);case Zi.YXZ:return e.rotateY(this[0]).rotateX(this[1]).rotateZ(this[2]);case Zi.ZXY:return e.rotateZ(this[0]).rotateX(this[1]).rotateY(this[2]);case Zi.ZYX:return e.rotateZ(this[0]).rotateY(this[1]).rotateX(this[2]);case Zi.YZX:return e.rotateY(this[0]).rotateZ(this[1]).rotateX(this[2]);case Zi.XZY:return e.rotateX(this[0]).rotateZ(this[1]).rotateY(this[2]);default:throw new Error(a1)}}_fromRotationMatrix(e,t=Zi.DefaultOrder){const i=e.elements,r=i[0],s=i[4],o=i[8],a=i[1],l=i[5],c=i[9],u=i[2],h=i[6],f=i[10];switch(t=t||this[3]){case Zi.XYZ:this[1]=Math.asin(Ua(o,-1,1)),Math.abs(o)1&&void 0!==arguments[1]?arguments[1]:0,t=(co[n[e+0]]+co[n[e+1]]+co[n[e+2]]+co[n[e+3]]+"-"+co[n[e+4]]+co[n[e+5]]+"-"+co[n[e+6]]+co[n[e+7]]+"-"+co[n[e+8]]+co[n[e+9]]+"-"+co[n[e+10]]+co[n[e+11]]+co[n[e+12]]+co[n[e+13]]+co[n[e+14]]+co[n[e+15]]).toLowerCase();if(!DRe(t))throw TypeError("Stringified UUID is invalid");return t}(i)};var c1=et(1609);const Gm=Object.freeze({OUTSIDE:-1,INTERSECTING:0,INSIDE:1}),Rr=(Math,Math,{});function LRe(n,{precision:e=Rr.precision||4}={}){return n=function(n){return Math.round(n/Rr.EPSILON)*Rr.EPSILON}(n),"".concat(parseFloat(n.toPrecision(e)))}function Mh(n){return Array.isArray(n)||ArrayBuffer.isView(n)&&!(n instanceof DataView)}function Xb(n,e,t){const i=Rr.EPSILON;t&&(Rr.EPSILON=t);try{if(n===e)return!0;if(Mh(n)&&Mh(e)){if(n.length!==e.length)return!1;for(let r=0;r0?", ":"")+LRe(this[i],e);return"".concat(e.printTypes?this.constructor.name:"","[").concat(t,"]")}equals(e){if(!e||this.length!==e.length)return!1;for(let t=0;t=0&&e=0&&e=a+s)return this.clone();if(s>=a+i)return e.clone();const l=.5*(i+a+s);return P9.copy(o).scale((-i+l)/a).add(t),this.center.copy(P9),this.radius=l,this}expand(e){const t=(e=Kb.from(e)).subtract(this.center).magnitude();return t>this.radius&&(this.radius=t),this}transform(e){this.center.transform(e);const t=function(n,e){var s=e[4],o=e[5],a=e[6],l=e[8],c=e[9],u=e[10];return n[0]=Math.hypot(e[0],e[1],e[2]),n[1]=Math.hypot(s,o,a),n[2]=Math.hypot(l,c,u),n}(Kb,e);return this.radius=Math.max(t[0],Math.max(t[1],t[2]))*this.radius,this}distanceSquaredTo(e){const t=this.distanceTo(e);return t*t}distanceTo(e){const t=(e=Kb.from(e)).subtract(this.center);return Math.max(0,t.len()-this.radius)}intersectPlane(e){const i=this.radius,s=e.normal.dot(this.center)+e.distance;return s<-i?Gm.OUTSIDE:s0?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 sH(this,this,e),this.check()}rotateY(e){return oH(this,this,e),this.check()}rotateZ(e){return aH(this,this,e),this.check()}scale(e){return pR(this,this,e),this.check()}slerp(e,t,i){switch(arguments.length){case 1:({start:e=JRe,target:t,ratio:i}=arguments[0]);break;case 2:[t,i]=arguments,e=this}return nb(this,e,t,i),this.check()}transformVector4(e,t=e){return OU(t,e,this),M9(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)}}const ePe=new Pn,tPe=new Pn,u1=new Pn,d1=new Pn,h1=new Pn,nPe=new Pn,iPe=new Pn;class Nk{constructor(e=[0,0,0],t=[0,0,0,0,0,0,0,0,0]){this.center=(new Pn).from(e),this.halfAxes=new Zo(t)}get halfSize(){const e=this.halfAxes.getColumn(0),t=this.halfAxes.getColumn(1),i=this.halfAxes.getColumn(2);return[new Pn(e).len(),new Pn(t).len(),new Pn(i).len()]}get quaternion(){const e=this.halfAxes.getColumn(0),t=this.halfAxes.getColumn(1),i=this.halfAxes.getColumn(2),r=new Pn(e).normalize(),s=new Pn(t).normalize(),o=new Pn(i).normalize();return(new k9).fromMatrix3(new Zo([...r,...s,...o]))}fromCenterHalfSizeQuaternion(e,t,i){const r=new k9(i),s=(new Zo).fromQuaternion(r);return s[0]=s[0]*t[0],s[1]=s[1]*t[0],s[2]=s[2]*t[0],s[3]=s[3]*t[1],s[4]=s[4]*t[1],s[5]=s[5]*t[1],s[6]=s[6]*t[2],s[7]=s[7]*t[2],s[8]=s[8]*t[2],this.center=(new Pn).from(e),this.halfAxes=s,this}clone(){return new Nk(this.center,this.halfAxes)}equals(e){return this===e||Boolean(e)&&this.center.equals(e.center)&&this.halfAxes.equals(e.halfAxes)}getBoundingSphere(e=new Pk){const t=this.halfAxes,i=t.getColumn(0,u1),r=t.getColumn(1,d1),s=t.getColumn(2,h1),o=ePe.copy(i).add(r).add(s);return e.center.copy(this.center),e.radius=o.magnitude(),e}intersectPlane(e){const t=this.center,i=e.normal,r=this.halfAxes,s=i.x,o=i.y,a=i.z,l=Math.abs(s*r[0]+o*r[1]+a*r[2])+Math.abs(s*r[3]+o*r[4]+a*r[5])+Math.abs(s*r[6]+o*r[7]+a*r[8]),c=i.dot(t)+e.distance;return c<=-l?Gm.OUTSIDE:c>=l?Gm.INSIDE:Gm.INTERSECTING}distanceTo(e){return Math.sqrt(this.distanceSquaredTo(e))}distanceSquaredTo(e){const t=tPe.from(e).subtract(this.center),i=this.halfAxes,r=i.getColumn(0,u1),s=i.getColumn(1,d1),o=i.getColumn(2,h1),a=r.magnitude(),l=s.magnitude(),c=o.magnitude();r.normalize(),s.normalize(),o.normalize();let h,u=0;return h=Math.abs(t.dot(r))-a,h>0&&(u+=h*h),h=Math.abs(t.dot(s))-l,h>0&&(u+=h*h),h=Math.abs(t.dot(o))-c,h>0&&(u+=h*h),u}computePlaneDistances(e,t,i=[-0,-0]){let r=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY;const o=this.center,a=this.halfAxes,l=a.getColumn(0,u1),c=a.getColumn(1,d1),u=a.getColumn(2,h1),h=nPe.copy(l).add(c).add(u).add(o),f=iPe.copy(h).subtract(e);let g=t.dot(f);return r=Math.min(g,r),s=Math.max(g,s),h.copy(o).add(l).add(c).subtract(u),f.copy(h).subtract(e),g=t.dot(f),r=Math.min(g,r),s=Math.max(g,s),h.copy(o).add(l).subtract(c).add(u),f.copy(h).subtract(e),g=t.dot(f),r=Math.min(g,r),s=Math.max(g,s),h.copy(o).add(l).subtract(c).subtract(u),f.copy(h).subtract(e),g=t.dot(f),r=Math.min(g,r),s=Math.max(g,s),o.copy(h).subtract(l).add(c).add(u),f.copy(h).subtract(e),g=t.dot(f),r=Math.min(g,r),s=Math.max(g,s),o.copy(h).subtract(l).add(c).subtract(u),f.copy(h).subtract(e),g=t.dot(f),r=Math.min(g,r),s=Math.max(g,s),o.copy(h).subtract(l).subtract(c).add(u),f.copy(h).subtract(e),g=t.dot(f),r=Math.min(g,r),s=Math.max(g,s),o.copy(h).subtract(l).subtract(c).subtract(u),f.copy(h).subtract(e),g=t.dot(f),r=Math.min(g,r),s=Math.max(g,s),i[0]=r,i[1]=s,i}transform(e){this.center.transformAsPoint(e);const t=this.halfAxes.getColumn(0,u1);t.transformAsPoint(e);const i=this.halfAxes.getColumn(1,d1);i.transformAsPoint(e);const r=this.halfAxes.getColumn(2,h1);return r.transformAsPoint(e),this.halfAxes=new Zo([...t,...i,...r]),this}getTransform(){throw new Error("not implemented")}}const F9=new Pn,L9=new Pn;class kk{constructor(e=[0,0,1],t=0){this.normal=new Pn,this.distance=-0,this.fromNormalDistance(e,t)}fromNormalDistance(e,t){return Tc(Number.isFinite(t)),this.normal.from(e).normalize(),this.distance=t,this}fromPointNormal(e,t){e=F9.from(e),this.normal.from(t).normalize();const i=-this.normal.dot(e);return this.distance=i,this}fromCoefficients(e,t,i,r){return this.normal.set(e,t,i),Tc(Xb(this.normal.len(),1)),this.distance=r,this}clone(e){return new kk(this.normal,this.distance)}equals(e){return Xb(this.distance,e.distance)&&Xb(this.normal,e.normal)}getPointDistance(e){return this.normal.dot(e)+this.distance}transform(e){const t=L9.copy(this.normal).transformAsVector(e).normalize(),i=this.normal.scale(-this.distance).transform(e);return this.fromPointNormal(i,t)}projectPointOntoPlane(e,t=[0,0,0]){e=F9.from(e);const i=this.getPointDistance(e),r=L9.copy(this.normal).scale(i);return e.subtract(r).to(t)}}function*Uk(n,e,t){for(const[i,r]of Object.entries(t))for(const s of(0,Un.readQuads)(n,e,i,null,null)){const o="Literal"===s.object.termType?(0,c1.fromRdf)(s.object):s.object.id;yield[r,o]}}function dp(n,e,t,i){const r={"@id":e,"@type":t};for(const[s,o]of Object.entries(i))for(const a of(0,Un.readQuads)(n,r["@id"],s,null,null)){const l="Literal"===a.object.termType?(0,c1.fromRdf)(a.object):a.object.id;r[o]=l}return r}new Pn([1,0,0]),new Pn([0,1,0]),new Pn([0,0,1]),new Pn,new Pn,new kk(new Pn(1,0,0),0),new Pn,new Pn,new Pn,new Pn,new Pn,new Pn,new Pn,new Pn,new Pn,new Pn,new Pn,new Pn,new Pn,new Pn,new Pn,new Pn,new Pn,Math,new Zo,new Zo,new Zo,new Zo,new Zo,new Pn,new Pn,new Pn,new Pn,new Pn,new Zo,new Zo,new Zo;const ir=Un.Util.prefixes({base:"http://purl.org/ccf/latest/ccf.owl#",ccf:"http://purl.org/ccf/",fma:"http://purl.org/sig/ont/fma/fma",obo:"http://purl.obolibrary.org/obo/",uberon:"http://purl.obolibrary.org/obo/UBERON_",cl:"http://purl.obolibrary.org/obo/CL_",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/",dcterms:"http://purl.org/dc/terms/"},Un.DataFactory),U9={x:ir("rdf"),type:ir("rdf")("type")},dn=(ir("rdfs"),ir("rdfs")("label"),ir("rdfs")("comment"),ir("rdfs")("isDefinedBy"),ir("rdfs")("seeAlso"),ir("ccf")),vi={id:ir("ccf")("has_registration_location"),label:ir("rdfs")("label"),description:ir("rdfs")("comment"),link:dn("url"),sex:dn("sex"),age:dn("age"),bmi:dn("bmi"),Male:Un.DataFactory.literal("Male"),Female:Un.DataFactory.literal("Female"),consortiumName:dn("consortium_name"),providerName:dn("tissue_provider_name"),providerUUID:dn("tissue_provider_uuid"),donor:dn("comes_from"),sections:dn("subdivided_into_sections"),datasets:dn("generates_dataset"),sampleType:dn("sample_type"),TissueBlock:Un.DataFactory.literal("Tissue Block"),TissueSection:Un.DataFactory.literal("Tissue Section"),NonStandard:Un.DataFactory.literal("Non-standard"),sectionCount:dn("section_count"),sectionSize:dn("section_size"),sectionUnits:dn("section_size_unit"),sectionNumber:dn("section_number"),spatialEntity:dn("has_registration_location"),ontologyTerms:dn("has_ontology_term"),cellTypeTerms:dn("has_cell_type_term"),technology:dn("technology"),thumbnail:dn("thumbnail")},ki={x:dn,base:ir("base"),ontologyNode:{label:dn("ccf_pref_label"),parent:dn("ccf_part_of"),children:dn("ccf_part_of"),rui_rank:dn("rui_rank"),synonymLabels:Un.DataFactory.namedNode("http://www.geneontology.org/formats/oboInOwl#hasExactSynonym")},asctb:{part_of:dn("ccf_part_of"),ct_is_a:dn("ccf_ct_isa"),located_in:dn("ccf_located_in"),characterizes:dn("ccf_characterizes")},spatial:{Female:ir("base")("VHFemale"),Male:ir("base")("VHMale"),BothSexes:ir("base")("VHBothSexes"),FemaleOrgans:ir("base")("VHFemaleOrgans"),MaleOrgans:ir("base")("VHMaleOrgans")},SpatialObjectReference:dn("spatial_object_reference"),SpatialEntity:dn("spatial_entity"),SpatialPlacement:dn("spatial_placement"),spatialObjectReference:{file:dn("file_url"),file_format:dn("file_format"),file_subpath:dn("file_subpath")},extractionSet:{label:ir("rdfs")("label"),rui_rank:dn("rui_rank")},spatialEntity:{label:ir("rdfs")("label"),description:ir("rdfs")("comment"),creator:ir("dcterms")("creator"),creator_first_name:dn("creator_first_name"),creator_last_name:dn("creator_last_name"),creator_orcid:dn("creator_orcid"),creation_date:ir("dcterms")("created"),updated_date:dn("updated_date"),ccf_annotations:dn("collides_with"),representation_of:dn("representation_of"),reference_organ:dn("has_reference_organ"),extraction_set_for:dn("extraction_set_for"),extraction_set:dn("has_extraction_set"),sex:dn("organ_owner_sex"),side:dn("organ_side"),rui_rank:dn("rui_rank"),slice_thickness:dn("slice_thickness"),slice_count:dn("slice_count"),x_dimension:dn("x_dimension"),y_dimension:dn("y_dimension"),z_dimension:dn("z_dimension"),dimension_units:dn("dimension_unit"),object:dn("has_object_reference")},spatialPlacement:{source:dn("placement_for"),target:dn("placement_relative_to"),placement_date:ir("dcterms")("created"),x_scaling:dn("x_scaling"),y_scaling:dn("y_scaling"),z_scaling:dn("z_scaling"),scaling_units:dn("scaling_unit"),x_rotation:dn("x_rotation"),y_rotation:dn("y_rotation"),z_rotation:dn("z_rotation"),w_rotation:dn("theta_rotation"),rotation_order:dn("rotation_order"),rotation_units:dn("rotation_unit"),x_translation:dn("x_translation"),y_translation:dn("y_translation"),z_translation:dn("z_translation"),translation_units:dn("translation_unit")}},di={x:ir("uberon"),body:ir("uberon")("0013702")},NPe={x:ir("cl"),cell:ir("cl")("0000000")},Zb={x:ir("fma")},vd=(ir("lmha"),{body:di.body,cell:NPe.cell,respiratory_system:di.x("0001004"),colon:di.x("0001155"),left_lung:di.x("0002168"),right_lung:di.x("0002167"),left_bronchus:di.x("0002178"),right_bronchus:di.x("0002177"),kidney:di.x("0002113"),ureter:di.x("0000056"),eye:di.x("0000970"),fallopian_tube:di.x("0003889"),knee:di.x("0001465"),ovary:di.x("0000992"),trachea:di.x("0003126"),aorta:di.x("0000947"),blood:di.x("0000178"),bone_marrow:di.x("0002371"),male_reproductive_system:di.x("0000079"),lymph_node:di.x("0000029"),blood_vasculature:di.x("0004537"),brain:di.x("0000955"),eye_left:di.x("0004548"),eye_right:Zb.x("54449"),fallopian_tube_left:di.x("0001303"),fallopian_tube_right:di.x("0001302"),heart:di.x("0000948"),kidney_left:di.x("0004538"),kidney_right:di.x("0004539"),knee_left:Zb.x("24978"),knee_right:Zb.x("24977"),large_intestine:di.x("0000059"),liver:di.x("0002107"),lungs:di.x("0002048"),mesenteric_lymph_node:di.x("0002509"),ovary_left:Zb.x("7214"),ovary_right:Zb.x("7213"),pancreas:di.x("0001264"),pelvis:di.x("0001270"),prostate_gland:di.x("0002367"),skin:di.x("0002097"),small_intestine:di.x("0002108"),spleen:di.x("0002106"),thymus:di.x("0002370"),ureter_left:di.x("0001223"),ureter_right:di.x("0001222"),urinary_bladder:di.x("0001255"),uterus:di.x("0000995")});function zk(n){const e={};return Object.entries(n).forEach(([t,i])=>{e[i.id]=t}),e}const p1={spatialObjectReference:zk(ki.spatialObjectReference),spatialEntity:zk(ki.spatialEntity),spatialPlacement:zk(ki.spatialPlacement)};function z9(n,e){const t=dp(n,e,"ExtractionSet",p1.spatialEntity);return t.extractionSites=(0,mr.sortBy)(n.getSubjects(ki.spatialEntity.extraction_set,e,null).map(i=>hp(n,i.id)),["rui_rank"]),t}function hp(n,e){const t=dp(n,e,"SpatialEntity",p1.spatialEntity);return t.object&&(t.object=function(n,e){return dp(n,e,"SpatialObjectReference",p1.spatialObjectReference)}(n,t.object)),t.ccf_annotations&&(t.ccf_annotations=n.getObjects(e,ki.spatialEntity.ccf_annotations,null).map(i=>i.id)),n.forSubjects(i=>t.entityId=i.id,vi.spatialEntity,e,null),t}function VPe(n,e){const t=dp(n,e,"SpatialPlacement",p1.spatialPlacement);return t.source&&(t.source=hp(n,t.source)),t.target&&(t.target=hp(n,t.target)),t}function H9(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(_j),o=[t.x_scaling,t.y_scaling,t.z_scaling];return n.translate(r).rotateXYZ(s).scale(o)}class G9{constructor(e){this.db=e,this.createGraph()}createGraph(){this.graph=new ERe.DirectedGraph;const e=this.db.store;e.forSubjects(i=>{this.addNode(i.id,"SpatialObjectReference")},U9.type,ki.SpatialObjectReference,null),e.forSubjects(i=>{this.addNode(i.id,"SpatialEntity")},U9.type,ki.SpatialEntity,null);const t={};for(const i of(0,Un.readQuads)(e,null,ki.spatialPlacement.source,null,null))t[i.subject.id]=i.object.id;for(const i of(0,Un.readQuads)(e,null,ki.spatialPlacement.target,null,null)){const r=t[i.subject.id];r&&this.addEdge(i.subject.id,r,i.object.id,"SpatialPlacement")}}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 qn(qn.IDENTITY);if(!this.graph.hasNode(e)||!this.graph.hasNode(t))return;const i=this.db.store,r=new qn(qn.IDENTITY),s=SRe()(this.graph,e,t);if(s&&s.length>0){s.reverse();let o="";for(const a of s)o&&H9(r,VPe(i,this.graph.getEdgeAttribute(a,o,"id"))),o=a;return r}}getSpatialPlacement(e,t){const i=this.graph.hasNode(e["@id"])?e["@id"]:void 0,r=(0,mr.get)(e,"placement[0]",(0,mr.get)(e,"placement",void 0));let s;if(r&&this.graph.hasNode(r.target)?(s=this.getTransformationMatrix(r.target,t),s&&(s=H9(s,r))):i&&(s=this.getTransformationMatrix(i,t)),s){const o=(new Zi).fromRotationMatrix(s,Zi.XYZ),a=s.getTranslation().map(u=>1e3*u),l=o.toVector3().map(dse),c=s.getScale().map(u=>u<1&&u>.999999?1:u);return{"@context":"https://hubmapconsortium.github.io/hubmap-ontology/ccf-context.jsonld","@id":`http://purl.org/ccf/1.5/${PRe()}_placement`,"@type":"SpatialPlacement",source:e["@id"],target:t,placement_date:(new Date).toISOString().split("T")[0],x_scaling:c[0],y_scaling:c[1],z_scaling:c[2],scaling_units:"ratio",x_rotation:l[0],y_rotation:l[1],z_rotation:l[2],rotation_order:"XYZ",rotation_units:"degree",x_translation:a[0],y_translation:a[1],z_translation:a[2],translation_units:"millimeter"}}}}class $9{constructor(e){this.db=e}getSpatialEntity(e){return hp(this.db.store,e)}getExtractionSets(e){return function(n,e){return(0,mr.sortBy)(n.getSubjects(ki.spatialEntity.extraction_set_for,e,null).map(t=>z9(n,t.id)),["rui_rank"])}(this.db.store,e)}getExtractionSet(e){return z9(this.db.store,e)}getAnatomicalStructures(e){return function(n,e){return(0,mr.sortBy)(n.getSubjects(ki.spatialEntity.reference_organ,e,null).map(t=>hp(n,t.id)).filter(t=>t["@id"]!==e),["rui_rank"])}(this.db.store,e)}getReferenceOrgans(){return function(n){const e=[];return n.forEach(t=>{t.subject.id===t.object.id&&e.push(hp(n,t.subject.id))},null,ki.spatialEntity.reference_organ,null,null),(0,mr.sortBy)(e,["rui_rank"])}(this.db.store)}getReferenceBody(e){let t;switch(null==e?void 0:e.sex){case"Male":t=ki.spatial.Male.id;break;case"Female":t=ki.spatial.Female.id;break;case"Both":default:t=ki.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),i=[];let r=[...this.getReferenceOrganSets(e).map(s=>{const o="http://purl.obolibrary.org/obo/UBERON_0002097"===s.representation_of,a=this.getSceneNode(s,t,{color:[255,255,255,255],opacity:o?.5:.2,unpickable:!0,_lighting:"pbr",zoomBasedOpacity:!o});return o&&a?void i.push(a):a})];return i.length>0&&(r=[...i,...r]),(null==e?void 0:e.debug)&&(r=r.concat([this.getSceneNode(this.getSpatialEntity(ki.base("VHRightKidney").id),t,{color:[0,0,255,127.5],geometry:"wireframe"}),this.getSceneNode(this.getSpatialEntity(ki.base("VHLeftKidney").id),t,{color:[255,0,0,127.5],geometry:"wireframe"}),this.getSceneNode(this.getSpatialEntity(ki.base("VHSpleenCC1").id),t,{color:[0,255,0,127.5],geometry:"wireframe"}),this.getSceneNode(this.getSpatialEntity(ki.base("VHSpleenCC2").id),t,{color:[0,255,0,127.5],geometry:"wireframe"}),this.getSceneNode(this.getSpatialEntity(ki.base("VHSpleenCC3").id),t,{color:[0,255,0,127.5],geometry:"wireframe"})])),r.filter(s=>void 0!==s)}getReferenceOrganScene(e,t){var i,r;const s=void 0!==(null==t?void 0:t.sex)&&"both"!==(null===(i=null==t?void 0:t.sex)||void 0===i?void 0:i.toLowerCase()),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"}),u=(null!==(r=this.db.getSpatialEntities(t))&&void 0!==r?r:[]).map(h=>this.getSceneNode(h,a,{color:[255,255,255,229.5]}));return[c].concat(u).filter(h=>void 0!==h)}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 u=this.db.graph.getTransformationMatrix(l&&e.object?e.object["@id"]:e["@id"],t["@id"]);if(u){if(l)u=new qn(qn.IDENTITY).rotateX(_j(90)).multiplyLeft(u);else{let h;switch(e.dimension_units){case"centimeter":h=.01;break;case"millimeter":h=.001;break;case"meter":default:h=1}const f=[e.x_dimension,e.y_dimension,e.z_dimension].map(g=>g*h/2);u.scale(f)}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:u,tooltip:e.label},i)}}getScene(e){return[...this.getReferenceSceneNodes(e),...this.getEntitySceneNodes(e)]}}const g1="https://entity.api.hubmapconsortium.org/entities/",W9=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"]),UPe={"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"},qm={"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","5c106f29-ea2d-11e9-85e8-0efb3ba9a670":"RTI-General Electric","301615f9-c870-11eb-a8dc-35ce3d8786fe":"TMC-UConn"},q9={"@base":"http://purl.org/ccf/latest/ccf-entity.owl#","@vocab":"http://purl.org/ccf/latest/ccf-entity.owl#",ccf:"http://purl.org/ccf/",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"},cellTypeTerms:{"@id":"has_cell_type_term","@type":"@id"},thumbnail:{"@id":"has_thumbnail"}};class GPe{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||[],u=(this.data.ancestors||[]).find(Ne=>"Donor"===Ne.entity_type);this.donor=this.getDonor(u,i);const h=this.getRuiLocation(e,this.donor);h?this.rui_location=h:this.bad=!0,qm[e.group_uuid]||(qm[e.group_uuid]=e.group_name);const f=new Date(e.last_modified_timestamp).toLocaleDateString(),g=qm[e.group_uuid]||e.group_name,m=e.created_by_user_displayname;this["@id"]=g1+e.uuid,this.label=`Registered ${f}, ${m}, ${g}`,this.link=`${i}browse/sample/${e.uuid}`;const w={},x=[];this.sections=x;const U=[];this.datasets=U;for(const Ne of c.filter(Ve=>"Sample"===Ve.entity_type)){const Ve=this.getSection(Ne,e,i);w[Ne.submission_id]=Ve,x.push(Ve),Ve.section_number=null!==(s=Ve.section_number)&&void 0!==s?s:x.length}for(const Ne of c)if("Dataset"===Ne.entity_type){const Ve=this.getDataset(Ne,t,i,r),bt=(0,mr.get)(Ne,["ingest_metadata","metadata","tissue_id"]);w[bt]?null===(o=w[bt].datasets)||void 0===o||o.push(Ve):U.push(Ve)}const D=null!=h?h:{},ie=`${D.x_dimension} x ${D.y_dimension} x ${D.z_dimension} ${D.dimension_units}`;this.section_count=D.slice_count||x.length;const _e=parseFloat((D.slice_thickness||(D.z_dimension||0)/Math.max(this.section_count,1)).toFixed(1));this.section_size=_e;const Pe=D.dimension_units||"millimeter";this.section_units=Pe,this.description=`${ie}, ${_e} ${Pe}, ${e.specimen_type}, ${this.section_count} Sections`,x.forEach((Ne,Ve)=>{Ne.description=`${D.x_dimension} x ${D.y_dimension} x ${_e} ${Pe}, ${_e} ${Pe}, ${Ne.description}`,Ne.section_number=Ve+1})}getSection(e,t,i){const r=new Date(e.last_modified_timestamp).toLocaleDateString();return{"@id":g1+e.uuid,"@type":"Sample",label:`Registered ${r}, ${e.created_by_user_displayname}, ${qm[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=qm[e.group_uuid]||e.group_name,l=e.created_by_user_displayname,c=[...e.data_types,(0,mr.get)(e,["ingest_metadata","metadata","assay_type"],"")],u=c.join("|").toLowerCase();let h,f="assets/icons/ico-unknown.svg";return-1!==u.indexOf("10x")?(h="10x",f="assets/icons/ico-bulk-10x.svg"):-1!==u.indexOf("af")?(h="AF",f="assets/icons/ico-spatial-af.svg"):-1!==u.indexOf("codex")?(h="CODEX",f="assets/icons/ico-spatial-codex.svg"):-1!==u.indexOf("imc")?(h="IMC",f="assets/icons/ico-spatial-imc.svg"):-1!==u.indexOf("lc")&&-1===u.indexOf("af")?(h="LC",f="assets/icons/ico-bulk-lc.svg"):h=-1!==u.indexOf("maldi")?"MALDI":-1!==u.indexOf("pas")?"PAS":"OTHER",f=null!==(s=this.getDatasetThumbnail(e,t,r))&&void 0!==s?s:f,{"@id":g1+e.uuid,"@type":"Dataset",label:`Registered ${o}, ${l}, ${a}`,description:`Data/Assay Types: ${c.join(", ")}`,link:`${i}browse/dataset/${e.uuid}`,technology:h,thumbnail:f}}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,mr.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=>W9.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(W9.has(s))return`assets/thumbnails/TMC-Vanderbilt/DR1/${s}`}}else if("07a29e4c-ed43-11e8-b56a-0e8017bdda58"===e.group_uuid){const r=UPe[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,mr.toNumber)(s[1]));for(const f of(0,mr.get)(e,"metadata.organ_donor_data",(0,mr.get)(e,"metadata.living_donor_data",[])))"Feminine gender"===f.preferred_term||"Female"===f.preferred_term?r="Female":"Masculine gender"===f.preferred_term||"Male"===f.preferred_term?r="Male":"Current chronological age"===f.preferred_term||"Age"===f.preferred_term?o=(0,mr.toNumber)(f.data_value):"Body mass index"===f.preferred_term&&(a=(0,mr.toNumber)(f.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(),u=qm[e.group_uuid]||e.group_name;return{"@id":g1+e.uuid,"@type":"Donor",label:l,description:`Entered ${c}, ${e.created_by_user_displayname}, ${u}`,link:`${t}browse/donor/${e.uuid}`,age:o,sex:r,bmi:a,consortium_name:"HuBMAP",provider_name:u,provider_uuid:e.group_uuid,samples:[]}}getRuiLocation(e,t){var i;let r,s=e.rui_location;if(s&&("string"==typeof s&&(s=JSON.parse(s)),s.alignment_id?console.log("Detected a deprecated rui_location",e.uuid):s["@id"]&&(r=s)),r){const o=null!==(i=(0,mr.get)(r,["placement","target"]))&&void 0!==i?i:"";o.startsWith("http://purl.org/ccf/latest/ccf.owl#VHSpleenCC")?(0,mr.set)(r,["placement","target"],o.replace("#VHSpleenCC","Male"===t.sex?"#VHMSpleenCC":"#VHFSpleenCC")):("http://purl.org/ccf/latest/ccf.owl#VHLeftKidney"===o||"http://purl.org/ccf/latest/ccf.owl#VHRightKidney"===o)&&(0,mr.set)(r,["placement","target"],"Male"===t.sex?o.replace("#VH","#VHM")+"_Patch":o.replace("#VH","#VHF")+"_Patch")}return r}getTissueBlock(){return(0,mr.omit)(Object.assign({},this),["data","bad","donor"])}toJsonLd(){return Object.assign(Object.assign({},this.donor),{samples:[this.getTissueBlock()]})}}const WPe=["uuid","entity_type","group_uuid","group_name","last_modified_timestamp","created_by_user_displayname","ancestors.entity_type","ancestors.description","ancestors.metadata.organ_donor_data.preferred_term","ancestors.metadata.organ_donor_data.data_value","ancestors.metadata.living_donor_data.preferred_term","ancestors.metadata.living_donor_data.data_value","ancestors.last_modified_timestamp","ancestors.group_uuid","ancestors.group_name","ancestors.created_by_user_displayname","ancestors.uuid","descendants.entity_type","descendants.ingest_metadata.metadata.tissue_id","descendants.last_modified_timestamp","descendants.group_uuid","descendants.group_name","descendants.created_by_user_displayname","descendants.uuid","descendants.data_types","descendants.ingest_metadata.metadata.assay_type","descendants.thumbnail_file","descendants.metadata.files.rel_path","rui_location","specimen_type"],qPe={exists:{field:"rui_location"}};function Y9(n,e,t){return JSON.stringify({version:!0,from:n,size:e,stored_fields:["*"],script_fields:{},docvalue_fields:[],query:null!=t?t:qPe,_source:{includes:WPe}})}function Hk(n,e){return Bi(this,void 0,void 0,function*(){try{const t=yield fetch(n,e);return t.ok?yield t.json():void 0}catch(t){return}})}function X9(n,e,t,i,r="",s=""){return Bi(this,void 0,void 0,function*(){let o;if("static"===e?o=yield Hk(n):"search-api"===e&&(o=yield function(n,e,t){return Bi(this,void 0,void 0,function*(){const i=250,r=function(n){const e=new Headers;return e.append("Content-type","application/json"),n&&e.append("Authorization",`Bearer ${n}`),e}(e),s=Y9(0,i,t),o=yield Hk(n,{method:"POST",headers:r,body:s});if(!o)return;const a=o.hits.total.value;if(a<=i)return o;const l=[];for(let h=i;h!h))return;const u=c.map(h=>h.hits.hits);return Object.assign(Object.assign({},o),{hits:Object.assign(Object.assign({},o.hits),{hits:o.hits.hits.concat(...u)})})})}(n,i,t)),o)return function(n,e="",t="",i,r=!1){const o={},a=(0,mr.get)(n,"hits.hits",[]).map(c=>(0,mr.get)(c,"_source",{})).sort((c,u)=>c.uuid.localeCompare(u.uuid)).map(c=>new GPe(c,e,t,i).toJsonLd());for(const c of a){const u=c["@id"];o[u]?o[u].samples.push(c.samples[0]):o[u]=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":q9},c)))),{"@context":q9,"@graph":l}}(o,r,s,i);console.warn(`Unable to load ${n} as HuBMAP Data`)})}function Jb(n,e,t){const i=new Set;for(const r of e)for(const s of(0,Un.readQuads)(n,r,t,null,null))i.add(s.object.id);return i}const JPe={[ki.spatialEntity.x_dimension.id]:"x",[ki.spatialEntity.y_dimension.id]:"y",[ki.spatialEntity.z_dimension.id]:"z"};function tNe(n,e,t,i){const r=e.getTransformationMatrix(t,i);let s;if(r){const o=r.getTranslation(),a=function(n,e){const t=dp(n,e,"Dimensions",JPe);return[t.x,t.y,t.z]}(n,t).map(c=>c/1e3/2),l=(new Zi).fromRotationMatrix(r,Zi.XYZ).toQuaternion().normalize().calculateW();s=(new Nk).fromCenterHalfSizeQuaternion(o,a,l)}return s}function nNe(n,e,t,i){const{x:r,y:s,z:o,radius:a,target:l}=i,c=new Set,u=a/1e3*(a/1e3);for(const h of t){const f=tNe(n,e,h,l);f&&f.distanceSquaredTo([r,s,o].map(m=>m/1e3))<=u&&c.add(h)}return c}function m1(n,e,t){var i,r;const s=new Map,o=new Set;for(const c of e)for(const u of(0,Un.readQuads)(n,c,vi.donor,null,null))o.add(u.object.id),s.has(u.object.id)?null===(i=s.get(u.object.id))||void 0===i||i.push(c):s.set(u.object.id,[c]);const a=t(o),l=new Set;for(const c of a)for(const u of null!==(r=s.get(c))&&void 0!==r?r:[])l.add(u);return l}function Gk(n,e,t){var i,r;const s=new Map,o=new Set;for(const c of e)for(const u of(0,Un.readQuads)(n,c,vi.spatialEntity,null,null))o.add(u.object.id),s.has(u.object.id)?null===(i=s.get(u.object.id))||void 0===i||i.push(c):s.set(u.object.id,[c]);const a=t(o),l=new Set;for(const c of a)for(const u of null!==(r=s.get(c))&&void 0!==r?r:[])l.add(u);return l}function ev(n,e){return function(t){n.has(t.id)&&e.add(t.id)}}function K9(n,e,t){const i=new Set;for(const r of t){const s=Un.DataFactory.namedNode(r);n.forSubjects(ev(e,i),ki.spatialEntity.ccf_annotations,s,null)}return i}function Q9(n,e){const t=function(n,e){const t=new Map;for(const i of n)for(const r of(0,Un.readQuads)(e,i,vi.spatialEntity,null,null))t.has(r.object.id)?t.get(r.object.id).add(i):t.set(r.object.id,new Set([i]));return t}(n,e),i=new Map;for(const r of t.keys()){const s=t.get(r);for(const o of(0,Un.readQuads)(e,r,ki.spatialEntity.ccf_annotations,null,null))if(i.has(o.object.id)){const a=i.get(o.object.id);s.forEach(l=>a.add(l))}else i.set(o.object.id,new Set(s))}return i}function _Ne(n,e,t){const i={"@id":e,"@type":"OntologyTreeNode",id:e,parent:"",children:[],synonymLabels:[],label:""},r={[ki.ontologyNode.label.id]:"label",[t]:"parent",[ki.ontologyNode.synonymLabels.id]:"synonymLabels"};for(const[s,o]of Uk(n,e,r))"synonymLabels"===s?i.synonymLabels.push(o):i[s]=o;return i.children=n.getSubjects(t,e,null).map(s=>s.id),i}function Z9(n,e,t,i){const r={root:e,nodes:{}},s=new Set;for(const a of(0,Un.readQuads)(n,null,i,null,null))s.add(a.subject.id),s.add(a.object.id);for(const a of s)r.nodes[a]=_Ne(n,a,i);r.nodes[e]||(r.nodes[e]={"@id":e,"@type":"OntologyTreeNode",id:e,label:t,children:[],synonymLabels:[]});const o=n.getSubjects(i,e,null).map(a=>a.id).sort((a,l)=>r.nodes[a].label.localeCompare(r.nodes[l].label));return r.nodes[e].children=o,J9(r),r}function J9(n,e,t=new Set){const i=n.nodes[null!=e?e:n.root];if(i){i.children=i.children.filter(r=>!t.has(r)),i.children.forEach(r=>t.add(r));for(const r of i.children)J9(n,r,t),n.nodes[r]&&(n.nodes[r].parent=i["@id"])}}const eq=(0,mr.memoize)(function(n){const e=Z9(n,vd.body.id,"body",ki.asctb.part_of.id);return e.nodes[vd.body.id].children=["http://purl.obolibrary.org/obo/UBERON_0000955","http://purl.obolibrary.org/obo/UBERON_0000029","http://purl.obolibrary.org/obo/UBERON_0000970","http://purl.obolibrary.org/obo/UBERON_0003889","http://purl.obolibrary.org/obo/UBERON_0000948","http://purl.obolibrary.org/obo/UBERON_0002113","http://purl.obolibrary.org/obo/UBERON_0001465","http://purl.obolibrary.org/obo/UBERON_0002107","http://purl.obolibrary.org/obo/UBERON_0002048","http://purl.obolibrary.org/obo/UBERON_0001911","http://purl.obolibrary.org/obo/UBERON_0000992","http://purl.obolibrary.org/obo/UBERON_0001264","http://purl.obolibrary.org/obo/UBERON_0001270","http://purl.obolibrary.org/obo/UBERON_0001987","http://purl.obolibrary.org/obo/UBERON_0002367","http://purl.obolibrary.org/obo/UBERON_0002097","http://purl.obolibrary.org/obo/UBERON_0002108","http://purl.obolibrary.org/obo/UBERON_0002240","http://purl.obolibrary.org/obo/UBERON_0000059","http://purl.obolibrary.org/obo/UBERON_0002106","http://purl.obolibrary.org/obo/UBERON_0002370","http://purl.obolibrary.org/obo/UBERON_0000056","http://purl.obolibrary.org/obo/UBERON_0001255","http://purl.obolibrary.org/obo/UBERON_0000995","http://purl.obolibrary.org/obo/UBERON_0004537"].filter(t=>t in e.nodes),e},()=>""),_1={[vi.label.id]:"label",[vi.description.id]:"description",[vi.link.id]:"link"},vNe=Object.assign(Object.assign({},_1),{[vi.providerName.id]:"providerName"}),wNe=Object.assign(Object.assign({},_1),{[vi.technology.id]:"technology",[vi.thumbnail.id]:"thumbnail"}),ENe=Object.assign(Object.assign({},_1),{[vi.sampleType.id]:"sampleType",[vi.sectionNumber.id]:"sectionNumber",[vi.datasets.id]:"datasets"}),xNe=Object.assign(Object.assign({},_1),{[vi.sampleType.id]:"sampleType",[vi.sectionCount.id]:"sectionCount",[vi.sectionSize.id]:"sectionSize",[vi.sectionUnits.id]:"sectionUnits",[vi.donor.id]:"donor",[vi.spatialEntity.id]:"spatialEntityId",[vi.sections.id]:"sections",[vi.datasets.id]:"datasets"});function SNe(n,e){return dp(n,e,"Donor",vNe)}function tq(n,e){return dp(n,e,"Dataset",wNe)}function CNe(n,e){const t={"@id":e,"@type":"Sample",datasets:[]};for(const[i,r]of Uk(n,e,ENe))if("datasets"===i){const s=tq(n,r);t[i].push(s)}else t[i]=r;return t}class ANe{constructor(e){this.database=e,this.connect()}toJson(){return{status:this.status,message:this.message,checkback:"Ready"===this.status||"Error"===this.status?36e5:2e3,loadTime:this.loadTime}}connect(){this.status="Loading",this.message="Loading database";const e=Date.now();return this.database.connect().then(t=>Bi(this,void 0,void 0,function*(){t?(this.message="Building scene",yield this.database.getScene(),this.message="Building tissue block results",yield this.database.getTissueBlockResults(),this.message="Aggregating results",yield this.database.getAggregateResults(),this.status="Ready",this.message="Database successfully loaded"):(this.status="Error",this.message="Unknown error while loading database")})).catch(t=>{var i;this.status="Error",this.message=null!==(i=null==t?void 0:t.message)&&void 0!==i?i:"Unknown error while loading database"}).finally(()=>{this.loadTime=Date.now()-e})}}const MNe={"@context":{"@base":"http://purl.org/ccf/","@vocab":"http://purl.org/ccf/",ccf:"http://purl.org/ccf/",rdfs:"http://www.w3.org/2000/01/rdf-schema#",dcterms:"http://purl.org/dc/terms/",label:"rdfs:label",description:"rdfs:comment",link:"ccf:url",sex:"ccf:sex",age:"ccf:age",bmi:"ccf:bmi",consortium_name:"ccf:consortium_name",provider_name:"ccf:tissue_provider_name",provider_uuid:"ccf:tissue_provider_uuid",donor:{"@id":"ccf:comes_from","@type":"@id"},samples:{"@reverse":"donor"},sections:{"@id":"ccf:subdivided_into_sections","@type":"@id"},datasets:{"@id":"ccf:generates_dataset","@type":"@id"},sample_type:"ccf:sample_type",section_count:"ccf:section_count",section_size:"ccf:section_size",section_units:"ccf:section_size_unit",section_number:"ccf:section_number",rui_location:{"@id":"ccf:has_registration_location","@type":"@id"},ccf_annotations:{"@id":"ccf:collides_with","@type":"@id","@container":"@set"},representation_of:{"@id":"ccf:representation_of","@type":"@id"},reference_organ:{"@id":"ccf:has_reference_organ","@type":"@id"},extraction_set_for:{"@id":"ccf:extraction_set_for","@type":"@id"},extraction_set:{"@id":"ccf:has_extraction_set","@type":"@id"},organ_owner_sex:"ccf:organ_owner_sex",side:"ccf:organ_side",rui_rank:"ccf:rui_rank",slice_thickness:"ccf:slice_thickness",slice_count:"ccf:slice_count",object:{"@id":"ccf:has_object_reference","@type":"@id"},creation_date:"dcterms:created",updated_date:"ccf:updated_date",creator:"dcterms:creator",creator_first_name:"ccf:creator_first_name",creator_last_name:"ccf:creator_last_name",placement:{"@reverse":"ccf:placement_for"},placement_date:"dcterms:created",rotation_order:"ccf:rotation_order",dimension_units:"ccf:dimension_unit",rotation_units:"ccf:rotation_unit",scaling_units:"ccf:scaling_unit",translation_units:"ccf:translation_unit",source:{"@id":"ccf:placement_for","@type":"@id"},target:{"@id":"ccf:placement_relative_to","@type":"@id"},x_rotation:"ccf:x_rotation",y_rotation:"ccf:y_rotation",z_rotation:"ccf:z_rotation",x_scaling:"ccf:x_scaling",y_scaling:"ccf:y_scaling",z_scaling:"ccf:z_scaling",x_translation:"ccf:x_translation",y_translation:"ccf:y_translation",z_translation:"ccf:z_translation",x_dimension:"ccf:x_dimension",y_dimension:"ccf:y_dimension",z_dimension:"ccf:z_dimension",ontology_terms:{"@id":"ccf:has_ontology_term","@type":"@id"},technology:"ccf:technology",thumbnail:"ccf:thumbnail",file:"ccf:file_url",file_format:"ccf:file_format",file_subpath:"ccf:file_subpath"}};function $k(n){return JSON.parse(n,(e,t)=>"ccf_annotations"===e&&Array.isArray(t)?t.map(i=>(null==i?void 0:i.startsWith("http://purl.obolibrary.org/obo/FMA_"))?i.replace("http://purl.obolibrary.org/obo/FMA_","http://purl.org/sig/ont/fma/fma"):i):"@context"!==e||!t||"https://hubmapconsortium.github.io/hubmap-ontology/ccf-entity-context.jsonld"!==t&&"https://hubmapconsortium.github.io/hubmap-ontology/ccf-context.jsonld"!==t&&"https://hubmapconsortium.github.io/ccf-ontology/ccf-context.jsonld"!==t&&"http://purl.org/ccf/latest/ccf-entity.owl#"!==t["@base"]?t:MNe)}const INe={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 ONe{constructor(e=INe){this.options=e,this.store=new Un.Store(void 0,{factory:Un.DataFactory}),this.graph=new G9(this),this.scene=new $9(this)}connect(e,t=!1){return Bi(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 Bi(this,void 0,void 0,function*(){const e=(new Date).getTime(),t="ccf-database.last_modified",i="ccf-database",r=yield A9(t).catch(()=>{});let s;r&&e-new Date(+r).getTime()>36e5?yield function(n,e=Cc()){return e("readwrite",t=>(n.forEach(i=>t.delete(i)),vu(t.transaction)))}([i,t]).catch(()=>{}):s=yield A9(i).catch(()=>{}),s?yield this.deserialize(s):(yield this.doConnect(),function(n,e=Cc()){return e("readwrite",t=>(n.forEach(i=>t.put(i[1],i[0])),vu(t.transaction)))}([[i,this.serialize()],[t,""+e]]).catch(()=>{}))})}doConnect(){var e,t;return Bi(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.startsWith("{"))this.store=(0,Un.deserializeN3Store)(s,Un.DataFactory);else 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,Un.deserializeN3Store)(o,Un.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(X9(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 Bi(this,void 0,void 0,function*(){const i=null!=t?t:this.store;return yield Promise.all(e.map(r=>Bi(this,void 0,void 0,function*(){"string"==typeof r?(r.startsWith("http")||r.startsWith("assets/"))&&r.includes("jsonld")?(r=$k(r=yield fetch(r).then(s=>s.text())),yield(0,Un.addJsonLdToStore)(r,i)):r.endsWith("n3")?yield(0,Un.addN3ToStore)(r,i):r.endsWith("rdf")||r.endsWith("owl")||r.endsWith("xml")?yield(0,Un.addRdfXmlToStore)(r,i):(r=$k(r),yield(0,Un.addJsonLdToStore)(r,i)):(r=$k(JSON.stringify(r)),yield(0,Un.addJsonLdToStore)(r,i))}))),this})}synchronize(){return Bi(this,void 0,void 0,function*(){return yield new Promise(e=>{setTimeout(e,500)}),this.graph.createGraph(),function(n){var e,t,i;const r=eq(n),s=new Map;for(const{subject:o,object:a}of(0,Un.readQuads)(n,null,ki.spatialEntity.representation_of,null,null)){const l=new Set([a.id]);let c=null===(e=r.nodes[a.id])||void 0===e?void 0:e.parent;for(;c&&!l.has(c);)l.add(c),c=null===(t=r.nodes[c])||void 0===t?void 0:t.parent;s.set(o.id,[...l].map(u=>Un.DataFactory.namedNode(u)))}for(const{object:o}of(0,Un.readQuads)(n,null,vi.spatialEntity,null,null))for(const{subject:a}of(0,Un.readQuads)(n,null,ki.spatialPlacement.source,o,null))for(const{object:l}of(0,Un.readQuads)(n,a,ki.spatialPlacement.target,null,null))for(const c of null!==(i=s.get(l.id))&&void 0!==i?i:[])n.addQuad(Un.DataFactory.namedNode(o.id),ki.spatialEntity.ccf_annotations,c)}(this.store),this})}serialize(){return(0,Un.serializeN3Store)(this.store)}deserialize(e){return Bi(this,void 0,void 0,function*(){this.store=(0,Un.deserializeN3Store)(e,Un.DataFactory),this.graph=new G9(this),this.scene=new $9(this),yield new Promise(t=>{setTimeout(t,10)})})}getIds(e={}){return function(n,e,t){var i,r,s,o,a,l,c;let u=function(n){const e=new Set;return n.forSubjects(t=>e.add(t.id),vi.spatialEntity,null,null),e}(n);if(u.size>0&&(u=function(n,e,t=!0){const i=new Set;if(n.forSubjects(ev(e,i),vi.spatialEntity,null,null),!t){const r=new Set;return e.forEach(s=>i.has(s)?void 0:r.add(s)),r}return i}(n,u)),u.size>0&&("Male"===t.sex||"Female"===t.sex)){const h=t.sex;u=m1(n,u,f=>function(n,e,t){const i=new Set;return n.forSubjects(ev(e,i),vi.sex,vi[t],null),i}(n,f,h))}if(u.size>0&&(null===(i=t.tmc)||void 0===i?void 0:i.length)>0&&(u=m1(n,u,h=>function(n,e,t){const i=new Set;for(const r of t){const s=Un.DataFactory.literal(r);n.forSubjects(ev(e,i),vi.providerName,s,null)}return i}(n,h,t.tmc))),u.size>0&&(null===(r=t.technologies)||void 0===r?void 0:r.length)>0&&(u=function(n,e,t){var i,r;const s=new Map,o=new Set,a=new Set(e);for(const u of e)for(const h of(0,Un.readQuads)(n,u,vi.sections,null,null))a.add(h.object.id);for(const u of a)for(const h of(0,Un.readQuads)(n,u,vi.datasets,null,null))o.add(h.object.id),s.has(h.object.id)?null===(i=s.get(h.object.id))||void 0===i||i.push(u):s.set(h.object.id,[u]);const l=t(o),c=new Set;for(const u of l)for(const h of null!==(r=s.get(u))&&void 0!==r?r:[])c.add(h);return c}(n,u,h=>function(n,e,t){const i=new Set;for(const r of t){const s=Un.DataFactory.literal(r);n.forSubjects(ev(e,i),vi.technology,s,null)}return i}(n,h,t.technologies))),u.size>0&&(null===(s=t.spatialSearches)||void 0===s?void 0:s.length)>0&&(u=Gk(n,u,h=>function(n,e,t,i){const r=new Set;for(const s of i)nNe(n,e,t,s).forEach(a=>r.add(a));return r}(n,e,h,t.spatialSearches))),u.size>0&&(null===(o=t.ontologyTerms)||void 0===o?void 0:o.length)>0){const h=t.ontologyTerms;-1===h.indexOf(vd.body.id)&&(u=Gk(n,u,f=>K9(n,f,h)))}if(u.size>0&&(null===(a=t.cellTypeTerms)||void 0===a?void 0:a.length)>0){const h=t.cellTypeTerms;-1===h.indexOf(vd.cell.id)&&(u=Gk(n,u,f=>function(n,e,t){const i=new Set;for(const r of t)n.forObjects(s=>{i.add(s.id)},r,ki.asctb.located_in,null),r===vd.cell.id&&i.add(vd.body.id);return K9(n,e,[...i])}(n,f,h)))}if(u.size>0&&2===(null===(l=t.ageRange)||void 0===l?void 0:l.length)&&(0,mr.isFinite)(t.ageRange[0])&&(0,mr.isFinite)(t.ageRange[1])){const h=Math.max(...t.ageRange),f=Math.min(...t.ageRange);1===f&&110===h||(u=m1(n,u,g=>function(n,e,t,i){const r=new Set;for(const s of e)for(const o of(0,Un.readQuads)(n,s,vi.age,null,null)){const a=(0,c1.fromRdf)(o.object);a>=t&&a<=i&&r.add(s)}return r}(n,g,f,h)))}if(u.size>0&&2===(null===(c=t.bmiRange)||void 0===c?void 0:c.length)&&(0,mr.isFinite)(t.bmiRange[0])&&(0,mr.isFinite)(t.bmiRange[1])){const h=Math.max(...t.bmiRange),f=Math.min(...t.bmiRange);13===f&&83===h||(u=m1(n,u,g=>function(n,e,t,i){const r=new Set;for(const s of e)for(const o of(0,Un.readQuads)(n,s,vi.bmi,null,null)){const a=(0,c1.fromRdf)(o.object);a>=t&&a<=i&&r.add(s)}return r}(n,g,f,h)))}return u}(this.store,this.graph,e)}get(e){return this.store.getQuads(Un.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=>function(n,e){const t=n.getObjects(Un.DataFactory.namedNode(e),vi.spatialEntity,null);if(t.length>0)return hp(n,t[0].id)}(this.store,t))}getDatabaseStatus(){return Bi(this,void 0,void 0,function*(){return this.status||(this.status=new ANe(this)),this.status.toJson()})}getDatasetTechnologyNames(){return Bi(this,void 0,void 0,function*(){return function(n){const e=new Set;for(const t of(0,Un.readQuads)(n,null,vi.technology,null,null))e.add(t.object.value);return Array.from(e).sort()}(this.store)})}getProviderNames(){return Bi(this,void 0,void 0,function*(){return function(n){const e=new Set;for(const t of(0,Un.readQuads)(n,null,vi.providerName,null,null))e.add(t.object.value);return Array.from(e).sort()}(this.store)})}getTissueBlockResults(e){return Bi(this,void 0,void 0,function*(){return e=Object.assign(Object.assign({},e),{hasSpatialEntity:!0}),[...this.getIds(e)].map(t=>function(n,e){const t={"@id":e,"@type":"Sample",sections:[],datasets:[]};for(const[i,r]of Uk(n,e,xNe))if("sections"===i){const s=CNe(n,r);t[i].push(s)}else if("datasets"===i){const s=tq(n,r);t[i].push(s)}else t[i]="donor"===i?SNe(n,r):r;return t}(this.store,t))})}getAggregateResults(e){return Bi(this,void 0,void 0,function*(){return function(n,e){const t=Jb(e,n,vi.donor.id),i=Jb(e,t,vi.providerUUID.id),r=new Set;for(const l of n)for(const c of(0,Un.readQuads)(e,l,vi.spatialEntity,null,null))r.add(c.subject.id);const s=Jb(e,r,vi.sections.id),o=new Set([...Jb(e,r,vi.datasets.id),...Jb(e,s,vi.datasets.id)]);return 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 Bi(this,void 0,void 0,function*(){return function(n,e){const t={};return Q9(n,e).forEach((r,s)=>{t[s]=r.size}),t}(this.getIds(e),this.store)})}getCellTypeTermOccurences(e){return Bi(this,void 0,void 0,function*(){return function(n,e){var t,i;const r=Q9(n,e),s=new Map;for(const a of r.keys()){const l=r.get(a);for(const c of(0,Un.readQuads)(e,null,ki.asctb.located_in,a,null)){const u=c.subject.id;if(s.has(u)){const h=s.get(u);l.forEach(f=>h.add(f))}else s.set(u,new Set(l))}}const o={};return s.forEach((a,l)=>{o[l]=a.size}),o[vd.cell.id]=null!==(i=null===(t=r.get(vd.body.id))||void 0===t?void 0:t.size)&&void 0!==i?i:0,o}(this.getIds(e),this.store)})}getOntologyTreeModel(){return Bi(this,void 0,void 0,function*(){return eq(this.store)})}getCellTypeTreeModel(){return Bi(this,void 0,void 0,function*(){return function(n){return Z9(n,vd.cell.id,"cell",ki.asctb.ct_is_a.id)}(this.store)})}getReferenceOrgans(){return Bi(this,void 0,void 0,function*(){return this.scene.getReferenceOrgans()})}getScene(e){return Bi(this,void 0,void 0,function*(){return this.graph.createGraph(),this.scene.getScene(e)})}getReferenceOrganScene(e,t){return Bi(this,void 0,void 0,function*(){return this.graph.createGraph(),this.scene.getReferenceOrganScene(e,t)})}getSpatialPlacement(e,t){return Bi(this,void 0,void 0,function*(){return this.graph.getSpatialPlacement(e,t)})}}class nq extends Error{constructor(){super(...arguments),this.message="NgxsDispatchPluginModule is not imported"}}function NNe(){throw new nq}function kNe(){throw new nq}function Wk(n,e,t){e.run(()=>n.dispatch(t))}function BNe(n,e,t,i){return yg(t)?function(n,e,t){return t.then(i=>(Wk(n,e,i),i))}(n,e,t):Im(t)?function(n,e,t,i){return null!==i&&(t=t.pipe(gr(i.cancelUncompleted$))),t.subscribe({next:r=>Wk(n,e,r)}),t}(n,e,t,i):(Wk(n,e,t),t)}class VNe{constructor(){this.cancelUncompleted$=new oe}cancelPreviousAction(){this.cancelUncompleted$.next()}}const qk="\u0275fac",iq=Symbol("InjectorInstance"),rq=Symbol("FactoryHasBeenDecorated");function sq(n,e){const t=n[iq];return t?t.get(e):null}const zNe={cancelUncompleted:!1};function oq(n=zNe){return(e,t,i)=>{let r;const s=function(n){return n?new VNe:null}(n.cancelUncompleted);function o(){null!==s&&s.cancelPreviousAction();const a=sq(this,hu)||NNe(),l=sq(this,pn)||kNe(),c=r.apply(this,arguments);return l.runOutsideAngular(()=>BNe(a,l,c,s))}"function"==typeof(null==i?void 0:i.value)?(r=i.value,i.value=o):Object.defineProperty(e,t,{set:a=>r=a,get:()=>o}),function(n){if(rq in n.constructor.prototype)return;const e=n.constructor;"function"==typeof e[qk]&&function(n){const e=n[qk];if("function"!=typeof e)return;const t=n.\u0275prov||n.\u0275pipe||n.\u0275cmp||n.\u0275dir,i=()=>{const r=e();return r[iq]=Ce(Vu),r};t&&(t.factory=i),Object.defineProperty(n,qk,{get:()=>i})}(e),n.constructor.prototype[rq]=!0}(e)}}const mke=["bodyCanvas"];let _ke=(()=>{class n{constructor(){this.clsName="ccf-body-ui",this.rotationChange=new ln,this.nodeDrag=new ln,this.nodeClick=new ln,this.nodeHoverStart=new ln,this.nodeHoverStop=new ln,this.initialized=new ln,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 Bi(this,void 0,void 0,function*(){const i=this.bodyCanvas.nativeElement,r=new zve({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.target&&this.bodyUI.setTarget(this.target),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))],this.initialized.emit()})}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=rn({type:n,selectors:[["ccf-body-ui"]],viewQuery:function(t,i){if(1&t&&hr(mke,5,gn),2&t){let r;Gn(r=$n())&&(i.bodyCanvas=r.first)}},hostVars:2,hostBindings:function(t,i){2&t&&Va(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",initialized:"initialized"},decls:2,vars:0,consts:[[1,"body-ui"],["bodyCanvas",""]],template:function(t,i){1&t&&ni(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})(),yke=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=tn({type:n}),n.\u0275inj=St({imports:[[fr]]}),n})();new Ht("Maximum number of autocomplete options displayed",{providedIn:"root",factory:()=>10});const yq=[{src:"app:skin",organ:"Skin",name:"Skin",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002097"},{src:"app:brain",organ:"Brain",name:"Brain",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000955"},{disabled:!0,src:"app:lymph-nodes",organ:"Lymph Node",name:"Lymph Node",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000029"},{src:"app:lymph-nodes",organ:"Lymph Node",name:"Lymph Node",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002509"},{disabled:!0,src:"app:eye",organ:"Eye",name:"Eye, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000970"},{src:"app:eye",organ:"Eye",name:"Eye, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0004548"},{src:"app:eye",organ:"Eye",name:"Eye, R",side:"right",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0004549"},{disabled:!0,src:"app:fallopian-tube-left",organ:"Fallopian Tube",name:"Fallopian Tube, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0003889"},{src:"app:fallopian-tube-left",organ:"Fallopian Tube",name:"Fallopian Tube, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0001303"},{src:"app:fallopian-tube-right",organ:"Fallopian Tube",name:"Fallopian Tube, R",side:"right",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0001302"},{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, L",side:"left",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"},{disabled:!0,src:"app:knee",organ:"Knee",name:"Knee, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001465"},{src:"app:knee",organ:"Knee",name:"Knee, L",side:"left",hasSex:!0,id:"http://purl.org/sig/ont/fma/fma24978"},{src:"app:knee",organ:"Knee",name:"Knee, R",side:"right",hasSex:!0,id:"http://purl.org/sig/ont/fma/fma24977"},{src:"app:liver",organ:"Liver",name:"Liver",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002107"},{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"},{disabled:!0,src:"app:mammary-gland",organ:"Mammary Gland",name:"Mammary Gland, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0001911"},{src:"app:mammary-gland",organ:"Mammary Gland",name:"Mammary Gland, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.org/sig/ont/fma/fma57991"},{src:"app:mammary-gland",organ:"Mammary Gland",name:"Mammary Gland, R",side:"right",hasSex:!1,sex:"female",id:"http://purl.org/sig/ont/fma/fma57987"},{disabled:!0,src:"app:ovary-left",organ:"Ovary",name:"Ovary, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0000992"},{src:"app:ovary-left",organ:"Ovary",name:"Ovary, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.org/sig/ont/fma/fma7214"},{src:"app:ovary-right",organ:"Ovary",name:"Ovary, R",side:"right",hasSex:!1,sex:"female",id:"http://purl.org/sig/ont/fma/fma7213"},{src:"app:pancreas",organ:"Pancreas",name:"Pancreas",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001264"},{src:"app:pelvis-f",organ:"Pelvis",name:"Pelvis",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001270"},{src:"app:placenta",organ:"Placenta",name:"Placenta",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0001987"},{src:"app:prostate",organ:"Prostate",name:"Prostate",hasSex:!1,sex:"male",id:"http://purl.obolibrary.org/obo/UBERON_0002367",disabled:!0},{src:"app:prostate",organ:"Prostate",name:"Prostate",hasSex:!1,sex:"male",id:"http://purl.obolibrary.org/obo/UBERON_0000079"},{src:"app:small-intestine",organ:"Small Intestine",name:"Small Intestine",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002108"},{src:"app:large-intestine",organ:"Large Intestine",name:"Large Intestine",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000059"},{src:"app:spinal-cord",organ:"Spinal Cord",name:"Spinal Cord",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002240"},{src:"app:spleen",organ:"Spleen",name:"Spleen",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002106"},{src:"app:thymus",organ:"Thymus",name:"Thymus",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002370"},{disabled:!0,src:"app:ureter-left",organ:"Ureter",name:"Ureter, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000056"},{src:"app:ureter-left",organ:"Ureter",name:"Ureter, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001223"},{src:"app:ureter-right",organ:"Ureter",name:"Ureter, R",side:"right",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001222"},{src:"app:bladder",organ:"Urinary Bladder",name:"Urinary Bladder",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001255"},{src:"app:uterus",organ:"Uterus",name:"Uterus",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0000995"},{src:"app:vasculature-thick",organ:"Blood Vasculature",name:"Blood Vasculature",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0004537"},{disabled:!0,src:"app:vasculature-thick",organ:"Blood Vasculature",name:"Blood Vasculature",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002049"}].sort((n,e)=>n.name.localeCompare(e.name));function Lke(n,e){if(1&n&&(wt(0,"div",16),ni(1,"youtube-player",17),Et()),2&n){const t=_i(3);zt(1),dE("videoId",t.videoID)}}function Bke(n,e){if(1&n&&(wt(0,"mat-expansion-panel",11),wt(1,"mat-expansion-panel-header"),wt(2,"h2",12),Jn(3),Et(),Et(),wt(4,"div",13),ni(5,"markdown",14),wi(6,Lke,2,1,"div",15),Et(),Et()),2&n){const t=_i(),i=t.index,r=t.$implicit;Jt("expanded",0===i),zt(3),gs(r.title),zt(2),ai("first",0===i),Jt("data",r.content),zt(1),Jt("ngIf",0===i)}}function Vke(n,e){if(1&n&&(wt(0,"div",9),wi(1,Bke,7,6,"mat-expansion-panel",10),Et()),2&n){const t=e.$implicit;zt(1),Jt("ngIf",t)}}yq.filter(n=>!0!==n.disabled);let bq=(()=>{class n{constructor(t,i){this.dialogRef=t,this.data=i,this.documentationContents=i.content||[],this.infoTitle=i.title||"",this.videoID=i.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 n.\u0275fac=function(t){return new(t||n)(Ce(kC),Ce(PW))},n.\u0275cmp=rn({type:n,selectors:[["ccf-info-dialog"]],decls:11,vars:2,consts:[[1,"rui-about","wrapper"],[1,"container"],[1,"content"],[1,"header"],["mat-dialog-title","",1,"title"],[1,"close"],[1,"material-icons","close-icon",3,"click"],[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,i){1&t&&(wt(0,"div",0),wt(1,"div",1),wt(2,"div",2),wt(3,"div",3),wt(4,"h2",4),Jn(5),Et(),wt(6,"div",5),wt(7,"mat-icon",6),Tn("click",function(){return i.close()}),Jn(8,"clear"),Et(),Et(),Et(),wt(9,"mat-dialog-content",7),wi(10,Vke,2,1,"div",8),Et(),Et(),Et(),Et()),2&t&&(zt(5),gs(i.infoTitle),zt(5),Jt("ngForOf",i.documentationContents))},directives:[kW,Fm,FW,Yu,ac,UW,zW,WW,KW],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%] .content[_ngcontent-%COMP%] .header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;height:3rem;margin-bottom:2.25rem;position:relative}.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%]{cursor:pointer;height:3rem;width:3rem;line-height:3rem;text-align:center;transition:.6s}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-size:1.5rem;margin:0 auto;line-height:3rem;height:3rem;justify-self:center;display:flex}.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;display:flex}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .dialog-content[_ngcontent-%COMP%] .variable-binding.first[_ngcontent-%COMP%]{padding-right:1rem;width:73%}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .dialog-content[_ngcontent-%COMP%] .variable-binding[_ngcontent-%COMP%] ul{margin:0}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .dialog-content[_ngcontent-%COMP%] .variable-binding[_ngcontent-%COMP%] img{margin-left:1rem;float:right}.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%}"]}),n})(),vq=(()=>{class n{constructor(t){this.http=t,this.panelContent=new Fr({content:[],infoTitle:"",videoID:""})}updateData(t,i,r){this.http.get(t,{responseType:"text"}).subscribe(s=>{const o={content:this.parseMarkdown(s),infoTitle:r,videoID:i};this.panelContent.next(o)})}parseMarkdown(t){const i=[],r=t.split("# ");for(const s of r)if(s.length){const o=s.includes("\n\n")?"\n\n":"\r\n\r\n",a=s.split(o);i.push({title:a[0],content:a.splice(1).join(o)})}return i}}return n.\u0275fac=function(t){return new(t||n)(Ie(_u))},n.\u0275prov=We({token:n,factory:n.\u0275fac,providedIn:"root"}),n})(),Uke=(()=>{class n{constructor(){this.clsName="ccf-call-to-action",this.callToActionClicked=new ln,this.closeClicked=new ln}close(){this.closeClicked.emit()}onDialogButtonClick(){this.callToActionClicked.emit()}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=rn({type:n,selectors:[["ccf-call-to-action"]],hostVars:2,hostBindings:function(t,i){2&t&&Va(i.clsName)},inputs:{infoTitle:"infoTitle",imageUrl:"imageUrl",message:"message",callToAction:"callToAction"},outputs:{callToActionClicked:"callToActionClicked",closeClicked:"closeClicked"},decls:13,vars:4,consts:[[1,"rui-about","wrapper"],[1,"container"],[1,"content"],[1,"first-row"],["mat-dialog-title","",1,"title"],[1,"cta-mat-icon","material-icons","close-icon",3,"click"],["mat-card-sm-image","","alt","preview","layout-fill","",1,"cta-image",3,"src"],[1,"mat-typography","dialog-content"],[1,"message"],["mat-button","",1,"mat-button",3,"text","click"]],template:function(t,i){1&t&&(wt(0,"div",0),wt(1,"div",1),wt(2,"div",2),wt(3,"div",3),wt(4,"p",4),Jn(5),Et(),wt(6,"mat-icon",5),Tn("click",function(){return i.close()}),Jn(7,"clear"),Et(),Et(),ni(8,"img",6),wt(9,"mat-dialog-content",7),wt(10,"div",8),Jn(11),Et(),wt(12,"a",9),Tn("click",function(){return i.onDialogButtonClick()}),Et(),Et(),Et(),Et(),Et()),2&t&&(zt(5),gs(i.infoTitle),zt(3),Jt("src",i.imageUrl,sf),zt(3),xo(" ",i.message,""),zt(1),Jt("text",i.callToAction))},directives:[kW,Fm,BMe,FW],styles:["[_nghost-%COMP%] .content[_ngcontent-%COMP%]{display:block;align-content:center;padding-left:1.6rem;padding-right:1.6rem;border-radius:.25rem}[_nghost-%COMP%] .info-button-wrapper[_ngcontent-%COMP%]{border-radius:.25rem;padding:.6rem;transition:.6s}[_nghost-%COMP%] .info-button-wrapper[_ngcontent-%COMP%] .ccf-info-button[_ngcontent-%COMP%]{cursor:pointer;transition:color .6s;font-size:1.2rem;vertical-align:sub}[_nghost-%COMP%] .first-row[_ngcontent-%COMP%]{display:flex;width:100%;line-height:.9rem}[_nghost-%COMP%] .first-row[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{padding-right:7rem;padding-left:.2rem;font-size:.875rem;padding-top:.75rem}[_nghost-%COMP%] .first-row[_ngcontent-%COMP%] .cta-mat-icon[_ngcontent-%COMP%]{height:30%;line-height:3.4rem}[_nghost-%COMP%] .message[_ngcontent-%COMP%]{padding:.5rem}[_nghost-%COMP%] .cta-image[_ngcontent-%COMP%]{align-self:center;-o-object-fit:cover;object-fit:cover;width:100%;border-radius:.25rem}[_nghost-%COMP%] .mat-button[_ngcontent-%COMP%]{background-color:#444a65;font-size:.75rem;position:relative;margin-bottom:1rem;width:100%;height:2rem;color:#fff}"],changeDetection:0}),n})(),Qm=(()=>{let n=class extends MDe{constructor(){super(...arguments),this.optionCache=new Map}get config$(){return this.state$.pipe(Ki(n=>null!=n),Wa(1))}setConfig(t){this.setState(t)}patchConfig(t){this.patchState(t)}getProperty(t){return this.config$.pipe(oW(...t),ld(),Wa(1))}getOption(...t){const i=this.getPathKey(t);if(this.optionCache.has(i))return this.optionCache.get(i);const r=this.config$.pipe(oW(...t),ld(),Wa(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=zi(n)))(i||n)}}(),n.\u0275prov=We({token:n,factory:n.\u0275fac}),Ei([f7()],n.prototype,"config$",null),n=Ei([CDe(),A5({name:"globalConfig",defaults:null})],n),n})();!function(){const n=localStorage.getItem("ALLOW_TELEMETRY");null===n||n.toLowerCase()}();class wq extends class{getDatabaseStatus(){return this.forwardCall("getDatabaseStatus")}getProviderNames(){return this.forwardCall("getProviderNames")}getDatasetTechnologyNames(){return this.forwardCall("getDatasetTechnologyNames")}getOntologyTreeModel(){return this.forwardCall("getOntologyTreeModel")}getCellTypeTreeModel(){return this.forwardCall("getCellTypeTreeModel")}getReferenceOrgans(){return this.forwardCall("getReferenceOrgans")}getTissueBlockResults(e){return this.forwardCall("getTissueBlockResults",e)}getAggregateResults(e){return this.forwardCall("getAggregateResults",e)}getOntologyTermOccurences(e){return this.forwardCall("getOntologyTermOccurences",e)}getCellTypeTermOccurences(e){return this.forwardCall("getCellTypeTermOccurences",e)}getScene(e){return this.forwardCall("getScene",e)}getReferenceOrganScene(e,t){return this.forwardCall("getReferenceOrganScene",e,t)}}{forwardCall(e,...t){return this.impl$.pipe(is(i=>i[e](...t)))}}let Eq=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const Qk=new oe,nv={cacheBusterObserver:Qk},Zm={cacheBusterObserver:Qk,maxCacheCount:4};function xq(n,e,t){return n?{min:n[0]>e?n[0]:void 0,max:n[1]{var t;return Object.assign(Object.assign({},e),{transformMatrix:new qn(null!==(t=e.transformMatrix)&&void 0!==t?t:[])})})}let Xke=(()=>{class n{constructor(t,i){this.api=t,this.globalConfig=i,i.getOption("hubmapToken").subscribe(Qk)}getDatabaseStatus(){return this.doRequest(t=>this.api.dbStatus(t))}getProviderNames(){return this.doRequest(t=>this.api.providerNames(t))}getDatasetTechnologyNames(){return this.doRequest(t=>this.api.technologyNames(t))}getOntologyTreeModel(){return this.doRequest(t=>this.api.ontologyTreeModel(t),void 0,{},n=>n)}getCellTypeTreeModel(){return this.doRequest(t=>this.api.cellTypeTreeModel(t),void 0,{},n=>n)}getReferenceOrgans(){return this.doRequest(t=>this.api.referenceOrgans(t),void 0,{},n=>n)}getTissueBlockResults(t){return this.doRequest(i=>this.api.tissueBlocks(i),t,{},n=>n)}getAggregateResults(t){return this.doRequest(i=>this.api.aggregateResults(i),t)}getOntologyTermOccurences(t){return this.doRequest(i=>this.api.ontologyTermOccurences(i),t)}getCellTypeTermOccurences(t){return this.doRequest(i=>this.api.cellTypeTermOccurences(i),t)}getScene(t){return this.doRequest(i=>this.api.scene(i),t,{},Sq)}getReferenceOrganScene(t,i){return this.doRequest(r=>this.api.referenceOrganScene(r),i,{organIri:t},Sq)}doRequest(t,i,r,s){const{api:o,globalConfig:a}=this,l=Object.assign(Object.assign({},function(n){var e,t;return{age:xq(null==n?void 0:n.ageRange,1,110),bmi:xq(null==n?void 0:n.bmiRange,13,83),sex:null===(t=null===(e=null==n?void 0:n.sex)||void 0===e?void 0:e.toLowerCase)||void 0===t?void 0:t.call(e),ontologyTerms:null==n?void 0:n.ontologyTerms,cellTypeTerms:null==n?void 0:n.cellTypeTerms,providers:null==n?void 0:n.tmc,technologies:null==n?void 0:n.technologies,spatial:null==n?void 0:n.spatialSearches}}(i)),r);return yc([a.getOption("remoteApiEndpoint"),a.getOption("hubmapToken")]).pipe(qr(1),cr(([c,u])=>{o.configuration.basePath=c,u&&(l.token=u)}),is(()=>t(l)),me(c=>s?s(c):c))}}return n.\u0275fac=function(t){return new(t||n)(Ie(T9),Ie(Qm))},n.\u0275prov=We({token:n,factory:n.\u0275fac,providedIn:"root"}),Ei([Sc(nv)],n.prototype,"getProviderNames",null),Ei([Sc(nv)],n.prototype,"getDatasetTechnologyNames",null),Ei([Sc(nv)],n.prototype,"getOntologyTreeModel",null),Ei([Sc(nv)],n.prototype,"getCellTypeTreeModel",null),Ei([Sc(nv)],n.prototype,"getReferenceOrgans",null),Ei([Sc(Zm)],n.prototype,"getTissueBlockResults",null),Ei([Sc(Zm)],n.prototype,"getAggregateResults",null),Ei([Sc(Zm)],n.prototype,"getOntologyTermOccurences",null),Ei([Sc(Zm)],n.prototype,"getCellTypeTermOccurences",null),Ei([Sc(Zm)],n.prototype,"getScene",null),Ei([Sc(Zm)],n.prototype,"getReferenceOrganScene",null),n})(),Kke=(()=>{class n extends wq{constructor(t){super(),this.impl$=this.database$=t.config$.pipe(i=>i,Ki(i=>Object.keys(i).length>0),is(i=>function(n,e){return new O(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?je(r):Qc).subscribe(t);return()=>{o.unsubscribe(),i&&i.unsubscribe()}})}(()=>this.createDatabase(i),r=>this.connectDatabase(r,i))),me(i=>i.database),Wa(1))}connectDatabase(t,i){return Bi(this,void 0,void 0,function*(){const r=!fa();return yield t.database.connect(i,r),t})}}return n.\u0275fac=function(t){return new(t||n)(Ie(Qm))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),Qke=(()=>{class n extends Kke{createDatabase(t){return{database:new ONe(t),unsubscribe:()=>{}}}}return n.\u0275fac=function(){let e;return function(i){return(e||(e=zi(n)))(i||n)}}(),n.\u0275prov=We({token:n,factory:n.\u0275fac,providedIn:"root"}),n})(),Zke=(()=>{class n extends wq{constructor(t,i){super(),this.impl$=t.config$.pipe(r=>r,me(r=>this.selectToken(r)),ld(),me(r=>i.get(r)),Wa(1))}}return n.\u0275fac=function(t){return new(t||n)(Ie(Qm),Ie(Hn))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),Zk=(()=>{class n{}return n.type="[CallToAction] Learn More",n})(),Jk=(()=>{class n{}return n.type="[CallToAction] Open Dialog",n})(),eF=(()=>{class n{}return n.type="[CallToAction] Close Dialog",n})();var tF;class wa{get length(){var e,t;return null!==(t=null===(e=wa.storage)||void 0===e?void 0:e.length)&&void 0!==t?t:0}key(e){var t,i;return null!==(i=null===(t=wa.storage)||void 0===t?void 0:t.key(e))&&void 0!==i?i:null}getItem(e,t){var i,r,s;return null!==(s=null!==(r=null===(i=wa.storage)||void 0===i?void 0:i.getItem(e))&&void 0!==r?r:t)&&void 0!==s?s:null}setItem(e,t){var i;try{return null===(i=wa.storage)||void 0===i||i.setItem(e,t),!0}catch(r){return!1}}removeItem(e){var t;null===(t=wa.storage)||void 0===t||t.removeItem(e)}clear(){var e;null===(e=wa.storage)||void 0===e||e.clear()}}wa.storage=(()=>{let n;try{n=window.localStorage;const e="__storage_test__";return n.setItem(e,e),n.removeItem(e),n}catch(e){return e instanceof DOMException&&(22===e.code||1014===e.code||"QuotaExceededError"===e.name||"NS_ERROR_DOM_QUOTA_REACHED"===e.name)&&n&&0!==n.length?n:void 0}})(),wa.\u0275fac=function(e){return new(e||wa)},wa.\u0275prov=We({token:wa,factory:wa.\u0275fac,providedIn:"root"});const Cq="callToActionPopupShown";let Ro=tF=class{constructor(e,t,i,r,s){this.dialog=e,this.ga=t,this.storage=i,this.infoService=r,this.http=s}static ctaDatePassed(e,t=Date.now){return+t()>+new Date(e)}ngxsOnInit(e){const{expirationDate:t,popupShown:i}=e.getState(),r=this.storage.getItem(Cq,`${i}`),s=tF.ctaDatePassed(t);"true"!==r&&!s&&e.dispatch(new Jk)}getDialogData(){return this.http.get("assets/docs/SPATIAL_SEARCH_README.md",{responseType:"text"}).pipe(me(e=>this.infoService.parseMarkdown(e)))}launchLearnMore(e){this.dialog.open(bq,{autoFocus:!1,panelClass:"modal-animated",width:"72rem",data:{title:"Spatial Search",content:e,videoID:"UfxMpzatowE"}})}learnMore(e){return this.dialog.closeAll(),this.ga.event("open_learn_more","call_to_action"),this.getDialogData().pipe(cr(t=>this.launchLearnMore(t)))}open(e){this.dialog.open(eFe,{autoFocus:!1,panelClass:"modal-animated",width:"30.75rem",height:"36.688rem"}),this.ga.event("open","call_to_action"),this.storage.setItem(Cq,"true"),e.patchState({popupShown:!0})}close(e){this.dialog.closeAll(),this.ga.event("close","call_to_action")}};Ro.\u0275fac=function(e){return new(e||Ro)(Ie(Nb),Ie(qb),Ie(wa),Ie(vq),Ie(_u))},Ro.\u0275prov=We({token:Ro,factory:Ro.\u0275fac}),Ei([yP(Zk)],Ro.prototype,"learnMore",null),Ei([yP(Jk)],Ro.prototype,"open",null),Ei([yP(eF)],Ro.prototype,"close",null),Ro=tF=Ei([A5({name:"callToAction",defaults:{title:"New to the Exploration User Interface",message:"Spatial Search has arrived!",callToAction:"Learn More",imageUrl:"assets/images/spatial_search.gif",expirationDate:"Dec 1, 2022",popupShown:!1}})],Ro);let E1=(()=>{class n{static title(t){return t.title}static message(t){return t.message}static callToAction(t){return t.callToAction}static imageUrl(t){return t.imageUrl}static expirationDate(t){return t.expirationDate}static popupShown(t){return t.popupShown}}return Ei([_m([Ro])],n,"title",null),Ei([_m([Ro])],n,"message",null),Ei([_m([Ro])],n,"callToAction",null),Ei([_m([Ro])],n,"imageUrl",null),Ei([_m([Ro])],n,"expirationDate",null),Ei([_m([Ro])],n,"popupShown",null),n})(),eFe=(()=>{class n{constructor(){this.close=()=>new eF,this.learnMore=()=>new Zk}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=rn({type:n,selectors:[["ccf-call-to-action-behavior"]],decls:5,vars:12,consts:[[3,"infoTitle","message","callToAction","imageUrl","callToActionClicked","closeClicked"]],template:function(t,i){1&t&&(wt(0,"ccf-call-to-action",0),Tn("callToActionClicked",function(){return i.learnMore()})("closeClicked",function(){return i.close()}),Ps(1,"async"),Ps(2,"async"),Ps(3,"async"),Ps(4,"async"),Et()),2&t&&Jt("infoTitle",To(1,4,i.title$))("message",To(2,6,i.message$))("callToAction",To(3,8,i.callToAction$))("imageUrl",To(4,10,i.imageUrl$))},directives:[Uke],pipes:[g0],styles:[""],changeDetection:0}),Ei([PS(E1.title)],n.prototype,"title$",void 0),Ei([PS(E1.message)],n.prototype,"message$",void 0),Ei([PS(E1.callToAction)],n.prototype,"callToAction$",void 0),Ei([PS(E1.imageUrl)],n.prototype,"imageUrl$",void 0),Ei([oq()],n.prototype,"close",void 0),Ei([oq()],n.prototype,"learnMore",void 0),n})(),iFe=(()=>{class n{constructor(t){this.source=t,this.organs=yq}getOrganInfo(t,i,r="Female"){let s=this.organs.find(a=>a.id===t);if(!s)return sn(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)),sn(s)}getOrgan(t,i="Both"){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}):sn([])}getOrganStats(t,i="Female"){return t.id?this.source.getAggregateResults({ontologyTerms:[t.id],sex:i}):sn([])}getBlocks(t,i="Female"){return t.id?this.source.getTissueBlockResults({ontologyTerms:[t.id],sex:i}):sn([])}}return n.\u0275fac=function(t){return new(t||n)(Ie(Eq))},n.\u0275prov=We({token:n,factory:n.\u0275fac,providedIn:"root"}),n})();const rFe=["thumbContainer"],sFe=["toggleBar"],oFe=["input"],aFe=function(n){return{enterDuration:n}},lFe=["*"],cFe=new Ht("mat-slide-toggle-default-options",{providedIn:"root",factory:()=>({disableToggleValue:!1})});let uFe=0;const dFe={provide:Xo,useExisting:ge(()=>Tq),multi:!0};class hFe{constructor(e,t){this.source=e,this.checked=t}}const fFe=wC(Mm(Ch(Am(class{constructor(n){this._elementRef=n}}))));let Tq=(()=>{class n extends fFe{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-"+ ++uFe,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 ln,this.toggleChange=new ln,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=bi(t)}get checked(){return this._checked}set checked(t){this._checked=bi(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 hFe(this,this.checked))}_onLabelTextChange(){this._changeDetectorRef.detectChanges()}}return n.\u0275fac=function(t){return new(t||n)(Ce(gn),Ce(vc),Ce(Mr),yo("tabindex"),Ce(cFe),Ce(Qa,8))},n.\u0275cmp=rn({type:n,selectors:[["mat-slide-toggle"]],viewQuery:function(t,i){if(1&t&&(hr(rFe,5),hr(sFe,5),hr(oFe,5)),2&t){let r;Gn(r=$n())&&(i._thumbEl=r.first),Gn(r=$n())&&(i._thumbBarEl=r.first),Gn(r=$n())&&(i._inputElement=r.first)}},hostAttrs:[1,"mat-slide-toggle"],hostVars:12,hostBindings:function(t,i){2&t&&(qc("id",i.id),Ii("tabindex",i.disabled?null:-1)("aria-label",null)("aria-labelledby",null),ai("mat-checked",i.checked)("mat-disabled",i.disabled)("mat-slide-toggle-label-before","before"==i.labelPosition)("_mat-animation-noopable",i._noopAnimations))},inputs:{disabled:"disabled",disableRipple:"disableRipple",color:"color",tabIndex:"tabIndex",name:"name",id:"id",labelPosition:"labelPosition",ariaLabel:["aria-label","ariaLabel"],ariaLabelledby:["aria-labelledby","ariaLabelledby"],required:"required",checked:"checked",ariaDescribedby:["aria-describedby","ariaDescribedby"]},outputs:{change:"change",toggleChange:"toggleChange"},exportAs:["matSlideToggle"],features:[Vn([dFe]),En],ngContentSelectors:lFe,decls:16,vars:20,consts:[[1,"mat-slide-toggle-label"],["label",""],[1,"mat-slide-toggle-bar"],["toggleBar",""],["type","checkbox","role","switch",1,"mat-slide-toggle-input","cdk-visually-hidden",3,"id","required","tabIndex","checked","disabled","change","click"],["input",""],[1,"mat-slide-toggle-thumb-container"],["thumbContainer",""],[1,"mat-slide-toggle-thumb"],["mat-ripple","",1,"mat-slide-toggle-ripple","mat-focus-indicator",3,"matRippleTrigger","matRippleDisabled","matRippleCentered","matRippleRadius","matRippleAnimation"],[1,"mat-ripple-element","mat-slide-toggle-persistent-ripple"],[1,"mat-slide-toggle-content",3,"cdkObserveContent"],["labelContent",""],[2,"display","none"]],template:function(t,i){if(1&t&&(Hr(),wt(0,"label",0,1),wt(2,"div",2,3),wt(4,"input",4,5),Tn("change",function(s){return i._onChangeEvent(s)})("click",function(s){return i._onInputClick(s)}),Et(),wt(6,"div",6,7),ni(8,"div",8),wt(9,"div",9),ni(10,"div",10),Et(),Et(),Et(),wt(11,"span",11,12),Tn("cdkObserveContent",function(){return i._onLabelTextChange()}),wt(13,"span",13),Jn(14,"\xa0"),Et(),oi(15),Et(),Et()),2&t){const r=ih(1),s=ih(12);Ii("for",i.inputId),zt(2),ai("mat-slide-toggle-bar-no-side-margin",!s.textContent||!s.textContent.trim()),zt(2),Jt("id",i.inputId)("required",i.required)("tabIndex",i.tabIndex)("checked",i.checked)("disabled",i.disabled),Ii("name",i.name)("aria-checked",i.checked.toString())("aria-label",i.ariaLabel)("aria-labelledby",i.ariaLabelledby)("aria-describedby",i.ariaDescribedby),zt(5),Jt("matRippleTrigger",r)("matRippleDisabled",i.disableRipple||i.disabled)("matRippleCentered",!0)("matRippleRadius",20)("matRippleAnimation",function(n,e,t,i){return E3(Vt(),Cs(),n,e,t,i)}(18,aFe,i._noopAnimations?0:150))}},directives:[gu,$P],styles:[".mat-slide-toggle{display:inline-block;height:24px;max-width:100%;line-height:24px;white-space:nowrap;outline:none;-webkit-tap-highlight-color:transparent}.mat-slide-toggle.mat-checked .mat-slide-toggle-thumb-container{transform:translate3d(16px, 0, 0)}[dir=rtl] .mat-slide-toggle.mat-checked .mat-slide-toggle-thumb-container{transform:translate3d(-16px, 0, 0)}.mat-slide-toggle.mat-disabled{opacity:.38}.mat-slide-toggle.mat-disabled .mat-slide-toggle-label,.mat-slide-toggle.mat-disabled .mat-slide-toggle-thumb-container{cursor:default}.mat-slide-toggle-label{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:flex;flex:1;flex-direction:row;align-items:center;height:inherit;cursor:pointer}.mat-slide-toggle-content{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mat-slide-toggle-label-before .mat-slide-toggle-label{order:1}.mat-slide-toggle-label-before .mat-slide-toggle-bar{order:2}[dir=rtl] .mat-slide-toggle-label-before .mat-slide-toggle-bar,.mat-slide-toggle-bar{margin-right:8px;margin-left:0}[dir=rtl] .mat-slide-toggle-bar,.mat-slide-toggle-label-before .mat-slide-toggle-bar{margin-left:8px;margin-right:0}.mat-slide-toggle-bar-no-side-margin{margin-left:0;margin-right:0}.mat-slide-toggle-thumb-container{position:absolute;z-index:1;width:20px;height:20px;top:-3px;left:0;transform:translate3d(0, 0, 0);transition:all 80ms linear;transition-property:transform}._mat-animation-noopable .mat-slide-toggle-thumb-container{transition:none}[dir=rtl] .mat-slide-toggle-thumb-container{left:auto;right:0}.mat-slide-toggle-thumb{height:20px;width:20px;border-radius:50%}.mat-slide-toggle-bar{position:relative;width:36px;height:14px;flex-shrink:0;border-radius:8px}.mat-slide-toggle-input{bottom:0;left:10px}[dir=rtl] .mat-slide-toggle-input{left:auto;right:10px}.mat-slide-toggle-bar,.mat-slide-toggle-thumb{transition:all 80ms linear;transition-property:background-color;transition-delay:50ms}._mat-animation-noopable .mat-slide-toggle-bar,._mat-animation-noopable .mat-slide-toggle-thumb{transition:none}.mat-slide-toggle .mat-slide-toggle-ripple{position:absolute;top:calc(50% - 20px);left:calc(50% - 20px);height:40px;width:40px;z-index:1;pointer-events:none}.mat-slide-toggle .mat-slide-toggle-ripple .mat-ripple-element:not(.mat-slide-toggle-persistent-ripple){opacity:.12}.mat-slide-toggle-persistent-ripple{width:100%;height:100%;transform:none}.mat-slide-toggle-bar:hover .mat-slide-toggle-persistent-ripple{opacity:.04}.mat-slide-toggle:not(.mat-disabled).cdk-keyboard-focused .mat-slide-toggle-persistent-ripple{opacity:.12}.mat-slide-toggle-persistent-ripple,.mat-slide-toggle.mat-disabled .mat-slide-toggle-bar:hover .mat-slide-toggle-persistent-ripple{opacity:0}@media(hover: none){.mat-slide-toggle-bar:hover .mat-slide-toggle-persistent-ripple{display:none}}.cdk-high-contrast-active .mat-slide-toggle-thumb,.cdk-high-contrast-active .mat-slide-toggle-bar{border:1px solid}.cdk-high-contrast-active .mat-slide-toggle.cdk-keyboard-focused .mat-slide-toggle-bar{outline:2px dotted;outline-offset:5px}\n"],encapsulation:2,changeDetection:0}),n})(),Aq=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=tn({type:n}),n.\u0275inj=St({}),n})(),mFe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=tn({type:n}),n.\u0275inj=St({imports:[[Aq,Dm,ji,QS],Aq,ji]}),n})(),_Fe=(()=>{class n{constructor(){this.clsName="ccf-slide-toggle",this.labels=["Left","Right"],this.value="Left",this.disabled=!1,this.valueChange=new ln}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=rn({type:n,selectors:[["ccf-slide-toggle"]],hostVars:2,hostBindings:function(t,i){2&t&&Va(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=wl();wt(0,"span",0),Tn("click",function(){_r(r);const o=ih(3);return i.left||o.toggle(),i.updateToggle(!0)}),Jn(1),Et(),wt(2,"mat-slide-toggle",1,2),Tn("change",function(o){return i.updateToggle(!o.checked)}),Et(),wt(4,"span",0),Tn("click",function(){_r(r);const o=ih(3);return i.left&&o.toggle(),i.updateToggle(!1)}),Jn(5),Et()}2&t&&(ai("disabled",i.disabled)("highlighted",i.left),zt(1),gs(i.labels[0].charAt(0).toUpperCase()+i.labels[0].slice(1)),zt(1),Jt("disabled",i.disabled)("checked",!i.left),zt(2),ai("disabled",i.disabled)("highlighted",!i.left),zt(1),gs(i.labels[1].charAt(0).toUpperCase()+i.labels[1].slice(1)))},directives:[Tq],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 yFe=["bodyUI"],bFe=function(){return["Male","Female"]},vFe=function(){return["Left","Right"]};let wFe=(()=>{class n{constructor(t){this.ga=t,this.sexChange=new ln,this.sideChange=new ln}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.zoomToFitOrgan()}updateSex(t){this.sex=t,this.sexChange.emit(this.sex)}updateSide(t){this.side=t,this.sideChange.emit(this.side)}zoomToFitOrgan(){const{bodyUI:t,organ:i}=this;if(i){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)(Ce(qb))},n.\u0275cmp=rn({type:n,selectors:[["ccf-organ"]],viewQuery:function(t,i){if(1&t&&hr(yFe,7),2&t){let r;Gn(r=$n())&&(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:[Fi],decls:5,vars:10,consts:[["camera","perspective",1,"body-ui",3,"scene","interactive","nodeClick","initialized"],["bodyUI",""],[1,"stage-options"],[1,"view-slider",3,"labels","value","hidden","valueChange"]],template:function(t,i){1&t&&(wt(0,"ccf-body-ui",0,1),Tn("nodeClick",function(s){return i.nodeClicked(s)})("initialized",function(){return i.zoomToFitOrgan()}),Et(),wt(2,"div",2),wt(3,"ccf-slide-toggle",3),Tn("valueChange",function(s){return i.updateSex(s)}),Et(),wt(4,"ccf-slide-toggle",3),Tn("valueChange",function(s){return i.updateSide(s)}),Et(),Et()),2&t&&(Jt("scene",i.scene)("interactive",!0),zt(3),Jt("labels",TE(8,bFe))("value",i.sex)("hidden",!i.sex),zt(1),Jt("labels",TE(9,vFe))("value",i.side)("hidden",!i.side))},directives:[_ke,_Fe],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 EFe(n,e){if(1&n&&(wt(0,"div",3),wt(1,"div",4),Jn(2),Et(),wt(3,"div",5),Jn(4),Et(),Et()),2&n){const t=e.$implicit;zt(2),gs(t.count),zt(2),gs(t.label)}}let xFe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=rn({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&&(wt(0,"div",0),wt(1,"div",1),Jn(2),Et(),wi(3,EFe,5,2,"div",2),Et()),2&t&&(zt(2),xo(" ",i.statsLabel," "),zt(1),Jt("ngForOf",i.stats))},directives:[Yu],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 SFe(n,e){if(1&n){const t=wl();wt(0,"div",6),wt(1,"div",7),wt(2,"div",8),Jn(3),Et(),wt(4,"div",9),Tn("click",function(){const s=_r(t).$implicit;return _i().goToURL(s.buttonUrl)}),Jn(5),Et(),Et(),Et()}if(2&n){const t=e.$implicit;zt(3),gs(t.body),zt(1),Jt("gaLabel",t.buttonUrl),zt(1),xo(" ",t.buttonTitle,"")}}function CFe(n,e){if(1&n){const t=wl();wt(0,"div",10),Tn("click",function(){const s=_r(t).$implicit;return _i().goToURL(s.buttonUrl)}),Jn(1),Et()}if(2&n){const t=e.$implicit;Jt("gaLabel",t.buttonUrl),zt(1),gs(t.buttonTitle)}}let TFe=(()=>{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=rn({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&&(wt(0,"div",0),wi(1,SFe,6,3,"div",1),Et(),wt(2,"div",2),wt(3,"div",3),Jn(4,"Common Coordinate Framework (CCF) Deep Dive"),Et(),wt(5,"div",4),wi(6,CFe,2,2,"div",5),Et(),Et()),2&t&&(zt(1),Jt("ngForOf",i.linkCards),zt(5),Jt("ngForOf",i.deepDives))},directives:[g9,Yu,m9],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 AFe=["left"],MFe=["right"],DFe=function(){return[]},IFe=[{color:[0,0,0,0],opacity:.001}];let OFe=(()=>{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(cr(s=>this.latestConfig=s),is(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)}),cr(s=>this.logOrganLookup(s)),cr(s=>this.latestOrganInfo=s),Wa(1)),this.organ$=this.organInfo$.pipe(is(s=>s?t.getOrgan(s,s.hasSex?this.latestConfig.sex:void 0):sn(void 0)),cr(s=>{var o;if(s&&this.latestOrganInfo){const a=(null===(o=this.latestOrganInfo)||void 0===o?void 0:o.hasSex)?s.sex:void 0;a!==this.latestConfig.sex&&this.updateInput("sex",a),s.side!==this.latestConfig.side&&this.updateInput("side",s.side)}}),Wa(1)),this.scene$=this.organ$.pipe(is(s=>s&&this.latestOrganInfo?t.getOrganScene(this.latestOrganInfo,s.sex):sn(IFe))),this.stats$=this.organ$.pipe(is(s=>s&&this.latestOrganInfo?t.getOrganStats(this.latestOrganInfo,s.sex):sn([]))),this.statsLabel$=this.organ$.pipe(me(s=>this.makeStatsLabel(this.latestOrganInfo,null==s?void 0:s.sex)),Oo("Loading...")),this.blocks$=this.organ$.pipe(is(s=>s&&this.latestOrganInfo?t.getBlocks(this.latestOrganInfo,s.sex):sn([])))}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,i){let r=[`Unknown IRI: ${this.latestConfig.organIri}`];if(t){const s=t.side?t.side.charAt(0).toUpperCase()+t.side.slice(1):void 0;r=[i,t.organ,s]}return r.filter(s=>!!s).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)(Ce(iFe),Ce(qb),Ce(Qm))},n.\u0275cmp=rn({type:n,selectors:[["ccf-root"]],viewQuery:function(t,i){if(1&t&&(hr(AFe,7,gn),hr(MFe,7,gn)),2&t){let r;Gn(r=$n())&&(i.left=r.first),Gn(r=$n())&&(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&&(wt(0,"div",0),wt(1,"div",1,2),wt(3,"ccf-organ",3),Tn("sexChange",function(s){return i.updateInput("sex",s)})("sideChange",function(s){return i.updateInput("side",s)}),Ps(4,"async"),Ps(5,"async"),Ps(6,"async"),Ps(7,"async"),Ps(8,"async"),Ps(9,"async"),Et(),Et(),wt(10,"div",4,5),ni(12,"ccf-stats-list",6),Ps(13,"async"),Ps(14,"async"),ni(15,"ccf-link-cards"),Et(),Et()),2&t){let r;zt(3),Jt("blocks",To(4,8,i.blocks$))("filter",To(5,10,i.filter$))("sex",To(6,12,i.sex$))("side",To(7,14,i.side$))("organ",To(8,16,i.organ$))("scene",null!==(r=To(9,18,i.scene$))&&void 0!==r?r:TE(24,DFe)),zt(9),Jt("statsLabel",To(13,20,i.statsLabel$))("stats",To(14,22,i.stats$))}},directives:[wFe,xFe,TFe],pipes:[g0],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 RFe(n,e){1&n&&ni(0,"ccf-root")}function PFe(n){const e=i=>"string"==typeof i,t=i=>Array.isArray(i)&&i.every(e);if("string"==typeof n){const i=XD.json(n);if(t(i))return i}else if(t(n))return n;throw new Error("Invalid data sources")}function NFe(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=XD.json(n);if(t(i))return i}}else if(t(n))return n;throw new Error("Invalid data sources")}let kFe=(()=>{class n extends fie{constructor(t,i){super(t,i,{initialDelay:10,initialConfig:Object.assign(Object.assign({},If.dbOptions),globalThis.dbOptions),parse:{dataSources:PFe,highlightProviders:NFe,useRemoteApi:XD.boolean}}),this.sex="Female",this.side="Left"}}return n.\u0275fac=function(t){return new(t||n)(Ce(Qm),Ce(Mr))},n.\u0275cmp=rn({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",useRemoteApi:"useRemoteApi",remoteApiEndpoint:"remoteApiEndpoint"},features:[En],decls:1,vars:1,consts:[[4,"ngIf"]],template:function(t,i){1&t&&wi(0,RFe,1,0,"ccf-root",0),2&t&&Jt("ngIf",i.initialized)},directives:[ac,OFe],encapsulation:2,changeDetection:0}),n})(),FFe=(()=>{class n extends Zke{selectToken(t){return t.useRemoteApi&&t.remoteApiEndpoint?Xke:Qke}}return n.\u0275fac=function(){let e;return function(i){return(e||(e=zi(n)))(i||n)}}(),n.\u0275prov=We({token:n,factory:n.\u0275fac,providedIn:"root"}),n})(),LFe=(()=>{class n{constructor(t,i){this.accessor=t,this.injector=i}static forRoot(t=[]){return{ngModule:n,providers:[hs,el,a7,...t]}}}return n.\u0275fac=function(t){return new(t||n)(Ie(hs,2),Ie(el,2))},n.\u0275mod=tn({type:n}),n.\u0275inj=St({}),n})();const x1=(n,e)=>((n,e)=>new Array(e+1).join("0"))(0,e-n.toString().length)+n;class jFe{constructor(e,t,i){this.action=e,this.store=t,this.logWriter=i}dispatched(e){const t=qf(this.action),i=function(n){return x1(n.getHours(),2)+":"+x1(n.getMinutes(),2)+":"+x1(n.getSeconds(),2)+"."+x1(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 UFe{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 Mq=new Ht("NGXS_LOGGER_PLUGIN_OPTIONS");let zFe=(()=>{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 UFe(this._options),this._store=this._store||this._injector.get(hu);const s=new jFe(i,this._store,this._logWriter);return s.dispatched(t),r(t,i).pipe(cr(o=>{s.completed(o)}),bc(o=>{throw s.errored(o),o}))}}return n.\u0275fac=function(t){return new(t||n)(Ie(Mq),Ie(Hn))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const Dq=new Ht("LOGGER_USER_OPTIONS");function HFe(n){return Object.assign({},{logger:console,collapsed:!1,disabled:!1,filter:()=>!0},n)}let GFe=(()=>{class n{static forRoot(t){return{ngModule:n,providers:[{provide:h5,useClass:zFe,multi:!0},{provide:Dq,useValue:t},{provide:Mq,useFactory:HFe,deps:[Dq]}]}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=tn({type:n}),n.\u0275inj=St({}),n})();const $Fe=[Qm];let WFe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=tn({type:n}),n.\u0275inj=St({imports:[[LFe.forRoot(),Yo.forRoot($Fe,{developmentMode:!If.production}),GFe.forRoot({disabled:If.production})]]}),n})(),qFe=(()=>{class n{constructor(t){if(t)throw new Error("The core module should only be imported once in the root module")}}return n.\u0275fac=function(t){return new(t||n)(Ie(n,12))},n.\u0275mod=tn({type:n}),n.\u0275inj=St({providers:[{provide:Eq,useExisting:FFe}],imports:[[CW,oRe.forRoot({gaToken:If.googleAnalyticsToken,appName:"organ-info",projectName:"ccf",developmentMode:!If.production}),pRe.forRoot(()=>new Yb({basePath:If.dbOptions.remoteApiEndpoint})),WFe]]}),n})(),YFe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=tn({type:n}),n.\u0275inj=St({imports:[[fr,mFe]]}),n})(),XFe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=tn({type:n}),n.\u0275inj=St({imports:[[fr,yke,YFe]]}),n})(),KFe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=tn({type:n}),n.\u0275inj=St({imports:[[fr,r1]]}),n})(),QFe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=tn({type:n}),n.\u0275inj=St({imports:[[fr]]}),n})(),ZFe=(()=>{class n{constructor(t){this.injector=t}ngDoBootstrap(){const t=function(n,e){const t=function(n,e){return e.get(El).resolveComponentFactory(n).inputs}(n,e.injector),i=e.strategyFactory||new aie(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 cie{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,u){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}(kFe,{injector:this.injector});customElements.define("ccf-organ-info",t)}}return n.\u0275fac=function(t){return new(t||n)(Ie(Hn))},n.\u0275mod=tn({type:n}),n.\u0275inj=St({providers:[],imports:[[WD,qFe,KFe,QFe,XFe]]}),n})();If.production&&function(){if(iB)throw new Error("Cannot enable prod mode after platform setup.");nB=!1}(),Ine().bootstrapModule(ZFe).catch(n=>console.error(n))},1052:Ut=>{function it(yt,ee,Dt,dt,Y,Se,he){try{var W=yt[Se](he),j=W.value}catch(k){return void Dt(k)}W.done?ee(j):Promise.resolve(j).then(dt,Y)}Ut.exports=function(yt){return function(){var ee=this,Dt=arguments;return new Promise(function(dt,Y){var Se=yt.apply(ee,Dt);function he(j){it(Se,dt,Y,he,W,"next",j)}function W(j){it(Se,dt,Y,he,W,"throw",j)}he(void 0)})}},Ut.exports.default=Ut.exports,Ut.exports.__esModule=!0},1948:Ut=>{Ut.exports=function(et){return et&&et.__esModule?et:{default:et}},Ut.exports.default=Ut.exports,Ut.exports.__esModule=!0},4321:Ut=>{function it(et){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(Ut.exports=it=function(ee){return typeof ee},Ut.exports.default=Ut.exports,Ut.exports.__esModule=!0):(Ut.exports=it=function(ee){return ee&&"function"==typeof Symbol&&ee.constructor===Symbol&&ee!==Symbol.prototype?"symbol":typeof ee},Ut.exports.default=Ut.exports,Ut.exports.__esModule=!0),it(et)}Ut.exports=it,Ut.exports.default=Ut.exports,Ut.exports.__esModule=!0},9082:Ut=>{function it(et){return Promise.resolve().then(()=>{var yt=new Error("Cannot find module '"+et+"'");throw yt.code="MODULE_NOT_FOUND",yt})}it.keys=()=>[],it.resolve=it,it.id=9082,Ut.exports=it},9521:()=>{},9125:()=>{},5307:()=>{}},Ut=>{Ut(Ut.s=2829)}]); \ No newline at end of file +var JFe=Object.defineProperty,e2e=Object.defineProperties,t2e=Object.getOwnPropertyDescriptors,S1=Object.getOwnPropertySymbols,Oq=Object.prototype.hasOwnProperty,Rq=Object.prototype.propertyIsEnumerable,Er=Math.pow,Pq=(Ut,it,et)=>it in Ut?JFe(Ut,it,{enumerable:!0,configurable:!0,writable:!0,value:et}):Ut[it]=et,ot=(Ut,it)=>{for(var et in it||(it={}))Oq.call(it,et)&&Pq(Ut,et,it[et]);if(S1)for(var et of S1(it))Rq.call(it,et)&&Pq(Ut,et,it[et]);return Ut},Sn=(Ut,it)=>e2e(Ut,t2e(it)),Nq=(Ut,it)=>{var et={};for(var yt in Ut)Oq.call(Ut,yt)&&it.indexOf(yt)<0&&(et[yt]=Ut[yt]);if(null!=Ut&&S1)for(var yt of S1(Ut))it.indexOf(yt)<0&&Rq.call(Ut,yt)&&(et[yt]=Ut[yt]);return et};(self.webpackChunkccf_ui=self.webpackChunkccf_ui||[]).push([[179],{1440:(Ut,it,et)=>{var yt=et(1052).default;Ut.exports=function Y(Se,he,W){function j(H,w){if(!he[H]){if(!Se[H]){if(k)return k(H,!0);var R=new Error("Cannot find module '"+H+"'");throw R.code="MODULE_NOT_FOUND",R}var T=he[H]={exports:{}};Se[H][0].call(T.exports,function(b){return j(Se[H][1][b]||b)},T,T.exports,Y,Se,he,W)}return he[H].exports}for(var k=void 0,Q=0;Q0&&G[G.length-1])&&(6===_t[0]||2===_t[0])){qe=0;continue}if(3===_t[0]&&(!G||_t[1]>G[0]&&_t[1]0?ue-4:ue;for($=0;$>16&255,O[K++]=P>>8&255,O[K++]=255&P;return 2===I&&(P=j[z.charCodeAt($)]<<2|j[z.charCodeAt($+1)]>>4,O[K++]=255&P),1===I&&(P=j[z.charCodeAt($)]<<10|j[z.charCodeAt($+1)]<<4|j[z.charCodeAt($+2)]>>2,O[K++]=P>>8&255,O[K++]=255&P),O},he.fromByteArray=function(z){for(var P,X=z.length,ue=X%3,I=[],O=16383,K=0,E=X-ue;KE?E:K+O));return 1===ue?I.push(W[(P=z[X-1])>>2]+W[P<<4&63]+"=="):2===ue&&I.push(W[(P=(z[X-2]<<8)+z[X-1])>>10]+W[P>>4&63]+W[P<<2&63]+"="),I.join("")};for(var W=[],j=[],k="undefined"!=typeof Uint8Array?Uint8Array:Array,Q="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",H=0,w=Q.length;H0)throw new Error("Invalid string. Length must be a multiple of 4");var X=z.indexOf("=");return-1===X&&(X=P),[X,X===P?0:4-X%4]}function y(z){return W[z>>18&63]+W[z>>12&63]+W[z>>6&63]+W[63&z]}function S(z,P,X){for(var I=[],O=P;O>5==6?2:I>>4==14?3:I>>3==30?4:I>>6==2?-1:-2}function T(I){var O=this.lastTotal-this.lastNeed,K=function(I,O,K){if(128!=(192&O[0]))return I.lastNeed=0,"\ufffd";if(I.lastNeed>1&&O.length>1){if(128!=(192&O[1]))return I.lastNeed=1,"\ufffd";if(I.lastNeed>2&&O.length>2&&128!=(192&O[2]))return I.lastNeed=2,"\ufffd"}}(this,I);return void 0!==K?K:this.lastNeed<=I.length?(I.copy(this.lastChar,O,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(I.copy(this.lastChar,O,0,I.length),void(this.lastNeed-=I.length))}function S(I,O){if((I.length-O)%2==0){var K=I.toString("utf16le",O);if(K){var E=K.charCodeAt(K.length-1);if(E>=55296&&E<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=I[I.length-2],this.lastChar[1]=I[I.length-1],K.slice(0,-1)}return K}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=I[I.length-1],I.toString("utf16le",O,I.length-1)}function A(I){var O=I&&I.length?this.write(I):"";return this.lastNeed?O+this.lastChar.toString("utf16le",0,this.lastTotal-this.lastNeed):O}function z(I,O){var K=(I.length-O)%3;return 0===K?I.toString("base64",O):(this.lastNeed=3-K,this.lastTotal=3,1===K?this.lastChar[0]=I[I.length-1]:(this.lastChar[0]=I[I.length-2],this.lastChar[1]=I[I.length-1]),I.toString("base64",O,I.length-K))}function P(I){var O=I&&I.length?this.write(I):"";return this.lastNeed?O+this.lastChar.toString("base64",0,3-this.lastNeed):O}function X(I){return I.toString(this.encoding)}function ue(I){return I&&I.length?this.write(I):""}he.StringDecoder=H,H.prototype.write=function(I){if(0===I.length)return"";var O,K;if(this.lastNeed){if(void 0===(O=this.fillLast(I)))return"";K=this.lastNeed,this.lastNeed=0}else K=0;return K=0?($>0&&(I.lastNeed=$-1),$):--E=0?($>0&&(I.lastNeed=$-2),$):--E=0?($>0&&(2===$?$=0:I.lastNeed=$-3),$):0}(this,I,O);if(!this.lastNeed)return I.toString("utf8",O);this.lastTotal=K;var E=I.length-(K-this.lastNeed);return I.copy(this.lastChar,0,E),I.toString("utf8",O,E)},H.prototype.fillLast=function(I){if(this.lastNeed<=I.length)return I.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);I.copy(this.lastChar,this.lastTotal-this.lastNeed,0,I.length),this.lastNeed-=I.length}},{"safe-buffer":4}],6:[function(Y,Se,he){(function(W){(function(){"use strict";var j=Y("base64-js"),k=Y("ieee754");he.Buffer=C,he.SlowBuffer=function(B){return+B!=B&&(B=0),C.alloc(+B)},he.INSPECT_MAX_BYTES=50;var Q=2147483647;function w(B){if(B>Q)throw new RangeError('The value "'+B+'" is invalid for option "size"');var N=new Uint8Array(B);return N.__proto__=C.prototype,N}function C(B,N,V){if("number"==typeof B){if("string"==typeof N)throw new TypeError('The "string" argument must be of type string. Received type number');return y(B)}return R(B,N,V)}function R(B,N,V){if("string"==typeof B)return function(B,N){if(("string"!=typeof N||""===N)&&(N="utf8"),!C.isEncoding(N))throw new TypeError("Unknown encoding: "+N);var V=0|I(B,N),Re=w(V),Ze=Re.write(B,N);return Ze!==V&&(Re=Re.slice(0,Ze)),Re}(B,N);if(ArrayBuffer.isView(B))return A(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,N,V){if(N<0||B.byteLength=Q)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Q.toString(16)+" bytes");return 0|B}function I(B,N){if(C.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 V=B.length,Re=arguments.length>2&&!0===arguments[2];if(!Re&&0===V)return 0;for(var Ze=!1;;)switch(N){case"ascii":case"latin1":case"binary":return V;case"utf8":case"utf-8":return G(B).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*V;case"hex":return V>>>1;case"base64":return je(B).length;default:if(Ze)return Re?-1:G(B).length;N=(""+N).toLowerCase(),Ze=!0}}function O(B,N,V){var Re=!1;if((void 0===N||N<0)&&(N=0),N>this.length||((void 0===V||V>this.length)&&(V=this.length),V<=0)||(V>>>=0)<=(N>>>=0))return"";for(B||(B="utf8");;)switch(B){case"hex":return tt(this,N,V);case"utf8":case"utf-8":return ye(this,N,V);case"ascii":return st(this,N,V);case"latin1":case"binary":return Qe(this,N,V);case"base64":return ne(this,N,V);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Xe(this,N,V);default:if(Re)throw new TypeError("Unknown encoding: "+B);B=(B+"").toLowerCase(),Re=!0}}function K(B,N,V){var Re=B[N];B[N]=B[V],B[V]=Re}function E(B,N,V,Re,Ze){if(0===B.length)return-1;if("string"==typeof V?(Re=V,V=0):V>2147483647?V=2147483647:V<-2147483648&&(V=-2147483648),we(V=+V)&&(V=Ze?0:B.length-1),V<0&&(V=B.length+V),V>=B.length){if(Ze)return-1;V=B.length-1}else if(V<0){if(!Ze)return-1;V=0}if("string"==typeof N&&(N=C.from(N,Re)),C.isBuffer(N))return 0===N.length?-1:$(B,N,V,Re,Ze);if("number"==typeof N)return N&=255,"function"==typeof Uint8Array.prototype.indexOf?Ze?Uint8Array.prototype.indexOf.call(B,N,V):Uint8Array.prototype.lastIndexOf.call(B,N,V):$(B,[N],V,Re,Ze);throw new TypeError("val must be string, number or Buffer")}function $(B,N,V,Re,Ze){var Yn,Tt=1,kt=B.length,In=N.length;if(void 0!==Re&&("ucs2"===(Re=String(Re).toLowerCase())||"ucs-2"===Re||"utf16le"===Re||"utf-16le"===Re)){if(B.length<2||N.length<2)return-1;Tt=2,kt/=2,In/=2,V/=2}function Nn(Ls,fs){return 1===Tt?Ls[fs]:Ls.readUInt16BE(fs*Tt)}if(Ze){var Mi=-1;for(Yn=V;Ynkt&&(V=kt-In),Yn=V;Yn>=0;Yn--){for(var xi=!0,Xr=0;XrZe&&(Re=Ze):Re=Ze;var Tt=N.length;Re>Tt/2&&(Re=Tt/2);for(var kt=0;kt>8,Tt.push(V%256),Tt.push(Re);return Tt}(N,B.length-V),B,V,Re)}function ne(B,N,V){return j.fromByteArray(0===N&&V===B.length?B:B.slice(N,V))}function ye(B,N,V){V=Math.min(B.length,V);for(var Re=[],Ze=N;Ze239?4:Tt>223?3:Tt>191?2:1;if(Ze+In<=V)switch(In){case 1:Tt<128&&(kt=Tt);break;case 2:128==(192&(Nn=B[Ze+1]))&&(xi=(31&Tt)<<6|63&Nn)>127&&(kt=xi);break;case 3:Yn=B[Ze+2],128==(192&(Nn=B[Ze+1]))&&128==(192&Yn)&&(xi=(15&Tt)<<12|(63&Nn)<<6|63&Yn)>2047&&(xi<55296||xi>57343)&&(kt=xi);break;case 4:Yn=B[Ze+2],Mi=B[Ze+3],128==(192&(Nn=B[Ze+1]))&&128==(192&Yn)&&128==(192&Mi)&&(xi=(15&Tt)<<18|(63&Nn)<<12|(63&Yn)<<6|63&Mi)>65535&&xi<1114112&&(kt=xi)}null===kt?(kt=65533,In=1):kt>65535&&(Re.push((kt-=65536)>>>10&1023|55296),kt=56320|1023&kt),Re.push(kt),Ze+=In}return function(B){var N=B.length;if(N<=4096)return String.fromCharCode.apply(String,B);for(var V="",Re=0;ReV&&(N+=" ... "),""},C.prototype.compare=function(N,V,Re,Ze,Tt){if(pt(N,Uint8Array)&&(N=C.from(N,N.offset,N.byteLength)),!C.isBuffer(N))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof N);if(void 0===V&&(V=0),void 0===Re&&(Re=N?N.length:0),void 0===Ze&&(Ze=0),void 0===Tt&&(Tt=this.length),V<0||Re>N.length||Ze<0||Tt>this.length)throw new RangeError("out of range index");if(Ze>=Tt&&V>=Re)return 0;if(Ze>=Tt)return-1;if(V>=Re)return 1;if(this===N)return 0;for(var kt=(Tt>>>=0)-(Ze>>>=0),In=(Re>>>=0)-(V>>>=0),Nn=Math.min(kt,In),Yn=this.slice(Ze,Tt),Mi=N.slice(V,Re),xi=0;xi>>=0,isFinite(Re)?(Re>>>=0,void 0===Ze&&(Ze="utf8")):(Ze=Re,Re=void 0)}var Tt=this.length-V;if((void 0===Re||Re>Tt)&&(Re=Tt),N.length>0&&(Re<0||V<0)||V>this.length)throw new RangeError("Attempt to write outside buffer bounds");Ze||(Ze="utf8");for(var kt=!1;;)switch(Ze){case"hex":return Z(this,N,V,Re);case"utf8":case"utf-8":return ae(this,N,V,Re);case"ascii":return oe(this,N,V,Re);case"latin1":case"binary":return te(this,N,V,Re);case"base64":return Te(this,N,V,Re);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return me(this,N,V,Re);default:if(kt)throw new TypeError("Unknown encoding: "+Ze);Ze=(""+Ze).toLowerCase(),kt=!0}},C.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function st(B,N,V){var Re="";V=Math.min(B.length,V);for(var Ze=N;ZeRe)&&(V=Re);for(var Ze="",Tt=N;TtV)throw new RangeError("Trying to access beyond buffer length")}function Le(B,N,V,Re,Ze,Tt){if(!C.isBuffer(B))throw new TypeError('"buffer" argument must be a Buffer instance');if(N>Ze||NB.length)throw new RangeError("Index out of range")}function Ke(B,N,V,Re,Ze,Tt){if(V+Re>B.length)throw new RangeError("Index out of range");if(V<0)throw new RangeError("Index out of range")}function Me(B,N,V,Re,Ze){return N=+N,V>>>=0,Ze||Ke(B,0,V,4),k.write(B,N,V,Re,23,4),V+4}function Ue(B,N,V,Re,Ze){return N=+N,V>>>=0,Ze||Ke(B,0,V,8),k.write(B,N,V,Re,52,8),V+8}C.prototype.slice=function(N,V){var Re=this.length;(N=~~N)<0?(N+=Re)<0&&(N=0):N>Re&&(N=Re),(V=void 0===V?Re:~~V)<0?(V+=Re)<0&&(V=0):V>Re&&(V=Re),V>>=0,V>>>=0,Re||ze(N,V,this.length);for(var Ze=this[N],Tt=1,kt=0;++kt>>=0,V>>>=0,Re||ze(N,V,this.length);for(var Ze=this[N+--V],Tt=1;V>0&&(Tt*=256);)Ze+=this[N+--V]*Tt;return Ze},C.prototype.readUInt8=function(N,V){return N>>>=0,V||ze(N,1,this.length),this[N]},C.prototype.readUInt16LE=function(N,V){return N>>>=0,V||ze(N,2,this.length),this[N]|this[N+1]<<8},C.prototype.readUInt16BE=function(N,V){return N>>>=0,V||ze(N,2,this.length),this[N]<<8|this[N+1]},C.prototype.readUInt32LE=function(N,V){return N>>>=0,V||ze(N,4,this.length),(this[N]|this[N+1]<<8|this[N+2]<<16)+16777216*this[N+3]},C.prototype.readUInt32BE=function(N,V){return N>>>=0,V||ze(N,4,this.length),16777216*this[N]+(this[N+1]<<16|this[N+2]<<8|this[N+3])},C.prototype.readIntLE=function(N,V,Re){N>>>=0,V>>>=0,Re||ze(N,V,this.length);for(var Ze=this[N],Tt=1,kt=0;++kt=(Tt*=128)&&(Ze-=Math.pow(2,8*V)),Ze},C.prototype.readIntBE=function(N,V,Re){N>>>=0,V>>>=0,Re||ze(N,V,this.length);for(var Ze=V,Tt=1,kt=this[N+--Ze];Ze>0&&(Tt*=256);)kt+=this[N+--Ze]*Tt;return kt>=(Tt*=128)&&(kt-=Math.pow(2,8*V)),kt},C.prototype.readInt8=function(N,V){return N>>>=0,V||ze(N,1,this.length),128&this[N]?-1*(255-this[N]+1):this[N]},C.prototype.readInt16LE=function(N,V){N>>>=0,V||ze(N,2,this.length);var Re=this[N]|this[N+1]<<8;return 32768&Re?4294901760|Re:Re},C.prototype.readInt16BE=function(N,V){N>>>=0,V||ze(N,2,this.length);var Re=this[N+1]|this[N]<<8;return 32768&Re?4294901760|Re:Re},C.prototype.readInt32LE=function(N,V){return N>>>=0,V||ze(N,4,this.length),this[N]|this[N+1]<<8|this[N+2]<<16|this[N+3]<<24},C.prototype.readInt32BE=function(N,V){return N>>>=0,V||ze(N,4,this.length),this[N]<<24|this[N+1]<<16|this[N+2]<<8|this[N+3]},C.prototype.readFloatLE=function(N,V){return N>>>=0,V||ze(N,4,this.length),k.read(this,N,!0,23,4)},C.prototype.readFloatBE=function(N,V){return N>>>=0,V||ze(N,4,this.length),k.read(this,N,!1,23,4)},C.prototype.readDoubleLE=function(N,V){return N>>>=0,V||ze(N,8,this.length),k.read(this,N,!0,52,8)},C.prototype.readDoubleBE=function(N,V){return N>>>=0,V||ze(N,8,this.length),k.read(this,N,!1,52,8)},C.prototype.writeUIntLE=function(N,V,Re,Ze){N=+N,V>>>=0,Re>>>=0,Ze||Le(this,N,V,Re,Math.pow(2,8*Re)-1,0);var kt=1,In=0;for(this[V]=255&N;++In>>=0,Re>>>=0,Ze||Le(this,N,V,Re,Math.pow(2,8*Re)-1,0);var kt=Re-1,In=1;for(this[V+kt]=255&N;--kt>=0&&(In*=256);)this[V+kt]=N/In&255;return V+Re},C.prototype.writeUInt8=function(N,V,Re){return N=+N,V>>>=0,Re||Le(this,N,V,1,255,0),this[V]=255&N,V+1},C.prototype.writeUInt16LE=function(N,V,Re){return N=+N,V>>>=0,Re||Le(this,N,V,2,65535,0),this[V]=255&N,this[V+1]=N>>>8,V+2},C.prototype.writeUInt16BE=function(N,V,Re){return N=+N,V>>>=0,Re||Le(this,N,V,2,65535,0),this[V]=N>>>8,this[V+1]=255&N,V+2},C.prototype.writeUInt32LE=function(N,V,Re){return N=+N,V>>>=0,Re||Le(this,N,V,4,4294967295,0),this[V+3]=N>>>24,this[V+2]=N>>>16,this[V+1]=N>>>8,this[V]=255&N,V+4},C.prototype.writeUInt32BE=function(N,V,Re){return N=+N,V>>>=0,Re||Le(this,N,V,4,4294967295,0),this[V]=N>>>24,this[V+1]=N>>>16,this[V+2]=N>>>8,this[V+3]=255&N,V+4},C.prototype.writeIntLE=function(N,V,Re,Ze){if(N=+N,V>>>=0,!Ze){var Tt=Math.pow(2,8*Re-1);Le(this,N,V,Re,Tt-1,-Tt)}var kt=0,In=1,Nn=0;for(this[V]=255&N;++kt>0)-Nn&255;return V+Re},C.prototype.writeIntBE=function(N,V,Re,Ze){if(N=+N,V>>>=0,!Ze){var Tt=Math.pow(2,8*Re-1);Le(this,N,V,Re,Tt-1,-Tt)}var kt=Re-1,In=1,Nn=0;for(this[V+kt]=255&N;--kt>=0&&(In*=256);)N<0&&0===Nn&&0!==this[V+kt+1]&&(Nn=1),this[V+kt]=(N/In>>0)-Nn&255;return V+Re},C.prototype.writeInt8=function(N,V,Re){return N=+N,V>>>=0,Re||Le(this,N,V,1,127,-128),N<0&&(N=255+N+1),this[V]=255&N,V+1},C.prototype.writeInt16LE=function(N,V,Re){return N=+N,V>>>=0,Re||Le(this,N,V,2,32767,-32768),this[V]=255&N,this[V+1]=N>>>8,V+2},C.prototype.writeInt16BE=function(N,V,Re){return N=+N,V>>>=0,Re||Le(this,N,V,2,32767,-32768),this[V]=N>>>8,this[V+1]=255&N,V+2},C.prototype.writeInt32LE=function(N,V,Re){return N=+N,V>>>=0,Re||Le(this,N,V,4,2147483647,-2147483648),this[V]=255&N,this[V+1]=N>>>8,this[V+2]=N>>>16,this[V+3]=N>>>24,V+4},C.prototype.writeInt32BE=function(N,V,Re){return N=+N,V>>>=0,Re||Le(this,N,V,4,2147483647,-2147483648),N<0&&(N=4294967295+N+1),this[V]=N>>>24,this[V+1]=N>>>16,this[V+2]=N>>>8,this[V+3]=255&N,V+4},C.prototype.writeFloatLE=function(N,V,Re){return Me(this,N,V,!0,Re)},C.prototype.writeFloatBE=function(N,V,Re){return Me(this,N,V,!1,Re)},C.prototype.writeDoubleLE=function(N,V,Re){return Ue(this,N,V,!0,Re)},C.prototype.writeDoubleBE=function(N,V,Re){return Ue(this,N,V,!1,Re)},C.prototype.copy=function(N,V,Re,Ze){if(!C.isBuffer(N))throw new TypeError("argument should be a Buffer");if(Re||(Re=0),!Ze&&0!==Ze&&(Ze=this.length),V>=N.length&&(V=N.length),V||(V=0),Ze>0&&Ze=this.length)throw new RangeError("Index out of range");if(Ze<0)throw new RangeError("sourceEnd out of bounds");Ze>this.length&&(Ze=this.length),N.length-V=0;--kt)N[kt+V]=this[kt+Re];else Uint8Array.prototype.set.call(N,this.subarray(Re,Ze),V);return Tt},C.prototype.fill=function(N,V,Re,Ze){if("string"==typeof N){if("string"==typeof V?(Ze=V,V=0,Re=this.length):"string"==typeof Re&&(Ze=Re,Re=this.length),void 0!==Ze&&"string"!=typeof Ze)throw new TypeError("encoding must be a string");if("string"==typeof Ze&&!C.isEncoding(Ze))throw new TypeError("Unknown encoding: "+Ze);if(1===N.length){var Tt=N.charCodeAt(0);("utf8"===Ze&&Tt<128||"latin1"===Ze)&&(N=Tt)}}else"number"==typeof N&&(N&=255);if(V<0||this.length>>=0,Re=void 0===Re?this.length:Re>>>0,N||(N=0),"number"==typeof N)for(kt=V;kt55295&&V<57344){if(!Ze){if(V>56319){(N-=3)>-1&&Tt.push(239,191,189);continue}if(kt+1===Re){(N-=3)>-1&&Tt.push(239,191,189);continue}Ze=V;continue}if(V<56320){(N-=3)>-1&&Tt.push(239,191,189),Ze=V;continue}V=65536+(Ze-55296<<10|V-56320)}else Ze&&(N-=3)>-1&&Tt.push(239,191,189);if(Ze=null,V<128){if((N-=1)<0)break;Tt.push(V)}else if(V<2048){if((N-=2)<0)break;Tt.push(V>>6|192,63&V|128)}else if(V<65536){if((N-=3)<0)break;Tt.push(V>>12|224,V>>6&63|128,63&V|128)}else{if(!(V<1114112))throw new Error("Invalid code point");if((N-=4)<0)break;Tt.push(V>>18|240,V>>12&63|128,V>>6&63|128,63&V|128)}}return Tt}function je(B){return j.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 _t(B,N,V,Re){for(var Ze=0;Ze=N.length||Ze>=B.length);++Ze)N[Ze+V]=B[Ze];return Ze}function pt(B,N){return B instanceof N||null!=B&&null!=B.constructor&&null!=B.constructor.name&&B.constructor.name===N.name}function we(B){return B!=B}}).call(this)}).call(this,Y("buffer").Buffer)},{"base64-js":2,buffer:6,ieee754:9}],7:[function(Y,Se,he){"use strict";Se.exports=function W(j){return null===j||"object"!=typeof j||null!=j.toJSON?JSON.stringify(j):Array.isArray(j)?"["+j.reduce((k,Q,H)=>k+(0===H?"":",")+W(void 0===Q||"symbol"==typeof Q?null:Q),"")+"]":"{"+Object.keys(j).sort().reduce((k,Q,H)=>void 0===j[Q]||"symbol"==typeof j[Q]?k:k+(0===k.length?"":",")+W(Q)+":"+W(j[Q]),"")+"}"}},{}],8:[function(Y,Se,he){"use strict";var k,W="object"==typeof Reflect?Reflect:null,j=W&&"function"==typeof W.apply?W.apply:function($,Z,ae){return Function.prototype.apply.call($,Z,ae)};k=W&&"function"==typeof W.ownKeys?W.ownKeys:Object.getOwnPropertySymbols?function($){return Object.getOwnPropertyNames($).concat(Object.getOwnPropertySymbols($))}:function($){return Object.getOwnPropertyNames($)};var H=Number.isNaN||function($){return $!=$};function w(){w.init.call(this)}Se.exports=w,Se.exports.once=function(E,$){return new Promise(function(Z,ae){function oe(Te){E.removeListener($,te),ae(Te)}function te(){"function"==typeof E.removeListener&&E.removeListener("error",oe),Z([].slice.call(arguments))}K(E,$,te,{once:!0}),"error"!==$&&function(E,$,Z){"function"==typeof E.on&&K(E,"error",$,Z)}(E,oe,{once:!0})})},w.EventEmitter=w,w.prototype._events=void 0,w.prototype._eventsCount=0,w.prototype._maxListeners=void 0;var C=10;function R(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?w.defaultMaxListeners:E._maxListeners}function b(E,$,Z,ae){var oe,te,Te;if(R(Z),void 0===(te=E._events)?(te=E._events=Object.create(null),E._eventsCount=0):(void 0!==te.newListener&&(E.emit("newListener",$,Z.listener?Z.listener:Z),te=E._events),Te=te[$]),void 0===Te)Te=te[$]=Z,++E._eventsCount;else if("function"==typeof Te?Te=te[$]=ae?[Z,Te]:[Te,Z]:ae?Te.unshift(Z):Te.push(Z),(oe=T(E))>0&&Te.length>oe&&!Te.warned){Te.warned=!0;var me=new Error("Possible EventEmitter memory leak detected. "+Te.length+" "+String($)+" listeners added. Use emitter.setMaxListeners() to increase limit");me.name="MaxListenersExceededWarning",me.emitter=E,me.type=$,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 S(E,$,Z){var ae={fired:!1,wrapFn:void 0,target:E,type:$,listener:Z},oe=y.bind(ae);return oe.listener=Z,ae.wrapFn=oe,oe}function A(E,$,Z){var ae=E._events;if(void 0===ae)return[];var oe=ae[$];return void 0===oe?[]:"function"==typeof oe?Z?[oe.listener||oe]:[oe]:Z?function(E){for(var $=new Array(E.length),Z=0;Z<$.length;++Z)$[Z]=E[Z].listener||E[Z];return $}(oe):P(oe,oe.length)}function z(E){var $=this._events;if(void 0!==$){var Z=$[E];if("function"==typeof Z)return 1;if(void 0!==Z)return Z.length}return 0}function P(E,$){for(var Z=new Array($),ae=0;ae<$;++ae)Z[ae]=E[ae];return Z}function K(E,$,Z,ae){if("function"==typeof E.on)ae.once?E.once($,Z):E.on($,Z);else{if("function"!=typeof E.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof E);E.addEventListener($,function oe(te){ae.once&&E.removeEventListener($,oe),Z(te)})}}Object.defineProperty(w,"defaultMaxListeners",{enumerable:!0,get:function(){return C},set:function(E){if("number"!=typeof E||E<0||H(E))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+E+".");C=E}}),w.init=function(){(void 0===this._events||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},w.prototype.setMaxListeners=function($){if("number"!=typeof $||$<0||H($))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+$+".");return this._maxListeners=$,this},w.prototype.getMaxListeners=function(){return T(this)},w.prototype.emit=function($){for(var Z=[],ae=1;ae0&&(Te=Z[0]),Te instanceof Error)throw Te;var me=new Error("Unhandled error."+(Te?" ("+Te.message+")":""));throw me.context=Te,me}var ne=te[$];if(void 0===ne)return!1;if("function"==typeof ne)j(ne,this,Z);else{var ye=ne.length,Oe=P(ne,ye);for(ae=0;ae=0;Te--)if(ae[Te]===Z||ae[Te].listener===Z){me=ae[Te].listener,te=Te;break}if(te<0)return this;0===te?ae.shift():function(E,$){for(;$+1=0;oe--)this.removeListener($,Z[oe]);return this},w.prototype.listeners=function($){return A(this,$,!0)},w.prototype.rawListeners=function($){return A(this,$,!1)},w.listenerCount=function(E,$){return"function"==typeof E.listenerCount?E.listenerCount($):z.call(E,$)},w.prototype.listenerCount=z,w.prototype.eventNames=function(){return this._eventsCount>0?k(this._events):[]}},{}],9:[function(Y,Se,he){he.read=function(W,j,k,Q,H){var w,C,R=8*H-Q-1,T=(1<>1,y=-7,S=k?H-1:0,A=k?-1:1,z=W[j+S];for(S+=A,w=z&(1<<-y)-1,z>>=-y,y+=R;y>0;w=256*w+W[j+S],S+=A,y-=8);for(C=w&(1<<-y)-1,w>>=-y,y+=Q;y>0;C=256*C+W[j+S],S+=A,y-=8);if(0===w)w=1-b;else{if(w===T)return C?NaN:1/0*(z?-1:1);C+=Math.pow(2,Q),w-=b}return(z?-1:1)*C*Math.pow(2,w-Q)},he.write=function(W,j,k,Q,H,w){var C,R,T,b=8*w-H-1,y=(1<>1,A=23===H?Math.pow(2,-24)-Math.pow(2,-77):0,z=Q?0:w-1,P=Q?1:-1,X=j<0||0===j&&1/j<0?1:0;for(j=Math.abs(j),isNaN(j)||j===1/0?(R=isNaN(j)?1:0,C=y):(C=Math.floor(Math.log(j)/Math.LN2),j*(T=Math.pow(2,-C))<1&&(C--,T*=2),(j+=C+S>=1?A/T:A*Math.pow(2,1-S))*T>=2&&(C++,T/=2),C+S>=y?(R=0,C=y):C+S>=1?(R=(j*T-1)*Math.pow(2,H),C+=S):(R=j*Math.pow(2,S-1)*Math.pow(2,H),C=0));H>=8;W[k+z]=255&R,z+=P,R/=256,H-=8);for(C=C<0;W[k+z]=255&C,z+=P,C/=256,b-=8);W[k+z-P]|=128*X}},{}],10:[function(Y,Se,he){Se.exports="function"==typeof Object.create?function(j,k){k&&(j.super_=k,j.prototype=Object.create(k.prototype,{constructor:{value:j,enumerable:!1,writable:!0,configurable:!0}}))}:function(j,k){if(k){j.super_=k;var Q=function(){};Q.prototype=k.prototype,j.prototype=new Q,j.prototype.constructor=j}}},{}],11:[function(Y,Se,he){"use strict";const{isArray:W,isObject:j,isString:k}=Y("./types"),{asArray:Q}=Y("./util"),{prependBase:H}=Y("./url"),w=Y("./JsonLdError"),C=Y("./ResolvedContext");function T(y){throw new w("Invalid JSON-LD syntax; @context must be an object.","jsonld.SyntaxError",{code:"invalid local context",context:y})}function b({context:y,base:S}){if(!y)return;const A=y["@context"];if(k(A))y["@context"]=H(S,A);else if(W(A))for(let z=0;z10)throw new w("Maximum number of @context URLs exceeded.","jsonld.ContextUrlError",{code:"json-ld-1.0"===S.processingMode?"loading remote context failed":"context overflow",max:10});if(P.has(A))throw new w("Cyclical @context URLs detected.","jsonld.ContextUrlError",{code:"json-ld-1.0"===S.processingMode?"recursive context inclusion":"context overflow",url:A});let X,ue;P.add(A);try{ue=yield z(A),X=ue.document||null,k(X)&&(X=JSON.parse(X))}catch(I){throw new w("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:A,cause:I})}if(!j(X))throw new w("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:A});return X="@context"in X?{"@context":X["@context"]}:{"@context":{}},ue.contextUrl&&(W(X["@context"])||(X["@context"]=[X["@context"]]),X["@context"].push(ue.contextUrl)),{context:X,remoteDoc:ue}})()}}},{"./JsonLdError":12,"./ResolvedContext":16,"./types":30,"./url":31,"./util":32}],12:[function(Y,Se,he){"use strict";Se.exports=class extends Error{constructor(j="An unspecified JSON-LD error occurred.",k="jsonld.Error",Q={}){super(j),this.name=k,this.message=j,this.details=Q}}},{}],13:[function(Y,Se,he){"use strict";Se.exports=W=>{class j{toString(){return"[object JsonLdProcessor]"}}return Object.defineProperty(j,"prototype",{writable:!1,enumerable:!1}),Object.defineProperty(j.prototype,"constructor",{writable:!0,enumerable:!1,configurable:!0,value:j}),j.compact=function(k,Q){return arguments.length<2?Promise.reject(new TypeError("Could not compact, too few arguments.")):W.compact(k,Q)},j.expand=function(k){return arguments.length<1?Promise.reject(new TypeError("Could not expand, too few arguments.")):W.expand(k)},j.flatten=function(k){return arguments.length<1?Promise.reject(new TypeError("Could not flatten, too few arguments.")):W.flatten(k)},j}},{}],14:[function(Y,Se,he){"use strict";Se.exports=Y("rdf-canonize").NQuads},{"rdf-canonize":46}],15:[function(Y,Se,he){"use strict";Se.exports=class{constructor(){this._requests={}}wrapLoader(j){const k=this;return k._loader=j,function(){return k.add.apply(k,arguments)}}add(j){var k=this;return yt(function*(){let Q=k._requests[j];if(Q)return Promise.resolve(Q);Q=k._requests[j]=k._loader(j);try{return yield Q}finally{delete k._requests[j]}})()}}},{}],16:[function(Y,Se,he){"use strict";const W=Y("lru-cache");Se.exports=class{constructor({document:Q}){this.document=Q,this.cache=new W({max:10})}getProcessed(Q){return this.cache.get(Q)}setProcessed(Q,H){this.cache.set(Q,H)}}},{"lru-cache":33}],17:[function(Y,Se,he){"use strict";const W=Y("./JsonLdError"),{isArray:j,isObject:k,isString:Q,isUndefined:H}=Y("./types"),{isList:w,isValue:C,isGraph:R,isSimpleGraph:T,isSubjectReference:b}=Y("./graphTypes"),{expandIri:y,getContextValue:S,isKeyword:A,process:z,processingMode:P}=Y("./context"),{removeBase:X,prependBase:ue}=Y("./url"),{addValue:I,asArray:O,compareShortestLeast:K}=Y("./util"),E={};function Z(ae,oe,te){if("@nest"!==y(ae,oe,{vocab:!0},te))throw new W("JSON-LD compact error; nested property must have an @nest value resolving to @nest.","jsonld.SyntaxError",{code:"invalid @nest value"})}Se.exports=E,E.compact=function(){var ae=yt(function*({activeCtx:oe,activeProperty:te=null,element:Te,options:me={},compactionMap:ne=(()=>{})}){if(j(Te)){let Oe=[];for(let $e=0;$e1&&(tt=Array.from(tt).sort());const Xe=oe;for(const Le of tt){const Ke=E.compactIri({activeCtx:Xe,iri:Le,relativeTo:{vocab:!0}}),Me=S(st,Ke,"@context");H(Me)||(oe=yield z({activeCtx:oe,localCtx:Me,options:me,propagate:!1}))}const ze=Object.keys(Te).sort();for(const Le of ze){const Ke=Te[Le];if("@id"!==Le)if("@type"!==Le)if("@reverse"!==Le)if("@preserve"!==Le)if("@index"!==Le)if("@graph"!==Le&&"@list"!==Le&&"@included"!==Le&&A(Le)){const Me=E.compactIri({activeCtx:oe,iri:Le,relativeTo:{vocab:!0}});I($e,Me,Ke)}else{if(!j(Ke))throw new W("JSON-LD expansion error; expanded value must be an array.","jsonld.SyntaxError");if(0===Ke.length){const Me=E.compactIri({activeCtx:oe,iri:Le,value:Ke,relativeTo:{vocab:!0},reverse:Oe}),Ue=oe.mappings.has(Me)?oe.mappings.get(Me)["@nest"]:null;let qe=$e;Ue&&(Z(oe,Ue,me),k($e[Ue])||($e[Ue]={}),qe=$e[Ue]),I(qe,Me,Ke,{propertyIsArray:!0})}for(const Me of Ke){const Ue=E.compactIri({activeCtx:oe,iri:Le,value:Me,relativeTo:{vocab:!0},reverse:Oe}),qe=oe.mappings.has(Ue)?oe.mappings.get(Ue)["@nest"]:null;let ke=$e;qe&&(Z(oe,qe,me),k($e[qe])||($e[qe]={}),ke=$e[qe]);const q=S(oe,Ue,"@container")||[],G=R(Me),pe=w(Me);let de;pe?de=Me["@list"]:G&&(de=Me["@graph"]);let je=yield E.compact({activeCtx:oe,activeProperty:Ue,element:pe||G?de:Me,options:me,compactionMap:ne});if(pe){if(j(je)||(je=[je]),q.includes("@list")){I(ke,Ue,je,{valueIsArray:!0,allowDuplicate:!0});continue}je={[E.compactIri({activeCtx:oe,iri:"@list",relativeTo:{vocab:!0}})]:je},"@index"in Me&&(je[E.compactIri({activeCtx:oe,iri:"@index",relativeTo:{vocab:!0}})]=Me["@index"])}if(G)if(q.includes("@graph")&&(q.includes("@id")||q.includes("@index")&&T(Me))){let _t;ke.hasOwnProperty(Ue)?_t=ke[Ue]:ke[Ue]=_t={};const pt=(q.includes("@id")?Me["@id"]:Me["@index"])||E.compactIri({activeCtx:oe,iri:"@none",relativeTo:{vocab:!0}});I(_t,pt,je,{propertyIsArray:!me.compactArrays||q.includes("@set")})}else q.includes("@graph")&&T(Me)?(j(je)&&je.length>1&&(je={"@included":je}),I(ke,Ue,je,{propertyIsArray:!me.compactArrays||q.includes("@set")})):(j(je)&&1===je.length&&me.compactArrays&&(je=je[0]),je={[E.compactIri({activeCtx:oe,iri:"@graph",relativeTo:{vocab:!0}})]:je},"@id"in Me&&(je[E.compactIri({activeCtx:oe,iri:"@id",relativeTo:{vocab:!0}})]=Me["@id"]),"@index"in Me&&(je[E.compactIri({activeCtx:oe,iri:"@index",relativeTo:{vocab:!0}})]=Me["@index"]),I(ke,Ue,je,{propertyIsArray:!me.compactArrays||q.includes("@set")}));else if(q.includes("@language")||q.includes("@index")||q.includes("@id")||q.includes("@type")){let _t,pt;if(ke.hasOwnProperty(Ue)?_t=ke[Ue]:ke[Ue]=_t={},q.includes("@language"))C(je)&&(je=je["@value"]),pt=Me["@language"];else if(q.includes("@index")){const we=S(oe,Ue,"@index")||"@index",B=E.compactIri({activeCtx:oe,iri:we,relativeTo:{vocab:!0}});if("@index"===we)pt=Me["@index"],delete je[B];else{let N;if([pt,...N]=O(je[we]||[]),Q(pt))switch(N.length){case 0:delete je[we];break;case 1:je[we]=N[0];break;default:je[we]=N}else pt=null}}else if(q.includes("@id")){const we=E.compactIri({activeCtx:oe,iri:"@id",relativeTo:{vocab:!0}});pt=je[we],delete je[we]}else if(q.includes("@type")){const we=E.compactIri({activeCtx:oe,iri:"@type",relativeTo:{vocab:!0}});let B;switch([pt,...B]=O(je[we]||[]),B.length){case 0:delete je[we];break;case 1:je[we]=B[0];break;default:je[we]=B}1===Object.keys(je).length&&"@id"in Me&&(je=yield E.compact({activeCtx:oe,activeProperty:Ue,element:{"@id":Me["@id"]},options:me,compactionMap:ne}))}pt||(pt=E.compactIri({activeCtx:oe,iri:"@none",relativeTo:{vocab:!0}})),I(_t,pt,je,{propertyIsArray:q.includes("@set")})}else{const _t=!me.compactArrays||q.includes("@set")||q.includes("@list")||j(je)&&0===je.length||"@list"===Le||"@graph"===Le;I(ke,Ue,je,{propertyIsArray:_t})}}}else{if((S(oe,te,"@container")||[]).includes("@index"))continue;const Ue=E.compactIri({activeCtx:oe,iri:Le,relativeTo:{vocab:!0}});I($e,Ue,Ke)}else{const Me=yield E.compact({activeCtx:oe,activeProperty:te,element:Ke,options:me,compactionMap:ne});j(Me)&&0===Me.length||I($e,Le,Me)}else{const Me=yield E.compact({activeCtx:oe,activeProperty:"@reverse",element:Ke,options:me,compactionMap:ne});for(const Ue in Me)if(oe.mappings.has(Ue)&&oe.mappings.get(Ue).reverse){const qe=Me[Ue],q=(S(oe,Ue,"@container")||[]).includes("@set")||!me.compactArrays;I($e,Ue,qe,{propertyIsArray:q}),delete Me[Ue]}if(Object.keys(Me).length>0){const Ue=E.compactIri({activeCtx:oe,iri:Le,relativeTo:{vocab:!0}});I($e,Ue,Me)}}else{let Me=O(Ke).map(G=>E.compactIri({activeCtx:st,iri:G,relativeTo:{vocab:!0}}));1===Me.length&&(Me=Me[0]);const Ue=E.compactIri({activeCtx:oe,iri:"@type",relativeTo:{vocab:!0}}),q=(S(oe,Ue,"@container")||[]).includes("@set")&&P(oe,1.1)||j(Me)&&0===Ke.length;I($e,Ue,Me,{propertyIsArray:q})}else{let Me=O(Ke).map(qe=>E.compactIri({activeCtx:oe,iri:qe,relativeTo:{vocab:!1},base:me.base}));1===Me.length&&(Me=Me[0]),$e[E.compactIri({activeCtx:oe,iri:"@id",relativeTo:{vocab:!0}})]=Me}}return $e}return Te});return function(oe){return ae.apply(this,arguments)}}(),E.compactIri=({activeCtx:ae,iri:oe,value:te=null,relativeTo:Te={vocab:!1},reverse:me=!1,base:ne=null})=>{if(null===oe)return oe;ae.isPropertyTermScoped&&ae.previousContext&&(ae=ae.previousContext);const ye=ae.getInverse();if(A(oe)&&oe in ye&&"@none"in ye[oe]&&"@type"in ye[oe]["@none"]&&"@none"in ye[oe]["@none"]["@type"])return ye[oe]["@none"]["@type"]["@none"];if(Te.vocab&&oe in ye){const tt=ae["@language"]||"@none",Xe=[];k(te)&&"@index"in te&&!("@graph"in te)&&Xe.push("@index","@index@set"),k(te)&&"@preserve"in te&&(te=te["@preserve"][0]),R(te)?("@index"in te&&Xe.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in te&&Xe.push("@graph@id","@graph@id@set"),Xe.push("@graph","@graph@set","@set"),"@index"in te||Xe.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in te||Xe.push("@graph@id","@graph@id@set")):k(te)&&!C(te)&&Xe.push("@id","@id@set","@type","@set@type");let ze="@language",Le="@null";if(me)ze="@type",Le="@reverse",Xe.push("@set");else if(w(te)){"@index"in te||Xe.push("@list");const Me=te["@list"];if(0===Me.length)ze="@any",Le="@none";else{let Ue=0===Me.length?tt:null,qe=null;for(let ke=0;kest.includes("_"));$e&&ye.push($e.replace(/^[^_]+_/,"_"))}ye.push("@none");const Oe=ae.inverse[oe];for(const $e of Te){if(!($e in Oe))continue;const st=Oe[$e][me];for(const Qe of ye)if(Qe in st)return st[Qe]}return null}(ae,oe,te,Xe,ze,Le);if(null!==Ke)return Ke}if(Te.vocab&&"@vocab"in ae){const tt=ae["@vocab"];if(0===oe.indexOf(tt)&&oe!==tt){const Xe=oe.substr(tt.length);if(!ae.mappings.has(Xe))return Xe}}let Oe=null;const $e=[];let st=ae.fastCurieMap;const Qe=oe.length-1;for(let tt=0;tt=0;--tt){const Xe=$e[tt],ze=Xe.terms;for(const Le of ze){const Ke=Le+":"+oe.substr(Xe.iri.length);ae.mappings.get(Le)._prefix&&(!ae.mappings.has(Ke)||null===te&&ae.mappings.get(Ke)["@id"]===oe)&&(null===Oe||K(Ke,Oe)<0)&&(Oe=Ke)}}if(null!==Oe)return Oe;for(const[tt,Xe]of ae.mappings)if(Xe&&Xe._prefix&&oe.startsWith(tt+":"))throw new W(`Absolute IRI "${oe}" confused with prefix "${tt}".`,"jsonld.SyntaxError",{code:"IRI confused with prefix",context:ae});return Te.vocab?oe:"@base"in ae?ae["@base"]?X(ue(ne,ae["@base"]),oe):oe:X(ne,oe)},E.compactValue=({activeCtx:ae,activeProperty:oe,value:te,options:Te})=>{if(C(te)){const Oe=S(ae,oe,"@type"),$e=S(ae,oe,"@language"),st=S(ae,oe,"@direction"),Qe=S(ae,oe,"@container")||[],tt="@index"in te&&!Qe.includes("@index");if(!tt&&"@none"!==Oe&&(te["@type"]===Oe||"@language"in te&&te["@language"]===$e&&"@direction"in te&&te["@direction"]===st||"@language"in te&&te["@language"]===$e||"@direction"in te&&te["@direction"]===st))return te["@value"];const Xe=Object.keys(te).length,ze=1===Xe||2===Xe&&"@index"in te&&!tt,Le="@language"in ae,Ke=Q(te["@value"]),Me=ae.mappings.has(oe)&&null===ae.mappings.get(oe)["@language"];if(ze&&"@none"!==Oe&&(!Le||!Ke||Me))return te["@value"];const Ue={};return tt&&(Ue[E.compactIri({activeCtx:ae,iri:"@index",relativeTo:{vocab:!0}})]=te["@index"]),"@type"in te?Ue[E.compactIri({activeCtx:ae,iri:"@type",relativeTo:{vocab:!0}})]=E.compactIri({activeCtx:ae,iri:te["@type"],relativeTo:{vocab:!0}}):"@language"in te&&(Ue[E.compactIri({activeCtx:ae,iri:"@language",relativeTo:{vocab:!0}})]=te["@language"]),"@direction"in te&&(Ue[E.compactIri({activeCtx:ae,iri:"@direction",relativeTo:{vocab:!0}})]=te["@direction"]),Ue[E.compactIri({activeCtx:ae,iri:"@value",relativeTo:{vocab:!0}})]=te["@value"],Ue}const me=y(ae,oe,{vocab:!0},Te),ne=S(ae,oe,"@type"),ye=E.compactIri({activeCtx:ae,iri:te["@id"],relativeTo:{vocab:"@vocab"===ne},base:Te.base});return"@id"===ne||"@vocab"===ne||"@graph"===me?ye:{[E.compactIri({activeCtx:ae,iri:"@id",relativeTo:{vocab:!0}})]:ye}}},{"./JsonLdError":12,"./context":19,"./graphTypes":25,"./types":30,"./url":31,"./util":32}],18:[function(Y,Se,he){"use strict";const W="http://www.w3.org/1999/02/22-rdf-syntax-ns#",j="http://www.w3.org/2001/XMLSchema#";Se.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:j,XSD_BOOLEAN:j+"boolean",XSD_DOUBLE:j+"double",XSD_INTEGER:j+"integer",XSD_STRING:j+"string"}},{}],19:[function(Y,Se,he){"use strict";const W=Y("./util"),j=Y("./JsonLdError"),{isArray:k,isObject:Q,isString:H,isUndefined:w}=Y("./types"),{isAbsolute:C,isRelative:R,prependBase:T}=Y("./url"),{asArray:b,compareShortestLeast:y}=Y("./util"),S=new Map,z=/^@[a-zA-Z]+$/,P={};function X(I,O,K,E,$,Z){if(null===O||!H(O)||P.isKeyword(O))return O;if(O.match(z))return null;if(E&&E.hasOwnProperty(O)&&!0!==$.get(O)&&P.createTermDefinition({activeCtx:I,localCtx:E,term:O,defined:$,options:Z}),(K=K||{}).vocab){const oe=I.mappings.get(O);if(null===oe)return null;if(Q(oe)&&"@id"in oe)return oe["@id"]}const ae=O.indexOf(":");if(ae>0){const oe=O.substr(0,ae),te=O.substr(ae+1);if("_"===oe||0===te.indexOf("//"))return O;E&&E.hasOwnProperty(oe)&&P.createTermDefinition({activeCtx:I,localCtx:E,term:oe,defined:$,options:Z});const Te=I.mappings.get(oe);if(Te&&Te._prefix)return Te["@id"]+te;if(C(O))return O}if(K.vocab&&"@vocab"in I)return I["@vocab"]+O;if(K.base&&"@base"in I){if(I["@base"])return T(T(Z.base,I["@base"]),O)}else if(K.base)return T(Z.base,O);return O}function ue(I,O){if(!I||"object"!=typeof I||!O||"object"!=typeof O)return I===O;const K=Array.isArray(I);if(K!==Array.isArray(O))return!1;if(K){if(I.length!==O.length)return!1;for(let Z=0;Z{if(E.has(K)){if(E.get(K))return;throw new j("Cyclical context definition detected.","jsonld.CyclicalContext",{code:"cyclic IRI mapping",context:O,term:K})}let ae;if(E.set(K,!1),O.hasOwnProperty(K)&&(ae=O[K]),"@type"===K&&Q(ae)&&"@set"===(ae["@container"]||"@set")&&P.processingMode(I,1.1)){const Oe=["@container","@id","@protected"],$e=Object.keys(ae);if(0===$e.length||$e.some(st=>!Oe.includes(st)))throw new j("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:O,term:K})}else{if(P.isKeyword(K))throw new j("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:O,term:K});if(K.match(z))return void console.warn('WARNING: terms beginning with "@" are reserved for future use and ignored',{term:K});if(""===K)throw new j("Invalid JSON-LD syntax; a term cannot be an empty string.","jsonld.SyntaxError",{code:"invalid term definition",context:O})}const oe=I.mappings.get(K);I.mappings.has(K)&&I.mappings.delete(K);let te=!1;if((H(ae)||null===ae)&&(te=!0,ae={"@id":ae}),!Q(ae))throw new j("Invalid JSON-LD syntax; @context term values must be strings or objects.","jsonld.SyntaxError",{code:"invalid term definition",context:O});const Te={};I.mappings.set(K,Te),Te.reverse=!1;const me=["@container","@id","@language","@reverse","@type"];P.processingMode(I,1.1)&&me.push("@context","@direction","@index","@nest","@prefix","@protected");for(const Oe in ae)if(!me.includes(Oe))throw new j("Invalid JSON-LD syntax; a term definition must not contain "+Oe,"jsonld.SyntaxError",{code:"invalid term definition",context:O});const ne=K.indexOf(":");if(Te._termHasColon=ne>0,"@reverse"in ae){if("@id"in ae)throw new j("Invalid JSON-LD syntax; a @reverse term definition must not contain @id.","jsonld.SyntaxError",{code:"invalid reverse property",context:O});if("@nest"in ae)throw new j("Invalid JSON-LD syntax; a @reverse term definition must not contain @nest.","jsonld.SyntaxError",{code:"invalid reverse property",context:O});const Oe=ae["@reverse"];if(!H(Oe))throw new j("Invalid JSON-LD syntax; a @context @reverse value must be a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:O});if(!P.isKeyword(Oe)&&Oe.match(z))return console.warn('WARNING: values beginning with "@" are reserved for future use and ignored',{reverse:Oe}),void(oe?I.mappings.set(K,oe):I.mappings.delete(K));const $e=X(I,Oe,{vocab:!0,base:!1},O,E,$);if(!C($e))throw new j("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:O});Te["@id"]=$e,Te.reverse=!0}else if("@id"in ae){let Oe=ae["@id"];if(Oe&&!H(Oe))throw new j("Invalid JSON-LD syntax; a @context @id value must be an array of strings or a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:O});if(null===Oe)Te["@id"]=null;else{if(!P.isKeyword(Oe)&&Oe.match(z))return console.warn('WARNING: values beginning with "@" are reserved for future use and ignored',{id:Oe}),void(oe?I.mappings.set(K,oe):I.mappings.delete(K));if(Oe!==K){if(Oe=X(I,Oe,{vocab:!0,base:!1},O,E,$),!C(Oe)&&!P.isKeyword(Oe))throw new j("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:O});if(K.match(/(?::[^:])|\//)&&X(I,K,{vocab:!0,base:!1},O,new Map(E).set(K,!0),$)!==Oe)throw new j("Invalid JSON-LD syntax; term in form of IRI must expand to definition.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:O});Te["@id"]=Oe,Te._prefix=te&&!Te._termHasColon&&Oe.match(/[:\/\?#\[\]@]$/)}}}if(!("@id"in Te))if(Te._termHasColon){const Oe=K.substr(0,ne);if(O.hasOwnProperty(Oe)&&P.createTermDefinition({activeCtx:I,localCtx:O,term:Oe,defined:E,options:$}),I.mappings.has(Oe)){const $e=K.substr(ne+1);Te["@id"]=I.mappings.get(Oe)["@id"]+$e}else Te["@id"]=K}else if("@type"===K)Te["@id"]=K;else{if(!("@vocab"in I))throw new j("Invalid JSON-LD syntax; @context terms must define an @id.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:O,term:K});Te["@id"]=I["@vocab"]+K}if((!0===ae["@protected"]||!0===E.get("@protected")&&!1!==ae["@protected"])&&(I.protected[K]=!0,Te.protected=!0),E.set(K,!0),"@type"in ae){let Oe=ae["@type"];if(!H(Oe))throw new j("Invalid JSON-LD syntax; an @context @type value must be a string.","jsonld.SyntaxError",{code:"invalid type mapping",context:O});if("@json"===Oe||"@none"===Oe){if(P.processingMode(I,1))throw new j(`Invalid JSON-LD syntax; an @context @type value must not be "${Oe}" in JSON-LD 1.0 mode.`,"jsonld.SyntaxError",{code:"invalid type mapping",context:O})}else if("@id"!==Oe&&"@vocab"!==Oe){if(Oe=X(I,Oe,{vocab:!0,base:!1},O,E,$),!C(Oe))throw new j("Invalid JSON-LD syntax; an @context @type value must be an absolute IRI.","jsonld.SyntaxError",{code:"invalid type mapping",context:O});if(0===Oe.indexOf("_:"))throw new j("Invalid JSON-LD syntax; an @context @type value must be an IRI, not a blank node identifier.","jsonld.SyntaxError",{code:"invalid type mapping",context:O})}Te["@type"]=Oe}if("@container"in ae){const Oe=H(ae["@container"])?[ae["@container"]]:ae["@container"]||[],$e=["@list","@set","@index","@language"];let st=!0;const Qe=Oe.includes("@set");if(P.processingMode(I,1.1)){if($e.push("@graph","@id","@type"),Oe.includes("@list")){if(1!==Oe.length)throw new j("Invalid JSON-LD syntax; @context @container with @list must have no other values","jsonld.SyntaxError",{code:"invalid container mapping",context:O})}else if(Oe.includes("@graph")){if(Oe.some(tt=>"@graph"!==tt&&"@id"!==tt&&"@index"!==tt&&"@set"!==tt))throw new j("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:O})}else st&=Oe.length<=(Qe?2:1);if(Oe.includes("@type")&&(Te["@type"]=Te["@type"]||"@id",!["@id","@vocab"].includes(Te["@type"])))throw new j("Invalid JSON-LD syntax; container: @type requires @type to be @id or @vocab.","jsonld.SyntaxError",{code:"invalid type mapping",context:O})}else st&=!k(ae["@container"]),st&=Oe.length<=1;if(st&=Oe.every(tt=>$e.includes(tt)),st&=!(Qe&&Oe.includes("@list")),!st)throw new j("Invalid JSON-LD syntax; @context @container value must be one of the following: "+$e.join(", "),"jsonld.SyntaxError",{code:"invalid container mapping",context:O});if(Te.reverse&&!Oe.every(tt=>["@index","@set"].includes(tt)))throw new j("Invalid JSON-LD syntax; @context @container value for a @reverse type definition must be @index or @set.","jsonld.SyntaxError",{code:"invalid reverse property",context:O});Te["@container"]=Oe}if("@index"in ae){if(!("@container"in ae)||!Te["@container"].includes("@index"))throw new j(`Invalid JSON-LD syntax; @index without @index in @container: "${ae["@index"]}" on term "${K}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:O});if(!H(ae["@index"])||0===ae["@index"].indexOf("@"))throw new j(`Invalid JSON-LD syntax; @index must expand to an IRI: "${ae["@index"]}" on term "${K}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:O});Te["@index"]=ae["@index"]}if("@context"in ae&&(Te["@context"]=ae["@context"]),"@language"in ae&&!("@type"in ae)){let Oe=ae["@language"];if(null!==Oe&&!H(Oe))throw new j("Invalid JSON-LD syntax; @context @language value must be a string or null.","jsonld.SyntaxError",{code:"invalid language mapping",context:O});null!==Oe&&(Oe=Oe.toLowerCase()),Te["@language"]=Oe}if("@prefix"in ae){if(K.match(/:|\//))throw new j("Invalid JSON-LD syntax; @context @prefix used on a compact IRI term","jsonld.SyntaxError",{code:"invalid term definition",context:O});if(P.isKeyword(Te["@id"]))throw new j("Invalid JSON-LD syntax; keywords may not be used as prefixes","jsonld.SyntaxError",{code:"invalid term definition",context:O});if("boolean"!=typeof ae["@prefix"])throw new j("Invalid JSON-LD syntax; @context value for @prefix must be boolean","jsonld.SyntaxError",{code:"invalid @prefix value",context:O});Te._prefix=!0===ae["@prefix"]}if("@direction"in ae){const Oe=ae["@direction"];if(null!==Oe&&"ltr"!==Oe&&"rtl"!==Oe)throw new j('Invalid JSON-LD syntax; @direction value must be null, "ltr", or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",context:O});Te["@direction"]=Oe}if("@nest"in ae){const Oe=ae["@nest"];if(!H(Oe)||"@nest"!==Oe&&0===Oe.indexOf("@"))throw new j("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:O});Te["@nest"]=Oe}const ye=Te["@id"];if("@context"===ye||"@preserve"===ye)throw new j("Invalid JSON-LD syntax; @context and @preserve cannot be aliased.","jsonld.SyntaxError",{code:"invalid keyword alias",context:O});if(oe&&oe.protected&&!Z&&(I.protected[K]=!0,Te.protected=!0,!ue(oe,Te))){const Oe=$&&$.protectedMode||"error";if("error"===Oe)throw new j(`Invalid JSON-LD syntax; tried to redefine "${K}" which is a protected term.`,"jsonld.SyntaxError",{code:"protected term redefinition",context:O,term:K});if("warn"===Oe)return void console.warn("WARNING: protected term redefinition",{term:K});throw new j("Invalid protectedMode.","jsonld.SyntaxError",{code:"invalid protected mode",context:O,term:K,protectedMode:Oe})}},P.expandIri=(I,O,K,E)=>X(I,O,K,void 0,void 0,E),P.getInitialContext=I=>{const O=JSON.stringify({processingMode:I.processingMode}),K=S.get(O);if(K)return K;const E={processingMode:I.processingMode,mappings:new Map,inverse:null,getInverse:function(){const Te=this;if(Te.inverse)return Te.inverse;const me=Te.inverse={},ne=Te.fastCurieMap={},ye={},Oe=(Te["@language"]||"@none").toLowerCase(),$e=Te["@direction"],st=Te.mappings,Qe=[...st.keys()].sort(y);for(const tt of Qe){const Xe=st.get(tt);if(null===Xe)continue;let ze=Xe["@container"]||"@none";if(ze=[].concat(ze).sort().join(""),null===Xe["@id"])continue;const Le=b(Xe["@id"]);for(const Ke of Le){let Me=me[Ke];const Ue=P.isKeyword(Ke);if(Me)!Ue&&!Xe._termHasColon&&ye[Ke].push(tt);else if(me[Ke]=Me={},!Ue&&!Xe._termHasColon){ye[Ke]=[tt];const qe={iri:Ke,terms:ye[Ke]};Ke[0]in ne?ne[Ke[0]].push(qe):ne[Ke[0]]=[qe]}if(Me[ze]||(Me[ze]={"@language":{},"@type":{},"@any":{}}),Me=Me[ze],ae(tt,Me["@any"],"@none"),Xe.reverse)ae(tt,Me["@type"],"@reverse");else if("@none"===Xe["@type"])ae(tt,Me["@any"],"@none"),ae(tt,Me["@language"],"@none"),ae(tt,Me["@type"],"@none");else if("@type"in Xe)ae(tt,Me["@type"],Xe["@type"]);else if("@language"in Xe&&"@direction"in Xe){const qe=Xe["@language"],ke=Xe["@direction"];ae(tt,Me["@language"],qe&&ke?`${qe}_${ke}`.toLowerCase():qe?qe.toLowerCase():ke?`_${ke}`:"@null")}else"@language"in Xe?ae(tt,Me["@language"],(Xe["@language"]||"@null").toLowerCase()):"@direction"in Xe?ae(tt,Me["@language"],Xe["@direction"]?`_${Xe["@direction"]}`:"@none"):$e?(ae(tt,Me["@language"],`_${$e}`),ae(tt,Me["@language"],"@none"),ae(tt,Me["@type"],"@none")):(ae(tt,Me["@language"],Oe),ae(tt,Me["@language"],"@none"),ae(tt,Me["@type"],"@none"))}}for(const tt in ne)Z(ne,tt,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===S.size&&S.clear(),S.set(O,E),E;function Z(Te,me,ne){const ye=Te[me],Oe=Te[me]={};let $e,st;for(const Qe of ye)$e=Qe.iri,st=ne>=$e.length?"":$e[ne],st in Oe?Oe[st].push(Qe):Oe[st]=[Qe];for(const Qe in Oe)""!==Qe&&Z(Oe,Qe,ne+1)}function ae(Te,me,ne){me.hasOwnProperty(ne)||(me[ne]=Te)}},P.getContextValue=(I,O,K)=>{if(null===O)return"@context"===K?void 0:null;if(I.mappings.has(O)){const E=I.mappings.get(O);if(w(K))return E;if(E.hasOwnProperty(K))return E[K]}return"@language"===K&&K in I||"@direction"===K&&K in I?I[K]:"@context"!==K?null:void 0},P.processingMode=(I,O)=>O.toString()>="1.1"?!I.processingMode||I.processingMode>="json-ld-"+O.toString():"json-ld-1.0"===I.processingMode,P.isKeyword=I=>{if(!H(I)||"@"!==I[0])return!1;switch(I){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,Se,he){"use strict";const{parseLinkHeader:W,buildHeaders:j}=Y("../util"),{LINK_HEADER_CONTEXT:k}=Y("../constants"),Q=Y("../JsonLdError"),H=Y("../RequestQueue"),{prependBase:w}=Y("../url"),C=/(^|(\r\n))link:/i;function R(T,b,y){const S=new(T=T||XMLHttpRequest);return new Promise((A,z)=>{S.onload=()=>A(S),S.onerror=P=>z(P),S.open("GET",b,!0);for(const P in y)S.setRequestHeader(P,y[P]);S.send()})}Se.exports=({secure:T,headers:b={},xhr:y}={headers:{}})=>{return b=j(b),(new H).wrapLoader(A);function A(P){return z.apply(this,arguments)}function z(){return(z=yt(function*(P){if(0!==P.indexOf("http:")&&0!==P.indexOf("https:"))throw new Q('URL could not be dereferenced; only "http" and "https" URLs are supported.',"jsonld.InvalidUrl",{code:"loading document failed",url:P});if(T&&0!==P.indexOf("https"))throw new Q('URL could not be dereferenced; secure mode is enabled and the URL\'s scheme is not "https".',"jsonld.InvalidUrl",{code:"loading document failed",url:P});let X;try{X=yield R(y,P,b)}catch(E){throw new Q("URL could not be dereferenced, an error occurred.","jsonld.LoadDocumentError",{code:"loading document failed",url:P,cause:E})}if(X.status>=400)throw new Q("URL could not be dereferenced: "+X.statusText,"jsonld.LoadDocumentError",{code:"loading document failed",url:P,httpStatusCode:X.status});let ue={contextUrl:null,documentUrl:P,document:X.response},I=null;const O=X.getResponseHeader("Content-Type");let K;if(C.test(X.getAllResponseHeaders())&&(K=X.getResponseHeader("Link")),K&&"application/ld+json"!==O){const E=W(K),$=E[k];if(Array.isArray($))throw new Q("URL could not be dereferenced, it has more than one associated HTTP Link Header.","jsonld.InvalidUrl",{code:"multiple context link headers",url:P});$&&(ue.contextUrl=$.target),I=E.alternate,I&&"application/ld+json"==I.type&&!(O||"").match(/^application\/(\w*\+)?json$/)&&(ue=yield A(w(P,I.target)))}return ue})).apply(this,arguments)}}},{"../JsonLdError":12,"../RequestQueue":15,"../constants":18,"../url":31,"../util":32}],21:[function(Y,Se,he){"use strict";const W=Y("./JsonLdError"),{isArray:j,isObject:k,isEmptyObject:Q,isString:H,isUndefined:w}=Y("./types"),{isList:C,isValue:R,isGraph:T,isSubject:b}=Y("./graphTypes"),{expandIri:y,getContextValue:S,isKeyword:A,process:z,processingMode:P}=Y("./context"),{isAbsolute:X}=Y("./url"),{addValue:ue,asArray:I,getValues:O,validateTypeValue:K}=Y("./util"),E={};Se.exports=E;const $=/^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$/;function Z(ne){return ae.apply(this,arguments)}function ae(){return(ae=yt(function*({activeCtx:ne,activeProperty:ye,expandedActiveProperty:Oe,element:$e,expandedParent:st,options:Qe={},insideList:tt,typeKey:Xe,typeScopedContext:ze,expansionMap:Le}){const Ke=Object.keys($e).sort(),Me=[];let Ue;const qe=$e[Xe]&&"@json"===y(ne,j($e[Xe])?$e[Xe][0]:$e[Xe],{vocab:!0},Qe);for(const ke of Ke){let G,q=$e[ke];if("@context"===ke)continue;let pe=y(ne,ke,{vocab:!0},Qe);if((null===pe||!X(pe)&&!A(pe))&&(pe=Le({unmappedProperty:ke,activeCtx:ne,activeProperty:ye,parent:$e,options:Qe,insideList:tt,value:q,expandedParent:st}),void 0===pe))continue;if(A(pe)){if("@reverse"===Oe)throw new W("Invalid JSON-LD syntax; a keyword cannot be used as a @reverse property.","jsonld.SyntaxError",{code:"invalid reverse property map",value:q});if(pe in st&&"@included"!==pe&&"@type"!==pe)throw new W("Invalid JSON-LD syntax; colliding keywords detected.","jsonld.SyntaxError",{code:"colliding keywords",keyword:pe})}if("@id"===pe){if(!H(q)){if(!Qe.isFrame)throw new W('Invalid JSON-LD syntax; "@id" value must a string.',"jsonld.SyntaxError",{code:"invalid @id value",value:q});if(k(q)){if(!Q(q))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:q})}else{if(!j(q))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:q});if(!q.every(pt=>H(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:q})}}ue(st,"@id",I(q).map(pt=>H(pt)?y(ne,pt,{base:!0},Qe):pt),{propertyIsArray:Qe.isFrame});continue}if("@type"===pe){k(q)&&(q=Object.fromEntries(Object.entries(q).map(([pt,we])=>[y(ze,pt,{vocab:!0}),I(we).map(B=>y(ze,B,{base:!0,vocab:!0}))]))),K(q,Qe.isFrame),ue(st,"@type",I(q).map(pt=>H(pt)?y(ze,pt,{base:!0,vocab:!0},Qe):pt),{propertyIsArray:Qe.isFrame});continue}if("@included"===pe&&P(ne,1.1)){const pt=I(yield E.expand({activeCtx:ne,activeProperty:ye,element:q,options:Qe,expansionMap:Le}));if(!pt.every(we=>b(we)))throw new W("Invalid JSON-LD syntax; values of @included must expand to node objects.","jsonld.SyntaxError",{code:"invalid @included value",value:q});ue(st,"@included",pt,{propertyIsArray:!0});continue}if("@graph"===pe&&!k(q)&&!j(q))throw new W('Invalid JSON-LD syntax; "@graph" value must not be an object or an array.',"jsonld.SyntaxError",{code:"invalid @graph value",value:q});if("@value"===pe){Ue=q,qe&&P(ne,1.1)?st["@value"]=q:ue(st,"@value",q,{propertyIsArray:Qe.isFrame});continue}if("@language"===pe){if(null===q)continue;if(!H(q)&&!Qe.isFrame)throw new W('Invalid JSON-LD syntax; "@language" value must be a string.',"jsonld.SyntaxError",{code:"invalid language-tagged string",value:q});q=I(q).map(pt=>H(pt)?pt.toLowerCase():pt);for(const pt of q)H(pt)&&!pt.match($)&&console.warn(`@language must be valid BCP47: ${pt}`);ue(st,"@language",q,{propertyIsArray:Qe.isFrame});continue}if("@direction"===pe){if(!H(q)&&!Qe.isFrame)throw new W('Invalid JSON-LD syntax; "@direction" value must be a string.',"jsonld.SyntaxError",{code:"invalid base direction",value:q});q=I(q);for(const pt of q)if(H(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:q});ue(st,"@direction",q,{propertyIsArray:Qe.isFrame});continue}if("@index"===pe){if(!H(q))throw new W('Invalid JSON-LD syntax; "@index" value must be a string.',"jsonld.SyntaxError",{code:"invalid @index value",value:q});ue(st,"@index",q);continue}if("@reverse"===pe){if(!k(q))throw new W('Invalid JSON-LD syntax; "@reverse" value must be an object.',"jsonld.SyntaxError",{code:"invalid @reverse value",value:q});if(G=yield E.expand({activeCtx:ne,activeProperty:"@reverse",element:q,options:Qe,expansionMap:Le}),"@reverse"in G)for(const we in G["@reverse"])ue(st,we,G["@reverse"][we],{propertyIsArray:!0});let pt=st["@reverse"]||null;for(const we in G){if("@reverse"===we)continue;null===pt&&(pt=st["@reverse"]={}),ue(pt,we,[],{propertyIsArray:!0});const B=G[we];for(let N=0;N"@id"===pt||"@index"===pt)&&(G=I(G).map(pt=>({"@graph":I(pt)}))),de.mappings.has(ke)&&de.mappings.get(ke).reverse){const pt=st["@reverse"]=st["@reverse"]||{};G=I(G);for(let we=0;we"@value"===y(ne,pe,{vocab:!0},Qe)))throw new W("Invalid JSON-LD syntax; nested value must be a node object.","jsonld.SyntaxError",{code:"invalid @nest value",value:G});yield Z({activeCtx:ne,activeProperty:ye,expandedActiveProperty:Oe,element:G,expandedParent:st,options:Qe,insideList:tt,typeScopedContext:ze,typeKey:Xe,expansionMap:Le})}}})).apply(this,arguments)}function oe({activeCtx:ne,activeProperty:ye,value:Oe,options:$e}){if(null==Oe)return null;const st=y(ne,ye,{vocab:!0},$e);if("@id"===st)return y(ne,Oe,{base:!0},$e);if("@type"===st)return y(ne,Oe,{vocab:!0,base:!0},$e);const Qe=S(ne,ye,"@type");if(("@id"===Qe||"@graph"===st)&&H(Oe))return{"@id":y(ne,Oe,{base:!0},$e)};if("@vocab"===Qe&&H(Oe))return{"@id":y(ne,Oe,{vocab:!0,base:!0},$e)};if(A(st))return Oe;const tt={};if(Qe&&!["@id","@vocab","@none"].includes(Qe))tt["@type"]=Qe;else if(H(Oe)){const Xe=S(ne,ye,"@language");null!==Xe&&(tt["@language"]=Xe);const ze=S(ne,ye,"@direction");null!==ze&&(tt["@direction"]=ze)}return["boolean","number","string"].includes(typeof Oe)||(Oe=Oe.toString()),tt["@value"]=Oe,tt}function te(ne,ye,Oe,$e){const st=[],Qe=Object.keys(ye).sort();for(const tt of Qe){const Xe=y(ne,tt,{vocab:!0},$e);let ze=ye[tt];j(ze)||(ze=[ze]);for(const Le of ze){if(null===Le)continue;if(!H(Le))throw new W("Invalid JSON-LD syntax; language map values must be strings.","jsonld.SyntaxError",{code:"invalid language map value",languageMap:ye});const Ke={"@value":Le};"@none"!==Xe&&(Ke["@language"]=tt.toLowerCase()),Oe&&(Ke["@direction"]=Oe),st.push(Ke)}}return st}function Te(ne){return me.apply(this,arguments)}function me(){return(me=yt(function*({activeCtx:ne,options:ye,activeProperty:Oe,value:$e,expansionMap:st,asGraph:Qe,indexKey:tt,propertyIndex:Xe}){const ze=[],Le=Object.keys($e).sort(),Ke="@type"===tt;for(let Me of Le){if(Ke){const ke=S(ne,Me,"@context");w(ke)||(ne=yield z({activeCtx:ne,localCtx:ke,propagate:!1,options:ye}))}let qe,Ue=$e[Me];j(Ue)||(Ue=[Ue]),Ue=yield E.expand({activeCtx:ne,activeProperty:Oe,element:Ue,options:ye,insideList:!1,insideIndex:!0,expansionMap:st}),qe=Xe?"@none"===Me?"@none":oe({activeCtx:ne,activeProperty:tt,value:Me,options:ye}):y(ne,Me,{vocab:!0},ye),"@id"===tt?Me=y(ne,Me,{base:!0},ye):Ke&&(Me=qe);for(let ke of Ue){if(Qe&&!T(ke)&&(ke={"@graph":[ke]}),"@type"===tt)"@none"===qe||(ke["@type"]=ke["@type"]?[Me].concat(ke["@type"]):[Me]);else{if(R(ke)&&!["@language","@type","@index"].includes(tt))throw new W(`Invalid JSON-LD syntax; Attempt to add illegal key to value object: "${tt}".`,"jsonld.SyntaxError",{code:"invalid value object",value:ke});Xe?"@none"!==qe&&ue(ke,Xe,qe,{propertyIsArray:!0,prependValue:!0}):"@none"!==qe&&!(tt in ke)&&(ke[tt]=Me)}ze.push(ke)}}return ze})).apply(this,arguments)}E.expand=function(){var ne=yt(function*({activeCtx:ye,activeProperty:Oe=null,element:$e,options:st={},insideList:Qe=!1,insideIndex:tt=!1,typeScopedContext:Xe=null,expansionMap:ze=(()=>{})}){if(null==$e)return null;if("@default"===Oe&&(st=Object.assign({},st,{isFrame:!1})),!j($e)&&!k($e)){if(!Qe&&(null===Oe||"@graph"===y(ye,Oe,{vocab:!0},st))){const G=yield ze({unmappedValue:$e,activeCtx:ye,activeProperty:Oe,options:st,insideList:Qe});return void 0===G?null:G}return oe({activeCtx:ye,activeProperty:Oe,value:$e,options:st})}if(j($e)){let G=[];const pe=S(ye,Oe,"@container")||[];Qe=Qe||pe.includes("@list");for(let de=0;de<$e.length;++de){let je=yield E.expand({activeCtx:ye,activeProperty:Oe,element:$e[de],options:st,expansionMap:ze,insideIndex:tt,typeScopedContext:Xe});Qe&&j(je)&&(je={"@list":je}),(null!==je||(je=yield ze({unmappedValue:$e[de],activeCtx:ye,activeProperty:Oe,parent:$e,index:de,options:st,expandedParent:G,insideList:Qe}),void 0!==je))&&(j(je)?G=G.concat(je):G.push(je))}return G}const Le=y(ye,Oe,{vocab:!0},st),Ke=S(ye,Oe,"@context");Xe=Xe||(ye.previousContext?ye:null);let Me=Object.keys($e).sort(),Ue=!tt;if(Ue&&Xe&&Me.length<=2&&!Me.includes("@context"))for(const G of Me){const pe=y(Xe,G,{vocab:!0},st);if("@value"===pe){Ue=!1,ye=Xe;break}if("@id"===pe&&1===Me.length){Ue=!1;break}}Ue&&(ye=ye.revertToPreviousContext()),w(Ke)||(ye=yield z({activeCtx:ye,localCtx:Ke,propagate:!0,overrideProtected:!0,options:st})),"@context"in $e&&(ye=yield z({activeCtx:ye,localCtx:$e["@context"],options:st})),Xe=ye;let qe=null;for(const G of Me)if("@type"===y(ye,G,{vocab:!0},st)){qe=qe||G;const de=$e[G],je=Array.isArray(de)?de.length>1?de.slice().sort():de:[de];for(const _t of je){const pt=S(Xe,_t,"@context");w(pt)||(ye=yield z({activeCtx:ye,localCtx:pt,options:st,propagate:!1}))}}let ke={};yield Z({activeCtx:ye,activeProperty:Oe,expandedActiveProperty:Le,element:$e,expandedParent:ke,options:st,insideList:Qe,typeKey:qe,typeScopedContext:Xe,expansionMap:ze}),Me=Object.keys(ke);let q=Me.length;if("@value"in ke){if("@type"in ke&&("@language"in ke||"@direction"in ke))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:ke});let G=q-1;if("@type"in ke&&(G-=1),"@index"in ke&&(G-=1),"@language"in ke&&(G-=1),"@direction"in ke&&(G-=1),0!==G)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:ke});const pe=null===ke["@value"]?[]:I(ke["@value"]),de=O(ke,"@type");if(!P(ye,1.1)||!de.includes("@json")||1!==de.length)if(0===pe.length){const je=yield ze({unmappedValue:ke,activeCtx:ye,activeProperty:Oe,element:$e,options:st,insideList:Qe});ke=void 0!==je?je:null}else{if(!pe.every(je=>H(je)||Q(je))&&"@language"in ke)throw new W("Invalid JSON-LD syntax; only strings may be language-tagged.","jsonld.SyntaxError",{code:"invalid language-tagged value",element:ke});if(!de.every(je=>X(je)&&!(H(je)&&0===je.indexOf("_:"))||Q(je)))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:ke})}}else if("@type"in ke&&!j(ke["@type"]))ke["@type"]=[ke["@type"]];else if("@set"in ke||"@list"in ke){if(q>1&&(2!==q||!("@index"in ke)))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:ke});"@set"in ke&&(ke=ke["@set"],Me=Object.keys(ke),q=Me.length)}else if(1===q&&"@language"in ke){const G=yield ze(ke,{unmappedValue:ke,activeCtx:ye,activeProperty:Oe,element:$e,options:st,insideList:Qe});ke=void 0!==G?G:null}if(k(ke)&&!st.keepFreeFloatingNodes&&!Qe&&(null===Oe||"@graph"===Le)&&(0===q||"@value"in ke||"@list"in ke||1===q&&"@id"in ke)){const G=yield ze({unmappedValue:ke,activeCtx:ye,activeProperty:Oe,element:$e,options:st,insideList:Qe});ke=void 0!==G?G:null}return ke});return function(ye){return ne.apply(this,arguments)}}()},{"./JsonLdError":12,"./context":19,"./graphTypes":25,"./types":30,"./url":31,"./util":32}],22:[function(Y,Se,he){"use strict";const{isSubjectReference:W}=Y("./graphTypes"),{createMergedNodeMap:j}=Y("./nodeMap"),k={};Se.exports=k,k.flatten=Q=>{const H=j(Q),w=[],C=Object.keys(H).sort();for(let R=0;R=0;--ae){const oe=Z[ae];if(oe.graph===$&&oe.subject["@id"]===E["@id"])return!0}return!1}function S(E,$,Z){const ae="@"+Z;let oe=ae in E?E[ae][0]:$[Z];if("embed"===Z)if(!0===oe)oe="@once";else if(!1===oe)oe="@never";else if("@always"!==oe&&"@never"!==oe&&"@link"!==oe&&"@first"!==oe&&"@last"!==oe&&"@once"!==oe)throw new w("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:E});return oe}function A(E){if(!k.isArray(E)||1!==E.length||!k.isObject(E[0]))throw new w("Invalid JSON-LD syntax; a JSON-LD frame must be a single object.","jsonld.SyntaxError",{frame:E});if("@id"in E[0])for(const $ of Q.asArray(E[0]["@id"]))if(!k.isObject($)&&!H.isAbsolute($)||k.isString($)&&0===$.indexOf("_:"))throw new w("Invalid JSON-LD syntax; invalid @id in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:E});if("@type"in E[0])for(const $ of Q.asArray(E[0]["@type"]))if(!k.isObject($)&&!H.isAbsolute($)||k.isString($)&&0===$.indexOf("_:"))throw new w("Invalid JSON-LD syntax; invalid @type in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:E})}function P(E,$,Z,ae){let oe=!0,te=!1;for(const Te in Z){let me=!1;const ne=Q.getValues($,Te),ye=0===Q.getValues(Z,Te).length;if("@id"===Te){if(k.isEmptyObject(Z["@id"][0]||{})?me=!0:Z["@id"].length>=0&&(me=Z["@id"].includes(ne[0])),!ae.requireAll)return me}else if("@type"===Te){if(oe=!1,ye){if(ne.length>0)return!1;me=!0}else if(1===Z["@type"].length&&k.isEmptyObject(Z["@type"][0]))me=ne.length>0;else for(const Oe of Z["@type"])me=!(!k.isObject(Oe)||!("@default"in Oe))||me||ne.some($e=>$e===Oe);if(!ae.requireAll)return me}else{if(W(Te))continue;{const Oe=Q.getValues(Z,Te)[0];let $e=!1;if(Oe&&(A([Oe]),$e="@default"in Oe),oe=!1,0===ne.length&&$e)continue;if(ne.length>0&&ye)return!1;if(void 0===Oe){if(ne.length>0)return!1;me=!0}else if(j.isList(Oe)){const st=Oe["@list"][0];if(j.isList(ne[0])){const Qe=ne[0]["@list"];j.isValue(st)?me=Qe.some(tt=>K(st,tt)):(j.isSubject(st)||j.isSubjectReference(st))&&(me=Qe.some(tt=>O(E,st,tt,ae)))}}else me=j.isValue(Oe)?ne.some(st=>K(Oe,st)):j.isSubjectReference(Oe)?ne.some(st=>O(E,Oe,st,ae)):!!k.isObject(Oe)&&ne.length>0}}if(!me&&ae.requireAll)return!1;te=te||me}return oe||te}function X(E,$){const Z=E.uniqueEmbeds[E.graph],ae=Z[$],oe=ae.parent,te=ae.property,Te={"@id":$};if(k.isArray(oe)){for(let ne=0;ne{const ye=Object.keys(Z);for(const Oe of ye)Oe in Z&&k.isObject(Z[Oe].parent)&&Z[Oe].parent["@id"]===ne&&(delete Z[Oe],me(Oe))};me($)}function ue(E,$){if(k.isArray(E))return E.map(Z=>ue(Z,$));if(k.isObject(E)){if("@preserve"in E)return E["@preserve"][0];if(j.isValue(E))return E;if(j.isList(E))return E["@list"]=ue(E["@list"],$),E;if("@id"in E){const Z=E["@id"];if($.link.hasOwnProperty(Z)){const ae=$.link[Z].indexOf(E);if(-1!==ae)return $.link[Z][ae];$.link[Z].push(E)}else $.link[Z]=[E]}for(const Z in E)"@id"===Z&&$.bnodesToClear.includes(E[Z])?delete E["@id"]:E[Z]=ue(E[Z],$)}return E}function I(E,$,Z){k.isObject(E)?Q.addValue(E,$,Z,{propertyIsArray:!0}):E.push(Z)}function O(E,$,Z,ae){if(!("@id"in Z))return!1;const oe=E.subjects[Z["@id"]];return oe&&P(E,oe,$,ae)}function K(E,$){const Z=$["@value"],ae=$["@type"],oe=$["@language"],te=E["@value"]?k.isArray(E["@value"])?E["@value"]:[E["@value"]]:[],Te=E["@type"]?k.isArray(E["@type"])?E["@type"]:[E["@type"]]:[],me=E["@language"]?k.isArray(E["@language"])?E["@language"]:[E["@language"]]:[];return 0===te.length&&0===Te.length&&0===me.length||!(!te.includes(Z)&&!k.isEmptyObject(te[0])||!(!ae&&0===Te.length||Te.includes(ae)||ae&&k.isEmptyObject(Te[0]))||!(!oe&&0===me.length||me.includes(oe)||oe&&k.isEmptyObject(me[0])))}Se.exports=T,T.frameMergedOrDefault=(E,$,Z)=>{const ae={options:Z,embedded:!1,graph:"@default",graphMap:{"@default":{}},subjectStack:[],link:{},bnodeMap:{}},oe=new Q.IdentifierIssuer("_:b");C(E,ae.graphMap,"@default",oe),Z.merged&&(ae.graphMap["@merged"]=R(ae.graphMap),ae.graph="@merged"),ae.subjects=ae.graphMap[ae.graph];const te=[];return T.frame(ae,Object.keys(ae.subjects).sort(),$,te),Z.pruneBlankNodeIdentifiers&&(Z.bnodesToClear=Object.keys(ae.bnodeMap).filter(Te=>1===ae.bnodeMap[Te].length)),Z.link={},ue(te,Z)},T.frame=(E,$,Z,ae,oe=null)=>{A(Z);const te=E.options,Te={embed:S(Z=Z[0],te,"embed"),explicit:S(Z,te,"explicit"),requireAll:S(Z,te,"requireAll")};E.link.hasOwnProperty(E.graph)||(E.link[E.graph]={});const me=E.link[E.graph],ne=function(E,$,Z,ae){const oe={};for(const te of $){const Te=E.graphMap[E.graph][te];P(E,Te,Z,ae)&&(oe[te]=Te)}return oe}(E,$,Z,Te),ye=Object.keys(ne).sort();for(const Oe of ye){const $e=ne[Oe];if(null===oe?E.uniqueEmbeds={[E.graph]:{}}:E.uniqueEmbeds[E.graph]=E.uniqueEmbeds[E.graph]||{},"@link"===Te.embed&&Oe in me){I(ae,oe,me[Oe]);continue}const st={"@id":Oe};if(0===Oe.indexOf("_:")&&Q.addValue(E.bnodeMap,Oe,st,{propertyIsArray:!0}),me[Oe]=st,("@first"===Te.embed||"@last"===Te.embed)&&E.is11)throw new w("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:Z});if(E.embedded||!E.uniqueEmbeds[E.graph].hasOwnProperty(Oe)){if(E.embedded&&("@never"===Te.embed||y($e,E.graph,E.subjectStack))){I(ae,oe,st);continue}if(E.embedded&&("@first"==Te.embed||"@once"==Te.embed)&&E.uniqueEmbeds[E.graph].hasOwnProperty(Oe)){I(ae,oe,st);continue}if("@last"===Te.embed&&Oe in E.uniqueEmbeds[E.graph]&&X(E,Oe),E.uniqueEmbeds[E.graph][Oe]={parent:ae,property:oe},E.subjectStack.push({subject:$e,graph:E.graph}),Oe in E.graphMap){let Qe=!1,tt=null;"@graph"in Z?(tt=Z["@graph"][0],Qe=!("@merged"===Oe||"@default"===Oe),k.isObject(tt)||(tt={})):(Qe="@merged"!==E.graph,tt={}),Qe&&T.frame(Sn(ot({},E),{graph:Oe,embedded:!1}),Object.keys(E.graphMap[Oe]).sort(),[tt],st,"@graph")}"@included"in Z&&T.frame(Sn(ot({},E),{embedded:!1}),$,Z["@included"],st,"@included");for(const Qe of Object.keys($e).sort())if(W(Qe)){if(st[Qe]=Q.clone($e[Qe]),"@type"===Qe)for(const tt of $e["@type"])0===tt.indexOf("_:")&&Q.addValue(E.bnodeMap,tt,st,{propertyIsArray:!0})}else if(!Te.explicit||Qe in Z)for(const tt of $e[Qe]){const Xe=Qe in Z?Z[Qe]:b(Te);if(j.isList(tt)){const ze=Z[Qe]&&Z[Qe][0]&&Z[Qe][0]["@list"]?Z[Qe][0]["@list"]:b(Te),Le={"@list":[]};I(st,Qe,Le);const Ke=tt["@list"];for(const Me of Ke)j.isSubjectReference(Me)?T.frame(Sn(ot({},E),{embedded:!0}),[Me["@id"]],ze,Le,"@list"):I(Le,"@list",Q.clone(Me))}else j.isSubjectReference(tt)?T.frame(Sn(ot({},E),{embedded:!0}),[tt["@id"]],Xe,st,Qe):K(Xe[0],tt)&&I(st,Qe,Q.clone(tt))}for(const Qe of Object.keys(Z).sort()){if("@type"===Qe){if(!k.isObject(Z[Qe][0])||!("@default"in Z[Qe][0]))continue}else if(W(Qe))continue;const tt=Z[Qe][0]||{};if(!S(tt,te,"omitDefault")&&!(Qe in st)){let ze="@null";"@default"in tt&&(ze=Q.clone(tt["@default"])),k.isArray(ze)||(ze=[ze]),st[Qe]=[{"@preserve":ze}]}}for(const Qe of Object.keys(Z["@reverse"]||{}).sort()){const tt=Z["@reverse"][Qe];for(const Xe of Object.keys(E.subjects))Q.getValues(E.subjects[Xe],Qe).some(Le=>Le["@id"]===Oe)&&(st["@reverse"]=st["@reverse"]||{},Q.addValue(st["@reverse"],Qe,[],{propertyIsArray:!0}),T.frame(Sn(ot({},E),{embedded:!0}),[Xe],tt,st["@reverse"][Qe],oe))}I(ae,oe,st),E.subjectStack.pop()}}},T.cleanupNull=(E,$)=>{if(k.isArray(E))return E.map(ae=>T.cleanupNull(ae,$)).filter(ae=>ae);if("@null"===E)return null;if(k.isObject(E)){if("@id"in E){const Z=E["@id"];if($.link.hasOwnProperty(Z)){const ae=$.link[Z].indexOf(E);if(-1!==ae)return $.link[Z][ae];$.link[Z].push(E)}else $.link[Z]=[E]}for(const Z in E)E[Z]=T.cleanupNull(E[Z],$)}return E}},{"./JsonLdError":12,"./context":19,"./graphTypes":25,"./nodeMap":27,"./types":30,"./url":31,"./util":32}],24:[function(Y,Se,he){"use strict";const W=Y("./JsonLdError"),j=Y("./graphTypes"),k=Y("./types"),Q=Y("./util"),{RDF_LIST:H,RDF_FIRST:w,RDF_REST:C,RDF_NIL:R,RDF_TYPE:T,RDF_JSON_LITERAL:b,XSD_BOOLEAN:y,XSD_DOUBLE:S,XSD_INTEGER:A,XSD_STRING:z}=Y("./constants"),P=/^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$/,X={};function ue(I,O,K){if(I.termType.endsWith("Node"))return{"@id":I.value};const E={"@value":I.value};if(I.language)E["@language"]=I.language;else{let $=I.datatype.value;if($||($=z),$===b){$="@json";try{E["@value"]=JSON.parse(E["@value"])}catch(Z){throw new W("JSON literal could not be parsed.","jsonld.InvalidJsonLiteral",{code:"invalid JSON literal",value:E["@value"],cause:Z})}}if(O){if($===y)"true"===E["@value"]?E["@value"]=!0:"false"===E["@value"]&&(E["@value"]=!1);else if(k.isNumeric(E["@value"]))if($===A){const Z=parseInt(E["@value"],10);Z.toFixed(0)===E["@value"]&&(E["@value"]=Z)}else $===S&&(E["@value"]=parseFloat(E["@value"]));[y,A,S,z].includes($)||(E["@type"]=$)}else if("i18n-datatype"===K&&$.startsWith("https://www.w3.org/ns/i18n#")){const[,Z,ae]=$.split(/[#_]/);Z.length>0&&(E["@language"]=Z,Z.match(P)||console.warn(`@language must be valid BCP47: ${Z}`)),E["@direction"]=ae}else $!==z&&(E["@type"]=$)}return E}Se.exports=X,X.fromRDF=function(){var I=yt(function*(O,{useRdfType:K=!1,useNativeTypes:E=!1,rdfDirection:$=null}){const Z={},ae={"@default":Z},oe={};for(const me of O){const ne="DefaultGraph"===me.graph.termType?"@default":me.graph.value;ne in ae||(ae[ne]={}),"@default"!==ne&&!(ne in Z)&&(Z[ne]={"@id":ne});const ye=ae[ne],Oe=me.subject.value,$e=me.predicate.value,st=me.object;Oe in ye||(ye[Oe]={"@id":Oe});const Qe=ye[Oe],tt=st.termType.endsWith("Node");if(tt&&!(st.value in ye)&&(ye[st.value]={"@id":st.value}),$e===T&&!K&&tt){Q.addValue(Qe,"@type",st.value,{propertyIsArray:!0});continue}const Xe=ue(st,E,$);if(Q.addValue(Qe,$e,Xe,{propertyIsArray:!0}),tt)if(st.value===R){const ze=ye[st.value];"usages"in ze||(ze.usages=[]),ze.usages.push({node:Qe,property:$e,value:Xe})}else oe[st.value]=!(st.value in oe)&&{node:Qe,property:$e,value:Xe}}for(const me in ae){const ne=ae[me];if(!(R in ne))continue;const ye=ne[R];if(ye.usages){for(let Oe of ye.usages){let $e=Oe.node,st=Oe.property,Qe=Oe.value;const tt=[],Xe=[];let ze=Object.keys($e).length;for(;st===C&&k.isObject(oe[$e["@id"]])&&k.isArray($e[w])&&1===$e[w].length&&k.isArray($e[C])&&1===$e[C].length&&(3===ze||4===ze&&k.isArray($e["@type"])&&1===$e["@type"].length&&$e["@type"][0]===H)&&(tt.push($e[w][0]),Xe.push($e["@id"]),Oe=oe[$e["@id"]],$e=Oe.node,st=Oe.property,Qe=Oe.value,ze=Object.keys($e).length,j.isBlankNode($e)););delete Qe["@id"],Qe["@list"]=tt.reverse();for(const Le of Xe)delete ne[Le]}delete ye.usages}}const te=[],Te=Object.keys(Z).sort();for(const me of Te){const ne=Z[me];if(me in ae){const ye=ne["@graph"]=[],Oe=ae[me],$e=Object.keys(Oe).sort();for(const st of $e){const Qe=Oe[st];j.isSubjectReference(Qe)||ye.push(Qe)}}j.isSubjectReference(ne)||te.push(ne)}return te});return function(O,K){return I.apply(this,arguments)}}()},{"./JsonLdError":12,"./constants":18,"./graphTypes":25,"./types":30,"./util":32}],25:[function(Y,Se,he){"use strict";const W=Y("./types"),j={};Se.exports=j,j.isSubject=k=>!(!W.isObject(k)||"@value"in k||"@set"in k||"@list"in k)&&(Object.keys(k).length>1||!("@id"in k)),j.isSubjectReference=k=>W.isObject(k)&&1===Object.keys(k).length&&"@id"in k,j.isValue=k=>W.isObject(k)&&"@value"in k,j.isList=k=>W.isObject(k)&&"@list"in k,j.isGraph=k=>W.isObject(k)&&"@graph"in k&&1===Object.keys(k).filter(Q=>"@id"!==Q&&"@index"!==Q).length,j.isSimpleGraph=k=>j.isGraph(k)&&!("@id"in k),j.isBlankNode=k=>!!W.isObject(k)&&("@id"in k?0===k["@id"].indexOf("_:"):0===Object.keys(k).length||!("@value"in k||"@set"in k||"@list"in k))},{"./types":30}],26:[function(Y,Se,he){const W=Y("rdf-canonize"),j=Y("./platform"),k=Y("./util"),Q=Y("./ContextResolver"),H=k.IdentifierIssuer,w=Y("./JsonLdError"),C=Y("lru-cache"),R=Y("./NQuads"),{expand:T}=Y("./expand"),{flatten:b}=Y("./flatten"),{fromRDF:y}=Y("./fromRdf"),{toRDF:S}=Y("./toRdf"),{frameMergedOrDefault:A,cleanupNull:z}=Y("./frame"),{isArray:P,isObject:X,isString:ue}=Y("./types"),{isSubjectReference:I}=Y("./graphTypes"),{expandIri:O,getInitialContext:K,process:E,processingMode:$}=Y("./context"),{compact:Z,compactIri:ae}=Y("./compact"),{createNodeMap:oe,createMergedNodeMap:te,mergeNodeMaps:Te}=Y("./nodeMap"),me=function(ye){const Oe={},st=new C({max:100});function Qe(tt,Le){var Ke=Le,{documentLoader:Xe=ye.documentLoader}=Ke,ze=Nq(Ke,["documentLoader"]);return Object.assign({},{documentLoader:Xe},ze,tt)}return ye.compact=function(){var tt=yt(function*(Xe,ze,Le){if(arguments.length<2)throw new TypeError("Could not compact, too few arguments.");if(null===ze)throw new w("The compaction context must not be null.","jsonld.CompactError",{code:"invalid local context"});if(null===Xe)return null;let Ke;(Le=Qe(Le,{base:ue(Xe)?Xe:"",compactArrays:!0,compactToRelative:!0,graph:!1,skipExpansion:!1,link:!1,issuer:new H("_:b"),contextResolver:new Q({sharedCache:st})})).link&&(Le.skipExpansion=!0),Le.compactToRelative||delete Le.base,Ke=Le.skipExpansion?Xe:yield ye.expand(Xe,Le);const Me=yield ye.processContext(K(Le),ze,Le);let Ue=yield Z({activeCtx:Me,element:Ke,options:Le,compactionMap:Le.compactionMap});Le.compactArrays&&!Le.graph&&P(Ue)?1===Ue.length?Ue=Ue[0]:0===Ue.length&&(Ue={}):Le.graph&&X(Ue)&&(Ue=[Ue]),X(ze)&&"@context"in ze&&(ze=ze["@context"]),ze=k.clone(ze),P(ze)||(ze=[ze]);const qe=ze;ze=[];for(let q=0;q0)&&ze.push(qe[q]);const ke=ze.length>0;if(1===ze.length&&(ze=ze[0]),P(Ue)){const q=ae({activeCtx:Me,iri:"@graph",relativeTo:{vocab:!0}}),G=Ue;Ue={},ke&&(Ue["@context"]=ze),Ue[q]=G}else if(X(Ue)&&ke){const q=Ue;Ue={"@context":ze};for(const G in q)Ue[G]=q[G]}return Ue});return function(Xe,ze,Le){return tt.apply(this,arguments)}}(),ye.expand=function(){var tt=yt(function*(Xe,ze){if(arguments.length<1)throw new TypeError("Could not expand, too few arguments.");!1===(ze=Qe(ze,{keepFreeFloatingNodes:!1,contextResolver:new Q({sharedCache:st})})).expansionMap&&(ze.expansionMap=void 0);const Le={},Ke=[];if("expandContext"in ze){const ke=k.clone(ze.expandContext);Le.expandContext=X(ke)&&"@context"in ke?ke:{"@context":ke},Ke.push(Le.expandContext)}let Me;if(ue(Xe)){const ke=yield ye.get(Xe,ze);Me=ke.documentUrl,Le.input=ke.document,ke.contextUrl&&(Le.remoteContext={"@context":ke.contextUrl},Ke.push(Le.remoteContext))}else Le.input=k.clone(Xe);"base"in ze||(ze.base=Me||"");let Ue=K(ze);for(const ke of Ke)Ue=yield E({activeCtx:Ue,localCtx:ke,options:ze});let qe=yield T({activeCtx:Ue,element:Le.input,options:ze,expansionMap:ze.expansionMap});return X(qe)&&"@graph"in qe&&1===Object.keys(qe).length?qe=qe["@graph"]:null===qe&&(qe=[]),P(qe)||(qe=[qe]),qe});return function(Xe,ze){return tt.apply(this,arguments)}}(),ye.flatten=function(){var tt=yt(function*(Xe,ze,Le){if(arguments.length<1)return new TypeError("Could not flatten, too few arguments.");ze="function"==typeof ze?null:ze||null,Le=Qe(Le,{base:ue(Xe)?Xe:"",contextResolver:new Q({sharedCache:st})});const Ke=yield ye.expand(Xe,Le),Me=b(Ke);return null===ze?Me:(Le.graph=!0,Le.skipExpansion=!0,yield ye.compact(Me,ze,Le))});return function(Xe,ze,Le){return tt.apply(this,arguments)}}(),ye.frame=function(){var tt=yt(function*(Xe,ze,Le){if(arguments.length<2)throw new TypeError("Could not frame, too few arguments.");if(Le=Qe(Le,{base:ue(Xe)?Xe:"",embed:"@once",explicit:!1,requireAll:!1,omitDefault:!1,bnodesToClear:[],contextResolver:new Q({sharedCache:st})}),ue(ze)){const de=yield ye.get(ze,Le);if(ze=de.document,de.contextUrl){let je=ze["@context"];je?P(je)?je.push(de.contextUrl):je=[je,de.contextUrl]:je=de.contextUrl,ze["@context"]=je}}const Ke=ze&&ze["@context"]||{},Me=yield ye.processContext(K(Le),Ke,Le);Le.hasOwnProperty("omitGraph")||(Le.omitGraph=$(Me,1.1)),Le.hasOwnProperty("pruneBlankNodeIdentifiers")||(Le.pruneBlankNodeIdentifiers=$(Me,1.1));const Ue=yield ye.expand(Xe,Le),qe=ot({},Le);qe.isFrame=!0,qe.keepFreeFloatingNodes=!0;const ke=yield ye.expand(ze,qe),q=Object.keys(ze).map(de=>O(Me,de,{vocab:!0}));qe.merged=!q.includes("@graph"),qe.is11=$(Me,1.1);const G=A(Ue,ke,qe);qe.graph=!Le.omitGraph,qe.skipExpansion=!0,qe.link={},qe.framing=!0;let pe=yield ye.compact(G,Ke,qe);return qe.link={},pe=z(pe,qe),pe});return function(Xe,ze,Le){return tt.apply(this,arguments)}}(),ye.link=function(){var tt=yt(function*(Xe,ze,Le){const Ke={};return ze&&(Ke["@context"]=ze),Ke["@embed"]="@link",ye.frame(Xe,Ke,Le)});return function(Xe,ze,Le){return tt.apply(this,arguments)}}(),ye.normalize=ye.canonize=function(){var tt=yt(function*(Xe,ze){if(arguments.length<1)throw new TypeError("Could not canonize, too few arguments.");if("inputFormat"in(ze=Qe(ze,{base:ue(Xe)?Xe:"",algorithm:"URDNA2015",skipExpansion:!1,contextResolver:new Q({sharedCache:st})}))){if("application/n-quads"!==ze.inputFormat&&"application/nquads"!==ze.inputFormat)throw new w("Unknown canonicalization input format.","jsonld.CanonizeError");const Me=R.parse(Xe);return W.canonize(Me,ze)}const Le=ot({},ze);delete Le.format,Le.produceGeneralizedRdf=!1;const Ke=yield ye.toRDF(Xe,Le);return W.canonize(Ke,ze)});return function(Xe,ze){return tt.apply(this,arguments)}}(),ye.fromRDF=function(){var tt=yt(function*(Xe,ze){if(arguments.length<1)throw new TypeError("Could not convert from RDF, too few arguments.");ze=Qe(ze,{format:ue(Xe)?"application/n-quads":void 0});const{format:Le}=ze;let{rdfParser:Ke}=ze;if(Le){if(Ke=Ke||Oe[Le],!Ke)throw new w("Unknown input format.","jsonld.UnknownFormat",{format:Le})}else Ke=()=>Xe;const Me=yield Ke(Xe);return y(Me,ze)});return function(Xe,ze){return tt.apply(this,arguments)}}(),ye.toRDF=function(){var tt=yt(function*(Xe,ze){if(arguments.length<1)throw new TypeError("Could not convert to RDF, too few arguments.");let Le;Le=(ze=Qe(ze,{base:ue(Xe)?Xe:"",skipExpansion:!1,contextResolver:new Q({sharedCache:st})})).skipExpansion?Xe:yield ye.expand(Xe,ze);const Ke=S(Le,ze);if(ze.format){if("application/n-quads"===ze.format||"application/nquads"===ze.format)return R.serialize(Ke);throw new w("Unknown output format.","jsonld.UnknownFormat",{format:ze.format})}return Ke});return function(Xe,ze){return tt.apply(this,arguments)}}(),ye.createNodeMap=function(){var tt=yt(function*(Xe,ze){if(arguments.length<1)throw new TypeError("Could not create node map, too few arguments.");ze=Qe(ze,{base:ue(Xe)?Xe:"",contextResolver:new Q({sharedCache:st})});const Le=yield ye.expand(Xe,ze);return te(Le,ze)});return function(Xe,ze){return tt.apply(this,arguments)}}(),ye.merge=function(){var tt=yt(function*(Xe,ze,Le){if(arguments.length<1)throw new TypeError("Could not merge, too few arguments.");if(!P(Xe))throw new TypeError('Could not merge, "docs" must be an array.');ze="function"==typeof ze?null:ze||null,Le=Qe(Le,{contextResolver:new Q({sharedCache:st})});const Ke=yield Promise.all(Xe.map(de=>{const je=ot({},Le);return ye.expand(de,je)}));let Me=!0;"mergeNodes"in Le&&(Me=Le.mergeNodes);const Ue=Le.issuer||new H("_:b"),qe={"@default":{}};for(let de=0;deye._documentLoader,set:tt=>ye._documentLoader=tt}),ye.documentLoader=function(){var tt=yt(function*(Xe){throw new w("Could not retrieve a JSON-LD document from the URL. URL dereferencing not implemented.","jsonld.LoadDocumentError",{code:"loading document failed",url:Xe})});return function(Xe){return tt.apply(this,arguments)}}(),ye.get=function(){var tt=yt(function*(Xe,ze){let Le;Le="function"==typeof ze.documentLoader?ze.documentLoader:ye.documentLoader;const Ke=yield Le(Xe);try{if(!Ke.document)throw new w("No remote document found at the given URL.","jsonld.NullRemoteDocument");ue(Ke.document)&&(Ke.document=JSON.parse(Ke.document))}catch(Me){throw new w("Could not retrieve a JSON-LD document from the URL.","jsonld.LoadDocumentError",{code:"loading document failed",cause:Me,remoteDoc:Ke})}return Ke});return function(Xe,ze){return tt.apply(this,arguments)}}(),ye.processContext=function(){var tt=yt(function*(Xe,ze,Le){return Le=Qe(Le,{base:"",contextResolver:new Q({sharedCache:st})}),null===ze?K(Le):(ze=k.clone(ze),X(ze)&&"@context"in ze||(ze={"@context":ze}),E({activeCtx:Xe,localCtx:ze,options:Le}))});return function(Xe,ze,Le){return tt.apply(this,arguments)}}(),ye.getContextValue=Y("./context").getContextValue,ye.documentLoaders={},ye.useDocumentLoader=function(tt){if(!(tt in ye.documentLoaders))throw new w('Unknown document loader type: "'+tt+'"',"jsonld.UnknownDocumentLoader",{type:tt});ye.documentLoader=ye.documentLoaders[tt].apply(ye,Array.prototype.slice.call(arguments,1))},ye.registerRDFParser=function(tt,Xe){Oe[tt]=Xe},ye.unregisterRDFParser=function(tt){delete Oe[tt]},ye.registerRDFParser("application/n-quads",R.parse),ye.registerRDFParser("application/nquads",R.parse),ye.url=Y("./url"),ye.util=k,Object.assign(ye,k),ye.promises=ye,ye.RequestQueue=Y("./RequestQueue"),ye.JsonLdProcessor=Y("./JsonLdProcessor")(ye),j.setupGlobals(ye),j.setupDocumentLoaders(ye),ye},ne=function(){return me(function(){return ne()})};me(ne),Se.exports=ne},{"./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,Se,he){"use strict";const{isKeyword:W}=Y("./context"),j=Y("./graphTypes"),k=Y("./types"),Q=Y("./util"),H=Y("./JsonLdError"),w={};Se.exports=w,w.createMergedNodeMap=(C,R)=>{const T=(R=R||{}).issuer||new Q.IdentifierIssuer("_:b"),b={"@default":{}};return w.createNodeMap(C,b,"@default",T),w.mergeNodeMaps(b)},w.createNodeMap=(C,R,T,b,y,S)=>{if(k.isArray(C)){for(const X of C)w.createNodeMap(X,R,T,b,void 0,S);return}if(!k.isObject(C))return void(S&&S.push(C));if(j.isValue(C)){if("@type"in C){let X=C["@type"];0===X.indexOf("_:")&&(C["@type"]=X=b.getId(X))}return void(S&&S.push(C))}if(S&&j.isList(C)){const X=[];return w.createNodeMap(C["@list"],R,T,b,y,X),void S.push({"@list":X})}if("@type"in C){const X=C["@type"];for(const ue of X)0===ue.indexOf("_:")&&b.getId(ue)}k.isUndefined(y)&&(y=j.isBlankNode(C)?b.getId(C["@id"]):C["@id"]),S&&S.push({"@id":y});const A=R[T],z=A[y]=A[y]||{};z["@id"]=y;const P=Object.keys(C).sort();for(let X of P){if("@id"===X)continue;if("@reverse"===X){const I={"@id":y},O=C["@reverse"];for(const K in O){const E=O[K];for(const $ of E){let Z=$["@id"];j.isBlankNode($)&&(Z=b.getId(Z)),w.createNodeMap($,R,T,b,Z),Q.addValue(A[Z],K,I,{propertyIsArray:!0,allowDuplicate:!1})}}continue}if("@graph"===X){y in R||(R[y]={}),w.createNodeMap(C[X],R,y,b);continue}if("@included"===X){w.createNodeMap(C[X],R,T,b);continue}if("@type"!==X&&W(X)){if("@index"===X&&X in z&&(C[X]!==z[X]||C[X]["@id"]!==z[X]["@id"]))throw new H("Invalid JSON-LD syntax; conflicting @index property detected.","jsonld.SyntaxError",{code:"conflicting indexes",subject:z});z[X]=C[X];continue}const ue=C[X];if(0===X.indexOf("_:")&&(X=b.getId(X)),0!==ue.length)for(let I of ue)if("@type"===X&&(I=0===I.indexOf("_:")?b.getId(I):I),j.isSubject(I)||j.isSubjectReference(I)){if("@id"in I&&!I["@id"])continue;const O=j.isBlankNode(I)?b.getId(I["@id"]):I["@id"];Q.addValue(z,X,{"@id":O},{propertyIsArray:!0,allowDuplicate:!1}),w.createNodeMap(I,R,T,b,O)}else if(j.isValue(I))Q.addValue(z,X,I,{propertyIsArray:!0,allowDuplicate:!1});else if(j.isList(I)){const O=[];w.createNodeMap(I["@list"],R,T,b,y,O),I={"@list":O},Q.addValue(z,X,I,{propertyIsArray:!0,allowDuplicate:!1})}else w.createNodeMap(I,R,T,b,y),Q.addValue(z,X,I,{propertyIsArray:!0,allowDuplicate:!1});else Q.addValue(z,X,[],{propertyIsArray:!0})}},w.mergeNodeMapGraphs=C=>{const R={};for(const T of Object.keys(C).sort())for(const b of Object.keys(C[T]).sort()){const y=C[T][b];b in R||(R[b]={"@id":b});const S=R[b];for(const A of Object.keys(y).sort())if(W(A)&&"@type"!==A)S[A]=Q.clone(y[A]);else for(const z of y[A])Q.addValue(S,A,Q.clone(z),{propertyIsArray:!0,allowDuplicate:!1})}return R},w.mergeNodeMaps=C=>{const R=C["@default"],T=Object.keys(C).sort();for(const b of T){if("@default"===b)continue;const y=C[b];let S=R[b];S?"@graph"in S||(S["@graph"]=[]):R[b]=S={"@id":b,"@graph":[]};const A=S["@graph"];for(const z of Object.keys(y).sort()){const P=y[z];j.isSubjectReference(P)||A.push(P)}}return R}},{"./JsonLdError":12,"./context":19,"./graphTypes":25,"./types":30,"./util":32}],28:[function(Y,Se,he){"use strict";const W=Y("./documentLoaders/xhr"),j={};Se.exports=j,j.setupDocumentLoaders=function(k){"undefined"!=typeof XMLHttpRequest&&(k.documentLoaders.xhr=W,k.useDocumentLoader("xhr"))},j.setupGlobals=function(k){void 0===globalThis.JsonLdProcessor&&Object.defineProperty(globalThis,"JsonLdProcessor",{writable:!0,enumerable:!1,configurable:!0,value:k.JsonLdProcessor})}},{"./documentLoaders/xhr":20}],29:[function(Y,Se,he){"use strict";const{createNodeMap:W}=Y("./nodeMap"),{isKeyword:j}=Y("./context"),k=Y("./graphTypes"),Q=Y("canonicalize"),H=Y("./types"),w=Y("./util"),{RDF_FIRST:C,RDF_REST:R,RDF_NIL:T,RDF_TYPE:b,RDF_JSON_LITERAL:y,RDF_LANGSTRING:S,XSD_BOOLEAN:A,XSD_DOUBLE:z,XSD_INTEGER:P,XSD_STRING:X}=Y("./constants"),{isAbsolute:ue}=Y("./url"),I={};function O($,Z,ae,oe,te){const Te=Object.keys(Z).sort();for(const me of Te){const ne=Z[me],ye=Object.keys(ne).sort();for(let Oe of ye){const $e=ne[Oe];if("@type"===Oe)Oe=b;else if(j(Oe))continue;for(const st of $e){const Qe={termType:me.startsWith("_:")?"BlankNode":"NamedNode",value:me};if(!ue(me))continue;const tt={termType:Oe.startsWith("_:")?"BlankNode":"NamedNode",value:Oe};if(!ue(Oe)||"BlankNode"===tt.termType&&!te.produceGeneralizedRdf)continue;const Xe=E(st,oe,$,ae,te.rdfDirection);Xe&&$.push({subject:Qe,predicate:tt,object:Xe,graph:ae})}}}}function E($,Z,ae,oe,te){const Te={};if(k.isValue($)){Te.termType="Literal",Te.value=void 0,Te.datatype={termType:"NamedNode"};let me=$["@value"];const ne=$["@type"]||null;"@json"===ne?(Te.value=Q(me),Te.datatype.value=y):H.isBoolean(me)?(Te.value=me.toString(),Te.datatype.value=ne||A):H.isDouble(me)||ne===z?(H.isDouble(me)||(me=parseFloat(me)),Te.value=me.toExponential(15).replace(/(\d)0*e\+?/,"$1E"),Te.datatype.value=ne||z):H.isNumber(me)?(Te.value=me.toFixed(0),Te.datatype.value=ne||P):"i18n-datatype"===te&&"@direction"in $?(Te.datatype.value="https://www.w3.org/ns/i18n#"+($["@language"]||"")+`_${$["@direction"]}`,Te.value=me):"@language"in $?(Te.value=me,Te.datatype.value=ne||S,Te.language=$["@language"]):(Te.value=me,Te.datatype.value=ne||X)}else if(k.isList($)){const me=function($,Z,ae,oe,te){const Te={termType:"NamedNode",value:C},me={termType:"NamedNode",value:R},ne={termType:"NamedNode",value:T},ye=$.pop(),Oe=ye?{termType:"BlankNode",value:Z.getId()}:ne;let $e=Oe;for(const st of $){const Qe=E(st,Z,ae,oe,te),tt={termType:"BlankNode",value:Z.getId()};ae.push({subject:$e,predicate:Te,object:Qe,graph:oe}),ae.push({subject:$e,predicate:me,object:tt,graph:oe}),$e=tt}if(ye){const st=E(ye,Z,ae,oe,te);ae.push({subject:$e,predicate:Te,object:st,graph:oe}),ae.push({subject:$e,predicate:me,object:ne,graph:oe})}return Oe}($["@list"],Z,ae,oe,te);Te.termType=me.termType,Te.value=me.value}else{const me=H.isObject($)?$["@id"]:$;Te.termType=me.startsWith("_:")?"BlankNode":"NamedNode",Te.value=me}return"NamedNode"!==Te.termType||ue(Te.value)?Te:null}Se.exports=I,I.toRDF=($,Z)=>{const ae=new w.IdentifierIssuer("_:b"),oe={"@default":{}};W($,oe,"@default",ae);const te=[],Te=Object.keys(oe).sort();for(const me of Te){let ne;if("@default"===me)ne={termType:"DefaultGraph",value:""};else{if(!ue(me))continue;ne=me.startsWith("_:")?{termType:"BlankNode"}:{termType:"NamedNode"},ne.value=me}O(te,oe[me],ne,ae,Z)}return te}},{"./constants":18,"./context":19,"./graphTypes":25,"./nodeMap":27,"./types":30,"./url":31,"./util":32,canonicalize:7}],30:[function(Y,Se,he){"use strict";const W={};Se.exports=W,W.isArray=Array.isArray,W.isBoolean=j=>"boolean"==typeof j||"[object Boolean]"===Object.prototype.toString.call(j),W.isDouble=j=>W.isNumber(j)&&(-1!==String(j).indexOf(".")||Math.abs(j)>=1e21),W.isEmptyObject=j=>W.isObject(j)&&0===Object.keys(j).length,W.isNumber=j=>"number"==typeof j||"[object Number]"===Object.prototype.toString.call(j),W.isNumeric=j=>!isNaN(parseFloat(j))&&isFinite(j),W.isObject=j=>"[object Object]"===Object.prototype.toString.call(j),W.isString=j=>"string"==typeof j||"[object String]"===Object.prototype.toString.call(j),W.isUndefined=j=>void 0===j},{}],31:[function(Y,Se,he){"use strict";const W=Y("./types"),j={};Se.exports=j,j.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*))?))?(?:(((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/}},j.parse=(Q,H)=>{const w={},C=j.parsers[H||"full"],R=C.regex.exec(Q);let T=C.keys.length;for(;T--;)w[C.keys[T]]=void 0===R[T]?null:R[T];return("https"===w.scheme&&"443"===w.port||"http"===w.scheme&&"80"===w.port)&&(w.href=w.href.replace(":"+w.port,""),w.authority=w.authority.replace(":"+w.port,""),w.port=null),w.normalizedPath=j.removeDotSegments(w.path),w},j.prependBase=(Q,H)=>{if(null===Q||j.isAbsolute(H))return H;(!Q||W.isString(Q))&&(Q=j.parse(Q||""));const w=j.parse(H),C={protocol:Q.protocol||""};if(null!==w.authority)C.authority=w.authority,C.path=w.path,C.query=w.query;else if(C.authority=Q.authority,""===w.path)C.path=Q.path,C.query=null!==w.query?w.query:Q.query;else{if(0===w.path.indexOf("/"))C.path=w.path;else{let T=Q.path;T=T.substr(0,T.lastIndexOf("/")+1),(T.length>0||Q.authority)&&"/"!==T.substr(-1)&&(T+="/"),T+=w.path,C.path=T}C.query=w.query}""!==w.path&&(C.path=j.removeDotSegments(C.path));let R=C.protocol;return null!==C.authority&&(R+="//"+C.authority),R+=C.path,null!==C.query&&(R+="?"+C.query),null!==w.fragment&&(R+="#"+w.fragment),""===R&&(R="./"),R},j.removeBase=(Q,H)=>{if(null===Q)return H;(!Q||W.isString(Q))&&(Q=j.parse(Q||""));let w="";if(""!==Q.href?w+=(Q.protocol||"")+"//"+(Q.authority||""):H.indexOf("//")&&(w+="//"),0!==H.indexOf(w))return H;const C=j.parse(H.substr(w.length)),R=Q.normalizedPath.split("/"),T=C.normalizedPath.split("/"),b=C.fragment||C.query?0:1;for(;R.length>0&&T.length>b&&R[0]===T[0];)R.shift(),T.shift();let y="";if(R.length>0){R.pop();for(let S=0;S{if(0===Q.length)return"";const H=Q.split("/"),w=[];for(;H.length>0;){const C=H.shift(),R=0===H.length;"."!==C?".."!==C?w.push(C):(w.pop(),R&&w.push("")):R&&w.push("")}return"/"===Q[0]&&w.length>0&&""!==w[0]&&w.unshift(""),1===w.length&&""===w[0]?"/":w.join("/")};const k=/^([A-Za-z][A-Za-z0-9+-.]*|_):[^\s]*$/;j.isAbsolute=Q=>W.isString(Q)&&k.test(Q),j.isRelative=Q=>W.isString(Q)},{"./types":30}],32:[function(Y,Se,he){"use strict";const W=Y("./graphTypes"),j=Y("./types"),k=Y("rdf-canonize").IdentifierIssuer,Q=Y("./JsonLdError"),H=/(?:<[^>]*?>|"[^"]*?"|[^,])+/g,w=/\s*<([^>]*?)>\s*(?:;\s*(.*))?/,C=/(.*?)=(?:(?:"([^"]*?)")|([^"]*?))\s*(?:(?:;\s*)|$)/g,R_headers={accept:"application/ld+json, application/json"},T={};function b(y,S){if(j.isArray(S))for(let A=0;A{if(Object.keys(y).some(A=>"accept"===A.toLowerCase()))throw new RangeError('Accept header may not be specified; only "'+R_headers.accept+'" is supported.');return Object.assign({Accept:R_headers.accept},y)},T.parseLinkHeader=y=>{const S={},A=y.match(H);for(let z=0;z{if(!(j.isString(y)||j.isArray(y)&&y.every(A=>j.isString(A)))){if(S&&j.isObject(y))switch(Object.keys(y).length){case 0:return;case 1:if("@default"in y&&T.asArray(y["@default"]).every(A=>j.isString(A)))return}throw new Q('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,S)=>{if(y.hasOwnProperty(S)){const A=y[S];return!j.isArray(A)||A.length>0}return!1},T.hasValue=(y,S,A)=>{if(T.hasProperty(y,S)){let z=y[S];const P=W.isList(z);if(j.isArray(z)||P){P&&(z=z["@list"]);for(let X=0;X{if("propertyIsArray"in(z=z||{})||(z.propertyIsArray=!1),"valueIsArray"in z||(z.valueIsArray=!1),"allowDuplicate"in z||(z.allowDuplicate=!0),"prependValue"in z||(z.prependValue=!1),z.valueIsArray)y[S]=A;else if(j.isArray(A)){0===A.length&&z.propertyIsArray&&!y.hasOwnProperty(S)&&(y[S]=[]),z.prependValue&&(A=A.concat(y[S]),y[S]=[]);for(let P=0;P[].concat(y[S]||[]),T.removeProperty=(y,S)=>{delete y[S]},T.removeValue=(y,S,A,z)=>{"propertyIsArray"in(z=z||{})||(z.propertyIsArray=!1);const P=T.getValues(y,S).filter(X=>!T.compareValues(X,A));0===P.length?T.removeProperty(y,S):y[S]=1!==P.length||z.propertyIsArray?P:P[0]},T.relabelBlankNodes=(y,S)=>b((S=S||{}).issuer||new k("_:b"),y),T.compareValues=(y,S)=>!!(y===S||W.isValue(y)&&W.isValue(S)&&y["@value"]===S["@value"]&&y["@type"]===S["@type"]&&y["@language"]===S["@language"]&&y["@index"]===S["@index"])||!!(j.isObject(y)&&"@id"in y&&j.isObject(S)&&"@id"in S)&&y["@id"]===S["@id"],T.compareShortestLeast=(y,S)=>y.length1;const z=(K,E,$)=>{const Z=K[b].get(E);if(Z){const ae=Z.value;if(P(K,ae)){if(ue(K,Z),!K[H])return}else $&&(K[y]&&(Z.value.now=Date.now()),K[T].unshiftNode(Z));return ae.value}},P=(K,E)=>{if(!E||!E.maxAge&&!K[w])return!1;const $=Date.now()-E.now;return E.maxAge?$>E.maxAge:K[w]&&$>K[w]},X=K=>{if(K[k]>K[j])for(let E=K[T].tail;K[k]>K[j]&&null!==E;){const $=E.prev;ue(K,E),E=$}},ue=(K,E)=>{if(E){const $=E.value;K[C]&&K[C]($.key,$.value),K[k]-=$.length,K[b].delete($.key),K[T].removeNode(E)}};class I{constructor(E,$,Z,ae,oe){this.key=E,this.value=$,this.length=Z,this.now=ae,this.maxAge=oe||0}}const O=(K,E,$,Z)=>{let ae=$.value;P(K,ae)&&(ue(K,$),K[H]||(ae=void 0)),ae&&E.call(Z,ae.value,ae.key,K)};Se.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[j]=E.max||1/0;const Z=E.length||S;if(this[Q]="function"!=typeof Z?S:Z,this[H]=E.stale||!1,E.maxAge&&"number"!=typeof E.maxAge)throw new TypeError("maxAge must be a number");this[w]=E.maxAge||0,this[C]=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[j]=E||1/0,X(this)}get max(){return this[j]}set allowStale(E){this[H]=!!E}get allowStale(){return this[H]}set maxAge(E){if("number"!=typeof E)throw new TypeError("maxAge must be a non-negative number");this[w]=E,X(this)}get maxAge(){return this[w]}set lengthCalculator(E){"function"!=typeof E&&(E=S),E!==this[Q]&&(this[Q]=E,this[k]=0,this[T].forEach($=>{$.length=this[Q]($.value,$.key),this[k]+=$.length})),X(this)}get lengthCalculator(){return this[Q]}get length(){return this[k]}get itemCount(){return this[T].length}rforEach(E,$){$=$||this;for(let Z=this[T].tail;null!==Z;){const ae=Z.prev;O(this,E,Z,$),Z=ae}}forEach(E,$){$=$||this;for(let Z=this[T].head;null!==Z;){const ae=Z.next;O(this,E,Z,$),Z=ae}}keys(){return this[T].toArray().map(E=>E.key)}values(){return this[T].toArray().map(E=>E.value)}reset(){this[C]&&this[T]&&this[T].length&&this[T].forEach(E=>this[C](E.key,E.value)),this[b]=new Map,this[T]=new W,this[k]=0}dump(){return this[T].map(E=>!P(this,E)&&{k:E.key,v:E.value,e:E.now+(E.maxAge||0)}).toArray().filter(E=>E)}dumpLru(){return this[T]}set(E,$,Z){if((Z=Z||this[w])&&"number"!=typeof Z)throw new TypeError("maxAge must be a number");const ae=Z?Date.now():0,oe=this[Q]($,E);if(this[b].has(E)){if(oe>this[j])return ue(this,this[b].get(E)),!1;const me=this[b].get(E).value;return this[C]&&(this[R]||this[C](E,me.value)),me.now=ae,me.maxAge=Z,me.value=$,this[k]+=oe-me.length,me.length=oe,this.get(E),X(this),!0}const te=new I(E,$,oe,ae,Z);return te.length>this[j]?(this[C]&&this[C](E,$),!1):(this[k]+=te.length,this[T].unshift(te),this[b].set(E,this[T].head),X(this),!0)}has(E){if(!this[b].has(E))return!1;const $=this[b].get(E).value;return!P(this,$)}get(E){return z(this,E,!0)}peek(E){return z(this,E,!1)}pop(){const E=this[T].tail;return E?(ue(this,E),E.value):null}del(E){ue(this,this[b].get(E))}load(E){this.reset();const $=Date.now();for(let Z=E.length-1;Z>=0;Z--){const ae=E[Z],oe=ae.e||0;if(0===oe)this.set(ae.k,ae.v);else{const te=oe-$;te>0&&this.set(ae.k,ae.v,te)}}}prune(){this[b].forEach((E,$)=>z(this,$,!1))}}},{yallist:92}],34:[function(Y,Se,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#",j="http://www.w3.org/2001/XMLSchema#",k="http://www.w3.org/2000/10/swap/";he.default={xsd:{decimal:`${j}decimal`,boolean:`${j}boolean`,double:`${j}double`,integer:`${j}integer`,string:`${j}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:`${k}reify#forSome`,forAll:`${k}reify#forAll`},log:{implies:`${k}log#implies`}}},{}],35:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.default=he.Variable=he.Triple=he.Term=he.Quad=he.NamedNode=he.Literal=he.DefaultGraph=he.BlankNode=void 0,he.escapeQuotes=E,he.termFromId=function I(ne,ye){if(ye=ye||b,!ne)return ye.defaultGraph();switch(ne[0]){case"?":return ye.variable(ne.substr(1));case"_":return ye.blankNode(ne.substr(2));case'"':if(ye===b)return new z(ne);if('"'===ne[ne.length-1])return ye.literal(ne.substr(1,ne.length-2));const Oe=ne.lastIndexOf('"',ne.length-1);return ye.literal(ne.substr(1,Oe-1),"@"===ne[Oe+1]?ne.substr(Oe+2):ye.namedNode(ne.substr(Oe+3)));case"<":const $e=T.exec(ne);return ye.quad(I($($e[1]),ye),I($($e[2]),ye),I($($e[3]),ye),$e[4]&&I($($e[4]),ye));default:return ye.namedNode(ne)}},he.termToId=function O(ne){if("string"==typeof ne)return ne;if(ne instanceof S&&"Quad"!==ne.termType)return ne.id;if(!ne)return w.id;switch(ne.termType){case"NamedNode":return ne.value;case"BlankNode":return`_:${ne.value}`;case"Variable":return`?${ne.value}`;case"DefaultGraph":return"";case"Literal":return`"${ne.value}"${ne.language?`@${ne.language}`:ne.datatype&&ne.datatype.value!==H.string?`^^${ne.datatype.value}`:""}`;case"Quad":return`<<${E(O(ne.subject))} ${E(O(ne.predicate))} ${E(O(ne.object))}${(0,j.isDefaultGraph)(ne.graph)?"":` ${O(ne.graph)}`}>>`;default:throw new Error(`Unexpected termType: ${ne.termType}`)}},he.unescapeQuotes=$;var ne,W=(ne=Y("./IRIs"))&&ne.__esModule?ne:{default:ne},j=Y("./N3Util");const{rdf:Q,xsd:H}=W.default;let w,C=0;const R=/^"(.*".*)(?="[^"]*$)/,T=/^<<("(?:""|[^"])*"[^ ]*|[^ ]+) ("(?:""|[^"])*"[^ ]*|[^ ]+) ("(?:""|[^"])*"[^ ]*|[^ ]+) ?("(?:""|[^"])*"[^ ]*|[^ ]+)?>>$/,b={namedNode:function(ne){return new A(ne)},blankNode:function(ne){return new P(ne||"n3-"+C++)},variable:function(ne){return new X(ne)},literal:function(ne,ye){if("string"==typeof ye)return new z(`"${ne}"@${ye.toLowerCase()}`);let Oe=ye?ye.value:"";return""===Oe&&("boolean"==typeof ne?Oe=H.boolean:"number"==typeof ne&&(Number.isFinite(ne)?Oe=Number.isInteger(ne)?H.integer:H.double:(Oe=H.double,Number.isNaN(ne)||(ne=ne>0?"INF":"-INF")))),new z(""===Oe||Oe===H.string?`"${ne}"`:`"${ne}"^^${Oe}`)},defaultGraph:function(){return w},quad:me,triple:me};he.default=b;class S{constructor(ye){this.id=ye}get value(){return this.id}equals(ye){return ye instanceof S?this.id===ye.id:!!ye&&this.termType===ye.termType&&this.value===ye.value}hashCode(){return 0}toJSON(){return{termType:this.termType,value:this.value}}}he.Term=S;class A extends S{get termType(){return"NamedNode"}}he.NamedNode=A;class z extends S{get termType(){return"Literal"}get value(){return this.id.substring(1,this.id.lastIndexOf('"'))}get language(){const ye=this.id;let Oe=ye.lastIndexOf('"')+1;return Oe`"${Oe.replace(/"/g,'""')}`)}function $(ne){return ne.replace(R,(ye,Oe)=>`"${Oe.replace(/""/g,'"')}`)}function me(ne,ye,Oe,$e){return new K(ne,ye,Oe,$e)}he.Triple=he.Quad=K},{"./IRIs":34,"./N3Util":41}],36:[function(Y,Se,he){(function(W){(function(){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.default=void 0;var j=Q(Y("./IRIs")),k=Q(Y("queue-microtask"));function Q(S){return S&&S.__esModule?S:{default:S}}const{xsd:H}=j.default,w=/\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{8})|\\([^])/g,C={"\\":"\\","'":"'",'"':'"',n:"\n",r:"\r",t:"\t",f:"\f",b:"\b",_:"_","~":"~",".":".","-":"-","!":"!",$:"$","&":"&","(":"(",")":")","*":"*","+":"+",",":",",";":";","=":"=","/":"/","?":"?","#":"#","@":"@","%":"%"},R=/[\x00-\x20<>\\"\{\}\|\^\`]/,T={_iri:!0,_unescapedIri:!0,_simpleQuotedString:!0,_langcode:!0,_blank:!0,_newline:!0,_comment:!0,_whitespace:!0,_endOfFile:!0},b=/$0^/;he.default=class{constructor(A){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=!!(A=A||{}).lineMode){this._n3Mode=!1;for(const z in this)!(z in T)&&this[z]instanceof RegExp&&(this[z]=b)}else this._n3Mode=!1!==A.n3;this._comments=!!A.comments,this._literalClosingPos=0}_tokenizeToEnd(A,z){let P=this._input,X=P.length;for(;;){let O,K;for(;O=this._newline.exec(P);)this._comments&&(K=this._comment.exec(O[0]))&&ue("comment",K[1],"",this._line,O[0].length),P=P.substr(O[0].length,P.length),X=P.length,this._line++;if(!O&&(O=this._whitespace.exec(P))&&(P=P.substr(O[0].length,P.length)),this._endOfFile.test(P))return z&&(this._comments&&(K=this._comment.exec(P))&&ue("comment",K[1],"",this._line,P.length),P=null,ue("eof","","",this._line,0)),this._input=P;const E=this._line,$=P[0];let Z="",ae="",oe="",te=null,Te=0,me=!1;switch($){case"^":if(P.length<3)break;if("^"!==P[1]){this._n3Mode&&(Te=1,Z="^");break}if(this._previousMarker="^^",P=P.substr(2),"<"!==P[0]){me=!0;break}case"<":if(te=this._unescapedIri.exec(P))Z="IRI",ae=te[1];else if(te=this._iri.exec(P)){if(ae=this._unescape(te[1]),null===ae||R.test(ae))return I(this);Z="IRI"}else P.length>1&&"<"===P[1]?(Z="<<",Te=2):this._n3Mode&&P.length>1&&"="===P[1]&&(Z="inverse",Te=2,ae=">");break;case">":P.length>1&&">"===P[1]&&(Z=">>",Te=2);break;case"_":((te=this._blank.exec(P))||z&&(te=this._blank.exec(`${P} `)))&&(Z="blank",oe="_",ae=te[1]);break;case'"':if(te=this._simpleQuotedString.exec(P))ae=te[1];else if(({value:ae,matchLength:Te}=this._parseLiteral(P)),null===ae)return I(this);(null!==te||0!==Te)&&(Z="literal",this._literalClosingPos=0);break;case"'":if(!this._lineMode){if(te=this._simpleApostropheString.exec(P))ae=te[1];else if(({value:ae,matchLength:Te}=this._parseLiteral(P)),null===ae)return I(this);(null!==te||0!==Te)&&(Z="literal",this._literalClosingPos=0)}break;case"?":this._n3Mode&&(te=this._variable.exec(P))&&(Z="var",ae=te[0]);break;case"@":"literal"===this._previousMarker&&(te=this._langcode.exec(P))?(Z="langcode",ae=te[1]):(te=this._keyword.exec(P))&&(Z=te[0]);break;case".":if(1===P.length?z:P[1]<"0"||P[1]>"9"){Z=".",Te=1;break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"+":case"-":(te=this._number.exec(P)||z&&(te=this._number.exec(`${P} `)))&&(Z="literal",ae=te[0],oe="string"==typeof te[1]?H.double:"string"==typeof te[2]?H.decimal:H.integer);break;case"B":case"b":case"p":case"P":case"G":case"g":(te=this._sparqlKeyword.exec(P))?Z=te[0].toUpperCase():me=!0;break;case"f":case"t":(te=this._boolean.exec(P))?(Z="literal",ae=te[0],oe=H.boolean):me=!0;break;case"a":(te=this._shortPredicates.exec(P))?(Z="abbreviation",ae="a"):me=!0;break;case"=":this._n3Mode&&P.length>1&&(Z="abbreviation",">"!==P[1]?(Te=1,ae="="):(Te=2,ae=">"));break;case"!":if(!this._n3Mode)break;case",":case";":case"[":case"]":case"(":case")":case"{":case"}":this._lineMode||(Te=1,Z=$);break;default:me=!0}if(me&&("@prefix"!==this._previousMarker&&"PREFIX"!==this._previousMarker||!(te=this._prefix.exec(P))?((te=this._prefixed.exec(P))||z&&(te=this._prefixed.exec(`${P} `)))&&(Z="prefixed",oe=te[1]||"",ae=this._unescape(te[2])):(Z="prefix",ae=te[1]||"")),"^^"===this._previousMarker)switch(Z){case"prefixed":Z="type";break;case"IRI":Z="typeIRI";break;default:Z=""}if(!Z)return z||!/^'''|^"""/.test(P)&&/\n|\r/.test(P)?I(this):this._input=P;const ne=Te||te[0].length,ye=ue(Z,ae,oe,E,ne);this.previousToken=ye,this._previousMarker=Z,P=P.substr(ne,P.length)}function ue(O,K,E,$,Z){const ae=P?X-P.length:X,te={type:O,value:K,prefix:E,line:$,start:ae,end:ae+Z};return A(null,te),te}function I(O){A(O._syntaxError(/^\S*/.exec(P)[0]))}}_unescape(A){let z=!1;const P=A.replace(w,(X,ue,I,O)=>{if("string"==typeof ue)return String.fromCharCode(Number.parseInt(ue,16));if("string"==typeof I){let K=Number.parseInt(I,16);return K<=65535?String.fromCharCode(Number.parseInt(I,16)):String.fromCharCode(55296+((K-=65536)>>10),56320+(1023&K))}return O in C?C[O]:(z=!0,"")});return z?null:P}_parseLiteral(A){if(A.length>=3){const z=A.match(/^(?:"""|"|'''|'|)/)[0],P=z.length;let X=Math.max(this._literalClosingPos,P);for(;(X=A.indexOf(z,X))>0;){let ue=0;for(;"\\"===A[X-ue-1];)ue++;if(ue%2==0){const I=A.substring(P,X),O=I.split(/\r\n|\r|\n/).length-1,K=X+P;if(1===P&&0!==O||3===P&&this._lineMode)break;return this._line+=O,{value:this._unescape(I),matchLength:K}}X++}this._literalClosingPos=A.length-P+1}return{value:"",matchLength:0}}_syntaxError(A){this._input=null;const z=new Error(`Unexpected "${A}" on line ${this._line}.`);return z.context={token:void 0,line:this._line,previousToken:this.previousToken},z}_readStartingBom(A){return A.startsWith("\ufeff")?A.substr(1):A}tokenize(A,z){if(this._line=1,"string"==typeof A){if(this._input=this._readStartingBom(A),"function"!=typeof z){const P=[];let X;if(this._tokenizeToEnd((ue,I)=>ue?X=ue:P.push(I),!0),X)throw X;return P}(0,k.default)(()=>this._tokenizeToEnd(z,!0))}else this._pendingBuffer=null,"function"==typeof A.setEncoding&&A.setEncoding("utf8"),A.on("data",P=>{null!==this._input&&0!==P.length&&(this._pendingBuffer&&(P=W.concat([this._pendingBuffer,P]),this._pendingBuffer=null),128&P[P.length-1]?this._pendingBuffer=P:(void 0===this._input?this._input=this._readStartingBom("string"==typeof P?P:P.toString()):this._input+=P,this._tokenizeToEnd(z,!1)))}),A.on("end",()=>{"string"==typeof this._input&&this._tokenizeToEnd(z,!0)}),A.on("error",z)}}}).call(this)}).call(this,Y("buffer").Buffer)},{"./IRIs":34,buffer:6,"queue-microtask":45}],37:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.default=void 0;var W=Q(Y("./N3Lexer")),j=Q(Y("./N3DataFactory")),k=Q(Y("./IRIs"));function Q(T){return T&&T.__esModule?T:{default:T}}let H=0;class w{constructor(b){this._contextStack=[],this._graph=null,this._setBase((b=b||{}).baseIRI),b.factory&&R(this,b.factory);const y="string"==typeof b.format?b.format.match(/\w*$/)[0].toLowerCase():"",S=/turtle/.test(y),A=/trig/.test(y),z=/triple/.test(y),P=/quad/.test(y),X=this._n3Mode=/n3/.test(y),ue=z||P;(this._supportsNamedGraphs=!(S||X))||(this._readPredicateOrNamedGraph=this._readPredicate),this._supportsQuads=!(S||A||z||X),this._supportsRDFStar=""===y||/star|\*$/.test(y),ue&&(this._resolveRelativeIRI=I=>null),this._blankNodePrefix="string"!=typeof b.blankNodePrefix?"":b.blankNodePrefix.replace(/^(?!_:)/,"_:"),this._lexer=b.lexer||new W.default({lineMode:ue,n3:X}),this._explicitQuantifiers=!!b.explicitQuantifiers}static _resetBlankNodePrefix(){H=0}_setBase(b){if(b){const y=b.indexOf("#");y>=0&&(b=b.substr(0,y)),this._base=b,this._basePath=b.indexOf("/")<0?b:b.replace(/[^\/?]*(?:\?.*)?$/,""),b=b.match(/^(?:([a-z][a-z0-9+.-]*:))?(?:\/\/[^\/]*)?/i),this._baseRoot=b[0],this._baseScheme=b[1]}else this._base="",this._basePath=""}_saveContext(b,y,S,A,z){const P=this._n3Mode;this._contextStack.push({subject:S,predicate:A,object:z,graph:y,type:b,inverse:!!P&&this._inversePredicate,blankPrefix:P?this._prefixes._:"",quantified:P?this._quantified:null}),P&&(this._inversePredicate=!1,this._prefixes._=this._graph?`${this._graph.id.substr(2)}.`:".",this._quantified=Object.create(this._quantified))}_restoreContext(){const b=this._contextStack.pop(),y=this._n3Mode;this._subject=b.subject,this._predicate=b.predicate,this._object=b.object,this._graph=b.graph,y&&(this._inversePredicate=b.inverse,this._prefixes._=b.blankPrefix,this._quantified=b.quantified)}_readInTopContext(b){switch(b.type){case"eof":return null!==this._graph?this._error("Unclosed graph",b):(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(b)}}_readEntity(b,y){let S;switch(b.type){case"IRI":case"typeIRI":const A=this._resolveIRI(b.value);if(null===A)return this._error("Invalid IRI",b);S=this._namedNode(A);break;case"type":case"prefixed":const z=this._prefixes[b.prefix];if(void 0===z)return this._error(`Undefined prefix "${b.prefix}:"`,b);S=this._namedNode(z+b.value);break;case"blank":S=this._blankNode(this._prefixes[b.prefix]+b.value);break;case"var":S=this._variable(b.value.substr(1));break;default:return this._error(`Expected entity but got ${b.type}`,b)}return!y&&this._n3Mode&&S.id in this._quantified&&(S=this._quantified[S.id]),S}_readSubject(b){switch(this._predicate=null,b.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",b);case"}":return this._readPunctuation(b);case"@forSome":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORSOME,this._quantifier=this._blankNode,this._readQuantifierList):this._error('Unexpected "@forSome"',b);case"@forAll":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORALL,this._quantifier=this._variable,this._readQuantifierList):this._error('Unexpected "@forAll"',b);case"literal":if(!this._n3Mode)return this._error("Unexpected literal",b);if(0===b.prefix.length)return this._literalValue=b.value,this._completeSubjectLiteral;this._subject=this._literal(b.value,this._namedNode(b.prefix));break;case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,null,null,null),this._graph=null,this._readSubject):this._error("Unexpected RDF* syntax",b);default:if(void 0===(this._subject=this._readEntity(b)))return;if(this._n3Mode)return this._getPathReader(this._readPredicateOrNamedGraph)}return this._readPredicateOrNamedGraph}_readPredicate(b){const y=b.type;switch(y){case"inverse":this._inversePredicate=!0;case"abbreviation":this._predicate=this.ABBREVIATIONS[b.value];break;case".":case"]":case"}":return null===this._predicate?this._error(`Unexpected ${y}`,b):(this._subject=null,"]"===y?this._readBlankNodeTail(b):this._readPunctuation(b));case";":return null!==this._predicate?this._readPredicate:this._error("Expected predicate but got ;",b);case"[":if(this._n3Mode)return this._saveContext("blank",this._graph,this._subject,this._subject=this._blankNode(),null),this._readBlankNodeHead;case"blank":if(!this._n3Mode)return this._error("Disallowed blank node as predicate",b);default:if(void 0===(this._predicate=this._readEntity(b)))return}return this._readObject}_readObject(b){switch(b.type){case"literal":if(0===b.prefix.length)return this._literalValue=b.value,this._readDataTypeOrLang;this._object=this._literal(b.value,this._namedNode(b.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",b);case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,this._subject,this._predicate,null),this._graph=null,this._readSubject):this._error("Unexpected RDF* syntax",b);default:if(void 0===(this._object=this._readEntity(b)))return;if(this._n3Mode)return this._getPathReader(this._getContextEndReader())}return this._getContextEndReader()}_readPredicateOrNamedGraph(b){return"{"===b.type?this._readGraph(b):this._readPredicate(b)}_readGraph(b){return"{"!==b.type?this._error(`Expected graph but got ${b.type}`,b):(this._graph=this._subject,this._subject=null,this._readSubject)}_readBlankNodeHead(b){return"]"===b.type?(this._subject=null,this._readBlankNodeTail(b)):(this._predicate=null,this._readPredicate(b))}_readBlankNodeTail(b){if("]"!==b.type)return this._readBlankNodePunctuation(b);null!==this._subject&&this._emit(this._subject,this._predicate,this._object,this._graph);const y=null===this._predicate;return this._restoreContext(),null!==this._object?this._getContextEndReader():null!==this._predicate?this._readObject:y?this._readPredicateOrNamedGraph:this._readPredicateAfterBlank}_readPredicateAfterBlank(b){switch(b.type){case".":case"}":return this._subject=null,this._readPunctuation(b);default:return this._readPredicate(b)}}_readListItem(b){let y=null,S=null,A=this._readListItem;const z=this._subject,P=this._contextStack,X=P[P.length-1];switch(b.type){case"[":this._saveContext("blank",this._graph,S=this._blankNode(),this.RDF_FIRST,this._subject=y=this._blankNode()),A=this._readBlankNodeHead;break;case"(":this._saveContext("list",this._graph,S=this._blankNode(),this.RDF_FIRST,this.RDF_NIL),this._subject=null;break;case")":if(this._restoreContext(),0!==P.length&&"list"===P[P.length-1].type&&this._emit(this._subject,this._predicate,this._object,this._graph),null===this._predicate){if(A=this._readPredicate,this._subject===this.RDF_NIL)return A}else if(A=this._getContextEndReader(),this._object===this.RDF_NIL)return A;S=this.RDF_NIL;break;case"literal":0===b.prefix.length?(this._literalValue=b.value,A=this._readListItemDataTypeOrLang):(y=this._literal(b.value,this._namedNode(b.prefix)),A=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",b);default:if(void 0===(y=this._readEntity(b)))return}if(null===S&&(this._subject=S=this._blankNode()),null===z?null===X.predicate?X.subject=S:X.object=S:this._emit(z,this.RDF_REST,S,this._graph),null!==y){if(this._n3Mode&&("IRI"===b.type||"prefixed"===b.type))return this._saveContext("item",this._graph,S,this.RDF_FIRST,y),this._subject=y,this._predicate=null,this._getPathReader(this._readListItem);this._emit(S,this.RDF_FIRST,y,this._graph)}return A}_readDataTypeOrLang(b){return this._completeObjectLiteral(b,!1)}_readListItemDataTypeOrLang(b){return this._completeObjectLiteral(b,!0)}_completeLiteral(b){let y=this._literal(this._literalValue);switch(b.type){case"type":case"typeIRI":const S=this._readEntity(b);if(void 0===S)return;y=this._literal(this._literalValue,S),b=null;break;case"langcode":y=this._literal(this._literalValue,b.value),b=null}return{token:b,literal:y}}_completeSubjectLiteral(b){return this._subject=this._completeLiteral(b).literal,this._readPredicateOrNamedGraph}_completeObjectLiteral(b,y){const S=this._completeLiteral(b);if(S)return this._object=S.literal,y&&this._emit(this._subject,this.RDF_FIRST,this._object,this._graph),null===S.token?this._getContextEndReader():(this._readCallback=this._getContextEndReader(),this._readCallback(S.token))}_readFormulaTail(b){return"}"!==b.type?this._readPunctuation(b):(null!==this._subject&&this._emit(this._subject,this._predicate,this._object,this._graph),this._restoreContext(),null===this._object?this._readPredicate:this._getContextEndReader())}_readPunctuation(b){let y,S=this._graph;const A=this._subject,z=this._inversePredicate;switch(b.type){case"}":if(null===this._graph)return this._error("Unexpected graph closing",b);if(this._n3Mode)return this._readFormulaTail(b);this._graph=null;case".":this._subject=null,y=this._contextStack.length?this._readSubject:this._readInTopContext,z&&(this._inversePredicate=!1);break;case";":y=this._readPredicate;break;case",":y=this._readObject;break;default:if(this._supportsQuads&&null===this._graph&&void 0!==(S=this._readEntity(b))){y=this._readQuadPunctuation;break}return this._error(`Expected punctuation to follow "${this._object.id}"`,b)}if(null!==A){const P=this._predicate,X=this._object;z?this._emit(X,P,A,S):this._emit(A,P,X,S)}return y}_readBlankNodePunctuation(b){let y;switch(b.type){case";":y=this._readPredicate;break;case",":y=this._readObject;break;default:return this._error(`Expected punctuation to follow "${this._object.id}"`,b)}return this._emit(this._subject,this._predicate,this._object,this._graph),y}_readQuadPunctuation(b){return"."!==b.type?this._error("Expected dot to follow quad",b):this._readInTopContext}_readPrefix(b){return"prefix"!==b.type?this._error("Expected prefix to follow @prefix",b):(this._prefix=b.value,this._readPrefixIRI)}_readPrefixIRI(b){if("IRI"!==b.type)return this._error(`Expected IRI to follow prefix "${this._prefix}:"`,b);const y=this._readEntity(b);return this._prefixes[this._prefix]=y.value,this._prefixCallback(this._prefix,y),this._readDeclarationPunctuation}_readBaseIRI(b){const y="IRI"===b.type&&this._resolveIRI(b.value);return y?(this._setBase(y),this._readDeclarationPunctuation):this._error("Expected valid IRI to follow base declaration",b)}_readNamedGraphLabel(b){switch(b.type){case"IRI":case"blank":case"prefixed":return this._readSubject(b),this._readGraph;case"[":return this._readNamedGraphBlankLabel;default:return this._error("Invalid graph label",b)}}_readNamedGraphBlankLabel(b){return"]"!==b.type?this._error("Invalid graph label",b):(this._subject=this._blankNode(),this._readGraph)}_readDeclarationPunctuation(b){return this._sparqlStyle?(this._sparqlStyle=!1,this._readInTopContext(b)):"."!==b.type?this._error("Expected declaration to end with a dot",b):this._readInTopContext}_readQuantifierList(b){let y;switch(b.type){case"IRI":case"prefixed":if(void 0!==(y=this._readEntity(b,!0)))break;default:return this._error(`Unexpected ${b.type}`,b)}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(b){return","===b.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(b))}_getPathReader(b){return this._afterPath=b,this._readPath}_readPath(b){switch(b.type){case"!":return this._readForwardPath;case"^":return this._readBackwardPath;default:const y=this._contextStack,S=y.length&&y[y.length-1];if(S&&"item"===S.type){const A=this._subject;this._restoreContext(),this._emit(this._subject,this.RDF_FIRST,A,this._graph)}return this._afterPath(b)}}_readForwardPath(b){let y,S;const A=this._blankNode();if(void 0!==(S=this._readEntity(b)))return null===this._predicate?(y=this._subject,this._subject=A):(y=this._object,this._object=A),this._emit(y,S,A,this._graph),this._readPath}_readBackwardPath(b){const y=this._blankNode();let S,A;if(void 0!==(S=this._readEntity(b)))return null===this._predicate?(A=this._subject,this._subject=y):(A=this._object,this._object=y),this._emit(y,S,A,this._graph),this._readPath}_readRDFStarTailOrGraph(b){return">>"!==b.type?this._supportsQuads&&null===this._graph&&void 0!==(this._graph=this._readEntity(b))?this._readRDFStarTail:this._error(`Expected >> to follow "${this._object.id}"`,b):this._readRDFStarTail(b)}_readRDFStarTail(b){if(">>"!==b.type)return this._error(`Expected >> but got ${b.type}`,b);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 b=this._contextStack;if(!b.length)return this._readPunctuation;switch(b[b.length-1].type){case"blank":return this._readBlankNodeTail;case"list":return this._readListItem;case"formula":return this._readFormulaTail;case"<<":return this._readRDFStarTailOrGraph}}_emit(b,y,S,A){this._callback(null,this._quad(b,y,S,A||this.DEFAULTGRAPH))}_error(b,y){const S=new Error(`${b} on line ${y.line}.`);S.context={token:y,line:y.line,previousToken:this._lexer.previousToken},this._callback(S),this._callback=C}_resolveIRI(b){return/^[a-z][a-z0-9+.-]*:/i.test(b)?b:this._resolveRelativeIRI(b)}_resolveRelativeIRI(b){if(!b.length)return this._base;switch(b[0]){case"#":return this._base+b;case"?":return this._base.replace(/(?:\?.*)?$/,b);case"/":return("/"===b[1]?this._baseScheme:this._baseRoot)+this._removeDotSegments(b);default:return/^[^/:]*:/.test(b)?null:this._removeDotSegments(this._basePath+b)}}_removeDotSegments(b){if(!/(^|\/)\.\.?($|[/#?])/.test(b))return b;const y=b.length;let S="",A=-1,z=-1,P=0,X="/";for(;A=z&&(S=S.substr(0,P)),"/"!==X)return`${S}/${b.substr(A+1)}`;P=A+1}}}X=b[++A]}return S+b.substring(P)}parse(b,y,S){if(this._readCallback=this._readInTopContext,this._sparqlStyle=!1,this._prefixes=Object.create(null),this._prefixes._=this._blankNodePrefix?this._blankNodePrefix.substr(2):`b${H++}_`,this._prefixCallback=S||C,this._inversePredicate=!1,this._quantified=Object.create(null),!y){const A=[];let z;if(this._callback=(P,X)=>{P?z=P:X&&A.push(X)},this._lexer.tokenize(b).every(P=>this._readCallback=this._readCallback(P)),z)throw z;return A}this._callback=y,this._lexer.tokenize(b,(A,z)=>{null!==A?(this._callback(A),this._callback=C):this._readCallback&&(this._readCallback=this._readCallback(z))})}}function C(){}function R(T,b){const y=b.namedNode;T._namedNode=y,T._blankNode=b.blankNode,T._literal=b.literal,T._variable=b.variable,T._quad=b.quad,T.DEFAULTGRAPH=b.defaultGraph(),T.RDF_FIRST=y(k.default.rdf.first),T.RDF_REST=y(k.default.rdf.rest),T.RDF_NIL=y(k.default.rdf.nil),T.N3_FORALL=y(k.default.r.forAll),T.N3_FORSOME=y(k.default.r.forSome),T.ABBREVIATIONS={a:y(k.default.rdf.type),"=":y(k.default.owl.sameAs),">":y(k.default.log.implies)},T.QUANTIFIERS_GRAPH=y("urn:n3:quantifiers")}he.default=w,R(w.prototype,j.default)},{"./IRIs":34,"./N3DataFactory":35,"./N3Lexer":36}],38:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.default=void 0;var b,W=function(b,y){if(!y&&b&&b.__esModule)return b;if(null===b||"object"!=typeof b&&"function"!=typeof b)return{default:b};var S=H(y);if(S&&S.has(b))return S.get(b);var A={},z=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var P in b)if("default"!==P&&Object.prototype.hasOwnProperty.call(b,P)){var X=z?Object.getOwnPropertyDescriptor(b,P):null;X&&(X.get||X.set)?Object.defineProperty(A,P,X):A[P]=b[P]}return A.default=b,S&&S.set(b,A),A}(Y("./N3DataFactory")),j=Y("readable-stream"),k=(b=Y("./IRIs"))&&b.__esModule?b:{default:b};function H(b){if("function"!=typeof WeakMap)return null;var y=new WeakMap,S=new WeakMap;return(H=function(A){return A?S:y})(b)}class C{constructor(y,S){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,!S&&y&&!y[0]&&(S=y,y=null),this._factory=(S=S||{}).factory||W.default,y&&this.addQuads(y)}get size(){let y=this._size;if(null!==y)return y;y=0;const S=this._graphs;let A,z;for(const P in S)for(const X in A=S[P].subjects)for(const ue in z=A[X])y+=Object.keys(z[ue]).length;return this._size=y}_addToIndex(y,S,A,z){const P=y[S]||(y[S]={}),X=P[A]||(P[A]={}),ue=z in X;return ue||(X[z]=null),!ue}_removeFromIndex(y,S,A,z){const P=y[S],X=P[A];delete X[z];for(const ue in X)return;delete P[A];for(const ue in P)return;delete y[S]}*_findInIndex(y,S,A,z,P,X,ue,I){let O,K,E;const Z=!S+!A+!z>1?Object.keys(this._ids):this._entities,ae=(0,W.termFromId)(I,this._factory);S&&((O=y,y={})[S]=O[S]);for(const oe in y){const te=Z[oe];if(K=y[oe]){A&&((O=K,K={})[A]=O[A]);for(const Te in K){const me=Z[Te];if(E=K[Te]){const ne=z?z in E?[z]:[]:Object.keys(E);for(let ye=0;ye{A in S||(S[A]=!0,y((0,W.termFromId)(this._entities[A],this._factory)))}}add(y){return this.addQuad(y),this}addQuad(y,S,A,z){S||(z=y.graph,A=y.object,S=y.predicate,y=y.subject),y=(0,W.termToId)(y),S=(0,W.termToId)(S),A=(0,W.termToId)(A),z=(0,W.termToId)(z);let P=this._graphs[z];P||(P=this._graphs[z]={subjects:{},predicates:{},objects:{}},Object.freeze(P));const X=this._ids,ue=this._entities;y=X[y]||(X[ue[++this._id]=y]=this._id),S=X[S]||(X[ue[++this._id]=S]=this._id),A=X[A]||(X[ue[++this._id]=A]=this._id);const I=this._addToIndex(P.subjects,y,S,A);return this._addToIndex(P.predicates,S,A,y),this._addToIndex(P.objects,A,y,S),this._size=null,I}addQuads(y){for(let S=0;S{this.addQuad(S)}),y}removeQuad(y,S,A,z){S||(z=y.graph,A=y.object,S=y.predicate,y=y.subject),y=(0,W.termToId)(y),S=(0,W.termToId)(S),A=(0,W.termToId)(A),z=(0,W.termToId)(z);const P=this._ids,X=this._graphs;let ue,I,O;if(!((y=P[y])&&(S=P[S])&&(A=P[A])&&(ue=X[z])&&(I=ue.subjects[y])&&(O=I[S])&&A in O))return!1;for(y in this._removeFromIndex(ue.subjects,y,S,A),this._removeFromIndex(ue.predicates,S,A,y),this._removeFromIndex(ue.objects,A,y,S),null!==this._size&&this._size--,ue.subjects)return!0;return delete X[z],!0}removeQuads(y){for(let S=0;S{this.removeQuad(S)}),y}removeMatches(y,S,A,z){const P=new j.Readable({objectMode:!0});return P._read=()=>{for(const X of this.readQuads(y,S,A,z))P.push(X);P.push(null)},this.remove(P)}deleteGraph(y){return this.removeMatches(null,null,null,y)}getQuads(y,S,A,z){return[...this.readQuads(y,S,A,z)]}*readQuads(y,S,A,z){y=y&&(0,W.termToId)(y),S=S&&(0,W.termToId)(S),A=A&&(0,W.termToId)(A),z=z&&(0,W.termToId)(z);const P=this._getGraphs(z),X=this._ids;let ue,I,O,K;if(!(R(y)&&!(I=X[y])||R(S)&&!(O=X[S])||R(A)&&!(K=X[A])))for(const E in P)(ue=P[E])&&(I?K?yield*this._findInIndex(ue.objects,K,I,O,"object","subject","predicate",E,null,!0):yield*this._findInIndex(ue.subjects,I,O,null,"subject","predicate","object",E,null,!0):O?yield*this._findInIndex(ue.predicates,O,K,null,"predicate","object","subject",E,null,!0):K?yield*this._findInIndex(ue.objects,K,null,null,"object","subject","predicate",E,null,!0):yield*this._findInIndex(ue.subjects,null,null,null,"subject","predicate","object",E,null,!0))}match(y,S,A,z){return new T(this,y,S,A,z)}countQuads(y,S,A,z){y=y&&(0,W.termToId)(y),S=S&&(0,W.termToId)(S),A=A&&(0,W.termToId)(A),z=z&&(0,W.termToId)(z);const P=this._getGraphs(z),X=this._ids;let I,O,K,E,ue=0;if(R(y)&&!(O=X[y])||R(S)&&!(K=X[S])||R(A)&&!(E=X[A]))return 0;for(const $ in P)(I=P[$])&&(ue+=y?A?this._countInIndex(I.objects,E,O,K):this._countInIndex(I.subjects,O,K,E):S?this._countInIndex(I.predicates,K,E,O):this._countInIndex(I.objects,E,O,K));return ue}forEach(y,S,A,z,P){this.some(X=>(y(X),!1),S,A,z,P)}every(y,S,A,z,P){let X=!1;const ue=!this.some(I=>(X=!0,!y(I)),S,A,z,P);return X&&ue}some(y,S,A,z,P){for(const X of this.readQuads(S,A,z,P))if(y(X))return!0;return!1}getSubjects(y,S,A){const z=[];return this.forSubjects(P=>{z.push(P)},y,S,A),z}forSubjects(y,S,A,z){S=S&&(0,W.termToId)(S),A=A&&(0,W.termToId)(A),z=z&&(0,W.termToId)(z);const P=this._ids,X=this._getGraphs(z);let ue,I,O;if(y=this._uniqueEntities(y),!(R(S)&&!(I=P[S])||R(A)&&!(O=P[A])))for(z in X)(ue=X[z])&&(I?O?this._loopBy2Keys(ue.predicates,I,O,y):this._loopByKey1(ue.subjects,I,y):O?this._loopByKey0(ue.objects,O,y):this._loop(ue.subjects,y))}getPredicates(y,S,A){const z=[];return this.forPredicates(P=>{z.push(P)},y,S,A),z}forPredicates(y,S,A,z){S=S&&(0,W.termToId)(S),A=A&&(0,W.termToId)(A),z=z&&(0,W.termToId)(z);const P=this._ids,X=this._getGraphs(z);let ue,I,O;if(y=this._uniqueEntities(y),!(R(S)&&!(I=P[S])||R(A)&&!(O=P[A])))for(z in X)(ue=X[z])&&(I?O?this._loopBy2Keys(ue.objects,O,I,y):this._loopByKey0(ue.subjects,I,y):O?this._loopByKey1(ue.predicates,O,y):this._loop(ue.predicates,y))}getObjects(y,S,A){const z=[];return this.forObjects(P=>{z.push(P)},y,S,A),z}forObjects(y,S,A,z){S=S&&(0,W.termToId)(S),A=A&&(0,W.termToId)(A),z=z&&(0,W.termToId)(z);const P=this._ids,X=this._getGraphs(z);let ue,I,O;if(y=this._uniqueEntities(y),!(R(S)&&!(I=P[S])||R(A)&&!(O=P[A])))for(z in X)(ue=X[z])&&(I?O?this._loopBy2Keys(ue.subjects,I,O,y):this._loopByKey1(ue.objects,I,y):O?this._loopByKey0(ue.predicates,O,y):this._loop(ue.objects,y))}getGraphs(y,S,A){const z=[];return this.forGraphs(P=>{z.push(P)},y,S,A),z}forGraphs(y,S,A,z){for(const P in this._graphs)this.some(X=>(y(X.graph),!0),S,A,z,P)}createBlankNode(y){let S,A;if(y)for(S=y=`_:${y}`,A=1;this._ids[S];)S=y+A++;else do{S="_:b"+this._blankNodeIndex++}while(this._ids[S]);return this._ids[S]=++this._id,this._entities[this._id]=S,this._factory.blankNode(S.substr(2))}extractLists({remove:y=!1,ignoreErrors:S=!1}={}){const A={},z=S?()=>!0:(ue,I)=>{throw new Error(`${ue.value} ${I}`)},P=this.getQuads(null,k.default.rdf.rest,k.default.rdf.nil,null),X=y?[...P]:[];return P.forEach(ue=>{const I=[];let K,E,O=!1;const $=ue.graph;let Z=ue.subject;for(;Z&&!O;){const ae=this.getQuads(null,null,Z,null),oe=this.getQuads(Z,null,null,null);let te,Te=null,me=null,ne=null;for(let ye=0;ye{switch(b){case"data":R=y;break;case"end":T=y}}},(b,y)=>{b&&this.emit("error",b)||y&&this.push(y)},(b,y)=>{this.emit("prefix",b,y)}),this._transform=(b,y,S)=>{R(b),S()},this._flush=b=>{T(),b()}}import(w){return w.on("data",C=>{this.write(C)}),w.on("end",()=>{this.end()}),w.on("error",C=>{this.emit("error",C)}),this}}},{"./N3Parser":37,"readable-stream":81}],40:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.default=void 0;var H,W=Y("readable-stream"),j=(H=Y("./N3Writer"))&&H.__esModule?H:{default:H};he.default=class extends W.Transform{constructor(w){super({encoding:"utf8",writableObjectMode:!0});const C=this._writer=new j.default({write:(R,T,b)=>{this.push(R),b&&b()},end:R=>{this.push(null),R&&R()}},w);this._transform=(R,T,b)=>{C.addQuad(R,b)},this._flush=R=>{C.end(R)}}import(w){return w.on("data",C=>{this.write(C)}),w.on("end",()=>{this.end()}),w.on("error",C=>{this.emit("error",C)}),w.on("prefix",(C,R)=>{this._writer.addPrefix(C,R)}),this}}},{"./N3Writer":42,"readable-stream":81}],41:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.inDefaultGraph=function(y){return C(y.graph)},he.isBlankNode=function(y){return!!y&&"BlankNode"===y.termType},he.isDefaultGraph=C,he.isLiteral=function(y){return!!y&&"Literal"===y.termType},he.isNamedNode=function(y){return!!y&&"NamedNode"===y.termType},he.isVariable=function(y){return!!y&&"Variable"===y.termType},he.prefix=function(y,S){return b({"":y.value||y},S)("")},he.prefixes=b;var y,W=(y=Y("./N3DataFactory"))&&y.__esModule?y:{default:y};function C(y){return!!y&&"DefaultGraph"===y.termType}function b(y,S){const A=Object.create(null);for(const P in y)z(P,y[P]);function z(P,X){if("string"==typeof X){const ue=Object.create(null);A[P]=I=>ue[I]||(ue[I]=S.namedNode(X+I))}else if(!(P in A))throw new Error(`Unknown prefix: ${P}`);return A[P]}return S=S||W.default,z}},{"./N3DataFactory":35}],42:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.default=void 0;var ue,W=(ue=Y("./IRIs"))&&ue.__esModule?ue:{default:ue},j=function(ue,I){if(!I&&ue&&ue.__esModule)return ue;if(null===ue||"object"!=typeof ue&&"function"!=typeof ue)return{default:ue};var O=Q(I);if(O&&O.has(ue))return O.get(ue);var K={},E=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var $ in ue)if("default"!==$&&Object.prototype.hasOwnProperty.call(ue,$)){var Z=E?Object.getOwnPropertyDescriptor(ue,$):null;Z&&(Z.get||Z.set)?Object.defineProperty(K,$,Z):K[$]=ue[$]}return K.default=ue,O&&O.set(ue,K),K}(Y("./N3DataFactory")),k=Y("./N3Util");function Q(ue){if("function"!=typeof WeakMap)return null;var I=new WeakMap,O=new WeakMap;return(Q=function(K){return K?O:I})(ue)}const C=j.default.defaultGraph(),{rdf:R,xsd:T}=W.default,b=/["\\\t\n\r\b\f\u0000-\u0019\ud800-\udbff]/,y=/["\\\t\n\r\b\f\u0000-\u0019]|[\ud800-\udbff][\udc00-\udfff]/g,S={"\\":"\\\\",'"':'\\"',"\t":"\\t","\n":"\\n","\r":"\\r","\b":"\\b","\f":"\\f"};class A extends j.Term{equals(){return!1}}function P(ue){let I=S[ue];return void 0===I&&(1===ue.length?(I=ue.charCodeAt(0).toString(16),I="\\u0000".substr(0,6-I.length)+I):(I=(1024*(ue.charCodeAt(0)-55296)+ue.charCodeAt(1)+9216).toString(16),I="\\U00000000".substr(0,10-I.length)+I)),I}function X(ue){return ue.replace(/[\]\/\(\)\*\+\?\.\\\$]/g,"\\$&")}he.default=class{constructor(I,O){if(this._prefixRegex=/$0^/,I&&"function"!=typeof I.write&&(O=I,I=null),this._lists=(O=O||{}).lists,I)this._outputStream=I,this._endStream=void 0===O.end||!!O.end;else{let K="";this._outputStream={write(E,$,Z){K+=E,Z&&Z()},end:E=>{E&&E(null,K)}},this._endStream=!0}this._subject=null,/triple|quad/i.test(O.format)?(this._lineMode=!0,this._writeQuad=this._writeQuadLine):(this._lineMode=!1,this._graph=C,this._prefixIRIs=Object.create(null),O.prefixes&&this.addPrefixes(O.prefixes),O.baseIRI&&(this._baseMatcher=new RegExp(`^${X(O.baseIRI)}${O.baseIRI.endsWith("/")?"":"[#?]"}`),this._baseLength=O.baseIRI.length))}get _inDefaultGraph(){return C.equals(this._graph)}_write(I,O){this._outputStream.write(I,"utf8",O)}_writeQuad(I,O,K,E,$){try{E.equals(this._graph)||(this._write((null===this._subject?"":this._inDefaultGraph?".\n":"\n}\n")+(C.equals(E)?"":`${this._encodeIriOrBlank(E)} {\n`)),this._graph=E,this._subject=null),I.equals(this._subject)?O.equals(this._predicate)?this._write(`, ${this._encodeObject(K)}`,$):this._write(`;\n ${this._encodePredicate(this._predicate=O)} ${this._encodeObject(K)}`,$):this._write(`${(null===this._subject?"":".\n")+this._encodeSubject(this._subject=I)} ${this._encodePredicate(this._predicate=O)} ${this._encodeObject(K)}`,$)}catch(Z){$&&$(Z)}}_writeQuadLine(I,O,K,E,$){delete this._prefixMatch,this._write(this.quadToString(I,O,K,E),$)}quadToString(I,O,K,E){return`${this._encodeSubject(I)} ${this._encodeIriOrBlank(O)} ${this._encodeObject(K)}${E&&E.value?` ${this._encodeIriOrBlank(E)} .\n`:" .\n"}`}quadsToString(I){return I.map(O=>this.quadToString(O.subject,O.predicate,O.object,O.graph)).join("")}_encodeSubject(I){return"Quad"===I.termType?this._encodeQuad(I):this._encodeIriOrBlank(I)}_encodeIriOrBlank(I){if("NamedNode"!==I.termType)return this._lists&&I.value in this._lists&&(I=this.list(this._lists[I.value])),"id"in I?I.id:`_:${I.value}`;let O=I.value;this._baseMatcher&&this._baseMatcher.test(O)&&(O=O.substr(this._baseLength)),b.test(O)&&(O=O.replace(y,P));const K=this._prefixRegex.exec(O);return K?K[1]?this._prefixIRIs[K[1]]+K[2]:O:`<${O}>`}_encodeLiteral(I){let O=I.value;if(b.test(O)&&(O=O.replace(y,P)),I.language)return`"${O}"@${I.language}`;if(this._lineMode){if(I.datatype.value===T.string)return`"${O}"`}else switch(I.datatype.value){case T.string:return`"${O}"`;case T.boolean:if("true"===O||"false"===O)return O;break;case T.integer:if(/^[+-]?\d+$/.test(O))return O;break;case T.decimal:if(/^[+-]?\d*\.\d+$/.test(O))return O;break;case T.double:if(/^[+-]?(?:\d+\.\d*|\.?\d+)[eE][+-]?\d+$/.test(O))return O}return`"${O}"^^${this._encodeIriOrBlank(I.datatype)}`}_encodePredicate(I){return I.value===R.type?"a":this._encodeIriOrBlank(I)}_encodeObject(I){switch(I.termType){case"Quad":return this._encodeQuad(I);case"Literal":return this._encodeLiteral(I);default:return this._encodeIriOrBlank(I)}}_encodeQuad({subject:I,predicate:O,object:K,graph:E}){return`<<${this._encodeSubject(I)} ${this._encodePredicate(O)} ${this._encodeObject(K)}${(0,k.isDefaultGraph)(E)?"":` ${this._encodeIriOrBlank(E)}`}>>`}_blockedWrite(){throw new Error("Cannot write because the writer has been closed.")}addQuad(I,O,K,E,$){void 0===K?this._writeQuad(I.subject,I.predicate,I.object,I.graph,O):"function"==typeof E?this._writeQuad(I,O,K,C,E):this._writeQuad(I,O,K,E||C,$)}addQuads(I){for(let O=0;O.\n`)}if(K){let E="",$="";for(const Z in this._prefixIRIs)E+=E?`|${Z}`:Z,$+=($?"|":"")+this._prefixIRIs[Z];E=X(E),this._prefixRegex=new RegExp(`^(?:${$})[^/]*$|^(${E})([a-zA-Z][\\-_a-zA-Z0-9]*)$`)}this._write(K?"\n":"",O)}blank(I,O){let E,$,K=I;switch(void 0===I?K=[]:I.termType?K=[{predicate:I,object:O}]:"length"in I||(K=[I]),$=K.length){case 0:return new A("[]");case 1:if(E=K[0],!(E.object instanceof A))return new A(`[ ${this._encodePredicate(E.predicate)} ${this._encodeObject(E.object)} ]`);default:let Z="[";for(let ae=0;ae<$;ae++)E=K[ae],E.predicate.equals(I)?Z+=`, ${this._encodeObject(E.object)}`:(Z+=`${(ae?";\n ":"\n ")+this._encodePredicate(E.predicate)} ${this._encodeObject(E.object)}`,I=E.predicate);return new A(`${Z}\n]`)}}list(I){const O=I&&I.length||0,K=new Array(O);for(let E=0;E{O=null,I(K,E)});if(this._endStream)try{return this._outputStream.end(O)}catch(K){}O&&O()}}},{"./IRIs":34,"./N3DataFactory":35,"./N3Util":41}],43:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),Object.defineProperty(he,"BlankNode",{enumerable:!0,get:function(){return R.BlankNode}}),Object.defineProperty(he,"DataFactory",{enumerable:!0,get:function(){return R.default}}),Object.defineProperty(he,"DefaultGraph",{enumerable:!0,get:function(){return R.DefaultGraph}}),Object.defineProperty(he,"Lexer",{enumerable:!0,get:function(){return W.default}}),Object.defineProperty(he,"Literal",{enumerable:!0,get:function(){return R.Literal}}),Object.defineProperty(he,"NamedNode",{enumerable:!0,get:function(){return R.NamedNode}}),Object.defineProperty(he,"Parser",{enumerable:!0,get:function(){return j.default}}),Object.defineProperty(he,"Quad",{enumerable:!0,get:function(){return R.Quad}}),Object.defineProperty(he,"Store",{enumerable:!0,get:function(){return Q.default}}),Object.defineProperty(he,"StreamParser",{enumerable:!0,get:function(){return H.default}}),Object.defineProperty(he,"StreamWriter",{enumerable:!0,get:function(){return w.default}}),Object.defineProperty(he,"Term",{enumerable:!0,get:function(){return R.Term}}),Object.defineProperty(he,"Triple",{enumerable:!0,get:function(){return R.Triple}}),he.Util=void 0,Object.defineProperty(he,"Variable",{enumerable:!0,get:function(){return R.Variable}}),Object.defineProperty(he,"Writer",{enumerable:!0,get:function(){return k.default}}),he.default=void 0,Object.defineProperty(he,"termFromId",{enumerable:!0,get:function(){return R.termFromId}}),Object.defineProperty(he,"termToId",{enumerable:!0,get:function(){return R.termToId}});var W=y(Y("./N3Lexer")),j=y(Y("./N3Parser")),k=y(Y("./N3Writer")),Q=y(Y("./N3Store")),H=y(Y("./N3StreamParser")),w=y(Y("./N3StreamWriter")),C=b(Y("./N3Util"));he.Util=C;var R=b(Y("./N3DataFactory"));function T(A){if("function"!=typeof WeakMap)return null;var z=new WeakMap,P=new WeakMap;return(T=function(X){return X?P:z})(A)}function b(A,z){if(!z&&A&&A.__esModule)return A;if(null===A||"object"!=typeof A&&"function"!=typeof A)return{default:A};var P=T(z);if(P&&P.has(A))return P.get(A);var X={},ue=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var I in A)if("default"!==I&&Object.prototype.hasOwnProperty.call(A,I)){var O=ue?Object.getOwnPropertyDescriptor(A,I):null;O&&(O.get||O.set)?Object.defineProperty(X,I,O):X[I]=A[I]}return X.default=A,P&&P.set(A,X),X}function y(A){return A&&A.__esModule?A:{default:A}}he.default={Lexer:W.default,Parser:j.default,Writer:k.default,Store:Q.default,StreamParser:H.default,StreamWriter:w.default,Util:C,DataFactory:R.default,Term:R.Term,NamedNode:R.NamedNode,Literal:R.Literal,BlankNode:R.BlankNode,Variable:R.Variable,DefaultGraph:R.DefaultGraph,Quad:R.Quad,Triple:R.Triple,termFromId:R.termFromId,termToId:R.termToId}},{"./N3DataFactory":35,"./N3Lexer":36,"./N3Parser":37,"./N3Store":38,"./N3StreamParser":39,"./N3StreamWriter":40,"./N3Util":41,"./N3Writer":42}],44:[function(Y,Se,he){var j,k,W=Se.exports={};function Q(){throw new Error("setTimeout has not been defined")}function H(){throw new Error("clearTimeout has not been defined")}function w(X){if(j===setTimeout)return setTimeout(X,0);if((j===Q||!j)&&setTimeout)return j=setTimeout,setTimeout(X,0);try{return j(X,0)}catch(ue){try{return j.call(null,X,0)}catch(I){return j.call(this,X,0)}}}!function(){try{j="function"==typeof setTimeout?setTimeout:Q}catch(X){j=Q}try{k="function"==typeof clearTimeout?clearTimeout:H}catch(X){k=H}}();var b,R=[],T=!1,y=-1;function S(){!T||!b||(T=!1,b.length?R=b.concat(R):y=-1,R.length&&A())}function A(){if(!T){var X=w(S);T=!0;for(var ue=R.length;ue;){for(b=R,R=[];++y1)for(var I=1;I(j||(j=Promise.resolve())).then(k).catch(Q=>setTimeout(()=>{throw Q},0))}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],46:[function(Y,Se,he){Se.exports=Y("./lib")},{"./lib":55}],47:[function(Y,Se,he){"use strict";Se.exports=class kq{constructor(j,k=new Map,Q=0){this.prefix=j,this._existing=k,this.counter=Q}clone(){const{prefix:j,_existing:k,counter:Q}=this;return new kq(j,new Map(k),Q)}getId(j){const k=j&&this._existing.get(j);if(k)return k;const Q=this.prefix+this.counter;return this.counter++,j&&this._existing.set(j,Q),Q}hasId(j){return this._existing.has(j)}getOldIds(){return[...this._existing.keys()]}}},{}],48:[function(Y,Se,he){"use strict";Y("setimmediate");const W=self.crypto||self.msCrypto;Se.exports=class{constructor(k){if(!W||!W.subtle)throw new Error("crypto.subtle not found.");if("sha256"===k)this.algorithm={name:"SHA-256"};else{if("sha1"!==k)throw new Error(`Unsupport algorithm "${k}".`);this.algorithm={name:"SHA-1"}}this._content=""}update(k){this._content+=k}digest(){var k=this;return yt(function*(){const Q=(new TextEncoder).encode(k._content),H=new Uint8Array(yield W.subtle.digest(k.algorithm,Q));let w="";for(let C=0;C]*)>)|(_:(?:[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]*$'),Se.exports=class nF{static parse(X){const ue=[],I={},O=X.split(T.eoln);let K=0;for(const E of O){if(K++,T.empty.test(E))continue;const $=E.match(T.quad);if(null===$)throw new Error("N-Quads parse error on line "+K+".");const Z={subject:null,predicate:null,object:null,graph:null};if(Z.subject=void 0!==$[1]?{termType:H,value:$[1]}:{termType:w,value:$[2]},Z.predicate={termType:H,value:$[3]},void 0!==$[4]?Z.object={termType:H,value:$[4]}:void 0!==$[5]?Z.object={termType:w,value:$[5]}:(Z.object={termType:C,value:void 0,datatype:{termType:H}},void 0!==$[7]?Z.object.datatype.value=$[7]:void 0!==$[8]?(Z.object.datatype.value=k,Z.object.language=$[8]):Z.object.datatype.value=Q,Z.object.value=$[6].replace(A,function(X,ue,I,O){if(ue)switch(ue){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(I)return String.fromCharCode(parseInt(I,16));if(O)throw new Error("Unsupported U escape")})),Z.graph=void 0!==$[9]?{termType:H,value:$[9]}:void 0!==$[10]?{termType:w,value:$[10]}:{termType:R,value:""},Z.graph.value in I){let ae=!0;const oe=I[Z.graph.value];for(const te of oe)if(b(te,Z)){ae=!1;break}ae&&(oe.push(Z),ue.push(Z))}else I[Z.graph.value]=[Z],ue.push(Z)}return ue}static serialize(X){Array.isArray(X)||(X=nF.legacyDatasetToQuads(X));const ue=[];for(const I of X)ue.push(nF.serializeQuad(I));return ue.sort().join("")}static serializeQuad(X){const ue=X.subject,O=X.object,K=X.graph;let E="";return E+=ue.termType===H?`<${ue.value}>`:`${ue.value}`,E+=` <${X.predicate.value}> `,O.termType===H?E+=`<${O.value}>`:O.termType===w?E+=O.value:(E+=`"${P=O.value,P.replace(y,function(X){switch(X){case'"':return'\\"';case"\\":return"\\\\";case"\n":return"\\n";case"\r":return"\\r"}})}"`,O.datatype.value===k?O.language&&(E+=`@${O.language}`):O.datatype.value!==Q&&(E+=`^^<${O.datatype.value}>`)),K.termType===H?E+=` <${K.value}>`:K.termType===w&&(E+=` ${K.value}`),E+=" .\n",E;var P}static legacyDatasetToQuads(X){const ue=[],I={"blank node":w,IRI:H,literal:C};for(const O in X)X[O].forEach(E=>{const $={};for(const Z in E){const ae=E[Z],oe={termType:I[ae.type],value:ae.value};oe.termType===C&&(oe.datatype={termType:H},"datatype"in ae&&(oe.datatype.value=ae.datatype),"language"in ae?("datatype"in ae||(oe.datatype.value=k),oe.language=ae.language):"datatype"in ae||(oe.datatype.value=Q)),$[Z]=oe}$.graph="@default"===O?{termType:R,value:""}:{termType:O.startsWith("_:")?w:H,value:O},ue.push($)});return ue}};const y=/["\\\n\r]/g;const A=/(?:\\([tbnrf"'\\]))|(?:\\u([0-9A-Fa-f]{4}))|(?:\\U([0-9A-Fa-f]{8}))/g},{}],50:[function(Y,Se,he){"use strict";Se.exports=class{constructor(j){this.current=j.sort(),this.done=!1,this.dir=new Map;for(let k=0;kH)&&(b&&R>0&&T>j[R-1]||!b&&Rj[R+1])&&(H=T,w=R)}if(null===H)this.done=!0;else{const R=k.get(H)?w-1:w+1;j[w]=j[R],j[R]=H;for(const T of j)T>H&&k.set(T,!k.get(T))}return Q}}},{}],51:[function(Y,Se,he){(function(W){(function(){"use strict";const j=Y("./IdentifierIssuer"),k=Y("./MessageDigest"),Q=Y("./Permuter"),H=Y("./NQuads");function w(C,R){return C.hashR.hash?1:0}Se.exports=class{constructor(){this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new j("_:c14n"),this.hashAlgorithm="sha256",this.quads=null}main(R){var T=this;return yt(function*(){T.quads=R;for(const X of R)T._addBlankNodeQuadInfo({quad:X,component:X.subject}),T._addBlankNodeQuadInfo({quad:X,component:X.object}),T._addBlankNodeQuadInfo({quad:X,component:X.graph});const b=new Map,y=[...T.blankNodeInfo.keys()];let S=0;for(const X of y)++S%100==0&&(yield T._yield()),yield T._hashAndTrackBlankNode({id:X,hashToBlankNodes:b});const A=[...b.keys()].sort(),z=[];for(const X of A){const ue=b.get(X);ue.length>1?z.push(ue):T.canonicalIssuer.getId(ue[0])}for(const X of z){const ue=[];for(const I of X){if(T.canonicalIssuer.hasId(I))continue;const O=new j("_:b");O.getId(I);const K=yield T.hashNDegreeQuads(I,O);ue.push(K)}ue.sort(w);for(const I of ue){const O=I.issuer.getOldIds();for(const K of O)T.canonicalIssuer.getId(K)}}const P=[];for(const X of T.quads){const ue=ot({},X);ue.subject=T._useCanonicalId({component:ue.subject}),ue.object=T._useCanonicalId({component:ue.object}),ue.graph=T._useCanonicalId({component:ue.graph}),P.push(H.serializeQuad(ue))}return P.sort(),P.join("")})()}hashFirstDegreeQuads(R){var T=this;return yt(function*(){const b=[],y=T.blankNodeInfo.get(R),S=y.quads;for(const z of S){const P={subject:null,predicate:z.predicate,object:null,graph:null};P.subject=T.modifyFirstDegreeComponent(R,z.subject,"subject"),P.object=T.modifyFirstDegreeComponent(R,z.object,"object"),P.graph=T.modifyFirstDegreeComponent(R,z.graph,"graph"),b.push(H.serializeQuad(P))}b.sort();const A=new k(T.hashAlgorithm);for(const z of b)A.update(z);return y.hash=yield A.digest(),y.hash})()}hashRelatedBlankNode(R,T,b,y){var S=this;return yt(function*(){let A;A=S.canonicalIssuer.hasId(R)?S.canonicalIssuer.getId(R):b.hasId(R)?b.getId(R):S.blankNodeInfo.get(R).hash;const z=new k(S.hashAlgorithm);return z.update(y),"g"!==y&&z.update(S.getRelatedPredicate(T)),z.update(A),z.digest()})()}hashNDegreeQuads(R,T){var b=this;return yt(function*(){const y=new k(b.hashAlgorithm),S=yield b.createHashToRelated(R,T),A=[...S.keys()].sort();for(const z of A){y.update(z);let X,P="";const ue=new Q(S.get(z));let I=0;for(;ue.hasNext();){const O=ue.next();++I%3==0&&(yield b._yield());let K=T.clone(),E="";const $=[];let Z=!1;for(const ae of O)if(b.canonicalIssuer.hasId(ae)?E+=b.canonicalIssuer.getId(ae):(K.hasId(ae)||$.push(ae),E+=K.getId(ae)),0!==P.length&&E>P){Z=!0;break}if(!Z){for(const ae of $){const oe=yield b.hashNDegreeQuads(ae,K);if(E+=K.getId(ae),E+=`<${oe.hash}>`,K=oe.issuer,0!==P.length&&E>P){Z=!0;break}}Z||(0===P.length||E`}createHashToRelated(R,T){var b=this;return yt(function*(){const y=new Map,S=b.blankNodeInfo.get(R).quads;let A=0;for(const z of S)++A%100==0&&(yield b._yield()),yield Promise.all([b._addRelatedBlankNodeHash({quad:z,component:z.subject,position:"s",id:R,issuer:T,hashToRelated:y}),b._addRelatedBlankNodeHash({quad:z,component:z.object,position:"o",id:R,issuer:T,hashToRelated:y}),b._addRelatedBlankNodeHash({quad:z,component:z.graph,position:"g",id:R,issuer:T,hashToRelated:y})]);return y})()}_hashAndTrackBlankNode({id:R,hashToBlankNodes:T}){var b=this;return yt(function*(){const y=yield b.hashFirstDegreeQuads(R),S=T.get(y);S?S.push(R):T.set(y,[R])})()}_addBlankNodeQuadInfo({quad:R,component:T}){if("BlankNode"!==T.termType)return;const b=T.value,y=this.blankNodeInfo.get(b);y?y.quads.add(R):this.blankNodeInfo.set(b,{quads:new Set([R]),hash:null})}_addRelatedBlankNodeHash({quad:R,component:T,position:b,id:y,issuer:S,hashToRelated:A}){var z=this;return yt(function*(){if("BlankNode"!==T.termType||T.value===y)return;const P=T.value,X=yield z.hashRelatedBlankNode(P,R,S,b),ue=A.get(X);ue?ue.push(P):A.set(X,[P])})()}_useCanonicalId({component:R}){return"BlankNode"!==R.termType||R.value.startsWith(this.canonicalIssuer.prefix)?R:{termType:"BlankNode",value:this.canonicalIssuer.getId(R.value)}}_yield(){return yt(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,Se,he){"use strict";const W=Y("./IdentifierIssuer"),j=Y("./MessageDigest"),k=Y("./Permuter"),Q=Y("./NQuads");function H(w,C){return w.hashC.hash?1:0}Se.exports=class{constructor(){this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new W("_:c14n"),this.hashAlgorithm="sha256",this.quads=null}main(C){this.quads=C;for(const A of C)this._addBlankNodeQuadInfo({quad:A,component:A.subject}),this._addBlankNodeQuadInfo({quad:A,component:A.object}),this._addBlankNodeQuadInfo({quad:A,component:A.graph});const R=new Map,T=[...this.blankNodeInfo.keys()];for(const A of T)this._hashAndTrackBlankNode({id:A,hashToBlankNodes:R});const b=[...R.keys()].sort(),y=[];for(const A of b){const z=R.get(A);z.length>1?y.push(z):this.canonicalIssuer.getId(z[0])}for(const A of y){const z=[];for(const P of A){if(this.canonicalIssuer.hasId(P))continue;const X=new W("_:b");X.getId(P);const ue=this.hashNDegreeQuads(P,X);z.push(ue)}z.sort(H);for(const P of z){const X=P.issuer.getOldIds();for(const ue of X)this.canonicalIssuer.getId(ue)}}const S=[];for(const A of this.quads){const z=ot({},A);z.subject=this._useCanonicalId({component:z.subject}),z.object=this._useCanonicalId({component:z.object}),z.graph=this._useCanonicalId({component:z.graph}),S.push(Q.serializeQuad(z))}return S.sort(),S.join("")}hashFirstDegreeQuads(C){const R=[],T=this.blankNodeInfo.get(C),b=T.quads;for(const S of b){const A={subject:null,predicate:S.predicate,object:null,graph:null};A.subject=this.modifyFirstDegreeComponent(C,S.subject,"subject"),A.object=this.modifyFirstDegreeComponent(C,S.object,"object"),A.graph=this.modifyFirstDegreeComponent(C,S.graph,"graph"),R.push(Q.serializeQuad(A))}R.sort();const y=new j(this.hashAlgorithm);for(const S of R)y.update(S);return T.hash=y.digest(),T.hash}hashRelatedBlankNode(C,R,T,b){let y;y=this.canonicalIssuer.hasId(C)?this.canonicalIssuer.getId(C):T.hasId(C)?T.getId(C):this.blankNodeInfo.get(C).hash;const S=new j(this.hashAlgorithm);return S.update(b),"g"!==b&&S.update(this.getRelatedPredicate(R)),S.update(y),S.digest()}hashNDegreeQuads(C,R){const T=new j(this.hashAlgorithm),b=this.createHashToRelated(C,R),y=[...b.keys()].sort();for(const S of y){T.update(S);let z,A="";const P=new k(b.get(S));for(;P.hasNext();){const X=P.next();let ue=R.clone(),I="";const O=[];let K=!1;for(const E of X)if(this.canonicalIssuer.hasId(E)?I+=this.canonicalIssuer.getId(E):(ue.hasId(E)||O.push(E),I+=ue.getId(E)),0!==A.length&&I>A){K=!0;break}if(!K){for(const E of O){const $=this.hashNDegreeQuads(E,ue);if(I+=ue.getId(E),I+=`<${$.hash}>`,ue=$.issuer,0!==A.length&&I>A){K=!0;break}}K||(0===A.length||I`}createHashToRelated(C,R){const T=new Map,b=this.blankNodeInfo.get(C).quads;for(const y of b)this._addRelatedBlankNodeHash({quad:y,component:y.subject,position:"s",id:C,issuer:R,hashToRelated:T}),this._addRelatedBlankNodeHash({quad:y,component:y.object,position:"o",id:C,issuer:R,hashToRelated:T}),this._addRelatedBlankNodeHash({quad:y,component:y.graph,position:"g",id:C,issuer:R,hashToRelated:T});return T}_hashAndTrackBlankNode({id:C,hashToBlankNodes:R}){const T=this.hashFirstDegreeQuads(C),b=R.get(T);b?b.push(C):R.set(T,[C])}_addBlankNodeQuadInfo({quad:C,component:R}){if("BlankNode"!==R.termType)return;const T=R.value,b=this.blankNodeInfo.get(T);b?b.quads.add(C):this.blankNodeInfo.set(T,{quads:new Set([C]),hash:null})}_addRelatedBlankNodeHash({quad:C,component:R,position:T,id:b,issuer:y,hashToRelated:S}){if("BlankNode"!==R.termType||R.value===b)return;const A=R.value,z=this.hashRelatedBlankNode(A,C,y,T),P=S.get(z);P?P.push(A):S.set(z,[A])}_useCanonicalId({component:C}){return"BlankNode"!==C.termType||C.value.startsWith(this.canonicalIssuer.prefix)?C:{termType:"BlankNode",value:this.canonicalIssuer.getId(C.value)}}}},{"./IdentifierIssuer":47,"./MessageDigest":48,"./NQuads":49,"./Permuter":50}],53:[function(Y,Se,he){"use strict";const W=Y("./URDNA2015");Se.exports=class extends W{constructor(){super(),this.name="URGNA2012",this.hashAlgorithm="sha1"}modifyFirstDegreeComponent(k,Q,H){return"BlankNode"!==Q.termType?Q:"graph"===H?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:Q.value===k?"_:a":"_:z"}}getRelatedPredicate(k){return k.predicate.value}createHashToRelated(k,Q){var H=this;return yt(function*(){const w=new Map,C=H.blankNodeInfo.get(k).quads;let R=0;for(const T of C){let b,y;if("BlankNode"===T.subject.termType&&T.subject.value!==k)y=T.subject.value,b="p";else{if("BlankNode"!==T.object.termType||T.object.value===k)continue;y=T.object.value,b="r"}++R%100==0&&(yield H._yield());const S=yield H.hashRelatedBlankNode(y,T,Q,b),A=w.get(S);A?A.push(y):w.set(S,[y])}return w})()}}},{"./URDNA2015":51}],54:[function(Y,Se,he){"use strict";const W=Y("./URDNA2015Sync");Se.exports=class extends W{constructor(){super(),this.name="URGNA2012",this.hashAlgorithm="sha1"}modifyFirstDegreeComponent(k,Q,H){return"BlankNode"!==Q.termType?Q:"graph"===H?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:Q.value===k?"_:a":"_:z"}}getRelatedPredicate(k){return k.predicate.value}createHashToRelated(k,Q){const H=new Map,w=this.blankNodeInfo.get(k).quads;for(const C of w){let R,T;if("BlankNode"===C.subject.termType&&C.subject.value!==k)T=C.subject.value,R="p";else{if("BlankNode"!==C.object.termType||C.object.value===k)continue;T=C.object.value,R="r"}const b=this.hashRelatedBlankNode(T,C,Q,R),y=H.get(b);y?y.push(T):H.set(b,[T])}return H}}},{"./URDNA2015Sync":52}],55:[function(Y,Se,he){"use strict";const W=Y("./URDNA2015"),j=Y("./URGNA2012"),k=Y("./URDNA2015Sync"),Q=Y("./URGNA2012Sync");let H;try{H=Y("rdf-canonize-native")}catch(C){}const w={};Se.exports=w,w.NQuads=Y("./NQuads"),w.IdentifierIssuer=Y("./IdentifierIssuer"),w._rdfCanonizeNative=function(C){return C&&(H=C),H},w.canonize=function(){var C=yt(function*(R,T){if(Array.isArray(R)||(R=w.NQuads.legacyDatasetToQuads(R)),T.useNative){if(!H)throw new Error("rdf-canonize-native not available");return new Promise((b,y)=>H.canonize(R,T,(S,A)=>S?y(S):b(A)))}if("URDNA2015"===T.algorithm)return new W(T).main(R);if("URGNA2012"===T.algorithm)return new j(T).main(R);throw"algorithm"in T?new Error("Invalid RDF Dataset Canonicalization algorithm: "+T.algorithm):new Error("No RDF Dataset Canonicalization algorithm specified.")});return function(R,T){return C.apply(this,arguments)}}(),w._canonizeSync=function(C,R){if(Array.isArray(C)||(C=w.NQuads.legacyDatasetToQuads(C)),R.useNative){if(H)return H.canonizeSync(C,R);throw new Error("rdf-canonize-native not available")}if("URDNA2015"===R.algorithm)return new k(R).main(C);if("URGNA2012"===R.algorithm)return new Q(R).main(C);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,Se,he){"use strict";var W=this&&this.__createBinding||(Object.create?function(k,Q,H,w){void 0===w&&(w=H),Object.defineProperty(k,w,{enumerable:!0,get:function(){return Q[H]}})}:function(k,Q,H,w){void 0===w&&(w=H),k[w]=Q[H]}),j=this&&this.__exportStar||function(k,Q){for(var H in k)"default"!==H&&!Object.prototype.hasOwnProperty.call(Q,H)&&W(Q,k,H)};Object.defineProperty(he,"__esModule",{value:!0}),j(Y("./lib/BlankNode"),he),j(Y("./lib/DataFactory"),he),j(Y("./lib/DefaultGraph"),he),j(Y("./lib/Literal"),he),j(Y("./lib/NamedNode"),he),j(Y("./lib/Quad"),he),j(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,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.BlankNode=void 0;he.BlankNode=class{constructor(k){this.termType="BlankNode",this.value=k}equals(k){return!!k&&"BlankNode"===k.termType&&k.value===this.value}}},{}],58:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.DataFactory=void 0;const W=Y("./BlankNode"),j=Y("./DefaultGraph"),k=Y("./Literal"),Q=Y("./NamedNode"),H=Y("./Quad"),w=Y("./Variable");let C=0;he.DataFactory=class{constructor(b){this.blankNodeCounter=0,this.blankNodePrefix=(b=b||{}).blankNodePrefix||`df_${C++}_`}namedNode(b){return new Q.NamedNode(b)}blankNode(b){return new W.BlankNode(b||`${this.blankNodePrefix}${this.blankNodeCounter++}`)}literal(b,y){return new k.Literal(b,y)}variable(b){return new w.Variable(b)}defaultGraph(){return j.DefaultGraph.INSTANCE}quad(b,y,S,A){return new H.Quad(b,y,S,A||this.defaultGraph())}fromTerm(b){switch(b.termType){case"NamedNode":return this.namedNode(b.value);case"BlankNode":return this.blankNode(b.value);case"Literal":return b.language?this.literal(b.value,b.language):b.datatype.equals(k.Literal.XSD_STRING)?this.literal(b.value):this.literal(b.value,this.fromTerm(b.datatype));case"Variable":return this.variable(b.value);case"DefaultGraph":return this.defaultGraph();case"Quad":return this.quad(this.fromTerm(b.subject),this.fromTerm(b.predicate),this.fromTerm(b.object),this.fromTerm(b.graph))}}fromQuad(b){return this.fromTerm(b)}resetBlankNodeCounter(){this.blankNodeCounter=0}}},{"./BlankNode":57,"./DefaultGraph":59,"./Literal":60,"./NamedNode":61,"./Quad":62,"./Variable":63}],59:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.DefaultGraph=void 0;class W{constructor(){this.termType="DefaultGraph",this.value=""}equals(k){return!!k&&"DefaultGraph"===k.termType}}he.DefaultGraph=W,W.INSTANCE=new W},{}],60:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.Literal=void 0;const W=Y("./NamedNode");class j{constructor(Q,H){this.termType="Literal",this.value=Q,"string"==typeof H?(this.language=H,this.datatype=j.RDF_LANGUAGE_STRING):H?(this.language="",this.datatype=H):(this.language="",this.datatype=j.XSD_STRING)}equals(Q){return!!Q&&"Literal"===Q.termType&&Q.value===this.value&&Q.language===this.language&&Q.datatype.equals(this.datatype)}}he.Literal=j,j.RDF_LANGUAGE_STRING=new W.NamedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),j.XSD_STRING=new W.NamedNode("http://www.w3.org/2001/XMLSchema#string")},{"./NamedNode":61}],61:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.NamedNode=void 0;he.NamedNode=class{constructor(k){this.termType="NamedNode",this.value=k}equals(k){return!!k&&"NamedNode"===k.termType&&k.value===this.value}}},{}],62:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.Quad=void 0;he.Quad=class{constructor(k,Q,H,w){this.termType="Quad",this.value="",this.subject=k,this.predicate=Q,this.object=H,this.graph=w}equals(k){return!!k&&("Quad"===k.termType||!k.termType)&&this.subject.equals(k.subject)&&this.predicate.equals(k.predicate)&&this.object.equals(k.object)&&this.graph.equals(k.graph)}}},{}],63:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.Variable=void 0;he.Variable=class{constructor(k){this.termType="Variable",this.value=k}equals(k){return!!k&&"Variable"===k.termType&&k.value===this.value}}},{}],64:[function(Y,Se,he){"use strict";var W=this&&this.__createBinding||(Object.create?function(k,Q,H,w){void 0===w&&(w=H),Object.defineProperty(k,w,{enumerable:!0,get:function(){return Q[H]}})}:function(k,Q,H,w){void 0===w&&(w=H),k[w]=Q[H]}),j=this&&this.__exportStar||function(k,Q){for(var H in k)"default"!==H&&!Object.prototype.hasOwnProperty.call(Q,H)&&W(Q,k,H)};Object.defineProperty(he,"__esModule",{value:!0}),j(Y("./lib/RdfXmlParser"),he)},{"./lib/RdfXmlParser":66}],65:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.ParseError=void 0;class W extends Error{constructor(k,Q){const H=k.saxStream._parser;super(k.trackPosition?`Line ${H.line+1} column ${H.column+1}: ${Q}`:Q)}}he.ParseError=W},{}],66:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.ParseType=he.RdfXmlParser=void 0;const W=Y("relative-to-absolute-iri"),j=Y("sax"),k=Y("stream"),Q=Y("./ParseError"),H=Y("rdf-data-factory");class w extends k.Transform{constructor(T){super({readableObjectMode:!0}),this.activeTagStack=[],this.nodeIds={},T&&(Object.assign(this,T),this.options=T),this.dataFactory||(this.dataFactory=new H.DataFactory),this.baseIRI||(this.baseIRI=""),this.defaultGraph||(this.defaultGraph=this.dataFactory.defaultGraph()),this.saxStream=j.createStream(this.strict,{xmlns:!1,position:this.trackPosition}),this.strict||(this.saxStream._parser.looseCase="toString"),this.attachSaxListeners()}static parseNamespace(T,b){const y={};let S=!1;for(const z in T.attributes)z.startsWith("xmlns")&&(5===z.length?(S=!0,y[""]=T.attributes[z]):":"===z.charAt(5)&&(S=!0,y[z.substr(6)]=T.attributes[z]));const A=b&&b.ns?b.ns:[w.DEFAULT_NS];return S?A.concat([y]):A}static expandPrefixedTerm(T,b,y){const S=T.indexOf(":");let A,z;S>=0?(A=T.substr(0,S),z=T.substr(S+1)):(A="",z=T);let P=null,X=null;for(let ue=b.length-1;ue>=0;ue--){const I=b[ue][A];if(I){P=I;break}X||(X=b[ue][""])}if(!P){if(A&&"xmlns"!==A)throw new Q.ParseError(y,`The prefix '${A}' in term '${T}' was not bound.`);P=X||""}return{prefix:A,local:z,uri:P}}static isValidIri(T){return w.IRI_REGEX.test(T)}import(T){const b=new k.PassThrough({readableObjectMode:!0});T.on("error",S=>y.emit("error",S)),T.on("data",S=>b.push(S)),T.on("end",()=>b.push(null));const y=b.pipe(new w(this.options));return y}_transform(T,b,y){try{this.saxStream.write(T,b)}catch(S){return y(S)}y()}newParseError(T){return new Q.ParseError(this,T)}valueToUri(T,b){return this.uriToNamedNode(W.resolve(T,b.baseIRI))}uriToNamedNode(T){if(!w.isValidIri(T))throw this.newParseError(`Invalid URI: ${T}`);return this.dataFactory.namedNode(T)}validateNcname(T){if(!w.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 b=this.activeTagStack.length?this.activeTagStack[this.activeTagStack.length-1]:null;let y=C.RESOURCE;if(b&&(b.hadChildren=!0,y=b.childrenParseType),b&&b.childrenStringTags){const A=T.name;let z="";for(const I in T.attributes)z+=` ${I}="${T.attributes[I]}"`;b.childrenStringTags.push(`<${A}${z}>`);const ue={childrenStringTags:b.childrenStringTags};return ue.childrenStringEmitClosingTag=``,void this.activeTagStack.push(ue)}const S={};b?(S.language=b.language,S.baseIRI=b.baseIRI):S.baseIRI=this.baseIRI,this.activeTagStack.push(S),S.ns=w.parseNamespace(T,b),y===C.RESOURCE?this.onTagResource(T,S,b,!b):this.onTagProperty(T,S,b)}onTagResource(T,b,y,S){const A=w.expandPrefixedTerm(T.name,b.ns,this);b.childrenParseType=C.PROPERTY;let z=!0;if(A.uri===w.RDF){if(!S&&w.FORBIDDEN_NODE_ELEMENTS.indexOf(A.local)>=0)throw this.newParseError(`Illegal node element name: ${A.local}`);switch(A.local){case"RDF":b.childrenParseType=C.RESOURCE;case"Description":z=!1}}const P=[],X=[];let ue=null,I=!1,O=!1,K=null;for(const E in T.attributes){const $=T.attributes[E],Z=w.expandPrefixedTerm(E,b.ns,this);if(y&&Z.uri===w.RDF)switch(Z.local){case"about":if(ue)throw this.newParseError(`Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ${$} and ${ue} where found.`);ue=$;continue;case"ID":if(ue)throw this.newParseError(`Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ${$} and ${ue} where found.`);this.validateNcname($),ue="#"+$,I=!0;continue;case"nodeID":if(ue)throw this.newParseError(`Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ${$} and ${ue} where found.`);this.validateNcname($),ue=$,O=!0;continue;case"bagID":throw this.newParseError("rdf:bagID is not supported.");case"type":K=$;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(Z.uri===w.XML){if("lang"===Z.local){b.language=""===$?null:$.toLowerCase();continue}if("base"===Z.local){b.baseIRI=W.resolve($,b.baseIRI);continue}}"xml"!==Z.prefix&&Z.uri&&(P.push(this.uriToNamedNode(Z.uri+Z.local)),X.push($))}if(null!==ue&&(b.subject=O?this.dataFactory.blankNode(ue):this.valueToUri(ue,b),I&&this.claimNodeId(b.subject)),b.subject||(b.subject=this.dataFactory.blankNode()),z){const E=this.uriToNamedNode(A.uri+A.local);this.emitTriple(b.subject,this.dataFactory.namedNode(w.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(w.RDF+"first"),b.subject,b.reifiedStatementId),y.childrenCollectionSubject=E,y.childrenCollectionPredicate=this.dataFactory.namedNode(w.RDF+"rest")}else{this.emitTriple(y.subject,y.predicate,b.subject,y.reifiedStatementId);for(let E=0;E=0)throw this.newParseError(`Illegal property element name: ${S.local}`);b.predicateSubPredicates=[],b.predicateSubObjects=[];let A=!1,z=!1,P=null,X=!0;const ue=[],I=[];for(const O in T.attributes){const K=T.attributes[O],E=w.expandPrefixedTerm(O,b.ns,this);if(E.uri===w.RDF)switch(E.local){case"resource":if(P)throw this.newParseError(`Found both rdf:resource (${K}) and rdf:nodeID (${P}).`);if(A)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:resource (${K})`);b.hadChildren=!0,P=K,X=!1;continue;case"datatype":if(z)throw this.newParseError(`Found both non-rdf:* property attributes and rdf:datatype (${K}).`);if(A)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:datatype (${K})`);b.datatype=this.valueToUri(K,b);continue;case"nodeID":if(z)throw this.newParseError(`Found both non-rdf:* property attributes and rdf:nodeID (${K}).`);if(b.hadChildren)throw this.newParseError(`Found both rdf:resource and rdf:nodeID (${K}).`);if(A)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:nodeID (${K})`);this.validateNcname(K),b.hadChildren=!0,P=K,X=!0;continue;case"bagID":throw this.newParseError("rdf:bagID is not supported.");case"parseType":if(z)throw this.newParseError("rdf:parseType is not allowed when non-rdf:* property attributes are present");if(b.datatype)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:datatype (${b.datatype.value})`);if(P)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:nodeID or rdf:resource (${P})`);if("Resource"===K){A=!0,b.childrenParseType=C.PROPERTY;const $=this.dataFactory.blankNode();this.emitTriple(b.subject,b.predicate,$,b.reifiedStatementId),b.subject=$,b.predicate=null}else"Collection"===K?(A=!0,b.hadChildren=!0,b.childrenCollectionSubject=b.subject,b.childrenCollectionPredicate=b.predicate,X=!1):"Literal"===K&&(A=!0,b.childrenTagsToString=!0,b.childrenStringTags=[]);continue;case"ID":this.validateNcname(K),b.reifiedStatementId=this.valueToUri("#"+K,b),this.claimNodeId(b.reifiedStatementId);continue}else if(E.uri===w.XML&&"lang"===E.local){b.language=""===K?null:K.toLowerCase();continue}if("xml"!==E.prefix&&"xmlns"!==E.prefix&&E.uri){if(A||b.datatype)throw this.newParseError(`Found illegal rdf:* properties on property element with attribute: ${K}`);b.hadChildren=!0,z=!0,ue.push(this.uriToNamedNode(E.uri+E.local)),I.push(this.dataFactory.literal(K,b.datatype||b.language))}}if(null!==P){const O=b.subject;b.subject=X?this.dataFactory.blankNode(P):this.valueToUri(P,b),this.emitTriple(O,b.predicate,b.subject,b.reifiedStatementId);for(let K=0;K/g,(b,y,S)=>(this.saxStream._parser.ENTITIES[y]=S,""))}}var C,R;he.RdfXmlParser=w,w.IRI_REGEX=/^([A-Za-z][A-Za-z0-9+-.]*):[^ "<>{}|\\\[\]`]*$/,w.MIME_TYPE="application/rdf+xml",w.RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#",w.XML="http://www.w3.org/XML/1998/namespace",w.XMLNS="http://www.w3.org/2000/xmlns/",w.DEFAULT_NS={xml:w.XML},w.FORBIDDEN_NODE_ELEMENTS=["RDF","ID","about","bagID","parseType","resource","nodeID","li","aboutEach","aboutEachPrefix"],w.FORBIDDEN_PROPERTY_ELEMENTS=["Description","RDF","ID","about","bagID","parseType","resource","nodeID","aboutEach","aboutEachPrefix"],w.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=C=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,Se,he){"use strict";var j={};function k(R,T,b){b||(b=Error);var S=function(A){function z(P,X,ue){return A.call(this,function(A,z,P){return"string"==typeof T?T:T(A,z,P)}(P,X,ue))||this}return function(R,T){R.prototype=Object.create(T.prototype),R.prototype.constructor=R,R.__proto__=T}(z,A),z}(b);S.prototype.name=b.name,S.prototype.code=R,j[R]=S}function Q(R,T){if(Array.isArray(R)){var b=R.length;return R=R.map(function(y){return String(y)}),b>2?"one of ".concat(T," ").concat(R.slice(0,b-1).join(", "),", or ")+R[b-1]:2===b?"one of ".concat(T," ").concat(R[0]," or ").concat(R[1]):"of ".concat(T," ").concat(R[0])}return"of ".concat(T," ").concat(String(R))}k("ERR_INVALID_OPT_VALUE",function(R,T){return'The value "'+T+'" is invalid for option "'+R+'"'},TypeError),k("ERR_INVALID_ARG_TYPE",function(R,T,b){var y,S;if("string"==typeof T&&function(R,T,b){return R.substr(!b||b<0?0:+b,T.length)===T}(T,"not ")?(y="must not be",T=T.replace(/^not /,"")):y="must be",function(R,T,b){return(void 0===b||b>R.length)&&(b=R.length),R.substring(b-T.length,b)===T}(R," argument"))S="The ".concat(R," ").concat(y," ").concat(Q(T,"type"));else{var A=function(R,T,b){return"number"!=typeof b&&(b=0),!(b+T.length>R.length)&&-1!==R.indexOf(T,b)}(R,".")?"property":"argument";S='The "'.concat(R,'" ').concat(A," ").concat(y," ").concat(Q(T,"type"))}return S+". Received type ".concat(typeof b)},TypeError),k("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),k("ERR_METHOD_NOT_IMPLEMENTED",function(R){return"The "+R+" method is not implemented"}),k("ERR_STREAM_PREMATURE_CLOSE","Premature close"),k("ERR_STREAM_DESTROYED",function(R){return"Cannot call "+R+" after a stream was destroyed"}),k("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),k("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),k("ERR_STREAM_WRITE_AFTER_END","write after end"),k("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),k("ERR_UNKNOWN_ENCODING",function(R){return"Unknown encoding: "+R},TypeError),k("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),Se.exports.codes=j},{}],68:[function(Y,Se,he){(function(W){(function(){"use strict";var j=Object.keys||function(y){var S=[];for(var A in y)S.push(A);return S};Se.exports=R;var k=Y("./_stream_readable"),Q=Y("./_stream_writable");Y("inherits")(R,k);for(var H=j(Q.prototype),w=0;w0)if("string"!=typeof B&&!Ze.objectMode&&Object.getPrototypeOf(B)!==C.prototype&&(B=function(we){return C.from(we)}(B)),V)Ze.endEmitted?oe(we,new E):Oe(we,Ze,B,!0);else if(Ze.ended)oe(we,new O);else{if(Ze.destroyed)return!1;Ze.reading=!1,Ze.decoder&&!N?(B=Ze.decoder.write(B),Ze.objectMode||0!==B.length?Oe(we,Ze,B,!1):Ke(we,Ze)):Oe(we,Ze,B,!1)}else V||(Ze.reading=!1,Ke(we,Ze));return!Ze.ended&&(Ze.lengthB.highWaterMark&&(B.highWaterMark=function(we){return we>=st?we=st:(we--,we|=we>>>1,we|=we>>>2,we|=we>>>4,we|=we>>>8,we|=we>>>16,we++),we}(we)),we<=B.length?we:B.ended?B.length:(B.needReadable=!0,0))}function ze(we){var B=we._readableState;S("emitReadable",B.needReadable,B.emittedReadable),B.needReadable=!1,B.emittedReadable||(S("emitReadable",B.flowing),B.emittedReadable=!0,W.nextTick(Le,we))}function Le(we){var B=we._readableState;S("emitReadable_",B.destroyed,B.length,B.ended),!B.destroyed&&(B.length||B.ended)&&(we.emit("readable"),B.emittedReadable=!1),B.needReadable=!B.flowing&&!B.ended&&B.length<=B.highWaterMark,pe(we)}function Ke(we,B){B.readingMore||(B.readingMore=!0,W.nextTick(Me,we,B))}function Me(we,B){for(;!B.reading&&!B.ended&&(B.length0,B.resumeScheduled&&!B.paused?B.flowing=!0:we.listenerCount("data")>0&&we.resume()}function ke(we){S("readable nexttick read 0"),we.read(0)}function G(we,B){S("resume",B.reading),B.reading||we.read(0),B.resumeScheduled=!1,we.emit("resume"),pe(we),B.flowing&&!B.reading&&we.read(0)}function pe(we){var B=we._readableState;for(S("flow",B.flowing);B.flowing&&null!==we.read(););}function de(we,B){return 0===B.length?null:(B.objectMode?N=B.buffer.shift():!we||we>=B.length?(N=B.decoder?B.buffer.join(""):1===B.buffer.length?B.buffer.first():B.buffer.concat(B.length),B.buffer.clear()):N=B.buffer.consume(we,B.decoder),N);var N}function je(we){var B=we._readableState;S("endReadable",B.endEmitted),B.endEmitted||(B.ended=!0,W.nextTick(_t,B,we))}function _t(we,B){if(S("endReadableNT",we.endEmitted,we.length),!we.endEmitted&&0===we.length&&(we.endEmitted=!0,B.readable=!1,B.emit("end"),we.autoDestroy)){var N=B._writableState;(!N||N.autoDestroy&&N.finished)&&B.destroy()}}function pt(we,B){for(var N=0,V=we.length;N=B.highWaterMark:B.length>0)||B.ended))return S("read: emitReadable",B.length,B.ended),0===B.length&&B.ended?je(this):ze(this),null;if(0===(we=tt(we,B))&&B.ended)return 0===B.length&&je(this),null;var Re,V=B.needReadable;return S("need readable",V),(0===B.length||B.length-we0?de(we,B):null)?(B.needReadable=B.length<=B.highWaterMark,we=0):(B.length-=we,B.awaitDrain=0),0===B.length&&(B.ended||(B.needReadable=!0),N!==we&&B.ended&&je(this)),null!==Re&&this.emit("data",Re),Re},ne.prototype._read=function(we){oe(this,new K("_read()"))},ne.prototype.pipe=function(we,B){var N=this,V=this._readableState;switch(V.pipesCount){case 0:V.pipes=we;break;case 1:V.pipes=[V.pipes,we];break;default:V.pipes.push(we)}V.pipesCount+=1,S("pipe count=%d opts=%j",V.pipesCount,B);var Ze=B&&!1===B.end||we===W.stdout||we===W.stderr?fs:kt;function Tt(Bs,Kr){S("onunpipe"),Bs===N&&Kr&&!1===Kr.hasUnpiped&&(Kr.hasUnpiped=!0,S("cleanup"),we.removeListener("close",Xr),we.removeListener("finish",Ls),we.removeListener("drain",In),we.removeListener("error",xi),we.removeListener("unpipe",Tt),N.removeListener("end",kt),N.removeListener("end",fs),N.removeListener("data",Mi),Nn=!0,V.awaitDrain&&(!we._writableState||we._writableState.needDrain)&&In())}function kt(){S("onend"),we.end()}V.endEmitted?W.nextTick(Ze):N.once("end",Ze),we.on("unpipe",Tt);var In=function(we){return function(){var N=we._readableState;S("pipeOnDrain",N.awaitDrain),N.awaitDrain&&N.awaitDrain--,0===N.awaitDrain&&H(we,"data")&&(N.flowing=!0,pe(we))}}(N);we.on("drain",In);var Nn=!1;function Mi(Bs){S("ondata");var Kr=we.write(Bs);S("dest.write",Kr),!1===Kr&&((1===V.pipesCount&&V.pipes===we||V.pipesCount>1&&-1!==pt(V.pipes,we))&&!Nn&&(S("false write response, pause",V.awaitDrain),V.awaitDrain++),N.pause())}function xi(Bs){S("onerror",Bs),fs(),we.removeListener("error",xi),0===H(we,"error")&&oe(we,Bs)}function Xr(){we.removeListener("finish",Ls),fs()}function Ls(){S("onfinish"),we.removeListener("close",Xr),fs()}function fs(){S("unpipe"),N.unpipe(we)}return N.on("data",Mi),function(we,B,N){if("function"==typeof we.prependListener)return we.prependListener(B,N);we._events&&we._events[B]?Array.isArray(we._events[B])?we._events[B].unshift(N):we._events[B]=[N,we._events[B]]:we.on(B,N)}(we,"error",xi),we.once("close",Xr),we.once("finish",Ls),we.emit("pipe",N),V.flowing||(S("pipe resume"),N.resume()),we},ne.prototype.unpipe=function(we){var B=this._readableState,N={hasUnpiped:!1};if(0===B.pipesCount)return this;if(1===B.pipesCount)return we&&we!==B.pipes||(we||(we=B.pipes),B.pipes=null,B.pipesCount=0,B.flowing=!1,we&&we.emit("unpipe",this,N)),this;if(!we){var V=B.pipes,Re=B.pipesCount;B.pipes=null,B.pipesCount=0,B.flowing=!1;for(var Ze=0;Ze0,!1!==V.flowing&&this.resume()):"readable"===we&&!V.endEmitted&&!V.readableListening&&(V.readableListening=V.needReadable=!0,V.flowing=!1,V.emittedReadable=!1,S("on readable",V.length,V.reading),V.length?ze(this):V.reading||W.nextTick(ke,this)),N},ne.prototype.removeListener=function(we,B){var N=w.prototype.removeListener.call(this,we,B);return"readable"===we&&W.nextTick(qe,this),N},ne.prototype.removeAllListeners=function(we){var B=w.prototype.removeAllListeners.apply(this,arguments);return("readable"===we||void 0===we)&&W.nextTick(qe,this),B},ne.prototype.resume=function(){var we=this._readableState;return we.flowing||(S("resume"),we.flowing=!we.readableListening,function(we,B){B.resumeScheduled||(B.resumeScheduled=!0,W.nextTick(G,we,B))}(this,we)),we.paused=!1,this},ne.prototype.pause=function(){return S("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(S("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},ne.prototype.wrap=function(we){var B=this,N=this._readableState,V=!1;for(var Re in we.on("end",function(){if(S("wrapped end"),N.decoder&&!N.ended){var Tt=N.decoder.end();Tt&&Tt.length&&B.push(Tt)}B.push(null)}),we.on("data",function(Tt){S("wrapped data"),N.decoder&&(Tt=N.decoder.write(Tt)),N.objectMode&&null==Tt||!(N.objectMode||Tt&&Tt.length)||B.push(Tt)||(V=!0,we.pause())}),we)void 0===this[Re]&&"function"==typeof we[Re]&&(this[Re]=function(kt){return function(){return we[kt].apply(we,arguments)}}(Re));for(var Ze=0;Ze-1))throw new Z(de);return this._writableState.defaultEncoding=de,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(pe,de,je){je(new ue("_write()"))},me.prototype._writev=null,me.prototype.end=function(pe,de,je){var _t=this._writableState;return"function"==typeof pe?(je=pe,pe=null,de=null):"function"==typeof de&&(je=de,de=null),null!=pe&&this.write(pe,de),_t.corked&&(_t.corked=1,this.uncork()),_t.ending||function(pe,de,je){de.ending=!0,ke(pe,de),je&&(de.finished?W.nextTick(je):pe.once("finish",je)),de.ended=!0,pe.writable=!1}(this,_t,je),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(de){!this._writableState||(this._writableState.destroyed=de)}}),me.prototype.destroy=S.destroy,me.prototype._undestroy=S.undestroy,me.prototype._destroy=function(pe,de){de(pe)}}).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,Se,he){(function(W){(function(){"use strict";var j;function k(O,K,E){return K in O?Object.defineProperty(O,K,{value:E,enumerable:!0,configurable:!0,writable:!0}):O[K]=E,O}var Q=Y("./end-of-stream"),H=Symbol("lastResolve"),w=Symbol("lastReject"),C=Symbol("error"),R=Symbol("ended"),T=Symbol("lastPromise"),b=Symbol("handlePromise"),y=Symbol("stream");function S(O,K){return{value:O,done:K}}function A(O){var K=O[H];if(null!==K){var E=O[y].read();null!==E&&(O[T]=null,O[H]=null,O[w]=null,K(S(E,!1)))}}function z(O){W.nextTick(A,O)}var X=Object.getPrototypeOf(function(){}),ue=Object.setPrototypeOf((k(j={get stream(){return this[y]},next:function(){var K=this,E=this[C];if(null!==E)return Promise.reject(E);if(this[R])return Promise.resolve(S(void 0,!0));if(this[y].destroyed)return new Promise(function(oe,te){W.nextTick(function(){K[C]?te(K[C]):oe(S(void 0,!0))})});var Z,$=this[T];if($)Z=new Promise(function(O,K){return function(E,$){O.then(function(){K[R]?E(S(void 0,!0)):K[b](E,$)},$)}}($,this));else{var ae=this[y].read();if(null!==ae)return Promise.resolve(S(ae,!1));Z=new Promise(this[b])}return this[T]=Z,Z}},Symbol.asyncIterator,function(){return this}),k(j,"return",function(){var K=this;return new Promise(function(E,$){K[y].destroy(null,function(Z){Z?$(Z):E(S(void 0,!0))})})}),j),X);Se.exports=function(K){var E,$=Object.create(ue,(k(E={},y,{value:K,writable:!0}),k(E,H,{value:null,writable:!0}),k(E,w,{value:null,writable:!0}),k(E,C,{value:null,writable:!0}),k(E,R,{value:K._readableState.endEmitted,writable:!0}),k(E,b,{value:function(ae,oe){var te=$[y].read();te?($[T]=null,$[H]=null,$[w]=null,ae(S(te,!1))):($[H]=ae,$[w]=oe)},writable:!0}),E));return $[T]=null,Q(K,function(Z){if(Z&&"ERR_STREAM_PREMATURE_CLOSE"!==Z.code){var ae=$[w];return null!==ae&&($[T]=null,$[H]=null,$[w]=null,ae(Z)),void($[C]=Z)}var oe=$[H];null!==oe&&($[T]=null,$[H]=null,$[w]=null,oe(S(void 0,!0))),$[R]=!0}),K.on("readable",z.bind(null,$)),$}}).call(this)}).call(this,Y("_process"))},{"./end-of-stream":76,_process:44}],74:[function(Y,Se,he){"use strict";function W(A,z){var P=Object.keys(A);if(Object.getOwnPropertySymbols){var X=Object.getOwnPropertySymbols(A);z&&(X=X.filter(function(ue){return Object.getOwnPropertyDescriptor(A,ue).enumerable})),P.push.apply(P,X)}return P}function k(A,z,P){return z in A?Object.defineProperty(A,z,{value:P,enumerable:!0,configurable:!0,writable:!0}):A[z]=P,A}function H(A,z){for(var P=0;P0?this.tail.next=X:this.head=X,this.tail=X,++this.length}},{key:"unshift",value:function(P){var X={data:P,next:this.head};0===this.length&&(this.tail=X),this.head=X,++this.length}},{key:"shift",value:function(){if(0!==this.length){var P=this.head.data;return this.head=1===this.length?this.tail=null:this.head.next,--this.length,P}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(P){if(0===this.length)return"";for(var X=this.head,ue=""+X.data;X=X.next;)ue+=P+X.data;return ue}},{key:"concat",value:function(P){if(0===this.length)return R.alloc(0);for(var X=R.allocUnsafe(P>>>0),ue=this.head,I=0;ue;)S(ue.data,X,I),I+=ue.data.length,ue=ue.next;return X}},{key:"consume",value:function(P,X){var ue;return PO.length?O.length:P;if(I+=K===O.length?O:O.slice(0,P),0==(P-=K)){K===O.length?(++ue,this.head=X.next?X.next:this.tail=null):(this.head=X,X.data=O.slice(K));break}++ue}return this.length-=ue,I}},{key:"_getBuffer",value:function(P){var X=R.allocUnsafe(P),ue=this.head,I=1;for(ue.data.copy(X),P-=ue.data.length;ue=ue.next;){var O=ue.data,K=P>O.length?O.length:P;if(O.copy(X,X.length-P,0,K),0==(P-=K)){K===O.length?(++I,this.head=ue.next?ue.next:this.tail=null):(this.head=ue,ue.data=O.slice(K));break}++I}return this.length-=I,X}},{key:y,value:function(P,X){return b(this,function(A){for(var z=1;z0,function(Z){ue||(ue=Z),Z&&I.forEach(T),!E&&(I.forEach(T),X(ue))})});return z.reduce(b)}},{"../../../errors":67,"./end-of-stream":76}],79:[function(Y,Se,he){"use strict";var W=Y("../../../errors").codes.ERR_INVALID_OPT_VALUE;Se.exports={getHighWaterMark:function(Q,H,w,C){var R=function(Q,H,w){return null!=Q.highWaterMark?Q.highWaterMark:H?Q[w]:null}(H,C,w);if(null!=R){if(!isFinite(R)||Math.floor(R)!==R||R<0)throw new W(C?w:"highWaterMark",R);return Math.floor(R)}return Q.objectMode?16:16384}}},{"../../../errors":67}],80:[function(Y,Se,he){Se.exports=Y("events").EventEmitter},{events:8}],81:[function(Y,Se,he){(he=Se.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,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),function(j){for(var k in j)he.hasOwnProperty(k)||(he[k]=j[k])}(Y("./lib/Resolve"))},{"./lib/Resolve":83}],83:[function(Y,Se,he){"use strict";function j(H){const w=[];let C=0;for(;CR.join("")).join("/")}function k(H,w){let C=w+1;w>=0?"/"===H[w+1]&&"/"===H[w+2]&&(C=w+3):"/"===H[0]&&"/"===H[1]&&(C=2);const R=H.indexOf("/",C);return R<0?H:H.substr(0,R)+j(H.substr(R))}function Q(H){return!H||"#"===H||"?"===H||"/"===H}Object.defineProperty(he,"__esModule",{value:!0}),he.resolve=function(H,w){const C=(w=w||"").indexOf("#");if(C>0&&(w=w.substr(0,C)),!H.length){if(w.indexOf(":")<0)throw new Error(`Found invalid baseIRI '${w}' for value '${H}'`);return w}if(H.startsWith("?")){const z=w.indexOf("?");return z>0&&(w=w.substr(0,z)),w+H}if(H.startsWith("#"))return w+H;if(!w.length){const z=H.indexOf(":");if(z<0)throw new Error(`Found invalid relative IRI '${H}' for a missing baseIRI`);return k(H,z)}const R=H.indexOf(":");if(R>=0)return k(H,R);const T=w.indexOf(":");if(T<0)throw new Error(`Found invalid baseIRI '${w}' for value '${H}'`);const b=w.substr(0,T+1);if(0===H.indexOf("//"))return b+k(H,R);let y;if(w.indexOf("//",T)===T+1){if(y=w.indexOf("/",T+3),y<0)return w.length>T+3?w+"/"+k(H,R):b+k(H,R)}else if(y=w.indexOf("/",T+1),y<0)return b+k(H,R);if(0===H.indexOf("/"))return w.substr(0,y)+j(H);let S=w.substr(y);const A=S.lastIndexOf("/");return A>=0&&A"===de?(ne(G,"onsgmldeclaration",G.sgmlDecl),G.sgmlDecl="",G.state=te.TEXT):($(de)&&(G.state=te.SGML_DECL_QUOTED),G.sgmlDecl+=de);continue;case te.SGML_DECL_QUOTED:de===G.q&&(G.state=te.SGML_DECL,G.q=""),G.sgmlDecl+=de;continue;case te.DOCTYPE:">"===de?(G.state=te.TEXT,ne(G,"ondoctype",G.doctype),G.doctype=!0):(G.doctype+=de,"["===de?G.state=te.DOCTYPE_DTD:$(de)&&(G.state=te.DOCTYPE_QUOTED,G.q=de));continue;case te.DOCTYPE_QUOTED:G.doctype+=de,de===G.q&&(G.q="",G.state=te.DOCTYPE);continue;case te.DOCTYPE_DTD:G.doctype+=de,"]"===de?G.state=te.DOCTYPE:$(de)&&(G.state=te.DOCTYPE_DTD_QUOTED,G.q=de);continue;case te.DOCTYPE_DTD_QUOTED:G.doctype+=de,de===G.q&&(G.state=te.DOCTYPE_DTD,G.q="");continue;case te.COMMENT:"-"===de?G.state=te.COMMENT_ENDING:G.comment+=de;continue;case te.COMMENT_ENDING:"-"===de?(G.state=te.COMMENT_ENDED,G.comment=Oe(G.opt,G.comment),G.comment&&ne(G,"oncomment",G.comment),G.comment=""):(G.comment+="-"+de,G.state=te.COMMENT);continue;case te.COMMENT_ENDED:">"!==de?(Qe(G,"Malformed comment"),G.comment+="--"+de,G.state=te.COMMENT):G.state=te.TEXT;continue;case te.CDATA:"]"===de?G.state=te.CDATA_ENDING:G.cdata+=de;continue;case te.CDATA_ENDING:"]"===de?G.state=te.CDATA_ENDING_2:(G.cdata+="]"+de,G.state=te.CDATA);continue;case te.CDATA_ENDING_2:">"===de?(G.cdata&&ne(G,"oncdata",G.cdata),ne(G,"onclosecdata"),G.cdata="",G.state=te.TEXT):"]"===de?G.cdata+="]":(G.cdata+="]]"+de,G.state=te.CDATA);continue;case te.PROC_INST:"?"===de?G.state=te.PROC_INST_ENDING:E(de)?G.state=te.PROC_INST_BODY:G.procInstName+=de;continue;case te.PROC_INST_BODY:if(!G.procInstBody&&E(de))continue;"?"===de?G.state=te.PROC_INST_ENDING:G.procInstBody+=de;continue;case te.PROC_INST_ENDING:">"===de?(ne(G,"onprocessinginstruction",{name:G.procInstName,body:G.procInstBody}),G.procInstName=G.procInstBody="",G.state=te.TEXT):(G.procInstBody+="?"+de,G.state=te.PROC_INST_BODY);continue;case te.OPEN_TAG:ae(I,de)?G.tagName+=de:(tt(G),">"===de?Le(G):"/"===de?G.state=te.OPEN_TAG_SLASH:(E(de)||Qe(G,"Invalid character in tag name"),G.state=te.ATTRIB));continue;case te.OPEN_TAG_SLASH:">"===de?(Le(G,!0),Ke(G)):(Qe(G,"Forward-slash in opening tag not followed by >"),G.state=te.ATTRIB);continue;case te.ATTRIB:if(E(de))continue;">"===de?Le(G):"/"===de?G.state=te.OPEN_TAG_SLASH:ae(ue,de)?(G.attribName=de,G.attribValue="",G.state=te.ATTRIB_NAME):Qe(G,"Invalid attribute name");continue;case te.ATTRIB_NAME:"="===de?G.state=te.ATTRIB_VALUE:">"===de?(Qe(G,"Attribute without value"),G.attribValue=G.attribName,ze(G),Le(G)):E(de)?G.state=te.ATTRIB_NAME_SAW_WHITE:ae(I,de)?G.attribName+=de:Qe(G,"Invalid attribute name");continue;case te.ATTRIB_NAME_SAW_WHITE:if("="===de)G.state=te.ATTRIB_VALUE;else{if(E(de))continue;Qe(G,"Attribute without value"),G.tag.attributes[G.attribName]="",G.attribValue="",ne(G,"onattribute",{name:G.attribName,value:""}),G.attribName="",">"===de?Le(G):ae(ue,de)?(G.attribName=de,G.state=te.ATTRIB_NAME):(Qe(G,"Invalid attribute name"),G.state=te.ATTRIB)}continue;case te.ATTRIB_VALUE:if(E(de))continue;$(de)?(G.q=de,G.state=te.ATTRIB_VALUE_QUOTED):(Qe(G,"Unquoted attribute value"),G.state=te.ATTRIB_VALUE_UNQUOTED,G.attribValue=de);continue;case te.ATTRIB_VALUE_QUOTED:if(de!==G.q){"&"===de?G.state=te.ATTRIB_VALUE_ENTITY_Q:G.attribValue+=de;continue}ze(G),G.q="",G.state=te.ATTRIB_VALUE_CLOSED;continue;case te.ATTRIB_VALUE_CLOSED:E(de)?G.state=te.ATTRIB:">"===de?Le(G):"/"===de?G.state=te.OPEN_TAG_SLASH:ae(ue,de)?(Qe(G,"No whitespace between attributes"),G.attribName=de,G.attribValue="",G.state=te.ATTRIB_NAME):Qe(G,"Invalid attribute name");continue;case te.ATTRIB_VALUE_UNQUOTED:if(!Z(de)){"&"===de?G.state=te.ATTRIB_VALUE_ENTITY_U:G.attribValue+=de;continue}ze(G),">"===de?Le(G):G.state=te.ATTRIB;continue;case te.CLOSE_TAG:if(G.tagName)">"===de?Ke(G):ae(I,de)?G.tagName+=de:G.script?(G.script+=""===de?Ke(G):Qe(G,"Invalid characters in closing tag");continue;case te.TEXT_ENTITY:case te.ATTRIB_VALUE_ENTITY_Q:case te.ATTRIB_VALUE_ENTITY_U:var pt,we;switch(G.state){case te.TEXT_ENTITY:pt=te.TEXT,we="textNode";break;case te.ATTRIB_VALUE_ENTITY_Q:pt=te.ATTRIB_VALUE_QUOTED,we="attribValue";break;case te.ATTRIB_VALUE_ENTITY_U:pt=te.ATTRIB_VALUE_UNQUOTED,we="attribValue"}";"===de?(G[we]+=Me(G),G.entity="",G.state=pt):ae(G.entity.length?K:O,de)?G.entity+=de:(Qe(G,"Invalid character in entity name"),G[we]+="&"+G.entity+de,G.entity="",G.state=pt);continue;default:throw new Error(G,"Unknown state: "+G.state)}return G.position>=G.bufferCheckPosition&&function(q){for(var G=Math.max(j.MAX_BUFFER_LENGTH,10),pe=0,de=0,je=k.length;deG)switch(k[de]){case"textNode":ye(q);break;case"cdata":ne(q,"oncdata",q.cdata),q.cdata="";break;case"script":ne(q,"onscript",q.script),q.script="";break;default:$e(q,"Max buffer length exceeded: "+k[de])}pe=Math.max(pe,_t)}q.bufferCheckPosition=j.MAX_BUFFER_LENGTH-pe+q.position}(G),G},resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){!function(q){ye(q),""!==q.cdata&&(ne(q,"oncdata",q.cdata),q.cdata=""),""!==q.script&&(ne(q,"onscript",q.script),q.script="")}(this)}};try{R=Y("stream").Stream}catch(q){R=function(){}}var T=j.EVENTS.filter(function(q){return"error"!==q&&"end"!==q});function y(q,G){if(!(this instanceof y))return new y(q,G);R.apply(this),this._parser=new Q(q,G),this.writable=!0,this.readable=!0;var pe=this;this._parser.onend=function(){pe.emit("end")},this._parser.onerror=function(de){pe.emit("error",de),pe._parser.error=null},this._decoder=null,T.forEach(function(de){Object.defineProperty(pe,"on"+de,{get:function(){return pe._parser["on"+de]},set:function(je){if(!je)return pe.removeAllListeners(de),pe._parser["on"+de]=je,je;pe.on(de,je)},enumerable:!0,configurable:!1})})}(y.prototype=Object.create(R.prototype,{constructor:{value:y}})).write=function(q){if("function"==typeof W&&"function"==typeof W.isBuffer&&W.isBuffer(q)){if(!this._decoder){var G=Y("string_decoder").StringDecoder;this._decoder=new G("utf8")}q=this._decoder.write(q)}return this._parser.write(q.toString()),this.emit("data",q),!0},y.prototype.end=function(q){return q&&q.length&&this.write(q),this._parser.end(),!0},y.prototype.on=function(q,G){var pe=this;return!pe._parser["on"+q]&&-1!==T.indexOf(q)&&(pe._parser["on"+q]=function(){var de=1===arguments.length?[arguments[0]]:Array.apply(null,arguments);de.splice(0,0,q),pe.emit.apply(pe,de)}),R.prototype.on.call(pe,q,G)};var z="http://www.w3.org/XML/1998/namespace",P="http://www.w3.org/2000/xmlns/",X={xml:z,xmlns:P},ue=/[:_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]/,I=/[:_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-]/,O=/[#:_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]/,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\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;function E(q){return" "===q||"\n"===q||"\r"===q||"\t"===q}function $(q){return'"'===q||"'"===q}function Z(q){return">"===q||E(q)}function ae(q,G){return q.test(G)}function oe(q,G){return!ae(q,G)}var q,G,pe,te=0;for(var Te in j.STATE={BEGIN:te++,BEGIN_WHITESPACE:te++,TEXT:te++,TEXT_ENTITY:te++,OPEN_WAKA:te++,SGML_DECL:te++,SGML_DECL_QUOTED:te++,DOCTYPE:te++,DOCTYPE_QUOTED:te++,DOCTYPE_DTD:te++,DOCTYPE_DTD_QUOTED:te++,COMMENT_STARTING:te++,COMMENT:te++,COMMENT_ENDING:te++,COMMENT_ENDED:te++,CDATA:te++,CDATA_ENDING:te++,CDATA_ENDING_2:te++,PROC_INST:te++,PROC_INST_BODY:te++,PROC_INST_ENDING:te++,OPEN_TAG:te++,OPEN_TAG_SLASH:te++,ATTRIB:te++,ATTRIB_NAME:te++,ATTRIB_NAME_SAW_WHITE:te++,ATTRIB_VALUE:te++,ATTRIB_VALUE_QUOTED:te++,ATTRIB_VALUE_CLOSED:te++,ATTRIB_VALUE_UNQUOTED:te++,ATTRIB_VALUE_ENTITY_Q:te++,ATTRIB_VALUE_ENTITY_U:te++,CLOSE_TAG:te++,CLOSE_TAG_SAW_WHITE:te++,SCRIPT:te++,SCRIPT_ENDING:te++},j.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},j.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(j.ENTITIES).forEach(function(q){var G=j.ENTITIES[q],pe="number"==typeof G?String.fromCharCode(G):G;j.ENTITIES[q]=pe}),j.STATE)j.STATE[j.STATE[Te]]=Te;function me(q,G,pe){q[G]&&q[G](pe)}function ne(q,G,pe){q.textNode&&ye(q),me(q,G,pe)}function ye(q){q.textNode=Oe(q.opt,q.textNode),q.textNode&&me(q,"ontext",q.textNode),q.textNode=""}function Oe(q,G){return q.trim&&(G=G.trim()),q.normalize&&(G=G.replace(/\s+/g," ")),G}function $e(q,G){return ye(q),q.trackPosition&&(G+="\nLine: "+q.line+"\nColumn: "+q.column+"\nChar: "+q.c),G=new Error(G),q.error=G,me(q,"onerror",G),q}function st(q){return q.sawRoot&&!q.closedRoot&&Qe(q,"Unclosed root tag"),q.state!==te.BEGIN&&q.state!==te.BEGIN_WHITESPACE&&q.state!==te.TEXT&&$e(q,"Unexpected end"),ye(q),q.c="",q.closed=!0,me(q,"onend"),Q.call(q,q.strict,q.opt),q}function Qe(q,G){if("object"!=typeof q||!(q instanceof Q))throw new Error("bad call to strictFail");q.strict&&$e(q,G)}function tt(q){q.strict||(q.tagName=q.tagName[q.looseCase]());var G=q.tags[q.tags.length-1]||q,pe=q.tag={name:q.tagName,attributes:{}};q.opt.xmlns&&(pe.ns=G.ns),q.attribList.length=0,ne(q,"onopentagstart",pe)}function Xe(q,G){var de=q.indexOf(":")<0?["",q]:q.split(":"),je=de[0],_t=de[1];return G&&"xmlns"===q&&(je="xmlns",_t=""),{prefix:je,local:_t}}function ze(q){if(q.strict||(q.attribName=q.attribName[q.looseCase]()),-1!==q.attribList.indexOf(q.attribName)||q.tag.attributes.hasOwnProperty(q.attribName))q.attribName=q.attribValue="";else{if(q.opt.xmlns){var G=Xe(q.attribName,!0),de=G.local;if("xmlns"===G.prefix)if("xml"===de&&q.attribValue!==z)Qe(q,"xml: prefix must be bound to "+z+"\nActual: "+q.attribValue);else if("xmlns"===de&&q.attribValue!==P)Qe(q,"xmlns: prefix must be bound to "+P+"\nActual: "+q.attribValue);else{var je=q.tag,_t=q.tags[q.tags.length-1]||q;je.ns===_t.ns&&(je.ns=Object.create(_t.ns)),je.ns[de]=q.attribValue}q.attribList.push([q.attribName,q.attribValue])}else q.tag.attributes[q.attribName]=q.attribValue,ne(q,"onattribute",{name:q.attribName,value:q.attribValue});q.attribName=q.attribValue=""}}function Le(q,G){if(q.opt.xmlns){var pe=q.tag,de=Xe(q.tagName);pe.prefix=de.prefix,pe.local=de.local,pe.uri=pe.ns[de.prefix]||"",pe.prefix&&!pe.uri&&(Qe(q,"Unbound namespace prefix: "+JSON.stringify(q.tagName)),pe.uri=de.prefix),pe.ns&&(q.tags[q.tags.length-1]||q).ns!==pe.ns&&Object.keys(pe.ns).forEach(function(In){ne(q,"onopennamespace",{prefix:In,uri:pe.ns[In]})});for(var _t=0,pt=q.attribList.length;_t",q.tagName="",void(q.state=te.SCRIPT);ne(q,"onscript",q.script),q.script=""}var G=q.tags.length,pe=q.tagName;q.strict||(pe=pe[q.looseCase]());for(var de=pe;G--&&q.tags[G].name!==de;)Qe(q,"Unexpected close tag");if(G<0)return Qe(q,"Unmatched closing tag: "+q.tagName),q.textNode+="",void(q.state=te.TEXT);q.tagName=pe;for(var _t=q.tags.length;_t-- >G;){var pt=q.tag=q.tags.pop();q.tagName=q.tag.name,ne(q,"onclosetag",q.tagName);var we={};for(var B in pt.ns)we[B]=pt.ns[B];q.opt.xmlns&&pt.ns!==(q.tags[q.tags.length-1]||q).ns&&Object.keys(pt.ns).forEach(function(V){ne(q,"onclosenamespace",{prefix:V,uri:pt.ns[V]})})}0===G&&(q.closedRoot=!0),q.tagName=q.attribValue=q.attribName="",q.attribList.length=0,q.state=te.TEXT}function Me(q){var de,G=q.entity,pe=G.toLowerCase(),je="";return q.ENTITIES[G]?q.ENTITIES[G]:q.ENTITIES[pe]?q.ENTITIES[pe]:("#"===(G=pe).charAt(0)&&("x"===G.charAt(1)?(G=G.slice(2),je=(de=parseInt(G,16)).toString(16)):(G=G.slice(1),je=(de=parseInt(G,10)).toString(10))),G=G.replace(/^0+/,""),isNaN(de)||je.toLowerCase()!==G?(Qe(q,"Invalid character entity"),"&"+q.entity+";"):String.fromCodePoint(de))}function Ue(q,G){"<"===G?(q.state=te.OPEN_WAKA,q.startTagPosition=q.position):E(G)||(Qe(q,"Non-whitespace before first tag."),q.textNode=G,q.state=te.TEXT)}function qe(q,G){var pe="";return G1114111||G(V)!==V)throw RangeError("Invalid code point: "+V);V<=65535?je.push(V):je.push(55296+((V-=65536)>>10),V%1024+56320),(we+1===B||je.length>de)&&(N+=q.apply(null,je),je.length=0)}return N},Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:pe,configurable:!0,writable:!0}):String.fromCodePoint=pe)}(void 0===he?this.sax={}:he)}).call(this)}).call(this,Y("buffer").Buffer)},{buffer:6,stream:87,string_decoder:5}],86:[function(Y,Se,he){(function(W,j){(function(){!function(k,Q){"use strict";if(!k.setImmediate){var T,H=1,w={},C=!1,R=k.document,K=Object.getPrototypeOf&&Object.getPrototypeOf(k);K=K&&K.setTimeout?K:k,"[object process]"==={}.toString.call(k.process)?T=function(E){W.nextTick(function(){A(E)})}:function(){if(k.postMessage&&!k.importScripts){var E=!0,$=k.onmessage;return k.onmessage=function(){E=!1},k.postMessage("","*"),k.onmessage=$,E}}()?(E="setImmediate$"+Math.random()+"$",$=function(Z){Z.source===k&&"string"==typeof Z.data&&0===Z.data.indexOf(E)&&A(+Z.data.slice(E.length))},k.addEventListener?k.addEventListener("message",$,!1):k.attachEvent("onmessage",$),T=function(Z){k.postMessage(E+Z,"*")}):k.MessageChannel?function(){var E=new MessageChannel;E.port1.onmessage=function($){A($.data)},T=function($){E.port2.postMessage($)}}():R&&"onreadystatechange"in R.createElement("script")?function(){var E=R.documentElement;T=function($){var Z=R.createElement("script");Z.onreadystatechange=function(){A($),Z.onreadystatechange=null,E.removeChild(Z),Z=null},E.appendChild(Z)}}():T=function(E){setTimeout(A,0,E)},K.setImmediate=function(E){"function"!=typeof E&&(E=new Function(""+E));for(var $=new Array(arguments.length-1),Z=0;Z<$.length;Z++)$[Z]=arguments[Z+1];return w[H]={callback:E,args:$},T(H),H++},K.clearImmediate=y}var E,$;function y(E){delete w[E]}function A(E){if(C)setTimeout(A,0,E);else{var $=w[E];if($){C=!0;try{!function(E){var $=E.callback,Z=E.args;switch(Z.length){case 0:$();break;case 1:$(Z[0]);break;case 2:$(Z[0],Z[1]);break;case 3:$(Z[0],Z[1],Z[2]);break;default:$.apply(void 0,Z)}}($)}finally{y(E),C=!1}}}}}("undefined"==typeof self?void 0===j?this:j:self)}).call(this)}).call(this,Y("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:44}],87:[function(Y,Se,he){Se.exports=k;var W=Y("events").EventEmitter;function k(){W.call(this)}Y("inherits")(k,W),k.Readable=Y("readable-stream/lib/_stream_readable.js"),k.Writable=Y("readable-stream/lib/_stream_writable.js"),k.Duplex=Y("readable-stream/lib/_stream_duplex.js"),k.Transform=Y("readable-stream/lib/_stream_transform.js"),k.PassThrough=Y("readable-stream/lib/_stream_passthrough.js"),k.finished=Y("readable-stream/lib/internal/streams/end-of-stream.js"),k.pipeline=Y("readable-stream/lib/internal/streams/pipeline.js"),k.Stream=k,k.prototype.pipe=function(Q,H){var w=this;function C(z){Q.writable&&!1===Q.write(z)&&w.pause&&w.pause()}function R(){w.readable&&w.resume&&w.resume()}w.on("data",C),Q.on("drain",R),!Q._isStdio&&(!H||!1!==H.end)&&(w.on("end",b),w.on("close",y));var T=!1;function b(){T||(T=!0,Q.end())}function y(){T||(T=!0,"function"==typeof Q.destroy&&Q.destroy())}function S(z){if(A(),0===W.listenerCount(this,"error"))throw z}function A(){w.removeListener("data",C),Q.removeListener("drain",R),w.removeListener("end",b),w.removeListener("close",y),w.removeListener("error",S),Q.removeListener("error",S),w.removeListener("end",A),w.removeListener("close",A),Q.removeListener("close",A)}return w.on("error",S),Q.on("error",S),w.on("end",A),w.on("close",A),Q.on("close",A),Q.emit("pipe",w),Q}},{events:8,inherits:10,"readable-stream/lib/_stream_duplex.js":68,"readable-stream/lib/_stream_passthrough.js":69,"readable-stream/lib/_stream_readable.js":70,"readable-stream/lib/_stream_transform.js":71,"readable-stream/lib/_stream_writable.js":72,"readable-stream/lib/internal/streams/end-of-stream.js":76,"readable-stream/lib/internal/streams/pipeline.js":78}],88:[function(Y,Se,he){arguments[4][5][0].apply(he,arguments)},{dup:5,"safe-buffer":84}],89:[function(Y,Se,he){(function(W,j){(function(){var k=Y("process/browser.js").nextTick,Q=Function.prototype.apply,H=Array.prototype.slice,w={},C=0;function R(T,b){this._id=T,this._clearFn=b}he.setTimeout=function(){return new R(Q.call(setTimeout,window,arguments),clearTimeout)},he.setInterval=function(){return new R(Q.call(setInterval,window,arguments),clearInterval)},he.clearTimeout=he.clearInterval=function(T){T.close()},R.prototype.unref=R.prototype.ref=function(){},R.prototype.close=function(){this._clearFn.call(window,this._id)},he.enroll=function(T,b){clearTimeout(T._idleTimeoutId),T._idleTimeout=b},he.unenroll=function(T){clearTimeout(T._idleTimeoutId),T._idleTimeout=-1},he._unrefActive=he.active=function(T){clearTimeout(T._idleTimeoutId);var b=T._idleTimeout;b>=0&&(T._idleTimeoutId=setTimeout(function(){T._onTimeout&&T._onTimeout()},b))},he.setImmediate="function"==typeof W?W:function(T){var b=C++,y=!(arguments.length<2)&&H.call(arguments,1);return w[b]=!0,k(function(){w[b]&&(y?T.apply(null,y):T.call(null),he.clearImmediate(b))}),b},he.clearImmediate="function"==typeof j?j:function(T){delete w[T]}}).call(this)}).call(this,Y("timers").setImmediate,Y("timers").clearImmediate)},{"process/browser.js":44,timers:89}],90:[function(Y,Se,he){(function(W){(function(){function k(Q){try{if(!W.localStorage)return!1}catch(w){return!1}var H=W.localStorage[Q];return null!=H&&"true"===String(H).toLowerCase()}Se.exports=function(Q,H){if(k("noDeprecation"))return Q;var w=!1;return function(){if(!w){if(k("throwDeprecation"))throw new Error(H);k("traceDeprecation")?console.trace(H):console.warn(H),w=!0}return Q.apply(this,arguments)}}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],91:[function(Y,Se,he){"use strict";Se.exports=function(W){W.prototype[Symbol.iterator]=function*(){for(let j=this.head;j;j=j.next)yield j.value}}},{}],92:[function(Y,Se,he){"use strict";function W(w){var C=this;if(C instanceof W||(C=new W),C.tail=null,C.head=null,C.length=0,w&&"function"==typeof w.forEach)w.forEach(function(b){C.push(b)});else if(arguments.length>0)for(var R=0,T=arguments.length;R1)R=C;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");T=this.head.next,R=this.head.value}for(var b=0;null!==T;b++)R=w(R,T.value,b),T=T.next;return R},W.prototype.reduceReverse=function(w,C){var R,T=this.tail;if(arguments.length>1)R=C;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");T=this.tail.prev,R=this.tail.value}for(var b=this.length-1;null!==T;b--)R=w(R,T.value,b),T=T.prev;return R},W.prototype.toArray=function(){for(var w=new Array(this.length),C=0,R=this.head;null!==R;C++)w[C]=R.value,R=R.next;return w},W.prototype.toArrayReverse=function(){for(var w=new Array(this.length),C=0,R=this.tail;null!==R;C++)w[C]=R.value,R=R.prev;return w},W.prototype.slice=function(w,C){(C=C||this.length)<0&&(C+=this.length),(w=w||0)<0&&(w+=this.length);var R=new W;if(Cthis.length&&(C=this.length);for(var T=0,b=this.head;null!==b&&Tthis.length&&(C=this.length);for(var T=this.length,b=this.tail;null!==b&&T>C;T--)b=b.prev;for(;null!==b&&T>w;T--,b=b.prev)R.push(b.value);return R},W.prototype.splice=function(w,C,...R){w>this.length&&(w=this.length-1),w<0&&(w=this.length+w);for(var T=0,b=this.head;null!==b&&T{"use strict";Ut.exports=et,Ut.exports.default=et;var it=1e20;function et(Y,Se,he,W,j,k){this.fontSize=Y||24,this.buffer=void 0===Se?3:Se,this.cutoff=W||.25,this.fontFamily=j||"sans-serif",this.fontWeight=k||"normal",this.radius=he||8;var Q=this.size=this.fontSize+2*this.buffer,H=Q+2*this.buffer;this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=Q,this.ctx=this.canvas.getContext("2d"),this.ctx.font=this.fontWeight+" "+this.fontSize+"px "+this.fontFamily,this.ctx.textAlign="left",this.ctx.fillStyle="black",this.gridOuter=new Float64Array(H*H),this.gridInner=new Float64Array(H*H),this.f=new Float64Array(H),this.z=new Float64Array(H+1),this.v=new Uint16Array(H),this.useMetrics=void 0!==this.ctx.measureText("A").actualBoundingBoxLeft,this.middle=Math.round(Q/2*(navigator.userAgent.indexOf("Gecko/")>=0?1.2:1))}function Dt(Y,Se,he,W,j,k){for(var Q=0;Q-1);k[++w]=H,Q[w]=C,Q[w+1]=it}for(H=0,w=0;H{Ut.exports=function(et,yt){var ee=yt.length;if(0!==ee){var Dt=et.length;et.length+=ee;for(var dt=0;dt{"use strict";var yt=(()=>{return(Dt=yt||(yt={})).typeOfFunction="function",Dt.boolTrue=!0,yt;var Dt})();function ee(Dt,dt,Y){if(!Y||typeof Y.value!==yt.typeOfFunction)throw new TypeError("Only methods can be decorated with @bind. <"+dt+"> is not a method!");return{configurable:yt.boolTrue,get:function(){var Se=Y.value.bind(this);return Object.defineProperty(this,dt,{value:Se,configurable:yt.boolTrue,writable:yt.boolTrue}),Se}}}it.ak=ee,it.ZP=ee},7266:(Ut,it,et)=>{Ut.exports={ResizeSensor:et(9835),ElementQueries:et(4845)}},4845:function(Ut,it,et){"use strict";var yt,ee,Dt;"undefined"!=typeof window&&window,ee=[et(9835)],void 0!==(Dt="function"==typeof(yt=function(dt){var Y=function(){var he,W={},j=[];function k(I){I||(I=document.documentElement);var O=window.getComputedStyle(I,null).fontSize;return parseFloat(O)||16}function H(I,O){var K=O.split(/\d/),E=K[K.length-1];switch(O=parseFloat(O),E){case"px":return O;case"em":return O*k(I);case"rem":return O*k();case"vw":return O*document.documentElement.clientWidth/100;case"vh":return O*document.documentElement.clientHeight/100;case"vmin":case"vmax":var $=document.documentElement.clientWidth/100,Z=document.documentElement.clientHeight/100;return O*(0,Math["vmin"===E?"min":"max"])($,Z);default:return O}}function w(I,O){this.element=I;var K,E,$,Z,ae,oe,te,Te,me=["min-width","min-height","max-width","max-height"];this.call=function(){for(K in $=function(I){if(!I.getBoundingClientRect)return{width:I.offsetWidth,height:I.offsetHeight};var O=I.getBoundingClientRect();return{width:Math.round(O.width),height:Math.round(O.height)}}(this.element),oe={},W[O])!W[O].hasOwnProperty(K)||(Z=H(this.element,(E=W[O][K]).value),ae="width"===E.property?$.width:$.height,te="","min"===E.mode&&ae>=Z&&(te+=E.value),"max"===E.mode&&ae<=Z&&(te+=E.value),oe[Te=E.mode+"-"+E.property]||(oe[Te]=""),te&&-1===(" "+oe[Te]+" ").indexOf(" "+te+" ")&&(oe[Te]+=" "+te));for(var ne in me)!me.hasOwnProperty(ne)||(oe[me[ne]]?this.element.setAttribute(me[ne],oe[me[ne]].substr(1)):this.element.removeAttribute(me[ne]))}}function C(I,O){I.elementQueriesSetupInformation||(I.elementQueriesSetupInformation=new w(I,O)),I.elementQueriesSensor||(I.elementQueriesSensor=new dt(I,function(){I.elementQueriesSetupInformation.call()}))}function R(I,O,K,E){if(void 0===W[I]){W[I]=[];var $=j.length;he.innerHTML+="\n"+I+" {animation: 0.1s element-queries;}",he.innerHTML+="\n"+I+" > .resize-sensor {min-width: "+$+"px;}",j.push(I)}W[I].push({mode:O,property:K,value:E})}function T(I){var O;if(document.querySelectorAll&&(O=I?I.querySelectorAll.bind(I):document.querySelectorAll.bind(document)),!O&&"undefined"!=typeof $$&&(O=$$),!O&&"undefined"!=typeof jQuery&&(O=jQuery),!O)throw"No document.querySelectorAll, jQuery or Mootools's $$ found.";return O}function y(I){var O=[],K=[],E=[],$=0,Z=-1,ae=[];for(var oe in I.children)if(I.children.hasOwnProperty(oe)&&I.children[oe].tagName&&"img"===I.children[oe].tagName.toLowerCase()){O.push(I.children[oe]);var te=I.children[oe].getAttribute("min-width")||I.children[oe].getAttribute("data-min-width"),Te=I.children[oe].getAttribute("data-src")||I.children[oe].getAttribute("url");E.push(Te),K.push({minWidth:te}),te?I.children[oe].style.display="none":($=O.length-1,I.children[oe].style.display="block")}function ne(){var Oe,ye=!1;for(Oe in O)!O.hasOwnProperty(Oe)||K[Oe].minWidth&&I.offsetWidth>K[Oe].minWidth&&(ye=Oe);if(ye||(ye=$),Z!==ye)if(ae[ye])O[Z].style.display="none",O[ye].style.display="block",Z=ye;else{var $e=new Image;$e.onload=function(){O[ye].src=E[ye],O[Z].style.display="none",O[ye].style.display="block",ae[ye]=!0,Z=ye},$e.src=E[ye]}else O[ye].src=E[ye]}Z=$,I.resizeSensorInstance=new dt(I,ne),ne()}var A=/,?[\s\t]*([^,\n]*?)((?:\[[\s\t]*?(?:min|max)-(?:width|height)[\s\t]*?[~$\^]?=[\s\t]*?"[^"]*?"[\s\t]*?])+)([^,\n\s\{]*)/gim,z=/\[[\s\t]*?(min|max)-(width|height)[\s\t]*?[~$\^]?=[\s\t]*?"([^"]*?)"[\s\t]*?]/gim;function P(I){var O,K,E,$;for(I=I.replace(/'/g,'"');null!==(O=A.exec(I));)for(K=O[1]+O[3],E=O[2];null!==($=z.exec(E));)R(K,$[1],$[2],$[3])}function X(I){var O="";if(I)if("string"==typeof I)(-1!==(I=I.toLowerCase()).indexOf("min-width")||-1!==I.indexOf("max-width"))&&P(I);else for(var K=0,E=I.length;K 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),ue=!0);for(var O=0,K=document.styleSheets.length;O{var yt=et(3910),ee=et(9369),Dt=et(322);function dt(Q,H,w){if(!yt(Q))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(!Q.hasNode(H))throw new Error('graphology-shortest-path: the "'+H+'" source node does not exist in the given graph.');if(!Q.hasNode(w))throw new Error('graphology-shortest-path: the "'+w+'" target node does not exist in the given graph.');if((H=""+H)==(w=""+w))return[H];var C=Q.inboundNeighbors.bind(Q),R=Q.outboundNeighbors.bind(Q),T={},b={};T[H]=null,b[w]=null;var A,z,P,X,ue,I,O,K,y=[H],S=[w],E=!1;e:for(;y.length&&S.length;)if(y.length<=S.length){for(A=y,y=[],ue=0,O=A.length;ue{Ut.exports=function(et){return null!==et&&"object"==typeof et&&"function"==typeof et.addUndirectedEdgeWithKey&&"function"==typeof et.dropNode&&"boolean"==typeof et.multi}},698:function(Ut){Ut.exports=function(){"use strict";function it(re){return(it="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(fe){return typeof fe}:function(fe){return fe&&"function"==typeof Symbol&&fe.constructor===Symbol&&fe!==Symbol.prototype?"symbol":typeof fe})(re)}function et(re,fe){re.prototype=Object.create(fe.prototype),re.prototype.constructor=re,ee(re,fe)}function yt(re){return(yt=Object.setPrototypeOf?Object.getPrototypeOf:function(fe){return fe.__proto__||Object.getPrototypeOf(fe)})(re)}function ee(re,fe){return(ee=Object.setPrototypeOf||function(se,M){return se.__proto__=M,se})(re,fe)}function Dt(){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(re){return!1}}function dt(re,fe,se){return(dt=Dt()?Reflect.construct:function(M,L,J){var Ee=[null];Ee.push.apply(Ee,L);var Fe=new(Function.bind.apply(M,Ee));return J&&ee(Fe,J.prototype),Fe}).apply(null,arguments)}function Y(re){var fe="function"==typeof Map?new Map:void 0;return(Y=function(se){if(null===se||-1===Function.toString.call(se).indexOf("[native code]"))return se;if("function"!=typeof se)throw new TypeError("Super expression must either be null or a function");if(void 0!==fe){if(fe.has(se))return fe.get(se);fe.set(se,L)}function L(){return dt(se,arguments,yt(this).constructor)}return L.prototype=Object.create(se.prototype,{constructor:{value:L,enumerable:!1,writable:!0,configurable:!0}}),ee(L,se)})(re)}function Se(re){if(void 0===re)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return re}var he=function(){for(var re=arguments[0],fe=1,se=arguments.length;fe0&&Ee.length>L&&!Ee.warned){Ee.warned=!0;var nt=new Error("Possible EventEmitter memory leak detected. "+Ee.length+" "+String(fe)+" listeners added. Use emitter.setMaxListeners() to increase limit");nt.name="MaxListenersExceededWarning",nt.emitter=re,nt.type=fe,nt.count=Ee.length,console&&console.warn&&console.warn(nt)}return re}function I(){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(re,fe,se){var M={fired:!1,wrapFn:void 0,target:re,type:fe,listener:se},L=I.bind(M);return L.listener=se,M.wrapFn=L,L}function K(re,fe,se){var M=re._events;if(void 0===M)return[];var L=M[fe];return void 0===L?[]:"function"==typeof L?se?[L.listener||L]:[L]:se?function(J){for(var Ee=new Array(J.length),Fe=0;Fe0&&(J=fe[0]),J instanceof Error)throw J;var Ee=new Error("Unhandled error."+(J?" ("+J.message+")":""));throw Ee.context=J,Ee}var Fe=L[re];if(void 0===Fe)return!1;if("function"==typeof Fe)y(Fe,this,fe);else{var nt=Fe.length,Pt=$(Fe,nt);for(se=0;se=0;J--)if(se[J]===fe||se[J].listener===fe){Ee=se[J].listener,L=J;break}if(L<0)return this;0===L?se.shift():function(Fe,nt){for(;nt+1=0;M--)this.removeListener(re,fe[M]);return this},A.prototype.listeners=function(re){return K(this,re,!0)},A.prototype.rawListeners=function(re){return K(this,re,!1)},A.listenerCount=function(re,fe){return"function"==typeof re.listenerCount?re.listenerCount(fe):E.call(re,fe)},A.prototype.listenerCount=E,A.prototype.eventNames=function(){return this._eventsCount>0?R(this._events):[]},ae.prototype.next=function(){if(this.done)return{done:!0};var re=this._next();return re.done&&(this.done=!0),re},"undefined"!=typeof Symbol&&(ae.prototype[Symbol.iterator]=function(){return this}),ae.of=function(){var re=arguments,fe=re.length,se=0;return new ae(function(){return se>=fe?{done:!0}:{done:!1,value:re[se++]}})},ae.empty=function(){var re=new ae(null);return re.done=!0,re},ae.is=function(re){return re instanceof ae||"object"==typeof re&&null!==re&&"function"==typeof re.next};var oe=ae,te=function(re,fe){for(var se,M=arguments.length>1?fe:1/0,L=M!==1/0?new Array(M):[],J=0;;){if(J===M)return L;if((se=re.next()).done)return J!==fe?L.slice(0,J):L;L[J++]=se.value}},Te=function(re){function fe(se,M){var L;return(L=re.call(this)||this).name="GraphError",L.message=se||"",L.data=M||{},L}return et(fe,re),fe}(Y(Error)),me=function(re){function fe(se,M){var L;return(L=re.call(this,se,M)||this).name="InvalidArgumentsGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(Se(L),fe.prototype.constructor),L}return et(fe,re),fe}(Te),ne=function(re){function fe(se,M){var L;return(L=re.call(this,se,M)||this).name="NotFoundGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(Se(L),fe.prototype.constructor),L}return et(fe,re),fe}(Te),ye=function(re){function fe(se,M){var L;return(L=re.call(this,se,M)||this).name="UsageGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(Se(L),fe.prototype.constructor),L}return et(fe,re),fe}(Te);function Oe(re,fe){this.key=re,this.attributes=fe,this.inDegree=0,this.outDegree=0,this.undirectedDegree=0,this.directedSelfLoops=0,this.undirectedSelfLoops=0,this.in={},this.out={},this.undirected={}}function $e(re,fe){this.key=re,this.attributes=fe,this.inDegree=0,this.outDegree=0,this.directedSelfLoops=0,this.in={},this.out={}}function st(re,fe){this.key=re,this.attributes=fe,this.undirectedDegree=0,this.undirectedSelfLoops=0,this.undirected={}}function Qe(re,fe,se,M,L,J){this.key=fe,this.attributes=J,this.undirected=re,this.source=M,this.target=L,this.generatedKey=se}function tt(re,fe,se,M,L,J,Ee){var Fe,nt,Pt="out",We="in";if(fe&&(Pt=We="undirected"),re.multi){if(void 0===(nt=(Fe=J[Pt])[L])&&(nt=new Set,Fe[L]=nt),nt.add(se),M===L&&fe)return;void 0===(Fe=Ee[We])[M]&&(Fe[M]=nt)}else{if(J[Pt][L]=se,M===L&&fe)return;Ee[We][M]=se}}function Xe(re,fe,se){var M=re.multi,L=se.source,J=se.target,Ee=L.key,Fe=J.key,nt=L[fe?"undirected":"out"],Pt=fe?"undirected":"in";if(Fe in nt)if(M){var We=nt[Fe];1===We.size?(delete nt[Fe],delete J[Pt][Ee]):We.delete(se)}else delete nt[Fe];M||delete J[Pt][Ee]}$e.prototype.upgradeToMixed=function(){this.undirectedDegree=0,this.undirectedSelfLoops=0,this.undirected={}},st.prototype.upgradeToMixed=function(){this.inDegree=0,this.outDegree=0,this.directedSelfLoops=0,this.in={},this.out={}};var ze=[{name:function(re){return"get".concat(re,"Attribute")},attacher:function(re,fe,se){re.prototype[fe]=function(M,L){var J;if("mixed"!==this.type&&"mixed"!==se&&se!==this.type)throw new ye("Graph.".concat(fe,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new ye("Graph.".concat(fe,": 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 Ee=""+M,Fe=""+L;if(L=arguments[2],!(J=W(this,Ee,Fe,se)))throw new ne("Graph.".concat(fe,': could not find an edge for the given path ("').concat(Ee,'" - "').concat(Fe,'").'))}else if(!(J=this._edges.get(M=""+M)))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" edge in the graph.'));if("mixed"!==se&&J.undirected!==("undirected"===se))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" ').concat(se," edge in the graph."));return J.attributes[L]}}},{name:function(re){return"get".concat(re,"Attributes")},attacher:function(re,fe,se){re.prototype[fe]=function(M){var L;if("mixed"!==this.type&&"mixed"!==se&&se!==this.type)throw new ye("Graph.".concat(fe,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>1){if(this.multi)throw new ye("Graph.".concat(fe,": 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 J=""+M,Ee=""+arguments[1];if(!(L=W(this,J,Ee,se)))throw new ne("Graph.".concat(fe,': could not find an edge for the given path ("').concat(J,'" - "').concat(Ee,'").'))}else if(!(L=this._edges.get(M=""+M)))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" edge in the graph.'));if("mixed"!==se&&L.undirected!==("undirected"===se))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" ').concat(se," edge in the graph."));return L.attributes}}},{name:function(re){return"has".concat(re,"Attribute")},attacher:function(re,fe,se){re.prototype[fe]=function(M,L){var J;if("mixed"!==this.type&&"mixed"!==se&&se!==this.type)throw new ye("Graph.".concat(fe,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new ye("Graph.".concat(fe,": 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 Ee=""+M,Fe=""+L;if(L=arguments[2],!(J=W(this,Ee,Fe,se)))throw new ne("Graph.".concat(fe,': could not find an edge for the given path ("').concat(Ee,'" - "').concat(Fe,'").'))}else if(!(J=this._edges.get(M=""+M)))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" edge in the graph.'));if("mixed"!==se&&J.undirected!==("undirected"===se))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" ').concat(se," edge in the graph."));return J.attributes.hasOwnProperty(L)}}},{name:function(re){return"set".concat(re,"Attribute")},attacher:function(re,fe,se){re.prototype[fe]=function(M,L,J){var Ee;if("mixed"!==this.type&&"mixed"!==se&&se!==this.type)throw new ye("Graph.".concat(fe,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>3){if(this.multi)throw new ye("Graph.".concat(fe,": 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=""+M,nt=""+L;if(L=arguments[2],J=arguments[3],!(Ee=W(this,Fe,nt,se)))throw new ne("Graph.".concat(fe,': could not find an edge for the given path ("').concat(Fe,'" - "').concat(nt,'").'))}else if(!(Ee=this._edges.get(M=""+M)))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" edge in the graph.'));if("mixed"!==se&&Ee.undirected!==("undirected"===se))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" ').concat(se," edge in the graph."));return Ee.attributes[L]=J,this.emit("edgeAttributesUpdated",{key:Ee.key,type:"set",attributes:Ee.attributes,name:L}),this}}},{name:function(re){return"update".concat(re,"Attribute")},attacher:function(re,fe,se){re.prototype[fe]=function(M,L,J){var Ee;if("mixed"!==this.type&&"mixed"!==se&&se!==this.type)throw new ye("Graph.".concat(fe,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>3){if(this.multi)throw new ye("Graph.".concat(fe,": 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=""+M,nt=""+L;if(L=arguments[2],J=arguments[3],!(Ee=W(this,Fe,nt,se)))throw new ne("Graph.".concat(fe,': could not find an edge for the given path ("').concat(Fe,'" - "').concat(nt,'").'))}else if(!(Ee=this._edges.get(M=""+M)))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" edge in the graph.'));if("function"!=typeof J)throw new me("Graph.".concat(fe,": updater should be a function."));if("mixed"!==se&&Ee.undirected!==("undirected"===se))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" ').concat(se," edge in the graph."));return Ee.attributes[L]=J(Ee.attributes[L]),this.emit("edgeAttributesUpdated",{key:Ee.key,type:"set",attributes:Ee.attributes,name:L}),this}}},{name:function(re){return"remove".concat(re,"Attribute")},attacher:function(re,fe,se){re.prototype[fe]=function(M,L){var J;if("mixed"!==this.type&&"mixed"!==se&&se!==this.type)throw new ye("Graph.".concat(fe,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new ye("Graph.".concat(fe,": 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 Ee=""+M,Fe=""+L;if(L=arguments[2],!(J=W(this,Ee,Fe,se)))throw new ne("Graph.".concat(fe,': could not find an edge for the given path ("').concat(Ee,'" - "').concat(Fe,'").'))}else if(!(J=this._edges.get(M=""+M)))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" edge in the graph.'));if("mixed"!==se&&J.undirected!==("undirected"===se))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" ').concat(se," edge in the graph."));return delete J.attributes[L],this.emit("edgeAttributesUpdated",{key:J.key,type:"remove",attributes:J.attributes,name:L}),this}}},{name:function(re){return"replace".concat(re,"Attributes")},attacher:function(re,fe,se){re.prototype[fe]=function(M,L){var J;if("mixed"!==this.type&&"mixed"!==se&&se!==this.type)throw new ye("Graph.".concat(fe,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new ye("Graph.".concat(fe,": 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 Ee=""+M,Fe=""+L;if(L=arguments[2],!(J=W(this,Ee,Fe,se)))throw new ne("Graph.".concat(fe,': could not find an edge for the given path ("').concat(Ee,'" - "').concat(Fe,'").'))}else if(!(J=this._edges.get(M=""+M)))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" edge in the graph.'));if(!k(L))throw new me("Graph.".concat(fe,": provided attributes are not a plain object."));if("mixed"!==se&&J.undirected!==("undirected"===se))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" ').concat(se," edge in the graph."));return J.attributes=L,this.emit("edgeAttributesUpdated",{key:J.key,type:"replace",attributes:J.attributes}),this}}},{name:function(re){return"merge".concat(re,"Attributes")},attacher:function(re,fe,se){re.prototype[fe]=function(M,L){var J;if("mixed"!==this.type&&"mixed"!==se&&se!==this.type)throw new ye("Graph.".concat(fe,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new ye("Graph.".concat(fe,": 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 Ee=""+M,Fe=""+L;if(L=arguments[2],!(J=W(this,Ee,Fe,se)))throw new ne("Graph.".concat(fe,': could not find an edge for the given path ("').concat(Ee,'" - "').concat(Fe,'").'))}else if(!(J=this._edges.get(M=""+M)))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" edge in the graph.'));if(!k(L))throw new me("Graph.".concat(fe,": provided attributes are not a plain object."));if("mixed"!==se&&J.undirected!==("undirected"===se))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" ').concat(se," edge in the graph."));return he(J.attributes,L),this.emit("edgeAttributesUpdated",{key:J.key,type:"merge",attributes:J.attributes,data:L}),this}}}],Le=oe,Ke=function(){var re,fe=arguments,se=-1;return new Le(function M(){if(!re){if(++se>=fe.length)return{done:!0};re=fe[se]}var L=re.next();return L.done?(re=null,M()):L})},Me=[{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(re,fe){for(var se in fe)re.push(fe[se].key)}function qe(re,fe){for(var se in fe)fe[se].forEach(function(M){return re.push(M.key)})}function ke(re,fe,se){for(var M in re)if(M!==se){var L=re[M];fe(L.key,L.attributes,L.source.key,L.target.key,L.source.attributes,L.target.attributes,L.undirected,L.generatedKey)}}function q(re,fe,se){for(var M in re)M!==se&&re[M].forEach(function(L){return fe(L.key,L.attributes,L.source.key,L.target.key,L.source.attributes,L.target.attributes,L.undirected,L.generatedKey)})}function G(re,fe,se){for(var M in re)if(M!==se){var L=re[M];if(fe(L.key,L.attributes,L.source.key,L.target.key,L.source.attributes,L.target.attributes,L.undirected,L.generatedKey))return!0}return!1}function pe(re,fe,se){var M,L,J,Ee,Fe;for(var nt in re)if(nt!==se)for(M=re[nt].values();!0!==(L=M.next()).done;)if(Ee=(J=L.value).source,fe(J.key,J.attributes,Ee.key,(Fe=J.target).key,Ee.attributes,Fe.attributes,J.undirected,J.generatedKey))return!0;return!1}function de(re,fe){var se=Object.keys(re),M=se.length,L=null,J=0;return new oe(function Ee(){var Fe;if(L){var nt=L.next();if(nt.done)return L=null,J++,Ee();Fe=nt.value}else{if(J>=M)return{done:!0};var Pt=se[J];if(Pt===fe)return J++,Ee();if((Fe=re[Pt])instanceof Set)return L=Fe.values(),Ee();J++}return{done:!1,value:[Fe.key,Fe.attributes,Fe.source.key,Fe.target.key,Fe.source.attributes,Fe.target.attributes]}})}function je(re,fe,se){var M=fe[se];M&&re.push(M.key)}function _t(re,fe,se){var M=fe[se];M&&M.forEach(function(L){return re.push(L.key)})}function pt(re,fe,se){var M=re[fe];if(M){var L=M.source,J=M.target;se(M.key,M.attributes,L.key,J.key,L.attributes,J.attributes,M.undirected,M.generatedKey)}}function we(re,fe,se){var M=re[fe];M&&M.forEach(function(L){return se(L.key,L.attributes,L.source.key,L.target.key,L.source.attributes,L.target.attributes,L.undirected,L.generatedKey)})}function B(re,fe,se){var M=re[fe];if(M){var L=M.source,J=M.target;return se(M.key,M.attributes,L.key,J.key,L.attributes,J.attributes,M.undirected,M.generatedKey)}}function N(re,fe,se){var M=re[fe];if(M){for(var L,J,Ee=M.values();!0!==(L=Ee.next()).done;)if(se((J=L.value).key,J.attributes,J.source.key,J.target.key,J.source.attributes,J.target.attributes,J.undirected,J.generatedKey))return!0;return!1}}function V(re,fe){var se=re[fe];if(se instanceof Set){var M=se.values();return new oe(function(){var L=M.next();if(L.done)return L;var J=L.value;return{done:!1,value:[J.key,J.attributes,J.source.key,J.target.key,J.source.attributes,J.target.attributes]}})}return oe.of([se.key,se.attributes,se.source.key,se.target.key,se.source.attributes,se.target.attributes])}function Re(re,fe){if(0===re.size)return[];if("mixed"===fe||fe===re.type)return"function"==typeof Array.from?Array.from(re._edges.keys()):te(re._edges.keys(),re._edges.size);for(var se,M,J=new Array("undirected"===fe?re.undirectedSize:re.directedSize),Ee="undirected"===fe,Fe=re._edges.values(),nt=0;!0!==(se=Fe.next()).done;)(M=se.value).undirected===Ee&&(J[nt++]=M.key);return J}function Ze(re,fe,se){if(0!==re.size)for(var M,L,J="mixed"!==fe&&fe!==re.type,Ee="undirected"===fe,Fe=re._edges.values();!0!==(M=Fe.next()).done;)if(L=M.value,!J||L.undirected===Ee){var qt=L.source,St=L.target;se(L.key,L.attributes,qt.key,St.key,qt.attributes,St.attributes,L.undirected,L.generatedKey)}}function Tt(re,fe,se){if(0!==re.size)for(var M,L,J="mixed"!==fe&&fe!==re.type,Ee="undirected"===fe,Fe=re._edges.values();!0!==(M=Fe.next()).done;)if(L=M.value,!J||L.undirected===Ee){var qt=L.source,St=L.target;if(se(L.key,L.attributes,qt.key,St.key,qt.attributes,St.attributes,L.undirected,L.generatedKey))break}}function kt(re,fe){if(0===re.size)return oe.empty();var se="mixed"!==fe&&fe!==re.type,M="undirected"===fe,L=re._edges.values();return new oe(function(){for(var J,Ee;;){if((J=L.next()).done)return J;if(Ee=J.value,!se||Ee.undirected===M)break}return{value:[Ee.key,Ee.attributes,Ee.source.key,Ee.target.key,Ee.source.attributes,Ee.target.attributes],done:!1}})}function In(re,fe,se,M){var L=[],J=re?qe:Ue;return"undirected"!==fe&&("out"!==se&&J(L,M.in),"in"!==se&&J(L,M.out),!se&&M.directedSelfLoops>0&&L.splice(L.lastIndexOf(M.key),1)),"directed"!==fe&&J(L,M.undirected),L}function Nn(re,fe,se,M,L){var J=re?q:ke;"undirected"!==fe&&("out"!==se&&J(M.in,L),"in"!==se&&J(M.out,L,se?null:M.key)),"directed"!==fe&&J(M.undirected,L)}function Yn(re,fe,se,M,L){var J=re?pe:G;"undirected"!==fe&&("out"!==se&&J(M.in,L)||"in"!==se&&J(M.out,L,se?null:M.key))||"directed"===fe||J(M.undirected,L)}function Mi(re,fe,se){var M=oe.empty();return"undirected"!==re&&("out"!==fe&&void 0!==se.in&&(M=Ke(M,de(se.in))),"in"!==fe&&void 0!==se.out&&(M=Ke(M,de(se.out,fe?null:se.key)))),"directed"!==re&&void 0!==se.undirected&&(M=Ke(M,de(se.undirected))),M}function xi(re,fe,se,M,L){var J=fe?_t:je,Ee=[];return"undirected"!==re&&(void 0!==M.in&&"out"!==se&&J(Ee,M.in,L),void 0!==M.out&&"in"!==se&&J(Ee,M.out,L),!se&&M.directedSelfLoops>0&&Ee.splice(Ee.lastIndexOf(M.key),1)),"directed"!==re&&void 0!==M.undirected&&J(Ee,M.undirected,L),Ee}function Xr(re,fe,se,M,L,J){var Ee=fe?we:pt;"undirected"!==re&&(void 0!==M.in&&"out"!==se&&Ee(M.in,L,J),M.key!==L&&void 0!==M.out&&"in"!==se&&Ee(M.out,L,J)),"directed"!==re&&void 0!==M.undirected&&Ee(M.undirected,L,J)}function Ls(re,fe,se,M,L,J){var Ee=fe?N:B;"undirected"!==re&&(void 0!==M.in&&"out"!==se&&Ee(M.in,L,J)||M.key!==L&&void 0!==M.out&&"in"!==se&&Ee(M.out,L,J,se?null:M.key))||"directed"===re||void 0===M.undirected||Ee(M.undirected,L,J)}function fs(re,fe,se,M){var L=oe.empty();return"undirected"!==re&&(void 0!==se.in&&"out"!==fe&&M in se.in&&(L=Ke(L,V(se.in,M))),void 0!==se.out&&"in"!==fe&&M in se.out&&(L=Ke(L,V(se.out,M)))),"directed"!==re&&void 0!==se.undirected&&M in se.undirected&&(L=Ke(L,V(se.undirected,M))),L}var Bs=[{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 Kr(re,fe){if(void 0!==fe)for(var se in fe)re.add(se)}function xa(re,fe,se){if("mixed"!==re){if("undirected"===re)return Object.keys(se.undirected);if("string"==typeof fe)return Object.keys(se[fe])}var M=new Set;return"undirected"!==re&&("out"!==fe&&Kr(M,se.in),"in"!==fe&&Kr(M,se.out)),"directed"!==re&&Kr(M,se.undirected),te(M.values(),M.size)}function kl(re,fe,se){for(var M in fe){var L=fe[M];L instanceof Set&&(L=L.values().next().value);var J=L.source,Fe=J===re?L.target:J;se(Fe.key,Fe.attributes)}}function Sa(re,fe,se,M){for(var L in se){var J=se[L];J instanceof Set&&(J=J.values().next().value);var Ee=J.source,nt=Ee===fe?J.target:Ee;re.has(nt.key)||(re.add(nt.key),M(nt.key,nt.attributes))}}function ws(re,fe,se){for(var M in fe){var L=fe[M];L instanceof Set&&(L=L.values().next().value);var J=L.source,Fe=J===re?L.target:J;if(se(Fe.key,Fe.attributes))return!0}return!1}function en(re,fe,se,M){for(var L in se){var J=se[L];J instanceof Set&&(J=J.values().next().value);var Ee=J.source,nt=Ee===fe?J.target:Ee;if(!re.has(nt.key)&&(re.add(nt.key),M(nt.key,nt.attributes)))return!0}return!1}function nl(re,fe){var se=Object.keys(fe),M=se.length,L=0;return new oe(function(){if(L>=M)return{done:!0};var J=fe[se[L++]];J instanceof Set&&(J=J.values().next().value);var Ee=J.source,nt=Ee===re?J.target:Ee;return{done:!1,value:[nt.key,nt.attributes]}})}function rt(re,fe,se){var M=Object.keys(se),L=M.length,J=0;return new oe(function Ee(){if(J>=L)return{done:!0};var Fe=se[M[J++]];Fe instanceof Set&&(Fe=Fe.values().next().value);var nt=Fe.source,We=nt===fe?Fe.target:nt;return re.has(We.key)?Ee():(re.add(We.key),{done:!1,value:[We.key,We.attributes]})})}function lt(re,fe,se,M,L){var J=re._nodes.get(M);if("undirected"!==fe){if("out"!==se&&void 0!==J.in)for(var Ee in J.in)if(Ee===L)return!0;if("in"!==se&&void 0!==J.out)for(var Fe in J.out)if(Fe===L)return!0}if("directed"!==fe&&void 0!==J.undirected)for(var nt in J.undirected)if(nt===L)return!0;return!1}function Be(re,fe,se){for(var M,L,J,Ee,Fe,nt,Pt,We=fe._nodes.values(),qt=fe.type;!0!==(M=We.next()).done;){if(L=M.value,"undirected"!==qt)for(J in Ee=L.out)if(nt=(Fe=Ee[J]).target,Pt=se(L.key,nt.key,L.attributes,nt.attributes,Fe.key,Fe.attributes,Fe.undirected,Fe.generatedKey),re&&Pt)return;if("directed"!==qt)for(J in Ee=L.undirected)if((nt=(Fe=Ee[J]).target).key!==J&&(nt=Fe.source),Pt=se(L.key,nt.key,L.attributes,nt.attributes,Fe.key,Fe.attributes,Fe.undirected,Fe.generatedKey),re&&Pt)return}}function ut(re,fe,se){for(var M,L,J,Ee,Fe,nt,Pt,We,qt,St=fe._nodes.values(),vn=fe.type;!0!==(M=St.next()).done;){if(L=M.value,"undirected"!==vn)for(J in nt=L.out)for(Ee=nt[J].values();!0!==(Fe=Ee.next()).done;)if(We=(Pt=Fe.value).target,qt=se(L.key,We.key,L.attributes,We.attributes,Pt.key,Pt.attributes,Pt.undirected,Pt.generatedKey),re&&qt)return;if("directed"!==vn)for(J in nt=L.undirected)for(Ee=nt[J].values();!0!==(Fe=Ee.next()).done;)if((We=(Pt=Fe.value).target).key!==J&&(We=Pt.source),qt=se(L.key,We.key,L.attributes,We.attributes,Pt.key,Pt.attributes,Pt.undirected,Pt.generatedKey),re&&qt)return}}function Je(re,fe){var se={key:re};return Q(fe.attributes)||(se.attributes=he({},fe.attributes)),se}function Mt(re,fe){var se={source:fe.source.key,target:fe.target.key};return fe.generatedKey||(se.key=re),Q(fe.attributes)||(se.attributes=he({},fe.attributes)),fe.undirected&&(se.undirected=!0),se}function It(re){return k(re)?"key"in re?!("attributes"in re)||k(re.attributes)&&null!==re.attributes?null:"invalid-attributes":"no-key":"not-object"}function Ot(re){return k(re)?"source"in re?"target"in re?!("attributes"in re)||k(re.attributes)&&null!==re.attributes?"undirected"in re&&"boolean"!=typeof re.undirected?"invalid-undirected":null:"invalid-attributes":"no-target":"no-source":"not-object"}var Qt=new Set(["directed","undirected","mixed"]),zn=new Set(["domain","_events","_eventsCount","_maxListeners"]),ci={allowSelfLoops:!0,edgeKeyGenerator:null,multi:!1,type:"mixed"};function Rn(re,fe,se){var M=new re.NodeDataClass(fe,se);return re._nodes.set(fe,M),re.emit("nodeAdded",{key:fe,attributes:se}),M}function bn(re,fe,se,M,L,J,Ee,Fe){if(!M&&"undirected"===re.type)throw new ye("Graph.".concat(fe,": you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead."));if(M&&"directed"===re.type)throw new ye("Graph.".concat(fe,": you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead."));if(Fe&&!k(Fe))throw new me("Graph.".concat(fe,': invalid attributes. Expecting an object but got "').concat(Fe,'"'));if(J=""+J,Ee=""+Ee,Fe=Fe||{},!re.allowSelfLoops&&J===Ee)throw new ye("Graph.".concat(fe,': source & target are the same ("').concat(J,"\"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false."));var nt=re._nodes.get(J),Pt=re._nodes.get(Ee);if(!nt)throw new ne("Graph.".concat(fe,': source node "').concat(J,'" not found.'));if(!Pt)throw new ne("Graph.".concat(fe,': target node "').concat(Ee,'" not found.'));var We={key:null,undirected:M,source:J,target:Ee,attributes:Fe};if(se&&(L=re._edgeKeyGenerator(We)),re._edges.has(L=""+L))throw new ye("Graph.".concat(fe,': the "').concat(L,'" edge already exists in the graph.'));if(!re.multi&&(M?void 0!==nt.undirected[Ee]:void 0!==nt.out[Ee]))throw new ye("Graph.".concat(fe,': an edge linking "').concat(J,'" to "').concat(Ee,"\" 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 qt=new Qe(M,L,se,nt,Pt,Fe);return re._edges.set(L,qt),J===Ee?M?(nt.undirectedSelfLoops++,re._undirectedSelfLoopCount++):(nt.directedSelfLoops++,re._directedSelfLoopCount++):M?(nt.undirectedDegree++,Pt.undirectedDegree++):(nt.outDegree++,Pt.inDegree++),tt(re,M,qt,J,Ee,nt,Pt),M?re._undirectedSize++:re._directedSize++,We.key=L,re.emit("edgeAdded",We),L}function Xn(re,fe,se,M,L,J,Ee,Fe,nt){if(!M&&"undirected"===re.type)throw new ye("Graph.".concat(fe,": you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead."));if(M&&"directed"===re.type)throw new ye("Graph.".concat(fe,": you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead."));if(Fe)if(nt){if("function"!=typeof Fe)throw new me("Graph.".concat(fe,': invalid updater function. Expecting a function but got "').concat(Fe,'"'))}else if(!k(Fe))throw new me("Graph.".concat(fe,': invalid attributes. Expecting an object but got "').concat(Fe,'"'));var Pt;if(J=""+J,Ee=""+Ee,nt&&(Pt=Fe,Fe=void 0),!re.allowSelfLoops&&J===Ee)throw new ye("Graph.".concat(fe,': source & target are the same ("').concat(J,"\"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false."));var We,qt,St=re._nodes.get(J),vn=re._nodes.get(Ee);if(!se&&(We=re._edges.get(L))){if(We.source.key!==J||We.target.key!==Ee||M&&(We.source.key!==Ee||We.target.key!==J))throw new ye("Graph.".concat(fe,': inconsistency detected when attempting to merge the "').concat(L,'" edge with "').concat(J,'" source & "').concat(Ee,'" target vs. ("').concat(We.source.key,'", "').concat(We.target.key,'").'));qt=We}if(qt||re.multi||!St||(qt=M?St.undirected[Ee]:St.out[Ee]),qt)return(nt?Pt:Fe)?(nt?(qt.attributes=Pt(qt.attributes),re.emit("edgeAttributesUpdated",{type:"replace",key:qt.key,attributes:qt.attributes})):(he(qt.attributes,Fe),re.emit("edgeAttributesUpdated",{type:"merge",key:qt.key,attributes:qt.attributes,data:Fe})),qt.key):qt.key;Fe=Fe||{},nt&&Pt&&(Fe=Pt(Fe));var Zr={key:null,undirected:M,source:J,target:Ee,attributes:Fe};if(se&&(L=re._edgeKeyGenerator(Zr)),re._edges.has(L=""+L))throw new ye("Graph.".concat(fe,': the "').concat(L,'" edge already exists in the graph.'));return St||(St=Rn(re,J,{}),J===Ee&&(vn=St)),vn||(vn=Rn(re,Ee,{})),We=new Qe(M,L,se,St,vn,Fe),re._edges.set(L,We),J===Ee?M?(St.undirectedSelfLoops++,re._undirectedSelfLoopCount++):(St.directedSelfLoops++,re._directedSelfLoopCount++):M?(St.undirectedDegree++,vn.undirectedDegree++):(St.outDegree++,vn.inDegree++),tt(re,M,We,J,Ee,St,vn),M?re._undirectedSize++:re._directedSize++,Zr.key=L,re.emit("edgeAdded",Zr),L}var re,Cn=function(re){function fe(M){var L;if(L=re.call(this)||this,(M=he({},ci,M)).edgeKeyGenerator&&"function"!=typeof M.edgeKeyGenerator)throw new me("Graph.constructor: invalid 'edgeKeyGenerator' option. Expecting a function but got \"".concat(M.edgeKeyGenerator,'".'));if("boolean"!=typeof M.multi)throw new me("Graph.constructor: invalid 'multi' option. Expecting a boolean but got \"".concat(M.multi,'".'));if(!Qt.has(M.type))throw new me('Graph.constructor: invalid \'type\' option. Should be one of "mixed", "directed" or "undirected" but got "'.concat(M.type,'".'));if("boolean"!=typeof M.allowSelfLoops)throw new me("Graph.constructor: invalid 'allowSelfLoops' option. Expecting a boolean but got \"".concat(M.allowSelfLoops,'".'));var J,Ee="mixed"===M.type?Oe:"directed"===M.type?$e:st;return H(Se(L),"NodeDataClass",Ee),H(Se(L),"_attributes",{}),H(Se(L),"_nodes",new Map),H(Se(L),"_edges",new Map),H(Se(L),"_directedSize",0),H(Se(L),"_undirectedSize",0),H(Se(L),"_directedSelfLoopCount",0),H(Se(L),"_undirectedSelfLoopCount",0),H(Se(L),"_edgeKeyGenerator",M.edgeKeyGenerator||(J=0,function(){return J++})),H(Se(L),"_options",M),zn.forEach(function(Fe){return H(Se(L),Fe,L[Fe])}),w(Se(L),"order",function(){return L._nodes.size}),w(Se(L),"size",function(){return L._edges.size}),w(Se(L),"directedSize",function(){return L._directedSize}),w(Se(L),"undirectedSize",function(){return L._undirectedSize}),w(Se(L),"selfLoopCount",function(){return L._directedSelfLoopCount+L._undirectedSelfLoopCount}),w(Se(L),"directedSelfLoopCount",function(){return L._directedSelfLoopCount}),w(Se(L),"undirectedSelfLoopCount",function(){return L._undirectedSelfLoopCount}),w(Se(L),"multi",L._options.multi),w(Se(L),"type",L._options.type),w(Se(L),"allowSelfLoops",L._options.allowSelfLoops),w(Se(L),"implementation",function(){return"graphology"}),L}et(fe,re);var se=fe.prototype;return se.hasNode=function(M){return this._nodes.has(""+M)},se.hasDirectedEdge=function(M,L){if("undirected"===this.type)return!1;if(1===arguments.length){var Ee=this._edges.get(""+M);return!!Ee&&!Ee.undirected}if(2===arguments.length){L=""+L;var Fe=this._nodes.get(M=""+M);if(!Fe)return!1;var nt=Fe.out[L];return!(!nt||this.multi&&!nt.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."))},se.hasUndirectedEdge=function(M,L){if("directed"===this.type)return!1;if(1===arguments.length){var Ee=this._edges.get(""+M);return!!Ee&&Ee.undirected}if(2===arguments.length){L=""+L;var Fe=this._nodes.get(M=""+M);if(!Fe)return!1;var nt=Fe.undirected[L];return!(!nt||this.multi&&!nt.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."))},se.hasEdge=function(M,L){if(1===arguments.length)return this._edges.has(""+M);if(2===arguments.length){L=""+L;var Ee=this._nodes.get(M=""+M);if(!Ee)return!1;var Fe=void 0!==Ee.out&&Ee.out[L];return Fe||(Fe=void 0!==Ee.undirected&&Ee.undirected[L]),!(!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."))},se.directedEdge=function(M,L){if("undirected"!==this.type){if(M=""+M,L=""+L,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 J=this._nodes.get(M);if(!J)throw new ne('Graph.directedEdge: could not find the "'.concat(M,'" source node in the graph.'));if(!this._nodes.has(L))throw new ne('Graph.directedEdge: could not find the "'.concat(L,'" target node in the graph.'));var Ee=J.out&&J.out[L]||void 0;return Ee?Ee.key:void 0}},se.undirectedEdge=function(M,L){if("directed"!==this.type){if(M=""+M,L=""+L,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 J=this._nodes.get(M);if(!J)throw new ne('Graph.undirectedEdge: could not find the "'.concat(M,'" source node in the graph.'));if(!this._nodes.has(L))throw new ne('Graph.undirectedEdge: could not find the "'.concat(L,'" target node in the graph.'));var Ee=J.undirected&&J.undirected[L]||void 0;return Ee?Ee.key:void 0}},se.edge=function(M,L){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.");L=""+L;var J=this._nodes.get(M=""+M);if(!J)throw new ne('Graph.edge: could not find the "'.concat(M,'" source node in the graph.'));if(!this._nodes.has(L))throw new ne('Graph.edge: could not find the "'.concat(L,'" target node in the graph.'));var Ee=J.out&&J.out[L]||J.undirected&&J.undirected[L]||void 0;if(Ee)return Ee.key},se.inDegree=function(M){var L=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof L)throw new me('Graph.inDegree: Expecting a boolean but got "'.concat(L,'" for the second parameter (allowing self-loops to be counted).'));var J=this._nodes.get(M=""+M);if(!J)throw new ne('Graph.inDegree: could not find the "'.concat(M,'" node in the graph.'));return"undirected"===this.type?0:J.inDegree+(L?J.directedSelfLoops:0)},se.outDegree=function(M){var L=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof L)throw new me('Graph.outDegree: Expecting a boolean but got "'.concat(L,'" for the second parameter (allowing self-loops to be counted).'));var J=this._nodes.get(M=""+M);if(!J)throw new ne('Graph.outDegree: could not find the "'.concat(M,'" node in the graph.'));return"undirected"===this.type?0:J.outDegree+(L?J.directedSelfLoops:0)},se.directedDegree=function(M){var L=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof L)throw new me('Graph.directedDegree: Expecting a boolean but got "'.concat(L,'" for the second parameter (allowing self-loops to be counted).'));var J=this._nodes.get(M=""+M);if(!J)throw new ne('Graph.directedDegree: could not find the "'.concat(M,'" node in the graph.'));if("undirected"===this.type)return 0;var Ee=L?J.directedSelfLoops:0;return J.inDegree+Ee+(J.outDegree+Ee)},se.undirectedDegree=function(M){var L=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof L)throw new me('Graph.undirectedDegree: Expecting a boolean but got "'.concat(L,'" for the second parameter (allowing self-loops to be counted).'));var J=this._nodes.get(M=""+M);if(!J)throw new ne('Graph.undirectedDegree: could not find the "'.concat(M,'" node in the graph.'));return"directed"===this.type?0:J.undirectedDegree+2*(L?J.undirectedSelfLoops:0)},se.degree=function(M){var L=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof L)throw new me('Graph.degree: Expecting a boolean but got "'.concat(L,'" for the second parameter (allowing self-loops to be counted).'));var J=this._nodes.get(M=""+M);if(!J)throw new ne('Graph.degree: could not find the "'.concat(M,'" node in the graph.'));var Ee=0,Fe=0;return"directed"!==this.type&&(L&&(Fe=J.undirectedSelfLoops),Ee+=J.undirectedDegree+2*Fe),"undirected"!==this.type&&(L&&(Fe=J.directedSelfLoops),Ee+=J.inDegree+J.outDegree+2*Fe),Ee},se.source=function(M){var L=this._edges.get(M=""+M);if(!L)throw new ne('Graph.source: could not find the "'.concat(M,'" edge in the graph.'));return L.source.key},se.target=function(M){var L=this._edges.get(M=""+M);if(!L)throw new ne('Graph.target: could not find the "'.concat(M,'" edge in the graph.'));return L.target.key},se.extremities=function(M){var L=this._edges.get(M=""+M);if(!L)throw new ne('Graph.extremities: could not find the "'.concat(M,'" edge in the graph.'));return[L.source.key,L.target.key]},se.opposite=function(M,L){M=""+M;var J=this._edges.get(L=""+L);if(!J)throw new ne('Graph.opposite: could not find the "'.concat(L,'" edge in the graph.'));var Ee=J.source.key,Fe=J.target.key;if(M!==Ee&&M!==Fe)throw new ne('Graph.opposite: the "'.concat(M,'" node is not attached to the "').concat(L,'" edge (').concat(Ee,", ").concat(Fe,")."));return M===Ee?Fe:Ee},se.hasExtremity=function(M,L){L=""+L;var J=this._edges.get(M=""+M);if(!J)throw new ne('Graph.hasExtremity: could not find the "'.concat(M,'" edge in the graph.'));return J.source.key===L||J.target.key===L},se.isUndirected=function(M){var L=this._edges.get(M=""+M);if(!L)throw new ne('Graph.isUndirected: could not find the "'.concat(M,'" edge in the graph.'));return L.undirected},se.isDirected=function(M){var L=this._edges.get(M=""+M);if(!L)throw new ne('Graph.isDirected: could not find the "'.concat(M,'" edge in the graph.'));return!L.undirected},se.isSelfLoop=function(M){var L=this._edges.get(M=""+M);if(!L)throw new ne('Graph.isSelfLoop: could not find the "'.concat(M,'" edge in the graph.'));return L.source===L.target},se.hasGeneratedKey=function(M){var L=this._edges.get(M=""+M);if(!L)throw new ne('Graph.hasGeneratedKey: could not find the "'.concat(M,'" edge in the graph.'));return L.generatedKey},se.addNode=function(M,L){return function(J,Ee,Fe){if(Fe&&!k(Fe))throw new me('Graph.addNode: invalid attributes. Expecting an object but got "'.concat(Fe,'"'));if(Fe=Fe||{},J._nodes.has(Ee=""+Ee))throw new ye('Graph.addNode: the "'.concat(Ee,'" node already exist in the graph.'));var nt=new J.NodeDataClass(Ee,Fe);return J._nodes.set(Ee,nt),J.emit("nodeAdded",{key:Ee,attributes:Fe}),nt}(this,M,L).key},se.mergeNode=function(M,L){if(L&&!k(L))throw new me('Graph.mergeNode: invalid attributes. Expecting an object but got "'.concat(L,'"'));L=L||{};var J=this._nodes.get(M=""+M);return J?(L&&(he(J.attributes,L),this.emit("nodeAttributesUpdated",{type:"merge",key:M,attributes:J.attributes,data:L})),M):(J=new this.NodeDataClass(M,L),this._nodes.set(M,J),this.emit("nodeAdded",{key:M,attributes:L}),M)},se.updateNode=function(M,L){if(L&&"function"!=typeof L)throw new me('Graph.updateNode: invalid updater function. Expecting a function but got "'.concat(L,'"'));var J=this._nodes.get(M=""+M);if(J)return L&&(J.attributes=L(J.attributes),this.emit("nodeAttributesUpdated",{type:"replace",key:M,attributes:J.attributes})),M;var Fe=L?L({}):{};return J=new this.NodeDataClass(M,Fe),this._nodes.set(M,J),this.emit("nodeAdded",{key:M,attributes:Fe}),M},se.dropNode=function(M){var L=this,J=this._nodes.get(M=""+M);if(!J)throw new ne('Graph.dropNode: could not find the "'.concat(M,'" node in the graph.'));this.forEachEdge(M,function(Ee){L.dropEdge(Ee)}),this._nodes.delete(M),this.emit("nodeDropped",{key:M,attributes:J.attributes})},se.dropEdge=function(M){var L;if(arguments.length>1){var J=""+arguments[0],Ee=""+arguments[1];if(!(L=W(this,J,Ee,this.type)))throw new ne('Graph.dropEdge: could not find the "'.concat(J,'" -> "').concat(Ee,'" edge in the graph.'))}else if(!(L=this._edges.get(M=""+M)))throw new ne('Graph.dropEdge: could not find the "'.concat(M,'" edge in the graph.'));this._edges.delete(L.key);var nt=L.source,Pt=L.target,We=L.attributes,qt=L.undirected;return nt===Pt?qt?(nt.undirectedSelfLoops--,this._undirectedSelfLoopCount--):(nt.directedSelfLoops--,this._directedSelfLoopCount--):qt?(nt.undirectedDegree--,Pt.undirectedDegree--):(nt.outDegree--,Pt.inDegree--),Xe(this,qt,L),qt?this._undirectedSize--:this._directedSize--,this.emit("edgeDropped",{key:M,attributes:We,source:nt.key,target:Pt.key,undirected:qt}),this},se.clear=function(){this._edges.clear(),this._nodes.clear(),this.emit("cleared")},se.clearEdges=function(){this._edges.clear(),this.clearIndex(),this.emit("edgesCleared")},se.getAttribute=function(M){return this._attributes[M]},se.getAttributes=function(){return this._attributes},se.hasAttribute=function(M){return this._attributes.hasOwnProperty(M)},se.setAttribute=function(M,L){return this._attributes[M]=L,this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:M}),this},se.updateAttribute=function(M,L){if("function"!=typeof L)throw new me("Graph.updateAttribute: updater should be a function.");return this._attributes[M]=L(this._attributes[M]),this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:M}),this},se.removeAttribute=function(M){return delete this._attributes[M],this.emit("attributesUpdated",{type:"remove",attributes:this._attributes,name:M}),this},se.replaceAttributes=function(M){if(!k(M))throw new me("Graph.replaceAttributes: provided attributes are not a plain object.");return this._attributes=M,this.emit("attributesUpdated",{type:"replace",attributes:this._attributes}),this},se.mergeAttributes=function(M){if(!k(M))throw new me("Graph.mergeAttributes: provided attributes are not a plain object.");return he(this._attributes,M),this.emit("attributesUpdated",{type:"merge",attributes:this._attributes,data:M}),this},se.getNodeAttribute=function(M,L){var J=this._nodes.get(M=""+M);if(!J)throw new ne('Graph.getNodeAttribute: could not find the "'.concat(M,'" node in the graph.'));return J.attributes[L]},se.getNodeAttributes=function(M){var L=this._nodes.get(M=""+M);if(!L)throw new ne('Graph.getNodeAttributes: could not find the "'.concat(M,'" node in the graph.'));return L.attributes},se.hasNodeAttribute=function(M,L){var J=this._nodes.get(M=""+M);if(!J)throw new ne('Graph.hasNodeAttribute: could not find the "'.concat(M,'" node in the graph.'));return J.attributes.hasOwnProperty(L)},se.setNodeAttribute=function(M,L,J){var Ee=this._nodes.get(M=""+M);if(!Ee)throw new ne('Graph.setNodeAttribute: could not find the "'.concat(M,'" 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 Ee.attributes[L]=J,this.emit("nodeAttributesUpdated",{key:M,type:"set",attributes:Ee.attributes,name:L}),this},se.updateNodeAttribute=function(M,L,J){var Ee=this._nodes.get(M=""+M);if(!Ee)throw new ne('Graph.updateNodeAttribute: could not find the "'.concat(M,'" 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 J)throw new me("Graph.updateAttribute: updater should be a function.");var Fe=Ee.attributes,nt=J(Fe[L]);return Fe[L]=nt,this.emit("nodeAttributesUpdated",{key:M,type:"set",attributes:Ee.attributes,name:L}),this},se.removeNodeAttribute=function(M,L){var J=this._nodes.get(M=""+M);if(!J)throw new ne('Graph.hasNodeAttribute: could not find the "'.concat(M,'" node in the graph.'));return delete J.attributes[L],this.emit("nodeAttributesUpdated",{key:M,type:"remove",attributes:J.attributes,name:L}),this},se.replaceNodeAttributes=function(M,L){var J=this._nodes.get(M=""+M);if(!J)throw new ne('Graph.replaceNodeAttributes: could not find the "'.concat(M,'" node in the graph.'));if(!k(L))throw new me("Graph.replaceNodeAttributes: provided attributes are not a plain object.");return J.attributes=L,this.emit("nodeAttributesUpdated",{key:M,type:"replace",attributes:J.attributes}),this},se.mergeNodeAttributes=function(M,L){var J=this._nodes.get(M=""+M);if(!J)throw new ne('Graph.mergeNodeAttributes: could not find the "'.concat(M,'" node in the graph.'));if(!k(L))throw new me("Graph.mergeNodeAttributes: provided attributes are not a plain object.");return he(J.attributes,L),this.emit("nodeAttributesUpdated",{key:M,type:"merge",attributes:J.attributes,data:L}),this},se.updateEachNodeAttributes=function(M,L){if("function"!=typeof M)throw new me("Graph.updateEachNodeAttributes: expecting an updater function.");if(L&&!C(L))throw new me("Graph.updateEachNodeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");for(var J,Ee,Fe=this._nodes.values();!0!==(J=Fe.next()).done;)(Ee=J.value).attributes=M(Ee.key,Ee.attributes);this.emit("eachNodeAttributesUpdated",{hints:L||null})},se.updateEachEdgeAttributes=function(M,L){if("function"!=typeof M)throw new me("Graph.updateEachEdgeAttributes: expecting an updater function.");if(L&&!C(L))throw new me("Graph.updateEachEdgeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");for(var J,Ee,Fe=this._edges.values();!0!==(J=Fe.next()).done;)(Ee=J.value).attributes=M(Ee.key,Ee.attributes);this.emit("eachEdgeAttributesUpdated",{hints:L||null})},se.forEach=function(M){if("function"!=typeof M)throw new me("Graph.forEach: expecting a callback.");this.multi?ut(!1,this,M):Be(!1,this,M)},se.forEachUntil=function(M){if("function"!=typeof M)throw new me("Graph.forEach: expecting a callback.");this.multi?ut(!0,this,M):Be(!0,this,M)},se.adjacency=function(){return this.multi?(nt=(M=this)._nodes.values(),Pt=M.type,We="outer",qt=null,new oe(function St(){var vn;if("outer"===We)return!0===(vn=nt.next()).done?vn:(L=vn.value,We="directed",St());if("directed"===We)return"undirected"===Pt?(We="undirected",St()):(Ee=L.out,J=Object.keys(L.out),Fe=0,We="inner-directed",St());if("undirected"===We){if("directed"===Pt)return We="outer",St();Ee=L.undirected,J=Object.keys(L.undirected),Fe=0,We="inner-undirected"}if(!qt&&Fe>=J.length)return We="inner-undirected"===We?"outer":"undirected",St();if(!qt){var Es=J[Fe++];return qt=Ee[Es].values(),St()}if((vn=qt.next()).done)return qt=null,St();var Zr=vn.value,Js=Zr.target;return"inner-undirected"===We&&Js.key===L.key&&(Js=Zr.source),{done:!1,value:[L.key,Js.key,L.attributes,Js.attributes,Zr.key,Zr.attributes]}})):(Fl=(St=this)._nodes.values(),fo=St.type,Br="outer",new oe(function Vs(){var Ac;if("outer"===Br)return!0===(Ac=Fl.next()).done?Ac:(vn=Ac.value,Br="directed",Vs());if("directed"===Br)return"undirected"===fo?(Br="undirected",Vs()):(Zr=vn.out,Es=Object.keys(vn.out),Js=0,Br="inner-directed",Vs());if("undirected"===Br){if("directed"===fo)return Br="outer",Vs();Zr=vn.undirected,Es=Object.keys(vn.undirected),Js=0,Br="inner-undirected"}if(Js>=Es.length)return Br="inner-undirected"===Br?"outer":"undirected",Vs();var xn=Es[Js++],po=Zr[xn],Ll=po.target;return"inner-undirected"===Br&&Ll.key===vn.key&&(Ll=po.source),{done:!1,value:[vn.key,Ll.key,vn.attributes,Ll.attributes,po.key,po.attributes]}}));var St,vn,Es,Zr,Js,Fl,fo,Br,M,L,J,Ee,Fe,nt,Pt,We,qt},se.nodes=function(){return"function"==typeof Array.from?Array.from(this._nodes.keys()):te(this._nodes.keys(),this._nodes.size)},se.forEachNode=function(M){if("function"!=typeof M)throw new me("Graph.forEachNode: expecting a callback.");this._nodes.forEach(function(L,J){M(J,L.attributes)})},se.forEachNodeUntil=function(M){if("function"!=typeof M)throw new me("Graph.forEachNode: expecting a callback.");for(var L,J,Ee=this._nodes.values();!0!==(L=Ee.next())&&!M((J=L.value).key,J.attributes););},se.nodeEntries=function(){var M=this._nodes.values();return new oe(function(){var L=M.next();if(L.done)return L;var J=L.value;return{value:[J.key,J.attributes],done:!1}})},se.exportNode=function(M){var L=this._nodes.get(M=""+M);if(!L)throw new ne('Graph.exportNode: could not find the "'.concat(M,'" node in the graph.'));return Je(M,L)},se.exportEdge=function(M){var L=this._edges.get(M=""+M);if(!L)throw new ne('Graph.exportEdge: could not find the "'.concat(M,'" edge in the graph.'));return Mt(M,L)},se.export=function(){var M=new Array(this._nodes.size),L=0;this._nodes.forEach(function(Ee,Fe){M[L++]=Je(Fe,Ee)});var J=new Array(this._edges.size);return L=0,this._edges.forEach(function(Ee,Fe){J[L++]=Mt(Fe,Ee)}),{attributes:this.getAttributes(),nodes:M,edges:J,options:{type:this.type,multi:this.multi,allowSelfLoops:this.allowSelfLoops}}},se.importNode=function(M){var L=arguments.length>1&&void 0!==arguments[1]&&arguments[1],J=It(M);if(J){if("not-object"===J)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"===J)throw new me("Graph.importNode: no key provided.");if("invalid-attributes"===J)throw new me("Graph.importNode: invalid attributes. Attributes should be a plain object, null or omitted.")}var Ee=M.key,Fe=M.attributes,nt=void 0===Fe?{}:Fe;return L?this.mergeNode(Ee,nt):this.addNode(Ee,nt),this},se.importEdge=function(M){var L=arguments.length>1&&void 0!==arguments[1]&&arguments[1],J=Ot(M);if(J){if("not-object"===J)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"===J)throw new me("Graph.importEdge: missing souce.");if("no-target"===J)throw new me("Graph.importEdge: missing target.");if("invalid-attributes"===J)throw new me("Graph.importEdge: invalid attributes. Attributes should be a plain object, null or omitted.");if("invalid-undirected"===J)throw new me("Graph.importEdge: invalid undirected. Undirected should be boolean or omitted.")}var Ee=M.source,Fe=M.target,nt=M.attributes,Pt=void 0===nt?{}:nt,We=M.undirected,qt=void 0!==We&&We;return"key"in M?(L?qt?this.mergeUndirectedEdgeWithKey:this.mergeDirectedEdgeWithKey:qt?this.addUndirectedEdgeWithKey:this.addDirectedEdgeWithKey).call(this,M.key,Ee,Fe,Pt):(L?qt?this.mergeUndirectedEdge:this.mergeDirectedEdge:qt?this.addUndirectedEdge:this.addDirectedEdge).call(this,Ee,Fe,Pt),this},se.import=function(M){var L,J,Ee,Fe=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(j(M))return this.import(M.export(),Fe),this;if(!k(M))throw new me("Graph.import: invalid argument. Expecting a serialized graph or, alternatively, a Graph instance.");if(M.attributes){if(!k(M.attributes))throw new me("Graph.import: invalid attributes. Expecting a plain object.");Fe?this.mergeAttributes(M.attributes):this.replaceAttributes(M.attributes)}if(M.nodes){if(Ee=M.nodes,!Array.isArray(Ee))throw new me("Graph.import: invalid nodes. Expecting an array.");for(L=0,J=Ee.length;LJ)){var Pt=new Set;Pt.add(L.undirected[nt]),L.undirected[nt]=Pt,M._nodes.get(nt).undirected[J]=Pt}})),this;var M},se.clearIndex=function(){return this._nodes.forEach(function(M){void 0!==M.in&&(M.in={},M.out={}),void 0!==M.undirected&&(M.undirected={})}),this},se.toJSON=function(){return this.export()},se.toString=function(){return"[object Graph]"},se.inspect=function(){var M=this,L={};this._nodes.forEach(function(Pt,We){L[We]=Pt.attributes});var J={},Ee={};this._edges.forEach(function(Pt,We){var qt=Pt.undirected?"--":"->",St="",vn="(".concat(Pt.source.key,")").concat(qt,"(").concat(Pt.target.key,")");Pt.generatedKey?M.multi&&(void 0===Ee[vn]?Ee[vn]=0:Ee[vn]++,St+="".concat(Ee[vn],". ")):St+="[".concat(We,"]: "),J[St+=vn]=Pt.attributes});var Fe={};for(var nt in this)this.hasOwnProperty(nt)&&!zn.has(nt)&&"function"!=typeof this[nt]&&(Fe[nt]=this[nt]);return Fe.attributes=this._attributes,Fe.nodes=L,Fe.edges=J,H(Fe,"constructor",this.constructor),Fe},fe}(T.exports.EventEmitter);"undefined"!=typeof Symbol&&(Cn.prototype[Symbol.for("nodejs.util.inspect.custom")]=Cn.prototype.inspect),[{name:function(re){return"".concat(re,"Edge")},generateKey:!0},{name:function(re){return"".concat(re,"DirectedEdge")},generateKey:!0,type:"directed"},{name:function(re){return"".concat(re,"UndirectedEdge")},generateKey:!0,type:"undirected"},{name:function(re){return"".concat(re,"EdgeWithKey")}},{name:function(re){return"".concat(re,"DirectedEdgeWithKey")},type:"directed"},{name:function(re){return"".concat(re,"UndirectedEdgeWithKey")},type:"undirected"}].forEach(function(re){["add","merge","update"].forEach(function(fe){var se=re.name(fe),M="add"===fe?bn:Xn;Cn.prototype[se]=re.generateKey?function(L,J,Ee){return M(this,se,!0,"undirected"===(re.type||this.type),null,L,J,Ee,"update"===fe)}:function(L,J,Ee,Fe){return M(this,se,!1,"undirected"===(re.type||this.type),L,J,Ee,Fe,"update"===fe)}})}),"undefined"!=typeof Symbol&&(Cn.prototype[Symbol.iterator]=Cn.prototype.adjacency),re=Cn,ze.forEach(function(fe){var se=fe.name,M=fe.attacher;M(re,se("Edge"),"mixed"),M(re,se("DirectedEdge"),"directed"),M(re,se("UndirectedEdge"),"undirected")}),function(re){Me.forEach(function(fe){var M,L,J,Ee;J=(M=fe).type,Ee=M.direction,re.prototype[L=M.name]=function(Fe,nt){if("mixed"!==J&&"mixed"!==this.type&&J!==this.type)return[];if(!arguments.length)return Re(this,J);if(1===arguments.length){var Pt=this._nodes.get(Fe=""+Fe);if(void 0===Pt)throw new ne("Graph.".concat(L,': could not find the "').concat(Fe,'" node in the graph.'));return In(this.multi,"mixed"===J?this.type:J,Ee,Pt)}if(2===arguments.length){nt=""+nt;var We=this._nodes.get(Fe=""+Fe);if(!We)throw new ne("Graph.".concat(L,': could not find the "').concat(Fe,'" source node in the graph.'));if(!this._nodes.has(nt))throw new ne("Graph.".concat(L,': could not find the "').concat(nt,'" target node in the graph.'));return xi(J,this.multi,Ee,We,nt)}throw new me("Graph.".concat(L,": too many arguments (expecting 0, 1 or 2 and got ").concat(arguments.length,")."))},function(se,M){var L=M.name,J=M.type,Ee=M.direction,Fe="forEach"+L[0].toUpperCase()+L.slice(1,-1);se.prototype[Fe]=function(nt,Pt,We){if("mixed"===J||"mixed"===this.type||J===this.type){if(1===arguments.length)return Ze(this,J,We=nt);if(2===arguments.length){We=Pt;var qt=this._nodes.get(nt=""+nt);if(void 0===qt)throw new ne("Graph.".concat(Fe,': could not find the "').concat(nt,'" node in the graph.'));return Nn(this.multi,"mixed"===J?this.type:J,Ee,qt,We)}if(3===arguments.length){Pt=""+Pt;var St=this._nodes.get(nt=""+nt);if(!St)throw new ne("Graph.".concat(Fe,': could not find the "').concat(nt,'" source node in the graph.'));if(!this._nodes.has(Pt))throw new ne("Graph.".concat(Fe,': could not find the "').concat(Pt,'" target node in the graph.'));return Xr(J,this.multi,Ee,St,Pt,We)}throw new me("Graph.".concat(Fe,": too many arguments (expecting 1, 2 or 3 and got ").concat(arguments.length,")."))}}}(re,fe),function(se,M){var L=M.name,J=M.type,Ee=M.direction,Fe="forEach"+L[0].toUpperCase()+L.slice(1,-1)+"Until";se.prototype[Fe]=function(nt,Pt,We){if("mixed"===J||"mixed"===this.type||J===this.type){if(1===arguments.length)return Tt(this,J,We=nt);if(2===arguments.length){We=Pt;var qt=this._nodes.get(nt=""+nt);if(void 0===qt)throw new ne("Graph.".concat(Fe,': could not find the "').concat(nt,'" node in the graph.'));return Yn(this.multi,"mixed"===J?this.type:J,Ee,qt,We)}if(3===arguments.length){Pt=""+Pt;var St=this._nodes.get(nt=""+nt);if(!St)throw new ne("Graph.".concat(Fe,': could not find the "').concat(nt,'" source node in the graph.'));if(!this._nodes.has(Pt))throw new ne("Graph.".concat(Fe,': could not find the "').concat(Pt,'" target node in the graph.'));return Ls(J,this.multi,Ee,St,Pt,We)}throw new me("Graph.".concat(Fe,": too many arguments (expecting 1, 2 or 3 and got ").concat(arguments.length,")."))}}}(re,fe),function(se,M){var J=M.type,Ee=M.direction,Fe=M.name.slice(0,-1)+"Entries";se.prototype[Fe]=function(nt,Pt){if("mixed"!==J&&"mixed"!==this.type&&J!==this.type)return oe.empty();if(!arguments.length)return kt(this,J);if(1===arguments.length){var We=this._nodes.get(nt=""+nt);if(!We)throw new ne("Graph.".concat(Fe,': could not find the "').concat(nt,'" node in the graph.'));return Mi(J,Ee,We)}if(2===arguments.length){Pt=""+Pt;var qt=this._nodes.get(nt=""+nt);if(!qt)throw new ne("Graph.".concat(Fe,': could not find the "').concat(nt,'" source node in the graph.'));if(!this._nodes.has(Pt))throw new ne("Graph.".concat(Fe,': could not find the "').concat(Pt,'" target node in the graph.'));return fs(J,Ee,qt,Pt)}throw new me("Graph.".concat(Fe,": too many arguments (expecting 0, 1 or 2 and got ").concat(arguments.length,")."))}}(re,fe)})}(Cn),function(re){Bs.forEach(function(fe){var M,L,J,Ee;J=(M=fe).type,Ee=M.direction,re.prototype[L=M.name]=function(Fe){if("mixed"!==J&&"mixed"!==this.type&&J!==this.type)return[];if(2===arguments.length){var nt=""+arguments[0],Pt=""+arguments[1];if(!this._nodes.has(nt))throw new ne("Graph.".concat(L,': could not find the "').concat(nt,'" node in the graph.'));if(!this._nodes.has(Pt))throw new ne("Graph.".concat(L,': could not find the "').concat(Pt,'" node in the graph.'));return lt(this,J,Ee,nt,Pt)}if(1===arguments.length){var We=this._nodes.get(Fe=""+Fe);if(void 0===We)throw new ne("Graph.".concat(L,': could not find the "').concat(Fe,'" node in the graph.'));return xa("mixed"===J?this.type:J,Ee,We)}throw new me("Graph.".concat(L,": invalid number of arguments (expecting 1 or 2 and got ").concat(arguments.length,")."))},function(re,fe){var se=fe.name,M=fe.type,L=fe.direction,J="forEach"+se[0].toUpperCase()+se.slice(1,-1);re.prototype[J]=function(Ee,Fe){if("mixed"===M||"mixed"===this.type||M===this.type){var nt=this._nodes.get(Ee=""+Ee);if(void 0===nt)throw new ne("Graph.".concat(J,': could not find the "').concat(Ee,'" node in the graph.'));!function(Pt,We,qt,St){if("mixed"!==Pt){if("undirected"===Pt)return kl(qt,qt.undirected,St);if("string"==typeof We)return kl(qt,qt[We],St)}var vn=new Set;"undirected"!==Pt&&("out"!==We&&Sa(vn,qt,qt.in,St),"in"!==We&&Sa(vn,qt,qt.out,St)),"directed"!==Pt&&Sa(vn,qt,qt.undirected,St)}("mixed"===M?this.type:M,L,nt,Fe)}}}(re,fe),function(re,fe){var se=fe.name,M=fe.type,L=fe.direction,J="forEach"+se[0].toUpperCase()+se.slice(1,-1)+"Until";re.prototype[J]=function(Ee,Fe){if("mixed"===M||"mixed"===this.type||M===this.type){var nt=this._nodes.get(Ee=""+Ee);if(void 0===nt)throw new ne("Graph.".concat(J,': could not find the "').concat(Ee,'" node in the graph.'));!function(Pt,We,qt,St){if("mixed"!==Pt){if("undirected"===Pt)return ws(qt,qt.undirected,St);if("string"==typeof We)return ws(qt,qt[We],St)}var vn=new Set;"undirected"!==Pt&&("out"!==We&&en(vn,qt,qt.in,St)||"in"!==We&&en(vn,qt,qt.out,St))||"directed"===Pt||en(vn,qt,qt.undirected,St)}("mixed"===M?this.type:M,L,nt,Fe)}}}(re,fe),function(re,fe){var M=fe.type,L=fe.direction,J=fe.name.slice(0,-1)+"Entries";re.prototype[J]=function(Ee){if("mixed"!==M&&"mixed"!==this.type&&M!==this.type)return oe.empty();var Fe=this._nodes.get(Ee=""+Ee);if(void 0===Fe)throw new ne("Graph.".concat(J,': could not find the "').concat(Ee,'" node in the graph.'));return function(nt,Pt,We){if("mixed"!==nt){if("undirected"===nt)return nl(We,We.undirected);if("string"==typeof Pt)return nl(We,We[Pt])}var qt=oe.empty(),St=new Set;return"undirected"!==nt&&("out"!==Pt&&(qt=Ke(qt,rt(St,We,We.in))),"in"!==Pt&&(qt=Ke(qt,rt(St,We,We.out)))),"directed"!==nt&&(qt=Ke(qt,rt(St,We,We.undirected))),qt}("mixed"===M?this.type:M,L,Fe)}}(re,fe)})}(Cn);var rr=function(re){function fe(se){var M=he({type:"directed"},se);if("multi"in M&&!1!==M.multi)throw new me("DirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if("directed"!==M.type)throw new me('DirectedGraph.from: inconsistent "'+M.type+'" type in given options!');return re.call(this,M)||this}return et(fe,re),fe}(Cn),sr=function(re){function fe(se){var M=he({type:"undirected"},se);if("multi"in M&&!1!==M.multi)throw new me("UndirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if("undirected"!==M.type)throw new me('UndirectedGraph.from: inconsistent "'+M.type+'" type in given options!');return re.call(this,M)||this}return et(fe,re),fe}(Cn),Qn=function(re){function fe(se){var M=he({multi:!0},se);if("multi"in M&&!0!==M.multi)throw new me("MultiGraph.from: inconsistent indication that the graph should be simple in given options!");return re.call(this,M)||this}return et(fe,re),fe}(Cn),Wi=function(re){function fe(se){var M=he({type:"directed",multi:!0},se);if("multi"in M&&!0!==M.multi)throw new me("MultiDirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if("directed"!==M.type)throw new me('MultiDirectedGraph.from: inconsistent "'+M.type+'" type in given options!');return re.call(this,M)||this}return et(fe,re),fe}(Cn),Ca=function(re){function fe(se){var M=he({type:"undirected",multi:!0},se);if("multi"in M&&!0!==M.multi)throw new me("MultiUndirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if("undirected"!==M.type)throw new me('MultiUndirectedGraph.from: inconsistent "'+M.type+'" type in given options!');return re.call(this,M)||this}return et(fe,re),fe}(Cn);function Qr(re){re.from=function(fe,se){var M=he({},fe.options,se),L=new re(M);return L.import(fe),L}}return Qr(Cn),Qr(rr),Qr(sr),Qr(Qn),Qr(Wi),Qr(Ca),Cn.Graph=Cn,Cn.DirectedGraph=rr,Cn.UndirectedGraph=sr,Cn.MultiGraph=Qn,Cn.MultiDirectedGraph=Wi,Cn.MultiUndirectedGraph=Ca,Cn.InvalidArgumentsGraphError=me,Cn.NotFoundGraphError=ne,Cn.UsageGraphError=ye,Cn}()},1524:(Ut,it,et)=>{var yt;!function(ee,Dt,dt,Y){"use strict";var T,Se=["","webkit","Moz","MS","ms","o"],he=Dt.createElement("div"),j=Math.round,k=Math.abs,Q=Date.now;function H(be,De,Ge){return setTimeout(A(be,Ge),De)}function w(be,De,Ge){return!!Array.isArray(be)&&(C(be,Ge[De],Ge),!0)}function C(be,De,Ge){var vt;if(be)if(be.forEach)be.forEach(De,Ge);else if(be.length!==Y)for(vt=0;vt\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",ui=ee.console&&(ee.console.warn||ee.console.log);return ui&&ui.call(ee.console,vt,Xt),be.apply(this,arguments)}}T="function"!=typeof Object.assign?function(De){if(De===Y||null===De)throw new TypeError("Cannot convert undefined or null to object");for(var Ge=Object(De),vt=1;vt-1}function K(be){return be.trim().split(/\s+/g)}function E(be,De,Ge){if(be.indexOf&&!Ge)return be.indexOf(De);for(var vt=0;vtxs[De]}):vt.sort()),vt}function ae(be,De){for(var Ge,vt,$t=De[0].toUpperCase()+De.slice(1),Xt=0;Xt1&&!Ge.firstMultiple?Ge.firstMultiple=Tt(De):1===$t&&(Ge.firstMultiple=!1);var Xt=Ge.firstInput,ui=Ge.firstMultiple,Vr=ui?ui.center:Xt.center,Jr=De.center=kt(vt);De.timeStamp=Q(),De.deltaTime=De.timeStamp-Xt.timeStamp,De.angle=Mi(Vr,Jr),De.distance=Yn(Vr,Jr),function(be,De){var Ge=De.center,vt=be.offsetDelta||{},$t=be.prevDelta||{},Xt=be.prevInput||{};(1===De.eventType||4===Xt.eventType)&&($t=be.prevDelta={x:Xt.deltaX||0,y:Xt.deltaY||0},vt=be.offsetDelta={x:Ge.x,y:Ge.y}),De.deltaX=$t.x+(Ge.x-vt.x),De.deltaY=$t.y+(Ge.y-vt.y)}(Ge,De),De.offsetDirection=Nn(De.deltaX,De.deltaY);var xs=In(De.deltaTime,De.deltaX,De.deltaY);De.overallVelocityX=xs.x,De.overallVelocityY=xs.y,De.overallVelocity=k(xs.x)>k(xs.y)?xs.x:xs.y,De.scale=ui?function(be,De){return Yn(De[0],De[1],pt)/Yn(be[0],be[1],pt)}(ui.pointers,vt):1,De.rotation=ui?function(be,De){return Mi(De[1],De[0],pt)+Mi(be[1],be[0],pt)}(ui.pointers,vt):0,De.maxPointers=Ge.prevInput?De.pointers.length>Ge.prevInput.maxPointers?De.pointers.length:Ge.prevInput.maxPointers:De.pointers.length,function(be,De){var $t,Xt,ui,Vr,Ge=be.lastInterval||De,vt=De.timeStamp-Ge.timeStamp;if(8!=De.eventType&&(vt>25||Ge.velocity===Y)){var Jr=De.deltaX-Ge.deltaX,xs=De.deltaY-Ge.deltaY,Zn=In(vt,Jr,xs);Xt=Zn.x,ui=Zn.y,$t=k(Zn.x)>k(Zn.y)?Zn.x:Zn.y,Vr=Nn(Jr,xs),be.lastInterval=De}else $t=Ge.velocity,Xt=Ge.velocityX,ui=Ge.velocityY,Vr=Ge.direction;De.velocity=$t,De.velocityX=Xt,De.velocityY=ui,De.direction=Vr}(Ge,De);var Zn=be.element;I(De.srcEvent.target,Zn)&&(Zn=De.srcEvent.target),De.target=Zn}(be,Ge),be.emit("hammer.input",Ge),be.recognize(Ge),be.session.prevInput=Ge}function Tt(be){for(var De=[],Ge=0;Ge=k(De)?be<0?2:4:De<0?8:16}function Yn(be,De,Ge){Ge||(Ge=_t);var vt=De[Ge[0]]-be[Ge[0]],$t=De[Ge[1]]-be[Ge[1]];return Math.sqrt(vt*vt+$t*$t)}function Mi(be,De,Ge){return Ge||(Ge=_t),180*Math.atan2(De[Ge[1]]-be[Ge[1]],De[Ge[0]]-be[Ge[0]])/Math.PI}we.prototype={handler:function(){},init:function(){this.evEl&&X(this.element,this.evEl,this.domHandler),this.evTarget&&X(this.target,this.evTarget,this.domHandler),this.evWin&&X(Te(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&ue(this.element,this.evEl,this.domHandler),this.evTarget&&ue(this.target,this.evTarget,this.domHandler),this.evWin&&ue(Te(this.element),this.evWin,this.domHandler)}};var Ls={mousedown:1,mousemove:2,mouseup:4},fs="mousedown",Bs="mousemove mouseup";function Kr(){this.evEl=fs,this.evWin=Bs,this.pressed=!1,we.apply(this,arguments)}S(Kr,we,{handler:function(De){var Ge=Ls[De.type];1&Ge&&0===De.button&&(this.pressed=!0),2&Ge&&1!==De.which&&(Ge=4),this.pressed&&(4&Ge&&(this.pressed=!1),this.callback(this.manager,Ge,{pointers:[De],changedPointers:[De],pointerType:Qe,srcEvent:De}))}});var xa={pointerdown:1,pointermove:2,pointerup:4,pointercancel:8,pointerout:8},kl={2:$e,3:"pen",4:Qe,5:"kinect"},Sa="pointerdown",ws="pointermove pointerup pointercancel";function en(){this.evEl=Sa,this.evWin=ws,we.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}ee.MSPointerEvent&&!ee.PointerEvent&&(Sa="MSPointerDown",ws="MSPointerMove MSPointerUp MSPointerCancel"),S(en,we,{handler:function(De){var Ge=this.store,vt=!1,$t=De.type.toLowerCase().replace("ms",""),Xt=xa[$t],ui=kl[De.pointerType]||De.pointerType,Vr=ui==$e,Jr=E(Ge,De.pointerId,"pointerId");1&Xt&&(0===De.button||Vr)?Jr<0&&(Ge.push(De),Jr=Ge.length-1):12&Xt&&(vt=!0),!(Jr<0)&&(Ge[Jr]=De,this.callback(this.manager,Xt,{pointers:Ge,changedPointers:[De],pointerType:ui,srcEvent:De}),vt&&Ge.splice(Jr,1))}});var nl={touchstart:1,touchmove:2,touchend:4,touchcancel:8},rt="touchstart",lt="touchstart touchmove touchend touchcancel";function ht(){this.evTarget=rt,this.evWin=lt,this.started=!1,we.apply(this,arguments)}function ge(be,De){var Ge=$(be.touches),vt=$(be.changedTouches);return 12&De&&(Ge=Z(Ge.concat(vt),"identifier",!0)),[Ge,vt]}S(ht,we,{handler:function(De){var Ge=nl[De.type];if(1===Ge&&(this.started=!0),this.started){var vt=ge.call(this,De,Ge);12&Ge&&vt[0].length-vt[1].length==0&&(this.started=!1),this.callback(this.manager,Ge,{pointers:vt[0],changedPointers:vt[1],pointerType:$e,srcEvent:De})}}});var ve={touchstart:1,touchmove:2,touchend:4,touchcancel:8},Be="touchstart touchmove touchend touchcancel";function ut(){this.evTarget=Be,this.targetIds={},we.apply(this,arguments)}function Je(be,De){var Ge=$(be.touches),vt=this.targetIds;if(3&De&&1===Ge.length)return vt[Ge[0].identifier]=!0,[Ge,Ge];var $t,Xt,ui=$(be.changedTouches),Vr=[],Jr=this.target;if(Xt=Ge.filter(function(xs){return I(xs.target,Jr)}),1===De)for($t=0;$t-1&&vt.splice(Xt,1)},2500)}}function ci(be){for(var De=be.srcEvent.clientX,Ge=be.srcEvent.clientY,vt=0;vt-1&&this.requireFail.splice(De,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(be){return!!this.simultaneous[be.id]},emit:function(be){var De=this,Ge=this.state;function vt($t){De.manager.emit($t,be)}Ge<8&&vt(De.options.event+We(Ge)),vt(De.options.event),be.additionalEvent&&vt(be.additionalEvent),Ge>=8&&vt(De.options.event+We(Ge))},tryEmit:function(be){if(this.canEmit())return this.emit(be);this.state=32},canEmit:function(){for(var be=0;beDe.threshold&&$t&De.direction},attrTest:function(be){return vn.prototype.attrTest.call(this,be)&&(2&this.state||!(2&this.state)&&this.directionTest(be))},emit:function(be){this.pX=be.deltaX,this.pY=be.deltaY;var De=qt(be.direction);De&&(be.additionalEvent=this.options.event+De),this._super.emit.call(this,be)}}),S(Zr,vn,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[sr]},attrTest:function(be){return this._super.attrTest.call(this,be)&&(Math.abs(be.scale-1)>this.options.threshold||2&this.state)},emit:function(be){1!==be.scale&&(be.additionalEvent=this.options.event+(be.scale<1?"in":"out")),this._super.emit.call(this,be)}}),S(Js,Pt,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return["auto"]},process:function(be){var De=this.options,Ge=be.pointers.length===De.pointers,vt=be.distanceDe.time;if(this._input=be,!vt||!Ge||12&be.eventType&&!$t)this.reset();else if(1&be.eventType)this.reset(),this._timer=H(function(){this.state=8,this.tryEmit()},De.time,this);else if(4&be.eventType)return 8;return 32},reset:function(){clearTimeout(this._timer)},emit:function(be){8===this.state&&(be&&4&be.eventType?this.manager.emit(this.options.event+"up",be):(this._input.timeStamp=Q(),this.manager.emit(this.options.event,this._input)))}}),S(Fl,vn,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[sr]},attrTest:function(be){return this._super.attrTest.call(this,be)&&(Math.abs(be.rotation)>this.options.threshold||2&this.state)}}),S(fo,vn,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:30,pointers:1},getTouchAction:function(){return Es.prototype.getTouchAction.call(this)},attrTest:function(be){var Ge,De=this.options.direction;return 30&De?Ge=be.overallVelocity:6&De?Ge=be.overallVelocityX:24&De&&(Ge=be.overallVelocityY),this._super.attrTest.call(this,be)&&De&be.offsetDirection&&be.distance>this.options.threshold&&be.maxPointers==this.options.pointers&&k(Ge)>this.options.velocity&&4&be.eventType},emit:function(be){var De=qt(be.offsetDirection);De&&this.manager.emit(this.options.event+De,be),this.manager.emit(this.options.event,be)}}),S(Br,Pt,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[rr]},process:function(be){var De=this.options,Ge=be.pointers.length===De.pointers,vt=be.distance"']/g,ws=RegExp(kl.source),en=RegExp(Sa.source),nl=/<%-([\s\S]+?)%>/g,rt=/<%([\s\S]+?)%>/g,lt=/<%=([\s\S]+?)%>/g,ht=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ge=/^\w*$/,ve=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Be=/[\\^$.*+?()[\]{}|]/g,ut=RegExp(Be.source),Je=/^\s+/,Mt=/\s/,It=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Ot=/\{\n\/\* \[wrapped with (.+)\] \*/,Qt=/,? & /,zn=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ci=/[()=,{}\[\]\/\s]/,Rn=/\\(\\)?/g,bn=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Xn=/\w*$/,Cn=/^[-+]0x[0-9a-f]+$/i,rr=/^0b[01]+$/i,sr=/^\[object .+?Constructor\]$/,Qn=/^0o[0-7]+$/i,Wi=/^(?:0|[1-9]\d*)$/,Ca=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Qr=/($^)/,re=/['\n\r\u2028\u2029\\]/g,fe="\\ud800-\\udfff",J="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Ee="\\u2700-\\u27bf",Fe="a-z\\xdf-\\xf6\\xf8-\\xff",St="A-Z\\xc0-\\xd6\\xd8-\\xde",vn="\\ufe0e\\ufe0f",Es="\\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",Js="["+fe+"]",Fl="["+Es+"]",fo="["+J+"]",Br="\\d+",Vs="["+Ee+"]",Ac="["+Fe+"]",xn="[^"+fe+Es+Br+Ee+Fe+St+"]",po="\\ud83c[\\udffb-\\udfff]",Ta="[^"+fe+"]",Ed="(?:\\ud83c[\\udde6-\\uddff]){2}",be="[\\ud800-\\udbff][\\udc00-\\udfff]",De="["+St+"]",vt="(?:"+Ac+"|"+xn+")",$t="(?:"+De+"|"+xn+")",Xt="(?:['\u2019](?:d|ll|m|re|s|t|ve))?",ui="(?:['\u2019](?:D|LL|M|RE|S|T|VE))?",Vr="(?:"+fo+"|"+po+")?",Jr="["+vn+"]?",C1=Jr+Vr+"(?:\\u200d(?:"+[Ta,Ed,be].join("|")+")"+Jr+Vr+")*",xd="(?:"+[Vs,Ed,be].join("|")+")"+C1,er="(?:"+[Ta+fo+"?",fo,Ed,be,Js].join("|")+")",fp=RegExp("['\u2019]","g"),n_=RegExp(fo,"g"),Oh=RegExp(po+"(?="+po+")|"+er+C1,"g"),iv=RegExp([De+"?"+Ac+"+"+Xt+"(?="+[Fl,De,"$"].join("|")+")",$t+"+"+ui+"(?="+[Fl,De+vt,"$"].join("|")+")",De+"?"+vt+"+"+Xt,De+"+"+ui,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Br,xd].join("|"),"g"),T1=RegExp("[\\u200d"+fe+J+vn+"]"),Bl=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Rh=["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"],A1=-1,rn={};rn[kt]=rn[In]=rn[Nn]=rn[Yn]=rn[Mi]=rn[xi]=rn[Xr]=rn[Ls]=rn[fs]=!0,rn[Qe]=rn[tt]=rn[Ze]=rn[ze]=rn[Tt]=rn[Le]=rn[Me]=rn[Ue]=rn[ke]=rn[q]=rn[pe]=rn[_t]=rn[pt]=rn[we]=rn[V]=!1;var or={};or[Qe]=or[tt]=or[Ze]=or[Tt]=or[ze]=or[Le]=or[kt]=or[In]=or[Nn]=or[Yn]=or[Mi]=or[ke]=or[q]=or[pe]=or[_t]=or[pt]=or[we]=or[B]=or[xi]=or[Xr]=or[Ls]=or[fs]=!0,or[Me]=or[Ue]=or[V]=!1;var tn={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},M1=parseFloat,av=parseInt,Nt="object"==typeof global&&global&&global.Object===Object&&global,js="object"==typeof self&&self&&self.Object===Object&&self,Ui=Nt||js||Function("return this")(),Vl=it&&!it.nodeType&&it,Aa=Vl&&Ut&&!Ut.nodeType&&Ut,No=Aa&&Aa.exports===Vl,i_=No&&Nt.process,xr=function(){try{return Aa&&Aa.require&&Aa.require("util").types||i_&&i_.binding&&i_.binding("util")}catch(Rt){}}(),an=xr&&xr.isArrayBuffer,hi=xr&&xr.isDate,ur=xr&&xr.isMap,go=xr&&xr.isRegExp,Mc=xr&&xr.isSet,ss=xr&&xr.isTypedArray;function os(at,Rt,Ct){switch(Ct.length){case 0:return at.call(Rt);case 1:return at.call(Rt,Ct[0]);case 2:return at.call(Rt,Ct[0],Ct[1]);case 3:return at.call(Rt,Ct[0],Ct[1],Ct[2])}return at.apply(Rt,Ct)}function jr(at,Rt,Ct,hn){for(var Mn=-1,Li=null==at?0:at.length;++Mn-1}function Ph(at,Rt,Ct){for(var hn=-1,Mn=null==at?0:at.length;++hn-1;);return Ct}function R1(at,Rt){for(var Ct=at.length;Ct--&&il(Rt,at[Ct],0)>-1;);return Ct}function rF(at,Rt){for(var Ct=at.length,hn=0;Ct--;)at[Ct]===Rt&&++hn;return hn}var sF=Jo({\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"}),oF=Jo({"&":"&","<":"<",">":">",'"':""","'":"'"});function aF(at){return"\\"+tn[at]}function Fh(at){return T1.test(at)}function cv(at){var Rt=-1,Ct=Array(at.size);return at.forEach(function(hn,Mn){Ct[++Rt]=[Mn,hn]}),Ct}function P1(at,Rt){return function(Ct){return at(Rt(Ct))}}function xu(at,Rt){for(var Ct=-1,hn=at.length,Mn=0,Li=[];++Ct",""":'"',"'":"'"}),Bh=function at(Rt){var d,Ct=(Rt=null==Rt?Ui:Bh.defaults(Ui.Object(),Rt,Bh.pick(Ui,Rh))).Array,hn=Rt.Date,Mn=Rt.Error,Li=Rt.Function,es=Rt.Math,Yi=Rt.Object,u_=Rt.RegExp,d_=Rt.String,Ia=Rt.TypeError,dr=Ct.prototype,Su=Yi.prototype,gp=Rt["__core-js_shared__"],Sr=Li.prototype.toString,Xi=Su.hasOwnProperty,fF=0,Vh=(d=/[^.]+$/.exec(gp&&gp.keys&&gp.keys.IE_PROTO||""))?"Symbol(src)_1."+d:"",eo=Su.toString,F1=Sr.call(Yi),h_=Ui._,Dd=u_("^"+Sr.call(Xi).replace(Be,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),zs=No?Rt.Buffer:ee,Ul=Rt.Symbol,Id=Rt.Uint8Array,hv=zs?zs.allocUnsafe:ee,Oa=P1(Yi.getPrototypeOf,Yi),f_=Yi.create,mp=Su.propertyIsEnumerable,Ln=dr.splice,L1=Ul?Ul.isConcatSpreadable:ee,jh=Ul?Ul.iterator:ee,Cu=Ul?Ul.toStringTag:ee,_p=function(){try{var d=jc(Yi,"defineProperty");return d({},"",{}),d}catch(p){}}(),fv=Rt.clearTimeout!==Ui.clearTimeout&&Rt.clearTimeout,B1=hn&&hn.now!==Ui.Date.now&&hn.now,V1=Rt.setTimeout!==Ui.setTimeout&&Rt.setTimeout,Vt=es.ceil,Si=es.floor,_r=Yi.getOwnPropertySymbols,as=zs?zs.isBuffer:ee,p_=Rt.isFinite,Uh=dr.join,sl=P1(Yi.keys,Yi),zr=es.max,ps=es.min,pF=hn.now,j1=Rt.parseInt,zh=es.random,yp=dr.reverse,Cs=jc(Rt,"DataView"),mo=jc(Rt,"Map"),bp=jc(Rt,"Promise"),Ra=jc(Rt,"Set"),Fo=jc(Rt,"WeakMap"),Hh=jc(Yi,"create"),Gh=Fo&&new Fo,Od={},U1=Lu(Cs),g_=Lu(mo),m_=Lu(bp),pv=Lu(Ra),__=Lu(Fo),vp=Ul?Ul.prototype:ee,Rd=vp?vp.valueOf:ee,$h=vp?vp.toString:ee;function xe(d){if(Ar(d)&&!On(d)&&!(d instanceof fi)){if(d instanceof Lo)return d;if(Xi.call(d,"__wrapped__"))return sf(d)}return new Lo(d)}var Tu=function(){function d(){}return function(p){if(!Tr(p))return{};if(f_)return f_(p);d.prototype=p;var _=new d;return d.prototype=ee,_}}();function Wh(){}function Lo(d,p){this.__wrapped__=d,this.__actions__=[],this.__chain__=!!p,this.__index__=0,this.__values__=ee}function fi(d){this.__wrapped__=d,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=ye,this.__views__=[]}function _o(d){var p=-1,_=null==d?0:d.length;for(this.clear();++p<_;){var F=d[p];this.set(F[0],F[1])}}function zl(d){var p=-1,_=null==d?0:d.length;for(this.clear();++p<_;){var F=d[p];this.set(F[0],F[1])}}function ol(d){var p=-1,_=null==d?0:d.length;for(this.clear();++p<_;){var F=d[p];this.set(F[0],F[1])}}function Pa(d){var p=-1,_=null==d?0:d.length;for(this.__data__=new ol;++p<_;)this.add(d[p])}function Na(d){var p=this.__data__=new zl(d);this.size=p.size}function Yh(d,p){var _=On(d),F=!_&&gl(d),le=!_&&!F&&ml(d),Ae=!_&&!F&&!le&&df(d),He=_||F||le||Ae,Ye=He?Md(d.length,d_):[],ct=Ye.length;for(var Ft in d)(p||Xi.call(d,Ft))&&(!He||!("length"==Ft||le&&("offset"==Ft||"parent"==Ft)||Ae&&("buffer"==Ft||"byteLength"==Ft||"byteOffset"==Ft)||jo(Ft,ct)))&&Ye.push(Ft);return Ye}function w_(d){var p=d.length;return p?d[Hl(0,p-1)]:ee}function yv(d,p){return qd(no(d),Au(p,0,d.length))}function Pd(d){return qd(no(d))}function E_(d,p,_){(_!==ee&&!Dn(d[p],_)||_===ee&&!(p in d))&&ll(d,p,_)}function al(d,p,_){var F=d[p];(!Xi.call(d,p)||!Dn(F,_)||_===ee&&!(p in d))&&ll(d,p,_)}function Nd(d,p){for(var _=d.length;_--;)if(Dn(d[_][0],p))return _;return-1}function Cp(d,p,_,F){return Pc(d,function(le,Ae,He){p(F,le,_(le),He)}),F}function Q1(d,p){return d&&Fa(p,Is(p),d)}function ll(d,p,_){"__proto__"==p&&_p?_p(d,p,{configurable:!0,enumerable:!0,value:_,writable:!0}):d[p]=_}function x_(d,p){for(var _=-1,F=p.length,le=Ct(F),Ae=null==d;++_=p?d:p)),d}function Hs(d,p,_,F,le,Ae){var He,Ye=1&p,ct=2&p,Ft=4&p;if(_&&(He=le?_(d,F,le,Ae):_(d)),He!==ee)return He;if(!Tr(d))return d;var Lt=On(d);if(Lt){if(He=function(d){var p=d.length,_=new d.constructor(p);return p&&"string"==typeof d[0]&&Xi.call(d,"index")&&(_.index=d.index,_.input=d.input),_}(d),!Ye)return no(d,He)}else{var Gt=$s(d),nn=Gt==Ue||Gt==qe;if(ml(d))return Pp(d,Ye);if(Gt==pe||Gt==Qe||nn&&!le){if(He=ct||nn?{}:Uv(d),!Ye)return ct?function(d,p){return Fa(d,Bv(d),p)}(d,function(d,p){return d&&Fa(p,ro(p),d)}(He,d)):function(d,p){return Fa(d,V_(d),p)}(d,Q1(He,d))}else{if(!or[Gt])return le?d:{};He=function(d,p,_){var F=d.constructor;switch(p){case Ze:return Pu(d);case ze:case Le:return new F(+d);case Tt:return function(d,p){var _=p?Pu(d.buffer):d.buffer;return new d.constructor(_,d.byteOffset,d.byteLength)}(d,_);case kt:case In:case Nn:case Yn:case Mi:case xi:case Xr:case Ls:case fs:return N_(d,_);case ke:return new F;case q:case we:return new F(d);case _t:return function(d){var p=new d.constructor(d.source,Xn.exec(d));return p.lastIndex=d.lastIndex,p}(d);case pt:return new F;case B:return function(d){return Rd?Yi(Rd.call(d)):{}}(d)}}(d,Gt,Ye)}}Ae||(Ae=new Na);var wn=Ae.get(d);if(wn)return wn;Ae.set(d,He),yA(d)?d.forEach(function(Bn){He.add(Hs(Bn,p,_,Bn,d,Ae))}):pA(d)&&d.forEach(function(Bn,mi){He.set(mi,Hs(Bn,p,_,mi,d,Ae))});var gi=Lt?ee:(Ft?ct?L_:ql:ct?ro:Is)(d);return Us(gi||d,function(Bn,mi){gi&&(Bn=d[mi=Bn]),al(He,mi,Hs(Bn,p,_,mi,d,Ae))}),He}function Tp(d,p,_){var F=_.length;if(null==d)return!F;for(d=Yi(d);F--;){var le=_[F],He=d[le];if(He===ee&&!(le in d)||!(0,p[le])(He))return!1}return!0}function Xh(d,p,_){if("function"!=typeof d)throw new Ia(Se);return nf(function(){d.apply(ee,_)},p)}function Rc(d,p,_,F){var le=-1,Ae=jl,He=!0,Ye=d.length,ct=[],Ft=p.length;if(!Ye)return ct;_&&(p=qi(p,ta(_))),F?(Ae=Ph,He=!1):p.length>=200&&(Ae=kh,He=!1,p=new Pa(p));e:for(;++le-1},zl.prototype.set=function(d,p){var _=this.__data__,F=Nd(_,d);return F<0?(++this.size,_.push([d,p])):_[F][1]=p,this},ol.prototype.clear=function(){this.size=0,this.__data__={hash:new _o,map:new(mo||zl),string:new _o}},ol.prototype.delete=function(d){var p=Gs(this,d).delete(d);return this.size-=p?1:0,p},ol.prototype.get=function(d){return Gs(this,d).get(d)},ol.prototype.has=function(d){return Gs(this,d).has(d)},ol.prototype.set=function(d,p){var _=Gs(this,d),F=_.size;return _.set(d,p),this.size+=_.size==F?0:1,this},Pa.prototype.add=Pa.prototype.push=function(d){return this.__data__.set(d,W),this},Pa.prototype.has=function(d){return this.__data__.has(d)},Na.prototype.clear=function(){this.__data__=new zl,this.size=0},Na.prototype.delete=function(d){var p=this.__data__,_=p.delete(d);return this.size=p.size,_},Na.prototype.get=function(d){return this.__data__.get(d)},Na.prototype.has=function(d){return this.__data__.has(d)},Na.prototype.set=function(d,p){var _=this.__data__;if(_ instanceof zl){var F=_.__data__;if(!mo||F.length<199)return F.push([d,p]),this.size=++_.size,this;_=this.__data__=new ol(F)}return _.set(d,p),this.size=_.size,this};var Pc=dl(cl),C_=dl(Ap,!0);function vv(d,p){var _=!0;return Pc(d,function(F,le,Ae){return _=!!p(F,le,Ae)}),_}function Kh(d,p,_){for(var F=-1,le=d.length;++F0&&_(Ye)?p>1?Ts(Ye,p-1,_,F,le):Ur(le,Ye):F||(le[le.length]=Ye)}return le}var kd=Dv(),Fd=Dv(!0);function cl(d,p){return d&&kd(d,p,Is)}function Ap(d,p){return d&&Fd(d,p,Is)}function Qh(d,p){return Ma(p,function(_){return ua(d[_])})}function na(d,p){for(var _=0,F=(p=Lc(p,d)).length;null!=d&&_p}function Ld(d,p){return null!=d&&Xi.call(d,p)}function Bd(d,p){return null!=d&&p in Yi(d)}function Mu(d,p,_){for(var F=_?Ph:jl,le=d[0].length,Ae=d.length,He=Ae,Ye=Ct(Ae),ct=1/0,Ft=[];He--;){var Lt=d[He];He&&p&&(Lt=qi(Lt,ta(p))),ct=ps(Lt.length,ct),Ye[He]=!_&&(p||le>=120&&Lt.length>=120)?new Pa(He&&Lt):ee}Lt=d[0];var Gt=-1,nn=Ye[0];e:for(;++Gt=Ye?ct:ct*("desc"==_[F]?-1:1)}return d.index-p.index}(Ae,He,_)});Ct--;)at[Ct]=at[Ct].value;return at}(nT(d,function(Ae,He,Ye){return{criteria:qi(p,function(Ft){return Ft(Ae)}),index:++F,value:Ae}}))}function Cv(d,p,_){for(var F=-1,le=p.length,Ae={};++F-1;)Ye!==d&&Ln.call(Ye,ct,1),Ln.call(d,ct,1);return d}function Jh(d,p){for(var _=d?p.length:0,F=_-1;_--;){var le=p[_];if(_==F||le!==Ae){var Ae=le;jo(le)?Ln.call(d,le,1):Iu(d,le)}}return d}function Hl(d,p){return d+Si(zh()*(p-d+1))}function Dp(d,p){var _="";if(!d||p<1||p>Te)return _;do{p%2&&(_+=d),(p=Si(p/2))&&(d+=d)}while(p);return _}function pi(d,p){return Hp(yT(d,p,so),d+"")}function rT(d){return w_(nh(d))}function xF(d,p){var _=nh(d);return qd(_,Au(p,0,_.length))}function Ip(d,p,_,F){if(!Tr(d))return d;for(var le=-1,Ae=(p=Lc(p,d)).length,He=Ae-1,Ye=d;null!=Ye&&++lele?0:le+p),(_=_>le?le:_)<0&&(_+=le),le=p>_?0:_-p>>>0,p>>>=0;for(var Ae=Ct(le);++F>>1,He=d[Ae];null!==He&&!da(He)&&(_?He<=p:He=200){var Ft=p?null:F_(d);if(Ft)return a_(Ft);He=!1,le=kh,ct=new Pa}else ct=p?[]:Ye;e:for(;++F=F?d:Ms(d,p,_)}var aT=fv||function(d){return Ui.clearTimeout(d)};function Pp(d,p){if(p)return d.slice();var _=d.length,F=hv?hv(_):new d.constructor(_);return d.copy(F),F}function Pu(d){var p=new d.constructor(d.byteLength);return new Id(p).set(new Id(d)),p}function N_(d,p){var _=p?Pu(d.buffer):d.buffer;return new d.constructor(_,d.byteOffset,d.length)}function Bc(d,p){if(d!==p){var _=d!==ee,F=null===d,le=d==d,Ae=da(d),He=p!==ee,Ye=null===p,ct=p==p,Ft=da(p);if(!Ye&&!Ft&&!Ae&&d>p||Ae&&He&&ct&&!Ye&&!Ft||F&&He&&ct||!_&&ct||!le)return 1;if(!F&&!Ae&&!Ft&&d1?_[le-1]:ee,He=le>2?_[2]:ee;for(Ae=d.length>3&&"function"==typeof Ae?(le--,Ae):ee,He&&Ws(_[0],_[1],He)&&(Ae=le<3?ee:Ae,le=1),p=Yi(p);++F-1?le[Ae?p[He]:He]:ee}}function ku(d){return hl(function(p){var _=p.length,F=_,le=Lo.prototype.thru;for(d&&p.reverse();F--;){var Ae=p[F];if("function"!=typeof Ae)throw new Ia(Se);if(le&&!He&&"wrapper"==jp(Ae))var He=new Lo([],!0)}for(F=He?F:_;++F<_;){var Ye=jp(Ae=p[F]),ct="wrapper"==Ye?B_(Ae):ee;He=ct&&Up(ct[0])&&424==ct[1]&&!ct[4].length&&1==ct[9]?He[jp(ct[0])].apply(He,ct[3]):1==Ae.length&&Up(Ae)?He[Ye]():He.thru(Ae)}return function(){var Ft=arguments,Lt=Ft[0];if(He&&1==Ft.length&&On(Lt))return He.plant(Lt).value();for(var Gt=0,nn=_?p[Gt].apply(this,Ft):Lt;++Gt<_;)nn=p[Gt].call(this,nn);return nn}})}function Vc(d,p,_,F,le,Ae,He,Ye,ct,Ft){var Lt=p&X,Gt=1&p,nn=2&p,wn=24&p,Fn=512&p,gi=nn?ee:Gd(d);return function Bn(){for(var mi=arguments.length,Di=Ct(mi),wo=mi;wo--;)Di[wo]=arguments[wo];if(wn)var qs=Wd(Bn),ha=rF(Di,qs);if(F&&(Di=zd(Di,F,le,wn)),Ae&&(Di=Mv(Di,Ae,He,wn)),mi-=ha,wn&&mi1&&Di.reverse(),Lt&&ctYe))return!1;var Ft=Ae.get(d),Lt=Ae.get(p);if(Ft&&Lt)return Ft==p&&Lt==d;var Gt=-1,nn=!0,wn=2&_?new Pa:ee;for(Ae.set(d,p),Ae.set(p,d);++Gt-1&&d%1==0&&d1?"& ":"")+p[F],p=p.join(_>2?", ":" "),d.replace(It,"{\n/* [wrapped with "+p+"] */\n")}(F,function(d,p){return Us(st,function(_){var F="_."+_[0];p&_[1]&&!jl(d,F)&&d.push(F)}),d.sort()}(function(d){var p=d.match(Ot);return p?p[1].split(Qt):[]}(F),_)))}function $_(d){var p=0,_=0;return function(){var F=pF(),le=16-(F-_);if(_=F,le>0){if(++p>=800)return arguments[0]}else p=0;return d.apply(ee,arguments)}}function qd(d,p){var _=-1,F=d.length,le=F-1;for(p=p===ee?F:p;++_1?d[p-1]:ee;return _="function"==typeof _?(d.pop(),_):ee,HT(d,_)});function ty(d){var p=xe(d);return p.__chain__=!0,p}function Xd(d,p){return p(d)}var ny=hl(function(d){var p=d.length,_=p?d[0]:0,F=this.__wrapped__,le=function(Ae){return x_(Ae,d)};return!(p>1||this.__actions__.length)&&F instanceof fi&&jo(_)?((F=F.slice(_,+_+(p?1:0))).__actions__.push({func:Xd,args:[le],thisArg:ee}),new Lo(F,this.__chain__).thru(function(Ae){return p&&!Ae.length&&Ae.push(ee),Ae})):this.thru(le)}),WT=ts(function(d,p,_){Xi.call(d,_)?++d[_]:ll(d,_,1)}),KT=Ov(q_),QT=Ov(Y_);function oy(d,p){return(On(d)?Us:Pc)(d,kn(p,3))}function Wp(d,p){return(On(d)?Sd:C_)(d,kn(p,3))}var JT=ts(function(d,p,_){Xi.call(d,_)?d[_].push(p):ll(d,_,[p])}),cw=pi(function(d,p,_){var F=-1,le="function"==typeof p,Ae=bo(d)?Ct(d.length):[];return Pc(d,function(He){Ae[++F]=le?os(p,He,_):ka(He,p,_)}),Ae}),uw=ts(function(d,p,_){ll(d,_,p)});function pl(d,p){return(On(d)?qi:nT)(d,kn(p,3))}var hw=ts(function(d,p,_){d[_?0:1].push(p)},function(){return[[],[]]}),Yp=pi(function(d,p){if(null==d)return[];var _=p.length;return _>1&&Ws(d,p[0],p[1])?p=[]:_>2&&Ws(p[0],p[1],p[2])&&(p=[p[0]]),Zh(d,Ts(p,1),[])}),Bu=B1||function(){return Ui.Date.now()};function Xp(d,p,_){return p=_?ee:p,Wl(d,X,ee,ee,ee,ee,p=d&&null==p?d.length:p)}function ly(d,p){var _;if("function"!=typeof p)throw new Ia(Se);return d=ti(d),function(){return--d>0&&(_=p.apply(this,arguments)),d<=1&&(p=ee),_}}var cf=pi(function(d,p,_){var F=1;if(_.length){var le=xu(_,Wd(cf));F|=z}return Wl(d,F,p,_,le)}),Qd=pi(function(d,p,_){var F=3;if(_.length){var le=xu(_,Wd(Qd));F|=z}return Wl(p,F,d,_,le)});function bw(d,p,_){var F,le,Ae,He,Ye,ct,Ft=0,Lt=!1,Gt=!1,nn=!0;if("function"!=typeof d)throw new Ia(Se);function wn(Gi){var bl=F,Gc=le;return F=le=ee,Ft=Gi,He=d.apply(Gc,bl)}function Fn(Gi){return Ft=Gi,Ye=nf(mi,p),Lt?wn(Gi):He}function Bn(Gi){var bl=Gi-ct;return ct===ee||bl>=p||bl<0||Gt&&Gi-Ft>=Ae}function mi(){var Gi=Bu();if(Bn(Gi))return Di(Gi);Ye=nf(mi,function(Gi){var aM=p-(Gi-ct);return Gt?ps(aM,Ae-(Gi-Ft)):aM}(Gi))}function Di(Gi){return Ye=ee,nn&&F?wn(Gi):(F=le=ee,He)}function ha(){var Gi=Bu(),bl=Bn(Gi);if(F=arguments,le=this,ct=Gi,bl){if(Ye===ee)return Fn(ct);if(Gt)return aT(Ye),Ye=nf(mi,p),wn(ct)}return Ye===ee&&(Ye=nf(mi,p)),He}return p=vo(p)||0,Tr(_)&&(Lt=!!_.leading,Ae=(Gt="maxWait"in _)?zr(vo(_.maxWait)||0,p):Ae,nn="trailing"in _?!!_.trailing:nn),ha.cancel=function(){Ye!==ee&&aT(Ye),Ft=0,F=ct=le=Ye=ee},ha.flush=function(){return Ye===ee?He:Di(Bu())},ha}var iA=pi(function(d,p){return Xh(d,1,p)}),vw=pi(function(d,p,_){return Xh(d,vo(p)||0,_)});function uf(d,p){if("function"!=typeof d||null!=p&&"function"!=typeof p)throw new Ia(Se);var _=function(){var F=arguments,le=p?p.apply(this,F):F[0],Ae=_.cache;if(Ae.has(le))return Ae.get(le);var He=d.apply(this,F);return _.cache=Ae.set(le,He)||Ae,He};return _.cache=new(uf.Cache||ol),_}function dy(d){if("function"!=typeof d)throw new Ia(Se);return function(){var p=arguments;switch(p.length){case 0:return!d.call(this);case 1:return!d.call(this,p[0]);case 2:return!d.call(this,p[0],p[1]);case 3:return!d.call(this,p[0],p[1],p[2])}return!d.apply(this,p)}}uf.Cache=ol;var rA=oT(function(d,p){var _=(p=1==p.length&&On(p[0])?qi(p[0],ta(kn())):qi(Ts(p,1),ta(kn()))).length;return pi(function(F){for(var le=-1,Ae=ps(F.length,_);++le=p}),gl=Z1(function(){return arguments}())?Z1:function(d){return Ar(d)&&Xi.call(d,"callee")&&!mp.call(d,"callee")},On=Ct.isArray,Tw=an?ta(an):function(d){return Ar(d)&&As(d)==Ze};function bo(d){return null!=d&&fy(d.length)&&!ua(d)}function Cr(d){return Ar(d)&&bo(d)}var ml=as||Fy,Aw=hi?ta(hi):function(d){return Ar(d)&&As(d)==Le};function Ba(d){if(!Ar(d))return!1;var p=As(d);return p==Me||"[object DOMException]"==p||"string"==typeof d.message&&"string"==typeof d.name&&!Jp(d)}function ua(d){if(!Tr(d))return!1;var p=As(d);return p==Ue||p==qe||"[object AsyncFunction]"==p||"[object Proxy]"==p}function Zp(d){return"number"==typeof d&&d==ti(d)}function fy(d){return"number"==typeof d&&d>-1&&d%1==0&&d<=Te}function Tr(d){var p=typeof d;return null!=d&&("object"==p||"function"==p)}function Ar(d){return null!=d&&"object"==typeof d}var pA=ur?ta(ur):function(d){return Ar(d)&&$s(d)==ke};function _A(d){return"number"==typeof d||Ar(d)&&As(d)==q}function Jp(d){if(!Ar(d)||As(d)!=pe)return!1;var p=Oa(d);if(null===p)return!0;var _=Xi.call(p,"constructor")&&p.constructor;return"function"==typeof _&&_ instanceof _&&Sr.call(_)==F1}var Ow=go?ta(go):function(d){return Ar(d)&&As(d)==_t},yA=Mc?ta(Mc):function(d){return Ar(d)&&$s(d)==pt};function gy(d){return"string"==typeof d||!On(d)&&Ar(d)&&As(d)==we}function da(d){return"symbol"==typeof d||Ar(d)&&As(d)==B}var df=ss?ta(ss):function(d){return Ar(d)&&fy(d.length)&&!!rn[As(d)]},Uc=Lp(Sv),my=Lp(function(d,p){return d<=p});function Rw(d){if(!d)return[];if(bo(d))return gy(d)?rl(d):no(d);if(jh&&d[jh])return function(at){for(var Rt,Ct=[];!(Rt=at.next()).done;)Ct.push(Rt.value);return Ct}(d[jh]());var p=$s(d);return(p==ke?cv:p==pt?a_:nh)(d)}function _l(d){return d?(d=vo(d))===te||d===-te?17976931348623157e292*(d<0?-1:1):d==d?d:0:0===d?d:0}function ti(d){var p=_l(d),_=p%1;return p==p?_?p-_:p:0}function _y(d){return d?Au(ti(d),0,ye):0}function vo(d){if("number"==typeof d)return d;if(da(d))return NaN;if(Tr(d)){var p="function"==typeof d.valueOf?d.valueOf():d;d=Tr(p)?p+"":p}if("string"!=typeof d)return 0===d?d:+d;d=lv(d);var _=rr.test(d);return _||Qn.test(d)?av(d.slice(2),_?2:8):Cn.test(d)?NaN:+d}function Pw(d){return Fa(d,ro(d))}function Hi(d){return null==d?"":Vo(d)}var bA=Gl(function(d,p){if(zp(p)||bo(p))Fa(p,Is(p),d);else for(var _ in p)Xi.call(p,_)&&al(d,_,p[_])}),vA=Gl(function(d,p){Fa(p,ro(p),d)}),Zd=Gl(function(d,p,_,F){Fa(p,ro(p),d,F)}),wA=Gl(function(d,p,_,F){Fa(p,Is(p),d,F)}),Nw=hl(x_),xA=pi(function(d,p){d=Yi(d);var _=-1,F=p.length,le=F>2?p[2]:ee;for(le&&Ws(p[0],p[1],le)&&(F=1);++_1),Ae}),Fa(d,L_(d),_),F&&(_=Hs(_,7,Bp));for(var le=p.length;le--;)Iu(_,p[le]);return _}),MA=hl(function(d,p){return null==d?{}:function(d,p){return Cv(d,p,function(_,F){return eg(d,F)})}(d,p)});function Uw(d,p){if(null==d)return{};var _=qi(L_(d),function(F){return[F]});return p=kn(p),Cv(d,_,function(F,le){return p(F,le[0])})}var DA=Fu(Is),Hw=Fu(ro);function nh(d){return null==d?[]:o_(d,Is(d))}var NA=$l(function(d,p,_){return p=p.toLowerCase(),d+(_?wy(p):p)});function wy(d){return ig(Hi(d).toLowerCase())}function Ey(d){return(d=Hi(d))&&d.replace(Ca,sF).replace(n_,"")}var FA=$l(function(d,p,_){return d+(_?"-":"")+p.toLowerCase()}),LA=$l(function(d,p,_){return d+(_?" ":"")+p.toLowerCase()}),GF=Np("toLowerCase"),zA=$l(function(d,p,_){return d+(_?"_":"")+p.toLowerCase()}),Cy=$l(function(d,p,_){return d+(_?" ":"")+ig(p)}),Xw=$l(function(d,p,_){return d+(_?" ":"")+p.toUpperCase()}),ig=Np("toUpperCase");function Dy(d,p,_){return d=Hi(d),(p=_?ee:p)===ee?function(at){return Bl.test(at)}(d)?function(at){return at.match(iv)||[]}(d):function(at){return at.match(zn)||[]}(d):d.match(p)||[]}var Iy=pi(function(d,p){try{return os(d,ee,p)}catch(_){return Ba(_)?_:new Mn(_)}}),Kw=hl(function(d,p){return Us(p,function(_){_=si(_),ll(d,_,cf(d[_],d))}),d});function Oy(d){return function(){return d}}var WF=ku(),Vu=ku(!0);function so(d){return d}function ju(d){return tT("function"==typeof d?d:Hs(d,1))}var Ry=pi(function(d,p){return function(_){return ka(_,d,p)}}),Qw=pi(function(d,p){return function(_){return ka(d,_,p)}});function Py(d,p,_){var F=Is(p),le=Qh(p,F);null==_&&(!Tr(p)||!le.length&&F.length)&&(_=p,p=d,d=this,le=Qh(p,Is(p)));var Ae=!(Tr(_)&&"chain"in _&&!_.chain),He=ua(d);return Us(le,function(Ye){var ct=p[Ye];d[Ye]=ct,He&&(d.prototype[Ye]=function(){var Ft=this.__chain__;if(Ae||Ft){var Lt=d(this.__wrapped__),Gt=Lt.__actions__=no(this.__actions__);return Gt.push({func:ct,args:arguments,thisArg:d}),Lt.__chain__=Ft,Lt}return ct.apply(d,Ur([this.value()],arguments))})}),d}function Ny(){}var XA=kp(qi),KA=kp(ri),Jw=kp(ko);function Uu(d){return oa(d)?r_(si(d)):function(d){return function(p){return na(p,d)}}(d)}var QA=Pv(),ZA=Pv(!0);function Hc(){return[]}function Fy(){return!1}var Hn=k_(function(d,p){return d+p},0),Ly=$d("ceil"),YF=k_(function(d,p){return d/p},1),Kl=$d("floor"),iE=k_(function(d,p){return d*p},1),rE=$d("round"),sE=k_(function(d,p){return d-p},0);return xe.after=function(d,p){if("function"!=typeof p)throw new Ia(Se);return d=ti(d),function(){if(--d<1)return p.apply(this,arguments)}},xe.ary=Xp,xe.assign=bA,xe.assignIn=vA,xe.assignInWith=Zd,xe.assignWith=wA,xe.at=Nw,xe.before=ly,xe.bind=cf,xe.bindAll=Kw,xe.bindKey=Qd,xe.castArray=function(){if(!arguments.length)return[];var d=arguments[0];return On(d)?d:[d]},xe.chain=ty,xe.chunk=function(d,p,_){p=(_?Ws(d,p,_):p===ee)?1:zr(ti(p),0);var F=null==d?0:d.length;if(!F||p<1)return[];for(var le=0,Ae=0,He=Ct(Vt(F/p));lele?0:le+_),(F=F===ee||F>le?le:ti(F))<0&&(F+=le),F=_>F?0:_y(F);_>>0)?(d=Hi(d))&&("string"==typeof p||null!=p&&!Ow(p))&&!(p=Vo(p))&&Fh(d)?ul(rl(d),0,_):d.split(p,_):[]},xe.spread=function(d,p){if("function"!=typeof d)throw new Ia(Se);return p=null==p?0:zr(ti(p),0),pi(function(_){var F=_[p],le=ul(_,0,p);return F&&Ur(le,F),os(d,this,le)})},xe.tail=function(d){var p=null==d?0:d.length;return p?Ms(d,1,p):[]},xe.take=function(d,p,_){return d&&d.length?Ms(d,0,(p=_||p===ee?1:ti(p))<0?0:p):[]},xe.takeRight=function(d,p,_){var F=null==d?0:d.length;return F?Ms(d,(p=F-(p=_||p===ee?1:ti(p)))<0?0:p,F):[]},xe.takeRightWhile=function(d,p){return d&&d.length?Ou(d,kn(p,3),!1,!0):[]},xe.takeWhile=function(d,p){return d&&d.length?Ou(d,kn(p,3)):[]},xe.tap=function(d,p){return p(d),d},xe.throttle=function(d,p,_){var F=!0,le=!0;if("function"!=typeof d)throw new Ia(Se);return Tr(_)&&(F="leading"in _?!!_.leading:F,le="trailing"in _?!!_.trailing:le),bw(d,p,{leading:F,maxWait:p,trailing:le})},xe.thru=Xd,xe.toArray=Rw,xe.toPairs=DA,xe.toPairsIn=Hw,xe.toPath=function(d){return On(d)?qi(d,si):da(d)?[d]:no($v(Hi(d)))},xe.toPlainObject=Pw,xe.transform=function(d,p,_){var F=On(d),le=F||ml(d)||df(d);if(p=kn(p,4),null==_){var Ae=d&&d.constructor;_=le?F?new Ae:[]:Tr(d)&&ua(Ae)?Tu(Oa(d)):{}}return(le?Us:cl)(d,function(He,Ye,ct){return p(_,He,Ye,ct)}),_},xe.unary=function(d){return Xp(d,1)},xe.union=tw,xe.unionBy=jT,xe.unionWith=UT,xe.uniq=function(d){return d&&d.length?kc(d):[]},xe.uniqBy=function(d,p){return d&&d.length?kc(d,kn(p,2)):[]},xe.uniqWith=function(d,p){return p="function"==typeof p?p:ee,d&&d.length?kc(d,ee,p):[]},xe.unset=function(d,p){return null==d||Iu(d,p)},xe.unzip=nw,xe.unzipWith=HT,xe.update=function(d,p,_){return null==d?d:Op(d,p,P_(_))},xe.updateWith=function(d,p,_,F){return F="function"==typeof F?F:ee,null==d?d:Op(d,p,P_(_),F)},xe.values=nh,xe.valuesIn=function(d){return null==d?[]:o_(d,ro(d))},xe.without=iw,xe.words=Dy,xe.wrap=function(d,p){return Kp(P_(p),d)},xe.xor=PF,xe.xorBy=Uo,xe.xorWith=J_,xe.zip=ey,xe.zipObject=function(d,p){return Rp(d||[],p||[],al)},xe.zipObjectDeep=function(d,p){return Rp(d||[],p||[],Ip)},xe.zipWith=lf,xe.entries=DA,xe.entriesIn=Hw,xe.extend=vA,xe.extendWith=Zd,Py(xe,xe),xe.add=Hn,xe.attempt=Iy,xe.camelCase=NA,xe.capitalize=wy,xe.ceil=Ly,xe.clamp=function(d,p,_){return _===ee&&(_=p,p=ee),_!==ee&&(_=(_=vo(_))==_?_:0),p!==ee&&(p=(p=vo(p))==p?p:0),Au(vo(d),p,_)},xe.clone=function(d){return Hs(d,4)},xe.cloneDeep=function(d){return Hs(d,5)},xe.cloneDeepWith=function(d,p){return Hs(d,5,p="function"==typeof p?p:ee)},xe.cloneWith=function(d,p){return Hs(d,4,p="function"==typeof p?p:ee)},xe.conformsTo=function(d,p){return null==p||Tp(d,p,Is(p))},xe.deburr=Ey,xe.defaultTo=function(d,p){return null==d||d!=d?p:d},xe.divide=YF,xe.endsWith=function(d,p,_){d=Hi(d),p=Vo(p);var F=d.length,le=_=_===ee?F:Au(ti(_),0,F);return(_-=p.length)>=0&&d.slice(_,le)==p},xe.eq=Dn,xe.escape=function(d){return(d=Hi(d))&&en.test(d)?d.replace(Sa,oF):d},xe.escapeRegExp=function(d){return(d=Hi(d))&&ut.test(d)?d.replace(Be,"\\$&"):d},xe.every=function(d,p,_){var F=On(d)?ri:vv;return _&&Ws(d,p,_)&&(p=ee),F(d,kn(p,3))},xe.find=KT,xe.findIndex=q_,xe.findKey=function(d,p){return Nh(d,kn(p,3),cl)},xe.findLast=QT,xe.findLastIndex=Y_,xe.findLastKey=function(d,p){return Nh(d,kn(p,3),Ap)},xe.floor=Kl,xe.forEach=oy,xe.forEachRight=Wp,xe.forIn=function(d,p){return null==d?d:kd(d,kn(p,3),ro)},xe.forInRight=function(d,p){return null==d?d:Fd(d,kn(p,3),ro)},xe.forOwn=function(d,p){return d&&cl(d,kn(p,3))},xe.forOwnRight=function(d,p){return d&&Ap(d,kn(p,3))},xe.get=pf,xe.gt=zt,xe.gte=Cw,xe.has=function(d,p){return null!=d&&jv(d,p,Ld)},xe.hasIn=eg,xe.head=qv,xe.identity=so,xe.includes=function(d,p,_,F){d=bo(d)?d:nh(d),_=_&&!F?ti(_):0;var le=d.length;return _<0&&(_=zr(le+_,0)),gy(d)?_<=le&&d.indexOf(p,_)>-1:!!le&&il(d,p,_)>-1},xe.indexOf=function(d,p,_){var F=null==d?0:d.length;if(!F)return-1;var le=null==_?0:ti(_);return le<0&&(le=zr(F+le,0)),il(d,p,le)},xe.inRange=function(d,p,_){return p=_l(p),_===ee?(_=p,p=0):_=_l(_),function(d,p,_){return d>=ps(p,_)&&d=-Te&&d<=Te},xe.isSet=yA,xe.isString=gy,xe.isSymbol=da,xe.isTypedArray=df,xe.isUndefined=function(d){return d===ee},xe.isWeakMap=function(d){return Ar(d)&&$s(d)==V},xe.isWeakSet=function(d){return Ar(d)&&"[object WeakSet]"==As(d)},xe.join=function(d,p){return null==d?"":Uh.call(d,p)},xe.kebabCase=FA,xe.last=aa,xe.lastIndexOf=function(d,p,_){var F=null==d?0:d.length;if(!F)return-1;var le=F;return _!==ee&&(le=(le=ti(_))<0?zr(F+le,0):ps(le,F-1)),p==p?function(at,Rt,Ct){for(var hn=Ct+1;hn--;)if(at[hn]===Rt)return hn;return hn}(d,p,le):Td(d,Dc,le,!0)},xe.lowerCase=LA,xe.lowerFirst=GF,xe.lt=Uc,xe.lte=my,xe.max=function(d){return d&&d.length?Kh(d,so,yo):ee},xe.maxBy=function(d,p){return d&&d.length?Kh(d,kn(p,2),yo):ee},xe.mean=function(d){return Ss(d,so)},xe.meanBy=function(d,p){return Ss(d,kn(p,2))},xe.min=function(d){return d&&d.length?Kh(d,so,Sv):ee},xe.minBy=function(d,p){return d&&d.length?Kh(d,kn(p,2),Sv):ee},xe.stubArray=Hc,xe.stubFalse=Fy,xe.stubObject=function(){return{}},xe.stubString=function(){return""},xe.stubTrue=function(){return!0},xe.multiply=iE,xe.nth=function(d,p){return d&&d.length?Du(d,ti(p)):ee},xe.noConflict=function(){return Ui._===this&&(Ui._=h_),this},xe.noop=Ny,xe.now=Bu,xe.pad=function(d,p,_){d=Hi(d);var F=(p=ti(p))?Lh(d):0;if(!p||F>=p)return d;var le=(p-F)/2;return Fp(Si(le),_)+d+Fp(Vt(le),_)},xe.padEnd=function(d,p,_){d=Hi(d);var F=(p=ti(p))?Lh(d):0;return p&&Fp){var F=d;d=p,p=F}if(_||d%1||p%1){var le=zh();return ps(d+le*(p-d+M1("1e-"+((le+"").length-1))),p)}return Hl(d,p)},xe.reduce=function(d,p,_){var F=On(d)?Eu:ea,le=arguments.length<3;return F(d,kn(p,4),_,le,Pc)},xe.reduceRight=function(d,p,_){var F=On(d)?Cd:ea,le=arguments.length<3;return F(d,kn(p,4),_,le,C_)},xe.repeat=function(d,p,_){return p=(_?Ws(d,p,_):p===ee)?1:ti(p),Dp(Hi(d),p)},xe.replace=function(){var d=arguments,p=Hi(d[0]);return d.length<3?p:p.replace(d[1],d[2])},xe.result=function(d,p,_){var F=-1,le=(p=Lc(p,d)).length;for(le||(le=1,d=ee);++FTe)return[];var _=ye,F=ps(d,ye);p=kn(p),d-=ye;for(var le=Md(F,p);++_=Ae)return d;var Ye=_-Lh(F);if(Ye<1)return F;var ct=He?ul(He,0,Ye).join(""):d.slice(0,Ye);if(le===ee)return ct+F;if(He&&(Ye+=ct.length-Ye),Ow(le)){if(d.slice(Ye).search(le)){var Ft,Lt=ct;for(le.global||(le=u_(le.source,Hi(Xn.exec(le))+"g")),le.lastIndex=0;Ft=le.exec(Lt);)var Gt=Ft.index;ct=ct.slice(0,Gt===ee?Ye:Gt)}}else if(d.indexOf(Vo(le),Ye)!=Ye){var nn=ct.lastIndexOf(le);nn>-1&&(ct=ct.slice(0,nn))}return ct+F},xe.unescape=function(d){return(d=Hi(d))&&ws.test(d)?d.replace(kl,c_):d},xe.uniqueId=function(d){var p=++fF;return Hi(d)+p},xe.upperCase=Xw,xe.upperFirst=ig,xe.each=oy,xe.eachRight=Wp,xe.first=qv,Py(xe,function(){var d={};return cl(xe,function(p,_){Xi.call(xe.prototype,_)||(d[_]=p)}),d}(),{chain:!1}),xe.VERSION="4.17.21",Us(["bind","bindKey","curry","curryRight","partial","partialRight"],function(d){xe[d].placeholder=xe}),Us(["drop","take"],function(d,p){fi.prototype[d]=function(_){_=_===ee?1:zr(ti(_),0);var F=this.__filtered__&&!p?new fi(this):this.clone();return F.__filtered__?F.__takeCount__=ps(_,F.__takeCount__):F.__views__.push({size:ps(_,ye),type:d+(F.__dir__<0?"Right":"")}),F},fi.prototype[d+"Right"]=function(_){return this.reverse()[d](_).reverse()}}),Us(["filter","map","takeWhile"],function(d,p){var _=p+1,F=1==_||3==_;fi.prototype[d]=function(le){var Ae=this.clone();return Ae.__iteratees__.push({iteratee:kn(le,3),type:_}),Ae.__filtered__=Ae.__filtered__||F,Ae}}),Us(["head","last"],function(d,p){var _="take"+(p?"Right":"");fi.prototype[d]=function(){return this[_](1).value()[0]}}),Us(["initial","tail"],function(d,p){var _="drop"+(p?"":"Right");fi.prototype[d]=function(){return this.__filtered__?new fi(this):this[_](1)}}),fi.prototype.compact=function(){return this.filter(so)},fi.prototype.find=function(d){return this.filter(d).head()},fi.prototype.findLast=function(d){return this.reverse().find(d)},fi.prototype.invokeMap=pi(function(d,p){return"function"==typeof d?new fi(this):this.map(function(_){return ka(_,d,p)})}),fi.prototype.reject=function(d){return this.filter(dy(kn(d)))},fi.prototype.slice=function(d,p){d=ti(d);var _=this;return _.__filtered__&&(d>0||p<0)?new fi(_):(d<0?_=_.takeRight(-d):d&&(_=_.drop(d)),p!==ee&&(_=(p=ti(p))<0?_.dropRight(-p):_.take(p-d)),_)},fi.prototype.takeRightWhile=function(d){return this.reverse().takeWhile(d).reverse()},fi.prototype.toArray=function(){return this.take(ye)},cl(fi.prototype,function(d,p){var _=/^(?:filter|find|map|reject)|While$/.test(p),F=/^(?:head|last)$/.test(p),le=xe[F?"take"+("last"==p?"Right":""):p],Ae=F||/^find/.test(p);!le||(xe.prototype[p]=function(){var He=this.__wrapped__,Ye=F?[1]:arguments,ct=He instanceof fi,Ft=Ye[0],Lt=ct||On(He),Gt=function(mi){var Di=le.apply(xe,Ur([mi],Ye));return F&&nn?Di[0]:Di};Lt&&_&&"function"==typeof Ft&&1!=Ft.length&&(ct=Lt=!1);var nn=this.__chain__,wn=!!this.__actions__.length,Fn=Ae&&!nn,gi=ct&&!wn;if(!Ae&&Lt){He=gi?He:new fi(this);var Bn=d.apply(He,Ye);return Bn.__actions__.push({func:Xd,args:[Gt],thisArg:ee}),new Lo(Bn,nn)}return Fn&&gi?d.apply(this,Ye):(Bn=this.thru(Gt),Fn?F?Bn.value()[0]:Bn.value():Bn)})}),Us(["pop","push","shift","sort","splice","unshift"],function(d){var p=dr[d],_=/^(?:push|sort|unshift)$/.test(d)?"tap":"thru",F=/^(?:pop|shift)$/.test(d);xe.prototype[d]=function(){var le=arguments;if(F&&!this.__chain__){var Ae=this.value();return p.apply(On(Ae)?Ae:[],le)}return this[_](function(He){return p.apply(On(He)?He:[],le)})}}),cl(fi.prototype,function(d,p){var _=xe[p];if(_){var F=_.name+"";Xi.call(Od,F)||(Od[F]=[]),Od[F].push({name:p,func:_})}}),Od[Vc(ee,2).name]=[{name:"wrapper",func:ee}],fi.prototype.clone=function(){var d=new fi(this.__wrapped__);return d.__actions__=no(this.__actions__),d.__dir__=this.__dir__,d.__filtered__=this.__filtered__,d.__iteratees__=no(this.__iteratees__),d.__takeCount__=this.__takeCount__,d.__views__=no(this.__views__),d},fi.prototype.reverse=function(){if(this.__filtered__){var d=new fi(this);d.__dir__=-1,d.__filtered__=!0}else(d=this.clone()).__dir__*=-1;return d},fi.prototype.value=function(){var d=this.__wrapped__.value(),p=this.__dir__,_=On(d),F=p<0,le=_?d.length:0,Ae=function(d,p,_){for(var F=-1,le=_.length;++F=this.__values__.length;return{done:d,value:d?ee:this.__values__[this.__index__++]}},xe.prototype.plant=function(d){for(var p,_=this;_ instanceof Wh;){var F=sf(_);F.__index__=0,F.__values__=ee,p?le.__wrapped__=F:p=F;var le=F;_=_.__wrapped__}return le.__wrapped__=d,p},xe.prototype.reverse=function(){var d=this.__wrapped__;if(d instanceof fi){var p=d;return this.__actions__.length&&(p=new fi(this)),(p=p.reverse()).__actions__.push({func:Xd,args:[Z_],thisArg:ee}),new Lo(p,this.__chain__)}return this.thru(Z_)},xe.prototype.toJSON=xe.prototype.valueOf=xe.prototype.value=function(){return sT(this.__wrapped__,this.__actions__)},xe.prototype.first=xe.prototype.head,jh&&(xe.prototype[jh]=function(){return this}),xe}();Ui._=Bh,(yt=function(){return Bh}.call(it,et,it,Ut))!==ee&&(Ut.exports=yt)}.call(this)},5478:function(Ut){Ut.exports=function(){"use strict";function it(rt,lt){for(var ht=0;htrt.length)&&(lt=rt.length);for(var ht=0,ge=new Array(lt);ht=rt.length?{done:!0}:{done:!1,value:rt[ge++]}}}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 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}}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:Y,changeDefaults:function(rt){dt.exports.defaults=rt}};var he=/[&<>"']/,W=/[&<>"']/g,j=/[<>"']|&(?!#?\w+;)/,k=/[<>"']|&(?!#?\w+;)/g,Q={"&":"&","<":"<",">":">",'"':""","'":"'"},H=function(lt){return Q[lt]};var C=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function R(rt){return rt.replace(C,function(lt,ht){return"colon"===(ht=ht.toLowerCase())?":":"#"===ht.charAt(0)?"x"===ht.charAt(1)?String.fromCharCode(parseInt(ht.substring(2),16)):String.fromCharCode(+ht.substring(1)):""})}var T=/(^|[^\[])\^/g;var y=/[^\w:]/g,S=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;var z={},P=/^[^:]+:\/*[^/]*$/,X=/^([^:]+:)[\s\S]*$/,ue=/^([^:]+:\/*[^/]*)[\s\S]*$/;function I(rt,lt){z[" "+rt]||(z[" "+rt]=P.test(rt)?rt+"/":$(rt,"/",!0));var ht=-1===(rt=z[" "+rt]).indexOf(":");return"//"===lt.substring(0,2)?ht?lt:rt.replace(X,"$1")+lt:"/"===lt.charAt(0)?ht?lt:rt.replace(ue,"$1")+lt:rt+lt}function $(rt,lt,ht){var ge=rt.length;if(0===ge)return"";for(var ve=0;ve1;)1<&&(ht+=rt),lt>>=1,rt+=rt;return ht+rt},Te=dt.exports.defaults,me=$,ne=function(rt,lt){var ge=rt.replace(/\|/g,function(Be,ut,Je){for(var Mt=!1,It=ut;--It>=0&&"\\"===Je[It];)Mt=!Mt;return Mt?"|":" |"}).split(/ \|/),ve=0;if(ge.length>lt)ge.splice(lt);else for(;ge.length1?{type:"space",raw:ve[0]}:{raw:"\n"}},lt.code=function(ge){var ve=this.rules.block.code.exec(ge);if(ve){var Be=ve[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:ve[0],codeBlockStyle:"indented",text:this.options.pedantic?Be:me(Be,"\n")}}},lt.fences=function(ge){var ve=this.rules.block.fences.exec(ge);if(ve){var Be=ve[0],ut=function(rt,lt){var ht=rt.match(/^(\s+)(?:```)/);if(null===ht)return lt;var ge=ht[1];return lt.split("\n").map(function(ve){var Be=ve.match(/^\s+/);return null===Be?ve:Be[0].length>=ge.length?ve.slice(ge.length):ve}).join("\n")}(Be,ve[3]||"");return{type:"code",raw:Be,lang:ve[2]?ve[2].trim():ve[2],text:ut}}},lt.heading=function(ge){var ve=this.rules.block.heading.exec(ge);if(ve){var Be=ve[2].trim();if(/#$/.test(Be)){var ut=me(Be,"#");(this.options.pedantic||!ut||/ $/.test(ut))&&(Be=ut.trim())}return{type:"heading",raw:ve[0],depth:ve[1].length,text:Be}}},lt.nptable=function(ge){var ve=this.rules.block.nptable.exec(ge);if(ve){var Be={type:"table",header:ne(ve[1].replace(/^ *| *\| *$/g,"")),align:ve[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ve[3]?ve[3].replace(/\n$/,"").split("\n"):[],raw:ve[0]};if(Be.header.length===Be.align.length){var Je,ut=Be.align.length;for(Je=0;Je ?/gm,"");return{type:"blockquote",raw:ve[0],text:Be}}},lt.list=function(ge){var ve=this.rules.block.list.exec(ge);if(ve){var Qt,zn,ci,Rn,bn,Xn,Cn,rr,sr,Be=ve[0],ut=ve[2],Je=ut.length>1,Mt={type:"list",raw:Be,ordered:Je,start:Je?+ut.slice(0,-1):"",loose:!1,items:[]},It=ve[0].match(this.rules.block.item),Ot=!1,Qn=It.length;ci=this.rules.block.listItemStart.exec(It[0]);for(var Wi=0;Wici[1].length:Rn[1].length>=ci[0].length||Rn[1].length>3){It.splice(Wi,2,It[Wi]+(!this.options.pedantic&&Rn[1].length/i.test(ut[0])&&(ve=!1),!Be&&/^<(pre|code|kbd|script)(\s|>)/i.test(ut[0])?Be=!0:Be&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(ut[0])&&(Be=!1),{type:this.options.sanitize?"text":"html",raw:ut[0],inLink:ve,inRawBlock:Be,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ut[0]):ye(ut[0]):ut[0]}},lt.link=function(ge){var ve=this.rules.inline.link.exec(ge);if(ve){var Be=ve[2].trim();if(!this.options.pedantic&&/^$/.test(Be))return;var ut=me(Be.slice(0,-1),"\\");if((Be.length-ut.length)%2==0)return}else{var Je=Oe(ve[2],"()");if(Je>-1){var It=(0===ve[0].indexOf("!")?5:4)+ve[1].length+Je;ve[2]=ve[2].substring(0,Je),ve[0]=ve[0].substring(0,It).trim(),ve[3]=""}}var Ot=ve[2],Qt="";if(this.options.pedantic){var zn=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Ot);zn&&(Ot=zn[1],Qt=zn[3])}else Qt=ve[3]?ve[3].slice(1,-1):"";return Ot=Ot.trim(),/^$/.test(Be)?Ot.slice(1):Ot.slice(1,-1)),$e(ve,{href:Ot&&Ot.replace(this.rules.inline._escapes,"$1"),title:Qt&&Qt.replace(this.rules.inline._escapes,"$1")},ve[0])}},lt.reflink=function(ge,ve){var Be;if((Be=this.rules.inline.reflink.exec(ge))||(Be=this.rules.inline.nolink.exec(ge))){var ut=(Be[2]||Be[1]).replace(/\s+/g," ");if(!(ut=ve[ut.toLowerCase()])||!ut.href){var Je=Be[0].charAt(0);return{type:"text",raw:Je,text:Je}}return $e(Be,ut,Be[0])}},lt.emStrong=function(ge,ve,Be){void 0===Be&&(Be="");var ut=this.rules.inline.emStrong.lDelim.exec(ge);if(ut&&(!ut[3]||!Be.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 Je=ut[1]||ut[2]||"";if(!Je||Je&&(""===Be||this.rules.inline.punctuation.exec(Be))){var It,Ot,Mt=ut[0].length-1,Qt=Mt,zn=0,ci="*"===ut[0][0]?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(ci.lastIndex=0,ve=ve.slice(-1*ge.length+Mt);null!=(ut=ci.exec(ve));)if(It=ut[1]||ut[2]||ut[3]||ut[4]||ut[5]||ut[6]){if(Ot=It.length,ut[3]||ut[4]){Qt+=Ot;continue}if((ut[5]||ut[6])&&Mt%3&&!((Mt+Ot)%3)){zn+=Ot;continue}if(!((Qt-=Ot)>0))return Ot=Math.min(Ot,Ot+Qt+zn),Math.min(Mt,Ot)%2?{type:"em",raw:ge.slice(0,Mt+ut.index+Ot+1),text:ge.slice(1,Mt+ut.index+Ot)}:{type:"strong",raw:ge.slice(0,Mt+ut.index+Ot+1),text:ge.slice(2,Mt+ut.index+Ot-1)}}}}},lt.codespan=function(ge){var ve=this.rules.inline.code.exec(ge);if(ve){var Be=ve[2].replace(/\n/g," "),ut=/[^ ]/.test(Be),Je=/^ /.test(Be)&&/ $/.test(Be);return ut&&Je&&(Be=Be.substring(1,Be.length-1)),Be=ye(Be,!0),{type:"codespan",raw:ve[0],text:Be}}},lt.br=function(ge){var ve=this.rules.inline.br.exec(ge);if(ve)return{type:"br",raw:ve[0]}},lt.del=function(ge){var ve=this.rules.inline.del.exec(ge);if(ve)return{type:"del",raw:ve[0],text:ve[2]}},lt.autolink=function(ge,ve){var ut,Je,Be=this.rules.inline.autolink.exec(ge);if(Be)return Je="@"===Be[2]?"mailto:"+(ut=ye(this.options.mangle?ve(Be[1]):Be[1])):ut=ye(Be[1]),{type:"link",raw:Be[0],text:ut,href:Je,tokens:[{type:"text",raw:ut,text:ut}]}},lt.url=function(ge,ve){var Be;if(Be=this.rules.inline.url.exec(ge)){var ut,Je;if("@"===Be[2])Je="mailto:"+(ut=ye(this.options.mangle?ve(Be[0]):Be[0]));else{var Mt;do{Mt=Be[0],Be[0]=this.rules.inline._backpedal.exec(Be[0])[0]}while(Mt!==Be[0]);ut=ye(Be[0]),Je="www."===Be[1]?"http://"+ut:ut}return{type:"link",raw:Be[0],text:ut,href:Je,tokens:[{type:"text",raw:ut,text:ut}]}}},lt.inlineText=function(ge,ve,Be){var Je,ut=this.rules.inline.text.exec(ge);if(ut)return Je=ve?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ut[0]):ye(ut[0]):ut[0]:ye(this.options.smartypants?Be(ut[0]):ut[0]),{type:"text",raw:ut[0],text:Je}},rt}(),tt=te_noopTest,Xe=te_edit,ze=te_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:tt,table:tt,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=Xe(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=Xe(Le.item,"gm").replace(/bull/g,Le.bullet).getRegex(),Le.listItemStart=Xe(/^( *)(bull) */).replace("bull",Le.bullet).getRegex(),Le.list=Xe(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=Xe(Le.html,"i").replace("comment",Le._comment).replace("tag",Le._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Le.paragraph=Xe(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=Xe(Le.blockquote).replace("paragraph",Le.paragraph).getRegex(),Le.normal=ze({},Le),Le.gfm=ze({},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=Xe(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=Xe(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=ze({},Le.normal,{html:Xe("^ *(?: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:tt,paragraph:Xe(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 Ke={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:tt,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:tt,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~"};Ke.punctuation=Xe(Ke.punctuation).replace(/punctuation/g,Ke._punctuation).getRegex(),Ke.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,Ke.escapedEmSt=/\\\*|\\_/g,Ke._comment=Xe(Le._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),Ke.emStrong.lDelim=Xe(Ke.emStrong.lDelim).replace(/punct/g,Ke._punctuation).getRegex(),Ke.emStrong.rDelimAst=Xe(Ke.emStrong.rDelimAst,"g").replace(/punct/g,Ke._punctuation).getRegex(),Ke.emStrong.rDelimUnd=Xe(Ke.emStrong.rDelimUnd,"g").replace(/punct/g,Ke._punctuation).getRegex(),Ke._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,Ke._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,Ke._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])?)+(?![-_])/,Ke.autolink=Xe(Ke.autolink).replace("scheme",Ke._scheme).replace("email",Ke._email).getRegex(),Ke._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,Ke.tag=Xe(Ke.tag).replace("comment",Ke._comment).replace("attribute",Ke._attribute).getRegex(),Ke._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Ke._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,Ke._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,Ke.link=Xe(Ke.link).replace("label",Ke._label).replace("href",Ke._href).replace("title",Ke._title).getRegex(),Ke.reflink=Xe(Ke.reflink).replace("label",Ke._label).getRegex(),Ke.reflinkSearch=Xe(Ke.reflinkSearch,"g").replace("reflink",Ke.reflink).replace("nolink",Ke.nolink).getRegex(),Ke.normal=ze({},Ke),Ke.pedantic=ze({},Ke.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:Xe(/^!?\[(label)\]\((.*?)\)/).replace("label",Ke._label).getRegex(),reflink:Xe(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Ke._label).getRegex()}),Ke.gfm=ze({},Ke.normal,{escape:Xe(Ke.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&&(ge="x"+ge.toString(16)),lt+="&#"+ge+";";return lt}var je=function(){function rt(ht){this.tokens=[],this.tokens.links=Object.create(null),this.options=ht||qe,this.options.tokenizer=this.options.tokenizer||new Ue,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var ge={block:ke.normal,inline:q.normal};this.options.pedantic?(ge.block=ke.pedantic,ge.inline=q.pedantic):this.options.gfm&&(ge.block=ke.gfm,ge.inline=this.options.breaks?q.breaks:q.gfm),this.tokenizer.rules=ge}rt.lex=function(ge,ve){return new rt(ve).lex(ge)},rt.lexInline=function(ge,ve){return new rt(ve).inlineTokens(ge)};var lt=rt.prototype;return lt.lex=function(ge){return ge=ge.replace(/\r\n|\r/g,"\n").replace(/\t/g," "),this.blockTokens(ge,this.tokens,!0),this.inline(this.tokens),this.tokens},lt.blockTokens=function(ge,ve,Be){var Je,Mt,It,Ot,Qt,zn,ut=this;for(void 0===ve&&(ve=[]),void 0===Be&&(Be=!0),this.options.pedantic&&(ge=ge.replace(/^ +$/gm,""));ge;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(function(Rn){return!!(Je=Rn.call(ut,ge,ve))&&(ge=ge.substring(Je.raw.length),ve.push(Je),!0)}))){if(Je=this.tokenizer.space(ge)){ge=ge.substring(Je.raw.length),Je.type&&ve.push(Je);continue}if(Je=this.tokenizer.code(ge)){ge=ge.substring(Je.raw.length),(Ot=ve[ve.length-1])&&"paragraph"===Ot.type?(Ot.raw+="\n"+Je.raw,Ot.text+="\n"+Je.text):ve.push(Je);continue}if(Je=this.tokenizer.fences(ge)){ge=ge.substring(Je.raw.length),ve.push(Je);continue}if(Je=this.tokenizer.heading(ge)){ge=ge.substring(Je.raw.length),ve.push(Je);continue}if(Je=this.tokenizer.nptable(ge)){ge=ge.substring(Je.raw.length),ve.push(Je);continue}if(Je=this.tokenizer.hr(ge)){ge=ge.substring(Je.raw.length),ve.push(Je);continue}if(Je=this.tokenizer.blockquote(ge)){ge=ge.substring(Je.raw.length),Je.tokens=this.blockTokens(Je.text,[],Be),ve.push(Je);continue}if(Je=this.tokenizer.list(ge)){for(ge=ge.substring(Je.raw.length),It=Je.items.length,Mt=0;Mt=0&&(Rn=Math.min(Rn,Xn))}),Rn<1/0&&Rn>=0&&(Qt=ge.substring(0,Rn+1))}(),Be&&(Je=this.tokenizer.paragraph(Qt))){Ot=ve[ve.length-1],zn&&"paragraph"===Ot.type?(Ot.raw+="\n"+Je.raw,Ot.text+="\n"+Je.text):ve.push(Je),zn=Qt.length!==ge.length,ge=ge.substring(Je.raw.length);continue}if(Je=this.tokenizer.text(ge)){ge=ge.substring(Je.raw.length),(Ot=ve[ve.length-1])&&"text"===Ot.type?(Ot.raw+="\n"+Je.raw,Ot.text+="\n"+Je.text):ve.push(Je);continue}if(ge){var ci="Infinite loop on byte: "+ge.charCodeAt(0);if(this.options.silent){console.error(ci);break}throw new Error(ci)}}return ve},lt.inline=function(ge){var ve,Be,ut,Je,Mt,It,Ot=ge.length;for(ve=0;ve0)for(;null!=(zn=this.tokenizer.rules.inline.reflinkSearch.exec(Qt));)bn.includes(zn[0].slice(zn[0].lastIndexOf("[")+1,-1))&&(Qt=Qt.slice(0,zn.index)+"["+G("a",zn[0].length-2)+"]"+Qt.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(zn=this.tokenizer.rules.inline.blockSkip.exec(Qt));)Qt=Qt.slice(0,zn.index)+"["+G("a",zn[0].length-2)+"]"+Qt.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(zn=this.tokenizer.rules.inline.escapedEmSt.exec(Qt));)Qt=Qt.slice(0,zn.index)+"++"+Qt.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;ge;)if(ci||(Rn=""),ci=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(function(Cn){return!!(Mt=Cn.call(Je,ge,ve))&&(ge=ge.substring(Mt.raw.length),ve.push(Mt),!0)}))){if(Mt=this.tokenizer.escape(ge)){ge=ge.substring(Mt.raw.length),ve.push(Mt);continue}if(Mt=this.tokenizer.tag(ge,Be,ut)){ge=ge.substring(Mt.raw.length),Be=Mt.inLink,ut=Mt.inRawBlock,(It=ve[ve.length-1])&&"text"===Mt.type&&"text"===It.type?(It.raw+=Mt.raw,It.text+=Mt.text):ve.push(Mt);continue}if(Mt=this.tokenizer.link(ge)){ge=ge.substring(Mt.raw.length),"link"===Mt.type&&(Mt.tokens=this.inlineTokens(Mt.text,[],!0,ut)),ve.push(Mt);continue}if(Mt=this.tokenizer.reflink(ge,this.tokens.links)){ge=ge.substring(Mt.raw.length),It=ve[ve.length-1],"link"===Mt.type?(Mt.tokens=this.inlineTokens(Mt.text,[],!0,ut),ve.push(Mt)):It&&"text"===Mt.type&&"text"===It.type?(It.raw+=Mt.raw,It.text+=Mt.text):ve.push(Mt);continue}if(Mt=this.tokenizer.emStrong(ge,Qt,Rn)){ge=ge.substring(Mt.raw.length),Mt.tokens=this.inlineTokens(Mt.text,[],Be,ut),ve.push(Mt);continue}if(Mt=this.tokenizer.codespan(ge)){ge=ge.substring(Mt.raw.length),ve.push(Mt);continue}if(Mt=this.tokenizer.br(ge)){ge=ge.substring(Mt.raw.length),ve.push(Mt);continue}if(Mt=this.tokenizer.del(ge)){ge=ge.substring(Mt.raw.length),Mt.tokens=this.inlineTokens(Mt.text,[],Be,ut),ve.push(Mt);continue}if(Mt=this.tokenizer.autolink(ge,de)){ge=ge.substring(Mt.raw.length),ve.push(Mt);continue}if(!Be&&(Mt=this.tokenizer.url(ge,de))){ge=ge.substring(Mt.raw.length),ve.push(Mt);continue}if(Ot=ge,this.options.extensions&&this.options.extensions.startInline&&function(){var Cn=1/0,rr=ge.slice(1),sr=void 0;Je.options.extensions.startInline.forEach(function(Qn){"number"==typeof(sr=Qn.call(this,rr))&&sr>=0&&(Cn=Math.min(Cn,sr))}),Cn<1/0&&Cn>=0&&(Ot=ge.substring(0,Cn+1))}(),Mt=this.tokenizer.inlineText(Ot,ut,pe)){ge=ge.substring(Mt.raw.length),"_"!==Mt.raw.slice(-1)&&(Rn=Mt.raw.slice(-1)),ci=!0,(It=ve[ve.length-1])&&"text"===It.type?(It.raw+=Mt.raw,It.text+=Mt.text):ve.push(Mt);continue}if(ge){var Xn="Infinite loop on byte: "+ge.charCodeAt(0);if(this.options.silent){console.error(Xn);break}throw new Error(Xn)}}return ve},function(rt,lt,ht){lt&&it(rt.prototype,lt),ht&&it(rt,ht)}(rt,null,[{key:"rules",get:function(){return{block:ke,inline:q}}}]),rt}(),_t=dt.exports.defaults,pt=te_cleanUrl,we=te_escape,B=function(){function rt(ht){this.options=ht||_t}var lt=rt.prototype;return lt.code=function(ge,ve,Be){var ut=(ve||"").match(/\S*/)[0];if(this.options.highlight){var Je=this.options.highlight(ge,ut);null!=Je&&Je!==ge&&(Be=!0,ge=Je)}return ge=ge.replace(/\n$/,"")+"\n",ut?'
    '+(Be?ge:we(ge,!0))+"
    \n":"
    "+(Be?ge:we(ge,!0))+"
    \n"},lt.blockquote=function(ge){return"
    \n"+ge+"
    \n"},lt.html=function(ge){return ge},lt.heading=function(ge,ve,Be,ut){return this.options.headerIds?"'+ge+"\n":""+ge+"\n"},lt.hr=function(){return this.options.xhtml?"
    \n":"
    \n"},lt.list=function(ge,ve,Be){var ut=ve?"ol":"ul";return"<"+ut+(ve&&1!==Be?' start="'+Be+'"':"")+">\n"+ge+"\n"},lt.listitem=function(ge){return"
  • "+ge+"
  • \n"},lt.checkbox=function(ge){return" "},lt.paragraph=function(ge){return"

    "+ge+"

    \n"},lt.table=function(ge,ve){return ve&&(ve=""+ve+""),"\n\n"+ge+"\n"+ve+"
    \n"},lt.tablerow=function(ge){return"\n"+ge+"\n"},lt.tablecell=function(ge,ve){var Be=ve.header?"th":"td";return(ve.align?"<"+Be+' align="'+ve.align+'">':"<"+Be+">")+ge+"\n"},lt.strong=function(ge){return""+ge+""},lt.em=function(ge){return""+ge+""},lt.codespan=function(ge){return""+ge+""},lt.br=function(){return this.options.xhtml?"
    ":"
    "},lt.del=function(ge){return""+ge+""},lt.link=function(ge,ve,Be){if(null===(ge=pt(this.options.sanitize,this.options.baseUrl,ge)))return Be;var ut='"+Be+""},lt.image=function(ge,ve,Be){if(null===(ge=pt(this.options.sanitize,this.options.baseUrl,ge)))return Be;var ut=''+Be+'":">")},lt.text=function(ge){return ge},rt}(),N=function(){function rt(){}var lt=rt.prototype;return lt.strong=function(ge){return ge},lt.em=function(ge){return ge},lt.codespan=function(ge){return ge},lt.del=function(ge){return ge},lt.html=function(ge){return ge},lt.text=function(ge){return ge},lt.link=function(ge,ve,Be){return""+Be},lt.image=function(ge,ve,Be){return""+Be},lt.br=function(){return""},rt}(),V=function(){function rt(){this.seen={}}var lt=rt.prototype;return lt.serialize=function(ge){return ge.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")},lt.getNextSafeSlug=function(ge,ve){var Be=ge,ut=0;if(this.seen.hasOwnProperty(Be)){ut=this.seen[ge];do{Be=ge+"-"+ ++ut}while(this.seen.hasOwnProperty(Be))}return ve||(this.seen[ge]=ut,this.seen[Be]=0),Be},lt.slug=function(ge,ve){void 0===ve&&(ve={});var Be=this.serialize(ge);return this.getNextSafeSlug(Be,ve.dryrun)},rt}(),Re=B,Ze=N,Tt=V,kt=dt.exports.defaults,In=te_unescape,Yn=je,Mi=function(){function rt(ht){this.options=ht||kt,this.options.renderer=this.options.renderer||new Re,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Ze,this.slugger=new Tt}rt.parse=function(ge,ve){return new rt(ve).parse(ge)},rt.parseInline=function(ge,ve){return new rt(ve).parseInline(ge)};var lt=rt.prototype;return lt.parse=function(ge,ve){void 0===ve&&(ve=!0);var ut,Je,Mt,It,Ot,Qt,zn,ci,Rn,bn,Xn,Cn,rr,sr,Qn,Wi,Ca,Qr,re,Be="",fe=ge.length;for(ut=0;ut0&&"text"===Qn.tokens[0].type?(Qn.tokens[0].text=Qr+" "+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=Qr+" "+Qn.tokens[0].tokens[0].text)):Qn.tokens.unshift({type:"text",text:Qr}):sr+=Qr),sr+=this.parse(Qn.tokens,rr),Rn+=this.renderer.listitem(sr,Ca,Wi);Be+=this.renderer.list(Rn,Xn,Cn);continue;case"html":Be+=this.renderer.html(bn.text);continue;case"paragraph":Be+=this.renderer.paragraph(this.parseInline(bn.tokens));continue;case"text":for(Rn=bn.tokens?this.parseInline(bn.tokens):bn.text;ut+1An error occurred:

    "+xa(Mt.message+"",!0)+"
    ";throw Mt}}return en.options=en.setOptions=function(rt){return Bs(en.defaults,rt),Sa(en.defaults),en},en.getDefaults=kl,en.defaults=ws,en.use=function(){for(var rt=this,lt=arguments.length,ht=new Array(lt),ge=0;geAn error occurred:

    "+xa(ge.message+"",!0)+"
    ";throw ge}},en.Parser=Mi,en.parser=Mi.parse,en.Renderer=Xr,en.TextRenderer=Ls,en.Lexer=Yn,en.lexer=Yn.lex,en.Tokenizer=xi,en.Slugger=fs,en.parse=en,en}()},9369:(Ut,it,et)=>{var yt=et(6284),ee=et(7830);function Dt(){this.clear()}Dt.prototype.clear=function(){this.items=[],this.offset=0,this.size=0},Dt.prototype.enqueue=function(dt){return this.items.push(dt),++this.size},Dt.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}},Dt.prototype.peek=function(){if(this.size)return this.items[this.offset]},Dt.prototype.forEach=function(dt,Y){Y=arguments.length>1?Y:this;for(var Se=this.offset,he=0,W=this.items.length;Se=dt.length)return{done:!0};var Se=dt[Y];return Y++,{value:Se,done:!1}})},Dt.prototype.entries=function(){var dt=this.items,Y=this.offset,Se=0;return new yt(function(){if(Y>=dt.length)return{done:!0};var he=dt[Y];return Y++,{value:[Se++,he],done:!1}})},"undefined"!=typeof Symbol&&(Dt.prototype[Symbol.iterator]=Dt.prototype.values),Dt.prototype.toString=function(){return this.toArray().join(",")},Dt.prototype.toJSON=function(){return this.toArray()},Dt.prototype.inspect=function(){var dt=this.toArray();return Object.defineProperty(dt,"constructor",{value:Dt,enumerable:!1}),dt},"undefined"!=typeof Symbol&&(Dt.prototype[Symbol.for("nodejs.util.inspect.custom")]=Dt.prototype.inspect),Dt.from=function(dt){var Y=new Dt;return ee(dt,function(Se){Y.enqueue(Se)}),Y},Dt.of=function(){return Dt.from(arguments)},Ut.exports=Dt},7830:Ut=>{var it="undefined"!=typeof ArrayBuffer,et="undefined"!=typeof Symbol;function yt(ee,Dt){var dt,Y,Se,he,W;if(!ee)throw new Error("obliterator/forEach: invalid iterable.");if("function"!=typeof Dt)throw new Error("obliterator/forEach: expecting a callback.");if(Array.isArray(ee)||it&&ArrayBuffer.isView(ee)||"string"==typeof ee||"[object Arguments]"===ee.toString())for(Se=0,he=ee.length;Se{function it(et){Object.defineProperty(this,"_next",{writable:!1,enumerable:!1,value:et}),this.done=!1}it.prototype.next=function(){if(this.done)return{done:!0};var et=this._next();return et.done&&(this.done=!0),et},"undefined"!=typeof Symbol&&(it.prototype[Symbol.iterator]=function(){return this}),it.of=function(){var et=arguments,yt=et.length,ee=0;return new it(function(){return ee>=yt?{done:!0}:{done:!1,value:et[ee++]}})},it.empty=function(){var et=new it(null);return et.done=!0,et},it.is=function(et){return et instanceof it||"object"==typeof et&&null!==et&&"function"==typeof et.next},Ut.exports=it},7310:(Ut,it,et)=>{"use strict";var yt=et(1948);Object.defineProperty(it,"__esModule",{value:!0}),it.isMobile=function(){return void 0!==ee.window.orientation},it.default=function(he){if(!he&&!(0,Dt.default)())return"Node";if((0,dt.default)(he))return"Electron";var W="undefined"!=typeof navigator?navigator:{},j=he||W.userAgent||"";if(j.indexOf("Edge")>-1)return"Edge";var k=-1!==j.indexOf("MSIE "),Q=-1!==j.indexOf("Trident/");return k||Q?"IE":ee.window.chrome?"Chrome":ee.window.safari?"Safari":ee.window.mozInnerScreenX?"Firefox":"Unknown"};var ee=et(1151),Dt=yt(et(1602)),dt=yt(et(2344))},1151:(Ut,it,et)=>{"use strict";var yt=et(1948);Object.defineProperty(it,"__esModule",{value:!0}),it.console=it.process=it.document=it.global=it.window=it.self=void 0;var ee=yt(et(4321)),Dt={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,ee.default)(process))&&process};it.self=Dt.self||Dt.window||Dt.global,it.window=Dt.window||Dt.self||Dt.global,it.global=Dt.global||Dt.self||Dt.window,it.document=Dt.document||{},it.process=Dt.process||{};var j=console;it.console=j},4761:(Ut,it,et)=>{"use strict";var ee=et(1948),Dt=et(4321);Object.defineProperty(it,"CO",{enumerable:!0,get:function(){return dt.global}}),Object.defineProperty(it,"qs",{enumerable:!0,get:function(){return Se.default}});var dt=et(1151),Se=(j(et(1602)),j(et(7310)));ee(et(2344));function W(k){if("function"!=typeof WeakMap)return null;var Q=new WeakMap,H=new WeakMap;return(W=function(C){return C?H:Q})(k)}function j(k,Q){if(!Q&&k&&k.__esModule)return k;if(null===k||"object"!==Dt(k)&&"function"!=typeof k)return{default:k};var H=W(Q);if(H&&H.has(k))return H.get(k);var w={},C=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var R in k)if("default"!==R&&Object.prototype.hasOwnProperty.call(k,R)){var T=C?Object.getOwnPropertyDescriptor(k,R):null;T&&(T.get||T.set)?Object.defineProperty(w,R,T):w[R]=k[R]}return w.default=k,H&&H.set(k,w),w}},1602:(Ut,it,et)=>{"use strict";var yt=et(1948);Object.defineProperty(it,"__esModule",{value:!0}),it.default=dt,it.isBrowserMainThread=function(){return dt()&&"undefined"!=typeof document};var ee=yt(et(4321)),Dt=yt(et(2344));function dt(){return!("object"===("undefined"==typeof process?"undefined":(0,ee.default)(process))&&"[object process]"===String(process)&&!process.browser)||(0,Dt.default)()}},2344:(Ut,it,et)=>{"use strict";var yt=et(1948);Object.defineProperty(it,"__esModule",{value:!0}),it.default=function(dt){if("undefined"!=typeof window&&"object"===(0,ee.default)(window.process)&&"renderer"===window.process.type||"undefined"!=typeof process&&"object"===(0,ee.default)(process.versions)&&Boolean(process.versions.electron))return!0;var Y="object"===("undefined"==typeof navigator?"undefined":(0,ee.default)(navigator))&&"string"==typeof navigator.userAgent&&navigator.userAgent,Se=dt||Y;return!!(Se&&Se.indexOf("Electron")>=0)};var ee=yt(et(4321))},6991:function(Ut,it,et){"use strict";var yt=this&&this.__createBinding||(Object.create?function(Dt,dt,Y,Se){void 0===Se&&(Se=Y),Object.defineProperty(Dt,Se,{enumerable:!0,get:function(){return dt[Y]}})}:function(Dt,dt,Y,Se){void 0===Se&&(Se=Y),Dt[Se]=dt[Y]}),ee=this&&this.__exportStar||function(Dt,dt){for(var Y in Dt)"default"!==Y&&!Object.prototype.hasOwnProperty.call(dt,Y)&&yt(dt,Dt,Y)};Object.defineProperty(it,"__esModule",{value:!0}),ee(et(4180),it),ee(et(5103),it),ee(et(8965),it),ee(et(2595),it),ee(et(2417),it),ee(et(2451),it),ee(et(7735),it)},4180:(Ut,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.BlankNode=void 0,it.BlankNode=class{constructor(ee){this.termType="BlankNode",this.value=ee}equals(ee){return!!ee&&"BlankNode"===ee.termType&&ee.value===this.value}}},5103:(Ut,it,et)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.DataFactory=void 0;const yt=et(4180),ee=et(8965),Dt=et(2595),dt=et(2417),Y=et(2451),Se=et(7735);let he=0;it.DataFactory=class{constructor(k){this.blankNodeCounter=0,this.blankNodePrefix=(k=k||{}).blankNodePrefix||`df_${he++}_`}namedNode(k){return new dt.NamedNode(k)}blankNode(k){return new yt.BlankNode(k||`${this.blankNodePrefix}${this.blankNodeCounter++}`)}literal(k,Q){return new Dt.Literal(k,Q)}variable(k){return new Se.Variable(k)}defaultGraph(){return ee.DefaultGraph.INSTANCE}quad(k,Q,H,w){return new Y.Quad(k,Q,H,w||this.defaultGraph())}fromTerm(k){switch(k.termType){case"NamedNode":return this.namedNode(k.value);case"BlankNode":return this.blankNode(k.value);case"Literal":return k.language?this.literal(k.value,k.language):k.datatype.equals(Dt.Literal.XSD_STRING)?this.literal(k.value):this.literal(k.value,this.fromTerm(k.datatype));case"Variable":return this.variable(k.value);case"DefaultGraph":return this.defaultGraph();case"Quad":return this.quad(this.fromTerm(k.subject),this.fromTerm(k.predicate),this.fromTerm(k.object),this.fromTerm(k.graph))}}fromQuad(k){return this.fromTerm(k)}resetBlankNodeCounter(){this.blankNodeCounter=0}}},8965:(Ut,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.DefaultGraph=void 0;class et{constructor(){this.termType="DefaultGraph",this.value=""}equals(ee){return!!ee&&"DefaultGraph"===ee.termType}}it.DefaultGraph=et,et.INSTANCE=new et},2595:(Ut,it,et)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.Literal=void 0;const yt=et(2417);class ee{constructor(dt,Y){this.termType="Literal",this.value=dt,"string"==typeof Y?(this.language=Y,this.datatype=ee.RDF_LANGUAGE_STRING):Y?(this.language="",this.datatype=Y):(this.language="",this.datatype=ee.XSD_STRING)}equals(dt){return!!dt&&"Literal"===dt.termType&&dt.value===this.value&&dt.language===this.language&&dt.datatype.equals(this.datatype)}}it.Literal=ee,ee.RDF_LANGUAGE_STRING=new yt.NamedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),ee.XSD_STRING=new yt.NamedNode("http://www.w3.org/2001/XMLSchema#string")},2417:(Ut,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.NamedNode=void 0,it.NamedNode=class{constructor(ee){this.termType="NamedNode",this.value=ee}equals(ee){return!!ee&&"NamedNode"===ee.termType&&ee.value===this.value}}},2451:(Ut,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.Quad=void 0,it.Quad=class{constructor(ee,Dt,dt,Y){this.termType="Quad",this.value="",this.subject=ee,this.predicate=Dt,this.object=dt,this.graph=Y}equals(ee){return!!ee&&("Quad"===ee.termType||!ee.termType)&&this.subject.equals(ee.subject)&&this.predicate.equals(ee.predicate)&&this.object.equals(ee.object)&&this.graph.equals(ee.graph)}}},7735:(Ut,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.Variable=void 0,it.Variable=class{constructor(ee){this.termType="Variable",this.value=ee}equals(ee){return!!ee&&"Variable"===ee.termType&&ee.value===this.value}}},1609:function(Ut,it,et){"use strict";var yt=this&&this.__createBinding||(Object.create?function(w,C,R,T){void 0===T&&(T=R),Object.defineProperty(w,T,{enumerable:!0,get:function(){return C[R]}})}:function(w,C,R,T){void 0===T&&(T=R),w[T]=C[R]}),ee=this&&this.__exportStar||function(w,C){for(var R in w)"default"!==R&&!Object.prototype.hasOwnProperty.call(C,R)&&yt(C,w,R)};Object.defineProperty(it,"__esModule",{value:!0}),it.getSupportedJavaScriptPrimitives=it.getSupportedRdfDatatypes=it.getTermRaw=it.toRdf=it.fromRdf=void 0;const Dt=et(6991),dt=et(9938),Y=et(6060);ee(et(9938),it),ee(et(8871),it),ee(et(6060),it);const Se=new Dt.DataFactory,he=new Y.Translator;function W(w,C){return he.fromRdf(w,C)}he.registerHandler(new dt.TypeHandlerString,dt.TypeHandlerString.TYPES.map(w=>Se.namedNode(w)),["string"]),he.registerHandler(new dt.TypeHandlerBoolean,[dt.TypeHandlerBoolean.TYPE].map(w=>Se.namedNode(w)),["boolean"]),he.registerHandler(new dt.TypeHandlerNumberDouble,dt.TypeHandlerNumberDouble.TYPES.map(w=>Se.namedNode(w)),["number"]),he.registerHandler(new dt.TypeHandlerNumberInteger,dt.TypeHandlerNumberInteger.TYPES.map(w=>Se.namedNode(w)),["number"]),he.registerHandler(new dt.TypeHandlerDate,dt.TypeHandlerDate.TYPES.map(w=>Se.namedNode(w)),["object"]),it.fromRdf=W,it.toRdf=function(w,C){return C&&"namedNode"in C&&(C={dataFactory:C}),(C=C||{})&&!C.dataFactory&&(C.dataFactory=Se),he.toRdf(w,C)},it.getTermRaw=function(w,C){return"Literal"===w.termType?W(w,C):w.value},it.getSupportedRdfDatatypes=function(){return he.getSupportedRdfDatatypes()},it.getSupportedJavaScriptPrimitives=function(){return he.getSupportedJavaScriptPrimitives()}},8871:(Ut,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0})},6060:(Ut,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(ee){throw new Error(`Invalid RDF ${ee.datatype.value} value: '${ee.value}'`)}registerHandler(ee,Dt,dt){for(const Y of Dt)this.supportedRdfDatatypes.push(Y),this.fromRdfHandlers[Y.value]=ee;for(const Y of dt){let Se=this.toRdfHandlers[Y];Se||(this.toRdfHandlers[Y]=Se=[]),Se.push(ee)}}fromRdf(ee,Dt){const dt=this.fromRdfHandlers[ee.datatype.value];return dt?dt.fromRdf(ee,Dt):ee.value}toRdf(ee,Dt){const dt=this.toRdfHandlers[typeof ee];if(dt)for(const Y of dt){const Se=Y.toRdf(ee,Dt);if(Se)return Se}throw new Error(`Invalid JavaScript value: '${ee}'`)}getSupportedRdfDatatypes(){return this.supportedRdfDatatypes}getSupportedJavaScriptPrimitives(){return Object.keys(this.toRdfHandlers)}}},727:(Ut,it,et)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.TypeHandlerBoolean=void 0;const yt=et(6060);class ee{fromRdf(dt,Y){switch(dt.value){case"true":return!0;case"false":return!1;case"1":return!0;case"0":return!1}return Y&&yt.Translator.incorrectRdfDataType(dt),!1}toRdf(dt,{datatype:Y,dataFactory:Se}){return Se.literal(dt?"true":"false",Y||Se.namedNode(ee.TYPE))}}it.TypeHandlerBoolean=ee,ee.TYPE="http://www.w3.org/2001/XMLSchema#boolean"},2525:(Ut,it,et)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.TypeHandlerDate=void 0;const yt=et(6060);class ee{fromRdf(dt,Y){switch(Y&&!dt.value.match(ee.VALIDATORS[dt.datatype.value.substr(33,dt.datatype.value.length)])&&yt.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 Se=dt.value.split("-");return new Date(0,parseInt(Se[0],10)-1,parseInt(Se[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:Y,dataFactory:Se}){if(Y=Y||Se.namedNode(ee.TYPES[0]),!(dt instanceof Date))return null;const he=dt;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 Se.literal(W,Y)}}it.TypeHandlerDate=ee,ee.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"],ee.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]$/}},8554:(Ut,it,et)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.TypeHandlerNumberDouble=void 0;const yt=et(6060);class ee{fromRdf(dt,Y){const Se=parseFloat(dt.value);return Y&&isNaN(Se)&&yt.Translator.incorrectRdfDataType(dt),Se}toRdf(dt,{datatype:Y,dataFactory:Se}){return Y=Y||Se.namedNode(ee.TYPES[0]),isNaN(dt)?Se.literal("NaN",Y):isFinite(dt)?dt%1==0?null:Se.literal(dt.toExponential(15).replace(/(\d)0*e\+?/,"$1E"),Y):Se.literal(dt>0?"INF":"-INF",Y)}}it.TypeHandlerNumberDouble=ee,ee.TYPES=["http://www.w3.org/2001/XMLSchema#double","http://www.w3.org/2001/XMLSchema#decimal","http://www.w3.org/2001/XMLSchema#float"]},7750:(Ut,it,et)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.TypeHandlerNumberInteger=void 0;const yt=et(6060);class ee{fromRdf(dt,Y){const Se=parseInt(dt.value,10);return Y&&(isNaN(Se)||dt.value.indexOf(".")>=0)&&yt.Translator.incorrectRdfDataType(dt),Se}toRdf(dt,{datatype:Y,dataFactory:Se}){return Se.literal(String(dt),Y||Se.namedNode(dt<=ee.MAX_INT&&dt>=ee.MIN_INT?ee.TYPES[0]:ee.TYPES[1]))}}it.TypeHandlerNumberInteger=ee,ee.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"],ee.MAX_INT=2147483647,ee.MIN_INT=-2147483648},4608:(Ut,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.TypeHandlerString=void 0;class et{fromRdf(ee){return ee.value}toRdf(ee,{datatype:Dt,dataFactory:dt}){return dt.literal(ee,Dt)}}it.TypeHandlerString=et,et.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(Ut,it,et){"use strict";var yt=this&&this.__createBinding||(Object.create?function(Dt,dt,Y,Se){void 0===Se&&(Se=Y),Object.defineProperty(Dt,Se,{enumerable:!0,get:function(){return dt[Y]}})}:function(Dt,dt,Y,Se){void 0===Se&&(Se=Y),Dt[Se]=dt[Y]}),ee=this&&this.__exportStar||function(Dt,dt){for(var Y in Dt)"default"!==Y&&!Object.prototype.hasOwnProperty.call(dt,Y)&&yt(dt,Dt,Y)};Object.defineProperty(it,"__esModule",{value:!0}),ee(et(727),it),ee(et(2525),it),ee(et(8554),it),ee(et(7750),it),ee(et(4608),it)},2829:(Ut,it,et)=>{"use strict";var yt={};et.r(yt),et.d(yt,{decode:()=>Ume,encode:()=>zme});var ee={};et.r(ee),et.d(ee,{decode:()=>qme,encode:()=>Yme});var Dt={};et.r(Dt),et.d(Dt,{decode:()=>Xme,encode:()=>Kme});var dt={};function Y(n){return"function"==typeof n}et.r(dt),et.d(dt,{decode:()=>Qme,encode:()=>Zme});let Se=!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 Se&&console.log("RxJS: Back to a better error behavior. Thank you. <3");Se=n},get useDeprecatedSynchronousErrorHandling(){return Se}};function W(n){setTimeout(()=>{throw n},0)}const j={closed:!0,next(n){},error(n){if(he.useDeprecatedSynchronousErrorHandling)throw n;W(n)},complete(){}},k=Array.isArray||(n=>n&&"number"==typeof n.length);function Q(n){return null!==n&&"object"==typeof n}const w=(()=>{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 C{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 C)t.remove(this);else if(null!==t)for(let o=0;oe.concat(t instanceof w?t.errors:t),[])}C.EMPTY=((n=new C).closed=!0,n);const T="function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random();class y extends C{constructor(e,t,i){switch(super(),this.syncErrorValue=null,this.syncErrorThrown=!1,this.syncErrorThrowable=!1,this.isStopped=!1,arguments.length){case 0:this.destination=j;break;case 1:if(!e){this.destination=j;break}if("object"==typeof e){e instanceof y?(this.syncErrorThrowable=e.syncErrorThrowable,this.destination=e,e.add(this)):(this.syncErrorThrowable=!0,this.destination=new S(this,e));break}default:this.syncErrorThrowable=!0,this.destination=new S(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 S 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!==j&&(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 P="function"==typeof Symbol&&Symbol.observable||"@@observable";function X(n){return n}function ue(...n){return I(n)}function I(n){return 0===n.length?X:1===n.length?n[0]:function(t){return n.reduce((i,r)=>r(i),t)}}let O=(()=>{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(j)}(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=K(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)}[P](){return this}pipe(...t){return 0===t.length?this:I(t)(this)}toPromise(t){return new(t=K(t))((i,r)=>{let s;this.subscribe(o=>s=o,o=>r(o),()=>i(s))})}}return n.create=e=>new n(e),n})();function K(n){if(n||(n=he.Promise||Promise),!n)throw new Error("no Promise impl found");return n}const $=(()=>{function n(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return n.prototype=Object.create(Error.prototype),n})();class Z extends C{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 ae extends y{constructor(e){super(e),this.destination=e}}let oe=(()=>{class n extends O{constructor(){super(),this.observers=[],this.closed=!1,this.isStopped=!1,this.hasError=!1,this.thrownError=null}[T](){return new ae(this)}lift(t){const i=new te(this,this);return i.operator=t,i}next(t){if(this.closed)throw new $;if(!this.isStopped){const{observers:i}=this,r=i.length,s=i.slice();for(let o=0;onew te(e,t),n})();class te extends oe{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):C.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 ne(n,e))}}class ne{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 Oe=n=>e=>{for(let t=0,i=n.length;tn&&"number"==typeof n.length&&"function"!=typeof n;function Ke(n){return!!n&&"function"!=typeof n.subscribe&&"function"==typeof n.then}const Me=n=>{if(n&&"function"==typeof n[P])return(n=>e=>{const t=n[P]();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 Oe(n);if(Ke(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[Qe])return(n=>e=>{const t=n[Qe]();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 ${Q(n)?"an invalid object":`'${n}'`} where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.`;throw new TypeError(t)}};function ke(n,e){return new O(t=>{const i=new C;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 je(n,e){return e?function(n,e){if(null!=n){if(function(n){return n&&"function"==typeof n[P]}(n))return function(n,e){return new O(t=>{const i=new C;return i.add(e.schedule(()=>{const r=n[P]();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(Ke(n))return function(n,e){return new O(t=>{const i=new C;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 ke(n,e);if(function(n){return n&&"function"==typeof n[Qe]}(n)||"string"==typeof n)return function(n,e){if(!n)throw new Error("Iterable cannot be null");return new O(t=>{const i=new C;let r;return i.add(()=>{r&&"function"==typeof r.return&&r.return()}),i.add(e.schedule(()=>{r=n[Qe](),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 O?n:new O(Me(n))}class _t 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 we extends y{notifyNext(e){this.destination.next(e)}notifyError(e){this.destination.error(e)}notifyComplete(){this.destination.complete()}}function N(n,e){if(e.closed)return;if(n instanceof O)return n.subscribe(e);let t;try{t=Me(n)(e)}catch(i){e.error(i)}return t}function V(n,e,t=Number.POSITIVE_INFINITY){return"function"==typeof e?i=>i.pipe(V((r,s)=>je(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 Ze(e,this.project,this.concurrent))}}class Ze extends we{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 kt(n=Number.POSITIVE_INFINITY){return V(X,n)}function In(n,e){return e?ke(n,e):new O(Oe(n))}function Nn(...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 O?n[0]:kt(e)(In(n,t))}function Yn(){return function(e){return e.lift(new Mi(e))}}class Mi{constructor(e){this.connectable=e}call(e,t){const{connectable:i}=this;i._refCount++;const r=new xi(e,i),s=t.subscribe(r);return r.closed||(r.connection=i.connect()),s}}class xi 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 Xr extends O{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 C,e.add(this.source.subscribe(new fs(this.getSubject(),this))),e.closed&&(this._connection=null,e=C.EMPTY)),e}refCount(){return Yn()(this)}}const Ls=(()=>{const n=Xr.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 fs extends ae{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()}}}function xa(n,e){return function(i){let r;if(r="function"==typeof n?n:function(){return n},"function"==typeof e)return i.lift(new kl(r,e));const s=Object.create(i,Ls);return s.source=i,s.subjectFactory=r,s}}class kl{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 Sa(){return new oe}function ws(){return n=>Yn()(xa(Sa)(n))}function en(n){for(let e in n)if(n[e]===en)return e;throw Error("Could not find renamed property on target object.")}function nl(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 lt(n,e){return null==n||""===n?null===e?"":e:null==e||""===e?n:n+" "+e}const ht=en({__forward_ref__:en});function ge(n){return n.__forward_ref__=ge,n.toString=function(){return rt(this())},n}function ve(n){return Be(n)?n():n}function Be(n){return"function"==typeof n&&n.hasOwnProperty(ht)&&n.__forward_ref__===ge}class Je extends Error{constructor(e,t){super(function(n,e){return`${n?`NG0${n}: `:""}${e}`}(e,t)),this.code=e}}function Ot(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():Ot(n)}function bn(n,e){const t=e?` in ${e}`:"";throw new Je("201",`No provider for ${Qt(n)} found${t}`)}function J(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 St(n){return{providers:n.providers||[],imports:n.imports||[]}}function vn(n){return Es(n,fo)||Es(n,Vs)}function Es(n,e){return n.hasOwnProperty(e)?n[e]:null}function Fl(n){return n&&(n.hasOwnProperty(Br)||n.hasOwnProperty(Ac))?n[Br]:null}const fo=en({\u0275prov:en}),Br=en({\u0275inj:en}),Vs=en({ngInjectableDef:en}),Ac=en({ngInjectorDef:en});var xn=(()=>((xn=xn||{})[xn.Default=0]="Default",xn[xn.Host=1]="Host",xn[xn.Self=2]="Self",xn[xn.SkipSelf=4]="SkipSelf",xn[xn.Optional=8]="Optional",xn))();let po;function Ta(n){const e=po;return po=n,e}function Ed(n,e,t){const i=vn(n);return i&&"root"==i.providedIn?void 0===i.value?i.value=i.factory():i.value:t&xn.Optional?null:void 0!==e?e:void bn(rt(n),"Injector")}function De(n){return{toString:n}.toString()}var Ge=(()=>((Ge=Ge||{})[Ge.OnPush=0]="OnPush",Ge[Ge.Default=1]="Default",Ge))(),Xt=(()=>((Xt=Xt||{})[Xt.Emulated=0]="Emulated",Xt[Xt.None=2]="None",Xt[Xt.ShadowDom=3]="ShadowDom",Xt))();const ui="undefined"!=typeof globalThis&&globalThis,Vr="undefined"!=typeof window&&window,Jr="undefined"!=typeof self&&"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&self,xs="undefined"!=typeof global&&global,Zn=ui||xs||Vr||Jr,xd={},er=[],fp=en({\u0275cmp:en}),n_=en({\u0275dir:en}),Oh=en({\u0275pipe:en}),iv=en({\u0275mod:en}),T1=en({\u0275loc:en}),Bl=en({\u0275fac:en}),Rh=en({__NG_ELEMENT_ID__:en});let A1=0;function rn(n){return De(()=>{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===Ge.OnPush,directiveDefs:null,pipeDefs:null,selectors:n.selectors||er,viewQuery:n.viewQuery||null,features:n.features||null,data:n.data||{},encapsulation:n.encapsulation||Xt.Emulated,id:"c",styles:n.styles||er,_:null,setInput:null,schemas:n.schemas||null,tView:null},r=n.directives,s=n.features,o=n.pipes;return i.id+=A1++,i.inputs=av(n.inputs,t),i.outputs=av(n.outputs),s&&s.forEach(a=>a(i)),i.directiveDefs=r?()=>("function"==typeof r?r():r).map(rv):null,i.pipeDefs=o?()=>("function"==typeof o?o():o).map(sv):null,i})}function rv(n){return Ui(n)||function(n){return n[n_]||null}(n)}function sv(n){return function(n){return n[Oh]||null}(n)}const ov={};function tn(n){return De(()=>{const e={type:n.type,bootstrap:n.bootstrap||er,declarations:n.declarations||er,imports:n.imports||er,exports:n.exports||er,transitiveCompileScopes:null,schemas:n.schemas||null,id:n.id||null};return null!=n.id&&(ov[n.id]=n.type),e})}function av(n,e){if(null==n)return xd;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 Nt=rn;function js(n){return{type:n.type,name:n.name,factory:null,pure:!1!==n.pure,onDestroy:n.type.prototype.ngOnDestroy||null}}function Ui(n){return n[fp]||null}function No(n,e){const t=n[iv]||null;if(!t&&!0===e)throw new Error(`Type ${rt(n)} does not have '\u0275mod' property.`);return t}function Jo(n){return Array.isArray(n)&&"object"==typeof n[1]}function ea(n){return Array.isArray(n)&&!0===n[1]}function s_(n){return 0!=(8&n.flags)}function Ad(n){return 2==(2&n.flags)}function Md(n){return 1==(1&n.flags)}function Da(n){return null!==n.template}function lv(n){return 0!=(512&n[2])}function Ic(n,e){return n.hasOwnProperty(Bl)?n[Bl]:null}class c_{constructor(e,t,i){this.previousValue=e,this.currentValue=t,this.firstChange=i}isFirstChange(){return this.firstChange}}function Fi(){return dv}function dv(n){return n.type.prototype.ngOnChanges&&(n.setInput=k1),N1}function N1(){const n=at(this),e=null==n?void 0:n.current;if(e){const t=n.previous;if(t===xd)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=at(n)||function(n,e){return n[Bh]=e}(n,{previous:xd,current:null}),s=r.current||(r.current={}),o=r.previous,a=this.declaredInputs[t],l=o[a];s[a]=new c_(l&&l.currentValue,e,o===xd),n[i]=e}Fi.ngInherit=!0;const Bh="__ngSimpleChanges__";function at(n){return n[Bh]||null}let Yi;function dr(n){return!!n.listen}const Su={createRenderer:(n,e)=>void 0!==Yi?Yi:"undefined"!=typeof document?document:void 0};function Sr(n){for(;Array.isArray(n);)n=n[0];return n}function Vh(n,e){return Sr(e[n])}function eo(n,e){return Sr(e[n.index])}function h_(n,e){return n.data[e]}function Dd(n,e){return n[e]}function zs(n,e){const t=e[n];return Jo(t)?t:t[0]}function Ul(n){return 4==(4&n[2])}function Id(n){return 128==(128&n[2])}function Oa(n,e){return null==e?null:n[e]}function f_(n){n[18]=0}function mp(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:Tu(null),bindingsEnabled:!0,isInCheckNoChangesMode:!1};function fv(){return Ln.bindingsEnabled}function Vt(){return Ln.lFrame.lView}function Si(){return Ln.lFrame.tView}function _r(n){return Ln.lFrame.contextLView=n,n[8]}function as(){let n=p_();for(;null!==n&&64===n.type;)n=n.parent;return n}function p_(){return Ln.lFrame.currentTNode}function sl(n,e){const t=Ln.lFrame;t.currentTNode=n,t.isParent=e}function zr(){return Ln.lFrame.isParent}function ps(){Ln.lFrame.isParent=!1}function zh(){return Ln.isInCheckNoChangesMode}function yp(n){Ln.isInCheckNoChangesMode=n}function Cs(){const n=Ln.lFrame;let e=n.bindingRootIndex;return-1===e&&(e=n.bindingRootIndex=n.tView.bindingStartIndex),e}function Ra(){return Ln.lFrame.bindingIndex++}function Fo(n){const e=Ln.lFrame,t=e.bindingIndex;return e.bindingIndex=e.bindingIndex+n,t}function Od(n,e){const t=Ln.lFrame;t.bindingIndex=t.bindingRootIndex=n,g_(e)}function g_(n){Ln.lFrame.currentDirectiveIndex=n}function m_(n){const e=Ln.lFrame.currentDirectiveIndex;return-1===e?null:n[e]}function pv(){return Ln.lFrame.currentQueryIndex}function __(n){Ln.lFrame.currentQueryIndex=n}function vp(n){const e=n[1];return 2===e.type?e.declTNode:1===e.type?n[6]:null}function Rd(n,e,t){if(t&xn.SkipSelf){let r=e,s=n;for(;!(r=r.parent,null!==r||t&xn.Host||(r=vp(s),null===r||(s=s[15],10&r.type))););if(null===r)return!1;e=r,n=s}const i=Ln.lFrame=xe();return i.currentTNode=e,i.lView=n,!0}function $h(n){const e=xe(),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 xe(){const n=Ln.lFrame,e=null===n?null:n.child;return null===e?Tu(n):e}function Tu(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 Wh(){const n=Ln.lFrame;return Ln.lFrame=n.parent,n.currentTNode=null,n.lView=null,n}const Lo=Wh;function fi(){const n=Wh();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 to(){return Ln.lFrame.selectedIndex}function _o(n){Ln.lFrame.selectedIndex=n}function Nr(){const n=Ln.lFrame;return h_(n.tView,n.selectedIndex)}function wp(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 qh{constructor(e,t,i){this.factory=e,this.resolving=!1,this.canSeeViewProviders=t,this.injectImpl=i}}function Sp(n,e,t){const i=dr(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 Nd=!0;function Cp(n){const e=Nd;return Nd=n,e}let x_=0;function Hs(n,e){const t=Tp(n,e);if(-1!==t)return t;const i=e[1];i.firstCreatePass&&(n.injectorIndex=e.length,S_(i.data,n),S_(e,null),S_(i.blueprint,null));const r=Xh(n,e),s=n.injectorIndex;if(yv(r)){const o=Pd(r),a=al(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 S_(n,e){n.push(0,0,0,0,0,0,0,0,e)}function Tp(n,e){return-1===n.injectorIndex||n.parent&&n.parent.injectorIndex===n.injectorIndex||null===e[n.injectorIndex+8]?-1:n.injectorIndex}function Xh(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 Rc(n,e,t){!function(n,e,t){let i;"string"==typeof t?i=t.charCodeAt(0)||0:t.hasOwnProperty(Rh)&&(i=t[Rh]),null==i&&(i=t[Rh]=x_++);const r=255&i;e.data[n+(r>>5)]|=1<=0?255&e:Ev:e}(t);if("function"==typeof s){if(!Rd(e,n,i))return i&xn.Host?C_(r,t,i):vv(e,t,i,r);try{const o=s(i);if(null!=o||i&xn.Optional)return o;bn(t)}finally{Lo()}}else if("number"==typeof s){let o=null,a=Tp(n,e),l=-1,c=i&xn.Host?e[16][6]:null;for((-1===a||i&xn.SkipSelf)&&(l=-1===a?Xh(n,e):e[a+8],-1!==l&&Qh(i,!1)?(o=e[1],a=Pd(l),e=al(l,e)):a=-1);-1!==a;){const u=e[1];if(Ap(s,a,u.data)){const h=Ts(a,e,t,o,i,c);if(h!==wv)return h}l=e[a+8],-1!==l&&Qh(i,e[1].data[a+8]===c)&&Ap(s,a,e)?(o=u,a=Pd(l),e=al(l,e)):a=-1}}}return vv(e,t,i,r)}const wv={};function Ev(){return new na(as(),Vt())}function Ts(n,e,t,i,r,s){const o=e[1],a=o.data[n+8],u=kd(a,o,t,null==i?Ad(a)&&Nd:i!=o&&0!=(3&a.type),r&xn.Host&&s===a);return null!==u?Fd(e,o,u,a):wv}function kd(n,e,t,i,r){const s=n.providerIndexes,o=e.data,a=1048575&s,l=n.directiveStart,u=s>>20,f=r?a+u:n.directiveEnd;for(let g=i?a:a+u;g=l&&m.type===t)return g}if(r){const g=o[l];if(g&&Da(g)&&g.type===t)return l}return null}function Fd(n,e,t,i){let r=n[t];const s=e.data;if(function(n){return n instanceof qh}(r)){const o=r;o.resolving&&function(n,e){throw new Je("200",`Circular dependency in DI detected for ${n}`)}(Qt(s[t]));const a=Cp(o.canSeeViewProviders);o.resolving=!0;const l=o.injectImpl?Ta(o.injectImpl):null;Rd(n,i,xn.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=dv(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&&Ta(l),Cp(a),o.resolving=!1,Lo()}}return r}function Ap(n,e,t){return!!(t[e+(n>>5)]&1<{const e=n.prototype.constructor,t=e[Bl]||As(e),i=Object.prototype;let r=Object.getPrototypeOf(n.prototype).constructor;for(;r&&r!==i;){const s=r[Bl]||As(r);if(s&&s!==t)return s;r=Object.getPrototypeOf(r)}return s=>new s})}function As(n){return Be(n)?()=>{const e=As(ve(n));return e&&e()}:Ic(n)}function yo(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{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,u){const h=l.hasOwnProperty(Bd)?l[Bd]:Object.defineProperty(l,Bd,{value:[]})[Bd];for(;h.length<=u;)h.push(null);return(h[u]=h[u]||[]).push(o),l}}return t&&(r.prototype=Object.create(t.prototype)),r.prototype.ngMetadataName=n,r.annotationCls=r,r})}class Ht{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}`}}const Du=Function;function ia(n,e){void 0===e&&(e=n);for(let t=0;tArray.isArray(t)?ra(t,e):e(t))}function Jh(n,e,t){e>=n.length?n.push(t):n.splice(e,0,t)}function Hl(n,e){return e>=n.length-1?n.pop():n.splice(e,1)[0]}function Nc(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 O_(n,e){const t=Ms(n,e);if(t>=0)return n[1|t]}function Ms(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(Lc,"\n ")}`}("\n"+n.message,r,t,i),n.ngTokenPath=r,n[Fc]=null,n}const Hd=zd(ka("Inject",n=>({token:n})),-1),ts=zd(ka("Optional"),8),dl=zd(ka("SkipSelf"),4);let $d;function Fu(n){var e;return(null===(e=function(){if(void 0===$d&&($d=null,Zn.trustedTypes))try{$d=Zn.trustedTypes.createPolicy("angular",{createHTML:n=>n,createScript:n=>n,createScriptURL:n=>n})}catch(n){}return $d}())||void 0===e?void 0:e.createHTML(n))||n}class ql{constructor(e){this.changingThisBreaksApplicationSecurity=e}toString(){return`SafeValue must use [property]=binding: ${this.changingThisBreaksApplicationSecurity} (see https://g.co/ng/security#xss)`}}class L_ extends ql{getTypeName(){return"HTML"}}class B_ extends ql{getTypeName(){return"Style"}}class jp extends ql{getTypeName(){return"Script"}}class Wd extends ql{getTypeName(){return"URL"}}class kn extends ql{getTypeName(){return"ResourceURL"}}function Gs(n){return n instanceof ql?n.changingThisBreaksApplicationSecurity:n}function sa(n,e){const t=jc(n);if(null!=t&&t!==e){if("ResourceURL"===t&&"URL"===e)return!0;throw new Error(`Required a safe ${e}, got a ${t} (see https://g.co/ng/security#xss)`)}return t===e}function jc(n){return n instanceof ql&&n.getTypeName()||null}class jv{constructor(e){this.inertDocumentHelper=e}getInertBodyElement(e){e=""+e;try{const t=(new window.DOMParser).parseFromString(Fu(e),"text/html").body;return null===t?this.inertDocumentHelper.getInertBodyElement(e):(t.removeChild(t.firstChild),t)}catch(t){return null}}}class fT{constructor(e){if(this.defaultDoc=e,this.inertDocument=this.defaultDoc.implementation.createHTMLDocument("sanitization-inert"),null==this.inertDocument.body){const t=this.inertDocument.createElement("html");this.inertDocument.appendChild(t);const i=this.inertDocument.createElement("body");t.appendChild(i)}}getInertBodyElement(e){const t=this.inertDocument.createElement("template");if("content"in t)return t.innerHTML=Fu(e),t;const i=this.inertDocument.createElement("body");return i.innerHTML=Fu(e),this.defaultDoc.documentMode&&this.stripCustomNsAttrs(i),i}stripCustomNsAttrs(e){const t=e.attributes;for(let r=t.length-1;0jo(e.trim())).join(", ")}function oa(n){const e={};for(const t of n.split(","))e[t]=!0;return e}function tf(...n){const e={};for(const t of n)for(const i in t)t.hasOwnProperty(i)&&(e[i]=!0);return e}const Up=oa("area,br,col,hr,img,wbr"),zv=oa("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr"),Hv=oa("rp,rt"),j_=tf(Up,tf(zv,oa("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")),tf(Hv,oa("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")),tf(Hv,zv)),U_=oa("background,cite,href,itemtype,longdesc,poster,src,xlink:href"),z_=oa("srcset"),H_=tf(U_,z_,oa("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"),oa("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")),bT=oa("script,style,template");class G_{constructor(){this.sanitizedSomething=!1,this.buf=[]}sanitizeChildren(e){let t=e.firstChild,i=!0;for(;t;)if(t.nodeType===Node.ELEMENT_NODE?i=this.startElement(t):t.nodeType===Node.TEXT_NODE?this.chars(t.nodeValue):this.sanitizedSomething=!0,i&&t.firstChild)t=t.firstChild;else for(;t;){t.nodeType===Node.ELEMENT_NODE&&this.endElement(t);let r=this.checkClobberedElement(t,t.nextSibling);if(r){t=r;break}t=this.checkClobberedElement(t,t.parentNode)}return this.buf.join("")}startElement(e){const t=e.nodeName.toLowerCase();if(!j_.hasOwnProperty(t))return this.sanitizedSomething=!0,!bT.hasOwnProperty(t);this.buf.push("<"),this.buf.push(t);const i=e.attributes;for(let r=0;r"),!0}endElement(e){const t=e.nodeName.toLowerCase();j_.hasOwnProperty(t)&&!Up.hasOwnProperty(t)&&(this.buf.push(""))}chars(e){this.buf.push(Hp(e))}checkClobberedElement(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: ${e.outerHTML}`);return t}}const Gv=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,nf=/([^\#-~ |!])/g;function Hp(n){return n.replace(/&/g,"&").replace(Gv,function(e){return"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";"}).replace(nf,function(e){return"&#"+e.charCodeAt(0)+";"}).replace(//g,">")}let rf;function $_(n,e){let t=null;try{rf=rf||function(n){const e=new fT(n);return function(){try{return!!(new window.DOMParser).parseFromString(Fu(""),"text/html")}catch(n){return!1}}()?new jv(e):e}(n);let i=e?String(e):"";t=rf.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=t.innerHTML,t=rf.getInertBodyElement(i)}while(i!==s);return Fu((new G_).sanitizeChildren(qd(t)||t))}finally{if(t){const i=qd(t)||t;for(;i.firstChild;)i.removeChild(i.firstChild)}}}function qd(n){return"content"in n&&function(n){return n.nodeType===Node.ELEMENT_NODE&&"TEMPLATE"===n.nodeName}(n)?n.content:null}var si=(()=>((si=si||{})[si.NONE=0]="NONE",si[si.HTML=1]="HTML",si[si.STYLE=2]="STYLE",si[si.SCRIPT=3]="SCRIPT",si[si.URL=4]="URL",si[si.RESOURCE_URL=5]="RESOURCE_URL",si))();function sf(n){const e=function(){const n=Vt();return n&&n[12]}();return e?e.sanitize(si.URL,n)||"":sa(n,"URL")?Gs(n):jo(Ot(n))}const Y_="__ngContext__";function Ds(n,e){n[Y_]=e}function X_(n){const e=function(n){return n[Y_]||null}(n);return e?Array.isArray(e)?e:e.lView:null}function Gp(n){return n.ngOriginalError}function RT(n,...e){n.error(...e)}class la{constructor(){this._console=console}handleError(e){const t=this._findOriginalError(e),i=this._findContext(e),r=function(n){return n&&n.ngErrorLogger||RT}(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(Gp(e)):null}_findOriginalError(e){let t=e&&Gp(e);for(;t&&Gp(t);)t=Gp(t);return t||null}}const tw=(()=>("undefined"!=typeof requestAnimationFrame&&requestAnimationFrame||setTimeout).bind(Zn))();function fl(n){return n instanceof Function?n():n}var Uo=(()=>((Uo=Uo||{})[Uo.Important=1]="Important",Uo[Uo.DashCase=2]="DashCase",Uo))();function ey(n,e){return undefined(n,e)}function lf(n){const e=n[3];return ea(e)?e[3]:e}function Xd(n){return ow(n[13])}function ny(n){return ow(n[4])}function ow(n){for(;null!==n&&!ea(n);)n=n[4];return n}function Kd(n,e,t,i,r){if(null!=i){let s,o=!1;ea(i)?s=i:Jo(i)&&(o=!0,i=i[0]);const a=Sr(i);0===n&&null!==t?null==r?dw(e,t,a):pl(e,t,a,r||null,!0):1===n&&null!==t?pl(e,t,a,r||null,!0):2===n?function(n,e,t){const i=qp(n,e);i&&function(n,e,t,i){dr(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!==Sr(t)&&Kd(e,n,i,s,r);for(let a=10;a0&&(n[t-1][4]=i[4]);const s=Hl(n,10+e);!function(n,e){Qd(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 oy(n,e){if(!(256&e[2])){const t=e[11];dr(t)&&t.destroyNode&&Qd(n,e,t,3,null,null),function(n){let e=n[13];if(!e)return Wp(n[1],n);for(;e;){let t=null;if(Jo(e))t=e[13];else{const i=e[10];i&&(t=i)}if(!t){for(;e&&!e[4]&&e!==n;)Jo(e)&&Wp(e[1],e),e=e[3];null===e&&(e=n),Jo(e)&&Wp(e[1],e),t=e&&e[4]}e=t}}(e)}}function Wp(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[h+1].toLowerCase();const g=8&i?f:null;if(g&&-1!==uf(g,c,0)||2&i&&c!==f){if(La(i))return!1;o=!0}}}}else{if(!o&&!La(i)&&!La(l))return!1;if(o&&La(l))continue;o=!1,i=l|1&i}}return La(i)||o}function La(n){return 0==(1&n)}function oA(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&&!La(o)&&(e+=Sw(s,r),r=""),i=o,s=s||!La(i);t++}return""!==r&&(e+=Sw(s,r)),e}const Dn={};function zt(n){Cw(Si(),Vt(),to()+n,zh())}function Cw(n,e,t,i){if(!i)if(3==(3&e[2])){const s=n.preOrderCheckHooks;null!==s&&Ep(e,s,t)}else{const s=n.preOrderHooks;null!==s&&xp(e,s,0,t)}_o(t)}function gl(n,e){return n<<17|e<<2}function On(n){return n>>17&32767}function Cr(n){return 2|n}function Yl(n){return(131068&n)>>2}function ml(n,e){return-131069&n|e<<2}function hy(n){return 1|n}function Nw(n,e){const t=n.contentQueries;if(null!==t)for(let i=0;i20&&Cw(n,e,20,zh()),t(i,r)}finally{_o(s)}}function pf(n,e,t){!fv()||(function(n,e,t,i){const r=t.directiveStart,s=t.directiveEnd;n.firstCreatePass||Hs(t,e),Ds(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 $w(n,e){null!==n.hostBindings&&n.hostBindings(1,e)}function Ww(n,e){e.flags|=2,(n.components||(n.components=[])).push(e.index)}function NA(n,e,t){if(t){if(e.exportAs)for(let i=0;i0&&Sy(t)}}function Sy(n){for(let i=Xd(n);null!==i;i=ny(i))for(let r=10;r0&&Sy(s)}const t=n[1].components;if(null!==t)for(let i=0;i0&&Sy(r)}}function UA(n,e){const t=zs(e,n),i=t[1];(function(n,e){for(let t=e.length;tPromise.resolve(null))();function Xw(n){return n[7]||(n[7]=[])}function ig(n){return n.cleanup||(n.cleanup=[])}function Dy(n,e,t){return(null===n||Da(n))&&(t=function(n){for(;Array.isArray(n);){if("object"==typeof n[1])return n;n=n[0]}return null}(t[e.index])),t[11]}function Iy(n,e){const t=n[9],i=t?t.get(la,null):null;i&&i.handleError(e)}function Kw(n,e,t,i,r){for(let s=0;sthis.processProvider(a,e,t)),ra([e],a=>this.processInjectorType(a,[],s)),this.records.set(Vu,Uu(void 0,this));const o=this.records.get(ju);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=Ru,i=xn.Default){this.assertNotDestroyed();const r=Ud(this),s=Ta(void 0);try{if(!(i&xn.SkipSelf)){let a=this.records.get(e);if(void 0===a){const l=function(n){return"function"==typeof n||"object"==typeof n&&n instanceof Ht}(e)&&vn(e);a=l&&this.injectableDefInScope(l)?Uu(ky(e),gf):null,this.records.set(e,a)}if(null!=a)return this.hydrate(e,a)}return(i&xn.Self?Qw():this.parent).get(e,t=i&xn.Optional&&t===Ru?null:t)}catch(o){if("NullInjectorError"===o.name){if((o[Fc]=o[Fc]||[]).unshift(rt(e)),r)throw o;return no(o,e,"R3InjectorError",this.source)}throw o}finally{Ta(s),Ud(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=Fl(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=Fl(s)),null==r)return!1;if(null!=r.imports&&!a){let u;i.push(o);try{ra(r.imports,h=>{this.processInjectorType(h,t,i)&&(void 0===u&&(u=[]),u.push(h))})}finally{}if(void 0!==u)for(let h=0;hthis.processProvider(m,f,g||er))}}this.injectorDefTypes.add(o);const l=Ic(o)||(()=>new o);this.records.set(o,Uu(l,gf));const c=r.providers;if(null!=c&&!a){const u=e;ra(c,h=>this.processProvider(h,u,c))}return void 0!==s&&void 0!==e.providers}processProvider(e,t,i){let r=Hc(e=ve(e))?e:ve(e&&e.provide);const s=function(n,e,t){return eE(n)?Uu(void 0,n.useValue):Uu(Jw(n),gf)}(e);if(Hc(e)||!0!==e.multi)this.records.get(r);else{let o=this.records.get(r);o||(o=Uu(void 0,gf,!0),o.factory=()=>Nu(o.multi),this.records.set(r,o)),r=e,o.multi.push(e)}this.records.set(r,s)}hydrate(e,t){return t.value===gf&&(t.value=YA,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 ky(n){const e=vn(n),t=null!==e?e.factory:Ic(n);if(null!==t)return t;if(n instanceof Ht)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=Nc(e,"?");throw new Error(`Can't resolve all parameters for ${rt(n)}: (${i.join(", ")}).`)}const t=function(n){const e=n&&(n[fo]||n[Vs]);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 Jw(n,e,t){let i;if(Hc(n)){const r=ve(n);return Ic(r)||ky(r)}if(eE(n))i=()=>ve(n.useValue);else if(function(n){return!(!n||!n.useFactory)}(n))i=()=>n.useFactory(...Nu(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 Ic(r)||ky(r);i=()=>new r(...Nu(n.deps))}return i}function Uu(n,e,t=!1){return{factory:n,value:e,multi:t?[]:void 0}}function eE(n){return null!==n&&"object"==typeof n&&Pp in n}function Hc(n){return"function"==typeof n}const tE=function(n,e,t){return function(n,e=null,t=null,i){const r=Zw(n,e,t,i);return r._resolveInjectorDefTypes(),r}({name:t},e,n,t)};class Hn{static create(e,t){return Array.isArray(e)?tE(e,t,""):tE(e.providers,e.parent,e.name||"")}}function Fq(n,e){wp(X_(n)[1],as())}function En(n){let e=function(n){return Object.getPrototypeOf(n.prototype).constructor}(n.type),t=!0;const i=[n];for(;e;){let r;if(Da(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=lM(n.inputs),o.declaredInputs=lM(n.declaredInputs),o.outputs=lM(n.outputs);const a=r.hostBindings;a&&jq(n,a);const l=r.viewQuery,c=r.contentQueries;if(l&&Bq(n,l),c&&Vq(n,c),nl(n.inputs,r.inputs),nl(n.declaredInputs,r.declaredInputs),nl(n.outputs,r.outputs),Da(r)&&r.data.animation){const u=n.data;u.animation=(u.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=Yh(r.hostAttrs,t=Yh(t,r.hostAttrs))}}(i)}function lM(n){return n===xd?{}:n===er?[]:n}function Bq(n,e){const t=n.viewQuery;n.viewQuery=t?(i,r)=>{e(i,r),t(i,r)}:e}function Vq(n,e){const t=n.contentQueries;n.contentQueries=t?(i,r,s)=>{e(i,r,s),t(i,r,s)}:e}function jq(n,e){const t=n.hostBindings;n.hostBindings=t?(i,r)=>{e(i,r),t(i,r)}:e}Hn.THROW_IF_NOT_FOUND=Ru,Hn.NULL=new so,Hn.\u0275prov=We({token:Hn,providedIn:"any",factory:()=>Ie(Vu)}),Hn.__NG_ELEMENT_ID__=-1;let oE=null;function sg(){if(!oE){const n=Zn.Symbol;if(n&&n.iterator)oE=n.iterator;else{const e=Object.getOwnPropertyNames(Map.prototype);for(let t=0;ta(Sr(_e[i.index])):i.index;if(dr(t)){let _e=null;if(!a&&l&&(_e=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!==_e)(_e.__ngLastListenerFn__||_e).__ngNextListenerFn__=s,_e.__ngLastListenerFn__=s,g=!1;else{s=gM(i,e,h,s,!1);const Pe=t.listen(U,r,s);f.push(s,Pe),u&&u.push(r,ie,D,D+1)}}else s=gM(i,e,h,s,!0),U.addEventListener(r,s,o),f.push(s),u&&u.push(r,ie,D,o)}else s=gM(i,e,h,s,!1);const m=i.outputs;let v;if(g&&null!==m&&(v=m[r])){const x=v.length;if(x)for(let U=0;U0;)e=e[15],n--;return e}(n,Ln.lFrame.contextLView))[8]}(n)}function vY(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 Os={textEnd:0,key:0,keyEnd:0,value:0,valueEnd:0};function k2(n){return n.substring(Os.key,Os.keyEnd)}function F2(n,e){const t=Os.textEnd;return t===e?-1:(e=Os.keyEnd=function(n,e,t){for(;e32;)e++;return e}(n,Os.key=e,t),bg(n,e,t))}function bg(n,e,t){for(;e=0;t=F2(e,t))Bo(n,k2(e),!0)}function Jl(n,e,t,i){const r=Vt(),s=Si(),o=Fo(2);s.firstUpdatePass&&z2(s,n,o,i),e!==Dn&&Eo(r,o,e)&&G2(s,s.data[to()],r,r[11],n,r[o+1]=function(n,e){return null==n||("string"==typeof e?n+=e:"object"==typeof n&&(n=rt(Gs(n)))),n}(e,t),i,o)}function U2(n,e){return e>=n.expandoStartIndex}function z2(n,e,t,i){const r=n.data;if(null===r[t+1]){const s=r[to()],o=U2(n,t);W2(s,i)&&null===e&&!o&&(e=!1),e=function(n,e,t,i){const r=m_(n);let s=i?e.residualClasses:e.residualStyles;if(null===r)0===(i?e.classBindings:e.styleBindings)&&(t=Hy(t=_M(null,n,e,t,i),e.attrs,i),s=null);else{const o=e.directiveStylingLast;if(-1===o||n[o]!==r)if(t=_M(r,n,e,t,i),null===s){let l=function(n,e,t){const i=t?e.classBindings:e.styleBindings;if(0!==Yl(i))return n[On(i)]}(n,e,i);void 0!==l&&Array.isArray(l)&&(l=_M(null,n,e,l[1],i),l=Hy(l,e.attrs,i),function(n,e,t,i){n[On(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 u=t;if(r)if(0!==l){const f=On(n[a+1]);n[i+1]=gl(f,a),0!==f&&(n[f+1]=ml(n[f+1],i)),n[a+1]=function(n,e){return 131071&n|e<<17}(n[a+1],i)}else n[i+1]=gl(a,0),0!==a&&(n[a+1]=ml(n[a+1],i)),a=i;else n[i+1]=gl(l,0),0===a?a=i:n[l+1]=ml(n[l+1],i),l=i;c&&(n[i+1]=Cr(n[i+1])),N2(n,u,i,!0),N2(n,u,i,!1),function(n,e,t,i,r){const s=r?n.residualClasses:n.residualStyles;null!=s&&"string"==typeof e&&Ms(s,e)>=0&&(t[i+1]=hy(t[i+1]))}(e,u,n,i,s),o=gl(a,l),s?e.classBindings=o:e.styleBindings=o}(r,s,e,t,o,i)}}function _M(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),u=c?l[1]:l,h=null===u;let f=t[r+1];f===Dn&&(f=h?er:void 0);let g=h?O_(f,i):u===i?f:void 0;if(c&&!hE(g)&&(g=O_(l,i)),hE(g)&&(a=g,o))return a;const m=n[r+1];r=o?On(m):Yl(m)}if(null!==e){let l=s?e.residualClasses:e.residualStyles;null!=l&&(a=O_(l,i))}return a}function hE(n){return void 0!==n}function W2(n,e){return 0!=(n.flags&(e?16:32))}function Jn(n,e=""){const t=Vt(),i=Si(),r=n+20,s=i.firstCreatePass?Jd(i,r,1,e,null):i.data[r],o=t[r]=function(n,e){return dr(n)?n.createText(e):n.createTextNode(e)}(t[11],e);Yp(i,t,o,s),sl(s,!1)}function gs(n){return xo("",n,""),gs}function xo(n,e,t){const i=Vt(),r=ag(i,n,e,t);return r!==Dn&&Xl(i,to(),r),xo}function qc(n,e,t){const i=Vt();return Eo(i,Ra(),e)&&zo(Si(),Nr(),i,n,e,i[11],t,!0),qc}function fE(n,e,t){const i=Vt();if(Eo(i,Ra(),e)){const s=Si(),o=Nr();zo(s,o,i,n,e,Dy(m_(s.data),o,i),t,!0)}return fE}const _f=void 0;var iX=["en",[["a","p"],["AM","PM"],_f],[["AM","PM"],_f,_f],[["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"]],_f,[["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"]],_f,[["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}",_f,"{1} 'at' {0}",_f],[".",",",";","%","+","-","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 vg={};function uL(n){return n in vg||(vg[n]=Zn.ng&&Zn.ng.common&&Zn.ng.common.locales&&Zn.ng.common.locales[n]),vg[n]}var un=(()=>((un=un||{})[un.LocaleId=0]="LocaleId",un[un.DayPeriodsFormat=1]="DayPeriodsFormat",un[un.DayPeriodsStandalone=2]="DayPeriodsStandalone",un[un.DaysFormat=3]="DaysFormat",un[un.DaysStandalone=4]="DaysStandalone",un[un.MonthsFormat=5]="MonthsFormat",un[un.MonthsStandalone=6]="MonthsStandalone",un[un.Eras=7]="Eras",un[un.FirstDayOfWeek=8]="FirstDayOfWeek",un[un.WeekendRange=9]="WeekendRange",un[un.DateFormat=10]="DateFormat",un[un.TimeFormat=11]="TimeFormat",un[un.DateTimeFormat=12]="DateTimeFormat",un[un.NumberSymbols=13]="NumberSymbols",un[un.NumberFormats=14]="NumberFormats",un[un.CurrencyCode=15]="CurrencyCode",un[un.CurrencySymbol=16]="CurrencySymbol",un[un.CurrencyName=17]="CurrencyName",un[un.Currencies=18]="Currencies",un[un.Directionality=19]="Directionality",un[un.PluralCase=20]="PluralCase",un[un.ExtraData=21]="ExtraData",un))();const pE="en-US";let dL=pE;function bM(n){J(n,"Expected localeId to be defined"),"string"==typeof n&&(dL=n.toLowerCase().replace(/_/g,"-"))}function EM(n,e,t,i,r){if(n=ve(n),Array.isArray(n))for(let s=0;s>20;if(Hc(n)||!n.multi){const g=new qh(l,r,Ce),m=SM(a,e,r?u:u+f,h);-1===m?(Rc(Hs(c,o),s,a),xM(s,n,e.length),e.push(a),c.directiveStart++,c.directiveEnd++,r&&(c.providerIndexes+=1048576),t.push(g),o.push(g)):(t[m]=g,o[m]=g)}else{const g=SM(a,e,u+f,h),m=SM(a,e,u,u+f),v=g>=0&&t[g],x=m>=0&&t[m];if(r&&!x||!r&&!v){Rc(Hs(c,o),s,a);const U=function(n,e,t,i,r){const s=new qh(n,t,Ce);return s.multi=[],s.index=e,s.componentProviders=0,kL(s,r,i&&!t),s}(r?eK:JX,t.length,r,i,l);!r&&x&&(t[m].providerFactory=U),xM(s,n,e.length,0),e.push(a),c.directiveStart++,c.directiveEnd++,r&&(c.providerIndexes+=1048576),t.push(U),o.push(U)}else xM(s,n,g>-1?g:m,kL(t[r?m:g],l,!r&&i));!r&&i&&x&&t[m].componentProviders++}}}function xM(n,e,t,i){const r=Hc(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 kL(n,e,t){return t&&n.componentProviders++,n.multi.push(e)-1}function SM(n,e,t,i){for(let r=t;r{t.providersResolver=(i,r)=>function(n,e,t){const i=Si();if(i.firstCreatePass){const r=Da(n);EM(t,i.data,i.blueprint,r,!0),EM(e,i.data,i.blueprint,r,!1)}}(i,r?r(n):n,e)}}class FL{}const BL="ngComponent";class iK{resolveComponentFactory(e){throw function(n){const e=Error(`No component factory found for ${rt(n)}. Did you add it to @NgModule.entryComponents?`);return e[BL]=n,e}(e)}}class El{}function bE(...n){}function Eg(n,e){return new gn(eo(n,e))}El.NULL=new iK;const oK=function(){return Eg(as(),Vt())};let gn=(()=>{class n{constructor(t){this.nativeElement=t}}return n.__NG_ELEMENT_ID__=oK,n})();function VL(n){return n instanceof gn?n.nativeElement:n}class yf{}let AM=(()=>{class n{}return n.\u0275prov=We({token:n,providedIn:"root",factory:()=>null}),n})();class Hu{constructor(e){this.full=e,this.major=e.split(".")[0],this.minor=e.split(".")[1],this.patch=e.split(".").slice(2).join(".")}}const jL=new Hu("12.2.5");class UL{constructor(){}supports(e){return jy(e)}create(e){return new hK(e)}}const dK=(n,e)=>e;class hK{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||dK}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 fK(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 zL),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 zL),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 fK{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 pK{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 zL{constructor(){this.map=new Map}put(e){const t=e.trackById;let i=this.map.get(t);i||(i=new pK,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 HL(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 mK(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 mK{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 $L(){return new xg([new UL])}let xg=(()=>{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||$L()),deps:[[n,new dl,new ts]]}}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:$L}),n})();function WL(){return new Sg([new GL])}let Sg=(()=>{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||WL()),deps:[[n,new dl,new ts]]}}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:WL}),n})();function vE(n,e,t,i,r=!1){for(;null!==t;){const s=e[t.index];if(null!==s&&i.push(Sr(s)),ea(s))for(let a=10;a-1&&(sy(e,i),Hl(t,i))}this._attachedToViewContainer=!1}oy(this._lView[1],this._lView)}onDestroy(e){Bw(this._lView[1],this._lView,null,e)}markForCheck(){Cy(this._cdRefInjectingView||this._lView)}detach(){this._lView[2]&=-129}reattach(){this._lView[2]|=128}detectChanges(){Ay(this._lView[1],this._lView,this.context)}checkNoChanges(){!function(n,e,t){yp(!0);try{Ay(n,e,t)}finally{yp(!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){Qd(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 yK extends Yy{constructor(e){super(e),this._view=e}detectChanges(){Yw(this._view)}checkNoChanges(){!function(n){yp(!0);try{Yw(n)}finally{yp(!1)}}(this._view)}get context(){return null}}const vK=function(n){return function(n,e,t){if(Ad(n)&&!t){const i=zs(n.index,e);return new Yy(i,i)}return 47&n.type?new Yy(e[16],e):null}(as(),Vt(),16==(16&n))};let Mr=(()=>{class n{}return n.__NG_ELEMENT_ID__=vK,n})();const xK=[new GL],CK=new xg([new UL]),TK=new Sg(xK),MK=function(){return wE(as(),Vt())};let Go=(()=>{class n{}return n.__NG_ELEMENT_ID__=MK,n})();const DK=Go,IK=class extends DK{constructor(e,t,i){super(),this._declarationLView=e,this._declarationTContainer=t,this.elementRef=i}createEmbeddedView(e){const t=this._declarationTContainer.tViews,i=hf(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)),ff(t,i,e),new Yy(i)}};function wE(n,e){return 4&n.type?new IK(e,n,Eg(n,e)):null}class Yc{}const PK=function(){return KL(as(),Vt())};let Rs=(()=>{class n{}return n.__NG_ELEMENT_ID__=PK,n})();const kK=Rs,YL=class extends kK{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 na(this._hostTNode,this._hostLView)}get parentInjector(){const e=Xh(this._hostTNode,this._hostLView);if(yv(e)){const t=al(e,this._hostLView),i=Pd(e);return new na(t[1].data[i+8],t)}return new na(null,this._hostLView)}clear(){for(;this.length>0;)this.remove(this.length-1)}get(e){const t=XL(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(Yc,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 ea(n[3])}(i)){const u=this.indexOf(e);if(-1!==u)this.detach(u);else{const h=i[3],f=new YL(h,h[6],h[3]);f.detach(f.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),itw});class b3 extends FL{constructor(e,t){super(),this.componentDef=e,this.ngModule=t,this.componentType=e.type,this.selector=function(n){return n.map(dA).join(",")}(e.selectors),this.ngContentSelectors=e.ngContentSelectors?e.ngContentSelectors:[],this.isBoundToModule=!!t}get inputs(){return y3(this.componentDef.inputs)}get outputs(){return y3(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,Mg,r);return s!==Mg||i===Mg?s:e.get(t,i,r)}}}(e,r.injector):e,o=s.get(yf,Su),a=s.get(AM,null),l=o.createRenderer(null,this.componentDef),c=this.componentDef.selectors[0][0]||"div",u=i?function(n,e,t){if(dr(n))return n.selectRootElement(e,t===Xt.ShadowDom);let i="string"==typeof e?n.querySelector(e):e;return i.textContent="",i}(l,i,this.componentDef.encapsulation):ry(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)),h=this.componentDef.onPush?576:528,f=function(n,e){return{components:[],scheduler:n||tw,clean:WA,playerHandler:e||null,flags:0}}(),g=tg(0,null,null,1,0,null,null,null,null,null),m=hf(null,g,f,h,null,null,o,l,a,s);let v,x;$h(m);try{const U=function(n,e,t,i,r,s){const o=t[1];t[20]=n;const l=Jd(o,20,2,"#host",null),c=l.mergedAttrs=e.hostAttrs;null!==c&&(rg(l,c,!0),null!==n&&(Sp(r,n,c),null!==l.classes&&uy(r,n,l.classes),null!==l.styles&&vw(r,n,l.styles)));const u=i.createRenderer(n,e),h=hf(t,eg(e),null,e.onPush?64:16,t[20],l,i,u,s||null,null);return o.firstCreatePass&&(Rc(Hs(l,t),o,e.type),Ww(o,l),wy(l,t.length,1)),ng(t,h),t[20]=h}(u,this.componentDef,m,o,l);if(u)if(i)Sp(l,u,["ng-version",jL.full]);else{const{attrs:D,classes:ie}=function(n){const e=[],t=[];let i=1,r=2;for(;i0&&uy(l,u,ie.join(" "))}if(x=h_(g,20),void 0!==t){const D=x.projection=[];for(let ie=0;iel(o,e)),e.contentQueries){const l=as();e.contentQueries(1,o,l.directiveStart)}const a=as();return!s.firstCreatePass||null===e.hostBindings&&null===e.hostAttrs||(_o(a.index),Gw(t[1],a,0,a.directiveStart,a.directiveEnd,e),$w(e,o)),o}(U,this.componentDef,m,f,[Fq]),ff(g,m,null)}finally{fi()}return new NQ(this.componentType,v,Eg(x,m),m,x)}}class NQ 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 yK(r),this.componentType=e}get injector(){return new na(this._tNode,this._rootLView)}destroy(){this.hostView.destroy()}onDestroy(e){this.hostView.onDestroy(e)}}const Dg=new Map;class LQ extends Yc{constructor(e,t){super(),this._parent=t,this._bootstrapComponents=[],this.injector=this,this.destroyCbs=[],this.componentFactoryResolver=new _3(this);const i=No(e),r=function(n){return n[T1]||null}(e);r&&bM(r),this._bootstrapComponents=fl(i.bootstrap),this._r3Injector=Zw(e,t,[{provide:Yc,useValue:this},{provide:El,useValue:this.componentFactoryResolver}],rt(e)),this._r3Injector._resolveInjectorDefTypes(),this.instance=this.get(e)}get(e,t=Hn.THROW_IF_NOT_FOUND,i=xn.Default){return e===Hn||e===Yc||e===Vu?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 UM extends class{}{constructor(e){super(),this.moduleType=e,null!==No(e)&&function(n){const e=new Set;!function t(i){const r=No(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,Dg.get(s),i),Dg.set(s,i));const o=fl(r.imports);for(const a of o)e.has(a)||(e.add(a),t(a))}(n)}(e)}create(e){return new LQ(this.moduleType,e)}}function TE(n,e,t){const i=Cs()+n,r=Vt();return r[i]===Dn?$c(r,i,t?e.call(t):e()):function(n,e){return n[e]}(r,i)}function E3(n,e,t,i,r,s){const o=e+t;return Eo(n,o,r)?$c(n,o+1,s?i.call(s,r):i(r)):function(n,e){const t=n[e];return t===Dn?void 0:t}(n,o+1)}function Ps(n,e){const t=Si();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 Je("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=Ic(i.type)),o=Ta(Ce);try{const a=Cp(!1),l=s();return Cp(a),function(n,e,t,i){t>=n.data.length&&(n.data[t]=null,n.blueprint[t]=null),e[t]=i}(t,Vt(),r,l),l}finally{Ta(o)}}function To(n,e,t){const i=n+20,r=Vt(),s=Dd(r,i);return function(n,e){Ql.isWrapped(e)&&(e=Ql.unwrap(e),n[Ln.lFrame.bindingIndex]=Dn);return e}(r,function(n,e){return n[1].data[e].pure}(r,i)?E3(r,Cs(),e,s.transform,t,s):s.transform(t))}function HM(n){return e=>{setTimeout(n,void 0,e)}}const ln=class extends oe{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 h=e;a=null===(r=h.next)||void 0===r?void 0:r.bind(h),l=null===(s=h.error)||void 0===s?void 0:s.bind(h),c=null===(o=h.complete)||void 0===o?void 0:o.bind(h)}this.__isAsync&&(l=HM(l),a&&(a=HM(a)),c&&(c=HM(c)));const u=super.subscribe({next:a,error:l,complete:c});return e instanceof C&&e.add(u),u}};function QQ(){return this._results[sg()]()}class wf{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=sg(),i=wf.prototype;i[t]||(i[t]=QQ)}get changes(){return this._changes||(this._changes=new ln)}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=ia(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],u=e[-l];for(let h=10;h{class n{constructor(t){this.appInits=t,this.resolve=bE,this.reject=bE,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(Ef,8))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const a0=new Ht("AppId"),PZ={provide:a0,useFactory:function(){return`${eD()}${eD()}${eD()}`},deps:[]};function eD(){return String.fromCharCode(97+Math.floor(25*Math.random()))}const X3=new Ht("Platform Initializer"),Xc=new Ht("Platform ID"),IE=new Ht("appBootstrapListener");let OE=(()=>{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 Gu=new Ht("LocaleId"),K3=new Ht("DefaultCurrencyCode");class kZ{constructor(e,t){this.ngModuleFactory=e,this.componentFactories=t}}const tD=function(n){return new UM(n)},FZ=tD,LZ=function(n){return Promise.resolve(tD(n))},Q3=function(n){const e=tD(n),i=fl(No(n).declarations).reduce((r,s)=>{const o=Ui(s);return o&&r.push(new b3(o)),r},[]);return new kZ(e,i)},BZ=Q3,VZ=function(n){return Promise.resolve(Q3(n))};let xf=(()=>{class n{constructor(){this.compileModuleSync=FZ,this.compileModuleAsync=LZ,this.compileModuleAndAllComponentsSync=BZ,this.compileModuleAndAllComponentsAsync=VZ}clearCache(){}clearCacheFor(t){}getModuleId(t){}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const Z3=new Ht("compilerOptions"),UZ=(()=>Promise.resolve(0))();function nD(n){"undefined"==typeof Zone?UZ.then(()=>{n&&n.apply(null,null)}):Zone.current.scheduleMicroTask("scheduleMicrotask",n)}class pn{constructor({enableLongStackTrace:e=!1,shouldCoalesceEventChangeDetection:t=!1,shouldCoalesceRunChangeDetection:i=!1}){if(this.hasPendingMacrotasks=!1,this.hasPendingMicrotasks=!1,this.isStable=!0,this.onUnstable=new ln(!1),this.onMicrotaskEmpty=new ln(!1),this.onStable=new ln(!1),this.onError=new ln(!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=Zn.requestAnimationFrame,e=Zn.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(Zn,()=>{n.fakeTopEventTask||(n.fakeTopEventTask=Zone.root.scheduleEventTask("fakeTopEventTask",()=>{n.lastRequestAnimationFrameId=-1,rD(n),n.isCheckStableRunning=!0,iD(n),n.isCheckStableRunning=!1},void 0,()=>{},()=>{})),n.fakeTopEventTask.invoke()}),rD(n))}(n)};n._inner=n._inner.fork({name:"angular",properties:{isAngularZone:!0},onInvokeTask:(t,i,r,s,o,a)=>{try{return J3(n),t.invokeTask(r,s,o,a)}finally{(n.shouldCoalesceEventChangeDetection&&"eventTask"===s.type||n.shouldCoalesceRunChangeDetection)&&e(),eB(n)}},onInvoke:(t,i,r,s,o,a,l)=>{try{return J3(n),t.invoke(r,s,o,a,l)}finally{n.shouldCoalesceRunChangeDetection&&e(),eB(n)}},onHasTask:(t,i,r,s)=>{t.hasTask(r,s),i===r&&("microTask"==s.change?(n._hasPendingMicrotasks=s.microTask,rD(n),iD(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(!pn.isInAngularZone())throw new Error("Expected to be in Angular Zone, but it is not!")}static assertNotInAngularZone(){if(pn.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,HZ,bE,bE);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 HZ={};function iD(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 rD(n){n.hasPendingMicrotasks=!!(n._hasPendingMicrotasks||(n.shouldCoalesceEventChangeDetection||n.shouldCoalesceRunChangeDetection)&&-1!==n.lastRequestAnimationFrameId)}function J3(n){n._nesting++,n.isStable&&(n.isStable=!1,n.onUnstable.emit(null))}function eB(n){n._nesting--,iD(n)}class WZ{constructor(){this.hasPendingMicrotasks=!1,this.hasPendingMacrotasks=!1,this.isStable=!0,this.onUnstable=new ln,this.onMicrotaskEmpty=new ln,this.onStable=new ln,this.onError=new ln}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 sD=(()=>{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:()=>{pn.assertNotInAngularZone(),nD(()=>{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())nD(()=>{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(pn))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),tB=(()=>{class n{constructor(){this._applications=new Map,oD.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 oD.findTestabilityInTree(this,t,i)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();class qZ{addToWindow(e){}findTestabilityInTree(e,t,i){return null}}let oD=new qZ,nB=!0,iB=!1;function fa(){return iB=!0,nB}let ic;const rB=new Ht("AllowMultipleToken");function sB(n,e,t=[]){const i=`Platform: ${e}`,r=new Ht(i);return(s=[])=>{let o=lD();if(!o||o.injector.get(rB,!1))if(n)n(t.concat(s).concat({provide:r,useValue:!0}));else{const a=t.concat(s).concat({provide:r,useValue:!0},{provide:ju,useValue:"platform"});!function(n){if(ic&&!ic.destroyed&&!ic.injector.get(rB,!1))throw new Error("There can be only one platform. Destroy the previous one to create a new one.");ic=n.get(oB);const e=n.get(X3,null);e&&e.forEach(t=>t())}(Hn.create({providers:a,name:i}))}return function(n){const e=lD();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 lD(){return ic&&!ic.destroyed?ic:null}let oB=(()=>{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 WZ:("zone.js"===n?void 0:n)||new pn({enableLongStackTrace:fa(),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:pn,useValue:a}];return a.run(()=>{const c=Hn.create({providers:l,parent:this.injector,name:t.moduleType.name}),u=t.create(c),h=u.injector.get(la,null);if(!h)throw new Error("No ErrorHandler. Is platform module (BrowserModule) included?");return a.runOutsideAngular(()=>{const f=a.onError.subscribe({next:g=>{h.handleError(g)}});u.onDestroy(()=>{cD(this._modules,u),f.unsubscribe()})}),function(n,e,t){try{const i=t();return yg(i)?i.catch(r=>{throw e.runOutsideAngular(()=>n.handleError(r)),r}):i}catch(i){throw e.runOutsideAngular(()=>n.handleError(i)),i}}(h,a,()=>{const f=u.injector.get(Og);return f.runInitializers(),f.donePromise.then(()=>(bM(u.injector.get(Gu,pE)||pE),this._moduleDoBootstrap(u),u))})})}bootstrapModule(t,i=[]){const r=aB({},i);return function(n,e,t){const i=new UM(t);return Promise.resolve(i)}(0,0,t).then(s=>this.bootstrapModuleFactory(s,r))}_moduleDoBootstrap(t){const i=t.injector.get(sh);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 aB(n,e){return Array.isArray(e)?e.reduce(aB,n):Object.assign(Object.assign({},n),e)}let sh=(()=>{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 O(c=>{this._stable=this._zone.isStable&&!this._zone.hasPendingMacrotasks&&!this._zone.hasPendingMicrotasks,this._zone.runOutsideAngular(()=>{c.next(this._stable),c.complete()})}),l=new O(c=>{let u;this._zone.runOutsideAngular(()=>{u=this._zone.onStable.subscribe(()=>{pn.assertNotInAngularZone(),nD(()=>{!this._stable&&!this._zone.hasPendingMacrotasks&&!this._zone.hasPendingMicrotasks&&(this._stable=!0,c.next(!0))})})});const h=this._zone.onUnstable.subscribe(()=>{pn.assertInAngularZone(),this._stable&&(this._stable=!1,this._zone.runOutsideAngular(()=>{c.next(!1)}))});return()=>{u.unsubscribe(),h.unsubscribe()}});this.isStable=Nn(a,l.pipe(ws()))}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 FL?t:this._componentFactoryResolver.resolveComponentFactory(t),this.componentTypes.push(r.componentType);const s=function(n){return n.isBoundToModule}(r)?void 0:this._injector.get(Yc),a=r.create(Hn.NULL,[],i||r.selector,s),l=a.location.nativeElement,c=a.injector.get(sD,null),u=c&&a.injector.get(tB);return c&&u&&u.registerApplication(l,c),a.onDestroy(()=>{this.detachView(a.hostView),cD(this.components,a),u&&u.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;cD(this._views,i),i.detachFromAppRef()}_loadComponent(t){this.attachView(t.hostView),this.tick(),this.components.push(t),this._injector.get(IE,[]).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(pn),Ie(Hn),Ie(la),Ie(El),Ie(Og))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();function cD(n,e){const t=n.indexOf(e);t>-1&&n.splice(t,1)}const vJ=sB(null,"core",[{provide:Xc,useValue:"unknown"},{provide:oB,deps:[Hn]},{provide:tB,deps:[]},{provide:OE,deps:[]}]),CJ=[{provide:sh,useClass:sh,deps:[pn,Hn,la,El,Og]},{provide:OQ,deps:[pn],useFactory:function(n){let e=[];return n.onStable.subscribe(()=>{for(;e.length;)e.pop()()}),function(t){e.push(t)}}},{provide:Og,useClass:Og,deps:[[new ts,Ef]]},{provide:xf,useClass:xf,deps:[]},PZ,{provide:xg,useFactory:function(){return CK},deps:[]},{provide:Sg,useFactory:function(){return TK},deps:[]},{provide:Gu,useFactory:function(n){return bM(n=n||"undefined"!=typeof $localize&&$localize.locale||pE),n},deps:[[new Hd(Gu),new ts,new dl]]},{provide:K3,useValue:"USD"}];let AJ=(()=>{class n{constructor(t){}}return n.\u0275fac=function(t){return new(t||n)(Ie(sh))},n.\u0275mod=tn({type:n}),n.\u0275inj=St({providers:CJ}),n})(),zE=null;function Kc(){return zE}const fn=new Ht("DocumentToken");let Tf=(()=>{class n{historyGo(t){throw new Error("Not implemented")}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({factory:Tee,token:n,providedIn:"platform"}),n})();function Tee(){return Ie(kB)}let kB=(()=>{class n extends Tf{constructor(t){super(),this._doc=t,this._init()}_init(){this.location=window.location,this._history=window.history}getBaseHrefFromDOM(){return Kc().getBaseHref(this._doc)}onPopState(t){const i=Kc().getGlobalEventTarget(this._doc,"window");return i.addEventListener("popstate",t,!1),()=>i.removeEventListener("popstate",t)}onHashChange(t){const i=Kc().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){FB()?this._history.pushState(t,i,r):this.location.hash=r}replaceState(t,i,r){FB()?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(fn))},n.\u0275prov=We({factory:Mee,token:n,providedIn:"platform"}),n})();function FB(){return!!window.history.pushState}function Mee(){return new kB(Ie(fn))}function SD(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}function LB(n){const e=n.match(/#|\?|$/),t=e&&e.index||n.length;return n.slice(0,t-("/"===n[t-1]?1:0))+n.slice(t)}function Wu(n){return n&&"?"!==n[0]?"?"+n:n}let Ng=(()=>{class n{historyGo(t){throw new Error("Not implemented")}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({factory:Dee,token:n,providedIn:"root"}),n})();function Dee(n){const e=Ie(fn).location;return new BB(Ie(Tf),e&&e.origin||"")}const CD=new Ht("appBaseHref");let BB=(()=>{class n extends Ng{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 SD(this._baseHref,t)}path(t=!1){const i=this._platformLocation.pathname+Wu(this._platformLocation.search),r=this._platformLocation.hash;return r&&t?`${i}${r}`:i}pushState(t,i,r,s){const o=this.prepareExternalUrl(r+Wu(s));this._platformLocation.pushState(t,i,o)}replaceState(t,i,r,s){const o=this.prepareExternalUrl(r+Wu(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(Tf),Ie(CD,8))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),kg=(()=>{class n{constructor(t,i){this._subject=new ln,this._urlChangeListeners=[],this._platformStrategy=t;const r=this._platformStrategy.getBaseHref();this._platformLocation=i,this._baseHref=LB(VB(r)),this._platformStrategy.onPopState(s=>{this._subject.emit({url:this.path(!0),pop:!0,state:s.state,type:s.type})})}path(t=!1){return this.normalize(this._platformStrategy.path(t))}getState(){return this._platformLocation.getState()}isCurrentPathEqualTo(t,i=""){return this.path()==this.normalize(t+Wu(i))}normalize(t){return n.stripTrailingSlash(function(n,e){return n&&e.startsWith(n)?e.substring(n.length):e}(this._baseHref,VB(t)))}prepareExternalUrl(t){return t&&"/"!==t[0]&&(t="/"+t),this._platformStrategy.prepareExternalUrl(t)}go(t,i="",r=null){this._platformStrategy.pushState(r,"",t,i),this._notifyUrlChangeListeners(this.prepareExternalUrl(t+Wu(i)),r)}replaceState(t,i="",r=null){this._platformStrategy.replaceState(r,"",t,i),this._notifyUrlChangeListeners(this.prepareExternalUrl(t+Wu(i)),r)}forward(){this._platformStrategy.forward()}back(){this._platformStrategy.back()}historyGo(t=0){var i,r;null===(r=(i=this._platformStrategy).historyGo)||void 0===r||r.call(i,t)}onUrlChange(t){this._urlChangeListeners.push(t),this._urlChangeSubscription||(this._urlChangeSubscription=this.subscribe(i=>{this._notifyUrlChangeListeners(i.url,i.state)}))}_notifyUrlChangeListeners(t="",i){this._urlChangeListeners.forEach(r=>r(t,i))}subscribe(t,i,r){return this._subject.subscribe({next:t,error:i,complete:r})}}return n.\u0275fac=function(t){return new(t||n)(Ie(Ng),Ie(Tf))},n.normalizeQueryParams=Wu,n.joinWithSlash=SD,n.stripTrailingSlash=LB,n.\u0275prov=We({factory:Oee,token:n,providedIn:"root"}),n})();function Oee(){return new kg(Ie(Ng),Ie(Tf))}function VB(n){return n.replace(/\/index.html$/,"")}var ms=(()=>((ms=ms||{})[ms.Zero=0]="Zero",ms[ms.One=1]="One",ms[ms.Two=2]="Two",ms[ms.Few=3]="Few",ms[ms.Many=4]="Many",ms[ms.Other=5]="Other",ms))();const Vee=function(n){return function(n){const e=function(n){return n.toLowerCase().replace(/_/g,"-")}(n);let t=uL(e);if(t)return t;const i=e.split("-")[0];if(t=uL(i),t)return t;if("en"===i)return iX;throw new Error(`Missing locale data for the locale "${n}".`)}(n)[un.PluralCase]};class ZE{}let pte=(()=>{class n extends ZE{constructor(t){super(),this.locale=t}getPluralCategory(t,i){switch(Vee(i||this.locale)(t)){case ms.Zero:return"zero";case ms.One:return"one";case ms.Two:return"two";case ms.Few:return"few";case ms.Many:return"many";default:return"other"}}}return n.\u0275fac=function(t){return new(t||n)(Ie(Gu))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();function YB(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}class mte{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 Yu=(()=>{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 mte(null,this._ngForOf,-1,-1),null===o?void 0:o),l=new XB(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 XB(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)(Ce(Rs),Ce(Go),Ce(xg))},n.\u0275dir=Nt({type:n,selectors:[["","ngFor","","ngForOf",""]],inputs:{ngForOf:"ngForOf",ngForTrackBy:"ngForTrackBy",ngForTemplate:"ngForTemplate"}}),n})();class XB{constructor(e,t){this.record=e,this.view=t}}let ac=(()=>{class n{constructor(t,i){this._viewContainer=t,this._context=new yte,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){KB("ngIfThen",t),this._thenTemplateRef=t,this._thenViewRef=null,this._updateView()}set ngIfElse(t){KB("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)(Ce(Rs),Ce(Go))},n.\u0275dir=Nt({type:n,selectors:[["","ngIf",""]],inputs:{ngIf:"ngIf",ngIfThen:"ngIfThen",ngIfElse:"ngIfElse"}}),n})();class yte{constructor(){this.$implicit=null,this.ngIf=null}}function KB(n,e){if(e&&!e.createEmbeddedView)throw new Error(`${n} must be a TemplateRef, but received '${rt(e)}'.`)}class Ete{createSubscription(e,t){return e.subscribe({next:t,error:i=>{throw i}})}dispose(e){e.unsubscribe()}onDestroy(e){e.unsubscribe()}}class xte{createSubscription(e,t){return e.then(t,i=>{throw i})}dispose(e){}onDestroy(e){}}const Ste=new xte,Cte=new Ete;let g0=(()=>{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(yg(t))return Ste;if(x2(t))return Cte;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)(Ce(Mr,16))},n.\u0275pipe=js({name:"async",type:n,pure:!1}),n})(),fr=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=tn({type:n}),n.\u0275inj=St({providers:[{provide:ZE,useClass:pte}]}),n})();const iV="browser";function Af(n){return n===iV}class oV{}class BD extends class extends class{}{constructor(){super(...arguments),this.supportsDOMEvents=!0}}{static makeCurrent(){!function(n){zE||(zE=n)}(new BD)}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=(m0=m0||document.querySelector("base"),m0?m0.getAttribute("href"):null);return null==t?null:function(n){ex=ex||document.createElement("a"),ex.setAttribute("href",n);const e=ex.pathname;return"/"===e.charAt(0)?e:`/${e}`}(t)}resetBaseElement(){m0=null}getUserAgent(){return window.navigator.userAgent}getCookie(e){return YB(document.cookie,e)}}let ex,m0=null;const aV=new Ht("TRANSITION_ID"),Xte=[{provide:Ef,useFactory:function(n,e,t){return()=>{t.get(Og).donePromise.then(()=>{const i=Kc(),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},Zn.getAllAngularTestabilities=()=>e.getAllTestabilities(),Zn.getAllAngularRootElements=()=>e.getAllRootElements(),Zn.frameworkStabilizers||(Zn.frameworkStabilizers=[]),Zn.frameworkStabilizers.push(i=>{const r=Zn.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?Kc().isShadowRoot(t)?this.findTestabilityInTree(e,t.host,!0):this.findTestabilityInTree(e,t.parentElement,!0):null}}let Kte=(()=>{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 _0=new Ht("EventManagerPlugins");let nx=(()=>{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})(),y0=(()=>{class n extends cV{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(uV),this._hostNodes.delete(t)}onStylesAdded(t){this._hostNodes.forEach((i,r)=>{this._addStylesToHost(t,r,i)})}ngOnDestroy(){this._hostNodes.forEach(t=>t.forEach(uV))}}return n.\u0275fac=function(t){return new(t||n)(Ie(fn))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();function uV(n){Kc().remove(n)}const UD={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/"},zD=/%COMP%/g;function ix(n,e,t){for(let i=0;i{if("__ngUnwrap__"===e)return n;!1===n(e)&&(e.preventDefault(),e.returnValue=!1)}}let rx=(()=>{class n{constructor(t,i,r){this.eventManager=t,this.sharedStylesHost=i,this.appId=r,this.rendererByCompId=new Map,this.defaultRenderer=new HD(t)}createRenderer(t,i){if(!t||!i)return this.defaultRenderer;switch(i.encapsulation){case Xt.Emulated:{let r=this.rendererByCompId.get(i.id);return r||(r=new dne(this.eventManager,this.sharedStylesHost,i,this.appId),this.rendererByCompId.set(i.id,r)),r.applyToHost(t),r}case 1:case Xt.ShadowDom:return new hne(this.eventManager,this.sharedStylesHost,t,i);default:if(!this.rendererByCompId.has(i.id)){const r=ix(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(nx),Ie(y0),Ie(a0))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();class HD{constructor(e){this.eventManager=e,this.data=Object.create(null)}destroy(){}createElement(e,t){return t?document.createElementNS(UD[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=UD[r];s?e.setAttributeNS(s,t,i):e.setAttribute(t,i)}else e.setAttribute(t,i)}removeAttribute(e,t,i){if(i){const r=UD[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&(Uo.DashCase|Uo.Important)?e.style.setProperty(t,i,r&Uo.Important?"important":""):e.style[t]=i}removeStyle(e,t,i){i&Uo.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,fV(i)):this.eventManager.addEventListener(e,t,fV(i))}}class dne extends HD{constructor(e,t,i,r){super(e),this.component=i;const s=ix(r+"-"+i.id,i.styles,[]);t.addStyles(s),this.contentAttr=function(n){return"_ngcontent-%COMP%".replace(zD,n)}(r+"-"+i.id),this.hostAttr=function(n){return"_nghost-%COMP%".replace(zD,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 hne extends HD{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=ix(r.id,r.styles,[]);for(let o=0;o{class n extends jD{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(fn))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const mV=["alt","control","meta","shift"],vne={"\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"},_V={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"},wne={alt:n=>n.altKey,control:n=>n.ctrlKey,meta:n=>n.metaKey,shift:n=>n.shiftKey};let Ene=(()=>{class n extends jD{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(()=>Kc().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(mV.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&&_V.hasOwnProperty(e)&&(e=_V[e]))}return vne[e]||e}(t);return r=r.toLowerCase()," "===r?r="space":"."===r&&(r="dot"),mV.forEach(s=>{s!=r&&wne[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(fn))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),Mf=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({factory:function(){return Ie($D)},token:n,providedIn:"root"}),n})(),$D=(()=>{class n extends Mf{constructor(t){super(),this._doc=t}sanitize(t,i){if(null==i)return null;switch(t){case si.NONE:return i;case si.HTML:return sa(i,"HTML")?Gs(i):$_(this._doc,String(i)).toString();case si.STYLE:return sa(i,"Style")?Gs(i):i;case si.SCRIPT:if(sa(i,"Script"))return Gs(i);throw new Error("unsafe value used in a script context");case si.URL:return jc(i),sa(i,"URL")?Gs(i):jo(String(i));case si.RESOURCE_URL:if(sa(i,"ResourceURL"))return Gs(i);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(n){return new L_(n)}(t)}bypassSecurityTrustStyle(t){return function(n){return new B_(n)}(t)}bypassSecurityTrustScript(t){return function(n){return new jp(n)}(t)}bypassSecurityTrustUrl(t){return function(n){return new Wd(n)}(t)}bypassSecurityTrustResourceUrl(t){return function(n){return new kn(n)}(t)}}return n.\u0275fac=function(t){return new(t||n)(Ie(fn))},n.\u0275prov=We({factory:function(){return function(n){return new $D(n.get(fn))}(Ie(Vu))},token:n,providedIn:"root"}),n})();const Ine=sB(vJ,"browser",[{provide:Xc,useValue:iV},{provide:X3,useValue:function(){BD.makeCurrent(),VD.init()},multi:!0},{provide:fn,useFactory:function(){return function(n){Yi=n}(document),document},deps:[]}]),One=[[],{provide:ju,useValue:"root"},{provide:la,useFactory:function(){return new la},deps:[]},{provide:_0,useClass:fne,multi:!0,deps:[fn,pn,Xc]},{provide:_0,useClass:Ene,multi:!0,deps:[fn]},[],{provide:rx,useClass:rx,deps:[nx,y0,a0]},{provide:yf,useExisting:rx},{provide:cV,useExisting:y0},{provide:y0,useClass:y0,deps:[fn]},{provide:sD,useClass:sD,deps:[pn]},{provide:nx,useClass:nx,deps:[_0,pn]},{provide:oV,useClass:Kte,deps:[]},[]];let WD=(()=>{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:a0,useValue:t.appId},{provide:aV,useExisting:a0},Xte]}}}return n.\u0275fac=function(t){return new(t||n)(Ie(n,12))},n.\u0275mod=tn({type:n}),n.\u0275inj=St({providers:One,imports:[fr,AJ]}),n})();"undefined"!=typeof window&&window;class Vne extends C{constructor(e,t){super()}schedule(e,t=0){return this}}class sx extends Vne{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 bV=(()=>{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 cc extends bV{constructor(e,t=bV.now){super(e,()=>cc.delegate&&cc.delegate!==this?cc.delegate.now():t()),this.actions=[],this.active=!1,this.scheduled=void 0}schedule(e,t=0,i){return cc.delegate&&cc.delegate!==this?cc.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 zne=new class extends cc{}(class extends sx{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)}}),Qc=new O(n=>n.complete());function b0(n){return n?function(n){return new O(e=>n.schedule(()=>e.complete()))}(n):Qc}function sn(...n){let e=n[n.length-1];return Te(e)?(n.pop(),ke(n,e)):In(n)}function Fg(n,e){return new O(e?t=>e.schedule(Gne,0,{error:n,subscriber:t}):t=>t.error(n))}function Gne({error:n,subscriber:e}){e.error(n)}class ga{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 sn(this.value);case"E":return Fg(this.error);case"C":return b0()}throw new Error("unexpected notification kind value")}static createNext(e){return void 0!==e?new ga("N",e):ga.undefinedValueNotification}static createError(e){return new ga("E",void 0,e)}static createComplete(){return ga.completeNotification}}ga.completeNotification=new ga("C"),ga.undefinedValueNotification=new ga("N",void 0);class ox 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(ox.dispatch,this.delay,new Wne(e,this.destination)))}_next(e){this.scheduleMessage(ga.createNext(e))}_error(e){this.scheduleMessage(ga.createError(e)),this.unsubscribe()}_complete(){this.scheduleMessage(ga.createComplete()),this.unsubscribe()}}class Wne{constructor(e,t){this.notification=e,this.destination=t}}class Df extends oe{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 qne(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 $;if(this.isStopped||this.hasError?o=C.EMPTY:(this.observers.push(e),o=new Z(this,e)),r&&e.add(e=new ox(e,r)),t)for(let a=0;at&&(o=Math.max(o,s-t)),o>0&&r.splice(0,o),r}}class qne{constructor(e,t){this.time=e,this.value=t}}function is(n,e){return"function"==typeof e?t=>t.pipe(is((i,r)=>je(n(i,r)).pipe(me((s,o)=>e(i,s,r,o))))):t=>t.lift(new Yne(n))}class Yne{constructor(e){this.project=e}call(e,t){return t.subscribe(new Xne(e,this.project))}}class Xne extends we{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 _t(this),r=this.destination;r.add(i),this.innerSubscription=N(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 ax={schedule(n,e){const t=setTimeout(n,e);return()=>clearTimeout(t)},scheduleBeforeRender(n){if("undefined"==typeof window)return ax.schedule(n,0);if(void 0===window.requestAnimationFrame)return ax.schedule(n,16);const e=window.requestAnimationFrame(n);return()=>window.cancelAnimationFrame(e)}};let YD;function sie(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(!YD){const t=Element.prototype;YD=t.matches||t.matchesSelector||t.mozMatchesSelector||t.msMatchesSelector||t.oMatchesSelector||t.webkitMatchesSelector}return n.nodeType===Node.ELEMENT_NODE&&YD.call(n,e)}(n,r)||(i=s,0))),i}class aie{constructor(e,t){this.componentFactory=t.get(El).resolveComponentFactory(e)}create(e){return new lie(this.componentFactory,e)}}class lie{constructor(e,t){this.componentFactory=e,this.injector=t,this.eventEmitters=new Df(1),this.events=this.eventEmitters.pipe(is(i=>Nn(...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(pn),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=ax.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=ax.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 c_(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 cie extends HTMLElement{constructor(){super(...arguments),this.ngElementEventsSubscription=null}}const die={initialConfig:{},parse:{},rename:{}};class hie{constructor(e,t){this.configState=e,this.storedChanges={},this.options=Object.assign(Object.assign({},die),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,u=null!==(s=o[e])&&void 0!==s?s:o[l];if(null==c)delete i[l];else if(u)try{i[l]=u(c)}catch(h){console.warn(`Failed to parse ${e} = ${c}`,h.message)}else i[l]=c}}let fie=(()=>{class n{constructor(t,i,r={}){this.configState=t,this.cdr=i,this.options=r,this.initialized=!1,this.configManager=new hie(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=Nt({type:n,features:[Fi]}),n})();const XD={boolean:n=>"false"!=`${n}`,json:n=>"string"==typeof n?JSON.parse(n):n,function:n=>{if("function"!=typeof n)throw new Error("Expected a javascript function");return n}};var KD;const If={production:!0,disableDbWorker:!0,acceptableViewerDomains:["https://portal.hubmapconsortium.org","https://portal.test.hubmapconsortium.org"],dbOptions:{ccfOwlUrl:"https://r5i95k35v5.us-east-2.awsapprunner.com/v1/ccf.owl.n3store.json",ccfContextUrl:"https://hubmapconsortium.github.io/ccf-ontology/ccf-context.jsonld",dataSources:["https://cdn.jsdelivr.net/gh/hubmapconsortium/ccf-ui@staging/assets/kpmp/data/rui_locations.jsonld","https://cdn.jsdelivr.net/gh/hubmapconsortium/ccf-ui@staging/assets/sparc/data/rui_locations.jsonld"],hubmapDataService:"",hubmapPortalUrl:"",hubmapDataUrl:"",hubmapAssetsUrl:"",hubmapToken:null!==(KD=localStorage.getItem("HUBMAP_TOKEN"))&&void 0!==KD?KD:"",useRemoteApi:!1,remoteApiEndpoint:"https://r5i95k35v5.us-east-2.awsapprunner.com/v1"},googleAnalyticsToken:"G-ERNVZ1Q4KE"};function Ei(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 wV(n,e){return function(t,i){e(t,i,n)}}function uc(n,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(n,e)}function Bi(n,e,t,i){return new(t||(t=Promise))(function(s,o){function a(u){try{c(i.next(u))}catch(h){o(h)}}function l(u){try{c(i.throw(u))}catch(h){o(h)}}function c(u){u.done?s(u.value):function(s){return s instanceof t?s:new t(function(o){o(s)})}(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})}function SV(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 ZD(){return!("object"==typeof process&&"[object process]"===String(process)&&!process.browser)||SV()}const CV="undefined"!=typeof __VERSION__?__VERSION__:"untranspiled source",cx=ZD();class _ie{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 JD(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 TV={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 AV(n){return"string"==typeof n?TV[n.toUpperCase()]||TV.WHITE:n}function ux(n,e){if(!n)throw new Error(e||"Assertion failed")}const dc={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},v0=dc.window||dc.self||dc.global,MV=dc.process||{};function Lg(){let n;if(cx&&v0.performance)n=v0.performance.now();else if(MV.hrtime){const e=MV.hrtime();n=1e3*e[0]+e[1]/1e6}else n=Date.now();return n}console;const Bg={debug:cx&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},Sie={enabled:!0,level:0};function Al(){}const DV={},IV={once:!0};function Cie(n){for(const e in n)for(const t in n[e])return t||"untitled";return"empty"}let eI=(()=>{class n{constructor({id:t}={id:""}){this.id=t,this.VERSION=CV,this._startTs=Lg(),this._deltaTs=Lg(),this.LOG_THROTTLE_TIMEOUT=0,this._storage=new _ie("__probe-".concat(this.id,"__"),Sie),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((Lg()-this._startTs).toPrecision(10))}getDelta(){return Number((Lg()-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){ux(t,i)}warn(t){return this._getLogFunction(0,t,Bg.warn,arguments,IV)}error(t){return this._getLogFunction(0,t,Bg.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,Bg.log,arguments,{time:!0,once:!0})}log(t,i){return this._getLogFunction(t,i,Bg.debug,arguments)}info(t,i){return this._getLogFunction(t,i,console.info,arguments)}once(t,i){return this._getLogFunction(t,i,Bg.debug||Bg.info,arguments,IV)}table(t,i,r){return i?this._getLogFunction(t,i,console.table||Al,r&&[r],{tag:Cie(i)}):Al}image({logLevel:t,priority:i,image:r,message:s="",scale:o=1}){return this._shouldLog(t||i)?cx?function({image:n,message:e="",scale:t=1}){if("string"==typeof n){const r=new Image;return r.onload=()=>{const s=JD(r,e,t);console.log(...s)},r.src=n,Al}const i=n.nodeName||"";if("img"===i.toLowerCase())return console.log(...JD(n,e,t)),Al;if("canvas"===i.toLowerCase()){const r=new Image;return r.onload=()=>console.log(...JD(r,e,t)),r.src=n.toDataURL(),Al}return Al}({image:r,message:s,scale:o}):function({image:n,message:e="",scale:t=1}){let i=null;try{i=et(5307)}catch(r){}return i?()=>i(n,{fit:"box",width:"".concat(Math.round(80*t),"%")}).then(r=>console.log(r)):Al}({image:r,message:s,scale:o}):Al}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||Al)}group(t,i,r={collapsed:!1}){r=RV({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||Al)}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()>=OV(t)}_getLogFunction(t,i,r,s=[],o){if(this._shouldLog(t)){o=RV({logLevel:t,message:i,args:s,opts:o}),ux(r=r||o.method),o.total=this.getTotal(),o.delta=this.getDelta(),this._deltaTs=Lg();const a=o.tag||o.message;if(o.once){if(DV[a])return Al;DV[a]=Lg()}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!cx&&"string"==typeof n&&(e&&(e=AV(e),n="\x1b[".concat(e,"m").concat(n,"\x1b[39m")),t&&(e=AV(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 Al}}return n.VERSION=CV,n})();function OV(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 ux(Number.isFinite(e)&&e>=0),e}function RV(n){const{logLevel:e,message:t}=n;n.logLevel=OV(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 ux("string"===r||"object"===r),Object.assign(n,n.opts)}const Ri=new eI({id:"deck"}),Vi={DEFAULT:-1,LNGLAT:1,METER_OFFSETS:2,LNGLAT_OFFSETS:3,CARTESIAN:0};Object.defineProperty(Vi,"IDENTITY",{get:()=>Ri.deprecated("COORDINATE_SYSTEM.IDENTITY","COORDINATE_SYSTEM.CARTESIAN")()||0});const Zc={WEB_MERCATOR:1,GLOBE:2,WEB_MERCATOR_AUTO_OFFSET:4,IDENTITY:0},PV={click:{handler:"onClick"},panstart:{handler:"onDragStart"},panmove:{handler:"onDrag"},panend:{handler:"onDragEnd"}},mn=new eI({id:"luma.gl"});function qo(n,e){if(!n)throw new Error(e||"luma.gl: assertion failed.")}function dx(n){return"undefined"!=typeof WebGLRenderingContext&&n instanceof WebGLRenderingContext||"undefined"!=typeof WebGL2RenderingContext&&n instanceof WebGL2RenderingContext||Boolean(n&&Number.isFinite(n._version))}function Ci(n){return"undefined"!=typeof WebGL2RenderingContext&&n instanceof WebGL2RenderingContext||Boolean(n&&2===n._version)}function hx(n){return qo(dx(n),"Invalid WebGLRenderingContext"),n}function Ao(n){return qo(Ci(n),"Requires WebGL2"),n}const w0={};const E0=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{globalThis.console&&globalThis.console.log&&globalThis.console.log("OESVertexArrayObject emulation library context restored"),t.reset_()},!0),this.reset_()};Of.prototype.VERTEX_ARRAY_BINDING_OES=34229,Of.prototype.reset_=function(){if(void 0!==this.vertexArrayObjects)for(let i=0;iCi(n)?void 0:0,Wie={3074:n=>Ci(n)?void 0:36064,35723:n=>Ci(n)?void 0:4352,35977:br,32937:br,36795:(n,e)=>{const t=Ci(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(FV);return e(t&&t.UNMASKED_VENDOR_WEBGL||7936)},37446:(n,e)=>{const t=n.getExtension(FV);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:br,35071:br,37447:br,36063:(n,e)=>{if(!Ci(n)){const t=n.getExtension(kV);return t?e(t.MAX_COLOR_ATTACHMENTS_WEBGL):0}},35379:br,35374:br,35377:br,34852:n=>{if(!Ci(n)){const e=n.getExtension(kV);return e?e.MAX_DRAW_BUFFERS_WEBGL:0}},36203:n=>n.getExtension(NV)?2147483647:65535,33001:n=>n.getExtension(NV)?16777216:65535,33e3:n=>16777216,37157:br,35373:br,35657:br,36183:br,37137:br,34045:br,35978:br,35979:br,35968:br,35376:br,35375:br,35659:br,37154:br,35371:br,35658:br,35076:br,35077:br,35380:br},LV="ANGLE_instanced_arrays",BV={OES_vertex_array_object:{meta:{suffix:"OES"},createVertexArray:()=>{qo(!1,"VertexArray requires WebGL2 or OES_vertex_array_object extension")},deleteVertexArray:()=>{},bindVertexArray:()=>{},isVertexArray:()=>!1},[LV]:{meta:{suffix:"ANGLE"},vertexAttribDivisor(n,e){qo(0===e,"WebGL instanced rendering not supported")},drawElementsInstanced:()=>{},drawArraysInstanced:()=>{}},WEBGL_draw_buffers:{meta:{suffix:"WEBGL"},drawBuffers:()=>{qo(!1)}},EXT_disjoint_timer_query:{meta:{suffix:"EXT"},createQuery:()=>{qo(!1)},deleteQuery:()=>{qo(!1)},beginQuery:()=>{qo(!1)},endQuery:()=>{},getQuery(n,e){return this.getQueryObject(n,e)},getQueryParameter(n,e){return this.getQueryObject(n,e)},getQueryObject:()=>{}}},tI={readBuffer:(n,e,t)=>{Ci(n)&&e(t)},getVertexAttrib:(n,e,t,i)=>{const{webgl2:r,ext:s}=function(n,e){return{webgl2:Ci(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(!Ci(n))switch(i){case 35967:return 35981;case 35971:case 35382:return 0}return e(t,i)},getInternalformatParameter:(n,e,t,i,r)=>{if(!Ci(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=Wie[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 rre(n,{extension:e,target:t,target2:i}){const r=BV[e];qo(r);const{meta:s={}}=r,{suffix:o=""}=s,a=n.getExtension(e);for(const l of Object.keys(r)){const c=`${l}${o}`;let u=null;"meta"===l||"function"==typeof n[l]||(a&&"function"==typeof a[c]?u=(...h)=>a[c](...h):"function"==typeof r[l]&&(u=r[l].bind(t))),u&&(t[l]=u,i[l]=u)}}globalThis.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 Of(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&&rre(n,{extension:t,target:n.luma,target2:n})}(n,BV),function(n,{target:e,target2:t}){Object.keys(tI).forEach(i=>{if("function"==typeof tI[i]){const r=n[i]?n[i].bind(n):()=>{},s=tI[i].bind(null,n,r);e[i]=s,t[i]=s}})}(n,{target:e,target2:n}),e.polyfilled=!0),n};const nI={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},lh=(n,e,t)=>e?n.enable(t):n.disable(t),VV=(n,e,t)=>n.hint(t,e),ja=(n,e,t)=>n.pixelStorei(t,e);function x0(n){return Array.isArray(n)||ArrayBuffer.isView(n)}const are={3042:lh,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:lh,2885:(n,e)=>n.cullFace(e),2929:lh,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:lh,35723:VV,36006:(n,e)=>{const t=Ci(n)?36009:36160;return n.bindFramebuffer(t,e)},2886:(n,e)=>n.frontFace(e),33170:VV,2849:(n,e)=>n.lineWidth(e),32823:lh,32824:"polygonOffset",10752:"polygonOffset",35977:lh,32938:"sampleCoverage",32939:"sampleCoverage",3089:lh,3088:(n,e)=>n.scissor(...e),2960:lh,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:ja,3317:ja,37440:ja,37441:ja,37443:ja,3330:ja,3332:ja,3331:ja,36010:(n,e)=>n.bindFramebuffer(36008,e),3314:ja,32878:ja,3316:ja,3315:ja,32877:ja,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=x0(e)?e:[e,e],n.blendEquationSeparate(...e)},blendFunc:(n,e)=>{e=x0(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=x0(e)?e:[e,e];const[t,i]=e;n.stencilMaskSeparate(1028,t),n.stencilMaskSeparate(1029,i)},stencilFunc:(n,e)=>{e=x0(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=x0(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 rs(n,e,t){return void 0!==e[n]?e[n]:t[n]}const lre={blendEquation:(n,e,t)=>n.blendEquationSeparate(rs(32777,e,t),rs(34877,e,t)),blendFunc:(n,e,t)=>n.blendFuncSeparate(rs(32969,e,t),rs(32968,e,t),rs(32971,e,t),rs(32970,e,t)),polygonOffset:(n,e,t)=>n.polygonOffset(rs(32824,e,t),rs(10752,e,t)),sampleCoverage:(n,e,t)=>n.sampleCoverage(rs(32938,e,t),rs(32939,e,t)),stencilFuncFront:(n,e,t)=>n.stencilFuncSeparate(1028,rs(2962,e,t),rs(2967,e,t),rs(2963,e,t)),stencilFuncBack:(n,e,t)=>n.stencilFuncSeparate(1029,rs(34816,e,t),rs(36003,e,t),rs(36004,e,t)),stencilOpFront:(n,e,t)=>n.stencilOpSeparate(1028,rs(2964,e,t),rs(2965,e,t),rs(2966,e,t)),stencilOpBack:(n,e,t)=>n.stencilOpSeparate(1029,rs(34817,e,t),rs(34818,e,t),rs(34819,e,t))},jV={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]})},Jc=(n,e)=>n.isEnabled(e),UV={3042:Jc,2884:Jc,2929:Jc,3024:Jc,32823:Jc,32926:Jc,32928:Jc,3089:Jc,2960:Jc,35977:Jc};function zV(n){for(const e in n)return!1;return!0}function cre(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||nI)){const r=e,s=UV[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=UV[r];i[r]=s?s(n,Number(r)):n.getParameter(Number(r))}return i}(e):Object.assign({},nI),this.log=i,this._updateCache=this._updateCache.bind(this),Object.seal(this)}push(e={}){this.stateStack.push({})}pop(){qo(this.stateStack.length>0),Xu(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){qo(void 0!==s);const o=e[s],a=this.cache[s];cre(o,a)||(t=!0,i=a,r&&!(s in r)&&(r[s]=a),this.cache[s]=o)}return{valueChanged:t,oldValue:i}}}function GV(n,e={}){const{enable:t=!0,copyState:i}=e;if(qo(void 0!==i),!n.state){const{polyfillContext:r}=globalThis;r&&r(n),n.state=new hre(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 s in jV)ure(n,s,jV[s]);HV(n,"getParameter"),HV(n,"isEnabled")}return n.state.enable=t,n}function $V(n){qo(n.state),n.state.pop()}function Xu(n,e){if(qo(dx(n),"setParameters requires a WebGL context"),zV(e))return;const t={};for(const r in e){const s=Number(r),o=are[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)lre[r](n,e,i)}function hc(n,e,t){if(zV(e))return t(n);const{nocatch:i=!0}=e;let r;if(function(n){n.state||GV(n,{copyState:!1}),n.state.push()}(n),Xu(n,e),i)r=t(n),$V(n);else try{r=t(n)}finally{$V(n)}return r}function fx(){return!("object"==typeof process&&"[object process]"===String(process)&&!process.browser)||function(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;return!!(e&&e.indexOf("Electron")>=0)}()}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 iI(n,e,t=!0){return function(n,e,t,i,r){const s=WV(n[0],e,t);let o=qV(n[1],e,i,r),a=WV(n[0]+1,e,t);const l=a===t-1?a:a-1;let c;return a=qV(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 WV(n,e,t){return Math.min(Math.round(n*e),t-1)}function qV(n,e,t,i){return i?Math.max(0,t-1-Math.round(n*e)):Math.min(Math.round(n*e),t-1)}const rI=fx(),bre=rI&&"undefined"!=typeof document,YV={webgl2:!0,webgl1:!0,throwOnError:!0,manageState:!0,canvas:null,debug:!1,width:800,height:600};function XV(n={}){qo(rI,"createGLContext only available in the browser.\nCreate your own headless context or use 'createHeadlessContext' from @luma.gl/test-utils"),n=Object.assign({},YV,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?(bre&&"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=sI(r,n),function(n){const e=Ci(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);mn.info(1,`${e}${n.debug?" debug":""} context ${t?`(${t.vendor},${t.renderer})`:""}`)()}(r),r):null}function sI(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({},YV,e);const{manageState:t,debug:i}=e;return t&&GV(n,{copyState:!1,log:(...r)=>mn.log(1,...r)()}),rI&&i&&(globalThis.makeDebugContext?(n=globalThis.makeDebugContext(n,e),mn.level=Math.max(mn.level,1)):mn.warn('WebGL debug mode not activated. import "@luma.gl/debug" to enable.')()),n._instrumented=!0,n}function KV(){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 QV{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=KV(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(KV()-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 oI{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 QV?e:new QV(t,i)),this.stats[t]}}const S0="8.5.12",Rf=new class{constructor(){this.stats=new Map}get(e){return this.stats.has(e)||this.stats.set(e,new oI({id:e})),this.stats.get(e)}};if(globalThis.luma&&globalThis.luma.VERSION!==S0)throw new Error(`luma.gl - multiple VERSIONs detected: ${globalThis.luma.VERSION} vs ${S0}`);function on(n,e){if(!n)throw new Error(e||"luma.gl: assertion failed.")}function aI(n,e){if("string"!=typeof e)return e;const t=Number(e);if(!isNaN(t))return t;const i=n[e=e.replace(/^.*\./,"")];return on(void 0!==i,`Accessing undefined constant GL.${e}`),i}function ch(n,e){e=Number(e);for(const t in n)if(n[t]===e)return`GL.${t}`;return String(e)}globalThis.luma||(fx()&&mn.log(1,`luma.gl ${S0} - set luma.log.level=1 (or higher) to trace rendering`)(),globalThis.luma=globalThis.luma||{VERSION:S0,version:S0,log:mn,stats:Rf,globals:{modules:{},nodeIO:{}}}),globalThis;const lI={};function ma(n="id"){return lI[n]=lI[n]||1,`${n}-${lI[n]++}`}function ZV(n){return on("number"==typeof n,"Input must be a number"),n&&0==(n&n-1)}function jg(n){let e=!0;for(const t in n){e=!1;break}return e}function JV(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 mn.removed(`Calling removed method ${e}.${o}: `,r)(),new Error(o)})})}const Ug="Resource subclass must define virtual methods";class Ku{get[Symbol.toStringTag](){return"Resource"}constructor(e,t={}){hx(e);const{id:i,userData:r={}}=t;this.gl=e,this.gl2=e,this.id=i||ma(this[Symbol.toStringTag]),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[Symbol.toStringTag]||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={}){on(e=aI(this.gl,e));const r=(this.constructor.PARAMETERS||{})[e];if(r){const s=Ci(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=Ci(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 h=i?ch(this.gl,l):l;o[h]=this.getParameter(l,e),i&&"GLenum"===c.type&&(o[h]=ch(this.gl,o[h]))}}return o}setParameter(e,t){on(e=aI(this.gl,e));const r=(this.constructor.PARAMETERS||{})[e];if(r){const s=Ci(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=aI(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 JV(this,e,t,i)}initialize(e){}_createHandle(){throw new Error(Ug)}_deleteHandle(){throw new Error(Ug)}_bindHandle(e){throw new Error(Ug)}_getOptsFromHandle(){throw new Error(Ug)}_getParameter(e,t){throw new Error(Ug)}_setParameter(e,t){throw new Error(Ug)}_context(){return this.gl.luma=this.gl.luma||{},this.gl.luma}_addStats(){const e=this[Symbol.toStringTag],t=Rf.get("Resource Counts");t.get("Resources Created").incrementCount(),t.get(`${e}s Created`).incrementCount(),t.get(`${e}s Active`).incrementCount()}_removeStats(){const e=this[Symbol.toStringTag];Rf.get("Resource Counts").get(`${e}s Active`).decrementCount()}_trackAllocatedMemory(e,t=this[Symbol.toStringTag]){const i=Rf.get("Memory Usage");i.get("GPU Memory").addCount(e),i.get(`${t} Memory`).addCount(e),this.byteLength=e}_trackDeallocatedMemory(e=this[Symbol.toStringTag]){const t=Rf.get("Memory Usage");t.get("GPU Memory").subtractCount(this.byteLength),t.get(`${e} Memory`).subtractCount(this.byteLength),this.byteLength=0}}function cI(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 C0(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 Ore({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 _a.getBytesPerElement(this)}get BYTES_PER_VERTEX(){return _a.getBytesPerVertex(this)}_assign(e={}){return void 0!==(e=uI("Accessor",e,Pre)).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"},Nre={removedProps:{},replacedProps:{bytes:"byteLength"},deprecatedProps:tj},kre={removedProps:tj};class lr extends Ku{get[Symbol.toStringTag](){return"Buffer"}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/_a.getBytesPerElement(e))}getVertexCount(e=this.accessor){return Math.round(this.byteLength/_a.getBytesPerVertex(e))}initialize(e={}){return ArrayBuffer.isView(e)&&(e={data:e}),Number.isFinite(e)&&(e={byteLength:e}),e=uI("Buffer",e,Nre),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=uI("Buffer",e,kre))&&this.setAccessor(e.accessor),this}setAccessor(e){return delete(e=Object.assign({},e)).buffer,this.accessor=new _a(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;on(t);const o=this.gl.webgl2?36663:this.target;return this.gl.bindBuffer(o,this.handle),0!==r||void 0!==s?(Ao(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 Ao(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}={}){Ao(this.gl);const s=C0(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 u=Math.min(o,l);return on((r=r||u)<=u),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):(on(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){on(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=cI(e);return on(s),this.setAccessor(new _a(this.accessor,{type:s})),this}_setByteLength(e,t=this.usage){on(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/C0(this.accessor.type||5126,{clamped:!1}).BYTES_PER_ELEMENT;return this.getElementCount()-i}_inferType(e){this.accessor.type||this.setAccessor(new _a(this.accessor,{type:cI(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 mn.deprecated("Buffer.type","Buffer.accessor.type")(),this.accessor.type}get bytes(){return mn.deprecated("Buffer.bytes","Buffer.byteLength")(),this.byteLength}setByteLength(e){return mn.deprecated("setByteLength","reallocate")(),this.reallocate(e)}updateAccessor(e){return mn.deprecated("updateAccessor(...)","setAccessor(new Accessor(buffer.accessor, ...)")(),this.accessor=new _a(this.accessor,e),this}}const dI={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}},nj={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},ij={5126:4,5125:4,5124:4,5123:2,5122:2,5131:2,5120:1,5121:1},Bre=[9729,9728],rj=globalThis.WebGLBuffer||function(){};class Pf extends Ku{get[Symbol.toStringTag](){return"Texture"}static isSupported(e,t={}){const{format:i,linearFiltering:r}=t;let s=!0;return i&&(s=s&&function(n,e){const t=dI[e];if(!t)return!1;if(void 0===t.gl1&&void 0===t.gl2)return!0;const i=Ci(n)&&t.gl2||t.gl1;return"string"==typeof i?n.getExtension(i):i}(e,i),s=s&&(!r||function(n,e){const t=dI[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=ma("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(D=>this.initialize(Object.assign({},e,{pixels:D,data:D}))),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:u}=e;t||(t=r);let{width:h,height:f,dataFormat:g,type:m,compressed:v=!1,mipmaps:x=!0}=e;const{depth:U=0}=e;return({width:h,height:f,compressed:v,dataFormat:g,type:m}=this._deduceParameters({format:s,type:m,dataFormat:g,compressed:v,data:t,width:h,height:f})),this.width=h,this.height=f,this.depth=U,this.format=s,this.type=m,this.dataFormat=g,this.border=o,this.textureUnit=u,Number.isFinite(this.textureUnit)&&(this.gl.activeTexture(33984+this.textureUnit),this.gl.bindTexture(this.target,this.handle)),x&&this._isNPOT()&&(mn.warn(`texture: ${this} is Non-Power-Of-Two, disabling mipmaping`)(),x=!1,this._updateForNPOT(l)),this.mipmaps=x,this.setImageData({data:t,width:h,height:f,depth:U,format:s,type:m,dataFormat:g,border:o,mipmaps:x,parameters:c,compressed:v}),x&&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:u=this.type,width:h=this.width,height:f=this.height,dataFormat:g=this.dataFormat,compressed:m=!1}=e;c||(c=i),({type:u,dataFormat:g,compressed:m,width:h,height:f}=this._deduceParameters({format:s,type:u,dataFormat:g,compressed:m,data:c,width:h,height:f}));const{gl:v}=this;v.bindTexture(this.target,this.handle);let x=null;({data:c,dataType:x}=this._getDataType({data:c,compressed:m}));let U,D=0;return hc(this.gl,l,()=>{switch(x){case"null":v.texImage2D(t,r,s,h,f,o,g,u,c);break;case"typed-array":v.texImage2D(t,r,s,h,f,o,g,u,c,a);break;case"buffer":U=Ao(v),U.bindBuffer(35052,c.handle||c),U.texImage2D(t,r,s,h,f,o,g,u,a),U.bindBuffer(35052,null);break;case"browser-object":Ci(v)?v.texImage2D(t,r,s,h,f,o,g,u,c):v.texImage2D(t,r,s,g,u,c);break;case"compressed":for(const[ie,_e]of c.entries())v.compressedTexImage2D(t,ie,_e.format,_e.width,_e.height,o,_e.data),D+=_e.levelSize;break;default:on(!1,"Unknown image data type")}}),this._trackAllocatedMemory("compressed"===x?D:c&&c.byteLength?c.byteLength:this.width*this.height*(nj[this.dataFormat]||4)*(ij[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:u=this.type,dataFormat:h=this.dataFormat,compressed:f=!1,offset:g=0,border:m=this.border,parameters:v={}}){if(({type:u,dataFormat:h,compressed:f,width:o,height:a}=this._deduceParameters({format:c,type:u,dataFormat:h,compressed:f,data:i,width:o,height:a})),on(0===this.depth,"texSubImage not supported for 3D textures"),i||(i=t),i&&i.data){const x=i;i=x.data,o=x.shape[0],a=x.shape[1]}i instanceof lr&&(i=i.handle),this.gl.bindTexture(this.target,this.handle),hc(this.gl,v,()=>{if(f)this.gl.compressedTexSubImage2D(e,l,r,s,o,a,c,i);else if(null===i)this.gl.texSubImage2D(e,l,r,s,o,a,h,u,null);else if(ArrayBuffer.isView(i))this.gl.texSubImage2D(e,l,r,s,o,a,h,u,i,g);else if(i instanceof rj){const x=Ao(this.gl);x.bindBuffer(35052,i),x.texSubImage2D(e,l,r,s,o,a,h,u,g),x.bindBuffer(35052,null)}else Ci(this.gl)?Ao(this.gl).texSubImage2D(e,l,r,s,o,a,h,u,i):this.gl.texSubImage2D(e,l,r,s,h,u,i)}),this.gl.bindTexture(this.target,null)}copyFramebuffer(e={}){return mn.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 lr?{data:e.handle,dataType:"buffer"}:e instanceof rj?{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=dI[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},on(r,"Could not deduced texture size"),on(void 0===t||r.width===t,"Deduced texture width does not match supplied width"),on(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:on(!1);break;default:this.gl.texParameteri(this.target,e,t)}return this.gl.bindTexture(this.target,null),this}_isNPOT(){return!(Ci(this.gl)||!this.width||!this.height||ZV(this.width)&&ZV(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===Bre.indexOf(t)&&(t=9729);break;case 10242:case 10243:33071!==t&&(t=33071)}return t}}function Vre(n,e){return on("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 ya extends Pf{get[Symbol.toStringTag](){return"Texture2D"}static isSupported(e,t){return Pf.isSupported(e,t)}constructor(e,t={}){hx(e),(t instanceof Promise||"string"==typeof t)&&(t={data:t}),"string"==typeof t.data&&(t=Object.assign({},t,{data:Vre(t.data)})),super(e,Object.assign({},t,{target:3553})),this.initialize(t),Object.seal(this)}}const Nf="EXT_color_buffer_float",sj={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:Nf,bpp:2},33327:{gl2:Nf,bpp:4},34842:{gl2:Nf,bpp:8},33326:{gl2:Nf,bpp:4},33328:{gl2:Nf,bpp:8},34836:{gl2:Nf,bpp:16},35898:{gl2:Nf,bpp:4}};class zg extends Ku{get[Symbol.toStringTag](){return"Renderbuffer"}static isSupported(e,{format:t}={format:null}){return!t||function(n,e,t){const i=t[e];if(!i)return!1;const r=Ci(n)&&i.gl2||i.gl1;return"string"==typeof r?n.getExtension(r):r}(e,t,sj)}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 on(e,"Needs format"),this._trackDeallocatedMemory(),this.gl.bindRenderbuffer(36161,this.handle),0!==r&&Ci(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)*sj[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 uj="clear: bad arguments";function fI(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)),on(0!==o,uj),hc(n,s,()=>{n.clear(o)})}function dj(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 li(n){return function(){var e=this,t=arguments;return new Promise(function(i,r){var s=n.apply(e,t);function o(l){dj(s,i,r,o,a,"next",l)}function a(l){dj(s,i,r,o,a,"throw",l)}o(void 0)})}}const pI=[34069,34070,34071,34072,34073,34074];let Wre=(()=>{class n extends Pf{get[Symbol.toStringTag](){return"TextureCube"}constructor(t,i={}){hx(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 li(function*(){const{gl:u}=c,h=r||s,f=yield Promise.all(pI.map(g=>{const m=h[g];return Promise.all(Array.isArray(m)?m:[m])}));c.bind(),pI.forEach((g,m)=>{f[m].length>1&&!1!==c.opts.mipmaps&&mn.warn(`${c.id} has mipmap and multiple LODs.`)(),f[m].forEach((v,x)=>{t&&i?u.texImage2D(g,x,a,t,i,o,a,l,v):u.texImage2D(g,x,a,a,l,v)})}),c.unbind()})()}setImageDataForFace(t){const{face:i,width:r,height:s,pixels:o,data:a,border:l=0,format:c=6408,type:u=5121}=t,{gl:h}=this,f=o||a;return this.bind(),f instanceof Promise?f.then(g=>this.setImageDataForFace(Object.assign({},t,{face:i,data:g,pixels:g}))):this.width||this.height?h.texImage2D(i,0,c,r,s,l,c,u,f):h.texImage2D(i,0,c,c,u,f),this}}return n.FACES=pI,n})();class qre extends Pf{get[Symbol.toStringTag](){return"Texture3D"}static isSupported(e){return Ci(e)}constructor(e,t={}){Ao(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:u,parameters:h={}}){return this._trackDeallocatedMemory("Texture"),this.gl.bindTexture(this.target,this.handle),hc(this.gl,h,()=>{ArrayBuffer.isView(u)&&this.gl.texImage3D(this.target,e,t,i,r,s,o,a,l,u),u instanceof lr&&(this.gl.bindBuffer(35052,u.handle),this.gl.texImage3D(this.target,e,t,i,r,s,o,a,l,c))}),this._trackAllocatedMemory(u&&u.byteLength?u.byteLength:this.width*this.height*this.depth*(nj[this.dataFormat]||4)*(ij[this.type]||1),"Texture"),this.loaded=!0,this}}function hj(n,e){on(n instanceof ya||n instanceof Wre||n instanceof qre);const t=n.constructor,{gl:i,width:r,height:s,format:o,type:a,dataFormat:l,border:c,mipmaps:u}=n;return new t(i,Object.assign({width:r,height:s,format:o,type:a,dataFormat:l,border:c,mipmaps:u},e))}function Yre(n,e){const{gl:t,width:i,height:r,id:s}=n;return new ks(t,Object.assign({},e,{id:`framebuffer-for-${s}`,width:i,height:r,attachments:{36064:n}}))}function px(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:u,deleteFramebuffer:h}=T0(n);on(u);const{gl:f,handle:g,attachments:m}=u;a=a||u.width,l=l||u.height,36064===s&&null===g&&(s=1028),on(m[s]),c=c||m[s].type,o=function(n,e,t,i,r){if(n)return n;return new(C0(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 on(!1),0}}(t))}(o,c,r,a,l),c=c||cI(o);const v=f.bindFramebuffer(36160,g);return f.readPixels(t,i,a,l,r,c,o),f.bindFramebuffer(36160,v||null),h&&u.delete(),o}function gI(n,{sourceAttachment:e=36064,targetMaxHeight:t=Number.MAX_SAFE_INTEGER}={}){let i=px(n,{sourceAttachment:e}),{width:r,height:s}=n;for(;s>t;)({data:i,width:r,height:s}=Ore({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 u in i){const h=i[u];(Array.isArray(h)?h[0]:h).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 on(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&&mn.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){on(void 0!==o,"Misspelled framebuffer binding point?");const a=Number(o),l=r[a];let c=l;if(c)if(c instanceof zg)this._attachRenderbuffer({attachment:a,renderbuffer:c});else if(Array.isArray(l)){const[u,h=0,f=0]=l;c=u,this._attachTexture({attachment:a,texture:u,layer:h,level:f})}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(ks.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)&&fI(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]}={}){Ao(n),hc(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:on(!1,uj)}})}(this.gl,{drawBuffer:l,value:a})}),this.gl.bindFramebuffer(36160,o||null),this}readPixels(e={}){return mn.error("Framebuffer.readPixels() is no logner supported, use readPixelsToArray(framebuffer)")(),null}readPixelsToBuffer(e={}){return mn.error("Framebuffer.readPixelsToBuffer()is no logner supported, use readPixelsToBuffer(framebuffer)")(),null}copyToDataUrl(e={}){return mn.error("Framebuffer.copyToDataUrl() is no logner supported, use copyToDataUrl(framebuffer)")(),null}copyToImage(e={}){return mn.error("Framebuffer.copyToImage() is no logner supported, use copyToImage(framebuffer)")(),null}copyToTexture(e={}){return mn.error("Framebuffer.copyToTexture({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null}blit(e={}){return mn.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=Ao(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=ch(this.gl,r)),r}getAttachmentParameters(e=36064,t,i=this.constructor.ATTACHMENT_PARAMETERS||[]){const r={};for(const s of i)r[t?ch(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?ch(this.gl,s):s]=this.getAttachmentParameters(s,e)}return i}show(){return"undefined"!=typeof window&&window.open(gI(this),"luma-debug-texture"),this}log(e=0,t=""){if(e>mn.level||"undefined"==typeof window)return this;t=t||`Framebuffer ${this.id}`;const i=gI(this,{targetMaxHeight:100});return mn.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 ya(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 zg(this.gl,{id:`${this.id}-depth-stencil`,format:35056,width:r,height:111}),this.ownResources.push(o[33306])):t?(o=o||{},o[36096]=new zg(this.gl,{id:`${this.id}-depth`,format:33189,width:r,height:s}),this.ownResources.push(o[36096])):i&&on(!1),o}_unattach(e){const t=this.attachments[e];!t||(t instanceof zg?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:Ao(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:on(!1,"Illegal texture type")}s.bindTexture(t.target,null),this.attachments[e]=t}_setReadBuffer(e){const t=function(n){return Ci(n)?n:null}(this.gl);t?t.readBuffer(e):on(36064===e||1029===e,fj),this.readBuffer=e}_setDrawBuffers(e){const{gl:t}=this,i=Ao(t);if(i)i.drawBuffers(e);else{const r=t.getExtension("WEBGL_draw_buffers");r?r.drawBuffersWEBGL(e):on(1===e.length&&(36064===e[0]||1029===e[0]),fj)}this.drawBuffers=e}_getAttachmentParameterFallback(e){const t=function(n){n.luma=n.luma||{},n.luma.caps=n.luma.caps||{};for(const e in pj)void 0===n.luma.caps[e]&&(n.luma.caps[e]=mj(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)}}ks.ATTACHMENT_PARAMETERS=[36049,36048,33296,33298,33299,33300,33301,33302,33303];const pj={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 ya(n,{format:6408,type:5126,dataFormat:6408}),t=new ks(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 mI(n,e){return gj(n,e)}function gj(n,e){return(e=Array.isArray(e)?e:[e]).every(t=>mj(n,t))}function mj(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=pj[e];let i;on(t,e);const r=Ci(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:on(!1);return i}(n,e)),n.luma.caps[e]||mn.log(2,`Feature: ${e} not supported`)(),n.luma.caps[e]}class _I{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()}},ose=1/Math.PI*180,ase=1/180*Math.PI,Dr={};function cse(n,{precision:e=Dr.precision||4}={}){return n=function(n){return Math.round(n/Dr.EPSILON)*Dr.EPSILON}(n),`${parseFloat(n.toPrecision(e))}`}function uh(n){return Array.isArray(n)||ArrayBuffer.isView(n)&&!(n instanceof DataView)}function Qu(n,e,t){if(uh(n)){t=t||function(n){return n.clone?n.clone():new Array(n.length)}(n);for(let i=0;it*ase,void 0)}(n)}function dse(n){return function(n,e){return Qu(n,t=>t*ose,void 0)}(n)}function Ua(n,e,t){return Qu(n,i=>Math.max(e,Math.min(t,i)))}function gx(n,e,t){return uh(n)?n.map((i,r)=>gx(i,e[r],t)):t*e+(1-t)*n}function M0(n,e,t){const i=Dr.EPSILON;t&&(Dr.EPSILON=t);try{if(n===e)return!0;if(uh(n)&&uh(e)){if(n.length!==e.length)return!1;for(let r=0;r0?", ":"")+cse(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&&(Rj.length=n.length,i=Rj):i=Oj,(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 Pj(n){return n&&n[Symbol.asyncIterator]}function xI(n,e=(()=>!0)){return Array.isArray(n)?Nj(n,e,[]):e(n)?[n]:[]}function Nj(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 kj(n,e){return n?(Number.isFinite(n)&&(n={duration:n}),n.type=n.type||"interpolation",ot(ot(ot({},Bse[n.type]),e),n)):null}function Fj(n,e){return e.getBuffer()?[e.getBuffer(),{divisor:0,size:e.size,normalized:e.settings.normalized}]:e.value}function Lj(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 Bj(n){n.push(n.shift())}function CI(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 Vj({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,u=r&&c,h=CI(t,e),f=t.state.constant;if(!u&&i>=h)return;const g=f?t.value:t.getBuffer().getData({srcByteOffset:l});if(t.settings.normalized&&!f){const U=s;s=(D,ie)=>t._normalizeConstant(U(D,ie))}const m=f?(U,D)=>s(g,D):(U,D)=>s(g.subarray(U,U+a),D),v=n.getData({length:i}),x=new Float32Array(h);(function({source:n,target:e,size:t,getData:i,sourceStartIndices:r,targetStartIndices:s}){if(!Array.isArray(s))return SI({source:n,target:e,size:t,getData:i}),e;let o=0,a=0;const l=i&&((u,h)=>i(u+a,h)),c=Math.min(r.length,s.length);for(let u=1;u(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===vx||(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=vx}clearNeedsUpdate(){this.state.needsUpdate=!1,this.state.updateRanges=kse}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!==vx}),!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,u]of s)o.call(r,this,{data:t,startRow:c,endRow:u,props:i,numInstances:e});if(this.value)if(this.constant||this.buffer.byteLength{if(!r){const x=h*a+l;for(let U=0;Uu?c.set(ie,v):(e._normalizeValue(ie,U.target,0),Nse({target:c,source:U.target,start:v,count:_e}));v+=_e*u}else e._normalizeValue(ie,c,v),v+=u}}_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 AI={};function Do(n){Ri.level>0&&AI[n]&&AI[n].call(...arguments)}function za(n,e){if(!n)throw new Error(e||"shadertools: assertion failed.")}const jj="out vec4 transform_output;\nvoid main() {\n transform_output = vec4(0);\n}",Use=`#version 300 es\n${jj}`;function Uj(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 zj(n={}){const{version:e=100,input:t,inputType:i,output:r}=n;if(!t)return 300===e?Use:e>300?`#version ${e}\n${jj}`:"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 za(!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 Hj extends Ku{get[Symbol.toStringTag](){return"TransformFeedback"}static isSupported(e){return Ci(e)}constructor(e,t={}){Ao(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,jg(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,mn.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 lr?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 $se{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 lr?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&&on(Ci(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 Hj(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],on(i[s]instanceof lr)}return{sourceBuffers:t,feedbackBuffers:i}}_createNewBuffer(e,t){const i=new lr(this.gl,t);return this.resources[e]&&this.resources[e].delete(),this.resources[e]=i,i}_getNextIndex(){return(this.currentIndex+1)%2}}function Gj(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 R0="vs",Yse={[R0]:"#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"},wx="__LUMA_INJECT_DECLARATIONS__",$j=/void\s+main\s*\([^)]*\)\s*\{\n?/,Wj=/}\n?[^{}]*$/,DI=[];function qj(n,e,t,i=!1){const r=e===R0;for(const s in t){const o=t[s];o.sort((l,c)=>l.order-c.order),DI.length=o.length;for(let l=0,c=o.length;ll+a));break;case"vs:#main-end":r&&(n=n.replace(Wj,l=>a+l));break;case"fs:#decl":r||(n=n.replace(wx,a));break;case"fs:#main-start":r||(n=n.replace($j,l=>l+a));break;case"fs:#main-end":r||(n=n.replace(Wj,l=>a+l));break;default:n=n.replace(s,l=>l+a)}}return n=n.replace(wx,""),i&&(n=n.replace(/\}\s*$/,s=>s+Yse[e])),n}function II(n){const e={};return za(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 Xse={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},Ex="transform_uSize_",Yj="transform_position";const ioe={10241:9728,10240:9728,10242:33071,10243:33071};class soe{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 h in this.samplerTextureMap)a[h]=i[this.samplerTextureMap[h]];this._setSourceTextureParameters();const u=function({sourceTextureMap:n,targetTextureVarying:e,targetTexture:t}){const i={};let r,s;e&&(({width:r,height:s}=t),i[`${Ex}${e}`]=[r,s]);for(const o in n)({width:r,height:s}=n[o]),i[`${Ex}${o}`]=[r,s];return i}({sourceTextureMap:i,targetTextureVarying:this.targetTextureVarying,targetTexture:s});Object.assign(a,u)}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=px(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 za(!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 lr(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 ks(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(ioe)}_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=hj(e,{parameters:{10241:9728,10240:9728,10242:33071,10243:33071},pixelStore:{37440:!1}});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 u=l.split("\n"),h=u.slice();if(u.forEach((f,g,m)=>{if(s>0){const v=function(n,e){const t={},i=function(n){return Uj(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=`${Ex}${n}`;return{samplerName:e,sizeName:t,uniformDeclerations:` uniform sampler2D ${e};\n uniform vec2 ${t};`}}(s),h=` ${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 za(!1),null}}(r)};\n`;return t[a]=s,{updatedLine:o,inject:{"vs:#decl":c,"vs:#main-start":h},samplerTextureMap:t}}return null}(f,e);if(v){const{updatedLine:x,inject:U}=v;h[g]=x,c=II([c,U]),Object.assign(a,v.samplerTextureMap),s--}}t&&!o&&(o=function(n,e){const t=Uj(n,["varying","out"]);return t&&t.name===e?t.type:null}(f,t))}),t){on(i);const f=`${Ex}${t}`;c=II([c,{"vs:#decl":`uniform vec2 ${f};\n`,"vs:#main-start":` vec2 ${Yj} = transform_getPos(${f});\n gl_Position = vec4(${Yj}, 0, 1.);\n`}])}l=h.join("\n")}return{vs:l,targetTextureType:o,inject:c,samplerTextureMap:a}}({vs:e.vs,sourceTextureMap:t,targetTextureVarying:this.targetTextureVarying,targetTexture:i}),c=II([e.inject||{},a]);return this.targetTextureType=o,this.samplerTextureMap=l,{vs:r,fs:e._fs||zj({version:Gj(r),input:this.targetTextureVarying,inputType:o,output:"transform_output"}),modules:this.hasSourceTextures||this.targetTextureVarying?[Xse].concat(e.modules||[]):e.modules,uniforms:s,inject:c}}}const OI={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 aoe(n){let e=Xj(n);return"object"===e?n?"type"in n?Object.assign({},n,OI[n.type]):"value"in n?(e=Xj(n.value),Object.assign({type:e},n,OI[e])):{type:"object",value:n}:{type:"object",value:null}:Object.assign({type:e,value:n},OI[e])}function Xj(n){return Array.isArray(n)||ArrayBuffer.isView(n)?"array":typeof n}class RI{constructor({name:e,vs:t,fs:i,dependencies:r=[],uniforms:s,getUniforms:o,deprecations:a=[],defines:l={},inject:c={},vertexShader:u,fragmentShader:h}){za("string"==typeof e),this.name=e,this.vs=t||u,this.fs=i||h,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=aoe(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:za(!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&&za(s.validate(e[r],s),`${this.name}: invalid ${r}`),t[r]=e[r]):t[r]=s.value}return t}}function doe(n){return function(n){const e={},t={};return PI({modules:n,level:0,moduleMap:e,moduleDepth:t}),Object.keys(t).sort((i,r)=>t[r]-t[i]).map(i=>e[i])}(Qj(n))}function PI({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 RI||(za("string"!=typeof t,`Shader module use by name is deprecated. Import shader module '${t}' and use it directly.`),za(t.name,"shader module has no name"),(t=new RI(t)).dependencies=Qj(t.dependencies)),t))}const NI={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]},kf={};function boe(n,e){return n.match(/NVIDIA/i)||e.match(/NVIDIA/i)?"NVIDIA":n.match(/INTEL/i)||e.match(/INTEL/i)?"INTEL":n.match(/AMD/i)||e.match(/AMD/i)||n.match(/ATI/i)||e.match(/ATI/i)?"AMD":"UNKNOWN GPU"}Object.keys(NI).forEach(n=>{kf[n]=n});const kI={};function Zj(n,e,t={}){const i=NI[e];if(za(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 kI)return kI[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),kI[e]=l,l}function xx(n,e){return(e=Array.isArray(e)?e:[e]).every(t=>function(n,e){const t=NI[e];za(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 za(!1===r||!0===r),r}(n,t))}function Gg(n){return new RegExp(`\\b${n}[ \\t]+(\\w+[ \\t]+\\w+(\\[\\w+\\])?;)`,"g")}const Jj=[[/^(#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("]],xoe=[...Jj,[Gg("attribute"),"in $1"],[Gg("varying"),"out $1"]],Soe=[...Jj,[Gg("varying"),"in $1"]],eU=[[/^#version[ \t]+300[ \t]+es/,"#version 100"],[/\btexture(2D|2DProj|Cube)Lod\(/g,"texture$1LodEXT("],[/\btexture\(/g,"texture2D("],[/\btextureLod\(/g,"texture2DLodEXT("]],Coe=[...eU,[Gg("in"),"attribute $1"],[Gg("out"),"varying $1"]],Toe=[...eU,[Gg("in"),"varying $1"]],FI="gl_FragColor",LI=/\bout[ \t]+vec4[ \t]+(\w+)[ \t]*;\n?/,Aoe=/void\s+main\s*\([^)]*\)\s*\{\n?/;function Sx(n,e){for(const[t,i]of e)n=n.replace(t,i);return n}const Ooe=`\n\n${wx}\n\n`,tU={[R0]:"vertex",fs:"fragment"};function nU(n,{id:e,source:t,type:i,modules:r,defines:s={},hookFunctions:o=[],inject:a={},transpileToGLSL100:l=!1,prologue:c=!0,log:u}){za("string"==typeof t,"shader source must be a string");const h=i===R0,f=t.split("\n");let g=100,m="",v=t;0===f[0].indexOf("#version ")?(g=300,m=f[0],v=f.slice(1).join("\n")):m=`#version ${g}`;const x={};r.forEach(Ne=>{Object.assign(x,Ne.getDefines())}),Object.assign(x,s);let U=c?`${m}\n${function({id:n,source:e,type:t}){return n&&"string"==typeof n&&-1===e.indexOf("SHADER_NAME")?`\n#define SHADER_NAME ${n}_${tU[t]}\n\n`:""}({id:e,source:t,type:i})}\n${function({type:n}){return`\n#define SHADER_TYPE_${tU[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:boe(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// 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"}}(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 xx(n,kf.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"),xx(n,kf.GLSL_DERIVATIVES)&&Zj(n,kf.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"),xx(n,kf.GLSL_FRAG_DATA)&&Zj(n,kf.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"),xx(n,kf.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}(x)}\n${h?"":"precision highp float;\n\n"}\n`:`${m}\n`;const D=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),ie={},_e={},Pe={};for(const Ne in a){const Ve="string"==typeof a[Ne]?{injection:a[Ne],order:0}:a[Ne],bt=Ne.match(/^(v|f)s:(#)?([\w-]+)$/);if(bt){const At=bt[3];bt[2]?"decl"===At?_e[Ne]=[Ve]:Pe[Ne]=[Ve]:ie[Ne]=[Ve]}else Pe[Ne]=[Ve]}for(const Ne of r){u&&Ne.checkDeprecations(v,u),U+=Ne.getModuleSource(i,g);const bt=Ne.injections[i];for(const xt in bt){const At=xt.match(/^(v|f)s:#([\w-]+)$/);if(At){const Wt="decl"===At[2]?_e:Pe;Wt[xt]=Wt[xt]||[],Wt[xt].push(bt[xt])}else ie[xt]=ie[xt]||[],ie[xt].push(bt[xt])}}return U+=Ooe,U=qj(U,i,_e),U+=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}(D[i],ie),U+=v,U=qj(U,i,Pe),U=function(n,e,t){switch(e){case 300:return t?Sx(n,xoe):function(n){const e=(n=Sx(n,Soe)).match(LI);if(e){const t=e[1];n=n.replace(new RegExp(`\\b${FI}\\b`,"g"),t)}else{const t="fragmentColor";n=n.replace(Aoe,i=>`out vec4 ${t};\n${i}`).replace(new RegExp(`\\b${FI}\\b`,"g"),t)}return n}(n);case 100:return t?Sx(n,Coe):function(n){const e=(n=Sx(n,Toe)).match(LI);if(e){const t=e[1];n=n.replace(LI,"").replace(new RegExp(`\\b${t}\\b`,"g"),FI)}return n}(n);default:throw new Error(`unknown GLSL version ${e}`)}}(U,l?100:g,h),U}function Noe(n){return function(t){const i={};for(const r of n){const s=r.getUniforms(t,i);Object.assign(i,s)}return i}}const joe={5126:Ir.bind(null,"uniform1fv",Ha,1,Io),35664:Ir.bind(null,"uniform2fv",Ha,2,Io),35665:Ir.bind(null,"uniform3fv",Ha,3,Io),35666:Ir.bind(null,"uniform4fv",Ha,4,Io),5124:Ir.bind(null,"uniform1iv",dh,1,Io),35667:Ir.bind(null,"uniform2iv",dh,2,Io),35668:Ir.bind(null,"uniform3iv",dh,3,Io),35669:Ir.bind(null,"uniform4iv",dh,4,Io),35670:Ir.bind(null,"uniform1iv",dh,1,Io),35671:Ir.bind(null,"uniform2iv",dh,2,Io),35672:Ir.bind(null,"uniform3iv",dh,3,Io),35673:Ir.bind(null,"uniform4iv",dh,4,Io),35674:Ir.bind(null,"uniformMatrix2fv",Ha,4,Ju),35675:Ir.bind(null,"uniformMatrix3fv",Ha,9,Ju),35676:Ir.bind(null,"uniformMatrix4fv",Ha,16,Ju),35678:oo,35680:oo,5125:Ir.bind(null,"uniform1uiv",Cx,1,Io),36294:Ir.bind(null,"uniform2uiv",Cx,2,Io),36295:Ir.bind(null,"uniform3uiv",Cx,3,Io),36296:Ir.bind(null,"uniform4uiv",Cx,4,Io),35685:Ir.bind(null,"uniformMatrix2x3fv",Ha,6,Ju),35686:Ir.bind(null,"uniformMatrix2x4fv",Ha,8,Ju),35687:Ir.bind(null,"uniformMatrix3x2fv",Ha,6,Ju),35688:Ir.bind(null,"uniformMatrix3x4fv",Ha,12,Ju),35689:Ir.bind(null,"uniformMatrix4x2fv",Ha,8,Ju),35690:Ir.bind(null,"uniformMatrix4x3fv",Ha,12,Ju),35678:oo,35680:oo,35679:oo,35682:oo,36289:oo,36292:oo,36293:oo,36298:oo,36299:oo,36300:oo,36303:oo,36306:oo,36307:oo,36308:oo,36311:oo},Uoe={},zoe={},Hoe={},iU=[0];function BI(n,e,t,i){1===e&&"boolean"==typeof n&&(n=n?1:0),Number.isFinite(n)&&(iU[0]=n,n=iU);const r=n.length;if(r%e&&mn.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 Ir(n,e,t,i){let r=null,s=null;return(o,a,l)=>{const c=e(l,t),u=c.length;let h=!1;if(null===r)r=new Float32Array(u),s=u,h=!0;else{on(s===u,"Uniform length cannot change.");for(let f=0;f{const a=String(o+e);return aU(a,r-a.length)+t+s})}(e);return{shaderName:l,errors:oU(s,c),warnings:oU(o,c)}}(i,this.source,this.shaderType,this.id);throw mn.error(`GLSL compilation errors in ${r}\n${s}`)(),mn.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 VI extends P0{get[Symbol.toStringTag](){return"VertexShader"}constructor(e,t){"string"==typeof t&&(t={source:t}),super(e,Object.assign({},t,{shaderType:35633}))}_createHandle(){return this.gl.createShader(35633)}}class jI extends P0{get[Symbol.toStringTag](){return"FragmentShader"}constructor(e,t){"string"==typeof t&&(t={source:t}),super(e,Object.assign({},t,{shaderType:35632}))}_createHandle(){return this.gl.createShader(35632)}}const Fs=5126,N0=5124,k0=5125,UI={[Fs]:[Fs,1,"float"],35664:[Fs,2,"vec2"],35665:[Fs,3,"vec3"],35666:[Fs,4,"vec4"],[N0]:[N0,1,"int"],35667:[N0,2,"ivec2"],35668:[N0,3,"ivec3"],35669:[N0,4,"ivec4"],[k0]:[k0,1,"uint"],36294:[k0,2,"uvec2"],36295:[k0,3,"uvec3"],36296:[k0,4,"uvec4"],35670:[Fs,1,"bool"],35671:[Fs,2,"bvec2"],35672:[Fs,3,"bvec3"],35673:[Fs,4,"bvec4"],35674:[Fs,8,"mat2"],35685:[Fs,8,"mat2x3"],35686:[Fs,8,"mat2x4"],35675:[Fs,12,"mat3"],35687:[Fs,12,"mat3x2"],35688:[Fs,12,"mat3x4"],35676:[Fs,16,"mat4"],35689:[Fs,16,"mat4x2"],35690:[Fs,16,"mat4x3"]};function fU(n){const e=UI[n];if(!e)return null;const[t,i]=e;return{type:t,components:i}}function pU(n,e){switch(n){case 5120:case 5121:case 5122:case 5123:n=Fs}for(const t in UI){const[i,r,s]=UI[t];if(i===n&&r===e)return{glType:t,name:s}}return null}class Aae{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(!Ci(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}=fU(i),a={type:s,size:r*o};this._inferProperties(e,t,a);const l={location:e,name:t,accessor:new _a(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}=fU(i),l={location:e,name:t,accessor:new _a({type:s,size:r*o})};this.varyingInfos.push(l),this.varyingInfosByName[l.name]=l}}const Mae=35981,Dae=["setVertexArray","setAttributes","setBuffers","unsetBuffers","use","getUniformCount","getUniformInfo","getUniformLocation","getUniformValue","getVarying","getFragDataLocation","getAttachedShaders","getAttributeCount","getAttributeLocation","getAttributeInfo"];class mU extends Ku{get[Symbol.toStringTag](){return"Program"}constructor(e,t={}){super(e,t),this.stubRemovedMethods("Program","v6.0",Dae),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=Mae}=e;return this.hash=t||"",this.vs="string"==typeof i?new VI(this.gl,{id:`${e.id}-vs`,source:i}):i,this.fs="string"==typeof r?new jI(this.gl,{id:`${e.id}-fs`,source:r}):r,on(this.vs instanceof VI),on(this.fs instanceof jI),this.uniforms={},this._textureUniforms={},s&&s.length>0&&(Ao(this.gl),this.varyings=s,this.gl2.transformFeedbackVaryings(this.handle,s,o)),this._compileAndLink(),this._readUniformLocationsFromLinkedProgram(),this.configuration=new Aae(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:u=c>0,vertexArray:h=null,transformFeedback:f,framebuffer:g,parameters:m={},uniforms:v,samplers:x}){if((v||x)&&(mn.deprecated("Program.draw({uniforms})","Program.setUniforms(uniforms)")(),this.setUniforms(v||{})),mn.priority>=e){const U=g?g.id:"default",D=`mode=${ch(this.gl,t)} verts=${i} instances=${c} indexType=${ch(this.gl,l)} isInstanced=${u} isIndexed=${a} Framebuffer=${U}`;mn.log(e,D)()}return on(h),this.gl.useProgram(this.handle),!(!this._areTexturesRenderable()||0===i||u&&0===c||(h.bindForDraw(i,c,()=>{if(void 0!==g&&(m=Object.assign({},m,{framebuffer:g})),f){const U=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 on(!1),0}}(t);f.begin(U)}this._bindTextures(),hc(this.gl,m,()=>{a&&u?this.gl2.drawElementsInstanced(t,i,l,r,c):a&&Ci(this.gl)&&!isNaN(s)&&!isNaN(o)?this.gl2.drawRangeElements(t,s,o,i,l,r):a?this.gl.drawElements(t,i,l,r):u?this.gl2.drawArraysInstanced(t,r,i,c):this.gl.drawArrays(t,r,i)}),f&&f.end()}),0))}setUniforms(e={}){mn.priority>=2&&function(n,e,t){for(const i in n){const r=n[i];if((!t||Boolean(t[i]))&&!Woe(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 ks&&(s=s.texture),s instanceof Pf)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)&&qoe(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 VI({handle:r});break;case 35632:i.fs=new jI({handle:r})}return i}_getParameter(e){return this.gl.getProgramParameter(this.handle,e)}_setId(e){if(!e){const t=this._getName();this.id=ma(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),mn.time(4,`linkProgram for ${this._getName()}`)(),e.linkProgram(this.handle),mn.timeEnd(4,`linkProgram for ${this._getName()}`)(),e.debug||mn.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),u=this._getHash(t),h=this._getHash(i),f=c.map(ie=>this._getHash(ie.name)).sort(),g=o.map(ie=>this._getHash(ie)),m=Object.keys(r).sort(),v=Object.keys(s).sort(),x=[],U=[];for(const ie of m)x.push(this._getHash(ie)),x.push(this._getHash(r[ie]));for(const ie of v)U.push(this._getHash(ie)),U.push(this._getHash(s[ie]));const D=`${u}/${h}D${x.join("/")}M${f.join("/")}I${U.join("/")}V${g.join("/")}H${this.stateHash}B${a}${l?"T":""}`;if(!this._programCache[D]){const ie=function(n,e){const{vs:t,fs:i}=e,r=doe(e.modules||[]);return{gl:n,vs:nU(n,Object.assign({},e,{source:t,type:R0,modules:r})),fs:nU(n,Object.assign({},e,{source:i,type:"fs",modules:r})),getUniforms:Noe(r)}}(this.gl,{vs:t,fs:i,modules:c,inject:s,defines:r,hookFunctions:this._hookFunctions,transpileToGLSL100:l});this._programCache[D]=new mU(this.gl,{hash:D,vs:ie.vs,fs:ie.fs,varyings:o,bufferMode:a}),this._getUniforms[D]=ie.getUniforms||(_e=>{}),this._useCounts[D]=0}return this._useCounts[D]++,this._programCache[D]}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":v0.chrome?"Chrome":v0.safari?"Safari":v0.mozInnerScreenX?"Firefox":"Unknown"}()}static getDefaultArray(e){return e.luma=e.luma||{},e.luma.defaultVertexArray||(e.luma.defaultVertexArray=new Ga(e,{handle:null,isDefaultArray:!0})),e.luma.defaultVertexArray}static getMaxAttributes(e){return Ga.MAX_ATTRIBUTES=Ga.MAX_ATTRIBUTES||e.getParameter(34921),Ga.MAX_ATTRIBUTES}static setConstant(e,t,i){switch(i.constructor){case Float32Array:Ga._setConstantFloatArray(e,t,i);break;case Int32Array:Ga._setConstantIntArray(e,t,i);break;case Uint32Array:Ga._setConstantUintArray(e,t,i);break;default:on(!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 Ga.getMaxAttributes(this.gl)}initialize(e={}){return this.setProps(e)}setProps(e){return this}setElementBuffer(e=null,t={}){return on(!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:u}=i,{gl:h,gl2:f}=this;return e=Number(e),this.bind(()=>{h.bindBuffer(34962,t.handle),c?(on(Ci(h)),f.vertexAttribIPointer(e,r,s,o,a)):h.vertexAttribPointer(e,r,s,l,o,a),h.enableVertexAttribArray(e),f.vertexAttribDivisor(e,u||0)}),this}enable(e,t=!0){return!t&&0===e&&!Ga.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 lr(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(!Mx||Mx.byteLength{switch(e){case 34373:return this.gl.getVertexAttribOffset(t,e);default:return this.gl.getVertexAttrib(t,e)}})}}const Fae=/^(.+)__LOCATION_([0-9]+)$/,Lae=["setBuffers","setGeneric","clearBindings","setLocations","setGenericValues","setDivisor","enable","disable"];class Bae{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 Ga(e),JV(this,"VertexArray","v6.0",Lae),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 lr(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,mn.once(3,()=>`unused value ${e} in ${this.id}`)(),s;const l=this._getAttributeInfo(a||o);if(!l)return s;const u=_a.resolve(l.accessor,this.accessors[o]||{},i,r),{size:h,type:f}=u;return on(Number.isFinite(h)&&Number.isFinite(f)),{location:o,accessor:u}}_getAttributeInfo(e){return this.configuration&&this.configuration.getAttributeInfo(e)}_getAttributeIndex(e){const t=Number(e);if(Number.isFinite(t))return{location:t};const i=Fae.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 lr)this.setBuffer(e,t);else if(Array.isArray(t)&&t.length&&t[0]instanceof lr)this.setBuffer(e,t[0],t[1]);else if(ArrayBuffer.isView(t)||Array.isArray(t))this.setConstant(e,t);else{if(!(t.buffer instanceof lr))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 lr){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 mn.deprecated("setElements","setElementBuffer")(),this.setElementBuffer(e,t)}}function L0(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+=L0(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 _U(n,e,t,i){const{gl:r}=n;if(!e)return{[i]:"null","Format ":"N/A"};let c,u,h,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 lr){const f=e,{data:g,changed:m}=f.getDebugData();let v;return u=m?"*":"",h=g,l=f.byteLength,a=l/g.BYTES_PER_ELEMENT/o,t?v=`${t.divisor>0?"I ":"P "} ${a} (x${o}=${l} bytes ${ch(r,s)})`:(c=!0,v=`${l} bytes`),{[i]:`${u}${L0(h,{size:o,isInteger:c})}`,"Format ":v}}return h=e,o=e.length,s=String(e.constructor.name).replace("Array",""),c=-1!==s.indexOf("nt"),{[i]:`${L0(h,{size:o,isInteger:c})} (constant)`,"Format ":`${o}x${s} (constant)`}}function Uae(n,e){const{type:t,size:i}=e,r=pU(t,i);return r?`${n} (${r.name})`:n}function yU({header:n="Uniforms",program:e,uniforms:t,undefinedOnly:i=!1}){on(e);const s=".*Matrix",a={},l=Object.keys(e._uniformSetters).sort();let c=0;for(const f of l)!f.match(".*_.*")&&!f.match(s)&&zI({table:a,header:n,uniforms:t,uniformName:f,undefinedOnly:i})&&c++;for(const f of l)f.match(s)&&zI({table:a,header:n,uniforms:t,uniformName:f,undefinedOnly:i})&&c++;for(const f of l)a[f]||zI({table:a,header:n,uniforms:t,uniformName:f,undefinedOnly:i})&&c++;let u=0;const h={};if(!i)for(const f in t){const g=t[f];a[f]||(u++,h[f]={Type:`NOT USED: ${g}`,[n]:L0(g)})}return{table:a,count:c,unusedTable:h,unusedCount:u}}function zI({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?L0(s):"N/A","Uniform Type":o?s:"NOT PROVIDED"},0))}function bU(n){const{type:e,size:t}=n.accessor,i=pU(e,t);return i?`${i.name} ${n.name}`:n.name}const Gae={POSITION:"positions",NORMAL:"normals",COLOR_0:"colors",TEXCOORD_0:"texCoords",TEXCOORD_1:"texCoords1",TEXCOORD_2:"texCoords2"};function Wae(n,e){const{attributeMap:t=Gae}=e||{};return t&&t[n]||n}function qae(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}on(Number.isFinite(e.size),`attribute ${n} needs size`)}const vU=()=>{},Kae={};class Yg{constructor(e,t={}){const{id:i=ma("model")}=t;on(dx(e)),this.id=i,this.gl=e,this.id=t.id||ma("Model"),this.lastLogTime=0,this.animated=!1,this.initialize(t)}initialize(e){this.props={},this.programManager=e.programManager||F0.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:u}=e;this.programProps={program:t,vs:i,fs:r,modules:s,defines:o,inject:a,varyings:l,bufferMode:c,transpileToGLSL100:u},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={},on(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:u}=e;this.programProps={program:t,vs:i,fs:r,modules:s,defines:o,inject:a,varyings:l,bufferMode:c,transpileToGLSL100:u},this._programDirty=!0}getUniforms(){return this.uniforms}setDrawMode(e){return this.drawMode=e,this}setVertexCount(e){return on(Number.isFinite(e)),this.vertexCount=e,this}setInstanceCount(e){return on(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=Wae(s,undefined);if("indices"===s)r=o;else if(o.constant)i[a]=o.value;else{const l=o.value,c=ot({},o);delete c.value,i[a]=[new lr(n,l),c],qae(s,c)}}if(r){const s=r.value||r;on(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 lr(n,{data:s,target:34963}),o]}return i}(this.gl,e),this.vertexArray.setAttributes(this.geometryBuffers),this}setAttributes(e={}){if(jg(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 fI(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),mn.priority>=2&&(c=this._logDrawCallStart(2));const u=this.vertexArray.getDrawParams(),{isIndexed:h=u.isIndexed,indexType:f=u.indexType,indexOffset:g=u.indexOffset,vertexArrayInstanced:m=u.isInstanced}=this.props;m&&!this.isInstanced&&mn.warn("Found instanced attributes on non-instanced model",this.id)();const{isInstanced:v,instanceCount:x}=this,{onBeforeRender:U=vU,onAfterRender:D=vU}=this.props;U(),this.program.setUniforms(this.uniforms);const ie=this.program.draw(Object.assign(Kae,e,{logPriority:c,uniforms:null,framebuffer:i,parameters:a,drawMode:this.getDrawMode(),vertexCount:this.getVertexCount(),vertexArray:l,transformFeedback:o,isIndexed:h,indexType:f,isInstanced:v,instanceCount:x,offset:h?g:0}));return D(),mn.priority>=2&&this._logDrawCallEnd(c,l,i),ie}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 mn.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:u}=this.programProps;t=this.programManager.get({vs:i,fs:r,modules:s,inject:o,defines:a,varyings:l,bufferMode:c,transpileToGLSL100:u}),this.program&&this._managedProgram&&this.programManager.release(this.program),this._programManagerState=this.programManager.stateHash,this._managedProgram=!0}on(t instanceof mU,"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 Bae(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 lr&&t.delete()}}_setAnimationProps(e){this.animated&&on(e,"Model.draw(): animated uniforms but no animationProps")}_setFeedbackBuffers(e={}){if(jg(e))return this;const{gl:t}=this.program;return this.transformFeedback=this.transformFeedback||new Hj(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:mn.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=_U(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}: ${Uae(s.name,a)}`),t[o]=_U(n,i[r],a,e)}}return t}({vertexArray:t,header:`${this.id} attributes`,attributes:this._attributes}),{table:o,unusedTable:a,unusedCount:l}=yU({header:`${this.id} uniforms`,program:this.program,uniforms:Object.assign({},this.program.uniforms,i)}),{table:c,count:u}=yU({header:`${this.id} uniforms`,program:this.program,uniforms:Object.assign({},this.program.uniforms,i),undefinedOnly:!0});u>0&&mn.log("MISSING UNIFORMS",Object.keys(c))(),l>0&&mn.log("UNUSED UNIFORMS",Object.keys(a))();const h=function(n){const e={},t=`Accessors for ${n.id}`;for(const i of n.attributeInfos)i&&(e[`in ${bU(i)}`]={[t]:JSON.stringify(i.accessor)});for(const i of n.varyingInfos)i&&(e[`out ${bU(i)}`]={[t]:JSON.stringify(i.accessor)});return e}(this.vertexArray.configuration);mn.table(e,s)(),mn.table(e,o)(),mn.table(e+1,h)(),r&&r.log({logLevel:2,message:`Rendered to ${r.id}`}),mn.groupEnd(2,`>>> DRAWING MODEL ${this.id}`)()}}class HI{static isSupported(e){return Ci(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();on(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 Yg(t,Object.assign({},e,{fs:e.fs||zj({version:Gj(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!(jg(n.feedbackBuffers)&&jg(n.feedbackMap)&&!(n.varyings&&n.varyings.length>0))})(t)&&(this.bufferTransform=new $se(e,t)),function(n){return!(jg(n._sourceTextures)&&!n._targetTexture&&!n._targetTextureVarying)}(t)&&(this.textureTransform=new soe(e,t)),on(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 Dx(){}const Jae={onStart:Dx,onUpdate:Dx,onInterrupt:Dx,onEnd:Dx};class B0{constructor(e){this._inProgress=!1,this._handle=null,this.timeline=e,this.settings={}}get inProgress(){return this._inProgress}start(e){this.cancel(),this.settings=ot(ot({},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 ale={interpolation:class{constructor({gl:e,attribute:t,timeline:i}){this.gl=e,this.type="interpolation",this.transition=new B0(i),this.attribute=t,this.attributeInTransition=new TI(e,t.settings),this.currentStartIndices=t.startIndices,this.currentLength=0,this.transform=function(n,e){const t=Lj(e.size);return new HI(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 lr(e,r),new lr(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;Bj(r);const o={numInstances:t,attribute:s,fromLength:this.currentLength,fromStartIndices:this.currentStartIndices,getData:e.enter};for(const a of r)Vj(ot({buffer:a},o));this.currentStartIndices=s.startIndices,this.currentLength=CI(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:Fj(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 B0(i),this.attribute=t,this.attributeInTransition=new TI(e,Sn(ot({},t.settings),{normalized:!1})),this.currentStartIndices=t.startIndices,this.currentLength=0,this.texture=function(n){return new ya(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 ks(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=Lj(e.size);return new HI(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 lr(e,r),new lr(e,r),new lr(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)Vj(ot({buffer:a},o));this.currentStartIndices=s.startIndices,this.currentLength=CI(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:Fj(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]}}),Bj(e),this.attributeInTransition.update({buffer:e[1],value:this.attribute.value}),px(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 lle{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=HI.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 Ri.warn("WebGL2 not supported by this browser. Transition for ".concat(e," is disabled."))();r&&this._removeTransition(e);const o=ale[i.type];o?this.transitions[e]=new o({attribute:t,timeline:this.timeline,gl:this.gl}):(Ri.error("unsupported transition type '".concat(i.type,"'"))(),s=!1)}(s||t.needsRedraw())&&(this.needsRedraw=!0,this.transitions[e].start(i,this.numInstances))}}const wU="attributeManager.invalidate";class ple{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 lle(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;Do("attribute.updateStart",t),t.allocate(i)&&Do("attribute.allocate",t,i),t.updateBuffer(e)&&(this.needsRedraw=!0,Do("attribute.updateEnd",t,i))}}function xU(n,e,t,i,r){const s=e-n;return(t-e)*r+-s*i+s+e}function SU(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=kj(r)))return;const o=yle[r.type];if(!o)return void Ri.error("unsupported transition type '".concat(r.type,"'"))();const a=new o(this.timeline);a.start(Sn(ot({},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 Ix={COMPONENT:Symbol.for("component"),ASYNC_DEFAULTS:Symbol.for("asyncPropDefaults"),ASYNC_ORIGINAL:Symbol.for("asyncPropOriginal"),ASYNC_RESOLVED:Symbol.for("asyncPropResolved")},{COMPONENT:vle}=Ix;function xle(n,e){if(!n.transitions)return null;const t={},i=$I(n);for(const r in n.transitions){const s=i[r],o=s&&s.type;("number"===o||"color"===o||"array"===o)&&GI(n[r],e[r],s)&&(t[r]=!0)}return t}function CU({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=GI(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=GI(n[s],e[s],i[s]);if(o)return"".concat(r,".").concat(s," ").concat(o)}}return null}function GI(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 Tle(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(!Rle(i[r],e[r])){t=n(i),e=i;break}return t}}function Ple(n,e){if(!e)return n;const t=ot(ot({},n),e);if("defines"in e&&(t.defines=ot(ot({},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=ot({},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 WI(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],u=e[8],h=e[9],f=e[10],g=e[11],m=e[12],v=e[13],x=e[14],U=e[15],D=t*a-i*o,ie=t*l-r*o,_e=t*c-s*o,Pe=i*l-r*a,Ne=i*c-s*a,Ve=r*c-s*l,bt=u*v-h*m,xt=u*x-f*m,At=u*U-g*m,Bt=h*x-f*v,Wt=h*U-g*v,gt=f*U-g*x,mt=D*gt-ie*Wt+_e*Bt+Pe*At-Ne*xt+Ve*bt;return mt?(n[0]=(a*gt-l*Wt+c*Bt)*(mt=1/mt),n[1]=(r*Wt-i*gt-s*Bt)*mt,n[2]=(v*Ve-x*Ne+U*Pe)*mt,n[3]=(f*Ne-h*Ve-g*Pe)*mt,n[4]=(l*At-o*gt-c*xt)*mt,n[5]=(t*gt-r*At+s*xt)*mt,n[6]=(x*_e-m*Ve-U*ie)*mt,n[7]=(u*Ve-f*_e+g*ie)*mt,n[8]=(o*Wt-a*At+c*bt)*mt,n[9]=(i*At-t*Wt-s*bt)*mt,n[10]=(m*Ne-v*_e+U*D)*mt,n[11]=(h*_e-u*Ne-g*D)*mt,n[12]=(a*xt-o*Bt-l*bt)*mt,n[13]=(t*Bt-i*xt+r*bt)*mt,n[14]=(v*ie-m*Pe-x*D)*mt,n[15]=(u*Pe-h*ie+f*D)*mt,n):null}function Ff(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],u=e[7],h=e[8],f=e[9],g=e[10],m=e[11],v=e[12],x=e[13],U=e[14],D=e[15],ie=t[0],_e=t[1],Pe=t[2],Ne=t[3];return n[0]=ie*i+_e*a+Pe*h+Ne*v,n[1]=ie*r+_e*l+Pe*f+Ne*x,n[2]=ie*s+_e*c+Pe*g+Ne*U,n[3]=ie*o+_e*u+Pe*m+Ne*D,n[4]=(ie=t[4])*i+(_e=t[5])*a+(Pe=t[6])*h+(Ne=t[7])*v,n[5]=ie*r+_e*l+Pe*f+Ne*x,n[6]=ie*s+_e*c+Pe*g+Ne*U,n[7]=ie*o+_e*u+Pe*m+Ne*D,n[8]=(ie=t[8])*i+(_e=t[9])*a+(Pe=t[10])*h+(Ne=t[11])*v,n[9]=ie*r+_e*l+Pe*f+Ne*x,n[10]=ie*s+_e*c+Pe*g+Ne*U,n[11]=ie*o+_e*u+Pe*m+Ne*D,n[12]=(ie=t[12])*i+(_e=t[13])*a+(Pe=t[14])*h+(Ne=t[15])*v,n[13]=ie*r+_e*l+Pe*f+Ne*x,n[14]=ie*s+_e*c+Pe*g+Ne*U,n[15]=ie*o+_e*u+Pe*m+Ne*D,n}function Rx(n,e,t){var o,a,l,c,u,h,f,g,m,v,x,U,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],u=e[4],h=e[5],f=e[6],g=e[7],m=e[8],v=e[9],x=e[10],U=e[11],n[0]=o=e[0],n[1]=a,n[2]=l,n[3]=c,n[4]=u,n[5]=h,n[6]=f,n[7]=g,n[8]=m,n[9]=v,n[10]=x,n[11]=U,n[12]=o*i+u*r+m*s+e[12],n[13]=a*i+h*r+v*s+e[13],n[14]=l*i+f*r+x*s+e[14],n[15]=c*i+g*r+U*s+e[15]),n}function Px(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 AU(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],u=e[9],h=e[10],f=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+u*i,n[6]=a*r+h*i,n[7]=l*r+f*i,n[8]=c*r-s*i,n[9]=u*r-o*i,n[10]=h*r-a*i,n[11]=f*r-l*i,n}function MU(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],u=e[5],h=e[6],f=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+u*i,n[2]=a*r+h*i,n[3]=l*r+f*i,n[4]=c*r-s*i,n[5]=u*r-o*i,n[6]=h*r-a*i,n[7]=f*r-l*i,n}function IU(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 Nx(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 OU(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],u=c*i+a*s-l*r,h=c*r+l*i-o*s,f=c*s+o*r-a*i,g=-o*i-a*r-l*s;return n[0]=u*c+g*-o+h*-l-f*-a,n[1]=h*c+g*-a+f*-o-u*-l,n[2]=f*c+g*-l+u*-a-h*-o,n[3]=e[3],n}!function(){var n=new ba(4);ba!=Float32Array&&(n[0]=0,n[1]=0,n[2]=0,n[3]=0)}();const RU=[0,0,0,0],rce=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0],sce=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],oce=[0,0,0],ace=[0,0,0],lce=Ox(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=RU,l=RU,c=n.cameraPosition;const{geospatialOrigin:u,shaderCoordinateOrigin:h,offsetMode:f}=PU(n,e,t);return f&&(l=n.projectPosition(u||h),c=[c[0]-l[0],c[1]-l[1],c[2]-l[2]],l[3]=1,a=Nx([],l,o),s=i||s,o=Ff([],r,s),o=Ff([],o,rce)),{viewMatrix:s,viewProjectionMatrix:o,projectionCenter:a,originCommon:l,cameraPosCommon:c,shaderCoordinateOrigin:h,geospatialOrigin:u}}(n,t,i),u=n.getDistanceScales(),h=[n.width*e,n.height*e],f=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:h,project_uDevicePixelRatio:e,project_uFocalDistance:f,project_uCommonUnitsPerMeter:u.unitsPerMeter,project_uCommonUnitsPerWorldUnit:u.unitsPerMeter,project_uCommonUnitsPerWorldUnit2:oce,project_uScale:n.scale,project_uViewProjectionMatrix:s,project_uCameraPosition:a};if(c){const m=n.getDistanceScales(c);switch(t){case Vi.METER_OFFSETS:g.project_uCommonUnitsPerWorldUnit=m.unitsPerMeter,g.project_uCommonUnitsPerWorldUnit2=m.unitsPerMeter2;break;case Vi.LNGLAT:case Vi.LNGLAT_OFFSETS:g.project_uCommonUnitsPerWorldUnit=m.unitsPerDegree,g.project_uCommonUnitsPerWorldUnit2=m.unitsPerDegree2;break;case Vi.CARTESIAN:g.project_uCommonUnitsPerWorldUnit=[1,1,m.unitsPerMeter[2]],g.project_uCommonUnitsPerWorldUnit2=[0,0,m.unitsPerMeter2[2]]}}return g});function PU(n,e,t=ace){let r,i=t,s=!0;switch(r=e===Vi.LNGLAT_OFFSETS||e===Vi.METER_OFFSETS?t:n.isGeospatial?[Math.fround(n.longitude),Math.fround(n.latitude),0]:null,n.projectionMode){case Zc.WEB_MERCATOR:(e===Vi.LNGLAT||e===Vi.CARTESIAN)&&(s=!1);break;case Zc.WEB_MERCATOR_AUTO_OFFSET:e===Vi.LNGLAT?i=r:e===Vi.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 Zc.IDENTITY:i=n.position.map(Math.fround);break;case Zc.GLOBE:s=!1,r=null;break;default:s=!1}return i[2]=i[2]||0,{geospatialOrigin:r,shaderCoordinateOrigin:i,offsetMode:s}}class hce extends mx{get ELEMENTS(){return Zu(!1),0}get RANK(){return Zu(!1),0}toString(){let e="[";if(Dr.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 qn).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 function(n,e,t,i,r){var o,s=1/Math.tan(e/2);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)}(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],u=n[9],h=n[10],f=n[11],g=n[12],m=n[13],v=n[14],x=n[15];return(e*o-t*s)*(h*x-f*v)-(e*a-i*s)*(u*x-f*m)+(e*l-r*s)*(u*v-h*m)+(t*a-i*o)*(c*x-f*g)-(t*l-r*o)*(c*v-h*g)+(i*l-r*a)*(c*m-u*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 WI(this,this),this.check()}multiplyLeft(e){return Ff(this,e,this),this.check()}multiplyRight(e){return Ff(this,this,e),this.check()}rotateX(e){return AU(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],u=e[9],h=e[10],f=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-u*i,n[2]=a*r-h*i,n[3]=l*r-f*i,n[8]=s*i+c*r,n[9]=o*i+u*r,n[10]=a*i+h*r,n[11]=l*i+f*r}(this,this,e),this.check()}rotateZ(e){return MU(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,u,h,f,g,m,v,x,U,D,ie,_e,Pe,Ne,Ve,bt,xt,At,Bt,Wt,gt,mt,jt,r=i[0],s=i[1],o=i[2],a=Math.hypot(r,s,o);at?t:n}const qI=Math.log2||function(n){return Math.log(n)*Math.LOG2E};function ed(n,e){if(!n)throw new Error(e||"@math.gl/web-mercator: assertion failed.")}const pc=Math.PI,VU=pc/4,gc=pc/180,YI=180/pc,XI=4003e4,Fx=85.051129;function Lx([n,e]){return ed(Number.isFinite(n)),ed(Number.isFinite(e)&&e>=-90&&e<=90,"invalid latitude"),[512*(n*gc+pc)/(2*pc),512*(pc+Math.log(Math.tan(VU+e*gc*.5)))/(2*pc)]}function Zg([n,e]){const t=n/512*(2*pc)-pc,i=2*(Math.atan(Math.exp(e/512*(2*pc)-pc))-VU);return[t*YI,i*YI]}function KI({latitude:n,longitude:e,highPrecision:t=!1}){ed(Number.isFinite(n)&&Number.isFinite(e));const i={},s=Math.cos(n*gc),o=512/360,a=o/s,l=512/XI/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=gc*Math.tan(n*gc)/s,h=512/XI*c,f=h/a*l;i.unitsPerDegree2=[0,o*c/2,h],i.unitsPerMeter2=[f,0,f]}return i}function jU(n,e){const[t,i,r]=n,[s,o,a]=e,{unitsPerMeter:l,unitsPerMeter2:c}=KI({longitude:t,latitude:i,highPrecision:!0}),u=Lx(n);u[0]+=s*(l[0]+c[0]*o),u[1]+=o*(l[1]+c[1]*o);const h=Zg(u),f=(r||0)+(a||0);return Number.isFinite(r)||Number.isFinite(a)?[h[0],h[1],f]:h}function zU(n){return 2*Math.atan(.5/n)*YI}function HU(n,e){const[t,i,r=0]=n;return ed(Number.isFinite(t)&&Number.isFinite(i)&&Number.isFinite(r)),Qg(e,[t,i,r,1])}function j0(n,e,t=0){const[i,r,s]=n;if(ed(Number.isFinite(i)&&Number.isFinite(r),"invalid pixel coordinate"),Number.isFinite(s))return Qg(e,[i,r,s,1]);const o=Qg(e,[i,r,0,1]),a=Qg(e,[i,r,1,1]),l=o[2],c=a[2];return kU([],o,a,l===c?0:((t||0)-l)/(c-l))}const GU=Math.PI/180;function $U(n,e,t){const{pixelUnprojectionMatrix:i}=n,r=Qg(i,[e,0,1,1]),s=Qg(i,[e,n.height,1,1]),c=Zg(kU([],r,s,(t*n.distanceScales.unitsPerMeter[2]-r[2])/(s[2]-r[2])));return c[2]=t,c}const Dce=Math.PI/180,Ice=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],ZI=[0,0,0],Rce={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?Zc.WEB_MERCATOR:Zc.WEB_MERCATOR_AUTO_OFFSET:Zc.IDENTITY}equals(t){return t instanceof n&&(this===t||t.width===this.width&&t.height===this.height&&t.scale===this.scale&&M0(t.projectionMatrix,this.projectionMatrix)&&M0(t.viewMatrix,this.viewMatrix))}project(t,{topLeft:i=!0}={}){const s=HU(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,u=j0([s,i?o:this.height-o,a],this.pixelUnprojectionMatrix,r&&r*this.distanceScales.unitsPerMeter[2]),[h,f,g]=this.unprojectPosition(u);return Number.isFinite(a)?[h,f,g]:Number.isFinite(r)?[h,f,r]:[h,f]}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?Lx(t):t}unprojectFlat(t){return this.isGeospatial?Zg(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?KI({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:u=!1,repeat:h=!1,worldOffset:f=0}=t;let{width:g,height:m,altitude:v=1.5}=t;const x=Math.pow(2,s);g=g||1,m=m||1,v=Math.max(.75,v);const{fov:U,aspect:D,focalDistance:ie,near:_e,far:Pe}=function({width:n,height:e,fovy:t=zU(1.5),altitude:i,pitch:r=0,nearZMultiplier:s=1,farZMultiplier:o=1}){void 0!==i&&(t=zU(i));const a=.5*t*gc,l=function(n){return.5/Math.tan(.5*n*gc)}(t),c=r*gc,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:n/e,focalDistance:l,near:s,far:(Math.sin(c)*u+l)*o}}({width:g,height:m,pitch:o,altitude:v,nearZMultiplier:l,farZMultiplier:c});let Ne=function({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 Rx(o,o,[0,0,-i]),AU(o,o,-e*gc),MU(o,o,t*gc),Px(o,o,[r/=n,r,r]),s&&Rx(o,o,function(n,e){return n[0]=-e[0],n[1]=-e[1],n[2]=-e[2],n}([],s)),o}({height:m,pitch:o,bearing:a,scale:x,altitude:v});f&&(Ne=(new qn).translate([512*f,0,0]).multiplyLeft(Ne)),super(Sn(ot({},t),{width:g,height:m,viewMatrix:Ne,longitude:r,latitude:i,zoom:s,orthographic:u,fovyRadians:U,aspect:D,focalDistance:ie,near:_e,far:Pe})),this.latitude=i,this.longitude=r,this.zoom=s,this.pitch=o,this.bearing=a,this.altitude=v,this.orthographic=u,this._subViewports=h?[]: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(Sn(ot({},this),{worldOffset:s})):this;this._subViewports.push(o)}}return this._subViewports}addMetersToLngLat(t,i){return jU(t,i)}panByPosition(t,i){const r=j0(i,this.pixelUnprojectionMatrix),o=kx([],this.projectFlat(t),NU([],r)),a=kx([],this.center,o),[l,c]=this.unprojectFlat(a);return{longitude:l,latitude:c}}getBounds(t={}){const i=function(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*GU:Math.atan(.5/n.altitude))>(90-n.pitch)*GU-.01?(l=$U(n,0,e),c=$U(n,t,e)):(l=r([0,0],s),c=r([t,0],s)),[o,a,c,l]}(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}=function({width:n,height:e,bounds:t,minExtent:i=0,maxZoom:r=24,padding:s=0,offset:o=[0,0]}){const[[a,l],[c,u]]=t;Number.isFinite(s)?s={top:s,bottom:s,left:s,right:s}:ed(Number.isFinite(s.top)&&Number.isFinite(s.bottom)&&Number.isFinite(s.left)&&Number.isFinite(s.right));const h=Lx([a,BU(u,-Fx,Fx)]),f=Lx([c,BU(l,-Fx,Fx)]),g=[Math.max(Math.abs(f[0]-h[0]),i),Math.max(Math.abs(f[1]-h[1]),i)],m=[n-s.left-s.right-2*Math.abs(o[0]),e-s.top-s.bottom-2*Math.abs(o[1])];ed(m[0]>0&&m[1]>0);const v=m[0]/g[0],x=m[1]/g[1],_e=Zg([(f[0]+h[0])/2+(s.right-s.left)/2/v,(f[1]+h[1])/2+(s.bottom-s.top)/2/x]),Pe=Math.min(r,qI(Math.abs(Math.min(v,x))));return ed(Number.isFinite(Pe)),{longitude:_e[0],latitude:_e[1],zoom:Pe}}(ot({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 JI(n,e,t=!1){const i=e.projectPosition(n);if(t&&e instanceof KU){const[r,s,o=0]=n,a=e.getDistanceScales([r,s]);i[2]=o*a.unitsPerMeter[2]}return i}function QU(n,{viewport:e,modelMatrix:t,coordinateSystem:i,coordinateOrigin:r,offsetMode:s}){let[o,a,l=0]=n;switch(t&&([o,a,l]=Nx([],[o,a,l,1],t)),i){case Vi.LNGLAT:return JI([o,a,l],e,s);case Vi.LNGLAT_OFFSETS:return JI([o+r[0],a+r[1],l+(r[2]||0)],e,s);case Vi.METER_OFFSETS:return JI(jU(r,[o,a,l]),e,s);case Vi.CARTESIAN:default:return e.isGeospatial?[o+r[0],a+r[1],l+r[2]]:e.projectPosition([o,a,l])}}const kce={10241:9987,10240:9729,10242:33071,10243:33071},eO={},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||z0(n)&&(3===n.length||4===n.length),equal:(n,e,t)=>tO(n,e)},accessor:{validate(n,e){const t=Bx(n);return"function"===t||t===Bx(e.value)},equal:(n,e,t)=>"function"==typeof e||tO(n,e)},array:{validate:(n,e)=>e.optional&&!n||z0(n),equal:(n,e,t)=>t.compare?tO(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 ya)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 ya(t,Sn(ot({},e),{parameters:ot(ot(ot({},kce),i),n.props.textureParameters)}));return eO[r.id]=!0,r}(t,n),release:n=>{!function(n){!n||!(n instanceof ya)||eO[n.id]&&(n.delete(),delete eO[n.id])}(n)}}};function tO(n,e){if(n===e)return!0;if(!z0(n)||!z0(e))return!1;const t=n.length;if(t!==e.length)return!1;for(let i=0;i{},this.oldProps=Qce,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[Xce]||{},i=e[Yce]||e,r=e[Kce]||{};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(Pj(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 li(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 h,c=!0,u=!1;try{for(var g,m,f=iO(t);c=(g=yield f.next()).done,m=yield g.value,!c;c=!0){const x=m,{dataTransform:U}=i.component?i.component.props:{};a=U?U(x,a):a.concat(x),Object.defineProperty(a,"__diff",{enumerable:!1,value:[{startRow:l,endRow:a.length}]}),l=a.length,i._setAsyncPropValue(e,a,o)}}catch(x){u=!0,h=x}finally{try{!c&&null!=f.return&&(yield f.return())}finally{if(u)throw h}}const v=null===(r=i.layer)||void 0===r?void 0:r.props.onDataLoad;v&&v(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:tz,ASYNC_RESOLVED:nz,ASYNC_DEFAULTS:Zce}=Ix,Jce={};let eue=0,tue=(()=>{class n{constructor(){this.props=Uce.apply(this,arguments),this.id=this.props.id,this.count=eue++,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[Zce])s in i[nz]?r[s]=i[nz][s]:s in i[tz]&&(r[s]=i[tz][s]);return new this.constructor(ot(ot(ot({},i),r),t))}get stats(){return this.internalState.stats}_initState(){this.internalState=new ez({})}}return n.componentName="Component",n.defaultProps=Jce,n})();class nue extends ez{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 mc=n=>"function"==typeof n,hh=n=>null!==n&&"object"==typeof n,rz=n=>hh(n)&&n.constructor==={}.constructor,iue=n=>n&&"function"==typeof n[Symbol.iterator],rue=n=>n&&"function"==typeof n[Symbol.asyncIterator],G0=n=>"undefined"!=typeof Response&&n instanceof Response||n&&n.arrayBuffer&&n.text&&n.json,em=n=>"undefined"!=typeof Blob&&n instanceof Blob,sz=n=>(n=>"undefined"!=typeof ReadableStream&&n instanceof ReadableStream||hh(n)&&mc(n.tee)&&mc(n.cancel)&&mc(n.getReader))(n)||(n=>hh(n)&&mc(n.read)&&mc(n.pipe)&&(n=>"boolean"==typeof n)(n.readable))(n);function Lf(n,e){if(!n)throw new Error(e||"loader assertion failed.")}function rO(n){var e;return!!n&&(Array.isArray(n)&&(n=n[0]),Array.isArray(null===(e=n)||void 0===e?void 0:e.extensions))}function sO(n){var e,t;let i;return Lf(n,"null loader"),Lf(rO(n),"invalid loader"),Array.isArray(n)&&(i=n[1],n=Sn(ot({},n=n[0]),{options:ot(ot({},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 tu={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},oO=tu.global||tu.self||tu.window||{},uue="object"!=typeof process||"[object process]"!==String(process)||process.browser,oz="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version);oz&&parseFloat(oz[1]);const lO={};function due(n){for(const e in lO)n.startsWith(e)&&(n=n.replace(e,lO[e]));return!n.startsWith("http://")&&!n.startsWith("https://")&&(n=`${n}`),n}const hue=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,fue=/^([-\w.]+\/[-\w.+]+)/;function pue(n){const e=fue.exec(n);return e?e[1]:n}function az(n){const e=hue.exec(n);return e?e[1]:""}const gue=/\?.*/;function zx(n){if(G0(n)){const e=cO(n.url||"");return{url:e,type:pue(n.headers.get("content-type")||"")||az(e)}}return em(n)?{url:cO(n.name||""),type:n.type||""}:"string"==typeof n?{url:cO(n),type:az(n)}:{url:"",type:""}}function mue(n){return G0(n)?n.headers["content-length"]||-1:em(n)?n.size:"string"==typeof n?n.length:n instanceof ArrayBuffer||ArrayBuffer.isView(n)?n.byteLength:-1}function cO(n){return n.replace(gue,"")}function lz(n){return uO.apply(this,arguments)}function uO(){return(uO=li(function*(n){if(G0(n))return n;const e={},t=mue(n);t>=0&&(e["content-length"]=String(t));const{url:i,type:r}=zx(n);r&&(e["content-type"]=r);const s=yield bue(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 _ue(n){return dO.apply(this,arguments)}function dO(){return(dO=li(function*(n){if(!n.ok){const e=yield yue(n);throw new Error(e)}})).apply(this,arguments)}function yue(n){return hO.apply(this,arguments)}function hO(){return(hO=li(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 bue(n){return fO.apply(this,arguments)}function fO(){return(fO=li(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,${vue(n.slice(0,5))}`:null})).apply(this,arguments)}function vue(n){let e="";const t=new Uint8Array(n);for(let i=0;i{}}info(){return()=>{}}warn(){return()=>{}}error(){return()=>{}}}const dz={fetch:null,mimeType:void 0,nothrow:!1,log:new class{constructor(){Kn(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:[]},xue={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 gO(){oO.loaders=oO.loaders||{};const{loaders:n}=oO;return n._state=n._state||{},n._state}const mO=()=>{const n=gO();return n.globalOptions=n.globalOptions||ot({},dz),n.globalOptions};function Sue(n,e,t,i){return t=t||[],function(n,e){fz(n,null,dz,xue,e);for(const t of e)fz(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=ot({},n.options||{});return function(n,e){e&&!("baseUri"in n)&&(n.baseUri=e)}(r,t),null===r.log&&(r.log=new wue),gz(r,mO()),gz(r,e),r}(e,n,i)}function hz(n,e){const t=mO(),i=n||t;return"function"==typeof i.fetch?i.fetch:hh(i.fetch)?r=>cz(r,i):null!=e&&e.fetch?null==e?void 0:e.fetch:cz}function fz(n,e,t,i,r){const s=e||"Top level",o=e?`${e}.`:"";for(const a in n){const l=!e&&hh(n[a]),c="baseUri"===a&&!e,u="workerUrl"===a&&e;if(!(a in t)&&!c&&!u)if(a in i)uz.warn(`${s} loader option '${o}${a}' no longer supported, use '${i[a]}'`)();else if(!l){const h=Tue(a,r);uz.warn(`${s} loader option '${o}${a}' not recognized. ${h}`)()}}}function Tue(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 gz(n,e){for(const t in e)t in e&&(n[t]=rz(e[t])&&rz(n[t])?ot(ot({},n[t]),e[t]):e[t])}function nu(n,e){if(!n)throw new Error(e||"loaders.gl assertion failed.")}function Due(n,e="3.0.12"){return nu(n,"no worker provided"),!(!e||!n.version)}const iu={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},Iue=iu.global||iu.self||iu.window||{},_O="object"!=typeof process||"[object process]"!==String(process)||process.browser,yO="function"==typeof importScripts,Oue="undefined"!=typeof window&&void 0!==window.orientation,mz="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version),bO=(mz&&parseFloat(mz[1]),new Map);function _z(n){const e=new Blob([n],{type:"application/javascript"});return URL.createObjectURL(e)}function yz(n,e=!0,t){const i=t||new Set;if(n)if(bz(n))i.add(n);else if(bz(n.buffer))i.add(n.buffer);else if(!ArrayBuffer.isView(n)&&e&&"object"==typeof n)for(const r in n)yz(n[r],e,i);return void 0===t?Array.from(i):[]}function bz(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 vO=()=>{};class vz{static isSupported(){return"undefined"!=typeof Worker}constructor(e){Kn(this,"name",void 0),Kn(this,"source",void 0),Kn(this,"url",void 0),Kn(this,"terminated",!1),Kn(this,"worker",void 0),Kn(this,"onMessage",void 0),Kn(this,"onError",void 0),Kn(this,"_loadableURL","");const{name:t,source:i,url:r}=e;nu(i||r),this.name=t,this.source=i,this.url=r,this.onMessage=vO,this.onError=s=>console.log(s),this.worker=this._createBrowserWorker()}destroy(){this.onMessage=vO,this.onError=vO,this.worker.terminate(),this.terminated=!0}get isRunning(){return Boolean(this.onMessage)}postMessage(e,t){t=t||yz(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){nu(n.source&&!n.url||!n.source&&n.url);let e=bO.get(n.source||n.url);return e||(n.url&&(e=function(n){return n.startsWith("http")?_z(function(n){return`try {\n importScripts('${n}');\n} catch (error) {\n console.error(error);\n throw error;\n}`}(n)):n}(n.url),bO.set(n.url,e)),n.source&&(e=_z(n.source),bO.set(n.source,e))),nu(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 kue{constructor(e,t){Kn(this,"name",void 0),Kn(this,"workerThread",void 0),Kn(this,"isRunning",void 0),Kn(this,"result",void 0),Kn(this,"_resolve",void 0),Kn(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){nu(this.isRunning),this.isRunning=!1,this._resolve(e)}error(e){nu(this.isRunning),this.isRunning=!1,this._reject(e)}}class Fue{constructor(e){Kn(this,"name","unnamed"),Kn(this,"source",void 0),Kn(this,"url",void 0),Kn(this,"maxConcurrency",1),Kn(this,"maxMobileConcurrency",1),Kn(this,"onDebug",()=>{}),Kn(this,"reuseWorkers",!0),Kn(this,"props",{}),Kn(this,"jobQueue",[]),Kn(this,"idleQueue",[]),Kn(this,"count",0),Kn(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=ot(ot({},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 li(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 li(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 kue(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 td{static isSupported(){return vz.isSupported()}static getWorkerFarm(e={}){return td._workerFarm=td._workerFarm||new td({}),td._workerFarm.setProps(e),td._workerFarm}constructor(e){Kn(this,"props",void 0),Kn(this,"workerPools",new Map),this.props=ot({},Lue),this.setProps(e),this.workerPools=new Map}destroy(){for(const e of this.workerPools.values())e.destroy()}setProps(e){this.props=ot(ot({},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 Fue({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 Vue(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 nu(r),r}function jue(n,e){return!!td.isSupported()&&n.worker&&(null==e?void 0:e.worker)}function Uue(n,e,t,i,r){return wO.apply(this,arguments)}function wO(){return(wO=li(function*(n,e,t,i,r){const s=n.id,o=Vue(n,t),l=td.getWorkerFarm(t).getWorkerPool({name:s,url:o});t=JSON.parse(JSON.stringify(t));const c=yield l.startJob("process-on-worker",zue.bind(null,r));return c.postMessage("process",{input:e,options:t}),yield(yield c.result).result})).apply(this,arguments)}function zue(n,e,t,i){return EO.apply(this,arguments)}function EO(){return(EO=li(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)}Kn(td,"_workerFarm",void 0);var Ez=et(9521);function xz(n){if(function(n){return n&&"object"==typeof n&&n.isBuffer}(n)&&(n=function(n){return Ez.toArrayBuffer?Ez.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 Wue(...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 Sz(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 que(n){return SO.apply(this,arguments)}function SO(){return(SO=li(function*(n){const e=[];var r,t=!0,i=!1;try{for(var o,a,s=iO(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 Wue(...e)})).apply(this,arguments)}const Kue=262144;function Cz(n){this.wrapped=n}function $0(n){return new Cz(n)}function W0(n){var e,t;function r(o,a){try{var l=n[o](a),c=l.value,u=c instanceof Cz;Promise.resolve(u?c.wrapped:c).then(function(h){u?r("return"===o?"return":"next",h):s(l.done?"return":"normal",h)},function(h){r("throw",h)})}catch(h){s("throw",h)}}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 u={key:o,arg:a,resolve:l,reject:c,next:null};t?t=t.next=u:(e=t=u,r(o,a))})},"function"!=typeof n.return&&(this.return=void 0)}function TO(n){return function(){return new W0(n.apply(this,arguments))}}function AO(){return(AO=TO(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(IO)}function rde(n,e,t){return OO.apply(this,arguments)}function OO(){return(OO=li(function*(n,e,t){const i=n instanceof ArrayBuffer||ArrayBuffer.isView(n);if("string"==typeof n||i)return ide(n,e);if(em(n)&&(n=yield lz(n)),G0(n)){const r=n;return yield _ue(r),e.binary?yield r.arrayBuffer():yield r.text()}if(sz(n)&&(n=nde(n,t)),iue(n)||rue(n))return que(n);throw new Error(IO)})).apply(this,arguments)}function ode(n,e,t=null){if(t)return t;const i=ot({fetch:hz(e,n)},n);return Array.isArray(i.loaders)||(i.loaders=null),i}function ade(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 Az=()=>{const n=gO();return n.loaderRegistry=n.loaderRegistry||[],n.loaderRegistry};function Mz(n){const e=Az();n=Array.isArray(n)?n:[n];for(const t of n){const i=sO(t);e.find(r=>i===r)||e.unshift(i)}}const cde=/\.([^.]+)$/;function ude(n){return NO.apply(this,arguments)}function NO(){return(NO=li(function*(n,e=[],t,i){if(!Iz(n))return null;let r=Dz(n,e,Sn(ot({},t),{nothrow:!0}),i);if(r)return r;if(em(n)&&(r=Dz(n=yield n.slice(0,10).arrayBuffer(),e,t,i)),!(r||null!=t&&t.nothrow))throw new Error(Oz(n));return r})).apply(this,arguments)}function Dz(n,e=[],t,i){if(!Iz(n))return null;if(e&&!Array.isArray(e))return sO(e);let r=[];e&&(r=r.concat(e)),null!=t&&t.ignoreRegisteredLoaders||r.push(...Az()),function(n){for(const e of n)sO(e)}(r);const s=function(n,e,t,i){const{url:r,type:s}=zx(n),o=r||(null==i?void 0:i.url);let a=null;return null!=t&&t.mimeType&&(a=kO(e,null==t?void 0:t.mimeType)),a=a||function(n,e){const t=e&&cde.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||kO(e,s),a=a||function(n,e){if(!e)return null;for(const t of n)if("string"==typeof e){if(mde(e,t))return t}else if(ArrayBuffer.isView(e)){if(Rz(e.buffer,e.byteOffset,t))return t}else if(e instanceof ArrayBuffer&&Rz(e,0,t))return t;return null}(e,n),a=a||kO(e,null==t?void 0:t.fallbackMimeType),a}(n,r,t,i);if(!(s||null!=t&&t.nothrow))throw new Error(Oz(n));return s}function Iz(n){return!(n instanceof Response&&204===n.status)}function Oz(n){const{url:e,type:t}=zx(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)?FO(n.buffer,n.byteOffset,e):n instanceof ArrayBuffer?FO(n,0,e):""}(n)}", contentType: "${t}"`),e&&(i+=` url: ${e}`),i}function kO(n,e){for(const t of n)if(t.mimeTypes&&t.mimeTypes.includes(e)||e===`application/x.${t.id}`)return t;return null}function mde(n,e){return e.testText?e.testText(n):(Array.isArray(e.tests)?e.tests:[e.tests]).some(i=>n.startsWith(i))}function Rz(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 ru=new Uint8ClampedArray(0);const Ade={data:{type:"data",value:Cde,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=Sn(ot({},r),{fetch:Sn(ot({},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:q0(n,i),persistent:!1}),l=!0),l?o.subscribe({resourceId:n,onChange:c=>t.internalState.reloadAsyncProp(e,c),consumerId:t.id,requestId:e}):q0(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:Vi.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 Y0=(()=>{class n extends tue{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=QU(t,{viewport:i,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem}),[s,o,a]=HU(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=ot({},n);let{coordinateSystem:t}=n;const{viewport:i,coordinateOrigin:r,fromCoordinateSystem:s,fromCoordinateOrigin:o}=n;return t===Vi.DEFAULT&&(t=i.isGeospatial?Vi.LNGLAT:Vi.CARTESIAN),void 0===s&&(e.fromCoordinateSystem=t),void 0===o&&(e.fromCoordinateOrigin=r),e.coordinateSystem=t,e}(e),{geospatialOrigin:l,shaderCoordinateOrigin:c,offsetMode:u}=PU(t,i,r),h=QU(n,{viewport:t,modelMatrix:s,coordinateSystem:o,coordinateOrigin:a,offsetMode:u});u&&function(n,e,t){n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2]}(h,h,t.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===Vi.DEFAULT||t===Vi.LNGLAT||t===Vi.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){fc(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=Ple(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 u of c)o.invalidateAll(u);else o.invalidateAll()}const l=i.highlightedObjectIndex>=0||i.pickable;if((t.highlightedObjectIndex>=0||t.pickable)!==l&&o){const{pickingColors:c,instancePickingColors:u}=o.attributes,h=c||u;h&&(l&&h.constant&&(h.constant=!1,o.invalidate(h.id)),!h.value&&!l&&(h.constant=!0,h.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||!Tde({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(ru.length/3);if(this.internalState.usesPickingColorCache=!0,rPz&&Ri.warn("Layer has too many data objects. Picking might not be able to distinguish all objects.")(),ru=A0.allocate(ru,i,{size:3,copy:!0,maxCount:Math.max(i,Pz)});const s=Math.floor(ru.length/3),o=[];for(let a=r;a{const c={moduleParameters:t,uniforms:i,parameters:r,context:this.context};for(const u of this.props.extensions)u.draw.call(this,c,u);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&&Do("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=CU({newProps:n,oldProps:e,propTypes:$I(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&&TU(n,e,"all"))return{all:!0};const t={};let i=!1;for(const r in n.updateTriggers)"all"!==r&&TU(n,e,r)&&(t[r]=!0,i=t);return i}(n,e)),{dataChanged:i,propsChanged:t,updateTriggersChanged:r,extensionsChanged:Tle(n,e),transitionsChanged:xle(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=$I(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 ple(this.context.gl,{id:this.props.id,stats:this.context.stats,timeline:this.context.timeline})}_initState(){fc(!this.internalState&&!this.state),fc(isFinite(this.props.coordinateSystem));const t=this._getAttributeManager();t&&t.addInstanced({instancePickingColors:{type:5121,size:3,noAlloc:!0,update:this.calculateInstancePickingColors}}),this.internalState=new nue({attributeManager:t,layer:this}),this.clearChangeFlags(),this.state={},Object.defineProperty(this.state,"attributeManager",{get:()=>(Ri.deprecated("layer.state.attributeManager","layer.getAttributeManager()"),t)}),this.internalState.layer=this,this.internalState.uniformTransitions=new ble(this.context.timeline),this.internalState.onAsyncPropUpdated=this._onAsyncPropUpdated.bind(this),this.internalState.setAsyncProps(this.props)}_transferState(t){Do("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=Ade,n})(),Nz=(()=>{class n extends Y0{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:u,coordinateSystem:h,coordinateOrigin:f,wrapLongitude:g,positionFormat:m,modelMatrix:v,extensions:x,fetch:U,_subLayerProps:D}=this.props,ie={opacity:i,pickable:r,visible:s,parameters:o,getPolygonOffset:a,highlightedObjectIndex:l,autoHighlight:c,highlightColor:u,coordinateSystem:h,coordinateOrigin:f,wrapLongitude:g,positionFormat:m,modelMatrix:v,extensions:x,fetch:U},_e=D&&D[t.id],Pe=_e&&_e.updateTriggers,Ne=t.id||"sublayer";if(_e){const Ve=this.constructor._propTypes,bt=t.type?t.type._propTypes:{};for(const xt in _e){const At=bt[xt]||Ve[xt];At&&"accessor"===At.type&&(_e[xt]=this.getSubLayerAccessor(_e[xt]))}}Object.assign(ie,t,_e),ie.id="".concat(this.props.id,"-").concat(Ne),ie.updateTriggers=ot(ot({all:this.props.updateTriggers.all},t.updateTriggers),Pe);for(const Ve of x){const bt=Ve.getSubLayerProps.call(this,Ve);bt&&Object.assign(ie,bt,{updateTriggers:Object.assign(ie.updateTriggers,bt.updateTriggers)})}return ie}_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=xI(t,Boolean),this.internalState.subLayers=t),Do("compositeLayer.renderLayers",this,i,t);for(const r of t)r.parent=this}}return n.layerName="CompositeLayer",n})();const Dde=/([0-9]+\.?[0-9]*)(%|px)/;function Gx(n){switch(typeof n){case"number":return{position:n,relative:!1};case"string":const e=n.match(Dde);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 $x(n,e){return n.relative?Math.round(n.position*e):n.position}function X0(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)&&X0(i,r)))return!1}return!0}class jO{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:u=1e3,modelMatrix:h=null,viewportInstance:f=null,type:g=Jg}=e;fc(!f||f instanceof Jg),this.viewportInstance=f,this.id=t||this.constructor.displayName||"view",this.type=g,this.props=Sn(ot({},e),{id:this.id,projectionMatrix:a,fovy:l,near:c,far:u,modelMatrix:h}),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):X0(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=ot({},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:$x(this._x,e),y:$x(this._y,t),width:$x(this._width,e),height:$x(this._height,t)}}_getControllerProps(e){let t=this.props.controller;return t?!0===t?e:("function"==typeof t&&(t={type:t}),ot(ot({},e),t)):null}_getViewport(e,t){const{type:i}=this;return new i(ot(ot(ot({},e),this.props),t))}_parseDimensions({x:e,y:t,width:i,height:r}){this._x=Gx(e),this._y=Gx(t),this._width=Gx(i),this._height=Gx(r)}}const K0=()=>{},kz={transitionEasing:n=>n,transitionInterruption:1,onTransitionStart:K0,onTransitionInterrupt:K0,onTransitionEnd:K0};class Ide{constructor(e,t={}){this.ControllerState=e,this.props=ot(ot({},kz),t),this.propsInTransition=null,this.transition=new B0(t.timeline),this.onViewStateChange=t.onViewStateChange||K0,this.onStateChange=t.onStateChange||K0,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=ot(ot({},kz),e),this.props=e,this._shouldIgnoreViewportChange(i,e))return t;if(this._isTransitionEnabled(e)){const{interruption:r,endProps:s}=this.transition.settings,o=ot(ot({},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(ot(ot({},this.props),c)).getViewportProps(),this.onViewStateChange({viewState:this.propsInTransition,oldViewState:this.props})}}const Fz=["longitude","latitude","zoom","bearing","pitch"],Rde=["longitude","latitude","zoom"];class Lz 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)||!M0(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];fc(Number.isFinite(i)||Array.isArray(i),"".concat(t," is required for transition"))})}}{constructor(e={}){super((Array.isArray(e)?e:e.transitionProps)||{compare:Fz,extract:Fz,required:Rde}),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]=gx(e[s]||0,t[s]||0,i);if(t.aroundPosition){const s=this.opts.makeViewport(ot(ot({},t),r));Object.assign(r,s.panByPosition(t.aroundPosition,gx(e.around,t.around,i)))}return r}}const fh={transitionDuration:0},Pde={transitionDuration:300,transitionEasing:n=>n,transitionInterruption:1},qx=n=>1-(1-n)*(1-n),tm_WHEEL=["wheel"],tm_PAN=["panstart","panmove","panend"],tm_PINCH=["pinchstart","pinchmove","pinchend"],tm_TRIPLE_PAN=["tripanstart","tripanmove","tripanend"],tm_DOUBLE_TAP=["doubletap"],tm_KEYBOARD=["keydown"];class UO{constructor(e,t={}){this.ControllerState=e,this.controllerState=null,this.controllerStateProps=null,this.eventManager=null,this.transitionManager=new Ide(e,Sn(ot({},t),{onViewStateChange:this._onTransition.bind(this),onStateChange:this._setInteractionState.bind(this)}));const i=this.linearTransitionProps;this._transition=i&&Sn(ot({},Pde),{transitionInterpolator:new Lz({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(ot(ot({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,u=Boolean(this.onViewStateChange);this.toggleEvents(tm_WHEEL,u&&i),this.toggleEvents(tm_PAN,u&&(r||s)),this.toggleEvents(tm_PINCH,u&&(a||l)),this.toggleEvents(tm_TRIPLE_PAN,u&&l),this.toggleEvents(tm_DOUBLE_TAP,u&&o),this.toggleEvents(tm_KEYBOARD,u&&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=ot(ot({},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,fh,{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,fh,{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,Sn(ot({},this._getTransitionProps()),{transitionDuration:t,transitionEasing:qx}),{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,fh,{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,Sn(ot({},this._getTransitionProps()),{transitionDuration:t,transitionEasing:qx}),{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,Sn(ot({},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,fh,{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,fh,{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,Sn(ot({},this._getTransitionProps()),{transitionDuration:t,transitionEasing:qx}),{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,fh,{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,fh,{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,Sn(ot({},this._getTransitionProps({around:r})),{transitionDuration:t,transitionEasing:qx}),{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?Sn(ot({},t),{transitionInterpolator:new Lz(Sn(ot({},e),{transitionProps:this.linearTransitionProps,makeViewport:this.controllerState.makeViewport}))}):t:fh}}class Bz{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 ph_target=[0,0,0];class Yx extends Bz{constructor({makeViewport:e,width:t,height:i,rotationX:r=0,rotationOrbit:s=0,target:o=ph_target,zoom:a=0,minRotationX:l=-90,maxRotationX:c=90,minZoom:u=-(1/0),maxZoom:h=Infinity,startPanPosition:f,startRotatePos:g,startRotationX:m,startRotationOrbit:v,startZoomPosition:x,startZoom:U}){super({width:t,height:i,rotationX:r,rotationOrbit:s,target:o,zoom:a,minRotationX:l,maxRotationX:c,minZoom:u,maxZoom:h}),this._state={startPanPosition:f,startRotatePos:g,startRotationX:m,startRotationOrbit:v,startZoomPosition:x,startZoom:U},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 u=(e[0]-r[0])/a;(s<-90||s>90)&&(u*=-1),c={rotationX:s+(e[1]-r[1])/l*180,rotationOrbit:o+180*u}}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=ot({},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(Sn(ot({},this._viewportProps),{zoom:a}));return this._getUpdatedState(ot({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),Ua(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 Yx(ot(ot(ot({},this._viewportProps),this._state),e))}_applyConstraints(e){const{maxZoom:t,minZoom:i,zoom:r,maxRotationX:s,minRotationX:o,rotationOrbit:a}=e;return e.zoom=Ua(r,i,t),e.rotationX=Ua(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 kde extends UO{constructor(e){super(Yx,e)}get linearTransitionProps(){return["target","zoom","rotationX","rotationOrbit"]}}class Fde extends UO{constructor(e){e.dragMode=e.dragMode||"pan",super(Yx,e)}_onPanRotate(e){return!1}get linearTransitionProps(){return["target","zoom"]}}const Lde=(new qn).lookAt({eye:[0,0,1]});function Bde({width:n,height:e,near:t,far:i}){return n=n||1,e=e||1,(new qn).ortho({left:-n/2,right:n/2,bottom:-e/2,top:e/2,near:t,far:i})}class Vde 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(Sn(ot({},e),{longitude:null,position:a,viewMatrix:Lde.clone().scale([c,c*(l?-1:1),c]),projectionMatrix:Bde({width:t,height:i,near:r,far:s}),zoom:o}))}panByPosition(e,t){const r=kx([],e,NU([],j0(t,this.pixelUnprojectionMatrix)));return{target:kx([],this.center,r)}}}let jde=(()=>{class n extends jO{constructor(t){super(Sn(ot({},t),{type:Vde}))}get controller(){return this._getControllerProps({type:Fde})}}return n.displayName="OrthographicView",n})();const Xx=Math.PI/180;function Ude({height:n,fovy:e,orbitAxis:t,rotationX:i,rotationOrbit:r,zoom:s}){const o=.5/Math.tan(e*Xx/2),a="Z"===t?[0,0,1]:[0,1,0],l="Z"===t?[0,-o,0]:[0,0,o],c=(new qn).lookAt({eye:l,up:a});c.rotateX(i*Xx),"Z"===t?c.rotateZ(r*Xx):c.rotateY(r*Xx);const u=Math.pow(2,s)/(n||1);return c.scale(u),c}class zde 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(Sn(ot({},e),{longitude:null,viewMatrix:Ude({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]=j0([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 Hde=(()=>{class n extends jO{constructor(t={}){const{orbitAxis:i="Z"}=t;super(Sn(ot({},t),{orbitAxis:i,type:zde}))}get controller(){return this._getControllerProps({type:kde})}}return n.displayName="OrbitView",n})();const Gde=[255,255,255],$de=1;let Wde=0;class Vz{constructor(e={}){const{color:t=Gde}=e,{intensity:i=$de}=e;this.id=e.id||"ambient-".concat(Wde++),this.color=t,this.intensity=i,this.type="ambient"}}const qde=[255,255,255],Yde=1,Xde=[0,0,-1];let Kde=0;class jz{constructor(e={}){const{color:t=qde}=e,{intensity:i=Yde}=e,{direction:r=Xde}=e,{_shadow:s=!1}=e;this.id=e.id||"directional-".concat(Kde++),this.color=t,this.intensity=i,this.type="directional",this.direction=new Mo(r).normalize().toArray(),this.shadow=s}getProjectedLight(){return this}}class Uz{constructor(e={}){const{id:t="effect"}=e;this.id=t,this.props=ot({},e)}preRender(){}getModuleParameters(){}cleanup(){}}class zO extends class{constructor(e,t={}){const{id:i="pass"}=t;this.id=i,this.gl=e,this.props=ot({},t)}setProps(e){Object.assign(this.props,e)}render(){}cleanup(){}}{render(e){return Xu(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){Xu(n,{viewport:[0,0,n.drawingBufferWidth,n.drawingBufferHeight]}),n.clear(16640)}(o);const a=[];for(const l of t){const c=l.viewport||l,u=i&&i[c.id];r(c);const h=this._getDrawLayerParams(c,e);e.view=u;const f=c.subViewports||[c];for(const g of f){e.viewport=g;const m=this._drawLayersInViewport(o,e,h);a.push(m)}}return a}_getDrawLayerParams(e,{layers:t,pass:i,layerFilter:r,effects:s,moduleParameters:o}){const a=[],l=zz(),c={viewport:e,isPicking:i.startsWith("picking"),renderPass:i};for(let u=0;ufI(e,c))}const l={totalCount:t.length,visibleCount:0,compositeCount:0,pickableCount:0};Xu(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 u=t[l]=t[l]||zz(e[l],e);c=u(r,s),t[a]=u}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 ehe extends zO{constructor(e,t){super(e,t),this.shadowMap=new ya(e,{width:1,height:1,parameters:{10241:9729,10240:9729,10242:33071,10243:33071}}),this.depthBuffer=new zg(e,{format:33189,width:1,height:1}),this.fbo=new ks(e,{id:"shadowmap",width:1,height:1,attachments:{36064:this.shadowMap,36096:this.depthBuffer}})}render(e){const t=this.fbo;hc(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(Sn(ot({},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 nhe=Object.keys(Vi).map(n=>"const int COORDINATE_SYSTEM_".concat(n," = ").concat(Vi[n],";")).join(""),ihe=Object.keys(Zc).map(n=>"const int PROJECTION_MODE_".concat(n," = ").concat(Zc[n],";")).join(""),rhe="".concat(nhe,"\n").concat(ihe,"\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"),she={},HO={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:rhe,getUniforms:function(n=she){return n.viewport?function({viewport:n,devicePixelRatio:e=1,modelMatrix:t=null,coordinateSystem:i=Vi.DEFAULT,coordinateOrigin:r,autoWrapLongitude:s=!1}={}){i===Vi.DEFAULT&&(i=n.isGeospatial?Vi.LNGLAT:Vi.CARTESIAN);const o=lce({viewport:n,devicePixelRatio:e,coordinateSystem:i,coordinateOrigin:r});return o.project_uWrapLongitude=s,o.project_uModelMatrix=t||sce,o}(n):{}}},che=Ox(function({viewport:n,center:e}){return new qn(n.viewProjectionMatrix).invert().transform(e)}),uhe=Ox(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=j0([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(u=>a.transform(u)),c=(new qn).ortho({left:Math.min(...l.map(u=>u[0])),right:Math.max(...l.map(u=>u[0])),bottom:Math.min(...l.map(u=>u[1])),top:Math.max(...l.map(u=>u[1])),near:Math.min(...l.map(u=>-u[2])),far:Math.max(...l.map(u=>-u[2]))});t.push(c.multiplyRight(o))}return t}),dhe=[0,0,0,1],hhe=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0],GO={name:"shadow",dependencies:[HO],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||dhe,shadow_uLightId:n.shadowLightId||0,shadow_uLightCount:n.shadowMatrices.length},i=che({viewport:n.viewport,center:e.project_uCenter}),r=[],s=uhe({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{}}},_he={color:[255,255,255],intensity:1},Hz=[{color:[255,255,255],intensity:1,direction:[-1,3,-1]},{color:[255,255,255],intensity:.9,direction:[1,-8,-2.5]}],yhe=[0,0,0,200/255];class $O extends Uz{constructor(e){super(e),this.ambientLight=null,this.directionalLights=[],this.pointLights=[],this.shadowColor=yhe,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=F0.getDefaultProgramManager(e),GO&&this.programManager.addDefaultModule(GO)),this.dummyShadowMap||(this.dummyShadowMap=new ya(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(GO),this.programManager=null)}_createLightMatrix(){const e=[];for(const t of this.directionalLights){const i=(new qn).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=vhe++;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 whe{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=q0(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 Ehe{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 whe(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 xhe=[{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"},HO],She=["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 Che(n){const e=F0.getDefaultProgramManager(n);for(const t of xhe)e.addDefaultModule(t);for(const t of She)e.addShaderHook(t);return e}const Mhe=Object.seal({layerManager:null,resourceManager:null,deck:null,gl:null,stats:null,shaderCache:null,pickingFBO:null,mousePosition:null,userData:{}});class Dhe{constructor(e,{deck:t,stats:i,viewport:r,timeline:s}={}){this.lastRenderedLayers=[],this.layers=[],this.resourceManager=new Ehe({gl:e,protocol:"deck://"}),this.context=Sn(ot({},Mhe),{layerManager:this,gl:e,deck:t,programManager:e&&Che(e),stats:i||new oI({id:"deck.gl"}),viewport:r||new Jg({id:"DEFAULT-INITIAL-VIEWPORT"}),timeline:s||new Gz,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){Do("layerManager.setLayers",this,t,e),this.lastRenderedLayers=e,e=xI(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 Do("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]?Ri.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&&Ri.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 Ihe{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=xI(e,Boolean),this._diffViews(e,this.views)&&this.setNeedsUpdate("views changed"),this.views=e}_setViewState(e){e?(!X0(e,this.viewState)&&this.setNeedsUpdate("viewState changed"),this.viewState=e):Ri.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)(ot({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=Sn(ot(ot(ot({},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 u=r[a.id];a.controller&&!u&&(s=!0),(s||!a.controller)&&u&&(u.finalize(),u=null),this.controllers[a.id]=this._updateController(a,l,c,u),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 Rhe extends Bz{constructor({makeViewport:e,width:t,height:i,latitude:r,longitude:s,zoom:o,bearing:a=0,pitch:l=0,altitude:c=1.5,maxZoom:u=20,minZoom:h=0,maxPitch:f=60,minPitch:g=0,startPanLngLat:m,startZoomLngLat:v,startRotatePos:x,startBearing:U,startPitch:D,startZoom:ie,normalize:_e}={}){fc(Number.isFinite(s)),fc(Number.isFinite(r)),fc(Number.isFinite(o)),super({width:t,height:i,latitude:r,longitude:s,zoom:o,bearing:a,pitch:l,altitude:c,maxZoom:u,minZoom:h,maxPitch:f,minPitch:g,normalize:_e}),this._state={startPanLngLat:m,startZoomLngLat:v,startRotatePos:x,startBearing:U,startPitch:D,startZoom:ie},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(Sn(ot({},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(Sn(ot({},this._viewportProps),{zoom:o}));return this._getUpdatedState(ot({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=ot({},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(ot(ot(ot({makeViewport:this.makeViewport},this._viewportProps),this._state),e))}_applyConstraints(e){const{maxZoom:t,minZoom:i,zoom:r}=e;e.zoom=Ua(r,i,t);const{maxPitch:s,minPitch:o,pitch:a}=e;e.pitch=Ua(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=LU(t+180,360)-180),(o<-180||o>180)&&(o=LU(o+180,360)-180);const a=qI(e/512);if(r<=a)r=a,i=0;else{const l=e/2/Math.pow(2,r),c=Zg([0,l])[1];if(iu&&(i=u)}}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 Ua(t+Math.log2(e),r,i)}_calculateNewPitchAndBearing({deltaScaleX:e,deltaScaleY:t,startBearing:i,startPitch:r}){t=Ua(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 u=0;return r>0?Math.abs(l-o)>5&&(u=r/(o-l)*1.2):r<0&&o>5&&(u=1-s/o),u=Math.min(1,Math.max(-1,u)),{deltaScaleX:c,deltaScaleY:u}}}class Phe extends UO{constructor(e){e.dragMode=e.dragMode||"pan",super(Rhe,e)}setProps(e){const t=this.controllerStateProps;super.setProps(e),(!t||t.height!==e.height)&&this.updateViewport(new this.ControllerState(ot(ot({makeViewport:this.makeViewport},this.controllerStateProps),this._state)))}get linearTransitionProps(){return["longitude","latitude","zoom","bearing","pitch"]}}let Nhe=(()=>{class n extends jO{constructor(t){super(Sn(ot({},t),{type:KU}))}get controller(){return this._getControllerProps({type:Phe})}}return n.displayName="MapView",n})();const khe=new $O;class Fhe{constructor(){this.effects=[],this._internalEffects=[],this._needsRedraw="Initial render",this.setEffects()}setProps(e){"effects"in e&&(e.effects.length!==this.effects.length||!X0(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 $O)||this._internalEffects.push(khe)}}class Lhe extends zO{}const Wz={blendFunc:[1,0,32771,0],blendEquation:32774};class qz extends zO{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:u},pass:h="picking",redrawReason:f,pickZ:g}){const m=this.gl;return this.pickZ=g,hc(m,Sn(ot({scissorTest:!0,scissor:[a,l,c,u],clearColor:[0,0,0,0],depthMask:!0,depthTest:!0,depthRange:[0,1],colorMask:[!0,!0,!0,!0]},Wz),{blend:!g}),()=>{super.render({target:o,layers:e,layerFilter:t,views:i,viewports:r,onViewportActive:s,pass:h,redrawReason:f})})}shouldDrawLayer(e){return e.props.pickable}getModuleParameters(){return{pickingActive:1,pickingAttribute:this.pickZ,lightSources:{}}}getLayerParameters(e,t){const i=this.pickZ?{blend:!1}:Sn(ot({},Wz),{blend:!0,blendColor:[0,0,0,this.useAlpha?(t+1)/255:1]});return ot(ot({},e.props.parameters),i)}}class Vhe{constructor(e){this.gl=e,this.layerFilter=null,this.drawPickingColors=!1,this.drawLayersPass=new Lhe(e),this.pickLayersPass=new qz(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||ks.getDefaultFramebuffer(this.gl),this._preRender(e.effects,e);const i=this.lastPostProcessEffect?this.renderBuffers[0]:e.target,r=t.render(Sn(ot({},e),{target:i}));this._postRender(e.effects,e),this.renderCount++,Do("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 ks(this.gl),new ks(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 jhe={pickedColor:null,pickedLayer:null,pickedObjectIndex:-1};function Uhe({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 u=r*r,h=-1,f=0;for(let g=0;gu)f+=4*l;else for(let x=0;x=0){const D=x+o-t,ie=D*D+v;ie<=u&&(u=ie,h=f)}f+=4}}if(h>=0){const g=n[h+3]-1,m=n.slice(h,h+4),v=e[g];if(v){const x=v.decodePickingColor(m),U=Math.floor(h/4/l);return{pickedColor:m,pickedLayer:v,pickedObjectIndex:x,pickedX:o+(h/4-U*l),pickedY:a+U}}Ri.error("Picked non-existent layer. Is picking buffer corrupt?")()}}return jhe}function Yz({pickInfo:n,mode:e,viewports:t,layerFilter:i,pixelRatio:r,x:s,y:o,z:a}){const l=n&&n.pickedLayer,u=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&&(f=>i({layer:l,viewport:f,isPicking:!0,renderPass:"picking:".concat(e)}))),h=u&&u.unproject([s-u.x,o-u.y],{targetZ:a});return{color:null,layer:null,viewport:u,index:-1,picked:!1,x:s,y:o,pixel:[s,o],coordinate:h,devicePixel:n&&[n.pickedX,n.pickedY],pixelRatio:r}}function Hhe(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 h=t.index,f=t.layerId,g=o&&o.props.id;if(g!==f||a!==h){if(g!==f){const m=r.find(v=>v.props.id===f);m&&l.unshift(m)}t.layerId=g,t.index=a,t.info=null}}const c=Yz(n),u=new Map;return u.set(null,c),l.forEach(h=>{let f=ot({},c);h===o&&(f.color=s,f.index=a,f.picked=!0),f=Xz({layer:h,info:f,mode:i}),h===o&&"hover"===i&&(t.info=f),u.set(f.layer.id,f),"hover"===i&&f.layer.updateAutoHighlight(f)}),u}function Xz({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 $he{constructor(e){this.gl=e,this.pickingFBO=null,this.pickLayersPass=new qz(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(f=>f.id===o):null,c=a&&r.find(f=>f.id===a)||r[0],u=c&&c.unproject([e-c.x,t-c.y]),h={x:e,y:t,viewport:c,coordinate:u,layer:l};return l?ot(ot({},s),h):Object.assign(h,{color:null,object:null,index:-1})}_resizeBuffer(){const{gl:e}=this;return this.pickingFBO||(this.pickingFBO=new ks(e),ks.isSupported(e,{colorBufferFloat:!0})&&(this.depthFBO=new ks(e),this.depthFBO.attach({36064:new ya(e,{format:Ci(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?(Ri.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:u}){if(!(e=this._getPickable(e)))return{result:[],emptyInfo:Yz({viewports:i,x:r,y:s})};this._resizeBuffer();const h=Vg(this.gl),f=iI(this.gl,[r,s],!0),g=[f.x+Math.floor(f.width/2),f.y+Math.floor(f.height/2)],m=Math.round(o*h),{width:v,height:x}=this.pickingFBO,U=this._getPickingRect({deviceX:g[0],deviceY:g[1],deviceRadius:m,deviceWidth:v,deviceHeight:x});let D;const ie=[],_e={};for(let Pe=0;Pe=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)}):Ri.error("Picked non-existent layer. Is picking buffer corrupt?")()}}}return Array.from(t.values())}({pickedColors:this._drawAndSample({layers:e,views:t,viewports:i,onViewportActive:u,deviceRect:{x:g,y:U,width:v.x+v.width-g,height:m-U},pass:"picking:".concat(l),redrawReason:l}),layers:e}),Pe=new Map,Ne=Number.isFinite(c);for(let Ve=0;Ve<_e.length&&!(Ne&&Pe.size>=c);Ve++){const bt=_e[Ve];let xt={color:bt.pickedColor,layer:null,index:bt.pickedObjectIndex,picked:!0,x:r,y:s,width:o,height:a,pixelRatio:h};xt=Xz({layer:bt.pickedLayer,info:xt,mode:l}),Pe.has(xt.object)||Pe.set(xt.object,xt)}return Array.from(Pe.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:u,y:h,width:f,height:g}=s,m=new(l?Float32Array:Uint8Array)(f*g*4);return px(c,{sourceX:u,sourceY:h,sourceWidth:f,sourceHeight:g,target:m}),m}_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 Whe={zIndex:1,position:"absolute",pointerEvents:"none",color:"#a0a7b4",backgroundColor:"#29323c",padding:"10px",top:0,left:0,display:"none"};class qhe{constructor(e){const t=e.parentElement;t&&(this.el=document.createElement("div"),this.el.className="deck-tooltip",Object.assign(this.el.style,Whe),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 Kz(n,e){if(!n)throw new Error(e)}const su={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},Qz=su.global||su.self||su.window,Xhe="object"!=typeof process||"[object process]"!==String(process)||process.browser,Zz="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version),{_parseImageNode:Khe}=(Zz&&parseFloat(Zz[1]),Qz),WO="undefined"!=typeof Image,qO="undefined"!=typeof ImageBitmap,Qhe=Boolean(Khe),YO=!!Xhe||Qhe;function Jz(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 e4(n){switch(Jz(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 efe=/^data:image\/svg\+xml/,tfe=/\.svg((\?|#).*)?$/;function XO(n){return n&&(efe.test(n)||tfe.test(n))}function nfe(n,e){if(XO(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 n4(n,e)}function n4(n,e){if(XO(e))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(n)])}function i4(n,e,t){return KO.apply(this,arguments)}function KO(){return(KO=li(function*(n,e,t){const i=nfe(n,t),r=self.URL||self.webkitURL,s="string"!=typeof i&&r.createObjectURL(i);try{return yield ife(s||i,e)}finally{s&&r.revokeObjectURL(s)}})).apply(this,arguments)}function ife(n,e){return QO.apply(this,arguments)}function QO(){return(QO=li(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 rfe={};let r4=!0;function sfe(n,e,t){return ZO.apply(this,arguments)}function ZO(){return(ZO=li(function*(n,e,t){let i;i=XO(t)?yield i4(n,e,t):n4(n,t);const r=e&&e.imagebitmap;return yield ofe(i,r)})).apply(this,arguments)}function ofe(n){return JO.apply(this,arguments)}function JO(){return(JO=li(function*(n,e=null){if((afe(e)||!r4)&&(e=null),e)try{return yield createImageBitmap(n,e)}catch(t){console.warn(t),r4=!1}return yield createImageBitmap(n)})).apply(this,arguments)}function afe(n){for(const e in n||rfe)return!1;return!0}const ou=!1,Q0=!0;function eR(n){const e=Z0(n);return function(n){const e=Z0(n);return e.byteLength>=24&&2303741511===e.getUint32(0,ou)?{mimeType:"image/png",width:e.getUint32(16,ou),height:e.getUint32(20,ou)}:null}(e)||function(n){const e=Z0(n);if(!(e.byteLength>=3&&65496===e.getUint16(0,ou)&&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,ou)?{mimeType:"image/gif",width:e.getUint16(6,Q0),height:e.getUint16(8,Q0)}:null}(e)||function(n){const e=Z0(n);return e.byteLength>=14&&16973===e.getUint16(0,ou)&&e.getUint32(2,Q0)===e.byteLength?{mimeType:"image/bmp",width:e.getUint32(18,Q0),height:e.getUint32(22,Q0)}:null}(e)}function Z0(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 ffe(n,e){const{mimeType:t}=eR(n)||{},{_parseImageNode:i}=Qz;return Kz(i),i(n,t,e)}function tR(){return(tR=li(function*(n,e,t){const r=((e=e||{}).image||{}).type||"auto",{url:s}=t||{};let a;switch(gfe(r)){case"imagebitmap":a=yield sfe(n,e,s);break;case"image":a=yield i4(n,e,s);break;case"data":a=yield ffe(n,e);break;default:Kz(!1)}return"data"===r&&(a=e4(a)),a})).apply(this,arguments)}function gfe(n){switch(n){case"auto":case"data":return function(){if(qO)return"imagebitmap";if(WO)return"image";if(YO)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}();default:return function(n){switch(n){case"auto":return qO||WO||YO;case"imagebitmap":return qO;case"image":return WO;case"data":return YO;default:throw new Error(`@loaders.gl/images: image ${n} not supported in this environment`)}}(n),n}}const nR={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 tR.apply(this,arguments)},tests:[n=>Boolean(eR(new DataView(n)))],options:{image:{type:"auto",decode:!0}}};var nm=et(4761);const _fe={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},J0="8.5.8",Kx=nm.CO.deck&&nm.CO.deck.VERSION;if(Kx&&Kx!==J0)throw new Error("deck.gl - multiple versions detected: ".concat(Kx," vs ").concat(J0));Kx||(Ri.log(1,"deck.gl ".concat(J0))(),nm.CO.deck=Object.assign(nm.CO.deck||{},{VERSION:J0,version:J0,log:Ri,_registerLoggers:function(n){AI=n}}),Mz([_fe,[nR,{imagebitmap:{premultiplyAlpha:"none"}}]]));const yfe=nm.CO.deck;class Qx extends Ku{get[Symbol.toStringTag](){return"Query"}static isSupported(e,t=[]){const i=Ci(e),r=gj(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:on(!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 Qx.isSupported(this.gl)?this.gl2.createQuery():null}_deleteHandle(){this.gl2.deleteQuery(this.handle)}}const s4=fx()&&"undefined"!=typeof document;let Mfe=0;class Dfe{constructor(e={}){const{onCreateContext:t=(x=>XV(x)),onAddHTML:i=null,onInitialize:r=(()=>{}),onRender:s=(()=>{}),onFinalize:o=(()=>{}),onError:a,gl:l=null,glOptions:c={},debug:u=!1,createFramebuffer:h=!1,autoResizeViewport:f=!0,autoResizeDrawingBuffer:g=!0,stats:m=Rf.get("animation-loop-"+Mfe++)}=e;let{useDevicePixels:v=!0}=e;"useDevicePixelRatio"in e&&(mn.deprecated("useDevicePixelRatio","useDevicePixels")(),v=e.useDevicePixelRatio),this.props={onCreateContext:t,onAddHTML:i,onInitialize:r,onRender:s,onFinalize:o,onError:a,gl:l,glOptions:c,debug:u,createFramebuffer:h},this.gl=l,this.needsRedraw=null,this.timeline=null,this.stats=m,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:f,autoResizeDrawingBuffer:g,useDevicePixels:v}),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 on("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=Qx.isSupported(this.gl,["timers"])?new Qx(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 li(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 mn.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=s4?new Promise((e,t)=>{s4&&"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?sI(this.props.gl,e):this.onCreateContext(e),!dx(this.gl))throw new Error("AnimationLoop.onCreateContext - illegal context returned");(function(n){Xu(n,nI)})(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)&&(mn.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)&&(mn.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 ks(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 Ife=et(1524),Zx=et.n(Ife);const Ofe={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}))}}(Zx().MouseInput);const kfe=Zx().Manager,au=Zx(),Ffe=au?[[au.Pan,{event:"tripan",pointers:3,threshold:0,enable:!1}],[au.Rotate,{enable:!1}],[au.Pinch,{enable:!1}],[au.Swipe,{enable:!1}],[au.Pan,{threshold:0,enable:!1}],[au.Press,{enable:!1}],[au.Tap,{event:"doubletap",taps:2,enable:!1}],[au.Tap,{event:"anytap",enable:!1}],[au.Tap,{enable:!1}]]:null,l4={tripan:["rotate","pinch","pan"],rotate:["pinch"],pinch:["pan"],pan:["press","doubletap","anytap","tap"],doubletap:["anytap"],anytap:["tap"]},Lfe={doubletap:["tap"]},Bfe={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"]},Vfe={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"},c4={click:"tap",anyclick:"anytap",dblclick:"doubletap",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup",mouseover:"pointerover",mouseout:"pointerout",mouseleave:"pointerleave"},jfe="undefined"!=typeof navigator&&navigator.userAgent?navigator.userAgent.toLowerCase():"",im="undefined"!=typeof window?window:global;"undefined"!=typeof global?global:window,"undefined"!=typeof document&&document;let u4=!1;try{const n={get passive(){return u4=!0,!0}};im.addEventListener("test",n,n),im.removeEventListener("test",n,n)}catch(n){}const Ufe=-1!==jfe.indexOf("firefox"),{WHEEL_EVENTS:zfe}=rR,h4=4.000244140625;class $fe{constructor(e,t,i={}){this.element=e,this.callback=t,this.options=Object.assign({enable:!0},i),this.events=zfe.concat(i.events||[]),this.handleEvent=this.handleEvent.bind(this),this.events.forEach(r=>e.addEventListener(r,this.handleEvent,!!u4&&{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;im.WheelEvent&&(Ufe&&e.deltaMode===im.WheelEvent.DOM_DELTA_PIXEL&&(t/=im.devicePixelRatio),e.deltaMode===im.WheelEvent.DOM_DELTA_LINE&&(t*=40));const i={x:e.clientX,y:e.clientY};0!==t&&t%h4==0&&(t=Math.floor(t/h4)),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:Wfe}=rR,f4="pointermove",p4="pointerover",g4="pointerout",m4="pointerleave";class qfe{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=Wfe.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===f4&&(this.enableMoveEvent=t),e===p4&&(this.enableOverEvent=t),e===g4&&(this.enableOutEvent=t),e===m4&&(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:p4,srcEvent:e,pointerType:"mouse",target:e.target})}handleOutEvent(e){this.enableOutEvent&&"mouseout"===e.type&&this.callback({type:g4,srcEvent:e,pointerType:"mouse",target:e.target})}handleLeaveEvent(e){this.enableLeaveEvent&&"mouseleave"===e.type&&this.callback({type:m4,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:f4,srcEvent:e,pointerType:"mouse",target:e.target});break;case"mouseup":this.pressed=!1}}}const{KEY_EVENTS:Yfe}=rR,_4="keydown";class Xfe{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=Yfe.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===_4&&(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:_4,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 b4="contextmenu";class Kfe{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===b4&&(this.options.enable=t)}handleEvent(e){!this.options.enable||this.callback({type:b4,center:{x:e.clientX,y:e.clientY},srcEvent:e,pointerType:"mouse",target:e.target})}}const Qfe={pointerdown:1,pointermove:2,pointerup:4,mousedown:1,mousemove:2,mouseup:4},v4={srcElement:"root",priority:0};class cpe{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({},v4,i):v4;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 u=l.length-1;for(;u>=0&&!(l[u].priority>=c.priority);)u--;l.splice(u+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&&l4[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 $fe(e,this._onOtherEvent,{enable:!1}),this.moveInput=new qfe(e,this._onOtherEvent,{enable:!1}),this.keyInput=new Xfe(e,this._onOtherEvent,{enable:!1,tabIndex:t.tabIndex}),this.contextmenuInput=new Kfe(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=Lfe[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 u in e)this._addEventHandler(u,e[u],i,r,s);return}const{manager:o,events:a}=this,l=c4[e]||e;let c=a.get(l);c||(c=new cpe(this),a.set(l,c),c.recognizerName=Vfe[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(c4[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=Bfe[t.type];i&&this.manager.emit(i,e)}_onOtherEvent(e){this.manager.emit(e.type,e)}}function Vf(){}const w4={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:Vf,onResize:Vf,onViewStateChange:Vf,onInteractionStateChange:Vf,onBeforeRender:Vf,onAfterRender:Vf,onLoad:Vf,onError:(n,e)=>Ri.error(n)(),_onMetrics:null,getCursor:({isDragging:n})=>n?"grabbing":"grab",debug:!1,drawPickingColors:!1};class eS{constructor(e){e=ot(ot({},w4),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&&Ri.warn("View state tracking is disabled. Use either `initialViewState` for auto update or `viewState` for manual update.")(),"IE"===(0,nm.qs)()&&Ri.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 oI({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&&A0.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&&Ri.removed("onLayerHover","onHover")(),"onLayerClick"in e&&Ri.removed("onLayerClick","onClick")(),e.initialViewState&&!X0(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](ot({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),fc(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:u,autoResizeDrawingBuffer:h}=e;return new Dfe({width:t,height:i,useDevicePixels:u,autoResizeDrawingBuffer:h,autoResizeViewport:!1,gl:r,onCreateContext:f=>XV(Sn(ot(ot({},s),f),{canvas:this.canvas,debug:o,onContextLost:()=>this._onContextLost()})),onInitialize:f=>this._setGLContext(f.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 Nhe({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,sI(e,{enable:!0,copyState:!0})),this.tooltip=new qhe(this.canvas),Xu(e,{blend:!0,blendFunc:[770,771,1,771],polygonOffsetFill:!0,depthTest:!0,depthFunc:515}),this.props.onWebGLInitialized(e);const t=new Gz;t.play(),this.animationLoop.attachTimeline(t),this.eventManager=new dpe(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 PV)this.eventManager.on(r,this._onEvent);this.viewManager=new Ihe({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 Dhe(e,{deck:this,stats:this.stats,viewport:i,timeline:t}),this.effectManager=new Fhe,this.deckRenderer=new Vhe(e),this.deckPicker=new $he(e),this.setProps(this.props),this._updateCanvasSize(),this.props.onLoad()}_drawLayers(e,t){const{gl:i}=this.layerManager.context;Xu(i,this.props.parameters),this.props.onBeforeRender({gl:i}),this.deckRenderer.renderLayers(ot({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(),Ri.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=Sn(ot({},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=PV[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=Rf.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}}eS.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(Uz)),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}},eS.defaultProps=w4,eS.VERSION=yfe.VERSION;const tS={name:"project32",dependencies:[HO],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"},gpe={pickingSelectedColor:null,pickingHighlightColor:new Uint8Array([0,255,255,255]),pickingActive:!1,pickingAttribute:!1},nS=ot({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=gpe){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}}),E4={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6};class gh{static get DRAW_MODE(){return E4}constructor(e={}){const{id:t=ma("geometry"),drawMode:i=E4.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?ot({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,on(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?(on(!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 on(Number.isFinite(i)),i}}const x4=()=>{},wpe={10241:9987,10240:9729,10242:33071,10243:33071};function Epe(n){return Math.pow(2,Math.ceil(Math.log2(n)))}function xpe(n,e,t,i){return t===e.width&&i===e.height?e:(n.canvas.height=i,n.canvas.width=t,n.clearRect(0,0,n.canvas.width,n.canvas.height),n.drawImage(e,0,0,e.width,e.height,0,0,t,i),n.canvas)}function eb(n){return n&&(n.id||n.url)}function S4(n,e,t){for(let i=0;i0){const{mapping:i,xOffset:r,yOffset:s,rowHeight:o,canvasHeight:a}=function({icons:n,buffer:e,mapping:t={},xOffset:i=0,yOffset:r=0,rowHeight:s=0,canvasWidth:o}){let a=[];for(let l=0;lo&&(S4(t,a,r),i=0,r=s+r+e,s=0,a=[]),a.push({icon:c,xOffset:i}),i=i+f+e,s=Math.max(s,h)}}return a.length>0&&S4(t,a,r),{mapping:t,rowHeight:s,xOffset:i,yOffset:r,canvasWidth:o,canvasHeight:Epe(s+r+e)}}({icons:t,buffer:this._buffer,canvasWidth:this._canvasWidth,mapping:this._mapping,rowHeight:this._rowHeight,xOffset:this._xOffset,yOffset:this._yOffset});this._rowHeight=o,this._mapping=i,this._xOffset=r,this._yOffset=s,this._canvasHeight=a,this._texture||(this._texture=new ya(this.gl,{width:this._canvasWidth,height:this._canvasHeight,parameters:wpe})),this._texture.height!==this._canvasHeight&&(this._texture=function(n,e,t,i){const r=e.width,s=e.height,o=hj(e,{width:t,height:i});return function(n,e,t={}){const{sourceX:i=0,sourceY:r=0,targetMipmaplevel:s=0,targetInternalFormat:o=6408}=t;let{targetX:a,targetY:l,targetZ:c,width:u,height:h}=t;const{framebuffer:f,deleteFramebuffer:g}=T0(n);on(f);const{gl:m,handle:v}=f,x=void 0!==a||void 0!==l||void 0!==c;a=a||0,l=l||0,c=c||0;const U=m.bindFramebuffer(36160,v);on(e);let D=null;if(e instanceof Pf&&(D=e,u=Number.isFinite(u)?u:D.width,h=Number.isFinite(h)?h:D.height,D.bind(0),e=D.target),x)switch(e){case 3553:case 34067:m.copyTexSubImage2D(e,s,a,l,i,r,u,h);break;case 35866:case 32879:Ao(m).copyTexSubImage3D(e,s,a,l,c,i,r,u,h)}else m.copyTexImage2D(e,s,o,i,r,u,h,0);D&&D.unbind(),m.bindFramebuffer(36160,U||null),g&&f.delete()}(e,o,{targetY:0,width:r,height:s}),e.delete(),o}(0,this._texture,this._canvasWidth,this._canvasHeight)),this.onUpdate(),this._loadIcons(t)}}_loadIcons(e){const t=this._canvas.getContext("2d");for(const i of e)this._pendingCount++,q0(i.url,nR,this._loadOptions).then(r=>{const s=eb(i),{x:o,y:a,width:l,height:c}=this._mapping[s],u=xpe(t,r,l,c);this._texture.setSubImageData({data:u,x:o,y:a,width:l,height:c}),this._texture.generateMipmap(),this.onUpdate()}).catch(r=>{this.onError({url:i.url,source:i.source,sourceIndex:i.sourceIndex,loadOptions:this._loadOptions,error:r})}).finally(()=>{this._pendingCount--})}}const C4=[0,0,0,255],Mpe={iconAtlas:{type:"image",value:null,async:!0},iconMapping:{type:"object",value:{},async:!0},sizeScale:{type:"number",value:1,min:0},billboard:!0,sizeUnits:"pixels",sizeMinPixels:{type:"number",min:0,value:0},sizeMaxPixels:{type:"number",min:0,value:Number.MAX_SAFE_INTEGER},alphaCutoff:{type:"number",value:.05,min:0,max:1},getPosition:{type:"accessor",value:n=>n.position},getIcon:{type:"accessor",value:n=>n.icon},getColor:{type:"accessor",value:C4},getSize:{type:"accessor",value:1},getAngle:{type:"accessor",value:0},getPixelOffset:{type:"accessor",value:[0,0]},onIconError:{type:"function",value:null,compare:!1,optional:!0}};let Dpe=(()=>{class n extends Y0{getShaders(){return super.getShaders({vs:"#define SHADER_NAME icon-layer-vertex-shader\n\nattribute vec2 positions;\n\nattribute vec3 instancePositions;\nattribute vec3 instancePositions64Low;\nattribute float instanceSizes;\nattribute float instanceAngles;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\nattribute vec4 instanceIconFrames;\nattribute float instanceColorModes;\nattribute vec2 instanceOffsets;\nattribute vec2 instancePixelOffset;\n\nuniform float sizeScale;\nuniform vec2 iconsTextureDim;\nuniform float sizeMinPixels;\nuniform float sizeMaxPixels;\nuniform bool billboard;\n\nvarying float vColorMode;\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\nvarying vec2 uv;\n\nvec2 rotate_by_angle(vec2 vertex, float angle) {\n float angle_radian = angle * PI / 180.0;\n float cos_angle = cos(angle_radian);\n float sin_angle = sin(angle_radian);\n mat2 rotationMatrix = mat2(cos_angle, -sin_angle, sin_angle, cos_angle);\n return rotationMatrix * vertex;\n}\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n geometry.uv = positions;\n geometry.pickingColor = instancePickingColors;\n uv = positions;\n\n vec2 iconSize = instanceIconFrames.zw;\n float sizePixels = clamp(\n project_size_to_pixel(instanceSizes * sizeScale), \n sizeMinPixels, sizeMaxPixels\n );\n float instanceScale = iconSize.y == 0.0 ? 0.0 : sizePixels / iconSize.y;\n vec2 pixelOffset = positions / 2.0 * iconSize + instanceOffsets;\n pixelOffset = rotate_by_angle(pixelOffset, instanceAngles) * instanceScale;\n pixelOffset += instancePixelOffset;\n pixelOffset.y *= -1.0;\n\n if (billboard) {\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, vec3(0.0), geometry.position);\n vec3 offset = vec3(pixelOffset, 0.0);\n DECKGL_FILTER_SIZE(offset, geometry);\n gl_Position.xy += project_pixel_size_to_clipspace(offset.xy);\n\n } else {\n vec3 offset_common = vec3(project_pixel_size(pixelOffset), 0.0);\n DECKGL_FILTER_SIZE(offset_common, geometry);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, offset_common, geometry.position); \n }\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n vTextureCoords = mix(\n instanceIconFrames.xy,\n instanceIconFrames.xy + iconSize,\n (positions.xy + 1.0) / 2.0\n ) / iconsTextureDim;\n\n vColor = instanceColors;\n DECKGL_FILTER_COLOR(vColor, geometry);\n\n vColorMode = instanceColorModes;\n}\n",fs:"#define SHADER_NAME icon-layer-fragment-shader\n\nprecision highp float;\n\nuniform float opacity;\nuniform sampler2D iconsTexture;\nuniform float alphaCutoff;\n\nvarying float vColorMode;\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\nvarying vec2 uv;\n\nvoid main(void) {\n geometry.uv = uv;\n\n vec4 texColor = texture2D(iconsTexture, vTextureCoords);\n vec3 color = mix(texColor.rgb, vColor.rgb, vColorMode);\n float a = texColor.a * opacity * vColor.a;\n\n if (a < alphaCutoff) {\n discard;\n }\n\n gl_FragColor = vec4(color, a);\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:[tS,nS]})}initializeState(){this.state={iconManager:new Ape(this.context.gl,{onUpdate:this._onUpdate.bind(this),onError:this._onError.bind(this)})},this.getAttributeManager().addInstanced({instancePositions:{size:3,type:5130,fp64:this.use64bitPositions(),transition:!0,accessor:"getPosition"},instanceSizes:{size:1,transition:!0,accessor:"getSize",defaultValue:1},instanceOffsets:{size:2,accessor:"getIcon",transform:this.getInstanceOffset},instanceIconFrames:{size:4,accessor:"getIcon",transform:this.getInstanceIconFrame},instanceColorModes:{size:1,type:5121,accessor:"getIcon",transform:this.getInstanceColorMode},instanceColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:!0,accessor:"getColor",defaultValue:C4},instanceAngles:{size:1,transition:!0,accessor:"getAngle"},instancePixelOffset:{size:2,transition:!0,accessor:"getPixelOffset"}})}updateState({oldProps:t,props:i,changeFlags:r}){super.updateState({props:i,oldProps:t,changeFlags:r});const s=this.getAttributeManager(),{iconAtlas:o,iconMapping:a,data:l,getIcon:c}=i,{iconManager:u}=this.state;u.setProps({loadOptions:i.loadOptions});let h=!1;if(o||this.internalState.isAsyncPropLoading("iconAtlas")?(t.iconAtlas!==i.iconAtlas&&u.setProps({iconAtlas:o,autoPacking:!1}),t.iconMapping!==i.iconMapping&&(u.setProps({iconMapping:a}),h=!0)):u.setProps({autoPacking:!0}),(r.dataChanged||r.updateTriggersChanged&&(r.updateTriggersChanged.all||r.updateTriggersChanged.getIcon))&&u.setProps({data:l,getIcon:c}),h&&(s.invalidate("instanceOffsets"),s.invalidate("instanceIconFrames"),s.invalidate("instanceColorModes")),r.extensionsChanged){var g;const{gl:m}=this.context;null===(g=this.state.model)||void 0===g||g.delete(),this.state.model=this._getModel(m),s.invalidateAll()}}get isLoaded(){return super.isLoaded&&this.state.iconManager.isLoaded}finalizeState(){super.finalizeState(),this.state.iconManager.finalize()}draw({uniforms:t}){const{sizeScale:i,sizeMinPixels:r,sizeMaxPixels:s,sizeUnits:o,billboard:a,alphaCutoff:l}=this.props,{iconManager:c}=this.state,{viewport:u}=this.context,h=c.getTexture();h&&this.state.model.setUniforms(t).setUniforms({iconsTexture:h,iconsTextureDim:[h.width,h.height],sizeScale:i*("pixels"===o?u.metersPerPixel:1),sizeMinPixels:r,sizeMaxPixels:s,billboard:a,alphaCutoff:l}).draw()}_getModel(t){return new Yg(t,Sn(ot({},this.getShaders()),{id:this.props.id,geometry:new gh({drawMode:6,attributes:{positions:{size:2,value:new Float32Array([-1,-1,-1,1,1,1,1,-1])}}}),isInstanced:!0}))}_onUpdate(){this.setNeedsRedraw()}_onError(t){const{onIconError:i}=this.getCurrentLayer().props;i?i(t):Ri.error(t.error)()}getInstanceOffset(t){const i=this.state.iconManager.getIconMapping(t);return[i.width/2-i.anchorX||0,i.height/2-i.anchorY||0]}getInstanceColorMode(t){return this.state.iconManager.getIconMapping(t).mask?1:0}getInstanceIconFrame(t){const i=this.state.iconManager.getIconMapping(t);return[i.x||0,i.y||0,i.width||0,i.height||0]}}return n.layerName="IconLayer",n.defaultProps=Mpe,n})();const A4=[],Ope={getIconOffsets:{type:"accessor",value:n=>n.offsets},alphaCutoff:.001,smoothing:.1,outlineWidth:0,outlineColor:{type:"color",value:[0,0,0,255]}};let Rpe=(()=>{class n extends Dpe{getShaders(){return Sn(ot({},super.getShaders()),{fs:"#define SHADER_NAME multi-icon-layer-fragment-shader\n\nprecision highp float;\n\nuniform float opacity;\nuniform sampler2D iconsTexture;\nuniform float gamma;\nuniform bool sdf;\nuniform float alphaCutoff;\nuniform float buffer;\nuniform float outlineBuffer;\nuniform vec4 outlineColor;\n\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\nvarying vec2 uv;\n\nvoid main(void) {\n geometry.uv = uv;\n\n if (!picking_uActive) {\n float alpha = texture2D(iconsTexture, vTextureCoords).a;\n vec4 color = vColor;\n if (sdf) {\n float distance = alpha;\n alpha = smoothstep(buffer - gamma, buffer + gamma, distance);\n\n if (outlineBuffer > 0.0) {\n float inFill = alpha;\n float inBorder = smoothstep(outlineBuffer - gamma, outlineBuffer + gamma, distance);\n color = mix(outlineColor, vColor, inFill);\n alpha = inBorder;\n }\n }\n float a = alpha * color.a;\n \n if (a < alphaCutoff) {\n discard;\n }\n\n gl_FragColor = vec4(color.rgb, a * opacity);\n }\n\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n"})}initializeState(){super.initializeState(),this.getAttributeManager().addInstanced({instanceOffsets:{size:2,accessor:"getIconOffsets"},instancePickingColors:{type:5121,size:3,accessor:(i,{index:r,target:s})=>this.encodePickingColor(r,s)}})}updateState(t){super.updateState(t);const{props:i,oldProps:r}=t;let{outlineColor:s}=i;s!==r.outlineColor&&(s=s.map(o=>o/255),s[3]=Number.isFinite(s[3])?s[3]:1,this.setState({outlineColor:s})),!i.sdf&&i.outlineWidth&&Ri.warn("".concat(this.id,": fontSettings.sdf is required to render outline"))()}draw(t){const{sdf:i,smoothing:r,outlineWidth:s}=this.props,{outlineColor:o}=this.state;t.uniforms=Sn(ot({},t.uniforms),{buffer:.75,outlineBuffer:s?Math.max(r,.75*(1-s)):-1,gamma:r,sdf:Boolean(i),outlineColor:o}),super.draw(t)}getInstanceOffset(t){return t?Array.from(t).map(i=>super.getInstanceOffset(i)):A4}getInstanceColorMode(t){return 1}getInstanceIconFrame(t){return t?Array.from(t).map(i=>super.getInstanceIconFrame(i)):A4}}return n.layerName="MultiIconLayer",n.defaultProps=Ope,n})();var Ppe=et(1002),Npe=et.n(Ppe);const Fpe=[];function Lpe(n){return Math.pow(2,Math.ceil(Math.log2(n)))}function M4(n,e,t,i){let r=0;for(let s=e;si&&(oa){let h=M4(n,a,l,r);c+h>i&&(oi&&(h=D4(n,a,l,i,r,s),o=s[s.length-1])),a=l,c+=h}}(n,r,s,t,i,o),o}function Upe(n,e,t,i,r,s){let o=0,a=0;for(let l=e;l0,u=[0,0],h=[];let f=0,g=0,m=0;for(let v=0;v<=s;v++){const x=n[v];if(("\n"===x||v===s)&&(m=v),m>g){const U=c?jpe(n,t,i,r,g,m):Fpe;for(let D=0;D<=U.length;D++){const ie=0===D?g:U[D-1],_e=Di===e);t>=0&&this._order.splice(t,1)}_appendOrder(e){this._order.push(e)}}(3),qpe=["fontFamily","fontWeight","characterSet","fontSize","sdf","buffer","cutoff","radius"];function Xpe(n,e){for(let t=0;t{o in e&&(this.props[o]=e[o])});const t=this._key;this._key=this._getKey();const i=function(n,e){const t=aR.get(n);if(!t)return e;const i=[];let s=Object.keys(t.mapping);s=new Set(s);let o=e;return o instanceof Array&&(o=new Set(o)),o.forEach(a=>{s.has(a)||i.push(a)}),i}(this._key,this.props.characterSet),r=aR.get(this._key);if(r&&0===i.length)return void(this._key!==t&&(this._atlas=r));const s=this._generateFontAtlas(this._key,i,r);this._atlas=s,aR.set(this._key,s)}_generateFontAtlas(e,t,i){const{fontFamily:r,fontWeight:s,fontSize:o,buffer:a,sdf:l,radius:c,cutoff:u}=this.props;let h=i&&i.data;h||(h=document.createElement("canvas"),h.width=1024);const f=h.getContext("2d");j4(f,r,o,s);const{mapping:g,canvasHeight:m,xOffset:v,yOffset:x}=function({characterSet:n,getFontWidth:e,fontHeight:t,buffer:i,maxCanvasWidth:r,mapping:s={},xOffset:o=0,yOffset:a=0}){let l=0,c=o,u=0;for(const f of n)if(!s[f]){const g=e(f,u++);c+g+2*i>r&&(c=0,l++),s[f]={x:c+i,y:a+l*(t+2*i)+i,width:g,height:t},c+=g+2*i}const h=t+2*i;return{mapping:s,xOffset:c,yOffset:a+l*h,canvasHeight:Lpe(a+(l+1)*h)}}(ot({getFontWidth:U=>f.measureText(U).width,fontHeight:1.2*o,buffer:a,characterSet:t,maxCanvasWidth:1024},i&&{mapping:i.mapping,xOffset:i.xOffset,yOffset:i.yOffset}));if(h.height!==m){const U=f.getImageData(0,0,h.width,h.height);h.height=m,f.putImageData(U,0,0)}if(j4(f,r,o,s),l){const U=new(Npe())(o,a,c,u,r,s),D=f.getImageData(0,0,U.size,U.size);for(const ie of t)Xpe(U.draw(ie),D),f.putImageData(D,g[ie].x-a,g[ie].y+a)}else for(const U of t)f.fillText(U,g[U].x,g[U].y+.9*o);return{xOffset:v,yOffset:x,mapping:g,data:h,width:h.width,height:h.height}}_getKey(){const{fontFamily:e,fontWeight:t,fontSize:i,buffer:r,sdf:s,radius:o,cutoff:a}=this.props;return s?"".concat(e," ").concat(t," ").concat(i," ").concat(r," ").concat(o," ").concat(a):"".concat(e," ").concat(t," ").concat(i," ").concat(r)}}const Jpe={billboard:!0,sizeScale:1,sizeUnits:"pixels",sizeMinPixels:0,sizeMaxPixels:Number.MAX_SAFE_INTEGER,padding:{type:"array",value:[0,0,0,0]},getPosition:{type:"accessor",value:n=>n.position},getSize:{type:"accessor",value:1},getAngle:{type:"accessor",value:0},getPixelOffset:{type:"accessor",value:[0,0]},getBoundingRect:{type:"accessor",value:[0,0,0,0]},getFillColor:{type:"accessor",value:[0,0,0,255]},getLineColor:{type:"accessor",value:[0,0,0,255]},getLineWidth:{type:"accessor",value:1}};let ege=(()=>{class n extends Y0{getShaders(){return super.getShaders({vs:"#define SHADER_NAME text-background-layer-vertex-shader\n\nattribute vec2 positions;\n\nattribute vec3 instancePositions;\nattribute vec3 instancePositions64Low;\nattribute vec4 instanceRects;\nattribute float instanceSizes;\nattribute float instanceAngles;\nattribute vec2 instancePixelOffsets;\nattribute float instanceLineWidths;\nattribute vec4 instanceFillColors;\nattribute vec4 instanceLineColors;\nattribute vec3 instancePickingColors;\n\nuniform bool billboard;\nuniform float opacity;\nuniform float sizeScale;\nuniform float sizeMinPixels;\nuniform float sizeMaxPixels;\nuniform vec4 padding;\n\nvarying vec4 vFillColor;\nvarying vec4 vLineColor;\nvarying float vLineWidth;\nvarying vec2 uv;\nvarying vec2 dimensions;\n\nvec2 rotate_by_angle(vec2 vertex, float angle) {\n float angle_radian = radians(angle);\n float cos_angle = cos(angle_radian);\n float sin_angle = sin(angle_radian);\n mat2 rotationMatrix = mat2(cos_angle, -sin_angle, sin_angle, cos_angle);\n return rotationMatrix * vertex;\n}\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n geometry.uv = positions;\n geometry.pickingColor = instancePickingColors;\n uv = positions;\n vLineWidth = instanceLineWidths;\n float sizePixels = clamp(\n project_size_to_pixel(instanceSizes * sizeScale),\n sizeMinPixels, sizeMaxPixels\n );\n\n dimensions = instanceRects.zw * sizePixels + padding.xy + padding.zw;\n\n vec2 pixelOffset = (positions * instanceRects.zw + instanceRects.xy) * sizePixels + mix(-padding.xy, padding.zw, positions);\n pixelOffset = rotate_by_angle(pixelOffset, instanceAngles);\n pixelOffset += instancePixelOffsets;\n pixelOffset.y *= -1.0;\n\n if (billboard) {\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, vec3(0.0), geometry.position);\n vec3 offset = vec3(pixelOffset, 0.0);\n DECKGL_FILTER_SIZE(offset, geometry);\n gl_Position.xy += project_pixel_size_to_clipspace(offset.xy);\n } else {\n vec3 offset_common = vec3(project_pixel_size(pixelOffset), 0.0);\n DECKGL_FILTER_SIZE(offset_common, geometry);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, offset_common, geometry.position);\n }\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n vFillColor = vec4(instanceFillColors.rgb, instanceFillColors.a * opacity);\n DECKGL_FILTER_COLOR(vFillColor, geometry);\n vLineColor = vec4(instanceLineColors.rgb, instanceLineColors.a * opacity);\n DECKGL_FILTER_COLOR(vLineColor, geometry);\n}\n",fs:"#define SHADER_NAME text-background-layer-fragment-shader\n\nprecision highp float;\n\nuniform bool stroked;\n\nvarying vec4 vFillColor;\nvarying vec4 vLineColor;\nvarying float vLineWidth;\nvarying vec2 uv;\nvarying vec2 dimensions;\n\nvoid main(void) {\n geometry.uv = uv;\n\n vec2 pixelPosition = uv * dimensions;\n if (stroked) {\n float distToEdge = min(\n min(pixelPosition.x, dimensions.x - pixelPosition.x),\n min(pixelPosition.y, dimensions.y - pixelPosition.y)\n );\n float isBorder = smoothedge(distToEdge, vLineWidth);\n gl_FragColor = mix(vFillColor, vLineColor, isBorder);\n } else {\n gl_FragColor = vFillColor;\n }\n\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:[tS,nS]})}initializeState(){this.getAttributeManager().addInstanced({instancePositions:{size:3,type:5130,fp64:this.use64bitPositions(),transition:!0,accessor:"getPosition"},instanceSizes:{size:1,transition:!0,accessor:"getSize",defaultValue:1},instanceAngles:{size:1,transition:!0,accessor:"getAngle"},instanceRects:{size:4,accessor:"getBoundingRect"},instancePixelOffsets:{size:2,transition:!0,accessor:"getPixelOffset"},instanceFillColors:{size:4,transition:!0,normalized:!0,type:5121,accessor:"getFillColor",defaultValue:[0,0,0,255]},instanceLineColors:{size:4,transition:!0,normalized:!0,type:5121,accessor:"getLineColor",defaultValue:[0,0,0,255]},instanceLineWidths:{size:1,transition:!0,accessor:"getLineWidth",defaultValue:1}})}updateState({props:t,oldProps:i,changeFlags:r}){if(super.updateState({props:t,oldProps:i,changeFlags:r}),r.extensionsChanged){var s;const{gl:o}=this.context;null===(s=this.state.model)||void 0===s||s.delete(),this.state.model=this._getModel(o),this.getAttributeManager().invalidateAll()}}draw({uniforms:t}){const{viewport:i}=this.context,{billboard:r,sizeScale:s,sizeUnits:o,sizeMinPixels:a,sizeMaxPixels:l,getLineWidth:c}=this.props;let{padding:u}=this.props;const h="pixels"===o?i.metersPerPixel:1;u.length<4&&(u=[u[0],u[1],u[0],u[1]]),this.state.model.setUniforms(t).setUniforms({billboard:r,stroked:Boolean(c),padding:u,sizeScale:s*h,sizeMinPixels:a,sizeMaxPixels:l}).draw()}_getModel(t){return new Yg(t,Sn(ot({},this.getShaders()),{id:this.props.id,geometry:new gh({drawMode:6,vertexCount:4,attributes:{positions:{size:2,value:new Float32Array([0,0,1,0,1,1,0,1])}}}),isInstanced:!0}))}}return n.layerName="TextBackgroundLayer",n.defaultProps=Jpe,n})();const U4={fontSize:64,buffer:4,sdf:!1,radius:12,cutoff:.25,smoothing:.1},z4={start:1,middle:0,end:-1},H4={top:1,center:0,bottom:-1},lR=[0,0,0,255],nge=["fontSize","buffer","sdf","radius","cutoff"],ige={billboard:!0,sizeScale:1,sizeUnits:"pixels",sizeMinPixels:0,sizeMaxPixels:Number.MAX_SAFE_INTEGER,background:!1,getBackgroundColor:{type:"accessor",value:[255,255,255,255]},getBorderColor:{type:"accessor",value:lR},getBorderWidth:{type:"accessor",value:0},backgroundPadding:{type:"array",value:[0,0,0,0]},characterSet:{type:"object",value:O4},fontFamily:R4,fontWeight:"normal",lineHeight:1,outlineWidth:{type:"number",value:0,min:0},outlineColor:{type:"color",value:lR},fontSettings:{},wordBreak:"break-word",maxWidth:{type:"number",value:-1},getText:{type:"accessor",value:n=>n.text},getPosition:{type:"accessor",value:n=>n.position},getColor:{type:"accessor",value:lR},getSize:{type:"accessor",value:32},getAngle:{type:"accessor",value:0},getTextAnchor:{type:"accessor",value:"middle"},getAlignmentBaseline:{type:"accessor",value:"center"},getPixelOffset:{type:"accessor",value:[0,0]},backgroundColor:{deprecatedFor:["background","getBackgroundColor"]}};let rge=(()=>{class n extends Nz{initializeState(){this.state={styleVersion:0,fontAtlasManager:new Kpe}}updateState({props:t,oldProps:i,changeFlags:r}){const o=this.state.characterSet;(r.dataChanged||r.updateTriggersChanged&&(r.updateTriggersChanged.all||r.updateTriggersChanged.getText))&&this._updateText();const a=o!==this.state.characterSet||this._fontChanged(i,t);a&&this._updateFontAtlas(i,t),(a||t.lineHeight!==i.lineHeight||t.wordBreak!==i.wordBreak||t.maxWidth!==i.maxWidth)&&this.setState({styleVersion:this.state.styleVersion+1})}getPickingInfo({info:t}){return t.object=t.index>=0?this.props.data[t.index]:null,t}_updateFontAtlas(t,i){const{fontSettings:r,fontFamily:s,fontWeight:o}=i,{fontAtlasManager:a,characterSet:l}=this.state;a.setProps(Sn(ot(ot({},U4),r),{characterSet:l,fontFamily:s,fontWeight:o}))}_fontChanged(t,i){if(t.fontFamily!==i.fontFamily||t.fontWeight!==i.fontWeight)return!0;if(t.fontSettings===i.fontSettings)return!1;const r=t.fontSettings||{},s=i.fontSettings||{};return nge.some(o=>r[o]!==s[o])}_updateText(){const{data:t,characterSet:i}=this.props,r=t.attributes&&t.attributes.getText;let a,{getText:s}=this.props,{startIndices:o}=t;const l="auto"===i&&new Set;if(r&&o){const{texts:c,characterCount:u}=function({value:n,length:e,stride:t,offset:i,startIndices:r,characterSet:s}){const o=n.BYTES_PER_ELEMENT,a=t?t/o:1,l=i?i/o:0,c=r[e]||Math.ceil((n.length-l)/a),u=s&&new Set,h=new Array(e);let f=n;if(a>1||l>0){f=new n.constructor(c);for(let g=0;gc[f]}else{const{iterable:c,objectInfo:u}=bx(t);o=[0],a=0;for(const h of c){u.index++;const f=Array.from(s(h,u)||"");l&&f.forEach(l.add,l),a+=f.length,o.push(a)}}this.setState({getText:s,startIndices:o,numInstances:a,characterSet:l||i})}getBoundingRect(t,i){const r=this.state.fontAtlasManager.mapping,{getText:s}=this.state,{wordBreak:o,maxWidth:a,lineHeight:l,getTextAnchor:c,getAlignmentBaseline:u}=this.props,h=s(t,i)||"",{size:[f,g]}=I4(h,l,o,a,r);return[(z4["function"==typeof c?c(t,i):c]-1)*f/2,(H4["function"==typeof u?u(t,i):u]-1)*g/2,f,g]}getIconOffsets(t,i){const r=this.state.fontAtlasManager.mapping,{getText:s}=this.state,{wordBreak:o,maxWidth:a,lineHeight:l,getTextAnchor:c,getAlignmentBaseline:u}=this.props,h=s(t,i)||"",{x:f,y:g,rowWidth:m,size:[v,x]}=I4(h,l,o,a,r),U=z4["function"==typeof c?c(t,i):c],D=H4["function"==typeof u?u(t,i):u],ie=f.length,_e=new Array(2*ie);let Pe=0;for(let Ne=0;Net*e/255)}const uR={name:"lights",vs:G4,fs:G4,getUniforms:function $4(n=sge){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?cR(n):[0,0,0],e.forEach((r,s)=>{i[`lighting_uPointLight[${s}].color`]=cR(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`]=cR(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 $4({lightSources:e})}return{}},defines:{MAX_LIGHTS:3}},age={};const cge={name:"phong-lighting",dependencies:[uR],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=age){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}}},dR=Math.PI/180,iS=new Float32Array(16),Y4=new Float32Array(12);function X4(n,e,t){const i=e[0]*dR,r=e[1]*dR,s=e[2]*dR,o=Math.sin(s),a=Math.sin(i),l=Math.sin(r),c=Math.cos(s),u=Math.cos(i),h=Math.cos(r),f=t[0],g=t[1],m=t[2];n[0]=f*h*u,n[1]=f*l*u,n[2]=f*-a,n[3]=g*(-l*c+h*a*o),n[4]=g*(h*c+l*a*o),n[5]=g*u*o,n[6]=m*(l*o+h*a*c),n[7]=m*(-h*o+l*a*c),n[8]=m*u*c}function K4(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 Q4={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,u=Array.isArray(s),h=Array.isArray(r),f=Array.isArray(o),g=c||!l&&Boolean(a(i[0]));n.constant=g?c:h&&u&&f;const m=n.value;if(n.constant){let v;g?(iS.set(a),v=K4(iS)):(v=Y4,X4(v,r,s),v.set(o,9)),n.value=new Float32Array(v)}else{let v=e*n.size;const{iterable:x,objectInfo:U}=bx(i,e,t);for(const D of x){let ie;U.index++,g?(iS.set(c?a:a(D,U)),ie=K4(iS)):(ie=Y4,X4(ie,h?r:r(D,U),u?s:s(D,U)),ie.set(f?o:o(D,U),9)),m[v++]=ie[0],m[v++]=ie[1],m[v++]=ie[2],m[v++]=ie[3],m[v++]=ie[4],m[v++]=ie[5],m[v++]=ie[6],m[v++]=ie[7],m[v++]=ie[8],m[v++]=ie[9],m[v++]=ie[10],m[v++]=ie[11]}}}};function Z4(n,e){return e===Vi.CARTESIAN||e===Vi.METER_OFFSETS||e===Vi.DEFAULT&&!n.isGeospatial}function J4(n,e){(n.COLOR_0||n.colors)&&e||(n.colors={constant:!0,value:new Float32Array([1,1,1])}),Ri.assert(n.positions||n.POSITION,'no "postions" or "POSITION" attribute in mesh')}function hge(n,e){if(n.attributes)return J4(n.attributes,e),n instanceof gh?n:new gh(n);if(n.positions||n.POSITION)return J4(n,e),new gh({attributes:n});throw Error("Invalid mesh")}const fge={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 pge=(()=>{class n extends Y0{getShaders(){const t=!Ci(this.context.gl),i={};return mI(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:[tS,cge,nS],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:Q4}),this.setState({emptyTexture:new ya(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||Z4(i,s),flatShading:!this.state.hasNormals}).draw()}getModel(t){const i=new Yg(this.context.gl,Sn(ot({},this.getShaders()),{id:this.props.id,geometry:hge(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=fge,n})();const eH={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:[uR]};class rm{constructor(e={}){const{id:t}=e;this.id=t||ma(this.constructor.name),this.display=!0,this.position=new Mo,this.rotation=new Mo,this.scale=new Mo(1,1,1),this.matrix=new qn,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 on(3===e.length,"setPosition requires vector argument"),this.position=e,this}setRotation(e){return on(3===e.length,"setRotation requires vector argument"),this.rotation=e,this}setScale(e){return on(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){on(e),t=t||this.matrix;const i=new qn(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 tb extends rm{constructor(e={}){e=Array.isArray(e)?{children:e}:e;const{children:t=[]}=e;mn.assert(t.every(i=>i instanceof rm),"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 qn}={}){const i=new qn(t).multiplyRight(this.matrix);for(const r of this.children)r instanceof tb?r.traverse(e,{worldMatrix:i}):e(r,{worldMatrix:i})}}function tH(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],u=e[7],h=e[8],f=t[0],g=t[1],m=t[2],v=t[3],x=t[4],U=t[5],D=t[6],ie=t[7],_e=t[8];return n[0]=f*i+g*o+m*c,n[1]=f*r+g*a+m*u,n[2]=f*s+g*l+m*h,n[3]=v*i+x*o+U*c,n[4]=v*r+x*a+U*u,n[5]=v*s+x*l+U*h,n[6]=D*i+ie*o+_e*c,n[7]=D*r+ie*a+_e*u,n[8]=D*s+ie*l+_e*h,n}function nH(n,e,t){var i=t[0],r=t[1];return n[0]=i*e[0],n[1]=i*e[1],n[2]=i*e[2],n[3]=r*e[3],n[4]=r*e[4],n[5]=r*e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n}function iH(){var n=new ba(4);return ba!=Float32Array&&(n[0]=0,n[1]=0,n[2]=0),n[3]=1,n}function rH(n){return n[0]=0,n[1]=0,n[2]=0,n[3]=1,n}function hR(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 rS(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],u=t[3];return n[0]=i*u+o*a+r*c-s*l,n[1]=r*u+o*l+s*a-i*c,n[2]=s*u+o*c+i*l-r*a,n[3]=o*u-i*a-r*l-s*c,n}function sH(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);return n[0]=i*l+o*a,n[1]=r*l+s*a,n[2]=s*l-r*a,n[3]=o*l-i*a,n}function oH(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);return n[0]=i*l-s*a,n[1]=r*l+o*a,n[2]=s*l+i*a,n[3]=o*l-r*a,n}function aH(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);return n[0]=i*l+r*a,n[1]=r*l-i*a,n[2]=s*l+o*a,n[3]=o*l-s*a,n}function lH(n,e){var t=e[0],i=e[1],r=e[2];return n[0]=t,n[1]=i,n[2]=r,n[3]=Math.sqrt(Math.abs(1-t*t-i*i-r*r)),n}function nb(n,e,t,i){var f,g,m,v,x,r=e[0],s=e[1],o=e[2],a=e[3],l=t[0],c=t[1],u=t[2],h=t[3];return(g=r*l+s*c+o*u+a*h)<0&&(g=-g,l=-l,c=-c,u=-u,h=-h),1-g>eu?(f=Math.acos(g),m=Math.sin(f),v=Math.sin((1-i)*f)/m,x=Math.sin(i*f)/m):(v=1-i,x=i),n[0]=v*r+x*l,n[1]=v*s+x*c,n[2]=v*o+x*u,n[3]=v*a+x*h,n}function cH(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;return n[0]=-t*a,n[1]=-i*a,n[2]=-r*a,n[3]=s*a,n}function uH(n,e){return n[0]=-e[0],n[1]=-e[1],n[2]=-e[2],n[3]=e[3],n}function fR(n,e){var i,t=e[0]+e[4]+e[8];if(t>0)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}return n}var dH=function(n,e,t){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n},pR=IU,gR=function(n,e){return n[0]*e[0]+n[1]*e[1]+n[2]*e[2]+n[3]*e[3]},hH=function(n,e,t,i){var r=e[0],s=e[1],o=e[2],a=e[3];return 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),n},fH=function(n){return Math.hypot(n[0],n[1],n[2],n[3])},pH=function(n){var e=n[0],t=n[1],i=n[2],r=n[3];return e*e+t*t+i*i+r*r},mH=function(){var n=bj(),e=vj(1,0,0),t=vj(0,1,0);return function(i,r,s){var o=wj(r,s);return o<-.999999?(D0(n,e,r),function(n){return Math.hypot(n[0],n[1],n[2])}(n)<1e-6&&D0(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),hR(i,n,Math.PI),i):o>.999999?(i[0]=0,i[1]=0,i[2]=0,i[3]=1,i):(D0(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))}}();iH(),iH(),function(){var n=new ba(9);ba!=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 Sge=[0,0,0,1];class mR extends mx{constructor(e=0,t=0,i=0,r=1){super(-0,-0,-0,-0),Array.isArray(e)&&1===arguments.length?this.copy(e):this.set(e,t,i,r)}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this.check()}set(e,t,i,r){return this[0]=e,this[1]=t,this[2]=i,this[3]=r,this.check()}fromMatrix3(e){return fR(this,e),this.check()}identity(){return rH(this),this.check()}fromAxisRotation(e,t){return hR(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]=nr(e)}get y(){return this[1]}set y(e){this[1]=nr(e)}get z(){return this[2]}set z(e){this[2]=nr(e)}get w(){return this[3]}set w(e){this[3]=nr(e)}len(){return fH(this)}lengthSquared(){return pH(this)}dot(e,t){if(void 0!==t)throw new Error("Quaternion.dot only takes one argument");return gR(this,e)}rotationTo(e,t){return mH(this,e,t),this.check()}add(e,t){if(void 0!==t)throw new Error("Quaternion.add only takes one argument");return dH(this,this,e),this.check()}calculateW(){return lH(this,this),this.check()}conjugate(){return uH(this,this),this.check()}invert(){return cH(this,this),this.check()}lerp(e,t,i){return hH(this,e,t,i),this.check()}multiplyRight(e,t){return Zu(!t),rS(this,this,e),this.check()}multiplyLeft(e,t){return Zu(!t),rS(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 sH(this,this,e),this.check()}rotateY(e){return oH(this,this,e),this.check()}rotateZ(e){return aH(this,this,e),this.check()}scale(e){return pR(this,this,e),this.check()}slerp(e,t,i){switch(arguments.length){case 1:({start:e=Sge,target:t,ratio:i}=arguments[0]);break;case 2:[t,i]=arguments,e=this}return nb(this,e,t,i),this.check()}transformVector4(e,t=e){return OU(t,e,this),_x(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)}}const Cge={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Tge={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function _H(n){if(!n._animation){const e=Tge[n.componentType],t=Cge[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;l{(function(n,{input:e,interpolation:t,output:i},r,s){const a=n%e[e.length-1],l=e.findIndex(f=>f>=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:mn.warn(`Bad animation path ${s}`)()}on(r[s].length===i[c].length);const u=e[c],h=e[l];switch(t){case"STEP":!function(n,e,t){for(let i=0;iu&&function(n,e,t,i,r){if("rotation"===e){_R.slerp({start:t,target:i,ratio:r});for(let s=0;s<_R.length;s++)n[e][s]=_R[s]}else for(let s=0;su&&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:_H(e.accessors[a]),interpolation:l,output:_H(e.accessors[c])})),o=t.channels.map(({sampler:a,target:l})=>({sampler:s[a],target:e.nodes[l.node],path:l.path}));return new Pge({name:r,channels:o})})}animate(e){this.setTime(e)}setTime(e){this.animations.forEach(t=>t.animate(e))}getAnimations(){return this.animations}}class kge extends rm{constructor(e,t={}){super(t),this.onBeforeRender=null,this.AfterRender=null,e instanceof Yg?(this.model=e,this._setModelNodeProps(t)):this.model=new Yg(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 Fge{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},mI(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 ya(this.gl,ot({id:e.name||e.id,parameters:ot(ot({},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&&(mn.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 yH(n,e){return Ci(n)?`#version 300 es\n${e}`:e}const jge={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Uge={modelOptions:{},pbrDebug:!1,imageBasedLightingEnvironment:null,lights:!0,useTangents:!1};class zge{constructor(e,t={}){this.gl=e,this.options=Object.assign({},Uge,t)}instantiate(e){return this.gltf=e,(e.scenes||[]).map(i=>this.createScene(i))}createAnimator(){return Array.isArray(this.gltf.animations)?new Nge(this.gltf):null}createScene(e){const i=(e.nodes||[]).map(s=>this.createNode(s));return new tb({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 tb({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 qn).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 tb({id:e.name||e.id,children:i});e._mesh=r}return e._mesh}getVertexCount(e){mn.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 Fge(n,e);mn.info(4,"createGLTFModel defines: ",a.defines)();const l=[];l.push(...a.generatedTextures),l.push(...Object.values(s).map(u=>u.buffer));const c=new kge(n,Object.assign({id:t,drawMode:i,vertexCount:r,modules:[eH],defines:a.defines,parameters:a.parameters,vs:yH(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:yH(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))),mn.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 lr(this.gl,{id:`from-${i.id}`,data:i.data||e.value,target:t})),i.lumaBuffers[t]}createAccessor(e,t){return new _a({buffer:t,offset:e.byteOffset||0,stride:e.bufferView.byteStride||0,type:e.componentType,size:jge[e.type]})}createSampler(e){return e}needsPOT(){return!1}}function bH(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 sm(i,this.metadata)}selectAt(...e){const t=e.map(i=>this.fields[i]).filter(Boolean);return new sm(t,this.metadata)}assign(e){let t,i=this.metadata;if(e instanceof sm){const o=e;t=o.fields,i=xH(xH(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 sm(s,i)}}function xH(n,e){return new Map([...n||new Map,...e||new Map])}let kr,SH,CH,TH,AH,MH,DH,IH;!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"}(kr||(kr={}));class yR{static isNull(e){return e&&e.typeId===kr.Null}static isInt(e){return e&&e.typeId===kr.Int}static isFloat(e){return e&&e.typeId===kr.Float}static isBinary(e){return e&&e.typeId===kr.Binary}static isUtf8(e){return e&&e.typeId===kr.Utf8}static isBool(e){return e&&e.typeId===kr.Bool}static isDecimal(e){return e&&e.typeId===kr.Decimal}static isDate(e){return e&&e.typeId===kr.Date}static isTime(e){return e&&e.typeId===kr.Time}static isTimestamp(e){return e&&e.typeId===kr.Timestamp}static isInterval(e){return e&&e.typeId===kr.Interval}static isList(e){return e&&e.typeId===kr.List}static isStruct(e){return e&&e.typeId===kr.Struct}static isUnion(e){return e&&e.typeId===kr.Union}static isFixedSizeBinary(e){return e&&e.typeId===kr.FixedSizeBinary}static isFixedSizeList(e){return e&&e.typeId===kr.FixedSizeList}static isMap(e){return e&&e.typeId===kr.Map}static isDictionary(e){return e&&e.typeId===kr.Dictionary}get typeId(){return kr.NONE}compareTo(e){return this===e}}Symbol,Symbol,SH=Symbol.toStringTag;class om extends yR{constructor(e,t){super(),Kn(this,"isSigned",void 0),Kn(this,"bitWidth",void 0),this.isSigned=e,this.bitWidth=t}get typeId(){return kr.Int}get[SH](){return"Int"}toString(){return`${this.isSigned?"I":"Ui"}nt${this.bitWidth}`}}class Zge extends om{constructor(){super(!0,8)}}class Jge extends om{constructor(){super(!0,16)}}class eme extends om{constructor(){super(!0,32)}}class tme extends om{constructor(){super(!1,8)}}class nme extends om{constructor(){super(!1,16)}}class ime extends om{constructor(){super(!1,32)}}CH=Symbol.toStringTag;class OH extends yR{constructor(e){super(),Kn(this,"precision",void 0),this.precision=e}get typeId(){return kr.Float}get[CH](){return"Float"}toString(){return`Float${this.precision}`}}class rme extends OH{constructor(){super(32)}}class sme extends OH{constructor(){super(64)}}Symbol,Symbol,TH=Symbol.toStringTag,AH=Symbol.toStringTag,MH=Symbol.toStringTag,DH=Symbol.toStringTag,IH=Symbol.toStringTag;class ome extends yR{constructor(e,t){super(),Kn(this,"listSize",void 0),Kn(this,"children",void 0),this.listSize=e,this.children=[t]}get typeId(){return kr.FixedSizeList}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get[IH](){return"FixedSizeList"}toString(){return`FixedSizeList[${this.listSize}]<${this.valueType}>`}}class sS{constructor(e,t,i=!1,r=new Map){Kn(this,"name",void 0),Kn(this,"type",void 0),Kn(this,"nullable",void 0),Kn(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 sS(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 RH(n,e,t){const i=t?PH(t.metadata):void 0,r=function(n){switch(n.constructor){case Int8Array:return new Zge;case Uint8Array:return new tme;case Int16Array:return new Jge;case Uint16Array:return new nme;case Int32Array:return new eme;case Uint32Array:return new ime;case Float32Array:return new rme;case Float64Array:return new sme;default:throw new Error("array type not supported")}}(e.value);return new sS(n,new ome(e.size,new sS("value",r)),!1,i)}function PH(n){const e=new Map;for(const t in n)e.set(`${t}.string`,JSON.stringify(n[t]));return e}const NH={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},ume={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array};class hme{constructor(e){Kn(this,"draco",void 0),Kn(this,"decoder",void 0),Kn(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 f=`DRACO decompression failed: ${o.error_msg()}`;throw new Error(f)}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?u:r,s=h>s?h:s,o=f>o?f:o}return[[e,t,i],[r,s,o]]}(l.attributes),u=function(n,e,t){const i=PH(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=RH(o,n[o],s[o]);r.push(l)}if(t){const o=RH("indices",t);r.push(o)}return new sm(r,i)}(l.attributes,a,l.indices);return Sn(ot({loader:"draco",loaderData:a,header:{vertexCount:s.num_points(),boundingBox:c}},l),{schema:u})}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 oS=et(9125);const ER={};function xR(n){return SR.apply(this,arguments)}function SR(){return(SR=li(function*(n,e=null,t={}){return e&&(n=_me(n,e,t)),ER[n]=ER[n]||yme(n),yield ER[n]})).apply(this,arguments)}function _me(n,e,t){if(n.startsWith("http"))return n;const i=t.modules||{};return i[n]?i[n]:_O?t.CDN?(nu(t.CDN.startsWith("http")),`${t.CDN}/${e}@3.0.12/dist/libs/${n}`):yO?`../src/libs/${n}`:`modules/${e}/src/libs/${n}`:`modules/${e}/dist/libs/${n}`}function yme(n){return CR.apply(this,arguments)}function CR(){return(CR=li(function*(n){return n.endsWith("wasm")?yield(yield fetch(n)).arrayBuffer():_O?yO?importScripts(n):bme(yield(yield fetch(n)).text(),n):oS.requireFromFile&&(yield oS.requireFromFile(n))})).apply(this,arguments)}function bme(n,e){if(!_O)return oS.requireFromString&&oS.requireFromString(n,e);if(yO)return eval.call(Iue,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 vme="https://www.gstatic.com/draco/versioned/decoders/1.4.1/draco_decoder.js",wme="https://www.gstatic.com/draco/versioned/decoders/1.4.1/draco_wasm_wrapper.js",Eme="https://www.gstatic.com/draco/versioned/decoders/1.4.1/draco_decoder.wasm";let ib;function Sme(n){return TR.apply(this,arguments)}function TR(){return(TR=li(function*(n){const e=n.modules||{};return ib=e.draco3d?ib||e.draco3d.createDecoderModule({}).then(t=>({draco:t})):ib||Cme(n),yield ib})).apply(this,arguments)}function Cme(n){return MR.apply(this,arguments)}function MR(){return(MR=li(function*(n){let e,t;switch(n.draco&&n.draco.decoderType){case"js":e=yield xR(vme,"draco",n);break;case"wasm":default:[e,t]=yield Promise.all([yield xR(wme,"draco",n),yield xR(Eme,"draco",n)])}return e=e||globalThis.DracoDecoderModule,yield Tme(e,t)})).apply(this,arguments)}function Tme(n,e){const t={};return e&&(t.wasmBinary=e),new Promise(i=>{n(Sn(ot({},t),{onModuleLoaded:r=>i({draco:r})}))})}const IR=Sn(ot({},EH),{parse:function(n,e){return OR.apply(this,arguments)}});function OR(){return(OR=li(function*(n,e){const{draco:t}=yield Sme(e),i=new hme(t);try{return i.parseSync(n,null==e?void 0:e.draco)}finally{i.destroy()}})).apply(this,arguments)}function sb(n,e){return Lf(n>=0),Lf(e>0),n+(e-1)&~(e-1)}function Dme(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+sb(i.byteLength,4)}const kH=["SCALAR","VEC2","VEC3","VEC4"],Ime=[[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Uint32Array,5125],[Float32Array,5126],[Float64Array,5130]],Ome=new Map(Ime),Rme={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Pme={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},Nme={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function FH(n){return kH[n-1]||kH[0]}function LH(n){const e=Ome.get(n.constructor);if(!e)throw new Error("Illegal typed array");return e}function BH(n,e){const t=Nme[n.componentType],i=Rme[n.type],s=n.count*i,o=n.count*i*Pme[n.componentType];return $a(o>=0&&o<=e.byteLength),{ArrayType:t,length:s,byteLength:o}}const kme={asset:{version:"2.0",generator:"loaders.gl"},buffers:[]};class _h{constructor(e){Kn(this,"gltf",void 0),Kn(this,"sourceBuffers",void 0),Kn(this,"byteLength",void 0),this.gltf=e||{json:ot({},kme),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 $a(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}=BH(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 $a(t),this.json.extensions=this.json.extensions||{},this.json.extensions[e]=t,this.registerUsedExtension(e),t}addRequiredExtension(e,t={}){return $a(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=eR(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;$a(Number.isFinite(t)),this.sourceBuffers=this.sourceBuffers||[],this.sourceBuffers.push(e);const i={buffer:0,byteOffset:this.byteLength,byteLength:t};return this.byteLength+=sb(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:FH(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:LH(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=Dme(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*Wme(n){for(const e of n.json.meshes||[])for(const t of e.primitives)yield t}function qme(n){return NR.apply(this,arguments)}function NR(){return(NR=li(function*(n){const e=new _h(n),{json:t}=e;e.removeExtension(lS);for(const i of t.materials||[])i.extensions&&i.extensions.KHR_materials_unlit&&(i.unlit=!0),e.removeObjectExtension(i,lS)})).apply(this,arguments)}function Yme(n){const e=new _h(n),{json:t}=e;if(e.materials)for(const i of t.materials||[])i.unlit&&(delete i.unlit,e.addObjectExtension(i,lS,{}),e.addExtension(lS))}function Xme(n){return kR.apply(this,arguments)}function kR(){return(kR=li(function*(n){const e=new _h(n),{json:t}=e,i=e.getExtension(am);i&&(e.json.lights=i.lights,e.removeExtension(am));for(const r of t.nodes||[]){const s=e.getObjectExtension(r,am);s&&(r.light=s.light),e.removeObjectExtension(r,am)}})).apply(this,arguments)}function Kme(n){return FR.apply(this,arguments)}function FR(){return(FR=li(function*(n){const e=new _h(n),{json:t}=e;if(t.lights){const i=e.addExtension(am);$a(!i.lights),i.lights=t.lights,delete t.lights}if(e.json.lights){for(const i of e.json.lights)e.addObjectExtension(i.node,am,i);delete e.json.lights}})).apply(this,arguments)}function Qme(n){return LR.apply(this,arguments)}function LR(){return(LR=li(function*(n){const e=new _h(n),{json:t}=e,i=e.getExtension(cS);if(i){const r=Jme(i,e);for(const s of t.materials||[]){const o=e.getObjectExtension(s,cS);o&&(s.technique=Object.assign({},o,r[o.technique]),s.technique.values=e_e(s.technique,e)),e.removeObjectExtension(s,cS)}e.removeExtension(cS)}})).apply(this,arguments)}function Zme(n,e){return BR.apply(this,arguments)}function BR(){return(BR=li(function*(n,e){})).apply(this,arguments)}function Jme(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 e_e(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 UH={KHR_draco_mesh_compression:yt,KHR_materials_unlit:ee,KHR_lights_punctual:Dt,KHR_techniques_webgl:dt};function t_e(n){return VR.apply(this,arguments)}function VR(){return(VR=li(function*(n,e={},t){for(const r in UH){var i;const s=(null==e||null===(i=e.gltf)||void 0===i?void 0:i.excludeExtensions)||{};r in s&&!s[r]||(yield UH[r].decode(n,e,t))}})).apply(this,arguments)}const zH={accessors:"accessor",animations:"animation",buffers:"buffer",bufferViews:"bufferView",images:"image",materials:"material",meshes:"mesh",nodes:"node",samplers:"sampler",scenes:"scene",skins:"skin",textures:"texture"},i_e={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 r_e{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 _h(n),{json:t}=e;for(const i of t.images||[]){const r=e.removeObjectExtension(i,VH);r&&Object.assign(i,r)}t.buffers&&t.buffers[0]&&delete t.buffers[0].uri,e.removeExtension(VH)}(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 zH)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 zH)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=i_e[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 s_e(n,e={}){return(new r_e).normalize(n,e)}const o_e={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},a_e={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},Ml={TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,REPEAT:10497,LINEAR:9729,NEAREST_MIPMAP_LINEAR:9986},l_e={magFilter:Ml.TEXTURE_MAG_FILTER,minFilter:Ml.TEXTURE_MIN_FILTER,wrapS:Ml.TEXTURE_WRAP_S,wrapT:Ml.TEXTURE_WRAP_T},c_e={[Ml.TEXTURE_MAG_FILTER]:Ml.LINEAR,[Ml.TEXTURE_MIN_FILTER]:Ml.NEAREST_MIPMAP_LINEAR,[Ml.TEXTURE_WRAP_S]:Ml.REPEAT,[Ml.TEXTURE_WRAP_]:Ml.REPEAT};class h_e{postProcess(e,t={}){const{json:i,buffers:r=[],images:s=[],baseUri:o=""}=e;return $a(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=ot({},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=ot({},e.normalTexture),e.normalTexture.texture=this.getTexture(e.normalTexture.index)),e.occlusionTexture&&(e.occlustionTexture=ot({},e.occlustionTexture),e.occlusionTexture.texture=this.getTexture(e.occlusionTexture.index)),e.emissiveTexture&&(e.emmisiveTexture=ot({},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=ot({},e.pbrMetallicRoughness);const i=e.pbrMetallicRoughness;i.baseColorTexture&&(i.baseColorTexture=ot({},i.baseColorTexture),i.baseColorTexture.texture=this.getTexture(i.baseColorTexture.index)),i.metallicRoughnessTexture&&(i.metallicRoughnessTexture=ot({},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 a_e[n]}(e.componentType),e.components=function(n){return o_e[n]}(e.type),e.bytesPerElement=e.bytesPerComponent*e.components,e.bufferView){const i=e.bufferView.buffer,{ArrayType:r,byteLength:s}=BH(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):c_e,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 l_e[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 f_e(n,e){return(new h_e).postProcess(n,e)}const HH=1735152710,lm=!0;function UR(n,e,t,i){const r=new Uint8Array(e.buffer,t,i),o=new TextDecoder("utf8").decode(r);return n.json=JSON.parse(o),sb(i,4)}function zR(n,e,t,i){return n.header.hasBinChunk=!0,n.binChunks.push({byteOffset:t,byteLength:i,arrayBuffer:e.buffer}),sb(i,4)}function C_e(n,e){return HR.apply(this,arguments)}function HR(){return(HR=li(function*(n,e,t=0,i,r){var s,o,a,l;T_e(n,e,t,i),s_e(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 A_e(n,i,r)),null!=i&&null!==(a=i.gltf)&&void 0!==a&&a.loadImages){const h=M_e(n,i,r);c.push(h)}const u=t_e(n,i,r);return c.push(u),yield Promise.all(c),null!=i&&null!==(l=i.gltf)&&void 0!==l&&l.postProcess?f_e(n,i):n})).apply(this,arguments)}function T_e(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=HH}=t,s=i.getUint32(e,!1);return s===r||s===HH}(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)?bH(n.buffer,n.byteOffset,e):n instanceof ArrayBuffer?bH(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,lm),a=r.getUint32(t+8,lm);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){Lf(n.header.byteLength>20);const i=e.getUint32(t+0,lm),r=e.getUint32(t+4,lm);return t+=8,Lf(0===r),UR(n,e,t,i),(t+=i)+zR(n,e,t,n.header.byteLength)}(n,r,t);case 2:return function(n,e,t,i){return Lf(n.header.byteLength>20),function(n,e,t,i){for(;t+8<=n.header.byteLength;){const r=e.getUint32(t+0,lm),s=e.getUint32(t+4,lm);switch(t+=8,s){case 1313821514:UR(n,e,t,r);break;case 5130562:zR(n,e,t,r);break;case 0:i.strict||UR(n,e,t,r);break;case 1:i.strict||zR(n,e,t,r)}t+=sb(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),$a("glTF"===o.type,`Invalid GLB magic string ${o.type}`),n._glb=o,n.json=o.json}else $a(!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 A_e(n,e,t){return GR.apply(this,arguments)}function GR(){return(GR=li(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 R_e(()=>e.some(t=>!t.loaded))})).apply(this,arguments)}function R_e(n){return XR.apply(this,arguments)}function XR(){return(XR=li(function*(n){for(;n();)yield new Promise(e=>requestAnimationFrame(e))})).apply(this,arguments)}const GH=[255,255,255,255],k_e={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:GH},_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:[cm]};let F_e=(()=>{class n extends Y0{getShaders(){const t=[tS,nS];return"pbr"===this.props._lighting&&t.push(eH),{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:GH,transition:!0},instanceModelMatrix:Q4})}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 rm)r={scenes:[t.scenegraph]};else if(t.scenegraph&&!t.scenegraph.gltf){const l=t.scenegraph,c=function(n,e,t){const i=new zge(n,t);return{scenes:i.instantiate(e),animator:i.createAnimator()}}(i,l,this._getModelOptions());r=ot({gltf:l},c),function(n){return YR.apply(this,arguments)}(c).then(()=>this.setNeedsRedraw())}else t.scenegraph&&(Ri.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 rm?(this._deleteScenegraph(),this._applyAllAttributes(o),this._applyAnimationsProp(o,a,t._animations),this.setState({scenegraph:o,animator:a})):null!==o&&Ri.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):Ri.warn("animation ".concat(o," not found"))()}})}_deleteScenegraph(){const{scenegraph:t}=this.state;t instanceof rm&&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:ot({isInstanced:!0,transpileToGLSL100:!Ci(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:u}=this.props,h=this.getNumInstances();this.state.scenegraph.traverse((f,{worldMatrix:g})=>{f.model.setInstanceCount(h),f.updateModuleSettings(t),f.draw({parameters:i,uniforms:{sizeScale:o,opacity:c,sizeMinPixels:a,sizeMaxPixels:l,composeModelMatrix:Z4(s,u),sceneModelMatrix:g,u_Camera:f.model.getUniforms().project_uCameraPosition}})})}}return n.layerName="ScenegraphLayer",n.defaultProps=k_e,n})();class L_e extends gh{constructor(e={}){const{id:t=ma("sphere-geometry")}=e,{indices:i,attributes:r}=function(n){const{nlat:e=10,nlong:t=10}=n;let{radius:i=1}=n;const o=Math.PI-0,c=2*Math.PI-0,u=(e+1)*(t+1);if("number"==typeof i){const U=i;i=(D,ie,_e,Pe,Ne)=>U}const h=new Float32Array(3*u),f=new Float32Array(3*u),g=new Float32Array(2*u),v=new(u>65535?Uint32Array:Uint16Array)(e*t*6);for(let U=0;U<=e;U++)for(let D=0;D<=t;D++){const ie=D/t,_e=U/e,Pe=D+U*(t+1),Ne=2*Pe,Ve=3*Pe,bt=c*ie,xt=o*_e,At=Math.sin(bt),Bt=Math.cos(bt),Wt=Math.sin(xt),mt=Bt*Wt,jt=Math.cos(xt),ft=At*Wt,Yt=i(mt,jt,ft,ie,_e);h[Ve+0]=Yt*mt,h[Ve+1]=Yt*jt,h[Ve+2]=Yt*ft,f[Ve+0]=mt,f[Ve+1]=jt,f[Ve+2]=ft,g[Ne+0]=ie,g[Ne+1]=1-_e}const x=t+1;for(let U=0;Us?(gt=i,Wt=1,mt=t):mt=e+Bt/s*(t-e),(-2===Bt||Bt===s+2)&&(mt=0,Wt=0),gt-=i/2;for(let jt=0;jts?0:ft*v,Ve[xt+Pe[1]]=Bt<0?-1:Bt>s?1:x,Ve[xt+Pe[2]]=Bt<0||Bt>s?0:Yt*v,bt[At+0]=jt/r,bt[At+1]=Wt,At+=2,xt+=3}}for(let Bt=0;Bt0){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 ce){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 ce){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 ce){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 ce){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 ce){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=K_e,s=1/i;r.set(this.x*s,this.y*s,this.z*s);const o=Q_e;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(WH),WH.almostEquals(e,t)}clone(){return new ce(this.x,this.y,this.z)}}ce.ZERO=void 0,ce.UNIT_X=void 0,ce.UNIT_Y=void 0,ce.UNIT_Z=void 0,ce.ZERO=new ce(0,0,0),ce.UNIT_X=new ce(1,0,0),ce.UNIT_Y=new ce(0,1,0),ce.UNIT_Z=new ce(0,0,1);const K_e=new ce,Q_e=new ce,WH=new ce;class pr{constructor(e={}){this.lowerBound=void 0,this.upperBound=void 0,this.lowerBound=new ce,this.upperBound=new ce,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,u=this.upperBound;e.copy(c),t.set(u.x,c.y,c.z),i.set(u.x,u.y,c.z),r.set(c.x,u.y,u.z),s.set(u.x,c.y,u.z),o.set(c.x,u.y,c.z),a.set(c.x,c.y,u.z),l.copy(u)}toLocalFrame(e,t){const i=YH;this.getCorners(i[0],i[1],i[2],i[3],i[4],i[5],i[6],i[7]);for(let f=0;8!==f;f++){const g=i[f];e.pointToLocal(g,g)}return t.setFromPoints(i)}toWorldFrame(e,t){const i=YH;this.getCorners(i[0],i[1],i[2],i[3],i[4],i[5],i[6],i[7]);for(let f=0;8!==f;f++){const g=i[f];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,u=(this.upperBound.y-i.y)*s,h=(this.lowerBound.z-i.z)*o,f=(this.upperBound.z-i.z)*o,g=Math.max(Math.max(Math.min(a,l),Math.min(c,u)),Math.min(h,f)),m=Math.min(Math.min(Math.max(a,l),Math.max(c,u)),Math.max(h,f));return!(m<0||g>m)}}const qH=new ce,YH=[new ce,new ce,new ce,new ce,new ce,new ce,new ce,new ce];class us{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 ce){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=J_e;e.tangents(i,eye),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(Er(e.length(),2)*Er(t.length(),2))+e.dot(t),this.normalize()}return this}mult(e,t=new us){const i=this.x,r=this.y,s=this.z,o=this.w,a=e.x,l=e.y,c=e.z,u=e.w;return t.x=i*u+o*a+r*c-s*l,t.y=r*u+o*l+s*a-i*c,t.z=s*u+o*c+i*l-r*a,t.w=o*u-i*a-r*l-s*c,t}inverse(e=new us){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 us){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 ce){const i=e.x,r=e.y,s=e.z,o=this.x,a=this.y,l=this.z,c=this.w,u=c*i+a*s-l*r,h=c*r+l*i-o*s,f=c*s+o*r-a*i,g=-o*i-a*r-l*s;return t.x=u*c+g*-o+h*-l-f*-a,t.y=h*c+g*-a+f*-o-u*-l,t.z=f*c+g*-l+u*-a-h*-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 u=o*a+l*c;if(u>.499&&(i=2*Math.atan2(o,c),r=Math.PI/2,s=0),u<-.499&&(i=-2*Math.atan2(o,c),r=-Math.PI/2,s=0),void 0===i){const h=o*o,g=l*l;i=Math.atan2(2*a*c-2*o*l,1-a*a*2-2*g),r=Math.asin(2*u),s=Math.atan2(2*o*c-2*a*l,1-2*h-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),u=Math.sin(i/2);return"XYZ"===r?(this.x=l*o*a+s*c*u,this.y=s*c*a-l*o*u,this.z=s*o*u+l*c*a,this.w=s*o*a-l*c*u):"YXZ"===r?(this.x=l*o*a+s*c*u,this.y=s*c*a-l*o*u,this.z=s*o*u-l*c*a,this.w=s*o*a+l*c*u):"ZXY"===r?(this.x=l*o*a-s*c*u,this.y=s*c*a+l*o*u,this.z=s*o*u+l*c*a,this.w=s*o*a-l*c*u):"ZYX"===r?(this.x=l*o*a-s*c*u,this.y=s*c*a+l*o*u,this.z=s*o*u-l*c*a,this.w=s*o*a+l*c*u):"YZX"===r?(this.x=l*o*a+s*c*u,this.y=s*c*a+l*o*u,this.z=s*o*u-l*c*a,this.w=s*o*a-l*c*u):"XZY"===r&&(this.x=l*o*a-s*c*u,this.y=s*c*a-l*o*u,this.z=s*o*u+l*c*a,this.w=s*o*a+l*c*u),this}clone(){return new us(this.x,this.y,this.z,this.w)}slerp(e,t,i=new us){const r=this.x,s=this.y,o=this.z,a=this.w;let f,g,m,v,x,l=e.x,c=e.y,u=e.z,h=e.w;return g=r*l+s*c+o*u+a*h,g<0&&(g=-g,l=-l,c=-c,u=-u,h=-h),1-g>1e-6?(f=Math.acos(g),m=Math.sin(f),v=Math.sin((1-t)*f)/m,x=Math.sin(t*f)/m):(v=1-t,x=t),i.x=v*r+x*l,i.y=v*s+x*c,i.z=v*o+x*u,i.w=v*a+x*h,i}integrate(e,t,i,r=new us){const s=e.x*i.x,o=e.y*i.y,a=e.z*i.z,l=this.x,c=this.y,u=this.z,h=this.w,f=.5*t;return r.x+=f*(s*h+o*u-a*c),r.y+=f*(o*h+a*l-s*u),r.z+=f*(a*h+s*c-o*l),r.w+=f*(-s*l-o*c-a*u),r}}const J_e=new ce,eye=new ce,tye={SPHERE:1,PLANE:2,BOX:4,COMPOUND:8,CONVEXPOLYHEDRON:16,HEIGHTFIELD:32,PARTICLE:64,CYLINDER:128,TRIMESH:256};let _n=(()=>{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=tye,n})();class $i{constructor(e={}){this.position=void 0,this.quaternion=void 0,this.position=new ce,this.quaternion=new us,e.position&&this.position.copy(e.position),e.quaternion&&this.quaternion.copy(e.quaternion)}pointToLocal(e,t){return $i.pointToLocalFrame(this.position,this.quaternion,e,t)}pointToWorld(e,t){return $i.pointToWorldFrame(this.position,this.quaternion,e,t)}vectorToWorldFrame(e,t=new ce){return this.quaternion.vmult(e,t),t}static pointToLocalFrame(e,t,i,r=new ce){return i.vsub(e,r),t.conjugate(KH),KH.vmult(r,r),r}static pointToWorldFrame(e,t,i,r=new ce){return t.vmult(i,r),r.vadd(e,r),r}static vectorToWorldFrame(e,t,i=new ce){return e.vmult(t,i),i}static vectorToLocalFrame(e,t,i,r=new ce){return t.w*=-1,t.vmult(i,r),t.w*=-1,r}}const KH=new us;class jf extends _n{constructor(e={}){const{vertices:t=[],faces:i=[],normals:r=[],axes:s,boundingSphereRadius:o}=e;super({type:_n.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 ce;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 u=!1;for(let h=0;h!==i.length;h++)if(i[h].almostEquals(r)||i[h].almostEquals(r)){u=!0;break}u||i.push(r.clone())}}}computeNormals(){this.faceNormals.length=this.faces.length;for(let e=0;ef&&(f=v,h=m)}const g=[];for(let m=0;m=0&&this.clipFaceAgainstHull(o,e,t,g,a,l,c)}findSeparatingAxis(e,t,i,r,s,o,a,l){const c=new ce,u=new ce,h=new ce,f=new ce,g=new ce,m=new ce;let v=Number.MAX_VALUE;const x=this;if(x.uniqueAxes)for(let U=0;U!==x.uniqueAxes.length;U++){i.vmult(x.uniqueAxes[U],c);const D=x.testSepAxis(c,e,t,i,r,s);if(!1===D)return!1;D0&&o.negate(o),!0}testSepAxis(e,t,i,r,s,o){jf.project(this,e,i,r,KR),jf.project(t,e,s,o,QR);const l=KR[0],c=KR[1],u=QR[0],h=QR[1];if(l0?1/t:0,this.material=e.material||null,this.linearDamping="number"==typeof e.linearDamping?e.linearDamping:.01,this.type=t<=0?yn.STATIC:yn.DYNAMIC,typeof e.type==typeof yn.STATIC&&(this.type=e.type),this.allowSleep=void 0===e.allowSleep||e.allowSleep,this.sleepState=yn.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 ce,this.quaternion=new us,this.initQuaternion=new us,this.previousQuaternion=new us,this.interpolatedQuaternion=new us,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 ce,e.angularVelocity&&this.angularVelocity.copy(e.angularVelocity),this.initAngularVelocity=new ce,this.shapes=[],this.shapeOffsets=[],this.shapeOrientations=[],this.inertia=new ce,this.invInertia=new ce,this.invInertiaWorld=new lu,this.invMassSolve=0,this.invInertiaSolve=new ce,this.invInertiaWorldSolve=new lu,this.fixedRotation=void 0!==e.fixedRotation&&e.fixedRotation,this.angularDamping=void 0!==e.angularDamping?e.angularDamping:.01,this.linearFactor=new ce(1,1,1),e.linearFactor&&this.linearFactor.copy(e.linearFactor),this.angularFactor=new ce(1,1,1),e.angularFactor&&this.angularFactor.copy(e.angularFactor),this.aabb=new pr,this.aabbNeedsUpdate=!0,this.boundingRadius=0,this.wlambda=new ce,this.isTrigger=Boolean(e.isTrigger),e.shape&&this.addShape(e.shape),this.updateMassProperties()}wakeUp(){const e=this.sleepState;this.sleepState=yn.AWAKE,this.wakeUpAfterNarrowphase=!1,e===yn.SLEEPING&&this.dispatchEvent(yn.wakeupEvent)}sleep(){this.sleepState=yn.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=Er(this.sleepSpeedLimit,2);t===yn.AWAKE&&ir?this.wakeUp():t===yn.SLEEPY&&e-this.timeLastSleepy>this.sleepTimeLimit&&(this.sleep(),this.dispatchEvent(yn.sleepEvent))}}updateSolveMassProperties(){this.sleepState===yn.SLEEPING||this.type===yn.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 ce){return e.vsub(this.position,t),this.quaternion.conjugate().vmult(t,t),t}vectorToLocalFrame(e,t=new ce){return this.quaternion.conjugate().vmult(e,t),t}pointToWorldFrame(e,t=new ce){return this.quaternion.vmult(e,t),t.vadd(this.position,t),t}vectorToWorldFrame(e,t=new ce){return this.quaternion.vmult(e,t),t}addShape(e,t,i){const r=new ce,s=new us;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=rye,o=sye,a=this.quaternion,l=this.aabb,c=oye;for(let u=0;u!==r;u++){const h=e[u];a.vmult(t[u],s),s.vadd(this.position,s),a.mult(i[u],o),h.calculateWorldAABB(s,o,c.lowerBound,c.upperBound),0===u?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=aye,r=lye;i.setRotationFromQuaternion(this.quaternion),i.transpose(r),i.scale(t,i),i.mmult(r,this.invInertiaWorld)}}applyForce(e,t=new ce){if(this.type!==yn.DYNAMIC)return;this.sleepState===yn.SLEEPING&&this.wakeUp();const i=cye;t.cross(e,i),this.force.vadd(e,this.force),this.torque.vadd(i,this.torque)}applyLocalForce(e,t=new ce){if(this.type!==yn.DYNAMIC)return;const i=uye,r=dye;this.vectorToWorldFrame(e,i),this.vectorToWorldFrame(t,r),this.applyForce(i,r)}applyTorque(e){this.type===yn.DYNAMIC&&(this.sleepState===yn.SLEEPING&&this.wakeUp(),this.torque.vadd(e,this.torque))}applyImpulse(e,t=new ce){if(this.type!==yn.DYNAMIC)return;this.sleepState===yn.SLEEPING&&this.wakeUp();const i=t,r=hye;r.copy(e),r.scale(this.invMass,r),this.velocity.vadd(r,this.velocity);const s=fye;i.cross(e,s),this.invInertiaWorld.vmult(s,s),this.angularVelocity.vadd(s,this.angularVelocity)}applyLocalImpulse(e,t=new ce){if(this.type!==yn.DYNAMIC)return;const i=pye,r=gye;this.vectorToWorldFrame(e,i),this.vectorToWorldFrame(t,r),this.applyImpulse(i,r)}updateMassProperties(){const e=mye;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),dS.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 ce;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!==yn.DYNAMIC&&this.type!==yn.KINEMATIC||this.sleepState===yn.SLEEPING)return;const r=this.velocity,s=this.angularVelocity,o=this.position,a=this.force,l=this.torque,c=this.quaternion,h=this.invInertiaWorld,f=this.linearFactor,g=this.invMass*e;r.x+=a.x*g*f.x,r.y+=a.y*g*f.y,r.z+=a.z*g*f.z;const m=h.elements,v=this.angularFactor,x=l.x*v.x,U=l.y*v.y,D=l.z*v.z;s.x+=e*(m[0]*x+m[1]*U+m[2]*D),s.y+=e*(m[3]*x+m[4]*U+m[5]*D),s.z+=e*(m[6]*x+m[7]*U+m[8]*D),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()}}yn.idCounter=0,yn.COLLIDE_EVENT_NAME="collide",yn.DYNAMIC=1,yn.STATIC=2,yn.KINEMATIC=4,yn.AWAKE=0,yn.SLEEPY=1,yn.SLEEPING=2,yn.wakeupEvent={type:"wakeup"},yn.sleepyEvent={type:"sleepy"},yn.sleepEvent={type:"sleep"};const rye=new ce,sye=new us,oye=new pr,aye=new lu,lye=new lu,cye=new ce,uye=new ce,dye=new ce,hye=new ce,fye=new ce,pye=new ce,gye=new ce,mye=new ce;new ce,new ce;class hS{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 ce,this.rayToWorld=new ce,this.hitNormalWorld=new ce,this.hitPointWorld=new ce,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 QH,ZH,JH,e8,t8,n8,i8;QH=_n.types.SPHERE,ZH=_n.types.PLANE,JH=_n.types.BOX,e8=_n.types.CYLINDER,t8=_n.types.CONVEXPOLYHEDRON,n8=_n.types.HEIGHTFIELD,i8=_n.types.TRIMESH;class ys{get[QH](){return this._intersectSphere}get[ZH](){return this._intersectPlane}get[JH](){return this._intersectBox}get[e8](){return this._intersectConvex}get[t8](){return this._intersectConvex}get[n8](){return this._intersectHeightfield}get[i8](){return this._intersectTrimesh}constructor(e=new ce,t=new ce){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 ce,this.precision=1e-4,this.checkCollisionResponse=!0,this.skipBackfaces=!1,this.collisionFilterMask=-1,this.collisionFilterGroup=-1,this.mode=ys.ANY,this.result=new hS,this.hasHit=!1,this.callback=i=>{}}intersectWorld(e,t){return this.mode=t.mode||ys.ANY,this.result=t.result||new hS,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(r8),tP.length=0,e.broadphase.aabbQuery(e,r8,tP),this.intersectBodies(tP),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=xye,s=Sye;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 ce(0,0,1);t.vmult(c,c);const u=new ce;o.vsub(i,u);const h=u.dot(c);if(a.vsub(i,u),h*u.dot(c)>0||o.distanceTo(a)=0&&v<=1&&(o.lerp(a,v,g),g.vsub(i,m),m.normalize(),this.reportIntersection(m,g,s,r,-1)),this.result.shouldStop)return;x>=0&&x<=1&&(o.lerp(a,x,g),g.vsub(i,m),m.normalize(),this.reportIntersection(m,g,s,r,-1))}}_intersectConvex(e,t,i,r,s,o){const a=Dye,l=o8,c=o&&o.faceList||null,u=e.faces,h=e.vertices,f=e.faceNormals,g=this.direction,m=this.from,x=m.distanceTo(this.to),U=c?c.length:u.length,D=this.result;for(let ie=0;!D.shouldStop&&iex||this.reportIntersection(a,va,s,r,_e)}}}}_intersectTrimesh(e,t,i,r,s,o){const a=Iye,l=Fye,c=Lye,u=o8,h=Oye,f=Rye,g=Pye,m=kye,v=Nye,x=e.indices,U=this.from,D=this.to,ie=this.direction;c.position.copy(i),c.quaternion.copy(t),$i.vectorToLocalFrame(i,t,ie,h),$i.pointToLocalFrame(i,t,U,f),$i.pointToLocalFrame(i,t,D,g),g.x*=e.scale.x,g.y*=e.scale.y,g.z*=e.scale.z,f.x*=e.scale.x,f.y*=e.scale.y,f.z*=e.scale.z,g.vsub(f,h),h.normalize();const _e=f.distanceSquared(g);e.tree.rayQuery(this,c,l);for(let Pe=0,Ne=l.length;!this.result.shouldStop&&Pe!==Ne;Pe++){const Ve=l[Pe];e.getNormal(Ve,a),e.getVertex(x[3*Ve],_c),_c.vsub(f,u);const bt=h.dot(a),xt=a.dot(u)/bt;if(xt<0)continue;h.scale(xt,va),va.vadd(f,va),e.getVertex(x[3*Ve+1],uu),e.getVertex(x[3*Ve+2],du);const At=va.distanceSquared(f);!ys.pointInTriangle(va,uu,_c,du)&&!ys.pointInTriangle(va,_c,uu,du)||At>_e||($i.vectorToWorldFrame(t,a,v),$i.pointToWorldFrame(i,t,va,m),this.reportIntersection(v,m,s,r,Ve))}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 ys.ALL:this.hasHit=!0,c.set(o,a,e,t,i,r,l),c.hasHit=!0,this.callback(c);break;case ys.CLOSEST:(l=0&&(h=s*c-o*a)>=0&&u+hDate.now()-n}var $f=et(4517);class Fr extends oe{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 $;return this._value}next(e){super.next(this._value=e)}}function fm(n,e,t){e||(e=new qn(qn.IDENTITY));const i=new qn(qn.IDENTITY);if(!n)return!0;if(n.matrix)i.copy(n.matrix);else{if(i.identity(),n.translation&&i.translate(n.translation),n.rotation){const s=new qn(qn.IDENTITY).fromQuaternion(n.rotation);i.multiplyRight(s)}n.scale&&i.scale(n.scale)}const r=new qn(e).multiplyRight(i);if(!1===t(n,r,e))return!1;for(const s of n.nodes||n.children||[])if(!1===fm(s,r,t))return!1;return!0}function Q8(){Mz([EH,cm])}function Z8(n,e){var t;const i=null===(t=e.nodes)||void 0===t?void 0:t.find(r=>r.name===n);if(i){let r=!1;for(const s of e.scenes)r||fm(s,new qn(qn.IDENTITY),(o,a)=>o!==i||(o.matrix=a,o.translation=void 0,o.rotation=void 0,o.scale=void 0,r=!0,!1));return e.scene={id:n,name:n,nodes:[i]},e.scenes=[e.scene],{scene:e.scene,scenes:e.scenes}}return e}function sP(n,e){return Bi(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 Hx(i,cm,{DracoLoader:IR,gltf:{decompressMeshes:!0,postProcess:!0}});return r.nodes||console.log("WARNING: Empty Scene",t,r),Z8(n.scenegraphNode,r)})}function Bve(n,e){return Bi(this,void 0,void 0,function*(){return Z8(n,yield e)})}function oP(n,e,t){if(e&&0!==e.length){let i;switch(t.geometry){case"sphere":i=new L_e;break;case"cone":i=new U_e;break;case"cylinder":i=new z_e;break;case"cube":default:i=new Y_e}return new pge(Object.assign({id:n,pickable:!0,autoHighlight:!1,highlightColor:[30,136,229,255],coordinateSystem:Vi.CARTESIAN,data:e,mesh:i,wireframe:!1,getTransformMatrix:r=>r.transformMatrix,getColor:r=>r.color||[255,255,255,229.5]},t))}}function J8(n,e,t){if(e&&0!==e.length)return new rge(Object.assign({id:n,pickable:!0,data:e.map(i=>Object.assign(Object.assign({},i),{position:new qn(i.transformMatrix).getTranslation()})),getText:i=>i.text,getPosition:i=>i.position,getColor:i=>i.color},t))}let jve=(()=>{class n extends Nz{initializeState(){const{data:t}=this.props;this.setState({data:null!=t?t:[],zoomOpacity:.8,doCollisions:!1}),Q8()}renderLayers(){var t,i;const r=this.state,s={sphere:[],cone:[],cylinder:[],cube:[],text:[],wireframe:[],scenegraph:[]};for(const l of r.data){const c=null!==(t=l.geometry)&&void 0!==t?t:"cube";l.scenegraph?s.scenegraph.push(l):void 0!==s[c]&&s[c].push(l)}const o={};for(const l of s.scenegraph)l.scenegraph&&l.scenegraphNode&&!Object.prototype.hasOwnProperty.call(o,l.scenegraph)&&(o[l.scenegraph]=sP({scenegraph:l.scenegraph},n.gltfCache));const a=[];for(const[l,c]of Object.entries(s))if("scenegraph"===l)for(const u of c)a.push(new F_e({id:"models-"+u["@id"],opacity:u.zoomBasedOpacity?r.zoomOpacity:void 0!==u.opacity?u.opacity:1,pickable:!u.unpickable,coordinateSystem:Vi.CARTESIAN,data:[u],scenegraph:u.scenegraphNode?Bve(u.scenegraphNode,o[u.scenegraph]):u.scenegraph,_lighting:u._lighting,getTransformMatrix:u.transformMatrix,getColor:null!==(i=u.color)&&void 0!==i?i:[0,255,0,127.5],parameters:{depthMask:!u.zoomBasedOpacity&&(void 0===u.opacity||1===u.opacity)}}));else"text"===l?(a.push(J8("text",c.filter(u=>u.unpickable),{pickable:!1})),a.push(J8("textPickable",c.filter(u=>!u.unpickable),{pickable:!0}))):"wireframe"===l?a.push(oP(l,c,{wireframe:!0,pickable:!1,geometry:l})):(a.push(oP(l,c.filter(u=>u.unpickable),{wireframe:!1,pickable:!1,geometry:l})),a.push(oP(`${l}Pickable`,c.filter(u=>!u.unpickable),{wireframe:!1,pickable:!0,geometry:l})));return r.doCollisions&&function(n){Bi(this,void 0,void 0,function*(){console.log("Starting Collisioning");const e=n.filter(o=>!o.scenegraph&&"wireframe"!==o.geometry).map(o=>{const a=new qn(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 pr({lowerBound:new ce(...l.map((u,h)=>Math.min(u,c[h]))),upperBound:new ce(...c.map((u,h)=>Math.max(u,l[h])))})}}),t=[];for(const o of n.filter(a=>!!a.scenegraph)){const a=yield q0(o.scenegraph,cm,{DracoLoader:IR,decompress:!0,postProcess:!0});for(const l of a.scenes)fm(l,new qn(o.transformMatrix),(c,u)=>{if(c.mesh&&c.mesh.primitives&&c.mesh.primitives.length>0)for(const h of c.mesh.primitives)if(h.attributes.POSITION&&h.attributes.POSITION.min){const f=u.transformAsPoint(h.attributes.POSITION.min,[]),g=u.transformAsPoint(h.attributes.POSITION.max,[]);t.push({"@id":o["@id"],name:c.name,entityId:o.entityId,bbox:new pr({lowerBound:new ce(...f.map((m,v)=>Math.min(m,g[v]))),upperBound:new ce(...g.map((m,v)=>Math.max(m,f[v])))}),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})}(r.data),a.filter(l=>!!l)}getPickingInfo(t){return t.info}}return n.layerName="BodyUILayer",n.gltfCache={},n})();function e5(n,e=[]){for(const t of n.nodes||n.children||[])e.push(t.name),e5(t,e);return e}let zve=(()=>{class n{constructor(t){var i,r,s,o,a;this.deckProps=t,this.bodyUILayer=new jve({}),this.nodeClickSubject=new oe,this.nodeHoverStartSubject=new oe,this.nodeHoverStopSubject=new oe,this.sceneRotationSubject=new Fr([0,0]),this.nodeDragStartSubject=new oe,this.nodeDragSubject=new oe,this.nodeDragEndSubject=new oe,this.nodeClick$=this.nodeClickSubject.pipe(ws()),this.nodeHoverStart$=this.nodeHoverStartSubject.pipe(ws()),this.nodeHoverStop$=this.nodeHoverStopSubject.pipe(ws()),this.sceneRotation$=this.sceneRotationSubject.pipe(ws()),this.nodeDragStart$=this.nodeDragStartSubject.pipe(ws()),this.nodeDrag$=this.nodeDragSubject.pipe(ws()),this.nodeDragEnd$=this.nodeDragEndSubject.pipe(ws());const l=Object.assign(Object.assign({},t),{views:["orthographic"===t.camera?new jde({flipY:!1,near:-1e3}):new Hde({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 u;return null!==(u=this.cursor)&&void 0!==u?u:c.isDragging?"grabbing":"grab"}});t.legacyLighting&&(l.effects=[new $O({ambientLight:new Vz({color:[255,255,255],intensity:10})})]),this.deck=new eS(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 Bi(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 qn([.076,0,0,0,0,.076,16875389974302382e-33,0,0,-16875389974302382e-33,.076,0,.49,.034,.11,1]);(function(n,e,t,i){return Bi(this,void 0,void 0,function*(){Q8();const r=yield sP({scenegraph:n,scenegraphNode:"VHF_Kidney_L_Low1"},undefined),s={},o=[];for(const a of r.scenes)fm(a,e=new qn(e||qn.IDENTITY),(l,c)=>{const u={"@id":l.name||l.id,"@type":"ProcessedNode",transformMatrix:new qn(c),geometry:"wireframe",node:l};if(o.push({"@id":`GLTF:${u["@id"]}`,"@type":"GLTFNode",scenegraph:n,scenegraphNode:u["@id"],transformMatrix:new qn(e||qn.IDENTITY),tooltip:l.name||l.id,color:[255,255,255,255],_lighting:"pbr",zoomBasedOpacity:!0,node:l}),l.mesh&&l.mesh.primitives&&l.mesh.primitives.length>0)for(const h of l.mesh.primitives)if(h.attributes.POSITION&&h.attributes.POSITION.min){const f=c.transformAsPoint(h.attributes.POSITION.min,[]),g=c.transformAsPoint(h.attributes.POSITION.max,[]);u.bbox=new pr({lowerBound:new ce(...f.map((m,v)=>Math.min(m,g[v]))),upperBound:new ce(...g.map((m,v)=>Math.max(m,f[v])))})}return s[u["@id"]]=u,!0});for(const a of Object.values(s).filter(l=>!l.bbox)){for(const l of e5(a.node).map(c=>s[c]).filter(c=>c.bbox))a.bbox?a.bbox.extend(l.bbox):a.bbox=l.bbox.clone();a.bbox||delete s[a["@id"]]}for(const a of Object.values(s)){const l=a.bbox.lowerBound,h=(a.size=a.bbox.upperBound.clone().vsub(l)).clone().vmul(new ce(.5,.5,.5)),f=a.center=l.clone().vadd(h);a.transformMatrix=new qn(qn.IDENTITY).translate(f.toArray()).scale(h.toArray())}for(const a of o)s[a["@id"]]=a;return s})})(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 qn(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 Ei([$f.ZP],n.prototype,"_onHover",null),Ei([$f.ZP],n.prototype,"_onClick",null),Ei([$f.ZP],n.prototype,"_onViewStateChange",null),Ei([$f.ZP],n.prototype,"_onDragStart",null),Ei([$f.ZP],n.prototype,"_onDrag",null),Ei([$f.ZP],n.prototype,"_onDragEnd",null),n})();class t5 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 Hve 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 n5(n,e,t,i,r=new Hve(n,t,i)){if(!r.closed)return e instanceof O?e.subscribe(r):Me(e)(r)}const i5={};function yc(...n){let e,t;return Te(n[n.length-1])&&(t=n.pop()),"function"==typeof n[n.length-1]&&(e=n.pop()),1===n.length&&k(n[0])&&(n=n[0]),In(n,t).lift(new r5(e))}class r5{constructor(e){this.resultSelector=e}call(e,t){return t.subscribe(new Gve(e,this.resultSelector))}}class Gve extends t5{constructor(e,t){super(e),this.resultSelector=t,this.active=0,this.values=[],this.observables=[]}_next(e){this.values.push(i5),this.observables.push(e)}_complete(){const e=this.observables,t=e.length;if(0===t)this.destination.complete();else{this.active=t,this.toRespond=t;for(let i=0;i(i&&i.providers||[]).some(s=>s&&s.provide&&"MockNgModuleResolver"===s.provide.name||!1))});let aP=(()=>{class n{constructor(){this.bootstrap$=new Df(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 lP=new Ht("INITIAL_STATE_TOKEN");let Kve=(()=>{class n{static set(t){this.value=t}static pop(){const t=this.value;return this.value={},t}}return n.value={},n})();const s5=new Ht("Internals.StateContextFactory"),o5=new Ht("Internals.StateFactory");function fb(...n){if(1===n.length){const e=n[0];if(k(e))return ES(e,null);if(Q(e)&&Object.getPrototypeOf(e)===Object.prototype){const t=Object.keys(e);return ES(t.map(i=>e[i]),t)}}if("function"==typeof n[n.length-1]){const e=n.pop();return ES(n=1===n.length&&k(n[0])?n[0]:n,null).pipe(me(t=>e(...t)))}return ES(n,null)}function ES(n,e){return new O(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]=u},error:u=>t.error(u),complete:()=>{s++,(s===i||!c)&&(o===i&&t.next(e?e.reduce((u,h,f)=>(u[h]=r[f],u),{}):r),t.complete())}}))}})}function Ki(n,e){return function(i){return i.lift(new Qve(n,e))}}class Qve{constructor(e,t){this.predicate=e,this.thisArg=t}call(e,t){return t.subscribe(new Zve(e,this.predicate,this.thisArg))}}class Zve 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 Wa(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(u){let h;s++,!r||a?(a=!1,r=new Df(n,e,i),h=r.subscribe(this),o=u.subscribe({next(f){r.next(f)},error(f){a=!0,r.error(f)},complete(){l=!0,o=void 0,r.complete()}}),l&&(o=void 0)):h=r.subscribe(this),this.add(()=>{s--,h.unsubscribe(),h=void 0,o&&!l&&t&&0===s&&(o.unsubscribe(),o=void 0,r=void 0)})}}(i))}const a5=(()=>{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 qr(n){return e=>0===n?b0():e.lift(new ewe(n))}class ewe{constructor(e){if(this.total=e,this.total<0)throw new a5}call(e,t){return t.subscribe(new twe(e,this.total))}}class twe 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 l5(n,e){return e?t=>t.pipe(l5((i,r)=>je(n(i,r)).pipe(me((s,o)=>e(i,s,r,o))))):t=>t.lift(new nwe(n))}class nwe{constructor(e){this.project=e}call(e,t){return t.subscribe(new iwe(e,this.project))}}class iwe extends we{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 _t(this),i=this.destination;i.add(t);const r=N(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 xS(n=null){return e=>e.lift(new rwe(n))}class rwe{constructor(e){this.defaultValue=e}call(e,t){return t.subscribe(new swe(e,this.defaultValue))}}class swe 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 bc(n){return function(t){const i=new owe(n),r=t.lift(i);return i.caught=r}}class owe{constructor(e){this.selector=e}call(e,t){return t.subscribe(new awe(e,this.selector,this.caught))}}class awe extends we{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 _t(this);this.add(i);const r=N(t,i);r!==i&&this.add(r)}}}function gr(n){return e=>e.lift(new lwe(n))}class lwe{constructor(e){this.notifier=e}call(e,t){const i=new cwe(e),r=N(this.notifier,new _t(i));return r&&!i.seenValue?(i.add(r),t.subscribe(i)):i}}class cwe extends we{constructor(e){super(e),this.seenValue=!1}notifyNext(){this.seenValue=!0,this.complete()}notifyComplete(){}}function bh(){}function cr(n,e,t){return function(r){return r.lift(new uwe(n,e,t))}}class uwe{constructor(e,t,i){this.nextOrObserver=e,this.error=t,this.complete=i}call(e,t){return t.subscribe(new dwe(e,this.nextOrObserver,this.error,this.complete))}}class dwe extends y{constructor(e,t,i,r){super(e),this._tapNext=bh,this._tapError=bh,this._tapComplete=bh,this._tapError=i||bh,this._tapComplete=r||bh,Y(t)?(this._context=this,this._tapNext=t):t&&(this._context=t,this._tapNext=t.next||bh,this._tapError=t.error||bh,this._tapComplete=t.complete||bh)}_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 ld(n,e){return t=>t.lift(new hwe(n,e))}class hwe{constructor(e,t){this.compare=e,this.keySelector=t}call(e,t){return t.subscribe(new fwe(e,this.compare,this.keySelector))}}class fwe 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 qa={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 c5=(()=>{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 pn.isInAngularZone()?t():this._ngZone.run(t)}runOutsideAngular(t){return pn.isInAngularZone()?this._ngZone.runOutsideAngular(t):t()}verifyZoneIsNotNooped(t){t instanceof pn||console.warn(qa.ZONE_WARNING())}}return n.\u0275fac=function(t){return new(t||n)(Ie(pn),Ie(Xc))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const u5=new Ht("ROOT_STATE_TOKEN"),d5=new Ht("FEATURE_STATE_TOKEN"),h5=new Ht("NGXS_PLUGINS"),f5=new Ht("NG_TEST_MODE"),p5=new Ht("NG_DEV_MODE"),cd="NGXS_META",g5="NGXS_OPTIONS_META",cP="NGXS_SELECTOR_META";let Wf=(()=>{class n{constructor(){this.defaultsState={},this.selectorOptions={injectContainerState:!0,suppressErrors:!0},this.compatibility={strictContentSecurityPolicy:!1},this.executionStrategy=c5}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();class pwe{constructor(e,t,i){this.previousValue=e,this.currentValue=t,this.firstChange=i}}const m5=new Ht("NGXS_EXECUTION_STRATEGY");function qf(n){return n.constructor&&n.constructor.type?n.constructor.type:n.type}const _5=(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},SS=(n,e)=>e.split(".").reduce((t,i)=>t&&t[i],n),uP=n=>n&&"object"==typeof n&&!Array.isArray(n),dP=(n,...e)=>{if(!e.length)return n;const t=e.shift();if(uP(n)&&uP(t))for(const i in t)uP(t[i])?(n[i]||Object.assign(n,{[i]:{}}),dP(n[i],t[i])):Object.assign(n,{[i]:t[i]});return dP(n,...e)};function hP(n){if(!n.hasOwnProperty(cd)){const e={name:null,actions:{},defaults:{},path:null,makeRootSelector:t=>t.getStateGetter(e.name),children:[]};Object.defineProperty(n,cd,{value:e})}return pb(n)}function pb(n){return n[cd]}function pP(n){return n[cP]}function y5(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(e[qf(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 Ki(t=>{const i=qf(t.action);return n[i]&&(!e||e[t.status])})}(i,r),t())}}(n,["DISPATCHED"])}function Cwe(){return me(n=>n.action)}function CS(n){return e=>new O(t=>e.subscribe({next(i){n.leave(()=>t.next(i))},error(i){n.leave(()=>t.error(i))},complete(){n.leave(()=>t.complete())}}))}let TS=(()=>{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(m5))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();class Mwe extends oe{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 AS=(()=>{class n extends Mwe{}return n.\u0275fac=function(){let e;return function(i){return(e||(e=zi(n)))(i||n)}}(),n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),Dwe=(()=>{class n extends O{constructor(t,i){super(r=>{const s=t.pipe(CS(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(AS),Ie(TS))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const v5=n=>(...e)=>n.shift()(...e,(...i)=>v5(n)(...i));let MS=(()=>{class n extends Fr{constructor(){super({})}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),gP=(()=>{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(h5,8))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),mP=(()=>{class n extends oe{}return n.\u0275fac=function(){let e;return function(i){return(e||(e=zi(n)))(i||n)}}(),n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),w5=(()=>{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(la),this._errorHandler.handleError(r)}catch(s){}})}),i.pipe(CS(this._ngxsExecutionStrategy))}dispatchByEvents(t){return Array.isArray(t)?0===t.length?sn(this._stateStream.getValue()):fb(t.map(i=>this.dispatchSingle(i))):this.dispatchSingle(t)}dispatchSingle(t){if(!qf(t))return Fg(new Error(`This action doesn't have a type property: ${t.constructor.name}`));const r=this._stateStream.getValue();return v5([...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(Wa())}getActionResultStream(t){return this._actionResults.pipe(Ki(i=>i.action===t&&"DISPATCHED"!==i.status),qr(1),Wa())}createDispatchObservable(t){return t.pipe(l5(i=>{switch(i.status){case"SUCCESSFUL":return sn(this._stateStream.getValue());case"ERRORED":return Fg(i.error);default:return Qc}})).pipe(Wa())}}return n.\u0275fac=function(t){return new(t||n)(Ie(Hn),Ie(AS),Ie(mP),Ie(gP),Ie(MS),Ie(TS))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const E5=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])&&E5(n[i])}),n};let x5=(()=>{class n{constructor(t,i){this.isDevMode=t,this.isTestMode=i}}return n.\u0275fac=function(t){return new(t||n)(Ie(p5),Ie(f5))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),S5=(()=>{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(qa.INCORRECT_PRODUCTION()):this.isIncorrectDevelopment&&console.warn(qa.INCORRECT_DEVELOPMENT()))}}return n.\u0275fac=function(t){return new(t||n)(Ie(x5),Ie(Wf))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),gm=(()=>{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=E5(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(MS),Ie(w5),Ie(Wf),Ie(S5))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),DS=(()=>{class n{constructor(t){this._internalStateOperations=t}createStateContext(t){const i=this._internalStateOperations.getRootStateOperations();function r(l){return SS(l,t.path)}function s(l,c){const u=_5(l,t.path,c),h=t.instance;if(h.ngxsOnChanges){const f=b5(t,{currentAppState:l,newAppState:u});h.ngxsOnChanges(f)}return i.setState(u),u}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(qa.PATCHING_ARRAY());if("object"!=typeof n)throw new Error(qa.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(gm))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();class IS{static stateNameErrorMessage(e){return qa.STATE_NAME(e)}static checkCorrectStateName(e){if(!e)throw new Error(qa.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(qa.STATE_UNIQUE(r,e.name,s.name));return r}static getValidStateMeta(e){const t=pb(e);if(!t)throw new Error(qa.STATE_DECORATOR());return t}}IS.stateNameRegex=new RegExp("^[a-zA-Z0-9_]+$");let mm=(()=>{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=wS(()=>{const c=this;function u(f){const g=c.statePaths[f];return g?y5(g.split("."),c._config):null}return this._parentFactory?this._parentFactory.getRuntimeSelectorContext():{getStateGetter(f){let g=u(f);return g||((...m)=>(g||(g=u(f)),g?g(...m):void 0))},getSelectorOptions:f=>Object.assign({},c._config.selectorOptions,f||{})}})}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(IS.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[cd].name};return n.reduce((t,i)=>{const{name:r,children:s}=i[cd];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[cd].name]=t,e),{})}(i),l=[];for(const c of s){const u=a[c],h=o[c],f=u[cd];this.addRuntimeInfoToMeta(f,h);const g={name:c,path:h,isInitialised:!1,actions:f.actions,instance:this._injector.get(u),defaults:n.cloneDefaults(f.defaults)};this.hasBeenMountedAndBootstrapped(c,h)||l.push(g),this.states.push(g)}return l}addAndReturnDefaults(t){const r=this.add(t||[]);return{defaults:r.reduce((o,a)=>_5(o,a.path,a.defaults),{}),states:r}}connectActionHandlers(){null===this._actionsSubscription&&(this._actionsSubscription=this._actions.pipe(Ki(t=>"DISPATCHED"===t.status),V(({action:t})=>this.invokeActions(this._actions,t).pipe(me(()=>({action:t,status:"SUCCESSFUL"})),xS({action:t,status:"CANCELED"}),bc(i=>sn({action:t,status:"ERRORED",error:i}))))).subscribe(t=>this._actionResults.next(t)))}invokeActions(t,i){const r=qf(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 u=o.instance[l.fn](c,i);u instanceof Promise&&(u=je(u)),u instanceof O?(u=u.pipe(xS({})),l.options.cancelUncompleted&&(u=u.pipe(gr(t.pipe(Ewe(i)))))):u=sn({}).pipe(Wa()),s.push(u)}catch(u){s.push(Fg(u))}}}return s.length||s.push(sn({})),fb(s)}addToStatesMap(t){const i=[],r=this.statesByName;for(const s of t){const o=IS.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!==SS(this._initialState,i);return this.statesByName[t]&&r}}return n.\u0275fac=function(t){return new(t||n)(Ie(Hn),Ie(Wf),Ie(n,12),Ie(AS),Ie(mP),Ie(DS),Ie(lP,8))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),_P=(()=>{class n{constructor(t,i,r){this.internalStateOperations=t,this.stateContextFactory=i,this.bootstrapper=r}ngxsBootstrap(t,i){this.internalStateOperations.getRootStateOperations().dispatch(t).pipe(Ki(()=>!!i),cr(()=>this.invokeInit(i.states)),V(()=>this.bootstrapper.appBootstrapped$),Ki(r=>!!r)).subscribe(()=>this.invokeBootstrap(i.states))}invokeInit(t){for(const i of t){const r=i.instance;if(r.ngxsOnChanges){const a=b5(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(gm),Ie(DS),Ie(aP))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const OS_getOptions=n=>n&&n.NGXS_SELECTOR_OPTIONS_META||{};function Owe(n,e,t){const i=t&&t.containerClass,s=wS(function(...c){const u=e.apply(i,c);return u instanceof Function?wS.apply(null,[u]):u});Object.setPrototypeOf(s,e);const o=function(n,e){const t=function(n){return n.hasOwnProperty(cP)||Object.defineProperty(n,cP,{value:{makeRootSelector:null,originalFn:null,containerClass:null,selectorName:null,getSelectorOptions:()=>({})}}),pP(n)}(n);t.originalFn=n;let i=()=>({});e&&(t.containerClass=e.containerClass,t.selectorName=e.selectorName,i=e.getSelectorOptions||i);const r=Object.assign({},t);return t.getSelectorOptions=()=>function(n,e){return Object.assign({},OS_getOptions(n.containerClass)||{},OS_getOptions(n.originalFn)||{},n.getSelectorOptions()||{},e)}(r,i()),t}(e,t);return o.makeRootSelector=l=>{const{argumentSelectorFunctions:c,selectorOptions:u}=function(n,e,t=[]){const i=e.getSelectorOptions(),r=n.getSelectorOptions(i);return{selectorOptions:r,argumentSelectorFunctions:function(n=[],e,t){const i=[];return t&&(0===n.length||e.injectContainerState)&&pb(t)&&i.push(t),n&&i.push(...n),i}(t,r,e.containerClass).map(a=>T5(a)(n))}}(l,o,n);return function(f){const g=c.map(m=>m(f));try{return s(...g)}catch(m){if(m instanceof TypeError&&u.suppressErrors)return;throw m}}},s}function T5(n){const e=pP(n)||pb(n);return e&&e.makeRootSelector||(()=>n)}let hu=(()=>{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),bc(r=>{const{suppressErrors:s}=this._config.selectorOptions;return r instanceof TypeError&&s?sn(void 0):Fg(r)}),ld(),CS(this._internalExecutionStrategy))}selectOnce(t){return this.select(t).pipe(qr(1))}selectSnapshot(t){return this.getStoreBoundSelectorFn(t)(this._stateStream.getValue())}subscribe(t){return this._stateStream.pipe(CS(this._internalExecutionStrategy)).subscribe(t)}snapshot(){return this._internalStateOperations.getRootStateOperations().getState()}reset(t){return this._internalStateOperations.getRootStateOperations().setState(t)}getStoreBoundSelectorFn(t){return T5(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(MS),Ie(gm),Ie(Wf),Ie(TS),Ie(mm),Ie(lP,8))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),gb=(()=>{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(hu),Ie(Wf))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n.store=null,n.config=null,n})();class Fwe{static get type(){return"@@INIT"}}class Lwe{constructor(e){this.addedStates=e}static get type(){return"@@UPDATE_STATE"}}const RS=new Df(1);let Vwe=(()=>{class n{constructor(t,i,r,s,o=[],a){!function(){try{const n=window.ng,t=!(n.probe&&n.coreTokens)&&fa();RS.next(t)}catch(n){RS.next(!1)}finally{RS.complete()}}();const l=t.addAndReturnDefaults(o);i.setStateToTheCurrentWithNew(l),t.connectActionHandlers(),a.ngxsBootstrap(new Fwe,l)}}return n.\u0275fac=function(t){return new(t||n)(Ie(mm),Ie(gm),Ie(hu),Ie(gb),Ie(u5,8),Ie(_P))},n.\u0275mod=tn({type:n}),n.\u0275inj=St({}),n})(),jwe=(()=>{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 Lwe(l.defaults),l))}static flattenStates(t=[]){return t.reduce((i,r)=>i.concat(r),[])}}return n.\u0275fac=function(t){return new(t||n)(Ie(hu),Ie(gm),Ie(mm),Ie(d5,8),Ie(_P))},n.\u0275mod=tn({type:n}),n.\u0275inj=St({}),n})();class Yo{static forRoot(e=[],t={}){return{ngModule:Vwe,providers:[mm,DS,Dwe,AS,aP,S5,x5,_P,w5,mP,gm,TS,hu,MS,gb,gP,...e,...Yo.ngxsTokenProviders(e,t)]}}static forFeature(e=[]){return{ngModule:jwe,providers:[mm,gP,...e,{provide:d5,multi:!0,useValue:e}]}}static ngxsTokenProviders(e,t){return[{provide:f5,useValue:Xve},{provide:p5,useValue:fa},{provide:m5,useClass:t.executionStrategy||c5},{provide:u5,useValue:e},{provide:Yo.ROOT_OPTIONS,useValue:t},{provide:Wf,useFactory:Yo.ngxsConfigFactory,deps:[Yo.ROOT_OPTIONS]},{provide:IE,useFactory:Yo.appBootstrapListenerFactory,multi:!0,deps:[aP]},{provide:lP,useFactory:Yo.getInitialState},{provide:s5,useExisting:DS},{provide:o5,useExisting:mm}]}static ngxsConfigFactory(e){return dP(new Wf,e)}static appBootstrapListenerFactory(e){return()=>e.bootstrap()}static getInitialState(){return Kve.pop()}}function yP(n,e){return(t,i)=>{if(t.hasOwnProperty("prototype"))throw new Error(qa.ACTION_DECORATOR());const s=hP(t.constructor);Array.isArray(n)||(n=[n]);for(const o of n){const a=o.type;s.actions[a]||(s.actions[a]=[]),s.actions[a].push({fn:i,options:e||{},type:a})}}}function A5(n){return i=>{!function(n){RS.subscribe(e=>{e&&(n.\u0275prov||console.warn(qa.UNDECORATED_STATE_IN_IVY(n.name)))})}(i);const r=i,s=hP(r),o=Object.getPrototypeOf(r),a=function(i){return Object.assign({},i[g5]||{},n)}(o);(function(i){const{meta:r,inheritedStateClass:s,optionsWithInheritance:o}=i,{children:a,defaults:l,name:c}=o,u="string"==typeof c?c:c&&c.getName()||null;IS.checkCorrectStateName(u),s.hasOwnProperty(cd)&&(r.actions=Object.assign({},r.actions,(s[cd]||{}).actions)),r.children=a,r.defaults=l,r.name=u})({meta:s,inheritedStateClass:o,optionsWithInheritance:a}),r[g5]=a}}function PS(n,...e){return function(t,i){const r=i.toString(),s=`__${r}__selector`,o=function(n,e,t=[]){return"string"==typeof(e=e||function(n){const e=n.length-1;return 36===n.charCodeAt(e)?n.slice(0,e):n}(n))?y5(t.length?[e,...t]:e.split("."),gb.config):e}(r,n,e);Object.defineProperties(t,{[s]:{writable:!0,enumerable:!1,configurable:!0},[r]:{enumerable:!0,configurable:!0,get(){return this[s]||(this[s]=function(n){if(!gb.store)throw new Error(qa.SELECT_FACTORY_NOT_CONNECTED());return gb.store.select(n)}(o))}}})}}function _m(n){return(e,t,i)=>{if(!i||null===i.value)throw new Error(qa.SELECTOR_DECORATOR());const s=i.value,o=Owe(n,s,{containerClass:e,selectorName:t.toString(),getSelectorOptions:()=>({})}),a={configurable:!0,get:()=>o};return a.originalFn=s,a}}Yo.\u0275fac=function(e){return new(e||Yo)},Yo.\u0275mod=tn({type:Yo}),Yo.\u0275inj=St({}),Yo.ROOT_OPTIONS=new Ht("ROOT_OPTIONS");const Xo=new Ht("NgValueAccessor");function Dl(n,...e){return e.length?e.some(t=>n[t]):n.altKey||n.shiftKey||n.ctrlKey||n.metaKey}const qS=new cc(sx);class YEe{constructor(e,t){this.dueTime=e,this.scheduler=t}call(e,t){return t.subscribe(new XEe(e,this.dueTime,this.scheduler))}}class XEe 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(KEe,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 KEe(n){n.debouncedNext()}class QEe{constructor(e){this.total=e}call(e,t){return t.subscribe(new ZEe(e,this.total))}}class ZEe extends y{constructor(e,t){super(e),this.total=t,this.count=0}_next(e){++this.count>this.total&&this.destination.next(e)}}function bi(n){return null!=n&&"false"!=`${n}`}function Ya(n,e=0){return function(n){return!isNaN(parseFloat(n))&&!isNaN(Number(n))}(n)?Number(n):e}function YS(n){return Array.isArray(n)?n:[n]}function bs(n){return null==n?"":"string"==typeof n?n:`${n}px`}function dd(n){return n instanceof gn?n.nativeElement:n}let zP;try{zP="undefined"!=typeof Intl&&Intl.v8BreakIterator}catch(n){zP=!1}let Cb,Xf,HP,Qi=(()=>{class n{constructor(t){this._platformId=t,this.isBrowser=this._platformId?Af(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&&!zP)&&"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(Xc))},n.\u0275prov=We({factory:function(){return new n(Ie(Xc))},token:n,providedIn:"root"}),n})(),Sb=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=tn({type:n}),n.\u0275inj=St({}),n})();function vm(n){return function(){if(null==Cb&&"undefined"!=typeof window)try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:()=>Cb=!0}))}finally{Cb=Cb||!1}return Cb}()?n:!!n.capture}function F6(){if(null==Xf){if("object"!=typeof document||!document||"function"!=typeof Element||!Element)return Xf=!1,Xf;if("scrollBehavior"in document.documentElement.style)Xf=!0;else{const n=Element.prototype.scrollTo;Xf=!!n&&!/\{\s*\[native code\]\s*\}/.test(n.toString())}}return Xf}function KS(){let n="undefined"!=typeof document&&document?document.activeElement:null;for(;n&&n.shadowRoot;){const e=n.shadowRoot.activeElement;if(e===n)break;n=e}return n}function Kf(n){return n.composedPath?n.composedPath()[0]:n.target}let GP=(()=>{class n{create(t){return"undefined"==typeof MutationObserver?null:new MutationObserver(t)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({factory:function(){return new n},token:n,providedIn:"root"}),n})(),L6=(()=>{class n{constructor(t){this._mutationObserverFactory=t,this._observedElements=new Map}ngOnDestroy(){this._observedElements.forEach((t,i)=>this._cleanupObserver(i))}observe(t){const i=dd(t);return new O(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 oe,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(GP))},n.\u0275prov=We({factory:function(){return new n(Ie(GP))},token:n,providedIn:"root"}),n})(),$P=(()=>{class n{constructor(t,i,r){this._contentObserver=t,this._elementRef=i,this._ngZone=r,this.event=new ln,this._disabled=!1,this._currentSubscription=null}get disabled(){return this._disabled}set disabled(t){this._disabled=bi(t),this._disabled?this._unsubscribe():this._subscribe()}get debounce(){return this._debounce}set debounce(t){this._debounce=Ya(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=qS){return t=>t.lift(new YEe(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)(Ce(L6),Ce(gn),Ce(pn))},n.\u0275dir=Nt({type:n,selectors:[["","cdkObserveContent",""]],inputs:{disabled:["cdkObserveContentDisabled","disabled"],debounce:"debounce"},outputs:{event:"cdkObserveContent"},exportAs:["cdkObserveContent"]}),n})(),QS=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=tn({type:n}),n.\u0275inj=St({providers:[GP]}),n})(),$6=(()=>{class n{constructor(t){this._platform=t}isDisabled(t){return t.hasAttribute("disabled")}isVisible(t){return function(n){return!!(n.offsetWidth||n.offsetHeight||"function"==typeof n.getClientRects&&n.getClientRects().length)}(t)&&"visible"===getComputedStyle(t).visibility}isTabbable(t){if(!this._platform.isBrowser)return!1;const i=function(n){try{return n.frameElement}catch(e){return null}}(function(n){return n.ownerDocument&&n.ownerDocument.defaultView||window}(t));if(i&&(-1===q6(i)||!this.isVisible(i)))return!1;let r=t.nodeName.toLowerCase(),s=q6(t);return t.hasAttribute("contenteditable")?-1!==s:!("iframe"===r||"object"===r||this._platform.WEBKIT&&this._platform.IOS&&!function(n){let e=n.nodeName.toLowerCase(),t="input"===e&&n.type;return"text"===t||"password"===t||"select"===e||"textarea"===e}(t))&&("audio"===r?!!t.hasAttribute("controls")&&-1!==s:"video"===r?-1!==s&&(null!==s||this._platform.FIREFOX||t.hasAttribute("controls")):t.tabIndex>=0)}isFocusable(t,i){return function(n){return!function(n){return function(n){return"input"==n.nodeName.toLowerCase()}(n)&&"hidden"==n.type}(n)&&(function(n){let e=n.nodeName.toLowerCase();return"input"===e||"select"===e||"button"===e||"textarea"===e}(n)||function(n){return function(n){return"a"==n.nodeName.toLowerCase()}(n)&&n.hasAttribute("href")}(n)||n.hasAttribute("contenteditable")||W6(n))}(t)&&!this.isDisabled(t)&&((null==i?void 0:i.ignoreVisibility)||this.isVisible(t))}}return n.\u0275fac=function(t){return new(t||n)(Ie(Qi))},n.\u0275prov=We({factory:function(){return new n(Ie(Qi))},token:n,providedIn:"root"}),n})();function W6(n){if(!n.hasAttribute("tabindex")||void 0===n.tabIndex)return!1;let e=n.getAttribute("tabindex");return"-32768"!=e&&!(!e||isNaN(parseInt(e,10)))}function q6(n){if(!W6(n))return null;const e=parseInt(n.getAttribute("tabindex")||"",10);return isNaN(e)?-1:e}class yxe{constructor(e,t,i,r,s=!1){this._element=e,this._checker=t,this._ngZone=i,this._document=r,this._hasAttached=!1,this.startAnchorListener=()=>this.focusLastTabbableElement(),this.endAnchorListener=()=>this.focusFirstTabbableElement(),this._enabled=!0,s||this.attachAnchors()}get enabled(){return this._enabled}set enabled(e){this._enabled=e,this._startAnchor&&this._endAnchor&&(this._toggleAnchorTabIndex(e,this._startAnchor),this._toggleAnchorTabIndex(e,this._endAnchor))}destroy(){const 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}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(e){return new Promise(t=>{this._executeOnStable(()=>t(this.focusInitialElement(e)))})}focusFirstTabbableElementWhenReady(e){return new Promise(t=>{this._executeOnStable(()=>t(this.focusFirstTabbableElement(e)))})}focusLastTabbableElementWhenReady(e){return new Promise(t=>{this._executeOnStable(()=>t(this.focusLastTabbableElement(e)))})}_getRegionBoundary(e){let t=this._element.querySelectorAll(`[cdk-focus-region-${e}], [cdkFocusRegion${e}], [cdk-focus-${e}]`);for(let i=0;i=0;i--){let r=t[i].nodeType===this._document.ELEMENT_NODE?this._getLastTabbableElement(t[i]):null;if(r)return r}return null}_createAnchor(){const 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}_toggleAnchorTabIndex(e,t){e?t.setAttribute("tabindex","0"):t.removeAttribute("tabindex")}toggleAnchors(e){this._startAnchor&&this._endAnchor&&(this._toggleAnchorTabIndex(e,this._startAnchor),this._toggleAnchorTabIndex(e,this._endAnchor))}_executeOnStable(e){this._ngZone.isStable?e():this._ngZone.onStable.pipe(qr(1)).subscribe(e)}}let Y6=(()=>{class n{constructor(t,i,r){this._checker=t,this._ngZone=i,this._document=r}create(t,i=!1){return new yxe(t,this._checker,this._ngZone,this._document,i)}}return n.\u0275fac=function(t){return new(t||n)(Ie($6),Ie(pn),Ie(fn))},n.\u0275prov=We({factory:function(){return new n(Ie($6),Ie(pn),Ie(fn))},token:n,providedIn:"root"}),n})();function X6(n){return 0===n.offsetX&&0===n.offsetY}function K6(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 Q6=new Ht("cdk-input-modality-detector-options"),xxe={ignoreKeys:[18,17,224,91,16]},wm=vm({passive:!0,capture:!0});let J6=(()=>{class n{constructor(t,i,r,s){this._platform=t,this._mostRecentTarget=null,this._modality=new Fr(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=Kf(o))},this._onMousedown=o=>{Date.now()-this._lastTouchMs<650||(this._modality.next(X6(o)?"keyboard":"mouse"),this._mostRecentTarget=Kf(o))},this._onTouchstart=o=>{K6(o)?this._modality.next("keyboard"):(this._lastTouchMs=Date.now(),this._modality.next("touch"),this._mostRecentTarget=Kf(o))},this._options=Object.assign(Object.assign({},xxe),s),this.modalityDetected=this._modality.pipe(function(n){return e=>e.lift(new QEe(n))}(1)),this.modalityChanged=this.modalityDetected.pipe(ld()),t.isBrowser&&i.runOutsideAngular(()=>{r.addEventListener("keydown",this._onKeydown,wm),r.addEventListener("mousedown",this._onMousedown,wm),r.addEventListener("touchstart",this._onTouchstart,wm)})}get mostRecentModality(){return this._modality.value}ngOnDestroy(){!this._platform.isBrowser||(document.removeEventListener("keydown",this._onKeydown,wm),document.removeEventListener("mousedown",this._onMousedown,wm),document.removeEventListener("touchstart",this._onTouchstart,wm))}}return n.\u0275fac=function(t){return new(t||n)(Ie(Qi),Ie(pn),Ie(fn),Ie(Q6,8))},n.\u0275prov=We({factory:function(){return new n(Ie(Qi),Ie(pn),Ie(fn),Ie(Q6,8))},token:n,providedIn:"root"}),n})();const nG=new Ht("cdk-focus-monitor-default-options"),eC=vm({passive:!0,capture:!0});let vc=(()=>{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 oe,this._rootNodeFocusAndBlurListener=a=>{const l=Kf(a),c="focus"===a.type?this._onFocus:this._onBlur;for(let u=l;u;u=u.parentElement)c.call(this,a,u)},this._document=s,this._detectionMode=(null==o?void 0:o.detectionMode)||0}monitor(t,i=!1){const r=dd(t);if(!this._platform.isBrowser||1!==r.nodeType)return sn(null);const s=function(n){if(function(){if(null==HP){const n="undefined"!=typeof document?document.head:null;HP=!(!n||!n.createShadowRoot&&!n.attachShadow)}return HP}()){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 oe,rootNode:s};return this._elementInfo.set(r,a),this._registerGlobalListeners(a),a.subject}stopMonitoring(t){const i=dd(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=dd(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=Kf(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,eC),i.addEventListener("blur",this._rootNodeFocusAndBlurListener,eC)}),this._rootNodeFocusListenerCount.set(i,r+1),1==++this._monitoredElementCount&&(this._ngZone.runOutsideAngular(()=>{this._getWindow().addEventListener("focus",this._windowFocusListener)}),this._inputModalityDetector.modalityDetected.pipe(gr(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,eC),i.removeEventListener("blur",this._rootNodeFocusAndBlurListener,eC),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(pn),Ie(Qi),Ie(J6),Ie(fn,8),Ie(nG,8))},n.\u0275prov=We({factory:function(){return new n(Ie(pn),Ie(Qi),Ie(J6),Ie(fn,8),Ie(nG,8))},token:n,providedIn:"root"}),n})();const iG="cdk-high-contrast-black-on-white",rG="cdk-high-contrast-white-on-black",qP="cdk-high-contrast-active";let sG=(()=>{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(qP),t.remove(iG),t.remove(rG),this._hasCheckedHighContrastMode=!0;const i=this.getHighContrastMode();1===i?(t.add(qP),t.add(iG)):2===i&&(t.add(qP),t.add(rG))}}}return n.\u0275fac=function(t){return new(t||n)(Ie(Qi),Ie(fn))},n.\u0275prov=We({factory:function(){return new n(Ie(Qi),Ie(fn))},token:n,providedIn:"root"}),n})();const oG=new Ht("cdk-dir-doc",{providedIn:"root",factory:function(){return Bc(fn)}});let Il=(()=>{class n{constructor(t){if(this.value="ltr",this.change=new ln,t){const r=t.documentElement?t.documentElement.dir:null,s=(t.body?t.body.dir:null)||r;this.value="ltr"===s||"rtl"===s?s:"ltr"}}ngOnDestroy(){this.change.complete()}}return n.\u0275fac=function(t){return new(t||n)(Ie(oG,8))},n.\u0275prov=We({factory:function(){return new n(Ie(oG,8))},token:n,providedIn:"root"}),n})(),Ab=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=tn({type:n}),n.\u0275inj=St({}),n})();const aG=new Hu("12.2.5");function tC(...n){return kt(1)(sn(...n))}function Oo(...n){const e=n[n.length-1];return Te(e)?(n.pop(),t=>tC(n,t,e)):t=>tC(n,t)}function Em(n,e){return{type:7,name:n,definitions:e,options:{}}}function fd(n,e=null){return{type:4,styles:e,timings:n}}function ds(n){return{type:6,styles:n,offset:null}}function wc(n,e,t){return{type:0,name:n,styles:e,options:t}}function pd(n,e,t=null){return{type:1,expr:n,animation:e,options:t}}function uG(n){Promise.resolve(null).then(n)}class xm{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(){uG(()=>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 hG(){return"undefined"!=typeof window&&void 0!==window.document}function XP(){return"undefined"!=typeof process&&"[object process]"==={}.toString.call(process)}let JP=(n,e)=>!1,eN=(n,e)=>!1,gG=(n,e,t)=>[];const mG=XP();(mG||"undefined"!=typeof Element)&&(JP=hG()?(n,e)=>{for(;e&&e!==document.documentElement;){if(e===n)return!0;e=e.parentNode||e.host}return!1}:(n,e)=>n.contains(e),eN=(()=>{if(mG||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]):eN}})(),gG=(n,e,t)=>{let i=[];if(t){const r=n.querySelectorAll(e);for(let s=0;s{class n{validateStyleProperty(t){return tN(t)}matchesElement(t,i){return nN(t,i)}containsElement(t,i){return iN(t,i)}query(t,i,r){return rN(t,i,r)}computeStyle(t,i,r){return r||""}animate(t,i,r,s,o,a=[],l){return new xm(r,s)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();class nC{}nC.NOOP=new bG;function xG(n,e,t){return t?e+":"+t+";":""}function SG(n){let e="";for(let t=0;t{const r=cN(i);t&&!t.hasOwnProperty(i)&&(t[i]=n.style[r]),n.style[r]=e[i]}),XP()&&SG(n))}function Jf(n,e){n.style&&(Object.keys(e).forEach(t=>{const i=cN(t);n.style[i]=""}),XP()&&SG(n))}const Lxe=/-+([a-z0-9])/g;function cN(n){return n.replace(Lxe,(...e)=>e[1].toUpperCase())}function Bxe(n){return n.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}class Tm{constructor(e,t,i){this._element=e,this._startStyles=t,this._endStyles=i,this._state=0;let r=Tm.initialStylesByElement.get(e);r||Tm.initialStylesByElement.set(e,r={}),this._initialStyles=r}start(){this._state<1&&(this._startStyles&&pu(this._element,this._startStyles,this._initialStyles),this._state=1)}finish(){this.start(),this._state<2&&(pu(this._element,this._initialStyles),this._endStyles&&(pu(this._element,this._endStyles),this._endStyles=null),this._state=1)}destroy(){this.finish(),this._state<3&&(Tm.initialStylesByElement.delete(this._element),this._startStyles&&(Jf(this._element,this._startStyles),this._endStyles=null),this._endStyles&&(Jf(this._element,this._endStyles),this._endStyles=null),pu(this._element,this._initialStyles),this._state=3)}}Tm.initialStylesByElement=new WeakMap;const Qa=new Ht("AnimationModuleType"),l$=new Hu("12.2.5"),sCe=new Ht("mat-sanity-checks",{providedIn:"root",factory:function(){return!0}});let tp,ji=(()=>{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!(!fa()||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")&&l$.full!==aG.full&&console.warn("The Angular Material version ("+l$.full+") does not match the Angular CDK version ("+aG.full+").\nPlease ensure the versions of these two packages exactly match.")}}return n.\u0275fac=function(t){return new(t||n)(Ie(sG),Ie(sCe,8),Ie(fn))},n.\u0275mod=tn({type:n}),n.\u0275inj=St({imports:[[Ab],Ab]}),n})();function Am(n){return class extends n{constructor(...e){super(...e),this._disabled=!1}get disabled(){return this._disabled}set disabled(e){this._disabled=bi(e)}}}function Mm(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 Ch(n){return class extends n{constructor(...e){super(...e),this._disableRipple=!1}get disableRipple(){return this._disableRipple}set disableRipple(e){this._disableRipple=bi(e)}}}function wC(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?Ya(t):this.defaultTabIndex}}}try{tp="undefined"!=typeof Intl}catch(n){tp=!1}class yCe{constructor(e,t,i){this._renderer=e,this.element=t,this.config=i,this.state=3}fadeOut(){this._renderer.fadeOutRipple(this)}}const p$={enterDuration:225,exitDuration:150},SN=vm({passive:!0}),g$=["mousedown","touchstart"],m$=["mouseup","mouseleave","touchend","touchcancel"];class vCe{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=dd(i))}fadeInRipple(e,t,i={}){const r=this._containerRect=this._containerRect||this._containerElement.getBoundingClientRect(),s=Object.assign(Object.assign({},p$),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,u=document.createElement("div");u.classList.add("mat-ripple-element"),u.style.left=a-o+"px",u.style.top=l-o+"px",u.style.height=2*o+"px",u.style.width=2*o+"px",null!=i.color&&(u.style.backgroundColor=i.color),u.style.transitionDuration=`${c}ms`,this._containerElement.appendChild(u),function(n){window.getComputedStyle(n).getPropertyValue("opacity")}(u),u.style.transform="scale(1)";const h=new yCe(this,u,i);return h.state=0,this._activeRipples.add(h),i.persistent||(this._mostRecentTransientRipple=h),this._runTimeoutOutsideZone(()=>{const f=h===this._mostRecentTransientRipple;h.state=1,!i.persistent&&(!f||!this._isPointerDown)&&h.fadeOut()},c),h}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({},p$),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=dd(e);!t||t===this._triggerElement||(this._removeTriggerEvents(),this._triggerElement=t,this._registerEvents(g$))}handleEvent(e){"mousedown"===e.type?this._onMousedown(e):"touchstart"===e.type?this._onTouchStart(e):this._onPointerUp(),this._pointerUpEventsRegistered||(this._registerEvents(m$),this._pointerUpEventsRegistered=!0)}_onMousedown(e){const t=X6(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,SN)})})}_removeTriggerEvents(){this._triggerElement&&(g$.forEach(e=>{this._triggerElement.removeEventListener(e,this,SN)}),this._pointerUpEventsRegistered&&m$.forEach(e=>{this._triggerElement.removeEventListener(e,this,SN)}))}}const xCe=new Ht("mat-ripple-global-options");let gu=(()=>{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 vCe(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)(Ce(gn),Ce(pn),Ce(Qi),Ce(xCe,8),Ce(Qa,8))},n.\u0275dir=Nt({type:n,selectors:[["","mat-ripple",""],["","matRipple",""]],hostAttrs:[1,"mat-ripple"],hostVars:2,hostBindings:function(t,i){2&t&&ai("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})(),Dm=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=tn({type:n}),n.\u0275inj=St({imports:[[ji,Sb],ji]}),n})();function gd(n,e,t,i){return Y(t)&&(i=t,t=void 0),i?gd(n,e,t).pipe(me(r=>k(r)?i(...r):i(r))):new O(r=>{E$(n,e,function(o){r.next(arguments.length>1?Array.prototype.slice.call(arguments):o)},r,t)})}function E$(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;o0?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 FCe=1;const LCe=Promise.resolve(),SC={};function x$(n){return n in SC&&(delete SC[n],!0)}const S$={setImmediate(n){const e=FCe++;return SC[e]=!0,LCe.then(()=>x$(e)&&n()),e},clearImmediate(n){x$(n)}};new class extends cc{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=S$.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&&(S$.clearImmediate(t),e.scheduled=void 0)}});function Im(n){return!!n&&(n instanceof O||"function"==typeof n.lift&&"function"==typeof n.subscribe)}class zCe{constructor(e){this.durationSelector=e}call(e,t){return t.subscribe(new HCe(e,this.durationSelector))}}class HCe extends we{constructor(e,t){super(e),this.durationSelector=t,this.hasValue=!1}_next(e){if(this.value=e,this.hasValue=!0,!this.throttled){let t;try{const{durationSelector:r}=this;t=r(e)}catch(r){return this.destination.error(r)}const i=N(t,new _t(this));!i||i.closed?this.clearThrottle():this.add(this.throttled=i)}}clearThrottle(){const{value:e,hasValue:t,throttled:i}=this;i&&(this.remove(i),this.throttled=void 0,i.unsubscribe()),t&&(this.value=void 0,this.hasValue=!1,this.destination.next(e))}notifyNext(){this.clearThrottle()}notifyComplete(){this.clearThrottle()}}function C$(n){return!k(n)&&n-parseFloat(n)+1>=0}function $Ce(n){const{index:e,period:t,subscriber:i}=n;if(i.next(e),!i.closed){if(-1===t)return i.complete();n.index=e+1,this.schedule(n,t)}}function CC(n,e=qS){return function(n){return function(t){return t.lift(new zCe(n))}}(()=>function(n=0,e,t){let i=-1;return C$(e)?i=Number(e)<1?1:Number(e):Te(e)&&(t=e),Te(t)||(t=qS),new O(r=>{const s=C$(n)?n:+n-t.now();return t.schedule($Ce,s,{index:0,period:i,subscriber:r})})}(n,e))}let A$=(()=>{class n{constructor(){this._listeners=[]}notify(t,i){for(let r of this._listeners)r(t,i)}listen(t){return this._listeners.push(t),()=>{this._listeners=this._listeners.filter(i=>t!==i)}}ngOnDestroy(){this._listeners=[]}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({factory:function(){return new n},token:n,providedIn:"root"}),n})(),Om=(()=>{class n{constructor(t,i,r){this._ngZone=t,this._platform=i,this._scrolled=new oe,this._globalSubscription=null,this._scrolledCount=0,this.scrollContainers=new Map,this._document=r}register(t){this.scrollContainers.has(t)||this.scrollContainers.set(t,t.elementScrolled().subscribe(()=>this._scrolled.next(t)))}deregister(t){const i=this.scrollContainers.get(t);i&&(i.unsubscribe(),this.scrollContainers.delete(t))}scrolled(t=20){return this._platform.isBrowser?new O(i=>{this._globalSubscription||this._addGlobalListener();const r=t>0?this._scrolled.pipe(CC(t)).subscribe(i):this._scrolled.subscribe(i);return this._scrolledCount++,()=>{r.unsubscribe(),this._scrolledCount--,this._scrolledCount||this._removeGlobalListener()}}):sn()}ngOnDestroy(){this._removeGlobalListener(),this.scrollContainers.forEach((t,i)=>this.deregister(i)),this._scrolled.complete()}ancestorScrolled(t,i){const r=this.getAncestorScrollContainers(t);return this.scrolled(i).pipe(Ki(s=>!s||r.indexOf(s)>-1))}getAncestorScrollContainers(t){const i=[];return this.scrollContainers.forEach((r,s)=>{this._scrollableContainsElement(s,t)&&i.push(s)}),i}_getWindow(){return this._document.defaultView||window}_scrollableContainsElement(t,i){let r=dd(i),s=t.getElementRef().nativeElement;do{if(r==s)return!0}while(r=r.parentElement);return!1}_addGlobalListener(){this._globalSubscription=this._ngZone.runOutsideAngular(()=>gd(this._getWindow().document,"scroll").subscribe(()=>this._scrolled.next()))}_removeGlobalListener(){this._globalSubscription&&(this._globalSubscription.unsubscribe(),this._globalSubscription=null)}}return n.\u0275fac=function(t){return new(t||n)(Ie(pn),Ie(Qi),Ie(fn,8))},n.\u0275prov=We({factory:function(){return new n(Ie(pn),Ie(Qi),Ie(fn,8))},token:n,providedIn:"root"}),n})(),Rm=(()=>{class n{constructor(t,i,r){this._platform=t,this._change=new oe,this._changeListener=s=>{this._change.next(s)},this._document=r,i.runOutsideAngular(()=>{if(t.isBrowser){const s=this._getWindow();s.addEventListener("resize",this._changeListener),s.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:i,height:r}=this.getViewportSize();return{top:t.top,left:t.left,bottom:t.top+r,right:t.left+i,height:r,width:i}}getViewportScrollPosition(){if(!this._platform.isBrowser)return{top:0,left:0};const t=this._document,i=this._getWindow(),r=t.documentElement,s=r.getBoundingClientRect();return{top:-s.top||t.body.scrollTop||i.scrollY||r.scrollTop||0,left:-s.left||t.body.scrollLeft||i.scrollX||r.scrollLeft||0}}change(t=20){return t>0?this._change.pipe(CC(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 n.\u0275fac=function(t){return new(t||n)(Ie(Qi),Ie(pn),Ie(fn,8))},n.\u0275prov=We({factory:function(){return new n(Ie(Qi),Ie(pn),Ie(fn,8))},token:n,providedIn:"root"}),n})();class MN{attach(e){return this._attachedHost=e,e.attach(this)}detach(){let e=this._attachedHost;null!=e&&(this._attachedHost=null,e.detach())}get isAttached(){return null!=this._attachedHost}setAttachedHost(e){this._attachedHost=e}}class AC extends MN{constructor(e,t,i,r){super(),this.component=e,this.viewContainerRef=t,this.injector=i,this.componentFactoryResolver=r}}class Pm extends MN{constructor(e,t,i){super(),this.templateRef=e,this.viewContainerRef=t,this.context=i}get origin(){return this.templateRef.elementRef}attach(e,t=this.context){return this.context=t,super.attach(e)}detach(){return this.context=void 0,super.detach()}}class l1e extends MN{constructor(e){super(),this.element=e instanceof gn?e.nativeElement:e}}class MC{constructor(){this._isDisposed=!1,this.attachDomPortal=null}hasAttached(){return!!this._attachedPortal}attach(e){return e instanceof AC?(this._attachedPortal=e,this.attachComponentPortal(e)):e instanceof Pm?(this._attachedPortal=e,this.attachTemplatePortal(e)):this.attachDomPortal&&e instanceof l1e?(this._attachedPortal=e,this.attachDomPortal(e)):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(e){this._disposeFn=e}_invokeDisposeFn(){this._disposeFn&&(this._disposeFn(),this._disposeFn=null)}}class c1e extends MC{constructor(e,t,i,r,s){super(),this.outletElement=e,this._componentFactoryResolver=t,this._appRef=i,this._defaultInjector=r,this.attachDomPortal=o=>{const a=o.element,l=this._document.createComment("dom-portal");a.parentNode.insertBefore(l,a),this.outletElement.appendChild(a),this._attachedPortal=o,super.setDisposeFn(()=>{l.parentNode&&l.parentNode.replaceChild(a,l)})},this._document=s}attachComponentPortal(e){const i=(e.componentFactoryResolver||this._componentFactoryResolver).resolveComponentFactory(e.component);let r;return e.viewContainerRef?(r=e.viewContainerRef.createComponent(i,e.viewContainerRef.length,e.injector||e.viewContainerRef.injector),this.setDisposeFn(()=>r.destroy())):(r=i.create(e.injector||this._defaultInjector),this._appRef.attachView(r.hostView),this.setDisposeFn(()=>{this._appRef.detachView(r.hostView),r.destroy()})),this.outletElement.appendChild(this._getComponentRootNode(r)),this._attachedPortal=e,r}attachTemplatePortal(e){let t=e.viewContainerRef,i=t.createEmbeddedView(e.templateRef,e.context);return i.rootNodes.forEach(r=>this.outletElement.appendChild(r)),i.detectChanges(),this.setDisposeFn(()=>{let r=t.indexOf(i);-1!==r&&t.remove(r)}),this._attachedPortal=e,i}dispose(){super.dispose(),null!=this.outletElement.parentNode&&this.outletElement.parentNode.removeChild(this.outletElement)}_getComponentRootNode(e){return e.hostView.rootNodes[0]}}let np=(()=>{class n extends MC{constructor(t,i,r){super(),this._componentFactoryResolver=t,this._viewContainerRef=i,this._isInitialized=!1,this.attached=new ln,this.attachDomPortal=s=>{const o=s.element,a=this._document.createComment("dom-portal");s.setAttachedHost(this),o.parentNode.insertBefore(a,o),this._getRootNode().appendChild(o),this._attachedPortal=s,super.setDisposeFn(()=>{a.parentNode&&a.parentNode.replaceChild(o,a)})},this._document=r}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 i=null!=t.viewContainerRef?t.viewContainerRef:this._viewContainerRef,s=(t.componentFactoryResolver||this._componentFactoryResolver).resolveComponentFactory(t.component),o=i.createComponent(s,i.length,t.injector||i.injector);return i!==this._viewContainerRef&&this._getRootNode().appendChild(o.hostView.rootNodes[0]),super.setDisposeFn(()=>o.destroy()),this._attachedPortal=t,this._attachedRef=o,this.attached.emit(o),o}attachTemplatePortal(t){t.setAttachedHost(this);const i=this._viewContainerRef.createEmbeddedView(t.templateRef,t.context);return super.setDisposeFn(()=>this._viewContainerRef.clear()),this._attachedPortal=t,this._attachedRef=i,this.attached.emit(i),i}_getRootNode(){const t=this._viewContainerRef.element.nativeElement;return t.nodeType===t.ELEMENT_NODE?t:t.parentNode}}return n.\u0275fac=function(t){return new(t||n)(Ce(El),Ce(Rs),Ce(fn))},n.\u0275dir=Nt({type:n,selectors:[["","cdkPortalOutlet",""]],inputs:{portal:["cdkPortalOutlet","portal"]},outputs:{attached:"attached"},exportAs:["cdkPortalOutlet"],features:[En]}),n})();const N$=F6();class f1e{constructor(e,t){this._viewportRuler=e,this._previousHTMLStyles={top:"",left:""},this._isEnabled=!1,this._document=t}attach(){}enable(){if(this._canBeEnabled()){const e=this._document.documentElement;this._previousScrollPosition=this._viewportRuler.getViewportScrollPosition(),this._previousHTMLStyles.left=e.style.left||"",this._previousHTMLStyles.top=e.style.top||"",e.style.left=bs(-this._previousScrollPosition.left),e.style.top=bs(-this._previousScrollPosition.top),e.classList.add("cdk-global-scrollblock"),this._isEnabled=!0}}disable(){if(this._isEnabled){const e=this._document.documentElement,i=e.style,r=this._document.body.style,s=i.scrollBehavior||"",o=r.scrollBehavior||"";this._isEnabled=!1,i.left=this._previousHTMLStyles.left,i.top=this._previousHTMLStyles.top,e.classList.remove("cdk-global-scrollblock"),N$&&(i.scrollBehavior=r.scrollBehavior="auto"),window.scroll(this._previousScrollPosition.left,this._previousScrollPosition.top),N$&&(i.scrollBehavior=s,r.scrollBehavior=o)}}_canBeEnabled(){if(this._document.documentElement.classList.contains("cdk-global-scrollblock")||this._isEnabled)return!1;const t=this._document.body,i=this._viewportRuler.getViewportSize();return t.scrollHeight>i.height||t.scrollWidth>i.width}}class p1e{constructor(e,t,i,r){this._scrollDispatcher=e,this._ngZone=t,this._viewportRuler=i,this._config=r,this._scrollSubscription=null,this._detach=()=>{this.disable(),this._overlayRef.hasAttached()&&this._ngZone.run(()=>this._overlayRef.detach())}}attach(e){this._overlayRef=e}enable(){if(this._scrollSubscription)return;const e=this._scrollDispatcher.scrolled(0);this._config&&this._config.threshold&&this._config.threshold>1?(this._initialScrollPosition=this._viewportRuler.getViewportScrollPosition().top,this._scrollSubscription=e.subscribe(()=>{const t=this._viewportRuler.getViewportScrollPosition().top;Math.abs(t-this._initialScrollPosition)>this._config.threshold?this._detach():this._overlayRef.updatePosition()})):this._scrollSubscription=e.subscribe(this._detach)}disable(){this._scrollSubscription&&(this._scrollSubscription.unsubscribe(),this._scrollSubscription=null)}detach(){this.disable(),this._overlayRef=null}}class k${enable(){}disable(){}attach(){}}function DN(n,e){return e.some(t=>n.bottomt.bottom||n.rightt.right)}function F$(n,e){return e.some(t=>n.topt.bottom||n.leftt.right)}class g1e{constructor(e,t,i,r){this._scrollDispatcher=e,this._viewportRuler=t,this._ngZone=i,this._config=r,this._scrollSubscription=null}attach(e){this._overlayRef=e}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:i,height:r}=this._viewportRuler.getViewportSize();DN(t,[{width:i,height:r,bottom:r,right:i,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 m1e=(()=>{class n{constructor(t,i,r,s){this._scrollDispatcher=t,this._viewportRuler=i,this._ngZone=r,this.noop=()=>new k$,this.close=o=>new p1e(this._scrollDispatcher,this._ngZone,this._viewportRuler,o),this.block=()=>new f1e(this._viewportRuler,this._document),this.reposition=o=>new g1e(this._scrollDispatcher,this._viewportRuler,this._ngZone,o),this._document=s}}return n.\u0275fac=function(t){return new(t||n)(Ie(Om),Ie(Rm),Ie(pn),Ie(fn))},n.\u0275prov=We({factory:function(){return new n(Ie(Om),Ie(Rm),Ie(pn),Ie(fn))},token:n,providedIn:"root"}),n})();class IC{constructor(e){if(this.scrollStrategy=new k$,this.panelClass="",this.hasBackdrop=!1,this.backdropClass="cdk-overlay-dark-backdrop",this.disposeOnNavigation=!1,e){const t=Object.keys(e);for(const i of t)void 0!==e[i]&&(this[i]=e[i])}}}class _1e{constructor(e,t,i,r,s){this.offsetX=i,this.offsetY=r,this.panelClass=s,this.originX=e.originX,this.originY=e.originY,this.overlayX=t.overlayX,this.overlayY=t.overlayY}}class y1e{constructor(e,t){this.connectionPair=e,this.scrollableViewProperties=t}}let L$=(()=>{class n{constructor(t){this._attachedOverlays=[],this._document=t}ngOnDestroy(){this.detach()}add(t){this.remove(t),this._attachedOverlays.push(t)}remove(t){const i=this._attachedOverlays.indexOf(t);i>-1&&this._attachedOverlays.splice(i,1),0===this._attachedOverlays.length&&this.detach()}}return n.\u0275fac=function(t){return new(t||n)(Ie(fn))},n.\u0275prov=We({factory:function(){return new n(Ie(fn))},token:n,providedIn:"root"}),n})(),b1e=(()=>{class n extends L${constructor(t){super(t),this._keydownListener=i=>{const r=this._attachedOverlays;for(let s=r.length-1;s>-1;s--)if(r[s]._keydownEvents.observers.length>0){r[s]._keydownEvents.next(i);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 n.\u0275fac=function(t){return new(t||n)(Ie(fn))},n.\u0275prov=We({factory:function(){return new n(Ie(fn))},token:n,providedIn:"root"}),n})(),v1e=(()=>{class n extends L${constructor(t,i){super(t),this._platform=i,this._cursorStyleIsSet=!1,this._clickListener=r=>{const s=Kf(r),o=this._attachedOverlays.slice();for(let a=o.length-1;a>-1;a--){const l=o[a];if(!(l._outsidePointerEvents.observers.length<1)&&l.hasAttached()){if(l.overlayElement.contains(s))break;l._outsidePointerEvents.next(r)}}}}add(t){if(super.add(t),!this._isAttached){const i=this._document.body;i.addEventListener("click",this._clickListener,!0),i.addEventListener("auxclick",this._clickListener,!0),i.addEventListener("contextmenu",this._clickListener,!0),this._platform.IOS&&!this._cursorStyleIsSet&&(this._cursorOriginalValue=i.style.cursor,i.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 n.\u0275fac=function(t){return new(t||n)(Ie(fn),Ie(Qi))},n.\u0275prov=We({factory:function(){return new n(Ie(fn),Ie(Qi))},token:n,providedIn:"root"}),n})();const Th="undefined"!=typeof window?window:{},B$=void 0!==Th.__karma__&&!!Th.__karma__||void 0!==Th.jasmine&&!!Th.jasmine||void 0!==Th.jest&&!!Th.jest||void 0!==Th.Mocha&&!!Th.Mocha;let Ob=(()=>{class n{constructor(t,i){this._platform=i,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||B$){const r=this._document.querySelectorAll(`.${t}[platform="server"], .${t}[platform="test"]`);for(let s=0;sthis._backdropClick.next(u),this._keydownEvents=new oe,this._outsidePointerEvents=new oe,r.scrollStrategy&&(this._scrollStrategy=r.scrollStrategy,this._scrollStrategy.attach(this)),this._positionStrategy=r.positionStrategy}get overlayElement(){return this._pane}get backdropElement(){return this._backdropElement}get hostElement(){return this._host}attach(e){let t=this._portalOutlet.attach(e);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(qr(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),t}detach(){if(!this.hasAttached())return;this.detachBackdrop(),this._togglePointerEvents(!1),this._positionStrategy&&this._positionStrategy.detach&&this._positionStrategy.detach(),this._scrollStrategy&&this._scrollStrategy.disable();const e=this._portalOutlet.detach();return this._detachments.next(),this._keyboardDispatcher.remove(this),this._detachContentWhenStable(),this._locationChanges.unsubscribe(),this._outsideClickDispatcher.remove(this),e}dispose(){const e=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,e&&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(e){e!==this._positionStrategy&&(this._positionStrategy&&this._positionStrategy.dispose(),this._positionStrategy=e,this.hasAttached()&&(e.attach(this),this.updatePosition()))}updateSize(e){this._config=Object.assign(Object.assign({},this._config),e),this._updateElementSize()}setDirection(e){this._config=Object.assign(Object.assign({},this._config),{direction:e}),this._updateElementDirection()}addPanelClass(e){this._pane&&this._toggleClasses(this._pane,e,!0)}removePanelClass(e){this._pane&&this._toggleClasses(this._pane,e,!1)}getDirection(){const e=this._config.direction;return e?"string"==typeof e?e:e.value:"ltr"}updateScrollStrategy(e){e!==this._scrollStrategy&&(this._disposeScrollStrategy(),this._scrollStrategy=e,this.hasAttached()&&(e.attach(this),e.enable()))}_updateElementDirection(){this._host.setAttribute("dir",this.getDirection())}_updateElementSize(){if(!this._pane)return;const e=this._pane.style;e.width=bs(this._config.width),e.height=bs(this._config.height),e.minWidth=bs(this._config.minWidth),e.minHeight=bs(this._config.minHeight),e.maxWidth=bs(this._config.maxWidth),e.maxHeight=bs(this._config.maxHeight)}_togglePointerEvents(e){this._pane.style.pointerEvents=e?"":"none"}_attachBackdrop(){const e="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(e)})}):this._backdropElement.classList.add(e)}_updateStackingOrder(){this._host.nextSibling&&this._host.parentNode.appendChild(this._host)}detachBackdrop(){let e=this._backdropElement;if(!e)return;let t,i=()=>{e&&(e.removeEventListener("click",this._backdropClickHandler),e.removeEventListener("transitionend",i),e.parentNode&&e.parentNode.removeChild(e)),this._backdropElement==e&&(this._backdropElement=null),this._config.backdropClass&&this._toggleClasses(e,this._config.backdropClass,!1),clearTimeout(t)};e.classList.remove("cdk-overlay-backdrop-showing"),this._ngZone.runOutsideAngular(()=>{e.addEventListener("transitionend",i)}),e.style.pointerEvents="none",t=this._ngZone.runOutsideAngular(()=>setTimeout(i,500))}_toggleClasses(e,t,i){const r=e.classList;YS(t).forEach(s=>{s&&(i?r.add(s):r.remove(s))})}_detachContentWhenStable(){this._ngZone.runOutsideAngular(()=>{const e=this._ngZone.onStable.pipe(gr(Nn(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)),e.unsubscribe())})})}_disposeScrollStrategy(){const e=this._scrollStrategy;e&&(e.disable(),e.detach&&e.detach())}}const V$="cdk-overlay-connected-position-bounding-box",E1e=/([A-Za-z%]+)$/;class j${constructor(e,t,i,r,s){this._viewportRuler=t,this._document=i,this._platform=r,this._overlayContainer=s,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 oe,this._resizeSubscription=C.EMPTY,this._offsetX=0,this._offsetY=0,this._appliedPanelClasses=[],this.positionChanges=this._positionChanges,this.setOrigin(e)}get positions(){return this._preferredPositions}attach(e){this._validatePositions(),e.hostElement.classList.add(V$),this._overlayRef=e,this._boundingBox=e.hostElement,this._pane=e.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 e=this._originRect,t=this._overlayRect,i=this._viewportRect,r=[];let s;for(let o of this._preferredPositions){let a=this._getOriginPoint(e,o),l=this._getOverlayPoint(a,t,o),c=this._getOverlayFit(l,t,i,o);if(c.isCompletelyWithinViewport)return this._isPushed=!1,void this._applyPosition(o,a);this._canFitWithFlexibleDimensions(c,l,i)?r.push({position:o,origin:a,overlayRect:t,boundingBoxRect:this._calculateBoundingBoxRect(a,o)}):(!s||s.overlayFit.visibleAreaa&&(a=c,o=l)}return this._isPushed=!1,void this._applyPosition(o.position,o.origin)}if(this._canPush)return this._isPushed=!0,void this._applyPosition(s.position,s.originPoint);this._applyPosition(s.position,s.originPoint)}detach(){this._clearPanelClasses(),this._lastPosition=null,this._previousPushAmount=null,this._resizeSubscription.unsubscribe()}dispose(){this._isDisposed||(this._boundingBox&&ip(this._boundingBox.style,{top:"",left:"",right:"",bottom:"",height:"",width:"",alignItems:"",justifyContent:""}),this._pane&&this._resetOverlayElementStyles(),this._overlayRef&&this._overlayRef.hostElement.classList.remove(V$),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 e=this._lastPosition||this._preferredPositions[0],t=this._getOriginPoint(this._originRect,e);this._applyPosition(e,t)}}withScrollableContainers(e){return this._scrollables=e,this}withPositions(e){return this._preferredPositions=e,-1===e.indexOf(this._lastPosition)&&(this._lastPosition=null),this._validatePositions(),this}withViewportMargin(e){return this._viewportMargin=e,this}withFlexibleDimensions(e=!0){return this._hasFlexibleDimensions=e,this}withGrowAfterOpen(e=!0){return this._growAfterOpen=e,this}withPush(e=!0){return this._canPush=e,this}withLockedPosition(e=!0){return this._positionLocked=e,this}setOrigin(e){return this._origin=e,this}withDefaultOffsetX(e){return this._offsetX=e,this}withDefaultOffsetY(e){return this._offsetY=e,this}withTransformOriginOn(e){return this._transformOriginSelector=e,this}_getOriginPoint(e,t){let i,r;if("center"==t.originX)i=e.left+e.width/2;else{const s=this._isRtl()?e.right:e.left,o=this._isRtl()?e.left:e.right;i="start"==t.originX?s:o}return r="center"==t.originY?e.top+e.height/2:"top"==t.originY?e.top:e.bottom,{x:i,y:r}}_getOverlayPoint(e,t,i){let r,s;return r="center"==i.overlayX?-t.width/2:"start"===i.overlayX?this._isRtl()?-t.width:0:this._isRtl()?0:-t.width,s="center"==i.overlayY?-t.height/2:"top"==i.overlayY?0:-t.height,{x:e.x+r,y:e.y+s}}_getOverlayFit(e,t,i,r){const s=z$(t);let{x:o,y:a}=e,l=this._getOffset(r,"x"),c=this._getOffset(r,"y");l&&(o+=l),c&&(a+=c);let f=0-a,g=a+s.height-i.height,m=this._subtractOverflows(s.width,0-o,o+s.width-i.width),v=this._subtractOverflows(s.height,f,g),x=m*v;return{visibleArea:x,isCompletelyWithinViewport:s.width*s.height===x,fitsInViewportVertically:v===s.height,fitsInViewportHorizontally:m==s.width}}_canFitWithFlexibleDimensions(e,t,i){if(this._hasFlexibleDimensions){const r=i.bottom-t.y,s=i.right-t.x,o=U$(this._overlayRef.getConfig().minHeight),a=U$(this._overlayRef.getConfig().minWidth),c=e.fitsInViewportHorizontally||null!=a&&a<=s;return(e.fitsInViewportVertically||null!=o&&o<=r)&&c}return!1}_pushOverlayOnScreen(e,t,i){if(this._previousPushAmount&&this._positionLocked)return{x:e.x+this._previousPushAmount.x,y:e.y+this._previousPushAmount.y};const r=z$(t),s=this._viewportRect,o=Math.max(e.x+r.width-s.width,0),a=Math.max(e.y+r.height-s.height,0),l=Math.max(s.top-i.top-e.y,0),c=Math.max(s.left-i.left-e.x,0);let u=0,h=0;return u=r.width<=s.width?c||-o:e.xm&&!this._isInitialRender&&!this._growAfterOpen&&(o=e.y-m/2)}if("end"===t.overlayX&&!r||"start"===t.overlayX&&r)f=i.width-e.x+this._viewportMargin,u=e.x-this._viewportMargin;else if("start"===t.overlayX&&!r||"end"===t.overlayX&&r)h=e.x,u=i.right-e.x;else{const g=Math.min(i.right-e.x+i.left,e.x),m=this._lastBoundingBoxSize.width;u=2*g,h=e.x-g,u>m&&!this._isInitialRender&&!this._growAfterOpen&&(h=e.x-m/2)}return{top:o,left:h,bottom:a,right:f,width:u,height:s}}_setBoundingBoxStyles(e,t){const i=this._calculateBoundingBoxRect(e,t);!this._isInitialRender&&!this._growAfterOpen&&(i.height=Math.min(i.height,this._lastBoundingBoxSize.height),i.width=Math.min(i.width,this._lastBoundingBoxSize.width));const r={};if(this._hasExactPosition())r.top=r.left="0",r.bottom=r.right=r.maxHeight=r.maxWidth="",r.width=r.height="100%";else{const s=this._overlayRef.getConfig().maxHeight,o=this._overlayRef.getConfig().maxWidth;r.height=bs(i.height),r.top=bs(i.top),r.bottom=bs(i.bottom),r.width=bs(i.width),r.left=bs(i.left),r.right=bs(i.right),r.alignItems="center"===t.overlayX?"center":"end"===t.overlayX?"flex-end":"flex-start",r.justifyContent="center"===t.overlayY?"center":"bottom"===t.overlayY?"flex-end":"flex-start",s&&(r.maxHeight=bs(s)),o&&(r.maxWidth=bs(o))}this._lastBoundingBoxSize=i,ip(this._boundingBox.style,r)}_resetBoundingBoxStyles(){ip(this._boundingBox.style,{top:"0",left:"0",right:"0",bottom:"0",height:"",width:"",alignItems:"",justifyContent:""})}_resetOverlayElementStyles(){ip(this._pane.style,{top:"",left:"",bottom:"",right:"",position:"",transform:""})}_setOverlayElementStyles(e,t){const i={},r=this._hasExactPosition(),s=this._hasFlexibleDimensions,o=this._overlayRef.getConfig();if(r){const u=this._viewportRuler.getViewportScrollPosition();ip(i,this._getExactOverlayY(t,e,u)),ip(i,this._getExactOverlayX(t,e,u))}else i.position="static";let a="",l=this._getOffset(t,"x"),c=this._getOffset(t,"y");l&&(a+=`translateX(${l}px) `),c&&(a+=`translateY(${c}px)`),i.transform=a.trim(),o.maxHeight&&(r?i.maxHeight=bs(o.maxHeight):s&&(i.maxHeight="")),o.maxWidth&&(r?i.maxWidth=bs(o.maxWidth):s&&(i.maxWidth="")),ip(this._pane.style,i)}_getExactOverlayY(e,t,i){let r={top:"",bottom:""},s=this._getOverlayPoint(t,this._overlayRect,e);this._isPushed&&(s=this._pushOverlayOnScreen(s,this._overlayRect,i));let o=this._overlayContainer.getContainerElement().getBoundingClientRect().top;return s.y-=o,"bottom"===e.overlayY?r.bottom=this._document.documentElement.clientHeight-(s.y+this._overlayRect.height)+"px":r.top=bs(s.y),r}_getExactOverlayX(e,t,i){let o,r={left:"",right:""},s=this._getOverlayPoint(t,this._overlayRect,e);return this._isPushed&&(s=this._pushOverlayOnScreen(s,this._overlayRect,i)),o=this._isRtl()?"end"===e.overlayX?"left":"right":"end"===e.overlayX?"right":"left","right"===o?r.right=this._document.documentElement.clientWidth-(s.x+this._overlayRect.width)+"px":r.left=bs(s.x),r}_getScrollVisibility(){const e=this._getOriginRect(),t=this._pane.getBoundingClientRect(),i=this._scrollables.map(r=>r.getElementRef().nativeElement.getBoundingClientRect());return{isOriginClipped:F$(e,i),isOriginOutsideView:DN(e,i),isOverlayClipped:F$(t,i),isOverlayOutsideView:DN(t,i)}}_subtractOverflows(e,...t){return t.reduce((i,r)=>i-Math.max(r,0),e)}_getNarrowedViewportRect(){const e=this._document.documentElement.clientWidth,t=this._document.documentElement.clientHeight,i=this._viewportRuler.getViewportScrollPosition();return{top:i.top+this._viewportMargin,left:i.left+this._viewportMargin,right:i.left+e-this._viewportMargin,bottom:i.top+t-this._viewportMargin,width:e-2*this._viewportMargin,height:t-2*this._viewportMargin}}_isRtl(){return"rtl"===this._overlayRef.getDirection()}_hasExactPosition(){return!this._hasFlexibleDimensions||this._isPushed}_getOffset(e,t){return"x"===t?null==e.offsetX?this._offsetX:e.offsetX:null==e.offsetY?this._offsetY:e.offsetY}_validatePositions(){}_addPanelClasses(e){this._pane&&YS(e).forEach(t=>{""!==t&&-1===this._appliedPanelClasses.indexOf(t)&&(this._appliedPanelClasses.push(t),this._pane.classList.add(t))})}_clearPanelClasses(){this._pane&&(this._appliedPanelClasses.forEach(e=>{this._pane.classList.remove(e)}),this._appliedPanelClasses=[])}_getOriginRect(){const e=this._origin;if(e instanceof gn)return e.nativeElement.getBoundingClientRect();if(e instanceof Element)return e.getBoundingClientRect();const t=e.width||0,i=e.height||0;return{top:e.y,bottom:e.y+i,left:e.x,right:e.x+t,height:i,width:t}}}function ip(n,e){for(let t in e)e.hasOwnProperty(t)&&(n[t]=e[t]);return n}function U$(n){if("number"!=typeof n&&null!=n){const[e,t]=n.split(E1e);return t&&"px"!==t?null:parseFloat(e)}return n||null}function z$(n){return{top:Math.floor(n.top),right:Math.floor(n.right),bottom:Math.floor(n.bottom),left:Math.floor(n.left),width:Math.floor(n.width),height:Math.floor(n.height)}}class x1e{constructor(e,t,i,r,s,o,a){this._preferredPositions=[],this._positionStrategy=new j$(i,r,s,o,a).withFlexibleDimensions(!1).withPush(!1).withViewportMargin(0),this.withFallbackPosition(e,t),this.onPositionChange=this._positionStrategy.positionChanges}get positions(){return this._preferredPositions}attach(e){this._overlayRef=e,this._positionStrategy.attach(e),this._direction&&(e.setDirection(this._direction),this._direction=null)}dispose(){this._positionStrategy.dispose()}detach(){this._positionStrategy.detach()}apply(){this._positionStrategy.apply()}recalculateLastPosition(){this._positionStrategy.reapplyLastPosition()}withScrollableContainers(e){this._positionStrategy.withScrollableContainers(e)}withFallbackPosition(e,t,i,r){const s=new _1e(e,t,i,r);return this._preferredPositions.push(s),this._positionStrategy.withPositions(this._preferredPositions),this}withDirection(e){return this._overlayRef?this._overlayRef.setDirection(e):this._direction=e,this}withOffsetX(e){return this._positionStrategy.withDefaultOffsetX(e),this}withOffsetY(e){return this._positionStrategy.withDefaultOffsetY(e),this}withLockedPosition(e){return this._positionStrategy.withLockedPosition(e),this}withPositions(e){return this._preferredPositions=e.slice(),this._positionStrategy.withPositions(this._preferredPositions),this}setOrigin(e){return this._positionStrategy.setOrigin(e),this}}const H$="cdk-global-overlay-wrapper";class S1e{constructor(){this._cssPosition="static",this._topOffset="",this._bottomOffset="",this._leftOffset="",this._rightOffset="",this._alignItems="",this._justifyContent="",this._width="",this._height=""}attach(e){const t=e.getConfig();this._overlayRef=e,this._width&&!t.width&&e.updateSize({width:this._width}),this._height&&!t.height&&e.updateSize({height:this._height}),e.hostElement.classList.add(H$),this._isDisposed=!1}top(e=""){return this._bottomOffset="",this._topOffset=e,this._alignItems="flex-start",this}left(e=""){return this._rightOffset="",this._leftOffset=e,this._justifyContent="flex-start",this}bottom(e=""){return this._topOffset="",this._bottomOffset=e,this._alignItems="flex-end",this}right(e=""){return this._leftOffset="",this._rightOffset=e,this._justifyContent="flex-end",this}width(e=""){return this._overlayRef?this._overlayRef.updateSize({width:e}):this._width=e,this}height(e=""){return this._overlayRef?this._overlayRef.updateSize({height:e}):this._height=e,this}centerHorizontally(e=""){return this.left(e),this._justifyContent="center",this}centerVertically(e=""){return this.top(e),this._alignItems="center",this}apply(){if(!this._overlayRef||!this._overlayRef.hasAttached())return;const e=this._overlayRef.overlayElement.style,t=this._overlayRef.hostElement.style,i=this._overlayRef.getConfig(),{width:r,height:s,maxWidth:o,maxHeight:a}=i,l=!("100%"!==r&&"100vw"!==r||o&&"100%"!==o&&"100vw"!==o),c=!("100%"!==s&&"100vh"!==s||a&&"100%"!==a&&"100vh"!==a);e.position=this._cssPosition,e.marginLeft=l?"0":this._leftOffset,e.marginTop=c?"0":this._topOffset,e.marginBottom=this._bottomOffset,e.marginRight=this._rightOffset,l?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=c?"flex-start":this._alignItems}dispose(){if(this._isDisposed||!this._overlayRef)return;const e=this._overlayRef.overlayElement.style,t=this._overlayRef.hostElement,i=t.style;t.classList.remove(H$),i.justifyContent=i.alignItems=e.marginTop=e.marginBottom=e.marginLeft=e.marginRight=e.position="",this._overlayRef=null,this._isDisposed=!0}}let C1e=(()=>{class n{constructor(t,i,r,s){this._viewportRuler=t,this._document=i,this._platform=r,this._overlayContainer=s}global(){return new S1e}connectedTo(t,i,r){return new x1e(i,r,t,this._viewportRuler,this._document,this._platform,this._overlayContainer)}flexibleConnectedTo(t){return new j$(t,this._viewportRuler,this._document,this._platform,this._overlayContainer)}}return n.\u0275fac=function(t){return new(t||n)(Ie(Rm),Ie(fn),Ie(Qi),Ie(Ob))},n.\u0275prov=We({factory:function(){return new n(Ie(Rm),Ie(fn),Ie(Qi),Ie(Ob))},token:n,providedIn:"root"}),n})(),T1e=0,Ec=(()=>{class n{constructor(t,i,r,s,o,a,l,c,u,h,f){this.scrollStrategies=t,this._overlayContainer=i,this._componentFactoryResolver=r,this._positionBuilder=s,this._keyboardDispatcher=o,this._injector=a,this._ngZone=l,this._document=c,this._directionality=u,this._location=h,this._outsideClickDispatcher=f}create(t){const i=this._createHostElement(),r=this._createPaneElement(i),s=this._createPortalOutlet(r),o=new IC(t);return o.direction=o.direction||this._directionality.value,new w1e(s,i,r,o,this._ngZone,this._keyboardDispatcher,this._document,this._location,this._outsideClickDispatcher)}position(){return this._positionBuilder}_createPaneElement(t){const i=this._document.createElement("div");return i.id="cdk-overlay-"+T1e++,i.classList.add("cdk-overlay-pane"),t.appendChild(i),i}_createHostElement(){const t=this._document.createElement("div");return this._overlayContainer.getContainerElement().appendChild(t),t}_createPortalOutlet(t){return this._appRef||(this._appRef=this._injector.get(sh)),new c1e(t,this._componentFactoryResolver,this._appRef,this._injector,this._document)}}return n.\u0275fac=function(t){return new(t||n)(Ie(m1e),Ie(Ob),Ie(El),Ie(C1e),Ie(b1e),Ie(Hn),Ie(pn),Ie(fn),Ie(Il),Ie(kg),Ie(v1e))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();class rTe{constructor(e,t){this.delay=e,this.scheduler=t}call(e,t){return t.subscribe(new PN(e,this.delay,this.scheduler))}}class PN extends y{constructor(e,t,i){super(e),this.delay=t,this.scheduler=i,this.queue=[],this.active=!1,this.errored=!1}static dispatch(e){const t=e.source,i=t.queue,r=e.scheduler,s=e.destination;for(;i.length>0&&i[0].time-r.now()<=0;)i.shift().notification.observe(s);if(i.length>0){const o=Math.max(0,i[0].time-r.now());this.schedule(e,o)}else this.unsubscribe(),t.active=!1}_schedule(e){this.active=!0,this.destination.add(e.schedule(PN.dispatch,this.delay,{source:this,destination:this.destination,scheduler:e}))}scheduleNotification(e){if(!0===this.errored)return;const t=this.scheduler,i=new sTe(t.now()+this.delay,e);this.queue.push(i),!1===this.active&&this._schedule(t)}_next(e){this.scheduleNotification(ga.createNext(e))}_error(e){this.errored=!0,this.queue=[],this.destination.error(e),this.unsubscribe()}_complete(){this.scheduleNotification(ga.createComplete()),this.unsubscribe()}}class sTe{constructor(e,t){this.time=e,this.notification=t}}function oW(...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;se.lift(new WTe(n))}et(7266);class WTe{constructor(e){this.callback=e}call(e,t){return t.subscribe(new qTe(e,this.callback))}}class qTe extends y{constructor(e,t){super(e),this.add(new C(t))}}class fW{}class pW{}class mu{constructor(e){this.normalizedNames=new Map,this.lazyUpdate=null,e?this.lazyInit="string"==typeof e?()=>{this.headers=new Map,e.split("\n").forEach(t=>{const i=t.indexOf(":");if(i>0){const r=t.slice(0,i),s=r.toLowerCase(),o=t.slice(i+1).trim();this.maybeSetNormalizedName(r,s),this.headers.has(s)?this.headers.get(s).push(o):this.headers.set(s,[o])}})}:()=>{this.headers=new Map,Object.keys(e).forEach(t=>{let i=e[t];const r=t.toLowerCase();"string"==typeof i&&(i=[i]),i.length>0&&(this.headers.set(r,i),this.maybeSetNormalizedName(t,r))})}:this.headers=new Map}has(e){return this.init(),this.headers.has(e.toLowerCase())}get(e){this.init();const t=this.headers.get(e.toLowerCase());return t&&t.length>0?t[0]:null}keys(){return this.init(),Array.from(this.normalizedNames.values())}getAll(e){return this.init(),this.headers.get(e.toLowerCase())||null}append(e,t){return this.clone({name:e,value:t,op:"a"})}set(e,t){return this.clone({name:e,value:t,op:"s"})}delete(e,t){return this.clone({name:e,value:t,op:"d"})}maybeSetNormalizedName(e,t){this.normalizedNames.has(t)||this.normalizedNames.set(t,e)}init(){this.lazyInit&&(this.lazyInit instanceof mu?this.copyFrom(this.lazyInit):this.lazyInit(),this.lazyInit=null,this.lazyUpdate&&(this.lazyUpdate.forEach(e=>this.applyUpdate(e)),this.lazyUpdate=null))}copyFrom(e){e.init(),Array.from(e.headers.keys()).forEach(t=>{this.headers.set(t,e.headers.get(t)),this.normalizedNames.set(t,e.normalizedNames.get(t))})}clone(e){const t=new mu;return t.lazyInit=this.lazyInit&&this.lazyInit instanceof mu?this.lazyInit:this,t.lazyUpdate=(this.lazyUpdate||[]).concat([e]),t}applyUpdate(e){const t=e.name.toLowerCase();switch(e.op){case"a":case"s":let i=e.value;if("string"==typeof i&&(i=[i]),0===i.length)return;this.maybeSetNormalizedName(e.name,t);const r=("a"===e.op?this.headers.get(t):void 0)||[];r.push(...i),this.headers.set(t,r);break;case"d":const s=e.value;if(s){let o=this.headers.get(t);if(!o)return;o=o.filter(a=>-1===s.indexOf(a)),0===o.length?(this.headers.delete(t),this.normalizedNames.delete(t)):this.headers.set(t,o)}else this.headers.delete(t),this.normalizedNames.delete(t)}}forEach(e){this.init(),Array.from(this.normalizedNames.keys()).forEach(t=>e(this.normalizedNames.get(t),this.headers.get(t)))}}class YTe{encodeKey(e){return gW(e)}encodeValue(e){return gW(e)}decodeKey(e){return decodeURIComponent(e)}decodeValue(e){return decodeURIComponent(e)}}const KTe=/%(\d[a-f0-9])/gi,QTe={40:"@","3A":":",24:"$","2C":",","3B":";","2B":"+","3D":"=","3F":"?","2F":"/"};function gW(n){return encodeURIComponent(n).replace(KTe,(e,t)=>{var i;return null!==(i=QTe[t])&&void 0!==i?i:e})}function mW(n){return`${n}`}class Lr{constructor(e={}){if(this.updates=null,this.cloneFrom=null,this.encoder=e.encoder||new YTe,e.fromString){if(e.fromObject)throw new Error("Cannot specify both fromString and fromObject.");this.map=function(n,e){const t=new Map;return n.length>0&&n.replace(/^\?/,"").split("&").forEach(r=>{const s=r.indexOf("="),[o,a]=-1==s?[e.decodeKey(r),""]:[e.decodeKey(r.slice(0,s)),e.decodeValue(r.slice(s+1))],l=t.get(o)||[];l.push(a),t.set(o,l)}),t}(e.fromString,this.encoder)}else e.fromObject?(this.map=new Map,Object.keys(e.fromObject).forEach(t=>{const i=e.fromObject[t];this.map.set(t,Array.isArray(i)?i:[i])})):this.map=null}has(e){return this.init(),this.map.has(e)}get(e){this.init();const t=this.map.get(e);return t?t[0]:null}getAll(e){return this.init(),this.map.get(e)||null}keys(){return this.init(),Array.from(this.map.keys())}append(e,t){return this.clone({param:e,value:t,op:"a"})}appendAll(e){const t=[];return Object.keys(e).forEach(i=>{const r=e[i];Array.isArray(r)?r.forEach(s=>{t.push({param:i,value:s,op:"a"})}):t.push({param:i,value:r,op:"a"})}),this.clone(t)}set(e,t){return this.clone({param:e,value:t,op:"s"})}delete(e,t){return this.clone({param:e,value:t,op:"d"})}toString(){return this.init(),this.keys().map(e=>{const t=this.encoder.encodeKey(e);return this.map.get(e).map(i=>t+"="+this.encoder.encodeValue(i)).join("&")}).filter(e=>""!==e).join("&")}clone(e){const t=new Lr({encoder:this.encoder});return t.cloneFrom=this.cloneFrom||this,t.updates=(this.updates||[]).concat(e),t}init(){null===this.map&&(this.map=new Map),null!==this.cloneFrom&&(this.cloneFrom.init(),this.cloneFrom.keys().forEach(e=>this.map.set(e,this.cloneFrom.map.get(e))),this.updates.forEach(e=>{switch(e.op){case"a":case"s":const t=("a"===e.op?this.map.get(e.param):void 0)||[];t.push(mW(e.value)),this.map.set(e.param,t);break;case"d":if(void 0===e.value){this.map.delete(e.param);break}{let i=this.map.get(e.param)||[];const r=i.indexOf(mW(e.value));-1!==r&&i.splice(r,1),i.length>0?this.map.set(e.param,i):this.map.delete(e.param)}}}),this.cloneFrom=this.updates=null)}}class Zs{constructor(){this.map=new Map}set(e,t){return this.map.set(e,t),this}get(e){return this.map.has(e)||this.map.set(e,e.defaultValue()),this.map.get(e)}delete(e){return this.map.delete(e),this}keys(){return this.map.keys()}}function _W(n){return"undefined"!=typeof ArrayBuffer&&n instanceof ArrayBuffer}function yW(n){return"undefined"!=typeof Blob&&n instanceof Blob}function bW(n){return"undefined"!=typeof FormData&&n instanceof FormData}class Rb{constructor(e,t,i,r){let s;if(this.url=t,this.body=null,this.reportProgress=!1,this.withCredentials=!1,this.responseType="json",this.method=e.toUpperCase(),function(n){switch(n){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,s=r):s=i,s&&(this.reportProgress=!!s.reportProgress,this.withCredentials=!!s.withCredentials,s.responseType&&(this.responseType=s.responseType),s.headers&&(this.headers=s.headers),s.context&&(this.context=s.context),s.params&&(this.params=s.params)),this.headers||(this.headers=new mu),this.context||(this.context=new Zs),this.params){const o=this.params.toString();if(0===o.length)this.urlWithParams=t;else{const a=t.indexOf("?");this.urlWithParams=t+(-1===a?"?":af.set(g,e.setHeaders[g]),c)),e.setParams&&(u=Object.keys(e.setParams).reduce((f,g)=>f.set(g,e.setParams[g]),u)),new Rb(i,r,o,{params:u,headers:c,context:h,reportProgress:l,responseType:s,withCredentials:a})}}var vs=(()=>((vs=vs||{})[vs.Sent=0]="Sent",vs[vs.UploadProgress=1]="UploadProgress",vs[vs.ResponseHeader=2]="ResponseHeader",vs[vs.DownloadProgress=3]="DownloadProgress",vs[vs.Response=4]="Response",vs[vs.User=5]="User",vs))();class kN{constructor(e,t=200,i="OK"){this.headers=e.headers||new mu,this.status=void 0!==e.status?e.status:t,this.statusText=e.statusText||i,this.url=e.url||null,this.ok=this.status>=200&&this.status<300}}class FN extends kN{constructor(e={}){super(e),this.type=vs.ResponseHeader}clone(e={}){return new FN({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})}}class RC extends kN{constructor(e={}){super(e),this.type=vs.Response,this.body=void 0!==e.body?e.body:null}clone(e={}){return new RC({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})}}class vW extends kN{constructor(e){super(e,0,"Unknown Error"),this.name="HttpErrorResponse",this.ok=!1,this.message=this.status>=200&&this.status<300?`Http failure during parsing for ${e.url||"(unknown url)"}`:`Http failure response for ${e.url||"(unknown url)"}: ${e.status} ${e.statusText}`,this.error=e.error||null}}function LN(n,e){return{body:e,headers:n.headers,context:n.context,observe:n.observe,params:n.params,reportProgress:n.reportProgress,responseType:n.responseType,withCredentials:n.withCredentials}}let _u=(()=>{class n{constructor(t){this.handler=t}request(t,i,r={}){let s;if(t instanceof Rb)s=t;else{let l,c;l=r.headers instanceof mu?r.headers:new mu(r.headers),r.params&&(c=r.params instanceof Lr?r.params:new Lr({fromObject:r.params})),s=new Rb(t,i,void 0!==r.body?r.body:null,{headers:l,context:r.context,params:c,reportProgress:r.reportProgress,responseType:r.responseType||"json",withCredentials:r.withCredentials})}const o=sn(s).pipe(function(n,e){return V(n,e,1)}(l=>this.handler.handle(l)));if(t instanceof Rb||"events"===r.observe)return o;const a=o.pipe(Ki(l=>l instanceof RC));switch(r.observe||"body"){case"body":switch(s.responseType){case"arraybuffer":return a.pipe(me(l=>{if(null!==l.body&&!(l.body instanceof ArrayBuffer))throw new Error("Response is not an ArrayBuffer.");return l.body}));case"blob":return a.pipe(me(l=>{if(null!==l.body&&!(l.body instanceof Blob))throw new Error("Response is not a Blob.");return l.body}));case"text":return a.pipe(me(l=>{if(null!==l.body&&"string"!=typeof l.body)throw new Error("Response is not a string.");return l.body}));case"json":default:return a.pipe(me(l=>l.body))}case"response":return a;default:throw new Error(`Unreachable: unhandled observe type ${r.observe}}`)}}delete(t,i={}){return this.request("DELETE",t,i)}get(t,i={}){return this.request("GET",t,i)}head(t,i={}){return this.request("HEAD",t,i)}jsonp(t,i){return this.request("JSONP",t,{params:(new Lr).append(i,"JSONP_CALLBACK"),observe:"body",responseType:"json"})}options(t,i={}){return this.request("OPTIONS",t,i)}patch(t,i,r={}){return this.request("PATCH",t,LN(r,i))}post(t,i,r={}){return this.request("POST",t,LN(r,i))}put(t,i,r={}){return this.request("PUT",t,LN(r,i))}}return n.\u0275fac=function(t){return new(t||n)(Ie(fW))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();class wW{constructor(e,t){this.next=e,this.interceptor=t}handle(e){return this.interceptor.intercept(e,this.next)}}const EW=new Ht("HTTP_INTERCEPTORS");let eAe=(()=>{class n{intercept(t,i){return i.handle(t)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const tAe=/^\)\]\}',?\n/;let xW=(()=>{class n{constructor(t){this.xhrFactory=t}handle(t){if("JSONP"===t.method)throw new Error("Attempted to construct Jsonp request without HttpClientJsonpModule installed.");return new O(i=>{const r=this.xhrFactory.build();if(r.open(t.method,t.urlWithParams),t.withCredentials&&(r.withCredentials=!0),t.headers.forEach((g,m)=>r.setRequestHeader(g,m.join(","))),t.headers.has("Accept")||r.setRequestHeader("Accept","application/json, text/plain, */*"),!t.headers.has("Content-Type")){const g=t.detectContentTypeHeader();null!==g&&r.setRequestHeader("Content-Type",g)}if(t.responseType){const g=t.responseType.toLowerCase();r.responseType="json"!==g?g:"text"}const s=t.serializeBody();let o=null;const a=()=>{if(null!==o)return o;const g=1223===r.status?204:r.status,m=r.statusText||"OK",v=new mu(r.getAllResponseHeaders()),x=function(n){return"responseURL"in n&&n.responseURL?n.responseURL:/^X-Request-URL:/m.test(n.getAllResponseHeaders())?n.getResponseHeader("X-Request-URL"):null}(r)||t.url;return o=new FN({headers:v,status:g,statusText:m,url:x}),o},l=()=>{let{headers:g,status:m,statusText:v,url:x}=a(),U=null;204!==m&&(U=void 0===r.response?r.responseText:r.response),0===m&&(m=U?200:0);let D=m>=200&&m<300;if("json"===t.responseType&&"string"==typeof U){const ie=U;U=U.replace(tAe,"");try{U=""!==U?JSON.parse(U):null}catch(_e){U=ie,D&&(D=!1,U={error:_e,text:U})}}D?(i.next(new RC({body:U,headers:g,status:m,statusText:v,url:x||void 0})),i.complete()):i.error(new vW({error:U,headers:g,status:m,statusText:v,url:x||void 0}))},c=g=>{const{url:m}=a(),v=new vW({error:g,status:r.status||0,statusText:r.statusText||"Unknown Error",url:m||void 0});i.error(v)};let u=!1;const h=g=>{u||(i.next(a()),u=!0);let m={type:vs.DownloadProgress,loaded:g.loaded};g.lengthComputable&&(m.total=g.total),"text"===t.responseType&&!!r.responseText&&(m.partialText=r.responseText),i.next(m)},f=g=>{let m={type:vs.UploadProgress,loaded:g.loaded};g.lengthComputable&&(m.total=g.total),i.next(m)};return r.addEventListener("load",l),r.addEventListener("error",c),r.addEventListener("timeout",c),r.addEventListener("abort",c),t.reportProgress&&(r.addEventListener("progress",h),null!==s&&r.upload&&r.upload.addEventListener("progress",f)),r.send(s),i.next({type:vs.Sent}),()=>{r.removeEventListener("error",c),r.removeEventListener("abort",c),r.removeEventListener("load",l),r.removeEventListener("timeout",c),t.reportProgress&&(r.removeEventListener("progress",h),null!==s&&r.upload&&r.upload.removeEventListener("progress",f)),r.readyState!==r.DONE&&r.abort()}})}}return n.\u0275fac=function(t){return new(t||n)(Ie(oV))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const BN=new Ht("XSRF_COOKIE_NAME"),VN=new Ht("XSRF_HEADER_NAME");class SW{}let iAe=(()=>{class n{constructor(t,i,r){this.doc=t,this.platform=i,this.cookieName=r,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=YB(t,this.cookieName),this.lastCookieString=t),this.lastToken}}return n.\u0275fac=function(t){return new(t||n)(Ie(fn),Ie(Xc),Ie(BN))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),jN=(()=>{class n{constructor(t,i){this.tokenService=t,this.headerName=i}intercept(t,i){const r=t.url.toLowerCase();if("GET"===t.method||"HEAD"===t.method||r.startsWith("http://")||r.startsWith("https://"))return i.handle(t);const s=this.tokenService.getToken();return null!==s&&!t.headers.has(this.headerName)&&(t=t.clone({headers:t.headers.set(this.headerName,s)})),i.handle(t)}}return n.\u0275fac=function(t){return new(t||n)(Ie(SW),Ie(VN))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),rAe=(()=>{class n{constructor(t,i){this.backend=t,this.injector=i,this.chain=null}handle(t){if(null===this.chain){const i=this.injector.get(EW,[]);this.chain=i.reduceRight((r,s)=>new wW(r,s),this.backend)}return this.chain.handle(t)}}return n.\u0275fac=function(t){return new(t||n)(Ie(pW),Ie(Hn))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),sAe=(()=>{class n{static disable(){return{ngModule:n,providers:[{provide:jN,useClass:eAe}]}}static withOptions(t={}){return{ngModule:n,providers:[t.cookieName?{provide:BN,useValue:t.cookieName}:[],t.headerName?{provide:VN,useValue:t.headerName}:[]]}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=tn({type:n}),n.\u0275inj=St({providers:[jN,{provide:EW,useExisting:jN,multi:!0},{provide:SW,useClass:iAe},{provide:BN,useValue:"XSRF-TOKEN"},{provide:VN,useValue:"X-XSRF-TOKEN"}]}),n})(),CW=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=tn({type:n}),n.\u0275inj=St({providers:[_u,{provide:fW,useClass:rAe},xW,{provide:pW,useExisting:xW}],imports:[[sAe.withOptions({cookieName:"XSRF-TOKEN",headerName:"X-XSRF-TOKEN"})]]}),n})();const oAe=["*"];function TW(n){return Error(`Unable to find icon with the name "${n}"`)}function AW(n){return Error(`The URL provided to MatIconRegistry was not trusted as a resource URL via Angular's DomSanitizer. Attempted URL was "${n}".`)}function MW(n){return Error(`The literal provided to MatIconRegistry was not trusted as safe HTML by Angular's DomSanitizer. Attempted literal was "${n}".`)}class rp{constructor(e,t,i){this.url=e,this.svgText=t,this.options=i}}let PC=(()=>{class n{constructor(t,i,r,s){this._httpClient=t,this._sanitizer=i,this._errorHandler=s,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=r}addSvgIcon(t,i,r){return this.addSvgIconInNamespace("",t,i,r)}addSvgIconLiteral(t,i,r){return this.addSvgIconLiteralInNamespace("",t,i,r)}addSvgIconInNamespace(t,i,r,s){return this._addSvgIconConfig(t,i,new rp(r,null,s))}addSvgIconResolver(t){return this._resolvers.push(t),this}addSvgIconLiteralInNamespace(t,i,r,s){const o=this._sanitizer.sanitize(si.HTML,r);if(!o)throw MW(r);return this._addSvgIconConfig(t,i,new rp("",o,s))}addSvgIconSet(t,i){return this.addSvgIconSetInNamespace("",t,i)}addSvgIconSetLiteral(t,i){return this.addSvgIconSetLiteralInNamespace("",t,i)}addSvgIconSetInNamespace(t,i,r){return this._addSvgIconSetConfig(t,new rp(i,null,r))}addSvgIconSetLiteralInNamespace(t,i,r){const s=this._sanitizer.sanitize(si.HTML,i);if(!s)throw MW(i);return this._addSvgIconSetConfig(t,new rp("",s,r))}registerFontClassAlias(t,i=t){return this._fontCssClassesByAlias.set(t,i),this}classNameForFontAlias(t){return this._fontCssClassesByAlias.get(t)||t}setDefaultFontSetClass(t){return this._defaultFontSetClass=t,this}getDefaultFontSetClass(){return this._defaultFontSetClass}getSvgIconFromUrl(t){const i=this._sanitizer.sanitize(si.RESOURCE_URL,t);if(!i)throw AW(t);const r=this._cachedIconsByUrl.get(i);return r?sn(NC(r)):this._loadSvgIconFromConfig(new rp(t,null)).pipe(cr(s=>this._cachedIconsByUrl.set(i,s)),me(s=>NC(s)))}getNamedSvgIcon(t,i=""){const r=DW(i,t);let s=this._svgIconConfigs.get(r);if(s)return this._getSvgFromConfig(s);if(s=this._getIconConfigFromResolvers(i,t),s)return this._svgIconConfigs.set(r,s),this._getSvgFromConfig(s);const o=this._iconSetConfigs.get(i);return o?this._getSvgFromIconSetConfigs(t,o):Fg(TW(r))}ngOnDestroy(){this._resolvers=[],this._svgIconConfigs.clear(),this._iconSetConfigs.clear(),this._cachedIconsByUrl.clear()}_getSvgFromConfig(t){return t.svgText?sn(NC(this._svgElementFromConfig(t))):this._loadSvgIconFromConfig(t).pipe(me(i=>NC(i)))}_getSvgFromIconSetConfigs(t,i){const r=this._extractIconWithNameFromAnySet(t,i);return r?sn(r):fb(i.filter(o=>!o.svgText).map(o=>this._loadSvgIconSetFromConfig(o).pipe(bc(a=>{const c=`Loading icon set URL: ${this._sanitizer.sanitize(si.RESOURCE_URL,o.url)} failed: ${a.message}`;return this._errorHandler.handleError(new Error(c)),sn(null)})))).pipe(me(()=>{const o=this._extractIconWithNameFromAnySet(t,i);if(!o)throw TW(t);return o}))}_extractIconWithNameFromAnySet(t,i){for(let r=i.length-1;r>=0;r--){const s=i[r];if(s.svgText&&s.svgText.indexOf(t)>-1){const o=this._svgElementFromConfig(s),a=this._extractSvgIconFromSet(o,t,s.options);if(a)return a}}return null}_loadSvgIconFromConfig(t){return this._fetchIcon(t).pipe(cr(i=>t.svgText=i),me(()=>this._svgElementFromConfig(t)))}_loadSvgIconSetFromConfig(t){return t.svgText?sn(null):this._fetchIcon(t).pipe(cr(i=>t.svgText=i))}_extractSvgIconFromSet(t,i,r){const s=t.querySelector(`[id="${i}"]`);if(!s)return null;const o=s.cloneNode(!0);if(o.removeAttribute("id"),"svg"===o.nodeName.toLowerCase())return this._setSvgAttributes(o,r);if("symbol"===o.nodeName.toLowerCase())return this._setSvgAttributes(this._toSvgElement(o),r);const a=this._svgElementFromString("");return a.appendChild(o),this._setSvgAttributes(a,r)}_svgElementFromString(t){const i=this._document.createElement("DIV");i.innerHTML=t;const r=i.querySelector("svg");if(!r)throw Error(" tag not found");return r}_toSvgElement(t){const i=this._svgElementFromString(""),r=t.attributes;for(let s=0;sthis._inProgressUrlFetches.delete(a)),ws());return this._inProgressUrlFetches.set(a,c),c}_addSvgIconConfig(t,i,r){return this._svgIconConfigs.set(DW(t,i),r),this}_addSvgIconSetConfig(t,i){const r=this._iconSetConfigs.get(t);return r?r.push(i):this._iconSetConfigs.set(t,[i]),this}_svgElementFromConfig(t){if(!t.svgElement){const i=this._svgElementFromString(t.svgText);this._setSvgAttributes(i,t.options),t.svgElement=i}return t.svgElement}_getIconConfigFromResolvers(t,i){for(let r=0;re?e.pathname+e.search:""}}}),IW=["clip-path","color-profile","src","cursor","fill","filter","marker","marker-start","marker-mid","marker-end","mask","stroke"],pAe=IW.map(n=>`[${n}]`).join(", "),gAe=/^url\(['"]?#(.*?)['"]?\)$/;let Fm=(()=>{class n extends uAe{constructor(t,i,r,s,o){super(t),this._iconRegistry=i,this._location=s,this._errorHandler=o,this._inline=!1,this._currentIconFetch=C.EMPTY,r||t.nativeElement.setAttribute("aria-hidden","true")}get inline(){return this._inline}set inline(t){this._inline=bi(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 i=this._cleanupFontValue(t);i!==this._fontSet&&(this._fontSet=i,this._updateFontIconClasses())}get fontIcon(){return this._fontIcon}set fontIcon(t){const i=this._cleanupFontValue(t);i!==this._fontIcon&&(this._fontIcon=i,this._updateFontIconClasses())}_splitIconName(t){if(!t)return["",""];const i=t.split(":");switch(i.length){case 1:return["",i[0]];case 2:return i;default:throw Error(`Invalid icon name: "${t}"`)}}ngOnInit(){this._updateFontIconClasses()}ngAfterViewChecked(){const t=this._elementsWithExternalReferences;if(t&&t.size){const i=this._location.getPathname();i!==this._previousPath&&(this._previousPath=i,this._prependPathToReferences(i))}}ngOnDestroy(){this._currentIconFetch.unsubscribe(),this._elementsWithExternalReferences&&this._elementsWithExternalReferences.clear()}_usingFontIcon(){return!this.svgIcon}_setSvgElement(t){this._clearSvgElement();const i=t.querySelectorAll("style");for(let s=0;s{r.forEach(o=>{s.setAttribute(o.name,`url('${t}#${o.value}')`)})})}_cacheChildrenWithExternalReferences(t){const i=t.querySelectorAll(pAe),r=this._elementsWithExternalReferences=this._elementsWithExternalReferences||new Map;for(let s=0;s{const a=i[s],l=a.getAttribute(o),c=l?l.match(gAe):null;if(c){let u=r.get(a);u||(u=[],r.set(a,u)),u.push({name:o,value:c[1]})}})}_updateSvgIcon(t){if(this._svgNamespace=null,this._svgName=null,this._currentIconFetch.unsubscribe(),t){const[i,r]=this._splitIconName(t);i&&(this._svgNamespace=i),r&&(this._svgName=r),this._currentIconFetch=this._iconRegistry.getNamedSvgIcon(r,i).pipe(qr(1)).subscribe(s=>this._setSvgElement(s),s=>{this._errorHandler.handleError(new Error(`Error retrieving icon ${i}:${r}! ${s.message}`))})}}}return n.\u0275fac=function(t){return new(t||n)(Ce(gn),Ce(PC),yo("aria-hidden"),Ce(dAe),Ce(la))},n.\u0275cmp=rn({type:n,selectors:[["mat-icon"]],hostAttrs:["role","img",1,"mat-icon","notranslate"],hostVars:7,hostBindings:function(t,i){2&t&&(Ii("data-mat-icon-type",i._usingFontIcon()?"font":"svg")("data-mat-icon-name",i._svgName||i.fontIcon)("data-mat-icon-namespace",i._svgNamespace||i.fontSet),ai("mat-icon-inline",i.inline)("mat-icon-no-color","primary"!==i.color&&"accent"!==i.color&&"warn"!==i.color))},inputs:{color:"color",inline:"inline",svgIcon:"svgIcon",fontSet:"fontSet",fontIcon:"fontIcon"},exportAs:["matIcon"],features:[En],ngContentSelectors:oAe,decls:1,vars:0,template:function(t,i){1&t&&(Hr(),oi(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}),n})();function TAe(n,e){}class zN{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 AAe={dialogContainer:Em("dialogContainer",[wc("void, exit",ds({opacity:0,transform:"scale(0.7)"})),wc("enter",ds({transform:"none"})),pd("* => enter",fd("150ms cubic-bezier(0, 0, 0.2, 1)",ds({transform:"none",opacity:1}))),pd("* => void, * => exit",fd("75ms cubic-bezier(0.4, 0.0, 0.2, 1)",ds({opacity:0})))])};let MAe=(()=>{class n extends MC{constructor(t,i,r,s,o,a){super(),this._elementRef=t,this._focusTrapFactory=i,this._changeDetectorRef=r,this._config=o,this._focusMonitor=a,this._animationStateChanged=new ln,this._elementFocusedBeforeDialogWasOpened=null,this._closeInteractionType=null,this.attachDomPortal=l=>(this._portalOutlet.hasAttached(),this._portalOutlet.attachDomPortal(l)),this._ariaLabelledBy=o.ariaLabelledBy||null,this._document=s}_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 i=KS(),r=this._elementRef.nativeElement;(!i||i===this._document.body||i===r||r.contains(i))&&(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=KS())}_focusDialogContainer(){this._elementRef.nativeElement.focus&&this._elementRef.nativeElement.focus()}_containsFocus(){const t=this._elementRef.nativeElement,i=KS();return t===i||t.contains(i)}}return n.\u0275fac=function(t){return new(t||n)(Ce(gn),Ce(Y6),Ce(Mr),Ce(fn,8),Ce(zN),Ce(vc))},n.\u0275dir=Nt({type:n,viewQuery:function(t,i){if(1&t&&hr(np,7),2&t){let r;Gn(r=$n())&&(i._portalOutlet=r.first)}},features:[En]}),n})(),DAe=(()=>{class n extends MAe{constructor(){super(...arguments),this._state="enter"}_onAnimationDone({toState:t,totalTime:i}){"enter"===t?(this._trapFocus(),this._animationStateChanged.next({state:"opened",totalTime:i})):"exit"===t&&(this._restoreFocus(),this._animationStateChanged.next({state:"closed",totalTime:i}))}_onAnimationStart({toState:t,totalTime:i}){"enter"===t?this._animationStateChanged.next({state:"opening",totalTime:i}):("exit"===t||"void"===t)&&this._animationStateChanged.next({state:"closing",totalTime:i})}_startExitAnimation(){this._state="exit",this._changeDetectorRef.markForCheck()}}return n.\u0275fac=function(){let e;return function(i){return(e||(e=zi(n)))(i||n)}}(),n.\u0275cmp=rn({type:n,selectors:[["mat-dialog-container"]],hostAttrs:["tabindex","-1","aria-modal","true",1,"mat-dialog-container"],hostVars:6,hostBindings:function(t,i){1&t&&uE("@dialogContainer.start",function(s){return i._onAnimationStart(s)})("@dialogContainer.done",function(s){return i._onAnimationDone(s)}),2&t&&(qc("id",i._id),Ii("role",i._config.role)("aria-labelledby",i._config.ariaLabel?null:i._ariaLabelledBy)("aria-label",i._config.ariaLabel)("aria-describedby",i._config.ariaDescribedBy||null),fE("@dialogContainer",i._state))},features:[En],decls:1,vars:0,consts:[["cdkPortalOutlet",""]],template:function(t,i){1&t&&wi(0,TAe,0,0,"ng-template",0)},directives:[np],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:[AAe.dialogContainer]}}),n})(),IAe=0;class kC{constructor(e,t,i="mat-dialog-"+IAe++){this._overlayRef=e,this._containerInstance=t,this.id=i,this.disableClose=this._containerInstance._config.disableClose,this._afterOpened=new oe,this._afterClosed=new oe,this._beforeClosed=new oe,this._state=0,t._id=i,t._animationStateChanged.pipe(Ki(r=>"opened"===r.state),qr(1)).subscribe(()=>{this._afterOpened.next(),this._afterOpened.complete()}),t._animationStateChanged.pipe(Ki(r=>"closed"===r.state),qr(1)).subscribe(()=>{clearTimeout(this._closeFallbackTimeout),this._finishDialogClose()}),e.detachments().subscribe(()=>{this._beforeClosed.next(this._result),this._beforeClosed.complete(),this._afterClosed.next(this._result),this._afterClosed.complete(),this.componentInstance=null,this._overlayRef.dispose()}),e.keydownEvents().pipe(Ki(r=>27===r.keyCode&&!this.disableClose&&!Dl(r))).subscribe(r=>{r.preventDefault(),HN(this,"keyboard")}),e.backdropClick().subscribe(()=>{this.disableClose?this._containerInstance._recaptureFocus():HN(this,"mouse")})}close(e){this._result=e,this._containerInstance._animationStateChanged.pipe(Ki(t=>"closing"===t.state),qr(1)).subscribe(t=>{this._beforeClosed.next(e),this._beforeClosed.complete(),this._overlayRef.detachBackdrop(),this._closeFallbackTimeout=setTimeout(()=>this._finishDialogClose(),t.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(e){let 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}updateSize(e="",t=""){return this._overlayRef.updateSize({width:e,height:t}),this._overlayRef.updatePosition(),this}addPanelClass(e){return this._overlayRef.addPanelClass(e),this}removePanelClass(e){return this._overlayRef.removePanelClass(e),this}getState(){return this._state}_finishDialogClose(){this._state=2,this._overlayRef.dispose()}_getPositionStrategy(){return this._overlayRef.getConfig().positionStrategy}}function HN(n,e,t){return void 0!==n._containerInstance&&(n._containerInstance._closeInteractionType=e),n.close(t)}const PW=new Ht("MatDialogData"),OAe=new Ht("mat-dialog-default-options"),NW=new Ht("mat-dialog-scroll-strategy");let NAe=(()=>{class n{constructor(t,i,r,s,o,a,l,c,u){this._overlay=t,this._injector=i,this._defaultOptions=r,this._parentDialog=s,this._overlayContainer=o,this._dialogRefConstructor=l,this._dialogContainerType=c,this._dialogDataToken=u,this._openDialogsAtThisLevel=[],this._afterAllClosedAtThisLevel=new oe,this._afterOpenedAtThisLevel=new oe,this._ariaHiddenElements=new Map,this.afterAllClosed=function(n){return new O(e=>{let t;try{t=n()}catch(r){return void e.error(r)}return(t?je(t):b0()).subscribe(e)})}(()=>this.openDialogs.length?this._getAfterAllClosed():this._getAfterAllClosed().pipe(Oo(void 0))),this._scrollStrategy=a}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,i){(i=function(n,e){return Object.assign(Object.assign({},e),n)}(i,this._defaultOptions||new zN)).id&&this.getDialogById(i.id);const r=this._createOverlay(i),s=this._attachDialogContainer(r,i),o=this._attachDialogContent(t,s,r,i);return this.openDialogs.length||this._hideNonDialogContentFromAssistiveTechnology(),this.openDialogs.push(o),o.afterClosed().subscribe(()=>this._removeOpenDialog(o)),this.afterOpened.next(o),s._initializeWithAttachedContent(),o}closeAll(){this._closeDialogs(this.openDialogs)}getDialogById(t){return this.openDialogs.find(i=>i.id===t)}ngOnDestroy(){this._closeDialogs(this._openDialogsAtThisLevel),this._afterAllClosedAtThisLevel.complete(),this._afterOpenedAtThisLevel.complete()}_createOverlay(t){const i=this._getOverlayConfig(t);return this._overlay.create(i)}_getOverlayConfig(t){const i=new IC({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&&(i.backdropClass=t.backdropClass),i}_attachDialogContainer(t,i){const s=Hn.create({parent:i&&i.viewContainerRef&&i.viewContainerRef.injector||this._injector,providers:[{provide:zN,useValue:i}]}),o=new AC(this._dialogContainerType,i.viewContainerRef,s,i.componentFactoryResolver);return t.attach(o).instance}_attachDialogContent(t,i,r,s){const o=new this._dialogRefConstructor(r,i,s.id);if(t instanceof Go)i.attachTemplatePortal(new Pm(t,null,{$implicit:s.data,dialogRef:o}));else{const a=this._createInjector(s,o,i),l=i.attachComponentPortal(new AC(t,s.viewContainerRef,a));o.componentInstance=l.instance}return o.updateSize(s.width,s.height).updatePosition(s.position),o}_createInjector(t,i,r){const s=t&&t.viewContainerRef&&t.viewContainerRef.injector,o=[{provide:this._dialogContainerType,useValue:r},{provide:this._dialogDataToken,useValue:t.data},{provide:this._dialogRefConstructor,useValue:i}];return t.direction&&(!s||!s.get(Il,null,xn.Optional))&&o.push({provide:Il,useValue:{value:t.direction,change:sn()}}),Hn.create({parent:s||this._injector,providers:o})}_removeOpenDialog(t){const i=this.openDialogs.indexOf(t);i>-1&&(this.openDialogs.splice(i,1),this.openDialogs.length||(this._ariaHiddenElements.forEach((r,s)=>{r?s.setAttribute("aria-hidden",r):s.removeAttribute("aria-hidden")}),this._ariaHiddenElements.clear(),this._getAfterAllClosed().next()))}_hideNonDialogContentFromAssistiveTechnology(){const t=this._overlayContainer.getContainerElement();if(t.parentElement){const i=t.parentElement.children;for(let r=i.length-1;r>-1;r--){let s=i[r];s!==t&&"SCRIPT"!==s.nodeName&&"STYLE"!==s.nodeName&&!s.hasAttribute("aria-live")&&(this._ariaHiddenElements.set(s,s.getAttribute("aria-hidden")),s.setAttribute("aria-hidden","true"))}}}_closeDialogs(t){let i=t.length;for(;i--;)t[i].close()}}return n.\u0275fac=function(t){return new(t||n)(Ce(Ec),Ce(Hn),Ce(void 0),Ce(void 0),Ce(Ob),Ce(void 0),Ce(Du),Ce(Du),Ce(Ht))},n.\u0275dir=Nt({type:n}),n})(),Nb=(()=>{class n extends NAe{constructor(t,i,r,s,o,a,l){super(t,i,s,a,l,o,kC,DAe,PW)}}return n.\u0275fac=function(t){return new(t||n)(Ie(Ec),Ie(Hn),Ie(kg,8),Ie(OAe,8),Ie(NW),Ie(n,12),Ie(Ob))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),FAe=0,kW=(()=>{class n{constructor(t,i,r){this._dialogRef=t,this._elementRef=i,this._dialog=r,this.id="mat-dialog-title-"+FAe++}ngOnInit(){this._dialogRef||(this._dialogRef=function(n,e){let t=n.nativeElement.parentElement;for(;t&&!t.classList.contains("mat-dialog-container");)t=t.parentElement;return t?e.find(i=>i.id===t.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 n.\u0275fac=function(t){return new(t||n)(Ce(kC,8),Ce(gn),Ce(Nb))},n.\u0275dir=Nt({type:n,selectors:[["","mat-dialog-title",""],["","matDialogTitle",""]],hostAttrs:[1,"mat-dialog-title"],hostVars:1,hostBindings:function(t,i){2&t&&qc("id",i.id)},inputs:{id:"id"},exportAs:["matDialogTitle"]}),n})(),FW=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275dir=Nt({type:n,selectors:[["","mat-dialog-content",""],["mat-dialog-content"],["","matDialogContent",""]],hostAttrs:[1,"mat-dialog-content"]}),n})();const $N=new Ht("CdkAccordion");let VAe=0,UAe=(()=>{class n{constructor(t,i,r){this.accordion=t,this._changeDetectorRef=i,this._expansionDispatcher=r,this._openCloseAllSubscription=C.EMPTY,this.closed=new ln,this.opened=new ln,this.destroyed=new ln,this.expandedChange=new ln,this.id="cdk-accordion-child-"+VAe++,this._expanded=!1,this._disabled=!1,this._removeUniqueSelectionListener=()=>{},this._removeUniqueSelectionListener=r.listen((s,o)=>{this.accordion&&!this.accordion.multi&&this.accordion.id===o&&this.id!==s&&(this.expanded=!1)}),this.accordion&&(this._openCloseAllSubscription=this._subscribeToOpenCloseAllActions())}get expanded(){return this._expanded}set expanded(t){t=bi(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=bi(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 n.\u0275fac=function(t){return new(t||n)(Ce($N,12),Ce(Mr),Ce(A$))},n.\u0275dir=Nt({type:n,selectors:[["cdk-accordion-item"],["","cdkAccordionItem",""]],inputs:{expanded:"expanded",disabled:"disabled"},outputs:{closed:"closed",opened:"opened",destroyed:"destroyed",expandedChange:"expandedChange"},exportAs:["cdkAccordionItem"],features:[Vn([{provide:$N,useValue:void 0}])]}),n})();const HAe=["body"];function GAe(n,e){}const $Ae=[[["mat-expansion-panel-header"]],"*",[["mat-action-row"]]],WAe=["mat-expansion-panel-header","*","mat-action-row"];function qAe(n,e){1&n&&ni(0,"span",2),2&n&&Jt("@indicatorRotate",_i()._getExpandedState())}const YAe=[[["mat-panel-title"]],[["mat-panel-description"]],"*"],XAe=["mat-panel-title","mat-panel-description","*"],WN=new Ht("MAT_ACCORDION"),BW="225ms cubic-bezier(0.4,0.0,0.2,1)",VW={indicatorRotate:Em("indicatorRotate",[wc("collapsed, void",ds({transform:"rotate(0deg)"})),wc("expanded",ds({transform:"rotate(180deg)"})),pd("expanded <=> collapsed, void => collapsed",fd(BW))]),bodyExpansion:Em("bodyExpansion",[wc("collapsed, void",ds({height:"0px",visibility:"hidden"})),wc("expanded",ds({height:"*",visibility:"visible"})),pd("expanded <=> collapsed, void => collapsed",fd(BW))])};let KAe=(()=>{class n{constructor(t){this._template=t}}return n.\u0275fac=function(t){return new(t||n)(Ce(Go))},n.\u0275dir=Nt({type:n,selectors:[["ng-template","matExpansionPanelContent",""]]}),n})(),QAe=0;const jW=new Ht("MAT_EXPANSION_PANEL_DEFAULT_OPTIONS");let UW=(()=>{class n extends UAe{constructor(t,i,r,s,o,a,l){super(t,i,r),this._viewContainerRef=s,this._animationMode=a,this._hideToggle=!1,this.afterExpand=new ln,this.afterCollapse=new ln,this._inputChanges=new oe,this._headerId="mat-expansion-panel-header-"+QAe++,this._bodyAnimationDone=new oe,this.accordion=t,this._document=o,this._bodyAnimationDone.pipe(ld((c,u)=>c.fromState===u.fromState&&c.toState===u.toState)).subscribe(c=>{"void"!==c.fromState&&("expanded"===c.toState?this.afterExpand.emit():"collapsed"===c.toState&&this.afterCollapse.emit())}),l&&(this.hideToggle=l.hideToggle)}get hideToggle(){return this._hideToggle||this.accordion&&this.accordion.hideToggle}set hideToggle(t){this._hideToggle=bi(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(Oo(null),Ki(()=>this.expanded&&!this._portal),qr(1)).subscribe(()=>{this._portal=new Pm(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,i=this._body.nativeElement;return t===i||i.contains(t)}return!1}}return n.\u0275fac=function(t){return new(t||n)(Ce(WN,12),Ce(Mr),Ce(A$),Ce(Rs),Ce(fn),Ce(Qa,8),Ce(jW,8))},n.\u0275cmp=rn({type:n,selectors:[["mat-expansion-panel"]],contentQueries:function(t,i,r){if(1&t&&function(n,e,t,i){const r=Si();if(r.firstCreatePass){const s=as();I3(r,new A3(e,t,i),s.index),function(n,e){const t=n.contentQueries||(n.contentQueries=[]);e!==(t.length?t[t.length-1]:-1)&&t.push(n.queries.length-1,e)}(r,n),2==(2&t)&&(r.staticContentQueries=!0)}D3(r,Vt(),t)}(r,KAe,5),2&t){let s;Gn(s=$n())&&(i._lazyContent=s.first)}},viewQuery:function(t,i){if(1&t&&hr(HAe,5),2&t){let r;Gn(r=$n())&&(i._body=r.first)}},hostAttrs:[1,"mat-expansion-panel"],hostVars:6,hostBindings:function(t,i){2&t&&ai("mat-expanded",i.expanded)("_mat-animation-noopable","NoopAnimations"===i._animationMode)("mat-expansion-panel-spacing",i._hasSpacing())},inputs:{disabled:"disabled",expanded:"expanded",hideToggle:"hideToggle",togglePosition:"togglePosition"},outputs:{opened:"opened",closed:"closed",expandedChange:"expandedChange",afterExpand:"afterExpand",afterCollapse:"afterCollapse"},exportAs:["matExpansionPanel"],features:[Vn([{provide:WN,useValue:void 0}]),En,Fi],ngContentSelectors:WAe,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,i){1&t&&(Hr($Ae),oi(0),wt(1,"div",0,1),Tn("@bodyExpansion.done",function(s){return i._bodyAnimationDone.next(s)}),wt(3,"div",2),oi(4,1),wi(5,GAe,0,0,"ng-template",3),Et(),oi(6,2),Et()),2&t&&(zt(1),Jt("@bodyExpansion",i._getExpandedState())("id",i.id),Ii("aria-labelledby",i._headerId),zt(4),Jt("cdkPortalOutlet",i._portal))},directives:[np],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:[VW.bodyExpansion]},changeDetection:0}),n})();class JAe{}const eMe=wC(JAe);let zW=(()=>{class n extends eMe{constructor(t,i,r,s,o,a,l){super(),this.panel=t,this._element=i,this._focusMonitor=r,this._changeDetectorRef=s,this._animationMode=a,this._parentChangeSubscription=C.EMPTY;const c=t.accordion?t.accordion._stateChanges.pipe(Ki(u=>!(!u.hideToggle&&!u.togglePosition))):Qc;this.tabIndex=parseInt(l||"")||0,this._parentChangeSubscription=Nn(t.opened,t.closed,c,t._inputChanges.pipe(Ki(u=>!!(u.hideToggle||u.disabled||u.togglePosition)))).subscribe(()=>this._changeDetectorRef.markForCheck()),t.closed.pipe(Ki(()=>t._containsFocus())).subscribe(()=>r.focusVia(i,"program")),o&&(this.expandedHeight=o.expandedHeight,this.collapsedHeight=o.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:Dl(t)||(t.preventDefault(),this._toggle());break;default:return void(this.panel.accordion&&this.panel.accordion._handleHeaderKeydown(t))}}focus(t,i){t?this._focusMonitor.focusVia(this._element,t,i):this._element.nativeElement.focus(i)}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 n.\u0275fac=function(t){return new(t||n)(Ce(UW,1),Ce(gn),Ce(vc),Ce(Mr),Ce(jW,8),Ce(Qa,8),yo("tabindex"))},n.\u0275cmp=rn({type:n,selectors:[["mat-expansion-panel-header"]],hostAttrs:["role","button",1,"mat-expansion-panel-header","mat-focus-indicator"],hostVars:15,hostBindings:function(t,i){1&t&&Tn("click",function(){return i._toggle()})("keydown",function(s){return i._keydown(s)}),2&t&&(Ii("id",i.panel._headerId)("tabindex",i.tabIndex)("aria-controls",i._getPanelId())("aria-expanded",i._isExpanded())("aria-disabled",i.panel.disabled),zy("height",i._getHeaderHeight()),ai("mat-expanded",i._isExpanded())("mat-expansion-toggle-indicator-after","after"===i._getTogglePosition())("mat-expansion-toggle-indicator-before","before"===i._getTogglePosition())("_mat-animation-noopable","NoopAnimations"===i._animationMode))},inputs:{tabIndex:"tabIndex",expandedHeight:"expandedHeight",collapsedHeight:"collapsedHeight"},features:[En],ngContentSelectors:XAe,decls:5,vars:1,consts:[[1,"mat-content"],["class","mat-expansion-indicator",4,"ngIf"],[1,"mat-expansion-indicator"]],template:function(t,i){1&t&&(Hr(YAe),wt(0,"span",0),oi(1),oi(2,1),oi(3,2),Et(),wi(4,qAe,1,1,"span",1)),2&t&&(zt(4),Jt("ngIf",i._showToggle()))},directives:[ac],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:[VW.indicatorRotate]},changeDetection:0}),n})();var HW=et(5478);Object.create(Error.prototype);const sMe=["*"];var LC=(()=>(function(n){n.LineHighlight="line-highlight",n.LineNumbers="line-numbers"}(LC||(LC={})),LC))();class aMe{}const $W=new Ht("SECURITY_CONTEXT");let qN=(()=>{class n{constructor(t,i,r,s,o){this.platform=t,this.securityContext=i,this.http=r,this.sanitizer=o,this.initialMarkedOptions={renderer:new HW.Renderer},this.options=s}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,i=!1,r=!1,s=this.options){const o=this.trimIndentation(t),a=i?this.decodeHtml(o):o,l=r?this.renderEmoji(a):a,c=HW.parse(l,s);return this.sanitizer.sanitize(this.securityContext,c)||""}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(me(i=>this.handleExtension(t,i)))}highlight(t){if(Af(this.platform)&&"undefined"!=typeof Prism){t||(t=document);const i=t.querySelectorAll('pre code:not([class*="language-"])');Array.prototype.forEach.call(i,r=>r.classList.add("language-none")),Prism.highlightAllUnder(t)}}renderKatex(t,i){if(!Af(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,(r,s)=>katex.renderToString(s,i))}decodeHtml(t){if(!Af(this.platform))return t;const i=document.createElement("textarea");return i.innerHTML=t,i.value}handleExtension(t,i){const r=t?t.split("?")[0].split(".").splice(-1).join():"";return"md"!==r?"```"+r+"\n"+i+"\n```":i}renderEmoji(t){if(!Af(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 i;return t.split("\n").map(r=>{let s=i;return r.length>0&&(s=isNaN(s)?r.search(/\S|$/):Math.min(r.search(/\S|$/),s)),isNaN(i)&&(i=s),s?r.substring(s):r}).join("\n")}}return n.\u0275fac=function(t){return new(t||n)(Ie(Xc),Ie($W),Ie(_u,8),Ie(aMe,8),Ie(Mf))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),WW=(()=>{class n{constructor(t,i){this.element=t,this.markdownService=i,this.error=new ln,this.load=new ln,this.ready=new ln,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,i=!1){let r=this.markdownService.compile(t,i,this.emoji);r=this.katex?this.markdownService.renderKatex(r,this.katexOptions):r,this.element.nativeElement.innerHTML=r,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,LC.LineNumbers),this.setPluginOptions(this.element.nativeElement,{dataStart:this.start}))}setPluginClass(t,i){const r=t.querySelectorAll("pre");for(let s=0;s{const a=i[o];if(a){const l=this.toLispCase(o);r.item(s).setAttribute(l,a.toString())}})}toLispCase(t){const i=t.match(/([A-Z])/g);if(!i)return t;let r=t.toString();for(let s=0,o=i.length;sk(i)?t(...i):t(i))):new O(i=>{const r=(...o)=>i.next(1===o.length?o[0]:o);let s;try{s=n(r)}catch(o){return void i.error(o)}if(Y(e))return()=>e(r,s)})}function YN(...n){return e=>{let t;return"function"==typeof n[n.length-1]&&(t=n.pop()),e.lift(new pMe(n,t))}}class pMe{constructor(e,t){this.observables=e,this.project=t}call(e,t){return t.subscribe(new gMe(e,this.observables,this.project))}}class gMe extends t5{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)}}class mMe{constructor(e,t,i=!1){this.accumulator=e,this.seed=t,this.hasSeed=i}call(e,t){return t.subscribe(new _Me(e,this.accumulator,this.seed,this.hasSeed))}}class _Me extends y{constructor(e,t,i,r){super(e),this.accumulator=t,this._seed=i,this.hasSeed=r,this.index=0}get seed(){return this._seed}set seed(e){this.hasSeed=!0,this._seed=e}_next(e){if(this.hasSeed)return this._tryNext(e);this.seed=e,this.destination.next(e)}_tryNext(e){const t=this.index++;let i;try{i=this.accumulator(this.seed,e,t)}catch(r){this.destination.error(r)}this.seed=i,this.destination.next(i)}}class vMe{constructor(e){this.predicate=e}call(e,t){return t.subscribe(new wMe(e,this.predicate))}}class wMe extends y{constructor(e,t){super(e),this.predicate=t,this.skipping=!0,this.index=0}_next(e){const t=this.destination;this.skipping&&this.tryCallPredicate(e),this.skipping||t.next(e)}tryCallPredicate(e){try{const t=this.predicate(e,this.index++);this.skipping=Boolean(t)}catch(t){this.destination.error(t)}}}const EMe=["youtubeContainer"];let KW=(()=>{class n{constructor(t,i){this._ngZone=t,this._youtubeContainer=new oe,this._destroyed=new oe,this._playerChanges=new Fr(void 0),this._videoId=new Fr(void 0),this._height=new Fr(390),this._width=new Fr(640),this._startSeconds=new Fr(void 0),this._endSeconds=new Fr(void 0),this._suggestedQuality=new Fr(void 0),this._playerVars=new Fr(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=Af(i)}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=sn(!0);if(!window.YT||!window.YT.Player){const r=new oe;this._existingApiReadyCallback=window.onYouTubeIframeAPIReady,window.onYouTubeIframeAPIReady=()=>{this._existingApiReadyCallback&&this._existingApiReadyCallback(),this._ngZone.run(()=>r.next(!0))},t=r.pipe(qr(1),Oo(!1))}const i=function(n,e,t,i,r,s,o){const a=yc([e,s]).pipe(YN(yc([i,r])),me(([l,c])=>{const[u,h]=l,[f,g]=c;return u?{videoId:u,playerVars:h,width:f,height:g}:void 0}));return yc([n,a,sn(o)]).pipe(function(n){return ue(function(...n){let e=null;return"function"==typeof n[n.length-1]&&(e=n.pop()),1===n.length&&k(n[0])&&(n=n[0].slice()),t=>t.lift.call(je([t,...n]),new r5(e))}(n),function(n){return e=>e.lift(new vMe(n))}(([e,t])=>!t),me(([e])=>e))}(t),function(n,e){let t=!1;return arguments.length>=2&&(t=!0),function(r){return r.lift(new mMe(n,e,t))}}(MMe,void 0),ld())}(this._youtubeContainer,this._videoId,t,this._width,this._height,this._playerVars,this._ngZone).pipe(cr(r=>{this._playerChanges.next(r)}),V(e=>e?QW(e)?sn(e):new O(t=>{let i=!1,r=!1;const s=o=>{r=!0,i||(o.target.removeEventListener("onReady",s),t.next(o.target))};return e.addEventListener("onReady",s),()=>{i=!0,r||(r=>{QW(r)||r.destroy()})(e)}}).pipe(qr(1),Oo(void 0)):sn(void 0)),gr(this._destroyed),xa(new oe));i.subscribe(r=>{this._player=r,r&&this._pendingPlayerState&&this._initializePlayer(r,this._pendingPlayerState),this._pendingPlayerState=void 0}),function(n,e,t){yc([n,e,t]).subscribe(([i,r,s])=>i&&i.setSize(r,s))}(i,this._width,this._height),function(n,e){yc([n,e]).subscribe(([t,i])=>t&&i&&t.setPlaybackQuality(i))}(i,this._suggestedQuality),function(n,e,t,i,r,s){const o=yc([t,i]).pipe(me(([u,h])=>({startSeconds:u,endSeconds:h}))),a=o.pipe(KN(n,u=>!!u&&!function(n){const e=n.getPlayerState();return e!==YT.PlayerState.UNSTARTED&&e!==YT.PlayerState.CUED}(u))),l=e.pipe(KN(n,(u,h)=>!!u&&u.videoId!==h));Nn(n.pipe(KN(yc([e,o]),([u,h],f)=>!(!f||u==f.videoId&&!h.startSeconds&&!h.endSeconds))),l,a).pipe(YN(yc([n,e,o,r])),me(([u,h])=>h),gr(s)).subscribe(([u,h,f,g])=>{!h||!u||(u.videoId=h,u.cueVideoById(Object.assign({videoId:h,suggestedQuality:g},f)))})}(i,this._videoId,this._startSeconds,this._endSeconds,this._suggestedQuality,this._destroyed),i.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,i){this._player?this._player.seekTo(t,i):this._getPendingState().seek={seconds:t,allowSeekAhead:i}}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,i){const{playbackState:r,playbackRate:s,volume:o,muted:a,seek:l}=i;switch(r){case YT.PlayerState.PLAYING:t.playVideo();break;case YT.PlayerState.PAUSED:t.pauseVideo();break;case YT.PlayerState.CUED:t.stopVideo()}null!=s&&t.setPlaybackRate(s),null!=o&&t.setVolume(o),null!=a&&(a?t.mute():t.unMute()),null!=l&&t.seekTo(l.seconds,l.allowSeekAhead)}_getLazyEmitter(t){return this._playerChanges.pipe(is(i=>i?qW(r=>{i.addEventListener(t,r)},r=>{try{i.removeEventListener&&i.removeEventListener(t,r)}catch(s){}}):sn()),i=>new O(r=>i.subscribe({next:s=>this._ngZone.run(()=>r.next(s)),error:s=>r.error(s),complete:()=>r.complete()})),gr(this._destroyed))}}return n.\u0275fac=function(t){return new(t||n)(Ce(pn),Ce(Xc))},n.\u0275cmp=rn({type:n,selectors:[["youtube-player"]],viewQuery:function(t,i){if(1&t&&hr(EMe,5),2&t){let r;Gn(r=$n())&&(i.youtubeContainer=r.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,i){1&t&&ni(0,"div",null,0)},encapsulation:2,changeDetection:0}),n})();function MMe(n,[e,t,i]){if(n&&t&&n.playerVars!==t.playerVars)n.destroy();else{if(!t)return void(n&&n.destroy());if(n)return n}const r=i.runOutsideAngular(()=>new YT.Player(e,t));return r.videoId=t.videoId,r.playerVars=t.playerVars,r}function QW(n){return"getPlayerStatus"in n}function KN(n,e){return ue(YN(n),Ki(([t,i])=>e(i,t)),me(([t])=>t))}let BMe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275dir=Nt({type:n,selectors:[["","mat-card-sm-image",""],["","matCardImageSmall",""]],hostAttrs:[1,"mat-card-sm-image"]}),n})();function Fb(n){return!0===n}function Za(n){return null==n}function Ja(n){return!Za(n)}function QN(n){return Boolean(n)}function t7(n){return Za(n)?n:JSON.parse(JSON.stringify(n))}const VC=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])&&VC(n[o])}),n};function n7(n){return Ja(n)&&"object"==typeof n&&function(n){return"[object Object]"===Object.prototype.toString.call(n)}(n)}const s7="NGXS_DATA_META",JN="NGXS_META",o7="NGXS_ARGUMENT_REGISTRY_META";let a7=(()=>{class n{constructor(t){this.sequence$=new Fr(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(hu,8))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();function Lb(n){return n[s7]}let el=(()=>{class n{constructor(t,i,r){n.store=t.get(hu),n.ngZone=t.get(pn),n.factory=i,n.context=r,n.computed=t.get(a7)}}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(o5),Ie(s5))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();class hs{constructor(){hs.statesCachedMeta.clear()}static createStateContext(e){return el.context.createStateContext(e)}static ensureMappedState(e){if(Za(el.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(Ja(e.name)?hs.statesCachedMeta.get(e.name):null)||hs.ensureMeta(e)}static getRepositoryByInstance(e){var t;const r=null!==(t=Lb(hs.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=hs.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=hs.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=Ja(e.name)?null===(t=el.factory.states)||void 0===t?void 0:t.find(r=>r.name===e.name):null;return Ja(i)&&Ja(e.name)&&hs.statesCachedMeta.set(e.name,i),i}}hs.statesCachedMeta=new Map,hs.\u0275fac=function(e){return new(e||hs)},hs.\u0275prov=We({token:hs,factory:hs.\u0275fac}),new Df(1);class sDe extends Error{constructor(e){super(`Child states can only be added to an object. Cannot convert ${Ja(null==e?void 0:e.constructor)?e.constructor.name:e} to PlainObject`)}}function l7(n){var e;return null!==(e=n.NGXS_OPTIONS_META)&&void 0!==e?e:{name:""}}function c7(n){var e;const t=l7(n),i=null!==(e=t.children)&&void 0!==e?e:[],s=t7(void 0===t.defaults?{}:t.defaults);if(i.length){if(n7(s))return function(n,e){return e.reduce((t,i)=>{const r=l7(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()]=c7(i),t},null!=n?n:{})}(s,i);throw new sDe(s)}return s}function d7(n){var e;return null!==(e=n.__NGXS_COMPUTED_OPTION__)&&void 0!==e?e:null}function h7(){var n,e;return null!==(e=null===(n=null==el?void 0:el.computed)||void 0===n?void 0:n.sequenceValue)&&void 0!==e?e:0}function cDe(n){let e=!1;return Im(n)&&(e=!0),e}function ek(n){return n[o7]}class uDe extends Error{constructor(e,t){super(`An argument with the name '${e}' already exists in the method '${t}'`)}}class dDe{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(QN(this.argumentMap.has(e))||QN(this.payloadMap.has(e)))throw new uDe(e,t)}}function _De(n){return{enumerable:!0,configurable:!0,get(){const e=Lb(n),t=hs.ensureMappedState(e.stateMeta);return hs.createStateContext(t)}}}function f7(){return(n,e,t)=>{!function(n,e){if(!function(n,e){var t;let i=n,r=!1;if(n7(i))for(;null!==i;){if(Fb(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(d7(n))&&Object.defineProperties(n,{__NGXS_COMPUTED_OPTION__:{enumerable:!0,configurable:!0,value:new WeakMap}}),d7(n)}(this),o=null==s?void 0:s.get(i);if(Fb(null==o?void 0:o.isObservable))return null==o?void 0:o.value;if(Za(o)||o.sequenceId!==h7()){s.delete(i);const l=i.apply(this,r);return s.set(i,{value:l,sequenceId:h7(),isObservable:cDe(l)}),l}return o.value},t}}const xDe={cancelUncompleted:!0,insideZone:!1};function tk(n=xDe){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=hs.getRepositoryByInstance(a),u=c.operations;let h=u[s];const f=c.stateMeta,g=ek(r);if(Za(h)){const D=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),ie=function(n){const{statePath:e,argumentsNames:t,methodName:i,argumentRegistry:r}=n;let s="";for(let o=0;o{var D;return Fb(n.insideZone)?null===(D=el.ngZone)||void 0===D||D.run(()=>{l=r.apply(a,o)}):l=r.apply(a,o),Im(l)?sn(null).pipe(me(()=>l)):l};const x=hs.createAction(h,o,g),U=el.store.dispatch(x);return Im(l)?function(n,e){return fb([n,e]).pipe(me(t=>t.pop()))}(U,l):l},i}}function p7(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(ek(t))&&Object.defineProperties(t,{[o7]:{enumerable:!0,configurable:!0,value:new dDe}}),ek(t)})(e,t).createPayloadType(r,t,i)}}function CDe(){return n=>{const e=function(n){if(function(n){return!QN(n)}(n.hasOwnProperty(JN))){const e={name:null,actions:{},defaults:{},path:null,makeRootSelector:t=>t.getStateGetter(e.name),children:[]};Object.defineProperty(n,JN,{value:e})}return function(n){var e;return null===(e=n)||void 0===e?void 0:e[JN]}(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=Lb(n))&&void 0!==e?e:null;return(Za(t)||(null==t?void 0:t.stateClass)!==n)&&function(n){Object.defineProperty(n,s7,{writable:!0,configurable:!0,enumerable:!0,value:{stateMeta:null,operations:{},stateClass:n}})}(n),Lb(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:()=>t7(t)},context:_De(n)})}(n,e,c7(n)),function(n){var e,t;const i=Lb(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(Ja(r)){const s=`__${r}__selector`;Object.defineProperties(n.prototype,{[s]:{writable:!0,enumerable:!1,configurable:!0},state$:{enumerable:!0,configurable:!0,get(){if(Ja(this[s]))return this[s];if(Za(el.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]=el.store.select(n).pipe(me(o=>fa()?VC(o):o),Wa({refCount:!0,bufferSize:1})),this[s]}}})}}(n)}}let ADe=(()=>{class n{constructor(){this.browserStorageEvents$=new oe,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})(),MDe=(()=>{class n extends ADe{get snapshot(){return function(n){return fa()?VC(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:()=>fa()?VC(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=zi(n)))(i||n)}}(),n.\u0275prov=We({token:n,factory:n.\u0275fac}),Ei([f7(),uc("design:type",Object),uc("design:paramtypes",[])],n.prototype,"snapshot",null),Ei([tk(),wV(0,p7("patchValue")),uc("design:type",Function),uc("design:paramtypes",[Object]),uc("design:returntype",void 0)],n.prototype,"patchState",null),Ei([tk(),wV(0,p7("stateValue")),uc("design:type",Function),uc("design:paramtypes",[Object]),uc("design:returntype",void 0)],n.prototype,"setState",null),Ei([tk(),uc("design:type",Function),uc("design:paramtypes",[]),uc("design:returntype",void 0)],n.prototype,"reset",null),n})(),g9=(()=>{class n{constructor(){}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275dir=Nt({type:n,selectors:[["","gaEvent","","gaCategory",""],["","gaCategory",""]],inputs:{gaCategory:"gaCategory"},exportAs:["gaCategory"]}),n})();const zm=new Ht("ngx-google-analytics-settings",{factory:()=>({trackingCode:"",enableTracing:!1})}),Sk=new Ht("ngx-window",{providedIn:"root",factory:()=>function(n){return Af(n)?window:null}(Bc(Xc))}),jOe=new Ht("ngx-data-layer",{providedIn:"root",factory:()=>function(n){return n?n.dataLayer=n.dataLayer||[]:null}(Bc(Sk))}),Ck=new Ht("ngx-gtag-fn",{providedIn:"root",factory:()=>function(n,e){return n?n.gtag=n.gtag||function(){e.push(arguments)}:null}(Bc(Sk),Bc(jOe))});let qb=(()=>{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||fa())&&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(zm),Ie(fn),Ie(Ck))},n.\u0275prov=We({factory:function(){return new n(Ie(zm),Ie(fn),Ie(Ck))},token:n,providedIn:"root"}),n})(),m9=(()=>{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=gd(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){(fa()||this.settings.enableTracing)&&console&&console.warn&&console.warn(t)}}return n.\u0275fac=function(t){return new(t||n)(Ce(g9,8),Ce(qb),Ce(zm),Ce(gn))},n.\u0275dir=Nt({type:n,selectors:[["","gaEvent",""]],inputs:{gaBind:"gaBind",gaAction:"gaAction",gaLabel:"gaLabel",label:"label",gaValue:"gaValue",gaInteraction:"gaInteraction",gaEvent:"gaEvent"},exportAs:["gaEvent"]}),n})();const zOe={provide:Ef,multi:!0,useFactory:function(n,e,t){return()=>Bi(this,void 0,void 0,function*(){var i;if(!n.trackingCode)return void(fa()||console.error("Empty tracking code for Google Analytics. Make sure to provide one when initializing NgxGoogleAnalyticsModule."));if(!e)return void(fa()||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||fa()||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:[zm,Ck,fn]};new Ht("ngx-google-analytics-routing-settings",{factory:()=>({})});let r1=(()=>{class n{static forRoot(t,i=[],r,s,o){return{ngModule:n,providers:[{provide:zm,useValue:{trackingCode:t,initCommands:i,uri:r,enableTracing:s,nonce:o}},zOe]}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=tn({type:n}),n.\u0275inj=St({imports:[[]]}),n})(),o1=(()=>{class n{constructor(){this.consent="not-set",this.consentChange=new Df(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=We({token:n,factory:n.\u0275fac}),n})(),tRe=(()=>{class n{constructor(t,i,{trackingCode:r}){this.window=i,this.subscriptions=new C,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(o1),Ie(Sk),Ie(zm))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const nRe=new Ht("Key under which consent is stored",{providedIn:"root",factory:()=>"ALLOW_TELEMETRY"}),S9=[o1,tRe,(()=>{class n{constructor(t,i){this.key=i,this.subscriptions=new C;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(o1),Ie(nRe))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})()];function rRe(n){return Object.entries(n).reduce((e,[t,i])=>(null!=i&&(e[t]=`${i}`),e),{})}let oRe=(()=>{class n{static forRoot(t){const{providers:i=[]}=r1.forRoot(t.gaToken,function(n){const{appName:e,projectName:t,developmentMode:i}=n;return[{command:"set",values:[rRe({appName:e,projectName:t,developmentMode:i})]}]}(t));return{ngModule:n,providers:i}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=tn({type:n}),n.\u0275inj=St({providers:[...S9,{provide:Ef,multi:!0,useFactory:()=>()=>{},deps:S9}],imports:[[r1]]}),n})();const uRe=(n,e)=>JSON.stringify(n)===JSON.stringify(e),dRe=n=>n.map(e=>void 0!==e?JSON.parse(JSON.stringify(e)):e),xc={storageStrategy:class extends class{}{constructor(){super(...arguments),this.cachePairs=[]}add(e,t,i){this.cachePairs.push(e)}addMany(e){this.cachePairs=e}updateAtIndex(e,t){Object.assign(this.cachePairs[e],t)}update(e,t){Object.assign(this.cachePairs[e],t)}getAll(){return this.cachePairs}removeAtIndex(e){this.cachePairs.splice(e,1)}remove(e){this.cachePairs.splice(e,1)}removeAll(){this.cachePairs.length=0}},globalCacheKey:"CACHE_STORAGE",promiseImplementation:Promise},hRe=new oe;function Sc(n={}){return function(e,t,i){const r=n.cacheKey||e.constructor.name+"#"+t,s=i.value;if(i&&i.value){let o=n.storageStrategy?new n.storageStrategy:new xc.storageStrategy;const a=[];n.cacheModifier&&n.cacheModifier.subscribe(u=>o.addMany(u(o.getAll(r,this)),r,this)),Nn(hRe.asObservable(),n.cacheBusterObserver?n.cacheBusterObserver:b0()).subscribe(u=>{o.removeAll(r,this),a.length=0}),n.cacheResolver=n.cacheResolver||xc.cacheResolver||uRe,n.cacheHasher=n.cacheHasher||xc.cacheHasher||dRe,i.value=function(...u){const h=o.getAll(r,this);let f=n.cacheHasher(u),g=h.find(v=>n.cacheResolver(v.parameters,f));const m=a.find(v=>n.cacheResolver(v.parameters,f));if((n.maxAge||xc.maxAge)&&g&&g.created&&((new Date).getTime()-new Date(g.created).getTime()>(n.maxAge||xc.maxAge)?(o.remove?o.remove(h.indexOf(g),g,r,this):o.removeAtIndex(h.indexOf(g),r,this),g=null):(n.slidingExpiration||xc.slidingExpiration)&&(g.created=new Date,o.update?o.update(h.indexOf(g),g,r,this):o.updateAtIndex(h.indexOf(g),g,r,this))),g){const v=sn(g.response);return n.async?v.pipe(function(n,e=qS){const i=function(n){return n instanceof Date&&!isNaN(+n)}(n)?+n-e.now():Math.abs(n);return r=>r.lift(new rTe(i,e))}(0)):v}if(m)return m.response;{const v=s.call(this,...u).pipe(NN(()=>{const x=a.find(U=>n.cacheResolver(U.parameters,f));a.splice(a.indexOf(x),1)}),cr(x=>{(!n.shouldCacheDecider||n.shouldCacheDecider(x))&&((!(n.maxCacheCount||xc.maxCacheCount)||1===(n.maxCacheCount||xc.maxCacheCount)||(n.maxCacheCount||xc.maxCacheCount)&&(n.maxCacheCount||xc.maxCacheCount)xa(()=>s,undefined)(o)}(),Yn());return a.push({parameters:f,response:v,created:new Date}),v}}}return i}}class fRe{encodeKey(e){return encodeURIComponent(e)}encodeValue(e){return encodeURIComponent(e)}decodeKey(e){return decodeURIComponent(e)}decodeValue(e){return decodeURIComponent(e)}}const C9=new Ht("basePath");class Yb{constructor(e={}){this.apiKeys=e.apiKeys,this.username=e.username,this.password=e.password,this.accessToken=e.accessToken,this.basePath=e.basePath,this.withCredentials=e.withCredentials,this.encoder=e.encoder,this.credentials=e.credentials?e.credentials:{}}selectHeaderContentType(e){if(0===e.length)return;const t=e.find(i=>this.isJsonMime(i));return void 0===t?e[0]:t}selectHeaderAccept(e){if(0===e.length)return;const t=e.find(i=>this.isJsonMime(i));return void 0===t?e[0]:t}isJsonMime(e){const t=new RegExp("^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$","i");return null!==e&&(t.test(e)||"application/json-patch+json"===e.toLowerCase())}lookupCredential(e){const t=this.credentials[e];return"function"==typeof t?t():t}}let T9=(()=>{class n{constructor(t,i,r){this.httpClient=t,this.basePath="/v1",this.defaultHeaders=new mu,this.configuration=new Yb,r&&(this.configuration=r),"string"!=typeof this.configuration.basePath&&("string"!=typeof i&&(i=this.basePath),this.configuration.basePath=i),this.encoder=this.configuration.encoder||new fRe}addToHttpParams(t,i,r){return this.addToHttpParamsRecursive(t,i,r)}addToHttpParamsRecursive(t,i,r){if(null==i)return t;if("object"==typeof i)if(Array.isArray(i))i.forEach(s=>t=this.addToHttpParamsRecursive(t,s,r));else if(i instanceof Date){if(null==r)throw Error("key may not be null if value is Date");t=t.append(r,i.toISOString().substr(0,10))}else Object.keys(i).forEach(s=>t=this.addToHttpParamsRecursive(t,i[s],null!=r?`${r}.${s}`:s));else{if(null==r)throw Error("key may not be null if value is not object or array");t=t.append(r,i)}return t}aggregateResults(t,i="body",r=!1,s){const o=t.age,a=t.ageRange,l=t.bmi,c=t.bmiRange,u=t.cache,h=t.ontologyTerms,f=t.cellTypeTerms,g=t.providers,m=t.sex,v=t.spatial,x=t.technologies,U=t.token;let D=new Lr({encoder:this.encoder});null!=o&&(D=this.addToHttpParams(D,o,"age")),null!=a&&(D=this.addToHttpParams(D,a,"age-range")),null!=l&&(D=this.addToHttpParams(D,l,"bmi")),null!=c&&(D=this.addToHttpParams(D,c,"bmi-range")),null!=u&&(D=this.addToHttpParams(D,u,"cache")),h&&h.forEach(Ve=>{D=this.addToHttpParams(D,Ve,"ontology-terms")}),f&&f.forEach(Ve=>{D=this.addToHttpParams(D,Ve,"cell-type-terms")}),g&&g.forEach(Ve=>{D=this.addToHttpParams(D,Ve,"providers")}),null!=m&&(D=this.addToHttpParams(D,m,"sex")),v&&v.forEach(Ve=>{D=this.addToHttpParams(D,Ve,"spatial")}),x&&x.forEach(Ve=>{D=this.addToHttpParams(D,Ve,"technologies")}),null!=U&&(D=this.addToHttpParams(D,U,"token"));let ie=this.defaultHeaders,_e=s&&s.httpHeaderAccept;void 0===_e&&(_e=this.configuration.selectHeaderAccept(["application/json"])),void 0!==_e&&(ie=ie.set("Accept",_e));let Pe=s&&s.context;void 0===Pe&&(Pe=new Zs);let Ne="json";return _e&&(Ne=_e.startsWith("text")?"text":this.configuration.isJsonMime(_e)?"json":"blob"),this.httpClient.get(`${this.configuration.basePath}/aggregate-results`,{context:Pe,params:D,responseType:Ne,withCredentials:this.configuration.withCredentials,headers:ie,observe:i,reportProgress:r})}cellTypeTermOccurences(t,i="body",r=!1,s){const o=t.age,a=t.ageRange,l=t.bmi,c=t.bmiRange,u=t.cache,h=t.ontologyTerms,f=t.cellTypeTerms,g=t.providers,m=t.sex,v=t.spatial,x=t.technologies,U=t.token;let D=new Lr({encoder:this.encoder});null!=o&&(D=this.addToHttpParams(D,o,"age")),null!=a&&(D=this.addToHttpParams(D,a,"age-range")),null!=l&&(D=this.addToHttpParams(D,l,"bmi")),null!=c&&(D=this.addToHttpParams(D,c,"bmi-range")),null!=u&&(D=this.addToHttpParams(D,u,"cache")),h&&h.forEach(Ve=>{D=this.addToHttpParams(D,Ve,"ontology-terms")}),f&&f.forEach(Ve=>{D=this.addToHttpParams(D,Ve,"cell-type-terms")}),g&&g.forEach(Ve=>{D=this.addToHttpParams(D,Ve,"providers")}),null!=m&&(D=this.addToHttpParams(D,m,"sex")),v&&v.forEach(Ve=>{D=this.addToHttpParams(D,Ve,"spatial")}),x&&x.forEach(Ve=>{D=this.addToHttpParams(D,Ve,"technologies")}),null!=U&&(D=this.addToHttpParams(D,U,"token"));let ie=this.defaultHeaders,_e=s&&s.httpHeaderAccept;void 0===_e&&(_e=this.configuration.selectHeaderAccept(["application/json"])),void 0!==_e&&(ie=ie.set("Accept",_e));let Pe=s&&s.context;void 0===Pe&&(Pe=new Zs);let Ne="json";return _e&&(Ne=_e.startsWith("text")?"text":this.configuration.isJsonMime(_e)?"json":"blob"),this.httpClient.get(`${this.configuration.basePath}/cell-type-term-occurences`,{context:Pe,params:D,responseType:Ne,withCredentials:this.configuration.withCredentials,headers:ie,observe:i,reportProgress:r})}cellTypeTreeModel(t,i="body",r=!1,s){const o=t.cache,a=t.token;let l=new Lr({encoder:this.encoder});null!=o&&(l=this.addToHttpParams(l,o,"cache")),null!=a&&(l=this.addToHttpParams(l,a,"token"));let c=this.defaultHeaders,u=s&&s.httpHeaderAccept;void 0===u&&(u=this.configuration.selectHeaderAccept(["application/json"])),void 0!==u&&(c=c.set("Accept",u));let h=s&&s.context;void 0===h&&(h=new Zs);let f="json";return u&&(f=u.startsWith("text")?"text":this.configuration.isJsonMime(u)?"json":"blob"),this.httpClient.get(`${this.configuration.basePath}/cell-type-tree-model`,{context:h,params:l,responseType:f,withCredentials:this.configuration.withCredentials,headers:c,observe:i,reportProgress:r})}dbStatus(t,i="body",r=!1,s){const o=t.token;let a=new Lr({encoder:this.encoder});null!=o&&(a=this.addToHttpParams(a,o,"token"));let l=this.defaultHeaders,c=s&&s.httpHeaderAccept;void 0===c&&(c=this.configuration.selectHeaderAccept(["application/json"])),void 0!==c&&(l=l.set("Accept",c));let u=s&&s.context;void 0===u&&(u=new Zs);let h="json";return c&&(h=c.startsWith("text")?"text":this.configuration.isJsonMime(c)?"json":"blob"),this.httpClient.get(`${this.configuration.basePath}/db-status`,{context:u,params:a,responseType:h,withCredentials:this.configuration.withCredentials,headers:l,observe:i,reportProgress:r})}getSpatialPlacement(t,i="body",r=!1,s){const o=t.getSpatialPlacementRequest;if(null==o)throw new Error("Required parameter getSpatialPlacementRequest was null or undefined when calling getSpatialPlacement.");let a=this.defaultHeaders,l=s&&s.httpHeaderAccept;void 0===l&&(l=this.configuration.selectHeaderAccept(["application/json"])),void 0!==l&&(a=a.set("Accept",l));let c=s&&s.context;void 0===c&&(c=new Zs);const h=this.configuration.selectHeaderContentType(["application/json"]);void 0!==h&&(a=a.set("Content-Type",h));let f="json";return l&&(f=l.startsWith("text")?"text":this.configuration.isJsonMime(l)?"json":"blob"),this.httpClient.post(`${this.configuration.basePath}/get-spatial-placement`,o,{context:c,responseType:f,withCredentials:this.configuration.withCredentials,headers:a,observe:i,reportProgress:r})}gtexRuiLocations(t,i="body",r=!1,s){const o=t.cache;let a=new Lr({encoder:this.encoder});null!=o&&(a=this.addToHttpParams(a,o,"cache"));let l=this.defaultHeaders,c=s&&s.httpHeaderAccept;void 0===c&&(c=this.configuration.selectHeaderAccept(["application/json"])),void 0!==c&&(l=l.set("Accept",c));let u=s&&s.context;void 0===u&&(u=new Zs);let h="json";return c&&(h=c.startsWith("text")?"text":this.configuration.isJsonMime(c)?"json":"blob"),this.httpClient.get(`${this.configuration.basePath}/gtex/rui_locations.jsonld`,{context:u,params:a,responseType:h,withCredentials:this.configuration.withCredentials,headers:l,observe:i,reportProgress:r})}hubmapRuiLocations(t,i="body",r=!1,s){const o=t.cache,a=t.token;let l=new Lr({encoder:this.encoder});null!=o&&(l=this.addToHttpParams(l,o,"cache")),null!=a&&(l=this.addToHttpParams(l,a,"token"));let c=this.defaultHeaders,u=s&&s.httpHeaderAccept;void 0===u&&(u=this.configuration.selectHeaderAccept(["application/json"])),void 0!==u&&(c=c.set("Accept",u));let h=s&&s.context;void 0===h&&(h=new Zs);let f="json";return u&&(f=u.startsWith("text")?"text":this.configuration.isJsonMime(u)?"json":"blob"),this.httpClient.get(`${this.configuration.basePath}/hubmap/rui_locations.jsonld`,{context:h,params:l,responseType:f,withCredentials:this.configuration.withCredentials,headers:c,observe:i,reportProgress:r})}ontologyTermOccurences(t,i="body",r=!1,s){const o=t.age,a=t.ageRange,l=t.bmi,c=t.bmiRange,u=t.cache,h=t.ontologyTerms,f=t.cellTypeTerms,g=t.providers,m=t.sex,v=t.spatial,x=t.technologies,U=t.token;let D=new Lr({encoder:this.encoder});null!=o&&(D=this.addToHttpParams(D,o,"age")),null!=a&&(D=this.addToHttpParams(D,a,"age-range")),null!=l&&(D=this.addToHttpParams(D,l,"bmi")),null!=c&&(D=this.addToHttpParams(D,c,"bmi-range")),null!=u&&(D=this.addToHttpParams(D,u,"cache")),h&&h.forEach(Ve=>{D=this.addToHttpParams(D,Ve,"ontology-terms")}),f&&f.forEach(Ve=>{D=this.addToHttpParams(D,Ve,"cell-type-terms")}),g&&g.forEach(Ve=>{D=this.addToHttpParams(D,Ve,"providers")}),null!=m&&(D=this.addToHttpParams(D,m,"sex")),v&&v.forEach(Ve=>{D=this.addToHttpParams(D,Ve,"spatial")}),x&&x.forEach(Ve=>{D=this.addToHttpParams(D,Ve,"technologies")}),null!=U&&(D=this.addToHttpParams(D,U,"token"));let ie=this.defaultHeaders,_e=s&&s.httpHeaderAccept;void 0===_e&&(_e=this.configuration.selectHeaderAccept(["application/json"])),void 0!==_e&&(ie=ie.set("Accept",_e));let Pe=s&&s.context;void 0===Pe&&(Pe=new Zs);let Ne="json";return _e&&(Ne=_e.startsWith("text")?"text":this.configuration.isJsonMime(_e)?"json":"blob"),this.httpClient.get(`${this.configuration.basePath}/ontology-term-occurences`,{context:Pe,params:D,responseType:Ne,withCredentials:this.configuration.withCredentials,headers:ie,observe:i,reportProgress:r})}ontologyTreeModel(t,i="body",r=!1,s){const o=t.cache,a=t.token;let l=new Lr({encoder:this.encoder});null!=o&&(l=this.addToHttpParams(l,o,"cache")),null!=a&&(l=this.addToHttpParams(l,a,"token"));let c=this.defaultHeaders,u=s&&s.httpHeaderAccept;void 0===u&&(u=this.configuration.selectHeaderAccept(["application/json"])),void 0!==u&&(c=c.set("Accept",u));let h=s&&s.context;void 0===h&&(h=new Zs);let f="json";return u&&(f=u.startsWith("text")?"text":this.configuration.isJsonMime(u)?"json":"blob"),this.httpClient.get(`${this.configuration.basePath}/ontology-tree-model`,{context:h,params:l,responseType:f,withCredentials:this.configuration.withCredentials,headers:c,observe:i,reportProgress:r})}providerNames(t,i="body",r=!1,s){const o=t.cache,a=t.token;let l=new Lr({encoder:this.encoder});null!=o&&(l=this.addToHttpParams(l,o,"cache")),null!=a&&(l=this.addToHttpParams(l,a,"token"));let c=this.defaultHeaders,u=s&&s.httpHeaderAccept;void 0===u&&(u=this.configuration.selectHeaderAccept(["application/json"])),void 0!==u&&(c=c.set("Accept",u));let h=s&&s.context;void 0===h&&(h=new Zs);let f="json";return u&&(f=u.startsWith("text")?"text":this.configuration.isJsonMime(u)?"json":"blob"),this.httpClient.get(`${this.configuration.basePath}/provider-names`,{context:h,params:l,responseType:f,withCredentials:this.configuration.withCredentials,headers:c,observe:i,reportProgress:r})}referenceOrganScene(t,i="body",r=!1,s){const o=t.organIri;if(null==o)throw new Error("Required parameter organIri was null or undefined when calling referenceOrganScene.");const a=t.age,l=t.ageRange,c=t.bmi,u=t.bmiRange,h=t.cache,f=t.ontologyTerms,g=t.cellTypeTerms,m=t.providers,v=t.sex,x=t.spatial,U=t.technologies,D=t.token;let ie=new Lr({encoder:this.encoder});null!=a&&(ie=this.addToHttpParams(ie,a,"age")),null!=l&&(ie=this.addToHttpParams(ie,l,"age-range")),null!=c&&(ie=this.addToHttpParams(ie,c,"bmi")),null!=u&&(ie=this.addToHttpParams(ie,u,"bmi-range")),null!=h&&(ie=this.addToHttpParams(ie,h,"cache")),f&&f.forEach(bt=>{ie=this.addToHttpParams(ie,bt,"ontology-terms")}),g&&g.forEach(bt=>{ie=this.addToHttpParams(ie,bt,"cell-type-terms")}),null!=o&&(ie=this.addToHttpParams(ie,o,"organ-iri")),m&&m.forEach(bt=>{ie=this.addToHttpParams(ie,bt,"providers")}),null!=v&&(ie=this.addToHttpParams(ie,v,"sex")),x&&x.forEach(bt=>{ie=this.addToHttpParams(ie,bt,"spatial")}),U&&U.forEach(bt=>{ie=this.addToHttpParams(ie,bt,"technologies")}),null!=D&&(ie=this.addToHttpParams(ie,D,"token"));let _e=this.defaultHeaders,Pe=s&&s.httpHeaderAccept;void 0===Pe&&(Pe=this.configuration.selectHeaderAccept(["application/json"])),void 0!==Pe&&(_e=_e.set("Accept",Pe));let Ne=s&&s.context;void 0===Ne&&(Ne=new Zs);let Ve="json";return Pe&&(Ve=Pe.startsWith("text")?"text":this.configuration.isJsonMime(Pe)?"json":"blob"),this.httpClient.get(`${this.configuration.basePath}/reference-organ-scene`,{context:Ne,params:ie,responseType:Ve,withCredentials:this.configuration.withCredentials,headers:_e,observe:i,reportProgress:r})}referenceOrgans(t,i="body",r=!1,s){const o=t.cache,a=t.token;let l=new Lr({encoder:this.encoder});null!=o&&(l=this.addToHttpParams(l,o,"cache")),null!=a&&(l=this.addToHttpParams(l,a,"token"));let c=this.defaultHeaders,u=s&&s.httpHeaderAccept;void 0===u&&(u=this.configuration.selectHeaderAccept(["application/json"])),void 0!==u&&(c=c.set("Accept",u));let h=s&&s.context;void 0===h&&(h=new Zs);let f="json";return u&&(f=u.startsWith("text")?"text":this.configuration.isJsonMime(u)?"json":"blob"),this.httpClient.get(`${this.configuration.basePath}/reference-organs`,{context:h,params:l,responseType:f,withCredentials:this.configuration.withCredentials,headers:c,observe:i,reportProgress:r})}scene(t,i="body",r=!1,s){const o=t.age,a=t.ageRange,l=t.bmi,c=t.bmiRange,u=t.cache,h=t.ontologyTerms,f=t.cellTypeTerms,g=t.providers,m=t.sex,v=t.spatial,x=t.technologies,U=t.token;let D=new Lr({encoder:this.encoder});null!=o&&(D=this.addToHttpParams(D,o,"age")),null!=a&&(D=this.addToHttpParams(D,a,"age-range")),null!=l&&(D=this.addToHttpParams(D,l,"bmi")),null!=c&&(D=this.addToHttpParams(D,c,"bmi-range")),null!=u&&(D=this.addToHttpParams(D,u,"cache")),h&&h.forEach(Ve=>{D=this.addToHttpParams(D,Ve,"ontology-terms")}),f&&f.forEach(Ve=>{D=this.addToHttpParams(D,Ve,"cell-type-terms")}),g&&g.forEach(Ve=>{D=this.addToHttpParams(D,Ve,"providers")}),null!=m&&(D=this.addToHttpParams(D,m,"sex")),v&&v.forEach(Ve=>{D=this.addToHttpParams(D,Ve,"spatial")}),x&&x.forEach(Ve=>{D=this.addToHttpParams(D,Ve,"technologies")}),null!=U&&(D=this.addToHttpParams(D,U,"token"));let ie=this.defaultHeaders,_e=s&&s.httpHeaderAccept;void 0===_e&&(_e=this.configuration.selectHeaderAccept(["application/json"])),void 0!==_e&&(ie=ie.set("Accept",_e));let Pe=s&&s.context;void 0===Pe&&(Pe=new Zs);let Ne="json";return _e&&(Ne=_e.startsWith("text")?"text":this.configuration.isJsonMime(_e)?"json":"blob"),this.httpClient.get(`${this.configuration.basePath}/scene`,{context:Pe,params:D,responseType:Ne,withCredentials:this.configuration.withCredentials,headers:ie,observe:i,reportProgress:r})}sparql(t,i="body",r=!1,s){const o=t.query;if(null==o)throw new Error("Required parameter query was null or undefined when calling sparql.");const a=t.token,l=t.format;let c=new Lr({encoder:this.encoder});null!=o&&(c=this.addToHttpParams(c,o,"query")),null!=a&&(c=this.addToHttpParams(c,a,"token")),null!=l&&(c=this.addToHttpParams(c,l,"format"));let u=this.defaultHeaders,h=s&&s.httpHeaderAccept;void 0===h&&(h=this.configuration.selectHeaderAccept(["application/json"])),void 0!==h&&(u=u.set("Accept",h));let f=s&&s.context;void 0===f&&(f=new Zs);let g="json";return h&&(g=h.startsWith("text")?"text":this.configuration.isJsonMime(h)?"json":"blob"),this.httpClient.get(`${this.configuration.basePath}/sparql`,{context:f,params:c,responseType:g,withCredentials:this.configuration.withCredentials,headers:u,observe:i,reportProgress:r})}sparqlPost(t,i="body",r=!1,s){const o=t.sparqlQueryRequest;if(null==o)throw new Error("Required parameter sparqlQueryRequest was null or undefined when calling sparqlPost.");const a=t.token,l=t.format;let c=new Lr({encoder:this.encoder});null!=a&&(c=this.addToHttpParams(c,a,"token")),null!=l&&(c=this.addToHttpParams(c,l,"format"));let u=this.defaultHeaders,h=s&&s.httpHeaderAccept;void 0===h&&(h=this.configuration.selectHeaderAccept(["application/json"])),void 0!==h&&(u=u.set("Accept",h));let f=s&&s.context;void 0===f&&(f=new Zs);const m=this.configuration.selectHeaderContentType(["application/json","application/x-www-form-urlencoded"]);void 0!==m&&(u=u.set("Content-Type",m));let v="json";return h&&(v=h.startsWith("text")?"text":this.configuration.isJsonMime(h)?"json":"blob"),this.httpClient.post(`${this.configuration.basePath}/sparql`,o,{context:f,params:c,responseType:v,withCredentials:this.configuration.withCredentials,headers:u,observe:i,reportProgress:r})}technologyNames(t,i="body",r=!1,s){const o=t.cache,a=t.token;let l=new Lr({encoder:this.encoder});null!=o&&(l=this.addToHttpParams(l,o,"cache")),null!=a&&(l=this.addToHttpParams(l,a,"token"));let c=this.defaultHeaders,u=s&&s.httpHeaderAccept;void 0===u&&(u=this.configuration.selectHeaderAccept(["application/json"])),void 0!==u&&(c=c.set("Accept",u));let h=s&&s.context;void 0===h&&(h=new Zs);let f="json";return u&&(f=u.startsWith("text")?"text":this.configuration.isJsonMime(u)?"json":"blob"),this.httpClient.get(`${this.configuration.basePath}/technology-names`,{context:h,params:l,responseType:f,withCredentials:this.configuration.withCredentials,headers:c,observe:i,reportProgress:r})}tissueBlocks(t,i="body",r=!1,s){const o=t.age,a=t.ageRange,l=t.bmi,c=t.bmiRange,u=t.cache,h=t.ontologyTerms,f=t.cellTypeTerms,g=t.providers,m=t.sex,v=t.spatial,x=t.technologies,U=t.token;let D=new Lr({encoder:this.encoder});null!=o&&(D=this.addToHttpParams(D,o,"age")),null!=a&&(D=this.addToHttpParams(D,a,"age-range")),null!=l&&(D=this.addToHttpParams(D,l,"bmi")),null!=c&&(D=this.addToHttpParams(D,c,"bmi-range")),null!=u&&(D=this.addToHttpParams(D,u,"cache")),h&&h.forEach(Ve=>{D=this.addToHttpParams(D,Ve,"ontology-terms")}),f&&f.forEach(Ve=>{D=this.addToHttpParams(D,Ve,"cell-type-terms")}),g&&g.forEach(Ve=>{D=this.addToHttpParams(D,Ve,"providers")}),null!=m&&(D=this.addToHttpParams(D,m,"sex")),v&&v.forEach(Ve=>{D=this.addToHttpParams(D,Ve,"spatial")}),x&&x.forEach(Ve=>{D=this.addToHttpParams(D,Ve,"technologies")}),null!=U&&(D=this.addToHttpParams(D,U,"token"));let ie=this.defaultHeaders,_e=s&&s.httpHeaderAccept;void 0===_e&&(_e=this.configuration.selectHeaderAccept(["application/json"])),void 0!==_e&&(ie=ie.set("Accept",_e));let Pe=s&&s.context;void 0===Pe&&(Pe=new Zs);let Ne="json";return _e&&(Ne=_e.startsWith("text")?"text":this.configuration.isJsonMime(_e)?"json":"blob"),this.httpClient.get(`${this.configuration.basePath}/tissue-blocks`,{context:Pe,params:D,responseType:Ne,withCredentials:this.configuration.withCredentials,headers:ie,observe:i,reportProgress:r})}}return n.\u0275fac=function(t){return new(t||n)(Ie(_u),Ie(C9,8),Ie(Yb,8))},n.\u0275prov=We({factory:function(){return new n(Ie(_u),Ie(C9,8),Ie(Yb,8))},token:n,providedIn:"root"}),n})(),pRe=(()=>{class n{constructor(t,i){if(t)throw new Error("CcfApiModule is already loaded. Import in your base AppModule only.");if(!i)throw new Error("You need to import the HttpClientModule in your AppModule! \nSee also https://github.com/angular/angular/issues/20575")}static forRoot(t){return{ngModule:n,providers:[{provide:Yb,useFactory:t}]}}}return n.\u0275fac=function(t){return new(t||n)(Ie(n,12),Ie(_u,8))},n.\u0275mod=tn({type:n}),n.\u0275inj=St({providers:[],imports:[[]]}),n})();function vu(n){return new Promise((e,t)=>{n.oncomplete=n.onsuccess=()=>e(n.result),n.onabort=n.onerror=()=>t(n.error)})}let Ak;function Cc(){return Ak||(Ak=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),vu(i)});return(i,r)=>t.then(s=>r(s.transaction(e,i).objectStore(e)))}(0,"keyval")),Ak}function A9(n,e=Cc()){return e("readonly",t=>vu(t.get(n)))}var Un=et(1440);const a1="Unknown Euler angle order",Hm=.99999;class Zi extends mx{static get ZYX(){return 0}static get YXZ(){return 1}static get XZY(){return 2}static get ZXY(){return 3}static get YZX(){return 4}static get XYZ(){return 5}static get RollPitchYaw(){return 0}static get DefaultOrder(){return Zi.ZYX}static get RotationOrders(){return["ZYX","YXZ","XZY","ZXY","YZX","XYZ"]}static rotationOrder(e){return Zi.RotationOrders[e]}get ELEMENTS(){return 4}constructor(e=0,t=0,i=0,r=Zi.DefaultOrder){super(-0,-0,-0,-0),arguments.length>0&&Array.isArray(arguments[0])?this.fromVector3(...arguments):this.set(e,t,i,r)}fromQuaternion(e){const[t,i,r,s]=e,o=i*i,a=-2*(o+r*r)+1,l=2*(t*i+s*r);let c=-2*(t*r-s*i);c=c>1?1:c,c=c<-1?-1:c;const f=Math.atan2(2*(i*r+s*t),-2*(t*t+o)+1),g=Math.asin(c),m=Math.atan2(l,a);return new Zi(f,g,m,Zi.RollPitchYaw)}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=Number.isFinite(e[3])||this.order,this.check()}set(e=0,t=0,i=0,r){return this[0]=e,this[1]=t,this[2]=i,this[3]=Number.isFinite(r)?r:this[3],this.check()}validate(){return function(n){return n>=0&&n<6}(this[3])&&Number.isFinite(this[0])&&Number.isFinite(this[1])&&Number.isFinite(this[2])}toArray(e=[],t=0){return e[t]=this[0],e[t+1]=this[1],e[t+2]=this[2],e}toArray4(e=[],t=0){return e[t]=this[0],e[t+1]=this[1],e[t+2]=this[2],e[t+3]=this[3],e}toVector3(e=[-0,-0,-0]){return e[0]=this[0],e[1]=this[1],e[2]=this[2],e}get x(){return this[0]}set x(e){this[0]=nr(e)}get y(){return this[1]}set y(e){this[1]=nr(e)}get z(){return this[2]}set z(e){this[2]=nr(e)}get alpha(){return this[0]}set alpha(e){this[0]=nr(e)}get beta(){return this[1]}set beta(e){this[1]=nr(e)}get gamma(){return this[2]}set gamma(e){this[2]=nr(e)}get phi(){return this[0]}set phi(e){this[0]=nr(e)}get theta(){return this[1]}set theta(e){this[1]=nr(e)}get psi(){return this[2]}set psi(e){this[2]=nr(e)}get roll(){return this[0]}set roll(e){this[0]=nr(e)}get pitch(){return this[1]}set pitch(e){this[1]=nr(e)}get yaw(){return this[2]}set yaw(e){this[2]=nr(e)}get order(){return this[3]}set order(e){this[3]=function(n){if(n<0&&n>=6)throw new Error(a1);return n}(e)}fromVector3(e,t){return this.set(e[0],e[1],e[2],Number.isFinite(t)?t:this[3])}fromArray(e,t=0){return this[0]=e[0+t],this[1]=e[1+t],this[2]=e[2+t],void 0!==e[3]&&(this[3]=e[3]),this.check()}fromRollPitchYaw(e,t,i){return this.set(e,t,i,Zi.ZYX)}fromRotationMatrix(e,t=Zi.DefaultOrder){return this._fromRotationMatrix(e,t),this.check()}getRotationMatrix(e){return this._getRotationMatrix(e)}getQuaternion(){const e=new mR;switch(this[4]){case Zi.XYZ:return e.rotateX(this[0]).rotateY(this[1]).rotateZ(this[2]);case Zi.YXZ:return e.rotateY(this[0]).rotateX(this[1]).rotateZ(this[2]);case Zi.ZXY:return e.rotateZ(this[0]).rotateX(this[1]).rotateY(this[2]);case Zi.ZYX:return e.rotateZ(this[0]).rotateY(this[1]).rotateX(this[2]);case Zi.YZX:return e.rotateY(this[0]).rotateZ(this[1]).rotateX(this[2]);case Zi.XZY:return e.rotateX(this[0]).rotateZ(this[1]).rotateY(this[2]);default:throw new Error(a1)}}_fromRotationMatrix(e,t=Zi.DefaultOrder){const i=e.elements,r=i[0],s=i[4],o=i[8],a=i[1],l=i[5],c=i[9],u=i[2],h=i[6],f=i[10];switch(t=t||this[3]){case Zi.XYZ:this[1]=Math.asin(Ua(o,-1,1)),Math.abs(o)1&&void 0!==arguments[1]?arguments[1]:0,t=(co[n[e+0]]+co[n[e+1]]+co[n[e+2]]+co[n[e+3]]+"-"+co[n[e+4]]+co[n[e+5]]+"-"+co[n[e+6]]+co[n[e+7]]+"-"+co[n[e+8]]+co[n[e+9]]+"-"+co[n[e+10]]+co[n[e+11]]+co[n[e+12]]+co[n[e+13]]+co[n[e+14]]+co[n[e+15]]).toLowerCase();if(!DRe(t))throw TypeError("Stringified UUID is invalid");return t}(i)};var c1=et(1609);const Gm=Object.freeze({OUTSIDE:-1,INTERSECTING:0,INSIDE:1}),Rr=(Math,Math,{});function LRe(n,{precision:e=Rr.precision||4}={}){return n=function(n){return Math.round(n/Rr.EPSILON)*Rr.EPSILON}(n),"".concat(parseFloat(n.toPrecision(e)))}function Mh(n){return Array.isArray(n)||ArrayBuffer.isView(n)&&!(n instanceof DataView)}function Xb(n,e,t){const i=Rr.EPSILON;t&&(Rr.EPSILON=t);try{if(n===e)return!0;if(Mh(n)&&Mh(e)){if(n.length!==e.length)return!1;for(let r=0;r0?", ":"")+LRe(this[i],e);return"".concat(e.printTypes?this.constructor.name:"","[").concat(t,"]")}equals(e){if(!e||this.length!==e.length)return!1;for(let t=0;t=0&&e=0&&e=a+s)return this.clone();if(s>=a+i)return e.clone();const l=.5*(i+a+s);return P9.copy(o).scale((-i+l)/a).add(t),this.center.copy(P9),this.radius=l,this}expand(e){const t=(e=Kb.from(e)).subtract(this.center).magnitude();return t>this.radius&&(this.radius=t),this}transform(e){this.center.transform(e);const t=function(n,e){var s=e[4],o=e[5],a=e[6],l=e[8],c=e[9],u=e[10];return n[0]=Math.hypot(e[0],e[1],e[2]),n[1]=Math.hypot(s,o,a),n[2]=Math.hypot(l,c,u),n}(Kb,e);return this.radius=Math.max(t[0],Math.max(t[1],t[2]))*this.radius,this}distanceSquaredTo(e){const t=this.distanceTo(e);return t*t}distanceTo(e){const t=(e=Kb.from(e)).subtract(this.center);return Math.max(0,t.len()-this.radius)}intersectPlane(e){const i=this.radius,s=e.normal.dot(this.center)+e.distance;return s<-i?Gm.OUTSIDE:s0?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 sH(this,this,e),this.check()}rotateY(e){return oH(this,this,e),this.check()}rotateZ(e){return aH(this,this,e),this.check()}scale(e){return pR(this,this,e),this.check()}slerp(e,t,i){switch(arguments.length){case 1:({start:e=JRe,target:t,ratio:i}=arguments[0]);break;case 2:[t,i]=arguments,e=this}return nb(this,e,t,i),this.check()}transformVector4(e,t=e){return OU(t,e,this),M9(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)}}const ePe=new Pn,tPe=new Pn,u1=new Pn,d1=new Pn,h1=new Pn,nPe=new Pn,iPe=new Pn;class Nk{constructor(e=[0,0,0],t=[0,0,0,0,0,0,0,0,0]){this.center=(new Pn).from(e),this.halfAxes=new Zo(t)}get halfSize(){const e=this.halfAxes.getColumn(0),t=this.halfAxes.getColumn(1),i=this.halfAxes.getColumn(2);return[new Pn(e).len(),new Pn(t).len(),new Pn(i).len()]}get quaternion(){const e=this.halfAxes.getColumn(0),t=this.halfAxes.getColumn(1),i=this.halfAxes.getColumn(2),r=new Pn(e).normalize(),s=new Pn(t).normalize(),o=new Pn(i).normalize();return(new k9).fromMatrix3(new Zo([...r,...s,...o]))}fromCenterHalfSizeQuaternion(e,t,i){const r=new k9(i),s=(new Zo).fromQuaternion(r);return s[0]=s[0]*t[0],s[1]=s[1]*t[0],s[2]=s[2]*t[0],s[3]=s[3]*t[1],s[4]=s[4]*t[1],s[5]=s[5]*t[1],s[6]=s[6]*t[2],s[7]=s[7]*t[2],s[8]=s[8]*t[2],this.center=(new Pn).from(e),this.halfAxes=s,this}clone(){return new Nk(this.center,this.halfAxes)}equals(e){return this===e||Boolean(e)&&this.center.equals(e.center)&&this.halfAxes.equals(e.halfAxes)}getBoundingSphere(e=new Pk){const t=this.halfAxes,i=t.getColumn(0,u1),r=t.getColumn(1,d1),s=t.getColumn(2,h1),o=ePe.copy(i).add(r).add(s);return e.center.copy(this.center),e.radius=o.magnitude(),e}intersectPlane(e){const t=this.center,i=e.normal,r=this.halfAxes,s=i.x,o=i.y,a=i.z,l=Math.abs(s*r[0]+o*r[1]+a*r[2])+Math.abs(s*r[3]+o*r[4]+a*r[5])+Math.abs(s*r[6]+o*r[7]+a*r[8]),c=i.dot(t)+e.distance;return c<=-l?Gm.OUTSIDE:c>=l?Gm.INSIDE:Gm.INTERSECTING}distanceTo(e){return Math.sqrt(this.distanceSquaredTo(e))}distanceSquaredTo(e){const t=tPe.from(e).subtract(this.center),i=this.halfAxes,r=i.getColumn(0,u1),s=i.getColumn(1,d1),o=i.getColumn(2,h1),a=r.magnitude(),l=s.magnitude(),c=o.magnitude();r.normalize(),s.normalize(),o.normalize();let h,u=0;return h=Math.abs(t.dot(r))-a,h>0&&(u+=h*h),h=Math.abs(t.dot(s))-l,h>0&&(u+=h*h),h=Math.abs(t.dot(o))-c,h>0&&(u+=h*h),u}computePlaneDistances(e,t,i=[-0,-0]){let r=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY;const o=this.center,a=this.halfAxes,l=a.getColumn(0,u1),c=a.getColumn(1,d1),u=a.getColumn(2,h1),h=nPe.copy(l).add(c).add(u).add(o),f=iPe.copy(h).subtract(e);let g=t.dot(f);return r=Math.min(g,r),s=Math.max(g,s),h.copy(o).add(l).add(c).subtract(u),f.copy(h).subtract(e),g=t.dot(f),r=Math.min(g,r),s=Math.max(g,s),h.copy(o).add(l).subtract(c).add(u),f.copy(h).subtract(e),g=t.dot(f),r=Math.min(g,r),s=Math.max(g,s),h.copy(o).add(l).subtract(c).subtract(u),f.copy(h).subtract(e),g=t.dot(f),r=Math.min(g,r),s=Math.max(g,s),o.copy(h).subtract(l).add(c).add(u),f.copy(h).subtract(e),g=t.dot(f),r=Math.min(g,r),s=Math.max(g,s),o.copy(h).subtract(l).add(c).subtract(u),f.copy(h).subtract(e),g=t.dot(f),r=Math.min(g,r),s=Math.max(g,s),o.copy(h).subtract(l).subtract(c).add(u),f.copy(h).subtract(e),g=t.dot(f),r=Math.min(g,r),s=Math.max(g,s),o.copy(h).subtract(l).subtract(c).subtract(u),f.copy(h).subtract(e),g=t.dot(f),r=Math.min(g,r),s=Math.max(g,s),i[0]=r,i[1]=s,i}transform(e){this.center.transformAsPoint(e);const t=this.halfAxes.getColumn(0,u1);t.transformAsPoint(e);const i=this.halfAxes.getColumn(1,d1);i.transformAsPoint(e);const r=this.halfAxes.getColumn(2,h1);return r.transformAsPoint(e),this.halfAxes=new Zo([...t,...i,...r]),this}getTransform(){throw new Error("not implemented")}}const F9=new Pn,L9=new Pn;class kk{constructor(e=[0,0,1],t=0){this.normal=new Pn,this.distance=-0,this.fromNormalDistance(e,t)}fromNormalDistance(e,t){return Tc(Number.isFinite(t)),this.normal.from(e).normalize(),this.distance=t,this}fromPointNormal(e,t){e=F9.from(e),this.normal.from(t).normalize();const i=-this.normal.dot(e);return this.distance=i,this}fromCoefficients(e,t,i,r){return this.normal.set(e,t,i),Tc(Xb(this.normal.len(),1)),this.distance=r,this}clone(e){return new kk(this.normal,this.distance)}equals(e){return Xb(this.distance,e.distance)&&Xb(this.normal,e.normal)}getPointDistance(e){return this.normal.dot(e)+this.distance}transform(e){const t=L9.copy(this.normal).transformAsVector(e).normalize(),i=this.normal.scale(-this.distance).transform(e);return this.fromPointNormal(i,t)}projectPointOntoPlane(e,t=[0,0,0]){e=F9.from(e);const i=this.getPointDistance(e),r=L9.copy(this.normal).scale(i);return e.subtract(r).to(t)}}function*Uk(n,e,t){for(const[i,r]of Object.entries(t))for(const s of(0,Un.readQuads)(n,e,i,null,null)){const o="Literal"===s.object.termType?(0,c1.fromRdf)(s.object):s.object.id;yield[r,o]}}function dp(n,e,t,i){const r={"@id":e,"@type":t};for(const[s,o]of Object.entries(i))for(const a of(0,Un.readQuads)(n,r["@id"],s,null,null)){const l="Literal"===a.object.termType?(0,c1.fromRdf)(a.object):a.object.id;r[o]=l}return r}new Pn([1,0,0]),new Pn([0,1,0]),new Pn([0,0,1]),new Pn,new Pn,new kk(new Pn(1,0,0),0),new Pn,new Pn,new Pn,new Pn,new Pn,new Pn,new Pn,new Pn,new Pn,new Pn,new Pn,new Pn,new Pn,new Pn,new Pn,new Pn,new Pn,Math,new Zo,new Zo,new Zo,new Zo,new Zo,new Pn,new Pn,new Pn,new Pn,new Pn,new Zo,new Zo,new Zo;const ir=Un.Util.prefixes({base:"http://purl.org/ccf/latest/ccf.owl#",ccf:"http://purl.org/ccf/",fma:"http://purl.org/sig/ont/fma/fma",obo:"http://purl.obolibrary.org/obo/",uberon:"http://purl.obolibrary.org/obo/UBERON_",cl:"http://purl.obolibrary.org/obo/CL_",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/",dcterms:"http://purl.org/dc/terms/"},Un.DataFactory),U9={x:ir("rdf"),type:ir("rdf")("type")},dn=(ir("rdfs"),ir("rdfs")("label"),ir("rdfs")("comment"),ir("rdfs")("isDefinedBy"),ir("rdfs")("seeAlso"),ir("ccf")),vi={id:ir("ccf")("has_registration_location"),label:ir("rdfs")("label"),description:ir("rdfs")("comment"),link:dn("url"),sex:dn("sex"),age:dn("age"),bmi:dn("bmi"),Male:Un.DataFactory.literal("Male"),Female:Un.DataFactory.literal("Female"),consortiumName:dn("consortium_name"),providerName:dn("tissue_provider_name"),providerUUID:dn("tissue_provider_uuid"),donor:dn("comes_from"),sections:dn("subdivided_into_sections"),datasets:dn("generates_dataset"),sampleType:dn("sample_type"),TissueBlock:Un.DataFactory.literal("Tissue Block"),TissueSection:Un.DataFactory.literal("Tissue Section"),NonStandard:Un.DataFactory.literal("Non-standard"),sectionCount:dn("section_count"),sectionSize:dn("section_size"),sectionUnits:dn("section_size_unit"),sectionNumber:dn("section_number"),spatialEntity:dn("has_registration_location"),ontologyTerms:dn("has_ontology_term"),cellTypeTerms:dn("has_cell_type_term"),technology:dn("technology"),thumbnail:dn("thumbnail")},ki={x:dn,base:ir("base"),ontologyNode:{label:dn("ccf_pref_label"),parent:dn("ccf_part_of"),children:dn("ccf_part_of"),rui_rank:dn("rui_rank"),synonymLabels:Un.DataFactory.namedNode("http://www.geneontology.org/formats/oboInOwl#hasExactSynonym")},asctb:{part_of:dn("ccf_part_of"),ct_is_a:dn("ccf_ct_isa"),located_in:dn("ccf_located_in"),characterizes:dn("ccf_characterizes")},spatial:{Female:ir("base")("VHFemale"),Male:ir("base")("VHMale"),BothSexes:ir("base")("VHBothSexes"),FemaleOrgans:ir("base")("VHFemaleOrgans"),MaleOrgans:ir("base")("VHMaleOrgans")},SpatialObjectReference:dn("spatial_object_reference"),SpatialEntity:dn("spatial_entity"),SpatialPlacement:dn("spatial_placement"),spatialObjectReference:{file:dn("file_url"),file_format:dn("file_format"),file_subpath:dn("file_subpath")},extractionSet:{label:ir("rdfs")("label"),rui_rank:dn("rui_rank")},spatialEntity:{label:ir("rdfs")("label"),description:ir("rdfs")("comment"),creator:ir("dcterms")("creator"),creator_first_name:dn("creator_first_name"),creator_last_name:dn("creator_last_name"),creator_orcid:dn("creator_orcid"),creation_date:ir("dcterms")("created"),updated_date:dn("updated_date"),ccf_annotations:dn("collides_with"),representation_of:dn("representation_of"),reference_organ:dn("has_reference_organ"),extraction_set_for:dn("extraction_set_for"),extraction_set:dn("has_extraction_set"),sex:dn("organ_owner_sex"),side:dn("organ_side"),rui_rank:dn("rui_rank"),slice_thickness:dn("slice_thickness"),slice_count:dn("slice_count"),x_dimension:dn("x_dimension"),y_dimension:dn("y_dimension"),z_dimension:dn("z_dimension"),dimension_units:dn("dimension_unit"),object:dn("has_object_reference")},spatialPlacement:{source:dn("placement_for"),target:dn("placement_relative_to"),placement_date:ir("dcterms")("created"),x_scaling:dn("x_scaling"),y_scaling:dn("y_scaling"),z_scaling:dn("z_scaling"),scaling_units:dn("scaling_unit"),x_rotation:dn("x_rotation"),y_rotation:dn("y_rotation"),z_rotation:dn("z_rotation"),w_rotation:dn("theta_rotation"),rotation_order:dn("rotation_order"),rotation_units:dn("rotation_unit"),x_translation:dn("x_translation"),y_translation:dn("y_translation"),z_translation:dn("z_translation"),translation_units:dn("translation_unit")}},di={x:ir("uberon"),body:ir("uberon")("0013702")},NPe={x:ir("cl"),cell:ir("cl")("0000000")},Zb={x:ir("fma")},vd=(ir("lmha"),{body:di.body,cell:NPe.cell,respiratory_system:di.x("0001004"),colon:di.x("0001155"),left_lung:di.x("0002168"),right_lung:di.x("0002167"),left_bronchus:di.x("0002178"),right_bronchus:di.x("0002177"),kidney:di.x("0002113"),ureter:di.x("0000056"),eye:di.x("0000970"),fallopian_tube:di.x("0003889"),knee:di.x("0001465"),ovary:di.x("0000992"),trachea:di.x("0003126"),aorta:di.x("0000947"),blood:di.x("0000178"),bone_marrow:di.x("0002371"),male_reproductive_system:di.x("0000079"),lymph_node:di.x("0000029"),blood_vasculature:di.x("0004537"),brain:di.x("0000955"),eye_left:di.x("0004548"),eye_right:Zb.x("54449"),fallopian_tube_left:di.x("0001303"),fallopian_tube_right:di.x("0001302"),heart:di.x("0000948"),kidney_left:di.x("0004538"),kidney_right:di.x("0004539"),knee_left:Zb.x("24978"),knee_right:Zb.x("24977"),large_intestine:di.x("0000059"),liver:di.x("0002107"),lungs:di.x("0002048"),mesenteric_lymph_node:di.x("0002509"),ovary_left:Zb.x("7214"),ovary_right:Zb.x("7213"),pancreas:di.x("0001264"),pelvis:di.x("0001270"),prostate_gland:di.x("0002367"),skin:di.x("0002097"),small_intestine:di.x("0002108"),spleen:di.x("0002106"),thymus:di.x("0002370"),ureter_left:di.x("0001223"),ureter_right:di.x("0001222"),urinary_bladder:di.x("0001255"),uterus:di.x("0000995")});function zk(n){const e={};return Object.entries(n).forEach(([t,i])=>{e[i.id]=t}),e}const p1={spatialObjectReference:zk(ki.spatialObjectReference),spatialEntity:zk(ki.spatialEntity),spatialPlacement:zk(ki.spatialPlacement)};function z9(n,e){const t=dp(n,e,"ExtractionSet",p1.spatialEntity);return t.extractionSites=(0,mr.sortBy)(n.getSubjects(ki.spatialEntity.extraction_set,e,null).map(i=>hp(n,i.id)),["rui_rank"]),t}function hp(n,e){const t=dp(n,e,"SpatialEntity",p1.spatialEntity);return t.object&&(t.object=function(n,e){return dp(n,e,"SpatialObjectReference",p1.spatialObjectReference)}(n,t.object)),t.ccf_annotations&&(t.ccf_annotations=n.getObjects(e,ki.spatialEntity.ccf_annotations,null).map(i=>i.id)),n.forSubjects(i=>t.entityId=i.id,vi.spatialEntity,e,null),t}function VPe(n,e){const t=dp(n,e,"SpatialPlacement",p1.spatialPlacement);return t.source&&(t.source=hp(n,t.source)),t.target&&(t.target=hp(n,t.target)),t}function H9(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(_j),o=[t.x_scaling,t.y_scaling,t.z_scaling];return n.translate(r).rotateXYZ(s).scale(o)}class G9{constructor(e){this.db=e,this.createGraph()}createGraph(){this.graph=new ERe.DirectedGraph;const e=this.db.store;e.forSubjects(i=>{this.addNode(i.id,"SpatialObjectReference")},U9.type,ki.SpatialObjectReference,null),e.forSubjects(i=>{this.addNode(i.id,"SpatialEntity")},U9.type,ki.SpatialEntity,null);const t={};for(const i of(0,Un.readQuads)(e,null,ki.spatialPlacement.source,null,null))t[i.subject.id]=i.object.id;for(const i of(0,Un.readQuads)(e,null,ki.spatialPlacement.target,null,null)){const r=t[i.subject.id];r&&this.addEdge(i.subject.id,r,i.object.id,"SpatialPlacement")}}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 qn(qn.IDENTITY);if(!this.graph.hasNode(e)||!this.graph.hasNode(t))return;const i=this.db.store,r=new qn(qn.IDENTITY),s=SRe()(this.graph,e,t);if(s&&s.length>0){s.reverse();let o="";for(const a of s)o&&H9(r,VPe(i,this.graph.getEdgeAttribute(a,o,"id"))),o=a;return r}}getSpatialPlacement(e,t){const i=this.graph.hasNode(e["@id"])?e["@id"]:void 0,r=(0,mr.get)(e,"placement[0]",(0,mr.get)(e,"placement",void 0));let s;if(r&&this.graph.hasNode(r.target)?(s=this.getTransformationMatrix(r.target,t),s&&(s=H9(s,r))):i&&(s=this.getTransformationMatrix(i,t)),s){const o=(new Zi).fromRotationMatrix(s,Zi.XYZ),a=s.getTranslation().map(u=>1e3*u),l=o.toVector3().map(dse),c=s.getScale().map(u=>u<1&&u>.999999?1:u);return{"@context":"https://hubmapconsortium.github.io/hubmap-ontology/ccf-context.jsonld","@id":`http://purl.org/ccf/1.5/${PRe()}_placement`,"@type":"SpatialPlacement",source:e["@id"],target:t,placement_date:(new Date).toISOString().split("T")[0],x_scaling:c[0],y_scaling:c[1],z_scaling:c[2],scaling_units:"ratio",x_rotation:l[0],y_rotation:l[1],z_rotation:l[2],rotation_order:"XYZ",rotation_units:"degree",x_translation:a[0],y_translation:a[1],z_translation:a[2],translation_units:"millimeter"}}}}class $9{constructor(e){this.db=e}getSpatialEntity(e){return hp(this.db.store,e)}getExtractionSets(e){return function(n,e){return(0,mr.sortBy)(n.getSubjects(ki.spatialEntity.extraction_set_for,e,null).map(t=>z9(n,t.id)),["rui_rank"])}(this.db.store,e)}getExtractionSet(e){return z9(this.db.store,e)}getAnatomicalStructures(e){return function(n,e){return(0,mr.sortBy)(n.getSubjects(ki.spatialEntity.reference_organ,e,null).map(t=>hp(n,t.id)).filter(t=>t["@id"]!==e),["rui_rank"])}(this.db.store,e)}getReferenceOrgans(){return function(n){const e=[];return n.forEach(t=>{t.subject.id===t.object.id&&e.push(hp(n,t.subject.id))},null,ki.spatialEntity.reference_organ,null,null),(0,mr.sortBy)(e,["rui_rank"])}(this.db.store)}getReferenceBody(e){let t;switch(null==e?void 0:e.sex){case"Male":t=ki.spatial.Male.id;break;case"Female":t=ki.spatial.Female.id;break;case"Both":default:t=ki.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),i=[];let r=[...this.getReferenceOrganSets(e).map(s=>{const o="http://purl.obolibrary.org/obo/UBERON_0002097"===s.representation_of,a=this.getSceneNode(s,t,{color:[255,255,255,255],opacity:o?.5:.2,unpickable:!0,_lighting:"pbr",zoomBasedOpacity:!o});return o&&a?void i.push(a):a})];return i.length>0&&(r=[...i,...r]),(null==e?void 0:e.debug)&&(r=r.concat([this.getSceneNode(this.getSpatialEntity(ki.base("VHRightKidney").id),t,{color:[0,0,255,127.5],geometry:"wireframe"}),this.getSceneNode(this.getSpatialEntity(ki.base("VHLeftKidney").id),t,{color:[255,0,0,127.5],geometry:"wireframe"}),this.getSceneNode(this.getSpatialEntity(ki.base("VHSpleenCC1").id),t,{color:[0,255,0,127.5],geometry:"wireframe"}),this.getSceneNode(this.getSpatialEntity(ki.base("VHSpleenCC2").id),t,{color:[0,255,0,127.5],geometry:"wireframe"}),this.getSceneNode(this.getSpatialEntity(ki.base("VHSpleenCC3").id),t,{color:[0,255,0,127.5],geometry:"wireframe"})])),r.filter(s=>void 0!==s)}getReferenceOrganScene(e,t){var i,r;const s=void 0!==(null==t?void 0:t.sex)&&"both"!==(null===(i=null==t?void 0:t.sex)||void 0===i?void 0:i.toLowerCase()),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"}),u=(null!==(r=this.db.getSpatialEntities(t))&&void 0!==r?r:[]).map(h=>this.getSceneNode(h,a,{color:[255,255,255,229.5]}));return[c].concat(u).filter(h=>void 0!==h)}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 u=this.db.graph.getTransformationMatrix(l&&e.object?e.object["@id"]:e["@id"],t["@id"]);if(u){if(l)u=new qn(qn.IDENTITY).rotateX(_j(90)).multiplyLeft(u);else{let h;switch(e.dimension_units){case"centimeter":h=.01;break;case"millimeter":h=.001;break;case"meter":default:h=1}const f=[e.x_dimension,e.y_dimension,e.z_dimension].map(g=>g*h/2);u.scale(f)}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:u,tooltip:e.label},i)}}getScene(e){return[...this.getReferenceSceneNodes(e),...this.getEntitySceneNodes(e)]}}const g1="https://entity.api.hubmapconsortium.org/entities/",W9=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"]),UPe={"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"},qm={"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","5c106f29-ea2d-11e9-85e8-0efb3ba9a670":"RTI-General Electric","301615f9-c870-11eb-a8dc-35ce3d8786fe":"TMC-UConn"},q9={"@base":"http://purl.org/ccf/latest/ccf-entity.owl#","@vocab":"http://purl.org/ccf/latest/ccf-entity.owl#",ccf:"http://purl.org/ccf/",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"},cellTypeTerms:{"@id":"has_cell_type_term","@type":"@id"},thumbnail:{"@id":"has_thumbnail"}};class GPe{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||[],u=(this.data.ancestors||[]).find(Ne=>"Donor"===Ne.entity_type);this.donor=this.getDonor(u,i);const h=this.getRuiLocation(e,this.donor);h?this.rui_location=h:this.bad=!0,qm[e.group_uuid]||(qm[e.group_uuid]=e.group_name);const f=new Date(e.last_modified_timestamp).toLocaleDateString(),g=qm[e.group_uuid]||e.group_name,m=e.created_by_user_displayname;this["@id"]=g1+e.uuid,this.label=`Registered ${f}, ${m}, ${g}`,this.link=`${i}browse/sample/${e.uuid}`;const v={},x=[];this.sections=x;const U=[];this.datasets=U;for(const Ne of c.filter(Ve=>"Sample"===Ve.entity_type)){const Ve=this.getSection(Ne,e,i);v[Ne.submission_id]=Ve,x.push(Ve),Ve.section_number=null!==(s=Ve.section_number)&&void 0!==s?s:x.length}for(const Ne of c)if("Dataset"===Ne.entity_type){const Ve=this.getDataset(Ne,t,i,r),bt=(0,mr.get)(Ne,["ingest_metadata","metadata","tissue_id"]);v[bt]?null===(o=v[bt].datasets)||void 0===o||o.push(Ve):U.push(Ve)}const D=null!=h?h:{},ie=`${D.x_dimension} x ${D.y_dimension} x ${D.z_dimension} ${D.dimension_units}`;this.section_count=D.slice_count||x.length;const _e=parseFloat((D.slice_thickness||(D.z_dimension||0)/Math.max(this.section_count,1)).toFixed(1));this.section_size=_e;const Pe=D.dimension_units||"millimeter";this.section_units=Pe,this.description=`${ie}, ${_e} ${Pe}, ${e.specimen_type}, ${this.section_count} Sections`,x.forEach((Ne,Ve)=>{Ne.description=`${D.x_dimension} x ${D.y_dimension} x ${_e} ${Pe}, ${_e} ${Pe}, ${Ne.description}`,Ne.section_number=Ve+1})}getSection(e,t,i){const r=new Date(e.last_modified_timestamp).toLocaleDateString();return{"@id":g1+e.uuid,"@type":"Sample",label:`Registered ${r}, ${e.created_by_user_displayname}, ${qm[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=qm[e.group_uuid]||e.group_name,l=e.created_by_user_displayname,c=[...e.data_types,(0,mr.get)(e,["ingest_metadata","metadata","assay_type"],"")],u=c.join("|").toLowerCase();let h,f="assets/icons/ico-unknown.svg";return-1!==u.indexOf("10x")?(h="10x",f="assets/icons/ico-bulk-10x.svg"):-1!==u.indexOf("af")?(h="AF",f="assets/icons/ico-spatial-af.svg"):-1!==u.indexOf("codex")?(h="CODEX",f="assets/icons/ico-spatial-codex.svg"):-1!==u.indexOf("imc")?(h="IMC",f="assets/icons/ico-spatial-imc.svg"):-1!==u.indexOf("lc")&&-1===u.indexOf("af")?(h="LC",f="assets/icons/ico-bulk-lc.svg"):h=-1!==u.indexOf("maldi")?"MALDI":-1!==u.indexOf("pas")?"PAS":"OTHER",f=null!==(s=this.getDatasetThumbnail(e,t,r))&&void 0!==s?s:f,{"@id":g1+e.uuid,"@type":"Dataset",label:`Registered ${o}, ${l}, ${a}`,description:`Data/Assay Types: ${c.join(", ")}`,link:`${i}browse/dataset/${e.uuid}`,technology:h,thumbnail:f}}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,mr.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=>W9.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(W9.has(s))return`assets/thumbnails/TMC-Vanderbilt/DR1/${s}`}}else if("07a29e4c-ed43-11e8-b56a-0e8017bdda58"===e.group_uuid){const r=UPe[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,mr.toNumber)(s[1]));for(const f of(0,mr.get)(e,"metadata.organ_donor_data",(0,mr.get)(e,"metadata.living_donor_data",[])))"Feminine gender"===f.preferred_term||"Female"===f.preferred_term?r="Female":"Masculine gender"===f.preferred_term||"Male"===f.preferred_term?r="Male":"Current chronological age"===f.preferred_term||"Age"===f.preferred_term?o=(0,mr.toNumber)(f.data_value):"Body mass index"===f.preferred_term&&(a=(0,mr.toNumber)(f.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(),u=qm[e.group_uuid]||e.group_name;return{"@id":g1+e.uuid,"@type":"Donor",label:l,description:`Entered ${c}, ${e.created_by_user_displayname}, ${u}`,link:`${t}browse/donor/${e.uuid}`,age:o,sex:r,bmi:a,consortium_name:"HuBMAP",provider_name:u,provider_uuid:e.group_uuid,samples:[]}}getRuiLocation(e,t){var i;let r,s=e.rui_location;if(s&&("string"==typeof s&&(s=JSON.parse(s)),s.alignment_id?console.log("Detected a deprecated rui_location",e.uuid):s["@id"]&&(r=s)),r){const o=null!==(i=(0,mr.get)(r,["placement","target"]))&&void 0!==i?i:"";o.startsWith("http://purl.org/ccf/latest/ccf.owl#VHSpleenCC")?(0,mr.set)(r,["placement","target"],o.replace("#VHSpleenCC","Male"===t.sex?"#VHMSpleenCC":"#VHFSpleenCC")):("http://purl.org/ccf/latest/ccf.owl#VHLeftKidney"===o||"http://purl.org/ccf/latest/ccf.owl#VHRightKidney"===o)&&(0,mr.set)(r,["placement","target"],"Male"===t.sex?o.replace("#VH","#VHM")+"_Patch":o.replace("#VH","#VHF")+"_Patch")}return r}getTissueBlock(){return(0,mr.omit)(Object.assign({},this),["data","bad","donor"])}toJsonLd(){return Object.assign(Object.assign({},this.donor),{samples:[this.getTissueBlock()]})}}const WPe=["uuid","entity_type","group_uuid","group_name","last_modified_timestamp","created_by_user_displayname","ancestors.entity_type","ancestors.description","ancestors.metadata.organ_donor_data.preferred_term","ancestors.metadata.organ_donor_data.data_value","ancestors.metadata.living_donor_data.preferred_term","ancestors.metadata.living_donor_data.data_value","ancestors.last_modified_timestamp","ancestors.group_uuid","ancestors.group_name","ancestors.created_by_user_displayname","ancestors.uuid","descendants.entity_type","descendants.ingest_metadata.metadata.tissue_id","descendants.last_modified_timestamp","descendants.group_uuid","descendants.group_name","descendants.created_by_user_displayname","descendants.uuid","descendants.data_types","descendants.ingest_metadata.metadata.assay_type","descendants.thumbnail_file","descendants.metadata.files.rel_path","rui_location","specimen_type"],qPe={exists:{field:"rui_location"}};function Y9(n,e,t){return JSON.stringify({version:!0,from:n,size:e,stored_fields:["*"],script_fields:{},docvalue_fields:[],query:null!=t?t:qPe,_source:{includes:WPe}})}function Hk(n,e){return Bi(this,void 0,void 0,function*(){try{const t=yield fetch(n,e);return t.ok?yield t.json():void 0}catch(t){return}})}function X9(n,e,t,i,r="",s=""){return Bi(this,void 0,void 0,function*(){let o;if("static"===e?o=yield Hk(n):"search-api"===e&&(o=yield function(n,e,t){return Bi(this,void 0,void 0,function*(){const i=250,r=function(n){const e=new Headers;return e.append("Content-type","application/json"),n&&e.append("Authorization",`Bearer ${n}`),e}(e),s=Y9(0,i,t),o=yield Hk(n,{method:"POST",headers:r,body:s});if(!o)return;const a=o.hits.total.value;if(a<=i)return o;const l=[];for(let h=i;h!h))return;const u=c.map(h=>h.hits.hits);return Object.assign(Object.assign({},o),{hits:Object.assign(Object.assign({},o.hits),{hits:o.hits.hits.concat(...u)})})})}(n,i,t)),o)return function(n,e="",t="",i,r=!1){const o={},a=(0,mr.get)(n,"hits.hits",[]).map(c=>(0,mr.get)(c,"_source",{})).sort((c,u)=>c.uuid.localeCompare(u.uuid)).map(c=>new GPe(c,e,t,i).toJsonLd());for(const c of a){const u=c["@id"];o[u]?o[u].samples.push(c.samples[0]):o[u]=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":q9},c)))),{"@context":q9,"@graph":l}}(o,r,s,i);console.warn(`Unable to load ${n} as HuBMAP Data`)})}function Jb(n,e,t){const i=new Set;for(const r of e)for(const s of(0,Un.readQuads)(n,r,t,null,null))i.add(s.object.id);return i}const JPe={[ki.spatialEntity.x_dimension.id]:"x",[ki.spatialEntity.y_dimension.id]:"y",[ki.spatialEntity.z_dimension.id]:"z"};function tNe(n,e,t,i){const r=e.getTransformationMatrix(t,i);let s;if(r){const o=r.getTranslation(),a=function(n,e){const t=dp(n,e,"Dimensions",JPe);return[t.x,t.y,t.z]}(n,t).map(c=>c/1e3/2),l=(new Zi).fromRotationMatrix(r,Zi.XYZ).toQuaternion().normalize().calculateW();s=(new Nk).fromCenterHalfSizeQuaternion(o,a,l)}return s}function nNe(n,e,t,i){const{x:r,y:s,z:o,radius:a,target:l}=i,c=new Set,u=a/1e3*(a/1e3);for(const h of t){const f=tNe(n,e,h,l);f&&f.distanceSquaredTo([r,s,o].map(m=>m/1e3))<=u&&c.add(h)}return c}function m1(n,e,t){var i,r;const s=new Map,o=new Set;for(const c of e)for(const u of(0,Un.readQuads)(n,c,vi.donor,null,null))o.add(u.object.id),s.has(u.object.id)?null===(i=s.get(u.object.id))||void 0===i||i.push(c):s.set(u.object.id,[c]);const a=t(o),l=new Set;for(const c of a)for(const u of null!==(r=s.get(c))&&void 0!==r?r:[])l.add(u);return l}function Gk(n,e,t){var i,r;const s=new Map,o=new Set;for(const c of e)for(const u of(0,Un.readQuads)(n,c,vi.spatialEntity,null,null))o.add(u.object.id),s.has(u.object.id)?null===(i=s.get(u.object.id))||void 0===i||i.push(c):s.set(u.object.id,[c]);const a=t(o),l=new Set;for(const c of a)for(const u of null!==(r=s.get(c))&&void 0!==r?r:[])l.add(u);return l}function ev(n,e){return function(t){n.has(t.id)&&e.add(t.id)}}function K9(n,e,t){const i=new Set;for(const r of t){const s=Un.DataFactory.namedNode(r);n.forSubjects(ev(e,i),ki.spatialEntity.ccf_annotations,s,null)}return i}function Q9(n,e){const t=function(n,e){const t=new Map;for(const i of n)for(const r of(0,Un.readQuads)(e,i,vi.spatialEntity,null,null))t.has(r.object.id)?t.get(r.object.id).add(i):t.set(r.object.id,new Set([i]));return t}(n,e),i=new Map;for(const r of t.keys()){const s=t.get(r);for(const o of(0,Un.readQuads)(e,r,ki.spatialEntity.ccf_annotations,null,null))if(i.has(o.object.id)){const a=i.get(o.object.id);s.forEach(l=>a.add(l))}else i.set(o.object.id,new Set(s))}return i}function _Ne(n,e,t){const i={"@id":e,"@type":"OntologyTreeNode",id:e,parent:"",children:[],synonymLabels:[],label:""},r={[ki.ontologyNode.label.id]:"label",[t]:"parent",[ki.ontologyNode.synonymLabels.id]:"synonymLabels"};for(const[s,o]of Uk(n,e,r))"synonymLabels"===s?i.synonymLabels.push(o):i[s]=o;return i.children=n.getSubjects(t,e,null).map(s=>s.id),i}function Z9(n,e,t,i){const r={root:e,nodes:{}},s=new Set;for(const a of(0,Un.readQuads)(n,null,i,null,null))s.add(a.subject.id),s.add(a.object.id);for(const a of s)r.nodes[a]=_Ne(n,a,i);r.nodes[e]||(r.nodes[e]={"@id":e,"@type":"OntologyTreeNode",id:e,label:t,children:[],synonymLabels:[]});const o=n.getSubjects(i,e,null).map(a=>a.id).sort((a,l)=>r.nodes[a].label.localeCompare(r.nodes[l].label));return r.nodes[e].children=o,J9(r),r}function J9(n,e,t=new Set){const i=n.nodes[null!=e?e:n.root];if(i){i.children=i.children.filter(r=>!t.has(r)),i.children.forEach(r=>t.add(r));for(const r of i.children)J9(n,r,t),n.nodes[r]&&(n.nodes[r].parent=i["@id"])}}const eq=(0,mr.memoize)(function(n){const e=Z9(n,vd.body.id,"body",ki.asctb.part_of.id);return e.nodes[vd.body.id].children=["http://purl.obolibrary.org/obo/UBERON_0000955","http://purl.obolibrary.org/obo/UBERON_0000029","http://purl.obolibrary.org/obo/UBERON_0000970","http://purl.obolibrary.org/obo/UBERON_0003889","http://purl.obolibrary.org/obo/UBERON_0000948","http://purl.obolibrary.org/obo/UBERON_0002113","http://purl.obolibrary.org/obo/UBERON_0001465","http://purl.obolibrary.org/obo/UBERON_0002107","http://purl.obolibrary.org/obo/UBERON_0002048","http://purl.obolibrary.org/obo/UBERON_0001911","http://purl.obolibrary.org/obo/UBERON_0000992","http://purl.obolibrary.org/obo/UBERON_0001264","http://purl.obolibrary.org/obo/UBERON_0001270","http://purl.obolibrary.org/obo/UBERON_0001987","http://purl.obolibrary.org/obo/UBERON_0002367","http://purl.obolibrary.org/obo/UBERON_0002097","http://purl.obolibrary.org/obo/UBERON_0002108","http://purl.obolibrary.org/obo/UBERON_0002240","http://purl.obolibrary.org/obo/UBERON_0000059","http://purl.obolibrary.org/obo/UBERON_0002106","http://purl.obolibrary.org/obo/UBERON_0002370","http://purl.obolibrary.org/obo/UBERON_0000056","http://purl.obolibrary.org/obo/UBERON_0001255","http://purl.obolibrary.org/obo/UBERON_0000995","http://purl.obolibrary.org/obo/UBERON_0004537"].filter(t=>t in e.nodes),e},()=>""),_1={[vi.label.id]:"label",[vi.description.id]:"description",[vi.link.id]:"link"},vNe=Object.assign(Object.assign({},_1),{[vi.providerName.id]:"providerName"}),wNe=Object.assign(Object.assign({},_1),{[vi.technology.id]:"technology",[vi.thumbnail.id]:"thumbnail"}),ENe=Object.assign(Object.assign({},_1),{[vi.sampleType.id]:"sampleType",[vi.sectionNumber.id]:"sectionNumber",[vi.datasets.id]:"datasets"}),xNe=Object.assign(Object.assign({},_1),{[vi.sampleType.id]:"sampleType",[vi.sectionCount.id]:"sectionCount",[vi.sectionSize.id]:"sectionSize",[vi.sectionUnits.id]:"sectionUnits",[vi.donor.id]:"donor",[vi.spatialEntity.id]:"spatialEntityId",[vi.sections.id]:"sections",[vi.datasets.id]:"datasets"});function SNe(n,e){return dp(n,e,"Donor",vNe)}function tq(n,e){return dp(n,e,"Dataset",wNe)}function CNe(n,e){const t={"@id":e,"@type":"Sample",datasets:[]};for(const[i,r]of Uk(n,e,ENe))if("datasets"===i){const s=tq(n,r);t[i].push(s)}else t[i]=r;return t}class ANe{constructor(e){this.database=e,this.connect()}toJson(){return{status:this.status,message:this.message,checkback:"Ready"===this.status||"Error"===this.status?36e5:2e3,loadTime:this.loadTime}}connect(){this.status="Loading",this.message="Loading database";const e=Date.now();return this.database.connect().then(t=>Bi(this,void 0,void 0,function*(){t?(this.message="Building scene",yield this.database.getScene(),this.message="Building tissue block results",yield this.database.getTissueBlockResults(),this.message="Aggregating results",yield this.database.getAggregateResults(),this.status="Ready",this.message="Database successfully loaded"):(this.status="Error",this.message="Unknown error while loading database")})).catch(t=>{var i;this.status="Error",this.message=null!==(i=null==t?void 0:t.message)&&void 0!==i?i:"Unknown error while loading database"}).finally(()=>{this.loadTime=Date.now()-e})}}const MNe={"@context":{"@base":"http://purl.org/ccf/","@vocab":"http://purl.org/ccf/",ccf:"http://purl.org/ccf/",rdfs:"http://www.w3.org/2000/01/rdf-schema#",dcterms:"http://purl.org/dc/terms/",label:"rdfs:label",description:"rdfs:comment",link:"ccf:url",sex:"ccf:sex",age:"ccf:age",bmi:"ccf:bmi",consortium_name:"ccf:consortium_name",provider_name:"ccf:tissue_provider_name",provider_uuid:"ccf:tissue_provider_uuid",donor:{"@id":"ccf:comes_from","@type":"@id"},samples:{"@reverse":"donor"},sections:{"@id":"ccf:subdivided_into_sections","@type":"@id"},datasets:{"@id":"ccf:generates_dataset","@type":"@id"},sample_type:"ccf:sample_type",section_count:"ccf:section_count",section_size:"ccf:section_size",section_units:"ccf:section_size_unit",section_number:"ccf:section_number",rui_location:{"@id":"ccf:has_registration_location","@type":"@id"},ccf_annotations:{"@id":"ccf:collides_with","@type":"@id","@container":"@set"},representation_of:{"@id":"ccf:representation_of","@type":"@id"},reference_organ:{"@id":"ccf:has_reference_organ","@type":"@id"},extraction_set_for:{"@id":"ccf:extraction_set_for","@type":"@id"},extraction_set:{"@id":"ccf:has_extraction_set","@type":"@id"},organ_owner_sex:"ccf:organ_owner_sex",side:"ccf:organ_side",rui_rank:"ccf:rui_rank",slice_thickness:"ccf:slice_thickness",slice_count:"ccf:slice_count",object:{"@id":"ccf:has_object_reference","@type":"@id"},creation_date:"dcterms:created",updated_date:"ccf:updated_date",creator:"dcterms:creator",creator_first_name:"ccf:creator_first_name",creator_last_name:"ccf:creator_last_name",placement:{"@reverse":"ccf:placement_for"},placement_date:"dcterms:created",rotation_order:"ccf:rotation_order",dimension_units:"ccf:dimension_unit",rotation_units:"ccf:rotation_unit",scaling_units:"ccf:scaling_unit",translation_units:"ccf:translation_unit",source:{"@id":"ccf:placement_for","@type":"@id"},target:{"@id":"ccf:placement_relative_to","@type":"@id"},x_rotation:"ccf:x_rotation",y_rotation:"ccf:y_rotation",z_rotation:"ccf:z_rotation",x_scaling:"ccf:x_scaling",y_scaling:"ccf:y_scaling",z_scaling:"ccf:z_scaling",x_translation:"ccf:x_translation",y_translation:"ccf:y_translation",z_translation:"ccf:z_translation",x_dimension:"ccf:x_dimension",y_dimension:"ccf:y_dimension",z_dimension:"ccf:z_dimension",ontology_terms:{"@id":"ccf:has_ontology_term","@type":"@id"},technology:"ccf:technology",thumbnail:"ccf:thumbnail",file:"ccf:file_url",file_format:"ccf:file_format",file_subpath:"ccf:file_subpath"}};function $k(n){return JSON.parse(n,(e,t)=>"ccf_annotations"===e&&Array.isArray(t)?t.map(i=>(null==i?void 0:i.startsWith("http://purl.obolibrary.org/obo/FMA_"))?i.replace("http://purl.obolibrary.org/obo/FMA_","http://purl.org/sig/ont/fma/fma"):i):"@context"!==e||!t||"https://hubmapconsortium.github.io/hubmap-ontology/ccf-entity-context.jsonld"!==t&&"https://hubmapconsortium.github.io/hubmap-ontology/ccf-context.jsonld"!==t&&"https://hubmapconsortium.github.io/ccf-ontology/ccf-context.jsonld"!==t&&"http://purl.org/ccf/latest/ccf-entity.owl#"!==t["@base"]?t:MNe)}const INe={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 ONe{constructor(e=INe){this.options=e,this.store=new Un.Store(void 0,{factory:Un.DataFactory}),this.graph=new G9(this),this.scene=new $9(this)}connect(e,t=!1){return Bi(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 Bi(this,void 0,void 0,function*(){const e=(new Date).getTime(),t="ccf-database.last_modified",i="ccf-database",r=yield A9(t).catch(()=>{});let s;r&&e-new Date(+r).getTime()>36e5?yield function(n,e=Cc()){return e("readwrite",t=>(n.forEach(i=>t.delete(i)),vu(t.transaction)))}([i,t]).catch(()=>{}):s=yield A9(i).catch(()=>{}),s?yield this.deserialize(s):(yield this.doConnect(),function(n,e=Cc()){return e("readwrite",t=>(n.forEach(i=>t.put(i[1],i[0])),vu(t.transaction)))}([[i,this.serialize()],[t,""+e]]).catch(()=>{}))})}doConnect(){var e,t;return Bi(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.startsWith("{"))this.store=(0,Un.deserializeN3Store)(s,Un.DataFactory);else 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,Un.deserializeN3Store)(o,Un.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(X9(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 Bi(this,void 0,void 0,function*(){const i=null!=t?t:this.store;return yield Promise.all(e.map(r=>Bi(this,void 0,void 0,function*(){"string"==typeof r?(r.startsWith("http")||r.startsWith("assets/"))&&r.includes("jsonld")?(r=$k(r=yield fetch(r).then(s=>s.text())),yield(0,Un.addJsonLdToStore)(r,i)):r.endsWith("n3")?yield(0,Un.addN3ToStore)(r,i):r.endsWith("rdf")||r.endsWith("owl")||r.endsWith("xml")?yield(0,Un.addRdfXmlToStore)(r,i):(r=$k(r),yield(0,Un.addJsonLdToStore)(r,i)):(r=$k(JSON.stringify(r)),yield(0,Un.addJsonLdToStore)(r,i))}))),this})}synchronize(){return Bi(this,void 0,void 0,function*(){return yield new Promise(e=>{setTimeout(e,500)}),this.graph.createGraph(),function(n){var e,t,i;const r=eq(n),s=new Map;for(const{subject:o,object:a}of(0,Un.readQuads)(n,null,ki.spatialEntity.representation_of,null,null)){const l=new Set([a.id]);let c=null===(e=r.nodes[a.id])||void 0===e?void 0:e.parent;for(;c&&!l.has(c);)l.add(c),c=null===(t=r.nodes[c])||void 0===t?void 0:t.parent;s.set(o.id,[...l].map(u=>Un.DataFactory.namedNode(u)))}for(const{object:o}of(0,Un.readQuads)(n,null,vi.spatialEntity,null,null))for(const{subject:a}of(0,Un.readQuads)(n,null,ki.spatialPlacement.source,o,null))for(const{object:l}of(0,Un.readQuads)(n,a,ki.spatialPlacement.target,null,null))for(const c of null!==(i=s.get(l.id))&&void 0!==i?i:[])n.addQuad(Un.DataFactory.namedNode(o.id),ki.spatialEntity.ccf_annotations,c)}(this.store),this})}serialize(){return(0,Un.serializeN3Store)(this.store)}deserialize(e){return Bi(this,void 0,void 0,function*(){this.store=(0,Un.deserializeN3Store)(e,Un.DataFactory),this.graph=new G9(this),this.scene=new $9(this),yield new Promise(t=>{setTimeout(t,10)})})}getIds(e={}){return function(n,e,t){var i,r,s,o,a,l,c;let u=function(n){const e=new Set;return n.forSubjects(t=>e.add(t.id),vi.spatialEntity,null,null),e}(n);if(u.size>0&&(u=function(n,e,t=!0){const i=new Set;if(n.forSubjects(ev(e,i),vi.spatialEntity,null,null),!t){const r=new Set;return e.forEach(s=>i.has(s)?void 0:r.add(s)),r}return i}(n,u)),u.size>0&&("Male"===t.sex||"Female"===t.sex)){const h=t.sex;u=m1(n,u,f=>function(n,e,t){const i=new Set;return n.forSubjects(ev(e,i),vi.sex,vi[t],null),i}(n,f,h))}if(u.size>0&&(null===(i=t.tmc)||void 0===i?void 0:i.length)>0&&(u=m1(n,u,h=>function(n,e,t){const i=new Set;for(const r of t){const s=Un.DataFactory.literal(r);n.forSubjects(ev(e,i),vi.providerName,s,null)}return i}(n,h,t.tmc))),u.size>0&&(null===(r=t.technologies)||void 0===r?void 0:r.length)>0&&(u=function(n,e,t){var i,r;const s=new Map,o=new Set,a=new Set(e);for(const u of e)for(const h of(0,Un.readQuads)(n,u,vi.sections,null,null))a.add(h.object.id);for(const u of a)for(const h of(0,Un.readQuads)(n,u,vi.datasets,null,null))o.add(h.object.id),s.has(h.object.id)?null===(i=s.get(h.object.id))||void 0===i||i.push(u):s.set(h.object.id,[u]);const l=t(o),c=new Set;for(const u of l)for(const h of null!==(r=s.get(u))&&void 0!==r?r:[])c.add(h);return c}(n,u,h=>function(n,e,t){const i=new Set;for(const r of t){const s=Un.DataFactory.literal(r);n.forSubjects(ev(e,i),vi.technology,s,null)}return i}(n,h,t.technologies))),u.size>0&&(null===(s=t.spatialSearches)||void 0===s?void 0:s.length)>0&&(u=Gk(n,u,h=>function(n,e,t,i){const r=new Set;for(const s of i)nNe(n,e,t,s).forEach(a=>r.add(a));return r}(n,e,h,t.spatialSearches))),u.size>0&&(null===(o=t.ontologyTerms)||void 0===o?void 0:o.length)>0){const h=t.ontologyTerms;-1===h.indexOf(vd.body.id)&&(u=Gk(n,u,f=>K9(n,f,h)))}if(u.size>0&&(null===(a=t.cellTypeTerms)||void 0===a?void 0:a.length)>0){const h=t.cellTypeTerms;-1===h.indexOf(vd.cell.id)&&(u=Gk(n,u,f=>function(n,e,t){const i=new Set;for(const r of t)n.forObjects(s=>{i.add(s.id)},r,ki.asctb.located_in,null),r===vd.cell.id&&i.add(vd.body.id);return K9(n,e,[...i])}(n,f,h)))}if(u.size>0&&2===(null===(l=t.ageRange)||void 0===l?void 0:l.length)&&(0,mr.isFinite)(t.ageRange[0])&&(0,mr.isFinite)(t.ageRange[1])){const h=Math.max(...t.ageRange),f=Math.min(...t.ageRange);1===f&&110===h||(u=m1(n,u,g=>function(n,e,t,i){const r=new Set;for(const s of e)for(const o of(0,Un.readQuads)(n,s,vi.age,null,null)){const a=(0,c1.fromRdf)(o.object);a>=t&&a<=i&&r.add(s)}return r}(n,g,f,h)))}if(u.size>0&&2===(null===(c=t.bmiRange)||void 0===c?void 0:c.length)&&(0,mr.isFinite)(t.bmiRange[0])&&(0,mr.isFinite)(t.bmiRange[1])){const h=Math.max(...t.bmiRange),f=Math.min(...t.bmiRange);13===f&&83===h||(u=m1(n,u,g=>function(n,e,t,i){const r=new Set;for(const s of e)for(const o of(0,Un.readQuads)(n,s,vi.bmi,null,null)){const a=(0,c1.fromRdf)(o.object);a>=t&&a<=i&&r.add(s)}return r}(n,g,f,h)))}return u}(this.store,this.graph,e)}get(e){return this.store.getQuads(Un.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=>function(n,e){const t=n.getObjects(Un.DataFactory.namedNode(e),vi.spatialEntity,null);if(t.length>0)return hp(n,t[0].id)}(this.store,t))}getDatabaseStatus(){return Bi(this,void 0,void 0,function*(){return this.status||(this.status=new ANe(this)),this.status.toJson()})}getDatasetTechnologyNames(){return Bi(this,void 0,void 0,function*(){return function(n){const e=new Set;for(const t of(0,Un.readQuads)(n,null,vi.technology,null,null))e.add(t.object.value);return Array.from(e).sort()}(this.store)})}getProviderNames(){return Bi(this,void 0,void 0,function*(){return function(n){const e=new Set;for(const t of(0,Un.readQuads)(n,null,vi.providerName,null,null))e.add(t.object.value);return Array.from(e).sort()}(this.store)})}getTissueBlockResults(e){return Bi(this,void 0,void 0,function*(){return e=Object.assign(Object.assign({},e),{hasSpatialEntity:!0}),[...this.getIds(e)].map(t=>function(n,e){const t={"@id":e,"@type":"Sample",sections:[],datasets:[]};for(const[i,r]of Uk(n,e,xNe))if("sections"===i){const s=CNe(n,r);t[i].push(s)}else if("datasets"===i){const s=tq(n,r);t[i].push(s)}else t[i]="donor"===i?SNe(n,r):r;return t}(this.store,t))})}getAggregateResults(e){return Bi(this,void 0,void 0,function*(){return function(n,e){const t=Jb(e,n,vi.donor.id),i=Jb(e,t,vi.providerUUID.id),r=new Set;for(const l of n)for(const c of(0,Un.readQuads)(e,l,vi.spatialEntity,null,null))r.add(c.subject.id);const s=Jb(e,r,vi.sections.id),o=new Set([...Jb(e,r,vi.datasets.id),...Jb(e,s,vi.datasets.id)]);return 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 Bi(this,void 0,void 0,function*(){return function(n,e){const t={};return Q9(n,e).forEach((r,s)=>{t[s]=r.size}),t}(this.getIds(e),this.store)})}getCellTypeTermOccurences(e){return Bi(this,void 0,void 0,function*(){return function(n,e){var t,i;const r=Q9(n,e),s=new Map;for(const a of r.keys()){const l=r.get(a);for(const c of(0,Un.readQuads)(e,null,ki.asctb.located_in,a,null)){const u=c.subject.id;if(s.has(u)){const h=s.get(u);l.forEach(f=>h.add(f))}else s.set(u,new Set(l))}}const o={};return s.forEach((a,l)=>{o[l]=a.size}),o[vd.cell.id]=null!==(i=null===(t=r.get(vd.body.id))||void 0===t?void 0:t.size)&&void 0!==i?i:0,o}(this.getIds(e),this.store)})}getOntologyTreeModel(){return Bi(this,void 0,void 0,function*(){return eq(this.store)})}getCellTypeTreeModel(){return Bi(this,void 0,void 0,function*(){return function(n){return Z9(n,vd.cell.id,"cell",ki.asctb.ct_is_a.id)}(this.store)})}getReferenceOrgans(){return Bi(this,void 0,void 0,function*(){return this.scene.getReferenceOrgans()})}getScene(e){return Bi(this,void 0,void 0,function*(){return this.graph.createGraph(),this.scene.getScene(e)})}getReferenceOrganScene(e,t){return Bi(this,void 0,void 0,function*(){return this.graph.createGraph(),this.scene.getReferenceOrganScene(e,t)})}getSpatialPlacement(e,t){return Bi(this,void 0,void 0,function*(){return this.graph.getSpatialPlacement(e,t)})}}class nq extends Error{constructor(){super(...arguments),this.message="NgxsDispatchPluginModule is not imported"}}function NNe(){throw new nq}function kNe(){throw new nq}function Wk(n,e,t){e.run(()=>n.dispatch(t))}function BNe(n,e,t,i){return yg(t)?function(n,e,t){return t.then(i=>(Wk(n,e,i),i))}(n,e,t):Im(t)?function(n,e,t,i){return null!==i&&(t=t.pipe(gr(i.cancelUncompleted$))),t.subscribe({next:r=>Wk(n,e,r)}),t}(n,e,t,i):(Wk(n,e,t),t)}class VNe{constructor(){this.cancelUncompleted$=new oe}cancelPreviousAction(){this.cancelUncompleted$.next()}}const qk="\u0275fac",iq=Symbol("InjectorInstance"),rq=Symbol("FactoryHasBeenDecorated");function sq(n,e){const t=n[iq];return t?t.get(e):null}const zNe={cancelUncompleted:!1};function oq(n=zNe){return(e,t,i)=>{let r;const s=function(n){return n?new VNe:null}(n.cancelUncompleted);function o(){null!==s&&s.cancelPreviousAction();const a=sq(this,hu)||NNe(),l=sq(this,pn)||kNe(),c=r.apply(this,arguments);return l.runOutsideAngular(()=>BNe(a,l,c,s))}"function"==typeof(null==i?void 0:i.value)?(r=i.value,i.value=o):Object.defineProperty(e,t,{set:a=>r=a,get:()=>o}),function(n){if(rq in n.constructor.prototype)return;const e=n.constructor;"function"==typeof e[qk]&&function(n){const e=n[qk];if("function"!=typeof e)return;const t=n.\u0275prov||n.\u0275pipe||n.\u0275cmp||n.\u0275dir,i=()=>{const r=e();return r[iq]=Ce(Vu),r};t&&(t.factory=i),Object.defineProperty(n,qk,{get:()=>i})}(e),n.constructor.prototype[rq]=!0}(e)}}const mke=["bodyCanvas"];let _ke=(()=>{class n{constructor(){this.clsName="ccf-body-ui",this.rotationChange=new ln,this.nodeDrag=new ln,this.nodeClick=new ln,this.nodeHoverStart=new ln,this.nodeHoverStop=new ln,this.initialized=new ln,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 Bi(this,void 0,void 0,function*(){const i=this.bodyCanvas.nativeElement,r=new zve({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.target&&this.bodyUI.setTarget(this.target),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))],this.initialized.emit()})}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=rn({type:n,selectors:[["ccf-body-ui"]],viewQuery:function(t,i){if(1&t&&hr(mke,5,gn),2&t){let r;Gn(r=$n())&&(i.bodyCanvas=r.first)}},hostVars:2,hostBindings:function(t,i){2&t&&Va(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",initialized:"initialized"},decls:2,vars:0,consts:[[1,"body-ui"],["bodyCanvas",""]],template:function(t,i){1&t&&ni(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})(),yke=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=tn({type:n}),n.\u0275inj=St({imports:[[fr]]}),n})();new Ht("Maximum number of autocomplete options displayed",{providedIn:"root",factory:()=>10});const yq=[{src:"app:skin",organ:"Skin",name:"Skin",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002097"},{src:"app:brain",organ:"Brain",name:"Brain",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000955"},{disabled:!0,src:"app:lymph-nodes",organ:"Lymph Node",name:"Lymph Node",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000029"},{src:"app:lymph-nodes",organ:"Lymph Node",name:"Lymph Node",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002509"},{disabled:!0,src:"app:eye",organ:"Eye",name:"Eye, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000970"},{src:"app:eye",organ:"Eye",name:"Eye, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0004548"},{src:"app:eye",organ:"Eye",name:"Eye, R",side:"right",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0004549"},{disabled:!0,src:"app:fallopian-tube-left",organ:"Fallopian Tube",name:"Fallopian Tube, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0003889"},{src:"app:fallopian-tube-left",organ:"Fallopian Tube",name:"Fallopian Tube, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0001303"},{src:"app:fallopian-tube-right",organ:"Fallopian Tube",name:"Fallopian Tube, R",side:"right",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0001302"},{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, L",side:"left",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"},{disabled:!0,src:"app:knee",organ:"Knee",name:"Knee, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001465"},{src:"app:knee",organ:"Knee",name:"Knee, L",side:"left",hasSex:!0,id:"http://purl.org/sig/ont/fma/fma24978"},{src:"app:knee",organ:"Knee",name:"Knee, R",side:"right",hasSex:!0,id:"http://purl.org/sig/ont/fma/fma24977"},{src:"app:liver",organ:"Liver",name:"Liver",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002107"},{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"},{disabled:!0,src:"app:mammary-gland",organ:"Mammary Gland",name:"Mammary Gland, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0001911"},{src:"app:mammary-gland",organ:"Mammary Gland",name:"Mammary Gland, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.org/sig/ont/fma/fma57991"},{src:"app:mammary-gland",organ:"Mammary Gland",name:"Mammary Gland, R",side:"right",hasSex:!1,sex:"female",id:"http://purl.org/sig/ont/fma/fma57987"},{disabled:!0,src:"app:ovary-left",organ:"Ovary",name:"Ovary, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0000992"},{src:"app:ovary-left",organ:"Ovary",name:"Ovary, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.org/sig/ont/fma/fma7214"},{src:"app:ovary-right",organ:"Ovary",name:"Ovary, R",side:"right",hasSex:!1,sex:"female",id:"http://purl.org/sig/ont/fma/fma7213"},{src:"app:pancreas",organ:"Pancreas",name:"Pancreas",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001264"},{src:"app:pelvis-f",organ:"Pelvis",name:"Pelvis",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001270"},{src:"app:placenta",organ:"Placenta",name:"Placenta",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0001987"},{src:"app:prostate",organ:"Prostate",name:"Prostate",hasSex:!1,sex:"male",id:"http://purl.obolibrary.org/obo/UBERON_0002367",disabled:!0},{src:"app:prostate",organ:"Prostate",name:"Prostate",hasSex:!1,sex:"male",id:"http://purl.obolibrary.org/obo/UBERON_0000079"},{src:"app:small-intestine",organ:"Small Intestine",name:"Small Intestine",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002108"},{src:"app:large-intestine",organ:"Large Intestine",name:"Large Intestine",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000059"},{src:"app:spinal-cord",organ:"Spinal Cord",name:"Spinal Cord",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002240"},{src:"app:spleen",organ:"Spleen",name:"Spleen",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002106"},{src:"app:thymus",organ:"Thymus",name:"Thymus",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002370"},{disabled:!0,src:"app:ureter-left",organ:"Ureter",name:"Ureter, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000056"},{src:"app:ureter-left",organ:"Ureter",name:"Ureter, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001223"},{src:"app:ureter-right",organ:"Ureter",name:"Ureter, R",side:"right",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001222"},{src:"app:bladder",organ:"Urinary Bladder",name:"Urinary Bladder",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001255"},{src:"app:uterus",organ:"Uterus",name:"Uterus",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0000995"},{src:"app:vasculature-thick",organ:"Blood Vasculature",name:"Blood Vasculature",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0004537"},{disabled:!0,src:"app:vasculature-thick",organ:"Blood Vasculature",name:"Blood Vasculature",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002049"}].sort((n,e)=>n.name.localeCompare(e.name));function Lke(n,e){if(1&n&&(wt(0,"div",16),ni(1,"youtube-player",17),Et()),2&n){const t=_i(3);zt(1),dE("videoId",t.videoID)}}function Bke(n,e){if(1&n&&(wt(0,"mat-expansion-panel",11),wt(1,"mat-expansion-panel-header"),wt(2,"h2",12),Jn(3),Et(),Et(),wt(4,"div",13),ni(5,"markdown",14),wi(6,Lke,2,1,"div",15),Et(),Et()),2&n){const t=_i(),i=t.index,r=t.$implicit;Jt("expanded",0===i),zt(3),gs(r.title),zt(2),ai("first",0===i),Jt("data",r.content),zt(1),Jt("ngIf",0===i)}}function Vke(n,e){if(1&n&&(wt(0,"div",9),wi(1,Bke,7,6,"mat-expansion-panel",10),Et()),2&n){const t=e.$implicit;zt(1),Jt("ngIf",t)}}yq.filter(n=>!0!==n.disabled);let bq=(()=>{class n{constructor(t,i){this.dialogRef=t,this.data=i,this.documentationContents=i.content||[],this.infoTitle=i.title||"",this.videoID=i.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 n.\u0275fac=function(t){return new(t||n)(Ce(kC),Ce(PW))},n.\u0275cmp=rn({type:n,selectors:[["ccf-info-dialog"]],decls:11,vars:2,consts:[[1,"rui-about","wrapper"],[1,"container"],[1,"content"],[1,"header"],["mat-dialog-title","",1,"title"],[1,"close"],[1,"material-icons","close-icon",3,"click"],[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,i){1&t&&(wt(0,"div",0),wt(1,"div",1),wt(2,"div",2),wt(3,"div",3),wt(4,"h2",4),Jn(5),Et(),wt(6,"div",5),wt(7,"mat-icon",6),Tn("click",function(){return i.close()}),Jn(8,"clear"),Et(),Et(),Et(),wt(9,"mat-dialog-content",7),wi(10,Vke,2,1,"div",8),Et(),Et(),Et(),Et()),2&t&&(zt(5),gs(i.infoTitle),zt(5),Jt("ngForOf",i.documentationContents))},directives:[kW,Fm,FW,Yu,ac,UW,zW,WW,KW],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%] .content[_ngcontent-%COMP%] .header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;height:3rem;margin-bottom:2.25rem;position:relative}.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%]{cursor:pointer;height:3rem;width:3rem;line-height:3rem;text-align:center;transition:.6s}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-size:1.5rem;margin:0 auto;line-height:3rem;height:3rem;justify-self:center;display:flex}.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;display:flex}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .dialog-content[_ngcontent-%COMP%] .variable-binding.first[_ngcontent-%COMP%]{padding-right:1rem;width:73%}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .dialog-content[_ngcontent-%COMP%] .variable-binding[_ngcontent-%COMP%] ul{margin:0}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .dialog-content[_ngcontent-%COMP%] .variable-binding[_ngcontent-%COMP%] img{margin-left:1rem;float:right}.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%}"]}),n})(),vq=(()=>{class n{constructor(t){this.http=t,this.panelContent=new Fr({content:[],infoTitle:"",videoID:""})}updateData(t,i,r){this.http.get(t,{responseType:"text"}).subscribe(s=>{const o={content:this.parseMarkdown(s),infoTitle:r,videoID:i};this.panelContent.next(o)})}parseMarkdown(t){const i=[],r=t.split("# ");for(const s of r)if(s.length){const o=s.includes("\n\n")?"\n\n":"\r\n\r\n",a=s.split(o);i.push({title:a[0],content:a.splice(1).join(o)})}return i}}return n.\u0275fac=function(t){return new(t||n)(Ie(_u))},n.\u0275prov=We({token:n,factory:n.\u0275fac,providedIn:"root"}),n})(),Uke=(()=>{class n{constructor(){this.clsName="ccf-call-to-action",this.callToActionClicked=new ln,this.closeClicked=new ln}close(){this.closeClicked.emit()}onDialogButtonClick(){this.callToActionClicked.emit()}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=rn({type:n,selectors:[["ccf-call-to-action"]],hostVars:2,hostBindings:function(t,i){2&t&&Va(i.clsName)},inputs:{infoTitle:"infoTitle",imageUrl:"imageUrl",message:"message",callToAction:"callToAction"},outputs:{callToActionClicked:"callToActionClicked",closeClicked:"closeClicked"},decls:13,vars:4,consts:[[1,"rui-about","wrapper"],[1,"container"],[1,"content"],[1,"first-row"],["mat-dialog-title","",1,"title"],[1,"cta-mat-icon","material-icons","close-icon",3,"click"],["mat-card-sm-image","","alt","preview","layout-fill","",1,"cta-image",3,"src"],[1,"mat-typography","dialog-content"],[1,"message"],["mat-button","",1,"mat-button",3,"text","click"]],template:function(t,i){1&t&&(wt(0,"div",0),wt(1,"div",1),wt(2,"div",2),wt(3,"div",3),wt(4,"p",4),Jn(5),Et(),wt(6,"mat-icon",5),Tn("click",function(){return i.close()}),Jn(7,"clear"),Et(),Et(),ni(8,"img",6),wt(9,"mat-dialog-content",7),wt(10,"div",8),Jn(11),Et(),wt(12,"a",9),Tn("click",function(){return i.onDialogButtonClick()}),Et(),Et(),Et(),Et(),Et()),2&t&&(zt(5),gs(i.infoTitle),zt(3),Jt("src",i.imageUrl,sf),zt(3),xo(" ",i.message,""),zt(1),Jt("text",i.callToAction))},directives:[kW,Fm,BMe,FW],styles:["[_nghost-%COMP%] .content[_ngcontent-%COMP%]{display:block;align-content:center;padding-left:1.6rem;padding-right:1.6rem;border-radius:.25rem}[_nghost-%COMP%] .info-button-wrapper[_ngcontent-%COMP%]{border-radius:.25rem;padding:.6rem;transition:.6s}[_nghost-%COMP%] .info-button-wrapper[_ngcontent-%COMP%] .ccf-info-button[_ngcontent-%COMP%]{cursor:pointer;transition:color .6s;font-size:1.2rem;vertical-align:sub}[_nghost-%COMP%] .first-row[_ngcontent-%COMP%]{display:flex;width:100%;line-height:.9rem}[_nghost-%COMP%] .first-row[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{padding-right:7rem;padding-left:.2rem;font-size:.875rem;padding-top:.75rem}[_nghost-%COMP%] .first-row[_ngcontent-%COMP%] .cta-mat-icon[_ngcontent-%COMP%]{height:30%;line-height:3.4rem}[_nghost-%COMP%] .message[_ngcontent-%COMP%]{padding:.5rem}[_nghost-%COMP%] .cta-image[_ngcontent-%COMP%]{align-self:center;-o-object-fit:cover;object-fit:cover;width:100%;border-radius:.25rem}[_nghost-%COMP%] .mat-button[_ngcontent-%COMP%]{background-color:#444a65;font-size:.75rem;position:relative;margin-bottom:1rem;width:100%;height:2rem;color:#fff}"],changeDetection:0}),n})(),Qm=(()=>{let n=class extends MDe{constructor(){super(...arguments),this.optionCache=new Map}get config$(){return this.state$.pipe(Ki(n=>null!=n),Wa(1))}setConfig(t){this.setState(t)}patchConfig(t){this.patchState(t)}getProperty(t){return this.config$.pipe(oW(...t),ld(),Wa(1))}getOption(...t){const i=this.getPathKey(t);if(this.optionCache.has(i))return this.optionCache.get(i);const r=this.config$.pipe(oW(...t),ld(),Wa(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=zi(n)))(i||n)}}(),n.\u0275prov=We({token:n,factory:n.\u0275fac}),Ei([f7()],n.prototype,"config$",null),n=Ei([CDe(),A5({name:"globalConfig",defaults:null})],n),n})();!function(){const n=localStorage.getItem("ALLOW_TELEMETRY");null===n||n.toLowerCase()}();class wq extends class{getDatabaseStatus(){return this.forwardCall("getDatabaseStatus")}getProviderNames(){return this.forwardCall("getProviderNames")}getDatasetTechnologyNames(){return this.forwardCall("getDatasetTechnologyNames")}getOntologyTreeModel(){return this.forwardCall("getOntologyTreeModel")}getCellTypeTreeModel(){return this.forwardCall("getCellTypeTreeModel")}getReferenceOrgans(){return this.forwardCall("getReferenceOrgans")}getTissueBlockResults(e){return this.forwardCall("getTissueBlockResults",e)}getAggregateResults(e){return this.forwardCall("getAggregateResults",e)}getOntologyTermOccurences(e){return this.forwardCall("getOntologyTermOccurences",e)}getCellTypeTermOccurences(e){return this.forwardCall("getCellTypeTermOccurences",e)}getScene(e){return this.forwardCall("getScene",e)}getReferenceOrganScene(e,t){return this.forwardCall("getReferenceOrganScene",e,t)}}{forwardCall(e,...t){return this.impl$.pipe(is(i=>i[e](...t)))}}let Eq=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const Qk=new oe,nv={cacheBusterObserver:Qk},Zm={cacheBusterObserver:Qk,maxCacheCount:4};function xq(n,e,t){return n?{min:n[0]>e?n[0]:void 0,max:n[1]{var t;return Object.assign(Object.assign({},e),{transformMatrix:new qn(null!==(t=e.transformMatrix)&&void 0!==t?t:[])})})}let Xke=(()=>{class n{constructor(t,i){this.api=t,this.globalConfig=i,i.getOption("hubmapToken").subscribe(Qk)}getDatabaseStatus(){return this.doRequest(t=>this.api.dbStatus(t))}getProviderNames(){return this.doRequest(t=>this.api.providerNames(t))}getDatasetTechnologyNames(){return this.doRequest(t=>this.api.technologyNames(t))}getOntologyTreeModel(){return this.doRequest(t=>this.api.ontologyTreeModel(t),void 0,{},n=>n)}getCellTypeTreeModel(){return this.doRequest(t=>this.api.cellTypeTreeModel(t),void 0,{},n=>n)}getReferenceOrgans(){return this.doRequest(t=>this.api.referenceOrgans(t),void 0,{},n=>n)}getTissueBlockResults(t){return this.doRequest(i=>this.api.tissueBlocks(i),t,{},n=>n)}getAggregateResults(t){return this.doRequest(i=>this.api.aggregateResults(i),t)}getOntologyTermOccurences(t){return this.doRequest(i=>this.api.ontologyTermOccurences(i),t)}getCellTypeTermOccurences(t){return this.doRequest(i=>this.api.cellTypeTermOccurences(i),t)}getScene(t){return this.doRequest(i=>this.api.scene(i),t,{},Sq)}getReferenceOrganScene(t,i){return this.doRequest(r=>this.api.referenceOrganScene(r),i,{organIri:t},Sq)}doRequest(t,i,r,s){const{api:o,globalConfig:a}=this,l=Object.assign(Object.assign({},function(n){var e,t;return{age:xq(null==n?void 0:n.ageRange,1,110),bmi:xq(null==n?void 0:n.bmiRange,13,83),sex:null===(t=null===(e=null==n?void 0:n.sex)||void 0===e?void 0:e.toLowerCase)||void 0===t?void 0:t.call(e),ontologyTerms:null==n?void 0:n.ontologyTerms,cellTypeTerms:null==n?void 0:n.cellTypeTerms,providers:null==n?void 0:n.tmc,technologies:null==n?void 0:n.technologies,spatial:null==n?void 0:n.spatialSearches}}(i)),r);return yc([a.getOption("remoteApiEndpoint"),a.getOption("hubmapToken")]).pipe(qr(1),cr(([c,u])=>{o.configuration.basePath=c,u&&(l.token=u)}),is(()=>t(l)),me(c=>s?s(c):c))}}return n.\u0275fac=function(t){return new(t||n)(Ie(T9),Ie(Qm))},n.\u0275prov=We({token:n,factory:n.\u0275fac,providedIn:"root"}),Ei([Sc(nv)],n.prototype,"getProviderNames",null),Ei([Sc(nv)],n.prototype,"getDatasetTechnologyNames",null),Ei([Sc(nv)],n.prototype,"getOntologyTreeModel",null),Ei([Sc(nv)],n.prototype,"getCellTypeTreeModel",null),Ei([Sc(nv)],n.prototype,"getReferenceOrgans",null),Ei([Sc(Zm)],n.prototype,"getTissueBlockResults",null),Ei([Sc(Zm)],n.prototype,"getAggregateResults",null),Ei([Sc(Zm)],n.prototype,"getOntologyTermOccurences",null),Ei([Sc(Zm)],n.prototype,"getCellTypeTermOccurences",null),Ei([Sc(Zm)],n.prototype,"getScene",null),Ei([Sc(Zm)],n.prototype,"getReferenceOrganScene",null),n})(),Kke=(()=>{class n extends wq{constructor(t){super(),this.impl$=this.database$=t.config$.pipe(i=>i,Ki(i=>Object.keys(i).length>0),is(i=>function(n,e){return new O(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?je(r):Qc).subscribe(t);return()=>{o.unsubscribe(),i&&i.unsubscribe()}})}(()=>this.createDatabase(i),r=>this.connectDatabase(r,i))),me(i=>i.database),Wa(1))}connectDatabase(t,i){return Bi(this,void 0,void 0,function*(){const r=!fa();return yield t.database.connect(i,r),t})}}return n.\u0275fac=function(t){return new(t||n)(Ie(Qm))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),Qke=(()=>{class n extends Kke{createDatabase(t){return{database:new ONe(t),unsubscribe:()=>{}}}}return n.\u0275fac=function(){let e;return function(i){return(e||(e=zi(n)))(i||n)}}(),n.\u0275prov=We({token:n,factory:n.\u0275fac,providedIn:"root"}),n})(),Zke=(()=>{class n extends wq{constructor(t,i){super(),this.impl$=t.config$.pipe(r=>r,me(r=>this.selectToken(r)),ld(),me(r=>i.get(r)),Wa(1))}}return n.\u0275fac=function(t){return new(t||n)(Ie(Qm),Ie(Hn))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),Zk=(()=>{class n{}return n.type="[CallToAction] Learn More",n})(),Jk=(()=>{class n{}return n.type="[CallToAction] Open Dialog",n})(),eF=(()=>{class n{}return n.type="[CallToAction] Close Dialog",n})();var tF;class wa{get length(){var e,t;return null!==(t=null===(e=wa.storage)||void 0===e?void 0:e.length)&&void 0!==t?t:0}key(e){var t,i;return null!==(i=null===(t=wa.storage)||void 0===t?void 0:t.key(e))&&void 0!==i?i:null}getItem(e,t){var i,r,s;return null!==(s=null!==(r=null===(i=wa.storage)||void 0===i?void 0:i.getItem(e))&&void 0!==r?r:t)&&void 0!==s?s:null}setItem(e,t){var i;try{return null===(i=wa.storage)||void 0===i||i.setItem(e,t),!0}catch(r){return!1}}removeItem(e){var t;null===(t=wa.storage)||void 0===t||t.removeItem(e)}clear(){var e;null===(e=wa.storage)||void 0===e||e.clear()}}wa.storage=(()=>{let n;try{n=window.localStorage;const e="__storage_test__";return n.setItem(e,e),n.removeItem(e),n}catch(e){return e instanceof DOMException&&(22===e.code||1014===e.code||"QuotaExceededError"===e.name||"NS_ERROR_DOM_QUOTA_REACHED"===e.name)&&n&&0!==n.length?n:void 0}})(),wa.\u0275fac=function(e){return new(e||wa)},wa.\u0275prov=We({token:wa,factory:wa.\u0275fac,providedIn:"root"});const Cq="callToActionPopupShown";let Ro=tF=class{constructor(e,t,i,r,s){this.dialog=e,this.ga=t,this.storage=i,this.infoService=r,this.http=s}static ctaDatePassed(e,t=Date.now){return+t()>+new Date(e)}ngxsOnInit(e){const{expirationDate:t,popupShown:i}=e.getState(),r=this.storage.getItem(Cq,`${i}`),s=tF.ctaDatePassed(t);"true"!==r&&!s&&e.dispatch(new Jk)}getDialogData(){return this.http.get("assets/docs/SPATIAL_SEARCH_README.md",{responseType:"text"}).pipe(me(e=>this.infoService.parseMarkdown(e)))}launchLearnMore(e){this.dialog.open(bq,{autoFocus:!1,panelClass:"modal-animated",width:"72rem",data:{title:"Spatial Search",content:e,videoID:"UfxMpzatowE"}})}learnMore(e){return this.dialog.closeAll(),this.ga.event("open_learn_more","call_to_action"),this.getDialogData().pipe(cr(t=>this.launchLearnMore(t)))}open(e){this.dialog.open(eFe,{autoFocus:!1,panelClass:"modal-animated",width:"30.75rem",height:"36.688rem"}),this.ga.event("open","call_to_action"),this.storage.setItem(Cq,"true"),e.patchState({popupShown:!0})}close(e){this.dialog.closeAll(),this.ga.event("close","call_to_action")}};Ro.\u0275fac=function(e){return new(e||Ro)(Ie(Nb),Ie(qb),Ie(wa),Ie(vq),Ie(_u))},Ro.\u0275prov=We({token:Ro,factory:Ro.\u0275fac}),Ei([yP(Zk)],Ro.prototype,"learnMore",null),Ei([yP(Jk)],Ro.prototype,"open",null),Ei([yP(eF)],Ro.prototype,"close",null),Ro=tF=Ei([A5({name:"callToAction",defaults:{title:"New to the Exploration User Interface",message:"Spatial Search has arrived!",callToAction:"Learn More",imageUrl:"assets/images/spatial_search.gif",expirationDate:"Dec 1, 2022",popupShown:!1}})],Ro);let E1=(()=>{class n{static title(t){return t.title}static message(t){return t.message}static callToAction(t){return t.callToAction}static imageUrl(t){return t.imageUrl}static expirationDate(t){return t.expirationDate}static popupShown(t){return t.popupShown}}return Ei([_m([Ro])],n,"title",null),Ei([_m([Ro])],n,"message",null),Ei([_m([Ro])],n,"callToAction",null),Ei([_m([Ro])],n,"imageUrl",null),Ei([_m([Ro])],n,"expirationDate",null),Ei([_m([Ro])],n,"popupShown",null),n})(),eFe=(()=>{class n{constructor(){this.close=()=>new eF,this.learnMore=()=>new Zk}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=rn({type:n,selectors:[["ccf-call-to-action-behavior"]],decls:5,vars:12,consts:[[3,"infoTitle","message","callToAction","imageUrl","callToActionClicked","closeClicked"]],template:function(t,i){1&t&&(wt(0,"ccf-call-to-action",0),Tn("callToActionClicked",function(){return i.learnMore()})("closeClicked",function(){return i.close()}),Ps(1,"async"),Ps(2,"async"),Ps(3,"async"),Ps(4,"async"),Et()),2&t&&Jt("infoTitle",To(1,4,i.title$))("message",To(2,6,i.message$))("callToAction",To(3,8,i.callToAction$))("imageUrl",To(4,10,i.imageUrl$))},directives:[Uke],pipes:[g0],styles:[""],changeDetection:0}),Ei([PS(E1.title)],n.prototype,"title$",void 0),Ei([PS(E1.message)],n.prototype,"message$",void 0),Ei([PS(E1.callToAction)],n.prototype,"callToAction$",void 0),Ei([PS(E1.imageUrl)],n.prototype,"imageUrl$",void 0),Ei([oq()],n.prototype,"close",void 0),Ei([oq()],n.prototype,"learnMore",void 0),n})(),iFe=(()=>{class n{constructor(t){this.source=t,this.organs=yq}getOrganInfo(t,i,r="Female"){let s=this.organs.find(a=>a.id===t);if(!s)return sn(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)),sn(s)}getOrgan(t,i="Both"){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}):sn([])}getOrganStats(t,i="Female"){return t.id?this.source.getAggregateResults({ontologyTerms:[t.id],sex:i}):sn([])}getBlocks(t,i="Female"){return t.id?this.source.getTissueBlockResults({ontologyTerms:[t.id],sex:i}):sn([])}}return n.\u0275fac=function(t){return new(t||n)(Ie(Eq))},n.\u0275prov=We({token:n,factory:n.\u0275fac,providedIn:"root"}),n})();const rFe=["thumbContainer"],sFe=["toggleBar"],oFe=["input"],aFe=function(n){return{enterDuration:n}},lFe=["*"],cFe=new Ht("mat-slide-toggle-default-options",{providedIn:"root",factory:()=>({disableToggleValue:!1})});let uFe=0;const dFe={provide:Xo,useExisting:ge(()=>Tq),multi:!0};class hFe{constructor(e,t){this.source=e,this.checked=t}}const fFe=wC(Mm(Ch(Am(class{constructor(n){this._elementRef=n}}))));let Tq=(()=>{class n extends fFe{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-"+ ++uFe,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 ln,this.toggleChange=new ln,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=bi(t)}get checked(){return this._checked}set checked(t){this._checked=bi(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 hFe(this,this.checked))}_onLabelTextChange(){this._changeDetectorRef.detectChanges()}}return n.\u0275fac=function(t){return new(t||n)(Ce(gn),Ce(vc),Ce(Mr),yo("tabindex"),Ce(cFe),Ce(Qa,8))},n.\u0275cmp=rn({type:n,selectors:[["mat-slide-toggle"]],viewQuery:function(t,i){if(1&t&&(hr(rFe,5),hr(sFe,5),hr(oFe,5)),2&t){let r;Gn(r=$n())&&(i._thumbEl=r.first),Gn(r=$n())&&(i._thumbBarEl=r.first),Gn(r=$n())&&(i._inputElement=r.first)}},hostAttrs:[1,"mat-slide-toggle"],hostVars:12,hostBindings:function(t,i){2&t&&(qc("id",i.id),Ii("tabindex",i.disabled?null:-1)("aria-label",null)("aria-labelledby",null),ai("mat-checked",i.checked)("mat-disabled",i.disabled)("mat-slide-toggle-label-before","before"==i.labelPosition)("_mat-animation-noopable",i._noopAnimations))},inputs:{disabled:"disabled",disableRipple:"disableRipple",color:"color",tabIndex:"tabIndex",name:"name",id:"id",labelPosition:"labelPosition",ariaLabel:["aria-label","ariaLabel"],ariaLabelledby:["aria-labelledby","ariaLabelledby"],required:"required",checked:"checked",ariaDescribedby:["aria-describedby","ariaDescribedby"]},outputs:{change:"change",toggleChange:"toggleChange"},exportAs:["matSlideToggle"],features:[Vn([dFe]),En],ngContentSelectors:lFe,decls:16,vars:20,consts:[[1,"mat-slide-toggle-label"],["label",""],[1,"mat-slide-toggle-bar"],["toggleBar",""],["type","checkbox","role","switch",1,"mat-slide-toggle-input","cdk-visually-hidden",3,"id","required","tabIndex","checked","disabled","change","click"],["input",""],[1,"mat-slide-toggle-thumb-container"],["thumbContainer",""],[1,"mat-slide-toggle-thumb"],["mat-ripple","",1,"mat-slide-toggle-ripple","mat-focus-indicator",3,"matRippleTrigger","matRippleDisabled","matRippleCentered","matRippleRadius","matRippleAnimation"],[1,"mat-ripple-element","mat-slide-toggle-persistent-ripple"],[1,"mat-slide-toggle-content",3,"cdkObserveContent"],["labelContent",""],[2,"display","none"]],template:function(t,i){if(1&t&&(Hr(),wt(0,"label",0,1),wt(2,"div",2,3),wt(4,"input",4,5),Tn("change",function(s){return i._onChangeEvent(s)})("click",function(s){return i._onInputClick(s)}),Et(),wt(6,"div",6,7),ni(8,"div",8),wt(9,"div",9),ni(10,"div",10),Et(),Et(),Et(),wt(11,"span",11,12),Tn("cdkObserveContent",function(){return i._onLabelTextChange()}),wt(13,"span",13),Jn(14,"\xa0"),Et(),oi(15),Et(),Et()),2&t){const r=ih(1),s=ih(12);Ii("for",i.inputId),zt(2),ai("mat-slide-toggle-bar-no-side-margin",!s.textContent||!s.textContent.trim()),zt(2),Jt("id",i.inputId)("required",i.required)("tabIndex",i.tabIndex)("checked",i.checked)("disabled",i.disabled),Ii("name",i.name)("aria-checked",i.checked.toString())("aria-label",i.ariaLabel)("aria-labelledby",i.ariaLabelledby)("aria-describedby",i.ariaDescribedby),zt(5),Jt("matRippleTrigger",r)("matRippleDisabled",i.disableRipple||i.disabled)("matRippleCentered",!0)("matRippleRadius",20)("matRippleAnimation",function(n,e,t,i){return E3(Vt(),Cs(),n,e,t,i)}(18,aFe,i._noopAnimations?0:150))}},directives:[gu,$P],styles:[".mat-slide-toggle{display:inline-block;height:24px;max-width:100%;line-height:24px;white-space:nowrap;outline:none;-webkit-tap-highlight-color:transparent}.mat-slide-toggle.mat-checked .mat-slide-toggle-thumb-container{transform:translate3d(16px, 0, 0)}[dir=rtl] .mat-slide-toggle.mat-checked .mat-slide-toggle-thumb-container{transform:translate3d(-16px, 0, 0)}.mat-slide-toggle.mat-disabled{opacity:.38}.mat-slide-toggle.mat-disabled .mat-slide-toggle-label,.mat-slide-toggle.mat-disabled .mat-slide-toggle-thumb-container{cursor:default}.mat-slide-toggle-label{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:flex;flex:1;flex-direction:row;align-items:center;height:inherit;cursor:pointer}.mat-slide-toggle-content{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mat-slide-toggle-label-before .mat-slide-toggle-label{order:1}.mat-slide-toggle-label-before .mat-slide-toggle-bar{order:2}[dir=rtl] .mat-slide-toggle-label-before .mat-slide-toggle-bar,.mat-slide-toggle-bar{margin-right:8px;margin-left:0}[dir=rtl] .mat-slide-toggle-bar,.mat-slide-toggle-label-before .mat-slide-toggle-bar{margin-left:8px;margin-right:0}.mat-slide-toggle-bar-no-side-margin{margin-left:0;margin-right:0}.mat-slide-toggle-thumb-container{position:absolute;z-index:1;width:20px;height:20px;top:-3px;left:0;transform:translate3d(0, 0, 0);transition:all 80ms linear;transition-property:transform}._mat-animation-noopable .mat-slide-toggle-thumb-container{transition:none}[dir=rtl] .mat-slide-toggle-thumb-container{left:auto;right:0}.mat-slide-toggle-thumb{height:20px;width:20px;border-radius:50%}.mat-slide-toggle-bar{position:relative;width:36px;height:14px;flex-shrink:0;border-radius:8px}.mat-slide-toggle-input{bottom:0;left:10px}[dir=rtl] .mat-slide-toggle-input{left:auto;right:10px}.mat-slide-toggle-bar,.mat-slide-toggle-thumb{transition:all 80ms linear;transition-property:background-color;transition-delay:50ms}._mat-animation-noopable .mat-slide-toggle-bar,._mat-animation-noopable .mat-slide-toggle-thumb{transition:none}.mat-slide-toggle .mat-slide-toggle-ripple{position:absolute;top:calc(50% - 20px);left:calc(50% - 20px);height:40px;width:40px;z-index:1;pointer-events:none}.mat-slide-toggle .mat-slide-toggle-ripple .mat-ripple-element:not(.mat-slide-toggle-persistent-ripple){opacity:.12}.mat-slide-toggle-persistent-ripple{width:100%;height:100%;transform:none}.mat-slide-toggle-bar:hover .mat-slide-toggle-persistent-ripple{opacity:.04}.mat-slide-toggle:not(.mat-disabled).cdk-keyboard-focused .mat-slide-toggle-persistent-ripple{opacity:.12}.mat-slide-toggle-persistent-ripple,.mat-slide-toggle.mat-disabled .mat-slide-toggle-bar:hover .mat-slide-toggle-persistent-ripple{opacity:0}@media(hover: none){.mat-slide-toggle-bar:hover .mat-slide-toggle-persistent-ripple{display:none}}.cdk-high-contrast-active .mat-slide-toggle-thumb,.cdk-high-contrast-active .mat-slide-toggle-bar{border:1px solid}.cdk-high-contrast-active .mat-slide-toggle.cdk-keyboard-focused .mat-slide-toggle-bar{outline:2px dotted;outline-offset:5px}\n"],encapsulation:2,changeDetection:0}),n})(),Aq=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=tn({type:n}),n.\u0275inj=St({}),n})(),mFe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=tn({type:n}),n.\u0275inj=St({imports:[[Aq,Dm,ji,QS],Aq,ji]}),n})(),_Fe=(()=>{class n{constructor(){this.clsName="ccf-slide-toggle",this.labels=["Left","Right"],this.value="Left",this.disabled=!1,this.valueChange=new ln}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=rn({type:n,selectors:[["ccf-slide-toggle"]],hostVars:2,hostBindings:function(t,i){2&t&&Va(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=wl();wt(0,"span",0),Tn("click",function(){_r(r);const o=ih(3);return i.left||o.toggle(),i.updateToggle(!0)}),Jn(1),Et(),wt(2,"mat-slide-toggle",1,2),Tn("change",function(o){return i.updateToggle(!o.checked)}),Et(),wt(4,"span",0),Tn("click",function(){_r(r);const o=ih(3);return i.left&&o.toggle(),i.updateToggle(!1)}),Jn(5),Et()}2&t&&(ai("disabled",i.disabled)("highlighted",i.left),zt(1),gs(i.labels[0].charAt(0).toUpperCase()+i.labels[0].slice(1)),zt(1),Jt("disabled",i.disabled)("checked",!i.left),zt(2),ai("disabled",i.disabled)("highlighted",!i.left),zt(1),gs(i.labels[1].charAt(0).toUpperCase()+i.labels[1].slice(1)))},directives:[Tq],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 yFe=["bodyUI"],bFe=function(){return["Male","Female"]},vFe=function(){return["Left","Right"]};let wFe=(()=>{class n{constructor(t){this.ga=t,this.sexChange=new ln,this.sideChange=new ln}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.zoomToFitOrgan()}updateSex(t){this.sex=t,this.sexChange.emit(this.sex)}updateSide(t){this.side=t,this.sideChange.emit(this.side)}zoomToFitOrgan(){const{bodyUI:t,organ:i}=this;if(i){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)(Ce(qb))},n.\u0275cmp=rn({type:n,selectors:[["ccf-organ"]],viewQuery:function(t,i){if(1&t&&hr(yFe,7),2&t){let r;Gn(r=$n())&&(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:[Fi],decls:5,vars:10,consts:[["camera","perspective",1,"body-ui",3,"scene","interactive","nodeClick","initialized"],["bodyUI",""],[1,"stage-options"],[1,"view-slider",3,"labels","value","hidden","valueChange"]],template:function(t,i){1&t&&(wt(0,"ccf-body-ui",0,1),Tn("nodeClick",function(s){return i.nodeClicked(s)})("initialized",function(){return i.zoomToFitOrgan()}),Et(),wt(2,"div",2),wt(3,"ccf-slide-toggle",3),Tn("valueChange",function(s){return i.updateSex(s)}),Et(),wt(4,"ccf-slide-toggle",3),Tn("valueChange",function(s){return i.updateSide(s)}),Et(),Et()),2&t&&(Jt("scene",i.scene)("interactive",!0),zt(3),Jt("labels",TE(8,bFe))("value",i.sex)("hidden",!i.sex),zt(1),Jt("labels",TE(9,vFe))("value",i.side)("hidden",!i.side))},directives:[_ke,_Fe],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 EFe(n,e){if(1&n&&(wt(0,"div",3),wt(1,"div",4),Jn(2),Et(),wt(3,"div",5),Jn(4),Et(),Et()),2&n){const t=e.$implicit;zt(2),gs(t.count),zt(2),gs(t.label)}}let xFe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=rn({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&&(wt(0,"div",0),wt(1,"div",1),Jn(2),Et(),wi(3,EFe,5,2,"div",2),Et()),2&t&&(zt(2),xo(" ",i.statsLabel," "),zt(1),Jt("ngForOf",i.stats))},directives:[Yu],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 SFe(n,e){if(1&n){const t=wl();wt(0,"div",6),wt(1,"div",7),wt(2,"div",8),Jn(3),Et(),wt(4,"div",9),Tn("click",function(){const s=_r(t).$implicit;return _i().goToURL(s.buttonUrl)}),Jn(5),Et(),Et(),Et()}if(2&n){const t=e.$implicit;zt(3),gs(t.body),zt(1),Jt("gaLabel",t.buttonUrl),zt(1),xo(" ",t.buttonTitle,"")}}function CFe(n,e){if(1&n){const t=wl();wt(0,"div",10),Tn("click",function(){const s=_r(t).$implicit;return _i().goToURL(s.buttonUrl)}),Jn(1),Et()}if(2&n){const t=e.$implicit;Jt("gaLabel",t.buttonUrl),zt(1),gs(t.buttonTitle)}}let TFe=(()=>{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=rn({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&&(wt(0,"div",0),wi(1,SFe,6,3,"div",1),Et(),wt(2,"div",2),wt(3,"div",3),Jn(4,"Common Coordinate Framework (CCF) Deep Dive"),Et(),wt(5,"div",4),wi(6,CFe,2,2,"div",5),Et(),Et()),2&t&&(zt(1),Jt("ngForOf",i.linkCards),zt(5),Jt("ngForOf",i.deepDives))},directives:[g9,Yu,m9],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 AFe=["left"],MFe=["right"],DFe=function(){return[]},IFe=[{color:[0,0,0,0],opacity:.001}];let OFe=(()=>{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(cr(s=>this.latestConfig=s),is(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)}),cr(s=>this.logOrganLookup(s)),cr(s=>this.latestOrganInfo=s),Wa(1)),this.organ$=this.organInfo$.pipe(is(s=>s?t.getOrgan(s,s.hasSex?this.latestConfig.sex:void 0):sn(void 0)),cr(s=>{var o;if(s&&this.latestOrganInfo){const a=(null===(o=this.latestOrganInfo)||void 0===o?void 0:o.hasSex)?s.sex:void 0;a!==this.latestConfig.sex&&this.updateInput("sex",a),s.side!==this.latestConfig.side&&this.updateInput("side",s.side)}}),Wa(1)),this.scene$=this.organ$.pipe(is(s=>s&&this.latestOrganInfo?t.getOrganScene(this.latestOrganInfo,s.sex):sn(IFe))),this.stats$=this.organ$.pipe(is(s=>s&&this.latestOrganInfo?t.getOrganStats(this.latestOrganInfo,s.sex):sn([]))),this.statsLabel$=this.organ$.pipe(me(s=>this.makeStatsLabel(this.latestOrganInfo,null==s?void 0:s.sex)),Oo("Loading...")),this.blocks$=this.organ$.pipe(is(s=>s&&this.latestOrganInfo?t.getBlocks(this.latestOrganInfo,s.sex):sn([])))}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,i){let r=[`Unknown IRI: ${this.latestConfig.organIri}`];if(t){const s=t.side?t.side.charAt(0).toUpperCase()+t.side.slice(1):void 0;r=[i,t.organ,s]}return r.filter(s=>!!s).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)(Ce(iFe),Ce(qb),Ce(Qm))},n.\u0275cmp=rn({type:n,selectors:[["ccf-root"]],viewQuery:function(t,i){if(1&t&&(hr(AFe,7,gn),hr(MFe,7,gn)),2&t){let r;Gn(r=$n())&&(i.left=r.first),Gn(r=$n())&&(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&&(wt(0,"div",0),wt(1,"div",1,2),wt(3,"ccf-organ",3),Tn("sexChange",function(s){return i.updateInput("sex",s)})("sideChange",function(s){return i.updateInput("side",s)}),Ps(4,"async"),Ps(5,"async"),Ps(6,"async"),Ps(7,"async"),Ps(8,"async"),Ps(9,"async"),Et(),Et(),wt(10,"div",4,5),ni(12,"ccf-stats-list",6),Ps(13,"async"),Ps(14,"async"),ni(15,"ccf-link-cards"),Et(),Et()),2&t){let r;zt(3),Jt("blocks",To(4,8,i.blocks$))("filter",To(5,10,i.filter$))("sex",To(6,12,i.sex$))("side",To(7,14,i.side$))("organ",To(8,16,i.organ$))("scene",null!==(r=To(9,18,i.scene$))&&void 0!==r?r:TE(24,DFe)),zt(9),Jt("statsLabel",To(13,20,i.statsLabel$))("stats",To(14,22,i.stats$))}},directives:[wFe,xFe,TFe],pipes:[g0],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 RFe(n,e){1&n&&ni(0,"ccf-root")}function PFe(n){const e=i=>"string"==typeof i,t=i=>Array.isArray(i)&&i.every(e);if("string"==typeof n){const i=XD.json(n);if(t(i))return i}else if(t(n))return n;throw new Error("Invalid data sources")}function NFe(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=XD.json(n);if(t(i))return i}}else if(t(n))return n;throw new Error("Invalid data sources")}let kFe=(()=>{class n extends fie{constructor(t,i){super(t,i,{initialDelay:10,initialConfig:Object.assign(Object.assign({},If.dbOptions),globalThis.dbOptions),parse:{dataSources:PFe,highlightProviders:NFe,useRemoteApi:XD.boolean}}),this.sex="Female",this.side="Left"}}return n.\u0275fac=function(t){return new(t||n)(Ce(Qm),Ce(Mr))},n.\u0275cmp=rn({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",useRemoteApi:"useRemoteApi",remoteApiEndpoint:"remoteApiEndpoint"},features:[En],decls:1,vars:1,consts:[[4,"ngIf"]],template:function(t,i){1&t&&wi(0,RFe,1,0,"ccf-root",0),2&t&&Jt("ngIf",i.initialized)},directives:[ac,OFe],encapsulation:2,changeDetection:0}),n})(),FFe=(()=>{class n extends Zke{selectToken(t){return t.useRemoteApi&&t.remoteApiEndpoint?Xke:Qke}}return n.\u0275fac=function(){let e;return function(i){return(e||(e=zi(n)))(i||n)}}(),n.\u0275prov=We({token:n,factory:n.\u0275fac,providedIn:"root"}),n})(),LFe=(()=>{class n{constructor(t,i){this.accessor=t,this.injector=i}static forRoot(t=[]){return{ngModule:n,providers:[hs,el,a7,...t]}}}return n.\u0275fac=function(t){return new(t||n)(Ie(hs,2),Ie(el,2))},n.\u0275mod=tn({type:n}),n.\u0275inj=St({}),n})();const x1=(n,e)=>((n,e)=>new Array(e+1).join("0"))(0,e-n.toString().length)+n;class jFe{constructor(e,t,i){this.action=e,this.store=t,this.logWriter=i}dispatched(e){const t=qf(this.action),i=function(n){return x1(n.getHours(),2)+":"+x1(n.getMinutes(),2)+":"+x1(n.getSeconds(),2)+"."+x1(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 UFe{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 Mq=new Ht("NGXS_LOGGER_PLUGIN_OPTIONS");let zFe=(()=>{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 UFe(this._options),this._store=this._store||this._injector.get(hu);const s=new jFe(i,this._store,this._logWriter);return s.dispatched(t),r(t,i).pipe(cr(o=>{s.completed(o)}),bc(o=>{throw s.errored(o),o}))}}return n.\u0275fac=function(t){return new(t||n)(Ie(Mq),Ie(Hn))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const Dq=new Ht("LOGGER_USER_OPTIONS");function HFe(n){return Object.assign({},{logger:console,collapsed:!1,disabled:!1,filter:()=>!0},n)}let GFe=(()=>{class n{static forRoot(t){return{ngModule:n,providers:[{provide:h5,useClass:zFe,multi:!0},{provide:Dq,useValue:t},{provide:Mq,useFactory:HFe,deps:[Dq]}]}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=tn({type:n}),n.\u0275inj=St({}),n})();const $Fe=[Qm];let WFe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=tn({type:n}),n.\u0275inj=St({imports:[[LFe.forRoot(),Yo.forRoot($Fe,{developmentMode:!If.production}),GFe.forRoot({disabled:If.production})]]}),n})(),qFe=(()=>{class n{constructor(t){if(t)throw new Error("The core module should only be imported once in the root module")}}return n.\u0275fac=function(t){return new(t||n)(Ie(n,12))},n.\u0275mod=tn({type:n}),n.\u0275inj=St({providers:[{provide:Eq,useExisting:FFe}],imports:[[CW,oRe.forRoot({gaToken:If.googleAnalyticsToken,appName:"organ-info",projectName:"ccf",developmentMode:!If.production}),pRe.forRoot(()=>new Yb({basePath:If.dbOptions.remoteApiEndpoint})),WFe]]}),n})(),YFe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=tn({type:n}),n.\u0275inj=St({imports:[[fr,mFe]]}),n})(),XFe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=tn({type:n}),n.\u0275inj=St({imports:[[fr,yke,YFe]]}),n})(),KFe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=tn({type:n}),n.\u0275inj=St({imports:[[fr,r1]]}),n})(),QFe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=tn({type:n}),n.\u0275inj=St({imports:[[fr]]}),n})(),ZFe=(()=>{class n{constructor(t){this.injector=t}ngDoBootstrap(){const t=function(n,e){const t=function(n,e){return e.get(El).resolveComponentFactory(n).inputs}(n,e.injector),i=e.strategyFactory||new aie(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 cie{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,u){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}(kFe,{injector:this.injector});customElements.define("ccf-organ-info",t)}}return n.\u0275fac=function(t){return new(t||n)(Ie(Hn))},n.\u0275mod=tn({type:n}),n.\u0275inj=St({providers:[],imports:[[WD,qFe,KFe,QFe,XFe]]}),n})();If.production&&function(){if(iB)throw new Error("Cannot enable prod mode after platform setup.");nB=!1}(),Ine().bootstrapModule(ZFe).catch(n=>console.error(n))},1052:Ut=>{function it(yt,ee,Dt,dt,Y,Se,he){try{var W=yt[Se](he),j=W.value}catch(k){return void Dt(k)}W.done?ee(j):Promise.resolve(j).then(dt,Y)}Ut.exports=function(yt){return function(){var ee=this,Dt=arguments;return new Promise(function(dt,Y){var Se=yt.apply(ee,Dt);function he(j){it(Se,dt,Y,he,W,"next",j)}function W(j){it(Se,dt,Y,he,W,"throw",j)}he(void 0)})}},Ut.exports.default=Ut.exports,Ut.exports.__esModule=!0},1948:Ut=>{Ut.exports=function(et){return et&&et.__esModule?et:{default:et}},Ut.exports.default=Ut.exports,Ut.exports.__esModule=!0},4321:Ut=>{function it(et){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(Ut.exports=it=function(ee){return typeof ee},Ut.exports.default=Ut.exports,Ut.exports.__esModule=!0):(Ut.exports=it=function(ee){return ee&&"function"==typeof Symbol&&ee.constructor===Symbol&&ee!==Symbol.prototype?"symbol":typeof ee},Ut.exports.default=Ut.exports,Ut.exports.__esModule=!0),it(et)}Ut.exports=it,Ut.exports.default=Ut.exports,Ut.exports.__esModule=!0},9082:Ut=>{function it(et){return Promise.resolve().then(()=>{var yt=new Error("Cannot find module '"+et+"'");throw yt.code="MODULE_NOT_FOUND",yt})}it.keys=()=>[],it.resolve=it,it.id=9082,Ut.exports=it},9521:()=>{},9125:()=>{},5307:()=>{}},Ut=>{Ut(Ut.s=2829)}]); \ No newline at end of file diff --git a/organ-info/wc.js b/organ-info/wc.js index 3209e7554..26eab54af 100644 --- a/organ-info/wc.js +++ b/organ-info/wc.js @@ -2,4 +2,4 @@ (self.webpackChunkccf_ui=self.webpackChunkccf_ui||[]).push([[429],{4138:()=>{!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)},7277:()=>{"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"))})},8454:(G,ne,he)=>{"use strict";he(7277),he(142),he(4138)}},G=>{G(G.s=8454)}]); /*! (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 JFe=Object.defineProperty,e2e=Object.defineProperties,t2e=Object.getOwnPropertyDescriptors,S1=Object.getOwnPropertySymbols,Oq=Object.prototype.hasOwnProperty,Rq=Object.prototype.propertyIsEnumerable,Er=Math.pow,Pq=(Ut,it,et)=>it in Ut?JFe(Ut,it,{enumerable:!0,configurable:!0,writable:!0,value:et}):Ut[it]=et,ot=(Ut,it)=>{for(var et in it||(it={}))Oq.call(it,et)&&Pq(Ut,et,it[et]);if(S1)for(var et of S1(it))Rq.call(it,et)&&Pq(Ut,et,it[et]);return Ut},Sn=(Ut,it)=>e2e(Ut,t2e(it)),Nq=(Ut,it)=>{var et={};for(var yt in Ut)Oq.call(Ut,yt)&&it.indexOf(yt)<0&&(et[yt]=Ut[yt]);if(null!=Ut&&S1)for(var yt of S1(Ut))it.indexOf(yt)<0&&Rq.call(Ut,yt)&&(et[yt]=Ut[yt]);return et};(self.webpackChunkccf_ui=self.webpackChunkccf_ui||[]).push([[179],{1440:(Ut,it,et)=>{var yt=et(1052).default;Ut.exports=function Y(Se,he,W){function j(H,v){if(!he[H]){if(!Se[H]){if(k)return k(H,!0);var R=new Error("Cannot find module '"+H+"'");throw R.code="MODULE_NOT_FOUND",R}var T=he[H]={exports:{}};Se[H][0].call(T.exports,function(b){return j(Se[H][1][b]||b)},T,T.exports,Y,Se,he,W)}return he[H].exports}for(var k=void 0,Q=0;Q0&&G[G.length-1])&&(6===_t[0]||2===_t[0])){qe=0;continue}if(3===_t[0]&&(!G||_t[1]>G[0]&&_t[1]0?ue-4:ue;for($=0;$>16&255,O[K++]=P>>8&255,O[K++]=255&P;return 2===I&&(P=j[z.charCodeAt($)]<<2|j[z.charCodeAt($+1)]>>4,O[K++]=255&P),1===I&&(P=j[z.charCodeAt($)]<<10|j[z.charCodeAt($+1)]<<4|j[z.charCodeAt($+2)]>>2,O[K++]=P>>8&255,O[K++]=255&P),O},he.fromByteArray=function(z){for(var P,X=z.length,ue=X%3,I=[],O=16383,K=0,E=X-ue;KE?E:K+O));return 1===ue?I.push(W[(P=z[X-1])>>2]+W[P<<4&63]+"=="):2===ue&&I.push(W[(P=(z[X-2]<<8)+z[X-1])>>10]+W[P>>4&63]+W[P<<2&63]+"="),I.join("")};for(var W=[],j=[],k="undefined"!=typeof Uint8Array?Uint8Array:Array,Q="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",H=0,v=Q.length;H0)throw new Error("Invalid string. Length must be a multiple of 4");var X=z.indexOf("=");return-1===X&&(X=P),[X,X===P?0:4-X%4]}function y(z){return W[z>>18&63]+W[z>>12&63]+W[z>>6&63]+W[63&z]}function S(z,P,X){for(var I=[],O=P;O>5==6?2:I>>4==14?3:I>>3==30?4:I>>6==2?-1:-2}function T(I){var O=this.lastTotal-this.lastNeed,K=function(I,O,K){if(128!=(192&O[0]))return I.lastNeed=0,"\ufffd";if(I.lastNeed>1&&O.length>1){if(128!=(192&O[1]))return I.lastNeed=1,"\ufffd";if(I.lastNeed>2&&O.length>2&&128!=(192&O[2]))return I.lastNeed=2,"\ufffd"}}(this,I);return void 0!==K?K:this.lastNeed<=I.length?(I.copy(this.lastChar,O,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(I.copy(this.lastChar,O,0,I.length),void(this.lastNeed-=I.length))}function S(I,O){if((I.length-O)%2==0){var K=I.toString("utf16le",O);if(K){var E=K.charCodeAt(K.length-1);if(E>=55296&&E<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=I[I.length-2],this.lastChar[1]=I[I.length-1],K.slice(0,-1)}return K}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=I[I.length-1],I.toString("utf16le",O,I.length-1)}function A(I){var O=I&&I.length?this.write(I):"";return this.lastNeed?O+this.lastChar.toString("utf16le",0,this.lastTotal-this.lastNeed):O}function z(I,O){var K=(I.length-O)%3;return 0===K?I.toString("base64",O):(this.lastNeed=3-K,this.lastTotal=3,1===K?this.lastChar[0]=I[I.length-1]:(this.lastChar[0]=I[I.length-2],this.lastChar[1]=I[I.length-1]),I.toString("base64",O,I.length-K))}function P(I){var O=I&&I.length?this.write(I):"";return this.lastNeed?O+this.lastChar.toString("base64",0,3-this.lastNeed):O}function X(I){return I.toString(this.encoding)}function ue(I){return I&&I.length?this.write(I):""}he.StringDecoder=H,H.prototype.write=function(I){if(0===I.length)return"";var O,K;if(this.lastNeed){if(void 0===(O=this.fillLast(I)))return"";K=this.lastNeed,this.lastNeed=0}else K=0;return K=0?($>0&&(I.lastNeed=$-1),$):--E=0?($>0&&(I.lastNeed=$-2),$):--E=0?($>0&&(2===$?$=0:I.lastNeed=$-3),$):0}(this,I,O);if(!this.lastNeed)return I.toString("utf8",O);this.lastTotal=K;var E=I.length-(K-this.lastNeed);return I.copy(this.lastChar,0,E),I.toString("utf8",O,E)},H.prototype.fillLast=function(I){if(this.lastNeed<=I.length)return I.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);I.copy(this.lastChar,this.lastTotal-this.lastNeed,0,I.length),this.lastNeed-=I.length}},{"safe-buffer":4}],6:[function(Y,Se,he){(function(W){(function(){"use strict";var j=Y("base64-js"),k=Y("ieee754");he.Buffer=C,he.SlowBuffer=function(B){return+B!=B&&(B=0),C.alloc(+B)},he.INSPECT_MAX_BYTES=50;var Q=2147483647;function v(B){if(B>Q)throw new RangeError('The value "'+B+'" is invalid for option "size"');var N=new Uint8Array(B);return N.__proto__=C.prototype,N}function C(B,N,V){if("number"==typeof B){if("string"==typeof N)throw new TypeError('The "string" argument must be of type string. Received type number');return y(B)}return R(B,N,V)}function R(B,N,V){if("string"==typeof B)return function(B,N){if(("string"!=typeof N||""===N)&&(N="utf8"),!C.isEncoding(N))throw new TypeError("Unknown encoding: "+N);var V=0|I(B,N),Re=v(V),Ze=Re.write(B,N);return Ze!==V&&(Re=Re.slice(0,Ze)),Re}(B,N);if(ArrayBuffer.isView(B))return A(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,N,V){if(N<0||B.byteLength=Q)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Q.toString(16)+" bytes");return 0|B}function I(B,N){if(C.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 V=B.length,Re=arguments.length>2&&!0===arguments[2];if(!Re&&0===V)return 0;for(var Ze=!1;;)switch(N){case"ascii":case"latin1":case"binary":return V;case"utf8":case"utf-8":return G(B).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*V;case"hex":return V>>>1;case"base64":return je(B).length;default:if(Ze)return Re?-1:G(B).length;N=(""+N).toLowerCase(),Ze=!0}}function O(B,N,V){var Re=!1;if((void 0===N||N<0)&&(N=0),N>this.length||((void 0===V||V>this.length)&&(V=this.length),V<=0)||(V>>>=0)<=(N>>>=0))return"";for(B||(B="utf8");;)switch(B){case"hex":return tt(this,N,V);case"utf8":case"utf-8":return ye(this,N,V);case"ascii":return st(this,N,V);case"latin1":case"binary":return Qe(this,N,V);case"base64":return ne(this,N,V);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Xe(this,N,V);default:if(Re)throw new TypeError("Unknown encoding: "+B);B=(B+"").toLowerCase(),Re=!0}}function K(B,N,V){var Re=B[N];B[N]=B[V],B[V]=Re}function E(B,N,V,Re,Ze){if(0===B.length)return-1;if("string"==typeof V?(Re=V,V=0):V>2147483647?V=2147483647:V<-2147483648&&(V=-2147483648),we(V=+V)&&(V=Ze?0:B.length-1),V<0&&(V=B.length+V),V>=B.length){if(Ze)return-1;V=B.length-1}else if(V<0){if(!Ze)return-1;V=0}if("string"==typeof N&&(N=C.from(N,Re)),C.isBuffer(N))return 0===N.length?-1:$(B,N,V,Re,Ze);if("number"==typeof N)return N&=255,"function"==typeof Uint8Array.prototype.indexOf?Ze?Uint8Array.prototype.indexOf.call(B,N,V):Uint8Array.prototype.lastIndexOf.call(B,N,V):$(B,[N],V,Re,Ze);throw new TypeError("val must be string, number or Buffer")}function $(B,N,V,Re,Ze){var Yn,Tt=1,kt=B.length,In=N.length;if(void 0!==Re&&("ucs2"===(Re=String(Re).toLowerCase())||"ucs-2"===Re||"utf16le"===Re||"utf-16le"===Re)){if(B.length<2||N.length<2)return-1;Tt=2,kt/=2,In/=2,V/=2}function Nn(Ls,fs){return 1===Tt?Ls[fs]:Ls.readUInt16BE(fs*Tt)}if(Ze){var Mi=-1;for(Yn=V;Ynkt&&(V=kt-In),Yn=V;Yn>=0;Yn--){for(var xi=!0,Xr=0;XrZe&&(Re=Ze):Re=Ze;var Tt=N.length;Re>Tt/2&&(Re=Tt/2);for(var kt=0;kt>8,Tt.push(V%256),Tt.push(Re);return Tt}(N,B.length-V),B,V,Re)}function ne(B,N,V){return j.fromByteArray(0===N&&V===B.length?B:B.slice(N,V))}function ye(B,N,V){V=Math.min(B.length,V);for(var Re=[],Ze=N;Ze239?4:Tt>223?3:Tt>191?2:1;if(Ze+In<=V)switch(In){case 1:Tt<128&&(kt=Tt);break;case 2:128==(192&(Nn=B[Ze+1]))&&(xi=(31&Tt)<<6|63&Nn)>127&&(kt=xi);break;case 3:Yn=B[Ze+2],128==(192&(Nn=B[Ze+1]))&&128==(192&Yn)&&(xi=(15&Tt)<<12|(63&Nn)<<6|63&Yn)>2047&&(xi<55296||xi>57343)&&(kt=xi);break;case 4:Yn=B[Ze+2],Mi=B[Ze+3],128==(192&(Nn=B[Ze+1]))&&128==(192&Yn)&&128==(192&Mi)&&(xi=(15&Tt)<<18|(63&Nn)<<12|(63&Yn)<<6|63&Mi)>65535&&xi<1114112&&(kt=xi)}null===kt?(kt=65533,In=1):kt>65535&&(Re.push((kt-=65536)>>>10&1023|55296),kt=56320|1023&kt),Re.push(kt),Ze+=In}return function(B){var N=B.length;if(N<=4096)return String.fromCharCode.apply(String,B);for(var V="",Re=0;ReV&&(N+=" ... "),""},C.prototype.compare=function(N,V,Re,Ze,Tt){if(pt(N,Uint8Array)&&(N=C.from(N,N.offset,N.byteLength)),!C.isBuffer(N))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof N);if(void 0===V&&(V=0),void 0===Re&&(Re=N?N.length:0),void 0===Ze&&(Ze=0),void 0===Tt&&(Tt=this.length),V<0||Re>N.length||Ze<0||Tt>this.length)throw new RangeError("out of range index");if(Ze>=Tt&&V>=Re)return 0;if(Ze>=Tt)return-1;if(V>=Re)return 1;if(this===N)return 0;for(var kt=(Tt>>>=0)-(Ze>>>=0),In=(Re>>>=0)-(V>>>=0),Nn=Math.min(kt,In),Yn=this.slice(Ze,Tt),Mi=N.slice(V,Re),xi=0;xi>>=0,isFinite(Re)?(Re>>>=0,void 0===Ze&&(Ze="utf8")):(Ze=Re,Re=void 0)}var Tt=this.length-V;if((void 0===Re||Re>Tt)&&(Re=Tt),N.length>0&&(Re<0||V<0)||V>this.length)throw new RangeError("Attempt to write outside buffer bounds");Ze||(Ze="utf8");for(var kt=!1;;)switch(Ze){case"hex":return Z(this,N,V,Re);case"utf8":case"utf-8":return ae(this,N,V,Re);case"ascii":return oe(this,N,V,Re);case"latin1":case"binary":return te(this,N,V,Re);case"base64":return Te(this,N,V,Re);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return me(this,N,V,Re);default:if(kt)throw new TypeError("Unknown encoding: "+Ze);Ze=(""+Ze).toLowerCase(),kt=!0}},C.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function st(B,N,V){var Re="";V=Math.min(B.length,V);for(var Ze=N;ZeRe)&&(V=Re);for(var Ze="",Tt=N;TtV)throw new RangeError("Trying to access beyond buffer length")}function Le(B,N,V,Re,Ze,Tt){if(!C.isBuffer(B))throw new TypeError('"buffer" argument must be a Buffer instance');if(N>Ze||NB.length)throw new RangeError("Index out of range")}function Ke(B,N,V,Re,Ze,Tt){if(V+Re>B.length)throw new RangeError("Index out of range");if(V<0)throw new RangeError("Index out of range")}function Me(B,N,V,Re,Ze){return N=+N,V>>>=0,Ze||Ke(B,0,V,4),k.write(B,N,V,Re,23,4),V+4}function Ue(B,N,V,Re,Ze){return N=+N,V>>>=0,Ze||Ke(B,0,V,8),k.write(B,N,V,Re,52,8),V+8}C.prototype.slice=function(N,V){var Re=this.length;(N=~~N)<0?(N+=Re)<0&&(N=0):N>Re&&(N=Re),(V=void 0===V?Re:~~V)<0?(V+=Re)<0&&(V=0):V>Re&&(V=Re),V>>=0,V>>>=0,Re||ze(N,V,this.length);for(var Ze=this[N],Tt=1,kt=0;++kt>>=0,V>>>=0,Re||ze(N,V,this.length);for(var Ze=this[N+--V],Tt=1;V>0&&(Tt*=256);)Ze+=this[N+--V]*Tt;return Ze},C.prototype.readUInt8=function(N,V){return N>>>=0,V||ze(N,1,this.length),this[N]},C.prototype.readUInt16LE=function(N,V){return N>>>=0,V||ze(N,2,this.length),this[N]|this[N+1]<<8},C.prototype.readUInt16BE=function(N,V){return N>>>=0,V||ze(N,2,this.length),this[N]<<8|this[N+1]},C.prototype.readUInt32LE=function(N,V){return N>>>=0,V||ze(N,4,this.length),(this[N]|this[N+1]<<8|this[N+2]<<16)+16777216*this[N+3]},C.prototype.readUInt32BE=function(N,V){return N>>>=0,V||ze(N,4,this.length),16777216*this[N]+(this[N+1]<<16|this[N+2]<<8|this[N+3])},C.prototype.readIntLE=function(N,V,Re){N>>>=0,V>>>=0,Re||ze(N,V,this.length);for(var Ze=this[N],Tt=1,kt=0;++kt=(Tt*=128)&&(Ze-=Math.pow(2,8*V)),Ze},C.prototype.readIntBE=function(N,V,Re){N>>>=0,V>>>=0,Re||ze(N,V,this.length);for(var Ze=V,Tt=1,kt=this[N+--Ze];Ze>0&&(Tt*=256);)kt+=this[N+--Ze]*Tt;return kt>=(Tt*=128)&&(kt-=Math.pow(2,8*V)),kt},C.prototype.readInt8=function(N,V){return N>>>=0,V||ze(N,1,this.length),128&this[N]?-1*(255-this[N]+1):this[N]},C.prototype.readInt16LE=function(N,V){N>>>=0,V||ze(N,2,this.length);var Re=this[N]|this[N+1]<<8;return 32768&Re?4294901760|Re:Re},C.prototype.readInt16BE=function(N,V){N>>>=0,V||ze(N,2,this.length);var Re=this[N+1]|this[N]<<8;return 32768&Re?4294901760|Re:Re},C.prototype.readInt32LE=function(N,V){return N>>>=0,V||ze(N,4,this.length),this[N]|this[N+1]<<8|this[N+2]<<16|this[N+3]<<24},C.prototype.readInt32BE=function(N,V){return N>>>=0,V||ze(N,4,this.length),this[N]<<24|this[N+1]<<16|this[N+2]<<8|this[N+3]},C.prototype.readFloatLE=function(N,V){return N>>>=0,V||ze(N,4,this.length),k.read(this,N,!0,23,4)},C.prototype.readFloatBE=function(N,V){return N>>>=0,V||ze(N,4,this.length),k.read(this,N,!1,23,4)},C.prototype.readDoubleLE=function(N,V){return N>>>=0,V||ze(N,8,this.length),k.read(this,N,!0,52,8)},C.prototype.readDoubleBE=function(N,V){return N>>>=0,V||ze(N,8,this.length),k.read(this,N,!1,52,8)},C.prototype.writeUIntLE=function(N,V,Re,Ze){N=+N,V>>>=0,Re>>>=0,Ze||Le(this,N,V,Re,Math.pow(2,8*Re)-1,0);var kt=1,In=0;for(this[V]=255&N;++In>>=0,Re>>>=0,Ze||Le(this,N,V,Re,Math.pow(2,8*Re)-1,0);var kt=Re-1,In=1;for(this[V+kt]=255&N;--kt>=0&&(In*=256);)this[V+kt]=N/In&255;return V+Re},C.prototype.writeUInt8=function(N,V,Re){return N=+N,V>>>=0,Re||Le(this,N,V,1,255,0),this[V]=255&N,V+1},C.prototype.writeUInt16LE=function(N,V,Re){return N=+N,V>>>=0,Re||Le(this,N,V,2,65535,0),this[V]=255&N,this[V+1]=N>>>8,V+2},C.prototype.writeUInt16BE=function(N,V,Re){return N=+N,V>>>=0,Re||Le(this,N,V,2,65535,0),this[V]=N>>>8,this[V+1]=255&N,V+2},C.prototype.writeUInt32LE=function(N,V,Re){return N=+N,V>>>=0,Re||Le(this,N,V,4,4294967295,0),this[V+3]=N>>>24,this[V+2]=N>>>16,this[V+1]=N>>>8,this[V]=255&N,V+4},C.prototype.writeUInt32BE=function(N,V,Re){return N=+N,V>>>=0,Re||Le(this,N,V,4,4294967295,0),this[V]=N>>>24,this[V+1]=N>>>16,this[V+2]=N>>>8,this[V+3]=255&N,V+4},C.prototype.writeIntLE=function(N,V,Re,Ze){if(N=+N,V>>>=0,!Ze){var Tt=Math.pow(2,8*Re-1);Le(this,N,V,Re,Tt-1,-Tt)}var kt=0,In=1,Nn=0;for(this[V]=255&N;++kt>0)-Nn&255;return V+Re},C.prototype.writeIntBE=function(N,V,Re,Ze){if(N=+N,V>>>=0,!Ze){var Tt=Math.pow(2,8*Re-1);Le(this,N,V,Re,Tt-1,-Tt)}var kt=Re-1,In=1,Nn=0;for(this[V+kt]=255&N;--kt>=0&&(In*=256);)N<0&&0===Nn&&0!==this[V+kt+1]&&(Nn=1),this[V+kt]=(N/In>>0)-Nn&255;return V+Re},C.prototype.writeInt8=function(N,V,Re){return N=+N,V>>>=0,Re||Le(this,N,V,1,127,-128),N<0&&(N=255+N+1),this[V]=255&N,V+1},C.prototype.writeInt16LE=function(N,V,Re){return N=+N,V>>>=0,Re||Le(this,N,V,2,32767,-32768),this[V]=255&N,this[V+1]=N>>>8,V+2},C.prototype.writeInt16BE=function(N,V,Re){return N=+N,V>>>=0,Re||Le(this,N,V,2,32767,-32768),this[V]=N>>>8,this[V+1]=255&N,V+2},C.prototype.writeInt32LE=function(N,V,Re){return N=+N,V>>>=0,Re||Le(this,N,V,4,2147483647,-2147483648),this[V]=255&N,this[V+1]=N>>>8,this[V+2]=N>>>16,this[V+3]=N>>>24,V+4},C.prototype.writeInt32BE=function(N,V,Re){return N=+N,V>>>=0,Re||Le(this,N,V,4,2147483647,-2147483648),N<0&&(N=4294967295+N+1),this[V]=N>>>24,this[V+1]=N>>>16,this[V+2]=N>>>8,this[V+3]=255&N,V+4},C.prototype.writeFloatLE=function(N,V,Re){return Me(this,N,V,!0,Re)},C.prototype.writeFloatBE=function(N,V,Re){return Me(this,N,V,!1,Re)},C.prototype.writeDoubleLE=function(N,V,Re){return Ue(this,N,V,!0,Re)},C.prototype.writeDoubleBE=function(N,V,Re){return Ue(this,N,V,!1,Re)},C.prototype.copy=function(N,V,Re,Ze){if(!C.isBuffer(N))throw new TypeError("argument should be a Buffer");if(Re||(Re=0),!Ze&&0!==Ze&&(Ze=this.length),V>=N.length&&(V=N.length),V||(V=0),Ze>0&&Ze=this.length)throw new RangeError("Index out of range");if(Ze<0)throw new RangeError("sourceEnd out of bounds");Ze>this.length&&(Ze=this.length),N.length-V=0;--kt)N[kt+V]=this[kt+Re];else Uint8Array.prototype.set.call(N,this.subarray(Re,Ze),V);return Tt},C.prototype.fill=function(N,V,Re,Ze){if("string"==typeof N){if("string"==typeof V?(Ze=V,V=0,Re=this.length):"string"==typeof Re&&(Ze=Re,Re=this.length),void 0!==Ze&&"string"!=typeof Ze)throw new TypeError("encoding must be a string");if("string"==typeof Ze&&!C.isEncoding(Ze))throw new TypeError("Unknown encoding: "+Ze);if(1===N.length){var Tt=N.charCodeAt(0);("utf8"===Ze&&Tt<128||"latin1"===Ze)&&(N=Tt)}}else"number"==typeof N&&(N&=255);if(V<0||this.length>>=0,Re=void 0===Re?this.length:Re>>>0,N||(N=0),"number"==typeof N)for(kt=V;kt55295&&V<57344){if(!Ze){if(V>56319){(N-=3)>-1&&Tt.push(239,191,189);continue}if(kt+1===Re){(N-=3)>-1&&Tt.push(239,191,189);continue}Ze=V;continue}if(V<56320){(N-=3)>-1&&Tt.push(239,191,189),Ze=V;continue}V=65536+(Ze-55296<<10|V-56320)}else Ze&&(N-=3)>-1&&Tt.push(239,191,189);if(Ze=null,V<128){if((N-=1)<0)break;Tt.push(V)}else if(V<2048){if((N-=2)<0)break;Tt.push(V>>6|192,63&V|128)}else if(V<65536){if((N-=3)<0)break;Tt.push(V>>12|224,V>>6&63|128,63&V|128)}else{if(!(V<1114112))throw new Error("Invalid code point");if((N-=4)<0)break;Tt.push(V>>18|240,V>>12&63|128,V>>6&63|128,63&V|128)}}return Tt}function je(B){return j.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 _t(B,N,V,Re){for(var Ze=0;Ze=N.length||Ze>=B.length);++Ze)N[Ze+V]=B[Ze];return Ze}function pt(B,N){return B instanceof N||null!=B&&null!=B.constructor&&null!=B.constructor.name&&B.constructor.name===N.name}function we(B){return B!=B}}).call(this)}).call(this,Y("buffer").Buffer)},{"base64-js":2,buffer:6,ieee754:9}],7:[function(Y,Se,he){"use strict";Se.exports=function W(j){return null===j||"object"!=typeof j||null!=j.toJSON?JSON.stringify(j):Array.isArray(j)?"["+j.reduce((k,Q,H)=>k+(0===H?"":",")+W(void 0===Q||"symbol"==typeof Q?null:Q),"")+"]":"{"+Object.keys(j).sort().reduce((k,Q,H)=>void 0===j[Q]||"symbol"==typeof j[Q]?k:k+(0===k.length?"":",")+W(Q)+":"+W(j[Q]),"")+"}"}},{}],8:[function(Y,Se,he){"use strict";var k,W="object"==typeof Reflect?Reflect:null,j=W&&"function"==typeof W.apply?W.apply:function($,Z,ae){return Function.prototype.apply.call($,Z,ae)};k=W&&"function"==typeof W.ownKeys?W.ownKeys:Object.getOwnPropertySymbols?function($){return Object.getOwnPropertyNames($).concat(Object.getOwnPropertySymbols($))}:function($){return Object.getOwnPropertyNames($)};var H=Number.isNaN||function($){return $!=$};function v(){v.init.call(this)}Se.exports=v,Se.exports.once=function(E,$){return new Promise(function(Z,ae){function oe(Te){E.removeListener($,te),ae(Te)}function te(){"function"==typeof E.removeListener&&E.removeListener("error",oe),Z([].slice.call(arguments))}K(E,$,te,{once:!0}),"error"!==$&&function(E,$,Z){"function"==typeof E.on&&K(E,"error",$,Z)}(E,oe,{once:!0})})},v.EventEmitter=v,v.prototype._events=void 0,v.prototype._eventsCount=0,v.prototype._maxListeners=void 0;var C=10;function R(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?v.defaultMaxListeners:E._maxListeners}function b(E,$,Z,ae){var oe,te,Te;if(R(Z),void 0===(te=E._events)?(te=E._events=Object.create(null),E._eventsCount=0):(void 0!==te.newListener&&(E.emit("newListener",$,Z.listener?Z.listener:Z),te=E._events),Te=te[$]),void 0===Te)Te=te[$]=Z,++E._eventsCount;else if("function"==typeof Te?Te=te[$]=ae?[Z,Te]:[Te,Z]:ae?Te.unshift(Z):Te.push(Z),(oe=T(E))>0&&Te.length>oe&&!Te.warned){Te.warned=!0;var me=new Error("Possible EventEmitter memory leak detected. "+Te.length+" "+String($)+" listeners added. Use emitter.setMaxListeners() to increase limit");me.name="MaxListenersExceededWarning",me.emitter=E,me.type=$,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 S(E,$,Z){var ae={fired:!1,wrapFn:void 0,target:E,type:$,listener:Z},oe=y.bind(ae);return oe.listener=Z,ae.wrapFn=oe,oe}function A(E,$,Z){var ae=E._events;if(void 0===ae)return[];var oe=ae[$];return void 0===oe?[]:"function"==typeof oe?Z?[oe.listener||oe]:[oe]:Z?function(E){for(var $=new Array(E.length),Z=0;Z<$.length;++Z)$[Z]=E[Z].listener||E[Z];return $}(oe):P(oe,oe.length)}function z(E){var $=this._events;if(void 0!==$){var Z=$[E];if("function"==typeof Z)return 1;if(void 0!==Z)return Z.length}return 0}function P(E,$){for(var Z=new Array($),ae=0;ae<$;++ae)Z[ae]=E[ae];return Z}function K(E,$,Z,ae){if("function"==typeof E.on)ae.once?E.once($,Z):E.on($,Z);else{if("function"!=typeof E.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof E);E.addEventListener($,function oe(te){ae.once&&E.removeEventListener($,oe),Z(te)})}}Object.defineProperty(v,"defaultMaxListeners",{enumerable:!0,get:function(){return C},set:function(E){if("number"!=typeof E||E<0||H(E))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+E+".");C=E}}),v.init=function(){(void 0===this._events||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},v.prototype.setMaxListeners=function($){if("number"!=typeof $||$<0||H($))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+$+".");return this._maxListeners=$,this},v.prototype.getMaxListeners=function(){return T(this)},v.prototype.emit=function($){for(var Z=[],ae=1;ae0&&(Te=Z[0]),Te instanceof Error)throw Te;var me=new Error("Unhandled error."+(Te?" ("+Te.message+")":""));throw me.context=Te,me}var ne=te[$];if(void 0===ne)return!1;if("function"==typeof ne)j(ne,this,Z);else{var ye=ne.length,Oe=P(ne,ye);for(ae=0;ae=0;Te--)if(ae[Te]===Z||ae[Te].listener===Z){me=ae[Te].listener,te=Te;break}if(te<0)return this;0===te?ae.shift():function(E,$){for(;$+1=0;oe--)this.removeListener($,Z[oe]);return this},v.prototype.listeners=function($){return A(this,$,!0)},v.prototype.rawListeners=function($){return A(this,$,!1)},v.listenerCount=function(E,$){return"function"==typeof E.listenerCount?E.listenerCount($):z.call(E,$)},v.prototype.listenerCount=z,v.prototype.eventNames=function(){return this._eventsCount>0?k(this._events):[]}},{}],9:[function(Y,Se,he){he.read=function(W,j,k,Q,H){var v,C,R=8*H-Q-1,T=(1<>1,y=-7,S=k?H-1:0,A=k?-1:1,z=W[j+S];for(S+=A,v=z&(1<<-y)-1,z>>=-y,y+=R;y>0;v=256*v+W[j+S],S+=A,y-=8);for(C=v&(1<<-y)-1,v>>=-y,y+=Q;y>0;C=256*C+W[j+S],S+=A,y-=8);if(0===v)v=1-b;else{if(v===T)return C?NaN:1/0*(z?-1:1);C+=Math.pow(2,Q),v-=b}return(z?-1:1)*C*Math.pow(2,v-Q)},he.write=function(W,j,k,Q,H,v){var C,R,T,b=8*v-H-1,y=(1<>1,A=23===H?Math.pow(2,-24)-Math.pow(2,-77):0,z=Q?0:v-1,P=Q?1:-1,X=j<0||0===j&&1/j<0?1:0;for(j=Math.abs(j),isNaN(j)||j===1/0?(R=isNaN(j)?1:0,C=y):(C=Math.floor(Math.log(j)/Math.LN2),j*(T=Math.pow(2,-C))<1&&(C--,T*=2),(j+=C+S>=1?A/T:A*Math.pow(2,1-S))*T>=2&&(C++,T/=2),C+S>=y?(R=0,C=y):C+S>=1?(R=(j*T-1)*Math.pow(2,H),C+=S):(R=j*Math.pow(2,S-1)*Math.pow(2,H),C=0));H>=8;W[k+z]=255&R,z+=P,R/=256,H-=8);for(C=C<0;W[k+z]=255&C,z+=P,C/=256,b-=8);W[k+z-P]|=128*X}},{}],10:[function(Y,Se,he){Se.exports="function"==typeof Object.create?function(j,k){k&&(j.super_=k,j.prototype=Object.create(k.prototype,{constructor:{value:j,enumerable:!1,writable:!0,configurable:!0}}))}:function(j,k){if(k){j.super_=k;var Q=function(){};Q.prototype=k.prototype,j.prototype=new Q,j.prototype.constructor=j}}},{}],11:[function(Y,Se,he){"use strict";const{isArray:W,isObject:j,isString:k}=Y("./types"),{asArray:Q}=Y("./util"),{prependBase:H}=Y("./url"),v=Y("./JsonLdError"),C=Y("./ResolvedContext");function T(y){throw new v("Invalid JSON-LD syntax; @context must be an object.","jsonld.SyntaxError",{code:"invalid local context",context:y})}function b({context:y,base:S}){if(!y)return;const A=y["@context"];if(k(A))y["@context"]=H(S,A);else if(W(A))for(let z=0;z10)throw new v("Maximum number of @context URLs exceeded.","jsonld.ContextUrlError",{code:"json-ld-1.0"===S.processingMode?"loading remote context failed":"context overflow",max:10});if(P.has(A))throw new v("Cyclical @context URLs detected.","jsonld.ContextUrlError",{code:"json-ld-1.0"===S.processingMode?"recursive context inclusion":"context overflow",url:A});let X,ue;P.add(A);try{ue=yield z(A),X=ue.document||null,k(X)&&(X=JSON.parse(X))}catch(I){throw new v("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:A,cause:I})}if(!j(X))throw new v("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:A});return X="@context"in X?{"@context":X["@context"]}:{"@context":{}},ue.contextUrl&&(W(X["@context"])||(X["@context"]=[X["@context"]]),X["@context"].push(ue.contextUrl)),{context:X,remoteDoc:ue}})()}}},{"./JsonLdError":12,"./ResolvedContext":16,"./types":30,"./url":31,"./util":32}],12:[function(Y,Se,he){"use strict";Se.exports=class extends Error{constructor(j="An unspecified JSON-LD error occurred.",k="jsonld.Error",Q={}){super(j),this.name=k,this.message=j,this.details=Q}}},{}],13:[function(Y,Se,he){"use strict";Se.exports=W=>{class j{toString(){return"[object JsonLdProcessor]"}}return Object.defineProperty(j,"prototype",{writable:!1,enumerable:!1}),Object.defineProperty(j.prototype,"constructor",{writable:!0,enumerable:!1,configurable:!0,value:j}),j.compact=function(k,Q){return arguments.length<2?Promise.reject(new TypeError("Could not compact, too few arguments.")):W.compact(k,Q)},j.expand=function(k){return arguments.length<1?Promise.reject(new TypeError("Could not expand, too few arguments.")):W.expand(k)},j.flatten=function(k){return arguments.length<1?Promise.reject(new TypeError("Could not flatten, too few arguments.")):W.flatten(k)},j}},{}],14:[function(Y,Se,he){"use strict";Se.exports=Y("rdf-canonize").NQuads},{"rdf-canonize":46}],15:[function(Y,Se,he){"use strict";Se.exports=class{constructor(){this._requests={}}wrapLoader(j){const k=this;return k._loader=j,function(){return k.add.apply(k,arguments)}}add(j){var k=this;return yt(function*(){let Q=k._requests[j];if(Q)return Promise.resolve(Q);Q=k._requests[j]=k._loader(j);try{return yield Q}finally{delete k._requests[j]}})()}}},{}],16:[function(Y,Se,he){"use strict";const W=Y("lru-cache");Se.exports=class{constructor({document:Q}){this.document=Q,this.cache=new W({max:10})}getProcessed(Q){return this.cache.get(Q)}setProcessed(Q,H){this.cache.set(Q,H)}}},{"lru-cache":33}],17:[function(Y,Se,he){"use strict";const W=Y("./JsonLdError"),{isArray:j,isObject:k,isString:Q,isUndefined:H}=Y("./types"),{isList:v,isValue:C,isGraph:R,isSimpleGraph:T,isSubjectReference:b}=Y("./graphTypes"),{expandIri:y,getContextValue:S,isKeyword:A,process:z,processingMode:P}=Y("./context"),{removeBase:X,prependBase:ue}=Y("./url"),{addValue:I,asArray:O,compareShortestLeast:K}=Y("./util"),E={};function Z(ae,oe,te){if("@nest"!==y(ae,oe,{vocab:!0},te))throw new W("JSON-LD compact error; nested property must have an @nest value resolving to @nest.","jsonld.SyntaxError",{code:"invalid @nest value"})}Se.exports=E,E.compact=function(){var ae=yt(function*({activeCtx:oe,activeProperty:te=null,element:Te,options:me={},compactionMap:ne=(()=>{})}){if(j(Te)){let Oe=[];for(let $e=0;$e1&&(tt=Array.from(tt).sort());const Xe=oe;for(const Le of tt){const Ke=E.compactIri({activeCtx:Xe,iri:Le,relativeTo:{vocab:!0}}),Me=S(st,Ke,"@context");H(Me)||(oe=yield z({activeCtx:oe,localCtx:Me,options:me,propagate:!1}))}const ze=Object.keys(Te).sort();for(const Le of ze){const Ke=Te[Le];if("@id"!==Le)if("@type"!==Le)if("@reverse"!==Le)if("@preserve"!==Le)if("@index"!==Le)if("@graph"!==Le&&"@list"!==Le&&"@included"!==Le&&A(Le)){const Me=E.compactIri({activeCtx:oe,iri:Le,relativeTo:{vocab:!0}});I($e,Me,Ke)}else{if(!j(Ke))throw new W("JSON-LD expansion error; expanded value must be an array.","jsonld.SyntaxError");if(0===Ke.length){const Me=E.compactIri({activeCtx:oe,iri:Le,value:Ke,relativeTo:{vocab:!0},reverse:Oe}),Ue=oe.mappings.has(Me)?oe.mappings.get(Me)["@nest"]:null;let qe=$e;Ue&&(Z(oe,Ue,me),k($e[Ue])||($e[Ue]={}),qe=$e[Ue]),I(qe,Me,Ke,{propertyIsArray:!0})}for(const Me of Ke){const Ue=E.compactIri({activeCtx:oe,iri:Le,value:Me,relativeTo:{vocab:!0},reverse:Oe}),qe=oe.mappings.has(Ue)?oe.mappings.get(Ue)["@nest"]:null;let ke=$e;qe&&(Z(oe,qe,me),k($e[qe])||($e[qe]={}),ke=$e[qe]);const q=S(oe,Ue,"@container")||[],G=R(Me),pe=v(Me);let de;pe?de=Me["@list"]:G&&(de=Me["@graph"]);let je=yield E.compact({activeCtx:oe,activeProperty:Ue,element:pe||G?de:Me,options:me,compactionMap:ne});if(pe){if(j(je)||(je=[je]),q.includes("@list")){I(ke,Ue,je,{valueIsArray:!0,allowDuplicate:!0});continue}je={[E.compactIri({activeCtx:oe,iri:"@list",relativeTo:{vocab:!0}})]:je},"@index"in Me&&(je[E.compactIri({activeCtx:oe,iri:"@index",relativeTo:{vocab:!0}})]=Me["@index"])}if(G)if(q.includes("@graph")&&(q.includes("@id")||q.includes("@index")&&T(Me))){let _t;ke.hasOwnProperty(Ue)?_t=ke[Ue]:ke[Ue]=_t={};const pt=(q.includes("@id")?Me["@id"]:Me["@index"])||E.compactIri({activeCtx:oe,iri:"@none",relativeTo:{vocab:!0}});I(_t,pt,je,{propertyIsArray:!me.compactArrays||q.includes("@set")})}else q.includes("@graph")&&T(Me)?(j(je)&&je.length>1&&(je={"@included":je}),I(ke,Ue,je,{propertyIsArray:!me.compactArrays||q.includes("@set")})):(j(je)&&1===je.length&&me.compactArrays&&(je=je[0]),je={[E.compactIri({activeCtx:oe,iri:"@graph",relativeTo:{vocab:!0}})]:je},"@id"in Me&&(je[E.compactIri({activeCtx:oe,iri:"@id",relativeTo:{vocab:!0}})]=Me["@id"]),"@index"in Me&&(je[E.compactIri({activeCtx:oe,iri:"@index",relativeTo:{vocab:!0}})]=Me["@index"]),I(ke,Ue,je,{propertyIsArray:!me.compactArrays||q.includes("@set")}));else if(q.includes("@language")||q.includes("@index")||q.includes("@id")||q.includes("@type")){let _t,pt;if(ke.hasOwnProperty(Ue)?_t=ke[Ue]:ke[Ue]=_t={},q.includes("@language"))C(je)&&(je=je["@value"]),pt=Me["@language"];else if(q.includes("@index")){const we=S(oe,Ue,"@index")||"@index",B=E.compactIri({activeCtx:oe,iri:we,relativeTo:{vocab:!0}});if("@index"===we)pt=Me["@index"],delete je[B];else{let N;if([pt,...N]=O(je[we]||[]),Q(pt))switch(N.length){case 0:delete je[we];break;case 1:je[we]=N[0];break;default:je[we]=N}else pt=null}}else if(q.includes("@id")){const we=E.compactIri({activeCtx:oe,iri:"@id",relativeTo:{vocab:!0}});pt=je[we],delete je[we]}else if(q.includes("@type")){const we=E.compactIri({activeCtx:oe,iri:"@type",relativeTo:{vocab:!0}});let B;switch([pt,...B]=O(je[we]||[]),B.length){case 0:delete je[we];break;case 1:je[we]=B[0];break;default:je[we]=B}1===Object.keys(je).length&&"@id"in Me&&(je=yield E.compact({activeCtx:oe,activeProperty:Ue,element:{"@id":Me["@id"]},options:me,compactionMap:ne}))}pt||(pt=E.compactIri({activeCtx:oe,iri:"@none",relativeTo:{vocab:!0}})),I(_t,pt,je,{propertyIsArray:q.includes("@set")})}else{const _t=!me.compactArrays||q.includes("@set")||q.includes("@list")||j(je)&&0===je.length||"@list"===Le||"@graph"===Le;I(ke,Ue,je,{propertyIsArray:_t})}}}else{if((S(oe,te,"@container")||[]).includes("@index"))continue;const Ue=E.compactIri({activeCtx:oe,iri:Le,relativeTo:{vocab:!0}});I($e,Ue,Ke)}else{const Me=yield E.compact({activeCtx:oe,activeProperty:te,element:Ke,options:me,compactionMap:ne});j(Me)&&0===Me.length||I($e,Le,Me)}else{const Me=yield E.compact({activeCtx:oe,activeProperty:"@reverse",element:Ke,options:me,compactionMap:ne});for(const Ue in Me)if(oe.mappings.has(Ue)&&oe.mappings.get(Ue).reverse){const qe=Me[Ue],q=(S(oe,Ue,"@container")||[]).includes("@set")||!me.compactArrays;I($e,Ue,qe,{propertyIsArray:q}),delete Me[Ue]}if(Object.keys(Me).length>0){const Ue=E.compactIri({activeCtx:oe,iri:Le,relativeTo:{vocab:!0}});I($e,Ue,Me)}}else{let Me=O(Ke).map(G=>E.compactIri({activeCtx:st,iri:G,relativeTo:{vocab:!0}}));1===Me.length&&(Me=Me[0]);const Ue=E.compactIri({activeCtx:oe,iri:"@type",relativeTo:{vocab:!0}}),q=(S(oe,Ue,"@container")||[]).includes("@set")&&P(oe,1.1)||j(Me)&&0===Ke.length;I($e,Ue,Me,{propertyIsArray:q})}else{let Me=O(Ke).map(qe=>E.compactIri({activeCtx:oe,iri:qe,relativeTo:{vocab:!1},base:me.base}));1===Me.length&&(Me=Me[0]),$e[E.compactIri({activeCtx:oe,iri:"@id",relativeTo:{vocab:!0}})]=Me}}return $e}return Te});return function(oe){return ae.apply(this,arguments)}}(),E.compactIri=({activeCtx:ae,iri:oe,value:te=null,relativeTo:Te={vocab:!1},reverse:me=!1,base:ne=null})=>{if(null===oe)return oe;ae.isPropertyTermScoped&&ae.previousContext&&(ae=ae.previousContext);const ye=ae.getInverse();if(A(oe)&&oe in ye&&"@none"in ye[oe]&&"@type"in ye[oe]["@none"]&&"@none"in ye[oe]["@none"]["@type"])return ye[oe]["@none"]["@type"]["@none"];if(Te.vocab&&oe in ye){const tt=ae["@language"]||"@none",Xe=[];k(te)&&"@index"in te&&!("@graph"in te)&&Xe.push("@index","@index@set"),k(te)&&"@preserve"in te&&(te=te["@preserve"][0]),R(te)?("@index"in te&&Xe.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in te&&Xe.push("@graph@id","@graph@id@set"),Xe.push("@graph","@graph@set","@set"),"@index"in te||Xe.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in te||Xe.push("@graph@id","@graph@id@set")):k(te)&&!C(te)&&Xe.push("@id","@id@set","@type","@set@type");let ze="@language",Le="@null";if(me)ze="@type",Le="@reverse",Xe.push("@set");else if(v(te)){"@index"in te||Xe.push("@list");const Me=te["@list"];if(0===Me.length)ze="@any",Le="@none";else{let Ue=0===Me.length?tt:null,qe=null;for(let ke=0;kest.includes("_"));$e&&ye.push($e.replace(/^[^_]+_/,"_"))}ye.push("@none");const Oe=ae.inverse[oe];for(const $e of Te){if(!($e in Oe))continue;const st=Oe[$e][me];for(const Qe of ye)if(Qe in st)return st[Qe]}return null}(ae,oe,te,Xe,ze,Le);if(null!==Ke)return Ke}if(Te.vocab&&"@vocab"in ae){const tt=ae["@vocab"];if(0===oe.indexOf(tt)&&oe!==tt){const Xe=oe.substr(tt.length);if(!ae.mappings.has(Xe))return Xe}}let Oe=null;const $e=[];let st=ae.fastCurieMap;const Qe=oe.length-1;for(let tt=0;tt=0;--tt){const Xe=$e[tt],ze=Xe.terms;for(const Le of ze){const Ke=Le+":"+oe.substr(Xe.iri.length);ae.mappings.get(Le)._prefix&&(!ae.mappings.has(Ke)||null===te&&ae.mappings.get(Ke)["@id"]===oe)&&(null===Oe||K(Ke,Oe)<0)&&(Oe=Ke)}}if(null!==Oe)return Oe;for(const[tt,Xe]of ae.mappings)if(Xe&&Xe._prefix&&oe.startsWith(tt+":"))throw new W(`Absolute IRI "${oe}" confused with prefix "${tt}".`,"jsonld.SyntaxError",{code:"IRI confused with prefix",context:ae});return Te.vocab?oe:"@base"in ae?ae["@base"]?X(ue(ne,ae["@base"]),oe):oe:X(ne,oe)},E.compactValue=({activeCtx:ae,activeProperty:oe,value:te,options:Te})=>{if(C(te)){const Oe=S(ae,oe,"@type"),$e=S(ae,oe,"@language"),st=S(ae,oe,"@direction"),Qe=S(ae,oe,"@container")||[],tt="@index"in te&&!Qe.includes("@index");if(!tt&&"@none"!==Oe&&(te["@type"]===Oe||"@language"in te&&te["@language"]===$e&&"@direction"in te&&te["@direction"]===st||"@language"in te&&te["@language"]===$e||"@direction"in te&&te["@direction"]===st))return te["@value"];const Xe=Object.keys(te).length,ze=1===Xe||2===Xe&&"@index"in te&&!tt,Le="@language"in ae,Ke=Q(te["@value"]),Me=ae.mappings.has(oe)&&null===ae.mappings.get(oe)["@language"];if(ze&&"@none"!==Oe&&(!Le||!Ke||Me))return te["@value"];const Ue={};return tt&&(Ue[E.compactIri({activeCtx:ae,iri:"@index",relativeTo:{vocab:!0}})]=te["@index"]),"@type"in te?Ue[E.compactIri({activeCtx:ae,iri:"@type",relativeTo:{vocab:!0}})]=E.compactIri({activeCtx:ae,iri:te["@type"],relativeTo:{vocab:!0}}):"@language"in te&&(Ue[E.compactIri({activeCtx:ae,iri:"@language",relativeTo:{vocab:!0}})]=te["@language"]),"@direction"in te&&(Ue[E.compactIri({activeCtx:ae,iri:"@direction",relativeTo:{vocab:!0}})]=te["@direction"]),Ue[E.compactIri({activeCtx:ae,iri:"@value",relativeTo:{vocab:!0}})]=te["@value"],Ue}const me=y(ae,oe,{vocab:!0},Te),ne=S(ae,oe,"@type"),ye=E.compactIri({activeCtx:ae,iri:te["@id"],relativeTo:{vocab:"@vocab"===ne},base:Te.base});return"@id"===ne||"@vocab"===ne||"@graph"===me?ye:{[E.compactIri({activeCtx:ae,iri:"@id",relativeTo:{vocab:!0}})]:ye}}},{"./JsonLdError":12,"./context":19,"./graphTypes":25,"./types":30,"./url":31,"./util":32}],18:[function(Y,Se,he){"use strict";const W="http://www.w3.org/1999/02/22-rdf-syntax-ns#",j="http://www.w3.org/2001/XMLSchema#";Se.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:j,XSD_BOOLEAN:j+"boolean",XSD_DOUBLE:j+"double",XSD_INTEGER:j+"integer",XSD_STRING:j+"string"}},{}],19:[function(Y,Se,he){"use strict";const W=Y("./util"),j=Y("./JsonLdError"),{isArray:k,isObject:Q,isString:H,isUndefined:v}=Y("./types"),{isAbsolute:C,isRelative:R,prependBase:T}=Y("./url"),{asArray:b,compareShortestLeast:y}=Y("./util"),S=new Map,z=/^@[a-zA-Z]+$/,P={};function X(I,O,K,E,$,Z){if(null===O||!H(O)||P.isKeyword(O))return O;if(O.match(z))return null;if(E&&E.hasOwnProperty(O)&&!0!==$.get(O)&&P.createTermDefinition({activeCtx:I,localCtx:E,term:O,defined:$,options:Z}),(K=K||{}).vocab){const oe=I.mappings.get(O);if(null===oe)return null;if(Q(oe)&&"@id"in oe)return oe["@id"]}const ae=O.indexOf(":");if(ae>0){const oe=O.substr(0,ae),te=O.substr(ae+1);if("_"===oe||0===te.indexOf("//"))return O;E&&E.hasOwnProperty(oe)&&P.createTermDefinition({activeCtx:I,localCtx:E,term:oe,defined:$,options:Z});const Te=I.mappings.get(oe);if(Te&&Te._prefix)return Te["@id"]+te;if(C(O))return O}if(K.vocab&&"@vocab"in I)return I["@vocab"]+O;if(K.base&&"@base"in I){if(I["@base"])return T(T(Z.base,I["@base"]),O)}else if(K.base)return T(Z.base,O);return O}function ue(I,O){if(!I||"object"!=typeof I||!O||"object"!=typeof O)return I===O;const K=Array.isArray(I);if(K!==Array.isArray(O))return!1;if(K){if(I.length!==O.length)return!1;for(let Z=0;Z{if(E.has(K)){if(E.get(K))return;throw new j("Cyclical context definition detected.","jsonld.CyclicalContext",{code:"cyclic IRI mapping",context:O,term:K})}let ae;if(E.set(K,!1),O.hasOwnProperty(K)&&(ae=O[K]),"@type"===K&&Q(ae)&&"@set"===(ae["@container"]||"@set")&&P.processingMode(I,1.1)){const Oe=["@container","@id","@protected"],$e=Object.keys(ae);if(0===$e.length||$e.some(st=>!Oe.includes(st)))throw new j("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:O,term:K})}else{if(P.isKeyword(K))throw new j("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:O,term:K});if(K.match(z))return void console.warn('WARNING: terms beginning with "@" are reserved for future use and ignored',{term:K});if(""===K)throw new j("Invalid JSON-LD syntax; a term cannot be an empty string.","jsonld.SyntaxError",{code:"invalid term definition",context:O})}const oe=I.mappings.get(K);I.mappings.has(K)&&I.mappings.delete(K);let te=!1;if((H(ae)||null===ae)&&(te=!0,ae={"@id":ae}),!Q(ae))throw new j("Invalid JSON-LD syntax; @context term values must be strings or objects.","jsonld.SyntaxError",{code:"invalid term definition",context:O});const Te={};I.mappings.set(K,Te),Te.reverse=!1;const me=["@container","@id","@language","@reverse","@type"];P.processingMode(I,1.1)&&me.push("@context","@direction","@index","@nest","@prefix","@protected");for(const Oe in ae)if(!me.includes(Oe))throw new j("Invalid JSON-LD syntax; a term definition must not contain "+Oe,"jsonld.SyntaxError",{code:"invalid term definition",context:O});const ne=K.indexOf(":");if(Te._termHasColon=ne>0,"@reverse"in ae){if("@id"in ae)throw new j("Invalid JSON-LD syntax; a @reverse term definition must not contain @id.","jsonld.SyntaxError",{code:"invalid reverse property",context:O});if("@nest"in ae)throw new j("Invalid JSON-LD syntax; a @reverse term definition must not contain @nest.","jsonld.SyntaxError",{code:"invalid reverse property",context:O});const Oe=ae["@reverse"];if(!H(Oe))throw new j("Invalid JSON-LD syntax; a @context @reverse value must be a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:O});if(!P.isKeyword(Oe)&&Oe.match(z))return console.warn('WARNING: values beginning with "@" are reserved for future use and ignored',{reverse:Oe}),void(oe?I.mappings.set(K,oe):I.mappings.delete(K));const $e=X(I,Oe,{vocab:!0,base:!1},O,E,$);if(!C($e))throw new j("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:O});Te["@id"]=$e,Te.reverse=!0}else if("@id"in ae){let Oe=ae["@id"];if(Oe&&!H(Oe))throw new j("Invalid JSON-LD syntax; a @context @id value must be an array of strings or a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:O});if(null===Oe)Te["@id"]=null;else{if(!P.isKeyword(Oe)&&Oe.match(z))return console.warn('WARNING: values beginning with "@" are reserved for future use and ignored',{id:Oe}),void(oe?I.mappings.set(K,oe):I.mappings.delete(K));if(Oe!==K){if(Oe=X(I,Oe,{vocab:!0,base:!1},O,E,$),!C(Oe)&&!P.isKeyword(Oe))throw new j("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:O});if(K.match(/(?::[^:])|\//)&&X(I,K,{vocab:!0,base:!1},O,new Map(E).set(K,!0),$)!==Oe)throw new j("Invalid JSON-LD syntax; term in form of IRI must expand to definition.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:O});Te["@id"]=Oe,Te._prefix=te&&!Te._termHasColon&&Oe.match(/[:\/\?#\[\]@]$/)}}}if(!("@id"in Te))if(Te._termHasColon){const Oe=K.substr(0,ne);if(O.hasOwnProperty(Oe)&&P.createTermDefinition({activeCtx:I,localCtx:O,term:Oe,defined:E,options:$}),I.mappings.has(Oe)){const $e=K.substr(ne+1);Te["@id"]=I.mappings.get(Oe)["@id"]+$e}else Te["@id"]=K}else if("@type"===K)Te["@id"]=K;else{if(!("@vocab"in I))throw new j("Invalid JSON-LD syntax; @context terms must define an @id.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:O,term:K});Te["@id"]=I["@vocab"]+K}if((!0===ae["@protected"]||!0===E.get("@protected")&&!1!==ae["@protected"])&&(I.protected[K]=!0,Te.protected=!0),E.set(K,!0),"@type"in ae){let Oe=ae["@type"];if(!H(Oe))throw new j("Invalid JSON-LD syntax; an @context @type value must be a string.","jsonld.SyntaxError",{code:"invalid type mapping",context:O});if("@json"===Oe||"@none"===Oe){if(P.processingMode(I,1))throw new j(`Invalid JSON-LD syntax; an @context @type value must not be "${Oe}" in JSON-LD 1.0 mode.`,"jsonld.SyntaxError",{code:"invalid type mapping",context:O})}else if("@id"!==Oe&&"@vocab"!==Oe){if(Oe=X(I,Oe,{vocab:!0,base:!1},O,E,$),!C(Oe))throw new j("Invalid JSON-LD syntax; an @context @type value must be an absolute IRI.","jsonld.SyntaxError",{code:"invalid type mapping",context:O});if(0===Oe.indexOf("_:"))throw new j("Invalid JSON-LD syntax; an @context @type value must be an IRI, not a blank node identifier.","jsonld.SyntaxError",{code:"invalid type mapping",context:O})}Te["@type"]=Oe}if("@container"in ae){const Oe=H(ae["@container"])?[ae["@container"]]:ae["@container"]||[],$e=["@list","@set","@index","@language"];let st=!0;const Qe=Oe.includes("@set");if(P.processingMode(I,1.1)){if($e.push("@graph","@id","@type"),Oe.includes("@list")){if(1!==Oe.length)throw new j("Invalid JSON-LD syntax; @context @container with @list must have no other values","jsonld.SyntaxError",{code:"invalid container mapping",context:O})}else if(Oe.includes("@graph")){if(Oe.some(tt=>"@graph"!==tt&&"@id"!==tt&&"@index"!==tt&&"@set"!==tt))throw new j("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:O})}else st&=Oe.length<=(Qe?2:1);if(Oe.includes("@type")&&(Te["@type"]=Te["@type"]||"@id",!["@id","@vocab"].includes(Te["@type"])))throw new j("Invalid JSON-LD syntax; container: @type requires @type to be @id or @vocab.","jsonld.SyntaxError",{code:"invalid type mapping",context:O})}else st&=!k(ae["@container"]),st&=Oe.length<=1;if(st&=Oe.every(tt=>$e.includes(tt)),st&=!(Qe&&Oe.includes("@list")),!st)throw new j("Invalid JSON-LD syntax; @context @container value must be one of the following: "+$e.join(", "),"jsonld.SyntaxError",{code:"invalid container mapping",context:O});if(Te.reverse&&!Oe.every(tt=>["@index","@set"].includes(tt)))throw new j("Invalid JSON-LD syntax; @context @container value for a @reverse type definition must be @index or @set.","jsonld.SyntaxError",{code:"invalid reverse property",context:O});Te["@container"]=Oe}if("@index"in ae){if(!("@container"in ae)||!Te["@container"].includes("@index"))throw new j(`Invalid JSON-LD syntax; @index without @index in @container: "${ae["@index"]}" on term "${K}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:O});if(!H(ae["@index"])||0===ae["@index"].indexOf("@"))throw new j(`Invalid JSON-LD syntax; @index must expand to an IRI: "${ae["@index"]}" on term "${K}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:O});Te["@index"]=ae["@index"]}if("@context"in ae&&(Te["@context"]=ae["@context"]),"@language"in ae&&!("@type"in ae)){let Oe=ae["@language"];if(null!==Oe&&!H(Oe))throw new j("Invalid JSON-LD syntax; @context @language value must be a string or null.","jsonld.SyntaxError",{code:"invalid language mapping",context:O});null!==Oe&&(Oe=Oe.toLowerCase()),Te["@language"]=Oe}if("@prefix"in ae){if(K.match(/:|\//))throw new j("Invalid JSON-LD syntax; @context @prefix used on a compact IRI term","jsonld.SyntaxError",{code:"invalid term definition",context:O});if(P.isKeyword(Te["@id"]))throw new j("Invalid JSON-LD syntax; keywords may not be used as prefixes","jsonld.SyntaxError",{code:"invalid term definition",context:O});if("boolean"!=typeof ae["@prefix"])throw new j("Invalid JSON-LD syntax; @context value for @prefix must be boolean","jsonld.SyntaxError",{code:"invalid @prefix value",context:O});Te._prefix=!0===ae["@prefix"]}if("@direction"in ae){const Oe=ae["@direction"];if(null!==Oe&&"ltr"!==Oe&&"rtl"!==Oe)throw new j('Invalid JSON-LD syntax; @direction value must be null, "ltr", or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",context:O});Te["@direction"]=Oe}if("@nest"in ae){const Oe=ae["@nest"];if(!H(Oe)||"@nest"!==Oe&&0===Oe.indexOf("@"))throw new j("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:O});Te["@nest"]=Oe}const ye=Te["@id"];if("@context"===ye||"@preserve"===ye)throw new j("Invalid JSON-LD syntax; @context and @preserve cannot be aliased.","jsonld.SyntaxError",{code:"invalid keyword alias",context:O});if(oe&&oe.protected&&!Z&&(I.protected[K]=!0,Te.protected=!0,!ue(oe,Te))){const Oe=$&&$.protectedMode||"error";if("error"===Oe)throw new j(`Invalid JSON-LD syntax; tried to redefine "${K}" which is a protected term.`,"jsonld.SyntaxError",{code:"protected term redefinition",context:O,term:K});if("warn"===Oe)return void console.warn("WARNING: protected term redefinition",{term:K});throw new j("Invalid protectedMode.","jsonld.SyntaxError",{code:"invalid protected mode",context:O,term:K,protectedMode:Oe})}},P.expandIri=(I,O,K,E)=>X(I,O,K,void 0,void 0,E),P.getInitialContext=I=>{const O=JSON.stringify({processingMode:I.processingMode}),K=S.get(O);if(K)return K;const E={processingMode:I.processingMode,mappings:new Map,inverse:null,getInverse:function(){const Te=this;if(Te.inverse)return Te.inverse;const me=Te.inverse={},ne=Te.fastCurieMap={},ye={},Oe=(Te["@language"]||"@none").toLowerCase(),$e=Te["@direction"],st=Te.mappings,Qe=[...st.keys()].sort(y);for(const tt of Qe){const Xe=st.get(tt);if(null===Xe)continue;let ze=Xe["@container"]||"@none";if(ze=[].concat(ze).sort().join(""),null===Xe["@id"])continue;const Le=b(Xe["@id"]);for(const Ke of Le){let Me=me[Ke];const Ue=P.isKeyword(Ke);if(Me)!Ue&&!Xe._termHasColon&&ye[Ke].push(tt);else if(me[Ke]=Me={},!Ue&&!Xe._termHasColon){ye[Ke]=[tt];const qe={iri:Ke,terms:ye[Ke]};Ke[0]in ne?ne[Ke[0]].push(qe):ne[Ke[0]]=[qe]}if(Me[ze]||(Me[ze]={"@language":{},"@type":{},"@any":{}}),Me=Me[ze],ae(tt,Me["@any"],"@none"),Xe.reverse)ae(tt,Me["@type"],"@reverse");else if("@none"===Xe["@type"])ae(tt,Me["@any"],"@none"),ae(tt,Me["@language"],"@none"),ae(tt,Me["@type"],"@none");else if("@type"in Xe)ae(tt,Me["@type"],Xe["@type"]);else if("@language"in Xe&&"@direction"in Xe){const qe=Xe["@language"],ke=Xe["@direction"];ae(tt,Me["@language"],qe&&ke?`${qe}_${ke}`.toLowerCase():qe?qe.toLowerCase():ke?`_${ke}`:"@null")}else"@language"in Xe?ae(tt,Me["@language"],(Xe["@language"]||"@null").toLowerCase()):"@direction"in Xe?ae(tt,Me["@language"],Xe["@direction"]?`_${Xe["@direction"]}`:"@none"):$e?(ae(tt,Me["@language"],`_${$e}`),ae(tt,Me["@language"],"@none"),ae(tt,Me["@type"],"@none")):(ae(tt,Me["@language"],Oe),ae(tt,Me["@language"],"@none"),ae(tt,Me["@type"],"@none"))}}for(const tt in ne)Z(ne,tt,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===S.size&&S.clear(),S.set(O,E),E;function Z(Te,me,ne){const ye=Te[me],Oe=Te[me]={};let $e,st;for(const Qe of ye)$e=Qe.iri,st=ne>=$e.length?"":$e[ne],st in Oe?Oe[st].push(Qe):Oe[st]=[Qe];for(const Qe in Oe)""!==Qe&&Z(Oe,Qe,ne+1)}function ae(Te,me,ne){me.hasOwnProperty(ne)||(me[ne]=Te)}},P.getContextValue=(I,O,K)=>{if(null===O)return"@context"===K?void 0:null;if(I.mappings.has(O)){const E=I.mappings.get(O);if(v(K))return E;if(E.hasOwnProperty(K))return E[K]}return"@language"===K&&K in I||"@direction"===K&&K in I?I[K]:"@context"!==K?null:void 0},P.processingMode=(I,O)=>O.toString()>="1.1"?!I.processingMode||I.processingMode>="json-ld-"+O.toString():"json-ld-1.0"===I.processingMode,P.isKeyword=I=>{if(!H(I)||"@"!==I[0])return!1;switch(I){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,Se,he){"use strict";const{parseLinkHeader:W,buildHeaders:j}=Y("../util"),{LINK_HEADER_CONTEXT:k}=Y("../constants"),Q=Y("../JsonLdError"),H=Y("../RequestQueue"),{prependBase:v}=Y("../url"),C=/(^|(\r\n))link:/i;function R(T,b,y){const S=new(T=T||XMLHttpRequest);return new Promise((A,z)=>{S.onload=()=>A(S),S.onerror=P=>z(P),S.open("GET",b,!0);for(const P in y)S.setRequestHeader(P,y[P]);S.send()})}Se.exports=({secure:T,headers:b={},xhr:y}={headers:{}})=>{return b=j(b),(new H).wrapLoader(A);function A(P){return z.apply(this,arguments)}function z(){return(z=yt(function*(P){if(0!==P.indexOf("http:")&&0!==P.indexOf("https:"))throw new Q('URL could not be dereferenced; only "http" and "https" URLs are supported.',"jsonld.InvalidUrl",{code:"loading document failed",url:P});if(T&&0!==P.indexOf("https"))throw new Q('URL could not be dereferenced; secure mode is enabled and the URL\'s scheme is not "https".',"jsonld.InvalidUrl",{code:"loading document failed",url:P});let X;try{X=yield R(y,P,b)}catch(E){throw new Q("URL could not be dereferenced, an error occurred.","jsonld.LoadDocumentError",{code:"loading document failed",url:P,cause:E})}if(X.status>=400)throw new Q("URL could not be dereferenced: "+X.statusText,"jsonld.LoadDocumentError",{code:"loading document failed",url:P,httpStatusCode:X.status});let ue={contextUrl:null,documentUrl:P,document:X.response},I=null;const O=X.getResponseHeader("Content-Type");let K;if(C.test(X.getAllResponseHeaders())&&(K=X.getResponseHeader("Link")),K&&"application/ld+json"!==O){const E=W(K),$=E[k];if(Array.isArray($))throw new Q("URL could not be dereferenced, it has more than one associated HTTP Link Header.","jsonld.InvalidUrl",{code:"multiple context link headers",url:P});$&&(ue.contextUrl=$.target),I=E.alternate,I&&"application/ld+json"==I.type&&!(O||"").match(/^application\/(\w*\+)?json$/)&&(ue=yield A(v(P,I.target)))}return ue})).apply(this,arguments)}}},{"../JsonLdError":12,"../RequestQueue":15,"../constants":18,"../url":31,"../util":32}],21:[function(Y,Se,he){"use strict";const W=Y("./JsonLdError"),{isArray:j,isObject:k,isEmptyObject:Q,isString:H,isUndefined:v}=Y("./types"),{isList:C,isValue:R,isGraph:T,isSubject:b}=Y("./graphTypes"),{expandIri:y,getContextValue:S,isKeyword:A,process:z,processingMode:P}=Y("./context"),{isAbsolute:X}=Y("./url"),{addValue:ue,asArray:I,getValues:O,validateTypeValue:K}=Y("./util"),E={};Se.exports=E;const $=/^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$/;function Z(ne){return ae.apply(this,arguments)}function ae(){return(ae=yt(function*({activeCtx:ne,activeProperty:ye,expandedActiveProperty:Oe,element:$e,expandedParent:st,options:Qe={},insideList:tt,typeKey:Xe,typeScopedContext:ze,expansionMap:Le}){const Ke=Object.keys($e).sort(),Me=[];let Ue;const qe=$e[Xe]&&"@json"===y(ne,j($e[Xe])?$e[Xe][0]:$e[Xe],{vocab:!0},Qe);for(const ke of Ke){let G,q=$e[ke];if("@context"===ke)continue;let pe=y(ne,ke,{vocab:!0},Qe);if((null===pe||!X(pe)&&!A(pe))&&(pe=Le({unmappedProperty:ke,activeCtx:ne,activeProperty:ye,parent:$e,options:Qe,insideList:tt,value:q,expandedParent:st}),void 0===pe))continue;if(A(pe)){if("@reverse"===Oe)throw new W("Invalid JSON-LD syntax; a keyword cannot be used as a @reverse property.","jsonld.SyntaxError",{code:"invalid reverse property map",value:q});if(pe in st&&"@included"!==pe&&"@type"!==pe)throw new W("Invalid JSON-LD syntax; colliding keywords detected.","jsonld.SyntaxError",{code:"colliding keywords",keyword:pe})}if("@id"===pe){if(!H(q)){if(!Qe.isFrame)throw new W('Invalid JSON-LD syntax; "@id" value must a string.',"jsonld.SyntaxError",{code:"invalid @id value",value:q});if(k(q)){if(!Q(q))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:q})}else{if(!j(q))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:q});if(!q.every(pt=>H(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:q})}}ue(st,"@id",I(q).map(pt=>H(pt)?y(ne,pt,{base:!0},Qe):pt),{propertyIsArray:Qe.isFrame});continue}if("@type"===pe){k(q)&&(q=Object.fromEntries(Object.entries(q).map(([pt,we])=>[y(ze,pt,{vocab:!0}),I(we).map(B=>y(ze,B,{base:!0,vocab:!0}))]))),K(q,Qe.isFrame),ue(st,"@type",I(q).map(pt=>H(pt)?y(ze,pt,{base:!0,vocab:!0},Qe):pt),{propertyIsArray:Qe.isFrame});continue}if("@included"===pe&&P(ne,1.1)){const pt=I(yield E.expand({activeCtx:ne,activeProperty:ye,element:q,options:Qe,expansionMap:Le}));if(!pt.every(we=>b(we)))throw new W("Invalid JSON-LD syntax; values of @included must expand to node objects.","jsonld.SyntaxError",{code:"invalid @included value",value:q});ue(st,"@included",pt,{propertyIsArray:!0});continue}if("@graph"===pe&&!k(q)&&!j(q))throw new W('Invalid JSON-LD syntax; "@graph" value must not be an object or an array.',"jsonld.SyntaxError",{code:"invalid @graph value",value:q});if("@value"===pe){Ue=q,qe&&P(ne,1.1)?st["@value"]=q:ue(st,"@value",q,{propertyIsArray:Qe.isFrame});continue}if("@language"===pe){if(null===q)continue;if(!H(q)&&!Qe.isFrame)throw new W('Invalid JSON-LD syntax; "@language" value must be a string.',"jsonld.SyntaxError",{code:"invalid language-tagged string",value:q});q=I(q).map(pt=>H(pt)?pt.toLowerCase():pt);for(const pt of q)H(pt)&&!pt.match($)&&console.warn(`@language must be valid BCP47: ${pt}`);ue(st,"@language",q,{propertyIsArray:Qe.isFrame});continue}if("@direction"===pe){if(!H(q)&&!Qe.isFrame)throw new W('Invalid JSON-LD syntax; "@direction" value must be a string.',"jsonld.SyntaxError",{code:"invalid base direction",value:q});q=I(q);for(const pt of q)if(H(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:q});ue(st,"@direction",q,{propertyIsArray:Qe.isFrame});continue}if("@index"===pe){if(!H(q))throw new W('Invalid JSON-LD syntax; "@index" value must be a string.',"jsonld.SyntaxError",{code:"invalid @index value",value:q});ue(st,"@index",q);continue}if("@reverse"===pe){if(!k(q))throw new W('Invalid JSON-LD syntax; "@reverse" value must be an object.',"jsonld.SyntaxError",{code:"invalid @reverse value",value:q});if(G=yield E.expand({activeCtx:ne,activeProperty:"@reverse",element:q,options:Qe,expansionMap:Le}),"@reverse"in G)for(const we in G["@reverse"])ue(st,we,G["@reverse"][we],{propertyIsArray:!0});let pt=st["@reverse"]||null;for(const we in G){if("@reverse"===we)continue;null===pt&&(pt=st["@reverse"]={}),ue(pt,we,[],{propertyIsArray:!0});const B=G[we];for(let N=0;N"@id"===pt||"@index"===pt)&&(G=I(G).map(pt=>({"@graph":I(pt)}))),de.mappings.has(ke)&&de.mappings.get(ke).reverse){const pt=st["@reverse"]=st["@reverse"]||{};G=I(G);for(let we=0;we"@value"===y(ne,pe,{vocab:!0},Qe)))throw new W("Invalid JSON-LD syntax; nested value must be a node object.","jsonld.SyntaxError",{code:"invalid @nest value",value:G});yield Z({activeCtx:ne,activeProperty:ye,expandedActiveProperty:Oe,element:G,expandedParent:st,options:Qe,insideList:tt,typeScopedContext:ze,typeKey:Xe,expansionMap:Le})}}})).apply(this,arguments)}function oe({activeCtx:ne,activeProperty:ye,value:Oe,options:$e}){if(null==Oe)return null;const st=y(ne,ye,{vocab:!0},$e);if("@id"===st)return y(ne,Oe,{base:!0},$e);if("@type"===st)return y(ne,Oe,{vocab:!0,base:!0},$e);const Qe=S(ne,ye,"@type");if(("@id"===Qe||"@graph"===st)&&H(Oe))return{"@id":y(ne,Oe,{base:!0},$e)};if("@vocab"===Qe&&H(Oe))return{"@id":y(ne,Oe,{vocab:!0,base:!0},$e)};if(A(st))return Oe;const tt={};if(Qe&&!["@id","@vocab","@none"].includes(Qe))tt["@type"]=Qe;else if(H(Oe)){const Xe=S(ne,ye,"@language");null!==Xe&&(tt["@language"]=Xe);const ze=S(ne,ye,"@direction");null!==ze&&(tt["@direction"]=ze)}return["boolean","number","string"].includes(typeof Oe)||(Oe=Oe.toString()),tt["@value"]=Oe,tt}function te(ne,ye,Oe,$e){const st=[],Qe=Object.keys(ye).sort();for(const tt of Qe){const Xe=y(ne,tt,{vocab:!0},$e);let ze=ye[tt];j(ze)||(ze=[ze]);for(const Le of ze){if(null===Le)continue;if(!H(Le))throw new W("Invalid JSON-LD syntax; language map values must be strings.","jsonld.SyntaxError",{code:"invalid language map value",languageMap:ye});const Ke={"@value":Le};"@none"!==Xe&&(Ke["@language"]=tt.toLowerCase()),Oe&&(Ke["@direction"]=Oe),st.push(Ke)}}return st}function Te(ne){return me.apply(this,arguments)}function me(){return(me=yt(function*({activeCtx:ne,options:ye,activeProperty:Oe,value:$e,expansionMap:st,asGraph:Qe,indexKey:tt,propertyIndex:Xe}){const ze=[],Le=Object.keys($e).sort(),Ke="@type"===tt;for(let Me of Le){if(Ke){const ke=S(ne,Me,"@context");v(ke)||(ne=yield z({activeCtx:ne,localCtx:ke,propagate:!1,options:ye}))}let qe,Ue=$e[Me];j(Ue)||(Ue=[Ue]),Ue=yield E.expand({activeCtx:ne,activeProperty:Oe,element:Ue,options:ye,insideList:!1,insideIndex:!0,expansionMap:st}),qe=Xe?"@none"===Me?"@none":oe({activeCtx:ne,activeProperty:tt,value:Me,options:ye}):y(ne,Me,{vocab:!0},ye),"@id"===tt?Me=y(ne,Me,{base:!0},ye):Ke&&(Me=qe);for(let ke of Ue){if(Qe&&!T(ke)&&(ke={"@graph":[ke]}),"@type"===tt)"@none"===qe||(ke["@type"]=ke["@type"]?[Me].concat(ke["@type"]):[Me]);else{if(R(ke)&&!["@language","@type","@index"].includes(tt))throw new W(`Invalid JSON-LD syntax; Attempt to add illegal key to value object: "${tt}".`,"jsonld.SyntaxError",{code:"invalid value object",value:ke});Xe?"@none"!==qe&&ue(ke,Xe,qe,{propertyIsArray:!0,prependValue:!0}):"@none"!==qe&&!(tt in ke)&&(ke[tt]=Me)}ze.push(ke)}}return ze})).apply(this,arguments)}E.expand=function(){var ne=yt(function*({activeCtx:ye,activeProperty:Oe=null,element:$e,options:st={},insideList:Qe=!1,insideIndex:tt=!1,typeScopedContext:Xe=null,expansionMap:ze=(()=>{})}){if(null==$e)return null;if("@default"===Oe&&(st=Object.assign({},st,{isFrame:!1})),!j($e)&&!k($e)){if(!Qe&&(null===Oe||"@graph"===y(ye,Oe,{vocab:!0},st))){const G=yield ze({unmappedValue:$e,activeCtx:ye,activeProperty:Oe,options:st,insideList:Qe});return void 0===G?null:G}return oe({activeCtx:ye,activeProperty:Oe,value:$e,options:st})}if(j($e)){let G=[];const pe=S(ye,Oe,"@container")||[];Qe=Qe||pe.includes("@list");for(let de=0;de<$e.length;++de){let je=yield E.expand({activeCtx:ye,activeProperty:Oe,element:$e[de],options:st,expansionMap:ze,insideIndex:tt,typeScopedContext:Xe});Qe&&j(je)&&(je={"@list":je}),(null!==je||(je=yield ze({unmappedValue:$e[de],activeCtx:ye,activeProperty:Oe,parent:$e,index:de,options:st,expandedParent:G,insideList:Qe}),void 0!==je))&&(j(je)?G=G.concat(je):G.push(je))}return G}const Le=y(ye,Oe,{vocab:!0},st),Ke=S(ye,Oe,"@context");Xe=Xe||(ye.previousContext?ye:null);let Me=Object.keys($e).sort(),Ue=!tt;if(Ue&&Xe&&Me.length<=2&&!Me.includes("@context"))for(const G of Me){const pe=y(Xe,G,{vocab:!0},st);if("@value"===pe){Ue=!1,ye=Xe;break}if("@id"===pe&&1===Me.length){Ue=!1;break}}Ue&&(ye=ye.revertToPreviousContext()),v(Ke)||(ye=yield z({activeCtx:ye,localCtx:Ke,propagate:!0,overrideProtected:!0,options:st})),"@context"in $e&&(ye=yield z({activeCtx:ye,localCtx:$e["@context"],options:st})),Xe=ye;let qe=null;for(const G of Me)if("@type"===y(ye,G,{vocab:!0},st)){qe=qe||G;const de=$e[G],je=Array.isArray(de)?de.length>1?de.slice().sort():de:[de];for(const _t of je){const pt=S(Xe,_t,"@context");v(pt)||(ye=yield z({activeCtx:ye,localCtx:pt,options:st,propagate:!1}))}}let ke={};yield Z({activeCtx:ye,activeProperty:Oe,expandedActiveProperty:Le,element:$e,expandedParent:ke,options:st,insideList:Qe,typeKey:qe,typeScopedContext:Xe,expansionMap:ze}),Me=Object.keys(ke);let q=Me.length;if("@value"in ke){if("@type"in ke&&("@language"in ke||"@direction"in ke))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:ke});let G=q-1;if("@type"in ke&&(G-=1),"@index"in ke&&(G-=1),"@language"in ke&&(G-=1),"@direction"in ke&&(G-=1),0!==G)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:ke});const pe=null===ke["@value"]?[]:I(ke["@value"]),de=O(ke,"@type");if(!P(ye,1.1)||!de.includes("@json")||1!==de.length)if(0===pe.length){const je=yield ze({unmappedValue:ke,activeCtx:ye,activeProperty:Oe,element:$e,options:st,insideList:Qe});ke=void 0!==je?je:null}else{if(!pe.every(je=>H(je)||Q(je))&&"@language"in ke)throw new W("Invalid JSON-LD syntax; only strings may be language-tagged.","jsonld.SyntaxError",{code:"invalid language-tagged value",element:ke});if(!de.every(je=>X(je)&&!(H(je)&&0===je.indexOf("_:"))||Q(je)))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:ke})}}else if("@type"in ke&&!j(ke["@type"]))ke["@type"]=[ke["@type"]];else if("@set"in ke||"@list"in ke){if(q>1&&(2!==q||!("@index"in ke)))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:ke});"@set"in ke&&(ke=ke["@set"],Me=Object.keys(ke),q=Me.length)}else if(1===q&&"@language"in ke){const G=yield ze(ke,{unmappedValue:ke,activeCtx:ye,activeProperty:Oe,element:$e,options:st,insideList:Qe});ke=void 0!==G?G:null}if(k(ke)&&!st.keepFreeFloatingNodes&&!Qe&&(null===Oe||"@graph"===Le)&&(0===q||"@value"in ke||"@list"in ke||1===q&&"@id"in ke)){const G=yield ze({unmappedValue:ke,activeCtx:ye,activeProperty:Oe,element:$e,options:st,insideList:Qe});ke=void 0!==G?G:null}return ke});return function(ye){return ne.apply(this,arguments)}}()},{"./JsonLdError":12,"./context":19,"./graphTypes":25,"./types":30,"./url":31,"./util":32}],22:[function(Y,Se,he){"use strict";const{isSubjectReference:W}=Y("./graphTypes"),{createMergedNodeMap:j}=Y("./nodeMap"),k={};Se.exports=k,k.flatten=Q=>{const H=j(Q),v=[],C=Object.keys(H).sort();for(let R=0;R=0;--ae){const oe=Z[ae];if(oe.graph===$&&oe.subject["@id"]===E["@id"])return!0}return!1}function S(E,$,Z){const ae="@"+Z;let oe=ae in E?E[ae][0]:$[Z];if("embed"===Z)if(!0===oe)oe="@once";else if(!1===oe)oe="@never";else if("@always"!==oe&&"@never"!==oe&&"@link"!==oe&&"@first"!==oe&&"@last"!==oe&&"@once"!==oe)throw new v("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:E});return oe}function A(E){if(!k.isArray(E)||1!==E.length||!k.isObject(E[0]))throw new v("Invalid JSON-LD syntax; a JSON-LD frame must be a single object.","jsonld.SyntaxError",{frame:E});if("@id"in E[0])for(const $ of Q.asArray(E[0]["@id"]))if(!k.isObject($)&&!H.isAbsolute($)||k.isString($)&&0===$.indexOf("_:"))throw new v("Invalid JSON-LD syntax; invalid @id in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:E});if("@type"in E[0])for(const $ of Q.asArray(E[0]["@type"]))if(!k.isObject($)&&!H.isAbsolute($)||k.isString($)&&0===$.indexOf("_:"))throw new v("Invalid JSON-LD syntax; invalid @type in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:E})}function P(E,$,Z,ae){let oe=!0,te=!1;for(const Te in Z){let me=!1;const ne=Q.getValues($,Te),ye=0===Q.getValues(Z,Te).length;if("@id"===Te){if(k.isEmptyObject(Z["@id"][0]||{})?me=!0:Z["@id"].length>=0&&(me=Z["@id"].includes(ne[0])),!ae.requireAll)return me}else if("@type"===Te){if(oe=!1,ye){if(ne.length>0)return!1;me=!0}else if(1===Z["@type"].length&&k.isEmptyObject(Z["@type"][0]))me=ne.length>0;else for(const Oe of Z["@type"])me=!(!k.isObject(Oe)||!("@default"in Oe))||me||ne.some($e=>$e===Oe);if(!ae.requireAll)return me}else{if(W(Te))continue;{const Oe=Q.getValues(Z,Te)[0];let $e=!1;if(Oe&&(A([Oe]),$e="@default"in Oe),oe=!1,0===ne.length&&$e)continue;if(ne.length>0&&ye)return!1;if(void 0===Oe){if(ne.length>0)return!1;me=!0}else if(j.isList(Oe)){const st=Oe["@list"][0];if(j.isList(ne[0])){const Qe=ne[0]["@list"];j.isValue(st)?me=Qe.some(tt=>K(st,tt)):(j.isSubject(st)||j.isSubjectReference(st))&&(me=Qe.some(tt=>O(E,st,tt,ae)))}}else me=j.isValue(Oe)?ne.some(st=>K(Oe,st)):j.isSubjectReference(Oe)?ne.some(st=>O(E,Oe,st,ae)):!!k.isObject(Oe)&&ne.length>0}}if(!me&&ae.requireAll)return!1;te=te||me}return oe||te}function X(E,$){const Z=E.uniqueEmbeds[E.graph],ae=Z[$],oe=ae.parent,te=ae.property,Te={"@id":$};if(k.isArray(oe)){for(let ne=0;ne{const ye=Object.keys(Z);for(const Oe of ye)Oe in Z&&k.isObject(Z[Oe].parent)&&Z[Oe].parent["@id"]===ne&&(delete Z[Oe],me(Oe))};me($)}function ue(E,$){if(k.isArray(E))return E.map(Z=>ue(Z,$));if(k.isObject(E)){if("@preserve"in E)return E["@preserve"][0];if(j.isValue(E))return E;if(j.isList(E))return E["@list"]=ue(E["@list"],$),E;if("@id"in E){const Z=E["@id"];if($.link.hasOwnProperty(Z)){const ae=$.link[Z].indexOf(E);if(-1!==ae)return $.link[Z][ae];$.link[Z].push(E)}else $.link[Z]=[E]}for(const Z in E)"@id"===Z&&$.bnodesToClear.includes(E[Z])?delete E["@id"]:E[Z]=ue(E[Z],$)}return E}function I(E,$,Z){k.isObject(E)?Q.addValue(E,$,Z,{propertyIsArray:!0}):E.push(Z)}function O(E,$,Z,ae){if(!("@id"in Z))return!1;const oe=E.subjects[Z["@id"]];return oe&&P(E,oe,$,ae)}function K(E,$){const Z=$["@value"],ae=$["@type"],oe=$["@language"],te=E["@value"]?k.isArray(E["@value"])?E["@value"]:[E["@value"]]:[],Te=E["@type"]?k.isArray(E["@type"])?E["@type"]:[E["@type"]]:[],me=E["@language"]?k.isArray(E["@language"])?E["@language"]:[E["@language"]]:[];return 0===te.length&&0===Te.length&&0===me.length||!(!te.includes(Z)&&!k.isEmptyObject(te[0])||!(!ae&&0===Te.length||Te.includes(ae)||ae&&k.isEmptyObject(Te[0]))||!(!oe&&0===me.length||me.includes(oe)||oe&&k.isEmptyObject(me[0])))}Se.exports=T,T.frameMergedOrDefault=(E,$,Z)=>{const ae={options:Z,embedded:!1,graph:"@default",graphMap:{"@default":{}},subjectStack:[],link:{},bnodeMap:{}},oe=new Q.IdentifierIssuer("_:b");C(E,ae.graphMap,"@default",oe),Z.merged&&(ae.graphMap["@merged"]=R(ae.graphMap),ae.graph="@merged"),ae.subjects=ae.graphMap[ae.graph];const te=[];return T.frame(ae,Object.keys(ae.subjects).sort(),$,te),Z.pruneBlankNodeIdentifiers&&(Z.bnodesToClear=Object.keys(ae.bnodeMap).filter(Te=>1===ae.bnodeMap[Te].length)),Z.link={},ue(te,Z)},T.frame=(E,$,Z,ae,oe=null)=>{A(Z);const te=E.options,Te={embed:S(Z=Z[0],te,"embed"),explicit:S(Z,te,"explicit"),requireAll:S(Z,te,"requireAll")};E.link.hasOwnProperty(E.graph)||(E.link[E.graph]={});const me=E.link[E.graph],ne=function(E,$,Z,ae){const oe={};for(const te of $){const Te=E.graphMap[E.graph][te];P(E,Te,Z,ae)&&(oe[te]=Te)}return oe}(E,$,Z,Te),ye=Object.keys(ne).sort();for(const Oe of ye){const $e=ne[Oe];if(null===oe?E.uniqueEmbeds={[E.graph]:{}}:E.uniqueEmbeds[E.graph]=E.uniqueEmbeds[E.graph]||{},"@link"===Te.embed&&Oe in me){I(ae,oe,me[Oe]);continue}const st={"@id":Oe};if(0===Oe.indexOf("_:")&&Q.addValue(E.bnodeMap,Oe,st,{propertyIsArray:!0}),me[Oe]=st,("@first"===Te.embed||"@last"===Te.embed)&&E.is11)throw new v("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:Z});if(E.embedded||!E.uniqueEmbeds[E.graph].hasOwnProperty(Oe)){if(E.embedded&&("@never"===Te.embed||y($e,E.graph,E.subjectStack))){I(ae,oe,st);continue}if(E.embedded&&("@first"==Te.embed||"@once"==Te.embed)&&E.uniqueEmbeds[E.graph].hasOwnProperty(Oe)){I(ae,oe,st);continue}if("@last"===Te.embed&&Oe in E.uniqueEmbeds[E.graph]&&X(E,Oe),E.uniqueEmbeds[E.graph][Oe]={parent:ae,property:oe},E.subjectStack.push({subject:$e,graph:E.graph}),Oe in E.graphMap){let Qe=!1,tt=null;"@graph"in Z?(tt=Z["@graph"][0],Qe=!("@merged"===Oe||"@default"===Oe),k.isObject(tt)||(tt={})):(Qe="@merged"!==E.graph,tt={}),Qe&&T.frame(Sn(ot({},E),{graph:Oe,embedded:!1}),Object.keys(E.graphMap[Oe]).sort(),[tt],st,"@graph")}"@included"in Z&&T.frame(Sn(ot({},E),{embedded:!1}),$,Z["@included"],st,"@included");for(const Qe of Object.keys($e).sort())if(W(Qe)){if(st[Qe]=Q.clone($e[Qe]),"@type"===Qe)for(const tt of $e["@type"])0===tt.indexOf("_:")&&Q.addValue(E.bnodeMap,tt,st,{propertyIsArray:!0})}else if(!Te.explicit||Qe in Z)for(const tt of $e[Qe]){const Xe=Qe in Z?Z[Qe]:b(Te);if(j.isList(tt)){const ze=Z[Qe]&&Z[Qe][0]&&Z[Qe][0]["@list"]?Z[Qe][0]["@list"]:b(Te),Le={"@list":[]};I(st,Qe,Le);const Ke=tt["@list"];for(const Me of Ke)j.isSubjectReference(Me)?T.frame(Sn(ot({},E),{embedded:!0}),[Me["@id"]],ze,Le,"@list"):I(Le,"@list",Q.clone(Me))}else j.isSubjectReference(tt)?T.frame(Sn(ot({},E),{embedded:!0}),[tt["@id"]],Xe,st,Qe):K(Xe[0],tt)&&I(st,Qe,Q.clone(tt))}for(const Qe of Object.keys(Z).sort()){if("@type"===Qe){if(!k.isObject(Z[Qe][0])||!("@default"in Z[Qe][0]))continue}else if(W(Qe))continue;const tt=Z[Qe][0]||{};if(!S(tt,te,"omitDefault")&&!(Qe in st)){let ze="@null";"@default"in tt&&(ze=Q.clone(tt["@default"])),k.isArray(ze)||(ze=[ze]),st[Qe]=[{"@preserve":ze}]}}for(const Qe of Object.keys(Z["@reverse"]||{}).sort()){const tt=Z["@reverse"][Qe];for(const Xe of Object.keys(E.subjects))Q.getValues(E.subjects[Xe],Qe).some(Le=>Le["@id"]===Oe)&&(st["@reverse"]=st["@reverse"]||{},Q.addValue(st["@reverse"],Qe,[],{propertyIsArray:!0}),T.frame(Sn(ot({},E),{embedded:!0}),[Xe],tt,st["@reverse"][Qe],oe))}I(ae,oe,st),E.subjectStack.pop()}}},T.cleanupNull=(E,$)=>{if(k.isArray(E))return E.map(ae=>T.cleanupNull(ae,$)).filter(ae=>ae);if("@null"===E)return null;if(k.isObject(E)){if("@id"in E){const Z=E["@id"];if($.link.hasOwnProperty(Z)){const ae=$.link[Z].indexOf(E);if(-1!==ae)return $.link[Z][ae];$.link[Z].push(E)}else $.link[Z]=[E]}for(const Z in E)E[Z]=T.cleanupNull(E[Z],$)}return E}},{"./JsonLdError":12,"./context":19,"./graphTypes":25,"./nodeMap":27,"./types":30,"./url":31,"./util":32}],24:[function(Y,Se,he){"use strict";const W=Y("./JsonLdError"),j=Y("./graphTypes"),k=Y("./types"),Q=Y("./util"),{RDF_LIST:H,RDF_FIRST:v,RDF_REST:C,RDF_NIL:R,RDF_TYPE:T,RDF_JSON_LITERAL:b,XSD_BOOLEAN:y,XSD_DOUBLE:S,XSD_INTEGER:A,XSD_STRING:z}=Y("./constants"),P=/^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$/,X={};function ue(I,O,K){if(I.termType.endsWith("Node"))return{"@id":I.value};const E={"@value":I.value};if(I.language)E["@language"]=I.language;else{let $=I.datatype.value;if($||($=z),$===b){$="@json";try{E["@value"]=JSON.parse(E["@value"])}catch(Z){throw new W("JSON literal could not be parsed.","jsonld.InvalidJsonLiteral",{code:"invalid JSON literal",value:E["@value"],cause:Z})}}if(O){if($===y)"true"===E["@value"]?E["@value"]=!0:"false"===E["@value"]&&(E["@value"]=!1);else if(k.isNumeric(E["@value"]))if($===A){const Z=parseInt(E["@value"],10);Z.toFixed(0)===E["@value"]&&(E["@value"]=Z)}else $===S&&(E["@value"]=parseFloat(E["@value"]));[y,A,S,z].includes($)||(E["@type"]=$)}else if("i18n-datatype"===K&&$.startsWith("https://www.w3.org/ns/i18n#")){const[,Z,ae]=$.split(/[#_]/);Z.length>0&&(E["@language"]=Z,Z.match(P)||console.warn(`@language must be valid BCP47: ${Z}`)),E["@direction"]=ae}else $!==z&&(E["@type"]=$)}return E}Se.exports=X,X.fromRDF=function(){var I=yt(function*(O,{useRdfType:K=!1,useNativeTypes:E=!1,rdfDirection:$=null}){const Z={},ae={"@default":Z},oe={};for(const me of O){const ne="DefaultGraph"===me.graph.termType?"@default":me.graph.value;ne in ae||(ae[ne]={}),"@default"!==ne&&!(ne in Z)&&(Z[ne]={"@id":ne});const ye=ae[ne],Oe=me.subject.value,$e=me.predicate.value,st=me.object;Oe in ye||(ye[Oe]={"@id":Oe});const Qe=ye[Oe],tt=st.termType.endsWith("Node");if(tt&&!(st.value in ye)&&(ye[st.value]={"@id":st.value}),$e===T&&!K&&tt){Q.addValue(Qe,"@type",st.value,{propertyIsArray:!0});continue}const Xe=ue(st,E,$);if(Q.addValue(Qe,$e,Xe,{propertyIsArray:!0}),tt)if(st.value===R){const ze=ye[st.value];"usages"in ze||(ze.usages=[]),ze.usages.push({node:Qe,property:$e,value:Xe})}else oe[st.value]=!(st.value in oe)&&{node:Qe,property:$e,value:Xe}}for(const me in ae){const ne=ae[me];if(!(R in ne))continue;const ye=ne[R];if(ye.usages){for(let Oe of ye.usages){let $e=Oe.node,st=Oe.property,Qe=Oe.value;const tt=[],Xe=[];let ze=Object.keys($e).length;for(;st===C&&k.isObject(oe[$e["@id"]])&&k.isArray($e[v])&&1===$e[v].length&&k.isArray($e[C])&&1===$e[C].length&&(3===ze||4===ze&&k.isArray($e["@type"])&&1===$e["@type"].length&&$e["@type"][0]===H)&&(tt.push($e[v][0]),Xe.push($e["@id"]),Oe=oe[$e["@id"]],$e=Oe.node,st=Oe.property,Qe=Oe.value,ze=Object.keys($e).length,j.isBlankNode($e)););delete Qe["@id"],Qe["@list"]=tt.reverse();for(const Le of Xe)delete ne[Le]}delete ye.usages}}const te=[],Te=Object.keys(Z).sort();for(const me of Te){const ne=Z[me];if(me in ae){const ye=ne["@graph"]=[],Oe=ae[me],$e=Object.keys(Oe).sort();for(const st of $e){const Qe=Oe[st];j.isSubjectReference(Qe)||ye.push(Qe)}}j.isSubjectReference(ne)||te.push(ne)}return te});return function(O,K){return I.apply(this,arguments)}}()},{"./JsonLdError":12,"./constants":18,"./graphTypes":25,"./types":30,"./util":32}],25:[function(Y,Se,he){"use strict";const W=Y("./types"),j={};Se.exports=j,j.isSubject=k=>!(!W.isObject(k)||"@value"in k||"@set"in k||"@list"in k)&&(Object.keys(k).length>1||!("@id"in k)),j.isSubjectReference=k=>W.isObject(k)&&1===Object.keys(k).length&&"@id"in k,j.isValue=k=>W.isObject(k)&&"@value"in k,j.isList=k=>W.isObject(k)&&"@list"in k,j.isGraph=k=>W.isObject(k)&&"@graph"in k&&1===Object.keys(k).filter(Q=>"@id"!==Q&&"@index"!==Q).length,j.isSimpleGraph=k=>j.isGraph(k)&&!("@id"in k),j.isBlankNode=k=>!!W.isObject(k)&&("@id"in k?0===k["@id"].indexOf("_:"):0===Object.keys(k).length||!("@value"in k||"@set"in k||"@list"in k))},{"./types":30}],26:[function(Y,Se,he){const W=Y("rdf-canonize"),j=Y("./platform"),k=Y("./util"),Q=Y("./ContextResolver"),H=k.IdentifierIssuer,v=Y("./JsonLdError"),C=Y("lru-cache"),R=Y("./NQuads"),{expand:T}=Y("./expand"),{flatten:b}=Y("./flatten"),{fromRDF:y}=Y("./fromRdf"),{toRDF:S}=Y("./toRdf"),{frameMergedOrDefault:A,cleanupNull:z}=Y("./frame"),{isArray:P,isObject:X,isString:ue}=Y("./types"),{isSubjectReference:I}=Y("./graphTypes"),{expandIri:O,getInitialContext:K,process:E,processingMode:$}=Y("./context"),{compact:Z,compactIri:ae}=Y("./compact"),{createNodeMap:oe,createMergedNodeMap:te,mergeNodeMaps:Te}=Y("./nodeMap"),me=function(ye){const Oe={},st=new C({max:100});function Qe(tt,Le){var Ke=Le,{documentLoader:Xe=ye.documentLoader}=Ke,ze=Nq(Ke,["documentLoader"]);return Object.assign({},{documentLoader:Xe},ze,tt)}return ye.compact=function(){var tt=yt(function*(Xe,ze,Le){if(arguments.length<2)throw new TypeError("Could not compact, too few arguments.");if(null===ze)throw new v("The compaction context must not be null.","jsonld.CompactError",{code:"invalid local context"});if(null===Xe)return null;let Ke;(Le=Qe(Le,{base:ue(Xe)?Xe:"",compactArrays:!0,compactToRelative:!0,graph:!1,skipExpansion:!1,link:!1,issuer:new H("_:b"),contextResolver:new Q({sharedCache:st})})).link&&(Le.skipExpansion=!0),Le.compactToRelative||delete Le.base,Ke=Le.skipExpansion?Xe:yield ye.expand(Xe,Le);const Me=yield ye.processContext(K(Le),ze,Le);let Ue=yield Z({activeCtx:Me,element:Ke,options:Le,compactionMap:Le.compactionMap});Le.compactArrays&&!Le.graph&&P(Ue)?1===Ue.length?Ue=Ue[0]:0===Ue.length&&(Ue={}):Le.graph&&X(Ue)&&(Ue=[Ue]),X(ze)&&"@context"in ze&&(ze=ze["@context"]),ze=k.clone(ze),P(ze)||(ze=[ze]);const qe=ze;ze=[];for(let q=0;q0)&&ze.push(qe[q]);const ke=ze.length>0;if(1===ze.length&&(ze=ze[0]),P(Ue)){const q=ae({activeCtx:Me,iri:"@graph",relativeTo:{vocab:!0}}),G=Ue;Ue={},ke&&(Ue["@context"]=ze),Ue[q]=G}else if(X(Ue)&&ke){const q=Ue;Ue={"@context":ze};for(const G in q)Ue[G]=q[G]}return Ue});return function(Xe,ze,Le){return tt.apply(this,arguments)}}(),ye.expand=function(){var tt=yt(function*(Xe,ze){if(arguments.length<1)throw new TypeError("Could not expand, too few arguments.");!1===(ze=Qe(ze,{keepFreeFloatingNodes:!1,contextResolver:new Q({sharedCache:st})})).expansionMap&&(ze.expansionMap=void 0);const Le={},Ke=[];if("expandContext"in ze){const ke=k.clone(ze.expandContext);Le.expandContext=X(ke)&&"@context"in ke?ke:{"@context":ke},Ke.push(Le.expandContext)}let Me;if(ue(Xe)){const ke=yield ye.get(Xe,ze);Me=ke.documentUrl,Le.input=ke.document,ke.contextUrl&&(Le.remoteContext={"@context":ke.contextUrl},Ke.push(Le.remoteContext))}else Le.input=k.clone(Xe);"base"in ze||(ze.base=Me||"");let Ue=K(ze);for(const ke of Ke)Ue=yield E({activeCtx:Ue,localCtx:ke,options:ze});let qe=yield T({activeCtx:Ue,element:Le.input,options:ze,expansionMap:ze.expansionMap});return X(qe)&&"@graph"in qe&&1===Object.keys(qe).length?qe=qe["@graph"]:null===qe&&(qe=[]),P(qe)||(qe=[qe]),qe});return function(Xe,ze){return tt.apply(this,arguments)}}(),ye.flatten=function(){var tt=yt(function*(Xe,ze,Le){if(arguments.length<1)return new TypeError("Could not flatten, too few arguments.");ze="function"==typeof ze?null:ze||null,Le=Qe(Le,{base:ue(Xe)?Xe:"",contextResolver:new Q({sharedCache:st})});const Ke=yield ye.expand(Xe,Le),Me=b(Ke);return null===ze?Me:(Le.graph=!0,Le.skipExpansion=!0,yield ye.compact(Me,ze,Le))});return function(Xe,ze,Le){return tt.apply(this,arguments)}}(),ye.frame=function(){var tt=yt(function*(Xe,ze,Le){if(arguments.length<2)throw new TypeError("Could not frame, too few arguments.");if(Le=Qe(Le,{base:ue(Xe)?Xe:"",embed:"@once",explicit:!1,requireAll:!1,omitDefault:!1,bnodesToClear:[],contextResolver:new Q({sharedCache:st})}),ue(ze)){const de=yield ye.get(ze,Le);if(ze=de.document,de.contextUrl){let je=ze["@context"];je?P(je)?je.push(de.contextUrl):je=[je,de.contextUrl]:je=de.contextUrl,ze["@context"]=je}}const Ke=ze&&ze["@context"]||{},Me=yield ye.processContext(K(Le),Ke,Le);Le.hasOwnProperty("omitGraph")||(Le.omitGraph=$(Me,1.1)),Le.hasOwnProperty("pruneBlankNodeIdentifiers")||(Le.pruneBlankNodeIdentifiers=$(Me,1.1));const Ue=yield ye.expand(Xe,Le),qe=ot({},Le);qe.isFrame=!0,qe.keepFreeFloatingNodes=!0;const ke=yield ye.expand(ze,qe),q=Object.keys(ze).map(de=>O(Me,de,{vocab:!0}));qe.merged=!q.includes("@graph"),qe.is11=$(Me,1.1);const G=A(Ue,ke,qe);qe.graph=!Le.omitGraph,qe.skipExpansion=!0,qe.link={},qe.framing=!0;let pe=yield ye.compact(G,Ke,qe);return qe.link={},pe=z(pe,qe),pe});return function(Xe,ze,Le){return tt.apply(this,arguments)}}(),ye.link=function(){var tt=yt(function*(Xe,ze,Le){const Ke={};return ze&&(Ke["@context"]=ze),Ke["@embed"]="@link",ye.frame(Xe,Ke,Le)});return function(Xe,ze,Le){return tt.apply(this,arguments)}}(),ye.normalize=ye.canonize=function(){var tt=yt(function*(Xe,ze){if(arguments.length<1)throw new TypeError("Could not canonize, too few arguments.");if("inputFormat"in(ze=Qe(ze,{base:ue(Xe)?Xe:"",algorithm:"URDNA2015",skipExpansion:!1,contextResolver:new Q({sharedCache:st})}))){if("application/n-quads"!==ze.inputFormat&&"application/nquads"!==ze.inputFormat)throw new v("Unknown canonicalization input format.","jsonld.CanonizeError");const Me=R.parse(Xe);return W.canonize(Me,ze)}const Le=ot({},ze);delete Le.format,Le.produceGeneralizedRdf=!1;const Ke=yield ye.toRDF(Xe,Le);return W.canonize(Ke,ze)});return function(Xe,ze){return tt.apply(this,arguments)}}(),ye.fromRDF=function(){var tt=yt(function*(Xe,ze){if(arguments.length<1)throw new TypeError("Could not convert from RDF, too few arguments.");ze=Qe(ze,{format:ue(Xe)?"application/n-quads":void 0});const{format:Le}=ze;let{rdfParser:Ke}=ze;if(Le){if(Ke=Ke||Oe[Le],!Ke)throw new v("Unknown input format.","jsonld.UnknownFormat",{format:Le})}else Ke=()=>Xe;const Me=yield Ke(Xe);return y(Me,ze)});return function(Xe,ze){return tt.apply(this,arguments)}}(),ye.toRDF=function(){var tt=yt(function*(Xe,ze){if(arguments.length<1)throw new TypeError("Could not convert to RDF, too few arguments.");let Le;Le=(ze=Qe(ze,{base:ue(Xe)?Xe:"",skipExpansion:!1,contextResolver:new Q({sharedCache:st})})).skipExpansion?Xe:yield ye.expand(Xe,ze);const Ke=S(Le,ze);if(ze.format){if("application/n-quads"===ze.format||"application/nquads"===ze.format)return R.serialize(Ke);throw new v("Unknown output format.","jsonld.UnknownFormat",{format:ze.format})}return Ke});return function(Xe,ze){return tt.apply(this,arguments)}}(),ye.createNodeMap=function(){var tt=yt(function*(Xe,ze){if(arguments.length<1)throw new TypeError("Could not create node map, too few arguments.");ze=Qe(ze,{base:ue(Xe)?Xe:"",contextResolver:new Q({sharedCache:st})});const Le=yield ye.expand(Xe,ze);return te(Le,ze)});return function(Xe,ze){return tt.apply(this,arguments)}}(),ye.merge=function(){var tt=yt(function*(Xe,ze,Le){if(arguments.length<1)throw new TypeError("Could not merge, too few arguments.");if(!P(Xe))throw new TypeError('Could not merge, "docs" must be an array.');ze="function"==typeof ze?null:ze||null,Le=Qe(Le,{contextResolver:new Q({sharedCache:st})});const Ke=yield Promise.all(Xe.map(de=>{const je=ot({},Le);return ye.expand(de,je)}));let Me=!0;"mergeNodes"in Le&&(Me=Le.mergeNodes);const Ue=Le.issuer||new H("_:b"),qe={"@default":{}};for(let de=0;deye._documentLoader,set:tt=>ye._documentLoader=tt}),ye.documentLoader=function(){var tt=yt(function*(Xe){throw new v("Could not retrieve a JSON-LD document from the URL. URL dereferencing not implemented.","jsonld.LoadDocumentError",{code:"loading document failed",url:Xe})});return function(Xe){return tt.apply(this,arguments)}}(),ye.get=function(){var tt=yt(function*(Xe,ze){let Le;Le="function"==typeof ze.documentLoader?ze.documentLoader:ye.documentLoader;const Ke=yield Le(Xe);try{if(!Ke.document)throw new v("No remote document found at the given URL.","jsonld.NullRemoteDocument");ue(Ke.document)&&(Ke.document=JSON.parse(Ke.document))}catch(Me){throw new v("Could not retrieve a JSON-LD document from the URL.","jsonld.LoadDocumentError",{code:"loading document failed",cause:Me,remoteDoc:Ke})}return Ke});return function(Xe,ze){return tt.apply(this,arguments)}}(),ye.processContext=function(){var tt=yt(function*(Xe,ze,Le){return Le=Qe(Le,{base:"",contextResolver:new Q({sharedCache:st})}),null===ze?K(Le):(ze=k.clone(ze),X(ze)&&"@context"in ze||(ze={"@context":ze}),E({activeCtx:Xe,localCtx:ze,options:Le}))});return function(Xe,ze,Le){return tt.apply(this,arguments)}}(),ye.getContextValue=Y("./context").getContextValue,ye.documentLoaders={},ye.useDocumentLoader=function(tt){if(!(tt in ye.documentLoaders))throw new v('Unknown document loader type: "'+tt+'"',"jsonld.UnknownDocumentLoader",{type:tt});ye.documentLoader=ye.documentLoaders[tt].apply(ye,Array.prototype.slice.call(arguments,1))},ye.registerRDFParser=function(tt,Xe){Oe[tt]=Xe},ye.unregisterRDFParser=function(tt){delete Oe[tt]},ye.registerRDFParser("application/n-quads",R.parse),ye.registerRDFParser("application/nquads",R.parse),ye.url=Y("./url"),ye.util=k,Object.assign(ye,k),ye.promises=ye,ye.RequestQueue=Y("./RequestQueue"),ye.JsonLdProcessor=Y("./JsonLdProcessor")(ye),j.setupGlobals(ye),j.setupDocumentLoaders(ye),ye},ne=function(){return me(function(){return ne()})};me(ne),Se.exports=ne},{"./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,Se,he){"use strict";const{isKeyword:W}=Y("./context"),j=Y("./graphTypes"),k=Y("./types"),Q=Y("./util"),H=Y("./JsonLdError"),v={};Se.exports=v,v.createMergedNodeMap=(C,R)=>{const T=(R=R||{}).issuer||new Q.IdentifierIssuer("_:b"),b={"@default":{}};return v.createNodeMap(C,b,"@default",T),v.mergeNodeMaps(b)},v.createNodeMap=(C,R,T,b,y,S)=>{if(k.isArray(C)){for(const X of C)v.createNodeMap(X,R,T,b,void 0,S);return}if(!k.isObject(C))return void(S&&S.push(C));if(j.isValue(C)){if("@type"in C){let X=C["@type"];0===X.indexOf("_:")&&(C["@type"]=X=b.getId(X))}return void(S&&S.push(C))}if(S&&j.isList(C)){const X=[];return v.createNodeMap(C["@list"],R,T,b,y,X),void S.push({"@list":X})}if("@type"in C){const X=C["@type"];for(const ue of X)0===ue.indexOf("_:")&&b.getId(ue)}k.isUndefined(y)&&(y=j.isBlankNode(C)?b.getId(C["@id"]):C["@id"]),S&&S.push({"@id":y});const A=R[T],z=A[y]=A[y]||{};z["@id"]=y;const P=Object.keys(C).sort();for(let X of P){if("@id"===X)continue;if("@reverse"===X){const I={"@id":y},O=C["@reverse"];for(const K in O){const E=O[K];for(const $ of E){let Z=$["@id"];j.isBlankNode($)&&(Z=b.getId(Z)),v.createNodeMap($,R,T,b,Z),Q.addValue(A[Z],K,I,{propertyIsArray:!0,allowDuplicate:!1})}}continue}if("@graph"===X){y in R||(R[y]={}),v.createNodeMap(C[X],R,y,b);continue}if("@included"===X){v.createNodeMap(C[X],R,T,b);continue}if("@type"!==X&&W(X)){if("@index"===X&&X in z&&(C[X]!==z[X]||C[X]["@id"]!==z[X]["@id"]))throw new H("Invalid JSON-LD syntax; conflicting @index property detected.","jsonld.SyntaxError",{code:"conflicting indexes",subject:z});z[X]=C[X];continue}const ue=C[X];if(0===X.indexOf("_:")&&(X=b.getId(X)),0!==ue.length)for(let I of ue)if("@type"===X&&(I=0===I.indexOf("_:")?b.getId(I):I),j.isSubject(I)||j.isSubjectReference(I)){if("@id"in I&&!I["@id"])continue;const O=j.isBlankNode(I)?b.getId(I["@id"]):I["@id"];Q.addValue(z,X,{"@id":O},{propertyIsArray:!0,allowDuplicate:!1}),v.createNodeMap(I,R,T,b,O)}else if(j.isValue(I))Q.addValue(z,X,I,{propertyIsArray:!0,allowDuplicate:!1});else if(j.isList(I)){const O=[];v.createNodeMap(I["@list"],R,T,b,y,O),I={"@list":O},Q.addValue(z,X,I,{propertyIsArray:!0,allowDuplicate:!1})}else v.createNodeMap(I,R,T,b,y),Q.addValue(z,X,I,{propertyIsArray:!0,allowDuplicate:!1});else Q.addValue(z,X,[],{propertyIsArray:!0})}},v.mergeNodeMapGraphs=C=>{const R={};for(const T of Object.keys(C).sort())for(const b of Object.keys(C[T]).sort()){const y=C[T][b];b in R||(R[b]={"@id":b});const S=R[b];for(const A of Object.keys(y).sort())if(W(A)&&"@type"!==A)S[A]=Q.clone(y[A]);else for(const z of y[A])Q.addValue(S,A,Q.clone(z),{propertyIsArray:!0,allowDuplicate:!1})}return R},v.mergeNodeMaps=C=>{const R=C["@default"],T=Object.keys(C).sort();for(const b of T){if("@default"===b)continue;const y=C[b];let S=R[b];S?"@graph"in S||(S["@graph"]=[]):R[b]=S={"@id":b,"@graph":[]};const A=S["@graph"];for(const z of Object.keys(y).sort()){const P=y[z];j.isSubjectReference(P)||A.push(P)}}return R}},{"./JsonLdError":12,"./context":19,"./graphTypes":25,"./types":30,"./util":32}],28:[function(Y,Se,he){"use strict";const W=Y("./documentLoaders/xhr"),j={};Se.exports=j,j.setupDocumentLoaders=function(k){"undefined"!=typeof XMLHttpRequest&&(k.documentLoaders.xhr=W,k.useDocumentLoader("xhr"))},j.setupGlobals=function(k){void 0===globalThis.JsonLdProcessor&&Object.defineProperty(globalThis,"JsonLdProcessor",{writable:!0,enumerable:!1,configurable:!0,value:k.JsonLdProcessor})}},{"./documentLoaders/xhr":20}],29:[function(Y,Se,he){"use strict";const{createNodeMap:W}=Y("./nodeMap"),{isKeyword:j}=Y("./context"),k=Y("./graphTypes"),Q=Y("canonicalize"),H=Y("./types"),v=Y("./util"),{RDF_FIRST:C,RDF_REST:R,RDF_NIL:T,RDF_TYPE:b,RDF_JSON_LITERAL:y,RDF_LANGSTRING:S,XSD_BOOLEAN:A,XSD_DOUBLE:z,XSD_INTEGER:P,XSD_STRING:X}=Y("./constants"),{isAbsolute:ue}=Y("./url"),I={};function O($,Z,ae,oe,te){const Te=Object.keys(Z).sort();for(const me of Te){const ne=Z[me],ye=Object.keys(ne).sort();for(let Oe of ye){const $e=ne[Oe];if("@type"===Oe)Oe=b;else if(j(Oe))continue;for(const st of $e){const Qe={termType:me.startsWith("_:")?"BlankNode":"NamedNode",value:me};if(!ue(me))continue;const tt={termType:Oe.startsWith("_:")?"BlankNode":"NamedNode",value:Oe};if(!ue(Oe)||"BlankNode"===tt.termType&&!te.produceGeneralizedRdf)continue;const Xe=E(st,oe,$,ae,te.rdfDirection);Xe&&$.push({subject:Qe,predicate:tt,object:Xe,graph:ae})}}}}function E($,Z,ae,oe,te){const Te={};if(k.isValue($)){Te.termType="Literal",Te.value=void 0,Te.datatype={termType:"NamedNode"};let me=$["@value"];const ne=$["@type"]||null;"@json"===ne?(Te.value=Q(me),Te.datatype.value=y):H.isBoolean(me)?(Te.value=me.toString(),Te.datatype.value=ne||A):H.isDouble(me)||ne===z?(H.isDouble(me)||(me=parseFloat(me)),Te.value=me.toExponential(15).replace(/(\d)0*e\+?/,"$1E"),Te.datatype.value=ne||z):H.isNumber(me)?(Te.value=me.toFixed(0),Te.datatype.value=ne||P):"i18n-datatype"===te&&"@direction"in $?(Te.datatype.value="https://www.w3.org/ns/i18n#"+($["@language"]||"")+`_${$["@direction"]}`,Te.value=me):"@language"in $?(Te.value=me,Te.datatype.value=ne||S,Te.language=$["@language"]):(Te.value=me,Te.datatype.value=ne||X)}else if(k.isList($)){const me=function($,Z,ae,oe,te){const Te={termType:"NamedNode",value:C},me={termType:"NamedNode",value:R},ne={termType:"NamedNode",value:T},ye=$.pop(),Oe=ye?{termType:"BlankNode",value:Z.getId()}:ne;let $e=Oe;for(const st of $){const Qe=E(st,Z,ae,oe,te),tt={termType:"BlankNode",value:Z.getId()};ae.push({subject:$e,predicate:Te,object:Qe,graph:oe}),ae.push({subject:$e,predicate:me,object:tt,graph:oe}),$e=tt}if(ye){const st=E(ye,Z,ae,oe,te);ae.push({subject:$e,predicate:Te,object:st,graph:oe}),ae.push({subject:$e,predicate:me,object:ne,graph:oe})}return Oe}($["@list"],Z,ae,oe,te);Te.termType=me.termType,Te.value=me.value}else{const me=H.isObject($)?$["@id"]:$;Te.termType=me.startsWith("_:")?"BlankNode":"NamedNode",Te.value=me}return"NamedNode"!==Te.termType||ue(Te.value)?Te:null}Se.exports=I,I.toRDF=($,Z)=>{const ae=new v.IdentifierIssuer("_:b"),oe={"@default":{}};W($,oe,"@default",ae);const te=[],Te=Object.keys(oe).sort();for(const me of Te){let ne;if("@default"===me)ne={termType:"DefaultGraph",value:""};else{if(!ue(me))continue;ne=me.startsWith("_:")?{termType:"BlankNode"}:{termType:"NamedNode"},ne.value=me}O(te,oe[me],ne,ae,Z)}return te}},{"./constants":18,"./context":19,"./graphTypes":25,"./nodeMap":27,"./types":30,"./url":31,"./util":32,canonicalize:7}],30:[function(Y,Se,he){"use strict";const W={};Se.exports=W,W.isArray=Array.isArray,W.isBoolean=j=>"boolean"==typeof j||"[object Boolean]"===Object.prototype.toString.call(j),W.isDouble=j=>W.isNumber(j)&&(-1!==String(j).indexOf(".")||Math.abs(j)>=1e21),W.isEmptyObject=j=>W.isObject(j)&&0===Object.keys(j).length,W.isNumber=j=>"number"==typeof j||"[object Number]"===Object.prototype.toString.call(j),W.isNumeric=j=>!isNaN(parseFloat(j))&&isFinite(j),W.isObject=j=>"[object Object]"===Object.prototype.toString.call(j),W.isString=j=>"string"==typeof j||"[object String]"===Object.prototype.toString.call(j),W.isUndefined=j=>void 0===j},{}],31:[function(Y,Se,he){"use strict";const W=Y("./types"),j={};Se.exports=j,j.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*))?))?(?:(((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/}},j.parse=(Q,H)=>{const v={},C=j.parsers[H||"full"],R=C.regex.exec(Q);let T=C.keys.length;for(;T--;)v[C.keys[T]]=void 0===R[T]?null:R[T];return("https"===v.scheme&&"443"===v.port||"http"===v.scheme&&"80"===v.port)&&(v.href=v.href.replace(":"+v.port,""),v.authority=v.authority.replace(":"+v.port,""),v.port=null),v.normalizedPath=j.removeDotSegments(v.path),v},j.prependBase=(Q,H)=>{if(null===Q||j.isAbsolute(H))return H;(!Q||W.isString(Q))&&(Q=j.parse(Q||""));const v=j.parse(H),C={protocol:Q.protocol||""};if(null!==v.authority)C.authority=v.authority,C.path=v.path,C.query=v.query;else if(C.authority=Q.authority,""===v.path)C.path=Q.path,C.query=null!==v.query?v.query:Q.query;else{if(0===v.path.indexOf("/"))C.path=v.path;else{let T=Q.path;T=T.substr(0,T.lastIndexOf("/")+1),(T.length>0||Q.authority)&&"/"!==T.substr(-1)&&(T+="/"),T+=v.path,C.path=T}C.query=v.query}""!==v.path&&(C.path=j.removeDotSegments(C.path));let R=C.protocol;return null!==C.authority&&(R+="//"+C.authority),R+=C.path,null!==C.query&&(R+="?"+C.query),null!==v.fragment&&(R+="#"+v.fragment),""===R&&(R="./"),R},j.removeBase=(Q,H)=>{if(null===Q)return H;(!Q||W.isString(Q))&&(Q=j.parse(Q||""));let v="";if(""!==Q.href?v+=(Q.protocol||"")+"//"+(Q.authority||""):H.indexOf("//")&&(v+="//"),0!==H.indexOf(v))return H;const C=j.parse(H.substr(v.length)),R=Q.normalizedPath.split("/"),T=C.normalizedPath.split("/"),b=C.fragment||C.query?0:1;for(;R.length>0&&T.length>b&&R[0]===T[0];)R.shift(),T.shift();let y="";if(R.length>0){R.pop();for(let S=0;S{if(0===Q.length)return"";const H=Q.split("/"),v=[];for(;H.length>0;){const C=H.shift(),R=0===H.length;"."!==C?".."!==C?v.push(C):(v.pop(),R&&v.push("")):R&&v.push("")}return"/"===Q[0]&&v.length>0&&""!==v[0]&&v.unshift(""),1===v.length&&""===v[0]?"/":v.join("/")};const k=/^([A-Za-z][A-Za-z0-9+-.]*|_):[^\s]*$/;j.isAbsolute=Q=>W.isString(Q)&&k.test(Q),j.isRelative=Q=>W.isString(Q)},{"./types":30}],32:[function(Y,Se,he){"use strict";const W=Y("./graphTypes"),j=Y("./types"),k=Y("rdf-canonize").IdentifierIssuer,Q=Y("./JsonLdError"),H=/(?:<[^>]*?>|"[^"]*?"|[^,])+/g,v=/\s*<([^>]*?)>\s*(?:;\s*(.*))?/,C=/(.*?)=(?:(?:"([^"]*?)")|([^"]*?))\s*(?:(?:;\s*)|$)/g,R_headers={accept:"application/ld+json, application/json"},T={};function b(y,S){if(j.isArray(S))for(let A=0;A{if(Object.keys(y).some(A=>"accept"===A.toLowerCase()))throw new RangeError('Accept header may not be specified; only "'+R_headers.accept+'" is supported.');return Object.assign({Accept:R_headers.accept},y)},T.parseLinkHeader=y=>{const S={},A=y.match(H);for(let z=0;z{if(!(j.isString(y)||j.isArray(y)&&y.every(A=>j.isString(A)))){if(S&&j.isObject(y))switch(Object.keys(y).length){case 0:return;case 1:if("@default"in y&&T.asArray(y["@default"]).every(A=>j.isString(A)))return}throw new Q('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,S)=>{if(y.hasOwnProperty(S)){const A=y[S];return!j.isArray(A)||A.length>0}return!1},T.hasValue=(y,S,A)=>{if(T.hasProperty(y,S)){let z=y[S];const P=W.isList(z);if(j.isArray(z)||P){P&&(z=z["@list"]);for(let X=0;X{if("propertyIsArray"in(z=z||{})||(z.propertyIsArray=!1),"valueIsArray"in z||(z.valueIsArray=!1),"allowDuplicate"in z||(z.allowDuplicate=!0),"prependValue"in z||(z.prependValue=!1),z.valueIsArray)y[S]=A;else if(j.isArray(A)){0===A.length&&z.propertyIsArray&&!y.hasOwnProperty(S)&&(y[S]=[]),z.prependValue&&(A=A.concat(y[S]),y[S]=[]);for(let P=0;P[].concat(y[S]||[]),T.removeProperty=(y,S)=>{delete y[S]},T.removeValue=(y,S,A,z)=>{"propertyIsArray"in(z=z||{})||(z.propertyIsArray=!1);const P=T.getValues(y,S).filter(X=>!T.compareValues(X,A));0===P.length?T.removeProperty(y,S):y[S]=1!==P.length||z.propertyIsArray?P:P[0]},T.relabelBlankNodes=(y,S)=>b((S=S||{}).issuer||new k("_:b"),y),T.compareValues=(y,S)=>!!(y===S||W.isValue(y)&&W.isValue(S)&&y["@value"]===S["@value"]&&y["@type"]===S["@type"]&&y["@language"]===S["@language"]&&y["@index"]===S["@index"])||!!(j.isObject(y)&&"@id"in y&&j.isObject(S)&&"@id"in S)&&y["@id"]===S["@id"],T.compareShortestLeast=(y,S)=>y.length1;const z=(K,E,$)=>{const Z=K[b].get(E);if(Z){const ae=Z.value;if(P(K,ae)){if(ue(K,Z),!K[H])return}else $&&(K[y]&&(Z.value.now=Date.now()),K[T].unshiftNode(Z));return ae.value}},P=(K,E)=>{if(!E||!E.maxAge&&!K[v])return!1;const $=Date.now()-E.now;return E.maxAge?$>E.maxAge:K[v]&&$>K[v]},X=K=>{if(K[k]>K[j])for(let E=K[T].tail;K[k]>K[j]&&null!==E;){const $=E.prev;ue(K,E),E=$}},ue=(K,E)=>{if(E){const $=E.value;K[C]&&K[C]($.key,$.value),K[k]-=$.length,K[b].delete($.key),K[T].removeNode(E)}};class I{constructor(E,$,Z,ae,oe){this.key=E,this.value=$,this.length=Z,this.now=ae,this.maxAge=oe||0}}const O=(K,E,$,Z)=>{let ae=$.value;P(K,ae)&&(ue(K,$),K[H]||(ae=void 0)),ae&&E.call(Z,ae.value,ae.key,K)};Se.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[j]=E.max||1/0;const Z=E.length||S;if(this[Q]="function"!=typeof Z?S:Z,this[H]=E.stale||!1,E.maxAge&&"number"!=typeof E.maxAge)throw new TypeError("maxAge must be a number");this[v]=E.maxAge||0,this[C]=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[j]=E||1/0,X(this)}get max(){return this[j]}set allowStale(E){this[H]=!!E}get allowStale(){return this[H]}set maxAge(E){if("number"!=typeof E)throw new TypeError("maxAge must be a non-negative number");this[v]=E,X(this)}get maxAge(){return this[v]}set lengthCalculator(E){"function"!=typeof E&&(E=S),E!==this[Q]&&(this[Q]=E,this[k]=0,this[T].forEach($=>{$.length=this[Q]($.value,$.key),this[k]+=$.length})),X(this)}get lengthCalculator(){return this[Q]}get length(){return this[k]}get itemCount(){return this[T].length}rforEach(E,$){$=$||this;for(let Z=this[T].tail;null!==Z;){const ae=Z.prev;O(this,E,Z,$),Z=ae}}forEach(E,$){$=$||this;for(let Z=this[T].head;null!==Z;){const ae=Z.next;O(this,E,Z,$),Z=ae}}keys(){return this[T].toArray().map(E=>E.key)}values(){return this[T].toArray().map(E=>E.value)}reset(){this[C]&&this[T]&&this[T].length&&this[T].forEach(E=>this[C](E.key,E.value)),this[b]=new Map,this[T]=new W,this[k]=0}dump(){return this[T].map(E=>!P(this,E)&&{k:E.key,v:E.value,e:E.now+(E.maxAge||0)}).toArray().filter(E=>E)}dumpLru(){return this[T]}set(E,$,Z){if((Z=Z||this[v])&&"number"!=typeof Z)throw new TypeError("maxAge must be a number");const ae=Z?Date.now():0,oe=this[Q]($,E);if(this[b].has(E)){if(oe>this[j])return ue(this,this[b].get(E)),!1;const me=this[b].get(E).value;return this[C]&&(this[R]||this[C](E,me.value)),me.now=ae,me.maxAge=Z,me.value=$,this[k]+=oe-me.length,me.length=oe,this.get(E),X(this),!0}const te=new I(E,$,oe,ae,Z);return te.length>this[j]?(this[C]&&this[C](E,$),!1):(this[k]+=te.length,this[T].unshift(te),this[b].set(E,this[T].head),X(this),!0)}has(E){if(!this[b].has(E))return!1;const $=this[b].get(E).value;return!P(this,$)}get(E){return z(this,E,!0)}peek(E){return z(this,E,!1)}pop(){const E=this[T].tail;return E?(ue(this,E),E.value):null}del(E){ue(this,this[b].get(E))}load(E){this.reset();const $=Date.now();for(let Z=E.length-1;Z>=0;Z--){const ae=E[Z],oe=ae.e||0;if(0===oe)this.set(ae.k,ae.v);else{const te=oe-$;te>0&&this.set(ae.k,ae.v,te)}}}prune(){this[b].forEach((E,$)=>z(this,$,!1))}}},{yallist:92}],34:[function(Y,Se,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#",j="http://www.w3.org/2001/XMLSchema#",k="http://www.w3.org/2000/10/swap/";he.default={xsd:{decimal:`${j}decimal`,boolean:`${j}boolean`,double:`${j}double`,integer:`${j}integer`,string:`${j}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:`${k}reify#forSome`,forAll:`${k}reify#forAll`},log:{implies:`${k}log#implies`}}},{}],35:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.default=he.Variable=he.Triple=he.Term=he.Quad=he.NamedNode=he.Literal=he.DefaultGraph=he.BlankNode=void 0,he.escapeQuotes=E,he.termFromId=function I(ne,ye){if(ye=ye||b,!ne)return ye.defaultGraph();switch(ne[0]){case"?":return ye.variable(ne.substr(1));case"_":return ye.blankNode(ne.substr(2));case'"':if(ye===b)return new z(ne);if('"'===ne[ne.length-1])return ye.literal(ne.substr(1,ne.length-2));const Oe=ne.lastIndexOf('"',ne.length-1);return ye.literal(ne.substr(1,Oe-1),"@"===ne[Oe+1]?ne.substr(Oe+2):ye.namedNode(ne.substr(Oe+3)));case"<":const $e=T.exec(ne);return ye.quad(I($($e[1]),ye),I($($e[2]),ye),I($($e[3]),ye),$e[4]&&I($($e[4]),ye));default:return ye.namedNode(ne)}},he.termToId=function O(ne){if("string"==typeof ne)return ne;if(ne instanceof S&&"Quad"!==ne.termType)return ne.id;if(!ne)return v.id;switch(ne.termType){case"NamedNode":return ne.value;case"BlankNode":return`_:${ne.value}`;case"Variable":return`?${ne.value}`;case"DefaultGraph":return"";case"Literal":return`"${ne.value}"${ne.language?`@${ne.language}`:ne.datatype&&ne.datatype.value!==H.string?`^^${ne.datatype.value}`:""}`;case"Quad":return`<<${E(O(ne.subject))} ${E(O(ne.predicate))} ${E(O(ne.object))}${(0,j.isDefaultGraph)(ne.graph)?"":` ${O(ne.graph)}`}>>`;default:throw new Error(`Unexpected termType: ${ne.termType}`)}},he.unescapeQuotes=$;var ne,W=(ne=Y("./IRIs"))&&ne.__esModule?ne:{default:ne},j=Y("./N3Util");const{rdf:Q,xsd:H}=W.default;let v,C=0;const R=/^"(.*".*)(?="[^"]*$)/,T=/^<<("(?:""|[^"])*"[^ ]*|[^ ]+) ("(?:""|[^"])*"[^ ]*|[^ ]+) ("(?:""|[^"])*"[^ ]*|[^ ]+) ?("(?:""|[^"])*"[^ ]*|[^ ]+)?>>$/,b={namedNode:function(ne){return new A(ne)},blankNode:function(ne){return new P(ne||"n3-"+C++)},variable:function(ne){return new X(ne)},literal:function(ne,ye){if("string"==typeof ye)return new z(`"${ne}"@${ye.toLowerCase()}`);let Oe=ye?ye.value:"";return""===Oe&&("boolean"==typeof ne?Oe=H.boolean:"number"==typeof ne&&(Number.isFinite(ne)?Oe=Number.isInteger(ne)?H.integer:H.double:(Oe=H.double,Number.isNaN(ne)||(ne=ne>0?"INF":"-INF")))),new z(""===Oe||Oe===H.string?`"${ne}"`:`"${ne}"^^${Oe}`)},defaultGraph:function(){return v},quad:me,triple:me};he.default=b;class S{constructor(ye){this.id=ye}get value(){return this.id}equals(ye){return ye instanceof S?this.id===ye.id:!!ye&&this.termType===ye.termType&&this.value===ye.value}hashCode(){return 0}toJSON(){return{termType:this.termType,value:this.value}}}he.Term=S;class A extends S{get termType(){return"NamedNode"}}he.NamedNode=A;class z extends S{get termType(){return"Literal"}get value(){return this.id.substring(1,this.id.lastIndexOf('"'))}get language(){const ye=this.id;let Oe=ye.lastIndexOf('"')+1;return Oe`"${Oe.replace(/"/g,'""')}`)}function $(ne){return ne.replace(R,(ye,Oe)=>`"${Oe.replace(/""/g,'"')}`)}function me(ne,ye,Oe,$e){return new K(ne,ye,Oe,$e)}he.Triple=he.Quad=K},{"./IRIs":34,"./N3Util":41}],36:[function(Y,Se,he){(function(W){(function(){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.default=void 0;var j=Q(Y("./IRIs")),k=Q(Y("queue-microtask"));function Q(S){return S&&S.__esModule?S:{default:S}}const{xsd:H}=j.default,v=/\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{8})|\\([^])/g,C={"\\":"\\","'":"'",'"':'"',n:"\n",r:"\r",t:"\t",f:"\f",b:"\b",_:"_","~":"~",".":".","-":"-","!":"!",$:"$","&":"&","(":"(",")":")","*":"*","+":"+",",":",",";":";","=":"=","/":"/","?":"?","#":"#","@":"@","%":"%"},R=/[\x00-\x20<>\\"\{\}\|\^\`]/,T={_iri:!0,_unescapedIri:!0,_simpleQuotedString:!0,_langcode:!0,_blank:!0,_newline:!0,_comment:!0,_whitespace:!0,_endOfFile:!0},b=/$0^/;he.default=class{constructor(A){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=!!(A=A||{}).lineMode){this._n3Mode=!1;for(const z in this)!(z in T)&&this[z]instanceof RegExp&&(this[z]=b)}else this._n3Mode=!1!==A.n3;this._comments=!!A.comments,this._literalClosingPos=0}_tokenizeToEnd(A,z){let P=this._input,X=P.length;for(;;){let O,K;for(;O=this._newline.exec(P);)this._comments&&(K=this._comment.exec(O[0]))&&ue("comment",K[1],"",this._line,O[0].length),P=P.substr(O[0].length,P.length),X=P.length,this._line++;if(!O&&(O=this._whitespace.exec(P))&&(P=P.substr(O[0].length,P.length)),this._endOfFile.test(P))return z&&(this._comments&&(K=this._comment.exec(P))&&ue("comment",K[1],"",this._line,P.length),P=null,ue("eof","","",this._line,0)),this._input=P;const E=this._line,$=P[0];let Z="",ae="",oe="",te=null,Te=0,me=!1;switch($){case"^":if(P.length<3)break;if("^"!==P[1]){this._n3Mode&&(Te=1,Z="^");break}if(this._previousMarker="^^",P=P.substr(2),"<"!==P[0]){me=!0;break}case"<":if(te=this._unescapedIri.exec(P))Z="IRI",ae=te[1];else if(te=this._iri.exec(P)){if(ae=this._unescape(te[1]),null===ae||R.test(ae))return I(this);Z="IRI"}else P.length>1&&"<"===P[1]?(Z="<<",Te=2):this._n3Mode&&P.length>1&&"="===P[1]&&(Z="inverse",Te=2,ae=">");break;case">":P.length>1&&">"===P[1]&&(Z=">>",Te=2);break;case"_":((te=this._blank.exec(P))||z&&(te=this._blank.exec(`${P} `)))&&(Z="blank",oe="_",ae=te[1]);break;case'"':if(te=this._simpleQuotedString.exec(P))ae=te[1];else if(({value:ae,matchLength:Te}=this._parseLiteral(P)),null===ae)return I(this);(null!==te||0!==Te)&&(Z="literal",this._literalClosingPos=0);break;case"'":if(!this._lineMode){if(te=this._simpleApostropheString.exec(P))ae=te[1];else if(({value:ae,matchLength:Te}=this._parseLiteral(P)),null===ae)return I(this);(null!==te||0!==Te)&&(Z="literal",this._literalClosingPos=0)}break;case"?":this._n3Mode&&(te=this._variable.exec(P))&&(Z="var",ae=te[0]);break;case"@":"literal"===this._previousMarker&&(te=this._langcode.exec(P))?(Z="langcode",ae=te[1]):(te=this._keyword.exec(P))&&(Z=te[0]);break;case".":if(1===P.length?z:P[1]<"0"||P[1]>"9"){Z=".",Te=1;break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"+":case"-":(te=this._number.exec(P)||z&&(te=this._number.exec(`${P} `)))&&(Z="literal",ae=te[0],oe="string"==typeof te[1]?H.double:"string"==typeof te[2]?H.decimal:H.integer);break;case"B":case"b":case"p":case"P":case"G":case"g":(te=this._sparqlKeyword.exec(P))?Z=te[0].toUpperCase():me=!0;break;case"f":case"t":(te=this._boolean.exec(P))?(Z="literal",ae=te[0],oe=H.boolean):me=!0;break;case"a":(te=this._shortPredicates.exec(P))?(Z="abbreviation",ae="a"):me=!0;break;case"=":this._n3Mode&&P.length>1&&(Z="abbreviation",">"!==P[1]?(Te=1,ae="="):(Te=2,ae=">"));break;case"!":if(!this._n3Mode)break;case",":case";":case"[":case"]":case"(":case")":case"{":case"}":this._lineMode||(Te=1,Z=$);break;default:me=!0}if(me&&("@prefix"!==this._previousMarker&&"PREFIX"!==this._previousMarker||!(te=this._prefix.exec(P))?((te=this._prefixed.exec(P))||z&&(te=this._prefixed.exec(`${P} `)))&&(Z="prefixed",oe=te[1]||"",ae=this._unescape(te[2])):(Z="prefix",ae=te[1]||"")),"^^"===this._previousMarker)switch(Z){case"prefixed":Z="type";break;case"IRI":Z="typeIRI";break;default:Z=""}if(!Z)return z||!/^'''|^"""/.test(P)&&/\n|\r/.test(P)?I(this):this._input=P;const ne=Te||te[0].length,ye=ue(Z,ae,oe,E,ne);this.previousToken=ye,this._previousMarker=Z,P=P.substr(ne,P.length)}function ue(O,K,E,$,Z){const ae=P?X-P.length:X,te={type:O,value:K,prefix:E,line:$,start:ae,end:ae+Z};return A(null,te),te}function I(O){A(O._syntaxError(/^\S*/.exec(P)[0]))}}_unescape(A){let z=!1;const P=A.replace(v,(X,ue,I,O)=>{if("string"==typeof ue)return String.fromCharCode(Number.parseInt(ue,16));if("string"==typeof I){let K=Number.parseInt(I,16);return K<=65535?String.fromCharCode(Number.parseInt(I,16)):String.fromCharCode(55296+((K-=65536)>>10),56320+(1023&K))}return O in C?C[O]:(z=!0,"")});return z?null:P}_parseLiteral(A){if(A.length>=3){const z=A.match(/^(?:"""|"|'''|'|)/)[0],P=z.length;let X=Math.max(this._literalClosingPos,P);for(;(X=A.indexOf(z,X))>0;){let ue=0;for(;"\\"===A[X-ue-1];)ue++;if(ue%2==0){const I=A.substring(P,X),O=I.split(/\r\n|\r|\n/).length-1,K=X+P;if(1===P&&0!==O||3===P&&this._lineMode)break;return this._line+=O,{value:this._unescape(I),matchLength:K}}X++}this._literalClosingPos=A.length-P+1}return{value:"",matchLength:0}}_syntaxError(A){this._input=null;const z=new Error(`Unexpected "${A}" on line ${this._line}.`);return z.context={token:void 0,line:this._line,previousToken:this.previousToken},z}_readStartingBom(A){return A.startsWith("\ufeff")?A.substr(1):A}tokenize(A,z){if(this._line=1,"string"==typeof A){if(this._input=this._readStartingBom(A),"function"!=typeof z){const P=[];let X;if(this._tokenizeToEnd((ue,I)=>ue?X=ue:P.push(I),!0),X)throw X;return P}(0,k.default)(()=>this._tokenizeToEnd(z,!0))}else this._pendingBuffer=null,"function"==typeof A.setEncoding&&A.setEncoding("utf8"),A.on("data",P=>{null!==this._input&&0!==P.length&&(this._pendingBuffer&&(P=W.concat([this._pendingBuffer,P]),this._pendingBuffer=null),128&P[P.length-1]?this._pendingBuffer=P:(void 0===this._input?this._input=this._readStartingBom("string"==typeof P?P:P.toString()):this._input+=P,this._tokenizeToEnd(z,!1)))}),A.on("end",()=>{"string"==typeof this._input&&this._tokenizeToEnd(z,!0)}),A.on("error",z)}}}).call(this)}).call(this,Y("buffer").Buffer)},{"./IRIs":34,buffer:6,"queue-microtask":45}],37:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.default=void 0;var W=Q(Y("./N3Lexer")),j=Q(Y("./N3DataFactory")),k=Q(Y("./IRIs"));function Q(T){return T&&T.__esModule?T:{default:T}}let H=0;class v{constructor(b){this._contextStack=[],this._graph=null,this._setBase((b=b||{}).baseIRI),b.factory&&R(this,b.factory);const y="string"==typeof b.format?b.format.match(/\w*$/)[0].toLowerCase():"",S=/turtle/.test(y),A=/trig/.test(y),z=/triple/.test(y),P=/quad/.test(y),X=this._n3Mode=/n3/.test(y),ue=z||P;(this._supportsNamedGraphs=!(S||X))||(this._readPredicateOrNamedGraph=this._readPredicate),this._supportsQuads=!(S||A||z||X),this._supportsRDFStar=""===y||/star|\*$/.test(y),ue&&(this._resolveRelativeIRI=I=>null),this._blankNodePrefix="string"!=typeof b.blankNodePrefix?"":b.blankNodePrefix.replace(/^(?!_:)/,"_:"),this._lexer=b.lexer||new W.default({lineMode:ue,n3:X}),this._explicitQuantifiers=!!b.explicitQuantifiers}static _resetBlankNodePrefix(){H=0}_setBase(b){if(b){const y=b.indexOf("#");y>=0&&(b=b.substr(0,y)),this._base=b,this._basePath=b.indexOf("/")<0?b:b.replace(/[^\/?]*(?:\?.*)?$/,""),b=b.match(/^(?:([a-z][a-z0-9+.-]*:))?(?:\/\/[^\/]*)?/i),this._baseRoot=b[0],this._baseScheme=b[1]}else this._base="",this._basePath=""}_saveContext(b,y,S,A,z){const P=this._n3Mode;this._contextStack.push({subject:S,predicate:A,object:z,graph:y,type:b,inverse:!!P&&this._inversePredicate,blankPrefix:P?this._prefixes._:"",quantified:P?this._quantified:null}),P&&(this._inversePredicate=!1,this._prefixes._=this._graph?`${this._graph.id.substr(2)}.`:".",this._quantified=Object.create(this._quantified))}_restoreContext(){const b=this._contextStack.pop(),y=this._n3Mode;this._subject=b.subject,this._predicate=b.predicate,this._object=b.object,this._graph=b.graph,y&&(this._inversePredicate=b.inverse,this._prefixes._=b.blankPrefix,this._quantified=b.quantified)}_readInTopContext(b){switch(b.type){case"eof":return null!==this._graph?this._error("Unclosed graph",b):(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(b)}}_readEntity(b,y){let S;switch(b.type){case"IRI":case"typeIRI":const A=this._resolveIRI(b.value);if(null===A)return this._error("Invalid IRI",b);S=this._namedNode(A);break;case"type":case"prefixed":const z=this._prefixes[b.prefix];if(void 0===z)return this._error(`Undefined prefix "${b.prefix}:"`,b);S=this._namedNode(z+b.value);break;case"blank":S=this._blankNode(this._prefixes[b.prefix]+b.value);break;case"var":S=this._variable(b.value.substr(1));break;default:return this._error(`Expected entity but got ${b.type}`,b)}return!y&&this._n3Mode&&S.id in this._quantified&&(S=this._quantified[S.id]),S}_readSubject(b){switch(this._predicate=null,b.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",b);case"}":return this._readPunctuation(b);case"@forSome":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORSOME,this._quantifier=this._blankNode,this._readQuantifierList):this._error('Unexpected "@forSome"',b);case"@forAll":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORALL,this._quantifier=this._variable,this._readQuantifierList):this._error('Unexpected "@forAll"',b);case"literal":if(!this._n3Mode)return this._error("Unexpected literal",b);if(0===b.prefix.length)return this._literalValue=b.value,this._completeSubjectLiteral;this._subject=this._literal(b.value,this._namedNode(b.prefix));break;case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,null,null,null),this._graph=null,this._readSubject):this._error("Unexpected RDF* syntax",b);default:if(void 0===(this._subject=this._readEntity(b)))return;if(this._n3Mode)return this._getPathReader(this._readPredicateOrNamedGraph)}return this._readPredicateOrNamedGraph}_readPredicate(b){const y=b.type;switch(y){case"inverse":this._inversePredicate=!0;case"abbreviation":this._predicate=this.ABBREVIATIONS[b.value];break;case".":case"]":case"}":return null===this._predicate?this._error(`Unexpected ${y}`,b):(this._subject=null,"]"===y?this._readBlankNodeTail(b):this._readPunctuation(b));case";":return null!==this._predicate?this._readPredicate:this._error("Expected predicate but got ;",b);case"[":if(this._n3Mode)return this._saveContext("blank",this._graph,this._subject,this._subject=this._blankNode(),null),this._readBlankNodeHead;case"blank":if(!this._n3Mode)return this._error("Disallowed blank node as predicate",b);default:if(void 0===(this._predicate=this._readEntity(b)))return}return this._readObject}_readObject(b){switch(b.type){case"literal":if(0===b.prefix.length)return this._literalValue=b.value,this._readDataTypeOrLang;this._object=this._literal(b.value,this._namedNode(b.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",b);case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,this._subject,this._predicate,null),this._graph=null,this._readSubject):this._error("Unexpected RDF* syntax",b);default:if(void 0===(this._object=this._readEntity(b)))return;if(this._n3Mode)return this._getPathReader(this._getContextEndReader())}return this._getContextEndReader()}_readPredicateOrNamedGraph(b){return"{"===b.type?this._readGraph(b):this._readPredicate(b)}_readGraph(b){return"{"!==b.type?this._error(`Expected graph but got ${b.type}`,b):(this._graph=this._subject,this._subject=null,this._readSubject)}_readBlankNodeHead(b){return"]"===b.type?(this._subject=null,this._readBlankNodeTail(b)):(this._predicate=null,this._readPredicate(b))}_readBlankNodeTail(b){if("]"!==b.type)return this._readBlankNodePunctuation(b);null!==this._subject&&this._emit(this._subject,this._predicate,this._object,this._graph);const y=null===this._predicate;return this._restoreContext(),null!==this._object?this._getContextEndReader():null!==this._predicate?this._readObject:y?this._readPredicateOrNamedGraph:this._readPredicateAfterBlank}_readPredicateAfterBlank(b){switch(b.type){case".":case"}":return this._subject=null,this._readPunctuation(b);default:return this._readPredicate(b)}}_readListItem(b){let y=null,S=null,A=this._readListItem;const z=this._subject,P=this._contextStack,X=P[P.length-1];switch(b.type){case"[":this._saveContext("blank",this._graph,S=this._blankNode(),this.RDF_FIRST,this._subject=y=this._blankNode()),A=this._readBlankNodeHead;break;case"(":this._saveContext("list",this._graph,S=this._blankNode(),this.RDF_FIRST,this.RDF_NIL),this._subject=null;break;case")":if(this._restoreContext(),0!==P.length&&"list"===P[P.length-1].type&&this._emit(this._subject,this._predicate,this._object,this._graph),null===this._predicate){if(A=this._readPredicate,this._subject===this.RDF_NIL)return A}else if(A=this._getContextEndReader(),this._object===this.RDF_NIL)return A;S=this.RDF_NIL;break;case"literal":0===b.prefix.length?(this._literalValue=b.value,A=this._readListItemDataTypeOrLang):(y=this._literal(b.value,this._namedNode(b.prefix)),A=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",b);default:if(void 0===(y=this._readEntity(b)))return}if(null===S&&(this._subject=S=this._blankNode()),null===z?null===X.predicate?X.subject=S:X.object=S:this._emit(z,this.RDF_REST,S,this._graph),null!==y){if(this._n3Mode&&("IRI"===b.type||"prefixed"===b.type))return this._saveContext("item",this._graph,S,this.RDF_FIRST,y),this._subject=y,this._predicate=null,this._getPathReader(this._readListItem);this._emit(S,this.RDF_FIRST,y,this._graph)}return A}_readDataTypeOrLang(b){return this._completeObjectLiteral(b,!1)}_readListItemDataTypeOrLang(b){return this._completeObjectLiteral(b,!0)}_completeLiteral(b){let y=this._literal(this._literalValue);switch(b.type){case"type":case"typeIRI":const S=this._readEntity(b);if(void 0===S)return;y=this._literal(this._literalValue,S),b=null;break;case"langcode":y=this._literal(this._literalValue,b.value),b=null}return{token:b,literal:y}}_completeSubjectLiteral(b){return this._subject=this._completeLiteral(b).literal,this._readPredicateOrNamedGraph}_completeObjectLiteral(b,y){const S=this._completeLiteral(b);if(S)return this._object=S.literal,y&&this._emit(this._subject,this.RDF_FIRST,this._object,this._graph),null===S.token?this._getContextEndReader():(this._readCallback=this._getContextEndReader(),this._readCallback(S.token))}_readFormulaTail(b){return"}"!==b.type?this._readPunctuation(b):(null!==this._subject&&this._emit(this._subject,this._predicate,this._object,this._graph),this._restoreContext(),null===this._object?this._readPredicate:this._getContextEndReader())}_readPunctuation(b){let y,S=this._graph;const A=this._subject,z=this._inversePredicate;switch(b.type){case"}":if(null===this._graph)return this._error("Unexpected graph closing",b);if(this._n3Mode)return this._readFormulaTail(b);this._graph=null;case".":this._subject=null,y=this._contextStack.length?this._readSubject:this._readInTopContext,z&&(this._inversePredicate=!1);break;case";":y=this._readPredicate;break;case",":y=this._readObject;break;default:if(this._supportsQuads&&null===this._graph&&void 0!==(S=this._readEntity(b))){y=this._readQuadPunctuation;break}return this._error(`Expected punctuation to follow "${this._object.id}"`,b)}if(null!==A){const P=this._predicate,X=this._object;z?this._emit(X,P,A,S):this._emit(A,P,X,S)}return y}_readBlankNodePunctuation(b){let y;switch(b.type){case";":y=this._readPredicate;break;case",":y=this._readObject;break;default:return this._error(`Expected punctuation to follow "${this._object.id}"`,b)}return this._emit(this._subject,this._predicate,this._object,this._graph),y}_readQuadPunctuation(b){return"."!==b.type?this._error("Expected dot to follow quad",b):this._readInTopContext}_readPrefix(b){return"prefix"!==b.type?this._error("Expected prefix to follow @prefix",b):(this._prefix=b.value,this._readPrefixIRI)}_readPrefixIRI(b){if("IRI"!==b.type)return this._error(`Expected IRI to follow prefix "${this._prefix}:"`,b);const y=this._readEntity(b);return this._prefixes[this._prefix]=y.value,this._prefixCallback(this._prefix,y),this._readDeclarationPunctuation}_readBaseIRI(b){const y="IRI"===b.type&&this._resolveIRI(b.value);return y?(this._setBase(y),this._readDeclarationPunctuation):this._error("Expected valid IRI to follow base declaration",b)}_readNamedGraphLabel(b){switch(b.type){case"IRI":case"blank":case"prefixed":return this._readSubject(b),this._readGraph;case"[":return this._readNamedGraphBlankLabel;default:return this._error("Invalid graph label",b)}}_readNamedGraphBlankLabel(b){return"]"!==b.type?this._error("Invalid graph label",b):(this._subject=this._blankNode(),this._readGraph)}_readDeclarationPunctuation(b){return this._sparqlStyle?(this._sparqlStyle=!1,this._readInTopContext(b)):"."!==b.type?this._error("Expected declaration to end with a dot",b):this._readInTopContext}_readQuantifierList(b){let y;switch(b.type){case"IRI":case"prefixed":if(void 0!==(y=this._readEntity(b,!0)))break;default:return this._error(`Unexpected ${b.type}`,b)}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(b){return","===b.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(b))}_getPathReader(b){return this._afterPath=b,this._readPath}_readPath(b){switch(b.type){case"!":return this._readForwardPath;case"^":return this._readBackwardPath;default:const y=this._contextStack,S=y.length&&y[y.length-1];if(S&&"item"===S.type){const A=this._subject;this._restoreContext(),this._emit(this._subject,this.RDF_FIRST,A,this._graph)}return this._afterPath(b)}}_readForwardPath(b){let y,S;const A=this._blankNode();if(void 0!==(S=this._readEntity(b)))return null===this._predicate?(y=this._subject,this._subject=A):(y=this._object,this._object=A),this._emit(y,S,A,this._graph),this._readPath}_readBackwardPath(b){const y=this._blankNode();let S,A;if(void 0!==(S=this._readEntity(b)))return null===this._predicate?(A=this._subject,this._subject=y):(A=this._object,this._object=y),this._emit(y,S,A,this._graph),this._readPath}_readRDFStarTailOrGraph(b){return">>"!==b.type?this._supportsQuads&&null===this._graph&&void 0!==(this._graph=this._readEntity(b))?this._readRDFStarTail:this._error(`Expected >> to follow "${this._object.id}"`,b):this._readRDFStarTail(b)}_readRDFStarTail(b){if(">>"!==b.type)return this._error(`Expected >> but got ${b.type}`,b);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 b=this._contextStack;if(!b.length)return this._readPunctuation;switch(b[b.length-1].type){case"blank":return this._readBlankNodeTail;case"list":return this._readListItem;case"formula":return this._readFormulaTail;case"<<":return this._readRDFStarTailOrGraph}}_emit(b,y,S,A){this._callback(null,this._quad(b,y,S,A||this.DEFAULTGRAPH))}_error(b,y){const S=new Error(`${b} on line ${y.line}.`);S.context={token:y,line:y.line,previousToken:this._lexer.previousToken},this._callback(S),this._callback=C}_resolveIRI(b){return/^[a-z][a-z0-9+.-]*:/i.test(b)?b:this._resolveRelativeIRI(b)}_resolveRelativeIRI(b){if(!b.length)return this._base;switch(b[0]){case"#":return this._base+b;case"?":return this._base.replace(/(?:\?.*)?$/,b);case"/":return("/"===b[1]?this._baseScheme:this._baseRoot)+this._removeDotSegments(b);default:return/^[^/:]*:/.test(b)?null:this._removeDotSegments(this._basePath+b)}}_removeDotSegments(b){if(!/(^|\/)\.\.?($|[/#?])/.test(b))return b;const y=b.length;let S="",A=-1,z=-1,P=0,X="/";for(;A=z&&(S=S.substr(0,P)),"/"!==X)return`${S}/${b.substr(A+1)}`;P=A+1}}}X=b[++A]}return S+b.substring(P)}parse(b,y,S){if(this._readCallback=this._readInTopContext,this._sparqlStyle=!1,this._prefixes=Object.create(null),this._prefixes._=this._blankNodePrefix?this._blankNodePrefix.substr(2):`b${H++}_`,this._prefixCallback=S||C,this._inversePredicate=!1,this._quantified=Object.create(null),!y){const A=[];let z;if(this._callback=(P,X)=>{P?z=P:X&&A.push(X)},this._lexer.tokenize(b).every(P=>this._readCallback=this._readCallback(P)),z)throw z;return A}this._callback=y,this._lexer.tokenize(b,(A,z)=>{null!==A?(this._callback(A),this._callback=C):this._readCallback&&(this._readCallback=this._readCallback(z))})}}function C(){}function R(T,b){const y=b.namedNode;T._namedNode=y,T._blankNode=b.blankNode,T._literal=b.literal,T._variable=b.variable,T._quad=b.quad,T.DEFAULTGRAPH=b.defaultGraph(),T.RDF_FIRST=y(k.default.rdf.first),T.RDF_REST=y(k.default.rdf.rest),T.RDF_NIL=y(k.default.rdf.nil),T.N3_FORALL=y(k.default.r.forAll),T.N3_FORSOME=y(k.default.r.forSome),T.ABBREVIATIONS={a:y(k.default.rdf.type),"=":y(k.default.owl.sameAs),">":y(k.default.log.implies)},T.QUANTIFIERS_GRAPH=y("urn:n3:quantifiers")}he.default=v,R(v.prototype,j.default)},{"./IRIs":34,"./N3DataFactory":35,"./N3Lexer":36}],38:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.default=void 0;var b,W=function(b,y){if(!y&&b&&b.__esModule)return b;if(null===b||"object"!=typeof b&&"function"!=typeof b)return{default:b};var S=H(y);if(S&&S.has(b))return S.get(b);var A={},z=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var P in b)if("default"!==P&&Object.prototype.hasOwnProperty.call(b,P)){var X=z?Object.getOwnPropertyDescriptor(b,P):null;X&&(X.get||X.set)?Object.defineProperty(A,P,X):A[P]=b[P]}return A.default=b,S&&S.set(b,A),A}(Y("./N3DataFactory")),j=Y("readable-stream"),k=(b=Y("./IRIs"))&&b.__esModule?b:{default:b};function H(b){if("function"!=typeof WeakMap)return null;var y=new WeakMap,S=new WeakMap;return(H=function(A){return A?S:y})(b)}class C{constructor(y,S){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,!S&&y&&!y[0]&&(S=y,y=null),this._factory=(S=S||{}).factory||W.default,y&&this.addQuads(y)}get size(){let y=this._size;if(null!==y)return y;y=0;const S=this._graphs;let A,z;for(const P in S)for(const X in A=S[P].subjects)for(const ue in z=A[X])y+=Object.keys(z[ue]).length;return this._size=y}_addToIndex(y,S,A,z){const P=y[S]||(y[S]={}),X=P[A]||(P[A]={}),ue=z in X;return ue||(X[z]=null),!ue}_removeFromIndex(y,S,A,z){const P=y[S],X=P[A];delete X[z];for(const ue in X)return;delete P[A];for(const ue in P)return;delete y[S]}*_findInIndex(y,S,A,z,P,X,ue,I){let O,K,E;const Z=!S+!A+!z>1?Object.keys(this._ids):this._entities,ae=(0,W.termFromId)(I,this._factory);S&&((O=y,y={})[S]=O[S]);for(const oe in y){const te=Z[oe];if(K=y[oe]){A&&((O=K,K={})[A]=O[A]);for(const Te in K){const me=Z[Te];if(E=K[Te]){const ne=z?z in E?[z]:[]:Object.keys(E);for(let ye=0;ye{A in S||(S[A]=!0,y((0,W.termFromId)(this._entities[A],this._factory)))}}add(y){return this.addQuad(y),this}addQuad(y,S,A,z){S||(z=y.graph,A=y.object,S=y.predicate,y=y.subject),y=(0,W.termToId)(y),S=(0,W.termToId)(S),A=(0,W.termToId)(A),z=(0,W.termToId)(z);let P=this._graphs[z];P||(P=this._graphs[z]={subjects:{},predicates:{},objects:{}},Object.freeze(P));const X=this._ids,ue=this._entities;y=X[y]||(X[ue[++this._id]=y]=this._id),S=X[S]||(X[ue[++this._id]=S]=this._id),A=X[A]||(X[ue[++this._id]=A]=this._id);const I=this._addToIndex(P.subjects,y,S,A);return this._addToIndex(P.predicates,S,A,y),this._addToIndex(P.objects,A,y,S),this._size=null,I}addQuads(y){for(let S=0;S{this.addQuad(S)}),y}removeQuad(y,S,A,z){S||(z=y.graph,A=y.object,S=y.predicate,y=y.subject),y=(0,W.termToId)(y),S=(0,W.termToId)(S),A=(0,W.termToId)(A),z=(0,W.termToId)(z);const P=this._ids,X=this._graphs;let ue,I,O;if(!((y=P[y])&&(S=P[S])&&(A=P[A])&&(ue=X[z])&&(I=ue.subjects[y])&&(O=I[S])&&A in O))return!1;for(y in this._removeFromIndex(ue.subjects,y,S,A),this._removeFromIndex(ue.predicates,S,A,y),this._removeFromIndex(ue.objects,A,y,S),null!==this._size&&this._size--,ue.subjects)return!0;return delete X[z],!0}removeQuads(y){for(let S=0;S{this.removeQuad(S)}),y}removeMatches(y,S,A,z){const P=new j.Readable({objectMode:!0});return P._read=()=>{for(const X of this.readQuads(y,S,A,z))P.push(X);P.push(null)},this.remove(P)}deleteGraph(y){return this.removeMatches(null,null,null,y)}getQuads(y,S,A,z){return[...this.readQuads(y,S,A,z)]}*readQuads(y,S,A,z){y=y&&(0,W.termToId)(y),S=S&&(0,W.termToId)(S),A=A&&(0,W.termToId)(A),z=z&&(0,W.termToId)(z);const P=this._getGraphs(z),X=this._ids;let ue,I,O,K;if(!(R(y)&&!(I=X[y])||R(S)&&!(O=X[S])||R(A)&&!(K=X[A])))for(const E in P)(ue=P[E])&&(I?K?yield*this._findInIndex(ue.objects,K,I,O,"object","subject","predicate",E,null,!0):yield*this._findInIndex(ue.subjects,I,O,null,"subject","predicate","object",E,null,!0):O?yield*this._findInIndex(ue.predicates,O,K,null,"predicate","object","subject",E,null,!0):K?yield*this._findInIndex(ue.objects,K,null,null,"object","subject","predicate",E,null,!0):yield*this._findInIndex(ue.subjects,null,null,null,"subject","predicate","object",E,null,!0))}match(y,S,A,z){return new T(this,y,S,A,z)}countQuads(y,S,A,z){y=y&&(0,W.termToId)(y),S=S&&(0,W.termToId)(S),A=A&&(0,W.termToId)(A),z=z&&(0,W.termToId)(z);const P=this._getGraphs(z),X=this._ids;let I,O,K,E,ue=0;if(R(y)&&!(O=X[y])||R(S)&&!(K=X[S])||R(A)&&!(E=X[A]))return 0;for(const $ in P)(I=P[$])&&(ue+=y?A?this._countInIndex(I.objects,E,O,K):this._countInIndex(I.subjects,O,K,E):S?this._countInIndex(I.predicates,K,E,O):this._countInIndex(I.objects,E,O,K));return ue}forEach(y,S,A,z,P){this.some(X=>(y(X),!1),S,A,z,P)}every(y,S,A,z,P){let X=!1;const ue=!this.some(I=>(X=!0,!y(I)),S,A,z,P);return X&&ue}some(y,S,A,z,P){for(const X of this.readQuads(S,A,z,P))if(y(X))return!0;return!1}getSubjects(y,S,A){const z=[];return this.forSubjects(P=>{z.push(P)},y,S,A),z}forSubjects(y,S,A,z){S=S&&(0,W.termToId)(S),A=A&&(0,W.termToId)(A),z=z&&(0,W.termToId)(z);const P=this._ids,X=this._getGraphs(z);let ue,I,O;if(y=this._uniqueEntities(y),!(R(S)&&!(I=P[S])||R(A)&&!(O=P[A])))for(z in X)(ue=X[z])&&(I?O?this._loopBy2Keys(ue.predicates,I,O,y):this._loopByKey1(ue.subjects,I,y):O?this._loopByKey0(ue.objects,O,y):this._loop(ue.subjects,y))}getPredicates(y,S,A){const z=[];return this.forPredicates(P=>{z.push(P)},y,S,A),z}forPredicates(y,S,A,z){S=S&&(0,W.termToId)(S),A=A&&(0,W.termToId)(A),z=z&&(0,W.termToId)(z);const P=this._ids,X=this._getGraphs(z);let ue,I,O;if(y=this._uniqueEntities(y),!(R(S)&&!(I=P[S])||R(A)&&!(O=P[A])))for(z in X)(ue=X[z])&&(I?O?this._loopBy2Keys(ue.objects,O,I,y):this._loopByKey0(ue.subjects,I,y):O?this._loopByKey1(ue.predicates,O,y):this._loop(ue.predicates,y))}getObjects(y,S,A){const z=[];return this.forObjects(P=>{z.push(P)},y,S,A),z}forObjects(y,S,A,z){S=S&&(0,W.termToId)(S),A=A&&(0,W.termToId)(A),z=z&&(0,W.termToId)(z);const P=this._ids,X=this._getGraphs(z);let ue,I,O;if(y=this._uniqueEntities(y),!(R(S)&&!(I=P[S])||R(A)&&!(O=P[A])))for(z in X)(ue=X[z])&&(I?O?this._loopBy2Keys(ue.subjects,I,O,y):this._loopByKey1(ue.objects,I,y):O?this._loopByKey0(ue.predicates,O,y):this._loop(ue.objects,y))}getGraphs(y,S,A){const z=[];return this.forGraphs(P=>{z.push(P)},y,S,A),z}forGraphs(y,S,A,z){for(const P in this._graphs)this.some(X=>(y(X.graph),!0),S,A,z,P)}createBlankNode(y){let S,A;if(y)for(S=y=`_:${y}`,A=1;this._ids[S];)S=y+A++;else do{S="_:b"+this._blankNodeIndex++}while(this._ids[S]);return this._ids[S]=++this._id,this._entities[this._id]=S,this._factory.blankNode(S.substr(2))}extractLists({remove:y=!1,ignoreErrors:S=!1}={}){const A={},z=S?()=>!0:(ue,I)=>{throw new Error(`${ue.value} ${I}`)},P=this.getQuads(null,k.default.rdf.rest,k.default.rdf.nil,null),X=y?[...P]:[];return P.forEach(ue=>{const I=[];let K,E,O=!1;const $=ue.graph;let Z=ue.subject;for(;Z&&!O;){const ae=this.getQuads(null,null,Z,null),oe=this.getQuads(Z,null,null,null);let te,Te=null,me=null,ne=null;for(let ye=0;ye{switch(b){case"data":R=y;break;case"end":T=y}}},(b,y)=>{b&&this.emit("error",b)||y&&this.push(y)},(b,y)=>{this.emit("prefix",b,y)}),this._transform=(b,y,S)=>{R(b),S()},this._flush=b=>{T(),b()}}import(v){return v.on("data",C=>{this.write(C)}),v.on("end",()=>{this.end()}),v.on("error",C=>{this.emit("error",C)}),this}}},{"./N3Parser":37,"readable-stream":81}],40:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.default=void 0;var H,W=Y("readable-stream"),j=(H=Y("./N3Writer"))&&H.__esModule?H:{default:H};he.default=class extends W.Transform{constructor(v){super({encoding:"utf8",writableObjectMode:!0});const C=this._writer=new j.default({write:(R,T,b)=>{this.push(R),b&&b()},end:R=>{this.push(null),R&&R()}},v);this._transform=(R,T,b)=>{C.addQuad(R,b)},this._flush=R=>{C.end(R)}}import(v){return v.on("data",C=>{this.write(C)}),v.on("end",()=>{this.end()}),v.on("error",C=>{this.emit("error",C)}),v.on("prefix",(C,R)=>{this._writer.addPrefix(C,R)}),this}}},{"./N3Writer":42,"readable-stream":81}],41:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.inDefaultGraph=function(y){return C(y.graph)},he.isBlankNode=function(y){return!!y&&"BlankNode"===y.termType},he.isDefaultGraph=C,he.isLiteral=function(y){return!!y&&"Literal"===y.termType},he.isNamedNode=function(y){return!!y&&"NamedNode"===y.termType},he.isVariable=function(y){return!!y&&"Variable"===y.termType},he.prefix=function(y,S){return b({"":y.value||y},S)("")},he.prefixes=b;var y,W=(y=Y("./N3DataFactory"))&&y.__esModule?y:{default:y};function C(y){return!!y&&"DefaultGraph"===y.termType}function b(y,S){const A=Object.create(null);for(const P in y)z(P,y[P]);function z(P,X){if("string"==typeof X){const ue=Object.create(null);A[P]=I=>ue[I]||(ue[I]=S.namedNode(X+I))}else if(!(P in A))throw new Error(`Unknown prefix: ${P}`);return A[P]}return S=S||W.default,z}},{"./N3DataFactory":35}],42:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.default=void 0;var ue,W=(ue=Y("./IRIs"))&&ue.__esModule?ue:{default:ue},j=function(ue,I){if(!I&&ue&&ue.__esModule)return ue;if(null===ue||"object"!=typeof ue&&"function"!=typeof ue)return{default:ue};var O=Q(I);if(O&&O.has(ue))return O.get(ue);var K={},E=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var $ in ue)if("default"!==$&&Object.prototype.hasOwnProperty.call(ue,$)){var Z=E?Object.getOwnPropertyDescriptor(ue,$):null;Z&&(Z.get||Z.set)?Object.defineProperty(K,$,Z):K[$]=ue[$]}return K.default=ue,O&&O.set(ue,K),K}(Y("./N3DataFactory")),k=Y("./N3Util");function Q(ue){if("function"!=typeof WeakMap)return null;var I=new WeakMap,O=new WeakMap;return(Q=function(K){return K?O:I})(ue)}const C=j.default.defaultGraph(),{rdf:R,xsd:T}=W.default,b=/["\\\t\n\r\b\f\u0000-\u0019\ud800-\udbff]/,y=/["\\\t\n\r\b\f\u0000-\u0019]|[\ud800-\udbff][\udc00-\udfff]/g,S={"\\":"\\\\",'"':'\\"',"\t":"\\t","\n":"\\n","\r":"\\r","\b":"\\b","\f":"\\f"};class A extends j.Term{equals(){return!1}}function P(ue){let I=S[ue];return void 0===I&&(1===ue.length?(I=ue.charCodeAt(0).toString(16),I="\\u0000".substr(0,6-I.length)+I):(I=(1024*(ue.charCodeAt(0)-55296)+ue.charCodeAt(1)+9216).toString(16),I="\\U00000000".substr(0,10-I.length)+I)),I}function X(ue){return ue.replace(/[\]\/\(\)\*\+\?\.\\\$]/g,"\\$&")}he.default=class{constructor(I,O){if(this._prefixRegex=/$0^/,I&&"function"!=typeof I.write&&(O=I,I=null),this._lists=(O=O||{}).lists,I)this._outputStream=I,this._endStream=void 0===O.end||!!O.end;else{let K="";this._outputStream={write(E,$,Z){K+=E,Z&&Z()},end:E=>{E&&E(null,K)}},this._endStream=!0}this._subject=null,/triple|quad/i.test(O.format)?(this._lineMode=!0,this._writeQuad=this._writeQuadLine):(this._lineMode=!1,this._graph=C,this._prefixIRIs=Object.create(null),O.prefixes&&this.addPrefixes(O.prefixes),O.baseIRI&&(this._baseMatcher=new RegExp(`^${X(O.baseIRI)}${O.baseIRI.endsWith("/")?"":"[#?]"}`),this._baseLength=O.baseIRI.length))}get _inDefaultGraph(){return C.equals(this._graph)}_write(I,O){this._outputStream.write(I,"utf8",O)}_writeQuad(I,O,K,E,$){try{E.equals(this._graph)||(this._write((null===this._subject?"":this._inDefaultGraph?".\n":"\n}\n")+(C.equals(E)?"":`${this._encodeIriOrBlank(E)} {\n`)),this._graph=E,this._subject=null),I.equals(this._subject)?O.equals(this._predicate)?this._write(`, ${this._encodeObject(K)}`,$):this._write(`;\n ${this._encodePredicate(this._predicate=O)} ${this._encodeObject(K)}`,$):this._write(`${(null===this._subject?"":".\n")+this._encodeSubject(this._subject=I)} ${this._encodePredicate(this._predicate=O)} ${this._encodeObject(K)}`,$)}catch(Z){$&&$(Z)}}_writeQuadLine(I,O,K,E,$){delete this._prefixMatch,this._write(this.quadToString(I,O,K,E),$)}quadToString(I,O,K,E){return`${this._encodeSubject(I)} ${this._encodeIriOrBlank(O)} ${this._encodeObject(K)}${E&&E.value?` ${this._encodeIriOrBlank(E)} .\n`:" .\n"}`}quadsToString(I){return I.map(O=>this.quadToString(O.subject,O.predicate,O.object,O.graph)).join("")}_encodeSubject(I){return"Quad"===I.termType?this._encodeQuad(I):this._encodeIriOrBlank(I)}_encodeIriOrBlank(I){if("NamedNode"!==I.termType)return this._lists&&I.value in this._lists&&(I=this.list(this._lists[I.value])),"id"in I?I.id:`_:${I.value}`;let O=I.value;this._baseMatcher&&this._baseMatcher.test(O)&&(O=O.substr(this._baseLength)),b.test(O)&&(O=O.replace(y,P));const K=this._prefixRegex.exec(O);return K?K[1]?this._prefixIRIs[K[1]]+K[2]:O:`<${O}>`}_encodeLiteral(I){let O=I.value;if(b.test(O)&&(O=O.replace(y,P)),I.language)return`"${O}"@${I.language}`;if(this._lineMode){if(I.datatype.value===T.string)return`"${O}"`}else switch(I.datatype.value){case T.string:return`"${O}"`;case T.boolean:if("true"===O||"false"===O)return O;break;case T.integer:if(/^[+-]?\d+$/.test(O))return O;break;case T.decimal:if(/^[+-]?\d*\.\d+$/.test(O))return O;break;case T.double:if(/^[+-]?(?:\d+\.\d*|\.?\d+)[eE][+-]?\d+$/.test(O))return O}return`"${O}"^^${this._encodeIriOrBlank(I.datatype)}`}_encodePredicate(I){return I.value===R.type?"a":this._encodeIriOrBlank(I)}_encodeObject(I){switch(I.termType){case"Quad":return this._encodeQuad(I);case"Literal":return this._encodeLiteral(I);default:return this._encodeIriOrBlank(I)}}_encodeQuad({subject:I,predicate:O,object:K,graph:E}){return`<<${this._encodeSubject(I)} ${this._encodePredicate(O)} ${this._encodeObject(K)}${(0,k.isDefaultGraph)(E)?"":` ${this._encodeIriOrBlank(E)}`}>>`}_blockedWrite(){throw new Error("Cannot write because the writer has been closed.")}addQuad(I,O,K,E,$){void 0===K?this._writeQuad(I.subject,I.predicate,I.object,I.graph,O):"function"==typeof E?this._writeQuad(I,O,K,C,E):this._writeQuad(I,O,K,E||C,$)}addQuads(I){for(let O=0;O.\n`)}if(K){let E="",$="";for(const Z in this._prefixIRIs)E+=E?`|${Z}`:Z,$+=($?"|":"")+this._prefixIRIs[Z];E=X(E),this._prefixRegex=new RegExp(`^(?:${$})[^/]*$|^(${E})([a-zA-Z][\\-_a-zA-Z0-9]*)$`)}this._write(K?"\n":"",O)}blank(I,O){let E,$,K=I;switch(void 0===I?K=[]:I.termType?K=[{predicate:I,object:O}]:"length"in I||(K=[I]),$=K.length){case 0:return new A("[]");case 1:if(E=K[0],!(E.object instanceof A))return new A(`[ ${this._encodePredicate(E.predicate)} ${this._encodeObject(E.object)} ]`);default:let Z="[";for(let ae=0;ae<$;ae++)E=K[ae],E.predicate.equals(I)?Z+=`, ${this._encodeObject(E.object)}`:(Z+=`${(ae?";\n ":"\n ")+this._encodePredicate(E.predicate)} ${this._encodeObject(E.object)}`,I=E.predicate);return new A(`${Z}\n]`)}}list(I){const O=I&&I.length||0,K=new Array(O);for(let E=0;E{O=null,I(K,E)});if(this._endStream)try{return this._outputStream.end(O)}catch(K){}O&&O()}}},{"./IRIs":34,"./N3DataFactory":35,"./N3Util":41}],43:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),Object.defineProperty(he,"BlankNode",{enumerable:!0,get:function(){return R.BlankNode}}),Object.defineProperty(he,"DataFactory",{enumerable:!0,get:function(){return R.default}}),Object.defineProperty(he,"DefaultGraph",{enumerable:!0,get:function(){return R.DefaultGraph}}),Object.defineProperty(he,"Lexer",{enumerable:!0,get:function(){return W.default}}),Object.defineProperty(he,"Literal",{enumerable:!0,get:function(){return R.Literal}}),Object.defineProperty(he,"NamedNode",{enumerable:!0,get:function(){return R.NamedNode}}),Object.defineProperty(he,"Parser",{enumerable:!0,get:function(){return j.default}}),Object.defineProperty(he,"Quad",{enumerable:!0,get:function(){return R.Quad}}),Object.defineProperty(he,"Store",{enumerable:!0,get:function(){return Q.default}}),Object.defineProperty(he,"StreamParser",{enumerable:!0,get:function(){return H.default}}),Object.defineProperty(he,"StreamWriter",{enumerable:!0,get:function(){return v.default}}),Object.defineProperty(he,"Term",{enumerable:!0,get:function(){return R.Term}}),Object.defineProperty(he,"Triple",{enumerable:!0,get:function(){return R.Triple}}),he.Util=void 0,Object.defineProperty(he,"Variable",{enumerable:!0,get:function(){return R.Variable}}),Object.defineProperty(he,"Writer",{enumerable:!0,get:function(){return k.default}}),he.default=void 0,Object.defineProperty(he,"termFromId",{enumerable:!0,get:function(){return R.termFromId}}),Object.defineProperty(he,"termToId",{enumerable:!0,get:function(){return R.termToId}});var W=y(Y("./N3Lexer")),j=y(Y("./N3Parser")),k=y(Y("./N3Writer")),Q=y(Y("./N3Store")),H=y(Y("./N3StreamParser")),v=y(Y("./N3StreamWriter")),C=b(Y("./N3Util"));he.Util=C;var R=b(Y("./N3DataFactory"));function T(A){if("function"!=typeof WeakMap)return null;var z=new WeakMap,P=new WeakMap;return(T=function(X){return X?P:z})(A)}function b(A,z){if(!z&&A&&A.__esModule)return A;if(null===A||"object"!=typeof A&&"function"!=typeof A)return{default:A};var P=T(z);if(P&&P.has(A))return P.get(A);var X={},ue=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var I in A)if("default"!==I&&Object.prototype.hasOwnProperty.call(A,I)){var O=ue?Object.getOwnPropertyDescriptor(A,I):null;O&&(O.get||O.set)?Object.defineProperty(X,I,O):X[I]=A[I]}return X.default=A,P&&P.set(A,X),X}function y(A){return A&&A.__esModule?A:{default:A}}he.default={Lexer:W.default,Parser:j.default,Writer:k.default,Store:Q.default,StreamParser:H.default,StreamWriter:v.default,Util:C,DataFactory:R.default,Term:R.Term,NamedNode:R.NamedNode,Literal:R.Literal,BlankNode:R.BlankNode,Variable:R.Variable,DefaultGraph:R.DefaultGraph,Quad:R.Quad,Triple:R.Triple,termFromId:R.termFromId,termToId:R.termToId}},{"./N3DataFactory":35,"./N3Lexer":36,"./N3Parser":37,"./N3Store":38,"./N3StreamParser":39,"./N3StreamWriter":40,"./N3Util":41,"./N3Writer":42}],44:[function(Y,Se,he){var j,k,W=Se.exports={};function Q(){throw new Error("setTimeout has not been defined")}function H(){throw new Error("clearTimeout has not been defined")}function v(X){if(j===setTimeout)return setTimeout(X,0);if((j===Q||!j)&&setTimeout)return j=setTimeout,setTimeout(X,0);try{return j(X,0)}catch(ue){try{return j.call(null,X,0)}catch(I){return j.call(this,X,0)}}}!function(){try{j="function"==typeof setTimeout?setTimeout:Q}catch(X){j=Q}try{k="function"==typeof clearTimeout?clearTimeout:H}catch(X){k=H}}();var b,R=[],T=!1,y=-1;function S(){!T||!b||(T=!1,b.length?R=b.concat(R):y=-1,R.length&&A())}function A(){if(!T){var X=v(S);T=!0;for(var ue=R.length;ue;){for(b=R,R=[];++y1)for(var I=1;I(j||(j=Promise.resolve())).then(k).catch(Q=>setTimeout(()=>{throw Q},0))}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],46:[function(Y,Se,he){Se.exports=Y("./lib")},{"./lib":55}],47:[function(Y,Se,he){"use strict";Se.exports=class kq{constructor(j,k=new Map,Q=0){this.prefix=j,this._existing=k,this.counter=Q}clone(){const{prefix:j,_existing:k,counter:Q}=this;return new kq(j,new Map(k),Q)}getId(j){const k=j&&this._existing.get(j);if(k)return k;const Q=this.prefix+this.counter;return this.counter++,j&&this._existing.set(j,Q),Q}hasId(j){return this._existing.has(j)}getOldIds(){return[...this._existing.keys()]}}},{}],48:[function(Y,Se,he){"use strict";Y("setimmediate");const W=self.crypto||self.msCrypto;Se.exports=class{constructor(k){if(!W||!W.subtle)throw new Error("crypto.subtle not found.");if("sha256"===k)this.algorithm={name:"SHA-256"};else{if("sha1"!==k)throw new Error(`Unsupport algorithm "${k}".`);this.algorithm={name:"SHA-1"}}this._content=""}update(k){this._content+=k}digest(){var k=this;return yt(function*(){const Q=(new TextEncoder).encode(k._content),H=new Uint8Array(yield W.subtle.digest(k.algorithm,Q));let v="";for(let C=0;C]*)>)|(_:(?:[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]*$'),Se.exports=class nF{static parse(X){const ue=[],I={},O=X.split(T.eoln);let K=0;for(const E of O){if(K++,T.empty.test(E))continue;const $=E.match(T.quad);if(null===$)throw new Error("N-Quads parse error on line "+K+".");const Z={subject:null,predicate:null,object:null,graph:null};if(Z.subject=void 0!==$[1]?{termType:H,value:$[1]}:{termType:v,value:$[2]},Z.predicate={termType:H,value:$[3]},void 0!==$[4]?Z.object={termType:H,value:$[4]}:void 0!==$[5]?Z.object={termType:v,value:$[5]}:(Z.object={termType:C,value:void 0,datatype:{termType:H}},void 0!==$[7]?Z.object.datatype.value=$[7]:void 0!==$[8]?(Z.object.datatype.value=k,Z.object.language=$[8]):Z.object.datatype.value=Q,Z.object.value=$[6].replace(A,function(X,ue,I,O){if(ue)switch(ue){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(I)return String.fromCharCode(parseInt(I,16));if(O)throw new Error("Unsupported U escape")})),Z.graph=void 0!==$[9]?{termType:H,value:$[9]}:void 0!==$[10]?{termType:v,value:$[10]}:{termType:R,value:""},Z.graph.value in I){let ae=!0;const oe=I[Z.graph.value];for(const te of oe)if(b(te,Z)){ae=!1;break}ae&&(oe.push(Z),ue.push(Z))}else I[Z.graph.value]=[Z],ue.push(Z)}return ue}static serialize(X){Array.isArray(X)||(X=nF.legacyDatasetToQuads(X));const ue=[];for(const I of X)ue.push(nF.serializeQuad(I));return ue.sort().join("")}static serializeQuad(X){const ue=X.subject,O=X.object,K=X.graph;let E="";return E+=ue.termType===H?`<${ue.value}>`:`${ue.value}`,E+=` <${X.predicate.value}> `,O.termType===H?E+=`<${O.value}>`:O.termType===v?E+=O.value:(E+=`"${P=O.value,P.replace(y,function(X){switch(X){case'"':return'\\"';case"\\":return"\\\\";case"\n":return"\\n";case"\r":return"\\r"}})}"`,O.datatype.value===k?O.language&&(E+=`@${O.language}`):O.datatype.value!==Q&&(E+=`^^<${O.datatype.value}>`)),K.termType===H?E+=` <${K.value}>`:K.termType===v&&(E+=` ${K.value}`),E+=" .\n",E;var P}static legacyDatasetToQuads(X){const ue=[],I={"blank node":v,IRI:H,literal:C};for(const O in X)X[O].forEach(E=>{const $={};for(const Z in E){const ae=E[Z],oe={termType:I[ae.type],value:ae.value};oe.termType===C&&(oe.datatype={termType:H},"datatype"in ae&&(oe.datatype.value=ae.datatype),"language"in ae?("datatype"in ae||(oe.datatype.value=k),oe.language=ae.language):"datatype"in ae||(oe.datatype.value=Q)),$[Z]=oe}$.graph="@default"===O?{termType:R,value:""}:{termType:O.startsWith("_:")?v:H,value:O},ue.push($)});return ue}};const y=/["\\\n\r]/g;const A=/(?:\\([tbnrf"'\\]))|(?:\\u([0-9A-Fa-f]{4}))|(?:\\U([0-9A-Fa-f]{8}))/g},{}],50:[function(Y,Se,he){"use strict";Se.exports=class{constructor(j){this.current=j.sort(),this.done=!1,this.dir=new Map;for(let k=0;kH)&&(b&&R>0&&T>j[R-1]||!b&&Rj[R+1])&&(H=T,v=R)}if(null===H)this.done=!0;else{const R=k.get(H)?v-1:v+1;j[v]=j[R],j[R]=H;for(const T of j)T>H&&k.set(T,!k.get(T))}return Q}}},{}],51:[function(Y,Se,he){(function(W){(function(){"use strict";const j=Y("./IdentifierIssuer"),k=Y("./MessageDigest"),Q=Y("./Permuter"),H=Y("./NQuads");function v(C,R){return C.hashR.hash?1:0}Se.exports=class{constructor(){this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new j("_:c14n"),this.hashAlgorithm="sha256",this.quads=null}main(R){var T=this;return yt(function*(){T.quads=R;for(const X of R)T._addBlankNodeQuadInfo({quad:X,component:X.subject}),T._addBlankNodeQuadInfo({quad:X,component:X.object}),T._addBlankNodeQuadInfo({quad:X,component:X.graph});const b=new Map,y=[...T.blankNodeInfo.keys()];let S=0;for(const X of y)++S%100==0&&(yield T._yield()),yield T._hashAndTrackBlankNode({id:X,hashToBlankNodes:b});const A=[...b.keys()].sort(),z=[];for(const X of A){const ue=b.get(X);ue.length>1?z.push(ue):T.canonicalIssuer.getId(ue[0])}for(const X of z){const ue=[];for(const I of X){if(T.canonicalIssuer.hasId(I))continue;const O=new j("_:b");O.getId(I);const K=yield T.hashNDegreeQuads(I,O);ue.push(K)}ue.sort(v);for(const I of ue){const O=I.issuer.getOldIds();for(const K of O)T.canonicalIssuer.getId(K)}}const P=[];for(const X of T.quads){const ue=ot({},X);ue.subject=T._useCanonicalId({component:ue.subject}),ue.object=T._useCanonicalId({component:ue.object}),ue.graph=T._useCanonicalId({component:ue.graph}),P.push(H.serializeQuad(ue))}return P.sort(),P.join("")})()}hashFirstDegreeQuads(R){var T=this;return yt(function*(){const b=[],y=T.blankNodeInfo.get(R),S=y.quads;for(const z of S){const P={subject:null,predicate:z.predicate,object:null,graph:null};P.subject=T.modifyFirstDegreeComponent(R,z.subject,"subject"),P.object=T.modifyFirstDegreeComponent(R,z.object,"object"),P.graph=T.modifyFirstDegreeComponent(R,z.graph,"graph"),b.push(H.serializeQuad(P))}b.sort();const A=new k(T.hashAlgorithm);for(const z of b)A.update(z);return y.hash=yield A.digest(),y.hash})()}hashRelatedBlankNode(R,T,b,y){var S=this;return yt(function*(){let A;A=S.canonicalIssuer.hasId(R)?S.canonicalIssuer.getId(R):b.hasId(R)?b.getId(R):S.blankNodeInfo.get(R).hash;const z=new k(S.hashAlgorithm);return z.update(y),"g"!==y&&z.update(S.getRelatedPredicate(T)),z.update(A),z.digest()})()}hashNDegreeQuads(R,T){var b=this;return yt(function*(){const y=new k(b.hashAlgorithm),S=yield b.createHashToRelated(R,T),A=[...S.keys()].sort();for(const z of A){y.update(z);let X,P="";const ue=new Q(S.get(z));let I=0;for(;ue.hasNext();){const O=ue.next();++I%3==0&&(yield b._yield());let K=T.clone(),E="";const $=[];let Z=!1;for(const ae of O)if(b.canonicalIssuer.hasId(ae)?E+=b.canonicalIssuer.getId(ae):(K.hasId(ae)||$.push(ae),E+=K.getId(ae)),0!==P.length&&E>P){Z=!0;break}if(!Z){for(const ae of $){const oe=yield b.hashNDegreeQuads(ae,K);if(E+=K.getId(ae),E+=`<${oe.hash}>`,K=oe.issuer,0!==P.length&&E>P){Z=!0;break}}Z||(0===P.length||E`}createHashToRelated(R,T){var b=this;return yt(function*(){const y=new Map,S=b.blankNodeInfo.get(R).quads;let A=0;for(const z of S)++A%100==0&&(yield b._yield()),yield Promise.all([b._addRelatedBlankNodeHash({quad:z,component:z.subject,position:"s",id:R,issuer:T,hashToRelated:y}),b._addRelatedBlankNodeHash({quad:z,component:z.object,position:"o",id:R,issuer:T,hashToRelated:y}),b._addRelatedBlankNodeHash({quad:z,component:z.graph,position:"g",id:R,issuer:T,hashToRelated:y})]);return y})()}_hashAndTrackBlankNode({id:R,hashToBlankNodes:T}){var b=this;return yt(function*(){const y=yield b.hashFirstDegreeQuads(R),S=T.get(y);S?S.push(R):T.set(y,[R])})()}_addBlankNodeQuadInfo({quad:R,component:T}){if("BlankNode"!==T.termType)return;const b=T.value,y=this.blankNodeInfo.get(b);y?y.quads.add(R):this.blankNodeInfo.set(b,{quads:new Set([R]),hash:null})}_addRelatedBlankNodeHash({quad:R,component:T,position:b,id:y,issuer:S,hashToRelated:A}){var z=this;return yt(function*(){if("BlankNode"!==T.termType||T.value===y)return;const P=T.value,X=yield z.hashRelatedBlankNode(P,R,S,b),ue=A.get(X);ue?ue.push(P):A.set(X,[P])})()}_useCanonicalId({component:R}){return"BlankNode"!==R.termType||R.value.startsWith(this.canonicalIssuer.prefix)?R:{termType:"BlankNode",value:this.canonicalIssuer.getId(R.value)}}_yield(){return yt(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,Se,he){"use strict";const W=Y("./IdentifierIssuer"),j=Y("./MessageDigest"),k=Y("./Permuter"),Q=Y("./NQuads");function H(v,C){return v.hashC.hash?1:0}Se.exports=class{constructor(){this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new W("_:c14n"),this.hashAlgorithm="sha256",this.quads=null}main(C){this.quads=C;for(const A of C)this._addBlankNodeQuadInfo({quad:A,component:A.subject}),this._addBlankNodeQuadInfo({quad:A,component:A.object}),this._addBlankNodeQuadInfo({quad:A,component:A.graph});const R=new Map,T=[...this.blankNodeInfo.keys()];for(const A of T)this._hashAndTrackBlankNode({id:A,hashToBlankNodes:R});const b=[...R.keys()].sort(),y=[];for(const A of b){const z=R.get(A);z.length>1?y.push(z):this.canonicalIssuer.getId(z[0])}for(const A of y){const z=[];for(const P of A){if(this.canonicalIssuer.hasId(P))continue;const X=new W("_:b");X.getId(P);const ue=this.hashNDegreeQuads(P,X);z.push(ue)}z.sort(H);for(const P of z){const X=P.issuer.getOldIds();for(const ue of X)this.canonicalIssuer.getId(ue)}}const S=[];for(const A of this.quads){const z=ot({},A);z.subject=this._useCanonicalId({component:z.subject}),z.object=this._useCanonicalId({component:z.object}),z.graph=this._useCanonicalId({component:z.graph}),S.push(Q.serializeQuad(z))}return S.sort(),S.join("")}hashFirstDegreeQuads(C){const R=[],T=this.blankNodeInfo.get(C),b=T.quads;for(const S of b){const A={subject:null,predicate:S.predicate,object:null,graph:null};A.subject=this.modifyFirstDegreeComponent(C,S.subject,"subject"),A.object=this.modifyFirstDegreeComponent(C,S.object,"object"),A.graph=this.modifyFirstDegreeComponent(C,S.graph,"graph"),R.push(Q.serializeQuad(A))}R.sort();const y=new j(this.hashAlgorithm);for(const S of R)y.update(S);return T.hash=y.digest(),T.hash}hashRelatedBlankNode(C,R,T,b){let y;y=this.canonicalIssuer.hasId(C)?this.canonicalIssuer.getId(C):T.hasId(C)?T.getId(C):this.blankNodeInfo.get(C).hash;const S=new j(this.hashAlgorithm);return S.update(b),"g"!==b&&S.update(this.getRelatedPredicate(R)),S.update(y),S.digest()}hashNDegreeQuads(C,R){const T=new j(this.hashAlgorithm),b=this.createHashToRelated(C,R),y=[...b.keys()].sort();for(const S of y){T.update(S);let z,A="";const P=new k(b.get(S));for(;P.hasNext();){const X=P.next();let ue=R.clone(),I="";const O=[];let K=!1;for(const E of X)if(this.canonicalIssuer.hasId(E)?I+=this.canonicalIssuer.getId(E):(ue.hasId(E)||O.push(E),I+=ue.getId(E)),0!==A.length&&I>A){K=!0;break}if(!K){for(const E of O){const $=this.hashNDegreeQuads(E,ue);if(I+=ue.getId(E),I+=`<${$.hash}>`,ue=$.issuer,0!==A.length&&I>A){K=!0;break}}K||(0===A.length||I`}createHashToRelated(C,R){const T=new Map,b=this.blankNodeInfo.get(C).quads;for(const y of b)this._addRelatedBlankNodeHash({quad:y,component:y.subject,position:"s",id:C,issuer:R,hashToRelated:T}),this._addRelatedBlankNodeHash({quad:y,component:y.object,position:"o",id:C,issuer:R,hashToRelated:T}),this._addRelatedBlankNodeHash({quad:y,component:y.graph,position:"g",id:C,issuer:R,hashToRelated:T});return T}_hashAndTrackBlankNode({id:C,hashToBlankNodes:R}){const T=this.hashFirstDegreeQuads(C),b=R.get(T);b?b.push(C):R.set(T,[C])}_addBlankNodeQuadInfo({quad:C,component:R}){if("BlankNode"!==R.termType)return;const T=R.value,b=this.blankNodeInfo.get(T);b?b.quads.add(C):this.blankNodeInfo.set(T,{quads:new Set([C]),hash:null})}_addRelatedBlankNodeHash({quad:C,component:R,position:T,id:b,issuer:y,hashToRelated:S}){if("BlankNode"!==R.termType||R.value===b)return;const A=R.value,z=this.hashRelatedBlankNode(A,C,y,T),P=S.get(z);P?P.push(A):S.set(z,[A])}_useCanonicalId({component:C}){return"BlankNode"!==C.termType||C.value.startsWith(this.canonicalIssuer.prefix)?C:{termType:"BlankNode",value:this.canonicalIssuer.getId(C.value)}}}},{"./IdentifierIssuer":47,"./MessageDigest":48,"./NQuads":49,"./Permuter":50}],53:[function(Y,Se,he){"use strict";const W=Y("./URDNA2015");Se.exports=class extends W{constructor(){super(),this.name="URGNA2012",this.hashAlgorithm="sha1"}modifyFirstDegreeComponent(k,Q,H){return"BlankNode"!==Q.termType?Q:"graph"===H?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:Q.value===k?"_:a":"_:z"}}getRelatedPredicate(k){return k.predicate.value}createHashToRelated(k,Q){var H=this;return yt(function*(){const v=new Map,C=H.blankNodeInfo.get(k).quads;let R=0;for(const T of C){let b,y;if("BlankNode"===T.subject.termType&&T.subject.value!==k)y=T.subject.value,b="p";else{if("BlankNode"!==T.object.termType||T.object.value===k)continue;y=T.object.value,b="r"}++R%100==0&&(yield H._yield());const S=yield H.hashRelatedBlankNode(y,T,Q,b),A=v.get(S);A?A.push(y):v.set(S,[y])}return v})()}}},{"./URDNA2015":51}],54:[function(Y,Se,he){"use strict";const W=Y("./URDNA2015Sync");Se.exports=class extends W{constructor(){super(),this.name="URGNA2012",this.hashAlgorithm="sha1"}modifyFirstDegreeComponent(k,Q,H){return"BlankNode"!==Q.termType?Q:"graph"===H?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:Q.value===k?"_:a":"_:z"}}getRelatedPredicate(k){return k.predicate.value}createHashToRelated(k,Q){const H=new Map,v=this.blankNodeInfo.get(k).quads;for(const C of v){let R,T;if("BlankNode"===C.subject.termType&&C.subject.value!==k)T=C.subject.value,R="p";else{if("BlankNode"!==C.object.termType||C.object.value===k)continue;T=C.object.value,R="r"}const b=this.hashRelatedBlankNode(T,C,Q,R),y=H.get(b);y?y.push(T):H.set(b,[T])}return H}}},{"./URDNA2015Sync":52}],55:[function(Y,Se,he){"use strict";const W=Y("./URDNA2015"),j=Y("./URGNA2012"),k=Y("./URDNA2015Sync"),Q=Y("./URGNA2012Sync");let H;try{H=Y("rdf-canonize-native")}catch(C){}const v={};Se.exports=v,v.NQuads=Y("./NQuads"),v.IdentifierIssuer=Y("./IdentifierIssuer"),v._rdfCanonizeNative=function(C){return C&&(H=C),H},v.canonize=function(){var C=yt(function*(R,T){if(Array.isArray(R)||(R=v.NQuads.legacyDatasetToQuads(R)),T.useNative){if(!H)throw new Error("rdf-canonize-native not available");return new Promise((b,y)=>H.canonize(R,T,(S,A)=>S?y(S):b(A)))}if("URDNA2015"===T.algorithm)return new W(T).main(R);if("URGNA2012"===T.algorithm)return new j(T).main(R);throw"algorithm"in T?new Error("Invalid RDF Dataset Canonicalization algorithm: "+T.algorithm):new Error("No RDF Dataset Canonicalization algorithm specified.")});return function(R,T){return C.apply(this,arguments)}}(),v._canonizeSync=function(C,R){if(Array.isArray(C)||(C=v.NQuads.legacyDatasetToQuads(C)),R.useNative){if(H)return H.canonizeSync(C,R);throw new Error("rdf-canonize-native not available")}if("URDNA2015"===R.algorithm)return new k(R).main(C);if("URGNA2012"===R.algorithm)return new Q(R).main(C);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,Se,he){"use strict";var W=this&&this.__createBinding||(Object.create?function(k,Q,H,v){void 0===v&&(v=H),Object.defineProperty(k,v,{enumerable:!0,get:function(){return Q[H]}})}:function(k,Q,H,v){void 0===v&&(v=H),k[v]=Q[H]}),j=this&&this.__exportStar||function(k,Q){for(var H in k)"default"!==H&&!Object.prototype.hasOwnProperty.call(Q,H)&&W(Q,k,H)};Object.defineProperty(he,"__esModule",{value:!0}),j(Y("./lib/BlankNode"),he),j(Y("./lib/DataFactory"),he),j(Y("./lib/DefaultGraph"),he),j(Y("./lib/Literal"),he),j(Y("./lib/NamedNode"),he),j(Y("./lib/Quad"),he),j(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,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.BlankNode=void 0;he.BlankNode=class{constructor(k){this.termType="BlankNode",this.value=k}equals(k){return!!k&&"BlankNode"===k.termType&&k.value===this.value}}},{}],58:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.DataFactory=void 0;const W=Y("./BlankNode"),j=Y("./DefaultGraph"),k=Y("./Literal"),Q=Y("./NamedNode"),H=Y("./Quad"),v=Y("./Variable");let C=0;he.DataFactory=class{constructor(b){this.blankNodeCounter=0,this.blankNodePrefix=(b=b||{}).blankNodePrefix||`df_${C++}_`}namedNode(b){return new Q.NamedNode(b)}blankNode(b){return new W.BlankNode(b||`${this.blankNodePrefix}${this.blankNodeCounter++}`)}literal(b,y){return new k.Literal(b,y)}variable(b){return new v.Variable(b)}defaultGraph(){return j.DefaultGraph.INSTANCE}quad(b,y,S,A){return new H.Quad(b,y,S,A||this.defaultGraph())}fromTerm(b){switch(b.termType){case"NamedNode":return this.namedNode(b.value);case"BlankNode":return this.blankNode(b.value);case"Literal":return b.language?this.literal(b.value,b.language):b.datatype.equals(k.Literal.XSD_STRING)?this.literal(b.value):this.literal(b.value,this.fromTerm(b.datatype));case"Variable":return this.variable(b.value);case"DefaultGraph":return this.defaultGraph();case"Quad":return this.quad(this.fromTerm(b.subject),this.fromTerm(b.predicate),this.fromTerm(b.object),this.fromTerm(b.graph))}}fromQuad(b){return this.fromTerm(b)}resetBlankNodeCounter(){this.blankNodeCounter=0}}},{"./BlankNode":57,"./DefaultGraph":59,"./Literal":60,"./NamedNode":61,"./Quad":62,"./Variable":63}],59:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.DefaultGraph=void 0;class W{constructor(){this.termType="DefaultGraph",this.value=""}equals(k){return!!k&&"DefaultGraph"===k.termType}}he.DefaultGraph=W,W.INSTANCE=new W},{}],60:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.Literal=void 0;const W=Y("./NamedNode");class j{constructor(Q,H){this.termType="Literal",this.value=Q,"string"==typeof H?(this.language=H,this.datatype=j.RDF_LANGUAGE_STRING):H?(this.language="",this.datatype=H):(this.language="",this.datatype=j.XSD_STRING)}equals(Q){return!!Q&&"Literal"===Q.termType&&Q.value===this.value&&Q.language===this.language&&Q.datatype.equals(this.datatype)}}he.Literal=j,j.RDF_LANGUAGE_STRING=new W.NamedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),j.XSD_STRING=new W.NamedNode("http://www.w3.org/2001/XMLSchema#string")},{"./NamedNode":61}],61:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.NamedNode=void 0;he.NamedNode=class{constructor(k){this.termType="NamedNode",this.value=k}equals(k){return!!k&&"NamedNode"===k.termType&&k.value===this.value}}},{}],62:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.Quad=void 0;he.Quad=class{constructor(k,Q,H,v){this.termType="Quad",this.value="",this.subject=k,this.predicate=Q,this.object=H,this.graph=v}equals(k){return!!k&&("Quad"===k.termType||!k.termType)&&this.subject.equals(k.subject)&&this.predicate.equals(k.predicate)&&this.object.equals(k.object)&&this.graph.equals(k.graph)}}},{}],63:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.Variable=void 0;he.Variable=class{constructor(k){this.termType="Variable",this.value=k}equals(k){return!!k&&"Variable"===k.termType&&k.value===this.value}}},{}],64:[function(Y,Se,he){"use strict";var W=this&&this.__createBinding||(Object.create?function(k,Q,H,v){void 0===v&&(v=H),Object.defineProperty(k,v,{enumerable:!0,get:function(){return Q[H]}})}:function(k,Q,H,v){void 0===v&&(v=H),k[v]=Q[H]}),j=this&&this.__exportStar||function(k,Q){for(var H in k)"default"!==H&&!Object.prototype.hasOwnProperty.call(Q,H)&&W(Q,k,H)};Object.defineProperty(he,"__esModule",{value:!0}),j(Y("./lib/RdfXmlParser"),he)},{"./lib/RdfXmlParser":66}],65:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.ParseError=void 0;class W extends Error{constructor(k,Q){const H=k.saxStream._parser;super(k.trackPosition?`Line ${H.line+1} column ${H.column+1}: ${Q}`:Q)}}he.ParseError=W},{}],66:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.ParseType=he.RdfXmlParser=void 0;const W=Y("relative-to-absolute-iri"),j=Y("sax"),k=Y("stream"),Q=Y("./ParseError"),H=Y("rdf-data-factory");class v extends k.Transform{constructor(T){super({readableObjectMode:!0}),this.activeTagStack=[],this.nodeIds={},T&&(Object.assign(this,T),this.options=T),this.dataFactory||(this.dataFactory=new H.DataFactory),this.baseIRI||(this.baseIRI=""),this.defaultGraph||(this.defaultGraph=this.dataFactory.defaultGraph()),this.saxStream=j.createStream(this.strict,{xmlns:!1,position:this.trackPosition}),this.strict||(this.saxStream._parser.looseCase="toString"),this.attachSaxListeners()}static parseNamespace(T,b){const y={};let S=!1;for(const z in T.attributes)z.startsWith("xmlns")&&(5===z.length?(S=!0,y[""]=T.attributes[z]):":"===z.charAt(5)&&(S=!0,y[z.substr(6)]=T.attributes[z]));const A=b&&b.ns?b.ns:[v.DEFAULT_NS];return S?A.concat([y]):A}static expandPrefixedTerm(T,b,y){const S=T.indexOf(":");let A,z;S>=0?(A=T.substr(0,S),z=T.substr(S+1)):(A="",z=T);let P=null,X=null;for(let ue=b.length-1;ue>=0;ue--){const I=b[ue][A];if(I){P=I;break}X||(X=b[ue][""])}if(!P){if(A&&"xmlns"!==A)throw new Q.ParseError(y,`The prefix '${A}' in term '${T}' was not bound.`);P=X||""}return{prefix:A,local:z,uri:P}}static isValidIri(T){return v.IRI_REGEX.test(T)}import(T){const b=new k.PassThrough({readableObjectMode:!0});T.on("error",S=>y.emit("error",S)),T.on("data",S=>b.push(S)),T.on("end",()=>b.push(null));const y=b.pipe(new v(this.options));return y}_transform(T,b,y){try{this.saxStream.write(T,b)}catch(S){return y(S)}y()}newParseError(T){return new Q.ParseError(this,T)}valueToUri(T,b){return this.uriToNamedNode(W.resolve(T,b.baseIRI))}uriToNamedNode(T){if(!v.isValidIri(T))throw this.newParseError(`Invalid URI: ${T}`);return this.dataFactory.namedNode(T)}validateNcname(T){if(!v.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 b=this.activeTagStack.length?this.activeTagStack[this.activeTagStack.length-1]:null;let y=C.RESOURCE;if(b&&(b.hadChildren=!0,y=b.childrenParseType),b&&b.childrenStringTags){const A=T.name;let z="";for(const I in T.attributes)z+=` ${I}="${T.attributes[I]}"`;b.childrenStringTags.push(`<${A}${z}>`);const ue={childrenStringTags:b.childrenStringTags};return ue.childrenStringEmitClosingTag=``,void this.activeTagStack.push(ue)}const S={};b?(S.language=b.language,S.baseIRI=b.baseIRI):S.baseIRI=this.baseIRI,this.activeTagStack.push(S),S.ns=v.parseNamespace(T,b),y===C.RESOURCE?this.onTagResource(T,S,b,!b):this.onTagProperty(T,S,b)}onTagResource(T,b,y,S){const A=v.expandPrefixedTerm(T.name,b.ns,this);b.childrenParseType=C.PROPERTY;let z=!0;if(A.uri===v.RDF){if(!S&&v.FORBIDDEN_NODE_ELEMENTS.indexOf(A.local)>=0)throw this.newParseError(`Illegal node element name: ${A.local}`);switch(A.local){case"RDF":b.childrenParseType=C.RESOURCE;case"Description":z=!1}}const P=[],X=[];let ue=null,I=!1,O=!1,K=null;for(const E in T.attributes){const $=T.attributes[E],Z=v.expandPrefixedTerm(E,b.ns,this);if(y&&Z.uri===v.RDF)switch(Z.local){case"about":if(ue)throw this.newParseError(`Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ${$} and ${ue} where found.`);ue=$;continue;case"ID":if(ue)throw this.newParseError(`Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ${$} and ${ue} where found.`);this.validateNcname($),ue="#"+$,I=!0;continue;case"nodeID":if(ue)throw this.newParseError(`Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ${$} and ${ue} where found.`);this.validateNcname($),ue=$,O=!0;continue;case"bagID":throw this.newParseError("rdf:bagID is not supported.");case"type":K=$;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(Z.uri===v.XML){if("lang"===Z.local){b.language=""===$?null:$.toLowerCase();continue}if("base"===Z.local){b.baseIRI=W.resolve($,b.baseIRI);continue}}"xml"!==Z.prefix&&Z.uri&&(P.push(this.uriToNamedNode(Z.uri+Z.local)),X.push($))}if(null!==ue&&(b.subject=O?this.dataFactory.blankNode(ue):this.valueToUri(ue,b),I&&this.claimNodeId(b.subject)),b.subject||(b.subject=this.dataFactory.blankNode()),z){const E=this.uriToNamedNode(A.uri+A.local);this.emitTriple(b.subject,this.dataFactory.namedNode(v.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(v.RDF+"first"),b.subject,b.reifiedStatementId),y.childrenCollectionSubject=E,y.childrenCollectionPredicate=this.dataFactory.namedNode(v.RDF+"rest")}else{this.emitTriple(y.subject,y.predicate,b.subject,y.reifiedStatementId);for(let E=0;E=0)throw this.newParseError(`Illegal property element name: ${S.local}`);b.predicateSubPredicates=[],b.predicateSubObjects=[];let A=!1,z=!1,P=null,X=!0;const ue=[],I=[];for(const O in T.attributes){const K=T.attributes[O],E=v.expandPrefixedTerm(O,b.ns,this);if(E.uri===v.RDF)switch(E.local){case"resource":if(P)throw this.newParseError(`Found both rdf:resource (${K}) and rdf:nodeID (${P}).`);if(A)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:resource (${K})`);b.hadChildren=!0,P=K,X=!1;continue;case"datatype":if(z)throw this.newParseError(`Found both non-rdf:* property attributes and rdf:datatype (${K}).`);if(A)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:datatype (${K})`);b.datatype=this.valueToUri(K,b);continue;case"nodeID":if(z)throw this.newParseError(`Found both non-rdf:* property attributes and rdf:nodeID (${K}).`);if(b.hadChildren)throw this.newParseError(`Found both rdf:resource and rdf:nodeID (${K}).`);if(A)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:nodeID (${K})`);this.validateNcname(K),b.hadChildren=!0,P=K,X=!0;continue;case"bagID":throw this.newParseError("rdf:bagID is not supported.");case"parseType":if(z)throw this.newParseError("rdf:parseType is not allowed when non-rdf:* property attributes are present");if(b.datatype)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:datatype (${b.datatype.value})`);if(P)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:nodeID or rdf:resource (${P})`);if("Resource"===K){A=!0,b.childrenParseType=C.PROPERTY;const $=this.dataFactory.blankNode();this.emitTriple(b.subject,b.predicate,$,b.reifiedStatementId),b.subject=$,b.predicate=null}else"Collection"===K?(A=!0,b.hadChildren=!0,b.childrenCollectionSubject=b.subject,b.childrenCollectionPredicate=b.predicate,X=!1):"Literal"===K&&(A=!0,b.childrenTagsToString=!0,b.childrenStringTags=[]);continue;case"ID":this.validateNcname(K),b.reifiedStatementId=this.valueToUri("#"+K,b),this.claimNodeId(b.reifiedStatementId);continue}else if(E.uri===v.XML&&"lang"===E.local){b.language=""===K?null:K.toLowerCase();continue}if("xml"!==E.prefix&&"xmlns"!==E.prefix&&E.uri){if(A||b.datatype)throw this.newParseError(`Found illegal rdf:* properties on property element with attribute: ${K}`);b.hadChildren=!0,z=!0,ue.push(this.uriToNamedNode(E.uri+E.local)),I.push(this.dataFactory.literal(K,b.datatype||b.language))}}if(null!==P){const O=b.subject;b.subject=X?this.dataFactory.blankNode(P):this.valueToUri(P,b),this.emitTriple(O,b.predicate,b.subject,b.reifiedStatementId);for(let K=0;K/g,(b,y,S)=>(this.saxStream._parser.ENTITIES[y]=S,""))}}var C,R;he.RdfXmlParser=v,v.IRI_REGEX=/^([A-Za-z][A-Za-z0-9+-.]*):[^ "<>{}|\\\[\]`]*$/,v.MIME_TYPE="application/rdf+xml",v.RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#",v.XML="http://www.w3.org/XML/1998/namespace",v.XMLNS="http://www.w3.org/2000/xmlns/",v.DEFAULT_NS={xml:v.XML},v.FORBIDDEN_NODE_ELEMENTS=["RDF","ID","about","bagID","parseType","resource","nodeID","li","aboutEach","aboutEachPrefix"],v.FORBIDDEN_PROPERTY_ELEMENTS=["Description","RDF","ID","about","bagID","parseType","resource","nodeID","aboutEach","aboutEachPrefix"],v.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=C=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,Se,he){"use strict";var j={};function k(R,T,b){b||(b=Error);var S=function(A){function z(P,X,ue){return A.call(this,function(A,z,P){return"string"==typeof T?T:T(A,z,P)}(P,X,ue))||this}return function(R,T){R.prototype=Object.create(T.prototype),R.prototype.constructor=R,R.__proto__=T}(z,A),z}(b);S.prototype.name=b.name,S.prototype.code=R,j[R]=S}function Q(R,T){if(Array.isArray(R)){var b=R.length;return R=R.map(function(y){return String(y)}),b>2?"one of ".concat(T," ").concat(R.slice(0,b-1).join(", "),", or ")+R[b-1]:2===b?"one of ".concat(T," ").concat(R[0]," or ").concat(R[1]):"of ".concat(T," ").concat(R[0])}return"of ".concat(T," ").concat(String(R))}k("ERR_INVALID_OPT_VALUE",function(R,T){return'The value "'+T+'" is invalid for option "'+R+'"'},TypeError),k("ERR_INVALID_ARG_TYPE",function(R,T,b){var y,S;if("string"==typeof T&&function(R,T,b){return R.substr(!b||b<0?0:+b,T.length)===T}(T,"not ")?(y="must not be",T=T.replace(/^not /,"")):y="must be",function(R,T,b){return(void 0===b||b>R.length)&&(b=R.length),R.substring(b-T.length,b)===T}(R," argument"))S="The ".concat(R," ").concat(y," ").concat(Q(T,"type"));else{var A=function(R,T,b){return"number"!=typeof b&&(b=0),!(b+T.length>R.length)&&-1!==R.indexOf(T,b)}(R,".")?"property":"argument";S='The "'.concat(R,'" ').concat(A," ").concat(y," ").concat(Q(T,"type"))}return S+". Received type ".concat(typeof b)},TypeError),k("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),k("ERR_METHOD_NOT_IMPLEMENTED",function(R){return"The "+R+" method is not implemented"}),k("ERR_STREAM_PREMATURE_CLOSE","Premature close"),k("ERR_STREAM_DESTROYED",function(R){return"Cannot call "+R+" after a stream was destroyed"}),k("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),k("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),k("ERR_STREAM_WRITE_AFTER_END","write after end"),k("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),k("ERR_UNKNOWN_ENCODING",function(R){return"Unknown encoding: "+R},TypeError),k("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),Se.exports.codes=j},{}],68:[function(Y,Se,he){(function(W){(function(){"use strict";var j=Object.keys||function(y){var S=[];for(var A in y)S.push(A);return S};Se.exports=R;var k=Y("./_stream_readable"),Q=Y("./_stream_writable");Y("inherits")(R,k);for(var H=j(Q.prototype),v=0;v0)if("string"!=typeof B&&!Ze.objectMode&&Object.getPrototypeOf(B)!==C.prototype&&(B=function(we){return C.from(we)}(B)),V)Ze.endEmitted?oe(we,new E):Oe(we,Ze,B,!0);else if(Ze.ended)oe(we,new O);else{if(Ze.destroyed)return!1;Ze.reading=!1,Ze.decoder&&!N?(B=Ze.decoder.write(B),Ze.objectMode||0!==B.length?Oe(we,Ze,B,!1):Ke(we,Ze)):Oe(we,Ze,B,!1)}else V||(Ze.reading=!1,Ke(we,Ze));return!Ze.ended&&(Ze.lengthB.highWaterMark&&(B.highWaterMark=function(we){return we>=st?we=st:(we--,we|=we>>>1,we|=we>>>2,we|=we>>>4,we|=we>>>8,we|=we>>>16,we++),we}(we)),we<=B.length?we:B.ended?B.length:(B.needReadable=!0,0))}function ze(we){var B=we._readableState;S("emitReadable",B.needReadable,B.emittedReadable),B.needReadable=!1,B.emittedReadable||(S("emitReadable",B.flowing),B.emittedReadable=!0,W.nextTick(Le,we))}function Le(we){var B=we._readableState;S("emitReadable_",B.destroyed,B.length,B.ended),!B.destroyed&&(B.length||B.ended)&&(we.emit("readable"),B.emittedReadable=!1),B.needReadable=!B.flowing&&!B.ended&&B.length<=B.highWaterMark,pe(we)}function Ke(we,B){B.readingMore||(B.readingMore=!0,W.nextTick(Me,we,B))}function Me(we,B){for(;!B.reading&&!B.ended&&(B.length0,B.resumeScheduled&&!B.paused?B.flowing=!0:we.listenerCount("data")>0&&we.resume()}function ke(we){S("readable nexttick read 0"),we.read(0)}function G(we,B){S("resume",B.reading),B.reading||we.read(0),B.resumeScheduled=!1,we.emit("resume"),pe(we),B.flowing&&!B.reading&&we.read(0)}function pe(we){var B=we._readableState;for(S("flow",B.flowing);B.flowing&&null!==we.read(););}function de(we,B){return 0===B.length?null:(B.objectMode?N=B.buffer.shift():!we||we>=B.length?(N=B.decoder?B.buffer.join(""):1===B.buffer.length?B.buffer.first():B.buffer.concat(B.length),B.buffer.clear()):N=B.buffer.consume(we,B.decoder),N);var N}function je(we){var B=we._readableState;S("endReadable",B.endEmitted),B.endEmitted||(B.ended=!0,W.nextTick(_t,B,we))}function _t(we,B){if(S("endReadableNT",we.endEmitted,we.length),!we.endEmitted&&0===we.length&&(we.endEmitted=!0,B.readable=!1,B.emit("end"),we.autoDestroy)){var N=B._writableState;(!N||N.autoDestroy&&N.finished)&&B.destroy()}}function pt(we,B){for(var N=0,V=we.length;N=B.highWaterMark:B.length>0)||B.ended))return S("read: emitReadable",B.length,B.ended),0===B.length&&B.ended?je(this):ze(this),null;if(0===(we=tt(we,B))&&B.ended)return 0===B.length&&je(this),null;var Re,V=B.needReadable;return S("need readable",V),(0===B.length||B.length-we0?de(we,B):null)?(B.needReadable=B.length<=B.highWaterMark,we=0):(B.length-=we,B.awaitDrain=0),0===B.length&&(B.ended||(B.needReadable=!0),N!==we&&B.ended&&je(this)),null!==Re&&this.emit("data",Re),Re},ne.prototype._read=function(we){oe(this,new K("_read()"))},ne.prototype.pipe=function(we,B){var N=this,V=this._readableState;switch(V.pipesCount){case 0:V.pipes=we;break;case 1:V.pipes=[V.pipes,we];break;default:V.pipes.push(we)}V.pipesCount+=1,S("pipe count=%d opts=%j",V.pipesCount,B);var Ze=B&&!1===B.end||we===W.stdout||we===W.stderr?fs:kt;function Tt(Bs,Kr){S("onunpipe"),Bs===N&&Kr&&!1===Kr.hasUnpiped&&(Kr.hasUnpiped=!0,S("cleanup"),we.removeListener("close",Xr),we.removeListener("finish",Ls),we.removeListener("drain",In),we.removeListener("error",xi),we.removeListener("unpipe",Tt),N.removeListener("end",kt),N.removeListener("end",fs),N.removeListener("data",Mi),Nn=!0,V.awaitDrain&&(!we._writableState||we._writableState.needDrain)&&In())}function kt(){S("onend"),we.end()}V.endEmitted?W.nextTick(Ze):N.once("end",Ze),we.on("unpipe",Tt);var In=function(we){return function(){var N=we._readableState;S("pipeOnDrain",N.awaitDrain),N.awaitDrain&&N.awaitDrain--,0===N.awaitDrain&&H(we,"data")&&(N.flowing=!0,pe(we))}}(N);we.on("drain",In);var Nn=!1;function Mi(Bs){S("ondata");var Kr=we.write(Bs);S("dest.write",Kr),!1===Kr&&((1===V.pipesCount&&V.pipes===we||V.pipesCount>1&&-1!==pt(V.pipes,we))&&!Nn&&(S("false write response, pause",V.awaitDrain),V.awaitDrain++),N.pause())}function xi(Bs){S("onerror",Bs),fs(),we.removeListener("error",xi),0===H(we,"error")&&oe(we,Bs)}function Xr(){we.removeListener("finish",Ls),fs()}function Ls(){S("onfinish"),we.removeListener("close",Xr),fs()}function fs(){S("unpipe"),N.unpipe(we)}return N.on("data",Mi),function(we,B,N){if("function"==typeof we.prependListener)return we.prependListener(B,N);we._events&&we._events[B]?Array.isArray(we._events[B])?we._events[B].unshift(N):we._events[B]=[N,we._events[B]]:we.on(B,N)}(we,"error",xi),we.once("close",Xr),we.once("finish",Ls),we.emit("pipe",N),V.flowing||(S("pipe resume"),N.resume()),we},ne.prototype.unpipe=function(we){var B=this._readableState,N={hasUnpiped:!1};if(0===B.pipesCount)return this;if(1===B.pipesCount)return we&&we!==B.pipes||(we||(we=B.pipes),B.pipes=null,B.pipesCount=0,B.flowing=!1,we&&we.emit("unpipe",this,N)),this;if(!we){var V=B.pipes,Re=B.pipesCount;B.pipes=null,B.pipesCount=0,B.flowing=!1;for(var Ze=0;Ze0,!1!==V.flowing&&this.resume()):"readable"===we&&!V.endEmitted&&!V.readableListening&&(V.readableListening=V.needReadable=!0,V.flowing=!1,V.emittedReadable=!1,S("on readable",V.length,V.reading),V.length?ze(this):V.reading||W.nextTick(ke,this)),N},ne.prototype.removeListener=function(we,B){var N=v.prototype.removeListener.call(this,we,B);return"readable"===we&&W.nextTick(qe,this),N},ne.prototype.removeAllListeners=function(we){var B=v.prototype.removeAllListeners.apply(this,arguments);return("readable"===we||void 0===we)&&W.nextTick(qe,this),B},ne.prototype.resume=function(){var we=this._readableState;return we.flowing||(S("resume"),we.flowing=!we.readableListening,function(we,B){B.resumeScheduled||(B.resumeScheduled=!0,W.nextTick(G,we,B))}(this,we)),we.paused=!1,this},ne.prototype.pause=function(){return S("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(S("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},ne.prototype.wrap=function(we){var B=this,N=this._readableState,V=!1;for(var Re in we.on("end",function(){if(S("wrapped end"),N.decoder&&!N.ended){var Tt=N.decoder.end();Tt&&Tt.length&&B.push(Tt)}B.push(null)}),we.on("data",function(Tt){S("wrapped data"),N.decoder&&(Tt=N.decoder.write(Tt)),N.objectMode&&null==Tt||!(N.objectMode||Tt&&Tt.length)||B.push(Tt)||(V=!0,we.pause())}),we)void 0===this[Re]&&"function"==typeof we[Re]&&(this[Re]=function(kt){return function(){return we[kt].apply(we,arguments)}}(Re));for(var Ze=0;Ze-1))throw new Z(de);return this._writableState.defaultEncoding=de,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(pe,de,je){je(new ue("_write()"))},me.prototype._writev=null,me.prototype.end=function(pe,de,je){var _t=this._writableState;return"function"==typeof pe?(je=pe,pe=null,de=null):"function"==typeof de&&(je=de,de=null),null!=pe&&this.write(pe,de),_t.corked&&(_t.corked=1,this.uncork()),_t.ending||function(pe,de,je){de.ending=!0,ke(pe,de),je&&(de.finished?W.nextTick(je):pe.once("finish",je)),de.ended=!0,pe.writable=!1}(this,_t,je),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(de){!this._writableState||(this._writableState.destroyed=de)}}),me.prototype.destroy=S.destroy,me.prototype._undestroy=S.undestroy,me.prototype._destroy=function(pe,de){de(pe)}}).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,Se,he){(function(W){(function(){"use strict";var j;function k(O,K,E){return K in O?Object.defineProperty(O,K,{value:E,enumerable:!0,configurable:!0,writable:!0}):O[K]=E,O}var Q=Y("./end-of-stream"),H=Symbol("lastResolve"),v=Symbol("lastReject"),C=Symbol("error"),R=Symbol("ended"),T=Symbol("lastPromise"),b=Symbol("handlePromise"),y=Symbol("stream");function S(O,K){return{value:O,done:K}}function A(O){var K=O[H];if(null!==K){var E=O[y].read();null!==E&&(O[T]=null,O[H]=null,O[v]=null,K(S(E,!1)))}}function z(O){W.nextTick(A,O)}var X=Object.getPrototypeOf(function(){}),ue=Object.setPrototypeOf((k(j={get stream(){return this[y]},next:function(){var K=this,E=this[C];if(null!==E)return Promise.reject(E);if(this[R])return Promise.resolve(S(void 0,!0));if(this[y].destroyed)return new Promise(function(oe,te){W.nextTick(function(){K[C]?te(K[C]):oe(S(void 0,!0))})});var Z,$=this[T];if($)Z=new Promise(function(O,K){return function(E,$){O.then(function(){K[R]?E(S(void 0,!0)):K[b](E,$)},$)}}($,this));else{var ae=this[y].read();if(null!==ae)return Promise.resolve(S(ae,!1));Z=new Promise(this[b])}return this[T]=Z,Z}},Symbol.asyncIterator,function(){return this}),k(j,"return",function(){var K=this;return new Promise(function(E,$){K[y].destroy(null,function(Z){Z?$(Z):E(S(void 0,!0))})})}),j),X);Se.exports=function(K){var E,$=Object.create(ue,(k(E={},y,{value:K,writable:!0}),k(E,H,{value:null,writable:!0}),k(E,v,{value:null,writable:!0}),k(E,C,{value:null,writable:!0}),k(E,R,{value:K._readableState.endEmitted,writable:!0}),k(E,b,{value:function(ae,oe){var te=$[y].read();te?($[T]=null,$[H]=null,$[v]=null,ae(S(te,!1))):($[H]=ae,$[v]=oe)},writable:!0}),E));return $[T]=null,Q(K,function(Z){if(Z&&"ERR_STREAM_PREMATURE_CLOSE"!==Z.code){var ae=$[v];return null!==ae&&($[T]=null,$[H]=null,$[v]=null,ae(Z)),void($[C]=Z)}var oe=$[H];null!==oe&&($[T]=null,$[H]=null,$[v]=null,oe(S(void 0,!0))),$[R]=!0}),K.on("readable",z.bind(null,$)),$}}).call(this)}).call(this,Y("_process"))},{"./end-of-stream":76,_process:44}],74:[function(Y,Se,he){"use strict";function W(A,z){var P=Object.keys(A);if(Object.getOwnPropertySymbols){var X=Object.getOwnPropertySymbols(A);z&&(X=X.filter(function(ue){return Object.getOwnPropertyDescriptor(A,ue).enumerable})),P.push.apply(P,X)}return P}function k(A,z,P){return z in A?Object.defineProperty(A,z,{value:P,enumerable:!0,configurable:!0,writable:!0}):A[z]=P,A}function H(A,z){for(var P=0;P0?this.tail.next=X:this.head=X,this.tail=X,++this.length}},{key:"unshift",value:function(P){var X={data:P,next:this.head};0===this.length&&(this.tail=X),this.head=X,++this.length}},{key:"shift",value:function(){if(0!==this.length){var P=this.head.data;return this.head=1===this.length?this.tail=null:this.head.next,--this.length,P}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(P){if(0===this.length)return"";for(var X=this.head,ue=""+X.data;X=X.next;)ue+=P+X.data;return ue}},{key:"concat",value:function(P){if(0===this.length)return R.alloc(0);for(var X=R.allocUnsafe(P>>>0),ue=this.head,I=0;ue;)S(ue.data,X,I),I+=ue.data.length,ue=ue.next;return X}},{key:"consume",value:function(P,X){var ue;return PO.length?O.length:P;if(I+=K===O.length?O:O.slice(0,P),0==(P-=K)){K===O.length?(++ue,this.head=X.next?X.next:this.tail=null):(this.head=X,X.data=O.slice(K));break}++ue}return this.length-=ue,I}},{key:"_getBuffer",value:function(P){var X=R.allocUnsafe(P),ue=this.head,I=1;for(ue.data.copy(X),P-=ue.data.length;ue=ue.next;){var O=ue.data,K=P>O.length?O.length:P;if(O.copy(X,X.length-P,0,K),0==(P-=K)){K===O.length?(++I,this.head=ue.next?ue.next:this.tail=null):(this.head=ue,ue.data=O.slice(K));break}++I}return this.length-=I,X}},{key:y,value:function(P,X){return b(this,function(A){for(var z=1;z0,function(Z){ue||(ue=Z),Z&&I.forEach(T),!E&&(I.forEach(T),X(ue))})});return z.reduce(b)}},{"../../../errors":67,"./end-of-stream":76}],79:[function(Y,Se,he){"use strict";var W=Y("../../../errors").codes.ERR_INVALID_OPT_VALUE;Se.exports={getHighWaterMark:function(Q,H,v,C){var R=function(Q,H,v){return null!=Q.highWaterMark?Q.highWaterMark:H?Q[v]:null}(H,C,v);if(null!=R){if(!isFinite(R)||Math.floor(R)!==R||R<0)throw new W(C?v:"highWaterMark",R);return Math.floor(R)}return Q.objectMode?16:16384}}},{"../../../errors":67}],80:[function(Y,Se,he){Se.exports=Y("events").EventEmitter},{events:8}],81:[function(Y,Se,he){(he=Se.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,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),function(j){for(var k in j)he.hasOwnProperty(k)||(he[k]=j[k])}(Y("./lib/Resolve"))},{"./lib/Resolve":83}],83:[function(Y,Se,he){"use strict";function j(H){const v=[];let C=0;for(;CR.join("")).join("/")}function k(H,v){let C=v+1;v>=0?"/"===H[v+1]&&"/"===H[v+2]&&(C=v+3):"/"===H[0]&&"/"===H[1]&&(C=2);const R=H.indexOf("/",C);return R<0?H:H.substr(0,R)+j(H.substr(R))}function Q(H){return!H||"#"===H||"?"===H||"/"===H}Object.defineProperty(he,"__esModule",{value:!0}),he.resolve=function(H,v){const C=(v=v||"").indexOf("#");if(C>0&&(v=v.substr(0,C)),!H.length){if(v.indexOf(":")<0)throw new Error(`Found invalid baseIRI '${v}' for value '${H}'`);return v}if(H.startsWith("?")){const z=v.indexOf("?");return z>0&&(v=v.substr(0,z)),v+H}if(H.startsWith("#"))return v+H;if(!v.length){const z=H.indexOf(":");if(z<0)throw new Error(`Found invalid relative IRI '${H}' for a missing baseIRI`);return k(H,z)}const R=H.indexOf(":");if(R>=0)return k(H,R);const T=v.indexOf(":");if(T<0)throw new Error(`Found invalid baseIRI '${v}' for value '${H}'`);const b=v.substr(0,T+1);if(0===H.indexOf("//"))return b+k(H,R);let y;if(v.indexOf("//",T)===T+1){if(y=v.indexOf("/",T+3),y<0)return v.length>T+3?v+"/"+k(H,R):b+k(H,R)}else if(y=v.indexOf("/",T+1),y<0)return b+k(H,R);if(0===H.indexOf("/"))return v.substr(0,y)+j(H);let S=v.substr(y);const A=S.lastIndexOf("/");return A>=0&&A"===de?(ne(G,"onsgmldeclaration",G.sgmlDecl),G.sgmlDecl="",G.state=te.TEXT):($(de)&&(G.state=te.SGML_DECL_QUOTED),G.sgmlDecl+=de);continue;case te.SGML_DECL_QUOTED:de===G.q&&(G.state=te.SGML_DECL,G.q=""),G.sgmlDecl+=de;continue;case te.DOCTYPE:">"===de?(G.state=te.TEXT,ne(G,"ondoctype",G.doctype),G.doctype=!0):(G.doctype+=de,"["===de?G.state=te.DOCTYPE_DTD:$(de)&&(G.state=te.DOCTYPE_QUOTED,G.q=de));continue;case te.DOCTYPE_QUOTED:G.doctype+=de,de===G.q&&(G.q="",G.state=te.DOCTYPE);continue;case te.DOCTYPE_DTD:G.doctype+=de,"]"===de?G.state=te.DOCTYPE:$(de)&&(G.state=te.DOCTYPE_DTD_QUOTED,G.q=de);continue;case te.DOCTYPE_DTD_QUOTED:G.doctype+=de,de===G.q&&(G.state=te.DOCTYPE_DTD,G.q="");continue;case te.COMMENT:"-"===de?G.state=te.COMMENT_ENDING:G.comment+=de;continue;case te.COMMENT_ENDING:"-"===de?(G.state=te.COMMENT_ENDED,G.comment=Oe(G.opt,G.comment),G.comment&&ne(G,"oncomment",G.comment),G.comment=""):(G.comment+="-"+de,G.state=te.COMMENT);continue;case te.COMMENT_ENDED:">"!==de?(Qe(G,"Malformed comment"),G.comment+="--"+de,G.state=te.COMMENT):G.state=te.TEXT;continue;case te.CDATA:"]"===de?G.state=te.CDATA_ENDING:G.cdata+=de;continue;case te.CDATA_ENDING:"]"===de?G.state=te.CDATA_ENDING_2:(G.cdata+="]"+de,G.state=te.CDATA);continue;case te.CDATA_ENDING_2:">"===de?(G.cdata&&ne(G,"oncdata",G.cdata),ne(G,"onclosecdata"),G.cdata="",G.state=te.TEXT):"]"===de?G.cdata+="]":(G.cdata+="]]"+de,G.state=te.CDATA);continue;case te.PROC_INST:"?"===de?G.state=te.PROC_INST_ENDING:E(de)?G.state=te.PROC_INST_BODY:G.procInstName+=de;continue;case te.PROC_INST_BODY:if(!G.procInstBody&&E(de))continue;"?"===de?G.state=te.PROC_INST_ENDING:G.procInstBody+=de;continue;case te.PROC_INST_ENDING:">"===de?(ne(G,"onprocessinginstruction",{name:G.procInstName,body:G.procInstBody}),G.procInstName=G.procInstBody="",G.state=te.TEXT):(G.procInstBody+="?"+de,G.state=te.PROC_INST_BODY);continue;case te.OPEN_TAG:ae(I,de)?G.tagName+=de:(tt(G),">"===de?Le(G):"/"===de?G.state=te.OPEN_TAG_SLASH:(E(de)||Qe(G,"Invalid character in tag name"),G.state=te.ATTRIB));continue;case te.OPEN_TAG_SLASH:">"===de?(Le(G,!0),Ke(G)):(Qe(G,"Forward-slash in opening tag not followed by >"),G.state=te.ATTRIB);continue;case te.ATTRIB:if(E(de))continue;">"===de?Le(G):"/"===de?G.state=te.OPEN_TAG_SLASH:ae(ue,de)?(G.attribName=de,G.attribValue="",G.state=te.ATTRIB_NAME):Qe(G,"Invalid attribute name");continue;case te.ATTRIB_NAME:"="===de?G.state=te.ATTRIB_VALUE:">"===de?(Qe(G,"Attribute without value"),G.attribValue=G.attribName,ze(G),Le(G)):E(de)?G.state=te.ATTRIB_NAME_SAW_WHITE:ae(I,de)?G.attribName+=de:Qe(G,"Invalid attribute name");continue;case te.ATTRIB_NAME_SAW_WHITE:if("="===de)G.state=te.ATTRIB_VALUE;else{if(E(de))continue;Qe(G,"Attribute without value"),G.tag.attributes[G.attribName]="",G.attribValue="",ne(G,"onattribute",{name:G.attribName,value:""}),G.attribName="",">"===de?Le(G):ae(ue,de)?(G.attribName=de,G.state=te.ATTRIB_NAME):(Qe(G,"Invalid attribute name"),G.state=te.ATTRIB)}continue;case te.ATTRIB_VALUE:if(E(de))continue;$(de)?(G.q=de,G.state=te.ATTRIB_VALUE_QUOTED):(Qe(G,"Unquoted attribute value"),G.state=te.ATTRIB_VALUE_UNQUOTED,G.attribValue=de);continue;case te.ATTRIB_VALUE_QUOTED:if(de!==G.q){"&"===de?G.state=te.ATTRIB_VALUE_ENTITY_Q:G.attribValue+=de;continue}ze(G),G.q="",G.state=te.ATTRIB_VALUE_CLOSED;continue;case te.ATTRIB_VALUE_CLOSED:E(de)?G.state=te.ATTRIB:">"===de?Le(G):"/"===de?G.state=te.OPEN_TAG_SLASH:ae(ue,de)?(Qe(G,"No whitespace between attributes"),G.attribName=de,G.attribValue="",G.state=te.ATTRIB_NAME):Qe(G,"Invalid attribute name");continue;case te.ATTRIB_VALUE_UNQUOTED:if(!Z(de)){"&"===de?G.state=te.ATTRIB_VALUE_ENTITY_U:G.attribValue+=de;continue}ze(G),">"===de?Le(G):G.state=te.ATTRIB;continue;case te.CLOSE_TAG:if(G.tagName)">"===de?Ke(G):ae(I,de)?G.tagName+=de:G.script?(G.script+=""===de?Ke(G):Qe(G,"Invalid characters in closing tag");continue;case te.TEXT_ENTITY:case te.ATTRIB_VALUE_ENTITY_Q:case te.ATTRIB_VALUE_ENTITY_U:var pt,we;switch(G.state){case te.TEXT_ENTITY:pt=te.TEXT,we="textNode";break;case te.ATTRIB_VALUE_ENTITY_Q:pt=te.ATTRIB_VALUE_QUOTED,we="attribValue";break;case te.ATTRIB_VALUE_ENTITY_U:pt=te.ATTRIB_VALUE_UNQUOTED,we="attribValue"}";"===de?(G[we]+=Me(G),G.entity="",G.state=pt):ae(G.entity.length?K:O,de)?G.entity+=de:(Qe(G,"Invalid character in entity name"),G[we]+="&"+G.entity+de,G.entity="",G.state=pt);continue;default:throw new Error(G,"Unknown state: "+G.state)}return G.position>=G.bufferCheckPosition&&function(q){for(var G=Math.max(j.MAX_BUFFER_LENGTH,10),pe=0,de=0,je=k.length;deG)switch(k[de]){case"textNode":ye(q);break;case"cdata":ne(q,"oncdata",q.cdata),q.cdata="";break;case"script":ne(q,"onscript",q.script),q.script="";break;default:$e(q,"Max buffer length exceeded: "+k[de])}pe=Math.max(pe,_t)}q.bufferCheckPosition=j.MAX_BUFFER_LENGTH-pe+q.position}(G),G},resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){!function(q){ye(q),""!==q.cdata&&(ne(q,"oncdata",q.cdata),q.cdata=""),""!==q.script&&(ne(q,"onscript",q.script),q.script="")}(this)}};try{R=Y("stream").Stream}catch(q){R=function(){}}var T=j.EVENTS.filter(function(q){return"error"!==q&&"end"!==q});function y(q,G){if(!(this instanceof y))return new y(q,G);R.apply(this),this._parser=new Q(q,G),this.writable=!0,this.readable=!0;var pe=this;this._parser.onend=function(){pe.emit("end")},this._parser.onerror=function(de){pe.emit("error",de),pe._parser.error=null},this._decoder=null,T.forEach(function(de){Object.defineProperty(pe,"on"+de,{get:function(){return pe._parser["on"+de]},set:function(je){if(!je)return pe.removeAllListeners(de),pe._parser["on"+de]=je,je;pe.on(de,je)},enumerable:!0,configurable:!1})})}(y.prototype=Object.create(R.prototype,{constructor:{value:y}})).write=function(q){if("function"==typeof W&&"function"==typeof W.isBuffer&&W.isBuffer(q)){if(!this._decoder){var G=Y("string_decoder").StringDecoder;this._decoder=new G("utf8")}q=this._decoder.write(q)}return this._parser.write(q.toString()),this.emit("data",q),!0},y.prototype.end=function(q){return q&&q.length&&this.write(q),this._parser.end(),!0},y.prototype.on=function(q,G){var pe=this;return!pe._parser["on"+q]&&-1!==T.indexOf(q)&&(pe._parser["on"+q]=function(){var de=1===arguments.length?[arguments[0]]:Array.apply(null,arguments);de.splice(0,0,q),pe.emit.apply(pe,de)}),R.prototype.on.call(pe,q,G)};var z="http://www.w3.org/XML/1998/namespace",P="http://www.w3.org/2000/xmlns/",X={xml:z,xmlns:P},ue=/[:_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]/,I=/[:_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-]/,O=/[#:_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]/,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\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;function E(q){return" "===q||"\n"===q||"\r"===q||"\t"===q}function $(q){return'"'===q||"'"===q}function Z(q){return">"===q||E(q)}function ae(q,G){return q.test(G)}function oe(q,G){return!ae(q,G)}var q,G,pe,te=0;for(var Te in j.STATE={BEGIN:te++,BEGIN_WHITESPACE:te++,TEXT:te++,TEXT_ENTITY:te++,OPEN_WAKA:te++,SGML_DECL:te++,SGML_DECL_QUOTED:te++,DOCTYPE:te++,DOCTYPE_QUOTED:te++,DOCTYPE_DTD:te++,DOCTYPE_DTD_QUOTED:te++,COMMENT_STARTING:te++,COMMENT:te++,COMMENT_ENDING:te++,COMMENT_ENDED:te++,CDATA:te++,CDATA_ENDING:te++,CDATA_ENDING_2:te++,PROC_INST:te++,PROC_INST_BODY:te++,PROC_INST_ENDING:te++,OPEN_TAG:te++,OPEN_TAG_SLASH:te++,ATTRIB:te++,ATTRIB_NAME:te++,ATTRIB_NAME_SAW_WHITE:te++,ATTRIB_VALUE:te++,ATTRIB_VALUE_QUOTED:te++,ATTRIB_VALUE_CLOSED:te++,ATTRIB_VALUE_UNQUOTED:te++,ATTRIB_VALUE_ENTITY_Q:te++,ATTRIB_VALUE_ENTITY_U:te++,CLOSE_TAG:te++,CLOSE_TAG_SAW_WHITE:te++,SCRIPT:te++,SCRIPT_ENDING:te++},j.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},j.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(j.ENTITIES).forEach(function(q){var G=j.ENTITIES[q],pe="number"==typeof G?String.fromCharCode(G):G;j.ENTITIES[q]=pe}),j.STATE)j.STATE[j.STATE[Te]]=Te;function me(q,G,pe){q[G]&&q[G](pe)}function ne(q,G,pe){q.textNode&&ye(q),me(q,G,pe)}function ye(q){q.textNode=Oe(q.opt,q.textNode),q.textNode&&me(q,"ontext",q.textNode),q.textNode=""}function Oe(q,G){return q.trim&&(G=G.trim()),q.normalize&&(G=G.replace(/\s+/g," ")),G}function $e(q,G){return ye(q),q.trackPosition&&(G+="\nLine: "+q.line+"\nColumn: "+q.column+"\nChar: "+q.c),G=new Error(G),q.error=G,me(q,"onerror",G),q}function st(q){return q.sawRoot&&!q.closedRoot&&Qe(q,"Unclosed root tag"),q.state!==te.BEGIN&&q.state!==te.BEGIN_WHITESPACE&&q.state!==te.TEXT&&$e(q,"Unexpected end"),ye(q),q.c="",q.closed=!0,me(q,"onend"),Q.call(q,q.strict,q.opt),q}function Qe(q,G){if("object"!=typeof q||!(q instanceof Q))throw new Error("bad call to strictFail");q.strict&&$e(q,G)}function tt(q){q.strict||(q.tagName=q.tagName[q.looseCase]());var G=q.tags[q.tags.length-1]||q,pe=q.tag={name:q.tagName,attributes:{}};q.opt.xmlns&&(pe.ns=G.ns),q.attribList.length=0,ne(q,"onopentagstart",pe)}function Xe(q,G){var de=q.indexOf(":")<0?["",q]:q.split(":"),je=de[0],_t=de[1];return G&&"xmlns"===q&&(je="xmlns",_t=""),{prefix:je,local:_t}}function ze(q){if(q.strict||(q.attribName=q.attribName[q.looseCase]()),-1!==q.attribList.indexOf(q.attribName)||q.tag.attributes.hasOwnProperty(q.attribName))q.attribName=q.attribValue="";else{if(q.opt.xmlns){var G=Xe(q.attribName,!0),de=G.local;if("xmlns"===G.prefix)if("xml"===de&&q.attribValue!==z)Qe(q,"xml: prefix must be bound to "+z+"\nActual: "+q.attribValue);else if("xmlns"===de&&q.attribValue!==P)Qe(q,"xmlns: prefix must be bound to "+P+"\nActual: "+q.attribValue);else{var je=q.tag,_t=q.tags[q.tags.length-1]||q;je.ns===_t.ns&&(je.ns=Object.create(_t.ns)),je.ns[de]=q.attribValue}q.attribList.push([q.attribName,q.attribValue])}else q.tag.attributes[q.attribName]=q.attribValue,ne(q,"onattribute",{name:q.attribName,value:q.attribValue});q.attribName=q.attribValue=""}}function Le(q,G){if(q.opt.xmlns){var pe=q.tag,de=Xe(q.tagName);pe.prefix=de.prefix,pe.local=de.local,pe.uri=pe.ns[de.prefix]||"",pe.prefix&&!pe.uri&&(Qe(q,"Unbound namespace prefix: "+JSON.stringify(q.tagName)),pe.uri=de.prefix),pe.ns&&(q.tags[q.tags.length-1]||q).ns!==pe.ns&&Object.keys(pe.ns).forEach(function(In){ne(q,"onopennamespace",{prefix:In,uri:pe.ns[In]})});for(var _t=0,pt=q.attribList.length;_t",q.tagName="",void(q.state=te.SCRIPT);ne(q,"onscript",q.script),q.script=""}var G=q.tags.length,pe=q.tagName;q.strict||(pe=pe[q.looseCase]());for(var de=pe;G--&&q.tags[G].name!==de;)Qe(q,"Unexpected close tag");if(G<0)return Qe(q,"Unmatched closing tag: "+q.tagName),q.textNode+="",void(q.state=te.TEXT);q.tagName=pe;for(var _t=q.tags.length;_t-- >G;){var pt=q.tag=q.tags.pop();q.tagName=q.tag.name,ne(q,"onclosetag",q.tagName);var we={};for(var B in pt.ns)we[B]=pt.ns[B];q.opt.xmlns&&pt.ns!==(q.tags[q.tags.length-1]||q).ns&&Object.keys(pt.ns).forEach(function(V){ne(q,"onclosenamespace",{prefix:V,uri:pt.ns[V]})})}0===G&&(q.closedRoot=!0),q.tagName=q.attribValue=q.attribName="",q.attribList.length=0,q.state=te.TEXT}function Me(q){var de,G=q.entity,pe=G.toLowerCase(),je="";return q.ENTITIES[G]?q.ENTITIES[G]:q.ENTITIES[pe]?q.ENTITIES[pe]:("#"===(G=pe).charAt(0)&&("x"===G.charAt(1)?(G=G.slice(2),je=(de=parseInt(G,16)).toString(16)):(G=G.slice(1),je=(de=parseInt(G,10)).toString(10))),G=G.replace(/^0+/,""),isNaN(de)||je.toLowerCase()!==G?(Qe(q,"Invalid character entity"),"&"+q.entity+";"):String.fromCodePoint(de))}function Ue(q,G){"<"===G?(q.state=te.OPEN_WAKA,q.startTagPosition=q.position):E(G)||(Qe(q,"Non-whitespace before first tag."),q.textNode=G,q.state=te.TEXT)}function qe(q,G){var pe="";return G1114111||G(V)!==V)throw RangeError("Invalid code point: "+V);V<=65535?je.push(V):je.push(55296+((V-=65536)>>10),V%1024+56320),(we+1===B||je.length>de)&&(N+=q.apply(null,je),je.length=0)}return N},Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:pe,configurable:!0,writable:!0}):String.fromCodePoint=pe)}(void 0===he?this.sax={}:he)}).call(this)}).call(this,Y("buffer").Buffer)},{buffer:6,stream:87,string_decoder:5}],86:[function(Y,Se,he){(function(W,j){(function(){!function(k,Q){"use strict";if(!k.setImmediate){var T,H=1,v={},C=!1,R=k.document,K=Object.getPrototypeOf&&Object.getPrototypeOf(k);K=K&&K.setTimeout?K:k,"[object process]"==={}.toString.call(k.process)?T=function(E){W.nextTick(function(){A(E)})}:function(){if(k.postMessage&&!k.importScripts){var E=!0,$=k.onmessage;return k.onmessage=function(){E=!1},k.postMessage("","*"),k.onmessage=$,E}}()?(E="setImmediate$"+Math.random()+"$",$=function(Z){Z.source===k&&"string"==typeof Z.data&&0===Z.data.indexOf(E)&&A(+Z.data.slice(E.length))},k.addEventListener?k.addEventListener("message",$,!1):k.attachEvent("onmessage",$),T=function(Z){k.postMessage(E+Z,"*")}):k.MessageChannel?function(){var E=new MessageChannel;E.port1.onmessage=function($){A($.data)},T=function($){E.port2.postMessage($)}}():R&&"onreadystatechange"in R.createElement("script")?function(){var E=R.documentElement;T=function($){var Z=R.createElement("script");Z.onreadystatechange=function(){A($),Z.onreadystatechange=null,E.removeChild(Z),Z=null},E.appendChild(Z)}}():T=function(E){setTimeout(A,0,E)},K.setImmediate=function(E){"function"!=typeof E&&(E=new Function(""+E));for(var $=new Array(arguments.length-1),Z=0;Z<$.length;Z++)$[Z]=arguments[Z+1];return v[H]={callback:E,args:$},T(H),H++},K.clearImmediate=y}var E,$;function y(E){delete v[E]}function A(E){if(C)setTimeout(A,0,E);else{var $=v[E];if($){C=!0;try{!function(E){var $=E.callback,Z=E.args;switch(Z.length){case 0:$();break;case 1:$(Z[0]);break;case 2:$(Z[0],Z[1]);break;case 3:$(Z[0],Z[1],Z[2]);break;default:$.apply(void 0,Z)}}($)}finally{y(E),C=!1}}}}}("undefined"==typeof self?void 0===j?this:j:self)}).call(this)}).call(this,Y("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:44}],87:[function(Y,Se,he){Se.exports=k;var W=Y("events").EventEmitter;function k(){W.call(this)}Y("inherits")(k,W),k.Readable=Y("readable-stream/lib/_stream_readable.js"),k.Writable=Y("readable-stream/lib/_stream_writable.js"),k.Duplex=Y("readable-stream/lib/_stream_duplex.js"),k.Transform=Y("readable-stream/lib/_stream_transform.js"),k.PassThrough=Y("readable-stream/lib/_stream_passthrough.js"),k.finished=Y("readable-stream/lib/internal/streams/end-of-stream.js"),k.pipeline=Y("readable-stream/lib/internal/streams/pipeline.js"),k.Stream=k,k.prototype.pipe=function(Q,H){var v=this;function C(z){Q.writable&&!1===Q.write(z)&&v.pause&&v.pause()}function R(){v.readable&&v.resume&&v.resume()}v.on("data",C),Q.on("drain",R),!Q._isStdio&&(!H||!1!==H.end)&&(v.on("end",b),v.on("close",y));var T=!1;function b(){T||(T=!0,Q.end())}function y(){T||(T=!0,"function"==typeof Q.destroy&&Q.destroy())}function S(z){if(A(),0===W.listenerCount(this,"error"))throw z}function A(){v.removeListener("data",C),Q.removeListener("drain",R),v.removeListener("end",b),v.removeListener("close",y),v.removeListener("error",S),Q.removeListener("error",S),v.removeListener("end",A),v.removeListener("close",A),Q.removeListener("close",A)}return v.on("error",S),Q.on("error",S),v.on("end",A),v.on("close",A),Q.on("close",A),Q.emit("pipe",v),Q}},{events:8,inherits:10,"readable-stream/lib/_stream_duplex.js":68,"readable-stream/lib/_stream_passthrough.js":69,"readable-stream/lib/_stream_readable.js":70,"readable-stream/lib/_stream_transform.js":71,"readable-stream/lib/_stream_writable.js":72,"readable-stream/lib/internal/streams/end-of-stream.js":76,"readable-stream/lib/internal/streams/pipeline.js":78}],88:[function(Y,Se,he){arguments[4][5][0].apply(he,arguments)},{dup:5,"safe-buffer":84}],89:[function(Y,Se,he){(function(W,j){(function(){var k=Y("process/browser.js").nextTick,Q=Function.prototype.apply,H=Array.prototype.slice,v={},C=0;function R(T,b){this._id=T,this._clearFn=b}he.setTimeout=function(){return new R(Q.call(setTimeout,window,arguments),clearTimeout)},he.setInterval=function(){return new R(Q.call(setInterval,window,arguments),clearInterval)},he.clearTimeout=he.clearInterval=function(T){T.close()},R.prototype.unref=R.prototype.ref=function(){},R.prototype.close=function(){this._clearFn.call(window,this._id)},he.enroll=function(T,b){clearTimeout(T._idleTimeoutId),T._idleTimeout=b},he.unenroll=function(T){clearTimeout(T._idleTimeoutId),T._idleTimeout=-1},he._unrefActive=he.active=function(T){clearTimeout(T._idleTimeoutId);var b=T._idleTimeout;b>=0&&(T._idleTimeoutId=setTimeout(function(){T._onTimeout&&T._onTimeout()},b))},he.setImmediate="function"==typeof W?W:function(T){var b=C++,y=!(arguments.length<2)&&H.call(arguments,1);return v[b]=!0,k(function(){v[b]&&(y?T.apply(null,y):T.call(null),he.clearImmediate(b))}),b},he.clearImmediate="function"==typeof j?j:function(T){delete v[T]}}).call(this)}).call(this,Y("timers").setImmediate,Y("timers").clearImmediate)},{"process/browser.js":44,timers:89}],90:[function(Y,Se,he){(function(W){(function(){function k(Q){try{if(!W.localStorage)return!1}catch(v){return!1}var H=W.localStorage[Q];return null!=H&&"true"===String(H).toLowerCase()}Se.exports=function(Q,H){if(k("noDeprecation"))return Q;var v=!1;return function(){if(!v){if(k("throwDeprecation"))throw new Error(H);k("traceDeprecation")?console.trace(H):console.warn(H),v=!0}return Q.apply(this,arguments)}}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],91:[function(Y,Se,he){"use strict";Se.exports=function(W){W.prototype[Symbol.iterator]=function*(){for(let j=this.head;j;j=j.next)yield j.value}}},{}],92:[function(Y,Se,he){"use strict";function W(v){var C=this;if(C instanceof W||(C=new W),C.tail=null,C.head=null,C.length=0,v&&"function"==typeof v.forEach)v.forEach(function(b){C.push(b)});else if(arguments.length>0)for(var R=0,T=arguments.length;R1)R=C;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");T=this.head.next,R=this.head.value}for(var b=0;null!==T;b++)R=v(R,T.value,b),T=T.next;return R},W.prototype.reduceReverse=function(v,C){var R,T=this.tail;if(arguments.length>1)R=C;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");T=this.tail.prev,R=this.tail.value}for(var b=this.length-1;null!==T;b--)R=v(R,T.value,b),T=T.prev;return R},W.prototype.toArray=function(){for(var v=new Array(this.length),C=0,R=this.head;null!==R;C++)v[C]=R.value,R=R.next;return v},W.prototype.toArrayReverse=function(){for(var v=new Array(this.length),C=0,R=this.tail;null!==R;C++)v[C]=R.value,R=R.prev;return v},W.prototype.slice=function(v,C){(C=C||this.length)<0&&(C+=this.length),(v=v||0)<0&&(v+=this.length);var R=new W;if(Cthis.length&&(C=this.length);for(var T=0,b=this.head;null!==b&&Tthis.length&&(C=this.length);for(var T=this.length,b=this.tail;null!==b&&T>C;T--)b=b.prev;for(;null!==b&&T>v;T--,b=b.prev)R.push(b.value);return R},W.prototype.splice=function(v,C,...R){v>this.length&&(v=this.length-1),v<0&&(v=this.length+v);for(var T=0,b=this.head;null!==b&&T{"use strict";Ut.exports=et,Ut.exports.default=et;var it=1e20;function et(Y,Se,he,W,j,k){this.fontSize=Y||24,this.buffer=void 0===Se?3:Se,this.cutoff=W||.25,this.fontFamily=j||"sans-serif",this.fontWeight=k||"normal",this.radius=he||8;var Q=this.size=this.fontSize+2*this.buffer,H=Q+2*this.buffer;this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=Q,this.ctx=this.canvas.getContext("2d"),this.ctx.font=this.fontWeight+" "+this.fontSize+"px "+this.fontFamily,this.ctx.textAlign="left",this.ctx.fillStyle="black",this.gridOuter=new Float64Array(H*H),this.gridInner=new Float64Array(H*H),this.f=new Float64Array(H),this.z=new Float64Array(H+1),this.v=new Uint16Array(H),this.useMetrics=void 0!==this.ctx.measureText("A").actualBoundingBoxLeft,this.middle=Math.round(Q/2*(navigator.userAgent.indexOf("Gecko/")>=0?1.2:1))}function Dt(Y,Se,he,W,j,k){for(var Q=0;Q-1);k[++v]=H,Q[v]=C,Q[v+1]=it}for(H=0,v=0;H{Ut.exports=function(et,yt){var ee=yt.length;if(0!==ee){var Dt=et.length;et.length+=ee;for(var dt=0;dt{"use strict";var yt=(()=>{return(Dt=yt||(yt={})).typeOfFunction="function",Dt.boolTrue=!0,yt;var Dt})();function ee(Dt,dt,Y){if(!Y||typeof Y.value!==yt.typeOfFunction)throw new TypeError("Only methods can be decorated with @bind. <"+dt+"> is not a method!");return{configurable:yt.boolTrue,get:function(){var Se=Y.value.bind(this);return Object.defineProperty(this,dt,{value:Se,configurable:yt.boolTrue,writable:yt.boolTrue}),Se}}}it.ak=ee,it.ZP=ee},7266:(Ut,it,et)=>{Ut.exports={ResizeSensor:et(9835),ElementQueries:et(4845)}},4845:function(Ut,it,et){"use strict";var yt,ee,Dt;"undefined"!=typeof window&&window,ee=[et(9835)],void 0!==(Dt="function"==typeof(yt=function(dt){var Y=function(){var he,W={},j=[];function k(I){I||(I=document.documentElement);var O=window.getComputedStyle(I,null).fontSize;return parseFloat(O)||16}function H(I,O){var K=O.split(/\d/),E=K[K.length-1];switch(O=parseFloat(O),E){case"px":return O;case"em":return O*k(I);case"rem":return O*k();case"vw":return O*document.documentElement.clientWidth/100;case"vh":return O*document.documentElement.clientHeight/100;case"vmin":case"vmax":var $=document.documentElement.clientWidth/100,Z=document.documentElement.clientHeight/100;return O*(0,Math["vmin"===E?"min":"max"])($,Z);default:return O}}function v(I,O){this.element=I;var K,E,$,Z,ae,oe,te,Te,me=["min-width","min-height","max-width","max-height"];this.call=function(){for(K in $=function(I){if(!I.getBoundingClientRect)return{width:I.offsetWidth,height:I.offsetHeight};var O=I.getBoundingClientRect();return{width:Math.round(O.width),height:Math.round(O.height)}}(this.element),oe={},W[O])!W[O].hasOwnProperty(K)||(Z=H(this.element,(E=W[O][K]).value),ae="width"===E.property?$.width:$.height,te="","min"===E.mode&&ae>=Z&&(te+=E.value),"max"===E.mode&&ae<=Z&&(te+=E.value),oe[Te=E.mode+"-"+E.property]||(oe[Te]=""),te&&-1===(" "+oe[Te]+" ").indexOf(" "+te+" ")&&(oe[Te]+=" "+te));for(var ne in me)!me.hasOwnProperty(ne)||(oe[me[ne]]?this.element.setAttribute(me[ne],oe[me[ne]].substr(1)):this.element.removeAttribute(me[ne]))}}function C(I,O){I.elementQueriesSetupInformation||(I.elementQueriesSetupInformation=new v(I,O)),I.elementQueriesSensor||(I.elementQueriesSensor=new dt(I,function(){I.elementQueriesSetupInformation.call()}))}function R(I,O,K,E){if(void 0===W[I]){W[I]=[];var $=j.length;he.innerHTML+="\n"+I+" {animation: 0.1s element-queries;}",he.innerHTML+="\n"+I+" > .resize-sensor {min-width: "+$+"px;}",j.push(I)}W[I].push({mode:O,property:K,value:E})}function T(I){var O;if(document.querySelectorAll&&(O=I?I.querySelectorAll.bind(I):document.querySelectorAll.bind(document)),!O&&"undefined"!=typeof $$&&(O=$$),!O&&"undefined"!=typeof jQuery&&(O=jQuery),!O)throw"No document.querySelectorAll, jQuery or Mootools's $$ found.";return O}function y(I){var O=[],K=[],E=[],$=0,Z=-1,ae=[];for(var oe in I.children)if(I.children.hasOwnProperty(oe)&&I.children[oe].tagName&&"img"===I.children[oe].tagName.toLowerCase()){O.push(I.children[oe]);var te=I.children[oe].getAttribute("min-width")||I.children[oe].getAttribute("data-min-width"),Te=I.children[oe].getAttribute("data-src")||I.children[oe].getAttribute("url");E.push(Te),K.push({minWidth:te}),te?I.children[oe].style.display="none":($=O.length-1,I.children[oe].style.display="block")}function ne(){var Oe,ye=!1;for(Oe in O)!O.hasOwnProperty(Oe)||K[Oe].minWidth&&I.offsetWidth>K[Oe].minWidth&&(ye=Oe);if(ye||(ye=$),Z!==ye)if(ae[ye])O[Z].style.display="none",O[ye].style.display="block",Z=ye;else{var $e=new Image;$e.onload=function(){O[ye].src=E[ye],O[Z].style.display="none",O[ye].style.display="block",ae[ye]=!0,Z=ye},$e.src=E[ye]}else O[ye].src=E[ye]}Z=$,I.resizeSensorInstance=new dt(I,ne),ne()}var A=/,?[\s\t]*([^,\n]*?)((?:\[[\s\t]*?(?:min|max)-(?:width|height)[\s\t]*?[~$\^]?=[\s\t]*?"[^"]*?"[\s\t]*?])+)([^,\n\s\{]*)/gim,z=/\[[\s\t]*?(min|max)-(width|height)[\s\t]*?[~$\^]?=[\s\t]*?"([^"]*?)"[\s\t]*?]/gim;function P(I){var O,K,E,$;for(I=I.replace(/'/g,'"');null!==(O=A.exec(I));)for(K=O[1]+O[3],E=O[2];null!==($=z.exec(E));)R(K,$[1],$[2],$[3])}function X(I){var O="";if(I)if("string"==typeof I)(-1!==(I=I.toLowerCase()).indexOf("min-width")||-1!==I.indexOf("max-width"))&&P(I);else for(var K=0,E=I.length;K 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),ue=!0);for(var O=0,K=document.styleSheets.length;O{var yt=et(3910),ee=et(9369),Dt=et(322);function dt(Q,H,v){if(!yt(Q))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(!Q.hasNode(H))throw new Error('graphology-shortest-path: the "'+H+'" source node does not exist in the given graph.');if(!Q.hasNode(v))throw new Error('graphology-shortest-path: the "'+v+'" target node does not exist in the given graph.');if((H=""+H)==(v=""+v))return[H];var C=Q.inboundNeighbors.bind(Q),R=Q.outboundNeighbors.bind(Q),T={},b={};T[H]=null,b[v]=null;var A,z,P,X,ue,I,O,K,y=[H],S=[v],E=!1;e:for(;y.length&&S.length;)if(y.length<=S.length){for(A=y,y=[],ue=0,O=A.length;ue{Ut.exports=function(et){return null!==et&&"object"==typeof et&&"function"==typeof et.addUndirectedEdgeWithKey&&"function"==typeof et.dropNode&&"boolean"==typeof et.multi}},698:function(Ut){Ut.exports=function(){"use strict";function it(re){return(it="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(fe){return typeof fe}:function(fe){return fe&&"function"==typeof Symbol&&fe.constructor===Symbol&&fe!==Symbol.prototype?"symbol":typeof fe})(re)}function et(re,fe){re.prototype=Object.create(fe.prototype),re.prototype.constructor=re,ee(re,fe)}function yt(re){return(yt=Object.setPrototypeOf?Object.getPrototypeOf:function(fe){return fe.__proto__||Object.getPrototypeOf(fe)})(re)}function ee(re,fe){return(ee=Object.setPrototypeOf||function(se,M){return se.__proto__=M,se})(re,fe)}function Dt(){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(re){return!1}}function dt(re,fe,se){return(dt=Dt()?Reflect.construct:function(M,L,J){var Ee=[null];Ee.push.apply(Ee,L);var Fe=new(Function.bind.apply(M,Ee));return J&&ee(Fe,J.prototype),Fe}).apply(null,arguments)}function Y(re){var fe="function"==typeof Map?new Map:void 0;return(Y=function(se){if(null===se||-1===Function.toString.call(se).indexOf("[native code]"))return se;if("function"!=typeof se)throw new TypeError("Super expression must either be null or a function");if(void 0!==fe){if(fe.has(se))return fe.get(se);fe.set(se,L)}function L(){return dt(se,arguments,yt(this).constructor)}return L.prototype=Object.create(se.prototype,{constructor:{value:L,enumerable:!1,writable:!0,configurable:!0}}),ee(L,se)})(re)}function Se(re){if(void 0===re)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return re}var he=function(){for(var re=arguments[0],fe=1,se=arguments.length;fe0&&Ee.length>L&&!Ee.warned){Ee.warned=!0;var nt=new Error("Possible EventEmitter memory leak detected. "+Ee.length+" "+String(fe)+" listeners added. Use emitter.setMaxListeners() to increase limit");nt.name="MaxListenersExceededWarning",nt.emitter=re,nt.type=fe,nt.count=Ee.length,console&&console.warn&&console.warn(nt)}return re}function I(){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(re,fe,se){var M={fired:!1,wrapFn:void 0,target:re,type:fe,listener:se},L=I.bind(M);return L.listener=se,M.wrapFn=L,L}function K(re,fe,se){var M=re._events;if(void 0===M)return[];var L=M[fe];return void 0===L?[]:"function"==typeof L?se?[L.listener||L]:[L]:se?function(J){for(var Ee=new Array(J.length),Fe=0;Fe0&&(J=fe[0]),J instanceof Error)throw J;var Ee=new Error("Unhandled error."+(J?" ("+J.message+")":""));throw Ee.context=J,Ee}var Fe=L[re];if(void 0===Fe)return!1;if("function"==typeof Fe)y(Fe,this,fe);else{var nt=Fe.length,Pt=$(Fe,nt);for(se=0;se=0;J--)if(se[J]===fe||se[J].listener===fe){Ee=se[J].listener,L=J;break}if(L<0)return this;0===L?se.shift():function(Fe,nt){for(;nt+1=0;M--)this.removeListener(re,fe[M]);return this},A.prototype.listeners=function(re){return K(this,re,!0)},A.prototype.rawListeners=function(re){return K(this,re,!1)},A.listenerCount=function(re,fe){return"function"==typeof re.listenerCount?re.listenerCount(fe):E.call(re,fe)},A.prototype.listenerCount=E,A.prototype.eventNames=function(){return this._eventsCount>0?R(this._events):[]},ae.prototype.next=function(){if(this.done)return{done:!0};var re=this._next();return re.done&&(this.done=!0),re},"undefined"!=typeof Symbol&&(ae.prototype[Symbol.iterator]=function(){return this}),ae.of=function(){var re=arguments,fe=re.length,se=0;return new ae(function(){return se>=fe?{done:!0}:{done:!1,value:re[se++]}})},ae.empty=function(){var re=new ae(null);return re.done=!0,re},ae.is=function(re){return re instanceof ae||"object"==typeof re&&null!==re&&"function"==typeof re.next};var oe=ae,te=function(re,fe){for(var se,M=arguments.length>1?fe:1/0,L=M!==1/0?new Array(M):[],J=0;;){if(J===M)return L;if((se=re.next()).done)return J!==fe?L.slice(0,J):L;L[J++]=se.value}},Te=function(re){function fe(se,M){var L;return(L=re.call(this)||this).name="GraphError",L.message=se||"",L.data=M||{},L}return et(fe,re),fe}(Y(Error)),me=function(re){function fe(se,M){var L;return(L=re.call(this,se,M)||this).name="InvalidArgumentsGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(Se(L),fe.prototype.constructor),L}return et(fe,re),fe}(Te),ne=function(re){function fe(se,M){var L;return(L=re.call(this,se,M)||this).name="NotFoundGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(Se(L),fe.prototype.constructor),L}return et(fe,re),fe}(Te),ye=function(re){function fe(se,M){var L;return(L=re.call(this,se,M)||this).name="UsageGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(Se(L),fe.prototype.constructor),L}return et(fe,re),fe}(Te);function Oe(re,fe){this.key=re,this.attributes=fe,this.inDegree=0,this.outDegree=0,this.undirectedDegree=0,this.directedSelfLoops=0,this.undirectedSelfLoops=0,this.in={},this.out={},this.undirected={}}function $e(re,fe){this.key=re,this.attributes=fe,this.inDegree=0,this.outDegree=0,this.directedSelfLoops=0,this.in={},this.out={}}function st(re,fe){this.key=re,this.attributes=fe,this.undirectedDegree=0,this.undirectedSelfLoops=0,this.undirected={}}function Qe(re,fe,se,M,L,J){this.key=fe,this.attributes=J,this.undirected=re,this.source=M,this.target=L,this.generatedKey=se}function tt(re,fe,se,M,L,J,Ee){var Fe,nt,Pt="out",We="in";if(fe&&(Pt=We="undirected"),re.multi){if(void 0===(nt=(Fe=J[Pt])[L])&&(nt=new Set,Fe[L]=nt),nt.add(se),M===L&&fe)return;void 0===(Fe=Ee[We])[M]&&(Fe[M]=nt)}else{if(J[Pt][L]=se,M===L&&fe)return;Ee[We][M]=se}}function Xe(re,fe,se){var M=re.multi,L=se.source,J=se.target,Ee=L.key,Fe=J.key,nt=L[fe?"undirected":"out"],Pt=fe?"undirected":"in";if(Fe in nt)if(M){var We=nt[Fe];1===We.size?(delete nt[Fe],delete J[Pt][Ee]):We.delete(se)}else delete nt[Fe];M||delete J[Pt][Ee]}$e.prototype.upgradeToMixed=function(){this.undirectedDegree=0,this.undirectedSelfLoops=0,this.undirected={}},st.prototype.upgradeToMixed=function(){this.inDegree=0,this.outDegree=0,this.directedSelfLoops=0,this.in={},this.out={}};var ze=[{name:function(re){return"get".concat(re,"Attribute")},attacher:function(re,fe,se){re.prototype[fe]=function(M,L){var J;if("mixed"!==this.type&&"mixed"!==se&&se!==this.type)throw new ye("Graph.".concat(fe,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new ye("Graph.".concat(fe,": 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 Ee=""+M,Fe=""+L;if(L=arguments[2],!(J=W(this,Ee,Fe,se)))throw new ne("Graph.".concat(fe,': could not find an edge for the given path ("').concat(Ee,'" - "').concat(Fe,'").'))}else if(!(J=this._edges.get(M=""+M)))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" edge in the graph.'));if("mixed"!==se&&J.undirected!==("undirected"===se))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" ').concat(se," edge in the graph."));return J.attributes[L]}}},{name:function(re){return"get".concat(re,"Attributes")},attacher:function(re,fe,se){re.prototype[fe]=function(M){var L;if("mixed"!==this.type&&"mixed"!==se&&se!==this.type)throw new ye("Graph.".concat(fe,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>1){if(this.multi)throw new ye("Graph.".concat(fe,": 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 J=""+M,Ee=""+arguments[1];if(!(L=W(this,J,Ee,se)))throw new ne("Graph.".concat(fe,': could not find an edge for the given path ("').concat(J,'" - "').concat(Ee,'").'))}else if(!(L=this._edges.get(M=""+M)))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" edge in the graph.'));if("mixed"!==se&&L.undirected!==("undirected"===se))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" ').concat(se," edge in the graph."));return L.attributes}}},{name:function(re){return"has".concat(re,"Attribute")},attacher:function(re,fe,se){re.prototype[fe]=function(M,L){var J;if("mixed"!==this.type&&"mixed"!==se&&se!==this.type)throw new ye("Graph.".concat(fe,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new ye("Graph.".concat(fe,": 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 Ee=""+M,Fe=""+L;if(L=arguments[2],!(J=W(this,Ee,Fe,se)))throw new ne("Graph.".concat(fe,': could not find an edge for the given path ("').concat(Ee,'" - "').concat(Fe,'").'))}else if(!(J=this._edges.get(M=""+M)))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" edge in the graph.'));if("mixed"!==se&&J.undirected!==("undirected"===se))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" ').concat(se," edge in the graph."));return J.attributes.hasOwnProperty(L)}}},{name:function(re){return"set".concat(re,"Attribute")},attacher:function(re,fe,se){re.prototype[fe]=function(M,L,J){var Ee;if("mixed"!==this.type&&"mixed"!==se&&se!==this.type)throw new ye("Graph.".concat(fe,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>3){if(this.multi)throw new ye("Graph.".concat(fe,": 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=""+M,nt=""+L;if(L=arguments[2],J=arguments[3],!(Ee=W(this,Fe,nt,se)))throw new ne("Graph.".concat(fe,': could not find an edge for the given path ("').concat(Fe,'" - "').concat(nt,'").'))}else if(!(Ee=this._edges.get(M=""+M)))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" edge in the graph.'));if("mixed"!==se&&Ee.undirected!==("undirected"===se))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" ').concat(se," edge in the graph."));return Ee.attributes[L]=J,this.emit("edgeAttributesUpdated",{key:Ee.key,type:"set",attributes:Ee.attributes,name:L}),this}}},{name:function(re){return"update".concat(re,"Attribute")},attacher:function(re,fe,se){re.prototype[fe]=function(M,L,J){var Ee;if("mixed"!==this.type&&"mixed"!==se&&se!==this.type)throw new ye("Graph.".concat(fe,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>3){if(this.multi)throw new ye("Graph.".concat(fe,": 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=""+M,nt=""+L;if(L=arguments[2],J=arguments[3],!(Ee=W(this,Fe,nt,se)))throw new ne("Graph.".concat(fe,': could not find an edge for the given path ("').concat(Fe,'" - "').concat(nt,'").'))}else if(!(Ee=this._edges.get(M=""+M)))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" edge in the graph.'));if("function"!=typeof J)throw new me("Graph.".concat(fe,": updater should be a function."));if("mixed"!==se&&Ee.undirected!==("undirected"===se))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" ').concat(se," edge in the graph."));return Ee.attributes[L]=J(Ee.attributes[L]),this.emit("edgeAttributesUpdated",{key:Ee.key,type:"set",attributes:Ee.attributes,name:L}),this}}},{name:function(re){return"remove".concat(re,"Attribute")},attacher:function(re,fe,se){re.prototype[fe]=function(M,L){var J;if("mixed"!==this.type&&"mixed"!==se&&se!==this.type)throw new ye("Graph.".concat(fe,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new ye("Graph.".concat(fe,": 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 Ee=""+M,Fe=""+L;if(L=arguments[2],!(J=W(this,Ee,Fe,se)))throw new ne("Graph.".concat(fe,': could not find an edge for the given path ("').concat(Ee,'" - "').concat(Fe,'").'))}else if(!(J=this._edges.get(M=""+M)))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" edge in the graph.'));if("mixed"!==se&&J.undirected!==("undirected"===se))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" ').concat(se," edge in the graph."));return delete J.attributes[L],this.emit("edgeAttributesUpdated",{key:J.key,type:"remove",attributes:J.attributes,name:L}),this}}},{name:function(re){return"replace".concat(re,"Attributes")},attacher:function(re,fe,se){re.prototype[fe]=function(M,L){var J;if("mixed"!==this.type&&"mixed"!==se&&se!==this.type)throw new ye("Graph.".concat(fe,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new ye("Graph.".concat(fe,": 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 Ee=""+M,Fe=""+L;if(L=arguments[2],!(J=W(this,Ee,Fe,se)))throw new ne("Graph.".concat(fe,': could not find an edge for the given path ("').concat(Ee,'" - "').concat(Fe,'").'))}else if(!(J=this._edges.get(M=""+M)))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" edge in the graph.'));if(!k(L))throw new me("Graph.".concat(fe,": provided attributes are not a plain object."));if("mixed"!==se&&J.undirected!==("undirected"===se))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" ').concat(se," edge in the graph."));return J.attributes=L,this.emit("edgeAttributesUpdated",{key:J.key,type:"replace",attributes:J.attributes}),this}}},{name:function(re){return"merge".concat(re,"Attributes")},attacher:function(re,fe,se){re.prototype[fe]=function(M,L){var J;if("mixed"!==this.type&&"mixed"!==se&&se!==this.type)throw new ye("Graph.".concat(fe,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new ye("Graph.".concat(fe,": 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 Ee=""+M,Fe=""+L;if(L=arguments[2],!(J=W(this,Ee,Fe,se)))throw new ne("Graph.".concat(fe,': could not find an edge for the given path ("').concat(Ee,'" - "').concat(Fe,'").'))}else if(!(J=this._edges.get(M=""+M)))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" edge in the graph.'));if(!k(L))throw new me("Graph.".concat(fe,": provided attributes are not a plain object."));if("mixed"!==se&&J.undirected!==("undirected"===se))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" ').concat(se," edge in the graph."));return he(J.attributes,L),this.emit("edgeAttributesUpdated",{key:J.key,type:"merge",attributes:J.attributes,data:L}),this}}}],Le=oe,Ke=function(){var re,fe=arguments,se=-1;return new Le(function M(){if(!re){if(++se>=fe.length)return{done:!0};re=fe[se]}var L=re.next();return L.done?(re=null,M()):L})},Me=[{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(re,fe){for(var se in fe)re.push(fe[se].key)}function qe(re,fe){for(var se in fe)fe[se].forEach(function(M){return re.push(M.key)})}function ke(re,fe,se){for(var M in re)if(M!==se){var L=re[M];fe(L.key,L.attributes,L.source.key,L.target.key,L.source.attributes,L.target.attributes,L.undirected,L.generatedKey)}}function q(re,fe,se){for(var M in re)M!==se&&re[M].forEach(function(L){return fe(L.key,L.attributes,L.source.key,L.target.key,L.source.attributes,L.target.attributes,L.undirected,L.generatedKey)})}function G(re,fe,se){for(var M in re)if(M!==se){var L=re[M];if(fe(L.key,L.attributes,L.source.key,L.target.key,L.source.attributes,L.target.attributes,L.undirected,L.generatedKey))return!0}return!1}function pe(re,fe,se){var M,L,J,Ee,Fe;for(var nt in re)if(nt!==se)for(M=re[nt].values();!0!==(L=M.next()).done;)if(Ee=(J=L.value).source,fe(J.key,J.attributes,Ee.key,(Fe=J.target).key,Ee.attributes,Fe.attributes,J.undirected,J.generatedKey))return!0;return!1}function de(re,fe){var se=Object.keys(re),M=se.length,L=null,J=0;return new oe(function Ee(){var Fe;if(L){var nt=L.next();if(nt.done)return L=null,J++,Ee();Fe=nt.value}else{if(J>=M)return{done:!0};var Pt=se[J];if(Pt===fe)return J++,Ee();if((Fe=re[Pt])instanceof Set)return L=Fe.values(),Ee();J++}return{done:!1,value:[Fe.key,Fe.attributes,Fe.source.key,Fe.target.key,Fe.source.attributes,Fe.target.attributes]}})}function je(re,fe,se){var M=fe[se];M&&re.push(M.key)}function _t(re,fe,se){var M=fe[se];M&&M.forEach(function(L){return re.push(L.key)})}function pt(re,fe,se){var M=re[fe];if(M){var L=M.source,J=M.target;se(M.key,M.attributes,L.key,J.key,L.attributes,J.attributes,M.undirected,M.generatedKey)}}function we(re,fe,se){var M=re[fe];M&&M.forEach(function(L){return se(L.key,L.attributes,L.source.key,L.target.key,L.source.attributes,L.target.attributes,L.undirected,L.generatedKey)})}function B(re,fe,se){var M=re[fe];if(M){var L=M.source,J=M.target;return se(M.key,M.attributes,L.key,J.key,L.attributes,J.attributes,M.undirected,M.generatedKey)}}function N(re,fe,se){var M=re[fe];if(M){for(var L,J,Ee=M.values();!0!==(L=Ee.next()).done;)if(se((J=L.value).key,J.attributes,J.source.key,J.target.key,J.source.attributes,J.target.attributes,J.undirected,J.generatedKey))return!0;return!1}}function V(re,fe){var se=re[fe];if(se instanceof Set){var M=se.values();return new oe(function(){var L=M.next();if(L.done)return L;var J=L.value;return{done:!1,value:[J.key,J.attributes,J.source.key,J.target.key,J.source.attributes,J.target.attributes]}})}return oe.of([se.key,se.attributes,se.source.key,se.target.key,se.source.attributes,se.target.attributes])}function Re(re,fe){if(0===re.size)return[];if("mixed"===fe||fe===re.type)return"function"==typeof Array.from?Array.from(re._edges.keys()):te(re._edges.keys(),re._edges.size);for(var se,M,J=new Array("undirected"===fe?re.undirectedSize:re.directedSize),Ee="undirected"===fe,Fe=re._edges.values(),nt=0;!0!==(se=Fe.next()).done;)(M=se.value).undirected===Ee&&(J[nt++]=M.key);return J}function Ze(re,fe,se){if(0!==re.size)for(var M,L,J="mixed"!==fe&&fe!==re.type,Ee="undirected"===fe,Fe=re._edges.values();!0!==(M=Fe.next()).done;)if(L=M.value,!J||L.undirected===Ee){var qt=L.source,St=L.target;se(L.key,L.attributes,qt.key,St.key,qt.attributes,St.attributes,L.undirected,L.generatedKey)}}function Tt(re,fe,se){if(0!==re.size)for(var M,L,J="mixed"!==fe&&fe!==re.type,Ee="undirected"===fe,Fe=re._edges.values();!0!==(M=Fe.next()).done;)if(L=M.value,!J||L.undirected===Ee){var qt=L.source,St=L.target;if(se(L.key,L.attributes,qt.key,St.key,qt.attributes,St.attributes,L.undirected,L.generatedKey))break}}function kt(re,fe){if(0===re.size)return oe.empty();var se="mixed"!==fe&&fe!==re.type,M="undirected"===fe,L=re._edges.values();return new oe(function(){for(var J,Ee;;){if((J=L.next()).done)return J;if(Ee=J.value,!se||Ee.undirected===M)break}return{value:[Ee.key,Ee.attributes,Ee.source.key,Ee.target.key,Ee.source.attributes,Ee.target.attributes],done:!1}})}function In(re,fe,se,M){var L=[],J=re?qe:Ue;return"undirected"!==fe&&("out"!==se&&J(L,M.in),"in"!==se&&J(L,M.out),!se&&M.directedSelfLoops>0&&L.splice(L.lastIndexOf(M.key),1)),"directed"!==fe&&J(L,M.undirected),L}function Nn(re,fe,se,M,L){var J=re?q:ke;"undirected"!==fe&&("out"!==se&&J(M.in,L),"in"!==se&&J(M.out,L,se?null:M.key)),"directed"!==fe&&J(M.undirected,L)}function Yn(re,fe,se,M,L){var J=re?pe:G;"undirected"!==fe&&("out"!==se&&J(M.in,L)||"in"!==se&&J(M.out,L,se?null:M.key))||"directed"===fe||J(M.undirected,L)}function Mi(re,fe,se){var M=oe.empty();return"undirected"!==re&&("out"!==fe&&void 0!==se.in&&(M=Ke(M,de(se.in))),"in"!==fe&&void 0!==se.out&&(M=Ke(M,de(se.out,fe?null:se.key)))),"directed"!==re&&void 0!==se.undirected&&(M=Ke(M,de(se.undirected))),M}function xi(re,fe,se,M,L){var J=fe?_t:je,Ee=[];return"undirected"!==re&&(void 0!==M.in&&"out"!==se&&J(Ee,M.in,L),void 0!==M.out&&"in"!==se&&J(Ee,M.out,L),!se&&M.directedSelfLoops>0&&Ee.splice(Ee.lastIndexOf(M.key),1)),"directed"!==re&&void 0!==M.undirected&&J(Ee,M.undirected,L),Ee}function Xr(re,fe,se,M,L,J){var Ee=fe?we:pt;"undirected"!==re&&(void 0!==M.in&&"out"!==se&&Ee(M.in,L,J),M.key!==L&&void 0!==M.out&&"in"!==se&&Ee(M.out,L,J)),"directed"!==re&&void 0!==M.undirected&&Ee(M.undirected,L,J)}function Ls(re,fe,se,M,L,J){var Ee=fe?N:B;"undirected"!==re&&(void 0!==M.in&&"out"!==se&&Ee(M.in,L,J)||M.key!==L&&void 0!==M.out&&"in"!==se&&Ee(M.out,L,J,se?null:M.key))||"directed"===re||void 0===M.undirected||Ee(M.undirected,L,J)}function fs(re,fe,se,M){var L=oe.empty();return"undirected"!==re&&(void 0!==se.in&&"out"!==fe&&M in se.in&&(L=Ke(L,V(se.in,M))),void 0!==se.out&&"in"!==fe&&M in se.out&&(L=Ke(L,V(se.out,M)))),"directed"!==re&&void 0!==se.undirected&&M in se.undirected&&(L=Ke(L,V(se.undirected,M))),L}var Bs=[{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 Kr(re,fe){if(void 0!==fe)for(var se in fe)re.add(se)}function xa(re,fe,se){if("mixed"!==re){if("undirected"===re)return Object.keys(se.undirected);if("string"==typeof fe)return Object.keys(se[fe])}var M=new Set;return"undirected"!==re&&("out"!==fe&&Kr(M,se.in),"in"!==fe&&Kr(M,se.out)),"directed"!==re&&Kr(M,se.undirected),te(M.values(),M.size)}function kl(re,fe,se){for(var M in fe){var L=fe[M];L instanceof Set&&(L=L.values().next().value);var J=L.source,Fe=J===re?L.target:J;se(Fe.key,Fe.attributes)}}function Sa(re,fe,se,M){for(var L in se){var J=se[L];J instanceof Set&&(J=J.values().next().value);var Ee=J.source,nt=Ee===fe?J.target:Ee;re.has(nt.key)||(re.add(nt.key),M(nt.key,nt.attributes))}}function ws(re,fe,se){for(var M in fe){var L=fe[M];L instanceof Set&&(L=L.values().next().value);var J=L.source,Fe=J===re?L.target:J;if(se(Fe.key,Fe.attributes))return!0}return!1}function en(re,fe,se,M){for(var L in se){var J=se[L];J instanceof Set&&(J=J.values().next().value);var Ee=J.source,nt=Ee===fe?J.target:Ee;if(!re.has(nt.key)&&(re.add(nt.key),M(nt.key,nt.attributes)))return!0}return!1}function nl(re,fe){var se=Object.keys(fe),M=se.length,L=0;return new oe(function(){if(L>=M)return{done:!0};var J=fe[se[L++]];J instanceof Set&&(J=J.values().next().value);var Ee=J.source,nt=Ee===re?J.target:Ee;return{done:!1,value:[nt.key,nt.attributes]}})}function rt(re,fe,se){var M=Object.keys(se),L=M.length,J=0;return new oe(function Ee(){if(J>=L)return{done:!0};var Fe=se[M[J++]];Fe instanceof Set&&(Fe=Fe.values().next().value);var nt=Fe.source,We=nt===fe?Fe.target:nt;return re.has(We.key)?Ee():(re.add(We.key),{done:!1,value:[We.key,We.attributes]})})}function lt(re,fe,se,M,L){var J=re._nodes.get(M);if("undirected"!==fe){if("out"!==se&&void 0!==J.in)for(var Ee in J.in)if(Ee===L)return!0;if("in"!==se&&void 0!==J.out)for(var Fe in J.out)if(Fe===L)return!0}if("directed"!==fe&&void 0!==J.undirected)for(var nt in J.undirected)if(nt===L)return!0;return!1}function Be(re,fe,se){for(var M,L,J,Ee,Fe,nt,Pt,We=fe._nodes.values(),qt=fe.type;!0!==(M=We.next()).done;){if(L=M.value,"undirected"!==qt)for(J in Ee=L.out)if(nt=(Fe=Ee[J]).target,Pt=se(L.key,nt.key,L.attributes,nt.attributes,Fe.key,Fe.attributes,Fe.undirected,Fe.generatedKey),re&&Pt)return;if("directed"!==qt)for(J in Ee=L.undirected)if((nt=(Fe=Ee[J]).target).key!==J&&(nt=Fe.source),Pt=se(L.key,nt.key,L.attributes,nt.attributes,Fe.key,Fe.attributes,Fe.undirected,Fe.generatedKey),re&&Pt)return}}function ut(re,fe,se){for(var M,L,J,Ee,Fe,nt,Pt,We,qt,St=fe._nodes.values(),vn=fe.type;!0!==(M=St.next()).done;){if(L=M.value,"undirected"!==vn)for(J in nt=L.out)for(Ee=nt[J].values();!0!==(Fe=Ee.next()).done;)if(We=(Pt=Fe.value).target,qt=se(L.key,We.key,L.attributes,We.attributes,Pt.key,Pt.attributes,Pt.undirected,Pt.generatedKey),re&&qt)return;if("directed"!==vn)for(J in nt=L.undirected)for(Ee=nt[J].values();!0!==(Fe=Ee.next()).done;)if((We=(Pt=Fe.value).target).key!==J&&(We=Pt.source),qt=se(L.key,We.key,L.attributes,We.attributes,Pt.key,Pt.attributes,Pt.undirected,Pt.generatedKey),re&&qt)return}}function Je(re,fe){var se={key:re};return Q(fe.attributes)||(se.attributes=he({},fe.attributes)),se}function Mt(re,fe){var se={source:fe.source.key,target:fe.target.key};return fe.generatedKey||(se.key=re),Q(fe.attributes)||(se.attributes=he({},fe.attributes)),fe.undirected&&(se.undirected=!0),se}function It(re){return k(re)?"key"in re?!("attributes"in re)||k(re.attributes)&&null!==re.attributes?null:"invalid-attributes":"no-key":"not-object"}function Ot(re){return k(re)?"source"in re?"target"in re?!("attributes"in re)||k(re.attributes)&&null!==re.attributes?"undirected"in re&&"boolean"!=typeof re.undirected?"invalid-undirected":null:"invalid-attributes":"no-target":"no-source":"not-object"}var Qt=new Set(["directed","undirected","mixed"]),zn=new Set(["domain","_events","_eventsCount","_maxListeners"]),ci={allowSelfLoops:!0,edgeKeyGenerator:null,multi:!1,type:"mixed"};function Rn(re,fe,se){var M=new re.NodeDataClass(fe,se);return re._nodes.set(fe,M),re.emit("nodeAdded",{key:fe,attributes:se}),M}function bn(re,fe,se,M,L,J,Ee,Fe){if(!M&&"undirected"===re.type)throw new ye("Graph.".concat(fe,": you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead."));if(M&&"directed"===re.type)throw new ye("Graph.".concat(fe,": you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead."));if(Fe&&!k(Fe))throw new me("Graph.".concat(fe,': invalid attributes. Expecting an object but got "').concat(Fe,'"'));if(J=""+J,Ee=""+Ee,Fe=Fe||{},!re.allowSelfLoops&&J===Ee)throw new ye("Graph.".concat(fe,': source & target are the same ("').concat(J,"\"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false."));var nt=re._nodes.get(J),Pt=re._nodes.get(Ee);if(!nt)throw new ne("Graph.".concat(fe,': source node "').concat(J,'" not found.'));if(!Pt)throw new ne("Graph.".concat(fe,': target node "').concat(Ee,'" not found.'));var We={key:null,undirected:M,source:J,target:Ee,attributes:Fe};if(se&&(L=re._edgeKeyGenerator(We)),re._edges.has(L=""+L))throw new ye("Graph.".concat(fe,': the "').concat(L,'" edge already exists in the graph.'));if(!re.multi&&(M?void 0!==nt.undirected[Ee]:void 0!==nt.out[Ee]))throw new ye("Graph.".concat(fe,': an edge linking "').concat(J,'" to "').concat(Ee,"\" 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 qt=new Qe(M,L,se,nt,Pt,Fe);return re._edges.set(L,qt),J===Ee?M?(nt.undirectedSelfLoops++,re._undirectedSelfLoopCount++):(nt.directedSelfLoops++,re._directedSelfLoopCount++):M?(nt.undirectedDegree++,Pt.undirectedDegree++):(nt.outDegree++,Pt.inDegree++),tt(re,M,qt,J,Ee,nt,Pt),M?re._undirectedSize++:re._directedSize++,We.key=L,re.emit("edgeAdded",We),L}function Xn(re,fe,se,M,L,J,Ee,Fe,nt){if(!M&&"undirected"===re.type)throw new ye("Graph.".concat(fe,": you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead."));if(M&&"directed"===re.type)throw new ye("Graph.".concat(fe,": you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead."));if(Fe)if(nt){if("function"!=typeof Fe)throw new me("Graph.".concat(fe,': invalid updater function. Expecting a function but got "').concat(Fe,'"'))}else if(!k(Fe))throw new me("Graph.".concat(fe,': invalid attributes. Expecting an object but got "').concat(Fe,'"'));var Pt;if(J=""+J,Ee=""+Ee,nt&&(Pt=Fe,Fe=void 0),!re.allowSelfLoops&&J===Ee)throw new ye("Graph.".concat(fe,': source & target are the same ("').concat(J,"\"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false."));var We,qt,St=re._nodes.get(J),vn=re._nodes.get(Ee);if(!se&&(We=re._edges.get(L))){if(We.source.key!==J||We.target.key!==Ee||M&&(We.source.key!==Ee||We.target.key!==J))throw new ye("Graph.".concat(fe,': inconsistency detected when attempting to merge the "').concat(L,'" edge with "').concat(J,'" source & "').concat(Ee,'" target vs. ("').concat(We.source.key,'", "').concat(We.target.key,'").'));qt=We}if(qt||re.multi||!St||(qt=M?St.undirected[Ee]:St.out[Ee]),qt)return(nt?Pt:Fe)?(nt?(qt.attributes=Pt(qt.attributes),re.emit("edgeAttributesUpdated",{type:"replace",key:qt.key,attributes:qt.attributes})):(he(qt.attributes,Fe),re.emit("edgeAttributesUpdated",{type:"merge",key:qt.key,attributes:qt.attributes,data:Fe})),qt.key):qt.key;Fe=Fe||{},nt&&Pt&&(Fe=Pt(Fe));var Zr={key:null,undirected:M,source:J,target:Ee,attributes:Fe};if(se&&(L=re._edgeKeyGenerator(Zr)),re._edges.has(L=""+L))throw new ye("Graph.".concat(fe,': the "').concat(L,'" edge already exists in the graph.'));return St||(St=Rn(re,J,{}),J===Ee&&(vn=St)),vn||(vn=Rn(re,Ee,{})),We=new Qe(M,L,se,St,vn,Fe),re._edges.set(L,We),J===Ee?M?(St.undirectedSelfLoops++,re._undirectedSelfLoopCount++):(St.directedSelfLoops++,re._directedSelfLoopCount++):M?(St.undirectedDegree++,vn.undirectedDegree++):(St.outDegree++,vn.inDegree++),tt(re,M,We,J,Ee,St,vn),M?re._undirectedSize++:re._directedSize++,Zr.key=L,re.emit("edgeAdded",Zr),L}var re,Cn=function(re){function fe(M){var L;if(L=re.call(this)||this,(M=he({},ci,M)).edgeKeyGenerator&&"function"!=typeof M.edgeKeyGenerator)throw new me("Graph.constructor: invalid 'edgeKeyGenerator' option. Expecting a function but got \"".concat(M.edgeKeyGenerator,'".'));if("boolean"!=typeof M.multi)throw new me("Graph.constructor: invalid 'multi' option. Expecting a boolean but got \"".concat(M.multi,'".'));if(!Qt.has(M.type))throw new me('Graph.constructor: invalid \'type\' option. Should be one of "mixed", "directed" or "undirected" but got "'.concat(M.type,'".'));if("boolean"!=typeof M.allowSelfLoops)throw new me("Graph.constructor: invalid 'allowSelfLoops' option. Expecting a boolean but got \"".concat(M.allowSelfLoops,'".'));var J,Ee="mixed"===M.type?Oe:"directed"===M.type?$e:st;return H(Se(L),"NodeDataClass",Ee),H(Se(L),"_attributes",{}),H(Se(L),"_nodes",new Map),H(Se(L),"_edges",new Map),H(Se(L),"_directedSize",0),H(Se(L),"_undirectedSize",0),H(Se(L),"_directedSelfLoopCount",0),H(Se(L),"_undirectedSelfLoopCount",0),H(Se(L),"_edgeKeyGenerator",M.edgeKeyGenerator||(J=0,function(){return J++})),H(Se(L),"_options",M),zn.forEach(function(Fe){return H(Se(L),Fe,L[Fe])}),v(Se(L),"order",function(){return L._nodes.size}),v(Se(L),"size",function(){return L._edges.size}),v(Se(L),"directedSize",function(){return L._directedSize}),v(Se(L),"undirectedSize",function(){return L._undirectedSize}),v(Se(L),"selfLoopCount",function(){return L._directedSelfLoopCount+L._undirectedSelfLoopCount}),v(Se(L),"directedSelfLoopCount",function(){return L._directedSelfLoopCount}),v(Se(L),"undirectedSelfLoopCount",function(){return L._undirectedSelfLoopCount}),v(Se(L),"multi",L._options.multi),v(Se(L),"type",L._options.type),v(Se(L),"allowSelfLoops",L._options.allowSelfLoops),v(Se(L),"implementation",function(){return"graphology"}),L}et(fe,re);var se=fe.prototype;return se.hasNode=function(M){return this._nodes.has(""+M)},se.hasDirectedEdge=function(M,L){if("undirected"===this.type)return!1;if(1===arguments.length){var Ee=this._edges.get(""+M);return!!Ee&&!Ee.undirected}if(2===arguments.length){L=""+L;var Fe=this._nodes.get(M=""+M);if(!Fe)return!1;var nt=Fe.out[L];return!(!nt||this.multi&&!nt.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."))},se.hasUndirectedEdge=function(M,L){if("directed"===this.type)return!1;if(1===arguments.length){var Ee=this._edges.get(""+M);return!!Ee&&Ee.undirected}if(2===arguments.length){L=""+L;var Fe=this._nodes.get(M=""+M);if(!Fe)return!1;var nt=Fe.undirected[L];return!(!nt||this.multi&&!nt.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."))},se.hasEdge=function(M,L){if(1===arguments.length)return this._edges.has(""+M);if(2===arguments.length){L=""+L;var Ee=this._nodes.get(M=""+M);if(!Ee)return!1;var Fe=void 0!==Ee.out&&Ee.out[L];return Fe||(Fe=void 0!==Ee.undirected&&Ee.undirected[L]),!(!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."))},se.directedEdge=function(M,L){if("undirected"!==this.type){if(M=""+M,L=""+L,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 J=this._nodes.get(M);if(!J)throw new ne('Graph.directedEdge: could not find the "'.concat(M,'" source node in the graph.'));if(!this._nodes.has(L))throw new ne('Graph.directedEdge: could not find the "'.concat(L,'" target node in the graph.'));var Ee=J.out&&J.out[L]||void 0;return Ee?Ee.key:void 0}},se.undirectedEdge=function(M,L){if("directed"!==this.type){if(M=""+M,L=""+L,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 J=this._nodes.get(M);if(!J)throw new ne('Graph.undirectedEdge: could not find the "'.concat(M,'" source node in the graph.'));if(!this._nodes.has(L))throw new ne('Graph.undirectedEdge: could not find the "'.concat(L,'" target node in the graph.'));var Ee=J.undirected&&J.undirected[L]||void 0;return Ee?Ee.key:void 0}},se.edge=function(M,L){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.");L=""+L;var J=this._nodes.get(M=""+M);if(!J)throw new ne('Graph.edge: could not find the "'.concat(M,'" source node in the graph.'));if(!this._nodes.has(L))throw new ne('Graph.edge: could not find the "'.concat(L,'" target node in the graph.'));var Ee=J.out&&J.out[L]||J.undirected&&J.undirected[L]||void 0;if(Ee)return Ee.key},se.inDegree=function(M){var L=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof L)throw new me('Graph.inDegree: Expecting a boolean but got "'.concat(L,'" for the second parameter (allowing self-loops to be counted).'));var J=this._nodes.get(M=""+M);if(!J)throw new ne('Graph.inDegree: could not find the "'.concat(M,'" node in the graph.'));return"undirected"===this.type?0:J.inDegree+(L?J.directedSelfLoops:0)},se.outDegree=function(M){var L=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof L)throw new me('Graph.outDegree: Expecting a boolean but got "'.concat(L,'" for the second parameter (allowing self-loops to be counted).'));var J=this._nodes.get(M=""+M);if(!J)throw new ne('Graph.outDegree: could not find the "'.concat(M,'" node in the graph.'));return"undirected"===this.type?0:J.outDegree+(L?J.directedSelfLoops:0)},se.directedDegree=function(M){var L=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof L)throw new me('Graph.directedDegree: Expecting a boolean but got "'.concat(L,'" for the second parameter (allowing self-loops to be counted).'));var J=this._nodes.get(M=""+M);if(!J)throw new ne('Graph.directedDegree: could not find the "'.concat(M,'" node in the graph.'));if("undirected"===this.type)return 0;var Ee=L?J.directedSelfLoops:0;return J.inDegree+Ee+(J.outDegree+Ee)},se.undirectedDegree=function(M){var L=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof L)throw new me('Graph.undirectedDegree: Expecting a boolean but got "'.concat(L,'" for the second parameter (allowing self-loops to be counted).'));var J=this._nodes.get(M=""+M);if(!J)throw new ne('Graph.undirectedDegree: could not find the "'.concat(M,'" node in the graph.'));return"directed"===this.type?0:J.undirectedDegree+2*(L?J.undirectedSelfLoops:0)},se.degree=function(M){var L=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof L)throw new me('Graph.degree: Expecting a boolean but got "'.concat(L,'" for the second parameter (allowing self-loops to be counted).'));var J=this._nodes.get(M=""+M);if(!J)throw new ne('Graph.degree: could not find the "'.concat(M,'" node in the graph.'));var Ee=0,Fe=0;return"directed"!==this.type&&(L&&(Fe=J.undirectedSelfLoops),Ee+=J.undirectedDegree+2*Fe),"undirected"!==this.type&&(L&&(Fe=J.directedSelfLoops),Ee+=J.inDegree+J.outDegree+2*Fe),Ee},se.source=function(M){var L=this._edges.get(M=""+M);if(!L)throw new ne('Graph.source: could not find the "'.concat(M,'" edge in the graph.'));return L.source.key},se.target=function(M){var L=this._edges.get(M=""+M);if(!L)throw new ne('Graph.target: could not find the "'.concat(M,'" edge in the graph.'));return L.target.key},se.extremities=function(M){var L=this._edges.get(M=""+M);if(!L)throw new ne('Graph.extremities: could not find the "'.concat(M,'" edge in the graph.'));return[L.source.key,L.target.key]},se.opposite=function(M,L){M=""+M;var J=this._edges.get(L=""+L);if(!J)throw new ne('Graph.opposite: could not find the "'.concat(L,'" edge in the graph.'));var Ee=J.source.key,Fe=J.target.key;if(M!==Ee&&M!==Fe)throw new ne('Graph.opposite: the "'.concat(M,'" node is not attached to the "').concat(L,'" edge (').concat(Ee,", ").concat(Fe,")."));return M===Ee?Fe:Ee},se.hasExtremity=function(M,L){L=""+L;var J=this._edges.get(M=""+M);if(!J)throw new ne('Graph.hasExtremity: could not find the "'.concat(M,'" edge in the graph.'));return J.source.key===L||J.target.key===L},se.isUndirected=function(M){var L=this._edges.get(M=""+M);if(!L)throw new ne('Graph.isUndirected: could not find the "'.concat(M,'" edge in the graph.'));return L.undirected},se.isDirected=function(M){var L=this._edges.get(M=""+M);if(!L)throw new ne('Graph.isDirected: could not find the "'.concat(M,'" edge in the graph.'));return!L.undirected},se.isSelfLoop=function(M){var L=this._edges.get(M=""+M);if(!L)throw new ne('Graph.isSelfLoop: could not find the "'.concat(M,'" edge in the graph.'));return L.source===L.target},se.hasGeneratedKey=function(M){var L=this._edges.get(M=""+M);if(!L)throw new ne('Graph.hasGeneratedKey: could not find the "'.concat(M,'" edge in the graph.'));return L.generatedKey},se.addNode=function(M,L){return function(J,Ee,Fe){if(Fe&&!k(Fe))throw new me('Graph.addNode: invalid attributes. Expecting an object but got "'.concat(Fe,'"'));if(Fe=Fe||{},J._nodes.has(Ee=""+Ee))throw new ye('Graph.addNode: the "'.concat(Ee,'" node already exist in the graph.'));var nt=new J.NodeDataClass(Ee,Fe);return J._nodes.set(Ee,nt),J.emit("nodeAdded",{key:Ee,attributes:Fe}),nt}(this,M,L).key},se.mergeNode=function(M,L){if(L&&!k(L))throw new me('Graph.mergeNode: invalid attributes. Expecting an object but got "'.concat(L,'"'));L=L||{};var J=this._nodes.get(M=""+M);return J?(L&&(he(J.attributes,L),this.emit("nodeAttributesUpdated",{type:"merge",key:M,attributes:J.attributes,data:L})),M):(J=new this.NodeDataClass(M,L),this._nodes.set(M,J),this.emit("nodeAdded",{key:M,attributes:L}),M)},se.updateNode=function(M,L){if(L&&"function"!=typeof L)throw new me('Graph.updateNode: invalid updater function. Expecting a function but got "'.concat(L,'"'));var J=this._nodes.get(M=""+M);if(J)return L&&(J.attributes=L(J.attributes),this.emit("nodeAttributesUpdated",{type:"replace",key:M,attributes:J.attributes})),M;var Fe=L?L({}):{};return J=new this.NodeDataClass(M,Fe),this._nodes.set(M,J),this.emit("nodeAdded",{key:M,attributes:Fe}),M},se.dropNode=function(M){var L=this,J=this._nodes.get(M=""+M);if(!J)throw new ne('Graph.dropNode: could not find the "'.concat(M,'" node in the graph.'));this.forEachEdge(M,function(Ee){L.dropEdge(Ee)}),this._nodes.delete(M),this.emit("nodeDropped",{key:M,attributes:J.attributes})},se.dropEdge=function(M){var L;if(arguments.length>1){var J=""+arguments[0],Ee=""+arguments[1];if(!(L=W(this,J,Ee,this.type)))throw new ne('Graph.dropEdge: could not find the "'.concat(J,'" -> "').concat(Ee,'" edge in the graph.'))}else if(!(L=this._edges.get(M=""+M)))throw new ne('Graph.dropEdge: could not find the "'.concat(M,'" edge in the graph.'));this._edges.delete(L.key);var nt=L.source,Pt=L.target,We=L.attributes,qt=L.undirected;return nt===Pt?qt?(nt.undirectedSelfLoops--,this._undirectedSelfLoopCount--):(nt.directedSelfLoops--,this._directedSelfLoopCount--):qt?(nt.undirectedDegree--,Pt.undirectedDegree--):(nt.outDegree--,Pt.inDegree--),Xe(this,qt,L),qt?this._undirectedSize--:this._directedSize--,this.emit("edgeDropped",{key:M,attributes:We,source:nt.key,target:Pt.key,undirected:qt}),this},se.clear=function(){this._edges.clear(),this._nodes.clear(),this.emit("cleared")},se.clearEdges=function(){this._edges.clear(),this.clearIndex(),this.emit("edgesCleared")},se.getAttribute=function(M){return this._attributes[M]},se.getAttributes=function(){return this._attributes},se.hasAttribute=function(M){return this._attributes.hasOwnProperty(M)},se.setAttribute=function(M,L){return this._attributes[M]=L,this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:M}),this},se.updateAttribute=function(M,L){if("function"!=typeof L)throw new me("Graph.updateAttribute: updater should be a function.");return this._attributes[M]=L(this._attributes[M]),this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:M}),this},se.removeAttribute=function(M){return delete this._attributes[M],this.emit("attributesUpdated",{type:"remove",attributes:this._attributes,name:M}),this},se.replaceAttributes=function(M){if(!k(M))throw new me("Graph.replaceAttributes: provided attributes are not a plain object.");return this._attributes=M,this.emit("attributesUpdated",{type:"replace",attributes:this._attributes}),this},se.mergeAttributes=function(M){if(!k(M))throw new me("Graph.mergeAttributes: provided attributes are not a plain object.");return he(this._attributes,M),this.emit("attributesUpdated",{type:"merge",attributes:this._attributes,data:M}),this},se.getNodeAttribute=function(M,L){var J=this._nodes.get(M=""+M);if(!J)throw new ne('Graph.getNodeAttribute: could not find the "'.concat(M,'" node in the graph.'));return J.attributes[L]},se.getNodeAttributes=function(M){var L=this._nodes.get(M=""+M);if(!L)throw new ne('Graph.getNodeAttributes: could not find the "'.concat(M,'" node in the graph.'));return L.attributes},se.hasNodeAttribute=function(M,L){var J=this._nodes.get(M=""+M);if(!J)throw new ne('Graph.hasNodeAttribute: could not find the "'.concat(M,'" node in the graph.'));return J.attributes.hasOwnProperty(L)},se.setNodeAttribute=function(M,L,J){var Ee=this._nodes.get(M=""+M);if(!Ee)throw new ne('Graph.setNodeAttribute: could not find the "'.concat(M,'" 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 Ee.attributes[L]=J,this.emit("nodeAttributesUpdated",{key:M,type:"set",attributes:Ee.attributes,name:L}),this},se.updateNodeAttribute=function(M,L,J){var Ee=this._nodes.get(M=""+M);if(!Ee)throw new ne('Graph.updateNodeAttribute: could not find the "'.concat(M,'" 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 J)throw new me("Graph.updateAttribute: updater should be a function.");var Fe=Ee.attributes,nt=J(Fe[L]);return Fe[L]=nt,this.emit("nodeAttributesUpdated",{key:M,type:"set",attributes:Ee.attributes,name:L}),this},se.removeNodeAttribute=function(M,L){var J=this._nodes.get(M=""+M);if(!J)throw new ne('Graph.hasNodeAttribute: could not find the "'.concat(M,'" node in the graph.'));return delete J.attributes[L],this.emit("nodeAttributesUpdated",{key:M,type:"remove",attributes:J.attributes,name:L}),this},se.replaceNodeAttributes=function(M,L){var J=this._nodes.get(M=""+M);if(!J)throw new ne('Graph.replaceNodeAttributes: could not find the "'.concat(M,'" node in the graph.'));if(!k(L))throw new me("Graph.replaceNodeAttributes: provided attributes are not a plain object.");return J.attributes=L,this.emit("nodeAttributesUpdated",{key:M,type:"replace",attributes:J.attributes}),this},se.mergeNodeAttributes=function(M,L){var J=this._nodes.get(M=""+M);if(!J)throw new ne('Graph.mergeNodeAttributes: could not find the "'.concat(M,'" node in the graph.'));if(!k(L))throw new me("Graph.mergeNodeAttributes: provided attributes are not a plain object.");return he(J.attributes,L),this.emit("nodeAttributesUpdated",{key:M,type:"merge",attributes:J.attributes,data:L}),this},se.updateEachNodeAttributes=function(M,L){if("function"!=typeof M)throw new me("Graph.updateEachNodeAttributes: expecting an updater function.");if(L&&!C(L))throw new me("Graph.updateEachNodeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");for(var J,Ee,Fe=this._nodes.values();!0!==(J=Fe.next()).done;)(Ee=J.value).attributes=M(Ee.key,Ee.attributes);this.emit("eachNodeAttributesUpdated",{hints:L||null})},se.updateEachEdgeAttributes=function(M,L){if("function"!=typeof M)throw new me("Graph.updateEachEdgeAttributes: expecting an updater function.");if(L&&!C(L))throw new me("Graph.updateEachEdgeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");for(var J,Ee,Fe=this._edges.values();!0!==(J=Fe.next()).done;)(Ee=J.value).attributes=M(Ee.key,Ee.attributes);this.emit("eachEdgeAttributesUpdated",{hints:L||null})},se.forEach=function(M){if("function"!=typeof M)throw new me("Graph.forEach: expecting a callback.");this.multi?ut(!1,this,M):Be(!1,this,M)},se.forEachUntil=function(M){if("function"!=typeof M)throw new me("Graph.forEach: expecting a callback.");this.multi?ut(!0,this,M):Be(!0,this,M)},se.adjacency=function(){return this.multi?(nt=(M=this)._nodes.values(),Pt=M.type,We="outer",qt=null,new oe(function St(){var vn;if("outer"===We)return!0===(vn=nt.next()).done?vn:(L=vn.value,We="directed",St());if("directed"===We)return"undirected"===Pt?(We="undirected",St()):(Ee=L.out,J=Object.keys(L.out),Fe=0,We="inner-directed",St());if("undirected"===We){if("directed"===Pt)return We="outer",St();Ee=L.undirected,J=Object.keys(L.undirected),Fe=0,We="inner-undirected"}if(!qt&&Fe>=J.length)return We="inner-undirected"===We?"outer":"undirected",St();if(!qt){var Es=J[Fe++];return qt=Ee[Es].values(),St()}if((vn=qt.next()).done)return qt=null,St();var Zr=vn.value,Js=Zr.target;return"inner-undirected"===We&&Js.key===L.key&&(Js=Zr.source),{done:!1,value:[L.key,Js.key,L.attributes,Js.attributes,Zr.key,Zr.attributes]}})):(Fl=(St=this)._nodes.values(),fo=St.type,Br="outer",new oe(function Vs(){var Ac;if("outer"===Br)return!0===(Ac=Fl.next()).done?Ac:(vn=Ac.value,Br="directed",Vs());if("directed"===Br)return"undirected"===fo?(Br="undirected",Vs()):(Zr=vn.out,Es=Object.keys(vn.out),Js=0,Br="inner-directed",Vs());if("undirected"===Br){if("directed"===fo)return Br="outer",Vs();Zr=vn.undirected,Es=Object.keys(vn.undirected),Js=0,Br="inner-undirected"}if(Js>=Es.length)return Br="inner-undirected"===Br?"outer":"undirected",Vs();var xn=Es[Js++],po=Zr[xn],Ll=po.target;return"inner-undirected"===Br&&Ll.key===vn.key&&(Ll=po.source),{done:!1,value:[vn.key,Ll.key,vn.attributes,Ll.attributes,po.key,po.attributes]}}));var St,vn,Es,Zr,Js,Fl,fo,Br,M,L,J,Ee,Fe,nt,Pt,We,qt},se.nodes=function(){return"function"==typeof Array.from?Array.from(this._nodes.keys()):te(this._nodes.keys(),this._nodes.size)},se.forEachNode=function(M){if("function"!=typeof M)throw new me("Graph.forEachNode: expecting a callback.");this._nodes.forEach(function(L,J){M(J,L.attributes)})},se.forEachNodeUntil=function(M){if("function"!=typeof M)throw new me("Graph.forEachNode: expecting a callback.");for(var L,J,Ee=this._nodes.values();!0!==(L=Ee.next())&&!M((J=L.value).key,J.attributes););},se.nodeEntries=function(){var M=this._nodes.values();return new oe(function(){var L=M.next();if(L.done)return L;var J=L.value;return{value:[J.key,J.attributes],done:!1}})},se.exportNode=function(M){var L=this._nodes.get(M=""+M);if(!L)throw new ne('Graph.exportNode: could not find the "'.concat(M,'" node in the graph.'));return Je(M,L)},se.exportEdge=function(M){var L=this._edges.get(M=""+M);if(!L)throw new ne('Graph.exportEdge: could not find the "'.concat(M,'" edge in the graph.'));return Mt(M,L)},se.export=function(){var M=new Array(this._nodes.size),L=0;this._nodes.forEach(function(Ee,Fe){M[L++]=Je(Fe,Ee)});var J=new Array(this._edges.size);return L=0,this._edges.forEach(function(Ee,Fe){J[L++]=Mt(Fe,Ee)}),{attributes:this.getAttributes(),nodes:M,edges:J,options:{type:this.type,multi:this.multi,allowSelfLoops:this.allowSelfLoops}}},se.importNode=function(M){var L=arguments.length>1&&void 0!==arguments[1]&&arguments[1],J=It(M);if(J){if("not-object"===J)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"===J)throw new me("Graph.importNode: no key provided.");if("invalid-attributes"===J)throw new me("Graph.importNode: invalid attributes. Attributes should be a plain object, null or omitted.")}var Ee=M.key,Fe=M.attributes,nt=void 0===Fe?{}:Fe;return L?this.mergeNode(Ee,nt):this.addNode(Ee,nt),this},se.importEdge=function(M){var L=arguments.length>1&&void 0!==arguments[1]&&arguments[1],J=Ot(M);if(J){if("not-object"===J)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"===J)throw new me("Graph.importEdge: missing souce.");if("no-target"===J)throw new me("Graph.importEdge: missing target.");if("invalid-attributes"===J)throw new me("Graph.importEdge: invalid attributes. Attributes should be a plain object, null or omitted.");if("invalid-undirected"===J)throw new me("Graph.importEdge: invalid undirected. Undirected should be boolean or omitted.")}var Ee=M.source,Fe=M.target,nt=M.attributes,Pt=void 0===nt?{}:nt,We=M.undirected,qt=void 0!==We&&We;return"key"in M?(L?qt?this.mergeUndirectedEdgeWithKey:this.mergeDirectedEdgeWithKey:qt?this.addUndirectedEdgeWithKey:this.addDirectedEdgeWithKey).call(this,M.key,Ee,Fe,Pt):(L?qt?this.mergeUndirectedEdge:this.mergeDirectedEdge:qt?this.addUndirectedEdge:this.addDirectedEdge).call(this,Ee,Fe,Pt),this},se.import=function(M){var L,J,Ee,Fe=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(j(M))return this.import(M.export(),Fe),this;if(!k(M))throw new me("Graph.import: invalid argument. Expecting a serialized graph or, alternatively, a Graph instance.");if(M.attributes){if(!k(M.attributes))throw new me("Graph.import: invalid attributes. Expecting a plain object.");Fe?this.mergeAttributes(M.attributes):this.replaceAttributes(M.attributes)}if(M.nodes){if(Ee=M.nodes,!Array.isArray(Ee))throw new me("Graph.import: invalid nodes. Expecting an array.");for(L=0,J=Ee.length;LJ)){var Pt=new Set;Pt.add(L.undirected[nt]),L.undirected[nt]=Pt,M._nodes.get(nt).undirected[J]=Pt}})),this;var M},se.clearIndex=function(){return this._nodes.forEach(function(M){void 0!==M.in&&(M.in={},M.out={}),void 0!==M.undirected&&(M.undirected={})}),this},se.toJSON=function(){return this.export()},se.toString=function(){return"[object Graph]"},se.inspect=function(){var M=this,L={};this._nodes.forEach(function(Pt,We){L[We]=Pt.attributes});var J={},Ee={};this._edges.forEach(function(Pt,We){var qt=Pt.undirected?"--":"->",St="",vn="(".concat(Pt.source.key,")").concat(qt,"(").concat(Pt.target.key,")");Pt.generatedKey?M.multi&&(void 0===Ee[vn]?Ee[vn]=0:Ee[vn]++,St+="".concat(Ee[vn],". ")):St+="[".concat(We,"]: "),J[St+=vn]=Pt.attributes});var Fe={};for(var nt in this)this.hasOwnProperty(nt)&&!zn.has(nt)&&"function"!=typeof this[nt]&&(Fe[nt]=this[nt]);return Fe.attributes=this._attributes,Fe.nodes=L,Fe.edges=J,H(Fe,"constructor",this.constructor),Fe},fe}(T.exports.EventEmitter);"undefined"!=typeof Symbol&&(Cn.prototype[Symbol.for("nodejs.util.inspect.custom")]=Cn.prototype.inspect),[{name:function(re){return"".concat(re,"Edge")},generateKey:!0},{name:function(re){return"".concat(re,"DirectedEdge")},generateKey:!0,type:"directed"},{name:function(re){return"".concat(re,"UndirectedEdge")},generateKey:!0,type:"undirected"},{name:function(re){return"".concat(re,"EdgeWithKey")}},{name:function(re){return"".concat(re,"DirectedEdgeWithKey")},type:"directed"},{name:function(re){return"".concat(re,"UndirectedEdgeWithKey")},type:"undirected"}].forEach(function(re){["add","merge","update"].forEach(function(fe){var se=re.name(fe),M="add"===fe?bn:Xn;Cn.prototype[se]=re.generateKey?function(L,J,Ee){return M(this,se,!0,"undirected"===(re.type||this.type),null,L,J,Ee,"update"===fe)}:function(L,J,Ee,Fe){return M(this,se,!1,"undirected"===(re.type||this.type),L,J,Ee,Fe,"update"===fe)}})}),"undefined"!=typeof Symbol&&(Cn.prototype[Symbol.iterator]=Cn.prototype.adjacency),re=Cn,ze.forEach(function(fe){var se=fe.name,M=fe.attacher;M(re,se("Edge"),"mixed"),M(re,se("DirectedEdge"),"directed"),M(re,se("UndirectedEdge"),"undirected")}),function(re){Me.forEach(function(fe){var M,L,J,Ee;J=(M=fe).type,Ee=M.direction,re.prototype[L=M.name]=function(Fe,nt){if("mixed"!==J&&"mixed"!==this.type&&J!==this.type)return[];if(!arguments.length)return Re(this,J);if(1===arguments.length){var Pt=this._nodes.get(Fe=""+Fe);if(void 0===Pt)throw new ne("Graph.".concat(L,': could not find the "').concat(Fe,'" node in the graph.'));return In(this.multi,"mixed"===J?this.type:J,Ee,Pt)}if(2===arguments.length){nt=""+nt;var We=this._nodes.get(Fe=""+Fe);if(!We)throw new ne("Graph.".concat(L,': could not find the "').concat(Fe,'" source node in the graph.'));if(!this._nodes.has(nt))throw new ne("Graph.".concat(L,': could not find the "').concat(nt,'" target node in the graph.'));return xi(J,this.multi,Ee,We,nt)}throw new me("Graph.".concat(L,": too many arguments (expecting 0, 1 or 2 and got ").concat(arguments.length,")."))},function(se,M){var L=M.name,J=M.type,Ee=M.direction,Fe="forEach"+L[0].toUpperCase()+L.slice(1,-1);se.prototype[Fe]=function(nt,Pt,We){if("mixed"===J||"mixed"===this.type||J===this.type){if(1===arguments.length)return Ze(this,J,We=nt);if(2===arguments.length){We=Pt;var qt=this._nodes.get(nt=""+nt);if(void 0===qt)throw new ne("Graph.".concat(Fe,': could not find the "').concat(nt,'" node in the graph.'));return Nn(this.multi,"mixed"===J?this.type:J,Ee,qt,We)}if(3===arguments.length){Pt=""+Pt;var St=this._nodes.get(nt=""+nt);if(!St)throw new ne("Graph.".concat(Fe,': could not find the "').concat(nt,'" source node in the graph.'));if(!this._nodes.has(Pt))throw new ne("Graph.".concat(Fe,': could not find the "').concat(Pt,'" target node in the graph.'));return Xr(J,this.multi,Ee,St,Pt,We)}throw new me("Graph.".concat(Fe,": too many arguments (expecting 1, 2 or 3 and got ").concat(arguments.length,")."))}}}(re,fe),function(se,M){var L=M.name,J=M.type,Ee=M.direction,Fe="forEach"+L[0].toUpperCase()+L.slice(1,-1)+"Until";se.prototype[Fe]=function(nt,Pt,We){if("mixed"===J||"mixed"===this.type||J===this.type){if(1===arguments.length)return Tt(this,J,We=nt);if(2===arguments.length){We=Pt;var qt=this._nodes.get(nt=""+nt);if(void 0===qt)throw new ne("Graph.".concat(Fe,': could not find the "').concat(nt,'" node in the graph.'));return Yn(this.multi,"mixed"===J?this.type:J,Ee,qt,We)}if(3===arguments.length){Pt=""+Pt;var St=this._nodes.get(nt=""+nt);if(!St)throw new ne("Graph.".concat(Fe,': could not find the "').concat(nt,'" source node in the graph.'));if(!this._nodes.has(Pt))throw new ne("Graph.".concat(Fe,': could not find the "').concat(Pt,'" target node in the graph.'));return Ls(J,this.multi,Ee,St,Pt,We)}throw new me("Graph.".concat(Fe,": too many arguments (expecting 1, 2 or 3 and got ").concat(arguments.length,")."))}}}(re,fe),function(se,M){var J=M.type,Ee=M.direction,Fe=M.name.slice(0,-1)+"Entries";se.prototype[Fe]=function(nt,Pt){if("mixed"!==J&&"mixed"!==this.type&&J!==this.type)return oe.empty();if(!arguments.length)return kt(this,J);if(1===arguments.length){var We=this._nodes.get(nt=""+nt);if(!We)throw new ne("Graph.".concat(Fe,': could not find the "').concat(nt,'" node in the graph.'));return Mi(J,Ee,We)}if(2===arguments.length){Pt=""+Pt;var qt=this._nodes.get(nt=""+nt);if(!qt)throw new ne("Graph.".concat(Fe,': could not find the "').concat(nt,'" source node in the graph.'));if(!this._nodes.has(Pt))throw new ne("Graph.".concat(Fe,': could not find the "').concat(Pt,'" target node in the graph.'));return fs(J,Ee,qt,Pt)}throw new me("Graph.".concat(Fe,": too many arguments (expecting 0, 1 or 2 and got ").concat(arguments.length,")."))}}(re,fe)})}(Cn),function(re){Bs.forEach(function(fe){var M,L,J,Ee;J=(M=fe).type,Ee=M.direction,re.prototype[L=M.name]=function(Fe){if("mixed"!==J&&"mixed"!==this.type&&J!==this.type)return[];if(2===arguments.length){var nt=""+arguments[0],Pt=""+arguments[1];if(!this._nodes.has(nt))throw new ne("Graph.".concat(L,': could not find the "').concat(nt,'" node in the graph.'));if(!this._nodes.has(Pt))throw new ne("Graph.".concat(L,': could not find the "').concat(Pt,'" node in the graph.'));return lt(this,J,Ee,nt,Pt)}if(1===arguments.length){var We=this._nodes.get(Fe=""+Fe);if(void 0===We)throw new ne("Graph.".concat(L,': could not find the "').concat(Fe,'" node in the graph.'));return xa("mixed"===J?this.type:J,Ee,We)}throw new me("Graph.".concat(L,": invalid number of arguments (expecting 1 or 2 and got ").concat(arguments.length,")."))},function(re,fe){var se=fe.name,M=fe.type,L=fe.direction,J="forEach"+se[0].toUpperCase()+se.slice(1,-1);re.prototype[J]=function(Ee,Fe){if("mixed"===M||"mixed"===this.type||M===this.type){var nt=this._nodes.get(Ee=""+Ee);if(void 0===nt)throw new ne("Graph.".concat(J,': could not find the "').concat(Ee,'" node in the graph.'));!function(Pt,We,qt,St){if("mixed"!==Pt){if("undirected"===Pt)return kl(qt,qt.undirected,St);if("string"==typeof We)return kl(qt,qt[We],St)}var vn=new Set;"undirected"!==Pt&&("out"!==We&&Sa(vn,qt,qt.in,St),"in"!==We&&Sa(vn,qt,qt.out,St)),"directed"!==Pt&&Sa(vn,qt,qt.undirected,St)}("mixed"===M?this.type:M,L,nt,Fe)}}}(re,fe),function(re,fe){var se=fe.name,M=fe.type,L=fe.direction,J="forEach"+se[0].toUpperCase()+se.slice(1,-1)+"Until";re.prototype[J]=function(Ee,Fe){if("mixed"===M||"mixed"===this.type||M===this.type){var nt=this._nodes.get(Ee=""+Ee);if(void 0===nt)throw new ne("Graph.".concat(J,': could not find the "').concat(Ee,'" node in the graph.'));!function(Pt,We,qt,St){if("mixed"!==Pt){if("undirected"===Pt)return ws(qt,qt.undirected,St);if("string"==typeof We)return ws(qt,qt[We],St)}var vn=new Set;"undirected"!==Pt&&("out"!==We&&en(vn,qt,qt.in,St)||"in"!==We&&en(vn,qt,qt.out,St))||"directed"===Pt||en(vn,qt,qt.undirected,St)}("mixed"===M?this.type:M,L,nt,Fe)}}}(re,fe),function(re,fe){var M=fe.type,L=fe.direction,J=fe.name.slice(0,-1)+"Entries";re.prototype[J]=function(Ee){if("mixed"!==M&&"mixed"!==this.type&&M!==this.type)return oe.empty();var Fe=this._nodes.get(Ee=""+Ee);if(void 0===Fe)throw new ne("Graph.".concat(J,': could not find the "').concat(Ee,'" node in the graph.'));return function(nt,Pt,We){if("mixed"!==nt){if("undirected"===nt)return nl(We,We.undirected);if("string"==typeof Pt)return nl(We,We[Pt])}var qt=oe.empty(),St=new Set;return"undirected"!==nt&&("out"!==Pt&&(qt=Ke(qt,rt(St,We,We.in))),"in"!==Pt&&(qt=Ke(qt,rt(St,We,We.out)))),"directed"!==nt&&(qt=Ke(qt,rt(St,We,We.undirected))),qt}("mixed"===M?this.type:M,L,Fe)}}(re,fe)})}(Cn);var rr=function(re){function fe(se){var M=he({type:"directed"},se);if("multi"in M&&!1!==M.multi)throw new me("DirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if("directed"!==M.type)throw new me('DirectedGraph.from: inconsistent "'+M.type+'" type in given options!');return re.call(this,M)||this}return et(fe,re),fe}(Cn),sr=function(re){function fe(se){var M=he({type:"undirected"},se);if("multi"in M&&!1!==M.multi)throw new me("UndirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if("undirected"!==M.type)throw new me('UndirectedGraph.from: inconsistent "'+M.type+'" type in given options!');return re.call(this,M)||this}return et(fe,re),fe}(Cn),Qn=function(re){function fe(se){var M=he({multi:!0},se);if("multi"in M&&!0!==M.multi)throw new me("MultiGraph.from: inconsistent indication that the graph should be simple in given options!");return re.call(this,M)||this}return et(fe,re),fe}(Cn),Wi=function(re){function fe(se){var M=he({type:"directed",multi:!0},se);if("multi"in M&&!0!==M.multi)throw new me("MultiDirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if("directed"!==M.type)throw new me('MultiDirectedGraph.from: inconsistent "'+M.type+'" type in given options!');return re.call(this,M)||this}return et(fe,re),fe}(Cn),Ca=function(re){function fe(se){var M=he({type:"undirected",multi:!0},se);if("multi"in M&&!0!==M.multi)throw new me("MultiUndirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if("undirected"!==M.type)throw new me('MultiUndirectedGraph.from: inconsistent "'+M.type+'" type in given options!');return re.call(this,M)||this}return et(fe,re),fe}(Cn);function Qr(re){re.from=function(fe,se){var M=he({},fe.options,se),L=new re(M);return L.import(fe),L}}return Qr(Cn),Qr(rr),Qr(sr),Qr(Qn),Qr(Wi),Qr(Ca),Cn.Graph=Cn,Cn.DirectedGraph=rr,Cn.UndirectedGraph=sr,Cn.MultiGraph=Qn,Cn.MultiDirectedGraph=Wi,Cn.MultiUndirectedGraph=Ca,Cn.InvalidArgumentsGraphError=me,Cn.NotFoundGraphError=ne,Cn.UsageGraphError=ye,Cn}()},1524:(Ut,it,et)=>{var yt;!function(ee,Dt,dt,Y){"use strict";var T,Se=["","webkit","Moz","MS","ms","o"],he=Dt.createElement("div"),j=Math.round,k=Math.abs,Q=Date.now;function H(be,De,Ge){return setTimeout(A(be,Ge),De)}function v(be,De,Ge){return!!Array.isArray(be)&&(C(be,Ge[De],Ge),!0)}function C(be,De,Ge){var vt;if(be)if(be.forEach)be.forEach(De,Ge);else if(be.length!==Y)for(vt=0;vt\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",ui=ee.console&&(ee.console.warn||ee.console.log);return ui&&ui.call(ee.console,vt,Xt),be.apply(this,arguments)}}T="function"!=typeof Object.assign?function(De){if(De===Y||null===De)throw new TypeError("Cannot convert undefined or null to object");for(var Ge=Object(De),vt=1;vt-1}function K(be){return be.trim().split(/\s+/g)}function E(be,De,Ge){if(be.indexOf&&!Ge)return be.indexOf(De);for(var vt=0;vtxs[De]}):vt.sort()),vt}function ae(be,De){for(var Ge,vt,$t=De[0].toUpperCase()+De.slice(1),Xt=0;Xt1&&!Ge.firstMultiple?Ge.firstMultiple=Tt(De):1===$t&&(Ge.firstMultiple=!1);var Xt=Ge.firstInput,ui=Ge.firstMultiple,Vr=ui?ui.center:Xt.center,Jr=De.center=kt(vt);De.timeStamp=Q(),De.deltaTime=De.timeStamp-Xt.timeStamp,De.angle=Mi(Vr,Jr),De.distance=Yn(Vr,Jr),function(be,De){var Ge=De.center,vt=be.offsetDelta||{},$t=be.prevDelta||{},Xt=be.prevInput||{};(1===De.eventType||4===Xt.eventType)&&($t=be.prevDelta={x:Xt.deltaX||0,y:Xt.deltaY||0},vt=be.offsetDelta={x:Ge.x,y:Ge.y}),De.deltaX=$t.x+(Ge.x-vt.x),De.deltaY=$t.y+(Ge.y-vt.y)}(Ge,De),De.offsetDirection=Nn(De.deltaX,De.deltaY);var xs=In(De.deltaTime,De.deltaX,De.deltaY);De.overallVelocityX=xs.x,De.overallVelocityY=xs.y,De.overallVelocity=k(xs.x)>k(xs.y)?xs.x:xs.y,De.scale=ui?function(be,De){return Yn(De[0],De[1],pt)/Yn(be[0],be[1],pt)}(ui.pointers,vt):1,De.rotation=ui?function(be,De){return Mi(De[1],De[0],pt)+Mi(be[1],be[0],pt)}(ui.pointers,vt):0,De.maxPointers=Ge.prevInput?De.pointers.length>Ge.prevInput.maxPointers?De.pointers.length:Ge.prevInput.maxPointers:De.pointers.length,function(be,De){var $t,Xt,ui,Vr,Ge=be.lastInterval||De,vt=De.timeStamp-Ge.timeStamp;if(8!=De.eventType&&(vt>25||Ge.velocity===Y)){var Jr=De.deltaX-Ge.deltaX,xs=De.deltaY-Ge.deltaY,Zn=In(vt,Jr,xs);Xt=Zn.x,ui=Zn.y,$t=k(Zn.x)>k(Zn.y)?Zn.x:Zn.y,Vr=Nn(Jr,xs),be.lastInterval=De}else $t=Ge.velocity,Xt=Ge.velocityX,ui=Ge.velocityY,Vr=Ge.direction;De.velocity=$t,De.velocityX=Xt,De.velocityY=ui,De.direction=Vr}(Ge,De);var Zn=be.element;I(De.srcEvent.target,Zn)&&(Zn=De.srcEvent.target),De.target=Zn}(be,Ge),be.emit("hammer.input",Ge),be.recognize(Ge),be.session.prevInput=Ge}function Tt(be){for(var De=[],Ge=0;Ge=k(De)?be<0?2:4:De<0?8:16}function Yn(be,De,Ge){Ge||(Ge=_t);var vt=De[Ge[0]]-be[Ge[0]],$t=De[Ge[1]]-be[Ge[1]];return Math.sqrt(vt*vt+$t*$t)}function Mi(be,De,Ge){return Ge||(Ge=_t),180*Math.atan2(De[Ge[1]]-be[Ge[1]],De[Ge[0]]-be[Ge[0]])/Math.PI}we.prototype={handler:function(){},init:function(){this.evEl&&X(this.element,this.evEl,this.domHandler),this.evTarget&&X(this.target,this.evTarget,this.domHandler),this.evWin&&X(Te(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&ue(this.element,this.evEl,this.domHandler),this.evTarget&&ue(this.target,this.evTarget,this.domHandler),this.evWin&&ue(Te(this.element),this.evWin,this.domHandler)}};var Ls={mousedown:1,mousemove:2,mouseup:4},fs="mousedown",Bs="mousemove mouseup";function Kr(){this.evEl=fs,this.evWin=Bs,this.pressed=!1,we.apply(this,arguments)}S(Kr,we,{handler:function(De){var Ge=Ls[De.type];1&Ge&&0===De.button&&(this.pressed=!0),2&Ge&&1!==De.which&&(Ge=4),this.pressed&&(4&Ge&&(this.pressed=!1),this.callback(this.manager,Ge,{pointers:[De],changedPointers:[De],pointerType:Qe,srcEvent:De}))}});var xa={pointerdown:1,pointermove:2,pointerup:4,pointercancel:8,pointerout:8},kl={2:$e,3:"pen",4:Qe,5:"kinect"},Sa="pointerdown",ws="pointermove pointerup pointercancel";function en(){this.evEl=Sa,this.evWin=ws,we.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}ee.MSPointerEvent&&!ee.PointerEvent&&(Sa="MSPointerDown",ws="MSPointerMove MSPointerUp MSPointerCancel"),S(en,we,{handler:function(De){var Ge=this.store,vt=!1,$t=De.type.toLowerCase().replace("ms",""),Xt=xa[$t],ui=kl[De.pointerType]||De.pointerType,Vr=ui==$e,Jr=E(Ge,De.pointerId,"pointerId");1&Xt&&(0===De.button||Vr)?Jr<0&&(Ge.push(De),Jr=Ge.length-1):12&Xt&&(vt=!0),!(Jr<0)&&(Ge[Jr]=De,this.callback(this.manager,Xt,{pointers:Ge,changedPointers:[De],pointerType:ui,srcEvent:De}),vt&&Ge.splice(Jr,1))}});var nl={touchstart:1,touchmove:2,touchend:4,touchcancel:8},rt="touchstart",lt="touchstart touchmove touchend touchcancel";function ht(){this.evTarget=rt,this.evWin=lt,this.started=!1,we.apply(this,arguments)}function ge(be,De){var Ge=$(be.touches),vt=$(be.changedTouches);return 12&De&&(Ge=Z(Ge.concat(vt),"identifier",!0)),[Ge,vt]}S(ht,we,{handler:function(De){var Ge=nl[De.type];if(1===Ge&&(this.started=!0),this.started){var vt=ge.call(this,De,Ge);12&Ge&&vt[0].length-vt[1].length==0&&(this.started=!1),this.callback(this.manager,Ge,{pointers:vt[0],changedPointers:vt[1],pointerType:$e,srcEvent:De})}}});var ve={touchstart:1,touchmove:2,touchend:4,touchcancel:8},Be="touchstart touchmove touchend touchcancel";function ut(){this.evTarget=Be,this.targetIds={},we.apply(this,arguments)}function Je(be,De){var Ge=$(be.touches),vt=this.targetIds;if(3&De&&1===Ge.length)return vt[Ge[0].identifier]=!0,[Ge,Ge];var $t,Xt,ui=$(be.changedTouches),Vr=[],Jr=this.target;if(Xt=Ge.filter(function(xs){return I(xs.target,Jr)}),1===De)for($t=0;$t-1&&vt.splice(Xt,1)},2500)}}function ci(be){for(var De=be.srcEvent.clientX,Ge=be.srcEvent.clientY,vt=0;vt-1&&this.requireFail.splice(De,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(be){return!!this.simultaneous[be.id]},emit:function(be){var De=this,Ge=this.state;function vt($t){De.manager.emit($t,be)}Ge<8&&vt(De.options.event+We(Ge)),vt(De.options.event),be.additionalEvent&&vt(be.additionalEvent),Ge>=8&&vt(De.options.event+We(Ge))},tryEmit:function(be){if(this.canEmit())return this.emit(be);this.state=32},canEmit:function(){for(var be=0;beDe.threshold&&$t&De.direction},attrTest:function(be){return vn.prototype.attrTest.call(this,be)&&(2&this.state||!(2&this.state)&&this.directionTest(be))},emit:function(be){this.pX=be.deltaX,this.pY=be.deltaY;var De=qt(be.direction);De&&(be.additionalEvent=this.options.event+De),this._super.emit.call(this,be)}}),S(Zr,vn,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[sr]},attrTest:function(be){return this._super.attrTest.call(this,be)&&(Math.abs(be.scale-1)>this.options.threshold||2&this.state)},emit:function(be){1!==be.scale&&(be.additionalEvent=this.options.event+(be.scale<1?"in":"out")),this._super.emit.call(this,be)}}),S(Js,Pt,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return["auto"]},process:function(be){var De=this.options,Ge=be.pointers.length===De.pointers,vt=be.distanceDe.time;if(this._input=be,!vt||!Ge||12&be.eventType&&!$t)this.reset();else if(1&be.eventType)this.reset(),this._timer=H(function(){this.state=8,this.tryEmit()},De.time,this);else if(4&be.eventType)return 8;return 32},reset:function(){clearTimeout(this._timer)},emit:function(be){8===this.state&&(be&&4&be.eventType?this.manager.emit(this.options.event+"up",be):(this._input.timeStamp=Q(),this.manager.emit(this.options.event,this._input)))}}),S(Fl,vn,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[sr]},attrTest:function(be){return this._super.attrTest.call(this,be)&&(Math.abs(be.rotation)>this.options.threshold||2&this.state)}}),S(fo,vn,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:30,pointers:1},getTouchAction:function(){return Es.prototype.getTouchAction.call(this)},attrTest:function(be){var Ge,De=this.options.direction;return 30&De?Ge=be.overallVelocity:6&De?Ge=be.overallVelocityX:24&De&&(Ge=be.overallVelocityY),this._super.attrTest.call(this,be)&&De&be.offsetDirection&&be.distance>this.options.threshold&&be.maxPointers==this.options.pointers&&k(Ge)>this.options.velocity&&4&be.eventType},emit:function(be){var De=qt(be.offsetDirection);De&&this.manager.emit(this.options.event+De,be),this.manager.emit(this.options.event,be)}}),S(Br,Pt,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[rr]},process:function(be){var De=this.options,Ge=be.pointers.length===De.pointers,vt=be.distance"']/g,ws=RegExp(kl.source),en=RegExp(Sa.source),nl=/<%-([\s\S]+?)%>/g,rt=/<%([\s\S]+?)%>/g,lt=/<%=([\s\S]+?)%>/g,ht=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ge=/^\w*$/,ve=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Be=/[\\^$.*+?()[\]{}|]/g,ut=RegExp(Be.source),Je=/^\s+/,Mt=/\s/,It=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Ot=/\{\n\/\* \[wrapped with (.+)\] \*/,Qt=/,? & /,zn=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ci=/[()=,{}\[\]\/\s]/,Rn=/\\(\\)?/g,bn=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Xn=/\w*$/,Cn=/^[-+]0x[0-9a-f]+$/i,rr=/^0b[01]+$/i,sr=/^\[object .+?Constructor\]$/,Qn=/^0o[0-7]+$/i,Wi=/^(?:0|[1-9]\d*)$/,Ca=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Qr=/($^)/,re=/['\n\r\u2028\u2029\\]/g,fe="\\ud800-\\udfff",J="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Ee="\\u2700-\\u27bf",Fe="a-z\\xdf-\\xf6\\xf8-\\xff",St="A-Z\\xc0-\\xd6\\xd8-\\xde",vn="\\ufe0e\\ufe0f",Es="\\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",Js="["+fe+"]",Fl="["+Es+"]",fo="["+J+"]",Br="\\d+",Vs="["+Ee+"]",Ac="["+Fe+"]",xn="[^"+fe+Es+Br+Ee+Fe+St+"]",po="\\ud83c[\\udffb-\\udfff]",Ta="[^"+fe+"]",Ed="(?:\\ud83c[\\udde6-\\uddff]){2}",be="[\\ud800-\\udbff][\\udc00-\\udfff]",De="["+St+"]",vt="(?:"+Ac+"|"+xn+")",$t="(?:"+De+"|"+xn+")",Xt="(?:['\u2019](?:d|ll|m|re|s|t|ve))?",ui="(?:['\u2019](?:D|LL|M|RE|S|T|VE))?",Vr="(?:"+fo+"|"+po+")?",Jr="["+vn+"]?",C1=Jr+Vr+"(?:\\u200d(?:"+[Ta,Ed,be].join("|")+")"+Jr+Vr+")*",xd="(?:"+[Vs,Ed,be].join("|")+")"+C1,er="(?:"+[Ta+fo+"?",fo,Ed,be,Js].join("|")+")",fp=RegExp("['\u2019]","g"),n_=RegExp(fo,"g"),Oh=RegExp(po+"(?="+po+")|"+er+C1,"g"),iv=RegExp([De+"?"+Ac+"+"+Xt+"(?="+[Fl,De,"$"].join("|")+")",$t+"+"+ui+"(?="+[Fl,De+vt,"$"].join("|")+")",De+"?"+vt+"+"+Xt,De+"+"+ui,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Br,xd].join("|"),"g"),T1=RegExp("[\\u200d"+fe+J+vn+"]"),Bl=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Rh=["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"],A1=-1,rn={};rn[kt]=rn[In]=rn[Nn]=rn[Yn]=rn[Mi]=rn[xi]=rn[Xr]=rn[Ls]=rn[fs]=!0,rn[Qe]=rn[tt]=rn[Ze]=rn[ze]=rn[Tt]=rn[Le]=rn[Me]=rn[Ue]=rn[ke]=rn[q]=rn[pe]=rn[_t]=rn[pt]=rn[we]=rn[V]=!1;var or={};or[Qe]=or[tt]=or[Ze]=or[Tt]=or[ze]=or[Le]=or[kt]=or[In]=or[Nn]=or[Yn]=or[Mi]=or[ke]=or[q]=or[pe]=or[_t]=or[pt]=or[we]=or[B]=or[xi]=or[Xr]=or[Ls]=or[fs]=!0,or[Me]=or[Ue]=or[V]=!1;var tn={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},M1=parseFloat,av=parseInt,Nt="object"==typeof global&&global&&global.Object===Object&&global,js="object"==typeof self&&self&&self.Object===Object&&self,Ui=Nt||js||Function("return this")(),Vl=it&&!it.nodeType&&it,Aa=Vl&&Ut&&!Ut.nodeType&&Ut,No=Aa&&Aa.exports===Vl,i_=No&&Nt.process,xr=function(){try{return Aa&&Aa.require&&Aa.require("util").types||i_&&i_.binding&&i_.binding("util")}catch(Rt){}}(),an=xr&&xr.isArrayBuffer,hi=xr&&xr.isDate,ur=xr&&xr.isMap,go=xr&&xr.isRegExp,Mc=xr&&xr.isSet,ss=xr&&xr.isTypedArray;function os(at,Rt,Ct){switch(Ct.length){case 0:return at.call(Rt);case 1:return at.call(Rt,Ct[0]);case 2:return at.call(Rt,Ct[0],Ct[1]);case 3:return at.call(Rt,Ct[0],Ct[1],Ct[2])}return at.apply(Rt,Ct)}function jr(at,Rt,Ct,hn){for(var Mn=-1,Li=null==at?0:at.length;++Mn-1}function Ph(at,Rt,Ct){for(var hn=-1,Mn=null==at?0:at.length;++hn-1;);return Ct}function R1(at,Rt){for(var Ct=at.length;Ct--&&il(Rt,at[Ct],0)>-1;);return Ct}function rF(at,Rt){for(var Ct=at.length,hn=0;Ct--;)at[Ct]===Rt&&++hn;return hn}var sF=Jo({\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"}),oF=Jo({"&":"&","<":"<",">":">",'"':""","'":"'"});function aF(at){return"\\"+tn[at]}function Fh(at){return T1.test(at)}function cv(at){var Rt=-1,Ct=Array(at.size);return at.forEach(function(hn,Mn){Ct[++Rt]=[Mn,hn]}),Ct}function P1(at,Rt){return function(Ct){return at(Rt(Ct))}}function xu(at,Rt){for(var Ct=-1,hn=at.length,Mn=0,Li=[];++Ct",""":'"',"'":"'"}),Bh=function at(Rt){var d,Ct=(Rt=null==Rt?Ui:Bh.defaults(Ui.Object(),Rt,Bh.pick(Ui,Rh))).Array,hn=Rt.Date,Mn=Rt.Error,Li=Rt.Function,es=Rt.Math,Yi=Rt.Object,u_=Rt.RegExp,d_=Rt.String,Ia=Rt.TypeError,dr=Ct.prototype,Su=Yi.prototype,gp=Rt["__core-js_shared__"],Sr=Li.prototype.toString,Xi=Su.hasOwnProperty,fF=0,Vh=(d=/[^.]+$/.exec(gp&&gp.keys&&gp.keys.IE_PROTO||""))?"Symbol(src)_1."+d:"",eo=Su.toString,F1=Sr.call(Yi),h_=Ui._,Dd=u_("^"+Sr.call(Xi).replace(Be,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),zs=No?Rt.Buffer:ee,Ul=Rt.Symbol,Id=Rt.Uint8Array,hv=zs?zs.allocUnsafe:ee,Oa=P1(Yi.getPrototypeOf,Yi),f_=Yi.create,mp=Su.propertyIsEnumerable,Ln=dr.splice,L1=Ul?Ul.isConcatSpreadable:ee,jh=Ul?Ul.iterator:ee,Cu=Ul?Ul.toStringTag:ee,_p=function(){try{var d=jc(Yi,"defineProperty");return d({},"",{}),d}catch(p){}}(),fv=Rt.clearTimeout!==Ui.clearTimeout&&Rt.clearTimeout,B1=hn&&hn.now!==Ui.Date.now&&hn.now,V1=Rt.setTimeout!==Ui.setTimeout&&Rt.setTimeout,Vt=es.ceil,Si=es.floor,_r=Yi.getOwnPropertySymbols,as=zs?zs.isBuffer:ee,p_=Rt.isFinite,Uh=dr.join,sl=P1(Yi.keys,Yi),zr=es.max,ps=es.min,pF=hn.now,j1=Rt.parseInt,zh=es.random,yp=dr.reverse,Cs=jc(Rt,"DataView"),mo=jc(Rt,"Map"),bp=jc(Rt,"Promise"),Ra=jc(Rt,"Set"),Fo=jc(Rt,"WeakMap"),Hh=jc(Yi,"create"),Gh=Fo&&new Fo,Od={},U1=Lu(Cs),g_=Lu(mo),m_=Lu(bp),pv=Lu(Ra),__=Lu(Fo),vp=Ul?Ul.prototype:ee,Rd=vp?vp.valueOf:ee,$h=vp?vp.toString:ee;function xe(d){if(Ar(d)&&!On(d)&&!(d instanceof fi)){if(d instanceof Lo)return d;if(Xi.call(d,"__wrapped__"))return sf(d)}return new Lo(d)}var Tu=function(){function d(){}return function(p){if(!Tr(p))return{};if(f_)return f_(p);d.prototype=p;var _=new d;return d.prototype=ee,_}}();function Wh(){}function Lo(d,p){this.__wrapped__=d,this.__actions__=[],this.__chain__=!!p,this.__index__=0,this.__values__=ee}function fi(d){this.__wrapped__=d,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=ye,this.__views__=[]}function _o(d){var p=-1,_=null==d?0:d.length;for(this.clear();++p<_;){var F=d[p];this.set(F[0],F[1])}}function zl(d){var p=-1,_=null==d?0:d.length;for(this.clear();++p<_;){var F=d[p];this.set(F[0],F[1])}}function ol(d){var p=-1,_=null==d?0:d.length;for(this.clear();++p<_;){var F=d[p];this.set(F[0],F[1])}}function Pa(d){var p=-1,_=null==d?0:d.length;for(this.__data__=new ol;++p<_;)this.add(d[p])}function Na(d){var p=this.__data__=new zl(d);this.size=p.size}function Yh(d,p){var _=On(d),F=!_&&gl(d),le=!_&&!F&&ml(d),Ae=!_&&!F&&!le&&df(d),He=_||F||le||Ae,Ye=He?Md(d.length,d_):[],ct=Ye.length;for(var Ft in d)(p||Xi.call(d,Ft))&&(!He||!("length"==Ft||le&&("offset"==Ft||"parent"==Ft)||Ae&&("buffer"==Ft||"byteLength"==Ft||"byteOffset"==Ft)||jo(Ft,ct)))&&Ye.push(Ft);return Ye}function w_(d){var p=d.length;return p?d[Hl(0,p-1)]:ee}function yv(d,p){return qd(no(d),Au(p,0,d.length))}function Pd(d){return qd(no(d))}function E_(d,p,_){(_!==ee&&!Dn(d[p],_)||_===ee&&!(p in d))&&ll(d,p,_)}function al(d,p,_){var F=d[p];(!Xi.call(d,p)||!Dn(F,_)||_===ee&&!(p in d))&&ll(d,p,_)}function Nd(d,p){for(var _=d.length;_--;)if(Dn(d[_][0],p))return _;return-1}function Cp(d,p,_,F){return Pc(d,function(le,Ae,He){p(F,le,_(le),He)}),F}function Q1(d,p){return d&&Fa(p,Is(p),d)}function ll(d,p,_){"__proto__"==p&&_p?_p(d,p,{configurable:!0,enumerable:!0,value:_,writable:!0}):d[p]=_}function x_(d,p){for(var _=-1,F=p.length,le=Ct(F),Ae=null==d;++_=p?d:p)),d}function Hs(d,p,_,F,le,Ae){var He,Ye=1&p,ct=2&p,Ft=4&p;if(_&&(He=le?_(d,F,le,Ae):_(d)),He!==ee)return He;if(!Tr(d))return d;var Lt=On(d);if(Lt){if(He=function(d){var p=d.length,_=new d.constructor(p);return p&&"string"==typeof d[0]&&Xi.call(d,"index")&&(_.index=d.index,_.input=d.input),_}(d),!Ye)return no(d,He)}else{var Gt=$s(d),nn=Gt==Ue||Gt==qe;if(ml(d))return Pp(d,Ye);if(Gt==pe||Gt==Qe||nn&&!le){if(He=ct||nn?{}:Uv(d),!Ye)return ct?function(d,p){return Fa(d,Bv(d),p)}(d,function(d,p){return d&&Fa(p,ro(p),d)}(He,d)):function(d,p){return Fa(d,V_(d),p)}(d,Q1(He,d))}else{if(!or[Gt])return le?d:{};He=function(d,p,_){var F=d.constructor;switch(p){case Ze:return Pu(d);case ze:case Le:return new F(+d);case Tt:return function(d,p){var _=p?Pu(d.buffer):d.buffer;return new d.constructor(_,d.byteOffset,d.byteLength)}(d,_);case kt:case In:case Nn:case Yn:case Mi:case xi:case Xr:case Ls:case fs:return N_(d,_);case ke:return new F;case q:case we:return new F(d);case _t:return function(d){var p=new d.constructor(d.source,Xn.exec(d));return p.lastIndex=d.lastIndex,p}(d);case pt:return new F;case B:return function(d){return Rd?Yi(Rd.call(d)):{}}(d)}}(d,Gt,Ye)}}Ae||(Ae=new Na);var wn=Ae.get(d);if(wn)return wn;Ae.set(d,He),yA(d)?d.forEach(function(Bn){He.add(Hs(Bn,p,_,Bn,d,Ae))}):pA(d)&&d.forEach(function(Bn,mi){He.set(mi,Hs(Bn,p,_,mi,d,Ae))});var gi=Lt?ee:(Ft?ct?L_:ql:ct?ro:Is)(d);return Us(gi||d,function(Bn,mi){gi&&(Bn=d[mi=Bn]),al(He,mi,Hs(Bn,p,_,mi,d,Ae))}),He}function Tp(d,p,_){var F=_.length;if(null==d)return!F;for(d=Yi(d);F--;){var le=_[F],He=d[le];if(He===ee&&!(le in d)||!(0,p[le])(He))return!1}return!0}function Xh(d,p,_){if("function"!=typeof d)throw new Ia(Se);return nf(function(){d.apply(ee,_)},p)}function Rc(d,p,_,F){var le=-1,Ae=jl,He=!0,Ye=d.length,ct=[],Ft=p.length;if(!Ye)return ct;_&&(p=qi(p,ta(_))),F?(Ae=Ph,He=!1):p.length>=200&&(Ae=kh,He=!1,p=new Pa(p));e:for(;++le-1},zl.prototype.set=function(d,p){var _=this.__data__,F=Nd(_,d);return F<0?(++this.size,_.push([d,p])):_[F][1]=p,this},ol.prototype.clear=function(){this.size=0,this.__data__={hash:new _o,map:new(mo||zl),string:new _o}},ol.prototype.delete=function(d){var p=Gs(this,d).delete(d);return this.size-=p?1:0,p},ol.prototype.get=function(d){return Gs(this,d).get(d)},ol.prototype.has=function(d){return Gs(this,d).has(d)},ol.prototype.set=function(d,p){var _=Gs(this,d),F=_.size;return _.set(d,p),this.size+=_.size==F?0:1,this},Pa.prototype.add=Pa.prototype.push=function(d){return this.__data__.set(d,W),this},Pa.prototype.has=function(d){return this.__data__.has(d)},Na.prototype.clear=function(){this.__data__=new zl,this.size=0},Na.prototype.delete=function(d){var p=this.__data__,_=p.delete(d);return this.size=p.size,_},Na.prototype.get=function(d){return this.__data__.get(d)},Na.prototype.has=function(d){return this.__data__.has(d)},Na.prototype.set=function(d,p){var _=this.__data__;if(_ instanceof zl){var F=_.__data__;if(!mo||F.length<199)return F.push([d,p]),this.size=++_.size,this;_=this.__data__=new ol(F)}return _.set(d,p),this.size=_.size,this};var Pc=dl(cl),C_=dl(Ap,!0);function vv(d,p){var _=!0;return Pc(d,function(F,le,Ae){return _=!!p(F,le,Ae)}),_}function Kh(d,p,_){for(var F=-1,le=d.length;++F0&&_(Ye)?p>1?Ts(Ye,p-1,_,F,le):Ur(le,Ye):F||(le[le.length]=Ye)}return le}var kd=Dv(),Fd=Dv(!0);function cl(d,p){return d&&kd(d,p,Is)}function Ap(d,p){return d&&Fd(d,p,Is)}function Qh(d,p){return Ma(p,function(_){return ua(d[_])})}function na(d,p){for(var _=0,F=(p=Lc(p,d)).length;null!=d&&_p}function Ld(d,p){return null!=d&&Xi.call(d,p)}function Bd(d,p){return null!=d&&p in Yi(d)}function Mu(d,p,_){for(var F=_?Ph:jl,le=d[0].length,Ae=d.length,He=Ae,Ye=Ct(Ae),ct=1/0,Ft=[];He--;){var Lt=d[He];He&&p&&(Lt=qi(Lt,ta(p))),ct=ps(Lt.length,ct),Ye[He]=!_&&(p||le>=120&&Lt.length>=120)?new Pa(He&&Lt):ee}Lt=d[0];var Gt=-1,nn=Ye[0];e:for(;++Gt=Ye?ct:ct*("desc"==_[F]?-1:1)}return d.index-p.index}(Ae,He,_)});Ct--;)at[Ct]=at[Ct].value;return at}(nT(d,function(Ae,He,Ye){return{criteria:qi(p,function(Ft){return Ft(Ae)}),index:++F,value:Ae}}))}function Cv(d,p,_){for(var F=-1,le=p.length,Ae={};++F-1;)Ye!==d&&Ln.call(Ye,ct,1),Ln.call(d,ct,1);return d}function Jh(d,p){for(var _=d?p.length:0,F=_-1;_--;){var le=p[_];if(_==F||le!==Ae){var Ae=le;jo(le)?Ln.call(d,le,1):Iu(d,le)}}return d}function Hl(d,p){return d+Si(zh()*(p-d+1))}function Dp(d,p){var _="";if(!d||p<1||p>Te)return _;do{p%2&&(_+=d),(p=Si(p/2))&&(d+=d)}while(p);return _}function pi(d,p){return Hp(yT(d,p,so),d+"")}function rT(d){return w_(nh(d))}function xF(d,p){var _=nh(d);return qd(_,Au(p,0,_.length))}function Ip(d,p,_,F){if(!Tr(d))return d;for(var le=-1,Ae=(p=Lc(p,d)).length,He=Ae-1,Ye=d;null!=Ye&&++lele?0:le+p),(_=_>le?le:_)<0&&(_+=le),le=p>_?0:_-p>>>0,p>>>=0;for(var Ae=Ct(le);++F>>1,He=d[Ae];null!==He&&!da(He)&&(_?He<=p:He=200){var Ft=p?null:F_(d);if(Ft)return a_(Ft);He=!1,le=kh,ct=new Pa}else ct=p?[]:Ye;e:for(;++F=F?d:Ms(d,p,_)}var aT=fv||function(d){return Ui.clearTimeout(d)};function Pp(d,p){if(p)return d.slice();var _=d.length,F=hv?hv(_):new d.constructor(_);return d.copy(F),F}function Pu(d){var p=new d.constructor(d.byteLength);return new Id(p).set(new Id(d)),p}function N_(d,p){var _=p?Pu(d.buffer):d.buffer;return new d.constructor(_,d.byteOffset,d.length)}function Bc(d,p){if(d!==p){var _=d!==ee,F=null===d,le=d==d,Ae=da(d),He=p!==ee,Ye=null===p,ct=p==p,Ft=da(p);if(!Ye&&!Ft&&!Ae&&d>p||Ae&&He&&ct&&!Ye&&!Ft||F&&He&&ct||!_&&ct||!le)return 1;if(!F&&!Ae&&!Ft&&d1?_[le-1]:ee,He=le>2?_[2]:ee;for(Ae=d.length>3&&"function"==typeof Ae?(le--,Ae):ee,He&&Ws(_[0],_[1],He)&&(Ae=le<3?ee:Ae,le=1),p=Yi(p);++F-1?le[Ae?p[He]:He]:ee}}function ku(d){return hl(function(p){var _=p.length,F=_,le=Lo.prototype.thru;for(d&&p.reverse();F--;){var Ae=p[F];if("function"!=typeof Ae)throw new Ia(Se);if(le&&!He&&"wrapper"==jp(Ae))var He=new Lo([],!0)}for(F=He?F:_;++F<_;){var Ye=jp(Ae=p[F]),ct="wrapper"==Ye?B_(Ae):ee;He=ct&&Up(ct[0])&&424==ct[1]&&!ct[4].length&&1==ct[9]?He[jp(ct[0])].apply(He,ct[3]):1==Ae.length&&Up(Ae)?He[Ye]():He.thru(Ae)}return function(){var Ft=arguments,Lt=Ft[0];if(He&&1==Ft.length&&On(Lt))return He.plant(Lt).value();for(var Gt=0,nn=_?p[Gt].apply(this,Ft):Lt;++Gt<_;)nn=p[Gt].call(this,nn);return nn}})}function Vc(d,p,_,F,le,Ae,He,Ye,ct,Ft){var Lt=p&X,Gt=1&p,nn=2&p,wn=24&p,Fn=512&p,gi=nn?ee:Gd(d);return function Bn(){for(var mi=arguments.length,Di=Ct(mi),wo=mi;wo--;)Di[wo]=arguments[wo];if(wn)var qs=Wd(Bn),ha=rF(Di,qs);if(F&&(Di=zd(Di,F,le,wn)),Ae&&(Di=Mv(Di,Ae,He,wn)),mi-=ha,wn&&mi1&&Di.reverse(),Lt&&ctYe))return!1;var Ft=Ae.get(d),Lt=Ae.get(p);if(Ft&&Lt)return Ft==p&&Lt==d;var Gt=-1,nn=!0,wn=2&_?new Pa:ee;for(Ae.set(d,p),Ae.set(p,d);++Gt-1&&d%1==0&&d1?"& ":"")+p[F],p=p.join(_>2?", ":" "),d.replace(It,"{\n/* [wrapped with "+p+"] */\n")}(F,function(d,p){return Us(st,function(_){var F="_."+_[0];p&_[1]&&!jl(d,F)&&d.push(F)}),d.sort()}(function(d){var p=d.match(Ot);return p?p[1].split(Qt):[]}(F),_)))}function $_(d){var p=0,_=0;return function(){var F=pF(),le=16-(F-_);if(_=F,le>0){if(++p>=800)return arguments[0]}else p=0;return d.apply(ee,arguments)}}function qd(d,p){var _=-1,F=d.length,le=F-1;for(p=p===ee?F:p;++_1?d[p-1]:ee;return _="function"==typeof _?(d.pop(),_):ee,HT(d,_)});function ty(d){var p=xe(d);return p.__chain__=!0,p}function Xd(d,p){return p(d)}var ny=hl(function(d){var p=d.length,_=p?d[0]:0,F=this.__wrapped__,le=function(Ae){return x_(Ae,d)};return!(p>1||this.__actions__.length)&&F instanceof fi&&jo(_)?((F=F.slice(_,+_+(p?1:0))).__actions__.push({func:Xd,args:[le],thisArg:ee}),new Lo(F,this.__chain__).thru(function(Ae){return p&&!Ae.length&&Ae.push(ee),Ae})):this.thru(le)}),WT=ts(function(d,p,_){Xi.call(d,_)?++d[_]:ll(d,_,1)}),KT=Ov(q_),QT=Ov(Y_);function oy(d,p){return(On(d)?Us:Pc)(d,kn(p,3))}function Wp(d,p){return(On(d)?Sd:C_)(d,kn(p,3))}var JT=ts(function(d,p,_){Xi.call(d,_)?d[_].push(p):ll(d,_,[p])}),cw=pi(function(d,p,_){var F=-1,le="function"==typeof p,Ae=bo(d)?Ct(d.length):[];return Pc(d,function(He){Ae[++F]=le?os(p,He,_):ka(He,p,_)}),Ae}),uw=ts(function(d,p,_){ll(d,_,p)});function pl(d,p){return(On(d)?qi:nT)(d,kn(p,3))}var hw=ts(function(d,p,_){d[_?0:1].push(p)},function(){return[[],[]]}),Yp=pi(function(d,p){if(null==d)return[];var _=p.length;return _>1&&Ws(d,p[0],p[1])?p=[]:_>2&&Ws(p[0],p[1],p[2])&&(p=[p[0]]),Zh(d,Ts(p,1),[])}),Bu=B1||function(){return Ui.Date.now()};function Xp(d,p,_){return p=_?ee:p,Wl(d,X,ee,ee,ee,ee,p=d&&null==p?d.length:p)}function ly(d,p){var _;if("function"!=typeof p)throw new Ia(Se);return d=ti(d),function(){return--d>0&&(_=p.apply(this,arguments)),d<=1&&(p=ee),_}}var cf=pi(function(d,p,_){var F=1;if(_.length){var le=xu(_,Wd(cf));F|=z}return Wl(d,F,p,_,le)}),Qd=pi(function(d,p,_){var F=3;if(_.length){var le=xu(_,Wd(Qd));F|=z}return Wl(p,F,d,_,le)});function bw(d,p,_){var F,le,Ae,He,Ye,ct,Ft=0,Lt=!1,Gt=!1,nn=!0;if("function"!=typeof d)throw new Ia(Se);function wn(Gi){var bl=F,Gc=le;return F=le=ee,Ft=Gi,He=d.apply(Gc,bl)}function Fn(Gi){return Ft=Gi,Ye=nf(mi,p),Lt?wn(Gi):He}function Bn(Gi){var bl=Gi-ct;return ct===ee||bl>=p||bl<0||Gt&&Gi-Ft>=Ae}function mi(){var Gi=Bu();if(Bn(Gi))return Di(Gi);Ye=nf(mi,function(Gi){var aM=p-(Gi-ct);return Gt?ps(aM,Ae-(Gi-Ft)):aM}(Gi))}function Di(Gi){return Ye=ee,nn&&F?wn(Gi):(F=le=ee,He)}function ha(){var Gi=Bu(),bl=Bn(Gi);if(F=arguments,le=this,ct=Gi,bl){if(Ye===ee)return Fn(ct);if(Gt)return aT(Ye),Ye=nf(mi,p),wn(ct)}return Ye===ee&&(Ye=nf(mi,p)),He}return p=vo(p)||0,Tr(_)&&(Lt=!!_.leading,Ae=(Gt="maxWait"in _)?zr(vo(_.maxWait)||0,p):Ae,nn="trailing"in _?!!_.trailing:nn),ha.cancel=function(){Ye!==ee&&aT(Ye),Ft=0,F=ct=le=Ye=ee},ha.flush=function(){return Ye===ee?He:Di(Bu())},ha}var iA=pi(function(d,p){return Xh(d,1,p)}),vw=pi(function(d,p,_){return Xh(d,vo(p)||0,_)});function uf(d,p){if("function"!=typeof d||null!=p&&"function"!=typeof p)throw new Ia(Se);var _=function(){var F=arguments,le=p?p.apply(this,F):F[0],Ae=_.cache;if(Ae.has(le))return Ae.get(le);var He=d.apply(this,F);return _.cache=Ae.set(le,He)||Ae,He};return _.cache=new(uf.Cache||ol),_}function dy(d){if("function"!=typeof d)throw new Ia(Se);return function(){var p=arguments;switch(p.length){case 0:return!d.call(this);case 1:return!d.call(this,p[0]);case 2:return!d.call(this,p[0],p[1]);case 3:return!d.call(this,p[0],p[1],p[2])}return!d.apply(this,p)}}uf.Cache=ol;var rA=oT(function(d,p){var _=(p=1==p.length&&On(p[0])?qi(p[0],ta(kn())):qi(Ts(p,1),ta(kn()))).length;return pi(function(F){for(var le=-1,Ae=ps(F.length,_);++le=p}),gl=Z1(function(){return arguments}())?Z1:function(d){return Ar(d)&&Xi.call(d,"callee")&&!mp.call(d,"callee")},On=Ct.isArray,Tw=an?ta(an):function(d){return Ar(d)&&As(d)==Ze};function bo(d){return null!=d&&fy(d.length)&&!ua(d)}function Cr(d){return Ar(d)&&bo(d)}var ml=as||Fy,Aw=hi?ta(hi):function(d){return Ar(d)&&As(d)==Le};function Ba(d){if(!Ar(d))return!1;var p=As(d);return p==Me||"[object DOMException]"==p||"string"==typeof d.message&&"string"==typeof d.name&&!Jp(d)}function ua(d){if(!Tr(d))return!1;var p=As(d);return p==Ue||p==qe||"[object AsyncFunction]"==p||"[object Proxy]"==p}function Zp(d){return"number"==typeof d&&d==ti(d)}function fy(d){return"number"==typeof d&&d>-1&&d%1==0&&d<=Te}function Tr(d){var p=typeof d;return null!=d&&("object"==p||"function"==p)}function Ar(d){return null!=d&&"object"==typeof d}var pA=ur?ta(ur):function(d){return Ar(d)&&$s(d)==ke};function _A(d){return"number"==typeof d||Ar(d)&&As(d)==q}function Jp(d){if(!Ar(d)||As(d)!=pe)return!1;var p=Oa(d);if(null===p)return!0;var _=Xi.call(p,"constructor")&&p.constructor;return"function"==typeof _&&_ instanceof _&&Sr.call(_)==F1}var Ow=go?ta(go):function(d){return Ar(d)&&As(d)==_t},yA=Mc?ta(Mc):function(d){return Ar(d)&&$s(d)==pt};function gy(d){return"string"==typeof d||!On(d)&&Ar(d)&&As(d)==we}function da(d){return"symbol"==typeof d||Ar(d)&&As(d)==B}var df=ss?ta(ss):function(d){return Ar(d)&&fy(d.length)&&!!rn[As(d)]},Uc=Lp(Sv),my=Lp(function(d,p){return d<=p});function Rw(d){if(!d)return[];if(bo(d))return gy(d)?rl(d):no(d);if(jh&&d[jh])return function(at){for(var Rt,Ct=[];!(Rt=at.next()).done;)Ct.push(Rt.value);return Ct}(d[jh]());var p=$s(d);return(p==ke?cv:p==pt?a_:nh)(d)}function _l(d){return d?(d=vo(d))===te||d===-te?17976931348623157e292*(d<0?-1:1):d==d?d:0:0===d?d:0}function ti(d){var p=_l(d),_=p%1;return p==p?_?p-_:p:0}function _y(d){return d?Au(ti(d),0,ye):0}function vo(d){if("number"==typeof d)return d;if(da(d))return NaN;if(Tr(d)){var p="function"==typeof d.valueOf?d.valueOf():d;d=Tr(p)?p+"":p}if("string"!=typeof d)return 0===d?d:+d;d=lv(d);var _=rr.test(d);return _||Qn.test(d)?av(d.slice(2),_?2:8):Cn.test(d)?NaN:+d}function Pw(d){return Fa(d,ro(d))}function Hi(d){return null==d?"":Vo(d)}var bA=Gl(function(d,p){if(zp(p)||bo(p))Fa(p,Is(p),d);else for(var _ in p)Xi.call(p,_)&&al(d,_,p[_])}),vA=Gl(function(d,p){Fa(p,ro(p),d)}),Zd=Gl(function(d,p,_,F){Fa(p,ro(p),d,F)}),wA=Gl(function(d,p,_,F){Fa(p,Is(p),d,F)}),Nw=hl(x_),xA=pi(function(d,p){d=Yi(d);var _=-1,F=p.length,le=F>2?p[2]:ee;for(le&&Ws(p[0],p[1],le)&&(F=1);++_1),Ae}),Fa(d,L_(d),_),F&&(_=Hs(_,7,Bp));for(var le=p.length;le--;)Iu(_,p[le]);return _}),MA=hl(function(d,p){return null==d?{}:function(d,p){return Cv(d,p,function(_,F){return eg(d,F)})}(d,p)});function Uw(d,p){if(null==d)return{};var _=qi(L_(d),function(F){return[F]});return p=kn(p),Cv(d,_,function(F,le){return p(F,le[0])})}var DA=Fu(Is),Hw=Fu(ro);function nh(d){return null==d?[]:o_(d,Is(d))}var NA=$l(function(d,p,_){return p=p.toLowerCase(),d+(_?wy(p):p)});function wy(d){return ig(Hi(d).toLowerCase())}function Ey(d){return(d=Hi(d))&&d.replace(Ca,sF).replace(n_,"")}var FA=$l(function(d,p,_){return d+(_?"-":"")+p.toLowerCase()}),LA=$l(function(d,p,_){return d+(_?" ":"")+p.toLowerCase()}),GF=Np("toLowerCase"),zA=$l(function(d,p,_){return d+(_?"_":"")+p.toLowerCase()}),Cy=$l(function(d,p,_){return d+(_?" ":"")+ig(p)}),Xw=$l(function(d,p,_){return d+(_?" ":"")+p.toUpperCase()}),ig=Np("toUpperCase");function Dy(d,p,_){return d=Hi(d),(p=_?ee:p)===ee?function(at){return Bl.test(at)}(d)?function(at){return at.match(iv)||[]}(d):function(at){return at.match(zn)||[]}(d):d.match(p)||[]}var Iy=pi(function(d,p){try{return os(d,ee,p)}catch(_){return Ba(_)?_:new Mn(_)}}),Kw=hl(function(d,p){return Us(p,function(_){_=si(_),ll(d,_,cf(d[_],d))}),d});function Oy(d){return function(){return d}}var WF=ku(),Vu=ku(!0);function so(d){return d}function ju(d){return tT("function"==typeof d?d:Hs(d,1))}var Ry=pi(function(d,p){return function(_){return ka(_,d,p)}}),Qw=pi(function(d,p){return function(_){return ka(d,_,p)}});function Py(d,p,_){var F=Is(p),le=Qh(p,F);null==_&&(!Tr(p)||!le.length&&F.length)&&(_=p,p=d,d=this,le=Qh(p,Is(p)));var Ae=!(Tr(_)&&"chain"in _&&!_.chain),He=ua(d);return Us(le,function(Ye){var ct=p[Ye];d[Ye]=ct,He&&(d.prototype[Ye]=function(){var Ft=this.__chain__;if(Ae||Ft){var Lt=d(this.__wrapped__),Gt=Lt.__actions__=no(this.__actions__);return Gt.push({func:ct,args:arguments,thisArg:d}),Lt.__chain__=Ft,Lt}return ct.apply(d,Ur([this.value()],arguments))})}),d}function Ny(){}var XA=kp(qi),KA=kp(ri),Jw=kp(ko);function Uu(d){return oa(d)?r_(si(d)):function(d){return function(p){return na(p,d)}}(d)}var QA=Pv(),ZA=Pv(!0);function Hc(){return[]}function Fy(){return!1}var Hn=k_(function(d,p){return d+p},0),Ly=$d("ceil"),YF=k_(function(d,p){return d/p},1),Kl=$d("floor"),iE=k_(function(d,p){return d*p},1),rE=$d("round"),sE=k_(function(d,p){return d-p},0);return xe.after=function(d,p){if("function"!=typeof p)throw new Ia(Se);return d=ti(d),function(){if(--d<1)return p.apply(this,arguments)}},xe.ary=Xp,xe.assign=bA,xe.assignIn=vA,xe.assignInWith=Zd,xe.assignWith=wA,xe.at=Nw,xe.before=ly,xe.bind=cf,xe.bindAll=Kw,xe.bindKey=Qd,xe.castArray=function(){if(!arguments.length)return[];var d=arguments[0];return On(d)?d:[d]},xe.chain=ty,xe.chunk=function(d,p,_){p=(_?Ws(d,p,_):p===ee)?1:zr(ti(p),0);var F=null==d?0:d.length;if(!F||p<1)return[];for(var le=0,Ae=0,He=Ct(Vt(F/p));lele?0:le+_),(F=F===ee||F>le?le:ti(F))<0&&(F+=le),F=_>F?0:_y(F);_>>0)?(d=Hi(d))&&("string"==typeof p||null!=p&&!Ow(p))&&!(p=Vo(p))&&Fh(d)?ul(rl(d),0,_):d.split(p,_):[]},xe.spread=function(d,p){if("function"!=typeof d)throw new Ia(Se);return p=null==p?0:zr(ti(p),0),pi(function(_){var F=_[p],le=ul(_,0,p);return F&&Ur(le,F),os(d,this,le)})},xe.tail=function(d){var p=null==d?0:d.length;return p?Ms(d,1,p):[]},xe.take=function(d,p,_){return d&&d.length?Ms(d,0,(p=_||p===ee?1:ti(p))<0?0:p):[]},xe.takeRight=function(d,p,_){var F=null==d?0:d.length;return F?Ms(d,(p=F-(p=_||p===ee?1:ti(p)))<0?0:p,F):[]},xe.takeRightWhile=function(d,p){return d&&d.length?Ou(d,kn(p,3),!1,!0):[]},xe.takeWhile=function(d,p){return d&&d.length?Ou(d,kn(p,3)):[]},xe.tap=function(d,p){return p(d),d},xe.throttle=function(d,p,_){var F=!0,le=!0;if("function"!=typeof d)throw new Ia(Se);return Tr(_)&&(F="leading"in _?!!_.leading:F,le="trailing"in _?!!_.trailing:le),bw(d,p,{leading:F,maxWait:p,trailing:le})},xe.thru=Xd,xe.toArray=Rw,xe.toPairs=DA,xe.toPairsIn=Hw,xe.toPath=function(d){return On(d)?qi(d,si):da(d)?[d]:no($v(Hi(d)))},xe.toPlainObject=Pw,xe.transform=function(d,p,_){var F=On(d),le=F||ml(d)||df(d);if(p=kn(p,4),null==_){var Ae=d&&d.constructor;_=le?F?new Ae:[]:Tr(d)&&ua(Ae)?Tu(Oa(d)):{}}return(le?Us:cl)(d,function(He,Ye,ct){return p(_,He,Ye,ct)}),_},xe.unary=function(d){return Xp(d,1)},xe.union=tw,xe.unionBy=jT,xe.unionWith=UT,xe.uniq=function(d){return d&&d.length?kc(d):[]},xe.uniqBy=function(d,p){return d&&d.length?kc(d,kn(p,2)):[]},xe.uniqWith=function(d,p){return p="function"==typeof p?p:ee,d&&d.length?kc(d,ee,p):[]},xe.unset=function(d,p){return null==d||Iu(d,p)},xe.unzip=nw,xe.unzipWith=HT,xe.update=function(d,p,_){return null==d?d:Op(d,p,P_(_))},xe.updateWith=function(d,p,_,F){return F="function"==typeof F?F:ee,null==d?d:Op(d,p,P_(_),F)},xe.values=nh,xe.valuesIn=function(d){return null==d?[]:o_(d,ro(d))},xe.without=iw,xe.words=Dy,xe.wrap=function(d,p){return Kp(P_(p),d)},xe.xor=PF,xe.xorBy=Uo,xe.xorWith=J_,xe.zip=ey,xe.zipObject=function(d,p){return Rp(d||[],p||[],al)},xe.zipObjectDeep=function(d,p){return Rp(d||[],p||[],Ip)},xe.zipWith=lf,xe.entries=DA,xe.entriesIn=Hw,xe.extend=vA,xe.extendWith=Zd,Py(xe,xe),xe.add=Hn,xe.attempt=Iy,xe.camelCase=NA,xe.capitalize=wy,xe.ceil=Ly,xe.clamp=function(d,p,_){return _===ee&&(_=p,p=ee),_!==ee&&(_=(_=vo(_))==_?_:0),p!==ee&&(p=(p=vo(p))==p?p:0),Au(vo(d),p,_)},xe.clone=function(d){return Hs(d,4)},xe.cloneDeep=function(d){return Hs(d,5)},xe.cloneDeepWith=function(d,p){return Hs(d,5,p="function"==typeof p?p:ee)},xe.cloneWith=function(d,p){return Hs(d,4,p="function"==typeof p?p:ee)},xe.conformsTo=function(d,p){return null==p||Tp(d,p,Is(p))},xe.deburr=Ey,xe.defaultTo=function(d,p){return null==d||d!=d?p:d},xe.divide=YF,xe.endsWith=function(d,p,_){d=Hi(d),p=Vo(p);var F=d.length,le=_=_===ee?F:Au(ti(_),0,F);return(_-=p.length)>=0&&d.slice(_,le)==p},xe.eq=Dn,xe.escape=function(d){return(d=Hi(d))&&en.test(d)?d.replace(Sa,oF):d},xe.escapeRegExp=function(d){return(d=Hi(d))&&ut.test(d)?d.replace(Be,"\\$&"):d},xe.every=function(d,p,_){var F=On(d)?ri:vv;return _&&Ws(d,p,_)&&(p=ee),F(d,kn(p,3))},xe.find=KT,xe.findIndex=q_,xe.findKey=function(d,p){return Nh(d,kn(p,3),cl)},xe.findLast=QT,xe.findLastIndex=Y_,xe.findLastKey=function(d,p){return Nh(d,kn(p,3),Ap)},xe.floor=Kl,xe.forEach=oy,xe.forEachRight=Wp,xe.forIn=function(d,p){return null==d?d:kd(d,kn(p,3),ro)},xe.forInRight=function(d,p){return null==d?d:Fd(d,kn(p,3),ro)},xe.forOwn=function(d,p){return d&&cl(d,kn(p,3))},xe.forOwnRight=function(d,p){return d&&Ap(d,kn(p,3))},xe.get=pf,xe.gt=zt,xe.gte=Cw,xe.has=function(d,p){return null!=d&&jv(d,p,Ld)},xe.hasIn=eg,xe.head=qv,xe.identity=so,xe.includes=function(d,p,_,F){d=bo(d)?d:nh(d),_=_&&!F?ti(_):0;var le=d.length;return _<0&&(_=zr(le+_,0)),gy(d)?_<=le&&d.indexOf(p,_)>-1:!!le&&il(d,p,_)>-1},xe.indexOf=function(d,p,_){var F=null==d?0:d.length;if(!F)return-1;var le=null==_?0:ti(_);return le<0&&(le=zr(F+le,0)),il(d,p,le)},xe.inRange=function(d,p,_){return p=_l(p),_===ee?(_=p,p=0):_=_l(_),function(d,p,_){return d>=ps(p,_)&&d=-Te&&d<=Te},xe.isSet=yA,xe.isString=gy,xe.isSymbol=da,xe.isTypedArray=df,xe.isUndefined=function(d){return d===ee},xe.isWeakMap=function(d){return Ar(d)&&$s(d)==V},xe.isWeakSet=function(d){return Ar(d)&&"[object WeakSet]"==As(d)},xe.join=function(d,p){return null==d?"":Uh.call(d,p)},xe.kebabCase=FA,xe.last=aa,xe.lastIndexOf=function(d,p,_){var F=null==d?0:d.length;if(!F)return-1;var le=F;return _!==ee&&(le=(le=ti(_))<0?zr(F+le,0):ps(le,F-1)),p==p?function(at,Rt,Ct){for(var hn=Ct+1;hn--;)if(at[hn]===Rt)return hn;return hn}(d,p,le):Td(d,Dc,le,!0)},xe.lowerCase=LA,xe.lowerFirst=GF,xe.lt=Uc,xe.lte=my,xe.max=function(d){return d&&d.length?Kh(d,so,yo):ee},xe.maxBy=function(d,p){return d&&d.length?Kh(d,kn(p,2),yo):ee},xe.mean=function(d){return Ss(d,so)},xe.meanBy=function(d,p){return Ss(d,kn(p,2))},xe.min=function(d){return d&&d.length?Kh(d,so,Sv):ee},xe.minBy=function(d,p){return d&&d.length?Kh(d,kn(p,2),Sv):ee},xe.stubArray=Hc,xe.stubFalse=Fy,xe.stubObject=function(){return{}},xe.stubString=function(){return""},xe.stubTrue=function(){return!0},xe.multiply=iE,xe.nth=function(d,p){return d&&d.length?Du(d,ti(p)):ee},xe.noConflict=function(){return Ui._===this&&(Ui._=h_),this},xe.noop=Ny,xe.now=Bu,xe.pad=function(d,p,_){d=Hi(d);var F=(p=ti(p))?Lh(d):0;if(!p||F>=p)return d;var le=(p-F)/2;return Fp(Si(le),_)+d+Fp(Vt(le),_)},xe.padEnd=function(d,p,_){d=Hi(d);var F=(p=ti(p))?Lh(d):0;return p&&Fp){var F=d;d=p,p=F}if(_||d%1||p%1){var le=zh();return ps(d+le*(p-d+M1("1e-"+((le+"").length-1))),p)}return Hl(d,p)},xe.reduce=function(d,p,_){var F=On(d)?Eu:ea,le=arguments.length<3;return F(d,kn(p,4),_,le,Pc)},xe.reduceRight=function(d,p,_){var F=On(d)?Cd:ea,le=arguments.length<3;return F(d,kn(p,4),_,le,C_)},xe.repeat=function(d,p,_){return p=(_?Ws(d,p,_):p===ee)?1:ti(p),Dp(Hi(d),p)},xe.replace=function(){var d=arguments,p=Hi(d[0]);return d.length<3?p:p.replace(d[1],d[2])},xe.result=function(d,p,_){var F=-1,le=(p=Lc(p,d)).length;for(le||(le=1,d=ee);++FTe)return[];var _=ye,F=ps(d,ye);p=kn(p),d-=ye;for(var le=Md(F,p);++_=Ae)return d;var Ye=_-Lh(F);if(Ye<1)return F;var ct=He?ul(He,0,Ye).join(""):d.slice(0,Ye);if(le===ee)return ct+F;if(He&&(Ye+=ct.length-Ye),Ow(le)){if(d.slice(Ye).search(le)){var Ft,Lt=ct;for(le.global||(le=u_(le.source,Hi(Xn.exec(le))+"g")),le.lastIndex=0;Ft=le.exec(Lt);)var Gt=Ft.index;ct=ct.slice(0,Gt===ee?Ye:Gt)}}else if(d.indexOf(Vo(le),Ye)!=Ye){var nn=ct.lastIndexOf(le);nn>-1&&(ct=ct.slice(0,nn))}return ct+F},xe.unescape=function(d){return(d=Hi(d))&&ws.test(d)?d.replace(kl,c_):d},xe.uniqueId=function(d){var p=++fF;return Hi(d)+p},xe.upperCase=Xw,xe.upperFirst=ig,xe.each=oy,xe.eachRight=Wp,xe.first=qv,Py(xe,function(){var d={};return cl(xe,function(p,_){Xi.call(xe.prototype,_)||(d[_]=p)}),d}(),{chain:!1}),xe.VERSION="4.17.21",Us(["bind","bindKey","curry","curryRight","partial","partialRight"],function(d){xe[d].placeholder=xe}),Us(["drop","take"],function(d,p){fi.prototype[d]=function(_){_=_===ee?1:zr(ti(_),0);var F=this.__filtered__&&!p?new fi(this):this.clone();return F.__filtered__?F.__takeCount__=ps(_,F.__takeCount__):F.__views__.push({size:ps(_,ye),type:d+(F.__dir__<0?"Right":"")}),F},fi.prototype[d+"Right"]=function(_){return this.reverse()[d](_).reverse()}}),Us(["filter","map","takeWhile"],function(d,p){var _=p+1,F=1==_||3==_;fi.prototype[d]=function(le){var Ae=this.clone();return Ae.__iteratees__.push({iteratee:kn(le,3),type:_}),Ae.__filtered__=Ae.__filtered__||F,Ae}}),Us(["head","last"],function(d,p){var _="take"+(p?"Right":"");fi.prototype[d]=function(){return this[_](1).value()[0]}}),Us(["initial","tail"],function(d,p){var _="drop"+(p?"":"Right");fi.prototype[d]=function(){return this.__filtered__?new fi(this):this[_](1)}}),fi.prototype.compact=function(){return this.filter(so)},fi.prototype.find=function(d){return this.filter(d).head()},fi.prototype.findLast=function(d){return this.reverse().find(d)},fi.prototype.invokeMap=pi(function(d,p){return"function"==typeof d?new fi(this):this.map(function(_){return ka(_,d,p)})}),fi.prototype.reject=function(d){return this.filter(dy(kn(d)))},fi.prototype.slice=function(d,p){d=ti(d);var _=this;return _.__filtered__&&(d>0||p<0)?new fi(_):(d<0?_=_.takeRight(-d):d&&(_=_.drop(d)),p!==ee&&(_=(p=ti(p))<0?_.dropRight(-p):_.take(p-d)),_)},fi.prototype.takeRightWhile=function(d){return this.reverse().takeWhile(d).reverse()},fi.prototype.toArray=function(){return this.take(ye)},cl(fi.prototype,function(d,p){var _=/^(?:filter|find|map|reject)|While$/.test(p),F=/^(?:head|last)$/.test(p),le=xe[F?"take"+("last"==p?"Right":""):p],Ae=F||/^find/.test(p);!le||(xe.prototype[p]=function(){var He=this.__wrapped__,Ye=F?[1]:arguments,ct=He instanceof fi,Ft=Ye[0],Lt=ct||On(He),Gt=function(mi){var Di=le.apply(xe,Ur([mi],Ye));return F&&nn?Di[0]:Di};Lt&&_&&"function"==typeof Ft&&1!=Ft.length&&(ct=Lt=!1);var nn=this.__chain__,wn=!!this.__actions__.length,Fn=Ae&&!nn,gi=ct&&!wn;if(!Ae&&Lt){He=gi?He:new fi(this);var Bn=d.apply(He,Ye);return Bn.__actions__.push({func:Xd,args:[Gt],thisArg:ee}),new Lo(Bn,nn)}return Fn&&gi?d.apply(this,Ye):(Bn=this.thru(Gt),Fn?F?Bn.value()[0]:Bn.value():Bn)})}),Us(["pop","push","shift","sort","splice","unshift"],function(d){var p=dr[d],_=/^(?:push|sort|unshift)$/.test(d)?"tap":"thru",F=/^(?:pop|shift)$/.test(d);xe.prototype[d]=function(){var le=arguments;if(F&&!this.__chain__){var Ae=this.value();return p.apply(On(Ae)?Ae:[],le)}return this[_](function(He){return p.apply(On(He)?He:[],le)})}}),cl(fi.prototype,function(d,p){var _=xe[p];if(_){var F=_.name+"";Xi.call(Od,F)||(Od[F]=[]),Od[F].push({name:p,func:_})}}),Od[Vc(ee,2).name]=[{name:"wrapper",func:ee}],fi.prototype.clone=function(){var d=new fi(this.__wrapped__);return d.__actions__=no(this.__actions__),d.__dir__=this.__dir__,d.__filtered__=this.__filtered__,d.__iteratees__=no(this.__iteratees__),d.__takeCount__=this.__takeCount__,d.__views__=no(this.__views__),d},fi.prototype.reverse=function(){if(this.__filtered__){var d=new fi(this);d.__dir__=-1,d.__filtered__=!0}else(d=this.clone()).__dir__*=-1;return d},fi.prototype.value=function(){var d=this.__wrapped__.value(),p=this.__dir__,_=On(d),F=p<0,le=_?d.length:0,Ae=function(d,p,_){for(var F=-1,le=_.length;++F=this.__values__.length;return{done:d,value:d?ee:this.__values__[this.__index__++]}},xe.prototype.plant=function(d){for(var p,_=this;_ instanceof Wh;){var F=sf(_);F.__index__=0,F.__values__=ee,p?le.__wrapped__=F:p=F;var le=F;_=_.__wrapped__}return le.__wrapped__=d,p},xe.prototype.reverse=function(){var d=this.__wrapped__;if(d instanceof fi){var p=d;return this.__actions__.length&&(p=new fi(this)),(p=p.reverse()).__actions__.push({func:Xd,args:[Z_],thisArg:ee}),new Lo(p,this.__chain__)}return this.thru(Z_)},xe.prototype.toJSON=xe.prototype.valueOf=xe.prototype.value=function(){return sT(this.__wrapped__,this.__actions__)},xe.prototype.first=xe.prototype.head,jh&&(xe.prototype[jh]=function(){return this}),xe}();Ui._=Bh,(yt=function(){return Bh}.call(it,et,it,Ut))!==ee&&(Ut.exports=yt)}.call(this)},5478:function(Ut){Ut.exports=function(){"use strict";function it(rt,lt){for(var ht=0;htrt.length)&&(lt=rt.length);for(var ht=0,ge=new Array(lt);ht=rt.length?{done:!0}:{done:!1,value:rt[ge++]}}}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 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}}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:Y,changeDefaults:function(rt){dt.exports.defaults=rt}};var he=/[&<>"']/,W=/[&<>"']/g,j=/[<>"']|&(?!#?\w+;)/,k=/[<>"']|&(?!#?\w+;)/g,Q={"&":"&","<":"<",">":">",'"':""","'":"'"},H=function(lt){return Q[lt]};var C=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function R(rt){return rt.replace(C,function(lt,ht){return"colon"===(ht=ht.toLowerCase())?":":"#"===ht.charAt(0)?"x"===ht.charAt(1)?String.fromCharCode(parseInt(ht.substring(2),16)):String.fromCharCode(+ht.substring(1)):""})}var T=/(^|[^\[])\^/g;var y=/[^\w:]/g,S=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;var z={},P=/^[^:]+:\/*[^/]*$/,X=/^([^:]+:)[\s\S]*$/,ue=/^([^:]+:\/*[^/]*)[\s\S]*$/;function I(rt,lt){z[" "+rt]||(z[" "+rt]=P.test(rt)?rt+"/":$(rt,"/",!0));var ht=-1===(rt=z[" "+rt]).indexOf(":");return"//"===lt.substring(0,2)?ht?lt:rt.replace(X,"$1")+lt:"/"===lt.charAt(0)?ht?lt:rt.replace(ue,"$1")+lt:rt+lt}function $(rt,lt,ht){var ge=rt.length;if(0===ge)return"";for(var ve=0;ve1;)1<&&(ht+=rt),lt>>=1,rt+=rt;return ht+rt},Te=dt.exports.defaults,me=$,ne=function(rt,lt){var ge=rt.replace(/\|/g,function(Be,ut,Je){for(var Mt=!1,It=ut;--It>=0&&"\\"===Je[It];)Mt=!Mt;return Mt?"|":" |"}).split(/ \|/),ve=0;if(ge.length>lt)ge.splice(lt);else for(;ge.length1?{type:"space",raw:ve[0]}:{raw:"\n"}},lt.code=function(ge){var ve=this.rules.block.code.exec(ge);if(ve){var Be=ve[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:ve[0],codeBlockStyle:"indented",text:this.options.pedantic?Be:me(Be,"\n")}}},lt.fences=function(ge){var ve=this.rules.block.fences.exec(ge);if(ve){var Be=ve[0],ut=function(rt,lt){var ht=rt.match(/^(\s+)(?:```)/);if(null===ht)return lt;var ge=ht[1];return lt.split("\n").map(function(ve){var Be=ve.match(/^\s+/);return null===Be?ve:Be[0].length>=ge.length?ve.slice(ge.length):ve}).join("\n")}(Be,ve[3]||"");return{type:"code",raw:Be,lang:ve[2]?ve[2].trim():ve[2],text:ut}}},lt.heading=function(ge){var ve=this.rules.block.heading.exec(ge);if(ve){var Be=ve[2].trim();if(/#$/.test(Be)){var ut=me(Be,"#");(this.options.pedantic||!ut||/ $/.test(ut))&&(Be=ut.trim())}return{type:"heading",raw:ve[0],depth:ve[1].length,text:Be}}},lt.nptable=function(ge){var ve=this.rules.block.nptable.exec(ge);if(ve){var Be={type:"table",header:ne(ve[1].replace(/^ *| *\| *$/g,"")),align:ve[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ve[3]?ve[3].replace(/\n$/,"").split("\n"):[],raw:ve[0]};if(Be.header.length===Be.align.length){var Je,ut=Be.align.length;for(Je=0;Je ?/gm,"");return{type:"blockquote",raw:ve[0],text:Be}}},lt.list=function(ge){var ve=this.rules.block.list.exec(ge);if(ve){var Qt,zn,ci,Rn,bn,Xn,Cn,rr,sr,Be=ve[0],ut=ve[2],Je=ut.length>1,Mt={type:"list",raw:Be,ordered:Je,start:Je?+ut.slice(0,-1):"",loose:!1,items:[]},It=ve[0].match(this.rules.block.item),Ot=!1,Qn=It.length;ci=this.rules.block.listItemStart.exec(It[0]);for(var Wi=0;Wici[1].length:Rn[1].length>=ci[0].length||Rn[1].length>3){It.splice(Wi,2,It[Wi]+(!this.options.pedantic&&Rn[1].length/i.test(ut[0])&&(ve=!1),!Be&&/^<(pre|code|kbd|script)(\s|>)/i.test(ut[0])?Be=!0:Be&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(ut[0])&&(Be=!1),{type:this.options.sanitize?"text":"html",raw:ut[0],inLink:ve,inRawBlock:Be,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ut[0]):ye(ut[0]):ut[0]}},lt.link=function(ge){var ve=this.rules.inline.link.exec(ge);if(ve){var Be=ve[2].trim();if(!this.options.pedantic&&/^$/.test(Be))return;var ut=me(Be.slice(0,-1),"\\");if((Be.length-ut.length)%2==0)return}else{var Je=Oe(ve[2],"()");if(Je>-1){var It=(0===ve[0].indexOf("!")?5:4)+ve[1].length+Je;ve[2]=ve[2].substring(0,Je),ve[0]=ve[0].substring(0,It).trim(),ve[3]=""}}var Ot=ve[2],Qt="";if(this.options.pedantic){var zn=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Ot);zn&&(Ot=zn[1],Qt=zn[3])}else Qt=ve[3]?ve[3].slice(1,-1):"";return Ot=Ot.trim(),/^$/.test(Be)?Ot.slice(1):Ot.slice(1,-1)),$e(ve,{href:Ot&&Ot.replace(this.rules.inline._escapes,"$1"),title:Qt&&Qt.replace(this.rules.inline._escapes,"$1")},ve[0])}},lt.reflink=function(ge,ve){var Be;if((Be=this.rules.inline.reflink.exec(ge))||(Be=this.rules.inline.nolink.exec(ge))){var ut=(Be[2]||Be[1]).replace(/\s+/g," ");if(!(ut=ve[ut.toLowerCase()])||!ut.href){var Je=Be[0].charAt(0);return{type:"text",raw:Je,text:Je}}return $e(Be,ut,Be[0])}},lt.emStrong=function(ge,ve,Be){void 0===Be&&(Be="");var ut=this.rules.inline.emStrong.lDelim.exec(ge);if(ut&&(!ut[3]||!Be.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 Je=ut[1]||ut[2]||"";if(!Je||Je&&(""===Be||this.rules.inline.punctuation.exec(Be))){var It,Ot,Mt=ut[0].length-1,Qt=Mt,zn=0,ci="*"===ut[0][0]?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(ci.lastIndex=0,ve=ve.slice(-1*ge.length+Mt);null!=(ut=ci.exec(ve));)if(It=ut[1]||ut[2]||ut[3]||ut[4]||ut[5]||ut[6]){if(Ot=It.length,ut[3]||ut[4]){Qt+=Ot;continue}if((ut[5]||ut[6])&&Mt%3&&!((Mt+Ot)%3)){zn+=Ot;continue}if(!((Qt-=Ot)>0))return Ot=Math.min(Ot,Ot+Qt+zn),Math.min(Mt,Ot)%2?{type:"em",raw:ge.slice(0,Mt+ut.index+Ot+1),text:ge.slice(1,Mt+ut.index+Ot)}:{type:"strong",raw:ge.slice(0,Mt+ut.index+Ot+1),text:ge.slice(2,Mt+ut.index+Ot-1)}}}}},lt.codespan=function(ge){var ve=this.rules.inline.code.exec(ge);if(ve){var Be=ve[2].replace(/\n/g," "),ut=/[^ ]/.test(Be),Je=/^ /.test(Be)&&/ $/.test(Be);return ut&&Je&&(Be=Be.substring(1,Be.length-1)),Be=ye(Be,!0),{type:"codespan",raw:ve[0],text:Be}}},lt.br=function(ge){var ve=this.rules.inline.br.exec(ge);if(ve)return{type:"br",raw:ve[0]}},lt.del=function(ge){var ve=this.rules.inline.del.exec(ge);if(ve)return{type:"del",raw:ve[0],text:ve[2]}},lt.autolink=function(ge,ve){var ut,Je,Be=this.rules.inline.autolink.exec(ge);if(Be)return Je="@"===Be[2]?"mailto:"+(ut=ye(this.options.mangle?ve(Be[1]):Be[1])):ut=ye(Be[1]),{type:"link",raw:Be[0],text:ut,href:Je,tokens:[{type:"text",raw:ut,text:ut}]}},lt.url=function(ge,ve){var Be;if(Be=this.rules.inline.url.exec(ge)){var ut,Je;if("@"===Be[2])Je="mailto:"+(ut=ye(this.options.mangle?ve(Be[0]):Be[0]));else{var Mt;do{Mt=Be[0],Be[0]=this.rules.inline._backpedal.exec(Be[0])[0]}while(Mt!==Be[0]);ut=ye(Be[0]),Je="www."===Be[1]?"http://"+ut:ut}return{type:"link",raw:Be[0],text:ut,href:Je,tokens:[{type:"text",raw:ut,text:ut}]}}},lt.inlineText=function(ge,ve,Be){var Je,ut=this.rules.inline.text.exec(ge);if(ut)return Je=ve?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ut[0]):ye(ut[0]):ut[0]:ye(this.options.smartypants?Be(ut[0]):ut[0]),{type:"text",raw:ut[0],text:Je}},rt}(),tt=te_noopTest,Xe=te_edit,ze=te_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:tt,table:tt,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=Xe(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=Xe(Le.item,"gm").replace(/bull/g,Le.bullet).getRegex(),Le.listItemStart=Xe(/^( *)(bull) */).replace("bull",Le.bullet).getRegex(),Le.list=Xe(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=Xe(Le.html,"i").replace("comment",Le._comment).replace("tag",Le._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Le.paragraph=Xe(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=Xe(Le.blockquote).replace("paragraph",Le.paragraph).getRegex(),Le.normal=ze({},Le),Le.gfm=ze({},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=Xe(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=Xe(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=ze({},Le.normal,{html:Xe("^ *(?: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:tt,paragraph:Xe(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 Ke={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:tt,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:tt,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~"};Ke.punctuation=Xe(Ke.punctuation).replace(/punctuation/g,Ke._punctuation).getRegex(),Ke.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,Ke.escapedEmSt=/\\\*|\\_/g,Ke._comment=Xe(Le._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),Ke.emStrong.lDelim=Xe(Ke.emStrong.lDelim).replace(/punct/g,Ke._punctuation).getRegex(),Ke.emStrong.rDelimAst=Xe(Ke.emStrong.rDelimAst,"g").replace(/punct/g,Ke._punctuation).getRegex(),Ke.emStrong.rDelimUnd=Xe(Ke.emStrong.rDelimUnd,"g").replace(/punct/g,Ke._punctuation).getRegex(),Ke._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,Ke._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,Ke._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])?)+(?![-_])/,Ke.autolink=Xe(Ke.autolink).replace("scheme",Ke._scheme).replace("email",Ke._email).getRegex(),Ke._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,Ke.tag=Xe(Ke.tag).replace("comment",Ke._comment).replace("attribute",Ke._attribute).getRegex(),Ke._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Ke._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,Ke._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,Ke.link=Xe(Ke.link).replace("label",Ke._label).replace("href",Ke._href).replace("title",Ke._title).getRegex(),Ke.reflink=Xe(Ke.reflink).replace("label",Ke._label).getRegex(),Ke.reflinkSearch=Xe(Ke.reflinkSearch,"g").replace("reflink",Ke.reflink).replace("nolink",Ke.nolink).getRegex(),Ke.normal=ze({},Ke),Ke.pedantic=ze({},Ke.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:Xe(/^!?\[(label)\]\((.*?)\)/).replace("label",Ke._label).getRegex(),reflink:Xe(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Ke._label).getRegex()}),Ke.gfm=ze({},Ke.normal,{escape:Xe(Ke.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&&(ge="x"+ge.toString(16)),lt+="&#"+ge+";";return lt}var je=function(){function rt(ht){this.tokens=[],this.tokens.links=Object.create(null),this.options=ht||qe,this.options.tokenizer=this.options.tokenizer||new Ue,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var ge={block:ke.normal,inline:q.normal};this.options.pedantic?(ge.block=ke.pedantic,ge.inline=q.pedantic):this.options.gfm&&(ge.block=ke.gfm,ge.inline=this.options.breaks?q.breaks:q.gfm),this.tokenizer.rules=ge}rt.lex=function(ge,ve){return new rt(ve).lex(ge)},rt.lexInline=function(ge,ve){return new rt(ve).inlineTokens(ge)};var lt=rt.prototype;return lt.lex=function(ge){return ge=ge.replace(/\r\n|\r/g,"\n").replace(/\t/g," "),this.blockTokens(ge,this.tokens,!0),this.inline(this.tokens),this.tokens},lt.blockTokens=function(ge,ve,Be){var Je,Mt,It,Ot,Qt,zn,ut=this;for(void 0===ve&&(ve=[]),void 0===Be&&(Be=!0),this.options.pedantic&&(ge=ge.replace(/^ +$/gm,""));ge;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(function(Rn){return!!(Je=Rn.call(ut,ge,ve))&&(ge=ge.substring(Je.raw.length),ve.push(Je),!0)}))){if(Je=this.tokenizer.space(ge)){ge=ge.substring(Je.raw.length),Je.type&&ve.push(Je);continue}if(Je=this.tokenizer.code(ge)){ge=ge.substring(Je.raw.length),(Ot=ve[ve.length-1])&&"paragraph"===Ot.type?(Ot.raw+="\n"+Je.raw,Ot.text+="\n"+Je.text):ve.push(Je);continue}if(Je=this.tokenizer.fences(ge)){ge=ge.substring(Je.raw.length),ve.push(Je);continue}if(Je=this.tokenizer.heading(ge)){ge=ge.substring(Je.raw.length),ve.push(Je);continue}if(Je=this.tokenizer.nptable(ge)){ge=ge.substring(Je.raw.length),ve.push(Je);continue}if(Je=this.tokenizer.hr(ge)){ge=ge.substring(Je.raw.length),ve.push(Je);continue}if(Je=this.tokenizer.blockquote(ge)){ge=ge.substring(Je.raw.length),Je.tokens=this.blockTokens(Je.text,[],Be),ve.push(Je);continue}if(Je=this.tokenizer.list(ge)){for(ge=ge.substring(Je.raw.length),It=Je.items.length,Mt=0;Mt=0&&(Rn=Math.min(Rn,Xn))}),Rn<1/0&&Rn>=0&&(Qt=ge.substring(0,Rn+1))}(),Be&&(Je=this.tokenizer.paragraph(Qt))){Ot=ve[ve.length-1],zn&&"paragraph"===Ot.type?(Ot.raw+="\n"+Je.raw,Ot.text+="\n"+Je.text):ve.push(Je),zn=Qt.length!==ge.length,ge=ge.substring(Je.raw.length);continue}if(Je=this.tokenizer.text(ge)){ge=ge.substring(Je.raw.length),(Ot=ve[ve.length-1])&&"text"===Ot.type?(Ot.raw+="\n"+Je.raw,Ot.text+="\n"+Je.text):ve.push(Je);continue}if(ge){var ci="Infinite loop on byte: "+ge.charCodeAt(0);if(this.options.silent){console.error(ci);break}throw new Error(ci)}}return ve},lt.inline=function(ge){var ve,Be,ut,Je,Mt,It,Ot=ge.length;for(ve=0;ve0)for(;null!=(zn=this.tokenizer.rules.inline.reflinkSearch.exec(Qt));)bn.includes(zn[0].slice(zn[0].lastIndexOf("[")+1,-1))&&(Qt=Qt.slice(0,zn.index)+"["+G("a",zn[0].length-2)+"]"+Qt.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(zn=this.tokenizer.rules.inline.blockSkip.exec(Qt));)Qt=Qt.slice(0,zn.index)+"["+G("a",zn[0].length-2)+"]"+Qt.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(zn=this.tokenizer.rules.inline.escapedEmSt.exec(Qt));)Qt=Qt.slice(0,zn.index)+"++"+Qt.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;ge;)if(ci||(Rn=""),ci=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(function(Cn){return!!(Mt=Cn.call(Je,ge,ve))&&(ge=ge.substring(Mt.raw.length),ve.push(Mt),!0)}))){if(Mt=this.tokenizer.escape(ge)){ge=ge.substring(Mt.raw.length),ve.push(Mt);continue}if(Mt=this.tokenizer.tag(ge,Be,ut)){ge=ge.substring(Mt.raw.length),Be=Mt.inLink,ut=Mt.inRawBlock,(It=ve[ve.length-1])&&"text"===Mt.type&&"text"===It.type?(It.raw+=Mt.raw,It.text+=Mt.text):ve.push(Mt);continue}if(Mt=this.tokenizer.link(ge)){ge=ge.substring(Mt.raw.length),"link"===Mt.type&&(Mt.tokens=this.inlineTokens(Mt.text,[],!0,ut)),ve.push(Mt);continue}if(Mt=this.tokenizer.reflink(ge,this.tokens.links)){ge=ge.substring(Mt.raw.length),It=ve[ve.length-1],"link"===Mt.type?(Mt.tokens=this.inlineTokens(Mt.text,[],!0,ut),ve.push(Mt)):It&&"text"===Mt.type&&"text"===It.type?(It.raw+=Mt.raw,It.text+=Mt.text):ve.push(Mt);continue}if(Mt=this.tokenizer.emStrong(ge,Qt,Rn)){ge=ge.substring(Mt.raw.length),Mt.tokens=this.inlineTokens(Mt.text,[],Be,ut),ve.push(Mt);continue}if(Mt=this.tokenizer.codespan(ge)){ge=ge.substring(Mt.raw.length),ve.push(Mt);continue}if(Mt=this.tokenizer.br(ge)){ge=ge.substring(Mt.raw.length),ve.push(Mt);continue}if(Mt=this.tokenizer.del(ge)){ge=ge.substring(Mt.raw.length),Mt.tokens=this.inlineTokens(Mt.text,[],Be,ut),ve.push(Mt);continue}if(Mt=this.tokenizer.autolink(ge,de)){ge=ge.substring(Mt.raw.length),ve.push(Mt);continue}if(!Be&&(Mt=this.tokenizer.url(ge,de))){ge=ge.substring(Mt.raw.length),ve.push(Mt);continue}if(Ot=ge,this.options.extensions&&this.options.extensions.startInline&&function(){var Cn=1/0,rr=ge.slice(1),sr=void 0;Je.options.extensions.startInline.forEach(function(Qn){"number"==typeof(sr=Qn.call(this,rr))&&sr>=0&&(Cn=Math.min(Cn,sr))}),Cn<1/0&&Cn>=0&&(Ot=ge.substring(0,Cn+1))}(),Mt=this.tokenizer.inlineText(Ot,ut,pe)){ge=ge.substring(Mt.raw.length),"_"!==Mt.raw.slice(-1)&&(Rn=Mt.raw.slice(-1)),ci=!0,(It=ve[ve.length-1])&&"text"===It.type?(It.raw+=Mt.raw,It.text+=Mt.text):ve.push(Mt);continue}if(ge){var Xn="Infinite loop on byte: "+ge.charCodeAt(0);if(this.options.silent){console.error(Xn);break}throw new Error(Xn)}}return ve},function(rt,lt,ht){lt&&it(rt.prototype,lt),ht&&it(rt,ht)}(rt,null,[{key:"rules",get:function(){return{block:ke,inline:q}}}]),rt}(),_t=dt.exports.defaults,pt=te_cleanUrl,we=te_escape,B=function(){function rt(ht){this.options=ht||_t}var lt=rt.prototype;return lt.code=function(ge,ve,Be){var ut=(ve||"").match(/\S*/)[0];if(this.options.highlight){var Je=this.options.highlight(ge,ut);null!=Je&&Je!==ge&&(Be=!0,ge=Je)}return ge=ge.replace(/\n$/,"")+"\n",ut?'
    '+(Be?ge:we(ge,!0))+"
    \n":"
    "+(Be?ge:we(ge,!0))+"
    \n"},lt.blockquote=function(ge){return"
    \n"+ge+"
    \n"},lt.html=function(ge){return ge},lt.heading=function(ge,ve,Be,ut){return this.options.headerIds?"'+ge+"\n":""+ge+"\n"},lt.hr=function(){return this.options.xhtml?"
    \n":"
    \n"},lt.list=function(ge,ve,Be){var ut=ve?"ol":"ul";return"<"+ut+(ve&&1!==Be?' start="'+Be+'"':"")+">\n"+ge+"\n"},lt.listitem=function(ge){return"
  • "+ge+"
  • \n"},lt.checkbox=function(ge){return" "},lt.paragraph=function(ge){return"

    "+ge+"

    \n"},lt.table=function(ge,ve){return ve&&(ve=""+ve+""),"\n\n"+ge+"\n"+ve+"
    \n"},lt.tablerow=function(ge){return"\n"+ge+"\n"},lt.tablecell=function(ge,ve){var Be=ve.header?"th":"td";return(ve.align?"<"+Be+' align="'+ve.align+'">':"<"+Be+">")+ge+"\n"},lt.strong=function(ge){return""+ge+""},lt.em=function(ge){return""+ge+""},lt.codespan=function(ge){return""+ge+""},lt.br=function(){return this.options.xhtml?"
    ":"
    "},lt.del=function(ge){return""+ge+""},lt.link=function(ge,ve,Be){if(null===(ge=pt(this.options.sanitize,this.options.baseUrl,ge)))return Be;var ut='"+Be+""},lt.image=function(ge,ve,Be){if(null===(ge=pt(this.options.sanitize,this.options.baseUrl,ge)))return Be;var ut=''+Be+'":">")},lt.text=function(ge){return ge},rt}(),N=function(){function rt(){}var lt=rt.prototype;return lt.strong=function(ge){return ge},lt.em=function(ge){return ge},lt.codespan=function(ge){return ge},lt.del=function(ge){return ge},lt.html=function(ge){return ge},lt.text=function(ge){return ge},lt.link=function(ge,ve,Be){return""+Be},lt.image=function(ge,ve,Be){return""+Be},lt.br=function(){return""},rt}(),V=function(){function rt(){this.seen={}}var lt=rt.prototype;return lt.serialize=function(ge){return ge.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")},lt.getNextSafeSlug=function(ge,ve){var Be=ge,ut=0;if(this.seen.hasOwnProperty(Be)){ut=this.seen[ge];do{Be=ge+"-"+ ++ut}while(this.seen.hasOwnProperty(Be))}return ve||(this.seen[ge]=ut,this.seen[Be]=0),Be},lt.slug=function(ge,ve){void 0===ve&&(ve={});var Be=this.serialize(ge);return this.getNextSafeSlug(Be,ve.dryrun)},rt}(),Re=B,Ze=N,Tt=V,kt=dt.exports.defaults,In=te_unescape,Yn=je,Mi=function(){function rt(ht){this.options=ht||kt,this.options.renderer=this.options.renderer||new Re,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Ze,this.slugger=new Tt}rt.parse=function(ge,ve){return new rt(ve).parse(ge)},rt.parseInline=function(ge,ve){return new rt(ve).parseInline(ge)};var lt=rt.prototype;return lt.parse=function(ge,ve){void 0===ve&&(ve=!0);var ut,Je,Mt,It,Ot,Qt,zn,ci,Rn,bn,Xn,Cn,rr,sr,Qn,Wi,Ca,Qr,re,Be="",fe=ge.length;for(ut=0;ut0&&"text"===Qn.tokens[0].type?(Qn.tokens[0].text=Qr+" "+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=Qr+" "+Qn.tokens[0].tokens[0].text)):Qn.tokens.unshift({type:"text",text:Qr}):sr+=Qr),sr+=this.parse(Qn.tokens,rr),Rn+=this.renderer.listitem(sr,Ca,Wi);Be+=this.renderer.list(Rn,Xn,Cn);continue;case"html":Be+=this.renderer.html(bn.text);continue;case"paragraph":Be+=this.renderer.paragraph(this.parseInline(bn.tokens));continue;case"text":for(Rn=bn.tokens?this.parseInline(bn.tokens):bn.text;ut+1An error occurred:

    "+xa(Mt.message+"",!0)+"
    ";throw Mt}}return en.options=en.setOptions=function(rt){return Bs(en.defaults,rt),Sa(en.defaults),en},en.getDefaults=kl,en.defaults=ws,en.use=function(){for(var rt=this,lt=arguments.length,ht=new Array(lt),ge=0;geAn error occurred:

    "+xa(ge.message+"",!0)+"
    ";throw ge}},en.Parser=Mi,en.parser=Mi.parse,en.Renderer=Xr,en.TextRenderer=Ls,en.Lexer=Yn,en.lexer=Yn.lex,en.Tokenizer=xi,en.Slugger=fs,en.parse=en,en}()},9369:(Ut,it,et)=>{var yt=et(6284),ee=et(7830);function Dt(){this.clear()}Dt.prototype.clear=function(){this.items=[],this.offset=0,this.size=0},Dt.prototype.enqueue=function(dt){return this.items.push(dt),++this.size},Dt.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}},Dt.prototype.peek=function(){if(this.size)return this.items[this.offset]},Dt.prototype.forEach=function(dt,Y){Y=arguments.length>1?Y:this;for(var Se=this.offset,he=0,W=this.items.length;Se=dt.length)return{done:!0};var Se=dt[Y];return Y++,{value:Se,done:!1}})},Dt.prototype.entries=function(){var dt=this.items,Y=this.offset,Se=0;return new yt(function(){if(Y>=dt.length)return{done:!0};var he=dt[Y];return Y++,{value:[Se++,he],done:!1}})},"undefined"!=typeof Symbol&&(Dt.prototype[Symbol.iterator]=Dt.prototype.values),Dt.prototype.toString=function(){return this.toArray().join(",")},Dt.prototype.toJSON=function(){return this.toArray()},Dt.prototype.inspect=function(){var dt=this.toArray();return Object.defineProperty(dt,"constructor",{value:Dt,enumerable:!1}),dt},"undefined"!=typeof Symbol&&(Dt.prototype[Symbol.for("nodejs.util.inspect.custom")]=Dt.prototype.inspect),Dt.from=function(dt){var Y=new Dt;return ee(dt,function(Se){Y.enqueue(Se)}),Y},Dt.of=function(){return Dt.from(arguments)},Ut.exports=Dt},7830:Ut=>{var it="undefined"!=typeof ArrayBuffer,et="undefined"!=typeof Symbol;function yt(ee,Dt){var dt,Y,Se,he,W;if(!ee)throw new Error("obliterator/forEach: invalid iterable.");if("function"!=typeof Dt)throw new Error("obliterator/forEach: expecting a callback.");if(Array.isArray(ee)||it&&ArrayBuffer.isView(ee)||"string"==typeof ee||"[object Arguments]"===ee.toString())for(Se=0,he=ee.length;Se{function it(et){Object.defineProperty(this,"_next",{writable:!1,enumerable:!1,value:et}),this.done=!1}it.prototype.next=function(){if(this.done)return{done:!0};var et=this._next();return et.done&&(this.done=!0),et},"undefined"!=typeof Symbol&&(it.prototype[Symbol.iterator]=function(){return this}),it.of=function(){var et=arguments,yt=et.length,ee=0;return new it(function(){return ee>=yt?{done:!0}:{done:!1,value:et[ee++]}})},it.empty=function(){var et=new it(null);return et.done=!0,et},it.is=function(et){return et instanceof it||"object"==typeof et&&null!==et&&"function"==typeof et.next},Ut.exports=it},7310:(Ut,it,et)=>{"use strict";var yt=et(1948);Object.defineProperty(it,"__esModule",{value:!0}),it.isMobile=function(){return void 0!==ee.window.orientation},it.default=function(he){if(!he&&!(0,Dt.default)())return"Node";if((0,dt.default)(he))return"Electron";var W="undefined"!=typeof navigator?navigator:{},j=he||W.userAgent||"";if(j.indexOf("Edge")>-1)return"Edge";var k=-1!==j.indexOf("MSIE "),Q=-1!==j.indexOf("Trident/");return k||Q?"IE":ee.window.chrome?"Chrome":ee.window.safari?"Safari":ee.window.mozInnerScreenX?"Firefox":"Unknown"};var ee=et(1151),Dt=yt(et(1602)),dt=yt(et(2344))},1151:(Ut,it,et)=>{"use strict";var yt=et(1948);Object.defineProperty(it,"__esModule",{value:!0}),it.console=it.process=it.document=it.global=it.window=it.self=void 0;var ee=yt(et(4321)),Dt={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,ee.default)(process))&&process};it.self=Dt.self||Dt.window||Dt.global,it.window=Dt.window||Dt.self||Dt.global,it.global=Dt.global||Dt.self||Dt.window,it.document=Dt.document||{},it.process=Dt.process||{};var j=console;it.console=j},4761:(Ut,it,et)=>{"use strict";var ee=et(1948),Dt=et(4321);Object.defineProperty(it,"CO",{enumerable:!0,get:function(){return dt.global}}),Object.defineProperty(it,"qs",{enumerable:!0,get:function(){return Se.default}});var dt=et(1151),Se=(j(et(1602)),j(et(7310)));ee(et(2344));function W(k){if("function"!=typeof WeakMap)return null;var Q=new WeakMap,H=new WeakMap;return(W=function(C){return C?H:Q})(k)}function j(k,Q){if(!Q&&k&&k.__esModule)return k;if(null===k||"object"!==Dt(k)&&"function"!=typeof k)return{default:k};var H=W(Q);if(H&&H.has(k))return H.get(k);var v={},C=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var R in k)if("default"!==R&&Object.prototype.hasOwnProperty.call(k,R)){var T=C?Object.getOwnPropertyDescriptor(k,R):null;T&&(T.get||T.set)?Object.defineProperty(v,R,T):v[R]=k[R]}return v.default=k,H&&H.set(k,v),v}},1602:(Ut,it,et)=>{"use strict";var yt=et(1948);Object.defineProperty(it,"__esModule",{value:!0}),it.default=dt,it.isBrowserMainThread=function(){return dt()&&"undefined"!=typeof document};var ee=yt(et(4321)),Dt=yt(et(2344));function dt(){return!("object"===("undefined"==typeof process?"undefined":(0,ee.default)(process))&&"[object process]"===String(process)&&!process.browser)||(0,Dt.default)()}},2344:(Ut,it,et)=>{"use strict";var yt=et(1948);Object.defineProperty(it,"__esModule",{value:!0}),it.default=function(dt){if("undefined"!=typeof window&&"object"===(0,ee.default)(window.process)&&"renderer"===window.process.type||"undefined"!=typeof process&&"object"===(0,ee.default)(process.versions)&&Boolean(process.versions.electron))return!0;var Y="object"===("undefined"==typeof navigator?"undefined":(0,ee.default)(navigator))&&"string"==typeof navigator.userAgent&&navigator.userAgent,Se=dt||Y;return!!(Se&&Se.indexOf("Electron")>=0)};var ee=yt(et(4321))},6991:function(Ut,it,et){"use strict";var yt=this&&this.__createBinding||(Object.create?function(Dt,dt,Y,Se){void 0===Se&&(Se=Y),Object.defineProperty(Dt,Se,{enumerable:!0,get:function(){return dt[Y]}})}:function(Dt,dt,Y,Se){void 0===Se&&(Se=Y),Dt[Se]=dt[Y]}),ee=this&&this.__exportStar||function(Dt,dt){for(var Y in Dt)"default"!==Y&&!Object.prototype.hasOwnProperty.call(dt,Y)&&yt(dt,Dt,Y)};Object.defineProperty(it,"__esModule",{value:!0}),ee(et(4180),it),ee(et(5103),it),ee(et(8965),it),ee(et(2595),it),ee(et(2417),it),ee(et(2451),it),ee(et(7735),it)},4180:(Ut,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.BlankNode=void 0,it.BlankNode=class{constructor(ee){this.termType="BlankNode",this.value=ee}equals(ee){return!!ee&&"BlankNode"===ee.termType&&ee.value===this.value}}},5103:(Ut,it,et)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.DataFactory=void 0;const yt=et(4180),ee=et(8965),Dt=et(2595),dt=et(2417),Y=et(2451),Se=et(7735);let he=0;it.DataFactory=class{constructor(k){this.blankNodeCounter=0,this.blankNodePrefix=(k=k||{}).blankNodePrefix||`df_${he++}_`}namedNode(k){return new dt.NamedNode(k)}blankNode(k){return new yt.BlankNode(k||`${this.blankNodePrefix}${this.blankNodeCounter++}`)}literal(k,Q){return new Dt.Literal(k,Q)}variable(k){return new Se.Variable(k)}defaultGraph(){return ee.DefaultGraph.INSTANCE}quad(k,Q,H,v){return new Y.Quad(k,Q,H,v||this.defaultGraph())}fromTerm(k){switch(k.termType){case"NamedNode":return this.namedNode(k.value);case"BlankNode":return this.blankNode(k.value);case"Literal":return k.language?this.literal(k.value,k.language):k.datatype.equals(Dt.Literal.XSD_STRING)?this.literal(k.value):this.literal(k.value,this.fromTerm(k.datatype));case"Variable":return this.variable(k.value);case"DefaultGraph":return this.defaultGraph();case"Quad":return this.quad(this.fromTerm(k.subject),this.fromTerm(k.predicate),this.fromTerm(k.object),this.fromTerm(k.graph))}}fromQuad(k){return this.fromTerm(k)}resetBlankNodeCounter(){this.blankNodeCounter=0}}},8965:(Ut,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.DefaultGraph=void 0;class et{constructor(){this.termType="DefaultGraph",this.value=""}equals(ee){return!!ee&&"DefaultGraph"===ee.termType}}it.DefaultGraph=et,et.INSTANCE=new et},2595:(Ut,it,et)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.Literal=void 0;const yt=et(2417);class ee{constructor(dt,Y){this.termType="Literal",this.value=dt,"string"==typeof Y?(this.language=Y,this.datatype=ee.RDF_LANGUAGE_STRING):Y?(this.language="",this.datatype=Y):(this.language="",this.datatype=ee.XSD_STRING)}equals(dt){return!!dt&&"Literal"===dt.termType&&dt.value===this.value&&dt.language===this.language&&dt.datatype.equals(this.datatype)}}it.Literal=ee,ee.RDF_LANGUAGE_STRING=new yt.NamedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),ee.XSD_STRING=new yt.NamedNode("http://www.w3.org/2001/XMLSchema#string")},2417:(Ut,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.NamedNode=void 0,it.NamedNode=class{constructor(ee){this.termType="NamedNode",this.value=ee}equals(ee){return!!ee&&"NamedNode"===ee.termType&&ee.value===this.value}}},2451:(Ut,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.Quad=void 0,it.Quad=class{constructor(ee,Dt,dt,Y){this.termType="Quad",this.value="",this.subject=ee,this.predicate=Dt,this.object=dt,this.graph=Y}equals(ee){return!!ee&&("Quad"===ee.termType||!ee.termType)&&this.subject.equals(ee.subject)&&this.predicate.equals(ee.predicate)&&this.object.equals(ee.object)&&this.graph.equals(ee.graph)}}},7735:(Ut,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.Variable=void 0,it.Variable=class{constructor(ee){this.termType="Variable",this.value=ee}equals(ee){return!!ee&&"Variable"===ee.termType&&ee.value===this.value}}},1609:function(Ut,it,et){"use strict";var yt=this&&this.__createBinding||(Object.create?function(v,C,R,T){void 0===T&&(T=R),Object.defineProperty(v,T,{enumerable:!0,get:function(){return C[R]}})}:function(v,C,R,T){void 0===T&&(T=R),v[T]=C[R]}),ee=this&&this.__exportStar||function(v,C){for(var R in v)"default"!==R&&!Object.prototype.hasOwnProperty.call(C,R)&&yt(C,v,R)};Object.defineProperty(it,"__esModule",{value:!0}),it.getSupportedJavaScriptPrimitives=it.getSupportedRdfDatatypes=it.getTermRaw=it.toRdf=it.fromRdf=void 0;const Dt=et(6991),dt=et(9938),Y=et(6060);ee(et(9938),it),ee(et(8871),it),ee(et(6060),it);const Se=new Dt.DataFactory,he=new Y.Translator;function W(v,C){return he.fromRdf(v,C)}he.registerHandler(new dt.TypeHandlerString,dt.TypeHandlerString.TYPES.map(v=>Se.namedNode(v)),["string"]),he.registerHandler(new dt.TypeHandlerBoolean,[dt.TypeHandlerBoolean.TYPE].map(v=>Se.namedNode(v)),["boolean"]),he.registerHandler(new dt.TypeHandlerNumberDouble,dt.TypeHandlerNumberDouble.TYPES.map(v=>Se.namedNode(v)),["number"]),he.registerHandler(new dt.TypeHandlerNumberInteger,dt.TypeHandlerNumberInteger.TYPES.map(v=>Se.namedNode(v)),["number"]),he.registerHandler(new dt.TypeHandlerDate,dt.TypeHandlerDate.TYPES.map(v=>Se.namedNode(v)),["object"]),it.fromRdf=W,it.toRdf=function(v,C){return C&&"namedNode"in C&&(C={dataFactory:C}),(C=C||{})&&!C.dataFactory&&(C.dataFactory=Se),he.toRdf(v,C)},it.getTermRaw=function(v,C){return"Literal"===v.termType?W(v,C):v.value},it.getSupportedRdfDatatypes=function(){return he.getSupportedRdfDatatypes()},it.getSupportedJavaScriptPrimitives=function(){return he.getSupportedJavaScriptPrimitives()}},8871:(Ut,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0})},6060:(Ut,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(ee){throw new Error(`Invalid RDF ${ee.datatype.value} value: '${ee.value}'`)}registerHandler(ee,Dt,dt){for(const Y of Dt)this.supportedRdfDatatypes.push(Y),this.fromRdfHandlers[Y.value]=ee;for(const Y of dt){let Se=this.toRdfHandlers[Y];Se||(this.toRdfHandlers[Y]=Se=[]),Se.push(ee)}}fromRdf(ee,Dt){const dt=this.fromRdfHandlers[ee.datatype.value];return dt?dt.fromRdf(ee,Dt):ee.value}toRdf(ee,Dt){const dt=this.toRdfHandlers[typeof ee];if(dt)for(const Y of dt){const Se=Y.toRdf(ee,Dt);if(Se)return Se}throw new Error(`Invalid JavaScript value: '${ee}'`)}getSupportedRdfDatatypes(){return this.supportedRdfDatatypes}getSupportedJavaScriptPrimitives(){return Object.keys(this.toRdfHandlers)}}},727:(Ut,it,et)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.TypeHandlerBoolean=void 0;const yt=et(6060);class ee{fromRdf(dt,Y){switch(dt.value){case"true":return!0;case"false":return!1;case"1":return!0;case"0":return!1}return Y&&yt.Translator.incorrectRdfDataType(dt),!1}toRdf(dt,{datatype:Y,dataFactory:Se}){return Se.literal(dt?"true":"false",Y||Se.namedNode(ee.TYPE))}}it.TypeHandlerBoolean=ee,ee.TYPE="http://www.w3.org/2001/XMLSchema#boolean"},2525:(Ut,it,et)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.TypeHandlerDate=void 0;const yt=et(6060);class ee{fromRdf(dt,Y){switch(Y&&!dt.value.match(ee.VALIDATORS[dt.datatype.value.substr(33,dt.datatype.value.length)])&&yt.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 Se=dt.value.split("-");return new Date(0,parseInt(Se[0],10)-1,parseInt(Se[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:Y,dataFactory:Se}){if(Y=Y||Se.namedNode(ee.TYPES[0]),!(dt instanceof Date))return null;const he=dt;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 Se.literal(W,Y)}}it.TypeHandlerDate=ee,ee.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"],ee.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]$/}},8554:(Ut,it,et)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.TypeHandlerNumberDouble=void 0;const yt=et(6060);class ee{fromRdf(dt,Y){const Se=parseFloat(dt.value);return Y&&isNaN(Se)&&yt.Translator.incorrectRdfDataType(dt),Se}toRdf(dt,{datatype:Y,dataFactory:Se}){return Y=Y||Se.namedNode(ee.TYPES[0]),isNaN(dt)?Se.literal("NaN",Y):isFinite(dt)?dt%1==0?null:Se.literal(dt.toExponential(15).replace(/(\d)0*e\+?/,"$1E"),Y):Se.literal(dt>0?"INF":"-INF",Y)}}it.TypeHandlerNumberDouble=ee,ee.TYPES=["http://www.w3.org/2001/XMLSchema#double","http://www.w3.org/2001/XMLSchema#decimal","http://www.w3.org/2001/XMLSchema#float"]},7750:(Ut,it,et)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.TypeHandlerNumberInteger=void 0;const yt=et(6060);class ee{fromRdf(dt,Y){const Se=parseInt(dt.value,10);return Y&&(isNaN(Se)||dt.value.indexOf(".")>=0)&&yt.Translator.incorrectRdfDataType(dt),Se}toRdf(dt,{datatype:Y,dataFactory:Se}){return Se.literal(String(dt),Y||Se.namedNode(dt<=ee.MAX_INT&&dt>=ee.MIN_INT?ee.TYPES[0]:ee.TYPES[1]))}}it.TypeHandlerNumberInteger=ee,ee.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"],ee.MAX_INT=2147483647,ee.MIN_INT=-2147483648},4608:(Ut,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.TypeHandlerString=void 0;class et{fromRdf(ee){return ee.value}toRdf(ee,{datatype:Dt,dataFactory:dt}){return dt.literal(ee,Dt)}}it.TypeHandlerString=et,et.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(Ut,it,et){"use strict";var yt=this&&this.__createBinding||(Object.create?function(Dt,dt,Y,Se){void 0===Se&&(Se=Y),Object.defineProperty(Dt,Se,{enumerable:!0,get:function(){return dt[Y]}})}:function(Dt,dt,Y,Se){void 0===Se&&(Se=Y),Dt[Se]=dt[Y]}),ee=this&&this.__exportStar||function(Dt,dt){for(var Y in Dt)"default"!==Y&&!Object.prototype.hasOwnProperty.call(dt,Y)&&yt(dt,Dt,Y)};Object.defineProperty(it,"__esModule",{value:!0}),ee(et(727),it),ee(et(2525),it),ee(et(8554),it),ee(et(7750),it),ee(et(4608),it)},2829:(Ut,it,et)=>{"use strict";var yt={};et.r(yt),et.d(yt,{decode:()=>Ume,encode:()=>zme});var ee={};et.r(ee),et.d(ee,{decode:()=>qme,encode:()=>Yme});var Dt={};et.r(Dt),et.d(Dt,{decode:()=>Xme,encode:()=>Kme});var dt={};function Y(n){return"function"==typeof n}et.r(dt),et.d(dt,{decode:()=>Qme,encode:()=>Zme});let Se=!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 Se&&console.log("RxJS: Back to a better error behavior. Thank you. <3");Se=n},get useDeprecatedSynchronousErrorHandling(){return Se}};function W(n){setTimeout(()=>{throw n},0)}const j={closed:!0,next(n){},error(n){if(he.useDeprecatedSynchronousErrorHandling)throw n;W(n)},complete(){}},k=Array.isArray||(n=>n&&"number"==typeof n.length);function Q(n){return null!==n&&"object"==typeof n}const v=(()=>{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 C{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 C)t.remove(this);else if(null!==t)for(let o=0;oe.concat(t instanceof v?t.errors:t),[])}C.EMPTY=((n=new C).closed=!0,n);const T="function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random();class y extends C{constructor(e,t,i){switch(super(),this.syncErrorValue=null,this.syncErrorThrown=!1,this.syncErrorThrowable=!1,this.isStopped=!1,arguments.length){case 0:this.destination=j;break;case 1:if(!e){this.destination=j;break}if("object"==typeof e){e instanceof y?(this.syncErrorThrowable=e.syncErrorThrowable,this.destination=e,e.add(this)):(this.syncErrorThrowable=!0,this.destination=new S(this,e));break}default:this.syncErrorThrowable=!0,this.destination=new S(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 S 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!==j&&(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 P="function"==typeof Symbol&&Symbol.observable||"@@observable";function X(n){return n}function ue(...n){return I(n)}function I(n){return 0===n.length?X:1===n.length?n[0]:function(t){return n.reduce((i,r)=>r(i),t)}}let O=(()=>{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(j)}(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=K(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)}[P](){return this}pipe(...t){return 0===t.length?this:I(t)(this)}toPromise(t){return new(t=K(t))((i,r)=>{let s;this.subscribe(o=>s=o,o=>r(o),()=>i(s))})}}return n.create=e=>new n(e),n})();function K(n){if(n||(n=he.Promise||Promise),!n)throw new Error("no Promise impl found");return n}const $=(()=>{function n(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return n.prototype=Object.create(Error.prototype),n})();class Z extends C{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 ae extends y{constructor(e){super(e),this.destination=e}}let oe=(()=>{class n extends O{constructor(){super(),this.observers=[],this.closed=!1,this.isStopped=!1,this.hasError=!1,this.thrownError=null}[T](){return new ae(this)}lift(t){const i=new te(this,this);return i.operator=t,i}next(t){if(this.closed)throw new $;if(!this.isStopped){const{observers:i}=this,r=i.length,s=i.slice();for(let o=0;onew te(e,t),n})();class te extends oe{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):C.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 ne(n,e))}}class ne{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 Oe=n=>e=>{for(let t=0,i=n.length;tn&&"number"==typeof n.length&&"function"!=typeof n;function Ke(n){return!!n&&"function"!=typeof n.subscribe&&"function"==typeof n.then}const Me=n=>{if(n&&"function"==typeof n[P])return(n=>e=>{const t=n[P]();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 Oe(n);if(Ke(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[Qe])return(n=>e=>{const t=n[Qe]();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 ${Q(n)?"an invalid object":`'${n}'`} where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.`;throw new TypeError(t)}};function ke(n,e){return new O(t=>{const i=new C;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 je(n,e){return e?function(n,e){if(null!=n){if(function(n){return n&&"function"==typeof n[P]}(n))return function(n,e){return new O(t=>{const i=new C;return i.add(e.schedule(()=>{const r=n[P]();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(Ke(n))return function(n,e){return new O(t=>{const i=new C;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 ke(n,e);if(function(n){return n&&"function"==typeof n[Qe]}(n)||"string"==typeof n)return function(n,e){if(!n)throw new Error("Iterable cannot be null");return new O(t=>{const i=new C;let r;return i.add(()=>{r&&"function"==typeof r.return&&r.return()}),i.add(e.schedule(()=>{r=n[Qe](),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 O?n:new O(Me(n))}class _t 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 we extends y{notifyNext(e){this.destination.next(e)}notifyError(e){this.destination.error(e)}notifyComplete(){this.destination.complete()}}function N(n,e){if(e.closed)return;if(n instanceof O)return n.subscribe(e);let t;try{t=Me(n)(e)}catch(i){e.error(i)}return t}function V(n,e,t=Number.POSITIVE_INFINITY){return"function"==typeof e?i=>i.pipe(V((r,s)=>je(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 Ze(e,this.project,this.concurrent))}}class Ze extends we{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 kt(n=Number.POSITIVE_INFINITY){return V(X,n)}function In(n,e){return e?ke(n,e):new O(Oe(n))}function Nn(...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 O?n[0]:kt(e)(In(n,t))}function Yn(){return function(e){return e.lift(new Mi(e))}}class Mi{constructor(e){this.connectable=e}call(e,t){const{connectable:i}=this;i._refCount++;const r=new xi(e,i),s=t.subscribe(r);return r.closed||(r.connection=i.connect()),s}}class xi 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 Xr extends O{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 C,e.add(this.source.subscribe(new fs(this.getSubject(),this))),e.closed&&(this._connection=null,e=C.EMPTY)),e}refCount(){return Yn()(this)}}const Ls=(()=>{const n=Xr.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 fs extends ae{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()}}}function xa(n,e){return function(i){let r;if(r="function"==typeof n?n:function(){return n},"function"==typeof e)return i.lift(new kl(r,e));const s=Object.create(i,Ls);return s.source=i,s.subjectFactory=r,s}}class kl{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 Sa(){return new oe}function ws(){return n=>Yn()(xa(Sa)(n))}function en(n){for(let e in n)if(n[e]===en)return e;throw Error("Could not find renamed property on target object.")}function nl(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 lt(n,e){return null==n||""===n?null===e?"":e:null==e||""===e?n:n+" "+e}const ht=en({__forward_ref__:en});function ge(n){return n.__forward_ref__=ge,n.toString=function(){return rt(this())},n}function ve(n){return Be(n)?n():n}function Be(n){return"function"==typeof n&&n.hasOwnProperty(ht)&&n.__forward_ref__===ge}class Je extends Error{constructor(e,t){super(function(n,e){return`${n?`NG0${n}: `:""}${e}`}(e,t)),this.code=e}}function Ot(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():Ot(n)}function bn(n,e){const t=e?` in ${e}`:"";throw new Je("201",`No provider for ${Qt(n)} found${t}`)}function J(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 St(n){return{providers:n.providers||[],imports:n.imports||[]}}function vn(n){return Es(n,fo)||Es(n,Vs)}function Es(n,e){return n.hasOwnProperty(e)?n[e]:null}function Fl(n){return n&&(n.hasOwnProperty(Br)||n.hasOwnProperty(Ac))?n[Br]:null}const fo=en({\u0275prov:en}),Br=en({\u0275inj:en}),Vs=en({ngInjectableDef:en}),Ac=en({ngInjectorDef:en});var xn=(()=>((xn=xn||{})[xn.Default=0]="Default",xn[xn.Host=1]="Host",xn[xn.Self=2]="Self",xn[xn.SkipSelf=4]="SkipSelf",xn[xn.Optional=8]="Optional",xn))();let po;function Ta(n){const e=po;return po=n,e}function Ed(n,e,t){const i=vn(n);return i&&"root"==i.providedIn?void 0===i.value?i.value=i.factory():i.value:t&xn.Optional?null:void 0!==e?e:void bn(rt(n),"Injector")}function De(n){return{toString:n}.toString()}var Ge=(()=>((Ge=Ge||{})[Ge.OnPush=0]="OnPush",Ge[Ge.Default=1]="Default",Ge))(),Xt=(()=>((Xt=Xt||{})[Xt.Emulated=0]="Emulated",Xt[Xt.None=2]="None",Xt[Xt.ShadowDom=3]="ShadowDom",Xt))();const ui="undefined"!=typeof globalThis&&globalThis,Vr="undefined"!=typeof window&&window,Jr="undefined"!=typeof self&&"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&self,xs="undefined"!=typeof global&&global,Zn=ui||xs||Vr||Jr,xd={},er=[],fp=en({\u0275cmp:en}),n_=en({\u0275dir:en}),Oh=en({\u0275pipe:en}),iv=en({\u0275mod:en}),T1=en({\u0275loc:en}),Bl=en({\u0275fac:en}),Rh=en({__NG_ELEMENT_ID__:en});let A1=0;function rn(n){return De(()=>{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===Ge.OnPush,directiveDefs:null,pipeDefs:null,selectors:n.selectors||er,viewQuery:n.viewQuery||null,features:n.features||null,data:n.data||{},encapsulation:n.encapsulation||Xt.Emulated,id:"c",styles:n.styles||er,_:null,setInput:null,schemas:n.schemas||null,tView:null},r=n.directives,s=n.features,o=n.pipes;return i.id+=A1++,i.inputs=av(n.inputs,t),i.outputs=av(n.outputs),s&&s.forEach(a=>a(i)),i.directiveDefs=r?()=>("function"==typeof r?r():r).map(rv):null,i.pipeDefs=o?()=>("function"==typeof o?o():o).map(sv):null,i})}function rv(n){return Ui(n)||function(n){return n[n_]||null}(n)}function sv(n){return function(n){return n[Oh]||null}(n)}const ov={};function tn(n){return De(()=>{const e={type:n.type,bootstrap:n.bootstrap||er,declarations:n.declarations||er,imports:n.imports||er,exports:n.exports||er,transitiveCompileScopes:null,schemas:n.schemas||null,id:n.id||null};return null!=n.id&&(ov[n.id]=n.type),e})}function av(n,e){if(null==n)return xd;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 Nt=rn;function js(n){return{type:n.type,name:n.name,factory:null,pure:!1!==n.pure,onDestroy:n.type.prototype.ngOnDestroy||null}}function Ui(n){return n[fp]||null}function No(n,e){const t=n[iv]||null;if(!t&&!0===e)throw new Error(`Type ${rt(n)} does not have '\u0275mod' property.`);return t}function Jo(n){return Array.isArray(n)&&"object"==typeof n[1]}function ea(n){return Array.isArray(n)&&!0===n[1]}function s_(n){return 0!=(8&n.flags)}function Ad(n){return 2==(2&n.flags)}function Md(n){return 1==(1&n.flags)}function Da(n){return null!==n.template}function lv(n){return 0!=(512&n[2])}function Ic(n,e){return n.hasOwnProperty(Bl)?n[Bl]:null}class c_{constructor(e,t,i){this.previousValue=e,this.currentValue=t,this.firstChange=i}isFirstChange(){return this.firstChange}}function Fi(){return dv}function dv(n){return n.type.prototype.ngOnChanges&&(n.setInput=k1),N1}function N1(){const n=at(this),e=null==n?void 0:n.current;if(e){const t=n.previous;if(t===xd)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=at(n)||function(n,e){return n[Bh]=e}(n,{previous:xd,current:null}),s=r.current||(r.current={}),o=r.previous,a=this.declaredInputs[t],l=o[a];s[a]=new c_(l&&l.currentValue,e,o===xd),n[i]=e}Fi.ngInherit=!0;const Bh="__ngSimpleChanges__";function at(n){return n[Bh]||null}let Yi;function dr(n){return!!n.listen}const Su={createRenderer:(n,e)=>void 0!==Yi?Yi:"undefined"!=typeof document?document:void 0};function Sr(n){for(;Array.isArray(n);)n=n[0];return n}function Vh(n,e){return Sr(e[n])}function eo(n,e){return Sr(e[n.index])}function h_(n,e){return n.data[e]}function Dd(n,e){return n[e]}function zs(n,e){const t=e[n];return Jo(t)?t:t[0]}function Ul(n){return 4==(4&n[2])}function Id(n){return 128==(128&n[2])}function Oa(n,e){return null==e?null:n[e]}function f_(n){n[18]=0}function mp(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:Tu(null),bindingsEnabled:!0,isInCheckNoChangesMode:!1};function fv(){return Ln.bindingsEnabled}function Vt(){return Ln.lFrame.lView}function Si(){return Ln.lFrame.tView}function _r(n){return Ln.lFrame.contextLView=n,n[8]}function as(){let n=p_();for(;null!==n&&64===n.type;)n=n.parent;return n}function p_(){return Ln.lFrame.currentTNode}function sl(n,e){const t=Ln.lFrame;t.currentTNode=n,t.isParent=e}function zr(){return Ln.lFrame.isParent}function ps(){Ln.lFrame.isParent=!1}function zh(){return Ln.isInCheckNoChangesMode}function yp(n){Ln.isInCheckNoChangesMode=n}function Cs(){const n=Ln.lFrame;let e=n.bindingRootIndex;return-1===e&&(e=n.bindingRootIndex=n.tView.bindingStartIndex),e}function Ra(){return Ln.lFrame.bindingIndex++}function Fo(n){const e=Ln.lFrame,t=e.bindingIndex;return e.bindingIndex=e.bindingIndex+n,t}function Od(n,e){const t=Ln.lFrame;t.bindingIndex=t.bindingRootIndex=n,g_(e)}function g_(n){Ln.lFrame.currentDirectiveIndex=n}function m_(n){const e=Ln.lFrame.currentDirectiveIndex;return-1===e?null:n[e]}function pv(){return Ln.lFrame.currentQueryIndex}function __(n){Ln.lFrame.currentQueryIndex=n}function vp(n){const e=n[1];return 2===e.type?e.declTNode:1===e.type?n[6]:null}function Rd(n,e,t){if(t&xn.SkipSelf){let r=e,s=n;for(;!(r=r.parent,null!==r||t&xn.Host||(r=vp(s),null===r||(s=s[15],10&r.type))););if(null===r)return!1;e=r,n=s}const i=Ln.lFrame=xe();return i.currentTNode=e,i.lView=n,!0}function $h(n){const e=xe(),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 xe(){const n=Ln.lFrame,e=null===n?null:n.child;return null===e?Tu(n):e}function Tu(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 Wh(){const n=Ln.lFrame;return Ln.lFrame=n.parent,n.currentTNode=null,n.lView=null,n}const Lo=Wh;function fi(){const n=Wh();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 to(){return Ln.lFrame.selectedIndex}function _o(n){Ln.lFrame.selectedIndex=n}function Nr(){const n=Ln.lFrame;return h_(n.tView,n.selectedIndex)}function wp(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 qh{constructor(e,t,i){this.factory=e,this.resolving=!1,this.canSeeViewProviders=t,this.injectImpl=i}}function Sp(n,e,t){const i=dr(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 Nd=!0;function Cp(n){const e=Nd;return Nd=n,e}let x_=0;function Hs(n,e){const t=Tp(n,e);if(-1!==t)return t;const i=e[1];i.firstCreatePass&&(n.injectorIndex=e.length,S_(i.data,n),S_(e,null),S_(i.blueprint,null));const r=Xh(n,e),s=n.injectorIndex;if(yv(r)){const o=Pd(r),a=al(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 S_(n,e){n.push(0,0,0,0,0,0,0,0,e)}function Tp(n,e){return-1===n.injectorIndex||n.parent&&n.parent.injectorIndex===n.injectorIndex||null===e[n.injectorIndex+8]?-1:n.injectorIndex}function Xh(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 Rc(n,e,t){!function(n,e,t){let i;"string"==typeof t?i=t.charCodeAt(0)||0:t.hasOwnProperty(Rh)&&(i=t[Rh]),null==i&&(i=t[Rh]=x_++);const r=255&i;e.data[n+(r>>5)]|=1<=0?255&e:Ev:e}(t);if("function"==typeof s){if(!Rd(e,n,i))return i&xn.Host?C_(r,t,i):vv(e,t,i,r);try{const o=s(i);if(null!=o||i&xn.Optional)return o;bn(t)}finally{Lo()}}else if("number"==typeof s){let o=null,a=Tp(n,e),l=-1,c=i&xn.Host?e[16][6]:null;for((-1===a||i&xn.SkipSelf)&&(l=-1===a?Xh(n,e):e[a+8],-1!==l&&Qh(i,!1)?(o=e[1],a=Pd(l),e=al(l,e)):a=-1);-1!==a;){const u=e[1];if(Ap(s,a,u.data)){const h=Ts(a,e,t,o,i,c);if(h!==wv)return h}l=e[a+8],-1!==l&&Qh(i,e[1].data[a+8]===c)&&Ap(s,a,e)?(o=u,a=Pd(l),e=al(l,e)):a=-1}}}return vv(e,t,i,r)}const wv={};function Ev(){return new na(as(),Vt())}function Ts(n,e,t,i,r,s){const o=e[1],a=o.data[n+8],u=kd(a,o,t,null==i?Ad(a)&&Nd:i!=o&&0!=(3&a.type),r&xn.Host&&s===a);return null!==u?Fd(e,o,u,a):wv}function kd(n,e,t,i,r){const s=n.providerIndexes,o=e.data,a=1048575&s,l=n.directiveStart,u=s>>20,f=r?a+u:n.directiveEnd;for(let g=i?a:a+u;g=l&&m.type===t)return g}if(r){const g=o[l];if(g&&Da(g)&&g.type===t)return l}return null}function Fd(n,e,t,i){let r=n[t];const s=e.data;if(function(n){return n instanceof qh}(r)){const o=r;o.resolving&&function(n,e){throw new Je("200",`Circular dependency in DI detected for ${n}`)}(Qt(s[t]));const a=Cp(o.canSeeViewProviders);o.resolving=!0;const l=o.injectImpl?Ta(o.injectImpl):null;Rd(n,i,xn.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=dv(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&&Ta(l),Cp(a),o.resolving=!1,Lo()}}return r}function Ap(n,e,t){return!!(t[e+(n>>5)]&1<{const e=n.prototype.constructor,t=e[Bl]||As(e),i=Object.prototype;let r=Object.getPrototypeOf(n.prototype).constructor;for(;r&&r!==i;){const s=r[Bl]||As(r);if(s&&s!==t)return s;r=Object.getPrototypeOf(r)}return s=>new s})}function As(n){return Be(n)?()=>{const e=As(ve(n));return e&&e()}:Ic(n)}function yo(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{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,u){const h=l.hasOwnProperty(Bd)?l[Bd]:Object.defineProperty(l,Bd,{value:[]})[Bd];for(;h.length<=u;)h.push(null);return(h[u]=h[u]||[]).push(o),l}}return t&&(r.prototype=Object.create(t.prototype)),r.prototype.ngMetadataName=n,r.annotationCls=r,r})}class Ht{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}`}}const Du=Function;function ia(n,e){void 0===e&&(e=n);for(let t=0;tArray.isArray(t)?ra(t,e):e(t))}function Jh(n,e,t){e>=n.length?n.push(t):n.splice(e,0,t)}function Hl(n,e){return e>=n.length-1?n.pop():n.splice(e,1)[0]}function Nc(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 O_(n,e){const t=Ms(n,e);if(t>=0)return n[1|t]}function Ms(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(Lc,"\n ")}`}("\n"+n.message,r,t,i),n.ngTokenPath=r,n[Fc]=null,n}const Hd=zd(ka("Inject",n=>({token:n})),-1),ts=zd(ka("Optional"),8),dl=zd(ka("SkipSelf"),4);let $d;function Fu(n){var e;return(null===(e=function(){if(void 0===$d&&($d=null,Zn.trustedTypes))try{$d=Zn.trustedTypes.createPolicy("angular",{createHTML:n=>n,createScript:n=>n,createScriptURL:n=>n})}catch(n){}return $d}())||void 0===e?void 0:e.createHTML(n))||n}class ql{constructor(e){this.changingThisBreaksApplicationSecurity=e}toString(){return`SafeValue must use [property]=binding: ${this.changingThisBreaksApplicationSecurity} (see https://g.co/ng/security#xss)`}}class L_ extends ql{getTypeName(){return"HTML"}}class B_ extends ql{getTypeName(){return"Style"}}class jp extends ql{getTypeName(){return"Script"}}class Wd extends ql{getTypeName(){return"URL"}}class kn extends ql{getTypeName(){return"ResourceURL"}}function Gs(n){return n instanceof ql?n.changingThisBreaksApplicationSecurity:n}function sa(n,e){const t=jc(n);if(null!=t&&t!==e){if("ResourceURL"===t&&"URL"===e)return!0;throw new Error(`Required a safe ${e}, got a ${t} (see https://g.co/ng/security#xss)`)}return t===e}function jc(n){return n instanceof ql&&n.getTypeName()||null}class jv{constructor(e){this.inertDocumentHelper=e}getInertBodyElement(e){e=""+e;try{const t=(new window.DOMParser).parseFromString(Fu(e),"text/html").body;return null===t?this.inertDocumentHelper.getInertBodyElement(e):(t.removeChild(t.firstChild),t)}catch(t){return null}}}class fT{constructor(e){if(this.defaultDoc=e,this.inertDocument=this.defaultDoc.implementation.createHTMLDocument("sanitization-inert"),null==this.inertDocument.body){const t=this.inertDocument.createElement("html");this.inertDocument.appendChild(t);const i=this.inertDocument.createElement("body");t.appendChild(i)}}getInertBodyElement(e){const t=this.inertDocument.createElement("template");if("content"in t)return t.innerHTML=Fu(e),t;const i=this.inertDocument.createElement("body");return i.innerHTML=Fu(e),this.defaultDoc.documentMode&&this.stripCustomNsAttrs(i),i}stripCustomNsAttrs(e){const t=e.attributes;for(let r=t.length-1;0jo(e.trim())).join(", ")}function oa(n){const e={};for(const t of n.split(","))e[t]=!0;return e}function tf(...n){const e={};for(const t of n)for(const i in t)t.hasOwnProperty(i)&&(e[i]=!0);return e}const Up=oa("area,br,col,hr,img,wbr"),zv=oa("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr"),Hv=oa("rp,rt"),j_=tf(Up,tf(zv,oa("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")),tf(Hv,oa("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")),tf(Hv,zv)),U_=oa("background,cite,href,itemtype,longdesc,poster,src,xlink:href"),z_=oa("srcset"),H_=tf(U_,z_,oa("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"),oa("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")),bT=oa("script,style,template");class G_{constructor(){this.sanitizedSomething=!1,this.buf=[]}sanitizeChildren(e){let t=e.firstChild,i=!0;for(;t;)if(t.nodeType===Node.ELEMENT_NODE?i=this.startElement(t):t.nodeType===Node.TEXT_NODE?this.chars(t.nodeValue):this.sanitizedSomething=!0,i&&t.firstChild)t=t.firstChild;else for(;t;){t.nodeType===Node.ELEMENT_NODE&&this.endElement(t);let r=this.checkClobberedElement(t,t.nextSibling);if(r){t=r;break}t=this.checkClobberedElement(t,t.parentNode)}return this.buf.join("")}startElement(e){const t=e.nodeName.toLowerCase();if(!j_.hasOwnProperty(t))return this.sanitizedSomething=!0,!bT.hasOwnProperty(t);this.buf.push("<"),this.buf.push(t);const i=e.attributes;for(let r=0;r"),!0}endElement(e){const t=e.nodeName.toLowerCase();j_.hasOwnProperty(t)&&!Up.hasOwnProperty(t)&&(this.buf.push(""))}chars(e){this.buf.push(Hp(e))}checkClobberedElement(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: ${e.outerHTML}`);return t}}const Gv=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,nf=/([^\#-~ |!])/g;function Hp(n){return n.replace(/&/g,"&").replace(Gv,function(e){return"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";"}).replace(nf,function(e){return"&#"+e.charCodeAt(0)+";"}).replace(//g,">")}let rf;function $_(n,e){let t=null;try{rf=rf||function(n){const e=new fT(n);return function(){try{return!!(new window.DOMParser).parseFromString(Fu(""),"text/html")}catch(n){return!1}}()?new jv(e):e}(n);let i=e?String(e):"";t=rf.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=t.innerHTML,t=rf.getInertBodyElement(i)}while(i!==s);return Fu((new G_).sanitizeChildren(qd(t)||t))}finally{if(t){const i=qd(t)||t;for(;i.firstChild;)i.removeChild(i.firstChild)}}}function qd(n){return"content"in n&&function(n){return n.nodeType===Node.ELEMENT_NODE&&"TEMPLATE"===n.nodeName}(n)?n.content:null}var si=(()=>((si=si||{})[si.NONE=0]="NONE",si[si.HTML=1]="HTML",si[si.STYLE=2]="STYLE",si[si.SCRIPT=3]="SCRIPT",si[si.URL=4]="URL",si[si.RESOURCE_URL=5]="RESOURCE_URL",si))();function sf(n){const e=function(){const n=Vt();return n&&n[12]}();return e?e.sanitize(si.URL,n)||"":sa(n,"URL")?Gs(n):jo(Ot(n))}const Y_="__ngContext__";function Ds(n,e){n[Y_]=e}function X_(n){const e=function(n){return n[Y_]||null}(n);return e?Array.isArray(e)?e:e.lView:null}function Gp(n){return n.ngOriginalError}function RT(n,...e){n.error(...e)}class la{constructor(){this._console=console}handleError(e){const t=this._findOriginalError(e),i=this._findContext(e),r=function(n){return n&&n.ngErrorLogger||RT}(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(Gp(e)):null}_findOriginalError(e){let t=e&&Gp(e);for(;t&&Gp(t);)t=Gp(t);return t||null}}const tw=(()=>("undefined"!=typeof requestAnimationFrame&&requestAnimationFrame||setTimeout).bind(Zn))();function fl(n){return n instanceof Function?n():n}var Uo=(()=>((Uo=Uo||{})[Uo.Important=1]="Important",Uo[Uo.DashCase=2]="DashCase",Uo))();function ey(n,e){return undefined(n,e)}function lf(n){const e=n[3];return ea(e)?e[3]:e}function Xd(n){return ow(n[13])}function ny(n){return ow(n[4])}function ow(n){for(;null!==n&&!ea(n);)n=n[4];return n}function Kd(n,e,t,i,r){if(null!=i){let s,o=!1;ea(i)?s=i:Jo(i)&&(o=!0,i=i[0]);const a=Sr(i);0===n&&null!==t?null==r?dw(e,t,a):pl(e,t,a,r||null,!0):1===n&&null!==t?pl(e,t,a,r||null,!0):2===n?function(n,e,t){const i=qp(n,e);i&&function(n,e,t,i){dr(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!==Sr(t)&&Kd(e,n,i,s,r);for(let a=10;a0&&(n[t-1][4]=i[4]);const s=Hl(n,10+e);!function(n,e){Qd(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 oy(n,e){if(!(256&e[2])){const t=e[11];dr(t)&&t.destroyNode&&Qd(n,e,t,3,null,null),function(n){let e=n[13];if(!e)return Wp(n[1],n);for(;e;){let t=null;if(Jo(e))t=e[13];else{const i=e[10];i&&(t=i)}if(!t){for(;e&&!e[4]&&e!==n;)Jo(e)&&Wp(e[1],e),e=e[3];null===e&&(e=n),Jo(e)&&Wp(e[1],e),t=e&&e[4]}e=t}}(e)}}function Wp(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[h+1].toLowerCase();const g=8&i?f:null;if(g&&-1!==uf(g,c,0)||2&i&&c!==f){if(La(i))return!1;o=!0}}}}else{if(!o&&!La(i)&&!La(l))return!1;if(o&&La(l))continue;o=!1,i=l|1&i}}return La(i)||o}function La(n){return 0==(1&n)}function oA(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&&!La(o)&&(e+=Sw(s,r),r=""),i=o,s=s||!La(i);t++}return""!==r&&(e+=Sw(s,r)),e}const Dn={};function zt(n){Cw(Si(),Vt(),to()+n,zh())}function Cw(n,e,t,i){if(!i)if(3==(3&e[2])){const s=n.preOrderCheckHooks;null!==s&&Ep(e,s,t)}else{const s=n.preOrderHooks;null!==s&&xp(e,s,0,t)}_o(t)}function gl(n,e){return n<<17|e<<2}function On(n){return n>>17&32767}function Cr(n){return 2|n}function Yl(n){return(131068&n)>>2}function ml(n,e){return-131069&n|e<<2}function hy(n){return 1|n}function Nw(n,e){const t=n.contentQueries;if(null!==t)for(let i=0;i20&&Cw(n,e,20,zh()),t(i,r)}finally{_o(s)}}function pf(n,e,t){!fv()||(function(n,e,t,i){const r=t.directiveStart,s=t.directiveEnd;n.firstCreatePass||Hs(t,e),Ds(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 $w(n,e){null!==n.hostBindings&&n.hostBindings(1,e)}function Ww(n,e){e.flags|=2,(n.components||(n.components=[])).push(e.index)}function NA(n,e,t){if(t){if(e.exportAs)for(let i=0;i0&&Sy(t)}}function Sy(n){for(let i=Xd(n);null!==i;i=ny(i))for(let r=10;r0&&Sy(s)}const t=n[1].components;if(null!==t)for(let i=0;i0&&Sy(r)}}function UA(n,e){const t=zs(e,n),i=t[1];(function(n,e){for(let t=e.length;tPromise.resolve(null))();function Xw(n){return n[7]||(n[7]=[])}function ig(n){return n.cleanup||(n.cleanup=[])}function Dy(n,e,t){return(null===n||Da(n))&&(t=function(n){for(;Array.isArray(n);){if("object"==typeof n[1])return n;n=n[0]}return null}(t[e.index])),t[11]}function Iy(n,e){const t=n[9],i=t?t.get(la,null):null;i&&i.handleError(e)}function Kw(n,e,t,i,r){for(let s=0;sthis.processProvider(a,e,t)),ra([e],a=>this.processInjectorType(a,[],s)),this.records.set(Vu,Uu(void 0,this));const o=this.records.get(ju);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=Ru,i=xn.Default){this.assertNotDestroyed();const r=Ud(this),s=Ta(void 0);try{if(!(i&xn.SkipSelf)){let a=this.records.get(e);if(void 0===a){const l=function(n){return"function"==typeof n||"object"==typeof n&&n instanceof Ht}(e)&&vn(e);a=l&&this.injectableDefInScope(l)?Uu(ky(e),gf):null,this.records.set(e,a)}if(null!=a)return this.hydrate(e,a)}return(i&xn.Self?Qw():this.parent).get(e,t=i&xn.Optional&&t===Ru?null:t)}catch(o){if("NullInjectorError"===o.name){if((o[Fc]=o[Fc]||[]).unshift(rt(e)),r)throw o;return no(o,e,"R3InjectorError",this.source)}throw o}finally{Ta(s),Ud(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=Fl(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=Fl(s)),null==r)return!1;if(null!=r.imports&&!a){let u;i.push(o);try{ra(r.imports,h=>{this.processInjectorType(h,t,i)&&(void 0===u&&(u=[]),u.push(h))})}finally{}if(void 0!==u)for(let h=0;hthis.processProvider(m,f,g||er))}}this.injectorDefTypes.add(o);const l=Ic(o)||(()=>new o);this.records.set(o,Uu(l,gf));const c=r.providers;if(null!=c&&!a){const u=e;ra(c,h=>this.processProvider(h,u,c))}return void 0!==s&&void 0!==e.providers}processProvider(e,t,i){let r=Hc(e=ve(e))?e:ve(e&&e.provide);const s=function(n,e,t){return eE(n)?Uu(void 0,n.useValue):Uu(Jw(n),gf)}(e);if(Hc(e)||!0!==e.multi)this.records.get(r);else{let o=this.records.get(r);o||(o=Uu(void 0,gf,!0),o.factory=()=>Nu(o.multi),this.records.set(r,o)),r=e,o.multi.push(e)}this.records.set(r,s)}hydrate(e,t){return t.value===gf&&(t.value=YA,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 ky(n){const e=vn(n),t=null!==e?e.factory:Ic(n);if(null!==t)return t;if(n instanceof Ht)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=Nc(e,"?");throw new Error(`Can't resolve all parameters for ${rt(n)}: (${i.join(", ")}).`)}const t=function(n){const e=n&&(n[fo]||n[Vs]);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 Jw(n,e,t){let i;if(Hc(n)){const r=ve(n);return Ic(r)||ky(r)}if(eE(n))i=()=>ve(n.useValue);else if(function(n){return!(!n||!n.useFactory)}(n))i=()=>n.useFactory(...Nu(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 Ic(r)||ky(r);i=()=>new r(...Nu(n.deps))}return i}function Uu(n,e,t=!1){return{factory:n,value:e,multi:t?[]:void 0}}function eE(n){return null!==n&&"object"==typeof n&&Pp in n}function Hc(n){return"function"==typeof n}const tE=function(n,e,t){return function(n,e=null,t=null,i){const r=Zw(n,e,t,i);return r._resolveInjectorDefTypes(),r}({name:t},e,n,t)};class Hn{static create(e,t){return Array.isArray(e)?tE(e,t,""):tE(e.providers,e.parent,e.name||"")}}function Fq(n,e){wp(X_(n)[1],as())}function En(n){let e=function(n){return Object.getPrototypeOf(n.prototype).constructor}(n.type),t=!0;const i=[n];for(;e;){let r;if(Da(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=lM(n.inputs),o.declaredInputs=lM(n.declaredInputs),o.outputs=lM(n.outputs);const a=r.hostBindings;a&&jq(n,a);const l=r.viewQuery,c=r.contentQueries;if(l&&Bq(n,l),c&&Vq(n,c),nl(n.inputs,r.inputs),nl(n.declaredInputs,r.declaredInputs),nl(n.outputs,r.outputs),Da(r)&&r.data.animation){const u=n.data;u.animation=(u.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=Yh(r.hostAttrs,t=Yh(t,r.hostAttrs))}}(i)}function lM(n){return n===xd?{}:n===er?[]:n}function Bq(n,e){const t=n.viewQuery;n.viewQuery=t?(i,r)=>{e(i,r),t(i,r)}:e}function Vq(n,e){const t=n.contentQueries;n.contentQueries=t?(i,r,s)=>{e(i,r,s),t(i,r,s)}:e}function jq(n,e){const t=n.hostBindings;n.hostBindings=t?(i,r)=>{e(i,r),t(i,r)}:e}Hn.THROW_IF_NOT_FOUND=Ru,Hn.NULL=new so,Hn.\u0275prov=We({token:Hn,providedIn:"any",factory:()=>Ie(Vu)}),Hn.__NG_ELEMENT_ID__=-1;let oE=null;function sg(){if(!oE){const n=Zn.Symbol;if(n&&n.iterator)oE=n.iterator;else{const e=Object.getOwnPropertyNames(Map.prototype);for(let t=0;ta(Sr(_e[i.index])):i.index;if(dr(t)){let _e=null;if(!a&&l&&(_e=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!==_e)(_e.__ngLastListenerFn__||_e).__ngNextListenerFn__=s,_e.__ngLastListenerFn__=s,g=!1;else{s=gM(i,e,h,s,!1);const Pe=t.listen(U,r,s);f.push(s,Pe),u&&u.push(r,ie,D,D+1)}}else s=gM(i,e,h,s,!0),U.addEventListener(r,s,o),f.push(s),u&&u.push(r,ie,D,o)}else s=gM(i,e,h,s,!1);const m=i.outputs;let w;if(g&&null!==m&&(w=m[r])){const x=w.length;if(x)for(let U=0;U0;)e=e[15],n--;return e}(n,Ln.lFrame.contextLView))[8]}(n)}function vY(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 Os={textEnd:0,key:0,keyEnd:0,value:0,valueEnd:0};function k2(n){return n.substring(Os.key,Os.keyEnd)}function F2(n,e){const t=Os.textEnd;return t===e?-1:(e=Os.keyEnd=function(n,e,t){for(;e32;)e++;return e}(n,Os.key=e,t),bg(n,e,t))}function bg(n,e,t){for(;e=0;t=F2(e,t))Bo(n,k2(e),!0)}function Jl(n,e,t,i){const r=Vt(),s=Si(),o=Fo(2);s.firstUpdatePass&&z2(s,n,o,i),e!==Dn&&Eo(r,o,e)&&G2(s,s.data[to()],r,r[11],n,r[o+1]=function(n,e){return null==n||("string"==typeof e?n+=e:"object"==typeof n&&(n=rt(Gs(n)))),n}(e,t),i,o)}function U2(n,e){return e>=n.expandoStartIndex}function z2(n,e,t,i){const r=n.data;if(null===r[t+1]){const s=r[to()],o=U2(n,t);W2(s,i)&&null===e&&!o&&(e=!1),e=function(n,e,t,i){const r=m_(n);let s=i?e.residualClasses:e.residualStyles;if(null===r)0===(i?e.classBindings:e.styleBindings)&&(t=Hy(t=_M(null,n,e,t,i),e.attrs,i),s=null);else{const o=e.directiveStylingLast;if(-1===o||n[o]!==r)if(t=_M(r,n,e,t,i),null===s){let l=function(n,e,t){const i=t?e.classBindings:e.styleBindings;if(0!==Yl(i))return n[On(i)]}(n,e,i);void 0!==l&&Array.isArray(l)&&(l=_M(null,n,e,l[1],i),l=Hy(l,e.attrs,i),function(n,e,t,i){n[On(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 u=t;if(r)if(0!==l){const f=On(n[a+1]);n[i+1]=gl(f,a),0!==f&&(n[f+1]=ml(n[f+1],i)),n[a+1]=function(n,e){return 131071&n|e<<17}(n[a+1],i)}else n[i+1]=gl(a,0),0!==a&&(n[a+1]=ml(n[a+1],i)),a=i;else n[i+1]=gl(l,0),0===a?a=i:n[l+1]=ml(n[l+1],i),l=i;c&&(n[i+1]=Cr(n[i+1])),N2(n,u,i,!0),N2(n,u,i,!1),function(n,e,t,i,r){const s=r?n.residualClasses:n.residualStyles;null!=s&&"string"==typeof e&&Ms(s,e)>=0&&(t[i+1]=hy(t[i+1]))}(e,u,n,i,s),o=gl(a,l),s?e.classBindings=o:e.styleBindings=o}(r,s,e,t,o,i)}}function _M(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),u=c?l[1]:l,h=null===u;let f=t[r+1];f===Dn&&(f=h?er:void 0);let g=h?O_(f,i):u===i?f:void 0;if(c&&!hE(g)&&(g=O_(l,i)),hE(g)&&(a=g,o))return a;const m=n[r+1];r=o?On(m):Yl(m)}if(null!==e){let l=s?e.residualClasses:e.residualStyles;null!=l&&(a=O_(l,i))}return a}function hE(n){return void 0!==n}function W2(n,e){return 0!=(n.flags&(e?16:32))}function Jn(n,e=""){const t=Vt(),i=Si(),r=n+20,s=i.firstCreatePass?Jd(i,r,1,e,null):i.data[r],o=t[r]=function(n,e){return dr(n)?n.createText(e):n.createTextNode(e)}(t[11],e);Yp(i,t,o,s),sl(s,!1)}function gs(n){return xo("",n,""),gs}function xo(n,e,t){const i=Vt(),r=ag(i,n,e,t);return r!==Dn&&Xl(i,to(),r),xo}function qc(n,e,t){const i=Vt();return Eo(i,Ra(),e)&&zo(Si(),Nr(),i,n,e,i[11],t,!0),qc}function fE(n,e,t){const i=Vt();if(Eo(i,Ra(),e)){const s=Si(),o=Nr();zo(s,o,i,n,e,Dy(m_(s.data),o,i),t,!0)}return fE}const _f=void 0;var iX=["en",[["a","p"],["AM","PM"],_f],[["AM","PM"],_f,_f],[["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"]],_f,[["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"]],_f,[["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}",_f,"{1} 'at' {0}",_f],[".",",",";","%","+","-","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 vg={};function uL(n){return n in vg||(vg[n]=Zn.ng&&Zn.ng.common&&Zn.ng.common.locales&&Zn.ng.common.locales[n]),vg[n]}var un=(()=>((un=un||{})[un.LocaleId=0]="LocaleId",un[un.DayPeriodsFormat=1]="DayPeriodsFormat",un[un.DayPeriodsStandalone=2]="DayPeriodsStandalone",un[un.DaysFormat=3]="DaysFormat",un[un.DaysStandalone=4]="DaysStandalone",un[un.MonthsFormat=5]="MonthsFormat",un[un.MonthsStandalone=6]="MonthsStandalone",un[un.Eras=7]="Eras",un[un.FirstDayOfWeek=8]="FirstDayOfWeek",un[un.WeekendRange=9]="WeekendRange",un[un.DateFormat=10]="DateFormat",un[un.TimeFormat=11]="TimeFormat",un[un.DateTimeFormat=12]="DateTimeFormat",un[un.NumberSymbols=13]="NumberSymbols",un[un.NumberFormats=14]="NumberFormats",un[un.CurrencyCode=15]="CurrencyCode",un[un.CurrencySymbol=16]="CurrencySymbol",un[un.CurrencyName=17]="CurrencyName",un[un.Currencies=18]="Currencies",un[un.Directionality=19]="Directionality",un[un.PluralCase=20]="PluralCase",un[un.ExtraData=21]="ExtraData",un))();const pE="en-US";let dL=pE;function bM(n){J(n,"Expected localeId to be defined"),"string"==typeof n&&(dL=n.toLowerCase().replace(/_/g,"-"))}function EM(n,e,t,i,r){if(n=ve(n),Array.isArray(n))for(let s=0;s>20;if(Hc(n)||!n.multi){const g=new qh(l,r,Ce),m=SM(a,e,r?u:u+f,h);-1===m?(Rc(Hs(c,o),s,a),xM(s,n,e.length),e.push(a),c.directiveStart++,c.directiveEnd++,r&&(c.providerIndexes+=1048576),t.push(g),o.push(g)):(t[m]=g,o[m]=g)}else{const g=SM(a,e,u+f,h),m=SM(a,e,u,u+f),w=g>=0&&t[g],x=m>=0&&t[m];if(r&&!x||!r&&!w){Rc(Hs(c,o),s,a);const U=function(n,e,t,i,r){const s=new qh(n,t,Ce);return s.multi=[],s.index=e,s.componentProviders=0,kL(s,r,i&&!t),s}(r?eK:JX,t.length,r,i,l);!r&&x&&(t[m].providerFactory=U),xM(s,n,e.length,0),e.push(a),c.directiveStart++,c.directiveEnd++,r&&(c.providerIndexes+=1048576),t.push(U),o.push(U)}else xM(s,n,g>-1?g:m,kL(t[r?m:g],l,!r&&i));!r&&i&&x&&t[m].componentProviders++}}}function xM(n,e,t,i){const r=Hc(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 kL(n,e,t){return t&&n.componentProviders++,n.multi.push(e)-1}function SM(n,e,t,i){for(let r=t;r{t.providersResolver=(i,r)=>function(n,e,t){const i=Si();if(i.firstCreatePass){const r=Da(n);EM(t,i.data,i.blueprint,r,!0),EM(e,i.data,i.blueprint,r,!1)}}(i,r?r(n):n,e)}}class FL{}const BL="ngComponent";class iK{resolveComponentFactory(e){throw function(n){const e=Error(`No component factory found for ${rt(n)}. Did you add it to @NgModule.entryComponents?`);return e[BL]=n,e}(e)}}class El{}function bE(...n){}function Eg(n,e){return new gn(eo(n,e))}El.NULL=new iK;const oK=function(){return Eg(as(),Vt())};let gn=(()=>{class n{constructor(t){this.nativeElement=t}}return n.__NG_ELEMENT_ID__=oK,n})();function VL(n){return n instanceof gn?n.nativeElement:n}class yf{}let AM=(()=>{class n{}return n.\u0275prov=We({token:n,providedIn:"root",factory:()=>null}),n})();class Hu{constructor(e){this.full=e,this.major=e.split(".")[0],this.minor=e.split(".")[1],this.patch=e.split(".").slice(2).join(".")}}const jL=new Hu("12.2.5");class UL{constructor(){}supports(e){return jy(e)}create(e){return new hK(e)}}const dK=(n,e)=>e;class hK{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||dK}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 fK(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 zL),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 zL),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 fK{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 pK{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 zL{constructor(){this.map=new Map}put(e){const t=e.trackById;let i=this.map.get(t);i||(i=new pK,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 HL(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 mK(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 mK{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 $L(){return new xg([new UL])}let xg=(()=>{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||$L()),deps:[[n,new dl,new ts]]}}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:$L}),n})();function WL(){return new Sg([new GL])}let Sg=(()=>{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||WL()),deps:[[n,new dl,new ts]]}}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:WL}),n})();function vE(n,e,t,i,r=!1){for(;null!==t;){const s=e[t.index];if(null!==s&&i.push(Sr(s)),ea(s))for(let a=10;a-1&&(sy(e,i),Hl(t,i))}this._attachedToViewContainer=!1}oy(this._lView[1],this._lView)}onDestroy(e){Bw(this._lView[1],this._lView,null,e)}markForCheck(){Cy(this._cdRefInjectingView||this._lView)}detach(){this._lView[2]&=-129}reattach(){this._lView[2]|=128}detectChanges(){Ay(this._lView[1],this._lView,this.context)}checkNoChanges(){!function(n,e,t){yp(!0);try{Ay(n,e,t)}finally{yp(!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){Qd(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 yK extends Yy{constructor(e){super(e),this._view=e}detectChanges(){Yw(this._view)}checkNoChanges(){!function(n){yp(!0);try{Yw(n)}finally{yp(!1)}}(this._view)}get context(){return null}}const vK=function(n){return function(n,e,t){if(Ad(n)&&!t){const i=zs(n.index,e);return new Yy(i,i)}return 47&n.type?new Yy(e[16],e):null}(as(),Vt(),16==(16&n))};let Mr=(()=>{class n{}return n.__NG_ELEMENT_ID__=vK,n})();const xK=[new GL],CK=new xg([new UL]),TK=new Sg(xK),MK=function(){return wE(as(),Vt())};let Go=(()=>{class n{}return n.__NG_ELEMENT_ID__=MK,n})();const DK=Go,IK=class extends DK{constructor(e,t,i){super(),this._declarationLView=e,this._declarationTContainer=t,this.elementRef=i}createEmbeddedView(e){const t=this._declarationTContainer.tViews,i=hf(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)),ff(t,i,e),new Yy(i)}};function wE(n,e){return 4&n.type?new IK(e,n,Eg(n,e)):null}class Yc{}const PK=function(){return KL(as(),Vt())};let Rs=(()=>{class n{}return n.__NG_ELEMENT_ID__=PK,n})();const kK=Rs,YL=class extends kK{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 na(this._hostTNode,this._hostLView)}get parentInjector(){const e=Xh(this._hostTNode,this._hostLView);if(yv(e)){const t=al(e,this._hostLView),i=Pd(e);return new na(t[1].data[i+8],t)}return new na(null,this._hostLView)}clear(){for(;this.length>0;)this.remove(this.length-1)}get(e){const t=XL(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(Yc,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 ea(n[3])}(i)){const u=this.indexOf(e);if(-1!==u)this.detach(u);else{const h=i[3],f=new YL(h,h[6],h[3]);f.detach(f.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),itw});class b3 extends FL{constructor(e,t){super(),this.componentDef=e,this.ngModule=t,this.componentType=e.type,this.selector=function(n){return n.map(dA).join(",")}(e.selectors),this.ngContentSelectors=e.ngContentSelectors?e.ngContentSelectors:[],this.isBoundToModule=!!t}get inputs(){return y3(this.componentDef.inputs)}get outputs(){return y3(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,Mg,r);return s!==Mg||i===Mg?s:e.get(t,i,r)}}}(e,r.injector):e,o=s.get(yf,Su),a=s.get(AM,null),l=o.createRenderer(null,this.componentDef),c=this.componentDef.selectors[0][0]||"div",u=i?function(n,e,t){if(dr(n))return n.selectRootElement(e,t===Xt.ShadowDom);let i="string"==typeof e?n.querySelector(e):e;return i.textContent="",i}(l,i,this.componentDef.encapsulation):ry(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)),h=this.componentDef.onPush?576:528,f=function(n,e){return{components:[],scheduler:n||tw,clean:WA,playerHandler:e||null,flags:0}}(),g=tg(0,null,null,1,0,null,null,null,null,null),m=hf(null,g,f,h,null,null,o,l,a,s);let w,x;$h(m);try{const U=function(n,e,t,i,r,s){const o=t[1];t[20]=n;const l=Jd(o,20,2,"#host",null),c=l.mergedAttrs=e.hostAttrs;null!==c&&(rg(l,c,!0),null!==n&&(Sp(r,n,c),null!==l.classes&&uy(r,n,l.classes),null!==l.styles&&vw(r,n,l.styles)));const u=i.createRenderer(n,e),h=hf(t,eg(e),null,e.onPush?64:16,t[20],l,i,u,s||null,null);return o.firstCreatePass&&(Rc(Hs(l,t),o,e.type),Ww(o,l),wy(l,t.length,1)),ng(t,h),t[20]=h}(u,this.componentDef,m,o,l);if(u)if(i)Sp(l,u,["ng-version",jL.full]);else{const{attrs:D,classes:ie}=function(n){const e=[],t=[];let i=1,r=2;for(;i0&&uy(l,u,ie.join(" "))}if(x=h_(g,20),void 0!==t){const D=x.projection=[];for(let ie=0;iel(o,e)),e.contentQueries){const l=as();e.contentQueries(1,o,l.directiveStart)}const a=as();return!s.firstCreatePass||null===e.hostBindings&&null===e.hostAttrs||(_o(a.index),Gw(t[1],a,0,a.directiveStart,a.directiveEnd,e),$w(e,o)),o}(U,this.componentDef,m,f,[Fq]),ff(g,m,null)}finally{fi()}return new NQ(this.componentType,w,Eg(x,m),m,x)}}class NQ 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 yK(r),this.componentType=e}get injector(){return new na(this._tNode,this._rootLView)}destroy(){this.hostView.destroy()}onDestroy(e){this.hostView.onDestroy(e)}}const Dg=new Map;class LQ extends Yc{constructor(e,t){super(),this._parent=t,this._bootstrapComponents=[],this.injector=this,this.destroyCbs=[],this.componentFactoryResolver=new _3(this);const i=No(e),r=function(n){return n[T1]||null}(e);r&&bM(r),this._bootstrapComponents=fl(i.bootstrap),this._r3Injector=Zw(e,t,[{provide:Yc,useValue:this},{provide:El,useValue:this.componentFactoryResolver}],rt(e)),this._r3Injector._resolveInjectorDefTypes(),this.instance=this.get(e)}get(e,t=Hn.THROW_IF_NOT_FOUND,i=xn.Default){return e===Hn||e===Yc||e===Vu?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 UM extends class{}{constructor(e){super(),this.moduleType=e,null!==No(e)&&function(n){const e=new Set;!function t(i){const r=No(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,Dg.get(s),i),Dg.set(s,i));const o=fl(r.imports);for(const a of o)e.has(a)||(e.add(a),t(a))}(n)}(e)}create(e){return new LQ(this.moduleType,e)}}function TE(n,e,t){const i=Cs()+n,r=Vt();return r[i]===Dn?$c(r,i,t?e.call(t):e()):function(n,e){return n[e]}(r,i)}function E3(n,e,t,i,r,s){const o=e+t;return Eo(n,o,r)?$c(n,o+1,s?i.call(s,r):i(r)):function(n,e){const t=n[e];return t===Dn?void 0:t}(n,o+1)}function Ps(n,e){const t=Si();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 Je("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=Ic(i.type)),o=Ta(Ce);try{const a=Cp(!1),l=s();return Cp(a),function(n,e,t,i){t>=n.data.length&&(n.data[t]=null,n.blueprint[t]=null),e[t]=i}(t,Vt(),r,l),l}finally{Ta(o)}}function To(n,e,t){const i=n+20,r=Vt(),s=Dd(r,i);return function(n,e){Ql.isWrapped(e)&&(e=Ql.unwrap(e),n[Ln.lFrame.bindingIndex]=Dn);return e}(r,function(n,e){return n[1].data[e].pure}(r,i)?E3(r,Cs(),e,s.transform,t,s):s.transform(t))}function HM(n){return e=>{setTimeout(n,void 0,e)}}const ln=class extends oe{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 h=e;a=null===(r=h.next)||void 0===r?void 0:r.bind(h),l=null===(s=h.error)||void 0===s?void 0:s.bind(h),c=null===(o=h.complete)||void 0===o?void 0:o.bind(h)}this.__isAsync&&(l=HM(l),a&&(a=HM(a)),c&&(c=HM(c)));const u=super.subscribe({next:a,error:l,complete:c});return e instanceof C&&e.add(u),u}};function QQ(){return this._results[sg()]()}class wf{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=sg(),i=wf.prototype;i[t]||(i[t]=QQ)}get changes(){return this._changes||(this._changes=new ln)}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=ia(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],u=e[-l];for(let h=10;h{class n{constructor(t){this.appInits=t,this.resolve=bE,this.reject=bE,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(Ef,8))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const a0=new Ht("AppId"),PZ={provide:a0,useFactory:function(){return`${eD()}${eD()}${eD()}`},deps:[]};function eD(){return String.fromCharCode(97+Math.floor(25*Math.random()))}const X3=new Ht("Platform Initializer"),Xc=new Ht("Platform ID"),IE=new Ht("appBootstrapListener");let OE=(()=>{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 Gu=new Ht("LocaleId"),K3=new Ht("DefaultCurrencyCode");class kZ{constructor(e,t){this.ngModuleFactory=e,this.componentFactories=t}}const tD=function(n){return new UM(n)},FZ=tD,LZ=function(n){return Promise.resolve(tD(n))},Q3=function(n){const e=tD(n),i=fl(No(n).declarations).reduce((r,s)=>{const o=Ui(s);return o&&r.push(new b3(o)),r},[]);return new kZ(e,i)},BZ=Q3,VZ=function(n){return Promise.resolve(Q3(n))};let xf=(()=>{class n{constructor(){this.compileModuleSync=FZ,this.compileModuleAsync=LZ,this.compileModuleAndAllComponentsSync=BZ,this.compileModuleAndAllComponentsAsync=VZ}clearCache(){}clearCacheFor(t){}getModuleId(t){}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const Z3=new Ht("compilerOptions"),UZ=(()=>Promise.resolve(0))();function nD(n){"undefined"==typeof Zone?UZ.then(()=>{n&&n.apply(null,null)}):Zone.current.scheduleMicroTask("scheduleMicrotask",n)}class pn{constructor({enableLongStackTrace:e=!1,shouldCoalesceEventChangeDetection:t=!1,shouldCoalesceRunChangeDetection:i=!1}){if(this.hasPendingMacrotasks=!1,this.hasPendingMicrotasks=!1,this.isStable=!0,this.onUnstable=new ln(!1),this.onMicrotaskEmpty=new ln(!1),this.onStable=new ln(!1),this.onError=new ln(!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=Zn.requestAnimationFrame,e=Zn.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(Zn,()=>{n.fakeTopEventTask||(n.fakeTopEventTask=Zone.root.scheduleEventTask("fakeTopEventTask",()=>{n.lastRequestAnimationFrameId=-1,rD(n),n.isCheckStableRunning=!0,iD(n),n.isCheckStableRunning=!1},void 0,()=>{},()=>{})),n.fakeTopEventTask.invoke()}),rD(n))}(n)};n._inner=n._inner.fork({name:"angular",properties:{isAngularZone:!0},onInvokeTask:(t,i,r,s,o,a)=>{try{return J3(n),t.invokeTask(r,s,o,a)}finally{(n.shouldCoalesceEventChangeDetection&&"eventTask"===s.type||n.shouldCoalesceRunChangeDetection)&&e(),eB(n)}},onInvoke:(t,i,r,s,o,a,l)=>{try{return J3(n),t.invoke(r,s,o,a,l)}finally{n.shouldCoalesceRunChangeDetection&&e(),eB(n)}},onHasTask:(t,i,r,s)=>{t.hasTask(r,s),i===r&&("microTask"==s.change?(n._hasPendingMicrotasks=s.microTask,rD(n),iD(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(!pn.isInAngularZone())throw new Error("Expected to be in Angular Zone, but it is not!")}static assertNotInAngularZone(){if(pn.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,HZ,bE,bE);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 HZ={};function iD(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 rD(n){n.hasPendingMicrotasks=!!(n._hasPendingMicrotasks||(n.shouldCoalesceEventChangeDetection||n.shouldCoalesceRunChangeDetection)&&-1!==n.lastRequestAnimationFrameId)}function J3(n){n._nesting++,n.isStable&&(n.isStable=!1,n.onUnstable.emit(null))}function eB(n){n._nesting--,iD(n)}class WZ{constructor(){this.hasPendingMicrotasks=!1,this.hasPendingMacrotasks=!1,this.isStable=!0,this.onUnstable=new ln,this.onMicrotaskEmpty=new ln,this.onStable=new ln,this.onError=new ln}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 sD=(()=>{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:()=>{pn.assertNotInAngularZone(),nD(()=>{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())nD(()=>{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(pn))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),tB=(()=>{class n{constructor(){this._applications=new Map,oD.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 oD.findTestabilityInTree(this,t,i)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();class qZ{addToWindow(e){}findTestabilityInTree(e,t,i){return null}}let oD=new qZ,nB=!0,iB=!1;function fa(){return iB=!0,nB}let ic;const rB=new Ht("AllowMultipleToken");function sB(n,e,t=[]){const i=`Platform: ${e}`,r=new Ht(i);return(s=[])=>{let o=lD();if(!o||o.injector.get(rB,!1))if(n)n(t.concat(s).concat({provide:r,useValue:!0}));else{const a=t.concat(s).concat({provide:r,useValue:!0},{provide:ju,useValue:"platform"});!function(n){if(ic&&!ic.destroyed&&!ic.injector.get(rB,!1))throw new Error("There can be only one platform. Destroy the previous one to create a new one.");ic=n.get(oB);const e=n.get(X3,null);e&&e.forEach(t=>t())}(Hn.create({providers:a,name:i}))}return function(n){const e=lD();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 lD(){return ic&&!ic.destroyed?ic:null}let oB=(()=>{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 WZ:("zone.js"===n?void 0:n)||new pn({enableLongStackTrace:fa(),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:pn,useValue:a}];return a.run(()=>{const c=Hn.create({providers:l,parent:this.injector,name:t.moduleType.name}),u=t.create(c),h=u.injector.get(la,null);if(!h)throw new Error("No ErrorHandler. Is platform module (BrowserModule) included?");return a.runOutsideAngular(()=>{const f=a.onError.subscribe({next:g=>{h.handleError(g)}});u.onDestroy(()=>{cD(this._modules,u),f.unsubscribe()})}),function(n,e,t){try{const i=t();return yg(i)?i.catch(r=>{throw e.runOutsideAngular(()=>n.handleError(r)),r}):i}catch(i){throw e.runOutsideAngular(()=>n.handleError(i)),i}}(h,a,()=>{const f=u.injector.get(Og);return f.runInitializers(),f.donePromise.then(()=>(bM(u.injector.get(Gu,pE)||pE),this._moduleDoBootstrap(u),u))})})}bootstrapModule(t,i=[]){const r=aB({},i);return function(n,e,t){const i=new UM(t);return Promise.resolve(i)}(0,0,t).then(s=>this.bootstrapModuleFactory(s,r))}_moduleDoBootstrap(t){const i=t.injector.get(sh);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 aB(n,e){return Array.isArray(e)?e.reduce(aB,n):Object.assign(Object.assign({},n),e)}let sh=(()=>{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 O(c=>{this._stable=this._zone.isStable&&!this._zone.hasPendingMacrotasks&&!this._zone.hasPendingMicrotasks,this._zone.runOutsideAngular(()=>{c.next(this._stable),c.complete()})}),l=new O(c=>{let u;this._zone.runOutsideAngular(()=>{u=this._zone.onStable.subscribe(()=>{pn.assertNotInAngularZone(),nD(()=>{!this._stable&&!this._zone.hasPendingMacrotasks&&!this._zone.hasPendingMicrotasks&&(this._stable=!0,c.next(!0))})})});const h=this._zone.onUnstable.subscribe(()=>{pn.assertInAngularZone(),this._stable&&(this._stable=!1,this._zone.runOutsideAngular(()=>{c.next(!1)}))});return()=>{u.unsubscribe(),h.unsubscribe()}});this.isStable=Nn(a,l.pipe(ws()))}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 FL?t:this._componentFactoryResolver.resolveComponentFactory(t),this.componentTypes.push(r.componentType);const s=function(n){return n.isBoundToModule}(r)?void 0:this._injector.get(Yc),a=r.create(Hn.NULL,[],i||r.selector,s),l=a.location.nativeElement,c=a.injector.get(sD,null),u=c&&a.injector.get(tB);return c&&u&&u.registerApplication(l,c),a.onDestroy(()=>{this.detachView(a.hostView),cD(this.components,a),u&&u.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;cD(this._views,i),i.detachFromAppRef()}_loadComponent(t){this.attachView(t.hostView),this.tick(),this.components.push(t),this._injector.get(IE,[]).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(pn),Ie(Hn),Ie(la),Ie(El),Ie(Og))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();function cD(n,e){const t=n.indexOf(e);t>-1&&n.splice(t,1)}const vJ=sB(null,"core",[{provide:Xc,useValue:"unknown"},{provide:oB,deps:[Hn]},{provide:tB,deps:[]},{provide:OE,deps:[]}]),CJ=[{provide:sh,useClass:sh,deps:[pn,Hn,la,El,Og]},{provide:OQ,deps:[pn],useFactory:function(n){let e=[];return n.onStable.subscribe(()=>{for(;e.length;)e.pop()()}),function(t){e.push(t)}}},{provide:Og,useClass:Og,deps:[[new ts,Ef]]},{provide:xf,useClass:xf,deps:[]},PZ,{provide:xg,useFactory:function(){return CK},deps:[]},{provide:Sg,useFactory:function(){return TK},deps:[]},{provide:Gu,useFactory:function(n){return bM(n=n||"undefined"!=typeof $localize&&$localize.locale||pE),n},deps:[[new Hd(Gu),new ts,new dl]]},{provide:K3,useValue:"USD"}];let AJ=(()=>{class n{constructor(t){}}return n.\u0275fac=function(t){return new(t||n)(Ie(sh))},n.\u0275mod=tn({type:n}),n.\u0275inj=St({providers:CJ}),n})(),zE=null;function Kc(){return zE}const fn=new Ht("DocumentToken");let Tf=(()=>{class n{historyGo(t){throw new Error("Not implemented")}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({factory:Tee,token:n,providedIn:"platform"}),n})();function Tee(){return Ie(kB)}let kB=(()=>{class n extends Tf{constructor(t){super(),this._doc=t,this._init()}_init(){this.location=window.location,this._history=window.history}getBaseHrefFromDOM(){return Kc().getBaseHref(this._doc)}onPopState(t){const i=Kc().getGlobalEventTarget(this._doc,"window");return i.addEventListener("popstate",t,!1),()=>i.removeEventListener("popstate",t)}onHashChange(t){const i=Kc().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){FB()?this._history.pushState(t,i,r):this.location.hash=r}replaceState(t,i,r){FB()?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(fn))},n.\u0275prov=We({factory:Mee,token:n,providedIn:"platform"}),n})();function FB(){return!!window.history.pushState}function Mee(){return new kB(Ie(fn))}function SD(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}function LB(n){const e=n.match(/#|\?|$/),t=e&&e.index||n.length;return n.slice(0,t-("/"===n[t-1]?1:0))+n.slice(t)}function Wu(n){return n&&"?"!==n[0]?"?"+n:n}let Ng=(()=>{class n{historyGo(t){throw new Error("Not implemented")}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({factory:Dee,token:n,providedIn:"root"}),n})();function Dee(n){const e=Ie(fn).location;return new BB(Ie(Tf),e&&e.origin||"")}const CD=new Ht("appBaseHref");let BB=(()=>{class n extends Ng{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 SD(this._baseHref,t)}path(t=!1){const i=this._platformLocation.pathname+Wu(this._platformLocation.search),r=this._platformLocation.hash;return r&&t?`${i}${r}`:i}pushState(t,i,r,s){const o=this.prepareExternalUrl(r+Wu(s));this._platformLocation.pushState(t,i,o)}replaceState(t,i,r,s){const o=this.prepareExternalUrl(r+Wu(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(Tf),Ie(CD,8))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),kg=(()=>{class n{constructor(t,i){this._subject=new ln,this._urlChangeListeners=[],this._platformStrategy=t;const r=this._platformStrategy.getBaseHref();this._platformLocation=i,this._baseHref=LB(VB(r)),this._platformStrategy.onPopState(s=>{this._subject.emit({url:this.path(!0),pop:!0,state:s.state,type:s.type})})}path(t=!1){return this.normalize(this._platformStrategy.path(t))}getState(){return this._platformLocation.getState()}isCurrentPathEqualTo(t,i=""){return this.path()==this.normalize(t+Wu(i))}normalize(t){return n.stripTrailingSlash(function(n,e){return n&&e.startsWith(n)?e.substring(n.length):e}(this._baseHref,VB(t)))}prepareExternalUrl(t){return t&&"/"!==t[0]&&(t="/"+t),this._platformStrategy.prepareExternalUrl(t)}go(t,i="",r=null){this._platformStrategy.pushState(r,"",t,i),this._notifyUrlChangeListeners(this.prepareExternalUrl(t+Wu(i)),r)}replaceState(t,i="",r=null){this._platformStrategy.replaceState(r,"",t,i),this._notifyUrlChangeListeners(this.prepareExternalUrl(t+Wu(i)),r)}forward(){this._platformStrategy.forward()}back(){this._platformStrategy.back()}historyGo(t=0){var i,r;null===(r=(i=this._platformStrategy).historyGo)||void 0===r||r.call(i,t)}onUrlChange(t){this._urlChangeListeners.push(t),this._urlChangeSubscription||(this._urlChangeSubscription=this.subscribe(i=>{this._notifyUrlChangeListeners(i.url,i.state)}))}_notifyUrlChangeListeners(t="",i){this._urlChangeListeners.forEach(r=>r(t,i))}subscribe(t,i,r){return this._subject.subscribe({next:t,error:i,complete:r})}}return n.\u0275fac=function(t){return new(t||n)(Ie(Ng),Ie(Tf))},n.normalizeQueryParams=Wu,n.joinWithSlash=SD,n.stripTrailingSlash=LB,n.\u0275prov=We({factory:Oee,token:n,providedIn:"root"}),n})();function Oee(){return new kg(Ie(Ng),Ie(Tf))}function VB(n){return n.replace(/\/index.html$/,"")}var ms=(()=>((ms=ms||{})[ms.Zero=0]="Zero",ms[ms.One=1]="One",ms[ms.Two=2]="Two",ms[ms.Few=3]="Few",ms[ms.Many=4]="Many",ms[ms.Other=5]="Other",ms))();const Vee=function(n){return function(n){const e=function(n){return n.toLowerCase().replace(/_/g,"-")}(n);let t=uL(e);if(t)return t;const i=e.split("-")[0];if(t=uL(i),t)return t;if("en"===i)return iX;throw new Error(`Missing locale data for the locale "${n}".`)}(n)[un.PluralCase]};class ZE{}let pte=(()=>{class n extends ZE{constructor(t){super(),this.locale=t}getPluralCategory(t,i){switch(Vee(i||this.locale)(t)){case ms.Zero:return"zero";case ms.One:return"one";case ms.Two:return"two";case ms.Few:return"few";case ms.Many:return"many";default:return"other"}}}return n.\u0275fac=function(t){return new(t||n)(Ie(Gu))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();function YB(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}class mte{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 Yu=(()=>{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 mte(null,this._ngForOf,-1,-1),null===o?void 0:o),l=new XB(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 XB(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)(Ce(Rs),Ce(Go),Ce(xg))},n.\u0275dir=Nt({type:n,selectors:[["","ngFor","","ngForOf",""]],inputs:{ngForOf:"ngForOf",ngForTrackBy:"ngForTrackBy",ngForTemplate:"ngForTemplate"}}),n})();class XB{constructor(e,t){this.record=e,this.view=t}}let ac=(()=>{class n{constructor(t,i){this._viewContainer=t,this._context=new yte,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){KB("ngIfThen",t),this._thenTemplateRef=t,this._thenViewRef=null,this._updateView()}set ngIfElse(t){KB("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)(Ce(Rs),Ce(Go))},n.\u0275dir=Nt({type:n,selectors:[["","ngIf",""]],inputs:{ngIf:"ngIf",ngIfThen:"ngIfThen",ngIfElse:"ngIfElse"}}),n})();class yte{constructor(){this.$implicit=null,this.ngIf=null}}function KB(n,e){if(e&&!e.createEmbeddedView)throw new Error(`${n} must be a TemplateRef, but received '${rt(e)}'.`)}class Ete{createSubscription(e,t){return e.subscribe({next:t,error:i=>{throw i}})}dispose(e){e.unsubscribe()}onDestroy(e){e.unsubscribe()}}class xte{createSubscription(e,t){return e.then(t,i=>{throw i})}dispose(e){}onDestroy(e){}}const Ste=new xte,Cte=new Ete;let g0=(()=>{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(yg(t))return Ste;if(x2(t))return Cte;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)(Ce(Mr,16))},n.\u0275pipe=js({name:"async",type:n,pure:!1}),n})(),fr=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=tn({type:n}),n.\u0275inj=St({providers:[{provide:ZE,useClass:pte}]}),n})();const iV="browser";function Af(n){return n===iV}class oV{}class BD extends class extends class{}{constructor(){super(...arguments),this.supportsDOMEvents=!0}}{static makeCurrent(){!function(n){zE||(zE=n)}(new BD)}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=(m0=m0||document.querySelector("base"),m0?m0.getAttribute("href"):null);return null==t?null:function(n){ex=ex||document.createElement("a"),ex.setAttribute("href",n);const e=ex.pathname;return"/"===e.charAt(0)?e:`/${e}`}(t)}resetBaseElement(){m0=null}getUserAgent(){return window.navigator.userAgent}getCookie(e){return YB(document.cookie,e)}}let ex,m0=null;const aV=new Ht("TRANSITION_ID"),Xte=[{provide:Ef,useFactory:function(n,e,t){return()=>{t.get(Og).donePromise.then(()=>{const i=Kc(),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},Zn.getAllAngularTestabilities=()=>e.getAllTestabilities(),Zn.getAllAngularRootElements=()=>e.getAllRootElements(),Zn.frameworkStabilizers||(Zn.frameworkStabilizers=[]),Zn.frameworkStabilizers.push(i=>{const r=Zn.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?Kc().isShadowRoot(t)?this.findTestabilityInTree(e,t.host,!0):this.findTestabilityInTree(e,t.parentElement,!0):null}}let Kte=(()=>{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 _0=new Ht("EventManagerPlugins");let nx=(()=>{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})(),y0=(()=>{class n extends cV{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(uV),this._hostNodes.delete(t)}onStylesAdded(t){this._hostNodes.forEach((i,r)=>{this._addStylesToHost(t,r,i)})}ngOnDestroy(){this._hostNodes.forEach(t=>t.forEach(uV))}}return n.\u0275fac=function(t){return new(t||n)(Ie(fn))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();function uV(n){Kc().remove(n)}const UD={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/"},zD=/%COMP%/g;function ix(n,e,t){for(let i=0;i{if("__ngUnwrap__"===e)return n;!1===n(e)&&(e.preventDefault(),e.returnValue=!1)}}let rx=(()=>{class n{constructor(t,i,r){this.eventManager=t,this.sharedStylesHost=i,this.appId=r,this.rendererByCompId=new Map,this.defaultRenderer=new HD(t)}createRenderer(t,i){if(!t||!i)return this.defaultRenderer;switch(i.encapsulation){case Xt.Emulated:{let r=this.rendererByCompId.get(i.id);return r||(r=new dne(this.eventManager,this.sharedStylesHost,i,this.appId),this.rendererByCompId.set(i.id,r)),r.applyToHost(t),r}case 1:case Xt.ShadowDom:return new hne(this.eventManager,this.sharedStylesHost,t,i);default:if(!this.rendererByCompId.has(i.id)){const r=ix(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(nx),Ie(y0),Ie(a0))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();class HD{constructor(e){this.eventManager=e,this.data=Object.create(null)}destroy(){}createElement(e,t){return t?document.createElementNS(UD[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=UD[r];s?e.setAttributeNS(s,t,i):e.setAttribute(t,i)}else e.setAttribute(t,i)}removeAttribute(e,t,i){if(i){const r=UD[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&(Uo.DashCase|Uo.Important)?e.style.setProperty(t,i,r&Uo.Important?"important":""):e.style[t]=i}removeStyle(e,t,i){i&Uo.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,fV(i)):this.eventManager.addEventListener(e,t,fV(i))}}class dne extends HD{constructor(e,t,i,r){super(e),this.component=i;const s=ix(r+"-"+i.id,i.styles,[]);t.addStyles(s),this.contentAttr=function(n){return"_ngcontent-%COMP%".replace(zD,n)}(r+"-"+i.id),this.hostAttr=function(n){return"_nghost-%COMP%".replace(zD,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 hne extends HD{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=ix(r.id,r.styles,[]);for(let o=0;o{class n extends jD{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(fn))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const mV=["alt","control","meta","shift"],vne={"\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"},_V={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"},wne={alt:n=>n.altKey,control:n=>n.ctrlKey,meta:n=>n.metaKey,shift:n=>n.shiftKey};let Ene=(()=>{class n extends jD{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(()=>Kc().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(mV.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&&_V.hasOwnProperty(e)&&(e=_V[e]))}return vne[e]||e}(t);return r=r.toLowerCase()," "===r?r="space":"."===r&&(r="dot"),mV.forEach(s=>{s!=r&&wne[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(fn))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),Mf=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({factory:function(){return Ie($D)},token:n,providedIn:"root"}),n})(),$D=(()=>{class n extends Mf{constructor(t){super(),this._doc=t}sanitize(t,i){if(null==i)return null;switch(t){case si.NONE:return i;case si.HTML:return sa(i,"HTML")?Gs(i):$_(this._doc,String(i)).toString();case si.STYLE:return sa(i,"Style")?Gs(i):i;case si.SCRIPT:if(sa(i,"Script"))return Gs(i);throw new Error("unsafe value used in a script context");case si.URL:return jc(i),sa(i,"URL")?Gs(i):jo(String(i));case si.RESOURCE_URL:if(sa(i,"ResourceURL"))return Gs(i);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(n){return new L_(n)}(t)}bypassSecurityTrustStyle(t){return function(n){return new B_(n)}(t)}bypassSecurityTrustScript(t){return function(n){return new jp(n)}(t)}bypassSecurityTrustUrl(t){return function(n){return new Wd(n)}(t)}bypassSecurityTrustResourceUrl(t){return function(n){return new kn(n)}(t)}}return n.\u0275fac=function(t){return new(t||n)(Ie(fn))},n.\u0275prov=We({factory:function(){return function(n){return new $D(n.get(fn))}(Ie(Vu))},token:n,providedIn:"root"}),n})();const Ine=sB(vJ,"browser",[{provide:Xc,useValue:iV},{provide:X3,useValue:function(){BD.makeCurrent(),VD.init()},multi:!0},{provide:fn,useFactory:function(){return function(n){Yi=n}(document),document},deps:[]}]),One=[[],{provide:ju,useValue:"root"},{provide:la,useFactory:function(){return new la},deps:[]},{provide:_0,useClass:fne,multi:!0,deps:[fn,pn,Xc]},{provide:_0,useClass:Ene,multi:!0,deps:[fn]},[],{provide:rx,useClass:rx,deps:[nx,y0,a0]},{provide:yf,useExisting:rx},{provide:cV,useExisting:y0},{provide:y0,useClass:y0,deps:[fn]},{provide:sD,useClass:sD,deps:[pn]},{provide:nx,useClass:nx,deps:[_0,pn]},{provide:oV,useClass:Kte,deps:[]},[]];let WD=(()=>{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:a0,useValue:t.appId},{provide:aV,useExisting:a0},Xte]}}}return n.\u0275fac=function(t){return new(t||n)(Ie(n,12))},n.\u0275mod=tn({type:n}),n.\u0275inj=St({providers:One,imports:[fr,AJ]}),n})();"undefined"!=typeof window&&window;class Vne extends C{constructor(e,t){super()}schedule(e,t=0){return this}}class sx extends Vne{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 bV=(()=>{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 cc extends bV{constructor(e,t=bV.now){super(e,()=>cc.delegate&&cc.delegate!==this?cc.delegate.now():t()),this.actions=[],this.active=!1,this.scheduled=void 0}schedule(e,t=0,i){return cc.delegate&&cc.delegate!==this?cc.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 zne=new class extends cc{}(class extends sx{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)}}),Qc=new O(n=>n.complete());function b0(n){return n?function(n){return new O(e=>n.schedule(()=>e.complete()))}(n):Qc}function sn(...n){let e=n[n.length-1];return Te(e)?(n.pop(),ke(n,e)):In(n)}function Fg(n,e){return new O(e?t=>e.schedule(Gne,0,{error:n,subscriber:t}):t=>t.error(n))}function Gne({error:n,subscriber:e}){e.error(n)}class ga{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 sn(this.value);case"E":return Fg(this.error);case"C":return b0()}throw new Error("unexpected notification kind value")}static createNext(e){return void 0!==e?new ga("N",e):ga.undefinedValueNotification}static createError(e){return new ga("E",void 0,e)}static createComplete(){return ga.completeNotification}}ga.completeNotification=new ga("C"),ga.undefinedValueNotification=new ga("N",void 0);class ox 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(ox.dispatch,this.delay,new Wne(e,this.destination)))}_next(e){this.scheduleMessage(ga.createNext(e))}_error(e){this.scheduleMessage(ga.createError(e)),this.unsubscribe()}_complete(){this.scheduleMessage(ga.createComplete()),this.unsubscribe()}}class Wne{constructor(e,t){this.notification=e,this.destination=t}}class Df extends oe{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 qne(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 $;if(this.isStopped||this.hasError?o=C.EMPTY:(this.observers.push(e),o=new Z(this,e)),r&&e.add(e=new ox(e,r)),t)for(let a=0;at&&(o=Math.max(o,s-t)),o>0&&r.splice(0,o),r}}class qne{constructor(e,t){this.time=e,this.value=t}}function is(n,e){return"function"==typeof e?t=>t.pipe(is((i,r)=>je(n(i,r)).pipe(me((s,o)=>e(i,s,r,o))))):t=>t.lift(new Yne(n))}class Yne{constructor(e){this.project=e}call(e,t){return t.subscribe(new Xne(e,this.project))}}class Xne extends we{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 _t(this),r=this.destination;r.add(i),this.innerSubscription=N(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 ax={schedule(n,e){const t=setTimeout(n,e);return()=>clearTimeout(t)},scheduleBeforeRender(n){if("undefined"==typeof window)return ax.schedule(n,0);if(void 0===window.requestAnimationFrame)return ax.schedule(n,16);const e=window.requestAnimationFrame(n);return()=>window.cancelAnimationFrame(e)}};let YD;function sie(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(!YD){const t=Element.prototype;YD=t.matches||t.matchesSelector||t.mozMatchesSelector||t.msMatchesSelector||t.oMatchesSelector||t.webkitMatchesSelector}return n.nodeType===Node.ELEMENT_NODE&&YD.call(n,e)}(n,r)||(i=s,0))),i}class aie{constructor(e,t){this.componentFactory=t.get(El).resolveComponentFactory(e)}create(e){return new lie(this.componentFactory,e)}}class lie{constructor(e,t){this.componentFactory=e,this.injector=t,this.eventEmitters=new Df(1),this.events=this.eventEmitters.pipe(is(i=>Nn(...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(pn),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=ax.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=ax.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 c_(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 cie extends HTMLElement{constructor(){super(...arguments),this.ngElementEventsSubscription=null}}const die={initialConfig:{},parse:{},rename:{}};class hie{constructor(e,t){this.configState=e,this.storedChanges={},this.options=Object.assign(Object.assign({},die),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,u=null!==(s=o[e])&&void 0!==s?s:o[l];if(null==c)delete i[l];else if(u)try{i[l]=u(c)}catch(h){console.warn(`Failed to parse ${e} = ${c}`,h.message)}else i[l]=c}}let fie=(()=>{class n{constructor(t,i,r={}){this.configState=t,this.cdr=i,this.options=r,this.initialized=!1,this.configManager=new hie(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=Nt({type:n,features:[Fi]}),n})();const XD={boolean:n=>"false"!=`${n}`,json:n=>"string"==typeof n?JSON.parse(n):n,function:n=>{if("function"!=typeof n)throw new Error("Expected a javascript function");return n}};var KD;const If={production:!0,disableDbWorker:!0,acceptableViewerDomains:["https://portal.hubmapconsortium.org","https://portal.test.hubmapconsortium.org"],dbOptions:{ccfOwlUrl:"https://r5i95k35v5.us-east-2.awsapprunner.com/v1/ccf.owl.n3store.json",ccfContextUrl:"https://hubmapconsortium.github.io/ccf-ontology/ccf-context.jsonld",dataSources:["https://cdn.jsdelivr.net/gh/hubmapconsortium/ccf-ui@staging/assets/kpmp/data/rui_locations.jsonld","https://cdn.jsdelivr.net/gh/hubmapconsortium/ccf-ui@staging/assets/sparc/data/rui_locations.jsonld"],hubmapDataService:"",hubmapPortalUrl:"",hubmapDataUrl:"",hubmapAssetsUrl:"",hubmapToken:null!==(KD=localStorage.getItem("HUBMAP_TOKEN"))&&void 0!==KD?KD:"",useRemoteApi:!1,remoteApiEndpoint:"https://r5i95k35v5.us-east-2.awsapprunner.com/v1"},googleAnalyticsToken:"G-ERNVZ1Q4KE"};function Ei(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 wV(n,e){return function(t,i){e(t,i,n)}}function uc(n,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(n,e)}function Bi(n,e,t,i){return new(t||(t=Promise))(function(s,o){function a(u){try{c(i.next(u))}catch(h){o(h)}}function l(u){try{c(i.throw(u))}catch(h){o(h)}}function c(u){u.done?s(u.value):function(s){return s instanceof t?s:new t(function(o){o(s)})}(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})}function SV(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 ZD(){return!("object"==typeof process&&"[object process]"===String(process)&&!process.browser)||SV()}const CV="undefined"!=typeof __VERSION__?__VERSION__:"untranspiled source",cx=ZD();class _ie{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 JD(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 TV={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 AV(n){return"string"==typeof n?TV[n.toUpperCase()]||TV.WHITE:n}function ux(n,e){if(!n)throw new Error(e||"Assertion failed")}const dc={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},v0=dc.window||dc.self||dc.global,MV=dc.process||{};function Lg(){let n;if(cx&&v0.performance)n=v0.performance.now();else if(MV.hrtime){const e=MV.hrtime();n=1e3*e[0]+e[1]/1e6}else n=Date.now();return n}console;const Bg={debug:cx&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},Sie={enabled:!0,level:0};function Al(){}const DV={},IV={once:!0};function Cie(n){for(const e in n)for(const t in n[e])return t||"untitled";return"empty"}let eI=(()=>{class n{constructor({id:t}={id:""}){this.id=t,this.VERSION=CV,this._startTs=Lg(),this._deltaTs=Lg(),this.LOG_THROTTLE_TIMEOUT=0,this._storage=new _ie("__probe-".concat(this.id,"__"),Sie),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((Lg()-this._startTs).toPrecision(10))}getDelta(){return Number((Lg()-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){ux(t,i)}warn(t){return this._getLogFunction(0,t,Bg.warn,arguments,IV)}error(t){return this._getLogFunction(0,t,Bg.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,Bg.log,arguments,{time:!0,once:!0})}log(t,i){return this._getLogFunction(t,i,Bg.debug,arguments)}info(t,i){return this._getLogFunction(t,i,console.info,arguments)}once(t,i){return this._getLogFunction(t,i,Bg.debug||Bg.info,arguments,IV)}table(t,i,r){return i?this._getLogFunction(t,i,console.table||Al,r&&[r],{tag:Cie(i)}):Al}image({logLevel:t,priority:i,image:r,message:s="",scale:o=1}){return this._shouldLog(t||i)?cx?function({image:n,message:e="",scale:t=1}){if("string"==typeof n){const r=new Image;return r.onload=()=>{const s=JD(r,e,t);console.log(...s)},r.src=n,Al}const i=n.nodeName||"";if("img"===i.toLowerCase())return console.log(...JD(n,e,t)),Al;if("canvas"===i.toLowerCase()){const r=new Image;return r.onload=()=>console.log(...JD(r,e,t)),r.src=n.toDataURL(),Al}return Al}({image:r,message:s,scale:o}):function({image:n,message:e="",scale:t=1}){let i=null;try{i=et(5307)}catch(r){}return i?()=>i(n,{fit:"box",width:"".concat(Math.round(80*t),"%")}).then(r=>console.log(r)):Al}({image:r,message:s,scale:o}):Al}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||Al)}group(t,i,r={collapsed:!1}){r=RV({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||Al)}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()>=OV(t)}_getLogFunction(t,i,r,s=[],o){if(this._shouldLog(t)){o=RV({logLevel:t,message:i,args:s,opts:o}),ux(r=r||o.method),o.total=this.getTotal(),o.delta=this.getDelta(),this._deltaTs=Lg();const a=o.tag||o.message;if(o.once){if(DV[a])return Al;DV[a]=Lg()}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!cx&&"string"==typeof n&&(e&&(e=AV(e),n="\x1b[".concat(e,"m").concat(n,"\x1b[39m")),t&&(e=AV(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 Al}}return n.VERSION=CV,n})();function OV(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 ux(Number.isFinite(e)&&e>=0),e}function RV(n){const{logLevel:e,message:t}=n;n.logLevel=OV(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 ux("string"===r||"object"===r),Object.assign(n,n.opts)}const Ri=new eI({id:"deck"}),Vi={DEFAULT:-1,LNGLAT:1,METER_OFFSETS:2,LNGLAT_OFFSETS:3,CARTESIAN:0};Object.defineProperty(Vi,"IDENTITY",{get:()=>Ri.deprecated("COORDINATE_SYSTEM.IDENTITY","COORDINATE_SYSTEM.CARTESIAN")()||0});const Zc={WEB_MERCATOR:1,GLOBE:2,WEB_MERCATOR_AUTO_OFFSET:4,IDENTITY:0},PV={click:{handler:"onClick"},panstart:{handler:"onDragStart"},panmove:{handler:"onDrag"},panend:{handler:"onDragEnd"}},mn=new eI({id:"luma.gl"});function qo(n,e){if(!n)throw new Error(e||"luma.gl: assertion failed.")}function dx(n){return"undefined"!=typeof WebGLRenderingContext&&n instanceof WebGLRenderingContext||"undefined"!=typeof WebGL2RenderingContext&&n instanceof WebGL2RenderingContext||Boolean(n&&Number.isFinite(n._version))}function Ci(n){return"undefined"!=typeof WebGL2RenderingContext&&n instanceof WebGL2RenderingContext||Boolean(n&&2===n._version)}function hx(n){return qo(dx(n),"Invalid WebGLRenderingContext"),n}function Ao(n){return qo(Ci(n),"Requires WebGL2"),n}const w0={};const E0=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{globalThis.console&&globalThis.console.log&&globalThis.console.log("OESVertexArrayObject emulation library context restored"),t.reset_()},!0),this.reset_()};Of.prototype.VERTEX_ARRAY_BINDING_OES=34229,Of.prototype.reset_=function(){if(void 0!==this.vertexArrayObjects)for(let i=0;iCi(n)?void 0:0,Wie={3074:n=>Ci(n)?void 0:36064,35723:n=>Ci(n)?void 0:4352,35977:br,32937:br,36795:(n,e)=>{const t=Ci(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(FV);return e(t&&t.UNMASKED_VENDOR_WEBGL||7936)},37446:(n,e)=>{const t=n.getExtension(FV);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:br,35071:br,37447:br,36063:(n,e)=>{if(!Ci(n)){const t=n.getExtension(kV);return t?e(t.MAX_COLOR_ATTACHMENTS_WEBGL):0}},35379:br,35374:br,35377:br,34852:n=>{if(!Ci(n)){const e=n.getExtension(kV);return e?e.MAX_DRAW_BUFFERS_WEBGL:0}},36203:n=>n.getExtension(NV)?2147483647:65535,33001:n=>n.getExtension(NV)?16777216:65535,33e3:n=>16777216,37157:br,35373:br,35657:br,36183:br,37137:br,34045:br,35978:br,35979:br,35968:br,35376:br,35375:br,35659:br,37154:br,35371:br,35658:br,35076:br,35077:br,35380:br},LV="ANGLE_instanced_arrays",BV={OES_vertex_array_object:{meta:{suffix:"OES"},createVertexArray:()=>{qo(!1,"VertexArray requires WebGL2 or OES_vertex_array_object extension")},deleteVertexArray:()=>{},bindVertexArray:()=>{},isVertexArray:()=>!1},[LV]:{meta:{suffix:"ANGLE"},vertexAttribDivisor(n,e){qo(0===e,"WebGL instanced rendering not supported")},drawElementsInstanced:()=>{},drawArraysInstanced:()=>{}},WEBGL_draw_buffers:{meta:{suffix:"WEBGL"},drawBuffers:()=>{qo(!1)}},EXT_disjoint_timer_query:{meta:{suffix:"EXT"},createQuery:()=>{qo(!1)},deleteQuery:()=>{qo(!1)},beginQuery:()=>{qo(!1)},endQuery:()=>{},getQuery(n,e){return this.getQueryObject(n,e)},getQueryParameter(n,e){return this.getQueryObject(n,e)},getQueryObject:()=>{}}},tI={readBuffer:(n,e,t)=>{Ci(n)&&e(t)},getVertexAttrib:(n,e,t,i)=>{const{webgl2:r,ext:s}=function(n,e){return{webgl2:Ci(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(!Ci(n))switch(i){case 35967:return 35981;case 35971:case 35382:return 0}return e(t,i)},getInternalformatParameter:(n,e,t,i,r)=>{if(!Ci(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=Wie[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 rre(n,{extension:e,target:t,target2:i}){const r=BV[e];qo(r);const{meta:s={}}=r,{suffix:o=""}=s,a=n.getExtension(e);for(const l of Object.keys(r)){const c=`${l}${o}`;let u=null;"meta"===l||"function"==typeof n[l]||(a&&"function"==typeof a[c]?u=(...h)=>a[c](...h):"function"==typeof r[l]&&(u=r[l].bind(t))),u&&(t[l]=u,i[l]=u)}}globalThis.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 Of(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&&rre(n,{extension:t,target:n.luma,target2:n})}(n,BV),function(n,{target:e,target2:t}){Object.keys(tI).forEach(i=>{if("function"==typeof tI[i]){const r=n[i]?n[i].bind(n):()=>{},s=tI[i].bind(null,n,r);e[i]=s,t[i]=s}})}(n,{target:e,target2:n}),e.polyfilled=!0),n};const nI={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},lh=(n,e,t)=>e?n.enable(t):n.disable(t),VV=(n,e,t)=>n.hint(t,e),ja=(n,e,t)=>n.pixelStorei(t,e);function x0(n){return Array.isArray(n)||ArrayBuffer.isView(n)}const are={3042:lh,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:lh,2885:(n,e)=>n.cullFace(e),2929:lh,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:lh,35723:VV,36006:(n,e)=>{const t=Ci(n)?36009:36160;return n.bindFramebuffer(t,e)},2886:(n,e)=>n.frontFace(e),33170:VV,2849:(n,e)=>n.lineWidth(e),32823:lh,32824:"polygonOffset",10752:"polygonOffset",35977:lh,32938:"sampleCoverage",32939:"sampleCoverage",3089:lh,3088:(n,e)=>n.scissor(...e),2960:lh,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:ja,3317:ja,37440:ja,37441:ja,37443:ja,3330:ja,3332:ja,3331:ja,36010:(n,e)=>n.bindFramebuffer(36008,e),3314:ja,32878:ja,3316:ja,3315:ja,32877:ja,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=x0(e)?e:[e,e],n.blendEquationSeparate(...e)},blendFunc:(n,e)=>{e=x0(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=x0(e)?e:[e,e];const[t,i]=e;n.stencilMaskSeparate(1028,t),n.stencilMaskSeparate(1029,i)},stencilFunc:(n,e)=>{e=x0(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=x0(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 rs(n,e,t){return void 0!==e[n]?e[n]:t[n]}const lre={blendEquation:(n,e,t)=>n.blendEquationSeparate(rs(32777,e,t),rs(34877,e,t)),blendFunc:(n,e,t)=>n.blendFuncSeparate(rs(32969,e,t),rs(32968,e,t),rs(32971,e,t),rs(32970,e,t)),polygonOffset:(n,e,t)=>n.polygonOffset(rs(32824,e,t),rs(10752,e,t)),sampleCoverage:(n,e,t)=>n.sampleCoverage(rs(32938,e,t),rs(32939,e,t)),stencilFuncFront:(n,e,t)=>n.stencilFuncSeparate(1028,rs(2962,e,t),rs(2967,e,t),rs(2963,e,t)),stencilFuncBack:(n,e,t)=>n.stencilFuncSeparate(1029,rs(34816,e,t),rs(36003,e,t),rs(36004,e,t)),stencilOpFront:(n,e,t)=>n.stencilOpSeparate(1028,rs(2964,e,t),rs(2965,e,t),rs(2966,e,t)),stencilOpBack:(n,e,t)=>n.stencilOpSeparate(1029,rs(34817,e,t),rs(34818,e,t),rs(34819,e,t))},jV={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]})},Jc=(n,e)=>n.isEnabled(e),UV={3042:Jc,2884:Jc,2929:Jc,3024:Jc,32823:Jc,32926:Jc,32928:Jc,3089:Jc,2960:Jc,35977:Jc};function zV(n){for(const e in n)return!1;return!0}function cre(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||nI)){const r=e,s=UV[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=UV[r];i[r]=s?s(n,Number(r)):n.getParameter(Number(r))}return i}(e):Object.assign({},nI),this.log=i,this._updateCache=this._updateCache.bind(this),Object.seal(this)}push(e={}){this.stateStack.push({})}pop(){qo(this.stateStack.length>0),Xu(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){qo(void 0!==s);const o=e[s],a=this.cache[s];cre(o,a)||(t=!0,i=a,r&&!(s in r)&&(r[s]=a),this.cache[s]=o)}return{valueChanged:t,oldValue:i}}}function GV(n,e={}){const{enable:t=!0,copyState:i}=e;if(qo(void 0!==i),!n.state){const{polyfillContext:r}=globalThis;r&&r(n),n.state=new hre(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 s in jV)ure(n,s,jV[s]);HV(n,"getParameter"),HV(n,"isEnabled")}return n.state.enable=t,n}function $V(n){qo(n.state),n.state.pop()}function Xu(n,e){if(qo(dx(n),"setParameters requires a WebGL context"),zV(e))return;const t={};for(const r in e){const s=Number(r),o=are[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)lre[r](n,e,i)}function hc(n,e,t){if(zV(e))return t(n);const{nocatch:i=!0}=e;let r;if(function(n){n.state||GV(n,{copyState:!1}),n.state.push()}(n),Xu(n,e),i)r=t(n),$V(n);else try{r=t(n)}finally{$V(n)}return r}function fx(){return!("object"==typeof process&&"[object process]"===String(process)&&!process.browser)||function(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;return!!(e&&e.indexOf("Electron")>=0)}()}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 iI(n,e,t=!0){return function(n,e,t,i,r){const s=WV(n[0],e,t);let o=qV(n[1],e,i,r),a=WV(n[0]+1,e,t);const l=a===t-1?a:a-1;let c;return a=qV(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 WV(n,e,t){return Math.min(Math.round(n*e),t-1)}function qV(n,e,t,i){return i?Math.max(0,t-1-Math.round(n*e)):Math.min(Math.round(n*e),t-1)}const rI=fx(),bre=rI&&"undefined"!=typeof document,YV={webgl2:!0,webgl1:!0,throwOnError:!0,manageState:!0,canvas:null,debug:!1,width:800,height:600};function XV(n={}){qo(rI,"createGLContext only available in the browser.\nCreate your own headless context or use 'createHeadlessContext' from @luma.gl/test-utils"),n=Object.assign({},YV,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?(bre&&"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=sI(r,n),function(n){const e=Ci(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);mn.info(1,`${e}${n.debug?" debug":""} context ${t?`(${t.vendor},${t.renderer})`:""}`)()}(r),r):null}function sI(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({},YV,e);const{manageState:t,debug:i}=e;return t&&GV(n,{copyState:!1,log:(...r)=>mn.log(1,...r)()}),rI&&i&&(globalThis.makeDebugContext?(n=globalThis.makeDebugContext(n,e),mn.level=Math.max(mn.level,1)):mn.warn('WebGL debug mode not activated. import "@luma.gl/debug" to enable.')()),n._instrumented=!0,n}function KV(){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 QV{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=KV(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(KV()-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 oI{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 QV?e:new QV(t,i)),this.stats[t]}}const S0="8.5.12",Rf=new class{constructor(){this.stats=new Map}get(e){return this.stats.has(e)||this.stats.set(e,new oI({id:e})),this.stats.get(e)}};if(globalThis.luma&&globalThis.luma.VERSION!==S0)throw new Error(`luma.gl - multiple VERSIONs detected: ${globalThis.luma.VERSION} vs ${S0}`);function on(n,e){if(!n)throw new Error(e||"luma.gl: assertion failed.")}function aI(n,e){if("string"!=typeof e)return e;const t=Number(e);if(!isNaN(t))return t;const i=n[e=e.replace(/^.*\./,"")];return on(void 0!==i,`Accessing undefined constant GL.${e}`),i}function ch(n,e){e=Number(e);for(const t in n)if(n[t]===e)return`GL.${t}`;return String(e)}globalThis.luma||(fx()&&mn.log(1,`luma.gl ${S0} - set luma.log.level=1 (or higher) to trace rendering`)(),globalThis.luma=globalThis.luma||{VERSION:S0,version:S0,log:mn,stats:Rf,globals:{modules:{},nodeIO:{}}}),globalThis;const lI={};function ma(n="id"){return lI[n]=lI[n]||1,`${n}-${lI[n]++}`}function ZV(n){return on("number"==typeof n,"Input must be a number"),n&&0==(n&n-1)}function jg(n){let e=!0;for(const t in n){e=!1;break}return e}function JV(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 mn.removed(`Calling removed method ${e}.${o}: `,r)(),new Error(o)})})}const Ug="Resource subclass must define virtual methods";class Ku{get[Symbol.toStringTag](){return"Resource"}constructor(e,t={}){hx(e);const{id:i,userData:r={}}=t;this.gl=e,this.gl2=e,this.id=i||ma(this[Symbol.toStringTag]),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[Symbol.toStringTag]||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={}){on(e=aI(this.gl,e));const r=(this.constructor.PARAMETERS||{})[e];if(r){const s=Ci(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=Ci(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 h=i?ch(this.gl,l):l;o[h]=this.getParameter(l,e),i&&"GLenum"===c.type&&(o[h]=ch(this.gl,o[h]))}}return o}setParameter(e,t){on(e=aI(this.gl,e));const r=(this.constructor.PARAMETERS||{})[e];if(r){const s=Ci(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=aI(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 JV(this,e,t,i)}initialize(e){}_createHandle(){throw new Error(Ug)}_deleteHandle(){throw new Error(Ug)}_bindHandle(e){throw new Error(Ug)}_getOptsFromHandle(){throw new Error(Ug)}_getParameter(e,t){throw new Error(Ug)}_setParameter(e,t){throw new Error(Ug)}_context(){return this.gl.luma=this.gl.luma||{},this.gl.luma}_addStats(){const e=this[Symbol.toStringTag],t=Rf.get("Resource Counts");t.get("Resources Created").incrementCount(),t.get(`${e}s Created`).incrementCount(),t.get(`${e}s Active`).incrementCount()}_removeStats(){const e=this[Symbol.toStringTag];Rf.get("Resource Counts").get(`${e}s Active`).decrementCount()}_trackAllocatedMemory(e,t=this[Symbol.toStringTag]){const i=Rf.get("Memory Usage");i.get("GPU Memory").addCount(e),i.get(`${t} Memory`).addCount(e),this.byteLength=e}_trackDeallocatedMemory(e=this[Symbol.toStringTag]){const t=Rf.get("Memory Usage");t.get("GPU Memory").subtractCount(this.byteLength),t.get(`${e} Memory`).subtractCount(this.byteLength),this.byteLength=0}}function cI(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 C0(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 Ore({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 _a.getBytesPerElement(this)}get BYTES_PER_VERTEX(){return _a.getBytesPerVertex(this)}_assign(e={}){return void 0!==(e=uI("Accessor",e,Pre)).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"},Nre={removedProps:{},replacedProps:{bytes:"byteLength"},deprecatedProps:tj},kre={removedProps:tj};class lr extends Ku{get[Symbol.toStringTag](){return"Buffer"}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/_a.getBytesPerElement(e))}getVertexCount(e=this.accessor){return Math.round(this.byteLength/_a.getBytesPerVertex(e))}initialize(e={}){return ArrayBuffer.isView(e)&&(e={data:e}),Number.isFinite(e)&&(e={byteLength:e}),e=uI("Buffer",e,Nre),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=uI("Buffer",e,kre))&&this.setAccessor(e.accessor),this}setAccessor(e){return delete(e=Object.assign({},e)).buffer,this.accessor=new _a(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;on(t);const o=this.gl.webgl2?36663:this.target;return this.gl.bindBuffer(o,this.handle),0!==r||void 0!==s?(Ao(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 Ao(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}={}){Ao(this.gl);const s=C0(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 u=Math.min(o,l);return on((r=r||u)<=u),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):(on(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){on(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=cI(e);return on(s),this.setAccessor(new _a(this.accessor,{type:s})),this}_setByteLength(e,t=this.usage){on(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/C0(this.accessor.type||5126,{clamped:!1}).BYTES_PER_ELEMENT;return this.getElementCount()-i}_inferType(e){this.accessor.type||this.setAccessor(new _a(this.accessor,{type:cI(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 mn.deprecated("Buffer.type","Buffer.accessor.type")(),this.accessor.type}get bytes(){return mn.deprecated("Buffer.bytes","Buffer.byteLength")(),this.byteLength}setByteLength(e){return mn.deprecated("setByteLength","reallocate")(),this.reallocate(e)}updateAccessor(e){return mn.deprecated("updateAccessor(...)","setAccessor(new Accessor(buffer.accessor, ...)")(),this.accessor=new _a(this.accessor,e),this}}const dI={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}},nj={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},ij={5126:4,5125:4,5124:4,5123:2,5122:2,5131:2,5120:1,5121:1},Bre=[9729,9728],rj=globalThis.WebGLBuffer||function(){};class Pf extends Ku{get[Symbol.toStringTag](){return"Texture"}static isSupported(e,t={}){const{format:i,linearFiltering:r}=t;let s=!0;return i&&(s=s&&function(n,e){const t=dI[e];if(!t)return!1;if(void 0===t.gl1&&void 0===t.gl2)return!0;const i=Ci(n)&&t.gl2||t.gl1;return"string"==typeof i?n.getExtension(i):i}(e,i),s=s&&(!r||function(n,e){const t=dI[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=ma("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(D=>this.initialize(Object.assign({},e,{pixels:D,data:D}))),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:u}=e;t||(t=r);let{width:h,height:f,dataFormat:g,type:m,compressed:w=!1,mipmaps:x=!0}=e;const{depth:U=0}=e;return({width:h,height:f,compressed:w,dataFormat:g,type:m}=this._deduceParameters({format:s,type:m,dataFormat:g,compressed:w,data:t,width:h,height:f})),this.width=h,this.height=f,this.depth=U,this.format=s,this.type=m,this.dataFormat=g,this.border=o,this.textureUnit=u,Number.isFinite(this.textureUnit)&&(this.gl.activeTexture(33984+this.textureUnit),this.gl.bindTexture(this.target,this.handle)),x&&this._isNPOT()&&(mn.warn(`texture: ${this} is Non-Power-Of-Two, disabling mipmaping`)(),x=!1,this._updateForNPOT(l)),this.mipmaps=x,this.setImageData({data:t,width:h,height:f,depth:U,format:s,type:m,dataFormat:g,border:o,mipmaps:x,parameters:c,compressed:w}),x&&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:u=this.type,width:h=this.width,height:f=this.height,dataFormat:g=this.dataFormat,compressed:m=!1}=e;c||(c=i),({type:u,dataFormat:g,compressed:m,width:h,height:f}=this._deduceParameters({format:s,type:u,dataFormat:g,compressed:m,data:c,width:h,height:f}));const{gl:w}=this;w.bindTexture(this.target,this.handle);let x=null;({data:c,dataType:x}=this._getDataType({data:c,compressed:m}));let U,D=0;return hc(this.gl,l,()=>{switch(x){case"null":w.texImage2D(t,r,s,h,f,o,g,u,c);break;case"typed-array":w.texImage2D(t,r,s,h,f,o,g,u,c,a);break;case"buffer":U=Ao(w),U.bindBuffer(35052,c.handle||c),U.texImage2D(t,r,s,h,f,o,g,u,a),U.bindBuffer(35052,null);break;case"browser-object":Ci(w)?w.texImage2D(t,r,s,h,f,o,g,u,c):w.texImage2D(t,r,s,g,u,c);break;case"compressed":for(const[ie,_e]of c.entries())w.compressedTexImage2D(t,ie,_e.format,_e.width,_e.height,o,_e.data),D+=_e.levelSize;break;default:on(!1,"Unknown image data type")}}),this._trackAllocatedMemory("compressed"===x?D:c&&c.byteLength?c.byteLength:this.width*this.height*(nj[this.dataFormat]||4)*(ij[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:u=this.type,dataFormat:h=this.dataFormat,compressed:f=!1,offset:g=0,border:m=this.border,parameters:w={}}){if(({type:u,dataFormat:h,compressed:f,width:o,height:a}=this._deduceParameters({format:c,type:u,dataFormat:h,compressed:f,data:i,width:o,height:a})),on(0===this.depth,"texSubImage not supported for 3D textures"),i||(i=t),i&&i.data){const x=i;i=x.data,o=x.shape[0],a=x.shape[1]}i instanceof lr&&(i=i.handle),this.gl.bindTexture(this.target,this.handle),hc(this.gl,w,()=>{if(f)this.gl.compressedTexSubImage2D(e,l,r,s,o,a,c,i);else if(null===i)this.gl.texSubImage2D(e,l,r,s,o,a,h,u,null);else if(ArrayBuffer.isView(i))this.gl.texSubImage2D(e,l,r,s,o,a,h,u,i,g);else if(i instanceof rj){const x=Ao(this.gl);x.bindBuffer(35052,i),x.texSubImage2D(e,l,r,s,o,a,h,u,g),x.bindBuffer(35052,null)}else Ci(this.gl)?Ao(this.gl).texSubImage2D(e,l,r,s,o,a,h,u,i):this.gl.texSubImage2D(e,l,r,s,h,u,i)}),this.gl.bindTexture(this.target,null)}copyFramebuffer(e={}){return mn.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 lr?{data:e.handle,dataType:"buffer"}:e instanceof rj?{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=dI[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},on(r,"Could not deduced texture size"),on(void 0===t||r.width===t,"Deduced texture width does not match supplied width"),on(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:on(!1);break;default:this.gl.texParameteri(this.target,e,t)}return this.gl.bindTexture(this.target,null),this}_isNPOT(){return!(Ci(this.gl)||!this.width||!this.height||ZV(this.width)&&ZV(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===Bre.indexOf(t)&&(t=9729);break;case 10242:case 10243:33071!==t&&(t=33071)}return t}}function Vre(n,e){return on("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 ya extends Pf{get[Symbol.toStringTag](){return"Texture2D"}static isSupported(e,t){return Pf.isSupported(e,t)}constructor(e,t={}){hx(e),(t instanceof Promise||"string"==typeof t)&&(t={data:t}),"string"==typeof t.data&&(t=Object.assign({},t,{data:Vre(t.data)})),super(e,Object.assign({},t,{target:3553})),this.initialize(t),Object.seal(this)}}const Nf="EXT_color_buffer_float",sj={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:Nf,bpp:2},33327:{gl2:Nf,bpp:4},34842:{gl2:Nf,bpp:8},33326:{gl2:Nf,bpp:4},33328:{gl2:Nf,bpp:8},34836:{gl2:Nf,bpp:16},35898:{gl2:Nf,bpp:4}};class zg extends Ku{get[Symbol.toStringTag](){return"Renderbuffer"}static isSupported(e,{format:t}={format:null}){return!t||function(n,e,t){const i=t[e];if(!i)return!1;const r=Ci(n)&&i.gl2||i.gl1;return"string"==typeof r?n.getExtension(r):r}(e,t,sj)}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 on(e,"Needs format"),this._trackDeallocatedMemory(),this.gl.bindRenderbuffer(36161,this.handle),0!==r&&Ci(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)*sj[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 uj="clear: bad arguments";function fI(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)),on(0!==o,uj),hc(n,s,()=>{n.clear(o)})}function dj(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 li(n){return function(){var e=this,t=arguments;return new Promise(function(i,r){var s=n.apply(e,t);function o(l){dj(s,i,r,o,a,"next",l)}function a(l){dj(s,i,r,o,a,"throw",l)}o(void 0)})}}const pI=[34069,34070,34071,34072,34073,34074];let Wre=(()=>{class n extends Pf{get[Symbol.toStringTag](){return"TextureCube"}constructor(t,i={}){hx(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 li(function*(){const{gl:u}=c,h=r||s,f=yield Promise.all(pI.map(g=>{const m=h[g];return Promise.all(Array.isArray(m)?m:[m])}));c.bind(),pI.forEach((g,m)=>{f[m].length>1&&!1!==c.opts.mipmaps&&mn.warn(`${c.id} has mipmap and multiple LODs.`)(),f[m].forEach((w,x)=>{t&&i?u.texImage2D(g,x,a,t,i,o,a,l,w):u.texImage2D(g,x,a,a,l,w)})}),c.unbind()})()}setImageDataForFace(t){const{face:i,width:r,height:s,pixels:o,data:a,border:l=0,format:c=6408,type:u=5121}=t,{gl:h}=this,f=o||a;return this.bind(),f instanceof Promise?f.then(g=>this.setImageDataForFace(Object.assign({},t,{face:i,data:g,pixels:g}))):this.width||this.height?h.texImage2D(i,0,c,r,s,l,c,u,f):h.texImage2D(i,0,c,c,u,f),this}}return n.FACES=pI,n})();class qre extends Pf{get[Symbol.toStringTag](){return"Texture3D"}static isSupported(e){return Ci(e)}constructor(e,t={}){Ao(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:u,parameters:h={}}){return this._trackDeallocatedMemory("Texture"),this.gl.bindTexture(this.target,this.handle),hc(this.gl,h,()=>{ArrayBuffer.isView(u)&&this.gl.texImage3D(this.target,e,t,i,r,s,o,a,l,u),u instanceof lr&&(this.gl.bindBuffer(35052,u.handle),this.gl.texImage3D(this.target,e,t,i,r,s,o,a,l,c))}),this._trackAllocatedMemory(u&&u.byteLength?u.byteLength:this.width*this.height*this.depth*(nj[this.dataFormat]||4)*(ij[this.type]||1),"Texture"),this.loaded=!0,this}}function hj(n,e){on(n instanceof ya||n instanceof Wre||n instanceof qre);const t=n.constructor,{gl:i,width:r,height:s,format:o,type:a,dataFormat:l,border:c,mipmaps:u}=n;return new t(i,Object.assign({width:r,height:s,format:o,type:a,dataFormat:l,border:c,mipmaps:u},e))}function Yre(n,e){const{gl:t,width:i,height:r,id:s}=n;return new ks(t,Object.assign({},e,{id:`framebuffer-for-${s}`,width:i,height:r,attachments:{36064:n}}))}function px(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:u,deleteFramebuffer:h}=T0(n);on(u);const{gl:f,handle:g,attachments:m}=u;a=a||u.width,l=l||u.height,36064===s&&null===g&&(s=1028),on(m[s]),c=c||m[s].type,o=function(n,e,t,i,r){if(n)return n;return new(C0(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 on(!1),0}}(t))}(o,c,r,a,l),c=c||cI(o);const w=f.bindFramebuffer(36160,g);return f.readPixels(t,i,a,l,r,c,o),f.bindFramebuffer(36160,w||null),h&&u.delete(),o}function gI(n,{sourceAttachment:e=36064,targetMaxHeight:t=Number.MAX_SAFE_INTEGER}={}){let i=px(n,{sourceAttachment:e}),{width:r,height:s}=n;for(;s>t;)({data:i,width:r,height:s}=Ore({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 u in i){const h=i[u];(Array.isArray(h)?h[0]:h).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 on(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&&mn.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){on(void 0!==o,"Misspelled framebuffer binding point?");const a=Number(o),l=r[a];let c=l;if(c)if(c instanceof zg)this._attachRenderbuffer({attachment:a,renderbuffer:c});else if(Array.isArray(l)){const[u,h=0,f=0]=l;c=u,this._attachTexture({attachment:a,texture:u,layer:h,level:f})}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(ks.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)&&fI(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]}={}){Ao(n),hc(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:on(!1,uj)}})}(this.gl,{drawBuffer:l,value:a})}),this.gl.bindFramebuffer(36160,o||null),this}readPixels(e={}){return mn.error("Framebuffer.readPixels() is no logner supported, use readPixelsToArray(framebuffer)")(),null}readPixelsToBuffer(e={}){return mn.error("Framebuffer.readPixelsToBuffer()is no logner supported, use readPixelsToBuffer(framebuffer)")(),null}copyToDataUrl(e={}){return mn.error("Framebuffer.copyToDataUrl() is no logner supported, use copyToDataUrl(framebuffer)")(),null}copyToImage(e={}){return mn.error("Framebuffer.copyToImage() is no logner supported, use copyToImage(framebuffer)")(),null}copyToTexture(e={}){return mn.error("Framebuffer.copyToTexture({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null}blit(e={}){return mn.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=Ao(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=ch(this.gl,r)),r}getAttachmentParameters(e=36064,t,i=this.constructor.ATTACHMENT_PARAMETERS||[]){const r={};for(const s of i)r[t?ch(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?ch(this.gl,s):s]=this.getAttachmentParameters(s,e)}return i}show(){return"undefined"!=typeof window&&window.open(gI(this),"luma-debug-texture"),this}log(e=0,t=""){if(e>mn.level||"undefined"==typeof window)return this;t=t||`Framebuffer ${this.id}`;const i=gI(this,{targetMaxHeight:100});return mn.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 ya(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 zg(this.gl,{id:`${this.id}-depth-stencil`,format:35056,width:r,height:111}),this.ownResources.push(o[33306])):t?(o=o||{},o[36096]=new zg(this.gl,{id:`${this.id}-depth`,format:33189,width:r,height:s}),this.ownResources.push(o[36096])):i&&on(!1),o}_unattach(e){const t=this.attachments[e];!t||(t instanceof zg?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:Ao(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:on(!1,"Illegal texture type")}s.bindTexture(t.target,null),this.attachments[e]=t}_setReadBuffer(e){const t=function(n){return Ci(n)?n:null}(this.gl);t?t.readBuffer(e):on(36064===e||1029===e,fj),this.readBuffer=e}_setDrawBuffers(e){const{gl:t}=this,i=Ao(t);if(i)i.drawBuffers(e);else{const r=t.getExtension("WEBGL_draw_buffers");r?r.drawBuffersWEBGL(e):on(1===e.length&&(36064===e[0]||1029===e[0]),fj)}this.drawBuffers=e}_getAttachmentParameterFallback(e){const t=function(n){n.luma=n.luma||{},n.luma.caps=n.luma.caps||{};for(const e in pj)void 0===n.luma.caps[e]&&(n.luma.caps[e]=mj(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)}}ks.ATTACHMENT_PARAMETERS=[36049,36048,33296,33298,33299,33300,33301,33302,33303];const pj={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 ya(n,{format:6408,type:5126,dataFormat:6408}),t=new ks(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 mI(n,e){return gj(n,e)}function gj(n,e){return(e=Array.isArray(e)?e:[e]).every(t=>mj(n,t))}function mj(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=pj[e];let i;on(t,e);const r=Ci(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:on(!1);return i}(n,e)),n.luma.caps[e]||mn.log(2,`Feature: ${e} not supported`)(),n.luma.caps[e]}class _I{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()}},ose=1/Math.PI*180,ase=1/180*Math.PI,Dr={};function cse(n,{precision:e=Dr.precision||4}={}){return n=function(n){return Math.round(n/Dr.EPSILON)*Dr.EPSILON}(n),`${parseFloat(n.toPrecision(e))}`}function uh(n){return Array.isArray(n)||ArrayBuffer.isView(n)&&!(n instanceof DataView)}function Qu(n,e,t){if(uh(n)){t=t||function(n){return n.clone?n.clone():new Array(n.length)}(n);for(let i=0;it*ase,void 0)}(n)}function dse(n){return function(n,e){return Qu(n,t=>t*ose,void 0)}(n)}function Ua(n,e,t){return Qu(n,i=>Math.max(e,Math.min(t,i)))}function gx(n,e,t){return uh(n)?n.map((i,r)=>gx(i,e[r],t)):t*e+(1-t)*n}function M0(n,e,t){const i=Dr.EPSILON;t&&(Dr.EPSILON=t);try{if(n===e)return!0;if(uh(n)&&uh(e)){if(n.length!==e.length)return!1;for(let r=0;r0?", ":"")+cse(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&&(Rj.length=n.length,i=Rj):i=Oj,(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 Pj(n){return n&&n[Symbol.asyncIterator]}function xI(n,e=(()=>!0)){return Array.isArray(n)?Nj(n,e,[]):e(n)?[n]:[]}function Nj(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 kj(n,e){return n?(Number.isFinite(n)&&(n={duration:n}),n.type=n.type||"interpolation",ot(ot(ot({},Bse[n.type]),e),n)):null}function Fj(n,e){return e.getBuffer()?[e.getBuffer(),{divisor:0,size:e.size,normalized:e.settings.normalized}]:e.value}function Lj(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 Bj(n){n.push(n.shift())}function CI(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 Vj({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,u=r&&c,h=CI(t,e),f=t.state.constant;if(!u&&i>=h)return;const g=f?t.value:t.getBuffer().getData({srcByteOffset:l});if(t.settings.normalized&&!f){const U=s;s=(D,ie)=>t._normalizeConstant(U(D,ie))}const m=f?(U,D)=>s(g,D):(U,D)=>s(g.subarray(U,U+a),D),w=n.getData({length:i}),x=new Float32Array(h);(function({source:n,target:e,size:t,getData:i,sourceStartIndices:r,targetStartIndices:s}){if(!Array.isArray(s))return SI({source:n,target:e,size:t,getData:i}),e;let o=0,a=0;const l=i&&((u,h)=>i(u+a,h)),c=Math.min(r.length,s.length);for(let u=1;u(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===vx||(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=vx}clearNeedsUpdate(){this.state.needsUpdate=!1,this.state.updateRanges=kse}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!==vx}),!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,u]of s)o.call(r,this,{data:t,startRow:c,endRow:u,props:i,numInstances:e});if(this.value)if(this.constant||this.buffer.byteLength{if(!r){const x=h*a+l;for(let U=0;Uu?c.set(ie,w):(e._normalizeValue(ie,U.target,0),Nse({target:c,source:U.target,start:w,count:_e}));w+=_e*u}else e._normalizeValue(ie,c,w),w+=u}}_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 AI={};function Do(n){Ri.level>0&&AI[n]&&AI[n].call(...arguments)}function za(n,e){if(!n)throw new Error(e||"shadertools: assertion failed.")}const jj="out vec4 transform_output;\nvoid main() {\n transform_output = vec4(0);\n}",Use=`#version 300 es\n${jj}`;function Uj(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 zj(n={}){const{version:e=100,input:t,inputType:i,output:r}=n;if(!t)return 300===e?Use:e>300?`#version ${e}\n${jj}`:"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 za(!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 Hj extends Ku{get[Symbol.toStringTag](){return"TransformFeedback"}static isSupported(e){return Ci(e)}constructor(e,t={}){Ao(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,jg(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,mn.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 lr?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 $se{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 lr?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&&on(Ci(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 Hj(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],on(i[s]instanceof lr)}return{sourceBuffers:t,feedbackBuffers:i}}_createNewBuffer(e,t){const i=new lr(this.gl,t);return this.resources[e]&&this.resources[e].delete(),this.resources[e]=i,i}_getNextIndex(){return(this.currentIndex+1)%2}}function Gj(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 R0="vs",Yse={[R0]:"#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"},wx="__LUMA_INJECT_DECLARATIONS__",$j=/void\s+main\s*\([^)]*\)\s*\{\n?/,Wj=/}\n?[^{}]*$/,DI=[];function qj(n,e,t,i=!1){const r=e===R0;for(const s in t){const o=t[s];o.sort((l,c)=>l.order-c.order),DI.length=o.length;for(let l=0,c=o.length;ll+a));break;case"vs:#main-end":r&&(n=n.replace(Wj,l=>a+l));break;case"fs:#decl":r||(n=n.replace(wx,a));break;case"fs:#main-start":r||(n=n.replace($j,l=>l+a));break;case"fs:#main-end":r||(n=n.replace(Wj,l=>a+l));break;default:n=n.replace(s,l=>l+a)}}return n=n.replace(wx,""),i&&(n=n.replace(/\}\s*$/,s=>s+Yse[e])),n}function II(n){const e={};return za(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 Xse={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},Ex="transform_uSize_",Yj="transform_position";const ioe={10241:9728,10240:9728,10242:33071,10243:33071};class soe{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 h in this.samplerTextureMap)a[h]=i[this.samplerTextureMap[h]];this._setSourceTextureParameters();const u=function({sourceTextureMap:n,targetTextureVarying:e,targetTexture:t}){const i={};let r,s;e&&(({width:r,height:s}=t),i[`${Ex}${e}`]=[r,s]);for(const o in n)({width:r,height:s}=n[o]),i[`${Ex}${o}`]=[r,s];return i}({sourceTextureMap:i,targetTextureVarying:this.targetTextureVarying,targetTexture:s});Object.assign(a,u)}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=px(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 za(!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 lr(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 ks(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(ioe)}_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=hj(e,{parameters:{10241:9728,10240:9728,10242:33071,10243:33071},pixelStore:{37440:!1}});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 u=l.split("\n"),h=u.slice();if(u.forEach((f,g,m)=>{if(s>0){const w=function(n,e){const t={},i=function(n){return Uj(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=`${Ex}${n}`;return{samplerName:e,sizeName:t,uniformDeclerations:` uniform sampler2D ${e};\n uniform vec2 ${t};`}}(s),h=` ${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 za(!1),null}}(r)};\n`;return t[a]=s,{updatedLine:o,inject:{"vs:#decl":c,"vs:#main-start":h},samplerTextureMap:t}}return null}(f,e);if(w){const{updatedLine:x,inject:U}=w;h[g]=x,c=II([c,U]),Object.assign(a,w.samplerTextureMap),s--}}t&&!o&&(o=function(n,e){const t=Uj(n,["varying","out"]);return t&&t.name===e?t.type:null}(f,t))}),t){on(i);const f=`${Ex}${t}`;c=II([c,{"vs:#decl":`uniform vec2 ${f};\n`,"vs:#main-start":` vec2 ${Yj} = transform_getPos(${f});\n gl_Position = vec4(${Yj}, 0, 1.);\n`}])}l=h.join("\n")}return{vs:l,targetTextureType:o,inject:c,samplerTextureMap:a}}({vs:e.vs,sourceTextureMap:t,targetTextureVarying:this.targetTextureVarying,targetTexture:i}),c=II([e.inject||{},a]);return this.targetTextureType=o,this.samplerTextureMap=l,{vs:r,fs:e._fs||zj({version:Gj(r),input:this.targetTextureVarying,inputType:o,output:"transform_output"}),modules:this.hasSourceTextures||this.targetTextureVarying?[Xse].concat(e.modules||[]):e.modules,uniforms:s,inject:c}}}const OI={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 aoe(n){let e=Xj(n);return"object"===e?n?"type"in n?Object.assign({},n,OI[n.type]):"value"in n?(e=Xj(n.value),Object.assign({type:e},n,OI[e])):{type:"object",value:n}:{type:"object",value:null}:Object.assign({type:e,value:n},OI[e])}function Xj(n){return Array.isArray(n)||ArrayBuffer.isView(n)?"array":typeof n}class RI{constructor({name:e,vs:t,fs:i,dependencies:r=[],uniforms:s,getUniforms:o,deprecations:a=[],defines:l={},inject:c={},vertexShader:u,fragmentShader:h}){za("string"==typeof e),this.name=e,this.vs=t||u,this.fs=i||h,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=aoe(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:za(!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&&za(s.validate(e[r],s),`${this.name}: invalid ${r}`),t[r]=e[r]):t[r]=s.value}return t}}function doe(n){return function(n){const e={},t={};return PI({modules:n,level:0,moduleMap:e,moduleDepth:t}),Object.keys(t).sort((i,r)=>t[r]-t[i]).map(i=>e[i])}(Qj(n))}function PI({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 RI||(za("string"!=typeof t,`Shader module use by name is deprecated. Import shader module '${t}' and use it directly.`),za(t.name,"shader module has no name"),(t=new RI(t)).dependencies=Qj(t.dependencies)),t))}const NI={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]},kf={};function boe(n,e){return n.match(/NVIDIA/i)||e.match(/NVIDIA/i)?"NVIDIA":n.match(/INTEL/i)||e.match(/INTEL/i)?"INTEL":n.match(/AMD/i)||e.match(/AMD/i)||n.match(/ATI/i)||e.match(/ATI/i)?"AMD":"UNKNOWN GPU"}Object.keys(NI).forEach(n=>{kf[n]=n});const kI={};function Zj(n,e,t={}){const i=NI[e];if(za(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 kI)return kI[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),kI[e]=l,l}function xx(n,e){return(e=Array.isArray(e)?e:[e]).every(t=>function(n,e){const t=NI[e];za(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 za(!1===r||!0===r),r}(n,t))}function Gg(n){return new RegExp(`\\b${n}[ \\t]+(\\w+[ \\t]+\\w+(\\[\\w+\\])?;)`,"g")}const Jj=[[/^(#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("]],xoe=[...Jj,[Gg("attribute"),"in $1"],[Gg("varying"),"out $1"]],Soe=[...Jj,[Gg("varying"),"in $1"]],eU=[[/^#version[ \t]+300[ \t]+es/,"#version 100"],[/\btexture(2D|2DProj|Cube)Lod\(/g,"texture$1LodEXT("],[/\btexture\(/g,"texture2D("],[/\btextureLod\(/g,"texture2DLodEXT("]],Coe=[...eU,[Gg("in"),"attribute $1"],[Gg("out"),"varying $1"]],Toe=[...eU,[Gg("in"),"varying $1"]],FI="gl_FragColor",LI=/\bout[ \t]+vec4[ \t]+(\w+)[ \t]*;\n?/,Aoe=/void\s+main\s*\([^)]*\)\s*\{\n?/;function Sx(n,e){for(const[t,i]of e)n=n.replace(t,i);return n}const Ooe=`\n\n${wx}\n\n`,tU={[R0]:"vertex",fs:"fragment"};function nU(n,{id:e,source:t,type:i,modules:r,defines:s={},hookFunctions:o=[],inject:a={},transpileToGLSL100:l=!1,prologue:c=!0,log:u}){za("string"==typeof t,"shader source must be a string");const h=i===R0,f=t.split("\n");let g=100,m="",w=t;0===f[0].indexOf("#version ")?(g=300,m=f[0],w=f.slice(1).join("\n")):m=`#version ${g}`;const x={};r.forEach(Ne=>{Object.assign(x,Ne.getDefines())}),Object.assign(x,s);let U=c?`${m}\n${function({id:n,source:e,type:t}){return n&&"string"==typeof n&&-1===e.indexOf("SHADER_NAME")?`\n#define SHADER_NAME ${n}_${tU[t]}\n\n`:""}({id:e,source:t,type:i})}\n${function({type:n}){return`\n#define SHADER_TYPE_${tU[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:boe(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// 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"}}(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 xx(n,kf.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"),xx(n,kf.GLSL_DERIVATIVES)&&Zj(n,kf.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"),xx(n,kf.GLSL_FRAG_DATA)&&Zj(n,kf.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"),xx(n,kf.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}(x)}\n${h?"":"precision highp float;\n\n"}\n`:`${m}\n`;const D=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),ie={},_e={},Pe={};for(const Ne in a){const Ve="string"==typeof a[Ne]?{injection:a[Ne],order:0}:a[Ne],bt=Ne.match(/^(v|f)s:(#)?([\w-]+)$/);if(bt){const At=bt[3];bt[2]?"decl"===At?_e[Ne]=[Ve]:Pe[Ne]=[Ve]:ie[Ne]=[Ve]}else Pe[Ne]=[Ve]}for(const Ne of r){u&&Ne.checkDeprecations(w,u),U+=Ne.getModuleSource(i,g);const bt=Ne.injections[i];for(const xt in bt){const At=xt.match(/^(v|f)s:#([\w-]+)$/);if(At){const Wt="decl"===At[2]?_e:Pe;Wt[xt]=Wt[xt]||[],Wt[xt].push(bt[xt])}else ie[xt]=ie[xt]||[],ie[xt].push(bt[xt])}}return U+=Ooe,U=qj(U,i,_e),U+=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}(D[i],ie),U+=w,U=qj(U,i,Pe),U=function(n,e,t){switch(e){case 300:return t?Sx(n,xoe):function(n){const e=(n=Sx(n,Soe)).match(LI);if(e){const t=e[1];n=n.replace(new RegExp(`\\b${FI}\\b`,"g"),t)}else{const t="fragmentColor";n=n.replace(Aoe,i=>`out vec4 ${t};\n${i}`).replace(new RegExp(`\\b${FI}\\b`,"g"),t)}return n}(n);case 100:return t?Sx(n,Coe):function(n){const e=(n=Sx(n,Toe)).match(LI);if(e){const t=e[1];n=n.replace(LI,"").replace(new RegExp(`\\b${t}\\b`,"g"),FI)}return n}(n);default:throw new Error(`unknown GLSL version ${e}`)}}(U,l?100:g,h),U}function Noe(n){return function(t){const i={};for(const r of n){const s=r.getUniforms(t,i);Object.assign(i,s)}return i}}const joe={5126:Ir.bind(null,"uniform1fv",Ha,1,Io),35664:Ir.bind(null,"uniform2fv",Ha,2,Io),35665:Ir.bind(null,"uniform3fv",Ha,3,Io),35666:Ir.bind(null,"uniform4fv",Ha,4,Io),5124:Ir.bind(null,"uniform1iv",dh,1,Io),35667:Ir.bind(null,"uniform2iv",dh,2,Io),35668:Ir.bind(null,"uniform3iv",dh,3,Io),35669:Ir.bind(null,"uniform4iv",dh,4,Io),35670:Ir.bind(null,"uniform1iv",dh,1,Io),35671:Ir.bind(null,"uniform2iv",dh,2,Io),35672:Ir.bind(null,"uniform3iv",dh,3,Io),35673:Ir.bind(null,"uniform4iv",dh,4,Io),35674:Ir.bind(null,"uniformMatrix2fv",Ha,4,Ju),35675:Ir.bind(null,"uniformMatrix3fv",Ha,9,Ju),35676:Ir.bind(null,"uniformMatrix4fv",Ha,16,Ju),35678:oo,35680:oo,5125:Ir.bind(null,"uniform1uiv",Cx,1,Io),36294:Ir.bind(null,"uniform2uiv",Cx,2,Io),36295:Ir.bind(null,"uniform3uiv",Cx,3,Io),36296:Ir.bind(null,"uniform4uiv",Cx,4,Io),35685:Ir.bind(null,"uniformMatrix2x3fv",Ha,6,Ju),35686:Ir.bind(null,"uniformMatrix2x4fv",Ha,8,Ju),35687:Ir.bind(null,"uniformMatrix3x2fv",Ha,6,Ju),35688:Ir.bind(null,"uniformMatrix3x4fv",Ha,12,Ju),35689:Ir.bind(null,"uniformMatrix4x2fv",Ha,8,Ju),35690:Ir.bind(null,"uniformMatrix4x3fv",Ha,12,Ju),35678:oo,35680:oo,35679:oo,35682:oo,36289:oo,36292:oo,36293:oo,36298:oo,36299:oo,36300:oo,36303:oo,36306:oo,36307:oo,36308:oo,36311:oo},Uoe={},zoe={},Hoe={},iU=[0];function BI(n,e,t,i){1===e&&"boolean"==typeof n&&(n=n?1:0),Number.isFinite(n)&&(iU[0]=n,n=iU);const r=n.length;if(r%e&&mn.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 Ir(n,e,t,i){let r=null,s=null;return(o,a,l)=>{const c=e(l,t),u=c.length;let h=!1;if(null===r)r=new Float32Array(u),s=u,h=!0;else{on(s===u,"Uniform length cannot change.");for(let f=0;f{const a=String(o+e);return aU(a,r-a.length)+t+s})}(e);return{shaderName:l,errors:oU(s,c),warnings:oU(o,c)}}(i,this.source,this.shaderType,this.id);throw mn.error(`GLSL compilation errors in ${r}\n${s}`)(),mn.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 VI extends P0{get[Symbol.toStringTag](){return"VertexShader"}constructor(e,t){"string"==typeof t&&(t={source:t}),super(e,Object.assign({},t,{shaderType:35633}))}_createHandle(){return this.gl.createShader(35633)}}class jI extends P0{get[Symbol.toStringTag](){return"FragmentShader"}constructor(e,t){"string"==typeof t&&(t={source:t}),super(e,Object.assign({},t,{shaderType:35632}))}_createHandle(){return this.gl.createShader(35632)}}const Fs=5126,N0=5124,k0=5125,UI={[Fs]:[Fs,1,"float"],35664:[Fs,2,"vec2"],35665:[Fs,3,"vec3"],35666:[Fs,4,"vec4"],[N0]:[N0,1,"int"],35667:[N0,2,"ivec2"],35668:[N0,3,"ivec3"],35669:[N0,4,"ivec4"],[k0]:[k0,1,"uint"],36294:[k0,2,"uvec2"],36295:[k0,3,"uvec3"],36296:[k0,4,"uvec4"],35670:[Fs,1,"bool"],35671:[Fs,2,"bvec2"],35672:[Fs,3,"bvec3"],35673:[Fs,4,"bvec4"],35674:[Fs,8,"mat2"],35685:[Fs,8,"mat2x3"],35686:[Fs,8,"mat2x4"],35675:[Fs,12,"mat3"],35687:[Fs,12,"mat3x2"],35688:[Fs,12,"mat3x4"],35676:[Fs,16,"mat4"],35689:[Fs,16,"mat4x2"],35690:[Fs,16,"mat4x3"]};function fU(n){const e=UI[n];if(!e)return null;const[t,i]=e;return{type:t,components:i}}function pU(n,e){switch(n){case 5120:case 5121:case 5122:case 5123:n=Fs}for(const t in UI){const[i,r,s]=UI[t];if(i===n&&r===e)return{glType:t,name:s}}return null}class Aae{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(!Ci(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}=fU(i),a={type:s,size:r*o};this._inferProperties(e,t,a);const l={location:e,name:t,accessor:new _a(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}=fU(i),l={location:e,name:t,accessor:new _a({type:s,size:r*o})};this.varyingInfos.push(l),this.varyingInfosByName[l.name]=l}}const Mae=35981,Dae=["setVertexArray","setAttributes","setBuffers","unsetBuffers","use","getUniformCount","getUniformInfo","getUniformLocation","getUniformValue","getVarying","getFragDataLocation","getAttachedShaders","getAttributeCount","getAttributeLocation","getAttributeInfo"];class mU extends Ku{get[Symbol.toStringTag](){return"Program"}constructor(e,t={}){super(e,t),this.stubRemovedMethods("Program","v6.0",Dae),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=Mae}=e;return this.hash=t||"",this.vs="string"==typeof i?new VI(this.gl,{id:`${e.id}-vs`,source:i}):i,this.fs="string"==typeof r?new jI(this.gl,{id:`${e.id}-fs`,source:r}):r,on(this.vs instanceof VI),on(this.fs instanceof jI),this.uniforms={},this._textureUniforms={},s&&s.length>0&&(Ao(this.gl),this.varyings=s,this.gl2.transformFeedbackVaryings(this.handle,s,o)),this._compileAndLink(),this._readUniformLocationsFromLinkedProgram(),this.configuration=new Aae(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:u=c>0,vertexArray:h=null,transformFeedback:f,framebuffer:g,parameters:m={},uniforms:w,samplers:x}){if((w||x)&&(mn.deprecated("Program.draw({uniforms})","Program.setUniforms(uniforms)")(),this.setUniforms(w||{})),mn.priority>=e){const U=g?g.id:"default",D=`mode=${ch(this.gl,t)} verts=${i} instances=${c} indexType=${ch(this.gl,l)} isInstanced=${u} isIndexed=${a} Framebuffer=${U}`;mn.log(e,D)()}return on(h),this.gl.useProgram(this.handle),!(!this._areTexturesRenderable()||0===i||u&&0===c||(h.bindForDraw(i,c,()=>{if(void 0!==g&&(m=Object.assign({},m,{framebuffer:g})),f){const U=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 on(!1),0}}(t);f.begin(U)}this._bindTextures(),hc(this.gl,m,()=>{a&&u?this.gl2.drawElementsInstanced(t,i,l,r,c):a&&Ci(this.gl)&&!isNaN(s)&&!isNaN(o)?this.gl2.drawRangeElements(t,s,o,i,l,r):a?this.gl.drawElements(t,i,l,r):u?this.gl2.drawArraysInstanced(t,r,i,c):this.gl.drawArrays(t,r,i)}),f&&f.end()}),0))}setUniforms(e={}){mn.priority>=2&&function(n,e,t){for(const i in n){const r=n[i];if((!t||Boolean(t[i]))&&!Woe(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 ks&&(s=s.texture),s instanceof Pf)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)&&qoe(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 VI({handle:r});break;case 35632:i.fs=new jI({handle:r})}return i}_getParameter(e){return this.gl.getProgramParameter(this.handle,e)}_setId(e){if(!e){const t=this._getName();this.id=ma(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),mn.time(4,`linkProgram for ${this._getName()}`)(),e.linkProgram(this.handle),mn.timeEnd(4,`linkProgram for ${this._getName()}`)(),e.debug||mn.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),u=this._getHash(t),h=this._getHash(i),f=c.map(ie=>this._getHash(ie.name)).sort(),g=o.map(ie=>this._getHash(ie)),m=Object.keys(r).sort(),w=Object.keys(s).sort(),x=[],U=[];for(const ie of m)x.push(this._getHash(ie)),x.push(this._getHash(r[ie]));for(const ie of w)U.push(this._getHash(ie)),U.push(this._getHash(s[ie]));const D=`${u}/${h}D${x.join("/")}M${f.join("/")}I${U.join("/")}V${g.join("/")}H${this.stateHash}B${a}${l?"T":""}`;if(!this._programCache[D]){const ie=function(n,e){const{vs:t,fs:i}=e,r=doe(e.modules||[]);return{gl:n,vs:nU(n,Object.assign({},e,{source:t,type:R0,modules:r})),fs:nU(n,Object.assign({},e,{source:i,type:"fs",modules:r})),getUniforms:Noe(r)}}(this.gl,{vs:t,fs:i,modules:c,inject:s,defines:r,hookFunctions:this._hookFunctions,transpileToGLSL100:l});this._programCache[D]=new mU(this.gl,{hash:D,vs:ie.vs,fs:ie.fs,varyings:o,bufferMode:a}),this._getUniforms[D]=ie.getUniforms||(_e=>{}),this._useCounts[D]=0}return this._useCounts[D]++,this._programCache[D]}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":v0.chrome?"Chrome":v0.safari?"Safari":v0.mozInnerScreenX?"Firefox":"Unknown"}()}static getDefaultArray(e){return e.luma=e.luma||{},e.luma.defaultVertexArray||(e.luma.defaultVertexArray=new Ga(e,{handle:null,isDefaultArray:!0})),e.luma.defaultVertexArray}static getMaxAttributes(e){return Ga.MAX_ATTRIBUTES=Ga.MAX_ATTRIBUTES||e.getParameter(34921),Ga.MAX_ATTRIBUTES}static setConstant(e,t,i){switch(i.constructor){case Float32Array:Ga._setConstantFloatArray(e,t,i);break;case Int32Array:Ga._setConstantIntArray(e,t,i);break;case Uint32Array:Ga._setConstantUintArray(e,t,i);break;default:on(!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 Ga.getMaxAttributes(this.gl)}initialize(e={}){return this.setProps(e)}setProps(e){return this}setElementBuffer(e=null,t={}){return on(!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:u}=i,{gl:h,gl2:f}=this;return e=Number(e),this.bind(()=>{h.bindBuffer(34962,t.handle),c?(on(Ci(h)),f.vertexAttribIPointer(e,r,s,o,a)):h.vertexAttribPointer(e,r,s,l,o,a),h.enableVertexAttribArray(e),f.vertexAttribDivisor(e,u||0)}),this}enable(e,t=!0){return!t&&0===e&&!Ga.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 lr(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(!Mx||Mx.byteLength{switch(e){case 34373:return this.gl.getVertexAttribOffset(t,e);default:return this.gl.getVertexAttrib(t,e)}})}}const Fae=/^(.+)__LOCATION_([0-9]+)$/,Lae=["setBuffers","setGeneric","clearBindings","setLocations","setGenericValues","setDivisor","enable","disable"];class Bae{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 Ga(e),JV(this,"VertexArray","v6.0",Lae),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 lr(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,mn.once(3,()=>`unused value ${e} in ${this.id}`)(),s;const l=this._getAttributeInfo(a||o);if(!l)return s;const u=_a.resolve(l.accessor,this.accessors[o]||{},i,r),{size:h,type:f}=u;return on(Number.isFinite(h)&&Number.isFinite(f)),{location:o,accessor:u}}_getAttributeInfo(e){return this.configuration&&this.configuration.getAttributeInfo(e)}_getAttributeIndex(e){const t=Number(e);if(Number.isFinite(t))return{location:t};const i=Fae.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 lr)this.setBuffer(e,t);else if(Array.isArray(t)&&t.length&&t[0]instanceof lr)this.setBuffer(e,t[0],t[1]);else if(ArrayBuffer.isView(t)||Array.isArray(t))this.setConstant(e,t);else{if(!(t.buffer instanceof lr))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 lr){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 mn.deprecated("setElements","setElementBuffer")(),this.setElementBuffer(e,t)}}function L0(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+=L0(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 _U(n,e,t,i){const{gl:r}=n;if(!e)return{[i]:"null","Format ":"N/A"};let c,u,h,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 lr){const f=e,{data:g,changed:m}=f.getDebugData();let w;return u=m?"*":"",h=g,l=f.byteLength,a=l/g.BYTES_PER_ELEMENT/o,t?w=`${t.divisor>0?"I ":"P "} ${a} (x${o}=${l} bytes ${ch(r,s)})`:(c=!0,w=`${l} bytes`),{[i]:`${u}${L0(h,{size:o,isInteger:c})}`,"Format ":w}}return h=e,o=e.length,s=String(e.constructor.name).replace("Array",""),c=-1!==s.indexOf("nt"),{[i]:`${L0(h,{size:o,isInteger:c})} (constant)`,"Format ":`${o}x${s} (constant)`}}function Uae(n,e){const{type:t,size:i}=e,r=pU(t,i);return r?`${n} (${r.name})`:n}function yU({header:n="Uniforms",program:e,uniforms:t,undefinedOnly:i=!1}){on(e);const s=".*Matrix",a={},l=Object.keys(e._uniformSetters).sort();let c=0;for(const f of l)!f.match(".*_.*")&&!f.match(s)&&zI({table:a,header:n,uniforms:t,uniformName:f,undefinedOnly:i})&&c++;for(const f of l)f.match(s)&&zI({table:a,header:n,uniforms:t,uniformName:f,undefinedOnly:i})&&c++;for(const f of l)a[f]||zI({table:a,header:n,uniforms:t,uniformName:f,undefinedOnly:i})&&c++;let u=0;const h={};if(!i)for(const f in t){const g=t[f];a[f]||(u++,h[f]={Type:`NOT USED: ${g}`,[n]:L0(g)})}return{table:a,count:c,unusedTable:h,unusedCount:u}}function zI({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?L0(s):"N/A","Uniform Type":o?s:"NOT PROVIDED"},0))}function bU(n){const{type:e,size:t}=n.accessor,i=pU(e,t);return i?`${i.name} ${n.name}`:n.name}const Gae={POSITION:"positions",NORMAL:"normals",COLOR_0:"colors",TEXCOORD_0:"texCoords",TEXCOORD_1:"texCoords1",TEXCOORD_2:"texCoords2"};function Wae(n,e){const{attributeMap:t=Gae}=e||{};return t&&t[n]||n}function qae(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}on(Number.isFinite(e.size),`attribute ${n} needs size`)}const vU=()=>{},Kae={};class Yg{constructor(e,t={}){const{id:i=ma("model")}=t;on(dx(e)),this.id=i,this.gl=e,this.id=t.id||ma("Model"),this.lastLogTime=0,this.animated=!1,this.initialize(t)}initialize(e){this.props={},this.programManager=e.programManager||F0.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:u}=e;this.programProps={program:t,vs:i,fs:r,modules:s,defines:o,inject:a,varyings:l,bufferMode:c,transpileToGLSL100:u},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={},on(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:u}=e;this.programProps={program:t,vs:i,fs:r,modules:s,defines:o,inject:a,varyings:l,bufferMode:c,transpileToGLSL100:u},this._programDirty=!0}getUniforms(){return this.uniforms}setDrawMode(e){return this.drawMode=e,this}setVertexCount(e){return on(Number.isFinite(e)),this.vertexCount=e,this}setInstanceCount(e){return on(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=Wae(s,undefined);if("indices"===s)r=o;else if(o.constant)i[a]=o.value;else{const l=o.value,c=ot({},o);delete c.value,i[a]=[new lr(n,l),c],qae(s,c)}}if(r){const s=r.value||r;on(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 lr(n,{data:s,target:34963}),o]}return i}(this.gl,e),this.vertexArray.setAttributes(this.geometryBuffers),this}setAttributes(e={}){if(jg(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 fI(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),mn.priority>=2&&(c=this._logDrawCallStart(2));const u=this.vertexArray.getDrawParams(),{isIndexed:h=u.isIndexed,indexType:f=u.indexType,indexOffset:g=u.indexOffset,vertexArrayInstanced:m=u.isInstanced}=this.props;m&&!this.isInstanced&&mn.warn("Found instanced attributes on non-instanced model",this.id)();const{isInstanced:w,instanceCount:x}=this,{onBeforeRender:U=vU,onAfterRender:D=vU}=this.props;U(),this.program.setUniforms(this.uniforms);const ie=this.program.draw(Object.assign(Kae,e,{logPriority:c,uniforms:null,framebuffer:i,parameters:a,drawMode:this.getDrawMode(),vertexCount:this.getVertexCount(),vertexArray:l,transformFeedback:o,isIndexed:h,indexType:f,isInstanced:w,instanceCount:x,offset:h?g:0}));return D(),mn.priority>=2&&this._logDrawCallEnd(c,l,i),ie}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 mn.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:u}=this.programProps;t=this.programManager.get({vs:i,fs:r,modules:s,inject:o,defines:a,varyings:l,bufferMode:c,transpileToGLSL100:u}),this.program&&this._managedProgram&&this.programManager.release(this.program),this._programManagerState=this.programManager.stateHash,this._managedProgram=!0}on(t instanceof mU,"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 Bae(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 lr&&t.delete()}}_setAnimationProps(e){this.animated&&on(e,"Model.draw(): animated uniforms but no animationProps")}_setFeedbackBuffers(e={}){if(jg(e))return this;const{gl:t}=this.program;return this.transformFeedback=this.transformFeedback||new Hj(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:mn.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=_U(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}: ${Uae(s.name,a)}`),t[o]=_U(n,i[r],a,e)}}return t}({vertexArray:t,header:`${this.id} attributes`,attributes:this._attributes}),{table:o,unusedTable:a,unusedCount:l}=yU({header:`${this.id} uniforms`,program:this.program,uniforms:Object.assign({},this.program.uniforms,i)}),{table:c,count:u}=yU({header:`${this.id} uniforms`,program:this.program,uniforms:Object.assign({},this.program.uniforms,i),undefinedOnly:!0});u>0&&mn.log("MISSING UNIFORMS",Object.keys(c))(),l>0&&mn.log("UNUSED UNIFORMS",Object.keys(a))();const h=function(n){const e={},t=`Accessors for ${n.id}`;for(const i of n.attributeInfos)i&&(e[`in ${bU(i)}`]={[t]:JSON.stringify(i.accessor)});for(const i of n.varyingInfos)i&&(e[`out ${bU(i)}`]={[t]:JSON.stringify(i.accessor)});return e}(this.vertexArray.configuration);mn.table(e,s)(),mn.table(e,o)(),mn.table(e+1,h)(),r&&r.log({logLevel:2,message:`Rendered to ${r.id}`}),mn.groupEnd(2,`>>> DRAWING MODEL ${this.id}`)()}}class HI{static isSupported(e){return Ci(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();on(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 Yg(t,Object.assign({},e,{fs:e.fs||zj({version:Gj(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!(jg(n.feedbackBuffers)&&jg(n.feedbackMap)&&!(n.varyings&&n.varyings.length>0))})(t)&&(this.bufferTransform=new $se(e,t)),function(n){return!(jg(n._sourceTextures)&&!n._targetTexture&&!n._targetTextureVarying)}(t)&&(this.textureTransform=new soe(e,t)),on(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 Dx(){}const Jae={onStart:Dx,onUpdate:Dx,onInterrupt:Dx,onEnd:Dx};class B0{constructor(e){this._inProgress=!1,this._handle=null,this.timeline=e,this.settings={}}get inProgress(){return this._inProgress}start(e){this.cancel(),this.settings=ot(ot({},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 ale={interpolation:class{constructor({gl:e,attribute:t,timeline:i}){this.gl=e,this.type="interpolation",this.transition=new B0(i),this.attribute=t,this.attributeInTransition=new TI(e,t.settings),this.currentStartIndices=t.startIndices,this.currentLength=0,this.transform=function(n,e){const t=Lj(e.size);return new HI(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 lr(e,r),new lr(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;Bj(r);const o={numInstances:t,attribute:s,fromLength:this.currentLength,fromStartIndices:this.currentStartIndices,getData:e.enter};for(const a of r)Vj(ot({buffer:a},o));this.currentStartIndices=s.startIndices,this.currentLength=CI(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:Fj(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 B0(i),this.attribute=t,this.attributeInTransition=new TI(e,Sn(ot({},t.settings),{normalized:!1})),this.currentStartIndices=t.startIndices,this.currentLength=0,this.texture=function(n){return new ya(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 ks(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=Lj(e.size);return new HI(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 lr(e,r),new lr(e,r),new lr(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)Vj(ot({buffer:a},o));this.currentStartIndices=s.startIndices,this.currentLength=CI(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:Fj(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]}}),Bj(e),this.attributeInTransition.update({buffer:e[1],value:this.attribute.value}),px(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 lle{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=HI.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 Ri.warn("WebGL2 not supported by this browser. Transition for ".concat(e," is disabled."))();r&&this._removeTransition(e);const o=ale[i.type];o?this.transitions[e]=new o({attribute:t,timeline:this.timeline,gl:this.gl}):(Ri.error("unsupported transition type '".concat(i.type,"'"))(),s=!1)}(s||t.needsRedraw())&&(this.needsRedraw=!0,this.transitions[e].start(i,this.numInstances))}}const wU="attributeManager.invalidate";class ple{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 lle(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;Do("attribute.updateStart",t),t.allocate(i)&&Do("attribute.allocate",t,i),t.updateBuffer(e)&&(this.needsRedraw=!0,Do("attribute.updateEnd",t,i))}}function xU(n,e,t,i,r){const s=e-n;return(t-e)*r+-s*i+s+e}function SU(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=kj(r)))return;const o=yle[r.type];if(!o)return void Ri.error("unsupported transition type '".concat(r.type,"'"))();const a=new o(this.timeline);a.start(Sn(ot({},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 Ix={COMPONENT:Symbol.for("component"),ASYNC_DEFAULTS:Symbol.for("asyncPropDefaults"),ASYNC_ORIGINAL:Symbol.for("asyncPropOriginal"),ASYNC_RESOLVED:Symbol.for("asyncPropResolved")},{COMPONENT:vle}=Ix;function xle(n,e){if(!n.transitions)return null;const t={},i=$I(n);for(const r in n.transitions){const s=i[r],o=s&&s.type;("number"===o||"color"===o||"array"===o)&&GI(n[r],e[r],s)&&(t[r]=!0)}return t}function CU({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=GI(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=GI(n[s],e[s],i[s]);if(o)return"".concat(r,".").concat(s," ").concat(o)}}return null}function GI(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 Tle(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(!Rle(i[r],e[r])){t=n(i),e=i;break}return t}}function Ple(n,e){if(!e)return n;const t=ot(ot({},n),e);if("defines"in e&&(t.defines=ot(ot({},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=ot({},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 WI(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],u=e[8],h=e[9],f=e[10],g=e[11],m=e[12],w=e[13],x=e[14],U=e[15],D=t*a-i*o,ie=t*l-r*o,_e=t*c-s*o,Pe=i*l-r*a,Ne=i*c-s*a,Ve=r*c-s*l,bt=u*w-h*m,xt=u*x-f*m,At=u*U-g*m,Bt=h*x-f*w,Wt=h*U-g*w,gt=f*U-g*x,mt=D*gt-ie*Wt+_e*Bt+Pe*At-Ne*xt+Ve*bt;return mt?(n[0]=(a*gt-l*Wt+c*Bt)*(mt=1/mt),n[1]=(r*Wt-i*gt-s*Bt)*mt,n[2]=(w*Ve-x*Ne+U*Pe)*mt,n[3]=(f*Ne-h*Ve-g*Pe)*mt,n[4]=(l*At-o*gt-c*xt)*mt,n[5]=(t*gt-r*At+s*xt)*mt,n[6]=(x*_e-m*Ve-U*ie)*mt,n[7]=(u*Ve-f*_e+g*ie)*mt,n[8]=(o*Wt-a*At+c*bt)*mt,n[9]=(i*At-t*Wt-s*bt)*mt,n[10]=(m*Ne-w*_e+U*D)*mt,n[11]=(h*_e-u*Ne-g*D)*mt,n[12]=(a*xt-o*Bt-l*bt)*mt,n[13]=(t*Bt-i*xt+r*bt)*mt,n[14]=(w*ie-m*Pe-x*D)*mt,n[15]=(u*Pe-h*ie+f*D)*mt,n):null}function Ff(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],u=e[7],h=e[8],f=e[9],g=e[10],m=e[11],w=e[12],x=e[13],U=e[14],D=e[15],ie=t[0],_e=t[1],Pe=t[2],Ne=t[3];return n[0]=ie*i+_e*a+Pe*h+Ne*w,n[1]=ie*r+_e*l+Pe*f+Ne*x,n[2]=ie*s+_e*c+Pe*g+Ne*U,n[3]=ie*o+_e*u+Pe*m+Ne*D,n[4]=(ie=t[4])*i+(_e=t[5])*a+(Pe=t[6])*h+(Ne=t[7])*w,n[5]=ie*r+_e*l+Pe*f+Ne*x,n[6]=ie*s+_e*c+Pe*g+Ne*U,n[7]=ie*o+_e*u+Pe*m+Ne*D,n[8]=(ie=t[8])*i+(_e=t[9])*a+(Pe=t[10])*h+(Ne=t[11])*w,n[9]=ie*r+_e*l+Pe*f+Ne*x,n[10]=ie*s+_e*c+Pe*g+Ne*U,n[11]=ie*o+_e*u+Pe*m+Ne*D,n[12]=(ie=t[12])*i+(_e=t[13])*a+(Pe=t[14])*h+(Ne=t[15])*w,n[13]=ie*r+_e*l+Pe*f+Ne*x,n[14]=ie*s+_e*c+Pe*g+Ne*U,n[15]=ie*o+_e*u+Pe*m+Ne*D,n}function Rx(n,e,t){var o,a,l,c,u,h,f,g,m,w,x,U,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],u=e[4],h=e[5],f=e[6],g=e[7],m=e[8],w=e[9],x=e[10],U=e[11],n[0]=o=e[0],n[1]=a,n[2]=l,n[3]=c,n[4]=u,n[5]=h,n[6]=f,n[7]=g,n[8]=m,n[9]=w,n[10]=x,n[11]=U,n[12]=o*i+u*r+m*s+e[12],n[13]=a*i+h*r+w*s+e[13],n[14]=l*i+f*r+x*s+e[14],n[15]=c*i+g*r+U*s+e[15]),n}function Px(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 AU(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],u=e[9],h=e[10],f=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+u*i,n[6]=a*r+h*i,n[7]=l*r+f*i,n[8]=c*r-s*i,n[9]=u*r-o*i,n[10]=h*r-a*i,n[11]=f*r-l*i,n}function MU(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],u=e[5],h=e[6],f=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+u*i,n[2]=a*r+h*i,n[3]=l*r+f*i,n[4]=c*r-s*i,n[5]=u*r-o*i,n[6]=h*r-a*i,n[7]=f*r-l*i,n}function IU(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 Nx(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 OU(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],u=c*i+a*s-l*r,h=c*r+l*i-o*s,f=c*s+o*r-a*i,g=-o*i-a*r-l*s;return n[0]=u*c+g*-o+h*-l-f*-a,n[1]=h*c+g*-a+f*-o-u*-l,n[2]=f*c+g*-l+u*-a-h*-o,n[3]=e[3],n}!function(){var n=new ba(4);ba!=Float32Array&&(n[0]=0,n[1]=0,n[2]=0,n[3]=0)}();const RU=[0,0,0,0],rce=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0],sce=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],oce=[0,0,0],ace=[0,0,0],lce=Ox(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=RU,l=RU,c=n.cameraPosition;const{geospatialOrigin:u,shaderCoordinateOrigin:h,offsetMode:f}=PU(n,e,t);return f&&(l=n.projectPosition(u||h),c=[c[0]-l[0],c[1]-l[1],c[2]-l[2]],l[3]=1,a=Nx([],l,o),s=i||s,o=Ff([],r,s),o=Ff([],o,rce)),{viewMatrix:s,viewProjectionMatrix:o,projectionCenter:a,originCommon:l,cameraPosCommon:c,shaderCoordinateOrigin:h,geospatialOrigin:u}}(n,t,i),u=n.getDistanceScales(),h=[n.width*e,n.height*e],f=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:h,project_uDevicePixelRatio:e,project_uFocalDistance:f,project_uCommonUnitsPerMeter:u.unitsPerMeter,project_uCommonUnitsPerWorldUnit:u.unitsPerMeter,project_uCommonUnitsPerWorldUnit2:oce,project_uScale:n.scale,project_uViewProjectionMatrix:s,project_uCameraPosition:a};if(c){const m=n.getDistanceScales(c);switch(t){case Vi.METER_OFFSETS:g.project_uCommonUnitsPerWorldUnit=m.unitsPerMeter,g.project_uCommonUnitsPerWorldUnit2=m.unitsPerMeter2;break;case Vi.LNGLAT:case Vi.LNGLAT_OFFSETS:g.project_uCommonUnitsPerWorldUnit=m.unitsPerDegree,g.project_uCommonUnitsPerWorldUnit2=m.unitsPerDegree2;break;case Vi.CARTESIAN:g.project_uCommonUnitsPerWorldUnit=[1,1,m.unitsPerMeter[2]],g.project_uCommonUnitsPerWorldUnit2=[0,0,m.unitsPerMeter2[2]]}}return g});function PU(n,e,t=ace){let r,i=t,s=!0;switch(r=e===Vi.LNGLAT_OFFSETS||e===Vi.METER_OFFSETS?t:n.isGeospatial?[Math.fround(n.longitude),Math.fround(n.latitude),0]:null,n.projectionMode){case Zc.WEB_MERCATOR:(e===Vi.LNGLAT||e===Vi.CARTESIAN)&&(s=!1);break;case Zc.WEB_MERCATOR_AUTO_OFFSET:e===Vi.LNGLAT?i=r:e===Vi.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 Zc.IDENTITY:i=n.position.map(Math.fround);break;case Zc.GLOBE:s=!1,r=null;break;default:s=!1}return i[2]=i[2]||0,{geospatialOrigin:r,shaderCoordinateOrigin:i,offsetMode:s}}class hce extends mx{get ELEMENTS(){return Zu(!1),0}get RANK(){return Zu(!1),0}toString(){let e="[";if(Dr.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 qn).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 function(n,e,t,i,r){var o,s=1/Math.tan(e/2);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)}(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],u=n[9],h=n[10],f=n[11],g=n[12],m=n[13],w=n[14],x=n[15];return(e*o-t*s)*(h*x-f*w)-(e*a-i*s)*(u*x-f*m)+(e*l-r*s)*(u*w-h*m)+(t*a-i*o)*(c*x-f*g)-(t*l-r*o)*(c*w-h*g)+(i*l-r*a)*(c*m-u*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 WI(this,this),this.check()}multiplyLeft(e){return Ff(this,e,this),this.check()}multiplyRight(e){return Ff(this,this,e),this.check()}rotateX(e){return AU(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],u=e[9],h=e[10],f=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-u*i,n[2]=a*r-h*i,n[3]=l*r-f*i,n[8]=s*i+c*r,n[9]=o*i+u*r,n[10]=a*i+h*r,n[11]=l*i+f*r}(this,this,e),this.check()}rotateZ(e){return MU(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,u,h,f,g,m,w,x,U,D,ie,_e,Pe,Ne,Ve,bt,xt,At,Bt,Wt,gt,mt,jt,r=i[0],s=i[1],o=i[2],a=Math.hypot(r,s,o);at?t:n}const qI=Math.log2||function(n){return Math.log(n)*Math.LOG2E};function ed(n,e){if(!n)throw new Error(e||"@math.gl/web-mercator: assertion failed.")}const pc=Math.PI,VU=pc/4,gc=pc/180,YI=180/pc,XI=4003e4,Fx=85.051129;function Lx([n,e]){return ed(Number.isFinite(n)),ed(Number.isFinite(e)&&e>=-90&&e<=90,"invalid latitude"),[512*(n*gc+pc)/(2*pc),512*(pc+Math.log(Math.tan(VU+e*gc*.5)))/(2*pc)]}function Zg([n,e]){const t=n/512*(2*pc)-pc,i=2*(Math.atan(Math.exp(e/512*(2*pc)-pc))-VU);return[t*YI,i*YI]}function KI({latitude:n,longitude:e,highPrecision:t=!1}){ed(Number.isFinite(n)&&Number.isFinite(e));const i={},s=Math.cos(n*gc),o=512/360,a=o/s,l=512/XI/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=gc*Math.tan(n*gc)/s,h=512/XI*c,f=h/a*l;i.unitsPerDegree2=[0,o*c/2,h],i.unitsPerMeter2=[f,0,f]}return i}function jU(n,e){const[t,i,r]=n,[s,o,a]=e,{unitsPerMeter:l,unitsPerMeter2:c}=KI({longitude:t,latitude:i,highPrecision:!0}),u=Lx(n);u[0]+=s*(l[0]+c[0]*o),u[1]+=o*(l[1]+c[1]*o);const h=Zg(u),f=(r||0)+(a||0);return Number.isFinite(r)||Number.isFinite(a)?[h[0],h[1],f]:h}function zU(n){return 2*Math.atan(.5/n)*YI}function HU(n,e){const[t,i,r=0]=n;return ed(Number.isFinite(t)&&Number.isFinite(i)&&Number.isFinite(r)),Qg(e,[t,i,r,1])}function j0(n,e,t=0){const[i,r,s]=n;if(ed(Number.isFinite(i)&&Number.isFinite(r),"invalid pixel coordinate"),Number.isFinite(s))return Qg(e,[i,r,s,1]);const o=Qg(e,[i,r,0,1]),a=Qg(e,[i,r,1,1]),l=o[2],c=a[2];return kU([],o,a,l===c?0:((t||0)-l)/(c-l))}const GU=Math.PI/180;function $U(n,e,t){const{pixelUnprojectionMatrix:i}=n,r=Qg(i,[e,0,1,1]),s=Qg(i,[e,n.height,1,1]),c=Zg(kU([],r,s,(t*n.distanceScales.unitsPerMeter[2]-r[2])/(s[2]-r[2])));return c[2]=t,c}const Dce=Math.PI/180,Ice=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],ZI=[0,0,0],Rce={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?Zc.WEB_MERCATOR:Zc.WEB_MERCATOR_AUTO_OFFSET:Zc.IDENTITY}equals(t){return t instanceof n&&(this===t||t.width===this.width&&t.height===this.height&&t.scale===this.scale&&M0(t.projectionMatrix,this.projectionMatrix)&&M0(t.viewMatrix,this.viewMatrix))}project(t,{topLeft:i=!0}={}){const s=HU(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,u=j0([s,i?o:this.height-o,a],this.pixelUnprojectionMatrix,r&&r*this.distanceScales.unitsPerMeter[2]),[h,f,g]=this.unprojectPosition(u);return Number.isFinite(a)?[h,f,g]:Number.isFinite(r)?[h,f,r]:[h,f]}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?Lx(t):t}unprojectFlat(t){return this.isGeospatial?Zg(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?KI({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:u=!1,repeat:h=!1,worldOffset:f=0}=t;let{width:g,height:m,altitude:w=1.5}=t;const x=Math.pow(2,s);g=g||1,m=m||1,w=Math.max(.75,w);const{fov:U,aspect:D,focalDistance:ie,near:_e,far:Pe}=function({width:n,height:e,fovy:t=zU(1.5),altitude:i,pitch:r=0,nearZMultiplier:s=1,farZMultiplier:o=1}){void 0!==i&&(t=zU(i));const a=.5*t*gc,l=function(n){return.5/Math.tan(.5*n*gc)}(t),c=r*gc,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:n/e,focalDistance:l,near:s,far:(Math.sin(c)*u+l)*o}}({width:g,height:m,pitch:o,altitude:w,nearZMultiplier:l,farZMultiplier:c});let Ne=function({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 Rx(o,o,[0,0,-i]),AU(o,o,-e*gc),MU(o,o,t*gc),Px(o,o,[r/=n,r,r]),s&&Rx(o,o,function(n,e){return n[0]=-e[0],n[1]=-e[1],n[2]=-e[2],n}([],s)),o}({height:m,pitch:o,bearing:a,scale:x,altitude:w});f&&(Ne=(new qn).translate([512*f,0,0]).multiplyLeft(Ne)),super(Sn(ot({},t),{width:g,height:m,viewMatrix:Ne,longitude:r,latitude:i,zoom:s,orthographic:u,fovyRadians:U,aspect:D,focalDistance:ie,near:_e,far:Pe})),this.latitude=i,this.longitude=r,this.zoom=s,this.pitch=o,this.bearing=a,this.altitude=w,this.orthographic=u,this._subViewports=h?[]: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(Sn(ot({},this),{worldOffset:s})):this;this._subViewports.push(o)}}return this._subViewports}addMetersToLngLat(t,i){return jU(t,i)}panByPosition(t,i){const r=j0(i,this.pixelUnprojectionMatrix),o=kx([],this.projectFlat(t),NU([],r)),a=kx([],this.center,o),[l,c]=this.unprojectFlat(a);return{longitude:l,latitude:c}}getBounds(t={}){const i=function(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*GU:Math.atan(.5/n.altitude))>(90-n.pitch)*GU-.01?(l=$U(n,0,e),c=$U(n,t,e)):(l=r([0,0],s),c=r([t,0],s)),[o,a,c,l]}(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}=function({width:n,height:e,bounds:t,minExtent:i=0,maxZoom:r=24,padding:s=0,offset:o=[0,0]}){const[[a,l],[c,u]]=t;Number.isFinite(s)?s={top:s,bottom:s,left:s,right:s}:ed(Number.isFinite(s.top)&&Number.isFinite(s.bottom)&&Number.isFinite(s.left)&&Number.isFinite(s.right));const h=Lx([a,BU(u,-Fx,Fx)]),f=Lx([c,BU(l,-Fx,Fx)]),g=[Math.max(Math.abs(f[0]-h[0]),i),Math.max(Math.abs(f[1]-h[1]),i)],m=[n-s.left-s.right-2*Math.abs(o[0]),e-s.top-s.bottom-2*Math.abs(o[1])];ed(m[0]>0&&m[1]>0);const w=m[0]/g[0],x=m[1]/g[1],_e=Zg([(f[0]+h[0])/2+(s.right-s.left)/2/w,(f[1]+h[1])/2+(s.bottom-s.top)/2/x]),Pe=Math.min(r,qI(Math.abs(Math.min(w,x))));return ed(Number.isFinite(Pe)),{longitude:_e[0],latitude:_e[1],zoom:Pe}}(ot({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 JI(n,e,t=!1){const i=e.projectPosition(n);if(t&&e instanceof KU){const[r,s,o=0]=n,a=e.getDistanceScales([r,s]);i[2]=o*a.unitsPerMeter[2]}return i}function QU(n,{viewport:e,modelMatrix:t,coordinateSystem:i,coordinateOrigin:r,offsetMode:s}){let[o,a,l=0]=n;switch(t&&([o,a,l]=Nx([],[o,a,l,1],t)),i){case Vi.LNGLAT:return JI([o,a,l],e,s);case Vi.LNGLAT_OFFSETS:return JI([o+r[0],a+r[1],l+(r[2]||0)],e,s);case Vi.METER_OFFSETS:return JI(jU(r,[o,a,l]),e,s);case Vi.CARTESIAN:default:return e.isGeospatial?[o+r[0],a+r[1],l+r[2]]:e.projectPosition([o,a,l])}}const kce={10241:9987,10240:9729,10242:33071,10243:33071},eO={},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||z0(n)&&(3===n.length||4===n.length),equal:(n,e,t)=>tO(n,e)},accessor:{validate(n,e){const t=Bx(n);return"function"===t||t===Bx(e.value)},equal:(n,e,t)=>"function"==typeof e||tO(n,e)},array:{validate:(n,e)=>e.optional&&!n||z0(n),equal:(n,e,t)=>t.compare?tO(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 ya)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 ya(t,Sn(ot({},e),{parameters:ot(ot(ot({},kce),i),n.props.textureParameters)}));return eO[r.id]=!0,r}(t,n),release:n=>{!function(n){!n||!(n instanceof ya)||eO[n.id]&&(n.delete(),delete eO[n.id])}(n)}}};function tO(n,e){if(n===e)return!0;if(!z0(n)||!z0(e))return!1;const t=n.length;if(t!==e.length)return!1;for(let i=0;i{},this.oldProps=Qce,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[Xce]||{},i=e[Yce]||e,r=e[Kce]||{};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(Pj(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 li(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 h,c=!0,u=!1;try{for(var g,m,f=iO(t);c=(g=yield f.next()).done,m=yield g.value,!c;c=!0){const x=m,{dataTransform:U}=i.component?i.component.props:{};a=U?U(x,a):a.concat(x),Object.defineProperty(a,"__diff",{enumerable:!1,value:[{startRow:l,endRow:a.length}]}),l=a.length,i._setAsyncPropValue(e,a,o)}}catch(x){u=!0,h=x}finally{try{!c&&null!=f.return&&(yield f.return())}finally{if(u)throw h}}const w=null===(r=i.layer)||void 0===r?void 0:r.props.onDataLoad;w&&w(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:tz,ASYNC_RESOLVED:nz,ASYNC_DEFAULTS:Zce}=Ix,Jce={};let eue=0,tue=(()=>{class n{constructor(){this.props=Uce.apply(this,arguments),this.id=this.props.id,this.count=eue++,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[Zce])s in i[nz]?r[s]=i[nz][s]:s in i[tz]&&(r[s]=i[tz][s]);return new this.constructor(ot(ot(ot({},i),r),t))}get stats(){return this.internalState.stats}_initState(){this.internalState=new ez({})}}return n.componentName="Component",n.defaultProps=Jce,n})();class nue extends ez{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 mc=n=>"function"==typeof n,hh=n=>null!==n&&"object"==typeof n,rz=n=>hh(n)&&n.constructor==={}.constructor,iue=n=>n&&"function"==typeof n[Symbol.iterator],rue=n=>n&&"function"==typeof n[Symbol.asyncIterator],G0=n=>"undefined"!=typeof Response&&n instanceof Response||n&&n.arrayBuffer&&n.text&&n.json,em=n=>"undefined"!=typeof Blob&&n instanceof Blob,sz=n=>(n=>"undefined"!=typeof ReadableStream&&n instanceof ReadableStream||hh(n)&&mc(n.tee)&&mc(n.cancel)&&mc(n.getReader))(n)||(n=>hh(n)&&mc(n.read)&&mc(n.pipe)&&(n=>"boolean"==typeof n)(n.readable))(n);function Lf(n,e){if(!n)throw new Error(e||"loader assertion failed.")}function rO(n){var e;return!!n&&(Array.isArray(n)&&(n=n[0]),Array.isArray(null===(e=n)||void 0===e?void 0:e.extensions))}function sO(n){var e,t;let i;return Lf(n,"null loader"),Lf(rO(n),"invalid loader"),Array.isArray(n)&&(i=n[1],n=Sn(ot({},n=n[0]),{options:ot(ot({},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 tu={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},oO=tu.global||tu.self||tu.window||{},uue="object"!=typeof process||"[object process]"!==String(process)||process.browser,oz="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version);oz&&parseFloat(oz[1]);const lO={};function due(n){for(const e in lO)n.startsWith(e)&&(n=n.replace(e,lO[e]));return!n.startsWith("http://")&&!n.startsWith("https://")&&(n=`${n}`),n}const hue=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,fue=/^([-\w.]+\/[-\w.+]+)/;function pue(n){const e=fue.exec(n);return e?e[1]:n}function az(n){const e=hue.exec(n);return e?e[1]:""}const gue=/\?.*/;function zx(n){if(G0(n)){const e=cO(n.url||"");return{url:e,type:pue(n.headers.get("content-type")||"")||az(e)}}return em(n)?{url:cO(n.name||""),type:n.type||""}:"string"==typeof n?{url:cO(n),type:az(n)}:{url:"",type:""}}function mue(n){return G0(n)?n.headers["content-length"]||-1:em(n)?n.size:"string"==typeof n?n.length:n instanceof ArrayBuffer||ArrayBuffer.isView(n)?n.byteLength:-1}function cO(n){return n.replace(gue,"")}function lz(n){return uO.apply(this,arguments)}function uO(){return(uO=li(function*(n){if(G0(n))return n;const e={},t=mue(n);t>=0&&(e["content-length"]=String(t));const{url:i,type:r}=zx(n);r&&(e["content-type"]=r);const s=yield bue(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 _ue(n){return dO.apply(this,arguments)}function dO(){return(dO=li(function*(n){if(!n.ok){const e=yield yue(n);throw new Error(e)}})).apply(this,arguments)}function yue(n){return hO.apply(this,arguments)}function hO(){return(hO=li(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 bue(n){return fO.apply(this,arguments)}function fO(){return(fO=li(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,${vue(n.slice(0,5))}`:null})).apply(this,arguments)}function vue(n){let e="";const t=new Uint8Array(n);for(let i=0;i{}}info(){return()=>{}}warn(){return()=>{}}error(){return()=>{}}}const dz={fetch:null,mimeType:void 0,nothrow:!1,log:new class{constructor(){Kn(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:[]},xue={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 gO(){oO.loaders=oO.loaders||{};const{loaders:n}=oO;return n._state=n._state||{},n._state}const mO=()=>{const n=gO();return n.globalOptions=n.globalOptions||ot({},dz),n.globalOptions};function Sue(n,e,t,i){return t=t||[],function(n,e){fz(n,null,dz,xue,e);for(const t of e)fz(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=ot({},n.options||{});return function(n,e){e&&!("baseUri"in n)&&(n.baseUri=e)}(r,t),null===r.log&&(r.log=new wue),gz(r,mO()),gz(r,e),r}(e,n,i)}function hz(n,e){const t=mO(),i=n||t;return"function"==typeof i.fetch?i.fetch:hh(i.fetch)?r=>cz(r,i):null!=e&&e.fetch?null==e?void 0:e.fetch:cz}function fz(n,e,t,i,r){const s=e||"Top level",o=e?`${e}.`:"";for(const a in n){const l=!e&&hh(n[a]),c="baseUri"===a&&!e,u="workerUrl"===a&&e;if(!(a in t)&&!c&&!u)if(a in i)uz.warn(`${s} loader option '${o}${a}' no longer supported, use '${i[a]}'`)();else if(!l){const h=Tue(a,r);uz.warn(`${s} loader option '${o}${a}' not recognized. ${h}`)()}}}function Tue(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 gz(n,e){for(const t in e)t in e&&(n[t]=rz(e[t])&&rz(n[t])?ot(ot({},n[t]),e[t]):e[t])}function nu(n,e){if(!n)throw new Error(e||"loaders.gl assertion failed.")}function Due(n,e="3.0.12"){return nu(n,"no worker provided"),!(!e||!n.version)}const iu={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},Iue=iu.global||iu.self||iu.window||{},_O="object"!=typeof process||"[object process]"!==String(process)||process.browser,yO="function"==typeof importScripts,Oue="undefined"!=typeof window&&void 0!==window.orientation,mz="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version),bO=(mz&&parseFloat(mz[1]),new Map);function _z(n){const e=new Blob([n],{type:"application/javascript"});return URL.createObjectURL(e)}function yz(n,e=!0,t){const i=t||new Set;if(n)if(bz(n))i.add(n);else if(bz(n.buffer))i.add(n.buffer);else if(!ArrayBuffer.isView(n)&&e&&"object"==typeof n)for(const r in n)yz(n[r],e,i);return void 0===t?Array.from(i):[]}function bz(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 vO=()=>{};class vz{static isSupported(){return"undefined"!=typeof Worker}constructor(e){Kn(this,"name",void 0),Kn(this,"source",void 0),Kn(this,"url",void 0),Kn(this,"terminated",!1),Kn(this,"worker",void 0),Kn(this,"onMessage",void 0),Kn(this,"onError",void 0),Kn(this,"_loadableURL","");const{name:t,source:i,url:r}=e;nu(i||r),this.name=t,this.source=i,this.url=r,this.onMessage=vO,this.onError=s=>console.log(s),this.worker=this._createBrowserWorker()}destroy(){this.onMessage=vO,this.onError=vO,this.worker.terminate(),this.terminated=!0}get isRunning(){return Boolean(this.onMessage)}postMessage(e,t){t=t||yz(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){nu(n.source&&!n.url||!n.source&&n.url);let e=bO.get(n.source||n.url);return e||(n.url&&(e=function(n){return n.startsWith("http")?_z(function(n){return`try {\n importScripts('${n}');\n} catch (error) {\n console.error(error);\n throw error;\n}`}(n)):n}(n.url),bO.set(n.url,e)),n.source&&(e=_z(n.source),bO.set(n.source,e))),nu(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 kue{constructor(e,t){Kn(this,"name",void 0),Kn(this,"workerThread",void 0),Kn(this,"isRunning",void 0),Kn(this,"result",void 0),Kn(this,"_resolve",void 0),Kn(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){nu(this.isRunning),this.isRunning=!1,this._resolve(e)}error(e){nu(this.isRunning),this.isRunning=!1,this._reject(e)}}class Fue{constructor(e){Kn(this,"name","unnamed"),Kn(this,"source",void 0),Kn(this,"url",void 0),Kn(this,"maxConcurrency",1),Kn(this,"maxMobileConcurrency",1),Kn(this,"onDebug",()=>{}),Kn(this,"reuseWorkers",!0),Kn(this,"props",{}),Kn(this,"jobQueue",[]),Kn(this,"idleQueue",[]),Kn(this,"count",0),Kn(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=ot(ot({},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 li(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 li(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 kue(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 td{static isSupported(){return vz.isSupported()}static getWorkerFarm(e={}){return td._workerFarm=td._workerFarm||new td({}),td._workerFarm.setProps(e),td._workerFarm}constructor(e){Kn(this,"props",void 0),Kn(this,"workerPools",new Map),this.props=ot({},Lue),this.setProps(e),this.workerPools=new Map}destroy(){for(const e of this.workerPools.values())e.destroy()}setProps(e){this.props=ot(ot({},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 Fue({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 Vue(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 nu(r),r}function jue(n,e){return!!td.isSupported()&&n.worker&&(null==e?void 0:e.worker)}function Uue(n,e,t,i,r){return wO.apply(this,arguments)}function wO(){return(wO=li(function*(n,e,t,i,r){const s=n.id,o=Vue(n,t),l=td.getWorkerFarm(t).getWorkerPool({name:s,url:o});t=JSON.parse(JSON.stringify(t));const c=yield l.startJob("process-on-worker",zue.bind(null,r));return c.postMessage("process",{input:e,options:t}),yield(yield c.result).result})).apply(this,arguments)}function zue(n,e,t,i){return EO.apply(this,arguments)}function EO(){return(EO=li(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)}Kn(td,"_workerFarm",void 0);var Ez=et(9521);function xz(n){if(function(n){return n&&"object"==typeof n&&n.isBuffer}(n)&&(n=function(n){return Ez.toArrayBuffer?Ez.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 Wue(...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 Sz(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 que(n){return SO.apply(this,arguments)}function SO(){return(SO=li(function*(n){const e=[];var r,t=!0,i=!1;try{for(var o,a,s=iO(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 Wue(...e)})).apply(this,arguments)}const Kue=262144;function Cz(n){this.wrapped=n}function $0(n){return new Cz(n)}function W0(n){var e,t;function r(o,a){try{var l=n[o](a),c=l.value,u=c instanceof Cz;Promise.resolve(u?c.wrapped:c).then(function(h){u?r("return"===o?"return":"next",h):s(l.done?"return":"normal",h)},function(h){r("throw",h)})}catch(h){s("throw",h)}}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 u={key:o,arg:a,resolve:l,reject:c,next:null};t?t=t.next=u:(e=t=u,r(o,a))})},"function"!=typeof n.return&&(this.return=void 0)}function TO(n){return function(){return new W0(n.apply(this,arguments))}}function AO(){return(AO=TO(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(IO)}function rde(n,e,t){return OO.apply(this,arguments)}function OO(){return(OO=li(function*(n,e,t){const i=n instanceof ArrayBuffer||ArrayBuffer.isView(n);if("string"==typeof n||i)return ide(n,e);if(em(n)&&(n=yield lz(n)),G0(n)){const r=n;return yield _ue(r),e.binary?yield r.arrayBuffer():yield r.text()}if(sz(n)&&(n=nde(n,t)),iue(n)||rue(n))return que(n);throw new Error(IO)})).apply(this,arguments)}function ode(n,e,t=null){if(t)return t;const i=ot({fetch:hz(e,n)},n);return Array.isArray(i.loaders)||(i.loaders=null),i}function ade(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 Az=()=>{const n=gO();return n.loaderRegistry=n.loaderRegistry||[],n.loaderRegistry};function Mz(n){const e=Az();n=Array.isArray(n)?n:[n];for(const t of n){const i=sO(t);e.find(r=>i===r)||e.unshift(i)}}const cde=/\.([^.]+)$/;function ude(n){return NO.apply(this,arguments)}function NO(){return(NO=li(function*(n,e=[],t,i){if(!Iz(n))return null;let r=Dz(n,e,Sn(ot({},t),{nothrow:!0}),i);if(r)return r;if(em(n)&&(r=Dz(n=yield n.slice(0,10).arrayBuffer(),e,t,i)),!(r||null!=t&&t.nothrow))throw new Error(Oz(n));return r})).apply(this,arguments)}function Dz(n,e=[],t,i){if(!Iz(n))return null;if(e&&!Array.isArray(e))return sO(e);let r=[];e&&(r=r.concat(e)),null!=t&&t.ignoreRegisteredLoaders||r.push(...Az()),function(n){for(const e of n)sO(e)}(r);const s=function(n,e,t,i){const{url:r,type:s}=zx(n),o=r||(null==i?void 0:i.url);let a=null;return null!=t&&t.mimeType&&(a=kO(e,null==t?void 0:t.mimeType)),a=a||function(n,e){const t=e&&cde.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||kO(e,s),a=a||function(n,e){if(!e)return null;for(const t of n)if("string"==typeof e){if(mde(e,t))return t}else if(ArrayBuffer.isView(e)){if(Rz(e.buffer,e.byteOffset,t))return t}else if(e instanceof ArrayBuffer&&Rz(e,0,t))return t;return null}(e,n),a=a||kO(e,null==t?void 0:t.fallbackMimeType),a}(n,r,t,i);if(!(s||null!=t&&t.nothrow))throw new Error(Oz(n));return s}function Iz(n){return!(n instanceof Response&&204===n.status)}function Oz(n){const{url:e,type:t}=zx(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)?FO(n.buffer,n.byteOffset,e):n instanceof ArrayBuffer?FO(n,0,e):""}(n)}", contentType: "${t}"`),e&&(i+=` url: ${e}`),i}function kO(n,e){for(const t of n)if(t.mimeTypes&&t.mimeTypes.includes(e)||e===`application/x.${t.id}`)return t;return null}function mde(n,e){return e.testText?e.testText(n):(Array.isArray(e.tests)?e.tests:[e.tests]).some(i=>n.startsWith(i))}function Rz(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 ru=new Uint8ClampedArray(0);const Ade={data:{type:"data",value:Cde,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=Sn(ot({},r),{fetch:Sn(ot({},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:q0(n,i),persistent:!1}),l=!0),l?o.subscribe({resourceId:n,onChange:c=>t.internalState.reloadAsyncProp(e,c),consumerId:t.id,requestId:e}):q0(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:Vi.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 Y0=(()=>{class n extends tue{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=QU(t,{viewport:i,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem}),[s,o,a]=HU(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=ot({},n);let{coordinateSystem:t}=n;const{viewport:i,coordinateOrigin:r,fromCoordinateSystem:s,fromCoordinateOrigin:o}=n;return t===Vi.DEFAULT&&(t=i.isGeospatial?Vi.LNGLAT:Vi.CARTESIAN),void 0===s&&(e.fromCoordinateSystem=t),void 0===o&&(e.fromCoordinateOrigin=r),e.coordinateSystem=t,e}(e),{geospatialOrigin:l,shaderCoordinateOrigin:c,offsetMode:u}=PU(t,i,r),h=QU(n,{viewport:t,modelMatrix:s,coordinateSystem:o,coordinateOrigin:a,offsetMode:u});u&&function(n,e,t){n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2]}(h,h,t.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===Vi.DEFAULT||t===Vi.LNGLAT||t===Vi.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){fc(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=Ple(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 u of c)o.invalidateAll(u);else o.invalidateAll()}const l=i.highlightedObjectIndex>=0||i.pickable;if((t.highlightedObjectIndex>=0||t.pickable)!==l&&o){const{pickingColors:c,instancePickingColors:u}=o.attributes,h=c||u;h&&(l&&h.constant&&(h.constant=!1,o.invalidate(h.id)),!h.value&&!l&&(h.constant=!0,h.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||!Tde({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(ru.length/3);if(this.internalState.usesPickingColorCache=!0,rPz&&Ri.warn("Layer has too many data objects. Picking might not be able to distinguish all objects.")(),ru=A0.allocate(ru,i,{size:3,copy:!0,maxCount:Math.max(i,Pz)});const s=Math.floor(ru.length/3),o=[];for(let a=r;a{const c={moduleParameters:t,uniforms:i,parameters:r,context:this.context};for(const u of this.props.extensions)u.draw.call(this,c,u);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&&Do("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=CU({newProps:n,oldProps:e,propTypes:$I(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&&TU(n,e,"all"))return{all:!0};const t={};let i=!1;for(const r in n.updateTriggers)"all"!==r&&TU(n,e,r)&&(t[r]=!0,i=t);return i}(n,e)),{dataChanged:i,propsChanged:t,updateTriggersChanged:r,extensionsChanged:Tle(n,e),transitionsChanged:xle(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=$I(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 ple(this.context.gl,{id:this.props.id,stats:this.context.stats,timeline:this.context.timeline})}_initState(){fc(!this.internalState&&!this.state),fc(isFinite(this.props.coordinateSystem));const t=this._getAttributeManager();t&&t.addInstanced({instancePickingColors:{type:5121,size:3,noAlloc:!0,update:this.calculateInstancePickingColors}}),this.internalState=new nue({attributeManager:t,layer:this}),this.clearChangeFlags(),this.state={},Object.defineProperty(this.state,"attributeManager",{get:()=>(Ri.deprecated("layer.state.attributeManager","layer.getAttributeManager()"),t)}),this.internalState.layer=this,this.internalState.uniformTransitions=new ble(this.context.timeline),this.internalState.onAsyncPropUpdated=this._onAsyncPropUpdated.bind(this),this.internalState.setAsyncProps(this.props)}_transferState(t){Do("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=Ade,n})(),Nz=(()=>{class n extends Y0{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:u,coordinateSystem:h,coordinateOrigin:f,wrapLongitude:g,positionFormat:m,modelMatrix:w,extensions:x,fetch:U,_subLayerProps:D}=this.props,ie={opacity:i,pickable:r,visible:s,parameters:o,getPolygonOffset:a,highlightedObjectIndex:l,autoHighlight:c,highlightColor:u,coordinateSystem:h,coordinateOrigin:f,wrapLongitude:g,positionFormat:m,modelMatrix:w,extensions:x,fetch:U},_e=D&&D[t.id],Pe=_e&&_e.updateTriggers,Ne=t.id||"sublayer";if(_e){const Ve=this.constructor._propTypes,bt=t.type?t.type._propTypes:{};for(const xt in _e){const At=bt[xt]||Ve[xt];At&&"accessor"===At.type&&(_e[xt]=this.getSubLayerAccessor(_e[xt]))}}Object.assign(ie,t,_e),ie.id="".concat(this.props.id,"-").concat(Ne),ie.updateTriggers=ot(ot({all:this.props.updateTriggers.all},t.updateTriggers),Pe);for(const Ve of x){const bt=Ve.getSubLayerProps.call(this,Ve);bt&&Object.assign(ie,bt,{updateTriggers:Object.assign(ie.updateTriggers,bt.updateTriggers)})}return ie}_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=xI(t,Boolean),this.internalState.subLayers=t),Do("compositeLayer.renderLayers",this,i,t);for(const r of t)r.parent=this}}return n.layerName="CompositeLayer",n})();const Dde=/([0-9]+\.?[0-9]*)(%|px)/;function Gx(n){switch(typeof n){case"number":return{position:n,relative:!1};case"string":const e=n.match(Dde);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 $x(n,e){return n.relative?Math.round(n.position*e):n.position}function X0(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)&&X0(i,r)))return!1}return!0}class jO{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:u=1e3,modelMatrix:h=null,viewportInstance:f=null,type:g=Jg}=e;fc(!f||f instanceof Jg),this.viewportInstance=f,this.id=t||this.constructor.displayName||"view",this.type=g,this.props=Sn(ot({},e),{id:this.id,projectionMatrix:a,fovy:l,near:c,far:u,modelMatrix:h}),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):X0(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=ot({},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:$x(this._x,e),y:$x(this._y,t),width:$x(this._width,e),height:$x(this._height,t)}}_getControllerProps(e){let t=this.props.controller;return t?!0===t?e:("function"==typeof t&&(t={type:t}),ot(ot({},e),t)):null}_getViewport(e,t){const{type:i}=this;return new i(ot(ot(ot({},e),this.props),t))}_parseDimensions({x:e,y:t,width:i,height:r}){this._x=Gx(e),this._y=Gx(t),this._width=Gx(i),this._height=Gx(r)}}const K0=()=>{},kz={transitionEasing:n=>n,transitionInterruption:1,onTransitionStart:K0,onTransitionInterrupt:K0,onTransitionEnd:K0};class Ide{constructor(e,t={}){this.ControllerState=e,this.props=ot(ot({},kz),t),this.propsInTransition=null,this.transition=new B0(t.timeline),this.onViewStateChange=t.onViewStateChange||K0,this.onStateChange=t.onStateChange||K0,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=ot(ot({},kz),e),this.props=e,this._shouldIgnoreViewportChange(i,e))return t;if(this._isTransitionEnabled(e)){const{interruption:r,endProps:s}=this.transition.settings,o=ot(ot({},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(ot(ot({},this.props),c)).getViewportProps(),this.onViewStateChange({viewState:this.propsInTransition,oldViewState:this.props})}}const Fz=["longitude","latitude","zoom","bearing","pitch"],Rde=["longitude","latitude","zoom"];class Lz 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)||!M0(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];fc(Number.isFinite(i)||Array.isArray(i),"".concat(t," is required for transition"))})}}{constructor(e={}){super((Array.isArray(e)?e:e.transitionProps)||{compare:Fz,extract:Fz,required:Rde}),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]=gx(e[s]||0,t[s]||0,i);if(t.aroundPosition){const s=this.opts.makeViewport(ot(ot({},t),r));Object.assign(r,s.panByPosition(t.aroundPosition,gx(e.around,t.around,i)))}return r}}const fh={transitionDuration:0},Pde={transitionDuration:300,transitionEasing:n=>n,transitionInterruption:1},qx=n=>1-(1-n)*(1-n),tm_WHEEL=["wheel"],tm_PAN=["panstart","panmove","panend"],tm_PINCH=["pinchstart","pinchmove","pinchend"],tm_TRIPLE_PAN=["tripanstart","tripanmove","tripanend"],tm_DOUBLE_TAP=["doubletap"],tm_KEYBOARD=["keydown"];class UO{constructor(e,t={}){this.ControllerState=e,this.controllerState=null,this.controllerStateProps=null,this.eventManager=null,this.transitionManager=new Ide(e,Sn(ot({},t),{onViewStateChange:this._onTransition.bind(this),onStateChange:this._setInteractionState.bind(this)}));const i=this.linearTransitionProps;this._transition=i&&Sn(ot({},Pde),{transitionInterpolator:new Lz({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(ot(ot({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,u=Boolean(this.onViewStateChange);this.toggleEvents(tm_WHEEL,u&&i),this.toggleEvents(tm_PAN,u&&(r||s)),this.toggleEvents(tm_PINCH,u&&(a||l)),this.toggleEvents(tm_TRIPLE_PAN,u&&l),this.toggleEvents(tm_DOUBLE_TAP,u&&o),this.toggleEvents(tm_KEYBOARD,u&&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=ot(ot({},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,fh,{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,fh,{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,Sn(ot({},this._getTransitionProps()),{transitionDuration:t,transitionEasing:qx}),{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,fh,{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,Sn(ot({},this._getTransitionProps()),{transitionDuration:t,transitionEasing:qx}),{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,Sn(ot({},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,fh,{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,fh,{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,Sn(ot({},this._getTransitionProps()),{transitionDuration:t,transitionEasing:qx}),{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,fh,{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,fh,{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,Sn(ot({},this._getTransitionProps({around:r})),{transitionDuration:t,transitionEasing:qx}),{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?Sn(ot({},t),{transitionInterpolator:new Lz(Sn(ot({},e),{transitionProps:this.linearTransitionProps,makeViewport:this.controllerState.makeViewport}))}):t:fh}}class Bz{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 ph_target=[0,0,0];class Yx extends Bz{constructor({makeViewport:e,width:t,height:i,rotationX:r=0,rotationOrbit:s=0,target:o=ph_target,zoom:a=0,minRotationX:l=-90,maxRotationX:c=90,minZoom:u=-(1/0),maxZoom:h=Infinity,startPanPosition:f,startRotatePos:g,startRotationX:m,startRotationOrbit:w,startZoomPosition:x,startZoom:U}){super({width:t,height:i,rotationX:r,rotationOrbit:s,target:o,zoom:a,minRotationX:l,maxRotationX:c,minZoom:u,maxZoom:h}),this._state={startPanPosition:f,startRotatePos:g,startRotationX:m,startRotationOrbit:w,startZoomPosition:x,startZoom:U},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 u=(e[0]-r[0])/a;(s<-90||s>90)&&(u*=-1),c={rotationX:s+(e[1]-r[1])/l*180,rotationOrbit:o+180*u}}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=ot({},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(Sn(ot({},this._viewportProps),{zoom:a}));return this._getUpdatedState(ot({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),Ua(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 Yx(ot(ot(ot({},this._viewportProps),this._state),e))}_applyConstraints(e){const{maxZoom:t,minZoom:i,zoom:r,maxRotationX:s,minRotationX:o,rotationOrbit:a}=e;return e.zoom=Ua(r,i,t),e.rotationX=Ua(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 kde extends UO{constructor(e){super(Yx,e)}get linearTransitionProps(){return["target","zoom","rotationX","rotationOrbit"]}}class Fde extends UO{constructor(e){e.dragMode=e.dragMode||"pan",super(Yx,e)}_onPanRotate(e){return!1}get linearTransitionProps(){return["target","zoom"]}}const Lde=(new qn).lookAt({eye:[0,0,1]});function Bde({width:n,height:e,near:t,far:i}){return n=n||1,e=e||1,(new qn).ortho({left:-n/2,right:n/2,bottom:-e/2,top:e/2,near:t,far:i})}class Vde 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(Sn(ot({},e),{longitude:null,position:a,viewMatrix:Lde.clone().scale([c,c*(l?-1:1),c]),projectionMatrix:Bde({width:t,height:i,near:r,far:s}),zoom:o}))}panByPosition(e,t){const r=kx([],e,NU([],j0(t,this.pixelUnprojectionMatrix)));return{target:kx([],this.center,r)}}}let jde=(()=>{class n extends jO{constructor(t){super(Sn(ot({},t),{type:Vde}))}get controller(){return this._getControllerProps({type:Fde})}}return n.displayName="OrthographicView",n})();const Xx=Math.PI/180;function Ude({height:n,fovy:e,orbitAxis:t,rotationX:i,rotationOrbit:r,zoom:s}){const o=.5/Math.tan(e*Xx/2),a="Z"===t?[0,0,1]:[0,1,0],l="Z"===t?[0,-o,0]:[0,0,o],c=(new qn).lookAt({eye:l,up:a});c.rotateX(i*Xx),"Z"===t?c.rotateZ(r*Xx):c.rotateY(r*Xx);const u=Math.pow(2,s)/(n||1);return c.scale(u),c}class zde 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(Sn(ot({},e),{longitude:null,viewMatrix:Ude({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]=j0([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 Hde=(()=>{class n extends jO{constructor(t={}){const{orbitAxis:i="Z"}=t;super(Sn(ot({},t),{orbitAxis:i,type:zde}))}get controller(){return this._getControllerProps({type:kde})}}return n.displayName="OrbitView",n})();const Gde=[255,255,255],$de=1;let Wde=0;class Vz{constructor(e={}){const{color:t=Gde}=e,{intensity:i=$de}=e;this.id=e.id||"ambient-".concat(Wde++),this.color=t,this.intensity=i,this.type="ambient"}}const qde=[255,255,255],Yde=1,Xde=[0,0,-1];let Kde=0;class jz{constructor(e={}){const{color:t=qde}=e,{intensity:i=Yde}=e,{direction:r=Xde}=e,{_shadow:s=!1}=e;this.id=e.id||"directional-".concat(Kde++),this.color=t,this.intensity=i,this.type="directional",this.direction=new Mo(r).normalize().toArray(),this.shadow=s}getProjectedLight(){return this}}class Uz{constructor(e={}){const{id:t="effect"}=e;this.id=t,this.props=ot({},e)}preRender(){}getModuleParameters(){}cleanup(){}}class zO extends class{constructor(e,t={}){const{id:i="pass"}=t;this.id=i,this.gl=e,this.props=ot({},t)}setProps(e){Object.assign(this.props,e)}render(){}cleanup(){}}{render(e){return Xu(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){Xu(n,{viewport:[0,0,n.drawingBufferWidth,n.drawingBufferHeight]}),n.clear(16640)}(o);const a=[];for(const l of t){const c=l.viewport||l,u=i&&i[c.id];r(c);const h=this._getDrawLayerParams(c,e);e.view=u;const f=c.subViewports||[c];for(const g of f){e.viewport=g;const m=this._drawLayersInViewport(o,e,h);a.push(m)}}return a}_getDrawLayerParams(e,{layers:t,pass:i,layerFilter:r,effects:s,moduleParameters:o}){const a=[],l=zz(),c={viewport:e,isPicking:i.startsWith("picking"),renderPass:i};for(let u=0;ufI(e,c))}const l={totalCount:t.length,visibleCount:0,compositeCount:0,pickableCount:0};Xu(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 u=t[l]=t[l]||zz(e[l],e);c=u(r,s),t[a]=u}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 ehe extends zO{constructor(e,t){super(e,t),this.shadowMap=new ya(e,{width:1,height:1,parameters:{10241:9729,10240:9729,10242:33071,10243:33071}}),this.depthBuffer=new zg(e,{format:33189,width:1,height:1}),this.fbo=new ks(e,{id:"shadowmap",width:1,height:1,attachments:{36064:this.shadowMap,36096:this.depthBuffer}})}render(e){const t=this.fbo;hc(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(Sn(ot({},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 nhe=Object.keys(Vi).map(n=>"const int COORDINATE_SYSTEM_".concat(n," = ").concat(Vi[n],";")).join(""),ihe=Object.keys(Zc).map(n=>"const int PROJECTION_MODE_".concat(n," = ").concat(Zc[n],";")).join(""),rhe="".concat(nhe,"\n").concat(ihe,"\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"),she={},HO={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:rhe,getUniforms:function(n=she){return n.viewport?function({viewport:n,devicePixelRatio:e=1,modelMatrix:t=null,coordinateSystem:i=Vi.DEFAULT,coordinateOrigin:r,autoWrapLongitude:s=!1}={}){i===Vi.DEFAULT&&(i=n.isGeospatial?Vi.LNGLAT:Vi.CARTESIAN);const o=lce({viewport:n,devicePixelRatio:e,coordinateSystem:i,coordinateOrigin:r});return o.project_uWrapLongitude=s,o.project_uModelMatrix=t||sce,o}(n):{}}},che=Ox(function({viewport:n,center:e}){return new qn(n.viewProjectionMatrix).invert().transform(e)}),uhe=Ox(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=j0([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(u=>a.transform(u)),c=(new qn).ortho({left:Math.min(...l.map(u=>u[0])),right:Math.max(...l.map(u=>u[0])),bottom:Math.min(...l.map(u=>u[1])),top:Math.max(...l.map(u=>u[1])),near:Math.min(...l.map(u=>-u[2])),far:Math.max(...l.map(u=>-u[2]))});t.push(c.multiplyRight(o))}return t}),dhe=[0,0,0,1],hhe=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0],GO={name:"shadow",dependencies:[HO],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||dhe,shadow_uLightId:n.shadowLightId||0,shadow_uLightCount:n.shadowMatrices.length},i=che({viewport:n.viewport,center:e.project_uCenter}),r=[],s=uhe({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{}}},_he={color:[255,255,255],intensity:1},Hz=[{color:[255,255,255],intensity:1,direction:[-1,3,-1]},{color:[255,255,255],intensity:.9,direction:[1,-8,-2.5]}],yhe=[0,0,0,200/255];class $O extends Uz{constructor(e){super(e),this.ambientLight=null,this.directionalLights=[],this.pointLights=[],this.shadowColor=yhe,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=F0.getDefaultProgramManager(e),GO&&this.programManager.addDefaultModule(GO)),this.dummyShadowMap||(this.dummyShadowMap=new ya(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(GO),this.programManager=null)}_createLightMatrix(){const e=[];for(const t of this.directionalLights){const i=(new qn).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=vhe++;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 whe{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=q0(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 Ehe{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 whe(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 xhe=[{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"},HO],She=["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 Che(n){const e=F0.getDefaultProgramManager(n);for(const t of xhe)e.addDefaultModule(t);for(const t of She)e.addShaderHook(t);return e}const Mhe=Object.seal({layerManager:null,resourceManager:null,deck:null,gl:null,stats:null,shaderCache:null,pickingFBO:null,mousePosition:null,userData:{}});class Dhe{constructor(e,{deck:t,stats:i,viewport:r,timeline:s}={}){this.lastRenderedLayers=[],this.layers=[],this.resourceManager=new Ehe({gl:e,protocol:"deck://"}),this.context=Sn(ot({},Mhe),{layerManager:this,gl:e,deck:t,programManager:e&&Che(e),stats:i||new oI({id:"deck.gl"}),viewport:r||new Jg({id:"DEFAULT-INITIAL-VIEWPORT"}),timeline:s||new Gz,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){Do("layerManager.setLayers",this,t,e),this.lastRenderedLayers=e,e=xI(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 Do("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]?Ri.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&&Ri.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 Ihe{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=xI(e,Boolean),this._diffViews(e,this.views)&&this.setNeedsUpdate("views changed"),this.views=e}_setViewState(e){e?(!X0(e,this.viewState)&&this.setNeedsUpdate("viewState changed"),this.viewState=e):Ri.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)(ot({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=Sn(ot(ot(ot({},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 u=r[a.id];a.controller&&!u&&(s=!0),(s||!a.controller)&&u&&(u.finalize(),u=null),this.controllers[a.id]=this._updateController(a,l,c,u),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 Rhe extends Bz{constructor({makeViewport:e,width:t,height:i,latitude:r,longitude:s,zoom:o,bearing:a=0,pitch:l=0,altitude:c=1.5,maxZoom:u=20,minZoom:h=0,maxPitch:f=60,minPitch:g=0,startPanLngLat:m,startZoomLngLat:w,startRotatePos:x,startBearing:U,startPitch:D,startZoom:ie,normalize:_e}={}){fc(Number.isFinite(s)),fc(Number.isFinite(r)),fc(Number.isFinite(o)),super({width:t,height:i,latitude:r,longitude:s,zoom:o,bearing:a,pitch:l,altitude:c,maxZoom:u,minZoom:h,maxPitch:f,minPitch:g,normalize:_e}),this._state={startPanLngLat:m,startZoomLngLat:w,startRotatePos:x,startBearing:U,startPitch:D,startZoom:ie},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(Sn(ot({},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(Sn(ot({},this._viewportProps),{zoom:o}));return this._getUpdatedState(ot({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=ot({},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(ot(ot(ot({makeViewport:this.makeViewport},this._viewportProps),this._state),e))}_applyConstraints(e){const{maxZoom:t,minZoom:i,zoom:r}=e;e.zoom=Ua(r,i,t);const{maxPitch:s,minPitch:o,pitch:a}=e;e.pitch=Ua(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=LU(t+180,360)-180),(o<-180||o>180)&&(o=LU(o+180,360)-180);const a=qI(e/512);if(r<=a)r=a,i=0;else{const l=e/2/Math.pow(2,r),c=Zg([0,l])[1];if(iu&&(i=u)}}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 Ua(t+Math.log2(e),r,i)}_calculateNewPitchAndBearing({deltaScaleX:e,deltaScaleY:t,startBearing:i,startPitch:r}){t=Ua(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 u=0;return r>0?Math.abs(l-o)>5&&(u=r/(o-l)*1.2):r<0&&o>5&&(u=1-s/o),u=Math.min(1,Math.max(-1,u)),{deltaScaleX:c,deltaScaleY:u}}}class Phe extends UO{constructor(e){e.dragMode=e.dragMode||"pan",super(Rhe,e)}setProps(e){const t=this.controllerStateProps;super.setProps(e),(!t||t.height!==e.height)&&this.updateViewport(new this.ControllerState(ot(ot({makeViewport:this.makeViewport},this.controllerStateProps),this._state)))}get linearTransitionProps(){return["longitude","latitude","zoom","bearing","pitch"]}}let Nhe=(()=>{class n extends jO{constructor(t){super(Sn(ot({},t),{type:KU}))}get controller(){return this._getControllerProps({type:Phe})}}return n.displayName="MapView",n})();const khe=new $O;class Fhe{constructor(){this.effects=[],this._internalEffects=[],this._needsRedraw="Initial render",this.setEffects()}setProps(e){"effects"in e&&(e.effects.length!==this.effects.length||!X0(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 $O)||this._internalEffects.push(khe)}}class Lhe extends zO{}const Wz={blendFunc:[1,0,32771,0],blendEquation:32774};class qz extends zO{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:u},pass:h="picking",redrawReason:f,pickZ:g}){const m=this.gl;return this.pickZ=g,hc(m,Sn(ot({scissorTest:!0,scissor:[a,l,c,u],clearColor:[0,0,0,0],depthMask:!0,depthTest:!0,depthRange:[0,1],colorMask:[!0,!0,!0,!0]},Wz),{blend:!g}),()=>{super.render({target:o,layers:e,layerFilter:t,views:i,viewports:r,onViewportActive:s,pass:h,redrawReason:f})})}shouldDrawLayer(e){return e.props.pickable}getModuleParameters(){return{pickingActive:1,pickingAttribute:this.pickZ,lightSources:{}}}getLayerParameters(e,t){const i=this.pickZ?{blend:!1}:Sn(ot({},Wz),{blend:!0,blendColor:[0,0,0,this.useAlpha?(t+1)/255:1]});return ot(ot({},e.props.parameters),i)}}class Vhe{constructor(e){this.gl=e,this.layerFilter=null,this.drawPickingColors=!1,this.drawLayersPass=new Lhe(e),this.pickLayersPass=new qz(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||ks.getDefaultFramebuffer(this.gl),this._preRender(e.effects,e);const i=this.lastPostProcessEffect?this.renderBuffers[0]:e.target,r=t.render(Sn(ot({},e),{target:i}));this._postRender(e.effects,e),this.renderCount++,Do("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 ks(this.gl),new ks(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 jhe={pickedColor:null,pickedLayer:null,pickedObjectIndex:-1};function Uhe({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 u=r*r,h=-1,f=0;for(let g=0;gu)f+=4*l;else for(let x=0;x=0){const D=x+o-t,ie=D*D+w;ie<=u&&(u=ie,h=f)}f+=4}}if(h>=0){const g=n[h+3]-1,m=n.slice(h,h+4),w=e[g];if(w){const x=w.decodePickingColor(m),U=Math.floor(h/4/l);return{pickedColor:m,pickedLayer:w,pickedObjectIndex:x,pickedX:o+(h/4-U*l),pickedY:a+U}}Ri.error("Picked non-existent layer. Is picking buffer corrupt?")()}}return jhe}function Yz({pickInfo:n,mode:e,viewports:t,layerFilter:i,pixelRatio:r,x:s,y:o,z:a}){const l=n&&n.pickedLayer,u=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&&(f=>i({layer:l,viewport:f,isPicking:!0,renderPass:"picking:".concat(e)}))),h=u&&u.unproject([s-u.x,o-u.y],{targetZ:a});return{color:null,layer:null,viewport:u,index:-1,picked:!1,x:s,y:o,pixel:[s,o],coordinate:h,devicePixel:n&&[n.pickedX,n.pickedY],pixelRatio:r}}function Hhe(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 h=t.index,f=t.layerId,g=o&&o.props.id;if(g!==f||a!==h){if(g!==f){const m=r.find(w=>w.props.id===f);m&&l.unshift(m)}t.layerId=g,t.index=a,t.info=null}}const c=Yz(n),u=new Map;return u.set(null,c),l.forEach(h=>{let f=ot({},c);h===o&&(f.color=s,f.index=a,f.picked=!0),f=Xz({layer:h,info:f,mode:i}),h===o&&"hover"===i&&(t.info=f),u.set(f.layer.id,f),"hover"===i&&f.layer.updateAutoHighlight(f)}),u}function Xz({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 $he{constructor(e){this.gl=e,this.pickingFBO=null,this.pickLayersPass=new qz(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(f=>f.id===o):null,c=a&&r.find(f=>f.id===a)||r[0],u=c&&c.unproject([e-c.x,t-c.y]),h={x:e,y:t,viewport:c,coordinate:u,layer:l};return l?ot(ot({},s),h):Object.assign(h,{color:null,object:null,index:-1})}_resizeBuffer(){const{gl:e}=this;return this.pickingFBO||(this.pickingFBO=new ks(e),ks.isSupported(e,{colorBufferFloat:!0})&&(this.depthFBO=new ks(e),this.depthFBO.attach({36064:new ya(e,{format:Ci(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?(Ri.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:u}){if(!(e=this._getPickable(e)))return{result:[],emptyInfo:Yz({viewports:i,x:r,y:s})};this._resizeBuffer();const h=Vg(this.gl),f=iI(this.gl,[r,s],!0),g=[f.x+Math.floor(f.width/2),f.y+Math.floor(f.height/2)],m=Math.round(o*h),{width:w,height:x}=this.pickingFBO,U=this._getPickingRect({deviceX:g[0],deviceY:g[1],deviceRadius:m,deviceWidth:w,deviceHeight:x});let D;const ie=[],_e={};for(let Pe=0;Pe=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)}):Ri.error("Picked non-existent layer. Is picking buffer corrupt?")()}}}return Array.from(t.values())}({pickedColors:this._drawAndSample({layers:e,views:t,viewports:i,onViewportActive:u,deviceRect:{x:g,y:U,width:w.x+w.width-g,height:m-U},pass:"picking:".concat(l),redrawReason:l}),layers:e}),Pe=new Map,Ne=Number.isFinite(c);for(let Ve=0;Ve<_e.length&&!(Ne&&Pe.size>=c);Ve++){const bt=_e[Ve];let xt={color:bt.pickedColor,layer:null,index:bt.pickedObjectIndex,picked:!0,x:r,y:s,width:o,height:a,pixelRatio:h};xt=Xz({layer:bt.pickedLayer,info:xt,mode:l}),Pe.has(xt.object)||Pe.set(xt.object,xt)}return Array.from(Pe.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:u,y:h,width:f,height:g}=s,m=new(l?Float32Array:Uint8Array)(f*g*4);return px(c,{sourceX:u,sourceY:h,sourceWidth:f,sourceHeight:g,target:m}),m}_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 Whe={zIndex:1,position:"absolute",pointerEvents:"none",color:"#a0a7b4",backgroundColor:"#29323c",padding:"10px",top:0,left:0,display:"none"};class qhe{constructor(e){const t=e.parentElement;t&&(this.el=document.createElement("div"),this.el.className="deck-tooltip",Object.assign(this.el.style,Whe),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 Kz(n,e){if(!n)throw new Error(e)}const su={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},Qz=su.global||su.self||su.window,Xhe="object"!=typeof process||"[object process]"!==String(process)||process.browser,Zz="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version),{_parseImageNode:Khe}=(Zz&&parseFloat(Zz[1]),Qz),WO="undefined"!=typeof Image,qO="undefined"!=typeof ImageBitmap,Qhe=Boolean(Khe),YO=!!Xhe||Qhe;function Jz(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 e4(n){switch(Jz(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 efe=/^data:image\/svg\+xml/,tfe=/\.svg((\?|#).*)?$/;function XO(n){return n&&(efe.test(n)||tfe.test(n))}function nfe(n,e){if(XO(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 n4(n,e)}function n4(n,e){if(XO(e))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(n)])}function i4(n,e,t){return KO.apply(this,arguments)}function KO(){return(KO=li(function*(n,e,t){const i=nfe(n,t),r=self.URL||self.webkitURL,s="string"!=typeof i&&r.createObjectURL(i);try{return yield ife(s||i,e)}finally{s&&r.revokeObjectURL(s)}})).apply(this,arguments)}function ife(n,e){return QO.apply(this,arguments)}function QO(){return(QO=li(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 rfe={};let r4=!0;function sfe(n,e,t){return ZO.apply(this,arguments)}function ZO(){return(ZO=li(function*(n,e,t){let i;i=XO(t)?yield i4(n,e,t):n4(n,t);const r=e&&e.imagebitmap;return yield ofe(i,r)})).apply(this,arguments)}function ofe(n){return JO.apply(this,arguments)}function JO(){return(JO=li(function*(n,e=null){if((afe(e)||!r4)&&(e=null),e)try{return yield createImageBitmap(n,e)}catch(t){console.warn(t),r4=!1}return yield createImageBitmap(n)})).apply(this,arguments)}function afe(n){for(const e in n||rfe)return!1;return!0}const ou=!1,Q0=!0;function eR(n){const e=Z0(n);return function(n){const e=Z0(n);return e.byteLength>=24&&2303741511===e.getUint32(0,ou)?{mimeType:"image/png",width:e.getUint32(16,ou),height:e.getUint32(20,ou)}:null}(e)||function(n){const e=Z0(n);if(!(e.byteLength>=3&&65496===e.getUint16(0,ou)&&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,ou)?{mimeType:"image/gif",width:e.getUint16(6,Q0),height:e.getUint16(8,Q0)}:null}(e)||function(n){const e=Z0(n);return e.byteLength>=14&&16973===e.getUint16(0,ou)&&e.getUint32(2,Q0)===e.byteLength?{mimeType:"image/bmp",width:e.getUint32(18,Q0),height:e.getUint32(22,Q0)}:null}(e)}function Z0(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 ffe(n,e){const{mimeType:t}=eR(n)||{},{_parseImageNode:i}=Qz;return Kz(i),i(n,t,e)}function tR(){return(tR=li(function*(n,e,t){const r=((e=e||{}).image||{}).type||"auto",{url:s}=t||{};let a;switch(gfe(r)){case"imagebitmap":a=yield sfe(n,e,s);break;case"image":a=yield i4(n,e,s);break;case"data":a=yield ffe(n,e);break;default:Kz(!1)}return"data"===r&&(a=e4(a)),a})).apply(this,arguments)}function gfe(n){switch(n){case"auto":case"data":return function(){if(qO)return"imagebitmap";if(WO)return"image";if(YO)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}();default:return function(n){switch(n){case"auto":return qO||WO||YO;case"imagebitmap":return qO;case"image":return WO;case"data":return YO;default:throw new Error(`@loaders.gl/images: image ${n} not supported in this environment`)}}(n),n}}const nR={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 tR.apply(this,arguments)},tests:[n=>Boolean(eR(new DataView(n)))],options:{image:{type:"auto",decode:!0}}};var nm=et(4761);const _fe={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},J0="8.5.8",Kx=nm.CO.deck&&nm.CO.deck.VERSION;if(Kx&&Kx!==J0)throw new Error("deck.gl - multiple versions detected: ".concat(Kx," vs ").concat(J0));Kx||(Ri.log(1,"deck.gl ".concat(J0))(),nm.CO.deck=Object.assign(nm.CO.deck||{},{VERSION:J0,version:J0,log:Ri,_registerLoggers:function(n){AI=n}}),Mz([_fe,[nR,{imagebitmap:{premultiplyAlpha:"none"}}]]));const yfe=nm.CO.deck;class Qx extends Ku{get[Symbol.toStringTag](){return"Query"}static isSupported(e,t=[]){const i=Ci(e),r=gj(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:on(!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 Qx.isSupported(this.gl)?this.gl2.createQuery():null}_deleteHandle(){this.gl2.deleteQuery(this.handle)}}const s4=fx()&&"undefined"!=typeof document;let Mfe=0;class Dfe{constructor(e={}){const{onCreateContext:t=(x=>XV(x)),onAddHTML:i=null,onInitialize:r=(()=>{}),onRender:s=(()=>{}),onFinalize:o=(()=>{}),onError:a,gl:l=null,glOptions:c={},debug:u=!1,createFramebuffer:h=!1,autoResizeViewport:f=!0,autoResizeDrawingBuffer:g=!0,stats:m=Rf.get("animation-loop-"+Mfe++)}=e;let{useDevicePixels:w=!0}=e;"useDevicePixelRatio"in e&&(mn.deprecated("useDevicePixelRatio","useDevicePixels")(),w=e.useDevicePixelRatio),this.props={onCreateContext:t,onAddHTML:i,onInitialize:r,onRender:s,onFinalize:o,onError:a,gl:l,glOptions:c,debug:u,createFramebuffer:h},this.gl=l,this.needsRedraw=null,this.timeline=null,this.stats=m,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:f,autoResizeDrawingBuffer:g,useDevicePixels:w}),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 on("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=Qx.isSupported(this.gl,["timers"])?new Qx(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 li(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 mn.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=s4?new Promise((e,t)=>{s4&&"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?sI(this.props.gl,e):this.onCreateContext(e),!dx(this.gl))throw new Error("AnimationLoop.onCreateContext - illegal context returned");(function(n){Xu(n,nI)})(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)&&(mn.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)&&(mn.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 ks(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 Ife=et(1524),Zx=et.n(Ife);const Ofe={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}))}}(Zx().MouseInput);const kfe=Zx().Manager,au=Zx(),Ffe=au?[[au.Pan,{event:"tripan",pointers:3,threshold:0,enable:!1}],[au.Rotate,{enable:!1}],[au.Pinch,{enable:!1}],[au.Swipe,{enable:!1}],[au.Pan,{threshold:0,enable:!1}],[au.Press,{enable:!1}],[au.Tap,{event:"doubletap",taps:2,enable:!1}],[au.Tap,{event:"anytap",enable:!1}],[au.Tap,{enable:!1}]]:null,l4={tripan:["rotate","pinch","pan"],rotate:["pinch"],pinch:["pan"],pan:["press","doubletap","anytap","tap"],doubletap:["anytap"],anytap:["tap"]},Lfe={doubletap:["tap"]},Bfe={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"]},Vfe={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"},c4={click:"tap",anyclick:"anytap",dblclick:"doubletap",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup",mouseover:"pointerover",mouseout:"pointerout",mouseleave:"pointerleave"},jfe="undefined"!=typeof navigator&&navigator.userAgent?navigator.userAgent.toLowerCase():"",im="undefined"!=typeof window?window:global;"undefined"!=typeof global?global:window,"undefined"!=typeof document&&document;let u4=!1;try{const n={get passive(){return u4=!0,!0}};im.addEventListener("test",n,n),im.removeEventListener("test",n,n)}catch(n){}const Ufe=-1!==jfe.indexOf("firefox"),{WHEEL_EVENTS:zfe}=rR,h4=4.000244140625;class $fe{constructor(e,t,i={}){this.element=e,this.callback=t,this.options=Object.assign({enable:!0},i),this.events=zfe.concat(i.events||[]),this.handleEvent=this.handleEvent.bind(this),this.events.forEach(r=>e.addEventListener(r,this.handleEvent,!!u4&&{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;im.WheelEvent&&(Ufe&&e.deltaMode===im.WheelEvent.DOM_DELTA_PIXEL&&(t/=im.devicePixelRatio),e.deltaMode===im.WheelEvent.DOM_DELTA_LINE&&(t*=40));const i={x:e.clientX,y:e.clientY};0!==t&&t%h4==0&&(t=Math.floor(t/h4)),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:Wfe}=rR,f4="pointermove",p4="pointerover",g4="pointerout",m4="pointerleave";class qfe{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=Wfe.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===f4&&(this.enableMoveEvent=t),e===p4&&(this.enableOverEvent=t),e===g4&&(this.enableOutEvent=t),e===m4&&(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:p4,srcEvent:e,pointerType:"mouse",target:e.target})}handleOutEvent(e){this.enableOutEvent&&"mouseout"===e.type&&this.callback({type:g4,srcEvent:e,pointerType:"mouse",target:e.target})}handleLeaveEvent(e){this.enableLeaveEvent&&"mouseleave"===e.type&&this.callback({type:m4,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:f4,srcEvent:e,pointerType:"mouse",target:e.target});break;case"mouseup":this.pressed=!1}}}const{KEY_EVENTS:Yfe}=rR,_4="keydown";class Xfe{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=Yfe.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===_4&&(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:_4,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 b4="contextmenu";class Kfe{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===b4&&(this.options.enable=t)}handleEvent(e){!this.options.enable||this.callback({type:b4,center:{x:e.clientX,y:e.clientY},srcEvent:e,pointerType:"mouse",target:e.target})}}const Qfe={pointerdown:1,pointermove:2,pointerup:4,mousedown:1,mousemove:2,mouseup:4},v4={srcElement:"root",priority:0};class cpe{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({},v4,i):v4;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 u=l.length-1;for(;u>=0&&!(l[u].priority>=c.priority);)u--;l.splice(u+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&&l4[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 $fe(e,this._onOtherEvent,{enable:!1}),this.moveInput=new qfe(e,this._onOtherEvent,{enable:!1}),this.keyInput=new Xfe(e,this._onOtherEvent,{enable:!1,tabIndex:t.tabIndex}),this.contextmenuInput=new Kfe(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=Lfe[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 u in e)this._addEventHandler(u,e[u],i,r,s);return}const{manager:o,events:a}=this,l=c4[e]||e;let c=a.get(l);c||(c=new cpe(this),a.set(l,c),c.recognizerName=Vfe[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(c4[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=Bfe[t.type];i&&this.manager.emit(i,e)}_onOtherEvent(e){this.manager.emit(e.type,e)}}function Vf(){}const w4={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:Vf,onResize:Vf,onViewStateChange:Vf,onInteractionStateChange:Vf,onBeforeRender:Vf,onAfterRender:Vf,onLoad:Vf,onError:(n,e)=>Ri.error(n)(),_onMetrics:null,getCursor:({isDragging:n})=>n?"grabbing":"grab",debug:!1,drawPickingColors:!1};class eS{constructor(e){e=ot(ot({},w4),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&&Ri.warn("View state tracking is disabled. Use either `initialViewState` for auto update or `viewState` for manual update.")(),"IE"===(0,nm.qs)()&&Ri.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 oI({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&&A0.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&&Ri.removed("onLayerHover","onHover")(),"onLayerClick"in e&&Ri.removed("onLayerClick","onClick")(),e.initialViewState&&!X0(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](ot({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),fc(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:u,autoResizeDrawingBuffer:h}=e;return new Dfe({width:t,height:i,useDevicePixels:u,autoResizeDrawingBuffer:h,autoResizeViewport:!1,gl:r,onCreateContext:f=>XV(Sn(ot(ot({},s),f),{canvas:this.canvas,debug:o,onContextLost:()=>this._onContextLost()})),onInitialize:f=>this._setGLContext(f.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 Nhe({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,sI(e,{enable:!0,copyState:!0})),this.tooltip=new qhe(this.canvas),Xu(e,{blend:!0,blendFunc:[770,771,1,771],polygonOffsetFill:!0,depthTest:!0,depthFunc:515}),this.props.onWebGLInitialized(e);const t=new Gz;t.play(),this.animationLoop.attachTimeline(t),this.eventManager=new dpe(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 PV)this.eventManager.on(r,this._onEvent);this.viewManager=new Ihe({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 Dhe(e,{deck:this,stats:this.stats,viewport:i,timeline:t}),this.effectManager=new Fhe,this.deckRenderer=new Vhe(e),this.deckPicker=new $he(e),this.setProps(this.props),this._updateCanvasSize(),this.props.onLoad()}_drawLayers(e,t){const{gl:i}=this.layerManager.context;Xu(i,this.props.parameters),this.props.onBeforeRender({gl:i}),this.deckRenderer.renderLayers(ot({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(),Ri.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=Sn(ot({},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=PV[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=Rf.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}}eS.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(Uz)),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}},eS.defaultProps=w4,eS.VERSION=yfe.VERSION;const tS={name:"project32",dependencies:[HO],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"},gpe={pickingSelectedColor:null,pickingHighlightColor:new Uint8Array([0,255,255,255]),pickingActive:!1,pickingAttribute:!1},nS=ot({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=gpe){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}}),E4={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6};class gh{static get DRAW_MODE(){return E4}constructor(e={}){const{id:t=ma("geometry"),drawMode:i=E4.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?ot({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,on(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?(on(!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 on(Number.isFinite(i)),i}}const x4=()=>{},wpe={10241:9987,10240:9729,10242:33071,10243:33071};function Epe(n){return Math.pow(2,Math.ceil(Math.log2(n)))}function xpe(n,e,t,i){return t===e.width&&i===e.height?e:(n.canvas.height=i,n.canvas.width=t,n.clearRect(0,0,n.canvas.width,n.canvas.height),n.drawImage(e,0,0,e.width,e.height,0,0,t,i),n.canvas)}function eb(n){return n&&(n.id||n.url)}function S4(n,e,t){for(let i=0;i0){const{mapping:i,xOffset:r,yOffset:s,rowHeight:o,canvasHeight:a}=function({icons:n,buffer:e,mapping:t={},xOffset:i=0,yOffset:r=0,rowHeight:s=0,canvasWidth:o}){let a=[];for(let l=0;lo&&(S4(t,a,r),i=0,r=s+r+e,s=0,a=[]),a.push({icon:c,xOffset:i}),i=i+f+e,s=Math.max(s,h)}}return a.length>0&&S4(t,a,r),{mapping:t,rowHeight:s,xOffset:i,yOffset:r,canvasWidth:o,canvasHeight:Epe(s+r+e)}}({icons:t,buffer:this._buffer,canvasWidth:this._canvasWidth,mapping:this._mapping,rowHeight:this._rowHeight,xOffset:this._xOffset,yOffset:this._yOffset});this._rowHeight=o,this._mapping=i,this._xOffset=r,this._yOffset=s,this._canvasHeight=a,this._texture||(this._texture=new ya(this.gl,{width:this._canvasWidth,height:this._canvasHeight,parameters:wpe})),this._texture.height!==this._canvasHeight&&(this._texture=function(n,e,t,i){const r=e.width,s=e.height,o=hj(e,{width:t,height:i});return function(n,e,t={}){const{sourceX:i=0,sourceY:r=0,targetMipmaplevel:s=0,targetInternalFormat:o=6408}=t;let{targetX:a,targetY:l,targetZ:c,width:u,height:h}=t;const{framebuffer:f,deleteFramebuffer:g}=T0(n);on(f);const{gl:m,handle:w}=f,x=void 0!==a||void 0!==l||void 0!==c;a=a||0,l=l||0,c=c||0;const U=m.bindFramebuffer(36160,w);on(e);let D=null;if(e instanceof Pf&&(D=e,u=Number.isFinite(u)?u:D.width,h=Number.isFinite(h)?h:D.height,D.bind(0),e=D.target),x)switch(e){case 3553:case 34067:m.copyTexSubImage2D(e,s,a,l,i,r,u,h);break;case 35866:case 32879:Ao(m).copyTexSubImage3D(e,s,a,l,c,i,r,u,h)}else m.copyTexImage2D(e,s,o,i,r,u,h,0);D&&D.unbind(),m.bindFramebuffer(36160,U||null),g&&f.delete()}(e,o,{targetY:0,width:r,height:s}),e.delete(),o}(0,this._texture,this._canvasWidth,this._canvasHeight)),this.onUpdate(),this._loadIcons(t)}}_loadIcons(e){const t=this._canvas.getContext("2d");for(const i of e)this._pendingCount++,q0(i.url,nR,this._loadOptions).then(r=>{const s=eb(i),{x:o,y:a,width:l,height:c}=this._mapping[s],u=xpe(t,r,l,c);this._texture.setSubImageData({data:u,x:o,y:a,width:l,height:c}),this._texture.generateMipmap(),this.onUpdate()}).catch(r=>{this.onError({url:i.url,source:i.source,sourceIndex:i.sourceIndex,loadOptions:this._loadOptions,error:r})}).finally(()=>{this._pendingCount--})}}const C4=[0,0,0,255],Mpe={iconAtlas:{type:"image",value:null,async:!0},iconMapping:{type:"object",value:{},async:!0},sizeScale:{type:"number",value:1,min:0},billboard:!0,sizeUnits:"pixels",sizeMinPixels:{type:"number",min:0,value:0},sizeMaxPixels:{type:"number",min:0,value:Number.MAX_SAFE_INTEGER},alphaCutoff:{type:"number",value:.05,min:0,max:1},getPosition:{type:"accessor",value:n=>n.position},getIcon:{type:"accessor",value:n=>n.icon},getColor:{type:"accessor",value:C4},getSize:{type:"accessor",value:1},getAngle:{type:"accessor",value:0},getPixelOffset:{type:"accessor",value:[0,0]},onIconError:{type:"function",value:null,compare:!1,optional:!0}};let Dpe=(()=>{class n extends Y0{getShaders(){return super.getShaders({vs:"#define SHADER_NAME icon-layer-vertex-shader\n\nattribute vec2 positions;\n\nattribute vec3 instancePositions;\nattribute vec3 instancePositions64Low;\nattribute float instanceSizes;\nattribute float instanceAngles;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\nattribute vec4 instanceIconFrames;\nattribute float instanceColorModes;\nattribute vec2 instanceOffsets;\nattribute vec2 instancePixelOffset;\n\nuniform float sizeScale;\nuniform vec2 iconsTextureDim;\nuniform float sizeMinPixels;\nuniform float sizeMaxPixels;\nuniform bool billboard;\n\nvarying float vColorMode;\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\nvarying vec2 uv;\n\nvec2 rotate_by_angle(vec2 vertex, float angle) {\n float angle_radian = angle * PI / 180.0;\n float cos_angle = cos(angle_radian);\n float sin_angle = sin(angle_radian);\n mat2 rotationMatrix = mat2(cos_angle, -sin_angle, sin_angle, cos_angle);\n return rotationMatrix * vertex;\n}\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n geometry.uv = positions;\n geometry.pickingColor = instancePickingColors;\n uv = positions;\n\n vec2 iconSize = instanceIconFrames.zw;\n float sizePixels = clamp(\n project_size_to_pixel(instanceSizes * sizeScale), \n sizeMinPixels, sizeMaxPixels\n );\n float instanceScale = iconSize.y == 0.0 ? 0.0 : sizePixels / iconSize.y;\n vec2 pixelOffset = positions / 2.0 * iconSize + instanceOffsets;\n pixelOffset = rotate_by_angle(pixelOffset, instanceAngles) * instanceScale;\n pixelOffset += instancePixelOffset;\n pixelOffset.y *= -1.0;\n\n if (billboard) {\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, vec3(0.0), geometry.position);\n vec3 offset = vec3(pixelOffset, 0.0);\n DECKGL_FILTER_SIZE(offset, geometry);\n gl_Position.xy += project_pixel_size_to_clipspace(offset.xy);\n\n } else {\n vec3 offset_common = vec3(project_pixel_size(pixelOffset), 0.0);\n DECKGL_FILTER_SIZE(offset_common, geometry);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, offset_common, geometry.position); \n }\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n vTextureCoords = mix(\n instanceIconFrames.xy,\n instanceIconFrames.xy + iconSize,\n (positions.xy + 1.0) / 2.0\n ) / iconsTextureDim;\n\n vColor = instanceColors;\n DECKGL_FILTER_COLOR(vColor, geometry);\n\n vColorMode = instanceColorModes;\n}\n",fs:"#define SHADER_NAME icon-layer-fragment-shader\n\nprecision highp float;\n\nuniform float opacity;\nuniform sampler2D iconsTexture;\nuniform float alphaCutoff;\n\nvarying float vColorMode;\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\nvarying vec2 uv;\n\nvoid main(void) {\n geometry.uv = uv;\n\n vec4 texColor = texture2D(iconsTexture, vTextureCoords);\n vec3 color = mix(texColor.rgb, vColor.rgb, vColorMode);\n float a = texColor.a * opacity * vColor.a;\n\n if (a < alphaCutoff) {\n discard;\n }\n\n gl_FragColor = vec4(color, a);\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:[tS,nS]})}initializeState(){this.state={iconManager:new Ape(this.context.gl,{onUpdate:this._onUpdate.bind(this),onError:this._onError.bind(this)})},this.getAttributeManager().addInstanced({instancePositions:{size:3,type:5130,fp64:this.use64bitPositions(),transition:!0,accessor:"getPosition"},instanceSizes:{size:1,transition:!0,accessor:"getSize",defaultValue:1},instanceOffsets:{size:2,accessor:"getIcon",transform:this.getInstanceOffset},instanceIconFrames:{size:4,accessor:"getIcon",transform:this.getInstanceIconFrame},instanceColorModes:{size:1,type:5121,accessor:"getIcon",transform:this.getInstanceColorMode},instanceColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:!0,accessor:"getColor",defaultValue:C4},instanceAngles:{size:1,transition:!0,accessor:"getAngle"},instancePixelOffset:{size:2,transition:!0,accessor:"getPixelOffset"}})}updateState({oldProps:t,props:i,changeFlags:r}){super.updateState({props:i,oldProps:t,changeFlags:r});const s=this.getAttributeManager(),{iconAtlas:o,iconMapping:a,data:l,getIcon:c}=i,{iconManager:u}=this.state;u.setProps({loadOptions:i.loadOptions});let h=!1;if(o||this.internalState.isAsyncPropLoading("iconAtlas")?(t.iconAtlas!==i.iconAtlas&&u.setProps({iconAtlas:o,autoPacking:!1}),t.iconMapping!==i.iconMapping&&(u.setProps({iconMapping:a}),h=!0)):u.setProps({autoPacking:!0}),(r.dataChanged||r.updateTriggersChanged&&(r.updateTriggersChanged.all||r.updateTriggersChanged.getIcon))&&u.setProps({data:l,getIcon:c}),h&&(s.invalidate("instanceOffsets"),s.invalidate("instanceIconFrames"),s.invalidate("instanceColorModes")),r.extensionsChanged){var g;const{gl:m}=this.context;null===(g=this.state.model)||void 0===g||g.delete(),this.state.model=this._getModel(m),s.invalidateAll()}}get isLoaded(){return super.isLoaded&&this.state.iconManager.isLoaded}finalizeState(){super.finalizeState(),this.state.iconManager.finalize()}draw({uniforms:t}){const{sizeScale:i,sizeMinPixels:r,sizeMaxPixels:s,sizeUnits:o,billboard:a,alphaCutoff:l}=this.props,{iconManager:c}=this.state,{viewport:u}=this.context,h=c.getTexture();h&&this.state.model.setUniforms(t).setUniforms({iconsTexture:h,iconsTextureDim:[h.width,h.height],sizeScale:i*("pixels"===o?u.metersPerPixel:1),sizeMinPixels:r,sizeMaxPixels:s,billboard:a,alphaCutoff:l}).draw()}_getModel(t){return new Yg(t,Sn(ot({},this.getShaders()),{id:this.props.id,geometry:new gh({drawMode:6,attributes:{positions:{size:2,value:new Float32Array([-1,-1,-1,1,1,1,1,-1])}}}),isInstanced:!0}))}_onUpdate(){this.setNeedsRedraw()}_onError(t){const{onIconError:i}=this.getCurrentLayer().props;i?i(t):Ri.error(t.error)()}getInstanceOffset(t){const i=this.state.iconManager.getIconMapping(t);return[i.width/2-i.anchorX||0,i.height/2-i.anchorY||0]}getInstanceColorMode(t){return this.state.iconManager.getIconMapping(t).mask?1:0}getInstanceIconFrame(t){const i=this.state.iconManager.getIconMapping(t);return[i.x||0,i.y||0,i.width||0,i.height||0]}}return n.layerName="IconLayer",n.defaultProps=Mpe,n})();const A4=[],Ope={getIconOffsets:{type:"accessor",value:n=>n.offsets},alphaCutoff:.001,smoothing:.1,outlineWidth:0,outlineColor:{type:"color",value:[0,0,0,255]}};let Rpe=(()=>{class n extends Dpe{getShaders(){return Sn(ot({},super.getShaders()),{fs:"#define SHADER_NAME multi-icon-layer-fragment-shader\n\nprecision highp float;\n\nuniform float opacity;\nuniform sampler2D iconsTexture;\nuniform float gamma;\nuniform bool sdf;\nuniform float alphaCutoff;\nuniform float buffer;\nuniform float outlineBuffer;\nuniform vec4 outlineColor;\n\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\nvarying vec2 uv;\n\nvoid main(void) {\n geometry.uv = uv;\n\n if (!picking_uActive) {\n float alpha = texture2D(iconsTexture, vTextureCoords).a;\n vec4 color = vColor;\n if (sdf) {\n float distance = alpha;\n alpha = smoothstep(buffer - gamma, buffer + gamma, distance);\n\n if (outlineBuffer > 0.0) {\n float inFill = alpha;\n float inBorder = smoothstep(outlineBuffer - gamma, outlineBuffer + gamma, distance);\n color = mix(outlineColor, vColor, inFill);\n alpha = inBorder;\n }\n }\n float a = alpha * color.a;\n \n if (a < alphaCutoff) {\n discard;\n }\n\n gl_FragColor = vec4(color.rgb, a * opacity);\n }\n\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n"})}initializeState(){super.initializeState(),this.getAttributeManager().addInstanced({instanceOffsets:{size:2,accessor:"getIconOffsets"},instancePickingColors:{type:5121,size:3,accessor:(i,{index:r,target:s})=>this.encodePickingColor(r,s)}})}updateState(t){super.updateState(t);const{props:i,oldProps:r}=t;let{outlineColor:s}=i;s!==r.outlineColor&&(s=s.map(o=>o/255),s[3]=Number.isFinite(s[3])?s[3]:1,this.setState({outlineColor:s})),!i.sdf&&i.outlineWidth&&Ri.warn("".concat(this.id,": fontSettings.sdf is required to render outline"))()}draw(t){const{sdf:i,smoothing:r,outlineWidth:s}=this.props,{outlineColor:o}=this.state;t.uniforms=Sn(ot({},t.uniforms),{buffer:.75,outlineBuffer:s?Math.max(r,.75*(1-s)):-1,gamma:r,sdf:Boolean(i),outlineColor:o}),super.draw(t)}getInstanceOffset(t){return t?Array.from(t).map(i=>super.getInstanceOffset(i)):A4}getInstanceColorMode(t){return 1}getInstanceIconFrame(t){return t?Array.from(t).map(i=>super.getInstanceIconFrame(i)):A4}}return n.layerName="MultiIconLayer",n.defaultProps=Ope,n})();var Ppe=et(1002),Npe=et.n(Ppe);const Fpe=[];function Lpe(n){return Math.pow(2,Math.ceil(Math.log2(n)))}function M4(n,e,t,i){let r=0;for(let s=e;si&&(oa){let h=M4(n,a,l,r);c+h>i&&(oi&&(h=D4(n,a,l,i,r,s),o=s[s.length-1])),a=l,c+=h}}(n,r,s,t,i,o),o}function Upe(n,e,t,i,r,s){let o=0,a=0;for(let l=e;l0,u=[0,0],h=[];let f=0,g=0,m=0;for(let w=0;w<=s;w++){const x=n[w];if(("\n"===x||w===s)&&(m=w),m>g){const U=c?jpe(n,t,i,r,g,m):Fpe;for(let D=0;D<=U.length;D++){const ie=0===D?g:U[D-1],_e=Di===e);t>=0&&this._order.splice(t,1)}_appendOrder(e){this._order.push(e)}}(3),qpe=["fontFamily","fontWeight","characterSet","fontSize","sdf","buffer","cutoff","radius"];function Xpe(n,e){for(let t=0;t{o in e&&(this.props[o]=e[o])});const t=this._key;this._key=this._getKey();const i=function(n,e){const t=aR.get(n);if(!t)return e;const i=[];let s=Object.keys(t.mapping);s=new Set(s);let o=e;return o instanceof Array&&(o=new Set(o)),o.forEach(a=>{s.has(a)||i.push(a)}),i}(this._key,this.props.characterSet),r=aR.get(this._key);if(r&&0===i.length)return void(this._key!==t&&(this._atlas=r));const s=this._generateFontAtlas(this._key,i,r);this._atlas=s,aR.set(this._key,s)}_generateFontAtlas(e,t,i){const{fontFamily:r,fontWeight:s,fontSize:o,buffer:a,sdf:l,radius:c,cutoff:u}=this.props;let h=i&&i.data;h||(h=document.createElement("canvas"),h.width=1024);const f=h.getContext("2d");j4(f,r,o,s);const{mapping:g,canvasHeight:m,xOffset:w,yOffset:x}=function({characterSet:n,getFontWidth:e,fontHeight:t,buffer:i,maxCanvasWidth:r,mapping:s={},xOffset:o=0,yOffset:a=0}){let l=0,c=o,u=0;for(const f of n)if(!s[f]){const g=e(f,u++);c+g+2*i>r&&(c=0,l++),s[f]={x:c+i,y:a+l*(t+2*i)+i,width:g,height:t},c+=g+2*i}const h=t+2*i;return{mapping:s,xOffset:c,yOffset:a+l*h,canvasHeight:Lpe(a+(l+1)*h)}}(ot({getFontWidth:U=>f.measureText(U).width,fontHeight:1.2*o,buffer:a,characterSet:t,maxCanvasWidth:1024},i&&{mapping:i.mapping,xOffset:i.xOffset,yOffset:i.yOffset}));if(h.height!==m){const U=f.getImageData(0,0,h.width,h.height);h.height=m,f.putImageData(U,0,0)}if(j4(f,r,o,s),l){const U=new(Npe())(o,a,c,u,r,s),D=f.getImageData(0,0,U.size,U.size);for(const ie of t)Xpe(U.draw(ie),D),f.putImageData(D,g[ie].x-a,g[ie].y+a)}else for(const U of t)f.fillText(U,g[U].x,g[U].y+.9*o);return{xOffset:w,yOffset:x,mapping:g,data:h,width:h.width,height:h.height}}_getKey(){const{fontFamily:e,fontWeight:t,fontSize:i,buffer:r,sdf:s,radius:o,cutoff:a}=this.props;return s?"".concat(e," ").concat(t," ").concat(i," ").concat(r," ").concat(o," ").concat(a):"".concat(e," ").concat(t," ").concat(i," ").concat(r)}}const Jpe={billboard:!0,sizeScale:1,sizeUnits:"pixels",sizeMinPixels:0,sizeMaxPixels:Number.MAX_SAFE_INTEGER,padding:{type:"array",value:[0,0,0,0]},getPosition:{type:"accessor",value:n=>n.position},getSize:{type:"accessor",value:1},getAngle:{type:"accessor",value:0},getPixelOffset:{type:"accessor",value:[0,0]},getBoundingRect:{type:"accessor",value:[0,0,0,0]},getFillColor:{type:"accessor",value:[0,0,0,255]},getLineColor:{type:"accessor",value:[0,0,0,255]},getLineWidth:{type:"accessor",value:1}};let ege=(()=>{class n extends Y0{getShaders(){return super.getShaders({vs:"#define SHADER_NAME text-background-layer-vertex-shader\n\nattribute vec2 positions;\n\nattribute vec3 instancePositions;\nattribute vec3 instancePositions64Low;\nattribute vec4 instanceRects;\nattribute float instanceSizes;\nattribute float instanceAngles;\nattribute vec2 instancePixelOffsets;\nattribute float instanceLineWidths;\nattribute vec4 instanceFillColors;\nattribute vec4 instanceLineColors;\nattribute vec3 instancePickingColors;\n\nuniform bool billboard;\nuniform float opacity;\nuniform float sizeScale;\nuniform float sizeMinPixels;\nuniform float sizeMaxPixels;\nuniform vec4 padding;\n\nvarying vec4 vFillColor;\nvarying vec4 vLineColor;\nvarying float vLineWidth;\nvarying vec2 uv;\nvarying vec2 dimensions;\n\nvec2 rotate_by_angle(vec2 vertex, float angle) {\n float angle_radian = radians(angle);\n float cos_angle = cos(angle_radian);\n float sin_angle = sin(angle_radian);\n mat2 rotationMatrix = mat2(cos_angle, -sin_angle, sin_angle, cos_angle);\n return rotationMatrix * vertex;\n}\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n geometry.uv = positions;\n geometry.pickingColor = instancePickingColors;\n uv = positions;\n vLineWidth = instanceLineWidths;\n float sizePixels = clamp(\n project_size_to_pixel(instanceSizes * sizeScale),\n sizeMinPixels, sizeMaxPixels\n );\n\n dimensions = instanceRects.zw * sizePixels + padding.xy + padding.zw;\n\n vec2 pixelOffset = (positions * instanceRects.zw + instanceRects.xy) * sizePixels + mix(-padding.xy, padding.zw, positions);\n pixelOffset = rotate_by_angle(pixelOffset, instanceAngles);\n pixelOffset += instancePixelOffsets;\n pixelOffset.y *= -1.0;\n\n if (billboard) {\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, vec3(0.0), geometry.position);\n vec3 offset = vec3(pixelOffset, 0.0);\n DECKGL_FILTER_SIZE(offset, geometry);\n gl_Position.xy += project_pixel_size_to_clipspace(offset.xy);\n } else {\n vec3 offset_common = vec3(project_pixel_size(pixelOffset), 0.0);\n DECKGL_FILTER_SIZE(offset_common, geometry);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, offset_common, geometry.position);\n }\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n vFillColor = vec4(instanceFillColors.rgb, instanceFillColors.a * opacity);\n DECKGL_FILTER_COLOR(vFillColor, geometry);\n vLineColor = vec4(instanceLineColors.rgb, instanceLineColors.a * opacity);\n DECKGL_FILTER_COLOR(vLineColor, geometry);\n}\n",fs:"#define SHADER_NAME text-background-layer-fragment-shader\n\nprecision highp float;\n\nuniform bool stroked;\n\nvarying vec4 vFillColor;\nvarying vec4 vLineColor;\nvarying float vLineWidth;\nvarying vec2 uv;\nvarying vec2 dimensions;\n\nvoid main(void) {\n geometry.uv = uv;\n\n vec2 pixelPosition = uv * dimensions;\n if (stroked) {\n float distToEdge = min(\n min(pixelPosition.x, dimensions.x - pixelPosition.x),\n min(pixelPosition.y, dimensions.y - pixelPosition.y)\n );\n float isBorder = smoothedge(distToEdge, vLineWidth);\n gl_FragColor = mix(vFillColor, vLineColor, isBorder);\n } else {\n gl_FragColor = vFillColor;\n }\n\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:[tS,nS]})}initializeState(){this.getAttributeManager().addInstanced({instancePositions:{size:3,type:5130,fp64:this.use64bitPositions(),transition:!0,accessor:"getPosition"},instanceSizes:{size:1,transition:!0,accessor:"getSize",defaultValue:1},instanceAngles:{size:1,transition:!0,accessor:"getAngle"},instanceRects:{size:4,accessor:"getBoundingRect"},instancePixelOffsets:{size:2,transition:!0,accessor:"getPixelOffset"},instanceFillColors:{size:4,transition:!0,normalized:!0,type:5121,accessor:"getFillColor",defaultValue:[0,0,0,255]},instanceLineColors:{size:4,transition:!0,normalized:!0,type:5121,accessor:"getLineColor",defaultValue:[0,0,0,255]},instanceLineWidths:{size:1,transition:!0,accessor:"getLineWidth",defaultValue:1}})}updateState({props:t,oldProps:i,changeFlags:r}){if(super.updateState({props:t,oldProps:i,changeFlags:r}),r.extensionsChanged){var s;const{gl:o}=this.context;null===(s=this.state.model)||void 0===s||s.delete(),this.state.model=this._getModel(o),this.getAttributeManager().invalidateAll()}}draw({uniforms:t}){const{viewport:i}=this.context,{billboard:r,sizeScale:s,sizeUnits:o,sizeMinPixels:a,sizeMaxPixels:l,getLineWidth:c}=this.props;let{padding:u}=this.props;const h="pixels"===o?i.metersPerPixel:1;u.length<4&&(u=[u[0],u[1],u[0],u[1]]),this.state.model.setUniforms(t).setUniforms({billboard:r,stroked:Boolean(c),padding:u,sizeScale:s*h,sizeMinPixels:a,sizeMaxPixels:l}).draw()}_getModel(t){return new Yg(t,Sn(ot({},this.getShaders()),{id:this.props.id,geometry:new gh({drawMode:6,vertexCount:4,attributes:{positions:{size:2,value:new Float32Array([0,0,1,0,1,1,0,1])}}}),isInstanced:!0}))}}return n.layerName="TextBackgroundLayer",n.defaultProps=Jpe,n})();const U4={fontSize:64,buffer:4,sdf:!1,radius:12,cutoff:.25,smoothing:.1},z4={start:1,middle:0,end:-1},H4={top:1,center:0,bottom:-1},lR=[0,0,0,255],nge=["fontSize","buffer","sdf","radius","cutoff"],ige={billboard:!0,sizeScale:1,sizeUnits:"pixels",sizeMinPixels:0,sizeMaxPixels:Number.MAX_SAFE_INTEGER,background:!1,getBackgroundColor:{type:"accessor",value:[255,255,255,255]},getBorderColor:{type:"accessor",value:lR},getBorderWidth:{type:"accessor",value:0},backgroundPadding:{type:"array",value:[0,0,0,0]},characterSet:{type:"object",value:O4},fontFamily:R4,fontWeight:"normal",lineHeight:1,outlineWidth:{type:"number",value:0,min:0},outlineColor:{type:"color",value:lR},fontSettings:{},wordBreak:"break-word",maxWidth:{type:"number",value:-1},getText:{type:"accessor",value:n=>n.text},getPosition:{type:"accessor",value:n=>n.position},getColor:{type:"accessor",value:lR},getSize:{type:"accessor",value:32},getAngle:{type:"accessor",value:0},getTextAnchor:{type:"accessor",value:"middle"},getAlignmentBaseline:{type:"accessor",value:"center"},getPixelOffset:{type:"accessor",value:[0,0]},backgroundColor:{deprecatedFor:["background","getBackgroundColor"]}};let rge=(()=>{class n extends Nz{initializeState(){this.state={styleVersion:0,fontAtlasManager:new Kpe}}updateState({props:t,oldProps:i,changeFlags:r}){const o=this.state.characterSet;(r.dataChanged||r.updateTriggersChanged&&(r.updateTriggersChanged.all||r.updateTriggersChanged.getText))&&this._updateText();const a=o!==this.state.characterSet||this._fontChanged(i,t);a&&this._updateFontAtlas(i,t),(a||t.lineHeight!==i.lineHeight||t.wordBreak!==i.wordBreak||t.maxWidth!==i.maxWidth)&&this.setState({styleVersion:this.state.styleVersion+1})}getPickingInfo({info:t}){return t.object=t.index>=0?this.props.data[t.index]:null,t}_updateFontAtlas(t,i){const{fontSettings:r,fontFamily:s,fontWeight:o}=i,{fontAtlasManager:a,characterSet:l}=this.state;a.setProps(Sn(ot(ot({},U4),r),{characterSet:l,fontFamily:s,fontWeight:o}))}_fontChanged(t,i){if(t.fontFamily!==i.fontFamily||t.fontWeight!==i.fontWeight)return!0;if(t.fontSettings===i.fontSettings)return!1;const r=t.fontSettings||{},s=i.fontSettings||{};return nge.some(o=>r[o]!==s[o])}_updateText(){const{data:t,characterSet:i}=this.props,r=t.attributes&&t.attributes.getText;let a,{getText:s}=this.props,{startIndices:o}=t;const l="auto"===i&&new Set;if(r&&o){const{texts:c,characterCount:u}=function({value:n,length:e,stride:t,offset:i,startIndices:r,characterSet:s}){const o=n.BYTES_PER_ELEMENT,a=t?t/o:1,l=i?i/o:0,c=r[e]||Math.ceil((n.length-l)/a),u=s&&new Set,h=new Array(e);let f=n;if(a>1||l>0){f=new n.constructor(c);for(let g=0;gc[f]}else{const{iterable:c,objectInfo:u}=bx(t);o=[0],a=0;for(const h of c){u.index++;const f=Array.from(s(h,u)||"");l&&f.forEach(l.add,l),a+=f.length,o.push(a)}}this.setState({getText:s,startIndices:o,numInstances:a,characterSet:l||i})}getBoundingRect(t,i){const r=this.state.fontAtlasManager.mapping,{getText:s}=this.state,{wordBreak:o,maxWidth:a,lineHeight:l,getTextAnchor:c,getAlignmentBaseline:u}=this.props,h=s(t,i)||"",{size:[f,g]}=I4(h,l,o,a,r);return[(z4["function"==typeof c?c(t,i):c]-1)*f/2,(H4["function"==typeof u?u(t,i):u]-1)*g/2,f,g]}getIconOffsets(t,i){const r=this.state.fontAtlasManager.mapping,{getText:s}=this.state,{wordBreak:o,maxWidth:a,lineHeight:l,getTextAnchor:c,getAlignmentBaseline:u}=this.props,h=s(t,i)||"",{x:f,y:g,rowWidth:m,size:[w,x]}=I4(h,l,o,a,r),U=z4["function"==typeof c?c(t,i):c],D=H4["function"==typeof u?u(t,i):u],ie=f.length,_e=new Array(2*ie);let Pe=0;for(let Ne=0;Net*e/255)}const uR={name:"lights",vs:G4,fs:G4,getUniforms:function $4(n=sge){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?cR(n):[0,0,0],e.forEach((r,s)=>{i[`lighting_uPointLight[${s}].color`]=cR(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`]=cR(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 $4({lightSources:e})}return{}},defines:{MAX_LIGHTS:3}},age={};const cge={name:"phong-lighting",dependencies:[uR],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=age){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}}},dR=Math.PI/180,iS=new Float32Array(16),Y4=new Float32Array(12);function X4(n,e,t){const i=e[0]*dR,r=e[1]*dR,s=e[2]*dR,o=Math.sin(s),a=Math.sin(i),l=Math.sin(r),c=Math.cos(s),u=Math.cos(i),h=Math.cos(r),f=t[0],g=t[1],m=t[2];n[0]=f*h*u,n[1]=f*l*u,n[2]=f*-a,n[3]=g*(-l*c+h*a*o),n[4]=g*(h*c+l*a*o),n[5]=g*u*o,n[6]=m*(l*o+h*a*c),n[7]=m*(-h*o+l*a*c),n[8]=m*u*c}function K4(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 Q4={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,u=Array.isArray(s),h=Array.isArray(r),f=Array.isArray(o),g=c||!l&&Boolean(a(i[0]));n.constant=g?c:h&&u&&f;const m=n.value;if(n.constant){let w;g?(iS.set(a),w=K4(iS)):(w=Y4,X4(w,r,s),w.set(o,9)),n.value=new Float32Array(w)}else{let w=e*n.size;const{iterable:x,objectInfo:U}=bx(i,e,t);for(const D of x){let ie;U.index++,g?(iS.set(c?a:a(D,U)),ie=K4(iS)):(ie=Y4,X4(ie,h?r:r(D,U),u?s:s(D,U)),ie.set(f?o:o(D,U),9)),m[w++]=ie[0],m[w++]=ie[1],m[w++]=ie[2],m[w++]=ie[3],m[w++]=ie[4],m[w++]=ie[5],m[w++]=ie[6],m[w++]=ie[7],m[w++]=ie[8],m[w++]=ie[9],m[w++]=ie[10],m[w++]=ie[11]}}}};function Z4(n,e){return e===Vi.CARTESIAN||e===Vi.METER_OFFSETS||e===Vi.DEFAULT&&!n.isGeospatial}function J4(n,e){(n.COLOR_0||n.colors)&&e||(n.colors={constant:!0,value:new Float32Array([1,1,1])}),Ri.assert(n.positions||n.POSITION,'no "postions" or "POSITION" attribute in mesh')}function hge(n,e){if(n.attributes)return J4(n.attributes,e),n instanceof gh?n:new gh(n);if(n.positions||n.POSITION)return J4(n,e),new gh({attributes:n});throw Error("Invalid mesh")}const fge={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 pge=(()=>{class n extends Y0{getShaders(){const t=!Ci(this.context.gl),i={};return mI(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:[tS,cge,nS],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:Q4}),this.setState({emptyTexture:new ya(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||Z4(i,s),flatShading:!this.state.hasNormals}).draw()}getModel(t){const i=new Yg(this.context.gl,Sn(ot({},this.getShaders()),{id:this.props.id,geometry:hge(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=fge,n})();const eH={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:[uR]};class rm{constructor(e={}){const{id:t}=e;this.id=t||ma(this.constructor.name),this.display=!0,this.position=new Mo,this.rotation=new Mo,this.scale=new Mo(1,1,1),this.matrix=new qn,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 on(3===e.length,"setPosition requires vector argument"),this.position=e,this}setRotation(e){return on(3===e.length,"setRotation requires vector argument"),this.rotation=e,this}setScale(e){return on(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){on(e),t=t||this.matrix;const i=new qn(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 tb extends rm{constructor(e={}){e=Array.isArray(e)?{children:e}:e;const{children:t=[]}=e;mn.assert(t.every(i=>i instanceof rm),"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 qn}={}){const i=new qn(t).multiplyRight(this.matrix);for(const r of this.children)r instanceof tb?r.traverse(e,{worldMatrix:i}):e(r,{worldMatrix:i})}}function tH(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],u=e[7],h=e[8],f=t[0],g=t[1],m=t[2],w=t[3],x=t[4],U=t[5],D=t[6],ie=t[7],_e=t[8];return n[0]=f*i+g*o+m*c,n[1]=f*r+g*a+m*u,n[2]=f*s+g*l+m*h,n[3]=w*i+x*o+U*c,n[4]=w*r+x*a+U*u,n[5]=w*s+x*l+U*h,n[6]=D*i+ie*o+_e*c,n[7]=D*r+ie*a+_e*u,n[8]=D*s+ie*l+_e*h,n}function nH(n,e,t){var i=t[0],r=t[1];return n[0]=i*e[0],n[1]=i*e[1],n[2]=i*e[2],n[3]=r*e[3],n[4]=r*e[4],n[5]=r*e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n}function iH(){var n=new ba(4);return ba!=Float32Array&&(n[0]=0,n[1]=0,n[2]=0),n[3]=1,n}function rH(n){return n[0]=0,n[1]=0,n[2]=0,n[3]=1,n}function hR(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 rS(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],u=t[3];return n[0]=i*u+o*a+r*c-s*l,n[1]=r*u+o*l+s*a-i*c,n[2]=s*u+o*c+i*l-r*a,n[3]=o*u-i*a-r*l-s*c,n}function sH(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);return n[0]=i*l+o*a,n[1]=r*l+s*a,n[2]=s*l-r*a,n[3]=o*l-i*a,n}function oH(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);return n[0]=i*l-s*a,n[1]=r*l+o*a,n[2]=s*l+i*a,n[3]=o*l-r*a,n}function aH(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);return n[0]=i*l+r*a,n[1]=r*l-i*a,n[2]=s*l+o*a,n[3]=o*l-s*a,n}function lH(n,e){var t=e[0],i=e[1],r=e[2];return n[0]=t,n[1]=i,n[2]=r,n[3]=Math.sqrt(Math.abs(1-t*t-i*i-r*r)),n}function nb(n,e,t,i){var f,g,m,w,x,r=e[0],s=e[1],o=e[2],a=e[3],l=t[0],c=t[1],u=t[2],h=t[3];return(g=r*l+s*c+o*u+a*h)<0&&(g=-g,l=-l,c=-c,u=-u,h=-h),1-g>eu?(f=Math.acos(g),m=Math.sin(f),w=Math.sin((1-i)*f)/m,x=Math.sin(i*f)/m):(w=1-i,x=i),n[0]=w*r+x*l,n[1]=w*s+x*c,n[2]=w*o+x*u,n[3]=w*a+x*h,n}function cH(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;return n[0]=-t*a,n[1]=-i*a,n[2]=-r*a,n[3]=s*a,n}function uH(n,e){return n[0]=-e[0],n[1]=-e[1],n[2]=-e[2],n[3]=e[3],n}function fR(n,e){var i,t=e[0]+e[4]+e[8];if(t>0)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}return n}var dH=function(n,e,t){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n},pR=IU,gR=function(n,e){return n[0]*e[0]+n[1]*e[1]+n[2]*e[2]+n[3]*e[3]},hH=function(n,e,t,i){var r=e[0],s=e[1],o=e[2],a=e[3];return 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),n},fH=function(n){return Math.hypot(n[0],n[1],n[2],n[3])},pH=function(n){var e=n[0],t=n[1],i=n[2],r=n[3];return e*e+t*t+i*i+r*r},mH=function(){var n=bj(),e=vj(1,0,0),t=vj(0,1,0);return function(i,r,s){var o=wj(r,s);return o<-.999999?(D0(n,e,r),function(n){return Math.hypot(n[0],n[1],n[2])}(n)<1e-6&&D0(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),hR(i,n,Math.PI),i):o>.999999?(i[0]=0,i[1]=0,i[2]=0,i[3]=1,i):(D0(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))}}();iH(),iH(),function(){var n=new ba(9);ba!=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 Sge=[0,0,0,1];class mR extends mx{constructor(e=0,t=0,i=0,r=1){super(-0,-0,-0,-0),Array.isArray(e)&&1===arguments.length?this.copy(e):this.set(e,t,i,r)}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this.check()}set(e,t,i,r){return this[0]=e,this[1]=t,this[2]=i,this[3]=r,this.check()}fromMatrix3(e){return fR(this,e),this.check()}identity(){return rH(this),this.check()}fromAxisRotation(e,t){return hR(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]=nr(e)}get y(){return this[1]}set y(e){this[1]=nr(e)}get z(){return this[2]}set z(e){this[2]=nr(e)}get w(){return this[3]}set w(e){this[3]=nr(e)}len(){return fH(this)}lengthSquared(){return pH(this)}dot(e,t){if(void 0!==t)throw new Error("Quaternion.dot only takes one argument");return gR(this,e)}rotationTo(e,t){return mH(this,e,t),this.check()}add(e,t){if(void 0!==t)throw new Error("Quaternion.add only takes one argument");return dH(this,this,e),this.check()}calculateW(){return lH(this,this),this.check()}conjugate(){return uH(this,this),this.check()}invert(){return cH(this,this),this.check()}lerp(e,t,i){return hH(this,e,t,i),this.check()}multiplyRight(e,t){return Zu(!t),rS(this,this,e),this.check()}multiplyLeft(e,t){return Zu(!t),rS(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 sH(this,this,e),this.check()}rotateY(e){return oH(this,this,e),this.check()}rotateZ(e){return aH(this,this,e),this.check()}scale(e){return pR(this,this,e),this.check()}slerp(e,t,i){switch(arguments.length){case 1:({start:e=Sge,target:t,ratio:i}=arguments[0]);break;case 2:[t,i]=arguments,e=this}return nb(this,e,t,i),this.check()}transformVector4(e,t=e){return OU(t,e,this),_x(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)}}const Cge={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Tge={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function _H(n){if(!n._animation){const e=Tge[n.componentType],t=Cge[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;l{(function(n,{input:e,interpolation:t,output:i},r,s){const a=n%e[e.length-1],l=e.findIndex(f=>f>=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:mn.warn(`Bad animation path ${s}`)()}on(r[s].length===i[c].length);const u=e[c],h=e[l];switch(t){case"STEP":!function(n,e,t){for(let i=0;iu&&function(n,e,t,i,r){if("rotation"===e){_R.slerp({start:t,target:i,ratio:r});for(let s=0;s<_R.length;s++)n[e][s]=_R[s]}else for(let s=0;su&&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:_H(e.accessors[a]),interpolation:l,output:_H(e.accessors[c])})),o=t.channels.map(({sampler:a,target:l})=>({sampler:s[a],target:e.nodes[l.node],path:l.path}));return new Pge({name:r,channels:o})})}animate(e){this.setTime(e)}setTime(e){this.animations.forEach(t=>t.animate(e))}getAnimations(){return this.animations}}class kge extends rm{constructor(e,t={}){super(t),this.onBeforeRender=null,this.AfterRender=null,e instanceof Yg?(this.model=e,this._setModelNodeProps(t)):this.model=new Yg(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 Fge{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},mI(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 ya(this.gl,ot({id:e.name||e.id,parameters:ot(ot({},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&&(mn.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 yH(n,e){return Ci(n)?`#version 300 es\n${e}`:e}const jge={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Uge={modelOptions:{},pbrDebug:!1,imageBasedLightingEnvironment:null,lights:!0,useTangents:!1};class zge{constructor(e,t={}){this.gl=e,this.options=Object.assign({},Uge,t)}instantiate(e){return this.gltf=e,(e.scenes||[]).map(i=>this.createScene(i))}createAnimator(){return Array.isArray(this.gltf.animations)?new Nge(this.gltf):null}createScene(e){const i=(e.nodes||[]).map(s=>this.createNode(s));return new tb({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 tb({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 qn).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 tb({id:e.name||e.id,children:i});e._mesh=r}return e._mesh}getVertexCount(e){mn.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 Fge(n,e);mn.info(4,"createGLTFModel defines: ",a.defines)();const l=[];l.push(...a.generatedTextures),l.push(...Object.values(s).map(u=>u.buffer));const c=new kge(n,Object.assign({id:t,drawMode:i,vertexCount:r,modules:[eH],defines:a.defines,parameters:a.parameters,vs:yH(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:yH(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))),mn.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 lr(this.gl,{id:`from-${i.id}`,data:i.data||e.value,target:t})),i.lumaBuffers[t]}createAccessor(e,t){return new _a({buffer:t,offset:e.byteOffset||0,stride:e.bufferView.byteStride||0,type:e.componentType,size:jge[e.type]})}createSampler(e){return e}needsPOT(){return!1}}function bH(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 sm(i,this.metadata)}selectAt(...e){const t=e.map(i=>this.fields[i]).filter(Boolean);return new sm(t,this.metadata)}assign(e){let t,i=this.metadata;if(e instanceof sm){const o=e;t=o.fields,i=xH(xH(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 sm(s,i)}}function xH(n,e){return new Map([...n||new Map,...e||new Map])}let kr,SH,CH,TH,AH,MH,DH,IH;!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"}(kr||(kr={}));class yR{static isNull(e){return e&&e.typeId===kr.Null}static isInt(e){return e&&e.typeId===kr.Int}static isFloat(e){return e&&e.typeId===kr.Float}static isBinary(e){return e&&e.typeId===kr.Binary}static isUtf8(e){return e&&e.typeId===kr.Utf8}static isBool(e){return e&&e.typeId===kr.Bool}static isDecimal(e){return e&&e.typeId===kr.Decimal}static isDate(e){return e&&e.typeId===kr.Date}static isTime(e){return e&&e.typeId===kr.Time}static isTimestamp(e){return e&&e.typeId===kr.Timestamp}static isInterval(e){return e&&e.typeId===kr.Interval}static isList(e){return e&&e.typeId===kr.List}static isStruct(e){return e&&e.typeId===kr.Struct}static isUnion(e){return e&&e.typeId===kr.Union}static isFixedSizeBinary(e){return e&&e.typeId===kr.FixedSizeBinary}static isFixedSizeList(e){return e&&e.typeId===kr.FixedSizeList}static isMap(e){return e&&e.typeId===kr.Map}static isDictionary(e){return e&&e.typeId===kr.Dictionary}get typeId(){return kr.NONE}compareTo(e){return this===e}}Symbol,Symbol,SH=Symbol.toStringTag;class om extends yR{constructor(e,t){super(),Kn(this,"isSigned",void 0),Kn(this,"bitWidth",void 0),this.isSigned=e,this.bitWidth=t}get typeId(){return kr.Int}get[SH](){return"Int"}toString(){return`${this.isSigned?"I":"Ui"}nt${this.bitWidth}`}}class Zge extends om{constructor(){super(!0,8)}}class Jge extends om{constructor(){super(!0,16)}}class eme extends om{constructor(){super(!0,32)}}class tme extends om{constructor(){super(!1,8)}}class nme extends om{constructor(){super(!1,16)}}class ime extends om{constructor(){super(!1,32)}}CH=Symbol.toStringTag;class OH extends yR{constructor(e){super(),Kn(this,"precision",void 0),this.precision=e}get typeId(){return kr.Float}get[CH](){return"Float"}toString(){return`Float${this.precision}`}}class rme extends OH{constructor(){super(32)}}class sme extends OH{constructor(){super(64)}}Symbol,Symbol,TH=Symbol.toStringTag,AH=Symbol.toStringTag,MH=Symbol.toStringTag,DH=Symbol.toStringTag,IH=Symbol.toStringTag;class ome extends yR{constructor(e,t){super(),Kn(this,"listSize",void 0),Kn(this,"children",void 0),this.listSize=e,this.children=[t]}get typeId(){return kr.FixedSizeList}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get[IH](){return"FixedSizeList"}toString(){return`FixedSizeList[${this.listSize}]<${this.valueType}>`}}class sS{constructor(e,t,i=!1,r=new Map){Kn(this,"name",void 0),Kn(this,"type",void 0),Kn(this,"nullable",void 0),Kn(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 sS(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 RH(n,e,t){const i=t?PH(t.metadata):void 0,r=function(n){switch(n.constructor){case Int8Array:return new Zge;case Uint8Array:return new tme;case Int16Array:return new Jge;case Uint16Array:return new nme;case Int32Array:return new eme;case Uint32Array:return new ime;case Float32Array:return new rme;case Float64Array:return new sme;default:throw new Error("array type not supported")}}(e.value);return new sS(n,new ome(e.size,new sS("value",r)),!1,i)}function PH(n){const e=new Map;for(const t in n)e.set(`${t}.string`,JSON.stringify(n[t]));return e}const NH={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},ume={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array};class hme{constructor(e){Kn(this,"draco",void 0),Kn(this,"decoder",void 0),Kn(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 f=`DRACO decompression failed: ${o.error_msg()}`;throw new Error(f)}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?u:r,s=h>s?h:s,o=f>o?f:o}return[[e,t,i],[r,s,o]]}(l.attributes),u=function(n,e,t){const i=PH(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=RH(o,n[o],s[o]);r.push(l)}if(t){const o=RH("indices",t);r.push(o)}return new sm(r,i)}(l.attributes,a,l.indices);return Sn(ot({loader:"draco",loaderData:a,header:{vertexCount:s.num_points(),boundingBox:c}},l),{schema:u})}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 oS=et(9125);const ER={};function xR(n){return SR.apply(this,arguments)}function SR(){return(SR=li(function*(n,e=null,t={}){return e&&(n=_me(n,e,t)),ER[n]=ER[n]||yme(n),yield ER[n]})).apply(this,arguments)}function _me(n,e,t){if(n.startsWith("http"))return n;const i=t.modules||{};return i[n]?i[n]:_O?t.CDN?(nu(t.CDN.startsWith("http")),`${t.CDN}/${e}@3.0.12/dist/libs/${n}`):yO?`../src/libs/${n}`:`modules/${e}/src/libs/${n}`:`modules/${e}/dist/libs/${n}`}function yme(n){return CR.apply(this,arguments)}function CR(){return(CR=li(function*(n){return n.endsWith("wasm")?yield(yield fetch(n)).arrayBuffer():_O?yO?importScripts(n):bme(yield(yield fetch(n)).text(),n):oS.requireFromFile&&(yield oS.requireFromFile(n))})).apply(this,arguments)}function bme(n,e){if(!_O)return oS.requireFromString&&oS.requireFromString(n,e);if(yO)return eval.call(Iue,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 vme="https://www.gstatic.com/draco/versioned/decoders/1.4.1/draco_decoder.js",wme="https://www.gstatic.com/draco/versioned/decoders/1.4.1/draco_wasm_wrapper.js",Eme="https://www.gstatic.com/draco/versioned/decoders/1.4.1/draco_decoder.wasm";let ib;function Sme(n){return TR.apply(this,arguments)}function TR(){return(TR=li(function*(n){const e=n.modules||{};return ib=e.draco3d?ib||e.draco3d.createDecoderModule({}).then(t=>({draco:t})):ib||Cme(n),yield ib})).apply(this,arguments)}function Cme(n){return MR.apply(this,arguments)}function MR(){return(MR=li(function*(n){let e,t;switch(n.draco&&n.draco.decoderType){case"js":e=yield xR(vme,"draco",n);break;case"wasm":default:[e,t]=yield Promise.all([yield xR(wme,"draco",n),yield xR(Eme,"draco",n)])}return e=e||globalThis.DracoDecoderModule,yield Tme(e,t)})).apply(this,arguments)}function Tme(n,e){const t={};return e&&(t.wasmBinary=e),new Promise(i=>{n(Sn(ot({},t),{onModuleLoaded:r=>i({draco:r})}))})}const IR=Sn(ot({},EH),{parse:function(n,e){return OR.apply(this,arguments)}});function OR(){return(OR=li(function*(n,e){const{draco:t}=yield Sme(e),i=new hme(t);try{return i.parseSync(n,null==e?void 0:e.draco)}finally{i.destroy()}})).apply(this,arguments)}function sb(n,e){return Lf(n>=0),Lf(e>0),n+(e-1)&~(e-1)}function Dme(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+sb(i.byteLength,4)}const kH=["SCALAR","VEC2","VEC3","VEC4"],Ime=[[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Uint32Array,5125],[Float32Array,5126],[Float64Array,5130]],Ome=new Map(Ime),Rme={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Pme={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},Nme={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function FH(n){return kH[n-1]||kH[0]}function LH(n){const e=Ome.get(n.constructor);if(!e)throw new Error("Illegal typed array");return e}function BH(n,e){const t=Nme[n.componentType],i=Rme[n.type],s=n.count*i,o=n.count*i*Pme[n.componentType];return $a(o>=0&&o<=e.byteLength),{ArrayType:t,length:s,byteLength:o}}const kme={asset:{version:"2.0",generator:"loaders.gl"},buffers:[]};class _h{constructor(e){Kn(this,"gltf",void 0),Kn(this,"sourceBuffers",void 0),Kn(this,"byteLength",void 0),this.gltf=e||{json:ot({},kme),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 $a(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}=BH(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 $a(t),this.json.extensions=this.json.extensions||{},this.json.extensions[e]=t,this.registerUsedExtension(e),t}addRequiredExtension(e,t={}){return $a(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=eR(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;$a(Number.isFinite(t)),this.sourceBuffers=this.sourceBuffers||[],this.sourceBuffers.push(e);const i={buffer:0,byteOffset:this.byteLength,byteLength:t};return this.byteLength+=sb(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:FH(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:LH(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=Dme(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*Wme(n){for(const e of n.json.meshes||[])for(const t of e.primitives)yield t}function qme(n){return NR.apply(this,arguments)}function NR(){return(NR=li(function*(n){const e=new _h(n),{json:t}=e;e.removeExtension(lS);for(const i of t.materials||[])i.extensions&&i.extensions.KHR_materials_unlit&&(i.unlit=!0),e.removeObjectExtension(i,lS)})).apply(this,arguments)}function Yme(n){const e=new _h(n),{json:t}=e;if(e.materials)for(const i of t.materials||[])i.unlit&&(delete i.unlit,e.addObjectExtension(i,lS,{}),e.addExtension(lS))}function Xme(n){return kR.apply(this,arguments)}function kR(){return(kR=li(function*(n){const e=new _h(n),{json:t}=e,i=e.getExtension(am);i&&(e.json.lights=i.lights,e.removeExtension(am));for(const r of t.nodes||[]){const s=e.getObjectExtension(r,am);s&&(r.light=s.light),e.removeObjectExtension(r,am)}})).apply(this,arguments)}function Kme(n){return FR.apply(this,arguments)}function FR(){return(FR=li(function*(n){const e=new _h(n),{json:t}=e;if(t.lights){const i=e.addExtension(am);$a(!i.lights),i.lights=t.lights,delete t.lights}if(e.json.lights){for(const i of e.json.lights)e.addObjectExtension(i.node,am,i);delete e.json.lights}})).apply(this,arguments)}function Qme(n){return LR.apply(this,arguments)}function LR(){return(LR=li(function*(n){const e=new _h(n),{json:t}=e,i=e.getExtension(cS);if(i){const r=Jme(i,e);for(const s of t.materials||[]){const o=e.getObjectExtension(s,cS);o&&(s.technique=Object.assign({},o,r[o.technique]),s.technique.values=e_e(s.technique,e)),e.removeObjectExtension(s,cS)}e.removeExtension(cS)}})).apply(this,arguments)}function Zme(n,e){return BR.apply(this,arguments)}function BR(){return(BR=li(function*(n,e){})).apply(this,arguments)}function Jme(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 e_e(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 UH={KHR_draco_mesh_compression:yt,KHR_materials_unlit:ee,KHR_lights_punctual:Dt,KHR_techniques_webgl:dt};function t_e(n){return VR.apply(this,arguments)}function VR(){return(VR=li(function*(n,e={},t){for(const r in UH){var i;const s=(null==e||null===(i=e.gltf)||void 0===i?void 0:i.excludeExtensions)||{};r in s&&!s[r]||(yield UH[r].decode(n,e,t))}})).apply(this,arguments)}const zH={accessors:"accessor",animations:"animation",buffers:"buffer",bufferViews:"bufferView",images:"image",materials:"material",meshes:"mesh",nodes:"node",samplers:"sampler",scenes:"scene",skins:"skin",textures:"texture"},i_e={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 r_e{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 _h(n),{json:t}=e;for(const i of t.images||[]){const r=e.removeObjectExtension(i,VH);r&&Object.assign(i,r)}t.buffers&&t.buffers[0]&&delete t.buffers[0].uri,e.removeExtension(VH)}(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 zH)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 zH)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=i_e[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 s_e(n,e={}){return(new r_e).normalize(n,e)}const o_e={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},a_e={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},Ml={TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,REPEAT:10497,LINEAR:9729,NEAREST_MIPMAP_LINEAR:9986},l_e={magFilter:Ml.TEXTURE_MAG_FILTER,minFilter:Ml.TEXTURE_MIN_FILTER,wrapS:Ml.TEXTURE_WRAP_S,wrapT:Ml.TEXTURE_WRAP_T},c_e={[Ml.TEXTURE_MAG_FILTER]:Ml.LINEAR,[Ml.TEXTURE_MIN_FILTER]:Ml.NEAREST_MIPMAP_LINEAR,[Ml.TEXTURE_WRAP_S]:Ml.REPEAT,[Ml.TEXTURE_WRAP_]:Ml.REPEAT};class h_e{postProcess(e,t={}){const{json:i,buffers:r=[],images:s=[],baseUri:o=""}=e;return $a(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=ot({},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=ot({},e.normalTexture),e.normalTexture.texture=this.getTexture(e.normalTexture.index)),e.occlusionTexture&&(e.occlustionTexture=ot({},e.occlustionTexture),e.occlusionTexture.texture=this.getTexture(e.occlusionTexture.index)),e.emissiveTexture&&(e.emmisiveTexture=ot({},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=ot({},e.pbrMetallicRoughness);const i=e.pbrMetallicRoughness;i.baseColorTexture&&(i.baseColorTexture=ot({},i.baseColorTexture),i.baseColorTexture.texture=this.getTexture(i.baseColorTexture.index)),i.metallicRoughnessTexture&&(i.metallicRoughnessTexture=ot({},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 a_e[n]}(e.componentType),e.components=function(n){return o_e[n]}(e.type),e.bytesPerElement=e.bytesPerComponent*e.components,e.bufferView){const i=e.bufferView.buffer,{ArrayType:r,byteLength:s}=BH(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):c_e,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 l_e[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 f_e(n,e){return(new h_e).postProcess(n,e)}const HH=1735152710,lm=!0;function UR(n,e,t,i){const r=new Uint8Array(e.buffer,t,i),o=new TextDecoder("utf8").decode(r);return n.json=JSON.parse(o),sb(i,4)}function zR(n,e,t,i){return n.header.hasBinChunk=!0,n.binChunks.push({byteOffset:t,byteLength:i,arrayBuffer:e.buffer}),sb(i,4)}function C_e(n,e){return HR.apply(this,arguments)}function HR(){return(HR=li(function*(n,e,t=0,i,r){var s,o,a,l;T_e(n,e,t,i),s_e(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 A_e(n,i,r)),null!=i&&null!==(a=i.gltf)&&void 0!==a&&a.loadImages){const h=M_e(n,i,r);c.push(h)}const u=t_e(n,i,r);return c.push(u),yield Promise.all(c),null!=i&&null!==(l=i.gltf)&&void 0!==l&&l.postProcess?f_e(n,i):n})).apply(this,arguments)}function T_e(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=HH}=t,s=i.getUint32(e,!1);return s===r||s===HH}(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)?bH(n.buffer,n.byteOffset,e):n instanceof ArrayBuffer?bH(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,lm),a=r.getUint32(t+8,lm);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){Lf(n.header.byteLength>20);const i=e.getUint32(t+0,lm),r=e.getUint32(t+4,lm);return t+=8,Lf(0===r),UR(n,e,t,i),(t+=i)+zR(n,e,t,n.header.byteLength)}(n,r,t);case 2:return function(n,e,t,i){return Lf(n.header.byteLength>20),function(n,e,t,i){for(;t+8<=n.header.byteLength;){const r=e.getUint32(t+0,lm),s=e.getUint32(t+4,lm);switch(t+=8,s){case 1313821514:UR(n,e,t,r);break;case 5130562:zR(n,e,t,r);break;case 0:i.strict||UR(n,e,t,r);break;case 1:i.strict||zR(n,e,t,r)}t+=sb(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),$a("glTF"===o.type,`Invalid GLB magic string ${o.type}`),n._glb=o,n.json=o.json}else $a(!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 A_e(n,e,t){return GR.apply(this,arguments)}function GR(){return(GR=li(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 R_e(()=>e.some(t=>!t.loaded))})).apply(this,arguments)}function R_e(n){return XR.apply(this,arguments)}function XR(){return(XR=li(function*(n){for(;n();)yield new Promise(e=>requestAnimationFrame(e))})).apply(this,arguments)}const GH=[255,255,255,255],k_e={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:GH},_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:[cm]};let F_e=(()=>{class n extends Y0{getShaders(){const t=[tS,nS];return"pbr"===this.props._lighting&&t.push(eH),{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:GH,transition:!0},instanceModelMatrix:Q4})}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 rm)r={scenes:[t.scenegraph]};else if(t.scenegraph&&!t.scenegraph.gltf){const l=t.scenegraph,c=function(n,e,t){const i=new zge(n,t);return{scenes:i.instantiate(e),animator:i.createAnimator()}}(i,l,this._getModelOptions());r=ot({gltf:l},c),function(n){return YR.apply(this,arguments)}(c).then(()=>this.setNeedsRedraw())}else t.scenegraph&&(Ri.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 rm?(this._deleteScenegraph(),this._applyAllAttributes(o),this._applyAnimationsProp(o,a,t._animations),this.setState({scenegraph:o,animator:a})):null!==o&&Ri.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):Ri.warn("animation ".concat(o," not found"))()}})}_deleteScenegraph(){const{scenegraph:t}=this.state;t instanceof rm&&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:ot({isInstanced:!0,transpileToGLSL100:!Ci(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:u}=this.props,h=this.getNumInstances();this.state.scenegraph.traverse((f,{worldMatrix:g})=>{f.model.setInstanceCount(h),f.updateModuleSettings(t),f.draw({parameters:i,uniforms:{sizeScale:o,opacity:c,sizeMinPixels:a,sizeMaxPixels:l,composeModelMatrix:Z4(s,u),sceneModelMatrix:g,u_Camera:f.model.getUniforms().project_uCameraPosition}})})}}return n.layerName="ScenegraphLayer",n.defaultProps=k_e,n})();class L_e extends gh{constructor(e={}){const{id:t=ma("sphere-geometry")}=e,{indices:i,attributes:r}=function(n){const{nlat:e=10,nlong:t=10}=n;let{radius:i=1}=n;const o=Math.PI-0,c=2*Math.PI-0,u=(e+1)*(t+1);if("number"==typeof i){const U=i;i=(D,ie,_e,Pe,Ne)=>U}const h=new Float32Array(3*u),f=new Float32Array(3*u),g=new Float32Array(2*u),w=new(u>65535?Uint32Array:Uint16Array)(e*t*6);for(let U=0;U<=e;U++)for(let D=0;D<=t;D++){const ie=D/t,_e=U/e,Pe=D+U*(t+1),Ne=2*Pe,Ve=3*Pe,bt=c*ie,xt=o*_e,At=Math.sin(bt),Bt=Math.cos(bt),Wt=Math.sin(xt),mt=Bt*Wt,jt=Math.cos(xt),ft=At*Wt,Yt=i(mt,jt,ft,ie,_e);h[Ve+0]=Yt*mt,h[Ve+1]=Yt*jt,h[Ve+2]=Yt*ft,f[Ve+0]=mt,f[Ve+1]=jt,f[Ve+2]=ft,g[Ne+0]=ie,g[Ne+1]=1-_e}const x=t+1;for(let U=0;Us?(gt=i,Wt=1,mt=t):mt=e+Bt/s*(t-e),(-2===Bt||Bt===s+2)&&(mt=0,Wt=0),gt-=i/2;for(let jt=0;jts?0:ft*w,Ve[xt+Pe[1]]=Bt<0?-1:Bt>s?1:x,Ve[xt+Pe[2]]=Bt<0||Bt>s?0:Yt*w,bt[At+0]=jt/r,bt[At+1]=Wt,At+=2,xt+=3}}for(let Bt=0;Bt0){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 ce){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 ce){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 ce){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 ce){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 ce){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=K_e,s=1/i;r.set(this.x*s,this.y*s,this.z*s);const o=Q_e;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(WH),WH.almostEquals(e,t)}clone(){return new ce(this.x,this.y,this.z)}}ce.ZERO=void 0,ce.UNIT_X=void 0,ce.UNIT_Y=void 0,ce.UNIT_Z=void 0,ce.ZERO=new ce(0,0,0),ce.UNIT_X=new ce(1,0,0),ce.UNIT_Y=new ce(0,1,0),ce.UNIT_Z=new ce(0,0,1);const K_e=new ce,Q_e=new ce,WH=new ce;class pr{constructor(e={}){this.lowerBound=void 0,this.upperBound=void 0,this.lowerBound=new ce,this.upperBound=new ce,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,u=this.upperBound;e.copy(c),t.set(u.x,c.y,c.z),i.set(u.x,u.y,c.z),r.set(c.x,u.y,u.z),s.set(u.x,c.y,u.z),o.set(c.x,u.y,c.z),a.set(c.x,c.y,u.z),l.copy(u)}toLocalFrame(e,t){const i=YH;this.getCorners(i[0],i[1],i[2],i[3],i[4],i[5],i[6],i[7]);for(let f=0;8!==f;f++){const g=i[f];e.pointToLocal(g,g)}return t.setFromPoints(i)}toWorldFrame(e,t){const i=YH;this.getCorners(i[0],i[1],i[2],i[3],i[4],i[5],i[6],i[7]);for(let f=0;8!==f;f++){const g=i[f];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,u=(this.upperBound.y-i.y)*s,h=(this.lowerBound.z-i.z)*o,f=(this.upperBound.z-i.z)*o,g=Math.max(Math.max(Math.min(a,l),Math.min(c,u)),Math.min(h,f)),m=Math.min(Math.min(Math.max(a,l),Math.max(c,u)),Math.max(h,f));return!(m<0||g>m)}}const qH=new ce,YH=[new ce,new ce,new ce,new ce,new ce,new ce,new ce,new ce];class us{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 ce){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=J_e;e.tangents(i,eye),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(Er(e.length(),2)*Er(t.length(),2))+e.dot(t),this.normalize()}return this}mult(e,t=new us){const i=this.x,r=this.y,s=this.z,o=this.w,a=e.x,l=e.y,c=e.z,u=e.w;return t.x=i*u+o*a+r*c-s*l,t.y=r*u+o*l+s*a-i*c,t.z=s*u+o*c+i*l-r*a,t.w=o*u-i*a-r*l-s*c,t}inverse(e=new us){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 us){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 ce){const i=e.x,r=e.y,s=e.z,o=this.x,a=this.y,l=this.z,c=this.w,u=c*i+a*s-l*r,h=c*r+l*i-o*s,f=c*s+o*r-a*i,g=-o*i-a*r-l*s;return t.x=u*c+g*-o+h*-l-f*-a,t.y=h*c+g*-a+f*-o-u*-l,t.z=f*c+g*-l+u*-a-h*-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 u=o*a+l*c;if(u>.499&&(i=2*Math.atan2(o,c),r=Math.PI/2,s=0),u<-.499&&(i=-2*Math.atan2(o,c),r=-Math.PI/2,s=0),void 0===i){const h=o*o,g=l*l;i=Math.atan2(2*a*c-2*o*l,1-a*a*2-2*g),r=Math.asin(2*u),s=Math.atan2(2*o*c-2*a*l,1-2*h-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),u=Math.sin(i/2);return"XYZ"===r?(this.x=l*o*a+s*c*u,this.y=s*c*a-l*o*u,this.z=s*o*u+l*c*a,this.w=s*o*a-l*c*u):"YXZ"===r?(this.x=l*o*a+s*c*u,this.y=s*c*a-l*o*u,this.z=s*o*u-l*c*a,this.w=s*o*a+l*c*u):"ZXY"===r?(this.x=l*o*a-s*c*u,this.y=s*c*a+l*o*u,this.z=s*o*u+l*c*a,this.w=s*o*a-l*c*u):"ZYX"===r?(this.x=l*o*a-s*c*u,this.y=s*c*a+l*o*u,this.z=s*o*u-l*c*a,this.w=s*o*a+l*c*u):"YZX"===r?(this.x=l*o*a+s*c*u,this.y=s*c*a+l*o*u,this.z=s*o*u-l*c*a,this.w=s*o*a-l*c*u):"XZY"===r&&(this.x=l*o*a-s*c*u,this.y=s*c*a-l*o*u,this.z=s*o*u+l*c*a,this.w=s*o*a+l*c*u),this}clone(){return new us(this.x,this.y,this.z,this.w)}slerp(e,t,i=new us){const r=this.x,s=this.y,o=this.z,a=this.w;let f,g,m,w,x,l=e.x,c=e.y,u=e.z,h=e.w;return g=r*l+s*c+o*u+a*h,g<0&&(g=-g,l=-l,c=-c,u=-u,h=-h),1-g>1e-6?(f=Math.acos(g),m=Math.sin(f),w=Math.sin((1-t)*f)/m,x=Math.sin(t*f)/m):(w=1-t,x=t),i.x=w*r+x*l,i.y=w*s+x*c,i.z=w*o+x*u,i.w=w*a+x*h,i}integrate(e,t,i,r=new us){const s=e.x*i.x,o=e.y*i.y,a=e.z*i.z,l=this.x,c=this.y,u=this.z,h=this.w,f=.5*t;return r.x+=f*(s*h+o*u-a*c),r.y+=f*(o*h+a*l-s*u),r.z+=f*(a*h+s*c-o*l),r.w+=f*(-s*l-o*c-a*u),r}}const J_e=new ce,eye=new ce,tye={SPHERE:1,PLANE:2,BOX:4,COMPOUND:8,CONVEXPOLYHEDRON:16,HEIGHTFIELD:32,PARTICLE:64,CYLINDER:128,TRIMESH:256};let _n=(()=>{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=tye,n})();class $i{constructor(e={}){this.position=void 0,this.quaternion=void 0,this.position=new ce,this.quaternion=new us,e.position&&this.position.copy(e.position),e.quaternion&&this.quaternion.copy(e.quaternion)}pointToLocal(e,t){return $i.pointToLocalFrame(this.position,this.quaternion,e,t)}pointToWorld(e,t){return $i.pointToWorldFrame(this.position,this.quaternion,e,t)}vectorToWorldFrame(e,t=new ce){return this.quaternion.vmult(e,t),t}static pointToLocalFrame(e,t,i,r=new ce){return i.vsub(e,r),t.conjugate(KH),KH.vmult(r,r),r}static pointToWorldFrame(e,t,i,r=new ce){return t.vmult(i,r),r.vadd(e,r),r}static vectorToWorldFrame(e,t,i=new ce){return e.vmult(t,i),i}static vectorToLocalFrame(e,t,i,r=new ce){return t.w*=-1,t.vmult(i,r),t.w*=-1,r}}const KH=new us;class jf extends _n{constructor(e={}){const{vertices:t=[],faces:i=[],normals:r=[],axes:s,boundingSphereRadius:o}=e;super({type:_n.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 ce;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 u=!1;for(let h=0;h!==i.length;h++)if(i[h].almostEquals(r)||i[h].almostEquals(r)){u=!0;break}u||i.push(r.clone())}}}computeNormals(){this.faceNormals.length=this.faces.length;for(let e=0;ef&&(f=w,h=m)}const g=[];for(let m=0;m=0&&this.clipFaceAgainstHull(o,e,t,g,a,l,c)}findSeparatingAxis(e,t,i,r,s,o,a,l){const c=new ce,u=new ce,h=new ce,f=new ce,g=new ce,m=new ce;let w=Number.MAX_VALUE;const x=this;if(x.uniqueAxes)for(let U=0;U!==x.uniqueAxes.length;U++){i.vmult(x.uniqueAxes[U],c);const D=x.testSepAxis(c,e,t,i,r,s);if(!1===D)return!1;D0&&o.negate(o),!0}testSepAxis(e,t,i,r,s,o){jf.project(this,e,i,r,KR),jf.project(t,e,s,o,QR);const l=KR[0],c=KR[1],u=QR[0],h=QR[1];if(l0?1/t:0,this.material=e.material||null,this.linearDamping="number"==typeof e.linearDamping?e.linearDamping:.01,this.type=t<=0?yn.STATIC:yn.DYNAMIC,typeof e.type==typeof yn.STATIC&&(this.type=e.type),this.allowSleep=void 0===e.allowSleep||e.allowSleep,this.sleepState=yn.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 ce,this.quaternion=new us,this.initQuaternion=new us,this.previousQuaternion=new us,this.interpolatedQuaternion=new us,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 ce,e.angularVelocity&&this.angularVelocity.copy(e.angularVelocity),this.initAngularVelocity=new ce,this.shapes=[],this.shapeOffsets=[],this.shapeOrientations=[],this.inertia=new ce,this.invInertia=new ce,this.invInertiaWorld=new lu,this.invMassSolve=0,this.invInertiaSolve=new ce,this.invInertiaWorldSolve=new lu,this.fixedRotation=void 0!==e.fixedRotation&&e.fixedRotation,this.angularDamping=void 0!==e.angularDamping?e.angularDamping:.01,this.linearFactor=new ce(1,1,1),e.linearFactor&&this.linearFactor.copy(e.linearFactor),this.angularFactor=new ce(1,1,1),e.angularFactor&&this.angularFactor.copy(e.angularFactor),this.aabb=new pr,this.aabbNeedsUpdate=!0,this.boundingRadius=0,this.wlambda=new ce,this.isTrigger=Boolean(e.isTrigger),e.shape&&this.addShape(e.shape),this.updateMassProperties()}wakeUp(){const e=this.sleepState;this.sleepState=yn.AWAKE,this.wakeUpAfterNarrowphase=!1,e===yn.SLEEPING&&this.dispatchEvent(yn.wakeupEvent)}sleep(){this.sleepState=yn.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=Er(this.sleepSpeedLimit,2);t===yn.AWAKE&&ir?this.wakeUp():t===yn.SLEEPY&&e-this.timeLastSleepy>this.sleepTimeLimit&&(this.sleep(),this.dispatchEvent(yn.sleepEvent))}}updateSolveMassProperties(){this.sleepState===yn.SLEEPING||this.type===yn.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 ce){return e.vsub(this.position,t),this.quaternion.conjugate().vmult(t,t),t}vectorToLocalFrame(e,t=new ce){return this.quaternion.conjugate().vmult(e,t),t}pointToWorldFrame(e,t=new ce){return this.quaternion.vmult(e,t),t.vadd(this.position,t),t}vectorToWorldFrame(e,t=new ce){return this.quaternion.vmult(e,t),t}addShape(e,t,i){const r=new ce,s=new us;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=rye,o=sye,a=this.quaternion,l=this.aabb,c=oye;for(let u=0;u!==r;u++){const h=e[u];a.vmult(t[u],s),s.vadd(this.position,s),a.mult(i[u],o),h.calculateWorldAABB(s,o,c.lowerBound,c.upperBound),0===u?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=aye,r=lye;i.setRotationFromQuaternion(this.quaternion),i.transpose(r),i.scale(t,i),i.mmult(r,this.invInertiaWorld)}}applyForce(e,t=new ce){if(this.type!==yn.DYNAMIC)return;this.sleepState===yn.SLEEPING&&this.wakeUp();const i=cye;t.cross(e,i),this.force.vadd(e,this.force),this.torque.vadd(i,this.torque)}applyLocalForce(e,t=new ce){if(this.type!==yn.DYNAMIC)return;const i=uye,r=dye;this.vectorToWorldFrame(e,i),this.vectorToWorldFrame(t,r),this.applyForce(i,r)}applyTorque(e){this.type===yn.DYNAMIC&&(this.sleepState===yn.SLEEPING&&this.wakeUp(),this.torque.vadd(e,this.torque))}applyImpulse(e,t=new ce){if(this.type!==yn.DYNAMIC)return;this.sleepState===yn.SLEEPING&&this.wakeUp();const i=t,r=hye;r.copy(e),r.scale(this.invMass,r),this.velocity.vadd(r,this.velocity);const s=fye;i.cross(e,s),this.invInertiaWorld.vmult(s,s),this.angularVelocity.vadd(s,this.angularVelocity)}applyLocalImpulse(e,t=new ce){if(this.type!==yn.DYNAMIC)return;const i=pye,r=gye;this.vectorToWorldFrame(e,i),this.vectorToWorldFrame(t,r),this.applyImpulse(i,r)}updateMassProperties(){const e=mye;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),dS.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 ce;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!==yn.DYNAMIC&&this.type!==yn.KINEMATIC||this.sleepState===yn.SLEEPING)return;const r=this.velocity,s=this.angularVelocity,o=this.position,a=this.force,l=this.torque,c=this.quaternion,h=this.invInertiaWorld,f=this.linearFactor,g=this.invMass*e;r.x+=a.x*g*f.x,r.y+=a.y*g*f.y,r.z+=a.z*g*f.z;const m=h.elements,w=this.angularFactor,x=l.x*w.x,U=l.y*w.y,D=l.z*w.z;s.x+=e*(m[0]*x+m[1]*U+m[2]*D),s.y+=e*(m[3]*x+m[4]*U+m[5]*D),s.z+=e*(m[6]*x+m[7]*U+m[8]*D),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()}}yn.idCounter=0,yn.COLLIDE_EVENT_NAME="collide",yn.DYNAMIC=1,yn.STATIC=2,yn.KINEMATIC=4,yn.AWAKE=0,yn.SLEEPY=1,yn.SLEEPING=2,yn.wakeupEvent={type:"wakeup"},yn.sleepyEvent={type:"sleepy"},yn.sleepEvent={type:"sleep"};const rye=new ce,sye=new us,oye=new pr,aye=new lu,lye=new lu,cye=new ce,uye=new ce,dye=new ce,hye=new ce,fye=new ce,pye=new ce,gye=new ce,mye=new ce;new ce,new ce;class hS{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 ce,this.rayToWorld=new ce,this.hitNormalWorld=new ce,this.hitPointWorld=new ce,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 QH,ZH,JH,e8,t8,n8,i8;QH=_n.types.SPHERE,ZH=_n.types.PLANE,JH=_n.types.BOX,e8=_n.types.CYLINDER,t8=_n.types.CONVEXPOLYHEDRON,n8=_n.types.HEIGHTFIELD,i8=_n.types.TRIMESH;class ys{get[QH](){return this._intersectSphere}get[ZH](){return this._intersectPlane}get[JH](){return this._intersectBox}get[e8](){return this._intersectConvex}get[t8](){return this._intersectConvex}get[n8](){return this._intersectHeightfield}get[i8](){return this._intersectTrimesh}constructor(e=new ce,t=new ce){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 ce,this.precision=1e-4,this.checkCollisionResponse=!0,this.skipBackfaces=!1,this.collisionFilterMask=-1,this.collisionFilterGroup=-1,this.mode=ys.ANY,this.result=new hS,this.hasHit=!1,this.callback=i=>{}}intersectWorld(e,t){return this.mode=t.mode||ys.ANY,this.result=t.result||new hS,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(r8),tP.length=0,e.broadphase.aabbQuery(e,r8,tP),this.intersectBodies(tP),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=xye,s=Sye;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 ce(0,0,1);t.vmult(c,c);const u=new ce;o.vsub(i,u);const h=u.dot(c);if(a.vsub(i,u),h*u.dot(c)>0||o.distanceTo(a)=0&&w<=1&&(o.lerp(a,w,g),g.vsub(i,m),m.normalize(),this.reportIntersection(m,g,s,r,-1)),this.result.shouldStop)return;x>=0&&x<=1&&(o.lerp(a,x,g),g.vsub(i,m),m.normalize(),this.reportIntersection(m,g,s,r,-1))}}_intersectConvex(e,t,i,r,s,o){const a=Dye,l=o8,c=o&&o.faceList||null,u=e.faces,h=e.vertices,f=e.faceNormals,g=this.direction,m=this.from,x=m.distanceTo(this.to),U=c?c.length:u.length,D=this.result;for(let ie=0;!D.shouldStop&&iex||this.reportIntersection(a,va,s,r,_e)}}}}_intersectTrimesh(e,t,i,r,s,o){const a=Iye,l=Fye,c=Lye,u=o8,h=Oye,f=Rye,g=Pye,m=kye,w=Nye,x=e.indices,U=this.from,D=this.to,ie=this.direction;c.position.copy(i),c.quaternion.copy(t),$i.vectorToLocalFrame(i,t,ie,h),$i.pointToLocalFrame(i,t,U,f),$i.pointToLocalFrame(i,t,D,g),g.x*=e.scale.x,g.y*=e.scale.y,g.z*=e.scale.z,f.x*=e.scale.x,f.y*=e.scale.y,f.z*=e.scale.z,g.vsub(f,h),h.normalize();const _e=f.distanceSquared(g);e.tree.rayQuery(this,c,l);for(let Pe=0,Ne=l.length;!this.result.shouldStop&&Pe!==Ne;Pe++){const Ve=l[Pe];e.getNormal(Ve,a),e.getVertex(x[3*Ve],_c),_c.vsub(f,u);const bt=h.dot(a),xt=a.dot(u)/bt;if(xt<0)continue;h.scale(xt,va),va.vadd(f,va),e.getVertex(x[3*Ve+1],uu),e.getVertex(x[3*Ve+2],du);const At=va.distanceSquared(f);!ys.pointInTriangle(va,uu,_c,du)&&!ys.pointInTriangle(va,_c,uu,du)||At>_e||($i.vectorToWorldFrame(t,a,w),$i.pointToWorldFrame(i,t,va,m),this.reportIntersection(w,m,s,r,Ve))}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 ys.ALL:this.hasHit=!0,c.set(o,a,e,t,i,r,l),c.hasHit=!0,this.callback(c);break;case ys.CLOSEST:(l=0&&(h=s*c-o*a)>=0&&u+hDate.now()-n}var $f=et(4517);class Fr extends oe{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 $;return this._value}next(e){super.next(this._value=e)}}function fm(n,e,t){e||(e=new qn(qn.IDENTITY));const i=new qn(qn.IDENTITY);if(!n)return!0;if(n.matrix)i.copy(n.matrix);else{if(i.identity(),n.translation&&i.translate(n.translation),n.rotation){const s=new qn(qn.IDENTITY).fromQuaternion(n.rotation);i.multiplyRight(s)}n.scale&&i.scale(n.scale)}const r=new qn(e).multiplyRight(i);if(!1===t(n,r,e))return!1;for(const s of n.nodes||n.children||[])if(!1===fm(s,r,t))return!1;return!0}function Q8(){Mz([EH,cm])}function Z8(n,e){var t;const i=null===(t=e.nodes)||void 0===t?void 0:t.find(r=>r.name===n);if(i){let r=!1;for(const s of e.scenes)r||fm(s,new qn(qn.IDENTITY),(o,a)=>o!==i||(o.matrix=a,o.translation=void 0,o.rotation=void 0,o.scale=void 0,r=!0,!1));return e.scene={id:n,name:n,nodes:[i]},e.scenes=[e.scene],{scene:e.scene,scenes:e.scenes}}return e}function sP(n,e){return Bi(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 Hx(i,cm,{DracoLoader:IR,gltf:{decompressMeshes:!0,postProcess:!0}});return r.nodes||console.log("WARNING: Empty Scene",t,r),Z8(n.scenegraphNode,r)})}function Bve(n,e){return Bi(this,void 0,void 0,function*(){return Z8(n,yield e)})}function oP(n,e,t){if(e&&0!==e.length){let i;switch(t.geometry){case"sphere":i=new L_e;break;case"cone":i=new U_e;break;case"cylinder":i=new z_e;break;case"cube":default:i=new Y_e}return new pge(Object.assign({id:n,pickable:!0,autoHighlight:!1,highlightColor:[30,136,229,255],coordinateSystem:Vi.CARTESIAN,data:e,mesh:i,wireframe:!1,getTransformMatrix:r=>r.transformMatrix,getColor:r=>r.color||[255,255,255,229.5]},t))}}function J8(n,e,t){if(e&&0!==e.length)return new rge(Object.assign({id:n,pickable:!0,data:e.map(i=>Object.assign(Object.assign({},i),{position:new qn(i.transformMatrix).getTranslation()})),getText:i=>i.text,getPosition:i=>i.position,getColor:i=>i.color},t))}let jve=(()=>{class n extends Nz{initializeState(){const{data:t}=this.props;this.setState({data:null!=t?t:[],zoomOpacity:.8,doCollisions:!1}),Q8()}renderLayers(){var t,i;const r=this.state,s={sphere:[],cone:[],cylinder:[],cube:[],text:[],wireframe:[],scenegraph:[]};for(const l of r.data){const c=null!==(t=l.geometry)&&void 0!==t?t:"cube";l.scenegraph?s.scenegraph.push(l):void 0!==s[c]&&s[c].push(l)}const o={};for(const l of s.scenegraph)l.scenegraph&&l.scenegraphNode&&!Object.prototype.hasOwnProperty.call(o,l.scenegraph)&&(o[l.scenegraph]=sP({scenegraph:l.scenegraph},n.gltfCache));const a=[];for(const[l,c]of Object.entries(s))if("scenegraph"===l)for(const u of c)a.push(new F_e({id:"models-"+u["@id"],opacity:u.zoomBasedOpacity?r.zoomOpacity:void 0!==u.opacity?u.opacity:1,pickable:!u.unpickable,coordinateSystem:Vi.CARTESIAN,data:[u],scenegraph:u.scenegraphNode?Bve(u.scenegraphNode,o[u.scenegraph]):u.scenegraph,_lighting:u._lighting,getTransformMatrix:u.transformMatrix,getColor:null!==(i=u.color)&&void 0!==i?i:[0,255,0,127.5],parameters:{depthMask:!u.zoomBasedOpacity&&(void 0===u.opacity||1===u.opacity)}}));else"text"===l?(a.push(J8("text",c.filter(u=>u.unpickable),{pickable:!1})),a.push(J8("textPickable",c.filter(u=>!u.unpickable),{pickable:!0}))):"wireframe"===l?a.push(oP(l,c,{wireframe:!0,pickable:!1,geometry:l})):(a.push(oP(l,c.filter(u=>u.unpickable),{wireframe:!1,pickable:!1,geometry:l})),a.push(oP(`${l}Pickable`,c.filter(u=>!u.unpickable),{wireframe:!1,pickable:!0,geometry:l})));return r.doCollisions&&function(n){Bi(this,void 0,void 0,function*(){console.log("Starting Collisioning");const e=n.filter(o=>!o.scenegraph&&"wireframe"!==o.geometry).map(o=>{const a=new qn(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 pr({lowerBound:new ce(...l.map((u,h)=>Math.min(u,c[h]))),upperBound:new ce(...c.map((u,h)=>Math.max(u,l[h])))})}}),t=[];for(const o of n.filter(a=>!!a.scenegraph)){const a=yield q0(o.scenegraph,cm,{DracoLoader:IR,decompress:!0,postProcess:!0});for(const l of a.scenes)fm(l,new qn(o.transformMatrix),(c,u)=>{if(c.mesh&&c.mesh.primitives&&c.mesh.primitives.length>0)for(const h of c.mesh.primitives)if(h.attributes.POSITION&&h.attributes.POSITION.min){const f=u.transformAsPoint(h.attributes.POSITION.min,[]),g=u.transformAsPoint(h.attributes.POSITION.max,[]);t.push({"@id":o["@id"],name:c.name,entityId:o.entityId,bbox:new pr({lowerBound:new ce(...f.map((m,w)=>Math.min(m,g[w]))),upperBound:new ce(...g.map((m,w)=>Math.max(m,f[w])))}),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})}(r.data),a.filter(l=>!!l)}getPickingInfo(t){return t.info}}return n.layerName="BodyUILayer",n.gltfCache={},n})();function e5(n,e=[]){for(const t of n.nodes||n.children||[])e.push(t.name),e5(t,e);return e}let zve=(()=>{class n{constructor(t){var i,r,s,o,a;this.deckProps=t,this.bodyUILayer=new jve({}),this.nodeClickSubject=new oe,this.nodeHoverStartSubject=new oe,this.nodeHoverStopSubject=new oe,this.sceneRotationSubject=new Fr([0,0]),this.nodeDragStartSubject=new oe,this.nodeDragSubject=new oe,this.nodeDragEndSubject=new oe,this.nodeClick$=this.nodeClickSubject.pipe(ws()),this.nodeHoverStart$=this.nodeHoverStartSubject.pipe(ws()),this.nodeHoverStop$=this.nodeHoverStopSubject.pipe(ws()),this.sceneRotation$=this.sceneRotationSubject.pipe(ws()),this.nodeDragStart$=this.nodeDragStartSubject.pipe(ws()),this.nodeDrag$=this.nodeDragSubject.pipe(ws()),this.nodeDragEnd$=this.nodeDragEndSubject.pipe(ws());const l=Object.assign(Object.assign({},t),{views:["orthographic"===t.camera?new jde({flipY:!1,near:-1e3}):new Hde({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 u;return null!==(u=this.cursor)&&void 0!==u?u:c.isDragging?"grabbing":"grab"}});t.legacyLighting&&(l.effects=[new $O({ambientLight:new Vz({color:[255,255,255],intensity:10})})]),this.deck=new eS(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 Bi(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 qn([.076,0,0,0,0,.076,16875389974302382e-33,0,0,-16875389974302382e-33,.076,0,.49,.034,.11,1]);(function(n,e,t){return Bi(this,void 0,void 0,function*(){Q8();const i=yield sP({scenegraph:n,scenegraphNode:"VHF_Kidney_L_Low1"}),r={},s=[];for(const o of i.scenes)fm(o,e=new qn(e||qn.IDENTITY),(a,l)=>{const c={"@id":a.name||a.id,"@type":"ProcessedNode",transformMatrix:new qn(l),geometry:"wireframe",node:a};if(s.push({"@id":`GLTF:${c["@id"]}`,"@type":"GLTFNode",scenegraph:n,scenegraphNode:c["@id"],transformMatrix:new qn(e||qn.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 u of a.mesh.primitives)if(u.attributes.POSITION&&u.attributes.POSITION.min){const h=l.transformAsPoint(u.attributes.POSITION.min,[]),f=l.transformAsPoint(u.attributes.POSITION.max,[]);c.bbox=new pr({lowerBound:new ce(...h.map((g,m)=>Math.min(g,f[m]))),upperBound:new ce(...f.map((g,m)=>Math.max(g,h[m])))})}return r[c["@id"]]=c,!0});for(const o of Object.values(r).filter(a=>!a.bbox)){for(const a of e5(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,u=(o.size=o.bbox.upperBound.clone().vsub(a)).clone().vmul(new ce(.5,.5,.5)),h=o.center=a.clone().vadd(u);o.transformMatrix=new qn(qn.IDENTITY).translate(h.toArray()).scale(u.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 qn(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 Ei([$f.ZP],n.prototype,"_onHover",null),Ei([$f.ZP],n.prototype,"_onClick",null),Ei([$f.ZP],n.prototype,"_onViewStateChange",null),Ei([$f.ZP],n.prototype,"_onDragStart",null),Ei([$f.ZP],n.prototype,"_onDrag",null),Ei([$f.ZP],n.prototype,"_onDragEnd",null),n})();class t5 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 Hve 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 n5(n,e,t,i,r=new Hve(n,t,i)){if(!r.closed)return e instanceof O?e.subscribe(r):Me(e)(r)}const i5={};function yc(...n){let e,t;return Te(n[n.length-1])&&(t=n.pop()),"function"==typeof n[n.length-1]&&(e=n.pop()),1===n.length&&k(n[0])&&(n=n[0]),In(n,t).lift(new r5(e))}class r5{constructor(e){this.resultSelector=e}call(e,t){return t.subscribe(new Gve(e,this.resultSelector))}}class Gve extends t5{constructor(e,t){super(e),this.resultSelector=t,this.active=0,this.values=[],this.observables=[]}_next(e){this.values.push(i5),this.observables.push(e)}_complete(){const e=this.observables,t=e.length;if(0===t)this.destination.complete();else{this.active=t,this.toRespond=t;for(let i=0;i(i&&i.providers||[]).some(s=>s&&s.provide&&"MockNgModuleResolver"===s.provide.name||!1))});let aP=(()=>{class n{constructor(){this.bootstrap$=new Df(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 lP=new Ht("INITIAL_STATE_TOKEN");let Kve=(()=>{class n{static set(t){this.value=t}static pop(){const t=this.value;return this.value={},t}}return n.value={},n})();const s5=new Ht("Internals.StateContextFactory"),o5=new Ht("Internals.StateFactory");function fb(...n){if(1===n.length){const e=n[0];if(k(e))return ES(e,null);if(Q(e)&&Object.getPrototypeOf(e)===Object.prototype){const t=Object.keys(e);return ES(t.map(i=>e[i]),t)}}if("function"==typeof n[n.length-1]){const e=n.pop();return ES(n=1===n.length&&k(n[0])?n[0]:n,null).pipe(me(t=>e(...t)))}return ES(n,null)}function ES(n,e){return new O(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]=u},error:u=>t.error(u),complete:()=>{s++,(s===i||!c)&&(o===i&&t.next(e?e.reduce((u,h,f)=>(u[h]=r[f],u),{}):r),t.complete())}}))}})}function Ki(n,e){return function(i){return i.lift(new Qve(n,e))}}class Qve{constructor(e,t){this.predicate=e,this.thisArg=t}call(e,t){return t.subscribe(new Zve(e,this.predicate,this.thisArg))}}class Zve 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 Wa(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(u){let h;s++,!r||a?(a=!1,r=new Df(n,e,i),h=r.subscribe(this),o=u.subscribe({next(f){r.next(f)},error(f){a=!0,r.error(f)},complete(){l=!0,o=void 0,r.complete()}}),l&&(o=void 0)):h=r.subscribe(this),this.add(()=>{s--,h.unsubscribe(),h=void 0,o&&!l&&t&&0===s&&(o.unsubscribe(),o=void 0,r=void 0)})}}(i))}const a5=(()=>{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 qr(n){return e=>0===n?b0():e.lift(new ewe(n))}class ewe{constructor(e){if(this.total=e,this.total<0)throw new a5}call(e,t){return t.subscribe(new twe(e,this.total))}}class twe 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 l5(n,e){return e?t=>t.pipe(l5((i,r)=>je(n(i,r)).pipe(me((s,o)=>e(i,s,r,o))))):t=>t.lift(new nwe(n))}class nwe{constructor(e){this.project=e}call(e,t){return t.subscribe(new iwe(e,this.project))}}class iwe extends we{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 _t(this),i=this.destination;i.add(t);const r=N(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 xS(n=null){return e=>e.lift(new rwe(n))}class rwe{constructor(e){this.defaultValue=e}call(e,t){return t.subscribe(new swe(e,this.defaultValue))}}class swe 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 bc(n){return function(t){const i=new owe(n),r=t.lift(i);return i.caught=r}}class owe{constructor(e){this.selector=e}call(e,t){return t.subscribe(new awe(e,this.selector,this.caught))}}class awe extends we{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 _t(this);this.add(i);const r=N(t,i);r!==i&&this.add(r)}}}function gr(n){return e=>e.lift(new lwe(n))}class lwe{constructor(e){this.notifier=e}call(e,t){const i=new cwe(e),r=N(this.notifier,new _t(i));return r&&!i.seenValue?(i.add(r),t.subscribe(i)):i}}class cwe extends we{constructor(e){super(e),this.seenValue=!1}notifyNext(){this.seenValue=!0,this.complete()}notifyComplete(){}}function bh(){}function cr(n,e,t){return function(r){return r.lift(new uwe(n,e,t))}}class uwe{constructor(e,t,i){this.nextOrObserver=e,this.error=t,this.complete=i}call(e,t){return t.subscribe(new dwe(e,this.nextOrObserver,this.error,this.complete))}}class dwe extends y{constructor(e,t,i,r){super(e),this._tapNext=bh,this._tapError=bh,this._tapComplete=bh,this._tapError=i||bh,this._tapComplete=r||bh,Y(t)?(this._context=this,this._tapNext=t):t&&(this._context=t,this._tapNext=t.next||bh,this._tapError=t.error||bh,this._tapComplete=t.complete||bh)}_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 ld(n,e){return t=>t.lift(new hwe(n,e))}class hwe{constructor(e,t){this.compare=e,this.keySelector=t}call(e,t){return t.subscribe(new fwe(e,this.compare,this.keySelector))}}class fwe 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 qa={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 c5=(()=>{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 pn.isInAngularZone()?t():this._ngZone.run(t)}runOutsideAngular(t){return pn.isInAngularZone()?this._ngZone.runOutsideAngular(t):t()}verifyZoneIsNotNooped(t){t instanceof pn||console.warn(qa.ZONE_WARNING())}}return n.\u0275fac=function(t){return new(t||n)(Ie(pn),Ie(Xc))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const u5=new Ht("ROOT_STATE_TOKEN"),d5=new Ht("FEATURE_STATE_TOKEN"),h5=new Ht("NGXS_PLUGINS"),f5=new Ht("NG_TEST_MODE"),p5=new Ht("NG_DEV_MODE"),cd="NGXS_META",g5="NGXS_OPTIONS_META",cP="NGXS_SELECTOR_META";let Wf=(()=>{class n{constructor(){this.defaultsState={},this.selectorOptions={injectContainerState:!0,suppressErrors:!0},this.compatibility={strictContentSecurityPolicy:!1},this.executionStrategy=c5}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();class pwe{constructor(e,t,i){this.previousValue=e,this.currentValue=t,this.firstChange=i}}const m5=new Ht("NGXS_EXECUTION_STRATEGY");function qf(n){return n.constructor&&n.constructor.type?n.constructor.type:n.type}const _5=(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},SS=(n,e)=>e.split(".").reduce((t,i)=>t&&t[i],n),uP=n=>n&&"object"==typeof n&&!Array.isArray(n),dP=(n,...e)=>{if(!e.length)return n;const t=e.shift();if(uP(n)&&uP(t))for(const i in t)uP(t[i])?(n[i]||Object.assign(n,{[i]:{}}),dP(n[i],t[i])):Object.assign(n,{[i]:t[i]});return dP(n,...e)};function hP(n){if(!n.hasOwnProperty(cd)){const e={name:null,actions:{},defaults:{},path:null,makeRootSelector:t=>t.getStateGetter(e.name),children:[]};Object.defineProperty(n,cd,{value:e})}return pb(n)}function pb(n){return n[cd]}function pP(n){return n[cP]}function y5(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(e[qf(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 Ki(t=>{const i=qf(t.action);return n[i]&&(!e||e[t.status])})}(i,r),t())}}(n,["DISPATCHED"])}function Cwe(){return me(n=>n.action)}function CS(n){return e=>new O(t=>e.subscribe({next(i){n.leave(()=>t.next(i))},error(i){n.leave(()=>t.error(i))},complete(){n.leave(()=>t.complete())}}))}let TS=(()=>{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(m5))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();class Mwe extends oe{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 AS=(()=>{class n extends Mwe{}return n.\u0275fac=function(){let e;return function(i){return(e||(e=zi(n)))(i||n)}}(),n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),Dwe=(()=>{class n extends O{constructor(t,i){super(r=>{const s=t.pipe(CS(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(AS),Ie(TS))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const v5=n=>(...e)=>n.shift()(...e,(...i)=>v5(n)(...i));let MS=(()=>{class n extends Fr{constructor(){super({})}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),gP=(()=>{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(h5,8))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),mP=(()=>{class n extends oe{}return n.\u0275fac=function(){let e;return function(i){return(e||(e=zi(n)))(i||n)}}(),n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),w5=(()=>{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(la),this._errorHandler.handleError(r)}catch(s){}})}),i.pipe(CS(this._ngxsExecutionStrategy))}dispatchByEvents(t){return Array.isArray(t)?0===t.length?sn(this._stateStream.getValue()):fb(t.map(i=>this.dispatchSingle(i))):this.dispatchSingle(t)}dispatchSingle(t){if(!qf(t))return Fg(new Error(`This action doesn't have a type property: ${t.constructor.name}`));const r=this._stateStream.getValue();return v5([...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(Wa())}getActionResultStream(t){return this._actionResults.pipe(Ki(i=>i.action===t&&"DISPATCHED"!==i.status),qr(1),Wa())}createDispatchObservable(t){return t.pipe(l5(i=>{switch(i.status){case"SUCCESSFUL":return sn(this._stateStream.getValue());case"ERRORED":return Fg(i.error);default:return Qc}})).pipe(Wa())}}return n.\u0275fac=function(t){return new(t||n)(Ie(Hn),Ie(AS),Ie(mP),Ie(gP),Ie(MS),Ie(TS))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const E5=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])&&E5(n[i])}),n};let x5=(()=>{class n{constructor(t,i){this.isDevMode=t,this.isTestMode=i}}return n.\u0275fac=function(t){return new(t||n)(Ie(p5),Ie(f5))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),S5=(()=>{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(qa.INCORRECT_PRODUCTION()):this.isIncorrectDevelopment&&console.warn(qa.INCORRECT_DEVELOPMENT()))}}return n.\u0275fac=function(t){return new(t||n)(Ie(x5),Ie(Wf))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),gm=(()=>{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=E5(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(MS),Ie(w5),Ie(Wf),Ie(S5))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),DS=(()=>{class n{constructor(t){this._internalStateOperations=t}createStateContext(t){const i=this._internalStateOperations.getRootStateOperations();function r(l){return SS(l,t.path)}function s(l,c){const u=_5(l,t.path,c),h=t.instance;if(h.ngxsOnChanges){const f=b5(t,{currentAppState:l,newAppState:u});h.ngxsOnChanges(f)}return i.setState(u),u}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(qa.PATCHING_ARRAY());if("object"!=typeof n)throw new Error(qa.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(gm))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();class IS{static stateNameErrorMessage(e){return qa.STATE_NAME(e)}static checkCorrectStateName(e){if(!e)throw new Error(qa.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(qa.STATE_UNIQUE(r,e.name,s.name));return r}static getValidStateMeta(e){const t=pb(e);if(!t)throw new Error(qa.STATE_DECORATOR());return t}}IS.stateNameRegex=new RegExp("^[a-zA-Z0-9_]+$");let mm=(()=>{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=wS(()=>{const c=this;function u(f){const g=c.statePaths[f];return g?y5(g.split("."),c._config):null}return this._parentFactory?this._parentFactory.getRuntimeSelectorContext():{getStateGetter(f){let g=u(f);return g||((...m)=>(g||(g=u(f)),g?g(...m):void 0))},getSelectorOptions:f=>Object.assign({},c._config.selectorOptions,f||{})}})}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(IS.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[cd].name};return n.reduce((t,i)=>{const{name:r,children:s}=i[cd];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[cd].name]=t,e),{})}(i),l=[];for(const c of s){const u=a[c],h=o[c],f=u[cd];this.addRuntimeInfoToMeta(f,h);const g={name:c,path:h,isInitialised:!1,actions:f.actions,instance:this._injector.get(u),defaults:n.cloneDefaults(f.defaults)};this.hasBeenMountedAndBootstrapped(c,h)||l.push(g),this.states.push(g)}return l}addAndReturnDefaults(t){const r=this.add(t||[]);return{defaults:r.reduce((o,a)=>_5(o,a.path,a.defaults),{}),states:r}}connectActionHandlers(){null===this._actionsSubscription&&(this._actionsSubscription=this._actions.pipe(Ki(t=>"DISPATCHED"===t.status),V(({action:t})=>this.invokeActions(this._actions,t).pipe(me(()=>({action:t,status:"SUCCESSFUL"})),xS({action:t,status:"CANCELED"}),bc(i=>sn({action:t,status:"ERRORED",error:i}))))).subscribe(t=>this._actionResults.next(t)))}invokeActions(t,i){const r=qf(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 u=o.instance[l.fn](c,i);u instanceof Promise&&(u=je(u)),u instanceof O?(u=u.pipe(xS({})),l.options.cancelUncompleted&&(u=u.pipe(gr(t.pipe(Ewe(i)))))):u=sn({}).pipe(Wa()),s.push(u)}catch(u){s.push(Fg(u))}}}return s.length||s.push(sn({})),fb(s)}addToStatesMap(t){const i=[],r=this.statesByName;for(const s of t){const o=IS.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!==SS(this._initialState,i);return this.statesByName[t]&&r}}return n.\u0275fac=function(t){return new(t||n)(Ie(Hn),Ie(Wf),Ie(n,12),Ie(AS),Ie(mP),Ie(DS),Ie(lP,8))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),_P=(()=>{class n{constructor(t,i,r){this.internalStateOperations=t,this.stateContextFactory=i,this.bootstrapper=r}ngxsBootstrap(t,i){this.internalStateOperations.getRootStateOperations().dispatch(t).pipe(Ki(()=>!!i),cr(()=>this.invokeInit(i.states)),V(()=>this.bootstrapper.appBootstrapped$),Ki(r=>!!r)).subscribe(()=>this.invokeBootstrap(i.states))}invokeInit(t){for(const i of t){const r=i.instance;if(r.ngxsOnChanges){const a=b5(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(gm),Ie(DS),Ie(aP))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const OS_getOptions=n=>n&&n.NGXS_SELECTOR_OPTIONS_META||{};function Owe(n,e,t){const i=t&&t.containerClass,s=wS(function(...c){const u=e.apply(i,c);return u instanceof Function?wS.apply(null,[u]):u});Object.setPrototypeOf(s,e);const o=function(n,e){const t=function(n){return n.hasOwnProperty(cP)||Object.defineProperty(n,cP,{value:{makeRootSelector:null,originalFn:null,containerClass:null,selectorName:null,getSelectorOptions:()=>({})}}),pP(n)}(n);t.originalFn=n;let i=()=>({});e&&(t.containerClass=e.containerClass,t.selectorName=e.selectorName,i=e.getSelectorOptions||i);const r=Object.assign({},t);return t.getSelectorOptions=()=>function(n,e){return Object.assign({},OS_getOptions(n.containerClass)||{},OS_getOptions(n.originalFn)||{},n.getSelectorOptions()||{},e)}(r,i()),t}(e,t);return o.makeRootSelector=l=>{const{argumentSelectorFunctions:c,selectorOptions:u}=function(n,e,t=[]){const i=e.getSelectorOptions(),r=n.getSelectorOptions(i);return{selectorOptions:r,argumentSelectorFunctions:function(n=[],e,t){const i=[];return t&&(0===n.length||e.injectContainerState)&&pb(t)&&i.push(t),n&&i.push(...n),i}(t,r,e.containerClass).map(a=>T5(a)(n))}}(l,o,n);return function(f){const g=c.map(m=>m(f));try{return s(...g)}catch(m){if(m instanceof TypeError&&u.suppressErrors)return;throw m}}},s}function T5(n){const e=pP(n)||pb(n);return e&&e.makeRootSelector||(()=>n)}let hu=(()=>{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),bc(r=>{const{suppressErrors:s}=this._config.selectorOptions;return r instanceof TypeError&&s?sn(void 0):Fg(r)}),ld(),CS(this._internalExecutionStrategy))}selectOnce(t){return this.select(t).pipe(qr(1))}selectSnapshot(t){return this.getStoreBoundSelectorFn(t)(this._stateStream.getValue())}subscribe(t){return this._stateStream.pipe(CS(this._internalExecutionStrategy)).subscribe(t)}snapshot(){return this._internalStateOperations.getRootStateOperations().getState()}reset(t){return this._internalStateOperations.getRootStateOperations().setState(t)}getStoreBoundSelectorFn(t){return T5(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(MS),Ie(gm),Ie(Wf),Ie(TS),Ie(mm),Ie(lP,8))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),gb=(()=>{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(hu),Ie(Wf))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n.store=null,n.config=null,n})();class Fwe{static get type(){return"@@INIT"}}class Lwe{constructor(e){this.addedStates=e}static get type(){return"@@UPDATE_STATE"}}const RS=new Df(1);let Vwe=(()=>{class n{constructor(t,i,r,s,o=[],a){!function(){try{const n=window.ng,t=!(n.probe&&n.coreTokens)&&fa();RS.next(t)}catch(n){RS.next(!1)}finally{RS.complete()}}();const l=t.addAndReturnDefaults(o);i.setStateToTheCurrentWithNew(l),t.connectActionHandlers(),a.ngxsBootstrap(new Fwe,l)}}return n.\u0275fac=function(t){return new(t||n)(Ie(mm),Ie(gm),Ie(hu),Ie(gb),Ie(u5,8),Ie(_P))},n.\u0275mod=tn({type:n}),n.\u0275inj=St({}),n})(),jwe=(()=>{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 Lwe(l.defaults),l))}static flattenStates(t=[]){return t.reduce((i,r)=>i.concat(r),[])}}return n.\u0275fac=function(t){return new(t||n)(Ie(hu),Ie(gm),Ie(mm),Ie(d5,8),Ie(_P))},n.\u0275mod=tn({type:n}),n.\u0275inj=St({}),n})();class Yo{static forRoot(e=[],t={}){return{ngModule:Vwe,providers:[mm,DS,Dwe,AS,aP,S5,x5,_P,w5,mP,gm,TS,hu,MS,gb,gP,...e,...Yo.ngxsTokenProviders(e,t)]}}static forFeature(e=[]){return{ngModule:jwe,providers:[mm,gP,...e,{provide:d5,multi:!0,useValue:e}]}}static ngxsTokenProviders(e,t){return[{provide:f5,useValue:Xve},{provide:p5,useValue:fa},{provide:m5,useClass:t.executionStrategy||c5},{provide:u5,useValue:e},{provide:Yo.ROOT_OPTIONS,useValue:t},{provide:Wf,useFactory:Yo.ngxsConfigFactory,deps:[Yo.ROOT_OPTIONS]},{provide:IE,useFactory:Yo.appBootstrapListenerFactory,multi:!0,deps:[aP]},{provide:lP,useFactory:Yo.getInitialState},{provide:s5,useExisting:DS},{provide:o5,useExisting:mm}]}static ngxsConfigFactory(e){return dP(new Wf,e)}static appBootstrapListenerFactory(e){return()=>e.bootstrap()}static getInitialState(){return Kve.pop()}}function yP(n,e){return(t,i)=>{if(t.hasOwnProperty("prototype"))throw new Error(qa.ACTION_DECORATOR());const s=hP(t.constructor);Array.isArray(n)||(n=[n]);for(const o of n){const a=o.type;s.actions[a]||(s.actions[a]=[]),s.actions[a].push({fn:i,options:e||{},type:a})}}}function A5(n){return i=>{!function(n){RS.subscribe(e=>{e&&(n.\u0275prov||console.warn(qa.UNDECORATED_STATE_IN_IVY(n.name)))})}(i);const r=i,s=hP(r),o=Object.getPrototypeOf(r),a=function(i){return Object.assign({},i[g5]||{},n)}(o);(function(i){const{meta:r,inheritedStateClass:s,optionsWithInheritance:o}=i,{children:a,defaults:l,name:c}=o,u="string"==typeof c?c:c&&c.getName()||null;IS.checkCorrectStateName(u),s.hasOwnProperty(cd)&&(r.actions=Object.assign({},r.actions,(s[cd]||{}).actions)),r.children=a,r.defaults=l,r.name=u})({meta:s,inheritedStateClass:o,optionsWithInheritance:a}),r[g5]=a}}function PS(n,...e){return function(t,i){const r=i.toString(),s=`__${r}__selector`,o=function(n,e,t=[]){return"string"==typeof(e=e||function(n){const e=n.length-1;return 36===n.charCodeAt(e)?n.slice(0,e):n}(n))?y5(t.length?[e,...t]:e.split("."),gb.config):e}(r,n,e);Object.defineProperties(t,{[s]:{writable:!0,enumerable:!1,configurable:!0},[r]:{enumerable:!0,configurable:!0,get(){return this[s]||(this[s]=function(n){if(!gb.store)throw new Error(qa.SELECT_FACTORY_NOT_CONNECTED());return gb.store.select(n)}(o))}}})}}function _m(n){return(e,t,i)=>{if(!i||null===i.value)throw new Error(qa.SELECTOR_DECORATOR());const s=i.value,o=Owe(n,s,{containerClass:e,selectorName:t.toString(),getSelectorOptions:()=>({})}),a={configurable:!0,get:()=>o};return a.originalFn=s,a}}Yo.\u0275fac=function(e){return new(e||Yo)},Yo.\u0275mod=tn({type:Yo}),Yo.\u0275inj=St({}),Yo.ROOT_OPTIONS=new Ht("ROOT_OPTIONS");const Xo=new Ht("NgValueAccessor");function Dl(n,...e){return e.length?e.some(t=>n[t]):n.altKey||n.shiftKey||n.ctrlKey||n.metaKey}const qS=new cc(sx);class YEe{constructor(e,t){this.dueTime=e,this.scheduler=t}call(e,t){return t.subscribe(new XEe(e,this.dueTime,this.scheduler))}}class XEe 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(KEe,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 KEe(n){n.debouncedNext()}class QEe{constructor(e){this.total=e}call(e,t){return t.subscribe(new ZEe(e,this.total))}}class ZEe extends y{constructor(e,t){super(e),this.total=t,this.count=0}_next(e){++this.count>this.total&&this.destination.next(e)}}function bi(n){return null!=n&&"false"!=`${n}`}function Ya(n,e=0){return function(n){return!isNaN(parseFloat(n))&&!isNaN(Number(n))}(n)?Number(n):e}function YS(n){return Array.isArray(n)?n:[n]}function bs(n){return null==n?"":"string"==typeof n?n:`${n}px`}function dd(n){return n instanceof gn?n.nativeElement:n}let zP;try{zP="undefined"!=typeof Intl&&Intl.v8BreakIterator}catch(n){zP=!1}let Cb,Xf,HP,Qi=(()=>{class n{constructor(t){this._platformId=t,this.isBrowser=this._platformId?Af(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&&!zP)&&"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(Xc))},n.\u0275prov=We({factory:function(){return new n(Ie(Xc))},token:n,providedIn:"root"}),n})(),Sb=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=tn({type:n}),n.\u0275inj=St({}),n})();function vm(n){return function(){if(null==Cb&&"undefined"!=typeof window)try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:()=>Cb=!0}))}finally{Cb=Cb||!1}return Cb}()?n:!!n.capture}function F6(){if(null==Xf){if("object"!=typeof document||!document||"function"!=typeof Element||!Element)return Xf=!1,Xf;if("scrollBehavior"in document.documentElement.style)Xf=!0;else{const n=Element.prototype.scrollTo;Xf=!!n&&!/\{\s*\[native code\]\s*\}/.test(n.toString())}}return Xf}function KS(){let n="undefined"!=typeof document&&document?document.activeElement:null;for(;n&&n.shadowRoot;){const e=n.shadowRoot.activeElement;if(e===n)break;n=e}return n}function Kf(n){return n.composedPath?n.composedPath()[0]:n.target}let GP=(()=>{class n{create(t){return"undefined"==typeof MutationObserver?null:new MutationObserver(t)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({factory:function(){return new n},token:n,providedIn:"root"}),n})(),L6=(()=>{class n{constructor(t){this._mutationObserverFactory=t,this._observedElements=new Map}ngOnDestroy(){this._observedElements.forEach((t,i)=>this._cleanupObserver(i))}observe(t){const i=dd(t);return new O(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 oe,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(GP))},n.\u0275prov=We({factory:function(){return new n(Ie(GP))},token:n,providedIn:"root"}),n})(),$P=(()=>{class n{constructor(t,i,r){this._contentObserver=t,this._elementRef=i,this._ngZone=r,this.event=new ln,this._disabled=!1,this._currentSubscription=null}get disabled(){return this._disabled}set disabled(t){this._disabled=bi(t),this._disabled?this._unsubscribe():this._subscribe()}get debounce(){return this._debounce}set debounce(t){this._debounce=Ya(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=qS){return t=>t.lift(new YEe(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)(Ce(L6),Ce(gn),Ce(pn))},n.\u0275dir=Nt({type:n,selectors:[["","cdkObserveContent",""]],inputs:{disabled:["cdkObserveContentDisabled","disabled"],debounce:"debounce"},outputs:{event:"cdkObserveContent"},exportAs:["cdkObserveContent"]}),n})(),QS=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=tn({type:n}),n.\u0275inj=St({providers:[GP]}),n})(),$6=(()=>{class n{constructor(t){this._platform=t}isDisabled(t){return t.hasAttribute("disabled")}isVisible(t){return function(n){return!!(n.offsetWidth||n.offsetHeight||"function"==typeof n.getClientRects&&n.getClientRects().length)}(t)&&"visible"===getComputedStyle(t).visibility}isTabbable(t){if(!this._platform.isBrowser)return!1;const i=function(n){try{return n.frameElement}catch(e){return null}}(function(n){return n.ownerDocument&&n.ownerDocument.defaultView||window}(t));if(i&&(-1===q6(i)||!this.isVisible(i)))return!1;let r=t.nodeName.toLowerCase(),s=q6(t);return t.hasAttribute("contenteditable")?-1!==s:!("iframe"===r||"object"===r||this._platform.WEBKIT&&this._platform.IOS&&!function(n){let e=n.nodeName.toLowerCase(),t="input"===e&&n.type;return"text"===t||"password"===t||"select"===e||"textarea"===e}(t))&&("audio"===r?!!t.hasAttribute("controls")&&-1!==s:"video"===r?-1!==s&&(null!==s||this._platform.FIREFOX||t.hasAttribute("controls")):t.tabIndex>=0)}isFocusable(t,i){return function(n){return!function(n){return function(n){return"input"==n.nodeName.toLowerCase()}(n)&&"hidden"==n.type}(n)&&(function(n){let e=n.nodeName.toLowerCase();return"input"===e||"select"===e||"button"===e||"textarea"===e}(n)||function(n){return function(n){return"a"==n.nodeName.toLowerCase()}(n)&&n.hasAttribute("href")}(n)||n.hasAttribute("contenteditable")||W6(n))}(t)&&!this.isDisabled(t)&&((null==i?void 0:i.ignoreVisibility)||this.isVisible(t))}}return n.\u0275fac=function(t){return new(t||n)(Ie(Qi))},n.\u0275prov=We({factory:function(){return new n(Ie(Qi))},token:n,providedIn:"root"}),n})();function W6(n){if(!n.hasAttribute("tabindex")||void 0===n.tabIndex)return!1;let e=n.getAttribute("tabindex");return"-32768"!=e&&!(!e||isNaN(parseInt(e,10)))}function q6(n){if(!W6(n))return null;const e=parseInt(n.getAttribute("tabindex")||"",10);return isNaN(e)?-1:e}class yxe{constructor(e,t,i,r,s=!1){this._element=e,this._checker=t,this._ngZone=i,this._document=r,this._hasAttached=!1,this.startAnchorListener=()=>this.focusLastTabbableElement(),this.endAnchorListener=()=>this.focusFirstTabbableElement(),this._enabled=!0,s||this.attachAnchors()}get enabled(){return this._enabled}set enabled(e){this._enabled=e,this._startAnchor&&this._endAnchor&&(this._toggleAnchorTabIndex(e,this._startAnchor),this._toggleAnchorTabIndex(e,this._endAnchor))}destroy(){const 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}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(e){return new Promise(t=>{this._executeOnStable(()=>t(this.focusInitialElement(e)))})}focusFirstTabbableElementWhenReady(e){return new Promise(t=>{this._executeOnStable(()=>t(this.focusFirstTabbableElement(e)))})}focusLastTabbableElementWhenReady(e){return new Promise(t=>{this._executeOnStable(()=>t(this.focusLastTabbableElement(e)))})}_getRegionBoundary(e){let t=this._element.querySelectorAll(`[cdk-focus-region-${e}], [cdkFocusRegion${e}], [cdk-focus-${e}]`);for(let i=0;i=0;i--){let r=t[i].nodeType===this._document.ELEMENT_NODE?this._getLastTabbableElement(t[i]):null;if(r)return r}return null}_createAnchor(){const 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}_toggleAnchorTabIndex(e,t){e?t.setAttribute("tabindex","0"):t.removeAttribute("tabindex")}toggleAnchors(e){this._startAnchor&&this._endAnchor&&(this._toggleAnchorTabIndex(e,this._startAnchor),this._toggleAnchorTabIndex(e,this._endAnchor))}_executeOnStable(e){this._ngZone.isStable?e():this._ngZone.onStable.pipe(qr(1)).subscribe(e)}}let Y6=(()=>{class n{constructor(t,i,r){this._checker=t,this._ngZone=i,this._document=r}create(t,i=!1){return new yxe(t,this._checker,this._ngZone,this._document,i)}}return n.\u0275fac=function(t){return new(t||n)(Ie($6),Ie(pn),Ie(fn))},n.\u0275prov=We({factory:function(){return new n(Ie($6),Ie(pn),Ie(fn))},token:n,providedIn:"root"}),n})();function X6(n){return 0===n.offsetX&&0===n.offsetY}function K6(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 Q6=new Ht("cdk-input-modality-detector-options"),xxe={ignoreKeys:[18,17,224,91,16]},wm=vm({passive:!0,capture:!0});let J6=(()=>{class n{constructor(t,i,r,s){this._platform=t,this._mostRecentTarget=null,this._modality=new Fr(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=Kf(o))},this._onMousedown=o=>{Date.now()-this._lastTouchMs<650||(this._modality.next(X6(o)?"keyboard":"mouse"),this._mostRecentTarget=Kf(o))},this._onTouchstart=o=>{K6(o)?this._modality.next("keyboard"):(this._lastTouchMs=Date.now(),this._modality.next("touch"),this._mostRecentTarget=Kf(o))},this._options=Object.assign(Object.assign({},xxe),s),this.modalityDetected=this._modality.pipe(function(n){return e=>e.lift(new QEe(n))}(1)),this.modalityChanged=this.modalityDetected.pipe(ld()),t.isBrowser&&i.runOutsideAngular(()=>{r.addEventListener("keydown",this._onKeydown,wm),r.addEventListener("mousedown",this._onMousedown,wm),r.addEventListener("touchstart",this._onTouchstart,wm)})}get mostRecentModality(){return this._modality.value}ngOnDestroy(){!this._platform.isBrowser||(document.removeEventListener("keydown",this._onKeydown,wm),document.removeEventListener("mousedown",this._onMousedown,wm),document.removeEventListener("touchstart",this._onTouchstart,wm))}}return n.\u0275fac=function(t){return new(t||n)(Ie(Qi),Ie(pn),Ie(fn),Ie(Q6,8))},n.\u0275prov=We({factory:function(){return new n(Ie(Qi),Ie(pn),Ie(fn),Ie(Q6,8))},token:n,providedIn:"root"}),n})();const nG=new Ht("cdk-focus-monitor-default-options"),eC=vm({passive:!0,capture:!0});let vc=(()=>{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 oe,this._rootNodeFocusAndBlurListener=a=>{const l=Kf(a),c="focus"===a.type?this._onFocus:this._onBlur;for(let u=l;u;u=u.parentElement)c.call(this,a,u)},this._document=s,this._detectionMode=(null==o?void 0:o.detectionMode)||0}monitor(t,i=!1){const r=dd(t);if(!this._platform.isBrowser||1!==r.nodeType)return sn(null);const s=function(n){if(function(){if(null==HP){const n="undefined"!=typeof document?document.head:null;HP=!(!n||!n.createShadowRoot&&!n.attachShadow)}return HP}()){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 oe,rootNode:s};return this._elementInfo.set(r,a),this._registerGlobalListeners(a),a.subject}stopMonitoring(t){const i=dd(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=dd(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=Kf(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,eC),i.addEventListener("blur",this._rootNodeFocusAndBlurListener,eC)}),this._rootNodeFocusListenerCount.set(i,r+1),1==++this._monitoredElementCount&&(this._ngZone.runOutsideAngular(()=>{this._getWindow().addEventListener("focus",this._windowFocusListener)}),this._inputModalityDetector.modalityDetected.pipe(gr(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,eC),i.removeEventListener("blur",this._rootNodeFocusAndBlurListener,eC),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(pn),Ie(Qi),Ie(J6),Ie(fn,8),Ie(nG,8))},n.\u0275prov=We({factory:function(){return new n(Ie(pn),Ie(Qi),Ie(J6),Ie(fn,8),Ie(nG,8))},token:n,providedIn:"root"}),n})();const iG="cdk-high-contrast-black-on-white",rG="cdk-high-contrast-white-on-black",qP="cdk-high-contrast-active";let sG=(()=>{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(qP),t.remove(iG),t.remove(rG),this._hasCheckedHighContrastMode=!0;const i=this.getHighContrastMode();1===i?(t.add(qP),t.add(iG)):2===i&&(t.add(qP),t.add(rG))}}}return n.\u0275fac=function(t){return new(t||n)(Ie(Qi),Ie(fn))},n.\u0275prov=We({factory:function(){return new n(Ie(Qi),Ie(fn))},token:n,providedIn:"root"}),n})();const oG=new Ht("cdk-dir-doc",{providedIn:"root",factory:function(){return Bc(fn)}});let Il=(()=>{class n{constructor(t){if(this.value="ltr",this.change=new ln,t){const r=t.documentElement?t.documentElement.dir:null,s=(t.body?t.body.dir:null)||r;this.value="ltr"===s||"rtl"===s?s:"ltr"}}ngOnDestroy(){this.change.complete()}}return n.\u0275fac=function(t){return new(t||n)(Ie(oG,8))},n.\u0275prov=We({factory:function(){return new n(Ie(oG,8))},token:n,providedIn:"root"}),n})(),Ab=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=tn({type:n}),n.\u0275inj=St({}),n})();const aG=new Hu("12.2.5");function tC(...n){return kt(1)(sn(...n))}function Oo(...n){const e=n[n.length-1];return Te(e)?(n.pop(),t=>tC(n,t,e)):t=>tC(n,t)}function Em(n,e){return{type:7,name:n,definitions:e,options:{}}}function fd(n,e=null){return{type:4,styles:e,timings:n}}function ds(n){return{type:6,styles:n,offset:null}}function wc(n,e,t){return{type:0,name:n,styles:e,options:t}}function pd(n,e,t=null){return{type:1,expr:n,animation:e,options:t}}function uG(n){Promise.resolve(null).then(n)}class xm{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(){uG(()=>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 hG(){return"undefined"!=typeof window&&void 0!==window.document}function XP(){return"undefined"!=typeof process&&"[object process]"==={}.toString.call(process)}let JP=(n,e)=>!1,eN=(n,e)=>!1,gG=(n,e,t)=>[];const mG=XP();(mG||"undefined"!=typeof Element)&&(JP=hG()?(n,e)=>{for(;e&&e!==document.documentElement;){if(e===n)return!0;e=e.parentNode||e.host}return!1}:(n,e)=>n.contains(e),eN=(()=>{if(mG||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]):eN}})(),gG=(n,e,t)=>{let i=[];if(t){const r=n.querySelectorAll(e);for(let s=0;s{class n{validateStyleProperty(t){return tN(t)}matchesElement(t,i){return nN(t,i)}containsElement(t,i){return iN(t,i)}query(t,i,r){return rN(t,i,r)}computeStyle(t,i,r){return r||""}animate(t,i,r,s,o,a=[],l){return new xm(r,s)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();class nC{}nC.NOOP=new bG;function xG(n,e,t){return t?e+":"+t+";":""}function SG(n){let e="";for(let t=0;t{const r=cN(i);t&&!t.hasOwnProperty(i)&&(t[i]=n.style[r]),n.style[r]=e[i]}),XP()&&SG(n))}function Jf(n,e){n.style&&(Object.keys(e).forEach(t=>{const i=cN(t);n.style[i]=""}),XP()&&SG(n))}const Lxe=/-+([a-z0-9])/g;function cN(n){return n.replace(Lxe,(...e)=>e[1].toUpperCase())}function Bxe(n){return n.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}class Tm{constructor(e,t,i){this._element=e,this._startStyles=t,this._endStyles=i,this._state=0;let r=Tm.initialStylesByElement.get(e);r||Tm.initialStylesByElement.set(e,r={}),this._initialStyles=r}start(){this._state<1&&(this._startStyles&&pu(this._element,this._startStyles,this._initialStyles),this._state=1)}finish(){this.start(),this._state<2&&(pu(this._element,this._initialStyles),this._endStyles&&(pu(this._element,this._endStyles),this._endStyles=null),this._state=1)}destroy(){this.finish(),this._state<3&&(Tm.initialStylesByElement.delete(this._element),this._startStyles&&(Jf(this._element,this._startStyles),this._endStyles=null),this._endStyles&&(Jf(this._element,this._endStyles),this._endStyles=null),pu(this._element,this._initialStyles),this._state=3)}}Tm.initialStylesByElement=new WeakMap;const Qa=new Ht("AnimationModuleType"),l$=new Hu("12.2.5"),sCe=new Ht("mat-sanity-checks",{providedIn:"root",factory:function(){return!0}});let tp,ji=(()=>{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!(!fa()||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")&&l$.full!==aG.full&&console.warn("The Angular Material version ("+l$.full+") does not match the Angular CDK version ("+aG.full+").\nPlease ensure the versions of these two packages exactly match.")}}return n.\u0275fac=function(t){return new(t||n)(Ie(sG),Ie(sCe,8),Ie(fn))},n.\u0275mod=tn({type:n}),n.\u0275inj=St({imports:[[Ab],Ab]}),n})();function Am(n){return class extends n{constructor(...e){super(...e),this._disabled=!1}get disabled(){return this._disabled}set disabled(e){this._disabled=bi(e)}}}function Mm(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 Ch(n){return class extends n{constructor(...e){super(...e),this._disableRipple=!1}get disableRipple(){return this._disableRipple}set disableRipple(e){this._disableRipple=bi(e)}}}function wC(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?Ya(t):this.defaultTabIndex}}}try{tp="undefined"!=typeof Intl}catch(n){tp=!1}class yCe{constructor(e,t,i){this._renderer=e,this.element=t,this.config=i,this.state=3}fadeOut(){this._renderer.fadeOutRipple(this)}}const p$={enterDuration:225,exitDuration:150},SN=vm({passive:!0}),g$=["mousedown","touchstart"],m$=["mouseup","mouseleave","touchend","touchcancel"];class vCe{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=dd(i))}fadeInRipple(e,t,i={}){const r=this._containerRect=this._containerRect||this._containerElement.getBoundingClientRect(),s=Object.assign(Object.assign({},p$),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,u=document.createElement("div");u.classList.add("mat-ripple-element"),u.style.left=a-o+"px",u.style.top=l-o+"px",u.style.height=2*o+"px",u.style.width=2*o+"px",null!=i.color&&(u.style.backgroundColor=i.color),u.style.transitionDuration=`${c}ms`,this._containerElement.appendChild(u),function(n){window.getComputedStyle(n).getPropertyValue("opacity")}(u),u.style.transform="scale(1)";const h=new yCe(this,u,i);return h.state=0,this._activeRipples.add(h),i.persistent||(this._mostRecentTransientRipple=h),this._runTimeoutOutsideZone(()=>{const f=h===this._mostRecentTransientRipple;h.state=1,!i.persistent&&(!f||!this._isPointerDown)&&h.fadeOut()},c),h}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({},p$),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=dd(e);!t||t===this._triggerElement||(this._removeTriggerEvents(),this._triggerElement=t,this._registerEvents(g$))}handleEvent(e){"mousedown"===e.type?this._onMousedown(e):"touchstart"===e.type?this._onTouchStart(e):this._onPointerUp(),this._pointerUpEventsRegistered||(this._registerEvents(m$),this._pointerUpEventsRegistered=!0)}_onMousedown(e){const t=X6(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,SN)})})}_removeTriggerEvents(){this._triggerElement&&(g$.forEach(e=>{this._triggerElement.removeEventListener(e,this,SN)}),this._pointerUpEventsRegistered&&m$.forEach(e=>{this._triggerElement.removeEventListener(e,this,SN)}))}}const xCe=new Ht("mat-ripple-global-options");let gu=(()=>{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 vCe(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)(Ce(gn),Ce(pn),Ce(Qi),Ce(xCe,8),Ce(Qa,8))},n.\u0275dir=Nt({type:n,selectors:[["","mat-ripple",""],["","matRipple",""]],hostAttrs:[1,"mat-ripple"],hostVars:2,hostBindings:function(t,i){2&t&&ai("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})(),Dm=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=tn({type:n}),n.\u0275inj=St({imports:[[ji,Sb],ji]}),n})();function gd(n,e,t,i){return Y(t)&&(i=t,t=void 0),i?gd(n,e,t).pipe(me(r=>k(r)?i(...r):i(r))):new O(r=>{E$(n,e,function(o){r.next(arguments.length>1?Array.prototype.slice.call(arguments):o)},r,t)})}function E$(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;o0?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 FCe=1;const LCe=Promise.resolve(),SC={};function x$(n){return n in SC&&(delete SC[n],!0)}const S$={setImmediate(n){const e=FCe++;return SC[e]=!0,LCe.then(()=>x$(e)&&n()),e},clearImmediate(n){x$(n)}};new class extends cc{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=S$.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&&(S$.clearImmediate(t),e.scheduled=void 0)}});function Im(n){return!!n&&(n instanceof O||"function"==typeof n.lift&&"function"==typeof n.subscribe)}class zCe{constructor(e){this.durationSelector=e}call(e,t){return t.subscribe(new HCe(e,this.durationSelector))}}class HCe extends we{constructor(e,t){super(e),this.durationSelector=t,this.hasValue=!1}_next(e){if(this.value=e,this.hasValue=!0,!this.throttled){let t;try{const{durationSelector:r}=this;t=r(e)}catch(r){return this.destination.error(r)}const i=N(t,new _t(this));!i||i.closed?this.clearThrottle():this.add(this.throttled=i)}}clearThrottle(){const{value:e,hasValue:t,throttled:i}=this;i&&(this.remove(i),this.throttled=void 0,i.unsubscribe()),t&&(this.value=void 0,this.hasValue=!1,this.destination.next(e))}notifyNext(){this.clearThrottle()}notifyComplete(){this.clearThrottle()}}function C$(n){return!k(n)&&n-parseFloat(n)+1>=0}function $Ce(n){const{index:e,period:t,subscriber:i}=n;if(i.next(e),!i.closed){if(-1===t)return i.complete();n.index=e+1,this.schedule(n,t)}}function CC(n,e=qS){return function(n){return function(t){return t.lift(new zCe(n))}}(()=>function(n=0,e,t){let i=-1;return C$(e)?i=Number(e)<1?1:Number(e):Te(e)&&(t=e),Te(t)||(t=qS),new O(r=>{const s=C$(n)?n:+n-t.now();return t.schedule($Ce,s,{index:0,period:i,subscriber:r})})}(n,e))}let A$=(()=>{class n{constructor(){this._listeners=[]}notify(t,i){for(let r of this._listeners)r(t,i)}listen(t){return this._listeners.push(t),()=>{this._listeners=this._listeners.filter(i=>t!==i)}}ngOnDestroy(){this._listeners=[]}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({factory:function(){return new n},token:n,providedIn:"root"}),n})(),Om=(()=>{class n{constructor(t,i,r){this._ngZone=t,this._platform=i,this._scrolled=new oe,this._globalSubscription=null,this._scrolledCount=0,this.scrollContainers=new Map,this._document=r}register(t){this.scrollContainers.has(t)||this.scrollContainers.set(t,t.elementScrolled().subscribe(()=>this._scrolled.next(t)))}deregister(t){const i=this.scrollContainers.get(t);i&&(i.unsubscribe(),this.scrollContainers.delete(t))}scrolled(t=20){return this._platform.isBrowser?new O(i=>{this._globalSubscription||this._addGlobalListener();const r=t>0?this._scrolled.pipe(CC(t)).subscribe(i):this._scrolled.subscribe(i);return this._scrolledCount++,()=>{r.unsubscribe(),this._scrolledCount--,this._scrolledCount||this._removeGlobalListener()}}):sn()}ngOnDestroy(){this._removeGlobalListener(),this.scrollContainers.forEach((t,i)=>this.deregister(i)),this._scrolled.complete()}ancestorScrolled(t,i){const r=this.getAncestorScrollContainers(t);return this.scrolled(i).pipe(Ki(s=>!s||r.indexOf(s)>-1))}getAncestorScrollContainers(t){const i=[];return this.scrollContainers.forEach((r,s)=>{this._scrollableContainsElement(s,t)&&i.push(s)}),i}_getWindow(){return this._document.defaultView||window}_scrollableContainsElement(t,i){let r=dd(i),s=t.getElementRef().nativeElement;do{if(r==s)return!0}while(r=r.parentElement);return!1}_addGlobalListener(){this._globalSubscription=this._ngZone.runOutsideAngular(()=>gd(this._getWindow().document,"scroll").subscribe(()=>this._scrolled.next()))}_removeGlobalListener(){this._globalSubscription&&(this._globalSubscription.unsubscribe(),this._globalSubscription=null)}}return n.\u0275fac=function(t){return new(t||n)(Ie(pn),Ie(Qi),Ie(fn,8))},n.\u0275prov=We({factory:function(){return new n(Ie(pn),Ie(Qi),Ie(fn,8))},token:n,providedIn:"root"}),n})(),Rm=(()=>{class n{constructor(t,i,r){this._platform=t,this._change=new oe,this._changeListener=s=>{this._change.next(s)},this._document=r,i.runOutsideAngular(()=>{if(t.isBrowser){const s=this._getWindow();s.addEventListener("resize",this._changeListener),s.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:i,height:r}=this.getViewportSize();return{top:t.top,left:t.left,bottom:t.top+r,right:t.left+i,height:r,width:i}}getViewportScrollPosition(){if(!this._platform.isBrowser)return{top:0,left:0};const t=this._document,i=this._getWindow(),r=t.documentElement,s=r.getBoundingClientRect();return{top:-s.top||t.body.scrollTop||i.scrollY||r.scrollTop||0,left:-s.left||t.body.scrollLeft||i.scrollX||r.scrollLeft||0}}change(t=20){return t>0?this._change.pipe(CC(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 n.\u0275fac=function(t){return new(t||n)(Ie(Qi),Ie(pn),Ie(fn,8))},n.\u0275prov=We({factory:function(){return new n(Ie(Qi),Ie(pn),Ie(fn,8))},token:n,providedIn:"root"}),n})();class MN{attach(e){return this._attachedHost=e,e.attach(this)}detach(){let e=this._attachedHost;null!=e&&(this._attachedHost=null,e.detach())}get isAttached(){return null!=this._attachedHost}setAttachedHost(e){this._attachedHost=e}}class AC extends MN{constructor(e,t,i,r){super(),this.component=e,this.viewContainerRef=t,this.injector=i,this.componentFactoryResolver=r}}class Pm extends MN{constructor(e,t,i){super(),this.templateRef=e,this.viewContainerRef=t,this.context=i}get origin(){return this.templateRef.elementRef}attach(e,t=this.context){return this.context=t,super.attach(e)}detach(){return this.context=void 0,super.detach()}}class l1e extends MN{constructor(e){super(),this.element=e instanceof gn?e.nativeElement:e}}class MC{constructor(){this._isDisposed=!1,this.attachDomPortal=null}hasAttached(){return!!this._attachedPortal}attach(e){return e instanceof AC?(this._attachedPortal=e,this.attachComponentPortal(e)):e instanceof Pm?(this._attachedPortal=e,this.attachTemplatePortal(e)):this.attachDomPortal&&e instanceof l1e?(this._attachedPortal=e,this.attachDomPortal(e)):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(e){this._disposeFn=e}_invokeDisposeFn(){this._disposeFn&&(this._disposeFn(),this._disposeFn=null)}}class c1e extends MC{constructor(e,t,i,r,s){super(),this.outletElement=e,this._componentFactoryResolver=t,this._appRef=i,this._defaultInjector=r,this.attachDomPortal=o=>{const a=o.element,l=this._document.createComment("dom-portal");a.parentNode.insertBefore(l,a),this.outletElement.appendChild(a),this._attachedPortal=o,super.setDisposeFn(()=>{l.parentNode&&l.parentNode.replaceChild(a,l)})},this._document=s}attachComponentPortal(e){const i=(e.componentFactoryResolver||this._componentFactoryResolver).resolveComponentFactory(e.component);let r;return e.viewContainerRef?(r=e.viewContainerRef.createComponent(i,e.viewContainerRef.length,e.injector||e.viewContainerRef.injector),this.setDisposeFn(()=>r.destroy())):(r=i.create(e.injector||this._defaultInjector),this._appRef.attachView(r.hostView),this.setDisposeFn(()=>{this._appRef.detachView(r.hostView),r.destroy()})),this.outletElement.appendChild(this._getComponentRootNode(r)),this._attachedPortal=e,r}attachTemplatePortal(e){let t=e.viewContainerRef,i=t.createEmbeddedView(e.templateRef,e.context);return i.rootNodes.forEach(r=>this.outletElement.appendChild(r)),i.detectChanges(),this.setDisposeFn(()=>{let r=t.indexOf(i);-1!==r&&t.remove(r)}),this._attachedPortal=e,i}dispose(){super.dispose(),null!=this.outletElement.parentNode&&this.outletElement.parentNode.removeChild(this.outletElement)}_getComponentRootNode(e){return e.hostView.rootNodes[0]}}let np=(()=>{class n extends MC{constructor(t,i,r){super(),this._componentFactoryResolver=t,this._viewContainerRef=i,this._isInitialized=!1,this.attached=new ln,this.attachDomPortal=s=>{const o=s.element,a=this._document.createComment("dom-portal");s.setAttachedHost(this),o.parentNode.insertBefore(a,o),this._getRootNode().appendChild(o),this._attachedPortal=s,super.setDisposeFn(()=>{a.parentNode&&a.parentNode.replaceChild(o,a)})},this._document=r}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 i=null!=t.viewContainerRef?t.viewContainerRef:this._viewContainerRef,s=(t.componentFactoryResolver||this._componentFactoryResolver).resolveComponentFactory(t.component),o=i.createComponent(s,i.length,t.injector||i.injector);return i!==this._viewContainerRef&&this._getRootNode().appendChild(o.hostView.rootNodes[0]),super.setDisposeFn(()=>o.destroy()),this._attachedPortal=t,this._attachedRef=o,this.attached.emit(o),o}attachTemplatePortal(t){t.setAttachedHost(this);const i=this._viewContainerRef.createEmbeddedView(t.templateRef,t.context);return super.setDisposeFn(()=>this._viewContainerRef.clear()),this._attachedPortal=t,this._attachedRef=i,this.attached.emit(i),i}_getRootNode(){const t=this._viewContainerRef.element.nativeElement;return t.nodeType===t.ELEMENT_NODE?t:t.parentNode}}return n.\u0275fac=function(t){return new(t||n)(Ce(El),Ce(Rs),Ce(fn))},n.\u0275dir=Nt({type:n,selectors:[["","cdkPortalOutlet",""]],inputs:{portal:["cdkPortalOutlet","portal"]},outputs:{attached:"attached"},exportAs:["cdkPortalOutlet"],features:[En]}),n})();const N$=F6();class f1e{constructor(e,t){this._viewportRuler=e,this._previousHTMLStyles={top:"",left:""},this._isEnabled=!1,this._document=t}attach(){}enable(){if(this._canBeEnabled()){const e=this._document.documentElement;this._previousScrollPosition=this._viewportRuler.getViewportScrollPosition(),this._previousHTMLStyles.left=e.style.left||"",this._previousHTMLStyles.top=e.style.top||"",e.style.left=bs(-this._previousScrollPosition.left),e.style.top=bs(-this._previousScrollPosition.top),e.classList.add("cdk-global-scrollblock"),this._isEnabled=!0}}disable(){if(this._isEnabled){const e=this._document.documentElement,i=e.style,r=this._document.body.style,s=i.scrollBehavior||"",o=r.scrollBehavior||"";this._isEnabled=!1,i.left=this._previousHTMLStyles.left,i.top=this._previousHTMLStyles.top,e.classList.remove("cdk-global-scrollblock"),N$&&(i.scrollBehavior=r.scrollBehavior="auto"),window.scroll(this._previousScrollPosition.left,this._previousScrollPosition.top),N$&&(i.scrollBehavior=s,r.scrollBehavior=o)}}_canBeEnabled(){if(this._document.documentElement.classList.contains("cdk-global-scrollblock")||this._isEnabled)return!1;const t=this._document.body,i=this._viewportRuler.getViewportSize();return t.scrollHeight>i.height||t.scrollWidth>i.width}}class p1e{constructor(e,t,i,r){this._scrollDispatcher=e,this._ngZone=t,this._viewportRuler=i,this._config=r,this._scrollSubscription=null,this._detach=()=>{this.disable(),this._overlayRef.hasAttached()&&this._ngZone.run(()=>this._overlayRef.detach())}}attach(e){this._overlayRef=e}enable(){if(this._scrollSubscription)return;const e=this._scrollDispatcher.scrolled(0);this._config&&this._config.threshold&&this._config.threshold>1?(this._initialScrollPosition=this._viewportRuler.getViewportScrollPosition().top,this._scrollSubscription=e.subscribe(()=>{const t=this._viewportRuler.getViewportScrollPosition().top;Math.abs(t-this._initialScrollPosition)>this._config.threshold?this._detach():this._overlayRef.updatePosition()})):this._scrollSubscription=e.subscribe(this._detach)}disable(){this._scrollSubscription&&(this._scrollSubscription.unsubscribe(),this._scrollSubscription=null)}detach(){this.disable(),this._overlayRef=null}}class k${enable(){}disable(){}attach(){}}function DN(n,e){return e.some(t=>n.bottomt.bottom||n.rightt.right)}function F$(n,e){return e.some(t=>n.topt.bottom||n.leftt.right)}class g1e{constructor(e,t,i,r){this._scrollDispatcher=e,this._viewportRuler=t,this._ngZone=i,this._config=r,this._scrollSubscription=null}attach(e){this._overlayRef=e}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:i,height:r}=this._viewportRuler.getViewportSize();DN(t,[{width:i,height:r,bottom:r,right:i,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 m1e=(()=>{class n{constructor(t,i,r,s){this._scrollDispatcher=t,this._viewportRuler=i,this._ngZone=r,this.noop=()=>new k$,this.close=o=>new p1e(this._scrollDispatcher,this._ngZone,this._viewportRuler,o),this.block=()=>new f1e(this._viewportRuler,this._document),this.reposition=o=>new g1e(this._scrollDispatcher,this._viewportRuler,this._ngZone,o),this._document=s}}return n.\u0275fac=function(t){return new(t||n)(Ie(Om),Ie(Rm),Ie(pn),Ie(fn))},n.\u0275prov=We({factory:function(){return new n(Ie(Om),Ie(Rm),Ie(pn),Ie(fn))},token:n,providedIn:"root"}),n})();class IC{constructor(e){if(this.scrollStrategy=new k$,this.panelClass="",this.hasBackdrop=!1,this.backdropClass="cdk-overlay-dark-backdrop",this.disposeOnNavigation=!1,e){const t=Object.keys(e);for(const i of t)void 0!==e[i]&&(this[i]=e[i])}}}class _1e{constructor(e,t,i,r,s){this.offsetX=i,this.offsetY=r,this.panelClass=s,this.originX=e.originX,this.originY=e.originY,this.overlayX=t.overlayX,this.overlayY=t.overlayY}}class y1e{constructor(e,t){this.connectionPair=e,this.scrollableViewProperties=t}}let L$=(()=>{class n{constructor(t){this._attachedOverlays=[],this._document=t}ngOnDestroy(){this.detach()}add(t){this.remove(t),this._attachedOverlays.push(t)}remove(t){const i=this._attachedOverlays.indexOf(t);i>-1&&this._attachedOverlays.splice(i,1),0===this._attachedOverlays.length&&this.detach()}}return n.\u0275fac=function(t){return new(t||n)(Ie(fn))},n.\u0275prov=We({factory:function(){return new n(Ie(fn))},token:n,providedIn:"root"}),n})(),b1e=(()=>{class n extends L${constructor(t){super(t),this._keydownListener=i=>{const r=this._attachedOverlays;for(let s=r.length-1;s>-1;s--)if(r[s]._keydownEvents.observers.length>0){r[s]._keydownEvents.next(i);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 n.\u0275fac=function(t){return new(t||n)(Ie(fn))},n.\u0275prov=We({factory:function(){return new n(Ie(fn))},token:n,providedIn:"root"}),n})(),v1e=(()=>{class n extends L${constructor(t,i){super(t),this._platform=i,this._cursorStyleIsSet=!1,this._clickListener=r=>{const s=Kf(r),o=this._attachedOverlays.slice();for(let a=o.length-1;a>-1;a--){const l=o[a];if(!(l._outsidePointerEvents.observers.length<1)&&l.hasAttached()){if(l.overlayElement.contains(s))break;l._outsidePointerEvents.next(r)}}}}add(t){if(super.add(t),!this._isAttached){const i=this._document.body;i.addEventListener("click",this._clickListener,!0),i.addEventListener("auxclick",this._clickListener,!0),i.addEventListener("contextmenu",this._clickListener,!0),this._platform.IOS&&!this._cursorStyleIsSet&&(this._cursorOriginalValue=i.style.cursor,i.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 n.\u0275fac=function(t){return new(t||n)(Ie(fn),Ie(Qi))},n.\u0275prov=We({factory:function(){return new n(Ie(fn),Ie(Qi))},token:n,providedIn:"root"}),n})();const Th="undefined"!=typeof window?window:{},B$=void 0!==Th.__karma__&&!!Th.__karma__||void 0!==Th.jasmine&&!!Th.jasmine||void 0!==Th.jest&&!!Th.jest||void 0!==Th.Mocha&&!!Th.Mocha;let Ob=(()=>{class n{constructor(t,i){this._platform=i,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||B$){const r=this._document.querySelectorAll(`.${t}[platform="server"], .${t}[platform="test"]`);for(let s=0;sthis._backdropClick.next(u),this._keydownEvents=new oe,this._outsidePointerEvents=new oe,r.scrollStrategy&&(this._scrollStrategy=r.scrollStrategy,this._scrollStrategy.attach(this)),this._positionStrategy=r.positionStrategy}get overlayElement(){return this._pane}get backdropElement(){return this._backdropElement}get hostElement(){return this._host}attach(e){let t=this._portalOutlet.attach(e);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(qr(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),t}detach(){if(!this.hasAttached())return;this.detachBackdrop(),this._togglePointerEvents(!1),this._positionStrategy&&this._positionStrategy.detach&&this._positionStrategy.detach(),this._scrollStrategy&&this._scrollStrategy.disable();const e=this._portalOutlet.detach();return this._detachments.next(),this._keyboardDispatcher.remove(this),this._detachContentWhenStable(),this._locationChanges.unsubscribe(),this._outsideClickDispatcher.remove(this),e}dispose(){const e=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,e&&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(e){e!==this._positionStrategy&&(this._positionStrategy&&this._positionStrategy.dispose(),this._positionStrategy=e,this.hasAttached()&&(e.attach(this),this.updatePosition()))}updateSize(e){this._config=Object.assign(Object.assign({},this._config),e),this._updateElementSize()}setDirection(e){this._config=Object.assign(Object.assign({},this._config),{direction:e}),this._updateElementDirection()}addPanelClass(e){this._pane&&this._toggleClasses(this._pane,e,!0)}removePanelClass(e){this._pane&&this._toggleClasses(this._pane,e,!1)}getDirection(){const e=this._config.direction;return e?"string"==typeof e?e:e.value:"ltr"}updateScrollStrategy(e){e!==this._scrollStrategy&&(this._disposeScrollStrategy(),this._scrollStrategy=e,this.hasAttached()&&(e.attach(this),e.enable()))}_updateElementDirection(){this._host.setAttribute("dir",this.getDirection())}_updateElementSize(){if(!this._pane)return;const e=this._pane.style;e.width=bs(this._config.width),e.height=bs(this._config.height),e.minWidth=bs(this._config.minWidth),e.minHeight=bs(this._config.minHeight),e.maxWidth=bs(this._config.maxWidth),e.maxHeight=bs(this._config.maxHeight)}_togglePointerEvents(e){this._pane.style.pointerEvents=e?"":"none"}_attachBackdrop(){const e="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(e)})}):this._backdropElement.classList.add(e)}_updateStackingOrder(){this._host.nextSibling&&this._host.parentNode.appendChild(this._host)}detachBackdrop(){let e=this._backdropElement;if(!e)return;let t,i=()=>{e&&(e.removeEventListener("click",this._backdropClickHandler),e.removeEventListener("transitionend",i),e.parentNode&&e.parentNode.removeChild(e)),this._backdropElement==e&&(this._backdropElement=null),this._config.backdropClass&&this._toggleClasses(e,this._config.backdropClass,!1),clearTimeout(t)};e.classList.remove("cdk-overlay-backdrop-showing"),this._ngZone.runOutsideAngular(()=>{e.addEventListener("transitionend",i)}),e.style.pointerEvents="none",t=this._ngZone.runOutsideAngular(()=>setTimeout(i,500))}_toggleClasses(e,t,i){const r=e.classList;YS(t).forEach(s=>{s&&(i?r.add(s):r.remove(s))})}_detachContentWhenStable(){this._ngZone.runOutsideAngular(()=>{const e=this._ngZone.onStable.pipe(gr(Nn(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)),e.unsubscribe())})})}_disposeScrollStrategy(){const e=this._scrollStrategy;e&&(e.disable(),e.detach&&e.detach())}}const V$="cdk-overlay-connected-position-bounding-box",E1e=/([A-Za-z%]+)$/;class j${constructor(e,t,i,r,s){this._viewportRuler=t,this._document=i,this._platform=r,this._overlayContainer=s,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 oe,this._resizeSubscription=C.EMPTY,this._offsetX=0,this._offsetY=0,this._appliedPanelClasses=[],this.positionChanges=this._positionChanges,this.setOrigin(e)}get positions(){return this._preferredPositions}attach(e){this._validatePositions(),e.hostElement.classList.add(V$),this._overlayRef=e,this._boundingBox=e.hostElement,this._pane=e.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 e=this._originRect,t=this._overlayRect,i=this._viewportRect,r=[];let s;for(let o of this._preferredPositions){let a=this._getOriginPoint(e,o),l=this._getOverlayPoint(a,t,o),c=this._getOverlayFit(l,t,i,o);if(c.isCompletelyWithinViewport)return this._isPushed=!1,void this._applyPosition(o,a);this._canFitWithFlexibleDimensions(c,l,i)?r.push({position:o,origin:a,overlayRect:t,boundingBoxRect:this._calculateBoundingBoxRect(a,o)}):(!s||s.overlayFit.visibleAreaa&&(a=c,o=l)}return this._isPushed=!1,void this._applyPosition(o.position,o.origin)}if(this._canPush)return this._isPushed=!0,void this._applyPosition(s.position,s.originPoint);this._applyPosition(s.position,s.originPoint)}detach(){this._clearPanelClasses(),this._lastPosition=null,this._previousPushAmount=null,this._resizeSubscription.unsubscribe()}dispose(){this._isDisposed||(this._boundingBox&&ip(this._boundingBox.style,{top:"",left:"",right:"",bottom:"",height:"",width:"",alignItems:"",justifyContent:""}),this._pane&&this._resetOverlayElementStyles(),this._overlayRef&&this._overlayRef.hostElement.classList.remove(V$),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 e=this._lastPosition||this._preferredPositions[0],t=this._getOriginPoint(this._originRect,e);this._applyPosition(e,t)}}withScrollableContainers(e){return this._scrollables=e,this}withPositions(e){return this._preferredPositions=e,-1===e.indexOf(this._lastPosition)&&(this._lastPosition=null),this._validatePositions(),this}withViewportMargin(e){return this._viewportMargin=e,this}withFlexibleDimensions(e=!0){return this._hasFlexibleDimensions=e,this}withGrowAfterOpen(e=!0){return this._growAfterOpen=e,this}withPush(e=!0){return this._canPush=e,this}withLockedPosition(e=!0){return this._positionLocked=e,this}setOrigin(e){return this._origin=e,this}withDefaultOffsetX(e){return this._offsetX=e,this}withDefaultOffsetY(e){return this._offsetY=e,this}withTransformOriginOn(e){return this._transformOriginSelector=e,this}_getOriginPoint(e,t){let i,r;if("center"==t.originX)i=e.left+e.width/2;else{const s=this._isRtl()?e.right:e.left,o=this._isRtl()?e.left:e.right;i="start"==t.originX?s:o}return r="center"==t.originY?e.top+e.height/2:"top"==t.originY?e.top:e.bottom,{x:i,y:r}}_getOverlayPoint(e,t,i){let r,s;return r="center"==i.overlayX?-t.width/2:"start"===i.overlayX?this._isRtl()?-t.width:0:this._isRtl()?0:-t.width,s="center"==i.overlayY?-t.height/2:"top"==i.overlayY?0:-t.height,{x:e.x+r,y:e.y+s}}_getOverlayFit(e,t,i,r){const s=z$(t);let{x:o,y:a}=e,l=this._getOffset(r,"x"),c=this._getOffset(r,"y");l&&(o+=l),c&&(a+=c);let f=0-a,g=a+s.height-i.height,m=this._subtractOverflows(s.width,0-o,o+s.width-i.width),w=this._subtractOverflows(s.height,f,g),x=m*w;return{visibleArea:x,isCompletelyWithinViewport:s.width*s.height===x,fitsInViewportVertically:w===s.height,fitsInViewportHorizontally:m==s.width}}_canFitWithFlexibleDimensions(e,t,i){if(this._hasFlexibleDimensions){const r=i.bottom-t.y,s=i.right-t.x,o=U$(this._overlayRef.getConfig().minHeight),a=U$(this._overlayRef.getConfig().minWidth),c=e.fitsInViewportHorizontally||null!=a&&a<=s;return(e.fitsInViewportVertically||null!=o&&o<=r)&&c}return!1}_pushOverlayOnScreen(e,t,i){if(this._previousPushAmount&&this._positionLocked)return{x:e.x+this._previousPushAmount.x,y:e.y+this._previousPushAmount.y};const r=z$(t),s=this._viewportRect,o=Math.max(e.x+r.width-s.width,0),a=Math.max(e.y+r.height-s.height,0),l=Math.max(s.top-i.top-e.y,0),c=Math.max(s.left-i.left-e.x,0);let u=0,h=0;return u=r.width<=s.width?c||-o:e.xm&&!this._isInitialRender&&!this._growAfterOpen&&(o=e.y-m/2)}if("end"===t.overlayX&&!r||"start"===t.overlayX&&r)f=i.width-e.x+this._viewportMargin,u=e.x-this._viewportMargin;else if("start"===t.overlayX&&!r||"end"===t.overlayX&&r)h=e.x,u=i.right-e.x;else{const g=Math.min(i.right-e.x+i.left,e.x),m=this._lastBoundingBoxSize.width;u=2*g,h=e.x-g,u>m&&!this._isInitialRender&&!this._growAfterOpen&&(h=e.x-m/2)}return{top:o,left:h,bottom:a,right:f,width:u,height:s}}_setBoundingBoxStyles(e,t){const i=this._calculateBoundingBoxRect(e,t);!this._isInitialRender&&!this._growAfterOpen&&(i.height=Math.min(i.height,this._lastBoundingBoxSize.height),i.width=Math.min(i.width,this._lastBoundingBoxSize.width));const r={};if(this._hasExactPosition())r.top=r.left="0",r.bottom=r.right=r.maxHeight=r.maxWidth="",r.width=r.height="100%";else{const s=this._overlayRef.getConfig().maxHeight,o=this._overlayRef.getConfig().maxWidth;r.height=bs(i.height),r.top=bs(i.top),r.bottom=bs(i.bottom),r.width=bs(i.width),r.left=bs(i.left),r.right=bs(i.right),r.alignItems="center"===t.overlayX?"center":"end"===t.overlayX?"flex-end":"flex-start",r.justifyContent="center"===t.overlayY?"center":"bottom"===t.overlayY?"flex-end":"flex-start",s&&(r.maxHeight=bs(s)),o&&(r.maxWidth=bs(o))}this._lastBoundingBoxSize=i,ip(this._boundingBox.style,r)}_resetBoundingBoxStyles(){ip(this._boundingBox.style,{top:"0",left:"0",right:"0",bottom:"0",height:"",width:"",alignItems:"",justifyContent:""})}_resetOverlayElementStyles(){ip(this._pane.style,{top:"",left:"",bottom:"",right:"",position:"",transform:""})}_setOverlayElementStyles(e,t){const i={},r=this._hasExactPosition(),s=this._hasFlexibleDimensions,o=this._overlayRef.getConfig();if(r){const u=this._viewportRuler.getViewportScrollPosition();ip(i,this._getExactOverlayY(t,e,u)),ip(i,this._getExactOverlayX(t,e,u))}else i.position="static";let a="",l=this._getOffset(t,"x"),c=this._getOffset(t,"y");l&&(a+=`translateX(${l}px) `),c&&(a+=`translateY(${c}px)`),i.transform=a.trim(),o.maxHeight&&(r?i.maxHeight=bs(o.maxHeight):s&&(i.maxHeight="")),o.maxWidth&&(r?i.maxWidth=bs(o.maxWidth):s&&(i.maxWidth="")),ip(this._pane.style,i)}_getExactOverlayY(e,t,i){let r={top:"",bottom:""},s=this._getOverlayPoint(t,this._overlayRect,e);this._isPushed&&(s=this._pushOverlayOnScreen(s,this._overlayRect,i));let o=this._overlayContainer.getContainerElement().getBoundingClientRect().top;return s.y-=o,"bottom"===e.overlayY?r.bottom=this._document.documentElement.clientHeight-(s.y+this._overlayRect.height)+"px":r.top=bs(s.y),r}_getExactOverlayX(e,t,i){let o,r={left:"",right:""},s=this._getOverlayPoint(t,this._overlayRect,e);return this._isPushed&&(s=this._pushOverlayOnScreen(s,this._overlayRect,i)),o=this._isRtl()?"end"===e.overlayX?"left":"right":"end"===e.overlayX?"right":"left","right"===o?r.right=this._document.documentElement.clientWidth-(s.x+this._overlayRect.width)+"px":r.left=bs(s.x),r}_getScrollVisibility(){const e=this._getOriginRect(),t=this._pane.getBoundingClientRect(),i=this._scrollables.map(r=>r.getElementRef().nativeElement.getBoundingClientRect());return{isOriginClipped:F$(e,i),isOriginOutsideView:DN(e,i),isOverlayClipped:F$(t,i),isOverlayOutsideView:DN(t,i)}}_subtractOverflows(e,...t){return t.reduce((i,r)=>i-Math.max(r,0),e)}_getNarrowedViewportRect(){const e=this._document.documentElement.clientWidth,t=this._document.documentElement.clientHeight,i=this._viewportRuler.getViewportScrollPosition();return{top:i.top+this._viewportMargin,left:i.left+this._viewportMargin,right:i.left+e-this._viewportMargin,bottom:i.top+t-this._viewportMargin,width:e-2*this._viewportMargin,height:t-2*this._viewportMargin}}_isRtl(){return"rtl"===this._overlayRef.getDirection()}_hasExactPosition(){return!this._hasFlexibleDimensions||this._isPushed}_getOffset(e,t){return"x"===t?null==e.offsetX?this._offsetX:e.offsetX:null==e.offsetY?this._offsetY:e.offsetY}_validatePositions(){}_addPanelClasses(e){this._pane&&YS(e).forEach(t=>{""!==t&&-1===this._appliedPanelClasses.indexOf(t)&&(this._appliedPanelClasses.push(t),this._pane.classList.add(t))})}_clearPanelClasses(){this._pane&&(this._appliedPanelClasses.forEach(e=>{this._pane.classList.remove(e)}),this._appliedPanelClasses=[])}_getOriginRect(){const e=this._origin;if(e instanceof gn)return e.nativeElement.getBoundingClientRect();if(e instanceof Element)return e.getBoundingClientRect();const t=e.width||0,i=e.height||0;return{top:e.y,bottom:e.y+i,left:e.x,right:e.x+t,height:i,width:t}}}function ip(n,e){for(let t in e)e.hasOwnProperty(t)&&(n[t]=e[t]);return n}function U$(n){if("number"!=typeof n&&null!=n){const[e,t]=n.split(E1e);return t&&"px"!==t?null:parseFloat(e)}return n||null}function z$(n){return{top:Math.floor(n.top),right:Math.floor(n.right),bottom:Math.floor(n.bottom),left:Math.floor(n.left),width:Math.floor(n.width),height:Math.floor(n.height)}}class x1e{constructor(e,t,i,r,s,o,a){this._preferredPositions=[],this._positionStrategy=new j$(i,r,s,o,a).withFlexibleDimensions(!1).withPush(!1).withViewportMargin(0),this.withFallbackPosition(e,t),this.onPositionChange=this._positionStrategy.positionChanges}get positions(){return this._preferredPositions}attach(e){this._overlayRef=e,this._positionStrategy.attach(e),this._direction&&(e.setDirection(this._direction),this._direction=null)}dispose(){this._positionStrategy.dispose()}detach(){this._positionStrategy.detach()}apply(){this._positionStrategy.apply()}recalculateLastPosition(){this._positionStrategy.reapplyLastPosition()}withScrollableContainers(e){this._positionStrategy.withScrollableContainers(e)}withFallbackPosition(e,t,i,r){const s=new _1e(e,t,i,r);return this._preferredPositions.push(s),this._positionStrategy.withPositions(this._preferredPositions),this}withDirection(e){return this._overlayRef?this._overlayRef.setDirection(e):this._direction=e,this}withOffsetX(e){return this._positionStrategy.withDefaultOffsetX(e),this}withOffsetY(e){return this._positionStrategy.withDefaultOffsetY(e),this}withLockedPosition(e){return this._positionStrategy.withLockedPosition(e),this}withPositions(e){return this._preferredPositions=e.slice(),this._positionStrategy.withPositions(this._preferredPositions),this}setOrigin(e){return this._positionStrategy.setOrigin(e),this}}const H$="cdk-global-overlay-wrapper";class S1e{constructor(){this._cssPosition="static",this._topOffset="",this._bottomOffset="",this._leftOffset="",this._rightOffset="",this._alignItems="",this._justifyContent="",this._width="",this._height=""}attach(e){const t=e.getConfig();this._overlayRef=e,this._width&&!t.width&&e.updateSize({width:this._width}),this._height&&!t.height&&e.updateSize({height:this._height}),e.hostElement.classList.add(H$),this._isDisposed=!1}top(e=""){return this._bottomOffset="",this._topOffset=e,this._alignItems="flex-start",this}left(e=""){return this._rightOffset="",this._leftOffset=e,this._justifyContent="flex-start",this}bottom(e=""){return this._topOffset="",this._bottomOffset=e,this._alignItems="flex-end",this}right(e=""){return this._leftOffset="",this._rightOffset=e,this._justifyContent="flex-end",this}width(e=""){return this._overlayRef?this._overlayRef.updateSize({width:e}):this._width=e,this}height(e=""){return this._overlayRef?this._overlayRef.updateSize({height:e}):this._height=e,this}centerHorizontally(e=""){return this.left(e),this._justifyContent="center",this}centerVertically(e=""){return this.top(e),this._alignItems="center",this}apply(){if(!this._overlayRef||!this._overlayRef.hasAttached())return;const e=this._overlayRef.overlayElement.style,t=this._overlayRef.hostElement.style,i=this._overlayRef.getConfig(),{width:r,height:s,maxWidth:o,maxHeight:a}=i,l=!("100%"!==r&&"100vw"!==r||o&&"100%"!==o&&"100vw"!==o),c=!("100%"!==s&&"100vh"!==s||a&&"100%"!==a&&"100vh"!==a);e.position=this._cssPosition,e.marginLeft=l?"0":this._leftOffset,e.marginTop=c?"0":this._topOffset,e.marginBottom=this._bottomOffset,e.marginRight=this._rightOffset,l?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=c?"flex-start":this._alignItems}dispose(){if(this._isDisposed||!this._overlayRef)return;const e=this._overlayRef.overlayElement.style,t=this._overlayRef.hostElement,i=t.style;t.classList.remove(H$),i.justifyContent=i.alignItems=e.marginTop=e.marginBottom=e.marginLeft=e.marginRight=e.position="",this._overlayRef=null,this._isDisposed=!0}}let C1e=(()=>{class n{constructor(t,i,r,s){this._viewportRuler=t,this._document=i,this._platform=r,this._overlayContainer=s}global(){return new S1e}connectedTo(t,i,r){return new x1e(i,r,t,this._viewportRuler,this._document,this._platform,this._overlayContainer)}flexibleConnectedTo(t){return new j$(t,this._viewportRuler,this._document,this._platform,this._overlayContainer)}}return n.\u0275fac=function(t){return new(t||n)(Ie(Rm),Ie(fn),Ie(Qi),Ie(Ob))},n.\u0275prov=We({factory:function(){return new n(Ie(Rm),Ie(fn),Ie(Qi),Ie(Ob))},token:n,providedIn:"root"}),n})(),T1e=0,Ec=(()=>{class n{constructor(t,i,r,s,o,a,l,c,u,h,f){this.scrollStrategies=t,this._overlayContainer=i,this._componentFactoryResolver=r,this._positionBuilder=s,this._keyboardDispatcher=o,this._injector=a,this._ngZone=l,this._document=c,this._directionality=u,this._location=h,this._outsideClickDispatcher=f}create(t){const i=this._createHostElement(),r=this._createPaneElement(i),s=this._createPortalOutlet(r),o=new IC(t);return o.direction=o.direction||this._directionality.value,new w1e(s,i,r,o,this._ngZone,this._keyboardDispatcher,this._document,this._location,this._outsideClickDispatcher)}position(){return this._positionBuilder}_createPaneElement(t){const i=this._document.createElement("div");return i.id="cdk-overlay-"+T1e++,i.classList.add("cdk-overlay-pane"),t.appendChild(i),i}_createHostElement(){const t=this._document.createElement("div");return this._overlayContainer.getContainerElement().appendChild(t),t}_createPortalOutlet(t){return this._appRef||(this._appRef=this._injector.get(sh)),new c1e(t,this._componentFactoryResolver,this._appRef,this._injector,this._document)}}return n.\u0275fac=function(t){return new(t||n)(Ie(m1e),Ie(Ob),Ie(El),Ie(C1e),Ie(b1e),Ie(Hn),Ie(pn),Ie(fn),Ie(Il),Ie(kg),Ie(v1e))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();class rTe{constructor(e,t){this.delay=e,this.scheduler=t}call(e,t){return t.subscribe(new PN(e,this.delay,this.scheduler))}}class PN extends y{constructor(e,t,i){super(e),this.delay=t,this.scheduler=i,this.queue=[],this.active=!1,this.errored=!1}static dispatch(e){const t=e.source,i=t.queue,r=e.scheduler,s=e.destination;for(;i.length>0&&i[0].time-r.now()<=0;)i.shift().notification.observe(s);if(i.length>0){const o=Math.max(0,i[0].time-r.now());this.schedule(e,o)}else this.unsubscribe(),t.active=!1}_schedule(e){this.active=!0,this.destination.add(e.schedule(PN.dispatch,this.delay,{source:this,destination:this.destination,scheduler:e}))}scheduleNotification(e){if(!0===this.errored)return;const t=this.scheduler,i=new sTe(t.now()+this.delay,e);this.queue.push(i),!1===this.active&&this._schedule(t)}_next(e){this.scheduleNotification(ga.createNext(e))}_error(e){this.errored=!0,this.queue=[],this.destination.error(e),this.unsubscribe()}_complete(){this.scheduleNotification(ga.createComplete()),this.unsubscribe()}}class sTe{constructor(e,t){this.time=e,this.notification=t}}function oW(...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;se.lift(new WTe(n))}et(7266);class WTe{constructor(e){this.callback=e}call(e,t){return t.subscribe(new qTe(e,this.callback))}}class qTe extends y{constructor(e,t){super(e),this.add(new C(t))}}class fW{}class pW{}class mu{constructor(e){this.normalizedNames=new Map,this.lazyUpdate=null,e?this.lazyInit="string"==typeof e?()=>{this.headers=new Map,e.split("\n").forEach(t=>{const i=t.indexOf(":");if(i>0){const r=t.slice(0,i),s=r.toLowerCase(),o=t.slice(i+1).trim();this.maybeSetNormalizedName(r,s),this.headers.has(s)?this.headers.get(s).push(o):this.headers.set(s,[o])}})}:()=>{this.headers=new Map,Object.keys(e).forEach(t=>{let i=e[t];const r=t.toLowerCase();"string"==typeof i&&(i=[i]),i.length>0&&(this.headers.set(r,i),this.maybeSetNormalizedName(t,r))})}:this.headers=new Map}has(e){return this.init(),this.headers.has(e.toLowerCase())}get(e){this.init();const t=this.headers.get(e.toLowerCase());return t&&t.length>0?t[0]:null}keys(){return this.init(),Array.from(this.normalizedNames.values())}getAll(e){return this.init(),this.headers.get(e.toLowerCase())||null}append(e,t){return this.clone({name:e,value:t,op:"a"})}set(e,t){return this.clone({name:e,value:t,op:"s"})}delete(e,t){return this.clone({name:e,value:t,op:"d"})}maybeSetNormalizedName(e,t){this.normalizedNames.has(t)||this.normalizedNames.set(t,e)}init(){this.lazyInit&&(this.lazyInit instanceof mu?this.copyFrom(this.lazyInit):this.lazyInit(),this.lazyInit=null,this.lazyUpdate&&(this.lazyUpdate.forEach(e=>this.applyUpdate(e)),this.lazyUpdate=null))}copyFrom(e){e.init(),Array.from(e.headers.keys()).forEach(t=>{this.headers.set(t,e.headers.get(t)),this.normalizedNames.set(t,e.normalizedNames.get(t))})}clone(e){const t=new mu;return t.lazyInit=this.lazyInit&&this.lazyInit instanceof mu?this.lazyInit:this,t.lazyUpdate=(this.lazyUpdate||[]).concat([e]),t}applyUpdate(e){const t=e.name.toLowerCase();switch(e.op){case"a":case"s":let i=e.value;if("string"==typeof i&&(i=[i]),0===i.length)return;this.maybeSetNormalizedName(e.name,t);const r=("a"===e.op?this.headers.get(t):void 0)||[];r.push(...i),this.headers.set(t,r);break;case"d":const s=e.value;if(s){let o=this.headers.get(t);if(!o)return;o=o.filter(a=>-1===s.indexOf(a)),0===o.length?(this.headers.delete(t),this.normalizedNames.delete(t)):this.headers.set(t,o)}else this.headers.delete(t),this.normalizedNames.delete(t)}}forEach(e){this.init(),Array.from(this.normalizedNames.keys()).forEach(t=>e(this.normalizedNames.get(t),this.headers.get(t)))}}class YTe{encodeKey(e){return gW(e)}encodeValue(e){return gW(e)}decodeKey(e){return decodeURIComponent(e)}decodeValue(e){return decodeURIComponent(e)}}const KTe=/%(\d[a-f0-9])/gi,QTe={40:"@","3A":":",24:"$","2C":",","3B":";","2B":"+","3D":"=","3F":"?","2F":"/"};function gW(n){return encodeURIComponent(n).replace(KTe,(e,t)=>{var i;return null!==(i=QTe[t])&&void 0!==i?i:e})}function mW(n){return`${n}`}class Lr{constructor(e={}){if(this.updates=null,this.cloneFrom=null,this.encoder=e.encoder||new YTe,e.fromString){if(e.fromObject)throw new Error("Cannot specify both fromString and fromObject.");this.map=function(n,e){const t=new Map;return n.length>0&&n.replace(/^\?/,"").split("&").forEach(r=>{const s=r.indexOf("="),[o,a]=-1==s?[e.decodeKey(r),""]:[e.decodeKey(r.slice(0,s)),e.decodeValue(r.slice(s+1))],l=t.get(o)||[];l.push(a),t.set(o,l)}),t}(e.fromString,this.encoder)}else e.fromObject?(this.map=new Map,Object.keys(e.fromObject).forEach(t=>{const i=e.fromObject[t];this.map.set(t,Array.isArray(i)?i:[i])})):this.map=null}has(e){return this.init(),this.map.has(e)}get(e){this.init();const t=this.map.get(e);return t?t[0]:null}getAll(e){return this.init(),this.map.get(e)||null}keys(){return this.init(),Array.from(this.map.keys())}append(e,t){return this.clone({param:e,value:t,op:"a"})}appendAll(e){const t=[];return Object.keys(e).forEach(i=>{const r=e[i];Array.isArray(r)?r.forEach(s=>{t.push({param:i,value:s,op:"a"})}):t.push({param:i,value:r,op:"a"})}),this.clone(t)}set(e,t){return this.clone({param:e,value:t,op:"s"})}delete(e,t){return this.clone({param:e,value:t,op:"d"})}toString(){return this.init(),this.keys().map(e=>{const t=this.encoder.encodeKey(e);return this.map.get(e).map(i=>t+"="+this.encoder.encodeValue(i)).join("&")}).filter(e=>""!==e).join("&")}clone(e){const t=new Lr({encoder:this.encoder});return t.cloneFrom=this.cloneFrom||this,t.updates=(this.updates||[]).concat(e),t}init(){null===this.map&&(this.map=new Map),null!==this.cloneFrom&&(this.cloneFrom.init(),this.cloneFrom.keys().forEach(e=>this.map.set(e,this.cloneFrom.map.get(e))),this.updates.forEach(e=>{switch(e.op){case"a":case"s":const t=("a"===e.op?this.map.get(e.param):void 0)||[];t.push(mW(e.value)),this.map.set(e.param,t);break;case"d":if(void 0===e.value){this.map.delete(e.param);break}{let i=this.map.get(e.param)||[];const r=i.indexOf(mW(e.value));-1!==r&&i.splice(r,1),i.length>0?this.map.set(e.param,i):this.map.delete(e.param)}}}),this.cloneFrom=this.updates=null)}}class Zs{constructor(){this.map=new Map}set(e,t){return this.map.set(e,t),this}get(e){return this.map.has(e)||this.map.set(e,e.defaultValue()),this.map.get(e)}delete(e){return this.map.delete(e),this}keys(){return this.map.keys()}}function _W(n){return"undefined"!=typeof ArrayBuffer&&n instanceof ArrayBuffer}function yW(n){return"undefined"!=typeof Blob&&n instanceof Blob}function bW(n){return"undefined"!=typeof FormData&&n instanceof FormData}class Rb{constructor(e,t,i,r){let s;if(this.url=t,this.body=null,this.reportProgress=!1,this.withCredentials=!1,this.responseType="json",this.method=e.toUpperCase(),function(n){switch(n){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,s=r):s=i,s&&(this.reportProgress=!!s.reportProgress,this.withCredentials=!!s.withCredentials,s.responseType&&(this.responseType=s.responseType),s.headers&&(this.headers=s.headers),s.context&&(this.context=s.context),s.params&&(this.params=s.params)),this.headers||(this.headers=new mu),this.context||(this.context=new Zs),this.params){const o=this.params.toString();if(0===o.length)this.urlWithParams=t;else{const a=t.indexOf("?");this.urlWithParams=t+(-1===a?"?":af.set(g,e.setHeaders[g]),c)),e.setParams&&(u=Object.keys(e.setParams).reduce((f,g)=>f.set(g,e.setParams[g]),u)),new Rb(i,r,o,{params:u,headers:c,context:h,reportProgress:l,responseType:s,withCredentials:a})}}var vs=(()=>((vs=vs||{})[vs.Sent=0]="Sent",vs[vs.UploadProgress=1]="UploadProgress",vs[vs.ResponseHeader=2]="ResponseHeader",vs[vs.DownloadProgress=3]="DownloadProgress",vs[vs.Response=4]="Response",vs[vs.User=5]="User",vs))();class kN{constructor(e,t=200,i="OK"){this.headers=e.headers||new mu,this.status=void 0!==e.status?e.status:t,this.statusText=e.statusText||i,this.url=e.url||null,this.ok=this.status>=200&&this.status<300}}class FN extends kN{constructor(e={}){super(e),this.type=vs.ResponseHeader}clone(e={}){return new FN({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})}}class RC extends kN{constructor(e={}){super(e),this.type=vs.Response,this.body=void 0!==e.body?e.body:null}clone(e={}){return new RC({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})}}class vW extends kN{constructor(e){super(e,0,"Unknown Error"),this.name="HttpErrorResponse",this.ok=!1,this.message=this.status>=200&&this.status<300?`Http failure during parsing for ${e.url||"(unknown url)"}`:`Http failure response for ${e.url||"(unknown url)"}: ${e.status} ${e.statusText}`,this.error=e.error||null}}function LN(n,e){return{body:e,headers:n.headers,context:n.context,observe:n.observe,params:n.params,reportProgress:n.reportProgress,responseType:n.responseType,withCredentials:n.withCredentials}}let _u=(()=>{class n{constructor(t){this.handler=t}request(t,i,r={}){let s;if(t instanceof Rb)s=t;else{let l,c;l=r.headers instanceof mu?r.headers:new mu(r.headers),r.params&&(c=r.params instanceof Lr?r.params:new Lr({fromObject:r.params})),s=new Rb(t,i,void 0!==r.body?r.body:null,{headers:l,context:r.context,params:c,reportProgress:r.reportProgress,responseType:r.responseType||"json",withCredentials:r.withCredentials})}const o=sn(s).pipe(function(n,e){return V(n,e,1)}(l=>this.handler.handle(l)));if(t instanceof Rb||"events"===r.observe)return o;const a=o.pipe(Ki(l=>l instanceof RC));switch(r.observe||"body"){case"body":switch(s.responseType){case"arraybuffer":return a.pipe(me(l=>{if(null!==l.body&&!(l.body instanceof ArrayBuffer))throw new Error("Response is not an ArrayBuffer.");return l.body}));case"blob":return a.pipe(me(l=>{if(null!==l.body&&!(l.body instanceof Blob))throw new Error("Response is not a Blob.");return l.body}));case"text":return a.pipe(me(l=>{if(null!==l.body&&"string"!=typeof l.body)throw new Error("Response is not a string.");return l.body}));case"json":default:return a.pipe(me(l=>l.body))}case"response":return a;default:throw new Error(`Unreachable: unhandled observe type ${r.observe}}`)}}delete(t,i={}){return this.request("DELETE",t,i)}get(t,i={}){return this.request("GET",t,i)}head(t,i={}){return this.request("HEAD",t,i)}jsonp(t,i){return this.request("JSONP",t,{params:(new Lr).append(i,"JSONP_CALLBACK"),observe:"body",responseType:"json"})}options(t,i={}){return this.request("OPTIONS",t,i)}patch(t,i,r={}){return this.request("PATCH",t,LN(r,i))}post(t,i,r={}){return this.request("POST",t,LN(r,i))}put(t,i,r={}){return this.request("PUT",t,LN(r,i))}}return n.\u0275fac=function(t){return new(t||n)(Ie(fW))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();class wW{constructor(e,t){this.next=e,this.interceptor=t}handle(e){return this.interceptor.intercept(e,this.next)}}const EW=new Ht("HTTP_INTERCEPTORS");let eAe=(()=>{class n{intercept(t,i){return i.handle(t)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const tAe=/^\)\]\}',?\n/;let xW=(()=>{class n{constructor(t){this.xhrFactory=t}handle(t){if("JSONP"===t.method)throw new Error("Attempted to construct Jsonp request without HttpClientJsonpModule installed.");return new O(i=>{const r=this.xhrFactory.build();if(r.open(t.method,t.urlWithParams),t.withCredentials&&(r.withCredentials=!0),t.headers.forEach((g,m)=>r.setRequestHeader(g,m.join(","))),t.headers.has("Accept")||r.setRequestHeader("Accept","application/json, text/plain, */*"),!t.headers.has("Content-Type")){const g=t.detectContentTypeHeader();null!==g&&r.setRequestHeader("Content-Type",g)}if(t.responseType){const g=t.responseType.toLowerCase();r.responseType="json"!==g?g:"text"}const s=t.serializeBody();let o=null;const a=()=>{if(null!==o)return o;const g=1223===r.status?204:r.status,m=r.statusText||"OK",w=new mu(r.getAllResponseHeaders()),x=function(n){return"responseURL"in n&&n.responseURL?n.responseURL:/^X-Request-URL:/m.test(n.getAllResponseHeaders())?n.getResponseHeader("X-Request-URL"):null}(r)||t.url;return o=new FN({headers:w,status:g,statusText:m,url:x}),o},l=()=>{let{headers:g,status:m,statusText:w,url:x}=a(),U=null;204!==m&&(U=void 0===r.response?r.responseText:r.response),0===m&&(m=U?200:0);let D=m>=200&&m<300;if("json"===t.responseType&&"string"==typeof U){const ie=U;U=U.replace(tAe,"");try{U=""!==U?JSON.parse(U):null}catch(_e){U=ie,D&&(D=!1,U={error:_e,text:U})}}D?(i.next(new RC({body:U,headers:g,status:m,statusText:w,url:x||void 0})),i.complete()):i.error(new vW({error:U,headers:g,status:m,statusText:w,url:x||void 0}))},c=g=>{const{url:m}=a(),w=new vW({error:g,status:r.status||0,statusText:r.statusText||"Unknown Error",url:m||void 0});i.error(w)};let u=!1;const h=g=>{u||(i.next(a()),u=!0);let m={type:vs.DownloadProgress,loaded:g.loaded};g.lengthComputable&&(m.total=g.total),"text"===t.responseType&&!!r.responseText&&(m.partialText=r.responseText),i.next(m)},f=g=>{let m={type:vs.UploadProgress,loaded:g.loaded};g.lengthComputable&&(m.total=g.total),i.next(m)};return r.addEventListener("load",l),r.addEventListener("error",c),r.addEventListener("timeout",c),r.addEventListener("abort",c),t.reportProgress&&(r.addEventListener("progress",h),null!==s&&r.upload&&r.upload.addEventListener("progress",f)),r.send(s),i.next({type:vs.Sent}),()=>{r.removeEventListener("error",c),r.removeEventListener("abort",c),r.removeEventListener("load",l),r.removeEventListener("timeout",c),t.reportProgress&&(r.removeEventListener("progress",h),null!==s&&r.upload&&r.upload.removeEventListener("progress",f)),r.readyState!==r.DONE&&r.abort()}})}}return n.\u0275fac=function(t){return new(t||n)(Ie(oV))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const BN=new Ht("XSRF_COOKIE_NAME"),VN=new Ht("XSRF_HEADER_NAME");class SW{}let iAe=(()=>{class n{constructor(t,i,r){this.doc=t,this.platform=i,this.cookieName=r,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=YB(t,this.cookieName),this.lastCookieString=t),this.lastToken}}return n.\u0275fac=function(t){return new(t||n)(Ie(fn),Ie(Xc),Ie(BN))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),jN=(()=>{class n{constructor(t,i){this.tokenService=t,this.headerName=i}intercept(t,i){const r=t.url.toLowerCase();if("GET"===t.method||"HEAD"===t.method||r.startsWith("http://")||r.startsWith("https://"))return i.handle(t);const s=this.tokenService.getToken();return null!==s&&!t.headers.has(this.headerName)&&(t=t.clone({headers:t.headers.set(this.headerName,s)})),i.handle(t)}}return n.\u0275fac=function(t){return new(t||n)(Ie(SW),Ie(VN))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),rAe=(()=>{class n{constructor(t,i){this.backend=t,this.injector=i,this.chain=null}handle(t){if(null===this.chain){const i=this.injector.get(EW,[]);this.chain=i.reduceRight((r,s)=>new wW(r,s),this.backend)}return this.chain.handle(t)}}return n.\u0275fac=function(t){return new(t||n)(Ie(pW),Ie(Hn))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),sAe=(()=>{class n{static disable(){return{ngModule:n,providers:[{provide:jN,useClass:eAe}]}}static withOptions(t={}){return{ngModule:n,providers:[t.cookieName?{provide:BN,useValue:t.cookieName}:[],t.headerName?{provide:VN,useValue:t.headerName}:[]]}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=tn({type:n}),n.\u0275inj=St({providers:[jN,{provide:EW,useExisting:jN,multi:!0},{provide:SW,useClass:iAe},{provide:BN,useValue:"XSRF-TOKEN"},{provide:VN,useValue:"X-XSRF-TOKEN"}]}),n})(),CW=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=tn({type:n}),n.\u0275inj=St({providers:[_u,{provide:fW,useClass:rAe},xW,{provide:pW,useExisting:xW}],imports:[[sAe.withOptions({cookieName:"XSRF-TOKEN",headerName:"X-XSRF-TOKEN"})]]}),n})();const oAe=["*"];function TW(n){return Error(`Unable to find icon with the name "${n}"`)}function AW(n){return Error(`The URL provided to MatIconRegistry was not trusted as a resource URL via Angular's DomSanitizer. Attempted URL was "${n}".`)}function MW(n){return Error(`The literal provided to MatIconRegistry was not trusted as safe HTML by Angular's DomSanitizer. Attempted literal was "${n}".`)}class rp{constructor(e,t,i){this.url=e,this.svgText=t,this.options=i}}let PC=(()=>{class n{constructor(t,i,r,s){this._httpClient=t,this._sanitizer=i,this._errorHandler=s,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=r}addSvgIcon(t,i,r){return this.addSvgIconInNamespace("",t,i,r)}addSvgIconLiteral(t,i,r){return this.addSvgIconLiteralInNamespace("",t,i,r)}addSvgIconInNamespace(t,i,r,s){return this._addSvgIconConfig(t,i,new rp(r,null,s))}addSvgIconResolver(t){return this._resolvers.push(t),this}addSvgIconLiteralInNamespace(t,i,r,s){const o=this._sanitizer.sanitize(si.HTML,r);if(!o)throw MW(r);return this._addSvgIconConfig(t,i,new rp("",o,s))}addSvgIconSet(t,i){return this.addSvgIconSetInNamespace("",t,i)}addSvgIconSetLiteral(t,i){return this.addSvgIconSetLiteralInNamespace("",t,i)}addSvgIconSetInNamespace(t,i,r){return this._addSvgIconSetConfig(t,new rp(i,null,r))}addSvgIconSetLiteralInNamespace(t,i,r){const s=this._sanitizer.sanitize(si.HTML,i);if(!s)throw MW(i);return this._addSvgIconSetConfig(t,new rp("",s,r))}registerFontClassAlias(t,i=t){return this._fontCssClassesByAlias.set(t,i),this}classNameForFontAlias(t){return this._fontCssClassesByAlias.get(t)||t}setDefaultFontSetClass(t){return this._defaultFontSetClass=t,this}getDefaultFontSetClass(){return this._defaultFontSetClass}getSvgIconFromUrl(t){const i=this._sanitizer.sanitize(si.RESOURCE_URL,t);if(!i)throw AW(t);const r=this._cachedIconsByUrl.get(i);return r?sn(NC(r)):this._loadSvgIconFromConfig(new rp(t,null)).pipe(cr(s=>this._cachedIconsByUrl.set(i,s)),me(s=>NC(s)))}getNamedSvgIcon(t,i=""){const r=DW(i,t);let s=this._svgIconConfigs.get(r);if(s)return this._getSvgFromConfig(s);if(s=this._getIconConfigFromResolvers(i,t),s)return this._svgIconConfigs.set(r,s),this._getSvgFromConfig(s);const o=this._iconSetConfigs.get(i);return o?this._getSvgFromIconSetConfigs(t,o):Fg(TW(r))}ngOnDestroy(){this._resolvers=[],this._svgIconConfigs.clear(),this._iconSetConfigs.clear(),this._cachedIconsByUrl.clear()}_getSvgFromConfig(t){return t.svgText?sn(NC(this._svgElementFromConfig(t))):this._loadSvgIconFromConfig(t).pipe(me(i=>NC(i)))}_getSvgFromIconSetConfigs(t,i){const r=this._extractIconWithNameFromAnySet(t,i);return r?sn(r):fb(i.filter(o=>!o.svgText).map(o=>this._loadSvgIconSetFromConfig(o).pipe(bc(a=>{const c=`Loading icon set URL: ${this._sanitizer.sanitize(si.RESOURCE_URL,o.url)} failed: ${a.message}`;return this._errorHandler.handleError(new Error(c)),sn(null)})))).pipe(me(()=>{const o=this._extractIconWithNameFromAnySet(t,i);if(!o)throw TW(t);return o}))}_extractIconWithNameFromAnySet(t,i){for(let r=i.length-1;r>=0;r--){const s=i[r];if(s.svgText&&s.svgText.indexOf(t)>-1){const o=this._svgElementFromConfig(s),a=this._extractSvgIconFromSet(o,t,s.options);if(a)return a}}return null}_loadSvgIconFromConfig(t){return this._fetchIcon(t).pipe(cr(i=>t.svgText=i),me(()=>this._svgElementFromConfig(t)))}_loadSvgIconSetFromConfig(t){return t.svgText?sn(null):this._fetchIcon(t).pipe(cr(i=>t.svgText=i))}_extractSvgIconFromSet(t,i,r){const s=t.querySelector(`[id="${i}"]`);if(!s)return null;const o=s.cloneNode(!0);if(o.removeAttribute("id"),"svg"===o.nodeName.toLowerCase())return this._setSvgAttributes(o,r);if("symbol"===o.nodeName.toLowerCase())return this._setSvgAttributes(this._toSvgElement(o),r);const a=this._svgElementFromString("");return a.appendChild(o),this._setSvgAttributes(a,r)}_svgElementFromString(t){const i=this._document.createElement("DIV");i.innerHTML=t;const r=i.querySelector("svg");if(!r)throw Error(" tag not found");return r}_toSvgElement(t){const i=this._svgElementFromString(""),r=t.attributes;for(let s=0;sthis._inProgressUrlFetches.delete(a)),ws());return this._inProgressUrlFetches.set(a,c),c}_addSvgIconConfig(t,i,r){return this._svgIconConfigs.set(DW(t,i),r),this}_addSvgIconSetConfig(t,i){const r=this._iconSetConfigs.get(t);return r?r.push(i):this._iconSetConfigs.set(t,[i]),this}_svgElementFromConfig(t){if(!t.svgElement){const i=this._svgElementFromString(t.svgText);this._setSvgAttributes(i,t.options),t.svgElement=i}return t.svgElement}_getIconConfigFromResolvers(t,i){for(let r=0;re?e.pathname+e.search:""}}}),IW=["clip-path","color-profile","src","cursor","fill","filter","marker","marker-start","marker-mid","marker-end","mask","stroke"],pAe=IW.map(n=>`[${n}]`).join(", "),gAe=/^url\(['"]?#(.*?)['"]?\)$/;let Fm=(()=>{class n extends uAe{constructor(t,i,r,s,o){super(t),this._iconRegistry=i,this._location=s,this._errorHandler=o,this._inline=!1,this._currentIconFetch=C.EMPTY,r||t.nativeElement.setAttribute("aria-hidden","true")}get inline(){return this._inline}set inline(t){this._inline=bi(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 i=this._cleanupFontValue(t);i!==this._fontSet&&(this._fontSet=i,this._updateFontIconClasses())}get fontIcon(){return this._fontIcon}set fontIcon(t){const i=this._cleanupFontValue(t);i!==this._fontIcon&&(this._fontIcon=i,this._updateFontIconClasses())}_splitIconName(t){if(!t)return["",""];const i=t.split(":");switch(i.length){case 1:return["",i[0]];case 2:return i;default:throw Error(`Invalid icon name: "${t}"`)}}ngOnInit(){this._updateFontIconClasses()}ngAfterViewChecked(){const t=this._elementsWithExternalReferences;if(t&&t.size){const i=this._location.getPathname();i!==this._previousPath&&(this._previousPath=i,this._prependPathToReferences(i))}}ngOnDestroy(){this._currentIconFetch.unsubscribe(),this._elementsWithExternalReferences&&this._elementsWithExternalReferences.clear()}_usingFontIcon(){return!this.svgIcon}_setSvgElement(t){this._clearSvgElement();const i=t.querySelectorAll("style");for(let s=0;s{r.forEach(o=>{s.setAttribute(o.name,`url('${t}#${o.value}')`)})})}_cacheChildrenWithExternalReferences(t){const i=t.querySelectorAll(pAe),r=this._elementsWithExternalReferences=this._elementsWithExternalReferences||new Map;for(let s=0;s{const a=i[s],l=a.getAttribute(o),c=l?l.match(gAe):null;if(c){let u=r.get(a);u||(u=[],r.set(a,u)),u.push({name:o,value:c[1]})}})}_updateSvgIcon(t){if(this._svgNamespace=null,this._svgName=null,this._currentIconFetch.unsubscribe(),t){const[i,r]=this._splitIconName(t);i&&(this._svgNamespace=i),r&&(this._svgName=r),this._currentIconFetch=this._iconRegistry.getNamedSvgIcon(r,i).pipe(qr(1)).subscribe(s=>this._setSvgElement(s),s=>{this._errorHandler.handleError(new Error(`Error retrieving icon ${i}:${r}! ${s.message}`))})}}}return n.\u0275fac=function(t){return new(t||n)(Ce(gn),Ce(PC),yo("aria-hidden"),Ce(dAe),Ce(la))},n.\u0275cmp=rn({type:n,selectors:[["mat-icon"]],hostAttrs:["role","img",1,"mat-icon","notranslate"],hostVars:7,hostBindings:function(t,i){2&t&&(Ii("data-mat-icon-type",i._usingFontIcon()?"font":"svg")("data-mat-icon-name",i._svgName||i.fontIcon)("data-mat-icon-namespace",i._svgNamespace||i.fontSet),ai("mat-icon-inline",i.inline)("mat-icon-no-color","primary"!==i.color&&"accent"!==i.color&&"warn"!==i.color))},inputs:{color:"color",inline:"inline",svgIcon:"svgIcon",fontSet:"fontSet",fontIcon:"fontIcon"},exportAs:["matIcon"],features:[En],ngContentSelectors:oAe,decls:1,vars:0,template:function(t,i){1&t&&(Hr(),oi(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}),n})();function TAe(n,e){}class zN{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 AAe={dialogContainer:Em("dialogContainer",[wc("void, exit",ds({opacity:0,transform:"scale(0.7)"})),wc("enter",ds({transform:"none"})),pd("* => enter",fd("150ms cubic-bezier(0, 0, 0.2, 1)",ds({transform:"none",opacity:1}))),pd("* => void, * => exit",fd("75ms cubic-bezier(0.4, 0.0, 0.2, 1)",ds({opacity:0})))])};let MAe=(()=>{class n extends MC{constructor(t,i,r,s,o,a){super(),this._elementRef=t,this._focusTrapFactory=i,this._changeDetectorRef=r,this._config=o,this._focusMonitor=a,this._animationStateChanged=new ln,this._elementFocusedBeforeDialogWasOpened=null,this._closeInteractionType=null,this.attachDomPortal=l=>(this._portalOutlet.hasAttached(),this._portalOutlet.attachDomPortal(l)),this._ariaLabelledBy=o.ariaLabelledBy||null,this._document=s}_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 i=KS(),r=this._elementRef.nativeElement;(!i||i===this._document.body||i===r||r.contains(i))&&(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=KS())}_focusDialogContainer(){this._elementRef.nativeElement.focus&&this._elementRef.nativeElement.focus()}_containsFocus(){const t=this._elementRef.nativeElement,i=KS();return t===i||t.contains(i)}}return n.\u0275fac=function(t){return new(t||n)(Ce(gn),Ce(Y6),Ce(Mr),Ce(fn,8),Ce(zN),Ce(vc))},n.\u0275dir=Nt({type:n,viewQuery:function(t,i){if(1&t&&hr(np,7),2&t){let r;Gn(r=$n())&&(i._portalOutlet=r.first)}},features:[En]}),n})(),DAe=(()=>{class n extends MAe{constructor(){super(...arguments),this._state="enter"}_onAnimationDone({toState:t,totalTime:i}){"enter"===t?(this._trapFocus(),this._animationStateChanged.next({state:"opened",totalTime:i})):"exit"===t&&(this._restoreFocus(),this._animationStateChanged.next({state:"closed",totalTime:i}))}_onAnimationStart({toState:t,totalTime:i}){"enter"===t?this._animationStateChanged.next({state:"opening",totalTime:i}):("exit"===t||"void"===t)&&this._animationStateChanged.next({state:"closing",totalTime:i})}_startExitAnimation(){this._state="exit",this._changeDetectorRef.markForCheck()}}return n.\u0275fac=function(){let e;return function(i){return(e||(e=zi(n)))(i||n)}}(),n.\u0275cmp=rn({type:n,selectors:[["mat-dialog-container"]],hostAttrs:["tabindex","-1","aria-modal","true",1,"mat-dialog-container"],hostVars:6,hostBindings:function(t,i){1&t&&uE("@dialogContainer.start",function(s){return i._onAnimationStart(s)})("@dialogContainer.done",function(s){return i._onAnimationDone(s)}),2&t&&(qc("id",i._id),Ii("role",i._config.role)("aria-labelledby",i._config.ariaLabel?null:i._ariaLabelledBy)("aria-label",i._config.ariaLabel)("aria-describedby",i._config.ariaDescribedBy||null),fE("@dialogContainer",i._state))},features:[En],decls:1,vars:0,consts:[["cdkPortalOutlet",""]],template:function(t,i){1&t&&wi(0,TAe,0,0,"ng-template",0)},directives:[np],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:[AAe.dialogContainer]}}),n})(),IAe=0;class kC{constructor(e,t,i="mat-dialog-"+IAe++){this._overlayRef=e,this._containerInstance=t,this.id=i,this.disableClose=this._containerInstance._config.disableClose,this._afterOpened=new oe,this._afterClosed=new oe,this._beforeClosed=new oe,this._state=0,t._id=i,t._animationStateChanged.pipe(Ki(r=>"opened"===r.state),qr(1)).subscribe(()=>{this._afterOpened.next(),this._afterOpened.complete()}),t._animationStateChanged.pipe(Ki(r=>"closed"===r.state),qr(1)).subscribe(()=>{clearTimeout(this._closeFallbackTimeout),this._finishDialogClose()}),e.detachments().subscribe(()=>{this._beforeClosed.next(this._result),this._beforeClosed.complete(),this._afterClosed.next(this._result),this._afterClosed.complete(),this.componentInstance=null,this._overlayRef.dispose()}),e.keydownEvents().pipe(Ki(r=>27===r.keyCode&&!this.disableClose&&!Dl(r))).subscribe(r=>{r.preventDefault(),HN(this,"keyboard")}),e.backdropClick().subscribe(()=>{this.disableClose?this._containerInstance._recaptureFocus():HN(this,"mouse")})}close(e){this._result=e,this._containerInstance._animationStateChanged.pipe(Ki(t=>"closing"===t.state),qr(1)).subscribe(t=>{this._beforeClosed.next(e),this._beforeClosed.complete(),this._overlayRef.detachBackdrop(),this._closeFallbackTimeout=setTimeout(()=>this._finishDialogClose(),t.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(e){let 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}updateSize(e="",t=""){return this._overlayRef.updateSize({width:e,height:t}),this._overlayRef.updatePosition(),this}addPanelClass(e){return this._overlayRef.addPanelClass(e),this}removePanelClass(e){return this._overlayRef.removePanelClass(e),this}getState(){return this._state}_finishDialogClose(){this._state=2,this._overlayRef.dispose()}_getPositionStrategy(){return this._overlayRef.getConfig().positionStrategy}}function HN(n,e,t){return void 0!==n._containerInstance&&(n._containerInstance._closeInteractionType=e),n.close(t)}const PW=new Ht("MatDialogData"),OAe=new Ht("mat-dialog-default-options"),NW=new Ht("mat-dialog-scroll-strategy");let NAe=(()=>{class n{constructor(t,i,r,s,o,a,l,c,u){this._overlay=t,this._injector=i,this._defaultOptions=r,this._parentDialog=s,this._overlayContainer=o,this._dialogRefConstructor=l,this._dialogContainerType=c,this._dialogDataToken=u,this._openDialogsAtThisLevel=[],this._afterAllClosedAtThisLevel=new oe,this._afterOpenedAtThisLevel=new oe,this._ariaHiddenElements=new Map,this.afterAllClosed=function(n){return new O(e=>{let t;try{t=n()}catch(r){return void e.error(r)}return(t?je(t):b0()).subscribe(e)})}(()=>this.openDialogs.length?this._getAfterAllClosed():this._getAfterAllClosed().pipe(Oo(void 0))),this._scrollStrategy=a}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,i){(i=function(n,e){return Object.assign(Object.assign({},e),n)}(i,this._defaultOptions||new zN)).id&&this.getDialogById(i.id);const r=this._createOverlay(i),s=this._attachDialogContainer(r,i),o=this._attachDialogContent(t,s,r,i);return this.openDialogs.length||this._hideNonDialogContentFromAssistiveTechnology(),this.openDialogs.push(o),o.afterClosed().subscribe(()=>this._removeOpenDialog(o)),this.afterOpened.next(o),s._initializeWithAttachedContent(),o}closeAll(){this._closeDialogs(this.openDialogs)}getDialogById(t){return this.openDialogs.find(i=>i.id===t)}ngOnDestroy(){this._closeDialogs(this._openDialogsAtThisLevel),this._afterAllClosedAtThisLevel.complete(),this._afterOpenedAtThisLevel.complete()}_createOverlay(t){const i=this._getOverlayConfig(t);return this._overlay.create(i)}_getOverlayConfig(t){const i=new IC({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&&(i.backdropClass=t.backdropClass),i}_attachDialogContainer(t,i){const s=Hn.create({parent:i&&i.viewContainerRef&&i.viewContainerRef.injector||this._injector,providers:[{provide:zN,useValue:i}]}),o=new AC(this._dialogContainerType,i.viewContainerRef,s,i.componentFactoryResolver);return t.attach(o).instance}_attachDialogContent(t,i,r,s){const o=new this._dialogRefConstructor(r,i,s.id);if(t instanceof Go)i.attachTemplatePortal(new Pm(t,null,{$implicit:s.data,dialogRef:o}));else{const a=this._createInjector(s,o,i),l=i.attachComponentPortal(new AC(t,s.viewContainerRef,a));o.componentInstance=l.instance}return o.updateSize(s.width,s.height).updatePosition(s.position),o}_createInjector(t,i,r){const s=t&&t.viewContainerRef&&t.viewContainerRef.injector,o=[{provide:this._dialogContainerType,useValue:r},{provide:this._dialogDataToken,useValue:t.data},{provide:this._dialogRefConstructor,useValue:i}];return t.direction&&(!s||!s.get(Il,null,xn.Optional))&&o.push({provide:Il,useValue:{value:t.direction,change:sn()}}),Hn.create({parent:s||this._injector,providers:o})}_removeOpenDialog(t){const i=this.openDialogs.indexOf(t);i>-1&&(this.openDialogs.splice(i,1),this.openDialogs.length||(this._ariaHiddenElements.forEach((r,s)=>{r?s.setAttribute("aria-hidden",r):s.removeAttribute("aria-hidden")}),this._ariaHiddenElements.clear(),this._getAfterAllClosed().next()))}_hideNonDialogContentFromAssistiveTechnology(){const t=this._overlayContainer.getContainerElement();if(t.parentElement){const i=t.parentElement.children;for(let r=i.length-1;r>-1;r--){let s=i[r];s!==t&&"SCRIPT"!==s.nodeName&&"STYLE"!==s.nodeName&&!s.hasAttribute("aria-live")&&(this._ariaHiddenElements.set(s,s.getAttribute("aria-hidden")),s.setAttribute("aria-hidden","true"))}}}_closeDialogs(t){let i=t.length;for(;i--;)t[i].close()}}return n.\u0275fac=function(t){return new(t||n)(Ce(Ec),Ce(Hn),Ce(void 0),Ce(void 0),Ce(Ob),Ce(void 0),Ce(Du),Ce(Du),Ce(Ht))},n.\u0275dir=Nt({type:n}),n})(),Nb=(()=>{class n extends NAe{constructor(t,i,r,s,o,a,l){super(t,i,s,a,l,o,kC,DAe,PW)}}return n.\u0275fac=function(t){return new(t||n)(Ie(Ec),Ie(Hn),Ie(kg,8),Ie(OAe,8),Ie(NW),Ie(n,12),Ie(Ob))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),FAe=0,kW=(()=>{class n{constructor(t,i,r){this._dialogRef=t,this._elementRef=i,this._dialog=r,this.id="mat-dialog-title-"+FAe++}ngOnInit(){this._dialogRef||(this._dialogRef=function(n,e){let t=n.nativeElement.parentElement;for(;t&&!t.classList.contains("mat-dialog-container");)t=t.parentElement;return t?e.find(i=>i.id===t.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 n.\u0275fac=function(t){return new(t||n)(Ce(kC,8),Ce(gn),Ce(Nb))},n.\u0275dir=Nt({type:n,selectors:[["","mat-dialog-title",""],["","matDialogTitle",""]],hostAttrs:[1,"mat-dialog-title"],hostVars:1,hostBindings:function(t,i){2&t&&qc("id",i.id)},inputs:{id:"id"},exportAs:["matDialogTitle"]}),n})(),FW=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275dir=Nt({type:n,selectors:[["","mat-dialog-content",""],["mat-dialog-content"],["","matDialogContent",""]],hostAttrs:[1,"mat-dialog-content"]}),n})();const $N=new Ht("CdkAccordion");let VAe=0,UAe=(()=>{class n{constructor(t,i,r){this.accordion=t,this._changeDetectorRef=i,this._expansionDispatcher=r,this._openCloseAllSubscription=C.EMPTY,this.closed=new ln,this.opened=new ln,this.destroyed=new ln,this.expandedChange=new ln,this.id="cdk-accordion-child-"+VAe++,this._expanded=!1,this._disabled=!1,this._removeUniqueSelectionListener=()=>{},this._removeUniqueSelectionListener=r.listen((s,o)=>{this.accordion&&!this.accordion.multi&&this.accordion.id===o&&this.id!==s&&(this.expanded=!1)}),this.accordion&&(this._openCloseAllSubscription=this._subscribeToOpenCloseAllActions())}get expanded(){return this._expanded}set expanded(t){t=bi(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=bi(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 n.\u0275fac=function(t){return new(t||n)(Ce($N,12),Ce(Mr),Ce(A$))},n.\u0275dir=Nt({type:n,selectors:[["cdk-accordion-item"],["","cdkAccordionItem",""]],inputs:{expanded:"expanded",disabled:"disabled"},outputs:{closed:"closed",opened:"opened",destroyed:"destroyed",expandedChange:"expandedChange"},exportAs:["cdkAccordionItem"],features:[Vn([{provide:$N,useValue:void 0}])]}),n})();const HAe=["body"];function GAe(n,e){}const $Ae=[[["mat-expansion-panel-header"]],"*",[["mat-action-row"]]],WAe=["mat-expansion-panel-header","*","mat-action-row"];function qAe(n,e){1&n&&ni(0,"span",2),2&n&&Jt("@indicatorRotate",_i()._getExpandedState())}const YAe=[[["mat-panel-title"]],[["mat-panel-description"]],"*"],XAe=["mat-panel-title","mat-panel-description","*"],WN=new Ht("MAT_ACCORDION"),BW="225ms cubic-bezier(0.4,0.0,0.2,1)",VW={indicatorRotate:Em("indicatorRotate",[wc("collapsed, void",ds({transform:"rotate(0deg)"})),wc("expanded",ds({transform:"rotate(180deg)"})),pd("expanded <=> collapsed, void => collapsed",fd(BW))]),bodyExpansion:Em("bodyExpansion",[wc("collapsed, void",ds({height:"0px",visibility:"hidden"})),wc("expanded",ds({height:"*",visibility:"visible"})),pd("expanded <=> collapsed, void => collapsed",fd(BW))])};let KAe=(()=>{class n{constructor(t){this._template=t}}return n.\u0275fac=function(t){return new(t||n)(Ce(Go))},n.\u0275dir=Nt({type:n,selectors:[["ng-template","matExpansionPanelContent",""]]}),n})(),QAe=0;const jW=new Ht("MAT_EXPANSION_PANEL_DEFAULT_OPTIONS");let UW=(()=>{class n extends UAe{constructor(t,i,r,s,o,a,l){super(t,i,r),this._viewContainerRef=s,this._animationMode=a,this._hideToggle=!1,this.afterExpand=new ln,this.afterCollapse=new ln,this._inputChanges=new oe,this._headerId="mat-expansion-panel-header-"+QAe++,this._bodyAnimationDone=new oe,this.accordion=t,this._document=o,this._bodyAnimationDone.pipe(ld((c,u)=>c.fromState===u.fromState&&c.toState===u.toState)).subscribe(c=>{"void"!==c.fromState&&("expanded"===c.toState?this.afterExpand.emit():"collapsed"===c.toState&&this.afterCollapse.emit())}),l&&(this.hideToggle=l.hideToggle)}get hideToggle(){return this._hideToggle||this.accordion&&this.accordion.hideToggle}set hideToggle(t){this._hideToggle=bi(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(Oo(null),Ki(()=>this.expanded&&!this._portal),qr(1)).subscribe(()=>{this._portal=new Pm(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,i=this._body.nativeElement;return t===i||i.contains(t)}return!1}}return n.\u0275fac=function(t){return new(t||n)(Ce(WN,12),Ce(Mr),Ce(A$),Ce(Rs),Ce(fn),Ce(Qa,8),Ce(jW,8))},n.\u0275cmp=rn({type:n,selectors:[["mat-expansion-panel"]],contentQueries:function(t,i,r){if(1&t&&function(n,e,t,i){const r=Si();if(r.firstCreatePass){const s=as();I3(r,new A3(e,t,i),s.index),function(n,e){const t=n.contentQueries||(n.contentQueries=[]);e!==(t.length?t[t.length-1]:-1)&&t.push(n.queries.length-1,e)}(r,n),2==(2&t)&&(r.staticContentQueries=!0)}D3(r,Vt(),t)}(r,KAe,5),2&t){let s;Gn(s=$n())&&(i._lazyContent=s.first)}},viewQuery:function(t,i){if(1&t&&hr(HAe,5),2&t){let r;Gn(r=$n())&&(i._body=r.first)}},hostAttrs:[1,"mat-expansion-panel"],hostVars:6,hostBindings:function(t,i){2&t&&ai("mat-expanded",i.expanded)("_mat-animation-noopable","NoopAnimations"===i._animationMode)("mat-expansion-panel-spacing",i._hasSpacing())},inputs:{disabled:"disabled",expanded:"expanded",hideToggle:"hideToggle",togglePosition:"togglePosition"},outputs:{opened:"opened",closed:"closed",expandedChange:"expandedChange",afterExpand:"afterExpand",afterCollapse:"afterCollapse"},exportAs:["matExpansionPanel"],features:[Vn([{provide:WN,useValue:void 0}]),En,Fi],ngContentSelectors:WAe,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,i){1&t&&(Hr($Ae),oi(0),wt(1,"div",0,1),Tn("@bodyExpansion.done",function(s){return i._bodyAnimationDone.next(s)}),wt(3,"div",2),oi(4,1),wi(5,GAe,0,0,"ng-template",3),Et(),oi(6,2),Et()),2&t&&(zt(1),Jt("@bodyExpansion",i._getExpandedState())("id",i.id),Ii("aria-labelledby",i._headerId),zt(4),Jt("cdkPortalOutlet",i._portal))},directives:[np],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:[VW.bodyExpansion]},changeDetection:0}),n})();class JAe{}const eMe=wC(JAe);let zW=(()=>{class n extends eMe{constructor(t,i,r,s,o,a,l){super(),this.panel=t,this._element=i,this._focusMonitor=r,this._changeDetectorRef=s,this._animationMode=a,this._parentChangeSubscription=C.EMPTY;const c=t.accordion?t.accordion._stateChanges.pipe(Ki(u=>!(!u.hideToggle&&!u.togglePosition))):Qc;this.tabIndex=parseInt(l||"")||0,this._parentChangeSubscription=Nn(t.opened,t.closed,c,t._inputChanges.pipe(Ki(u=>!!(u.hideToggle||u.disabled||u.togglePosition)))).subscribe(()=>this._changeDetectorRef.markForCheck()),t.closed.pipe(Ki(()=>t._containsFocus())).subscribe(()=>r.focusVia(i,"program")),o&&(this.expandedHeight=o.expandedHeight,this.collapsedHeight=o.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:Dl(t)||(t.preventDefault(),this._toggle());break;default:return void(this.panel.accordion&&this.panel.accordion._handleHeaderKeydown(t))}}focus(t,i){t?this._focusMonitor.focusVia(this._element,t,i):this._element.nativeElement.focus(i)}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 n.\u0275fac=function(t){return new(t||n)(Ce(UW,1),Ce(gn),Ce(vc),Ce(Mr),Ce(jW,8),Ce(Qa,8),yo("tabindex"))},n.\u0275cmp=rn({type:n,selectors:[["mat-expansion-panel-header"]],hostAttrs:["role","button",1,"mat-expansion-panel-header","mat-focus-indicator"],hostVars:15,hostBindings:function(t,i){1&t&&Tn("click",function(){return i._toggle()})("keydown",function(s){return i._keydown(s)}),2&t&&(Ii("id",i.panel._headerId)("tabindex",i.tabIndex)("aria-controls",i._getPanelId())("aria-expanded",i._isExpanded())("aria-disabled",i.panel.disabled),zy("height",i._getHeaderHeight()),ai("mat-expanded",i._isExpanded())("mat-expansion-toggle-indicator-after","after"===i._getTogglePosition())("mat-expansion-toggle-indicator-before","before"===i._getTogglePosition())("_mat-animation-noopable","NoopAnimations"===i._animationMode))},inputs:{tabIndex:"tabIndex",expandedHeight:"expandedHeight",collapsedHeight:"collapsedHeight"},features:[En],ngContentSelectors:XAe,decls:5,vars:1,consts:[[1,"mat-content"],["class","mat-expansion-indicator",4,"ngIf"],[1,"mat-expansion-indicator"]],template:function(t,i){1&t&&(Hr(YAe),wt(0,"span",0),oi(1),oi(2,1),oi(3,2),Et(),wi(4,qAe,1,1,"span",1)),2&t&&(zt(4),Jt("ngIf",i._showToggle()))},directives:[ac],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:[VW.indicatorRotate]},changeDetection:0}),n})();var HW=et(5478);Object.create(Error.prototype);const sMe=["*"];var LC=(()=>(function(n){n.LineHighlight="line-highlight",n.LineNumbers="line-numbers"}(LC||(LC={})),LC))();class aMe{}const $W=new Ht("SECURITY_CONTEXT");let qN=(()=>{class n{constructor(t,i,r,s,o){this.platform=t,this.securityContext=i,this.http=r,this.sanitizer=o,this.initialMarkedOptions={renderer:new HW.Renderer},this.options=s}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,i=!1,r=!1,s=this.options){const o=this.trimIndentation(t),a=i?this.decodeHtml(o):o,l=r?this.renderEmoji(a):a,c=HW.parse(l,s);return this.sanitizer.sanitize(this.securityContext,c)||""}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(me(i=>this.handleExtension(t,i)))}highlight(t){if(Af(this.platform)&&"undefined"!=typeof Prism){t||(t=document);const i=t.querySelectorAll('pre code:not([class*="language-"])');Array.prototype.forEach.call(i,r=>r.classList.add("language-none")),Prism.highlightAllUnder(t)}}renderKatex(t,i){if(!Af(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,(r,s)=>katex.renderToString(s,i))}decodeHtml(t){if(!Af(this.platform))return t;const i=document.createElement("textarea");return i.innerHTML=t,i.value}handleExtension(t,i){const r=t?t.split("?")[0].split(".").splice(-1).join():"";return"md"!==r?"```"+r+"\n"+i+"\n```":i}renderEmoji(t){if(!Af(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 i;return t.split("\n").map(r=>{let s=i;return r.length>0&&(s=isNaN(s)?r.search(/\S|$/):Math.min(r.search(/\S|$/),s)),isNaN(i)&&(i=s),s?r.substring(s):r}).join("\n")}}return n.\u0275fac=function(t){return new(t||n)(Ie(Xc),Ie($W),Ie(_u,8),Ie(aMe,8),Ie(Mf))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),WW=(()=>{class n{constructor(t,i){this.element=t,this.markdownService=i,this.error=new ln,this.load=new ln,this.ready=new ln,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,i=!1){let r=this.markdownService.compile(t,i,this.emoji);r=this.katex?this.markdownService.renderKatex(r,this.katexOptions):r,this.element.nativeElement.innerHTML=r,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,LC.LineNumbers),this.setPluginOptions(this.element.nativeElement,{dataStart:this.start}))}setPluginClass(t,i){const r=t.querySelectorAll("pre");for(let s=0;s{const a=i[o];if(a){const l=this.toLispCase(o);r.item(s).setAttribute(l,a.toString())}})}toLispCase(t){const i=t.match(/([A-Z])/g);if(!i)return t;let r=t.toString();for(let s=0,o=i.length;sk(i)?t(...i):t(i))):new O(i=>{const r=(...o)=>i.next(1===o.length?o[0]:o);let s;try{s=n(r)}catch(o){return void i.error(o)}if(Y(e))return()=>e(r,s)})}function YN(...n){return e=>{let t;return"function"==typeof n[n.length-1]&&(t=n.pop()),e.lift(new pMe(n,t))}}class pMe{constructor(e,t){this.observables=e,this.project=t}call(e,t){return t.subscribe(new gMe(e,this.observables,this.project))}}class gMe extends t5{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)}}class mMe{constructor(e,t,i=!1){this.accumulator=e,this.seed=t,this.hasSeed=i}call(e,t){return t.subscribe(new _Me(e,this.accumulator,this.seed,this.hasSeed))}}class _Me extends y{constructor(e,t,i,r){super(e),this.accumulator=t,this._seed=i,this.hasSeed=r,this.index=0}get seed(){return this._seed}set seed(e){this.hasSeed=!0,this._seed=e}_next(e){if(this.hasSeed)return this._tryNext(e);this.seed=e,this.destination.next(e)}_tryNext(e){const t=this.index++;let i;try{i=this.accumulator(this.seed,e,t)}catch(r){this.destination.error(r)}this.seed=i,this.destination.next(i)}}class vMe{constructor(e){this.predicate=e}call(e,t){return t.subscribe(new wMe(e,this.predicate))}}class wMe extends y{constructor(e,t){super(e),this.predicate=t,this.skipping=!0,this.index=0}_next(e){const t=this.destination;this.skipping&&this.tryCallPredicate(e),this.skipping||t.next(e)}tryCallPredicate(e){try{const t=this.predicate(e,this.index++);this.skipping=Boolean(t)}catch(t){this.destination.error(t)}}}const EMe=["youtubeContainer"];let KW=(()=>{class n{constructor(t,i){this._ngZone=t,this._youtubeContainer=new oe,this._destroyed=new oe,this._playerChanges=new Fr(void 0),this._videoId=new Fr(void 0),this._height=new Fr(390),this._width=new Fr(640),this._startSeconds=new Fr(void 0),this._endSeconds=new Fr(void 0),this._suggestedQuality=new Fr(void 0),this._playerVars=new Fr(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=Af(i)}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=sn(!0);if(!window.YT||!window.YT.Player){const r=new oe;this._existingApiReadyCallback=window.onYouTubeIframeAPIReady,window.onYouTubeIframeAPIReady=()=>{this._existingApiReadyCallback&&this._existingApiReadyCallback(),this._ngZone.run(()=>r.next(!0))},t=r.pipe(qr(1),Oo(!1))}const i=function(n,e,t,i,r,s,o){const a=yc([e,s]).pipe(YN(yc([i,r])),me(([l,c])=>{const[u,h]=l,[f,g]=c;return u?{videoId:u,playerVars:h,width:f,height:g}:void 0}));return yc([n,a,sn(o)]).pipe(function(n){return ue(function(...n){let e=null;return"function"==typeof n[n.length-1]&&(e=n.pop()),1===n.length&&k(n[0])&&(n=n[0].slice()),t=>t.lift.call(je([t,...n]),new r5(e))}(n),function(n){return e=>e.lift(new vMe(n))}(([e,t])=>!t),me(([e])=>e))}(t),function(n,e){let t=!1;return arguments.length>=2&&(t=!0),function(r){return r.lift(new mMe(n,e,t))}}(MMe,void 0),ld())}(this._youtubeContainer,this._videoId,t,this._width,this._height,this._playerVars,this._ngZone).pipe(cr(r=>{this._playerChanges.next(r)}),V(e=>e?QW(e)?sn(e):new O(t=>{let i=!1,r=!1;const s=o=>{r=!0,i||(o.target.removeEventListener("onReady",s),t.next(o.target))};return e.addEventListener("onReady",s),()=>{i=!0,r||(r=>{QW(r)||r.destroy()})(e)}}).pipe(qr(1),Oo(void 0)):sn(void 0)),gr(this._destroyed),xa(new oe));i.subscribe(r=>{this._player=r,r&&this._pendingPlayerState&&this._initializePlayer(r,this._pendingPlayerState),this._pendingPlayerState=void 0}),function(n,e,t){yc([n,e,t]).subscribe(([i,r,s])=>i&&i.setSize(r,s))}(i,this._width,this._height),function(n,e){yc([n,e]).subscribe(([t,i])=>t&&i&&t.setPlaybackQuality(i))}(i,this._suggestedQuality),function(n,e,t,i,r,s){const o=yc([t,i]).pipe(me(([u,h])=>({startSeconds:u,endSeconds:h}))),a=o.pipe(KN(n,u=>!!u&&!function(n){const e=n.getPlayerState();return e!==YT.PlayerState.UNSTARTED&&e!==YT.PlayerState.CUED}(u))),l=e.pipe(KN(n,(u,h)=>!!u&&u.videoId!==h));Nn(n.pipe(KN(yc([e,o]),([u,h],f)=>!(!f||u==f.videoId&&!h.startSeconds&&!h.endSeconds))),l,a).pipe(YN(yc([n,e,o,r])),me(([u,h])=>h),gr(s)).subscribe(([u,h,f,g])=>{!h||!u||(u.videoId=h,u.cueVideoById(Object.assign({videoId:h,suggestedQuality:g},f)))})}(i,this._videoId,this._startSeconds,this._endSeconds,this._suggestedQuality,this._destroyed),i.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,i){this._player?this._player.seekTo(t,i):this._getPendingState().seek={seconds:t,allowSeekAhead:i}}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,i){const{playbackState:r,playbackRate:s,volume:o,muted:a,seek:l}=i;switch(r){case YT.PlayerState.PLAYING:t.playVideo();break;case YT.PlayerState.PAUSED:t.pauseVideo();break;case YT.PlayerState.CUED:t.stopVideo()}null!=s&&t.setPlaybackRate(s),null!=o&&t.setVolume(o),null!=a&&(a?t.mute():t.unMute()),null!=l&&t.seekTo(l.seconds,l.allowSeekAhead)}_getLazyEmitter(t){return this._playerChanges.pipe(is(i=>i?qW(r=>{i.addEventListener(t,r)},r=>{try{i.removeEventListener&&i.removeEventListener(t,r)}catch(s){}}):sn()),i=>new O(r=>i.subscribe({next:s=>this._ngZone.run(()=>r.next(s)),error:s=>r.error(s),complete:()=>r.complete()})),gr(this._destroyed))}}return n.\u0275fac=function(t){return new(t||n)(Ce(pn),Ce(Xc))},n.\u0275cmp=rn({type:n,selectors:[["youtube-player"]],viewQuery:function(t,i){if(1&t&&hr(EMe,5),2&t){let r;Gn(r=$n())&&(i.youtubeContainer=r.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,i){1&t&&ni(0,"div",null,0)},encapsulation:2,changeDetection:0}),n})();function MMe(n,[e,t,i]){if(n&&t&&n.playerVars!==t.playerVars)n.destroy();else{if(!t)return void(n&&n.destroy());if(n)return n}const r=i.runOutsideAngular(()=>new YT.Player(e,t));return r.videoId=t.videoId,r.playerVars=t.playerVars,r}function QW(n){return"getPlayerStatus"in n}function KN(n,e){return ue(YN(n),Ki(([t,i])=>e(i,t)),me(([t])=>t))}let BMe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275dir=Nt({type:n,selectors:[["","mat-card-sm-image",""],["","matCardImageSmall",""]],hostAttrs:[1,"mat-card-sm-image"]}),n})();function Fb(n){return!0===n}function Za(n){return null==n}function Ja(n){return!Za(n)}function QN(n){return Boolean(n)}function t7(n){return Za(n)?n:JSON.parse(JSON.stringify(n))}const VC=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])&&VC(n[o])}),n};function n7(n){return Ja(n)&&"object"==typeof n&&function(n){return"[object Object]"===Object.prototype.toString.call(n)}(n)}const s7="NGXS_DATA_META",JN="NGXS_META",o7="NGXS_ARGUMENT_REGISTRY_META";let a7=(()=>{class n{constructor(t){this.sequence$=new Fr(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(hu,8))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();function Lb(n){return n[s7]}let el=(()=>{class n{constructor(t,i,r){n.store=t.get(hu),n.ngZone=t.get(pn),n.factory=i,n.context=r,n.computed=t.get(a7)}}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(o5),Ie(s5))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();class hs{constructor(){hs.statesCachedMeta.clear()}static createStateContext(e){return el.context.createStateContext(e)}static ensureMappedState(e){if(Za(el.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(Ja(e.name)?hs.statesCachedMeta.get(e.name):null)||hs.ensureMeta(e)}static getRepositoryByInstance(e){var t;const r=null!==(t=Lb(hs.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=hs.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=hs.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=Ja(e.name)?null===(t=el.factory.states)||void 0===t?void 0:t.find(r=>r.name===e.name):null;return Ja(i)&&Ja(e.name)&&hs.statesCachedMeta.set(e.name,i),i}}hs.statesCachedMeta=new Map,hs.\u0275fac=function(e){return new(e||hs)},hs.\u0275prov=We({token:hs,factory:hs.\u0275fac}),new Df(1);class sDe extends Error{constructor(e){super(`Child states can only be added to an object. Cannot convert ${Ja(null==e?void 0:e.constructor)?e.constructor.name:e} to PlainObject`)}}function l7(n){var e;return null!==(e=n.NGXS_OPTIONS_META)&&void 0!==e?e:{name:""}}function c7(n){var e;const t=l7(n),i=null!==(e=t.children)&&void 0!==e?e:[],s=t7(void 0===t.defaults?{}:t.defaults);if(i.length){if(n7(s))return function(n,e){return e.reduce((t,i)=>{const r=l7(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()]=c7(i),t},null!=n?n:{})}(s,i);throw new sDe(s)}return s}function d7(n){var e;return null!==(e=n.__NGXS_COMPUTED_OPTION__)&&void 0!==e?e:null}function h7(){var n,e;return null!==(e=null===(n=null==el?void 0:el.computed)||void 0===n?void 0:n.sequenceValue)&&void 0!==e?e:0}function cDe(n){let e=!1;return Im(n)&&(e=!0),e}function ek(n){return n[o7]}class uDe extends Error{constructor(e,t){super(`An argument with the name '${e}' already exists in the method '${t}'`)}}class dDe{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(QN(this.argumentMap.has(e))||QN(this.payloadMap.has(e)))throw new uDe(e,t)}}function _De(n){return{enumerable:!0,configurable:!0,get(){const e=Lb(n),t=hs.ensureMappedState(e.stateMeta);return hs.createStateContext(t)}}}function f7(){return(n,e,t)=>{!function(n,e){if(!function(n,e){var t;let i=n,r=!1;if(n7(i))for(;null!==i;){if(Fb(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(d7(n))&&Object.defineProperties(n,{__NGXS_COMPUTED_OPTION__:{enumerable:!0,configurable:!0,value:new WeakMap}}),d7(n)}(this),o=null==s?void 0:s.get(i);if(Fb(null==o?void 0:o.isObservable))return null==o?void 0:o.value;if(Za(o)||o.sequenceId!==h7()){s.delete(i);const l=i.apply(this,r);return s.set(i,{value:l,sequenceId:h7(),isObservable:cDe(l)}),l}return o.value},t}}const xDe={cancelUncompleted:!0,insideZone:!1};function tk(n=xDe){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=hs.getRepositoryByInstance(a),u=c.operations;let h=u[s];const f=c.stateMeta,g=ek(r);if(Za(h)){const D=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),ie=function(n){const{statePath:e,argumentsNames:t,methodName:i,argumentRegistry:r}=n;let s="";for(let o=0;o{var D;return Fb(n.insideZone)?null===(D=el.ngZone)||void 0===D||D.run(()=>{l=r.apply(a,o)}):l=r.apply(a,o),Im(l)?sn(null).pipe(me(()=>l)):l};const x=hs.createAction(h,o,g),U=el.store.dispatch(x);return Im(l)?function(n,e){return fb([n,e]).pipe(me(t=>t.pop()))}(U,l):l},i}}function p7(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(ek(t))&&Object.defineProperties(t,{[o7]:{enumerable:!0,configurable:!0,value:new dDe}}),ek(t)})(e,t).createPayloadType(r,t,i)}}function CDe(){return n=>{const e=function(n){if(function(n){return!QN(n)}(n.hasOwnProperty(JN))){const e={name:null,actions:{},defaults:{},path:null,makeRootSelector:t=>t.getStateGetter(e.name),children:[]};Object.defineProperty(n,JN,{value:e})}return function(n){var e;return null===(e=n)||void 0===e?void 0:e[JN]}(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=Lb(n))&&void 0!==e?e:null;return(Za(t)||(null==t?void 0:t.stateClass)!==n)&&function(n){Object.defineProperty(n,s7,{writable:!0,configurable:!0,enumerable:!0,value:{stateMeta:null,operations:{},stateClass:n}})}(n),Lb(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:()=>t7(t)},context:_De(n)})}(n,e,c7(n)),function(n){var e,t;const i=Lb(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(Ja(r)){const s=`__${r}__selector`;Object.defineProperties(n.prototype,{[s]:{writable:!0,enumerable:!1,configurable:!0},state$:{enumerable:!0,configurable:!0,get(){if(Ja(this[s]))return this[s];if(Za(el.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]=el.store.select(n).pipe(me(o=>fa()?VC(o):o),Wa({refCount:!0,bufferSize:1})),this[s]}}})}}(n)}}let ADe=(()=>{class n{constructor(){this.browserStorageEvents$=new oe,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})(),MDe=(()=>{class n extends ADe{get snapshot(){return function(n){return fa()?VC(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:()=>fa()?VC(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=zi(n)))(i||n)}}(),n.\u0275prov=We({token:n,factory:n.\u0275fac}),Ei([f7(),uc("design:type",Object),uc("design:paramtypes",[])],n.prototype,"snapshot",null),Ei([tk(),wV(0,p7("patchValue")),uc("design:type",Function),uc("design:paramtypes",[Object]),uc("design:returntype",void 0)],n.prototype,"patchState",null),Ei([tk(),wV(0,p7("stateValue")),uc("design:type",Function),uc("design:paramtypes",[Object]),uc("design:returntype",void 0)],n.prototype,"setState",null),Ei([tk(),uc("design:type",Function),uc("design:paramtypes",[]),uc("design:returntype",void 0)],n.prototype,"reset",null),n})(),g9=(()=>{class n{constructor(){}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275dir=Nt({type:n,selectors:[["","gaEvent","","gaCategory",""],["","gaCategory",""]],inputs:{gaCategory:"gaCategory"},exportAs:["gaCategory"]}),n})();const zm=new Ht("ngx-google-analytics-settings",{factory:()=>({trackingCode:"",enableTracing:!1})}),Sk=new Ht("ngx-window",{providedIn:"root",factory:()=>function(n){return Af(n)?window:null}(Bc(Xc))}),jOe=new Ht("ngx-data-layer",{providedIn:"root",factory:()=>function(n){return n?n.dataLayer=n.dataLayer||[]:null}(Bc(Sk))}),Ck=new Ht("ngx-gtag-fn",{providedIn:"root",factory:()=>function(n,e){return n?n.gtag=n.gtag||function(){e.push(arguments)}:null}(Bc(Sk),Bc(jOe))});let qb=(()=>{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||fa())&&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(zm),Ie(fn),Ie(Ck))},n.\u0275prov=We({factory:function(){return new n(Ie(zm),Ie(fn),Ie(Ck))},token:n,providedIn:"root"}),n})(),m9=(()=>{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=gd(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){(fa()||this.settings.enableTracing)&&console&&console.warn&&console.warn(t)}}return n.\u0275fac=function(t){return new(t||n)(Ce(g9,8),Ce(qb),Ce(zm),Ce(gn))},n.\u0275dir=Nt({type:n,selectors:[["","gaEvent",""]],inputs:{gaBind:"gaBind",gaAction:"gaAction",gaLabel:"gaLabel",label:"label",gaValue:"gaValue",gaInteraction:"gaInteraction",gaEvent:"gaEvent"},exportAs:["gaEvent"]}),n})();const zOe={provide:Ef,multi:!0,useFactory:function(n,e,t){return()=>Bi(this,void 0,void 0,function*(){var i;if(!n.trackingCode)return void(fa()||console.error("Empty tracking code for Google Analytics. Make sure to provide one when initializing NgxGoogleAnalyticsModule."));if(!e)return void(fa()||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||fa()||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:[zm,Ck,fn]};new Ht("ngx-google-analytics-routing-settings",{factory:()=>({})});let r1=(()=>{class n{static forRoot(t,i=[],r,s,o){return{ngModule:n,providers:[{provide:zm,useValue:{trackingCode:t,initCommands:i,uri:r,enableTracing:s,nonce:o}},zOe]}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=tn({type:n}),n.\u0275inj=St({imports:[[]]}),n})(),o1=(()=>{class n{constructor(){this.consent="not-set",this.consentChange=new Df(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=We({token:n,factory:n.\u0275fac}),n})(),tRe=(()=>{class n{constructor(t,i,{trackingCode:r}){this.window=i,this.subscriptions=new C,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(o1),Ie(Sk),Ie(zm))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const nRe=new Ht("Key under which consent is stored",{providedIn:"root",factory:()=>"ALLOW_TELEMETRY"}),S9=[o1,tRe,(()=>{class n{constructor(t,i){this.key=i,this.subscriptions=new C;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(o1),Ie(nRe))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})()];function rRe(n){return Object.entries(n).reduce((e,[t,i])=>(null!=i&&(e[t]=`${i}`),e),{})}let oRe=(()=>{class n{static forRoot(t){const{providers:i=[]}=r1.forRoot(t.gaToken,function(n){const{appName:e,projectName:t,developmentMode:i}=n;return[{command:"set",values:[rRe({appName:e,projectName:t,developmentMode:i})]}]}(t));return{ngModule:n,providers:i}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=tn({type:n}),n.\u0275inj=St({providers:[...S9,{provide:Ef,multi:!0,useFactory:()=>()=>{},deps:S9}],imports:[[r1]]}),n})();const uRe=(n,e)=>JSON.stringify(n)===JSON.stringify(e),dRe=n=>n.map(e=>void 0!==e?JSON.parse(JSON.stringify(e)):e),xc={storageStrategy:class extends class{}{constructor(){super(...arguments),this.cachePairs=[]}add(e,t,i){this.cachePairs.push(e)}addMany(e){this.cachePairs=e}updateAtIndex(e,t){Object.assign(this.cachePairs[e],t)}update(e,t){Object.assign(this.cachePairs[e],t)}getAll(){return this.cachePairs}removeAtIndex(e){this.cachePairs.splice(e,1)}remove(e){this.cachePairs.splice(e,1)}removeAll(){this.cachePairs.length=0}},globalCacheKey:"CACHE_STORAGE",promiseImplementation:Promise},hRe=new oe;function Sc(n={}){return function(e,t,i){const r=n.cacheKey||e.constructor.name+"#"+t,s=i.value;if(i&&i.value){let o=n.storageStrategy?new n.storageStrategy:new xc.storageStrategy;const a=[];n.cacheModifier&&n.cacheModifier.subscribe(u=>o.addMany(u(o.getAll(r,this)),r,this)),Nn(hRe.asObservable(),n.cacheBusterObserver?n.cacheBusterObserver:b0()).subscribe(u=>{o.removeAll(r,this),a.length=0}),n.cacheResolver=n.cacheResolver||xc.cacheResolver||uRe,n.cacheHasher=n.cacheHasher||xc.cacheHasher||dRe,i.value=function(...u){const h=o.getAll(r,this);let f=n.cacheHasher(u),g=h.find(w=>n.cacheResolver(w.parameters,f));const m=a.find(w=>n.cacheResolver(w.parameters,f));if((n.maxAge||xc.maxAge)&&g&&g.created&&((new Date).getTime()-new Date(g.created).getTime()>(n.maxAge||xc.maxAge)?(o.remove?o.remove(h.indexOf(g),g,r,this):o.removeAtIndex(h.indexOf(g),r,this),g=null):(n.slidingExpiration||xc.slidingExpiration)&&(g.created=new Date,o.update?o.update(h.indexOf(g),g,r,this):o.updateAtIndex(h.indexOf(g),g,r,this))),g){const w=sn(g.response);return n.async?w.pipe(function(n,e=qS){const i=function(n){return n instanceof Date&&!isNaN(+n)}(n)?+n-e.now():Math.abs(n);return r=>r.lift(new rTe(i,e))}(0)):w}if(m)return m.response;{const w=s.call(this,...u).pipe(NN(()=>{const x=a.find(U=>n.cacheResolver(U.parameters,f));a.splice(a.indexOf(x),1)}),cr(x=>{(!n.shouldCacheDecider||n.shouldCacheDecider(x))&&((!(n.maxCacheCount||xc.maxCacheCount)||1===(n.maxCacheCount||xc.maxCacheCount)||(n.maxCacheCount||xc.maxCacheCount)&&(n.maxCacheCount||xc.maxCacheCount)xa(()=>s,undefined)(o)}(),Yn());return a.push({parameters:f,response:w,created:new Date}),w}}}return i}}class fRe{encodeKey(e){return encodeURIComponent(e)}encodeValue(e){return encodeURIComponent(e)}decodeKey(e){return decodeURIComponent(e)}decodeValue(e){return decodeURIComponent(e)}}const C9=new Ht("basePath");class Yb{constructor(e={}){this.apiKeys=e.apiKeys,this.username=e.username,this.password=e.password,this.accessToken=e.accessToken,this.basePath=e.basePath,this.withCredentials=e.withCredentials,this.encoder=e.encoder,this.credentials=e.credentials?e.credentials:{}}selectHeaderContentType(e){if(0===e.length)return;const t=e.find(i=>this.isJsonMime(i));return void 0===t?e[0]:t}selectHeaderAccept(e){if(0===e.length)return;const t=e.find(i=>this.isJsonMime(i));return void 0===t?e[0]:t}isJsonMime(e){const t=new RegExp("^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$","i");return null!==e&&(t.test(e)||"application/json-patch+json"===e.toLowerCase())}lookupCredential(e){const t=this.credentials[e];return"function"==typeof t?t():t}}let T9=(()=>{class n{constructor(t,i,r){this.httpClient=t,this.basePath="/v1",this.defaultHeaders=new mu,this.configuration=new Yb,r&&(this.configuration=r),"string"!=typeof this.configuration.basePath&&("string"!=typeof i&&(i=this.basePath),this.configuration.basePath=i),this.encoder=this.configuration.encoder||new fRe}addToHttpParams(t,i,r){return this.addToHttpParamsRecursive(t,i,r)}addToHttpParamsRecursive(t,i,r){if(null==i)return t;if("object"==typeof i)if(Array.isArray(i))i.forEach(s=>t=this.addToHttpParamsRecursive(t,s,r));else if(i instanceof Date){if(null==r)throw Error("key may not be null if value is Date");t=t.append(r,i.toISOString().substr(0,10))}else Object.keys(i).forEach(s=>t=this.addToHttpParamsRecursive(t,i[s],null!=r?`${r}.${s}`:s));else{if(null==r)throw Error("key may not be null if value is not object or array");t=t.append(r,i)}return t}aggregateResults(t,i="body",r=!1,s){const o=t.age,a=t.ageRange,l=t.bmi,c=t.bmiRange,u=t.cache,h=t.ontologyTerms,f=t.cellTypeTerms,g=t.providers,m=t.sex,w=t.spatial,x=t.technologies,U=t.token;let D=new Lr({encoder:this.encoder});null!=o&&(D=this.addToHttpParams(D,o,"age")),null!=a&&(D=this.addToHttpParams(D,a,"age-range")),null!=l&&(D=this.addToHttpParams(D,l,"bmi")),null!=c&&(D=this.addToHttpParams(D,c,"bmi-range")),null!=u&&(D=this.addToHttpParams(D,u,"cache")),h&&h.forEach(Ve=>{D=this.addToHttpParams(D,Ve,"ontology-terms")}),f&&f.forEach(Ve=>{D=this.addToHttpParams(D,Ve,"cell-type-terms")}),g&&g.forEach(Ve=>{D=this.addToHttpParams(D,Ve,"providers")}),null!=m&&(D=this.addToHttpParams(D,m,"sex")),w&&w.forEach(Ve=>{D=this.addToHttpParams(D,Ve,"spatial")}),x&&x.forEach(Ve=>{D=this.addToHttpParams(D,Ve,"technologies")}),null!=U&&(D=this.addToHttpParams(D,U,"token"));let ie=this.defaultHeaders,_e=s&&s.httpHeaderAccept;void 0===_e&&(_e=this.configuration.selectHeaderAccept(["application/json"])),void 0!==_e&&(ie=ie.set("Accept",_e));let Pe=s&&s.context;void 0===Pe&&(Pe=new Zs);let Ne="json";return _e&&(Ne=_e.startsWith("text")?"text":this.configuration.isJsonMime(_e)?"json":"blob"),this.httpClient.get(`${this.configuration.basePath}/aggregate-results`,{context:Pe,params:D,responseType:Ne,withCredentials:this.configuration.withCredentials,headers:ie,observe:i,reportProgress:r})}cellTypeTermOccurences(t,i="body",r=!1,s){const o=t.age,a=t.ageRange,l=t.bmi,c=t.bmiRange,u=t.cache,h=t.ontologyTerms,f=t.cellTypeTerms,g=t.providers,m=t.sex,w=t.spatial,x=t.technologies,U=t.token;let D=new Lr({encoder:this.encoder});null!=o&&(D=this.addToHttpParams(D,o,"age")),null!=a&&(D=this.addToHttpParams(D,a,"age-range")),null!=l&&(D=this.addToHttpParams(D,l,"bmi")),null!=c&&(D=this.addToHttpParams(D,c,"bmi-range")),null!=u&&(D=this.addToHttpParams(D,u,"cache")),h&&h.forEach(Ve=>{D=this.addToHttpParams(D,Ve,"ontology-terms")}),f&&f.forEach(Ve=>{D=this.addToHttpParams(D,Ve,"cell-type-terms")}),g&&g.forEach(Ve=>{D=this.addToHttpParams(D,Ve,"providers")}),null!=m&&(D=this.addToHttpParams(D,m,"sex")),w&&w.forEach(Ve=>{D=this.addToHttpParams(D,Ve,"spatial")}),x&&x.forEach(Ve=>{D=this.addToHttpParams(D,Ve,"technologies")}),null!=U&&(D=this.addToHttpParams(D,U,"token"));let ie=this.defaultHeaders,_e=s&&s.httpHeaderAccept;void 0===_e&&(_e=this.configuration.selectHeaderAccept(["application/json"])),void 0!==_e&&(ie=ie.set("Accept",_e));let Pe=s&&s.context;void 0===Pe&&(Pe=new Zs);let Ne="json";return _e&&(Ne=_e.startsWith("text")?"text":this.configuration.isJsonMime(_e)?"json":"blob"),this.httpClient.get(`${this.configuration.basePath}/cell-type-term-occurences`,{context:Pe,params:D,responseType:Ne,withCredentials:this.configuration.withCredentials,headers:ie,observe:i,reportProgress:r})}cellTypeTreeModel(t,i="body",r=!1,s){const o=t.cache,a=t.token;let l=new Lr({encoder:this.encoder});null!=o&&(l=this.addToHttpParams(l,o,"cache")),null!=a&&(l=this.addToHttpParams(l,a,"token"));let c=this.defaultHeaders,u=s&&s.httpHeaderAccept;void 0===u&&(u=this.configuration.selectHeaderAccept(["application/json"])),void 0!==u&&(c=c.set("Accept",u));let h=s&&s.context;void 0===h&&(h=new Zs);let f="json";return u&&(f=u.startsWith("text")?"text":this.configuration.isJsonMime(u)?"json":"blob"),this.httpClient.get(`${this.configuration.basePath}/cell-type-tree-model`,{context:h,params:l,responseType:f,withCredentials:this.configuration.withCredentials,headers:c,observe:i,reportProgress:r})}dbStatus(t,i="body",r=!1,s){const o=t.token;let a=new Lr({encoder:this.encoder});null!=o&&(a=this.addToHttpParams(a,o,"token"));let l=this.defaultHeaders,c=s&&s.httpHeaderAccept;void 0===c&&(c=this.configuration.selectHeaderAccept(["application/json"])),void 0!==c&&(l=l.set("Accept",c));let u=s&&s.context;void 0===u&&(u=new Zs);let h="json";return c&&(h=c.startsWith("text")?"text":this.configuration.isJsonMime(c)?"json":"blob"),this.httpClient.get(`${this.configuration.basePath}/db-status`,{context:u,params:a,responseType:h,withCredentials:this.configuration.withCredentials,headers:l,observe:i,reportProgress:r})}getSpatialPlacement(t,i="body",r=!1,s){const o=t.getSpatialPlacementRequest;if(null==o)throw new Error("Required parameter getSpatialPlacementRequest was null or undefined when calling getSpatialPlacement.");let a=this.defaultHeaders,l=s&&s.httpHeaderAccept;void 0===l&&(l=this.configuration.selectHeaderAccept(["application/json"])),void 0!==l&&(a=a.set("Accept",l));let c=s&&s.context;void 0===c&&(c=new Zs);const h=this.configuration.selectHeaderContentType(["application/json"]);void 0!==h&&(a=a.set("Content-Type",h));let f="json";return l&&(f=l.startsWith("text")?"text":this.configuration.isJsonMime(l)?"json":"blob"),this.httpClient.post(`${this.configuration.basePath}/get-spatial-placement`,o,{context:c,responseType:f,withCredentials:this.configuration.withCredentials,headers:a,observe:i,reportProgress:r})}gtexRuiLocations(t,i="body",r=!1,s){const o=t.cache;let a=new Lr({encoder:this.encoder});null!=o&&(a=this.addToHttpParams(a,o,"cache"));let l=this.defaultHeaders,c=s&&s.httpHeaderAccept;void 0===c&&(c=this.configuration.selectHeaderAccept(["application/json"])),void 0!==c&&(l=l.set("Accept",c));let u=s&&s.context;void 0===u&&(u=new Zs);let h="json";return c&&(h=c.startsWith("text")?"text":this.configuration.isJsonMime(c)?"json":"blob"),this.httpClient.get(`${this.configuration.basePath}/gtex/rui_locations.jsonld`,{context:u,params:a,responseType:h,withCredentials:this.configuration.withCredentials,headers:l,observe:i,reportProgress:r})}hubmapRuiLocations(t,i="body",r=!1,s){const o=t.cache,a=t.token;let l=new Lr({encoder:this.encoder});null!=o&&(l=this.addToHttpParams(l,o,"cache")),null!=a&&(l=this.addToHttpParams(l,a,"token"));let c=this.defaultHeaders,u=s&&s.httpHeaderAccept;void 0===u&&(u=this.configuration.selectHeaderAccept(["application/json"])),void 0!==u&&(c=c.set("Accept",u));let h=s&&s.context;void 0===h&&(h=new Zs);let f="json";return u&&(f=u.startsWith("text")?"text":this.configuration.isJsonMime(u)?"json":"blob"),this.httpClient.get(`${this.configuration.basePath}/hubmap/rui_locations.jsonld`,{context:h,params:l,responseType:f,withCredentials:this.configuration.withCredentials,headers:c,observe:i,reportProgress:r})}ontologyTermOccurences(t,i="body",r=!1,s){const o=t.age,a=t.ageRange,l=t.bmi,c=t.bmiRange,u=t.cache,h=t.ontologyTerms,f=t.cellTypeTerms,g=t.providers,m=t.sex,w=t.spatial,x=t.technologies,U=t.token;let D=new Lr({encoder:this.encoder});null!=o&&(D=this.addToHttpParams(D,o,"age")),null!=a&&(D=this.addToHttpParams(D,a,"age-range")),null!=l&&(D=this.addToHttpParams(D,l,"bmi")),null!=c&&(D=this.addToHttpParams(D,c,"bmi-range")),null!=u&&(D=this.addToHttpParams(D,u,"cache")),h&&h.forEach(Ve=>{D=this.addToHttpParams(D,Ve,"ontology-terms")}),f&&f.forEach(Ve=>{D=this.addToHttpParams(D,Ve,"cell-type-terms")}),g&&g.forEach(Ve=>{D=this.addToHttpParams(D,Ve,"providers")}),null!=m&&(D=this.addToHttpParams(D,m,"sex")),w&&w.forEach(Ve=>{D=this.addToHttpParams(D,Ve,"spatial")}),x&&x.forEach(Ve=>{D=this.addToHttpParams(D,Ve,"technologies")}),null!=U&&(D=this.addToHttpParams(D,U,"token"));let ie=this.defaultHeaders,_e=s&&s.httpHeaderAccept;void 0===_e&&(_e=this.configuration.selectHeaderAccept(["application/json"])),void 0!==_e&&(ie=ie.set("Accept",_e));let Pe=s&&s.context;void 0===Pe&&(Pe=new Zs);let Ne="json";return _e&&(Ne=_e.startsWith("text")?"text":this.configuration.isJsonMime(_e)?"json":"blob"),this.httpClient.get(`${this.configuration.basePath}/ontology-term-occurences`,{context:Pe,params:D,responseType:Ne,withCredentials:this.configuration.withCredentials,headers:ie,observe:i,reportProgress:r})}ontologyTreeModel(t,i="body",r=!1,s){const o=t.cache,a=t.token;let l=new Lr({encoder:this.encoder});null!=o&&(l=this.addToHttpParams(l,o,"cache")),null!=a&&(l=this.addToHttpParams(l,a,"token"));let c=this.defaultHeaders,u=s&&s.httpHeaderAccept;void 0===u&&(u=this.configuration.selectHeaderAccept(["application/json"])),void 0!==u&&(c=c.set("Accept",u));let h=s&&s.context;void 0===h&&(h=new Zs);let f="json";return u&&(f=u.startsWith("text")?"text":this.configuration.isJsonMime(u)?"json":"blob"),this.httpClient.get(`${this.configuration.basePath}/ontology-tree-model`,{context:h,params:l,responseType:f,withCredentials:this.configuration.withCredentials,headers:c,observe:i,reportProgress:r})}providerNames(t,i="body",r=!1,s){const o=t.cache,a=t.token;let l=new Lr({encoder:this.encoder});null!=o&&(l=this.addToHttpParams(l,o,"cache")),null!=a&&(l=this.addToHttpParams(l,a,"token"));let c=this.defaultHeaders,u=s&&s.httpHeaderAccept;void 0===u&&(u=this.configuration.selectHeaderAccept(["application/json"])),void 0!==u&&(c=c.set("Accept",u));let h=s&&s.context;void 0===h&&(h=new Zs);let f="json";return u&&(f=u.startsWith("text")?"text":this.configuration.isJsonMime(u)?"json":"blob"),this.httpClient.get(`${this.configuration.basePath}/provider-names`,{context:h,params:l,responseType:f,withCredentials:this.configuration.withCredentials,headers:c,observe:i,reportProgress:r})}referenceOrganScene(t,i="body",r=!1,s){const o=t.organIri;if(null==o)throw new Error("Required parameter organIri was null or undefined when calling referenceOrganScene.");const a=t.age,l=t.ageRange,c=t.bmi,u=t.bmiRange,h=t.cache,f=t.ontologyTerms,g=t.cellTypeTerms,m=t.providers,w=t.sex,x=t.spatial,U=t.technologies,D=t.token;let ie=new Lr({encoder:this.encoder});null!=a&&(ie=this.addToHttpParams(ie,a,"age")),null!=l&&(ie=this.addToHttpParams(ie,l,"age-range")),null!=c&&(ie=this.addToHttpParams(ie,c,"bmi")),null!=u&&(ie=this.addToHttpParams(ie,u,"bmi-range")),null!=h&&(ie=this.addToHttpParams(ie,h,"cache")),f&&f.forEach(bt=>{ie=this.addToHttpParams(ie,bt,"ontology-terms")}),g&&g.forEach(bt=>{ie=this.addToHttpParams(ie,bt,"cell-type-terms")}),null!=o&&(ie=this.addToHttpParams(ie,o,"organ-iri")),m&&m.forEach(bt=>{ie=this.addToHttpParams(ie,bt,"providers")}),null!=w&&(ie=this.addToHttpParams(ie,w,"sex")),x&&x.forEach(bt=>{ie=this.addToHttpParams(ie,bt,"spatial")}),U&&U.forEach(bt=>{ie=this.addToHttpParams(ie,bt,"technologies")}),null!=D&&(ie=this.addToHttpParams(ie,D,"token"));let _e=this.defaultHeaders,Pe=s&&s.httpHeaderAccept;void 0===Pe&&(Pe=this.configuration.selectHeaderAccept(["application/json"])),void 0!==Pe&&(_e=_e.set("Accept",Pe));let Ne=s&&s.context;void 0===Ne&&(Ne=new Zs);let Ve="json";return Pe&&(Ve=Pe.startsWith("text")?"text":this.configuration.isJsonMime(Pe)?"json":"blob"),this.httpClient.get(`${this.configuration.basePath}/reference-organ-scene`,{context:Ne,params:ie,responseType:Ve,withCredentials:this.configuration.withCredentials,headers:_e,observe:i,reportProgress:r})}referenceOrgans(t,i="body",r=!1,s){const o=t.cache,a=t.token;let l=new Lr({encoder:this.encoder});null!=o&&(l=this.addToHttpParams(l,o,"cache")),null!=a&&(l=this.addToHttpParams(l,a,"token"));let c=this.defaultHeaders,u=s&&s.httpHeaderAccept;void 0===u&&(u=this.configuration.selectHeaderAccept(["application/json"])),void 0!==u&&(c=c.set("Accept",u));let h=s&&s.context;void 0===h&&(h=new Zs);let f="json";return u&&(f=u.startsWith("text")?"text":this.configuration.isJsonMime(u)?"json":"blob"),this.httpClient.get(`${this.configuration.basePath}/reference-organs`,{context:h,params:l,responseType:f,withCredentials:this.configuration.withCredentials,headers:c,observe:i,reportProgress:r})}scene(t,i="body",r=!1,s){const o=t.age,a=t.ageRange,l=t.bmi,c=t.bmiRange,u=t.cache,h=t.ontologyTerms,f=t.cellTypeTerms,g=t.providers,m=t.sex,w=t.spatial,x=t.technologies,U=t.token;let D=new Lr({encoder:this.encoder});null!=o&&(D=this.addToHttpParams(D,o,"age")),null!=a&&(D=this.addToHttpParams(D,a,"age-range")),null!=l&&(D=this.addToHttpParams(D,l,"bmi")),null!=c&&(D=this.addToHttpParams(D,c,"bmi-range")),null!=u&&(D=this.addToHttpParams(D,u,"cache")),h&&h.forEach(Ve=>{D=this.addToHttpParams(D,Ve,"ontology-terms")}),f&&f.forEach(Ve=>{D=this.addToHttpParams(D,Ve,"cell-type-terms")}),g&&g.forEach(Ve=>{D=this.addToHttpParams(D,Ve,"providers")}),null!=m&&(D=this.addToHttpParams(D,m,"sex")),w&&w.forEach(Ve=>{D=this.addToHttpParams(D,Ve,"spatial")}),x&&x.forEach(Ve=>{D=this.addToHttpParams(D,Ve,"technologies")}),null!=U&&(D=this.addToHttpParams(D,U,"token"));let ie=this.defaultHeaders,_e=s&&s.httpHeaderAccept;void 0===_e&&(_e=this.configuration.selectHeaderAccept(["application/json"])),void 0!==_e&&(ie=ie.set("Accept",_e));let Pe=s&&s.context;void 0===Pe&&(Pe=new Zs);let Ne="json";return _e&&(Ne=_e.startsWith("text")?"text":this.configuration.isJsonMime(_e)?"json":"blob"),this.httpClient.get(`${this.configuration.basePath}/scene`,{context:Pe,params:D,responseType:Ne,withCredentials:this.configuration.withCredentials,headers:ie,observe:i,reportProgress:r})}sparql(t,i="body",r=!1,s){const o=t.query;if(null==o)throw new Error("Required parameter query was null or undefined when calling sparql.");const a=t.token,l=t.format;let c=new Lr({encoder:this.encoder});null!=o&&(c=this.addToHttpParams(c,o,"query")),null!=a&&(c=this.addToHttpParams(c,a,"token")),null!=l&&(c=this.addToHttpParams(c,l,"format"));let u=this.defaultHeaders,h=s&&s.httpHeaderAccept;void 0===h&&(h=this.configuration.selectHeaderAccept(["application/json"])),void 0!==h&&(u=u.set("Accept",h));let f=s&&s.context;void 0===f&&(f=new Zs);let g="json";return h&&(g=h.startsWith("text")?"text":this.configuration.isJsonMime(h)?"json":"blob"),this.httpClient.get(`${this.configuration.basePath}/sparql`,{context:f,params:c,responseType:g,withCredentials:this.configuration.withCredentials,headers:u,observe:i,reportProgress:r})}sparqlPost(t,i="body",r=!1,s){const o=t.sparqlQueryRequest;if(null==o)throw new Error("Required parameter sparqlQueryRequest was null or undefined when calling sparqlPost.");const a=t.token,l=t.format;let c=new Lr({encoder:this.encoder});null!=a&&(c=this.addToHttpParams(c,a,"token")),null!=l&&(c=this.addToHttpParams(c,l,"format"));let u=this.defaultHeaders,h=s&&s.httpHeaderAccept;void 0===h&&(h=this.configuration.selectHeaderAccept(["application/json"])),void 0!==h&&(u=u.set("Accept",h));let f=s&&s.context;void 0===f&&(f=new Zs);const m=this.configuration.selectHeaderContentType(["application/json","application/x-www-form-urlencoded"]);void 0!==m&&(u=u.set("Content-Type",m));let w="json";return h&&(w=h.startsWith("text")?"text":this.configuration.isJsonMime(h)?"json":"blob"),this.httpClient.post(`${this.configuration.basePath}/sparql`,o,{context:f,params:c,responseType:w,withCredentials:this.configuration.withCredentials,headers:u,observe:i,reportProgress:r})}technologyNames(t,i="body",r=!1,s){const o=t.cache,a=t.token;let l=new Lr({encoder:this.encoder});null!=o&&(l=this.addToHttpParams(l,o,"cache")),null!=a&&(l=this.addToHttpParams(l,a,"token"));let c=this.defaultHeaders,u=s&&s.httpHeaderAccept;void 0===u&&(u=this.configuration.selectHeaderAccept(["application/json"])),void 0!==u&&(c=c.set("Accept",u));let h=s&&s.context;void 0===h&&(h=new Zs);let f="json";return u&&(f=u.startsWith("text")?"text":this.configuration.isJsonMime(u)?"json":"blob"),this.httpClient.get(`${this.configuration.basePath}/technology-names`,{context:h,params:l,responseType:f,withCredentials:this.configuration.withCredentials,headers:c,observe:i,reportProgress:r})}tissueBlocks(t,i="body",r=!1,s){const o=t.age,a=t.ageRange,l=t.bmi,c=t.bmiRange,u=t.cache,h=t.ontologyTerms,f=t.cellTypeTerms,g=t.providers,m=t.sex,w=t.spatial,x=t.technologies,U=t.token;let D=new Lr({encoder:this.encoder});null!=o&&(D=this.addToHttpParams(D,o,"age")),null!=a&&(D=this.addToHttpParams(D,a,"age-range")),null!=l&&(D=this.addToHttpParams(D,l,"bmi")),null!=c&&(D=this.addToHttpParams(D,c,"bmi-range")),null!=u&&(D=this.addToHttpParams(D,u,"cache")),h&&h.forEach(Ve=>{D=this.addToHttpParams(D,Ve,"ontology-terms")}),f&&f.forEach(Ve=>{D=this.addToHttpParams(D,Ve,"cell-type-terms")}),g&&g.forEach(Ve=>{D=this.addToHttpParams(D,Ve,"providers")}),null!=m&&(D=this.addToHttpParams(D,m,"sex")),w&&w.forEach(Ve=>{D=this.addToHttpParams(D,Ve,"spatial")}),x&&x.forEach(Ve=>{D=this.addToHttpParams(D,Ve,"technologies")}),null!=U&&(D=this.addToHttpParams(D,U,"token"));let ie=this.defaultHeaders,_e=s&&s.httpHeaderAccept;void 0===_e&&(_e=this.configuration.selectHeaderAccept(["application/json"])),void 0!==_e&&(ie=ie.set("Accept",_e));let Pe=s&&s.context;void 0===Pe&&(Pe=new Zs);let Ne="json";return _e&&(Ne=_e.startsWith("text")?"text":this.configuration.isJsonMime(_e)?"json":"blob"),this.httpClient.get(`${this.configuration.basePath}/tissue-blocks`,{context:Pe,params:D,responseType:Ne,withCredentials:this.configuration.withCredentials,headers:ie,observe:i,reportProgress:r})}}return n.\u0275fac=function(t){return new(t||n)(Ie(_u),Ie(C9,8),Ie(Yb,8))},n.\u0275prov=We({factory:function(){return new n(Ie(_u),Ie(C9,8),Ie(Yb,8))},token:n,providedIn:"root"}),n})(),pRe=(()=>{class n{constructor(t,i){if(t)throw new Error("CcfApiModule is already loaded. Import in your base AppModule only.");if(!i)throw new Error("You need to import the HttpClientModule in your AppModule! \nSee also https://github.com/angular/angular/issues/20575")}static forRoot(t){return{ngModule:n,providers:[{provide:Yb,useFactory:t}]}}}return n.\u0275fac=function(t){return new(t||n)(Ie(n,12),Ie(_u,8))},n.\u0275mod=tn({type:n}),n.\u0275inj=St({providers:[],imports:[[]]}),n})();function vu(n){return new Promise((e,t)=>{n.oncomplete=n.onsuccess=()=>e(n.result),n.onabort=n.onerror=()=>t(n.error)})}let Ak;function Cc(){return Ak||(Ak=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),vu(i)});return(i,r)=>t.then(s=>r(s.transaction(e,i).objectStore(e)))}(0,"keyval")),Ak}function A9(n,e=Cc()){return e("readonly",t=>vu(t.get(n)))}var Un=et(1440);const a1="Unknown Euler angle order",Hm=.99999;class Zi extends mx{static get ZYX(){return 0}static get YXZ(){return 1}static get XZY(){return 2}static get ZXY(){return 3}static get YZX(){return 4}static get XYZ(){return 5}static get RollPitchYaw(){return 0}static get DefaultOrder(){return Zi.ZYX}static get RotationOrders(){return["ZYX","YXZ","XZY","ZXY","YZX","XYZ"]}static rotationOrder(e){return Zi.RotationOrders[e]}get ELEMENTS(){return 4}constructor(e=0,t=0,i=0,r=Zi.DefaultOrder){super(-0,-0,-0,-0),arguments.length>0&&Array.isArray(arguments[0])?this.fromVector3(...arguments):this.set(e,t,i,r)}fromQuaternion(e){const[t,i,r,s]=e,o=i*i,a=-2*(o+r*r)+1,l=2*(t*i+s*r);let c=-2*(t*r-s*i);c=c>1?1:c,c=c<-1?-1:c;const f=Math.atan2(2*(i*r+s*t),-2*(t*t+o)+1),g=Math.asin(c),m=Math.atan2(l,a);return new Zi(f,g,m,Zi.RollPitchYaw)}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=Number.isFinite(e[3])||this.order,this.check()}set(e=0,t=0,i=0,r){return this[0]=e,this[1]=t,this[2]=i,this[3]=Number.isFinite(r)?r:this[3],this.check()}validate(){return function(n){return n>=0&&n<6}(this[3])&&Number.isFinite(this[0])&&Number.isFinite(this[1])&&Number.isFinite(this[2])}toArray(e=[],t=0){return e[t]=this[0],e[t+1]=this[1],e[t+2]=this[2],e}toArray4(e=[],t=0){return e[t]=this[0],e[t+1]=this[1],e[t+2]=this[2],e[t+3]=this[3],e}toVector3(e=[-0,-0,-0]){return e[0]=this[0],e[1]=this[1],e[2]=this[2],e}get x(){return this[0]}set x(e){this[0]=nr(e)}get y(){return this[1]}set y(e){this[1]=nr(e)}get z(){return this[2]}set z(e){this[2]=nr(e)}get alpha(){return this[0]}set alpha(e){this[0]=nr(e)}get beta(){return this[1]}set beta(e){this[1]=nr(e)}get gamma(){return this[2]}set gamma(e){this[2]=nr(e)}get phi(){return this[0]}set phi(e){this[0]=nr(e)}get theta(){return this[1]}set theta(e){this[1]=nr(e)}get psi(){return this[2]}set psi(e){this[2]=nr(e)}get roll(){return this[0]}set roll(e){this[0]=nr(e)}get pitch(){return this[1]}set pitch(e){this[1]=nr(e)}get yaw(){return this[2]}set yaw(e){this[2]=nr(e)}get order(){return this[3]}set order(e){this[3]=function(n){if(n<0&&n>=6)throw new Error(a1);return n}(e)}fromVector3(e,t){return this.set(e[0],e[1],e[2],Number.isFinite(t)?t:this[3])}fromArray(e,t=0){return this[0]=e[0+t],this[1]=e[1+t],this[2]=e[2+t],void 0!==e[3]&&(this[3]=e[3]),this.check()}fromRollPitchYaw(e,t,i){return this.set(e,t,i,Zi.ZYX)}fromRotationMatrix(e,t=Zi.DefaultOrder){return this._fromRotationMatrix(e,t),this.check()}getRotationMatrix(e){return this._getRotationMatrix(e)}getQuaternion(){const e=new mR;switch(this[4]){case Zi.XYZ:return e.rotateX(this[0]).rotateY(this[1]).rotateZ(this[2]);case Zi.YXZ:return e.rotateY(this[0]).rotateX(this[1]).rotateZ(this[2]);case Zi.ZXY:return e.rotateZ(this[0]).rotateX(this[1]).rotateY(this[2]);case Zi.ZYX:return e.rotateZ(this[0]).rotateY(this[1]).rotateX(this[2]);case Zi.YZX:return e.rotateY(this[0]).rotateZ(this[1]).rotateX(this[2]);case Zi.XZY:return e.rotateX(this[0]).rotateZ(this[1]).rotateY(this[2]);default:throw new Error(a1)}}_fromRotationMatrix(e,t=Zi.DefaultOrder){const i=e.elements,r=i[0],s=i[4],o=i[8],a=i[1],l=i[5],c=i[9],u=i[2],h=i[6],f=i[10];switch(t=t||this[3]){case Zi.XYZ:this[1]=Math.asin(Ua(o,-1,1)),Math.abs(o)1&&void 0!==arguments[1]?arguments[1]:0,t=(co[n[e+0]]+co[n[e+1]]+co[n[e+2]]+co[n[e+3]]+"-"+co[n[e+4]]+co[n[e+5]]+"-"+co[n[e+6]]+co[n[e+7]]+"-"+co[n[e+8]]+co[n[e+9]]+"-"+co[n[e+10]]+co[n[e+11]]+co[n[e+12]]+co[n[e+13]]+co[n[e+14]]+co[n[e+15]]).toLowerCase();if(!DRe(t))throw TypeError("Stringified UUID is invalid");return t}(i)};var c1=et(1609);const Gm=Object.freeze({OUTSIDE:-1,INTERSECTING:0,INSIDE:1}),Rr=(Math,Math,{});function LRe(n,{precision:e=Rr.precision||4}={}){return n=function(n){return Math.round(n/Rr.EPSILON)*Rr.EPSILON}(n),"".concat(parseFloat(n.toPrecision(e)))}function Mh(n){return Array.isArray(n)||ArrayBuffer.isView(n)&&!(n instanceof DataView)}function Xb(n,e,t){const i=Rr.EPSILON;t&&(Rr.EPSILON=t);try{if(n===e)return!0;if(Mh(n)&&Mh(e)){if(n.length!==e.length)return!1;for(let r=0;r0?", ":"")+LRe(this[i],e);return"".concat(e.printTypes?this.constructor.name:"","[").concat(t,"]")}equals(e){if(!e||this.length!==e.length)return!1;for(let t=0;t=0&&e=0&&e=a+s)return this.clone();if(s>=a+i)return e.clone();const l=.5*(i+a+s);return P9.copy(o).scale((-i+l)/a).add(t),this.center.copy(P9),this.radius=l,this}expand(e){const t=(e=Kb.from(e)).subtract(this.center).magnitude();return t>this.radius&&(this.radius=t),this}transform(e){this.center.transform(e);const t=function(n,e){var s=e[4],o=e[5],a=e[6],l=e[8],c=e[9],u=e[10];return n[0]=Math.hypot(e[0],e[1],e[2]),n[1]=Math.hypot(s,o,a),n[2]=Math.hypot(l,c,u),n}(Kb,e);return this.radius=Math.max(t[0],Math.max(t[1],t[2]))*this.radius,this}distanceSquaredTo(e){const t=this.distanceTo(e);return t*t}distanceTo(e){const t=(e=Kb.from(e)).subtract(this.center);return Math.max(0,t.len()-this.radius)}intersectPlane(e){const i=this.radius,s=e.normal.dot(this.center)+e.distance;return s<-i?Gm.OUTSIDE:s0?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 sH(this,this,e),this.check()}rotateY(e){return oH(this,this,e),this.check()}rotateZ(e){return aH(this,this,e),this.check()}scale(e){return pR(this,this,e),this.check()}slerp(e,t,i){switch(arguments.length){case 1:({start:e=JRe,target:t,ratio:i}=arguments[0]);break;case 2:[t,i]=arguments,e=this}return nb(this,e,t,i),this.check()}transformVector4(e,t=e){return OU(t,e,this),M9(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)}}const ePe=new Pn,tPe=new Pn,u1=new Pn,d1=new Pn,h1=new Pn,nPe=new Pn,iPe=new Pn;class Nk{constructor(e=[0,0,0],t=[0,0,0,0,0,0,0,0,0]){this.center=(new Pn).from(e),this.halfAxes=new Zo(t)}get halfSize(){const e=this.halfAxes.getColumn(0),t=this.halfAxes.getColumn(1),i=this.halfAxes.getColumn(2);return[new Pn(e).len(),new Pn(t).len(),new Pn(i).len()]}get quaternion(){const e=this.halfAxes.getColumn(0),t=this.halfAxes.getColumn(1),i=this.halfAxes.getColumn(2),r=new Pn(e).normalize(),s=new Pn(t).normalize(),o=new Pn(i).normalize();return(new k9).fromMatrix3(new Zo([...r,...s,...o]))}fromCenterHalfSizeQuaternion(e,t,i){const r=new k9(i),s=(new Zo).fromQuaternion(r);return s[0]=s[0]*t[0],s[1]=s[1]*t[0],s[2]=s[2]*t[0],s[3]=s[3]*t[1],s[4]=s[4]*t[1],s[5]=s[5]*t[1],s[6]=s[6]*t[2],s[7]=s[7]*t[2],s[8]=s[8]*t[2],this.center=(new Pn).from(e),this.halfAxes=s,this}clone(){return new Nk(this.center,this.halfAxes)}equals(e){return this===e||Boolean(e)&&this.center.equals(e.center)&&this.halfAxes.equals(e.halfAxes)}getBoundingSphere(e=new Pk){const t=this.halfAxes,i=t.getColumn(0,u1),r=t.getColumn(1,d1),s=t.getColumn(2,h1),o=ePe.copy(i).add(r).add(s);return e.center.copy(this.center),e.radius=o.magnitude(),e}intersectPlane(e){const t=this.center,i=e.normal,r=this.halfAxes,s=i.x,o=i.y,a=i.z,l=Math.abs(s*r[0]+o*r[1]+a*r[2])+Math.abs(s*r[3]+o*r[4]+a*r[5])+Math.abs(s*r[6]+o*r[7]+a*r[8]),c=i.dot(t)+e.distance;return c<=-l?Gm.OUTSIDE:c>=l?Gm.INSIDE:Gm.INTERSECTING}distanceTo(e){return Math.sqrt(this.distanceSquaredTo(e))}distanceSquaredTo(e){const t=tPe.from(e).subtract(this.center),i=this.halfAxes,r=i.getColumn(0,u1),s=i.getColumn(1,d1),o=i.getColumn(2,h1),a=r.magnitude(),l=s.magnitude(),c=o.magnitude();r.normalize(),s.normalize(),o.normalize();let h,u=0;return h=Math.abs(t.dot(r))-a,h>0&&(u+=h*h),h=Math.abs(t.dot(s))-l,h>0&&(u+=h*h),h=Math.abs(t.dot(o))-c,h>0&&(u+=h*h),u}computePlaneDistances(e,t,i=[-0,-0]){let r=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY;const o=this.center,a=this.halfAxes,l=a.getColumn(0,u1),c=a.getColumn(1,d1),u=a.getColumn(2,h1),h=nPe.copy(l).add(c).add(u).add(o),f=iPe.copy(h).subtract(e);let g=t.dot(f);return r=Math.min(g,r),s=Math.max(g,s),h.copy(o).add(l).add(c).subtract(u),f.copy(h).subtract(e),g=t.dot(f),r=Math.min(g,r),s=Math.max(g,s),h.copy(o).add(l).subtract(c).add(u),f.copy(h).subtract(e),g=t.dot(f),r=Math.min(g,r),s=Math.max(g,s),h.copy(o).add(l).subtract(c).subtract(u),f.copy(h).subtract(e),g=t.dot(f),r=Math.min(g,r),s=Math.max(g,s),o.copy(h).subtract(l).add(c).add(u),f.copy(h).subtract(e),g=t.dot(f),r=Math.min(g,r),s=Math.max(g,s),o.copy(h).subtract(l).add(c).subtract(u),f.copy(h).subtract(e),g=t.dot(f),r=Math.min(g,r),s=Math.max(g,s),o.copy(h).subtract(l).subtract(c).add(u),f.copy(h).subtract(e),g=t.dot(f),r=Math.min(g,r),s=Math.max(g,s),o.copy(h).subtract(l).subtract(c).subtract(u),f.copy(h).subtract(e),g=t.dot(f),r=Math.min(g,r),s=Math.max(g,s),i[0]=r,i[1]=s,i}transform(e){this.center.transformAsPoint(e);const t=this.halfAxes.getColumn(0,u1);t.transformAsPoint(e);const i=this.halfAxes.getColumn(1,d1);i.transformAsPoint(e);const r=this.halfAxes.getColumn(2,h1);return r.transformAsPoint(e),this.halfAxes=new Zo([...t,...i,...r]),this}getTransform(){throw new Error("not implemented")}}const F9=new Pn,L9=new Pn;class kk{constructor(e=[0,0,1],t=0){this.normal=new Pn,this.distance=-0,this.fromNormalDistance(e,t)}fromNormalDistance(e,t){return Tc(Number.isFinite(t)),this.normal.from(e).normalize(),this.distance=t,this}fromPointNormal(e,t){e=F9.from(e),this.normal.from(t).normalize();const i=-this.normal.dot(e);return this.distance=i,this}fromCoefficients(e,t,i,r){return this.normal.set(e,t,i),Tc(Xb(this.normal.len(),1)),this.distance=r,this}clone(e){return new kk(this.normal,this.distance)}equals(e){return Xb(this.distance,e.distance)&&Xb(this.normal,e.normal)}getPointDistance(e){return this.normal.dot(e)+this.distance}transform(e){const t=L9.copy(this.normal).transformAsVector(e).normalize(),i=this.normal.scale(-this.distance).transform(e);return this.fromPointNormal(i,t)}projectPointOntoPlane(e,t=[0,0,0]){e=F9.from(e);const i=this.getPointDistance(e),r=L9.copy(this.normal).scale(i);return e.subtract(r).to(t)}}function*Uk(n,e,t){for(const[i,r]of Object.entries(t))for(const s of(0,Un.readQuads)(n,e,i,null,null)){const o="Literal"===s.object.termType?(0,c1.fromRdf)(s.object):s.object.id;yield[r,o]}}function dp(n,e,t,i){const r={"@id":e,"@type":t};for(const[s,o]of Object.entries(i))for(const a of(0,Un.readQuads)(n,r["@id"],s,null,null)){const l="Literal"===a.object.termType?(0,c1.fromRdf)(a.object):a.object.id;r[o]=l}return r}new Pn([1,0,0]),new Pn([0,1,0]),new Pn([0,0,1]),new Pn,new Pn,new kk(new Pn(1,0,0),0),new Pn,new Pn,new Pn,new Pn,new Pn,new Pn,new Pn,new Pn,new Pn,new Pn,new Pn,new Pn,new Pn,new Pn,new Pn,new Pn,new Pn,Math,new Zo,new Zo,new Zo,new Zo,new Zo,new Pn,new Pn,new Pn,new Pn,new Pn,new Zo,new Zo,new Zo;const ir=Un.Util.prefixes({base:"http://purl.org/ccf/latest/ccf.owl#",ccf:"http://purl.org/ccf/",fma:"http://purl.org/sig/ont/fma/fma",obo:"http://purl.obolibrary.org/obo/",uberon:"http://purl.obolibrary.org/obo/UBERON_",cl:"http://purl.obolibrary.org/obo/CL_",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/",dcterms:"http://purl.org/dc/terms/"},Un.DataFactory),U9={x:ir("rdf"),type:ir("rdf")("type")},dn=(ir("rdfs"),ir("rdfs")("label"),ir("rdfs")("comment"),ir("rdfs")("isDefinedBy"),ir("rdfs")("seeAlso"),ir("ccf")),vi={id:ir("ccf")("has_registration_location"),label:ir("rdfs")("label"),description:ir("rdfs")("comment"),link:dn("url"),sex:dn("sex"),age:dn("age"),bmi:dn("bmi"),Male:Un.DataFactory.literal("Male"),Female:Un.DataFactory.literal("Female"),consortiumName:dn("consortium_name"),providerName:dn("tissue_provider_name"),providerUUID:dn("tissue_provider_uuid"),donor:dn("comes_from"),sections:dn("subdivided_into_sections"),datasets:dn("generates_dataset"),sampleType:dn("sample_type"),TissueBlock:Un.DataFactory.literal("Tissue Block"),TissueSection:Un.DataFactory.literal("Tissue Section"),NonStandard:Un.DataFactory.literal("Non-standard"),sectionCount:dn("section_count"),sectionSize:dn("section_size"),sectionUnits:dn("section_size_unit"),sectionNumber:dn("section_number"),spatialEntity:dn("has_registration_location"),ontologyTerms:dn("has_ontology_term"),cellTypeTerms:dn("has_cell_type_term"),technology:dn("technology"),thumbnail:dn("thumbnail")},ki={x:dn,base:ir("base"),ontologyNode:{label:dn("ccf_pref_label"),parent:dn("ccf_part_of"),children:dn("ccf_part_of"),rui_rank:dn("rui_rank"),synonymLabels:Un.DataFactory.namedNode("http://www.geneontology.org/formats/oboInOwl#hasExactSynonym")},asctb:{part_of:dn("ccf_part_of"),ct_is_a:dn("ccf_ct_isa"),located_in:dn("ccf_located_in"),characterizes:dn("ccf_characterizes")},spatial:{Female:ir("base")("VHFemale"),Male:ir("base")("VHMale"),BothSexes:ir("base")("VHBothSexes"),FemaleOrgans:ir("base")("VHFemaleOrgans"),MaleOrgans:ir("base")("VHMaleOrgans")},SpatialObjectReference:dn("spatial_object_reference"),SpatialEntity:dn("spatial_entity"),SpatialPlacement:dn("spatial_placement"),spatialObjectReference:{file:dn("file_url"),file_format:dn("file_format"),file_subpath:dn("file_subpath")},extractionSet:{label:ir("rdfs")("label"),rui_rank:dn("rui_rank")},spatialEntity:{label:ir("rdfs")("label"),description:ir("rdfs")("comment"),creator:ir("dcterms")("creator"),creator_first_name:dn("creator_first_name"),creator_last_name:dn("creator_last_name"),creator_orcid:dn("creator_orcid"),creation_date:ir("dcterms")("created"),updated_date:dn("updated_date"),ccf_annotations:dn("collides_with"),representation_of:dn("representation_of"),reference_organ:dn("has_reference_organ"),extraction_set_for:dn("extraction_set_for"),extraction_set:dn("has_extraction_set"),sex:dn("organ_owner_sex"),side:dn("organ_side"),rui_rank:dn("rui_rank"),slice_thickness:dn("slice_thickness"),slice_count:dn("slice_count"),x_dimension:dn("x_dimension"),y_dimension:dn("y_dimension"),z_dimension:dn("z_dimension"),dimension_units:dn("dimension_unit"),object:dn("has_object_reference")},spatialPlacement:{source:dn("placement_for"),target:dn("placement_relative_to"),placement_date:ir("dcterms")("created"),x_scaling:dn("x_scaling"),y_scaling:dn("y_scaling"),z_scaling:dn("z_scaling"),scaling_units:dn("scaling_unit"),x_rotation:dn("x_rotation"),y_rotation:dn("y_rotation"),z_rotation:dn("z_rotation"),w_rotation:dn("theta_rotation"),rotation_order:dn("rotation_order"),rotation_units:dn("rotation_unit"),x_translation:dn("x_translation"),y_translation:dn("y_translation"),z_translation:dn("z_translation"),translation_units:dn("translation_unit")}},di={x:ir("uberon"),body:ir("uberon")("0013702")},NPe={x:ir("cl"),cell:ir("cl")("0000000")},Zb={x:ir("fma")},vd=(ir("lmha"),{body:di.body,cell:NPe.cell,respiratory_system:di.x("0001004"),colon:di.x("0001155"),left_lung:di.x("0002168"),right_lung:di.x("0002167"),left_bronchus:di.x("0002178"),right_bronchus:di.x("0002177"),kidney:di.x("0002113"),ureter:di.x("0000056"),eye:di.x("0000970"),fallopian_tube:di.x("0003889"),knee:di.x("0001465"),ovary:di.x("0000992"),trachea:di.x("0003126"),aorta:di.x("0000947"),blood:di.x("0000178"),bone_marrow:di.x("0002371"),male_reproductive_system:di.x("0000079"),lymph_node:di.x("0000029"),blood_vasculature:di.x("0004537"),brain:di.x("0000955"),eye_left:di.x("0004548"),eye_right:Zb.x("54449"),fallopian_tube_left:di.x("0001303"),fallopian_tube_right:di.x("0001302"),heart:di.x("0000948"),kidney_left:di.x("0004538"),kidney_right:di.x("0004539"),knee_left:Zb.x("24978"),knee_right:Zb.x("24977"),large_intestine:di.x("0000059"),liver:di.x("0002107"),lungs:di.x("0002048"),mesenteric_lymph_node:di.x("0002509"),ovary_left:Zb.x("7214"),ovary_right:Zb.x("7213"),pancreas:di.x("0001264"),pelvis:di.x("0001270"),prostate_gland:di.x("0002367"),skin:di.x("0002097"),small_intestine:di.x("0002108"),spleen:di.x("0002106"),thymus:di.x("0002370"),ureter_left:di.x("0001223"),ureter_right:di.x("0001222"),urinary_bladder:di.x("0001255"),uterus:di.x("0000995")});function zk(n){const e={};return Object.entries(n).forEach(([t,i])=>{e[i.id]=t}),e}const p1={spatialObjectReference:zk(ki.spatialObjectReference),spatialEntity:zk(ki.spatialEntity),spatialPlacement:zk(ki.spatialPlacement)};function z9(n,e){const t=dp(n,e,"ExtractionSet",p1.spatialEntity);return t.extractionSites=(0,mr.sortBy)(n.getSubjects(ki.spatialEntity.extraction_set,e,null).map(i=>hp(n,i.id)),["rui_rank"]),t}function hp(n,e){const t=dp(n,e,"SpatialEntity",p1.spatialEntity);return t.object&&(t.object=function(n,e){return dp(n,e,"SpatialObjectReference",p1.spatialObjectReference)}(n,t.object)),t.ccf_annotations&&(t.ccf_annotations=n.getObjects(e,ki.spatialEntity.ccf_annotations,null).map(i=>i.id)),n.forSubjects(i=>t.entityId=i.id,vi.spatialEntity,e,null),t}function VPe(n,e){const t=dp(n,e,"SpatialPlacement",p1.spatialPlacement);return t.source&&(t.source=hp(n,t.source)),t.target&&(t.target=hp(n,t.target)),t}function H9(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(_j),o=[t.x_scaling,t.y_scaling,t.z_scaling];return n.translate(r).rotateXYZ(s).scale(o)}class G9{constructor(e){this.db=e,this.createGraph()}createGraph(){this.graph=new ERe.DirectedGraph;const e=this.db.store;e.forSubjects(i=>{this.addNode(i.id,"SpatialObjectReference")},U9.type,ki.SpatialObjectReference,null),e.forSubjects(i=>{this.addNode(i.id,"SpatialEntity")},U9.type,ki.SpatialEntity,null);const t={};for(const i of(0,Un.readQuads)(e,null,ki.spatialPlacement.source,null,null))t[i.subject.id]=i.object.id;for(const i of(0,Un.readQuads)(e,null,ki.spatialPlacement.target,null,null)){const r=t[i.subject.id];r&&this.addEdge(i.subject.id,r,i.object.id,"SpatialPlacement")}}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 qn(qn.IDENTITY);if(!this.graph.hasNode(e)||!this.graph.hasNode(t))return;const i=this.db.store,r=new qn(qn.IDENTITY),s=SRe()(this.graph,e,t);if(s&&s.length>0){s.reverse();let o="";for(const a of s)o&&H9(r,VPe(i,this.graph.getEdgeAttribute(a,o,"id"))),o=a;return r}}getSpatialPlacement(e,t){const i=this.graph.hasNode(e["@id"])?e["@id"]:void 0,r=(0,mr.get)(e,"placement[0]",(0,mr.get)(e,"placement",void 0));let s;if(r&&this.graph.hasNode(r.target)?(s=this.getTransformationMatrix(r.target,t),s&&(s=H9(s,r))):i&&(s=this.getTransformationMatrix(i,t)),s){const o=(new Zi).fromRotationMatrix(s,Zi.XYZ),a=s.getTranslation().map(u=>1e3*u),l=o.toVector3().map(dse),c=s.getScale().map(u=>u<1&&u>.999999?1:u);return{"@context":"https://hubmapconsortium.github.io/hubmap-ontology/ccf-context.jsonld","@id":`http://purl.org/ccf/1.5/${PRe()}_placement`,"@type":"SpatialPlacement",source:e["@id"],target:t,placement_date:(new Date).toISOString().split("T")[0],x_scaling:c[0],y_scaling:c[1],z_scaling:c[2],scaling_units:"ratio",x_rotation:l[0],y_rotation:l[1],z_rotation:l[2],rotation_order:"XYZ",rotation_units:"degree",x_translation:a[0],y_translation:a[1],z_translation:a[2],translation_units:"millimeter"}}}}class $9{constructor(e){this.db=e}getSpatialEntity(e){return hp(this.db.store,e)}getExtractionSets(e){return function(n,e){return(0,mr.sortBy)(n.getSubjects(ki.spatialEntity.extraction_set_for,e,null).map(t=>z9(n,t.id)),["rui_rank"])}(this.db.store,e)}getExtractionSet(e){return z9(this.db.store,e)}getAnatomicalStructures(e){return function(n,e){return(0,mr.sortBy)(n.getSubjects(ki.spatialEntity.reference_organ,e,null).map(t=>hp(n,t.id)).filter(t=>t["@id"]!==e),["rui_rank"])}(this.db.store,e)}getReferenceOrgans(){return function(n){const e=[];return n.forEach(t=>{t.subject.id===t.object.id&&e.push(hp(n,t.subject.id))},null,ki.spatialEntity.reference_organ,null,null),(0,mr.sortBy)(e,["rui_rank"])}(this.db.store)}getReferenceBody(e){let t;switch(null==e?void 0:e.sex){case"Male":t=ki.spatial.Male.id;break;case"Female":t=ki.spatial.Female.id;break;case"Both":default:t=ki.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),i=[];let r=[...this.getReferenceOrganSets(e).map(s=>{const o="http://purl.obolibrary.org/obo/UBERON_0002097"===s.representation_of,a=this.getSceneNode(s,t,{color:[255,255,255,255],opacity:o?.5:.2,unpickable:!0,_lighting:"pbr",zoomBasedOpacity:!o});return o&&a?void i.push(a):a})];return i.length>0&&(r=[...i,...r]),(null==e?void 0:e.debug)&&(r=r.concat([this.getSceneNode(this.getSpatialEntity(ki.base("VHRightKidney").id),t,{color:[0,0,255,127.5],geometry:"wireframe"}),this.getSceneNode(this.getSpatialEntity(ki.base("VHLeftKidney").id),t,{color:[255,0,0,127.5],geometry:"wireframe"}),this.getSceneNode(this.getSpatialEntity(ki.base("VHSpleenCC1").id),t,{color:[0,255,0,127.5],geometry:"wireframe"}),this.getSceneNode(this.getSpatialEntity(ki.base("VHSpleenCC2").id),t,{color:[0,255,0,127.5],geometry:"wireframe"}),this.getSceneNode(this.getSpatialEntity(ki.base("VHSpleenCC3").id),t,{color:[0,255,0,127.5],geometry:"wireframe"})])),r.filter(s=>void 0!==s)}getReferenceOrganScene(e,t){var i,r;const s=void 0!==(null==t?void 0:t.sex)&&"both"!==(null===(i=null==t?void 0:t.sex)||void 0===i?void 0:i.toLowerCase()),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"}),u=(null!==(r=this.db.getSpatialEntities(t))&&void 0!==r?r:[]).map(h=>this.getSceneNode(h,a,{color:[255,255,255,229.5]}));return[c].concat(u).filter(h=>void 0!==h)}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 u=this.db.graph.getTransformationMatrix(l&&e.object?e.object["@id"]:e["@id"],t["@id"]);if(u){if(l)u=new qn(qn.IDENTITY).rotateX(_j(90)).multiplyLeft(u);else{let h;switch(e.dimension_units){case"centimeter":h=.01;break;case"millimeter":h=.001;break;case"meter":default:h=1}const f=[e.x_dimension,e.y_dimension,e.z_dimension].map(g=>g*h/2);u.scale(f)}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:u,tooltip:e.label},i)}}getScene(e){return[...this.getReferenceSceneNodes(e),...this.getEntitySceneNodes(e)]}}const g1="https://entity.api.hubmapconsortium.org/entities/",W9=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"]),UPe={"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"},qm={"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","5c106f29-ea2d-11e9-85e8-0efb3ba9a670":"RTI-General Electric","301615f9-c870-11eb-a8dc-35ce3d8786fe":"TMC-UConn"},q9={"@base":"http://purl.org/ccf/latest/ccf-entity.owl#","@vocab":"http://purl.org/ccf/latest/ccf-entity.owl#",ccf:"http://purl.org/ccf/",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"},cellTypeTerms:{"@id":"has_cell_type_term","@type":"@id"},thumbnail:{"@id":"has_thumbnail"}};class GPe{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||[],u=(this.data.ancestors||[]).find(Ne=>"Donor"===Ne.entity_type);this.donor=this.getDonor(u,i);const h=this.getRuiLocation(e,this.donor);h?this.rui_location=h:this.bad=!0,qm[e.group_uuid]||(qm[e.group_uuid]=e.group_name);const f=new Date(e.last_modified_timestamp).toLocaleDateString(),g=qm[e.group_uuid]||e.group_name,m=e.created_by_user_displayname;this["@id"]=g1+e.uuid,this.label=`Registered ${f}, ${m}, ${g}`,this.link=`${i}browse/sample/${e.uuid}`;const w={},x=[];this.sections=x;const U=[];this.datasets=U;for(const Ne of c.filter(Ve=>"Sample"===Ve.entity_type)){const Ve=this.getSection(Ne,e,i);w[Ne.submission_id]=Ve,x.push(Ve),Ve.section_number=null!==(s=Ve.section_number)&&void 0!==s?s:x.length}for(const Ne of c)if("Dataset"===Ne.entity_type){const Ve=this.getDataset(Ne,t,i,r),bt=(0,mr.get)(Ne,["ingest_metadata","metadata","tissue_id"]);w[bt]?null===(o=w[bt].datasets)||void 0===o||o.push(Ve):U.push(Ve)}const D=null!=h?h:{},ie=`${D.x_dimension} x ${D.y_dimension} x ${D.z_dimension} ${D.dimension_units}`;this.section_count=D.slice_count||x.length;const _e=parseFloat((D.slice_thickness||(D.z_dimension||0)/Math.max(this.section_count,1)).toFixed(1));this.section_size=_e;const Pe=D.dimension_units||"millimeter";this.section_units=Pe,this.description=`${ie}, ${_e} ${Pe}, ${e.specimen_type}, ${this.section_count} Sections`,x.forEach((Ne,Ve)=>{Ne.description=`${D.x_dimension} x ${D.y_dimension} x ${_e} ${Pe}, ${_e} ${Pe}, ${Ne.description}`,Ne.section_number=Ve+1})}getSection(e,t,i){const r=new Date(e.last_modified_timestamp).toLocaleDateString();return{"@id":g1+e.uuid,"@type":"Sample",label:`Registered ${r}, ${e.created_by_user_displayname}, ${qm[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=qm[e.group_uuid]||e.group_name,l=e.created_by_user_displayname,c=[...e.data_types,(0,mr.get)(e,["ingest_metadata","metadata","assay_type"],"")],u=c.join("|").toLowerCase();let h,f="assets/icons/ico-unknown.svg";return-1!==u.indexOf("10x")?(h="10x",f="assets/icons/ico-bulk-10x.svg"):-1!==u.indexOf("af")?(h="AF",f="assets/icons/ico-spatial-af.svg"):-1!==u.indexOf("codex")?(h="CODEX",f="assets/icons/ico-spatial-codex.svg"):-1!==u.indexOf("imc")?(h="IMC",f="assets/icons/ico-spatial-imc.svg"):-1!==u.indexOf("lc")&&-1===u.indexOf("af")?(h="LC",f="assets/icons/ico-bulk-lc.svg"):h=-1!==u.indexOf("maldi")?"MALDI":-1!==u.indexOf("pas")?"PAS":"OTHER",f=null!==(s=this.getDatasetThumbnail(e,t,r))&&void 0!==s?s:f,{"@id":g1+e.uuid,"@type":"Dataset",label:`Registered ${o}, ${l}, ${a}`,description:`Data/Assay Types: ${c.join(", ")}`,link:`${i}browse/dataset/${e.uuid}`,technology:h,thumbnail:f}}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,mr.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=>W9.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(W9.has(s))return`assets/thumbnails/TMC-Vanderbilt/DR1/${s}`}}else if("07a29e4c-ed43-11e8-b56a-0e8017bdda58"===e.group_uuid){const r=UPe[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,mr.toNumber)(s[1]));for(const f of(0,mr.get)(e,"metadata.organ_donor_data",(0,mr.get)(e,"metadata.living_donor_data",[])))"Feminine gender"===f.preferred_term||"Female"===f.preferred_term?r="Female":"Masculine gender"===f.preferred_term||"Male"===f.preferred_term?r="Male":"Current chronological age"===f.preferred_term||"Age"===f.preferred_term?o=(0,mr.toNumber)(f.data_value):"Body mass index"===f.preferred_term&&(a=(0,mr.toNumber)(f.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(),u=qm[e.group_uuid]||e.group_name;return{"@id":g1+e.uuid,"@type":"Donor",label:l,description:`Entered ${c}, ${e.created_by_user_displayname}, ${u}`,link:`${t}browse/donor/${e.uuid}`,age:o,sex:r,bmi:a,consortium_name:"HuBMAP",provider_name:u,provider_uuid:e.group_uuid,samples:[]}}getRuiLocation(e,t){var i;let r,s=e.rui_location;if(s&&("string"==typeof s&&(s=JSON.parse(s)),s.alignment_id?console.log("Detected a deprecated rui_location",e.uuid):s["@id"]&&(r=s)),r){const o=null!==(i=(0,mr.get)(r,["placement","target"]))&&void 0!==i?i:"";o.startsWith("http://purl.org/ccf/latest/ccf.owl#VHSpleenCC")?(0,mr.set)(r,["placement","target"],o.replace("#VHSpleenCC","Male"===t.sex?"#VHMSpleenCC":"#VHFSpleenCC")):("http://purl.org/ccf/latest/ccf.owl#VHLeftKidney"===o||"http://purl.org/ccf/latest/ccf.owl#VHRightKidney"===o)&&(0,mr.set)(r,["placement","target"],"Male"===t.sex?o.replace("#VH","#VHM")+"_Patch":o.replace("#VH","#VHF")+"_Patch")}return r}getTissueBlock(){return(0,mr.omit)(Object.assign({},this),["data","bad","donor"])}toJsonLd(){return Object.assign(Object.assign({},this.donor),{samples:[this.getTissueBlock()]})}}const WPe=["uuid","entity_type","group_uuid","group_name","last_modified_timestamp","created_by_user_displayname","ancestors.entity_type","ancestors.description","ancestors.metadata.organ_donor_data.preferred_term","ancestors.metadata.organ_donor_data.data_value","ancestors.metadata.living_donor_data.preferred_term","ancestors.metadata.living_donor_data.data_value","ancestors.last_modified_timestamp","ancestors.group_uuid","ancestors.group_name","ancestors.created_by_user_displayname","ancestors.uuid","descendants.entity_type","descendants.ingest_metadata.metadata.tissue_id","descendants.last_modified_timestamp","descendants.group_uuid","descendants.group_name","descendants.created_by_user_displayname","descendants.uuid","descendants.data_types","descendants.ingest_metadata.metadata.assay_type","descendants.thumbnail_file","descendants.metadata.files.rel_path","rui_location","specimen_type"],qPe={exists:{field:"rui_location"}};function Y9(n,e,t){return JSON.stringify({version:!0,from:n,size:e,stored_fields:["*"],script_fields:{},docvalue_fields:[],query:null!=t?t:qPe,_source:{includes:WPe}})}function Hk(n,e){return Bi(this,void 0,void 0,function*(){try{const t=yield fetch(n,e);return t.ok?yield t.json():void 0}catch(t){return}})}function X9(n,e,t,i,r="",s=""){return Bi(this,void 0,void 0,function*(){let o;if("static"===e?o=yield Hk(n):"search-api"===e&&(o=yield function(n,e,t){return Bi(this,void 0,void 0,function*(){const i=250,r=function(n){const e=new Headers;return e.append("Content-type","application/json"),n&&e.append("Authorization",`Bearer ${n}`),e}(e),s=Y9(0,i,t),o=yield Hk(n,{method:"POST",headers:r,body:s});if(!o)return;const a=o.hits.total.value;if(a<=i)return o;const l=[];for(let h=i;h!h))return;const u=c.map(h=>h.hits.hits);return Object.assign(Object.assign({},o),{hits:Object.assign(Object.assign({},o.hits),{hits:o.hits.hits.concat(...u)})})})}(n,i,t)),o)return function(n,e="",t="",i,r=!1){const o={},a=(0,mr.get)(n,"hits.hits",[]).map(c=>(0,mr.get)(c,"_source",{})).sort((c,u)=>c.uuid.localeCompare(u.uuid)).map(c=>new GPe(c,e,t,i).toJsonLd());for(const c of a){const u=c["@id"];o[u]?o[u].samples.push(c.samples[0]):o[u]=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":q9},c)))),{"@context":q9,"@graph":l}}(o,r,s,i);console.warn(`Unable to load ${n} as HuBMAP Data`)})}function Jb(n,e,t){const i=new Set;for(const r of e)for(const s of(0,Un.readQuads)(n,r,t,null,null))i.add(s.object.id);return i}const JPe={[ki.spatialEntity.x_dimension.id]:"x",[ki.spatialEntity.y_dimension.id]:"y",[ki.spatialEntity.z_dimension.id]:"z"};function tNe(n,e,t,i){const r=e.getTransformationMatrix(t,i);let s;if(r){const o=r.getTranslation(),a=function(n,e){const t=dp(n,e,"Dimensions",JPe);return[t.x,t.y,t.z]}(n,t).map(c=>c/1e3/2),l=(new Zi).fromRotationMatrix(r,Zi.XYZ).toQuaternion().normalize().calculateW();s=(new Nk).fromCenterHalfSizeQuaternion(o,a,l)}return s}function nNe(n,e,t,i){const{x:r,y:s,z:o,radius:a,target:l}=i,c=new Set,u=a/1e3*(a/1e3);for(const h of t){const f=tNe(n,e,h,l);f&&f.distanceSquaredTo([r,s,o].map(m=>m/1e3))<=u&&c.add(h)}return c}function m1(n,e,t){var i,r;const s=new Map,o=new Set;for(const c of e)for(const u of(0,Un.readQuads)(n,c,vi.donor,null,null))o.add(u.object.id),s.has(u.object.id)?null===(i=s.get(u.object.id))||void 0===i||i.push(c):s.set(u.object.id,[c]);const a=t(o),l=new Set;for(const c of a)for(const u of null!==(r=s.get(c))&&void 0!==r?r:[])l.add(u);return l}function Gk(n,e,t){var i,r;const s=new Map,o=new Set;for(const c of e)for(const u of(0,Un.readQuads)(n,c,vi.spatialEntity,null,null))o.add(u.object.id),s.has(u.object.id)?null===(i=s.get(u.object.id))||void 0===i||i.push(c):s.set(u.object.id,[c]);const a=t(o),l=new Set;for(const c of a)for(const u of null!==(r=s.get(c))&&void 0!==r?r:[])l.add(u);return l}function ev(n,e){return function(t){n.has(t.id)&&e.add(t.id)}}function K9(n,e,t){const i=new Set;for(const r of t){const s=Un.DataFactory.namedNode(r);n.forSubjects(ev(e,i),ki.spatialEntity.ccf_annotations,s,null)}return i}function Q9(n,e){const t=function(n,e){const t=new Map;for(const i of n)for(const r of(0,Un.readQuads)(e,i,vi.spatialEntity,null,null))t.has(r.object.id)?t.get(r.object.id).add(i):t.set(r.object.id,new Set([i]));return t}(n,e),i=new Map;for(const r of t.keys()){const s=t.get(r);for(const o of(0,Un.readQuads)(e,r,ki.spatialEntity.ccf_annotations,null,null))if(i.has(o.object.id)){const a=i.get(o.object.id);s.forEach(l=>a.add(l))}else i.set(o.object.id,new Set(s))}return i}function _Ne(n,e,t){const i={"@id":e,"@type":"OntologyTreeNode",id:e,parent:"",children:[],synonymLabels:[],label:""},r={[ki.ontologyNode.label.id]:"label",[t]:"parent",[ki.ontologyNode.synonymLabels.id]:"synonymLabels"};for(const[s,o]of Uk(n,e,r))"synonymLabels"===s?i.synonymLabels.push(o):i[s]=o;return i.children=n.getSubjects(t,e,null).map(s=>s.id),i}function Z9(n,e,t,i){const r={root:e,nodes:{}},s=new Set;for(const a of(0,Un.readQuads)(n,null,i,null,null))s.add(a.subject.id),s.add(a.object.id);for(const a of s)r.nodes[a]=_Ne(n,a,i);r.nodes[e]||(r.nodes[e]={"@id":e,"@type":"OntologyTreeNode",id:e,label:t,children:[],synonymLabels:[]});const o=n.getSubjects(i,e,null).map(a=>a.id).sort((a,l)=>r.nodes[a].label.localeCompare(r.nodes[l].label));return r.nodes[e].children=o,J9(r),r}function J9(n,e,t=new Set){const i=n.nodes[null!=e?e:n.root];if(i){i.children=i.children.filter(r=>!t.has(r)),i.children.forEach(r=>t.add(r));for(const r of i.children)J9(n,r,t),n.nodes[r]&&(n.nodes[r].parent=i["@id"])}}const eq=(0,mr.memoize)(function(n){const e=Z9(n,vd.body.id,"body",ki.asctb.part_of.id);return e.nodes[vd.body.id].children=["http://purl.obolibrary.org/obo/UBERON_0000955","http://purl.obolibrary.org/obo/UBERON_0000029","http://purl.obolibrary.org/obo/UBERON_0000970","http://purl.obolibrary.org/obo/UBERON_0003889","http://purl.obolibrary.org/obo/UBERON_0000948","http://purl.obolibrary.org/obo/UBERON_0002113","http://purl.obolibrary.org/obo/UBERON_0001465","http://purl.obolibrary.org/obo/UBERON_0002107","http://purl.obolibrary.org/obo/UBERON_0002048","http://purl.obolibrary.org/obo/UBERON_0001911","http://purl.obolibrary.org/obo/UBERON_0000992","http://purl.obolibrary.org/obo/UBERON_0001264","http://purl.obolibrary.org/obo/UBERON_0001270","http://purl.obolibrary.org/obo/UBERON_0001987","http://purl.obolibrary.org/obo/UBERON_0002367","http://purl.obolibrary.org/obo/UBERON_0002097","http://purl.obolibrary.org/obo/UBERON_0002108","http://purl.obolibrary.org/obo/UBERON_0002240","http://purl.obolibrary.org/obo/UBERON_0000059","http://purl.obolibrary.org/obo/UBERON_0002106","http://purl.obolibrary.org/obo/UBERON_0002370","http://purl.obolibrary.org/obo/UBERON_0000056","http://purl.obolibrary.org/obo/UBERON_0001255","http://purl.obolibrary.org/obo/UBERON_0000995","http://purl.obolibrary.org/obo/UBERON_0004537"].filter(t=>t in e.nodes),e},()=>""),_1={[vi.label.id]:"label",[vi.description.id]:"description",[vi.link.id]:"link"},vNe=Object.assign(Object.assign({},_1),{[vi.providerName.id]:"providerName"}),wNe=Object.assign(Object.assign({},_1),{[vi.technology.id]:"technology",[vi.thumbnail.id]:"thumbnail"}),ENe=Object.assign(Object.assign({},_1),{[vi.sampleType.id]:"sampleType",[vi.sectionNumber.id]:"sectionNumber",[vi.datasets.id]:"datasets"}),xNe=Object.assign(Object.assign({},_1),{[vi.sampleType.id]:"sampleType",[vi.sectionCount.id]:"sectionCount",[vi.sectionSize.id]:"sectionSize",[vi.sectionUnits.id]:"sectionUnits",[vi.donor.id]:"donor",[vi.spatialEntity.id]:"spatialEntityId",[vi.sections.id]:"sections",[vi.datasets.id]:"datasets"});function SNe(n,e){return dp(n,e,"Donor",vNe)}function tq(n,e){return dp(n,e,"Dataset",wNe)}function CNe(n,e){const t={"@id":e,"@type":"Sample",datasets:[]};for(const[i,r]of Uk(n,e,ENe))if("datasets"===i){const s=tq(n,r);t[i].push(s)}else t[i]=r;return t}class ANe{constructor(e){this.database=e,this.connect()}toJson(){return{status:this.status,message:this.message,checkback:"Ready"===this.status||"Error"===this.status?36e5:2e3,loadTime:this.loadTime}}connect(){this.status="Loading",this.message="Loading database";const e=Date.now();return this.database.connect().then(t=>Bi(this,void 0,void 0,function*(){t?(this.message="Building scene",yield this.database.getScene(),this.message="Building tissue block results",yield this.database.getTissueBlockResults(),this.message="Aggregating results",yield this.database.getAggregateResults(),this.status="Ready",this.message="Database successfully loaded"):(this.status="Error",this.message="Unknown error while loading database")})).catch(t=>{var i;this.status="Error",this.message=null!==(i=null==t?void 0:t.message)&&void 0!==i?i:"Unknown error while loading database"}).finally(()=>{this.loadTime=Date.now()-e})}}const MNe={"@context":{"@base":"http://purl.org/ccf/","@vocab":"http://purl.org/ccf/",ccf:"http://purl.org/ccf/",rdfs:"http://www.w3.org/2000/01/rdf-schema#",dcterms:"http://purl.org/dc/terms/",label:"rdfs:label",description:"rdfs:comment",link:"ccf:url",sex:"ccf:sex",age:"ccf:age",bmi:"ccf:bmi",consortium_name:"ccf:consortium_name",provider_name:"ccf:tissue_provider_name",provider_uuid:"ccf:tissue_provider_uuid",donor:{"@id":"ccf:comes_from","@type":"@id"},samples:{"@reverse":"donor"},sections:{"@id":"ccf:subdivided_into_sections","@type":"@id"},datasets:{"@id":"ccf:generates_dataset","@type":"@id"},sample_type:"ccf:sample_type",section_count:"ccf:section_count",section_size:"ccf:section_size",section_units:"ccf:section_size_unit",section_number:"ccf:section_number",rui_location:{"@id":"ccf:has_registration_location","@type":"@id"},ccf_annotations:{"@id":"ccf:collides_with","@type":"@id","@container":"@set"},representation_of:{"@id":"ccf:representation_of","@type":"@id"},reference_organ:{"@id":"ccf:has_reference_organ","@type":"@id"},extraction_set_for:{"@id":"ccf:extraction_set_for","@type":"@id"},extraction_set:{"@id":"ccf:has_extraction_set","@type":"@id"},organ_owner_sex:"ccf:organ_owner_sex",side:"ccf:organ_side",rui_rank:"ccf:rui_rank",slice_thickness:"ccf:slice_thickness",slice_count:"ccf:slice_count",object:{"@id":"ccf:has_object_reference","@type":"@id"},creation_date:"dcterms:created",updated_date:"ccf:updated_date",creator:"dcterms:creator",creator_first_name:"ccf:creator_first_name",creator_last_name:"ccf:creator_last_name",placement:{"@reverse":"ccf:placement_for"},placement_date:"dcterms:created",rotation_order:"ccf:rotation_order",dimension_units:"ccf:dimension_unit",rotation_units:"ccf:rotation_unit",scaling_units:"ccf:scaling_unit",translation_units:"ccf:translation_unit",source:{"@id":"ccf:placement_for","@type":"@id"},target:{"@id":"ccf:placement_relative_to","@type":"@id"},x_rotation:"ccf:x_rotation",y_rotation:"ccf:y_rotation",z_rotation:"ccf:z_rotation",x_scaling:"ccf:x_scaling",y_scaling:"ccf:y_scaling",z_scaling:"ccf:z_scaling",x_translation:"ccf:x_translation",y_translation:"ccf:y_translation",z_translation:"ccf:z_translation",x_dimension:"ccf:x_dimension",y_dimension:"ccf:y_dimension",z_dimension:"ccf:z_dimension",ontology_terms:{"@id":"ccf:has_ontology_term","@type":"@id"},technology:"ccf:technology",thumbnail:"ccf:thumbnail",file:"ccf:file_url",file_format:"ccf:file_format",file_subpath:"ccf:file_subpath"}};function $k(n){return JSON.parse(n,(e,t)=>"ccf_annotations"===e&&Array.isArray(t)?t.map(i=>(null==i?void 0:i.startsWith("http://purl.obolibrary.org/obo/FMA_"))?i.replace("http://purl.obolibrary.org/obo/FMA_","http://purl.org/sig/ont/fma/fma"):i):"@context"!==e||!t||"https://hubmapconsortium.github.io/hubmap-ontology/ccf-entity-context.jsonld"!==t&&"https://hubmapconsortium.github.io/hubmap-ontology/ccf-context.jsonld"!==t&&"https://hubmapconsortium.github.io/ccf-ontology/ccf-context.jsonld"!==t&&"http://purl.org/ccf/latest/ccf-entity.owl#"!==t["@base"]?t:MNe)}const INe={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 ONe{constructor(e=INe){this.options=e,this.store=new Un.Store(void 0,{factory:Un.DataFactory}),this.graph=new G9(this),this.scene=new $9(this)}connect(e,t=!1){return Bi(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 Bi(this,void 0,void 0,function*(){const e=(new Date).getTime(),t="ccf-database.last_modified",i="ccf-database",r=yield A9(t).catch(()=>{});let s;r&&e-new Date(+r).getTime()>36e5?yield function(n,e=Cc()){return e("readwrite",t=>(n.forEach(i=>t.delete(i)),vu(t.transaction)))}([i,t]).catch(()=>{}):s=yield A9(i).catch(()=>{}),s?yield this.deserialize(s):(yield this.doConnect(),function(n,e=Cc()){return e("readwrite",t=>(n.forEach(i=>t.put(i[1],i[0])),vu(t.transaction)))}([[i,this.serialize()],[t,""+e]]).catch(()=>{}))})}doConnect(){var e,t;return Bi(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.startsWith("{"))this.store=(0,Un.deserializeN3Store)(s,Un.DataFactory);else 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,Un.deserializeN3Store)(o,Un.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(X9(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 Bi(this,void 0,void 0,function*(){const i=null!=t?t:this.store;return yield Promise.all(e.map(r=>Bi(this,void 0,void 0,function*(){"string"==typeof r?(r.startsWith("http")||r.startsWith("assets/"))&&r.includes("jsonld")?(r=$k(r=yield fetch(r).then(s=>s.text())),yield(0,Un.addJsonLdToStore)(r,i)):r.endsWith("n3")?yield(0,Un.addN3ToStore)(r,i):r.endsWith("rdf")||r.endsWith("owl")||r.endsWith("xml")?yield(0,Un.addRdfXmlToStore)(r,i):(r=$k(r),yield(0,Un.addJsonLdToStore)(r,i)):(r=$k(JSON.stringify(r)),yield(0,Un.addJsonLdToStore)(r,i))}))),this})}synchronize(){return Bi(this,void 0,void 0,function*(){return yield new Promise(e=>{setTimeout(e,500)}),this.graph.createGraph(),function(n){var e,t,i;const r=eq(n),s=new Map;for(const{subject:o,object:a}of(0,Un.readQuads)(n,null,ki.spatialEntity.representation_of,null,null)){const l=new Set([a.id]);let c=null===(e=r.nodes[a.id])||void 0===e?void 0:e.parent;for(;c&&!l.has(c);)l.add(c),c=null===(t=r.nodes[c])||void 0===t?void 0:t.parent;s.set(o.id,[...l].map(u=>Un.DataFactory.namedNode(u)))}for(const{object:o}of(0,Un.readQuads)(n,null,vi.spatialEntity,null,null))for(const{subject:a}of(0,Un.readQuads)(n,null,ki.spatialPlacement.source,o,null))for(const{object:l}of(0,Un.readQuads)(n,a,ki.spatialPlacement.target,null,null))for(const c of null!==(i=s.get(l.id))&&void 0!==i?i:[])n.addQuad(Un.DataFactory.namedNode(o.id),ki.spatialEntity.ccf_annotations,c)}(this.store),this})}serialize(){return(0,Un.serializeN3Store)(this.store)}deserialize(e){return Bi(this,void 0,void 0,function*(){this.store=(0,Un.deserializeN3Store)(e,Un.DataFactory),this.graph=new G9(this),this.scene=new $9(this),yield new Promise(t=>{setTimeout(t,10)})})}getIds(e={}){return function(n,e,t){var i,r,s,o,a,l,c;let u=function(n){const e=new Set;return n.forSubjects(t=>e.add(t.id),vi.spatialEntity,null,null),e}(n);if(u.size>0&&(u=function(n,e,t=!0){const i=new Set;if(n.forSubjects(ev(e,i),vi.spatialEntity,null,null),!t){const r=new Set;return e.forEach(s=>i.has(s)?void 0:r.add(s)),r}return i}(n,u)),u.size>0&&("Male"===t.sex||"Female"===t.sex)){const h=t.sex;u=m1(n,u,f=>function(n,e,t){const i=new Set;return n.forSubjects(ev(e,i),vi.sex,vi[t],null),i}(n,f,h))}if(u.size>0&&(null===(i=t.tmc)||void 0===i?void 0:i.length)>0&&(u=m1(n,u,h=>function(n,e,t){const i=new Set;for(const r of t){const s=Un.DataFactory.literal(r);n.forSubjects(ev(e,i),vi.providerName,s,null)}return i}(n,h,t.tmc))),u.size>0&&(null===(r=t.technologies)||void 0===r?void 0:r.length)>0&&(u=function(n,e,t){var i,r;const s=new Map,o=new Set,a=new Set(e);for(const u of e)for(const h of(0,Un.readQuads)(n,u,vi.sections,null,null))a.add(h.object.id);for(const u of a)for(const h of(0,Un.readQuads)(n,u,vi.datasets,null,null))o.add(h.object.id),s.has(h.object.id)?null===(i=s.get(h.object.id))||void 0===i||i.push(u):s.set(h.object.id,[u]);const l=t(o),c=new Set;for(const u of l)for(const h of null!==(r=s.get(u))&&void 0!==r?r:[])c.add(h);return c}(n,u,h=>function(n,e,t){const i=new Set;for(const r of t){const s=Un.DataFactory.literal(r);n.forSubjects(ev(e,i),vi.technology,s,null)}return i}(n,h,t.technologies))),u.size>0&&(null===(s=t.spatialSearches)||void 0===s?void 0:s.length)>0&&(u=Gk(n,u,h=>function(n,e,t,i){const r=new Set;for(const s of i)nNe(n,e,t,s).forEach(a=>r.add(a));return r}(n,e,h,t.spatialSearches))),u.size>0&&(null===(o=t.ontologyTerms)||void 0===o?void 0:o.length)>0){const h=t.ontologyTerms;-1===h.indexOf(vd.body.id)&&(u=Gk(n,u,f=>K9(n,f,h)))}if(u.size>0&&(null===(a=t.cellTypeTerms)||void 0===a?void 0:a.length)>0){const h=t.cellTypeTerms;-1===h.indexOf(vd.cell.id)&&(u=Gk(n,u,f=>function(n,e,t){const i=new Set;for(const r of t)n.forObjects(s=>{i.add(s.id)},r,ki.asctb.located_in,null),r===vd.cell.id&&i.add(vd.body.id);return K9(n,e,[...i])}(n,f,h)))}if(u.size>0&&2===(null===(l=t.ageRange)||void 0===l?void 0:l.length)&&(0,mr.isFinite)(t.ageRange[0])&&(0,mr.isFinite)(t.ageRange[1])){const h=Math.max(...t.ageRange),f=Math.min(...t.ageRange);1===f&&110===h||(u=m1(n,u,g=>function(n,e,t,i){const r=new Set;for(const s of e)for(const o of(0,Un.readQuads)(n,s,vi.age,null,null)){const a=(0,c1.fromRdf)(o.object);a>=t&&a<=i&&r.add(s)}return r}(n,g,f,h)))}if(u.size>0&&2===(null===(c=t.bmiRange)||void 0===c?void 0:c.length)&&(0,mr.isFinite)(t.bmiRange[0])&&(0,mr.isFinite)(t.bmiRange[1])){const h=Math.max(...t.bmiRange),f=Math.min(...t.bmiRange);13===f&&83===h||(u=m1(n,u,g=>function(n,e,t,i){const r=new Set;for(const s of e)for(const o of(0,Un.readQuads)(n,s,vi.bmi,null,null)){const a=(0,c1.fromRdf)(o.object);a>=t&&a<=i&&r.add(s)}return r}(n,g,f,h)))}return u}(this.store,this.graph,e)}get(e){return this.store.getQuads(Un.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=>function(n,e){const t=n.getObjects(Un.DataFactory.namedNode(e),vi.spatialEntity,null);if(t.length>0)return hp(n,t[0].id)}(this.store,t))}getDatabaseStatus(){return Bi(this,void 0,void 0,function*(){return this.status||(this.status=new ANe(this)),this.status.toJson()})}getDatasetTechnologyNames(){return Bi(this,void 0,void 0,function*(){return function(n){const e=new Set;for(const t of(0,Un.readQuads)(n,null,vi.technology,null,null))e.add(t.object.value);return Array.from(e).sort()}(this.store)})}getProviderNames(){return Bi(this,void 0,void 0,function*(){return function(n){const e=new Set;for(const t of(0,Un.readQuads)(n,null,vi.providerName,null,null))e.add(t.object.value);return Array.from(e).sort()}(this.store)})}getTissueBlockResults(e){return Bi(this,void 0,void 0,function*(){return e=Object.assign(Object.assign({},e),{hasSpatialEntity:!0}),[...this.getIds(e)].map(t=>function(n,e){const t={"@id":e,"@type":"Sample",sections:[],datasets:[]};for(const[i,r]of Uk(n,e,xNe))if("sections"===i){const s=CNe(n,r);t[i].push(s)}else if("datasets"===i){const s=tq(n,r);t[i].push(s)}else t[i]="donor"===i?SNe(n,r):r;return t}(this.store,t))})}getAggregateResults(e){return Bi(this,void 0,void 0,function*(){return function(n,e){const t=Jb(e,n,vi.donor.id),i=Jb(e,t,vi.providerUUID.id),r=new Set;for(const l of n)for(const c of(0,Un.readQuads)(e,l,vi.spatialEntity,null,null))r.add(c.subject.id);const s=Jb(e,r,vi.sections.id),o=new Set([...Jb(e,r,vi.datasets.id),...Jb(e,s,vi.datasets.id)]);return 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 Bi(this,void 0,void 0,function*(){return function(n,e){const t={};return Q9(n,e).forEach((r,s)=>{t[s]=r.size}),t}(this.getIds(e),this.store)})}getCellTypeTermOccurences(e){return Bi(this,void 0,void 0,function*(){return function(n,e){var t,i;const r=Q9(n,e),s=new Map;for(const a of r.keys()){const l=r.get(a);for(const c of(0,Un.readQuads)(e,null,ki.asctb.located_in,a,null)){const u=c.subject.id;if(s.has(u)){const h=s.get(u);l.forEach(f=>h.add(f))}else s.set(u,new Set(l))}}const o={};return s.forEach((a,l)=>{o[l]=a.size}),o[vd.cell.id]=null!==(i=null===(t=r.get(vd.body.id))||void 0===t?void 0:t.size)&&void 0!==i?i:0,o}(this.getIds(e),this.store)})}getOntologyTreeModel(){return Bi(this,void 0,void 0,function*(){return eq(this.store)})}getCellTypeTreeModel(){return Bi(this,void 0,void 0,function*(){return function(n){return Z9(n,vd.cell.id,"cell",ki.asctb.ct_is_a.id)}(this.store)})}getReferenceOrgans(){return Bi(this,void 0,void 0,function*(){return this.scene.getReferenceOrgans()})}getScene(e){return Bi(this,void 0,void 0,function*(){return this.graph.createGraph(),this.scene.getScene(e)})}getReferenceOrganScene(e,t){return Bi(this,void 0,void 0,function*(){return this.graph.createGraph(),this.scene.getReferenceOrganScene(e,t)})}getSpatialPlacement(e,t){return Bi(this,void 0,void 0,function*(){return this.graph.getSpatialPlacement(e,t)})}}class nq extends Error{constructor(){super(...arguments),this.message="NgxsDispatchPluginModule is not imported"}}function NNe(){throw new nq}function kNe(){throw new nq}function Wk(n,e,t){e.run(()=>n.dispatch(t))}function BNe(n,e,t,i){return yg(t)?function(n,e,t){return t.then(i=>(Wk(n,e,i),i))}(n,e,t):Im(t)?function(n,e,t,i){return null!==i&&(t=t.pipe(gr(i.cancelUncompleted$))),t.subscribe({next:r=>Wk(n,e,r)}),t}(n,e,t,i):(Wk(n,e,t),t)}class VNe{constructor(){this.cancelUncompleted$=new oe}cancelPreviousAction(){this.cancelUncompleted$.next()}}const qk="\u0275fac",iq=Symbol("InjectorInstance"),rq=Symbol("FactoryHasBeenDecorated");function sq(n,e){const t=n[iq];return t?t.get(e):null}const zNe={cancelUncompleted:!1};function oq(n=zNe){return(e,t,i)=>{let r;const s=function(n){return n?new VNe:null}(n.cancelUncompleted);function o(){null!==s&&s.cancelPreviousAction();const a=sq(this,hu)||NNe(),l=sq(this,pn)||kNe(),c=r.apply(this,arguments);return l.runOutsideAngular(()=>BNe(a,l,c,s))}"function"==typeof(null==i?void 0:i.value)?(r=i.value,i.value=o):Object.defineProperty(e,t,{set:a=>r=a,get:()=>o}),function(n){if(rq in n.constructor.prototype)return;const e=n.constructor;"function"==typeof e[qk]&&function(n){const e=n[qk];if("function"!=typeof e)return;const t=n.\u0275prov||n.\u0275pipe||n.\u0275cmp||n.\u0275dir,i=()=>{const r=e();return r[iq]=Ce(Vu),r};t&&(t.factory=i),Object.defineProperty(n,qk,{get:()=>i})}(e),n.constructor.prototype[rq]=!0}(e)}}const mke=["bodyCanvas"];let _ke=(()=>{class n{constructor(){this.clsName="ccf-body-ui",this.rotationChange=new ln,this.nodeDrag=new ln,this.nodeClick=new ln,this.nodeHoverStart=new ln,this.nodeHoverStop=new ln,this.initialized=new ln,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 Bi(this,void 0,void 0,function*(){const i=this.bodyCanvas.nativeElement,r=new zve({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.target&&this.bodyUI.setTarget(this.target),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))],this.initialized.emit()})}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=rn({type:n,selectors:[["ccf-body-ui"]],viewQuery:function(t,i){if(1&t&&hr(mke,5,gn),2&t){let r;Gn(r=$n())&&(i.bodyCanvas=r.first)}},hostVars:2,hostBindings:function(t,i){2&t&&Va(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",initialized:"initialized"},decls:2,vars:0,consts:[[1,"body-ui"],["bodyCanvas",""]],template:function(t,i){1&t&&ni(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})(),yke=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=tn({type:n}),n.\u0275inj=St({imports:[[fr]]}),n})();new Ht("Maximum number of autocomplete options displayed",{providedIn:"root",factory:()=>10});const yq=[{src:"app:skin",organ:"Skin",name:"Skin",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002097"},{src:"app:brain",organ:"Brain",name:"Brain",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000955"},{disabled:!0,src:"app:lymph-nodes",organ:"Lymph Node",name:"Lymph Node",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000029"},{src:"app:lymph-nodes",organ:"Lymph Node",name:"Lymph Node",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002509"},{disabled:!0,src:"app:eye",organ:"Eye",name:"Eye, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000970"},{src:"app:eye",organ:"Eye",name:"Eye, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0004548"},{src:"app:eye",organ:"Eye",name:"Eye, R",side:"right",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0004549"},{disabled:!0,src:"app:fallopian-tube-left",organ:"Fallopian Tube",name:"Fallopian Tube, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0003889"},{src:"app:fallopian-tube-left",organ:"Fallopian Tube",name:"Fallopian Tube, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0001303"},{src:"app:fallopian-tube-right",organ:"Fallopian Tube",name:"Fallopian Tube, R",side:"right",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0001302"},{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, L",side:"left",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"},{disabled:!0,src:"app:knee",organ:"Knee",name:"Knee, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001465"},{src:"app:knee",organ:"Knee",name:"Knee, L",side:"left",hasSex:!0,id:"http://purl.org/sig/ont/fma/fma24978"},{src:"app:knee",organ:"Knee",name:"Knee, R",side:"right",hasSex:!0,id:"http://purl.org/sig/ont/fma/fma24977"},{src:"app:liver",organ:"Liver",name:"Liver",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002107"},{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"},{disabled:!0,src:"app:mammary-gland",organ:"Mammary Gland",name:"Mammary Gland, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0001911"},{src:"app:mammary-gland",organ:"Mammary Gland",name:"Mammary Gland, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.org/sig/ont/fma/fma57991"},{src:"app:mammary-gland",organ:"Mammary Gland",name:"Mammary Gland, R",side:"right",hasSex:!1,sex:"female",id:"http://purl.org/sig/ont/fma/fma57987"},{disabled:!0,src:"app:ovary-left",organ:"Ovary",name:"Ovary, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0000992"},{src:"app:ovary-left",organ:"Ovary",name:"Ovary, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.org/sig/ont/fma/fma7214"},{src:"app:ovary-right",organ:"Ovary",name:"Ovary, R",side:"right",hasSex:!1,sex:"female",id:"http://purl.org/sig/ont/fma/fma7213"},{src:"app:pancreas",organ:"Pancreas",name:"Pancreas",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001264"},{src:"app:pelvis-f",organ:"Pelvis",name:"Pelvis",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001270"},{src:"app:placenta",organ:"Placenta",name:"Placenta",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0001987"},{src:"app:prostate",organ:"Prostate",name:"Prostate",hasSex:!1,sex:"male",id:"http://purl.obolibrary.org/obo/UBERON_0002367",disabled:!0},{src:"app:prostate",organ:"Prostate",name:"Prostate",hasSex:!1,sex:"male",id:"http://purl.obolibrary.org/obo/UBERON_0000079"},{src:"app:small-intestine",organ:"Small Intestine",name:"Small Intestine",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002108"},{src:"app:large-intestine",organ:"Large Intestine",name:"Large Intestine",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000059"},{src:"app:spinal-cord",organ:"Spinal Cord",name:"Spinal Cord",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002240"},{src:"app:spleen",organ:"Spleen",name:"Spleen",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002106"},{src:"app:thymus",organ:"Thymus",name:"Thymus",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002370"},{disabled:!0,src:"app:ureter-left",organ:"Ureter",name:"Ureter, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000056"},{src:"app:ureter-left",organ:"Ureter",name:"Ureter, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001223"},{src:"app:ureter-right",organ:"Ureter",name:"Ureter, R",side:"right",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001222"},{src:"app:bladder",organ:"Urinary Bladder",name:"Urinary Bladder",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001255"},{src:"app:uterus",organ:"Uterus",name:"Uterus",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0000995"},{src:"app:vasculature-thick",organ:"Blood Vasculature",name:"Blood Vasculature",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0004537"},{disabled:!0,src:"app:vasculature-thick",organ:"Blood Vasculature",name:"Blood Vasculature",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002049"}].sort((n,e)=>n.name.localeCompare(e.name));function Lke(n,e){if(1&n&&(wt(0,"div",16),ni(1,"youtube-player",17),Et()),2&n){const t=_i(3);zt(1),dE("videoId",t.videoID)}}function Bke(n,e){if(1&n&&(wt(0,"mat-expansion-panel",11),wt(1,"mat-expansion-panel-header"),wt(2,"h2",12),Jn(3),Et(),Et(),wt(4,"div",13),ni(5,"markdown",14),wi(6,Lke,2,1,"div",15),Et(),Et()),2&n){const t=_i(),i=t.index,r=t.$implicit;Jt("expanded",0===i),zt(3),gs(r.title),zt(2),ai("first",0===i),Jt("data",r.content),zt(1),Jt("ngIf",0===i)}}function Vke(n,e){if(1&n&&(wt(0,"div",9),wi(1,Bke,7,6,"mat-expansion-panel",10),Et()),2&n){const t=e.$implicit;zt(1),Jt("ngIf",t)}}yq.filter(n=>!0!==n.disabled);let bq=(()=>{class n{constructor(t,i){this.dialogRef=t,this.data=i,this.documentationContents=i.content||[],this.infoTitle=i.title||"",this.videoID=i.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 n.\u0275fac=function(t){return new(t||n)(Ce(kC),Ce(PW))},n.\u0275cmp=rn({type:n,selectors:[["ccf-info-dialog"]],decls:11,vars:2,consts:[[1,"rui-about","wrapper"],[1,"container"],[1,"content"],[1,"header"],["mat-dialog-title","",1,"title"],[1,"close"],[1,"material-icons","close-icon",3,"click"],[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,i){1&t&&(wt(0,"div",0),wt(1,"div",1),wt(2,"div",2),wt(3,"div",3),wt(4,"h2",4),Jn(5),Et(),wt(6,"div",5),wt(7,"mat-icon",6),Tn("click",function(){return i.close()}),Jn(8,"clear"),Et(),Et(),Et(),wt(9,"mat-dialog-content",7),wi(10,Vke,2,1,"div",8),Et(),Et(),Et(),Et()),2&t&&(zt(5),gs(i.infoTitle),zt(5),Jt("ngForOf",i.documentationContents))},directives:[kW,Fm,FW,Yu,ac,UW,zW,WW,KW],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%] .content[_ngcontent-%COMP%] .header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;height:3rem;margin-bottom:2.25rem;position:relative}.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%]{cursor:pointer;height:3rem;width:3rem;line-height:3rem;text-align:center;transition:.6s}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-size:1.5rem;margin:0 auto;line-height:3rem;height:3rem;justify-self:center;display:flex}.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;display:flex}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .dialog-content[_ngcontent-%COMP%] .variable-binding.first[_ngcontent-%COMP%]{padding-right:1rem;width:73%}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .dialog-content[_ngcontent-%COMP%] .variable-binding[_ngcontent-%COMP%] ul{margin:0}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .dialog-content[_ngcontent-%COMP%] .variable-binding[_ngcontent-%COMP%] img{margin-left:1rem;float:right}.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%}"]}),n})(),vq=(()=>{class n{constructor(t){this.http=t,this.panelContent=new Fr({content:[],infoTitle:"",videoID:""})}updateData(t,i,r){this.http.get(t,{responseType:"text"}).subscribe(s=>{const o={content:this.parseMarkdown(s),infoTitle:r,videoID:i};this.panelContent.next(o)})}parseMarkdown(t){const i=[],r=t.split("# ");for(const s of r)if(s.length){const o=s.includes("\n\n")?"\n\n":"\r\n\r\n",a=s.split(o);i.push({title:a[0],content:a.splice(1).join(o)})}return i}}return n.\u0275fac=function(t){return new(t||n)(Ie(_u))},n.\u0275prov=We({token:n,factory:n.\u0275fac,providedIn:"root"}),n})(),Uke=(()=>{class n{constructor(){this.clsName="ccf-call-to-action",this.callToActionClicked=new ln,this.closeClicked=new ln}close(){this.closeClicked.emit()}onDialogButtonClick(){this.callToActionClicked.emit()}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=rn({type:n,selectors:[["ccf-call-to-action"]],hostVars:2,hostBindings:function(t,i){2&t&&Va(i.clsName)},inputs:{infoTitle:"infoTitle",imageUrl:"imageUrl",message:"message",callToAction:"callToAction"},outputs:{callToActionClicked:"callToActionClicked",closeClicked:"closeClicked"},decls:13,vars:4,consts:[[1,"rui-about","wrapper"],[1,"container"],[1,"content"],[1,"first-row"],["mat-dialog-title","",1,"title"],[1,"cta-mat-icon","material-icons","close-icon",3,"click"],["mat-card-sm-image","","alt","preview","layout-fill","",1,"cta-image",3,"src"],[1,"mat-typography","dialog-content"],[1,"message"],["mat-button","",1,"mat-button",3,"text","click"]],template:function(t,i){1&t&&(wt(0,"div",0),wt(1,"div",1),wt(2,"div",2),wt(3,"div",3),wt(4,"p",4),Jn(5),Et(),wt(6,"mat-icon",5),Tn("click",function(){return i.close()}),Jn(7,"clear"),Et(),Et(),ni(8,"img",6),wt(9,"mat-dialog-content",7),wt(10,"div",8),Jn(11),Et(),wt(12,"a",9),Tn("click",function(){return i.onDialogButtonClick()}),Et(),Et(),Et(),Et(),Et()),2&t&&(zt(5),gs(i.infoTitle),zt(3),Jt("src",i.imageUrl,sf),zt(3),xo(" ",i.message,""),zt(1),Jt("text",i.callToAction))},directives:[kW,Fm,BMe,FW],styles:["[_nghost-%COMP%] .content[_ngcontent-%COMP%]{display:block;align-content:center;padding-left:1.6rem;padding-right:1.6rem;border-radius:.25rem}[_nghost-%COMP%] .info-button-wrapper[_ngcontent-%COMP%]{border-radius:.25rem;padding:.6rem;transition:.6s}[_nghost-%COMP%] .info-button-wrapper[_ngcontent-%COMP%] .ccf-info-button[_ngcontent-%COMP%]{cursor:pointer;transition:color .6s;font-size:1.2rem;vertical-align:sub}[_nghost-%COMP%] .first-row[_ngcontent-%COMP%]{display:flex;width:100%;line-height:.9rem}[_nghost-%COMP%] .first-row[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{padding-right:7rem;padding-left:.2rem;font-size:.875rem;padding-top:.75rem}[_nghost-%COMP%] .first-row[_ngcontent-%COMP%] .cta-mat-icon[_ngcontent-%COMP%]{height:30%;line-height:3.4rem}[_nghost-%COMP%] .message[_ngcontent-%COMP%]{padding:.5rem}[_nghost-%COMP%] .cta-image[_ngcontent-%COMP%]{align-self:center;-o-object-fit:cover;object-fit:cover;width:100%;border-radius:.25rem}[_nghost-%COMP%] .mat-button[_ngcontent-%COMP%]{background-color:#444a65;font-size:.75rem;position:relative;margin-bottom:1rem;width:100%;height:2rem;color:#fff}"],changeDetection:0}),n})(),Qm=(()=>{let n=class extends MDe{constructor(){super(...arguments),this.optionCache=new Map}get config$(){return this.state$.pipe(Ki(n=>null!=n),Wa(1))}setConfig(t){this.setState(t)}patchConfig(t){this.patchState(t)}getProperty(t){return this.config$.pipe(oW(...t),ld(),Wa(1))}getOption(...t){const i=this.getPathKey(t);if(this.optionCache.has(i))return this.optionCache.get(i);const r=this.config$.pipe(oW(...t),ld(),Wa(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=zi(n)))(i||n)}}(),n.\u0275prov=We({token:n,factory:n.\u0275fac}),Ei([f7()],n.prototype,"config$",null),n=Ei([CDe(),A5({name:"globalConfig",defaults:null})],n),n})();!function(){const n=localStorage.getItem("ALLOW_TELEMETRY");null===n||n.toLowerCase()}();class wq extends class{getDatabaseStatus(){return this.forwardCall("getDatabaseStatus")}getProviderNames(){return this.forwardCall("getProviderNames")}getDatasetTechnologyNames(){return this.forwardCall("getDatasetTechnologyNames")}getOntologyTreeModel(){return this.forwardCall("getOntologyTreeModel")}getCellTypeTreeModel(){return this.forwardCall("getCellTypeTreeModel")}getReferenceOrgans(){return this.forwardCall("getReferenceOrgans")}getTissueBlockResults(e){return this.forwardCall("getTissueBlockResults",e)}getAggregateResults(e){return this.forwardCall("getAggregateResults",e)}getOntologyTermOccurences(e){return this.forwardCall("getOntologyTermOccurences",e)}getCellTypeTermOccurences(e){return this.forwardCall("getCellTypeTermOccurences",e)}getScene(e){return this.forwardCall("getScene",e)}getReferenceOrganScene(e,t){return this.forwardCall("getReferenceOrganScene",e,t)}}{forwardCall(e,...t){return this.impl$.pipe(is(i=>i[e](...t)))}}let Eq=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const Qk=new oe,nv={cacheBusterObserver:Qk},Zm={cacheBusterObserver:Qk,maxCacheCount:4};function xq(n,e,t){return n?{min:n[0]>e?n[0]:void 0,max:n[1]{var t;return Object.assign(Object.assign({},e),{transformMatrix:new qn(null!==(t=e.transformMatrix)&&void 0!==t?t:[])})})}let Xke=(()=>{class n{constructor(t,i){this.api=t,this.globalConfig=i,i.getOption("hubmapToken").subscribe(Qk)}getDatabaseStatus(){return this.doRequest(t=>this.api.dbStatus(t))}getProviderNames(){return this.doRequest(t=>this.api.providerNames(t))}getDatasetTechnologyNames(){return this.doRequest(t=>this.api.technologyNames(t))}getOntologyTreeModel(){return this.doRequest(t=>this.api.ontologyTreeModel(t),void 0,{},n=>n)}getCellTypeTreeModel(){return this.doRequest(t=>this.api.cellTypeTreeModel(t),void 0,{},n=>n)}getReferenceOrgans(){return this.doRequest(t=>this.api.referenceOrgans(t),void 0,{},n=>n)}getTissueBlockResults(t){return this.doRequest(i=>this.api.tissueBlocks(i),t,{},n=>n)}getAggregateResults(t){return this.doRequest(i=>this.api.aggregateResults(i),t)}getOntologyTermOccurences(t){return this.doRequest(i=>this.api.ontologyTermOccurences(i),t)}getCellTypeTermOccurences(t){return this.doRequest(i=>this.api.cellTypeTermOccurences(i),t)}getScene(t){return this.doRequest(i=>this.api.scene(i),t,{},Sq)}getReferenceOrganScene(t,i){return this.doRequest(r=>this.api.referenceOrganScene(r),i,{organIri:t},Sq)}doRequest(t,i,r,s){const{api:o,globalConfig:a}=this,l=Object.assign(Object.assign({},function(n){var e,t;return{age:xq(null==n?void 0:n.ageRange,1,110),bmi:xq(null==n?void 0:n.bmiRange,13,83),sex:null===(t=null===(e=null==n?void 0:n.sex)||void 0===e?void 0:e.toLowerCase)||void 0===t?void 0:t.call(e),ontologyTerms:null==n?void 0:n.ontologyTerms,cellTypeTerms:null==n?void 0:n.cellTypeTerms,providers:null==n?void 0:n.tmc,technologies:null==n?void 0:n.technologies,spatial:null==n?void 0:n.spatialSearches}}(i)),r);return yc([a.getOption("remoteApiEndpoint"),a.getOption("hubmapToken")]).pipe(qr(1),cr(([c,u])=>{o.configuration.basePath=c,u&&(l.token=u)}),is(()=>t(l)),me(c=>s?s(c):c))}}return n.\u0275fac=function(t){return new(t||n)(Ie(T9),Ie(Qm))},n.\u0275prov=We({token:n,factory:n.\u0275fac,providedIn:"root"}),Ei([Sc(nv)],n.prototype,"getProviderNames",null),Ei([Sc(nv)],n.prototype,"getDatasetTechnologyNames",null),Ei([Sc(nv)],n.prototype,"getOntologyTreeModel",null),Ei([Sc(nv)],n.prototype,"getCellTypeTreeModel",null),Ei([Sc(nv)],n.prototype,"getReferenceOrgans",null),Ei([Sc(Zm)],n.prototype,"getTissueBlockResults",null),Ei([Sc(Zm)],n.prototype,"getAggregateResults",null),Ei([Sc(Zm)],n.prototype,"getOntologyTermOccurences",null),Ei([Sc(Zm)],n.prototype,"getCellTypeTermOccurences",null),Ei([Sc(Zm)],n.prototype,"getScene",null),Ei([Sc(Zm)],n.prototype,"getReferenceOrganScene",null),n})(),Kke=(()=>{class n extends wq{constructor(t){super(),this.impl$=this.database$=t.config$.pipe(i=>i,Ki(i=>Object.keys(i).length>0),is(i=>function(n,e){return new O(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?je(r):Qc).subscribe(t);return()=>{o.unsubscribe(),i&&i.unsubscribe()}})}(()=>this.createDatabase(i),r=>this.connectDatabase(r,i))),me(i=>i.database),Wa(1))}connectDatabase(t,i){return Bi(this,void 0,void 0,function*(){const r=!fa();return yield t.database.connect(i,r),t})}}return n.\u0275fac=function(t){return new(t||n)(Ie(Qm))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),Qke=(()=>{class n extends Kke{createDatabase(t){return{database:new ONe(t),unsubscribe:()=>{}}}}return n.\u0275fac=function(){let e;return function(i){return(e||(e=zi(n)))(i||n)}}(),n.\u0275prov=We({token:n,factory:n.\u0275fac,providedIn:"root"}),n})(),Zke=(()=>{class n extends wq{constructor(t,i){super(),this.impl$=t.config$.pipe(r=>r,me(r=>this.selectToken(r)),ld(),me(r=>i.get(r)),Wa(1))}}return n.\u0275fac=function(t){return new(t||n)(Ie(Qm),Ie(Hn))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),Zk=(()=>{class n{}return n.type="[CallToAction] Learn More",n})(),Jk=(()=>{class n{}return n.type="[CallToAction] Open Dialog",n})(),eF=(()=>{class n{}return n.type="[CallToAction] Close Dialog",n})();var tF;class wa{get length(){var e,t;return null!==(t=null===(e=wa.storage)||void 0===e?void 0:e.length)&&void 0!==t?t:0}key(e){var t,i;return null!==(i=null===(t=wa.storage)||void 0===t?void 0:t.key(e))&&void 0!==i?i:null}getItem(e,t){var i,r,s;return null!==(s=null!==(r=null===(i=wa.storage)||void 0===i?void 0:i.getItem(e))&&void 0!==r?r:t)&&void 0!==s?s:null}setItem(e,t){var i;try{return null===(i=wa.storage)||void 0===i||i.setItem(e,t),!0}catch(r){return!1}}removeItem(e){var t;null===(t=wa.storage)||void 0===t||t.removeItem(e)}clear(){var e;null===(e=wa.storage)||void 0===e||e.clear()}}wa.storage=(()=>{let n;try{n=window.localStorage;const e="__storage_test__";return n.setItem(e,e),n.removeItem(e),n}catch(e){return e instanceof DOMException&&(22===e.code||1014===e.code||"QuotaExceededError"===e.name||"NS_ERROR_DOM_QUOTA_REACHED"===e.name)&&n&&0!==n.length?n:void 0}})(),wa.\u0275fac=function(e){return new(e||wa)},wa.\u0275prov=We({token:wa,factory:wa.\u0275fac,providedIn:"root"});const Cq="callToActionPopupShown";let Ro=tF=class{constructor(e,t,i,r,s){this.dialog=e,this.ga=t,this.storage=i,this.infoService=r,this.http=s}static ctaDatePassed(e,t=Date.now){return+t()>+new Date(e)}ngxsOnInit(e){const{expirationDate:t,popupShown:i}=e.getState(),r=this.storage.getItem(Cq,`${i}`),s=tF.ctaDatePassed(t);"true"!==r&&!s&&e.dispatch(new Jk)}getDialogData(){return this.http.get("assets/docs/SPATIAL_SEARCH_README.md",{responseType:"text"}).pipe(me(e=>this.infoService.parseMarkdown(e)))}launchLearnMore(e){this.dialog.open(bq,{autoFocus:!1,panelClass:"modal-animated",width:"72rem",data:{title:"Spatial Search",content:e,videoID:"UfxMpzatowE"}})}learnMore(e){return this.dialog.closeAll(),this.ga.event("open_learn_more","call_to_action"),this.getDialogData().pipe(cr(t=>this.launchLearnMore(t)))}open(e){this.dialog.open(eFe,{autoFocus:!1,panelClass:"modal-animated",width:"30.75rem",height:"36.688rem"}),this.ga.event("open","call_to_action"),this.storage.setItem(Cq,"true"),e.patchState({popupShown:!0})}close(e){this.dialog.closeAll(),this.ga.event("close","call_to_action")}};Ro.\u0275fac=function(e){return new(e||Ro)(Ie(Nb),Ie(qb),Ie(wa),Ie(vq),Ie(_u))},Ro.\u0275prov=We({token:Ro,factory:Ro.\u0275fac}),Ei([yP(Zk)],Ro.prototype,"learnMore",null),Ei([yP(Jk)],Ro.prototype,"open",null),Ei([yP(eF)],Ro.prototype,"close",null),Ro=tF=Ei([A5({name:"callToAction",defaults:{title:"New to the Exploration User Interface",message:"Spatial Search has arrived!",callToAction:"Learn More",imageUrl:"assets/images/spatial_search.gif",expirationDate:"Dec 1, 2022",popupShown:!1}})],Ro);let E1=(()=>{class n{static title(t){return t.title}static message(t){return t.message}static callToAction(t){return t.callToAction}static imageUrl(t){return t.imageUrl}static expirationDate(t){return t.expirationDate}static popupShown(t){return t.popupShown}}return Ei([_m([Ro])],n,"title",null),Ei([_m([Ro])],n,"message",null),Ei([_m([Ro])],n,"callToAction",null),Ei([_m([Ro])],n,"imageUrl",null),Ei([_m([Ro])],n,"expirationDate",null),Ei([_m([Ro])],n,"popupShown",null),n})(),eFe=(()=>{class n{constructor(){this.close=()=>new eF,this.learnMore=()=>new Zk}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=rn({type:n,selectors:[["ccf-call-to-action-behavior"]],decls:5,vars:12,consts:[[3,"infoTitle","message","callToAction","imageUrl","callToActionClicked","closeClicked"]],template:function(t,i){1&t&&(wt(0,"ccf-call-to-action",0),Tn("callToActionClicked",function(){return i.learnMore()})("closeClicked",function(){return i.close()}),Ps(1,"async"),Ps(2,"async"),Ps(3,"async"),Ps(4,"async"),Et()),2&t&&Jt("infoTitle",To(1,4,i.title$))("message",To(2,6,i.message$))("callToAction",To(3,8,i.callToAction$))("imageUrl",To(4,10,i.imageUrl$))},directives:[Uke],pipes:[g0],styles:[""],changeDetection:0}),Ei([PS(E1.title)],n.prototype,"title$",void 0),Ei([PS(E1.message)],n.prototype,"message$",void 0),Ei([PS(E1.callToAction)],n.prototype,"callToAction$",void 0),Ei([PS(E1.imageUrl)],n.prototype,"imageUrl$",void 0),Ei([oq()],n.prototype,"close",void 0),Ei([oq()],n.prototype,"learnMore",void 0),n})(),iFe=(()=>{class n{constructor(t){this.source=t,this.organs=yq}getOrganInfo(t,i,r="Female"){let s=this.organs.find(a=>a.id===t);if(!s)return sn(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)),sn(s)}getOrgan(t,i="Both"){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}):sn([])}getOrganStats(t,i="Female"){return t.id?this.source.getAggregateResults({ontologyTerms:[t.id],sex:i}):sn([])}getBlocks(t,i="Female"){return t.id?this.source.getTissueBlockResults({ontologyTerms:[t.id],sex:i}):sn([])}}return n.\u0275fac=function(t){return new(t||n)(Ie(Eq))},n.\u0275prov=We({token:n,factory:n.\u0275fac,providedIn:"root"}),n})();const rFe=["thumbContainer"],sFe=["toggleBar"],oFe=["input"],aFe=function(n){return{enterDuration:n}},lFe=["*"],cFe=new Ht("mat-slide-toggle-default-options",{providedIn:"root",factory:()=>({disableToggleValue:!1})});let uFe=0;const dFe={provide:Xo,useExisting:ge(()=>Tq),multi:!0};class hFe{constructor(e,t){this.source=e,this.checked=t}}const fFe=wC(Mm(Ch(Am(class{constructor(n){this._elementRef=n}}))));let Tq=(()=>{class n extends fFe{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-"+ ++uFe,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 ln,this.toggleChange=new ln,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=bi(t)}get checked(){return this._checked}set checked(t){this._checked=bi(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 hFe(this,this.checked))}_onLabelTextChange(){this._changeDetectorRef.detectChanges()}}return n.\u0275fac=function(t){return new(t||n)(Ce(gn),Ce(vc),Ce(Mr),yo("tabindex"),Ce(cFe),Ce(Qa,8))},n.\u0275cmp=rn({type:n,selectors:[["mat-slide-toggle"]],viewQuery:function(t,i){if(1&t&&(hr(rFe,5),hr(sFe,5),hr(oFe,5)),2&t){let r;Gn(r=$n())&&(i._thumbEl=r.first),Gn(r=$n())&&(i._thumbBarEl=r.first),Gn(r=$n())&&(i._inputElement=r.first)}},hostAttrs:[1,"mat-slide-toggle"],hostVars:12,hostBindings:function(t,i){2&t&&(qc("id",i.id),Ii("tabindex",i.disabled?null:-1)("aria-label",null)("aria-labelledby",null),ai("mat-checked",i.checked)("mat-disabled",i.disabled)("mat-slide-toggle-label-before","before"==i.labelPosition)("_mat-animation-noopable",i._noopAnimations))},inputs:{disabled:"disabled",disableRipple:"disableRipple",color:"color",tabIndex:"tabIndex",name:"name",id:"id",labelPosition:"labelPosition",ariaLabel:["aria-label","ariaLabel"],ariaLabelledby:["aria-labelledby","ariaLabelledby"],required:"required",checked:"checked",ariaDescribedby:["aria-describedby","ariaDescribedby"]},outputs:{change:"change",toggleChange:"toggleChange"},exportAs:["matSlideToggle"],features:[Vn([dFe]),En],ngContentSelectors:lFe,decls:16,vars:20,consts:[[1,"mat-slide-toggle-label"],["label",""],[1,"mat-slide-toggle-bar"],["toggleBar",""],["type","checkbox","role","switch",1,"mat-slide-toggle-input","cdk-visually-hidden",3,"id","required","tabIndex","checked","disabled","change","click"],["input",""],[1,"mat-slide-toggle-thumb-container"],["thumbContainer",""],[1,"mat-slide-toggle-thumb"],["mat-ripple","",1,"mat-slide-toggle-ripple","mat-focus-indicator",3,"matRippleTrigger","matRippleDisabled","matRippleCentered","matRippleRadius","matRippleAnimation"],[1,"mat-ripple-element","mat-slide-toggle-persistent-ripple"],[1,"mat-slide-toggle-content",3,"cdkObserveContent"],["labelContent",""],[2,"display","none"]],template:function(t,i){if(1&t&&(Hr(),wt(0,"label",0,1),wt(2,"div",2,3),wt(4,"input",4,5),Tn("change",function(s){return i._onChangeEvent(s)})("click",function(s){return i._onInputClick(s)}),Et(),wt(6,"div",6,7),ni(8,"div",8),wt(9,"div",9),ni(10,"div",10),Et(),Et(),Et(),wt(11,"span",11,12),Tn("cdkObserveContent",function(){return i._onLabelTextChange()}),wt(13,"span",13),Jn(14,"\xa0"),Et(),oi(15),Et(),Et()),2&t){const r=ih(1),s=ih(12);Ii("for",i.inputId),zt(2),ai("mat-slide-toggle-bar-no-side-margin",!s.textContent||!s.textContent.trim()),zt(2),Jt("id",i.inputId)("required",i.required)("tabIndex",i.tabIndex)("checked",i.checked)("disabled",i.disabled),Ii("name",i.name)("aria-checked",i.checked.toString())("aria-label",i.ariaLabel)("aria-labelledby",i.ariaLabelledby)("aria-describedby",i.ariaDescribedby),zt(5),Jt("matRippleTrigger",r)("matRippleDisabled",i.disableRipple||i.disabled)("matRippleCentered",!0)("matRippleRadius",20)("matRippleAnimation",function(n,e,t,i){return E3(Vt(),Cs(),n,e,t,i)}(18,aFe,i._noopAnimations?0:150))}},directives:[gu,$P],styles:[".mat-slide-toggle{display:inline-block;height:24px;max-width:100%;line-height:24px;white-space:nowrap;outline:none;-webkit-tap-highlight-color:transparent}.mat-slide-toggle.mat-checked .mat-slide-toggle-thumb-container{transform:translate3d(16px, 0, 0)}[dir=rtl] .mat-slide-toggle.mat-checked .mat-slide-toggle-thumb-container{transform:translate3d(-16px, 0, 0)}.mat-slide-toggle.mat-disabled{opacity:.38}.mat-slide-toggle.mat-disabled .mat-slide-toggle-label,.mat-slide-toggle.mat-disabled .mat-slide-toggle-thumb-container{cursor:default}.mat-slide-toggle-label{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:flex;flex:1;flex-direction:row;align-items:center;height:inherit;cursor:pointer}.mat-slide-toggle-content{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mat-slide-toggle-label-before .mat-slide-toggle-label{order:1}.mat-slide-toggle-label-before .mat-slide-toggle-bar{order:2}[dir=rtl] .mat-slide-toggle-label-before .mat-slide-toggle-bar,.mat-slide-toggle-bar{margin-right:8px;margin-left:0}[dir=rtl] .mat-slide-toggle-bar,.mat-slide-toggle-label-before .mat-slide-toggle-bar{margin-left:8px;margin-right:0}.mat-slide-toggle-bar-no-side-margin{margin-left:0;margin-right:0}.mat-slide-toggle-thumb-container{position:absolute;z-index:1;width:20px;height:20px;top:-3px;left:0;transform:translate3d(0, 0, 0);transition:all 80ms linear;transition-property:transform}._mat-animation-noopable .mat-slide-toggle-thumb-container{transition:none}[dir=rtl] .mat-slide-toggle-thumb-container{left:auto;right:0}.mat-slide-toggle-thumb{height:20px;width:20px;border-radius:50%}.mat-slide-toggle-bar{position:relative;width:36px;height:14px;flex-shrink:0;border-radius:8px}.mat-slide-toggle-input{bottom:0;left:10px}[dir=rtl] .mat-slide-toggle-input{left:auto;right:10px}.mat-slide-toggle-bar,.mat-slide-toggle-thumb{transition:all 80ms linear;transition-property:background-color;transition-delay:50ms}._mat-animation-noopable .mat-slide-toggle-bar,._mat-animation-noopable .mat-slide-toggle-thumb{transition:none}.mat-slide-toggle .mat-slide-toggle-ripple{position:absolute;top:calc(50% - 20px);left:calc(50% - 20px);height:40px;width:40px;z-index:1;pointer-events:none}.mat-slide-toggle .mat-slide-toggle-ripple .mat-ripple-element:not(.mat-slide-toggle-persistent-ripple){opacity:.12}.mat-slide-toggle-persistent-ripple{width:100%;height:100%;transform:none}.mat-slide-toggle-bar:hover .mat-slide-toggle-persistent-ripple{opacity:.04}.mat-slide-toggle:not(.mat-disabled).cdk-keyboard-focused .mat-slide-toggle-persistent-ripple{opacity:.12}.mat-slide-toggle-persistent-ripple,.mat-slide-toggle.mat-disabled .mat-slide-toggle-bar:hover .mat-slide-toggle-persistent-ripple{opacity:0}@media(hover: none){.mat-slide-toggle-bar:hover .mat-slide-toggle-persistent-ripple{display:none}}.cdk-high-contrast-active .mat-slide-toggle-thumb,.cdk-high-contrast-active .mat-slide-toggle-bar{border:1px solid}.cdk-high-contrast-active .mat-slide-toggle.cdk-keyboard-focused .mat-slide-toggle-bar{outline:2px dotted;outline-offset:5px}\n"],encapsulation:2,changeDetection:0}),n})(),Aq=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=tn({type:n}),n.\u0275inj=St({}),n})(),mFe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=tn({type:n}),n.\u0275inj=St({imports:[[Aq,Dm,ji,QS],Aq,ji]}),n})(),_Fe=(()=>{class n{constructor(){this.clsName="ccf-slide-toggle",this.labels=["Left","Right"],this.value="Left",this.disabled=!1,this.valueChange=new ln}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=rn({type:n,selectors:[["ccf-slide-toggle"]],hostVars:2,hostBindings:function(t,i){2&t&&Va(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=wl();wt(0,"span",0),Tn("click",function(){_r(r);const o=ih(3);return i.left||o.toggle(),i.updateToggle(!0)}),Jn(1),Et(),wt(2,"mat-slide-toggle",1,2),Tn("change",function(o){return i.updateToggle(!o.checked)}),Et(),wt(4,"span",0),Tn("click",function(){_r(r);const o=ih(3);return i.left&&o.toggle(),i.updateToggle(!1)}),Jn(5),Et()}2&t&&(ai("disabled",i.disabled)("highlighted",i.left),zt(1),gs(i.labels[0].charAt(0).toUpperCase()+i.labels[0].slice(1)),zt(1),Jt("disabled",i.disabled)("checked",!i.left),zt(2),ai("disabled",i.disabled)("highlighted",!i.left),zt(1),gs(i.labels[1].charAt(0).toUpperCase()+i.labels[1].slice(1)))},directives:[Tq],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 yFe=["bodyUI"],bFe=function(){return["Male","Female"]},vFe=function(){return["Left","Right"]};let wFe=(()=>{class n{constructor(t){this.ga=t,this.sexChange=new ln,this.sideChange=new ln}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.zoomToFitOrgan()}updateSex(t){this.sex=t,this.sexChange.emit(this.sex)}updateSide(t){this.side=t,this.sideChange.emit(this.side)}zoomToFitOrgan(){const{bodyUI:t,organ:i}=this;if(i){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)(Ce(qb))},n.\u0275cmp=rn({type:n,selectors:[["ccf-organ"]],viewQuery:function(t,i){if(1&t&&hr(yFe,7),2&t){let r;Gn(r=$n())&&(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:[Fi],decls:5,vars:10,consts:[["camera","perspective",1,"body-ui",3,"scene","interactive","nodeClick","initialized"],["bodyUI",""],[1,"stage-options"],[1,"view-slider",3,"labels","value","hidden","valueChange"]],template:function(t,i){1&t&&(wt(0,"ccf-body-ui",0,1),Tn("nodeClick",function(s){return i.nodeClicked(s)})("initialized",function(){return i.zoomToFitOrgan()}),Et(),wt(2,"div",2),wt(3,"ccf-slide-toggle",3),Tn("valueChange",function(s){return i.updateSex(s)}),Et(),wt(4,"ccf-slide-toggle",3),Tn("valueChange",function(s){return i.updateSide(s)}),Et(),Et()),2&t&&(Jt("scene",i.scene)("interactive",!0),zt(3),Jt("labels",TE(8,bFe))("value",i.sex)("hidden",!i.sex),zt(1),Jt("labels",TE(9,vFe))("value",i.side)("hidden",!i.side))},directives:[_ke,_Fe],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 EFe(n,e){if(1&n&&(wt(0,"div",3),wt(1,"div",4),Jn(2),Et(),wt(3,"div",5),Jn(4),Et(),Et()),2&n){const t=e.$implicit;zt(2),gs(t.count),zt(2),gs(t.label)}}let xFe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=rn({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&&(wt(0,"div",0),wt(1,"div",1),Jn(2),Et(),wi(3,EFe,5,2,"div",2),Et()),2&t&&(zt(2),xo(" ",i.statsLabel," "),zt(1),Jt("ngForOf",i.stats))},directives:[Yu],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 SFe(n,e){if(1&n){const t=wl();wt(0,"div",6),wt(1,"div",7),wt(2,"div",8),Jn(3),Et(),wt(4,"div",9),Tn("click",function(){const s=_r(t).$implicit;return _i().goToURL(s.buttonUrl)}),Jn(5),Et(),Et(),Et()}if(2&n){const t=e.$implicit;zt(3),gs(t.body),zt(1),Jt("gaLabel",t.buttonUrl),zt(1),xo(" ",t.buttonTitle,"")}}function CFe(n,e){if(1&n){const t=wl();wt(0,"div",10),Tn("click",function(){const s=_r(t).$implicit;return _i().goToURL(s.buttonUrl)}),Jn(1),Et()}if(2&n){const t=e.$implicit;Jt("gaLabel",t.buttonUrl),zt(1),gs(t.buttonTitle)}}let TFe=(()=>{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=rn({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&&(wt(0,"div",0),wi(1,SFe,6,3,"div",1),Et(),wt(2,"div",2),wt(3,"div",3),Jn(4,"Common Coordinate Framework (CCF) Deep Dive"),Et(),wt(5,"div",4),wi(6,CFe,2,2,"div",5),Et(),Et()),2&t&&(zt(1),Jt("ngForOf",i.linkCards),zt(5),Jt("ngForOf",i.deepDives))},directives:[g9,Yu,m9],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 AFe=["left"],MFe=["right"],DFe=function(){return[]},IFe=[{color:[0,0,0,0],opacity:.001}];let OFe=(()=>{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(cr(s=>this.latestConfig=s),is(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)}),cr(s=>this.logOrganLookup(s)),cr(s=>this.latestOrganInfo=s),Wa(1)),this.organ$=this.organInfo$.pipe(is(s=>s?t.getOrgan(s,s.hasSex?this.latestConfig.sex:void 0):sn(void 0)),cr(s=>{var o;if(s&&this.latestOrganInfo){const a=(null===(o=this.latestOrganInfo)||void 0===o?void 0:o.hasSex)?s.sex:void 0;a!==this.latestConfig.sex&&this.updateInput("sex",a),s.side!==this.latestConfig.side&&this.updateInput("side",s.side)}}),Wa(1)),this.scene$=this.organ$.pipe(is(s=>s&&this.latestOrganInfo?t.getOrganScene(this.latestOrganInfo,s.sex):sn(IFe))),this.stats$=this.organ$.pipe(is(s=>s&&this.latestOrganInfo?t.getOrganStats(this.latestOrganInfo,s.sex):sn([]))),this.statsLabel$=this.organ$.pipe(me(s=>this.makeStatsLabel(this.latestOrganInfo,null==s?void 0:s.sex)),Oo("Loading...")),this.blocks$=this.organ$.pipe(is(s=>s&&this.latestOrganInfo?t.getBlocks(this.latestOrganInfo,s.sex):sn([])))}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,i){let r=[`Unknown IRI: ${this.latestConfig.organIri}`];if(t){const s=t.side?t.side.charAt(0).toUpperCase()+t.side.slice(1):void 0;r=[i,t.organ,s]}return r.filter(s=>!!s).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)(Ce(iFe),Ce(qb),Ce(Qm))},n.\u0275cmp=rn({type:n,selectors:[["ccf-root"]],viewQuery:function(t,i){if(1&t&&(hr(AFe,7,gn),hr(MFe,7,gn)),2&t){let r;Gn(r=$n())&&(i.left=r.first),Gn(r=$n())&&(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&&(wt(0,"div",0),wt(1,"div",1,2),wt(3,"ccf-organ",3),Tn("sexChange",function(s){return i.updateInput("sex",s)})("sideChange",function(s){return i.updateInput("side",s)}),Ps(4,"async"),Ps(5,"async"),Ps(6,"async"),Ps(7,"async"),Ps(8,"async"),Ps(9,"async"),Et(),Et(),wt(10,"div",4,5),ni(12,"ccf-stats-list",6),Ps(13,"async"),Ps(14,"async"),ni(15,"ccf-link-cards"),Et(),Et()),2&t){let r;zt(3),Jt("blocks",To(4,8,i.blocks$))("filter",To(5,10,i.filter$))("sex",To(6,12,i.sex$))("side",To(7,14,i.side$))("organ",To(8,16,i.organ$))("scene",null!==(r=To(9,18,i.scene$))&&void 0!==r?r:TE(24,DFe)),zt(9),Jt("statsLabel",To(13,20,i.statsLabel$))("stats",To(14,22,i.stats$))}},directives:[wFe,xFe,TFe],pipes:[g0],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 RFe(n,e){1&n&&ni(0,"ccf-root")}function PFe(n){const e=i=>"string"==typeof i,t=i=>Array.isArray(i)&&i.every(e);if("string"==typeof n){const i=XD.json(n);if(t(i))return i}else if(t(n))return n;throw new Error("Invalid data sources")}function NFe(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=XD.json(n);if(t(i))return i}}else if(t(n))return n;throw new Error("Invalid data sources")}let kFe=(()=>{class n extends fie{constructor(t,i){super(t,i,{initialDelay:10,initialConfig:Object.assign(Object.assign({},If.dbOptions),globalThis.dbOptions),parse:{dataSources:PFe,highlightProviders:NFe,useRemoteApi:XD.boolean}}),this.sex="Female",this.side="Left"}}return n.\u0275fac=function(t){return new(t||n)(Ce(Qm),Ce(Mr))},n.\u0275cmp=rn({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",useRemoteApi:"useRemoteApi",remoteApiEndpoint:"remoteApiEndpoint"},features:[En],decls:1,vars:1,consts:[[4,"ngIf"]],template:function(t,i){1&t&&wi(0,RFe,1,0,"ccf-root",0),2&t&&Jt("ngIf",i.initialized)},directives:[ac,OFe],encapsulation:2,changeDetection:0}),n})(),FFe=(()=>{class n extends Zke{selectToken(t){return t.useRemoteApi&&t.remoteApiEndpoint?Xke:Qke}}return n.\u0275fac=function(){let e;return function(i){return(e||(e=zi(n)))(i||n)}}(),n.\u0275prov=We({token:n,factory:n.\u0275fac,providedIn:"root"}),n})(),LFe=(()=>{class n{constructor(t,i){this.accessor=t,this.injector=i}static forRoot(t=[]){return{ngModule:n,providers:[hs,el,a7,...t]}}}return n.\u0275fac=function(t){return new(t||n)(Ie(hs,2),Ie(el,2))},n.\u0275mod=tn({type:n}),n.\u0275inj=St({}),n})();const x1=(n,e)=>((n,e)=>new Array(e+1).join("0"))(0,e-n.toString().length)+n;class jFe{constructor(e,t,i){this.action=e,this.store=t,this.logWriter=i}dispatched(e){const t=qf(this.action),i=function(n){return x1(n.getHours(),2)+":"+x1(n.getMinutes(),2)+":"+x1(n.getSeconds(),2)+"."+x1(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 UFe{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 Mq=new Ht("NGXS_LOGGER_PLUGIN_OPTIONS");let zFe=(()=>{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 UFe(this._options),this._store=this._store||this._injector.get(hu);const s=new jFe(i,this._store,this._logWriter);return s.dispatched(t),r(t,i).pipe(cr(o=>{s.completed(o)}),bc(o=>{throw s.errored(o),o}))}}return n.\u0275fac=function(t){return new(t||n)(Ie(Mq),Ie(Hn))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const Dq=new Ht("LOGGER_USER_OPTIONS");function HFe(n){return Object.assign({},{logger:console,collapsed:!1,disabled:!1,filter:()=>!0},n)}let GFe=(()=>{class n{static forRoot(t){return{ngModule:n,providers:[{provide:h5,useClass:zFe,multi:!0},{provide:Dq,useValue:t},{provide:Mq,useFactory:HFe,deps:[Dq]}]}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=tn({type:n}),n.\u0275inj=St({}),n})();const $Fe=[Qm];let WFe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=tn({type:n}),n.\u0275inj=St({imports:[[LFe.forRoot(),Yo.forRoot($Fe,{developmentMode:!If.production}),GFe.forRoot({disabled:If.production})]]}),n})(),qFe=(()=>{class n{constructor(t){if(t)throw new Error("The core module should only be imported once in the root module")}}return n.\u0275fac=function(t){return new(t||n)(Ie(n,12))},n.\u0275mod=tn({type:n}),n.\u0275inj=St({providers:[{provide:Eq,useExisting:FFe}],imports:[[CW,oRe.forRoot({gaToken:If.googleAnalyticsToken,appName:"organ-info",projectName:"ccf",developmentMode:!If.production}),pRe.forRoot(()=>new Yb({basePath:If.dbOptions.remoteApiEndpoint})),WFe]]}),n})(),YFe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=tn({type:n}),n.\u0275inj=St({imports:[[fr,mFe]]}),n})(),XFe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=tn({type:n}),n.\u0275inj=St({imports:[[fr,yke,YFe]]}),n})(),KFe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=tn({type:n}),n.\u0275inj=St({imports:[[fr,r1]]}),n})(),QFe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=tn({type:n}),n.\u0275inj=St({imports:[[fr]]}),n})(),ZFe=(()=>{class n{constructor(t){this.injector=t}ngDoBootstrap(){const t=function(n,e){const t=function(n,e){return e.get(El).resolveComponentFactory(n).inputs}(n,e.injector),i=e.strategyFactory||new aie(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 cie{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,u){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}(kFe,{injector:this.injector});customElements.define("ccf-organ-info",t)}}return n.\u0275fac=function(t){return new(t||n)(Ie(Hn))},n.\u0275mod=tn({type:n}),n.\u0275inj=St({providers:[],imports:[[WD,qFe,KFe,QFe,XFe]]}),n})();If.production&&function(){if(iB)throw new Error("Cannot enable prod mode after platform setup.");nB=!1}(),Ine().bootstrapModule(ZFe).catch(n=>console.error(n))},1052:Ut=>{function it(yt,ee,Dt,dt,Y,Se,he){try{var W=yt[Se](he),j=W.value}catch(k){return void Dt(k)}W.done?ee(j):Promise.resolve(j).then(dt,Y)}Ut.exports=function(yt){return function(){var ee=this,Dt=arguments;return new Promise(function(dt,Y){var Se=yt.apply(ee,Dt);function he(j){it(Se,dt,Y,he,W,"next",j)}function W(j){it(Se,dt,Y,he,W,"throw",j)}he(void 0)})}},Ut.exports.default=Ut.exports,Ut.exports.__esModule=!0},1948:Ut=>{Ut.exports=function(et){return et&&et.__esModule?et:{default:et}},Ut.exports.default=Ut.exports,Ut.exports.__esModule=!0},4321:Ut=>{function it(et){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(Ut.exports=it=function(ee){return typeof ee},Ut.exports.default=Ut.exports,Ut.exports.__esModule=!0):(Ut.exports=it=function(ee){return ee&&"function"==typeof Symbol&&ee.constructor===Symbol&&ee!==Symbol.prototype?"symbol":typeof ee},Ut.exports.default=Ut.exports,Ut.exports.__esModule=!0),it(et)}Ut.exports=it,Ut.exports.default=Ut.exports,Ut.exports.__esModule=!0},9082:Ut=>{function it(et){return Promise.resolve().then(()=>{var yt=new Error("Cannot find module '"+et+"'");throw yt.code="MODULE_NOT_FOUND",yt})}it.keys=()=>[],it.resolve=it,it.id=9082,Ut.exports=it},9521:()=>{},9125:()=>{},5307:()=>{}},Ut=>{Ut(Ut.s=2829)}]); \ No newline at end of file +var JFe=Object.defineProperty,e2e=Object.defineProperties,t2e=Object.getOwnPropertyDescriptors,S1=Object.getOwnPropertySymbols,Oq=Object.prototype.hasOwnProperty,Rq=Object.prototype.propertyIsEnumerable,Er=Math.pow,Pq=(Ut,it,et)=>it in Ut?JFe(Ut,it,{enumerable:!0,configurable:!0,writable:!0,value:et}):Ut[it]=et,ot=(Ut,it)=>{for(var et in it||(it={}))Oq.call(it,et)&&Pq(Ut,et,it[et]);if(S1)for(var et of S1(it))Rq.call(it,et)&&Pq(Ut,et,it[et]);return Ut},Sn=(Ut,it)=>e2e(Ut,t2e(it)),Nq=(Ut,it)=>{var et={};for(var yt in Ut)Oq.call(Ut,yt)&&it.indexOf(yt)<0&&(et[yt]=Ut[yt]);if(null!=Ut&&S1)for(var yt of S1(Ut))it.indexOf(yt)<0&&Rq.call(Ut,yt)&&(et[yt]=Ut[yt]);return et};(self.webpackChunkccf_ui=self.webpackChunkccf_ui||[]).push([[179],{1440:(Ut,it,et)=>{var yt=et(1052).default;Ut.exports=function Y(Se,he,W){function j(H,w){if(!he[H]){if(!Se[H]){if(k)return k(H,!0);var R=new Error("Cannot find module '"+H+"'");throw R.code="MODULE_NOT_FOUND",R}var T=he[H]={exports:{}};Se[H][0].call(T.exports,function(b){return j(Se[H][1][b]||b)},T,T.exports,Y,Se,he,W)}return he[H].exports}for(var k=void 0,Q=0;Q0&&G[G.length-1])&&(6===_t[0]||2===_t[0])){qe=0;continue}if(3===_t[0]&&(!G||_t[1]>G[0]&&_t[1]0?ue-4:ue;for($=0;$>16&255,O[K++]=P>>8&255,O[K++]=255&P;return 2===I&&(P=j[z.charCodeAt($)]<<2|j[z.charCodeAt($+1)]>>4,O[K++]=255&P),1===I&&(P=j[z.charCodeAt($)]<<10|j[z.charCodeAt($+1)]<<4|j[z.charCodeAt($+2)]>>2,O[K++]=P>>8&255,O[K++]=255&P),O},he.fromByteArray=function(z){for(var P,X=z.length,ue=X%3,I=[],O=16383,K=0,E=X-ue;KE?E:K+O));return 1===ue?I.push(W[(P=z[X-1])>>2]+W[P<<4&63]+"=="):2===ue&&I.push(W[(P=(z[X-2]<<8)+z[X-1])>>10]+W[P>>4&63]+W[P<<2&63]+"="),I.join("")};for(var W=[],j=[],k="undefined"!=typeof Uint8Array?Uint8Array:Array,Q="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",H=0,w=Q.length;H0)throw new Error("Invalid string. Length must be a multiple of 4");var X=z.indexOf("=");return-1===X&&(X=P),[X,X===P?0:4-X%4]}function y(z){return W[z>>18&63]+W[z>>12&63]+W[z>>6&63]+W[63&z]}function S(z,P,X){for(var I=[],O=P;O>5==6?2:I>>4==14?3:I>>3==30?4:I>>6==2?-1:-2}function T(I){var O=this.lastTotal-this.lastNeed,K=function(I,O,K){if(128!=(192&O[0]))return I.lastNeed=0,"\ufffd";if(I.lastNeed>1&&O.length>1){if(128!=(192&O[1]))return I.lastNeed=1,"\ufffd";if(I.lastNeed>2&&O.length>2&&128!=(192&O[2]))return I.lastNeed=2,"\ufffd"}}(this,I);return void 0!==K?K:this.lastNeed<=I.length?(I.copy(this.lastChar,O,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(I.copy(this.lastChar,O,0,I.length),void(this.lastNeed-=I.length))}function S(I,O){if((I.length-O)%2==0){var K=I.toString("utf16le",O);if(K){var E=K.charCodeAt(K.length-1);if(E>=55296&&E<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=I[I.length-2],this.lastChar[1]=I[I.length-1],K.slice(0,-1)}return K}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=I[I.length-1],I.toString("utf16le",O,I.length-1)}function A(I){var O=I&&I.length?this.write(I):"";return this.lastNeed?O+this.lastChar.toString("utf16le",0,this.lastTotal-this.lastNeed):O}function z(I,O){var K=(I.length-O)%3;return 0===K?I.toString("base64",O):(this.lastNeed=3-K,this.lastTotal=3,1===K?this.lastChar[0]=I[I.length-1]:(this.lastChar[0]=I[I.length-2],this.lastChar[1]=I[I.length-1]),I.toString("base64",O,I.length-K))}function P(I){var O=I&&I.length?this.write(I):"";return this.lastNeed?O+this.lastChar.toString("base64",0,3-this.lastNeed):O}function X(I){return I.toString(this.encoding)}function ue(I){return I&&I.length?this.write(I):""}he.StringDecoder=H,H.prototype.write=function(I){if(0===I.length)return"";var O,K;if(this.lastNeed){if(void 0===(O=this.fillLast(I)))return"";K=this.lastNeed,this.lastNeed=0}else K=0;return K=0?($>0&&(I.lastNeed=$-1),$):--E=0?($>0&&(I.lastNeed=$-2),$):--E=0?($>0&&(2===$?$=0:I.lastNeed=$-3),$):0}(this,I,O);if(!this.lastNeed)return I.toString("utf8",O);this.lastTotal=K;var E=I.length-(K-this.lastNeed);return I.copy(this.lastChar,0,E),I.toString("utf8",O,E)},H.prototype.fillLast=function(I){if(this.lastNeed<=I.length)return I.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);I.copy(this.lastChar,this.lastTotal-this.lastNeed,0,I.length),this.lastNeed-=I.length}},{"safe-buffer":4}],6:[function(Y,Se,he){(function(W){(function(){"use strict";var j=Y("base64-js"),k=Y("ieee754");he.Buffer=C,he.SlowBuffer=function(B){return+B!=B&&(B=0),C.alloc(+B)},he.INSPECT_MAX_BYTES=50;var Q=2147483647;function w(B){if(B>Q)throw new RangeError('The value "'+B+'" is invalid for option "size"');var N=new Uint8Array(B);return N.__proto__=C.prototype,N}function C(B,N,V){if("number"==typeof B){if("string"==typeof N)throw new TypeError('The "string" argument must be of type string. Received type number');return y(B)}return R(B,N,V)}function R(B,N,V){if("string"==typeof B)return function(B,N){if(("string"!=typeof N||""===N)&&(N="utf8"),!C.isEncoding(N))throw new TypeError("Unknown encoding: "+N);var V=0|I(B,N),Re=w(V),Ze=Re.write(B,N);return Ze!==V&&(Re=Re.slice(0,Ze)),Re}(B,N);if(ArrayBuffer.isView(B))return A(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,N,V){if(N<0||B.byteLength=Q)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Q.toString(16)+" bytes");return 0|B}function I(B,N){if(C.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 V=B.length,Re=arguments.length>2&&!0===arguments[2];if(!Re&&0===V)return 0;for(var Ze=!1;;)switch(N){case"ascii":case"latin1":case"binary":return V;case"utf8":case"utf-8":return G(B).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*V;case"hex":return V>>>1;case"base64":return je(B).length;default:if(Ze)return Re?-1:G(B).length;N=(""+N).toLowerCase(),Ze=!0}}function O(B,N,V){var Re=!1;if((void 0===N||N<0)&&(N=0),N>this.length||((void 0===V||V>this.length)&&(V=this.length),V<=0)||(V>>>=0)<=(N>>>=0))return"";for(B||(B="utf8");;)switch(B){case"hex":return tt(this,N,V);case"utf8":case"utf-8":return ye(this,N,V);case"ascii":return st(this,N,V);case"latin1":case"binary":return Qe(this,N,V);case"base64":return ne(this,N,V);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Xe(this,N,V);default:if(Re)throw new TypeError("Unknown encoding: "+B);B=(B+"").toLowerCase(),Re=!0}}function K(B,N,V){var Re=B[N];B[N]=B[V],B[V]=Re}function E(B,N,V,Re,Ze){if(0===B.length)return-1;if("string"==typeof V?(Re=V,V=0):V>2147483647?V=2147483647:V<-2147483648&&(V=-2147483648),we(V=+V)&&(V=Ze?0:B.length-1),V<0&&(V=B.length+V),V>=B.length){if(Ze)return-1;V=B.length-1}else if(V<0){if(!Ze)return-1;V=0}if("string"==typeof N&&(N=C.from(N,Re)),C.isBuffer(N))return 0===N.length?-1:$(B,N,V,Re,Ze);if("number"==typeof N)return N&=255,"function"==typeof Uint8Array.prototype.indexOf?Ze?Uint8Array.prototype.indexOf.call(B,N,V):Uint8Array.prototype.lastIndexOf.call(B,N,V):$(B,[N],V,Re,Ze);throw new TypeError("val must be string, number or Buffer")}function $(B,N,V,Re,Ze){var Yn,Tt=1,kt=B.length,In=N.length;if(void 0!==Re&&("ucs2"===(Re=String(Re).toLowerCase())||"ucs-2"===Re||"utf16le"===Re||"utf-16le"===Re)){if(B.length<2||N.length<2)return-1;Tt=2,kt/=2,In/=2,V/=2}function Nn(Ls,fs){return 1===Tt?Ls[fs]:Ls.readUInt16BE(fs*Tt)}if(Ze){var Mi=-1;for(Yn=V;Ynkt&&(V=kt-In),Yn=V;Yn>=0;Yn--){for(var xi=!0,Xr=0;XrZe&&(Re=Ze):Re=Ze;var Tt=N.length;Re>Tt/2&&(Re=Tt/2);for(var kt=0;kt>8,Tt.push(V%256),Tt.push(Re);return Tt}(N,B.length-V),B,V,Re)}function ne(B,N,V){return j.fromByteArray(0===N&&V===B.length?B:B.slice(N,V))}function ye(B,N,V){V=Math.min(B.length,V);for(var Re=[],Ze=N;Ze239?4:Tt>223?3:Tt>191?2:1;if(Ze+In<=V)switch(In){case 1:Tt<128&&(kt=Tt);break;case 2:128==(192&(Nn=B[Ze+1]))&&(xi=(31&Tt)<<6|63&Nn)>127&&(kt=xi);break;case 3:Yn=B[Ze+2],128==(192&(Nn=B[Ze+1]))&&128==(192&Yn)&&(xi=(15&Tt)<<12|(63&Nn)<<6|63&Yn)>2047&&(xi<55296||xi>57343)&&(kt=xi);break;case 4:Yn=B[Ze+2],Mi=B[Ze+3],128==(192&(Nn=B[Ze+1]))&&128==(192&Yn)&&128==(192&Mi)&&(xi=(15&Tt)<<18|(63&Nn)<<12|(63&Yn)<<6|63&Mi)>65535&&xi<1114112&&(kt=xi)}null===kt?(kt=65533,In=1):kt>65535&&(Re.push((kt-=65536)>>>10&1023|55296),kt=56320|1023&kt),Re.push(kt),Ze+=In}return function(B){var N=B.length;if(N<=4096)return String.fromCharCode.apply(String,B);for(var V="",Re=0;ReV&&(N+=" ... "),""},C.prototype.compare=function(N,V,Re,Ze,Tt){if(pt(N,Uint8Array)&&(N=C.from(N,N.offset,N.byteLength)),!C.isBuffer(N))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof N);if(void 0===V&&(V=0),void 0===Re&&(Re=N?N.length:0),void 0===Ze&&(Ze=0),void 0===Tt&&(Tt=this.length),V<0||Re>N.length||Ze<0||Tt>this.length)throw new RangeError("out of range index");if(Ze>=Tt&&V>=Re)return 0;if(Ze>=Tt)return-1;if(V>=Re)return 1;if(this===N)return 0;for(var kt=(Tt>>>=0)-(Ze>>>=0),In=(Re>>>=0)-(V>>>=0),Nn=Math.min(kt,In),Yn=this.slice(Ze,Tt),Mi=N.slice(V,Re),xi=0;xi>>=0,isFinite(Re)?(Re>>>=0,void 0===Ze&&(Ze="utf8")):(Ze=Re,Re=void 0)}var Tt=this.length-V;if((void 0===Re||Re>Tt)&&(Re=Tt),N.length>0&&(Re<0||V<0)||V>this.length)throw new RangeError("Attempt to write outside buffer bounds");Ze||(Ze="utf8");for(var kt=!1;;)switch(Ze){case"hex":return Z(this,N,V,Re);case"utf8":case"utf-8":return ae(this,N,V,Re);case"ascii":return oe(this,N,V,Re);case"latin1":case"binary":return te(this,N,V,Re);case"base64":return Te(this,N,V,Re);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return me(this,N,V,Re);default:if(kt)throw new TypeError("Unknown encoding: "+Ze);Ze=(""+Ze).toLowerCase(),kt=!0}},C.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function st(B,N,V){var Re="";V=Math.min(B.length,V);for(var Ze=N;ZeRe)&&(V=Re);for(var Ze="",Tt=N;TtV)throw new RangeError("Trying to access beyond buffer length")}function Le(B,N,V,Re,Ze,Tt){if(!C.isBuffer(B))throw new TypeError('"buffer" argument must be a Buffer instance');if(N>Ze||NB.length)throw new RangeError("Index out of range")}function Ke(B,N,V,Re,Ze,Tt){if(V+Re>B.length)throw new RangeError("Index out of range");if(V<0)throw new RangeError("Index out of range")}function Me(B,N,V,Re,Ze){return N=+N,V>>>=0,Ze||Ke(B,0,V,4),k.write(B,N,V,Re,23,4),V+4}function Ue(B,N,V,Re,Ze){return N=+N,V>>>=0,Ze||Ke(B,0,V,8),k.write(B,N,V,Re,52,8),V+8}C.prototype.slice=function(N,V){var Re=this.length;(N=~~N)<0?(N+=Re)<0&&(N=0):N>Re&&(N=Re),(V=void 0===V?Re:~~V)<0?(V+=Re)<0&&(V=0):V>Re&&(V=Re),V>>=0,V>>>=0,Re||ze(N,V,this.length);for(var Ze=this[N],Tt=1,kt=0;++kt>>=0,V>>>=0,Re||ze(N,V,this.length);for(var Ze=this[N+--V],Tt=1;V>0&&(Tt*=256);)Ze+=this[N+--V]*Tt;return Ze},C.prototype.readUInt8=function(N,V){return N>>>=0,V||ze(N,1,this.length),this[N]},C.prototype.readUInt16LE=function(N,V){return N>>>=0,V||ze(N,2,this.length),this[N]|this[N+1]<<8},C.prototype.readUInt16BE=function(N,V){return N>>>=0,V||ze(N,2,this.length),this[N]<<8|this[N+1]},C.prototype.readUInt32LE=function(N,V){return N>>>=0,V||ze(N,4,this.length),(this[N]|this[N+1]<<8|this[N+2]<<16)+16777216*this[N+3]},C.prototype.readUInt32BE=function(N,V){return N>>>=0,V||ze(N,4,this.length),16777216*this[N]+(this[N+1]<<16|this[N+2]<<8|this[N+3])},C.prototype.readIntLE=function(N,V,Re){N>>>=0,V>>>=0,Re||ze(N,V,this.length);for(var Ze=this[N],Tt=1,kt=0;++kt=(Tt*=128)&&(Ze-=Math.pow(2,8*V)),Ze},C.prototype.readIntBE=function(N,V,Re){N>>>=0,V>>>=0,Re||ze(N,V,this.length);for(var Ze=V,Tt=1,kt=this[N+--Ze];Ze>0&&(Tt*=256);)kt+=this[N+--Ze]*Tt;return kt>=(Tt*=128)&&(kt-=Math.pow(2,8*V)),kt},C.prototype.readInt8=function(N,V){return N>>>=0,V||ze(N,1,this.length),128&this[N]?-1*(255-this[N]+1):this[N]},C.prototype.readInt16LE=function(N,V){N>>>=0,V||ze(N,2,this.length);var Re=this[N]|this[N+1]<<8;return 32768&Re?4294901760|Re:Re},C.prototype.readInt16BE=function(N,V){N>>>=0,V||ze(N,2,this.length);var Re=this[N+1]|this[N]<<8;return 32768&Re?4294901760|Re:Re},C.prototype.readInt32LE=function(N,V){return N>>>=0,V||ze(N,4,this.length),this[N]|this[N+1]<<8|this[N+2]<<16|this[N+3]<<24},C.prototype.readInt32BE=function(N,V){return N>>>=0,V||ze(N,4,this.length),this[N]<<24|this[N+1]<<16|this[N+2]<<8|this[N+3]},C.prototype.readFloatLE=function(N,V){return N>>>=0,V||ze(N,4,this.length),k.read(this,N,!0,23,4)},C.prototype.readFloatBE=function(N,V){return N>>>=0,V||ze(N,4,this.length),k.read(this,N,!1,23,4)},C.prototype.readDoubleLE=function(N,V){return N>>>=0,V||ze(N,8,this.length),k.read(this,N,!0,52,8)},C.prototype.readDoubleBE=function(N,V){return N>>>=0,V||ze(N,8,this.length),k.read(this,N,!1,52,8)},C.prototype.writeUIntLE=function(N,V,Re,Ze){N=+N,V>>>=0,Re>>>=0,Ze||Le(this,N,V,Re,Math.pow(2,8*Re)-1,0);var kt=1,In=0;for(this[V]=255&N;++In>>=0,Re>>>=0,Ze||Le(this,N,V,Re,Math.pow(2,8*Re)-1,0);var kt=Re-1,In=1;for(this[V+kt]=255&N;--kt>=0&&(In*=256);)this[V+kt]=N/In&255;return V+Re},C.prototype.writeUInt8=function(N,V,Re){return N=+N,V>>>=0,Re||Le(this,N,V,1,255,0),this[V]=255&N,V+1},C.prototype.writeUInt16LE=function(N,V,Re){return N=+N,V>>>=0,Re||Le(this,N,V,2,65535,0),this[V]=255&N,this[V+1]=N>>>8,V+2},C.prototype.writeUInt16BE=function(N,V,Re){return N=+N,V>>>=0,Re||Le(this,N,V,2,65535,0),this[V]=N>>>8,this[V+1]=255&N,V+2},C.prototype.writeUInt32LE=function(N,V,Re){return N=+N,V>>>=0,Re||Le(this,N,V,4,4294967295,0),this[V+3]=N>>>24,this[V+2]=N>>>16,this[V+1]=N>>>8,this[V]=255&N,V+4},C.prototype.writeUInt32BE=function(N,V,Re){return N=+N,V>>>=0,Re||Le(this,N,V,4,4294967295,0),this[V]=N>>>24,this[V+1]=N>>>16,this[V+2]=N>>>8,this[V+3]=255&N,V+4},C.prototype.writeIntLE=function(N,V,Re,Ze){if(N=+N,V>>>=0,!Ze){var Tt=Math.pow(2,8*Re-1);Le(this,N,V,Re,Tt-1,-Tt)}var kt=0,In=1,Nn=0;for(this[V]=255&N;++kt>0)-Nn&255;return V+Re},C.prototype.writeIntBE=function(N,V,Re,Ze){if(N=+N,V>>>=0,!Ze){var Tt=Math.pow(2,8*Re-1);Le(this,N,V,Re,Tt-1,-Tt)}var kt=Re-1,In=1,Nn=0;for(this[V+kt]=255&N;--kt>=0&&(In*=256);)N<0&&0===Nn&&0!==this[V+kt+1]&&(Nn=1),this[V+kt]=(N/In>>0)-Nn&255;return V+Re},C.prototype.writeInt8=function(N,V,Re){return N=+N,V>>>=0,Re||Le(this,N,V,1,127,-128),N<0&&(N=255+N+1),this[V]=255&N,V+1},C.prototype.writeInt16LE=function(N,V,Re){return N=+N,V>>>=0,Re||Le(this,N,V,2,32767,-32768),this[V]=255&N,this[V+1]=N>>>8,V+2},C.prototype.writeInt16BE=function(N,V,Re){return N=+N,V>>>=0,Re||Le(this,N,V,2,32767,-32768),this[V]=N>>>8,this[V+1]=255&N,V+2},C.prototype.writeInt32LE=function(N,V,Re){return N=+N,V>>>=0,Re||Le(this,N,V,4,2147483647,-2147483648),this[V]=255&N,this[V+1]=N>>>8,this[V+2]=N>>>16,this[V+3]=N>>>24,V+4},C.prototype.writeInt32BE=function(N,V,Re){return N=+N,V>>>=0,Re||Le(this,N,V,4,2147483647,-2147483648),N<0&&(N=4294967295+N+1),this[V]=N>>>24,this[V+1]=N>>>16,this[V+2]=N>>>8,this[V+3]=255&N,V+4},C.prototype.writeFloatLE=function(N,V,Re){return Me(this,N,V,!0,Re)},C.prototype.writeFloatBE=function(N,V,Re){return Me(this,N,V,!1,Re)},C.prototype.writeDoubleLE=function(N,V,Re){return Ue(this,N,V,!0,Re)},C.prototype.writeDoubleBE=function(N,V,Re){return Ue(this,N,V,!1,Re)},C.prototype.copy=function(N,V,Re,Ze){if(!C.isBuffer(N))throw new TypeError("argument should be a Buffer");if(Re||(Re=0),!Ze&&0!==Ze&&(Ze=this.length),V>=N.length&&(V=N.length),V||(V=0),Ze>0&&Ze=this.length)throw new RangeError("Index out of range");if(Ze<0)throw new RangeError("sourceEnd out of bounds");Ze>this.length&&(Ze=this.length),N.length-V=0;--kt)N[kt+V]=this[kt+Re];else Uint8Array.prototype.set.call(N,this.subarray(Re,Ze),V);return Tt},C.prototype.fill=function(N,V,Re,Ze){if("string"==typeof N){if("string"==typeof V?(Ze=V,V=0,Re=this.length):"string"==typeof Re&&(Ze=Re,Re=this.length),void 0!==Ze&&"string"!=typeof Ze)throw new TypeError("encoding must be a string");if("string"==typeof Ze&&!C.isEncoding(Ze))throw new TypeError("Unknown encoding: "+Ze);if(1===N.length){var Tt=N.charCodeAt(0);("utf8"===Ze&&Tt<128||"latin1"===Ze)&&(N=Tt)}}else"number"==typeof N&&(N&=255);if(V<0||this.length>>=0,Re=void 0===Re?this.length:Re>>>0,N||(N=0),"number"==typeof N)for(kt=V;kt55295&&V<57344){if(!Ze){if(V>56319){(N-=3)>-1&&Tt.push(239,191,189);continue}if(kt+1===Re){(N-=3)>-1&&Tt.push(239,191,189);continue}Ze=V;continue}if(V<56320){(N-=3)>-1&&Tt.push(239,191,189),Ze=V;continue}V=65536+(Ze-55296<<10|V-56320)}else Ze&&(N-=3)>-1&&Tt.push(239,191,189);if(Ze=null,V<128){if((N-=1)<0)break;Tt.push(V)}else if(V<2048){if((N-=2)<0)break;Tt.push(V>>6|192,63&V|128)}else if(V<65536){if((N-=3)<0)break;Tt.push(V>>12|224,V>>6&63|128,63&V|128)}else{if(!(V<1114112))throw new Error("Invalid code point");if((N-=4)<0)break;Tt.push(V>>18|240,V>>12&63|128,V>>6&63|128,63&V|128)}}return Tt}function je(B){return j.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 _t(B,N,V,Re){for(var Ze=0;Ze=N.length||Ze>=B.length);++Ze)N[Ze+V]=B[Ze];return Ze}function pt(B,N){return B instanceof N||null!=B&&null!=B.constructor&&null!=B.constructor.name&&B.constructor.name===N.name}function we(B){return B!=B}}).call(this)}).call(this,Y("buffer").Buffer)},{"base64-js":2,buffer:6,ieee754:9}],7:[function(Y,Se,he){"use strict";Se.exports=function W(j){return null===j||"object"!=typeof j||null!=j.toJSON?JSON.stringify(j):Array.isArray(j)?"["+j.reduce((k,Q,H)=>k+(0===H?"":",")+W(void 0===Q||"symbol"==typeof Q?null:Q),"")+"]":"{"+Object.keys(j).sort().reduce((k,Q,H)=>void 0===j[Q]||"symbol"==typeof j[Q]?k:k+(0===k.length?"":",")+W(Q)+":"+W(j[Q]),"")+"}"}},{}],8:[function(Y,Se,he){"use strict";var k,W="object"==typeof Reflect?Reflect:null,j=W&&"function"==typeof W.apply?W.apply:function($,Z,ae){return Function.prototype.apply.call($,Z,ae)};k=W&&"function"==typeof W.ownKeys?W.ownKeys:Object.getOwnPropertySymbols?function($){return Object.getOwnPropertyNames($).concat(Object.getOwnPropertySymbols($))}:function($){return Object.getOwnPropertyNames($)};var H=Number.isNaN||function($){return $!=$};function w(){w.init.call(this)}Se.exports=w,Se.exports.once=function(E,$){return new Promise(function(Z,ae){function oe(Te){E.removeListener($,te),ae(Te)}function te(){"function"==typeof E.removeListener&&E.removeListener("error",oe),Z([].slice.call(arguments))}K(E,$,te,{once:!0}),"error"!==$&&function(E,$,Z){"function"==typeof E.on&&K(E,"error",$,Z)}(E,oe,{once:!0})})},w.EventEmitter=w,w.prototype._events=void 0,w.prototype._eventsCount=0,w.prototype._maxListeners=void 0;var C=10;function R(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?w.defaultMaxListeners:E._maxListeners}function b(E,$,Z,ae){var oe,te,Te;if(R(Z),void 0===(te=E._events)?(te=E._events=Object.create(null),E._eventsCount=0):(void 0!==te.newListener&&(E.emit("newListener",$,Z.listener?Z.listener:Z),te=E._events),Te=te[$]),void 0===Te)Te=te[$]=Z,++E._eventsCount;else if("function"==typeof Te?Te=te[$]=ae?[Z,Te]:[Te,Z]:ae?Te.unshift(Z):Te.push(Z),(oe=T(E))>0&&Te.length>oe&&!Te.warned){Te.warned=!0;var me=new Error("Possible EventEmitter memory leak detected. "+Te.length+" "+String($)+" listeners added. Use emitter.setMaxListeners() to increase limit");me.name="MaxListenersExceededWarning",me.emitter=E,me.type=$,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 S(E,$,Z){var ae={fired:!1,wrapFn:void 0,target:E,type:$,listener:Z},oe=y.bind(ae);return oe.listener=Z,ae.wrapFn=oe,oe}function A(E,$,Z){var ae=E._events;if(void 0===ae)return[];var oe=ae[$];return void 0===oe?[]:"function"==typeof oe?Z?[oe.listener||oe]:[oe]:Z?function(E){for(var $=new Array(E.length),Z=0;Z<$.length;++Z)$[Z]=E[Z].listener||E[Z];return $}(oe):P(oe,oe.length)}function z(E){var $=this._events;if(void 0!==$){var Z=$[E];if("function"==typeof Z)return 1;if(void 0!==Z)return Z.length}return 0}function P(E,$){for(var Z=new Array($),ae=0;ae<$;++ae)Z[ae]=E[ae];return Z}function K(E,$,Z,ae){if("function"==typeof E.on)ae.once?E.once($,Z):E.on($,Z);else{if("function"!=typeof E.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof E);E.addEventListener($,function oe(te){ae.once&&E.removeEventListener($,oe),Z(te)})}}Object.defineProperty(w,"defaultMaxListeners",{enumerable:!0,get:function(){return C},set:function(E){if("number"!=typeof E||E<0||H(E))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+E+".");C=E}}),w.init=function(){(void 0===this._events||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},w.prototype.setMaxListeners=function($){if("number"!=typeof $||$<0||H($))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+$+".");return this._maxListeners=$,this},w.prototype.getMaxListeners=function(){return T(this)},w.prototype.emit=function($){for(var Z=[],ae=1;ae0&&(Te=Z[0]),Te instanceof Error)throw Te;var me=new Error("Unhandled error."+(Te?" ("+Te.message+")":""));throw me.context=Te,me}var ne=te[$];if(void 0===ne)return!1;if("function"==typeof ne)j(ne,this,Z);else{var ye=ne.length,Oe=P(ne,ye);for(ae=0;ae=0;Te--)if(ae[Te]===Z||ae[Te].listener===Z){me=ae[Te].listener,te=Te;break}if(te<0)return this;0===te?ae.shift():function(E,$){for(;$+1=0;oe--)this.removeListener($,Z[oe]);return this},w.prototype.listeners=function($){return A(this,$,!0)},w.prototype.rawListeners=function($){return A(this,$,!1)},w.listenerCount=function(E,$){return"function"==typeof E.listenerCount?E.listenerCount($):z.call(E,$)},w.prototype.listenerCount=z,w.prototype.eventNames=function(){return this._eventsCount>0?k(this._events):[]}},{}],9:[function(Y,Se,he){he.read=function(W,j,k,Q,H){var w,C,R=8*H-Q-1,T=(1<>1,y=-7,S=k?H-1:0,A=k?-1:1,z=W[j+S];for(S+=A,w=z&(1<<-y)-1,z>>=-y,y+=R;y>0;w=256*w+W[j+S],S+=A,y-=8);for(C=w&(1<<-y)-1,w>>=-y,y+=Q;y>0;C=256*C+W[j+S],S+=A,y-=8);if(0===w)w=1-b;else{if(w===T)return C?NaN:1/0*(z?-1:1);C+=Math.pow(2,Q),w-=b}return(z?-1:1)*C*Math.pow(2,w-Q)},he.write=function(W,j,k,Q,H,w){var C,R,T,b=8*w-H-1,y=(1<>1,A=23===H?Math.pow(2,-24)-Math.pow(2,-77):0,z=Q?0:w-1,P=Q?1:-1,X=j<0||0===j&&1/j<0?1:0;for(j=Math.abs(j),isNaN(j)||j===1/0?(R=isNaN(j)?1:0,C=y):(C=Math.floor(Math.log(j)/Math.LN2),j*(T=Math.pow(2,-C))<1&&(C--,T*=2),(j+=C+S>=1?A/T:A*Math.pow(2,1-S))*T>=2&&(C++,T/=2),C+S>=y?(R=0,C=y):C+S>=1?(R=(j*T-1)*Math.pow(2,H),C+=S):(R=j*Math.pow(2,S-1)*Math.pow(2,H),C=0));H>=8;W[k+z]=255&R,z+=P,R/=256,H-=8);for(C=C<0;W[k+z]=255&C,z+=P,C/=256,b-=8);W[k+z-P]|=128*X}},{}],10:[function(Y,Se,he){Se.exports="function"==typeof Object.create?function(j,k){k&&(j.super_=k,j.prototype=Object.create(k.prototype,{constructor:{value:j,enumerable:!1,writable:!0,configurable:!0}}))}:function(j,k){if(k){j.super_=k;var Q=function(){};Q.prototype=k.prototype,j.prototype=new Q,j.prototype.constructor=j}}},{}],11:[function(Y,Se,he){"use strict";const{isArray:W,isObject:j,isString:k}=Y("./types"),{asArray:Q}=Y("./util"),{prependBase:H}=Y("./url"),w=Y("./JsonLdError"),C=Y("./ResolvedContext");function T(y){throw new w("Invalid JSON-LD syntax; @context must be an object.","jsonld.SyntaxError",{code:"invalid local context",context:y})}function b({context:y,base:S}){if(!y)return;const A=y["@context"];if(k(A))y["@context"]=H(S,A);else if(W(A))for(let z=0;z10)throw new w("Maximum number of @context URLs exceeded.","jsonld.ContextUrlError",{code:"json-ld-1.0"===S.processingMode?"loading remote context failed":"context overflow",max:10});if(P.has(A))throw new w("Cyclical @context URLs detected.","jsonld.ContextUrlError",{code:"json-ld-1.0"===S.processingMode?"recursive context inclusion":"context overflow",url:A});let X,ue;P.add(A);try{ue=yield z(A),X=ue.document||null,k(X)&&(X=JSON.parse(X))}catch(I){throw new w("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:A,cause:I})}if(!j(X))throw new w("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:A});return X="@context"in X?{"@context":X["@context"]}:{"@context":{}},ue.contextUrl&&(W(X["@context"])||(X["@context"]=[X["@context"]]),X["@context"].push(ue.contextUrl)),{context:X,remoteDoc:ue}})()}}},{"./JsonLdError":12,"./ResolvedContext":16,"./types":30,"./url":31,"./util":32}],12:[function(Y,Se,he){"use strict";Se.exports=class extends Error{constructor(j="An unspecified JSON-LD error occurred.",k="jsonld.Error",Q={}){super(j),this.name=k,this.message=j,this.details=Q}}},{}],13:[function(Y,Se,he){"use strict";Se.exports=W=>{class j{toString(){return"[object JsonLdProcessor]"}}return Object.defineProperty(j,"prototype",{writable:!1,enumerable:!1}),Object.defineProperty(j.prototype,"constructor",{writable:!0,enumerable:!1,configurable:!0,value:j}),j.compact=function(k,Q){return arguments.length<2?Promise.reject(new TypeError("Could not compact, too few arguments.")):W.compact(k,Q)},j.expand=function(k){return arguments.length<1?Promise.reject(new TypeError("Could not expand, too few arguments.")):W.expand(k)},j.flatten=function(k){return arguments.length<1?Promise.reject(new TypeError("Could not flatten, too few arguments.")):W.flatten(k)},j}},{}],14:[function(Y,Se,he){"use strict";Se.exports=Y("rdf-canonize").NQuads},{"rdf-canonize":46}],15:[function(Y,Se,he){"use strict";Se.exports=class{constructor(){this._requests={}}wrapLoader(j){const k=this;return k._loader=j,function(){return k.add.apply(k,arguments)}}add(j){var k=this;return yt(function*(){let Q=k._requests[j];if(Q)return Promise.resolve(Q);Q=k._requests[j]=k._loader(j);try{return yield Q}finally{delete k._requests[j]}})()}}},{}],16:[function(Y,Se,he){"use strict";const W=Y("lru-cache");Se.exports=class{constructor({document:Q}){this.document=Q,this.cache=new W({max:10})}getProcessed(Q){return this.cache.get(Q)}setProcessed(Q,H){this.cache.set(Q,H)}}},{"lru-cache":33}],17:[function(Y,Se,he){"use strict";const W=Y("./JsonLdError"),{isArray:j,isObject:k,isString:Q,isUndefined:H}=Y("./types"),{isList:w,isValue:C,isGraph:R,isSimpleGraph:T,isSubjectReference:b}=Y("./graphTypes"),{expandIri:y,getContextValue:S,isKeyword:A,process:z,processingMode:P}=Y("./context"),{removeBase:X,prependBase:ue}=Y("./url"),{addValue:I,asArray:O,compareShortestLeast:K}=Y("./util"),E={};function Z(ae,oe,te){if("@nest"!==y(ae,oe,{vocab:!0},te))throw new W("JSON-LD compact error; nested property must have an @nest value resolving to @nest.","jsonld.SyntaxError",{code:"invalid @nest value"})}Se.exports=E,E.compact=function(){var ae=yt(function*({activeCtx:oe,activeProperty:te=null,element:Te,options:me={},compactionMap:ne=(()=>{})}){if(j(Te)){let Oe=[];for(let $e=0;$e1&&(tt=Array.from(tt).sort());const Xe=oe;for(const Le of tt){const Ke=E.compactIri({activeCtx:Xe,iri:Le,relativeTo:{vocab:!0}}),Me=S(st,Ke,"@context");H(Me)||(oe=yield z({activeCtx:oe,localCtx:Me,options:me,propagate:!1}))}const ze=Object.keys(Te).sort();for(const Le of ze){const Ke=Te[Le];if("@id"!==Le)if("@type"!==Le)if("@reverse"!==Le)if("@preserve"!==Le)if("@index"!==Le)if("@graph"!==Le&&"@list"!==Le&&"@included"!==Le&&A(Le)){const Me=E.compactIri({activeCtx:oe,iri:Le,relativeTo:{vocab:!0}});I($e,Me,Ke)}else{if(!j(Ke))throw new W("JSON-LD expansion error; expanded value must be an array.","jsonld.SyntaxError");if(0===Ke.length){const Me=E.compactIri({activeCtx:oe,iri:Le,value:Ke,relativeTo:{vocab:!0},reverse:Oe}),Ue=oe.mappings.has(Me)?oe.mappings.get(Me)["@nest"]:null;let qe=$e;Ue&&(Z(oe,Ue,me),k($e[Ue])||($e[Ue]={}),qe=$e[Ue]),I(qe,Me,Ke,{propertyIsArray:!0})}for(const Me of Ke){const Ue=E.compactIri({activeCtx:oe,iri:Le,value:Me,relativeTo:{vocab:!0},reverse:Oe}),qe=oe.mappings.has(Ue)?oe.mappings.get(Ue)["@nest"]:null;let ke=$e;qe&&(Z(oe,qe,me),k($e[qe])||($e[qe]={}),ke=$e[qe]);const q=S(oe,Ue,"@container")||[],G=R(Me),pe=w(Me);let de;pe?de=Me["@list"]:G&&(de=Me["@graph"]);let je=yield E.compact({activeCtx:oe,activeProperty:Ue,element:pe||G?de:Me,options:me,compactionMap:ne});if(pe){if(j(je)||(je=[je]),q.includes("@list")){I(ke,Ue,je,{valueIsArray:!0,allowDuplicate:!0});continue}je={[E.compactIri({activeCtx:oe,iri:"@list",relativeTo:{vocab:!0}})]:je},"@index"in Me&&(je[E.compactIri({activeCtx:oe,iri:"@index",relativeTo:{vocab:!0}})]=Me["@index"])}if(G)if(q.includes("@graph")&&(q.includes("@id")||q.includes("@index")&&T(Me))){let _t;ke.hasOwnProperty(Ue)?_t=ke[Ue]:ke[Ue]=_t={};const pt=(q.includes("@id")?Me["@id"]:Me["@index"])||E.compactIri({activeCtx:oe,iri:"@none",relativeTo:{vocab:!0}});I(_t,pt,je,{propertyIsArray:!me.compactArrays||q.includes("@set")})}else q.includes("@graph")&&T(Me)?(j(je)&&je.length>1&&(je={"@included":je}),I(ke,Ue,je,{propertyIsArray:!me.compactArrays||q.includes("@set")})):(j(je)&&1===je.length&&me.compactArrays&&(je=je[0]),je={[E.compactIri({activeCtx:oe,iri:"@graph",relativeTo:{vocab:!0}})]:je},"@id"in Me&&(je[E.compactIri({activeCtx:oe,iri:"@id",relativeTo:{vocab:!0}})]=Me["@id"]),"@index"in Me&&(je[E.compactIri({activeCtx:oe,iri:"@index",relativeTo:{vocab:!0}})]=Me["@index"]),I(ke,Ue,je,{propertyIsArray:!me.compactArrays||q.includes("@set")}));else if(q.includes("@language")||q.includes("@index")||q.includes("@id")||q.includes("@type")){let _t,pt;if(ke.hasOwnProperty(Ue)?_t=ke[Ue]:ke[Ue]=_t={},q.includes("@language"))C(je)&&(je=je["@value"]),pt=Me["@language"];else if(q.includes("@index")){const we=S(oe,Ue,"@index")||"@index",B=E.compactIri({activeCtx:oe,iri:we,relativeTo:{vocab:!0}});if("@index"===we)pt=Me["@index"],delete je[B];else{let N;if([pt,...N]=O(je[we]||[]),Q(pt))switch(N.length){case 0:delete je[we];break;case 1:je[we]=N[0];break;default:je[we]=N}else pt=null}}else if(q.includes("@id")){const we=E.compactIri({activeCtx:oe,iri:"@id",relativeTo:{vocab:!0}});pt=je[we],delete je[we]}else if(q.includes("@type")){const we=E.compactIri({activeCtx:oe,iri:"@type",relativeTo:{vocab:!0}});let B;switch([pt,...B]=O(je[we]||[]),B.length){case 0:delete je[we];break;case 1:je[we]=B[0];break;default:je[we]=B}1===Object.keys(je).length&&"@id"in Me&&(je=yield E.compact({activeCtx:oe,activeProperty:Ue,element:{"@id":Me["@id"]},options:me,compactionMap:ne}))}pt||(pt=E.compactIri({activeCtx:oe,iri:"@none",relativeTo:{vocab:!0}})),I(_t,pt,je,{propertyIsArray:q.includes("@set")})}else{const _t=!me.compactArrays||q.includes("@set")||q.includes("@list")||j(je)&&0===je.length||"@list"===Le||"@graph"===Le;I(ke,Ue,je,{propertyIsArray:_t})}}}else{if((S(oe,te,"@container")||[]).includes("@index"))continue;const Ue=E.compactIri({activeCtx:oe,iri:Le,relativeTo:{vocab:!0}});I($e,Ue,Ke)}else{const Me=yield E.compact({activeCtx:oe,activeProperty:te,element:Ke,options:me,compactionMap:ne});j(Me)&&0===Me.length||I($e,Le,Me)}else{const Me=yield E.compact({activeCtx:oe,activeProperty:"@reverse",element:Ke,options:me,compactionMap:ne});for(const Ue in Me)if(oe.mappings.has(Ue)&&oe.mappings.get(Ue).reverse){const qe=Me[Ue],q=(S(oe,Ue,"@container")||[]).includes("@set")||!me.compactArrays;I($e,Ue,qe,{propertyIsArray:q}),delete Me[Ue]}if(Object.keys(Me).length>0){const Ue=E.compactIri({activeCtx:oe,iri:Le,relativeTo:{vocab:!0}});I($e,Ue,Me)}}else{let Me=O(Ke).map(G=>E.compactIri({activeCtx:st,iri:G,relativeTo:{vocab:!0}}));1===Me.length&&(Me=Me[0]);const Ue=E.compactIri({activeCtx:oe,iri:"@type",relativeTo:{vocab:!0}}),q=(S(oe,Ue,"@container")||[]).includes("@set")&&P(oe,1.1)||j(Me)&&0===Ke.length;I($e,Ue,Me,{propertyIsArray:q})}else{let Me=O(Ke).map(qe=>E.compactIri({activeCtx:oe,iri:qe,relativeTo:{vocab:!1},base:me.base}));1===Me.length&&(Me=Me[0]),$e[E.compactIri({activeCtx:oe,iri:"@id",relativeTo:{vocab:!0}})]=Me}}return $e}return Te});return function(oe){return ae.apply(this,arguments)}}(),E.compactIri=({activeCtx:ae,iri:oe,value:te=null,relativeTo:Te={vocab:!1},reverse:me=!1,base:ne=null})=>{if(null===oe)return oe;ae.isPropertyTermScoped&&ae.previousContext&&(ae=ae.previousContext);const ye=ae.getInverse();if(A(oe)&&oe in ye&&"@none"in ye[oe]&&"@type"in ye[oe]["@none"]&&"@none"in ye[oe]["@none"]["@type"])return ye[oe]["@none"]["@type"]["@none"];if(Te.vocab&&oe in ye){const tt=ae["@language"]||"@none",Xe=[];k(te)&&"@index"in te&&!("@graph"in te)&&Xe.push("@index","@index@set"),k(te)&&"@preserve"in te&&(te=te["@preserve"][0]),R(te)?("@index"in te&&Xe.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in te&&Xe.push("@graph@id","@graph@id@set"),Xe.push("@graph","@graph@set","@set"),"@index"in te||Xe.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in te||Xe.push("@graph@id","@graph@id@set")):k(te)&&!C(te)&&Xe.push("@id","@id@set","@type","@set@type");let ze="@language",Le="@null";if(me)ze="@type",Le="@reverse",Xe.push("@set");else if(w(te)){"@index"in te||Xe.push("@list");const Me=te["@list"];if(0===Me.length)ze="@any",Le="@none";else{let Ue=0===Me.length?tt:null,qe=null;for(let ke=0;kest.includes("_"));$e&&ye.push($e.replace(/^[^_]+_/,"_"))}ye.push("@none");const Oe=ae.inverse[oe];for(const $e of Te){if(!($e in Oe))continue;const st=Oe[$e][me];for(const Qe of ye)if(Qe in st)return st[Qe]}return null}(ae,oe,te,Xe,ze,Le);if(null!==Ke)return Ke}if(Te.vocab&&"@vocab"in ae){const tt=ae["@vocab"];if(0===oe.indexOf(tt)&&oe!==tt){const Xe=oe.substr(tt.length);if(!ae.mappings.has(Xe))return Xe}}let Oe=null;const $e=[];let st=ae.fastCurieMap;const Qe=oe.length-1;for(let tt=0;tt=0;--tt){const Xe=$e[tt],ze=Xe.terms;for(const Le of ze){const Ke=Le+":"+oe.substr(Xe.iri.length);ae.mappings.get(Le)._prefix&&(!ae.mappings.has(Ke)||null===te&&ae.mappings.get(Ke)["@id"]===oe)&&(null===Oe||K(Ke,Oe)<0)&&(Oe=Ke)}}if(null!==Oe)return Oe;for(const[tt,Xe]of ae.mappings)if(Xe&&Xe._prefix&&oe.startsWith(tt+":"))throw new W(`Absolute IRI "${oe}" confused with prefix "${tt}".`,"jsonld.SyntaxError",{code:"IRI confused with prefix",context:ae});return Te.vocab?oe:"@base"in ae?ae["@base"]?X(ue(ne,ae["@base"]),oe):oe:X(ne,oe)},E.compactValue=({activeCtx:ae,activeProperty:oe,value:te,options:Te})=>{if(C(te)){const Oe=S(ae,oe,"@type"),$e=S(ae,oe,"@language"),st=S(ae,oe,"@direction"),Qe=S(ae,oe,"@container")||[],tt="@index"in te&&!Qe.includes("@index");if(!tt&&"@none"!==Oe&&(te["@type"]===Oe||"@language"in te&&te["@language"]===$e&&"@direction"in te&&te["@direction"]===st||"@language"in te&&te["@language"]===$e||"@direction"in te&&te["@direction"]===st))return te["@value"];const Xe=Object.keys(te).length,ze=1===Xe||2===Xe&&"@index"in te&&!tt,Le="@language"in ae,Ke=Q(te["@value"]),Me=ae.mappings.has(oe)&&null===ae.mappings.get(oe)["@language"];if(ze&&"@none"!==Oe&&(!Le||!Ke||Me))return te["@value"];const Ue={};return tt&&(Ue[E.compactIri({activeCtx:ae,iri:"@index",relativeTo:{vocab:!0}})]=te["@index"]),"@type"in te?Ue[E.compactIri({activeCtx:ae,iri:"@type",relativeTo:{vocab:!0}})]=E.compactIri({activeCtx:ae,iri:te["@type"],relativeTo:{vocab:!0}}):"@language"in te&&(Ue[E.compactIri({activeCtx:ae,iri:"@language",relativeTo:{vocab:!0}})]=te["@language"]),"@direction"in te&&(Ue[E.compactIri({activeCtx:ae,iri:"@direction",relativeTo:{vocab:!0}})]=te["@direction"]),Ue[E.compactIri({activeCtx:ae,iri:"@value",relativeTo:{vocab:!0}})]=te["@value"],Ue}const me=y(ae,oe,{vocab:!0},Te),ne=S(ae,oe,"@type"),ye=E.compactIri({activeCtx:ae,iri:te["@id"],relativeTo:{vocab:"@vocab"===ne},base:Te.base});return"@id"===ne||"@vocab"===ne||"@graph"===me?ye:{[E.compactIri({activeCtx:ae,iri:"@id",relativeTo:{vocab:!0}})]:ye}}},{"./JsonLdError":12,"./context":19,"./graphTypes":25,"./types":30,"./url":31,"./util":32}],18:[function(Y,Se,he){"use strict";const W="http://www.w3.org/1999/02/22-rdf-syntax-ns#",j="http://www.w3.org/2001/XMLSchema#";Se.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:j,XSD_BOOLEAN:j+"boolean",XSD_DOUBLE:j+"double",XSD_INTEGER:j+"integer",XSD_STRING:j+"string"}},{}],19:[function(Y,Se,he){"use strict";const W=Y("./util"),j=Y("./JsonLdError"),{isArray:k,isObject:Q,isString:H,isUndefined:w}=Y("./types"),{isAbsolute:C,isRelative:R,prependBase:T}=Y("./url"),{asArray:b,compareShortestLeast:y}=Y("./util"),S=new Map,z=/^@[a-zA-Z]+$/,P={};function X(I,O,K,E,$,Z){if(null===O||!H(O)||P.isKeyword(O))return O;if(O.match(z))return null;if(E&&E.hasOwnProperty(O)&&!0!==$.get(O)&&P.createTermDefinition({activeCtx:I,localCtx:E,term:O,defined:$,options:Z}),(K=K||{}).vocab){const oe=I.mappings.get(O);if(null===oe)return null;if(Q(oe)&&"@id"in oe)return oe["@id"]}const ae=O.indexOf(":");if(ae>0){const oe=O.substr(0,ae),te=O.substr(ae+1);if("_"===oe||0===te.indexOf("//"))return O;E&&E.hasOwnProperty(oe)&&P.createTermDefinition({activeCtx:I,localCtx:E,term:oe,defined:$,options:Z});const Te=I.mappings.get(oe);if(Te&&Te._prefix)return Te["@id"]+te;if(C(O))return O}if(K.vocab&&"@vocab"in I)return I["@vocab"]+O;if(K.base&&"@base"in I){if(I["@base"])return T(T(Z.base,I["@base"]),O)}else if(K.base)return T(Z.base,O);return O}function ue(I,O){if(!I||"object"!=typeof I||!O||"object"!=typeof O)return I===O;const K=Array.isArray(I);if(K!==Array.isArray(O))return!1;if(K){if(I.length!==O.length)return!1;for(let Z=0;Z{if(E.has(K)){if(E.get(K))return;throw new j("Cyclical context definition detected.","jsonld.CyclicalContext",{code:"cyclic IRI mapping",context:O,term:K})}let ae;if(E.set(K,!1),O.hasOwnProperty(K)&&(ae=O[K]),"@type"===K&&Q(ae)&&"@set"===(ae["@container"]||"@set")&&P.processingMode(I,1.1)){const Oe=["@container","@id","@protected"],$e=Object.keys(ae);if(0===$e.length||$e.some(st=>!Oe.includes(st)))throw new j("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:O,term:K})}else{if(P.isKeyword(K))throw new j("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:O,term:K});if(K.match(z))return void console.warn('WARNING: terms beginning with "@" are reserved for future use and ignored',{term:K});if(""===K)throw new j("Invalid JSON-LD syntax; a term cannot be an empty string.","jsonld.SyntaxError",{code:"invalid term definition",context:O})}const oe=I.mappings.get(K);I.mappings.has(K)&&I.mappings.delete(K);let te=!1;if((H(ae)||null===ae)&&(te=!0,ae={"@id":ae}),!Q(ae))throw new j("Invalid JSON-LD syntax; @context term values must be strings or objects.","jsonld.SyntaxError",{code:"invalid term definition",context:O});const Te={};I.mappings.set(K,Te),Te.reverse=!1;const me=["@container","@id","@language","@reverse","@type"];P.processingMode(I,1.1)&&me.push("@context","@direction","@index","@nest","@prefix","@protected");for(const Oe in ae)if(!me.includes(Oe))throw new j("Invalid JSON-LD syntax; a term definition must not contain "+Oe,"jsonld.SyntaxError",{code:"invalid term definition",context:O});const ne=K.indexOf(":");if(Te._termHasColon=ne>0,"@reverse"in ae){if("@id"in ae)throw new j("Invalid JSON-LD syntax; a @reverse term definition must not contain @id.","jsonld.SyntaxError",{code:"invalid reverse property",context:O});if("@nest"in ae)throw new j("Invalid JSON-LD syntax; a @reverse term definition must not contain @nest.","jsonld.SyntaxError",{code:"invalid reverse property",context:O});const Oe=ae["@reverse"];if(!H(Oe))throw new j("Invalid JSON-LD syntax; a @context @reverse value must be a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:O});if(!P.isKeyword(Oe)&&Oe.match(z))return console.warn('WARNING: values beginning with "@" are reserved for future use and ignored',{reverse:Oe}),void(oe?I.mappings.set(K,oe):I.mappings.delete(K));const $e=X(I,Oe,{vocab:!0,base:!1},O,E,$);if(!C($e))throw new j("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:O});Te["@id"]=$e,Te.reverse=!0}else if("@id"in ae){let Oe=ae["@id"];if(Oe&&!H(Oe))throw new j("Invalid JSON-LD syntax; a @context @id value must be an array of strings or a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:O});if(null===Oe)Te["@id"]=null;else{if(!P.isKeyword(Oe)&&Oe.match(z))return console.warn('WARNING: values beginning with "@" are reserved for future use and ignored',{id:Oe}),void(oe?I.mappings.set(K,oe):I.mappings.delete(K));if(Oe!==K){if(Oe=X(I,Oe,{vocab:!0,base:!1},O,E,$),!C(Oe)&&!P.isKeyword(Oe))throw new j("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:O});if(K.match(/(?::[^:])|\//)&&X(I,K,{vocab:!0,base:!1},O,new Map(E).set(K,!0),$)!==Oe)throw new j("Invalid JSON-LD syntax; term in form of IRI must expand to definition.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:O});Te["@id"]=Oe,Te._prefix=te&&!Te._termHasColon&&Oe.match(/[:\/\?#\[\]@]$/)}}}if(!("@id"in Te))if(Te._termHasColon){const Oe=K.substr(0,ne);if(O.hasOwnProperty(Oe)&&P.createTermDefinition({activeCtx:I,localCtx:O,term:Oe,defined:E,options:$}),I.mappings.has(Oe)){const $e=K.substr(ne+1);Te["@id"]=I.mappings.get(Oe)["@id"]+$e}else Te["@id"]=K}else if("@type"===K)Te["@id"]=K;else{if(!("@vocab"in I))throw new j("Invalid JSON-LD syntax; @context terms must define an @id.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:O,term:K});Te["@id"]=I["@vocab"]+K}if((!0===ae["@protected"]||!0===E.get("@protected")&&!1!==ae["@protected"])&&(I.protected[K]=!0,Te.protected=!0),E.set(K,!0),"@type"in ae){let Oe=ae["@type"];if(!H(Oe))throw new j("Invalid JSON-LD syntax; an @context @type value must be a string.","jsonld.SyntaxError",{code:"invalid type mapping",context:O});if("@json"===Oe||"@none"===Oe){if(P.processingMode(I,1))throw new j(`Invalid JSON-LD syntax; an @context @type value must not be "${Oe}" in JSON-LD 1.0 mode.`,"jsonld.SyntaxError",{code:"invalid type mapping",context:O})}else if("@id"!==Oe&&"@vocab"!==Oe){if(Oe=X(I,Oe,{vocab:!0,base:!1},O,E,$),!C(Oe))throw new j("Invalid JSON-LD syntax; an @context @type value must be an absolute IRI.","jsonld.SyntaxError",{code:"invalid type mapping",context:O});if(0===Oe.indexOf("_:"))throw new j("Invalid JSON-LD syntax; an @context @type value must be an IRI, not a blank node identifier.","jsonld.SyntaxError",{code:"invalid type mapping",context:O})}Te["@type"]=Oe}if("@container"in ae){const Oe=H(ae["@container"])?[ae["@container"]]:ae["@container"]||[],$e=["@list","@set","@index","@language"];let st=!0;const Qe=Oe.includes("@set");if(P.processingMode(I,1.1)){if($e.push("@graph","@id","@type"),Oe.includes("@list")){if(1!==Oe.length)throw new j("Invalid JSON-LD syntax; @context @container with @list must have no other values","jsonld.SyntaxError",{code:"invalid container mapping",context:O})}else if(Oe.includes("@graph")){if(Oe.some(tt=>"@graph"!==tt&&"@id"!==tt&&"@index"!==tt&&"@set"!==tt))throw new j("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:O})}else st&=Oe.length<=(Qe?2:1);if(Oe.includes("@type")&&(Te["@type"]=Te["@type"]||"@id",!["@id","@vocab"].includes(Te["@type"])))throw new j("Invalid JSON-LD syntax; container: @type requires @type to be @id or @vocab.","jsonld.SyntaxError",{code:"invalid type mapping",context:O})}else st&=!k(ae["@container"]),st&=Oe.length<=1;if(st&=Oe.every(tt=>$e.includes(tt)),st&=!(Qe&&Oe.includes("@list")),!st)throw new j("Invalid JSON-LD syntax; @context @container value must be one of the following: "+$e.join(", "),"jsonld.SyntaxError",{code:"invalid container mapping",context:O});if(Te.reverse&&!Oe.every(tt=>["@index","@set"].includes(tt)))throw new j("Invalid JSON-LD syntax; @context @container value for a @reverse type definition must be @index or @set.","jsonld.SyntaxError",{code:"invalid reverse property",context:O});Te["@container"]=Oe}if("@index"in ae){if(!("@container"in ae)||!Te["@container"].includes("@index"))throw new j(`Invalid JSON-LD syntax; @index without @index in @container: "${ae["@index"]}" on term "${K}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:O});if(!H(ae["@index"])||0===ae["@index"].indexOf("@"))throw new j(`Invalid JSON-LD syntax; @index must expand to an IRI: "${ae["@index"]}" on term "${K}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:O});Te["@index"]=ae["@index"]}if("@context"in ae&&(Te["@context"]=ae["@context"]),"@language"in ae&&!("@type"in ae)){let Oe=ae["@language"];if(null!==Oe&&!H(Oe))throw new j("Invalid JSON-LD syntax; @context @language value must be a string or null.","jsonld.SyntaxError",{code:"invalid language mapping",context:O});null!==Oe&&(Oe=Oe.toLowerCase()),Te["@language"]=Oe}if("@prefix"in ae){if(K.match(/:|\//))throw new j("Invalid JSON-LD syntax; @context @prefix used on a compact IRI term","jsonld.SyntaxError",{code:"invalid term definition",context:O});if(P.isKeyword(Te["@id"]))throw new j("Invalid JSON-LD syntax; keywords may not be used as prefixes","jsonld.SyntaxError",{code:"invalid term definition",context:O});if("boolean"!=typeof ae["@prefix"])throw new j("Invalid JSON-LD syntax; @context value for @prefix must be boolean","jsonld.SyntaxError",{code:"invalid @prefix value",context:O});Te._prefix=!0===ae["@prefix"]}if("@direction"in ae){const Oe=ae["@direction"];if(null!==Oe&&"ltr"!==Oe&&"rtl"!==Oe)throw new j('Invalid JSON-LD syntax; @direction value must be null, "ltr", or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",context:O});Te["@direction"]=Oe}if("@nest"in ae){const Oe=ae["@nest"];if(!H(Oe)||"@nest"!==Oe&&0===Oe.indexOf("@"))throw new j("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:O});Te["@nest"]=Oe}const ye=Te["@id"];if("@context"===ye||"@preserve"===ye)throw new j("Invalid JSON-LD syntax; @context and @preserve cannot be aliased.","jsonld.SyntaxError",{code:"invalid keyword alias",context:O});if(oe&&oe.protected&&!Z&&(I.protected[K]=!0,Te.protected=!0,!ue(oe,Te))){const Oe=$&&$.protectedMode||"error";if("error"===Oe)throw new j(`Invalid JSON-LD syntax; tried to redefine "${K}" which is a protected term.`,"jsonld.SyntaxError",{code:"protected term redefinition",context:O,term:K});if("warn"===Oe)return void console.warn("WARNING: protected term redefinition",{term:K});throw new j("Invalid protectedMode.","jsonld.SyntaxError",{code:"invalid protected mode",context:O,term:K,protectedMode:Oe})}},P.expandIri=(I,O,K,E)=>X(I,O,K,void 0,void 0,E),P.getInitialContext=I=>{const O=JSON.stringify({processingMode:I.processingMode}),K=S.get(O);if(K)return K;const E={processingMode:I.processingMode,mappings:new Map,inverse:null,getInverse:function(){const Te=this;if(Te.inverse)return Te.inverse;const me=Te.inverse={},ne=Te.fastCurieMap={},ye={},Oe=(Te["@language"]||"@none").toLowerCase(),$e=Te["@direction"],st=Te.mappings,Qe=[...st.keys()].sort(y);for(const tt of Qe){const Xe=st.get(tt);if(null===Xe)continue;let ze=Xe["@container"]||"@none";if(ze=[].concat(ze).sort().join(""),null===Xe["@id"])continue;const Le=b(Xe["@id"]);for(const Ke of Le){let Me=me[Ke];const Ue=P.isKeyword(Ke);if(Me)!Ue&&!Xe._termHasColon&&ye[Ke].push(tt);else if(me[Ke]=Me={},!Ue&&!Xe._termHasColon){ye[Ke]=[tt];const qe={iri:Ke,terms:ye[Ke]};Ke[0]in ne?ne[Ke[0]].push(qe):ne[Ke[0]]=[qe]}if(Me[ze]||(Me[ze]={"@language":{},"@type":{},"@any":{}}),Me=Me[ze],ae(tt,Me["@any"],"@none"),Xe.reverse)ae(tt,Me["@type"],"@reverse");else if("@none"===Xe["@type"])ae(tt,Me["@any"],"@none"),ae(tt,Me["@language"],"@none"),ae(tt,Me["@type"],"@none");else if("@type"in Xe)ae(tt,Me["@type"],Xe["@type"]);else if("@language"in Xe&&"@direction"in Xe){const qe=Xe["@language"],ke=Xe["@direction"];ae(tt,Me["@language"],qe&&ke?`${qe}_${ke}`.toLowerCase():qe?qe.toLowerCase():ke?`_${ke}`:"@null")}else"@language"in Xe?ae(tt,Me["@language"],(Xe["@language"]||"@null").toLowerCase()):"@direction"in Xe?ae(tt,Me["@language"],Xe["@direction"]?`_${Xe["@direction"]}`:"@none"):$e?(ae(tt,Me["@language"],`_${$e}`),ae(tt,Me["@language"],"@none"),ae(tt,Me["@type"],"@none")):(ae(tt,Me["@language"],Oe),ae(tt,Me["@language"],"@none"),ae(tt,Me["@type"],"@none"))}}for(const tt in ne)Z(ne,tt,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===S.size&&S.clear(),S.set(O,E),E;function Z(Te,me,ne){const ye=Te[me],Oe=Te[me]={};let $e,st;for(const Qe of ye)$e=Qe.iri,st=ne>=$e.length?"":$e[ne],st in Oe?Oe[st].push(Qe):Oe[st]=[Qe];for(const Qe in Oe)""!==Qe&&Z(Oe,Qe,ne+1)}function ae(Te,me,ne){me.hasOwnProperty(ne)||(me[ne]=Te)}},P.getContextValue=(I,O,K)=>{if(null===O)return"@context"===K?void 0:null;if(I.mappings.has(O)){const E=I.mappings.get(O);if(w(K))return E;if(E.hasOwnProperty(K))return E[K]}return"@language"===K&&K in I||"@direction"===K&&K in I?I[K]:"@context"!==K?null:void 0},P.processingMode=(I,O)=>O.toString()>="1.1"?!I.processingMode||I.processingMode>="json-ld-"+O.toString():"json-ld-1.0"===I.processingMode,P.isKeyword=I=>{if(!H(I)||"@"!==I[0])return!1;switch(I){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,Se,he){"use strict";const{parseLinkHeader:W,buildHeaders:j}=Y("../util"),{LINK_HEADER_CONTEXT:k}=Y("../constants"),Q=Y("../JsonLdError"),H=Y("../RequestQueue"),{prependBase:w}=Y("../url"),C=/(^|(\r\n))link:/i;function R(T,b,y){const S=new(T=T||XMLHttpRequest);return new Promise((A,z)=>{S.onload=()=>A(S),S.onerror=P=>z(P),S.open("GET",b,!0);for(const P in y)S.setRequestHeader(P,y[P]);S.send()})}Se.exports=({secure:T,headers:b={},xhr:y}={headers:{}})=>{return b=j(b),(new H).wrapLoader(A);function A(P){return z.apply(this,arguments)}function z(){return(z=yt(function*(P){if(0!==P.indexOf("http:")&&0!==P.indexOf("https:"))throw new Q('URL could not be dereferenced; only "http" and "https" URLs are supported.',"jsonld.InvalidUrl",{code:"loading document failed",url:P});if(T&&0!==P.indexOf("https"))throw new Q('URL could not be dereferenced; secure mode is enabled and the URL\'s scheme is not "https".',"jsonld.InvalidUrl",{code:"loading document failed",url:P});let X;try{X=yield R(y,P,b)}catch(E){throw new Q("URL could not be dereferenced, an error occurred.","jsonld.LoadDocumentError",{code:"loading document failed",url:P,cause:E})}if(X.status>=400)throw new Q("URL could not be dereferenced: "+X.statusText,"jsonld.LoadDocumentError",{code:"loading document failed",url:P,httpStatusCode:X.status});let ue={contextUrl:null,documentUrl:P,document:X.response},I=null;const O=X.getResponseHeader("Content-Type");let K;if(C.test(X.getAllResponseHeaders())&&(K=X.getResponseHeader("Link")),K&&"application/ld+json"!==O){const E=W(K),$=E[k];if(Array.isArray($))throw new Q("URL could not be dereferenced, it has more than one associated HTTP Link Header.","jsonld.InvalidUrl",{code:"multiple context link headers",url:P});$&&(ue.contextUrl=$.target),I=E.alternate,I&&"application/ld+json"==I.type&&!(O||"").match(/^application\/(\w*\+)?json$/)&&(ue=yield A(w(P,I.target)))}return ue})).apply(this,arguments)}}},{"../JsonLdError":12,"../RequestQueue":15,"../constants":18,"../url":31,"../util":32}],21:[function(Y,Se,he){"use strict";const W=Y("./JsonLdError"),{isArray:j,isObject:k,isEmptyObject:Q,isString:H,isUndefined:w}=Y("./types"),{isList:C,isValue:R,isGraph:T,isSubject:b}=Y("./graphTypes"),{expandIri:y,getContextValue:S,isKeyword:A,process:z,processingMode:P}=Y("./context"),{isAbsolute:X}=Y("./url"),{addValue:ue,asArray:I,getValues:O,validateTypeValue:K}=Y("./util"),E={};Se.exports=E;const $=/^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$/;function Z(ne){return ae.apply(this,arguments)}function ae(){return(ae=yt(function*({activeCtx:ne,activeProperty:ye,expandedActiveProperty:Oe,element:$e,expandedParent:st,options:Qe={},insideList:tt,typeKey:Xe,typeScopedContext:ze,expansionMap:Le}){const Ke=Object.keys($e).sort(),Me=[];let Ue;const qe=$e[Xe]&&"@json"===y(ne,j($e[Xe])?$e[Xe][0]:$e[Xe],{vocab:!0},Qe);for(const ke of Ke){let G,q=$e[ke];if("@context"===ke)continue;let pe=y(ne,ke,{vocab:!0},Qe);if((null===pe||!X(pe)&&!A(pe))&&(pe=Le({unmappedProperty:ke,activeCtx:ne,activeProperty:ye,parent:$e,options:Qe,insideList:tt,value:q,expandedParent:st}),void 0===pe))continue;if(A(pe)){if("@reverse"===Oe)throw new W("Invalid JSON-LD syntax; a keyword cannot be used as a @reverse property.","jsonld.SyntaxError",{code:"invalid reverse property map",value:q});if(pe in st&&"@included"!==pe&&"@type"!==pe)throw new W("Invalid JSON-LD syntax; colliding keywords detected.","jsonld.SyntaxError",{code:"colliding keywords",keyword:pe})}if("@id"===pe){if(!H(q)){if(!Qe.isFrame)throw new W('Invalid JSON-LD syntax; "@id" value must a string.',"jsonld.SyntaxError",{code:"invalid @id value",value:q});if(k(q)){if(!Q(q))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:q})}else{if(!j(q))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:q});if(!q.every(pt=>H(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:q})}}ue(st,"@id",I(q).map(pt=>H(pt)?y(ne,pt,{base:!0},Qe):pt),{propertyIsArray:Qe.isFrame});continue}if("@type"===pe){k(q)&&(q=Object.fromEntries(Object.entries(q).map(([pt,we])=>[y(ze,pt,{vocab:!0}),I(we).map(B=>y(ze,B,{base:!0,vocab:!0}))]))),K(q,Qe.isFrame),ue(st,"@type",I(q).map(pt=>H(pt)?y(ze,pt,{base:!0,vocab:!0},Qe):pt),{propertyIsArray:Qe.isFrame});continue}if("@included"===pe&&P(ne,1.1)){const pt=I(yield E.expand({activeCtx:ne,activeProperty:ye,element:q,options:Qe,expansionMap:Le}));if(!pt.every(we=>b(we)))throw new W("Invalid JSON-LD syntax; values of @included must expand to node objects.","jsonld.SyntaxError",{code:"invalid @included value",value:q});ue(st,"@included",pt,{propertyIsArray:!0});continue}if("@graph"===pe&&!k(q)&&!j(q))throw new W('Invalid JSON-LD syntax; "@graph" value must not be an object or an array.',"jsonld.SyntaxError",{code:"invalid @graph value",value:q});if("@value"===pe){Ue=q,qe&&P(ne,1.1)?st["@value"]=q:ue(st,"@value",q,{propertyIsArray:Qe.isFrame});continue}if("@language"===pe){if(null===q)continue;if(!H(q)&&!Qe.isFrame)throw new W('Invalid JSON-LD syntax; "@language" value must be a string.',"jsonld.SyntaxError",{code:"invalid language-tagged string",value:q});q=I(q).map(pt=>H(pt)?pt.toLowerCase():pt);for(const pt of q)H(pt)&&!pt.match($)&&console.warn(`@language must be valid BCP47: ${pt}`);ue(st,"@language",q,{propertyIsArray:Qe.isFrame});continue}if("@direction"===pe){if(!H(q)&&!Qe.isFrame)throw new W('Invalid JSON-LD syntax; "@direction" value must be a string.',"jsonld.SyntaxError",{code:"invalid base direction",value:q});q=I(q);for(const pt of q)if(H(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:q});ue(st,"@direction",q,{propertyIsArray:Qe.isFrame});continue}if("@index"===pe){if(!H(q))throw new W('Invalid JSON-LD syntax; "@index" value must be a string.',"jsonld.SyntaxError",{code:"invalid @index value",value:q});ue(st,"@index",q);continue}if("@reverse"===pe){if(!k(q))throw new W('Invalid JSON-LD syntax; "@reverse" value must be an object.',"jsonld.SyntaxError",{code:"invalid @reverse value",value:q});if(G=yield E.expand({activeCtx:ne,activeProperty:"@reverse",element:q,options:Qe,expansionMap:Le}),"@reverse"in G)for(const we in G["@reverse"])ue(st,we,G["@reverse"][we],{propertyIsArray:!0});let pt=st["@reverse"]||null;for(const we in G){if("@reverse"===we)continue;null===pt&&(pt=st["@reverse"]={}),ue(pt,we,[],{propertyIsArray:!0});const B=G[we];for(let N=0;N"@id"===pt||"@index"===pt)&&(G=I(G).map(pt=>({"@graph":I(pt)}))),de.mappings.has(ke)&&de.mappings.get(ke).reverse){const pt=st["@reverse"]=st["@reverse"]||{};G=I(G);for(let we=0;we"@value"===y(ne,pe,{vocab:!0},Qe)))throw new W("Invalid JSON-LD syntax; nested value must be a node object.","jsonld.SyntaxError",{code:"invalid @nest value",value:G});yield Z({activeCtx:ne,activeProperty:ye,expandedActiveProperty:Oe,element:G,expandedParent:st,options:Qe,insideList:tt,typeScopedContext:ze,typeKey:Xe,expansionMap:Le})}}})).apply(this,arguments)}function oe({activeCtx:ne,activeProperty:ye,value:Oe,options:$e}){if(null==Oe)return null;const st=y(ne,ye,{vocab:!0},$e);if("@id"===st)return y(ne,Oe,{base:!0},$e);if("@type"===st)return y(ne,Oe,{vocab:!0,base:!0},$e);const Qe=S(ne,ye,"@type");if(("@id"===Qe||"@graph"===st)&&H(Oe))return{"@id":y(ne,Oe,{base:!0},$e)};if("@vocab"===Qe&&H(Oe))return{"@id":y(ne,Oe,{vocab:!0,base:!0},$e)};if(A(st))return Oe;const tt={};if(Qe&&!["@id","@vocab","@none"].includes(Qe))tt["@type"]=Qe;else if(H(Oe)){const Xe=S(ne,ye,"@language");null!==Xe&&(tt["@language"]=Xe);const ze=S(ne,ye,"@direction");null!==ze&&(tt["@direction"]=ze)}return["boolean","number","string"].includes(typeof Oe)||(Oe=Oe.toString()),tt["@value"]=Oe,tt}function te(ne,ye,Oe,$e){const st=[],Qe=Object.keys(ye).sort();for(const tt of Qe){const Xe=y(ne,tt,{vocab:!0},$e);let ze=ye[tt];j(ze)||(ze=[ze]);for(const Le of ze){if(null===Le)continue;if(!H(Le))throw new W("Invalid JSON-LD syntax; language map values must be strings.","jsonld.SyntaxError",{code:"invalid language map value",languageMap:ye});const Ke={"@value":Le};"@none"!==Xe&&(Ke["@language"]=tt.toLowerCase()),Oe&&(Ke["@direction"]=Oe),st.push(Ke)}}return st}function Te(ne){return me.apply(this,arguments)}function me(){return(me=yt(function*({activeCtx:ne,options:ye,activeProperty:Oe,value:$e,expansionMap:st,asGraph:Qe,indexKey:tt,propertyIndex:Xe}){const ze=[],Le=Object.keys($e).sort(),Ke="@type"===tt;for(let Me of Le){if(Ke){const ke=S(ne,Me,"@context");w(ke)||(ne=yield z({activeCtx:ne,localCtx:ke,propagate:!1,options:ye}))}let qe,Ue=$e[Me];j(Ue)||(Ue=[Ue]),Ue=yield E.expand({activeCtx:ne,activeProperty:Oe,element:Ue,options:ye,insideList:!1,insideIndex:!0,expansionMap:st}),qe=Xe?"@none"===Me?"@none":oe({activeCtx:ne,activeProperty:tt,value:Me,options:ye}):y(ne,Me,{vocab:!0},ye),"@id"===tt?Me=y(ne,Me,{base:!0},ye):Ke&&(Me=qe);for(let ke of Ue){if(Qe&&!T(ke)&&(ke={"@graph":[ke]}),"@type"===tt)"@none"===qe||(ke["@type"]=ke["@type"]?[Me].concat(ke["@type"]):[Me]);else{if(R(ke)&&!["@language","@type","@index"].includes(tt))throw new W(`Invalid JSON-LD syntax; Attempt to add illegal key to value object: "${tt}".`,"jsonld.SyntaxError",{code:"invalid value object",value:ke});Xe?"@none"!==qe&&ue(ke,Xe,qe,{propertyIsArray:!0,prependValue:!0}):"@none"!==qe&&!(tt in ke)&&(ke[tt]=Me)}ze.push(ke)}}return ze})).apply(this,arguments)}E.expand=function(){var ne=yt(function*({activeCtx:ye,activeProperty:Oe=null,element:$e,options:st={},insideList:Qe=!1,insideIndex:tt=!1,typeScopedContext:Xe=null,expansionMap:ze=(()=>{})}){if(null==$e)return null;if("@default"===Oe&&(st=Object.assign({},st,{isFrame:!1})),!j($e)&&!k($e)){if(!Qe&&(null===Oe||"@graph"===y(ye,Oe,{vocab:!0},st))){const G=yield ze({unmappedValue:$e,activeCtx:ye,activeProperty:Oe,options:st,insideList:Qe});return void 0===G?null:G}return oe({activeCtx:ye,activeProperty:Oe,value:$e,options:st})}if(j($e)){let G=[];const pe=S(ye,Oe,"@container")||[];Qe=Qe||pe.includes("@list");for(let de=0;de<$e.length;++de){let je=yield E.expand({activeCtx:ye,activeProperty:Oe,element:$e[de],options:st,expansionMap:ze,insideIndex:tt,typeScopedContext:Xe});Qe&&j(je)&&(je={"@list":je}),(null!==je||(je=yield ze({unmappedValue:$e[de],activeCtx:ye,activeProperty:Oe,parent:$e,index:de,options:st,expandedParent:G,insideList:Qe}),void 0!==je))&&(j(je)?G=G.concat(je):G.push(je))}return G}const Le=y(ye,Oe,{vocab:!0},st),Ke=S(ye,Oe,"@context");Xe=Xe||(ye.previousContext?ye:null);let Me=Object.keys($e).sort(),Ue=!tt;if(Ue&&Xe&&Me.length<=2&&!Me.includes("@context"))for(const G of Me){const pe=y(Xe,G,{vocab:!0},st);if("@value"===pe){Ue=!1,ye=Xe;break}if("@id"===pe&&1===Me.length){Ue=!1;break}}Ue&&(ye=ye.revertToPreviousContext()),w(Ke)||(ye=yield z({activeCtx:ye,localCtx:Ke,propagate:!0,overrideProtected:!0,options:st})),"@context"in $e&&(ye=yield z({activeCtx:ye,localCtx:$e["@context"],options:st})),Xe=ye;let qe=null;for(const G of Me)if("@type"===y(ye,G,{vocab:!0},st)){qe=qe||G;const de=$e[G],je=Array.isArray(de)?de.length>1?de.slice().sort():de:[de];for(const _t of je){const pt=S(Xe,_t,"@context");w(pt)||(ye=yield z({activeCtx:ye,localCtx:pt,options:st,propagate:!1}))}}let ke={};yield Z({activeCtx:ye,activeProperty:Oe,expandedActiveProperty:Le,element:$e,expandedParent:ke,options:st,insideList:Qe,typeKey:qe,typeScopedContext:Xe,expansionMap:ze}),Me=Object.keys(ke);let q=Me.length;if("@value"in ke){if("@type"in ke&&("@language"in ke||"@direction"in ke))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:ke});let G=q-1;if("@type"in ke&&(G-=1),"@index"in ke&&(G-=1),"@language"in ke&&(G-=1),"@direction"in ke&&(G-=1),0!==G)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:ke});const pe=null===ke["@value"]?[]:I(ke["@value"]),de=O(ke,"@type");if(!P(ye,1.1)||!de.includes("@json")||1!==de.length)if(0===pe.length){const je=yield ze({unmappedValue:ke,activeCtx:ye,activeProperty:Oe,element:$e,options:st,insideList:Qe});ke=void 0!==je?je:null}else{if(!pe.every(je=>H(je)||Q(je))&&"@language"in ke)throw new W("Invalid JSON-LD syntax; only strings may be language-tagged.","jsonld.SyntaxError",{code:"invalid language-tagged value",element:ke});if(!de.every(je=>X(je)&&!(H(je)&&0===je.indexOf("_:"))||Q(je)))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:ke})}}else if("@type"in ke&&!j(ke["@type"]))ke["@type"]=[ke["@type"]];else if("@set"in ke||"@list"in ke){if(q>1&&(2!==q||!("@index"in ke)))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:ke});"@set"in ke&&(ke=ke["@set"],Me=Object.keys(ke),q=Me.length)}else if(1===q&&"@language"in ke){const G=yield ze(ke,{unmappedValue:ke,activeCtx:ye,activeProperty:Oe,element:$e,options:st,insideList:Qe});ke=void 0!==G?G:null}if(k(ke)&&!st.keepFreeFloatingNodes&&!Qe&&(null===Oe||"@graph"===Le)&&(0===q||"@value"in ke||"@list"in ke||1===q&&"@id"in ke)){const G=yield ze({unmappedValue:ke,activeCtx:ye,activeProperty:Oe,element:$e,options:st,insideList:Qe});ke=void 0!==G?G:null}return ke});return function(ye){return ne.apply(this,arguments)}}()},{"./JsonLdError":12,"./context":19,"./graphTypes":25,"./types":30,"./url":31,"./util":32}],22:[function(Y,Se,he){"use strict";const{isSubjectReference:W}=Y("./graphTypes"),{createMergedNodeMap:j}=Y("./nodeMap"),k={};Se.exports=k,k.flatten=Q=>{const H=j(Q),w=[],C=Object.keys(H).sort();for(let R=0;R=0;--ae){const oe=Z[ae];if(oe.graph===$&&oe.subject["@id"]===E["@id"])return!0}return!1}function S(E,$,Z){const ae="@"+Z;let oe=ae in E?E[ae][0]:$[Z];if("embed"===Z)if(!0===oe)oe="@once";else if(!1===oe)oe="@never";else if("@always"!==oe&&"@never"!==oe&&"@link"!==oe&&"@first"!==oe&&"@last"!==oe&&"@once"!==oe)throw new w("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:E});return oe}function A(E){if(!k.isArray(E)||1!==E.length||!k.isObject(E[0]))throw new w("Invalid JSON-LD syntax; a JSON-LD frame must be a single object.","jsonld.SyntaxError",{frame:E});if("@id"in E[0])for(const $ of Q.asArray(E[0]["@id"]))if(!k.isObject($)&&!H.isAbsolute($)||k.isString($)&&0===$.indexOf("_:"))throw new w("Invalid JSON-LD syntax; invalid @id in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:E});if("@type"in E[0])for(const $ of Q.asArray(E[0]["@type"]))if(!k.isObject($)&&!H.isAbsolute($)||k.isString($)&&0===$.indexOf("_:"))throw new w("Invalid JSON-LD syntax; invalid @type in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:E})}function P(E,$,Z,ae){let oe=!0,te=!1;for(const Te in Z){let me=!1;const ne=Q.getValues($,Te),ye=0===Q.getValues(Z,Te).length;if("@id"===Te){if(k.isEmptyObject(Z["@id"][0]||{})?me=!0:Z["@id"].length>=0&&(me=Z["@id"].includes(ne[0])),!ae.requireAll)return me}else if("@type"===Te){if(oe=!1,ye){if(ne.length>0)return!1;me=!0}else if(1===Z["@type"].length&&k.isEmptyObject(Z["@type"][0]))me=ne.length>0;else for(const Oe of Z["@type"])me=!(!k.isObject(Oe)||!("@default"in Oe))||me||ne.some($e=>$e===Oe);if(!ae.requireAll)return me}else{if(W(Te))continue;{const Oe=Q.getValues(Z,Te)[0];let $e=!1;if(Oe&&(A([Oe]),$e="@default"in Oe),oe=!1,0===ne.length&&$e)continue;if(ne.length>0&&ye)return!1;if(void 0===Oe){if(ne.length>0)return!1;me=!0}else if(j.isList(Oe)){const st=Oe["@list"][0];if(j.isList(ne[0])){const Qe=ne[0]["@list"];j.isValue(st)?me=Qe.some(tt=>K(st,tt)):(j.isSubject(st)||j.isSubjectReference(st))&&(me=Qe.some(tt=>O(E,st,tt,ae)))}}else me=j.isValue(Oe)?ne.some(st=>K(Oe,st)):j.isSubjectReference(Oe)?ne.some(st=>O(E,Oe,st,ae)):!!k.isObject(Oe)&&ne.length>0}}if(!me&&ae.requireAll)return!1;te=te||me}return oe||te}function X(E,$){const Z=E.uniqueEmbeds[E.graph],ae=Z[$],oe=ae.parent,te=ae.property,Te={"@id":$};if(k.isArray(oe)){for(let ne=0;ne{const ye=Object.keys(Z);for(const Oe of ye)Oe in Z&&k.isObject(Z[Oe].parent)&&Z[Oe].parent["@id"]===ne&&(delete Z[Oe],me(Oe))};me($)}function ue(E,$){if(k.isArray(E))return E.map(Z=>ue(Z,$));if(k.isObject(E)){if("@preserve"in E)return E["@preserve"][0];if(j.isValue(E))return E;if(j.isList(E))return E["@list"]=ue(E["@list"],$),E;if("@id"in E){const Z=E["@id"];if($.link.hasOwnProperty(Z)){const ae=$.link[Z].indexOf(E);if(-1!==ae)return $.link[Z][ae];$.link[Z].push(E)}else $.link[Z]=[E]}for(const Z in E)"@id"===Z&&$.bnodesToClear.includes(E[Z])?delete E["@id"]:E[Z]=ue(E[Z],$)}return E}function I(E,$,Z){k.isObject(E)?Q.addValue(E,$,Z,{propertyIsArray:!0}):E.push(Z)}function O(E,$,Z,ae){if(!("@id"in Z))return!1;const oe=E.subjects[Z["@id"]];return oe&&P(E,oe,$,ae)}function K(E,$){const Z=$["@value"],ae=$["@type"],oe=$["@language"],te=E["@value"]?k.isArray(E["@value"])?E["@value"]:[E["@value"]]:[],Te=E["@type"]?k.isArray(E["@type"])?E["@type"]:[E["@type"]]:[],me=E["@language"]?k.isArray(E["@language"])?E["@language"]:[E["@language"]]:[];return 0===te.length&&0===Te.length&&0===me.length||!(!te.includes(Z)&&!k.isEmptyObject(te[0])||!(!ae&&0===Te.length||Te.includes(ae)||ae&&k.isEmptyObject(Te[0]))||!(!oe&&0===me.length||me.includes(oe)||oe&&k.isEmptyObject(me[0])))}Se.exports=T,T.frameMergedOrDefault=(E,$,Z)=>{const ae={options:Z,embedded:!1,graph:"@default",graphMap:{"@default":{}},subjectStack:[],link:{},bnodeMap:{}},oe=new Q.IdentifierIssuer("_:b");C(E,ae.graphMap,"@default",oe),Z.merged&&(ae.graphMap["@merged"]=R(ae.graphMap),ae.graph="@merged"),ae.subjects=ae.graphMap[ae.graph];const te=[];return T.frame(ae,Object.keys(ae.subjects).sort(),$,te),Z.pruneBlankNodeIdentifiers&&(Z.bnodesToClear=Object.keys(ae.bnodeMap).filter(Te=>1===ae.bnodeMap[Te].length)),Z.link={},ue(te,Z)},T.frame=(E,$,Z,ae,oe=null)=>{A(Z);const te=E.options,Te={embed:S(Z=Z[0],te,"embed"),explicit:S(Z,te,"explicit"),requireAll:S(Z,te,"requireAll")};E.link.hasOwnProperty(E.graph)||(E.link[E.graph]={});const me=E.link[E.graph],ne=function(E,$,Z,ae){const oe={};for(const te of $){const Te=E.graphMap[E.graph][te];P(E,Te,Z,ae)&&(oe[te]=Te)}return oe}(E,$,Z,Te),ye=Object.keys(ne).sort();for(const Oe of ye){const $e=ne[Oe];if(null===oe?E.uniqueEmbeds={[E.graph]:{}}:E.uniqueEmbeds[E.graph]=E.uniqueEmbeds[E.graph]||{},"@link"===Te.embed&&Oe in me){I(ae,oe,me[Oe]);continue}const st={"@id":Oe};if(0===Oe.indexOf("_:")&&Q.addValue(E.bnodeMap,Oe,st,{propertyIsArray:!0}),me[Oe]=st,("@first"===Te.embed||"@last"===Te.embed)&&E.is11)throw new w("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:Z});if(E.embedded||!E.uniqueEmbeds[E.graph].hasOwnProperty(Oe)){if(E.embedded&&("@never"===Te.embed||y($e,E.graph,E.subjectStack))){I(ae,oe,st);continue}if(E.embedded&&("@first"==Te.embed||"@once"==Te.embed)&&E.uniqueEmbeds[E.graph].hasOwnProperty(Oe)){I(ae,oe,st);continue}if("@last"===Te.embed&&Oe in E.uniqueEmbeds[E.graph]&&X(E,Oe),E.uniqueEmbeds[E.graph][Oe]={parent:ae,property:oe},E.subjectStack.push({subject:$e,graph:E.graph}),Oe in E.graphMap){let Qe=!1,tt=null;"@graph"in Z?(tt=Z["@graph"][0],Qe=!("@merged"===Oe||"@default"===Oe),k.isObject(tt)||(tt={})):(Qe="@merged"!==E.graph,tt={}),Qe&&T.frame(Sn(ot({},E),{graph:Oe,embedded:!1}),Object.keys(E.graphMap[Oe]).sort(),[tt],st,"@graph")}"@included"in Z&&T.frame(Sn(ot({},E),{embedded:!1}),$,Z["@included"],st,"@included");for(const Qe of Object.keys($e).sort())if(W(Qe)){if(st[Qe]=Q.clone($e[Qe]),"@type"===Qe)for(const tt of $e["@type"])0===tt.indexOf("_:")&&Q.addValue(E.bnodeMap,tt,st,{propertyIsArray:!0})}else if(!Te.explicit||Qe in Z)for(const tt of $e[Qe]){const Xe=Qe in Z?Z[Qe]:b(Te);if(j.isList(tt)){const ze=Z[Qe]&&Z[Qe][0]&&Z[Qe][0]["@list"]?Z[Qe][0]["@list"]:b(Te),Le={"@list":[]};I(st,Qe,Le);const Ke=tt["@list"];for(const Me of Ke)j.isSubjectReference(Me)?T.frame(Sn(ot({},E),{embedded:!0}),[Me["@id"]],ze,Le,"@list"):I(Le,"@list",Q.clone(Me))}else j.isSubjectReference(tt)?T.frame(Sn(ot({},E),{embedded:!0}),[tt["@id"]],Xe,st,Qe):K(Xe[0],tt)&&I(st,Qe,Q.clone(tt))}for(const Qe of Object.keys(Z).sort()){if("@type"===Qe){if(!k.isObject(Z[Qe][0])||!("@default"in Z[Qe][0]))continue}else if(W(Qe))continue;const tt=Z[Qe][0]||{};if(!S(tt,te,"omitDefault")&&!(Qe in st)){let ze="@null";"@default"in tt&&(ze=Q.clone(tt["@default"])),k.isArray(ze)||(ze=[ze]),st[Qe]=[{"@preserve":ze}]}}for(const Qe of Object.keys(Z["@reverse"]||{}).sort()){const tt=Z["@reverse"][Qe];for(const Xe of Object.keys(E.subjects))Q.getValues(E.subjects[Xe],Qe).some(Le=>Le["@id"]===Oe)&&(st["@reverse"]=st["@reverse"]||{},Q.addValue(st["@reverse"],Qe,[],{propertyIsArray:!0}),T.frame(Sn(ot({},E),{embedded:!0}),[Xe],tt,st["@reverse"][Qe],oe))}I(ae,oe,st),E.subjectStack.pop()}}},T.cleanupNull=(E,$)=>{if(k.isArray(E))return E.map(ae=>T.cleanupNull(ae,$)).filter(ae=>ae);if("@null"===E)return null;if(k.isObject(E)){if("@id"in E){const Z=E["@id"];if($.link.hasOwnProperty(Z)){const ae=$.link[Z].indexOf(E);if(-1!==ae)return $.link[Z][ae];$.link[Z].push(E)}else $.link[Z]=[E]}for(const Z in E)E[Z]=T.cleanupNull(E[Z],$)}return E}},{"./JsonLdError":12,"./context":19,"./graphTypes":25,"./nodeMap":27,"./types":30,"./url":31,"./util":32}],24:[function(Y,Se,he){"use strict";const W=Y("./JsonLdError"),j=Y("./graphTypes"),k=Y("./types"),Q=Y("./util"),{RDF_LIST:H,RDF_FIRST:w,RDF_REST:C,RDF_NIL:R,RDF_TYPE:T,RDF_JSON_LITERAL:b,XSD_BOOLEAN:y,XSD_DOUBLE:S,XSD_INTEGER:A,XSD_STRING:z}=Y("./constants"),P=/^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$/,X={};function ue(I,O,K){if(I.termType.endsWith("Node"))return{"@id":I.value};const E={"@value":I.value};if(I.language)E["@language"]=I.language;else{let $=I.datatype.value;if($||($=z),$===b){$="@json";try{E["@value"]=JSON.parse(E["@value"])}catch(Z){throw new W("JSON literal could not be parsed.","jsonld.InvalidJsonLiteral",{code:"invalid JSON literal",value:E["@value"],cause:Z})}}if(O){if($===y)"true"===E["@value"]?E["@value"]=!0:"false"===E["@value"]&&(E["@value"]=!1);else if(k.isNumeric(E["@value"]))if($===A){const Z=parseInt(E["@value"],10);Z.toFixed(0)===E["@value"]&&(E["@value"]=Z)}else $===S&&(E["@value"]=parseFloat(E["@value"]));[y,A,S,z].includes($)||(E["@type"]=$)}else if("i18n-datatype"===K&&$.startsWith("https://www.w3.org/ns/i18n#")){const[,Z,ae]=$.split(/[#_]/);Z.length>0&&(E["@language"]=Z,Z.match(P)||console.warn(`@language must be valid BCP47: ${Z}`)),E["@direction"]=ae}else $!==z&&(E["@type"]=$)}return E}Se.exports=X,X.fromRDF=function(){var I=yt(function*(O,{useRdfType:K=!1,useNativeTypes:E=!1,rdfDirection:$=null}){const Z={},ae={"@default":Z},oe={};for(const me of O){const ne="DefaultGraph"===me.graph.termType?"@default":me.graph.value;ne in ae||(ae[ne]={}),"@default"!==ne&&!(ne in Z)&&(Z[ne]={"@id":ne});const ye=ae[ne],Oe=me.subject.value,$e=me.predicate.value,st=me.object;Oe in ye||(ye[Oe]={"@id":Oe});const Qe=ye[Oe],tt=st.termType.endsWith("Node");if(tt&&!(st.value in ye)&&(ye[st.value]={"@id":st.value}),$e===T&&!K&&tt){Q.addValue(Qe,"@type",st.value,{propertyIsArray:!0});continue}const Xe=ue(st,E,$);if(Q.addValue(Qe,$e,Xe,{propertyIsArray:!0}),tt)if(st.value===R){const ze=ye[st.value];"usages"in ze||(ze.usages=[]),ze.usages.push({node:Qe,property:$e,value:Xe})}else oe[st.value]=!(st.value in oe)&&{node:Qe,property:$e,value:Xe}}for(const me in ae){const ne=ae[me];if(!(R in ne))continue;const ye=ne[R];if(ye.usages){for(let Oe of ye.usages){let $e=Oe.node,st=Oe.property,Qe=Oe.value;const tt=[],Xe=[];let ze=Object.keys($e).length;for(;st===C&&k.isObject(oe[$e["@id"]])&&k.isArray($e[w])&&1===$e[w].length&&k.isArray($e[C])&&1===$e[C].length&&(3===ze||4===ze&&k.isArray($e["@type"])&&1===$e["@type"].length&&$e["@type"][0]===H)&&(tt.push($e[w][0]),Xe.push($e["@id"]),Oe=oe[$e["@id"]],$e=Oe.node,st=Oe.property,Qe=Oe.value,ze=Object.keys($e).length,j.isBlankNode($e)););delete Qe["@id"],Qe["@list"]=tt.reverse();for(const Le of Xe)delete ne[Le]}delete ye.usages}}const te=[],Te=Object.keys(Z).sort();for(const me of Te){const ne=Z[me];if(me in ae){const ye=ne["@graph"]=[],Oe=ae[me],$e=Object.keys(Oe).sort();for(const st of $e){const Qe=Oe[st];j.isSubjectReference(Qe)||ye.push(Qe)}}j.isSubjectReference(ne)||te.push(ne)}return te});return function(O,K){return I.apply(this,arguments)}}()},{"./JsonLdError":12,"./constants":18,"./graphTypes":25,"./types":30,"./util":32}],25:[function(Y,Se,he){"use strict";const W=Y("./types"),j={};Se.exports=j,j.isSubject=k=>!(!W.isObject(k)||"@value"in k||"@set"in k||"@list"in k)&&(Object.keys(k).length>1||!("@id"in k)),j.isSubjectReference=k=>W.isObject(k)&&1===Object.keys(k).length&&"@id"in k,j.isValue=k=>W.isObject(k)&&"@value"in k,j.isList=k=>W.isObject(k)&&"@list"in k,j.isGraph=k=>W.isObject(k)&&"@graph"in k&&1===Object.keys(k).filter(Q=>"@id"!==Q&&"@index"!==Q).length,j.isSimpleGraph=k=>j.isGraph(k)&&!("@id"in k),j.isBlankNode=k=>!!W.isObject(k)&&("@id"in k?0===k["@id"].indexOf("_:"):0===Object.keys(k).length||!("@value"in k||"@set"in k||"@list"in k))},{"./types":30}],26:[function(Y,Se,he){const W=Y("rdf-canonize"),j=Y("./platform"),k=Y("./util"),Q=Y("./ContextResolver"),H=k.IdentifierIssuer,w=Y("./JsonLdError"),C=Y("lru-cache"),R=Y("./NQuads"),{expand:T}=Y("./expand"),{flatten:b}=Y("./flatten"),{fromRDF:y}=Y("./fromRdf"),{toRDF:S}=Y("./toRdf"),{frameMergedOrDefault:A,cleanupNull:z}=Y("./frame"),{isArray:P,isObject:X,isString:ue}=Y("./types"),{isSubjectReference:I}=Y("./graphTypes"),{expandIri:O,getInitialContext:K,process:E,processingMode:$}=Y("./context"),{compact:Z,compactIri:ae}=Y("./compact"),{createNodeMap:oe,createMergedNodeMap:te,mergeNodeMaps:Te}=Y("./nodeMap"),me=function(ye){const Oe={},st=new C({max:100});function Qe(tt,Le){var Ke=Le,{documentLoader:Xe=ye.documentLoader}=Ke,ze=Nq(Ke,["documentLoader"]);return Object.assign({},{documentLoader:Xe},ze,tt)}return ye.compact=function(){var tt=yt(function*(Xe,ze,Le){if(arguments.length<2)throw new TypeError("Could not compact, too few arguments.");if(null===ze)throw new w("The compaction context must not be null.","jsonld.CompactError",{code:"invalid local context"});if(null===Xe)return null;let Ke;(Le=Qe(Le,{base:ue(Xe)?Xe:"",compactArrays:!0,compactToRelative:!0,graph:!1,skipExpansion:!1,link:!1,issuer:new H("_:b"),contextResolver:new Q({sharedCache:st})})).link&&(Le.skipExpansion=!0),Le.compactToRelative||delete Le.base,Ke=Le.skipExpansion?Xe:yield ye.expand(Xe,Le);const Me=yield ye.processContext(K(Le),ze,Le);let Ue=yield Z({activeCtx:Me,element:Ke,options:Le,compactionMap:Le.compactionMap});Le.compactArrays&&!Le.graph&&P(Ue)?1===Ue.length?Ue=Ue[0]:0===Ue.length&&(Ue={}):Le.graph&&X(Ue)&&(Ue=[Ue]),X(ze)&&"@context"in ze&&(ze=ze["@context"]),ze=k.clone(ze),P(ze)||(ze=[ze]);const qe=ze;ze=[];for(let q=0;q0)&&ze.push(qe[q]);const ke=ze.length>0;if(1===ze.length&&(ze=ze[0]),P(Ue)){const q=ae({activeCtx:Me,iri:"@graph",relativeTo:{vocab:!0}}),G=Ue;Ue={},ke&&(Ue["@context"]=ze),Ue[q]=G}else if(X(Ue)&&ke){const q=Ue;Ue={"@context":ze};for(const G in q)Ue[G]=q[G]}return Ue});return function(Xe,ze,Le){return tt.apply(this,arguments)}}(),ye.expand=function(){var tt=yt(function*(Xe,ze){if(arguments.length<1)throw new TypeError("Could not expand, too few arguments.");!1===(ze=Qe(ze,{keepFreeFloatingNodes:!1,contextResolver:new Q({sharedCache:st})})).expansionMap&&(ze.expansionMap=void 0);const Le={},Ke=[];if("expandContext"in ze){const ke=k.clone(ze.expandContext);Le.expandContext=X(ke)&&"@context"in ke?ke:{"@context":ke},Ke.push(Le.expandContext)}let Me;if(ue(Xe)){const ke=yield ye.get(Xe,ze);Me=ke.documentUrl,Le.input=ke.document,ke.contextUrl&&(Le.remoteContext={"@context":ke.contextUrl},Ke.push(Le.remoteContext))}else Le.input=k.clone(Xe);"base"in ze||(ze.base=Me||"");let Ue=K(ze);for(const ke of Ke)Ue=yield E({activeCtx:Ue,localCtx:ke,options:ze});let qe=yield T({activeCtx:Ue,element:Le.input,options:ze,expansionMap:ze.expansionMap});return X(qe)&&"@graph"in qe&&1===Object.keys(qe).length?qe=qe["@graph"]:null===qe&&(qe=[]),P(qe)||(qe=[qe]),qe});return function(Xe,ze){return tt.apply(this,arguments)}}(),ye.flatten=function(){var tt=yt(function*(Xe,ze,Le){if(arguments.length<1)return new TypeError("Could not flatten, too few arguments.");ze="function"==typeof ze?null:ze||null,Le=Qe(Le,{base:ue(Xe)?Xe:"",contextResolver:new Q({sharedCache:st})});const Ke=yield ye.expand(Xe,Le),Me=b(Ke);return null===ze?Me:(Le.graph=!0,Le.skipExpansion=!0,yield ye.compact(Me,ze,Le))});return function(Xe,ze,Le){return tt.apply(this,arguments)}}(),ye.frame=function(){var tt=yt(function*(Xe,ze,Le){if(arguments.length<2)throw new TypeError("Could not frame, too few arguments.");if(Le=Qe(Le,{base:ue(Xe)?Xe:"",embed:"@once",explicit:!1,requireAll:!1,omitDefault:!1,bnodesToClear:[],contextResolver:new Q({sharedCache:st})}),ue(ze)){const de=yield ye.get(ze,Le);if(ze=de.document,de.contextUrl){let je=ze["@context"];je?P(je)?je.push(de.contextUrl):je=[je,de.contextUrl]:je=de.contextUrl,ze["@context"]=je}}const Ke=ze&&ze["@context"]||{},Me=yield ye.processContext(K(Le),Ke,Le);Le.hasOwnProperty("omitGraph")||(Le.omitGraph=$(Me,1.1)),Le.hasOwnProperty("pruneBlankNodeIdentifiers")||(Le.pruneBlankNodeIdentifiers=$(Me,1.1));const Ue=yield ye.expand(Xe,Le),qe=ot({},Le);qe.isFrame=!0,qe.keepFreeFloatingNodes=!0;const ke=yield ye.expand(ze,qe),q=Object.keys(ze).map(de=>O(Me,de,{vocab:!0}));qe.merged=!q.includes("@graph"),qe.is11=$(Me,1.1);const G=A(Ue,ke,qe);qe.graph=!Le.omitGraph,qe.skipExpansion=!0,qe.link={},qe.framing=!0;let pe=yield ye.compact(G,Ke,qe);return qe.link={},pe=z(pe,qe),pe});return function(Xe,ze,Le){return tt.apply(this,arguments)}}(),ye.link=function(){var tt=yt(function*(Xe,ze,Le){const Ke={};return ze&&(Ke["@context"]=ze),Ke["@embed"]="@link",ye.frame(Xe,Ke,Le)});return function(Xe,ze,Le){return tt.apply(this,arguments)}}(),ye.normalize=ye.canonize=function(){var tt=yt(function*(Xe,ze){if(arguments.length<1)throw new TypeError("Could not canonize, too few arguments.");if("inputFormat"in(ze=Qe(ze,{base:ue(Xe)?Xe:"",algorithm:"URDNA2015",skipExpansion:!1,contextResolver:new Q({sharedCache:st})}))){if("application/n-quads"!==ze.inputFormat&&"application/nquads"!==ze.inputFormat)throw new w("Unknown canonicalization input format.","jsonld.CanonizeError");const Me=R.parse(Xe);return W.canonize(Me,ze)}const Le=ot({},ze);delete Le.format,Le.produceGeneralizedRdf=!1;const Ke=yield ye.toRDF(Xe,Le);return W.canonize(Ke,ze)});return function(Xe,ze){return tt.apply(this,arguments)}}(),ye.fromRDF=function(){var tt=yt(function*(Xe,ze){if(arguments.length<1)throw new TypeError("Could not convert from RDF, too few arguments.");ze=Qe(ze,{format:ue(Xe)?"application/n-quads":void 0});const{format:Le}=ze;let{rdfParser:Ke}=ze;if(Le){if(Ke=Ke||Oe[Le],!Ke)throw new w("Unknown input format.","jsonld.UnknownFormat",{format:Le})}else Ke=()=>Xe;const Me=yield Ke(Xe);return y(Me,ze)});return function(Xe,ze){return tt.apply(this,arguments)}}(),ye.toRDF=function(){var tt=yt(function*(Xe,ze){if(arguments.length<1)throw new TypeError("Could not convert to RDF, too few arguments.");let Le;Le=(ze=Qe(ze,{base:ue(Xe)?Xe:"",skipExpansion:!1,contextResolver:new Q({sharedCache:st})})).skipExpansion?Xe:yield ye.expand(Xe,ze);const Ke=S(Le,ze);if(ze.format){if("application/n-quads"===ze.format||"application/nquads"===ze.format)return R.serialize(Ke);throw new w("Unknown output format.","jsonld.UnknownFormat",{format:ze.format})}return Ke});return function(Xe,ze){return tt.apply(this,arguments)}}(),ye.createNodeMap=function(){var tt=yt(function*(Xe,ze){if(arguments.length<1)throw new TypeError("Could not create node map, too few arguments.");ze=Qe(ze,{base:ue(Xe)?Xe:"",contextResolver:new Q({sharedCache:st})});const Le=yield ye.expand(Xe,ze);return te(Le,ze)});return function(Xe,ze){return tt.apply(this,arguments)}}(),ye.merge=function(){var tt=yt(function*(Xe,ze,Le){if(arguments.length<1)throw new TypeError("Could not merge, too few arguments.");if(!P(Xe))throw new TypeError('Could not merge, "docs" must be an array.');ze="function"==typeof ze?null:ze||null,Le=Qe(Le,{contextResolver:new Q({sharedCache:st})});const Ke=yield Promise.all(Xe.map(de=>{const je=ot({},Le);return ye.expand(de,je)}));let Me=!0;"mergeNodes"in Le&&(Me=Le.mergeNodes);const Ue=Le.issuer||new H("_:b"),qe={"@default":{}};for(let de=0;deye._documentLoader,set:tt=>ye._documentLoader=tt}),ye.documentLoader=function(){var tt=yt(function*(Xe){throw new w("Could not retrieve a JSON-LD document from the URL. URL dereferencing not implemented.","jsonld.LoadDocumentError",{code:"loading document failed",url:Xe})});return function(Xe){return tt.apply(this,arguments)}}(),ye.get=function(){var tt=yt(function*(Xe,ze){let Le;Le="function"==typeof ze.documentLoader?ze.documentLoader:ye.documentLoader;const Ke=yield Le(Xe);try{if(!Ke.document)throw new w("No remote document found at the given URL.","jsonld.NullRemoteDocument");ue(Ke.document)&&(Ke.document=JSON.parse(Ke.document))}catch(Me){throw new w("Could not retrieve a JSON-LD document from the URL.","jsonld.LoadDocumentError",{code:"loading document failed",cause:Me,remoteDoc:Ke})}return Ke});return function(Xe,ze){return tt.apply(this,arguments)}}(),ye.processContext=function(){var tt=yt(function*(Xe,ze,Le){return Le=Qe(Le,{base:"",contextResolver:new Q({sharedCache:st})}),null===ze?K(Le):(ze=k.clone(ze),X(ze)&&"@context"in ze||(ze={"@context":ze}),E({activeCtx:Xe,localCtx:ze,options:Le}))});return function(Xe,ze,Le){return tt.apply(this,arguments)}}(),ye.getContextValue=Y("./context").getContextValue,ye.documentLoaders={},ye.useDocumentLoader=function(tt){if(!(tt in ye.documentLoaders))throw new w('Unknown document loader type: "'+tt+'"',"jsonld.UnknownDocumentLoader",{type:tt});ye.documentLoader=ye.documentLoaders[tt].apply(ye,Array.prototype.slice.call(arguments,1))},ye.registerRDFParser=function(tt,Xe){Oe[tt]=Xe},ye.unregisterRDFParser=function(tt){delete Oe[tt]},ye.registerRDFParser("application/n-quads",R.parse),ye.registerRDFParser("application/nquads",R.parse),ye.url=Y("./url"),ye.util=k,Object.assign(ye,k),ye.promises=ye,ye.RequestQueue=Y("./RequestQueue"),ye.JsonLdProcessor=Y("./JsonLdProcessor")(ye),j.setupGlobals(ye),j.setupDocumentLoaders(ye),ye},ne=function(){return me(function(){return ne()})};me(ne),Se.exports=ne},{"./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,Se,he){"use strict";const{isKeyword:W}=Y("./context"),j=Y("./graphTypes"),k=Y("./types"),Q=Y("./util"),H=Y("./JsonLdError"),w={};Se.exports=w,w.createMergedNodeMap=(C,R)=>{const T=(R=R||{}).issuer||new Q.IdentifierIssuer("_:b"),b={"@default":{}};return w.createNodeMap(C,b,"@default",T),w.mergeNodeMaps(b)},w.createNodeMap=(C,R,T,b,y,S)=>{if(k.isArray(C)){for(const X of C)w.createNodeMap(X,R,T,b,void 0,S);return}if(!k.isObject(C))return void(S&&S.push(C));if(j.isValue(C)){if("@type"in C){let X=C["@type"];0===X.indexOf("_:")&&(C["@type"]=X=b.getId(X))}return void(S&&S.push(C))}if(S&&j.isList(C)){const X=[];return w.createNodeMap(C["@list"],R,T,b,y,X),void S.push({"@list":X})}if("@type"in C){const X=C["@type"];for(const ue of X)0===ue.indexOf("_:")&&b.getId(ue)}k.isUndefined(y)&&(y=j.isBlankNode(C)?b.getId(C["@id"]):C["@id"]),S&&S.push({"@id":y});const A=R[T],z=A[y]=A[y]||{};z["@id"]=y;const P=Object.keys(C).sort();for(let X of P){if("@id"===X)continue;if("@reverse"===X){const I={"@id":y},O=C["@reverse"];for(const K in O){const E=O[K];for(const $ of E){let Z=$["@id"];j.isBlankNode($)&&(Z=b.getId(Z)),w.createNodeMap($,R,T,b,Z),Q.addValue(A[Z],K,I,{propertyIsArray:!0,allowDuplicate:!1})}}continue}if("@graph"===X){y in R||(R[y]={}),w.createNodeMap(C[X],R,y,b);continue}if("@included"===X){w.createNodeMap(C[X],R,T,b);continue}if("@type"!==X&&W(X)){if("@index"===X&&X in z&&(C[X]!==z[X]||C[X]["@id"]!==z[X]["@id"]))throw new H("Invalid JSON-LD syntax; conflicting @index property detected.","jsonld.SyntaxError",{code:"conflicting indexes",subject:z});z[X]=C[X];continue}const ue=C[X];if(0===X.indexOf("_:")&&(X=b.getId(X)),0!==ue.length)for(let I of ue)if("@type"===X&&(I=0===I.indexOf("_:")?b.getId(I):I),j.isSubject(I)||j.isSubjectReference(I)){if("@id"in I&&!I["@id"])continue;const O=j.isBlankNode(I)?b.getId(I["@id"]):I["@id"];Q.addValue(z,X,{"@id":O},{propertyIsArray:!0,allowDuplicate:!1}),w.createNodeMap(I,R,T,b,O)}else if(j.isValue(I))Q.addValue(z,X,I,{propertyIsArray:!0,allowDuplicate:!1});else if(j.isList(I)){const O=[];w.createNodeMap(I["@list"],R,T,b,y,O),I={"@list":O},Q.addValue(z,X,I,{propertyIsArray:!0,allowDuplicate:!1})}else w.createNodeMap(I,R,T,b,y),Q.addValue(z,X,I,{propertyIsArray:!0,allowDuplicate:!1});else Q.addValue(z,X,[],{propertyIsArray:!0})}},w.mergeNodeMapGraphs=C=>{const R={};for(const T of Object.keys(C).sort())for(const b of Object.keys(C[T]).sort()){const y=C[T][b];b in R||(R[b]={"@id":b});const S=R[b];for(const A of Object.keys(y).sort())if(W(A)&&"@type"!==A)S[A]=Q.clone(y[A]);else for(const z of y[A])Q.addValue(S,A,Q.clone(z),{propertyIsArray:!0,allowDuplicate:!1})}return R},w.mergeNodeMaps=C=>{const R=C["@default"],T=Object.keys(C).sort();for(const b of T){if("@default"===b)continue;const y=C[b];let S=R[b];S?"@graph"in S||(S["@graph"]=[]):R[b]=S={"@id":b,"@graph":[]};const A=S["@graph"];for(const z of Object.keys(y).sort()){const P=y[z];j.isSubjectReference(P)||A.push(P)}}return R}},{"./JsonLdError":12,"./context":19,"./graphTypes":25,"./types":30,"./util":32}],28:[function(Y,Se,he){"use strict";const W=Y("./documentLoaders/xhr"),j={};Se.exports=j,j.setupDocumentLoaders=function(k){"undefined"!=typeof XMLHttpRequest&&(k.documentLoaders.xhr=W,k.useDocumentLoader("xhr"))},j.setupGlobals=function(k){void 0===globalThis.JsonLdProcessor&&Object.defineProperty(globalThis,"JsonLdProcessor",{writable:!0,enumerable:!1,configurable:!0,value:k.JsonLdProcessor})}},{"./documentLoaders/xhr":20}],29:[function(Y,Se,he){"use strict";const{createNodeMap:W}=Y("./nodeMap"),{isKeyword:j}=Y("./context"),k=Y("./graphTypes"),Q=Y("canonicalize"),H=Y("./types"),w=Y("./util"),{RDF_FIRST:C,RDF_REST:R,RDF_NIL:T,RDF_TYPE:b,RDF_JSON_LITERAL:y,RDF_LANGSTRING:S,XSD_BOOLEAN:A,XSD_DOUBLE:z,XSD_INTEGER:P,XSD_STRING:X}=Y("./constants"),{isAbsolute:ue}=Y("./url"),I={};function O($,Z,ae,oe,te){const Te=Object.keys(Z).sort();for(const me of Te){const ne=Z[me],ye=Object.keys(ne).sort();for(let Oe of ye){const $e=ne[Oe];if("@type"===Oe)Oe=b;else if(j(Oe))continue;for(const st of $e){const Qe={termType:me.startsWith("_:")?"BlankNode":"NamedNode",value:me};if(!ue(me))continue;const tt={termType:Oe.startsWith("_:")?"BlankNode":"NamedNode",value:Oe};if(!ue(Oe)||"BlankNode"===tt.termType&&!te.produceGeneralizedRdf)continue;const Xe=E(st,oe,$,ae,te.rdfDirection);Xe&&$.push({subject:Qe,predicate:tt,object:Xe,graph:ae})}}}}function E($,Z,ae,oe,te){const Te={};if(k.isValue($)){Te.termType="Literal",Te.value=void 0,Te.datatype={termType:"NamedNode"};let me=$["@value"];const ne=$["@type"]||null;"@json"===ne?(Te.value=Q(me),Te.datatype.value=y):H.isBoolean(me)?(Te.value=me.toString(),Te.datatype.value=ne||A):H.isDouble(me)||ne===z?(H.isDouble(me)||(me=parseFloat(me)),Te.value=me.toExponential(15).replace(/(\d)0*e\+?/,"$1E"),Te.datatype.value=ne||z):H.isNumber(me)?(Te.value=me.toFixed(0),Te.datatype.value=ne||P):"i18n-datatype"===te&&"@direction"in $?(Te.datatype.value="https://www.w3.org/ns/i18n#"+($["@language"]||"")+`_${$["@direction"]}`,Te.value=me):"@language"in $?(Te.value=me,Te.datatype.value=ne||S,Te.language=$["@language"]):(Te.value=me,Te.datatype.value=ne||X)}else if(k.isList($)){const me=function($,Z,ae,oe,te){const Te={termType:"NamedNode",value:C},me={termType:"NamedNode",value:R},ne={termType:"NamedNode",value:T},ye=$.pop(),Oe=ye?{termType:"BlankNode",value:Z.getId()}:ne;let $e=Oe;for(const st of $){const Qe=E(st,Z,ae,oe,te),tt={termType:"BlankNode",value:Z.getId()};ae.push({subject:$e,predicate:Te,object:Qe,graph:oe}),ae.push({subject:$e,predicate:me,object:tt,graph:oe}),$e=tt}if(ye){const st=E(ye,Z,ae,oe,te);ae.push({subject:$e,predicate:Te,object:st,graph:oe}),ae.push({subject:$e,predicate:me,object:ne,graph:oe})}return Oe}($["@list"],Z,ae,oe,te);Te.termType=me.termType,Te.value=me.value}else{const me=H.isObject($)?$["@id"]:$;Te.termType=me.startsWith("_:")?"BlankNode":"NamedNode",Te.value=me}return"NamedNode"!==Te.termType||ue(Te.value)?Te:null}Se.exports=I,I.toRDF=($,Z)=>{const ae=new w.IdentifierIssuer("_:b"),oe={"@default":{}};W($,oe,"@default",ae);const te=[],Te=Object.keys(oe).sort();for(const me of Te){let ne;if("@default"===me)ne={termType:"DefaultGraph",value:""};else{if(!ue(me))continue;ne=me.startsWith("_:")?{termType:"BlankNode"}:{termType:"NamedNode"},ne.value=me}O(te,oe[me],ne,ae,Z)}return te}},{"./constants":18,"./context":19,"./graphTypes":25,"./nodeMap":27,"./types":30,"./url":31,"./util":32,canonicalize:7}],30:[function(Y,Se,he){"use strict";const W={};Se.exports=W,W.isArray=Array.isArray,W.isBoolean=j=>"boolean"==typeof j||"[object Boolean]"===Object.prototype.toString.call(j),W.isDouble=j=>W.isNumber(j)&&(-1!==String(j).indexOf(".")||Math.abs(j)>=1e21),W.isEmptyObject=j=>W.isObject(j)&&0===Object.keys(j).length,W.isNumber=j=>"number"==typeof j||"[object Number]"===Object.prototype.toString.call(j),W.isNumeric=j=>!isNaN(parseFloat(j))&&isFinite(j),W.isObject=j=>"[object Object]"===Object.prototype.toString.call(j),W.isString=j=>"string"==typeof j||"[object String]"===Object.prototype.toString.call(j),W.isUndefined=j=>void 0===j},{}],31:[function(Y,Se,he){"use strict";const W=Y("./types"),j={};Se.exports=j,j.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*))?))?(?:(((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/}},j.parse=(Q,H)=>{const w={},C=j.parsers[H||"full"],R=C.regex.exec(Q);let T=C.keys.length;for(;T--;)w[C.keys[T]]=void 0===R[T]?null:R[T];return("https"===w.scheme&&"443"===w.port||"http"===w.scheme&&"80"===w.port)&&(w.href=w.href.replace(":"+w.port,""),w.authority=w.authority.replace(":"+w.port,""),w.port=null),w.normalizedPath=j.removeDotSegments(w.path),w},j.prependBase=(Q,H)=>{if(null===Q||j.isAbsolute(H))return H;(!Q||W.isString(Q))&&(Q=j.parse(Q||""));const w=j.parse(H),C={protocol:Q.protocol||""};if(null!==w.authority)C.authority=w.authority,C.path=w.path,C.query=w.query;else if(C.authority=Q.authority,""===w.path)C.path=Q.path,C.query=null!==w.query?w.query:Q.query;else{if(0===w.path.indexOf("/"))C.path=w.path;else{let T=Q.path;T=T.substr(0,T.lastIndexOf("/")+1),(T.length>0||Q.authority)&&"/"!==T.substr(-1)&&(T+="/"),T+=w.path,C.path=T}C.query=w.query}""!==w.path&&(C.path=j.removeDotSegments(C.path));let R=C.protocol;return null!==C.authority&&(R+="//"+C.authority),R+=C.path,null!==C.query&&(R+="?"+C.query),null!==w.fragment&&(R+="#"+w.fragment),""===R&&(R="./"),R},j.removeBase=(Q,H)=>{if(null===Q)return H;(!Q||W.isString(Q))&&(Q=j.parse(Q||""));let w="";if(""!==Q.href?w+=(Q.protocol||"")+"//"+(Q.authority||""):H.indexOf("//")&&(w+="//"),0!==H.indexOf(w))return H;const C=j.parse(H.substr(w.length)),R=Q.normalizedPath.split("/"),T=C.normalizedPath.split("/"),b=C.fragment||C.query?0:1;for(;R.length>0&&T.length>b&&R[0]===T[0];)R.shift(),T.shift();let y="";if(R.length>0){R.pop();for(let S=0;S{if(0===Q.length)return"";const H=Q.split("/"),w=[];for(;H.length>0;){const C=H.shift(),R=0===H.length;"."!==C?".."!==C?w.push(C):(w.pop(),R&&w.push("")):R&&w.push("")}return"/"===Q[0]&&w.length>0&&""!==w[0]&&w.unshift(""),1===w.length&&""===w[0]?"/":w.join("/")};const k=/^([A-Za-z][A-Za-z0-9+-.]*|_):[^\s]*$/;j.isAbsolute=Q=>W.isString(Q)&&k.test(Q),j.isRelative=Q=>W.isString(Q)},{"./types":30}],32:[function(Y,Se,he){"use strict";const W=Y("./graphTypes"),j=Y("./types"),k=Y("rdf-canonize").IdentifierIssuer,Q=Y("./JsonLdError"),H=/(?:<[^>]*?>|"[^"]*?"|[^,])+/g,w=/\s*<([^>]*?)>\s*(?:;\s*(.*))?/,C=/(.*?)=(?:(?:"([^"]*?)")|([^"]*?))\s*(?:(?:;\s*)|$)/g,R_headers={accept:"application/ld+json, application/json"},T={};function b(y,S){if(j.isArray(S))for(let A=0;A{if(Object.keys(y).some(A=>"accept"===A.toLowerCase()))throw new RangeError('Accept header may not be specified; only "'+R_headers.accept+'" is supported.');return Object.assign({Accept:R_headers.accept},y)},T.parseLinkHeader=y=>{const S={},A=y.match(H);for(let z=0;z{if(!(j.isString(y)||j.isArray(y)&&y.every(A=>j.isString(A)))){if(S&&j.isObject(y))switch(Object.keys(y).length){case 0:return;case 1:if("@default"in y&&T.asArray(y["@default"]).every(A=>j.isString(A)))return}throw new Q('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,S)=>{if(y.hasOwnProperty(S)){const A=y[S];return!j.isArray(A)||A.length>0}return!1},T.hasValue=(y,S,A)=>{if(T.hasProperty(y,S)){let z=y[S];const P=W.isList(z);if(j.isArray(z)||P){P&&(z=z["@list"]);for(let X=0;X{if("propertyIsArray"in(z=z||{})||(z.propertyIsArray=!1),"valueIsArray"in z||(z.valueIsArray=!1),"allowDuplicate"in z||(z.allowDuplicate=!0),"prependValue"in z||(z.prependValue=!1),z.valueIsArray)y[S]=A;else if(j.isArray(A)){0===A.length&&z.propertyIsArray&&!y.hasOwnProperty(S)&&(y[S]=[]),z.prependValue&&(A=A.concat(y[S]),y[S]=[]);for(let P=0;P[].concat(y[S]||[]),T.removeProperty=(y,S)=>{delete y[S]},T.removeValue=(y,S,A,z)=>{"propertyIsArray"in(z=z||{})||(z.propertyIsArray=!1);const P=T.getValues(y,S).filter(X=>!T.compareValues(X,A));0===P.length?T.removeProperty(y,S):y[S]=1!==P.length||z.propertyIsArray?P:P[0]},T.relabelBlankNodes=(y,S)=>b((S=S||{}).issuer||new k("_:b"),y),T.compareValues=(y,S)=>!!(y===S||W.isValue(y)&&W.isValue(S)&&y["@value"]===S["@value"]&&y["@type"]===S["@type"]&&y["@language"]===S["@language"]&&y["@index"]===S["@index"])||!!(j.isObject(y)&&"@id"in y&&j.isObject(S)&&"@id"in S)&&y["@id"]===S["@id"],T.compareShortestLeast=(y,S)=>y.length1;const z=(K,E,$)=>{const Z=K[b].get(E);if(Z){const ae=Z.value;if(P(K,ae)){if(ue(K,Z),!K[H])return}else $&&(K[y]&&(Z.value.now=Date.now()),K[T].unshiftNode(Z));return ae.value}},P=(K,E)=>{if(!E||!E.maxAge&&!K[w])return!1;const $=Date.now()-E.now;return E.maxAge?$>E.maxAge:K[w]&&$>K[w]},X=K=>{if(K[k]>K[j])for(let E=K[T].tail;K[k]>K[j]&&null!==E;){const $=E.prev;ue(K,E),E=$}},ue=(K,E)=>{if(E){const $=E.value;K[C]&&K[C]($.key,$.value),K[k]-=$.length,K[b].delete($.key),K[T].removeNode(E)}};class I{constructor(E,$,Z,ae,oe){this.key=E,this.value=$,this.length=Z,this.now=ae,this.maxAge=oe||0}}const O=(K,E,$,Z)=>{let ae=$.value;P(K,ae)&&(ue(K,$),K[H]||(ae=void 0)),ae&&E.call(Z,ae.value,ae.key,K)};Se.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[j]=E.max||1/0;const Z=E.length||S;if(this[Q]="function"!=typeof Z?S:Z,this[H]=E.stale||!1,E.maxAge&&"number"!=typeof E.maxAge)throw new TypeError("maxAge must be a number");this[w]=E.maxAge||0,this[C]=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[j]=E||1/0,X(this)}get max(){return this[j]}set allowStale(E){this[H]=!!E}get allowStale(){return this[H]}set maxAge(E){if("number"!=typeof E)throw new TypeError("maxAge must be a non-negative number");this[w]=E,X(this)}get maxAge(){return this[w]}set lengthCalculator(E){"function"!=typeof E&&(E=S),E!==this[Q]&&(this[Q]=E,this[k]=0,this[T].forEach($=>{$.length=this[Q]($.value,$.key),this[k]+=$.length})),X(this)}get lengthCalculator(){return this[Q]}get length(){return this[k]}get itemCount(){return this[T].length}rforEach(E,$){$=$||this;for(let Z=this[T].tail;null!==Z;){const ae=Z.prev;O(this,E,Z,$),Z=ae}}forEach(E,$){$=$||this;for(let Z=this[T].head;null!==Z;){const ae=Z.next;O(this,E,Z,$),Z=ae}}keys(){return this[T].toArray().map(E=>E.key)}values(){return this[T].toArray().map(E=>E.value)}reset(){this[C]&&this[T]&&this[T].length&&this[T].forEach(E=>this[C](E.key,E.value)),this[b]=new Map,this[T]=new W,this[k]=0}dump(){return this[T].map(E=>!P(this,E)&&{k:E.key,v:E.value,e:E.now+(E.maxAge||0)}).toArray().filter(E=>E)}dumpLru(){return this[T]}set(E,$,Z){if((Z=Z||this[w])&&"number"!=typeof Z)throw new TypeError("maxAge must be a number");const ae=Z?Date.now():0,oe=this[Q]($,E);if(this[b].has(E)){if(oe>this[j])return ue(this,this[b].get(E)),!1;const me=this[b].get(E).value;return this[C]&&(this[R]||this[C](E,me.value)),me.now=ae,me.maxAge=Z,me.value=$,this[k]+=oe-me.length,me.length=oe,this.get(E),X(this),!0}const te=new I(E,$,oe,ae,Z);return te.length>this[j]?(this[C]&&this[C](E,$),!1):(this[k]+=te.length,this[T].unshift(te),this[b].set(E,this[T].head),X(this),!0)}has(E){if(!this[b].has(E))return!1;const $=this[b].get(E).value;return!P(this,$)}get(E){return z(this,E,!0)}peek(E){return z(this,E,!1)}pop(){const E=this[T].tail;return E?(ue(this,E),E.value):null}del(E){ue(this,this[b].get(E))}load(E){this.reset();const $=Date.now();for(let Z=E.length-1;Z>=0;Z--){const ae=E[Z],oe=ae.e||0;if(0===oe)this.set(ae.k,ae.v);else{const te=oe-$;te>0&&this.set(ae.k,ae.v,te)}}}prune(){this[b].forEach((E,$)=>z(this,$,!1))}}},{yallist:92}],34:[function(Y,Se,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#",j="http://www.w3.org/2001/XMLSchema#",k="http://www.w3.org/2000/10/swap/";he.default={xsd:{decimal:`${j}decimal`,boolean:`${j}boolean`,double:`${j}double`,integer:`${j}integer`,string:`${j}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:`${k}reify#forSome`,forAll:`${k}reify#forAll`},log:{implies:`${k}log#implies`}}},{}],35:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.default=he.Variable=he.Triple=he.Term=he.Quad=he.NamedNode=he.Literal=he.DefaultGraph=he.BlankNode=void 0,he.escapeQuotes=E,he.termFromId=function I(ne,ye){if(ye=ye||b,!ne)return ye.defaultGraph();switch(ne[0]){case"?":return ye.variable(ne.substr(1));case"_":return ye.blankNode(ne.substr(2));case'"':if(ye===b)return new z(ne);if('"'===ne[ne.length-1])return ye.literal(ne.substr(1,ne.length-2));const Oe=ne.lastIndexOf('"',ne.length-1);return ye.literal(ne.substr(1,Oe-1),"@"===ne[Oe+1]?ne.substr(Oe+2):ye.namedNode(ne.substr(Oe+3)));case"<":const $e=T.exec(ne);return ye.quad(I($($e[1]),ye),I($($e[2]),ye),I($($e[3]),ye),$e[4]&&I($($e[4]),ye));default:return ye.namedNode(ne)}},he.termToId=function O(ne){if("string"==typeof ne)return ne;if(ne instanceof S&&"Quad"!==ne.termType)return ne.id;if(!ne)return w.id;switch(ne.termType){case"NamedNode":return ne.value;case"BlankNode":return`_:${ne.value}`;case"Variable":return`?${ne.value}`;case"DefaultGraph":return"";case"Literal":return`"${ne.value}"${ne.language?`@${ne.language}`:ne.datatype&&ne.datatype.value!==H.string?`^^${ne.datatype.value}`:""}`;case"Quad":return`<<${E(O(ne.subject))} ${E(O(ne.predicate))} ${E(O(ne.object))}${(0,j.isDefaultGraph)(ne.graph)?"":` ${O(ne.graph)}`}>>`;default:throw new Error(`Unexpected termType: ${ne.termType}`)}},he.unescapeQuotes=$;var ne,W=(ne=Y("./IRIs"))&&ne.__esModule?ne:{default:ne},j=Y("./N3Util");const{rdf:Q,xsd:H}=W.default;let w,C=0;const R=/^"(.*".*)(?="[^"]*$)/,T=/^<<("(?:""|[^"])*"[^ ]*|[^ ]+) ("(?:""|[^"])*"[^ ]*|[^ ]+) ("(?:""|[^"])*"[^ ]*|[^ ]+) ?("(?:""|[^"])*"[^ ]*|[^ ]+)?>>$/,b={namedNode:function(ne){return new A(ne)},blankNode:function(ne){return new P(ne||"n3-"+C++)},variable:function(ne){return new X(ne)},literal:function(ne,ye){if("string"==typeof ye)return new z(`"${ne}"@${ye.toLowerCase()}`);let Oe=ye?ye.value:"";return""===Oe&&("boolean"==typeof ne?Oe=H.boolean:"number"==typeof ne&&(Number.isFinite(ne)?Oe=Number.isInteger(ne)?H.integer:H.double:(Oe=H.double,Number.isNaN(ne)||(ne=ne>0?"INF":"-INF")))),new z(""===Oe||Oe===H.string?`"${ne}"`:`"${ne}"^^${Oe}`)},defaultGraph:function(){return w},quad:me,triple:me};he.default=b;class S{constructor(ye){this.id=ye}get value(){return this.id}equals(ye){return ye instanceof S?this.id===ye.id:!!ye&&this.termType===ye.termType&&this.value===ye.value}hashCode(){return 0}toJSON(){return{termType:this.termType,value:this.value}}}he.Term=S;class A extends S{get termType(){return"NamedNode"}}he.NamedNode=A;class z extends S{get termType(){return"Literal"}get value(){return this.id.substring(1,this.id.lastIndexOf('"'))}get language(){const ye=this.id;let Oe=ye.lastIndexOf('"')+1;return Oe`"${Oe.replace(/"/g,'""')}`)}function $(ne){return ne.replace(R,(ye,Oe)=>`"${Oe.replace(/""/g,'"')}`)}function me(ne,ye,Oe,$e){return new K(ne,ye,Oe,$e)}he.Triple=he.Quad=K},{"./IRIs":34,"./N3Util":41}],36:[function(Y,Se,he){(function(W){(function(){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.default=void 0;var j=Q(Y("./IRIs")),k=Q(Y("queue-microtask"));function Q(S){return S&&S.__esModule?S:{default:S}}const{xsd:H}=j.default,w=/\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{8})|\\([^])/g,C={"\\":"\\","'":"'",'"':'"',n:"\n",r:"\r",t:"\t",f:"\f",b:"\b",_:"_","~":"~",".":".","-":"-","!":"!",$:"$","&":"&","(":"(",")":")","*":"*","+":"+",",":",",";":";","=":"=","/":"/","?":"?","#":"#","@":"@","%":"%"},R=/[\x00-\x20<>\\"\{\}\|\^\`]/,T={_iri:!0,_unescapedIri:!0,_simpleQuotedString:!0,_langcode:!0,_blank:!0,_newline:!0,_comment:!0,_whitespace:!0,_endOfFile:!0},b=/$0^/;he.default=class{constructor(A){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=!!(A=A||{}).lineMode){this._n3Mode=!1;for(const z in this)!(z in T)&&this[z]instanceof RegExp&&(this[z]=b)}else this._n3Mode=!1!==A.n3;this._comments=!!A.comments,this._literalClosingPos=0}_tokenizeToEnd(A,z){let P=this._input,X=P.length;for(;;){let O,K;for(;O=this._newline.exec(P);)this._comments&&(K=this._comment.exec(O[0]))&&ue("comment",K[1],"",this._line,O[0].length),P=P.substr(O[0].length,P.length),X=P.length,this._line++;if(!O&&(O=this._whitespace.exec(P))&&(P=P.substr(O[0].length,P.length)),this._endOfFile.test(P))return z&&(this._comments&&(K=this._comment.exec(P))&&ue("comment",K[1],"",this._line,P.length),P=null,ue("eof","","",this._line,0)),this._input=P;const E=this._line,$=P[0];let Z="",ae="",oe="",te=null,Te=0,me=!1;switch($){case"^":if(P.length<3)break;if("^"!==P[1]){this._n3Mode&&(Te=1,Z="^");break}if(this._previousMarker="^^",P=P.substr(2),"<"!==P[0]){me=!0;break}case"<":if(te=this._unescapedIri.exec(P))Z="IRI",ae=te[1];else if(te=this._iri.exec(P)){if(ae=this._unescape(te[1]),null===ae||R.test(ae))return I(this);Z="IRI"}else P.length>1&&"<"===P[1]?(Z="<<",Te=2):this._n3Mode&&P.length>1&&"="===P[1]&&(Z="inverse",Te=2,ae=">");break;case">":P.length>1&&">"===P[1]&&(Z=">>",Te=2);break;case"_":((te=this._blank.exec(P))||z&&(te=this._blank.exec(`${P} `)))&&(Z="blank",oe="_",ae=te[1]);break;case'"':if(te=this._simpleQuotedString.exec(P))ae=te[1];else if(({value:ae,matchLength:Te}=this._parseLiteral(P)),null===ae)return I(this);(null!==te||0!==Te)&&(Z="literal",this._literalClosingPos=0);break;case"'":if(!this._lineMode){if(te=this._simpleApostropheString.exec(P))ae=te[1];else if(({value:ae,matchLength:Te}=this._parseLiteral(P)),null===ae)return I(this);(null!==te||0!==Te)&&(Z="literal",this._literalClosingPos=0)}break;case"?":this._n3Mode&&(te=this._variable.exec(P))&&(Z="var",ae=te[0]);break;case"@":"literal"===this._previousMarker&&(te=this._langcode.exec(P))?(Z="langcode",ae=te[1]):(te=this._keyword.exec(P))&&(Z=te[0]);break;case".":if(1===P.length?z:P[1]<"0"||P[1]>"9"){Z=".",Te=1;break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"+":case"-":(te=this._number.exec(P)||z&&(te=this._number.exec(`${P} `)))&&(Z="literal",ae=te[0],oe="string"==typeof te[1]?H.double:"string"==typeof te[2]?H.decimal:H.integer);break;case"B":case"b":case"p":case"P":case"G":case"g":(te=this._sparqlKeyword.exec(P))?Z=te[0].toUpperCase():me=!0;break;case"f":case"t":(te=this._boolean.exec(P))?(Z="literal",ae=te[0],oe=H.boolean):me=!0;break;case"a":(te=this._shortPredicates.exec(P))?(Z="abbreviation",ae="a"):me=!0;break;case"=":this._n3Mode&&P.length>1&&(Z="abbreviation",">"!==P[1]?(Te=1,ae="="):(Te=2,ae=">"));break;case"!":if(!this._n3Mode)break;case",":case";":case"[":case"]":case"(":case")":case"{":case"}":this._lineMode||(Te=1,Z=$);break;default:me=!0}if(me&&("@prefix"!==this._previousMarker&&"PREFIX"!==this._previousMarker||!(te=this._prefix.exec(P))?((te=this._prefixed.exec(P))||z&&(te=this._prefixed.exec(`${P} `)))&&(Z="prefixed",oe=te[1]||"",ae=this._unescape(te[2])):(Z="prefix",ae=te[1]||"")),"^^"===this._previousMarker)switch(Z){case"prefixed":Z="type";break;case"IRI":Z="typeIRI";break;default:Z=""}if(!Z)return z||!/^'''|^"""/.test(P)&&/\n|\r/.test(P)?I(this):this._input=P;const ne=Te||te[0].length,ye=ue(Z,ae,oe,E,ne);this.previousToken=ye,this._previousMarker=Z,P=P.substr(ne,P.length)}function ue(O,K,E,$,Z){const ae=P?X-P.length:X,te={type:O,value:K,prefix:E,line:$,start:ae,end:ae+Z};return A(null,te),te}function I(O){A(O._syntaxError(/^\S*/.exec(P)[0]))}}_unescape(A){let z=!1;const P=A.replace(w,(X,ue,I,O)=>{if("string"==typeof ue)return String.fromCharCode(Number.parseInt(ue,16));if("string"==typeof I){let K=Number.parseInt(I,16);return K<=65535?String.fromCharCode(Number.parseInt(I,16)):String.fromCharCode(55296+((K-=65536)>>10),56320+(1023&K))}return O in C?C[O]:(z=!0,"")});return z?null:P}_parseLiteral(A){if(A.length>=3){const z=A.match(/^(?:"""|"|'''|'|)/)[0],P=z.length;let X=Math.max(this._literalClosingPos,P);for(;(X=A.indexOf(z,X))>0;){let ue=0;for(;"\\"===A[X-ue-1];)ue++;if(ue%2==0){const I=A.substring(P,X),O=I.split(/\r\n|\r|\n/).length-1,K=X+P;if(1===P&&0!==O||3===P&&this._lineMode)break;return this._line+=O,{value:this._unescape(I),matchLength:K}}X++}this._literalClosingPos=A.length-P+1}return{value:"",matchLength:0}}_syntaxError(A){this._input=null;const z=new Error(`Unexpected "${A}" on line ${this._line}.`);return z.context={token:void 0,line:this._line,previousToken:this.previousToken},z}_readStartingBom(A){return A.startsWith("\ufeff")?A.substr(1):A}tokenize(A,z){if(this._line=1,"string"==typeof A){if(this._input=this._readStartingBom(A),"function"!=typeof z){const P=[];let X;if(this._tokenizeToEnd((ue,I)=>ue?X=ue:P.push(I),!0),X)throw X;return P}(0,k.default)(()=>this._tokenizeToEnd(z,!0))}else this._pendingBuffer=null,"function"==typeof A.setEncoding&&A.setEncoding("utf8"),A.on("data",P=>{null!==this._input&&0!==P.length&&(this._pendingBuffer&&(P=W.concat([this._pendingBuffer,P]),this._pendingBuffer=null),128&P[P.length-1]?this._pendingBuffer=P:(void 0===this._input?this._input=this._readStartingBom("string"==typeof P?P:P.toString()):this._input+=P,this._tokenizeToEnd(z,!1)))}),A.on("end",()=>{"string"==typeof this._input&&this._tokenizeToEnd(z,!0)}),A.on("error",z)}}}).call(this)}).call(this,Y("buffer").Buffer)},{"./IRIs":34,buffer:6,"queue-microtask":45}],37:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.default=void 0;var W=Q(Y("./N3Lexer")),j=Q(Y("./N3DataFactory")),k=Q(Y("./IRIs"));function Q(T){return T&&T.__esModule?T:{default:T}}let H=0;class w{constructor(b){this._contextStack=[],this._graph=null,this._setBase((b=b||{}).baseIRI),b.factory&&R(this,b.factory);const y="string"==typeof b.format?b.format.match(/\w*$/)[0].toLowerCase():"",S=/turtle/.test(y),A=/trig/.test(y),z=/triple/.test(y),P=/quad/.test(y),X=this._n3Mode=/n3/.test(y),ue=z||P;(this._supportsNamedGraphs=!(S||X))||(this._readPredicateOrNamedGraph=this._readPredicate),this._supportsQuads=!(S||A||z||X),this._supportsRDFStar=""===y||/star|\*$/.test(y),ue&&(this._resolveRelativeIRI=I=>null),this._blankNodePrefix="string"!=typeof b.blankNodePrefix?"":b.blankNodePrefix.replace(/^(?!_:)/,"_:"),this._lexer=b.lexer||new W.default({lineMode:ue,n3:X}),this._explicitQuantifiers=!!b.explicitQuantifiers}static _resetBlankNodePrefix(){H=0}_setBase(b){if(b){const y=b.indexOf("#");y>=0&&(b=b.substr(0,y)),this._base=b,this._basePath=b.indexOf("/")<0?b:b.replace(/[^\/?]*(?:\?.*)?$/,""),b=b.match(/^(?:([a-z][a-z0-9+.-]*:))?(?:\/\/[^\/]*)?/i),this._baseRoot=b[0],this._baseScheme=b[1]}else this._base="",this._basePath=""}_saveContext(b,y,S,A,z){const P=this._n3Mode;this._contextStack.push({subject:S,predicate:A,object:z,graph:y,type:b,inverse:!!P&&this._inversePredicate,blankPrefix:P?this._prefixes._:"",quantified:P?this._quantified:null}),P&&(this._inversePredicate=!1,this._prefixes._=this._graph?`${this._graph.id.substr(2)}.`:".",this._quantified=Object.create(this._quantified))}_restoreContext(){const b=this._contextStack.pop(),y=this._n3Mode;this._subject=b.subject,this._predicate=b.predicate,this._object=b.object,this._graph=b.graph,y&&(this._inversePredicate=b.inverse,this._prefixes._=b.blankPrefix,this._quantified=b.quantified)}_readInTopContext(b){switch(b.type){case"eof":return null!==this._graph?this._error("Unclosed graph",b):(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(b)}}_readEntity(b,y){let S;switch(b.type){case"IRI":case"typeIRI":const A=this._resolveIRI(b.value);if(null===A)return this._error("Invalid IRI",b);S=this._namedNode(A);break;case"type":case"prefixed":const z=this._prefixes[b.prefix];if(void 0===z)return this._error(`Undefined prefix "${b.prefix}:"`,b);S=this._namedNode(z+b.value);break;case"blank":S=this._blankNode(this._prefixes[b.prefix]+b.value);break;case"var":S=this._variable(b.value.substr(1));break;default:return this._error(`Expected entity but got ${b.type}`,b)}return!y&&this._n3Mode&&S.id in this._quantified&&(S=this._quantified[S.id]),S}_readSubject(b){switch(this._predicate=null,b.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",b);case"}":return this._readPunctuation(b);case"@forSome":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORSOME,this._quantifier=this._blankNode,this._readQuantifierList):this._error('Unexpected "@forSome"',b);case"@forAll":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORALL,this._quantifier=this._variable,this._readQuantifierList):this._error('Unexpected "@forAll"',b);case"literal":if(!this._n3Mode)return this._error("Unexpected literal",b);if(0===b.prefix.length)return this._literalValue=b.value,this._completeSubjectLiteral;this._subject=this._literal(b.value,this._namedNode(b.prefix));break;case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,null,null,null),this._graph=null,this._readSubject):this._error("Unexpected RDF* syntax",b);default:if(void 0===(this._subject=this._readEntity(b)))return;if(this._n3Mode)return this._getPathReader(this._readPredicateOrNamedGraph)}return this._readPredicateOrNamedGraph}_readPredicate(b){const y=b.type;switch(y){case"inverse":this._inversePredicate=!0;case"abbreviation":this._predicate=this.ABBREVIATIONS[b.value];break;case".":case"]":case"}":return null===this._predicate?this._error(`Unexpected ${y}`,b):(this._subject=null,"]"===y?this._readBlankNodeTail(b):this._readPunctuation(b));case";":return null!==this._predicate?this._readPredicate:this._error("Expected predicate but got ;",b);case"[":if(this._n3Mode)return this._saveContext("blank",this._graph,this._subject,this._subject=this._blankNode(),null),this._readBlankNodeHead;case"blank":if(!this._n3Mode)return this._error("Disallowed blank node as predicate",b);default:if(void 0===(this._predicate=this._readEntity(b)))return}return this._readObject}_readObject(b){switch(b.type){case"literal":if(0===b.prefix.length)return this._literalValue=b.value,this._readDataTypeOrLang;this._object=this._literal(b.value,this._namedNode(b.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",b);case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,this._subject,this._predicate,null),this._graph=null,this._readSubject):this._error("Unexpected RDF* syntax",b);default:if(void 0===(this._object=this._readEntity(b)))return;if(this._n3Mode)return this._getPathReader(this._getContextEndReader())}return this._getContextEndReader()}_readPredicateOrNamedGraph(b){return"{"===b.type?this._readGraph(b):this._readPredicate(b)}_readGraph(b){return"{"!==b.type?this._error(`Expected graph but got ${b.type}`,b):(this._graph=this._subject,this._subject=null,this._readSubject)}_readBlankNodeHead(b){return"]"===b.type?(this._subject=null,this._readBlankNodeTail(b)):(this._predicate=null,this._readPredicate(b))}_readBlankNodeTail(b){if("]"!==b.type)return this._readBlankNodePunctuation(b);null!==this._subject&&this._emit(this._subject,this._predicate,this._object,this._graph);const y=null===this._predicate;return this._restoreContext(),null!==this._object?this._getContextEndReader():null!==this._predicate?this._readObject:y?this._readPredicateOrNamedGraph:this._readPredicateAfterBlank}_readPredicateAfterBlank(b){switch(b.type){case".":case"}":return this._subject=null,this._readPunctuation(b);default:return this._readPredicate(b)}}_readListItem(b){let y=null,S=null,A=this._readListItem;const z=this._subject,P=this._contextStack,X=P[P.length-1];switch(b.type){case"[":this._saveContext("blank",this._graph,S=this._blankNode(),this.RDF_FIRST,this._subject=y=this._blankNode()),A=this._readBlankNodeHead;break;case"(":this._saveContext("list",this._graph,S=this._blankNode(),this.RDF_FIRST,this.RDF_NIL),this._subject=null;break;case")":if(this._restoreContext(),0!==P.length&&"list"===P[P.length-1].type&&this._emit(this._subject,this._predicate,this._object,this._graph),null===this._predicate){if(A=this._readPredicate,this._subject===this.RDF_NIL)return A}else if(A=this._getContextEndReader(),this._object===this.RDF_NIL)return A;S=this.RDF_NIL;break;case"literal":0===b.prefix.length?(this._literalValue=b.value,A=this._readListItemDataTypeOrLang):(y=this._literal(b.value,this._namedNode(b.prefix)),A=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",b);default:if(void 0===(y=this._readEntity(b)))return}if(null===S&&(this._subject=S=this._blankNode()),null===z?null===X.predicate?X.subject=S:X.object=S:this._emit(z,this.RDF_REST,S,this._graph),null!==y){if(this._n3Mode&&("IRI"===b.type||"prefixed"===b.type))return this._saveContext("item",this._graph,S,this.RDF_FIRST,y),this._subject=y,this._predicate=null,this._getPathReader(this._readListItem);this._emit(S,this.RDF_FIRST,y,this._graph)}return A}_readDataTypeOrLang(b){return this._completeObjectLiteral(b,!1)}_readListItemDataTypeOrLang(b){return this._completeObjectLiteral(b,!0)}_completeLiteral(b){let y=this._literal(this._literalValue);switch(b.type){case"type":case"typeIRI":const S=this._readEntity(b);if(void 0===S)return;y=this._literal(this._literalValue,S),b=null;break;case"langcode":y=this._literal(this._literalValue,b.value),b=null}return{token:b,literal:y}}_completeSubjectLiteral(b){return this._subject=this._completeLiteral(b).literal,this._readPredicateOrNamedGraph}_completeObjectLiteral(b,y){const S=this._completeLiteral(b);if(S)return this._object=S.literal,y&&this._emit(this._subject,this.RDF_FIRST,this._object,this._graph),null===S.token?this._getContextEndReader():(this._readCallback=this._getContextEndReader(),this._readCallback(S.token))}_readFormulaTail(b){return"}"!==b.type?this._readPunctuation(b):(null!==this._subject&&this._emit(this._subject,this._predicate,this._object,this._graph),this._restoreContext(),null===this._object?this._readPredicate:this._getContextEndReader())}_readPunctuation(b){let y,S=this._graph;const A=this._subject,z=this._inversePredicate;switch(b.type){case"}":if(null===this._graph)return this._error("Unexpected graph closing",b);if(this._n3Mode)return this._readFormulaTail(b);this._graph=null;case".":this._subject=null,y=this._contextStack.length?this._readSubject:this._readInTopContext,z&&(this._inversePredicate=!1);break;case";":y=this._readPredicate;break;case",":y=this._readObject;break;default:if(this._supportsQuads&&null===this._graph&&void 0!==(S=this._readEntity(b))){y=this._readQuadPunctuation;break}return this._error(`Expected punctuation to follow "${this._object.id}"`,b)}if(null!==A){const P=this._predicate,X=this._object;z?this._emit(X,P,A,S):this._emit(A,P,X,S)}return y}_readBlankNodePunctuation(b){let y;switch(b.type){case";":y=this._readPredicate;break;case",":y=this._readObject;break;default:return this._error(`Expected punctuation to follow "${this._object.id}"`,b)}return this._emit(this._subject,this._predicate,this._object,this._graph),y}_readQuadPunctuation(b){return"."!==b.type?this._error("Expected dot to follow quad",b):this._readInTopContext}_readPrefix(b){return"prefix"!==b.type?this._error("Expected prefix to follow @prefix",b):(this._prefix=b.value,this._readPrefixIRI)}_readPrefixIRI(b){if("IRI"!==b.type)return this._error(`Expected IRI to follow prefix "${this._prefix}:"`,b);const y=this._readEntity(b);return this._prefixes[this._prefix]=y.value,this._prefixCallback(this._prefix,y),this._readDeclarationPunctuation}_readBaseIRI(b){const y="IRI"===b.type&&this._resolveIRI(b.value);return y?(this._setBase(y),this._readDeclarationPunctuation):this._error("Expected valid IRI to follow base declaration",b)}_readNamedGraphLabel(b){switch(b.type){case"IRI":case"blank":case"prefixed":return this._readSubject(b),this._readGraph;case"[":return this._readNamedGraphBlankLabel;default:return this._error("Invalid graph label",b)}}_readNamedGraphBlankLabel(b){return"]"!==b.type?this._error("Invalid graph label",b):(this._subject=this._blankNode(),this._readGraph)}_readDeclarationPunctuation(b){return this._sparqlStyle?(this._sparqlStyle=!1,this._readInTopContext(b)):"."!==b.type?this._error("Expected declaration to end with a dot",b):this._readInTopContext}_readQuantifierList(b){let y;switch(b.type){case"IRI":case"prefixed":if(void 0!==(y=this._readEntity(b,!0)))break;default:return this._error(`Unexpected ${b.type}`,b)}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(b){return","===b.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(b))}_getPathReader(b){return this._afterPath=b,this._readPath}_readPath(b){switch(b.type){case"!":return this._readForwardPath;case"^":return this._readBackwardPath;default:const y=this._contextStack,S=y.length&&y[y.length-1];if(S&&"item"===S.type){const A=this._subject;this._restoreContext(),this._emit(this._subject,this.RDF_FIRST,A,this._graph)}return this._afterPath(b)}}_readForwardPath(b){let y,S;const A=this._blankNode();if(void 0!==(S=this._readEntity(b)))return null===this._predicate?(y=this._subject,this._subject=A):(y=this._object,this._object=A),this._emit(y,S,A,this._graph),this._readPath}_readBackwardPath(b){const y=this._blankNode();let S,A;if(void 0!==(S=this._readEntity(b)))return null===this._predicate?(A=this._subject,this._subject=y):(A=this._object,this._object=y),this._emit(y,S,A,this._graph),this._readPath}_readRDFStarTailOrGraph(b){return">>"!==b.type?this._supportsQuads&&null===this._graph&&void 0!==(this._graph=this._readEntity(b))?this._readRDFStarTail:this._error(`Expected >> to follow "${this._object.id}"`,b):this._readRDFStarTail(b)}_readRDFStarTail(b){if(">>"!==b.type)return this._error(`Expected >> but got ${b.type}`,b);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 b=this._contextStack;if(!b.length)return this._readPunctuation;switch(b[b.length-1].type){case"blank":return this._readBlankNodeTail;case"list":return this._readListItem;case"formula":return this._readFormulaTail;case"<<":return this._readRDFStarTailOrGraph}}_emit(b,y,S,A){this._callback(null,this._quad(b,y,S,A||this.DEFAULTGRAPH))}_error(b,y){const S=new Error(`${b} on line ${y.line}.`);S.context={token:y,line:y.line,previousToken:this._lexer.previousToken},this._callback(S),this._callback=C}_resolveIRI(b){return/^[a-z][a-z0-9+.-]*:/i.test(b)?b:this._resolveRelativeIRI(b)}_resolveRelativeIRI(b){if(!b.length)return this._base;switch(b[0]){case"#":return this._base+b;case"?":return this._base.replace(/(?:\?.*)?$/,b);case"/":return("/"===b[1]?this._baseScheme:this._baseRoot)+this._removeDotSegments(b);default:return/^[^/:]*:/.test(b)?null:this._removeDotSegments(this._basePath+b)}}_removeDotSegments(b){if(!/(^|\/)\.\.?($|[/#?])/.test(b))return b;const y=b.length;let S="",A=-1,z=-1,P=0,X="/";for(;A=z&&(S=S.substr(0,P)),"/"!==X)return`${S}/${b.substr(A+1)}`;P=A+1}}}X=b[++A]}return S+b.substring(P)}parse(b,y,S){if(this._readCallback=this._readInTopContext,this._sparqlStyle=!1,this._prefixes=Object.create(null),this._prefixes._=this._blankNodePrefix?this._blankNodePrefix.substr(2):`b${H++}_`,this._prefixCallback=S||C,this._inversePredicate=!1,this._quantified=Object.create(null),!y){const A=[];let z;if(this._callback=(P,X)=>{P?z=P:X&&A.push(X)},this._lexer.tokenize(b).every(P=>this._readCallback=this._readCallback(P)),z)throw z;return A}this._callback=y,this._lexer.tokenize(b,(A,z)=>{null!==A?(this._callback(A),this._callback=C):this._readCallback&&(this._readCallback=this._readCallback(z))})}}function C(){}function R(T,b){const y=b.namedNode;T._namedNode=y,T._blankNode=b.blankNode,T._literal=b.literal,T._variable=b.variable,T._quad=b.quad,T.DEFAULTGRAPH=b.defaultGraph(),T.RDF_FIRST=y(k.default.rdf.first),T.RDF_REST=y(k.default.rdf.rest),T.RDF_NIL=y(k.default.rdf.nil),T.N3_FORALL=y(k.default.r.forAll),T.N3_FORSOME=y(k.default.r.forSome),T.ABBREVIATIONS={a:y(k.default.rdf.type),"=":y(k.default.owl.sameAs),">":y(k.default.log.implies)},T.QUANTIFIERS_GRAPH=y("urn:n3:quantifiers")}he.default=w,R(w.prototype,j.default)},{"./IRIs":34,"./N3DataFactory":35,"./N3Lexer":36}],38:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.default=void 0;var b,W=function(b,y){if(!y&&b&&b.__esModule)return b;if(null===b||"object"!=typeof b&&"function"!=typeof b)return{default:b};var S=H(y);if(S&&S.has(b))return S.get(b);var A={},z=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var P in b)if("default"!==P&&Object.prototype.hasOwnProperty.call(b,P)){var X=z?Object.getOwnPropertyDescriptor(b,P):null;X&&(X.get||X.set)?Object.defineProperty(A,P,X):A[P]=b[P]}return A.default=b,S&&S.set(b,A),A}(Y("./N3DataFactory")),j=Y("readable-stream"),k=(b=Y("./IRIs"))&&b.__esModule?b:{default:b};function H(b){if("function"!=typeof WeakMap)return null;var y=new WeakMap,S=new WeakMap;return(H=function(A){return A?S:y})(b)}class C{constructor(y,S){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,!S&&y&&!y[0]&&(S=y,y=null),this._factory=(S=S||{}).factory||W.default,y&&this.addQuads(y)}get size(){let y=this._size;if(null!==y)return y;y=0;const S=this._graphs;let A,z;for(const P in S)for(const X in A=S[P].subjects)for(const ue in z=A[X])y+=Object.keys(z[ue]).length;return this._size=y}_addToIndex(y,S,A,z){const P=y[S]||(y[S]={}),X=P[A]||(P[A]={}),ue=z in X;return ue||(X[z]=null),!ue}_removeFromIndex(y,S,A,z){const P=y[S],X=P[A];delete X[z];for(const ue in X)return;delete P[A];for(const ue in P)return;delete y[S]}*_findInIndex(y,S,A,z,P,X,ue,I){let O,K,E;const Z=!S+!A+!z>1?Object.keys(this._ids):this._entities,ae=(0,W.termFromId)(I,this._factory);S&&((O=y,y={})[S]=O[S]);for(const oe in y){const te=Z[oe];if(K=y[oe]){A&&((O=K,K={})[A]=O[A]);for(const Te in K){const me=Z[Te];if(E=K[Te]){const ne=z?z in E?[z]:[]:Object.keys(E);for(let ye=0;ye{A in S||(S[A]=!0,y((0,W.termFromId)(this._entities[A],this._factory)))}}add(y){return this.addQuad(y),this}addQuad(y,S,A,z){S||(z=y.graph,A=y.object,S=y.predicate,y=y.subject),y=(0,W.termToId)(y),S=(0,W.termToId)(S),A=(0,W.termToId)(A),z=(0,W.termToId)(z);let P=this._graphs[z];P||(P=this._graphs[z]={subjects:{},predicates:{},objects:{}},Object.freeze(P));const X=this._ids,ue=this._entities;y=X[y]||(X[ue[++this._id]=y]=this._id),S=X[S]||(X[ue[++this._id]=S]=this._id),A=X[A]||(X[ue[++this._id]=A]=this._id);const I=this._addToIndex(P.subjects,y,S,A);return this._addToIndex(P.predicates,S,A,y),this._addToIndex(P.objects,A,y,S),this._size=null,I}addQuads(y){for(let S=0;S{this.addQuad(S)}),y}removeQuad(y,S,A,z){S||(z=y.graph,A=y.object,S=y.predicate,y=y.subject),y=(0,W.termToId)(y),S=(0,W.termToId)(S),A=(0,W.termToId)(A),z=(0,W.termToId)(z);const P=this._ids,X=this._graphs;let ue,I,O;if(!((y=P[y])&&(S=P[S])&&(A=P[A])&&(ue=X[z])&&(I=ue.subjects[y])&&(O=I[S])&&A in O))return!1;for(y in this._removeFromIndex(ue.subjects,y,S,A),this._removeFromIndex(ue.predicates,S,A,y),this._removeFromIndex(ue.objects,A,y,S),null!==this._size&&this._size--,ue.subjects)return!0;return delete X[z],!0}removeQuads(y){for(let S=0;S{this.removeQuad(S)}),y}removeMatches(y,S,A,z){const P=new j.Readable({objectMode:!0});return P._read=()=>{for(const X of this.readQuads(y,S,A,z))P.push(X);P.push(null)},this.remove(P)}deleteGraph(y){return this.removeMatches(null,null,null,y)}getQuads(y,S,A,z){return[...this.readQuads(y,S,A,z)]}*readQuads(y,S,A,z){y=y&&(0,W.termToId)(y),S=S&&(0,W.termToId)(S),A=A&&(0,W.termToId)(A),z=z&&(0,W.termToId)(z);const P=this._getGraphs(z),X=this._ids;let ue,I,O,K;if(!(R(y)&&!(I=X[y])||R(S)&&!(O=X[S])||R(A)&&!(K=X[A])))for(const E in P)(ue=P[E])&&(I?K?yield*this._findInIndex(ue.objects,K,I,O,"object","subject","predicate",E,null,!0):yield*this._findInIndex(ue.subjects,I,O,null,"subject","predicate","object",E,null,!0):O?yield*this._findInIndex(ue.predicates,O,K,null,"predicate","object","subject",E,null,!0):K?yield*this._findInIndex(ue.objects,K,null,null,"object","subject","predicate",E,null,!0):yield*this._findInIndex(ue.subjects,null,null,null,"subject","predicate","object",E,null,!0))}match(y,S,A,z){return new T(this,y,S,A,z)}countQuads(y,S,A,z){y=y&&(0,W.termToId)(y),S=S&&(0,W.termToId)(S),A=A&&(0,W.termToId)(A),z=z&&(0,W.termToId)(z);const P=this._getGraphs(z),X=this._ids;let I,O,K,E,ue=0;if(R(y)&&!(O=X[y])||R(S)&&!(K=X[S])||R(A)&&!(E=X[A]))return 0;for(const $ in P)(I=P[$])&&(ue+=y?A?this._countInIndex(I.objects,E,O,K):this._countInIndex(I.subjects,O,K,E):S?this._countInIndex(I.predicates,K,E,O):this._countInIndex(I.objects,E,O,K));return ue}forEach(y,S,A,z,P){this.some(X=>(y(X),!1),S,A,z,P)}every(y,S,A,z,P){let X=!1;const ue=!this.some(I=>(X=!0,!y(I)),S,A,z,P);return X&&ue}some(y,S,A,z,P){for(const X of this.readQuads(S,A,z,P))if(y(X))return!0;return!1}getSubjects(y,S,A){const z=[];return this.forSubjects(P=>{z.push(P)},y,S,A),z}forSubjects(y,S,A,z){S=S&&(0,W.termToId)(S),A=A&&(0,W.termToId)(A),z=z&&(0,W.termToId)(z);const P=this._ids,X=this._getGraphs(z);let ue,I,O;if(y=this._uniqueEntities(y),!(R(S)&&!(I=P[S])||R(A)&&!(O=P[A])))for(z in X)(ue=X[z])&&(I?O?this._loopBy2Keys(ue.predicates,I,O,y):this._loopByKey1(ue.subjects,I,y):O?this._loopByKey0(ue.objects,O,y):this._loop(ue.subjects,y))}getPredicates(y,S,A){const z=[];return this.forPredicates(P=>{z.push(P)},y,S,A),z}forPredicates(y,S,A,z){S=S&&(0,W.termToId)(S),A=A&&(0,W.termToId)(A),z=z&&(0,W.termToId)(z);const P=this._ids,X=this._getGraphs(z);let ue,I,O;if(y=this._uniqueEntities(y),!(R(S)&&!(I=P[S])||R(A)&&!(O=P[A])))for(z in X)(ue=X[z])&&(I?O?this._loopBy2Keys(ue.objects,O,I,y):this._loopByKey0(ue.subjects,I,y):O?this._loopByKey1(ue.predicates,O,y):this._loop(ue.predicates,y))}getObjects(y,S,A){const z=[];return this.forObjects(P=>{z.push(P)},y,S,A),z}forObjects(y,S,A,z){S=S&&(0,W.termToId)(S),A=A&&(0,W.termToId)(A),z=z&&(0,W.termToId)(z);const P=this._ids,X=this._getGraphs(z);let ue,I,O;if(y=this._uniqueEntities(y),!(R(S)&&!(I=P[S])||R(A)&&!(O=P[A])))for(z in X)(ue=X[z])&&(I?O?this._loopBy2Keys(ue.subjects,I,O,y):this._loopByKey1(ue.objects,I,y):O?this._loopByKey0(ue.predicates,O,y):this._loop(ue.objects,y))}getGraphs(y,S,A){const z=[];return this.forGraphs(P=>{z.push(P)},y,S,A),z}forGraphs(y,S,A,z){for(const P in this._graphs)this.some(X=>(y(X.graph),!0),S,A,z,P)}createBlankNode(y){let S,A;if(y)for(S=y=`_:${y}`,A=1;this._ids[S];)S=y+A++;else do{S="_:b"+this._blankNodeIndex++}while(this._ids[S]);return this._ids[S]=++this._id,this._entities[this._id]=S,this._factory.blankNode(S.substr(2))}extractLists({remove:y=!1,ignoreErrors:S=!1}={}){const A={},z=S?()=>!0:(ue,I)=>{throw new Error(`${ue.value} ${I}`)},P=this.getQuads(null,k.default.rdf.rest,k.default.rdf.nil,null),X=y?[...P]:[];return P.forEach(ue=>{const I=[];let K,E,O=!1;const $=ue.graph;let Z=ue.subject;for(;Z&&!O;){const ae=this.getQuads(null,null,Z,null),oe=this.getQuads(Z,null,null,null);let te,Te=null,me=null,ne=null;for(let ye=0;ye{switch(b){case"data":R=y;break;case"end":T=y}}},(b,y)=>{b&&this.emit("error",b)||y&&this.push(y)},(b,y)=>{this.emit("prefix",b,y)}),this._transform=(b,y,S)=>{R(b),S()},this._flush=b=>{T(),b()}}import(w){return w.on("data",C=>{this.write(C)}),w.on("end",()=>{this.end()}),w.on("error",C=>{this.emit("error",C)}),this}}},{"./N3Parser":37,"readable-stream":81}],40:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.default=void 0;var H,W=Y("readable-stream"),j=(H=Y("./N3Writer"))&&H.__esModule?H:{default:H};he.default=class extends W.Transform{constructor(w){super({encoding:"utf8",writableObjectMode:!0});const C=this._writer=new j.default({write:(R,T,b)=>{this.push(R),b&&b()},end:R=>{this.push(null),R&&R()}},w);this._transform=(R,T,b)=>{C.addQuad(R,b)},this._flush=R=>{C.end(R)}}import(w){return w.on("data",C=>{this.write(C)}),w.on("end",()=>{this.end()}),w.on("error",C=>{this.emit("error",C)}),w.on("prefix",(C,R)=>{this._writer.addPrefix(C,R)}),this}}},{"./N3Writer":42,"readable-stream":81}],41:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.inDefaultGraph=function(y){return C(y.graph)},he.isBlankNode=function(y){return!!y&&"BlankNode"===y.termType},he.isDefaultGraph=C,he.isLiteral=function(y){return!!y&&"Literal"===y.termType},he.isNamedNode=function(y){return!!y&&"NamedNode"===y.termType},he.isVariable=function(y){return!!y&&"Variable"===y.termType},he.prefix=function(y,S){return b({"":y.value||y},S)("")},he.prefixes=b;var y,W=(y=Y("./N3DataFactory"))&&y.__esModule?y:{default:y};function C(y){return!!y&&"DefaultGraph"===y.termType}function b(y,S){const A=Object.create(null);for(const P in y)z(P,y[P]);function z(P,X){if("string"==typeof X){const ue=Object.create(null);A[P]=I=>ue[I]||(ue[I]=S.namedNode(X+I))}else if(!(P in A))throw new Error(`Unknown prefix: ${P}`);return A[P]}return S=S||W.default,z}},{"./N3DataFactory":35}],42:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.default=void 0;var ue,W=(ue=Y("./IRIs"))&&ue.__esModule?ue:{default:ue},j=function(ue,I){if(!I&&ue&&ue.__esModule)return ue;if(null===ue||"object"!=typeof ue&&"function"!=typeof ue)return{default:ue};var O=Q(I);if(O&&O.has(ue))return O.get(ue);var K={},E=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var $ in ue)if("default"!==$&&Object.prototype.hasOwnProperty.call(ue,$)){var Z=E?Object.getOwnPropertyDescriptor(ue,$):null;Z&&(Z.get||Z.set)?Object.defineProperty(K,$,Z):K[$]=ue[$]}return K.default=ue,O&&O.set(ue,K),K}(Y("./N3DataFactory")),k=Y("./N3Util");function Q(ue){if("function"!=typeof WeakMap)return null;var I=new WeakMap,O=new WeakMap;return(Q=function(K){return K?O:I})(ue)}const C=j.default.defaultGraph(),{rdf:R,xsd:T}=W.default,b=/["\\\t\n\r\b\f\u0000-\u0019\ud800-\udbff]/,y=/["\\\t\n\r\b\f\u0000-\u0019]|[\ud800-\udbff][\udc00-\udfff]/g,S={"\\":"\\\\",'"':'\\"',"\t":"\\t","\n":"\\n","\r":"\\r","\b":"\\b","\f":"\\f"};class A extends j.Term{equals(){return!1}}function P(ue){let I=S[ue];return void 0===I&&(1===ue.length?(I=ue.charCodeAt(0).toString(16),I="\\u0000".substr(0,6-I.length)+I):(I=(1024*(ue.charCodeAt(0)-55296)+ue.charCodeAt(1)+9216).toString(16),I="\\U00000000".substr(0,10-I.length)+I)),I}function X(ue){return ue.replace(/[\]\/\(\)\*\+\?\.\\\$]/g,"\\$&")}he.default=class{constructor(I,O){if(this._prefixRegex=/$0^/,I&&"function"!=typeof I.write&&(O=I,I=null),this._lists=(O=O||{}).lists,I)this._outputStream=I,this._endStream=void 0===O.end||!!O.end;else{let K="";this._outputStream={write(E,$,Z){K+=E,Z&&Z()},end:E=>{E&&E(null,K)}},this._endStream=!0}this._subject=null,/triple|quad/i.test(O.format)?(this._lineMode=!0,this._writeQuad=this._writeQuadLine):(this._lineMode=!1,this._graph=C,this._prefixIRIs=Object.create(null),O.prefixes&&this.addPrefixes(O.prefixes),O.baseIRI&&(this._baseMatcher=new RegExp(`^${X(O.baseIRI)}${O.baseIRI.endsWith("/")?"":"[#?]"}`),this._baseLength=O.baseIRI.length))}get _inDefaultGraph(){return C.equals(this._graph)}_write(I,O){this._outputStream.write(I,"utf8",O)}_writeQuad(I,O,K,E,$){try{E.equals(this._graph)||(this._write((null===this._subject?"":this._inDefaultGraph?".\n":"\n}\n")+(C.equals(E)?"":`${this._encodeIriOrBlank(E)} {\n`)),this._graph=E,this._subject=null),I.equals(this._subject)?O.equals(this._predicate)?this._write(`, ${this._encodeObject(K)}`,$):this._write(`;\n ${this._encodePredicate(this._predicate=O)} ${this._encodeObject(K)}`,$):this._write(`${(null===this._subject?"":".\n")+this._encodeSubject(this._subject=I)} ${this._encodePredicate(this._predicate=O)} ${this._encodeObject(K)}`,$)}catch(Z){$&&$(Z)}}_writeQuadLine(I,O,K,E,$){delete this._prefixMatch,this._write(this.quadToString(I,O,K,E),$)}quadToString(I,O,K,E){return`${this._encodeSubject(I)} ${this._encodeIriOrBlank(O)} ${this._encodeObject(K)}${E&&E.value?` ${this._encodeIriOrBlank(E)} .\n`:" .\n"}`}quadsToString(I){return I.map(O=>this.quadToString(O.subject,O.predicate,O.object,O.graph)).join("")}_encodeSubject(I){return"Quad"===I.termType?this._encodeQuad(I):this._encodeIriOrBlank(I)}_encodeIriOrBlank(I){if("NamedNode"!==I.termType)return this._lists&&I.value in this._lists&&(I=this.list(this._lists[I.value])),"id"in I?I.id:`_:${I.value}`;let O=I.value;this._baseMatcher&&this._baseMatcher.test(O)&&(O=O.substr(this._baseLength)),b.test(O)&&(O=O.replace(y,P));const K=this._prefixRegex.exec(O);return K?K[1]?this._prefixIRIs[K[1]]+K[2]:O:`<${O}>`}_encodeLiteral(I){let O=I.value;if(b.test(O)&&(O=O.replace(y,P)),I.language)return`"${O}"@${I.language}`;if(this._lineMode){if(I.datatype.value===T.string)return`"${O}"`}else switch(I.datatype.value){case T.string:return`"${O}"`;case T.boolean:if("true"===O||"false"===O)return O;break;case T.integer:if(/^[+-]?\d+$/.test(O))return O;break;case T.decimal:if(/^[+-]?\d*\.\d+$/.test(O))return O;break;case T.double:if(/^[+-]?(?:\d+\.\d*|\.?\d+)[eE][+-]?\d+$/.test(O))return O}return`"${O}"^^${this._encodeIriOrBlank(I.datatype)}`}_encodePredicate(I){return I.value===R.type?"a":this._encodeIriOrBlank(I)}_encodeObject(I){switch(I.termType){case"Quad":return this._encodeQuad(I);case"Literal":return this._encodeLiteral(I);default:return this._encodeIriOrBlank(I)}}_encodeQuad({subject:I,predicate:O,object:K,graph:E}){return`<<${this._encodeSubject(I)} ${this._encodePredicate(O)} ${this._encodeObject(K)}${(0,k.isDefaultGraph)(E)?"":` ${this._encodeIriOrBlank(E)}`}>>`}_blockedWrite(){throw new Error("Cannot write because the writer has been closed.")}addQuad(I,O,K,E,$){void 0===K?this._writeQuad(I.subject,I.predicate,I.object,I.graph,O):"function"==typeof E?this._writeQuad(I,O,K,C,E):this._writeQuad(I,O,K,E||C,$)}addQuads(I){for(let O=0;O.\n`)}if(K){let E="",$="";for(const Z in this._prefixIRIs)E+=E?`|${Z}`:Z,$+=($?"|":"")+this._prefixIRIs[Z];E=X(E),this._prefixRegex=new RegExp(`^(?:${$})[^/]*$|^(${E})([a-zA-Z][\\-_a-zA-Z0-9]*)$`)}this._write(K?"\n":"",O)}blank(I,O){let E,$,K=I;switch(void 0===I?K=[]:I.termType?K=[{predicate:I,object:O}]:"length"in I||(K=[I]),$=K.length){case 0:return new A("[]");case 1:if(E=K[0],!(E.object instanceof A))return new A(`[ ${this._encodePredicate(E.predicate)} ${this._encodeObject(E.object)} ]`);default:let Z="[";for(let ae=0;ae<$;ae++)E=K[ae],E.predicate.equals(I)?Z+=`, ${this._encodeObject(E.object)}`:(Z+=`${(ae?";\n ":"\n ")+this._encodePredicate(E.predicate)} ${this._encodeObject(E.object)}`,I=E.predicate);return new A(`${Z}\n]`)}}list(I){const O=I&&I.length||0,K=new Array(O);for(let E=0;E{O=null,I(K,E)});if(this._endStream)try{return this._outputStream.end(O)}catch(K){}O&&O()}}},{"./IRIs":34,"./N3DataFactory":35,"./N3Util":41}],43:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),Object.defineProperty(he,"BlankNode",{enumerable:!0,get:function(){return R.BlankNode}}),Object.defineProperty(he,"DataFactory",{enumerable:!0,get:function(){return R.default}}),Object.defineProperty(he,"DefaultGraph",{enumerable:!0,get:function(){return R.DefaultGraph}}),Object.defineProperty(he,"Lexer",{enumerable:!0,get:function(){return W.default}}),Object.defineProperty(he,"Literal",{enumerable:!0,get:function(){return R.Literal}}),Object.defineProperty(he,"NamedNode",{enumerable:!0,get:function(){return R.NamedNode}}),Object.defineProperty(he,"Parser",{enumerable:!0,get:function(){return j.default}}),Object.defineProperty(he,"Quad",{enumerable:!0,get:function(){return R.Quad}}),Object.defineProperty(he,"Store",{enumerable:!0,get:function(){return Q.default}}),Object.defineProperty(he,"StreamParser",{enumerable:!0,get:function(){return H.default}}),Object.defineProperty(he,"StreamWriter",{enumerable:!0,get:function(){return w.default}}),Object.defineProperty(he,"Term",{enumerable:!0,get:function(){return R.Term}}),Object.defineProperty(he,"Triple",{enumerable:!0,get:function(){return R.Triple}}),he.Util=void 0,Object.defineProperty(he,"Variable",{enumerable:!0,get:function(){return R.Variable}}),Object.defineProperty(he,"Writer",{enumerable:!0,get:function(){return k.default}}),he.default=void 0,Object.defineProperty(he,"termFromId",{enumerable:!0,get:function(){return R.termFromId}}),Object.defineProperty(he,"termToId",{enumerable:!0,get:function(){return R.termToId}});var W=y(Y("./N3Lexer")),j=y(Y("./N3Parser")),k=y(Y("./N3Writer")),Q=y(Y("./N3Store")),H=y(Y("./N3StreamParser")),w=y(Y("./N3StreamWriter")),C=b(Y("./N3Util"));he.Util=C;var R=b(Y("./N3DataFactory"));function T(A){if("function"!=typeof WeakMap)return null;var z=new WeakMap,P=new WeakMap;return(T=function(X){return X?P:z})(A)}function b(A,z){if(!z&&A&&A.__esModule)return A;if(null===A||"object"!=typeof A&&"function"!=typeof A)return{default:A};var P=T(z);if(P&&P.has(A))return P.get(A);var X={},ue=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var I in A)if("default"!==I&&Object.prototype.hasOwnProperty.call(A,I)){var O=ue?Object.getOwnPropertyDescriptor(A,I):null;O&&(O.get||O.set)?Object.defineProperty(X,I,O):X[I]=A[I]}return X.default=A,P&&P.set(A,X),X}function y(A){return A&&A.__esModule?A:{default:A}}he.default={Lexer:W.default,Parser:j.default,Writer:k.default,Store:Q.default,StreamParser:H.default,StreamWriter:w.default,Util:C,DataFactory:R.default,Term:R.Term,NamedNode:R.NamedNode,Literal:R.Literal,BlankNode:R.BlankNode,Variable:R.Variable,DefaultGraph:R.DefaultGraph,Quad:R.Quad,Triple:R.Triple,termFromId:R.termFromId,termToId:R.termToId}},{"./N3DataFactory":35,"./N3Lexer":36,"./N3Parser":37,"./N3Store":38,"./N3StreamParser":39,"./N3StreamWriter":40,"./N3Util":41,"./N3Writer":42}],44:[function(Y,Se,he){var j,k,W=Se.exports={};function Q(){throw new Error("setTimeout has not been defined")}function H(){throw new Error("clearTimeout has not been defined")}function w(X){if(j===setTimeout)return setTimeout(X,0);if((j===Q||!j)&&setTimeout)return j=setTimeout,setTimeout(X,0);try{return j(X,0)}catch(ue){try{return j.call(null,X,0)}catch(I){return j.call(this,X,0)}}}!function(){try{j="function"==typeof setTimeout?setTimeout:Q}catch(X){j=Q}try{k="function"==typeof clearTimeout?clearTimeout:H}catch(X){k=H}}();var b,R=[],T=!1,y=-1;function S(){!T||!b||(T=!1,b.length?R=b.concat(R):y=-1,R.length&&A())}function A(){if(!T){var X=w(S);T=!0;for(var ue=R.length;ue;){for(b=R,R=[];++y1)for(var I=1;I(j||(j=Promise.resolve())).then(k).catch(Q=>setTimeout(()=>{throw Q},0))}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],46:[function(Y,Se,he){Se.exports=Y("./lib")},{"./lib":55}],47:[function(Y,Se,he){"use strict";Se.exports=class kq{constructor(j,k=new Map,Q=0){this.prefix=j,this._existing=k,this.counter=Q}clone(){const{prefix:j,_existing:k,counter:Q}=this;return new kq(j,new Map(k),Q)}getId(j){const k=j&&this._existing.get(j);if(k)return k;const Q=this.prefix+this.counter;return this.counter++,j&&this._existing.set(j,Q),Q}hasId(j){return this._existing.has(j)}getOldIds(){return[...this._existing.keys()]}}},{}],48:[function(Y,Se,he){"use strict";Y("setimmediate");const W=self.crypto||self.msCrypto;Se.exports=class{constructor(k){if(!W||!W.subtle)throw new Error("crypto.subtle not found.");if("sha256"===k)this.algorithm={name:"SHA-256"};else{if("sha1"!==k)throw new Error(`Unsupport algorithm "${k}".`);this.algorithm={name:"SHA-1"}}this._content=""}update(k){this._content+=k}digest(){var k=this;return yt(function*(){const Q=(new TextEncoder).encode(k._content),H=new Uint8Array(yield W.subtle.digest(k.algorithm,Q));let w="";for(let C=0;C]*)>)|(_:(?:[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]*$'),Se.exports=class nF{static parse(X){const ue=[],I={},O=X.split(T.eoln);let K=0;for(const E of O){if(K++,T.empty.test(E))continue;const $=E.match(T.quad);if(null===$)throw new Error("N-Quads parse error on line "+K+".");const Z={subject:null,predicate:null,object:null,graph:null};if(Z.subject=void 0!==$[1]?{termType:H,value:$[1]}:{termType:w,value:$[2]},Z.predicate={termType:H,value:$[3]},void 0!==$[4]?Z.object={termType:H,value:$[4]}:void 0!==$[5]?Z.object={termType:w,value:$[5]}:(Z.object={termType:C,value:void 0,datatype:{termType:H}},void 0!==$[7]?Z.object.datatype.value=$[7]:void 0!==$[8]?(Z.object.datatype.value=k,Z.object.language=$[8]):Z.object.datatype.value=Q,Z.object.value=$[6].replace(A,function(X,ue,I,O){if(ue)switch(ue){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(I)return String.fromCharCode(parseInt(I,16));if(O)throw new Error("Unsupported U escape")})),Z.graph=void 0!==$[9]?{termType:H,value:$[9]}:void 0!==$[10]?{termType:w,value:$[10]}:{termType:R,value:""},Z.graph.value in I){let ae=!0;const oe=I[Z.graph.value];for(const te of oe)if(b(te,Z)){ae=!1;break}ae&&(oe.push(Z),ue.push(Z))}else I[Z.graph.value]=[Z],ue.push(Z)}return ue}static serialize(X){Array.isArray(X)||(X=nF.legacyDatasetToQuads(X));const ue=[];for(const I of X)ue.push(nF.serializeQuad(I));return ue.sort().join("")}static serializeQuad(X){const ue=X.subject,O=X.object,K=X.graph;let E="";return E+=ue.termType===H?`<${ue.value}>`:`${ue.value}`,E+=` <${X.predicate.value}> `,O.termType===H?E+=`<${O.value}>`:O.termType===w?E+=O.value:(E+=`"${P=O.value,P.replace(y,function(X){switch(X){case'"':return'\\"';case"\\":return"\\\\";case"\n":return"\\n";case"\r":return"\\r"}})}"`,O.datatype.value===k?O.language&&(E+=`@${O.language}`):O.datatype.value!==Q&&(E+=`^^<${O.datatype.value}>`)),K.termType===H?E+=` <${K.value}>`:K.termType===w&&(E+=` ${K.value}`),E+=" .\n",E;var P}static legacyDatasetToQuads(X){const ue=[],I={"blank node":w,IRI:H,literal:C};for(const O in X)X[O].forEach(E=>{const $={};for(const Z in E){const ae=E[Z],oe={termType:I[ae.type],value:ae.value};oe.termType===C&&(oe.datatype={termType:H},"datatype"in ae&&(oe.datatype.value=ae.datatype),"language"in ae?("datatype"in ae||(oe.datatype.value=k),oe.language=ae.language):"datatype"in ae||(oe.datatype.value=Q)),$[Z]=oe}$.graph="@default"===O?{termType:R,value:""}:{termType:O.startsWith("_:")?w:H,value:O},ue.push($)});return ue}};const y=/["\\\n\r]/g;const A=/(?:\\([tbnrf"'\\]))|(?:\\u([0-9A-Fa-f]{4}))|(?:\\U([0-9A-Fa-f]{8}))/g},{}],50:[function(Y,Se,he){"use strict";Se.exports=class{constructor(j){this.current=j.sort(),this.done=!1,this.dir=new Map;for(let k=0;kH)&&(b&&R>0&&T>j[R-1]||!b&&Rj[R+1])&&(H=T,w=R)}if(null===H)this.done=!0;else{const R=k.get(H)?w-1:w+1;j[w]=j[R],j[R]=H;for(const T of j)T>H&&k.set(T,!k.get(T))}return Q}}},{}],51:[function(Y,Se,he){(function(W){(function(){"use strict";const j=Y("./IdentifierIssuer"),k=Y("./MessageDigest"),Q=Y("./Permuter"),H=Y("./NQuads");function w(C,R){return C.hashR.hash?1:0}Se.exports=class{constructor(){this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new j("_:c14n"),this.hashAlgorithm="sha256",this.quads=null}main(R){var T=this;return yt(function*(){T.quads=R;for(const X of R)T._addBlankNodeQuadInfo({quad:X,component:X.subject}),T._addBlankNodeQuadInfo({quad:X,component:X.object}),T._addBlankNodeQuadInfo({quad:X,component:X.graph});const b=new Map,y=[...T.blankNodeInfo.keys()];let S=0;for(const X of y)++S%100==0&&(yield T._yield()),yield T._hashAndTrackBlankNode({id:X,hashToBlankNodes:b});const A=[...b.keys()].sort(),z=[];for(const X of A){const ue=b.get(X);ue.length>1?z.push(ue):T.canonicalIssuer.getId(ue[0])}for(const X of z){const ue=[];for(const I of X){if(T.canonicalIssuer.hasId(I))continue;const O=new j("_:b");O.getId(I);const K=yield T.hashNDegreeQuads(I,O);ue.push(K)}ue.sort(w);for(const I of ue){const O=I.issuer.getOldIds();for(const K of O)T.canonicalIssuer.getId(K)}}const P=[];for(const X of T.quads){const ue=ot({},X);ue.subject=T._useCanonicalId({component:ue.subject}),ue.object=T._useCanonicalId({component:ue.object}),ue.graph=T._useCanonicalId({component:ue.graph}),P.push(H.serializeQuad(ue))}return P.sort(),P.join("")})()}hashFirstDegreeQuads(R){var T=this;return yt(function*(){const b=[],y=T.blankNodeInfo.get(R),S=y.quads;for(const z of S){const P={subject:null,predicate:z.predicate,object:null,graph:null};P.subject=T.modifyFirstDegreeComponent(R,z.subject,"subject"),P.object=T.modifyFirstDegreeComponent(R,z.object,"object"),P.graph=T.modifyFirstDegreeComponent(R,z.graph,"graph"),b.push(H.serializeQuad(P))}b.sort();const A=new k(T.hashAlgorithm);for(const z of b)A.update(z);return y.hash=yield A.digest(),y.hash})()}hashRelatedBlankNode(R,T,b,y){var S=this;return yt(function*(){let A;A=S.canonicalIssuer.hasId(R)?S.canonicalIssuer.getId(R):b.hasId(R)?b.getId(R):S.blankNodeInfo.get(R).hash;const z=new k(S.hashAlgorithm);return z.update(y),"g"!==y&&z.update(S.getRelatedPredicate(T)),z.update(A),z.digest()})()}hashNDegreeQuads(R,T){var b=this;return yt(function*(){const y=new k(b.hashAlgorithm),S=yield b.createHashToRelated(R,T),A=[...S.keys()].sort();for(const z of A){y.update(z);let X,P="";const ue=new Q(S.get(z));let I=0;for(;ue.hasNext();){const O=ue.next();++I%3==0&&(yield b._yield());let K=T.clone(),E="";const $=[];let Z=!1;for(const ae of O)if(b.canonicalIssuer.hasId(ae)?E+=b.canonicalIssuer.getId(ae):(K.hasId(ae)||$.push(ae),E+=K.getId(ae)),0!==P.length&&E>P){Z=!0;break}if(!Z){for(const ae of $){const oe=yield b.hashNDegreeQuads(ae,K);if(E+=K.getId(ae),E+=`<${oe.hash}>`,K=oe.issuer,0!==P.length&&E>P){Z=!0;break}}Z||(0===P.length||E`}createHashToRelated(R,T){var b=this;return yt(function*(){const y=new Map,S=b.blankNodeInfo.get(R).quads;let A=0;for(const z of S)++A%100==0&&(yield b._yield()),yield Promise.all([b._addRelatedBlankNodeHash({quad:z,component:z.subject,position:"s",id:R,issuer:T,hashToRelated:y}),b._addRelatedBlankNodeHash({quad:z,component:z.object,position:"o",id:R,issuer:T,hashToRelated:y}),b._addRelatedBlankNodeHash({quad:z,component:z.graph,position:"g",id:R,issuer:T,hashToRelated:y})]);return y})()}_hashAndTrackBlankNode({id:R,hashToBlankNodes:T}){var b=this;return yt(function*(){const y=yield b.hashFirstDegreeQuads(R),S=T.get(y);S?S.push(R):T.set(y,[R])})()}_addBlankNodeQuadInfo({quad:R,component:T}){if("BlankNode"!==T.termType)return;const b=T.value,y=this.blankNodeInfo.get(b);y?y.quads.add(R):this.blankNodeInfo.set(b,{quads:new Set([R]),hash:null})}_addRelatedBlankNodeHash({quad:R,component:T,position:b,id:y,issuer:S,hashToRelated:A}){var z=this;return yt(function*(){if("BlankNode"!==T.termType||T.value===y)return;const P=T.value,X=yield z.hashRelatedBlankNode(P,R,S,b),ue=A.get(X);ue?ue.push(P):A.set(X,[P])})()}_useCanonicalId({component:R}){return"BlankNode"!==R.termType||R.value.startsWith(this.canonicalIssuer.prefix)?R:{termType:"BlankNode",value:this.canonicalIssuer.getId(R.value)}}_yield(){return yt(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,Se,he){"use strict";const W=Y("./IdentifierIssuer"),j=Y("./MessageDigest"),k=Y("./Permuter"),Q=Y("./NQuads");function H(w,C){return w.hashC.hash?1:0}Se.exports=class{constructor(){this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new W("_:c14n"),this.hashAlgorithm="sha256",this.quads=null}main(C){this.quads=C;for(const A of C)this._addBlankNodeQuadInfo({quad:A,component:A.subject}),this._addBlankNodeQuadInfo({quad:A,component:A.object}),this._addBlankNodeQuadInfo({quad:A,component:A.graph});const R=new Map,T=[...this.blankNodeInfo.keys()];for(const A of T)this._hashAndTrackBlankNode({id:A,hashToBlankNodes:R});const b=[...R.keys()].sort(),y=[];for(const A of b){const z=R.get(A);z.length>1?y.push(z):this.canonicalIssuer.getId(z[0])}for(const A of y){const z=[];for(const P of A){if(this.canonicalIssuer.hasId(P))continue;const X=new W("_:b");X.getId(P);const ue=this.hashNDegreeQuads(P,X);z.push(ue)}z.sort(H);for(const P of z){const X=P.issuer.getOldIds();for(const ue of X)this.canonicalIssuer.getId(ue)}}const S=[];for(const A of this.quads){const z=ot({},A);z.subject=this._useCanonicalId({component:z.subject}),z.object=this._useCanonicalId({component:z.object}),z.graph=this._useCanonicalId({component:z.graph}),S.push(Q.serializeQuad(z))}return S.sort(),S.join("")}hashFirstDegreeQuads(C){const R=[],T=this.blankNodeInfo.get(C),b=T.quads;for(const S of b){const A={subject:null,predicate:S.predicate,object:null,graph:null};A.subject=this.modifyFirstDegreeComponent(C,S.subject,"subject"),A.object=this.modifyFirstDegreeComponent(C,S.object,"object"),A.graph=this.modifyFirstDegreeComponent(C,S.graph,"graph"),R.push(Q.serializeQuad(A))}R.sort();const y=new j(this.hashAlgorithm);for(const S of R)y.update(S);return T.hash=y.digest(),T.hash}hashRelatedBlankNode(C,R,T,b){let y;y=this.canonicalIssuer.hasId(C)?this.canonicalIssuer.getId(C):T.hasId(C)?T.getId(C):this.blankNodeInfo.get(C).hash;const S=new j(this.hashAlgorithm);return S.update(b),"g"!==b&&S.update(this.getRelatedPredicate(R)),S.update(y),S.digest()}hashNDegreeQuads(C,R){const T=new j(this.hashAlgorithm),b=this.createHashToRelated(C,R),y=[...b.keys()].sort();for(const S of y){T.update(S);let z,A="";const P=new k(b.get(S));for(;P.hasNext();){const X=P.next();let ue=R.clone(),I="";const O=[];let K=!1;for(const E of X)if(this.canonicalIssuer.hasId(E)?I+=this.canonicalIssuer.getId(E):(ue.hasId(E)||O.push(E),I+=ue.getId(E)),0!==A.length&&I>A){K=!0;break}if(!K){for(const E of O){const $=this.hashNDegreeQuads(E,ue);if(I+=ue.getId(E),I+=`<${$.hash}>`,ue=$.issuer,0!==A.length&&I>A){K=!0;break}}K||(0===A.length||I`}createHashToRelated(C,R){const T=new Map,b=this.blankNodeInfo.get(C).quads;for(const y of b)this._addRelatedBlankNodeHash({quad:y,component:y.subject,position:"s",id:C,issuer:R,hashToRelated:T}),this._addRelatedBlankNodeHash({quad:y,component:y.object,position:"o",id:C,issuer:R,hashToRelated:T}),this._addRelatedBlankNodeHash({quad:y,component:y.graph,position:"g",id:C,issuer:R,hashToRelated:T});return T}_hashAndTrackBlankNode({id:C,hashToBlankNodes:R}){const T=this.hashFirstDegreeQuads(C),b=R.get(T);b?b.push(C):R.set(T,[C])}_addBlankNodeQuadInfo({quad:C,component:R}){if("BlankNode"!==R.termType)return;const T=R.value,b=this.blankNodeInfo.get(T);b?b.quads.add(C):this.blankNodeInfo.set(T,{quads:new Set([C]),hash:null})}_addRelatedBlankNodeHash({quad:C,component:R,position:T,id:b,issuer:y,hashToRelated:S}){if("BlankNode"!==R.termType||R.value===b)return;const A=R.value,z=this.hashRelatedBlankNode(A,C,y,T),P=S.get(z);P?P.push(A):S.set(z,[A])}_useCanonicalId({component:C}){return"BlankNode"!==C.termType||C.value.startsWith(this.canonicalIssuer.prefix)?C:{termType:"BlankNode",value:this.canonicalIssuer.getId(C.value)}}}},{"./IdentifierIssuer":47,"./MessageDigest":48,"./NQuads":49,"./Permuter":50}],53:[function(Y,Se,he){"use strict";const W=Y("./URDNA2015");Se.exports=class extends W{constructor(){super(),this.name="URGNA2012",this.hashAlgorithm="sha1"}modifyFirstDegreeComponent(k,Q,H){return"BlankNode"!==Q.termType?Q:"graph"===H?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:Q.value===k?"_:a":"_:z"}}getRelatedPredicate(k){return k.predicate.value}createHashToRelated(k,Q){var H=this;return yt(function*(){const w=new Map,C=H.blankNodeInfo.get(k).quads;let R=0;for(const T of C){let b,y;if("BlankNode"===T.subject.termType&&T.subject.value!==k)y=T.subject.value,b="p";else{if("BlankNode"!==T.object.termType||T.object.value===k)continue;y=T.object.value,b="r"}++R%100==0&&(yield H._yield());const S=yield H.hashRelatedBlankNode(y,T,Q,b),A=w.get(S);A?A.push(y):w.set(S,[y])}return w})()}}},{"./URDNA2015":51}],54:[function(Y,Se,he){"use strict";const W=Y("./URDNA2015Sync");Se.exports=class extends W{constructor(){super(),this.name="URGNA2012",this.hashAlgorithm="sha1"}modifyFirstDegreeComponent(k,Q,H){return"BlankNode"!==Q.termType?Q:"graph"===H?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:Q.value===k?"_:a":"_:z"}}getRelatedPredicate(k){return k.predicate.value}createHashToRelated(k,Q){const H=new Map,w=this.blankNodeInfo.get(k).quads;for(const C of w){let R,T;if("BlankNode"===C.subject.termType&&C.subject.value!==k)T=C.subject.value,R="p";else{if("BlankNode"!==C.object.termType||C.object.value===k)continue;T=C.object.value,R="r"}const b=this.hashRelatedBlankNode(T,C,Q,R),y=H.get(b);y?y.push(T):H.set(b,[T])}return H}}},{"./URDNA2015Sync":52}],55:[function(Y,Se,he){"use strict";const W=Y("./URDNA2015"),j=Y("./URGNA2012"),k=Y("./URDNA2015Sync"),Q=Y("./URGNA2012Sync");let H;try{H=Y("rdf-canonize-native")}catch(C){}const w={};Se.exports=w,w.NQuads=Y("./NQuads"),w.IdentifierIssuer=Y("./IdentifierIssuer"),w._rdfCanonizeNative=function(C){return C&&(H=C),H},w.canonize=function(){var C=yt(function*(R,T){if(Array.isArray(R)||(R=w.NQuads.legacyDatasetToQuads(R)),T.useNative){if(!H)throw new Error("rdf-canonize-native not available");return new Promise((b,y)=>H.canonize(R,T,(S,A)=>S?y(S):b(A)))}if("URDNA2015"===T.algorithm)return new W(T).main(R);if("URGNA2012"===T.algorithm)return new j(T).main(R);throw"algorithm"in T?new Error("Invalid RDF Dataset Canonicalization algorithm: "+T.algorithm):new Error("No RDF Dataset Canonicalization algorithm specified.")});return function(R,T){return C.apply(this,arguments)}}(),w._canonizeSync=function(C,R){if(Array.isArray(C)||(C=w.NQuads.legacyDatasetToQuads(C)),R.useNative){if(H)return H.canonizeSync(C,R);throw new Error("rdf-canonize-native not available")}if("URDNA2015"===R.algorithm)return new k(R).main(C);if("URGNA2012"===R.algorithm)return new Q(R).main(C);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,Se,he){"use strict";var W=this&&this.__createBinding||(Object.create?function(k,Q,H,w){void 0===w&&(w=H),Object.defineProperty(k,w,{enumerable:!0,get:function(){return Q[H]}})}:function(k,Q,H,w){void 0===w&&(w=H),k[w]=Q[H]}),j=this&&this.__exportStar||function(k,Q){for(var H in k)"default"!==H&&!Object.prototype.hasOwnProperty.call(Q,H)&&W(Q,k,H)};Object.defineProperty(he,"__esModule",{value:!0}),j(Y("./lib/BlankNode"),he),j(Y("./lib/DataFactory"),he),j(Y("./lib/DefaultGraph"),he),j(Y("./lib/Literal"),he),j(Y("./lib/NamedNode"),he),j(Y("./lib/Quad"),he),j(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,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.BlankNode=void 0;he.BlankNode=class{constructor(k){this.termType="BlankNode",this.value=k}equals(k){return!!k&&"BlankNode"===k.termType&&k.value===this.value}}},{}],58:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.DataFactory=void 0;const W=Y("./BlankNode"),j=Y("./DefaultGraph"),k=Y("./Literal"),Q=Y("./NamedNode"),H=Y("./Quad"),w=Y("./Variable");let C=0;he.DataFactory=class{constructor(b){this.blankNodeCounter=0,this.blankNodePrefix=(b=b||{}).blankNodePrefix||`df_${C++}_`}namedNode(b){return new Q.NamedNode(b)}blankNode(b){return new W.BlankNode(b||`${this.blankNodePrefix}${this.blankNodeCounter++}`)}literal(b,y){return new k.Literal(b,y)}variable(b){return new w.Variable(b)}defaultGraph(){return j.DefaultGraph.INSTANCE}quad(b,y,S,A){return new H.Quad(b,y,S,A||this.defaultGraph())}fromTerm(b){switch(b.termType){case"NamedNode":return this.namedNode(b.value);case"BlankNode":return this.blankNode(b.value);case"Literal":return b.language?this.literal(b.value,b.language):b.datatype.equals(k.Literal.XSD_STRING)?this.literal(b.value):this.literal(b.value,this.fromTerm(b.datatype));case"Variable":return this.variable(b.value);case"DefaultGraph":return this.defaultGraph();case"Quad":return this.quad(this.fromTerm(b.subject),this.fromTerm(b.predicate),this.fromTerm(b.object),this.fromTerm(b.graph))}}fromQuad(b){return this.fromTerm(b)}resetBlankNodeCounter(){this.blankNodeCounter=0}}},{"./BlankNode":57,"./DefaultGraph":59,"./Literal":60,"./NamedNode":61,"./Quad":62,"./Variable":63}],59:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.DefaultGraph=void 0;class W{constructor(){this.termType="DefaultGraph",this.value=""}equals(k){return!!k&&"DefaultGraph"===k.termType}}he.DefaultGraph=W,W.INSTANCE=new W},{}],60:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.Literal=void 0;const W=Y("./NamedNode");class j{constructor(Q,H){this.termType="Literal",this.value=Q,"string"==typeof H?(this.language=H,this.datatype=j.RDF_LANGUAGE_STRING):H?(this.language="",this.datatype=H):(this.language="",this.datatype=j.XSD_STRING)}equals(Q){return!!Q&&"Literal"===Q.termType&&Q.value===this.value&&Q.language===this.language&&Q.datatype.equals(this.datatype)}}he.Literal=j,j.RDF_LANGUAGE_STRING=new W.NamedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),j.XSD_STRING=new W.NamedNode("http://www.w3.org/2001/XMLSchema#string")},{"./NamedNode":61}],61:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.NamedNode=void 0;he.NamedNode=class{constructor(k){this.termType="NamedNode",this.value=k}equals(k){return!!k&&"NamedNode"===k.termType&&k.value===this.value}}},{}],62:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.Quad=void 0;he.Quad=class{constructor(k,Q,H,w){this.termType="Quad",this.value="",this.subject=k,this.predicate=Q,this.object=H,this.graph=w}equals(k){return!!k&&("Quad"===k.termType||!k.termType)&&this.subject.equals(k.subject)&&this.predicate.equals(k.predicate)&&this.object.equals(k.object)&&this.graph.equals(k.graph)}}},{}],63:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.Variable=void 0;he.Variable=class{constructor(k){this.termType="Variable",this.value=k}equals(k){return!!k&&"Variable"===k.termType&&k.value===this.value}}},{}],64:[function(Y,Se,he){"use strict";var W=this&&this.__createBinding||(Object.create?function(k,Q,H,w){void 0===w&&(w=H),Object.defineProperty(k,w,{enumerable:!0,get:function(){return Q[H]}})}:function(k,Q,H,w){void 0===w&&(w=H),k[w]=Q[H]}),j=this&&this.__exportStar||function(k,Q){for(var H in k)"default"!==H&&!Object.prototype.hasOwnProperty.call(Q,H)&&W(Q,k,H)};Object.defineProperty(he,"__esModule",{value:!0}),j(Y("./lib/RdfXmlParser"),he)},{"./lib/RdfXmlParser":66}],65:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.ParseError=void 0;class W extends Error{constructor(k,Q){const H=k.saxStream._parser;super(k.trackPosition?`Line ${H.line+1} column ${H.column+1}: ${Q}`:Q)}}he.ParseError=W},{}],66:[function(Y,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),he.ParseType=he.RdfXmlParser=void 0;const W=Y("relative-to-absolute-iri"),j=Y("sax"),k=Y("stream"),Q=Y("./ParseError"),H=Y("rdf-data-factory");class w extends k.Transform{constructor(T){super({readableObjectMode:!0}),this.activeTagStack=[],this.nodeIds={},T&&(Object.assign(this,T),this.options=T),this.dataFactory||(this.dataFactory=new H.DataFactory),this.baseIRI||(this.baseIRI=""),this.defaultGraph||(this.defaultGraph=this.dataFactory.defaultGraph()),this.saxStream=j.createStream(this.strict,{xmlns:!1,position:this.trackPosition}),this.strict||(this.saxStream._parser.looseCase="toString"),this.attachSaxListeners()}static parseNamespace(T,b){const y={};let S=!1;for(const z in T.attributes)z.startsWith("xmlns")&&(5===z.length?(S=!0,y[""]=T.attributes[z]):":"===z.charAt(5)&&(S=!0,y[z.substr(6)]=T.attributes[z]));const A=b&&b.ns?b.ns:[w.DEFAULT_NS];return S?A.concat([y]):A}static expandPrefixedTerm(T,b,y){const S=T.indexOf(":");let A,z;S>=0?(A=T.substr(0,S),z=T.substr(S+1)):(A="",z=T);let P=null,X=null;for(let ue=b.length-1;ue>=0;ue--){const I=b[ue][A];if(I){P=I;break}X||(X=b[ue][""])}if(!P){if(A&&"xmlns"!==A)throw new Q.ParseError(y,`The prefix '${A}' in term '${T}' was not bound.`);P=X||""}return{prefix:A,local:z,uri:P}}static isValidIri(T){return w.IRI_REGEX.test(T)}import(T){const b=new k.PassThrough({readableObjectMode:!0});T.on("error",S=>y.emit("error",S)),T.on("data",S=>b.push(S)),T.on("end",()=>b.push(null));const y=b.pipe(new w(this.options));return y}_transform(T,b,y){try{this.saxStream.write(T,b)}catch(S){return y(S)}y()}newParseError(T){return new Q.ParseError(this,T)}valueToUri(T,b){return this.uriToNamedNode(W.resolve(T,b.baseIRI))}uriToNamedNode(T){if(!w.isValidIri(T))throw this.newParseError(`Invalid URI: ${T}`);return this.dataFactory.namedNode(T)}validateNcname(T){if(!w.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 b=this.activeTagStack.length?this.activeTagStack[this.activeTagStack.length-1]:null;let y=C.RESOURCE;if(b&&(b.hadChildren=!0,y=b.childrenParseType),b&&b.childrenStringTags){const A=T.name;let z="";for(const I in T.attributes)z+=` ${I}="${T.attributes[I]}"`;b.childrenStringTags.push(`<${A}${z}>`);const ue={childrenStringTags:b.childrenStringTags};return ue.childrenStringEmitClosingTag=``,void this.activeTagStack.push(ue)}const S={};b?(S.language=b.language,S.baseIRI=b.baseIRI):S.baseIRI=this.baseIRI,this.activeTagStack.push(S),S.ns=w.parseNamespace(T,b),y===C.RESOURCE?this.onTagResource(T,S,b,!b):this.onTagProperty(T,S,b)}onTagResource(T,b,y,S){const A=w.expandPrefixedTerm(T.name,b.ns,this);b.childrenParseType=C.PROPERTY;let z=!0;if(A.uri===w.RDF){if(!S&&w.FORBIDDEN_NODE_ELEMENTS.indexOf(A.local)>=0)throw this.newParseError(`Illegal node element name: ${A.local}`);switch(A.local){case"RDF":b.childrenParseType=C.RESOURCE;case"Description":z=!1}}const P=[],X=[];let ue=null,I=!1,O=!1,K=null;for(const E in T.attributes){const $=T.attributes[E],Z=w.expandPrefixedTerm(E,b.ns,this);if(y&&Z.uri===w.RDF)switch(Z.local){case"about":if(ue)throw this.newParseError(`Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ${$} and ${ue} where found.`);ue=$;continue;case"ID":if(ue)throw this.newParseError(`Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ${$} and ${ue} where found.`);this.validateNcname($),ue="#"+$,I=!0;continue;case"nodeID":if(ue)throw this.newParseError(`Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ${$} and ${ue} where found.`);this.validateNcname($),ue=$,O=!0;continue;case"bagID":throw this.newParseError("rdf:bagID is not supported.");case"type":K=$;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(Z.uri===w.XML){if("lang"===Z.local){b.language=""===$?null:$.toLowerCase();continue}if("base"===Z.local){b.baseIRI=W.resolve($,b.baseIRI);continue}}"xml"!==Z.prefix&&Z.uri&&(P.push(this.uriToNamedNode(Z.uri+Z.local)),X.push($))}if(null!==ue&&(b.subject=O?this.dataFactory.blankNode(ue):this.valueToUri(ue,b),I&&this.claimNodeId(b.subject)),b.subject||(b.subject=this.dataFactory.blankNode()),z){const E=this.uriToNamedNode(A.uri+A.local);this.emitTriple(b.subject,this.dataFactory.namedNode(w.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(w.RDF+"first"),b.subject,b.reifiedStatementId),y.childrenCollectionSubject=E,y.childrenCollectionPredicate=this.dataFactory.namedNode(w.RDF+"rest")}else{this.emitTriple(y.subject,y.predicate,b.subject,y.reifiedStatementId);for(let E=0;E=0)throw this.newParseError(`Illegal property element name: ${S.local}`);b.predicateSubPredicates=[],b.predicateSubObjects=[];let A=!1,z=!1,P=null,X=!0;const ue=[],I=[];for(const O in T.attributes){const K=T.attributes[O],E=w.expandPrefixedTerm(O,b.ns,this);if(E.uri===w.RDF)switch(E.local){case"resource":if(P)throw this.newParseError(`Found both rdf:resource (${K}) and rdf:nodeID (${P}).`);if(A)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:resource (${K})`);b.hadChildren=!0,P=K,X=!1;continue;case"datatype":if(z)throw this.newParseError(`Found both non-rdf:* property attributes and rdf:datatype (${K}).`);if(A)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:datatype (${K})`);b.datatype=this.valueToUri(K,b);continue;case"nodeID":if(z)throw this.newParseError(`Found both non-rdf:* property attributes and rdf:nodeID (${K}).`);if(b.hadChildren)throw this.newParseError(`Found both rdf:resource and rdf:nodeID (${K}).`);if(A)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:nodeID (${K})`);this.validateNcname(K),b.hadChildren=!0,P=K,X=!0;continue;case"bagID":throw this.newParseError("rdf:bagID is not supported.");case"parseType":if(z)throw this.newParseError("rdf:parseType is not allowed when non-rdf:* property attributes are present");if(b.datatype)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:datatype (${b.datatype.value})`);if(P)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:nodeID or rdf:resource (${P})`);if("Resource"===K){A=!0,b.childrenParseType=C.PROPERTY;const $=this.dataFactory.blankNode();this.emitTriple(b.subject,b.predicate,$,b.reifiedStatementId),b.subject=$,b.predicate=null}else"Collection"===K?(A=!0,b.hadChildren=!0,b.childrenCollectionSubject=b.subject,b.childrenCollectionPredicate=b.predicate,X=!1):"Literal"===K&&(A=!0,b.childrenTagsToString=!0,b.childrenStringTags=[]);continue;case"ID":this.validateNcname(K),b.reifiedStatementId=this.valueToUri("#"+K,b),this.claimNodeId(b.reifiedStatementId);continue}else if(E.uri===w.XML&&"lang"===E.local){b.language=""===K?null:K.toLowerCase();continue}if("xml"!==E.prefix&&"xmlns"!==E.prefix&&E.uri){if(A||b.datatype)throw this.newParseError(`Found illegal rdf:* properties on property element with attribute: ${K}`);b.hadChildren=!0,z=!0,ue.push(this.uriToNamedNode(E.uri+E.local)),I.push(this.dataFactory.literal(K,b.datatype||b.language))}}if(null!==P){const O=b.subject;b.subject=X?this.dataFactory.blankNode(P):this.valueToUri(P,b),this.emitTriple(O,b.predicate,b.subject,b.reifiedStatementId);for(let K=0;K/g,(b,y,S)=>(this.saxStream._parser.ENTITIES[y]=S,""))}}var C,R;he.RdfXmlParser=w,w.IRI_REGEX=/^([A-Za-z][A-Za-z0-9+-.]*):[^ "<>{}|\\\[\]`]*$/,w.MIME_TYPE="application/rdf+xml",w.RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#",w.XML="http://www.w3.org/XML/1998/namespace",w.XMLNS="http://www.w3.org/2000/xmlns/",w.DEFAULT_NS={xml:w.XML},w.FORBIDDEN_NODE_ELEMENTS=["RDF","ID","about","bagID","parseType","resource","nodeID","li","aboutEach","aboutEachPrefix"],w.FORBIDDEN_PROPERTY_ELEMENTS=["Description","RDF","ID","about","bagID","parseType","resource","nodeID","aboutEach","aboutEachPrefix"],w.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=C=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,Se,he){"use strict";var j={};function k(R,T,b){b||(b=Error);var S=function(A){function z(P,X,ue){return A.call(this,function(A,z,P){return"string"==typeof T?T:T(A,z,P)}(P,X,ue))||this}return function(R,T){R.prototype=Object.create(T.prototype),R.prototype.constructor=R,R.__proto__=T}(z,A),z}(b);S.prototype.name=b.name,S.prototype.code=R,j[R]=S}function Q(R,T){if(Array.isArray(R)){var b=R.length;return R=R.map(function(y){return String(y)}),b>2?"one of ".concat(T," ").concat(R.slice(0,b-1).join(", "),", or ")+R[b-1]:2===b?"one of ".concat(T," ").concat(R[0]," or ").concat(R[1]):"of ".concat(T," ").concat(R[0])}return"of ".concat(T," ").concat(String(R))}k("ERR_INVALID_OPT_VALUE",function(R,T){return'The value "'+T+'" is invalid for option "'+R+'"'},TypeError),k("ERR_INVALID_ARG_TYPE",function(R,T,b){var y,S;if("string"==typeof T&&function(R,T,b){return R.substr(!b||b<0?0:+b,T.length)===T}(T,"not ")?(y="must not be",T=T.replace(/^not /,"")):y="must be",function(R,T,b){return(void 0===b||b>R.length)&&(b=R.length),R.substring(b-T.length,b)===T}(R," argument"))S="The ".concat(R," ").concat(y," ").concat(Q(T,"type"));else{var A=function(R,T,b){return"number"!=typeof b&&(b=0),!(b+T.length>R.length)&&-1!==R.indexOf(T,b)}(R,".")?"property":"argument";S='The "'.concat(R,'" ').concat(A," ").concat(y," ").concat(Q(T,"type"))}return S+". Received type ".concat(typeof b)},TypeError),k("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),k("ERR_METHOD_NOT_IMPLEMENTED",function(R){return"The "+R+" method is not implemented"}),k("ERR_STREAM_PREMATURE_CLOSE","Premature close"),k("ERR_STREAM_DESTROYED",function(R){return"Cannot call "+R+" after a stream was destroyed"}),k("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),k("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),k("ERR_STREAM_WRITE_AFTER_END","write after end"),k("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),k("ERR_UNKNOWN_ENCODING",function(R){return"Unknown encoding: "+R},TypeError),k("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),Se.exports.codes=j},{}],68:[function(Y,Se,he){(function(W){(function(){"use strict";var j=Object.keys||function(y){var S=[];for(var A in y)S.push(A);return S};Se.exports=R;var k=Y("./_stream_readable"),Q=Y("./_stream_writable");Y("inherits")(R,k);for(var H=j(Q.prototype),w=0;w0)if("string"!=typeof B&&!Ze.objectMode&&Object.getPrototypeOf(B)!==C.prototype&&(B=function(we){return C.from(we)}(B)),V)Ze.endEmitted?oe(we,new E):Oe(we,Ze,B,!0);else if(Ze.ended)oe(we,new O);else{if(Ze.destroyed)return!1;Ze.reading=!1,Ze.decoder&&!N?(B=Ze.decoder.write(B),Ze.objectMode||0!==B.length?Oe(we,Ze,B,!1):Ke(we,Ze)):Oe(we,Ze,B,!1)}else V||(Ze.reading=!1,Ke(we,Ze));return!Ze.ended&&(Ze.lengthB.highWaterMark&&(B.highWaterMark=function(we){return we>=st?we=st:(we--,we|=we>>>1,we|=we>>>2,we|=we>>>4,we|=we>>>8,we|=we>>>16,we++),we}(we)),we<=B.length?we:B.ended?B.length:(B.needReadable=!0,0))}function ze(we){var B=we._readableState;S("emitReadable",B.needReadable,B.emittedReadable),B.needReadable=!1,B.emittedReadable||(S("emitReadable",B.flowing),B.emittedReadable=!0,W.nextTick(Le,we))}function Le(we){var B=we._readableState;S("emitReadable_",B.destroyed,B.length,B.ended),!B.destroyed&&(B.length||B.ended)&&(we.emit("readable"),B.emittedReadable=!1),B.needReadable=!B.flowing&&!B.ended&&B.length<=B.highWaterMark,pe(we)}function Ke(we,B){B.readingMore||(B.readingMore=!0,W.nextTick(Me,we,B))}function Me(we,B){for(;!B.reading&&!B.ended&&(B.length0,B.resumeScheduled&&!B.paused?B.flowing=!0:we.listenerCount("data")>0&&we.resume()}function ke(we){S("readable nexttick read 0"),we.read(0)}function G(we,B){S("resume",B.reading),B.reading||we.read(0),B.resumeScheduled=!1,we.emit("resume"),pe(we),B.flowing&&!B.reading&&we.read(0)}function pe(we){var B=we._readableState;for(S("flow",B.flowing);B.flowing&&null!==we.read(););}function de(we,B){return 0===B.length?null:(B.objectMode?N=B.buffer.shift():!we||we>=B.length?(N=B.decoder?B.buffer.join(""):1===B.buffer.length?B.buffer.first():B.buffer.concat(B.length),B.buffer.clear()):N=B.buffer.consume(we,B.decoder),N);var N}function je(we){var B=we._readableState;S("endReadable",B.endEmitted),B.endEmitted||(B.ended=!0,W.nextTick(_t,B,we))}function _t(we,B){if(S("endReadableNT",we.endEmitted,we.length),!we.endEmitted&&0===we.length&&(we.endEmitted=!0,B.readable=!1,B.emit("end"),we.autoDestroy)){var N=B._writableState;(!N||N.autoDestroy&&N.finished)&&B.destroy()}}function pt(we,B){for(var N=0,V=we.length;N=B.highWaterMark:B.length>0)||B.ended))return S("read: emitReadable",B.length,B.ended),0===B.length&&B.ended?je(this):ze(this),null;if(0===(we=tt(we,B))&&B.ended)return 0===B.length&&je(this),null;var Re,V=B.needReadable;return S("need readable",V),(0===B.length||B.length-we0?de(we,B):null)?(B.needReadable=B.length<=B.highWaterMark,we=0):(B.length-=we,B.awaitDrain=0),0===B.length&&(B.ended||(B.needReadable=!0),N!==we&&B.ended&&je(this)),null!==Re&&this.emit("data",Re),Re},ne.prototype._read=function(we){oe(this,new K("_read()"))},ne.prototype.pipe=function(we,B){var N=this,V=this._readableState;switch(V.pipesCount){case 0:V.pipes=we;break;case 1:V.pipes=[V.pipes,we];break;default:V.pipes.push(we)}V.pipesCount+=1,S("pipe count=%d opts=%j",V.pipesCount,B);var Ze=B&&!1===B.end||we===W.stdout||we===W.stderr?fs:kt;function Tt(Bs,Kr){S("onunpipe"),Bs===N&&Kr&&!1===Kr.hasUnpiped&&(Kr.hasUnpiped=!0,S("cleanup"),we.removeListener("close",Xr),we.removeListener("finish",Ls),we.removeListener("drain",In),we.removeListener("error",xi),we.removeListener("unpipe",Tt),N.removeListener("end",kt),N.removeListener("end",fs),N.removeListener("data",Mi),Nn=!0,V.awaitDrain&&(!we._writableState||we._writableState.needDrain)&&In())}function kt(){S("onend"),we.end()}V.endEmitted?W.nextTick(Ze):N.once("end",Ze),we.on("unpipe",Tt);var In=function(we){return function(){var N=we._readableState;S("pipeOnDrain",N.awaitDrain),N.awaitDrain&&N.awaitDrain--,0===N.awaitDrain&&H(we,"data")&&(N.flowing=!0,pe(we))}}(N);we.on("drain",In);var Nn=!1;function Mi(Bs){S("ondata");var Kr=we.write(Bs);S("dest.write",Kr),!1===Kr&&((1===V.pipesCount&&V.pipes===we||V.pipesCount>1&&-1!==pt(V.pipes,we))&&!Nn&&(S("false write response, pause",V.awaitDrain),V.awaitDrain++),N.pause())}function xi(Bs){S("onerror",Bs),fs(),we.removeListener("error",xi),0===H(we,"error")&&oe(we,Bs)}function Xr(){we.removeListener("finish",Ls),fs()}function Ls(){S("onfinish"),we.removeListener("close",Xr),fs()}function fs(){S("unpipe"),N.unpipe(we)}return N.on("data",Mi),function(we,B,N){if("function"==typeof we.prependListener)return we.prependListener(B,N);we._events&&we._events[B]?Array.isArray(we._events[B])?we._events[B].unshift(N):we._events[B]=[N,we._events[B]]:we.on(B,N)}(we,"error",xi),we.once("close",Xr),we.once("finish",Ls),we.emit("pipe",N),V.flowing||(S("pipe resume"),N.resume()),we},ne.prototype.unpipe=function(we){var B=this._readableState,N={hasUnpiped:!1};if(0===B.pipesCount)return this;if(1===B.pipesCount)return we&&we!==B.pipes||(we||(we=B.pipes),B.pipes=null,B.pipesCount=0,B.flowing=!1,we&&we.emit("unpipe",this,N)),this;if(!we){var V=B.pipes,Re=B.pipesCount;B.pipes=null,B.pipesCount=0,B.flowing=!1;for(var Ze=0;Ze0,!1!==V.flowing&&this.resume()):"readable"===we&&!V.endEmitted&&!V.readableListening&&(V.readableListening=V.needReadable=!0,V.flowing=!1,V.emittedReadable=!1,S("on readable",V.length,V.reading),V.length?ze(this):V.reading||W.nextTick(ke,this)),N},ne.prototype.removeListener=function(we,B){var N=w.prototype.removeListener.call(this,we,B);return"readable"===we&&W.nextTick(qe,this),N},ne.prototype.removeAllListeners=function(we){var B=w.prototype.removeAllListeners.apply(this,arguments);return("readable"===we||void 0===we)&&W.nextTick(qe,this),B},ne.prototype.resume=function(){var we=this._readableState;return we.flowing||(S("resume"),we.flowing=!we.readableListening,function(we,B){B.resumeScheduled||(B.resumeScheduled=!0,W.nextTick(G,we,B))}(this,we)),we.paused=!1,this},ne.prototype.pause=function(){return S("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(S("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},ne.prototype.wrap=function(we){var B=this,N=this._readableState,V=!1;for(var Re in we.on("end",function(){if(S("wrapped end"),N.decoder&&!N.ended){var Tt=N.decoder.end();Tt&&Tt.length&&B.push(Tt)}B.push(null)}),we.on("data",function(Tt){S("wrapped data"),N.decoder&&(Tt=N.decoder.write(Tt)),N.objectMode&&null==Tt||!(N.objectMode||Tt&&Tt.length)||B.push(Tt)||(V=!0,we.pause())}),we)void 0===this[Re]&&"function"==typeof we[Re]&&(this[Re]=function(kt){return function(){return we[kt].apply(we,arguments)}}(Re));for(var Ze=0;Ze-1))throw new Z(de);return this._writableState.defaultEncoding=de,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(pe,de,je){je(new ue("_write()"))},me.prototype._writev=null,me.prototype.end=function(pe,de,je){var _t=this._writableState;return"function"==typeof pe?(je=pe,pe=null,de=null):"function"==typeof de&&(je=de,de=null),null!=pe&&this.write(pe,de),_t.corked&&(_t.corked=1,this.uncork()),_t.ending||function(pe,de,je){de.ending=!0,ke(pe,de),je&&(de.finished?W.nextTick(je):pe.once("finish",je)),de.ended=!0,pe.writable=!1}(this,_t,je),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(de){!this._writableState||(this._writableState.destroyed=de)}}),me.prototype.destroy=S.destroy,me.prototype._undestroy=S.undestroy,me.prototype._destroy=function(pe,de){de(pe)}}).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,Se,he){(function(W){(function(){"use strict";var j;function k(O,K,E){return K in O?Object.defineProperty(O,K,{value:E,enumerable:!0,configurable:!0,writable:!0}):O[K]=E,O}var Q=Y("./end-of-stream"),H=Symbol("lastResolve"),w=Symbol("lastReject"),C=Symbol("error"),R=Symbol("ended"),T=Symbol("lastPromise"),b=Symbol("handlePromise"),y=Symbol("stream");function S(O,K){return{value:O,done:K}}function A(O){var K=O[H];if(null!==K){var E=O[y].read();null!==E&&(O[T]=null,O[H]=null,O[w]=null,K(S(E,!1)))}}function z(O){W.nextTick(A,O)}var X=Object.getPrototypeOf(function(){}),ue=Object.setPrototypeOf((k(j={get stream(){return this[y]},next:function(){var K=this,E=this[C];if(null!==E)return Promise.reject(E);if(this[R])return Promise.resolve(S(void 0,!0));if(this[y].destroyed)return new Promise(function(oe,te){W.nextTick(function(){K[C]?te(K[C]):oe(S(void 0,!0))})});var Z,$=this[T];if($)Z=new Promise(function(O,K){return function(E,$){O.then(function(){K[R]?E(S(void 0,!0)):K[b](E,$)},$)}}($,this));else{var ae=this[y].read();if(null!==ae)return Promise.resolve(S(ae,!1));Z=new Promise(this[b])}return this[T]=Z,Z}},Symbol.asyncIterator,function(){return this}),k(j,"return",function(){var K=this;return new Promise(function(E,$){K[y].destroy(null,function(Z){Z?$(Z):E(S(void 0,!0))})})}),j),X);Se.exports=function(K){var E,$=Object.create(ue,(k(E={},y,{value:K,writable:!0}),k(E,H,{value:null,writable:!0}),k(E,w,{value:null,writable:!0}),k(E,C,{value:null,writable:!0}),k(E,R,{value:K._readableState.endEmitted,writable:!0}),k(E,b,{value:function(ae,oe){var te=$[y].read();te?($[T]=null,$[H]=null,$[w]=null,ae(S(te,!1))):($[H]=ae,$[w]=oe)},writable:!0}),E));return $[T]=null,Q(K,function(Z){if(Z&&"ERR_STREAM_PREMATURE_CLOSE"!==Z.code){var ae=$[w];return null!==ae&&($[T]=null,$[H]=null,$[w]=null,ae(Z)),void($[C]=Z)}var oe=$[H];null!==oe&&($[T]=null,$[H]=null,$[w]=null,oe(S(void 0,!0))),$[R]=!0}),K.on("readable",z.bind(null,$)),$}}).call(this)}).call(this,Y("_process"))},{"./end-of-stream":76,_process:44}],74:[function(Y,Se,he){"use strict";function W(A,z){var P=Object.keys(A);if(Object.getOwnPropertySymbols){var X=Object.getOwnPropertySymbols(A);z&&(X=X.filter(function(ue){return Object.getOwnPropertyDescriptor(A,ue).enumerable})),P.push.apply(P,X)}return P}function k(A,z,P){return z in A?Object.defineProperty(A,z,{value:P,enumerable:!0,configurable:!0,writable:!0}):A[z]=P,A}function H(A,z){for(var P=0;P0?this.tail.next=X:this.head=X,this.tail=X,++this.length}},{key:"unshift",value:function(P){var X={data:P,next:this.head};0===this.length&&(this.tail=X),this.head=X,++this.length}},{key:"shift",value:function(){if(0!==this.length){var P=this.head.data;return this.head=1===this.length?this.tail=null:this.head.next,--this.length,P}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(P){if(0===this.length)return"";for(var X=this.head,ue=""+X.data;X=X.next;)ue+=P+X.data;return ue}},{key:"concat",value:function(P){if(0===this.length)return R.alloc(0);for(var X=R.allocUnsafe(P>>>0),ue=this.head,I=0;ue;)S(ue.data,X,I),I+=ue.data.length,ue=ue.next;return X}},{key:"consume",value:function(P,X){var ue;return PO.length?O.length:P;if(I+=K===O.length?O:O.slice(0,P),0==(P-=K)){K===O.length?(++ue,this.head=X.next?X.next:this.tail=null):(this.head=X,X.data=O.slice(K));break}++ue}return this.length-=ue,I}},{key:"_getBuffer",value:function(P){var X=R.allocUnsafe(P),ue=this.head,I=1;for(ue.data.copy(X),P-=ue.data.length;ue=ue.next;){var O=ue.data,K=P>O.length?O.length:P;if(O.copy(X,X.length-P,0,K),0==(P-=K)){K===O.length?(++I,this.head=ue.next?ue.next:this.tail=null):(this.head=ue,ue.data=O.slice(K));break}++I}return this.length-=I,X}},{key:y,value:function(P,X){return b(this,function(A){for(var z=1;z0,function(Z){ue||(ue=Z),Z&&I.forEach(T),!E&&(I.forEach(T),X(ue))})});return z.reduce(b)}},{"../../../errors":67,"./end-of-stream":76}],79:[function(Y,Se,he){"use strict";var W=Y("../../../errors").codes.ERR_INVALID_OPT_VALUE;Se.exports={getHighWaterMark:function(Q,H,w,C){var R=function(Q,H,w){return null!=Q.highWaterMark?Q.highWaterMark:H?Q[w]:null}(H,C,w);if(null!=R){if(!isFinite(R)||Math.floor(R)!==R||R<0)throw new W(C?w:"highWaterMark",R);return Math.floor(R)}return Q.objectMode?16:16384}}},{"../../../errors":67}],80:[function(Y,Se,he){Se.exports=Y("events").EventEmitter},{events:8}],81:[function(Y,Se,he){(he=Se.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,Se,he){"use strict";Object.defineProperty(he,"__esModule",{value:!0}),function(j){for(var k in j)he.hasOwnProperty(k)||(he[k]=j[k])}(Y("./lib/Resolve"))},{"./lib/Resolve":83}],83:[function(Y,Se,he){"use strict";function j(H){const w=[];let C=0;for(;CR.join("")).join("/")}function k(H,w){let C=w+1;w>=0?"/"===H[w+1]&&"/"===H[w+2]&&(C=w+3):"/"===H[0]&&"/"===H[1]&&(C=2);const R=H.indexOf("/",C);return R<0?H:H.substr(0,R)+j(H.substr(R))}function Q(H){return!H||"#"===H||"?"===H||"/"===H}Object.defineProperty(he,"__esModule",{value:!0}),he.resolve=function(H,w){const C=(w=w||"").indexOf("#");if(C>0&&(w=w.substr(0,C)),!H.length){if(w.indexOf(":")<0)throw new Error(`Found invalid baseIRI '${w}' for value '${H}'`);return w}if(H.startsWith("?")){const z=w.indexOf("?");return z>0&&(w=w.substr(0,z)),w+H}if(H.startsWith("#"))return w+H;if(!w.length){const z=H.indexOf(":");if(z<0)throw new Error(`Found invalid relative IRI '${H}' for a missing baseIRI`);return k(H,z)}const R=H.indexOf(":");if(R>=0)return k(H,R);const T=w.indexOf(":");if(T<0)throw new Error(`Found invalid baseIRI '${w}' for value '${H}'`);const b=w.substr(0,T+1);if(0===H.indexOf("//"))return b+k(H,R);let y;if(w.indexOf("//",T)===T+1){if(y=w.indexOf("/",T+3),y<0)return w.length>T+3?w+"/"+k(H,R):b+k(H,R)}else if(y=w.indexOf("/",T+1),y<0)return b+k(H,R);if(0===H.indexOf("/"))return w.substr(0,y)+j(H);let S=w.substr(y);const A=S.lastIndexOf("/");return A>=0&&A"===de?(ne(G,"onsgmldeclaration",G.sgmlDecl),G.sgmlDecl="",G.state=te.TEXT):($(de)&&(G.state=te.SGML_DECL_QUOTED),G.sgmlDecl+=de);continue;case te.SGML_DECL_QUOTED:de===G.q&&(G.state=te.SGML_DECL,G.q=""),G.sgmlDecl+=de;continue;case te.DOCTYPE:">"===de?(G.state=te.TEXT,ne(G,"ondoctype",G.doctype),G.doctype=!0):(G.doctype+=de,"["===de?G.state=te.DOCTYPE_DTD:$(de)&&(G.state=te.DOCTYPE_QUOTED,G.q=de));continue;case te.DOCTYPE_QUOTED:G.doctype+=de,de===G.q&&(G.q="",G.state=te.DOCTYPE);continue;case te.DOCTYPE_DTD:G.doctype+=de,"]"===de?G.state=te.DOCTYPE:$(de)&&(G.state=te.DOCTYPE_DTD_QUOTED,G.q=de);continue;case te.DOCTYPE_DTD_QUOTED:G.doctype+=de,de===G.q&&(G.state=te.DOCTYPE_DTD,G.q="");continue;case te.COMMENT:"-"===de?G.state=te.COMMENT_ENDING:G.comment+=de;continue;case te.COMMENT_ENDING:"-"===de?(G.state=te.COMMENT_ENDED,G.comment=Oe(G.opt,G.comment),G.comment&&ne(G,"oncomment",G.comment),G.comment=""):(G.comment+="-"+de,G.state=te.COMMENT);continue;case te.COMMENT_ENDED:">"!==de?(Qe(G,"Malformed comment"),G.comment+="--"+de,G.state=te.COMMENT):G.state=te.TEXT;continue;case te.CDATA:"]"===de?G.state=te.CDATA_ENDING:G.cdata+=de;continue;case te.CDATA_ENDING:"]"===de?G.state=te.CDATA_ENDING_2:(G.cdata+="]"+de,G.state=te.CDATA);continue;case te.CDATA_ENDING_2:">"===de?(G.cdata&&ne(G,"oncdata",G.cdata),ne(G,"onclosecdata"),G.cdata="",G.state=te.TEXT):"]"===de?G.cdata+="]":(G.cdata+="]]"+de,G.state=te.CDATA);continue;case te.PROC_INST:"?"===de?G.state=te.PROC_INST_ENDING:E(de)?G.state=te.PROC_INST_BODY:G.procInstName+=de;continue;case te.PROC_INST_BODY:if(!G.procInstBody&&E(de))continue;"?"===de?G.state=te.PROC_INST_ENDING:G.procInstBody+=de;continue;case te.PROC_INST_ENDING:">"===de?(ne(G,"onprocessinginstruction",{name:G.procInstName,body:G.procInstBody}),G.procInstName=G.procInstBody="",G.state=te.TEXT):(G.procInstBody+="?"+de,G.state=te.PROC_INST_BODY);continue;case te.OPEN_TAG:ae(I,de)?G.tagName+=de:(tt(G),">"===de?Le(G):"/"===de?G.state=te.OPEN_TAG_SLASH:(E(de)||Qe(G,"Invalid character in tag name"),G.state=te.ATTRIB));continue;case te.OPEN_TAG_SLASH:">"===de?(Le(G,!0),Ke(G)):(Qe(G,"Forward-slash in opening tag not followed by >"),G.state=te.ATTRIB);continue;case te.ATTRIB:if(E(de))continue;">"===de?Le(G):"/"===de?G.state=te.OPEN_TAG_SLASH:ae(ue,de)?(G.attribName=de,G.attribValue="",G.state=te.ATTRIB_NAME):Qe(G,"Invalid attribute name");continue;case te.ATTRIB_NAME:"="===de?G.state=te.ATTRIB_VALUE:">"===de?(Qe(G,"Attribute without value"),G.attribValue=G.attribName,ze(G),Le(G)):E(de)?G.state=te.ATTRIB_NAME_SAW_WHITE:ae(I,de)?G.attribName+=de:Qe(G,"Invalid attribute name");continue;case te.ATTRIB_NAME_SAW_WHITE:if("="===de)G.state=te.ATTRIB_VALUE;else{if(E(de))continue;Qe(G,"Attribute without value"),G.tag.attributes[G.attribName]="",G.attribValue="",ne(G,"onattribute",{name:G.attribName,value:""}),G.attribName="",">"===de?Le(G):ae(ue,de)?(G.attribName=de,G.state=te.ATTRIB_NAME):(Qe(G,"Invalid attribute name"),G.state=te.ATTRIB)}continue;case te.ATTRIB_VALUE:if(E(de))continue;$(de)?(G.q=de,G.state=te.ATTRIB_VALUE_QUOTED):(Qe(G,"Unquoted attribute value"),G.state=te.ATTRIB_VALUE_UNQUOTED,G.attribValue=de);continue;case te.ATTRIB_VALUE_QUOTED:if(de!==G.q){"&"===de?G.state=te.ATTRIB_VALUE_ENTITY_Q:G.attribValue+=de;continue}ze(G),G.q="",G.state=te.ATTRIB_VALUE_CLOSED;continue;case te.ATTRIB_VALUE_CLOSED:E(de)?G.state=te.ATTRIB:">"===de?Le(G):"/"===de?G.state=te.OPEN_TAG_SLASH:ae(ue,de)?(Qe(G,"No whitespace between attributes"),G.attribName=de,G.attribValue="",G.state=te.ATTRIB_NAME):Qe(G,"Invalid attribute name");continue;case te.ATTRIB_VALUE_UNQUOTED:if(!Z(de)){"&"===de?G.state=te.ATTRIB_VALUE_ENTITY_U:G.attribValue+=de;continue}ze(G),">"===de?Le(G):G.state=te.ATTRIB;continue;case te.CLOSE_TAG:if(G.tagName)">"===de?Ke(G):ae(I,de)?G.tagName+=de:G.script?(G.script+=""===de?Ke(G):Qe(G,"Invalid characters in closing tag");continue;case te.TEXT_ENTITY:case te.ATTRIB_VALUE_ENTITY_Q:case te.ATTRIB_VALUE_ENTITY_U:var pt,we;switch(G.state){case te.TEXT_ENTITY:pt=te.TEXT,we="textNode";break;case te.ATTRIB_VALUE_ENTITY_Q:pt=te.ATTRIB_VALUE_QUOTED,we="attribValue";break;case te.ATTRIB_VALUE_ENTITY_U:pt=te.ATTRIB_VALUE_UNQUOTED,we="attribValue"}";"===de?(G[we]+=Me(G),G.entity="",G.state=pt):ae(G.entity.length?K:O,de)?G.entity+=de:(Qe(G,"Invalid character in entity name"),G[we]+="&"+G.entity+de,G.entity="",G.state=pt);continue;default:throw new Error(G,"Unknown state: "+G.state)}return G.position>=G.bufferCheckPosition&&function(q){for(var G=Math.max(j.MAX_BUFFER_LENGTH,10),pe=0,de=0,je=k.length;deG)switch(k[de]){case"textNode":ye(q);break;case"cdata":ne(q,"oncdata",q.cdata),q.cdata="";break;case"script":ne(q,"onscript",q.script),q.script="";break;default:$e(q,"Max buffer length exceeded: "+k[de])}pe=Math.max(pe,_t)}q.bufferCheckPosition=j.MAX_BUFFER_LENGTH-pe+q.position}(G),G},resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){!function(q){ye(q),""!==q.cdata&&(ne(q,"oncdata",q.cdata),q.cdata=""),""!==q.script&&(ne(q,"onscript",q.script),q.script="")}(this)}};try{R=Y("stream").Stream}catch(q){R=function(){}}var T=j.EVENTS.filter(function(q){return"error"!==q&&"end"!==q});function y(q,G){if(!(this instanceof y))return new y(q,G);R.apply(this),this._parser=new Q(q,G),this.writable=!0,this.readable=!0;var pe=this;this._parser.onend=function(){pe.emit("end")},this._parser.onerror=function(de){pe.emit("error",de),pe._parser.error=null},this._decoder=null,T.forEach(function(de){Object.defineProperty(pe,"on"+de,{get:function(){return pe._parser["on"+de]},set:function(je){if(!je)return pe.removeAllListeners(de),pe._parser["on"+de]=je,je;pe.on(de,je)},enumerable:!0,configurable:!1})})}(y.prototype=Object.create(R.prototype,{constructor:{value:y}})).write=function(q){if("function"==typeof W&&"function"==typeof W.isBuffer&&W.isBuffer(q)){if(!this._decoder){var G=Y("string_decoder").StringDecoder;this._decoder=new G("utf8")}q=this._decoder.write(q)}return this._parser.write(q.toString()),this.emit("data",q),!0},y.prototype.end=function(q){return q&&q.length&&this.write(q),this._parser.end(),!0},y.prototype.on=function(q,G){var pe=this;return!pe._parser["on"+q]&&-1!==T.indexOf(q)&&(pe._parser["on"+q]=function(){var de=1===arguments.length?[arguments[0]]:Array.apply(null,arguments);de.splice(0,0,q),pe.emit.apply(pe,de)}),R.prototype.on.call(pe,q,G)};var z="http://www.w3.org/XML/1998/namespace",P="http://www.w3.org/2000/xmlns/",X={xml:z,xmlns:P},ue=/[:_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]/,I=/[:_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-]/,O=/[#:_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]/,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\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;function E(q){return" "===q||"\n"===q||"\r"===q||"\t"===q}function $(q){return'"'===q||"'"===q}function Z(q){return">"===q||E(q)}function ae(q,G){return q.test(G)}function oe(q,G){return!ae(q,G)}var q,G,pe,te=0;for(var Te in j.STATE={BEGIN:te++,BEGIN_WHITESPACE:te++,TEXT:te++,TEXT_ENTITY:te++,OPEN_WAKA:te++,SGML_DECL:te++,SGML_DECL_QUOTED:te++,DOCTYPE:te++,DOCTYPE_QUOTED:te++,DOCTYPE_DTD:te++,DOCTYPE_DTD_QUOTED:te++,COMMENT_STARTING:te++,COMMENT:te++,COMMENT_ENDING:te++,COMMENT_ENDED:te++,CDATA:te++,CDATA_ENDING:te++,CDATA_ENDING_2:te++,PROC_INST:te++,PROC_INST_BODY:te++,PROC_INST_ENDING:te++,OPEN_TAG:te++,OPEN_TAG_SLASH:te++,ATTRIB:te++,ATTRIB_NAME:te++,ATTRIB_NAME_SAW_WHITE:te++,ATTRIB_VALUE:te++,ATTRIB_VALUE_QUOTED:te++,ATTRIB_VALUE_CLOSED:te++,ATTRIB_VALUE_UNQUOTED:te++,ATTRIB_VALUE_ENTITY_Q:te++,ATTRIB_VALUE_ENTITY_U:te++,CLOSE_TAG:te++,CLOSE_TAG_SAW_WHITE:te++,SCRIPT:te++,SCRIPT_ENDING:te++},j.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},j.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(j.ENTITIES).forEach(function(q){var G=j.ENTITIES[q],pe="number"==typeof G?String.fromCharCode(G):G;j.ENTITIES[q]=pe}),j.STATE)j.STATE[j.STATE[Te]]=Te;function me(q,G,pe){q[G]&&q[G](pe)}function ne(q,G,pe){q.textNode&&ye(q),me(q,G,pe)}function ye(q){q.textNode=Oe(q.opt,q.textNode),q.textNode&&me(q,"ontext",q.textNode),q.textNode=""}function Oe(q,G){return q.trim&&(G=G.trim()),q.normalize&&(G=G.replace(/\s+/g," ")),G}function $e(q,G){return ye(q),q.trackPosition&&(G+="\nLine: "+q.line+"\nColumn: "+q.column+"\nChar: "+q.c),G=new Error(G),q.error=G,me(q,"onerror",G),q}function st(q){return q.sawRoot&&!q.closedRoot&&Qe(q,"Unclosed root tag"),q.state!==te.BEGIN&&q.state!==te.BEGIN_WHITESPACE&&q.state!==te.TEXT&&$e(q,"Unexpected end"),ye(q),q.c="",q.closed=!0,me(q,"onend"),Q.call(q,q.strict,q.opt),q}function Qe(q,G){if("object"!=typeof q||!(q instanceof Q))throw new Error("bad call to strictFail");q.strict&&$e(q,G)}function tt(q){q.strict||(q.tagName=q.tagName[q.looseCase]());var G=q.tags[q.tags.length-1]||q,pe=q.tag={name:q.tagName,attributes:{}};q.opt.xmlns&&(pe.ns=G.ns),q.attribList.length=0,ne(q,"onopentagstart",pe)}function Xe(q,G){var de=q.indexOf(":")<0?["",q]:q.split(":"),je=de[0],_t=de[1];return G&&"xmlns"===q&&(je="xmlns",_t=""),{prefix:je,local:_t}}function ze(q){if(q.strict||(q.attribName=q.attribName[q.looseCase]()),-1!==q.attribList.indexOf(q.attribName)||q.tag.attributes.hasOwnProperty(q.attribName))q.attribName=q.attribValue="";else{if(q.opt.xmlns){var G=Xe(q.attribName,!0),de=G.local;if("xmlns"===G.prefix)if("xml"===de&&q.attribValue!==z)Qe(q,"xml: prefix must be bound to "+z+"\nActual: "+q.attribValue);else if("xmlns"===de&&q.attribValue!==P)Qe(q,"xmlns: prefix must be bound to "+P+"\nActual: "+q.attribValue);else{var je=q.tag,_t=q.tags[q.tags.length-1]||q;je.ns===_t.ns&&(je.ns=Object.create(_t.ns)),je.ns[de]=q.attribValue}q.attribList.push([q.attribName,q.attribValue])}else q.tag.attributes[q.attribName]=q.attribValue,ne(q,"onattribute",{name:q.attribName,value:q.attribValue});q.attribName=q.attribValue=""}}function Le(q,G){if(q.opt.xmlns){var pe=q.tag,de=Xe(q.tagName);pe.prefix=de.prefix,pe.local=de.local,pe.uri=pe.ns[de.prefix]||"",pe.prefix&&!pe.uri&&(Qe(q,"Unbound namespace prefix: "+JSON.stringify(q.tagName)),pe.uri=de.prefix),pe.ns&&(q.tags[q.tags.length-1]||q).ns!==pe.ns&&Object.keys(pe.ns).forEach(function(In){ne(q,"onopennamespace",{prefix:In,uri:pe.ns[In]})});for(var _t=0,pt=q.attribList.length;_t",q.tagName="",void(q.state=te.SCRIPT);ne(q,"onscript",q.script),q.script=""}var G=q.tags.length,pe=q.tagName;q.strict||(pe=pe[q.looseCase]());for(var de=pe;G--&&q.tags[G].name!==de;)Qe(q,"Unexpected close tag");if(G<0)return Qe(q,"Unmatched closing tag: "+q.tagName),q.textNode+="",void(q.state=te.TEXT);q.tagName=pe;for(var _t=q.tags.length;_t-- >G;){var pt=q.tag=q.tags.pop();q.tagName=q.tag.name,ne(q,"onclosetag",q.tagName);var we={};for(var B in pt.ns)we[B]=pt.ns[B];q.opt.xmlns&&pt.ns!==(q.tags[q.tags.length-1]||q).ns&&Object.keys(pt.ns).forEach(function(V){ne(q,"onclosenamespace",{prefix:V,uri:pt.ns[V]})})}0===G&&(q.closedRoot=!0),q.tagName=q.attribValue=q.attribName="",q.attribList.length=0,q.state=te.TEXT}function Me(q){var de,G=q.entity,pe=G.toLowerCase(),je="";return q.ENTITIES[G]?q.ENTITIES[G]:q.ENTITIES[pe]?q.ENTITIES[pe]:("#"===(G=pe).charAt(0)&&("x"===G.charAt(1)?(G=G.slice(2),je=(de=parseInt(G,16)).toString(16)):(G=G.slice(1),je=(de=parseInt(G,10)).toString(10))),G=G.replace(/^0+/,""),isNaN(de)||je.toLowerCase()!==G?(Qe(q,"Invalid character entity"),"&"+q.entity+";"):String.fromCodePoint(de))}function Ue(q,G){"<"===G?(q.state=te.OPEN_WAKA,q.startTagPosition=q.position):E(G)||(Qe(q,"Non-whitespace before first tag."),q.textNode=G,q.state=te.TEXT)}function qe(q,G){var pe="";return G1114111||G(V)!==V)throw RangeError("Invalid code point: "+V);V<=65535?je.push(V):je.push(55296+((V-=65536)>>10),V%1024+56320),(we+1===B||je.length>de)&&(N+=q.apply(null,je),je.length=0)}return N},Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:pe,configurable:!0,writable:!0}):String.fromCodePoint=pe)}(void 0===he?this.sax={}:he)}).call(this)}).call(this,Y("buffer").Buffer)},{buffer:6,stream:87,string_decoder:5}],86:[function(Y,Se,he){(function(W,j){(function(){!function(k,Q){"use strict";if(!k.setImmediate){var T,H=1,w={},C=!1,R=k.document,K=Object.getPrototypeOf&&Object.getPrototypeOf(k);K=K&&K.setTimeout?K:k,"[object process]"==={}.toString.call(k.process)?T=function(E){W.nextTick(function(){A(E)})}:function(){if(k.postMessage&&!k.importScripts){var E=!0,$=k.onmessage;return k.onmessage=function(){E=!1},k.postMessage("","*"),k.onmessage=$,E}}()?(E="setImmediate$"+Math.random()+"$",$=function(Z){Z.source===k&&"string"==typeof Z.data&&0===Z.data.indexOf(E)&&A(+Z.data.slice(E.length))},k.addEventListener?k.addEventListener("message",$,!1):k.attachEvent("onmessage",$),T=function(Z){k.postMessage(E+Z,"*")}):k.MessageChannel?function(){var E=new MessageChannel;E.port1.onmessage=function($){A($.data)},T=function($){E.port2.postMessage($)}}():R&&"onreadystatechange"in R.createElement("script")?function(){var E=R.documentElement;T=function($){var Z=R.createElement("script");Z.onreadystatechange=function(){A($),Z.onreadystatechange=null,E.removeChild(Z),Z=null},E.appendChild(Z)}}():T=function(E){setTimeout(A,0,E)},K.setImmediate=function(E){"function"!=typeof E&&(E=new Function(""+E));for(var $=new Array(arguments.length-1),Z=0;Z<$.length;Z++)$[Z]=arguments[Z+1];return w[H]={callback:E,args:$},T(H),H++},K.clearImmediate=y}var E,$;function y(E){delete w[E]}function A(E){if(C)setTimeout(A,0,E);else{var $=w[E];if($){C=!0;try{!function(E){var $=E.callback,Z=E.args;switch(Z.length){case 0:$();break;case 1:$(Z[0]);break;case 2:$(Z[0],Z[1]);break;case 3:$(Z[0],Z[1],Z[2]);break;default:$.apply(void 0,Z)}}($)}finally{y(E),C=!1}}}}}("undefined"==typeof self?void 0===j?this:j:self)}).call(this)}).call(this,Y("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:44}],87:[function(Y,Se,he){Se.exports=k;var W=Y("events").EventEmitter;function k(){W.call(this)}Y("inherits")(k,W),k.Readable=Y("readable-stream/lib/_stream_readable.js"),k.Writable=Y("readable-stream/lib/_stream_writable.js"),k.Duplex=Y("readable-stream/lib/_stream_duplex.js"),k.Transform=Y("readable-stream/lib/_stream_transform.js"),k.PassThrough=Y("readable-stream/lib/_stream_passthrough.js"),k.finished=Y("readable-stream/lib/internal/streams/end-of-stream.js"),k.pipeline=Y("readable-stream/lib/internal/streams/pipeline.js"),k.Stream=k,k.prototype.pipe=function(Q,H){var w=this;function C(z){Q.writable&&!1===Q.write(z)&&w.pause&&w.pause()}function R(){w.readable&&w.resume&&w.resume()}w.on("data",C),Q.on("drain",R),!Q._isStdio&&(!H||!1!==H.end)&&(w.on("end",b),w.on("close",y));var T=!1;function b(){T||(T=!0,Q.end())}function y(){T||(T=!0,"function"==typeof Q.destroy&&Q.destroy())}function S(z){if(A(),0===W.listenerCount(this,"error"))throw z}function A(){w.removeListener("data",C),Q.removeListener("drain",R),w.removeListener("end",b),w.removeListener("close",y),w.removeListener("error",S),Q.removeListener("error",S),w.removeListener("end",A),w.removeListener("close",A),Q.removeListener("close",A)}return w.on("error",S),Q.on("error",S),w.on("end",A),w.on("close",A),Q.on("close",A),Q.emit("pipe",w),Q}},{events:8,inherits:10,"readable-stream/lib/_stream_duplex.js":68,"readable-stream/lib/_stream_passthrough.js":69,"readable-stream/lib/_stream_readable.js":70,"readable-stream/lib/_stream_transform.js":71,"readable-stream/lib/_stream_writable.js":72,"readable-stream/lib/internal/streams/end-of-stream.js":76,"readable-stream/lib/internal/streams/pipeline.js":78}],88:[function(Y,Se,he){arguments[4][5][0].apply(he,arguments)},{dup:5,"safe-buffer":84}],89:[function(Y,Se,he){(function(W,j){(function(){var k=Y("process/browser.js").nextTick,Q=Function.prototype.apply,H=Array.prototype.slice,w={},C=0;function R(T,b){this._id=T,this._clearFn=b}he.setTimeout=function(){return new R(Q.call(setTimeout,window,arguments),clearTimeout)},he.setInterval=function(){return new R(Q.call(setInterval,window,arguments),clearInterval)},he.clearTimeout=he.clearInterval=function(T){T.close()},R.prototype.unref=R.prototype.ref=function(){},R.prototype.close=function(){this._clearFn.call(window,this._id)},he.enroll=function(T,b){clearTimeout(T._idleTimeoutId),T._idleTimeout=b},he.unenroll=function(T){clearTimeout(T._idleTimeoutId),T._idleTimeout=-1},he._unrefActive=he.active=function(T){clearTimeout(T._idleTimeoutId);var b=T._idleTimeout;b>=0&&(T._idleTimeoutId=setTimeout(function(){T._onTimeout&&T._onTimeout()},b))},he.setImmediate="function"==typeof W?W:function(T){var b=C++,y=!(arguments.length<2)&&H.call(arguments,1);return w[b]=!0,k(function(){w[b]&&(y?T.apply(null,y):T.call(null),he.clearImmediate(b))}),b},he.clearImmediate="function"==typeof j?j:function(T){delete w[T]}}).call(this)}).call(this,Y("timers").setImmediate,Y("timers").clearImmediate)},{"process/browser.js":44,timers:89}],90:[function(Y,Se,he){(function(W){(function(){function k(Q){try{if(!W.localStorage)return!1}catch(w){return!1}var H=W.localStorage[Q];return null!=H&&"true"===String(H).toLowerCase()}Se.exports=function(Q,H){if(k("noDeprecation"))return Q;var w=!1;return function(){if(!w){if(k("throwDeprecation"))throw new Error(H);k("traceDeprecation")?console.trace(H):console.warn(H),w=!0}return Q.apply(this,arguments)}}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],91:[function(Y,Se,he){"use strict";Se.exports=function(W){W.prototype[Symbol.iterator]=function*(){for(let j=this.head;j;j=j.next)yield j.value}}},{}],92:[function(Y,Se,he){"use strict";function W(w){var C=this;if(C instanceof W||(C=new W),C.tail=null,C.head=null,C.length=0,w&&"function"==typeof w.forEach)w.forEach(function(b){C.push(b)});else if(arguments.length>0)for(var R=0,T=arguments.length;R1)R=C;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");T=this.head.next,R=this.head.value}for(var b=0;null!==T;b++)R=w(R,T.value,b),T=T.next;return R},W.prototype.reduceReverse=function(w,C){var R,T=this.tail;if(arguments.length>1)R=C;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");T=this.tail.prev,R=this.tail.value}for(var b=this.length-1;null!==T;b--)R=w(R,T.value,b),T=T.prev;return R},W.prototype.toArray=function(){for(var w=new Array(this.length),C=0,R=this.head;null!==R;C++)w[C]=R.value,R=R.next;return w},W.prototype.toArrayReverse=function(){for(var w=new Array(this.length),C=0,R=this.tail;null!==R;C++)w[C]=R.value,R=R.prev;return w},W.prototype.slice=function(w,C){(C=C||this.length)<0&&(C+=this.length),(w=w||0)<0&&(w+=this.length);var R=new W;if(Cthis.length&&(C=this.length);for(var T=0,b=this.head;null!==b&&Tthis.length&&(C=this.length);for(var T=this.length,b=this.tail;null!==b&&T>C;T--)b=b.prev;for(;null!==b&&T>w;T--,b=b.prev)R.push(b.value);return R},W.prototype.splice=function(w,C,...R){w>this.length&&(w=this.length-1),w<0&&(w=this.length+w);for(var T=0,b=this.head;null!==b&&T{"use strict";Ut.exports=et,Ut.exports.default=et;var it=1e20;function et(Y,Se,he,W,j,k){this.fontSize=Y||24,this.buffer=void 0===Se?3:Se,this.cutoff=W||.25,this.fontFamily=j||"sans-serif",this.fontWeight=k||"normal",this.radius=he||8;var Q=this.size=this.fontSize+2*this.buffer,H=Q+2*this.buffer;this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=Q,this.ctx=this.canvas.getContext("2d"),this.ctx.font=this.fontWeight+" "+this.fontSize+"px "+this.fontFamily,this.ctx.textAlign="left",this.ctx.fillStyle="black",this.gridOuter=new Float64Array(H*H),this.gridInner=new Float64Array(H*H),this.f=new Float64Array(H),this.z=new Float64Array(H+1),this.v=new Uint16Array(H),this.useMetrics=void 0!==this.ctx.measureText("A").actualBoundingBoxLeft,this.middle=Math.round(Q/2*(navigator.userAgent.indexOf("Gecko/")>=0?1.2:1))}function Dt(Y,Se,he,W,j,k){for(var Q=0;Q-1);k[++w]=H,Q[w]=C,Q[w+1]=it}for(H=0,w=0;H{Ut.exports=function(et,yt){var ee=yt.length;if(0!==ee){var Dt=et.length;et.length+=ee;for(var dt=0;dt{"use strict";var yt=(()=>{return(Dt=yt||(yt={})).typeOfFunction="function",Dt.boolTrue=!0,yt;var Dt})();function ee(Dt,dt,Y){if(!Y||typeof Y.value!==yt.typeOfFunction)throw new TypeError("Only methods can be decorated with @bind. <"+dt+"> is not a method!");return{configurable:yt.boolTrue,get:function(){var Se=Y.value.bind(this);return Object.defineProperty(this,dt,{value:Se,configurable:yt.boolTrue,writable:yt.boolTrue}),Se}}}it.ak=ee,it.ZP=ee},7266:(Ut,it,et)=>{Ut.exports={ResizeSensor:et(9835),ElementQueries:et(4845)}},4845:function(Ut,it,et){"use strict";var yt,ee,Dt;"undefined"!=typeof window&&window,ee=[et(9835)],void 0!==(Dt="function"==typeof(yt=function(dt){var Y=function(){var he,W={},j=[];function k(I){I||(I=document.documentElement);var O=window.getComputedStyle(I,null).fontSize;return parseFloat(O)||16}function H(I,O){var K=O.split(/\d/),E=K[K.length-1];switch(O=parseFloat(O),E){case"px":return O;case"em":return O*k(I);case"rem":return O*k();case"vw":return O*document.documentElement.clientWidth/100;case"vh":return O*document.documentElement.clientHeight/100;case"vmin":case"vmax":var $=document.documentElement.clientWidth/100,Z=document.documentElement.clientHeight/100;return O*(0,Math["vmin"===E?"min":"max"])($,Z);default:return O}}function w(I,O){this.element=I;var K,E,$,Z,ae,oe,te,Te,me=["min-width","min-height","max-width","max-height"];this.call=function(){for(K in $=function(I){if(!I.getBoundingClientRect)return{width:I.offsetWidth,height:I.offsetHeight};var O=I.getBoundingClientRect();return{width:Math.round(O.width),height:Math.round(O.height)}}(this.element),oe={},W[O])!W[O].hasOwnProperty(K)||(Z=H(this.element,(E=W[O][K]).value),ae="width"===E.property?$.width:$.height,te="","min"===E.mode&&ae>=Z&&(te+=E.value),"max"===E.mode&&ae<=Z&&(te+=E.value),oe[Te=E.mode+"-"+E.property]||(oe[Te]=""),te&&-1===(" "+oe[Te]+" ").indexOf(" "+te+" ")&&(oe[Te]+=" "+te));for(var ne in me)!me.hasOwnProperty(ne)||(oe[me[ne]]?this.element.setAttribute(me[ne],oe[me[ne]].substr(1)):this.element.removeAttribute(me[ne]))}}function C(I,O){I.elementQueriesSetupInformation||(I.elementQueriesSetupInformation=new w(I,O)),I.elementQueriesSensor||(I.elementQueriesSensor=new dt(I,function(){I.elementQueriesSetupInformation.call()}))}function R(I,O,K,E){if(void 0===W[I]){W[I]=[];var $=j.length;he.innerHTML+="\n"+I+" {animation: 0.1s element-queries;}",he.innerHTML+="\n"+I+" > .resize-sensor {min-width: "+$+"px;}",j.push(I)}W[I].push({mode:O,property:K,value:E})}function T(I){var O;if(document.querySelectorAll&&(O=I?I.querySelectorAll.bind(I):document.querySelectorAll.bind(document)),!O&&"undefined"!=typeof $$&&(O=$$),!O&&"undefined"!=typeof jQuery&&(O=jQuery),!O)throw"No document.querySelectorAll, jQuery or Mootools's $$ found.";return O}function y(I){var O=[],K=[],E=[],$=0,Z=-1,ae=[];for(var oe in I.children)if(I.children.hasOwnProperty(oe)&&I.children[oe].tagName&&"img"===I.children[oe].tagName.toLowerCase()){O.push(I.children[oe]);var te=I.children[oe].getAttribute("min-width")||I.children[oe].getAttribute("data-min-width"),Te=I.children[oe].getAttribute("data-src")||I.children[oe].getAttribute("url");E.push(Te),K.push({minWidth:te}),te?I.children[oe].style.display="none":($=O.length-1,I.children[oe].style.display="block")}function ne(){var Oe,ye=!1;for(Oe in O)!O.hasOwnProperty(Oe)||K[Oe].minWidth&&I.offsetWidth>K[Oe].minWidth&&(ye=Oe);if(ye||(ye=$),Z!==ye)if(ae[ye])O[Z].style.display="none",O[ye].style.display="block",Z=ye;else{var $e=new Image;$e.onload=function(){O[ye].src=E[ye],O[Z].style.display="none",O[ye].style.display="block",ae[ye]=!0,Z=ye},$e.src=E[ye]}else O[ye].src=E[ye]}Z=$,I.resizeSensorInstance=new dt(I,ne),ne()}var A=/,?[\s\t]*([^,\n]*?)((?:\[[\s\t]*?(?:min|max)-(?:width|height)[\s\t]*?[~$\^]?=[\s\t]*?"[^"]*?"[\s\t]*?])+)([^,\n\s\{]*)/gim,z=/\[[\s\t]*?(min|max)-(width|height)[\s\t]*?[~$\^]?=[\s\t]*?"([^"]*?)"[\s\t]*?]/gim;function P(I){var O,K,E,$;for(I=I.replace(/'/g,'"');null!==(O=A.exec(I));)for(K=O[1]+O[3],E=O[2];null!==($=z.exec(E));)R(K,$[1],$[2],$[3])}function X(I){var O="";if(I)if("string"==typeof I)(-1!==(I=I.toLowerCase()).indexOf("min-width")||-1!==I.indexOf("max-width"))&&P(I);else for(var K=0,E=I.length;K 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),ue=!0);for(var O=0,K=document.styleSheets.length;O{var yt=et(3910),ee=et(9369),Dt=et(322);function dt(Q,H,w){if(!yt(Q))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(!Q.hasNode(H))throw new Error('graphology-shortest-path: the "'+H+'" source node does not exist in the given graph.');if(!Q.hasNode(w))throw new Error('graphology-shortest-path: the "'+w+'" target node does not exist in the given graph.');if((H=""+H)==(w=""+w))return[H];var C=Q.inboundNeighbors.bind(Q),R=Q.outboundNeighbors.bind(Q),T={},b={};T[H]=null,b[w]=null;var A,z,P,X,ue,I,O,K,y=[H],S=[w],E=!1;e:for(;y.length&&S.length;)if(y.length<=S.length){for(A=y,y=[],ue=0,O=A.length;ue{Ut.exports=function(et){return null!==et&&"object"==typeof et&&"function"==typeof et.addUndirectedEdgeWithKey&&"function"==typeof et.dropNode&&"boolean"==typeof et.multi}},698:function(Ut){Ut.exports=function(){"use strict";function it(re){return(it="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(fe){return typeof fe}:function(fe){return fe&&"function"==typeof Symbol&&fe.constructor===Symbol&&fe!==Symbol.prototype?"symbol":typeof fe})(re)}function et(re,fe){re.prototype=Object.create(fe.prototype),re.prototype.constructor=re,ee(re,fe)}function yt(re){return(yt=Object.setPrototypeOf?Object.getPrototypeOf:function(fe){return fe.__proto__||Object.getPrototypeOf(fe)})(re)}function ee(re,fe){return(ee=Object.setPrototypeOf||function(se,M){return se.__proto__=M,se})(re,fe)}function Dt(){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(re){return!1}}function dt(re,fe,se){return(dt=Dt()?Reflect.construct:function(M,L,J){var Ee=[null];Ee.push.apply(Ee,L);var Fe=new(Function.bind.apply(M,Ee));return J&&ee(Fe,J.prototype),Fe}).apply(null,arguments)}function Y(re){var fe="function"==typeof Map?new Map:void 0;return(Y=function(se){if(null===se||-1===Function.toString.call(se).indexOf("[native code]"))return se;if("function"!=typeof se)throw new TypeError("Super expression must either be null or a function");if(void 0!==fe){if(fe.has(se))return fe.get(se);fe.set(se,L)}function L(){return dt(se,arguments,yt(this).constructor)}return L.prototype=Object.create(se.prototype,{constructor:{value:L,enumerable:!1,writable:!0,configurable:!0}}),ee(L,se)})(re)}function Se(re){if(void 0===re)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return re}var he=function(){for(var re=arguments[0],fe=1,se=arguments.length;fe0&&Ee.length>L&&!Ee.warned){Ee.warned=!0;var nt=new Error("Possible EventEmitter memory leak detected. "+Ee.length+" "+String(fe)+" listeners added. Use emitter.setMaxListeners() to increase limit");nt.name="MaxListenersExceededWarning",nt.emitter=re,nt.type=fe,nt.count=Ee.length,console&&console.warn&&console.warn(nt)}return re}function I(){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(re,fe,se){var M={fired:!1,wrapFn:void 0,target:re,type:fe,listener:se},L=I.bind(M);return L.listener=se,M.wrapFn=L,L}function K(re,fe,se){var M=re._events;if(void 0===M)return[];var L=M[fe];return void 0===L?[]:"function"==typeof L?se?[L.listener||L]:[L]:se?function(J){for(var Ee=new Array(J.length),Fe=0;Fe0&&(J=fe[0]),J instanceof Error)throw J;var Ee=new Error("Unhandled error."+(J?" ("+J.message+")":""));throw Ee.context=J,Ee}var Fe=L[re];if(void 0===Fe)return!1;if("function"==typeof Fe)y(Fe,this,fe);else{var nt=Fe.length,Pt=$(Fe,nt);for(se=0;se=0;J--)if(se[J]===fe||se[J].listener===fe){Ee=se[J].listener,L=J;break}if(L<0)return this;0===L?se.shift():function(Fe,nt){for(;nt+1=0;M--)this.removeListener(re,fe[M]);return this},A.prototype.listeners=function(re){return K(this,re,!0)},A.prototype.rawListeners=function(re){return K(this,re,!1)},A.listenerCount=function(re,fe){return"function"==typeof re.listenerCount?re.listenerCount(fe):E.call(re,fe)},A.prototype.listenerCount=E,A.prototype.eventNames=function(){return this._eventsCount>0?R(this._events):[]},ae.prototype.next=function(){if(this.done)return{done:!0};var re=this._next();return re.done&&(this.done=!0),re},"undefined"!=typeof Symbol&&(ae.prototype[Symbol.iterator]=function(){return this}),ae.of=function(){var re=arguments,fe=re.length,se=0;return new ae(function(){return se>=fe?{done:!0}:{done:!1,value:re[se++]}})},ae.empty=function(){var re=new ae(null);return re.done=!0,re},ae.is=function(re){return re instanceof ae||"object"==typeof re&&null!==re&&"function"==typeof re.next};var oe=ae,te=function(re,fe){for(var se,M=arguments.length>1?fe:1/0,L=M!==1/0?new Array(M):[],J=0;;){if(J===M)return L;if((se=re.next()).done)return J!==fe?L.slice(0,J):L;L[J++]=se.value}},Te=function(re){function fe(se,M){var L;return(L=re.call(this)||this).name="GraphError",L.message=se||"",L.data=M||{},L}return et(fe,re),fe}(Y(Error)),me=function(re){function fe(se,M){var L;return(L=re.call(this,se,M)||this).name="InvalidArgumentsGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(Se(L),fe.prototype.constructor),L}return et(fe,re),fe}(Te),ne=function(re){function fe(se,M){var L;return(L=re.call(this,se,M)||this).name="NotFoundGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(Se(L),fe.prototype.constructor),L}return et(fe,re),fe}(Te),ye=function(re){function fe(se,M){var L;return(L=re.call(this,se,M)||this).name="UsageGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(Se(L),fe.prototype.constructor),L}return et(fe,re),fe}(Te);function Oe(re,fe){this.key=re,this.attributes=fe,this.inDegree=0,this.outDegree=0,this.undirectedDegree=0,this.directedSelfLoops=0,this.undirectedSelfLoops=0,this.in={},this.out={},this.undirected={}}function $e(re,fe){this.key=re,this.attributes=fe,this.inDegree=0,this.outDegree=0,this.directedSelfLoops=0,this.in={},this.out={}}function st(re,fe){this.key=re,this.attributes=fe,this.undirectedDegree=0,this.undirectedSelfLoops=0,this.undirected={}}function Qe(re,fe,se,M,L,J){this.key=fe,this.attributes=J,this.undirected=re,this.source=M,this.target=L,this.generatedKey=se}function tt(re,fe,se,M,L,J,Ee){var Fe,nt,Pt="out",We="in";if(fe&&(Pt=We="undirected"),re.multi){if(void 0===(nt=(Fe=J[Pt])[L])&&(nt=new Set,Fe[L]=nt),nt.add(se),M===L&&fe)return;void 0===(Fe=Ee[We])[M]&&(Fe[M]=nt)}else{if(J[Pt][L]=se,M===L&&fe)return;Ee[We][M]=se}}function Xe(re,fe,se){var M=re.multi,L=se.source,J=se.target,Ee=L.key,Fe=J.key,nt=L[fe?"undirected":"out"],Pt=fe?"undirected":"in";if(Fe in nt)if(M){var We=nt[Fe];1===We.size?(delete nt[Fe],delete J[Pt][Ee]):We.delete(se)}else delete nt[Fe];M||delete J[Pt][Ee]}$e.prototype.upgradeToMixed=function(){this.undirectedDegree=0,this.undirectedSelfLoops=0,this.undirected={}},st.prototype.upgradeToMixed=function(){this.inDegree=0,this.outDegree=0,this.directedSelfLoops=0,this.in={},this.out={}};var ze=[{name:function(re){return"get".concat(re,"Attribute")},attacher:function(re,fe,se){re.prototype[fe]=function(M,L){var J;if("mixed"!==this.type&&"mixed"!==se&&se!==this.type)throw new ye("Graph.".concat(fe,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new ye("Graph.".concat(fe,": 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 Ee=""+M,Fe=""+L;if(L=arguments[2],!(J=W(this,Ee,Fe,se)))throw new ne("Graph.".concat(fe,': could not find an edge for the given path ("').concat(Ee,'" - "').concat(Fe,'").'))}else if(!(J=this._edges.get(M=""+M)))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" edge in the graph.'));if("mixed"!==se&&J.undirected!==("undirected"===se))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" ').concat(se," edge in the graph."));return J.attributes[L]}}},{name:function(re){return"get".concat(re,"Attributes")},attacher:function(re,fe,se){re.prototype[fe]=function(M){var L;if("mixed"!==this.type&&"mixed"!==se&&se!==this.type)throw new ye("Graph.".concat(fe,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>1){if(this.multi)throw new ye("Graph.".concat(fe,": 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 J=""+M,Ee=""+arguments[1];if(!(L=W(this,J,Ee,se)))throw new ne("Graph.".concat(fe,': could not find an edge for the given path ("').concat(J,'" - "').concat(Ee,'").'))}else if(!(L=this._edges.get(M=""+M)))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" edge in the graph.'));if("mixed"!==se&&L.undirected!==("undirected"===se))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" ').concat(se," edge in the graph."));return L.attributes}}},{name:function(re){return"has".concat(re,"Attribute")},attacher:function(re,fe,se){re.prototype[fe]=function(M,L){var J;if("mixed"!==this.type&&"mixed"!==se&&se!==this.type)throw new ye("Graph.".concat(fe,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new ye("Graph.".concat(fe,": 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 Ee=""+M,Fe=""+L;if(L=arguments[2],!(J=W(this,Ee,Fe,se)))throw new ne("Graph.".concat(fe,': could not find an edge for the given path ("').concat(Ee,'" - "').concat(Fe,'").'))}else if(!(J=this._edges.get(M=""+M)))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" edge in the graph.'));if("mixed"!==se&&J.undirected!==("undirected"===se))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" ').concat(se," edge in the graph."));return J.attributes.hasOwnProperty(L)}}},{name:function(re){return"set".concat(re,"Attribute")},attacher:function(re,fe,se){re.prototype[fe]=function(M,L,J){var Ee;if("mixed"!==this.type&&"mixed"!==se&&se!==this.type)throw new ye("Graph.".concat(fe,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>3){if(this.multi)throw new ye("Graph.".concat(fe,": 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=""+M,nt=""+L;if(L=arguments[2],J=arguments[3],!(Ee=W(this,Fe,nt,se)))throw new ne("Graph.".concat(fe,': could not find an edge for the given path ("').concat(Fe,'" - "').concat(nt,'").'))}else if(!(Ee=this._edges.get(M=""+M)))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" edge in the graph.'));if("mixed"!==se&&Ee.undirected!==("undirected"===se))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" ').concat(se," edge in the graph."));return Ee.attributes[L]=J,this.emit("edgeAttributesUpdated",{key:Ee.key,type:"set",attributes:Ee.attributes,name:L}),this}}},{name:function(re){return"update".concat(re,"Attribute")},attacher:function(re,fe,se){re.prototype[fe]=function(M,L,J){var Ee;if("mixed"!==this.type&&"mixed"!==se&&se!==this.type)throw new ye("Graph.".concat(fe,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>3){if(this.multi)throw new ye("Graph.".concat(fe,": 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=""+M,nt=""+L;if(L=arguments[2],J=arguments[3],!(Ee=W(this,Fe,nt,se)))throw new ne("Graph.".concat(fe,': could not find an edge for the given path ("').concat(Fe,'" - "').concat(nt,'").'))}else if(!(Ee=this._edges.get(M=""+M)))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" edge in the graph.'));if("function"!=typeof J)throw new me("Graph.".concat(fe,": updater should be a function."));if("mixed"!==se&&Ee.undirected!==("undirected"===se))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" ').concat(se," edge in the graph."));return Ee.attributes[L]=J(Ee.attributes[L]),this.emit("edgeAttributesUpdated",{key:Ee.key,type:"set",attributes:Ee.attributes,name:L}),this}}},{name:function(re){return"remove".concat(re,"Attribute")},attacher:function(re,fe,se){re.prototype[fe]=function(M,L){var J;if("mixed"!==this.type&&"mixed"!==se&&se!==this.type)throw new ye("Graph.".concat(fe,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new ye("Graph.".concat(fe,": 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 Ee=""+M,Fe=""+L;if(L=arguments[2],!(J=W(this,Ee,Fe,se)))throw new ne("Graph.".concat(fe,': could not find an edge for the given path ("').concat(Ee,'" - "').concat(Fe,'").'))}else if(!(J=this._edges.get(M=""+M)))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" edge in the graph.'));if("mixed"!==se&&J.undirected!==("undirected"===se))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" ').concat(se," edge in the graph."));return delete J.attributes[L],this.emit("edgeAttributesUpdated",{key:J.key,type:"remove",attributes:J.attributes,name:L}),this}}},{name:function(re){return"replace".concat(re,"Attributes")},attacher:function(re,fe,se){re.prototype[fe]=function(M,L){var J;if("mixed"!==this.type&&"mixed"!==se&&se!==this.type)throw new ye("Graph.".concat(fe,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new ye("Graph.".concat(fe,": 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 Ee=""+M,Fe=""+L;if(L=arguments[2],!(J=W(this,Ee,Fe,se)))throw new ne("Graph.".concat(fe,': could not find an edge for the given path ("').concat(Ee,'" - "').concat(Fe,'").'))}else if(!(J=this._edges.get(M=""+M)))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" edge in the graph.'));if(!k(L))throw new me("Graph.".concat(fe,": provided attributes are not a plain object."));if("mixed"!==se&&J.undirected!==("undirected"===se))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" ').concat(se," edge in the graph."));return J.attributes=L,this.emit("edgeAttributesUpdated",{key:J.key,type:"replace",attributes:J.attributes}),this}}},{name:function(re){return"merge".concat(re,"Attributes")},attacher:function(re,fe,se){re.prototype[fe]=function(M,L){var J;if("mixed"!==this.type&&"mixed"!==se&&se!==this.type)throw new ye("Graph.".concat(fe,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new ye("Graph.".concat(fe,": 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 Ee=""+M,Fe=""+L;if(L=arguments[2],!(J=W(this,Ee,Fe,se)))throw new ne("Graph.".concat(fe,': could not find an edge for the given path ("').concat(Ee,'" - "').concat(Fe,'").'))}else if(!(J=this._edges.get(M=""+M)))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" edge in the graph.'));if(!k(L))throw new me("Graph.".concat(fe,": provided attributes are not a plain object."));if("mixed"!==se&&J.undirected!==("undirected"===se))throw new ne("Graph.".concat(fe,': could not find the "').concat(M,'" ').concat(se," edge in the graph."));return he(J.attributes,L),this.emit("edgeAttributesUpdated",{key:J.key,type:"merge",attributes:J.attributes,data:L}),this}}}],Le=oe,Ke=function(){var re,fe=arguments,se=-1;return new Le(function M(){if(!re){if(++se>=fe.length)return{done:!0};re=fe[se]}var L=re.next();return L.done?(re=null,M()):L})},Me=[{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(re,fe){for(var se in fe)re.push(fe[se].key)}function qe(re,fe){for(var se in fe)fe[se].forEach(function(M){return re.push(M.key)})}function ke(re,fe,se){for(var M in re)if(M!==se){var L=re[M];fe(L.key,L.attributes,L.source.key,L.target.key,L.source.attributes,L.target.attributes,L.undirected,L.generatedKey)}}function q(re,fe,se){for(var M in re)M!==se&&re[M].forEach(function(L){return fe(L.key,L.attributes,L.source.key,L.target.key,L.source.attributes,L.target.attributes,L.undirected,L.generatedKey)})}function G(re,fe,se){for(var M in re)if(M!==se){var L=re[M];if(fe(L.key,L.attributes,L.source.key,L.target.key,L.source.attributes,L.target.attributes,L.undirected,L.generatedKey))return!0}return!1}function pe(re,fe,se){var M,L,J,Ee,Fe;for(var nt in re)if(nt!==se)for(M=re[nt].values();!0!==(L=M.next()).done;)if(Ee=(J=L.value).source,fe(J.key,J.attributes,Ee.key,(Fe=J.target).key,Ee.attributes,Fe.attributes,J.undirected,J.generatedKey))return!0;return!1}function de(re,fe){var se=Object.keys(re),M=se.length,L=null,J=0;return new oe(function Ee(){var Fe;if(L){var nt=L.next();if(nt.done)return L=null,J++,Ee();Fe=nt.value}else{if(J>=M)return{done:!0};var Pt=se[J];if(Pt===fe)return J++,Ee();if((Fe=re[Pt])instanceof Set)return L=Fe.values(),Ee();J++}return{done:!1,value:[Fe.key,Fe.attributes,Fe.source.key,Fe.target.key,Fe.source.attributes,Fe.target.attributes]}})}function je(re,fe,se){var M=fe[se];M&&re.push(M.key)}function _t(re,fe,se){var M=fe[se];M&&M.forEach(function(L){return re.push(L.key)})}function pt(re,fe,se){var M=re[fe];if(M){var L=M.source,J=M.target;se(M.key,M.attributes,L.key,J.key,L.attributes,J.attributes,M.undirected,M.generatedKey)}}function we(re,fe,se){var M=re[fe];M&&M.forEach(function(L){return se(L.key,L.attributes,L.source.key,L.target.key,L.source.attributes,L.target.attributes,L.undirected,L.generatedKey)})}function B(re,fe,se){var M=re[fe];if(M){var L=M.source,J=M.target;return se(M.key,M.attributes,L.key,J.key,L.attributes,J.attributes,M.undirected,M.generatedKey)}}function N(re,fe,se){var M=re[fe];if(M){for(var L,J,Ee=M.values();!0!==(L=Ee.next()).done;)if(se((J=L.value).key,J.attributes,J.source.key,J.target.key,J.source.attributes,J.target.attributes,J.undirected,J.generatedKey))return!0;return!1}}function V(re,fe){var se=re[fe];if(se instanceof Set){var M=se.values();return new oe(function(){var L=M.next();if(L.done)return L;var J=L.value;return{done:!1,value:[J.key,J.attributes,J.source.key,J.target.key,J.source.attributes,J.target.attributes]}})}return oe.of([se.key,se.attributes,se.source.key,se.target.key,se.source.attributes,se.target.attributes])}function Re(re,fe){if(0===re.size)return[];if("mixed"===fe||fe===re.type)return"function"==typeof Array.from?Array.from(re._edges.keys()):te(re._edges.keys(),re._edges.size);for(var se,M,J=new Array("undirected"===fe?re.undirectedSize:re.directedSize),Ee="undirected"===fe,Fe=re._edges.values(),nt=0;!0!==(se=Fe.next()).done;)(M=se.value).undirected===Ee&&(J[nt++]=M.key);return J}function Ze(re,fe,se){if(0!==re.size)for(var M,L,J="mixed"!==fe&&fe!==re.type,Ee="undirected"===fe,Fe=re._edges.values();!0!==(M=Fe.next()).done;)if(L=M.value,!J||L.undirected===Ee){var qt=L.source,St=L.target;se(L.key,L.attributes,qt.key,St.key,qt.attributes,St.attributes,L.undirected,L.generatedKey)}}function Tt(re,fe,se){if(0!==re.size)for(var M,L,J="mixed"!==fe&&fe!==re.type,Ee="undirected"===fe,Fe=re._edges.values();!0!==(M=Fe.next()).done;)if(L=M.value,!J||L.undirected===Ee){var qt=L.source,St=L.target;if(se(L.key,L.attributes,qt.key,St.key,qt.attributes,St.attributes,L.undirected,L.generatedKey))break}}function kt(re,fe){if(0===re.size)return oe.empty();var se="mixed"!==fe&&fe!==re.type,M="undirected"===fe,L=re._edges.values();return new oe(function(){for(var J,Ee;;){if((J=L.next()).done)return J;if(Ee=J.value,!se||Ee.undirected===M)break}return{value:[Ee.key,Ee.attributes,Ee.source.key,Ee.target.key,Ee.source.attributes,Ee.target.attributes],done:!1}})}function In(re,fe,se,M){var L=[],J=re?qe:Ue;return"undirected"!==fe&&("out"!==se&&J(L,M.in),"in"!==se&&J(L,M.out),!se&&M.directedSelfLoops>0&&L.splice(L.lastIndexOf(M.key),1)),"directed"!==fe&&J(L,M.undirected),L}function Nn(re,fe,se,M,L){var J=re?q:ke;"undirected"!==fe&&("out"!==se&&J(M.in,L),"in"!==se&&J(M.out,L,se?null:M.key)),"directed"!==fe&&J(M.undirected,L)}function Yn(re,fe,se,M,L){var J=re?pe:G;"undirected"!==fe&&("out"!==se&&J(M.in,L)||"in"!==se&&J(M.out,L,se?null:M.key))||"directed"===fe||J(M.undirected,L)}function Mi(re,fe,se){var M=oe.empty();return"undirected"!==re&&("out"!==fe&&void 0!==se.in&&(M=Ke(M,de(se.in))),"in"!==fe&&void 0!==se.out&&(M=Ke(M,de(se.out,fe?null:se.key)))),"directed"!==re&&void 0!==se.undirected&&(M=Ke(M,de(se.undirected))),M}function xi(re,fe,se,M,L){var J=fe?_t:je,Ee=[];return"undirected"!==re&&(void 0!==M.in&&"out"!==se&&J(Ee,M.in,L),void 0!==M.out&&"in"!==se&&J(Ee,M.out,L),!se&&M.directedSelfLoops>0&&Ee.splice(Ee.lastIndexOf(M.key),1)),"directed"!==re&&void 0!==M.undirected&&J(Ee,M.undirected,L),Ee}function Xr(re,fe,se,M,L,J){var Ee=fe?we:pt;"undirected"!==re&&(void 0!==M.in&&"out"!==se&&Ee(M.in,L,J),M.key!==L&&void 0!==M.out&&"in"!==se&&Ee(M.out,L,J)),"directed"!==re&&void 0!==M.undirected&&Ee(M.undirected,L,J)}function Ls(re,fe,se,M,L,J){var Ee=fe?N:B;"undirected"!==re&&(void 0!==M.in&&"out"!==se&&Ee(M.in,L,J)||M.key!==L&&void 0!==M.out&&"in"!==se&&Ee(M.out,L,J,se?null:M.key))||"directed"===re||void 0===M.undirected||Ee(M.undirected,L,J)}function fs(re,fe,se,M){var L=oe.empty();return"undirected"!==re&&(void 0!==se.in&&"out"!==fe&&M in se.in&&(L=Ke(L,V(se.in,M))),void 0!==se.out&&"in"!==fe&&M in se.out&&(L=Ke(L,V(se.out,M)))),"directed"!==re&&void 0!==se.undirected&&M in se.undirected&&(L=Ke(L,V(se.undirected,M))),L}var Bs=[{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 Kr(re,fe){if(void 0!==fe)for(var se in fe)re.add(se)}function xa(re,fe,se){if("mixed"!==re){if("undirected"===re)return Object.keys(se.undirected);if("string"==typeof fe)return Object.keys(se[fe])}var M=new Set;return"undirected"!==re&&("out"!==fe&&Kr(M,se.in),"in"!==fe&&Kr(M,se.out)),"directed"!==re&&Kr(M,se.undirected),te(M.values(),M.size)}function kl(re,fe,se){for(var M in fe){var L=fe[M];L instanceof Set&&(L=L.values().next().value);var J=L.source,Fe=J===re?L.target:J;se(Fe.key,Fe.attributes)}}function Sa(re,fe,se,M){for(var L in se){var J=se[L];J instanceof Set&&(J=J.values().next().value);var Ee=J.source,nt=Ee===fe?J.target:Ee;re.has(nt.key)||(re.add(nt.key),M(nt.key,nt.attributes))}}function ws(re,fe,se){for(var M in fe){var L=fe[M];L instanceof Set&&(L=L.values().next().value);var J=L.source,Fe=J===re?L.target:J;if(se(Fe.key,Fe.attributes))return!0}return!1}function en(re,fe,se,M){for(var L in se){var J=se[L];J instanceof Set&&(J=J.values().next().value);var Ee=J.source,nt=Ee===fe?J.target:Ee;if(!re.has(nt.key)&&(re.add(nt.key),M(nt.key,nt.attributes)))return!0}return!1}function nl(re,fe){var se=Object.keys(fe),M=se.length,L=0;return new oe(function(){if(L>=M)return{done:!0};var J=fe[se[L++]];J instanceof Set&&(J=J.values().next().value);var Ee=J.source,nt=Ee===re?J.target:Ee;return{done:!1,value:[nt.key,nt.attributes]}})}function rt(re,fe,se){var M=Object.keys(se),L=M.length,J=0;return new oe(function Ee(){if(J>=L)return{done:!0};var Fe=se[M[J++]];Fe instanceof Set&&(Fe=Fe.values().next().value);var nt=Fe.source,We=nt===fe?Fe.target:nt;return re.has(We.key)?Ee():(re.add(We.key),{done:!1,value:[We.key,We.attributes]})})}function lt(re,fe,se,M,L){var J=re._nodes.get(M);if("undirected"!==fe){if("out"!==se&&void 0!==J.in)for(var Ee in J.in)if(Ee===L)return!0;if("in"!==se&&void 0!==J.out)for(var Fe in J.out)if(Fe===L)return!0}if("directed"!==fe&&void 0!==J.undirected)for(var nt in J.undirected)if(nt===L)return!0;return!1}function Be(re,fe,se){for(var M,L,J,Ee,Fe,nt,Pt,We=fe._nodes.values(),qt=fe.type;!0!==(M=We.next()).done;){if(L=M.value,"undirected"!==qt)for(J in Ee=L.out)if(nt=(Fe=Ee[J]).target,Pt=se(L.key,nt.key,L.attributes,nt.attributes,Fe.key,Fe.attributes,Fe.undirected,Fe.generatedKey),re&&Pt)return;if("directed"!==qt)for(J in Ee=L.undirected)if((nt=(Fe=Ee[J]).target).key!==J&&(nt=Fe.source),Pt=se(L.key,nt.key,L.attributes,nt.attributes,Fe.key,Fe.attributes,Fe.undirected,Fe.generatedKey),re&&Pt)return}}function ut(re,fe,se){for(var M,L,J,Ee,Fe,nt,Pt,We,qt,St=fe._nodes.values(),vn=fe.type;!0!==(M=St.next()).done;){if(L=M.value,"undirected"!==vn)for(J in nt=L.out)for(Ee=nt[J].values();!0!==(Fe=Ee.next()).done;)if(We=(Pt=Fe.value).target,qt=se(L.key,We.key,L.attributes,We.attributes,Pt.key,Pt.attributes,Pt.undirected,Pt.generatedKey),re&&qt)return;if("directed"!==vn)for(J in nt=L.undirected)for(Ee=nt[J].values();!0!==(Fe=Ee.next()).done;)if((We=(Pt=Fe.value).target).key!==J&&(We=Pt.source),qt=se(L.key,We.key,L.attributes,We.attributes,Pt.key,Pt.attributes,Pt.undirected,Pt.generatedKey),re&&qt)return}}function Je(re,fe){var se={key:re};return Q(fe.attributes)||(se.attributes=he({},fe.attributes)),se}function Mt(re,fe){var se={source:fe.source.key,target:fe.target.key};return fe.generatedKey||(se.key=re),Q(fe.attributes)||(se.attributes=he({},fe.attributes)),fe.undirected&&(se.undirected=!0),se}function It(re){return k(re)?"key"in re?!("attributes"in re)||k(re.attributes)&&null!==re.attributes?null:"invalid-attributes":"no-key":"not-object"}function Ot(re){return k(re)?"source"in re?"target"in re?!("attributes"in re)||k(re.attributes)&&null!==re.attributes?"undirected"in re&&"boolean"!=typeof re.undirected?"invalid-undirected":null:"invalid-attributes":"no-target":"no-source":"not-object"}var Qt=new Set(["directed","undirected","mixed"]),zn=new Set(["domain","_events","_eventsCount","_maxListeners"]),ci={allowSelfLoops:!0,edgeKeyGenerator:null,multi:!1,type:"mixed"};function Rn(re,fe,se){var M=new re.NodeDataClass(fe,se);return re._nodes.set(fe,M),re.emit("nodeAdded",{key:fe,attributes:se}),M}function bn(re,fe,se,M,L,J,Ee,Fe){if(!M&&"undirected"===re.type)throw new ye("Graph.".concat(fe,": you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead."));if(M&&"directed"===re.type)throw new ye("Graph.".concat(fe,": you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead."));if(Fe&&!k(Fe))throw new me("Graph.".concat(fe,': invalid attributes. Expecting an object but got "').concat(Fe,'"'));if(J=""+J,Ee=""+Ee,Fe=Fe||{},!re.allowSelfLoops&&J===Ee)throw new ye("Graph.".concat(fe,': source & target are the same ("').concat(J,"\"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false."));var nt=re._nodes.get(J),Pt=re._nodes.get(Ee);if(!nt)throw new ne("Graph.".concat(fe,': source node "').concat(J,'" not found.'));if(!Pt)throw new ne("Graph.".concat(fe,': target node "').concat(Ee,'" not found.'));var We={key:null,undirected:M,source:J,target:Ee,attributes:Fe};if(se&&(L=re._edgeKeyGenerator(We)),re._edges.has(L=""+L))throw new ye("Graph.".concat(fe,': the "').concat(L,'" edge already exists in the graph.'));if(!re.multi&&(M?void 0!==nt.undirected[Ee]:void 0!==nt.out[Ee]))throw new ye("Graph.".concat(fe,': an edge linking "').concat(J,'" to "').concat(Ee,"\" 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 qt=new Qe(M,L,se,nt,Pt,Fe);return re._edges.set(L,qt),J===Ee?M?(nt.undirectedSelfLoops++,re._undirectedSelfLoopCount++):(nt.directedSelfLoops++,re._directedSelfLoopCount++):M?(nt.undirectedDegree++,Pt.undirectedDegree++):(nt.outDegree++,Pt.inDegree++),tt(re,M,qt,J,Ee,nt,Pt),M?re._undirectedSize++:re._directedSize++,We.key=L,re.emit("edgeAdded",We),L}function Xn(re,fe,se,M,L,J,Ee,Fe,nt){if(!M&&"undirected"===re.type)throw new ye("Graph.".concat(fe,": you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead."));if(M&&"directed"===re.type)throw new ye("Graph.".concat(fe,": you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead."));if(Fe)if(nt){if("function"!=typeof Fe)throw new me("Graph.".concat(fe,': invalid updater function. Expecting a function but got "').concat(Fe,'"'))}else if(!k(Fe))throw new me("Graph.".concat(fe,': invalid attributes. Expecting an object but got "').concat(Fe,'"'));var Pt;if(J=""+J,Ee=""+Ee,nt&&(Pt=Fe,Fe=void 0),!re.allowSelfLoops&&J===Ee)throw new ye("Graph.".concat(fe,': source & target are the same ("').concat(J,"\"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false."));var We,qt,St=re._nodes.get(J),vn=re._nodes.get(Ee);if(!se&&(We=re._edges.get(L))){if(We.source.key!==J||We.target.key!==Ee||M&&(We.source.key!==Ee||We.target.key!==J))throw new ye("Graph.".concat(fe,': inconsistency detected when attempting to merge the "').concat(L,'" edge with "').concat(J,'" source & "').concat(Ee,'" target vs. ("').concat(We.source.key,'", "').concat(We.target.key,'").'));qt=We}if(qt||re.multi||!St||(qt=M?St.undirected[Ee]:St.out[Ee]),qt)return(nt?Pt:Fe)?(nt?(qt.attributes=Pt(qt.attributes),re.emit("edgeAttributesUpdated",{type:"replace",key:qt.key,attributes:qt.attributes})):(he(qt.attributes,Fe),re.emit("edgeAttributesUpdated",{type:"merge",key:qt.key,attributes:qt.attributes,data:Fe})),qt.key):qt.key;Fe=Fe||{},nt&&Pt&&(Fe=Pt(Fe));var Zr={key:null,undirected:M,source:J,target:Ee,attributes:Fe};if(se&&(L=re._edgeKeyGenerator(Zr)),re._edges.has(L=""+L))throw new ye("Graph.".concat(fe,': the "').concat(L,'" edge already exists in the graph.'));return St||(St=Rn(re,J,{}),J===Ee&&(vn=St)),vn||(vn=Rn(re,Ee,{})),We=new Qe(M,L,se,St,vn,Fe),re._edges.set(L,We),J===Ee?M?(St.undirectedSelfLoops++,re._undirectedSelfLoopCount++):(St.directedSelfLoops++,re._directedSelfLoopCount++):M?(St.undirectedDegree++,vn.undirectedDegree++):(St.outDegree++,vn.inDegree++),tt(re,M,We,J,Ee,St,vn),M?re._undirectedSize++:re._directedSize++,Zr.key=L,re.emit("edgeAdded",Zr),L}var re,Cn=function(re){function fe(M){var L;if(L=re.call(this)||this,(M=he({},ci,M)).edgeKeyGenerator&&"function"!=typeof M.edgeKeyGenerator)throw new me("Graph.constructor: invalid 'edgeKeyGenerator' option. Expecting a function but got \"".concat(M.edgeKeyGenerator,'".'));if("boolean"!=typeof M.multi)throw new me("Graph.constructor: invalid 'multi' option. Expecting a boolean but got \"".concat(M.multi,'".'));if(!Qt.has(M.type))throw new me('Graph.constructor: invalid \'type\' option. Should be one of "mixed", "directed" or "undirected" but got "'.concat(M.type,'".'));if("boolean"!=typeof M.allowSelfLoops)throw new me("Graph.constructor: invalid 'allowSelfLoops' option. Expecting a boolean but got \"".concat(M.allowSelfLoops,'".'));var J,Ee="mixed"===M.type?Oe:"directed"===M.type?$e:st;return H(Se(L),"NodeDataClass",Ee),H(Se(L),"_attributes",{}),H(Se(L),"_nodes",new Map),H(Se(L),"_edges",new Map),H(Se(L),"_directedSize",0),H(Se(L),"_undirectedSize",0),H(Se(L),"_directedSelfLoopCount",0),H(Se(L),"_undirectedSelfLoopCount",0),H(Se(L),"_edgeKeyGenerator",M.edgeKeyGenerator||(J=0,function(){return J++})),H(Se(L),"_options",M),zn.forEach(function(Fe){return H(Se(L),Fe,L[Fe])}),w(Se(L),"order",function(){return L._nodes.size}),w(Se(L),"size",function(){return L._edges.size}),w(Se(L),"directedSize",function(){return L._directedSize}),w(Se(L),"undirectedSize",function(){return L._undirectedSize}),w(Se(L),"selfLoopCount",function(){return L._directedSelfLoopCount+L._undirectedSelfLoopCount}),w(Se(L),"directedSelfLoopCount",function(){return L._directedSelfLoopCount}),w(Se(L),"undirectedSelfLoopCount",function(){return L._undirectedSelfLoopCount}),w(Se(L),"multi",L._options.multi),w(Se(L),"type",L._options.type),w(Se(L),"allowSelfLoops",L._options.allowSelfLoops),w(Se(L),"implementation",function(){return"graphology"}),L}et(fe,re);var se=fe.prototype;return se.hasNode=function(M){return this._nodes.has(""+M)},se.hasDirectedEdge=function(M,L){if("undirected"===this.type)return!1;if(1===arguments.length){var Ee=this._edges.get(""+M);return!!Ee&&!Ee.undirected}if(2===arguments.length){L=""+L;var Fe=this._nodes.get(M=""+M);if(!Fe)return!1;var nt=Fe.out[L];return!(!nt||this.multi&&!nt.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."))},se.hasUndirectedEdge=function(M,L){if("directed"===this.type)return!1;if(1===arguments.length){var Ee=this._edges.get(""+M);return!!Ee&&Ee.undirected}if(2===arguments.length){L=""+L;var Fe=this._nodes.get(M=""+M);if(!Fe)return!1;var nt=Fe.undirected[L];return!(!nt||this.multi&&!nt.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."))},se.hasEdge=function(M,L){if(1===arguments.length)return this._edges.has(""+M);if(2===arguments.length){L=""+L;var Ee=this._nodes.get(M=""+M);if(!Ee)return!1;var Fe=void 0!==Ee.out&&Ee.out[L];return Fe||(Fe=void 0!==Ee.undirected&&Ee.undirected[L]),!(!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."))},se.directedEdge=function(M,L){if("undirected"!==this.type){if(M=""+M,L=""+L,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 J=this._nodes.get(M);if(!J)throw new ne('Graph.directedEdge: could not find the "'.concat(M,'" source node in the graph.'));if(!this._nodes.has(L))throw new ne('Graph.directedEdge: could not find the "'.concat(L,'" target node in the graph.'));var Ee=J.out&&J.out[L]||void 0;return Ee?Ee.key:void 0}},se.undirectedEdge=function(M,L){if("directed"!==this.type){if(M=""+M,L=""+L,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 J=this._nodes.get(M);if(!J)throw new ne('Graph.undirectedEdge: could not find the "'.concat(M,'" source node in the graph.'));if(!this._nodes.has(L))throw new ne('Graph.undirectedEdge: could not find the "'.concat(L,'" target node in the graph.'));var Ee=J.undirected&&J.undirected[L]||void 0;return Ee?Ee.key:void 0}},se.edge=function(M,L){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.");L=""+L;var J=this._nodes.get(M=""+M);if(!J)throw new ne('Graph.edge: could not find the "'.concat(M,'" source node in the graph.'));if(!this._nodes.has(L))throw new ne('Graph.edge: could not find the "'.concat(L,'" target node in the graph.'));var Ee=J.out&&J.out[L]||J.undirected&&J.undirected[L]||void 0;if(Ee)return Ee.key},se.inDegree=function(M){var L=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof L)throw new me('Graph.inDegree: Expecting a boolean but got "'.concat(L,'" for the second parameter (allowing self-loops to be counted).'));var J=this._nodes.get(M=""+M);if(!J)throw new ne('Graph.inDegree: could not find the "'.concat(M,'" node in the graph.'));return"undirected"===this.type?0:J.inDegree+(L?J.directedSelfLoops:0)},se.outDegree=function(M){var L=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof L)throw new me('Graph.outDegree: Expecting a boolean but got "'.concat(L,'" for the second parameter (allowing self-loops to be counted).'));var J=this._nodes.get(M=""+M);if(!J)throw new ne('Graph.outDegree: could not find the "'.concat(M,'" node in the graph.'));return"undirected"===this.type?0:J.outDegree+(L?J.directedSelfLoops:0)},se.directedDegree=function(M){var L=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof L)throw new me('Graph.directedDegree: Expecting a boolean but got "'.concat(L,'" for the second parameter (allowing self-loops to be counted).'));var J=this._nodes.get(M=""+M);if(!J)throw new ne('Graph.directedDegree: could not find the "'.concat(M,'" node in the graph.'));if("undirected"===this.type)return 0;var Ee=L?J.directedSelfLoops:0;return J.inDegree+Ee+(J.outDegree+Ee)},se.undirectedDegree=function(M){var L=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof L)throw new me('Graph.undirectedDegree: Expecting a boolean but got "'.concat(L,'" for the second parameter (allowing self-loops to be counted).'));var J=this._nodes.get(M=""+M);if(!J)throw new ne('Graph.undirectedDegree: could not find the "'.concat(M,'" node in the graph.'));return"directed"===this.type?0:J.undirectedDegree+2*(L?J.undirectedSelfLoops:0)},se.degree=function(M){var L=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof L)throw new me('Graph.degree: Expecting a boolean but got "'.concat(L,'" for the second parameter (allowing self-loops to be counted).'));var J=this._nodes.get(M=""+M);if(!J)throw new ne('Graph.degree: could not find the "'.concat(M,'" node in the graph.'));var Ee=0,Fe=0;return"directed"!==this.type&&(L&&(Fe=J.undirectedSelfLoops),Ee+=J.undirectedDegree+2*Fe),"undirected"!==this.type&&(L&&(Fe=J.directedSelfLoops),Ee+=J.inDegree+J.outDegree+2*Fe),Ee},se.source=function(M){var L=this._edges.get(M=""+M);if(!L)throw new ne('Graph.source: could not find the "'.concat(M,'" edge in the graph.'));return L.source.key},se.target=function(M){var L=this._edges.get(M=""+M);if(!L)throw new ne('Graph.target: could not find the "'.concat(M,'" edge in the graph.'));return L.target.key},se.extremities=function(M){var L=this._edges.get(M=""+M);if(!L)throw new ne('Graph.extremities: could not find the "'.concat(M,'" edge in the graph.'));return[L.source.key,L.target.key]},se.opposite=function(M,L){M=""+M;var J=this._edges.get(L=""+L);if(!J)throw new ne('Graph.opposite: could not find the "'.concat(L,'" edge in the graph.'));var Ee=J.source.key,Fe=J.target.key;if(M!==Ee&&M!==Fe)throw new ne('Graph.opposite: the "'.concat(M,'" node is not attached to the "').concat(L,'" edge (').concat(Ee,", ").concat(Fe,")."));return M===Ee?Fe:Ee},se.hasExtremity=function(M,L){L=""+L;var J=this._edges.get(M=""+M);if(!J)throw new ne('Graph.hasExtremity: could not find the "'.concat(M,'" edge in the graph.'));return J.source.key===L||J.target.key===L},se.isUndirected=function(M){var L=this._edges.get(M=""+M);if(!L)throw new ne('Graph.isUndirected: could not find the "'.concat(M,'" edge in the graph.'));return L.undirected},se.isDirected=function(M){var L=this._edges.get(M=""+M);if(!L)throw new ne('Graph.isDirected: could not find the "'.concat(M,'" edge in the graph.'));return!L.undirected},se.isSelfLoop=function(M){var L=this._edges.get(M=""+M);if(!L)throw new ne('Graph.isSelfLoop: could not find the "'.concat(M,'" edge in the graph.'));return L.source===L.target},se.hasGeneratedKey=function(M){var L=this._edges.get(M=""+M);if(!L)throw new ne('Graph.hasGeneratedKey: could not find the "'.concat(M,'" edge in the graph.'));return L.generatedKey},se.addNode=function(M,L){return function(J,Ee,Fe){if(Fe&&!k(Fe))throw new me('Graph.addNode: invalid attributes. Expecting an object but got "'.concat(Fe,'"'));if(Fe=Fe||{},J._nodes.has(Ee=""+Ee))throw new ye('Graph.addNode: the "'.concat(Ee,'" node already exist in the graph.'));var nt=new J.NodeDataClass(Ee,Fe);return J._nodes.set(Ee,nt),J.emit("nodeAdded",{key:Ee,attributes:Fe}),nt}(this,M,L).key},se.mergeNode=function(M,L){if(L&&!k(L))throw new me('Graph.mergeNode: invalid attributes. Expecting an object but got "'.concat(L,'"'));L=L||{};var J=this._nodes.get(M=""+M);return J?(L&&(he(J.attributes,L),this.emit("nodeAttributesUpdated",{type:"merge",key:M,attributes:J.attributes,data:L})),M):(J=new this.NodeDataClass(M,L),this._nodes.set(M,J),this.emit("nodeAdded",{key:M,attributes:L}),M)},se.updateNode=function(M,L){if(L&&"function"!=typeof L)throw new me('Graph.updateNode: invalid updater function. Expecting a function but got "'.concat(L,'"'));var J=this._nodes.get(M=""+M);if(J)return L&&(J.attributes=L(J.attributes),this.emit("nodeAttributesUpdated",{type:"replace",key:M,attributes:J.attributes})),M;var Fe=L?L({}):{};return J=new this.NodeDataClass(M,Fe),this._nodes.set(M,J),this.emit("nodeAdded",{key:M,attributes:Fe}),M},se.dropNode=function(M){var L=this,J=this._nodes.get(M=""+M);if(!J)throw new ne('Graph.dropNode: could not find the "'.concat(M,'" node in the graph.'));this.forEachEdge(M,function(Ee){L.dropEdge(Ee)}),this._nodes.delete(M),this.emit("nodeDropped",{key:M,attributes:J.attributes})},se.dropEdge=function(M){var L;if(arguments.length>1){var J=""+arguments[0],Ee=""+arguments[1];if(!(L=W(this,J,Ee,this.type)))throw new ne('Graph.dropEdge: could not find the "'.concat(J,'" -> "').concat(Ee,'" edge in the graph.'))}else if(!(L=this._edges.get(M=""+M)))throw new ne('Graph.dropEdge: could not find the "'.concat(M,'" edge in the graph.'));this._edges.delete(L.key);var nt=L.source,Pt=L.target,We=L.attributes,qt=L.undirected;return nt===Pt?qt?(nt.undirectedSelfLoops--,this._undirectedSelfLoopCount--):(nt.directedSelfLoops--,this._directedSelfLoopCount--):qt?(nt.undirectedDegree--,Pt.undirectedDegree--):(nt.outDegree--,Pt.inDegree--),Xe(this,qt,L),qt?this._undirectedSize--:this._directedSize--,this.emit("edgeDropped",{key:M,attributes:We,source:nt.key,target:Pt.key,undirected:qt}),this},se.clear=function(){this._edges.clear(),this._nodes.clear(),this.emit("cleared")},se.clearEdges=function(){this._edges.clear(),this.clearIndex(),this.emit("edgesCleared")},se.getAttribute=function(M){return this._attributes[M]},se.getAttributes=function(){return this._attributes},se.hasAttribute=function(M){return this._attributes.hasOwnProperty(M)},se.setAttribute=function(M,L){return this._attributes[M]=L,this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:M}),this},se.updateAttribute=function(M,L){if("function"!=typeof L)throw new me("Graph.updateAttribute: updater should be a function.");return this._attributes[M]=L(this._attributes[M]),this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:M}),this},se.removeAttribute=function(M){return delete this._attributes[M],this.emit("attributesUpdated",{type:"remove",attributes:this._attributes,name:M}),this},se.replaceAttributes=function(M){if(!k(M))throw new me("Graph.replaceAttributes: provided attributes are not a plain object.");return this._attributes=M,this.emit("attributesUpdated",{type:"replace",attributes:this._attributes}),this},se.mergeAttributes=function(M){if(!k(M))throw new me("Graph.mergeAttributes: provided attributes are not a plain object.");return he(this._attributes,M),this.emit("attributesUpdated",{type:"merge",attributes:this._attributes,data:M}),this},se.getNodeAttribute=function(M,L){var J=this._nodes.get(M=""+M);if(!J)throw new ne('Graph.getNodeAttribute: could not find the "'.concat(M,'" node in the graph.'));return J.attributes[L]},se.getNodeAttributes=function(M){var L=this._nodes.get(M=""+M);if(!L)throw new ne('Graph.getNodeAttributes: could not find the "'.concat(M,'" node in the graph.'));return L.attributes},se.hasNodeAttribute=function(M,L){var J=this._nodes.get(M=""+M);if(!J)throw new ne('Graph.hasNodeAttribute: could not find the "'.concat(M,'" node in the graph.'));return J.attributes.hasOwnProperty(L)},se.setNodeAttribute=function(M,L,J){var Ee=this._nodes.get(M=""+M);if(!Ee)throw new ne('Graph.setNodeAttribute: could not find the "'.concat(M,'" 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 Ee.attributes[L]=J,this.emit("nodeAttributesUpdated",{key:M,type:"set",attributes:Ee.attributes,name:L}),this},se.updateNodeAttribute=function(M,L,J){var Ee=this._nodes.get(M=""+M);if(!Ee)throw new ne('Graph.updateNodeAttribute: could not find the "'.concat(M,'" 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 J)throw new me("Graph.updateAttribute: updater should be a function.");var Fe=Ee.attributes,nt=J(Fe[L]);return Fe[L]=nt,this.emit("nodeAttributesUpdated",{key:M,type:"set",attributes:Ee.attributes,name:L}),this},se.removeNodeAttribute=function(M,L){var J=this._nodes.get(M=""+M);if(!J)throw new ne('Graph.hasNodeAttribute: could not find the "'.concat(M,'" node in the graph.'));return delete J.attributes[L],this.emit("nodeAttributesUpdated",{key:M,type:"remove",attributes:J.attributes,name:L}),this},se.replaceNodeAttributes=function(M,L){var J=this._nodes.get(M=""+M);if(!J)throw new ne('Graph.replaceNodeAttributes: could not find the "'.concat(M,'" node in the graph.'));if(!k(L))throw new me("Graph.replaceNodeAttributes: provided attributes are not a plain object.");return J.attributes=L,this.emit("nodeAttributesUpdated",{key:M,type:"replace",attributes:J.attributes}),this},se.mergeNodeAttributes=function(M,L){var J=this._nodes.get(M=""+M);if(!J)throw new ne('Graph.mergeNodeAttributes: could not find the "'.concat(M,'" node in the graph.'));if(!k(L))throw new me("Graph.mergeNodeAttributes: provided attributes are not a plain object.");return he(J.attributes,L),this.emit("nodeAttributesUpdated",{key:M,type:"merge",attributes:J.attributes,data:L}),this},se.updateEachNodeAttributes=function(M,L){if("function"!=typeof M)throw new me("Graph.updateEachNodeAttributes: expecting an updater function.");if(L&&!C(L))throw new me("Graph.updateEachNodeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");for(var J,Ee,Fe=this._nodes.values();!0!==(J=Fe.next()).done;)(Ee=J.value).attributes=M(Ee.key,Ee.attributes);this.emit("eachNodeAttributesUpdated",{hints:L||null})},se.updateEachEdgeAttributes=function(M,L){if("function"!=typeof M)throw new me("Graph.updateEachEdgeAttributes: expecting an updater function.");if(L&&!C(L))throw new me("Graph.updateEachEdgeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");for(var J,Ee,Fe=this._edges.values();!0!==(J=Fe.next()).done;)(Ee=J.value).attributes=M(Ee.key,Ee.attributes);this.emit("eachEdgeAttributesUpdated",{hints:L||null})},se.forEach=function(M){if("function"!=typeof M)throw new me("Graph.forEach: expecting a callback.");this.multi?ut(!1,this,M):Be(!1,this,M)},se.forEachUntil=function(M){if("function"!=typeof M)throw new me("Graph.forEach: expecting a callback.");this.multi?ut(!0,this,M):Be(!0,this,M)},se.adjacency=function(){return this.multi?(nt=(M=this)._nodes.values(),Pt=M.type,We="outer",qt=null,new oe(function St(){var vn;if("outer"===We)return!0===(vn=nt.next()).done?vn:(L=vn.value,We="directed",St());if("directed"===We)return"undirected"===Pt?(We="undirected",St()):(Ee=L.out,J=Object.keys(L.out),Fe=0,We="inner-directed",St());if("undirected"===We){if("directed"===Pt)return We="outer",St();Ee=L.undirected,J=Object.keys(L.undirected),Fe=0,We="inner-undirected"}if(!qt&&Fe>=J.length)return We="inner-undirected"===We?"outer":"undirected",St();if(!qt){var Es=J[Fe++];return qt=Ee[Es].values(),St()}if((vn=qt.next()).done)return qt=null,St();var Zr=vn.value,Js=Zr.target;return"inner-undirected"===We&&Js.key===L.key&&(Js=Zr.source),{done:!1,value:[L.key,Js.key,L.attributes,Js.attributes,Zr.key,Zr.attributes]}})):(Fl=(St=this)._nodes.values(),fo=St.type,Br="outer",new oe(function Vs(){var Ac;if("outer"===Br)return!0===(Ac=Fl.next()).done?Ac:(vn=Ac.value,Br="directed",Vs());if("directed"===Br)return"undirected"===fo?(Br="undirected",Vs()):(Zr=vn.out,Es=Object.keys(vn.out),Js=0,Br="inner-directed",Vs());if("undirected"===Br){if("directed"===fo)return Br="outer",Vs();Zr=vn.undirected,Es=Object.keys(vn.undirected),Js=0,Br="inner-undirected"}if(Js>=Es.length)return Br="inner-undirected"===Br?"outer":"undirected",Vs();var xn=Es[Js++],po=Zr[xn],Ll=po.target;return"inner-undirected"===Br&&Ll.key===vn.key&&(Ll=po.source),{done:!1,value:[vn.key,Ll.key,vn.attributes,Ll.attributes,po.key,po.attributes]}}));var St,vn,Es,Zr,Js,Fl,fo,Br,M,L,J,Ee,Fe,nt,Pt,We,qt},se.nodes=function(){return"function"==typeof Array.from?Array.from(this._nodes.keys()):te(this._nodes.keys(),this._nodes.size)},se.forEachNode=function(M){if("function"!=typeof M)throw new me("Graph.forEachNode: expecting a callback.");this._nodes.forEach(function(L,J){M(J,L.attributes)})},se.forEachNodeUntil=function(M){if("function"!=typeof M)throw new me("Graph.forEachNode: expecting a callback.");for(var L,J,Ee=this._nodes.values();!0!==(L=Ee.next())&&!M((J=L.value).key,J.attributes););},se.nodeEntries=function(){var M=this._nodes.values();return new oe(function(){var L=M.next();if(L.done)return L;var J=L.value;return{value:[J.key,J.attributes],done:!1}})},se.exportNode=function(M){var L=this._nodes.get(M=""+M);if(!L)throw new ne('Graph.exportNode: could not find the "'.concat(M,'" node in the graph.'));return Je(M,L)},se.exportEdge=function(M){var L=this._edges.get(M=""+M);if(!L)throw new ne('Graph.exportEdge: could not find the "'.concat(M,'" edge in the graph.'));return Mt(M,L)},se.export=function(){var M=new Array(this._nodes.size),L=0;this._nodes.forEach(function(Ee,Fe){M[L++]=Je(Fe,Ee)});var J=new Array(this._edges.size);return L=0,this._edges.forEach(function(Ee,Fe){J[L++]=Mt(Fe,Ee)}),{attributes:this.getAttributes(),nodes:M,edges:J,options:{type:this.type,multi:this.multi,allowSelfLoops:this.allowSelfLoops}}},se.importNode=function(M){var L=arguments.length>1&&void 0!==arguments[1]&&arguments[1],J=It(M);if(J){if("not-object"===J)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"===J)throw new me("Graph.importNode: no key provided.");if("invalid-attributes"===J)throw new me("Graph.importNode: invalid attributes. Attributes should be a plain object, null or omitted.")}var Ee=M.key,Fe=M.attributes,nt=void 0===Fe?{}:Fe;return L?this.mergeNode(Ee,nt):this.addNode(Ee,nt),this},se.importEdge=function(M){var L=arguments.length>1&&void 0!==arguments[1]&&arguments[1],J=Ot(M);if(J){if("not-object"===J)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"===J)throw new me("Graph.importEdge: missing souce.");if("no-target"===J)throw new me("Graph.importEdge: missing target.");if("invalid-attributes"===J)throw new me("Graph.importEdge: invalid attributes. Attributes should be a plain object, null or omitted.");if("invalid-undirected"===J)throw new me("Graph.importEdge: invalid undirected. Undirected should be boolean or omitted.")}var Ee=M.source,Fe=M.target,nt=M.attributes,Pt=void 0===nt?{}:nt,We=M.undirected,qt=void 0!==We&&We;return"key"in M?(L?qt?this.mergeUndirectedEdgeWithKey:this.mergeDirectedEdgeWithKey:qt?this.addUndirectedEdgeWithKey:this.addDirectedEdgeWithKey).call(this,M.key,Ee,Fe,Pt):(L?qt?this.mergeUndirectedEdge:this.mergeDirectedEdge:qt?this.addUndirectedEdge:this.addDirectedEdge).call(this,Ee,Fe,Pt),this},se.import=function(M){var L,J,Ee,Fe=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(j(M))return this.import(M.export(),Fe),this;if(!k(M))throw new me("Graph.import: invalid argument. Expecting a serialized graph or, alternatively, a Graph instance.");if(M.attributes){if(!k(M.attributes))throw new me("Graph.import: invalid attributes. Expecting a plain object.");Fe?this.mergeAttributes(M.attributes):this.replaceAttributes(M.attributes)}if(M.nodes){if(Ee=M.nodes,!Array.isArray(Ee))throw new me("Graph.import: invalid nodes. Expecting an array.");for(L=0,J=Ee.length;LJ)){var Pt=new Set;Pt.add(L.undirected[nt]),L.undirected[nt]=Pt,M._nodes.get(nt).undirected[J]=Pt}})),this;var M},se.clearIndex=function(){return this._nodes.forEach(function(M){void 0!==M.in&&(M.in={},M.out={}),void 0!==M.undirected&&(M.undirected={})}),this},se.toJSON=function(){return this.export()},se.toString=function(){return"[object Graph]"},se.inspect=function(){var M=this,L={};this._nodes.forEach(function(Pt,We){L[We]=Pt.attributes});var J={},Ee={};this._edges.forEach(function(Pt,We){var qt=Pt.undirected?"--":"->",St="",vn="(".concat(Pt.source.key,")").concat(qt,"(").concat(Pt.target.key,")");Pt.generatedKey?M.multi&&(void 0===Ee[vn]?Ee[vn]=0:Ee[vn]++,St+="".concat(Ee[vn],". ")):St+="[".concat(We,"]: "),J[St+=vn]=Pt.attributes});var Fe={};for(var nt in this)this.hasOwnProperty(nt)&&!zn.has(nt)&&"function"!=typeof this[nt]&&(Fe[nt]=this[nt]);return Fe.attributes=this._attributes,Fe.nodes=L,Fe.edges=J,H(Fe,"constructor",this.constructor),Fe},fe}(T.exports.EventEmitter);"undefined"!=typeof Symbol&&(Cn.prototype[Symbol.for("nodejs.util.inspect.custom")]=Cn.prototype.inspect),[{name:function(re){return"".concat(re,"Edge")},generateKey:!0},{name:function(re){return"".concat(re,"DirectedEdge")},generateKey:!0,type:"directed"},{name:function(re){return"".concat(re,"UndirectedEdge")},generateKey:!0,type:"undirected"},{name:function(re){return"".concat(re,"EdgeWithKey")}},{name:function(re){return"".concat(re,"DirectedEdgeWithKey")},type:"directed"},{name:function(re){return"".concat(re,"UndirectedEdgeWithKey")},type:"undirected"}].forEach(function(re){["add","merge","update"].forEach(function(fe){var se=re.name(fe),M="add"===fe?bn:Xn;Cn.prototype[se]=re.generateKey?function(L,J,Ee){return M(this,se,!0,"undirected"===(re.type||this.type),null,L,J,Ee,"update"===fe)}:function(L,J,Ee,Fe){return M(this,se,!1,"undirected"===(re.type||this.type),L,J,Ee,Fe,"update"===fe)}})}),"undefined"!=typeof Symbol&&(Cn.prototype[Symbol.iterator]=Cn.prototype.adjacency),re=Cn,ze.forEach(function(fe){var se=fe.name,M=fe.attacher;M(re,se("Edge"),"mixed"),M(re,se("DirectedEdge"),"directed"),M(re,se("UndirectedEdge"),"undirected")}),function(re){Me.forEach(function(fe){var M,L,J,Ee;J=(M=fe).type,Ee=M.direction,re.prototype[L=M.name]=function(Fe,nt){if("mixed"!==J&&"mixed"!==this.type&&J!==this.type)return[];if(!arguments.length)return Re(this,J);if(1===arguments.length){var Pt=this._nodes.get(Fe=""+Fe);if(void 0===Pt)throw new ne("Graph.".concat(L,': could not find the "').concat(Fe,'" node in the graph.'));return In(this.multi,"mixed"===J?this.type:J,Ee,Pt)}if(2===arguments.length){nt=""+nt;var We=this._nodes.get(Fe=""+Fe);if(!We)throw new ne("Graph.".concat(L,': could not find the "').concat(Fe,'" source node in the graph.'));if(!this._nodes.has(nt))throw new ne("Graph.".concat(L,': could not find the "').concat(nt,'" target node in the graph.'));return xi(J,this.multi,Ee,We,nt)}throw new me("Graph.".concat(L,": too many arguments (expecting 0, 1 or 2 and got ").concat(arguments.length,")."))},function(se,M){var L=M.name,J=M.type,Ee=M.direction,Fe="forEach"+L[0].toUpperCase()+L.slice(1,-1);se.prototype[Fe]=function(nt,Pt,We){if("mixed"===J||"mixed"===this.type||J===this.type){if(1===arguments.length)return Ze(this,J,We=nt);if(2===arguments.length){We=Pt;var qt=this._nodes.get(nt=""+nt);if(void 0===qt)throw new ne("Graph.".concat(Fe,': could not find the "').concat(nt,'" node in the graph.'));return Nn(this.multi,"mixed"===J?this.type:J,Ee,qt,We)}if(3===arguments.length){Pt=""+Pt;var St=this._nodes.get(nt=""+nt);if(!St)throw new ne("Graph.".concat(Fe,': could not find the "').concat(nt,'" source node in the graph.'));if(!this._nodes.has(Pt))throw new ne("Graph.".concat(Fe,': could not find the "').concat(Pt,'" target node in the graph.'));return Xr(J,this.multi,Ee,St,Pt,We)}throw new me("Graph.".concat(Fe,": too many arguments (expecting 1, 2 or 3 and got ").concat(arguments.length,")."))}}}(re,fe),function(se,M){var L=M.name,J=M.type,Ee=M.direction,Fe="forEach"+L[0].toUpperCase()+L.slice(1,-1)+"Until";se.prototype[Fe]=function(nt,Pt,We){if("mixed"===J||"mixed"===this.type||J===this.type){if(1===arguments.length)return Tt(this,J,We=nt);if(2===arguments.length){We=Pt;var qt=this._nodes.get(nt=""+nt);if(void 0===qt)throw new ne("Graph.".concat(Fe,': could not find the "').concat(nt,'" node in the graph.'));return Yn(this.multi,"mixed"===J?this.type:J,Ee,qt,We)}if(3===arguments.length){Pt=""+Pt;var St=this._nodes.get(nt=""+nt);if(!St)throw new ne("Graph.".concat(Fe,': could not find the "').concat(nt,'" source node in the graph.'));if(!this._nodes.has(Pt))throw new ne("Graph.".concat(Fe,': could not find the "').concat(Pt,'" target node in the graph.'));return Ls(J,this.multi,Ee,St,Pt,We)}throw new me("Graph.".concat(Fe,": too many arguments (expecting 1, 2 or 3 and got ").concat(arguments.length,")."))}}}(re,fe),function(se,M){var J=M.type,Ee=M.direction,Fe=M.name.slice(0,-1)+"Entries";se.prototype[Fe]=function(nt,Pt){if("mixed"!==J&&"mixed"!==this.type&&J!==this.type)return oe.empty();if(!arguments.length)return kt(this,J);if(1===arguments.length){var We=this._nodes.get(nt=""+nt);if(!We)throw new ne("Graph.".concat(Fe,': could not find the "').concat(nt,'" node in the graph.'));return Mi(J,Ee,We)}if(2===arguments.length){Pt=""+Pt;var qt=this._nodes.get(nt=""+nt);if(!qt)throw new ne("Graph.".concat(Fe,': could not find the "').concat(nt,'" source node in the graph.'));if(!this._nodes.has(Pt))throw new ne("Graph.".concat(Fe,': could not find the "').concat(Pt,'" target node in the graph.'));return fs(J,Ee,qt,Pt)}throw new me("Graph.".concat(Fe,": too many arguments (expecting 0, 1 or 2 and got ").concat(arguments.length,")."))}}(re,fe)})}(Cn),function(re){Bs.forEach(function(fe){var M,L,J,Ee;J=(M=fe).type,Ee=M.direction,re.prototype[L=M.name]=function(Fe){if("mixed"!==J&&"mixed"!==this.type&&J!==this.type)return[];if(2===arguments.length){var nt=""+arguments[0],Pt=""+arguments[1];if(!this._nodes.has(nt))throw new ne("Graph.".concat(L,': could not find the "').concat(nt,'" node in the graph.'));if(!this._nodes.has(Pt))throw new ne("Graph.".concat(L,': could not find the "').concat(Pt,'" node in the graph.'));return lt(this,J,Ee,nt,Pt)}if(1===arguments.length){var We=this._nodes.get(Fe=""+Fe);if(void 0===We)throw new ne("Graph.".concat(L,': could not find the "').concat(Fe,'" node in the graph.'));return xa("mixed"===J?this.type:J,Ee,We)}throw new me("Graph.".concat(L,": invalid number of arguments (expecting 1 or 2 and got ").concat(arguments.length,")."))},function(re,fe){var se=fe.name,M=fe.type,L=fe.direction,J="forEach"+se[0].toUpperCase()+se.slice(1,-1);re.prototype[J]=function(Ee,Fe){if("mixed"===M||"mixed"===this.type||M===this.type){var nt=this._nodes.get(Ee=""+Ee);if(void 0===nt)throw new ne("Graph.".concat(J,': could not find the "').concat(Ee,'" node in the graph.'));!function(Pt,We,qt,St){if("mixed"!==Pt){if("undirected"===Pt)return kl(qt,qt.undirected,St);if("string"==typeof We)return kl(qt,qt[We],St)}var vn=new Set;"undirected"!==Pt&&("out"!==We&&Sa(vn,qt,qt.in,St),"in"!==We&&Sa(vn,qt,qt.out,St)),"directed"!==Pt&&Sa(vn,qt,qt.undirected,St)}("mixed"===M?this.type:M,L,nt,Fe)}}}(re,fe),function(re,fe){var se=fe.name,M=fe.type,L=fe.direction,J="forEach"+se[0].toUpperCase()+se.slice(1,-1)+"Until";re.prototype[J]=function(Ee,Fe){if("mixed"===M||"mixed"===this.type||M===this.type){var nt=this._nodes.get(Ee=""+Ee);if(void 0===nt)throw new ne("Graph.".concat(J,': could not find the "').concat(Ee,'" node in the graph.'));!function(Pt,We,qt,St){if("mixed"!==Pt){if("undirected"===Pt)return ws(qt,qt.undirected,St);if("string"==typeof We)return ws(qt,qt[We],St)}var vn=new Set;"undirected"!==Pt&&("out"!==We&&en(vn,qt,qt.in,St)||"in"!==We&&en(vn,qt,qt.out,St))||"directed"===Pt||en(vn,qt,qt.undirected,St)}("mixed"===M?this.type:M,L,nt,Fe)}}}(re,fe),function(re,fe){var M=fe.type,L=fe.direction,J=fe.name.slice(0,-1)+"Entries";re.prototype[J]=function(Ee){if("mixed"!==M&&"mixed"!==this.type&&M!==this.type)return oe.empty();var Fe=this._nodes.get(Ee=""+Ee);if(void 0===Fe)throw new ne("Graph.".concat(J,': could not find the "').concat(Ee,'" node in the graph.'));return function(nt,Pt,We){if("mixed"!==nt){if("undirected"===nt)return nl(We,We.undirected);if("string"==typeof Pt)return nl(We,We[Pt])}var qt=oe.empty(),St=new Set;return"undirected"!==nt&&("out"!==Pt&&(qt=Ke(qt,rt(St,We,We.in))),"in"!==Pt&&(qt=Ke(qt,rt(St,We,We.out)))),"directed"!==nt&&(qt=Ke(qt,rt(St,We,We.undirected))),qt}("mixed"===M?this.type:M,L,Fe)}}(re,fe)})}(Cn);var rr=function(re){function fe(se){var M=he({type:"directed"},se);if("multi"in M&&!1!==M.multi)throw new me("DirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if("directed"!==M.type)throw new me('DirectedGraph.from: inconsistent "'+M.type+'" type in given options!');return re.call(this,M)||this}return et(fe,re),fe}(Cn),sr=function(re){function fe(se){var M=he({type:"undirected"},se);if("multi"in M&&!1!==M.multi)throw new me("UndirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if("undirected"!==M.type)throw new me('UndirectedGraph.from: inconsistent "'+M.type+'" type in given options!');return re.call(this,M)||this}return et(fe,re),fe}(Cn),Qn=function(re){function fe(se){var M=he({multi:!0},se);if("multi"in M&&!0!==M.multi)throw new me("MultiGraph.from: inconsistent indication that the graph should be simple in given options!");return re.call(this,M)||this}return et(fe,re),fe}(Cn),Wi=function(re){function fe(se){var M=he({type:"directed",multi:!0},se);if("multi"in M&&!0!==M.multi)throw new me("MultiDirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if("directed"!==M.type)throw new me('MultiDirectedGraph.from: inconsistent "'+M.type+'" type in given options!');return re.call(this,M)||this}return et(fe,re),fe}(Cn),Ca=function(re){function fe(se){var M=he({type:"undirected",multi:!0},se);if("multi"in M&&!0!==M.multi)throw new me("MultiUndirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if("undirected"!==M.type)throw new me('MultiUndirectedGraph.from: inconsistent "'+M.type+'" type in given options!');return re.call(this,M)||this}return et(fe,re),fe}(Cn);function Qr(re){re.from=function(fe,se){var M=he({},fe.options,se),L=new re(M);return L.import(fe),L}}return Qr(Cn),Qr(rr),Qr(sr),Qr(Qn),Qr(Wi),Qr(Ca),Cn.Graph=Cn,Cn.DirectedGraph=rr,Cn.UndirectedGraph=sr,Cn.MultiGraph=Qn,Cn.MultiDirectedGraph=Wi,Cn.MultiUndirectedGraph=Ca,Cn.InvalidArgumentsGraphError=me,Cn.NotFoundGraphError=ne,Cn.UsageGraphError=ye,Cn}()},1524:(Ut,it,et)=>{var yt;!function(ee,Dt,dt,Y){"use strict";var T,Se=["","webkit","Moz","MS","ms","o"],he=Dt.createElement("div"),j=Math.round,k=Math.abs,Q=Date.now;function H(be,De,Ge){return setTimeout(A(be,Ge),De)}function w(be,De,Ge){return!!Array.isArray(be)&&(C(be,Ge[De],Ge),!0)}function C(be,De,Ge){var vt;if(be)if(be.forEach)be.forEach(De,Ge);else if(be.length!==Y)for(vt=0;vt\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",ui=ee.console&&(ee.console.warn||ee.console.log);return ui&&ui.call(ee.console,vt,Xt),be.apply(this,arguments)}}T="function"!=typeof Object.assign?function(De){if(De===Y||null===De)throw new TypeError("Cannot convert undefined or null to object");for(var Ge=Object(De),vt=1;vt-1}function K(be){return be.trim().split(/\s+/g)}function E(be,De,Ge){if(be.indexOf&&!Ge)return be.indexOf(De);for(var vt=0;vtxs[De]}):vt.sort()),vt}function ae(be,De){for(var Ge,vt,$t=De[0].toUpperCase()+De.slice(1),Xt=0;Xt1&&!Ge.firstMultiple?Ge.firstMultiple=Tt(De):1===$t&&(Ge.firstMultiple=!1);var Xt=Ge.firstInput,ui=Ge.firstMultiple,Vr=ui?ui.center:Xt.center,Jr=De.center=kt(vt);De.timeStamp=Q(),De.deltaTime=De.timeStamp-Xt.timeStamp,De.angle=Mi(Vr,Jr),De.distance=Yn(Vr,Jr),function(be,De){var Ge=De.center,vt=be.offsetDelta||{},$t=be.prevDelta||{},Xt=be.prevInput||{};(1===De.eventType||4===Xt.eventType)&&($t=be.prevDelta={x:Xt.deltaX||0,y:Xt.deltaY||0},vt=be.offsetDelta={x:Ge.x,y:Ge.y}),De.deltaX=$t.x+(Ge.x-vt.x),De.deltaY=$t.y+(Ge.y-vt.y)}(Ge,De),De.offsetDirection=Nn(De.deltaX,De.deltaY);var xs=In(De.deltaTime,De.deltaX,De.deltaY);De.overallVelocityX=xs.x,De.overallVelocityY=xs.y,De.overallVelocity=k(xs.x)>k(xs.y)?xs.x:xs.y,De.scale=ui?function(be,De){return Yn(De[0],De[1],pt)/Yn(be[0],be[1],pt)}(ui.pointers,vt):1,De.rotation=ui?function(be,De){return Mi(De[1],De[0],pt)+Mi(be[1],be[0],pt)}(ui.pointers,vt):0,De.maxPointers=Ge.prevInput?De.pointers.length>Ge.prevInput.maxPointers?De.pointers.length:Ge.prevInput.maxPointers:De.pointers.length,function(be,De){var $t,Xt,ui,Vr,Ge=be.lastInterval||De,vt=De.timeStamp-Ge.timeStamp;if(8!=De.eventType&&(vt>25||Ge.velocity===Y)){var Jr=De.deltaX-Ge.deltaX,xs=De.deltaY-Ge.deltaY,Zn=In(vt,Jr,xs);Xt=Zn.x,ui=Zn.y,$t=k(Zn.x)>k(Zn.y)?Zn.x:Zn.y,Vr=Nn(Jr,xs),be.lastInterval=De}else $t=Ge.velocity,Xt=Ge.velocityX,ui=Ge.velocityY,Vr=Ge.direction;De.velocity=$t,De.velocityX=Xt,De.velocityY=ui,De.direction=Vr}(Ge,De);var Zn=be.element;I(De.srcEvent.target,Zn)&&(Zn=De.srcEvent.target),De.target=Zn}(be,Ge),be.emit("hammer.input",Ge),be.recognize(Ge),be.session.prevInput=Ge}function Tt(be){for(var De=[],Ge=0;Ge=k(De)?be<0?2:4:De<0?8:16}function Yn(be,De,Ge){Ge||(Ge=_t);var vt=De[Ge[0]]-be[Ge[0]],$t=De[Ge[1]]-be[Ge[1]];return Math.sqrt(vt*vt+$t*$t)}function Mi(be,De,Ge){return Ge||(Ge=_t),180*Math.atan2(De[Ge[1]]-be[Ge[1]],De[Ge[0]]-be[Ge[0]])/Math.PI}we.prototype={handler:function(){},init:function(){this.evEl&&X(this.element,this.evEl,this.domHandler),this.evTarget&&X(this.target,this.evTarget,this.domHandler),this.evWin&&X(Te(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&ue(this.element,this.evEl,this.domHandler),this.evTarget&&ue(this.target,this.evTarget,this.domHandler),this.evWin&&ue(Te(this.element),this.evWin,this.domHandler)}};var Ls={mousedown:1,mousemove:2,mouseup:4},fs="mousedown",Bs="mousemove mouseup";function Kr(){this.evEl=fs,this.evWin=Bs,this.pressed=!1,we.apply(this,arguments)}S(Kr,we,{handler:function(De){var Ge=Ls[De.type];1&Ge&&0===De.button&&(this.pressed=!0),2&Ge&&1!==De.which&&(Ge=4),this.pressed&&(4&Ge&&(this.pressed=!1),this.callback(this.manager,Ge,{pointers:[De],changedPointers:[De],pointerType:Qe,srcEvent:De}))}});var xa={pointerdown:1,pointermove:2,pointerup:4,pointercancel:8,pointerout:8},kl={2:$e,3:"pen",4:Qe,5:"kinect"},Sa="pointerdown",ws="pointermove pointerup pointercancel";function en(){this.evEl=Sa,this.evWin=ws,we.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}ee.MSPointerEvent&&!ee.PointerEvent&&(Sa="MSPointerDown",ws="MSPointerMove MSPointerUp MSPointerCancel"),S(en,we,{handler:function(De){var Ge=this.store,vt=!1,$t=De.type.toLowerCase().replace("ms",""),Xt=xa[$t],ui=kl[De.pointerType]||De.pointerType,Vr=ui==$e,Jr=E(Ge,De.pointerId,"pointerId");1&Xt&&(0===De.button||Vr)?Jr<0&&(Ge.push(De),Jr=Ge.length-1):12&Xt&&(vt=!0),!(Jr<0)&&(Ge[Jr]=De,this.callback(this.manager,Xt,{pointers:Ge,changedPointers:[De],pointerType:ui,srcEvent:De}),vt&&Ge.splice(Jr,1))}});var nl={touchstart:1,touchmove:2,touchend:4,touchcancel:8},rt="touchstart",lt="touchstart touchmove touchend touchcancel";function ht(){this.evTarget=rt,this.evWin=lt,this.started=!1,we.apply(this,arguments)}function ge(be,De){var Ge=$(be.touches),vt=$(be.changedTouches);return 12&De&&(Ge=Z(Ge.concat(vt),"identifier",!0)),[Ge,vt]}S(ht,we,{handler:function(De){var Ge=nl[De.type];if(1===Ge&&(this.started=!0),this.started){var vt=ge.call(this,De,Ge);12&Ge&&vt[0].length-vt[1].length==0&&(this.started=!1),this.callback(this.manager,Ge,{pointers:vt[0],changedPointers:vt[1],pointerType:$e,srcEvent:De})}}});var ve={touchstart:1,touchmove:2,touchend:4,touchcancel:8},Be="touchstart touchmove touchend touchcancel";function ut(){this.evTarget=Be,this.targetIds={},we.apply(this,arguments)}function Je(be,De){var Ge=$(be.touches),vt=this.targetIds;if(3&De&&1===Ge.length)return vt[Ge[0].identifier]=!0,[Ge,Ge];var $t,Xt,ui=$(be.changedTouches),Vr=[],Jr=this.target;if(Xt=Ge.filter(function(xs){return I(xs.target,Jr)}),1===De)for($t=0;$t-1&&vt.splice(Xt,1)},2500)}}function ci(be){for(var De=be.srcEvent.clientX,Ge=be.srcEvent.clientY,vt=0;vt-1&&this.requireFail.splice(De,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(be){return!!this.simultaneous[be.id]},emit:function(be){var De=this,Ge=this.state;function vt($t){De.manager.emit($t,be)}Ge<8&&vt(De.options.event+We(Ge)),vt(De.options.event),be.additionalEvent&&vt(be.additionalEvent),Ge>=8&&vt(De.options.event+We(Ge))},tryEmit:function(be){if(this.canEmit())return this.emit(be);this.state=32},canEmit:function(){for(var be=0;beDe.threshold&&$t&De.direction},attrTest:function(be){return vn.prototype.attrTest.call(this,be)&&(2&this.state||!(2&this.state)&&this.directionTest(be))},emit:function(be){this.pX=be.deltaX,this.pY=be.deltaY;var De=qt(be.direction);De&&(be.additionalEvent=this.options.event+De),this._super.emit.call(this,be)}}),S(Zr,vn,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[sr]},attrTest:function(be){return this._super.attrTest.call(this,be)&&(Math.abs(be.scale-1)>this.options.threshold||2&this.state)},emit:function(be){1!==be.scale&&(be.additionalEvent=this.options.event+(be.scale<1?"in":"out")),this._super.emit.call(this,be)}}),S(Js,Pt,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return["auto"]},process:function(be){var De=this.options,Ge=be.pointers.length===De.pointers,vt=be.distanceDe.time;if(this._input=be,!vt||!Ge||12&be.eventType&&!$t)this.reset();else if(1&be.eventType)this.reset(),this._timer=H(function(){this.state=8,this.tryEmit()},De.time,this);else if(4&be.eventType)return 8;return 32},reset:function(){clearTimeout(this._timer)},emit:function(be){8===this.state&&(be&&4&be.eventType?this.manager.emit(this.options.event+"up",be):(this._input.timeStamp=Q(),this.manager.emit(this.options.event,this._input)))}}),S(Fl,vn,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[sr]},attrTest:function(be){return this._super.attrTest.call(this,be)&&(Math.abs(be.rotation)>this.options.threshold||2&this.state)}}),S(fo,vn,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:30,pointers:1},getTouchAction:function(){return Es.prototype.getTouchAction.call(this)},attrTest:function(be){var Ge,De=this.options.direction;return 30&De?Ge=be.overallVelocity:6&De?Ge=be.overallVelocityX:24&De&&(Ge=be.overallVelocityY),this._super.attrTest.call(this,be)&&De&be.offsetDirection&&be.distance>this.options.threshold&&be.maxPointers==this.options.pointers&&k(Ge)>this.options.velocity&&4&be.eventType},emit:function(be){var De=qt(be.offsetDirection);De&&this.manager.emit(this.options.event+De,be),this.manager.emit(this.options.event,be)}}),S(Br,Pt,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[rr]},process:function(be){var De=this.options,Ge=be.pointers.length===De.pointers,vt=be.distance"']/g,ws=RegExp(kl.source),en=RegExp(Sa.source),nl=/<%-([\s\S]+?)%>/g,rt=/<%([\s\S]+?)%>/g,lt=/<%=([\s\S]+?)%>/g,ht=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ge=/^\w*$/,ve=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Be=/[\\^$.*+?()[\]{}|]/g,ut=RegExp(Be.source),Je=/^\s+/,Mt=/\s/,It=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Ot=/\{\n\/\* \[wrapped with (.+)\] \*/,Qt=/,? & /,zn=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ci=/[()=,{}\[\]\/\s]/,Rn=/\\(\\)?/g,bn=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Xn=/\w*$/,Cn=/^[-+]0x[0-9a-f]+$/i,rr=/^0b[01]+$/i,sr=/^\[object .+?Constructor\]$/,Qn=/^0o[0-7]+$/i,Wi=/^(?:0|[1-9]\d*)$/,Ca=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Qr=/($^)/,re=/['\n\r\u2028\u2029\\]/g,fe="\\ud800-\\udfff",J="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Ee="\\u2700-\\u27bf",Fe="a-z\\xdf-\\xf6\\xf8-\\xff",St="A-Z\\xc0-\\xd6\\xd8-\\xde",vn="\\ufe0e\\ufe0f",Es="\\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",Js="["+fe+"]",Fl="["+Es+"]",fo="["+J+"]",Br="\\d+",Vs="["+Ee+"]",Ac="["+Fe+"]",xn="[^"+fe+Es+Br+Ee+Fe+St+"]",po="\\ud83c[\\udffb-\\udfff]",Ta="[^"+fe+"]",Ed="(?:\\ud83c[\\udde6-\\uddff]){2}",be="[\\ud800-\\udbff][\\udc00-\\udfff]",De="["+St+"]",vt="(?:"+Ac+"|"+xn+")",$t="(?:"+De+"|"+xn+")",Xt="(?:['\u2019](?:d|ll|m|re|s|t|ve))?",ui="(?:['\u2019](?:D|LL|M|RE|S|T|VE))?",Vr="(?:"+fo+"|"+po+")?",Jr="["+vn+"]?",C1=Jr+Vr+"(?:\\u200d(?:"+[Ta,Ed,be].join("|")+")"+Jr+Vr+")*",xd="(?:"+[Vs,Ed,be].join("|")+")"+C1,er="(?:"+[Ta+fo+"?",fo,Ed,be,Js].join("|")+")",fp=RegExp("['\u2019]","g"),n_=RegExp(fo,"g"),Oh=RegExp(po+"(?="+po+")|"+er+C1,"g"),iv=RegExp([De+"?"+Ac+"+"+Xt+"(?="+[Fl,De,"$"].join("|")+")",$t+"+"+ui+"(?="+[Fl,De+vt,"$"].join("|")+")",De+"?"+vt+"+"+Xt,De+"+"+ui,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Br,xd].join("|"),"g"),T1=RegExp("[\\u200d"+fe+J+vn+"]"),Bl=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Rh=["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"],A1=-1,rn={};rn[kt]=rn[In]=rn[Nn]=rn[Yn]=rn[Mi]=rn[xi]=rn[Xr]=rn[Ls]=rn[fs]=!0,rn[Qe]=rn[tt]=rn[Ze]=rn[ze]=rn[Tt]=rn[Le]=rn[Me]=rn[Ue]=rn[ke]=rn[q]=rn[pe]=rn[_t]=rn[pt]=rn[we]=rn[V]=!1;var or={};or[Qe]=or[tt]=or[Ze]=or[Tt]=or[ze]=or[Le]=or[kt]=or[In]=or[Nn]=or[Yn]=or[Mi]=or[ke]=or[q]=or[pe]=or[_t]=or[pt]=or[we]=or[B]=or[xi]=or[Xr]=or[Ls]=or[fs]=!0,or[Me]=or[Ue]=or[V]=!1;var tn={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},M1=parseFloat,av=parseInt,Nt="object"==typeof global&&global&&global.Object===Object&&global,js="object"==typeof self&&self&&self.Object===Object&&self,Ui=Nt||js||Function("return this")(),Vl=it&&!it.nodeType&&it,Aa=Vl&&Ut&&!Ut.nodeType&&Ut,No=Aa&&Aa.exports===Vl,i_=No&&Nt.process,xr=function(){try{return Aa&&Aa.require&&Aa.require("util").types||i_&&i_.binding&&i_.binding("util")}catch(Rt){}}(),an=xr&&xr.isArrayBuffer,hi=xr&&xr.isDate,ur=xr&&xr.isMap,go=xr&&xr.isRegExp,Mc=xr&&xr.isSet,ss=xr&&xr.isTypedArray;function os(at,Rt,Ct){switch(Ct.length){case 0:return at.call(Rt);case 1:return at.call(Rt,Ct[0]);case 2:return at.call(Rt,Ct[0],Ct[1]);case 3:return at.call(Rt,Ct[0],Ct[1],Ct[2])}return at.apply(Rt,Ct)}function jr(at,Rt,Ct,hn){for(var Mn=-1,Li=null==at?0:at.length;++Mn-1}function Ph(at,Rt,Ct){for(var hn=-1,Mn=null==at?0:at.length;++hn-1;);return Ct}function R1(at,Rt){for(var Ct=at.length;Ct--&&il(Rt,at[Ct],0)>-1;);return Ct}function rF(at,Rt){for(var Ct=at.length,hn=0;Ct--;)at[Ct]===Rt&&++hn;return hn}var sF=Jo({\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"}),oF=Jo({"&":"&","<":"<",">":">",'"':""","'":"'"});function aF(at){return"\\"+tn[at]}function Fh(at){return T1.test(at)}function cv(at){var Rt=-1,Ct=Array(at.size);return at.forEach(function(hn,Mn){Ct[++Rt]=[Mn,hn]}),Ct}function P1(at,Rt){return function(Ct){return at(Rt(Ct))}}function xu(at,Rt){for(var Ct=-1,hn=at.length,Mn=0,Li=[];++Ct",""":'"',"'":"'"}),Bh=function at(Rt){var d,Ct=(Rt=null==Rt?Ui:Bh.defaults(Ui.Object(),Rt,Bh.pick(Ui,Rh))).Array,hn=Rt.Date,Mn=Rt.Error,Li=Rt.Function,es=Rt.Math,Yi=Rt.Object,u_=Rt.RegExp,d_=Rt.String,Ia=Rt.TypeError,dr=Ct.prototype,Su=Yi.prototype,gp=Rt["__core-js_shared__"],Sr=Li.prototype.toString,Xi=Su.hasOwnProperty,fF=0,Vh=(d=/[^.]+$/.exec(gp&&gp.keys&&gp.keys.IE_PROTO||""))?"Symbol(src)_1."+d:"",eo=Su.toString,F1=Sr.call(Yi),h_=Ui._,Dd=u_("^"+Sr.call(Xi).replace(Be,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),zs=No?Rt.Buffer:ee,Ul=Rt.Symbol,Id=Rt.Uint8Array,hv=zs?zs.allocUnsafe:ee,Oa=P1(Yi.getPrototypeOf,Yi),f_=Yi.create,mp=Su.propertyIsEnumerable,Ln=dr.splice,L1=Ul?Ul.isConcatSpreadable:ee,jh=Ul?Ul.iterator:ee,Cu=Ul?Ul.toStringTag:ee,_p=function(){try{var d=jc(Yi,"defineProperty");return d({},"",{}),d}catch(p){}}(),fv=Rt.clearTimeout!==Ui.clearTimeout&&Rt.clearTimeout,B1=hn&&hn.now!==Ui.Date.now&&hn.now,V1=Rt.setTimeout!==Ui.setTimeout&&Rt.setTimeout,Vt=es.ceil,Si=es.floor,_r=Yi.getOwnPropertySymbols,as=zs?zs.isBuffer:ee,p_=Rt.isFinite,Uh=dr.join,sl=P1(Yi.keys,Yi),zr=es.max,ps=es.min,pF=hn.now,j1=Rt.parseInt,zh=es.random,yp=dr.reverse,Cs=jc(Rt,"DataView"),mo=jc(Rt,"Map"),bp=jc(Rt,"Promise"),Ra=jc(Rt,"Set"),Fo=jc(Rt,"WeakMap"),Hh=jc(Yi,"create"),Gh=Fo&&new Fo,Od={},U1=Lu(Cs),g_=Lu(mo),m_=Lu(bp),pv=Lu(Ra),__=Lu(Fo),vp=Ul?Ul.prototype:ee,Rd=vp?vp.valueOf:ee,$h=vp?vp.toString:ee;function xe(d){if(Ar(d)&&!On(d)&&!(d instanceof fi)){if(d instanceof Lo)return d;if(Xi.call(d,"__wrapped__"))return sf(d)}return new Lo(d)}var Tu=function(){function d(){}return function(p){if(!Tr(p))return{};if(f_)return f_(p);d.prototype=p;var _=new d;return d.prototype=ee,_}}();function Wh(){}function Lo(d,p){this.__wrapped__=d,this.__actions__=[],this.__chain__=!!p,this.__index__=0,this.__values__=ee}function fi(d){this.__wrapped__=d,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=ye,this.__views__=[]}function _o(d){var p=-1,_=null==d?0:d.length;for(this.clear();++p<_;){var F=d[p];this.set(F[0],F[1])}}function zl(d){var p=-1,_=null==d?0:d.length;for(this.clear();++p<_;){var F=d[p];this.set(F[0],F[1])}}function ol(d){var p=-1,_=null==d?0:d.length;for(this.clear();++p<_;){var F=d[p];this.set(F[0],F[1])}}function Pa(d){var p=-1,_=null==d?0:d.length;for(this.__data__=new ol;++p<_;)this.add(d[p])}function Na(d){var p=this.__data__=new zl(d);this.size=p.size}function Yh(d,p){var _=On(d),F=!_&&gl(d),le=!_&&!F&&ml(d),Ae=!_&&!F&&!le&&df(d),He=_||F||le||Ae,Ye=He?Md(d.length,d_):[],ct=Ye.length;for(var Ft in d)(p||Xi.call(d,Ft))&&(!He||!("length"==Ft||le&&("offset"==Ft||"parent"==Ft)||Ae&&("buffer"==Ft||"byteLength"==Ft||"byteOffset"==Ft)||jo(Ft,ct)))&&Ye.push(Ft);return Ye}function w_(d){var p=d.length;return p?d[Hl(0,p-1)]:ee}function yv(d,p){return qd(no(d),Au(p,0,d.length))}function Pd(d){return qd(no(d))}function E_(d,p,_){(_!==ee&&!Dn(d[p],_)||_===ee&&!(p in d))&&ll(d,p,_)}function al(d,p,_){var F=d[p];(!Xi.call(d,p)||!Dn(F,_)||_===ee&&!(p in d))&&ll(d,p,_)}function Nd(d,p){for(var _=d.length;_--;)if(Dn(d[_][0],p))return _;return-1}function Cp(d,p,_,F){return Pc(d,function(le,Ae,He){p(F,le,_(le),He)}),F}function Q1(d,p){return d&&Fa(p,Is(p),d)}function ll(d,p,_){"__proto__"==p&&_p?_p(d,p,{configurable:!0,enumerable:!0,value:_,writable:!0}):d[p]=_}function x_(d,p){for(var _=-1,F=p.length,le=Ct(F),Ae=null==d;++_=p?d:p)),d}function Hs(d,p,_,F,le,Ae){var He,Ye=1&p,ct=2&p,Ft=4&p;if(_&&(He=le?_(d,F,le,Ae):_(d)),He!==ee)return He;if(!Tr(d))return d;var Lt=On(d);if(Lt){if(He=function(d){var p=d.length,_=new d.constructor(p);return p&&"string"==typeof d[0]&&Xi.call(d,"index")&&(_.index=d.index,_.input=d.input),_}(d),!Ye)return no(d,He)}else{var Gt=$s(d),nn=Gt==Ue||Gt==qe;if(ml(d))return Pp(d,Ye);if(Gt==pe||Gt==Qe||nn&&!le){if(He=ct||nn?{}:Uv(d),!Ye)return ct?function(d,p){return Fa(d,Bv(d),p)}(d,function(d,p){return d&&Fa(p,ro(p),d)}(He,d)):function(d,p){return Fa(d,V_(d),p)}(d,Q1(He,d))}else{if(!or[Gt])return le?d:{};He=function(d,p,_){var F=d.constructor;switch(p){case Ze:return Pu(d);case ze:case Le:return new F(+d);case Tt:return function(d,p){var _=p?Pu(d.buffer):d.buffer;return new d.constructor(_,d.byteOffset,d.byteLength)}(d,_);case kt:case In:case Nn:case Yn:case Mi:case xi:case Xr:case Ls:case fs:return N_(d,_);case ke:return new F;case q:case we:return new F(d);case _t:return function(d){var p=new d.constructor(d.source,Xn.exec(d));return p.lastIndex=d.lastIndex,p}(d);case pt:return new F;case B:return function(d){return Rd?Yi(Rd.call(d)):{}}(d)}}(d,Gt,Ye)}}Ae||(Ae=new Na);var wn=Ae.get(d);if(wn)return wn;Ae.set(d,He),yA(d)?d.forEach(function(Bn){He.add(Hs(Bn,p,_,Bn,d,Ae))}):pA(d)&&d.forEach(function(Bn,mi){He.set(mi,Hs(Bn,p,_,mi,d,Ae))});var gi=Lt?ee:(Ft?ct?L_:ql:ct?ro:Is)(d);return Us(gi||d,function(Bn,mi){gi&&(Bn=d[mi=Bn]),al(He,mi,Hs(Bn,p,_,mi,d,Ae))}),He}function Tp(d,p,_){var F=_.length;if(null==d)return!F;for(d=Yi(d);F--;){var le=_[F],He=d[le];if(He===ee&&!(le in d)||!(0,p[le])(He))return!1}return!0}function Xh(d,p,_){if("function"!=typeof d)throw new Ia(Se);return nf(function(){d.apply(ee,_)},p)}function Rc(d,p,_,F){var le=-1,Ae=jl,He=!0,Ye=d.length,ct=[],Ft=p.length;if(!Ye)return ct;_&&(p=qi(p,ta(_))),F?(Ae=Ph,He=!1):p.length>=200&&(Ae=kh,He=!1,p=new Pa(p));e:for(;++le-1},zl.prototype.set=function(d,p){var _=this.__data__,F=Nd(_,d);return F<0?(++this.size,_.push([d,p])):_[F][1]=p,this},ol.prototype.clear=function(){this.size=0,this.__data__={hash:new _o,map:new(mo||zl),string:new _o}},ol.prototype.delete=function(d){var p=Gs(this,d).delete(d);return this.size-=p?1:0,p},ol.prototype.get=function(d){return Gs(this,d).get(d)},ol.prototype.has=function(d){return Gs(this,d).has(d)},ol.prototype.set=function(d,p){var _=Gs(this,d),F=_.size;return _.set(d,p),this.size+=_.size==F?0:1,this},Pa.prototype.add=Pa.prototype.push=function(d){return this.__data__.set(d,W),this},Pa.prototype.has=function(d){return this.__data__.has(d)},Na.prototype.clear=function(){this.__data__=new zl,this.size=0},Na.prototype.delete=function(d){var p=this.__data__,_=p.delete(d);return this.size=p.size,_},Na.prototype.get=function(d){return this.__data__.get(d)},Na.prototype.has=function(d){return this.__data__.has(d)},Na.prototype.set=function(d,p){var _=this.__data__;if(_ instanceof zl){var F=_.__data__;if(!mo||F.length<199)return F.push([d,p]),this.size=++_.size,this;_=this.__data__=new ol(F)}return _.set(d,p),this.size=_.size,this};var Pc=dl(cl),C_=dl(Ap,!0);function vv(d,p){var _=!0;return Pc(d,function(F,le,Ae){return _=!!p(F,le,Ae)}),_}function Kh(d,p,_){for(var F=-1,le=d.length;++F0&&_(Ye)?p>1?Ts(Ye,p-1,_,F,le):Ur(le,Ye):F||(le[le.length]=Ye)}return le}var kd=Dv(),Fd=Dv(!0);function cl(d,p){return d&&kd(d,p,Is)}function Ap(d,p){return d&&Fd(d,p,Is)}function Qh(d,p){return Ma(p,function(_){return ua(d[_])})}function na(d,p){for(var _=0,F=(p=Lc(p,d)).length;null!=d&&_p}function Ld(d,p){return null!=d&&Xi.call(d,p)}function Bd(d,p){return null!=d&&p in Yi(d)}function Mu(d,p,_){for(var F=_?Ph:jl,le=d[0].length,Ae=d.length,He=Ae,Ye=Ct(Ae),ct=1/0,Ft=[];He--;){var Lt=d[He];He&&p&&(Lt=qi(Lt,ta(p))),ct=ps(Lt.length,ct),Ye[He]=!_&&(p||le>=120&&Lt.length>=120)?new Pa(He&&Lt):ee}Lt=d[0];var Gt=-1,nn=Ye[0];e:for(;++Gt=Ye?ct:ct*("desc"==_[F]?-1:1)}return d.index-p.index}(Ae,He,_)});Ct--;)at[Ct]=at[Ct].value;return at}(nT(d,function(Ae,He,Ye){return{criteria:qi(p,function(Ft){return Ft(Ae)}),index:++F,value:Ae}}))}function Cv(d,p,_){for(var F=-1,le=p.length,Ae={};++F-1;)Ye!==d&&Ln.call(Ye,ct,1),Ln.call(d,ct,1);return d}function Jh(d,p){for(var _=d?p.length:0,F=_-1;_--;){var le=p[_];if(_==F||le!==Ae){var Ae=le;jo(le)?Ln.call(d,le,1):Iu(d,le)}}return d}function Hl(d,p){return d+Si(zh()*(p-d+1))}function Dp(d,p){var _="";if(!d||p<1||p>Te)return _;do{p%2&&(_+=d),(p=Si(p/2))&&(d+=d)}while(p);return _}function pi(d,p){return Hp(yT(d,p,so),d+"")}function rT(d){return w_(nh(d))}function xF(d,p){var _=nh(d);return qd(_,Au(p,0,_.length))}function Ip(d,p,_,F){if(!Tr(d))return d;for(var le=-1,Ae=(p=Lc(p,d)).length,He=Ae-1,Ye=d;null!=Ye&&++lele?0:le+p),(_=_>le?le:_)<0&&(_+=le),le=p>_?0:_-p>>>0,p>>>=0;for(var Ae=Ct(le);++F>>1,He=d[Ae];null!==He&&!da(He)&&(_?He<=p:He=200){var Ft=p?null:F_(d);if(Ft)return a_(Ft);He=!1,le=kh,ct=new Pa}else ct=p?[]:Ye;e:for(;++F=F?d:Ms(d,p,_)}var aT=fv||function(d){return Ui.clearTimeout(d)};function Pp(d,p){if(p)return d.slice();var _=d.length,F=hv?hv(_):new d.constructor(_);return d.copy(F),F}function Pu(d){var p=new d.constructor(d.byteLength);return new Id(p).set(new Id(d)),p}function N_(d,p){var _=p?Pu(d.buffer):d.buffer;return new d.constructor(_,d.byteOffset,d.length)}function Bc(d,p){if(d!==p){var _=d!==ee,F=null===d,le=d==d,Ae=da(d),He=p!==ee,Ye=null===p,ct=p==p,Ft=da(p);if(!Ye&&!Ft&&!Ae&&d>p||Ae&&He&&ct&&!Ye&&!Ft||F&&He&&ct||!_&&ct||!le)return 1;if(!F&&!Ae&&!Ft&&d1?_[le-1]:ee,He=le>2?_[2]:ee;for(Ae=d.length>3&&"function"==typeof Ae?(le--,Ae):ee,He&&Ws(_[0],_[1],He)&&(Ae=le<3?ee:Ae,le=1),p=Yi(p);++F-1?le[Ae?p[He]:He]:ee}}function ku(d){return hl(function(p){var _=p.length,F=_,le=Lo.prototype.thru;for(d&&p.reverse();F--;){var Ae=p[F];if("function"!=typeof Ae)throw new Ia(Se);if(le&&!He&&"wrapper"==jp(Ae))var He=new Lo([],!0)}for(F=He?F:_;++F<_;){var Ye=jp(Ae=p[F]),ct="wrapper"==Ye?B_(Ae):ee;He=ct&&Up(ct[0])&&424==ct[1]&&!ct[4].length&&1==ct[9]?He[jp(ct[0])].apply(He,ct[3]):1==Ae.length&&Up(Ae)?He[Ye]():He.thru(Ae)}return function(){var Ft=arguments,Lt=Ft[0];if(He&&1==Ft.length&&On(Lt))return He.plant(Lt).value();for(var Gt=0,nn=_?p[Gt].apply(this,Ft):Lt;++Gt<_;)nn=p[Gt].call(this,nn);return nn}})}function Vc(d,p,_,F,le,Ae,He,Ye,ct,Ft){var Lt=p&X,Gt=1&p,nn=2&p,wn=24&p,Fn=512&p,gi=nn?ee:Gd(d);return function Bn(){for(var mi=arguments.length,Di=Ct(mi),wo=mi;wo--;)Di[wo]=arguments[wo];if(wn)var qs=Wd(Bn),ha=rF(Di,qs);if(F&&(Di=zd(Di,F,le,wn)),Ae&&(Di=Mv(Di,Ae,He,wn)),mi-=ha,wn&&mi1&&Di.reverse(),Lt&&ctYe))return!1;var Ft=Ae.get(d),Lt=Ae.get(p);if(Ft&&Lt)return Ft==p&&Lt==d;var Gt=-1,nn=!0,wn=2&_?new Pa:ee;for(Ae.set(d,p),Ae.set(p,d);++Gt-1&&d%1==0&&d1?"& ":"")+p[F],p=p.join(_>2?", ":" "),d.replace(It,"{\n/* [wrapped with "+p+"] */\n")}(F,function(d,p){return Us(st,function(_){var F="_."+_[0];p&_[1]&&!jl(d,F)&&d.push(F)}),d.sort()}(function(d){var p=d.match(Ot);return p?p[1].split(Qt):[]}(F),_)))}function $_(d){var p=0,_=0;return function(){var F=pF(),le=16-(F-_);if(_=F,le>0){if(++p>=800)return arguments[0]}else p=0;return d.apply(ee,arguments)}}function qd(d,p){var _=-1,F=d.length,le=F-1;for(p=p===ee?F:p;++_1?d[p-1]:ee;return _="function"==typeof _?(d.pop(),_):ee,HT(d,_)});function ty(d){var p=xe(d);return p.__chain__=!0,p}function Xd(d,p){return p(d)}var ny=hl(function(d){var p=d.length,_=p?d[0]:0,F=this.__wrapped__,le=function(Ae){return x_(Ae,d)};return!(p>1||this.__actions__.length)&&F instanceof fi&&jo(_)?((F=F.slice(_,+_+(p?1:0))).__actions__.push({func:Xd,args:[le],thisArg:ee}),new Lo(F,this.__chain__).thru(function(Ae){return p&&!Ae.length&&Ae.push(ee),Ae})):this.thru(le)}),WT=ts(function(d,p,_){Xi.call(d,_)?++d[_]:ll(d,_,1)}),KT=Ov(q_),QT=Ov(Y_);function oy(d,p){return(On(d)?Us:Pc)(d,kn(p,3))}function Wp(d,p){return(On(d)?Sd:C_)(d,kn(p,3))}var JT=ts(function(d,p,_){Xi.call(d,_)?d[_].push(p):ll(d,_,[p])}),cw=pi(function(d,p,_){var F=-1,le="function"==typeof p,Ae=bo(d)?Ct(d.length):[];return Pc(d,function(He){Ae[++F]=le?os(p,He,_):ka(He,p,_)}),Ae}),uw=ts(function(d,p,_){ll(d,_,p)});function pl(d,p){return(On(d)?qi:nT)(d,kn(p,3))}var hw=ts(function(d,p,_){d[_?0:1].push(p)},function(){return[[],[]]}),Yp=pi(function(d,p){if(null==d)return[];var _=p.length;return _>1&&Ws(d,p[0],p[1])?p=[]:_>2&&Ws(p[0],p[1],p[2])&&(p=[p[0]]),Zh(d,Ts(p,1),[])}),Bu=B1||function(){return Ui.Date.now()};function Xp(d,p,_){return p=_?ee:p,Wl(d,X,ee,ee,ee,ee,p=d&&null==p?d.length:p)}function ly(d,p){var _;if("function"!=typeof p)throw new Ia(Se);return d=ti(d),function(){return--d>0&&(_=p.apply(this,arguments)),d<=1&&(p=ee),_}}var cf=pi(function(d,p,_){var F=1;if(_.length){var le=xu(_,Wd(cf));F|=z}return Wl(d,F,p,_,le)}),Qd=pi(function(d,p,_){var F=3;if(_.length){var le=xu(_,Wd(Qd));F|=z}return Wl(p,F,d,_,le)});function bw(d,p,_){var F,le,Ae,He,Ye,ct,Ft=0,Lt=!1,Gt=!1,nn=!0;if("function"!=typeof d)throw new Ia(Se);function wn(Gi){var bl=F,Gc=le;return F=le=ee,Ft=Gi,He=d.apply(Gc,bl)}function Fn(Gi){return Ft=Gi,Ye=nf(mi,p),Lt?wn(Gi):He}function Bn(Gi){var bl=Gi-ct;return ct===ee||bl>=p||bl<0||Gt&&Gi-Ft>=Ae}function mi(){var Gi=Bu();if(Bn(Gi))return Di(Gi);Ye=nf(mi,function(Gi){var aM=p-(Gi-ct);return Gt?ps(aM,Ae-(Gi-Ft)):aM}(Gi))}function Di(Gi){return Ye=ee,nn&&F?wn(Gi):(F=le=ee,He)}function ha(){var Gi=Bu(),bl=Bn(Gi);if(F=arguments,le=this,ct=Gi,bl){if(Ye===ee)return Fn(ct);if(Gt)return aT(Ye),Ye=nf(mi,p),wn(ct)}return Ye===ee&&(Ye=nf(mi,p)),He}return p=vo(p)||0,Tr(_)&&(Lt=!!_.leading,Ae=(Gt="maxWait"in _)?zr(vo(_.maxWait)||0,p):Ae,nn="trailing"in _?!!_.trailing:nn),ha.cancel=function(){Ye!==ee&&aT(Ye),Ft=0,F=ct=le=Ye=ee},ha.flush=function(){return Ye===ee?He:Di(Bu())},ha}var iA=pi(function(d,p){return Xh(d,1,p)}),vw=pi(function(d,p,_){return Xh(d,vo(p)||0,_)});function uf(d,p){if("function"!=typeof d||null!=p&&"function"!=typeof p)throw new Ia(Se);var _=function(){var F=arguments,le=p?p.apply(this,F):F[0],Ae=_.cache;if(Ae.has(le))return Ae.get(le);var He=d.apply(this,F);return _.cache=Ae.set(le,He)||Ae,He};return _.cache=new(uf.Cache||ol),_}function dy(d){if("function"!=typeof d)throw new Ia(Se);return function(){var p=arguments;switch(p.length){case 0:return!d.call(this);case 1:return!d.call(this,p[0]);case 2:return!d.call(this,p[0],p[1]);case 3:return!d.call(this,p[0],p[1],p[2])}return!d.apply(this,p)}}uf.Cache=ol;var rA=oT(function(d,p){var _=(p=1==p.length&&On(p[0])?qi(p[0],ta(kn())):qi(Ts(p,1),ta(kn()))).length;return pi(function(F){for(var le=-1,Ae=ps(F.length,_);++le=p}),gl=Z1(function(){return arguments}())?Z1:function(d){return Ar(d)&&Xi.call(d,"callee")&&!mp.call(d,"callee")},On=Ct.isArray,Tw=an?ta(an):function(d){return Ar(d)&&As(d)==Ze};function bo(d){return null!=d&&fy(d.length)&&!ua(d)}function Cr(d){return Ar(d)&&bo(d)}var ml=as||Fy,Aw=hi?ta(hi):function(d){return Ar(d)&&As(d)==Le};function Ba(d){if(!Ar(d))return!1;var p=As(d);return p==Me||"[object DOMException]"==p||"string"==typeof d.message&&"string"==typeof d.name&&!Jp(d)}function ua(d){if(!Tr(d))return!1;var p=As(d);return p==Ue||p==qe||"[object AsyncFunction]"==p||"[object Proxy]"==p}function Zp(d){return"number"==typeof d&&d==ti(d)}function fy(d){return"number"==typeof d&&d>-1&&d%1==0&&d<=Te}function Tr(d){var p=typeof d;return null!=d&&("object"==p||"function"==p)}function Ar(d){return null!=d&&"object"==typeof d}var pA=ur?ta(ur):function(d){return Ar(d)&&$s(d)==ke};function _A(d){return"number"==typeof d||Ar(d)&&As(d)==q}function Jp(d){if(!Ar(d)||As(d)!=pe)return!1;var p=Oa(d);if(null===p)return!0;var _=Xi.call(p,"constructor")&&p.constructor;return"function"==typeof _&&_ instanceof _&&Sr.call(_)==F1}var Ow=go?ta(go):function(d){return Ar(d)&&As(d)==_t},yA=Mc?ta(Mc):function(d){return Ar(d)&&$s(d)==pt};function gy(d){return"string"==typeof d||!On(d)&&Ar(d)&&As(d)==we}function da(d){return"symbol"==typeof d||Ar(d)&&As(d)==B}var df=ss?ta(ss):function(d){return Ar(d)&&fy(d.length)&&!!rn[As(d)]},Uc=Lp(Sv),my=Lp(function(d,p){return d<=p});function Rw(d){if(!d)return[];if(bo(d))return gy(d)?rl(d):no(d);if(jh&&d[jh])return function(at){for(var Rt,Ct=[];!(Rt=at.next()).done;)Ct.push(Rt.value);return Ct}(d[jh]());var p=$s(d);return(p==ke?cv:p==pt?a_:nh)(d)}function _l(d){return d?(d=vo(d))===te||d===-te?17976931348623157e292*(d<0?-1:1):d==d?d:0:0===d?d:0}function ti(d){var p=_l(d),_=p%1;return p==p?_?p-_:p:0}function _y(d){return d?Au(ti(d),0,ye):0}function vo(d){if("number"==typeof d)return d;if(da(d))return NaN;if(Tr(d)){var p="function"==typeof d.valueOf?d.valueOf():d;d=Tr(p)?p+"":p}if("string"!=typeof d)return 0===d?d:+d;d=lv(d);var _=rr.test(d);return _||Qn.test(d)?av(d.slice(2),_?2:8):Cn.test(d)?NaN:+d}function Pw(d){return Fa(d,ro(d))}function Hi(d){return null==d?"":Vo(d)}var bA=Gl(function(d,p){if(zp(p)||bo(p))Fa(p,Is(p),d);else for(var _ in p)Xi.call(p,_)&&al(d,_,p[_])}),vA=Gl(function(d,p){Fa(p,ro(p),d)}),Zd=Gl(function(d,p,_,F){Fa(p,ro(p),d,F)}),wA=Gl(function(d,p,_,F){Fa(p,Is(p),d,F)}),Nw=hl(x_),xA=pi(function(d,p){d=Yi(d);var _=-1,F=p.length,le=F>2?p[2]:ee;for(le&&Ws(p[0],p[1],le)&&(F=1);++_1),Ae}),Fa(d,L_(d),_),F&&(_=Hs(_,7,Bp));for(var le=p.length;le--;)Iu(_,p[le]);return _}),MA=hl(function(d,p){return null==d?{}:function(d,p){return Cv(d,p,function(_,F){return eg(d,F)})}(d,p)});function Uw(d,p){if(null==d)return{};var _=qi(L_(d),function(F){return[F]});return p=kn(p),Cv(d,_,function(F,le){return p(F,le[0])})}var DA=Fu(Is),Hw=Fu(ro);function nh(d){return null==d?[]:o_(d,Is(d))}var NA=$l(function(d,p,_){return p=p.toLowerCase(),d+(_?wy(p):p)});function wy(d){return ig(Hi(d).toLowerCase())}function Ey(d){return(d=Hi(d))&&d.replace(Ca,sF).replace(n_,"")}var FA=$l(function(d,p,_){return d+(_?"-":"")+p.toLowerCase()}),LA=$l(function(d,p,_){return d+(_?" ":"")+p.toLowerCase()}),GF=Np("toLowerCase"),zA=$l(function(d,p,_){return d+(_?"_":"")+p.toLowerCase()}),Cy=$l(function(d,p,_){return d+(_?" ":"")+ig(p)}),Xw=$l(function(d,p,_){return d+(_?" ":"")+p.toUpperCase()}),ig=Np("toUpperCase");function Dy(d,p,_){return d=Hi(d),(p=_?ee:p)===ee?function(at){return Bl.test(at)}(d)?function(at){return at.match(iv)||[]}(d):function(at){return at.match(zn)||[]}(d):d.match(p)||[]}var Iy=pi(function(d,p){try{return os(d,ee,p)}catch(_){return Ba(_)?_:new Mn(_)}}),Kw=hl(function(d,p){return Us(p,function(_){_=si(_),ll(d,_,cf(d[_],d))}),d});function Oy(d){return function(){return d}}var WF=ku(),Vu=ku(!0);function so(d){return d}function ju(d){return tT("function"==typeof d?d:Hs(d,1))}var Ry=pi(function(d,p){return function(_){return ka(_,d,p)}}),Qw=pi(function(d,p){return function(_){return ka(d,_,p)}});function Py(d,p,_){var F=Is(p),le=Qh(p,F);null==_&&(!Tr(p)||!le.length&&F.length)&&(_=p,p=d,d=this,le=Qh(p,Is(p)));var Ae=!(Tr(_)&&"chain"in _&&!_.chain),He=ua(d);return Us(le,function(Ye){var ct=p[Ye];d[Ye]=ct,He&&(d.prototype[Ye]=function(){var Ft=this.__chain__;if(Ae||Ft){var Lt=d(this.__wrapped__),Gt=Lt.__actions__=no(this.__actions__);return Gt.push({func:ct,args:arguments,thisArg:d}),Lt.__chain__=Ft,Lt}return ct.apply(d,Ur([this.value()],arguments))})}),d}function Ny(){}var XA=kp(qi),KA=kp(ri),Jw=kp(ko);function Uu(d){return oa(d)?r_(si(d)):function(d){return function(p){return na(p,d)}}(d)}var QA=Pv(),ZA=Pv(!0);function Hc(){return[]}function Fy(){return!1}var Hn=k_(function(d,p){return d+p},0),Ly=$d("ceil"),YF=k_(function(d,p){return d/p},1),Kl=$d("floor"),iE=k_(function(d,p){return d*p},1),rE=$d("round"),sE=k_(function(d,p){return d-p},0);return xe.after=function(d,p){if("function"!=typeof p)throw new Ia(Se);return d=ti(d),function(){if(--d<1)return p.apply(this,arguments)}},xe.ary=Xp,xe.assign=bA,xe.assignIn=vA,xe.assignInWith=Zd,xe.assignWith=wA,xe.at=Nw,xe.before=ly,xe.bind=cf,xe.bindAll=Kw,xe.bindKey=Qd,xe.castArray=function(){if(!arguments.length)return[];var d=arguments[0];return On(d)?d:[d]},xe.chain=ty,xe.chunk=function(d,p,_){p=(_?Ws(d,p,_):p===ee)?1:zr(ti(p),0);var F=null==d?0:d.length;if(!F||p<1)return[];for(var le=0,Ae=0,He=Ct(Vt(F/p));lele?0:le+_),(F=F===ee||F>le?le:ti(F))<0&&(F+=le),F=_>F?0:_y(F);_>>0)?(d=Hi(d))&&("string"==typeof p||null!=p&&!Ow(p))&&!(p=Vo(p))&&Fh(d)?ul(rl(d),0,_):d.split(p,_):[]},xe.spread=function(d,p){if("function"!=typeof d)throw new Ia(Se);return p=null==p?0:zr(ti(p),0),pi(function(_){var F=_[p],le=ul(_,0,p);return F&&Ur(le,F),os(d,this,le)})},xe.tail=function(d){var p=null==d?0:d.length;return p?Ms(d,1,p):[]},xe.take=function(d,p,_){return d&&d.length?Ms(d,0,(p=_||p===ee?1:ti(p))<0?0:p):[]},xe.takeRight=function(d,p,_){var F=null==d?0:d.length;return F?Ms(d,(p=F-(p=_||p===ee?1:ti(p)))<0?0:p,F):[]},xe.takeRightWhile=function(d,p){return d&&d.length?Ou(d,kn(p,3),!1,!0):[]},xe.takeWhile=function(d,p){return d&&d.length?Ou(d,kn(p,3)):[]},xe.tap=function(d,p){return p(d),d},xe.throttle=function(d,p,_){var F=!0,le=!0;if("function"!=typeof d)throw new Ia(Se);return Tr(_)&&(F="leading"in _?!!_.leading:F,le="trailing"in _?!!_.trailing:le),bw(d,p,{leading:F,maxWait:p,trailing:le})},xe.thru=Xd,xe.toArray=Rw,xe.toPairs=DA,xe.toPairsIn=Hw,xe.toPath=function(d){return On(d)?qi(d,si):da(d)?[d]:no($v(Hi(d)))},xe.toPlainObject=Pw,xe.transform=function(d,p,_){var F=On(d),le=F||ml(d)||df(d);if(p=kn(p,4),null==_){var Ae=d&&d.constructor;_=le?F?new Ae:[]:Tr(d)&&ua(Ae)?Tu(Oa(d)):{}}return(le?Us:cl)(d,function(He,Ye,ct){return p(_,He,Ye,ct)}),_},xe.unary=function(d){return Xp(d,1)},xe.union=tw,xe.unionBy=jT,xe.unionWith=UT,xe.uniq=function(d){return d&&d.length?kc(d):[]},xe.uniqBy=function(d,p){return d&&d.length?kc(d,kn(p,2)):[]},xe.uniqWith=function(d,p){return p="function"==typeof p?p:ee,d&&d.length?kc(d,ee,p):[]},xe.unset=function(d,p){return null==d||Iu(d,p)},xe.unzip=nw,xe.unzipWith=HT,xe.update=function(d,p,_){return null==d?d:Op(d,p,P_(_))},xe.updateWith=function(d,p,_,F){return F="function"==typeof F?F:ee,null==d?d:Op(d,p,P_(_),F)},xe.values=nh,xe.valuesIn=function(d){return null==d?[]:o_(d,ro(d))},xe.without=iw,xe.words=Dy,xe.wrap=function(d,p){return Kp(P_(p),d)},xe.xor=PF,xe.xorBy=Uo,xe.xorWith=J_,xe.zip=ey,xe.zipObject=function(d,p){return Rp(d||[],p||[],al)},xe.zipObjectDeep=function(d,p){return Rp(d||[],p||[],Ip)},xe.zipWith=lf,xe.entries=DA,xe.entriesIn=Hw,xe.extend=vA,xe.extendWith=Zd,Py(xe,xe),xe.add=Hn,xe.attempt=Iy,xe.camelCase=NA,xe.capitalize=wy,xe.ceil=Ly,xe.clamp=function(d,p,_){return _===ee&&(_=p,p=ee),_!==ee&&(_=(_=vo(_))==_?_:0),p!==ee&&(p=(p=vo(p))==p?p:0),Au(vo(d),p,_)},xe.clone=function(d){return Hs(d,4)},xe.cloneDeep=function(d){return Hs(d,5)},xe.cloneDeepWith=function(d,p){return Hs(d,5,p="function"==typeof p?p:ee)},xe.cloneWith=function(d,p){return Hs(d,4,p="function"==typeof p?p:ee)},xe.conformsTo=function(d,p){return null==p||Tp(d,p,Is(p))},xe.deburr=Ey,xe.defaultTo=function(d,p){return null==d||d!=d?p:d},xe.divide=YF,xe.endsWith=function(d,p,_){d=Hi(d),p=Vo(p);var F=d.length,le=_=_===ee?F:Au(ti(_),0,F);return(_-=p.length)>=0&&d.slice(_,le)==p},xe.eq=Dn,xe.escape=function(d){return(d=Hi(d))&&en.test(d)?d.replace(Sa,oF):d},xe.escapeRegExp=function(d){return(d=Hi(d))&&ut.test(d)?d.replace(Be,"\\$&"):d},xe.every=function(d,p,_){var F=On(d)?ri:vv;return _&&Ws(d,p,_)&&(p=ee),F(d,kn(p,3))},xe.find=KT,xe.findIndex=q_,xe.findKey=function(d,p){return Nh(d,kn(p,3),cl)},xe.findLast=QT,xe.findLastIndex=Y_,xe.findLastKey=function(d,p){return Nh(d,kn(p,3),Ap)},xe.floor=Kl,xe.forEach=oy,xe.forEachRight=Wp,xe.forIn=function(d,p){return null==d?d:kd(d,kn(p,3),ro)},xe.forInRight=function(d,p){return null==d?d:Fd(d,kn(p,3),ro)},xe.forOwn=function(d,p){return d&&cl(d,kn(p,3))},xe.forOwnRight=function(d,p){return d&&Ap(d,kn(p,3))},xe.get=pf,xe.gt=zt,xe.gte=Cw,xe.has=function(d,p){return null!=d&&jv(d,p,Ld)},xe.hasIn=eg,xe.head=qv,xe.identity=so,xe.includes=function(d,p,_,F){d=bo(d)?d:nh(d),_=_&&!F?ti(_):0;var le=d.length;return _<0&&(_=zr(le+_,0)),gy(d)?_<=le&&d.indexOf(p,_)>-1:!!le&&il(d,p,_)>-1},xe.indexOf=function(d,p,_){var F=null==d?0:d.length;if(!F)return-1;var le=null==_?0:ti(_);return le<0&&(le=zr(F+le,0)),il(d,p,le)},xe.inRange=function(d,p,_){return p=_l(p),_===ee?(_=p,p=0):_=_l(_),function(d,p,_){return d>=ps(p,_)&&d=-Te&&d<=Te},xe.isSet=yA,xe.isString=gy,xe.isSymbol=da,xe.isTypedArray=df,xe.isUndefined=function(d){return d===ee},xe.isWeakMap=function(d){return Ar(d)&&$s(d)==V},xe.isWeakSet=function(d){return Ar(d)&&"[object WeakSet]"==As(d)},xe.join=function(d,p){return null==d?"":Uh.call(d,p)},xe.kebabCase=FA,xe.last=aa,xe.lastIndexOf=function(d,p,_){var F=null==d?0:d.length;if(!F)return-1;var le=F;return _!==ee&&(le=(le=ti(_))<0?zr(F+le,0):ps(le,F-1)),p==p?function(at,Rt,Ct){for(var hn=Ct+1;hn--;)if(at[hn]===Rt)return hn;return hn}(d,p,le):Td(d,Dc,le,!0)},xe.lowerCase=LA,xe.lowerFirst=GF,xe.lt=Uc,xe.lte=my,xe.max=function(d){return d&&d.length?Kh(d,so,yo):ee},xe.maxBy=function(d,p){return d&&d.length?Kh(d,kn(p,2),yo):ee},xe.mean=function(d){return Ss(d,so)},xe.meanBy=function(d,p){return Ss(d,kn(p,2))},xe.min=function(d){return d&&d.length?Kh(d,so,Sv):ee},xe.minBy=function(d,p){return d&&d.length?Kh(d,kn(p,2),Sv):ee},xe.stubArray=Hc,xe.stubFalse=Fy,xe.stubObject=function(){return{}},xe.stubString=function(){return""},xe.stubTrue=function(){return!0},xe.multiply=iE,xe.nth=function(d,p){return d&&d.length?Du(d,ti(p)):ee},xe.noConflict=function(){return Ui._===this&&(Ui._=h_),this},xe.noop=Ny,xe.now=Bu,xe.pad=function(d,p,_){d=Hi(d);var F=(p=ti(p))?Lh(d):0;if(!p||F>=p)return d;var le=(p-F)/2;return Fp(Si(le),_)+d+Fp(Vt(le),_)},xe.padEnd=function(d,p,_){d=Hi(d);var F=(p=ti(p))?Lh(d):0;return p&&Fp){var F=d;d=p,p=F}if(_||d%1||p%1){var le=zh();return ps(d+le*(p-d+M1("1e-"+((le+"").length-1))),p)}return Hl(d,p)},xe.reduce=function(d,p,_){var F=On(d)?Eu:ea,le=arguments.length<3;return F(d,kn(p,4),_,le,Pc)},xe.reduceRight=function(d,p,_){var F=On(d)?Cd:ea,le=arguments.length<3;return F(d,kn(p,4),_,le,C_)},xe.repeat=function(d,p,_){return p=(_?Ws(d,p,_):p===ee)?1:ti(p),Dp(Hi(d),p)},xe.replace=function(){var d=arguments,p=Hi(d[0]);return d.length<3?p:p.replace(d[1],d[2])},xe.result=function(d,p,_){var F=-1,le=(p=Lc(p,d)).length;for(le||(le=1,d=ee);++FTe)return[];var _=ye,F=ps(d,ye);p=kn(p),d-=ye;for(var le=Md(F,p);++_=Ae)return d;var Ye=_-Lh(F);if(Ye<1)return F;var ct=He?ul(He,0,Ye).join(""):d.slice(0,Ye);if(le===ee)return ct+F;if(He&&(Ye+=ct.length-Ye),Ow(le)){if(d.slice(Ye).search(le)){var Ft,Lt=ct;for(le.global||(le=u_(le.source,Hi(Xn.exec(le))+"g")),le.lastIndex=0;Ft=le.exec(Lt);)var Gt=Ft.index;ct=ct.slice(0,Gt===ee?Ye:Gt)}}else if(d.indexOf(Vo(le),Ye)!=Ye){var nn=ct.lastIndexOf(le);nn>-1&&(ct=ct.slice(0,nn))}return ct+F},xe.unescape=function(d){return(d=Hi(d))&&ws.test(d)?d.replace(kl,c_):d},xe.uniqueId=function(d){var p=++fF;return Hi(d)+p},xe.upperCase=Xw,xe.upperFirst=ig,xe.each=oy,xe.eachRight=Wp,xe.first=qv,Py(xe,function(){var d={};return cl(xe,function(p,_){Xi.call(xe.prototype,_)||(d[_]=p)}),d}(),{chain:!1}),xe.VERSION="4.17.21",Us(["bind","bindKey","curry","curryRight","partial","partialRight"],function(d){xe[d].placeholder=xe}),Us(["drop","take"],function(d,p){fi.prototype[d]=function(_){_=_===ee?1:zr(ti(_),0);var F=this.__filtered__&&!p?new fi(this):this.clone();return F.__filtered__?F.__takeCount__=ps(_,F.__takeCount__):F.__views__.push({size:ps(_,ye),type:d+(F.__dir__<0?"Right":"")}),F},fi.prototype[d+"Right"]=function(_){return this.reverse()[d](_).reverse()}}),Us(["filter","map","takeWhile"],function(d,p){var _=p+1,F=1==_||3==_;fi.prototype[d]=function(le){var Ae=this.clone();return Ae.__iteratees__.push({iteratee:kn(le,3),type:_}),Ae.__filtered__=Ae.__filtered__||F,Ae}}),Us(["head","last"],function(d,p){var _="take"+(p?"Right":"");fi.prototype[d]=function(){return this[_](1).value()[0]}}),Us(["initial","tail"],function(d,p){var _="drop"+(p?"":"Right");fi.prototype[d]=function(){return this.__filtered__?new fi(this):this[_](1)}}),fi.prototype.compact=function(){return this.filter(so)},fi.prototype.find=function(d){return this.filter(d).head()},fi.prototype.findLast=function(d){return this.reverse().find(d)},fi.prototype.invokeMap=pi(function(d,p){return"function"==typeof d?new fi(this):this.map(function(_){return ka(_,d,p)})}),fi.prototype.reject=function(d){return this.filter(dy(kn(d)))},fi.prototype.slice=function(d,p){d=ti(d);var _=this;return _.__filtered__&&(d>0||p<0)?new fi(_):(d<0?_=_.takeRight(-d):d&&(_=_.drop(d)),p!==ee&&(_=(p=ti(p))<0?_.dropRight(-p):_.take(p-d)),_)},fi.prototype.takeRightWhile=function(d){return this.reverse().takeWhile(d).reverse()},fi.prototype.toArray=function(){return this.take(ye)},cl(fi.prototype,function(d,p){var _=/^(?:filter|find|map|reject)|While$/.test(p),F=/^(?:head|last)$/.test(p),le=xe[F?"take"+("last"==p?"Right":""):p],Ae=F||/^find/.test(p);!le||(xe.prototype[p]=function(){var He=this.__wrapped__,Ye=F?[1]:arguments,ct=He instanceof fi,Ft=Ye[0],Lt=ct||On(He),Gt=function(mi){var Di=le.apply(xe,Ur([mi],Ye));return F&&nn?Di[0]:Di};Lt&&_&&"function"==typeof Ft&&1!=Ft.length&&(ct=Lt=!1);var nn=this.__chain__,wn=!!this.__actions__.length,Fn=Ae&&!nn,gi=ct&&!wn;if(!Ae&&Lt){He=gi?He:new fi(this);var Bn=d.apply(He,Ye);return Bn.__actions__.push({func:Xd,args:[Gt],thisArg:ee}),new Lo(Bn,nn)}return Fn&&gi?d.apply(this,Ye):(Bn=this.thru(Gt),Fn?F?Bn.value()[0]:Bn.value():Bn)})}),Us(["pop","push","shift","sort","splice","unshift"],function(d){var p=dr[d],_=/^(?:push|sort|unshift)$/.test(d)?"tap":"thru",F=/^(?:pop|shift)$/.test(d);xe.prototype[d]=function(){var le=arguments;if(F&&!this.__chain__){var Ae=this.value();return p.apply(On(Ae)?Ae:[],le)}return this[_](function(He){return p.apply(On(He)?He:[],le)})}}),cl(fi.prototype,function(d,p){var _=xe[p];if(_){var F=_.name+"";Xi.call(Od,F)||(Od[F]=[]),Od[F].push({name:p,func:_})}}),Od[Vc(ee,2).name]=[{name:"wrapper",func:ee}],fi.prototype.clone=function(){var d=new fi(this.__wrapped__);return d.__actions__=no(this.__actions__),d.__dir__=this.__dir__,d.__filtered__=this.__filtered__,d.__iteratees__=no(this.__iteratees__),d.__takeCount__=this.__takeCount__,d.__views__=no(this.__views__),d},fi.prototype.reverse=function(){if(this.__filtered__){var d=new fi(this);d.__dir__=-1,d.__filtered__=!0}else(d=this.clone()).__dir__*=-1;return d},fi.prototype.value=function(){var d=this.__wrapped__.value(),p=this.__dir__,_=On(d),F=p<0,le=_?d.length:0,Ae=function(d,p,_){for(var F=-1,le=_.length;++F=this.__values__.length;return{done:d,value:d?ee:this.__values__[this.__index__++]}},xe.prototype.plant=function(d){for(var p,_=this;_ instanceof Wh;){var F=sf(_);F.__index__=0,F.__values__=ee,p?le.__wrapped__=F:p=F;var le=F;_=_.__wrapped__}return le.__wrapped__=d,p},xe.prototype.reverse=function(){var d=this.__wrapped__;if(d instanceof fi){var p=d;return this.__actions__.length&&(p=new fi(this)),(p=p.reverse()).__actions__.push({func:Xd,args:[Z_],thisArg:ee}),new Lo(p,this.__chain__)}return this.thru(Z_)},xe.prototype.toJSON=xe.prototype.valueOf=xe.prototype.value=function(){return sT(this.__wrapped__,this.__actions__)},xe.prototype.first=xe.prototype.head,jh&&(xe.prototype[jh]=function(){return this}),xe}();Ui._=Bh,(yt=function(){return Bh}.call(it,et,it,Ut))!==ee&&(Ut.exports=yt)}.call(this)},5478:function(Ut){Ut.exports=function(){"use strict";function it(rt,lt){for(var ht=0;htrt.length)&&(lt=rt.length);for(var ht=0,ge=new Array(lt);ht=rt.length?{done:!0}:{done:!1,value:rt[ge++]}}}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 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}}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:Y,changeDefaults:function(rt){dt.exports.defaults=rt}};var he=/[&<>"']/,W=/[&<>"']/g,j=/[<>"']|&(?!#?\w+;)/,k=/[<>"']|&(?!#?\w+;)/g,Q={"&":"&","<":"<",">":">",'"':""","'":"'"},H=function(lt){return Q[lt]};var C=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function R(rt){return rt.replace(C,function(lt,ht){return"colon"===(ht=ht.toLowerCase())?":":"#"===ht.charAt(0)?"x"===ht.charAt(1)?String.fromCharCode(parseInt(ht.substring(2),16)):String.fromCharCode(+ht.substring(1)):""})}var T=/(^|[^\[])\^/g;var y=/[^\w:]/g,S=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;var z={},P=/^[^:]+:\/*[^/]*$/,X=/^([^:]+:)[\s\S]*$/,ue=/^([^:]+:\/*[^/]*)[\s\S]*$/;function I(rt,lt){z[" "+rt]||(z[" "+rt]=P.test(rt)?rt+"/":$(rt,"/",!0));var ht=-1===(rt=z[" "+rt]).indexOf(":");return"//"===lt.substring(0,2)?ht?lt:rt.replace(X,"$1")+lt:"/"===lt.charAt(0)?ht?lt:rt.replace(ue,"$1")+lt:rt+lt}function $(rt,lt,ht){var ge=rt.length;if(0===ge)return"";for(var ve=0;ve1;)1<&&(ht+=rt),lt>>=1,rt+=rt;return ht+rt},Te=dt.exports.defaults,me=$,ne=function(rt,lt){var ge=rt.replace(/\|/g,function(Be,ut,Je){for(var Mt=!1,It=ut;--It>=0&&"\\"===Je[It];)Mt=!Mt;return Mt?"|":" |"}).split(/ \|/),ve=0;if(ge.length>lt)ge.splice(lt);else for(;ge.length1?{type:"space",raw:ve[0]}:{raw:"\n"}},lt.code=function(ge){var ve=this.rules.block.code.exec(ge);if(ve){var Be=ve[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:ve[0],codeBlockStyle:"indented",text:this.options.pedantic?Be:me(Be,"\n")}}},lt.fences=function(ge){var ve=this.rules.block.fences.exec(ge);if(ve){var Be=ve[0],ut=function(rt,lt){var ht=rt.match(/^(\s+)(?:```)/);if(null===ht)return lt;var ge=ht[1];return lt.split("\n").map(function(ve){var Be=ve.match(/^\s+/);return null===Be?ve:Be[0].length>=ge.length?ve.slice(ge.length):ve}).join("\n")}(Be,ve[3]||"");return{type:"code",raw:Be,lang:ve[2]?ve[2].trim():ve[2],text:ut}}},lt.heading=function(ge){var ve=this.rules.block.heading.exec(ge);if(ve){var Be=ve[2].trim();if(/#$/.test(Be)){var ut=me(Be,"#");(this.options.pedantic||!ut||/ $/.test(ut))&&(Be=ut.trim())}return{type:"heading",raw:ve[0],depth:ve[1].length,text:Be}}},lt.nptable=function(ge){var ve=this.rules.block.nptable.exec(ge);if(ve){var Be={type:"table",header:ne(ve[1].replace(/^ *| *\| *$/g,"")),align:ve[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ve[3]?ve[3].replace(/\n$/,"").split("\n"):[],raw:ve[0]};if(Be.header.length===Be.align.length){var Je,ut=Be.align.length;for(Je=0;Je ?/gm,"");return{type:"blockquote",raw:ve[0],text:Be}}},lt.list=function(ge){var ve=this.rules.block.list.exec(ge);if(ve){var Qt,zn,ci,Rn,bn,Xn,Cn,rr,sr,Be=ve[0],ut=ve[2],Je=ut.length>1,Mt={type:"list",raw:Be,ordered:Je,start:Je?+ut.slice(0,-1):"",loose:!1,items:[]},It=ve[0].match(this.rules.block.item),Ot=!1,Qn=It.length;ci=this.rules.block.listItemStart.exec(It[0]);for(var Wi=0;Wici[1].length:Rn[1].length>=ci[0].length||Rn[1].length>3){It.splice(Wi,2,It[Wi]+(!this.options.pedantic&&Rn[1].length/i.test(ut[0])&&(ve=!1),!Be&&/^<(pre|code|kbd|script)(\s|>)/i.test(ut[0])?Be=!0:Be&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(ut[0])&&(Be=!1),{type:this.options.sanitize?"text":"html",raw:ut[0],inLink:ve,inRawBlock:Be,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ut[0]):ye(ut[0]):ut[0]}},lt.link=function(ge){var ve=this.rules.inline.link.exec(ge);if(ve){var Be=ve[2].trim();if(!this.options.pedantic&&/^$/.test(Be))return;var ut=me(Be.slice(0,-1),"\\");if((Be.length-ut.length)%2==0)return}else{var Je=Oe(ve[2],"()");if(Je>-1){var It=(0===ve[0].indexOf("!")?5:4)+ve[1].length+Je;ve[2]=ve[2].substring(0,Je),ve[0]=ve[0].substring(0,It).trim(),ve[3]=""}}var Ot=ve[2],Qt="";if(this.options.pedantic){var zn=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Ot);zn&&(Ot=zn[1],Qt=zn[3])}else Qt=ve[3]?ve[3].slice(1,-1):"";return Ot=Ot.trim(),/^$/.test(Be)?Ot.slice(1):Ot.slice(1,-1)),$e(ve,{href:Ot&&Ot.replace(this.rules.inline._escapes,"$1"),title:Qt&&Qt.replace(this.rules.inline._escapes,"$1")},ve[0])}},lt.reflink=function(ge,ve){var Be;if((Be=this.rules.inline.reflink.exec(ge))||(Be=this.rules.inline.nolink.exec(ge))){var ut=(Be[2]||Be[1]).replace(/\s+/g," ");if(!(ut=ve[ut.toLowerCase()])||!ut.href){var Je=Be[0].charAt(0);return{type:"text",raw:Je,text:Je}}return $e(Be,ut,Be[0])}},lt.emStrong=function(ge,ve,Be){void 0===Be&&(Be="");var ut=this.rules.inline.emStrong.lDelim.exec(ge);if(ut&&(!ut[3]||!Be.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 Je=ut[1]||ut[2]||"";if(!Je||Je&&(""===Be||this.rules.inline.punctuation.exec(Be))){var It,Ot,Mt=ut[0].length-1,Qt=Mt,zn=0,ci="*"===ut[0][0]?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(ci.lastIndex=0,ve=ve.slice(-1*ge.length+Mt);null!=(ut=ci.exec(ve));)if(It=ut[1]||ut[2]||ut[3]||ut[4]||ut[5]||ut[6]){if(Ot=It.length,ut[3]||ut[4]){Qt+=Ot;continue}if((ut[5]||ut[6])&&Mt%3&&!((Mt+Ot)%3)){zn+=Ot;continue}if(!((Qt-=Ot)>0))return Ot=Math.min(Ot,Ot+Qt+zn),Math.min(Mt,Ot)%2?{type:"em",raw:ge.slice(0,Mt+ut.index+Ot+1),text:ge.slice(1,Mt+ut.index+Ot)}:{type:"strong",raw:ge.slice(0,Mt+ut.index+Ot+1),text:ge.slice(2,Mt+ut.index+Ot-1)}}}}},lt.codespan=function(ge){var ve=this.rules.inline.code.exec(ge);if(ve){var Be=ve[2].replace(/\n/g," "),ut=/[^ ]/.test(Be),Je=/^ /.test(Be)&&/ $/.test(Be);return ut&&Je&&(Be=Be.substring(1,Be.length-1)),Be=ye(Be,!0),{type:"codespan",raw:ve[0],text:Be}}},lt.br=function(ge){var ve=this.rules.inline.br.exec(ge);if(ve)return{type:"br",raw:ve[0]}},lt.del=function(ge){var ve=this.rules.inline.del.exec(ge);if(ve)return{type:"del",raw:ve[0],text:ve[2]}},lt.autolink=function(ge,ve){var ut,Je,Be=this.rules.inline.autolink.exec(ge);if(Be)return Je="@"===Be[2]?"mailto:"+(ut=ye(this.options.mangle?ve(Be[1]):Be[1])):ut=ye(Be[1]),{type:"link",raw:Be[0],text:ut,href:Je,tokens:[{type:"text",raw:ut,text:ut}]}},lt.url=function(ge,ve){var Be;if(Be=this.rules.inline.url.exec(ge)){var ut,Je;if("@"===Be[2])Je="mailto:"+(ut=ye(this.options.mangle?ve(Be[0]):Be[0]));else{var Mt;do{Mt=Be[0],Be[0]=this.rules.inline._backpedal.exec(Be[0])[0]}while(Mt!==Be[0]);ut=ye(Be[0]),Je="www."===Be[1]?"http://"+ut:ut}return{type:"link",raw:Be[0],text:ut,href:Je,tokens:[{type:"text",raw:ut,text:ut}]}}},lt.inlineText=function(ge,ve,Be){var Je,ut=this.rules.inline.text.exec(ge);if(ut)return Je=ve?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ut[0]):ye(ut[0]):ut[0]:ye(this.options.smartypants?Be(ut[0]):ut[0]),{type:"text",raw:ut[0],text:Je}},rt}(),tt=te_noopTest,Xe=te_edit,ze=te_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:tt,table:tt,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=Xe(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=Xe(Le.item,"gm").replace(/bull/g,Le.bullet).getRegex(),Le.listItemStart=Xe(/^( *)(bull) */).replace("bull",Le.bullet).getRegex(),Le.list=Xe(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=Xe(Le.html,"i").replace("comment",Le._comment).replace("tag",Le._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Le.paragraph=Xe(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=Xe(Le.blockquote).replace("paragraph",Le.paragraph).getRegex(),Le.normal=ze({},Le),Le.gfm=ze({},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=Xe(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=Xe(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=ze({},Le.normal,{html:Xe("^ *(?: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:tt,paragraph:Xe(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 Ke={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:tt,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:tt,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~"};Ke.punctuation=Xe(Ke.punctuation).replace(/punctuation/g,Ke._punctuation).getRegex(),Ke.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,Ke.escapedEmSt=/\\\*|\\_/g,Ke._comment=Xe(Le._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),Ke.emStrong.lDelim=Xe(Ke.emStrong.lDelim).replace(/punct/g,Ke._punctuation).getRegex(),Ke.emStrong.rDelimAst=Xe(Ke.emStrong.rDelimAst,"g").replace(/punct/g,Ke._punctuation).getRegex(),Ke.emStrong.rDelimUnd=Xe(Ke.emStrong.rDelimUnd,"g").replace(/punct/g,Ke._punctuation).getRegex(),Ke._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,Ke._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,Ke._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])?)+(?![-_])/,Ke.autolink=Xe(Ke.autolink).replace("scheme",Ke._scheme).replace("email",Ke._email).getRegex(),Ke._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,Ke.tag=Xe(Ke.tag).replace("comment",Ke._comment).replace("attribute",Ke._attribute).getRegex(),Ke._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Ke._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,Ke._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,Ke.link=Xe(Ke.link).replace("label",Ke._label).replace("href",Ke._href).replace("title",Ke._title).getRegex(),Ke.reflink=Xe(Ke.reflink).replace("label",Ke._label).getRegex(),Ke.reflinkSearch=Xe(Ke.reflinkSearch,"g").replace("reflink",Ke.reflink).replace("nolink",Ke.nolink).getRegex(),Ke.normal=ze({},Ke),Ke.pedantic=ze({},Ke.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:Xe(/^!?\[(label)\]\((.*?)\)/).replace("label",Ke._label).getRegex(),reflink:Xe(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Ke._label).getRegex()}),Ke.gfm=ze({},Ke.normal,{escape:Xe(Ke.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&&(ge="x"+ge.toString(16)),lt+="&#"+ge+";";return lt}var je=function(){function rt(ht){this.tokens=[],this.tokens.links=Object.create(null),this.options=ht||qe,this.options.tokenizer=this.options.tokenizer||new Ue,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var ge={block:ke.normal,inline:q.normal};this.options.pedantic?(ge.block=ke.pedantic,ge.inline=q.pedantic):this.options.gfm&&(ge.block=ke.gfm,ge.inline=this.options.breaks?q.breaks:q.gfm),this.tokenizer.rules=ge}rt.lex=function(ge,ve){return new rt(ve).lex(ge)},rt.lexInline=function(ge,ve){return new rt(ve).inlineTokens(ge)};var lt=rt.prototype;return lt.lex=function(ge){return ge=ge.replace(/\r\n|\r/g,"\n").replace(/\t/g," "),this.blockTokens(ge,this.tokens,!0),this.inline(this.tokens),this.tokens},lt.blockTokens=function(ge,ve,Be){var Je,Mt,It,Ot,Qt,zn,ut=this;for(void 0===ve&&(ve=[]),void 0===Be&&(Be=!0),this.options.pedantic&&(ge=ge.replace(/^ +$/gm,""));ge;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(function(Rn){return!!(Je=Rn.call(ut,ge,ve))&&(ge=ge.substring(Je.raw.length),ve.push(Je),!0)}))){if(Je=this.tokenizer.space(ge)){ge=ge.substring(Je.raw.length),Je.type&&ve.push(Je);continue}if(Je=this.tokenizer.code(ge)){ge=ge.substring(Je.raw.length),(Ot=ve[ve.length-1])&&"paragraph"===Ot.type?(Ot.raw+="\n"+Je.raw,Ot.text+="\n"+Je.text):ve.push(Je);continue}if(Je=this.tokenizer.fences(ge)){ge=ge.substring(Je.raw.length),ve.push(Je);continue}if(Je=this.tokenizer.heading(ge)){ge=ge.substring(Je.raw.length),ve.push(Je);continue}if(Je=this.tokenizer.nptable(ge)){ge=ge.substring(Je.raw.length),ve.push(Je);continue}if(Je=this.tokenizer.hr(ge)){ge=ge.substring(Je.raw.length),ve.push(Je);continue}if(Je=this.tokenizer.blockquote(ge)){ge=ge.substring(Je.raw.length),Je.tokens=this.blockTokens(Je.text,[],Be),ve.push(Je);continue}if(Je=this.tokenizer.list(ge)){for(ge=ge.substring(Je.raw.length),It=Je.items.length,Mt=0;Mt=0&&(Rn=Math.min(Rn,Xn))}),Rn<1/0&&Rn>=0&&(Qt=ge.substring(0,Rn+1))}(),Be&&(Je=this.tokenizer.paragraph(Qt))){Ot=ve[ve.length-1],zn&&"paragraph"===Ot.type?(Ot.raw+="\n"+Je.raw,Ot.text+="\n"+Je.text):ve.push(Je),zn=Qt.length!==ge.length,ge=ge.substring(Je.raw.length);continue}if(Je=this.tokenizer.text(ge)){ge=ge.substring(Je.raw.length),(Ot=ve[ve.length-1])&&"text"===Ot.type?(Ot.raw+="\n"+Je.raw,Ot.text+="\n"+Je.text):ve.push(Je);continue}if(ge){var ci="Infinite loop on byte: "+ge.charCodeAt(0);if(this.options.silent){console.error(ci);break}throw new Error(ci)}}return ve},lt.inline=function(ge){var ve,Be,ut,Je,Mt,It,Ot=ge.length;for(ve=0;ve0)for(;null!=(zn=this.tokenizer.rules.inline.reflinkSearch.exec(Qt));)bn.includes(zn[0].slice(zn[0].lastIndexOf("[")+1,-1))&&(Qt=Qt.slice(0,zn.index)+"["+G("a",zn[0].length-2)+"]"+Qt.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(zn=this.tokenizer.rules.inline.blockSkip.exec(Qt));)Qt=Qt.slice(0,zn.index)+"["+G("a",zn[0].length-2)+"]"+Qt.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(zn=this.tokenizer.rules.inline.escapedEmSt.exec(Qt));)Qt=Qt.slice(0,zn.index)+"++"+Qt.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;ge;)if(ci||(Rn=""),ci=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(function(Cn){return!!(Mt=Cn.call(Je,ge,ve))&&(ge=ge.substring(Mt.raw.length),ve.push(Mt),!0)}))){if(Mt=this.tokenizer.escape(ge)){ge=ge.substring(Mt.raw.length),ve.push(Mt);continue}if(Mt=this.tokenizer.tag(ge,Be,ut)){ge=ge.substring(Mt.raw.length),Be=Mt.inLink,ut=Mt.inRawBlock,(It=ve[ve.length-1])&&"text"===Mt.type&&"text"===It.type?(It.raw+=Mt.raw,It.text+=Mt.text):ve.push(Mt);continue}if(Mt=this.tokenizer.link(ge)){ge=ge.substring(Mt.raw.length),"link"===Mt.type&&(Mt.tokens=this.inlineTokens(Mt.text,[],!0,ut)),ve.push(Mt);continue}if(Mt=this.tokenizer.reflink(ge,this.tokens.links)){ge=ge.substring(Mt.raw.length),It=ve[ve.length-1],"link"===Mt.type?(Mt.tokens=this.inlineTokens(Mt.text,[],!0,ut),ve.push(Mt)):It&&"text"===Mt.type&&"text"===It.type?(It.raw+=Mt.raw,It.text+=Mt.text):ve.push(Mt);continue}if(Mt=this.tokenizer.emStrong(ge,Qt,Rn)){ge=ge.substring(Mt.raw.length),Mt.tokens=this.inlineTokens(Mt.text,[],Be,ut),ve.push(Mt);continue}if(Mt=this.tokenizer.codespan(ge)){ge=ge.substring(Mt.raw.length),ve.push(Mt);continue}if(Mt=this.tokenizer.br(ge)){ge=ge.substring(Mt.raw.length),ve.push(Mt);continue}if(Mt=this.tokenizer.del(ge)){ge=ge.substring(Mt.raw.length),Mt.tokens=this.inlineTokens(Mt.text,[],Be,ut),ve.push(Mt);continue}if(Mt=this.tokenizer.autolink(ge,de)){ge=ge.substring(Mt.raw.length),ve.push(Mt);continue}if(!Be&&(Mt=this.tokenizer.url(ge,de))){ge=ge.substring(Mt.raw.length),ve.push(Mt);continue}if(Ot=ge,this.options.extensions&&this.options.extensions.startInline&&function(){var Cn=1/0,rr=ge.slice(1),sr=void 0;Je.options.extensions.startInline.forEach(function(Qn){"number"==typeof(sr=Qn.call(this,rr))&&sr>=0&&(Cn=Math.min(Cn,sr))}),Cn<1/0&&Cn>=0&&(Ot=ge.substring(0,Cn+1))}(),Mt=this.tokenizer.inlineText(Ot,ut,pe)){ge=ge.substring(Mt.raw.length),"_"!==Mt.raw.slice(-1)&&(Rn=Mt.raw.slice(-1)),ci=!0,(It=ve[ve.length-1])&&"text"===It.type?(It.raw+=Mt.raw,It.text+=Mt.text):ve.push(Mt);continue}if(ge){var Xn="Infinite loop on byte: "+ge.charCodeAt(0);if(this.options.silent){console.error(Xn);break}throw new Error(Xn)}}return ve},function(rt,lt,ht){lt&&it(rt.prototype,lt),ht&&it(rt,ht)}(rt,null,[{key:"rules",get:function(){return{block:ke,inline:q}}}]),rt}(),_t=dt.exports.defaults,pt=te_cleanUrl,we=te_escape,B=function(){function rt(ht){this.options=ht||_t}var lt=rt.prototype;return lt.code=function(ge,ve,Be){var ut=(ve||"").match(/\S*/)[0];if(this.options.highlight){var Je=this.options.highlight(ge,ut);null!=Je&&Je!==ge&&(Be=!0,ge=Je)}return ge=ge.replace(/\n$/,"")+"\n",ut?'
    '+(Be?ge:we(ge,!0))+"
    \n":"
    "+(Be?ge:we(ge,!0))+"
    \n"},lt.blockquote=function(ge){return"
    \n"+ge+"
    \n"},lt.html=function(ge){return ge},lt.heading=function(ge,ve,Be,ut){return this.options.headerIds?"'+ge+"\n":""+ge+"\n"},lt.hr=function(){return this.options.xhtml?"
    \n":"
    \n"},lt.list=function(ge,ve,Be){var ut=ve?"ol":"ul";return"<"+ut+(ve&&1!==Be?' start="'+Be+'"':"")+">\n"+ge+"\n"},lt.listitem=function(ge){return"
  • "+ge+"
  • \n"},lt.checkbox=function(ge){return" "},lt.paragraph=function(ge){return"

    "+ge+"

    \n"},lt.table=function(ge,ve){return ve&&(ve=""+ve+""),"\n\n"+ge+"\n"+ve+"
    \n"},lt.tablerow=function(ge){return"\n"+ge+"\n"},lt.tablecell=function(ge,ve){var Be=ve.header?"th":"td";return(ve.align?"<"+Be+' align="'+ve.align+'">':"<"+Be+">")+ge+"\n"},lt.strong=function(ge){return""+ge+""},lt.em=function(ge){return""+ge+""},lt.codespan=function(ge){return""+ge+""},lt.br=function(){return this.options.xhtml?"
    ":"
    "},lt.del=function(ge){return""+ge+""},lt.link=function(ge,ve,Be){if(null===(ge=pt(this.options.sanitize,this.options.baseUrl,ge)))return Be;var ut='"+Be+""},lt.image=function(ge,ve,Be){if(null===(ge=pt(this.options.sanitize,this.options.baseUrl,ge)))return Be;var ut=''+Be+'":">")},lt.text=function(ge){return ge},rt}(),N=function(){function rt(){}var lt=rt.prototype;return lt.strong=function(ge){return ge},lt.em=function(ge){return ge},lt.codespan=function(ge){return ge},lt.del=function(ge){return ge},lt.html=function(ge){return ge},lt.text=function(ge){return ge},lt.link=function(ge,ve,Be){return""+Be},lt.image=function(ge,ve,Be){return""+Be},lt.br=function(){return""},rt}(),V=function(){function rt(){this.seen={}}var lt=rt.prototype;return lt.serialize=function(ge){return ge.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")},lt.getNextSafeSlug=function(ge,ve){var Be=ge,ut=0;if(this.seen.hasOwnProperty(Be)){ut=this.seen[ge];do{Be=ge+"-"+ ++ut}while(this.seen.hasOwnProperty(Be))}return ve||(this.seen[ge]=ut,this.seen[Be]=0),Be},lt.slug=function(ge,ve){void 0===ve&&(ve={});var Be=this.serialize(ge);return this.getNextSafeSlug(Be,ve.dryrun)},rt}(),Re=B,Ze=N,Tt=V,kt=dt.exports.defaults,In=te_unescape,Yn=je,Mi=function(){function rt(ht){this.options=ht||kt,this.options.renderer=this.options.renderer||new Re,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Ze,this.slugger=new Tt}rt.parse=function(ge,ve){return new rt(ve).parse(ge)},rt.parseInline=function(ge,ve){return new rt(ve).parseInline(ge)};var lt=rt.prototype;return lt.parse=function(ge,ve){void 0===ve&&(ve=!0);var ut,Je,Mt,It,Ot,Qt,zn,ci,Rn,bn,Xn,Cn,rr,sr,Qn,Wi,Ca,Qr,re,Be="",fe=ge.length;for(ut=0;ut0&&"text"===Qn.tokens[0].type?(Qn.tokens[0].text=Qr+" "+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=Qr+" "+Qn.tokens[0].tokens[0].text)):Qn.tokens.unshift({type:"text",text:Qr}):sr+=Qr),sr+=this.parse(Qn.tokens,rr),Rn+=this.renderer.listitem(sr,Ca,Wi);Be+=this.renderer.list(Rn,Xn,Cn);continue;case"html":Be+=this.renderer.html(bn.text);continue;case"paragraph":Be+=this.renderer.paragraph(this.parseInline(bn.tokens));continue;case"text":for(Rn=bn.tokens?this.parseInline(bn.tokens):bn.text;ut+1An error occurred:

    "+xa(Mt.message+"",!0)+"
    ";throw Mt}}return en.options=en.setOptions=function(rt){return Bs(en.defaults,rt),Sa(en.defaults),en},en.getDefaults=kl,en.defaults=ws,en.use=function(){for(var rt=this,lt=arguments.length,ht=new Array(lt),ge=0;geAn error occurred:

    "+xa(ge.message+"",!0)+"
    ";throw ge}},en.Parser=Mi,en.parser=Mi.parse,en.Renderer=Xr,en.TextRenderer=Ls,en.Lexer=Yn,en.lexer=Yn.lex,en.Tokenizer=xi,en.Slugger=fs,en.parse=en,en}()},9369:(Ut,it,et)=>{var yt=et(6284),ee=et(7830);function Dt(){this.clear()}Dt.prototype.clear=function(){this.items=[],this.offset=0,this.size=0},Dt.prototype.enqueue=function(dt){return this.items.push(dt),++this.size},Dt.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}},Dt.prototype.peek=function(){if(this.size)return this.items[this.offset]},Dt.prototype.forEach=function(dt,Y){Y=arguments.length>1?Y:this;for(var Se=this.offset,he=0,W=this.items.length;Se=dt.length)return{done:!0};var Se=dt[Y];return Y++,{value:Se,done:!1}})},Dt.prototype.entries=function(){var dt=this.items,Y=this.offset,Se=0;return new yt(function(){if(Y>=dt.length)return{done:!0};var he=dt[Y];return Y++,{value:[Se++,he],done:!1}})},"undefined"!=typeof Symbol&&(Dt.prototype[Symbol.iterator]=Dt.prototype.values),Dt.prototype.toString=function(){return this.toArray().join(",")},Dt.prototype.toJSON=function(){return this.toArray()},Dt.prototype.inspect=function(){var dt=this.toArray();return Object.defineProperty(dt,"constructor",{value:Dt,enumerable:!1}),dt},"undefined"!=typeof Symbol&&(Dt.prototype[Symbol.for("nodejs.util.inspect.custom")]=Dt.prototype.inspect),Dt.from=function(dt){var Y=new Dt;return ee(dt,function(Se){Y.enqueue(Se)}),Y},Dt.of=function(){return Dt.from(arguments)},Ut.exports=Dt},7830:Ut=>{var it="undefined"!=typeof ArrayBuffer,et="undefined"!=typeof Symbol;function yt(ee,Dt){var dt,Y,Se,he,W;if(!ee)throw new Error("obliterator/forEach: invalid iterable.");if("function"!=typeof Dt)throw new Error("obliterator/forEach: expecting a callback.");if(Array.isArray(ee)||it&&ArrayBuffer.isView(ee)||"string"==typeof ee||"[object Arguments]"===ee.toString())for(Se=0,he=ee.length;Se{function it(et){Object.defineProperty(this,"_next",{writable:!1,enumerable:!1,value:et}),this.done=!1}it.prototype.next=function(){if(this.done)return{done:!0};var et=this._next();return et.done&&(this.done=!0),et},"undefined"!=typeof Symbol&&(it.prototype[Symbol.iterator]=function(){return this}),it.of=function(){var et=arguments,yt=et.length,ee=0;return new it(function(){return ee>=yt?{done:!0}:{done:!1,value:et[ee++]}})},it.empty=function(){var et=new it(null);return et.done=!0,et},it.is=function(et){return et instanceof it||"object"==typeof et&&null!==et&&"function"==typeof et.next},Ut.exports=it},7310:(Ut,it,et)=>{"use strict";var yt=et(1948);Object.defineProperty(it,"__esModule",{value:!0}),it.isMobile=function(){return void 0!==ee.window.orientation},it.default=function(he){if(!he&&!(0,Dt.default)())return"Node";if((0,dt.default)(he))return"Electron";var W="undefined"!=typeof navigator?navigator:{},j=he||W.userAgent||"";if(j.indexOf("Edge")>-1)return"Edge";var k=-1!==j.indexOf("MSIE "),Q=-1!==j.indexOf("Trident/");return k||Q?"IE":ee.window.chrome?"Chrome":ee.window.safari?"Safari":ee.window.mozInnerScreenX?"Firefox":"Unknown"};var ee=et(1151),Dt=yt(et(1602)),dt=yt(et(2344))},1151:(Ut,it,et)=>{"use strict";var yt=et(1948);Object.defineProperty(it,"__esModule",{value:!0}),it.console=it.process=it.document=it.global=it.window=it.self=void 0;var ee=yt(et(4321)),Dt={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,ee.default)(process))&&process};it.self=Dt.self||Dt.window||Dt.global,it.window=Dt.window||Dt.self||Dt.global,it.global=Dt.global||Dt.self||Dt.window,it.document=Dt.document||{},it.process=Dt.process||{};var j=console;it.console=j},4761:(Ut,it,et)=>{"use strict";var ee=et(1948),Dt=et(4321);Object.defineProperty(it,"CO",{enumerable:!0,get:function(){return dt.global}}),Object.defineProperty(it,"qs",{enumerable:!0,get:function(){return Se.default}});var dt=et(1151),Se=(j(et(1602)),j(et(7310)));ee(et(2344));function W(k){if("function"!=typeof WeakMap)return null;var Q=new WeakMap,H=new WeakMap;return(W=function(C){return C?H:Q})(k)}function j(k,Q){if(!Q&&k&&k.__esModule)return k;if(null===k||"object"!==Dt(k)&&"function"!=typeof k)return{default:k};var H=W(Q);if(H&&H.has(k))return H.get(k);var w={},C=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var R in k)if("default"!==R&&Object.prototype.hasOwnProperty.call(k,R)){var T=C?Object.getOwnPropertyDescriptor(k,R):null;T&&(T.get||T.set)?Object.defineProperty(w,R,T):w[R]=k[R]}return w.default=k,H&&H.set(k,w),w}},1602:(Ut,it,et)=>{"use strict";var yt=et(1948);Object.defineProperty(it,"__esModule",{value:!0}),it.default=dt,it.isBrowserMainThread=function(){return dt()&&"undefined"!=typeof document};var ee=yt(et(4321)),Dt=yt(et(2344));function dt(){return!("object"===("undefined"==typeof process?"undefined":(0,ee.default)(process))&&"[object process]"===String(process)&&!process.browser)||(0,Dt.default)()}},2344:(Ut,it,et)=>{"use strict";var yt=et(1948);Object.defineProperty(it,"__esModule",{value:!0}),it.default=function(dt){if("undefined"!=typeof window&&"object"===(0,ee.default)(window.process)&&"renderer"===window.process.type||"undefined"!=typeof process&&"object"===(0,ee.default)(process.versions)&&Boolean(process.versions.electron))return!0;var Y="object"===("undefined"==typeof navigator?"undefined":(0,ee.default)(navigator))&&"string"==typeof navigator.userAgent&&navigator.userAgent,Se=dt||Y;return!!(Se&&Se.indexOf("Electron")>=0)};var ee=yt(et(4321))},6991:function(Ut,it,et){"use strict";var yt=this&&this.__createBinding||(Object.create?function(Dt,dt,Y,Se){void 0===Se&&(Se=Y),Object.defineProperty(Dt,Se,{enumerable:!0,get:function(){return dt[Y]}})}:function(Dt,dt,Y,Se){void 0===Se&&(Se=Y),Dt[Se]=dt[Y]}),ee=this&&this.__exportStar||function(Dt,dt){for(var Y in Dt)"default"!==Y&&!Object.prototype.hasOwnProperty.call(dt,Y)&&yt(dt,Dt,Y)};Object.defineProperty(it,"__esModule",{value:!0}),ee(et(4180),it),ee(et(5103),it),ee(et(8965),it),ee(et(2595),it),ee(et(2417),it),ee(et(2451),it),ee(et(7735),it)},4180:(Ut,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.BlankNode=void 0,it.BlankNode=class{constructor(ee){this.termType="BlankNode",this.value=ee}equals(ee){return!!ee&&"BlankNode"===ee.termType&&ee.value===this.value}}},5103:(Ut,it,et)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.DataFactory=void 0;const yt=et(4180),ee=et(8965),Dt=et(2595),dt=et(2417),Y=et(2451),Se=et(7735);let he=0;it.DataFactory=class{constructor(k){this.blankNodeCounter=0,this.blankNodePrefix=(k=k||{}).blankNodePrefix||`df_${he++}_`}namedNode(k){return new dt.NamedNode(k)}blankNode(k){return new yt.BlankNode(k||`${this.blankNodePrefix}${this.blankNodeCounter++}`)}literal(k,Q){return new Dt.Literal(k,Q)}variable(k){return new Se.Variable(k)}defaultGraph(){return ee.DefaultGraph.INSTANCE}quad(k,Q,H,w){return new Y.Quad(k,Q,H,w||this.defaultGraph())}fromTerm(k){switch(k.termType){case"NamedNode":return this.namedNode(k.value);case"BlankNode":return this.blankNode(k.value);case"Literal":return k.language?this.literal(k.value,k.language):k.datatype.equals(Dt.Literal.XSD_STRING)?this.literal(k.value):this.literal(k.value,this.fromTerm(k.datatype));case"Variable":return this.variable(k.value);case"DefaultGraph":return this.defaultGraph();case"Quad":return this.quad(this.fromTerm(k.subject),this.fromTerm(k.predicate),this.fromTerm(k.object),this.fromTerm(k.graph))}}fromQuad(k){return this.fromTerm(k)}resetBlankNodeCounter(){this.blankNodeCounter=0}}},8965:(Ut,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.DefaultGraph=void 0;class et{constructor(){this.termType="DefaultGraph",this.value=""}equals(ee){return!!ee&&"DefaultGraph"===ee.termType}}it.DefaultGraph=et,et.INSTANCE=new et},2595:(Ut,it,et)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.Literal=void 0;const yt=et(2417);class ee{constructor(dt,Y){this.termType="Literal",this.value=dt,"string"==typeof Y?(this.language=Y,this.datatype=ee.RDF_LANGUAGE_STRING):Y?(this.language="",this.datatype=Y):(this.language="",this.datatype=ee.XSD_STRING)}equals(dt){return!!dt&&"Literal"===dt.termType&&dt.value===this.value&&dt.language===this.language&&dt.datatype.equals(this.datatype)}}it.Literal=ee,ee.RDF_LANGUAGE_STRING=new yt.NamedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),ee.XSD_STRING=new yt.NamedNode("http://www.w3.org/2001/XMLSchema#string")},2417:(Ut,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.NamedNode=void 0,it.NamedNode=class{constructor(ee){this.termType="NamedNode",this.value=ee}equals(ee){return!!ee&&"NamedNode"===ee.termType&&ee.value===this.value}}},2451:(Ut,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.Quad=void 0,it.Quad=class{constructor(ee,Dt,dt,Y){this.termType="Quad",this.value="",this.subject=ee,this.predicate=Dt,this.object=dt,this.graph=Y}equals(ee){return!!ee&&("Quad"===ee.termType||!ee.termType)&&this.subject.equals(ee.subject)&&this.predicate.equals(ee.predicate)&&this.object.equals(ee.object)&&this.graph.equals(ee.graph)}}},7735:(Ut,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.Variable=void 0,it.Variable=class{constructor(ee){this.termType="Variable",this.value=ee}equals(ee){return!!ee&&"Variable"===ee.termType&&ee.value===this.value}}},1609:function(Ut,it,et){"use strict";var yt=this&&this.__createBinding||(Object.create?function(w,C,R,T){void 0===T&&(T=R),Object.defineProperty(w,T,{enumerable:!0,get:function(){return C[R]}})}:function(w,C,R,T){void 0===T&&(T=R),w[T]=C[R]}),ee=this&&this.__exportStar||function(w,C){for(var R in w)"default"!==R&&!Object.prototype.hasOwnProperty.call(C,R)&&yt(C,w,R)};Object.defineProperty(it,"__esModule",{value:!0}),it.getSupportedJavaScriptPrimitives=it.getSupportedRdfDatatypes=it.getTermRaw=it.toRdf=it.fromRdf=void 0;const Dt=et(6991),dt=et(9938),Y=et(6060);ee(et(9938),it),ee(et(8871),it),ee(et(6060),it);const Se=new Dt.DataFactory,he=new Y.Translator;function W(w,C){return he.fromRdf(w,C)}he.registerHandler(new dt.TypeHandlerString,dt.TypeHandlerString.TYPES.map(w=>Se.namedNode(w)),["string"]),he.registerHandler(new dt.TypeHandlerBoolean,[dt.TypeHandlerBoolean.TYPE].map(w=>Se.namedNode(w)),["boolean"]),he.registerHandler(new dt.TypeHandlerNumberDouble,dt.TypeHandlerNumberDouble.TYPES.map(w=>Se.namedNode(w)),["number"]),he.registerHandler(new dt.TypeHandlerNumberInteger,dt.TypeHandlerNumberInteger.TYPES.map(w=>Se.namedNode(w)),["number"]),he.registerHandler(new dt.TypeHandlerDate,dt.TypeHandlerDate.TYPES.map(w=>Se.namedNode(w)),["object"]),it.fromRdf=W,it.toRdf=function(w,C){return C&&"namedNode"in C&&(C={dataFactory:C}),(C=C||{})&&!C.dataFactory&&(C.dataFactory=Se),he.toRdf(w,C)},it.getTermRaw=function(w,C){return"Literal"===w.termType?W(w,C):w.value},it.getSupportedRdfDatatypes=function(){return he.getSupportedRdfDatatypes()},it.getSupportedJavaScriptPrimitives=function(){return he.getSupportedJavaScriptPrimitives()}},8871:(Ut,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0})},6060:(Ut,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(ee){throw new Error(`Invalid RDF ${ee.datatype.value} value: '${ee.value}'`)}registerHandler(ee,Dt,dt){for(const Y of Dt)this.supportedRdfDatatypes.push(Y),this.fromRdfHandlers[Y.value]=ee;for(const Y of dt){let Se=this.toRdfHandlers[Y];Se||(this.toRdfHandlers[Y]=Se=[]),Se.push(ee)}}fromRdf(ee,Dt){const dt=this.fromRdfHandlers[ee.datatype.value];return dt?dt.fromRdf(ee,Dt):ee.value}toRdf(ee,Dt){const dt=this.toRdfHandlers[typeof ee];if(dt)for(const Y of dt){const Se=Y.toRdf(ee,Dt);if(Se)return Se}throw new Error(`Invalid JavaScript value: '${ee}'`)}getSupportedRdfDatatypes(){return this.supportedRdfDatatypes}getSupportedJavaScriptPrimitives(){return Object.keys(this.toRdfHandlers)}}},727:(Ut,it,et)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.TypeHandlerBoolean=void 0;const yt=et(6060);class ee{fromRdf(dt,Y){switch(dt.value){case"true":return!0;case"false":return!1;case"1":return!0;case"0":return!1}return Y&&yt.Translator.incorrectRdfDataType(dt),!1}toRdf(dt,{datatype:Y,dataFactory:Se}){return Se.literal(dt?"true":"false",Y||Se.namedNode(ee.TYPE))}}it.TypeHandlerBoolean=ee,ee.TYPE="http://www.w3.org/2001/XMLSchema#boolean"},2525:(Ut,it,et)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.TypeHandlerDate=void 0;const yt=et(6060);class ee{fromRdf(dt,Y){switch(Y&&!dt.value.match(ee.VALIDATORS[dt.datatype.value.substr(33,dt.datatype.value.length)])&&yt.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 Se=dt.value.split("-");return new Date(0,parseInt(Se[0],10)-1,parseInt(Se[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:Y,dataFactory:Se}){if(Y=Y||Se.namedNode(ee.TYPES[0]),!(dt instanceof Date))return null;const he=dt;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 Se.literal(W,Y)}}it.TypeHandlerDate=ee,ee.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"],ee.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]$/}},8554:(Ut,it,et)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.TypeHandlerNumberDouble=void 0;const yt=et(6060);class ee{fromRdf(dt,Y){const Se=parseFloat(dt.value);return Y&&isNaN(Se)&&yt.Translator.incorrectRdfDataType(dt),Se}toRdf(dt,{datatype:Y,dataFactory:Se}){return Y=Y||Se.namedNode(ee.TYPES[0]),isNaN(dt)?Se.literal("NaN",Y):isFinite(dt)?dt%1==0?null:Se.literal(dt.toExponential(15).replace(/(\d)0*e\+?/,"$1E"),Y):Se.literal(dt>0?"INF":"-INF",Y)}}it.TypeHandlerNumberDouble=ee,ee.TYPES=["http://www.w3.org/2001/XMLSchema#double","http://www.w3.org/2001/XMLSchema#decimal","http://www.w3.org/2001/XMLSchema#float"]},7750:(Ut,it,et)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.TypeHandlerNumberInteger=void 0;const yt=et(6060);class ee{fromRdf(dt,Y){const Se=parseInt(dt.value,10);return Y&&(isNaN(Se)||dt.value.indexOf(".")>=0)&&yt.Translator.incorrectRdfDataType(dt),Se}toRdf(dt,{datatype:Y,dataFactory:Se}){return Se.literal(String(dt),Y||Se.namedNode(dt<=ee.MAX_INT&&dt>=ee.MIN_INT?ee.TYPES[0]:ee.TYPES[1]))}}it.TypeHandlerNumberInteger=ee,ee.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"],ee.MAX_INT=2147483647,ee.MIN_INT=-2147483648},4608:(Ut,it)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.TypeHandlerString=void 0;class et{fromRdf(ee){return ee.value}toRdf(ee,{datatype:Dt,dataFactory:dt}){return dt.literal(ee,Dt)}}it.TypeHandlerString=et,et.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(Ut,it,et){"use strict";var yt=this&&this.__createBinding||(Object.create?function(Dt,dt,Y,Se){void 0===Se&&(Se=Y),Object.defineProperty(Dt,Se,{enumerable:!0,get:function(){return dt[Y]}})}:function(Dt,dt,Y,Se){void 0===Se&&(Se=Y),Dt[Se]=dt[Y]}),ee=this&&this.__exportStar||function(Dt,dt){for(var Y in Dt)"default"!==Y&&!Object.prototype.hasOwnProperty.call(dt,Y)&&yt(dt,Dt,Y)};Object.defineProperty(it,"__esModule",{value:!0}),ee(et(727),it),ee(et(2525),it),ee(et(8554),it),ee(et(7750),it),ee(et(4608),it)},2829:(Ut,it,et)=>{"use strict";var yt={};et.r(yt),et.d(yt,{decode:()=>Ume,encode:()=>zme});var ee={};et.r(ee),et.d(ee,{decode:()=>qme,encode:()=>Yme});var Dt={};et.r(Dt),et.d(Dt,{decode:()=>Xme,encode:()=>Kme});var dt={};function Y(n){return"function"==typeof n}et.r(dt),et.d(dt,{decode:()=>Qme,encode:()=>Zme});let Se=!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 Se&&console.log("RxJS: Back to a better error behavior. Thank you. <3");Se=n},get useDeprecatedSynchronousErrorHandling(){return Se}};function W(n){setTimeout(()=>{throw n},0)}const j={closed:!0,next(n){},error(n){if(he.useDeprecatedSynchronousErrorHandling)throw n;W(n)},complete(){}},k=Array.isArray||(n=>n&&"number"==typeof n.length);function Q(n){return null!==n&&"object"==typeof n}const w=(()=>{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 C{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 C)t.remove(this);else if(null!==t)for(let o=0;oe.concat(t instanceof w?t.errors:t),[])}C.EMPTY=((n=new C).closed=!0,n);const T="function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random();class y extends C{constructor(e,t,i){switch(super(),this.syncErrorValue=null,this.syncErrorThrown=!1,this.syncErrorThrowable=!1,this.isStopped=!1,arguments.length){case 0:this.destination=j;break;case 1:if(!e){this.destination=j;break}if("object"==typeof e){e instanceof y?(this.syncErrorThrowable=e.syncErrorThrowable,this.destination=e,e.add(this)):(this.syncErrorThrowable=!0,this.destination=new S(this,e));break}default:this.syncErrorThrowable=!0,this.destination=new S(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 S 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!==j&&(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 P="function"==typeof Symbol&&Symbol.observable||"@@observable";function X(n){return n}function ue(...n){return I(n)}function I(n){return 0===n.length?X:1===n.length?n[0]:function(t){return n.reduce((i,r)=>r(i),t)}}let O=(()=>{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(j)}(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=K(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)}[P](){return this}pipe(...t){return 0===t.length?this:I(t)(this)}toPromise(t){return new(t=K(t))((i,r)=>{let s;this.subscribe(o=>s=o,o=>r(o),()=>i(s))})}}return n.create=e=>new n(e),n})();function K(n){if(n||(n=he.Promise||Promise),!n)throw new Error("no Promise impl found");return n}const $=(()=>{function n(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return n.prototype=Object.create(Error.prototype),n})();class Z extends C{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 ae extends y{constructor(e){super(e),this.destination=e}}let oe=(()=>{class n extends O{constructor(){super(),this.observers=[],this.closed=!1,this.isStopped=!1,this.hasError=!1,this.thrownError=null}[T](){return new ae(this)}lift(t){const i=new te(this,this);return i.operator=t,i}next(t){if(this.closed)throw new $;if(!this.isStopped){const{observers:i}=this,r=i.length,s=i.slice();for(let o=0;onew te(e,t),n})();class te extends oe{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):C.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 ne(n,e))}}class ne{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 Oe=n=>e=>{for(let t=0,i=n.length;tn&&"number"==typeof n.length&&"function"!=typeof n;function Ke(n){return!!n&&"function"!=typeof n.subscribe&&"function"==typeof n.then}const Me=n=>{if(n&&"function"==typeof n[P])return(n=>e=>{const t=n[P]();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 Oe(n);if(Ke(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[Qe])return(n=>e=>{const t=n[Qe]();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 ${Q(n)?"an invalid object":`'${n}'`} where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.`;throw new TypeError(t)}};function ke(n,e){return new O(t=>{const i=new C;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 je(n,e){return e?function(n,e){if(null!=n){if(function(n){return n&&"function"==typeof n[P]}(n))return function(n,e){return new O(t=>{const i=new C;return i.add(e.schedule(()=>{const r=n[P]();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(Ke(n))return function(n,e){return new O(t=>{const i=new C;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 ke(n,e);if(function(n){return n&&"function"==typeof n[Qe]}(n)||"string"==typeof n)return function(n,e){if(!n)throw new Error("Iterable cannot be null");return new O(t=>{const i=new C;let r;return i.add(()=>{r&&"function"==typeof r.return&&r.return()}),i.add(e.schedule(()=>{r=n[Qe](),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 O?n:new O(Me(n))}class _t 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 we extends y{notifyNext(e){this.destination.next(e)}notifyError(e){this.destination.error(e)}notifyComplete(){this.destination.complete()}}function N(n,e){if(e.closed)return;if(n instanceof O)return n.subscribe(e);let t;try{t=Me(n)(e)}catch(i){e.error(i)}return t}function V(n,e,t=Number.POSITIVE_INFINITY){return"function"==typeof e?i=>i.pipe(V((r,s)=>je(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 Ze(e,this.project,this.concurrent))}}class Ze extends we{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 kt(n=Number.POSITIVE_INFINITY){return V(X,n)}function In(n,e){return e?ke(n,e):new O(Oe(n))}function Nn(...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 O?n[0]:kt(e)(In(n,t))}function Yn(){return function(e){return e.lift(new Mi(e))}}class Mi{constructor(e){this.connectable=e}call(e,t){const{connectable:i}=this;i._refCount++;const r=new xi(e,i),s=t.subscribe(r);return r.closed||(r.connection=i.connect()),s}}class xi 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 Xr extends O{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 C,e.add(this.source.subscribe(new fs(this.getSubject(),this))),e.closed&&(this._connection=null,e=C.EMPTY)),e}refCount(){return Yn()(this)}}const Ls=(()=>{const n=Xr.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 fs extends ae{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()}}}function xa(n,e){return function(i){let r;if(r="function"==typeof n?n:function(){return n},"function"==typeof e)return i.lift(new kl(r,e));const s=Object.create(i,Ls);return s.source=i,s.subjectFactory=r,s}}class kl{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 Sa(){return new oe}function ws(){return n=>Yn()(xa(Sa)(n))}function en(n){for(let e in n)if(n[e]===en)return e;throw Error("Could not find renamed property on target object.")}function nl(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 lt(n,e){return null==n||""===n?null===e?"":e:null==e||""===e?n:n+" "+e}const ht=en({__forward_ref__:en});function ge(n){return n.__forward_ref__=ge,n.toString=function(){return rt(this())},n}function ve(n){return Be(n)?n():n}function Be(n){return"function"==typeof n&&n.hasOwnProperty(ht)&&n.__forward_ref__===ge}class Je extends Error{constructor(e,t){super(function(n,e){return`${n?`NG0${n}: `:""}${e}`}(e,t)),this.code=e}}function Ot(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():Ot(n)}function bn(n,e){const t=e?` in ${e}`:"";throw new Je("201",`No provider for ${Qt(n)} found${t}`)}function J(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 St(n){return{providers:n.providers||[],imports:n.imports||[]}}function vn(n){return Es(n,fo)||Es(n,Vs)}function Es(n,e){return n.hasOwnProperty(e)?n[e]:null}function Fl(n){return n&&(n.hasOwnProperty(Br)||n.hasOwnProperty(Ac))?n[Br]:null}const fo=en({\u0275prov:en}),Br=en({\u0275inj:en}),Vs=en({ngInjectableDef:en}),Ac=en({ngInjectorDef:en});var xn=(()=>((xn=xn||{})[xn.Default=0]="Default",xn[xn.Host=1]="Host",xn[xn.Self=2]="Self",xn[xn.SkipSelf=4]="SkipSelf",xn[xn.Optional=8]="Optional",xn))();let po;function Ta(n){const e=po;return po=n,e}function Ed(n,e,t){const i=vn(n);return i&&"root"==i.providedIn?void 0===i.value?i.value=i.factory():i.value:t&xn.Optional?null:void 0!==e?e:void bn(rt(n),"Injector")}function De(n){return{toString:n}.toString()}var Ge=(()=>((Ge=Ge||{})[Ge.OnPush=0]="OnPush",Ge[Ge.Default=1]="Default",Ge))(),Xt=(()=>((Xt=Xt||{})[Xt.Emulated=0]="Emulated",Xt[Xt.None=2]="None",Xt[Xt.ShadowDom=3]="ShadowDom",Xt))();const ui="undefined"!=typeof globalThis&&globalThis,Vr="undefined"!=typeof window&&window,Jr="undefined"!=typeof self&&"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&self,xs="undefined"!=typeof global&&global,Zn=ui||xs||Vr||Jr,xd={},er=[],fp=en({\u0275cmp:en}),n_=en({\u0275dir:en}),Oh=en({\u0275pipe:en}),iv=en({\u0275mod:en}),T1=en({\u0275loc:en}),Bl=en({\u0275fac:en}),Rh=en({__NG_ELEMENT_ID__:en});let A1=0;function rn(n){return De(()=>{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===Ge.OnPush,directiveDefs:null,pipeDefs:null,selectors:n.selectors||er,viewQuery:n.viewQuery||null,features:n.features||null,data:n.data||{},encapsulation:n.encapsulation||Xt.Emulated,id:"c",styles:n.styles||er,_:null,setInput:null,schemas:n.schemas||null,tView:null},r=n.directives,s=n.features,o=n.pipes;return i.id+=A1++,i.inputs=av(n.inputs,t),i.outputs=av(n.outputs),s&&s.forEach(a=>a(i)),i.directiveDefs=r?()=>("function"==typeof r?r():r).map(rv):null,i.pipeDefs=o?()=>("function"==typeof o?o():o).map(sv):null,i})}function rv(n){return Ui(n)||function(n){return n[n_]||null}(n)}function sv(n){return function(n){return n[Oh]||null}(n)}const ov={};function tn(n){return De(()=>{const e={type:n.type,bootstrap:n.bootstrap||er,declarations:n.declarations||er,imports:n.imports||er,exports:n.exports||er,transitiveCompileScopes:null,schemas:n.schemas||null,id:n.id||null};return null!=n.id&&(ov[n.id]=n.type),e})}function av(n,e){if(null==n)return xd;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 Nt=rn;function js(n){return{type:n.type,name:n.name,factory:null,pure:!1!==n.pure,onDestroy:n.type.prototype.ngOnDestroy||null}}function Ui(n){return n[fp]||null}function No(n,e){const t=n[iv]||null;if(!t&&!0===e)throw new Error(`Type ${rt(n)} does not have '\u0275mod' property.`);return t}function Jo(n){return Array.isArray(n)&&"object"==typeof n[1]}function ea(n){return Array.isArray(n)&&!0===n[1]}function s_(n){return 0!=(8&n.flags)}function Ad(n){return 2==(2&n.flags)}function Md(n){return 1==(1&n.flags)}function Da(n){return null!==n.template}function lv(n){return 0!=(512&n[2])}function Ic(n,e){return n.hasOwnProperty(Bl)?n[Bl]:null}class c_{constructor(e,t,i){this.previousValue=e,this.currentValue=t,this.firstChange=i}isFirstChange(){return this.firstChange}}function Fi(){return dv}function dv(n){return n.type.prototype.ngOnChanges&&(n.setInput=k1),N1}function N1(){const n=at(this),e=null==n?void 0:n.current;if(e){const t=n.previous;if(t===xd)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=at(n)||function(n,e){return n[Bh]=e}(n,{previous:xd,current:null}),s=r.current||(r.current={}),o=r.previous,a=this.declaredInputs[t],l=o[a];s[a]=new c_(l&&l.currentValue,e,o===xd),n[i]=e}Fi.ngInherit=!0;const Bh="__ngSimpleChanges__";function at(n){return n[Bh]||null}let Yi;function dr(n){return!!n.listen}const Su={createRenderer:(n,e)=>void 0!==Yi?Yi:"undefined"!=typeof document?document:void 0};function Sr(n){for(;Array.isArray(n);)n=n[0];return n}function Vh(n,e){return Sr(e[n])}function eo(n,e){return Sr(e[n.index])}function h_(n,e){return n.data[e]}function Dd(n,e){return n[e]}function zs(n,e){const t=e[n];return Jo(t)?t:t[0]}function Ul(n){return 4==(4&n[2])}function Id(n){return 128==(128&n[2])}function Oa(n,e){return null==e?null:n[e]}function f_(n){n[18]=0}function mp(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:Tu(null),bindingsEnabled:!0,isInCheckNoChangesMode:!1};function fv(){return Ln.bindingsEnabled}function Vt(){return Ln.lFrame.lView}function Si(){return Ln.lFrame.tView}function _r(n){return Ln.lFrame.contextLView=n,n[8]}function as(){let n=p_();for(;null!==n&&64===n.type;)n=n.parent;return n}function p_(){return Ln.lFrame.currentTNode}function sl(n,e){const t=Ln.lFrame;t.currentTNode=n,t.isParent=e}function zr(){return Ln.lFrame.isParent}function ps(){Ln.lFrame.isParent=!1}function zh(){return Ln.isInCheckNoChangesMode}function yp(n){Ln.isInCheckNoChangesMode=n}function Cs(){const n=Ln.lFrame;let e=n.bindingRootIndex;return-1===e&&(e=n.bindingRootIndex=n.tView.bindingStartIndex),e}function Ra(){return Ln.lFrame.bindingIndex++}function Fo(n){const e=Ln.lFrame,t=e.bindingIndex;return e.bindingIndex=e.bindingIndex+n,t}function Od(n,e){const t=Ln.lFrame;t.bindingIndex=t.bindingRootIndex=n,g_(e)}function g_(n){Ln.lFrame.currentDirectiveIndex=n}function m_(n){const e=Ln.lFrame.currentDirectiveIndex;return-1===e?null:n[e]}function pv(){return Ln.lFrame.currentQueryIndex}function __(n){Ln.lFrame.currentQueryIndex=n}function vp(n){const e=n[1];return 2===e.type?e.declTNode:1===e.type?n[6]:null}function Rd(n,e,t){if(t&xn.SkipSelf){let r=e,s=n;for(;!(r=r.parent,null!==r||t&xn.Host||(r=vp(s),null===r||(s=s[15],10&r.type))););if(null===r)return!1;e=r,n=s}const i=Ln.lFrame=xe();return i.currentTNode=e,i.lView=n,!0}function $h(n){const e=xe(),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 xe(){const n=Ln.lFrame,e=null===n?null:n.child;return null===e?Tu(n):e}function Tu(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 Wh(){const n=Ln.lFrame;return Ln.lFrame=n.parent,n.currentTNode=null,n.lView=null,n}const Lo=Wh;function fi(){const n=Wh();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 to(){return Ln.lFrame.selectedIndex}function _o(n){Ln.lFrame.selectedIndex=n}function Nr(){const n=Ln.lFrame;return h_(n.tView,n.selectedIndex)}function wp(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 qh{constructor(e,t,i){this.factory=e,this.resolving=!1,this.canSeeViewProviders=t,this.injectImpl=i}}function Sp(n,e,t){const i=dr(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 Nd=!0;function Cp(n){const e=Nd;return Nd=n,e}let x_=0;function Hs(n,e){const t=Tp(n,e);if(-1!==t)return t;const i=e[1];i.firstCreatePass&&(n.injectorIndex=e.length,S_(i.data,n),S_(e,null),S_(i.blueprint,null));const r=Xh(n,e),s=n.injectorIndex;if(yv(r)){const o=Pd(r),a=al(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 S_(n,e){n.push(0,0,0,0,0,0,0,0,e)}function Tp(n,e){return-1===n.injectorIndex||n.parent&&n.parent.injectorIndex===n.injectorIndex||null===e[n.injectorIndex+8]?-1:n.injectorIndex}function Xh(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 Rc(n,e,t){!function(n,e,t){let i;"string"==typeof t?i=t.charCodeAt(0)||0:t.hasOwnProperty(Rh)&&(i=t[Rh]),null==i&&(i=t[Rh]=x_++);const r=255&i;e.data[n+(r>>5)]|=1<=0?255&e:Ev:e}(t);if("function"==typeof s){if(!Rd(e,n,i))return i&xn.Host?C_(r,t,i):vv(e,t,i,r);try{const o=s(i);if(null!=o||i&xn.Optional)return o;bn(t)}finally{Lo()}}else if("number"==typeof s){let o=null,a=Tp(n,e),l=-1,c=i&xn.Host?e[16][6]:null;for((-1===a||i&xn.SkipSelf)&&(l=-1===a?Xh(n,e):e[a+8],-1!==l&&Qh(i,!1)?(o=e[1],a=Pd(l),e=al(l,e)):a=-1);-1!==a;){const u=e[1];if(Ap(s,a,u.data)){const h=Ts(a,e,t,o,i,c);if(h!==wv)return h}l=e[a+8],-1!==l&&Qh(i,e[1].data[a+8]===c)&&Ap(s,a,e)?(o=u,a=Pd(l),e=al(l,e)):a=-1}}}return vv(e,t,i,r)}const wv={};function Ev(){return new na(as(),Vt())}function Ts(n,e,t,i,r,s){const o=e[1],a=o.data[n+8],u=kd(a,o,t,null==i?Ad(a)&&Nd:i!=o&&0!=(3&a.type),r&xn.Host&&s===a);return null!==u?Fd(e,o,u,a):wv}function kd(n,e,t,i,r){const s=n.providerIndexes,o=e.data,a=1048575&s,l=n.directiveStart,u=s>>20,f=r?a+u:n.directiveEnd;for(let g=i?a:a+u;g=l&&m.type===t)return g}if(r){const g=o[l];if(g&&Da(g)&&g.type===t)return l}return null}function Fd(n,e,t,i){let r=n[t];const s=e.data;if(function(n){return n instanceof qh}(r)){const o=r;o.resolving&&function(n,e){throw new Je("200",`Circular dependency in DI detected for ${n}`)}(Qt(s[t]));const a=Cp(o.canSeeViewProviders);o.resolving=!0;const l=o.injectImpl?Ta(o.injectImpl):null;Rd(n,i,xn.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=dv(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&&Ta(l),Cp(a),o.resolving=!1,Lo()}}return r}function Ap(n,e,t){return!!(t[e+(n>>5)]&1<{const e=n.prototype.constructor,t=e[Bl]||As(e),i=Object.prototype;let r=Object.getPrototypeOf(n.prototype).constructor;for(;r&&r!==i;){const s=r[Bl]||As(r);if(s&&s!==t)return s;r=Object.getPrototypeOf(r)}return s=>new s})}function As(n){return Be(n)?()=>{const e=As(ve(n));return e&&e()}:Ic(n)}function yo(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{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,u){const h=l.hasOwnProperty(Bd)?l[Bd]:Object.defineProperty(l,Bd,{value:[]})[Bd];for(;h.length<=u;)h.push(null);return(h[u]=h[u]||[]).push(o),l}}return t&&(r.prototype=Object.create(t.prototype)),r.prototype.ngMetadataName=n,r.annotationCls=r,r})}class Ht{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}`}}const Du=Function;function ia(n,e){void 0===e&&(e=n);for(let t=0;tArray.isArray(t)?ra(t,e):e(t))}function Jh(n,e,t){e>=n.length?n.push(t):n.splice(e,0,t)}function Hl(n,e){return e>=n.length-1?n.pop():n.splice(e,1)[0]}function Nc(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 O_(n,e){const t=Ms(n,e);if(t>=0)return n[1|t]}function Ms(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(Lc,"\n ")}`}("\n"+n.message,r,t,i),n.ngTokenPath=r,n[Fc]=null,n}const Hd=zd(ka("Inject",n=>({token:n})),-1),ts=zd(ka("Optional"),8),dl=zd(ka("SkipSelf"),4);let $d;function Fu(n){var e;return(null===(e=function(){if(void 0===$d&&($d=null,Zn.trustedTypes))try{$d=Zn.trustedTypes.createPolicy("angular",{createHTML:n=>n,createScript:n=>n,createScriptURL:n=>n})}catch(n){}return $d}())||void 0===e?void 0:e.createHTML(n))||n}class ql{constructor(e){this.changingThisBreaksApplicationSecurity=e}toString(){return`SafeValue must use [property]=binding: ${this.changingThisBreaksApplicationSecurity} (see https://g.co/ng/security#xss)`}}class L_ extends ql{getTypeName(){return"HTML"}}class B_ extends ql{getTypeName(){return"Style"}}class jp extends ql{getTypeName(){return"Script"}}class Wd extends ql{getTypeName(){return"URL"}}class kn extends ql{getTypeName(){return"ResourceURL"}}function Gs(n){return n instanceof ql?n.changingThisBreaksApplicationSecurity:n}function sa(n,e){const t=jc(n);if(null!=t&&t!==e){if("ResourceURL"===t&&"URL"===e)return!0;throw new Error(`Required a safe ${e}, got a ${t} (see https://g.co/ng/security#xss)`)}return t===e}function jc(n){return n instanceof ql&&n.getTypeName()||null}class jv{constructor(e){this.inertDocumentHelper=e}getInertBodyElement(e){e=""+e;try{const t=(new window.DOMParser).parseFromString(Fu(e),"text/html").body;return null===t?this.inertDocumentHelper.getInertBodyElement(e):(t.removeChild(t.firstChild),t)}catch(t){return null}}}class fT{constructor(e){if(this.defaultDoc=e,this.inertDocument=this.defaultDoc.implementation.createHTMLDocument("sanitization-inert"),null==this.inertDocument.body){const t=this.inertDocument.createElement("html");this.inertDocument.appendChild(t);const i=this.inertDocument.createElement("body");t.appendChild(i)}}getInertBodyElement(e){const t=this.inertDocument.createElement("template");if("content"in t)return t.innerHTML=Fu(e),t;const i=this.inertDocument.createElement("body");return i.innerHTML=Fu(e),this.defaultDoc.documentMode&&this.stripCustomNsAttrs(i),i}stripCustomNsAttrs(e){const t=e.attributes;for(let r=t.length-1;0jo(e.trim())).join(", ")}function oa(n){const e={};for(const t of n.split(","))e[t]=!0;return e}function tf(...n){const e={};for(const t of n)for(const i in t)t.hasOwnProperty(i)&&(e[i]=!0);return e}const Up=oa("area,br,col,hr,img,wbr"),zv=oa("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr"),Hv=oa("rp,rt"),j_=tf(Up,tf(zv,oa("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")),tf(Hv,oa("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")),tf(Hv,zv)),U_=oa("background,cite,href,itemtype,longdesc,poster,src,xlink:href"),z_=oa("srcset"),H_=tf(U_,z_,oa("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"),oa("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")),bT=oa("script,style,template");class G_{constructor(){this.sanitizedSomething=!1,this.buf=[]}sanitizeChildren(e){let t=e.firstChild,i=!0;for(;t;)if(t.nodeType===Node.ELEMENT_NODE?i=this.startElement(t):t.nodeType===Node.TEXT_NODE?this.chars(t.nodeValue):this.sanitizedSomething=!0,i&&t.firstChild)t=t.firstChild;else for(;t;){t.nodeType===Node.ELEMENT_NODE&&this.endElement(t);let r=this.checkClobberedElement(t,t.nextSibling);if(r){t=r;break}t=this.checkClobberedElement(t,t.parentNode)}return this.buf.join("")}startElement(e){const t=e.nodeName.toLowerCase();if(!j_.hasOwnProperty(t))return this.sanitizedSomething=!0,!bT.hasOwnProperty(t);this.buf.push("<"),this.buf.push(t);const i=e.attributes;for(let r=0;r"),!0}endElement(e){const t=e.nodeName.toLowerCase();j_.hasOwnProperty(t)&&!Up.hasOwnProperty(t)&&(this.buf.push(""))}chars(e){this.buf.push(Hp(e))}checkClobberedElement(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: ${e.outerHTML}`);return t}}const Gv=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,nf=/([^\#-~ |!])/g;function Hp(n){return n.replace(/&/g,"&").replace(Gv,function(e){return"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";"}).replace(nf,function(e){return"&#"+e.charCodeAt(0)+";"}).replace(//g,">")}let rf;function $_(n,e){let t=null;try{rf=rf||function(n){const e=new fT(n);return function(){try{return!!(new window.DOMParser).parseFromString(Fu(""),"text/html")}catch(n){return!1}}()?new jv(e):e}(n);let i=e?String(e):"";t=rf.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=t.innerHTML,t=rf.getInertBodyElement(i)}while(i!==s);return Fu((new G_).sanitizeChildren(qd(t)||t))}finally{if(t){const i=qd(t)||t;for(;i.firstChild;)i.removeChild(i.firstChild)}}}function qd(n){return"content"in n&&function(n){return n.nodeType===Node.ELEMENT_NODE&&"TEMPLATE"===n.nodeName}(n)?n.content:null}var si=(()=>((si=si||{})[si.NONE=0]="NONE",si[si.HTML=1]="HTML",si[si.STYLE=2]="STYLE",si[si.SCRIPT=3]="SCRIPT",si[si.URL=4]="URL",si[si.RESOURCE_URL=5]="RESOURCE_URL",si))();function sf(n){const e=function(){const n=Vt();return n&&n[12]}();return e?e.sanitize(si.URL,n)||"":sa(n,"URL")?Gs(n):jo(Ot(n))}const Y_="__ngContext__";function Ds(n,e){n[Y_]=e}function X_(n){const e=function(n){return n[Y_]||null}(n);return e?Array.isArray(e)?e:e.lView:null}function Gp(n){return n.ngOriginalError}function RT(n,...e){n.error(...e)}class la{constructor(){this._console=console}handleError(e){const t=this._findOriginalError(e),i=this._findContext(e),r=function(n){return n&&n.ngErrorLogger||RT}(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(Gp(e)):null}_findOriginalError(e){let t=e&&Gp(e);for(;t&&Gp(t);)t=Gp(t);return t||null}}const tw=(()=>("undefined"!=typeof requestAnimationFrame&&requestAnimationFrame||setTimeout).bind(Zn))();function fl(n){return n instanceof Function?n():n}var Uo=(()=>((Uo=Uo||{})[Uo.Important=1]="Important",Uo[Uo.DashCase=2]="DashCase",Uo))();function ey(n,e){return undefined(n,e)}function lf(n){const e=n[3];return ea(e)?e[3]:e}function Xd(n){return ow(n[13])}function ny(n){return ow(n[4])}function ow(n){for(;null!==n&&!ea(n);)n=n[4];return n}function Kd(n,e,t,i,r){if(null!=i){let s,o=!1;ea(i)?s=i:Jo(i)&&(o=!0,i=i[0]);const a=Sr(i);0===n&&null!==t?null==r?dw(e,t,a):pl(e,t,a,r||null,!0):1===n&&null!==t?pl(e,t,a,r||null,!0):2===n?function(n,e,t){const i=qp(n,e);i&&function(n,e,t,i){dr(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!==Sr(t)&&Kd(e,n,i,s,r);for(let a=10;a0&&(n[t-1][4]=i[4]);const s=Hl(n,10+e);!function(n,e){Qd(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 oy(n,e){if(!(256&e[2])){const t=e[11];dr(t)&&t.destroyNode&&Qd(n,e,t,3,null,null),function(n){let e=n[13];if(!e)return Wp(n[1],n);for(;e;){let t=null;if(Jo(e))t=e[13];else{const i=e[10];i&&(t=i)}if(!t){for(;e&&!e[4]&&e!==n;)Jo(e)&&Wp(e[1],e),e=e[3];null===e&&(e=n),Jo(e)&&Wp(e[1],e),t=e&&e[4]}e=t}}(e)}}function Wp(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[h+1].toLowerCase();const g=8&i?f:null;if(g&&-1!==uf(g,c,0)||2&i&&c!==f){if(La(i))return!1;o=!0}}}}else{if(!o&&!La(i)&&!La(l))return!1;if(o&&La(l))continue;o=!1,i=l|1&i}}return La(i)||o}function La(n){return 0==(1&n)}function oA(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&&!La(o)&&(e+=Sw(s,r),r=""),i=o,s=s||!La(i);t++}return""!==r&&(e+=Sw(s,r)),e}const Dn={};function zt(n){Cw(Si(),Vt(),to()+n,zh())}function Cw(n,e,t,i){if(!i)if(3==(3&e[2])){const s=n.preOrderCheckHooks;null!==s&&Ep(e,s,t)}else{const s=n.preOrderHooks;null!==s&&xp(e,s,0,t)}_o(t)}function gl(n,e){return n<<17|e<<2}function On(n){return n>>17&32767}function Cr(n){return 2|n}function Yl(n){return(131068&n)>>2}function ml(n,e){return-131069&n|e<<2}function hy(n){return 1|n}function Nw(n,e){const t=n.contentQueries;if(null!==t)for(let i=0;i20&&Cw(n,e,20,zh()),t(i,r)}finally{_o(s)}}function pf(n,e,t){!fv()||(function(n,e,t,i){const r=t.directiveStart,s=t.directiveEnd;n.firstCreatePass||Hs(t,e),Ds(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 $w(n,e){null!==n.hostBindings&&n.hostBindings(1,e)}function Ww(n,e){e.flags|=2,(n.components||(n.components=[])).push(e.index)}function NA(n,e,t){if(t){if(e.exportAs)for(let i=0;i0&&Sy(t)}}function Sy(n){for(let i=Xd(n);null!==i;i=ny(i))for(let r=10;r0&&Sy(s)}const t=n[1].components;if(null!==t)for(let i=0;i0&&Sy(r)}}function UA(n,e){const t=zs(e,n),i=t[1];(function(n,e){for(let t=e.length;tPromise.resolve(null))();function Xw(n){return n[7]||(n[7]=[])}function ig(n){return n.cleanup||(n.cleanup=[])}function Dy(n,e,t){return(null===n||Da(n))&&(t=function(n){for(;Array.isArray(n);){if("object"==typeof n[1])return n;n=n[0]}return null}(t[e.index])),t[11]}function Iy(n,e){const t=n[9],i=t?t.get(la,null):null;i&&i.handleError(e)}function Kw(n,e,t,i,r){for(let s=0;sthis.processProvider(a,e,t)),ra([e],a=>this.processInjectorType(a,[],s)),this.records.set(Vu,Uu(void 0,this));const o=this.records.get(ju);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=Ru,i=xn.Default){this.assertNotDestroyed();const r=Ud(this),s=Ta(void 0);try{if(!(i&xn.SkipSelf)){let a=this.records.get(e);if(void 0===a){const l=function(n){return"function"==typeof n||"object"==typeof n&&n instanceof Ht}(e)&&vn(e);a=l&&this.injectableDefInScope(l)?Uu(ky(e),gf):null,this.records.set(e,a)}if(null!=a)return this.hydrate(e,a)}return(i&xn.Self?Qw():this.parent).get(e,t=i&xn.Optional&&t===Ru?null:t)}catch(o){if("NullInjectorError"===o.name){if((o[Fc]=o[Fc]||[]).unshift(rt(e)),r)throw o;return no(o,e,"R3InjectorError",this.source)}throw o}finally{Ta(s),Ud(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=Fl(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=Fl(s)),null==r)return!1;if(null!=r.imports&&!a){let u;i.push(o);try{ra(r.imports,h=>{this.processInjectorType(h,t,i)&&(void 0===u&&(u=[]),u.push(h))})}finally{}if(void 0!==u)for(let h=0;hthis.processProvider(m,f,g||er))}}this.injectorDefTypes.add(o);const l=Ic(o)||(()=>new o);this.records.set(o,Uu(l,gf));const c=r.providers;if(null!=c&&!a){const u=e;ra(c,h=>this.processProvider(h,u,c))}return void 0!==s&&void 0!==e.providers}processProvider(e,t,i){let r=Hc(e=ve(e))?e:ve(e&&e.provide);const s=function(n,e,t){return eE(n)?Uu(void 0,n.useValue):Uu(Jw(n),gf)}(e);if(Hc(e)||!0!==e.multi)this.records.get(r);else{let o=this.records.get(r);o||(o=Uu(void 0,gf,!0),o.factory=()=>Nu(o.multi),this.records.set(r,o)),r=e,o.multi.push(e)}this.records.set(r,s)}hydrate(e,t){return t.value===gf&&(t.value=YA,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 ky(n){const e=vn(n),t=null!==e?e.factory:Ic(n);if(null!==t)return t;if(n instanceof Ht)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=Nc(e,"?");throw new Error(`Can't resolve all parameters for ${rt(n)}: (${i.join(", ")}).`)}const t=function(n){const e=n&&(n[fo]||n[Vs]);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 Jw(n,e,t){let i;if(Hc(n)){const r=ve(n);return Ic(r)||ky(r)}if(eE(n))i=()=>ve(n.useValue);else if(function(n){return!(!n||!n.useFactory)}(n))i=()=>n.useFactory(...Nu(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 Ic(r)||ky(r);i=()=>new r(...Nu(n.deps))}return i}function Uu(n,e,t=!1){return{factory:n,value:e,multi:t?[]:void 0}}function eE(n){return null!==n&&"object"==typeof n&&Pp in n}function Hc(n){return"function"==typeof n}const tE=function(n,e,t){return function(n,e=null,t=null,i){const r=Zw(n,e,t,i);return r._resolveInjectorDefTypes(),r}({name:t},e,n,t)};class Hn{static create(e,t){return Array.isArray(e)?tE(e,t,""):tE(e.providers,e.parent,e.name||"")}}function Fq(n,e){wp(X_(n)[1],as())}function En(n){let e=function(n){return Object.getPrototypeOf(n.prototype).constructor}(n.type),t=!0;const i=[n];for(;e;){let r;if(Da(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=lM(n.inputs),o.declaredInputs=lM(n.declaredInputs),o.outputs=lM(n.outputs);const a=r.hostBindings;a&&jq(n,a);const l=r.viewQuery,c=r.contentQueries;if(l&&Bq(n,l),c&&Vq(n,c),nl(n.inputs,r.inputs),nl(n.declaredInputs,r.declaredInputs),nl(n.outputs,r.outputs),Da(r)&&r.data.animation){const u=n.data;u.animation=(u.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=Yh(r.hostAttrs,t=Yh(t,r.hostAttrs))}}(i)}function lM(n){return n===xd?{}:n===er?[]:n}function Bq(n,e){const t=n.viewQuery;n.viewQuery=t?(i,r)=>{e(i,r),t(i,r)}:e}function Vq(n,e){const t=n.contentQueries;n.contentQueries=t?(i,r,s)=>{e(i,r,s),t(i,r,s)}:e}function jq(n,e){const t=n.hostBindings;n.hostBindings=t?(i,r)=>{e(i,r),t(i,r)}:e}Hn.THROW_IF_NOT_FOUND=Ru,Hn.NULL=new so,Hn.\u0275prov=We({token:Hn,providedIn:"any",factory:()=>Ie(Vu)}),Hn.__NG_ELEMENT_ID__=-1;let oE=null;function sg(){if(!oE){const n=Zn.Symbol;if(n&&n.iterator)oE=n.iterator;else{const e=Object.getOwnPropertyNames(Map.prototype);for(let t=0;ta(Sr(_e[i.index])):i.index;if(dr(t)){let _e=null;if(!a&&l&&(_e=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!==_e)(_e.__ngLastListenerFn__||_e).__ngNextListenerFn__=s,_e.__ngLastListenerFn__=s,g=!1;else{s=gM(i,e,h,s,!1);const Pe=t.listen(U,r,s);f.push(s,Pe),u&&u.push(r,ie,D,D+1)}}else s=gM(i,e,h,s,!0),U.addEventListener(r,s,o),f.push(s),u&&u.push(r,ie,D,o)}else s=gM(i,e,h,s,!1);const m=i.outputs;let v;if(g&&null!==m&&(v=m[r])){const x=v.length;if(x)for(let U=0;U0;)e=e[15],n--;return e}(n,Ln.lFrame.contextLView))[8]}(n)}function vY(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 Os={textEnd:0,key:0,keyEnd:0,value:0,valueEnd:0};function k2(n){return n.substring(Os.key,Os.keyEnd)}function F2(n,e){const t=Os.textEnd;return t===e?-1:(e=Os.keyEnd=function(n,e,t){for(;e32;)e++;return e}(n,Os.key=e,t),bg(n,e,t))}function bg(n,e,t){for(;e=0;t=F2(e,t))Bo(n,k2(e),!0)}function Jl(n,e,t,i){const r=Vt(),s=Si(),o=Fo(2);s.firstUpdatePass&&z2(s,n,o,i),e!==Dn&&Eo(r,o,e)&&G2(s,s.data[to()],r,r[11],n,r[o+1]=function(n,e){return null==n||("string"==typeof e?n+=e:"object"==typeof n&&(n=rt(Gs(n)))),n}(e,t),i,o)}function U2(n,e){return e>=n.expandoStartIndex}function z2(n,e,t,i){const r=n.data;if(null===r[t+1]){const s=r[to()],o=U2(n,t);W2(s,i)&&null===e&&!o&&(e=!1),e=function(n,e,t,i){const r=m_(n);let s=i?e.residualClasses:e.residualStyles;if(null===r)0===(i?e.classBindings:e.styleBindings)&&(t=Hy(t=_M(null,n,e,t,i),e.attrs,i),s=null);else{const o=e.directiveStylingLast;if(-1===o||n[o]!==r)if(t=_M(r,n,e,t,i),null===s){let l=function(n,e,t){const i=t?e.classBindings:e.styleBindings;if(0!==Yl(i))return n[On(i)]}(n,e,i);void 0!==l&&Array.isArray(l)&&(l=_M(null,n,e,l[1],i),l=Hy(l,e.attrs,i),function(n,e,t,i){n[On(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 u=t;if(r)if(0!==l){const f=On(n[a+1]);n[i+1]=gl(f,a),0!==f&&(n[f+1]=ml(n[f+1],i)),n[a+1]=function(n,e){return 131071&n|e<<17}(n[a+1],i)}else n[i+1]=gl(a,0),0!==a&&(n[a+1]=ml(n[a+1],i)),a=i;else n[i+1]=gl(l,0),0===a?a=i:n[l+1]=ml(n[l+1],i),l=i;c&&(n[i+1]=Cr(n[i+1])),N2(n,u,i,!0),N2(n,u,i,!1),function(n,e,t,i,r){const s=r?n.residualClasses:n.residualStyles;null!=s&&"string"==typeof e&&Ms(s,e)>=0&&(t[i+1]=hy(t[i+1]))}(e,u,n,i,s),o=gl(a,l),s?e.classBindings=o:e.styleBindings=o}(r,s,e,t,o,i)}}function _M(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),u=c?l[1]:l,h=null===u;let f=t[r+1];f===Dn&&(f=h?er:void 0);let g=h?O_(f,i):u===i?f:void 0;if(c&&!hE(g)&&(g=O_(l,i)),hE(g)&&(a=g,o))return a;const m=n[r+1];r=o?On(m):Yl(m)}if(null!==e){let l=s?e.residualClasses:e.residualStyles;null!=l&&(a=O_(l,i))}return a}function hE(n){return void 0!==n}function W2(n,e){return 0!=(n.flags&(e?16:32))}function Jn(n,e=""){const t=Vt(),i=Si(),r=n+20,s=i.firstCreatePass?Jd(i,r,1,e,null):i.data[r],o=t[r]=function(n,e){return dr(n)?n.createText(e):n.createTextNode(e)}(t[11],e);Yp(i,t,o,s),sl(s,!1)}function gs(n){return xo("",n,""),gs}function xo(n,e,t){const i=Vt(),r=ag(i,n,e,t);return r!==Dn&&Xl(i,to(),r),xo}function qc(n,e,t){const i=Vt();return Eo(i,Ra(),e)&&zo(Si(),Nr(),i,n,e,i[11],t,!0),qc}function fE(n,e,t){const i=Vt();if(Eo(i,Ra(),e)){const s=Si(),o=Nr();zo(s,o,i,n,e,Dy(m_(s.data),o,i),t,!0)}return fE}const _f=void 0;var iX=["en",[["a","p"],["AM","PM"],_f],[["AM","PM"],_f,_f],[["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"]],_f,[["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"]],_f,[["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}",_f,"{1} 'at' {0}",_f],[".",",",";","%","+","-","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 vg={};function uL(n){return n in vg||(vg[n]=Zn.ng&&Zn.ng.common&&Zn.ng.common.locales&&Zn.ng.common.locales[n]),vg[n]}var un=(()=>((un=un||{})[un.LocaleId=0]="LocaleId",un[un.DayPeriodsFormat=1]="DayPeriodsFormat",un[un.DayPeriodsStandalone=2]="DayPeriodsStandalone",un[un.DaysFormat=3]="DaysFormat",un[un.DaysStandalone=4]="DaysStandalone",un[un.MonthsFormat=5]="MonthsFormat",un[un.MonthsStandalone=6]="MonthsStandalone",un[un.Eras=7]="Eras",un[un.FirstDayOfWeek=8]="FirstDayOfWeek",un[un.WeekendRange=9]="WeekendRange",un[un.DateFormat=10]="DateFormat",un[un.TimeFormat=11]="TimeFormat",un[un.DateTimeFormat=12]="DateTimeFormat",un[un.NumberSymbols=13]="NumberSymbols",un[un.NumberFormats=14]="NumberFormats",un[un.CurrencyCode=15]="CurrencyCode",un[un.CurrencySymbol=16]="CurrencySymbol",un[un.CurrencyName=17]="CurrencyName",un[un.Currencies=18]="Currencies",un[un.Directionality=19]="Directionality",un[un.PluralCase=20]="PluralCase",un[un.ExtraData=21]="ExtraData",un))();const pE="en-US";let dL=pE;function bM(n){J(n,"Expected localeId to be defined"),"string"==typeof n&&(dL=n.toLowerCase().replace(/_/g,"-"))}function EM(n,e,t,i,r){if(n=ve(n),Array.isArray(n))for(let s=0;s>20;if(Hc(n)||!n.multi){const g=new qh(l,r,Ce),m=SM(a,e,r?u:u+f,h);-1===m?(Rc(Hs(c,o),s,a),xM(s,n,e.length),e.push(a),c.directiveStart++,c.directiveEnd++,r&&(c.providerIndexes+=1048576),t.push(g),o.push(g)):(t[m]=g,o[m]=g)}else{const g=SM(a,e,u+f,h),m=SM(a,e,u,u+f),v=g>=0&&t[g],x=m>=0&&t[m];if(r&&!x||!r&&!v){Rc(Hs(c,o),s,a);const U=function(n,e,t,i,r){const s=new qh(n,t,Ce);return s.multi=[],s.index=e,s.componentProviders=0,kL(s,r,i&&!t),s}(r?eK:JX,t.length,r,i,l);!r&&x&&(t[m].providerFactory=U),xM(s,n,e.length,0),e.push(a),c.directiveStart++,c.directiveEnd++,r&&(c.providerIndexes+=1048576),t.push(U),o.push(U)}else xM(s,n,g>-1?g:m,kL(t[r?m:g],l,!r&&i));!r&&i&&x&&t[m].componentProviders++}}}function xM(n,e,t,i){const r=Hc(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 kL(n,e,t){return t&&n.componentProviders++,n.multi.push(e)-1}function SM(n,e,t,i){for(let r=t;r{t.providersResolver=(i,r)=>function(n,e,t){const i=Si();if(i.firstCreatePass){const r=Da(n);EM(t,i.data,i.blueprint,r,!0),EM(e,i.data,i.blueprint,r,!1)}}(i,r?r(n):n,e)}}class FL{}const BL="ngComponent";class iK{resolveComponentFactory(e){throw function(n){const e=Error(`No component factory found for ${rt(n)}. Did you add it to @NgModule.entryComponents?`);return e[BL]=n,e}(e)}}class El{}function bE(...n){}function Eg(n,e){return new gn(eo(n,e))}El.NULL=new iK;const oK=function(){return Eg(as(),Vt())};let gn=(()=>{class n{constructor(t){this.nativeElement=t}}return n.__NG_ELEMENT_ID__=oK,n})();function VL(n){return n instanceof gn?n.nativeElement:n}class yf{}let AM=(()=>{class n{}return n.\u0275prov=We({token:n,providedIn:"root",factory:()=>null}),n})();class Hu{constructor(e){this.full=e,this.major=e.split(".")[0],this.minor=e.split(".")[1],this.patch=e.split(".").slice(2).join(".")}}const jL=new Hu("12.2.5");class UL{constructor(){}supports(e){return jy(e)}create(e){return new hK(e)}}const dK=(n,e)=>e;class hK{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||dK}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 fK(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 zL),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 zL),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 fK{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 pK{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 zL{constructor(){this.map=new Map}put(e){const t=e.trackById;let i=this.map.get(t);i||(i=new pK,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 HL(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 mK(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 mK{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 $L(){return new xg([new UL])}let xg=(()=>{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||$L()),deps:[[n,new dl,new ts]]}}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:$L}),n})();function WL(){return new Sg([new GL])}let Sg=(()=>{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||WL()),deps:[[n,new dl,new ts]]}}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:WL}),n})();function vE(n,e,t,i,r=!1){for(;null!==t;){const s=e[t.index];if(null!==s&&i.push(Sr(s)),ea(s))for(let a=10;a-1&&(sy(e,i),Hl(t,i))}this._attachedToViewContainer=!1}oy(this._lView[1],this._lView)}onDestroy(e){Bw(this._lView[1],this._lView,null,e)}markForCheck(){Cy(this._cdRefInjectingView||this._lView)}detach(){this._lView[2]&=-129}reattach(){this._lView[2]|=128}detectChanges(){Ay(this._lView[1],this._lView,this.context)}checkNoChanges(){!function(n,e,t){yp(!0);try{Ay(n,e,t)}finally{yp(!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){Qd(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 yK extends Yy{constructor(e){super(e),this._view=e}detectChanges(){Yw(this._view)}checkNoChanges(){!function(n){yp(!0);try{Yw(n)}finally{yp(!1)}}(this._view)}get context(){return null}}const vK=function(n){return function(n,e,t){if(Ad(n)&&!t){const i=zs(n.index,e);return new Yy(i,i)}return 47&n.type?new Yy(e[16],e):null}(as(),Vt(),16==(16&n))};let Mr=(()=>{class n{}return n.__NG_ELEMENT_ID__=vK,n})();const xK=[new GL],CK=new xg([new UL]),TK=new Sg(xK),MK=function(){return wE(as(),Vt())};let Go=(()=>{class n{}return n.__NG_ELEMENT_ID__=MK,n})();const DK=Go,IK=class extends DK{constructor(e,t,i){super(),this._declarationLView=e,this._declarationTContainer=t,this.elementRef=i}createEmbeddedView(e){const t=this._declarationTContainer.tViews,i=hf(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)),ff(t,i,e),new Yy(i)}};function wE(n,e){return 4&n.type?new IK(e,n,Eg(n,e)):null}class Yc{}const PK=function(){return KL(as(),Vt())};let Rs=(()=>{class n{}return n.__NG_ELEMENT_ID__=PK,n})();const kK=Rs,YL=class extends kK{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 na(this._hostTNode,this._hostLView)}get parentInjector(){const e=Xh(this._hostTNode,this._hostLView);if(yv(e)){const t=al(e,this._hostLView),i=Pd(e);return new na(t[1].data[i+8],t)}return new na(null,this._hostLView)}clear(){for(;this.length>0;)this.remove(this.length-1)}get(e){const t=XL(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(Yc,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 ea(n[3])}(i)){const u=this.indexOf(e);if(-1!==u)this.detach(u);else{const h=i[3],f=new YL(h,h[6],h[3]);f.detach(f.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),itw});class b3 extends FL{constructor(e,t){super(),this.componentDef=e,this.ngModule=t,this.componentType=e.type,this.selector=function(n){return n.map(dA).join(",")}(e.selectors),this.ngContentSelectors=e.ngContentSelectors?e.ngContentSelectors:[],this.isBoundToModule=!!t}get inputs(){return y3(this.componentDef.inputs)}get outputs(){return y3(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,Mg,r);return s!==Mg||i===Mg?s:e.get(t,i,r)}}}(e,r.injector):e,o=s.get(yf,Su),a=s.get(AM,null),l=o.createRenderer(null,this.componentDef),c=this.componentDef.selectors[0][0]||"div",u=i?function(n,e,t){if(dr(n))return n.selectRootElement(e,t===Xt.ShadowDom);let i="string"==typeof e?n.querySelector(e):e;return i.textContent="",i}(l,i,this.componentDef.encapsulation):ry(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)),h=this.componentDef.onPush?576:528,f=function(n,e){return{components:[],scheduler:n||tw,clean:WA,playerHandler:e||null,flags:0}}(),g=tg(0,null,null,1,0,null,null,null,null,null),m=hf(null,g,f,h,null,null,o,l,a,s);let v,x;$h(m);try{const U=function(n,e,t,i,r,s){const o=t[1];t[20]=n;const l=Jd(o,20,2,"#host",null),c=l.mergedAttrs=e.hostAttrs;null!==c&&(rg(l,c,!0),null!==n&&(Sp(r,n,c),null!==l.classes&&uy(r,n,l.classes),null!==l.styles&&vw(r,n,l.styles)));const u=i.createRenderer(n,e),h=hf(t,eg(e),null,e.onPush?64:16,t[20],l,i,u,s||null,null);return o.firstCreatePass&&(Rc(Hs(l,t),o,e.type),Ww(o,l),wy(l,t.length,1)),ng(t,h),t[20]=h}(u,this.componentDef,m,o,l);if(u)if(i)Sp(l,u,["ng-version",jL.full]);else{const{attrs:D,classes:ie}=function(n){const e=[],t=[];let i=1,r=2;for(;i0&&uy(l,u,ie.join(" "))}if(x=h_(g,20),void 0!==t){const D=x.projection=[];for(let ie=0;iel(o,e)),e.contentQueries){const l=as();e.contentQueries(1,o,l.directiveStart)}const a=as();return!s.firstCreatePass||null===e.hostBindings&&null===e.hostAttrs||(_o(a.index),Gw(t[1],a,0,a.directiveStart,a.directiveEnd,e),$w(e,o)),o}(U,this.componentDef,m,f,[Fq]),ff(g,m,null)}finally{fi()}return new NQ(this.componentType,v,Eg(x,m),m,x)}}class NQ 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 yK(r),this.componentType=e}get injector(){return new na(this._tNode,this._rootLView)}destroy(){this.hostView.destroy()}onDestroy(e){this.hostView.onDestroy(e)}}const Dg=new Map;class LQ extends Yc{constructor(e,t){super(),this._parent=t,this._bootstrapComponents=[],this.injector=this,this.destroyCbs=[],this.componentFactoryResolver=new _3(this);const i=No(e),r=function(n){return n[T1]||null}(e);r&&bM(r),this._bootstrapComponents=fl(i.bootstrap),this._r3Injector=Zw(e,t,[{provide:Yc,useValue:this},{provide:El,useValue:this.componentFactoryResolver}],rt(e)),this._r3Injector._resolveInjectorDefTypes(),this.instance=this.get(e)}get(e,t=Hn.THROW_IF_NOT_FOUND,i=xn.Default){return e===Hn||e===Yc||e===Vu?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 UM extends class{}{constructor(e){super(),this.moduleType=e,null!==No(e)&&function(n){const e=new Set;!function t(i){const r=No(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,Dg.get(s),i),Dg.set(s,i));const o=fl(r.imports);for(const a of o)e.has(a)||(e.add(a),t(a))}(n)}(e)}create(e){return new LQ(this.moduleType,e)}}function TE(n,e,t){const i=Cs()+n,r=Vt();return r[i]===Dn?$c(r,i,t?e.call(t):e()):function(n,e){return n[e]}(r,i)}function E3(n,e,t,i,r,s){const o=e+t;return Eo(n,o,r)?$c(n,o+1,s?i.call(s,r):i(r)):function(n,e){const t=n[e];return t===Dn?void 0:t}(n,o+1)}function Ps(n,e){const t=Si();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 Je("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=Ic(i.type)),o=Ta(Ce);try{const a=Cp(!1),l=s();return Cp(a),function(n,e,t,i){t>=n.data.length&&(n.data[t]=null,n.blueprint[t]=null),e[t]=i}(t,Vt(),r,l),l}finally{Ta(o)}}function To(n,e,t){const i=n+20,r=Vt(),s=Dd(r,i);return function(n,e){Ql.isWrapped(e)&&(e=Ql.unwrap(e),n[Ln.lFrame.bindingIndex]=Dn);return e}(r,function(n,e){return n[1].data[e].pure}(r,i)?E3(r,Cs(),e,s.transform,t,s):s.transform(t))}function HM(n){return e=>{setTimeout(n,void 0,e)}}const ln=class extends oe{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 h=e;a=null===(r=h.next)||void 0===r?void 0:r.bind(h),l=null===(s=h.error)||void 0===s?void 0:s.bind(h),c=null===(o=h.complete)||void 0===o?void 0:o.bind(h)}this.__isAsync&&(l=HM(l),a&&(a=HM(a)),c&&(c=HM(c)));const u=super.subscribe({next:a,error:l,complete:c});return e instanceof C&&e.add(u),u}};function QQ(){return this._results[sg()]()}class wf{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=sg(),i=wf.prototype;i[t]||(i[t]=QQ)}get changes(){return this._changes||(this._changes=new ln)}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=ia(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],u=e[-l];for(let h=10;h{class n{constructor(t){this.appInits=t,this.resolve=bE,this.reject=bE,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(Ef,8))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const a0=new Ht("AppId"),PZ={provide:a0,useFactory:function(){return`${eD()}${eD()}${eD()}`},deps:[]};function eD(){return String.fromCharCode(97+Math.floor(25*Math.random()))}const X3=new Ht("Platform Initializer"),Xc=new Ht("Platform ID"),IE=new Ht("appBootstrapListener");let OE=(()=>{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 Gu=new Ht("LocaleId"),K3=new Ht("DefaultCurrencyCode");class kZ{constructor(e,t){this.ngModuleFactory=e,this.componentFactories=t}}const tD=function(n){return new UM(n)},FZ=tD,LZ=function(n){return Promise.resolve(tD(n))},Q3=function(n){const e=tD(n),i=fl(No(n).declarations).reduce((r,s)=>{const o=Ui(s);return o&&r.push(new b3(o)),r},[]);return new kZ(e,i)},BZ=Q3,VZ=function(n){return Promise.resolve(Q3(n))};let xf=(()=>{class n{constructor(){this.compileModuleSync=FZ,this.compileModuleAsync=LZ,this.compileModuleAndAllComponentsSync=BZ,this.compileModuleAndAllComponentsAsync=VZ}clearCache(){}clearCacheFor(t){}getModuleId(t){}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const Z3=new Ht("compilerOptions"),UZ=(()=>Promise.resolve(0))();function nD(n){"undefined"==typeof Zone?UZ.then(()=>{n&&n.apply(null,null)}):Zone.current.scheduleMicroTask("scheduleMicrotask",n)}class pn{constructor({enableLongStackTrace:e=!1,shouldCoalesceEventChangeDetection:t=!1,shouldCoalesceRunChangeDetection:i=!1}){if(this.hasPendingMacrotasks=!1,this.hasPendingMicrotasks=!1,this.isStable=!0,this.onUnstable=new ln(!1),this.onMicrotaskEmpty=new ln(!1),this.onStable=new ln(!1),this.onError=new ln(!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=Zn.requestAnimationFrame,e=Zn.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(Zn,()=>{n.fakeTopEventTask||(n.fakeTopEventTask=Zone.root.scheduleEventTask("fakeTopEventTask",()=>{n.lastRequestAnimationFrameId=-1,rD(n),n.isCheckStableRunning=!0,iD(n),n.isCheckStableRunning=!1},void 0,()=>{},()=>{})),n.fakeTopEventTask.invoke()}),rD(n))}(n)};n._inner=n._inner.fork({name:"angular",properties:{isAngularZone:!0},onInvokeTask:(t,i,r,s,o,a)=>{try{return J3(n),t.invokeTask(r,s,o,a)}finally{(n.shouldCoalesceEventChangeDetection&&"eventTask"===s.type||n.shouldCoalesceRunChangeDetection)&&e(),eB(n)}},onInvoke:(t,i,r,s,o,a,l)=>{try{return J3(n),t.invoke(r,s,o,a,l)}finally{n.shouldCoalesceRunChangeDetection&&e(),eB(n)}},onHasTask:(t,i,r,s)=>{t.hasTask(r,s),i===r&&("microTask"==s.change?(n._hasPendingMicrotasks=s.microTask,rD(n),iD(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(!pn.isInAngularZone())throw new Error("Expected to be in Angular Zone, but it is not!")}static assertNotInAngularZone(){if(pn.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,HZ,bE,bE);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 HZ={};function iD(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 rD(n){n.hasPendingMicrotasks=!!(n._hasPendingMicrotasks||(n.shouldCoalesceEventChangeDetection||n.shouldCoalesceRunChangeDetection)&&-1!==n.lastRequestAnimationFrameId)}function J3(n){n._nesting++,n.isStable&&(n.isStable=!1,n.onUnstable.emit(null))}function eB(n){n._nesting--,iD(n)}class WZ{constructor(){this.hasPendingMicrotasks=!1,this.hasPendingMacrotasks=!1,this.isStable=!0,this.onUnstable=new ln,this.onMicrotaskEmpty=new ln,this.onStable=new ln,this.onError=new ln}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 sD=(()=>{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:()=>{pn.assertNotInAngularZone(),nD(()=>{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())nD(()=>{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(pn))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),tB=(()=>{class n{constructor(){this._applications=new Map,oD.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 oD.findTestabilityInTree(this,t,i)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();class qZ{addToWindow(e){}findTestabilityInTree(e,t,i){return null}}let oD=new qZ,nB=!0,iB=!1;function fa(){return iB=!0,nB}let ic;const rB=new Ht("AllowMultipleToken");function sB(n,e,t=[]){const i=`Platform: ${e}`,r=new Ht(i);return(s=[])=>{let o=lD();if(!o||o.injector.get(rB,!1))if(n)n(t.concat(s).concat({provide:r,useValue:!0}));else{const a=t.concat(s).concat({provide:r,useValue:!0},{provide:ju,useValue:"platform"});!function(n){if(ic&&!ic.destroyed&&!ic.injector.get(rB,!1))throw new Error("There can be only one platform. Destroy the previous one to create a new one.");ic=n.get(oB);const e=n.get(X3,null);e&&e.forEach(t=>t())}(Hn.create({providers:a,name:i}))}return function(n){const e=lD();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 lD(){return ic&&!ic.destroyed?ic:null}let oB=(()=>{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 WZ:("zone.js"===n?void 0:n)||new pn({enableLongStackTrace:fa(),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:pn,useValue:a}];return a.run(()=>{const c=Hn.create({providers:l,parent:this.injector,name:t.moduleType.name}),u=t.create(c),h=u.injector.get(la,null);if(!h)throw new Error("No ErrorHandler. Is platform module (BrowserModule) included?");return a.runOutsideAngular(()=>{const f=a.onError.subscribe({next:g=>{h.handleError(g)}});u.onDestroy(()=>{cD(this._modules,u),f.unsubscribe()})}),function(n,e,t){try{const i=t();return yg(i)?i.catch(r=>{throw e.runOutsideAngular(()=>n.handleError(r)),r}):i}catch(i){throw e.runOutsideAngular(()=>n.handleError(i)),i}}(h,a,()=>{const f=u.injector.get(Og);return f.runInitializers(),f.donePromise.then(()=>(bM(u.injector.get(Gu,pE)||pE),this._moduleDoBootstrap(u),u))})})}bootstrapModule(t,i=[]){const r=aB({},i);return function(n,e,t){const i=new UM(t);return Promise.resolve(i)}(0,0,t).then(s=>this.bootstrapModuleFactory(s,r))}_moduleDoBootstrap(t){const i=t.injector.get(sh);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 aB(n,e){return Array.isArray(e)?e.reduce(aB,n):Object.assign(Object.assign({},n),e)}let sh=(()=>{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 O(c=>{this._stable=this._zone.isStable&&!this._zone.hasPendingMacrotasks&&!this._zone.hasPendingMicrotasks,this._zone.runOutsideAngular(()=>{c.next(this._stable),c.complete()})}),l=new O(c=>{let u;this._zone.runOutsideAngular(()=>{u=this._zone.onStable.subscribe(()=>{pn.assertNotInAngularZone(),nD(()=>{!this._stable&&!this._zone.hasPendingMacrotasks&&!this._zone.hasPendingMicrotasks&&(this._stable=!0,c.next(!0))})})});const h=this._zone.onUnstable.subscribe(()=>{pn.assertInAngularZone(),this._stable&&(this._stable=!1,this._zone.runOutsideAngular(()=>{c.next(!1)}))});return()=>{u.unsubscribe(),h.unsubscribe()}});this.isStable=Nn(a,l.pipe(ws()))}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 FL?t:this._componentFactoryResolver.resolveComponentFactory(t),this.componentTypes.push(r.componentType);const s=function(n){return n.isBoundToModule}(r)?void 0:this._injector.get(Yc),a=r.create(Hn.NULL,[],i||r.selector,s),l=a.location.nativeElement,c=a.injector.get(sD,null),u=c&&a.injector.get(tB);return c&&u&&u.registerApplication(l,c),a.onDestroy(()=>{this.detachView(a.hostView),cD(this.components,a),u&&u.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;cD(this._views,i),i.detachFromAppRef()}_loadComponent(t){this.attachView(t.hostView),this.tick(),this.components.push(t),this._injector.get(IE,[]).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(pn),Ie(Hn),Ie(la),Ie(El),Ie(Og))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();function cD(n,e){const t=n.indexOf(e);t>-1&&n.splice(t,1)}const vJ=sB(null,"core",[{provide:Xc,useValue:"unknown"},{provide:oB,deps:[Hn]},{provide:tB,deps:[]},{provide:OE,deps:[]}]),CJ=[{provide:sh,useClass:sh,deps:[pn,Hn,la,El,Og]},{provide:OQ,deps:[pn],useFactory:function(n){let e=[];return n.onStable.subscribe(()=>{for(;e.length;)e.pop()()}),function(t){e.push(t)}}},{provide:Og,useClass:Og,deps:[[new ts,Ef]]},{provide:xf,useClass:xf,deps:[]},PZ,{provide:xg,useFactory:function(){return CK},deps:[]},{provide:Sg,useFactory:function(){return TK},deps:[]},{provide:Gu,useFactory:function(n){return bM(n=n||"undefined"!=typeof $localize&&$localize.locale||pE),n},deps:[[new Hd(Gu),new ts,new dl]]},{provide:K3,useValue:"USD"}];let AJ=(()=>{class n{constructor(t){}}return n.\u0275fac=function(t){return new(t||n)(Ie(sh))},n.\u0275mod=tn({type:n}),n.\u0275inj=St({providers:CJ}),n})(),zE=null;function Kc(){return zE}const fn=new Ht("DocumentToken");let Tf=(()=>{class n{historyGo(t){throw new Error("Not implemented")}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({factory:Tee,token:n,providedIn:"platform"}),n})();function Tee(){return Ie(kB)}let kB=(()=>{class n extends Tf{constructor(t){super(),this._doc=t,this._init()}_init(){this.location=window.location,this._history=window.history}getBaseHrefFromDOM(){return Kc().getBaseHref(this._doc)}onPopState(t){const i=Kc().getGlobalEventTarget(this._doc,"window");return i.addEventListener("popstate",t,!1),()=>i.removeEventListener("popstate",t)}onHashChange(t){const i=Kc().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){FB()?this._history.pushState(t,i,r):this.location.hash=r}replaceState(t,i,r){FB()?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(fn))},n.\u0275prov=We({factory:Mee,token:n,providedIn:"platform"}),n})();function FB(){return!!window.history.pushState}function Mee(){return new kB(Ie(fn))}function SD(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}function LB(n){const e=n.match(/#|\?|$/),t=e&&e.index||n.length;return n.slice(0,t-("/"===n[t-1]?1:0))+n.slice(t)}function Wu(n){return n&&"?"!==n[0]?"?"+n:n}let Ng=(()=>{class n{historyGo(t){throw new Error("Not implemented")}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({factory:Dee,token:n,providedIn:"root"}),n})();function Dee(n){const e=Ie(fn).location;return new BB(Ie(Tf),e&&e.origin||"")}const CD=new Ht("appBaseHref");let BB=(()=>{class n extends Ng{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 SD(this._baseHref,t)}path(t=!1){const i=this._platformLocation.pathname+Wu(this._platformLocation.search),r=this._platformLocation.hash;return r&&t?`${i}${r}`:i}pushState(t,i,r,s){const o=this.prepareExternalUrl(r+Wu(s));this._platformLocation.pushState(t,i,o)}replaceState(t,i,r,s){const o=this.prepareExternalUrl(r+Wu(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(Tf),Ie(CD,8))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),kg=(()=>{class n{constructor(t,i){this._subject=new ln,this._urlChangeListeners=[],this._platformStrategy=t;const r=this._platformStrategy.getBaseHref();this._platformLocation=i,this._baseHref=LB(VB(r)),this._platformStrategy.onPopState(s=>{this._subject.emit({url:this.path(!0),pop:!0,state:s.state,type:s.type})})}path(t=!1){return this.normalize(this._platformStrategy.path(t))}getState(){return this._platformLocation.getState()}isCurrentPathEqualTo(t,i=""){return this.path()==this.normalize(t+Wu(i))}normalize(t){return n.stripTrailingSlash(function(n,e){return n&&e.startsWith(n)?e.substring(n.length):e}(this._baseHref,VB(t)))}prepareExternalUrl(t){return t&&"/"!==t[0]&&(t="/"+t),this._platformStrategy.prepareExternalUrl(t)}go(t,i="",r=null){this._platformStrategy.pushState(r,"",t,i),this._notifyUrlChangeListeners(this.prepareExternalUrl(t+Wu(i)),r)}replaceState(t,i="",r=null){this._platformStrategy.replaceState(r,"",t,i),this._notifyUrlChangeListeners(this.prepareExternalUrl(t+Wu(i)),r)}forward(){this._platformStrategy.forward()}back(){this._platformStrategy.back()}historyGo(t=0){var i,r;null===(r=(i=this._platformStrategy).historyGo)||void 0===r||r.call(i,t)}onUrlChange(t){this._urlChangeListeners.push(t),this._urlChangeSubscription||(this._urlChangeSubscription=this.subscribe(i=>{this._notifyUrlChangeListeners(i.url,i.state)}))}_notifyUrlChangeListeners(t="",i){this._urlChangeListeners.forEach(r=>r(t,i))}subscribe(t,i,r){return this._subject.subscribe({next:t,error:i,complete:r})}}return n.\u0275fac=function(t){return new(t||n)(Ie(Ng),Ie(Tf))},n.normalizeQueryParams=Wu,n.joinWithSlash=SD,n.stripTrailingSlash=LB,n.\u0275prov=We({factory:Oee,token:n,providedIn:"root"}),n})();function Oee(){return new kg(Ie(Ng),Ie(Tf))}function VB(n){return n.replace(/\/index.html$/,"")}var ms=(()=>((ms=ms||{})[ms.Zero=0]="Zero",ms[ms.One=1]="One",ms[ms.Two=2]="Two",ms[ms.Few=3]="Few",ms[ms.Many=4]="Many",ms[ms.Other=5]="Other",ms))();const Vee=function(n){return function(n){const e=function(n){return n.toLowerCase().replace(/_/g,"-")}(n);let t=uL(e);if(t)return t;const i=e.split("-")[0];if(t=uL(i),t)return t;if("en"===i)return iX;throw new Error(`Missing locale data for the locale "${n}".`)}(n)[un.PluralCase]};class ZE{}let pte=(()=>{class n extends ZE{constructor(t){super(),this.locale=t}getPluralCategory(t,i){switch(Vee(i||this.locale)(t)){case ms.Zero:return"zero";case ms.One:return"one";case ms.Two:return"two";case ms.Few:return"few";case ms.Many:return"many";default:return"other"}}}return n.\u0275fac=function(t){return new(t||n)(Ie(Gu))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();function YB(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}class mte{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 Yu=(()=>{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 mte(null,this._ngForOf,-1,-1),null===o?void 0:o),l=new XB(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 XB(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)(Ce(Rs),Ce(Go),Ce(xg))},n.\u0275dir=Nt({type:n,selectors:[["","ngFor","","ngForOf",""]],inputs:{ngForOf:"ngForOf",ngForTrackBy:"ngForTrackBy",ngForTemplate:"ngForTemplate"}}),n})();class XB{constructor(e,t){this.record=e,this.view=t}}let ac=(()=>{class n{constructor(t,i){this._viewContainer=t,this._context=new yte,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){KB("ngIfThen",t),this._thenTemplateRef=t,this._thenViewRef=null,this._updateView()}set ngIfElse(t){KB("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)(Ce(Rs),Ce(Go))},n.\u0275dir=Nt({type:n,selectors:[["","ngIf",""]],inputs:{ngIf:"ngIf",ngIfThen:"ngIfThen",ngIfElse:"ngIfElse"}}),n})();class yte{constructor(){this.$implicit=null,this.ngIf=null}}function KB(n,e){if(e&&!e.createEmbeddedView)throw new Error(`${n} must be a TemplateRef, but received '${rt(e)}'.`)}class Ete{createSubscription(e,t){return e.subscribe({next:t,error:i=>{throw i}})}dispose(e){e.unsubscribe()}onDestroy(e){e.unsubscribe()}}class xte{createSubscription(e,t){return e.then(t,i=>{throw i})}dispose(e){}onDestroy(e){}}const Ste=new xte,Cte=new Ete;let g0=(()=>{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(yg(t))return Ste;if(x2(t))return Cte;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)(Ce(Mr,16))},n.\u0275pipe=js({name:"async",type:n,pure:!1}),n})(),fr=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=tn({type:n}),n.\u0275inj=St({providers:[{provide:ZE,useClass:pte}]}),n})();const iV="browser";function Af(n){return n===iV}class oV{}class BD extends class extends class{}{constructor(){super(...arguments),this.supportsDOMEvents=!0}}{static makeCurrent(){!function(n){zE||(zE=n)}(new BD)}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=(m0=m0||document.querySelector("base"),m0?m0.getAttribute("href"):null);return null==t?null:function(n){ex=ex||document.createElement("a"),ex.setAttribute("href",n);const e=ex.pathname;return"/"===e.charAt(0)?e:`/${e}`}(t)}resetBaseElement(){m0=null}getUserAgent(){return window.navigator.userAgent}getCookie(e){return YB(document.cookie,e)}}let ex,m0=null;const aV=new Ht("TRANSITION_ID"),Xte=[{provide:Ef,useFactory:function(n,e,t){return()=>{t.get(Og).donePromise.then(()=>{const i=Kc(),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},Zn.getAllAngularTestabilities=()=>e.getAllTestabilities(),Zn.getAllAngularRootElements=()=>e.getAllRootElements(),Zn.frameworkStabilizers||(Zn.frameworkStabilizers=[]),Zn.frameworkStabilizers.push(i=>{const r=Zn.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?Kc().isShadowRoot(t)?this.findTestabilityInTree(e,t.host,!0):this.findTestabilityInTree(e,t.parentElement,!0):null}}let Kte=(()=>{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 _0=new Ht("EventManagerPlugins");let nx=(()=>{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})(),y0=(()=>{class n extends cV{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(uV),this._hostNodes.delete(t)}onStylesAdded(t){this._hostNodes.forEach((i,r)=>{this._addStylesToHost(t,r,i)})}ngOnDestroy(){this._hostNodes.forEach(t=>t.forEach(uV))}}return n.\u0275fac=function(t){return new(t||n)(Ie(fn))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();function uV(n){Kc().remove(n)}const UD={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/"},zD=/%COMP%/g;function ix(n,e,t){for(let i=0;i{if("__ngUnwrap__"===e)return n;!1===n(e)&&(e.preventDefault(),e.returnValue=!1)}}let rx=(()=>{class n{constructor(t,i,r){this.eventManager=t,this.sharedStylesHost=i,this.appId=r,this.rendererByCompId=new Map,this.defaultRenderer=new HD(t)}createRenderer(t,i){if(!t||!i)return this.defaultRenderer;switch(i.encapsulation){case Xt.Emulated:{let r=this.rendererByCompId.get(i.id);return r||(r=new dne(this.eventManager,this.sharedStylesHost,i,this.appId),this.rendererByCompId.set(i.id,r)),r.applyToHost(t),r}case 1:case Xt.ShadowDom:return new hne(this.eventManager,this.sharedStylesHost,t,i);default:if(!this.rendererByCompId.has(i.id)){const r=ix(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(nx),Ie(y0),Ie(a0))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();class HD{constructor(e){this.eventManager=e,this.data=Object.create(null)}destroy(){}createElement(e,t){return t?document.createElementNS(UD[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=UD[r];s?e.setAttributeNS(s,t,i):e.setAttribute(t,i)}else e.setAttribute(t,i)}removeAttribute(e,t,i){if(i){const r=UD[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&(Uo.DashCase|Uo.Important)?e.style.setProperty(t,i,r&Uo.Important?"important":""):e.style[t]=i}removeStyle(e,t,i){i&Uo.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,fV(i)):this.eventManager.addEventListener(e,t,fV(i))}}class dne extends HD{constructor(e,t,i,r){super(e),this.component=i;const s=ix(r+"-"+i.id,i.styles,[]);t.addStyles(s),this.contentAttr=function(n){return"_ngcontent-%COMP%".replace(zD,n)}(r+"-"+i.id),this.hostAttr=function(n){return"_nghost-%COMP%".replace(zD,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 hne extends HD{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=ix(r.id,r.styles,[]);for(let o=0;o{class n extends jD{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(fn))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const mV=["alt","control","meta","shift"],vne={"\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"},_V={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"},wne={alt:n=>n.altKey,control:n=>n.ctrlKey,meta:n=>n.metaKey,shift:n=>n.shiftKey};let Ene=(()=>{class n extends jD{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(()=>Kc().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(mV.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&&_V.hasOwnProperty(e)&&(e=_V[e]))}return vne[e]||e}(t);return r=r.toLowerCase()," "===r?r="space":"."===r&&(r="dot"),mV.forEach(s=>{s!=r&&wne[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(fn))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),Mf=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({factory:function(){return Ie($D)},token:n,providedIn:"root"}),n})(),$D=(()=>{class n extends Mf{constructor(t){super(),this._doc=t}sanitize(t,i){if(null==i)return null;switch(t){case si.NONE:return i;case si.HTML:return sa(i,"HTML")?Gs(i):$_(this._doc,String(i)).toString();case si.STYLE:return sa(i,"Style")?Gs(i):i;case si.SCRIPT:if(sa(i,"Script"))return Gs(i);throw new Error("unsafe value used in a script context");case si.URL:return jc(i),sa(i,"URL")?Gs(i):jo(String(i));case si.RESOURCE_URL:if(sa(i,"ResourceURL"))return Gs(i);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(n){return new L_(n)}(t)}bypassSecurityTrustStyle(t){return function(n){return new B_(n)}(t)}bypassSecurityTrustScript(t){return function(n){return new jp(n)}(t)}bypassSecurityTrustUrl(t){return function(n){return new Wd(n)}(t)}bypassSecurityTrustResourceUrl(t){return function(n){return new kn(n)}(t)}}return n.\u0275fac=function(t){return new(t||n)(Ie(fn))},n.\u0275prov=We({factory:function(){return function(n){return new $D(n.get(fn))}(Ie(Vu))},token:n,providedIn:"root"}),n})();const Ine=sB(vJ,"browser",[{provide:Xc,useValue:iV},{provide:X3,useValue:function(){BD.makeCurrent(),VD.init()},multi:!0},{provide:fn,useFactory:function(){return function(n){Yi=n}(document),document},deps:[]}]),One=[[],{provide:ju,useValue:"root"},{provide:la,useFactory:function(){return new la},deps:[]},{provide:_0,useClass:fne,multi:!0,deps:[fn,pn,Xc]},{provide:_0,useClass:Ene,multi:!0,deps:[fn]},[],{provide:rx,useClass:rx,deps:[nx,y0,a0]},{provide:yf,useExisting:rx},{provide:cV,useExisting:y0},{provide:y0,useClass:y0,deps:[fn]},{provide:sD,useClass:sD,deps:[pn]},{provide:nx,useClass:nx,deps:[_0,pn]},{provide:oV,useClass:Kte,deps:[]},[]];let WD=(()=>{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:a0,useValue:t.appId},{provide:aV,useExisting:a0},Xte]}}}return n.\u0275fac=function(t){return new(t||n)(Ie(n,12))},n.\u0275mod=tn({type:n}),n.\u0275inj=St({providers:One,imports:[fr,AJ]}),n})();"undefined"!=typeof window&&window;class Vne extends C{constructor(e,t){super()}schedule(e,t=0){return this}}class sx extends Vne{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 bV=(()=>{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 cc extends bV{constructor(e,t=bV.now){super(e,()=>cc.delegate&&cc.delegate!==this?cc.delegate.now():t()),this.actions=[],this.active=!1,this.scheduled=void 0}schedule(e,t=0,i){return cc.delegate&&cc.delegate!==this?cc.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 zne=new class extends cc{}(class extends sx{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)}}),Qc=new O(n=>n.complete());function b0(n){return n?function(n){return new O(e=>n.schedule(()=>e.complete()))}(n):Qc}function sn(...n){let e=n[n.length-1];return Te(e)?(n.pop(),ke(n,e)):In(n)}function Fg(n,e){return new O(e?t=>e.schedule(Gne,0,{error:n,subscriber:t}):t=>t.error(n))}function Gne({error:n,subscriber:e}){e.error(n)}class ga{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 sn(this.value);case"E":return Fg(this.error);case"C":return b0()}throw new Error("unexpected notification kind value")}static createNext(e){return void 0!==e?new ga("N",e):ga.undefinedValueNotification}static createError(e){return new ga("E",void 0,e)}static createComplete(){return ga.completeNotification}}ga.completeNotification=new ga("C"),ga.undefinedValueNotification=new ga("N",void 0);class ox 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(ox.dispatch,this.delay,new Wne(e,this.destination)))}_next(e){this.scheduleMessage(ga.createNext(e))}_error(e){this.scheduleMessage(ga.createError(e)),this.unsubscribe()}_complete(){this.scheduleMessage(ga.createComplete()),this.unsubscribe()}}class Wne{constructor(e,t){this.notification=e,this.destination=t}}class Df extends oe{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 qne(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 $;if(this.isStopped||this.hasError?o=C.EMPTY:(this.observers.push(e),o=new Z(this,e)),r&&e.add(e=new ox(e,r)),t)for(let a=0;at&&(o=Math.max(o,s-t)),o>0&&r.splice(0,o),r}}class qne{constructor(e,t){this.time=e,this.value=t}}function is(n,e){return"function"==typeof e?t=>t.pipe(is((i,r)=>je(n(i,r)).pipe(me((s,o)=>e(i,s,r,o))))):t=>t.lift(new Yne(n))}class Yne{constructor(e){this.project=e}call(e,t){return t.subscribe(new Xne(e,this.project))}}class Xne extends we{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 _t(this),r=this.destination;r.add(i),this.innerSubscription=N(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 ax={schedule(n,e){const t=setTimeout(n,e);return()=>clearTimeout(t)},scheduleBeforeRender(n){if("undefined"==typeof window)return ax.schedule(n,0);if(void 0===window.requestAnimationFrame)return ax.schedule(n,16);const e=window.requestAnimationFrame(n);return()=>window.cancelAnimationFrame(e)}};let YD;function sie(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(!YD){const t=Element.prototype;YD=t.matches||t.matchesSelector||t.mozMatchesSelector||t.msMatchesSelector||t.oMatchesSelector||t.webkitMatchesSelector}return n.nodeType===Node.ELEMENT_NODE&&YD.call(n,e)}(n,r)||(i=s,0))),i}class aie{constructor(e,t){this.componentFactory=t.get(El).resolveComponentFactory(e)}create(e){return new lie(this.componentFactory,e)}}class lie{constructor(e,t){this.componentFactory=e,this.injector=t,this.eventEmitters=new Df(1),this.events=this.eventEmitters.pipe(is(i=>Nn(...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(pn),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=ax.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=ax.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 c_(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 cie extends HTMLElement{constructor(){super(...arguments),this.ngElementEventsSubscription=null}}const die={initialConfig:{},parse:{},rename:{}};class hie{constructor(e,t){this.configState=e,this.storedChanges={},this.options=Object.assign(Object.assign({},die),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,u=null!==(s=o[e])&&void 0!==s?s:o[l];if(null==c)delete i[l];else if(u)try{i[l]=u(c)}catch(h){console.warn(`Failed to parse ${e} = ${c}`,h.message)}else i[l]=c}}let fie=(()=>{class n{constructor(t,i,r={}){this.configState=t,this.cdr=i,this.options=r,this.initialized=!1,this.configManager=new hie(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=Nt({type:n,features:[Fi]}),n})();const XD={boolean:n=>"false"!=`${n}`,json:n=>"string"==typeof n?JSON.parse(n):n,function:n=>{if("function"!=typeof n)throw new Error("Expected a javascript function");return n}};var KD;const If={production:!0,disableDbWorker:!0,acceptableViewerDomains:["https://portal.hubmapconsortium.org","https://portal.test.hubmapconsortium.org"],dbOptions:{ccfOwlUrl:"https://r5i95k35v5.us-east-2.awsapprunner.com/v1/ccf.owl.n3store.json",ccfContextUrl:"https://hubmapconsortium.github.io/ccf-ontology/ccf-context.jsonld",dataSources:["https://cdn.jsdelivr.net/gh/hubmapconsortium/ccf-ui@staging/assets/kpmp/data/rui_locations.jsonld","https://cdn.jsdelivr.net/gh/hubmapconsortium/ccf-ui@staging/assets/sparc/data/rui_locations.jsonld"],hubmapDataService:"",hubmapPortalUrl:"",hubmapDataUrl:"",hubmapAssetsUrl:"",hubmapToken:null!==(KD=localStorage.getItem("HUBMAP_TOKEN"))&&void 0!==KD?KD:"",useRemoteApi:!1,remoteApiEndpoint:"https://r5i95k35v5.us-east-2.awsapprunner.com/v1"},googleAnalyticsToken:"G-ERNVZ1Q4KE"};function Ei(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 wV(n,e){return function(t,i){e(t,i,n)}}function uc(n,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(n,e)}function Bi(n,e,t,i){return new(t||(t=Promise))(function(s,o){function a(u){try{c(i.next(u))}catch(h){o(h)}}function l(u){try{c(i.throw(u))}catch(h){o(h)}}function c(u){u.done?s(u.value):function(s){return s instanceof t?s:new t(function(o){o(s)})}(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})}function SV(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 ZD(){return!("object"==typeof process&&"[object process]"===String(process)&&!process.browser)||SV()}const CV="undefined"!=typeof __VERSION__?__VERSION__:"untranspiled source",cx=ZD();class _ie{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 JD(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 TV={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 AV(n){return"string"==typeof n?TV[n.toUpperCase()]||TV.WHITE:n}function ux(n,e){if(!n)throw new Error(e||"Assertion failed")}const dc={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},v0=dc.window||dc.self||dc.global,MV=dc.process||{};function Lg(){let n;if(cx&&v0.performance)n=v0.performance.now();else if(MV.hrtime){const e=MV.hrtime();n=1e3*e[0]+e[1]/1e6}else n=Date.now();return n}console;const Bg={debug:cx&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},Sie={enabled:!0,level:0};function Al(){}const DV={},IV={once:!0};function Cie(n){for(const e in n)for(const t in n[e])return t||"untitled";return"empty"}let eI=(()=>{class n{constructor({id:t}={id:""}){this.id=t,this.VERSION=CV,this._startTs=Lg(),this._deltaTs=Lg(),this.LOG_THROTTLE_TIMEOUT=0,this._storage=new _ie("__probe-".concat(this.id,"__"),Sie),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((Lg()-this._startTs).toPrecision(10))}getDelta(){return Number((Lg()-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){ux(t,i)}warn(t){return this._getLogFunction(0,t,Bg.warn,arguments,IV)}error(t){return this._getLogFunction(0,t,Bg.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,Bg.log,arguments,{time:!0,once:!0})}log(t,i){return this._getLogFunction(t,i,Bg.debug,arguments)}info(t,i){return this._getLogFunction(t,i,console.info,arguments)}once(t,i){return this._getLogFunction(t,i,Bg.debug||Bg.info,arguments,IV)}table(t,i,r){return i?this._getLogFunction(t,i,console.table||Al,r&&[r],{tag:Cie(i)}):Al}image({logLevel:t,priority:i,image:r,message:s="",scale:o=1}){return this._shouldLog(t||i)?cx?function({image:n,message:e="",scale:t=1}){if("string"==typeof n){const r=new Image;return r.onload=()=>{const s=JD(r,e,t);console.log(...s)},r.src=n,Al}const i=n.nodeName||"";if("img"===i.toLowerCase())return console.log(...JD(n,e,t)),Al;if("canvas"===i.toLowerCase()){const r=new Image;return r.onload=()=>console.log(...JD(r,e,t)),r.src=n.toDataURL(),Al}return Al}({image:r,message:s,scale:o}):function({image:n,message:e="",scale:t=1}){let i=null;try{i=et(5307)}catch(r){}return i?()=>i(n,{fit:"box",width:"".concat(Math.round(80*t),"%")}).then(r=>console.log(r)):Al}({image:r,message:s,scale:o}):Al}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||Al)}group(t,i,r={collapsed:!1}){r=RV({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||Al)}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()>=OV(t)}_getLogFunction(t,i,r,s=[],o){if(this._shouldLog(t)){o=RV({logLevel:t,message:i,args:s,opts:o}),ux(r=r||o.method),o.total=this.getTotal(),o.delta=this.getDelta(),this._deltaTs=Lg();const a=o.tag||o.message;if(o.once){if(DV[a])return Al;DV[a]=Lg()}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!cx&&"string"==typeof n&&(e&&(e=AV(e),n="\x1b[".concat(e,"m").concat(n,"\x1b[39m")),t&&(e=AV(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 Al}}return n.VERSION=CV,n})();function OV(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 ux(Number.isFinite(e)&&e>=0),e}function RV(n){const{logLevel:e,message:t}=n;n.logLevel=OV(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 ux("string"===r||"object"===r),Object.assign(n,n.opts)}const Ri=new eI({id:"deck"}),Vi={DEFAULT:-1,LNGLAT:1,METER_OFFSETS:2,LNGLAT_OFFSETS:3,CARTESIAN:0};Object.defineProperty(Vi,"IDENTITY",{get:()=>Ri.deprecated("COORDINATE_SYSTEM.IDENTITY","COORDINATE_SYSTEM.CARTESIAN")()||0});const Zc={WEB_MERCATOR:1,GLOBE:2,WEB_MERCATOR_AUTO_OFFSET:4,IDENTITY:0},PV={click:{handler:"onClick"},panstart:{handler:"onDragStart"},panmove:{handler:"onDrag"},panend:{handler:"onDragEnd"}},mn=new eI({id:"luma.gl"});function qo(n,e){if(!n)throw new Error(e||"luma.gl: assertion failed.")}function dx(n){return"undefined"!=typeof WebGLRenderingContext&&n instanceof WebGLRenderingContext||"undefined"!=typeof WebGL2RenderingContext&&n instanceof WebGL2RenderingContext||Boolean(n&&Number.isFinite(n._version))}function Ci(n){return"undefined"!=typeof WebGL2RenderingContext&&n instanceof WebGL2RenderingContext||Boolean(n&&2===n._version)}function hx(n){return qo(dx(n),"Invalid WebGLRenderingContext"),n}function Ao(n){return qo(Ci(n),"Requires WebGL2"),n}const w0={};const E0=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{globalThis.console&&globalThis.console.log&&globalThis.console.log("OESVertexArrayObject emulation library context restored"),t.reset_()},!0),this.reset_()};Of.prototype.VERTEX_ARRAY_BINDING_OES=34229,Of.prototype.reset_=function(){if(void 0!==this.vertexArrayObjects)for(let i=0;iCi(n)?void 0:0,Wie={3074:n=>Ci(n)?void 0:36064,35723:n=>Ci(n)?void 0:4352,35977:br,32937:br,36795:(n,e)=>{const t=Ci(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(FV);return e(t&&t.UNMASKED_VENDOR_WEBGL||7936)},37446:(n,e)=>{const t=n.getExtension(FV);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:br,35071:br,37447:br,36063:(n,e)=>{if(!Ci(n)){const t=n.getExtension(kV);return t?e(t.MAX_COLOR_ATTACHMENTS_WEBGL):0}},35379:br,35374:br,35377:br,34852:n=>{if(!Ci(n)){const e=n.getExtension(kV);return e?e.MAX_DRAW_BUFFERS_WEBGL:0}},36203:n=>n.getExtension(NV)?2147483647:65535,33001:n=>n.getExtension(NV)?16777216:65535,33e3:n=>16777216,37157:br,35373:br,35657:br,36183:br,37137:br,34045:br,35978:br,35979:br,35968:br,35376:br,35375:br,35659:br,37154:br,35371:br,35658:br,35076:br,35077:br,35380:br},LV="ANGLE_instanced_arrays",BV={OES_vertex_array_object:{meta:{suffix:"OES"},createVertexArray:()=>{qo(!1,"VertexArray requires WebGL2 or OES_vertex_array_object extension")},deleteVertexArray:()=>{},bindVertexArray:()=>{},isVertexArray:()=>!1},[LV]:{meta:{suffix:"ANGLE"},vertexAttribDivisor(n,e){qo(0===e,"WebGL instanced rendering not supported")},drawElementsInstanced:()=>{},drawArraysInstanced:()=>{}},WEBGL_draw_buffers:{meta:{suffix:"WEBGL"},drawBuffers:()=>{qo(!1)}},EXT_disjoint_timer_query:{meta:{suffix:"EXT"},createQuery:()=>{qo(!1)},deleteQuery:()=>{qo(!1)},beginQuery:()=>{qo(!1)},endQuery:()=>{},getQuery(n,e){return this.getQueryObject(n,e)},getQueryParameter(n,e){return this.getQueryObject(n,e)},getQueryObject:()=>{}}},tI={readBuffer:(n,e,t)=>{Ci(n)&&e(t)},getVertexAttrib:(n,e,t,i)=>{const{webgl2:r,ext:s}=function(n,e){return{webgl2:Ci(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(!Ci(n))switch(i){case 35967:return 35981;case 35971:case 35382:return 0}return e(t,i)},getInternalformatParameter:(n,e,t,i,r)=>{if(!Ci(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=Wie[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 rre(n,{extension:e,target:t,target2:i}){const r=BV[e];qo(r);const{meta:s={}}=r,{suffix:o=""}=s,a=n.getExtension(e);for(const l of Object.keys(r)){const c=`${l}${o}`;let u=null;"meta"===l||"function"==typeof n[l]||(a&&"function"==typeof a[c]?u=(...h)=>a[c](...h):"function"==typeof r[l]&&(u=r[l].bind(t))),u&&(t[l]=u,i[l]=u)}}globalThis.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 Of(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&&rre(n,{extension:t,target:n.luma,target2:n})}(n,BV),function(n,{target:e,target2:t}){Object.keys(tI).forEach(i=>{if("function"==typeof tI[i]){const r=n[i]?n[i].bind(n):()=>{},s=tI[i].bind(null,n,r);e[i]=s,t[i]=s}})}(n,{target:e,target2:n}),e.polyfilled=!0),n};const nI={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},lh=(n,e,t)=>e?n.enable(t):n.disable(t),VV=(n,e,t)=>n.hint(t,e),ja=(n,e,t)=>n.pixelStorei(t,e);function x0(n){return Array.isArray(n)||ArrayBuffer.isView(n)}const are={3042:lh,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:lh,2885:(n,e)=>n.cullFace(e),2929:lh,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:lh,35723:VV,36006:(n,e)=>{const t=Ci(n)?36009:36160;return n.bindFramebuffer(t,e)},2886:(n,e)=>n.frontFace(e),33170:VV,2849:(n,e)=>n.lineWidth(e),32823:lh,32824:"polygonOffset",10752:"polygonOffset",35977:lh,32938:"sampleCoverage",32939:"sampleCoverage",3089:lh,3088:(n,e)=>n.scissor(...e),2960:lh,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:ja,3317:ja,37440:ja,37441:ja,37443:ja,3330:ja,3332:ja,3331:ja,36010:(n,e)=>n.bindFramebuffer(36008,e),3314:ja,32878:ja,3316:ja,3315:ja,32877:ja,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=x0(e)?e:[e,e],n.blendEquationSeparate(...e)},blendFunc:(n,e)=>{e=x0(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=x0(e)?e:[e,e];const[t,i]=e;n.stencilMaskSeparate(1028,t),n.stencilMaskSeparate(1029,i)},stencilFunc:(n,e)=>{e=x0(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=x0(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 rs(n,e,t){return void 0!==e[n]?e[n]:t[n]}const lre={blendEquation:(n,e,t)=>n.blendEquationSeparate(rs(32777,e,t),rs(34877,e,t)),blendFunc:(n,e,t)=>n.blendFuncSeparate(rs(32969,e,t),rs(32968,e,t),rs(32971,e,t),rs(32970,e,t)),polygonOffset:(n,e,t)=>n.polygonOffset(rs(32824,e,t),rs(10752,e,t)),sampleCoverage:(n,e,t)=>n.sampleCoverage(rs(32938,e,t),rs(32939,e,t)),stencilFuncFront:(n,e,t)=>n.stencilFuncSeparate(1028,rs(2962,e,t),rs(2967,e,t),rs(2963,e,t)),stencilFuncBack:(n,e,t)=>n.stencilFuncSeparate(1029,rs(34816,e,t),rs(36003,e,t),rs(36004,e,t)),stencilOpFront:(n,e,t)=>n.stencilOpSeparate(1028,rs(2964,e,t),rs(2965,e,t),rs(2966,e,t)),stencilOpBack:(n,e,t)=>n.stencilOpSeparate(1029,rs(34817,e,t),rs(34818,e,t),rs(34819,e,t))},jV={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]})},Jc=(n,e)=>n.isEnabled(e),UV={3042:Jc,2884:Jc,2929:Jc,3024:Jc,32823:Jc,32926:Jc,32928:Jc,3089:Jc,2960:Jc,35977:Jc};function zV(n){for(const e in n)return!1;return!0}function cre(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||nI)){const r=e,s=UV[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=UV[r];i[r]=s?s(n,Number(r)):n.getParameter(Number(r))}return i}(e):Object.assign({},nI),this.log=i,this._updateCache=this._updateCache.bind(this),Object.seal(this)}push(e={}){this.stateStack.push({})}pop(){qo(this.stateStack.length>0),Xu(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){qo(void 0!==s);const o=e[s],a=this.cache[s];cre(o,a)||(t=!0,i=a,r&&!(s in r)&&(r[s]=a),this.cache[s]=o)}return{valueChanged:t,oldValue:i}}}function GV(n,e={}){const{enable:t=!0,copyState:i}=e;if(qo(void 0!==i),!n.state){const{polyfillContext:r}=globalThis;r&&r(n),n.state=new hre(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 s in jV)ure(n,s,jV[s]);HV(n,"getParameter"),HV(n,"isEnabled")}return n.state.enable=t,n}function $V(n){qo(n.state),n.state.pop()}function Xu(n,e){if(qo(dx(n),"setParameters requires a WebGL context"),zV(e))return;const t={};for(const r in e){const s=Number(r),o=are[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)lre[r](n,e,i)}function hc(n,e,t){if(zV(e))return t(n);const{nocatch:i=!0}=e;let r;if(function(n){n.state||GV(n,{copyState:!1}),n.state.push()}(n),Xu(n,e),i)r=t(n),$V(n);else try{r=t(n)}finally{$V(n)}return r}function fx(){return!("object"==typeof process&&"[object process]"===String(process)&&!process.browser)||function(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;return!!(e&&e.indexOf("Electron")>=0)}()}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 iI(n,e,t=!0){return function(n,e,t,i,r){const s=WV(n[0],e,t);let o=qV(n[1],e,i,r),a=WV(n[0]+1,e,t);const l=a===t-1?a:a-1;let c;return a=qV(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 WV(n,e,t){return Math.min(Math.round(n*e),t-1)}function qV(n,e,t,i){return i?Math.max(0,t-1-Math.round(n*e)):Math.min(Math.round(n*e),t-1)}const rI=fx(),bre=rI&&"undefined"!=typeof document,YV={webgl2:!0,webgl1:!0,throwOnError:!0,manageState:!0,canvas:null,debug:!1,width:800,height:600};function XV(n={}){qo(rI,"createGLContext only available in the browser.\nCreate your own headless context or use 'createHeadlessContext' from @luma.gl/test-utils"),n=Object.assign({},YV,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?(bre&&"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=sI(r,n),function(n){const e=Ci(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);mn.info(1,`${e}${n.debug?" debug":""} context ${t?`(${t.vendor},${t.renderer})`:""}`)()}(r),r):null}function sI(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({},YV,e);const{manageState:t,debug:i}=e;return t&&GV(n,{copyState:!1,log:(...r)=>mn.log(1,...r)()}),rI&&i&&(globalThis.makeDebugContext?(n=globalThis.makeDebugContext(n,e),mn.level=Math.max(mn.level,1)):mn.warn('WebGL debug mode not activated. import "@luma.gl/debug" to enable.')()),n._instrumented=!0,n}function KV(){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 QV{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=KV(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(KV()-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 oI{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 QV?e:new QV(t,i)),this.stats[t]}}const S0="8.5.12",Rf=new class{constructor(){this.stats=new Map}get(e){return this.stats.has(e)||this.stats.set(e,new oI({id:e})),this.stats.get(e)}};if(globalThis.luma&&globalThis.luma.VERSION!==S0)throw new Error(`luma.gl - multiple VERSIONs detected: ${globalThis.luma.VERSION} vs ${S0}`);function on(n,e){if(!n)throw new Error(e||"luma.gl: assertion failed.")}function aI(n,e){if("string"!=typeof e)return e;const t=Number(e);if(!isNaN(t))return t;const i=n[e=e.replace(/^.*\./,"")];return on(void 0!==i,`Accessing undefined constant GL.${e}`),i}function ch(n,e){e=Number(e);for(const t in n)if(n[t]===e)return`GL.${t}`;return String(e)}globalThis.luma||(fx()&&mn.log(1,`luma.gl ${S0} - set luma.log.level=1 (or higher) to trace rendering`)(),globalThis.luma=globalThis.luma||{VERSION:S0,version:S0,log:mn,stats:Rf,globals:{modules:{},nodeIO:{}}}),globalThis;const lI={};function ma(n="id"){return lI[n]=lI[n]||1,`${n}-${lI[n]++}`}function ZV(n){return on("number"==typeof n,"Input must be a number"),n&&0==(n&n-1)}function jg(n){let e=!0;for(const t in n){e=!1;break}return e}function JV(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 mn.removed(`Calling removed method ${e}.${o}: `,r)(),new Error(o)})})}const Ug="Resource subclass must define virtual methods";class Ku{get[Symbol.toStringTag](){return"Resource"}constructor(e,t={}){hx(e);const{id:i,userData:r={}}=t;this.gl=e,this.gl2=e,this.id=i||ma(this[Symbol.toStringTag]),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[Symbol.toStringTag]||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={}){on(e=aI(this.gl,e));const r=(this.constructor.PARAMETERS||{})[e];if(r){const s=Ci(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=Ci(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 h=i?ch(this.gl,l):l;o[h]=this.getParameter(l,e),i&&"GLenum"===c.type&&(o[h]=ch(this.gl,o[h]))}}return o}setParameter(e,t){on(e=aI(this.gl,e));const r=(this.constructor.PARAMETERS||{})[e];if(r){const s=Ci(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=aI(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 JV(this,e,t,i)}initialize(e){}_createHandle(){throw new Error(Ug)}_deleteHandle(){throw new Error(Ug)}_bindHandle(e){throw new Error(Ug)}_getOptsFromHandle(){throw new Error(Ug)}_getParameter(e,t){throw new Error(Ug)}_setParameter(e,t){throw new Error(Ug)}_context(){return this.gl.luma=this.gl.luma||{},this.gl.luma}_addStats(){const e=this[Symbol.toStringTag],t=Rf.get("Resource Counts");t.get("Resources Created").incrementCount(),t.get(`${e}s Created`).incrementCount(),t.get(`${e}s Active`).incrementCount()}_removeStats(){const e=this[Symbol.toStringTag];Rf.get("Resource Counts").get(`${e}s Active`).decrementCount()}_trackAllocatedMemory(e,t=this[Symbol.toStringTag]){const i=Rf.get("Memory Usage");i.get("GPU Memory").addCount(e),i.get(`${t} Memory`).addCount(e),this.byteLength=e}_trackDeallocatedMemory(e=this[Symbol.toStringTag]){const t=Rf.get("Memory Usage");t.get("GPU Memory").subtractCount(this.byteLength),t.get(`${e} Memory`).subtractCount(this.byteLength),this.byteLength=0}}function cI(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 C0(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 Ore({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 _a.getBytesPerElement(this)}get BYTES_PER_VERTEX(){return _a.getBytesPerVertex(this)}_assign(e={}){return void 0!==(e=uI("Accessor",e,Pre)).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"},Nre={removedProps:{},replacedProps:{bytes:"byteLength"},deprecatedProps:tj},kre={removedProps:tj};class lr extends Ku{get[Symbol.toStringTag](){return"Buffer"}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/_a.getBytesPerElement(e))}getVertexCount(e=this.accessor){return Math.round(this.byteLength/_a.getBytesPerVertex(e))}initialize(e={}){return ArrayBuffer.isView(e)&&(e={data:e}),Number.isFinite(e)&&(e={byteLength:e}),e=uI("Buffer",e,Nre),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=uI("Buffer",e,kre))&&this.setAccessor(e.accessor),this}setAccessor(e){return delete(e=Object.assign({},e)).buffer,this.accessor=new _a(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;on(t);const o=this.gl.webgl2?36663:this.target;return this.gl.bindBuffer(o,this.handle),0!==r||void 0!==s?(Ao(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 Ao(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}={}){Ao(this.gl);const s=C0(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 u=Math.min(o,l);return on((r=r||u)<=u),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):(on(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){on(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=cI(e);return on(s),this.setAccessor(new _a(this.accessor,{type:s})),this}_setByteLength(e,t=this.usage){on(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/C0(this.accessor.type||5126,{clamped:!1}).BYTES_PER_ELEMENT;return this.getElementCount()-i}_inferType(e){this.accessor.type||this.setAccessor(new _a(this.accessor,{type:cI(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 mn.deprecated("Buffer.type","Buffer.accessor.type")(),this.accessor.type}get bytes(){return mn.deprecated("Buffer.bytes","Buffer.byteLength")(),this.byteLength}setByteLength(e){return mn.deprecated("setByteLength","reallocate")(),this.reallocate(e)}updateAccessor(e){return mn.deprecated("updateAccessor(...)","setAccessor(new Accessor(buffer.accessor, ...)")(),this.accessor=new _a(this.accessor,e),this}}const dI={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}},nj={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},ij={5126:4,5125:4,5124:4,5123:2,5122:2,5131:2,5120:1,5121:1},Bre=[9729,9728],rj=globalThis.WebGLBuffer||function(){};class Pf extends Ku{get[Symbol.toStringTag](){return"Texture"}static isSupported(e,t={}){const{format:i,linearFiltering:r}=t;let s=!0;return i&&(s=s&&function(n,e){const t=dI[e];if(!t)return!1;if(void 0===t.gl1&&void 0===t.gl2)return!0;const i=Ci(n)&&t.gl2||t.gl1;return"string"==typeof i?n.getExtension(i):i}(e,i),s=s&&(!r||function(n,e){const t=dI[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=ma("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(D=>this.initialize(Object.assign({},e,{pixels:D,data:D}))),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:u}=e;t||(t=r);let{width:h,height:f,dataFormat:g,type:m,compressed:v=!1,mipmaps:x=!0}=e;const{depth:U=0}=e;return({width:h,height:f,compressed:v,dataFormat:g,type:m}=this._deduceParameters({format:s,type:m,dataFormat:g,compressed:v,data:t,width:h,height:f})),this.width=h,this.height=f,this.depth=U,this.format=s,this.type=m,this.dataFormat=g,this.border=o,this.textureUnit=u,Number.isFinite(this.textureUnit)&&(this.gl.activeTexture(33984+this.textureUnit),this.gl.bindTexture(this.target,this.handle)),x&&this._isNPOT()&&(mn.warn(`texture: ${this} is Non-Power-Of-Two, disabling mipmaping`)(),x=!1,this._updateForNPOT(l)),this.mipmaps=x,this.setImageData({data:t,width:h,height:f,depth:U,format:s,type:m,dataFormat:g,border:o,mipmaps:x,parameters:c,compressed:v}),x&&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:u=this.type,width:h=this.width,height:f=this.height,dataFormat:g=this.dataFormat,compressed:m=!1}=e;c||(c=i),({type:u,dataFormat:g,compressed:m,width:h,height:f}=this._deduceParameters({format:s,type:u,dataFormat:g,compressed:m,data:c,width:h,height:f}));const{gl:v}=this;v.bindTexture(this.target,this.handle);let x=null;({data:c,dataType:x}=this._getDataType({data:c,compressed:m}));let U,D=0;return hc(this.gl,l,()=>{switch(x){case"null":v.texImage2D(t,r,s,h,f,o,g,u,c);break;case"typed-array":v.texImage2D(t,r,s,h,f,o,g,u,c,a);break;case"buffer":U=Ao(v),U.bindBuffer(35052,c.handle||c),U.texImage2D(t,r,s,h,f,o,g,u,a),U.bindBuffer(35052,null);break;case"browser-object":Ci(v)?v.texImage2D(t,r,s,h,f,o,g,u,c):v.texImage2D(t,r,s,g,u,c);break;case"compressed":for(const[ie,_e]of c.entries())v.compressedTexImage2D(t,ie,_e.format,_e.width,_e.height,o,_e.data),D+=_e.levelSize;break;default:on(!1,"Unknown image data type")}}),this._trackAllocatedMemory("compressed"===x?D:c&&c.byteLength?c.byteLength:this.width*this.height*(nj[this.dataFormat]||4)*(ij[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:u=this.type,dataFormat:h=this.dataFormat,compressed:f=!1,offset:g=0,border:m=this.border,parameters:v={}}){if(({type:u,dataFormat:h,compressed:f,width:o,height:a}=this._deduceParameters({format:c,type:u,dataFormat:h,compressed:f,data:i,width:o,height:a})),on(0===this.depth,"texSubImage not supported for 3D textures"),i||(i=t),i&&i.data){const x=i;i=x.data,o=x.shape[0],a=x.shape[1]}i instanceof lr&&(i=i.handle),this.gl.bindTexture(this.target,this.handle),hc(this.gl,v,()=>{if(f)this.gl.compressedTexSubImage2D(e,l,r,s,o,a,c,i);else if(null===i)this.gl.texSubImage2D(e,l,r,s,o,a,h,u,null);else if(ArrayBuffer.isView(i))this.gl.texSubImage2D(e,l,r,s,o,a,h,u,i,g);else if(i instanceof rj){const x=Ao(this.gl);x.bindBuffer(35052,i),x.texSubImage2D(e,l,r,s,o,a,h,u,g),x.bindBuffer(35052,null)}else Ci(this.gl)?Ao(this.gl).texSubImage2D(e,l,r,s,o,a,h,u,i):this.gl.texSubImage2D(e,l,r,s,h,u,i)}),this.gl.bindTexture(this.target,null)}copyFramebuffer(e={}){return mn.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 lr?{data:e.handle,dataType:"buffer"}:e instanceof rj?{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=dI[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},on(r,"Could not deduced texture size"),on(void 0===t||r.width===t,"Deduced texture width does not match supplied width"),on(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:on(!1);break;default:this.gl.texParameteri(this.target,e,t)}return this.gl.bindTexture(this.target,null),this}_isNPOT(){return!(Ci(this.gl)||!this.width||!this.height||ZV(this.width)&&ZV(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===Bre.indexOf(t)&&(t=9729);break;case 10242:case 10243:33071!==t&&(t=33071)}return t}}function Vre(n,e){return on("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 ya extends Pf{get[Symbol.toStringTag](){return"Texture2D"}static isSupported(e,t){return Pf.isSupported(e,t)}constructor(e,t={}){hx(e),(t instanceof Promise||"string"==typeof t)&&(t={data:t}),"string"==typeof t.data&&(t=Object.assign({},t,{data:Vre(t.data)})),super(e,Object.assign({},t,{target:3553})),this.initialize(t),Object.seal(this)}}const Nf="EXT_color_buffer_float",sj={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:Nf,bpp:2},33327:{gl2:Nf,bpp:4},34842:{gl2:Nf,bpp:8},33326:{gl2:Nf,bpp:4},33328:{gl2:Nf,bpp:8},34836:{gl2:Nf,bpp:16},35898:{gl2:Nf,bpp:4}};class zg extends Ku{get[Symbol.toStringTag](){return"Renderbuffer"}static isSupported(e,{format:t}={format:null}){return!t||function(n,e,t){const i=t[e];if(!i)return!1;const r=Ci(n)&&i.gl2||i.gl1;return"string"==typeof r?n.getExtension(r):r}(e,t,sj)}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 on(e,"Needs format"),this._trackDeallocatedMemory(),this.gl.bindRenderbuffer(36161,this.handle),0!==r&&Ci(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)*sj[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 uj="clear: bad arguments";function fI(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)),on(0!==o,uj),hc(n,s,()=>{n.clear(o)})}function dj(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 li(n){return function(){var e=this,t=arguments;return new Promise(function(i,r){var s=n.apply(e,t);function o(l){dj(s,i,r,o,a,"next",l)}function a(l){dj(s,i,r,o,a,"throw",l)}o(void 0)})}}const pI=[34069,34070,34071,34072,34073,34074];let Wre=(()=>{class n extends Pf{get[Symbol.toStringTag](){return"TextureCube"}constructor(t,i={}){hx(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 li(function*(){const{gl:u}=c,h=r||s,f=yield Promise.all(pI.map(g=>{const m=h[g];return Promise.all(Array.isArray(m)?m:[m])}));c.bind(),pI.forEach((g,m)=>{f[m].length>1&&!1!==c.opts.mipmaps&&mn.warn(`${c.id} has mipmap and multiple LODs.`)(),f[m].forEach((v,x)=>{t&&i?u.texImage2D(g,x,a,t,i,o,a,l,v):u.texImage2D(g,x,a,a,l,v)})}),c.unbind()})()}setImageDataForFace(t){const{face:i,width:r,height:s,pixels:o,data:a,border:l=0,format:c=6408,type:u=5121}=t,{gl:h}=this,f=o||a;return this.bind(),f instanceof Promise?f.then(g=>this.setImageDataForFace(Object.assign({},t,{face:i,data:g,pixels:g}))):this.width||this.height?h.texImage2D(i,0,c,r,s,l,c,u,f):h.texImage2D(i,0,c,c,u,f),this}}return n.FACES=pI,n})();class qre extends Pf{get[Symbol.toStringTag](){return"Texture3D"}static isSupported(e){return Ci(e)}constructor(e,t={}){Ao(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:u,parameters:h={}}){return this._trackDeallocatedMemory("Texture"),this.gl.bindTexture(this.target,this.handle),hc(this.gl,h,()=>{ArrayBuffer.isView(u)&&this.gl.texImage3D(this.target,e,t,i,r,s,o,a,l,u),u instanceof lr&&(this.gl.bindBuffer(35052,u.handle),this.gl.texImage3D(this.target,e,t,i,r,s,o,a,l,c))}),this._trackAllocatedMemory(u&&u.byteLength?u.byteLength:this.width*this.height*this.depth*(nj[this.dataFormat]||4)*(ij[this.type]||1),"Texture"),this.loaded=!0,this}}function hj(n,e){on(n instanceof ya||n instanceof Wre||n instanceof qre);const t=n.constructor,{gl:i,width:r,height:s,format:o,type:a,dataFormat:l,border:c,mipmaps:u}=n;return new t(i,Object.assign({width:r,height:s,format:o,type:a,dataFormat:l,border:c,mipmaps:u},e))}function Yre(n,e){const{gl:t,width:i,height:r,id:s}=n;return new ks(t,Object.assign({},e,{id:`framebuffer-for-${s}`,width:i,height:r,attachments:{36064:n}}))}function px(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:u,deleteFramebuffer:h}=T0(n);on(u);const{gl:f,handle:g,attachments:m}=u;a=a||u.width,l=l||u.height,36064===s&&null===g&&(s=1028),on(m[s]),c=c||m[s].type,o=function(n,e,t,i,r){if(n)return n;return new(C0(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 on(!1),0}}(t))}(o,c,r,a,l),c=c||cI(o);const v=f.bindFramebuffer(36160,g);return f.readPixels(t,i,a,l,r,c,o),f.bindFramebuffer(36160,v||null),h&&u.delete(),o}function gI(n,{sourceAttachment:e=36064,targetMaxHeight:t=Number.MAX_SAFE_INTEGER}={}){let i=px(n,{sourceAttachment:e}),{width:r,height:s}=n;for(;s>t;)({data:i,width:r,height:s}=Ore({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 u in i){const h=i[u];(Array.isArray(h)?h[0]:h).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 on(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&&mn.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){on(void 0!==o,"Misspelled framebuffer binding point?");const a=Number(o),l=r[a];let c=l;if(c)if(c instanceof zg)this._attachRenderbuffer({attachment:a,renderbuffer:c});else if(Array.isArray(l)){const[u,h=0,f=0]=l;c=u,this._attachTexture({attachment:a,texture:u,layer:h,level:f})}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(ks.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)&&fI(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]}={}){Ao(n),hc(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:on(!1,uj)}})}(this.gl,{drawBuffer:l,value:a})}),this.gl.bindFramebuffer(36160,o||null),this}readPixels(e={}){return mn.error("Framebuffer.readPixels() is no logner supported, use readPixelsToArray(framebuffer)")(),null}readPixelsToBuffer(e={}){return mn.error("Framebuffer.readPixelsToBuffer()is no logner supported, use readPixelsToBuffer(framebuffer)")(),null}copyToDataUrl(e={}){return mn.error("Framebuffer.copyToDataUrl() is no logner supported, use copyToDataUrl(framebuffer)")(),null}copyToImage(e={}){return mn.error("Framebuffer.copyToImage() is no logner supported, use copyToImage(framebuffer)")(),null}copyToTexture(e={}){return mn.error("Framebuffer.copyToTexture({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null}blit(e={}){return mn.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=Ao(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=ch(this.gl,r)),r}getAttachmentParameters(e=36064,t,i=this.constructor.ATTACHMENT_PARAMETERS||[]){const r={};for(const s of i)r[t?ch(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?ch(this.gl,s):s]=this.getAttachmentParameters(s,e)}return i}show(){return"undefined"!=typeof window&&window.open(gI(this),"luma-debug-texture"),this}log(e=0,t=""){if(e>mn.level||"undefined"==typeof window)return this;t=t||`Framebuffer ${this.id}`;const i=gI(this,{targetMaxHeight:100});return mn.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 ya(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 zg(this.gl,{id:`${this.id}-depth-stencil`,format:35056,width:r,height:111}),this.ownResources.push(o[33306])):t?(o=o||{},o[36096]=new zg(this.gl,{id:`${this.id}-depth`,format:33189,width:r,height:s}),this.ownResources.push(o[36096])):i&&on(!1),o}_unattach(e){const t=this.attachments[e];!t||(t instanceof zg?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:Ao(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:on(!1,"Illegal texture type")}s.bindTexture(t.target,null),this.attachments[e]=t}_setReadBuffer(e){const t=function(n){return Ci(n)?n:null}(this.gl);t?t.readBuffer(e):on(36064===e||1029===e,fj),this.readBuffer=e}_setDrawBuffers(e){const{gl:t}=this,i=Ao(t);if(i)i.drawBuffers(e);else{const r=t.getExtension("WEBGL_draw_buffers");r?r.drawBuffersWEBGL(e):on(1===e.length&&(36064===e[0]||1029===e[0]),fj)}this.drawBuffers=e}_getAttachmentParameterFallback(e){const t=function(n){n.luma=n.luma||{},n.luma.caps=n.luma.caps||{};for(const e in pj)void 0===n.luma.caps[e]&&(n.luma.caps[e]=mj(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)}}ks.ATTACHMENT_PARAMETERS=[36049,36048,33296,33298,33299,33300,33301,33302,33303];const pj={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 ya(n,{format:6408,type:5126,dataFormat:6408}),t=new ks(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 mI(n,e){return gj(n,e)}function gj(n,e){return(e=Array.isArray(e)?e:[e]).every(t=>mj(n,t))}function mj(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=pj[e];let i;on(t,e);const r=Ci(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:on(!1);return i}(n,e)),n.luma.caps[e]||mn.log(2,`Feature: ${e} not supported`)(),n.luma.caps[e]}class _I{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()}},ose=1/Math.PI*180,ase=1/180*Math.PI,Dr={};function cse(n,{precision:e=Dr.precision||4}={}){return n=function(n){return Math.round(n/Dr.EPSILON)*Dr.EPSILON}(n),`${parseFloat(n.toPrecision(e))}`}function uh(n){return Array.isArray(n)||ArrayBuffer.isView(n)&&!(n instanceof DataView)}function Qu(n,e,t){if(uh(n)){t=t||function(n){return n.clone?n.clone():new Array(n.length)}(n);for(let i=0;it*ase,void 0)}(n)}function dse(n){return function(n,e){return Qu(n,t=>t*ose,void 0)}(n)}function Ua(n,e,t){return Qu(n,i=>Math.max(e,Math.min(t,i)))}function gx(n,e,t){return uh(n)?n.map((i,r)=>gx(i,e[r],t)):t*e+(1-t)*n}function M0(n,e,t){const i=Dr.EPSILON;t&&(Dr.EPSILON=t);try{if(n===e)return!0;if(uh(n)&&uh(e)){if(n.length!==e.length)return!1;for(let r=0;r0?", ":"")+cse(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&&(Rj.length=n.length,i=Rj):i=Oj,(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 Pj(n){return n&&n[Symbol.asyncIterator]}function xI(n,e=(()=>!0)){return Array.isArray(n)?Nj(n,e,[]):e(n)?[n]:[]}function Nj(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 kj(n,e){return n?(Number.isFinite(n)&&(n={duration:n}),n.type=n.type||"interpolation",ot(ot(ot({},Bse[n.type]),e),n)):null}function Fj(n,e){return e.getBuffer()?[e.getBuffer(),{divisor:0,size:e.size,normalized:e.settings.normalized}]:e.value}function Lj(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 Bj(n){n.push(n.shift())}function CI(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 Vj({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,u=r&&c,h=CI(t,e),f=t.state.constant;if(!u&&i>=h)return;const g=f?t.value:t.getBuffer().getData({srcByteOffset:l});if(t.settings.normalized&&!f){const U=s;s=(D,ie)=>t._normalizeConstant(U(D,ie))}const m=f?(U,D)=>s(g,D):(U,D)=>s(g.subarray(U,U+a),D),v=n.getData({length:i}),x=new Float32Array(h);(function({source:n,target:e,size:t,getData:i,sourceStartIndices:r,targetStartIndices:s}){if(!Array.isArray(s))return SI({source:n,target:e,size:t,getData:i}),e;let o=0,a=0;const l=i&&((u,h)=>i(u+a,h)),c=Math.min(r.length,s.length);for(let u=1;u(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===vx||(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=vx}clearNeedsUpdate(){this.state.needsUpdate=!1,this.state.updateRanges=kse}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!==vx}),!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,u]of s)o.call(r,this,{data:t,startRow:c,endRow:u,props:i,numInstances:e});if(this.value)if(this.constant||this.buffer.byteLength{if(!r){const x=h*a+l;for(let U=0;Uu?c.set(ie,v):(e._normalizeValue(ie,U.target,0),Nse({target:c,source:U.target,start:v,count:_e}));v+=_e*u}else e._normalizeValue(ie,c,v),v+=u}}_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 AI={};function Do(n){Ri.level>0&&AI[n]&&AI[n].call(...arguments)}function za(n,e){if(!n)throw new Error(e||"shadertools: assertion failed.")}const jj="out vec4 transform_output;\nvoid main() {\n transform_output = vec4(0);\n}",Use=`#version 300 es\n${jj}`;function Uj(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 zj(n={}){const{version:e=100,input:t,inputType:i,output:r}=n;if(!t)return 300===e?Use:e>300?`#version ${e}\n${jj}`:"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 za(!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 Hj extends Ku{get[Symbol.toStringTag](){return"TransformFeedback"}static isSupported(e){return Ci(e)}constructor(e,t={}){Ao(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,jg(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,mn.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 lr?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 $se{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 lr?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&&on(Ci(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 Hj(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],on(i[s]instanceof lr)}return{sourceBuffers:t,feedbackBuffers:i}}_createNewBuffer(e,t){const i=new lr(this.gl,t);return this.resources[e]&&this.resources[e].delete(),this.resources[e]=i,i}_getNextIndex(){return(this.currentIndex+1)%2}}function Gj(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 R0="vs",Yse={[R0]:"#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"},wx="__LUMA_INJECT_DECLARATIONS__",$j=/void\s+main\s*\([^)]*\)\s*\{\n?/,Wj=/}\n?[^{}]*$/,DI=[];function qj(n,e,t,i=!1){const r=e===R0;for(const s in t){const o=t[s];o.sort((l,c)=>l.order-c.order),DI.length=o.length;for(let l=0,c=o.length;ll+a));break;case"vs:#main-end":r&&(n=n.replace(Wj,l=>a+l));break;case"fs:#decl":r||(n=n.replace(wx,a));break;case"fs:#main-start":r||(n=n.replace($j,l=>l+a));break;case"fs:#main-end":r||(n=n.replace(Wj,l=>a+l));break;default:n=n.replace(s,l=>l+a)}}return n=n.replace(wx,""),i&&(n=n.replace(/\}\s*$/,s=>s+Yse[e])),n}function II(n){const e={};return za(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 Xse={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},Ex="transform_uSize_",Yj="transform_position";const ioe={10241:9728,10240:9728,10242:33071,10243:33071};class soe{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 h in this.samplerTextureMap)a[h]=i[this.samplerTextureMap[h]];this._setSourceTextureParameters();const u=function({sourceTextureMap:n,targetTextureVarying:e,targetTexture:t}){const i={};let r,s;e&&(({width:r,height:s}=t),i[`${Ex}${e}`]=[r,s]);for(const o in n)({width:r,height:s}=n[o]),i[`${Ex}${o}`]=[r,s];return i}({sourceTextureMap:i,targetTextureVarying:this.targetTextureVarying,targetTexture:s});Object.assign(a,u)}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=px(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 za(!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 lr(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 ks(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(ioe)}_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=hj(e,{parameters:{10241:9728,10240:9728,10242:33071,10243:33071},pixelStore:{37440:!1}});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 u=l.split("\n"),h=u.slice();if(u.forEach((f,g,m)=>{if(s>0){const v=function(n,e){const t={},i=function(n){return Uj(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=`${Ex}${n}`;return{samplerName:e,sizeName:t,uniformDeclerations:` uniform sampler2D ${e};\n uniform vec2 ${t};`}}(s),h=` ${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 za(!1),null}}(r)};\n`;return t[a]=s,{updatedLine:o,inject:{"vs:#decl":c,"vs:#main-start":h},samplerTextureMap:t}}return null}(f,e);if(v){const{updatedLine:x,inject:U}=v;h[g]=x,c=II([c,U]),Object.assign(a,v.samplerTextureMap),s--}}t&&!o&&(o=function(n,e){const t=Uj(n,["varying","out"]);return t&&t.name===e?t.type:null}(f,t))}),t){on(i);const f=`${Ex}${t}`;c=II([c,{"vs:#decl":`uniform vec2 ${f};\n`,"vs:#main-start":` vec2 ${Yj} = transform_getPos(${f});\n gl_Position = vec4(${Yj}, 0, 1.);\n`}])}l=h.join("\n")}return{vs:l,targetTextureType:o,inject:c,samplerTextureMap:a}}({vs:e.vs,sourceTextureMap:t,targetTextureVarying:this.targetTextureVarying,targetTexture:i}),c=II([e.inject||{},a]);return this.targetTextureType=o,this.samplerTextureMap=l,{vs:r,fs:e._fs||zj({version:Gj(r),input:this.targetTextureVarying,inputType:o,output:"transform_output"}),modules:this.hasSourceTextures||this.targetTextureVarying?[Xse].concat(e.modules||[]):e.modules,uniforms:s,inject:c}}}const OI={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 aoe(n){let e=Xj(n);return"object"===e?n?"type"in n?Object.assign({},n,OI[n.type]):"value"in n?(e=Xj(n.value),Object.assign({type:e},n,OI[e])):{type:"object",value:n}:{type:"object",value:null}:Object.assign({type:e,value:n},OI[e])}function Xj(n){return Array.isArray(n)||ArrayBuffer.isView(n)?"array":typeof n}class RI{constructor({name:e,vs:t,fs:i,dependencies:r=[],uniforms:s,getUniforms:o,deprecations:a=[],defines:l={},inject:c={},vertexShader:u,fragmentShader:h}){za("string"==typeof e),this.name=e,this.vs=t||u,this.fs=i||h,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=aoe(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:za(!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&&za(s.validate(e[r],s),`${this.name}: invalid ${r}`),t[r]=e[r]):t[r]=s.value}return t}}function doe(n){return function(n){const e={},t={};return PI({modules:n,level:0,moduleMap:e,moduleDepth:t}),Object.keys(t).sort((i,r)=>t[r]-t[i]).map(i=>e[i])}(Qj(n))}function PI({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 RI||(za("string"!=typeof t,`Shader module use by name is deprecated. Import shader module '${t}' and use it directly.`),za(t.name,"shader module has no name"),(t=new RI(t)).dependencies=Qj(t.dependencies)),t))}const NI={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]},kf={};function boe(n,e){return n.match(/NVIDIA/i)||e.match(/NVIDIA/i)?"NVIDIA":n.match(/INTEL/i)||e.match(/INTEL/i)?"INTEL":n.match(/AMD/i)||e.match(/AMD/i)||n.match(/ATI/i)||e.match(/ATI/i)?"AMD":"UNKNOWN GPU"}Object.keys(NI).forEach(n=>{kf[n]=n});const kI={};function Zj(n,e,t={}){const i=NI[e];if(za(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 kI)return kI[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),kI[e]=l,l}function xx(n,e){return(e=Array.isArray(e)?e:[e]).every(t=>function(n,e){const t=NI[e];za(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 za(!1===r||!0===r),r}(n,t))}function Gg(n){return new RegExp(`\\b${n}[ \\t]+(\\w+[ \\t]+\\w+(\\[\\w+\\])?;)`,"g")}const Jj=[[/^(#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("]],xoe=[...Jj,[Gg("attribute"),"in $1"],[Gg("varying"),"out $1"]],Soe=[...Jj,[Gg("varying"),"in $1"]],eU=[[/^#version[ \t]+300[ \t]+es/,"#version 100"],[/\btexture(2D|2DProj|Cube)Lod\(/g,"texture$1LodEXT("],[/\btexture\(/g,"texture2D("],[/\btextureLod\(/g,"texture2DLodEXT("]],Coe=[...eU,[Gg("in"),"attribute $1"],[Gg("out"),"varying $1"]],Toe=[...eU,[Gg("in"),"varying $1"]],FI="gl_FragColor",LI=/\bout[ \t]+vec4[ \t]+(\w+)[ \t]*;\n?/,Aoe=/void\s+main\s*\([^)]*\)\s*\{\n?/;function Sx(n,e){for(const[t,i]of e)n=n.replace(t,i);return n}const Ooe=`\n\n${wx}\n\n`,tU={[R0]:"vertex",fs:"fragment"};function nU(n,{id:e,source:t,type:i,modules:r,defines:s={},hookFunctions:o=[],inject:a={},transpileToGLSL100:l=!1,prologue:c=!0,log:u}){za("string"==typeof t,"shader source must be a string");const h=i===R0,f=t.split("\n");let g=100,m="",v=t;0===f[0].indexOf("#version ")?(g=300,m=f[0],v=f.slice(1).join("\n")):m=`#version ${g}`;const x={};r.forEach(Ne=>{Object.assign(x,Ne.getDefines())}),Object.assign(x,s);let U=c?`${m}\n${function({id:n,source:e,type:t}){return n&&"string"==typeof n&&-1===e.indexOf("SHADER_NAME")?`\n#define SHADER_NAME ${n}_${tU[t]}\n\n`:""}({id:e,source:t,type:i})}\n${function({type:n}){return`\n#define SHADER_TYPE_${tU[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:boe(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// 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"}}(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 xx(n,kf.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"),xx(n,kf.GLSL_DERIVATIVES)&&Zj(n,kf.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"),xx(n,kf.GLSL_FRAG_DATA)&&Zj(n,kf.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"),xx(n,kf.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}(x)}\n${h?"":"precision highp float;\n\n"}\n`:`${m}\n`;const D=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),ie={},_e={},Pe={};for(const Ne in a){const Ve="string"==typeof a[Ne]?{injection:a[Ne],order:0}:a[Ne],bt=Ne.match(/^(v|f)s:(#)?([\w-]+)$/);if(bt){const At=bt[3];bt[2]?"decl"===At?_e[Ne]=[Ve]:Pe[Ne]=[Ve]:ie[Ne]=[Ve]}else Pe[Ne]=[Ve]}for(const Ne of r){u&&Ne.checkDeprecations(v,u),U+=Ne.getModuleSource(i,g);const bt=Ne.injections[i];for(const xt in bt){const At=xt.match(/^(v|f)s:#([\w-]+)$/);if(At){const Wt="decl"===At[2]?_e:Pe;Wt[xt]=Wt[xt]||[],Wt[xt].push(bt[xt])}else ie[xt]=ie[xt]||[],ie[xt].push(bt[xt])}}return U+=Ooe,U=qj(U,i,_e),U+=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}(D[i],ie),U+=v,U=qj(U,i,Pe),U=function(n,e,t){switch(e){case 300:return t?Sx(n,xoe):function(n){const e=(n=Sx(n,Soe)).match(LI);if(e){const t=e[1];n=n.replace(new RegExp(`\\b${FI}\\b`,"g"),t)}else{const t="fragmentColor";n=n.replace(Aoe,i=>`out vec4 ${t};\n${i}`).replace(new RegExp(`\\b${FI}\\b`,"g"),t)}return n}(n);case 100:return t?Sx(n,Coe):function(n){const e=(n=Sx(n,Toe)).match(LI);if(e){const t=e[1];n=n.replace(LI,"").replace(new RegExp(`\\b${t}\\b`,"g"),FI)}return n}(n);default:throw new Error(`unknown GLSL version ${e}`)}}(U,l?100:g,h),U}function Noe(n){return function(t){const i={};for(const r of n){const s=r.getUniforms(t,i);Object.assign(i,s)}return i}}const joe={5126:Ir.bind(null,"uniform1fv",Ha,1,Io),35664:Ir.bind(null,"uniform2fv",Ha,2,Io),35665:Ir.bind(null,"uniform3fv",Ha,3,Io),35666:Ir.bind(null,"uniform4fv",Ha,4,Io),5124:Ir.bind(null,"uniform1iv",dh,1,Io),35667:Ir.bind(null,"uniform2iv",dh,2,Io),35668:Ir.bind(null,"uniform3iv",dh,3,Io),35669:Ir.bind(null,"uniform4iv",dh,4,Io),35670:Ir.bind(null,"uniform1iv",dh,1,Io),35671:Ir.bind(null,"uniform2iv",dh,2,Io),35672:Ir.bind(null,"uniform3iv",dh,3,Io),35673:Ir.bind(null,"uniform4iv",dh,4,Io),35674:Ir.bind(null,"uniformMatrix2fv",Ha,4,Ju),35675:Ir.bind(null,"uniformMatrix3fv",Ha,9,Ju),35676:Ir.bind(null,"uniformMatrix4fv",Ha,16,Ju),35678:oo,35680:oo,5125:Ir.bind(null,"uniform1uiv",Cx,1,Io),36294:Ir.bind(null,"uniform2uiv",Cx,2,Io),36295:Ir.bind(null,"uniform3uiv",Cx,3,Io),36296:Ir.bind(null,"uniform4uiv",Cx,4,Io),35685:Ir.bind(null,"uniformMatrix2x3fv",Ha,6,Ju),35686:Ir.bind(null,"uniformMatrix2x4fv",Ha,8,Ju),35687:Ir.bind(null,"uniformMatrix3x2fv",Ha,6,Ju),35688:Ir.bind(null,"uniformMatrix3x4fv",Ha,12,Ju),35689:Ir.bind(null,"uniformMatrix4x2fv",Ha,8,Ju),35690:Ir.bind(null,"uniformMatrix4x3fv",Ha,12,Ju),35678:oo,35680:oo,35679:oo,35682:oo,36289:oo,36292:oo,36293:oo,36298:oo,36299:oo,36300:oo,36303:oo,36306:oo,36307:oo,36308:oo,36311:oo},Uoe={},zoe={},Hoe={},iU=[0];function BI(n,e,t,i){1===e&&"boolean"==typeof n&&(n=n?1:0),Number.isFinite(n)&&(iU[0]=n,n=iU);const r=n.length;if(r%e&&mn.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 Ir(n,e,t,i){let r=null,s=null;return(o,a,l)=>{const c=e(l,t),u=c.length;let h=!1;if(null===r)r=new Float32Array(u),s=u,h=!0;else{on(s===u,"Uniform length cannot change.");for(let f=0;f{const a=String(o+e);return aU(a,r-a.length)+t+s})}(e);return{shaderName:l,errors:oU(s,c),warnings:oU(o,c)}}(i,this.source,this.shaderType,this.id);throw mn.error(`GLSL compilation errors in ${r}\n${s}`)(),mn.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 VI extends P0{get[Symbol.toStringTag](){return"VertexShader"}constructor(e,t){"string"==typeof t&&(t={source:t}),super(e,Object.assign({},t,{shaderType:35633}))}_createHandle(){return this.gl.createShader(35633)}}class jI extends P0{get[Symbol.toStringTag](){return"FragmentShader"}constructor(e,t){"string"==typeof t&&(t={source:t}),super(e,Object.assign({},t,{shaderType:35632}))}_createHandle(){return this.gl.createShader(35632)}}const Fs=5126,N0=5124,k0=5125,UI={[Fs]:[Fs,1,"float"],35664:[Fs,2,"vec2"],35665:[Fs,3,"vec3"],35666:[Fs,4,"vec4"],[N0]:[N0,1,"int"],35667:[N0,2,"ivec2"],35668:[N0,3,"ivec3"],35669:[N0,4,"ivec4"],[k0]:[k0,1,"uint"],36294:[k0,2,"uvec2"],36295:[k0,3,"uvec3"],36296:[k0,4,"uvec4"],35670:[Fs,1,"bool"],35671:[Fs,2,"bvec2"],35672:[Fs,3,"bvec3"],35673:[Fs,4,"bvec4"],35674:[Fs,8,"mat2"],35685:[Fs,8,"mat2x3"],35686:[Fs,8,"mat2x4"],35675:[Fs,12,"mat3"],35687:[Fs,12,"mat3x2"],35688:[Fs,12,"mat3x4"],35676:[Fs,16,"mat4"],35689:[Fs,16,"mat4x2"],35690:[Fs,16,"mat4x3"]};function fU(n){const e=UI[n];if(!e)return null;const[t,i]=e;return{type:t,components:i}}function pU(n,e){switch(n){case 5120:case 5121:case 5122:case 5123:n=Fs}for(const t in UI){const[i,r,s]=UI[t];if(i===n&&r===e)return{glType:t,name:s}}return null}class Aae{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(!Ci(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}=fU(i),a={type:s,size:r*o};this._inferProperties(e,t,a);const l={location:e,name:t,accessor:new _a(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}=fU(i),l={location:e,name:t,accessor:new _a({type:s,size:r*o})};this.varyingInfos.push(l),this.varyingInfosByName[l.name]=l}}const Mae=35981,Dae=["setVertexArray","setAttributes","setBuffers","unsetBuffers","use","getUniformCount","getUniformInfo","getUniformLocation","getUniformValue","getVarying","getFragDataLocation","getAttachedShaders","getAttributeCount","getAttributeLocation","getAttributeInfo"];class mU extends Ku{get[Symbol.toStringTag](){return"Program"}constructor(e,t={}){super(e,t),this.stubRemovedMethods("Program","v6.0",Dae),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=Mae}=e;return this.hash=t||"",this.vs="string"==typeof i?new VI(this.gl,{id:`${e.id}-vs`,source:i}):i,this.fs="string"==typeof r?new jI(this.gl,{id:`${e.id}-fs`,source:r}):r,on(this.vs instanceof VI),on(this.fs instanceof jI),this.uniforms={},this._textureUniforms={},s&&s.length>0&&(Ao(this.gl),this.varyings=s,this.gl2.transformFeedbackVaryings(this.handle,s,o)),this._compileAndLink(),this._readUniformLocationsFromLinkedProgram(),this.configuration=new Aae(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:u=c>0,vertexArray:h=null,transformFeedback:f,framebuffer:g,parameters:m={},uniforms:v,samplers:x}){if((v||x)&&(mn.deprecated("Program.draw({uniforms})","Program.setUniforms(uniforms)")(),this.setUniforms(v||{})),mn.priority>=e){const U=g?g.id:"default",D=`mode=${ch(this.gl,t)} verts=${i} instances=${c} indexType=${ch(this.gl,l)} isInstanced=${u} isIndexed=${a} Framebuffer=${U}`;mn.log(e,D)()}return on(h),this.gl.useProgram(this.handle),!(!this._areTexturesRenderable()||0===i||u&&0===c||(h.bindForDraw(i,c,()=>{if(void 0!==g&&(m=Object.assign({},m,{framebuffer:g})),f){const U=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 on(!1),0}}(t);f.begin(U)}this._bindTextures(),hc(this.gl,m,()=>{a&&u?this.gl2.drawElementsInstanced(t,i,l,r,c):a&&Ci(this.gl)&&!isNaN(s)&&!isNaN(o)?this.gl2.drawRangeElements(t,s,o,i,l,r):a?this.gl.drawElements(t,i,l,r):u?this.gl2.drawArraysInstanced(t,r,i,c):this.gl.drawArrays(t,r,i)}),f&&f.end()}),0))}setUniforms(e={}){mn.priority>=2&&function(n,e,t){for(const i in n){const r=n[i];if((!t||Boolean(t[i]))&&!Woe(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 ks&&(s=s.texture),s instanceof Pf)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)&&qoe(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 VI({handle:r});break;case 35632:i.fs=new jI({handle:r})}return i}_getParameter(e){return this.gl.getProgramParameter(this.handle,e)}_setId(e){if(!e){const t=this._getName();this.id=ma(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),mn.time(4,`linkProgram for ${this._getName()}`)(),e.linkProgram(this.handle),mn.timeEnd(4,`linkProgram for ${this._getName()}`)(),e.debug||mn.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),u=this._getHash(t),h=this._getHash(i),f=c.map(ie=>this._getHash(ie.name)).sort(),g=o.map(ie=>this._getHash(ie)),m=Object.keys(r).sort(),v=Object.keys(s).sort(),x=[],U=[];for(const ie of m)x.push(this._getHash(ie)),x.push(this._getHash(r[ie]));for(const ie of v)U.push(this._getHash(ie)),U.push(this._getHash(s[ie]));const D=`${u}/${h}D${x.join("/")}M${f.join("/")}I${U.join("/")}V${g.join("/")}H${this.stateHash}B${a}${l?"T":""}`;if(!this._programCache[D]){const ie=function(n,e){const{vs:t,fs:i}=e,r=doe(e.modules||[]);return{gl:n,vs:nU(n,Object.assign({},e,{source:t,type:R0,modules:r})),fs:nU(n,Object.assign({},e,{source:i,type:"fs",modules:r})),getUniforms:Noe(r)}}(this.gl,{vs:t,fs:i,modules:c,inject:s,defines:r,hookFunctions:this._hookFunctions,transpileToGLSL100:l});this._programCache[D]=new mU(this.gl,{hash:D,vs:ie.vs,fs:ie.fs,varyings:o,bufferMode:a}),this._getUniforms[D]=ie.getUniforms||(_e=>{}),this._useCounts[D]=0}return this._useCounts[D]++,this._programCache[D]}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":v0.chrome?"Chrome":v0.safari?"Safari":v0.mozInnerScreenX?"Firefox":"Unknown"}()}static getDefaultArray(e){return e.luma=e.luma||{},e.luma.defaultVertexArray||(e.luma.defaultVertexArray=new Ga(e,{handle:null,isDefaultArray:!0})),e.luma.defaultVertexArray}static getMaxAttributes(e){return Ga.MAX_ATTRIBUTES=Ga.MAX_ATTRIBUTES||e.getParameter(34921),Ga.MAX_ATTRIBUTES}static setConstant(e,t,i){switch(i.constructor){case Float32Array:Ga._setConstantFloatArray(e,t,i);break;case Int32Array:Ga._setConstantIntArray(e,t,i);break;case Uint32Array:Ga._setConstantUintArray(e,t,i);break;default:on(!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 Ga.getMaxAttributes(this.gl)}initialize(e={}){return this.setProps(e)}setProps(e){return this}setElementBuffer(e=null,t={}){return on(!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:u}=i,{gl:h,gl2:f}=this;return e=Number(e),this.bind(()=>{h.bindBuffer(34962,t.handle),c?(on(Ci(h)),f.vertexAttribIPointer(e,r,s,o,a)):h.vertexAttribPointer(e,r,s,l,o,a),h.enableVertexAttribArray(e),f.vertexAttribDivisor(e,u||0)}),this}enable(e,t=!0){return!t&&0===e&&!Ga.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 lr(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(!Mx||Mx.byteLength{switch(e){case 34373:return this.gl.getVertexAttribOffset(t,e);default:return this.gl.getVertexAttrib(t,e)}})}}const Fae=/^(.+)__LOCATION_([0-9]+)$/,Lae=["setBuffers","setGeneric","clearBindings","setLocations","setGenericValues","setDivisor","enable","disable"];class Bae{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 Ga(e),JV(this,"VertexArray","v6.0",Lae),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 lr(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,mn.once(3,()=>`unused value ${e} in ${this.id}`)(),s;const l=this._getAttributeInfo(a||o);if(!l)return s;const u=_a.resolve(l.accessor,this.accessors[o]||{},i,r),{size:h,type:f}=u;return on(Number.isFinite(h)&&Number.isFinite(f)),{location:o,accessor:u}}_getAttributeInfo(e){return this.configuration&&this.configuration.getAttributeInfo(e)}_getAttributeIndex(e){const t=Number(e);if(Number.isFinite(t))return{location:t};const i=Fae.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 lr)this.setBuffer(e,t);else if(Array.isArray(t)&&t.length&&t[0]instanceof lr)this.setBuffer(e,t[0],t[1]);else if(ArrayBuffer.isView(t)||Array.isArray(t))this.setConstant(e,t);else{if(!(t.buffer instanceof lr))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 lr){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 mn.deprecated("setElements","setElementBuffer")(),this.setElementBuffer(e,t)}}function L0(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+=L0(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 _U(n,e,t,i){const{gl:r}=n;if(!e)return{[i]:"null","Format ":"N/A"};let c,u,h,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 lr){const f=e,{data:g,changed:m}=f.getDebugData();let v;return u=m?"*":"",h=g,l=f.byteLength,a=l/g.BYTES_PER_ELEMENT/o,t?v=`${t.divisor>0?"I ":"P "} ${a} (x${o}=${l} bytes ${ch(r,s)})`:(c=!0,v=`${l} bytes`),{[i]:`${u}${L0(h,{size:o,isInteger:c})}`,"Format ":v}}return h=e,o=e.length,s=String(e.constructor.name).replace("Array",""),c=-1!==s.indexOf("nt"),{[i]:`${L0(h,{size:o,isInteger:c})} (constant)`,"Format ":`${o}x${s} (constant)`}}function Uae(n,e){const{type:t,size:i}=e,r=pU(t,i);return r?`${n} (${r.name})`:n}function yU({header:n="Uniforms",program:e,uniforms:t,undefinedOnly:i=!1}){on(e);const s=".*Matrix",a={},l=Object.keys(e._uniformSetters).sort();let c=0;for(const f of l)!f.match(".*_.*")&&!f.match(s)&&zI({table:a,header:n,uniforms:t,uniformName:f,undefinedOnly:i})&&c++;for(const f of l)f.match(s)&&zI({table:a,header:n,uniforms:t,uniformName:f,undefinedOnly:i})&&c++;for(const f of l)a[f]||zI({table:a,header:n,uniforms:t,uniformName:f,undefinedOnly:i})&&c++;let u=0;const h={};if(!i)for(const f in t){const g=t[f];a[f]||(u++,h[f]={Type:`NOT USED: ${g}`,[n]:L0(g)})}return{table:a,count:c,unusedTable:h,unusedCount:u}}function zI({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?L0(s):"N/A","Uniform Type":o?s:"NOT PROVIDED"},0))}function bU(n){const{type:e,size:t}=n.accessor,i=pU(e,t);return i?`${i.name} ${n.name}`:n.name}const Gae={POSITION:"positions",NORMAL:"normals",COLOR_0:"colors",TEXCOORD_0:"texCoords",TEXCOORD_1:"texCoords1",TEXCOORD_2:"texCoords2"};function Wae(n,e){const{attributeMap:t=Gae}=e||{};return t&&t[n]||n}function qae(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}on(Number.isFinite(e.size),`attribute ${n} needs size`)}const vU=()=>{},Kae={};class Yg{constructor(e,t={}){const{id:i=ma("model")}=t;on(dx(e)),this.id=i,this.gl=e,this.id=t.id||ma("Model"),this.lastLogTime=0,this.animated=!1,this.initialize(t)}initialize(e){this.props={},this.programManager=e.programManager||F0.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:u}=e;this.programProps={program:t,vs:i,fs:r,modules:s,defines:o,inject:a,varyings:l,bufferMode:c,transpileToGLSL100:u},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={},on(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:u}=e;this.programProps={program:t,vs:i,fs:r,modules:s,defines:o,inject:a,varyings:l,bufferMode:c,transpileToGLSL100:u},this._programDirty=!0}getUniforms(){return this.uniforms}setDrawMode(e){return this.drawMode=e,this}setVertexCount(e){return on(Number.isFinite(e)),this.vertexCount=e,this}setInstanceCount(e){return on(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=Wae(s,undefined);if("indices"===s)r=o;else if(o.constant)i[a]=o.value;else{const l=o.value,c=ot({},o);delete c.value,i[a]=[new lr(n,l),c],qae(s,c)}}if(r){const s=r.value||r;on(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 lr(n,{data:s,target:34963}),o]}return i}(this.gl,e),this.vertexArray.setAttributes(this.geometryBuffers),this}setAttributes(e={}){if(jg(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 fI(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),mn.priority>=2&&(c=this._logDrawCallStart(2));const u=this.vertexArray.getDrawParams(),{isIndexed:h=u.isIndexed,indexType:f=u.indexType,indexOffset:g=u.indexOffset,vertexArrayInstanced:m=u.isInstanced}=this.props;m&&!this.isInstanced&&mn.warn("Found instanced attributes on non-instanced model",this.id)();const{isInstanced:v,instanceCount:x}=this,{onBeforeRender:U=vU,onAfterRender:D=vU}=this.props;U(),this.program.setUniforms(this.uniforms);const ie=this.program.draw(Object.assign(Kae,e,{logPriority:c,uniforms:null,framebuffer:i,parameters:a,drawMode:this.getDrawMode(),vertexCount:this.getVertexCount(),vertexArray:l,transformFeedback:o,isIndexed:h,indexType:f,isInstanced:v,instanceCount:x,offset:h?g:0}));return D(),mn.priority>=2&&this._logDrawCallEnd(c,l,i),ie}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 mn.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:u}=this.programProps;t=this.programManager.get({vs:i,fs:r,modules:s,inject:o,defines:a,varyings:l,bufferMode:c,transpileToGLSL100:u}),this.program&&this._managedProgram&&this.programManager.release(this.program),this._programManagerState=this.programManager.stateHash,this._managedProgram=!0}on(t instanceof mU,"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 Bae(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 lr&&t.delete()}}_setAnimationProps(e){this.animated&&on(e,"Model.draw(): animated uniforms but no animationProps")}_setFeedbackBuffers(e={}){if(jg(e))return this;const{gl:t}=this.program;return this.transformFeedback=this.transformFeedback||new Hj(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:mn.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=_U(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}: ${Uae(s.name,a)}`),t[o]=_U(n,i[r],a,e)}}return t}({vertexArray:t,header:`${this.id} attributes`,attributes:this._attributes}),{table:o,unusedTable:a,unusedCount:l}=yU({header:`${this.id} uniforms`,program:this.program,uniforms:Object.assign({},this.program.uniforms,i)}),{table:c,count:u}=yU({header:`${this.id} uniforms`,program:this.program,uniforms:Object.assign({},this.program.uniforms,i),undefinedOnly:!0});u>0&&mn.log("MISSING UNIFORMS",Object.keys(c))(),l>0&&mn.log("UNUSED UNIFORMS",Object.keys(a))();const h=function(n){const e={},t=`Accessors for ${n.id}`;for(const i of n.attributeInfos)i&&(e[`in ${bU(i)}`]={[t]:JSON.stringify(i.accessor)});for(const i of n.varyingInfos)i&&(e[`out ${bU(i)}`]={[t]:JSON.stringify(i.accessor)});return e}(this.vertexArray.configuration);mn.table(e,s)(),mn.table(e,o)(),mn.table(e+1,h)(),r&&r.log({logLevel:2,message:`Rendered to ${r.id}`}),mn.groupEnd(2,`>>> DRAWING MODEL ${this.id}`)()}}class HI{static isSupported(e){return Ci(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();on(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 Yg(t,Object.assign({},e,{fs:e.fs||zj({version:Gj(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!(jg(n.feedbackBuffers)&&jg(n.feedbackMap)&&!(n.varyings&&n.varyings.length>0))})(t)&&(this.bufferTransform=new $se(e,t)),function(n){return!(jg(n._sourceTextures)&&!n._targetTexture&&!n._targetTextureVarying)}(t)&&(this.textureTransform=new soe(e,t)),on(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 Dx(){}const Jae={onStart:Dx,onUpdate:Dx,onInterrupt:Dx,onEnd:Dx};class B0{constructor(e){this._inProgress=!1,this._handle=null,this.timeline=e,this.settings={}}get inProgress(){return this._inProgress}start(e){this.cancel(),this.settings=ot(ot({},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 ale={interpolation:class{constructor({gl:e,attribute:t,timeline:i}){this.gl=e,this.type="interpolation",this.transition=new B0(i),this.attribute=t,this.attributeInTransition=new TI(e,t.settings),this.currentStartIndices=t.startIndices,this.currentLength=0,this.transform=function(n,e){const t=Lj(e.size);return new HI(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 lr(e,r),new lr(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;Bj(r);const o={numInstances:t,attribute:s,fromLength:this.currentLength,fromStartIndices:this.currentStartIndices,getData:e.enter};for(const a of r)Vj(ot({buffer:a},o));this.currentStartIndices=s.startIndices,this.currentLength=CI(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:Fj(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 B0(i),this.attribute=t,this.attributeInTransition=new TI(e,Sn(ot({},t.settings),{normalized:!1})),this.currentStartIndices=t.startIndices,this.currentLength=0,this.texture=function(n){return new ya(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 ks(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=Lj(e.size);return new HI(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 lr(e,r),new lr(e,r),new lr(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)Vj(ot({buffer:a},o));this.currentStartIndices=s.startIndices,this.currentLength=CI(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:Fj(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]}}),Bj(e),this.attributeInTransition.update({buffer:e[1],value:this.attribute.value}),px(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 lle{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=HI.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 Ri.warn("WebGL2 not supported by this browser. Transition for ".concat(e," is disabled."))();r&&this._removeTransition(e);const o=ale[i.type];o?this.transitions[e]=new o({attribute:t,timeline:this.timeline,gl:this.gl}):(Ri.error("unsupported transition type '".concat(i.type,"'"))(),s=!1)}(s||t.needsRedraw())&&(this.needsRedraw=!0,this.transitions[e].start(i,this.numInstances))}}const wU="attributeManager.invalidate";class ple{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 lle(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;Do("attribute.updateStart",t),t.allocate(i)&&Do("attribute.allocate",t,i),t.updateBuffer(e)&&(this.needsRedraw=!0,Do("attribute.updateEnd",t,i))}}function xU(n,e,t,i,r){const s=e-n;return(t-e)*r+-s*i+s+e}function SU(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=kj(r)))return;const o=yle[r.type];if(!o)return void Ri.error("unsupported transition type '".concat(r.type,"'"))();const a=new o(this.timeline);a.start(Sn(ot({},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 Ix={COMPONENT:Symbol.for("component"),ASYNC_DEFAULTS:Symbol.for("asyncPropDefaults"),ASYNC_ORIGINAL:Symbol.for("asyncPropOriginal"),ASYNC_RESOLVED:Symbol.for("asyncPropResolved")},{COMPONENT:vle}=Ix;function xle(n,e){if(!n.transitions)return null;const t={},i=$I(n);for(const r in n.transitions){const s=i[r],o=s&&s.type;("number"===o||"color"===o||"array"===o)&&GI(n[r],e[r],s)&&(t[r]=!0)}return t}function CU({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=GI(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=GI(n[s],e[s],i[s]);if(o)return"".concat(r,".").concat(s," ").concat(o)}}return null}function GI(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 Tle(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(!Rle(i[r],e[r])){t=n(i),e=i;break}return t}}function Ple(n,e){if(!e)return n;const t=ot(ot({},n),e);if("defines"in e&&(t.defines=ot(ot({},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=ot({},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 WI(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],u=e[8],h=e[9],f=e[10],g=e[11],m=e[12],v=e[13],x=e[14],U=e[15],D=t*a-i*o,ie=t*l-r*o,_e=t*c-s*o,Pe=i*l-r*a,Ne=i*c-s*a,Ve=r*c-s*l,bt=u*v-h*m,xt=u*x-f*m,At=u*U-g*m,Bt=h*x-f*v,Wt=h*U-g*v,gt=f*U-g*x,mt=D*gt-ie*Wt+_e*Bt+Pe*At-Ne*xt+Ve*bt;return mt?(n[0]=(a*gt-l*Wt+c*Bt)*(mt=1/mt),n[1]=(r*Wt-i*gt-s*Bt)*mt,n[2]=(v*Ve-x*Ne+U*Pe)*mt,n[3]=(f*Ne-h*Ve-g*Pe)*mt,n[4]=(l*At-o*gt-c*xt)*mt,n[5]=(t*gt-r*At+s*xt)*mt,n[6]=(x*_e-m*Ve-U*ie)*mt,n[7]=(u*Ve-f*_e+g*ie)*mt,n[8]=(o*Wt-a*At+c*bt)*mt,n[9]=(i*At-t*Wt-s*bt)*mt,n[10]=(m*Ne-v*_e+U*D)*mt,n[11]=(h*_e-u*Ne-g*D)*mt,n[12]=(a*xt-o*Bt-l*bt)*mt,n[13]=(t*Bt-i*xt+r*bt)*mt,n[14]=(v*ie-m*Pe-x*D)*mt,n[15]=(u*Pe-h*ie+f*D)*mt,n):null}function Ff(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],u=e[7],h=e[8],f=e[9],g=e[10],m=e[11],v=e[12],x=e[13],U=e[14],D=e[15],ie=t[0],_e=t[1],Pe=t[2],Ne=t[3];return n[0]=ie*i+_e*a+Pe*h+Ne*v,n[1]=ie*r+_e*l+Pe*f+Ne*x,n[2]=ie*s+_e*c+Pe*g+Ne*U,n[3]=ie*o+_e*u+Pe*m+Ne*D,n[4]=(ie=t[4])*i+(_e=t[5])*a+(Pe=t[6])*h+(Ne=t[7])*v,n[5]=ie*r+_e*l+Pe*f+Ne*x,n[6]=ie*s+_e*c+Pe*g+Ne*U,n[7]=ie*o+_e*u+Pe*m+Ne*D,n[8]=(ie=t[8])*i+(_e=t[9])*a+(Pe=t[10])*h+(Ne=t[11])*v,n[9]=ie*r+_e*l+Pe*f+Ne*x,n[10]=ie*s+_e*c+Pe*g+Ne*U,n[11]=ie*o+_e*u+Pe*m+Ne*D,n[12]=(ie=t[12])*i+(_e=t[13])*a+(Pe=t[14])*h+(Ne=t[15])*v,n[13]=ie*r+_e*l+Pe*f+Ne*x,n[14]=ie*s+_e*c+Pe*g+Ne*U,n[15]=ie*o+_e*u+Pe*m+Ne*D,n}function Rx(n,e,t){var o,a,l,c,u,h,f,g,m,v,x,U,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],u=e[4],h=e[5],f=e[6],g=e[7],m=e[8],v=e[9],x=e[10],U=e[11],n[0]=o=e[0],n[1]=a,n[2]=l,n[3]=c,n[4]=u,n[5]=h,n[6]=f,n[7]=g,n[8]=m,n[9]=v,n[10]=x,n[11]=U,n[12]=o*i+u*r+m*s+e[12],n[13]=a*i+h*r+v*s+e[13],n[14]=l*i+f*r+x*s+e[14],n[15]=c*i+g*r+U*s+e[15]),n}function Px(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 AU(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],u=e[9],h=e[10],f=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+u*i,n[6]=a*r+h*i,n[7]=l*r+f*i,n[8]=c*r-s*i,n[9]=u*r-o*i,n[10]=h*r-a*i,n[11]=f*r-l*i,n}function MU(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],u=e[5],h=e[6],f=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+u*i,n[2]=a*r+h*i,n[3]=l*r+f*i,n[4]=c*r-s*i,n[5]=u*r-o*i,n[6]=h*r-a*i,n[7]=f*r-l*i,n}function IU(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 Nx(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 OU(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],u=c*i+a*s-l*r,h=c*r+l*i-o*s,f=c*s+o*r-a*i,g=-o*i-a*r-l*s;return n[0]=u*c+g*-o+h*-l-f*-a,n[1]=h*c+g*-a+f*-o-u*-l,n[2]=f*c+g*-l+u*-a-h*-o,n[3]=e[3],n}!function(){var n=new ba(4);ba!=Float32Array&&(n[0]=0,n[1]=0,n[2]=0,n[3]=0)}();const RU=[0,0,0,0],rce=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0],sce=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],oce=[0,0,0],ace=[0,0,0],lce=Ox(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=RU,l=RU,c=n.cameraPosition;const{geospatialOrigin:u,shaderCoordinateOrigin:h,offsetMode:f}=PU(n,e,t);return f&&(l=n.projectPosition(u||h),c=[c[0]-l[0],c[1]-l[1],c[2]-l[2]],l[3]=1,a=Nx([],l,o),s=i||s,o=Ff([],r,s),o=Ff([],o,rce)),{viewMatrix:s,viewProjectionMatrix:o,projectionCenter:a,originCommon:l,cameraPosCommon:c,shaderCoordinateOrigin:h,geospatialOrigin:u}}(n,t,i),u=n.getDistanceScales(),h=[n.width*e,n.height*e],f=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:h,project_uDevicePixelRatio:e,project_uFocalDistance:f,project_uCommonUnitsPerMeter:u.unitsPerMeter,project_uCommonUnitsPerWorldUnit:u.unitsPerMeter,project_uCommonUnitsPerWorldUnit2:oce,project_uScale:n.scale,project_uViewProjectionMatrix:s,project_uCameraPosition:a};if(c){const m=n.getDistanceScales(c);switch(t){case Vi.METER_OFFSETS:g.project_uCommonUnitsPerWorldUnit=m.unitsPerMeter,g.project_uCommonUnitsPerWorldUnit2=m.unitsPerMeter2;break;case Vi.LNGLAT:case Vi.LNGLAT_OFFSETS:g.project_uCommonUnitsPerWorldUnit=m.unitsPerDegree,g.project_uCommonUnitsPerWorldUnit2=m.unitsPerDegree2;break;case Vi.CARTESIAN:g.project_uCommonUnitsPerWorldUnit=[1,1,m.unitsPerMeter[2]],g.project_uCommonUnitsPerWorldUnit2=[0,0,m.unitsPerMeter2[2]]}}return g});function PU(n,e,t=ace){let r,i=t,s=!0;switch(r=e===Vi.LNGLAT_OFFSETS||e===Vi.METER_OFFSETS?t:n.isGeospatial?[Math.fround(n.longitude),Math.fround(n.latitude),0]:null,n.projectionMode){case Zc.WEB_MERCATOR:(e===Vi.LNGLAT||e===Vi.CARTESIAN)&&(s=!1);break;case Zc.WEB_MERCATOR_AUTO_OFFSET:e===Vi.LNGLAT?i=r:e===Vi.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 Zc.IDENTITY:i=n.position.map(Math.fround);break;case Zc.GLOBE:s=!1,r=null;break;default:s=!1}return i[2]=i[2]||0,{geospatialOrigin:r,shaderCoordinateOrigin:i,offsetMode:s}}class hce extends mx{get ELEMENTS(){return Zu(!1),0}get RANK(){return Zu(!1),0}toString(){let e="[";if(Dr.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 qn).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 function(n,e,t,i,r){var o,s=1/Math.tan(e/2);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)}(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],u=n[9],h=n[10],f=n[11],g=n[12],m=n[13],v=n[14],x=n[15];return(e*o-t*s)*(h*x-f*v)-(e*a-i*s)*(u*x-f*m)+(e*l-r*s)*(u*v-h*m)+(t*a-i*o)*(c*x-f*g)-(t*l-r*o)*(c*v-h*g)+(i*l-r*a)*(c*m-u*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 WI(this,this),this.check()}multiplyLeft(e){return Ff(this,e,this),this.check()}multiplyRight(e){return Ff(this,this,e),this.check()}rotateX(e){return AU(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],u=e[9],h=e[10],f=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-u*i,n[2]=a*r-h*i,n[3]=l*r-f*i,n[8]=s*i+c*r,n[9]=o*i+u*r,n[10]=a*i+h*r,n[11]=l*i+f*r}(this,this,e),this.check()}rotateZ(e){return MU(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,u,h,f,g,m,v,x,U,D,ie,_e,Pe,Ne,Ve,bt,xt,At,Bt,Wt,gt,mt,jt,r=i[0],s=i[1],o=i[2],a=Math.hypot(r,s,o);at?t:n}const qI=Math.log2||function(n){return Math.log(n)*Math.LOG2E};function ed(n,e){if(!n)throw new Error(e||"@math.gl/web-mercator: assertion failed.")}const pc=Math.PI,VU=pc/4,gc=pc/180,YI=180/pc,XI=4003e4,Fx=85.051129;function Lx([n,e]){return ed(Number.isFinite(n)),ed(Number.isFinite(e)&&e>=-90&&e<=90,"invalid latitude"),[512*(n*gc+pc)/(2*pc),512*(pc+Math.log(Math.tan(VU+e*gc*.5)))/(2*pc)]}function Zg([n,e]){const t=n/512*(2*pc)-pc,i=2*(Math.atan(Math.exp(e/512*(2*pc)-pc))-VU);return[t*YI,i*YI]}function KI({latitude:n,longitude:e,highPrecision:t=!1}){ed(Number.isFinite(n)&&Number.isFinite(e));const i={},s=Math.cos(n*gc),o=512/360,a=o/s,l=512/XI/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=gc*Math.tan(n*gc)/s,h=512/XI*c,f=h/a*l;i.unitsPerDegree2=[0,o*c/2,h],i.unitsPerMeter2=[f,0,f]}return i}function jU(n,e){const[t,i,r]=n,[s,o,a]=e,{unitsPerMeter:l,unitsPerMeter2:c}=KI({longitude:t,latitude:i,highPrecision:!0}),u=Lx(n);u[0]+=s*(l[0]+c[0]*o),u[1]+=o*(l[1]+c[1]*o);const h=Zg(u),f=(r||0)+(a||0);return Number.isFinite(r)||Number.isFinite(a)?[h[0],h[1],f]:h}function zU(n){return 2*Math.atan(.5/n)*YI}function HU(n,e){const[t,i,r=0]=n;return ed(Number.isFinite(t)&&Number.isFinite(i)&&Number.isFinite(r)),Qg(e,[t,i,r,1])}function j0(n,e,t=0){const[i,r,s]=n;if(ed(Number.isFinite(i)&&Number.isFinite(r),"invalid pixel coordinate"),Number.isFinite(s))return Qg(e,[i,r,s,1]);const o=Qg(e,[i,r,0,1]),a=Qg(e,[i,r,1,1]),l=o[2],c=a[2];return kU([],o,a,l===c?0:((t||0)-l)/(c-l))}const GU=Math.PI/180;function $U(n,e,t){const{pixelUnprojectionMatrix:i}=n,r=Qg(i,[e,0,1,1]),s=Qg(i,[e,n.height,1,1]),c=Zg(kU([],r,s,(t*n.distanceScales.unitsPerMeter[2]-r[2])/(s[2]-r[2])));return c[2]=t,c}const Dce=Math.PI/180,Ice=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],ZI=[0,0,0],Rce={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?Zc.WEB_MERCATOR:Zc.WEB_MERCATOR_AUTO_OFFSET:Zc.IDENTITY}equals(t){return t instanceof n&&(this===t||t.width===this.width&&t.height===this.height&&t.scale===this.scale&&M0(t.projectionMatrix,this.projectionMatrix)&&M0(t.viewMatrix,this.viewMatrix))}project(t,{topLeft:i=!0}={}){const s=HU(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,u=j0([s,i?o:this.height-o,a],this.pixelUnprojectionMatrix,r&&r*this.distanceScales.unitsPerMeter[2]),[h,f,g]=this.unprojectPosition(u);return Number.isFinite(a)?[h,f,g]:Number.isFinite(r)?[h,f,r]:[h,f]}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?Lx(t):t}unprojectFlat(t){return this.isGeospatial?Zg(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?KI({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:u=!1,repeat:h=!1,worldOffset:f=0}=t;let{width:g,height:m,altitude:v=1.5}=t;const x=Math.pow(2,s);g=g||1,m=m||1,v=Math.max(.75,v);const{fov:U,aspect:D,focalDistance:ie,near:_e,far:Pe}=function({width:n,height:e,fovy:t=zU(1.5),altitude:i,pitch:r=0,nearZMultiplier:s=1,farZMultiplier:o=1}){void 0!==i&&(t=zU(i));const a=.5*t*gc,l=function(n){return.5/Math.tan(.5*n*gc)}(t),c=r*gc,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:n/e,focalDistance:l,near:s,far:(Math.sin(c)*u+l)*o}}({width:g,height:m,pitch:o,altitude:v,nearZMultiplier:l,farZMultiplier:c});let Ne=function({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 Rx(o,o,[0,0,-i]),AU(o,o,-e*gc),MU(o,o,t*gc),Px(o,o,[r/=n,r,r]),s&&Rx(o,o,function(n,e){return n[0]=-e[0],n[1]=-e[1],n[2]=-e[2],n}([],s)),o}({height:m,pitch:o,bearing:a,scale:x,altitude:v});f&&(Ne=(new qn).translate([512*f,0,0]).multiplyLeft(Ne)),super(Sn(ot({},t),{width:g,height:m,viewMatrix:Ne,longitude:r,latitude:i,zoom:s,orthographic:u,fovyRadians:U,aspect:D,focalDistance:ie,near:_e,far:Pe})),this.latitude=i,this.longitude=r,this.zoom=s,this.pitch=o,this.bearing=a,this.altitude=v,this.orthographic=u,this._subViewports=h?[]: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(Sn(ot({},this),{worldOffset:s})):this;this._subViewports.push(o)}}return this._subViewports}addMetersToLngLat(t,i){return jU(t,i)}panByPosition(t,i){const r=j0(i,this.pixelUnprojectionMatrix),o=kx([],this.projectFlat(t),NU([],r)),a=kx([],this.center,o),[l,c]=this.unprojectFlat(a);return{longitude:l,latitude:c}}getBounds(t={}){const i=function(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*GU:Math.atan(.5/n.altitude))>(90-n.pitch)*GU-.01?(l=$U(n,0,e),c=$U(n,t,e)):(l=r([0,0],s),c=r([t,0],s)),[o,a,c,l]}(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}=function({width:n,height:e,bounds:t,minExtent:i=0,maxZoom:r=24,padding:s=0,offset:o=[0,0]}){const[[a,l],[c,u]]=t;Number.isFinite(s)?s={top:s,bottom:s,left:s,right:s}:ed(Number.isFinite(s.top)&&Number.isFinite(s.bottom)&&Number.isFinite(s.left)&&Number.isFinite(s.right));const h=Lx([a,BU(u,-Fx,Fx)]),f=Lx([c,BU(l,-Fx,Fx)]),g=[Math.max(Math.abs(f[0]-h[0]),i),Math.max(Math.abs(f[1]-h[1]),i)],m=[n-s.left-s.right-2*Math.abs(o[0]),e-s.top-s.bottom-2*Math.abs(o[1])];ed(m[0]>0&&m[1]>0);const v=m[0]/g[0],x=m[1]/g[1],_e=Zg([(f[0]+h[0])/2+(s.right-s.left)/2/v,(f[1]+h[1])/2+(s.bottom-s.top)/2/x]),Pe=Math.min(r,qI(Math.abs(Math.min(v,x))));return ed(Number.isFinite(Pe)),{longitude:_e[0],latitude:_e[1],zoom:Pe}}(ot({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 JI(n,e,t=!1){const i=e.projectPosition(n);if(t&&e instanceof KU){const[r,s,o=0]=n,a=e.getDistanceScales([r,s]);i[2]=o*a.unitsPerMeter[2]}return i}function QU(n,{viewport:e,modelMatrix:t,coordinateSystem:i,coordinateOrigin:r,offsetMode:s}){let[o,a,l=0]=n;switch(t&&([o,a,l]=Nx([],[o,a,l,1],t)),i){case Vi.LNGLAT:return JI([o,a,l],e,s);case Vi.LNGLAT_OFFSETS:return JI([o+r[0],a+r[1],l+(r[2]||0)],e,s);case Vi.METER_OFFSETS:return JI(jU(r,[o,a,l]),e,s);case Vi.CARTESIAN:default:return e.isGeospatial?[o+r[0],a+r[1],l+r[2]]:e.projectPosition([o,a,l])}}const kce={10241:9987,10240:9729,10242:33071,10243:33071},eO={},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||z0(n)&&(3===n.length||4===n.length),equal:(n,e,t)=>tO(n,e)},accessor:{validate(n,e){const t=Bx(n);return"function"===t||t===Bx(e.value)},equal:(n,e,t)=>"function"==typeof e||tO(n,e)},array:{validate:(n,e)=>e.optional&&!n||z0(n),equal:(n,e,t)=>t.compare?tO(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 ya)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 ya(t,Sn(ot({},e),{parameters:ot(ot(ot({},kce),i),n.props.textureParameters)}));return eO[r.id]=!0,r}(t,n),release:n=>{!function(n){!n||!(n instanceof ya)||eO[n.id]&&(n.delete(),delete eO[n.id])}(n)}}};function tO(n,e){if(n===e)return!0;if(!z0(n)||!z0(e))return!1;const t=n.length;if(t!==e.length)return!1;for(let i=0;i{},this.oldProps=Qce,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[Xce]||{},i=e[Yce]||e,r=e[Kce]||{};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(Pj(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 li(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 h,c=!0,u=!1;try{for(var g,m,f=iO(t);c=(g=yield f.next()).done,m=yield g.value,!c;c=!0){const x=m,{dataTransform:U}=i.component?i.component.props:{};a=U?U(x,a):a.concat(x),Object.defineProperty(a,"__diff",{enumerable:!1,value:[{startRow:l,endRow:a.length}]}),l=a.length,i._setAsyncPropValue(e,a,o)}}catch(x){u=!0,h=x}finally{try{!c&&null!=f.return&&(yield f.return())}finally{if(u)throw h}}const v=null===(r=i.layer)||void 0===r?void 0:r.props.onDataLoad;v&&v(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:tz,ASYNC_RESOLVED:nz,ASYNC_DEFAULTS:Zce}=Ix,Jce={};let eue=0,tue=(()=>{class n{constructor(){this.props=Uce.apply(this,arguments),this.id=this.props.id,this.count=eue++,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[Zce])s in i[nz]?r[s]=i[nz][s]:s in i[tz]&&(r[s]=i[tz][s]);return new this.constructor(ot(ot(ot({},i),r),t))}get stats(){return this.internalState.stats}_initState(){this.internalState=new ez({})}}return n.componentName="Component",n.defaultProps=Jce,n})();class nue extends ez{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 mc=n=>"function"==typeof n,hh=n=>null!==n&&"object"==typeof n,rz=n=>hh(n)&&n.constructor==={}.constructor,iue=n=>n&&"function"==typeof n[Symbol.iterator],rue=n=>n&&"function"==typeof n[Symbol.asyncIterator],G0=n=>"undefined"!=typeof Response&&n instanceof Response||n&&n.arrayBuffer&&n.text&&n.json,em=n=>"undefined"!=typeof Blob&&n instanceof Blob,sz=n=>(n=>"undefined"!=typeof ReadableStream&&n instanceof ReadableStream||hh(n)&&mc(n.tee)&&mc(n.cancel)&&mc(n.getReader))(n)||(n=>hh(n)&&mc(n.read)&&mc(n.pipe)&&(n=>"boolean"==typeof n)(n.readable))(n);function Lf(n,e){if(!n)throw new Error(e||"loader assertion failed.")}function rO(n){var e;return!!n&&(Array.isArray(n)&&(n=n[0]),Array.isArray(null===(e=n)||void 0===e?void 0:e.extensions))}function sO(n){var e,t;let i;return Lf(n,"null loader"),Lf(rO(n),"invalid loader"),Array.isArray(n)&&(i=n[1],n=Sn(ot({},n=n[0]),{options:ot(ot({},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 tu={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},oO=tu.global||tu.self||tu.window||{},uue="object"!=typeof process||"[object process]"!==String(process)||process.browser,oz="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version);oz&&parseFloat(oz[1]);const lO={};function due(n){for(const e in lO)n.startsWith(e)&&(n=n.replace(e,lO[e]));return!n.startsWith("http://")&&!n.startsWith("https://")&&(n=`${n}`),n}const hue=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,fue=/^([-\w.]+\/[-\w.+]+)/;function pue(n){const e=fue.exec(n);return e?e[1]:n}function az(n){const e=hue.exec(n);return e?e[1]:""}const gue=/\?.*/;function zx(n){if(G0(n)){const e=cO(n.url||"");return{url:e,type:pue(n.headers.get("content-type")||"")||az(e)}}return em(n)?{url:cO(n.name||""),type:n.type||""}:"string"==typeof n?{url:cO(n),type:az(n)}:{url:"",type:""}}function mue(n){return G0(n)?n.headers["content-length"]||-1:em(n)?n.size:"string"==typeof n?n.length:n instanceof ArrayBuffer||ArrayBuffer.isView(n)?n.byteLength:-1}function cO(n){return n.replace(gue,"")}function lz(n){return uO.apply(this,arguments)}function uO(){return(uO=li(function*(n){if(G0(n))return n;const e={},t=mue(n);t>=0&&(e["content-length"]=String(t));const{url:i,type:r}=zx(n);r&&(e["content-type"]=r);const s=yield bue(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 _ue(n){return dO.apply(this,arguments)}function dO(){return(dO=li(function*(n){if(!n.ok){const e=yield yue(n);throw new Error(e)}})).apply(this,arguments)}function yue(n){return hO.apply(this,arguments)}function hO(){return(hO=li(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 bue(n){return fO.apply(this,arguments)}function fO(){return(fO=li(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,${vue(n.slice(0,5))}`:null})).apply(this,arguments)}function vue(n){let e="";const t=new Uint8Array(n);for(let i=0;i{}}info(){return()=>{}}warn(){return()=>{}}error(){return()=>{}}}const dz={fetch:null,mimeType:void 0,nothrow:!1,log:new class{constructor(){Kn(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:[]},xue={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 gO(){oO.loaders=oO.loaders||{};const{loaders:n}=oO;return n._state=n._state||{},n._state}const mO=()=>{const n=gO();return n.globalOptions=n.globalOptions||ot({},dz),n.globalOptions};function Sue(n,e,t,i){return t=t||[],function(n,e){fz(n,null,dz,xue,e);for(const t of e)fz(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=ot({},n.options||{});return function(n,e){e&&!("baseUri"in n)&&(n.baseUri=e)}(r,t),null===r.log&&(r.log=new wue),gz(r,mO()),gz(r,e),r}(e,n,i)}function hz(n,e){const t=mO(),i=n||t;return"function"==typeof i.fetch?i.fetch:hh(i.fetch)?r=>cz(r,i):null!=e&&e.fetch?null==e?void 0:e.fetch:cz}function fz(n,e,t,i,r){const s=e||"Top level",o=e?`${e}.`:"";for(const a in n){const l=!e&&hh(n[a]),c="baseUri"===a&&!e,u="workerUrl"===a&&e;if(!(a in t)&&!c&&!u)if(a in i)uz.warn(`${s} loader option '${o}${a}' no longer supported, use '${i[a]}'`)();else if(!l){const h=Tue(a,r);uz.warn(`${s} loader option '${o}${a}' not recognized. ${h}`)()}}}function Tue(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 gz(n,e){for(const t in e)t in e&&(n[t]=rz(e[t])&&rz(n[t])?ot(ot({},n[t]),e[t]):e[t])}function nu(n,e){if(!n)throw new Error(e||"loaders.gl assertion failed.")}function Due(n,e="3.0.12"){return nu(n,"no worker provided"),!(!e||!n.version)}const iu={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},Iue=iu.global||iu.self||iu.window||{},_O="object"!=typeof process||"[object process]"!==String(process)||process.browser,yO="function"==typeof importScripts,Oue="undefined"!=typeof window&&void 0!==window.orientation,mz="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version),bO=(mz&&parseFloat(mz[1]),new Map);function _z(n){const e=new Blob([n],{type:"application/javascript"});return URL.createObjectURL(e)}function yz(n,e=!0,t){const i=t||new Set;if(n)if(bz(n))i.add(n);else if(bz(n.buffer))i.add(n.buffer);else if(!ArrayBuffer.isView(n)&&e&&"object"==typeof n)for(const r in n)yz(n[r],e,i);return void 0===t?Array.from(i):[]}function bz(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 vO=()=>{};class vz{static isSupported(){return"undefined"!=typeof Worker}constructor(e){Kn(this,"name",void 0),Kn(this,"source",void 0),Kn(this,"url",void 0),Kn(this,"terminated",!1),Kn(this,"worker",void 0),Kn(this,"onMessage",void 0),Kn(this,"onError",void 0),Kn(this,"_loadableURL","");const{name:t,source:i,url:r}=e;nu(i||r),this.name=t,this.source=i,this.url=r,this.onMessage=vO,this.onError=s=>console.log(s),this.worker=this._createBrowserWorker()}destroy(){this.onMessage=vO,this.onError=vO,this.worker.terminate(),this.terminated=!0}get isRunning(){return Boolean(this.onMessage)}postMessage(e,t){t=t||yz(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){nu(n.source&&!n.url||!n.source&&n.url);let e=bO.get(n.source||n.url);return e||(n.url&&(e=function(n){return n.startsWith("http")?_z(function(n){return`try {\n importScripts('${n}');\n} catch (error) {\n console.error(error);\n throw error;\n}`}(n)):n}(n.url),bO.set(n.url,e)),n.source&&(e=_z(n.source),bO.set(n.source,e))),nu(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 kue{constructor(e,t){Kn(this,"name",void 0),Kn(this,"workerThread",void 0),Kn(this,"isRunning",void 0),Kn(this,"result",void 0),Kn(this,"_resolve",void 0),Kn(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){nu(this.isRunning),this.isRunning=!1,this._resolve(e)}error(e){nu(this.isRunning),this.isRunning=!1,this._reject(e)}}class Fue{constructor(e){Kn(this,"name","unnamed"),Kn(this,"source",void 0),Kn(this,"url",void 0),Kn(this,"maxConcurrency",1),Kn(this,"maxMobileConcurrency",1),Kn(this,"onDebug",()=>{}),Kn(this,"reuseWorkers",!0),Kn(this,"props",{}),Kn(this,"jobQueue",[]),Kn(this,"idleQueue",[]),Kn(this,"count",0),Kn(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=ot(ot({},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 li(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 li(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 kue(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 td{static isSupported(){return vz.isSupported()}static getWorkerFarm(e={}){return td._workerFarm=td._workerFarm||new td({}),td._workerFarm.setProps(e),td._workerFarm}constructor(e){Kn(this,"props",void 0),Kn(this,"workerPools",new Map),this.props=ot({},Lue),this.setProps(e),this.workerPools=new Map}destroy(){for(const e of this.workerPools.values())e.destroy()}setProps(e){this.props=ot(ot({},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 Fue({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 Vue(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 nu(r),r}function jue(n,e){return!!td.isSupported()&&n.worker&&(null==e?void 0:e.worker)}function Uue(n,e,t,i,r){return wO.apply(this,arguments)}function wO(){return(wO=li(function*(n,e,t,i,r){const s=n.id,o=Vue(n,t),l=td.getWorkerFarm(t).getWorkerPool({name:s,url:o});t=JSON.parse(JSON.stringify(t));const c=yield l.startJob("process-on-worker",zue.bind(null,r));return c.postMessage("process",{input:e,options:t}),yield(yield c.result).result})).apply(this,arguments)}function zue(n,e,t,i){return EO.apply(this,arguments)}function EO(){return(EO=li(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)}Kn(td,"_workerFarm",void 0);var Ez=et(9521);function xz(n){if(function(n){return n&&"object"==typeof n&&n.isBuffer}(n)&&(n=function(n){return Ez.toArrayBuffer?Ez.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 Wue(...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 Sz(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 que(n){return SO.apply(this,arguments)}function SO(){return(SO=li(function*(n){const e=[];var r,t=!0,i=!1;try{for(var o,a,s=iO(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 Wue(...e)})).apply(this,arguments)}const Kue=262144;function Cz(n){this.wrapped=n}function $0(n){return new Cz(n)}function W0(n){var e,t;function r(o,a){try{var l=n[o](a),c=l.value,u=c instanceof Cz;Promise.resolve(u?c.wrapped:c).then(function(h){u?r("return"===o?"return":"next",h):s(l.done?"return":"normal",h)},function(h){r("throw",h)})}catch(h){s("throw",h)}}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 u={key:o,arg:a,resolve:l,reject:c,next:null};t?t=t.next=u:(e=t=u,r(o,a))})},"function"!=typeof n.return&&(this.return=void 0)}function TO(n){return function(){return new W0(n.apply(this,arguments))}}function AO(){return(AO=TO(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(IO)}function rde(n,e,t){return OO.apply(this,arguments)}function OO(){return(OO=li(function*(n,e,t){const i=n instanceof ArrayBuffer||ArrayBuffer.isView(n);if("string"==typeof n||i)return ide(n,e);if(em(n)&&(n=yield lz(n)),G0(n)){const r=n;return yield _ue(r),e.binary?yield r.arrayBuffer():yield r.text()}if(sz(n)&&(n=nde(n,t)),iue(n)||rue(n))return que(n);throw new Error(IO)})).apply(this,arguments)}function ode(n,e,t=null){if(t)return t;const i=ot({fetch:hz(e,n)},n);return Array.isArray(i.loaders)||(i.loaders=null),i}function ade(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 Az=()=>{const n=gO();return n.loaderRegistry=n.loaderRegistry||[],n.loaderRegistry};function Mz(n){const e=Az();n=Array.isArray(n)?n:[n];for(const t of n){const i=sO(t);e.find(r=>i===r)||e.unshift(i)}}const cde=/\.([^.]+)$/;function ude(n){return NO.apply(this,arguments)}function NO(){return(NO=li(function*(n,e=[],t,i){if(!Iz(n))return null;let r=Dz(n,e,Sn(ot({},t),{nothrow:!0}),i);if(r)return r;if(em(n)&&(r=Dz(n=yield n.slice(0,10).arrayBuffer(),e,t,i)),!(r||null!=t&&t.nothrow))throw new Error(Oz(n));return r})).apply(this,arguments)}function Dz(n,e=[],t,i){if(!Iz(n))return null;if(e&&!Array.isArray(e))return sO(e);let r=[];e&&(r=r.concat(e)),null!=t&&t.ignoreRegisteredLoaders||r.push(...Az()),function(n){for(const e of n)sO(e)}(r);const s=function(n,e,t,i){const{url:r,type:s}=zx(n),o=r||(null==i?void 0:i.url);let a=null;return null!=t&&t.mimeType&&(a=kO(e,null==t?void 0:t.mimeType)),a=a||function(n,e){const t=e&&cde.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||kO(e,s),a=a||function(n,e){if(!e)return null;for(const t of n)if("string"==typeof e){if(mde(e,t))return t}else if(ArrayBuffer.isView(e)){if(Rz(e.buffer,e.byteOffset,t))return t}else if(e instanceof ArrayBuffer&&Rz(e,0,t))return t;return null}(e,n),a=a||kO(e,null==t?void 0:t.fallbackMimeType),a}(n,r,t,i);if(!(s||null!=t&&t.nothrow))throw new Error(Oz(n));return s}function Iz(n){return!(n instanceof Response&&204===n.status)}function Oz(n){const{url:e,type:t}=zx(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)?FO(n.buffer,n.byteOffset,e):n instanceof ArrayBuffer?FO(n,0,e):""}(n)}", contentType: "${t}"`),e&&(i+=` url: ${e}`),i}function kO(n,e){for(const t of n)if(t.mimeTypes&&t.mimeTypes.includes(e)||e===`application/x.${t.id}`)return t;return null}function mde(n,e){return e.testText?e.testText(n):(Array.isArray(e.tests)?e.tests:[e.tests]).some(i=>n.startsWith(i))}function Rz(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 ru=new Uint8ClampedArray(0);const Ade={data:{type:"data",value:Cde,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=Sn(ot({},r),{fetch:Sn(ot({},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:q0(n,i),persistent:!1}),l=!0),l?o.subscribe({resourceId:n,onChange:c=>t.internalState.reloadAsyncProp(e,c),consumerId:t.id,requestId:e}):q0(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:Vi.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 Y0=(()=>{class n extends tue{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=QU(t,{viewport:i,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem}),[s,o,a]=HU(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=ot({},n);let{coordinateSystem:t}=n;const{viewport:i,coordinateOrigin:r,fromCoordinateSystem:s,fromCoordinateOrigin:o}=n;return t===Vi.DEFAULT&&(t=i.isGeospatial?Vi.LNGLAT:Vi.CARTESIAN),void 0===s&&(e.fromCoordinateSystem=t),void 0===o&&(e.fromCoordinateOrigin=r),e.coordinateSystem=t,e}(e),{geospatialOrigin:l,shaderCoordinateOrigin:c,offsetMode:u}=PU(t,i,r),h=QU(n,{viewport:t,modelMatrix:s,coordinateSystem:o,coordinateOrigin:a,offsetMode:u});u&&function(n,e,t){n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2]}(h,h,t.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===Vi.DEFAULT||t===Vi.LNGLAT||t===Vi.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){fc(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=Ple(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 u of c)o.invalidateAll(u);else o.invalidateAll()}const l=i.highlightedObjectIndex>=0||i.pickable;if((t.highlightedObjectIndex>=0||t.pickable)!==l&&o){const{pickingColors:c,instancePickingColors:u}=o.attributes,h=c||u;h&&(l&&h.constant&&(h.constant=!1,o.invalidate(h.id)),!h.value&&!l&&(h.constant=!0,h.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||!Tde({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(ru.length/3);if(this.internalState.usesPickingColorCache=!0,rPz&&Ri.warn("Layer has too many data objects. Picking might not be able to distinguish all objects.")(),ru=A0.allocate(ru,i,{size:3,copy:!0,maxCount:Math.max(i,Pz)});const s=Math.floor(ru.length/3),o=[];for(let a=r;a{const c={moduleParameters:t,uniforms:i,parameters:r,context:this.context};for(const u of this.props.extensions)u.draw.call(this,c,u);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&&Do("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=CU({newProps:n,oldProps:e,propTypes:$I(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&&TU(n,e,"all"))return{all:!0};const t={};let i=!1;for(const r in n.updateTriggers)"all"!==r&&TU(n,e,r)&&(t[r]=!0,i=t);return i}(n,e)),{dataChanged:i,propsChanged:t,updateTriggersChanged:r,extensionsChanged:Tle(n,e),transitionsChanged:xle(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=$I(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 ple(this.context.gl,{id:this.props.id,stats:this.context.stats,timeline:this.context.timeline})}_initState(){fc(!this.internalState&&!this.state),fc(isFinite(this.props.coordinateSystem));const t=this._getAttributeManager();t&&t.addInstanced({instancePickingColors:{type:5121,size:3,noAlloc:!0,update:this.calculateInstancePickingColors}}),this.internalState=new nue({attributeManager:t,layer:this}),this.clearChangeFlags(),this.state={},Object.defineProperty(this.state,"attributeManager",{get:()=>(Ri.deprecated("layer.state.attributeManager","layer.getAttributeManager()"),t)}),this.internalState.layer=this,this.internalState.uniformTransitions=new ble(this.context.timeline),this.internalState.onAsyncPropUpdated=this._onAsyncPropUpdated.bind(this),this.internalState.setAsyncProps(this.props)}_transferState(t){Do("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=Ade,n})(),Nz=(()=>{class n extends Y0{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:u,coordinateSystem:h,coordinateOrigin:f,wrapLongitude:g,positionFormat:m,modelMatrix:v,extensions:x,fetch:U,_subLayerProps:D}=this.props,ie={opacity:i,pickable:r,visible:s,parameters:o,getPolygonOffset:a,highlightedObjectIndex:l,autoHighlight:c,highlightColor:u,coordinateSystem:h,coordinateOrigin:f,wrapLongitude:g,positionFormat:m,modelMatrix:v,extensions:x,fetch:U},_e=D&&D[t.id],Pe=_e&&_e.updateTriggers,Ne=t.id||"sublayer";if(_e){const Ve=this.constructor._propTypes,bt=t.type?t.type._propTypes:{};for(const xt in _e){const At=bt[xt]||Ve[xt];At&&"accessor"===At.type&&(_e[xt]=this.getSubLayerAccessor(_e[xt]))}}Object.assign(ie,t,_e),ie.id="".concat(this.props.id,"-").concat(Ne),ie.updateTriggers=ot(ot({all:this.props.updateTriggers.all},t.updateTriggers),Pe);for(const Ve of x){const bt=Ve.getSubLayerProps.call(this,Ve);bt&&Object.assign(ie,bt,{updateTriggers:Object.assign(ie.updateTriggers,bt.updateTriggers)})}return ie}_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=xI(t,Boolean),this.internalState.subLayers=t),Do("compositeLayer.renderLayers",this,i,t);for(const r of t)r.parent=this}}return n.layerName="CompositeLayer",n})();const Dde=/([0-9]+\.?[0-9]*)(%|px)/;function Gx(n){switch(typeof n){case"number":return{position:n,relative:!1};case"string":const e=n.match(Dde);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 $x(n,e){return n.relative?Math.round(n.position*e):n.position}function X0(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)&&X0(i,r)))return!1}return!0}class jO{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:u=1e3,modelMatrix:h=null,viewportInstance:f=null,type:g=Jg}=e;fc(!f||f instanceof Jg),this.viewportInstance=f,this.id=t||this.constructor.displayName||"view",this.type=g,this.props=Sn(ot({},e),{id:this.id,projectionMatrix:a,fovy:l,near:c,far:u,modelMatrix:h}),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):X0(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=ot({},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:$x(this._x,e),y:$x(this._y,t),width:$x(this._width,e),height:$x(this._height,t)}}_getControllerProps(e){let t=this.props.controller;return t?!0===t?e:("function"==typeof t&&(t={type:t}),ot(ot({},e),t)):null}_getViewport(e,t){const{type:i}=this;return new i(ot(ot(ot({},e),this.props),t))}_parseDimensions({x:e,y:t,width:i,height:r}){this._x=Gx(e),this._y=Gx(t),this._width=Gx(i),this._height=Gx(r)}}const K0=()=>{},kz={transitionEasing:n=>n,transitionInterruption:1,onTransitionStart:K0,onTransitionInterrupt:K0,onTransitionEnd:K0};class Ide{constructor(e,t={}){this.ControllerState=e,this.props=ot(ot({},kz),t),this.propsInTransition=null,this.transition=new B0(t.timeline),this.onViewStateChange=t.onViewStateChange||K0,this.onStateChange=t.onStateChange||K0,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=ot(ot({},kz),e),this.props=e,this._shouldIgnoreViewportChange(i,e))return t;if(this._isTransitionEnabled(e)){const{interruption:r,endProps:s}=this.transition.settings,o=ot(ot({},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(ot(ot({},this.props),c)).getViewportProps(),this.onViewStateChange({viewState:this.propsInTransition,oldViewState:this.props})}}const Fz=["longitude","latitude","zoom","bearing","pitch"],Rde=["longitude","latitude","zoom"];class Lz 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)||!M0(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];fc(Number.isFinite(i)||Array.isArray(i),"".concat(t," is required for transition"))})}}{constructor(e={}){super((Array.isArray(e)?e:e.transitionProps)||{compare:Fz,extract:Fz,required:Rde}),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]=gx(e[s]||0,t[s]||0,i);if(t.aroundPosition){const s=this.opts.makeViewport(ot(ot({},t),r));Object.assign(r,s.panByPosition(t.aroundPosition,gx(e.around,t.around,i)))}return r}}const fh={transitionDuration:0},Pde={transitionDuration:300,transitionEasing:n=>n,transitionInterruption:1},qx=n=>1-(1-n)*(1-n),tm_WHEEL=["wheel"],tm_PAN=["panstart","panmove","panend"],tm_PINCH=["pinchstart","pinchmove","pinchend"],tm_TRIPLE_PAN=["tripanstart","tripanmove","tripanend"],tm_DOUBLE_TAP=["doubletap"],tm_KEYBOARD=["keydown"];class UO{constructor(e,t={}){this.ControllerState=e,this.controllerState=null,this.controllerStateProps=null,this.eventManager=null,this.transitionManager=new Ide(e,Sn(ot({},t),{onViewStateChange:this._onTransition.bind(this),onStateChange:this._setInteractionState.bind(this)}));const i=this.linearTransitionProps;this._transition=i&&Sn(ot({},Pde),{transitionInterpolator:new Lz({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(ot(ot({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,u=Boolean(this.onViewStateChange);this.toggleEvents(tm_WHEEL,u&&i),this.toggleEvents(tm_PAN,u&&(r||s)),this.toggleEvents(tm_PINCH,u&&(a||l)),this.toggleEvents(tm_TRIPLE_PAN,u&&l),this.toggleEvents(tm_DOUBLE_TAP,u&&o),this.toggleEvents(tm_KEYBOARD,u&&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=ot(ot({},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,fh,{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,fh,{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,Sn(ot({},this._getTransitionProps()),{transitionDuration:t,transitionEasing:qx}),{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,fh,{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,Sn(ot({},this._getTransitionProps()),{transitionDuration:t,transitionEasing:qx}),{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,Sn(ot({},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,fh,{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,fh,{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,Sn(ot({},this._getTransitionProps()),{transitionDuration:t,transitionEasing:qx}),{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,fh,{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,fh,{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,Sn(ot({},this._getTransitionProps({around:r})),{transitionDuration:t,transitionEasing:qx}),{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?Sn(ot({},t),{transitionInterpolator:new Lz(Sn(ot({},e),{transitionProps:this.linearTransitionProps,makeViewport:this.controllerState.makeViewport}))}):t:fh}}class Bz{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 ph_target=[0,0,0];class Yx extends Bz{constructor({makeViewport:e,width:t,height:i,rotationX:r=0,rotationOrbit:s=0,target:o=ph_target,zoom:a=0,minRotationX:l=-90,maxRotationX:c=90,minZoom:u=-(1/0),maxZoom:h=Infinity,startPanPosition:f,startRotatePos:g,startRotationX:m,startRotationOrbit:v,startZoomPosition:x,startZoom:U}){super({width:t,height:i,rotationX:r,rotationOrbit:s,target:o,zoom:a,minRotationX:l,maxRotationX:c,minZoom:u,maxZoom:h}),this._state={startPanPosition:f,startRotatePos:g,startRotationX:m,startRotationOrbit:v,startZoomPosition:x,startZoom:U},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 u=(e[0]-r[0])/a;(s<-90||s>90)&&(u*=-1),c={rotationX:s+(e[1]-r[1])/l*180,rotationOrbit:o+180*u}}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=ot({},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(Sn(ot({},this._viewportProps),{zoom:a}));return this._getUpdatedState(ot({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),Ua(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 Yx(ot(ot(ot({},this._viewportProps),this._state),e))}_applyConstraints(e){const{maxZoom:t,minZoom:i,zoom:r,maxRotationX:s,minRotationX:o,rotationOrbit:a}=e;return e.zoom=Ua(r,i,t),e.rotationX=Ua(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 kde extends UO{constructor(e){super(Yx,e)}get linearTransitionProps(){return["target","zoom","rotationX","rotationOrbit"]}}class Fde extends UO{constructor(e){e.dragMode=e.dragMode||"pan",super(Yx,e)}_onPanRotate(e){return!1}get linearTransitionProps(){return["target","zoom"]}}const Lde=(new qn).lookAt({eye:[0,0,1]});function Bde({width:n,height:e,near:t,far:i}){return n=n||1,e=e||1,(new qn).ortho({left:-n/2,right:n/2,bottom:-e/2,top:e/2,near:t,far:i})}class Vde 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(Sn(ot({},e),{longitude:null,position:a,viewMatrix:Lde.clone().scale([c,c*(l?-1:1),c]),projectionMatrix:Bde({width:t,height:i,near:r,far:s}),zoom:o}))}panByPosition(e,t){const r=kx([],e,NU([],j0(t,this.pixelUnprojectionMatrix)));return{target:kx([],this.center,r)}}}let jde=(()=>{class n extends jO{constructor(t){super(Sn(ot({},t),{type:Vde}))}get controller(){return this._getControllerProps({type:Fde})}}return n.displayName="OrthographicView",n})();const Xx=Math.PI/180;function Ude({height:n,fovy:e,orbitAxis:t,rotationX:i,rotationOrbit:r,zoom:s}){const o=.5/Math.tan(e*Xx/2),a="Z"===t?[0,0,1]:[0,1,0],l="Z"===t?[0,-o,0]:[0,0,o],c=(new qn).lookAt({eye:l,up:a});c.rotateX(i*Xx),"Z"===t?c.rotateZ(r*Xx):c.rotateY(r*Xx);const u=Math.pow(2,s)/(n||1);return c.scale(u),c}class zde 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(Sn(ot({},e),{longitude:null,viewMatrix:Ude({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]=j0([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 Hde=(()=>{class n extends jO{constructor(t={}){const{orbitAxis:i="Z"}=t;super(Sn(ot({},t),{orbitAxis:i,type:zde}))}get controller(){return this._getControllerProps({type:kde})}}return n.displayName="OrbitView",n})();const Gde=[255,255,255],$de=1;let Wde=0;class Vz{constructor(e={}){const{color:t=Gde}=e,{intensity:i=$de}=e;this.id=e.id||"ambient-".concat(Wde++),this.color=t,this.intensity=i,this.type="ambient"}}const qde=[255,255,255],Yde=1,Xde=[0,0,-1];let Kde=0;class jz{constructor(e={}){const{color:t=qde}=e,{intensity:i=Yde}=e,{direction:r=Xde}=e,{_shadow:s=!1}=e;this.id=e.id||"directional-".concat(Kde++),this.color=t,this.intensity=i,this.type="directional",this.direction=new Mo(r).normalize().toArray(),this.shadow=s}getProjectedLight(){return this}}class Uz{constructor(e={}){const{id:t="effect"}=e;this.id=t,this.props=ot({},e)}preRender(){}getModuleParameters(){}cleanup(){}}class zO extends class{constructor(e,t={}){const{id:i="pass"}=t;this.id=i,this.gl=e,this.props=ot({},t)}setProps(e){Object.assign(this.props,e)}render(){}cleanup(){}}{render(e){return Xu(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){Xu(n,{viewport:[0,0,n.drawingBufferWidth,n.drawingBufferHeight]}),n.clear(16640)}(o);const a=[];for(const l of t){const c=l.viewport||l,u=i&&i[c.id];r(c);const h=this._getDrawLayerParams(c,e);e.view=u;const f=c.subViewports||[c];for(const g of f){e.viewport=g;const m=this._drawLayersInViewport(o,e,h);a.push(m)}}return a}_getDrawLayerParams(e,{layers:t,pass:i,layerFilter:r,effects:s,moduleParameters:o}){const a=[],l=zz(),c={viewport:e,isPicking:i.startsWith("picking"),renderPass:i};for(let u=0;ufI(e,c))}const l={totalCount:t.length,visibleCount:0,compositeCount:0,pickableCount:0};Xu(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 u=t[l]=t[l]||zz(e[l],e);c=u(r,s),t[a]=u}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 ehe extends zO{constructor(e,t){super(e,t),this.shadowMap=new ya(e,{width:1,height:1,parameters:{10241:9729,10240:9729,10242:33071,10243:33071}}),this.depthBuffer=new zg(e,{format:33189,width:1,height:1}),this.fbo=new ks(e,{id:"shadowmap",width:1,height:1,attachments:{36064:this.shadowMap,36096:this.depthBuffer}})}render(e){const t=this.fbo;hc(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(Sn(ot({},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 nhe=Object.keys(Vi).map(n=>"const int COORDINATE_SYSTEM_".concat(n," = ").concat(Vi[n],";")).join(""),ihe=Object.keys(Zc).map(n=>"const int PROJECTION_MODE_".concat(n," = ").concat(Zc[n],";")).join(""),rhe="".concat(nhe,"\n").concat(ihe,"\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"),she={},HO={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:rhe,getUniforms:function(n=she){return n.viewport?function({viewport:n,devicePixelRatio:e=1,modelMatrix:t=null,coordinateSystem:i=Vi.DEFAULT,coordinateOrigin:r,autoWrapLongitude:s=!1}={}){i===Vi.DEFAULT&&(i=n.isGeospatial?Vi.LNGLAT:Vi.CARTESIAN);const o=lce({viewport:n,devicePixelRatio:e,coordinateSystem:i,coordinateOrigin:r});return o.project_uWrapLongitude=s,o.project_uModelMatrix=t||sce,o}(n):{}}},che=Ox(function({viewport:n,center:e}){return new qn(n.viewProjectionMatrix).invert().transform(e)}),uhe=Ox(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=j0([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(u=>a.transform(u)),c=(new qn).ortho({left:Math.min(...l.map(u=>u[0])),right:Math.max(...l.map(u=>u[0])),bottom:Math.min(...l.map(u=>u[1])),top:Math.max(...l.map(u=>u[1])),near:Math.min(...l.map(u=>-u[2])),far:Math.max(...l.map(u=>-u[2]))});t.push(c.multiplyRight(o))}return t}),dhe=[0,0,0,1],hhe=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0],GO={name:"shadow",dependencies:[HO],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||dhe,shadow_uLightId:n.shadowLightId||0,shadow_uLightCount:n.shadowMatrices.length},i=che({viewport:n.viewport,center:e.project_uCenter}),r=[],s=uhe({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{}}},_he={color:[255,255,255],intensity:1},Hz=[{color:[255,255,255],intensity:1,direction:[-1,3,-1]},{color:[255,255,255],intensity:.9,direction:[1,-8,-2.5]}],yhe=[0,0,0,200/255];class $O extends Uz{constructor(e){super(e),this.ambientLight=null,this.directionalLights=[],this.pointLights=[],this.shadowColor=yhe,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=F0.getDefaultProgramManager(e),GO&&this.programManager.addDefaultModule(GO)),this.dummyShadowMap||(this.dummyShadowMap=new ya(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(GO),this.programManager=null)}_createLightMatrix(){const e=[];for(const t of this.directionalLights){const i=(new qn).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=vhe++;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 whe{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=q0(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 Ehe{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 whe(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 xhe=[{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"},HO],She=["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 Che(n){const e=F0.getDefaultProgramManager(n);for(const t of xhe)e.addDefaultModule(t);for(const t of She)e.addShaderHook(t);return e}const Mhe=Object.seal({layerManager:null,resourceManager:null,deck:null,gl:null,stats:null,shaderCache:null,pickingFBO:null,mousePosition:null,userData:{}});class Dhe{constructor(e,{deck:t,stats:i,viewport:r,timeline:s}={}){this.lastRenderedLayers=[],this.layers=[],this.resourceManager=new Ehe({gl:e,protocol:"deck://"}),this.context=Sn(ot({},Mhe),{layerManager:this,gl:e,deck:t,programManager:e&&Che(e),stats:i||new oI({id:"deck.gl"}),viewport:r||new Jg({id:"DEFAULT-INITIAL-VIEWPORT"}),timeline:s||new Gz,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){Do("layerManager.setLayers",this,t,e),this.lastRenderedLayers=e,e=xI(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 Do("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]?Ri.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&&Ri.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 Ihe{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=xI(e,Boolean),this._diffViews(e,this.views)&&this.setNeedsUpdate("views changed"),this.views=e}_setViewState(e){e?(!X0(e,this.viewState)&&this.setNeedsUpdate("viewState changed"),this.viewState=e):Ri.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)(ot({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=Sn(ot(ot(ot({},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 u=r[a.id];a.controller&&!u&&(s=!0),(s||!a.controller)&&u&&(u.finalize(),u=null),this.controllers[a.id]=this._updateController(a,l,c,u),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 Rhe extends Bz{constructor({makeViewport:e,width:t,height:i,latitude:r,longitude:s,zoom:o,bearing:a=0,pitch:l=0,altitude:c=1.5,maxZoom:u=20,minZoom:h=0,maxPitch:f=60,minPitch:g=0,startPanLngLat:m,startZoomLngLat:v,startRotatePos:x,startBearing:U,startPitch:D,startZoom:ie,normalize:_e}={}){fc(Number.isFinite(s)),fc(Number.isFinite(r)),fc(Number.isFinite(o)),super({width:t,height:i,latitude:r,longitude:s,zoom:o,bearing:a,pitch:l,altitude:c,maxZoom:u,minZoom:h,maxPitch:f,minPitch:g,normalize:_e}),this._state={startPanLngLat:m,startZoomLngLat:v,startRotatePos:x,startBearing:U,startPitch:D,startZoom:ie},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(Sn(ot({},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(Sn(ot({},this._viewportProps),{zoom:o}));return this._getUpdatedState(ot({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=ot({},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(ot(ot(ot({makeViewport:this.makeViewport},this._viewportProps),this._state),e))}_applyConstraints(e){const{maxZoom:t,minZoom:i,zoom:r}=e;e.zoom=Ua(r,i,t);const{maxPitch:s,minPitch:o,pitch:a}=e;e.pitch=Ua(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=LU(t+180,360)-180),(o<-180||o>180)&&(o=LU(o+180,360)-180);const a=qI(e/512);if(r<=a)r=a,i=0;else{const l=e/2/Math.pow(2,r),c=Zg([0,l])[1];if(iu&&(i=u)}}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 Ua(t+Math.log2(e),r,i)}_calculateNewPitchAndBearing({deltaScaleX:e,deltaScaleY:t,startBearing:i,startPitch:r}){t=Ua(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 u=0;return r>0?Math.abs(l-o)>5&&(u=r/(o-l)*1.2):r<0&&o>5&&(u=1-s/o),u=Math.min(1,Math.max(-1,u)),{deltaScaleX:c,deltaScaleY:u}}}class Phe extends UO{constructor(e){e.dragMode=e.dragMode||"pan",super(Rhe,e)}setProps(e){const t=this.controllerStateProps;super.setProps(e),(!t||t.height!==e.height)&&this.updateViewport(new this.ControllerState(ot(ot({makeViewport:this.makeViewport},this.controllerStateProps),this._state)))}get linearTransitionProps(){return["longitude","latitude","zoom","bearing","pitch"]}}let Nhe=(()=>{class n extends jO{constructor(t){super(Sn(ot({},t),{type:KU}))}get controller(){return this._getControllerProps({type:Phe})}}return n.displayName="MapView",n})();const khe=new $O;class Fhe{constructor(){this.effects=[],this._internalEffects=[],this._needsRedraw="Initial render",this.setEffects()}setProps(e){"effects"in e&&(e.effects.length!==this.effects.length||!X0(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 $O)||this._internalEffects.push(khe)}}class Lhe extends zO{}const Wz={blendFunc:[1,0,32771,0],blendEquation:32774};class qz extends zO{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:u},pass:h="picking",redrawReason:f,pickZ:g}){const m=this.gl;return this.pickZ=g,hc(m,Sn(ot({scissorTest:!0,scissor:[a,l,c,u],clearColor:[0,0,0,0],depthMask:!0,depthTest:!0,depthRange:[0,1],colorMask:[!0,!0,!0,!0]},Wz),{blend:!g}),()=>{super.render({target:o,layers:e,layerFilter:t,views:i,viewports:r,onViewportActive:s,pass:h,redrawReason:f})})}shouldDrawLayer(e){return e.props.pickable}getModuleParameters(){return{pickingActive:1,pickingAttribute:this.pickZ,lightSources:{}}}getLayerParameters(e,t){const i=this.pickZ?{blend:!1}:Sn(ot({},Wz),{blend:!0,blendColor:[0,0,0,this.useAlpha?(t+1)/255:1]});return ot(ot({},e.props.parameters),i)}}class Vhe{constructor(e){this.gl=e,this.layerFilter=null,this.drawPickingColors=!1,this.drawLayersPass=new Lhe(e),this.pickLayersPass=new qz(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||ks.getDefaultFramebuffer(this.gl),this._preRender(e.effects,e);const i=this.lastPostProcessEffect?this.renderBuffers[0]:e.target,r=t.render(Sn(ot({},e),{target:i}));this._postRender(e.effects,e),this.renderCount++,Do("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 ks(this.gl),new ks(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 jhe={pickedColor:null,pickedLayer:null,pickedObjectIndex:-1};function Uhe({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 u=r*r,h=-1,f=0;for(let g=0;gu)f+=4*l;else for(let x=0;x=0){const D=x+o-t,ie=D*D+v;ie<=u&&(u=ie,h=f)}f+=4}}if(h>=0){const g=n[h+3]-1,m=n.slice(h,h+4),v=e[g];if(v){const x=v.decodePickingColor(m),U=Math.floor(h/4/l);return{pickedColor:m,pickedLayer:v,pickedObjectIndex:x,pickedX:o+(h/4-U*l),pickedY:a+U}}Ri.error("Picked non-existent layer. Is picking buffer corrupt?")()}}return jhe}function Yz({pickInfo:n,mode:e,viewports:t,layerFilter:i,pixelRatio:r,x:s,y:o,z:a}){const l=n&&n.pickedLayer,u=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&&(f=>i({layer:l,viewport:f,isPicking:!0,renderPass:"picking:".concat(e)}))),h=u&&u.unproject([s-u.x,o-u.y],{targetZ:a});return{color:null,layer:null,viewport:u,index:-1,picked:!1,x:s,y:o,pixel:[s,o],coordinate:h,devicePixel:n&&[n.pickedX,n.pickedY],pixelRatio:r}}function Hhe(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 h=t.index,f=t.layerId,g=o&&o.props.id;if(g!==f||a!==h){if(g!==f){const m=r.find(v=>v.props.id===f);m&&l.unshift(m)}t.layerId=g,t.index=a,t.info=null}}const c=Yz(n),u=new Map;return u.set(null,c),l.forEach(h=>{let f=ot({},c);h===o&&(f.color=s,f.index=a,f.picked=!0),f=Xz({layer:h,info:f,mode:i}),h===o&&"hover"===i&&(t.info=f),u.set(f.layer.id,f),"hover"===i&&f.layer.updateAutoHighlight(f)}),u}function Xz({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 $he{constructor(e){this.gl=e,this.pickingFBO=null,this.pickLayersPass=new qz(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(f=>f.id===o):null,c=a&&r.find(f=>f.id===a)||r[0],u=c&&c.unproject([e-c.x,t-c.y]),h={x:e,y:t,viewport:c,coordinate:u,layer:l};return l?ot(ot({},s),h):Object.assign(h,{color:null,object:null,index:-1})}_resizeBuffer(){const{gl:e}=this;return this.pickingFBO||(this.pickingFBO=new ks(e),ks.isSupported(e,{colorBufferFloat:!0})&&(this.depthFBO=new ks(e),this.depthFBO.attach({36064:new ya(e,{format:Ci(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?(Ri.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:u}){if(!(e=this._getPickable(e)))return{result:[],emptyInfo:Yz({viewports:i,x:r,y:s})};this._resizeBuffer();const h=Vg(this.gl),f=iI(this.gl,[r,s],!0),g=[f.x+Math.floor(f.width/2),f.y+Math.floor(f.height/2)],m=Math.round(o*h),{width:v,height:x}=this.pickingFBO,U=this._getPickingRect({deviceX:g[0],deviceY:g[1],deviceRadius:m,deviceWidth:v,deviceHeight:x});let D;const ie=[],_e={};for(let Pe=0;Pe=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)}):Ri.error("Picked non-existent layer. Is picking buffer corrupt?")()}}}return Array.from(t.values())}({pickedColors:this._drawAndSample({layers:e,views:t,viewports:i,onViewportActive:u,deviceRect:{x:g,y:U,width:v.x+v.width-g,height:m-U},pass:"picking:".concat(l),redrawReason:l}),layers:e}),Pe=new Map,Ne=Number.isFinite(c);for(let Ve=0;Ve<_e.length&&!(Ne&&Pe.size>=c);Ve++){const bt=_e[Ve];let xt={color:bt.pickedColor,layer:null,index:bt.pickedObjectIndex,picked:!0,x:r,y:s,width:o,height:a,pixelRatio:h};xt=Xz({layer:bt.pickedLayer,info:xt,mode:l}),Pe.has(xt.object)||Pe.set(xt.object,xt)}return Array.from(Pe.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:u,y:h,width:f,height:g}=s,m=new(l?Float32Array:Uint8Array)(f*g*4);return px(c,{sourceX:u,sourceY:h,sourceWidth:f,sourceHeight:g,target:m}),m}_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 Whe={zIndex:1,position:"absolute",pointerEvents:"none",color:"#a0a7b4",backgroundColor:"#29323c",padding:"10px",top:0,left:0,display:"none"};class qhe{constructor(e){const t=e.parentElement;t&&(this.el=document.createElement("div"),this.el.className="deck-tooltip",Object.assign(this.el.style,Whe),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 Kz(n,e){if(!n)throw new Error(e)}const su={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},Qz=su.global||su.self||su.window,Xhe="object"!=typeof process||"[object process]"!==String(process)||process.browser,Zz="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version),{_parseImageNode:Khe}=(Zz&&parseFloat(Zz[1]),Qz),WO="undefined"!=typeof Image,qO="undefined"!=typeof ImageBitmap,Qhe=Boolean(Khe),YO=!!Xhe||Qhe;function Jz(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 e4(n){switch(Jz(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 efe=/^data:image\/svg\+xml/,tfe=/\.svg((\?|#).*)?$/;function XO(n){return n&&(efe.test(n)||tfe.test(n))}function nfe(n,e){if(XO(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 n4(n,e)}function n4(n,e){if(XO(e))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(n)])}function i4(n,e,t){return KO.apply(this,arguments)}function KO(){return(KO=li(function*(n,e,t){const i=nfe(n,t),r=self.URL||self.webkitURL,s="string"!=typeof i&&r.createObjectURL(i);try{return yield ife(s||i,e)}finally{s&&r.revokeObjectURL(s)}})).apply(this,arguments)}function ife(n,e){return QO.apply(this,arguments)}function QO(){return(QO=li(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 rfe={};let r4=!0;function sfe(n,e,t){return ZO.apply(this,arguments)}function ZO(){return(ZO=li(function*(n,e,t){let i;i=XO(t)?yield i4(n,e,t):n4(n,t);const r=e&&e.imagebitmap;return yield ofe(i,r)})).apply(this,arguments)}function ofe(n){return JO.apply(this,arguments)}function JO(){return(JO=li(function*(n,e=null){if((afe(e)||!r4)&&(e=null),e)try{return yield createImageBitmap(n,e)}catch(t){console.warn(t),r4=!1}return yield createImageBitmap(n)})).apply(this,arguments)}function afe(n){for(const e in n||rfe)return!1;return!0}const ou=!1,Q0=!0;function eR(n){const e=Z0(n);return function(n){const e=Z0(n);return e.byteLength>=24&&2303741511===e.getUint32(0,ou)?{mimeType:"image/png",width:e.getUint32(16,ou),height:e.getUint32(20,ou)}:null}(e)||function(n){const e=Z0(n);if(!(e.byteLength>=3&&65496===e.getUint16(0,ou)&&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,ou)?{mimeType:"image/gif",width:e.getUint16(6,Q0),height:e.getUint16(8,Q0)}:null}(e)||function(n){const e=Z0(n);return e.byteLength>=14&&16973===e.getUint16(0,ou)&&e.getUint32(2,Q0)===e.byteLength?{mimeType:"image/bmp",width:e.getUint32(18,Q0),height:e.getUint32(22,Q0)}:null}(e)}function Z0(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 ffe(n,e){const{mimeType:t}=eR(n)||{},{_parseImageNode:i}=Qz;return Kz(i),i(n,t,e)}function tR(){return(tR=li(function*(n,e,t){const r=((e=e||{}).image||{}).type||"auto",{url:s}=t||{};let a;switch(gfe(r)){case"imagebitmap":a=yield sfe(n,e,s);break;case"image":a=yield i4(n,e,s);break;case"data":a=yield ffe(n,e);break;default:Kz(!1)}return"data"===r&&(a=e4(a)),a})).apply(this,arguments)}function gfe(n){switch(n){case"auto":case"data":return function(){if(qO)return"imagebitmap";if(WO)return"image";if(YO)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}();default:return function(n){switch(n){case"auto":return qO||WO||YO;case"imagebitmap":return qO;case"image":return WO;case"data":return YO;default:throw new Error(`@loaders.gl/images: image ${n} not supported in this environment`)}}(n),n}}const nR={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 tR.apply(this,arguments)},tests:[n=>Boolean(eR(new DataView(n)))],options:{image:{type:"auto",decode:!0}}};var nm=et(4761);const _fe={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},J0="8.5.8",Kx=nm.CO.deck&&nm.CO.deck.VERSION;if(Kx&&Kx!==J0)throw new Error("deck.gl - multiple versions detected: ".concat(Kx," vs ").concat(J0));Kx||(Ri.log(1,"deck.gl ".concat(J0))(),nm.CO.deck=Object.assign(nm.CO.deck||{},{VERSION:J0,version:J0,log:Ri,_registerLoggers:function(n){AI=n}}),Mz([_fe,[nR,{imagebitmap:{premultiplyAlpha:"none"}}]]));const yfe=nm.CO.deck;class Qx extends Ku{get[Symbol.toStringTag](){return"Query"}static isSupported(e,t=[]){const i=Ci(e),r=gj(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:on(!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 Qx.isSupported(this.gl)?this.gl2.createQuery():null}_deleteHandle(){this.gl2.deleteQuery(this.handle)}}const s4=fx()&&"undefined"!=typeof document;let Mfe=0;class Dfe{constructor(e={}){const{onCreateContext:t=(x=>XV(x)),onAddHTML:i=null,onInitialize:r=(()=>{}),onRender:s=(()=>{}),onFinalize:o=(()=>{}),onError:a,gl:l=null,glOptions:c={},debug:u=!1,createFramebuffer:h=!1,autoResizeViewport:f=!0,autoResizeDrawingBuffer:g=!0,stats:m=Rf.get("animation-loop-"+Mfe++)}=e;let{useDevicePixels:v=!0}=e;"useDevicePixelRatio"in e&&(mn.deprecated("useDevicePixelRatio","useDevicePixels")(),v=e.useDevicePixelRatio),this.props={onCreateContext:t,onAddHTML:i,onInitialize:r,onRender:s,onFinalize:o,onError:a,gl:l,glOptions:c,debug:u,createFramebuffer:h},this.gl=l,this.needsRedraw=null,this.timeline=null,this.stats=m,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:f,autoResizeDrawingBuffer:g,useDevicePixels:v}),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 on("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=Qx.isSupported(this.gl,["timers"])?new Qx(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 li(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 mn.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=s4?new Promise((e,t)=>{s4&&"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?sI(this.props.gl,e):this.onCreateContext(e),!dx(this.gl))throw new Error("AnimationLoop.onCreateContext - illegal context returned");(function(n){Xu(n,nI)})(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)&&(mn.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)&&(mn.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 ks(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 Ife=et(1524),Zx=et.n(Ife);const Ofe={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}))}}(Zx().MouseInput);const kfe=Zx().Manager,au=Zx(),Ffe=au?[[au.Pan,{event:"tripan",pointers:3,threshold:0,enable:!1}],[au.Rotate,{enable:!1}],[au.Pinch,{enable:!1}],[au.Swipe,{enable:!1}],[au.Pan,{threshold:0,enable:!1}],[au.Press,{enable:!1}],[au.Tap,{event:"doubletap",taps:2,enable:!1}],[au.Tap,{event:"anytap",enable:!1}],[au.Tap,{enable:!1}]]:null,l4={tripan:["rotate","pinch","pan"],rotate:["pinch"],pinch:["pan"],pan:["press","doubletap","anytap","tap"],doubletap:["anytap"],anytap:["tap"]},Lfe={doubletap:["tap"]},Bfe={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"]},Vfe={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"},c4={click:"tap",anyclick:"anytap",dblclick:"doubletap",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup",mouseover:"pointerover",mouseout:"pointerout",mouseleave:"pointerleave"},jfe="undefined"!=typeof navigator&&navigator.userAgent?navigator.userAgent.toLowerCase():"",im="undefined"!=typeof window?window:global;"undefined"!=typeof global?global:window,"undefined"!=typeof document&&document;let u4=!1;try{const n={get passive(){return u4=!0,!0}};im.addEventListener("test",n,n),im.removeEventListener("test",n,n)}catch(n){}const Ufe=-1!==jfe.indexOf("firefox"),{WHEEL_EVENTS:zfe}=rR,h4=4.000244140625;class $fe{constructor(e,t,i={}){this.element=e,this.callback=t,this.options=Object.assign({enable:!0},i),this.events=zfe.concat(i.events||[]),this.handleEvent=this.handleEvent.bind(this),this.events.forEach(r=>e.addEventListener(r,this.handleEvent,!!u4&&{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;im.WheelEvent&&(Ufe&&e.deltaMode===im.WheelEvent.DOM_DELTA_PIXEL&&(t/=im.devicePixelRatio),e.deltaMode===im.WheelEvent.DOM_DELTA_LINE&&(t*=40));const i={x:e.clientX,y:e.clientY};0!==t&&t%h4==0&&(t=Math.floor(t/h4)),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:Wfe}=rR,f4="pointermove",p4="pointerover",g4="pointerout",m4="pointerleave";class qfe{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=Wfe.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===f4&&(this.enableMoveEvent=t),e===p4&&(this.enableOverEvent=t),e===g4&&(this.enableOutEvent=t),e===m4&&(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:p4,srcEvent:e,pointerType:"mouse",target:e.target})}handleOutEvent(e){this.enableOutEvent&&"mouseout"===e.type&&this.callback({type:g4,srcEvent:e,pointerType:"mouse",target:e.target})}handleLeaveEvent(e){this.enableLeaveEvent&&"mouseleave"===e.type&&this.callback({type:m4,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:f4,srcEvent:e,pointerType:"mouse",target:e.target});break;case"mouseup":this.pressed=!1}}}const{KEY_EVENTS:Yfe}=rR,_4="keydown";class Xfe{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=Yfe.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===_4&&(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:_4,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 b4="contextmenu";class Kfe{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===b4&&(this.options.enable=t)}handleEvent(e){!this.options.enable||this.callback({type:b4,center:{x:e.clientX,y:e.clientY},srcEvent:e,pointerType:"mouse",target:e.target})}}const Qfe={pointerdown:1,pointermove:2,pointerup:4,mousedown:1,mousemove:2,mouseup:4},v4={srcElement:"root",priority:0};class cpe{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({},v4,i):v4;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 u=l.length-1;for(;u>=0&&!(l[u].priority>=c.priority);)u--;l.splice(u+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&&l4[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 $fe(e,this._onOtherEvent,{enable:!1}),this.moveInput=new qfe(e,this._onOtherEvent,{enable:!1}),this.keyInput=new Xfe(e,this._onOtherEvent,{enable:!1,tabIndex:t.tabIndex}),this.contextmenuInput=new Kfe(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=Lfe[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 u in e)this._addEventHandler(u,e[u],i,r,s);return}const{manager:o,events:a}=this,l=c4[e]||e;let c=a.get(l);c||(c=new cpe(this),a.set(l,c),c.recognizerName=Vfe[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(c4[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=Bfe[t.type];i&&this.manager.emit(i,e)}_onOtherEvent(e){this.manager.emit(e.type,e)}}function Vf(){}const w4={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:Vf,onResize:Vf,onViewStateChange:Vf,onInteractionStateChange:Vf,onBeforeRender:Vf,onAfterRender:Vf,onLoad:Vf,onError:(n,e)=>Ri.error(n)(),_onMetrics:null,getCursor:({isDragging:n})=>n?"grabbing":"grab",debug:!1,drawPickingColors:!1};class eS{constructor(e){e=ot(ot({},w4),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&&Ri.warn("View state tracking is disabled. Use either `initialViewState` for auto update or `viewState` for manual update.")(),"IE"===(0,nm.qs)()&&Ri.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 oI({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&&A0.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&&Ri.removed("onLayerHover","onHover")(),"onLayerClick"in e&&Ri.removed("onLayerClick","onClick")(),e.initialViewState&&!X0(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](ot({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),fc(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:u,autoResizeDrawingBuffer:h}=e;return new Dfe({width:t,height:i,useDevicePixels:u,autoResizeDrawingBuffer:h,autoResizeViewport:!1,gl:r,onCreateContext:f=>XV(Sn(ot(ot({},s),f),{canvas:this.canvas,debug:o,onContextLost:()=>this._onContextLost()})),onInitialize:f=>this._setGLContext(f.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 Nhe({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,sI(e,{enable:!0,copyState:!0})),this.tooltip=new qhe(this.canvas),Xu(e,{blend:!0,blendFunc:[770,771,1,771],polygonOffsetFill:!0,depthTest:!0,depthFunc:515}),this.props.onWebGLInitialized(e);const t=new Gz;t.play(),this.animationLoop.attachTimeline(t),this.eventManager=new dpe(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 PV)this.eventManager.on(r,this._onEvent);this.viewManager=new Ihe({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 Dhe(e,{deck:this,stats:this.stats,viewport:i,timeline:t}),this.effectManager=new Fhe,this.deckRenderer=new Vhe(e),this.deckPicker=new $he(e),this.setProps(this.props),this._updateCanvasSize(),this.props.onLoad()}_drawLayers(e,t){const{gl:i}=this.layerManager.context;Xu(i,this.props.parameters),this.props.onBeforeRender({gl:i}),this.deckRenderer.renderLayers(ot({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(),Ri.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=Sn(ot({},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=PV[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=Rf.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}}eS.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(Uz)),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}},eS.defaultProps=w4,eS.VERSION=yfe.VERSION;const tS={name:"project32",dependencies:[HO],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"},gpe={pickingSelectedColor:null,pickingHighlightColor:new Uint8Array([0,255,255,255]),pickingActive:!1,pickingAttribute:!1},nS=ot({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=gpe){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}}),E4={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6};class gh{static get DRAW_MODE(){return E4}constructor(e={}){const{id:t=ma("geometry"),drawMode:i=E4.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?ot({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,on(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?(on(!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 on(Number.isFinite(i)),i}}const x4=()=>{},wpe={10241:9987,10240:9729,10242:33071,10243:33071};function Epe(n){return Math.pow(2,Math.ceil(Math.log2(n)))}function xpe(n,e,t,i){return t===e.width&&i===e.height?e:(n.canvas.height=i,n.canvas.width=t,n.clearRect(0,0,n.canvas.width,n.canvas.height),n.drawImage(e,0,0,e.width,e.height,0,0,t,i),n.canvas)}function eb(n){return n&&(n.id||n.url)}function S4(n,e,t){for(let i=0;i0){const{mapping:i,xOffset:r,yOffset:s,rowHeight:o,canvasHeight:a}=function({icons:n,buffer:e,mapping:t={},xOffset:i=0,yOffset:r=0,rowHeight:s=0,canvasWidth:o}){let a=[];for(let l=0;lo&&(S4(t,a,r),i=0,r=s+r+e,s=0,a=[]),a.push({icon:c,xOffset:i}),i=i+f+e,s=Math.max(s,h)}}return a.length>0&&S4(t,a,r),{mapping:t,rowHeight:s,xOffset:i,yOffset:r,canvasWidth:o,canvasHeight:Epe(s+r+e)}}({icons:t,buffer:this._buffer,canvasWidth:this._canvasWidth,mapping:this._mapping,rowHeight:this._rowHeight,xOffset:this._xOffset,yOffset:this._yOffset});this._rowHeight=o,this._mapping=i,this._xOffset=r,this._yOffset=s,this._canvasHeight=a,this._texture||(this._texture=new ya(this.gl,{width:this._canvasWidth,height:this._canvasHeight,parameters:wpe})),this._texture.height!==this._canvasHeight&&(this._texture=function(n,e,t,i){const r=e.width,s=e.height,o=hj(e,{width:t,height:i});return function(n,e,t={}){const{sourceX:i=0,sourceY:r=0,targetMipmaplevel:s=0,targetInternalFormat:o=6408}=t;let{targetX:a,targetY:l,targetZ:c,width:u,height:h}=t;const{framebuffer:f,deleteFramebuffer:g}=T0(n);on(f);const{gl:m,handle:v}=f,x=void 0!==a||void 0!==l||void 0!==c;a=a||0,l=l||0,c=c||0;const U=m.bindFramebuffer(36160,v);on(e);let D=null;if(e instanceof Pf&&(D=e,u=Number.isFinite(u)?u:D.width,h=Number.isFinite(h)?h:D.height,D.bind(0),e=D.target),x)switch(e){case 3553:case 34067:m.copyTexSubImage2D(e,s,a,l,i,r,u,h);break;case 35866:case 32879:Ao(m).copyTexSubImage3D(e,s,a,l,c,i,r,u,h)}else m.copyTexImage2D(e,s,o,i,r,u,h,0);D&&D.unbind(),m.bindFramebuffer(36160,U||null),g&&f.delete()}(e,o,{targetY:0,width:r,height:s}),e.delete(),o}(0,this._texture,this._canvasWidth,this._canvasHeight)),this.onUpdate(),this._loadIcons(t)}}_loadIcons(e){const t=this._canvas.getContext("2d");for(const i of e)this._pendingCount++,q0(i.url,nR,this._loadOptions).then(r=>{const s=eb(i),{x:o,y:a,width:l,height:c}=this._mapping[s],u=xpe(t,r,l,c);this._texture.setSubImageData({data:u,x:o,y:a,width:l,height:c}),this._texture.generateMipmap(),this.onUpdate()}).catch(r=>{this.onError({url:i.url,source:i.source,sourceIndex:i.sourceIndex,loadOptions:this._loadOptions,error:r})}).finally(()=>{this._pendingCount--})}}const C4=[0,0,0,255],Mpe={iconAtlas:{type:"image",value:null,async:!0},iconMapping:{type:"object",value:{},async:!0},sizeScale:{type:"number",value:1,min:0},billboard:!0,sizeUnits:"pixels",sizeMinPixels:{type:"number",min:0,value:0},sizeMaxPixels:{type:"number",min:0,value:Number.MAX_SAFE_INTEGER},alphaCutoff:{type:"number",value:.05,min:0,max:1},getPosition:{type:"accessor",value:n=>n.position},getIcon:{type:"accessor",value:n=>n.icon},getColor:{type:"accessor",value:C4},getSize:{type:"accessor",value:1},getAngle:{type:"accessor",value:0},getPixelOffset:{type:"accessor",value:[0,0]},onIconError:{type:"function",value:null,compare:!1,optional:!0}};let Dpe=(()=>{class n extends Y0{getShaders(){return super.getShaders({vs:"#define SHADER_NAME icon-layer-vertex-shader\n\nattribute vec2 positions;\n\nattribute vec3 instancePositions;\nattribute vec3 instancePositions64Low;\nattribute float instanceSizes;\nattribute float instanceAngles;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\nattribute vec4 instanceIconFrames;\nattribute float instanceColorModes;\nattribute vec2 instanceOffsets;\nattribute vec2 instancePixelOffset;\n\nuniform float sizeScale;\nuniform vec2 iconsTextureDim;\nuniform float sizeMinPixels;\nuniform float sizeMaxPixels;\nuniform bool billboard;\n\nvarying float vColorMode;\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\nvarying vec2 uv;\n\nvec2 rotate_by_angle(vec2 vertex, float angle) {\n float angle_radian = angle * PI / 180.0;\n float cos_angle = cos(angle_radian);\n float sin_angle = sin(angle_radian);\n mat2 rotationMatrix = mat2(cos_angle, -sin_angle, sin_angle, cos_angle);\n return rotationMatrix * vertex;\n}\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n geometry.uv = positions;\n geometry.pickingColor = instancePickingColors;\n uv = positions;\n\n vec2 iconSize = instanceIconFrames.zw;\n float sizePixels = clamp(\n project_size_to_pixel(instanceSizes * sizeScale), \n sizeMinPixels, sizeMaxPixels\n );\n float instanceScale = iconSize.y == 0.0 ? 0.0 : sizePixels / iconSize.y;\n vec2 pixelOffset = positions / 2.0 * iconSize + instanceOffsets;\n pixelOffset = rotate_by_angle(pixelOffset, instanceAngles) * instanceScale;\n pixelOffset += instancePixelOffset;\n pixelOffset.y *= -1.0;\n\n if (billboard) {\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, vec3(0.0), geometry.position);\n vec3 offset = vec3(pixelOffset, 0.0);\n DECKGL_FILTER_SIZE(offset, geometry);\n gl_Position.xy += project_pixel_size_to_clipspace(offset.xy);\n\n } else {\n vec3 offset_common = vec3(project_pixel_size(pixelOffset), 0.0);\n DECKGL_FILTER_SIZE(offset_common, geometry);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, offset_common, geometry.position); \n }\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n vTextureCoords = mix(\n instanceIconFrames.xy,\n instanceIconFrames.xy + iconSize,\n (positions.xy + 1.0) / 2.0\n ) / iconsTextureDim;\n\n vColor = instanceColors;\n DECKGL_FILTER_COLOR(vColor, geometry);\n\n vColorMode = instanceColorModes;\n}\n",fs:"#define SHADER_NAME icon-layer-fragment-shader\n\nprecision highp float;\n\nuniform float opacity;\nuniform sampler2D iconsTexture;\nuniform float alphaCutoff;\n\nvarying float vColorMode;\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\nvarying vec2 uv;\n\nvoid main(void) {\n geometry.uv = uv;\n\n vec4 texColor = texture2D(iconsTexture, vTextureCoords);\n vec3 color = mix(texColor.rgb, vColor.rgb, vColorMode);\n float a = texColor.a * opacity * vColor.a;\n\n if (a < alphaCutoff) {\n discard;\n }\n\n gl_FragColor = vec4(color, a);\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:[tS,nS]})}initializeState(){this.state={iconManager:new Ape(this.context.gl,{onUpdate:this._onUpdate.bind(this),onError:this._onError.bind(this)})},this.getAttributeManager().addInstanced({instancePositions:{size:3,type:5130,fp64:this.use64bitPositions(),transition:!0,accessor:"getPosition"},instanceSizes:{size:1,transition:!0,accessor:"getSize",defaultValue:1},instanceOffsets:{size:2,accessor:"getIcon",transform:this.getInstanceOffset},instanceIconFrames:{size:4,accessor:"getIcon",transform:this.getInstanceIconFrame},instanceColorModes:{size:1,type:5121,accessor:"getIcon",transform:this.getInstanceColorMode},instanceColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:!0,accessor:"getColor",defaultValue:C4},instanceAngles:{size:1,transition:!0,accessor:"getAngle"},instancePixelOffset:{size:2,transition:!0,accessor:"getPixelOffset"}})}updateState({oldProps:t,props:i,changeFlags:r}){super.updateState({props:i,oldProps:t,changeFlags:r});const s=this.getAttributeManager(),{iconAtlas:o,iconMapping:a,data:l,getIcon:c}=i,{iconManager:u}=this.state;u.setProps({loadOptions:i.loadOptions});let h=!1;if(o||this.internalState.isAsyncPropLoading("iconAtlas")?(t.iconAtlas!==i.iconAtlas&&u.setProps({iconAtlas:o,autoPacking:!1}),t.iconMapping!==i.iconMapping&&(u.setProps({iconMapping:a}),h=!0)):u.setProps({autoPacking:!0}),(r.dataChanged||r.updateTriggersChanged&&(r.updateTriggersChanged.all||r.updateTriggersChanged.getIcon))&&u.setProps({data:l,getIcon:c}),h&&(s.invalidate("instanceOffsets"),s.invalidate("instanceIconFrames"),s.invalidate("instanceColorModes")),r.extensionsChanged){var g;const{gl:m}=this.context;null===(g=this.state.model)||void 0===g||g.delete(),this.state.model=this._getModel(m),s.invalidateAll()}}get isLoaded(){return super.isLoaded&&this.state.iconManager.isLoaded}finalizeState(){super.finalizeState(),this.state.iconManager.finalize()}draw({uniforms:t}){const{sizeScale:i,sizeMinPixels:r,sizeMaxPixels:s,sizeUnits:o,billboard:a,alphaCutoff:l}=this.props,{iconManager:c}=this.state,{viewport:u}=this.context,h=c.getTexture();h&&this.state.model.setUniforms(t).setUniforms({iconsTexture:h,iconsTextureDim:[h.width,h.height],sizeScale:i*("pixels"===o?u.metersPerPixel:1),sizeMinPixels:r,sizeMaxPixels:s,billboard:a,alphaCutoff:l}).draw()}_getModel(t){return new Yg(t,Sn(ot({},this.getShaders()),{id:this.props.id,geometry:new gh({drawMode:6,attributes:{positions:{size:2,value:new Float32Array([-1,-1,-1,1,1,1,1,-1])}}}),isInstanced:!0}))}_onUpdate(){this.setNeedsRedraw()}_onError(t){const{onIconError:i}=this.getCurrentLayer().props;i?i(t):Ri.error(t.error)()}getInstanceOffset(t){const i=this.state.iconManager.getIconMapping(t);return[i.width/2-i.anchorX||0,i.height/2-i.anchorY||0]}getInstanceColorMode(t){return this.state.iconManager.getIconMapping(t).mask?1:0}getInstanceIconFrame(t){const i=this.state.iconManager.getIconMapping(t);return[i.x||0,i.y||0,i.width||0,i.height||0]}}return n.layerName="IconLayer",n.defaultProps=Mpe,n})();const A4=[],Ope={getIconOffsets:{type:"accessor",value:n=>n.offsets},alphaCutoff:.001,smoothing:.1,outlineWidth:0,outlineColor:{type:"color",value:[0,0,0,255]}};let Rpe=(()=>{class n extends Dpe{getShaders(){return Sn(ot({},super.getShaders()),{fs:"#define SHADER_NAME multi-icon-layer-fragment-shader\n\nprecision highp float;\n\nuniform float opacity;\nuniform sampler2D iconsTexture;\nuniform float gamma;\nuniform bool sdf;\nuniform float alphaCutoff;\nuniform float buffer;\nuniform float outlineBuffer;\nuniform vec4 outlineColor;\n\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\nvarying vec2 uv;\n\nvoid main(void) {\n geometry.uv = uv;\n\n if (!picking_uActive) {\n float alpha = texture2D(iconsTexture, vTextureCoords).a;\n vec4 color = vColor;\n if (sdf) {\n float distance = alpha;\n alpha = smoothstep(buffer - gamma, buffer + gamma, distance);\n\n if (outlineBuffer > 0.0) {\n float inFill = alpha;\n float inBorder = smoothstep(outlineBuffer - gamma, outlineBuffer + gamma, distance);\n color = mix(outlineColor, vColor, inFill);\n alpha = inBorder;\n }\n }\n float a = alpha * color.a;\n \n if (a < alphaCutoff) {\n discard;\n }\n\n gl_FragColor = vec4(color.rgb, a * opacity);\n }\n\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n"})}initializeState(){super.initializeState(),this.getAttributeManager().addInstanced({instanceOffsets:{size:2,accessor:"getIconOffsets"},instancePickingColors:{type:5121,size:3,accessor:(i,{index:r,target:s})=>this.encodePickingColor(r,s)}})}updateState(t){super.updateState(t);const{props:i,oldProps:r}=t;let{outlineColor:s}=i;s!==r.outlineColor&&(s=s.map(o=>o/255),s[3]=Number.isFinite(s[3])?s[3]:1,this.setState({outlineColor:s})),!i.sdf&&i.outlineWidth&&Ri.warn("".concat(this.id,": fontSettings.sdf is required to render outline"))()}draw(t){const{sdf:i,smoothing:r,outlineWidth:s}=this.props,{outlineColor:o}=this.state;t.uniforms=Sn(ot({},t.uniforms),{buffer:.75,outlineBuffer:s?Math.max(r,.75*(1-s)):-1,gamma:r,sdf:Boolean(i),outlineColor:o}),super.draw(t)}getInstanceOffset(t){return t?Array.from(t).map(i=>super.getInstanceOffset(i)):A4}getInstanceColorMode(t){return 1}getInstanceIconFrame(t){return t?Array.from(t).map(i=>super.getInstanceIconFrame(i)):A4}}return n.layerName="MultiIconLayer",n.defaultProps=Ope,n})();var Ppe=et(1002),Npe=et.n(Ppe);const Fpe=[];function Lpe(n){return Math.pow(2,Math.ceil(Math.log2(n)))}function M4(n,e,t,i){let r=0;for(let s=e;si&&(oa){let h=M4(n,a,l,r);c+h>i&&(oi&&(h=D4(n,a,l,i,r,s),o=s[s.length-1])),a=l,c+=h}}(n,r,s,t,i,o),o}function Upe(n,e,t,i,r,s){let o=0,a=0;for(let l=e;l0,u=[0,0],h=[];let f=0,g=0,m=0;for(let v=0;v<=s;v++){const x=n[v];if(("\n"===x||v===s)&&(m=v),m>g){const U=c?jpe(n,t,i,r,g,m):Fpe;for(let D=0;D<=U.length;D++){const ie=0===D?g:U[D-1],_e=Di===e);t>=0&&this._order.splice(t,1)}_appendOrder(e){this._order.push(e)}}(3),qpe=["fontFamily","fontWeight","characterSet","fontSize","sdf","buffer","cutoff","radius"];function Xpe(n,e){for(let t=0;t{o in e&&(this.props[o]=e[o])});const t=this._key;this._key=this._getKey();const i=function(n,e){const t=aR.get(n);if(!t)return e;const i=[];let s=Object.keys(t.mapping);s=new Set(s);let o=e;return o instanceof Array&&(o=new Set(o)),o.forEach(a=>{s.has(a)||i.push(a)}),i}(this._key,this.props.characterSet),r=aR.get(this._key);if(r&&0===i.length)return void(this._key!==t&&(this._atlas=r));const s=this._generateFontAtlas(this._key,i,r);this._atlas=s,aR.set(this._key,s)}_generateFontAtlas(e,t,i){const{fontFamily:r,fontWeight:s,fontSize:o,buffer:a,sdf:l,radius:c,cutoff:u}=this.props;let h=i&&i.data;h||(h=document.createElement("canvas"),h.width=1024);const f=h.getContext("2d");j4(f,r,o,s);const{mapping:g,canvasHeight:m,xOffset:v,yOffset:x}=function({characterSet:n,getFontWidth:e,fontHeight:t,buffer:i,maxCanvasWidth:r,mapping:s={},xOffset:o=0,yOffset:a=0}){let l=0,c=o,u=0;for(const f of n)if(!s[f]){const g=e(f,u++);c+g+2*i>r&&(c=0,l++),s[f]={x:c+i,y:a+l*(t+2*i)+i,width:g,height:t},c+=g+2*i}const h=t+2*i;return{mapping:s,xOffset:c,yOffset:a+l*h,canvasHeight:Lpe(a+(l+1)*h)}}(ot({getFontWidth:U=>f.measureText(U).width,fontHeight:1.2*o,buffer:a,characterSet:t,maxCanvasWidth:1024},i&&{mapping:i.mapping,xOffset:i.xOffset,yOffset:i.yOffset}));if(h.height!==m){const U=f.getImageData(0,0,h.width,h.height);h.height=m,f.putImageData(U,0,0)}if(j4(f,r,o,s),l){const U=new(Npe())(o,a,c,u,r,s),D=f.getImageData(0,0,U.size,U.size);for(const ie of t)Xpe(U.draw(ie),D),f.putImageData(D,g[ie].x-a,g[ie].y+a)}else for(const U of t)f.fillText(U,g[U].x,g[U].y+.9*o);return{xOffset:v,yOffset:x,mapping:g,data:h,width:h.width,height:h.height}}_getKey(){const{fontFamily:e,fontWeight:t,fontSize:i,buffer:r,sdf:s,radius:o,cutoff:a}=this.props;return s?"".concat(e," ").concat(t," ").concat(i," ").concat(r," ").concat(o," ").concat(a):"".concat(e," ").concat(t," ").concat(i," ").concat(r)}}const Jpe={billboard:!0,sizeScale:1,sizeUnits:"pixels",sizeMinPixels:0,sizeMaxPixels:Number.MAX_SAFE_INTEGER,padding:{type:"array",value:[0,0,0,0]},getPosition:{type:"accessor",value:n=>n.position},getSize:{type:"accessor",value:1},getAngle:{type:"accessor",value:0},getPixelOffset:{type:"accessor",value:[0,0]},getBoundingRect:{type:"accessor",value:[0,0,0,0]},getFillColor:{type:"accessor",value:[0,0,0,255]},getLineColor:{type:"accessor",value:[0,0,0,255]},getLineWidth:{type:"accessor",value:1}};let ege=(()=>{class n extends Y0{getShaders(){return super.getShaders({vs:"#define SHADER_NAME text-background-layer-vertex-shader\n\nattribute vec2 positions;\n\nattribute vec3 instancePositions;\nattribute vec3 instancePositions64Low;\nattribute vec4 instanceRects;\nattribute float instanceSizes;\nattribute float instanceAngles;\nattribute vec2 instancePixelOffsets;\nattribute float instanceLineWidths;\nattribute vec4 instanceFillColors;\nattribute vec4 instanceLineColors;\nattribute vec3 instancePickingColors;\n\nuniform bool billboard;\nuniform float opacity;\nuniform float sizeScale;\nuniform float sizeMinPixels;\nuniform float sizeMaxPixels;\nuniform vec4 padding;\n\nvarying vec4 vFillColor;\nvarying vec4 vLineColor;\nvarying float vLineWidth;\nvarying vec2 uv;\nvarying vec2 dimensions;\n\nvec2 rotate_by_angle(vec2 vertex, float angle) {\n float angle_radian = radians(angle);\n float cos_angle = cos(angle_radian);\n float sin_angle = sin(angle_radian);\n mat2 rotationMatrix = mat2(cos_angle, -sin_angle, sin_angle, cos_angle);\n return rotationMatrix * vertex;\n}\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n geometry.uv = positions;\n geometry.pickingColor = instancePickingColors;\n uv = positions;\n vLineWidth = instanceLineWidths;\n float sizePixels = clamp(\n project_size_to_pixel(instanceSizes * sizeScale),\n sizeMinPixels, sizeMaxPixels\n );\n\n dimensions = instanceRects.zw * sizePixels + padding.xy + padding.zw;\n\n vec2 pixelOffset = (positions * instanceRects.zw + instanceRects.xy) * sizePixels + mix(-padding.xy, padding.zw, positions);\n pixelOffset = rotate_by_angle(pixelOffset, instanceAngles);\n pixelOffset += instancePixelOffsets;\n pixelOffset.y *= -1.0;\n\n if (billboard) {\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, vec3(0.0), geometry.position);\n vec3 offset = vec3(pixelOffset, 0.0);\n DECKGL_FILTER_SIZE(offset, geometry);\n gl_Position.xy += project_pixel_size_to_clipspace(offset.xy);\n } else {\n vec3 offset_common = vec3(project_pixel_size(pixelOffset), 0.0);\n DECKGL_FILTER_SIZE(offset_common, geometry);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, offset_common, geometry.position);\n }\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n vFillColor = vec4(instanceFillColors.rgb, instanceFillColors.a * opacity);\n DECKGL_FILTER_COLOR(vFillColor, geometry);\n vLineColor = vec4(instanceLineColors.rgb, instanceLineColors.a * opacity);\n DECKGL_FILTER_COLOR(vLineColor, geometry);\n}\n",fs:"#define SHADER_NAME text-background-layer-fragment-shader\n\nprecision highp float;\n\nuniform bool stroked;\n\nvarying vec4 vFillColor;\nvarying vec4 vLineColor;\nvarying float vLineWidth;\nvarying vec2 uv;\nvarying vec2 dimensions;\n\nvoid main(void) {\n geometry.uv = uv;\n\n vec2 pixelPosition = uv * dimensions;\n if (stroked) {\n float distToEdge = min(\n min(pixelPosition.x, dimensions.x - pixelPosition.x),\n min(pixelPosition.y, dimensions.y - pixelPosition.y)\n );\n float isBorder = smoothedge(distToEdge, vLineWidth);\n gl_FragColor = mix(vFillColor, vLineColor, isBorder);\n } else {\n gl_FragColor = vFillColor;\n }\n\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:[tS,nS]})}initializeState(){this.getAttributeManager().addInstanced({instancePositions:{size:3,type:5130,fp64:this.use64bitPositions(),transition:!0,accessor:"getPosition"},instanceSizes:{size:1,transition:!0,accessor:"getSize",defaultValue:1},instanceAngles:{size:1,transition:!0,accessor:"getAngle"},instanceRects:{size:4,accessor:"getBoundingRect"},instancePixelOffsets:{size:2,transition:!0,accessor:"getPixelOffset"},instanceFillColors:{size:4,transition:!0,normalized:!0,type:5121,accessor:"getFillColor",defaultValue:[0,0,0,255]},instanceLineColors:{size:4,transition:!0,normalized:!0,type:5121,accessor:"getLineColor",defaultValue:[0,0,0,255]},instanceLineWidths:{size:1,transition:!0,accessor:"getLineWidth",defaultValue:1}})}updateState({props:t,oldProps:i,changeFlags:r}){if(super.updateState({props:t,oldProps:i,changeFlags:r}),r.extensionsChanged){var s;const{gl:o}=this.context;null===(s=this.state.model)||void 0===s||s.delete(),this.state.model=this._getModel(o),this.getAttributeManager().invalidateAll()}}draw({uniforms:t}){const{viewport:i}=this.context,{billboard:r,sizeScale:s,sizeUnits:o,sizeMinPixels:a,sizeMaxPixels:l,getLineWidth:c}=this.props;let{padding:u}=this.props;const h="pixels"===o?i.metersPerPixel:1;u.length<4&&(u=[u[0],u[1],u[0],u[1]]),this.state.model.setUniforms(t).setUniforms({billboard:r,stroked:Boolean(c),padding:u,sizeScale:s*h,sizeMinPixels:a,sizeMaxPixels:l}).draw()}_getModel(t){return new Yg(t,Sn(ot({},this.getShaders()),{id:this.props.id,geometry:new gh({drawMode:6,vertexCount:4,attributes:{positions:{size:2,value:new Float32Array([0,0,1,0,1,1,0,1])}}}),isInstanced:!0}))}}return n.layerName="TextBackgroundLayer",n.defaultProps=Jpe,n})();const U4={fontSize:64,buffer:4,sdf:!1,radius:12,cutoff:.25,smoothing:.1},z4={start:1,middle:0,end:-1},H4={top:1,center:0,bottom:-1},lR=[0,0,0,255],nge=["fontSize","buffer","sdf","radius","cutoff"],ige={billboard:!0,sizeScale:1,sizeUnits:"pixels",sizeMinPixels:0,sizeMaxPixels:Number.MAX_SAFE_INTEGER,background:!1,getBackgroundColor:{type:"accessor",value:[255,255,255,255]},getBorderColor:{type:"accessor",value:lR},getBorderWidth:{type:"accessor",value:0},backgroundPadding:{type:"array",value:[0,0,0,0]},characterSet:{type:"object",value:O4},fontFamily:R4,fontWeight:"normal",lineHeight:1,outlineWidth:{type:"number",value:0,min:0},outlineColor:{type:"color",value:lR},fontSettings:{},wordBreak:"break-word",maxWidth:{type:"number",value:-1},getText:{type:"accessor",value:n=>n.text},getPosition:{type:"accessor",value:n=>n.position},getColor:{type:"accessor",value:lR},getSize:{type:"accessor",value:32},getAngle:{type:"accessor",value:0},getTextAnchor:{type:"accessor",value:"middle"},getAlignmentBaseline:{type:"accessor",value:"center"},getPixelOffset:{type:"accessor",value:[0,0]},backgroundColor:{deprecatedFor:["background","getBackgroundColor"]}};let rge=(()=>{class n extends Nz{initializeState(){this.state={styleVersion:0,fontAtlasManager:new Kpe}}updateState({props:t,oldProps:i,changeFlags:r}){const o=this.state.characterSet;(r.dataChanged||r.updateTriggersChanged&&(r.updateTriggersChanged.all||r.updateTriggersChanged.getText))&&this._updateText();const a=o!==this.state.characterSet||this._fontChanged(i,t);a&&this._updateFontAtlas(i,t),(a||t.lineHeight!==i.lineHeight||t.wordBreak!==i.wordBreak||t.maxWidth!==i.maxWidth)&&this.setState({styleVersion:this.state.styleVersion+1})}getPickingInfo({info:t}){return t.object=t.index>=0?this.props.data[t.index]:null,t}_updateFontAtlas(t,i){const{fontSettings:r,fontFamily:s,fontWeight:o}=i,{fontAtlasManager:a,characterSet:l}=this.state;a.setProps(Sn(ot(ot({},U4),r),{characterSet:l,fontFamily:s,fontWeight:o}))}_fontChanged(t,i){if(t.fontFamily!==i.fontFamily||t.fontWeight!==i.fontWeight)return!0;if(t.fontSettings===i.fontSettings)return!1;const r=t.fontSettings||{},s=i.fontSettings||{};return nge.some(o=>r[o]!==s[o])}_updateText(){const{data:t,characterSet:i}=this.props,r=t.attributes&&t.attributes.getText;let a,{getText:s}=this.props,{startIndices:o}=t;const l="auto"===i&&new Set;if(r&&o){const{texts:c,characterCount:u}=function({value:n,length:e,stride:t,offset:i,startIndices:r,characterSet:s}){const o=n.BYTES_PER_ELEMENT,a=t?t/o:1,l=i?i/o:0,c=r[e]||Math.ceil((n.length-l)/a),u=s&&new Set,h=new Array(e);let f=n;if(a>1||l>0){f=new n.constructor(c);for(let g=0;gc[f]}else{const{iterable:c,objectInfo:u}=bx(t);o=[0],a=0;for(const h of c){u.index++;const f=Array.from(s(h,u)||"");l&&f.forEach(l.add,l),a+=f.length,o.push(a)}}this.setState({getText:s,startIndices:o,numInstances:a,characterSet:l||i})}getBoundingRect(t,i){const r=this.state.fontAtlasManager.mapping,{getText:s}=this.state,{wordBreak:o,maxWidth:a,lineHeight:l,getTextAnchor:c,getAlignmentBaseline:u}=this.props,h=s(t,i)||"",{size:[f,g]}=I4(h,l,o,a,r);return[(z4["function"==typeof c?c(t,i):c]-1)*f/2,(H4["function"==typeof u?u(t,i):u]-1)*g/2,f,g]}getIconOffsets(t,i){const r=this.state.fontAtlasManager.mapping,{getText:s}=this.state,{wordBreak:o,maxWidth:a,lineHeight:l,getTextAnchor:c,getAlignmentBaseline:u}=this.props,h=s(t,i)||"",{x:f,y:g,rowWidth:m,size:[v,x]}=I4(h,l,o,a,r),U=z4["function"==typeof c?c(t,i):c],D=H4["function"==typeof u?u(t,i):u],ie=f.length,_e=new Array(2*ie);let Pe=0;for(let Ne=0;Net*e/255)}const uR={name:"lights",vs:G4,fs:G4,getUniforms:function $4(n=sge){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?cR(n):[0,0,0],e.forEach((r,s)=>{i[`lighting_uPointLight[${s}].color`]=cR(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`]=cR(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 $4({lightSources:e})}return{}},defines:{MAX_LIGHTS:3}},age={};const cge={name:"phong-lighting",dependencies:[uR],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=age){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}}},dR=Math.PI/180,iS=new Float32Array(16),Y4=new Float32Array(12);function X4(n,e,t){const i=e[0]*dR,r=e[1]*dR,s=e[2]*dR,o=Math.sin(s),a=Math.sin(i),l=Math.sin(r),c=Math.cos(s),u=Math.cos(i),h=Math.cos(r),f=t[0],g=t[1],m=t[2];n[0]=f*h*u,n[1]=f*l*u,n[2]=f*-a,n[3]=g*(-l*c+h*a*o),n[4]=g*(h*c+l*a*o),n[5]=g*u*o,n[6]=m*(l*o+h*a*c),n[7]=m*(-h*o+l*a*c),n[8]=m*u*c}function K4(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 Q4={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,u=Array.isArray(s),h=Array.isArray(r),f=Array.isArray(o),g=c||!l&&Boolean(a(i[0]));n.constant=g?c:h&&u&&f;const m=n.value;if(n.constant){let v;g?(iS.set(a),v=K4(iS)):(v=Y4,X4(v,r,s),v.set(o,9)),n.value=new Float32Array(v)}else{let v=e*n.size;const{iterable:x,objectInfo:U}=bx(i,e,t);for(const D of x){let ie;U.index++,g?(iS.set(c?a:a(D,U)),ie=K4(iS)):(ie=Y4,X4(ie,h?r:r(D,U),u?s:s(D,U)),ie.set(f?o:o(D,U),9)),m[v++]=ie[0],m[v++]=ie[1],m[v++]=ie[2],m[v++]=ie[3],m[v++]=ie[4],m[v++]=ie[5],m[v++]=ie[6],m[v++]=ie[7],m[v++]=ie[8],m[v++]=ie[9],m[v++]=ie[10],m[v++]=ie[11]}}}};function Z4(n,e){return e===Vi.CARTESIAN||e===Vi.METER_OFFSETS||e===Vi.DEFAULT&&!n.isGeospatial}function J4(n,e){(n.COLOR_0||n.colors)&&e||(n.colors={constant:!0,value:new Float32Array([1,1,1])}),Ri.assert(n.positions||n.POSITION,'no "postions" or "POSITION" attribute in mesh')}function hge(n,e){if(n.attributes)return J4(n.attributes,e),n instanceof gh?n:new gh(n);if(n.positions||n.POSITION)return J4(n,e),new gh({attributes:n});throw Error("Invalid mesh")}const fge={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 pge=(()=>{class n extends Y0{getShaders(){const t=!Ci(this.context.gl),i={};return mI(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:[tS,cge,nS],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:Q4}),this.setState({emptyTexture:new ya(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||Z4(i,s),flatShading:!this.state.hasNormals}).draw()}getModel(t){const i=new Yg(this.context.gl,Sn(ot({},this.getShaders()),{id:this.props.id,geometry:hge(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=fge,n})();const eH={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:[uR]};class rm{constructor(e={}){const{id:t}=e;this.id=t||ma(this.constructor.name),this.display=!0,this.position=new Mo,this.rotation=new Mo,this.scale=new Mo(1,1,1),this.matrix=new qn,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 on(3===e.length,"setPosition requires vector argument"),this.position=e,this}setRotation(e){return on(3===e.length,"setRotation requires vector argument"),this.rotation=e,this}setScale(e){return on(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){on(e),t=t||this.matrix;const i=new qn(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 tb extends rm{constructor(e={}){e=Array.isArray(e)?{children:e}:e;const{children:t=[]}=e;mn.assert(t.every(i=>i instanceof rm),"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 qn}={}){const i=new qn(t).multiplyRight(this.matrix);for(const r of this.children)r instanceof tb?r.traverse(e,{worldMatrix:i}):e(r,{worldMatrix:i})}}function tH(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],u=e[7],h=e[8],f=t[0],g=t[1],m=t[2],v=t[3],x=t[4],U=t[5],D=t[6],ie=t[7],_e=t[8];return n[0]=f*i+g*o+m*c,n[1]=f*r+g*a+m*u,n[2]=f*s+g*l+m*h,n[3]=v*i+x*o+U*c,n[4]=v*r+x*a+U*u,n[5]=v*s+x*l+U*h,n[6]=D*i+ie*o+_e*c,n[7]=D*r+ie*a+_e*u,n[8]=D*s+ie*l+_e*h,n}function nH(n,e,t){var i=t[0],r=t[1];return n[0]=i*e[0],n[1]=i*e[1],n[2]=i*e[2],n[3]=r*e[3],n[4]=r*e[4],n[5]=r*e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n}function iH(){var n=new ba(4);return ba!=Float32Array&&(n[0]=0,n[1]=0,n[2]=0),n[3]=1,n}function rH(n){return n[0]=0,n[1]=0,n[2]=0,n[3]=1,n}function hR(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 rS(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],u=t[3];return n[0]=i*u+o*a+r*c-s*l,n[1]=r*u+o*l+s*a-i*c,n[2]=s*u+o*c+i*l-r*a,n[3]=o*u-i*a-r*l-s*c,n}function sH(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);return n[0]=i*l+o*a,n[1]=r*l+s*a,n[2]=s*l-r*a,n[3]=o*l-i*a,n}function oH(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);return n[0]=i*l-s*a,n[1]=r*l+o*a,n[2]=s*l+i*a,n[3]=o*l-r*a,n}function aH(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);return n[0]=i*l+r*a,n[1]=r*l-i*a,n[2]=s*l+o*a,n[3]=o*l-s*a,n}function lH(n,e){var t=e[0],i=e[1],r=e[2];return n[0]=t,n[1]=i,n[2]=r,n[3]=Math.sqrt(Math.abs(1-t*t-i*i-r*r)),n}function nb(n,e,t,i){var f,g,m,v,x,r=e[0],s=e[1],o=e[2],a=e[3],l=t[0],c=t[1],u=t[2],h=t[3];return(g=r*l+s*c+o*u+a*h)<0&&(g=-g,l=-l,c=-c,u=-u,h=-h),1-g>eu?(f=Math.acos(g),m=Math.sin(f),v=Math.sin((1-i)*f)/m,x=Math.sin(i*f)/m):(v=1-i,x=i),n[0]=v*r+x*l,n[1]=v*s+x*c,n[2]=v*o+x*u,n[3]=v*a+x*h,n}function cH(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;return n[0]=-t*a,n[1]=-i*a,n[2]=-r*a,n[3]=s*a,n}function uH(n,e){return n[0]=-e[0],n[1]=-e[1],n[2]=-e[2],n[3]=e[3],n}function fR(n,e){var i,t=e[0]+e[4]+e[8];if(t>0)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}return n}var dH=function(n,e,t){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n},pR=IU,gR=function(n,e){return n[0]*e[0]+n[1]*e[1]+n[2]*e[2]+n[3]*e[3]},hH=function(n,e,t,i){var r=e[0],s=e[1],o=e[2],a=e[3];return 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),n},fH=function(n){return Math.hypot(n[0],n[1],n[2],n[3])},pH=function(n){var e=n[0],t=n[1],i=n[2],r=n[3];return e*e+t*t+i*i+r*r},mH=function(){var n=bj(),e=vj(1,0,0),t=vj(0,1,0);return function(i,r,s){var o=wj(r,s);return o<-.999999?(D0(n,e,r),function(n){return Math.hypot(n[0],n[1],n[2])}(n)<1e-6&&D0(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),hR(i,n,Math.PI),i):o>.999999?(i[0]=0,i[1]=0,i[2]=0,i[3]=1,i):(D0(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))}}();iH(),iH(),function(){var n=new ba(9);ba!=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 Sge=[0,0,0,1];class mR extends mx{constructor(e=0,t=0,i=0,r=1){super(-0,-0,-0,-0),Array.isArray(e)&&1===arguments.length?this.copy(e):this.set(e,t,i,r)}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this.check()}set(e,t,i,r){return this[0]=e,this[1]=t,this[2]=i,this[3]=r,this.check()}fromMatrix3(e){return fR(this,e),this.check()}identity(){return rH(this),this.check()}fromAxisRotation(e,t){return hR(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]=nr(e)}get y(){return this[1]}set y(e){this[1]=nr(e)}get z(){return this[2]}set z(e){this[2]=nr(e)}get w(){return this[3]}set w(e){this[3]=nr(e)}len(){return fH(this)}lengthSquared(){return pH(this)}dot(e,t){if(void 0!==t)throw new Error("Quaternion.dot only takes one argument");return gR(this,e)}rotationTo(e,t){return mH(this,e,t),this.check()}add(e,t){if(void 0!==t)throw new Error("Quaternion.add only takes one argument");return dH(this,this,e),this.check()}calculateW(){return lH(this,this),this.check()}conjugate(){return uH(this,this),this.check()}invert(){return cH(this,this),this.check()}lerp(e,t,i){return hH(this,e,t,i),this.check()}multiplyRight(e,t){return Zu(!t),rS(this,this,e),this.check()}multiplyLeft(e,t){return Zu(!t),rS(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 sH(this,this,e),this.check()}rotateY(e){return oH(this,this,e),this.check()}rotateZ(e){return aH(this,this,e),this.check()}scale(e){return pR(this,this,e),this.check()}slerp(e,t,i){switch(arguments.length){case 1:({start:e=Sge,target:t,ratio:i}=arguments[0]);break;case 2:[t,i]=arguments,e=this}return nb(this,e,t,i),this.check()}transformVector4(e,t=e){return OU(t,e,this),_x(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)}}const Cge={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Tge={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function _H(n){if(!n._animation){const e=Tge[n.componentType],t=Cge[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;l{(function(n,{input:e,interpolation:t,output:i},r,s){const a=n%e[e.length-1],l=e.findIndex(f=>f>=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:mn.warn(`Bad animation path ${s}`)()}on(r[s].length===i[c].length);const u=e[c],h=e[l];switch(t){case"STEP":!function(n,e,t){for(let i=0;iu&&function(n,e,t,i,r){if("rotation"===e){_R.slerp({start:t,target:i,ratio:r});for(let s=0;s<_R.length;s++)n[e][s]=_R[s]}else for(let s=0;su&&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:_H(e.accessors[a]),interpolation:l,output:_H(e.accessors[c])})),o=t.channels.map(({sampler:a,target:l})=>({sampler:s[a],target:e.nodes[l.node],path:l.path}));return new Pge({name:r,channels:o})})}animate(e){this.setTime(e)}setTime(e){this.animations.forEach(t=>t.animate(e))}getAnimations(){return this.animations}}class kge extends rm{constructor(e,t={}){super(t),this.onBeforeRender=null,this.AfterRender=null,e instanceof Yg?(this.model=e,this._setModelNodeProps(t)):this.model=new Yg(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 Fge{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},mI(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 ya(this.gl,ot({id:e.name||e.id,parameters:ot(ot({},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&&(mn.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 yH(n,e){return Ci(n)?`#version 300 es\n${e}`:e}const jge={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Uge={modelOptions:{},pbrDebug:!1,imageBasedLightingEnvironment:null,lights:!0,useTangents:!1};class zge{constructor(e,t={}){this.gl=e,this.options=Object.assign({},Uge,t)}instantiate(e){return this.gltf=e,(e.scenes||[]).map(i=>this.createScene(i))}createAnimator(){return Array.isArray(this.gltf.animations)?new Nge(this.gltf):null}createScene(e){const i=(e.nodes||[]).map(s=>this.createNode(s));return new tb({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 tb({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 qn).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 tb({id:e.name||e.id,children:i});e._mesh=r}return e._mesh}getVertexCount(e){mn.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 Fge(n,e);mn.info(4,"createGLTFModel defines: ",a.defines)();const l=[];l.push(...a.generatedTextures),l.push(...Object.values(s).map(u=>u.buffer));const c=new kge(n,Object.assign({id:t,drawMode:i,vertexCount:r,modules:[eH],defines:a.defines,parameters:a.parameters,vs:yH(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:yH(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))),mn.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 lr(this.gl,{id:`from-${i.id}`,data:i.data||e.value,target:t})),i.lumaBuffers[t]}createAccessor(e,t){return new _a({buffer:t,offset:e.byteOffset||0,stride:e.bufferView.byteStride||0,type:e.componentType,size:jge[e.type]})}createSampler(e){return e}needsPOT(){return!1}}function bH(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 sm(i,this.metadata)}selectAt(...e){const t=e.map(i=>this.fields[i]).filter(Boolean);return new sm(t,this.metadata)}assign(e){let t,i=this.metadata;if(e instanceof sm){const o=e;t=o.fields,i=xH(xH(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 sm(s,i)}}function xH(n,e){return new Map([...n||new Map,...e||new Map])}let kr,SH,CH,TH,AH,MH,DH,IH;!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"}(kr||(kr={}));class yR{static isNull(e){return e&&e.typeId===kr.Null}static isInt(e){return e&&e.typeId===kr.Int}static isFloat(e){return e&&e.typeId===kr.Float}static isBinary(e){return e&&e.typeId===kr.Binary}static isUtf8(e){return e&&e.typeId===kr.Utf8}static isBool(e){return e&&e.typeId===kr.Bool}static isDecimal(e){return e&&e.typeId===kr.Decimal}static isDate(e){return e&&e.typeId===kr.Date}static isTime(e){return e&&e.typeId===kr.Time}static isTimestamp(e){return e&&e.typeId===kr.Timestamp}static isInterval(e){return e&&e.typeId===kr.Interval}static isList(e){return e&&e.typeId===kr.List}static isStruct(e){return e&&e.typeId===kr.Struct}static isUnion(e){return e&&e.typeId===kr.Union}static isFixedSizeBinary(e){return e&&e.typeId===kr.FixedSizeBinary}static isFixedSizeList(e){return e&&e.typeId===kr.FixedSizeList}static isMap(e){return e&&e.typeId===kr.Map}static isDictionary(e){return e&&e.typeId===kr.Dictionary}get typeId(){return kr.NONE}compareTo(e){return this===e}}Symbol,Symbol,SH=Symbol.toStringTag;class om extends yR{constructor(e,t){super(),Kn(this,"isSigned",void 0),Kn(this,"bitWidth",void 0),this.isSigned=e,this.bitWidth=t}get typeId(){return kr.Int}get[SH](){return"Int"}toString(){return`${this.isSigned?"I":"Ui"}nt${this.bitWidth}`}}class Zge extends om{constructor(){super(!0,8)}}class Jge extends om{constructor(){super(!0,16)}}class eme extends om{constructor(){super(!0,32)}}class tme extends om{constructor(){super(!1,8)}}class nme extends om{constructor(){super(!1,16)}}class ime extends om{constructor(){super(!1,32)}}CH=Symbol.toStringTag;class OH extends yR{constructor(e){super(),Kn(this,"precision",void 0),this.precision=e}get typeId(){return kr.Float}get[CH](){return"Float"}toString(){return`Float${this.precision}`}}class rme extends OH{constructor(){super(32)}}class sme extends OH{constructor(){super(64)}}Symbol,Symbol,TH=Symbol.toStringTag,AH=Symbol.toStringTag,MH=Symbol.toStringTag,DH=Symbol.toStringTag,IH=Symbol.toStringTag;class ome extends yR{constructor(e,t){super(),Kn(this,"listSize",void 0),Kn(this,"children",void 0),this.listSize=e,this.children=[t]}get typeId(){return kr.FixedSizeList}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get[IH](){return"FixedSizeList"}toString(){return`FixedSizeList[${this.listSize}]<${this.valueType}>`}}class sS{constructor(e,t,i=!1,r=new Map){Kn(this,"name",void 0),Kn(this,"type",void 0),Kn(this,"nullable",void 0),Kn(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 sS(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 RH(n,e,t){const i=t?PH(t.metadata):void 0,r=function(n){switch(n.constructor){case Int8Array:return new Zge;case Uint8Array:return new tme;case Int16Array:return new Jge;case Uint16Array:return new nme;case Int32Array:return new eme;case Uint32Array:return new ime;case Float32Array:return new rme;case Float64Array:return new sme;default:throw new Error("array type not supported")}}(e.value);return new sS(n,new ome(e.size,new sS("value",r)),!1,i)}function PH(n){const e=new Map;for(const t in n)e.set(`${t}.string`,JSON.stringify(n[t]));return e}const NH={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},ume={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array};class hme{constructor(e){Kn(this,"draco",void 0),Kn(this,"decoder",void 0),Kn(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 f=`DRACO decompression failed: ${o.error_msg()}`;throw new Error(f)}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?u:r,s=h>s?h:s,o=f>o?f:o}return[[e,t,i],[r,s,o]]}(l.attributes),u=function(n,e,t){const i=PH(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=RH(o,n[o],s[o]);r.push(l)}if(t){const o=RH("indices",t);r.push(o)}return new sm(r,i)}(l.attributes,a,l.indices);return Sn(ot({loader:"draco",loaderData:a,header:{vertexCount:s.num_points(),boundingBox:c}},l),{schema:u})}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 oS=et(9125);const ER={};function xR(n){return SR.apply(this,arguments)}function SR(){return(SR=li(function*(n,e=null,t={}){return e&&(n=_me(n,e,t)),ER[n]=ER[n]||yme(n),yield ER[n]})).apply(this,arguments)}function _me(n,e,t){if(n.startsWith("http"))return n;const i=t.modules||{};return i[n]?i[n]:_O?t.CDN?(nu(t.CDN.startsWith("http")),`${t.CDN}/${e}@3.0.12/dist/libs/${n}`):yO?`../src/libs/${n}`:`modules/${e}/src/libs/${n}`:`modules/${e}/dist/libs/${n}`}function yme(n){return CR.apply(this,arguments)}function CR(){return(CR=li(function*(n){return n.endsWith("wasm")?yield(yield fetch(n)).arrayBuffer():_O?yO?importScripts(n):bme(yield(yield fetch(n)).text(),n):oS.requireFromFile&&(yield oS.requireFromFile(n))})).apply(this,arguments)}function bme(n,e){if(!_O)return oS.requireFromString&&oS.requireFromString(n,e);if(yO)return eval.call(Iue,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 vme="https://www.gstatic.com/draco/versioned/decoders/1.4.1/draco_decoder.js",wme="https://www.gstatic.com/draco/versioned/decoders/1.4.1/draco_wasm_wrapper.js",Eme="https://www.gstatic.com/draco/versioned/decoders/1.4.1/draco_decoder.wasm";let ib;function Sme(n){return TR.apply(this,arguments)}function TR(){return(TR=li(function*(n){const e=n.modules||{};return ib=e.draco3d?ib||e.draco3d.createDecoderModule({}).then(t=>({draco:t})):ib||Cme(n),yield ib})).apply(this,arguments)}function Cme(n){return MR.apply(this,arguments)}function MR(){return(MR=li(function*(n){let e,t;switch(n.draco&&n.draco.decoderType){case"js":e=yield xR(vme,"draco",n);break;case"wasm":default:[e,t]=yield Promise.all([yield xR(wme,"draco",n),yield xR(Eme,"draco",n)])}return e=e||globalThis.DracoDecoderModule,yield Tme(e,t)})).apply(this,arguments)}function Tme(n,e){const t={};return e&&(t.wasmBinary=e),new Promise(i=>{n(Sn(ot({},t),{onModuleLoaded:r=>i({draco:r})}))})}const IR=Sn(ot({},EH),{parse:function(n,e){return OR.apply(this,arguments)}});function OR(){return(OR=li(function*(n,e){const{draco:t}=yield Sme(e),i=new hme(t);try{return i.parseSync(n,null==e?void 0:e.draco)}finally{i.destroy()}})).apply(this,arguments)}function sb(n,e){return Lf(n>=0),Lf(e>0),n+(e-1)&~(e-1)}function Dme(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+sb(i.byteLength,4)}const kH=["SCALAR","VEC2","VEC3","VEC4"],Ime=[[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Uint32Array,5125],[Float32Array,5126],[Float64Array,5130]],Ome=new Map(Ime),Rme={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Pme={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},Nme={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function FH(n){return kH[n-1]||kH[0]}function LH(n){const e=Ome.get(n.constructor);if(!e)throw new Error("Illegal typed array");return e}function BH(n,e){const t=Nme[n.componentType],i=Rme[n.type],s=n.count*i,o=n.count*i*Pme[n.componentType];return $a(o>=0&&o<=e.byteLength),{ArrayType:t,length:s,byteLength:o}}const kme={asset:{version:"2.0",generator:"loaders.gl"},buffers:[]};class _h{constructor(e){Kn(this,"gltf",void 0),Kn(this,"sourceBuffers",void 0),Kn(this,"byteLength",void 0),this.gltf=e||{json:ot({},kme),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 $a(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}=BH(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 $a(t),this.json.extensions=this.json.extensions||{},this.json.extensions[e]=t,this.registerUsedExtension(e),t}addRequiredExtension(e,t={}){return $a(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=eR(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;$a(Number.isFinite(t)),this.sourceBuffers=this.sourceBuffers||[],this.sourceBuffers.push(e);const i={buffer:0,byteOffset:this.byteLength,byteLength:t};return this.byteLength+=sb(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:FH(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:LH(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=Dme(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*Wme(n){for(const e of n.json.meshes||[])for(const t of e.primitives)yield t}function qme(n){return NR.apply(this,arguments)}function NR(){return(NR=li(function*(n){const e=new _h(n),{json:t}=e;e.removeExtension(lS);for(const i of t.materials||[])i.extensions&&i.extensions.KHR_materials_unlit&&(i.unlit=!0),e.removeObjectExtension(i,lS)})).apply(this,arguments)}function Yme(n){const e=new _h(n),{json:t}=e;if(e.materials)for(const i of t.materials||[])i.unlit&&(delete i.unlit,e.addObjectExtension(i,lS,{}),e.addExtension(lS))}function Xme(n){return kR.apply(this,arguments)}function kR(){return(kR=li(function*(n){const e=new _h(n),{json:t}=e,i=e.getExtension(am);i&&(e.json.lights=i.lights,e.removeExtension(am));for(const r of t.nodes||[]){const s=e.getObjectExtension(r,am);s&&(r.light=s.light),e.removeObjectExtension(r,am)}})).apply(this,arguments)}function Kme(n){return FR.apply(this,arguments)}function FR(){return(FR=li(function*(n){const e=new _h(n),{json:t}=e;if(t.lights){const i=e.addExtension(am);$a(!i.lights),i.lights=t.lights,delete t.lights}if(e.json.lights){for(const i of e.json.lights)e.addObjectExtension(i.node,am,i);delete e.json.lights}})).apply(this,arguments)}function Qme(n){return LR.apply(this,arguments)}function LR(){return(LR=li(function*(n){const e=new _h(n),{json:t}=e,i=e.getExtension(cS);if(i){const r=Jme(i,e);for(const s of t.materials||[]){const o=e.getObjectExtension(s,cS);o&&(s.technique=Object.assign({},o,r[o.technique]),s.technique.values=e_e(s.technique,e)),e.removeObjectExtension(s,cS)}e.removeExtension(cS)}})).apply(this,arguments)}function Zme(n,e){return BR.apply(this,arguments)}function BR(){return(BR=li(function*(n,e){})).apply(this,arguments)}function Jme(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 e_e(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 UH={KHR_draco_mesh_compression:yt,KHR_materials_unlit:ee,KHR_lights_punctual:Dt,KHR_techniques_webgl:dt};function t_e(n){return VR.apply(this,arguments)}function VR(){return(VR=li(function*(n,e={},t){for(const r in UH){var i;const s=(null==e||null===(i=e.gltf)||void 0===i?void 0:i.excludeExtensions)||{};r in s&&!s[r]||(yield UH[r].decode(n,e,t))}})).apply(this,arguments)}const zH={accessors:"accessor",animations:"animation",buffers:"buffer",bufferViews:"bufferView",images:"image",materials:"material",meshes:"mesh",nodes:"node",samplers:"sampler",scenes:"scene",skins:"skin",textures:"texture"},i_e={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 r_e{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 _h(n),{json:t}=e;for(const i of t.images||[]){const r=e.removeObjectExtension(i,VH);r&&Object.assign(i,r)}t.buffers&&t.buffers[0]&&delete t.buffers[0].uri,e.removeExtension(VH)}(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 zH)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 zH)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=i_e[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 s_e(n,e={}){return(new r_e).normalize(n,e)}const o_e={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},a_e={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},Ml={TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,REPEAT:10497,LINEAR:9729,NEAREST_MIPMAP_LINEAR:9986},l_e={magFilter:Ml.TEXTURE_MAG_FILTER,minFilter:Ml.TEXTURE_MIN_FILTER,wrapS:Ml.TEXTURE_WRAP_S,wrapT:Ml.TEXTURE_WRAP_T},c_e={[Ml.TEXTURE_MAG_FILTER]:Ml.LINEAR,[Ml.TEXTURE_MIN_FILTER]:Ml.NEAREST_MIPMAP_LINEAR,[Ml.TEXTURE_WRAP_S]:Ml.REPEAT,[Ml.TEXTURE_WRAP_]:Ml.REPEAT};class h_e{postProcess(e,t={}){const{json:i,buffers:r=[],images:s=[],baseUri:o=""}=e;return $a(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=ot({},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=ot({},e.normalTexture),e.normalTexture.texture=this.getTexture(e.normalTexture.index)),e.occlusionTexture&&(e.occlustionTexture=ot({},e.occlustionTexture),e.occlusionTexture.texture=this.getTexture(e.occlusionTexture.index)),e.emissiveTexture&&(e.emmisiveTexture=ot({},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=ot({},e.pbrMetallicRoughness);const i=e.pbrMetallicRoughness;i.baseColorTexture&&(i.baseColorTexture=ot({},i.baseColorTexture),i.baseColorTexture.texture=this.getTexture(i.baseColorTexture.index)),i.metallicRoughnessTexture&&(i.metallicRoughnessTexture=ot({},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 a_e[n]}(e.componentType),e.components=function(n){return o_e[n]}(e.type),e.bytesPerElement=e.bytesPerComponent*e.components,e.bufferView){const i=e.bufferView.buffer,{ArrayType:r,byteLength:s}=BH(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):c_e,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 l_e[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 f_e(n,e){return(new h_e).postProcess(n,e)}const HH=1735152710,lm=!0;function UR(n,e,t,i){const r=new Uint8Array(e.buffer,t,i),o=new TextDecoder("utf8").decode(r);return n.json=JSON.parse(o),sb(i,4)}function zR(n,e,t,i){return n.header.hasBinChunk=!0,n.binChunks.push({byteOffset:t,byteLength:i,arrayBuffer:e.buffer}),sb(i,4)}function C_e(n,e){return HR.apply(this,arguments)}function HR(){return(HR=li(function*(n,e,t=0,i,r){var s,o,a,l;T_e(n,e,t,i),s_e(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 A_e(n,i,r)),null!=i&&null!==(a=i.gltf)&&void 0!==a&&a.loadImages){const h=M_e(n,i,r);c.push(h)}const u=t_e(n,i,r);return c.push(u),yield Promise.all(c),null!=i&&null!==(l=i.gltf)&&void 0!==l&&l.postProcess?f_e(n,i):n})).apply(this,arguments)}function T_e(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=HH}=t,s=i.getUint32(e,!1);return s===r||s===HH}(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)?bH(n.buffer,n.byteOffset,e):n instanceof ArrayBuffer?bH(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,lm),a=r.getUint32(t+8,lm);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){Lf(n.header.byteLength>20);const i=e.getUint32(t+0,lm),r=e.getUint32(t+4,lm);return t+=8,Lf(0===r),UR(n,e,t,i),(t+=i)+zR(n,e,t,n.header.byteLength)}(n,r,t);case 2:return function(n,e,t,i){return Lf(n.header.byteLength>20),function(n,e,t,i){for(;t+8<=n.header.byteLength;){const r=e.getUint32(t+0,lm),s=e.getUint32(t+4,lm);switch(t+=8,s){case 1313821514:UR(n,e,t,r);break;case 5130562:zR(n,e,t,r);break;case 0:i.strict||UR(n,e,t,r);break;case 1:i.strict||zR(n,e,t,r)}t+=sb(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),$a("glTF"===o.type,`Invalid GLB magic string ${o.type}`),n._glb=o,n.json=o.json}else $a(!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 A_e(n,e,t){return GR.apply(this,arguments)}function GR(){return(GR=li(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 R_e(()=>e.some(t=>!t.loaded))})).apply(this,arguments)}function R_e(n){return XR.apply(this,arguments)}function XR(){return(XR=li(function*(n){for(;n();)yield new Promise(e=>requestAnimationFrame(e))})).apply(this,arguments)}const GH=[255,255,255,255],k_e={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:GH},_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:[cm]};let F_e=(()=>{class n extends Y0{getShaders(){const t=[tS,nS];return"pbr"===this.props._lighting&&t.push(eH),{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:GH,transition:!0},instanceModelMatrix:Q4})}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 rm)r={scenes:[t.scenegraph]};else if(t.scenegraph&&!t.scenegraph.gltf){const l=t.scenegraph,c=function(n,e,t){const i=new zge(n,t);return{scenes:i.instantiate(e),animator:i.createAnimator()}}(i,l,this._getModelOptions());r=ot({gltf:l},c),function(n){return YR.apply(this,arguments)}(c).then(()=>this.setNeedsRedraw())}else t.scenegraph&&(Ri.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 rm?(this._deleteScenegraph(),this._applyAllAttributes(o),this._applyAnimationsProp(o,a,t._animations),this.setState({scenegraph:o,animator:a})):null!==o&&Ri.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):Ri.warn("animation ".concat(o," not found"))()}})}_deleteScenegraph(){const{scenegraph:t}=this.state;t instanceof rm&&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:ot({isInstanced:!0,transpileToGLSL100:!Ci(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:u}=this.props,h=this.getNumInstances();this.state.scenegraph.traverse((f,{worldMatrix:g})=>{f.model.setInstanceCount(h),f.updateModuleSettings(t),f.draw({parameters:i,uniforms:{sizeScale:o,opacity:c,sizeMinPixels:a,sizeMaxPixels:l,composeModelMatrix:Z4(s,u),sceneModelMatrix:g,u_Camera:f.model.getUniforms().project_uCameraPosition}})})}}return n.layerName="ScenegraphLayer",n.defaultProps=k_e,n})();class L_e extends gh{constructor(e={}){const{id:t=ma("sphere-geometry")}=e,{indices:i,attributes:r}=function(n){const{nlat:e=10,nlong:t=10}=n;let{radius:i=1}=n;const o=Math.PI-0,c=2*Math.PI-0,u=(e+1)*(t+1);if("number"==typeof i){const U=i;i=(D,ie,_e,Pe,Ne)=>U}const h=new Float32Array(3*u),f=new Float32Array(3*u),g=new Float32Array(2*u),v=new(u>65535?Uint32Array:Uint16Array)(e*t*6);for(let U=0;U<=e;U++)for(let D=0;D<=t;D++){const ie=D/t,_e=U/e,Pe=D+U*(t+1),Ne=2*Pe,Ve=3*Pe,bt=c*ie,xt=o*_e,At=Math.sin(bt),Bt=Math.cos(bt),Wt=Math.sin(xt),mt=Bt*Wt,jt=Math.cos(xt),ft=At*Wt,Yt=i(mt,jt,ft,ie,_e);h[Ve+0]=Yt*mt,h[Ve+1]=Yt*jt,h[Ve+2]=Yt*ft,f[Ve+0]=mt,f[Ve+1]=jt,f[Ve+2]=ft,g[Ne+0]=ie,g[Ne+1]=1-_e}const x=t+1;for(let U=0;Us?(gt=i,Wt=1,mt=t):mt=e+Bt/s*(t-e),(-2===Bt||Bt===s+2)&&(mt=0,Wt=0),gt-=i/2;for(let jt=0;jts?0:ft*v,Ve[xt+Pe[1]]=Bt<0?-1:Bt>s?1:x,Ve[xt+Pe[2]]=Bt<0||Bt>s?0:Yt*v,bt[At+0]=jt/r,bt[At+1]=Wt,At+=2,xt+=3}}for(let Bt=0;Bt0){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 ce){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 ce){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 ce){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 ce){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 ce){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=K_e,s=1/i;r.set(this.x*s,this.y*s,this.z*s);const o=Q_e;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(WH),WH.almostEquals(e,t)}clone(){return new ce(this.x,this.y,this.z)}}ce.ZERO=void 0,ce.UNIT_X=void 0,ce.UNIT_Y=void 0,ce.UNIT_Z=void 0,ce.ZERO=new ce(0,0,0),ce.UNIT_X=new ce(1,0,0),ce.UNIT_Y=new ce(0,1,0),ce.UNIT_Z=new ce(0,0,1);const K_e=new ce,Q_e=new ce,WH=new ce;class pr{constructor(e={}){this.lowerBound=void 0,this.upperBound=void 0,this.lowerBound=new ce,this.upperBound=new ce,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,u=this.upperBound;e.copy(c),t.set(u.x,c.y,c.z),i.set(u.x,u.y,c.z),r.set(c.x,u.y,u.z),s.set(u.x,c.y,u.z),o.set(c.x,u.y,c.z),a.set(c.x,c.y,u.z),l.copy(u)}toLocalFrame(e,t){const i=YH;this.getCorners(i[0],i[1],i[2],i[3],i[4],i[5],i[6],i[7]);for(let f=0;8!==f;f++){const g=i[f];e.pointToLocal(g,g)}return t.setFromPoints(i)}toWorldFrame(e,t){const i=YH;this.getCorners(i[0],i[1],i[2],i[3],i[4],i[5],i[6],i[7]);for(let f=0;8!==f;f++){const g=i[f];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,u=(this.upperBound.y-i.y)*s,h=(this.lowerBound.z-i.z)*o,f=(this.upperBound.z-i.z)*o,g=Math.max(Math.max(Math.min(a,l),Math.min(c,u)),Math.min(h,f)),m=Math.min(Math.min(Math.max(a,l),Math.max(c,u)),Math.max(h,f));return!(m<0||g>m)}}const qH=new ce,YH=[new ce,new ce,new ce,new ce,new ce,new ce,new ce,new ce];class us{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 ce){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=J_e;e.tangents(i,eye),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(Er(e.length(),2)*Er(t.length(),2))+e.dot(t),this.normalize()}return this}mult(e,t=new us){const i=this.x,r=this.y,s=this.z,o=this.w,a=e.x,l=e.y,c=e.z,u=e.w;return t.x=i*u+o*a+r*c-s*l,t.y=r*u+o*l+s*a-i*c,t.z=s*u+o*c+i*l-r*a,t.w=o*u-i*a-r*l-s*c,t}inverse(e=new us){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 us){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 ce){const i=e.x,r=e.y,s=e.z,o=this.x,a=this.y,l=this.z,c=this.w,u=c*i+a*s-l*r,h=c*r+l*i-o*s,f=c*s+o*r-a*i,g=-o*i-a*r-l*s;return t.x=u*c+g*-o+h*-l-f*-a,t.y=h*c+g*-a+f*-o-u*-l,t.z=f*c+g*-l+u*-a-h*-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 u=o*a+l*c;if(u>.499&&(i=2*Math.atan2(o,c),r=Math.PI/2,s=0),u<-.499&&(i=-2*Math.atan2(o,c),r=-Math.PI/2,s=0),void 0===i){const h=o*o,g=l*l;i=Math.atan2(2*a*c-2*o*l,1-a*a*2-2*g),r=Math.asin(2*u),s=Math.atan2(2*o*c-2*a*l,1-2*h-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),u=Math.sin(i/2);return"XYZ"===r?(this.x=l*o*a+s*c*u,this.y=s*c*a-l*o*u,this.z=s*o*u+l*c*a,this.w=s*o*a-l*c*u):"YXZ"===r?(this.x=l*o*a+s*c*u,this.y=s*c*a-l*o*u,this.z=s*o*u-l*c*a,this.w=s*o*a+l*c*u):"ZXY"===r?(this.x=l*o*a-s*c*u,this.y=s*c*a+l*o*u,this.z=s*o*u+l*c*a,this.w=s*o*a-l*c*u):"ZYX"===r?(this.x=l*o*a-s*c*u,this.y=s*c*a+l*o*u,this.z=s*o*u-l*c*a,this.w=s*o*a+l*c*u):"YZX"===r?(this.x=l*o*a+s*c*u,this.y=s*c*a+l*o*u,this.z=s*o*u-l*c*a,this.w=s*o*a-l*c*u):"XZY"===r&&(this.x=l*o*a-s*c*u,this.y=s*c*a-l*o*u,this.z=s*o*u+l*c*a,this.w=s*o*a+l*c*u),this}clone(){return new us(this.x,this.y,this.z,this.w)}slerp(e,t,i=new us){const r=this.x,s=this.y,o=this.z,a=this.w;let f,g,m,v,x,l=e.x,c=e.y,u=e.z,h=e.w;return g=r*l+s*c+o*u+a*h,g<0&&(g=-g,l=-l,c=-c,u=-u,h=-h),1-g>1e-6?(f=Math.acos(g),m=Math.sin(f),v=Math.sin((1-t)*f)/m,x=Math.sin(t*f)/m):(v=1-t,x=t),i.x=v*r+x*l,i.y=v*s+x*c,i.z=v*o+x*u,i.w=v*a+x*h,i}integrate(e,t,i,r=new us){const s=e.x*i.x,o=e.y*i.y,a=e.z*i.z,l=this.x,c=this.y,u=this.z,h=this.w,f=.5*t;return r.x+=f*(s*h+o*u-a*c),r.y+=f*(o*h+a*l-s*u),r.z+=f*(a*h+s*c-o*l),r.w+=f*(-s*l-o*c-a*u),r}}const J_e=new ce,eye=new ce,tye={SPHERE:1,PLANE:2,BOX:4,COMPOUND:8,CONVEXPOLYHEDRON:16,HEIGHTFIELD:32,PARTICLE:64,CYLINDER:128,TRIMESH:256};let _n=(()=>{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=tye,n})();class $i{constructor(e={}){this.position=void 0,this.quaternion=void 0,this.position=new ce,this.quaternion=new us,e.position&&this.position.copy(e.position),e.quaternion&&this.quaternion.copy(e.quaternion)}pointToLocal(e,t){return $i.pointToLocalFrame(this.position,this.quaternion,e,t)}pointToWorld(e,t){return $i.pointToWorldFrame(this.position,this.quaternion,e,t)}vectorToWorldFrame(e,t=new ce){return this.quaternion.vmult(e,t),t}static pointToLocalFrame(e,t,i,r=new ce){return i.vsub(e,r),t.conjugate(KH),KH.vmult(r,r),r}static pointToWorldFrame(e,t,i,r=new ce){return t.vmult(i,r),r.vadd(e,r),r}static vectorToWorldFrame(e,t,i=new ce){return e.vmult(t,i),i}static vectorToLocalFrame(e,t,i,r=new ce){return t.w*=-1,t.vmult(i,r),t.w*=-1,r}}const KH=new us;class jf extends _n{constructor(e={}){const{vertices:t=[],faces:i=[],normals:r=[],axes:s,boundingSphereRadius:o}=e;super({type:_n.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 ce;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 u=!1;for(let h=0;h!==i.length;h++)if(i[h].almostEquals(r)||i[h].almostEquals(r)){u=!0;break}u||i.push(r.clone())}}}computeNormals(){this.faceNormals.length=this.faces.length;for(let e=0;ef&&(f=v,h=m)}const g=[];for(let m=0;m=0&&this.clipFaceAgainstHull(o,e,t,g,a,l,c)}findSeparatingAxis(e,t,i,r,s,o,a,l){const c=new ce,u=new ce,h=new ce,f=new ce,g=new ce,m=new ce;let v=Number.MAX_VALUE;const x=this;if(x.uniqueAxes)for(let U=0;U!==x.uniqueAxes.length;U++){i.vmult(x.uniqueAxes[U],c);const D=x.testSepAxis(c,e,t,i,r,s);if(!1===D)return!1;D0&&o.negate(o),!0}testSepAxis(e,t,i,r,s,o){jf.project(this,e,i,r,KR),jf.project(t,e,s,o,QR);const l=KR[0],c=KR[1],u=QR[0],h=QR[1];if(l0?1/t:0,this.material=e.material||null,this.linearDamping="number"==typeof e.linearDamping?e.linearDamping:.01,this.type=t<=0?yn.STATIC:yn.DYNAMIC,typeof e.type==typeof yn.STATIC&&(this.type=e.type),this.allowSleep=void 0===e.allowSleep||e.allowSleep,this.sleepState=yn.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 ce,this.quaternion=new us,this.initQuaternion=new us,this.previousQuaternion=new us,this.interpolatedQuaternion=new us,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 ce,e.angularVelocity&&this.angularVelocity.copy(e.angularVelocity),this.initAngularVelocity=new ce,this.shapes=[],this.shapeOffsets=[],this.shapeOrientations=[],this.inertia=new ce,this.invInertia=new ce,this.invInertiaWorld=new lu,this.invMassSolve=0,this.invInertiaSolve=new ce,this.invInertiaWorldSolve=new lu,this.fixedRotation=void 0!==e.fixedRotation&&e.fixedRotation,this.angularDamping=void 0!==e.angularDamping?e.angularDamping:.01,this.linearFactor=new ce(1,1,1),e.linearFactor&&this.linearFactor.copy(e.linearFactor),this.angularFactor=new ce(1,1,1),e.angularFactor&&this.angularFactor.copy(e.angularFactor),this.aabb=new pr,this.aabbNeedsUpdate=!0,this.boundingRadius=0,this.wlambda=new ce,this.isTrigger=Boolean(e.isTrigger),e.shape&&this.addShape(e.shape),this.updateMassProperties()}wakeUp(){const e=this.sleepState;this.sleepState=yn.AWAKE,this.wakeUpAfterNarrowphase=!1,e===yn.SLEEPING&&this.dispatchEvent(yn.wakeupEvent)}sleep(){this.sleepState=yn.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=Er(this.sleepSpeedLimit,2);t===yn.AWAKE&&ir?this.wakeUp():t===yn.SLEEPY&&e-this.timeLastSleepy>this.sleepTimeLimit&&(this.sleep(),this.dispatchEvent(yn.sleepEvent))}}updateSolveMassProperties(){this.sleepState===yn.SLEEPING||this.type===yn.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 ce){return e.vsub(this.position,t),this.quaternion.conjugate().vmult(t,t),t}vectorToLocalFrame(e,t=new ce){return this.quaternion.conjugate().vmult(e,t),t}pointToWorldFrame(e,t=new ce){return this.quaternion.vmult(e,t),t.vadd(this.position,t),t}vectorToWorldFrame(e,t=new ce){return this.quaternion.vmult(e,t),t}addShape(e,t,i){const r=new ce,s=new us;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=rye,o=sye,a=this.quaternion,l=this.aabb,c=oye;for(let u=0;u!==r;u++){const h=e[u];a.vmult(t[u],s),s.vadd(this.position,s),a.mult(i[u],o),h.calculateWorldAABB(s,o,c.lowerBound,c.upperBound),0===u?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=aye,r=lye;i.setRotationFromQuaternion(this.quaternion),i.transpose(r),i.scale(t,i),i.mmult(r,this.invInertiaWorld)}}applyForce(e,t=new ce){if(this.type!==yn.DYNAMIC)return;this.sleepState===yn.SLEEPING&&this.wakeUp();const i=cye;t.cross(e,i),this.force.vadd(e,this.force),this.torque.vadd(i,this.torque)}applyLocalForce(e,t=new ce){if(this.type!==yn.DYNAMIC)return;const i=uye,r=dye;this.vectorToWorldFrame(e,i),this.vectorToWorldFrame(t,r),this.applyForce(i,r)}applyTorque(e){this.type===yn.DYNAMIC&&(this.sleepState===yn.SLEEPING&&this.wakeUp(),this.torque.vadd(e,this.torque))}applyImpulse(e,t=new ce){if(this.type!==yn.DYNAMIC)return;this.sleepState===yn.SLEEPING&&this.wakeUp();const i=t,r=hye;r.copy(e),r.scale(this.invMass,r),this.velocity.vadd(r,this.velocity);const s=fye;i.cross(e,s),this.invInertiaWorld.vmult(s,s),this.angularVelocity.vadd(s,this.angularVelocity)}applyLocalImpulse(e,t=new ce){if(this.type!==yn.DYNAMIC)return;const i=pye,r=gye;this.vectorToWorldFrame(e,i),this.vectorToWorldFrame(t,r),this.applyImpulse(i,r)}updateMassProperties(){const e=mye;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),dS.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 ce;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!==yn.DYNAMIC&&this.type!==yn.KINEMATIC||this.sleepState===yn.SLEEPING)return;const r=this.velocity,s=this.angularVelocity,o=this.position,a=this.force,l=this.torque,c=this.quaternion,h=this.invInertiaWorld,f=this.linearFactor,g=this.invMass*e;r.x+=a.x*g*f.x,r.y+=a.y*g*f.y,r.z+=a.z*g*f.z;const m=h.elements,v=this.angularFactor,x=l.x*v.x,U=l.y*v.y,D=l.z*v.z;s.x+=e*(m[0]*x+m[1]*U+m[2]*D),s.y+=e*(m[3]*x+m[4]*U+m[5]*D),s.z+=e*(m[6]*x+m[7]*U+m[8]*D),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()}}yn.idCounter=0,yn.COLLIDE_EVENT_NAME="collide",yn.DYNAMIC=1,yn.STATIC=2,yn.KINEMATIC=4,yn.AWAKE=0,yn.SLEEPY=1,yn.SLEEPING=2,yn.wakeupEvent={type:"wakeup"},yn.sleepyEvent={type:"sleepy"},yn.sleepEvent={type:"sleep"};const rye=new ce,sye=new us,oye=new pr,aye=new lu,lye=new lu,cye=new ce,uye=new ce,dye=new ce,hye=new ce,fye=new ce,pye=new ce,gye=new ce,mye=new ce;new ce,new ce;class hS{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 ce,this.rayToWorld=new ce,this.hitNormalWorld=new ce,this.hitPointWorld=new ce,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 QH,ZH,JH,e8,t8,n8,i8;QH=_n.types.SPHERE,ZH=_n.types.PLANE,JH=_n.types.BOX,e8=_n.types.CYLINDER,t8=_n.types.CONVEXPOLYHEDRON,n8=_n.types.HEIGHTFIELD,i8=_n.types.TRIMESH;class ys{get[QH](){return this._intersectSphere}get[ZH](){return this._intersectPlane}get[JH](){return this._intersectBox}get[e8](){return this._intersectConvex}get[t8](){return this._intersectConvex}get[n8](){return this._intersectHeightfield}get[i8](){return this._intersectTrimesh}constructor(e=new ce,t=new ce){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 ce,this.precision=1e-4,this.checkCollisionResponse=!0,this.skipBackfaces=!1,this.collisionFilterMask=-1,this.collisionFilterGroup=-1,this.mode=ys.ANY,this.result=new hS,this.hasHit=!1,this.callback=i=>{}}intersectWorld(e,t){return this.mode=t.mode||ys.ANY,this.result=t.result||new hS,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(r8),tP.length=0,e.broadphase.aabbQuery(e,r8,tP),this.intersectBodies(tP),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=xye,s=Sye;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 ce(0,0,1);t.vmult(c,c);const u=new ce;o.vsub(i,u);const h=u.dot(c);if(a.vsub(i,u),h*u.dot(c)>0||o.distanceTo(a)=0&&v<=1&&(o.lerp(a,v,g),g.vsub(i,m),m.normalize(),this.reportIntersection(m,g,s,r,-1)),this.result.shouldStop)return;x>=0&&x<=1&&(o.lerp(a,x,g),g.vsub(i,m),m.normalize(),this.reportIntersection(m,g,s,r,-1))}}_intersectConvex(e,t,i,r,s,o){const a=Dye,l=o8,c=o&&o.faceList||null,u=e.faces,h=e.vertices,f=e.faceNormals,g=this.direction,m=this.from,x=m.distanceTo(this.to),U=c?c.length:u.length,D=this.result;for(let ie=0;!D.shouldStop&&iex||this.reportIntersection(a,va,s,r,_e)}}}}_intersectTrimesh(e,t,i,r,s,o){const a=Iye,l=Fye,c=Lye,u=o8,h=Oye,f=Rye,g=Pye,m=kye,v=Nye,x=e.indices,U=this.from,D=this.to,ie=this.direction;c.position.copy(i),c.quaternion.copy(t),$i.vectorToLocalFrame(i,t,ie,h),$i.pointToLocalFrame(i,t,U,f),$i.pointToLocalFrame(i,t,D,g),g.x*=e.scale.x,g.y*=e.scale.y,g.z*=e.scale.z,f.x*=e.scale.x,f.y*=e.scale.y,f.z*=e.scale.z,g.vsub(f,h),h.normalize();const _e=f.distanceSquared(g);e.tree.rayQuery(this,c,l);for(let Pe=0,Ne=l.length;!this.result.shouldStop&&Pe!==Ne;Pe++){const Ve=l[Pe];e.getNormal(Ve,a),e.getVertex(x[3*Ve],_c),_c.vsub(f,u);const bt=h.dot(a),xt=a.dot(u)/bt;if(xt<0)continue;h.scale(xt,va),va.vadd(f,va),e.getVertex(x[3*Ve+1],uu),e.getVertex(x[3*Ve+2],du);const At=va.distanceSquared(f);!ys.pointInTriangle(va,uu,_c,du)&&!ys.pointInTriangle(va,_c,uu,du)||At>_e||($i.vectorToWorldFrame(t,a,v),$i.pointToWorldFrame(i,t,va,m),this.reportIntersection(v,m,s,r,Ve))}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 ys.ALL:this.hasHit=!0,c.set(o,a,e,t,i,r,l),c.hasHit=!0,this.callback(c);break;case ys.CLOSEST:(l=0&&(h=s*c-o*a)>=0&&u+hDate.now()-n}var $f=et(4517);class Fr extends oe{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 $;return this._value}next(e){super.next(this._value=e)}}function fm(n,e,t){e||(e=new qn(qn.IDENTITY));const i=new qn(qn.IDENTITY);if(!n)return!0;if(n.matrix)i.copy(n.matrix);else{if(i.identity(),n.translation&&i.translate(n.translation),n.rotation){const s=new qn(qn.IDENTITY).fromQuaternion(n.rotation);i.multiplyRight(s)}n.scale&&i.scale(n.scale)}const r=new qn(e).multiplyRight(i);if(!1===t(n,r,e))return!1;for(const s of n.nodes||n.children||[])if(!1===fm(s,r,t))return!1;return!0}function Q8(){Mz([EH,cm])}function Z8(n,e){var t;const i=null===(t=e.nodes)||void 0===t?void 0:t.find(r=>r.name===n);if(i){let r=!1;for(const s of e.scenes)r||fm(s,new qn(qn.IDENTITY),(o,a)=>o!==i||(o.matrix=a,o.translation=void 0,o.rotation=void 0,o.scale=void 0,r=!0,!1));return e.scene={id:n,name:n,nodes:[i]},e.scenes=[e.scene],{scene:e.scene,scenes:e.scenes}}return e}function sP(n,e){return Bi(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 Hx(i,cm,{DracoLoader:IR,gltf:{decompressMeshes:!0,postProcess:!0}});return r.nodes||console.log("WARNING: Empty Scene",t,r),Z8(n.scenegraphNode,r)})}function Bve(n,e){return Bi(this,void 0,void 0,function*(){return Z8(n,yield e)})}function oP(n,e,t){if(e&&0!==e.length){let i;switch(t.geometry){case"sphere":i=new L_e;break;case"cone":i=new U_e;break;case"cylinder":i=new z_e;break;case"cube":default:i=new Y_e}return new pge(Object.assign({id:n,pickable:!0,autoHighlight:!1,highlightColor:[30,136,229,255],coordinateSystem:Vi.CARTESIAN,data:e,mesh:i,wireframe:!1,getTransformMatrix:r=>r.transformMatrix,getColor:r=>r.color||[255,255,255,229.5]},t))}}function J8(n,e,t){if(e&&0!==e.length)return new rge(Object.assign({id:n,pickable:!0,data:e.map(i=>Object.assign(Object.assign({},i),{position:new qn(i.transformMatrix).getTranslation()})),getText:i=>i.text,getPosition:i=>i.position,getColor:i=>i.color},t))}let jve=(()=>{class n extends Nz{initializeState(){const{data:t}=this.props;this.setState({data:null!=t?t:[],zoomOpacity:.8,doCollisions:!1}),Q8()}renderLayers(){var t,i;const r=this.state,s={sphere:[],cone:[],cylinder:[],cube:[],text:[],wireframe:[],scenegraph:[]};for(const l of r.data){const c=null!==(t=l.geometry)&&void 0!==t?t:"cube";l.scenegraph?s.scenegraph.push(l):void 0!==s[c]&&s[c].push(l)}const o={};for(const l of s.scenegraph)l.scenegraph&&l.scenegraphNode&&!Object.prototype.hasOwnProperty.call(o,l.scenegraph)&&(o[l.scenegraph]=sP({scenegraph:l.scenegraph},n.gltfCache));const a=[];for(const[l,c]of Object.entries(s))if("scenegraph"===l)for(const u of c)a.push(new F_e({id:"models-"+u["@id"],opacity:u.zoomBasedOpacity?r.zoomOpacity:void 0!==u.opacity?u.opacity:1,pickable:!u.unpickable,coordinateSystem:Vi.CARTESIAN,data:[u],scenegraph:u.scenegraphNode?Bve(u.scenegraphNode,o[u.scenegraph]):u.scenegraph,_lighting:u._lighting,getTransformMatrix:u.transformMatrix,getColor:null!==(i=u.color)&&void 0!==i?i:[0,255,0,127.5],parameters:{depthMask:!u.zoomBasedOpacity&&(void 0===u.opacity||1===u.opacity)}}));else"text"===l?(a.push(J8("text",c.filter(u=>u.unpickable),{pickable:!1})),a.push(J8("textPickable",c.filter(u=>!u.unpickable),{pickable:!0}))):"wireframe"===l?a.push(oP(l,c,{wireframe:!0,pickable:!1,geometry:l})):(a.push(oP(l,c.filter(u=>u.unpickable),{wireframe:!1,pickable:!1,geometry:l})),a.push(oP(`${l}Pickable`,c.filter(u=>!u.unpickable),{wireframe:!1,pickable:!0,geometry:l})));return r.doCollisions&&function(n){Bi(this,void 0,void 0,function*(){console.log("Starting Collisioning");const e=n.filter(o=>!o.scenegraph&&"wireframe"!==o.geometry).map(o=>{const a=new qn(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 pr({lowerBound:new ce(...l.map((u,h)=>Math.min(u,c[h]))),upperBound:new ce(...c.map((u,h)=>Math.max(u,l[h])))})}}),t=[];for(const o of n.filter(a=>!!a.scenegraph)){const a=yield q0(o.scenegraph,cm,{DracoLoader:IR,decompress:!0,postProcess:!0});for(const l of a.scenes)fm(l,new qn(o.transformMatrix),(c,u)=>{if(c.mesh&&c.mesh.primitives&&c.mesh.primitives.length>0)for(const h of c.mesh.primitives)if(h.attributes.POSITION&&h.attributes.POSITION.min){const f=u.transformAsPoint(h.attributes.POSITION.min,[]),g=u.transformAsPoint(h.attributes.POSITION.max,[]);t.push({"@id":o["@id"],name:c.name,entityId:o.entityId,bbox:new pr({lowerBound:new ce(...f.map((m,v)=>Math.min(m,g[v]))),upperBound:new ce(...g.map((m,v)=>Math.max(m,f[v])))}),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})}(r.data),a.filter(l=>!!l)}getPickingInfo(t){return t.info}}return n.layerName="BodyUILayer",n.gltfCache={},n})();function e5(n,e=[]){for(const t of n.nodes||n.children||[])e.push(t.name),e5(t,e);return e}let zve=(()=>{class n{constructor(t){var i,r,s,o,a;this.deckProps=t,this.bodyUILayer=new jve({}),this.nodeClickSubject=new oe,this.nodeHoverStartSubject=new oe,this.nodeHoverStopSubject=new oe,this.sceneRotationSubject=new Fr([0,0]),this.nodeDragStartSubject=new oe,this.nodeDragSubject=new oe,this.nodeDragEndSubject=new oe,this.nodeClick$=this.nodeClickSubject.pipe(ws()),this.nodeHoverStart$=this.nodeHoverStartSubject.pipe(ws()),this.nodeHoverStop$=this.nodeHoverStopSubject.pipe(ws()),this.sceneRotation$=this.sceneRotationSubject.pipe(ws()),this.nodeDragStart$=this.nodeDragStartSubject.pipe(ws()),this.nodeDrag$=this.nodeDragSubject.pipe(ws()),this.nodeDragEnd$=this.nodeDragEndSubject.pipe(ws());const l=Object.assign(Object.assign({},t),{views:["orthographic"===t.camera?new jde({flipY:!1,near:-1e3}):new Hde({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 u;return null!==(u=this.cursor)&&void 0!==u?u:c.isDragging?"grabbing":"grab"}});t.legacyLighting&&(l.effects=[new $O({ambientLight:new Vz({color:[255,255,255],intensity:10})})]),this.deck=new eS(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 Bi(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 qn([.076,0,0,0,0,.076,16875389974302382e-33,0,0,-16875389974302382e-33,.076,0,.49,.034,.11,1]);(function(n,e,t,i){return Bi(this,void 0,void 0,function*(){Q8();const r=yield sP({scenegraph:n,scenegraphNode:"VHF_Kidney_L_Low1"},undefined),s={},o=[];for(const a of r.scenes)fm(a,e=new qn(e||qn.IDENTITY),(l,c)=>{const u={"@id":l.name||l.id,"@type":"ProcessedNode",transformMatrix:new qn(c),geometry:"wireframe",node:l};if(o.push({"@id":`GLTF:${u["@id"]}`,"@type":"GLTFNode",scenegraph:n,scenegraphNode:u["@id"],transformMatrix:new qn(e||qn.IDENTITY),tooltip:l.name||l.id,color:[255,255,255,255],_lighting:"pbr",zoomBasedOpacity:!0,node:l}),l.mesh&&l.mesh.primitives&&l.mesh.primitives.length>0)for(const h of l.mesh.primitives)if(h.attributes.POSITION&&h.attributes.POSITION.min){const f=c.transformAsPoint(h.attributes.POSITION.min,[]),g=c.transformAsPoint(h.attributes.POSITION.max,[]);u.bbox=new pr({lowerBound:new ce(...f.map((m,v)=>Math.min(m,g[v]))),upperBound:new ce(...g.map((m,v)=>Math.max(m,f[v])))})}return s[u["@id"]]=u,!0});for(const a of Object.values(s).filter(l=>!l.bbox)){for(const l of e5(a.node).map(c=>s[c]).filter(c=>c.bbox))a.bbox?a.bbox.extend(l.bbox):a.bbox=l.bbox.clone();a.bbox||delete s[a["@id"]]}for(const a of Object.values(s)){const l=a.bbox.lowerBound,h=(a.size=a.bbox.upperBound.clone().vsub(l)).clone().vmul(new ce(.5,.5,.5)),f=a.center=l.clone().vadd(h);a.transformMatrix=new qn(qn.IDENTITY).translate(f.toArray()).scale(h.toArray())}for(const a of o)s[a["@id"]]=a;return s})})(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 qn(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 Ei([$f.ZP],n.prototype,"_onHover",null),Ei([$f.ZP],n.prototype,"_onClick",null),Ei([$f.ZP],n.prototype,"_onViewStateChange",null),Ei([$f.ZP],n.prototype,"_onDragStart",null),Ei([$f.ZP],n.prototype,"_onDrag",null),Ei([$f.ZP],n.prototype,"_onDragEnd",null),n})();class t5 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 Hve 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 n5(n,e,t,i,r=new Hve(n,t,i)){if(!r.closed)return e instanceof O?e.subscribe(r):Me(e)(r)}const i5={};function yc(...n){let e,t;return Te(n[n.length-1])&&(t=n.pop()),"function"==typeof n[n.length-1]&&(e=n.pop()),1===n.length&&k(n[0])&&(n=n[0]),In(n,t).lift(new r5(e))}class r5{constructor(e){this.resultSelector=e}call(e,t){return t.subscribe(new Gve(e,this.resultSelector))}}class Gve extends t5{constructor(e,t){super(e),this.resultSelector=t,this.active=0,this.values=[],this.observables=[]}_next(e){this.values.push(i5),this.observables.push(e)}_complete(){const e=this.observables,t=e.length;if(0===t)this.destination.complete();else{this.active=t,this.toRespond=t;for(let i=0;i(i&&i.providers||[]).some(s=>s&&s.provide&&"MockNgModuleResolver"===s.provide.name||!1))});let aP=(()=>{class n{constructor(){this.bootstrap$=new Df(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 lP=new Ht("INITIAL_STATE_TOKEN");let Kve=(()=>{class n{static set(t){this.value=t}static pop(){const t=this.value;return this.value={},t}}return n.value={},n})();const s5=new Ht("Internals.StateContextFactory"),o5=new Ht("Internals.StateFactory");function fb(...n){if(1===n.length){const e=n[0];if(k(e))return ES(e,null);if(Q(e)&&Object.getPrototypeOf(e)===Object.prototype){const t=Object.keys(e);return ES(t.map(i=>e[i]),t)}}if("function"==typeof n[n.length-1]){const e=n.pop();return ES(n=1===n.length&&k(n[0])?n[0]:n,null).pipe(me(t=>e(...t)))}return ES(n,null)}function ES(n,e){return new O(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]=u},error:u=>t.error(u),complete:()=>{s++,(s===i||!c)&&(o===i&&t.next(e?e.reduce((u,h,f)=>(u[h]=r[f],u),{}):r),t.complete())}}))}})}function Ki(n,e){return function(i){return i.lift(new Qve(n,e))}}class Qve{constructor(e,t){this.predicate=e,this.thisArg=t}call(e,t){return t.subscribe(new Zve(e,this.predicate,this.thisArg))}}class Zve 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 Wa(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(u){let h;s++,!r||a?(a=!1,r=new Df(n,e,i),h=r.subscribe(this),o=u.subscribe({next(f){r.next(f)},error(f){a=!0,r.error(f)},complete(){l=!0,o=void 0,r.complete()}}),l&&(o=void 0)):h=r.subscribe(this),this.add(()=>{s--,h.unsubscribe(),h=void 0,o&&!l&&t&&0===s&&(o.unsubscribe(),o=void 0,r=void 0)})}}(i))}const a5=(()=>{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 qr(n){return e=>0===n?b0():e.lift(new ewe(n))}class ewe{constructor(e){if(this.total=e,this.total<0)throw new a5}call(e,t){return t.subscribe(new twe(e,this.total))}}class twe 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 l5(n,e){return e?t=>t.pipe(l5((i,r)=>je(n(i,r)).pipe(me((s,o)=>e(i,s,r,o))))):t=>t.lift(new nwe(n))}class nwe{constructor(e){this.project=e}call(e,t){return t.subscribe(new iwe(e,this.project))}}class iwe extends we{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 _t(this),i=this.destination;i.add(t);const r=N(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 xS(n=null){return e=>e.lift(new rwe(n))}class rwe{constructor(e){this.defaultValue=e}call(e,t){return t.subscribe(new swe(e,this.defaultValue))}}class swe 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 bc(n){return function(t){const i=new owe(n),r=t.lift(i);return i.caught=r}}class owe{constructor(e){this.selector=e}call(e,t){return t.subscribe(new awe(e,this.selector,this.caught))}}class awe extends we{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 _t(this);this.add(i);const r=N(t,i);r!==i&&this.add(r)}}}function gr(n){return e=>e.lift(new lwe(n))}class lwe{constructor(e){this.notifier=e}call(e,t){const i=new cwe(e),r=N(this.notifier,new _t(i));return r&&!i.seenValue?(i.add(r),t.subscribe(i)):i}}class cwe extends we{constructor(e){super(e),this.seenValue=!1}notifyNext(){this.seenValue=!0,this.complete()}notifyComplete(){}}function bh(){}function cr(n,e,t){return function(r){return r.lift(new uwe(n,e,t))}}class uwe{constructor(e,t,i){this.nextOrObserver=e,this.error=t,this.complete=i}call(e,t){return t.subscribe(new dwe(e,this.nextOrObserver,this.error,this.complete))}}class dwe extends y{constructor(e,t,i,r){super(e),this._tapNext=bh,this._tapError=bh,this._tapComplete=bh,this._tapError=i||bh,this._tapComplete=r||bh,Y(t)?(this._context=this,this._tapNext=t):t&&(this._context=t,this._tapNext=t.next||bh,this._tapError=t.error||bh,this._tapComplete=t.complete||bh)}_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 ld(n,e){return t=>t.lift(new hwe(n,e))}class hwe{constructor(e,t){this.compare=e,this.keySelector=t}call(e,t){return t.subscribe(new fwe(e,this.compare,this.keySelector))}}class fwe 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 qa={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 c5=(()=>{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 pn.isInAngularZone()?t():this._ngZone.run(t)}runOutsideAngular(t){return pn.isInAngularZone()?this._ngZone.runOutsideAngular(t):t()}verifyZoneIsNotNooped(t){t instanceof pn||console.warn(qa.ZONE_WARNING())}}return n.\u0275fac=function(t){return new(t||n)(Ie(pn),Ie(Xc))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const u5=new Ht("ROOT_STATE_TOKEN"),d5=new Ht("FEATURE_STATE_TOKEN"),h5=new Ht("NGXS_PLUGINS"),f5=new Ht("NG_TEST_MODE"),p5=new Ht("NG_DEV_MODE"),cd="NGXS_META",g5="NGXS_OPTIONS_META",cP="NGXS_SELECTOR_META";let Wf=(()=>{class n{constructor(){this.defaultsState={},this.selectorOptions={injectContainerState:!0,suppressErrors:!0},this.compatibility={strictContentSecurityPolicy:!1},this.executionStrategy=c5}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();class pwe{constructor(e,t,i){this.previousValue=e,this.currentValue=t,this.firstChange=i}}const m5=new Ht("NGXS_EXECUTION_STRATEGY");function qf(n){return n.constructor&&n.constructor.type?n.constructor.type:n.type}const _5=(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},SS=(n,e)=>e.split(".").reduce((t,i)=>t&&t[i],n),uP=n=>n&&"object"==typeof n&&!Array.isArray(n),dP=(n,...e)=>{if(!e.length)return n;const t=e.shift();if(uP(n)&&uP(t))for(const i in t)uP(t[i])?(n[i]||Object.assign(n,{[i]:{}}),dP(n[i],t[i])):Object.assign(n,{[i]:t[i]});return dP(n,...e)};function hP(n){if(!n.hasOwnProperty(cd)){const e={name:null,actions:{},defaults:{},path:null,makeRootSelector:t=>t.getStateGetter(e.name),children:[]};Object.defineProperty(n,cd,{value:e})}return pb(n)}function pb(n){return n[cd]}function pP(n){return n[cP]}function y5(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(e[qf(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 Ki(t=>{const i=qf(t.action);return n[i]&&(!e||e[t.status])})}(i,r),t())}}(n,["DISPATCHED"])}function Cwe(){return me(n=>n.action)}function CS(n){return e=>new O(t=>e.subscribe({next(i){n.leave(()=>t.next(i))},error(i){n.leave(()=>t.error(i))},complete(){n.leave(()=>t.complete())}}))}let TS=(()=>{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(m5))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();class Mwe extends oe{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 AS=(()=>{class n extends Mwe{}return n.\u0275fac=function(){let e;return function(i){return(e||(e=zi(n)))(i||n)}}(),n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),Dwe=(()=>{class n extends O{constructor(t,i){super(r=>{const s=t.pipe(CS(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(AS),Ie(TS))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const v5=n=>(...e)=>n.shift()(...e,(...i)=>v5(n)(...i));let MS=(()=>{class n extends Fr{constructor(){super({})}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),gP=(()=>{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(h5,8))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),mP=(()=>{class n extends oe{}return n.\u0275fac=function(){let e;return function(i){return(e||(e=zi(n)))(i||n)}}(),n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),w5=(()=>{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(la),this._errorHandler.handleError(r)}catch(s){}})}),i.pipe(CS(this._ngxsExecutionStrategy))}dispatchByEvents(t){return Array.isArray(t)?0===t.length?sn(this._stateStream.getValue()):fb(t.map(i=>this.dispatchSingle(i))):this.dispatchSingle(t)}dispatchSingle(t){if(!qf(t))return Fg(new Error(`This action doesn't have a type property: ${t.constructor.name}`));const r=this._stateStream.getValue();return v5([...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(Wa())}getActionResultStream(t){return this._actionResults.pipe(Ki(i=>i.action===t&&"DISPATCHED"!==i.status),qr(1),Wa())}createDispatchObservable(t){return t.pipe(l5(i=>{switch(i.status){case"SUCCESSFUL":return sn(this._stateStream.getValue());case"ERRORED":return Fg(i.error);default:return Qc}})).pipe(Wa())}}return n.\u0275fac=function(t){return new(t||n)(Ie(Hn),Ie(AS),Ie(mP),Ie(gP),Ie(MS),Ie(TS))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const E5=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])&&E5(n[i])}),n};let x5=(()=>{class n{constructor(t,i){this.isDevMode=t,this.isTestMode=i}}return n.\u0275fac=function(t){return new(t||n)(Ie(p5),Ie(f5))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),S5=(()=>{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(qa.INCORRECT_PRODUCTION()):this.isIncorrectDevelopment&&console.warn(qa.INCORRECT_DEVELOPMENT()))}}return n.\u0275fac=function(t){return new(t||n)(Ie(x5),Ie(Wf))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),gm=(()=>{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=E5(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(MS),Ie(w5),Ie(Wf),Ie(S5))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),DS=(()=>{class n{constructor(t){this._internalStateOperations=t}createStateContext(t){const i=this._internalStateOperations.getRootStateOperations();function r(l){return SS(l,t.path)}function s(l,c){const u=_5(l,t.path,c),h=t.instance;if(h.ngxsOnChanges){const f=b5(t,{currentAppState:l,newAppState:u});h.ngxsOnChanges(f)}return i.setState(u),u}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(qa.PATCHING_ARRAY());if("object"!=typeof n)throw new Error(qa.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(gm))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();class IS{static stateNameErrorMessage(e){return qa.STATE_NAME(e)}static checkCorrectStateName(e){if(!e)throw new Error(qa.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(qa.STATE_UNIQUE(r,e.name,s.name));return r}static getValidStateMeta(e){const t=pb(e);if(!t)throw new Error(qa.STATE_DECORATOR());return t}}IS.stateNameRegex=new RegExp("^[a-zA-Z0-9_]+$");let mm=(()=>{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=wS(()=>{const c=this;function u(f){const g=c.statePaths[f];return g?y5(g.split("."),c._config):null}return this._parentFactory?this._parentFactory.getRuntimeSelectorContext():{getStateGetter(f){let g=u(f);return g||((...m)=>(g||(g=u(f)),g?g(...m):void 0))},getSelectorOptions:f=>Object.assign({},c._config.selectorOptions,f||{})}})}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(IS.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[cd].name};return n.reduce((t,i)=>{const{name:r,children:s}=i[cd];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[cd].name]=t,e),{})}(i),l=[];for(const c of s){const u=a[c],h=o[c],f=u[cd];this.addRuntimeInfoToMeta(f,h);const g={name:c,path:h,isInitialised:!1,actions:f.actions,instance:this._injector.get(u),defaults:n.cloneDefaults(f.defaults)};this.hasBeenMountedAndBootstrapped(c,h)||l.push(g),this.states.push(g)}return l}addAndReturnDefaults(t){const r=this.add(t||[]);return{defaults:r.reduce((o,a)=>_5(o,a.path,a.defaults),{}),states:r}}connectActionHandlers(){null===this._actionsSubscription&&(this._actionsSubscription=this._actions.pipe(Ki(t=>"DISPATCHED"===t.status),V(({action:t})=>this.invokeActions(this._actions,t).pipe(me(()=>({action:t,status:"SUCCESSFUL"})),xS({action:t,status:"CANCELED"}),bc(i=>sn({action:t,status:"ERRORED",error:i}))))).subscribe(t=>this._actionResults.next(t)))}invokeActions(t,i){const r=qf(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 u=o.instance[l.fn](c,i);u instanceof Promise&&(u=je(u)),u instanceof O?(u=u.pipe(xS({})),l.options.cancelUncompleted&&(u=u.pipe(gr(t.pipe(Ewe(i)))))):u=sn({}).pipe(Wa()),s.push(u)}catch(u){s.push(Fg(u))}}}return s.length||s.push(sn({})),fb(s)}addToStatesMap(t){const i=[],r=this.statesByName;for(const s of t){const o=IS.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!==SS(this._initialState,i);return this.statesByName[t]&&r}}return n.\u0275fac=function(t){return new(t||n)(Ie(Hn),Ie(Wf),Ie(n,12),Ie(AS),Ie(mP),Ie(DS),Ie(lP,8))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),_P=(()=>{class n{constructor(t,i,r){this.internalStateOperations=t,this.stateContextFactory=i,this.bootstrapper=r}ngxsBootstrap(t,i){this.internalStateOperations.getRootStateOperations().dispatch(t).pipe(Ki(()=>!!i),cr(()=>this.invokeInit(i.states)),V(()=>this.bootstrapper.appBootstrapped$),Ki(r=>!!r)).subscribe(()=>this.invokeBootstrap(i.states))}invokeInit(t){for(const i of t){const r=i.instance;if(r.ngxsOnChanges){const a=b5(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(gm),Ie(DS),Ie(aP))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const OS_getOptions=n=>n&&n.NGXS_SELECTOR_OPTIONS_META||{};function Owe(n,e,t){const i=t&&t.containerClass,s=wS(function(...c){const u=e.apply(i,c);return u instanceof Function?wS.apply(null,[u]):u});Object.setPrototypeOf(s,e);const o=function(n,e){const t=function(n){return n.hasOwnProperty(cP)||Object.defineProperty(n,cP,{value:{makeRootSelector:null,originalFn:null,containerClass:null,selectorName:null,getSelectorOptions:()=>({})}}),pP(n)}(n);t.originalFn=n;let i=()=>({});e&&(t.containerClass=e.containerClass,t.selectorName=e.selectorName,i=e.getSelectorOptions||i);const r=Object.assign({},t);return t.getSelectorOptions=()=>function(n,e){return Object.assign({},OS_getOptions(n.containerClass)||{},OS_getOptions(n.originalFn)||{},n.getSelectorOptions()||{},e)}(r,i()),t}(e,t);return o.makeRootSelector=l=>{const{argumentSelectorFunctions:c,selectorOptions:u}=function(n,e,t=[]){const i=e.getSelectorOptions(),r=n.getSelectorOptions(i);return{selectorOptions:r,argumentSelectorFunctions:function(n=[],e,t){const i=[];return t&&(0===n.length||e.injectContainerState)&&pb(t)&&i.push(t),n&&i.push(...n),i}(t,r,e.containerClass).map(a=>T5(a)(n))}}(l,o,n);return function(f){const g=c.map(m=>m(f));try{return s(...g)}catch(m){if(m instanceof TypeError&&u.suppressErrors)return;throw m}}},s}function T5(n){const e=pP(n)||pb(n);return e&&e.makeRootSelector||(()=>n)}let hu=(()=>{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),bc(r=>{const{suppressErrors:s}=this._config.selectorOptions;return r instanceof TypeError&&s?sn(void 0):Fg(r)}),ld(),CS(this._internalExecutionStrategy))}selectOnce(t){return this.select(t).pipe(qr(1))}selectSnapshot(t){return this.getStoreBoundSelectorFn(t)(this._stateStream.getValue())}subscribe(t){return this._stateStream.pipe(CS(this._internalExecutionStrategy)).subscribe(t)}snapshot(){return this._internalStateOperations.getRootStateOperations().getState()}reset(t){return this._internalStateOperations.getRootStateOperations().setState(t)}getStoreBoundSelectorFn(t){return T5(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(MS),Ie(gm),Ie(Wf),Ie(TS),Ie(mm),Ie(lP,8))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),gb=(()=>{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(hu),Ie(Wf))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n.store=null,n.config=null,n})();class Fwe{static get type(){return"@@INIT"}}class Lwe{constructor(e){this.addedStates=e}static get type(){return"@@UPDATE_STATE"}}const RS=new Df(1);let Vwe=(()=>{class n{constructor(t,i,r,s,o=[],a){!function(){try{const n=window.ng,t=!(n.probe&&n.coreTokens)&&fa();RS.next(t)}catch(n){RS.next(!1)}finally{RS.complete()}}();const l=t.addAndReturnDefaults(o);i.setStateToTheCurrentWithNew(l),t.connectActionHandlers(),a.ngxsBootstrap(new Fwe,l)}}return n.\u0275fac=function(t){return new(t||n)(Ie(mm),Ie(gm),Ie(hu),Ie(gb),Ie(u5,8),Ie(_P))},n.\u0275mod=tn({type:n}),n.\u0275inj=St({}),n})(),jwe=(()=>{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 Lwe(l.defaults),l))}static flattenStates(t=[]){return t.reduce((i,r)=>i.concat(r),[])}}return n.\u0275fac=function(t){return new(t||n)(Ie(hu),Ie(gm),Ie(mm),Ie(d5,8),Ie(_P))},n.\u0275mod=tn({type:n}),n.\u0275inj=St({}),n})();class Yo{static forRoot(e=[],t={}){return{ngModule:Vwe,providers:[mm,DS,Dwe,AS,aP,S5,x5,_P,w5,mP,gm,TS,hu,MS,gb,gP,...e,...Yo.ngxsTokenProviders(e,t)]}}static forFeature(e=[]){return{ngModule:jwe,providers:[mm,gP,...e,{provide:d5,multi:!0,useValue:e}]}}static ngxsTokenProviders(e,t){return[{provide:f5,useValue:Xve},{provide:p5,useValue:fa},{provide:m5,useClass:t.executionStrategy||c5},{provide:u5,useValue:e},{provide:Yo.ROOT_OPTIONS,useValue:t},{provide:Wf,useFactory:Yo.ngxsConfigFactory,deps:[Yo.ROOT_OPTIONS]},{provide:IE,useFactory:Yo.appBootstrapListenerFactory,multi:!0,deps:[aP]},{provide:lP,useFactory:Yo.getInitialState},{provide:s5,useExisting:DS},{provide:o5,useExisting:mm}]}static ngxsConfigFactory(e){return dP(new Wf,e)}static appBootstrapListenerFactory(e){return()=>e.bootstrap()}static getInitialState(){return Kve.pop()}}function yP(n,e){return(t,i)=>{if(t.hasOwnProperty("prototype"))throw new Error(qa.ACTION_DECORATOR());const s=hP(t.constructor);Array.isArray(n)||(n=[n]);for(const o of n){const a=o.type;s.actions[a]||(s.actions[a]=[]),s.actions[a].push({fn:i,options:e||{},type:a})}}}function A5(n){return i=>{!function(n){RS.subscribe(e=>{e&&(n.\u0275prov||console.warn(qa.UNDECORATED_STATE_IN_IVY(n.name)))})}(i);const r=i,s=hP(r),o=Object.getPrototypeOf(r),a=function(i){return Object.assign({},i[g5]||{},n)}(o);(function(i){const{meta:r,inheritedStateClass:s,optionsWithInheritance:o}=i,{children:a,defaults:l,name:c}=o,u="string"==typeof c?c:c&&c.getName()||null;IS.checkCorrectStateName(u),s.hasOwnProperty(cd)&&(r.actions=Object.assign({},r.actions,(s[cd]||{}).actions)),r.children=a,r.defaults=l,r.name=u})({meta:s,inheritedStateClass:o,optionsWithInheritance:a}),r[g5]=a}}function PS(n,...e){return function(t,i){const r=i.toString(),s=`__${r}__selector`,o=function(n,e,t=[]){return"string"==typeof(e=e||function(n){const e=n.length-1;return 36===n.charCodeAt(e)?n.slice(0,e):n}(n))?y5(t.length?[e,...t]:e.split("."),gb.config):e}(r,n,e);Object.defineProperties(t,{[s]:{writable:!0,enumerable:!1,configurable:!0},[r]:{enumerable:!0,configurable:!0,get(){return this[s]||(this[s]=function(n){if(!gb.store)throw new Error(qa.SELECT_FACTORY_NOT_CONNECTED());return gb.store.select(n)}(o))}}})}}function _m(n){return(e,t,i)=>{if(!i||null===i.value)throw new Error(qa.SELECTOR_DECORATOR());const s=i.value,o=Owe(n,s,{containerClass:e,selectorName:t.toString(),getSelectorOptions:()=>({})}),a={configurable:!0,get:()=>o};return a.originalFn=s,a}}Yo.\u0275fac=function(e){return new(e||Yo)},Yo.\u0275mod=tn({type:Yo}),Yo.\u0275inj=St({}),Yo.ROOT_OPTIONS=new Ht("ROOT_OPTIONS");const Xo=new Ht("NgValueAccessor");function Dl(n,...e){return e.length?e.some(t=>n[t]):n.altKey||n.shiftKey||n.ctrlKey||n.metaKey}const qS=new cc(sx);class YEe{constructor(e,t){this.dueTime=e,this.scheduler=t}call(e,t){return t.subscribe(new XEe(e,this.dueTime,this.scheduler))}}class XEe 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(KEe,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 KEe(n){n.debouncedNext()}class QEe{constructor(e){this.total=e}call(e,t){return t.subscribe(new ZEe(e,this.total))}}class ZEe extends y{constructor(e,t){super(e),this.total=t,this.count=0}_next(e){++this.count>this.total&&this.destination.next(e)}}function bi(n){return null!=n&&"false"!=`${n}`}function Ya(n,e=0){return function(n){return!isNaN(parseFloat(n))&&!isNaN(Number(n))}(n)?Number(n):e}function YS(n){return Array.isArray(n)?n:[n]}function bs(n){return null==n?"":"string"==typeof n?n:`${n}px`}function dd(n){return n instanceof gn?n.nativeElement:n}let zP;try{zP="undefined"!=typeof Intl&&Intl.v8BreakIterator}catch(n){zP=!1}let Cb,Xf,HP,Qi=(()=>{class n{constructor(t){this._platformId=t,this.isBrowser=this._platformId?Af(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&&!zP)&&"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(Xc))},n.\u0275prov=We({factory:function(){return new n(Ie(Xc))},token:n,providedIn:"root"}),n})(),Sb=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=tn({type:n}),n.\u0275inj=St({}),n})();function vm(n){return function(){if(null==Cb&&"undefined"!=typeof window)try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:()=>Cb=!0}))}finally{Cb=Cb||!1}return Cb}()?n:!!n.capture}function F6(){if(null==Xf){if("object"!=typeof document||!document||"function"!=typeof Element||!Element)return Xf=!1,Xf;if("scrollBehavior"in document.documentElement.style)Xf=!0;else{const n=Element.prototype.scrollTo;Xf=!!n&&!/\{\s*\[native code\]\s*\}/.test(n.toString())}}return Xf}function KS(){let n="undefined"!=typeof document&&document?document.activeElement:null;for(;n&&n.shadowRoot;){const e=n.shadowRoot.activeElement;if(e===n)break;n=e}return n}function Kf(n){return n.composedPath?n.composedPath()[0]:n.target}let GP=(()=>{class n{create(t){return"undefined"==typeof MutationObserver?null:new MutationObserver(t)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({factory:function(){return new n},token:n,providedIn:"root"}),n})(),L6=(()=>{class n{constructor(t){this._mutationObserverFactory=t,this._observedElements=new Map}ngOnDestroy(){this._observedElements.forEach((t,i)=>this._cleanupObserver(i))}observe(t){const i=dd(t);return new O(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 oe,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(GP))},n.\u0275prov=We({factory:function(){return new n(Ie(GP))},token:n,providedIn:"root"}),n})(),$P=(()=>{class n{constructor(t,i,r){this._contentObserver=t,this._elementRef=i,this._ngZone=r,this.event=new ln,this._disabled=!1,this._currentSubscription=null}get disabled(){return this._disabled}set disabled(t){this._disabled=bi(t),this._disabled?this._unsubscribe():this._subscribe()}get debounce(){return this._debounce}set debounce(t){this._debounce=Ya(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=qS){return t=>t.lift(new YEe(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)(Ce(L6),Ce(gn),Ce(pn))},n.\u0275dir=Nt({type:n,selectors:[["","cdkObserveContent",""]],inputs:{disabled:["cdkObserveContentDisabled","disabled"],debounce:"debounce"},outputs:{event:"cdkObserveContent"},exportAs:["cdkObserveContent"]}),n})(),QS=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=tn({type:n}),n.\u0275inj=St({providers:[GP]}),n})(),$6=(()=>{class n{constructor(t){this._platform=t}isDisabled(t){return t.hasAttribute("disabled")}isVisible(t){return function(n){return!!(n.offsetWidth||n.offsetHeight||"function"==typeof n.getClientRects&&n.getClientRects().length)}(t)&&"visible"===getComputedStyle(t).visibility}isTabbable(t){if(!this._platform.isBrowser)return!1;const i=function(n){try{return n.frameElement}catch(e){return null}}(function(n){return n.ownerDocument&&n.ownerDocument.defaultView||window}(t));if(i&&(-1===q6(i)||!this.isVisible(i)))return!1;let r=t.nodeName.toLowerCase(),s=q6(t);return t.hasAttribute("contenteditable")?-1!==s:!("iframe"===r||"object"===r||this._platform.WEBKIT&&this._platform.IOS&&!function(n){let e=n.nodeName.toLowerCase(),t="input"===e&&n.type;return"text"===t||"password"===t||"select"===e||"textarea"===e}(t))&&("audio"===r?!!t.hasAttribute("controls")&&-1!==s:"video"===r?-1!==s&&(null!==s||this._platform.FIREFOX||t.hasAttribute("controls")):t.tabIndex>=0)}isFocusable(t,i){return function(n){return!function(n){return function(n){return"input"==n.nodeName.toLowerCase()}(n)&&"hidden"==n.type}(n)&&(function(n){let e=n.nodeName.toLowerCase();return"input"===e||"select"===e||"button"===e||"textarea"===e}(n)||function(n){return function(n){return"a"==n.nodeName.toLowerCase()}(n)&&n.hasAttribute("href")}(n)||n.hasAttribute("contenteditable")||W6(n))}(t)&&!this.isDisabled(t)&&((null==i?void 0:i.ignoreVisibility)||this.isVisible(t))}}return n.\u0275fac=function(t){return new(t||n)(Ie(Qi))},n.\u0275prov=We({factory:function(){return new n(Ie(Qi))},token:n,providedIn:"root"}),n})();function W6(n){if(!n.hasAttribute("tabindex")||void 0===n.tabIndex)return!1;let e=n.getAttribute("tabindex");return"-32768"!=e&&!(!e||isNaN(parseInt(e,10)))}function q6(n){if(!W6(n))return null;const e=parseInt(n.getAttribute("tabindex")||"",10);return isNaN(e)?-1:e}class yxe{constructor(e,t,i,r,s=!1){this._element=e,this._checker=t,this._ngZone=i,this._document=r,this._hasAttached=!1,this.startAnchorListener=()=>this.focusLastTabbableElement(),this.endAnchorListener=()=>this.focusFirstTabbableElement(),this._enabled=!0,s||this.attachAnchors()}get enabled(){return this._enabled}set enabled(e){this._enabled=e,this._startAnchor&&this._endAnchor&&(this._toggleAnchorTabIndex(e,this._startAnchor),this._toggleAnchorTabIndex(e,this._endAnchor))}destroy(){const 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}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(e){return new Promise(t=>{this._executeOnStable(()=>t(this.focusInitialElement(e)))})}focusFirstTabbableElementWhenReady(e){return new Promise(t=>{this._executeOnStable(()=>t(this.focusFirstTabbableElement(e)))})}focusLastTabbableElementWhenReady(e){return new Promise(t=>{this._executeOnStable(()=>t(this.focusLastTabbableElement(e)))})}_getRegionBoundary(e){let t=this._element.querySelectorAll(`[cdk-focus-region-${e}], [cdkFocusRegion${e}], [cdk-focus-${e}]`);for(let i=0;i=0;i--){let r=t[i].nodeType===this._document.ELEMENT_NODE?this._getLastTabbableElement(t[i]):null;if(r)return r}return null}_createAnchor(){const 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}_toggleAnchorTabIndex(e,t){e?t.setAttribute("tabindex","0"):t.removeAttribute("tabindex")}toggleAnchors(e){this._startAnchor&&this._endAnchor&&(this._toggleAnchorTabIndex(e,this._startAnchor),this._toggleAnchorTabIndex(e,this._endAnchor))}_executeOnStable(e){this._ngZone.isStable?e():this._ngZone.onStable.pipe(qr(1)).subscribe(e)}}let Y6=(()=>{class n{constructor(t,i,r){this._checker=t,this._ngZone=i,this._document=r}create(t,i=!1){return new yxe(t,this._checker,this._ngZone,this._document,i)}}return n.\u0275fac=function(t){return new(t||n)(Ie($6),Ie(pn),Ie(fn))},n.\u0275prov=We({factory:function(){return new n(Ie($6),Ie(pn),Ie(fn))},token:n,providedIn:"root"}),n})();function X6(n){return 0===n.offsetX&&0===n.offsetY}function K6(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 Q6=new Ht("cdk-input-modality-detector-options"),xxe={ignoreKeys:[18,17,224,91,16]},wm=vm({passive:!0,capture:!0});let J6=(()=>{class n{constructor(t,i,r,s){this._platform=t,this._mostRecentTarget=null,this._modality=new Fr(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=Kf(o))},this._onMousedown=o=>{Date.now()-this._lastTouchMs<650||(this._modality.next(X6(o)?"keyboard":"mouse"),this._mostRecentTarget=Kf(o))},this._onTouchstart=o=>{K6(o)?this._modality.next("keyboard"):(this._lastTouchMs=Date.now(),this._modality.next("touch"),this._mostRecentTarget=Kf(o))},this._options=Object.assign(Object.assign({},xxe),s),this.modalityDetected=this._modality.pipe(function(n){return e=>e.lift(new QEe(n))}(1)),this.modalityChanged=this.modalityDetected.pipe(ld()),t.isBrowser&&i.runOutsideAngular(()=>{r.addEventListener("keydown",this._onKeydown,wm),r.addEventListener("mousedown",this._onMousedown,wm),r.addEventListener("touchstart",this._onTouchstart,wm)})}get mostRecentModality(){return this._modality.value}ngOnDestroy(){!this._platform.isBrowser||(document.removeEventListener("keydown",this._onKeydown,wm),document.removeEventListener("mousedown",this._onMousedown,wm),document.removeEventListener("touchstart",this._onTouchstart,wm))}}return n.\u0275fac=function(t){return new(t||n)(Ie(Qi),Ie(pn),Ie(fn),Ie(Q6,8))},n.\u0275prov=We({factory:function(){return new n(Ie(Qi),Ie(pn),Ie(fn),Ie(Q6,8))},token:n,providedIn:"root"}),n})();const nG=new Ht("cdk-focus-monitor-default-options"),eC=vm({passive:!0,capture:!0});let vc=(()=>{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 oe,this._rootNodeFocusAndBlurListener=a=>{const l=Kf(a),c="focus"===a.type?this._onFocus:this._onBlur;for(let u=l;u;u=u.parentElement)c.call(this,a,u)},this._document=s,this._detectionMode=(null==o?void 0:o.detectionMode)||0}monitor(t,i=!1){const r=dd(t);if(!this._platform.isBrowser||1!==r.nodeType)return sn(null);const s=function(n){if(function(){if(null==HP){const n="undefined"!=typeof document?document.head:null;HP=!(!n||!n.createShadowRoot&&!n.attachShadow)}return HP}()){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 oe,rootNode:s};return this._elementInfo.set(r,a),this._registerGlobalListeners(a),a.subject}stopMonitoring(t){const i=dd(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=dd(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=Kf(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,eC),i.addEventListener("blur",this._rootNodeFocusAndBlurListener,eC)}),this._rootNodeFocusListenerCount.set(i,r+1),1==++this._monitoredElementCount&&(this._ngZone.runOutsideAngular(()=>{this._getWindow().addEventListener("focus",this._windowFocusListener)}),this._inputModalityDetector.modalityDetected.pipe(gr(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,eC),i.removeEventListener("blur",this._rootNodeFocusAndBlurListener,eC),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(pn),Ie(Qi),Ie(J6),Ie(fn,8),Ie(nG,8))},n.\u0275prov=We({factory:function(){return new n(Ie(pn),Ie(Qi),Ie(J6),Ie(fn,8),Ie(nG,8))},token:n,providedIn:"root"}),n})();const iG="cdk-high-contrast-black-on-white",rG="cdk-high-contrast-white-on-black",qP="cdk-high-contrast-active";let sG=(()=>{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(qP),t.remove(iG),t.remove(rG),this._hasCheckedHighContrastMode=!0;const i=this.getHighContrastMode();1===i?(t.add(qP),t.add(iG)):2===i&&(t.add(qP),t.add(rG))}}}return n.\u0275fac=function(t){return new(t||n)(Ie(Qi),Ie(fn))},n.\u0275prov=We({factory:function(){return new n(Ie(Qi),Ie(fn))},token:n,providedIn:"root"}),n})();const oG=new Ht("cdk-dir-doc",{providedIn:"root",factory:function(){return Bc(fn)}});let Il=(()=>{class n{constructor(t){if(this.value="ltr",this.change=new ln,t){const r=t.documentElement?t.documentElement.dir:null,s=(t.body?t.body.dir:null)||r;this.value="ltr"===s||"rtl"===s?s:"ltr"}}ngOnDestroy(){this.change.complete()}}return n.\u0275fac=function(t){return new(t||n)(Ie(oG,8))},n.\u0275prov=We({factory:function(){return new n(Ie(oG,8))},token:n,providedIn:"root"}),n})(),Ab=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=tn({type:n}),n.\u0275inj=St({}),n})();const aG=new Hu("12.2.5");function tC(...n){return kt(1)(sn(...n))}function Oo(...n){const e=n[n.length-1];return Te(e)?(n.pop(),t=>tC(n,t,e)):t=>tC(n,t)}function Em(n,e){return{type:7,name:n,definitions:e,options:{}}}function fd(n,e=null){return{type:4,styles:e,timings:n}}function ds(n){return{type:6,styles:n,offset:null}}function wc(n,e,t){return{type:0,name:n,styles:e,options:t}}function pd(n,e,t=null){return{type:1,expr:n,animation:e,options:t}}function uG(n){Promise.resolve(null).then(n)}class xm{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(){uG(()=>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 hG(){return"undefined"!=typeof window&&void 0!==window.document}function XP(){return"undefined"!=typeof process&&"[object process]"==={}.toString.call(process)}let JP=(n,e)=>!1,eN=(n,e)=>!1,gG=(n,e,t)=>[];const mG=XP();(mG||"undefined"!=typeof Element)&&(JP=hG()?(n,e)=>{for(;e&&e!==document.documentElement;){if(e===n)return!0;e=e.parentNode||e.host}return!1}:(n,e)=>n.contains(e),eN=(()=>{if(mG||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]):eN}})(),gG=(n,e,t)=>{let i=[];if(t){const r=n.querySelectorAll(e);for(let s=0;s{class n{validateStyleProperty(t){return tN(t)}matchesElement(t,i){return nN(t,i)}containsElement(t,i){return iN(t,i)}query(t,i,r){return rN(t,i,r)}computeStyle(t,i,r){return r||""}animate(t,i,r,s,o,a=[],l){return new xm(r,s)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();class nC{}nC.NOOP=new bG;function xG(n,e,t){return t?e+":"+t+";":""}function SG(n){let e="";for(let t=0;t{const r=cN(i);t&&!t.hasOwnProperty(i)&&(t[i]=n.style[r]),n.style[r]=e[i]}),XP()&&SG(n))}function Jf(n,e){n.style&&(Object.keys(e).forEach(t=>{const i=cN(t);n.style[i]=""}),XP()&&SG(n))}const Lxe=/-+([a-z0-9])/g;function cN(n){return n.replace(Lxe,(...e)=>e[1].toUpperCase())}function Bxe(n){return n.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}class Tm{constructor(e,t,i){this._element=e,this._startStyles=t,this._endStyles=i,this._state=0;let r=Tm.initialStylesByElement.get(e);r||Tm.initialStylesByElement.set(e,r={}),this._initialStyles=r}start(){this._state<1&&(this._startStyles&&pu(this._element,this._startStyles,this._initialStyles),this._state=1)}finish(){this.start(),this._state<2&&(pu(this._element,this._initialStyles),this._endStyles&&(pu(this._element,this._endStyles),this._endStyles=null),this._state=1)}destroy(){this.finish(),this._state<3&&(Tm.initialStylesByElement.delete(this._element),this._startStyles&&(Jf(this._element,this._startStyles),this._endStyles=null),this._endStyles&&(Jf(this._element,this._endStyles),this._endStyles=null),pu(this._element,this._initialStyles),this._state=3)}}Tm.initialStylesByElement=new WeakMap;const Qa=new Ht("AnimationModuleType"),l$=new Hu("12.2.5"),sCe=new Ht("mat-sanity-checks",{providedIn:"root",factory:function(){return!0}});let tp,ji=(()=>{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!(!fa()||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")&&l$.full!==aG.full&&console.warn("The Angular Material version ("+l$.full+") does not match the Angular CDK version ("+aG.full+").\nPlease ensure the versions of these two packages exactly match.")}}return n.\u0275fac=function(t){return new(t||n)(Ie(sG),Ie(sCe,8),Ie(fn))},n.\u0275mod=tn({type:n}),n.\u0275inj=St({imports:[[Ab],Ab]}),n})();function Am(n){return class extends n{constructor(...e){super(...e),this._disabled=!1}get disabled(){return this._disabled}set disabled(e){this._disabled=bi(e)}}}function Mm(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 Ch(n){return class extends n{constructor(...e){super(...e),this._disableRipple=!1}get disableRipple(){return this._disableRipple}set disableRipple(e){this._disableRipple=bi(e)}}}function wC(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?Ya(t):this.defaultTabIndex}}}try{tp="undefined"!=typeof Intl}catch(n){tp=!1}class yCe{constructor(e,t,i){this._renderer=e,this.element=t,this.config=i,this.state=3}fadeOut(){this._renderer.fadeOutRipple(this)}}const p$={enterDuration:225,exitDuration:150},SN=vm({passive:!0}),g$=["mousedown","touchstart"],m$=["mouseup","mouseleave","touchend","touchcancel"];class vCe{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=dd(i))}fadeInRipple(e,t,i={}){const r=this._containerRect=this._containerRect||this._containerElement.getBoundingClientRect(),s=Object.assign(Object.assign({},p$),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,u=document.createElement("div");u.classList.add("mat-ripple-element"),u.style.left=a-o+"px",u.style.top=l-o+"px",u.style.height=2*o+"px",u.style.width=2*o+"px",null!=i.color&&(u.style.backgroundColor=i.color),u.style.transitionDuration=`${c}ms`,this._containerElement.appendChild(u),function(n){window.getComputedStyle(n).getPropertyValue("opacity")}(u),u.style.transform="scale(1)";const h=new yCe(this,u,i);return h.state=0,this._activeRipples.add(h),i.persistent||(this._mostRecentTransientRipple=h),this._runTimeoutOutsideZone(()=>{const f=h===this._mostRecentTransientRipple;h.state=1,!i.persistent&&(!f||!this._isPointerDown)&&h.fadeOut()},c),h}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({},p$),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=dd(e);!t||t===this._triggerElement||(this._removeTriggerEvents(),this._triggerElement=t,this._registerEvents(g$))}handleEvent(e){"mousedown"===e.type?this._onMousedown(e):"touchstart"===e.type?this._onTouchStart(e):this._onPointerUp(),this._pointerUpEventsRegistered||(this._registerEvents(m$),this._pointerUpEventsRegistered=!0)}_onMousedown(e){const t=X6(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,SN)})})}_removeTriggerEvents(){this._triggerElement&&(g$.forEach(e=>{this._triggerElement.removeEventListener(e,this,SN)}),this._pointerUpEventsRegistered&&m$.forEach(e=>{this._triggerElement.removeEventListener(e,this,SN)}))}}const xCe=new Ht("mat-ripple-global-options");let gu=(()=>{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 vCe(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)(Ce(gn),Ce(pn),Ce(Qi),Ce(xCe,8),Ce(Qa,8))},n.\u0275dir=Nt({type:n,selectors:[["","mat-ripple",""],["","matRipple",""]],hostAttrs:[1,"mat-ripple"],hostVars:2,hostBindings:function(t,i){2&t&&ai("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})(),Dm=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=tn({type:n}),n.\u0275inj=St({imports:[[ji,Sb],ji]}),n})();function gd(n,e,t,i){return Y(t)&&(i=t,t=void 0),i?gd(n,e,t).pipe(me(r=>k(r)?i(...r):i(r))):new O(r=>{E$(n,e,function(o){r.next(arguments.length>1?Array.prototype.slice.call(arguments):o)},r,t)})}function E$(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;o0?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 FCe=1;const LCe=Promise.resolve(),SC={};function x$(n){return n in SC&&(delete SC[n],!0)}const S$={setImmediate(n){const e=FCe++;return SC[e]=!0,LCe.then(()=>x$(e)&&n()),e},clearImmediate(n){x$(n)}};new class extends cc{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=S$.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&&(S$.clearImmediate(t),e.scheduled=void 0)}});function Im(n){return!!n&&(n instanceof O||"function"==typeof n.lift&&"function"==typeof n.subscribe)}class zCe{constructor(e){this.durationSelector=e}call(e,t){return t.subscribe(new HCe(e,this.durationSelector))}}class HCe extends we{constructor(e,t){super(e),this.durationSelector=t,this.hasValue=!1}_next(e){if(this.value=e,this.hasValue=!0,!this.throttled){let t;try{const{durationSelector:r}=this;t=r(e)}catch(r){return this.destination.error(r)}const i=N(t,new _t(this));!i||i.closed?this.clearThrottle():this.add(this.throttled=i)}}clearThrottle(){const{value:e,hasValue:t,throttled:i}=this;i&&(this.remove(i),this.throttled=void 0,i.unsubscribe()),t&&(this.value=void 0,this.hasValue=!1,this.destination.next(e))}notifyNext(){this.clearThrottle()}notifyComplete(){this.clearThrottle()}}function C$(n){return!k(n)&&n-parseFloat(n)+1>=0}function $Ce(n){const{index:e,period:t,subscriber:i}=n;if(i.next(e),!i.closed){if(-1===t)return i.complete();n.index=e+1,this.schedule(n,t)}}function CC(n,e=qS){return function(n){return function(t){return t.lift(new zCe(n))}}(()=>function(n=0,e,t){let i=-1;return C$(e)?i=Number(e)<1?1:Number(e):Te(e)&&(t=e),Te(t)||(t=qS),new O(r=>{const s=C$(n)?n:+n-t.now();return t.schedule($Ce,s,{index:0,period:i,subscriber:r})})}(n,e))}let A$=(()=>{class n{constructor(){this._listeners=[]}notify(t,i){for(let r of this._listeners)r(t,i)}listen(t){return this._listeners.push(t),()=>{this._listeners=this._listeners.filter(i=>t!==i)}}ngOnDestroy(){this._listeners=[]}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({factory:function(){return new n},token:n,providedIn:"root"}),n})(),Om=(()=>{class n{constructor(t,i,r){this._ngZone=t,this._platform=i,this._scrolled=new oe,this._globalSubscription=null,this._scrolledCount=0,this.scrollContainers=new Map,this._document=r}register(t){this.scrollContainers.has(t)||this.scrollContainers.set(t,t.elementScrolled().subscribe(()=>this._scrolled.next(t)))}deregister(t){const i=this.scrollContainers.get(t);i&&(i.unsubscribe(),this.scrollContainers.delete(t))}scrolled(t=20){return this._platform.isBrowser?new O(i=>{this._globalSubscription||this._addGlobalListener();const r=t>0?this._scrolled.pipe(CC(t)).subscribe(i):this._scrolled.subscribe(i);return this._scrolledCount++,()=>{r.unsubscribe(),this._scrolledCount--,this._scrolledCount||this._removeGlobalListener()}}):sn()}ngOnDestroy(){this._removeGlobalListener(),this.scrollContainers.forEach((t,i)=>this.deregister(i)),this._scrolled.complete()}ancestorScrolled(t,i){const r=this.getAncestorScrollContainers(t);return this.scrolled(i).pipe(Ki(s=>!s||r.indexOf(s)>-1))}getAncestorScrollContainers(t){const i=[];return this.scrollContainers.forEach((r,s)=>{this._scrollableContainsElement(s,t)&&i.push(s)}),i}_getWindow(){return this._document.defaultView||window}_scrollableContainsElement(t,i){let r=dd(i),s=t.getElementRef().nativeElement;do{if(r==s)return!0}while(r=r.parentElement);return!1}_addGlobalListener(){this._globalSubscription=this._ngZone.runOutsideAngular(()=>gd(this._getWindow().document,"scroll").subscribe(()=>this._scrolled.next()))}_removeGlobalListener(){this._globalSubscription&&(this._globalSubscription.unsubscribe(),this._globalSubscription=null)}}return n.\u0275fac=function(t){return new(t||n)(Ie(pn),Ie(Qi),Ie(fn,8))},n.\u0275prov=We({factory:function(){return new n(Ie(pn),Ie(Qi),Ie(fn,8))},token:n,providedIn:"root"}),n})(),Rm=(()=>{class n{constructor(t,i,r){this._platform=t,this._change=new oe,this._changeListener=s=>{this._change.next(s)},this._document=r,i.runOutsideAngular(()=>{if(t.isBrowser){const s=this._getWindow();s.addEventListener("resize",this._changeListener),s.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:i,height:r}=this.getViewportSize();return{top:t.top,left:t.left,bottom:t.top+r,right:t.left+i,height:r,width:i}}getViewportScrollPosition(){if(!this._platform.isBrowser)return{top:0,left:0};const t=this._document,i=this._getWindow(),r=t.documentElement,s=r.getBoundingClientRect();return{top:-s.top||t.body.scrollTop||i.scrollY||r.scrollTop||0,left:-s.left||t.body.scrollLeft||i.scrollX||r.scrollLeft||0}}change(t=20){return t>0?this._change.pipe(CC(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 n.\u0275fac=function(t){return new(t||n)(Ie(Qi),Ie(pn),Ie(fn,8))},n.\u0275prov=We({factory:function(){return new n(Ie(Qi),Ie(pn),Ie(fn,8))},token:n,providedIn:"root"}),n})();class MN{attach(e){return this._attachedHost=e,e.attach(this)}detach(){let e=this._attachedHost;null!=e&&(this._attachedHost=null,e.detach())}get isAttached(){return null!=this._attachedHost}setAttachedHost(e){this._attachedHost=e}}class AC extends MN{constructor(e,t,i,r){super(),this.component=e,this.viewContainerRef=t,this.injector=i,this.componentFactoryResolver=r}}class Pm extends MN{constructor(e,t,i){super(),this.templateRef=e,this.viewContainerRef=t,this.context=i}get origin(){return this.templateRef.elementRef}attach(e,t=this.context){return this.context=t,super.attach(e)}detach(){return this.context=void 0,super.detach()}}class l1e extends MN{constructor(e){super(),this.element=e instanceof gn?e.nativeElement:e}}class MC{constructor(){this._isDisposed=!1,this.attachDomPortal=null}hasAttached(){return!!this._attachedPortal}attach(e){return e instanceof AC?(this._attachedPortal=e,this.attachComponentPortal(e)):e instanceof Pm?(this._attachedPortal=e,this.attachTemplatePortal(e)):this.attachDomPortal&&e instanceof l1e?(this._attachedPortal=e,this.attachDomPortal(e)):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(e){this._disposeFn=e}_invokeDisposeFn(){this._disposeFn&&(this._disposeFn(),this._disposeFn=null)}}class c1e extends MC{constructor(e,t,i,r,s){super(),this.outletElement=e,this._componentFactoryResolver=t,this._appRef=i,this._defaultInjector=r,this.attachDomPortal=o=>{const a=o.element,l=this._document.createComment("dom-portal");a.parentNode.insertBefore(l,a),this.outletElement.appendChild(a),this._attachedPortal=o,super.setDisposeFn(()=>{l.parentNode&&l.parentNode.replaceChild(a,l)})},this._document=s}attachComponentPortal(e){const i=(e.componentFactoryResolver||this._componentFactoryResolver).resolveComponentFactory(e.component);let r;return e.viewContainerRef?(r=e.viewContainerRef.createComponent(i,e.viewContainerRef.length,e.injector||e.viewContainerRef.injector),this.setDisposeFn(()=>r.destroy())):(r=i.create(e.injector||this._defaultInjector),this._appRef.attachView(r.hostView),this.setDisposeFn(()=>{this._appRef.detachView(r.hostView),r.destroy()})),this.outletElement.appendChild(this._getComponentRootNode(r)),this._attachedPortal=e,r}attachTemplatePortal(e){let t=e.viewContainerRef,i=t.createEmbeddedView(e.templateRef,e.context);return i.rootNodes.forEach(r=>this.outletElement.appendChild(r)),i.detectChanges(),this.setDisposeFn(()=>{let r=t.indexOf(i);-1!==r&&t.remove(r)}),this._attachedPortal=e,i}dispose(){super.dispose(),null!=this.outletElement.parentNode&&this.outletElement.parentNode.removeChild(this.outletElement)}_getComponentRootNode(e){return e.hostView.rootNodes[0]}}let np=(()=>{class n extends MC{constructor(t,i,r){super(),this._componentFactoryResolver=t,this._viewContainerRef=i,this._isInitialized=!1,this.attached=new ln,this.attachDomPortal=s=>{const o=s.element,a=this._document.createComment("dom-portal");s.setAttachedHost(this),o.parentNode.insertBefore(a,o),this._getRootNode().appendChild(o),this._attachedPortal=s,super.setDisposeFn(()=>{a.parentNode&&a.parentNode.replaceChild(o,a)})},this._document=r}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 i=null!=t.viewContainerRef?t.viewContainerRef:this._viewContainerRef,s=(t.componentFactoryResolver||this._componentFactoryResolver).resolveComponentFactory(t.component),o=i.createComponent(s,i.length,t.injector||i.injector);return i!==this._viewContainerRef&&this._getRootNode().appendChild(o.hostView.rootNodes[0]),super.setDisposeFn(()=>o.destroy()),this._attachedPortal=t,this._attachedRef=o,this.attached.emit(o),o}attachTemplatePortal(t){t.setAttachedHost(this);const i=this._viewContainerRef.createEmbeddedView(t.templateRef,t.context);return super.setDisposeFn(()=>this._viewContainerRef.clear()),this._attachedPortal=t,this._attachedRef=i,this.attached.emit(i),i}_getRootNode(){const t=this._viewContainerRef.element.nativeElement;return t.nodeType===t.ELEMENT_NODE?t:t.parentNode}}return n.\u0275fac=function(t){return new(t||n)(Ce(El),Ce(Rs),Ce(fn))},n.\u0275dir=Nt({type:n,selectors:[["","cdkPortalOutlet",""]],inputs:{portal:["cdkPortalOutlet","portal"]},outputs:{attached:"attached"},exportAs:["cdkPortalOutlet"],features:[En]}),n})();const N$=F6();class f1e{constructor(e,t){this._viewportRuler=e,this._previousHTMLStyles={top:"",left:""},this._isEnabled=!1,this._document=t}attach(){}enable(){if(this._canBeEnabled()){const e=this._document.documentElement;this._previousScrollPosition=this._viewportRuler.getViewportScrollPosition(),this._previousHTMLStyles.left=e.style.left||"",this._previousHTMLStyles.top=e.style.top||"",e.style.left=bs(-this._previousScrollPosition.left),e.style.top=bs(-this._previousScrollPosition.top),e.classList.add("cdk-global-scrollblock"),this._isEnabled=!0}}disable(){if(this._isEnabled){const e=this._document.documentElement,i=e.style,r=this._document.body.style,s=i.scrollBehavior||"",o=r.scrollBehavior||"";this._isEnabled=!1,i.left=this._previousHTMLStyles.left,i.top=this._previousHTMLStyles.top,e.classList.remove("cdk-global-scrollblock"),N$&&(i.scrollBehavior=r.scrollBehavior="auto"),window.scroll(this._previousScrollPosition.left,this._previousScrollPosition.top),N$&&(i.scrollBehavior=s,r.scrollBehavior=o)}}_canBeEnabled(){if(this._document.documentElement.classList.contains("cdk-global-scrollblock")||this._isEnabled)return!1;const t=this._document.body,i=this._viewportRuler.getViewportSize();return t.scrollHeight>i.height||t.scrollWidth>i.width}}class p1e{constructor(e,t,i,r){this._scrollDispatcher=e,this._ngZone=t,this._viewportRuler=i,this._config=r,this._scrollSubscription=null,this._detach=()=>{this.disable(),this._overlayRef.hasAttached()&&this._ngZone.run(()=>this._overlayRef.detach())}}attach(e){this._overlayRef=e}enable(){if(this._scrollSubscription)return;const e=this._scrollDispatcher.scrolled(0);this._config&&this._config.threshold&&this._config.threshold>1?(this._initialScrollPosition=this._viewportRuler.getViewportScrollPosition().top,this._scrollSubscription=e.subscribe(()=>{const t=this._viewportRuler.getViewportScrollPosition().top;Math.abs(t-this._initialScrollPosition)>this._config.threshold?this._detach():this._overlayRef.updatePosition()})):this._scrollSubscription=e.subscribe(this._detach)}disable(){this._scrollSubscription&&(this._scrollSubscription.unsubscribe(),this._scrollSubscription=null)}detach(){this.disable(),this._overlayRef=null}}class k${enable(){}disable(){}attach(){}}function DN(n,e){return e.some(t=>n.bottomt.bottom||n.rightt.right)}function F$(n,e){return e.some(t=>n.topt.bottom||n.leftt.right)}class g1e{constructor(e,t,i,r){this._scrollDispatcher=e,this._viewportRuler=t,this._ngZone=i,this._config=r,this._scrollSubscription=null}attach(e){this._overlayRef=e}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:i,height:r}=this._viewportRuler.getViewportSize();DN(t,[{width:i,height:r,bottom:r,right:i,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 m1e=(()=>{class n{constructor(t,i,r,s){this._scrollDispatcher=t,this._viewportRuler=i,this._ngZone=r,this.noop=()=>new k$,this.close=o=>new p1e(this._scrollDispatcher,this._ngZone,this._viewportRuler,o),this.block=()=>new f1e(this._viewportRuler,this._document),this.reposition=o=>new g1e(this._scrollDispatcher,this._viewportRuler,this._ngZone,o),this._document=s}}return n.\u0275fac=function(t){return new(t||n)(Ie(Om),Ie(Rm),Ie(pn),Ie(fn))},n.\u0275prov=We({factory:function(){return new n(Ie(Om),Ie(Rm),Ie(pn),Ie(fn))},token:n,providedIn:"root"}),n})();class IC{constructor(e){if(this.scrollStrategy=new k$,this.panelClass="",this.hasBackdrop=!1,this.backdropClass="cdk-overlay-dark-backdrop",this.disposeOnNavigation=!1,e){const t=Object.keys(e);for(const i of t)void 0!==e[i]&&(this[i]=e[i])}}}class _1e{constructor(e,t,i,r,s){this.offsetX=i,this.offsetY=r,this.panelClass=s,this.originX=e.originX,this.originY=e.originY,this.overlayX=t.overlayX,this.overlayY=t.overlayY}}class y1e{constructor(e,t){this.connectionPair=e,this.scrollableViewProperties=t}}let L$=(()=>{class n{constructor(t){this._attachedOverlays=[],this._document=t}ngOnDestroy(){this.detach()}add(t){this.remove(t),this._attachedOverlays.push(t)}remove(t){const i=this._attachedOverlays.indexOf(t);i>-1&&this._attachedOverlays.splice(i,1),0===this._attachedOverlays.length&&this.detach()}}return n.\u0275fac=function(t){return new(t||n)(Ie(fn))},n.\u0275prov=We({factory:function(){return new n(Ie(fn))},token:n,providedIn:"root"}),n})(),b1e=(()=>{class n extends L${constructor(t){super(t),this._keydownListener=i=>{const r=this._attachedOverlays;for(let s=r.length-1;s>-1;s--)if(r[s]._keydownEvents.observers.length>0){r[s]._keydownEvents.next(i);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 n.\u0275fac=function(t){return new(t||n)(Ie(fn))},n.\u0275prov=We({factory:function(){return new n(Ie(fn))},token:n,providedIn:"root"}),n})(),v1e=(()=>{class n extends L${constructor(t,i){super(t),this._platform=i,this._cursorStyleIsSet=!1,this._clickListener=r=>{const s=Kf(r),o=this._attachedOverlays.slice();for(let a=o.length-1;a>-1;a--){const l=o[a];if(!(l._outsidePointerEvents.observers.length<1)&&l.hasAttached()){if(l.overlayElement.contains(s))break;l._outsidePointerEvents.next(r)}}}}add(t){if(super.add(t),!this._isAttached){const i=this._document.body;i.addEventListener("click",this._clickListener,!0),i.addEventListener("auxclick",this._clickListener,!0),i.addEventListener("contextmenu",this._clickListener,!0),this._platform.IOS&&!this._cursorStyleIsSet&&(this._cursorOriginalValue=i.style.cursor,i.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 n.\u0275fac=function(t){return new(t||n)(Ie(fn),Ie(Qi))},n.\u0275prov=We({factory:function(){return new n(Ie(fn),Ie(Qi))},token:n,providedIn:"root"}),n})();const Th="undefined"!=typeof window?window:{},B$=void 0!==Th.__karma__&&!!Th.__karma__||void 0!==Th.jasmine&&!!Th.jasmine||void 0!==Th.jest&&!!Th.jest||void 0!==Th.Mocha&&!!Th.Mocha;let Ob=(()=>{class n{constructor(t,i){this._platform=i,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||B$){const r=this._document.querySelectorAll(`.${t}[platform="server"], .${t}[platform="test"]`);for(let s=0;sthis._backdropClick.next(u),this._keydownEvents=new oe,this._outsidePointerEvents=new oe,r.scrollStrategy&&(this._scrollStrategy=r.scrollStrategy,this._scrollStrategy.attach(this)),this._positionStrategy=r.positionStrategy}get overlayElement(){return this._pane}get backdropElement(){return this._backdropElement}get hostElement(){return this._host}attach(e){let t=this._portalOutlet.attach(e);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(qr(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),t}detach(){if(!this.hasAttached())return;this.detachBackdrop(),this._togglePointerEvents(!1),this._positionStrategy&&this._positionStrategy.detach&&this._positionStrategy.detach(),this._scrollStrategy&&this._scrollStrategy.disable();const e=this._portalOutlet.detach();return this._detachments.next(),this._keyboardDispatcher.remove(this),this._detachContentWhenStable(),this._locationChanges.unsubscribe(),this._outsideClickDispatcher.remove(this),e}dispose(){const e=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,e&&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(e){e!==this._positionStrategy&&(this._positionStrategy&&this._positionStrategy.dispose(),this._positionStrategy=e,this.hasAttached()&&(e.attach(this),this.updatePosition()))}updateSize(e){this._config=Object.assign(Object.assign({},this._config),e),this._updateElementSize()}setDirection(e){this._config=Object.assign(Object.assign({},this._config),{direction:e}),this._updateElementDirection()}addPanelClass(e){this._pane&&this._toggleClasses(this._pane,e,!0)}removePanelClass(e){this._pane&&this._toggleClasses(this._pane,e,!1)}getDirection(){const e=this._config.direction;return e?"string"==typeof e?e:e.value:"ltr"}updateScrollStrategy(e){e!==this._scrollStrategy&&(this._disposeScrollStrategy(),this._scrollStrategy=e,this.hasAttached()&&(e.attach(this),e.enable()))}_updateElementDirection(){this._host.setAttribute("dir",this.getDirection())}_updateElementSize(){if(!this._pane)return;const e=this._pane.style;e.width=bs(this._config.width),e.height=bs(this._config.height),e.minWidth=bs(this._config.minWidth),e.minHeight=bs(this._config.minHeight),e.maxWidth=bs(this._config.maxWidth),e.maxHeight=bs(this._config.maxHeight)}_togglePointerEvents(e){this._pane.style.pointerEvents=e?"":"none"}_attachBackdrop(){const e="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(e)})}):this._backdropElement.classList.add(e)}_updateStackingOrder(){this._host.nextSibling&&this._host.parentNode.appendChild(this._host)}detachBackdrop(){let e=this._backdropElement;if(!e)return;let t,i=()=>{e&&(e.removeEventListener("click",this._backdropClickHandler),e.removeEventListener("transitionend",i),e.parentNode&&e.parentNode.removeChild(e)),this._backdropElement==e&&(this._backdropElement=null),this._config.backdropClass&&this._toggleClasses(e,this._config.backdropClass,!1),clearTimeout(t)};e.classList.remove("cdk-overlay-backdrop-showing"),this._ngZone.runOutsideAngular(()=>{e.addEventListener("transitionend",i)}),e.style.pointerEvents="none",t=this._ngZone.runOutsideAngular(()=>setTimeout(i,500))}_toggleClasses(e,t,i){const r=e.classList;YS(t).forEach(s=>{s&&(i?r.add(s):r.remove(s))})}_detachContentWhenStable(){this._ngZone.runOutsideAngular(()=>{const e=this._ngZone.onStable.pipe(gr(Nn(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)),e.unsubscribe())})})}_disposeScrollStrategy(){const e=this._scrollStrategy;e&&(e.disable(),e.detach&&e.detach())}}const V$="cdk-overlay-connected-position-bounding-box",E1e=/([A-Za-z%]+)$/;class j${constructor(e,t,i,r,s){this._viewportRuler=t,this._document=i,this._platform=r,this._overlayContainer=s,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 oe,this._resizeSubscription=C.EMPTY,this._offsetX=0,this._offsetY=0,this._appliedPanelClasses=[],this.positionChanges=this._positionChanges,this.setOrigin(e)}get positions(){return this._preferredPositions}attach(e){this._validatePositions(),e.hostElement.classList.add(V$),this._overlayRef=e,this._boundingBox=e.hostElement,this._pane=e.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 e=this._originRect,t=this._overlayRect,i=this._viewportRect,r=[];let s;for(let o of this._preferredPositions){let a=this._getOriginPoint(e,o),l=this._getOverlayPoint(a,t,o),c=this._getOverlayFit(l,t,i,o);if(c.isCompletelyWithinViewport)return this._isPushed=!1,void this._applyPosition(o,a);this._canFitWithFlexibleDimensions(c,l,i)?r.push({position:o,origin:a,overlayRect:t,boundingBoxRect:this._calculateBoundingBoxRect(a,o)}):(!s||s.overlayFit.visibleAreaa&&(a=c,o=l)}return this._isPushed=!1,void this._applyPosition(o.position,o.origin)}if(this._canPush)return this._isPushed=!0,void this._applyPosition(s.position,s.originPoint);this._applyPosition(s.position,s.originPoint)}detach(){this._clearPanelClasses(),this._lastPosition=null,this._previousPushAmount=null,this._resizeSubscription.unsubscribe()}dispose(){this._isDisposed||(this._boundingBox&&ip(this._boundingBox.style,{top:"",left:"",right:"",bottom:"",height:"",width:"",alignItems:"",justifyContent:""}),this._pane&&this._resetOverlayElementStyles(),this._overlayRef&&this._overlayRef.hostElement.classList.remove(V$),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 e=this._lastPosition||this._preferredPositions[0],t=this._getOriginPoint(this._originRect,e);this._applyPosition(e,t)}}withScrollableContainers(e){return this._scrollables=e,this}withPositions(e){return this._preferredPositions=e,-1===e.indexOf(this._lastPosition)&&(this._lastPosition=null),this._validatePositions(),this}withViewportMargin(e){return this._viewportMargin=e,this}withFlexibleDimensions(e=!0){return this._hasFlexibleDimensions=e,this}withGrowAfterOpen(e=!0){return this._growAfterOpen=e,this}withPush(e=!0){return this._canPush=e,this}withLockedPosition(e=!0){return this._positionLocked=e,this}setOrigin(e){return this._origin=e,this}withDefaultOffsetX(e){return this._offsetX=e,this}withDefaultOffsetY(e){return this._offsetY=e,this}withTransformOriginOn(e){return this._transformOriginSelector=e,this}_getOriginPoint(e,t){let i,r;if("center"==t.originX)i=e.left+e.width/2;else{const s=this._isRtl()?e.right:e.left,o=this._isRtl()?e.left:e.right;i="start"==t.originX?s:o}return r="center"==t.originY?e.top+e.height/2:"top"==t.originY?e.top:e.bottom,{x:i,y:r}}_getOverlayPoint(e,t,i){let r,s;return r="center"==i.overlayX?-t.width/2:"start"===i.overlayX?this._isRtl()?-t.width:0:this._isRtl()?0:-t.width,s="center"==i.overlayY?-t.height/2:"top"==i.overlayY?0:-t.height,{x:e.x+r,y:e.y+s}}_getOverlayFit(e,t,i,r){const s=z$(t);let{x:o,y:a}=e,l=this._getOffset(r,"x"),c=this._getOffset(r,"y");l&&(o+=l),c&&(a+=c);let f=0-a,g=a+s.height-i.height,m=this._subtractOverflows(s.width,0-o,o+s.width-i.width),v=this._subtractOverflows(s.height,f,g),x=m*v;return{visibleArea:x,isCompletelyWithinViewport:s.width*s.height===x,fitsInViewportVertically:v===s.height,fitsInViewportHorizontally:m==s.width}}_canFitWithFlexibleDimensions(e,t,i){if(this._hasFlexibleDimensions){const r=i.bottom-t.y,s=i.right-t.x,o=U$(this._overlayRef.getConfig().minHeight),a=U$(this._overlayRef.getConfig().minWidth),c=e.fitsInViewportHorizontally||null!=a&&a<=s;return(e.fitsInViewportVertically||null!=o&&o<=r)&&c}return!1}_pushOverlayOnScreen(e,t,i){if(this._previousPushAmount&&this._positionLocked)return{x:e.x+this._previousPushAmount.x,y:e.y+this._previousPushAmount.y};const r=z$(t),s=this._viewportRect,o=Math.max(e.x+r.width-s.width,0),a=Math.max(e.y+r.height-s.height,0),l=Math.max(s.top-i.top-e.y,0),c=Math.max(s.left-i.left-e.x,0);let u=0,h=0;return u=r.width<=s.width?c||-o:e.xm&&!this._isInitialRender&&!this._growAfterOpen&&(o=e.y-m/2)}if("end"===t.overlayX&&!r||"start"===t.overlayX&&r)f=i.width-e.x+this._viewportMargin,u=e.x-this._viewportMargin;else if("start"===t.overlayX&&!r||"end"===t.overlayX&&r)h=e.x,u=i.right-e.x;else{const g=Math.min(i.right-e.x+i.left,e.x),m=this._lastBoundingBoxSize.width;u=2*g,h=e.x-g,u>m&&!this._isInitialRender&&!this._growAfterOpen&&(h=e.x-m/2)}return{top:o,left:h,bottom:a,right:f,width:u,height:s}}_setBoundingBoxStyles(e,t){const i=this._calculateBoundingBoxRect(e,t);!this._isInitialRender&&!this._growAfterOpen&&(i.height=Math.min(i.height,this._lastBoundingBoxSize.height),i.width=Math.min(i.width,this._lastBoundingBoxSize.width));const r={};if(this._hasExactPosition())r.top=r.left="0",r.bottom=r.right=r.maxHeight=r.maxWidth="",r.width=r.height="100%";else{const s=this._overlayRef.getConfig().maxHeight,o=this._overlayRef.getConfig().maxWidth;r.height=bs(i.height),r.top=bs(i.top),r.bottom=bs(i.bottom),r.width=bs(i.width),r.left=bs(i.left),r.right=bs(i.right),r.alignItems="center"===t.overlayX?"center":"end"===t.overlayX?"flex-end":"flex-start",r.justifyContent="center"===t.overlayY?"center":"bottom"===t.overlayY?"flex-end":"flex-start",s&&(r.maxHeight=bs(s)),o&&(r.maxWidth=bs(o))}this._lastBoundingBoxSize=i,ip(this._boundingBox.style,r)}_resetBoundingBoxStyles(){ip(this._boundingBox.style,{top:"0",left:"0",right:"0",bottom:"0",height:"",width:"",alignItems:"",justifyContent:""})}_resetOverlayElementStyles(){ip(this._pane.style,{top:"",left:"",bottom:"",right:"",position:"",transform:""})}_setOverlayElementStyles(e,t){const i={},r=this._hasExactPosition(),s=this._hasFlexibleDimensions,o=this._overlayRef.getConfig();if(r){const u=this._viewportRuler.getViewportScrollPosition();ip(i,this._getExactOverlayY(t,e,u)),ip(i,this._getExactOverlayX(t,e,u))}else i.position="static";let a="",l=this._getOffset(t,"x"),c=this._getOffset(t,"y");l&&(a+=`translateX(${l}px) `),c&&(a+=`translateY(${c}px)`),i.transform=a.trim(),o.maxHeight&&(r?i.maxHeight=bs(o.maxHeight):s&&(i.maxHeight="")),o.maxWidth&&(r?i.maxWidth=bs(o.maxWidth):s&&(i.maxWidth="")),ip(this._pane.style,i)}_getExactOverlayY(e,t,i){let r={top:"",bottom:""},s=this._getOverlayPoint(t,this._overlayRect,e);this._isPushed&&(s=this._pushOverlayOnScreen(s,this._overlayRect,i));let o=this._overlayContainer.getContainerElement().getBoundingClientRect().top;return s.y-=o,"bottom"===e.overlayY?r.bottom=this._document.documentElement.clientHeight-(s.y+this._overlayRect.height)+"px":r.top=bs(s.y),r}_getExactOverlayX(e,t,i){let o,r={left:"",right:""},s=this._getOverlayPoint(t,this._overlayRect,e);return this._isPushed&&(s=this._pushOverlayOnScreen(s,this._overlayRect,i)),o=this._isRtl()?"end"===e.overlayX?"left":"right":"end"===e.overlayX?"right":"left","right"===o?r.right=this._document.documentElement.clientWidth-(s.x+this._overlayRect.width)+"px":r.left=bs(s.x),r}_getScrollVisibility(){const e=this._getOriginRect(),t=this._pane.getBoundingClientRect(),i=this._scrollables.map(r=>r.getElementRef().nativeElement.getBoundingClientRect());return{isOriginClipped:F$(e,i),isOriginOutsideView:DN(e,i),isOverlayClipped:F$(t,i),isOverlayOutsideView:DN(t,i)}}_subtractOverflows(e,...t){return t.reduce((i,r)=>i-Math.max(r,0),e)}_getNarrowedViewportRect(){const e=this._document.documentElement.clientWidth,t=this._document.documentElement.clientHeight,i=this._viewportRuler.getViewportScrollPosition();return{top:i.top+this._viewportMargin,left:i.left+this._viewportMargin,right:i.left+e-this._viewportMargin,bottom:i.top+t-this._viewportMargin,width:e-2*this._viewportMargin,height:t-2*this._viewportMargin}}_isRtl(){return"rtl"===this._overlayRef.getDirection()}_hasExactPosition(){return!this._hasFlexibleDimensions||this._isPushed}_getOffset(e,t){return"x"===t?null==e.offsetX?this._offsetX:e.offsetX:null==e.offsetY?this._offsetY:e.offsetY}_validatePositions(){}_addPanelClasses(e){this._pane&&YS(e).forEach(t=>{""!==t&&-1===this._appliedPanelClasses.indexOf(t)&&(this._appliedPanelClasses.push(t),this._pane.classList.add(t))})}_clearPanelClasses(){this._pane&&(this._appliedPanelClasses.forEach(e=>{this._pane.classList.remove(e)}),this._appliedPanelClasses=[])}_getOriginRect(){const e=this._origin;if(e instanceof gn)return e.nativeElement.getBoundingClientRect();if(e instanceof Element)return e.getBoundingClientRect();const t=e.width||0,i=e.height||0;return{top:e.y,bottom:e.y+i,left:e.x,right:e.x+t,height:i,width:t}}}function ip(n,e){for(let t in e)e.hasOwnProperty(t)&&(n[t]=e[t]);return n}function U$(n){if("number"!=typeof n&&null!=n){const[e,t]=n.split(E1e);return t&&"px"!==t?null:parseFloat(e)}return n||null}function z$(n){return{top:Math.floor(n.top),right:Math.floor(n.right),bottom:Math.floor(n.bottom),left:Math.floor(n.left),width:Math.floor(n.width),height:Math.floor(n.height)}}class x1e{constructor(e,t,i,r,s,o,a){this._preferredPositions=[],this._positionStrategy=new j$(i,r,s,o,a).withFlexibleDimensions(!1).withPush(!1).withViewportMargin(0),this.withFallbackPosition(e,t),this.onPositionChange=this._positionStrategy.positionChanges}get positions(){return this._preferredPositions}attach(e){this._overlayRef=e,this._positionStrategy.attach(e),this._direction&&(e.setDirection(this._direction),this._direction=null)}dispose(){this._positionStrategy.dispose()}detach(){this._positionStrategy.detach()}apply(){this._positionStrategy.apply()}recalculateLastPosition(){this._positionStrategy.reapplyLastPosition()}withScrollableContainers(e){this._positionStrategy.withScrollableContainers(e)}withFallbackPosition(e,t,i,r){const s=new _1e(e,t,i,r);return this._preferredPositions.push(s),this._positionStrategy.withPositions(this._preferredPositions),this}withDirection(e){return this._overlayRef?this._overlayRef.setDirection(e):this._direction=e,this}withOffsetX(e){return this._positionStrategy.withDefaultOffsetX(e),this}withOffsetY(e){return this._positionStrategy.withDefaultOffsetY(e),this}withLockedPosition(e){return this._positionStrategy.withLockedPosition(e),this}withPositions(e){return this._preferredPositions=e.slice(),this._positionStrategy.withPositions(this._preferredPositions),this}setOrigin(e){return this._positionStrategy.setOrigin(e),this}}const H$="cdk-global-overlay-wrapper";class S1e{constructor(){this._cssPosition="static",this._topOffset="",this._bottomOffset="",this._leftOffset="",this._rightOffset="",this._alignItems="",this._justifyContent="",this._width="",this._height=""}attach(e){const t=e.getConfig();this._overlayRef=e,this._width&&!t.width&&e.updateSize({width:this._width}),this._height&&!t.height&&e.updateSize({height:this._height}),e.hostElement.classList.add(H$),this._isDisposed=!1}top(e=""){return this._bottomOffset="",this._topOffset=e,this._alignItems="flex-start",this}left(e=""){return this._rightOffset="",this._leftOffset=e,this._justifyContent="flex-start",this}bottom(e=""){return this._topOffset="",this._bottomOffset=e,this._alignItems="flex-end",this}right(e=""){return this._leftOffset="",this._rightOffset=e,this._justifyContent="flex-end",this}width(e=""){return this._overlayRef?this._overlayRef.updateSize({width:e}):this._width=e,this}height(e=""){return this._overlayRef?this._overlayRef.updateSize({height:e}):this._height=e,this}centerHorizontally(e=""){return this.left(e),this._justifyContent="center",this}centerVertically(e=""){return this.top(e),this._alignItems="center",this}apply(){if(!this._overlayRef||!this._overlayRef.hasAttached())return;const e=this._overlayRef.overlayElement.style,t=this._overlayRef.hostElement.style,i=this._overlayRef.getConfig(),{width:r,height:s,maxWidth:o,maxHeight:a}=i,l=!("100%"!==r&&"100vw"!==r||o&&"100%"!==o&&"100vw"!==o),c=!("100%"!==s&&"100vh"!==s||a&&"100%"!==a&&"100vh"!==a);e.position=this._cssPosition,e.marginLeft=l?"0":this._leftOffset,e.marginTop=c?"0":this._topOffset,e.marginBottom=this._bottomOffset,e.marginRight=this._rightOffset,l?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=c?"flex-start":this._alignItems}dispose(){if(this._isDisposed||!this._overlayRef)return;const e=this._overlayRef.overlayElement.style,t=this._overlayRef.hostElement,i=t.style;t.classList.remove(H$),i.justifyContent=i.alignItems=e.marginTop=e.marginBottom=e.marginLeft=e.marginRight=e.position="",this._overlayRef=null,this._isDisposed=!0}}let C1e=(()=>{class n{constructor(t,i,r,s){this._viewportRuler=t,this._document=i,this._platform=r,this._overlayContainer=s}global(){return new S1e}connectedTo(t,i,r){return new x1e(i,r,t,this._viewportRuler,this._document,this._platform,this._overlayContainer)}flexibleConnectedTo(t){return new j$(t,this._viewportRuler,this._document,this._platform,this._overlayContainer)}}return n.\u0275fac=function(t){return new(t||n)(Ie(Rm),Ie(fn),Ie(Qi),Ie(Ob))},n.\u0275prov=We({factory:function(){return new n(Ie(Rm),Ie(fn),Ie(Qi),Ie(Ob))},token:n,providedIn:"root"}),n})(),T1e=0,Ec=(()=>{class n{constructor(t,i,r,s,o,a,l,c,u,h,f){this.scrollStrategies=t,this._overlayContainer=i,this._componentFactoryResolver=r,this._positionBuilder=s,this._keyboardDispatcher=o,this._injector=a,this._ngZone=l,this._document=c,this._directionality=u,this._location=h,this._outsideClickDispatcher=f}create(t){const i=this._createHostElement(),r=this._createPaneElement(i),s=this._createPortalOutlet(r),o=new IC(t);return o.direction=o.direction||this._directionality.value,new w1e(s,i,r,o,this._ngZone,this._keyboardDispatcher,this._document,this._location,this._outsideClickDispatcher)}position(){return this._positionBuilder}_createPaneElement(t){const i=this._document.createElement("div");return i.id="cdk-overlay-"+T1e++,i.classList.add("cdk-overlay-pane"),t.appendChild(i),i}_createHostElement(){const t=this._document.createElement("div");return this._overlayContainer.getContainerElement().appendChild(t),t}_createPortalOutlet(t){return this._appRef||(this._appRef=this._injector.get(sh)),new c1e(t,this._componentFactoryResolver,this._appRef,this._injector,this._document)}}return n.\u0275fac=function(t){return new(t||n)(Ie(m1e),Ie(Ob),Ie(El),Ie(C1e),Ie(b1e),Ie(Hn),Ie(pn),Ie(fn),Ie(Il),Ie(kg),Ie(v1e))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();class rTe{constructor(e,t){this.delay=e,this.scheduler=t}call(e,t){return t.subscribe(new PN(e,this.delay,this.scheduler))}}class PN extends y{constructor(e,t,i){super(e),this.delay=t,this.scheduler=i,this.queue=[],this.active=!1,this.errored=!1}static dispatch(e){const t=e.source,i=t.queue,r=e.scheduler,s=e.destination;for(;i.length>0&&i[0].time-r.now()<=0;)i.shift().notification.observe(s);if(i.length>0){const o=Math.max(0,i[0].time-r.now());this.schedule(e,o)}else this.unsubscribe(),t.active=!1}_schedule(e){this.active=!0,this.destination.add(e.schedule(PN.dispatch,this.delay,{source:this,destination:this.destination,scheduler:e}))}scheduleNotification(e){if(!0===this.errored)return;const t=this.scheduler,i=new sTe(t.now()+this.delay,e);this.queue.push(i),!1===this.active&&this._schedule(t)}_next(e){this.scheduleNotification(ga.createNext(e))}_error(e){this.errored=!0,this.queue=[],this.destination.error(e),this.unsubscribe()}_complete(){this.scheduleNotification(ga.createComplete()),this.unsubscribe()}}class sTe{constructor(e,t){this.time=e,this.notification=t}}function oW(...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;se.lift(new WTe(n))}et(7266);class WTe{constructor(e){this.callback=e}call(e,t){return t.subscribe(new qTe(e,this.callback))}}class qTe extends y{constructor(e,t){super(e),this.add(new C(t))}}class fW{}class pW{}class mu{constructor(e){this.normalizedNames=new Map,this.lazyUpdate=null,e?this.lazyInit="string"==typeof e?()=>{this.headers=new Map,e.split("\n").forEach(t=>{const i=t.indexOf(":");if(i>0){const r=t.slice(0,i),s=r.toLowerCase(),o=t.slice(i+1).trim();this.maybeSetNormalizedName(r,s),this.headers.has(s)?this.headers.get(s).push(o):this.headers.set(s,[o])}})}:()=>{this.headers=new Map,Object.keys(e).forEach(t=>{let i=e[t];const r=t.toLowerCase();"string"==typeof i&&(i=[i]),i.length>0&&(this.headers.set(r,i),this.maybeSetNormalizedName(t,r))})}:this.headers=new Map}has(e){return this.init(),this.headers.has(e.toLowerCase())}get(e){this.init();const t=this.headers.get(e.toLowerCase());return t&&t.length>0?t[0]:null}keys(){return this.init(),Array.from(this.normalizedNames.values())}getAll(e){return this.init(),this.headers.get(e.toLowerCase())||null}append(e,t){return this.clone({name:e,value:t,op:"a"})}set(e,t){return this.clone({name:e,value:t,op:"s"})}delete(e,t){return this.clone({name:e,value:t,op:"d"})}maybeSetNormalizedName(e,t){this.normalizedNames.has(t)||this.normalizedNames.set(t,e)}init(){this.lazyInit&&(this.lazyInit instanceof mu?this.copyFrom(this.lazyInit):this.lazyInit(),this.lazyInit=null,this.lazyUpdate&&(this.lazyUpdate.forEach(e=>this.applyUpdate(e)),this.lazyUpdate=null))}copyFrom(e){e.init(),Array.from(e.headers.keys()).forEach(t=>{this.headers.set(t,e.headers.get(t)),this.normalizedNames.set(t,e.normalizedNames.get(t))})}clone(e){const t=new mu;return t.lazyInit=this.lazyInit&&this.lazyInit instanceof mu?this.lazyInit:this,t.lazyUpdate=(this.lazyUpdate||[]).concat([e]),t}applyUpdate(e){const t=e.name.toLowerCase();switch(e.op){case"a":case"s":let i=e.value;if("string"==typeof i&&(i=[i]),0===i.length)return;this.maybeSetNormalizedName(e.name,t);const r=("a"===e.op?this.headers.get(t):void 0)||[];r.push(...i),this.headers.set(t,r);break;case"d":const s=e.value;if(s){let o=this.headers.get(t);if(!o)return;o=o.filter(a=>-1===s.indexOf(a)),0===o.length?(this.headers.delete(t),this.normalizedNames.delete(t)):this.headers.set(t,o)}else this.headers.delete(t),this.normalizedNames.delete(t)}}forEach(e){this.init(),Array.from(this.normalizedNames.keys()).forEach(t=>e(this.normalizedNames.get(t),this.headers.get(t)))}}class YTe{encodeKey(e){return gW(e)}encodeValue(e){return gW(e)}decodeKey(e){return decodeURIComponent(e)}decodeValue(e){return decodeURIComponent(e)}}const KTe=/%(\d[a-f0-9])/gi,QTe={40:"@","3A":":",24:"$","2C":",","3B":";","2B":"+","3D":"=","3F":"?","2F":"/"};function gW(n){return encodeURIComponent(n).replace(KTe,(e,t)=>{var i;return null!==(i=QTe[t])&&void 0!==i?i:e})}function mW(n){return`${n}`}class Lr{constructor(e={}){if(this.updates=null,this.cloneFrom=null,this.encoder=e.encoder||new YTe,e.fromString){if(e.fromObject)throw new Error("Cannot specify both fromString and fromObject.");this.map=function(n,e){const t=new Map;return n.length>0&&n.replace(/^\?/,"").split("&").forEach(r=>{const s=r.indexOf("="),[o,a]=-1==s?[e.decodeKey(r),""]:[e.decodeKey(r.slice(0,s)),e.decodeValue(r.slice(s+1))],l=t.get(o)||[];l.push(a),t.set(o,l)}),t}(e.fromString,this.encoder)}else e.fromObject?(this.map=new Map,Object.keys(e.fromObject).forEach(t=>{const i=e.fromObject[t];this.map.set(t,Array.isArray(i)?i:[i])})):this.map=null}has(e){return this.init(),this.map.has(e)}get(e){this.init();const t=this.map.get(e);return t?t[0]:null}getAll(e){return this.init(),this.map.get(e)||null}keys(){return this.init(),Array.from(this.map.keys())}append(e,t){return this.clone({param:e,value:t,op:"a"})}appendAll(e){const t=[];return Object.keys(e).forEach(i=>{const r=e[i];Array.isArray(r)?r.forEach(s=>{t.push({param:i,value:s,op:"a"})}):t.push({param:i,value:r,op:"a"})}),this.clone(t)}set(e,t){return this.clone({param:e,value:t,op:"s"})}delete(e,t){return this.clone({param:e,value:t,op:"d"})}toString(){return this.init(),this.keys().map(e=>{const t=this.encoder.encodeKey(e);return this.map.get(e).map(i=>t+"="+this.encoder.encodeValue(i)).join("&")}).filter(e=>""!==e).join("&")}clone(e){const t=new Lr({encoder:this.encoder});return t.cloneFrom=this.cloneFrom||this,t.updates=(this.updates||[]).concat(e),t}init(){null===this.map&&(this.map=new Map),null!==this.cloneFrom&&(this.cloneFrom.init(),this.cloneFrom.keys().forEach(e=>this.map.set(e,this.cloneFrom.map.get(e))),this.updates.forEach(e=>{switch(e.op){case"a":case"s":const t=("a"===e.op?this.map.get(e.param):void 0)||[];t.push(mW(e.value)),this.map.set(e.param,t);break;case"d":if(void 0===e.value){this.map.delete(e.param);break}{let i=this.map.get(e.param)||[];const r=i.indexOf(mW(e.value));-1!==r&&i.splice(r,1),i.length>0?this.map.set(e.param,i):this.map.delete(e.param)}}}),this.cloneFrom=this.updates=null)}}class Zs{constructor(){this.map=new Map}set(e,t){return this.map.set(e,t),this}get(e){return this.map.has(e)||this.map.set(e,e.defaultValue()),this.map.get(e)}delete(e){return this.map.delete(e),this}keys(){return this.map.keys()}}function _W(n){return"undefined"!=typeof ArrayBuffer&&n instanceof ArrayBuffer}function yW(n){return"undefined"!=typeof Blob&&n instanceof Blob}function bW(n){return"undefined"!=typeof FormData&&n instanceof FormData}class Rb{constructor(e,t,i,r){let s;if(this.url=t,this.body=null,this.reportProgress=!1,this.withCredentials=!1,this.responseType="json",this.method=e.toUpperCase(),function(n){switch(n){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,s=r):s=i,s&&(this.reportProgress=!!s.reportProgress,this.withCredentials=!!s.withCredentials,s.responseType&&(this.responseType=s.responseType),s.headers&&(this.headers=s.headers),s.context&&(this.context=s.context),s.params&&(this.params=s.params)),this.headers||(this.headers=new mu),this.context||(this.context=new Zs),this.params){const o=this.params.toString();if(0===o.length)this.urlWithParams=t;else{const a=t.indexOf("?");this.urlWithParams=t+(-1===a?"?":af.set(g,e.setHeaders[g]),c)),e.setParams&&(u=Object.keys(e.setParams).reduce((f,g)=>f.set(g,e.setParams[g]),u)),new Rb(i,r,o,{params:u,headers:c,context:h,reportProgress:l,responseType:s,withCredentials:a})}}var vs=(()=>((vs=vs||{})[vs.Sent=0]="Sent",vs[vs.UploadProgress=1]="UploadProgress",vs[vs.ResponseHeader=2]="ResponseHeader",vs[vs.DownloadProgress=3]="DownloadProgress",vs[vs.Response=4]="Response",vs[vs.User=5]="User",vs))();class kN{constructor(e,t=200,i="OK"){this.headers=e.headers||new mu,this.status=void 0!==e.status?e.status:t,this.statusText=e.statusText||i,this.url=e.url||null,this.ok=this.status>=200&&this.status<300}}class FN extends kN{constructor(e={}){super(e),this.type=vs.ResponseHeader}clone(e={}){return new FN({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})}}class RC extends kN{constructor(e={}){super(e),this.type=vs.Response,this.body=void 0!==e.body?e.body:null}clone(e={}){return new RC({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})}}class vW extends kN{constructor(e){super(e,0,"Unknown Error"),this.name="HttpErrorResponse",this.ok=!1,this.message=this.status>=200&&this.status<300?`Http failure during parsing for ${e.url||"(unknown url)"}`:`Http failure response for ${e.url||"(unknown url)"}: ${e.status} ${e.statusText}`,this.error=e.error||null}}function LN(n,e){return{body:e,headers:n.headers,context:n.context,observe:n.observe,params:n.params,reportProgress:n.reportProgress,responseType:n.responseType,withCredentials:n.withCredentials}}let _u=(()=>{class n{constructor(t){this.handler=t}request(t,i,r={}){let s;if(t instanceof Rb)s=t;else{let l,c;l=r.headers instanceof mu?r.headers:new mu(r.headers),r.params&&(c=r.params instanceof Lr?r.params:new Lr({fromObject:r.params})),s=new Rb(t,i,void 0!==r.body?r.body:null,{headers:l,context:r.context,params:c,reportProgress:r.reportProgress,responseType:r.responseType||"json",withCredentials:r.withCredentials})}const o=sn(s).pipe(function(n,e){return V(n,e,1)}(l=>this.handler.handle(l)));if(t instanceof Rb||"events"===r.observe)return o;const a=o.pipe(Ki(l=>l instanceof RC));switch(r.observe||"body"){case"body":switch(s.responseType){case"arraybuffer":return a.pipe(me(l=>{if(null!==l.body&&!(l.body instanceof ArrayBuffer))throw new Error("Response is not an ArrayBuffer.");return l.body}));case"blob":return a.pipe(me(l=>{if(null!==l.body&&!(l.body instanceof Blob))throw new Error("Response is not a Blob.");return l.body}));case"text":return a.pipe(me(l=>{if(null!==l.body&&"string"!=typeof l.body)throw new Error("Response is not a string.");return l.body}));case"json":default:return a.pipe(me(l=>l.body))}case"response":return a;default:throw new Error(`Unreachable: unhandled observe type ${r.observe}}`)}}delete(t,i={}){return this.request("DELETE",t,i)}get(t,i={}){return this.request("GET",t,i)}head(t,i={}){return this.request("HEAD",t,i)}jsonp(t,i){return this.request("JSONP",t,{params:(new Lr).append(i,"JSONP_CALLBACK"),observe:"body",responseType:"json"})}options(t,i={}){return this.request("OPTIONS",t,i)}patch(t,i,r={}){return this.request("PATCH",t,LN(r,i))}post(t,i,r={}){return this.request("POST",t,LN(r,i))}put(t,i,r={}){return this.request("PUT",t,LN(r,i))}}return n.\u0275fac=function(t){return new(t||n)(Ie(fW))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();class wW{constructor(e,t){this.next=e,this.interceptor=t}handle(e){return this.interceptor.intercept(e,this.next)}}const EW=new Ht("HTTP_INTERCEPTORS");let eAe=(()=>{class n{intercept(t,i){return i.handle(t)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const tAe=/^\)\]\}',?\n/;let xW=(()=>{class n{constructor(t){this.xhrFactory=t}handle(t){if("JSONP"===t.method)throw new Error("Attempted to construct Jsonp request without HttpClientJsonpModule installed.");return new O(i=>{const r=this.xhrFactory.build();if(r.open(t.method,t.urlWithParams),t.withCredentials&&(r.withCredentials=!0),t.headers.forEach((g,m)=>r.setRequestHeader(g,m.join(","))),t.headers.has("Accept")||r.setRequestHeader("Accept","application/json, text/plain, */*"),!t.headers.has("Content-Type")){const g=t.detectContentTypeHeader();null!==g&&r.setRequestHeader("Content-Type",g)}if(t.responseType){const g=t.responseType.toLowerCase();r.responseType="json"!==g?g:"text"}const s=t.serializeBody();let o=null;const a=()=>{if(null!==o)return o;const g=1223===r.status?204:r.status,m=r.statusText||"OK",v=new mu(r.getAllResponseHeaders()),x=function(n){return"responseURL"in n&&n.responseURL?n.responseURL:/^X-Request-URL:/m.test(n.getAllResponseHeaders())?n.getResponseHeader("X-Request-URL"):null}(r)||t.url;return o=new FN({headers:v,status:g,statusText:m,url:x}),o},l=()=>{let{headers:g,status:m,statusText:v,url:x}=a(),U=null;204!==m&&(U=void 0===r.response?r.responseText:r.response),0===m&&(m=U?200:0);let D=m>=200&&m<300;if("json"===t.responseType&&"string"==typeof U){const ie=U;U=U.replace(tAe,"");try{U=""!==U?JSON.parse(U):null}catch(_e){U=ie,D&&(D=!1,U={error:_e,text:U})}}D?(i.next(new RC({body:U,headers:g,status:m,statusText:v,url:x||void 0})),i.complete()):i.error(new vW({error:U,headers:g,status:m,statusText:v,url:x||void 0}))},c=g=>{const{url:m}=a(),v=new vW({error:g,status:r.status||0,statusText:r.statusText||"Unknown Error",url:m||void 0});i.error(v)};let u=!1;const h=g=>{u||(i.next(a()),u=!0);let m={type:vs.DownloadProgress,loaded:g.loaded};g.lengthComputable&&(m.total=g.total),"text"===t.responseType&&!!r.responseText&&(m.partialText=r.responseText),i.next(m)},f=g=>{let m={type:vs.UploadProgress,loaded:g.loaded};g.lengthComputable&&(m.total=g.total),i.next(m)};return r.addEventListener("load",l),r.addEventListener("error",c),r.addEventListener("timeout",c),r.addEventListener("abort",c),t.reportProgress&&(r.addEventListener("progress",h),null!==s&&r.upload&&r.upload.addEventListener("progress",f)),r.send(s),i.next({type:vs.Sent}),()=>{r.removeEventListener("error",c),r.removeEventListener("abort",c),r.removeEventListener("load",l),r.removeEventListener("timeout",c),t.reportProgress&&(r.removeEventListener("progress",h),null!==s&&r.upload&&r.upload.removeEventListener("progress",f)),r.readyState!==r.DONE&&r.abort()}})}}return n.\u0275fac=function(t){return new(t||n)(Ie(oV))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const BN=new Ht("XSRF_COOKIE_NAME"),VN=new Ht("XSRF_HEADER_NAME");class SW{}let iAe=(()=>{class n{constructor(t,i,r){this.doc=t,this.platform=i,this.cookieName=r,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=YB(t,this.cookieName),this.lastCookieString=t),this.lastToken}}return n.\u0275fac=function(t){return new(t||n)(Ie(fn),Ie(Xc),Ie(BN))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),jN=(()=>{class n{constructor(t,i){this.tokenService=t,this.headerName=i}intercept(t,i){const r=t.url.toLowerCase();if("GET"===t.method||"HEAD"===t.method||r.startsWith("http://")||r.startsWith("https://"))return i.handle(t);const s=this.tokenService.getToken();return null!==s&&!t.headers.has(this.headerName)&&(t=t.clone({headers:t.headers.set(this.headerName,s)})),i.handle(t)}}return n.\u0275fac=function(t){return new(t||n)(Ie(SW),Ie(VN))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),rAe=(()=>{class n{constructor(t,i){this.backend=t,this.injector=i,this.chain=null}handle(t){if(null===this.chain){const i=this.injector.get(EW,[]);this.chain=i.reduceRight((r,s)=>new wW(r,s),this.backend)}return this.chain.handle(t)}}return n.\u0275fac=function(t){return new(t||n)(Ie(pW),Ie(Hn))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),sAe=(()=>{class n{static disable(){return{ngModule:n,providers:[{provide:jN,useClass:eAe}]}}static withOptions(t={}){return{ngModule:n,providers:[t.cookieName?{provide:BN,useValue:t.cookieName}:[],t.headerName?{provide:VN,useValue:t.headerName}:[]]}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=tn({type:n}),n.\u0275inj=St({providers:[jN,{provide:EW,useExisting:jN,multi:!0},{provide:SW,useClass:iAe},{provide:BN,useValue:"XSRF-TOKEN"},{provide:VN,useValue:"X-XSRF-TOKEN"}]}),n})(),CW=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=tn({type:n}),n.\u0275inj=St({providers:[_u,{provide:fW,useClass:rAe},xW,{provide:pW,useExisting:xW}],imports:[[sAe.withOptions({cookieName:"XSRF-TOKEN",headerName:"X-XSRF-TOKEN"})]]}),n})();const oAe=["*"];function TW(n){return Error(`Unable to find icon with the name "${n}"`)}function AW(n){return Error(`The URL provided to MatIconRegistry was not trusted as a resource URL via Angular's DomSanitizer. Attempted URL was "${n}".`)}function MW(n){return Error(`The literal provided to MatIconRegistry was not trusted as safe HTML by Angular's DomSanitizer. Attempted literal was "${n}".`)}class rp{constructor(e,t,i){this.url=e,this.svgText=t,this.options=i}}let PC=(()=>{class n{constructor(t,i,r,s){this._httpClient=t,this._sanitizer=i,this._errorHandler=s,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=r}addSvgIcon(t,i,r){return this.addSvgIconInNamespace("",t,i,r)}addSvgIconLiteral(t,i,r){return this.addSvgIconLiteralInNamespace("",t,i,r)}addSvgIconInNamespace(t,i,r,s){return this._addSvgIconConfig(t,i,new rp(r,null,s))}addSvgIconResolver(t){return this._resolvers.push(t),this}addSvgIconLiteralInNamespace(t,i,r,s){const o=this._sanitizer.sanitize(si.HTML,r);if(!o)throw MW(r);return this._addSvgIconConfig(t,i,new rp("",o,s))}addSvgIconSet(t,i){return this.addSvgIconSetInNamespace("",t,i)}addSvgIconSetLiteral(t,i){return this.addSvgIconSetLiteralInNamespace("",t,i)}addSvgIconSetInNamespace(t,i,r){return this._addSvgIconSetConfig(t,new rp(i,null,r))}addSvgIconSetLiteralInNamespace(t,i,r){const s=this._sanitizer.sanitize(si.HTML,i);if(!s)throw MW(i);return this._addSvgIconSetConfig(t,new rp("",s,r))}registerFontClassAlias(t,i=t){return this._fontCssClassesByAlias.set(t,i),this}classNameForFontAlias(t){return this._fontCssClassesByAlias.get(t)||t}setDefaultFontSetClass(t){return this._defaultFontSetClass=t,this}getDefaultFontSetClass(){return this._defaultFontSetClass}getSvgIconFromUrl(t){const i=this._sanitizer.sanitize(si.RESOURCE_URL,t);if(!i)throw AW(t);const r=this._cachedIconsByUrl.get(i);return r?sn(NC(r)):this._loadSvgIconFromConfig(new rp(t,null)).pipe(cr(s=>this._cachedIconsByUrl.set(i,s)),me(s=>NC(s)))}getNamedSvgIcon(t,i=""){const r=DW(i,t);let s=this._svgIconConfigs.get(r);if(s)return this._getSvgFromConfig(s);if(s=this._getIconConfigFromResolvers(i,t),s)return this._svgIconConfigs.set(r,s),this._getSvgFromConfig(s);const o=this._iconSetConfigs.get(i);return o?this._getSvgFromIconSetConfigs(t,o):Fg(TW(r))}ngOnDestroy(){this._resolvers=[],this._svgIconConfigs.clear(),this._iconSetConfigs.clear(),this._cachedIconsByUrl.clear()}_getSvgFromConfig(t){return t.svgText?sn(NC(this._svgElementFromConfig(t))):this._loadSvgIconFromConfig(t).pipe(me(i=>NC(i)))}_getSvgFromIconSetConfigs(t,i){const r=this._extractIconWithNameFromAnySet(t,i);return r?sn(r):fb(i.filter(o=>!o.svgText).map(o=>this._loadSvgIconSetFromConfig(o).pipe(bc(a=>{const c=`Loading icon set URL: ${this._sanitizer.sanitize(si.RESOURCE_URL,o.url)} failed: ${a.message}`;return this._errorHandler.handleError(new Error(c)),sn(null)})))).pipe(me(()=>{const o=this._extractIconWithNameFromAnySet(t,i);if(!o)throw TW(t);return o}))}_extractIconWithNameFromAnySet(t,i){for(let r=i.length-1;r>=0;r--){const s=i[r];if(s.svgText&&s.svgText.indexOf(t)>-1){const o=this._svgElementFromConfig(s),a=this._extractSvgIconFromSet(o,t,s.options);if(a)return a}}return null}_loadSvgIconFromConfig(t){return this._fetchIcon(t).pipe(cr(i=>t.svgText=i),me(()=>this._svgElementFromConfig(t)))}_loadSvgIconSetFromConfig(t){return t.svgText?sn(null):this._fetchIcon(t).pipe(cr(i=>t.svgText=i))}_extractSvgIconFromSet(t,i,r){const s=t.querySelector(`[id="${i}"]`);if(!s)return null;const o=s.cloneNode(!0);if(o.removeAttribute("id"),"svg"===o.nodeName.toLowerCase())return this._setSvgAttributes(o,r);if("symbol"===o.nodeName.toLowerCase())return this._setSvgAttributes(this._toSvgElement(o),r);const a=this._svgElementFromString("");return a.appendChild(o),this._setSvgAttributes(a,r)}_svgElementFromString(t){const i=this._document.createElement("DIV");i.innerHTML=t;const r=i.querySelector("svg");if(!r)throw Error(" tag not found");return r}_toSvgElement(t){const i=this._svgElementFromString(""),r=t.attributes;for(let s=0;sthis._inProgressUrlFetches.delete(a)),ws());return this._inProgressUrlFetches.set(a,c),c}_addSvgIconConfig(t,i,r){return this._svgIconConfigs.set(DW(t,i),r),this}_addSvgIconSetConfig(t,i){const r=this._iconSetConfigs.get(t);return r?r.push(i):this._iconSetConfigs.set(t,[i]),this}_svgElementFromConfig(t){if(!t.svgElement){const i=this._svgElementFromString(t.svgText);this._setSvgAttributes(i,t.options),t.svgElement=i}return t.svgElement}_getIconConfigFromResolvers(t,i){for(let r=0;re?e.pathname+e.search:""}}}),IW=["clip-path","color-profile","src","cursor","fill","filter","marker","marker-start","marker-mid","marker-end","mask","stroke"],pAe=IW.map(n=>`[${n}]`).join(", "),gAe=/^url\(['"]?#(.*?)['"]?\)$/;let Fm=(()=>{class n extends uAe{constructor(t,i,r,s,o){super(t),this._iconRegistry=i,this._location=s,this._errorHandler=o,this._inline=!1,this._currentIconFetch=C.EMPTY,r||t.nativeElement.setAttribute("aria-hidden","true")}get inline(){return this._inline}set inline(t){this._inline=bi(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 i=this._cleanupFontValue(t);i!==this._fontSet&&(this._fontSet=i,this._updateFontIconClasses())}get fontIcon(){return this._fontIcon}set fontIcon(t){const i=this._cleanupFontValue(t);i!==this._fontIcon&&(this._fontIcon=i,this._updateFontIconClasses())}_splitIconName(t){if(!t)return["",""];const i=t.split(":");switch(i.length){case 1:return["",i[0]];case 2:return i;default:throw Error(`Invalid icon name: "${t}"`)}}ngOnInit(){this._updateFontIconClasses()}ngAfterViewChecked(){const t=this._elementsWithExternalReferences;if(t&&t.size){const i=this._location.getPathname();i!==this._previousPath&&(this._previousPath=i,this._prependPathToReferences(i))}}ngOnDestroy(){this._currentIconFetch.unsubscribe(),this._elementsWithExternalReferences&&this._elementsWithExternalReferences.clear()}_usingFontIcon(){return!this.svgIcon}_setSvgElement(t){this._clearSvgElement();const i=t.querySelectorAll("style");for(let s=0;s{r.forEach(o=>{s.setAttribute(o.name,`url('${t}#${o.value}')`)})})}_cacheChildrenWithExternalReferences(t){const i=t.querySelectorAll(pAe),r=this._elementsWithExternalReferences=this._elementsWithExternalReferences||new Map;for(let s=0;s{const a=i[s],l=a.getAttribute(o),c=l?l.match(gAe):null;if(c){let u=r.get(a);u||(u=[],r.set(a,u)),u.push({name:o,value:c[1]})}})}_updateSvgIcon(t){if(this._svgNamespace=null,this._svgName=null,this._currentIconFetch.unsubscribe(),t){const[i,r]=this._splitIconName(t);i&&(this._svgNamespace=i),r&&(this._svgName=r),this._currentIconFetch=this._iconRegistry.getNamedSvgIcon(r,i).pipe(qr(1)).subscribe(s=>this._setSvgElement(s),s=>{this._errorHandler.handleError(new Error(`Error retrieving icon ${i}:${r}! ${s.message}`))})}}}return n.\u0275fac=function(t){return new(t||n)(Ce(gn),Ce(PC),yo("aria-hidden"),Ce(dAe),Ce(la))},n.\u0275cmp=rn({type:n,selectors:[["mat-icon"]],hostAttrs:["role","img",1,"mat-icon","notranslate"],hostVars:7,hostBindings:function(t,i){2&t&&(Ii("data-mat-icon-type",i._usingFontIcon()?"font":"svg")("data-mat-icon-name",i._svgName||i.fontIcon)("data-mat-icon-namespace",i._svgNamespace||i.fontSet),ai("mat-icon-inline",i.inline)("mat-icon-no-color","primary"!==i.color&&"accent"!==i.color&&"warn"!==i.color))},inputs:{color:"color",inline:"inline",svgIcon:"svgIcon",fontSet:"fontSet",fontIcon:"fontIcon"},exportAs:["matIcon"],features:[En],ngContentSelectors:oAe,decls:1,vars:0,template:function(t,i){1&t&&(Hr(),oi(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}),n})();function TAe(n,e){}class zN{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 AAe={dialogContainer:Em("dialogContainer",[wc("void, exit",ds({opacity:0,transform:"scale(0.7)"})),wc("enter",ds({transform:"none"})),pd("* => enter",fd("150ms cubic-bezier(0, 0, 0.2, 1)",ds({transform:"none",opacity:1}))),pd("* => void, * => exit",fd("75ms cubic-bezier(0.4, 0.0, 0.2, 1)",ds({opacity:0})))])};let MAe=(()=>{class n extends MC{constructor(t,i,r,s,o,a){super(),this._elementRef=t,this._focusTrapFactory=i,this._changeDetectorRef=r,this._config=o,this._focusMonitor=a,this._animationStateChanged=new ln,this._elementFocusedBeforeDialogWasOpened=null,this._closeInteractionType=null,this.attachDomPortal=l=>(this._portalOutlet.hasAttached(),this._portalOutlet.attachDomPortal(l)),this._ariaLabelledBy=o.ariaLabelledBy||null,this._document=s}_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 i=KS(),r=this._elementRef.nativeElement;(!i||i===this._document.body||i===r||r.contains(i))&&(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=KS())}_focusDialogContainer(){this._elementRef.nativeElement.focus&&this._elementRef.nativeElement.focus()}_containsFocus(){const t=this._elementRef.nativeElement,i=KS();return t===i||t.contains(i)}}return n.\u0275fac=function(t){return new(t||n)(Ce(gn),Ce(Y6),Ce(Mr),Ce(fn,8),Ce(zN),Ce(vc))},n.\u0275dir=Nt({type:n,viewQuery:function(t,i){if(1&t&&hr(np,7),2&t){let r;Gn(r=$n())&&(i._portalOutlet=r.first)}},features:[En]}),n})(),DAe=(()=>{class n extends MAe{constructor(){super(...arguments),this._state="enter"}_onAnimationDone({toState:t,totalTime:i}){"enter"===t?(this._trapFocus(),this._animationStateChanged.next({state:"opened",totalTime:i})):"exit"===t&&(this._restoreFocus(),this._animationStateChanged.next({state:"closed",totalTime:i}))}_onAnimationStart({toState:t,totalTime:i}){"enter"===t?this._animationStateChanged.next({state:"opening",totalTime:i}):("exit"===t||"void"===t)&&this._animationStateChanged.next({state:"closing",totalTime:i})}_startExitAnimation(){this._state="exit",this._changeDetectorRef.markForCheck()}}return n.\u0275fac=function(){let e;return function(i){return(e||(e=zi(n)))(i||n)}}(),n.\u0275cmp=rn({type:n,selectors:[["mat-dialog-container"]],hostAttrs:["tabindex","-1","aria-modal","true",1,"mat-dialog-container"],hostVars:6,hostBindings:function(t,i){1&t&&uE("@dialogContainer.start",function(s){return i._onAnimationStart(s)})("@dialogContainer.done",function(s){return i._onAnimationDone(s)}),2&t&&(qc("id",i._id),Ii("role",i._config.role)("aria-labelledby",i._config.ariaLabel?null:i._ariaLabelledBy)("aria-label",i._config.ariaLabel)("aria-describedby",i._config.ariaDescribedBy||null),fE("@dialogContainer",i._state))},features:[En],decls:1,vars:0,consts:[["cdkPortalOutlet",""]],template:function(t,i){1&t&&wi(0,TAe,0,0,"ng-template",0)},directives:[np],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:[AAe.dialogContainer]}}),n})(),IAe=0;class kC{constructor(e,t,i="mat-dialog-"+IAe++){this._overlayRef=e,this._containerInstance=t,this.id=i,this.disableClose=this._containerInstance._config.disableClose,this._afterOpened=new oe,this._afterClosed=new oe,this._beforeClosed=new oe,this._state=0,t._id=i,t._animationStateChanged.pipe(Ki(r=>"opened"===r.state),qr(1)).subscribe(()=>{this._afterOpened.next(),this._afterOpened.complete()}),t._animationStateChanged.pipe(Ki(r=>"closed"===r.state),qr(1)).subscribe(()=>{clearTimeout(this._closeFallbackTimeout),this._finishDialogClose()}),e.detachments().subscribe(()=>{this._beforeClosed.next(this._result),this._beforeClosed.complete(),this._afterClosed.next(this._result),this._afterClosed.complete(),this.componentInstance=null,this._overlayRef.dispose()}),e.keydownEvents().pipe(Ki(r=>27===r.keyCode&&!this.disableClose&&!Dl(r))).subscribe(r=>{r.preventDefault(),HN(this,"keyboard")}),e.backdropClick().subscribe(()=>{this.disableClose?this._containerInstance._recaptureFocus():HN(this,"mouse")})}close(e){this._result=e,this._containerInstance._animationStateChanged.pipe(Ki(t=>"closing"===t.state),qr(1)).subscribe(t=>{this._beforeClosed.next(e),this._beforeClosed.complete(),this._overlayRef.detachBackdrop(),this._closeFallbackTimeout=setTimeout(()=>this._finishDialogClose(),t.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(e){let 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}updateSize(e="",t=""){return this._overlayRef.updateSize({width:e,height:t}),this._overlayRef.updatePosition(),this}addPanelClass(e){return this._overlayRef.addPanelClass(e),this}removePanelClass(e){return this._overlayRef.removePanelClass(e),this}getState(){return this._state}_finishDialogClose(){this._state=2,this._overlayRef.dispose()}_getPositionStrategy(){return this._overlayRef.getConfig().positionStrategy}}function HN(n,e,t){return void 0!==n._containerInstance&&(n._containerInstance._closeInteractionType=e),n.close(t)}const PW=new Ht("MatDialogData"),OAe=new Ht("mat-dialog-default-options"),NW=new Ht("mat-dialog-scroll-strategy");let NAe=(()=>{class n{constructor(t,i,r,s,o,a,l,c,u){this._overlay=t,this._injector=i,this._defaultOptions=r,this._parentDialog=s,this._overlayContainer=o,this._dialogRefConstructor=l,this._dialogContainerType=c,this._dialogDataToken=u,this._openDialogsAtThisLevel=[],this._afterAllClosedAtThisLevel=new oe,this._afterOpenedAtThisLevel=new oe,this._ariaHiddenElements=new Map,this.afterAllClosed=function(n){return new O(e=>{let t;try{t=n()}catch(r){return void e.error(r)}return(t?je(t):b0()).subscribe(e)})}(()=>this.openDialogs.length?this._getAfterAllClosed():this._getAfterAllClosed().pipe(Oo(void 0))),this._scrollStrategy=a}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,i){(i=function(n,e){return Object.assign(Object.assign({},e),n)}(i,this._defaultOptions||new zN)).id&&this.getDialogById(i.id);const r=this._createOverlay(i),s=this._attachDialogContainer(r,i),o=this._attachDialogContent(t,s,r,i);return this.openDialogs.length||this._hideNonDialogContentFromAssistiveTechnology(),this.openDialogs.push(o),o.afterClosed().subscribe(()=>this._removeOpenDialog(o)),this.afterOpened.next(o),s._initializeWithAttachedContent(),o}closeAll(){this._closeDialogs(this.openDialogs)}getDialogById(t){return this.openDialogs.find(i=>i.id===t)}ngOnDestroy(){this._closeDialogs(this._openDialogsAtThisLevel),this._afterAllClosedAtThisLevel.complete(),this._afterOpenedAtThisLevel.complete()}_createOverlay(t){const i=this._getOverlayConfig(t);return this._overlay.create(i)}_getOverlayConfig(t){const i=new IC({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&&(i.backdropClass=t.backdropClass),i}_attachDialogContainer(t,i){const s=Hn.create({parent:i&&i.viewContainerRef&&i.viewContainerRef.injector||this._injector,providers:[{provide:zN,useValue:i}]}),o=new AC(this._dialogContainerType,i.viewContainerRef,s,i.componentFactoryResolver);return t.attach(o).instance}_attachDialogContent(t,i,r,s){const o=new this._dialogRefConstructor(r,i,s.id);if(t instanceof Go)i.attachTemplatePortal(new Pm(t,null,{$implicit:s.data,dialogRef:o}));else{const a=this._createInjector(s,o,i),l=i.attachComponentPortal(new AC(t,s.viewContainerRef,a));o.componentInstance=l.instance}return o.updateSize(s.width,s.height).updatePosition(s.position),o}_createInjector(t,i,r){const s=t&&t.viewContainerRef&&t.viewContainerRef.injector,o=[{provide:this._dialogContainerType,useValue:r},{provide:this._dialogDataToken,useValue:t.data},{provide:this._dialogRefConstructor,useValue:i}];return t.direction&&(!s||!s.get(Il,null,xn.Optional))&&o.push({provide:Il,useValue:{value:t.direction,change:sn()}}),Hn.create({parent:s||this._injector,providers:o})}_removeOpenDialog(t){const i=this.openDialogs.indexOf(t);i>-1&&(this.openDialogs.splice(i,1),this.openDialogs.length||(this._ariaHiddenElements.forEach((r,s)=>{r?s.setAttribute("aria-hidden",r):s.removeAttribute("aria-hidden")}),this._ariaHiddenElements.clear(),this._getAfterAllClosed().next()))}_hideNonDialogContentFromAssistiveTechnology(){const t=this._overlayContainer.getContainerElement();if(t.parentElement){const i=t.parentElement.children;for(let r=i.length-1;r>-1;r--){let s=i[r];s!==t&&"SCRIPT"!==s.nodeName&&"STYLE"!==s.nodeName&&!s.hasAttribute("aria-live")&&(this._ariaHiddenElements.set(s,s.getAttribute("aria-hidden")),s.setAttribute("aria-hidden","true"))}}}_closeDialogs(t){let i=t.length;for(;i--;)t[i].close()}}return n.\u0275fac=function(t){return new(t||n)(Ce(Ec),Ce(Hn),Ce(void 0),Ce(void 0),Ce(Ob),Ce(void 0),Ce(Du),Ce(Du),Ce(Ht))},n.\u0275dir=Nt({type:n}),n})(),Nb=(()=>{class n extends NAe{constructor(t,i,r,s,o,a,l){super(t,i,s,a,l,o,kC,DAe,PW)}}return n.\u0275fac=function(t){return new(t||n)(Ie(Ec),Ie(Hn),Ie(kg,8),Ie(OAe,8),Ie(NW),Ie(n,12),Ie(Ob))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),FAe=0,kW=(()=>{class n{constructor(t,i,r){this._dialogRef=t,this._elementRef=i,this._dialog=r,this.id="mat-dialog-title-"+FAe++}ngOnInit(){this._dialogRef||(this._dialogRef=function(n,e){let t=n.nativeElement.parentElement;for(;t&&!t.classList.contains("mat-dialog-container");)t=t.parentElement;return t?e.find(i=>i.id===t.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 n.\u0275fac=function(t){return new(t||n)(Ce(kC,8),Ce(gn),Ce(Nb))},n.\u0275dir=Nt({type:n,selectors:[["","mat-dialog-title",""],["","matDialogTitle",""]],hostAttrs:[1,"mat-dialog-title"],hostVars:1,hostBindings:function(t,i){2&t&&qc("id",i.id)},inputs:{id:"id"},exportAs:["matDialogTitle"]}),n})(),FW=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275dir=Nt({type:n,selectors:[["","mat-dialog-content",""],["mat-dialog-content"],["","matDialogContent",""]],hostAttrs:[1,"mat-dialog-content"]}),n})();const $N=new Ht("CdkAccordion");let VAe=0,UAe=(()=>{class n{constructor(t,i,r){this.accordion=t,this._changeDetectorRef=i,this._expansionDispatcher=r,this._openCloseAllSubscription=C.EMPTY,this.closed=new ln,this.opened=new ln,this.destroyed=new ln,this.expandedChange=new ln,this.id="cdk-accordion-child-"+VAe++,this._expanded=!1,this._disabled=!1,this._removeUniqueSelectionListener=()=>{},this._removeUniqueSelectionListener=r.listen((s,o)=>{this.accordion&&!this.accordion.multi&&this.accordion.id===o&&this.id!==s&&(this.expanded=!1)}),this.accordion&&(this._openCloseAllSubscription=this._subscribeToOpenCloseAllActions())}get expanded(){return this._expanded}set expanded(t){t=bi(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=bi(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 n.\u0275fac=function(t){return new(t||n)(Ce($N,12),Ce(Mr),Ce(A$))},n.\u0275dir=Nt({type:n,selectors:[["cdk-accordion-item"],["","cdkAccordionItem",""]],inputs:{expanded:"expanded",disabled:"disabled"},outputs:{closed:"closed",opened:"opened",destroyed:"destroyed",expandedChange:"expandedChange"},exportAs:["cdkAccordionItem"],features:[Vn([{provide:$N,useValue:void 0}])]}),n})();const HAe=["body"];function GAe(n,e){}const $Ae=[[["mat-expansion-panel-header"]],"*",[["mat-action-row"]]],WAe=["mat-expansion-panel-header","*","mat-action-row"];function qAe(n,e){1&n&&ni(0,"span",2),2&n&&Jt("@indicatorRotate",_i()._getExpandedState())}const YAe=[[["mat-panel-title"]],[["mat-panel-description"]],"*"],XAe=["mat-panel-title","mat-panel-description","*"],WN=new Ht("MAT_ACCORDION"),BW="225ms cubic-bezier(0.4,0.0,0.2,1)",VW={indicatorRotate:Em("indicatorRotate",[wc("collapsed, void",ds({transform:"rotate(0deg)"})),wc("expanded",ds({transform:"rotate(180deg)"})),pd("expanded <=> collapsed, void => collapsed",fd(BW))]),bodyExpansion:Em("bodyExpansion",[wc("collapsed, void",ds({height:"0px",visibility:"hidden"})),wc("expanded",ds({height:"*",visibility:"visible"})),pd("expanded <=> collapsed, void => collapsed",fd(BW))])};let KAe=(()=>{class n{constructor(t){this._template=t}}return n.\u0275fac=function(t){return new(t||n)(Ce(Go))},n.\u0275dir=Nt({type:n,selectors:[["ng-template","matExpansionPanelContent",""]]}),n})(),QAe=0;const jW=new Ht("MAT_EXPANSION_PANEL_DEFAULT_OPTIONS");let UW=(()=>{class n extends UAe{constructor(t,i,r,s,o,a,l){super(t,i,r),this._viewContainerRef=s,this._animationMode=a,this._hideToggle=!1,this.afterExpand=new ln,this.afterCollapse=new ln,this._inputChanges=new oe,this._headerId="mat-expansion-panel-header-"+QAe++,this._bodyAnimationDone=new oe,this.accordion=t,this._document=o,this._bodyAnimationDone.pipe(ld((c,u)=>c.fromState===u.fromState&&c.toState===u.toState)).subscribe(c=>{"void"!==c.fromState&&("expanded"===c.toState?this.afterExpand.emit():"collapsed"===c.toState&&this.afterCollapse.emit())}),l&&(this.hideToggle=l.hideToggle)}get hideToggle(){return this._hideToggle||this.accordion&&this.accordion.hideToggle}set hideToggle(t){this._hideToggle=bi(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(Oo(null),Ki(()=>this.expanded&&!this._portal),qr(1)).subscribe(()=>{this._portal=new Pm(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,i=this._body.nativeElement;return t===i||i.contains(t)}return!1}}return n.\u0275fac=function(t){return new(t||n)(Ce(WN,12),Ce(Mr),Ce(A$),Ce(Rs),Ce(fn),Ce(Qa,8),Ce(jW,8))},n.\u0275cmp=rn({type:n,selectors:[["mat-expansion-panel"]],contentQueries:function(t,i,r){if(1&t&&function(n,e,t,i){const r=Si();if(r.firstCreatePass){const s=as();I3(r,new A3(e,t,i),s.index),function(n,e){const t=n.contentQueries||(n.contentQueries=[]);e!==(t.length?t[t.length-1]:-1)&&t.push(n.queries.length-1,e)}(r,n),2==(2&t)&&(r.staticContentQueries=!0)}D3(r,Vt(),t)}(r,KAe,5),2&t){let s;Gn(s=$n())&&(i._lazyContent=s.first)}},viewQuery:function(t,i){if(1&t&&hr(HAe,5),2&t){let r;Gn(r=$n())&&(i._body=r.first)}},hostAttrs:[1,"mat-expansion-panel"],hostVars:6,hostBindings:function(t,i){2&t&&ai("mat-expanded",i.expanded)("_mat-animation-noopable","NoopAnimations"===i._animationMode)("mat-expansion-panel-spacing",i._hasSpacing())},inputs:{disabled:"disabled",expanded:"expanded",hideToggle:"hideToggle",togglePosition:"togglePosition"},outputs:{opened:"opened",closed:"closed",expandedChange:"expandedChange",afterExpand:"afterExpand",afterCollapse:"afterCollapse"},exportAs:["matExpansionPanel"],features:[Vn([{provide:WN,useValue:void 0}]),En,Fi],ngContentSelectors:WAe,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,i){1&t&&(Hr($Ae),oi(0),wt(1,"div",0,1),Tn("@bodyExpansion.done",function(s){return i._bodyAnimationDone.next(s)}),wt(3,"div",2),oi(4,1),wi(5,GAe,0,0,"ng-template",3),Et(),oi(6,2),Et()),2&t&&(zt(1),Jt("@bodyExpansion",i._getExpandedState())("id",i.id),Ii("aria-labelledby",i._headerId),zt(4),Jt("cdkPortalOutlet",i._portal))},directives:[np],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:[VW.bodyExpansion]},changeDetection:0}),n})();class JAe{}const eMe=wC(JAe);let zW=(()=>{class n extends eMe{constructor(t,i,r,s,o,a,l){super(),this.panel=t,this._element=i,this._focusMonitor=r,this._changeDetectorRef=s,this._animationMode=a,this._parentChangeSubscription=C.EMPTY;const c=t.accordion?t.accordion._stateChanges.pipe(Ki(u=>!(!u.hideToggle&&!u.togglePosition))):Qc;this.tabIndex=parseInt(l||"")||0,this._parentChangeSubscription=Nn(t.opened,t.closed,c,t._inputChanges.pipe(Ki(u=>!!(u.hideToggle||u.disabled||u.togglePosition)))).subscribe(()=>this._changeDetectorRef.markForCheck()),t.closed.pipe(Ki(()=>t._containsFocus())).subscribe(()=>r.focusVia(i,"program")),o&&(this.expandedHeight=o.expandedHeight,this.collapsedHeight=o.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:Dl(t)||(t.preventDefault(),this._toggle());break;default:return void(this.panel.accordion&&this.panel.accordion._handleHeaderKeydown(t))}}focus(t,i){t?this._focusMonitor.focusVia(this._element,t,i):this._element.nativeElement.focus(i)}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 n.\u0275fac=function(t){return new(t||n)(Ce(UW,1),Ce(gn),Ce(vc),Ce(Mr),Ce(jW,8),Ce(Qa,8),yo("tabindex"))},n.\u0275cmp=rn({type:n,selectors:[["mat-expansion-panel-header"]],hostAttrs:["role","button",1,"mat-expansion-panel-header","mat-focus-indicator"],hostVars:15,hostBindings:function(t,i){1&t&&Tn("click",function(){return i._toggle()})("keydown",function(s){return i._keydown(s)}),2&t&&(Ii("id",i.panel._headerId)("tabindex",i.tabIndex)("aria-controls",i._getPanelId())("aria-expanded",i._isExpanded())("aria-disabled",i.panel.disabled),zy("height",i._getHeaderHeight()),ai("mat-expanded",i._isExpanded())("mat-expansion-toggle-indicator-after","after"===i._getTogglePosition())("mat-expansion-toggle-indicator-before","before"===i._getTogglePosition())("_mat-animation-noopable","NoopAnimations"===i._animationMode))},inputs:{tabIndex:"tabIndex",expandedHeight:"expandedHeight",collapsedHeight:"collapsedHeight"},features:[En],ngContentSelectors:XAe,decls:5,vars:1,consts:[[1,"mat-content"],["class","mat-expansion-indicator",4,"ngIf"],[1,"mat-expansion-indicator"]],template:function(t,i){1&t&&(Hr(YAe),wt(0,"span",0),oi(1),oi(2,1),oi(3,2),Et(),wi(4,qAe,1,1,"span",1)),2&t&&(zt(4),Jt("ngIf",i._showToggle()))},directives:[ac],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:[VW.indicatorRotate]},changeDetection:0}),n})();var HW=et(5478);Object.create(Error.prototype);const sMe=["*"];var LC=(()=>(function(n){n.LineHighlight="line-highlight",n.LineNumbers="line-numbers"}(LC||(LC={})),LC))();class aMe{}const $W=new Ht("SECURITY_CONTEXT");let qN=(()=>{class n{constructor(t,i,r,s,o){this.platform=t,this.securityContext=i,this.http=r,this.sanitizer=o,this.initialMarkedOptions={renderer:new HW.Renderer},this.options=s}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,i=!1,r=!1,s=this.options){const o=this.trimIndentation(t),a=i?this.decodeHtml(o):o,l=r?this.renderEmoji(a):a,c=HW.parse(l,s);return this.sanitizer.sanitize(this.securityContext,c)||""}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(me(i=>this.handleExtension(t,i)))}highlight(t){if(Af(this.platform)&&"undefined"!=typeof Prism){t||(t=document);const i=t.querySelectorAll('pre code:not([class*="language-"])');Array.prototype.forEach.call(i,r=>r.classList.add("language-none")),Prism.highlightAllUnder(t)}}renderKatex(t,i){if(!Af(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,(r,s)=>katex.renderToString(s,i))}decodeHtml(t){if(!Af(this.platform))return t;const i=document.createElement("textarea");return i.innerHTML=t,i.value}handleExtension(t,i){const r=t?t.split("?")[0].split(".").splice(-1).join():"";return"md"!==r?"```"+r+"\n"+i+"\n```":i}renderEmoji(t){if(!Af(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 i;return t.split("\n").map(r=>{let s=i;return r.length>0&&(s=isNaN(s)?r.search(/\S|$/):Math.min(r.search(/\S|$/),s)),isNaN(i)&&(i=s),s?r.substring(s):r}).join("\n")}}return n.\u0275fac=function(t){return new(t||n)(Ie(Xc),Ie($W),Ie(_u,8),Ie(aMe,8),Ie(Mf))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),WW=(()=>{class n{constructor(t,i){this.element=t,this.markdownService=i,this.error=new ln,this.load=new ln,this.ready=new ln,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,i=!1){let r=this.markdownService.compile(t,i,this.emoji);r=this.katex?this.markdownService.renderKatex(r,this.katexOptions):r,this.element.nativeElement.innerHTML=r,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,LC.LineNumbers),this.setPluginOptions(this.element.nativeElement,{dataStart:this.start}))}setPluginClass(t,i){const r=t.querySelectorAll("pre");for(let s=0;s{const a=i[o];if(a){const l=this.toLispCase(o);r.item(s).setAttribute(l,a.toString())}})}toLispCase(t){const i=t.match(/([A-Z])/g);if(!i)return t;let r=t.toString();for(let s=0,o=i.length;sk(i)?t(...i):t(i))):new O(i=>{const r=(...o)=>i.next(1===o.length?o[0]:o);let s;try{s=n(r)}catch(o){return void i.error(o)}if(Y(e))return()=>e(r,s)})}function YN(...n){return e=>{let t;return"function"==typeof n[n.length-1]&&(t=n.pop()),e.lift(new pMe(n,t))}}class pMe{constructor(e,t){this.observables=e,this.project=t}call(e,t){return t.subscribe(new gMe(e,this.observables,this.project))}}class gMe extends t5{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)}}class mMe{constructor(e,t,i=!1){this.accumulator=e,this.seed=t,this.hasSeed=i}call(e,t){return t.subscribe(new _Me(e,this.accumulator,this.seed,this.hasSeed))}}class _Me extends y{constructor(e,t,i,r){super(e),this.accumulator=t,this._seed=i,this.hasSeed=r,this.index=0}get seed(){return this._seed}set seed(e){this.hasSeed=!0,this._seed=e}_next(e){if(this.hasSeed)return this._tryNext(e);this.seed=e,this.destination.next(e)}_tryNext(e){const t=this.index++;let i;try{i=this.accumulator(this.seed,e,t)}catch(r){this.destination.error(r)}this.seed=i,this.destination.next(i)}}class vMe{constructor(e){this.predicate=e}call(e,t){return t.subscribe(new wMe(e,this.predicate))}}class wMe extends y{constructor(e,t){super(e),this.predicate=t,this.skipping=!0,this.index=0}_next(e){const t=this.destination;this.skipping&&this.tryCallPredicate(e),this.skipping||t.next(e)}tryCallPredicate(e){try{const t=this.predicate(e,this.index++);this.skipping=Boolean(t)}catch(t){this.destination.error(t)}}}const EMe=["youtubeContainer"];let KW=(()=>{class n{constructor(t,i){this._ngZone=t,this._youtubeContainer=new oe,this._destroyed=new oe,this._playerChanges=new Fr(void 0),this._videoId=new Fr(void 0),this._height=new Fr(390),this._width=new Fr(640),this._startSeconds=new Fr(void 0),this._endSeconds=new Fr(void 0),this._suggestedQuality=new Fr(void 0),this._playerVars=new Fr(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=Af(i)}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=sn(!0);if(!window.YT||!window.YT.Player){const r=new oe;this._existingApiReadyCallback=window.onYouTubeIframeAPIReady,window.onYouTubeIframeAPIReady=()=>{this._existingApiReadyCallback&&this._existingApiReadyCallback(),this._ngZone.run(()=>r.next(!0))},t=r.pipe(qr(1),Oo(!1))}const i=function(n,e,t,i,r,s,o){const a=yc([e,s]).pipe(YN(yc([i,r])),me(([l,c])=>{const[u,h]=l,[f,g]=c;return u?{videoId:u,playerVars:h,width:f,height:g}:void 0}));return yc([n,a,sn(o)]).pipe(function(n){return ue(function(...n){let e=null;return"function"==typeof n[n.length-1]&&(e=n.pop()),1===n.length&&k(n[0])&&(n=n[0].slice()),t=>t.lift.call(je([t,...n]),new r5(e))}(n),function(n){return e=>e.lift(new vMe(n))}(([e,t])=>!t),me(([e])=>e))}(t),function(n,e){let t=!1;return arguments.length>=2&&(t=!0),function(r){return r.lift(new mMe(n,e,t))}}(MMe,void 0),ld())}(this._youtubeContainer,this._videoId,t,this._width,this._height,this._playerVars,this._ngZone).pipe(cr(r=>{this._playerChanges.next(r)}),V(e=>e?QW(e)?sn(e):new O(t=>{let i=!1,r=!1;const s=o=>{r=!0,i||(o.target.removeEventListener("onReady",s),t.next(o.target))};return e.addEventListener("onReady",s),()=>{i=!0,r||(r=>{QW(r)||r.destroy()})(e)}}).pipe(qr(1),Oo(void 0)):sn(void 0)),gr(this._destroyed),xa(new oe));i.subscribe(r=>{this._player=r,r&&this._pendingPlayerState&&this._initializePlayer(r,this._pendingPlayerState),this._pendingPlayerState=void 0}),function(n,e,t){yc([n,e,t]).subscribe(([i,r,s])=>i&&i.setSize(r,s))}(i,this._width,this._height),function(n,e){yc([n,e]).subscribe(([t,i])=>t&&i&&t.setPlaybackQuality(i))}(i,this._suggestedQuality),function(n,e,t,i,r,s){const o=yc([t,i]).pipe(me(([u,h])=>({startSeconds:u,endSeconds:h}))),a=o.pipe(KN(n,u=>!!u&&!function(n){const e=n.getPlayerState();return e!==YT.PlayerState.UNSTARTED&&e!==YT.PlayerState.CUED}(u))),l=e.pipe(KN(n,(u,h)=>!!u&&u.videoId!==h));Nn(n.pipe(KN(yc([e,o]),([u,h],f)=>!(!f||u==f.videoId&&!h.startSeconds&&!h.endSeconds))),l,a).pipe(YN(yc([n,e,o,r])),me(([u,h])=>h),gr(s)).subscribe(([u,h,f,g])=>{!h||!u||(u.videoId=h,u.cueVideoById(Object.assign({videoId:h,suggestedQuality:g},f)))})}(i,this._videoId,this._startSeconds,this._endSeconds,this._suggestedQuality,this._destroyed),i.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,i){this._player?this._player.seekTo(t,i):this._getPendingState().seek={seconds:t,allowSeekAhead:i}}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,i){const{playbackState:r,playbackRate:s,volume:o,muted:a,seek:l}=i;switch(r){case YT.PlayerState.PLAYING:t.playVideo();break;case YT.PlayerState.PAUSED:t.pauseVideo();break;case YT.PlayerState.CUED:t.stopVideo()}null!=s&&t.setPlaybackRate(s),null!=o&&t.setVolume(o),null!=a&&(a?t.mute():t.unMute()),null!=l&&t.seekTo(l.seconds,l.allowSeekAhead)}_getLazyEmitter(t){return this._playerChanges.pipe(is(i=>i?qW(r=>{i.addEventListener(t,r)},r=>{try{i.removeEventListener&&i.removeEventListener(t,r)}catch(s){}}):sn()),i=>new O(r=>i.subscribe({next:s=>this._ngZone.run(()=>r.next(s)),error:s=>r.error(s),complete:()=>r.complete()})),gr(this._destroyed))}}return n.\u0275fac=function(t){return new(t||n)(Ce(pn),Ce(Xc))},n.\u0275cmp=rn({type:n,selectors:[["youtube-player"]],viewQuery:function(t,i){if(1&t&&hr(EMe,5),2&t){let r;Gn(r=$n())&&(i.youtubeContainer=r.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,i){1&t&&ni(0,"div",null,0)},encapsulation:2,changeDetection:0}),n})();function MMe(n,[e,t,i]){if(n&&t&&n.playerVars!==t.playerVars)n.destroy();else{if(!t)return void(n&&n.destroy());if(n)return n}const r=i.runOutsideAngular(()=>new YT.Player(e,t));return r.videoId=t.videoId,r.playerVars=t.playerVars,r}function QW(n){return"getPlayerStatus"in n}function KN(n,e){return ue(YN(n),Ki(([t,i])=>e(i,t)),me(([t])=>t))}let BMe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275dir=Nt({type:n,selectors:[["","mat-card-sm-image",""],["","matCardImageSmall",""]],hostAttrs:[1,"mat-card-sm-image"]}),n})();function Fb(n){return!0===n}function Za(n){return null==n}function Ja(n){return!Za(n)}function QN(n){return Boolean(n)}function t7(n){return Za(n)?n:JSON.parse(JSON.stringify(n))}const VC=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])&&VC(n[o])}),n};function n7(n){return Ja(n)&&"object"==typeof n&&function(n){return"[object Object]"===Object.prototype.toString.call(n)}(n)}const s7="NGXS_DATA_META",JN="NGXS_META",o7="NGXS_ARGUMENT_REGISTRY_META";let a7=(()=>{class n{constructor(t){this.sequence$=new Fr(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(hu,8))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();function Lb(n){return n[s7]}let el=(()=>{class n{constructor(t,i,r){n.store=t.get(hu),n.ngZone=t.get(pn),n.factory=i,n.context=r,n.computed=t.get(a7)}}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(o5),Ie(s5))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();class hs{constructor(){hs.statesCachedMeta.clear()}static createStateContext(e){return el.context.createStateContext(e)}static ensureMappedState(e){if(Za(el.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(Ja(e.name)?hs.statesCachedMeta.get(e.name):null)||hs.ensureMeta(e)}static getRepositoryByInstance(e){var t;const r=null!==(t=Lb(hs.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=hs.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=hs.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=Ja(e.name)?null===(t=el.factory.states)||void 0===t?void 0:t.find(r=>r.name===e.name):null;return Ja(i)&&Ja(e.name)&&hs.statesCachedMeta.set(e.name,i),i}}hs.statesCachedMeta=new Map,hs.\u0275fac=function(e){return new(e||hs)},hs.\u0275prov=We({token:hs,factory:hs.\u0275fac}),new Df(1);class sDe extends Error{constructor(e){super(`Child states can only be added to an object. Cannot convert ${Ja(null==e?void 0:e.constructor)?e.constructor.name:e} to PlainObject`)}}function l7(n){var e;return null!==(e=n.NGXS_OPTIONS_META)&&void 0!==e?e:{name:""}}function c7(n){var e;const t=l7(n),i=null!==(e=t.children)&&void 0!==e?e:[],s=t7(void 0===t.defaults?{}:t.defaults);if(i.length){if(n7(s))return function(n,e){return e.reduce((t,i)=>{const r=l7(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()]=c7(i),t},null!=n?n:{})}(s,i);throw new sDe(s)}return s}function d7(n){var e;return null!==(e=n.__NGXS_COMPUTED_OPTION__)&&void 0!==e?e:null}function h7(){var n,e;return null!==(e=null===(n=null==el?void 0:el.computed)||void 0===n?void 0:n.sequenceValue)&&void 0!==e?e:0}function cDe(n){let e=!1;return Im(n)&&(e=!0),e}function ek(n){return n[o7]}class uDe extends Error{constructor(e,t){super(`An argument with the name '${e}' already exists in the method '${t}'`)}}class dDe{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(QN(this.argumentMap.has(e))||QN(this.payloadMap.has(e)))throw new uDe(e,t)}}function _De(n){return{enumerable:!0,configurable:!0,get(){const e=Lb(n),t=hs.ensureMappedState(e.stateMeta);return hs.createStateContext(t)}}}function f7(){return(n,e,t)=>{!function(n,e){if(!function(n,e){var t;let i=n,r=!1;if(n7(i))for(;null!==i;){if(Fb(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(d7(n))&&Object.defineProperties(n,{__NGXS_COMPUTED_OPTION__:{enumerable:!0,configurable:!0,value:new WeakMap}}),d7(n)}(this),o=null==s?void 0:s.get(i);if(Fb(null==o?void 0:o.isObservable))return null==o?void 0:o.value;if(Za(o)||o.sequenceId!==h7()){s.delete(i);const l=i.apply(this,r);return s.set(i,{value:l,sequenceId:h7(),isObservable:cDe(l)}),l}return o.value},t}}const xDe={cancelUncompleted:!0,insideZone:!1};function tk(n=xDe){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=hs.getRepositoryByInstance(a),u=c.operations;let h=u[s];const f=c.stateMeta,g=ek(r);if(Za(h)){const D=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),ie=function(n){const{statePath:e,argumentsNames:t,methodName:i,argumentRegistry:r}=n;let s="";for(let o=0;o{var D;return Fb(n.insideZone)?null===(D=el.ngZone)||void 0===D||D.run(()=>{l=r.apply(a,o)}):l=r.apply(a,o),Im(l)?sn(null).pipe(me(()=>l)):l};const x=hs.createAction(h,o,g),U=el.store.dispatch(x);return Im(l)?function(n,e){return fb([n,e]).pipe(me(t=>t.pop()))}(U,l):l},i}}function p7(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(ek(t))&&Object.defineProperties(t,{[o7]:{enumerable:!0,configurable:!0,value:new dDe}}),ek(t)})(e,t).createPayloadType(r,t,i)}}function CDe(){return n=>{const e=function(n){if(function(n){return!QN(n)}(n.hasOwnProperty(JN))){const e={name:null,actions:{},defaults:{},path:null,makeRootSelector:t=>t.getStateGetter(e.name),children:[]};Object.defineProperty(n,JN,{value:e})}return function(n){var e;return null===(e=n)||void 0===e?void 0:e[JN]}(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=Lb(n))&&void 0!==e?e:null;return(Za(t)||(null==t?void 0:t.stateClass)!==n)&&function(n){Object.defineProperty(n,s7,{writable:!0,configurable:!0,enumerable:!0,value:{stateMeta:null,operations:{},stateClass:n}})}(n),Lb(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:()=>t7(t)},context:_De(n)})}(n,e,c7(n)),function(n){var e,t;const i=Lb(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(Ja(r)){const s=`__${r}__selector`;Object.defineProperties(n.prototype,{[s]:{writable:!0,enumerable:!1,configurable:!0},state$:{enumerable:!0,configurable:!0,get(){if(Ja(this[s]))return this[s];if(Za(el.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]=el.store.select(n).pipe(me(o=>fa()?VC(o):o),Wa({refCount:!0,bufferSize:1})),this[s]}}})}}(n)}}let ADe=(()=>{class n{constructor(){this.browserStorageEvents$=new oe,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})(),MDe=(()=>{class n extends ADe{get snapshot(){return function(n){return fa()?VC(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:()=>fa()?VC(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=zi(n)))(i||n)}}(),n.\u0275prov=We({token:n,factory:n.\u0275fac}),Ei([f7(),uc("design:type",Object),uc("design:paramtypes",[])],n.prototype,"snapshot",null),Ei([tk(),wV(0,p7("patchValue")),uc("design:type",Function),uc("design:paramtypes",[Object]),uc("design:returntype",void 0)],n.prototype,"patchState",null),Ei([tk(),wV(0,p7("stateValue")),uc("design:type",Function),uc("design:paramtypes",[Object]),uc("design:returntype",void 0)],n.prototype,"setState",null),Ei([tk(),uc("design:type",Function),uc("design:paramtypes",[]),uc("design:returntype",void 0)],n.prototype,"reset",null),n})(),g9=(()=>{class n{constructor(){}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275dir=Nt({type:n,selectors:[["","gaEvent","","gaCategory",""],["","gaCategory",""]],inputs:{gaCategory:"gaCategory"},exportAs:["gaCategory"]}),n})();const zm=new Ht("ngx-google-analytics-settings",{factory:()=>({trackingCode:"",enableTracing:!1})}),Sk=new Ht("ngx-window",{providedIn:"root",factory:()=>function(n){return Af(n)?window:null}(Bc(Xc))}),jOe=new Ht("ngx-data-layer",{providedIn:"root",factory:()=>function(n){return n?n.dataLayer=n.dataLayer||[]:null}(Bc(Sk))}),Ck=new Ht("ngx-gtag-fn",{providedIn:"root",factory:()=>function(n,e){return n?n.gtag=n.gtag||function(){e.push(arguments)}:null}(Bc(Sk),Bc(jOe))});let qb=(()=>{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||fa())&&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(zm),Ie(fn),Ie(Ck))},n.\u0275prov=We({factory:function(){return new n(Ie(zm),Ie(fn),Ie(Ck))},token:n,providedIn:"root"}),n})(),m9=(()=>{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=gd(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){(fa()||this.settings.enableTracing)&&console&&console.warn&&console.warn(t)}}return n.\u0275fac=function(t){return new(t||n)(Ce(g9,8),Ce(qb),Ce(zm),Ce(gn))},n.\u0275dir=Nt({type:n,selectors:[["","gaEvent",""]],inputs:{gaBind:"gaBind",gaAction:"gaAction",gaLabel:"gaLabel",label:"label",gaValue:"gaValue",gaInteraction:"gaInteraction",gaEvent:"gaEvent"},exportAs:["gaEvent"]}),n})();const zOe={provide:Ef,multi:!0,useFactory:function(n,e,t){return()=>Bi(this,void 0,void 0,function*(){var i;if(!n.trackingCode)return void(fa()||console.error("Empty tracking code for Google Analytics. Make sure to provide one when initializing NgxGoogleAnalyticsModule."));if(!e)return void(fa()||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||fa()||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:[zm,Ck,fn]};new Ht("ngx-google-analytics-routing-settings",{factory:()=>({})});let r1=(()=>{class n{static forRoot(t,i=[],r,s,o){return{ngModule:n,providers:[{provide:zm,useValue:{trackingCode:t,initCommands:i,uri:r,enableTracing:s,nonce:o}},zOe]}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=tn({type:n}),n.\u0275inj=St({imports:[[]]}),n})(),o1=(()=>{class n{constructor(){this.consent="not-set",this.consentChange=new Df(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=We({token:n,factory:n.\u0275fac}),n})(),tRe=(()=>{class n{constructor(t,i,{trackingCode:r}){this.window=i,this.subscriptions=new C,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(o1),Ie(Sk),Ie(zm))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const nRe=new Ht("Key under which consent is stored",{providedIn:"root",factory:()=>"ALLOW_TELEMETRY"}),S9=[o1,tRe,(()=>{class n{constructor(t,i){this.key=i,this.subscriptions=new C;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(o1),Ie(nRe))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})()];function rRe(n){return Object.entries(n).reduce((e,[t,i])=>(null!=i&&(e[t]=`${i}`),e),{})}let oRe=(()=>{class n{static forRoot(t){const{providers:i=[]}=r1.forRoot(t.gaToken,function(n){const{appName:e,projectName:t,developmentMode:i}=n;return[{command:"set",values:[rRe({appName:e,projectName:t,developmentMode:i})]}]}(t));return{ngModule:n,providers:i}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=tn({type:n}),n.\u0275inj=St({providers:[...S9,{provide:Ef,multi:!0,useFactory:()=>()=>{},deps:S9}],imports:[[r1]]}),n})();const uRe=(n,e)=>JSON.stringify(n)===JSON.stringify(e),dRe=n=>n.map(e=>void 0!==e?JSON.parse(JSON.stringify(e)):e),xc={storageStrategy:class extends class{}{constructor(){super(...arguments),this.cachePairs=[]}add(e,t,i){this.cachePairs.push(e)}addMany(e){this.cachePairs=e}updateAtIndex(e,t){Object.assign(this.cachePairs[e],t)}update(e,t){Object.assign(this.cachePairs[e],t)}getAll(){return this.cachePairs}removeAtIndex(e){this.cachePairs.splice(e,1)}remove(e){this.cachePairs.splice(e,1)}removeAll(){this.cachePairs.length=0}},globalCacheKey:"CACHE_STORAGE",promiseImplementation:Promise},hRe=new oe;function Sc(n={}){return function(e,t,i){const r=n.cacheKey||e.constructor.name+"#"+t,s=i.value;if(i&&i.value){let o=n.storageStrategy?new n.storageStrategy:new xc.storageStrategy;const a=[];n.cacheModifier&&n.cacheModifier.subscribe(u=>o.addMany(u(o.getAll(r,this)),r,this)),Nn(hRe.asObservable(),n.cacheBusterObserver?n.cacheBusterObserver:b0()).subscribe(u=>{o.removeAll(r,this),a.length=0}),n.cacheResolver=n.cacheResolver||xc.cacheResolver||uRe,n.cacheHasher=n.cacheHasher||xc.cacheHasher||dRe,i.value=function(...u){const h=o.getAll(r,this);let f=n.cacheHasher(u),g=h.find(v=>n.cacheResolver(v.parameters,f));const m=a.find(v=>n.cacheResolver(v.parameters,f));if((n.maxAge||xc.maxAge)&&g&&g.created&&((new Date).getTime()-new Date(g.created).getTime()>(n.maxAge||xc.maxAge)?(o.remove?o.remove(h.indexOf(g),g,r,this):o.removeAtIndex(h.indexOf(g),r,this),g=null):(n.slidingExpiration||xc.slidingExpiration)&&(g.created=new Date,o.update?o.update(h.indexOf(g),g,r,this):o.updateAtIndex(h.indexOf(g),g,r,this))),g){const v=sn(g.response);return n.async?v.pipe(function(n,e=qS){const i=function(n){return n instanceof Date&&!isNaN(+n)}(n)?+n-e.now():Math.abs(n);return r=>r.lift(new rTe(i,e))}(0)):v}if(m)return m.response;{const v=s.call(this,...u).pipe(NN(()=>{const x=a.find(U=>n.cacheResolver(U.parameters,f));a.splice(a.indexOf(x),1)}),cr(x=>{(!n.shouldCacheDecider||n.shouldCacheDecider(x))&&((!(n.maxCacheCount||xc.maxCacheCount)||1===(n.maxCacheCount||xc.maxCacheCount)||(n.maxCacheCount||xc.maxCacheCount)&&(n.maxCacheCount||xc.maxCacheCount)xa(()=>s,undefined)(o)}(),Yn());return a.push({parameters:f,response:v,created:new Date}),v}}}return i}}class fRe{encodeKey(e){return encodeURIComponent(e)}encodeValue(e){return encodeURIComponent(e)}decodeKey(e){return decodeURIComponent(e)}decodeValue(e){return decodeURIComponent(e)}}const C9=new Ht("basePath");class Yb{constructor(e={}){this.apiKeys=e.apiKeys,this.username=e.username,this.password=e.password,this.accessToken=e.accessToken,this.basePath=e.basePath,this.withCredentials=e.withCredentials,this.encoder=e.encoder,this.credentials=e.credentials?e.credentials:{}}selectHeaderContentType(e){if(0===e.length)return;const t=e.find(i=>this.isJsonMime(i));return void 0===t?e[0]:t}selectHeaderAccept(e){if(0===e.length)return;const t=e.find(i=>this.isJsonMime(i));return void 0===t?e[0]:t}isJsonMime(e){const t=new RegExp("^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$","i");return null!==e&&(t.test(e)||"application/json-patch+json"===e.toLowerCase())}lookupCredential(e){const t=this.credentials[e];return"function"==typeof t?t():t}}let T9=(()=>{class n{constructor(t,i,r){this.httpClient=t,this.basePath="/v1",this.defaultHeaders=new mu,this.configuration=new Yb,r&&(this.configuration=r),"string"!=typeof this.configuration.basePath&&("string"!=typeof i&&(i=this.basePath),this.configuration.basePath=i),this.encoder=this.configuration.encoder||new fRe}addToHttpParams(t,i,r){return this.addToHttpParamsRecursive(t,i,r)}addToHttpParamsRecursive(t,i,r){if(null==i)return t;if("object"==typeof i)if(Array.isArray(i))i.forEach(s=>t=this.addToHttpParamsRecursive(t,s,r));else if(i instanceof Date){if(null==r)throw Error("key may not be null if value is Date");t=t.append(r,i.toISOString().substr(0,10))}else Object.keys(i).forEach(s=>t=this.addToHttpParamsRecursive(t,i[s],null!=r?`${r}.${s}`:s));else{if(null==r)throw Error("key may not be null if value is not object or array");t=t.append(r,i)}return t}aggregateResults(t,i="body",r=!1,s){const o=t.age,a=t.ageRange,l=t.bmi,c=t.bmiRange,u=t.cache,h=t.ontologyTerms,f=t.cellTypeTerms,g=t.providers,m=t.sex,v=t.spatial,x=t.technologies,U=t.token;let D=new Lr({encoder:this.encoder});null!=o&&(D=this.addToHttpParams(D,o,"age")),null!=a&&(D=this.addToHttpParams(D,a,"age-range")),null!=l&&(D=this.addToHttpParams(D,l,"bmi")),null!=c&&(D=this.addToHttpParams(D,c,"bmi-range")),null!=u&&(D=this.addToHttpParams(D,u,"cache")),h&&h.forEach(Ve=>{D=this.addToHttpParams(D,Ve,"ontology-terms")}),f&&f.forEach(Ve=>{D=this.addToHttpParams(D,Ve,"cell-type-terms")}),g&&g.forEach(Ve=>{D=this.addToHttpParams(D,Ve,"providers")}),null!=m&&(D=this.addToHttpParams(D,m,"sex")),v&&v.forEach(Ve=>{D=this.addToHttpParams(D,Ve,"spatial")}),x&&x.forEach(Ve=>{D=this.addToHttpParams(D,Ve,"technologies")}),null!=U&&(D=this.addToHttpParams(D,U,"token"));let ie=this.defaultHeaders,_e=s&&s.httpHeaderAccept;void 0===_e&&(_e=this.configuration.selectHeaderAccept(["application/json"])),void 0!==_e&&(ie=ie.set("Accept",_e));let Pe=s&&s.context;void 0===Pe&&(Pe=new Zs);let Ne="json";return _e&&(Ne=_e.startsWith("text")?"text":this.configuration.isJsonMime(_e)?"json":"blob"),this.httpClient.get(`${this.configuration.basePath}/aggregate-results`,{context:Pe,params:D,responseType:Ne,withCredentials:this.configuration.withCredentials,headers:ie,observe:i,reportProgress:r})}cellTypeTermOccurences(t,i="body",r=!1,s){const o=t.age,a=t.ageRange,l=t.bmi,c=t.bmiRange,u=t.cache,h=t.ontologyTerms,f=t.cellTypeTerms,g=t.providers,m=t.sex,v=t.spatial,x=t.technologies,U=t.token;let D=new Lr({encoder:this.encoder});null!=o&&(D=this.addToHttpParams(D,o,"age")),null!=a&&(D=this.addToHttpParams(D,a,"age-range")),null!=l&&(D=this.addToHttpParams(D,l,"bmi")),null!=c&&(D=this.addToHttpParams(D,c,"bmi-range")),null!=u&&(D=this.addToHttpParams(D,u,"cache")),h&&h.forEach(Ve=>{D=this.addToHttpParams(D,Ve,"ontology-terms")}),f&&f.forEach(Ve=>{D=this.addToHttpParams(D,Ve,"cell-type-terms")}),g&&g.forEach(Ve=>{D=this.addToHttpParams(D,Ve,"providers")}),null!=m&&(D=this.addToHttpParams(D,m,"sex")),v&&v.forEach(Ve=>{D=this.addToHttpParams(D,Ve,"spatial")}),x&&x.forEach(Ve=>{D=this.addToHttpParams(D,Ve,"technologies")}),null!=U&&(D=this.addToHttpParams(D,U,"token"));let ie=this.defaultHeaders,_e=s&&s.httpHeaderAccept;void 0===_e&&(_e=this.configuration.selectHeaderAccept(["application/json"])),void 0!==_e&&(ie=ie.set("Accept",_e));let Pe=s&&s.context;void 0===Pe&&(Pe=new Zs);let Ne="json";return _e&&(Ne=_e.startsWith("text")?"text":this.configuration.isJsonMime(_e)?"json":"blob"),this.httpClient.get(`${this.configuration.basePath}/cell-type-term-occurences`,{context:Pe,params:D,responseType:Ne,withCredentials:this.configuration.withCredentials,headers:ie,observe:i,reportProgress:r})}cellTypeTreeModel(t,i="body",r=!1,s){const o=t.cache,a=t.token;let l=new Lr({encoder:this.encoder});null!=o&&(l=this.addToHttpParams(l,o,"cache")),null!=a&&(l=this.addToHttpParams(l,a,"token"));let c=this.defaultHeaders,u=s&&s.httpHeaderAccept;void 0===u&&(u=this.configuration.selectHeaderAccept(["application/json"])),void 0!==u&&(c=c.set("Accept",u));let h=s&&s.context;void 0===h&&(h=new Zs);let f="json";return u&&(f=u.startsWith("text")?"text":this.configuration.isJsonMime(u)?"json":"blob"),this.httpClient.get(`${this.configuration.basePath}/cell-type-tree-model`,{context:h,params:l,responseType:f,withCredentials:this.configuration.withCredentials,headers:c,observe:i,reportProgress:r})}dbStatus(t,i="body",r=!1,s){const o=t.token;let a=new Lr({encoder:this.encoder});null!=o&&(a=this.addToHttpParams(a,o,"token"));let l=this.defaultHeaders,c=s&&s.httpHeaderAccept;void 0===c&&(c=this.configuration.selectHeaderAccept(["application/json"])),void 0!==c&&(l=l.set("Accept",c));let u=s&&s.context;void 0===u&&(u=new Zs);let h="json";return c&&(h=c.startsWith("text")?"text":this.configuration.isJsonMime(c)?"json":"blob"),this.httpClient.get(`${this.configuration.basePath}/db-status`,{context:u,params:a,responseType:h,withCredentials:this.configuration.withCredentials,headers:l,observe:i,reportProgress:r})}getSpatialPlacement(t,i="body",r=!1,s){const o=t.getSpatialPlacementRequest;if(null==o)throw new Error("Required parameter getSpatialPlacementRequest was null or undefined when calling getSpatialPlacement.");let a=this.defaultHeaders,l=s&&s.httpHeaderAccept;void 0===l&&(l=this.configuration.selectHeaderAccept(["application/json"])),void 0!==l&&(a=a.set("Accept",l));let c=s&&s.context;void 0===c&&(c=new Zs);const h=this.configuration.selectHeaderContentType(["application/json"]);void 0!==h&&(a=a.set("Content-Type",h));let f="json";return l&&(f=l.startsWith("text")?"text":this.configuration.isJsonMime(l)?"json":"blob"),this.httpClient.post(`${this.configuration.basePath}/get-spatial-placement`,o,{context:c,responseType:f,withCredentials:this.configuration.withCredentials,headers:a,observe:i,reportProgress:r})}gtexRuiLocations(t,i="body",r=!1,s){const o=t.cache;let a=new Lr({encoder:this.encoder});null!=o&&(a=this.addToHttpParams(a,o,"cache"));let l=this.defaultHeaders,c=s&&s.httpHeaderAccept;void 0===c&&(c=this.configuration.selectHeaderAccept(["application/json"])),void 0!==c&&(l=l.set("Accept",c));let u=s&&s.context;void 0===u&&(u=new Zs);let h="json";return c&&(h=c.startsWith("text")?"text":this.configuration.isJsonMime(c)?"json":"blob"),this.httpClient.get(`${this.configuration.basePath}/gtex/rui_locations.jsonld`,{context:u,params:a,responseType:h,withCredentials:this.configuration.withCredentials,headers:l,observe:i,reportProgress:r})}hubmapRuiLocations(t,i="body",r=!1,s){const o=t.cache,a=t.token;let l=new Lr({encoder:this.encoder});null!=o&&(l=this.addToHttpParams(l,o,"cache")),null!=a&&(l=this.addToHttpParams(l,a,"token"));let c=this.defaultHeaders,u=s&&s.httpHeaderAccept;void 0===u&&(u=this.configuration.selectHeaderAccept(["application/json"])),void 0!==u&&(c=c.set("Accept",u));let h=s&&s.context;void 0===h&&(h=new Zs);let f="json";return u&&(f=u.startsWith("text")?"text":this.configuration.isJsonMime(u)?"json":"blob"),this.httpClient.get(`${this.configuration.basePath}/hubmap/rui_locations.jsonld`,{context:h,params:l,responseType:f,withCredentials:this.configuration.withCredentials,headers:c,observe:i,reportProgress:r})}ontologyTermOccurences(t,i="body",r=!1,s){const o=t.age,a=t.ageRange,l=t.bmi,c=t.bmiRange,u=t.cache,h=t.ontologyTerms,f=t.cellTypeTerms,g=t.providers,m=t.sex,v=t.spatial,x=t.technologies,U=t.token;let D=new Lr({encoder:this.encoder});null!=o&&(D=this.addToHttpParams(D,o,"age")),null!=a&&(D=this.addToHttpParams(D,a,"age-range")),null!=l&&(D=this.addToHttpParams(D,l,"bmi")),null!=c&&(D=this.addToHttpParams(D,c,"bmi-range")),null!=u&&(D=this.addToHttpParams(D,u,"cache")),h&&h.forEach(Ve=>{D=this.addToHttpParams(D,Ve,"ontology-terms")}),f&&f.forEach(Ve=>{D=this.addToHttpParams(D,Ve,"cell-type-terms")}),g&&g.forEach(Ve=>{D=this.addToHttpParams(D,Ve,"providers")}),null!=m&&(D=this.addToHttpParams(D,m,"sex")),v&&v.forEach(Ve=>{D=this.addToHttpParams(D,Ve,"spatial")}),x&&x.forEach(Ve=>{D=this.addToHttpParams(D,Ve,"technologies")}),null!=U&&(D=this.addToHttpParams(D,U,"token"));let ie=this.defaultHeaders,_e=s&&s.httpHeaderAccept;void 0===_e&&(_e=this.configuration.selectHeaderAccept(["application/json"])),void 0!==_e&&(ie=ie.set("Accept",_e));let Pe=s&&s.context;void 0===Pe&&(Pe=new Zs);let Ne="json";return _e&&(Ne=_e.startsWith("text")?"text":this.configuration.isJsonMime(_e)?"json":"blob"),this.httpClient.get(`${this.configuration.basePath}/ontology-term-occurences`,{context:Pe,params:D,responseType:Ne,withCredentials:this.configuration.withCredentials,headers:ie,observe:i,reportProgress:r})}ontologyTreeModel(t,i="body",r=!1,s){const o=t.cache,a=t.token;let l=new Lr({encoder:this.encoder});null!=o&&(l=this.addToHttpParams(l,o,"cache")),null!=a&&(l=this.addToHttpParams(l,a,"token"));let c=this.defaultHeaders,u=s&&s.httpHeaderAccept;void 0===u&&(u=this.configuration.selectHeaderAccept(["application/json"])),void 0!==u&&(c=c.set("Accept",u));let h=s&&s.context;void 0===h&&(h=new Zs);let f="json";return u&&(f=u.startsWith("text")?"text":this.configuration.isJsonMime(u)?"json":"blob"),this.httpClient.get(`${this.configuration.basePath}/ontology-tree-model`,{context:h,params:l,responseType:f,withCredentials:this.configuration.withCredentials,headers:c,observe:i,reportProgress:r})}providerNames(t,i="body",r=!1,s){const o=t.cache,a=t.token;let l=new Lr({encoder:this.encoder});null!=o&&(l=this.addToHttpParams(l,o,"cache")),null!=a&&(l=this.addToHttpParams(l,a,"token"));let c=this.defaultHeaders,u=s&&s.httpHeaderAccept;void 0===u&&(u=this.configuration.selectHeaderAccept(["application/json"])),void 0!==u&&(c=c.set("Accept",u));let h=s&&s.context;void 0===h&&(h=new Zs);let f="json";return u&&(f=u.startsWith("text")?"text":this.configuration.isJsonMime(u)?"json":"blob"),this.httpClient.get(`${this.configuration.basePath}/provider-names`,{context:h,params:l,responseType:f,withCredentials:this.configuration.withCredentials,headers:c,observe:i,reportProgress:r})}referenceOrganScene(t,i="body",r=!1,s){const o=t.organIri;if(null==o)throw new Error("Required parameter organIri was null or undefined when calling referenceOrganScene.");const a=t.age,l=t.ageRange,c=t.bmi,u=t.bmiRange,h=t.cache,f=t.ontologyTerms,g=t.cellTypeTerms,m=t.providers,v=t.sex,x=t.spatial,U=t.technologies,D=t.token;let ie=new Lr({encoder:this.encoder});null!=a&&(ie=this.addToHttpParams(ie,a,"age")),null!=l&&(ie=this.addToHttpParams(ie,l,"age-range")),null!=c&&(ie=this.addToHttpParams(ie,c,"bmi")),null!=u&&(ie=this.addToHttpParams(ie,u,"bmi-range")),null!=h&&(ie=this.addToHttpParams(ie,h,"cache")),f&&f.forEach(bt=>{ie=this.addToHttpParams(ie,bt,"ontology-terms")}),g&&g.forEach(bt=>{ie=this.addToHttpParams(ie,bt,"cell-type-terms")}),null!=o&&(ie=this.addToHttpParams(ie,o,"organ-iri")),m&&m.forEach(bt=>{ie=this.addToHttpParams(ie,bt,"providers")}),null!=v&&(ie=this.addToHttpParams(ie,v,"sex")),x&&x.forEach(bt=>{ie=this.addToHttpParams(ie,bt,"spatial")}),U&&U.forEach(bt=>{ie=this.addToHttpParams(ie,bt,"technologies")}),null!=D&&(ie=this.addToHttpParams(ie,D,"token"));let _e=this.defaultHeaders,Pe=s&&s.httpHeaderAccept;void 0===Pe&&(Pe=this.configuration.selectHeaderAccept(["application/json"])),void 0!==Pe&&(_e=_e.set("Accept",Pe));let Ne=s&&s.context;void 0===Ne&&(Ne=new Zs);let Ve="json";return Pe&&(Ve=Pe.startsWith("text")?"text":this.configuration.isJsonMime(Pe)?"json":"blob"),this.httpClient.get(`${this.configuration.basePath}/reference-organ-scene`,{context:Ne,params:ie,responseType:Ve,withCredentials:this.configuration.withCredentials,headers:_e,observe:i,reportProgress:r})}referenceOrgans(t,i="body",r=!1,s){const o=t.cache,a=t.token;let l=new Lr({encoder:this.encoder});null!=o&&(l=this.addToHttpParams(l,o,"cache")),null!=a&&(l=this.addToHttpParams(l,a,"token"));let c=this.defaultHeaders,u=s&&s.httpHeaderAccept;void 0===u&&(u=this.configuration.selectHeaderAccept(["application/json"])),void 0!==u&&(c=c.set("Accept",u));let h=s&&s.context;void 0===h&&(h=new Zs);let f="json";return u&&(f=u.startsWith("text")?"text":this.configuration.isJsonMime(u)?"json":"blob"),this.httpClient.get(`${this.configuration.basePath}/reference-organs`,{context:h,params:l,responseType:f,withCredentials:this.configuration.withCredentials,headers:c,observe:i,reportProgress:r})}scene(t,i="body",r=!1,s){const o=t.age,a=t.ageRange,l=t.bmi,c=t.bmiRange,u=t.cache,h=t.ontologyTerms,f=t.cellTypeTerms,g=t.providers,m=t.sex,v=t.spatial,x=t.technologies,U=t.token;let D=new Lr({encoder:this.encoder});null!=o&&(D=this.addToHttpParams(D,o,"age")),null!=a&&(D=this.addToHttpParams(D,a,"age-range")),null!=l&&(D=this.addToHttpParams(D,l,"bmi")),null!=c&&(D=this.addToHttpParams(D,c,"bmi-range")),null!=u&&(D=this.addToHttpParams(D,u,"cache")),h&&h.forEach(Ve=>{D=this.addToHttpParams(D,Ve,"ontology-terms")}),f&&f.forEach(Ve=>{D=this.addToHttpParams(D,Ve,"cell-type-terms")}),g&&g.forEach(Ve=>{D=this.addToHttpParams(D,Ve,"providers")}),null!=m&&(D=this.addToHttpParams(D,m,"sex")),v&&v.forEach(Ve=>{D=this.addToHttpParams(D,Ve,"spatial")}),x&&x.forEach(Ve=>{D=this.addToHttpParams(D,Ve,"technologies")}),null!=U&&(D=this.addToHttpParams(D,U,"token"));let ie=this.defaultHeaders,_e=s&&s.httpHeaderAccept;void 0===_e&&(_e=this.configuration.selectHeaderAccept(["application/json"])),void 0!==_e&&(ie=ie.set("Accept",_e));let Pe=s&&s.context;void 0===Pe&&(Pe=new Zs);let Ne="json";return _e&&(Ne=_e.startsWith("text")?"text":this.configuration.isJsonMime(_e)?"json":"blob"),this.httpClient.get(`${this.configuration.basePath}/scene`,{context:Pe,params:D,responseType:Ne,withCredentials:this.configuration.withCredentials,headers:ie,observe:i,reportProgress:r})}sparql(t,i="body",r=!1,s){const o=t.query;if(null==o)throw new Error("Required parameter query was null or undefined when calling sparql.");const a=t.token,l=t.format;let c=new Lr({encoder:this.encoder});null!=o&&(c=this.addToHttpParams(c,o,"query")),null!=a&&(c=this.addToHttpParams(c,a,"token")),null!=l&&(c=this.addToHttpParams(c,l,"format"));let u=this.defaultHeaders,h=s&&s.httpHeaderAccept;void 0===h&&(h=this.configuration.selectHeaderAccept(["application/json"])),void 0!==h&&(u=u.set("Accept",h));let f=s&&s.context;void 0===f&&(f=new Zs);let g="json";return h&&(g=h.startsWith("text")?"text":this.configuration.isJsonMime(h)?"json":"blob"),this.httpClient.get(`${this.configuration.basePath}/sparql`,{context:f,params:c,responseType:g,withCredentials:this.configuration.withCredentials,headers:u,observe:i,reportProgress:r})}sparqlPost(t,i="body",r=!1,s){const o=t.sparqlQueryRequest;if(null==o)throw new Error("Required parameter sparqlQueryRequest was null or undefined when calling sparqlPost.");const a=t.token,l=t.format;let c=new Lr({encoder:this.encoder});null!=a&&(c=this.addToHttpParams(c,a,"token")),null!=l&&(c=this.addToHttpParams(c,l,"format"));let u=this.defaultHeaders,h=s&&s.httpHeaderAccept;void 0===h&&(h=this.configuration.selectHeaderAccept(["application/json"])),void 0!==h&&(u=u.set("Accept",h));let f=s&&s.context;void 0===f&&(f=new Zs);const m=this.configuration.selectHeaderContentType(["application/json","application/x-www-form-urlencoded"]);void 0!==m&&(u=u.set("Content-Type",m));let v="json";return h&&(v=h.startsWith("text")?"text":this.configuration.isJsonMime(h)?"json":"blob"),this.httpClient.post(`${this.configuration.basePath}/sparql`,o,{context:f,params:c,responseType:v,withCredentials:this.configuration.withCredentials,headers:u,observe:i,reportProgress:r})}technologyNames(t,i="body",r=!1,s){const o=t.cache,a=t.token;let l=new Lr({encoder:this.encoder});null!=o&&(l=this.addToHttpParams(l,o,"cache")),null!=a&&(l=this.addToHttpParams(l,a,"token"));let c=this.defaultHeaders,u=s&&s.httpHeaderAccept;void 0===u&&(u=this.configuration.selectHeaderAccept(["application/json"])),void 0!==u&&(c=c.set("Accept",u));let h=s&&s.context;void 0===h&&(h=new Zs);let f="json";return u&&(f=u.startsWith("text")?"text":this.configuration.isJsonMime(u)?"json":"blob"),this.httpClient.get(`${this.configuration.basePath}/technology-names`,{context:h,params:l,responseType:f,withCredentials:this.configuration.withCredentials,headers:c,observe:i,reportProgress:r})}tissueBlocks(t,i="body",r=!1,s){const o=t.age,a=t.ageRange,l=t.bmi,c=t.bmiRange,u=t.cache,h=t.ontologyTerms,f=t.cellTypeTerms,g=t.providers,m=t.sex,v=t.spatial,x=t.technologies,U=t.token;let D=new Lr({encoder:this.encoder});null!=o&&(D=this.addToHttpParams(D,o,"age")),null!=a&&(D=this.addToHttpParams(D,a,"age-range")),null!=l&&(D=this.addToHttpParams(D,l,"bmi")),null!=c&&(D=this.addToHttpParams(D,c,"bmi-range")),null!=u&&(D=this.addToHttpParams(D,u,"cache")),h&&h.forEach(Ve=>{D=this.addToHttpParams(D,Ve,"ontology-terms")}),f&&f.forEach(Ve=>{D=this.addToHttpParams(D,Ve,"cell-type-terms")}),g&&g.forEach(Ve=>{D=this.addToHttpParams(D,Ve,"providers")}),null!=m&&(D=this.addToHttpParams(D,m,"sex")),v&&v.forEach(Ve=>{D=this.addToHttpParams(D,Ve,"spatial")}),x&&x.forEach(Ve=>{D=this.addToHttpParams(D,Ve,"technologies")}),null!=U&&(D=this.addToHttpParams(D,U,"token"));let ie=this.defaultHeaders,_e=s&&s.httpHeaderAccept;void 0===_e&&(_e=this.configuration.selectHeaderAccept(["application/json"])),void 0!==_e&&(ie=ie.set("Accept",_e));let Pe=s&&s.context;void 0===Pe&&(Pe=new Zs);let Ne="json";return _e&&(Ne=_e.startsWith("text")?"text":this.configuration.isJsonMime(_e)?"json":"blob"),this.httpClient.get(`${this.configuration.basePath}/tissue-blocks`,{context:Pe,params:D,responseType:Ne,withCredentials:this.configuration.withCredentials,headers:ie,observe:i,reportProgress:r})}}return n.\u0275fac=function(t){return new(t||n)(Ie(_u),Ie(C9,8),Ie(Yb,8))},n.\u0275prov=We({factory:function(){return new n(Ie(_u),Ie(C9,8),Ie(Yb,8))},token:n,providedIn:"root"}),n})(),pRe=(()=>{class n{constructor(t,i){if(t)throw new Error("CcfApiModule is already loaded. Import in your base AppModule only.");if(!i)throw new Error("You need to import the HttpClientModule in your AppModule! \nSee also https://github.com/angular/angular/issues/20575")}static forRoot(t){return{ngModule:n,providers:[{provide:Yb,useFactory:t}]}}}return n.\u0275fac=function(t){return new(t||n)(Ie(n,12),Ie(_u,8))},n.\u0275mod=tn({type:n}),n.\u0275inj=St({providers:[],imports:[[]]}),n})();function vu(n){return new Promise((e,t)=>{n.oncomplete=n.onsuccess=()=>e(n.result),n.onabort=n.onerror=()=>t(n.error)})}let Ak;function Cc(){return Ak||(Ak=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),vu(i)});return(i,r)=>t.then(s=>r(s.transaction(e,i).objectStore(e)))}(0,"keyval")),Ak}function A9(n,e=Cc()){return e("readonly",t=>vu(t.get(n)))}var Un=et(1440);const a1="Unknown Euler angle order",Hm=.99999;class Zi extends mx{static get ZYX(){return 0}static get YXZ(){return 1}static get XZY(){return 2}static get ZXY(){return 3}static get YZX(){return 4}static get XYZ(){return 5}static get RollPitchYaw(){return 0}static get DefaultOrder(){return Zi.ZYX}static get RotationOrders(){return["ZYX","YXZ","XZY","ZXY","YZX","XYZ"]}static rotationOrder(e){return Zi.RotationOrders[e]}get ELEMENTS(){return 4}constructor(e=0,t=0,i=0,r=Zi.DefaultOrder){super(-0,-0,-0,-0),arguments.length>0&&Array.isArray(arguments[0])?this.fromVector3(...arguments):this.set(e,t,i,r)}fromQuaternion(e){const[t,i,r,s]=e,o=i*i,a=-2*(o+r*r)+1,l=2*(t*i+s*r);let c=-2*(t*r-s*i);c=c>1?1:c,c=c<-1?-1:c;const f=Math.atan2(2*(i*r+s*t),-2*(t*t+o)+1),g=Math.asin(c),m=Math.atan2(l,a);return new Zi(f,g,m,Zi.RollPitchYaw)}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=Number.isFinite(e[3])||this.order,this.check()}set(e=0,t=0,i=0,r){return this[0]=e,this[1]=t,this[2]=i,this[3]=Number.isFinite(r)?r:this[3],this.check()}validate(){return function(n){return n>=0&&n<6}(this[3])&&Number.isFinite(this[0])&&Number.isFinite(this[1])&&Number.isFinite(this[2])}toArray(e=[],t=0){return e[t]=this[0],e[t+1]=this[1],e[t+2]=this[2],e}toArray4(e=[],t=0){return e[t]=this[0],e[t+1]=this[1],e[t+2]=this[2],e[t+3]=this[3],e}toVector3(e=[-0,-0,-0]){return e[0]=this[0],e[1]=this[1],e[2]=this[2],e}get x(){return this[0]}set x(e){this[0]=nr(e)}get y(){return this[1]}set y(e){this[1]=nr(e)}get z(){return this[2]}set z(e){this[2]=nr(e)}get alpha(){return this[0]}set alpha(e){this[0]=nr(e)}get beta(){return this[1]}set beta(e){this[1]=nr(e)}get gamma(){return this[2]}set gamma(e){this[2]=nr(e)}get phi(){return this[0]}set phi(e){this[0]=nr(e)}get theta(){return this[1]}set theta(e){this[1]=nr(e)}get psi(){return this[2]}set psi(e){this[2]=nr(e)}get roll(){return this[0]}set roll(e){this[0]=nr(e)}get pitch(){return this[1]}set pitch(e){this[1]=nr(e)}get yaw(){return this[2]}set yaw(e){this[2]=nr(e)}get order(){return this[3]}set order(e){this[3]=function(n){if(n<0&&n>=6)throw new Error(a1);return n}(e)}fromVector3(e,t){return this.set(e[0],e[1],e[2],Number.isFinite(t)?t:this[3])}fromArray(e,t=0){return this[0]=e[0+t],this[1]=e[1+t],this[2]=e[2+t],void 0!==e[3]&&(this[3]=e[3]),this.check()}fromRollPitchYaw(e,t,i){return this.set(e,t,i,Zi.ZYX)}fromRotationMatrix(e,t=Zi.DefaultOrder){return this._fromRotationMatrix(e,t),this.check()}getRotationMatrix(e){return this._getRotationMatrix(e)}getQuaternion(){const e=new mR;switch(this[4]){case Zi.XYZ:return e.rotateX(this[0]).rotateY(this[1]).rotateZ(this[2]);case Zi.YXZ:return e.rotateY(this[0]).rotateX(this[1]).rotateZ(this[2]);case Zi.ZXY:return e.rotateZ(this[0]).rotateX(this[1]).rotateY(this[2]);case Zi.ZYX:return e.rotateZ(this[0]).rotateY(this[1]).rotateX(this[2]);case Zi.YZX:return e.rotateY(this[0]).rotateZ(this[1]).rotateX(this[2]);case Zi.XZY:return e.rotateX(this[0]).rotateZ(this[1]).rotateY(this[2]);default:throw new Error(a1)}}_fromRotationMatrix(e,t=Zi.DefaultOrder){const i=e.elements,r=i[0],s=i[4],o=i[8],a=i[1],l=i[5],c=i[9],u=i[2],h=i[6],f=i[10];switch(t=t||this[3]){case Zi.XYZ:this[1]=Math.asin(Ua(o,-1,1)),Math.abs(o)1&&void 0!==arguments[1]?arguments[1]:0,t=(co[n[e+0]]+co[n[e+1]]+co[n[e+2]]+co[n[e+3]]+"-"+co[n[e+4]]+co[n[e+5]]+"-"+co[n[e+6]]+co[n[e+7]]+"-"+co[n[e+8]]+co[n[e+9]]+"-"+co[n[e+10]]+co[n[e+11]]+co[n[e+12]]+co[n[e+13]]+co[n[e+14]]+co[n[e+15]]).toLowerCase();if(!DRe(t))throw TypeError("Stringified UUID is invalid");return t}(i)};var c1=et(1609);const Gm=Object.freeze({OUTSIDE:-1,INTERSECTING:0,INSIDE:1}),Rr=(Math,Math,{});function LRe(n,{precision:e=Rr.precision||4}={}){return n=function(n){return Math.round(n/Rr.EPSILON)*Rr.EPSILON}(n),"".concat(parseFloat(n.toPrecision(e)))}function Mh(n){return Array.isArray(n)||ArrayBuffer.isView(n)&&!(n instanceof DataView)}function Xb(n,e,t){const i=Rr.EPSILON;t&&(Rr.EPSILON=t);try{if(n===e)return!0;if(Mh(n)&&Mh(e)){if(n.length!==e.length)return!1;for(let r=0;r0?", ":"")+LRe(this[i],e);return"".concat(e.printTypes?this.constructor.name:"","[").concat(t,"]")}equals(e){if(!e||this.length!==e.length)return!1;for(let t=0;t=0&&e=0&&e=a+s)return this.clone();if(s>=a+i)return e.clone();const l=.5*(i+a+s);return P9.copy(o).scale((-i+l)/a).add(t),this.center.copy(P9),this.radius=l,this}expand(e){const t=(e=Kb.from(e)).subtract(this.center).magnitude();return t>this.radius&&(this.radius=t),this}transform(e){this.center.transform(e);const t=function(n,e){var s=e[4],o=e[5],a=e[6],l=e[8],c=e[9],u=e[10];return n[0]=Math.hypot(e[0],e[1],e[2]),n[1]=Math.hypot(s,o,a),n[2]=Math.hypot(l,c,u),n}(Kb,e);return this.radius=Math.max(t[0],Math.max(t[1],t[2]))*this.radius,this}distanceSquaredTo(e){const t=this.distanceTo(e);return t*t}distanceTo(e){const t=(e=Kb.from(e)).subtract(this.center);return Math.max(0,t.len()-this.radius)}intersectPlane(e){const i=this.radius,s=e.normal.dot(this.center)+e.distance;return s<-i?Gm.OUTSIDE:s0?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 sH(this,this,e),this.check()}rotateY(e){return oH(this,this,e),this.check()}rotateZ(e){return aH(this,this,e),this.check()}scale(e){return pR(this,this,e),this.check()}slerp(e,t,i){switch(arguments.length){case 1:({start:e=JRe,target:t,ratio:i}=arguments[0]);break;case 2:[t,i]=arguments,e=this}return nb(this,e,t,i),this.check()}transformVector4(e,t=e){return OU(t,e,this),M9(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)}}const ePe=new Pn,tPe=new Pn,u1=new Pn,d1=new Pn,h1=new Pn,nPe=new Pn,iPe=new Pn;class Nk{constructor(e=[0,0,0],t=[0,0,0,0,0,0,0,0,0]){this.center=(new Pn).from(e),this.halfAxes=new Zo(t)}get halfSize(){const e=this.halfAxes.getColumn(0),t=this.halfAxes.getColumn(1),i=this.halfAxes.getColumn(2);return[new Pn(e).len(),new Pn(t).len(),new Pn(i).len()]}get quaternion(){const e=this.halfAxes.getColumn(0),t=this.halfAxes.getColumn(1),i=this.halfAxes.getColumn(2),r=new Pn(e).normalize(),s=new Pn(t).normalize(),o=new Pn(i).normalize();return(new k9).fromMatrix3(new Zo([...r,...s,...o]))}fromCenterHalfSizeQuaternion(e,t,i){const r=new k9(i),s=(new Zo).fromQuaternion(r);return s[0]=s[0]*t[0],s[1]=s[1]*t[0],s[2]=s[2]*t[0],s[3]=s[3]*t[1],s[4]=s[4]*t[1],s[5]=s[5]*t[1],s[6]=s[6]*t[2],s[7]=s[7]*t[2],s[8]=s[8]*t[2],this.center=(new Pn).from(e),this.halfAxes=s,this}clone(){return new Nk(this.center,this.halfAxes)}equals(e){return this===e||Boolean(e)&&this.center.equals(e.center)&&this.halfAxes.equals(e.halfAxes)}getBoundingSphere(e=new Pk){const t=this.halfAxes,i=t.getColumn(0,u1),r=t.getColumn(1,d1),s=t.getColumn(2,h1),o=ePe.copy(i).add(r).add(s);return e.center.copy(this.center),e.radius=o.magnitude(),e}intersectPlane(e){const t=this.center,i=e.normal,r=this.halfAxes,s=i.x,o=i.y,a=i.z,l=Math.abs(s*r[0]+o*r[1]+a*r[2])+Math.abs(s*r[3]+o*r[4]+a*r[5])+Math.abs(s*r[6]+o*r[7]+a*r[8]),c=i.dot(t)+e.distance;return c<=-l?Gm.OUTSIDE:c>=l?Gm.INSIDE:Gm.INTERSECTING}distanceTo(e){return Math.sqrt(this.distanceSquaredTo(e))}distanceSquaredTo(e){const t=tPe.from(e).subtract(this.center),i=this.halfAxes,r=i.getColumn(0,u1),s=i.getColumn(1,d1),o=i.getColumn(2,h1),a=r.magnitude(),l=s.magnitude(),c=o.magnitude();r.normalize(),s.normalize(),o.normalize();let h,u=0;return h=Math.abs(t.dot(r))-a,h>0&&(u+=h*h),h=Math.abs(t.dot(s))-l,h>0&&(u+=h*h),h=Math.abs(t.dot(o))-c,h>0&&(u+=h*h),u}computePlaneDistances(e,t,i=[-0,-0]){let r=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY;const o=this.center,a=this.halfAxes,l=a.getColumn(0,u1),c=a.getColumn(1,d1),u=a.getColumn(2,h1),h=nPe.copy(l).add(c).add(u).add(o),f=iPe.copy(h).subtract(e);let g=t.dot(f);return r=Math.min(g,r),s=Math.max(g,s),h.copy(o).add(l).add(c).subtract(u),f.copy(h).subtract(e),g=t.dot(f),r=Math.min(g,r),s=Math.max(g,s),h.copy(o).add(l).subtract(c).add(u),f.copy(h).subtract(e),g=t.dot(f),r=Math.min(g,r),s=Math.max(g,s),h.copy(o).add(l).subtract(c).subtract(u),f.copy(h).subtract(e),g=t.dot(f),r=Math.min(g,r),s=Math.max(g,s),o.copy(h).subtract(l).add(c).add(u),f.copy(h).subtract(e),g=t.dot(f),r=Math.min(g,r),s=Math.max(g,s),o.copy(h).subtract(l).add(c).subtract(u),f.copy(h).subtract(e),g=t.dot(f),r=Math.min(g,r),s=Math.max(g,s),o.copy(h).subtract(l).subtract(c).add(u),f.copy(h).subtract(e),g=t.dot(f),r=Math.min(g,r),s=Math.max(g,s),o.copy(h).subtract(l).subtract(c).subtract(u),f.copy(h).subtract(e),g=t.dot(f),r=Math.min(g,r),s=Math.max(g,s),i[0]=r,i[1]=s,i}transform(e){this.center.transformAsPoint(e);const t=this.halfAxes.getColumn(0,u1);t.transformAsPoint(e);const i=this.halfAxes.getColumn(1,d1);i.transformAsPoint(e);const r=this.halfAxes.getColumn(2,h1);return r.transformAsPoint(e),this.halfAxes=new Zo([...t,...i,...r]),this}getTransform(){throw new Error("not implemented")}}const F9=new Pn,L9=new Pn;class kk{constructor(e=[0,0,1],t=0){this.normal=new Pn,this.distance=-0,this.fromNormalDistance(e,t)}fromNormalDistance(e,t){return Tc(Number.isFinite(t)),this.normal.from(e).normalize(),this.distance=t,this}fromPointNormal(e,t){e=F9.from(e),this.normal.from(t).normalize();const i=-this.normal.dot(e);return this.distance=i,this}fromCoefficients(e,t,i,r){return this.normal.set(e,t,i),Tc(Xb(this.normal.len(),1)),this.distance=r,this}clone(e){return new kk(this.normal,this.distance)}equals(e){return Xb(this.distance,e.distance)&&Xb(this.normal,e.normal)}getPointDistance(e){return this.normal.dot(e)+this.distance}transform(e){const t=L9.copy(this.normal).transformAsVector(e).normalize(),i=this.normal.scale(-this.distance).transform(e);return this.fromPointNormal(i,t)}projectPointOntoPlane(e,t=[0,0,0]){e=F9.from(e);const i=this.getPointDistance(e),r=L9.copy(this.normal).scale(i);return e.subtract(r).to(t)}}function*Uk(n,e,t){for(const[i,r]of Object.entries(t))for(const s of(0,Un.readQuads)(n,e,i,null,null)){const o="Literal"===s.object.termType?(0,c1.fromRdf)(s.object):s.object.id;yield[r,o]}}function dp(n,e,t,i){const r={"@id":e,"@type":t};for(const[s,o]of Object.entries(i))for(const a of(0,Un.readQuads)(n,r["@id"],s,null,null)){const l="Literal"===a.object.termType?(0,c1.fromRdf)(a.object):a.object.id;r[o]=l}return r}new Pn([1,0,0]),new Pn([0,1,0]),new Pn([0,0,1]),new Pn,new Pn,new kk(new Pn(1,0,0),0),new Pn,new Pn,new Pn,new Pn,new Pn,new Pn,new Pn,new Pn,new Pn,new Pn,new Pn,new Pn,new Pn,new Pn,new Pn,new Pn,new Pn,Math,new Zo,new Zo,new Zo,new Zo,new Zo,new Pn,new Pn,new Pn,new Pn,new Pn,new Zo,new Zo,new Zo;const ir=Un.Util.prefixes({base:"http://purl.org/ccf/latest/ccf.owl#",ccf:"http://purl.org/ccf/",fma:"http://purl.org/sig/ont/fma/fma",obo:"http://purl.obolibrary.org/obo/",uberon:"http://purl.obolibrary.org/obo/UBERON_",cl:"http://purl.obolibrary.org/obo/CL_",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/",dcterms:"http://purl.org/dc/terms/"},Un.DataFactory),U9={x:ir("rdf"),type:ir("rdf")("type")},dn=(ir("rdfs"),ir("rdfs")("label"),ir("rdfs")("comment"),ir("rdfs")("isDefinedBy"),ir("rdfs")("seeAlso"),ir("ccf")),vi={id:ir("ccf")("has_registration_location"),label:ir("rdfs")("label"),description:ir("rdfs")("comment"),link:dn("url"),sex:dn("sex"),age:dn("age"),bmi:dn("bmi"),Male:Un.DataFactory.literal("Male"),Female:Un.DataFactory.literal("Female"),consortiumName:dn("consortium_name"),providerName:dn("tissue_provider_name"),providerUUID:dn("tissue_provider_uuid"),donor:dn("comes_from"),sections:dn("subdivided_into_sections"),datasets:dn("generates_dataset"),sampleType:dn("sample_type"),TissueBlock:Un.DataFactory.literal("Tissue Block"),TissueSection:Un.DataFactory.literal("Tissue Section"),NonStandard:Un.DataFactory.literal("Non-standard"),sectionCount:dn("section_count"),sectionSize:dn("section_size"),sectionUnits:dn("section_size_unit"),sectionNumber:dn("section_number"),spatialEntity:dn("has_registration_location"),ontologyTerms:dn("has_ontology_term"),cellTypeTerms:dn("has_cell_type_term"),technology:dn("technology"),thumbnail:dn("thumbnail")},ki={x:dn,base:ir("base"),ontologyNode:{label:dn("ccf_pref_label"),parent:dn("ccf_part_of"),children:dn("ccf_part_of"),rui_rank:dn("rui_rank"),synonymLabels:Un.DataFactory.namedNode("http://www.geneontology.org/formats/oboInOwl#hasExactSynonym")},asctb:{part_of:dn("ccf_part_of"),ct_is_a:dn("ccf_ct_isa"),located_in:dn("ccf_located_in"),characterizes:dn("ccf_characterizes")},spatial:{Female:ir("base")("VHFemale"),Male:ir("base")("VHMale"),BothSexes:ir("base")("VHBothSexes"),FemaleOrgans:ir("base")("VHFemaleOrgans"),MaleOrgans:ir("base")("VHMaleOrgans")},SpatialObjectReference:dn("spatial_object_reference"),SpatialEntity:dn("spatial_entity"),SpatialPlacement:dn("spatial_placement"),spatialObjectReference:{file:dn("file_url"),file_format:dn("file_format"),file_subpath:dn("file_subpath")},extractionSet:{label:ir("rdfs")("label"),rui_rank:dn("rui_rank")},spatialEntity:{label:ir("rdfs")("label"),description:ir("rdfs")("comment"),creator:ir("dcterms")("creator"),creator_first_name:dn("creator_first_name"),creator_last_name:dn("creator_last_name"),creator_orcid:dn("creator_orcid"),creation_date:ir("dcterms")("created"),updated_date:dn("updated_date"),ccf_annotations:dn("collides_with"),representation_of:dn("representation_of"),reference_organ:dn("has_reference_organ"),extraction_set_for:dn("extraction_set_for"),extraction_set:dn("has_extraction_set"),sex:dn("organ_owner_sex"),side:dn("organ_side"),rui_rank:dn("rui_rank"),slice_thickness:dn("slice_thickness"),slice_count:dn("slice_count"),x_dimension:dn("x_dimension"),y_dimension:dn("y_dimension"),z_dimension:dn("z_dimension"),dimension_units:dn("dimension_unit"),object:dn("has_object_reference")},spatialPlacement:{source:dn("placement_for"),target:dn("placement_relative_to"),placement_date:ir("dcterms")("created"),x_scaling:dn("x_scaling"),y_scaling:dn("y_scaling"),z_scaling:dn("z_scaling"),scaling_units:dn("scaling_unit"),x_rotation:dn("x_rotation"),y_rotation:dn("y_rotation"),z_rotation:dn("z_rotation"),w_rotation:dn("theta_rotation"),rotation_order:dn("rotation_order"),rotation_units:dn("rotation_unit"),x_translation:dn("x_translation"),y_translation:dn("y_translation"),z_translation:dn("z_translation"),translation_units:dn("translation_unit")}},di={x:ir("uberon"),body:ir("uberon")("0013702")},NPe={x:ir("cl"),cell:ir("cl")("0000000")},Zb={x:ir("fma")},vd=(ir("lmha"),{body:di.body,cell:NPe.cell,respiratory_system:di.x("0001004"),colon:di.x("0001155"),left_lung:di.x("0002168"),right_lung:di.x("0002167"),left_bronchus:di.x("0002178"),right_bronchus:di.x("0002177"),kidney:di.x("0002113"),ureter:di.x("0000056"),eye:di.x("0000970"),fallopian_tube:di.x("0003889"),knee:di.x("0001465"),ovary:di.x("0000992"),trachea:di.x("0003126"),aorta:di.x("0000947"),blood:di.x("0000178"),bone_marrow:di.x("0002371"),male_reproductive_system:di.x("0000079"),lymph_node:di.x("0000029"),blood_vasculature:di.x("0004537"),brain:di.x("0000955"),eye_left:di.x("0004548"),eye_right:Zb.x("54449"),fallopian_tube_left:di.x("0001303"),fallopian_tube_right:di.x("0001302"),heart:di.x("0000948"),kidney_left:di.x("0004538"),kidney_right:di.x("0004539"),knee_left:Zb.x("24978"),knee_right:Zb.x("24977"),large_intestine:di.x("0000059"),liver:di.x("0002107"),lungs:di.x("0002048"),mesenteric_lymph_node:di.x("0002509"),ovary_left:Zb.x("7214"),ovary_right:Zb.x("7213"),pancreas:di.x("0001264"),pelvis:di.x("0001270"),prostate_gland:di.x("0002367"),skin:di.x("0002097"),small_intestine:di.x("0002108"),spleen:di.x("0002106"),thymus:di.x("0002370"),ureter_left:di.x("0001223"),ureter_right:di.x("0001222"),urinary_bladder:di.x("0001255"),uterus:di.x("0000995")});function zk(n){const e={};return Object.entries(n).forEach(([t,i])=>{e[i.id]=t}),e}const p1={spatialObjectReference:zk(ki.spatialObjectReference),spatialEntity:zk(ki.spatialEntity),spatialPlacement:zk(ki.spatialPlacement)};function z9(n,e){const t=dp(n,e,"ExtractionSet",p1.spatialEntity);return t.extractionSites=(0,mr.sortBy)(n.getSubjects(ki.spatialEntity.extraction_set,e,null).map(i=>hp(n,i.id)),["rui_rank"]),t}function hp(n,e){const t=dp(n,e,"SpatialEntity",p1.spatialEntity);return t.object&&(t.object=function(n,e){return dp(n,e,"SpatialObjectReference",p1.spatialObjectReference)}(n,t.object)),t.ccf_annotations&&(t.ccf_annotations=n.getObjects(e,ki.spatialEntity.ccf_annotations,null).map(i=>i.id)),n.forSubjects(i=>t.entityId=i.id,vi.spatialEntity,e,null),t}function VPe(n,e){const t=dp(n,e,"SpatialPlacement",p1.spatialPlacement);return t.source&&(t.source=hp(n,t.source)),t.target&&(t.target=hp(n,t.target)),t}function H9(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(_j),o=[t.x_scaling,t.y_scaling,t.z_scaling];return n.translate(r).rotateXYZ(s).scale(o)}class G9{constructor(e){this.db=e,this.createGraph()}createGraph(){this.graph=new ERe.DirectedGraph;const e=this.db.store;e.forSubjects(i=>{this.addNode(i.id,"SpatialObjectReference")},U9.type,ki.SpatialObjectReference,null),e.forSubjects(i=>{this.addNode(i.id,"SpatialEntity")},U9.type,ki.SpatialEntity,null);const t={};for(const i of(0,Un.readQuads)(e,null,ki.spatialPlacement.source,null,null))t[i.subject.id]=i.object.id;for(const i of(0,Un.readQuads)(e,null,ki.spatialPlacement.target,null,null)){const r=t[i.subject.id];r&&this.addEdge(i.subject.id,r,i.object.id,"SpatialPlacement")}}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 qn(qn.IDENTITY);if(!this.graph.hasNode(e)||!this.graph.hasNode(t))return;const i=this.db.store,r=new qn(qn.IDENTITY),s=SRe()(this.graph,e,t);if(s&&s.length>0){s.reverse();let o="";for(const a of s)o&&H9(r,VPe(i,this.graph.getEdgeAttribute(a,o,"id"))),o=a;return r}}getSpatialPlacement(e,t){const i=this.graph.hasNode(e["@id"])?e["@id"]:void 0,r=(0,mr.get)(e,"placement[0]",(0,mr.get)(e,"placement",void 0));let s;if(r&&this.graph.hasNode(r.target)?(s=this.getTransformationMatrix(r.target,t),s&&(s=H9(s,r))):i&&(s=this.getTransformationMatrix(i,t)),s){const o=(new Zi).fromRotationMatrix(s,Zi.XYZ),a=s.getTranslation().map(u=>1e3*u),l=o.toVector3().map(dse),c=s.getScale().map(u=>u<1&&u>.999999?1:u);return{"@context":"https://hubmapconsortium.github.io/hubmap-ontology/ccf-context.jsonld","@id":`http://purl.org/ccf/1.5/${PRe()}_placement`,"@type":"SpatialPlacement",source:e["@id"],target:t,placement_date:(new Date).toISOString().split("T")[0],x_scaling:c[0],y_scaling:c[1],z_scaling:c[2],scaling_units:"ratio",x_rotation:l[0],y_rotation:l[1],z_rotation:l[2],rotation_order:"XYZ",rotation_units:"degree",x_translation:a[0],y_translation:a[1],z_translation:a[2],translation_units:"millimeter"}}}}class $9{constructor(e){this.db=e}getSpatialEntity(e){return hp(this.db.store,e)}getExtractionSets(e){return function(n,e){return(0,mr.sortBy)(n.getSubjects(ki.spatialEntity.extraction_set_for,e,null).map(t=>z9(n,t.id)),["rui_rank"])}(this.db.store,e)}getExtractionSet(e){return z9(this.db.store,e)}getAnatomicalStructures(e){return function(n,e){return(0,mr.sortBy)(n.getSubjects(ki.spatialEntity.reference_organ,e,null).map(t=>hp(n,t.id)).filter(t=>t["@id"]!==e),["rui_rank"])}(this.db.store,e)}getReferenceOrgans(){return function(n){const e=[];return n.forEach(t=>{t.subject.id===t.object.id&&e.push(hp(n,t.subject.id))},null,ki.spatialEntity.reference_organ,null,null),(0,mr.sortBy)(e,["rui_rank"])}(this.db.store)}getReferenceBody(e){let t;switch(null==e?void 0:e.sex){case"Male":t=ki.spatial.Male.id;break;case"Female":t=ki.spatial.Female.id;break;case"Both":default:t=ki.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),i=[];let r=[...this.getReferenceOrganSets(e).map(s=>{const o="http://purl.obolibrary.org/obo/UBERON_0002097"===s.representation_of,a=this.getSceneNode(s,t,{color:[255,255,255,255],opacity:o?.5:.2,unpickable:!0,_lighting:"pbr",zoomBasedOpacity:!o});return o&&a?void i.push(a):a})];return i.length>0&&(r=[...i,...r]),(null==e?void 0:e.debug)&&(r=r.concat([this.getSceneNode(this.getSpatialEntity(ki.base("VHRightKidney").id),t,{color:[0,0,255,127.5],geometry:"wireframe"}),this.getSceneNode(this.getSpatialEntity(ki.base("VHLeftKidney").id),t,{color:[255,0,0,127.5],geometry:"wireframe"}),this.getSceneNode(this.getSpatialEntity(ki.base("VHSpleenCC1").id),t,{color:[0,255,0,127.5],geometry:"wireframe"}),this.getSceneNode(this.getSpatialEntity(ki.base("VHSpleenCC2").id),t,{color:[0,255,0,127.5],geometry:"wireframe"}),this.getSceneNode(this.getSpatialEntity(ki.base("VHSpleenCC3").id),t,{color:[0,255,0,127.5],geometry:"wireframe"})])),r.filter(s=>void 0!==s)}getReferenceOrganScene(e,t){var i,r;const s=void 0!==(null==t?void 0:t.sex)&&"both"!==(null===(i=null==t?void 0:t.sex)||void 0===i?void 0:i.toLowerCase()),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"}),u=(null!==(r=this.db.getSpatialEntities(t))&&void 0!==r?r:[]).map(h=>this.getSceneNode(h,a,{color:[255,255,255,229.5]}));return[c].concat(u).filter(h=>void 0!==h)}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 u=this.db.graph.getTransformationMatrix(l&&e.object?e.object["@id"]:e["@id"],t["@id"]);if(u){if(l)u=new qn(qn.IDENTITY).rotateX(_j(90)).multiplyLeft(u);else{let h;switch(e.dimension_units){case"centimeter":h=.01;break;case"millimeter":h=.001;break;case"meter":default:h=1}const f=[e.x_dimension,e.y_dimension,e.z_dimension].map(g=>g*h/2);u.scale(f)}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:u,tooltip:e.label},i)}}getScene(e){return[...this.getReferenceSceneNodes(e),...this.getEntitySceneNodes(e)]}}const g1="https://entity.api.hubmapconsortium.org/entities/",W9=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"]),UPe={"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"},qm={"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","5c106f29-ea2d-11e9-85e8-0efb3ba9a670":"RTI-General Electric","301615f9-c870-11eb-a8dc-35ce3d8786fe":"TMC-UConn"},q9={"@base":"http://purl.org/ccf/latest/ccf-entity.owl#","@vocab":"http://purl.org/ccf/latest/ccf-entity.owl#",ccf:"http://purl.org/ccf/",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"},cellTypeTerms:{"@id":"has_cell_type_term","@type":"@id"},thumbnail:{"@id":"has_thumbnail"}};class GPe{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||[],u=(this.data.ancestors||[]).find(Ne=>"Donor"===Ne.entity_type);this.donor=this.getDonor(u,i);const h=this.getRuiLocation(e,this.donor);h?this.rui_location=h:this.bad=!0,qm[e.group_uuid]||(qm[e.group_uuid]=e.group_name);const f=new Date(e.last_modified_timestamp).toLocaleDateString(),g=qm[e.group_uuid]||e.group_name,m=e.created_by_user_displayname;this["@id"]=g1+e.uuid,this.label=`Registered ${f}, ${m}, ${g}`,this.link=`${i}browse/sample/${e.uuid}`;const v={},x=[];this.sections=x;const U=[];this.datasets=U;for(const Ne of c.filter(Ve=>"Sample"===Ve.entity_type)){const Ve=this.getSection(Ne,e,i);v[Ne.submission_id]=Ve,x.push(Ve),Ve.section_number=null!==(s=Ve.section_number)&&void 0!==s?s:x.length}for(const Ne of c)if("Dataset"===Ne.entity_type){const Ve=this.getDataset(Ne,t,i,r),bt=(0,mr.get)(Ne,["ingest_metadata","metadata","tissue_id"]);v[bt]?null===(o=v[bt].datasets)||void 0===o||o.push(Ve):U.push(Ve)}const D=null!=h?h:{},ie=`${D.x_dimension} x ${D.y_dimension} x ${D.z_dimension} ${D.dimension_units}`;this.section_count=D.slice_count||x.length;const _e=parseFloat((D.slice_thickness||(D.z_dimension||0)/Math.max(this.section_count,1)).toFixed(1));this.section_size=_e;const Pe=D.dimension_units||"millimeter";this.section_units=Pe,this.description=`${ie}, ${_e} ${Pe}, ${e.specimen_type}, ${this.section_count} Sections`,x.forEach((Ne,Ve)=>{Ne.description=`${D.x_dimension} x ${D.y_dimension} x ${_e} ${Pe}, ${_e} ${Pe}, ${Ne.description}`,Ne.section_number=Ve+1})}getSection(e,t,i){const r=new Date(e.last_modified_timestamp).toLocaleDateString();return{"@id":g1+e.uuid,"@type":"Sample",label:`Registered ${r}, ${e.created_by_user_displayname}, ${qm[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=qm[e.group_uuid]||e.group_name,l=e.created_by_user_displayname,c=[...e.data_types,(0,mr.get)(e,["ingest_metadata","metadata","assay_type"],"")],u=c.join("|").toLowerCase();let h,f="assets/icons/ico-unknown.svg";return-1!==u.indexOf("10x")?(h="10x",f="assets/icons/ico-bulk-10x.svg"):-1!==u.indexOf("af")?(h="AF",f="assets/icons/ico-spatial-af.svg"):-1!==u.indexOf("codex")?(h="CODEX",f="assets/icons/ico-spatial-codex.svg"):-1!==u.indexOf("imc")?(h="IMC",f="assets/icons/ico-spatial-imc.svg"):-1!==u.indexOf("lc")&&-1===u.indexOf("af")?(h="LC",f="assets/icons/ico-bulk-lc.svg"):h=-1!==u.indexOf("maldi")?"MALDI":-1!==u.indexOf("pas")?"PAS":"OTHER",f=null!==(s=this.getDatasetThumbnail(e,t,r))&&void 0!==s?s:f,{"@id":g1+e.uuid,"@type":"Dataset",label:`Registered ${o}, ${l}, ${a}`,description:`Data/Assay Types: ${c.join(", ")}`,link:`${i}browse/dataset/${e.uuid}`,technology:h,thumbnail:f}}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,mr.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=>W9.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(W9.has(s))return`assets/thumbnails/TMC-Vanderbilt/DR1/${s}`}}else if("07a29e4c-ed43-11e8-b56a-0e8017bdda58"===e.group_uuid){const r=UPe[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,mr.toNumber)(s[1]));for(const f of(0,mr.get)(e,"metadata.organ_donor_data",(0,mr.get)(e,"metadata.living_donor_data",[])))"Feminine gender"===f.preferred_term||"Female"===f.preferred_term?r="Female":"Masculine gender"===f.preferred_term||"Male"===f.preferred_term?r="Male":"Current chronological age"===f.preferred_term||"Age"===f.preferred_term?o=(0,mr.toNumber)(f.data_value):"Body mass index"===f.preferred_term&&(a=(0,mr.toNumber)(f.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(),u=qm[e.group_uuid]||e.group_name;return{"@id":g1+e.uuid,"@type":"Donor",label:l,description:`Entered ${c}, ${e.created_by_user_displayname}, ${u}`,link:`${t}browse/donor/${e.uuid}`,age:o,sex:r,bmi:a,consortium_name:"HuBMAP",provider_name:u,provider_uuid:e.group_uuid,samples:[]}}getRuiLocation(e,t){var i;let r,s=e.rui_location;if(s&&("string"==typeof s&&(s=JSON.parse(s)),s.alignment_id?console.log("Detected a deprecated rui_location",e.uuid):s["@id"]&&(r=s)),r){const o=null!==(i=(0,mr.get)(r,["placement","target"]))&&void 0!==i?i:"";o.startsWith("http://purl.org/ccf/latest/ccf.owl#VHSpleenCC")?(0,mr.set)(r,["placement","target"],o.replace("#VHSpleenCC","Male"===t.sex?"#VHMSpleenCC":"#VHFSpleenCC")):("http://purl.org/ccf/latest/ccf.owl#VHLeftKidney"===o||"http://purl.org/ccf/latest/ccf.owl#VHRightKidney"===o)&&(0,mr.set)(r,["placement","target"],"Male"===t.sex?o.replace("#VH","#VHM")+"_Patch":o.replace("#VH","#VHF")+"_Patch")}return r}getTissueBlock(){return(0,mr.omit)(Object.assign({},this),["data","bad","donor"])}toJsonLd(){return Object.assign(Object.assign({},this.donor),{samples:[this.getTissueBlock()]})}}const WPe=["uuid","entity_type","group_uuid","group_name","last_modified_timestamp","created_by_user_displayname","ancestors.entity_type","ancestors.description","ancestors.metadata.organ_donor_data.preferred_term","ancestors.metadata.organ_donor_data.data_value","ancestors.metadata.living_donor_data.preferred_term","ancestors.metadata.living_donor_data.data_value","ancestors.last_modified_timestamp","ancestors.group_uuid","ancestors.group_name","ancestors.created_by_user_displayname","ancestors.uuid","descendants.entity_type","descendants.ingest_metadata.metadata.tissue_id","descendants.last_modified_timestamp","descendants.group_uuid","descendants.group_name","descendants.created_by_user_displayname","descendants.uuid","descendants.data_types","descendants.ingest_metadata.metadata.assay_type","descendants.thumbnail_file","descendants.metadata.files.rel_path","rui_location","specimen_type"],qPe={exists:{field:"rui_location"}};function Y9(n,e,t){return JSON.stringify({version:!0,from:n,size:e,stored_fields:["*"],script_fields:{},docvalue_fields:[],query:null!=t?t:qPe,_source:{includes:WPe}})}function Hk(n,e){return Bi(this,void 0,void 0,function*(){try{const t=yield fetch(n,e);return t.ok?yield t.json():void 0}catch(t){return}})}function X9(n,e,t,i,r="",s=""){return Bi(this,void 0,void 0,function*(){let o;if("static"===e?o=yield Hk(n):"search-api"===e&&(o=yield function(n,e,t){return Bi(this,void 0,void 0,function*(){const i=250,r=function(n){const e=new Headers;return e.append("Content-type","application/json"),n&&e.append("Authorization",`Bearer ${n}`),e}(e),s=Y9(0,i,t),o=yield Hk(n,{method:"POST",headers:r,body:s});if(!o)return;const a=o.hits.total.value;if(a<=i)return o;const l=[];for(let h=i;h!h))return;const u=c.map(h=>h.hits.hits);return Object.assign(Object.assign({},o),{hits:Object.assign(Object.assign({},o.hits),{hits:o.hits.hits.concat(...u)})})})}(n,i,t)),o)return function(n,e="",t="",i,r=!1){const o={},a=(0,mr.get)(n,"hits.hits",[]).map(c=>(0,mr.get)(c,"_source",{})).sort((c,u)=>c.uuid.localeCompare(u.uuid)).map(c=>new GPe(c,e,t,i).toJsonLd());for(const c of a){const u=c["@id"];o[u]?o[u].samples.push(c.samples[0]):o[u]=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":q9},c)))),{"@context":q9,"@graph":l}}(o,r,s,i);console.warn(`Unable to load ${n} as HuBMAP Data`)})}function Jb(n,e,t){const i=new Set;for(const r of e)for(const s of(0,Un.readQuads)(n,r,t,null,null))i.add(s.object.id);return i}const JPe={[ki.spatialEntity.x_dimension.id]:"x",[ki.spatialEntity.y_dimension.id]:"y",[ki.spatialEntity.z_dimension.id]:"z"};function tNe(n,e,t,i){const r=e.getTransformationMatrix(t,i);let s;if(r){const o=r.getTranslation(),a=function(n,e){const t=dp(n,e,"Dimensions",JPe);return[t.x,t.y,t.z]}(n,t).map(c=>c/1e3/2),l=(new Zi).fromRotationMatrix(r,Zi.XYZ).toQuaternion().normalize().calculateW();s=(new Nk).fromCenterHalfSizeQuaternion(o,a,l)}return s}function nNe(n,e,t,i){const{x:r,y:s,z:o,radius:a,target:l}=i,c=new Set,u=a/1e3*(a/1e3);for(const h of t){const f=tNe(n,e,h,l);f&&f.distanceSquaredTo([r,s,o].map(m=>m/1e3))<=u&&c.add(h)}return c}function m1(n,e,t){var i,r;const s=new Map,o=new Set;for(const c of e)for(const u of(0,Un.readQuads)(n,c,vi.donor,null,null))o.add(u.object.id),s.has(u.object.id)?null===(i=s.get(u.object.id))||void 0===i||i.push(c):s.set(u.object.id,[c]);const a=t(o),l=new Set;for(const c of a)for(const u of null!==(r=s.get(c))&&void 0!==r?r:[])l.add(u);return l}function Gk(n,e,t){var i,r;const s=new Map,o=new Set;for(const c of e)for(const u of(0,Un.readQuads)(n,c,vi.spatialEntity,null,null))o.add(u.object.id),s.has(u.object.id)?null===(i=s.get(u.object.id))||void 0===i||i.push(c):s.set(u.object.id,[c]);const a=t(o),l=new Set;for(const c of a)for(const u of null!==(r=s.get(c))&&void 0!==r?r:[])l.add(u);return l}function ev(n,e){return function(t){n.has(t.id)&&e.add(t.id)}}function K9(n,e,t){const i=new Set;for(const r of t){const s=Un.DataFactory.namedNode(r);n.forSubjects(ev(e,i),ki.spatialEntity.ccf_annotations,s,null)}return i}function Q9(n,e){const t=function(n,e){const t=new Map;for(const i of n)for(const r of(0,Un.readQuads)(e,i,vi.spatialEntity,null,null))t.has(r.object.id)?t.get(r.object.id).add(i):t.set(r.object.id,new Set([i]));return t}(n,e),i=new Map;for(const r of t.keys()){const s=t.get(r);for(const o of(0,Un.readQuads)(e,r,ki.spatialEntity.ccf_annotations,null,null))if(i.has(o.object.id)){const a=i.get(o.object.id);s.forEach(l=>a.add(l))}else i.set(o.object.id,new Set(s))}return i}function _Ne(n,e,t){const i={"@id":e,"@type":"OntologyTreeNode",id:e,parent:"",children:[],synonymLabels:[],label:""},r={[ki.ontologyNode.label.id]:"label",[t]:"parent",[ki.ontologyNode.synonymLabels.id]:"synonymLabels"};for(const[s,o]of Uk(n,e,r))"synonymLabels"===s?i.synonymLabels.push(o):i[s]=o;return i.children=n.getSubjects(t,e,null).map(s=>s.id),i}function Z9(n,e,t,i){const r={root:e,nodes:{}},s=new Set;for(const a of(0,Un.readQuads)(n,null,i,null,null))s.add(a.subject.id),s.add(a.object.id);for(const a of s)r.nodes[a]=_Ne(n,a,i);r.nodes[e]||(r.nodes[e]={"@id":e,"@type":"OntologyTreeNode",id:e,label:t,children:[],synonymLabels:[]});const o=n.getSubjects(i,e,null).map(a=>a.id).sort((a,l)=>r.nodes[a].label.localeCompare(r.nodes[l].label));return r.nodes[e].children=o,J9(r),r}function J9(n,e,t=new Set){const i=n.nodes[null!=e?e:n.root];if(i){i.children=i.children.filter(r=>!t.has(r)),i.children.forEach(r=>t.add(r));for(const r of i.children)J9(n,r,t),n.nodes[r]&&(n.nodes[r].parent=i["@id"])}}const eq=(0,mr.memoize)(function(n){const e=Z9(n,vd.body.id,"body",ki.asctb.part_of.id);return e.nodes[vd.body.id].children=["http://purl.obolibrary.org/obo/UBERON_0000955","http://purl.obolibrary.org/obo/UBERON_0000029","http://purl.obolibrary.org/obo/UBERON_0000970","http://purl.obolibrary.org/obo/UBERON_0003889","http://purl.obolibrary.org/obo/UBERON_0000948","http://purl.obolibrary.org/obo/UBERON_0002113","http://purl.obolibrary.org/obo/UBERON_0001465","http://purl.obolibrary.org/obo/UBERON_0002107","http://purl.obolibrary.org/obo/UBERON_0002048","http://purl.obolibrary.org/obo/UBERON_0001911","http://purl.obolibrary.org/obo/UBERON_0000992","http://purl.obolibrary.org/obo/UBERON_0001264","http://purl.obolibrary.org/obo/UBERON_0001270","http://purl.obolibrary.org/obo/UBERON_0001987","http://purl.obolibrary.org/obo/UBERON_0002367","http://purl.obolibrary.org/obo/UBERON_0002097","http://purl.obolibrary.org/obo/UBERON_0002108","http://purl.obolibrary.org/obo/UBERON_0002240","http://purl.obolibrary.org/obo/UBERON_0000059","http://purl.obolibrary.org/obo/UBERON_0002106","http://purl.obolibrary.org/obo/UBERON_0002370","http://purl.obolibrary.org/obo/UBERON_0000056","http://purl.obolibrary.org/obo/UBERON_0001255","http://purl.obolibrary.org/obo/UBERON_0000995","http://purl.obolibrary.org/obo/UBERON_0004537"].filter(t=>t in e.nodes),e},()=>""),_1={[vi.label.id]:"label",[vi.description.id]:"description",[vi.link.id]:"link"},vNe=Object.assign(Object.assign({},_1),{[vi.providerName.id]:"providerName"}),wNe=Object.assign(Object.assign({},_1),{[vi.technology.id]:"technology",[vi.thumbnail.id]:"thumbnail"}),ENe=Object.assign(Object.assign({},_1),{[vi.sampleType.id]:"sampleType",[vi.sectionNumber.id]:"sectionNumber",[vi.datasets.id]:"datasets"}),xNe=Object.assign(Object.assign({},_1),{[vi.sampleType.id]:"sampleType",[vi.sectionCount.id]:"sectionCount",[vi.sectionSize.id]:"sectionSize",[vi.sectionUnits.id]:"sectionUnits",[vi.donor.id]:"donor",[vi.spatialEntity.id]:"spatialEntityId",[vi.sections.id]:"sections",[vi.datasets.id]:"datasets"});function SNe(n,e){return dp(n,e,"Donor",vNe)}function tq(n,e){return dp(n,e,"Dataset",wNe)}function CNe(n,e){const t={"@id":e,"@type":"Sample",datasets:[]};for(const[i,r]of Uk(n,e,ENe))if("datasets"===i){const s=tq(n,r);t[i].push(s)}else t[i]=r;return t}class ANe{constructor(e){this.database=e,this.connect()}toJson(){return{status:this.status,message:this.message,checkback:"Ready"===this.status||"Error"===this.status?36e5:2e3,loadTime:this.loadTime}}connect(){this.status="Loading",this.message="Loading database";const e=Date.now();return this.database.connect().then(t=>Bi(this,void 0,void 0,function*(){t?(this.message="Building scene",yield this.database.getScene(),this.message="Building tissue block results",yield this.database.getTissueBlockResults(),this.message="Aggregating results",yield this.database.getAggregateResults(),this.status="Ready",this.message="Database successfully loaded"):(this.status="Error",this.message="Unknown error while loading database")})).catch(t=>{var i;this.status="Error",this.message=null!==(i=null==t?void 0:t.message)&&void 0!==i?i:"Unknown error while loading database"}).finally(()=>{this.loadTime=Date.now()-e})}}const MNe={"@context":{"@base":"http://purl.org/ccf/","@vocab":"http://purl.org/ccf/",ccf:"http://purl.org/ccf/",rdfs:"http://www.w3.org/2000/01/rdf-schema#",dcterms:"http://purl.org/dc/terms/",label:"rdfs:label",description:"rdfs:comment",link:"ccf:url",sex:"ccf:sex",age:"ccf:age",bmi:"ccf:bmi",consortium_name:"ccf:consortium_name",provider_name:"ccf:tissue_provider_name",provider_uuid:"ccf:tissue_provider_uuid",donor:{"@id":"ccf:comes_from","@type":"@id"},samples:{"@reverse":"donor"},sections:{"@id":"ccf:subdivided_into_sections","@type":"@id"},datasets:{"@id":"ccf:generates_dataset","@type":"@id"},sample_type:"ccf:sample_type",section_count:"ccf:section_count",section_size:"ccf:section_size",section_units:"ccf:section_size_unit",section_number:"ccf:section_number",rui_location:{"@id":"ccf:has_registration_location","@type":"@id"},ccf_annotations:{"@id":"ccf:collides_with","@type":"@id","@container":"@set"},representation_of:{"@id":"ccf:representation_of","@type":"@id"},reference_organ:{"@id":"ccf:has_reference_organ","@type":"@id"},extraction_set_for:{"@id":"ccf:extraction_set_for","@type":"@id"},extraction_set:{"@id":"ccf:has_extraction_set","@type":"@id"},organ_owner_sex:"ccf:organ_owner_sex",side:"ccf:organ_side",rui_rank:"ccf:rui_rank",slice_thickness:"ccf:slice_thickness",slice_count:"ccf:slice_count",object:{"@id":"ccf:has_object_reference","@type":"@id"},creation_date:"dcterms:created",updated_date:"ccf:updated_date",creator:"dcterms:creator",creator_first_name:"ccf:creator_first_name",creator_last_name:"ccf:creator_last_name",placement:{"@reverse":"ccf:placement_for"},placement_date:"dcterms:created",rotation_order:"ccf:rotation_order",dimension_units:"ccf:dimension_unit",rotation_units:"ccf:rotation_unit",scaling_units:"ccf:scaling_unit",translation_units:"ccf:translation_unit",source:{"@id":"ccf:placement_for","@type":"@id"},target:{"@id":"ccf:placement_relative_to","@type":"@id"},x_rotation:"ccf:x_rotation",y_rotation:"ccf:y_rotation",z_rotation:"ccf:z_rotation",x_scaling:"ccf:x_scaling",y_scaling:"ccf:y_scaling",z_scaling:"ccf:z_scaling",x_translation:"ccf:x_translation",y_translation:"ccf:y_translation",z_translation:"ccf:z_translation",x_dimension:"ccf:x_dimension",y_dimension:"ccf:y_dimension",z_dimension:"ccf:z_dimension",ontology_terms:{"@id":"ccf:has_ontology_term","@type":"@id"},technology:"ccf:technology",thumbnail:"ccf:thumbnail",file:"ccf:file_url",file_format:"ccf:file_format",file_subpath:"ccf:file_subpath"}};function $k(n){return JSON.parse(n,(e,t)=>"ccf_annotations"===e&&Array.isArray(t)?t.map(i=>(null==i?void 0:i.startsWith("http://purl.obolibrary.org/obo/FMA_"))?i.replace("http://purl.obolibrary.org/obo/FMA_","http://purl.org/sig/ont/fma/fma"):i):"@context"!==e||!t||"https://hubmapconsortium.github.io/hubmap-ontology/ccf-entity-context.jsonld"!==t&&"https://hubmapconsortium.github.io/hubmap-ontology/ccf-context.jsonld"!==t&&"https://hubmapconsortium.github.io/ccf-ontology/ccf-context.jsonld"!==t&&"http://purl.org/ccf/latest/ccf-entity.owl#"!==t["@base"]?t:MNe)}const INe={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 ONe{constructor(e=INe){this.options=e,this.store=new Un.Store(void 0,{factory:Un.DataFactory}),this.graph=new G9(this),this.scene=new $9(this)}connect(e,t=!1){return Bi(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 Bi(this,void 0,void 0,function*(){const e=(new Date).getTime(),t="ccf-database.last_modified",i="ccf-database",r=yield A9(t).catch(()=>{});let s;r&&e-new Date(+r).getTime()>36e5?yield function(n,e=Cc()){return e("readwrite",t=>(n.forEach(i=>t.delete(i)),vu(t.transaction)))}([i,t]).catch(()=>{}):s=yield A9(i).catch(()=>{}),s?yield this.deserialize(s):(yield this.doConnect(),function(n,e=Cc()){return e("readwrite",t=>(n.forEach(i=>t.put(i[1],i[0])),vu(t.transaction)))}([[i,this.serialize()],[t,""+e]]).catch(()=>{}))})}doConnect(){var e,t;return Bi(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.startsWith("{"))this.store=(0,Un.deserializeN3Store)(s,Un.DataFactory);else 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,Un.deserializeN3Store)(o,Un.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(X9(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 Bi(this,void 0,void 0,function*(){const i=null!=t?t:this.store;return yield Promise.all(e.map(r=>Bi(this,void 0,void 0,function*(){"string"==typeof r?(r.startsWith("http")||r.startsWith("assets/"))&&r.includes("jsonld")?(r=$k(r=yield fetch(r).then(s=>s.text())),yield(0,Un.addJsonLdToStore)(r,i)):r.endsWith("n3")?yield(0,Un.addN3ToStore)(r,i):r.endsWith("rdf")||r.endsWith("owl")||r.endsWith("xml")?yield(0,Un.addRdfXmlToStore)(r,i):(r=$k(r),yield(0,Un.addJsonLdToStore)(r,i)):(r=$k(JSON.stringify(r)),yield(0,Un.addJsonLdToStore)(r,i))}))),this})}synchronize(){return Bi(this,void 0,void 0,function*(){return yield new Promise(e=>{setTimeout(e,500)}),this.graph.createGraph(),function(n){var e,t,i;const r=eq(n),s=new Map;for(const{subject:o,object:a}of(0,Un.readQuads)(n,null,ki.spatialEntity.representation_of,null,null)){const l=new Set([a.id]);let c=null===(e=r.nodes[a.id])||void 0===e?void 0:e.parent;for(;c&&!l.has(c);)l.add(c),c=null===(t=r.nodes[c])||void 0===t?void 0:t.parent;s.set(o.id,[...l].map(u=>Un.DataFactory.namedNode(u)))}for(const{object:o}of(0,Un.readQuads)(n,null,vi.spatialEntity,null,null))for(const{subject:a}of(0,Un.readQuads)(n,null,ki.spatialPlacement.source,o,null))for(const{object:l}of(0,Un.readQuads)(n,a,ki.spatialPlacement.target,null,null))for(const c of null!==(i=s.get(l.id))&&void 0!==i?i:[])n.addQuad(Un.DataFactory.namedNode(o.id),ki.spatialEntity.ccf_annotations,c)}(this.store),this})}serialize(){return(0,Un.serializeN3Store)(this.store)}deserialize(e){return Bi(this,void 0,void 0,function*(){this.store=(0,Un.deserializeN3Store)(e,Un.DataFactory),this.graph=new G9(this),this.scene=new $9(this),yield new Promise(t=>{setTimeout(t,10)})})}getIds(e={}){return function(n,e,t){var i,r,s,o,a,l,c;let u=function(n){const e=new Set;return n.forSubjects(t=>e.add(t.id),vi.spatialEntity,null,null),e}(n);if(u.size>0&&(u=function(n,e,t=!0){const i=new Set;if(n.forSubjects(ev(e,i),vi.spatialEntity,null,null),!t){const r=new Set;return e.forEach(s=>i.has(s)?void 0:r.add(s)),r}return i}(n,u)),u.size>0&&("Male"===t.sex||"Female"===t.sex)){const h=t.sex;u=m1(n,u,f=>function(n,e,t){const i=new Set;return n.forSubjects(ev(e,i),vi.sex,vi[t],null),i}(n,f,h))}if(u.size>0&&(null===(i=t.tmc)||void 0===i?void 0:i.length)>0&&(u=m1(n,u,h=>function(n,e,t){const i=new Set;for(const r of t){const s=Un.DataFactory.literal(r);n.forSubjects(ev(e,i),vi.providerName,s,null)}return i}(n,h,t.tmc))),u.size>0&&(null===(r=t.technologies)||void 0===r?void 0:r.length)>0&&(u=function(n,e,t){var i,r;const s=new Map,o=new Set,a=new Set(e);for(const u of e)for(const h of(0,Un.readQuads)(n,u,vi.sections,null,null))a.add(h.object.id);for(const u of a)for(const h of(0,Un.readQuads)(n,u,vi.datasets,null,null))o.add(h.object.id),s.has(h.object.id)?null===(i=s.get(h.object.id))||void 0===i||i.push(u):s.set(h.object.id,[u]);const l=t(o),c=new Set;for(const u of l)for(const h of null!==(r=s.get(u))&&void 0!==r?r:[])c.add(h);return c}(n,u,h=>function(n,e,t){const i=new Set;for(const r of t){const s=Un.DataFactory.literal(r);n.forSubjects(ev(e,i),vi.technology,s,null)}return i}(n,h,t.technologies))),u.size>0&&(null===(s=t.spatialSearches)||void 0===s?void 0:s.length)>0&&(u=Gk(n,u,h=>function(n,e,t,i){const r=new Set;for(const s of i)nNe(n,e,t,s).forEach(a=>r.add(a));return r}(n,e,h,t.spatialSearches))),u.size>0&&(null===(o=t.ontologyTerms)||void 0===o?void 0:o.length)>0){const h=t.ontologyTerms;-1===h.indexOf(vd.body.id)&&(u=Gk(n,u,f=>K9(n,f,h)))}if(u.size>0&&(null===(a=t.cellTypeTerms)||void 0===a?void 0:a.length)>0){const h=t.cellTypeTerms;-1===h.indexOf(vd.cell.id)&&(u=Gk(n,u,f=>function(n,e,t){const i=new Set;for(const r of t)n.forObjects(s=>{i.add(s.id)},r,ki.asctb.located_in,null),r===vd.cell.id&&i.add(vd.body.id);return K9(n,e,[...i])}(n,f,h)))}if(u.size>0&&2===(null===(l=t.ageRange)||void 0===l?void 0:l.length)&&(0,mr.isFinite)(t.ageRange[0])&&(0,mr.isFinite)(t.ageRange[1])){const h=Math.max(...t.ageRange),f=Math.min(...t.ageRange);1===f&&110===h||(u=m1(n,u,g=>function(n,e,t,i){const r=new Set;for(const s of e)for(const o of(0,Un.readQuads)(n,s,vi.age,null,null)){const a=(0,c1.fromRdf)(o.object);a>=t&&a<=i&&r.add(s)}return r}(n,g,f,h)))}if(u.size>0&&2===(null===(c=t.bmiRange)||void 0===c?void 0:c.length)&&(0,mr.isFinite)(t.bmiRange[0])&&(0,mr.isFinite)(t.bmiRange[1])){const h=Math.max(...t.bmiRange),f=Math.min(...t.bmiRange);13===f&&83===h||(u=m1(n,u,g=>function(n,e,t,i){const r=new Set;for(const s of e)for(const o of(0,Un.readQuads)(n,s,vi.bmi,null,null)){const a=(0,c1.fromRdf)(o.object);a>=t&&a<=i&&r.add(s)}return r}(n,g,f,h)))}return u}(this.store,this.graph,e)}get(e){return this.store.getQuads(Un.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=>function(n,e){const t=n.getObjects(Un.DataFactory.namedNode(e),vi.spatialEntity,null);if(t.length>0)return hp(n,t[0].id)}(this.store,t))}getDatabaseStatus(){return Bi(this,void 0,void 0,function*(){return this.status||(this.status=new ANe(this)),this.status.toJson()})}getDatasetTechnologyNames(){return Bi(this,void 0,void 0,function*(){return function(n){const e=new Set;for(const t of(0,Un.readQuads)(n,null,vi.technology,null,null))e.add(t.object.value);return Array.from(e).sort()}(this.store)})}getProviderNames(){return Bi(this,void 0,void 0,function*(){return function(n){const e=new Set;for(const t of(0,Un.readQuads)(n,null,vi.providerName,null,null))e.add(t.object.value);return Array.from(e).sort()}(this.store)})}getTissueBlockResults(e){return Bi(this,void 0,void 0,function*(){return e=Object.assign(Object.assign({},e),{hasSpatialEntity:!0}),[...this.getIds(e)].map(t=>function(n,e){const t={"@id":e,"@type":"Sample",sections:[],datasets:[]};for(const[i,r]of Uk(n,e,xNe))if("sections"===i){const s=CNe(n,r);t[i].push(s)}else if("datasets"===i){const s=tq(n,r);t[i].push(s)}else t[i]="donor"===i?SNe(n,r):r;return t}(this.store,t))})}getAggregateResults(e){return Bi(this,void 0,void 0,function*(){return function(n,e){const t=Jb(e,n,vi.donor.id),i=Jb(e,t,vi.providerUUID.id),r=new Set;for(const l of n)for(const c of(0,Un.readQuads)(e,l,vi.spatialEntity,null,null))r.add(c.subject.id);const s=Jb(e,r,vi.sections.id),o=new Set([...Jb(e,r,vi.datasets.id),...Jb(e,s,vi.datasets.id)]);return 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 Bi(this,void 0,void 0,function*(){return function(n,e){const t={};return Q9(n,e).forEach((r,s)=>{t[s]=r.size}),t}(this.getIds(e),this.store)})}getCellTypeTermOccurences(e){return Bi(this,void 0,void 0,function*(){return function(n,e){var t,i;const r=Q9(n,e),s=new Map;for(const a of r.keys()){const l=r.get(a);for(const c of(0,Un.readQuads)(e,null,ki.asctb.located_in,a,null)){const u=c.subject.id;if(s.has(u)){const h=s.get(u);l.forEach(f=>h.add(f))}else s.set(u,new Set(l))}}const o={};return s.forEach((a,l)=>{o[l]=a.size}),o[vd.cell.id]=null!==(i=null===(t=r.get(vd.body.id))||void 0===t?void 0:t.size)&&void 0!==i?i:0,o}(this.getIds(e),this.store)})}getOntologyTreeModel(){return Bi(this,void 0,void 0,function*(){return eq(this.store)})}getCellTypeTreeModel(){return Bi(this,void 0,void 0,function*(){return function(n){return Z9(n,vd.cell.id,"cell",ki.asctb.ct_is_a.id)}(this.store)})}getReferenceOrgans(){return Bi(this,void 0,void 0,function*(){return this.scene.getReferenceOrgans()})}getScene(e){return Bi(this,void 0,void 0,function*(){return this.graph.createGraph(),this.scene.getScene(e)})}getReferenceOrganScene(e,t){return Bi(this,void 0,void 0,function*(){return this.graph.createGraph(),this.scene.getReferenceOrganScene(e,t)})}getSpatialPlacement(e,t){return Bi(this,void 0,void 0,function*(){return this.graph.getSpatialPlacement(e,t)})}}class nq extends Error{constructor(){super(...arguments),this.message="NgxsDispatchPluginModule is not imported"}}function NNe(){throw new nq}function kNe(){throw new nq}function Wk(n,e,t){e.run(()=>n.dispatch(t))}function BNe(n,e,t,i){return yg(t)?function(n,e,t){return t.then(i=>(Wk(n,e,i),i))}(n,e,t):Im(t)?function(n,e,t,i){return null!==i&&(t=t.pipe(gr(i.cancelUncompleted$))),t.subscribe({next:r=>Wk(n,e,r)}),t}(n,e,t,i):(Wk(n,e,t),t)}class VNe{constructor(){this.cancelUncompleted$=new oe}cancelPreviousAction(){this.cancelUncompleted$.next()}}const qk="\u0275fac",iq=Symbol("InjectorInstance"),rq=Symbol("FactoryHasBeenDecorated");function sq(n,e){const t=n[iq];return t?t.get(e):null}const zNe={cancelUncompleted:!1};function oq(n=zNe){return(e,t,i)=>{let r;const s=function(n){return n?new VNe:null}(n.cancelUncompleted);function o(){null!==s&&s.cancelPreviousAction();const a=sq(this,hu)||NNe(),l=sq(this,pn)||kNe(),c=r.apply(this,arguments);return l.runOutsideAngular(()=>BNe(a,l,c,s))}"function"==typeof(null==i?void 0:i.value)?(r=i.value,i.value=o):Object.defineProperty(e,t,{set:a=>r=a,get:()=>o}),function(n){if(rq in n.constructor.prototype)return;const e=n.constructor;"function"==typeof e[qk]&&function(n){const e=n[qk];if("function"!=typeof e)return;const t=n.\u0275prov||n.\u0275pipe||n.\u0275cmp||n.\u0275dir,i=()=>{const r=e();return r[iq]=Ce(Vu),r};t&&(t.factory=i),Object.defineProperty(n,qk,{get:()=>i})}(e),n.constructor.prototype[rq]=!0}(e)}}const mke=["bodyCanvas"];let _ke=(()=>{class n{constructor(){this.clsName="ccf-body-ui",this.rotationChange=new ln,this.nodeDrag=new ln,this.nodeClick=new ln,this.nodeHoverStart=new ln,this.nodeHoverStop=new ln,this.initialized=new ln,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 Bi(this,void 0,void 0,function*(){const i=this.bodyCanvas.nativeElement,r=new zve({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.target&&this.bodyUI.setTarget(this.target),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))],this.initialized.emit()})}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=rn({type:n,selectors:[["ccf-body-ui"]],viewQuery:function(t,i){if(1&t&&hr(mke,5,gn),2&t){let r;Gn(r=$n())&&(i.bodyCanvas=r.first)}},hostVars:2,hostBindings:function(t,i){2&t&&Va(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",initialized:"initialized"},decls:2,vars:0,consts:[[1,"body-ui"],["bodyCanvas",""]],template:function(t,i){1&t&&ni(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})(),yke=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=tn({type:n}),n.\u0275inj=St({imports:[[fr]]}),n})();new Ht("Maximum number of autocomplete options displayed",{providedIn:"root",factory:()=>10});const yq=[{src:"app:skin",organ:"Skin",name:"Skin",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002097"},{src:"app:brain",organ:"Brain",name:"Brain",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000955"},{disabled:!0,src:"app:lymph-nodes",organ:"Lymph Node",name:"Lymph Node",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000029"},{src:"app:lymph-nodes",organ:"Lymph Node",name:"Lymph Node",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002509"},{disabled:!0,src:"app:eye",organ:"Eye",name:"Eye, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000970"},{src:"app:eye",organ:"Eye",name:"Eye, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0004548"},{src:"app:eye",organ:"Eye",name:"Eye, R",side:"right",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0004549"},{disabled:!0,src:"app:fallopian-tube-left",organ:"Fallopian Tube",name:"Fallopian Tube, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0003889"},{src:"app:fallopian-tube-left",organ:"Fallopian Tube",name:"Fallopian Tube, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0001303"},{src:"app:fallopian-tube-right",organ:"Fallopian Tube",name:"Fallopian Tube, R",side:"right",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0001302"},{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, L",side:"left",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"},{disabled:!0,src:"app:knee",organ:"Knee",name:"Knee, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001465"},{src:"app:knee",organ:"Knee",name:"Knee, L",side:"left",hasSex:!0,id:"http://purl.org/sig/ont/fma/fma24978"},{src:"app:knee",organ:"Knee",name:"Knee, R",side:"right",hasSex:!0,id:"http://purl.org/sig/ont/fma/fma24977"},{src:"app:liver",organ:"Liver",name:"Liver",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002107"},{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"},{disabled:!0,src:"app:mammary-gland",organ:"Mammary Gland",name:"Mammary Gland, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0001911"},{src:"app:mammary-gland",organ:"Mammary Gland",name:"Mammary Gland, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.org/sig/ont/fma/fma57991"},{src:"app:mammary-gland",organ:"Mammary Gland",name:"Mammary Gland, R",side:"right",hasSex:!1,sex:"female",id:"http://purl.org/sig/ont/fma/fma57987"},{disabled:!0,src:"app:ovary-left",organ:"Ovary",name:"Ovary, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0000992"},{src:"app:ovary-left",organ:"Ovary",name:"Ovary, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.org/sig/ont/fma/fma7214"},{src:"app:ovary-right",organ:"Ovary",name:"Ovary, R",side:"right",hasSex:!1,sex:"female",id:"http://purl.org/sig/ont/fma/fma7213"},{src:"app:pancreas",organ:"Pancreas",name:"Pancreas",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001264"},{src:"app:pelvis-f",organ:"Pelvis",name:"Pelvis",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001270"},{src:"app:placenta",organ:"Placenta",name:"Placenta",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0001987"},{src:"app:prostate",organ:"Prostate",name:"Prostate",hasSex:!1,sex:"male",id:"http://purl.obolibrary.org/obo/UBERON_0002367",disabled:!0},{src:"app:prostate",organ:"Prostate",name:"Prostate",hasSex:!1,sex:"male",id:"http://purl.obolibrary.org/obo/UBERON_0000079"},{src:"app:small-intestine",organ:"Small Intestine",name:"Small Intestine",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002108"},{src:"app:large-intestine",organ:"Large Intestine",name:"Large Intestine",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000059"},{src:"app:spinal-cord",organ:"Spinal Cord",name:"Spinal Cord",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002240"},{src:"app:spleen",organ:"Spleen",name:"Spleen",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002106"},{src:"app:thymus",organ:"Thymus",name:"Thymus",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002370"},{disabled:!0,src:"app:ureter-left",organ:"Ureter",name:"Ureter, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000056"},{src:"app:ureter-left",organ:"Ureter",name:"Ureter, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001223"},{src:"app:ureter-right",organ:"Ureter",name:"Ureter, R",side:"right",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001222"},{src:"app:bladder",organ:"Urinary Bladder",name:"Urinary Bladder",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001255"},{src:"app:uterus",organ:"Uterus",name:"Uterus",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0000995"},{src:"app:vasculature-thick",organ:"Blood Vasculature",name:"Blood Vasculature",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0004537"},{disabled:!0,src:"app:vasculature-thick",organ:"Blood Vasculature",name:"Blood Vasculature",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002049"}].sort((n,e)=>n.name.localeCompare(e.name));function Lke(n,e){if(1&n&&(wt(0,"div",16),ni(1,"youtube-player",17),Et()),2&n){const t=_i(3);zt(1),dE("videoId",t.videoID)}}function Bke(n,e){if(1&n&&(wt(0,"mat-expansion-panel",11),wt(1,"mat-expansion-panel-header"),wt(2,"h2",12),Jn(3),Et(),Et(),wt(4,"div",13),ni(5,"markdown",14),wi(6,Lke,2,1,"div",15),Et(),Et()),2&n){const t=_i(),i=t.index,r=t.$implicit;Jt("expanded",0===i),zt(3),gs(r.title),zt(2),ai("first",0===i),Jt("data",r.content),zt(1),Jt("ngIf",0===i)}}function Vke(n,e){if(1&n&&(wt(0,"div",9),wi(1,Bke,7,6,"mat-expansion-panel",10),Et()),2&n){const t=e.$implicit;zt(1),Jt("ngIf",t)}}yq.filter(n=>!0!==n.disabled);let bq=(()=>{class n{constructor(t,i){this.dialogRef=t,this.data=i,this.documentationContents=i.content||[],this.infoTitle=i.title||"",this.videoID=i.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 n.\u0275fac=function(t){return new(t||n)(Ce(kC),Ce(PW))},n.\u0275cmp=rn({type:n,selectors:[["ccf-info-dialog"]],decls:11,vars:2,consts:[[1,"rui-about","wrapper"],[1,"container"],[1,"content"],[1,"header"],["mat-dialog-title","",1,"title"],[1,"close"],[1,"material-icons","close-icon",3,"click"],[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,i){1&t&&(wt(0,"div",0),wt(1,"div",1),wt(2,"div",2),wt(3,"div",3),wt(4,"h2",4),Jn(5),Et(),wt(6,"div",5),wt(7,"mat-icon",6),Tn("click",function(){return i.close()}),Jn(8,"clear"),Et(),Et(),Et(),wt(9,"mat-dialog-content",7),wi(10,Vke,2,1,"div",8),Et(),Et(),Et(),Et()),2&t&&(zt(5),gs(i.infoTitle),zt(5),Jt("ngForOf",i.documentationContents))},directives:[kW,Fm,FW,Yu,ac,UW,zW,WW,KW],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%] .content[_ngcontent-%COMP%] .header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;height:3rem;margin-bottom:2.25rem;position:relative}.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%]{cursor:pointer;height:3rem;width:3rem;line-height:3rem;text-align:center;transition:.6s}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-size:1.5rem;margin:0 auto;line-height:3rem;height:3rem;justify-self:center;display:flex}.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;display:flex}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .dialog-content[_ngcontent-%COMP%] .variable-binding.first[_ngcontent-%COMP%]{padding-right:1rem;width:73%}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .dialog-content[_ngcontent-%COMP%] .variable-binding[_ngcontent-%COMP%] ul{margin:0}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .dialog-content[_ngcontent-%COMP%] .variable-binding[_ngcontent-%COMP%] img{margin-left:1rem;float:right}.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%}"]}),n})(),vq=(()=>{class n{constructor(t){this.http=t,this.panelContent=new Fr({content:[],infoTitle:"",videoID:""})}updateData(t,i,r){this.http.get(t,{responseType:"text"}).subscribe(s=>{const o={content:this.parseMarkdown(s),infoTitle:r,videoID:i};this.panelContent.next(o)})}parseMarkdown(t){const i=[],r=t.split("# ");for(const s of r)if(s.length){const o=s.includes("\n\n")?"\n\n":"\r\n\r\n",a=s.split(o);i.push({title:a[0],content:a.splice(1).join(o)})}return i}}return n.\u0275fac=function(t){return new(t||n)(Ie(_u))},n.\u0275prov=We({token:n,factory:n.\u0275fac,providedIn:"root"}),n})(),Uke=(()=>{class n{constructor(){this.clsName="ccf-call-to-action",this.callToActionClicked=new ln,this.closeClicked=new ln}close(){this.closeClicked.emit()}onDialogButtonClick(){this.callToActionClicked.emit()}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=rn({type:n,selectors:[["ccf-call-to-action"]],hostVars:2,hostBindings:function(t,i){2&t&&Va(i.clsName)},inputs:{infoTitle:"infoTitle",imageUrl:"imageUrl",message:"message",callToAction:"callToAction"},outputs:{callToActionClicked:"callToActionClicked",closeClicked:"closeClicked"},decls:13,vars:4,consts:[[1,"rui-about","wrapper"],[1,"container"],[1,"content"],[1,"first-row"],["mat-dialog-title","",1,"title"],[1,"cta-mat-icon","material-icons","close-icon",3,"click"],["mat-card-sm-image","","alt","preview","layout-fill","",1,"cta-image",3,"src"],[1,"mat-typography","dialog-content"],[1,"message"],["mat-button","",1,"mat-button",3,"text","click"]],template:function(t,i){1&t&&(wt(0,"div",0),wt(1,"div",1),wt(2,"div",2),wt(3,"div",3),wt(4,"p",4),Jn(5),Et(),wt(6,"mat-icon",5),Tn("click",function(){return i.close()}),Jn(7,"clear"),Et(),Et(),ni(8,"img",6),wt(9,"mat-dialog-content",7),wt(10,"div",8),Jn(11),Et(),wt(12,"a",9),Tn("click",function(){return i.onDialogButtonClick()}),Et(),Et(),Et(),Et(),Et()),2&t&&(zt(5),gs(i.infoTitle),zt(3),Jt("src",i.imageUrl,sf),zt(3),xo(" ",i.message,""),zt(1),Jt("text",i.callToAction))},directives:[kW,Fm,BMe,FW],styles:["[_nghost-%COMP%] .content[_ngcontent-%COMP%]{display:block;align-content:center;padding-left:1.6rem;padding-right:1.6rem;border-radius:.25rem}[_nghost-%COMP%] .info-button-wrapper[_ngcontent-%COMP%]{border-radius:.25rem;padding:.6rem;transition:.6s}[_nghost-%COMP%] .info-button-wrapper[_ngcontent-%COMP%] .ccf-info-button[_ngcontent-%COMP%]{cursor:pointer;transition:color .6s;font-size:1.2rem;vertical-align:sub}[_nghost-%COMP%] .first-row[_ngcontent-%COMP%]{display:flex;width:100%;line-height:.9rem}[_nghost-%COMP%] .first-row[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{padding-right:7rem;padding-left:.2rem;font-size:.875rem;padding-top:.75rem}[_nghost-%COMP%] .first-row[_ngcontent-%COMP%] .cta-mat-icon[_ngcontent-%COMP%]{height:30%;line-height:3.4rem}[_nghost-%COMP%] .message[_ngcontent-%COMP%]{padding:.5rem}[_nghost-%COMP%] .cta-image[_ngcontent-%COMP%]{align-self:center;-o-object-fit:cover;object-fit:cover;width:100%;border-radius:.25rem}[_nghost-%COMP%] .mat-button[_ngcontent-%COMP%]{background-color:#444a65;font-size:.75rem;position:relative;margin-bottom:1rem;width:100%;height:2rem;color:#fff}"],changeDetection:0}),n})(),Qm=(()=>{let n=class extends MDe{constructor(){super(...arguments),this.optionCache=new Map}get config$(){return this.state$.pipe(Ki(n=>null!=n),Wa(1))}setConfig(t){this.setState(t)}patchConfig(t){this.patchState(t)}getProperty(t){return this.config$.pipe(oW(...t),ld(),Wa(1))}getOption(...t){const i=this.getPathKey(t);if(this.optionCache.has(i))return this.optionCache.get(i);const r=this.config$.pipe(oW(...t),ld(),Wa(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=zi(n)))(i||n)}}(),n.\u0275prov=We({token:n,factory:n.\u0275fac}),Ei([f7()],n.prototype,"config$",null),n=Ei([CDe(),A5({name:"globalConfig",defaults:null})],n),n})();!function(){const n=localStorage.getItem("ALLOW_TELEMETRY");null===n||n.toLowerCase()}();class wq extends class{getDatabaseStatus(){return this.forwardCall("getDatabaseStatus")}getProviderNames(){return this.forwardCall("getProviderNames")}getDatasetTechnologyNames(){return this.forwardCall("getDatasetTechnologyNames")}getOntologyTreeModel(){return this.forwardCall("getOntologyTreeModel")}getCellTypeTreeModel(){return this.forwardCall("getCellTypeTreeModel")}getReferenceOrgans(){return this.forwardCall("getReferenceOrgans")}getTissueBlockResults(e){return this.forwardCall("getTissueBlockResults",e)}getAggregateResults(e){return this.forwardCall("getAggregateResults",e)}getOntologyTermOccurences(e){return this.forwardCall("getOntologyTermOccurences",e)}getCellTypeTermOccurences(e){return this.forwardCall("getCellTypeTermOccurences",e)}getScene(e){return this.forwardCall("getScene",e)}getReferenceOrganScene(e,t){return this.forwardCall("getReferenceOrganScene",e,t)}}{forwardCall(e,...t){return this.impl$.pipe(is(i=>i[e](...t)))}}let Eq=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const Qk=new oe,nv={cacheBusterObserver:Qk},Zm={cacheBusterObserver:Qk,maxCacheCount:4};function xq(n,e,t){return n?{min:n[0]>e?n[0]:void 0,max:n[1]{var t;return Object.assign(Object.assign({},e),{transformMatrix:new qn(null!==(t=e.transformMatrix)&&void 0!==t?t:[])})})}let Xke=(()=>{class n{constructor(t,i){this.api=t,this.globalConfig=i,i.getOption("hubmapToken").subscribe(Qk)}getDatabaseStatus(){return this.doRequest(t=>this.api.dbStatus(t))}getProviderNames(){return this.doRequest(t=>this.api.providerNames(t))}getDatasetTechnologyNames(){return this.doRequest(t=>this.api.technologyNames(t))}getOntologyTreeModel(){return this.doRequest(t=>this.api.ontologyTreeModel(t),void 0,{},n=>n)}getCellTypeTreeModel(){return this.doRequest(t=>this.api.cellTypeTreeModel(t),void 0,{},n=>n)}getReferenceOrgans(){return this.doRequest(t=>this.api.referenceOrgans(t),void 0,{},n=>n)}getTissueBlockResults(t){return this.doRequest(i=>this.api.tissueBlocks(i),t,{},n=>n)}getAggregateResults(t){return this.doRequest(i=>this.api.aggregateResults(i),t)}getOntologyTermOccurences(t){return this.doRequest(i=>this.api.ontologyTermOccurences(i),t)}getCellTypeTermOccurences(t){return this.doRequest(i=>this.api.cellTypeTermOccurences(i),t)}getScene(t){return this.doRequest(i=>this.api.scene(i),t,{},Sq)}getReferenceOrganScene(t,i){return this.doRequest(r=>this.api.referenceOrganScene(r),i,{organIri:t},Sq)}doRequest(t,i,r,s){const{api:o,globalConfig:a}=this,l=Object.assign(Object.assign({},function(n){var e,t;return{age:xq(null==n?void 0:n.ageRange,1,110),bmi:xq(null==n?void 0:n.bmiRange,13,83),sex:null===(t=null===(e=null==n?void 0:n.sex)||void 0===e?void 0:e.toLowerCase)||void 0===t?void 0:t.call(e),ontologyTerms:null==n?void 0:n.ontologyTerms,cellTypeTerms:null==n?void 0:n.cellTypeTerms,providers:null==n?void 0:n.tmc,technologies:null==n?void 0:n.technologies,spatial:null==n?void 0:n.spatialSearches}}(i)),r);return yc([a.getOption("remoteApiEndpoint"),a.getOption("hubmapToken")]).pipe(qr(1),cr(([c,u])=>{o.configuration.basePath=c,u&&(l.token=u)}),is(()=>t(l)),me(c=>s?s(c):c))}}return n.\u0275fac=function(t){return new(t||n)(Ie(T9),Ie(Qm))},n.\u0275prov=We({token:n,factory:n.\u0275fac,providedIn:"root"}),Ei([Sc(nv)],n.prototype,"getProviderNames",null),Ei([Sc(nv)],n.prototype,"getDatasetTechnologyNames",null),Ei([Sc(nv)],n.prototype,"getOntologyTreeModel",null),Ei([Sc(nv)],n.prototype,"getCellTypeTreeModel",null),Ei([Sc(nv)],n.prototype,"getReferenceOrgans",null),Ei([Sc(Zm)],n.prototype,"getTissueBlockResults",null),Ei([Sc(Zm)],n.prototype,"getAggregateResults",null),Ei([Sc(Zm)],n.prototype,"getOntologyTermOccurences",null),Ei([Sc(Zm)],n.prototype,"getCellTypeTermOccurences",null),Ei([Sc(Zm)],n.prototype,"getScene",null),Ei([Sc(Zm)],n.prototype,"getReferenceOrganScene",null),n})(),Kke=(()=>{class n extends wq{constructor(t){super(),this.impl$=this.database$=t.config$.pipe(i=>i,Ki(i=>Object.keys(i).length>0),is(i=>function(n,e){return new O(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?je(r):Qc).subscribe(t);return()=>{o.unsubscribe(),i&&i.unsubscribe()}})}(()=>this.createDatabase(i),r=>this.connectDatabase(r,i))),me(i=>i.database),Wa(1))}connectDatabase(t,i){return Bi(this,void 0,void 0,function*(){const r=!fa();return yield t.database.connect(i,r),t})}}return n.\u0275fac=function(t){return new(t||n)(Ie(Qm))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),Qke=(()=>{class n extends Kke{createDatabase(t){return{database:new ONe(t),unsubscribe:()=>{}}}}return n.\u0275fac=function(){let e;return function(i){return(e||(e=zi(n)))(i||n)}}(),n.\u0275prov=We({token:n,factory:n.\u0275fac,providedIn:"root"}),n})(),Zke=(()=>{class n extends wq{constructor(t,i){super(),this.impl$=t.config$.pipe(r=>r,me(r=>this.selectToken(r)),ld(),me(r=>i.get(r)),Wa(1))}}return n.\u0275fac=function(t){return new(t||n)(Ie(Qm),Ie(Hn))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})(),Zk=(()=>{class n{}return n.type="[CallToAction] Learn More",n})(),Jk=(()=>{class n{}return n.type="[CallToAction] Open Dialog",n})(),eF=(()=>{class n{}return n.type="[CallToAction] Close Dialog",n})();var tF;class wa{get length(){var e,t;return null!==(t=null===(e=wa.storage)||void 0===e?void 0:e.length)&&void 0!==t?t:0}key(e){var t,i;return null!==(i=null===(t=wa.storage)||void 0===t?void 0:t.key(e))&&void 0!==i?i:null}getItem(e,t){var i,r,s;return null!==(s=null!==(r=null===(i=wa.storage)||void 0===i?void 0:i.getItem(e))&&void 0!==r?r:t)&&void 0!==s?s:null}setItem(e,t){var i;try{return null===(i=wa.storage)||void 0===i||i.setItem(e,t),!0}catch(r){return!1}}removeItem(e){var t;null===(t=wa.storage)||void 0===t||t.removeItem(e)}clear(){var e;null===(e=wa.storage)||void 0===e||e.clear()}}wa.storage=(()=>{let n;try{n=window.localStorage;const e="__storage_test__";return n.setItem(e,e),n.removeItem(e),n}catch(e){return e instanceof DOMException&&(22===e.code||1014===e.code||"QuotaExceededError"===e.name||"NS_ERROR_DOM_QUOTA_REACHED"===e.name)&&n&&0!==n.length?n:void 0}})(),wa.\u0275fac=function(e){return new(e||wa)},wa.\u0275prov=We({token:wa,factory:wa.\u0275fac,providedIn:"root"});const Cq="callToActionPopupShown";let Ro=tF=class{constructor(e,t,i,r,s){this.dialog=e,this.ga=t,this.storage=i,this.infoService=r,this.http=s}static ctaDatePassed(e,t=Date.now){return+t()>+new Date(e)}ngxsOnInit(e){const{expirationDate:t,popupShown:i}=e.getState(),r=this.storage.getItem(Cq,`${i}`),s=tF.ctaDatePassed(t);"true"!==r&&!s&&e.dispatch(new Jk)}getDialogData(){return this.http.get("assets/docs/SPATIAL_SEARCH_README.md",{responseType:"text"}).pipe(me(e=>this.infoService.parseMarkdown(e)))}launchLearnMore(e){this.dialog.open(bq,{autoFocus:!1,panelClass:"modal-animated",width:"72rem",data:{title:"Spatial Search",content:e,videoID:"UfxMpzatowE"}})}learnMore(e){return this.dialog.closeAll(),this.ga.event("open_learn_more","call_to_action"),this.getDialogData().pipe(cr(t=>this.launchLearnMore(t)))}open(e){this.dialog.open(eFe,{autoFocus:!1,panelClass:"modal-animated",width:"30.75rem",height:"36.688rem"}),this.ga.event("open","call_to_action"),this.storage.setItem(Cq,"true"),e.patchState({popupShown:!0})}close(e){this.dialog.closeAll(),this.ga.event("close","call_to_action")}};Ro.\u0275fac=function(e){return new(e||Ro)(Ie(Nb),Ie(qb),Ie(wa),Ie(vq),Ie(_u))},Ro.\u0275prov=We({token:Ro,factory:Ro.\u0275fac}),Ei([yP(Zk)],Ro.prototype,"learnMore",null),Ei([yP(Jk)],Ro.prototype,"open",null),Ei([yP(eF)],Ro.prototype,"close",null),Ro=tF=Ei([A5({name:"callToAction",defaults:{title:"New to the Exploration User Interface",message:"Spatial Search has arrived!",callToAction:"Learn More",imageUrl:"assets/images/spatial_search.gif",expirationDate:"Dec 1, 2022",popupShown:!1}})],Ro);let E1=(()=>{class n{static title(t){return t.title}static message(t){return t.message}static callToAction(t){return t.callToAction}static imageUrl(t){return t.imageUrl}static expirationDate(t){return t.expirationDate}static popupShown(t){return t.popupShown}}return Ei([_m([Ro])],n,"title",null),Ei([_m([Ro])],n,"message",null),Ei([_m([Ro])],n,"callToAction",null),Ei([_m([Ro])],n,"imageUrl",null),Ei([_m([Ro])],n,"expirationDate",null),Ei([_m([Ro])],n,"popupShown",null),n})(),eFe=(()=>{class n{constructor(){this.close=()=>new eF,this.learnMore=()=>new Zk}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=rn({type:n,selectors:[["ccf-call-to-action-behavior"]],decls:5,vars:12,consts:[[3,"infoTitle","message","callToAction","imageUrl","callToActionClicked","closeClicked"]],template:function(t,i){1&t&&(wt(0,"ccf-call-to-action",0),Tn("callToActionClicked",function(){return i.learnMore()})("closeClicked",function(){return i.close()}),Ps(1,"async"),Ps(2,"async"),Ps(3,"async"),Ps(4,"async"),Et()),2&t&&Jt("infoTitle",To(1,4,i.title$))("message",To(2,6,i.message$))("callToAction",To(3,8,i.callToAction$))("imageUrl",To(4,10,i.imageUrl$))},directives:[Uke],pipes:[g0],styles:[""],changeDetection:0}),Ei([PS(E1.title)],n.prototype,"title$",void 0),Ei([PS(E1.message)],n.prototype,"message$",void 0),Ei([PS(E1.callToAction)],n.prototype,"callToAction$",void 0),Ei([PS(E1.imageUrl)],n.prototype,"imageUrl$",void 0),Ei([oq()],n.prototype,"close",void 0),Ei([oq()],n.prototype,"learnMore",void 0),n})(),iFe=(()=>{class n{constructor(t){this.source=t,this.organs=yq}getOrganInfo(t,i,r="Female"){let s=this.organs.find(a=>a.id===t);if(!s)return sn(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)),sn(s)}getOrgan(t,i="Both"){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}):sn([])}getOrganStats(t,i="Female"){return t.id?this.source.getAggregateResults({ontologyTerms:[t.id],sex:i}):sn([])}getBlocks(t,i="Female"){return t.id?this.source.getTissueBlockResults({ontologyTerms:[t.id],sex:i}):sn([])}}return n.\u0275fac=function(t){return new(t||n)(Ie(Eq))},n.\u0275prov=We({token:n,factory:n.\u0275fac,providedIn:"root"}),n})();const rFe=["thumbContainer"],sFe=["toggleBar"],oFe=["input"],aFe=function(n){return{enterDuration:n}},lFe=["*"],cFe=new Ht("mat-slide-toggle-default-options",{providedIn:"root",factory:()=>({disableToggleValue:!1})});let uFe=0;const dFe={provide:Xo,useExisting:ge(()=>Tq),multi:!0};class hFe{constructor(e,t){this.source=e,this.checked=t}}const fFe=wC(Mm(Ch(Am(class{constructor(n){this._elementRef=n}}))));let Tq=(()=>{class n extends fFe{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-"+ ++uFe,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 ln,this.toggleChange=new ln,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=bi(t)}get checked(){return this._checked}set checked(t){this._checked=bi(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 hFe(this,this.checked))}_onLabelTextChange(){this._changeDetectorRef.detectChanges()}}return n.\u0275fac=function(t){return new(t||n)(Ce(gn),Ce(vc),Ce(Mr),yo("tabindex"),Ce(cFe),Ce(Qa,8))},n.\u0275cmp=rn({type:n,selectors:[["mat-slide-toggle"]],viewQuery:function(t,i){if(1&t&&(hr(rFe,5),hr(sFe,5),hr(oFe,5)),2&t){let r;Gn(r=$n())&&(i._thumbEl=r.first),Gn(r=$n())&&(i._thumbBarEl=r.first),Gn(r=$n())&&(i._inputElement=r.first)}},hostAttrs:[1,"mat-slide-toggle"],hostVars:12,hostBindings:function(t,i){2&t&&(qc("id",i.id),Ii("tabindex",i.disabled?null:-1)("aria-label",null)("aria-labelledby",null),ai("mat-checked",i.checked)("mat-disabled",i.disabled)("mat-slide-toggle-label-before","before"==i.labelPosition)("_mat-animation-noopable",i._noopAnimations))},inputs:{disabled:"disabled",disableRipple:"disableRipple",color:"color",tabIndex:"tabIndex",name:"name",id:"id",labelPosition:"labelPosition",ariaLabel:["aria-label","ariaLabel"],ariaLabelledby:["aria-labelledby","ariaLabelledby"],required:"required",checked:"checked",ariaDescribedby:["aria-describedby","ariaDescribedby"]},outputs:{change:"change",toggleChange:"toggleChange"},exportAs:["matSlideToggle"],features:[Vn([dFe]),En],ngContentSelectors:lFe,decls:16,vars:20,consts:[[1,"mat-slide-toggle-label"],["label",""],[1,"mat-slide-toggle-bar"],["toggleBar",""],["type","checkbox","role","switch",1,"mat-slide-toggle-input","cdk-visually-hidden",3,"id","required","tabIndex","checked","disabled","change","click"],["input",""],[1,"mat-slide-toggle-thumb-container"],["thumbContainer",""],[1,"mat-slide-toggle-thumb"],["mat-ripple","",1,"mat-slide-toggle-ripple","mat-focus-indicator",3,"matRippleTrigger","matRippleDisabled","matRippleCentered","matRippleRadius","matRippleAnimation"],[1,"mat-ripple-element","mat-slide-toggle-persistent-ripple"],[1,"mat-slide-toggle-content",3,"cdkObserveContent"],["labelContent",""],[2,"display","none"]],template:function(t,i){if(1&t&&(Hr(),wt(0,"label",0,1),wt(2,"div",2,3),wt(4,"input",4,5),Tn("change",function(s){return i._onChangeEvent(s)})("click",function(s){return i._onInputClick(s)}),Et(),wt(6,"div",6,7),ni(8,"div",8),wt(9,"div",9),ni(10,"div",10),Et(),Et(),Et(),wt(11,"span",11,12),Tn("cdkObserveContent",function(){return i._onLabelTextChange()}),wt(13,"span",13),Jn(14,"\xa0"),Et(),oi(15),Et(),Et()),2&t){const r=ih(1),s=ih(12);Ii("for",i.inputId),zt(2),ai("mat-slide-toggle-bar-no-side-margin",!s.textContent||!s.textContent.trim()),zt(2),Jt("id",i.inputId)("required",i.required)("tabIndex",i.tabIndex)("checked",i.checked)("disabled",i.disabled),Ii("name",i.name)("aria-checked",i.checked.toString())("aria-label",i.ariaLabel)("aria-labelledby",i.ariaLabelledby)("aria-describedby",i.ariaDescribedby),zt(5),Jt("matRippleTrigger",r)("matRippleDisabled",i.disableRipple||i.disabled)("matRippleCentered",!0)("matRippleRadius",20)("matRippleAnimation",function(n,e,t,i){return E3(Vt(),Cs(),n,e,t,i)}(18,aFe,i._noopAnimations?0:150))}},directives:[gu,$P],styles:[".mat-slide-toggle{display:inline-block;height:24px;max-width:100%;line-height:24px;white-space:nowrap;outline:none;-webkit-tap-highlight-color:transparent}.mat-slide-toggle.mat-checked .mat-slide-toggle-thumb-container{transform:translate3d(16px, 0, 0)}[dir=rtl] .mat-slide-toggle.mat-checked .mat-slide-toggle-thumb-container{transform:translate3d(-16px, 0, 0)}.mat-slide-toggle.mat-disabled{opacity:.38}.mat-slide-toggle.mat-disabled .mat-slide-toggle-label,.mat-slide-toggle.mat-disabled .mat-slide-toggle-thumb-container{cursor:default}.mat-slide-toggle-label{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:flex;flex:1;flex-direction:row;align-items:center;height:inherit;cursor:pointer}.mat-slide-toggle-content{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mat-slide-toggle-label-before .mat-slide-toggle-label{order:1}.mat-slide-toggle-label-before .mat-slide-toggle-bar{order:2}[dir=rtl] .mat-slide-toggle-label-before .mat-slide-toggle-bar,.mat-slide-toggle-bar{margin-right:8px;margin-left:0}[dir=rtl] .mat-slide-toggle-bar,.mat-slide-toggle-label-before .mat-slide-toggle-bar{margin-left:8px;margin-right:0}.mat-slide-toggle-bar-no-side-margin{margin-left:0;margin-right:0}.mat-slide-toggle-thumb-container{position:absolute;z-index:1;width:20px;height:20px;top:-3px;left:0;transform:translate3d(0, 0, 0);transition:all 80ms linear;transition-property:transform}._mat-animation-noopable .mat-slide-toggle-thumb-container{transition:none}[dir=rtl] .mat-slide-toggle-thumb-container{left:auto;right:0}.mat-slide-toggle-thumb{height:20px;width:20px;border-radius:50%}.mat-slide-toggle-bar{position:relative;width:36px;height:14px;flex-shrink:0;border-radius:8px}.mat-slide-toggle-input{bottom:0;left:10px}[dir=rtl] .mat-slide-toggle-input{left:auto;right:10px}.mat-slide-toggle-bar,.mat-slide-toggle-thumb{transition:all 80ms linear;transition-property:background-color;transition-delay:50ms}._mat-animation-noopable .mat-slide-toggle-bar,._mat-animation-noopable .mat-slide-toggle-thumb{transition:none}.mat-slide-toggle .mat-slide-toggle-ripple{position:absolute;top:calc(50% - 20px);left:calc(50% - 20px);height:40px;width:40px;z-index:1;pointer-events:none}.mat-slide-toggle .mat-slide-toggle-ripple .mat-ripple-element:not(.mat-slide-toggle-persistent-ripple){opacity:.12}.mat-slide-toggle-persistent-ripple{width:100%;height:100%;transform:none}.mat-slide-toggle-bar:hover .mat-slide-toggle-persistent-ripple{opacity:.04}.mat-slide-toggle:not(.mat-disabled).cdk-keyboard-focused .mat-slide-toggle-persistent-ripple{opacity:.12}.mat-slide-toggle-persistent-ripple,.mat-slide-toggle.mat-disabled .mat-slide-toggle-bar:hover .mat-slide-toggle-persistent-ripple{opacity:0}@media(hover: none){.mat-slide-toggle-bar:hover .mat-slide-toggle-persistent-ripple{display:none}}.cdk-high-contrast-active .mat-slide-toggle-thumb,.cdk-high-contrast-active .mat-slide-toggle-bar{border:1px solid}.cdk-high-contrast-active .mat-slide-toggle.cdk-keyboard-focused .mat-slide-toggle-bar{outline:2px dotted;outline-offset:5px}\n"],encapsulation:2,changeDetection:0}),n})(),Aq=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=tn({type:n}),n.\u0275inj=St({}),n})(),mFe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=tn({type:n}),n.\u0275inj=St({imports:[[Aq,Dm,ji,QS],Aq,ji]}),n})(),_Fe=(()=>{class n{constructor(){this.clsName="ccf-slide-toggle",this.labels=["Left","Right"],this.value="Left",this.disabled=!1,this.valueChange=new ln}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=rn({type:n,selectors:[["ccf-slide-toggle"]],hostVars:2,hostBindings:function(t,i){2&t&&Va(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=wl();wt(0,"span",0),Tn("click",function(){_r(r);const o=ih(3);return i.left||o.toggle(),i.updateToggle(!0)}),Jn(1),Et(),wt(2,"mat-slide-toggle",1,2),Tn("change",function(o){return i.updateToggle(!o.checked)}),Et(),wt(4,"span",0),Tn("click",function(){_r(r);const o=ih(3);return i.left&&o.toggle(),i.updateToggle(!1)}),Jn(5),Et()}2&t&&(ai("disabled",i.disabled)("highlighted",i.left),zt(1),gs(i.labels[0].charAt(0).toUpperCase()+i.labels[0].slice(1)),zt(1),Jt("disabled",i.disabled)("checked",!i.left),zt(2),ai("disabled",i.disabled)("highlighted",!i.left),zt(1),gs(i.labels[1].charAt(0).toUpperCase()+i.labels[1].slice(1)))},directives:[Tq],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 yFe=["bodyUI"],bFe=function(){return["Male","Female"]},vFe=function(){return["Left","Right"]};let wFe=(()=>{class n{constructor(t){this.ga=t,this.sexChange=new ln,this.sideChange=new ln}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.zoomToFitOrgan()}updateSex(t){this.sex=t,this.sexChange.emit(this.sex)}updateSide(t){this.side=t,this.sideChange.emit(this.side)}zoomToFitOrgan(){const{bodyUI:t,organ:i}=this;if(i){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)(Ce(qb))},n.\u0275cmp=rn({type:n,selectors:[["ccf-organ"]],viewQuery:function(t,i){if(1&t&&hr(yFe,7),2&t){let r;Gn(r=$n())&&(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:[Fi],decls:5,vars:10,consts:[["camera","perspective",1,"body-ui",3,"scene","interactive","nodeClick","initialized"],["bodyUI",""],[1,"stage-options"],[1,"view-slider",3,"labels","value","hidden","valueChange"]],template:function(t,i){1&t&&(wt(0,"ccf-body-ui",0,1),Tn("nodeClick",function(s){return i.nodeClicked(s)})("initialized",function(){return i.zoomToFitOrgan()}),Et(),wt(2,"div",2),wt(3,"ccf-slide-toggle",3),Tn("valueChange",function(s){return i.updateSex(s)}),Et(),wt(4,"ccf-slide-toggle",3),Tn("valueChange",function(s){return i.updateSide(s)}),Et(),Et()),2&t&&(Jt("scene",i.scene)("interactive",!0),zt(3),Jt("labels",TE(8,bFe))("value",i.sex)("hidden",!i.sex),zt(1),Jt("labels",TE(9,vFe))("value",i.side)("hidden",!i.side))},directives:[_ke,_Fe],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 EFe(n,e){if(1&n&&(wt(0,"div",3),wt(1,"div",4),Jn(2),Et(),wt(3,"div",5),Jn(4),Et(),Et()),2&n){const t=e.$implicit;zt(2),gs(t.count),zt(2),gs(t.label)}}let xFe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=rn({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&&(wt(0,"div",0),wt(1,"div",1),Jn(2),Et(),wi(3,EFe,5,2,"div",2),Et()),2&t&&(zt(2),xo(" ",i.statsLabel," "),zt(1),Jt("ngForOf",i.stats))},directives:[Yu],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 SFe(n,e){if(1&n){const t=wl();wt(0,"div",6),wt(1,"div",7),wt(2,"div",8),Jn(3),Et(),wt(4,"div",9),Tn("click",function(){const s=_r(t).$implicit;return _i().goToURL(s.buttonUrl)}),Jn(5),Et(),Et(),Et()}if(2&n){const t=e.$implicit;zt(3),gs(t.body),zt(1),Jt("gaLabel",t.buttonUrl),zt(1),xo(" ",t.buttonTitle,"")}}function CFe(n,e){if(1&n){const t=wl();wt(0,"div",10),Tn("click",function(){const s=_r(t).$implicit;return _i().goToURL(s.buttonUrl)}),Jn(1),Et()}if(2&n){const t=e.$implicit;Jt("gaLabel",t.buttonUrl),zt(1),gs(t.buttonTitle)}}let TFe=(()=>{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=rn({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&&(wt(0,"div",0),wi(1,SFe,6,3,"div",1),Et(),wt(2,"div",2),wt(3,"div",3),Jn(4,"Common Coordinate Framework (CCF) Deep Dive"),Et(),wt(5,"div",4),wi(6,CFe,2,2,"div",5),Et(),Et()),2&t&&(zt(1),Jt("ngForOf",i.linkCards),zt(5),Jt("ngForOf",i.deepDives))},directives:[g9,Yu,m9],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 AFe=["left"],MFe=["right"],DFe=function(){return[]},IFe=[{color:[0,0,0,0],opacity:.001}];let OFe=(()=>{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(cr(s=>this.latestConfig=s),is(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)}),cr(s=>this.logOrganLookup(s)),cr(s=>this.latestOrganInfo=s),Wa(1)),this.organ$=this.organInfo$.pipe(is(s=>s?t.getOrgan(s,s.hasSex?this.latestConfig.sex:void 0):sn(void 0)),cr(s=>{var o;if(s&&this.latestOrganInfo){const a=(null===(o=this.latestOrganInfo)||void 0===o?void 0:o.hasSex)?s.sex:void 0;a!==this.latestConfig.sex&&this.updateInput("sex",a),s.side!==this.latestConfig.side&&this.updateInput("side",s.side)}}),Wa(1)),this.scene$=this.organ$.pipe(is(s=>s&&this.latestOrganInfo?t.getOrganScene(this.latestOrganInfo,s.sex):sn(IFe))),this.stats$=this.organ$.pipe(is(s=>s&&this.latestOrganInfo?t.getOrganStats(this.latestOrganInfo,s.sex):sn([]))),this.statsLabel$=this.organ$.pipe(me(s=>this.makeStatsLabel(this.latestOrganInfo,null==s?void 0:s.sex)),Oo("Loading...")),this.blocks$=this.organ$.pipe(is(s=>s&&this.latestOrganInfo?t.getBlocks(this.latestOrganInfo,s.sex):sn([])))}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,i){let r=[`Unknown IRI: ${this.latestConfig.organIri}`];if(t){const s=t.side?t.side.charAt(0).toUpperCase()+t.side.slice(1):void 0;r=[i,t.organ,s]}return r.filter(s=>!!s).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)(Ce(iFe),Ce(qb),Ce(Qm))},n.\u0275cmp=rn({type:n,selectors:[["ccf-root"]],viewQuery:function(t,i){if(1&t&&(hr(AFe,7,gn),hr(MFe,7,gn)),2&t){let r;Gn(r=$n())&&(i.left=r.first),Gn(r=$n())&&(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&&(wt(0,"div",0),wt(1,"div",1,2),wt(3,"ccf-organ",3),Tn("sexChange",function(s){return i.updateInput("sex",s)})("sideChange",function(s){return i.updateInput("side",s)}),Ps(4,"async"),Ps(5,"async"),Ps(6,"async"),Ps(7,"async"),Ps(8,"async"),Ps(9,"async"),Et(),Et(),wt(10,"div",4,5),ni(12,"ccf-stats-list",6),Ps(13,"async"),Ps(14,"async"),ni(15,"ccf-link-cards"),Et(),Et()),2&t){let r;zt(3),Jt("blocks",To(4,8,i.blocks$))("filter",To(5,10,i.filter$))("sex",To(6,12,i.sex$))("side",To(7,14,i.side$))("organ",To(8,16,i.organ$))("scene",null!==(r=To(9,18,i.scene$))&&void 0!==r?r:TE(24,DFe)),zt(9),Jt("statsLabel",To(13,20,i.statsLabel$))("stats",To(14,22,i.stats$))}},directives:[wFe,xFe,TFe],pipes:[g0],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 RFe(n,e){1&n&&ni(0,"ccf-root")}function PFe(n){const e=i=>"string"==typeof i,t=i=>Array.isArray(i)&&i.every(e);if("string"==typeof n){const i=XD.json(n);if(t(i))return i}else if(t(n))return n;throw new Error("Invalid data sources")}function NFe(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=XD.json(n);if(t(i))return i}}else if(t(n))return n;throw new Error("Invalid data sources")}let kFe=(()=>{class n extends fie{constructor(t,i){super(t,i,{initialDelay:10,initialConfig:Object.assign(Object.assign({},If.dbOptions),globalThis.dbOptions),parse:{dataSources:PFe,highlightProviders:NFe,useRemoteApi:XD.boolean}}),this.sex="Female",this.side="Left"}}return n.\u0275fac=function(t){return new(t||n)(Ce(Qm),Ce(Mr))},n.\u0275cmp=rn({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",useRemoteApi:"useRemoteApi",remoteApiEndpoint:"remoteApiEndpoint"},features:[En],decls:1,vars:1,consts:[[4,"ngIf"]],template:function(t,i){1&t&&wi(0,RFe,1,0,"ccf-root",0),2&t&&Jt("ngIf",i.initialized)},directives:[ac,OFe],encapsulation:2,changeDetection:0}),n})(),FFe=(()=>{class n extends Zke{selectToken(t){return t.useRemoteApi&&t.remoteApiEndpoint?Xke:Qke}}return n.\u0275fac=function(){let e;return function(i){return(e||(e=zi(n)))(i||n)}}(),n.\u0275prov=We({token:n,factory:n.\u0275fac,providedIn:"root"}),n})(),LFe=(()=>{class n{constructor(t,i){this.accessor=t,this.injector=i}static forRoot(t=[]){return{ngModule:n,providers:[hs,el,a7,...t]}}}return n.\u0275fac=function(t){return new(t||n)(Ie(hs,2),Ie(el,2))},n.\u0275mod=tn({type:n}),n.\u0275inj=St({}),n})();const x1=(n,e)=>((n,e)=>new Array(e+1).join("0"))(0,e-n.toString().length)+n;class jFe{constructor(e,t,i){this.action=e,this.store=t,this.logWriter=i}dispatched(e){const t=qf(this.action),i=function(n){return x1(n.getHours(),2)+":"+x1(n.getMinutes(),2)+":"+x1(n.getSeconds(),2)+"."+x1(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 UFe{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 Mq=new Ht("NGXS_LOGGER_PLUGIN_OPTIONS");let zFe=(()=>{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 UFe(this._options),this._store=this._store||this._injector.get(hu);const s=new jFe(i,this._store,this._logWriter);return s.dispatched(t),r(t,i).pipe(cr(o=>{s.completed(o)}),bc(o=>{throw s.errored(o),o}))}}return n.\u0275fac=function(t){return new(t||n)(Ie(Mq),Ie(Hn))},n.\u0275prov=We({token:n,factory:n.\u0275fac}),n})();const Dq=new Ht("LOGGER_USER_OPTIONS");function HFe(n){return Object.assign({},{logger:console,collapsed:!1,disabled:!1,filter:()=>!0},n)}let GFe=(()=>{class n{static forRoot(t){return{ngModule:n,providers:[{provide:h5,useClass:zFe,multi:!0},{provide:Dq,useValue:t},{provide:Mq,useFactory:HFe,deps:[Dq]}]}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=tn({type:n}),n.\u0275inj=St({}),n})();const $Fe=[Qm];let WFe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=tn({type:n}),n.\u0275inj=St({imports:[[LFe.forRoot(),Yo.forRoot($Fe,{developmentMode:!If.production}),GFe.forRoot({disabled:If.production})]]}),n})(),qFe=(()=>{class n{constructor(t){if(t)throw new Error("The core module should only be imported once in the root module")}}return n.\u0275fac=function(t){return new(t||n)(Ie(n,12))},n.\u0275mod=tn({type:n}),n.\u0275inj=St({providers:[{provide:Eq,useExisting:FFe}],imports:[[CW,oRe.forRoot({gaToken:If.googleAnalyticsToken,appName:"organ-info",projectName:"ccf",developmentMode:!If.production}),pRe.forRoot(()=>new Yb({basePath:If.dbOptions.remoteApiEndpoint})),WFe]]}),n})(),YFe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=tn({type:n}),n.\u0275inj=St({imports:[[fr,mFe]]}),n})(),XFe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=tn({type:n}),n.\u0275inj=St({imports:[[fr,yke,YFe]]}),n})(),KFe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=tn({type:n}),n.\u0275inj=St({imports:[[fr,r1]]}),n})(),QFe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=tn({type:n}),n.\u0275inj=St({imports:[[fr]]}),n})(),ZFe=(()=>{class n{constructor(t){this.injector=t}ngDoBootstrap(){const t=function(n,e){const t=function(n,e){return e.get(El).resolveComponentFactory(n).inputs}(n,e.injector),i=e.strategyFactory||new aie(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 cie{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,u){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}(kFe,{injector:this.injector});customElements.define("ccf-organ-info",t)}}return n.\u0275fac=function(t){return new(t||n)(Ie(Hn))},n.\u0275mod=tn({type:n}),n.\u0275inj=St({providers:[],imports:[[WD,qFe,KFe,QFe,XFe]]}),n})();If.production&&function(){if(iB)throw new Error("Cannot enable prod mode after platform setup.");nB=!1}(),Ine().bootstrapModule(ZFe).catch(n=>console.error(n))},1052:Ut=>{function it(yt,ee,Dt,dt,Y,Se,he){try{var W=yt[Se](he),j=W.value}catch(k){return void Dt(k)}W.done?ee(j):Promise.resolve(j).then(dt,Y)}Ut.exports=function(yt){return function(){var ee=this,Dt=arguments;return new Promise(function(dt,Y){var Se=yt.apply(ee,Dt);function he(j){it(Se,dt,Y,he,W,"next",j)}function W(j){it(Se,dt,Y,he,W,"throw",j)}he(void 0)})}},Ut.exports.default=Ut.exports,Ut.exports.__esModule=!0},1948:Ut=>{Ut.exports=function(et){return et&&et.__esModule?et:{default:et}},Ut.exports.default=Ut.exports,Ut.exports.__esModule=!0},4321:Ut=>{function it(et){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(Ut.exports=it=function(ee){return typeof ee},Ut.exports.default=Ut.exports,Ut.exports.__esModule=!0):(Ut.exports=it=function(ee){return ee&&"function"==typeof Symbol&&ee.constructor===Symbol&&ee!==Symbol.prototype?"symbol":typeof ee},Ut.exports.default=Ut.exports,Ut.exports.__esModule=!0),it(et)}Ut.exports=it,Ut.exports.default=Ut.exports,Ut.exports.__esModule=!0},9082:Ut=>{function it(et){return Promise.resolve().then(()=>{var yt=new Error("Cannot find module '"+et+"'");throw yt.code="MODULE_NOT_FOUND",yt})}it.keys=()=>[],it.resolve=it,it.id=9082,Ut.exports=it},9521:()=>{},9125:()=>{},5307:()=>{}},Ut=>{Ut(Ut.s=2829)}]); \ No newline at end of file diff --git a/rui/index.html b/rui/index.html index a182cd731..ee4509865 100644 --- a/rui/index.html +++ b/rui/index.html @@ -66,7 +66,7 @@ - + diff --git a/rui/main.js b/rui/main.js index 3a7cbf0d4..d6fe8ac69 100644 --- a/rui/main.js +++ b/rui/main.js @@ -1 +1 @@ -var A2e=Object.defineProperty,D2e=Object.defineProperties,O2e=Object.getOwnPropertyDescriptors,p7=Object.getOwnPropertySymbols,I2e=Object.prototype.hasOwnProperty,P2e=Object.prototype.propertyIsEnumerable,Ui=Math.pow,g7=(gt,We,ze)=>We in gt?A2e(gt,We,{enumerable:!0,configurable:!0,writable:!0,value:ze}):gt[We]=ze,K=(gt,We)=>{for(var ze in We||(We={}))I2e.call(We,ze)&&g7(gt,ze,We[ze]);if(p7)for(var ze of p7(We))P2e.call(We,ze)&&g7(gt,ze,We[ze]);return gt},Lt=(gt,We)=>D2e(gt,O2e(We));(self.webpackChunkccf_ui=self.webpackChunkccf_ui||[]).push([[179],{2:gt=>{"use strict";gt.exports=ze,gt.exports.default=ze;var We=1e20;function ze(Ke,ft,Ze,Tt,Ft,we){this.fontSize=Ke||24,this.buffer=void 0===ft?3:ft,this.cutoff=Tt||.25,this.fontFamily=Ft||"sans-serif",this.fontWeight=we||"normal",this.radius=Ze||8;var _e=this.size=this.fontSize+2*this.buffer,ke=_e+2*this.buffer;this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=_e,this.ctx=this.canvas.getContext("2d"),this.ctx.font=this.fontWeight+" "+this.fontSize+"px "+this.fontFamily,this.ctx.textAlign="left",this.ctx.fillStyle="black",this.gridOuter=new Float64Array(ke*ke),this.gridInner=new Float64Array(ke*ke),this.f=new Float64Array(ke),this.z=new Float64Array(ke+1),this.v=new Uint16Array(ke),this.useMetrics=void 0!==this.ctx.measureText("A").actualBoundingBoxLeft,this.middle=Math.round(_e/2*(navigator.userAgent.indexOf("Gecko/")>=0?1.2:1))}function It(Ke,ft,Ze,Tt,Ft,we){for(var _e=0;_e-1);we[++ye]=ke,_e[ye]=Te,_e[ye+1]=We}for(ke=0,ye=0;ke{"use strict";var wt=(()=>{return(It=wt||(wt={})).typeOfFunction="function",It.boolTrue=!0,wt;var It})();function L(It,Pt,Ke){if(!Ke||typeof Ke.value!==wt.typeOfFunction)throw new TypeError("Only methods can be decorated with @bind. <"+Pt+"> is not a method!");return{configurable:wt.boolTrue,get:function(){var ft=Ke.value.bind(this);return Object.defineProperty(this,Pt,{value:ft,configurable:wt.boolTrue,writable:wt.boolTrue}),ft}}}We.ak=L,We.ZP=L},266:(gt,We,ze)=>{gt.exports={ResizeSensor:ze(835),ElementQueries:ze(845)}},845:function(gt,We,ze){"use strict";var wt,L,It;"undefined"!=typeof window&&window,L=[ze(835)],void 0!==(It="function"==typeof(wt=function(Pt){var Ke=function(){var Ze,Tt={},Ft=[];function we(Ve){Ve||(Ve=document.documentElement);var ce=window.getComputedStyle(Ve,null).fontSize;return parseFloat(ce)||16}function ke(Ve,ce){var zt=ce.split(/\d/),Gt=zt[zt.length-1];switch(ce=parseFloat(ce),Gt){case"px":return ce;case"em":return ce*we(Ve);case"rem":return ce*we();case"vw":return ce*document.documentElement.clientWidth/100;case"vh":return ce*document.documentElement.clientHeight/100;case"vmin":case"vmax":var Qt=document.documentElement.clientWidth/100,li=document.documentElement.clientHeight/100;return ce*(0,Math["vmin"===Gt?"min":"max"])(Qt,li);default:return ce}}function ye(Ve,ce){this.element=Ve;var zt,Gt,Qt,li,Pi,Se,pn,Gn,Ae=["min-width","min-height","max-width","max-height"];this.call=function(){for(zt in Qt=function(Ve){if(!Ve.getBoundingClientRect)return{width:Ve.offsetWidth,height:Ve.offsetHeight};var ce=Ve.getBoundingClientRect();return{width:Math.round(ce.width),height:Math.round(ce.height)}}(this.element),Se={},Tt[ce])!Tt[ce].hasOwnProperty(zt)||(li=ke(this.element,(Gt=Tt[ce][zt]).value),Pi="width"===Gt.property?Qt.width:Qt.height,pn="","min"===Gt.mode&&Pi>=li&&(pn+=Gt.value),"max"===Gt.mode&&Pi<=li&&(pn+=Gt.value),Se[Gn=Gt.mode+"-"+Gt.property]||(Se[Gn]=""),pn&&-1===(" "+Se[Gn]+" ").indexOf(" "+pn+" ")&&(Se[Gn]+=" "+pn));for(var Ri in Ae)!Ae.hasOwnProperty(Ri)||(Se[Ae[Ri]]?this.element.setAttribute(Ae[Ri],Se[Ae[Ri]].substr(1)):this.element.removeAttribute(Ae[Ri]))}}function Te(Ve,ce){Ve.elementQueriesSetupInformation||(Ve.elementQueriesSetupInformation=new ye(Ve,ce)),Ve.elementQueriesSensor||(Ve.elementQueriesSensor=new Pt(Ve,function(){Ve.elementQueriesSetupInformation.call()}))}function Vt(Ve,ce,zt,Gt){if(void 0===Tt[Ve]){Tt[Ve]=[];var Qt=Ft.length;Ze.innerHTML+="\n"+Ve+" {animation: 0.1s element-queries;}",Ze.innerHTML+="\n"+Ve+" > .resize-sensor {min-width: "+Qt+"px;}",Ft.push(Ve)}Tt[Ve].push({mode:ce,property:zt,value:Gt})}function He(Ve){var ce;if(document.querySelectorAll&&(ce=Ve?Ve.querySelectorAll.bind(Ve):document.querySelectorAll.bind(document)),!ce&&"undefined"!=typeof $$&&(ce=$$),!ce&&"undefined"!=typeof jQuery&&(ce=jQuery),!ce)throw"No document.querySelectorAll, jQuery or Mootools's $$ found.";return ce}function xt(Ve){var ce=[],zt=[],Gt=[],Qt=0,li=-1,Pi=[];for(var Se in Ve.children)if(Ve.children.hasOwnProperty(Se)&&Ve.children[Se].tagName&&"img"===Ve.children[Se].tagName.toLowerCase()){ce.push(Ve.children[Se]);var pn=Ve.children[Se].getAttribute("min-width")||Ve.children[Se].getAttribute("data-min-width"),Gn=Ve.children[Se].getAttribute("data-src")||Ve.children[Se].getAttribute("url");Gt.push(Gn),zt.push({minWidth:pn}),pn?Ve.children[Se].style.display="none":(Qt=ce.length-1,Ve.children[Se].style.display="block")}function Ri(){var xr,jt=!1;for(xr in ce)!ce.hasOwnProperty(xr)||zt[xr].minWidth&&Ve.offsetWidth>zt[xr].minWidth&&(jt=xr);if(jt||(jt=Qt),li!==jt)if(Pi[jt])ce[li].style.display="none",ce[jt].style.display="block",li=jt;else{var ls=new Image;ls.onload=function(){ce[jt].src=Gt[jt],ce[li].style.display="none",ce[jt].style.display="block",Pi[jt]=!0,li=jt},ls.src=Gt[jt]}else ce[jt].src=Gt[jt]}li=Qt,Ve.resizeSensorInstance=new Pt(Ve,Ri),Ri()}var Yn=/,?[\s\t]*([^,\n]*?)((?:\[[\s\t]*?(?:min|max)-(?:width|height)[\s\t]*?[~$\^]?=[\s\t]*?"[^"]*?"[\s\t]*?])+)([^,\n\s\{]*)/gim,Ei=/\[[\s\t]*?(min|max)-(width|height)[\s\t]*?[~$\^]?=[\s\t]*?"([^"]*?)"[\s\t]*?]/gim;function vi(Ve){var ce,zt,Gt,Qt;for(Ve=Ve.replace(/'/g,'"');null!==(ce=Yn.exec(Ve));)for(zt=ce[1]+ce[3],Gt=ce[2];null!==(Qt=Ei.exec(Gt));)Vt(zt,Qt[1],Qt[2],Qt[3])}function bi(Ve){var ce="";if(Ve)if("string"==typeof Ve)(-1!==(Ve=Ve.toLowerCase()).indexOf("min-width")||-1!==Ve.indexOf("max-width"))&&vi(Ve);else for(var zt=0,Gt=Ve.length;zt img, [data-responsive-image] {overflow: hidden; padding: 0; } [responsive-image] > img, [data-responsive-image] > img {width: 100%;}",Ze.innerHTML+="\n@keyframes element-queries { 0% { visibility: inherit; } }",document.getElementsByTagName("head")[0].appendChild(Ze),Mr=!0);for(var ce=0,zt=document.styleSheets.length;ce=_e.status}function ft(we){try{we.dispatchEvent(new MouseEvent("click"))}catch(ke){var _e=document.createEvent("MouseEvents");_e.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),we.dispatchEvent(_e)}}var Ze="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:"object"==typeof global&&global.global===global?global:void 0,Tt=Ze.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),Ft=Ze.saveAs||("object"!=typeof window||window!==Ze?function(){}:"download"in HTMLAnchorElement.prototype&&!Tt?function(we,_e,ke){var ye=Ze.URL||Ze.webkitURL,Te=document.createElement("a");Te.download=_e=_e||we.name||"download",Te.rel="noopener","string"==typeof we?(Te.href=we,Te.origin===location.origin?ft(Te):Ke(Te.href)?Pt(we,_e,ke):ft(Te,Te.target="_blank")):(Te.href=ye.createObjectURL(we),setTimeout(function(){ye.revokeObjectURL(Te.href)},4e4),setTimeout(function(){ft(Te)},0))}:"msSaveOrOpenBlob"in navigator?function(we,_e,ke){if(_e=_e||we.name||"download","string"!=typeof we)navigator.msSaveOrOpenBlob(function(we,_e){return void 0===_e?_e={autoBom:!1}:"object"!=typeof _e&&(console.warn("Deprecated: Expected third argument to be a object"),_e={autoBom:!_e}),_e.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(we.type)?new Blob(["\ufeff",we],{type:we.type}):we}(we,ke),_e);else if(Ke(we))Pt(we,_e,ke);else{var ye=document.createElement("a");ye.href=we,ye.target="_blank",setTimeout(function(){ft(ye)})}}:function(we,_e,ke,ye){if((ye=ye||open("","_blank"))&&(ye.document.title=ye.document.body.innerText="downloading..."),"string"==typeof we)return Pt(we,_e,ke);var Te="application/octet-stream"===we.type,Vt=/constructor/i.test(Ze.HTMLElement)||Ze.safari,He=/CriOS\/[\d]+/.test(navigator.userAgent);if((He||Te&&Vt||Tt)&&"undefined"!=typeof FileReader){var An=new FileReader;An.onloadend=function(){var Yn=An.result;Yn=He?Yn:Yn.replace(/^data:[^;]*;/,"data:attachment/file;"),ye?ye.location.href=Yn:location=Yn,ye=null},An.readAsDataURL(we)}else{var xt=Ze.URL||Ze.webkitURL,tn=xt.createObjectURL(we);ye?ye.location=tn:location.href=tn,ye=null,setTimeout(function(){xt.revokeObjectURL(tn)},4e4)}});Ze.saveAs=Ft.saveAs=Ft,gt.exports=Ft})?ze.apply(We,[]):ze)&&(gt.exports=L)},524:(gt,We,ze)=>{var wt;!function(L,It,Pt,Ke){"use strict";var He,ft=["","webkit","Moz","MS","ms","o"],Ze=It.createElement("div"),Ft=Math.round,we=Math.abs,_e=Date.now;function ke(A,F,j){return setTimeout(Yn(A,j),F)}function ye(A,F,j){return!!Array.isArray(A)&&(Te(A,j[F],j),!0)}function Te(A,F,j){var re;if(A)if(A.forEach)A.forEach(F,j);else if(A.length!==Ke)for(re=0;re\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",vn=L.console&&(L.console.warn||L.console.log);return vn&&vn.call(L.console,re,Ue),A.apply(this,arguments)}}He="function"!=typeof Object.assign?function(F){if(F===Ke||null===F)throw new TypeError("Cannot convert undefined or null to object");for(var j=Object(F),re=1;re-1}function zt(A){return A.trim().split(/\s+/g)}function Gt(A,F,j){if(A.indexOf&&!j)return A.indexOf(F);for(var re=0;reWr[F]}):re.sort()),re}function Pi(A,F){for(var j,re,Fe=F[0].toUpperCase()+F.slice(1),Ue=0;Ue1&&!j.firstMultiple?j.firstMultiple=Va(F):1===Fe&&(j.firstMultiple=!1);var Ue=j.firstInput,vn=j.firstMultiple,dr=vn?vn.center:Ue.center,yr=F.center=uo(re);F.timeStamp=_e(),F.deltaTime=F.timeStamp-Ue.timeStamp,F.angle=ho(dr,yr),F.distance=us(dr,yr),function(A,F){var j=F.center,re=A.offsetDelta||{},Fe=A.prevDelta||{},Ue=A.prevInput||{};(1===F.eventType||4===Ue.eventType)&&(Fe=A.prevDelta={x:Ue.deltaX||0,y:Ue.deltaY||0},re=A.offsetDelta={x:j.x,y:j.y}),F.deltaX=Fe.x+(j.x-re.x),F.deltaY=Fe.y+(j.y-re.y)}(j,F),F.offsetDirection=Ni(F.deltaX,F.deltaY);var Wr=za(F.deltaTime,F.deltaX,F.deltaY);F.overallVelocityX=Wr.x,F.overallVelocityY=Wr.y,F.overallVelocity=we(Wr.x)>we(Wr.y)?Wr.x:Wr.y,F.scale=vn?function(A,F){return us(F[0],F[1],Nr)/us(A[0],A[1],Nr)}(vn.pointers,re):1,F.rotation=vn?function(A,F){return ho(F[1],F[0],Nr)+ho(A[1],A[0],Nr)}(vn.pointers,re):0,F.maxPointers=j.prevInput?F.pointers.length>j.prevInput.maxPointers?F.pointers.length:j.prevInput.maxPointers:F.pointers.length,function(A,F){var Fe,Ue,vn,dr,j=A.lastInterval||F,re=F.timeStamp-j.timeStamp;if(8!=F.eventType&&(re>25||j.velocity===Ke)){var yr=F.deltaX-j.deltaX,Wr=F.deltaY-j.deltaY,cn=za(re,yr,Wr);Ue=cn.x,vn=cn.y,Fe=we(cn.x)>we(cn.y)?cn.x:cn.y,dr=Ni(yr,Wr),A.lastInterval=F}else Fe=j.velocity,Ue=j.velocityX,vn=j.velocityY,dr=j.direction;F.velocity=Fe,F.velocityX=Ue,F.velocityY=vn,F.direction=dr}(j,F);var cn=A.element;Ve(F.srcEvent.target,cn)&&(cn=F.srcEvent.target),F.target=cn}(A,j),A.emit("hammer.input",j),A.recognize(j),A.session.prevInput=j}function Va(A){for(var F=[],j=0;j=we(F)?A<0?2:4:F<0?8:16}function us(A,F,j){j||(j=Gr);var re=F[j[0]]-A[j[0]],Fe=F[j[1]]-A[j[1]];return Math.sqrt(re*re+Fe*Fe)}function ho(A,F,j){return j||(j=Gr),180*Math.atan2(F[j[1]]-A[j[1]],F[j[0]]-A[j[0]])/Math.PI}ii.prototype={handler:function(){},init:function(){this.evEl&&bi(this.element,this.evEl,this.domHandler),this.evTarget&&bi(this.target,this.evTarget,this.domHandler),this.evWin&&bi(Gn(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&Mr(this.element,this.evEl,this.domHandler),this.evTarget&&Mr(this.target,this.evTarget,this.domHandler),this.evWin&&Mr(Gn(this.element),this.evWin,this.domHandler)}};var fu={mousedown:1,mousemove:2,mouseup:4},pu="mousedown",gu="mousemove mouseup";function Ml(){this.evEl=pu,this.evWin=gu,this.pressed=!1,ii.apply(this,arguments)}tn(Ml,ii,{handler:function(F){var j=fu[F.type];1&j&&0===F.button&&(this.pressed=!0),2&j&&1!==F.which&&(j=4),this.pressed&&(4&j&&(this.pressed=!1),this.callback(this.manager,j,{pointers:[F],changedPointers:[F],pointerType:cs,srcEvent:F}))}});var mc={pointerdown:1,pointermove:2,pointerup:4,pointercancel:8,pointerout:8},pd={2:ls,3:"pen",4:cs,5:"kinect"},mu="pointerdown",Vs="pointermove pointerup pointercancel";function Je(){this.evEl=mu,this.evWin=Vs,ii.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}L.MSPointerEvent&&!L.PointerEvent&&(mu="MSPointerDown",Vs="MSPointerMove MSPointerUp MSPointerCancel"),tn(Je,ii,{handler:function(F){var j=this.store,re=!1,Fe=F.type.toLowerCase().replace("ms",""),Ue=mc[Fe],vn=pd[F.pointerType]||F.pointerType,dr=vn==ls,yr=Gt(j,F.pointerId,"pointerId");1&Ue&&(0===F.button||dr)?yr<0&&(j.push(F),yr=j.length-1):12&Ue&&(re=!0),!(yr<0)&&(j[yr]=F,this.callback(this.manager,Ue,{pointers:j,changedPointers:[F],pointerType:vn,srcEvent:F}),re&&j.splice(yr,1))}});var _u={touchstart:1,touchmove:2,touchend:4,touchcancel:8},W="touchstart",Y="touchstart touchmove touchend touchcancel";function J(){this.evTarget=W,this.evWin=Y,this.started=!1,ii.apply(this,arguments)}function T(A,F){var j=Qt(A.touches),re=Qt(A.changedTouches);return 12&F&&(j=li(j.concat(re),"identifier",!0)),[j,re]}tn(J,ii,{handler:function(F){var j=_u[F.type];if(1===j&&(this.started=!0),this.started){var re=T.call(this,F,j);12&j&&re[0].length-re[1].length==0&&(this.started=!1),this.callback(this.manager,j,{pointers:re[0],changedPointers:re[1],pointerType:ls,srcEvent:F})}}});var D={touchstart:1,touchmove:2,touchend:4,touchcancel:8},B="touchstart touchmove touchend touchcancel";function Z(){this.evTarget=B,this.targetIds={},ii.apply(this,arguments)}function $(A,F){var j=Qt(A.touches),re=this.targetIds;if(3&F&&1===j.length)return re[j[0].identifier]=!0,[j,j];var Fe,Ue,vn=Qt(A.changedTouches),dr=[],yr=this.target;if(Ue=j.filter(function(Wr){return Ve(Wr.target,yr)}),1===F)for(Fe=0;Fe-1&&re.splice(Ue,1)},2500)}}function xn(A){for(var F=A.srcEvent.clientX,j=A.srcEvent.clientY,re=0;re-1&&this.requireFail.splice(F,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(A){return!!this.simultaneous[A.id]},emit:function(A){var F=this,j=this.state;function re(Fe){F.manager.emit(Fe,A)}j<8&&re(F.options.event+ue(j)),re(F.options.event),A.additionalEvent&&re(A.additionalEvent),j>=8&&re(F.options.event+ue(j))},tryEmit:function(A){if(this.canEmit())return this.emit(A);this.state=32},canEmit:function(){for(var A=0;AF.threshold&&Fe&F.direction},attrTest:function(A){return rr.prototype.attrTest.call(this,A)&&(2&this.state||!(2&this.state)&&this.directionTest(A))},emit:function(A){this.pX=A.deltaX,this.pY=A.deltaY;var F=u_(A.direction);F&&(A.additionalEvent=this.options.event+F),this._super.emit.call(this,A)}}),tn(bu,rr,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[$i]},attrTest:function(A){return this._super.attrTest.call(this,A)&&(Math.abs(A.scale-1)>this.options.threshold||2&this.state)},emit:function(A){1!==A.scale&&(A.additionalEvent=this.options.event+(A.scale<1?"in":"out")),this._super.emit.call(this,A)}}),tn(Ih,ja,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return["auto"]},process:function(A){var F=this.options,j=A.pointers.length===F.pointers,re=A.distanceF.time;if(this._input=A,!re||!j||12&A.eventType&&!Fe)this.reset();else if(1&A.eventType)this.reset(),this._timer=ke(function(){this.state=8,this.tryEmit()},F.time,this);else if(4&A.eventType)return 8;return 32},reset:function(){clearTimeout(this._timer)},emit:function(A){8===this.state&&(A&&4&A.eventType?this.manager.emit(this.options.event+"up",A):(this._input.timeStamp=_e(),this.manager.emit(this.options.event,this._input)))}}),tn(Cu,rr,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[$i]},attrTest:function(A){return this._super.attrTest.call(this,A)&&(Math.abs(A.rotation)>this.options.threshold||2&this.state)}}),tn(ua,rr,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:30,pointers:1},getTouchAction:function(){return vc.prototype.getTouchAction.call(this)},attrTest:function(A){var j,F=this.options.direction;return 30&F?j=A.overallVelocity:6&F?j=A.overallVelocityX:24&F&&(j=A.overallVelocityY),this._super.attrTest.call(this,A)&&F&A.offsetDirection&&A.distance>this.options.threshold&&A.maxPointers==this.options.pointers&&we(j)>this.options.velocity&&4&A.eventType},emit:function(A){var F=u_(A.offsetDirection);F&&this.manager.emit(this.options.event+F,A),this.manager.emit(this.options.event,A)}}),tn(Tl,ja,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Hi]},process:function(A){var F=this.options,j=A.pointers.length===F.pointers,re=A.distance"']/g,Vs=RegExp(pd.source),Je=RegExp(mu.source),_u=/<%-([\s\S]+?)%>/g,W=/<%([\s\S]+?)%>/g,Y=/<%=([\s\S]+?)%>/g,J=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,T=/^\w*$/,D=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,B=/[\\^$.*+?()[\]{}|]/g,Z=RegExp(B.source),$=/^\s+/,le=/\s/,he=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,pe=/\{\n\/\* \[wrapped with (.+)\] \*/,Ge=/,? & /,an=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,xn=/[()=,{}\[\]\/\s]/,qt=/\\(\\)?/g,Et=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ln=/\w*$/,ri=/^[-+]0x[0-9a-f]+$/i,Hi=/^0b[01]+$/i,$i=/^\[object .+?Constructor\]$/,_n=/^0o[0-7]+$/i,Ci=/^(?:0|[1-9]\d*)$/,_c=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,fo=/($^)/,gd=/['\n\r\u2028\u2029\\]/g,xl="\\ud800-\\udfff",Gi="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Pn="\\u2700-\\u27bf",vu="a-z\\xdf-\\xf6\\xf8-\\xff",Me="A-Z\\xc0-\\xd6\\xd8-\\xde",rr="\\ufe0e\\ufe0f",vc="\\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",Ih="["+xl+"]",Cu="["+vc+"]",ua="["+Gi+"]",Tl="\\d+",Ua="["+Pn+"]",Sp="["+vu+"]",At="[^"+xl+vc+Tl+Pn+vu+Me+"]",Al="\\ud83c[\\udffb-\\udfff]",da="[^"+xl+"]",md="(?:\\ud83c[\\udde6-\\uddff]){2}",A="[\\ud800-\\udbff][\\udc00-\\udfff]",F="["+Me+"]",j="\\u200d",re="(?:"+Sp+"|"+At+")",Fe="(?:"+F+"|"+At+")",Ue="(?:['\u2019](?:d|ll|m|re|s|t|ve))?",vn="(?:['\u2019](?:D|LL|M|RE|S|T|VE))?",dr="(?:"+ua+"|"+Al+")?",yr="["+rr+"]?",Mx=yr+dr+"(?:"+j+"(?:"+[da,md,A].join("|")+")"+yr+dr+")*",_d="(?:"+[Ua,md,A].join("|")+")"+Mx,mi="(?:"+[da+ua+"?",ua,md,A,Ih].join("|")+")",xp=RegExp("['\u2019]","g"),d_=RegExp(ua,"g"),Ph=RegExp(Al+"(?="+Al+")|"+mi+Mx,"g"),b0=RegExp([F+"?"+Sp+"+"+Ue+"(?="+[Cu,F,"$"].join("|")+")",Fe+"+"+vn+"(?="+[Cu,F+re,"$"].join("|")+")",F+"?"+re+"+"+Ue,F+"+"+vn,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Tl,_d].join("|"),"g"),xx=RegExp("["+j+xl+Gi+rr+"]"),Dl=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Rh=["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"],Tx=-1,Ne={};Ne[uo]=Ne[za]=Ne[Ni]=Ne[us]=Ne[ho]=Ne[gc]=Ne[Sl]=Ne[fu]=Ne[pu]=!0,Ne[cs]=Ne[aa]=Ne[El]=Ne[ci]=Ne[Va]=Ne[pt]=Ne[ki]=Ne[la]=Ne[Fi]=Ne[$r]=Ne[ir]=Ne[Gr]=Ne[Nr]=Ne[ii]=Ne[di]=!1;var Si={};Si[cs]=Si[aa]=Si[El]=Si[Va]=Si[ci]=Si[pt]=Si[uo]=Si[za]=Si[Ni]=Si[us]=Si[ho]=Si[Fi]=Si[$r]=Si[ir]=Si[Gr]=Si[Nr]=Si[ii]=Si[pc]=Si[gc]=Si[Sl]=Si[fu]=Si[pu]=!0,Si[ki]=Si[la]=Si[di]=!1;var Pe={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Ax=parseFloat,S0=parseInt,oe="object"==typeof global&&global&&global.Object===Object&&global,ds="object"==typeof self&&self&&self.Object===Object&&self,Kn=oe||ds||Function("return this")(),Ol=We&&!We.nodeType&&We,ha=Ol&>&&!gt.nodeType&>,po=ha&&ha.exports===Ol,h_=po&&oe.process,Wi=function(){try{return ha&&ha.require&&ha.require("util").types||h_&&h_.binding&&h_.binding("util")}catch(fe){}}(),it=Wi&&Wi.isArrayBuffer,bn=Wi&&Wi.isDate,Oi=Wi&&Wi.isMap,js=Wi&&Wi.isRegExp,bc=Wi&&Wi.isSet,Tr=Wi&&Wi.isTypedArray;function Ar(q,fe,se){switch(se.length){case 0:return q.call(fe);case 1:return q.call(fe,se[0]);case 2:return q.call(fe,se[0],se[1]);case 3:return q.call(fe,se[0],se[1],se[2])}return q.apply(fe,se)}function hr(q,fe,se,lt){for(var Rt=-1,Wn=null==q?0:q.length;++Rt-1}function kh(q,fe,se){for(var lt=-1,Rt=null==q?0:q.length;++lt-1;);return se}function Px(q,fe){for(var se=q.length;se--&&Ha(fe,q[se],0)>-1;);return se}function r2(q,fe){for(var se=q.length,lt=0;se--;)q[se]===fe&&++lt;return lt}var s2=Fo({\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"}),o2=Fo({"&":"&","<":"<",">":">",'"':""","'":"'"});function a2(q){return"\\"+Pe[q]}function Lh(q){return xx.test(q)}function x0(q){var fe=-1,se=Array(q.size);return q.forEach(function(lt,Rt){se[++fe]=[Rt,lt]}),se}function Rx(q,fe){return function(se){return q(fe(se))}}function Eu(q,fe){for(var se=-1,lt=q.length,Rt=0,Wn=[];++se",""":'"',"'":"'"}),Vh=function q(fe){var u,se=(fe=null==fe?Kn:Vh.defaults(Kn.Object(),fe,Vh.pick(Kn,Rh))).Array,lt=fe.Date,Rt=fe.Error,Wn=fe.Function,vr=fe.Math,fi=fe.Object,v_=fe.RegExp,b_=fe.String,ga=fe.TypeError,Ii=se.prototype,Su=fi.prototype,Ap=fe["__core-js_shared__"],qi=Wn.prototype.toString,pi=Su.hasOwnProperty,f2=0,zh=(u=/[^.]+$/.exec(Ap&&Ap.keys&&Ap.keys.IE_PROTO||""))?"Symbol(src)_1."+u:"",Ts=Su.toString,Nx=qi.call(fi),C_=Kn._,Ed=v_("^"+qi.call(pi).replace(B,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),fs=po?fe.Buffer:L,Pl=fe.Symbol,Sd=fe.Uint8Array,D0=fs?fs.allocUnsafe:L,ma=Rx(fi.getPrototypeOf,fi),w_=fi.create,Dp=Su.propertyIsEnumerable,Yt=Ii.splice,Lx=Pl?Pl.isConcatSpreadable:L,jh=Pl?Pl.iterator:L,Mu=Pl?Pl.toStringTag:L,Op=function(){try{var u=Pc(fi,"defineProperty");return u({},"",{}),u}catch(h){}}(),O0=fe.clearTimeout!==Kn.clearTimeout&&fe.clearTimeout,Bx=lt&<.now!==Kn.Date.now&<.now,Vx=fe.setTimeout!==Kn.setTimeout&&fe.setTimeout,Oe=vr.ceil,Dn=vr.floor,en=fi.getOwnPropertySymbols,Dr=fs?fs.isBuffer:L,E_=fe.isFinite,Uh=Ii.join,Ga=Rx(fi.keys,fi),pr=vr.max,Lr=vr.min,p2=lt.now,zx=fe.parseInt,Hh=vr.random,Ip=Ii.reverse,Yr=Pc(fe,"DataView"),Us=Pc(fe,"Map"),Pp=Pc(fe,"Promise"),_a=Pc(fe,"Set"),mo=Pc(fe,"WeakMap"),$h=Pc(fi,"create"),Gh=mo&&new mo,Md={},jx=Lu(Yr),S_=Lu(Us),M_=Lu(Pp),I0=Lu(_a),x_=Lu(mo),Rp=Pl?Pl.prototype:L,xd=Rp?Rp.valueOf:L,Wh=Rp?Rp.toString:L;function O(u){if(Ki(u)&&!Bt(u)&&!(u instanceof Cn)){if(u instanceof _o)return u;if(pi.call(u,"__wrapped__"))return Ud(u)}return new _o(u)}var xu=function(){function u(){}return function(h){if(!Xi(h))return{};if(w_)return w_(h);u.prototype=h;var m=new u;return u.prototype=L,m}}();function qh(){}function _o(u,h){this.__wrapped__=u,this.__actions__=[],this.__chain__=!!h,this.__index__=0,this.__values__=L}function Cn(u){this.__wrapped__=u,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=jt,this.__views__=[]}function Hs(u){var h=-1,m=null==u?0:u.length;for(this.clear();++h=h?u:h)),u}function ps(u,h,m,b,M,P){var z,H=1&h,X=2&h,be=4&h;if(m&&(z=M?m(u,b,M,P):m(u)),z!==L)return z;if(!Xi(u))return u;var Ce=Bt(u);if(Ce){if(z=function(u){var h=u.length,m=new u.constructor(h);return h&&"string"==typeof u[0]&&pi.call(u,"index")&&(m.index=u.index,m.input=u.input),m}(u),!H)return Ds(u,z)}else{var Re=ms(u),et=Re==la||Re==La;if(nl(u))return Wp(u,H);if(Re==ir||Re==cs||et&&!M){if(z=X||et?{}:rC(u),!H)return X?function(u,h){return Ca(u,tC(u),h)}(u,function(u,h){return u&&Ca(h,Is(h),u)}(z,u)):function(u,h){return Ca(u,Y_(u),h)}(u,Zx(z,u))}else{if(!Si[Re])return M?u:{};z=function(u,h,m){var b=u.constructor;switch(h){case El:return Ru(u);case ci:case pt:return new b(+u);case Va:return function(u,h){var m=h?Ru(u.buffer):u.buffer;return new u.constructor(m,u.byteOffset,u.byteLength)}(u,m);case uo:case za:case Ni:case us:case ho:case gc:case Sl:case fu:case pu:return H_(u,m);case Fi:return new b;case $r:case ii:return new b(u);case Gr:return function(u){var h=new u.constructor(u.source,ln.exec(u));return h.lastIndex=u.lastIndex,h}(u);case Nr:return new b;case pc:return function(u){return xd?fi(xd.call(u)):{}}(u)}}(u,Re,H)}}P||(P=new va);var St=P.get(u);if(St)return St;P.set(u,z),gT(u)?u.forEach(function(Xt){z.add(ps(Xt,h,m,Xt,u,P))}):dT(u)&&u.forEach(function(Xt,Sn){z.set(Sn,ps(Xt,h,m,Sn,u,P))});var En=Ce?L:(be?X?W_:Bl:X?Is:es)(u);return hs(En||u,function(Xt,Sn){En&&(Xt=u[Sn=Xt]),qa(z,Sn,ps(Xt,h,m,Sn,u,P))}),z}function Vp(u,h,m){var b=m.length;if(null==u)return!b;for(u=fi(u);b--;){var M=m[b],z=u[M];if(z===L&&!(M in u)||!(0,h[M])(z))return!1}return!0}function Kh(u,h,m){if("function"!=typeof u)throw new ga(ft);return rf(function(){u.apply(L,m)},h)}function Sc(u,h,m,b){var M=-1,P=Il,z=!0,H=u.length,X=[],be=h.length;if(!H)return X;m&&(h=hi(h,Lo(m))),b?(P=kh,z=!1):h.length>=200&&(P=Nh,z=!1,h=new ya(h));e:for(;++M-1},Rl.prototype.set=function(u,h){var m=this.__data__,b=Ad(m,u);return b<0?(++this.size,m.push([u,h])):m[b][1]=h,this},Wa.prototype.clear=function(){this.size=0,this.__data__={hash:new Hs,map:new(Us||Rl),string:new Hs}},Wa.prototype.delete=function(u){var h=gs(this,u).delete(u);return this.size-=h?1:0,h},Wa.prototype.get=function(u){return gs(this,u).get(u)},Wa.prototype.has=function(u){return gs(this,u).has(u)},Wa.prototype.set=function(u,h){var m=gs(this,u),b=m.size;return m.set(u,h),this.size+=m.size==b?0:1,this},ya.prototype.add=ya.prototype.push=function(u){return this.__data__.set(u,Tt),this},ya.prototype.has=function(u){return this.__data__.has(u)},va.prototype.clear=function(){this.__data__=new Rl,this.size=0},va.prototype.delete=function(u){var h=this.__data__,m=h.delete(u);return this.size=h.size,m},va.prototype.get=function(u){return this.__data__.get(u)},va.prototype.has=function(u){return this.__data__.has(u)},va.prototype.set=function(u,h){var m=this.__data__;if(m instanceof Rl){var b=m.__data__;if(!Us||b.length<199)return b.push([u,h]),this.size=++m.size,this;m=this.__data__=new Wa(b)}return m.set(u,h),this.size=m.size,this};var Mc=Za(Xa),k_=Za(zp,!0);function L0(u,h){var m=!0;return Mc(u,function(b,M,P){return m=!!h(b,M,P)}),m}function Zh(u,h,m){for(var b=-1,M=u.length;++b0&&m(H)?h>1?Xr(H,h-1,m,b,M):fr(M,H):b||(M[M.length]=H)}return M}var Dd=W0(),Od=W0(!0);function Xa(u,h){return u&&Dd(u,h,es)}function zp(u,h){return u&&Od(u,h,es)}function Qh(u,h){return fa(h,function(m){return Wo(u[m])})}function Bo(u,h){for(var m=0,b=(h=Dc(h,u)).length;null!=u&&mh}function Id(u,h){return null!=u&&pi.call(u,h)}function Pd(u,h){return null!=u&&h in fi(u)}function Au(u,h,m){for(var b=m?kh:Il,M=u[0].length,P=u.length,z=P,H=se(P),X=1/0,be=[];z--;){var Ce=u[z];z&&h&&(Ce=hi(Ce,Lo(h))),X=Lr(Ce.length,X),H[z]=!m&&(h||M>=120&&Ce.length>=120)?new ya(z&&Ce):L}Ce=u[0];var Re=-1,et=H[0];e:for(;++Re=H?X:X*("desc"==m[b]?-1:1)}return u.index-h.index}(P,z,m)});se--;)q[se]=q[se].value;return q}(n1(u,function(P,z,H){return{criteria:hi(h,function(be){return be(P)}),index:++b,value:P}}))}function U0(u,h,m){for(var b=-1,M=h.length,P={};++b-1;)H!==u&&Yt.call(H,X,1),Yt.call(u,X,1);return u}function ef(u,h){for(var m=u?h.length:0,b=m-1;m--;){var M=h[m];if(m==b||M!==P){var P=M;bo(M)?Yt.call(u,M,1):Ou(u,M)}}return u}function kl(u,h){return u+Dn(Hh()*(h-u+1))}function Up(u,h){var m="";if(!u||h<1||h>Gn)return m;do{h%2&&(m+=u),(h=Dn(h/2))&&(u+=u)}while(h);return m}function wn(u,h){return ng(y1(u,h,Ps),u+"")}function r1(u){return O_(Zd(u))}function E2(u,h){var m=Zd(u);return jd(m,Tu(h,0,m.length))}function Hp(u,h,m,b){if(!Xi(u))return u;for(var M=-1,P=(h=Dc(h,u)).length,z=P-1,H=u;null!=H&&++MM?0:M+h),(m=m>M?M:m)<0&&(m+=M),M=h>m?0:m-h>>>0,h>>>=0;for(var P=se(M);++b>>1,z=u[P];null!==z&&!qo(z)&&(m?z<=h:z=200){var be=h?null:G_(u);if(be)return m_(be);z=!1,M=Nh,X=new ya}else X=h?[]:H;e:for(;++b=b?u:Qr(u,h,m)}var a1=O0||function(u){return Kn.clearTimeout(u)};function Wp(u,h){if(h)return u.slice();var m=u.length,b=D0?D0(m):new u.constructor(m);return u.copy(b),b}function Ru(u){var h=new u.constructor(u.byteLength);return new Sd(h).set(new Sd(u)),h}function H_(u,h){var m=h?Ru(u.buffer):u.buffer;return new u.constructor(m,u.byteOffset,u.length)}function Oc(u,h){if(u!==h){var m=u!==L,b=null===u,M=u==u,P=qo(u),z=h!==L,H=null===h,X=h==h,be=qo(h);if(!H&&!be&&!P&&u>h||P&&z&&X&&!H&&!be||b&&z&&X||!m&&X||!M)return 1;if(!b&&!P&&!be&&u1?m[M-1]:L,z=M>2?m[2]:L;for(P=u.length>3&&"function"==typeof P?(M--,P):L,z&&_s(m[0],m[1],z)&&(P=M<3?L:P,M=1),h=fi(h);++b-1?M[P?h[z]:z]:L}}function Fu(u){return Qa(function(h){var m=h.length,b=m,M=_o.prototype.thru;for(u&&h.reverse();b--;){var P=h[b];if("function"!=typeof P)throw new ga(ft);if(M&&!z&&"wrapper"==Jp(P))var z=new _o([],!0)}for(b=z?b:m;++b1&&Bn.reverse(),Ce&&XH))return!1;var be=P.get(u),Ce=P.get(h);if(be&&Ce)return be==h&&Ce==u;var Re=-1,et=!0,St=2&m?new ya:L;for(P.set(u,h),P.set(h,u);++Re-1&&u%1==0&&u1?"& ":"")+h[b],h=h.join(m>2?", ":" "),u.replace(he,"{\n/* [wrapped with "+h+"] */\n")}(b,function(u,h){return hs(Dh,function(m){var b="_."+m[0];h&m[1]&&!Il(u,b)&&u.push(b)}),u.sort()}(function(u){var h=u.match(pe);return h?h[1].split(Ge):[]}(b),m)))}function ey(u){var h=0,m=0;return function(){var b=p2(),M=16-(b-m);if(m=b,M>0){if(++h>=800)return arguments[0]}else h=0;return u.apply(L,arguments)}}function jd(u,h){var m=-1,b=u.length,M=b-1;for(h=h===L?b:h;++m1?u[h-1]:L;return m="function"==typeof m?(u.pop(),m):L,j1(u,m)});function dy(u){var h=O(u);return h.__chain__=!0,h}function $d(u,h){return h(u)}var hy=Qa(function(u){var h=u.length,m=h?u[0]:0,b=this.__wrapped__,M=function(P){return P_(P,u)};return!(h>1||this.__actions__.length)&&b instanceof Cn&&bo(m)?((b=b.slice(m,+m+(h?1:0))).__actions__.push({func:$d,args:[M],thisArg:L}),new _o(b,this.__chain__).thru(function(P){return h&&!P.length&&P.push(L),P})):this.thru(M)}),$1=br(function(u,h,m){pi.call(u,m)?++u[m]:Ya(u,m,1)}),q1=Y0(ny),Y1=Y0(iy);function my(u,h){return(Bt(u)?hs:Mc)(u,Ut(h,3))}function og(u,h){return(Bt(u)?yd:k_)(u,Ut(h,3))}var K1=br(function(u,h,m){pi.call(u,m)?u[m].push(h):Ya(u,m,[h])}),xC=wn(function(u,h,m){var b=-1,M="function"==typeof h,P=$s(u)?se(u.length):[];return Mc(u,function(z){P[++b]=M?Ar(h,z,m):ba(z,h,m)}),P}),TC=br(function(u,h,m){Ya(u,m,h)});function el(u,h){return(Bt(u)?hi:n1)(u,Ut(h,3))}var DC=br(function(u,h,m){u[m?0:1].push(h)},function(){return[[],[]]}),lg=wn(function(u,h){if(null==u)return[];var m=h.length;return m>1&&_s(u,h[0],h[1])?h=[]:m>2&&_s(h[0],h[1],h[2])&&(h=[h[0]]),Jh(u,Xr(h,1),[])}),Bu=Bx||function(){return Kn.Date.now()};function cg(u,h,m){return h=m?L:h,Ll(u,128,L,L,L,L,h=u&&null==h?u.length:h)}function yy(u,h){var m;if("function"!=typeof h)throw new ga(ft);return u=hn(u),function(){return--u>0&&(m=h.apply(this,arguments)),u<=1&&(h=L),m}}var cf=wn(function(u,h,m){var b=1;if(m.length){var M=Eu(m,zd(cf));b|=32}return Ll(u,b,h,m,M)}),Wd=wn(function(u,h,m){var b=3;if(m.length){var M=Eu(m,zd(Wd));b|=32}return Ll(h,b,u,m,M)});function NC(u,h,m){var b,M,P,z,H,X,be=0,Ce=!1,Re=!1,et=!0;if("function"!=typeof u)throw new ga(ft);function St(Qn){var sl=b,Lc=M;return b=M=L,be=Qn,z=u.apply(Lc,sl)}function Wt(Qn){return be=Qn,H=rf(Sn,h),Ce?St(Qn):z}function Xt(Qn){var sl=Qn-X;return X===L||sl>=h||sl<0||Re&&Qn-be>=P}function Sn(){var Qn=Bu();if(Xt(Qn))return Bn(Qn);H=rf(Sn,function(Qn){var sA=h-(Qn-X);return Re?Lr(sA,P-(Qn-be)):sA}(Qn))}function Bn(Qn){return H=L,et&&b?St(Qn):(b=M=L,z)}function Yo(){var Qn=Bu(),sl=Xt(Qn);if(b=arguments,M=this,X=Qn,sl){if(H===L)return Wt(X);if(Re)return a1(H),H=rf(Sn,h),St(X)}return H===L&&(H=rf(Sn,h)),z}return h=Gs(h)||0,Xi(m)&&(Ce=!!m.leading,P=(Re="maxWait"in m)?pr(Gs(m.maxWait)||0,h):P,et="trailing"in m?!!m.trailing:et),Yo.cancel=function(){H!==L&&a1(H),be=0,b=X=M=H=L},Yo.flush=function(){return H===L?z:Bn(Bu())},Yo}var eT=wn(function(u,h){return Kh(u,1,h)}),LC=wn(function(u,h,m){return Kh(u,Gs(h)||0,m)});function uf(u,h){if("function"!=typeof u||null!=h&&"function"!=typeof h)throw new ga(ft);var m=function(){var b=arguments,M=h?h.apply(this,b):b[0],P=m.cache;if(P.has(M))return P.get(M);var z=u.apply(this,b);return m.cache=P.set(M,z)||P,z};return m.cache=new(uf.Cache||Wa),m}function Cy(u){if("function"!=typeof u)throw new ga(ft);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)}}uf.Cache=Wa;var tT=o1(function(u,h){var m=(h=1==h.length&&Bt(h[0])?hi(h[0],Lo(Ut())):hi(Xr(h,1),Lo(Ut()))).length;return wn(function(b){for(var M=-1,P=Lr(b.length,m);++M=h}),tl=Qx(function(){return arguments}())?Qx:function(u){return Ki(u)&&pi.call(u,"callee")&&!Dp.call(u,"callee")},Bt=se.isArray,HC=it?Lo(it):function(u){return Ki(u)&&Kr(u)==El};function $s(u){return null!=u&&Ey(u.length)&&!Wo(u)}function Yi(u){return Ki(u)&&$s(u)}var nl=Dr||Wy,$C=bn?Lo(bn):function(u){return Ki(u)&&Kr(u)==pt};function Ea(u){if(!Ki(u))return!1;var h=Kr(u);return h==ki||"[object DOMException]"==h||"string"==typeof u.message&&"string"==typeof u.name&&!fg(u)}function Wo(u){if(!Xi(u))return!1;var h=Kr(u);return h==la||h==La||"[object AsyncFunction]"==h||"[object Proxy]"==h}function hg(u){return"number"==typeof u&&u==hn(u)}function Ey(u){return"number"==typeof u&&u>-1&&u%1==0&&u<=Gn}function Xi(u){var h=typeof u;return null!=u&&("object"==h||"function"==h)}function Ki(u){return null!=u&&"object"==typeof u}var dT=Oi?Lo(Oi):function(u){return Ki(u)&&ms(u)==Fi};function pT(u){return"number"==typeof u||Ki(u)&&Kr(u)==$r}function fg(u){if(!Ki(u)||Kr(u)!=ir)return!1;var h=ma(u);if(null===h)return!0;var m=pi.call(h,"constructor")&&h.constructor;return"function"==typeof m&&m instanceof m&&qi.call(m)==Nx}var YC=js?Lo(js):function(u){return Ki(u)&&Kr(u)==Gr},gT=bc?Lo(bc):function(u){return Ki(u)&&ms(u)==Nr};function My(u){return"string"==typeof u||!Bt(u)&&Ki(u)&&Kr(u)==ii}function qo(u){return"symbol"==typeof u||Ki(u)&&Kr(u)==pc}var df=Tr?Lo(Tr):function(u){return Ki(u)&&Ey(u.length)&&!!Ne[Kr(u)]},Rc=Kp(j0),xy=Kp(function(u,h){return u<=h});function XC(u){if(!u)return[];if($s(u))return My(u)?$a(u):Ds(u);if(jh&&u[jh])return function(q){for(var fe,se=[];!(fe=q.next()).done;)se.push(fe.value);return se}(u[jh]());var h=ms(u);return(h==Fi?x0:h==Nr?m_:Zd)(u)}function il(u){return u?(u=Gs(u))===pn||u===-pn?17976931348623157e292*(u<0?-1:1):u==u?u:0:0===u?u:0}function hn(u){var h=il(u),m=h%1;return h==h?m?h-m:h:0}function Ty(u){return u?Tu(hn(u),0,jt):0}function Gs(u){if("number"==typeof u)return u;if(qo(u))return NaN;if(Xi(u)){var h="function"==typeof u.valueOf?u.valueOf():u;u=Xi(h)?h+"":h}if("string"!=typeof u)return 0===u?u:+u;u=M0(u);var m=Hi.test(u);return m||_n.test(u)?S0(u.slice(2),m?2:8):ri.test(u)?NaN:+u}function KC(u){return Ca(u,Is(u))}function Zn(u){return null==u?"":vo(u)}var mT=Fl(function(u,h){if(tg(h)||$s(h))Ca(h,es(h),u);else for(var m in h)pi.call(h,m)&&qa(u,m,h[m])}),_T=Fl(function(u,h){Ca(h,Is(h),u)}),qd=Fl(function(u,h,m,b){Ca(h,Is(h),u,b)}),yT=Fl(function(u,h,m,b){Ca(h,es(h),u,b)}),ZC=Qa(P_),bT=wn(function(u,h){u=fi(u);var m=-1,b=h.length,M=b>2?h[2]:L;for(M&&_s(h[0],h[1],M)&&(b=1);++m1),P}),Ca(u,W_(u),m),b&&(m=ps(m,7,Zp));for(var M=h.length;M--;)Ou(m,h[M]);return m}),MT=Qa(function(u,h){return null==u?{}:function(u,h){return U0(u,h,function(m,b){return pg(u,b)})}(u,h)});function rw(u,h){if(null==u)return{};var m=hi(W_(u),function(b){return[b]});return h=Ut(h),U0(u,m,function(b,M){return h(b,M[0])})}var xT=Nu(es),ow=Nu(Is);function Zd(u){return null==u?[]:g_(u,es(u))}var IT=Nl(function(u,h,m){return h=h.toLowerCase(),u+(m?Iy(h):h)});function Iy(u){return _g(Zn(u).toLowerCase())}function Py(u){return(u=Zn(u))&&u.replace(_c,s2).replace(d_,"")}var RT=Nl(function(u,h,m){return u+(m?"-":"")+h.toLowerCase()}),kT=Nl(function(u,h,m){return u+(m?" ":"")+h.toLowerCase()}),$2=qp("toLowerCase"),VT=Nl(function(u,h,m){return u+(m?"_":"")+h.toLowerCase()}),Fy=Nl(function(u,h,m){return u+(m?" ":"")+_g(h)}),hw=Nl(function(u,h,m){return u+(m?" ":"")+h.toUpperCase()}),_g=qp("toUpperCase");function Vy(u,h,m){return u=Zn(u),(h=m?L:h)===L?function(q){return Dl.test(q)}(u)?function(q){return q.match(b0)||[]}(u):function(q){return q.match(an)||[]}(u):u.match(h)||[]}var zy=wn(function(u,h){try{return Ar(u,L,h)}catch(m){return Ea(m)?m:new Rt(m)}}),fw=Qa(function(u,h){return hs(h,function(m){m=mn(m),Ya(u,m,cf(u[m],u))}),u});function jy(u){return function(){return u}}var W2=Fu(),Fc=Fu(!0);function Ps(u){return u}function Vu(u){return t1("function"==typeof u?u:ps(u,1))}var Uy=wn(function(u,h){return function(m){return ba(m,u,h)}}),pw=wn(function(u,h){return function(m){return ba(u,m,h)}});function Hy(u,h,m){var b=es(h),M=Qh(h,b);null==m&&(!Xi(h)||!M.length&&b.length)&&(m=h,h=u,u=this,M=Qh(h,es(h)));var P=!(Xi(m)&&"chain"in m&&!m.chain),z=Wo(u);return hs(M,function(H){var X=h[H];u[H]=X,z&&(u.prototype[H]=function(){var be=this.__chain__;if(P||be){var Ce=u(this.__wrapped__),Re=Ce.__actions__=Ds(this.__actions__);return Re.push({func:X,args:arguments,thisArg:u}),Ce.__chain__=be,Ce}return X.apply(u,fr([this.value()],arguments))})}),u}function $y(){}var WT=Yp(hi),qT=Yp(gn),mw=Yp(go);function zu(u){return Uo(u)?f_(mn(u)):function(u){return function(h){return Bo(h,u)}}(u)}var XT=K0(),KT=K0(!0);function Nc(){return[]}function Wy(){return!1}var Nt=$_(function(u,h){return u+h},0),qy=Vd("ceil"),Y2=$_(function(u,h){return u/h},1),jl=Vd("floor"),bw=$_(function(u,h){return u*h},1),Cw=Vd("round"),ww=$_(function(u,h){return u-h},0);return O.after=function(u,h){if("function"!=typeof h)throw new ga(ft);return u=hn(u),function(){if(--u<1)return h.apply(this,arguments)}},O.ary=cg,O.assign=mT,O.assignIn=_T,O.assignInWith=qd,O.assignWith=yT,O.at=ZC,O.before=yy,O.bind=cf,O.bindAll=fw,O.bindKey=Wd,O.castArray=function(){if(!arguments.length)return[];var u=arguments[0];return Bt(u)?u:[u]},O.chain=dy,O.chunk=function(u,h,m){h=(m?_s(u,h,m):h===L)?1:pr(hn(h),0);var b=null==u?0:u.length;if(!b||h<1)return[];for(var M=0,P=0,z=se(Oe(b/h));MM?0:M+m),(b=b===L||b>M?M:hn(b))<0&&(b+=M),b=m>b?0:Ty(b);m>>0)?(u=Zn(u))&&("string"==typeof h||null!=h&&!YC(h))&&!(h=vo(h))&&Lh(u)?Ka($a(u),0,m):u.split(h,m):[]},O.spread=function(u,h){if("function"!=typeof u)throw new ga(ft);return h=null==h?0:pr(hn(h),0),wn(function(m){var b=m[h],M=Ka(m,0,h);return b&&fr(M,b),Ar(u,this,M)})},O.tail=function(u){var h=null==u?0:u.length;return h?Qr(u,1,h):[]},O.take=function(u,h,m){return u&&u.length?Qr(u,0,(h=m||h===L?1:hn(h))<0?0:h):[]},O.takeRight=function(u,h,m){var b=null==u?0:u.length;return b?Qr(u,(h=b-(h=m||h===L?1:hn(h)))<0?0:h,b):[]},O.takeRightWhile=function(u,h){return u&&u.length?Iu(u,Ut(h,3),!1,!0):[]},O.takeWhile=function(u,h){return u&&u.length?Iu(u,Ut(h,3)):[]},O.tap=function(u,h){return h(u),u},O.throttle=function(u,h,m){var b=!0,M=!0;if("function"!=typeof u)throw new ga(ft);return Xi(m)&&(b="leading"in m?!!m.leading:b,M="trailing"in m?!!m.trailing:M),NC(u,h,{leading:b,maxWait:h,trailing:M})},O.thru=$d,O.toArray=XC,O.toPairs=xT,O.toPairsIn=ow,O.toPath=function(u){return Bt(u)?hi(u,mn):qo(u)?[u]:Ds(lC(Zn(u)))},O.toPlainObject=KC,O.transform=function(u,h,m){var b=Bt(u),M=b||nl(u)||df(u);if(h=Ut(h,4),null==m){var P=u&&u.constructor;m=M?b?new P:[]:Xi(u)&&Wo(P)?xu(ma(u)):{}}return(M?hs:Xa)(u,function(z,H,X){return h(m,z,H,X)}),m},O.unary=function(u){return cg(u,1)},O.union=yC,O.unionBy=ly,O.unionWith=sg,O.uniq=function(u){return u&&u.length?Tc(u):[]},O.uniqBy=function(u,h){return u&&u.length?Tc(u,Ut(h,2)):[]},O.uniqWith=function(u,h){return h="function"==typeof h?h:L,u&&u.length?Tc(u,L,h):[]},O.unset=function(u,h){return null==u||Ou(u,h)},O.unzip=vC,O.unzipWith=j1,O.update=function(u,h,m){return null==u?u:$p(u,h,U_(m))},O.updateWith=function(u,h,m,b){return b="function"==typeof b?b:L,null==u?u:$p(u,h,U_(m),b)},O.values=Zd,O.valuesIn=function(u){return null==u?[]:g_(u,Is(u))},O.without=bC,O.words=Vy,O.wrap=function(u,h){return ug(U_(h),u)},O.xor=R2,O.xorBy=Co,O.xorWith=cy,O.zip=uy,O.zipObject=function(u,h){return Gp(u||[],h||[],qa)},O.zipObjectDeep=function(u,h){return Gp(u||[],h||[],Hp)},O.zipWith=lf,O.entries=xT,O.entriesIn=ow,O.extend=_T,O.extendWith=qd,Hy(O,O),O.add=Nt,O.attempt=zy,O.camelCase=IT,O.capitalize=Iy,O.ceil=qy,O.clamp=function(u,h,m){return m===L&&(m=h,h=L),m!==L&&(m=(m=Gs(m))==m?m:0),h!==L&&(h=(h=Gs(h))==h?h:0),Tu(Gs(u),h,m)},O.clone=function(u){return ps(u,4)},O.cloneDeep=function(u){return ps(u,5)},O.cloneDeepWith=function(u,h){return ps(u,5,h="function"==typeof h?h:L)},O.cloneWith=function(u,h){return ps(u,4,h="function"==typeof h?h:L)},O.conformsTo=function(u,h){return null==h||Vp(u,h,es(h))},O.deburr=Py,O.defaultTo=function(u,h){return null==u||u!=u?h:u},O.divide=Y2,O.endsWith=function(u,h,m){u=Zn(u),h=vo(h);var b=u.length,M=m=m===L?b:Tu(hn(m),0,b);return(m-=h.length)>=0&&u.slice(m,M)==h},O.eq=kt,O.escape=function(u){return(u=Zn(u))&&Je.test(u)?u.replace(mu,o2):u},O.escapeRegExp=function(u){return(u=Zn(u))&&Z.test(u)?u.replace(B,"\\$&"):u},O.every=function(u,h,m){var b=Bt(u)?gn:L0;return m&&_s(u,h,m)&&(h=L),b(u,Ut(h,3))},O.find=q1,O.findIndex=ny,O.findKey=function(u,h){return Fh(u,Ut(h,3),Xa)},O.findLast=Y1,O.findLastIndex=iy,O.findLastKey=function(u,h){return Fh(u,Ut(h,3),zp)},O.floor=jl,O.forEach=my,O.forEachRight=og,O.forIn=function(u,h){return null==u?u:Dd(u,Ut(h,3),Is)},O.forInRight=function(u,h){return null==u?u:Od(u,Ut(h,3),Is)},O.forOwn=function(u,h){return u&&Xa(u,Ut(h,3))},O.forOwnRight=function(u,h){return u&&zp(u,Ut(h,3))},O.get=pf,O.gt=G,O.gte=UC,O.has=function(u,h){return null!=u&&iC(u,h,Id)},O.hasIn=pg,O.head=uC,O.identity=Ps,O.includes=function(u,h,m,b){u=$s(u)?u:Zd(u),m=m&&!b?hn(m):0;var M=u.length;return m<0&&(m=pr(M+m,0)),My(u)?m<=M&&u.indexOf(h,m)>-1:!!M&&Ha(u,h,m)>-1},O.indexOf=function(u,h,m){var b=null==u?0:u.length;if(!b)return-1;var M=null==m?0:hn(m);return M<0&&(M=pr(b+M,0)),Ha(u,h,M)},O.inRange=function(u,h,m){return h=il(h),m===L?(m=h,h=0):m=il(m),function(u,h,m){return u>=Lr(h,m)&&u=-Gn&&u<=Gn},O.isSet=gT,O.isString=My,O.isSymbol=qo,O.isTypedArray=df,O.isUndefined=function(u){return u===L},O.isWeakMap=function(u){return Ki(u)&&ms(u)==di},O.isWeakSet=function(u){return Ki(u)&&"[object WeakSet]"==Kr(u)},O.join=function(u,h){return null==u?"":Uh.call(u,h)},O.kebabCase=RT,O.last=Ho,O.lastIndexOf=function(u,h,m){var b=null==u?0:u.length;if(!b)return-1;var M=b;return m!==L&&(M=(M=hn(m))<0?pr(b+M,0):Lr(M,b-1)),h==h?function(q,fe,se){for(var lt=se+1;lt--;)if(q[lt]===fe)return lt;return lt}(u,h,M):bd(u,Cc,M,!0)},O.lowerCase=kT,O.lowerFirst=$2,O.lt=Rc,O.lte=xy,O.max=function(u){return u&&u.length?Zh(u,Ps,Zr):L},O.maxBy=function(u,h){return u&&u.length?Zh(u,Ut(h,2),Zr):L},O.mean=function(u){return qr(u,Ps)},O.meanBy=function(u,h){return qr(u,Ut(h,2))},O.min=function(u){return u&&u.length?Zh(u,Ps,j0):L},O.minBy=function(u,h){return u&&u.length?Zh(u,Ut(h,2),j0):L},O.stubArray=Nc,O.stubFalse=Wy,O.stubObject=function(){return{}},O.stubString=function(){return""},O.stubTrue=function(){return!0},O.multiply=bw,O.nth=function(u,h){return u&&u.length?Du(u,hn(h)):L},O.noConflict=function(){return Kn._===this&&(Kn._=C_),this},O.noop=$y,O.now=Bu,O.pad=function(u,h,m){u=Zn(u);var b=(h=hn(h))?Bh(u):0;if(!h||b>=h)return u;var M=(h-b)/2;return Xp(Dn(M),m)+u+Xp(Oe(M),m)},O.padEnd=function(u,h,m){u=Zn(u);var b=(h=hn(h))?Bh(u):0;return h&&bh){var b=u;u=h,h=b}if(m||u%1||h%1){var M=Hh();return Lr(u+M*(h-u+Ax("1e-"+((M+"").length-1))),h)}return kl(u,h)},O.reduce=function(u,h,m){var b=Bt(u)?wu:No,M=arguments.length<3;return b(u,Ut(h,4),m,M,Mc)},O.reduceRight=function(u,h,m){var b=Bt(u)?vd:No,M=arguments.length<3;return b(u,Ut(h,4),m,M,k_)},O.repeat=function(u,h,m){return h=(m?_s(u,h,m):h===L)?1:hn(h),Up(Zn(u),h)},O.replace=function(){var u=arguments,h=Zn(u[0]);return u.length<3?h:h.replace(u[1],u[2])},O.result=function(u,h,m){var b=-1,M=(h=Dc(h,u)).length;for(M||(M=1,u=L);++bGn)return[];var m=jt,b=Lr(u,jt);h=Ut(h),u-=jt;for(var M=wd(b,h);++m=P)return u;var H=m-Bh(b);if(H<1)return b;var X=z?Ka(z,0,H).join(""):u.slice(0,H);if(M===L)return X+b;if(z&&(H+=X.length-H),YC(M)){if(u.slice(H).search(M)){var be,Ce=X;for(M.global||(M=v_(M.source,Zn(ln.exec(M))+"g")),M.lastIndex=0;be=M.exec(Ce);)var Re=be.index;X=X.slice(0,Re===L?H:Re)}}else if(u.indexOf(vo(M),H)!=H){var et=X.lastIndexOf(M);et>-1&&(X=X.slice(0,et))}return X+b},O.unescape=function(u){return(u=Zn(u))&&Vs.test(u)?u.replace(pd,y_):u},O.uniqueId=function(u){var h=++f2;return Zn(u)+h},O.upperCase=hw,O.upperFirst=_g,O.each=my,O.eachRight=og,O.first=uC,Hy(O,function(){var u={};return Xa(O,function(h,m){pi.call(O.prototype,m)||(u[m]=h)}),u}(),{chain:!1}),O.VERSION="4.17.21",hs(["bind","bindKey","curry","curryRight","partial","partialRight"],function(u){O[u].placeholder=O}),hs(["drop","take"],function(u,h){Cn.prototype[u]=function(m){m=m===L?1:pr(hn(m),0);var b=this.__filtered__&&!h?new Cn(this):this.clone();return b.__filtered__?b.__takeCount__=Lr(m,b.__takeCount__):b.__views__.push({size:Lr(m,jt),type:u+(b.__dir__<0?"Right":"")}),b},Cn.prototype[u+"Right"]=function(m){return this.reverse()[u](m).reverse()}}),hs(["filter","map","takeWhile"],function(u,h){var m=h+1,b=1==m||3==m;Cn.prototype[u]=function(M){var P=this.clone();return P.__iteratees__.push({iteratee:Ut(M,3),type:m}),P.__filtered__=P.__filtered__||b,P}}),hs(["head","last"],function(u,h){var m="take"+(h?"Right":"");Cn.prototype[u]=function(){return this[m](1).value()[0]}}),hs(["initial","tail"],function(u,h){var m="drop"+(h?"":"Right");Cn.prototype[u]=function(){return this.__filtered__?new Cn(this):this[m](1)}}),Cn.prototype.compact=function(){return this.filter(Ps)},Cn.prototype.find=function(u){return this.filter(u).head()},Cn.prototype.findLast=function(u){return this.reverse().find(u)},Cn.prototype.invokeMap=wn(function(u,h){return"function"==typeof u?new Cn(this):this.map(function(m){return ba(m,u,h)})}),Cn.prototype.reject=function(u){return this.filter(Cy(Ut(u)))},Cn.prototype.slice=function(u,h){u=hn(u);var m=this;return m.__filtered__&&(u>0||h<0)?new Cn(m):(u<0?m=m.takeRight(-u):u&&(m=m.drop(u)),h!==L&&(m=(h=hn(h))<0?m.dropRight(-h):m.take(h-u)),m)},Cn.prototype.takeRightWhile=function(u){return this.reverse().takeWhile(u).reverse()},Cn.prototype.toArray=function(){return this.take(jt)},Xa(Cn.prototype,function(u,h){var m=/^(?:filter|find|map|reject)|While$/.test(h),b=/^(?:head|last)$/.test(h),M=O[b?"take"+("last"==h?"Right":""):h],P=b||/^find/.test(h);!M||(O.prototype[h]=function(){var z=this.__wrapped__,H=b?[1]:arguments,X=z instanceof Cn,be=H[0],Ce=X||Bt(z),Re=function(Sn){var Bn=M.apply(O,fr([Sn],H));return b&&et?Bn[0]:Bn};Ce&&m&&"function"==typeof be&&1!=be.length&&(X=Ce=!1);var et=this.__chain__,St=!!this.__actions__.length,Wt=P&&!et,En=X&&!St;if(!P&&Ce){z=En?z:new Cn(this);var Xt=u.apply(z,H);return Xt.__actions__.push({func:$d,args:[Re],thisArg:L}),new _o(Xt,et)}return Wt&&En?u.apply(this,H):(Xt=this.thru(Re),Wt?b?Xt.value()[0]:Xt.value():Xt)})}),hs(["pop","push","shift","sort","splice","unshift"],function(u){var h=Ii[u],m=/^(?:push|sort|unshift)$/.test(u)?"tap":"thru",b=/^(?:pop|shift)$/.test(u);O.prototype[u]=function(){var M=arguments;if(b&&!this.__chain__){var P=this.value();return h.apply(Bt(P)?P:[],M)}return this[m](function(z){return h.apply(Bt(z)?z:[],M)})}}),Xa(Cn.prototype,function(u,h){var m=O[h];if(m){var b=m.name+"";pi.call(Md,b)||(Md[b]=[]),Md[b].push({name:h,func:m})}}),Md[Ic(L,2).name]=[{name:"wrapper",func:L}],Cn.prototype.clone=function(){var u=new Cn(this.__wrapped__);return u.__actions__=Ds(this.__actions__),u.__dir__=this.__dir__,u.__filtered__=this.__filtered__,u.__iteratees__=Ds(this.__iteratees__),u.__takeCount__=this.__takeCount__,u.__views__=Ds(this.__views__),u},Cn.prototype.reverse=function(){if(this.__filtered__){var u=new Cn(this);u.__dir__=-1,u.__filtered__=!0}else(u=this.clone()).__dir__*=-1;return u},Cn.prototype.value=function(){var u=this.__wrapped__.value(),h=this.__dir__,m=Bt(u),b=h<0,M=m?u.length:0,P=function(u,h,m){for(var b=-1,M=m.length;++b=this.__values__.length;return{done:u,value:u?L:this.__values__[this.__index__++]}},O.prototype.plant=function(u){for(var h,m=this;m instanceof qh;){var b=Ud(m);b.__index__=0,b.__values__=L,h?M.__wrapped__=b:h=b;var M=b;m=m.__wrapped__}return M.__wrapped__=u,h},O.prototype.reverse=function(){var u=this.__wrapped__;if(u instanceof Cn){var h=u;return this.__actions__.length&&(h=new Cn(this)),(h=h.reverse()).__actions__.push({func:$d,args:[ay],thisArg:L}),new _o(h,this.__chain__)}return this.thru(ay)},O.prototype.toJSON=O.prototype.valueOf=O.prototype.value=function(){return s1(this.__wrapped__,this.__actions__)},O.prototype.first=O.prototype.head,jh&&(O.prototype[jh]=function(){return this}),O}();Kn._=Vh,(wt=function(){return Vh}.call(We,ze,We,gt))!==L&&(gt.exports=wt)}.call(this)},478:function(gt){gt.exports=function(){"use strict";function We(W,Y){for(var J=0;JW.length)&&(Y=W.length);for(var J=0,T=new Array(Y);J=W.length?{done:!0}:{done:!1,value:W[T++]}}}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 Pt={exports:{}};function Ke(){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}}Pt.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:Ke,changeDefaults:function(W){Pt.exports.defaults=W}};var Ze=/[&<>"']/,Tt=/[&<>"']/g,Ft=/[<>"']|&(?!#?\w+;)/,we=/[<>"']|&(?!#?\w+;)/g,_e={"&":"&","<":"<",">":">",'"':""","'":"'"},ke=function(Y){return _e[Y]};var Te=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function Vt(W){return W.replace(Te,function(Y,J){return"colon"===(J=J.toLowerCase())?":":"#"===J.charAt(0)?"x"===J.charAt(1)?String.fromCharCode(parseInt(J.substring(2),16)):String.fromCharCode(+J.substring(1)):""})}var He=/(^|[^\[])\^/g;var xt=/[^\w:]/g,tn=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;var Ei={},vi=/^[^:]+:\/*[^/]*$/,bi=/^([^:]+:)[\s\S]*$/,Mr=/^([^:]+:\/*[^/]*)[\s\S]*$/;function Ve(W,Y){Ei[" "+W]||(Ei[" "+W]=vi.test(W)?W+"/":Qt(W,"/",!0));var J=-1===(W=Ei[" "+W]).indexOf(":");return"//"===Y.substring(0,2)?J?Y:W.replace(bi,"$1")+Y:"/"===Y.charAt(0)?J?Y:W.replace(Mr,"$1")+Y:W+Y}function Qt(W,Y,J){var T=W.length;if(0===T)return"";for(var D=0;D1;)1&Y&&(J+=W),Y>>=1,W+=W;return J+W},Gn=Pt.exports.defaults,Ae=Qt,Ri=function(W,Y){var T=W.replace(/\|/g,function(B,Z,$){for(var le=!1,he=Z;--he>=0&&"\\"===$[he];)le=!le;return le?"|":" |"}).split(/ \|/),D=0;if(T.length>Y)T.splice(Y);else for(;T.length1?{type:"space",raw:D[0]}:{raw:"\n"}},Y.code=function(T){var D=this.rules.block.code.exec(T);if(D){var B=D[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:D[0],codeBlockStyle:"indented",text:this.options.pedantic?B:Ae(B,"\n")}}},Y.fences=function(T){var D=this.rules.block.fences.exec(T);if(D){var B=D[0],Z=function(W,Y){var J=W.match(/^(\s+)(?:```)/);if(null===J)return Y;var T=J[1];return Y.split("\n").map(function(D){var B=D.match(/^\s+/);return null===B?D:B[0].length>=T.length?D.slice(T.length):D}).join("\n")}(B,D[3]||"");return{type:"code",raw:B,lang:D[2]?D[2].trim():D[2],text:Z}}},Y.heading=function(T){var D=this.rules.block.heading.exec(T);if(D){var B=D[2].trim();if(/#$/.test(B)){var Z=Ae(B,"#");(this.options.pedantic||!Z||/ $/.test(Z))&&(B=Z.trim())}return{type:"heading",raw:D[0],depth:D[1].length,text:B}}},Y.nptable=function(T){var D=this.rules.block.nptable.exec(T);if(D){var B={type:"table",header:Ri(D[1].replace(/^ *| *\| *$/g,"")),align:D[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:D[3]?D[3].replace(/\n$/,"").split("\n"):[],raw:D[0]};if(B.header.length===B.align.length){var $,Z=B.align.length;for($=0;$ ?/gm,"");return{type:"blockquote",raw:D[0],text:B}}},Y.list=function(T){var D=this.rules.block.list.exec(T);if(D){var Ge,an,xn,qt,Et,ln,ri,Hi,$i,B=D[0],Z=D[2],$=Z.length>1,le={type:"list",raw:B,ordered:$,start:$?+Z.slice(0,-1):"",loose:!1,items:[]},he=D[0].match(this.rules.block.item),pe=!1,_n=he.length;xn=this.rules.block.listItemStart.exec(he[0]);for(var Ci=0;Ci<_n;Ci++){if(B=Ge=he[Ci],this.options.pedantic||($i=Ge.match(new RegExp("\\n\\s*\\n {0,"+(xn[0].length-1)+"}\\S")))&&(Et=Ge.length-$i.index+he.slice(Ci+1).join("\n").length,le.raw=le.raw.substring(0,le.raw.length-Et),B=Ge=Ge.substring(0,$i.index),_n=Ci+1),Ci!==_n-1){if(qt=this.rules.block.listItemStart.exec(he[Ci+1]),this.options.pedantic?qt[1].length>xn[1].length:qt[1].length>=xn[0].length||qt[1].length>3){he.splice(Ci,2,he[Ci]+(!this.options.pedantic&&qt[1].length/i.test(Z[0])&&(D=!1),!B&&/^<(pre|code|kbd|script)(\s|>)/i.test(Z[0])?B=!0:B&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(Z[0])&&(B=!1),{type:this.options.sanitize?"text":"html",raw:Z[0],inLink:D,inRawBlock:B,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Z[0]):jt(Z[0]):Z[0]}},Y.link=function(T){var D=this.rules.inline.link.exec(T);if(D){var B=D[2].trim();if(!this.options.pedantic&&/^$/.test(B))return;var Z=Ae(B.slice(0,-1),"\\");if((B.length-Z.length)%2==0)return}else{var $=xr(D[2],"()");if($>-1){var he=(0===D[0].indexOf("!")?5:4)+D[1].length+$;D[2]=D[2].substring(0,$),D[0]=D[0].substring(0,he).trim(),D[3]=""}}var pe=D[2],Ge="";if(this.options.pedantic){var an=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(pe);an&&(pe=an[1],Ge=an[3])}else Ge=D[3]?D[3].slice(1,-1):"";return pe=pe.trim(),/^$/.test(B)?pe.slice(1):pe.slice(1,-1)),ls(D,{href:pe&&pe.replace(this.rules.inline._escapes,"$1"),title:Ge&&Ge.replace(this.rules.inline._escapes,"$1")},D[0])}},Y.reflink=function(T,D){var B;if((B=this.rules.inline.reflink.exec(T))||(B=this.rules.inline.nolink.exec(T))){var Z=(B[2]||B[1]).replace(/\s+/g," ");if(!(Z=D[Z.toLowerCase()])||!Z.href){var $=B[0].charAt(0);return{type:"text",raw:$,text:$}}return ls(B,Z,B[0])}},Y.emStrong=function(T,D,B){void 0===B&&(B="");var Z=this.rules.inline.emStrong.lDelim.exec(T);if(Z&&(!Z[3]||!B.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 $=Z[1]||Z[2]||"";if(!$||$&&(""===B||this.rules.inline.punctuation.exec(B))){var he,pe,le=Z[0].length-1,Ge=le,an=0,xn="*"===Z[0][0]?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(xn.lastIndex=0,D=D.slice(-1*T.length+le);null!=(Z=xn.exec(D));)if(he=Z[1]||Z[2]||Z[3]||Z[4]||Z[5]||Z[6]){if(pe=he.length,Z[3]||Z[4]){Ge+=pe;continue}if((Z[5]||Z[6])&&le%3&&!((le+pe)%3)){an+=pe;continue}if(!((Ge-=pe)>0))return pe=Math.min(pe,pe+Ge+an),Math.min(le,pe)%2?{type:"em",raw:T.slice(0,le+Z.index+pe+1),text:T.slice(1,le+Z.index+pe)}:{type:"strong",raw:T.slice(0,le+Z.index+pe+1),text:T.slice(2,le+Z.index+pe-1)}}}}},Y.codespan=function(T){var D=this.rules.inline.code.exec(T);if(D){var B=D[2].replace(/\n/g," "),Z=/[^ ]/.test(B),$=/^ /.test(B)&&/ $/.test(B);return Z&&$&&(B=B.substring(1,B.length-1)),B=jt(B,!0),{type:"codespan",raw:D[0],text:B}}},Y.br=function(T){var D=this.rules.inline.br.exec(T);if(D)return{type:"br",raw:D[0]}},Y.del=function(T){var D=this.rules.inline.del.exec(T);if(D)return{type:"del",raw:D[0],text:D[2]}},Y.autolink=function(T,D){var Z,$,B=this.rules.inline.autolink.exec(T);if(B)return $="@"===B[2]?"mailto:"+(Z=jt(this.options.mangle?D(B[1]):B[1])):Z=jt(B[1]),{type:"link",raw:B[0],text:Z,href:$,tokens:[{type:"text",raw:Z,text:Z}]}},Y.url=function(T,D){var B;if(B=this.rules.inline.url.exec(T)){var Z,$;if("@"===B[2])$="mailto:"+(Z=jt(this.options.mangle?D(B[0]):B[0]));else{var le;do{le=B[0],B[0]=this.rules.inline._backpedal.exec(B[0])[0]}while(le!==B[0]);Z=jt(B[0]),$="www."===B[1]?"http://"+Z:Z}return{type:"link",raw:B[0],text:Z,href:$,tokens:[{type:"text",raw:Z,text:Z}]}}},Y.inlineText=function(T,D,B){var $,Z=this.rules.inline.text.exec(T);if(Z)return $=D?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Z[0]):jt(Z[0]):Z[0]:jt(this.options.smartypants?B(Z[0]):Z[0]),{type:"text",raw:Z[0],text:$}},W}(),aa=pn_noopTest,Xn=pn_edit,ci=pn_merge,pt={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:aa,table:aa,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?'|\([^()]*\))/};pt.def=Xn(pt.def).replace("label",pt._label).replace("title",pt._title).getRegex(),pt.bullet=/(?:[*+-]|\d{1,9}[.)])/,pt.item=/^( *)(bull) ?[^\n]*(?:\n(?! *bull ?)[^\n]*)*/,pt.item=Xn(pt.item,"gm").replace(/bull/g,pt.bullet).getRegex(),pt.listItemStart=Xn(/^( *)(bull) */).replace("bull",pt.bullet).getRegex(),pt.list=Xn(pt.list).replace(/bull/g,pt.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+pt.def.source+")").getRegex(),pt._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",pt._comment=/|$)/,pt.html=Xn(pt.html,"i").replace("comment",pt._comment).replace("tag",pt._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),pt.paragraph=Xn(pt._paragraph).replace("hr",pt.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",pt._tag).getRegex(),pt.blockquote=Xn(pt.blockquote).replace("paragraph",pt.paragraph).getRegex(),pt.normal=ci({},pt),pt.gfm=ci({},pt.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*|$)"}),pt.gfm.nptable=Xn(pt.gfm.nptable).replace("hr",pt.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",pt._tag).getRegex(),pt.gfm.table=Xn(pt.gfm.table).replace("hr",pt.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",pt._tag).getRegex(),pt.pedantic=ci({},pt.normal,{html:Xn("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",pt._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:aa,paragraph:Xn(pt.normal._paragraph).replace("hr",pt.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",pt.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var Ye={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:aa,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:aa,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~"};Ye.punctuation=Xn(Ye.punctuation).replace(/punctuation/g,Ye._punctuation).getRegex(),Ye.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,Ye.escapedEmSt=/\\\*|\\_/g,Ye._comment=Xn(pt._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),Ye.emStrong.lDelim=Xn(Ye.emStrong.lDelim).replace(/punct/g,Ye._punctuation).getRegex(),Ye.emStrong.rDelimAst=Xn(Ye.emStrong.rDelimAst,"g").replace(/punct/g,Ye._punctuation).getRegex(),Ye.emStrong.rDelimUnd=Xn(Ye.emStrong.rDelimUnd,"g").replace(/punct/g,Ye._punctuation).getRegex(),Ye._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,Ye._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,Ye._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])?)+(?![-_])/,Ye.autolink=Xn(Ye.autolink).replace("scheme",Ye._scheme).replace("email",Ye._email).getRegex(),Ye._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,Ye.tag=Xn(Ye.tag).replace("comment",Ye._comment).replace("attribute",Ye._attribute).getRegex(),Ye._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Ye._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,Ye._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,Ye.link=Xn(Ye.link).replace("label",Ye._label).replace("href",Ye._href).replace("title",Ye._title).getRegex(),Ye.reflink=Xn(Ye.reflink).replace("label",Ye._label).getRegex(),Ye.reflinkSearch=Xn(Ye.reflinkSearch,"g").replace("reflink",Ye.reflink).replace("nolink",Ye.nolink).getRegex(),Ye.normal=ci({},Ye),Ye.pedantic=ci({},Ye.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:Xn(/^!?\[(label)\]\((.*?)\)/).replace("label",Ye._label).getRegex(),reflink:Xn(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Ye._label).getRegex()}),Ye.gfm=ci({},Ye.normal,{escape:Xn(Ye.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&&(T="x"+T.toString(16)),Y+="&#"+T+";";return Y}var ui=function(){function W(J){this.tokens=[],this.tokens.links=Object.create(null),this.options=J||La,this.options.tokenizer=this.options.tokenizer||new la,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var T={block:Fi.normal,inline:$r.normal};this.options.pedantic?(T.block=Fi.pedantic,T.inline=$r.pedantic):this.options.gfm&&(T.block=Fi.gfm,T.inline=this.options.breaks?$r.breaks:$r.gfm),this.tokenizer.rules=T}W.lex=function(T,D){return new W(D).lex(T)},W.lexInline=function(T,D){return new W(D).inlineTokens(T)};var Y=W.prototype;return Y.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},Y.blockTokens=function(T,D,B){var $,le,he,pe,Ge,an,Z=this;for(void 0===D&&(D=[]),void 0===B&&(B=!0),this.options.pedantic&&(T=T.replace(/^ +$/gm,""));T;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(function(qt){return!!($=qt.call(Z,T,D))&&(T=T.substring($.raw.length),D.push($),!0)}))){if($=this.tokenizer.space(T)){T=T.substring($.raw.length),$.type&&D.push($);continue}if($=this.tokenizer.code(T)){T=T.substring($.raw.length),(pe=D[D.length-1])&&"paragraph"===pe.type?(pe.raw+="\n"+$.raw,pe.text+="\n"+$.text):D.push($);continue}if($=this.tokenizer.fences(T)){T=T.substring($.raw.length),D.push($);continue}if($=this.tokenizer.heading(T)){T=T.substring($.raw.length),D.push($);continue}if($=this.tokenizer.nptable(T)){T=T.substring($.raw.length),D.push($);continue}if($=this.tokenizer.hr(T)){T=T.substring($.raw.length),D.push($);continue}if($=this.tokenizer.blockquote(T)){T=T.substring($.raw.length),$.tokens=this.blockTokens($.text,[],B),D.push($);continue}if($=this.tokenizer.list(T)){for(T=T.substring($.raw.length),he=$.items.length,le=0;le=0&&(qt=Math.min(qt,ln))}),qt<1/0&&qt>=0&&(Ge=T.substring(0,qt+1))}(),B&&($=this.tokenizer.paragraph(Ge))){pe=D[D.length-1],an&&"paragraph"===pe.type?(pe.raw+="\n"+$.raw,pe.text+="\n"+$.text):D.push($),an=Ge.length!==T.length,T=T.substring($.raw.length);continue}if($=this.tokenizer.text(T)){T=T.substring($.raw.length),(pe=D[D.length-1])&&"text"===pe.type?(pe.raw+="\n"+$.raw,pe.text+="\n"+$.text):D.push($);continue}if(T){var xn="Infinite loop on byte: "+T.charCodeAt(0);if(this.options.silent){console.error(xn);break}throw new Error(xn)}}return D},Y.inline=function(T){var D,B,Z,$,le,he,pe=T.length;for(D=0;D0)for(;null!=(an=this.tokenizer.rules.inline.reflinkSearch.exec(Ge));)Et.includes(an[0].slice(an[0].lastIndexOf("[")+1,-1))&&(Ge=Ge.slice(0,an.index)+"["+Ba("a",an[0].length-2)+"]"+Ge.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(an=this.tokenizer.rules.inline.blockSkip.exec(Ge));)Ge=Ge.slice(0,an.index)+"["+Ba("a",an[0].length-2)+"]"+Ge.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(an=this.tokenizer.rules.inline.escapedEmSt.exec(Ge));)Ge=Ge.slice(0,an.index)+"++"+Ge.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;T;)if(xn||(qt=""),xn=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(function(ri){return!!(le=ri.call($,T,D))&&(T=T.substring(le.raw.length),D.push(le),!0)}))){if(le=this.tokenizer.escape(T)){T=T.substring(le.raw.length),D.push(le);continue}if(le=this.tokenizer.tag(T,B,Z)){T=T.substring(le.raw.length),B=le.inLink,Z=le.inRawBlock,(he=D[D.length-1])&&"text"===le.type&&"text"===he.type?(he.raw+=le.raw,he.text+=le.text):D.push(le);continue}if(le=this.tokenizer.link(T)){T=T.substring(le.raw.length),"link"===le.type&&(le.tokens=this.inlineTokens(le.text,[],!0,Z)),D.push(le);continue}if(le=this.tokenizer.reflink(T,this.tokens.links)){T=T.substring(le.raw.length),he=D[D.length-1],"link"===le.type?(le.tokens=this.inlineTokens(le.text,[],!0,Z),D.push(le)):he&&"text"===le.type&&"text"===he.type?(he.raw+=le.raw,he.text+=le.text):D.push(le);continue}if(le=this.tokenizer.emStrong(T,Ge,qt)){T=T.substring(le.raw.length),le.tokens=this.inlineTokens(le.text,[],B,Z),D.push(le);continue}if(le=this.tokenizer.codespan(T)){T=T.substring(le.raw.length),D.push(le);continue}if(le=this.tokenizer.br(T)){T=T.substring(le.raw.length),D.push(le);continue}if(le=this.tokenizer.del(T)){T=T.substring(le.raw.length),le.tokens=this.inlineTokens(le.text,[],B,Z),D.push(le);continue}if(le=this.tokenizer.autolink(T,lo)){T=T.substring(le.raw.length),D.push(le);continue}if(!B&&(le=this.tokenizer.url(T,lo))){T=T.substring(le.raw.length),D.push(le);continue}if(pe=T,this.options.extensions&&this.options.extensions.startInline&&function(){var ri=1/0,Hi=T.slice(1),$i=void 0;$.options.extensions.startInline.forEach(function(_n){"number"==typeof($i=_n.call(this,Hi))&&$i>=0&&(ri=Math.min(ri,$i))}),ri<1/0&&ri>=0&&(pe=T.substring(0,ri+1))}(),le=this.tokenizer.inlineText(pe,Z,ir)){T=T.substring(le.raw.length),"_"!==le.raw.slice(-1)&&(qt=le.raw.slice(-1)),xn=!0,(he=D[D.length-1])&&"text"===he.type?(he.raw+=le.raw,he.text+=le.text):D.push(le);continue}if(T){var ln="Infinite loop on byte: "+T.charCodeAt(0);if(this.options.silent){console.error(ln);break}throw new Error(ln)}}return D},function(W,Y,J){Y&&We(W.prototype,Y),J&&We(W,J)}(W,null,[{key:"rules",get:function(){return{block:Fi,inline:$r}}}]),W}(),Gr=Pt.exports.defaults,Nr=pn_cleanUrl,ii=pn_escape,pc=function(){function W(J){this.options=J||Gr}var Y=W.prototype;return Y.code=function(T,D,B){var Z=(D||"").match(/\S*/)[0];if(this.options.highlight){var $=this.options.highlight(T,Z);null!=$&&$!==T&&(B=!0,T=$)}return T=T.replace(/\n$/,"")+"\n",Z?'
    '+(B?T:ii(T,!0))+"
    \n":"
    "+(B?T:ii(T,!0))+"
    \n"},Y.blockquote=function(T){return"
    \n"+T+"
    \n"},Y.html=function(T){return T},Y.heading=function(T,D,B,Z){return this.options.headerIds?"'+T+"\n":""+T+"\n"},Y.hr=function(){return this.options.xhtml?"
    \n":"
    \n"},Y.list=function(T,D,B){var Z=D?"ol":"ul";return"<"+Z+(D&&1!==B?' start="'+B+'"':"")+">\n"+T+"\n"},Y.listitem=function(T){return"
  • "+T+"
  • \n"},Y.checkbox=function(T){return" "},Y.paragraph=function(T){return"

    "+T+"

    \n"},Y.table=function(T,D){return D&&(D=""+D+""),"\n\n"+T+"\n"+D+"
    \n"},Y.tablerow=function(T){return"\n"+T+"\n"},Y.tablecell=function(T,D){var B=D.header?"th":"td";return(D.align?"<"+B+' align="'+D.align+'">':"<"+B+">")+T+"\n"},Y.strong=function(T){return""+T+""},Y.em=function(T){return""+T+""},Y.codespan=function(T){return""+T+""},Y.br=function(){return this.options.xhtml?"
    ":"
    "},Y.del=function(T){return""+T+""},Y.link=function(T,D,B){if(null===(T=Nr(this.options.sanitize,this.options.baseUrl,T)))return B;var Z='"+B+""},Y.image=function(T,D,B){if(null===(T=Nr(this.options.sanitize,this.options.baseUrl,T)))return B;var Z=''+B+'":">")},Y.text=function(T){return T},W}(),co=function(){function W(){}var Y=W.prototype;return Y.strong=function(T){return T},Y.em=function(T){return T},Y.codespan=function(T){return T},Y.del=function(T){return T},Y.html=function(T){return T},Y.text=function(T){return T},Y.link=function(T,D,B){return""+B},Y.image=function(T,D,B){return""+B},Y.br=function(){return""},W}(),di=function(){function W(){this.seen={}}var Y=W.prototype;return Y.serialize=function(T){return T.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")},Y.getNextSafeSlug=function(T,D){var B=T,Z=0;if(this.seen.hasOwnProperty(B)){Z=this.seen[T];do{B=T+"-"+ ++Z}while(this.seen.hasOwnProperty(B))}return D||(this.seen[T]=Z,this.seen[B]=0),B},Y.slug=function(T,D){void 0===D&&(D={});var B=this.serialize(T);return this.getNextSafeSlug(B,D.dryrun)},W}(),Oh=pc,El=co,Va=di,uo=Pt.exports.defaults,za=pn_unescape,us=ui,ho=function(){function W(J){this.options=J||uo,this.options.renderer=this.options.renderer||new Oh,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new El,this.slugger=new Va}W.parse=function(T,D){return new W(D).parse(T)},W.parseInline=function(T,D){return new W(D).parseInline(T)};var Y=W.prototype;return Y.parse=function(T,D){void 0===D&&(D=!0);var Z,$,le,he,pe,Ge,an,xn,qt,Et,ln,ri,Hi,$i,_n,Ci,_c,fo,gd,B="",xl=T.length;for(Z=0;Z0&&"text"===_n.tokens[0].type?(_n.tokens[0].text=fo+" "+_n.tokens[0].text,_n.tokens[0].tokens&&_n.tokens[0].tokens.length>0&&"text"===_n.tokens[0].tokens[0].type&&(_n.tokens[0].tokens[0].text=fo+" "+_n.tokens[0].tokens[0].text)):_n.tokens.unshift({type:"text",text:fo}):$i+=fo),$i+=this.parse(_n.tokens,Hi),qt+=this.renderer.listitem($i,_c,Ci);B+=this.renderer.list(qt,ln,ri);continue;case"html":B+=this.renderer.html(Et.text);continue;case"paragraph":B+=this.renderer.paragraph(this.parseInline(Et.tokens));continue;case"text":for(qt=Et.tokens?this.parseInline(Et.tokens):Et.text;Z+1An error occurred:

    "+mc(le.message+"",!0)+"
    ";throw le}}return Je.options=Je.setOptions=function(W){return gu(Je.defaults,W),mu(Je.defaults),Je},Je.getDefaults=pd,Je.defaults=Vs,Je.use=function(){for(var W=this,Y=arguments.length,J=new Array(Y),T=0;TAn error occurred:

    "+mc(T.message+"",!0)+"
    ";throw T}},Je.Parser=ho,Je.parser=ho.parse,Je.Renderer=Sl,Je.TextRenderer=fu,Je.Lexer=us,Je.lexer=us.lex,Je.Tokenizer=gc,Je.Slugger=pu,Je.parse=Je,Je}()},310:(gt,We,ze)=>{"use strict";var wt=ze(948);Object.defineProperty(We,"__esModule",{value:!0}),We.isMobile=function(){return void 0!==L.window.orientation},We.default=function(Ze){if(!Ze&&!(0,It.default)())return"Node";if((0,Pt.default)(Ze))return"Electron";var Tt="undefined"!=typeof navigator?navigator:{},Ft=Ze||Tt.userAgent||"";if(Ft.indexOf("Edge")>-1)return"Edge";var we=-1!==Ft.indexOf("MSIE "),_e=-1!==Ft.indexOf("Trident/");return we||_e?"IE":L.window.chrome?"Chrome":L.window.safari?"Safari":L.window.mozInnerScreenX?"Firefox":"Unknown"};var L=ze(151),It=wt(ze(602)),Pt=wt(ze(344))},151:(gt,We,ze)=>{"use strict";var wt=ze(948);Object.defineProperty(We,"__esModule",{value:!0}),We.console=We.process=We.document=We.global=We.window=We.self=void 0;var L=wt(ze(321)),It={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,L.default)(process))&&process};We.self=It.self||It.window||It.global,We.window=It.window||It.self||It.global,We.global=It.global||It.self||It.window,We.document=It.document||{},We.process=It.process||{};var Ft=console;We.console=Ft},761:(gt,We,ze)=>{"use strict";var L=ze(948),It=ze(321);Object.defineProperty(We,"CO",{enumerable:!0,get:function(){return Pt.global}}),Object.defineProperty(We,"qs",{enumerable:!0,get:function(){return ft.default}});var Pt=ze(151),ft=(Ft(ze(602)),Ft(ze(310)));L(ze(344));function Tt(we){if("function"!=typeof WeakMap)return null;var _e=new WeakMap,ke=new WeakMap;return(Tt=function(Te){return Te?ke:_e})(we)}function Ft(we,_e){if(!_e&&we&&we.__esModule)return we;if(null===we||"object"!==It(we)&&"function"!=typeof we)return{default:we};var ke=Tt(_e);if(ke&&ke.has(we))return ke.get(we);var ye={},Te=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var Vt in we)if("default"!==Vt&&Object.prototype.hasOwnProperty.call(we,Vt)){var He=Te?Object.getOwnPropertyDescriptor(we,Vt):null;He&&(He.get||He.set)?Object.defineProperty(ye,Vt,He):ye[Vt]=we[Vt]}return ye.default=we,ke&&ke.set(we,ye),ye}},602:(gt,We,ze)=>{"use strict";var wt=ze(948);Object.defineProperty(We,"__esModule",{value:!0}),We.default=Pt,We.isBrowserMainThread=function(){return Pt()&&"undefined"!=typeof document};var L=wt(ze(321)),It=wt(ze(344));function Pt(){return!("object"===("undefined"==typeof process?"undefined":(0,L.default)(process))&&"[object process]"===String(process)&&!process.browser)||(0,It.default)()}},344:(gt,We,ze)=>{"use strict";var wt=ze(948);Object.defineProperty(We,"__esModule",{value:!0}),We.default=function(Pt){if("undefined"!=typeof window&&"object"===(0,L.default)(window.process)&&"renderer"===window.process.type||"undefined"!=typeof process&&"object"===(0,L.default)(process.versions)&&Boolean(process.versions.electron))return!0;var Ke="object"===("undefined"==typeof navigator?"undefined":(0,L.default)(navigator))&&"string"==typeof navigator.userAgent&&navigator.userAgent,ft=Pt||Ke;return!!(ft&&ft.indexOf("Electron")>=0)};var L=wt(ze(321))},851:(gt,We,ze)=>{"use strict";var wt={};ze.r(wt),ze.d(wt,{decode:()=>N0e,encode:()=>L0e});var L={};ze.r(L),ze.d(L,{decode:()=>U0e,encode:()=>H0e});var It={};ze.r(It),ze.d(It,{decode:()=>$0e,encode:()=>G0e});var Pt={};function Ke(n){return"function"==typeof n}ze.r(Pt),ze.d(Pt,{decode:()=>W0e,encode:()=>q0e});let ft=!1;const Ze={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 ft&&console.log("RxJS: Back to a better error behavior. Thank you. <3");ft=n},get useDeprecatedSynchronousErrorHandling(){return ft}};function Tt(n){setTimeout(()=>{throw n},0)}const Ft={closed:!0,next(n){},error(n){if(Ze.useDeprecatedSynchronousErrorHandling)throw n;Tt(n)},complete(){}},we=Array.isArray||(n=>n&&"number"==typeof n.length);function _e(n){return null!==n&&"object"==typeof n}const ye=(()=>{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 Te{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 Te)t.remove(this);else if(null!==t)for(let o=0;oe.concat(t instanceof ye?t.errors:t),[])}Te.EMPTY=((n=new Te).closed=!0,n);const He="function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random();class xt extends Te{constructor(e,t,i){switch(super(),this.syncErrorValue=null,this.syncErrorThrown=!1,this.syncErrorThrowable=!1,this.isStopped=!1,arguments.length){case 0:this.destination=Ft;break;case 1:if(!e){this.destination=Ft;break}if("object"==typeof e){e instanceof xt?(this.syncErrorThrowable=e.syncErrorThrowable,this.destination=e,e.add(this)):(this.syncErrorThrowable=!0,this.destination=new tn(this,e));break}default:this.syncErrorThrowable=!0,this.destination=new tn(this,e,t,i)}}[He](){return this}static create(e,t,i){const r=new xt(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 tn extends xt{constructor(e,t,i,r){super(),this._parentSubscriber=e;let s,o=this;Ke(t)?s=t:t&&(s=t.next,i=t.error,r=t.complete,t!==Ft&&(o=Object.create(t),Ke(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;Ze.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}=Ze;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):Tt(e),this.unsubscribe();else{if(this.unsubscribe(),i)throw e;Tt(e)}}}complete(){if(!this.isStopped){const{_parentSubscriber:e}=this;if(this._complete){const t=()=>this._complete.call(this._context);Ze.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(),Ze.useDeprecatedSynchronousErrorHandling)throw i;Tt(i)}}__tryOrSetError(e,t,i){if(!Ze.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{t.call(this._context,i)}catch(r){return Ze.useDeprecatedSynchronousErrorHandling?(e.syncErrorValue=r,e.syncErrorThrown=!0,!0):(Tt(r),!0)}return!1}_unsubscribe(){const{_parentSubscriber:e}=this;this._context=null,this._parentSubscriber=null,e.unsubscribe()}}const vi="function"==typeof Symbol&&Symbol.observable||"@@observable";function bi(n){return n}function Mr(...n){return Ve(n)}function Ve(n){return 0===n.length?bi:1===n.length?n[0]:function(t){return n.reduce((i,r)=>r(i),t)}}let ce=(()=>{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 xt)return n;if(n[He])return n[He]()}return n||e||t?new xt(n,e,t):new xt(Ft)}(t,i,r);if(o.add(s?s.call(o,this.source):this.source||Ze.useDeprecatedSynchronousErrorHandling&&!o.syncErrorThrowable?this._subscribe(o):this._trySubscribe(o)),Ze.useDeprecatedSynchronousErrorHandling&&o.syncErrorThrowable&&(o.syncErrorThrowable=!1,o.syncErrorThrown))throw o.syncErrorValue;return o}_trySubscribe(t){try{return this._subscribe(t)}catch(i){Ze.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 xt?t:null}return!0}(t)?t.error(i):console.warn(i)}}forEach(t,i){return new(i=zt(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)}[vi](){return this}pipe(...t){return 0===t.length?this:Ve(t)(this)}toPromise(t){return new(t=zt(t))((i,r)=>{let s;this.subscribe(o=>s=o,o=>r(o),()=>i(s))})}}return n.create=e=>new n(e),n})();function zt(n){if(n||(n=Ze.Promise||Promise),!n)throw new Error("no Promise impl found");return n}const Qt=(()=>{function n(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return n.prototype=Object.create(Error.prototype),n})();class li extends Te{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 Pi extends xt{constructor(e){super(e),this.destination=e}}let Se=(()=>{class n extends ce{constructor(){super(),this.observers=[],this.closed=!1,this.isStopped=!1,this.hasError=!1,this.thrownError=null}[He](){return new Pi(this)}lift(t){const i=new pn(this,this);return i.operator=t,i}next(t){if(this.closed)throw new Qt;if(!this.isStopped){const{observers:i}=this,r=i.length,s=i.slice();for(let o=0;onew pn(e,t),n})();class pn extends Se{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):Te.EMPTY}}function Gn(n){return n&&"function"==typeof n.schedule}function Ae(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 Ri(n,e))}}class Ri{constructor(e,t){this.project=e,this.thisArg=t}call(e,t){return t.subscribe(new jt(e,this.project,this.thisArg))}}class jt extends xt{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 xr=n=>e=>{for(let t=0,i=n.length;tn&&"number"==typeof n.length&&"function"!=typeof n;function Ye(n){return!!n&&"function"!=typeof n.subscribe&&"function"==typeof n.then}const ki=n=>{if(n&&"function"==typeof n[vi])return(n=>e=>{const t=n[vi]();if("function"!=typeof t.subscribe)throw new TypeError("Provided object does not correctly implement Symbol.observable");return t.subscribe(e)})(n);if(pt(n))return xr(n);if(Ye(n))return(n=>e=>(n.then(t=>{e.closed||(e.next(t),e.complete())},t=>e.error(t)).then(null,Tt),e))(n);if(n&&"function"==typeof n[cs])return(n=>e=>{const t=n[cs]();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 ${_e(n)?"an invalid object":`'${n}'`} where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.`;throw new TypeError(t)}};function Fi(n,e){return new ce(t=>{const i=new Te;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 ui(n,e){return e?function(n,e){if(null!=n){if(function(n){return n&&"function"==typeof n[vi]}(n))return function(n,e){return new ce(t=>{const i=new Te;return i.add(e.schedule(()=>{const r=n[vi]();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(Ye(n))return function(n,e){return new ce(t=>{const i=new Te;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(pt(n))return Fi(n,e);if(function(n){return n&&"function"==typeof n[cs]}(n)||"string"==typeof n)return function(n,e){if(!n)throw new Error("Iterable cannot be null");return new ce(t=>{const i=new Te;let r;return i.add(()=>{r&&"function"==typeof r.return&&r.return()}),i.add(e.schedule(()=>{r=n[cs](),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 ce?n:new ce(ki(n))}class Gr extends xt{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 ii extends xt{notifyNext(e){this.destination.next(e)}notifyError(e){this.destination.error(e)}notifyComplete(){this.destination.complete()}}function co(n,e){if(e.closed)return;if(n instanceof ce)return n.subscribe(e);let t;try{t=ki(n)(e)}catch(i){e.error(i)}return t}function di(n,e,t=Number.POSITIVE_INFINITY){return"function"==typeof e?i=>i.pipe(di((r,s)=>ui(n(r,s)).pipe(Ae((o,a)=>e(r,o,s,a))),t)):("number"==typeof e&&(t=e),i=>i.lift(new Oh(n,t)))}class Oh{constructor(e,t=Number.POSITIVE_INFINITY){this.project=e,this.concurrent=t}call(e,t){return t.subscribe(new El(e,this.project,this.concurrent))}}class El extends ii{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 uo(n=Number.POSITIVE_INFINITY){return di(bi,n)}function za(n,e){return e?Fi(n,e):new ce(xr(n))}function Ni(...n){let e=Number.POSITIVE_INFINITY,t=null,i=n[n.length-1];return Gn(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 ce?n[0]:uo(e)(za(n,t))}function us(){return function(e){return e.lift(new ho(e))}}class ho{constructor(e){this.connectable=e}call(e,t){const{connectable:i}=this;i._refCount++;const r=new gc(e,i),s=t.subscribe(r);return r.closed||(r.connection=i.connect()),s}}class gc extends xt{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 Sl extends ce{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 Te,e.add(this.source.subscribe(new pu(this.getSubject(),this))),e.closed&&(this._connection=null,e=Te.EMPTY)),e}refCount(){return us()(this)}}const fu=(()=>{const n=Sl.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 pu extends Pi{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()}}}function mc(n,e){return function(i){let r;if(r="function"==typeof n?n:function(){return n},"function"==typeof e)return i.lift(new pd(r,e));const s=Object.create(i,fu);return s.source=i,s.subjectFactory=r,s}}class pd{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 mu(){return new Se}function Vs(){return n=>us()(mc(mu)(n))}function Je(n){for(let e in n)if(n[e]===Je)return e;throw Error("Could not find renamed property on target object.")}function _u(n,e){for(const t in e)e.hasOwnProperty(t)&&!n.hasOwnProperty(t)&&(n[t]=e[t])}function W(n){if("string"==typeof n)return n;if(Array.isArray(n))return"["+n.map(W).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 Y(n,e){return null==n||""===n?null===e?"":e:null==e||""===e?n:n+" "+e}const J=Je({__forward_ref__:Je});function T(n){return n.__forward_ref__=T,n.toString=function(){return W(this())},n}function D(n){return B(n)?n():n}function B(n){return"function"==typeof n&&n.hasOwnProperty(J)&&n.__forward_ref__===T}class $ extends Error{constructor(e,t){super(function(n,e){return`${n?`NG0${n}: `:""}${e}`}(e,t)),this.code=e}}function pe(n){return"string"==typeof n?n:null==n?"":String(n)}function Ge(n){return"function"==typeof n?n.name||n.toString():"object"==typeof n&&null!=n&&"function"==typeof n.type?n.type.name||n.type.toString():pe(n)}function Et(n,e){const t=e?` in ${e}`:"";throw new $("201",`No provider for ${Ge(n)} found${t}`)}function Gi(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 ue(n){return{token:n.token,providedIn:n.providedIn||null,factory:n.factory,value:void 0}}function Me(n){return{providers:n.providers||[],imports:n.imports||[]}}function rr(n){return vc(n,ua)||vc(n,Ua)}function vc(n,e){return n.hasOwnProperty(e)?n[e]:null}function Cu(n){return n&&(n.hasOwnProperty(Tl)||n.hasOwnProperty(Sp))?n[Tl]:null}const ua=Je({\u0275prov:Je}),Tl=Je({\u0275inj:Je}),Ua=Je({ngInjectableDef:Je}),Sp=Je({ngInjectorDef:Je});var At=(()=>((At=At||{})[At.Default=0]="Default",At[At.Host=1]="Host",At[At.Self=2]="Self",At[At.SkipSelf=4]="SkipSelf",At[At.Optional=8]="Optional",At))();let Al;function da(n){const e=Al;return Al=n,e}function md(n,e,t){const i=rr(n);return i&&"root"==i.providedIn?void 0===i.value?i.value=i.factory():i.value:t&At.Optional?null:void 0!==e?e:void Et(W(n),"Injector")}function F(n){return{toString:n}.toString()}var j=(()=>((j=j||{})[j.OnPush=0]="OnPush",j[j.Default=1]="Default",j))(),Ue=(()=>((Ue=Ue||{})[Ue.Emulated=0]="Emulated",Ue[Ue.None=2]="None",Ue[Ue.ShadowDom=3]="ShadowDom",Ue))();const vn="undefined"!=typeof globalThis&&globalThis,dr="undefined"!=typeof window&&window,yr="undefined"!=typeof self&&"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&self,Wr="undefined"!=typeof global&&global,cn=vn||Wr||dr||yr,_d={},mi=[],xp=Je({\u0275cmp:Je}),d_=Je({\u0275dir:Je}),Ph=Je({\u0275pipe:Je}),b0=Je({\u0275mod:Je}),xx=Je({\u0275loc:Je}),Dl=Je({\u0275fac:Je}),Rh=Je({__NG_ELEMENT_ID__:Je});let Tx=0;function Ne(n){return F(()=>{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===j.OnPush,directiveDefs:null,pipeDefs:null,selectors:n.selectors||mi,viewQuery:n.viewQuery||null,features:n.features||null,data:n.data||{},encapsulation:n.encapsulation||Ue.Emulated,id:"c",styles:n.styles||mi,_:null,setInput:null,schemas:n.schemas||null,tView:null},r=n.directives,s=n.features,o=n.pipes;return i.id+=Tx++,i.inputs=S0(n.inputs,t),i.outputs=S0(n.outputs),s&&s.forEach(a=>a(i)),i.directiveDefs=r?()=>("function"==typeof r?r():r).map(C0):null,i.pipeDefs=o?()=>("function"==typeof o?o():o).map(w0):null,i})}function C0(n){return Kn(n)||function(n){return n[d_]||null}(n)}function w0(n){return function(n){return n[Ph]||null}(n)}const E0={};function Pe(n){return F(()=>{const e={type:n.type,bootstrap:n.bootstrap||mi,declarations:n.declarations||mi,imports:n.imports||mi,exports:n.exports||mi,transitiveCompileScopes:null,schemas:n.schemas||null,id:n.id||null};return null!=n.id&&(E0[n.id]=n.type),e})}function S0(n,e){if(null==n)return _d;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 oe=Ne;function ds(n){return{type:n.type,name:n.name,factory:null,pure:!1!==n.pure,onDestroy:n.type.prototype.ngOnDestroy||null}}function Kn(n){return n[xp]||null}function po(n,e){const t=n[b0]||null;if(!t&&!0===e)throw new Error(`Type ${W(n)} does not have '\u0275mod' property.`);return t}function Fo(n){return Array.isArray(n)&&"object"==typeof n[1]}function No(n){return Array.isArray(n)&&!0===n[1]}function p_(n){return 0!=(8&n.flags)}function Cd(n){return 2==(2&n.flags)}function wd(n){return 1==(1&n.flags)}function pa(n){return null!==n.template}function M0(n){return 0!=(512&n[2])}function wc(n,e){return n.hasOwnProperty(Dl)?n[Dl]:null}class y_{constructor(e,t,i){this.previousValue=e,this.currentValue=t,this.firstChange=i}isFirstChange(){return this.firstChange}}function zn(){return A0}function A0(n){return n.type.prototype.ngOnChanges&&(n.setInput=Fx),kx}function kx(){const n=q(this),e=null==n?void 0:n.current;if(e){const t=n.previous;if(t===_d)n.previous=e;else for(let i in e)t[i]=e[i];n.current=null,this.ngOnChanges(e)}}function Fx(n,e,t,i){const r=q(n)||function(n,e){return n[Vh]=e}(n,{previous:_d,current:null}),s=r.current||(r.current={}),o=r.previous,a=this.declaredInputs[t],l=o[a];s[a]=new y_(l&&l.currentValue,e,o===_d),n[i]=e}zn.ngInherit=!0;const Vh="__ngSimpleChanges__";function q(n){return n[Vh]||null}const Wn="http://www.w3.org/2000/svg";let fi;function Ii(n){return!!n.listen}const Su={createRenderer:(n,e)=>void 0!==fi?fi:"undefined"!=typeof document?document:void 0};function qi(n){for(;Array.isArray(n);)n=n[0];return n}function zh(n,e){return qi(e[n])}function Ts(n,e){return qi(e[n.index])}function C_(n,e){return n.data[e]}function Ed(n,e){return n[e]}function fs(n,e){const t=e[n];return Fo(t)?t:t[0]}function Pl(n){return 4==(4&n[2])}function Sd(n){return 128==(128&n[2])}function ma(n,e){return null==e?null:n[e]}function w_(n){n[18]=0}function Dp(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 Yt={lFrame:xu(null),bindingsEnabled:!0,isInCheckNoChangesMode:!1};function O0(){return Yt.bindingsEnabled}function Oe(){return Yt.lFrame.lView}function Dn(){return Yt.lFrame.tView}function en(n){return Yt.lFrame.contextLView=n,n[8]}function Dr(){let n=E_();for(;null!==n&&64===n.type;)n=n.parent;return n}function E_(){return Yt.lFrame.currentTNode}function Ga(n,e){const t=Yt.lFrame;t.currentTNode=n,t.isParent=e}function pr(){return Yt.lFrame.isParent}function Lr(){Yt.lFrame.isParent=!1}function Hh(){return Yt.isInCheckNoChangesMode}function Ip(n){Yt.isInCheckNoChangesMode=n}function Yr(){const n=Yt.lFrame;let e=n.bindingRootIndex;return-1===e&&(e=n.bindingRootIndex=n.tView.bindingStartIndex),e}function Us(){return Yt.lFrame.bindingIndex}function _a(){return Yt.lFrame.bindingIndex++}function mo(n){const e=Yt.lFrame,t=e.bindingIndex;return e.bindingIndex=e.bindingIndex+n,t}function Md(n,e){const t=Yt.lFrame;t.bindingIndex=t.bindingRootIndex=n,S_(e)}function S_(n){Yt.lFrame.currentDirectiveIndex=n}function M_(n){const e=Yt.lFrame.currentDirectiveIndex;return-1===e?null:n[e]}function I0(){return Yt.lFrame.currentQueryIndex}function x_(n){Yt.lFrame.currentQueryIndex=n}function Rp(n){const e=n[1];return 2===e.type?e.declTNode:1===e.type?n[6]:null}function xd(n,e,t){if(t&At.SkipSelf){let r=e,s=n;for(;!(r=r.parent,null!==r||t&At.Host||(r=Rp(s),null===r||(s=s[15],10&r.type))););if(null===r)return!1;e=r,n=s}const i=Yt.lFrame=O();return i.currentTNode=e,i.lView=n,!0}function Wh(n){const e=O(),t=n[1];Yt.lFrame=e,e.currentTNode=t.firstChild,e.lView=n,e.tView=t,e.contextLView=n,e.bindingIndex=t.bindingStartIndex,e.inI18n=!1}function O(){const n=Yt.lFrame,e=null===n?null:n.child;return null===e?xu(n):e}function xu(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 qh(){const n=Yt.lFrame;return Yt.lFrame=n.parent,n.currentTNode=null,n.lView=null,n}const _o=qh;function Cn(){const n=qh();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 As(){return Yt.lFrame.selectedIndex}function Hs(n){Yt.lFrame.selectedIndex=n}function sr(){const n=Yt.lFrame;return C_(n.tView,n.selectedIndex)}function kp(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 Yh{constructor(e,t,i){this.factory=e,this.resolving=!1,this.canSeeViewProviders=t,this.injectImpl=i}}function Lp(n,e,t){const i=Ii(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 Ad=!0;function Bp(n){const e=Ad;return Ad=n,e}let P_=0;function ps(n,e){const t=Vp(n,e);if(-1!==t)return t;const i=e[1];i.firstCreatePass&&(n.injectorIndex=e.length,R_(i.data,n),R_(e,null),R_(i.blueprint,null));const r=Kh(n,e),s=n.injectorIndex;if(F0(r)){const o=Td(r),a=qa(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 R_(n,e){n.push(0,0,0,0,0,0,0,0,e)}function Vp(n,e){return-1===n.injectorIndex||n.parent&&n.parent.injectorIndex===n.injectorIndex||null===e[n.injectorIndex+8]?-1:n.injectorIndex}function Kh(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 Sc(n,e,t){!function(n,e,t){let i;"string"==typeof t?i=t.charCodeAt(0)||0:t.hasOwnProperty(Rh)&&(i=t[Rh]),null==i&&(i=t[Rh]=P_++);const r=255&i;e.data[n+(r>>5)]|=1<=0?255&e:V0:e}(t);if("function"==typeof s){if(!xd(e,n,i))return i&At.Host?k_(r,t,i):L0(e,t,i,r);try{const o=s(i);if(null!=o||i&At.Optional)return o;Et(t)}finally{_o()}}else if("number"==typeof s){let o=null,a=Vp(n,e),l=-1,c=i&At.Host?e[16][6]:null;for((-1===a||i&At.SkipSelf)&&(l=-1===a?Kh(n,e):e[a+8],-1!==l&&Qh(i,!1)?(o=e[1],a=Td(l),e=qa(l,e)):a=-1);-1!==a;){const d=e[1];if(zp(s,a,d.data)){const f=Xr(a,e,t,o,i,c);if(f!==B0)return f}l=e[a+8],-1!==l&&Qh(i,e[1].data[a+8]===c)&&zp(s,a,e)?(o=d,a=Td(l),e=qa(l,e)):a=-1}}}return L0(e,t,i,r)}const B0={};function V0(){return new Bo(Dr(),Oe())}function Xr(n,e,t,i,r,s){const o=e[1],a=o.data[n+8],d=Dd(a,o,t,null==i?Cd(a)&&Ad:i!=o&&0!=(3&a.type),r&At.Host&&s===a);return null!==d?Od(e,o,d,a):B0}function Dd(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&&pa(g)&&g.type===t)return l}return null}function Od(n,e,t,i){let r=n[t];const s=e.data;if(function(n){return n instanceof Yh}(r)){const o=r;o.resolving&&function(n,e){throw new $("200",`Circular dependency in DI detected for ${n}`)}(Ge(s[t]));const a=Bp(o.canSeeViewProviders);o.resolving=!0;const l=o.injectImpl?da(o.injectImpl):null;xd(n,i,At.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=A0(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&&da(l),Bp(a),o.resolving=!1,_o()}}return r}function zp(n,e,t){return!!(t[e+(n>>5)]&1<{const e=n.prototype.constructor,t=e[Dl]||Kr(e),i=Object.prototype;let r=Object.getPrototypeOf(n.prototype).constructor;for(;r&&r!==i;){const s=r[Dl]||Kr(r);if(s&&s!==t)return s;r=Object.getPrototypeOf(r)}return s=>new s})}function Kr(n){return B(n)?()=>{const e=Kr(D(n));return e&&e()}:wc(n)}function Zr(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{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(Pd)?l[Pd]:Object.defineProperty(l,Pd,{value:[]})[Pd];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 ve{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=ue({token:this,providedIn:t.providedIn||"root",factory:t.factory}))}toString(){return`InjectionToken ${this._desc}`}}const Du=Function;function Vo(n,e){void 0===e&&(e=n);for(let t=0;tArray.isArray(t)?zo(t,e):e(t))}function ef(n,e,t){e>=n.length?n.push(t):n.splice(e,0,t)}function kl(n,e){return e>=n.length-1?n.pop():n.splice(e,1)[0]}function xc(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 z_(n,e){const t=Qr(n,e);if(t>=0)return n[1|t]}function Qr(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):W(a)))}r=`{${s.join(", ")}}`}return`${t}${i?"("+i+")":""}[${r}]: ${n.replace(Dc,"\n ")}`}("\n"+n.message,r,t,i),n.ngTokenPath=r,n[Ac]=null,n}const Ld=Nd(ba("Inject",n=>({token:n})),-1),br=Nd(ba("Optional"),8),Za=Nd(ba("SkipSelf"),4);let Vd;function Nu(n){var e;return(null===(e=function(){if(void 0===Vd&&(Vd=null,cn.trustedTypes))try{Vd=cn.trustedTypes.createPolicy("angular",{createHTML:n=>n,createScript:n=>n,createScriptURL:n=>n})}catch(n){}return Vd}())||void 0===e?void 0:e.createHTML(n))||n}class Bl{constructor(e){this.changingThisBreaksApplicationSecurity=e}toString(){return`SafeValue must use [property]=binding: ${this.changingThisBreaksApplicationSecurity} (see https://g.co/ng/security#xss)`}}class W_ extends Bl{getTypeName(){return"HTML"}}class q_ extends Bl{getTypeName(){return"Style"}}class Jp extends Bl{getTypeName(){return"Script"}}class zd extends Bl{getTypeName(){return"URL"}}class Ut extends Bl{getTypeName(){return"ResourceURL"}}function gs(n){return n instanceof Bl?n.changingThisBreaksApplicationSecurity:n}function jo(n,e){const t=Pc(n);if(null!=t&&t!==e){if("ResourceURL"===t&&"URL"===e)return!0;throw new Error(`Required a safe ${e}, got a ${t} (see https://g.co/ng/security#xss)`)}return t===e}function Pc(n){return n instanceof Bl&&n.getTypeName()||null}class iC{constructor(e){this.inertDocumentHelper=e}getInertBodyElement(e){e=""+e;try{const t=(new window.DOMParser).parseFromString(Nu(e),"text/html").body;return null===t?this.inertDocumentHelper.getInertBodyElement(e):(t.removeChild(t.firstChild),t)}catch(t){return null}}}class f1{constructor(e){if(this.defaultDoc=e,this.inertDocument=this.defaultDoc.implementation.createHTMLDocument("sanitization-inert"),null==this.inertDocument.body){const t=this.inertDocument.createElement("html");this.inertDocument.appendChild(t);const i=this.inertDocument.createElement("body");t.appendChild(i)}}getInertBodyElement(e){const t=this.inertDocument.createElement("template");if("content"in t)return t.innerHTML=Nu(e),t;const i=this.inertDocument.createElement("body");return i.innerHTML=Nu(e),this.defaultDoc.documentMode&&this.stripCustomNsAttrs(i),i}stripCustomNsAttrs(e){const t=e.attributes;for(let r=t.length-1;0bo(e.trim())).join(", ")}function Uo(n){const e={};for(const t of n.split(","))e[t]=!0;return e}function nf(...n){const e={};for(const t of n)for(const i in t)t.hasOwnProperty(i)&&(e[i]=!0);return e}const eg=Uo("area,br,col,hr,img,wbr"),sC=Uo("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr"),oC=Uo("rp,rt"),X_=nf(eg,nf(sC,Uo("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")),nf(oC,Uo("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")),nf(oC,sC)),K_=Uo("background,cite,href,itemtype,longdesc,poster,src,xlink:href"),Z_=Uo("srcset"),Q_=nf(K_,Z_,Uo("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"),Uo("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")),v1=Uo("script,style,template");class J_{constructor(){this.sanitizedSomething=!1,this.buf=[]}sanitizeChildren(e){let t=e.firstChild,i=!0;for(;t;)if(t.nodeType===Node.ELEMENT_NODE?i=this.startElement(t):t.nodeType===Node.TEXT_NODE?this.chars(t.nodeValue):this.sanitizedSomething=!0,i&&t.firstChild)t=t.firstChild;else for(;t;){t.nodeType===Node.ELEMENT_NODE&&this.endElement(t);let r=this.checkClobberedElement(t,t.nextSibling);if(r){t=r;break}t=this.checkClobberedElement(t,t.parentNode)}return this.buf.join("")}startElement(e){const t=e.nodeName.toLowerCase();if(!X_.hasOwnProperty(t))return this.sanitizedSomething=!0,!v1.hasOwnProperty(t);this.buf.push("<"),this.buf.push(t);const i=e.attributes;for(let r=0;r"),!0}endElement(e){const t=e.nodeName.toLowerCase();X_.hasOwnProperty(t)&&!eg.hasOwnProperty(t)&&(this.buf.push(""))}chars(e){this.buf.push(ng(e))}checkClobberedElement(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: ${e.outerHTML}`);return t}}const aC=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,rf=/([^\#-~ |!])/g;function ng(n){return n.replace(/&/g,"&").replace(aC,function(e){return"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";"}).replace(rf,function(e){return"&#"+e.charCodeAt(0)+";"}).replace(//g,">")}let sf;function ey(n,e){let t=null;try{sf=sf||function(n){const e=new f1(n);return function(){try{return!!(new window.DOMParser).parseFromString(Nu(""),"text/html")}catch(n){return!1}}()?new iC(e):e}(n);let i=e?String(e):"";t=sf.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=t.innerHTML,t=sf.getInertBodyElement(i)}while(i!==s);return Nu((new J_).sanitizeChildren(jd(t)||t))}finally{if(t){const i=jd(t)||t;for(;i.firstChild;)i.removeChild(i.firstChild)}}}function jd(n){return"content"in n&&function(n){return n.nodeType===Node.ELEMENT_NODE&&"TEMPLATE"===n.nodeName}(n)?n.content:null}var mn=(()=>((mn=mn||{})[mn.NONE=0]="NONE",mn[mn.HTML=1]="HTML",mn[mn.STYLE=2]="STYLE",mn[mn.SCRIPT=3]="SCRIPT",mn[mn.URL=4]="URL",mn[mn.RESOURCE_URL=5]="RESOURCE_URL",mn))();function Ud(n){const e=function(){const n=Oe();return n&&n[12]}();return e?e.sanitize(mn.URL,n)||"":jo(n,"URL")?gs(n):bo(pe(n))}const iy="__ngContext__";function Jr(n,e){n[iy]=e}function ry(n){const e=function(n){return n[iy]||null}(n);return e?Array.isArray(e)?e:e.lView:null}function ig(n){return n.ngOriginalError}function P1(n,...e){n.error(...e)}class $o{constructor(){this._console=console}handleError(e){const t=this._findOriginalError(e),i=this._findContext(e),r=function(n){return n&&n.ngErrorLogger||P1}(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(ig(e)):null}_findOriginalError(e){let t=e&&ig(e);for(;t&&ig(t);)t=ig(t);return t||null}}const yC=(()=>("undefined"!=typeof requestAnimationFrame&&requestAnimationFrame||setTimeout).bind(cn))();function ly(n){return n.ownerDocument.defaultView}function sg(n){return n.ownerDocument}function Ja(n){return n instanceof Function?n():n}var Co=(()=>((Co=Co||{})[Co.Important=1]="Important",Co[Co.DashCase=2]="DashCase",Co))();function uy(n,e){return undefined(n,e)}function lf(n){const e=n[3];return No(e)?e[3]:e}function $d(n){return EC(n[13])}function hy(n){return EC(n[4])}function EC(n){for(;null!==n&&!No(n);)n=n[4];return n}function Gd(n,e,t,i,r){if(null!=i){let s,o=!1;No(i)?s=i:Fo(i)&&(o=!0,i=i[0]);const a=qi(i);0===n&&null!==t?null==r?AC(e,t,a):el(e,t,a,r||null,!0):1===n&&null!==t?el(e,t,a,r||null,!0):2===n?function(n,e,t){const i=ag(n,e);i&&function(n,e,t,i){Ii(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!==qi(t)&&Gd(e,n,i,s,r);for(let a=10;a0&&(n[t-1][4]=i[4]);const s=kl(n,10+e);!function(n,e){Wd(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 my(n,e){if(!(256&e[2])){const t=e[11];Ii(t)&&t.destroyNode&&Wd(n,e,t,3,null,null),function(n){let e=n[13];if(!e)return og(n[1],n);for(;e;){let t=null;if(Fo(e))t=e[13];else{const i=e[10];i&&(t=i)}if(!t){for(;e&&!e[4]&&e!==n;)Fo(e)&&og(e[1],e),e=e[3];null===e&&(e=n),Fo(e)&&og(e[1],e),t=e&&e[4]}e=t}}(e)}}function og(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!==uf(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 iT(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+=jC(s,r),r=""),i=o,s=s||!wa(i);t++}return""!==r&&(e+=jC(s,r)),e}const kt={};function G(n){UC(Dn(),Oe(),As()+n,Hh())}function UC(n,e,t,i){if(!i)if(3==(3&e[2])){const s=n.preOrderCheckHooks;null!==s&&Fp(e,s,t)}else{const s=n.preOrderHooks;null!==s&&Np(e,s,0,t)}Hs(t)}function tl(n,e){return n<<17|e<<2}function Bt(n){return n>>17&32767}function Yi(n){return 2|n}function Vl(n){return(131068&n)>>2}function nl(n,e){return-131069&n|e<<2}function wy(n){return 1|n}function ZC(n,e){const t=n.contentQueries;if(null!==t)for(let i=0;i20&&UC(n,e,20,Hh()),t(i,r)}finally{Hs(s)}}function JC(n,e,t){if(p_(e)){const r=e.directiveEnd;for(let s=e.directiveStart;s0;){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 lw(n,e){null!==n.hostBindings&&n.hostBindings(1,e)}function cw(n,e){e.flags|=2,(n.components||(n.components=[])).push(e.index)}function IT(n,e,t){if(t){if(e.exportAs)for(let i=0;i0&&ky(t)}}function ky(n){for(let i=$d(n);null!==i;i=hy(i))for(let r=10;r0&&ky(s)}const t=n[1].components;if(null!==t)for(let i=0;i0&&ky(r)}}function BT(n,e){const t=fs(e,n),i=t[1];(function(n,e){for(let t=e.length;tPromise.resolve(null))();function hw(n){return n[7]||(n[7]=[])}function _g(n){return n.cleanup||(n.cleanup=[])}function Vy(n,e,t){return(null===n||pa(n))&&(t=function(n){for(;Array.isArray(n);){if("object"==typeof n[1])return n;n=n[0]}return null}(t[e.index])),t[11]}function zy(n,e){const t=n[9],i=t?t.get($o,null):null;i&&i.handleError(e)}function fw(n,e,t,i,r){for(let s=0;sthis.processProvider(a,e,t)),zo([e],a=>this.processInjectorType(a,[],s)),this.records.set(Fc,zu(void 0,this));const o=this.records.get(Vu);this.scope=null!=o?o.value:null,this.source=r||("object"==typeof e?null:W(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=Pu,i=At.Default){this.assertNotDestroyed();const r=Fd(this),s=da(void 0);try{if(!(i&At.SkipSelf)){let a=this.records.get(e);if(void 0===a){const l=function(n){return"function"==typeof n||"object"==typeof n&&n instanceof ve}(e)&&rr(e);a=l&&this.injectableDefInScope(l)?zu(Gy(e),gf):null,this.records.set(e,a)}if(null!=a)return this.hydrate(e,a)}return(i&At.Self?pw():this.parent).get(e,t=i&At.Optional&&t===Pu?null:t)}catch(o){if("NullInjectorError"===o.name){if((o[Ac]=o[Ac]||[]).unshift(W(e)),r)throw o;return Ds(o,e,"R3InjectorError",this.source)}throw o}finally{da(s),Fd(r)}}_resolveInjectorDefTypes(){this.injectorDefTypes.forEach(e=>this.get(e))}toString(){const e=[];return this.records.forEach((i,r)=>e.push(W(r))),`R3Injector[${e.join(", ")}]`}assertNotDestroyed(){if(this._destroyed)throw new Error("Injector has already been destroyed.")}processInjectorType(e,t,i){if(!(e=D(e)))return!1;let r=Cu(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=Cu(s)),null==r)return!1;if(null!=r.imports&&!a){let d;i.push(o);try{zo(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||mi))}}this.injectorDefTypes.add(o);const l=wc(o)||(()=>new o);this.records.set(o,zu(l,gf));const c=r.providers;if(null!=c&&!a){const d=e;zo(c,f=>this.processProvider(f,d,c))}return void 0!==s&&void 0!==e.providers}processProvider(e,t,i){let r=Nc(e=D(e))?e:D(e&&e.provide);const s=function(n,e,t){return _w(n)?zu(void 0,n.useValue):zu(mw(n),gf)}(e);if(Nc(e)||!0!==e.multi)this.records.get(r);else{let o=this.records.get(r);o||(o=zu(void 0,gf,!0),o.factory=()=>ku(o.multi),this.records.set(r,o)),r=e,o.multi.push(e)}this.records.set(r,s)}hydrate(e,t){return t.value===gf&&(t.value=GT,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=D(e.providedIn);return"string"==typeof t?"any"===t||t===this.scope:this.injectorDefTypes.has(t)}}function Gy(n){const e=rr(n),t=null!==e?e.factory:wc(n);if(null!==t)return t;if(n instanceof ve)throw new Error(`Token ${W(n)} is missing a \u0275prov definition.`);if(n instanceof Function)return function(n){const e=n.length;if(e>0){const i=xc(e,"?");throw new Error(`Can't resolve all parameters for ${W(n)}: (${i.join(", ")}).`)}const t=function(n){const e=n&&(n[ua]||n[Ua]);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 mw(n,e,t){let i;if(Nc(n)){const r=D(n);return wc(r)||Gy(r)}if(_w(n))i=()=>D(n.useValue);else if(function(n){return!(!n||!n.useFactory)}(n))i=()=>n.useFactory(...ku(n.deps||[]));else if(function(n){return!(!n||!n.useExisting)}(n))i=()=>I(D(n.useExisting));else{const r=D(n&&(n.useClass||n.provide));if(!function(n){return!!n.deps}(n))return wc(r)||Gy(r);i=()=>new r(...ku(n.deps))}return i}function zu(n,e,t=!1){return{factory:n,value:e,multi:t?[]:void 0}}function _w(n){return null!==n&&"object"==typeof n&&Wp in n}function Nc(n){return"function"==typeof n}const yw=function(n,e,t){return function(n,e=null,t=null,i){const r=gw(n,e,t,i);return r._resolveInjectorDefTypes(),r}({name:t},e,n,t)};class Nt{static create(e,t){return Array.isArray(e)?yw(e,t,""):yw(e.providers,e.parent,e.name||"")}}function m7(n,e){kp(ry(n)[1],Dr())}function ct(n){let e=function(n){return Object.getPrototypeOf(n.prototype).constructor}(n.type),t=!0;const i=[n];for(;e;){let r;if(pa(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=oA(n.inputs),o.declaredInputs=oA(n.declaredInputs),o.outputs=oA(n.outputs);const a=r.hostBindings;a&&b7(n,a);const l=r.viewQuery,c=r.contentQueries;if(l&&y7(n,l),c&&v7(n,c),_u(n.inputs,r.inputs),_u(n.declaredInputs,r.declaredInputs),_u(n.outputs,r.outputs),pa(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=Xh(r.hostAttrs,t=Xh(t,r.hostAttrs))}}(i)}function oA(n){return n===_d?{}:n===mi?[]:n}function y7(n,e){const t=n.viewQuery;n.viewQuery=t?(i,r)=>{e(i,r),t(i,r)}:e}function v7(n,e){const t=n.contentQueries;n.contentQueries=t?(i,r,s)=>{e(i,r,s),t(i,r,s)}:e}function b7(n,e){const t=n.hostBindings;n.hostBindings=t?(i,r)=>{e(i,r),t(i,r)}:e}Nt.THROW_IF_NOT_FOUND=Pu,Nt.NULL=new Ps,Nt.\u0275prov=ue({token:Nt,providedIn:"any",factory:()=>I(Fc)}),Nt.__NG_ELEMENT_ID__=-1;let Ew=null;function vg(){if(!Ew){const n=cn.Symbol;if(n&&n.iterator)Ew=n.iterator;else{const e=Object.getOwnPropertyNames(Map.prototype);for(let t=0;ta(qi(N[i.index])):i.index;if(Ii(t)){let N=null;if(!a&&l&&(N=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!==N)(N.__ngLastListenerFn__||N).__ngNextListenerFn__=s,N.__ngLastListenerFn__=s,g=!1;else{s=fA(i,e,f,s,!1);const V=t.listen(C,r,s);p.push(s,V),d&&d.push(r,x,w,w+1)}}else s=fA(i,e,f,s,!0),C.addEventListener(r,s,o),p.push(s),d&&d.push(r,x,w,o)}else s=fA(i,e,f,s,!1);const _=i.outputs;let y;if(g&&null!==_&&(y=_[r])){const v=y.length;if(v)for(let C=0;C0;)e=e[15],n--;return e}(n,Yt.lFrame.contextLView))[8]}(n)}function J7(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 ts={textEnd:0,key:0,keyEnd:0,value:0,valueEnd:0};function FN(n){return n.substring(ts.key,ts.keyEnd)}function NN(n,e){const t=ts.textEnd;return t===e?-1:(e=ts.keyEnd=function(n,e,t){for(;e32;)e++;return e}(n,ts.key=e,t),Ig(n,e,t))}function Ig(n,e,t){for(;e=0;t=NN(e,t))yo(n,FN(e),!0)}function $l(n,e,t,i){const r=Oe(),s=Dn(),o=mo(2);s.firstUpdatePass&&UN(s,n,o,i),e!==kt&&qs(r,o,e)&&$N(s,s.data[As()],r,r[11],n,r[o+1]=function(n,e){return null==n||("string"==typeof e?n+=e:"object"==typeof n&&(n=W(gs(n)))),n}(e,t),i,o)}function Gl(n,e,t,i){const r=Dn(),s=mo(2);r.firstUpdatePass&&UN(r,null,s,i);const o=Oe();if(t!==kt&&qs(o,s,t)){const a=r.data[As()];if(WN(a,i)&&!jN(r,s)){let l=i?a.classesWithoutHost:a.stylesWithoutHost;null!==l&&(t=Y(l,t||"")),hA(r,a,o,t,i)}else!function(n,e,t,i,r,s,o,a){r===kt&&(r=mi);let l=0,c=0,d=0=n.expandoStartIndex}function UN(n,e,t,i){const r=n.data;if(null===r[t+1]){const s=r[As()],o=jN(n,t);WN(s,i)&&null===e&&!o&&(e=!1),e=function(n,e,t,i){const r=M_(n);let s=i?e.residualClasses:e.residualStyles;if(null===r)0===(i?e.classBindings:e.styleBindings)&&(t=ev(t=gA(null,n,e,t,i),e.attrs,i),s=null);else{const o=e.directiveStylingLast;if(-1===o||n[o]!==r)if(t=gA(r,n,e,t,i),null===s){let l=function(n,e,t){const i=t?e.classBindings:e.styleBindings;if(0!==Vl(i))return n[Bt(i)]}(n,e,i);void 0!==l&&Array.isArray(l)&&(l=gA(null,n,e,l[1],i),l=ev(l,e.attrs,i),function(n,e,t,i){n[Bt(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=Bt(n[a+1]);n[i+1]=tl(p,a),0!==p&&(n[p+1]=nl(n[p+1],i)),n[a+1]=function(n,e){return 131071&n|e<<17}(n[a+1],i)}else n[i+1]=tl(a,0),0!==a&&(n[a+1]=nl(n[a+1],i)),a=i;else n[i+1]=tl(l,0),0===a?a=i:n[l+1]=nl(n[l+1],i),l=i;c&&(n[i+1]=Yi(n[i+1])),kN(n,d,i,!0),kN(n,d,i,!1),function(n,e,t,i,r){const s=r?n.residualClasses:n.residualStyles;null!=s&&"string"==typeof e&&Qr(s,e)>=0&&(t[i+1]=wy(t[i+1]))}(e,d,n,i,s),o=tl(a,l),s?e.classBindings=o:e.styleBindings=o}(r,s,e,t,o,i)}}function gA(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===kt&&(p=f?mi:void 0);let g=f?z_(p,i):d===i?p:void 0;if(c&&!Tw(g)&&(g=z_(l,i)),Tw(g)&&(a=g,o))return a;const _=n[r+1];r=o?Bt(_):Vl(_)}if(null!==e){let l=s?e.residualClasses:e.residualStyles;null!=l&&(a=z_(l,i))}return a}function Tw(n){return void 0!==n}function WN(n,e){return 0!=(n.flags&(e?16:32))}function De(n,e=""){const t=Oe(),i=Dn(),r=n+20,s=i.firstCreatePass?Yd(i,r,1,e,null):i.data[r],o=t[r]=function(n,e){return Ii(n)?n.createText(e):n.createTextNode(e)}(t[11],e);lg(i,t,o,s),Ga(s,!1)}function xi(n){return or("",n,""),xi}function or(n,e,t){const i=Oe(),r=Cg(i,n,e,t);return r!==kt&&zl(i,As(),r),or}function Aw(n,e,t,i,r){const s=Oe(),o=function(n,e,t,i,r,s){const a=mf(n,Us(),t,r);return mo(2),a?e+pe(t)+i+pe(r)+s:kt}(s,n,e,t,i,r);return o!==kt&&zl(s,As(),o),Aw}function al(n,e,t){const i=Oe();return qs(i,_a(),e)&&wo(Dn(),sr(),i,n,e,i[11],t,!0),al}function Pg(n,e,t){const i=Oe();if(qs(i,_a(),e)){const s=Dn(),o=sr();wo(s,o,i,n,e,Vy(M_(s.data),o,i),t,!0)}return Pg}const bf=void 0;var FY=["en",[["a","p"],["AM","PM"],bf],[["AM","PM"],bf,bf],[["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"]],bf,[["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"]],bf,[["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}",bf,"{1} 'at' {0}",bf],[".",",",";","%","+","-","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 Rg={};function dL(n){return n in Rg||(Rg[n]=cn.ng&&cn.ng.common&&cn.ng.common.locales&&cn.ng.common.locales[n]),Rg[n]}var at=(()=>((at=at||{})[at.LocaleId=0]="LocaleId",at[at.DayPeriodsFormat=1]="DayPeriodsFormat",at[at.DayPeriodsStandalone=2]="DayPeriodsStandalone",at[at.DaysFormat=3]="DaysFormat",at[at.DaysStandalone=4]="DaysStandalone",at[at.MonthsFormat=5]="MonthsFormat",at[at.MonthsStandalone=6]="MonthsStandalone",at[at.Eras=7]="Eras",at[at.FirstDayOfWeek=8]="FirstDayOfWeek",at[at.WeekendRange=9]="WeekendRange",at[at.DateFormat=10]="DateFormat",at[at.TimeFormat=11]="TimeFormat",at[at.DateTimeFormat=12]="DateTimeFormat",at[at.NumberSymbols=13]="NumberSymbols",at[at.NumberFormats=14]="NumberFormats",at[at.CurrencyCode=15]="CurrencyCode",at[at.CurrencySymbol=16]="CurrencySymbol",at[at.CurrencyName=17]="CurrencyName",at[at.Currencies=18]="Currencies",at[at.Directionality=19]="Directionality",at[at.PluralCase=20]="PluralCase",at[at.ExtraData=21]="ExtraData",at))();const Dw="en-US";let hL=Dw;function mA(n){Gi(n,"Expected localeId to be defined"),"string"==typeof n&&(hL=n.toLowerCase().replace(/_/g,"-"))}function vA(n,e,t,i,r){if(n=D(n),Array.isArray(n))for(let s=0;s>20;if(Nc(n)||!n.multi){const g=new Yh(l,r,E),_=CA(a,e,r?d:d+p,f);-1===_?(Sc(ps(c,o),s,a),bA(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=CA(a,e,d+p,f),_=CA(a,e,d,d+p),y=g>=0&&t[g],v=_>=0&&t[_];if(r&&!v||!r&&!y){Sc(ps(c,o),s,a);const C=function(n,e,t,i,r){const s=new Yh(n,t,E);return s.multi=[],s.index=e,s.componentProviders=0,NL(s,r,i&&!t),s}(r?PX:IX,t.length,r,i,l);!r&&v&&(t[_].providerFactory=C),bA(s,n,e.length,0),e.push(a),c.directiveStart++,c.directiveEnd++,r&&(c.providerIndexes+=1048576),t.push(C),o.push(C)}else bA(s,n,g>-1?g:_,NL(t[r?_:g],l,!r&&i));!r&&i&&v&&t[_].componentProviders++}}}function bA(n,e,t,i){const r=Nc(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 NL(n,e,t){return t&&n.componentProviders++,n.multi.push(e)-1}function CA(n,e,t,i){for(let r=t;r{t.providersResolver=(i,r)=>function(n,e,t){const i=Dn();if(i.firstCreatePass){const r=pa(n);vA(t,i.data,i.blueprint,r,!0),vA(e,i.data,i.blueprint,r,!1)}}(i,r?r(n):n,e)}}class LL{}const VL="ngComponent";class FX{resolveComponentFactory(e){throw function(n){const e=Error(`No component factory found for ${W(n)}. Did you add it to @NgModule.entryComponents?`);return e[VL]=n,e}(e)}}class ll{}function kw(...n){}function Fg(n,e){return new rt(Ts(n,e))}ll.NULL=new FX;const BX=function(){return Fg(Dr(),Oe())};let rt=(()=>{class n{constructor(t){this.nativeElement=t}}return n.__NG_ELEMENT_ID__=BX,n})();function zL(n){return n instanceof rt?n.nativeElement:n}class Cf{}let zc=(()=>{class n{}return n.__NG_ELEMENT_ID__=()=>zX(),n})();const zX=function(){const n=Oe(),t=fs(Dr().index,n);return function(n){return n[11]}(Fo(t)?t:n)};let SA=(()=>{class n{}return n.\u0275prov=ue({token:n,providedIn:"root",factory:()=>null}),n})();class ju{constructor(e){this.full=e,this.major=e.split(".")[0],this.minor=e.split(".")[1],this.patch=e.split(".").slice(2).join(".")}}const jL=new ju("12.2.5");class UL{constructor(){}supports(e){return Ky(e)}create(e){return new $X(e)}}const HX=(n,e)=>e;class $X{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||HX}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<$L(i,r,s)?t:i,a=$L(o,r,s),l=o.currentIndex;if(o===i)r--,i=i._nextRemoved;else if(t=t._next,null==o.previousIndex)r++;else{s||(s=[]);const c=a-r,d=l-r;if(c!=d){for(let p=0;p{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 GX(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 HL),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 HL),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 GX{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 WX{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 HL{constructor(){this.map=new Map}put(e){const t=e.trackById;let i=this.map.get(t);i||(i=new WX,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 $L(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 YX(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 YX{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 WL(){return new Ng([new UL])}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||WL()),deps:[[n,new Za,new br]]}}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=ue({token:n,providedIn:"root",factory:WL}),n})();function qL(){return new Lg([new GL])}let Lg=(()=>{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||qL()),deps:[[n,new Za,new br]]}}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=ue({token:n,providedIn:"root",factory:qL}),n})();function Fw(n,e,t,i,r=!1){for(;null!==t;){const s=e[t.index];if(null!==s&&i.push(qi(s)),No(s))for(let a=10;a-1&&(gy(e,i),kl(t,i))}this._attachedToViewContainer=!1}my(this._lView[1],this._lView)}onDestroy(e){tw(this._lView[1],this._lView,null,e)}markForCheck(){Fy(this._cdRefInjectingView||this._lView)}detach(){this._lView[2]&=-129}reattach(){this._lView[2]|=128}detectChanges(){Ly(this._lView[1],this._lView,this.context)}checkNoChanges(){!function(n,e,t){Ip(!0);try{Ly(n,e,t)}finally{Ip(!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){Wd(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 KX extends sv{constructor(e){super(e),this._view=e}detectChanges(){dw(this._view)}checkNoChanges(){!function(n){Ip(!0);try{dw(n)}finally{Ip(!1)}}(this._view)}get context(){return null}}const QX=function(n){return function(n,e,t){if(Cd(n)&&!t){const i=fs(n.index,e);return new sv(i,i)}return 47&n.type?new sv(e[16],e):null}(Dr(),Oe(),16==(16&n))};let kn=(()=>{class n{}return n.__NG_ELEMENT_ID__=QX,n})();const tK=[new GL],iK=new Ng([new UL]),rK=new Lg(tK),oK=function(){return Nw(Dr(),Oe())};let Ys=(()=>{class n{}return n.__NG_ELEMENT_ID__=oK,n})();const aK=Ys,lK=class extends aK{constructor(e,t,i){super(),this._declarationLView=e,this._declarationTContainer=t,this.elementRef=i}createEmbeddedView(e){const t=this._declarationTContainer.tViews,i=hf(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)),ff(t,i,e),new sv(i)}};function Nw(n,e){return 4&n.type?new lK(e,n,Fg(n,e)):null}class jc{}const dK=function(){return ZL(Dr(),Oe())};let ns=(()=>{class n{}return n.__NG_ELEMENT_ID__=dK,n})();const fK=ns,XL=class extends fK{constructor(e,t,i){super(),this._lContainer=e,this._hostTNode=t,this._hostLView=i}get element(){return Fg(this._hostTNode,this._hostLView)}get injector(){return new Bo(this._hostTNode,this._hostLView)}get parentInjector(){const e=Kh(this._hostTNode,this._hostLView);if(F0(e)){const t=qa(e,this._hostLView),i=Td(e);return new Bo(t[1].data[i+8],t)}return new Bo(null,this._hostLView)}clear(){for(;this.length>0;)this.remove(this.length-1)}get(e){const t=KL(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(jc,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 No(n[3])}(i)){const d=this.indexOf(e);if(-1!==d)this.detach(d);else{const f=i[3],p=new XL(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),iyC});class vB extends LL{constructor(e,t){super(),this.componentDef=e,this.ngModule=t,this.componentType=e.type,this.selector=function(n){return n.map(lT).join(",")}(e.selectors),this.ngContentSelectors=e.ngContentSelectors?e.ngContentSelectors:[],this.isBoundToModule=!!t}get inputs(){return yB(this.componentDef.inputs)}get outputs(){return yB(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,jg,r);return s!==jg||i===jg?s:e.get(t,i,r)}}}(e,r.injector):e,o=s.get(Cf,Su),a=s.get(SA,null),l=o.createRenderer(null,this.componentDef),c=this.componentDef.selectors[0][0]||"div",d=i?function(n,e,t){if(Ii(n))return n.selectRootElement(e,t===Ue.ShadowDom);let i="string"==typeof e?n.querySelector(e):e;return i.textContent="",i}(l,i,this.componentDef.encapsulation):py(o.createRenderer(null,this.componentDef),c,function(n){const e=n.toLowerCase();return"svg"===e?Wn:"math"===e?"http://www.w3.org/1998/MathML/":null}(c)),f=this.componentDef.onPush?576:528,p=function(n,e){return{components:[],scheduler:n||yC,clean:HT,playerHandler:e||null,flags:0}}(),g=gg(0,null,null,1,0,null,null,null,null,null),_=hf(null,g,p,f,null,null,o,l,a,s);let y,v;Wh(_);try{const C=function(n,e,t,i,r,s){const o=t[1];t[20]=n;const l=Yd(o,20,2,"#host",null),c=l.mergedAttrs=e.hostAttrs;null!==c&&(yg(l,c,!0),null!==n&&(Lp(r,n,c),null!==l.classes&&by(r,n,l.classes),null!==l.styles&&LC(r,n,l.styles)));const d=i.createRenderer(n,e),f=hf(t,pg(e),null,e.onPush?64:16,t[20],l,i,d,s||null,null);return o.firstCreatePass&&(Sc(ps(l,t),o,e.type),cw(o,l),Iy(l,t.length,1)),mg(t,f),t[20]=f}(d,this.componentDef,_,o,l);if(d)if(i)Lp(l,d,["ng-version",jL.full]);else{const{attrs:w,classes:x}=function(n){const e=[],t=[];let i=1,r=2;for(;i0&&by(l,d,x.join(" "))}if(v=C_(g,20),void 0!==t){const w=v.projection=[];for(let x=0;xl(o,e)),e.contentQueries){const l=Dr();e.contentQueries(1,o,l.directiveStart)}const a=Dr();return!s.firstCreatePass||null===e.hostBindings&&null===e.hostAttrs||(Hs(a.index),aw(t[1],a,0,a.directiveStart,a.directiveEnd,e),lw(e,o)),o}(C,this.componentDef,_,p,[m7]),ff(g,_,null)}finally{Cn()}return new hZ(this.componentType,y,Fg(v,_),_,v)}}class hZ 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 KX(r),this.componentType=e}get injector(){return new Bo(this._tNode,this._rootLView)}destroy(){this.hostView.destroy()}onDestroy(e){this.hostView.onDestroy(e)}}const Ug=new Map;class gZ extends jc{constructor(e,t){super(),this._parent=t,this._bootstrapComponents=[],this.injector=this,this.destroyCbs=[],this.componentFactoryResolver=new _B(this);const i=po(e),r=function(n){return n[xx]||null}(e);r&&mA(r),this._bootstrapComponents=Ja(i.bootstrap),this._r3Injector=gw(e,t,[{provide:jc,useValue:this},{provide:ll,useValue:this.componentFactoryResolver}],W(e)),this._r3Injector._resolveInjectorDefTypes(),this.instance=this.get(e)}get(e,t=Nt.THROW_IF_NOT_FOUND,i=At.Default){return e===Nt||e===jc||e===Fc?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 BA extends class{}{constructor(e){super(),this.moduleType=e,null!==po(e)&&function(n){const e=new Set;!function t(i){const r=po(i,!0),s=r.id;null!==s&&(function(n,e,t){if(e&&e!==t)throw new Error(`Duplicate module registered for ${n} - ${W(e)} vs ${W(e.name)}`)}(s,Ug.get(s),i),Ug.set(s,i));const o=Ja(r.imports);for(const a of o)e.has(a)||(e.add(a),t(a))}(n)}(e)}create(e){return new gZ(this.moduleType,e)}}function fv(n,e,t){const i=Yr()+n,r=Oe();return r[i]===kt?Bc(r,i,t?e.call(t):e()):function(n,e){return n[e]}(r,i)}function Hg(n,e,t,i){return wB(Oe(),Yr(),n,e,t,i)}function pv(n,e){const t=n[e];return t===kt?void 0:t}function wB(n,e,t,i,r,s){const o=e+t;return qs(n,o,r)?Bc(n,o+1,s?i.call(s,r):i(r)):pv(n,o+1)}function Kt(n,e){const t=Dn();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 $("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=wc(i.type)),o=da(E);try{const a=Bp(!1),l=s();return Bp(a),function(n,e,t,i){t>=n.data.length&&(n.data[t]=null,n.blueprint[t]=null),e[t]=i}(t,Oe(),r,l),l}finally{da(o)}}function rn(n,e,t){const i=n+20,r=Oe(),s=Ed(r,i);return _v(r,mv(r,i)?wB(r,Yr(),e,s.transform,t,s):s.transform(t))}function gv(n,e,t,i){const r=n+20,s=Oe(),o=Ed(s,r);return _v(s,mv(s,r)?function(n,e,t,i,r,s,o){const a=e+t;return mf(n,a,r,s)?Bc(n,a+2,o?i.call(o,r,s):i(r,s)):pv(n,a+2)}(s,Yr(),e,o.transform,t,i,o):o.transform(t,i))}function mv(n,e){return n[1].data[e].pure}function _v(n,e){return Ul.isWrapped(e)&&(e=Ul.unwrap(e),n[Us()]=kt),e}function VA(n){return e=>{setTimeout(n,void 0,e)}}const Le=class extends Se{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=VA(l),a&&(a=VA(a)),c&&(c=VA(c)));const d=super.subscribe({next:a,error:l,complete:c});return e instanceof Te&&e.add(d),d}};function DZ(){return this._results[vg()]()}class Sf{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=vg(),i=Sf.prototype;i[t]||(i[t]=DZ)}get changes(){return this._changes||(this._changes=new Le)}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=Vo(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=kw,this.reject=kw,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)(I(Mf,8))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();const vv=new ve("AppId"),uQ={provide:vv,useFactory:function(){return`${KA()}${KA()}${KA()}`},deps:[]};function KA(){return String.fromCharCode(97+Math.floor(25*Math.random()))}const XB=new ve("Platform Initializer"),dl=new ve("Platform ID"),bv=new ve("appBootstrapListener");let $w=(()=>{class n{log(t){console.log(t)}warn(t){console.warn(t)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();const Uu=new ve("LocaleId"),KB=new ve("DefaultCurrencyCode");class hQ{constructor(e,t){this.ngModuleFactory=e,this.componentFactories=t}}const ZA=function(n){return new BA(n)},fQ=ZA,pQ=function(n){return Promise.resolve(ZA(n))},ZB=function(n){const e=ZA(n),i=Ja(po(n).declarations).reduce((r,s)=>{const o=Kn(s);return o&&r.push(new vB(o)),r},[]);return new hQ(e,i)},gQ=ZB,mQ=function(n){return Promise.resolve(ZB(n))};let xf=(()=>{class n{constructor(){this.compileModuleSync=fQ,this.compileModuleAsync=pQ,this.compileModuleAndAllComponentsSync=gQ,this.compileModuleAndAllComponentsAsync=mQ}clearCache(){}clearCacheFor(t){}getModuleId(t){}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();const QB=new ve("compilerOptions"),yQ=(()=>Promise.resolve(0))();function QA(n){"undefined"==typeof Zone?yQ.then(()=>{n&&n.apply(null,null)}):Zone.current.scheduleMicroTask("scheduleMicrotask",n)}class dt{constructor({enableLongStackTrace:e=!1,shouldCoalesceEventChangeDetection:t=!1,shouldCoalesceRunChangeDetection:i=!1}){if(this.hasPendingMacrotasks=!1,this.hasPendingMicrotasks=!1,this.isStable=!0,this.onUnstable=new Le(!1),this.onMicrotaskEmpty=new Le(!1),this.onStable=new Le(!1),this.onError=new Le(!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=cn.requestAnimationFrame,e=cn.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(cn,()=>{n.fakeTopEventTask||(n.fakeTopEventTask=Zone.root.scheduleEventTask("fakeTopEventTask",()=>{n.lastRequestAnimationFrameId=-1,eD(n),n.isCheckStableRunning=!0,JA(n),n.isCheckStableRunning=!1},void 0,()=>{},()=>{})),n.fakeTopEventTask.invoke()}),eD(n))}(n)};n._inner=n._inner.fork({name:"angular",properties:{isAngularZone:!0},onInvokeTask:(t,i,r,s,o,a)=>{try{return JB(n),t.invokeTask(r,s,o,a)}finally{(n.shouldCoalesceEventChangeDetection&&"eventTask"===s.type||n.shouldCoalesceRunChangeDetection)&&e(),e3(n)}},onInvoke:(t,i,r,s,o,a,l)=>{try{return JB(n),t.invoke(r,s,o,a,l)}finally{n.shouldCoalesceRunChangeDetection&&e(),e3(n)}},onHasTask:(t,i,r,s)=>{t.hasTask(r,s),i===r&&("microTask"==s.change?(n._hasPendingMicrotasks=s.microTask,eD(n),JA(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(!dt.isInAngularZone())throw new Error("Expected to be in Angular Zone, but it is not!")}static assertNotInAngularZone(){if(dt.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,bQ,kw,kw);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 bQ={};function JA(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 eD(n){n.hasPendingMicrotasks=!!(n._hasPendingMicrotasks||(n.shouldCoalesceEventChangeDetection||n.shouldCoalesceRunChangeDetection)&&-1!==n.lastRequestAnimationFrameId)}function JB(n){n._nesting++,n.isStable&&(n.isStable=!1,n.onUnstable.emit(null))}function e3(n){n._nesting--,JA(n)}class EQ{constructor(){this.hasPendingMicrotasks=!1,this.hasPendingMacrotasks=!1,this.isStable=!0,this.onUnstable=new Le,this.onMicrotaskEmpty=new Le,this.onStable=new Le,this.onError=new Le}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 tD=(()=>{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:()=>{dt.assertNotInAngularZone(),QA(()=>{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())QA(()=>{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)(I(dt))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})(),t3=(()=>{class n{constructor(){this._applications=new Map,nD.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 nD.findTestabilityInTree(this,t,i)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();class SQ{addToWindow(e){}findTestabilityInTree(e,t,i){return null}}let nD=new SQ,n3=!0,i3=!1;function Mo(){return i3=!0,n3}let Yl;const r3=new ve("AllowMultipleToken");function s3(n,e,t=[]){const i=`Platform: ${e}`,r=new ve(i);return(s=[])=>{let o=rD();if(!o||o.injector.get(r3,!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(Yl&&!Yl.destroyed&&!Yl.injector.get(r3,!1))throw new Error("There can be only one platform. Destroy the previous one to create a new one.");Yl=n.get(o3);const e=n.get(XB,null);e&&e.forEach(t=>t())}(Nt.create({providers:a,name:i}))}return function(n){const e=rD();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 rD(){return Yl&&!Yl.destroyed?Yl:null}let o3=(()=>{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 EQ:("zone.js"===n?void 0:n)||new dt({enableLongStackTrace:Mo(),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:dt,useValue:a}];return a.run(()=>{const c=Nt.create({providers:l,parent:this.injector,name:t.moduleType.name}),d=t.create(c),f=d.injector.get($o,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(()=>{sD(this._modules,d),p.unsubscribe()})}),function(n,e,t){try{const i=t();return Og(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(Gg);return p.runInitializers(),p.donePromise.then(()=>(mA(d.injector.get(Uu,Dw)||Dw),this._moduleDoBootstrap(d),d))})})}bootstrapModule(t,i=[]){const r=a3({},i);return function(n,e,t){const i=new BA(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 ${W(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)(I(Nt))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();function a3(n,e){return Array.isArray(e)?e.reduce(a3,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 ce(c=>{this._stable=this._zone.isStable&&!this._zone.hasPendingMacrotasks&&!this._zone.hasPendingMicrotasks,this._zone.runOutsideAngular(()=>{c.next(this._stable),c.complete()})}),l=new ce(c=>{let d;this._zone.runOutsideAngular(()=>{d=this._zone.onStable.subscribe(()=>{dt.assertNotInAngularZone(),QA(()=>{!this._stable&&!this._zone.hasPendingMacrotasks&&!this._zone.hasPendingMicrotasks&&(this._stable=!0,c.next(!0))})})});const f=this._zone.onUnstable.subscribe(()=>{dt.assertInAngularZone(),this._stable&&(this._stable=!1,this._zone.runOutsideAngular(()=>{c.next(!1)}))});return()=>{d.unsubscribe(),f.unsubscribe()}});this.isStable=Ni(a,l.pipe(Vs()))}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 LL?t:this._componentFactoryResolver.resolveComponentFactory(t),this.componentTypes.push(r.componentType);const s=function(n){return n.isBoundToModule}(r)?void 0:this._injector.get(jc),a=r.create(Nt.NULL,[],i||r.selector,s),l=a.location.nativeElement,c=a.injector.get(tD,null),d=c&&a.injector.get(t3);return c&&d&&d.registerApplication(l,c),a.onDestroy(()=>{this.detachView(a.hostView),sD(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;sD(this._views,i),i.detachFromAppRef()}_loadComponent(t){this.attachView(t.hostView),this.tick(),this.components.push(t),this._injector.get(bv,[]).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)(I(dt),I(Nt),I($o),I(ll),I(Gg))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();function sD(n,e){const t=n.indexOf(e);t>-1&&n.splice(t,1)}const ZQ=s3(null,"core",[{provide:dl,useValue:"unknown"},{provide:o3,deps:[Nt]},{provide:t3,deps:[]},{provide:$w,deps:[]}]),nJ=[{provide:Jd,useClass:Jd,deps:[dt,Nt,$o,ll,Gg]},{provide:cZ,deps:[dt],useFactory:function(n){let e=[];return n.onStable.subscribe(()=>{for(;e.length;)e.pop()()}),function(t){e.push(t)}}},{provide:Gg,useClass:Gg,deps:[[new br,Mf]]},{provide:xf,useClass:xf,deps:[]},uQ,{provide:Ng,useFactory:function(){return iK},deps:[]},{provide:Lg,useFactory:function(){return rK},deps:[]},{provide:Uu,useFactory:function(n){return mA(n=n||"undefined"!=typeof $localize&&$localize.locale||Dw),n},deps:[[new Ld(Uu),new br,new Za]]},{provide:KB,useValue:"USD"}];let rJ=(()=>{class n{constructor(t){}}return n.\u0275fac=function(t){return new(t||n)(I(Jd))},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({providers:nJ}),n})(),tE=null;function Uc(){return tE}const ut=new ve("DocumentToken");let Df=(()=>{class n{historyGo(t){throw new Error("Not implemented")}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ue({factory:iee,token:n,providedIn:"platform"}),n})();function iee(){return I(F3)}let F3=(()=>{class n extends Df{constructor(t){super(),this._doc=t,this._init()}_init(){this.location=window.location,this._history=window.history}getBaseHrefFromDOM(){return Uc().getBaseHref(this._doc)}onPopState(t){const i=Uc().getGlobalEventTarget(this._doc,"window");return i.addEventListener("popstate",t,!1),()=>i.removeEventListener("popstate",t)}onHashChange(t){const i=Uc().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){N3()?this._history.pushState(t,i,r):this.location.hash=r}replaceState(t,i,r){N3()?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)(I(ut))},n.\u0275prov=ue({factory:see,token:n,providedIn:"platform"}),n})();function N3(){return!!window.history.pushState}function see(){return new F3(I(ut))}function bD(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}function L3(n){const e=n.match(/#|\?|$/),t=e&&e.index||n.length;return n.slice(0,t-("/"===n[t-1]?1:0))+n.slice(t)}function $u(n){return n&&"?"!==n[0]?"?"+n:n}let Yg=(()=>{class n{historyGo(t){throw new Error("Not implemented")}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ue({factory:oee,token:n,providedIn:"root"}),n})();function oee(n){const e=I(ut).location;return new B3(I(Df),e&&e.origin||"")}const CD=new ve("appBaseHref");let B3=(()=>{class n extends Yg{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 bD(this._baseHref,t)}path(t=!1){const i=this._platformLocation.pathname+$u(this._platformLocation.search),r=this._platformLocation.hash;return r&&t?`${i}${r}`:i}pushState(t,i,r,s){const o=this.prepareExternalUrl(r+$u(s));this._platformLocation.pushState(t,i,o)}replaceState(t,i,r,s){const o=this.prepareExternalUrl(r+$u(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)(I(Df),I(CD,8))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})(),Xg=(()=>{class n{constructor(t,i){this._subject=new Le,this._urlChangeListeners=[],this._platformStrategy=t;const r=this._platformStrategy.getBaseHref();this._platformLocation=i,this._baseHref=L3(V3(r)),this._platformStrategy.onPopState(s=>{this._subject.emit({url:this.path(!0),pop:!0,state:s.state,type:s.type})})}path(t=!1){return this.normalize(this._platformStrategy.path(t))}getState(){return this._platformLocation.getState()}isCurrentPathEqualTo(t,i=""){return this.path()==this.normalize(t+$u(i))}normalize(t){return n.stripTrailingSlash(function(n,e){return n&&e.startsWith(n)?e.substring(n.length):e}(this._baseHref,V3(t)))}prepareExternalUrl(t){return t&&"/"!==t[0]&&(t="/"+t),this._platformStrategy.prepareExternalUrl(t)}go(t,i="",r=null){this._platformStrategy.pushState(r,"",t,i),this._notifyUrlChangeListeners(this.prepareExternalUrl(t+$u(i)),r)}replaceState(t,i="",r=null){this._platformStrategy.replaceState(r,"",t,i),this._notifyUrlChangeListeners(this.prepareExternalUrl(t+$u(i)),r)}forward(){this._platformStrategy.forward()}back(){this._platformStrategy.back()}historyGo(t=0){var i,r;null===(r=(i=this._platformStrategy).historyGo)||void 0===r||r.call(i,t)}onUrlChange(t){this._urlChangeListeners.push(t),this._urlChangeSubscription||(this._urlChangeSubscription=this.subscribe(i=>{this._notifyUrlChangeListeners(i.url,i.state)}))}_notifyUrlChangeListeners(t="",i){this._urlChangeListeners.forEach(r=>r(t,i))}subscribe(t,i,r){return this._subject.subscribe({next:t,error:i,complete:r})}}return n.\u0275fac=function(t){return new(t||n)(I(Yg),I(Df))},n.normalizeQueryParams=$u,n.joinWithSlash=bD,n.stripTrailingSlash=L3,n.\u0275prov=ue({factory:lee,token:n,providedIn:"root"}),n})();function lee(){return new Xg(I(Yg),I(Df))}function V3(n){return n.replace(/\/index.html$/,"")}var Br=(()=>((Br=Br||{})[Br.Zero=0]="Zero",Br[Br.One=1]="One",Br[Br.Two=2]="Two",Br[Br.Few=3]="Few",Br[Br.Many=4]="Many",Br[Br.Other=5]="Other",Br))();const mee=function(n){return function(n){const e=function(n){return n.toLowerCase().replace(/_/g,"-")}(n);let t=dL(e);if(t)return t;const i=e.split("-")[0];if(t=dL(i),t)return t;if("en"===i)return FY;throw new Error(`Missing locale data for the locale "${n}".`)}(n)[at.PluralCase]};class dE{}let Gee=(()=>{class n extends dE{constructor(t){super(),this.locale=t}getPluralCategory(t,i){switch(mee(i||this.locale)(t)){case Br.Zero:return"zero";case Br.One:return"one";case Br.Two:return"two";case Br.Few:return"few";case Br.Many:return"many";default:return"other"}}}return n.\u0275fac=function(t){return new(t||n)(I(Uu))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();function Y3(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}let hE=(()=>{class n{constructor(t,i,r,s){this._iterableDiffers=t,this._keyValueDiffers=i,this._ngEl=r,this._renderer=s,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&&(Ky(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(i=>this._toggleClass(i.key,i.currentValue)),t.forEachChangedItem(i=>this._toggleClass(i.key,i.currentValue)),t.forEachRemovedItem(i=>{i.previousValue&&this._toggleClass(i.key,!1)})}_applyIterableChanges(t){t.forEachAddedItem(i=>{if("string"!=typeof i.item)throw new Error(`NgClass can only toggle CSS classes expressed as strings, got ${W(i.item)}`);this._toggleClass(i.item,!0)}),t.forEachRemovedItem(i=>this._toggleClass(i.item,!1))}_applyClasses(t){t&&(Array.isArray(t)||t instanceof Set?t.forEach(i=>this._toggleClass(i,!0)):Object.keys(t).forEach(i=>this._toggleClass(i,!!t[i])))}_removeClasses(t){t&&(Array.isArray(t)||t instanceof Set?t.forEach(i=>this._toggleClass(i,!1)):Object.keys(t).forEach(i=>this._toggleClass(i,!1)))}_toggleClass(t,i){(t=t.trim())&&t.split(/\s+/g).forEach(r=>{i?this._renderer.addClass(this._ngEl.nativeElement,r):this._renderer.removeClass(this._ngEl.nativeElement,r)})}}return n.\u0275fac=function(t){return new(t||n)(E(Ng),E(Lg),E(rt),E(zc))},n.\u0275dir=oe({type:n,selectors:[["","ngClass",""]],inputs:{klass:["class","klass"],ngClass:"ngClass"}}),n})();class qee{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 pl=(()=>{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 qee(null,this._ngForOf,-1,-1),null===o?void 0:o),l=new X3(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 X3(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)(E(ns),E(Ys),E(Ng))},n.\u0275dir=oe({type:n,selectors:[["","ngFor","","ngForOf",""]],inputs:{ngForOf:"ngForOf",ngForTrackBy:"ngForTrackBy",ngForTemplate:"ngForTemplate"}}),n})();class X3{constructor(e,t){this.record=e,this.view=t}}let zr=(()=>{class n{constructor(t,i){this._viewContainer=t,this._context=new Xee,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){K3("ngIfThen",t),this._thenTemplateRef=t,this._thenViewRef=null,this._updateView()}set ngIfElse(t){K3("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)(E(ns),E(Ys))},n.\u0275dir=oe({type:n,selectors:[["","ngIf",""]],inputs:{ngIf:"ngIf",ngIfThen:"ngIfThen",ngIfElse:"ngIfElse"}}),n})();class Xee{constructor(){this.$implicit=null,this.ngIf=null}}function K3(n,e){if(e&&!e.createEmbeddedView)throw new Error(`${n} must be a TemplateRef, but received '${W(e)}'.`)}class OD{constructor(e,t){this._viewContainerRef=e,this._templateRef=t,this._created=!1}create(){this._created=!0,this._viewContainerRef.createEmbeddedView(this._templateRef)}destroy(){this._created=!1,this._viewContainerRef.clear()}enforceState(e){e&&!this._created?this.create():!e&&this._created&&this.destroy()}}let Av=(()=>{class n{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 i=t==this._ngSwitch;return this._lastCasesMatched=this._lastCasesMatched||i,this._lastCaseCheckIndex++,this._lastCaseCheckIndex===this._caseCount&&(this._updateDefaultCases(!this._lastCasesMatched),this._lastCaseCheckIndex=0,this._lastCasesMatched=!1),i}_updateDefaultCases(t){if(this._defaultViews&&t!==this._defaultUsed){this._defaultUsed=t;for(let i=0;i{class n{constructor(t,i,r){this.ngSwitch=r,r._addCase(),this._view=new OD(t,i)}ngDoCheck(){this._view.enforceState(this.ngSwitch._matchCase(this.ngSwitchCase))}}return n.\u0275fac=function(t){return new(t||n)(E(ns),E(Ys),E(Av,9))},n.\u0275dir=oe({type:n,selectors:[["","ngSwitchCase",""]],inputs:{ngSwitchCase:"ngSwitchCase"}}),n})(),Z3=(()=>{class n{constructor(t,i,r){r._addDefault(new OD(t,i))}}return n.\u0275fac=function(t){return new(t||n)(E(ns),E(Ys),E(Av,9))},n.\u0275dir=oe({type:n,selectors:[["","ngSwitchDefault",""]]}),n})(),J3=(()=>{class n{constructor(t,i,r){this._ngEl=t,this._differs=i,this._renderer=r,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,i){const[r,s]=t.split(".");null!=(i=null!=i&&s?`${i}${s}`:i)?this._renderer.setStyle(this._ngEl.nativeElement,r,i):this._renderer.removeStyle(this._ngEl.nativeElement,r)}_applyChanges(t){t.forEachRemovedItem(i=>this._setStyle(i.key,null)),t.forEachAddedItem(i=>this._setStyle(i.key,i.currentValue)),t.forEachChangedItem(i=>this._setStyle(i.key,i.currentValue))}}return n.\u0275fac=function(t){return new(t||n)(E(rt),E(Lg),E(zc))},n.\u0275dir=oe({type:n,selectors:[["","ngStyle",""]],inputs:{ngStyle:"ngStyle"}}),n})();function Ql(n,e){return Error(`InvalidPipeArgument: '${e}' for pipe '${W(n)}'`)}class Qee{createSubscription(e,t){return e.subscribe({next:t,error:i=>{throw i}})}dispose(e){e.unsubscribe()}onDestroy(e){e.unsubscribe()}}class Jee{createSubscription(e,t){return e.then(t,i=>{throw i})}dispose(e){}onDestroy(e){}}const ete=new Jee,tte=new Qee;let Hc=(()=>{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(Og(t))return ete;if(EN(t))return tte;throw Ql(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)(E(kn,16))},n.\u0275pipe=ds({name:"async",type:n,pure:!1}),n})();const ate=/#/g;let eV=(()=>{class n{constructor(t){this._localization=t}transform(t,i,r){if(null==t)return"";if("object"!=typeof i||null===i)throw Ql(n,i);return i[function(n,e,t,i){let r=`=${n}`;if(e.indexOf(r)>-1||(r=t.getPluralCategory(n,i),e.indexOf(r)>-1))return r;if(e.indexOf("other")>-1)return"other";throw new Error(`No plural message found for value "${n}"`)}(t,Object.keys(i),this._localization,r)].replace(ate,t.toString())}}return n.\u0275fac=function(t){return new(t||n)(E(dE,16))},n.\u0275pipe=ds({name:"i18nPlural",type:n,pure:!0}),n})(),tV=(()=>{class n{transform(t){return JSON.stringify(t,null,2)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275pipe=ds({name:"json",type:n,pure:!1}),n})(),dn=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({providers:[{provide:dE,useClass:Gee}]}),n})();const rV="browser";function Of(n){return n===rV}function kD(n){return"server"===n}class aV{}class FD extends class extends class{}{constructor(){super(...arguments),this.supportsDOMEvents=!0}}{static makeCurrent(){!function(n){tE||(tE=n)}(new FD)}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=(Dv=Dv||document.querySelector("base"),Dv?Dv.getAttribute("href"):null);return null==t?null:function(n){fE=fE||document.createElement("a"),fE.setAttribute("href",n);const e=fE.pathname;return"/"===e.charAt(0)?e:`/${e}`}(t)}resetBaseElement(){Dv=null}getUserAgent(){return window.navigator.userAgent}getCookie(e){return Y3(document.cookie,e)}}let fE,Dv=null;const lV=new ve("TRANSITION_ID"),Ete=[{provide:Mf,useFactory:function(n,e,t){return()=>{t.get(Gg).donePromise.then(()=>{const i=Uc(),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},cn.getAllAngularTestabilities=()=>e.getAllTestabilities(),cn.getAllAngularRootElements=()=>e.getAllRootElements(),cn.frameworkStabilizers||(cn.frameworkStabilizers=[]),cn.frameworkStabilizers.push(i=>{const r=cn.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?Uc().isShadowRoot(t)?this.findTestabilityInTree(e,t.host,!0):this.findTestabilityInTree(e,t.parentElement,!0):null}}let Ste=(()=>{class n{build(){return new XMLHttpRequest}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();const Ov=new ve("EventManagerPlugins");let gE=(()=>{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=ue({token:n,factory:n.\u0275fac}),n})(),Iv=(()=>{class n extends uV{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(dV),this._hostNodes.delete(t)}onStylesAdded(t){this._hostNodes.forEach((i,r)=>{this._addStylesToHost(t,r,i)})}ngOnDestroy(){this._hostNodes.forEach(t=>t.forEach(dV))}}return n.\u0275fac=function(t){return new(t||n)(I(ut))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();function dV(n){Uc().remove(n)}const BD={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/"},VD=/%COMP%/g;function mE(n,e,t){for(let i=0;i{if("__ngUnwrap__"===e)return n;!1===n(e)&&(e.preventDefault(),e.returnValue=!1)}}let _E=(()=>{class n{constructor(t,i,r){this.eventManager=t,this.sharedStylesHost=i,this.appId=r,this.rendererByCompId=new Map,this.defaultRenderer=new zD(t)}createRenderer(t,i){if(!t||!i)return this.defaultRenderer;switch(i.encapsulation){case Ue.Emulated:{let r=this.rendererByCompId.get(i.id);return r||(r=new Vte(this.eventManager,this.sharedStylesHost,i,this.appId),this.rendererByCompId.set(i.id,r)),r.applyToHost(t),r}case 1:case Ue.ShadowDom:return new zte(this.eventManager,this.sharedStylesHost,t,i);default:if(!this.rendererByCompId.has(i.id)){const r=mE(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)(I(gE),I(Iv),I(vv))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();class zD{constructor(e){this.eventManager=e,this.data=Object.create(null)}destroy(){}createElement(e,t){return t?document.createElementNS(BD[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=BD[r];s?e.setAttributeNS(s,t,i):e.setAttribute(t,i)}else e.setAttribute(t,i)}removeAttribute(e,t,i){if(i){const r=BD[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&(Co.DashCase|Co.Important)?e.style.setProperty(t,i,r&Co.Important?"important":""):e.style[t]=i}removeStyle(e,t,i){i&Co.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,pV(i)):this.eventManager.addEventListener(e,t,pV(i))}}class Vte extends zD{constructor(e,t,i,r){super(e),this.component=i;const s=mE(r+"-"+i.id,i.styles,[]);t.addStyles(s),this.contentAttr=function(n){return"_ngcontent-%COMP%".replace(VD,n)}(r+"-"+i.id),this.hostAttr=function(n){return"_nghost-%COMP%".replace(VD,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 zte extends zD{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=mE(r.id,r.styles,[]);for(let o=0;o{class n extends LD{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)(I(ut))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();const _V=["alt","control","meta","shift"],Yte={"\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"},yV={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"},Xte={alt:n=>n.altKey,control:n=>n.ctrlKey,meta:n=>n.metaKey,shift:n=>n.shiftKey};let Kte=(()=>{class n extends LD{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(()=>Uc().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(_V.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&&yV.hasOwnProperty(e)&&(e=yV[e]))}return Yte[e]||e}(t);return r=r.toLowerCase()," "===r?r="space":"."===r&&(r="dot"),_V.forEach(s=>{s!=r&&Xte[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)(I(ut))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})(),th=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ue({factory:function(){return I(UD)},token:n,providedIn:"root"}),n})(),UD=(()=>{class n extends th{constructor(t){super(),this._doc=t}sanitize(t,i){if(null==i)return null;switch(t){case mn.NONE:return i;case mn.HTML:return jo(i,"HTML")?gs(i):ey(this._doc,String(i)).toString();case mn.STYLE:return jo(i,"Style")?gs(i):i;case mn.SCRIPT:if(jo(i,"Script"))return gs(i);throw new Error("unsafe value used in a script context");case mn.URL:return Pc(i),jo(i,"URL")?gs(i):bo(String(i));case mn.RESOURCE_URL:if(jo(i,"ResourceURL"))return gs(i);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(n){return new W_(n)}(t)}bypassSecurityTrustStyle(t){return function(n){return new q_(n)}(t)}bypassSecurityTrustScript(t){return function(n){return new Jp(n)}(t)}bypassSecurityTrustUrl(t){return function(n){return new zd(n)}(t)}bypassSecurityTrustResourceUrl(t){return function(n){return new Ut(n)}(t)}}return n.\u0275fac=function(t){return new(t||n)(I(ut))},n.\u0275prov=ue({factory:function(){return function(n){return new UD(n.get(ut))}(I(Fc))},token:n,providedIn:"root"}),n})();const rne=s3(ZQ,"browser",[{provide:dl,useValue:rV},{provide:XB,useValue:function(){FD.makeCurrent(),ND.init()},multi:!0},{provide:ut,useFactory:function(){return function(n){fi=n}(document),document},deps:[]}]),sne=[[],{provide:Vu,useValue:"root"},{provide:$o,useFactory:function(){return new $o},deps:[]},{provide:Ov,useClass:jte,multi:!0,deps:[ut,dt,dl]},{provide:Ov,useClass:Kte,multi:!0,deps:[ut]},[],{provide:_E,useClass:_E,deps:[gE,Iv,vv]},{provide:Cf,useExisting:_E},{provide:uV,useExisting:Iv},{provide:Iv,useClass:Iv,deps:[ut]},{provide:tD,useClass:tD,deps:[dt]},{provide:gE,useClass:gE,deps:[Ov,dt]},{provide:aV,useClass:Ste,deps:[]},[]];let yE=(()=>{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:vv,useValue:t.appId},{provide:lV,useExisting:vv},Ete]}}}return n.\u0275fac=function(t){return new(t||n)(I(n,12))},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({providers:sne,imports:[dn,rJ]}),n})();"undefined"!=typeof window&&window;class fne extends Te{constructor(e,t){super()}schedule(e,t=0){return this}}class vE extends fne{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 bV=(()=>{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 bV{constructor(e,t=bV.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 mne=new class extends Jl{}(class extends vE{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)}}),ec=new ce(n=>n.complete());function bE(n){return n?function(n){return new ce(e=>n.schedule(()=>e.complete()))}(n):ec}function ht(...n){let e=n[n.length-1];return Gn(e)?(n.pop(),Fi(n,e)):za(n)}function Kg(n,e){return new ce(e?t=>e.schedule(yne,0,{error:n,subscriber:t}):t=>t.error(n))}function yne({error:n,subscriber:e}){e.error(n)}class Ko{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 ht(this.value);case"E":return Kg(this.error);case"C":return bE()}throw new Error("unexpected notification kind value")}static createNext(e){return void 0!==e?new Ko("N",e):Ko.undefinedValueNotification}static createError(e){return new Ko("E",void 0,e)}static createComplete(){return Ko.completeNotification}}Ko.completeNotification=new Ko("C"),Ko.undefinedValueNotification=new Ko("N",void 0);class CE extends xt{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(CE.dispatch,this.delay,new bne(e,this.destination)))}_next(e){this.scheduleMessage(Ko.createNext(e))}_error(e){this.scheduleMessage(Ko.createError(e)),this.unsubscribe()}_complete(){this.scheduleMessage(Ko.createComplete()),this.unsubscribe()}}class bne{constructor(e,t){this.notification=e,this.destination=t}}class If extends Se{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 Cne(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 Qt;if(this.isStopped||this.hasError?o=Te.EMPTY:(this.observers.push(e),o=new li(this,e)),r&&e.add(e=new CE(e,r)),t)for(let a=0;at&&(o=Math.max(o,s-t)),o>0&&r.splice(0,o),r}}class Cne{constructor(e,t){this.time=e,this.value=t}}function Pr(n,e){return"function"==typeof e?t=>t.pipe(Pr((i,r)=>ui(n(i,r)).pipe(Ae((s,o)=>e(i,s,r,o))))):t=>t.lift(new wne(n))}class wne{constructor(e){this.project=e}call(e,t){return t.subscribe(new Ene(e,this.project))}}class Ene extends ii{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 Gr(this),r=this.destination;r.add(i),this.innerSubscription=co(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 wE={schedule(n,e){const t=setTimeout(n,e);return()=>clearTimeout(t)},scheduleBeforeRender(n){if("undefined"==typeof window)return wE.schedule(n,0);if(void 0===window.requestAnimationFrame)return wE.schedule(n,16);const e=window.requestAnimationFrame(n);return()=>window.cancelAnimationFrame(e)}};let $D;function Rne(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(!$D){const t=Element.prototype;$D=t.matches||t.matchesSelector||t.mozMatchesSelector||t.msMatchesSelector||t.oMatchesSelector||t.webkitMatchesSelector}return n.nodeType===Node.ELEMENT_NODE&&$D.call(n,e)}(n,r)||(i=s,0))),i}class Fne{constructor(e,t){this.componentFactory=t.get(ll).resolveComponentFactory(e)}create(e){return new Nne(this.componentFactory,e)}}class Nne{constructor(e,t){this.componentFactory=e,this.injector=t,this.eventEmitters=new If(1),this.events=this.eventEmitters.pipe(Pr(i=>Ni(...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(dt),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=wE.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=Nt.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(Ae(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=wE.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 y_(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 Lne extends HTMLElement{constructor(){super(...arguments),this.ngElementEventsSubscription=null}}function Mt(n){return null!=n&&"false"!=`${n}`}function To(n,e=0){return function(n){return!isNaN(parseFloat(n))&&!isNaN(Number(n))}(n)?Number(n):e}function EE(n){return Array.isArray(n)?n:[n]}function jr(n){return null==n?"":"string"==typeof n?n:`${n}px`}function Wu(n){return n instanceof rt?n.nativeElement:n}const Pf=new Jl(vE);function Zg(n,e=Pf){return t=>t.lift(new jne(n,e))}class jne{constructor(e,t){this.dueTime=e,this.scheduler=t}call(e,t){return t.subscribe(new Une(e,this.dueTime,this.scheduler))}}class Une extends xt{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(Hne,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 Hne(n){n.debouncedNext()}let GD=(()=>{class n{create(t){return"undefined"==typeof MutationObserver?null:new MutationObserver(t)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ue({factory:function(){return new n},token:n,providedIn:"root"}),n})(),CV=(()=>{class n{constructor(t){this._mutationObserverFactory=t,this._observedElements=new Map}ngOnDestroy(){this._observedElements.forEach((t,i)=>this._cleanupObserver(i))}observe(t){const i=Wu(t);return new ce(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 Se,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)(I(GD))},n.\u0275prov=ue({factory:function(){return new n(I(GD))},token:n,providedIn:"root"}),n})(),WD=(()=>{class n{constructor(t,i,r){this._contentObserver=t,this._elementRef=i,this._ngZone=r,this.event=new Le,this._disabled=!1,this._currentSubscription=null}get disabled(){return this._disabled}set disabled(t){this._disabled=Mt(t),this._disabled?this._unsubscribe():this._subscribe()}get debounce(){return this._debounce}set debounce(t){this._debounce=To(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(Zg(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)(E(CV),E(rt),E(dt))},n.\u0275dir=oe({type:n,selectors:[["","cdkObserveContent",""]],inputs:{disabled:["cdkObserveContentDisabled","disabled"],debounce:"debounce"},outputs:{event:"cdkObserveContent"},exportAs:["cdkObserveContent"]}),n})(),SE=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({providers:[GD]}),n})();class ar extends Se{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 Qt;return this._value}next(e){super.next(this._value=e)}}function Zs(n,...e){return e.length?e.some(t=>n[t]):n.altKey||n.shiftKey||n.ctrlKey||n.metaKey}function ih(){}function Ti(n,e,t){return function(r){return r.lift(new tie(n,e,t))}}class tie{constructor(e,t,i){this.nextOrObserver=e,this.error=t,this.complete=i}call(e,t){return t.subscribe(new nie(e,this.nextOrObserver,this.error,this.complete))}}class nie extends xt{constructor(e,t,i,r){super(e),this._tapNext=ih,this._tapError=ih,this._tapComplete=ih,this._tapError=i||ih,this._tapComplete=r||ih,Ke(t)?(this._context=this,this._tapNext=t):t&&(this._context=t,this._tapNext=t.next||ih,this._tapError=t.error||ih,this._tapComplete=t.complete||ih)}_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 Fn(n,e){return function(i){return i.lift(new iie(n,e))}}class iie{constructor(e,t){this.predicate=e,this.thisArg=t}call(e,t){return t.subscribe(new rie(e,this.predicate,this.thisArg))}}class rie extends xt{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)}}const SV=(()=>{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?bE():e.lift(new sie(n))}class sie{constructor(e){if(this.total=e,this.total<0)throw new SV}call(e,t){return t.subscribe(new oie(e,this.total))}}class oie extends xt{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 QD(n){return e=>e.lift(new aie(n))}class aie{constructor(e){this.total=e}call(e,t){return t.subscribe(new lie(e,this.total))}}class lie extends xt{constructor(e,t){super(e),this.total=t,this.count=0}_next(e){++this.count>this.total&&this.destination.next(e)}}function Zo(n,e){return t=>t.lift(new cie(n,e))}class cie{constructor(e,t){this.compare=e,this.keySelector=t}call(e,t){return t.subscribe(new uie(e,this.compare,this.keySelector))}}class uie extends xt{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))}}function Tn(n){return e=>e.lift(new die(n))}class die{constructor(e){this.notifier=e}call(e,t){const i=new hie(e),r=co(this.notifier,new Gr(i));return r&&!i.seenValue?(i.add(r),t.subscribe(i)):i}}class hie extends ii{constructor(e){super(e),this.seenValue=!1}notifyNext(){this.seenValue=!0,this.complete()}notifyComplete(){}}let JD;try{JD="undefined"!=typeof Intl&&Intl.v8BreakIterator}catch(n){JD=!1}let em,si=(()=>{class n{constructor(t){this._platformId=t,this.isBrowser=this._platformId?Of(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&&!JD)&&"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)(I(dl))},n.\u0275prov=ue({factory:function(){return new n(I(dl))},token:n,providedIn:"root"}),n})(),Rv=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({}),n})();const MV=["color","button","checkbox","date","datetime-local","email","file","hidden","image","month","number","password","radio","range","reset","search","submit","tel","text","time","url","week"];function xV(){if(em)return em;if("object"!=typeof document||!document)return em=new Set(MV),em;let n=document.createElement("input");return em=new Set(MV.filter(e=>(n.setAttribute("type",e),n.type===e))),em}let kv,Ff,eO;function tm(n){return function(){if(null==kv&&"undefined"!=typeof window)try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:()=>kv=!0}))}finally{kv=kv||!1}return kv}()?n:!!n.capture}function TV(){if(null==Ff){if("object"!=typeof document||!document||"function"!=typeof Element||!Element)return Ff=!1,Ff;if("scrollBehavior"in document.documentElement.style)Ff=!0;else{const n=Element.prototype.scrollTo;Ff=!!n&&!/\{\s*\[native code\]\s*\}/.test(n.toString())}}return Ff}function xE(){let n="undefined"!=typeof document&&document?document.activeElement:null;for(;n&&n.shadowRoot;){const e=n.shadowRoot.activeElement;if(e===n)break;n=e}return n}function Nf(n){return n.composedPath?n.composedPath()[0]:n.target}function TE(n,e){return(n.getAttribute(e)||"").match(/\S+/g)||[]}const DV="cdk-describedby-message-container",OV="cdk-describedby-message",AE="cdk-describedby-host";let yie=0;const $c=new Map;let Rs=null,IV=(()=>{class n{constructor(t){this._document=t}describe(t,i,r){if(!this._canBeDescribed(t,i))return;const s=tO(i,r);"string"!=typeof i?(PV(i),$c.set(s,{messageElement:i,referenceCount:0})):$c.has(s)||this._createMessageElement(i,r),this._isElementDescribedByMessage(t,s)||this._addMessageReference(t,s)}removeDescription(t,i,r){if(!i||!this._isElementNode(t))return;const s=tO(i,r);if(this._isElementDescribedByMessage(t,s)&&this._removeMessageReference(t,s),"string"==typeof i){const o=$c.get(s);o&&0===o.referenceCount&&this._deleteMessageElement(s)}Rs&&0===Rs.childNodes.length&&this._deleteMessagesContainer()}ngOnDestroy(){const t=this._document.querySelectorAll(`[${AE}]`);for(let i=0;i0!=r.indexOf(OV));t.setAttribute("aria-describedby",i.join(" "))}_addMessageReference(t,i){const r=$c.get(i);(function(n,e,t){const i=TE(n,e);i.some(r=>r.trim()==t.trim())||(i.push(t.trim()),n.setAttribute(e,i.join(" ")))})(t,"aria-describedby",r.messageElement.id),t.setAttribute(AE,""),r.referenceCount++}_removeMessageReference(t,i){const r=$c.get(i);r.referenceCount--,function(n,e,t){const r=TE(n,e).filter(s=>s!=t.trim());r.length?n.setAttribute(e,r.join(" ")):n.removeAttribute(e)}(t,"aria-describedby",r.messageElement.id),t.removeAttribute(AE)}_isElementDescribedByMessage(t,i){const r=TE(t,"aria-describedby"),s=$c.get(i),o=s&&s.messageElement.id;return!!o&&-1!=r.indexOf(o)}_canBeDescribed(t,i){if(!this._isElementNode(t))return!1;if(i&&"object"==typeof i)return!0;const r=null==i?"":`${i}`.trim(),s=t.getAttribute("aria-label");return!(!r||s&&s.trim()===r)}_isElementNode(t){return t.nodeType===this._document.ELEMENT_NODE}}return n.\u0275fac=function(t){return new(t||n)(I(ut))},n.\u0275prov=ue({factory:function(){return new n(I(ut))},token:n,providedIn:"root"}),n})();function tO(n,e){return"string"==typeof n?`${e||""}/${n}`:n}function PV(n){n.id||(n.id=`${OV}-${yie++}`)}class RV{constructor(e){this._items=e,this._activeItemIndex=-1,this._activeItem=null,this._wrap=!1,this._letterKeyStream=new Se,this._typeaheadSubscription=Te.EMPTY,this._vertical=!0,this._allowedModifierKeys=[],this._homeAndEnd=!1,this._skipPredicateFn=t=>t.disabled,this._pressedLetters=[],this.tabOut=new Se,this.change=new Se,e instanceof Sf&&e.changes.subscribe(t=>{if(this._activeItem){const r=t.toArray().indexOf(this._activeItem);r>-1&&r!==this._activeItemIndex&&(this._activeItemIndex=r)}})}skipPredicate(e){return this._skipPredicateFn=e,this}withWrap(e=!0){return this._wrap=e,this}withVerticalOrientation(e=!0){return this._vertical=e,this}withHorizontalOrientation(e){return this._horizontal=e,this}withAllowedModifierKeys(e){return this._allowedModifierKeys=e,this}withTypeAhead(e=200){return this._typeaheadSubscription.unsubscribe(),this._typeaheadSubscription=this._letterKeyStream.pipe(Ti(t=>this._pressedLetters.push(t)),Zg(e),Fn(()=>this._pressedLetters.length>0),Ae(()=>this._pressedLetters.join(""))).subscribe(t=>{const i=this._getItemsArray();for(let r=1;r!e[s]||this._allowedModifierKeys.indexOf(s)>-1);switch(t){case 9:return void this.tabOut.next();case 40:if(this._vertical&&r){this.setNextItemActive();break}return;case 38:if(this._vertical&&r){this.setPreviousItemActive();break}return;case 39:if(this._horizontal&&r){"rtl"===this._horizontal?this.setPreviousItemActive():this.setNextItemActive();break}return;case 37:if(this._horizontal&&r){"rtl"===this._horizontal?this.setNextItemActive():this.setPreviousItemActive();break}return;case 36:if(this._homeAndEnd&&r){this.setFirstItemActive();break}return;case 35:if(this._homeAndEnd&&r){this.setLastItemActive();break}return;default:return void((r||Zs(e,"shiftKey"))&&(e.key&&1===e.key.length?this._letterKeyStream.next(e.key.toLocaleUpperCase()):(t>=65&&t<=90||t>=48&&t<=57)&&this._letterKeyStream.next(String.fromCharCode(t))))}this._pressedLetters=[],e.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(e){const t=this._getItemsArray(),i="number"==typeof e?e:t.indexOf(e),r=t[i];this._activeItem=null==r?null:r,this._activeItemIndex=i}_setActiveItemByDelta(e){this._wrap?this._setActiveInWrapMode(e):this._setActiveInDefaultMode(e)}_setActiveInWrapMode(e){const t=this._getItemsArray();for(let i=1;i<=t.length;i++){const r=(this._activeItemIndex+e*i+t.length)%t.length;if(!this._skipPredicateFn(t[r]))return void this.setActiveItem(r)}}_setActiveInDefaultMode(e){this._setActiveItemByIndex(this._activeItemIndex+e,e)}_setActiveItemByIndex(e,t){const i=this._getItemsArray();if(i[e]){for(;this._skipPredicateFn(i[e]);)if(!i[e+=t])return;this.setActiveItem(e)}}_getItemsArray(){return this._items instanceof Sf?this._items.toArray():this._items}}class kV extends RV{setActiveItem(e){this.activeItem&&this.activeItem.setInactiveStyles(),super.setActiveItem(e),this.activeItem&&this.activeItem.setActiveStyles()}}class nO extends RV{constructor(){super(...arguments),this._origin="program"}setFocusOrigin(e){return this._origin=e,this}setActiveItem(e){super.setActiveItem(e),this.activeItem&&this.activeItem.focus(this._origin)}}let FV=(()=>{class n{constructor(t){this._platform=t}isDisabled(t){return t.hasAttribute("disabled")}isVisible(t){return function(n){return!!(n.offsetWidth||n.offsetHeight||"function"==typeof n.getClientRects&&n.getClientRects().length)}(t)&&"visible"===getComputedStyle(t).visibility}isTabbable(t){if(!this._platform.isBrowser)return!1;const i=function(n){try{return n.frameElement}catch(e){return null}}(function(n){return n.ownerDocument&&n.ownerDocument.defaultView||window}(t));if(i&&(-1===LV(i)||!this.isVisible(i)))return!1;let r=t.nodeName.toLowerCase(),s=LV(t);return t.hasAttribute("contenteditable")?-1!==s:!("iframe"===r||"object"===r||this._platform.WEBKIT&&this._platform.IOS&&!function(n){let e=n.nodeName.toLowerCase(),t="input"===e&&n.type;return"text"===t||"password"===t||"select"===e||"textarea"===e}(t))&&("audio"===r?!!t.hasAttribute("controls")&&-1!==s:"video"===r?-1!==s&&(null!==s||this._platform.FIREFOX||t.hasAttribute("controls")):t.tabIndex>=0)}isFocusable(t,i){return function(n){return!function(n){return function(n){return"input"==n.nodeName.toLowerCase()}(n)&&"hidden"==n.type}(n)&&(function(n){let e=n.nodeName.toLowerCase();return"input"===e||"select"===e||"button"===e||"textarea"===e}(n)||function(n){return function(n){return"a"==n.nodeName.toLowerCase()}(n)&&n.hasAttribute("href")}(n)||n.hasAttribute("contenteditable")||NV(n))}(t)&&!this.isDisabled(t)&&((null==i?void 0:i.ignoreVisibility)||this.isVisible(t))}}return n.\u0275fac=function(t){return new(t||n)(I(si))},n.\u0275prov=ue({factory:function(){return new n(I(si))},token:n,providedIn:"root"}),n})();function NV(n){if(!n.hasAttribute("tabindex")||void 0===n.tabIndex)return!1;let e=n.getAttribute("tabindex");return"-32768"!=e&&!(!e||isNaN(parseInt(e,10)))}function LV(n){if(!NV(n))return null;const e=parseInt(n.getAttribute("tabindex")||"",10);return isNaN(e)?-1:e}class Die{constructor(e,t,i,r,s=!1){this._element=e,this._checker=t,this._ngZone=i,this._document=r,this._hasAttached=!1,this.startAnchorListener=()=>this.focusLastTabbableElement(),this.endAnchorListener=()=>this.focusFirstTabbableElement(),this._enabled=!0,s||this.attachAnchors()}get enabled(){return this._enabled}set enabled(e){this._enabled=e,this._startAnchor&&this._endAnchor&&(this._toggleAnchorTabIndex(e,this._startAnchor),this._toggleAnchorTabIndex(e,this._endAnchor))}destroy(){const 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}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(e){return new Promise(t=>{this._executeOnStable(()=>t(this.focusInitialElement(e)))})}focusFirstTabbableElementWhenReady(e){return new Promise(t=>{this._executeOnStable(()=>t(this.focusFirstTabbableElement(e)))})}focusLastTabbableElementWhenReady(e){return new Promise(t=>{this._executeOnStable(()=>t(this.focusLastTabbableElement(e)))})}_getRegionBoundary(e){let t=this._element.querySelectorAll(`[cdk-focus-region-${e}], [cdkFocusRegion${e}], [cdk-focus-${e}]`);for(let i=0;i=0;i--){let r=t[i].nodeType===this._document.ELEMENT_NODE?this._getLastTabbableElement(t[i]):null;if(r)return r}return null}_createAnchor(){const 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}_toggleAnchorTabIndex(e,t){e?t.setAttribute("tabindex","0"):t.removeAttribute("tabindex")}toggleAnchors(e){this._startAnchor&&this._endAnchor&&(this._toggleAnchorTabIndex(e,this._startAnchor),this._toggleAnchorTabIndex(e,this._endAnchor))}_executeOnStable(e){this._ngZone.isStable?e():this._ngZone.onStable.pipe(yi(1)).subscribe(e)}}let BV=(()=>{class n{constructor(t,i,r){this._checker=t,this._ngZone=i,this._document=r}create(t,i=!1){return new Die(t,this._checker,this._ngZone,this._document,i)}}return n.\u0275fac=function(t){return new(t||n)(I(FV),I(dt),I(ut))},n.\u0275prov=ue({factory:function(){return new n(I(FV),I(dt),I(ut))},token:n,providedIn:"root"}),n})();function VV(n){return 0===n.offsetX&&0===n.offsetY}function zV(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 jV=new ve("cdk-input-modality-detector-options"),kie={ignoreKeys:[18,17,224,91,16]},nm=tm({passive:!0,capture:!0});let HV=(()=>{class n{constructor(t,i,r,s){this._platform=t,this._mostRecentTarget=null,this._modality=new ar(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=Nf(o))},this._onMousedown=o=>{Date.now()-this._lastTouchMs<650||(this._modality.next(VV(o)?"keyboard":"mouse"),this._mostRecentTarget=Nf(o))},this._onTouchstart=o=>{zV(o)?this._modality.next("keyboard"):(this._lastTouchMs=Date.now(),this._modality.next("touch"),this._mostRecentTarget=Nf(o))},this._options=Object.assign(Object.assign({},kie),s),this.modalityDetected=this._modality.pipe(QD(1)),this.modalityChanged=this.modalityDetected.pipe(Zo()),t.isBrowser&&i.runOutsideAngular(()=>{r.addEventListener("keydown",this._onKeydown,nm),r.addEventListener("mousedown",this._onMousedown,nm),r.addEventListener("touchstart",this._onTouchstart,nm)})}get mostRecentModality(){return this._modality.value}ngOnDestroy(){!this._platform.isBrowser||(document.removeEventListener("keydown",this._onKeydown,nm),document.removeEventListener("mousedown",this._onMousedown,nm),document.removeEventListener("touchstart",this._onTouchstart,nm))}}return n.\u0275fac=function(t){return new(t||n)(I(si),I(dt),I(ut),I(jV,8))},n.\u0275prov=ue({factory:function(){return new n(I(si),I(dt),I(ut),I(jV,8))},token:n,providedIn:"root"}),n})();const $V=new ve("liveAnnouncerElement",{providedIn:"root",factory:function(){return null}}),GV=new ve("LIVE_ANNOUNCER_DEFAULT_OPTIONS");let DE=(()=>{class n{constructor(t,i,r,s){this._ngZone=i,this._defaultOptions=s,this._document=r,this._liveElement=t||this._createLiveElement()}announce(t,...i){const r=this._defaultOptions;let s,o;return 1===i.length&&"number"==typeof i[0]?o=i[0]:[s,o]=i,this.clear(),clearTimeout(this._previousTimeout),s||(s=r&&r.politeness?r.politeness:"polite"),null==o&&r&&(o=r.duration),this._liveElement.setAttribute("aria-live",s),this._ngZone.runOutsideAngular(()=>new Promise(a=>{clearTimeout(this._previousTimeout),this._previousTimeout=setTimeout(()=>{this._liveElement.textContent=t,a(),"number"==typeof o&&(this._previousTimeout=setTimeout(()=>this.clear(),o))},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",i=this._document.getElementsByClassName(t),r=this._document.createElement("div");for(let s=0;s{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 Se,this._rootNodeFocusAndBlurListener=a=>{const l=Nf(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=Wu(t);if(!this._platform.isBrowser||1!==r.nodeType)return ht(null);const s=function(n){if(function(){if(null==eO){const n="undefined"!=typeof document?document.head:null;eO=!(!n||!n.createShadowRoot&&!n.attachShadow)}return eO}()){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 Se,rootNode:s};return this._elementInfo.set(r,a),this._registerGlobalListeners(a),a.subject}stopMonitoring(t){const i=Wu(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=Wu(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=Nf(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,OE),i.addEventListener("blur",this._rootNodeFocusAndBlurListener,OE)}),this._rootNodeFocusListenerCount.set(i,r+1),1==++this._monitoredElementCount&&(this._ngZone.runOutsideAngular(()=>{this._getWindow().addEventListener("focus",this._windowFocusListener)}),this._inputModalityDetector.modalityDetected.pipe(Tn(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,OE),i.removeEventListener("blur",this._rootNodeFocusAndBlurListener,OE),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)(I(dt),I(si),I(HV),I(ut,8),I(WV,8))},n.\u0275prov=ue({factory:function(){return new n(I(dt),I(si),I(HV),I(ut,8),I(WV,8))},token:n,providedIn:"root"}),n})();const qV="cdk-high-contrast-black-on-white",YV="cdk-high-contrast-white-on-black",iO="cdk-high-contrast-active";let XV=(()=>{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(iO),t.remove(qV),t.remove(YV),this._hasCheckedHighContrastMode=!0;const i=this.getHighContrastMode();1===i?(t.add(iO),t.add(qV)):2===i&&(t.add(iO),t.add(YV))}}}return n.\u0275fac=function(t){return new(t||n)(I(si),I(ut))},n.\u0275prov=ue({factory:function(){return new n(I(si),I(ut))},token:n,providedIn:"root"}),n})(),Nie=(()=>{class n{constructor(t){t._applyBodyHighContrastModeCssClasses()}}return n.\u0275fac=function(t){return new(t||n)(I(XV))},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[Rv,SE]]}),n})();const KV=new ve("cdk-dir-doc",{providedIn:"root",factory:function(){return Oc(ut)}});let Qo=(()=>{class n{constructor(t){if(this.value="ltr",this.change=new Le,t){const r=t.documentElement?t.documentElement.dir:null,s=(t.body?t.body.dir:null)||r;this.value="ltr"===s||"rtl"===s?s:"ltr"}}ngOnDestroy(){this.change.complete()}}return n.\u0275fac=function(t){return new(t||n)(I(KV,8))},n.\u0275prov=ue({factory:function(){return new n(I(KV,8))},token:n,providedIn:"root"}),n})(),Nv=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({}),n})();const ZV=new ju("12.2.5");function IE(...n){return uo(1)(ht(...n))}function Rr(...n){const e=n[n.length-1];return Gn(e)?(n.pop(),t=>IE(n,t,e)):t=>IE(n,t)}class QV{}const qu="*";function tc(n,e){return{type:7,name:n,definitions:e,options:{}}}function Ao(n,e=null){return{type:4,styles:e,timings:n}}function JV(n,e=null){return{type:2,steps:n,options:e}}function ti(n){return{type:6,styles:n,offset:null}}function wr(n,e,t){return{type:0,name:n,styles:e,options:t}}function zie(n){return{type:5,steps:n}}function Qs(n,e,t=null){return{type:1,expr:n,animation:e,options:t}}function jie(n=null){return{type:9,options:n}}function Uie(n,e,t=null){return{type:11,selector:n,animation:e,options:t}}function ez(n){Promise.resolve(null).then(n)}class im{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(){ez(()=>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}}class tz{constructor(e){this._onDoneFns=[],this._onStartFns=[],this._finished=!1,this._started=!1,this._destroyed=!1,this._onDestroyFns=[],this.parentPlayer=null,this.totalTime=0,this.players=e;let t=0,i=0,r=0;const s=this.players.length;0==s?ez(()=>this._onFinish()):this.players.forEach(o=>{o.onDone(()=>{++t==s&&this._onFinish()}),o.onDestroy(()=>{++i==s&&this._onDestroy()}),o.onStart(()=>{++r==s&&this._onStart()})}),this.totalTime=this.players.reduce((o,a)=>Math.max(o,a.totalTime),0)}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(e=>e()),this._onDoneFns=[])}init(){this.players.forEach(e=>e.init())}onStart(e){this._onStartFns.push(e)}_onStart(){this.hasStarted()||(this._started=!0,this._onStartFns.forEach(e=>e()),this._onStartFns=[])}onDone(e){this._onDoneFns.push(e)}onDestroy(e){this._onDestroyFns.push(e)}hasStarted(){return this._started}play(){this.parentPlayer||this.init(),this._onStart(),this.players.forEach(e=>e.play())}pause(){this.players.forEach(e=>e.pause())}restart(){this.players.forEach(e=>e.restart())}finish(){this._onFinish(),this.players.forEach(e=>e.finish())}destroy(){this._onDestroy()}_onDestroy(){this._destroyed||(this._destroyed=!0,this._onFinish(),this.players.forEach(e=>e.destroy()),this._onDestroyFns.forEach(e=>e()),this._onDestroyFns=[])}reset(){this.players.forEach(e=>e.reset()),this._destroyed=!1,this._finished=!1,this._started=!1}setPosition(e){const t=e*this.totalTime;this.players.forEach(i=>{const r=i.totalTime?Math.min(1,t/i.totalTime):1;i.setPosition(r)})}getPosition(){const e=this.players.reduce((t,i)=>null===t||i.totalTime>t.totalTime?i:t,null);return null!=e?e.getPosition():0}beforeDestroy(){this.players.forEach(e=>{e.beforeDestroy&&e.beforeDestroy()})}triggerCallback(e){const t="start"==e?this._onStartFns:this._onDoneFns;t.forEach(i=>i()),t.length=0}}function nz(){return"undefined"!=typeof window&&void 0!==window.document}function sO(){return"undefined"!=typeof process&&"[object process]"==={}.toString.call(process)}function rh(n){switch(n.length){case 0:return new im;case 1:return n[0];default:return new tz(n)}}function iz(n,e,t,i,r={},s={}){const o=[],a=[];let l=-1,c=null;if(i.forEach(d=>{const f=d.offset,p=f==l,g=p&&c||{};Object.keys(d).forEach(_=>{let y=_,v=d[_];if("offset"!==_)switch(y=e.normalizePropertyName(y,o),v){case"!":v=r[_];break;case qu:v=s[_];break;default:v=e.normalizeStyleValue(_,y,v,o)}g[y]=v}),p||a.push(g),c=g,l=f}),o.length){const d="\n - ";throw new Error(`Unable to animate due to the following errors:${d}${o.join(d)}`)}return a}function oO(n,e,t,i){switch(e){case"start":n.onStart(()=>i(t&&aO(t,"start",n)));break;case"done":n.onDone(()=>i(t&&aO(t,"done",n)));break;case"destroy":n.onDestroy(()=>i(t&&aO(t,"destroy",n)))}}function aO(n,e,t){const i=t.totalTime,s=lO(n.element,n.triggerName,n.fromState,n.toState,e||n.phaseName,null==i?n.totalTime:i,!!t.disabled),o=n._data;return null!=o&&(s._data=o),s}function lO(n,e,t,i,r="",s=0,o){return{element:n,triggerName:e,fromState:t,toState:i,phaseName:r,totalTime:s,disabled:!!o}}function Ma(n,e,t){let i;return n instanceof Map?(i=n.get(e),i||n.set(e,i=t)):(i=n[e],i||(i=n[e]=t)),i}function rz(n){const e=n.indexOf(":");return[n.substring(1,e),n.substr(e+1)]}let cO=(n,e)=>!1,uO=(n,e)=>!1,sz=(n,e,t)=>[];const oz=sO();(oz||"undefined"!=typeof Element)&&(cO=nz()?(n,e)=>{for(;e&&e!==document.documentElement;){if(e===n)return!0;e=e.parentNode||e.host}return!1}:(n,e)=>n.contains(e),uO=(()=>{if(oz||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]):uO}})(),sz=(n,e,t)=>{let i=[];if(t){const r=n.querySelectorAll(e);for(let s=0;s{const i=t.replace(/([a-z])([A-Z])/g,"$1-$2");e[i]=n[t]}),e}let cz=(()=>{class n{validateStyleProperty(t){return dO(t)}matchesElement(t,i){return hO(t,i)}containsElement(t,i){return fO(t,i)}query(t,i,r){return pO(t,i,r)}computeStyle(t,i,r){return r||""}animate(t,i,r,s,o,a=[],l){return new im(r,s)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();class PE{}PE.NOOP=new cz;const gO="ng-enter",RE="ng-leave",kE="ng-trigger",FE=".ng-trigger",dz="ng-animating",mO=".ng-animating";function Bf(n){if("number"==typeof n)return n;const e=n.match(/^(-?[\.\d]+)(m?s)/);return!e||e.length<2?0:_O(parseFloat(e[1]),e[2])}function _O(n,e){switch(e){case"s":return 1e3*n;default:return n}}function NE(n,e,t){return n.hasOwnProperty("duration")?n:function(n,e,t){let r,s=0,o="";if("string"==typeof n){const a=n.match(/^(-?[\.\d]+)(m?s)(?:\s+(-?[\.\d]+)(m?s))?(?:\s+([-a-z]+(?:\(.+?\))?))?$/i);if(null===a)return e.push(`The provided timing value "${n}" is invalid.`),{duration:0,delay:0,easing:""};r=_O(parseFloat(a[1]),a[2]);const l=a[3];null!=l&&(s=_O(parseFloat(l),a[4]));const c=a[5];c&&(o=c)}else r=n;if(!t){let a=!1,l=e.length;r<0&&(e.push("Duration values below 0 are not allowed for this animation step."),a=!0),s<0&&(e.push("Delay values below 0 are not allowed for this animation step."),a=!0),a&&e.splice(l,0,`The provided timing value "${n}" is invalid.`)}return{duration:r,delay:s,easing:o}}(n,e,t)}function rm(n,e={}){return Object.keys(n).forEach(t=>{e[t]=n[t]}),e}function sh(n,e,t={}){if(e)for(let i in n)t[i]=n[i];else rm(n,t);return t}function fz(n,e,t){return t?e+":"+t+";":""}function pz(n){let e="";for(let t=0;t{const r=vO(i);t&&!t.hasOwnProperty(i)&&(t[i]=n.style[r]),n.style[r]=e[i]}),sO()&&pz(n))}function Vf(n,e){n.style&&(Object.keys(e).forEach(t=>{const i=vO(t);n.style[i]=""}),sO()&&pz(n))}function Lv(n){return Array.isArray(n)?1==n.length?n[0]:JV(n):n}const yO=new RegExp("{{\\s*(.+?)\\s*}}","g");function gz(n){let e=[];if("string"==typeof n){let t;for(;t=yO.exec(n);)e.push(t[1]);yO.lastIndex=0}return e}function LE(n,e,t){const i=n.toString(),r=i.replace(yO,(s,o)=>{let a=e[o];return e.hasOwnProperty(o)||(t.push(`Please provide a value for the animation param ${o}`),a=""),a.toString()});return r==i?n:r}function BE(n){const e=[];let t=n.next();for(;!t.done;)e.push(t.value),t=n.next();return e}const Xie=/-+([a-z0-9])/g;function vO(n){return n.replace(Xie,(...e)=>e[1].toUpperCase())}function Kie(n){return n.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function mz(n,e){return 0===n||0===e}function _z(n,e,t){const i=Object.keys(t);if(i.length&&e.length){let s=e[0],o=[];if(i.forEach(a=>{s.hasOwnProperty(a)||o.push(a),s[a]=t[a]}),o.length)for(var r=1;rfunction(n,e,t){if(":"==n[0]){const l=function(n,e){switch(n){case":enter":return"void => *";case":leave":return"* => void";case":increment":return(t,i)=>parseFloat(i)>parseFloat(t);case":decrement":return(t,i)=>parseFloat(i) *"}}(n,t);if("function"==typeof l)return void e.push(l);n=l}const i=n.match(/^(\*|[-\w]+)\s*()\s*(\*|[-\w]+)$/);if(null==i||i.length<4)return t.push(`The provided transition expression "${n}" is not supported`),e;const r=i[1],s=i[2],o=i[3];e.push(yz(r,o));"<"==s[0]&&!("*"==r&&"*"==o)&&e.push(yz(o,r))}(i,t,e)):t.push(n),t}const zE=new Set(["true","1"]),jE=new Set(["false","0"]);function yz(n,e){const t=zE.has(n)||jE.has(n),i=zE.has(e)||jE.has(e);return(r,s)=>{let o="*"==n||n==r,a="*"==e||e==s;return!o&&t&&"boolean"==typeof r&&(o=r?zE.has(n):jE.has(n)),!a&&i&&"boolean"==typeof s&&(a=s?zE.has(e):jE.has(e)),o&&a}}const ere=new RegExp("s*:selfs*,?","g");function CO(n,e,t){return new tre(n).build(e,t)}class tre{constructor(e){this._driver=e}build(e,t){const i=new rre(t);return this._resetContextStyleTimingState(i),xa(this,Lv(e),i)}_resetContextStyleTimingState(e){e.currentQuerySelector="",e.collectedStyles={},e.collectedStyles[""]={},e.currentTime=0}visitTrigger(e,t){let i=t.queryCount=0,r=t.depCount=0;const s=[],o=[];return"@"==e.name.charAt(0)&&t.errors.push("animation triggers cannot be prefixed with an `@` sign (e.g. trigger('@foo', [...]))"),e.definitions.forEach(a=>{if(this._resetContextStyleTimingState(t),0==a.type){const l=a,c=l.name;c.toString().split(/\s*,\s*/).forEach(d=>{l.name=d,s.push(this.visitState(l,t))}),l.name=c}else if(1==a.type){const l=this.visitTransition(a,t);i+=l.queryCount,r+=l.depCount,o.push(l)}else t.errors.push("only state() and transition() definitions can sit inside of a trigger()")}),{type:7,name:e.name,states:s,transitions:o,queryCount:i,depCount:r,options:null}}visitState(e,t){const i=this.visitStyle(e.styles,t),r=e.options&&e.options.params||null;if(i.containsDynamicStyles){const s=new Set,o=r||{};if(i.styles.forEach(a=>{if(UE(a)){const l=a;Object.keys(l).forEach(c=>{gz(l[c]).forEach(d=>{o.hasOwnProperty(d)||s.add(d)})})}}),s.size){const a=BE(s.values());t.errors.push(`state("${e.name}", ...) must define default values for all the following style substitutions: ${a.join(", ")}`)}}return{type:0,name:e.name,style:i,options:r?{params:r}:null}}visitTransition(e,t){t.queryCount=0,t.depCount=0;const i=xa(this,Lv(e.animation),t);return{type:1,matchers:Zie(e.expr,t.errors),animation:i,queryCount:t.queryCount,depCount:t.depCount,options:zf(e.options)}}visitSequence(e,t){return{type:2,steps:e.steps.map(i=>xa(this,i,t)),options:zf(e.options)}}visitGroup(e,t){const i=t.currentTime;let r=0;const s=e.steps.map(o=>{t.currentTime=i;const a=xa(this,o,t);return r=Math.max(r,t.currentTime),a});return t.currentTime=r,{type:3,steps:s,options:zf(e.options)}}visitAnimate(e,t){const i=function(n,e){let t=null;if(n.hasOwnProperty("duration"))t=n;else if("number"==typeof n)return wO(NE(n,e).duration,0,"");const i=n;if(i.split(/\s+/).some(s=>"{"==s.charAt(0)&&"{"==s.charAt(1))){const s=wO(0,0,"");return s.dynamic=!0,s.strValue=i,s}return t=t||NE(i,e),wO(t.duration,t.delay,t.easing)}(e.timings,t.errors);t.currentAnimateTimings=i;let r,s=e.styles?e.styles:ti({});if(5==s.type)r=this.visitKeyframes(s,t);else{let o=e.styles,a=!1;if(!o){a=!0;const c={};i.easing&&(c.easing=i.easing),o=ti(c)}t.currentTime+=i.duration+i.delay;const l=this.visitStyle(o,t);l.isEmptyStep=a,r=l}return t.currentAnimateTimings=null,{type:4,timings:i,style:r,options:null}}visitStyle(e,t){const i=this._makeStyleAst(e,t);return this._validateStyleAst(i,t),i}_makeStyleAst(e,t){const i=[];Array.isArray(e.styles)?e.styles.forEach(o=>{"string"==typeof o?o==qu?i.push(o):t.errors.push(`The provided style string value ${o} is not allowed.`):i.push(o)}):i.push(e.styles);let r=!1,s=null;return i.forEach(o=>{if(UE(o)){const a=o,l=a.easing;if(l&&(s=l,delete a.easing),!r)for(let c in a)if(a[c].toString().indexOf("{{")>=0){r=!0;break}}}),{type:6,styles:i,easing:s,offset:e.offset,containsDynamicStyles:r,options:null}}_validateStyleAst(e,t){const i=t.currentAnimateTimings;let r=t.currentTime,s=t.currentTime;i&&s>0&&(s-=i.duration+i.delay),e.styles.forEach(o=>{"string"!=typeof o&&Object.keys(o).forEach(a=>{if(!this._driver.validateStyleProperty(a))return void t.errors.push(`The provided animation property "${a}" is not a supported CSS property for animations`);const l=t.collectedStyles[t.currentQuerySelector],c=l[a];let d=!0;c&&(s!=r&&s>=c.startTime&&r<=c.endTime&&(t.errors.push(`The CSS property "${a}" that exists between the times of "${c.startTime}ms" and "${c.endTime}ms" is also being animated in a parallel animation between the times of "${s}ms" and "${r}ms"`),d=!1),s=c.startTime),d&&(l[a]={startTime:s,endTime:r}),t.options&&function(n,e,t){const i=e.params||{},r=gz(n);r.length&&r.forEach(s=>{i.hasOwnProperty(s)||t.push(`Unable to resolve the local animation param ${s} in the given list of values`)})}(o[a],t.options,t.errors)})})}visitKeyframes(e,t){const i={type:5,styles:[],options:null};if(!t.currentAnimateTimings)return t.errors.push("keyframes() must be placed inside of a call to animate()"),i;let s=0;const o=[];let a=!1,l=!1,c=0;const d=e.steps.map(C=>{const w=this._makeStyleAst(C,t);let x=null!=w.offset?w.offset:function(n){if("string"==typeof n)return null;let e=null;if(Array.isArray(n))n.forEach(t=>{if(UE(t)&&t.hasOwnProperty("offset")){const i=t;e=parseFloat(i.offset),delete i.offset}});else if(UE(n)&&n.hasOwnProperty("offset")){const t=n;e=parseFloat(t.offset),delete t.offset}return e}(w.styles),N=0;return null!=x&&(s++,N=w.offset=x),l=l||N<0||N>1,a=a||N0&&s{const x=p>0?w==g?1:p*w:o[w],N=x*v;t.currentTime=_+y.delay+N,y.duration=N,this._validateStyleAst(C,t),C.offset=x,i.styles.push(C)}),i}visitReference(e,t){return{type:8,animation:xa(this,Lv(e.animation),t),options:zf(e.options)}}visitAnimateChild(e,t){return t.depCount++,{type:9,options:zf(e.options)}}visitAnimateRef(e,t){return{type:10,animation:this.visitReference(e.animation,t),options:zf(e.options)}}visitQuery(e,t){const i=t.currentQuerySelector,r=e.options||{};t.queryCount++,t.currentQuery=e;const[s,o]=function(n){const e=!!n.split(/\s*,\s*/).find(t=>":self"==t);return e&&(n=n.replace(ere,"")),[n=n.replace(/@\*/g,FE).replace(/@\w+/g,t=>FE+"-"+t.substr(1)).replace(/:animating/g,mO),e]}(e.selector);t.currentQuerySelector=i.length?i+" "+s:s,Ma(t.collectedStyles,t.currentQuerySelector,{});const a=xa(this,Lv(e.animation),t);return t.currentQuery=null,t.currentQuerySelector=i,{type:11,selector:s,limit:r.limit||0,optional:!!r.optional,includeSelf:o,animation:a,originalSelector:e.selector,options:zf(e.options)}}visitStagger(e,t){t.currentQuery||t.errors.push("stagger() can only be used inside of query()");const i="full"===e.timings?{duration:0,delay:0,easing:"full"}:NE(e.timings,t.errors,!0);return{type:12,animation:xa(this,Lv(e.animation),t),timings:i,options:null}}}class rre{constructor(e){this.errors=e,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 UE(n){return!Array.isArray(n)&&"object"==typeof n}function zf(n){return n?(n=rm(n)).params&&(n.params=function(n){return n?rm(n):null}(n.params)):n={},n}function wO(n,e,t){return{duration:n,delay:e,easing:t}}function EO(n,e,t,i,r,s,o=null,a=!1){return{type:1,element:n,keyframes:e,preStyleProps:t,postStyleProps:i,duration:r,delay:s,totalTime:r+s,easing:o,subTimeline:a}}class HE{constructor(){this._map=new Map}consume(e){let t=this._map.get(e);return t?this._map.delete(e):t=[],t}append(e,t){let i=this._map.get(e);i||this._map.set(e,i=[]),i.push(...t)}has(e){return this._map.has(e)}clear(){this._map.clear()}}const cre=new RegExp(":enter","g"),dre=new RegExp(":leave","g");function SO(n,e,t,i,r,s={},o={},a,l,c=[]){return(new hre).buildKeyframes(n,e,t,i,r,s,o,a,l,c)}class hre{buildKeyframes(e,t,i,r,s,o,a,l,c,d=[]){c=c||new HE;const f=new MO(e,t,c,r,s,d,[]);f.options=l,f.currentTimeline.setStyles([o],null,f.errors,l),xa(this,i,f);const p=f.timelines.filter(g=>g.containsAnimation());if(p.length&&Object.keys(a).length){const g=p[p.length-1];g.allowOnlyTimelineStyles()||g.setStyles([a],null,f.errors,l)}return p.length?p.map(g=>g.buildKeyframes()):[EO(t,[],[],[],0,0,"",!1)]}visitTrigger(e,t){}visitState(e,t){}visitTransition(e,t){}visitAnimateChild(e,t){const i=t.subInstructions.consume(t.element);if(i){const r=t.createSubContext(e.options),s=t.currentTimeline.currentTime,o=this._visitSubInstructions(i,r,r.options);s!=o&&t.transformIntoNewTimeline(o)}t.previousNode=e}visitAnimateRef(e,t){const i=t.createSubContext(e.options);i.transformIntoNewTimeline(),this.visitReference(e.animation,i),t.transformIntoNewTimeline(i.currentTimeline.currentTime),t.previousNode=e}_visitSubInstructions(e,t,i){let s=t.currentTimeline.currentTime;const o=null!=i.duration?Bf(i.duration):null,a=null!=i.delay?Bf(i.delay):null;return 0!==o&&e.forEach(l=>{const c=t.appendInstructionToTimeline(l,o,a);s=Math.max(s,c.duration+c.delay)}),s}visitReference(e,t){t.updateOptions(e.options,!0),xa(this,e.animation,t),t.previousNode=e}visitSequence(e,t){const i=t.subContextCount;let r=t;const s=e.options;if(s&&(s.params||s.delay)&&(r=t.createSubContext(s),r.transformIntoNewTimeline(),null!=s.delay)){6==r.previousNode.type&&(r.currentTimeline.snapshotCurrentStyles(),r.previousNode=$E);const o=Bf(s.delay);r.delayNextStep(o)}e.steps.length&&(e.steps.forEach(o=>xa(this,o,r)),r.currentTimeline.applyStylesToKeyframe(),r.subContextCount>i&&r.transformIntoNewTimeline()),t.previousNode=e}visitGroup(e,t){const i=[];let r=t.currentTimeline.currentTime;const s=e.options&&e.options.delay?Bf(e.options.delay):0;e.steps.forEach(o=>{const a=t.createSubContext(e.options);s&&a.delayNextStep(s),xa(this,o,a),r=Math.max(r,a.currentTimeline.currentTime),i.push(a.currentTimeline)}),i.forEach(o=>t.currentTimeline.mergeTimelineCollectedStyles(o)),t.transformIntoNewTimeline(r),t.previousNode=e}_visitTiming(e,t){if(e.dynamic){const i=e.strValue;return NE(t.params?LE(i,t.params,t.errors):i,t.errors)}return{duration:e.duration,delay:e.delay,easing:e.easing}}visitAnimate(e,t){const i=t.currentAnimateTimings=this._visitTiming(e.timings,t),r=t.currentTimeline;i.delay&&(t.incrementTime(i.delay),r.snapshotCurrentStyles());const s=e.style;5==s.type?this.visitKeyframes(s,t):(t.incrementTime(i.duration),this.visitStyle(s,t),r.applyStylesToKeyframe()),t.currentAnimateTimings=null,t.previousNode=e}visitStyle(e,t){const i=t.currentTimeline,r=t.currentAnimateTimings;!r&&i.getCurrentStyleProperties().length&&i.forwardFrame();const s=r&&r.easing||e.easing;e.isEmptyStep?i.applyEmptyStep(s):i.setStyles(e.styles,s,t.errors,t.options),t.previousNode=e}visitKeyframes(e,t){const i=t.currentAnimateTimings,r=t.currentTimeline.duration,s=i.duration,a=t.createSubContext().currentTimeline;a.easing=i.easing,e.styles.forEach(l=>{a.forwardTime((l.offset||0)*s),a.setStyles(l.styles,l.easing,t.errors,t.options),a.applyStylesToKeyframe()}),t.currentTimeline.mergeTimelineCollectedStyles(a),t.transformIntoNewTimeline(r+s),t.previousNode=e}visitQuery(e,t){const i=t.currentTimeline.currentTime,r=e.options||{},s=r.delay?Bf(r.delay):0;s&&(6===t.previousNode.type||0==i&&t.currentTimeline.getCurrentStyleProperties().length)&&(t.currentTimeline.snapshotCurrentStyles(),t.previousNode=$E);let o=i;const a=t.invokeQuery(e.selector,e.originalSelector,e.limit,e.includeSelf,!!r.optional,t.errors);t.currentQueryTotal=a.length;let l=null;a.forEach((c,d)=>{t.currentQueryIndex=d;const f=t.createSubContext(e.options,c);s&&f.delayNextStep(s),c===t.element&&(l=f.currentTimeline),xa(this,e.animation,f),f.currentTimeline.applyStylesToKeyframe(),o=Math.max(o,f.currentTimeline.currentTime)}),t.currentQueryIndex=0,t.currentQueryTotal=0,t.transformIntoNewTimeline(o),l&&(t.currentTimeline.mergeTimelineCollectedStyles(l),t.currentTimeline.snapshotCurrentStyles()),t.previousNode=e}visitStagger(e,t){const i=t.parentContext,r=t.currentTimeline,s=e.timings,o=Math.abs(s.duration),a=o*(t.currentQueryTotal-1);let l=o*t.currentQueryIndex;switch(s.duration<0?"reverse":s.easing){case"reverse":l=a-l;break;case"full":l=i.currentStaggerTime}const d=t.currentTimeline;l&&d.delayNextStep(l);const f=d.currentTime;xa(this,e.animation,t),t.previousNode=e,i.currentStaggerTime=r.currentTime-f+(r.startTime-i.currentTimeline.startTime)}}const $E={};class MO{constructor(e,t,i,r,s,o,a,l){this._driver=e,this.element=t,this.subInstructions=i,this._enterClassName=r,this._leaveClassName=s,this.errors=o,this.timelines=a,this.parentContext=null,this.currentAnimateTimings=null,this.previousNode=$E,this.subContextCount=0,this.options={},this.currentQueryIndex=0,this.currentQueryTotal=0,this.currentStaggerTime=0,this.currentTimeline=l||new GE(this._driver,t,0),a.push(this.currentTimeline)}get params(){return this.options.params}updateOptions(e,t){if(!e)return;const i=e;let r=this.options;null!=i.duration&&(r.duration=Bf(i.duration)),null!=i.delay&&(r.delay=Bf(i.delay));const s=i.params;if(s){let o=r.params;o||(o=this.options.params={}),Object.keys(s).forEach(a=>{(!t||!o.hasOwnProperty(a))&&(o[a]=LE(s[a],o,this.errors))})}}_copyOptions(){const e={};if(this.options){const t=this.options.params;if(t){const i=e.params={};Object.keys(t).forEach(r=>{i[r]=t[r]})}}return e}createSubContext(e=null,t,i){const r=t||this.element,s=new MO(this._driver,r,this.subInstructions,this._enterClassName,this._leaveClassName,this.errors,this.timelines,this.currentTimeline.fork(r,i||0));return s.previousNode=this.previousNode,s.currentAnimateTimings=this.currentAnimateTimings,s.options=this._copyOptions(),s.updateOptions(e),s.currentQueryIndex=this.currentQueryIndex,s.currentQueryTotal=this.currentQueryTotal,s.parentContext=this,this.subContextCount++,s}transformIntoNewTimeline(e){return this.previousNode=$E,this.currentTimeline=this.currentTimeline.fork(this.element,e),this.timelines.push(this.currentTimeline),this.currentTimeline}appendInstructionToTimeline(e,t,i){const r={duration:null!=t?t:e.duration,delay:this.currentTimeline.currentTime+(null!=i?i:0)+e.delay,easing:""},s=new fre(this._driver,e.element,e.keyframes,e.preStyleProps,e.postStyleProps,r,e.stretchStartingKeyframe);return this.timelines.push(s),r}incrementTime(e){this.currentTimeline.forwardTime(this.currentTimeline.duration+e)}delayNextStep(e){e>0&&this.currentTimeline.delayNextStep(e)}invokeQuery(e,t,i,r,s,o){let a=[];if(r&&a.push(this.element),e.length>0){e=(e=e.replace(cre,"."+this._enterClassName)).replace(dre,"."+this._leaveClassName);let c=this._driver.query(this.element,e,1!=i);0!==i&&(c=i<0?c.slice(c.length+i,c.length):c.slice(0,i)),a.push(...c)}return!s&&0==a.length&&o.push(`\`query("${t}")\` returned zero elements. (Use \`query("${t}", { optional: true })\` if you wish to allow this.)`),a}}class GE{constructor(e,t,i,r){this._driver=e,this.element=t,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(t),this._globalTimelineStyles||(this._globalTimelineStyles=this._localTimelineStyles,this._elementTimelineStylesLookup.set(t,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(e){const t=1==this._keyframes.size&&Object.keys(this._pendingStyles).length;this.duration||t?(this.forwardTime(this.currentTime+e),t&&this.snapshotCurrentStyles()):this.startTime+=e}fork(e,t){return this.applyStylesToKeyframe(),new GE(this._driver,e,t||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(e){this.applyStylesToKeyframe(),this.duration=e,this._loadKeyframe()}_updateStyle(e,t){this._localTimelineStyles[e]=t,this._globalTimelineStyles[e]=t,this._styleSummary[e]={time:this.currentTime,value:t}}allowOnlyTimelineStyles(){return this._currentEmptyStepKeyframe!==this._currentKeyframe}applyEmptyStep(e){e&&(this._previousKeyframe.easing=e),Object.keys(this._globalTimelineStyles).forEach(t=>{this._backFill[t]=this._globalTimelineStyles[t]||qu,this._currentKeyframe[t]=qu}),this._currentEmptyStepKeyframe=this._currentKeyframe}setStyles(e,t,i,r){t&&(this._previousKeyframe.easing=t);const s=r&&r.params||{},o=function(n,e){const t={};let i;return n.forEach(r=>{"*"===r?(i=i||Object.keys(e),i.forEach(s=>{t[s]=qu})):sh(r,!1,t)}),t}(e,this._globalTimelineStyles);Object.keys(o).forEach(a=>{const l=LE(o[a],s,i);this._pendingStyles[a]=l,this._localTimelineStyles.hasOwnProperty(a)||(this._backFill[a]=this._globalTimelineStyles.hasOwnProperty(a)?this._globalTimelineStyles[a]:qu),this._updateStyle(a,l)})}applyStylesToKeyframe(){const e=this._pendingStyles,t=Object.keys(e);0!=t.length&&(this._pendingStyles={},t.forEach(i=>{this._currentKeyframe[i]=e[i]}),Object.keys(this._localTimelineStyles).forEach(i=>{this._currentKeyframe.hasOwnProperty(i)||(this._currentKeyframe[i]=this._localTimelineStyles[i])}))}snapshotCurrentStyles(){Object.keys(this._localTimelineStyles).forEach(e=>{const t=this._localTimelineStyles[e];this._pendingStyles[e]=t,this._updateStyle(e,t)})}getFinalKeyframe(){return this._keyframes.get(this.duration)}get properties(){const e=[];for(let t in this._currentKeyframe)e.push(t);return e}mergeTimelineCollectedStyles(e){Object.keys(e._styleSummary).forEach(t=>{const i=this._styleSummary[t],r=e._styleSummary[t];(!i||r.time>i.time)&&this._updateStyle(t,r.value)})}buildKeyframes(){this.applyStylesToKeyframe();const e=new Set,t=new Set,i=1===this._keyframes.size&&0===this.duration;let r=[];this._keyframes.forEach((a,l)=>{const c=sh(a,!0);Object.keys(c).forEach(d=>{const f=c[d];"!"==f?e.add(d):f==qu&&t.add(d)}),i||(c.offset=l/this.duration),r.push(c)});const s=e.size?BE(e.values()):[],o=t.size?BE(t.values()):[];if(i){const a=r[0],l=rm(a);a.offset=0,l.offset=1,r=[a,l]}return EO(this.element,r,s,o,this.duration,this.startTime,this.easing,!1)}}class fre extends GE{constructor(e,t,i,r,s,o,a=!1){super(e,t,o.delay),this.keyframes=i,this.preStyleProps=r,this.postStyleProps=s,this._stretchStartingKeyframe=a,this.timings={duration:o.duration,delay:o.delay,easing:o.easing}}containsAnimation(){return this.keyframes.length>1}buildKeyframes(){let e=this.keyframes,{delay:t,duration:i,easing:r}=this.timings;if(this._stretchStartingKeyframe&&t){const s=[],o=i+t,a=t/o,l=sh(e[0],!1);l.offset=0,s.push(l);const c=sh(e[0],!1);c.offset=Cz(a),s.push(c);const d=e.length-1;for(let f=1;f<=d;f++){let p=sh(e[f],!1);p.offset=Cz((t+p.offset*i)/o),s.push(p)}i=o,t=0,r="",e=s}return EO(this.element,e,this.preStyleProps,this.postStyleProps,i,t,r,!0)}}function Cz(n,e=3){const t=Math.pow(10,e-1);return Math.round(n*t)/t}class xO{}class gre extends xO{normalizePropertyName(e,t){return vO(e)}normalizeStyleValue(e,t,i,r){let s="";const o=i.toString().trim();if(mre[t]&&0!==i&&"0"!==i)if("number"==typeof i)s="px";else{const a=i.match(/^[+-]?[\d\.]+([a-z]*)$/);a&&0==a[1].length&&r.push(`Please provide a CSS unit value for ${e}:${i}`)}return o+s}}const mre=(()=>function(n){const e={};return n.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 wz(n,e,t,i,r,s,o,a,l,c,d,f,p){return{type:0,element:n,triggerName:e,isRemovalTransition:r,fromState:t,fromStyles:s,toState:i,toStyles:o,timelines:a,queriedElements:l,preStyleProps:c,postStyleProps:d,totalTime:f,errors:p}}const TO={};class Ez{constructor(e,t,i){this._triggerName=e,this.ast=t,this._stateStyles=i}match(e,t,i,r){return function(n,e,t,i,r){return n.some(s=>s(e,t,i,r))}(this.ast.matchers,e,t,i,r)}buildStyles(e,t,i){const r=this._stateStyles["*"],s=this._stateStyles[e],o=r?r.buildStyles(t,i):{};return s?s.buildStyles(t,i):o}build(e,t,i,r,s,o,a,l,c,d){const f=[],p=this.ast.options&&this.ast.options.params||TO,_=this.buildStyles(i,a&&a.params||TO,f),y=l&&l.params||TO,v=this.buildStyles(r,y,f),C=new Set,w=new Map,x=new Map,N="void"===r,V={params:Object.assign(Object.assign({},p),y)},U=d?[]:SO(e,t,this.ast.animation,s,o,_,v,V,c,f);let ee=0;if(U.forEach(ae=>{ee=Math.max(ae.duration+ae.delay,ee)}),f.length)return wz(t,this._triggerName,i,r,N,_,v,[],[],w,x,ee,f);U.forEach(ae=>{const me=ae.element,Ee=Ma(w,me,{});ae.preStyleProps.forEach(te=>Ee[te]=!0);const Be=Ma(x,me,{});ae.postStyleProps.forEach(te=>Be[te]=!0),me!==t&&C.add(me)});const de=BE(C.values());return wz(t,this._triggerName,i,r,N,_,v,U,de,w,x,ee)}}class vre{constructor(e,t,i){this.styles=e,this.defaultParams=t,this.normalizer=i}buildStyles(e,t){const i={},r=rm(this.defaultParams);return Object.keys(e).forEach(s=>{const o=e[s];null!=o&&(r[s]=o)}),this.styles.styles.forEach(s=>{if("string"!=typeof s){const o=s;Object.keys(o).forEach(a=>{let l=o[a];l.length>1&&(l=LE(l,r,t));const c=this.normalizer.normalizePropertyName(a,t);l=this.normalizer.normalizeStyleValue(a,c,l,t),i[c]=l})}}),i}}class Cre{constructor(e,t,i){this.name=e,this.ast=t,this._normalizer=i,this.transitionFactories=[],this.states={},t.states.forEach(r=>{this.states[r.name]=new vre(r.style,r.options&&r.options.params||{},i)}),Sz(this.states,"true","1"),Sz(this.states,"false","0"),t.transitions.forEach(r=>{this.transitionFactories.push(new Ez(e,r,this.states))}),this.fallbackTransition=function(n,e,t){return new Ez(n,{type:1,animation:{type:2,steps:[],options:null},matchers:[(o,a)=>!0],options:null,queryCount:0,depCount:0},e)}(e,this.states)}get containsQueries(){return this.ast.queryCount>0}matchTransition(e,t,i,r){return this.transitionFactories.find(o=>o.match(e,t,i,r))||null}matchStyles(e,t,i){return this.fallbackTransition.buildStyles(e,t,i)}}function Sz(n,e,t){n.hasOwnProperty(e)?n.hasOwnProperty(t)||(n[t]=n[e]):n.hasOwnProperty(t)&&(n[e]=n[t])}const Ere=new HE;class Sre{constructor(e,t,i){this.bodyNode=e,this._driver=t,this._normalizer=i,this._animations={},this._playersById={},this.players=[]}register(e,t){const i=[],r=CO(this._driver,t,i);if(i.length)throw new Error(`Unable to build the animation due to the following errors: ${i.join("\n")}`);this._animations[e]=r}_buildPlayer(e,t,i){const r=e.element,s=iz(0,this._normalizer,0,e.keyframes,t,i);return this._driver.animate(r,s,e.duration,e.delay,e.easing,[],!0)}create(e,t,i={}){const r=[],s=this._animations[e];let o;const a=new Map;if(s?(o=SO(this._driver,t,s,gO,RE,{},{},i,Ere,r),o.forEach(d=>{const f=Ma(a,d.element,{});d.postStyleProps.forEach(p=>f[p]=null)})):(r.push("The requested animation doesn't exist or has already been destroyed"),o=[]),r.length)throw new Error(`Unable to create the animation due to the following errors: ${r.join("\n")}`);a.forEach((d,f)=>{Object.keys(d).forEach(p=>{d[p]=this._driver.computeStyle(f,p,qu)})});const c=rh(o.map(d=>{const f=a.get(d.element);return this._buildPlayer(d,{},f)}));return this._playersById[e]=c,c.onDestroy(()=>this.destroy(e)),this.players.push(c),c}destroy(e){const t=this._getPlayer(e);t.destroy(),delete this._playersById[e];const i=this.players.indexOf(t);i>=0&&this.players.splice(i,1)}_getPlayer(e){const t=this._playersById[e];if(!t)throw new Error(`Unable to find the timeline player referenced by ${e}`);return t}listen(e,t,i,r){const s=lO(t,"","","");return oO(this._getPlayer(e),i,s,r),()=>{}}command(e,t,i,r){if("register"==i)return void this.register(e,r[0]);if("create"==i)return void this.create(e,t,r[0]||{});const s=this._getPlayer(e);switch(i){case"play":s.play();break;case"pause":s.pause();break;case"reset":s.reset();break;case"restart":s.restart();break;case"finish":s.finish();break;case"init":s.init();break;case"setPosition":s.setPosition(parseFloat(r[0]));break;case"destroy":this.destroy(e)}}}const Mz="ng-animate-queued",xz="ng-animate-disabled",Tz=".ng-animate-disabled",Are=[],Az={namespaceId:"",setForRemoval:!1,setForMove:!1,hasAnimation:!1,removedBeforeQueried:!1},Dre={namespaceId:"",setForMove:!1,setForRemoval:!1,hasAnimation:!1,removedBeforeQueried:!0},gl="__ng_removed";class AO{constructor(e,t=""){this.namespaceId=t;const i=e&&e.hasOwnProperty("value");if(this.value=function(n){return null!=n?n:null}(i?e.value:e),i){const s=rm(e);delete s.value,this.options=s}else this.options={};this.options.params||(this.options.params={})}get params(){return this.options.params}absorbOptions(e){const t=e.params;if(t){const i=this.options.params;Object.keys(t).forEach(r=>{null==i[r]&&(i[r]=t[r])})}}}const Bv="void",DO=new AO(Bv);class Ore{constructor(e,t,i){this.id=e,this.hostElement=t,this._engine=i,this.players=[],this._triggers={},this._queue=[],this._elementListeners=new Map,this._hostClassName="ng-tns-"+e,ml(t,this._hostClassName)}listen(e,t,i,r){if(!this._triggers.hasOwnProperty(t))throw new Error(`Unable to listen on the animation trigger event "${i}" because the animation trigger "${t}" doesn't exist!`);if(null==i||0==i.length)throw new Error(`Unable to listen on the animation trigger "${t}" because the provided event is undefined!`);if(!function(n){return"start"==n||"done"==n}(i))throw new Error(`The provided animation trigger event "${i}" for the animation trigger "${t}" is not supported!`);const s=Ma(this._elementListeners,e,[]),o={name:t,phase:i,callback:r};s.push(o);const a=Ma(this._engine.statesByElement,e,{});return a.hasOwnProperty(t)||(ml(e,kE),ml(e,kE+"-"+t),a[t]=DO),()=>{this._engine.afterFlush(()=>{const l=s.indexOf(o);l>=0&&s.splice(l,1),this._triggers[t]||delete a[t]})}}register(e,t){return!this._triggers[e]&&(this._triggers[e]=t,!0)}_getTrigger(e){const t=this._triggers[e];if(!t)throw new Error(`The provided animation trigger "${e}" has not been registered!`);return t}trigger(e,t,i,r=!0){const s=this._getTrigger(t),o=new OO(this.id,t,e);let a=this._engine.statesByElement.get(e);a||(ml(e,kE),ml(e,kE+"-"+t),this._engine.statesByElement.set(e,a={}));let l=a[t];const c=new AO(i,this.id);if(!(i&&i.hasOwnProperty("value"))&&l&&c.absorbOptions(l.options),a[t]=c,l||(l=DO),c.value!==Bv&&l.value===c.value){if(!function(n,e){const t=Object.keys(n),i=Object.keys(e);if(t.length!=i.length)return!1;for(let r=0;r{Vf(e,v),Gc(e,C)})}return}const p=Ma(this._engine.playersByElement,e,[]);p.forEach(y=>{y.namespaceId==this.id&&y.triggerName==t&&y.queued&&y.destroy()});let g=s.matchTransition(l.value,c.value,e,c.params),_=!1;if(!g){if(!r)return;g=s.fallbackTransition,_=!0}return this._engine.totalQueuedPlayers++,this._queue.push({element:e,triggerName:t,transition:g,fromState:l,toState:c,player:o,isFallbackTransition:_}),_||(ml(e,Mz),o.onStart(()=>{sm(e,Mz)})),o.onDone(()=>{let y=this.players.indexOf(o);y>=0&&this.players.splice(y,1);const v=this._engine.playersByElement.get(e);if(v){let C=v.indexOf(o);C>=0&&v.splice(C,1)}}),this.players.push(o),p.push(o),o}deregister(e){delete this._triggers[e],this._engine.statesByElement.forEach((t,i)=>{delete t[e]}),this._elementListeners.forEach((t,i)=>{this._elementListeners.set(i,t.filter(r=>r.name!=e))})}clearElementCache(e){this._engine.statesByElement.delete(e),this._elementListeners.delete(e);const t=this._engine.playersByElement.get(e);t&&(t.forEach(i=>i.destroy()),this._engine.playersByElement.delete(e))}_signalRemovalForInnerTriggers(e,t){const i=this._engine.driver.query(e,FE,!0);i.forEach(r=>{if(r[gl])return;const s=this._engine.fetchNamespacesByElement(r);s.size?s.forEach(o=>o.triggerLeaveAnimation(r,t,!1,!0)):this.clearElementCache(r)}),this._engine.afterFlushAnimationsDone(()=>i.forEach(r=>this.clearElementCache(r)))}triggerLeaveAnimation(e,t,i,r){const s=this._engine.statesByElement.get(e);if(s){const o=[];if(Object.keys(s).forEach(a=>{if(this._triggers[a]){const l=this.trigger(e,a,Bv,r);l&&o.push(l)}}),o.length)return this._engine.markElementAsRemoved(this.id,e,!0,t),i&&rh(o).onDone(()=>this._engine.processLeaveNode(e)),!0}return!1}prepareLeaveAnimationListeners(e){const t=this._elementListeners.get(e),i=this._engine.statesByElement.get(e);if(t&&i){const r=new Set;t.forEach(s=>{const o=s.name;if(r.has(o))return;r.add(o);const l=this._triggers[o].fallbackTransition,c=i[o]||DO,d=new AO(Bv),f=new OO(this.id,o,e);this._engine.totalQueuedPlayers++,this._queue.push({element:e,triggerName:o,transition:l,fromState:c,toState:d,player:f,isFallbackTransition:!0})})}}removeNode(e,t){const i=this._engine;if(e.childElementCount&&this._signalRemovalForInnerTriggers(e,t),this.triggerLeaveAnimation(e,t,!0))return;let r=!1;if(i.totalAnimations){const s=i.players.length?i.playersByQueriedElement.get(e):[];if(s&&s.length)r=!0;else{let o=e;for(;o=o.parentNode;)if(i.statesByElement.get(o)){r=!0;break}}}if(this.prepareLeaveAnimationListeners(e),r)i.markElementAsRemoved(this.id,e,!1,t);else{const s=e[gl];(!s||s===Az)&&(i.afterFlush(()=>this.clearElementCache(e)),i.destroyInnerAnimations(e),i._onRemovalComplete(e,t))}}insertNode(e,t){ml(e,this._hostClassName)}drainQueuedTransitions(e){const t=[];return this._queue.forEach(i=>{const r=i.player;if(r.destroyed)return;const s=i.element,o=this._elementListeners.get(s);o&&o.forEach(a=>{if(a.name==i.triggerName){const l=lO(s,i.triggerName,i.fromState.value,i.toState.value);l._data=e,oO(i.player,a.phase,l,a.callback)}}),r.markedForDestroy?this._engine.afterFlush(()=>{r.destroy()}):t.push(i)}),this._queue=[],t.sort((i,r)=>{const s=i.transition.ast.depCount,o=r.transition.ast.depCount;return 0==s||0==o?s-o:this._engine.driver.containsElement(i.element,r.element)?1:-1})}destroy(e){this.players.forEach(t=>t.destroy()),this._signalRemovalForInnerTriggers(this.hostElement,e)}elementContainsData(e){let t=!1;return this._elementListeners.has(e)&&(t=!0),t=!!this._queue.find(i=>i.element===e)||t,t}}class Ire{constructor(e,t,i){this.bodyNode=e,this.driver=t,this._normalizer=i,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=(r,s)=>{}}_onRemovalComplete(e,t){this.onRemovalComplete(e,t)}get queuedPlayers(){const e=[];return this._namespaceList.forEach(t=>{t.players.forEach(i=>{i.queued&&e.push(i)})}),e}createNamespace(e,t){const i=new Ore(e,t,this);return this.bodyNode&&this.driver.containsElement(this.bodyNode,t)?this._balanceNamespaceList(i,t):(this.newHostElements.set(t,i),this.collectEnterElement(t)),this._namespaceLookup[e]=i}_balanceNamespaceList(e,t){const i=this._namespaceList.length-1;if(i>=0){let r=!1;for(let s=i;s>=0;s--)if(this.driver.containsElement(this._namespaceList[s].hostElement,t)){this._namespaceList.splice(s+1,0,e),r=!0;break}r||this._namespaceList.splice(0,0,e)}else this._namespaceList.push(e);return this.namespacesByHostElement.set(t,e),e}register(e,t){let i=this._namespaceLookup[e];return i||(i=this.createNamespace(e,t)),i}registerTrigger(e,t,i){let r=this._namespaceLookup[e];r&&r.register(t,i)&&this.totalAnimations++}destroy(e,t){if(!e)return;const i=this._fetchNamespace(e);this.afterFlush(()=>{this.namespacesByHostElement.delete(i.hostElement),delete this._namespaceLookup[e];const r=this._namespaceList.indexOf(i);r>=0&&this._namespaceList.splice(r,1)}),this.afterFlushAnimationsDone(()=>i.destroy(t))}_fetchNamespace(e){return this._namespaceLookup[e]}fetchNamespacesByElement(e){const t=new Set,i=this.statesByElement.get(e);if(i){const r=Object.keys(i);for(let s=0;s=0&&this.collectedLeaveElements.splice(o,1)}if(e){const o=this._fetchNamespace(e);o&&o.insertNode(t,i)}r&&this.collectEnterElement(t)}collectEnterElement(e){this.collectedEnterElements.push(e)}markElementAsDisabled(e,t){t?this.disabledNodes.has(e)||(this.disabledNodes.add(e),ml(e,xz)):this.disabledNodes.has(e)&&(this.disabledNodes.delete(e),sm(e,xz))}removeNode(e,t,i,r){if(WE(t)){const s=e?this._fetchNamespace(e):null;if(s?s.removeNode(t,r):this.markElementAsRemoved(e,t,!1,r),i){const o=this.namespacesByHostElement.get(t);o&&o.id!==e&&o.removeNode(t,r)}}else this._onRemovalComplete(t,r)}markElementAsRemoved(e,t,i,r){this.collectedLeaveElements.push(t),t[gl]={namespaceId:e,setForRemoval:r,hasAnimation:i,removedBeforeQueried:!1}}listen(e,t,i,r,s){return WE(t)?this._fetchNamespace(e).listen(t,i,r,s):()=>{}}_buildInstruction(e,t,i,r,s){return e.transition.build(this.driver,e.element,e.fromState.value,e.toState.value,i,r,e.fromState.options,e.toState.options,t,s)}destroyInnerAnimations(e){let t=this.driver.query(e,FE,!0);t.forEach(i=>this.destroyActiveAnimationsForElement(i)),0!=this.playersByQueriedElement.size&&(t=this.driver.query(e,mO,!0),t.forEach(i=>this.finishActiveQueriedAnimationOnElement(i)))}destroyActiveAnimationsForElement(e){const t=this.playersByElement.get(e);t&&t.forEach(i=>{i.queued?i.markedForDestroy=!0:i.destroy()})}finishActiveQueriedAnimationOnElement(e){const t=this.playersByQueriedElement.get(e);t&&t.forEach(i=>i.finish())}whenRenderingDone(){return new Promise(e=>{if(this.players.length)return rh(this.players).onDone(()=>e());e()})}processLeaveNode(e){const t=e[gl];if(t&&t.setForRemoval){if(e[gl]=Az,t.namespaceId){this.destroyInnerAnimations(e);const i=this._fetchNamespace(t.namespaceId);i&&i.clearElementCache(e)}this._onRemovalComplete(e,t.setForRemoval)}this.driver.matchesElement(e,Tz)&&this.markElementAsDisabled(e,!1),this.driver.query(e,Tz,!0).forEach(i=>{this.markElementAsDisabled(i,!1)})}flush(e=-1){let t=[];if(this.newHostElements.size&&(this.newHostElements.forEach((i,r)=>this._balanceNamespaceList(i,r)),this.newHostElements.clear()),this.totalAnimations&&this.collectedEnterElements.length)for(let i=0;ii()),this._flushFns=[],this._whenQuietFns.length){const i=this._whenQuietFns;this._whenQuietFns=[],t.length?rh(t).onDone(()=>{i.forEach(r=>r())}):i.forEach(r=>r())}}reportError(e){throw new Error(`Unable to process animations due to the following failed trigger transitions\n ${e.join("\n")}`)}_flushAnimations(e,t){const i=new HE,r=[],s=new Map,o=[],a=new Map,l=new Map,c=new Map,d=new Set;this.disabledNodes.forEach(Q=>{d.add(Q);const je=this.driver.query(Q,".ng-animate-queued",!0);for(let $e=0;$e{const $e=gO+y++;_.set(je,$e),Q.forEach(qe=>ml(qe,$e))});const v=[],C=new Set,w=new Set;for(let Q=0;QC.add(qe)):w.add(je))}const x=new Map,N=Iz(p,Array.from(C));N.forEach((Q,je)=>{const $e=RE+y++;x.set(je,$e),Q.forEach(qe=>ml(qe,$e))}),e.push(()=>{g.forEach((Q,je)=>{const $e=_.get(je);Q.forEach(qe=>sm(qe,$e))}),N.forEach((Q,je)=>{const $e=x.get(je);Q.forEach(qe=>sm(qe,$e))}),v.forEach(Q=>{this.processLeaveNode(Q)})});const V=[],U=[];for(let Q=this._namespaceList.length-1;Q>=0;Q--)this._namespaceList[Q].drainQueuedTransitions(t).forEach($e=>{const qe=$e.player,Ot=$e.element;if(V.push(qe),this.collectedEnterElements.length){const gi=Ot[gl];if(gi&&gi.setForMove)return void qe.destroy()}const Hn=!f||!this.driver.containsElement(f,Ot),ot=x.get(Ot),nr=_.get(Ot),Ln=this._buildInstruction($e,i,nr,ot,Hn);if(Ln.errors&&Ln.errors.length)U.push(Ln);else{if(Hn)return qe.onStart(()=>Vf(Ot,Ln.fromStyles)),qe.onDestroy(()=>Gc(Ot,Ln.toStyles)),void r.push(qe);if($e.isFallbackTransition)return qe.onStart(()=>Vf(Ot,Ln.fromStyles)),qe.onDestroy(()=>Gc(Ot,Ln.toStyles)),void r.push(qe);Ln.timelines.forEach(gi=>gi.stretchStartingKeyframe=!0),i.append(Ot,Ln.timelines),o.push({instruction:Ln,player:qe,element:Ot}),Ln.queriedElements.forEach(gi=>Ma(a,gi,[]).push(qe)),Ln.preStyleProps.forEach((gi,_r)=>{const oa=Object.keys(gi);if(oa.length){let Bs=l.get(_r);Bs||l.set(_r,Bs=new Set),oa.forEach(Na=>Bs.add(Na))}}),Ln.postStyleProps.forEach((gi,_r)=>{const oa=Object.keys(gi);let Bs=c.get(_r);Bs||c.set(_r,Bs=new Set),oa.forEach(Na=>Bs.add(Na))})}});if(U.length){const Q=[];U.forEach(je=>{Q.push(`@${je.triggerName} has failed due to:\n`),je.errors.forEach($e=>Q.push(`- ${$e}\n`))}),V.forEach(je=>je.destroy()),this.reportError(Q)}const ee=new Map,de=new Map;o.forEach(Q=>{const je=Q.element;i.has(je)&&(de.set(je,je),this._beforeAnimationBuild(Q.player.namespaceId,Q.instruction,ee))}),r.forEach(Q=>{const je=Q.element;this._getPreviousPlayers(je,!1,Q.namespaceId,Q.triggerName,null).forEach(qe=>{Ma(ee,je,[]).push(qe),qe.destroy()})});const ae=v.filter(Q=>Rz(Q,l,c)),me=new Map;Oz(me,this.driver,w,c,qu).forEach(Q=>{Rz(Q,l,c)&&ae.push(Q)});const Be=new Map;g.forEach((Q,je)=>{Oz(Be,this.driver,new Set(Q),l,"!")}),ae.forEach(Q=>{const je=me.get(Q),$e=Be.get(Q);me.set(Q,Object.assign(Object.assign({},je),$e))});const te=[],ne=[],Ie={};o.forEach(Q=>{const{element:je,player:$e,instruction:qe}=Q;if(i.has(je)){if(d.has(je))return $e.onDestroy(()=>Gc(je,qe.toStyles)),$e.disabled=!0,$e.overrideTotalTime(qe.totalTime),void r.push($e);let Ot=Ie;if(de.size>1){let ot=je;const nr=[];for(;ot=ot.parentNode;){const Ln=de.get(ot);if(Ln){Ot=Ln;break}nr.push(ot)}nr.forEach(Ln=>de.set(Ln,Ot))}const Hn=this._buildAnimation($e.namespaceId,qe,ee,s,Be,me);if($e.setRealPlayer(Hn),Ot===Ie)te.push($e);else{const ot=this.playersByElement.get(Ot);ot&&ot.length&&($e.parentPlayer=rh(ot)),r.push($e)}}else Vf(je,qe.fromStyles),$e.onDestroy(()=>Gc(je,qe.toStyles)),ne.push($e),d.has(je)&&r.push($e)}),ne.forEach(Q=>{const je=s.get(Q.element);if(je&&je.length){const $e=rh(je);Q.setRealPlayer($e)}}),r.forEach(Q=>{Q.parentPlayer?Q.syncPlayerEvents(Q.parentPlayer):Q.destroy()});for(let Q=0;Q!Hn.destroyed);Ot.length?Fre(this,je,Ot):this.processLeaveNode(je)}return v.length=0,te.forEach(Q=>{this.players.push(Q),Q.onDone(()=>{Q.destroy();const je=this.players.indexOf(Q);this.players.splice(je,1)}),Q.play()}),te}elementContainsData(e,t){let i=!1;const r=t[gl];return r&&r.setForRemoval&&(i=!0),this.playersByElement.has(t)&&(i=!0),this.playersByQueriedElement.has(t)&&(i=!0),this.statesByElement.has(t)&&(i=!0),this._fetchNamespace(e).elementContainsData(t)||i}afterFlush(e){this._flushFns.push(e)}afterFlushAnimationsDone(e){this._whenQuietFns.push(e)}_getPreviousPlayers(e,t,i,r,s){let o=[];if(t){const a=this.playersByQueriedElement.get(e);a&&(o=a)}else{const a=this.playersByElement.get(e);if(a){const l=!s||s==Bv;a.forEach(c=>{c.queued||!l&&c.triggerName!=r||o.push(c)})}}return(i||r)&&(o=o.filter(a=>!(i&&i!=a.namespaceId||r&&r!=a.triggerName))),o}_beforeAnimationBuild(e,t,i){const s=t.element,o=t.isRemovalTransition?void 0:e,a=t.isRemovalTransition?void 0:t.triggerName;for(const l of t.timelines){const c=l.element,d=c!==s,f=Ma(i,c,[]);this._getPreviousPlayers(c,d,o,a,t.toState).forEach(g=>{const _=g.getRealPlayer();_.beforeDestroy&&_.beforeDestroy(),g.destroy(),f.push(g)})}Vf(s,t.fromStyles)}_buildAnimation(e,t,i,r,s,o){const a=t.triggerName,l=t.element,c=[],d=new Set,f=new Set,p=t.timelines.map(_=>{const y=_.element;d.add(y);const v=y[gl];if(v&&v.removedBeforeQueried)return new im(_.duration,_.delay);const C=y!==l,w=function(n){const e=[];return Pz(n,e),e}((i.get(y)||Are).map(ee=>ee.getRealPlayer())).filter(ee=>!!ee.element&&ee.element===y),x=s.get(y),N=o.get(y),V=iz(0,this._normalizer,0,_.keyframes,x,N),U=this._buildPlayer(_,V,w);if(_.subTimeline&&r&&f.add(y),C){const ee=new OO(e,a,y);ee.setRealPlayer(U),c.push(ee)}return U});c.forEach(_=>{Ma(this.playersByQueriedElement,_.element,[]).push(_),_.onDone(()=>function(n,e,t){let i;if(n instanceof Map){if(i=n.get(e),i){if(i.length){const r=i.indexOf(t);i.splice(r,1)}0==i.length&&n.delete(e)}}else if(i=n[e],i){if(i.length){const r=i.indexOf(t);i.splice(r,1)}0==i.length&&delete n[e]}return i}(this.playersByQueriedElement,_.element,_))}),d.forEach(_=>ml(_,dz));const g=rh(p);return g.onDestroy(()=>{d.forEach(_=>sm(_,dz)),Gc(l,t.toStyles)}),f.forEach(_=>{Ma(r,_,[]).push(g)}),g}_buildPlayer(e,t,i){return t.length>0?this.driver.animate(e.element,t,e.duration,e.delay,e.easing,i):new im(e.duration,e.delay)}}class OO{constructor(e,t,i){this.namespaceId=e,this.triggerName=t,this.element=i,this._player=new im,this._containsRealPlayer=!1,this._queuedCallbacks={},this.destroyed=!1,this.markedForDestroy=!1,this.disabled=!1,this.queued=!0,this.totalTime=0}setRealPlayer(e){this._containsRealPlayer||(this._player=e,Object.keys(this._queuedCallbacks).forEach(t=>{this._queuedCallbacks[t].forEach(i=>oO(e,t,void 0,i))}),this._queuedCallbacks={},this._containsRealPlayer=!0,this.overrideTotalTime(e.totalTime),this.queued=!1)}getRealPlayer(){return this._player}overrideTotalTime(e){this.totalTime=e}syncPlayerEvents(e){const t=this._player;t.triggerCallback&&e.onStart(()=>t.triggerCallback("start")),e.onDone(()=>this.finish()),e.onDestroy(()=>this.destroy())}_queueEvent(e,t){Ma(this._queuedCallbacks,e,[]).push(t)}onDone(e){this.queued&&this._queueEvent("done",e),this._player.onDone(e)}onStart(e){this.queued&&this._queueEvent("start",e),this._player.onStart(e)}onDestroy(e){this.queued&&this._queueEvent("destroy",e),this._player.onDestroy(e)}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(e){this.queued||this._player.setPosition(e)}getPosition(){return this.queued?0:this._player.getPosition()}triggerCallback(e){const t=this._player;t.triggerCallback&&t.triggerCallback(e)}}function WE(n){return n&&1===n.nodeType}function Dz(n,e){const t=n.style.display;return n.style.display=null!=e?e:"none",t}function Oz(n,e,t,i,r){const s=[];t.forEach(l=>s.push(Dz(l)));const o=[];i.forEach((l,c)=>{const d={};l.forEach(f=>{const p=d[f]=e.computeStyle(c,f,r);(!p||0==p.length)&&(c[gl]=Dre,o.push(c))}),n.set(c,d)});let a=0;return t.forEach(l=>Dz(l,s[a++])),o}function Iz(n,e){const t=new Map;if(n.forEach(a=>t.set(a,[])),0==e.length)return t;const r=new Set(e),s=new Map;function o(a){if(!a)return 1;let l=s.get(a);if(l)return l;const c=a.parentNode;return l=t.has(c)?c:r.has(c)?1:o(c),s.set(a,l),l}return e.forEach(a=>{const l=o(a);1!==l&&t.get(l).push(a)}),t}const qE="$$classes";function ml(n,e){if(n.classList)n.classList.add(e);else{let t=n[qE];t||(t=n[qE]={}),t[e]=!0}}function sm(n,e){if(n.classList)n.classList.remove(e);else{let t=n[qE];t&&delete t[e]}}function Fre(n,e,t){rh(t).onDone(()=>n.processLeaveNode(e))}function Pz(n,e){for(let t=0;tr.add(s)):e.set(n,i),t.delete(n),!0}class YE{constructor(e,t,i){this.bodyNode=e,this._driver=t,this._normalizer=i,this._triggerCache={},this.onRemovalComplete=(r,s)=>{},this._transitionEngine=new Ire(e,t,i),this._timelineEngine=new Sre(e,t,i),this._transitionEngine.onRemovalComplete=(r,s)=>this.onRemovalComplete(r,s)}registerTrigger(e,t,i,r,s){const o=e+"-"+r;let a=this._triggerCache[o];if(!a){const l=[],c=CO(this._driver,s,l);if(l.length)throw new Error(`The animation trigger "${r}" has failed to build due to the following errors:\n - ${l.join("\n - ")}`);a=function(n,e,t){return new Cre(n,e,t)}(r,c,this._normalizer),this._triggerCache[o]=a}this._transitionEngine.registerTrigger(t,r,a)}register(e,t){this._transitionEngine.register(e,t)}destroy(e,t){this._transitionEngine.destroy(e,t)}onInsert(e,t,i,r){this._transitionEngine.insertNode(e,t,i,r)}onRemove(e,t,i,r){this._transitionEngine.removeNode(e,t,r||!1,i)}disableAnimations(e,t){this._transitionEngine.markElementAsDisabled(e,t)}process(e,t,i,r){if("@"==i.charAt(0)){const[s,o]=rz(i);this._timelineEngine.command(s,t,o,r)}else this._transitionEngine.trigger(e,t,i,r)}listen(e,t,i,r,s){if("@"==i.charAt(0)){const[o,a]=rz(i);return this._timelineEngine.listen(o,t,a,s)}return this._transitionEngine.listen(e,t,i,r,s)}flush(e=-1){this._transitionEngine.flush(e)}get players(){return this._transitionEngine.players.concat(this._timelineEngine.players)}whenRenderingDone(){return this._transitionEngine.whenRenderingDone()}}function kz(n,e){let t=null,i=null;return Array.isArray(e)&&e.length?(t=IO(e[0]),e.length>1&&(i=IO(e[e.length-1]))):e&&(t=IO(e)),t||i?new om(n,t,i):null}class om{constructor(e,t,i){this._element=e,this._startStyles=t,this._endStyles=i,this._state=0;let r=om.initialStylesByElement.get(e);r||om.initialStylesByElement.set(e,r={}),this._initialStyles=r}start(){this._state<1&&(this._startStyles&&Gc(this._element,this._startStyles,this._initialStyles),this._state=1)}finish(){this.start(),this._state<2&&(Gc(this._element,this._initialStyles),this._endStyles&&(Gc(this._element,this._endStyles),this._endStyles=null),this._state=1)}destroy(){this.finish(),this._state<3&&(om.initialStylesByElement.delete(this._element),this._startStyles&&(Vf(this._element,this._startStyles),this._endStyles=null),this._endStyles&&(Vf(this._element,this._endStyles),this._endStyles=null),Gc(this._element,this._initialStyles),this._state=3)}}function IO(n){let e=null;const t=Object.keys(n);for(let i=0;ithis._handleCallback(l)}apply(){(function(n,e){const t=RO(n,"").trim();let i=0;t.length&&(function(n,e){let t=0;for(let i=0;i=this._delay&&i>=this._duration&&this.finish()}finish(){this._finished||(this._finished=!0,this._onDoneFn(),Vz(this._element,this._eventFn,!0))}destroy(){this._destroyed||(this._destroyed=!0,this.finish(),function(n,e){const i=RO(n,"").split(","),r=PO(i,e);r>=0&&(i.splice(r,1),XE(n,"",i.join(",")))}(this._element,this._name))}}function Lz(n,e,t){XE(n,"PlayState",t,Bz(n,e))}function Bz(n,e){const t=RO(n,"");return t.indexOf(",")>0?PO(t.split(","),e):PO([t],e)}function PO(n,e){for(let t=0;t=0)return t;return-1}function Vz(n,e,t){t?n.removeEventListener(Nz,e):n.addEventListener(Nz,e)}function XE(n,e,t,i){const r=Fz+e;if(null!=i){const s=n.style[r];if(s.length){const o=s.split(",");o[i]=t,t=o.join(",")}}n.style[r]=t}function RO(n,e){return n.style[Fz+e]||""}class zz{constructor(e,t,i,r,s,o,a,l){this.element=e,this.keyframes=t,this.animationName=i,this._duration=r,this._delay=s,this._finalStyles=a,this._specialStyles=l,this._onDoneFns=[],this._onStartFns=[],this._onDestroyFns=[],this.currentSnapshot={},this._state=0,this.easing=o||"linear",this.totalTime=r+s,this._buildStyler()}onStart(e){this._onStartFns.push(e)}onDone(e){this._onDoneFns.push(e)}onDestroy(e){this._onDestroyFns.push(e)}destroy(){this.init(),!(this._state>=4)&&(this._state=4,this._styler.destroy(),this._flushStartFns(),this._flushDoneFns(),this._specialStyles&&this._specialStyles.destroy(),this._onDestroyFns.forEach(e=>e()),this._onDestroyFns=[])}_flushDoneFns(){this._onDoneFns.forEach(e=>e()),this._onDoneFns=[]}_flushStartFns(){this._onStartFns.forEach(e=>e()),this._onStartFns=[]}finish(){this.init(),!(this._state>=3)&&(this._state=3,this._styler.finish(),this._flushStartFns(),this._specialStyles&&this._specialStyles.finish(),this._flushDoneFns())}setPosition(e){this._styler.setPosition(e)}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 jre(this.element,this.animationName,this._duration,this._delay,this.easing,"forwards",()=>this.finish())}triggerCallback(e){const t="start"==e?this._onStartFns:this._onDoneFns;t.forEach(i=>i()),t.length=0}beforeDestroy(){this.init();const e={};if(this.hasStarted()){const t=this._state>=3;Object.keys(this._finalStyles).forEach(i=>{"offset"!=i&&(e[i]=t?this._finalStyles[i]:bO(this.element,i))})}this.currentSnapshot=e}}class qre extends im{constructor(e,t){super(),this.element=e,this._startingStyles={},this.__initialized=!1,this._styles=lz(t)}init(){this.__initialized||!this._startingStyles||(this.__initialized=!0,Object.keys(this._styles).forEach(e=>{this._startingStyles[e]=this.element.style[e]}),super.init())}play(){!this._startingStyles||(this.init(),Object.keys(this._styles).forEach(e=>this.element.style.setProperty(e,this._styles[e])),super.play())}destroy(){!this._startingStyles||(Object.keys(this._startingStyles).forEach(e=>{const t=this._startingStyles[e];t?this.element.style.setProperty(e,t):this.element.style.removeProperty(e)}),this._startingStyles=null,super.destroy())}}class Uz{constructor(){this._count=0}validateStyleProperty(e){return dO(e)}matchesElement(e,t){return hO(e,t)}containsElement(e,t){return fO(e,t)}query(e,t,i){return pO(e,t,i)}computeStyle(e,t,i){return window.getComputedStyle(e)[t]}buildKeyframeElement(e,t,i){i=i.map(a=>lz(a));let r=`@keyframes ${t} {\n`,s="";i.forEach(a=>{s=" ";const l=parseFloat(a.offset);r+=`${s}${100*l}% {\n`,s+=" ",Object.keys(a).forEach(c=>{const d=a[c];switch(c){case"offset":return;case"easing":return void(d&&(r+=`${s}animation-timing-function: ${d};\n`));default:return void(r+=`${s}${c}: ${d};\n`)}}),r+=`${s}}\n`}),r+="}\n";const o=document.createElement("style");return o.textContent=r,o}animate(e,t,i,r,s,o=[],a){const l=o.filter(v=>v instanceof zz),c={};mz(i,r)&&l.forEach(v=>{let C=v.currentSnapshot;Object.keys(C).forEach(w=>c[w]=C[w])});const d=function(n){let e={};return n&&(Array.isArray(n)?n:[n]).forEach(i=>{Object.keys(i).forEach(r=>{"offset"==r||"easing"==r||(e[r]=i[r])})}),e}(t=_z(e,t,c));if(0==i)return new qre(e,d);const f="gen_css_kf_"+this._count++,p=this.buildKeyframeElement(e,f,t);(function(n){var e;const t=null===(e=n.getRootNode)||void 0===e?void 0:e.call(n);return"undefined"!=typeof ShadowRoot&&t instanceof ShadowRoot?t:document.head})(e).appendChild(p);const _=kz(e,t),y=new zz(e,t,f,i,r,s,d,_);return y.onDestroy(()=>function(n){n.parentNode.removeChild(n)}(p)),y}}class $z{constructor(e,t,i,r){this.element=e,this.keyframes=t,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}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(e=>e()),this._onDoneFns=[])}init(){this._buildPlayer(),this._preparePlayerBeforeStart()}_buildPlayer(){if(this._initialized)return;this._initialized=!0;const e=this.keyframes;this.domPlayer=this._triggerWebAnimation(this.element,e,this.options),this._finalKeyframe=e.length?e[e.length-1]:{},this.domPlayer.addEventListener("finish",()=>this._onFinish())}_preparePlayerBeforeStart(){this._delay?this._resetDomPlayerState():this.domPlayer.pause()}_triggerWebAnimation(e,t,i){return e.animate(t,i)}onStart(e){this._onStartFns.push(e)}onDone(e){this._onDoneFns.push(e)}onDestroy(e){this._onDestroyFns.push(e)}play(){this._buildPlayer(),this.hasStarted()||(this._onStartFns.forEach(e=>e()),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(e=>e()),this._onDestroyFns=[])}setPosition(e){void 0===this.domPlayer&&this.init(),this.domPlayer.currentTime=e*this.time}getPosition(){return this.domPlayer.currentTime/this.time}get totalTime(){return this._delay+this._duration}beforeDestroy(){const e={};this.hasStarted()&&Object.keys(this._finalKeyframe).forEach(t=>{"offset"!=t&&(e[t]=this._finished?this._finalKeyframe[t]:bO(this.element,t))}),this.currentSnapshot=e}triggerCallback(e){const t="start"==e?this._onStartFns:this._onDoneFns;t.forEach(i=>i()),t.length=0}}class Qre{constructor(){this._isNativeImpl=/\{\s*\[native\s+code\]\s*\}/.test(Gz().toString()),this._cssKeyframesDriver=new Uz}validateStyleProperty(e){return dO(e)}matchesElement(e,t){return hO(e,t)}containsElement(e,t){return fO(e,t)}query(e,t,i){return pO(e,t,i)}computeStyle(e,t,i){return window.getComputedStyle(e)[t]}overrideWebAnimationsSupport(e){this._isNativeImpl=e}animate(e,t,i,r,s,o=[],a){if(!a&&!this._isNativeImpl)return this._cssKeyframesDriver.animate(e,t,i,r,s,o);const d={duration:i,delay:r,fill:0==r?"both":"forwards"};s&&(d.easing=s);const f={},p=o.filter(_=>_ instanceof $z);mz(i,r)&&p.forEach(_=>{let y=_.currentSnapshot;Object.keys(y).forEach(v=>f[v]=y[v])});const g=kz(e,t=_z(e,t=t.map(_=>sh(_,!1)),f));return new $z(e,t,d,g)}}function Gz(){return nz()&&Element.prototype.animate||{}}let ese=(()=>{class n extends QV{constructor(t,i){super(),this._nextAnimationId=0,this._renderer=t.createRenderer(i.body,{id:"0",encapsulation:Ue.None,styles:[],data:{animation:[]}})}build(t){const i=this._nextAnimationId.toString();this._nextAnimationId++;const r=Array.isArray(t)?JV(t):t;return Wz(this._renderer,null,i,"register",[r]),new tse(i,this._renderer)}}return n.\u0275fac=function(t){return new(t||n)(I(Cf),I(ut))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();class tse extends class{}{constructor(e,t){super(),this._id=e,this._renderer=t}create(e,t){return new nse(this._id,e,t||{},this._renderer)}}class nse{constructor(e,t,i,r){this.id=e,this.element=t,this._renderer=r,this.parentPlayer=null,this._started=!1,this.totalTime=0,this._command("create",i)}_listen(e,t){return this._renderer.listen(this.element,`@@${this.id}:${e}`,t)}_command(e,...t){return Wz(this._renderer,this.element,this.id,e,t)}onDone(e){this._listen("done",e)}onStart(e){this._listen("start",e)}onDestroy(e){this._listen("destroy",e)}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(e){this._command("setPosition",e)}getPosition(){var e,t;return null!==(t=null===(e=this._renderer.engine.players[+this.id])||void 0===e?void 0:e.getPosition())&&void 0!==t?t:0}}function Wz(n,e,t,i,r){return n.setProperty(e,`@@${t}:${i}`,r)}const qz="@.disabled";let ise=(()=>{class n{constructor(t,i,r){this.delegate=t,this.engine=i,this._zone=r,this._currentId=0,this._microtaskId=1,this._animationCallbacksBuffer=[],this._rendererCache=new Map,this._cdRecurDepth=0,this.promise=Promise.resolve(0),i.onRemovalComplete=(s,o)=>{o&&o.parentNode(s)&&o.removeChild(s.parentNode,s)}}createRenderer(t,i){const s=this.delegate.createRenderer(t,i);if(!(t&&i&&i.data&&i.data.animation)){let d=this._rendererCache.get(s);return d||(d=new Yz("",s,this.engine),this._rendererCache.set(s,d)),d}const o=i.id,a=i.id+"-"+this._currentId;this._currentId++,this.engine.register(a,t);const l=d=>{Array.isArray(d)?d.forEach(l):this.engine.registerTrigger(o,a,t,d.name,d)};return i.data.animation.forEach(l),new rse(this,a,s,this.engine)}begin(){this._cdRecurDepth++,this.delegate.begin&&this.delegate.begin()}_scheduleCountTask(){this.promise.then(()=>{this._microtaskId++})}scheduleListenerCallback(t,i,r){t>=0&&ti(r)):(0==this._animationCallbacksBuffer.length&&Promise.resolve(null).then(()=>{this._zone.run(()=>{this._animationCallbacksBuffer.forEach(s=>{const[o,a]=s;o(a)}),this._animationCallbacksBuffer=[]})}),this._animationCallbacksBuffer.push([i,r]))}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 n.\u0275fac=function(t){return new(t||n)(I(Cf),I(YE),I(dt))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();class Yz{constructor(e,t,i){this.namespaceId=e,this.delegate=t,this.engine=i,this.destroyNode=this.delegate.destroyNode?r=>t.destroyNode(r):null}get data(){return this.delegate.data}destroy(){this.engine.destroy(this.namespaceId,this.delegate),this.delegate.destroy()}createElement(e,t){return this.delegate.createElement(e,t)}createComment(e){return this.delegate.createComment(e)}createText(e){return this.delegate.createText(e)}appendChild(e,t){this.delegate.appendChild(e,t),this.engine.onInsert(this.namespaceId,t,e,!1)}insertBefore(e,t,i,r=!0){this.delegate.insertBefore(e,t,i),this.engine.onInsert(this.namespaceId,t,e,r)}removeChild(e,t,i){this.engine.onRemove(this.namespaceId,t,this.delegate,i)}selectRootElement(e,t){return this.delegate.selectRootElement(e,t)}parentNode(e){return this.delegate.parentNode(e)}nextSibling(e){return this.delegate.nextSibling(e)}setAttribute(e,t,i,r){this.delegate.setAttribute(e,t,i,r)}removeAttribute(e,t,i){this.delegate.removeAttribute(e,t,i)}addClass(e,t){this.delegate.addClass(e,t)}removeClass(e,t){this.delegate.removeClass(e,t)}setStyle(e,t,i,r){this.delegate.setStyle(e,t,i,r)}removeStyle(e,t,i){this.delegate.removeStyle(e,t,i)}setProperty(e,t,i){"@"==t.charAt(0)&&t==qz?this.disableAnimations(e,!!i):this.delegate.setProperty(e,t,i)}setValue(e,t){this.delegate.setValue(e,t)}listen(e,t,i){return this.delegate.listen(e,t,i)}disableAnimations(e,t){this.engine.disableAnimations(e,t)}}class rse extends Yz{constructor(e,t,i,r){super(t,i,r),this.factory=e,this.namespaceId=t}setProperty(e,t,i){"@"==t.charAt(0)?"."==t.charAt(1)&&t==qz?this.disableAnimations(e,i=void 0===i||!!i):this.engine.process(this.namespaceId,e,t.substr(1),i):this.delegate.setProperty(e,t,i)}listen(e,t,i){if("@"==t.charAt(0)){const r=function(n){switch(n){case"body":return document.body;case"document":return document;case"window":return window;default:return n}}(e);let s=t.substr(1),o="";return"@"!=s.charAt(0)&&([s,o]=function(n){const e=n.indexOf(".");return[n.substring(0,e),n.substr(e+1)]}(s)),this.engine.listen(this.namespaceId,r,s,o,a=>{this.factory.scheduleListenerCallback(a._data||-1,i,a)})}return this.delegate.listen(e,t,i)}}let ase=(()=>{class n extends YE{constructor(t,i,r){super(t.body,i,r)}ngOnDestroy(){this.flush()}}return n.\u0275fac=function(t){return new(t||n)(I(ut),I(PE),I(xO))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();const Do=new ve("AnimationModuleType"),Xz=[{provide:QV,useClass:ese},{provide:xO,useFactory:function(){return new gre}},{provide:YE,useClass:ase},{provide:Cf,useFactory:function(n,e,t){return new ise(n,e,t)},deps:[_E,YE,dt]}],Kz=[{provide:PE,useFactory:function(){return"function"==typeof Gz()?new Qre:new Uz}},{provide:Do,useValue:"BrowserAnimations"},...Xz],Zz=[{provide:PE,useClass:cz},{provide:Do,useValue:"NoopAnimations"},...Xz];let kO=(()=>{class n{static withConfig(t){return{ngModule:n,providers:t.disableAnimations?Zz:Kz}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({providers:Kz,imports:[yE]}),n})();function fse(n,e){if(1&n&&tt(0,"mat-pseudo-checkbox",4),2&n){const t=Qe();ie("state",t.selected?"checked":"unchecked")("disabled",t.disabled)}}function pse(n,e){if(1&n&&(R(0,"span",5),De(1),k()),2&n){const t=Qe();G(1),or("(",t.group.label,")")}}const gse=["*"],Qz=new ju("12.2.5"),_se=new ve("mat-sanity-checks",{providedIn:"root",factory:function(){return!0}});let $f,On=(()=>{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!(!Mo()||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")&&Qz.full!==ZV.full&&console.warn("The Angular Material version ("+Qz.full+") does not match the Angular CDK version ("+ZV.full+").\nPlease ensure the versions of these two packages exactly match.")}}return n.\u0275fac=function(t){return new(t||n)(I(XV),I(_se,8),I(ut))},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[Nv],Nv]}),n})();function jf(n){return class extends n{constructor(...e){super(...e),this._disabled=!1}get disabled(){return this._disabled}set disabled(e){this._disabled=Mt(e)}}}function Uf(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 nc(n){return class extends n{constructor(...e){super(...e),this._disableRipple=!1}get disableRipple(){return this._disableRipple}set disableRipple(e){this._disableRipple=Mt(e)}}}function Hf(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?To(t):this.defaultTabIndex}}}function FO(n){return class extends n{constructor(...e){super(...e),this.stateChanges=new Se,this.errorState=!1}updateErrorState(){const e=this.errorState,s=(this.errorStateMatcher||this._defaultErrorStateMatcher).isErrorState(this.ngControl?this.ngControl.control:null,this._parentFormGroup||this._parentForm);s!==e&&(this.errorState=s,this.stateChanges.next())}}}try{$f="undefined"!=typeof Intl}catch(n){$f=!1}let Vv=(()=>{class n{isErrorState(t,i){return!!(t&&t.invalid&&(t.touched||i&&i.submitted))}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ue({factory:function(){return new n},token:n,providedIn:"root"}),n})();class Dse{constructor(e,t,i){this._renderer=e,this.element=t,this.config=i,this.state=3}fadeOut(){this._renderer.fadeOutRipple(this)}}const ij={enterDuration:225,exitDuration:150},NO=tm({passive:!0}),rj=["mousedown","touchstart"],sj=["mouseup","mouseleave","touchend","touchcancel"];class oj{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=Wu(i))}fadeInRipple(e,t,i={}){const r=this._containerRect=this._containerRect||this._containerElement.getBoundingClientRect(),s=Object.assign(Object.assign({},ij),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 Dse(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({},ij),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=Wu(e);!t||t===this._triggerElement||(this._removeTriggerEvents(),this._triggerElement=t,this._registerEvents(rj))}handleEvent(e){"mousedown"===e.type?this._onMousedown(e):"touchstart"===e.type?this._onTouchStart(e):this._onPointerUp(),this._pointerUpEventsRegistered||(this._registerEvents(sj),this._pointerUpEventsRegistered=!0)}_onMousedown(e){const t=VV(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,NO)})})}_removeTriggerEvents(){this._triggerElement&&(rj.forEach(e=>{this._triggerElement.removeEventListener(e,this,NO)}),this._pointerUpEventsRegistered&&sj.forEach(e=>{this._triggerElement.removeEventListener(e,this,NO)}))}}const aj=new ve("mat-ripple-global-options");let Js=(()=>{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 oj(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)(E(rt),E(dt),E(si),E(aj,8),E(Do,8))},n.\u0275dir=oe({type:n,selectors:[["","mat-ripple",""],["","matRipple",""]],hostAttrs:[1,"mat-ripple"],hostVars:2,hostBindings:function(t,i){2&t&&st("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})(),_l=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[On,Rv],On]}),n})(),lj=(()=>{class n{constructor(t){this._animationMode=t,this.state="unchecked",this.disabled=!1}}return n.\u0275fac=function(t){return new(t||n)(E(Do,8))},n.\u0275cmp=Ne({type:n,selectors:[["mat-pseudo-checkbox"]],hostAttrs:[1,"mat-pseudo-checkbox"],hostVars:8,hostBindings:function(t,i){2&t&&st("mat-pseudo-checkbox-indeterminate","indeterminate"===i.state)("mat-pseudo-checkbox-checked","checked"===i.state)("mat-pseudo-checkbox-disabled",i.disabled)("_mat-animation-noopable","NoopAnimations"===i._animationMode)},inputs:{state:"state",disabled:"disabled"},decls:0,vars:0,template:function(t,i){},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}),n})(),LO=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[On]]}),n})();const QE=new ve("MAT_OPTION_PARENT_COMPONENT"),Rse=jf(class{});let kse=0,cj=(()=>{class n extends Rse{constructor(t){var i;super(),this._labelId="mat-optgroup-label-"+kse++,this._inert=null!==(i=null==t?void 0:t.inertGroups)&&void 0!==i&&i}}return n.\u0275fac=function(t){return new(t||n)(E(QE,8))},n.\u0275dir=oe({type:n,inputs:{label:"label"},features:[ct]}),n})();const JE=new ve("MatOptgroup");let Fse=0;class uj{constructor(e,t=!1){this.source=e,this.isUserInput=t}}let Nse=(()=>{class n{constructor(t,i,r,s){this._element=t,this._changeDetectorRef=i,this._parent=r,this.group=s,this._selected=!1,this._active=!1,this._disabled=!1,this._mostRecentViewValue="",this.id="mat-option-"+Fse++,this.onSelectionChange=new Le,this._stateChanges=new Se}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=Mt(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,i){const r=this._getHostElement();"function"==typeof r.focus&&r.focus(i)}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)&&!Zs(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 uj(this,t))}}return n.\u0275fac=function(t){return new(t||n)(E(rt),E(kn),E(void 0),E(cj))},n.\u0275dir=oe({type:n,inputs:{id:"id",disabled:"disabled",value:"value"},outputs:{onSelectionChange:"onSelectionChange"}}),n})(),eS=(()=>{class n extends Nse{constructor(t,i,r,s){super(t,i,r,s)}}return n.\u0275fac=function(t){return new(t||n)(E(rt),E(kn),E(QE,8),E(JE,8))},n.\u0275cmp=Ne({type:n,selectors:[["mat-option"]],hostAttrs:["role","option",1,"mat-option","mat-focus-indicator"],hostVars:12,hostBindings:function(t,i){1&t&&ge("click",function(){return i._selectViaInteraction()})("keydown",function(s){return i._handleKeydown(s)}),2&t&&(al("id",i.id),nn("tabindex",i._getTabIndex())("aria-selected",i._getAriaSelected())("aria-disabled",i.disabled.toString()),st("mat-selected",i.selected)("mat-option-multiple",i.multiple)("mat-active",i.active)("mat-option-disabled",i.disabled))},exportAs:["matOption"],features:[ct],ngContentSelectors:gse,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,i){1&t&&(wi(),mt(0,fse,1,2,"mat-pseudo-checkbox",0),R(1,"span",1),Ht(2),k(),mt(3,pse,2,1,"span",2),tt(4,"div",3)),2&t&&(ie("ngIf",i.multiple),G(3),ie("ngIf",i.group&&i.group._inert),G(1),ie("matRippleTrigger",i._getHostElement())("matRippleDisabled",i.disabled||i.disableRipple))},directives:[zr,Js,lj],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}),n})();function BO(n,e,t){if(t.length){let i=e.toArray(),r=t.toArray(),s=0;for(let o=0;o{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[_l,dn,On,LO]]}),n})();function Wc(n,e,t,i){return Ke(t)&&(i=t,t=void 0),i?Wc(n,e,t).pipe(Ae(r=>we(r)?i(...r):i(r))):new ce(r=>{hj(n,e,function(o){r.next(arguments.length>1?Array.prototype.slice.call(arguments):o)},r,t)})}function hj(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 enter",[ti({opacity:0,transform:"translateY(-5px)"}),Ao("300ms cubic-bezier(0.55, 0, 0.55, 0.2)")])])};let jv=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275dir=oe({type:n}),n})();const pj=new ve("MatHint");let Gf=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275dir=oe({type:n,selectors:[["mat-label"]]}),n})(),ooe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275dir=oe({type:n,selectors:[["mat-placeholder"]]}),n})();const gj=new ve("MatPrefix"),mj=new ve("MatSuffix");let VO=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275dir=oe({type:n,selectors:[["","matSuffix",""]],features:[Dt([{provide:mj,useExisting:n}])]}),n})(),_j=0;const coe=Uf(class{constructor(n){this._elementRef=n}},"primary"),vj=new ve("MAT_FORM_FIELD_DEFAULT_OPTIONS"),nS=new ve("MatFormField");let am=(()=>{class n extends coe{constructor(t,i,r,s,o,a,l,c){super(t),this._changeDetectorRef=i,this._dir=s,this._defaults=o,this._platform=a,this._ngZone=l,this._outlineGapCalculationNeededImmediately=!1,this._outlineGapCalculationNeededOnStable=!1,this._destroyed=new Se,this._showAlwaysAnimate=!1,this._subscriptAnimationState="",this._hintLabel="",this._hintLabelId="mat-hint-"+_j++,this._labelId="mat-form-field-label-"+_j++,this.floatLabel=this._getDefaultFloatLabelState(),this._animationsEnabled="NoopAnimations"!==c,this.appearance=o&&o.appearance?o.appearance:"legacy",this._hideRequiredMarker=!(!o||null==o.hideRequiredMarker)&&o.hideRequiredMarker}get appearance(){return this._appearance}set appearance(t){const i=this._appearance;this._appearance=t||this._defaults&&this._defaults.appearance||"legacy","outline"===this._appearance&&i!==t&&(this._outlineGapCalculationNeededOnStable=!0)}get hideRequiredMarker(){return this._hideRequiredMarker}set hideRequiredMarker(t){this._hideRequiredMarker=Mt(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(Rr(null)).subscribe(()=>{this._validatePlaceholders(),this._syncDescribedByIds(),this._changeDetectorRef.markForCheck()}),t.ngControl&&t.ngControl.valueChanges&&t.ngControl.valueChanges.pipe(Tn(this._destroyed)).subscribe(()=>this._changeDetectorRef.markForCheck()),this._ngZone.runOutsideAngular(()=>{this._ngZone.onStable.pipe(Tn(this._destroyed)).subscribe(()=>{this._outlineGapCalculationNeededOnStable&&this.updateOutlineGap()})}),Ni(this._prefixChildren.changes,this._suffixChildren.changes).subscribe(()=>{this._outlineGapCalculationNeededOnStable=!0,this._changeDetectorRef.markForCheck()}),this._hintChildren.changes.pipe(Rr(null)).subscribe(()=>{this._processHints(),this._changeDetectorRef.markForCheck()}),this._errorChildren.changes.pipe(Rr(null)).subscribe(()=>{this._syncDescribedByIds(),this._changeDetectorRef.markForCheck()}),this._dir&&this._dir.change.pipe(Tn(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 i=this._control?this._control.ngControl:null;return i&&i[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,Wc(this._label.nativeElement,"transitionend").pipe(yi(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 i=this._hintChildren?this._hintChildren.find(s=>"start"===s.align):null,r=this._hintChildren?this._hintChildren.find(s=>"end"===s.align):null;i?t.push(i.id):this._hintLabel&&t.push(this._hintLabelId),r&&t.push(r.id)}else this._errorChildren&&t.push(...this._errorChildren.map(i=>i.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 i=0,r=0;const s=this._connectionContainerRef.nativeElement,o=s.querySelectorAll(".mat-form-field-outline-start"),a=s.querySelectorAll(".mat-form-field-outline-gap");if(this._label&&this._label.nativeElement.children.length){const l=s.getBoundingClientRect();if(0===l.width&&0===l.height)return this._outlineGapCalculationNeededOnStable=!0,void(this._outlineGapCalculationNeededImmediately=!1);const c=this._getStartEnd(l),d=t.children,f=this._getStartEnd(d[0].getBoundingClientRect());let p=0;for(let g=0;g0?.75*p+10:0}for(let l=0;l{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,On,SE],On]}),n})();function Hv(...n){if(1===n.length){const e=n[0];if(we(e))return iS(e,null);if(_e(e)&&Object.getPrototypeOf(e)===Object.prototype){const t=Object.keys(e);return iS(t.map(i=>e[i]),t)}}if("function"==typeof n[n.length-1]){const e=n.pop();return iS(n=1===n.length&&we(n[0])?n[0]:n,null).pipe(Ae(t=>e(...t)))}return iS(n,null)}function iS(n,e){return new ce(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 Ta(n){return function(t){const i=new uoe(n),r=t.lift(i);return i.caught=r}}class uoe{constructor(e){this.selector=e}call(e,t){return t.subscribe(new doe(e,this.selector,this.caught))}}class doe extends ii{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 Gr(this);this.add(i);const r=co(t,i);r!==i&&this.add(r)}}}class hoe{constructor(e){this.callback=e}call(e,t){return t.subscribe(new foe(e,this.callback))}}class foe extends xt{constructor(e,t){super(e),this.add(new Te(t))}}class Cj{}class wj{}class Yu{constructor(e){this.normalizedNames=new Map,this.lazyUpdate=null,e?this.lazyInit="string"==typeof e?()=>{this.headers=new Map,e.split("\n").forEach(t=>{const i=t.indexOf(":");if(i>0){const r=t.slice(0,i),s=r.toLowerCase(),o=t.slice(i+1).trim();this.maybeSetNormalizedName(r,s),this.headers.has(s)?this.headers.get(s).push(o):this.headers.set(s,[o])}})}:()=>{this.headers=new Map,Object.keys(e).forEach(t=>{let i=e[t];const r=t.toLowerCase();"string"==typeof i&&(i=[i]),i.length>0&&(this.headers.set(r,i),this.maybeSetNormalizedName(t,r))})}:this.headers=new Map}has(e){return this.init(),this.headers.has(e.toLowerCase())}get(e){this.init();const t=this.headers.get(e.toLowerCase());return t&&t.length>0?t[0]:null}keys(){return this.init(),Array.from(this.normalizedNames.values())}getAll(e){return this.init(),this.headers.get(e.toLowerCase())||null}append(e,t){return this.clone({name:e,value:t,op:"a"})}set(e,t){return this.clone({name:e,value:t,op:"s"})}delete(e,t){return this.clone({name:e,value:t,op:"d"})}maybeSetNormalizedName(e,t){this.normalizedNames.has(t)||this.normalizedNames.set(t,e)}init(){this.lazyInit&&(this.lazyInit instanceof Yu?this.copyFrom(this.lazyInit):this.lazyInit(),this.lazyInit=null,this.lazyUpdate&&(this.lazyUpdate.forEach(e=>this.applyUpdate(e)),this.lazyUpdate=null))}copyFrom(e){e.init(),Array.from(e.headers.keys()).forEach(t=>{this.headers.set(t,e.headers.get(t)),this.normalizedNames.set(t,e.normalizedNames.get(t))})}clone(e){const t=new Yu;return t.lazyInit=this.lazyInit&&this.lazyInit instanceof Yu?this.lazyInit:this,t.lazyUpdate=(this.lazyUpdate||[]).concat([e]),t}applyUpdate(e){const t=e.name.toLowerCase();switch(e.op){case"a":case"s":let i=e.value;if("string"==typeof i&&(i=[i]),0===i.length)return;this.maybeSetNormalizedName(e.name,t);const r=("a"===e.op?this.headers.get(t):void 0)||[];r.push(...i),this.headers.set(t,r);break;case"d":const s=e.value;if(s){let o=this.headers.get(t);if(!o)return;o=o.filter(a=>-1===s.indexOf(a)),0===o.length?(this.headers.delete(t),this.normalizedNames.delete(t)):this.headers.set(t,o)}else this.headers.delete(t),this.normalizedNames.delete(t)}}forEach(e){this.init(),Array.from(this.normalizedNames.keys()).forEach(t=>e(this.normalizedNames.get(t),this.headers.get(t)))}}class poe{encodeKey(e){return Ej(e)}encodeValue(e){return Ej(e)}decodeKey(e){return decodeURIComponent(e)}decodeValue(e){return decodeURIComponent(e)}}const moe=/%(\d[a-f0-9])/gi,_oe={40:"@","3A":":",24:"$","2C":",","3B":";","2B":"+","3D":"=","3F":"?","2F":"/"};function Ej(n){return encodeURIComponent(n).replace(moe,(e,t)=>{var i;return null!==(i=_oe[t])&&void 0!==i?i:e})}function Sj(n){return`${n}`}class oh{constructor(e={}){if(this.updates=null,this.cloneFrom=null,this.encoder=e.encoder||new poe,e.fromString){if(e.fromObject)throw new Error("Cannot specify both fromString and fromObject.");this.map=function(n,e){const t=new Map;return n.length>0&&n.replace(/^\?/,"").split("&").forEach(r=>{const s=r.indexOf("="),[o,a]=-1==s?[e.decodeKey(r),""]:[e.decodeKey(r.slice(0,s)),e.decodeValue(r.slice(s+1))],l=t.get(o)||[];l.push(a),t.set(o,l)}),t}(e.fromString,this.encoder)}else e.fromObject?(this.map=new Map,Object.keys(e.fromObject).forEach(t=>{const i=e.fromObject[t];this.map.set(t,Array.isArray(i)?i:[i])})):this.map=null}has(e){return this.init(),this.map.has(e)}get(e){this.init();const t=this.map.get(e);return t?t[0]:null}getAll(e){return this.init(),this.map.get(e)||null}keys(){return this.init(),Array.from(this.map.keys())}append(e,t){return this.clone({param:e,value:t,op:"a"})}appendAll(e){const t=[];return Object.keys(e).forEach(i=>{const r=e[i];Array.isArray(r)?r.forEach(s=>{t.push({param:i,value:s,op:"a"})}):t.push({param:i,value:r,op:"a"})}),this.clone(t)}set(e,t){return this.clone({param:e,value:t,op:"s"})}delete(e,t){return this.clone({param:e,value:t,op:"d"})}toString(){return this.init(),this.keys().map(e=>{const t=this.encoder.encodeKey(e);return this.map.get(e).map(i=>t+"="+this.encoder.encodeValue(i)).join("&")}).filter(e=>""!==e).join("&")}clone(e){const t=new oh({encoder:this.encoder});return t.cloneFrom=this.cloneFrom||this,t.updates=(this.updates||[]).concat(e),t}init(){null===this.map&&(this.map=new Map),null!==this.cloneFrom&&(this.cloneFrom.init(),this.cloneFrom.keys().forEach(e=>this.map.set(e,this.cloneFrom.map.get(e))),this.updates.forEach(e=>{switch(e.op){case"a":case"s":const t=("a"===e.op?this.map.get(e.param):void 0)||[];t.push(Sj(e.value)),this.map.set(e.param,t);break;case"d":if(void 0===e.value){this.map.delete(e.param);break}{let i=this.map.get(e.param)||[];const r=i.indexOf(Sj(e.value));-1!==r&&i.splice(r,1),i.length>0?this.map.set(e.param,i):this.map.delete(e.param)}}}),this.cloneFrom=this.updates=null)}}class yoe{constructor(){this.map=new Map}set(e,t){return this.map.set(e,t),this}get(e){return this.map.has(e)||this.map.set(e,e.defaultValue()),this.map.get(e)}delete(e){return this.map.delete(e),this}keys(){return this.map.keys()}}function Mj(n){return"undefined"!=typeof ArrayBuffer&&n instanceof ArrayBuffer}function xj(n){return"undefined"!=typeof Blob&&n instanceof Blob}function Tj(n){return"undefined"!=typeof FormData&&n instanceof FormData}class $v{constructor(e,t,i,r){let s;if(this.url=t,this.body=null,this.reportProgress=!1,this.withCredentials=!1,this.responseType="json",this.method=e.toUpperCase(),function(n){switch(n){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,s=r):s=i,s&&(this.reportProgress=!!s.reportProgress,this.withCredentials=!!s.withCredentials,s.responseType&&(this.responseType=s.responseType),s.headers&&(this.headers=s.headers),s.context&&(this.context=s.context),s.params&&(this.params=s.params)),this.headers||(this.headers=new Yu),this.context||(this.context=new yoe),this.params){const o=this.params.toString();if(0===o.length)this.urlWithParams=t;else{const a=t.indexOf("?");this.urlWithParams=t+(-1===a?"?":ap.set(g,e.setHeaders[g]),c)),e.setParams&&(d=Object.keys(e.setParams).reduce((p,g)=>p.set(g,e.setParams[g]),d)),new $v(i,r,o,{params:d,headers:c,context:f,reportProgress:l,responseType:s,withCredentials:a})}}var Ur=(()=>((Ur=Ur||{})[Ur.Sent=0]="Sent",Ur[Ur.UploadProgress=1]="UploadProgress",Ur[Ur.ResponseHeader=2]="ResponseHeader",Ur[Ur.DownloadProgress=3]="DownloadProgress",Ur[Ur.Response=4]="Response",Ur[Ur.User=5]="User",Ur))();class zO{constructor(e,t=200,i="OK"){this.headers=e.headers||new Yu,this.status=void 0!==e.status?e.status:t,this.statusText=e.statusText||i,this.url=e.url||null,this.ok=this.status>=200&&this.status<300}}class jO extends zO{constructor(e={}){super(e),this.type=Ur.ResponseHeader}clone(e={}){return new jO({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})}}class rS extends zO{constructor(e={}){super(e),this.type=Ur.Response,this.body=void 0!==e.body?e.body:null}clone(e={}){return new rS({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})}}class Aj extends zO{constructor(e){super(e,0,"Unknown Error"),this.name="HttpErrorResponse",this.ok=!1,this.message=this.status>=200&&this.status<300?`Http failure during parsing for ${e.url||"(unknown url)"}`:`Http failure response for ${e.url||"(unknown url)"}: ${e.status} ${e.statusText}`,this.error=e.error||null}}function UO(n,e){return{body:e,headers:n.headers,context:n.context,observe:n.observe,params:n.params,reportProgress:n.reportProgress,responseType:n.responseType,withCredentials:n.withCredentials}}let Wf=(()=>{class n{constructor(t){this.handler=t}request(t,i,r={}){let s;if(t instanceof $v)s=t;else{let l,c;l=r.headers instanceof Yu?r.headers:new Yu(r.headers),r.params&&(c=r.params instanceof oh?r.params:new oh({fromObject:r.params})),s=new $v(t,i,void 0!==r.body?r.body:null,{headers:l,context:r.context,params:c,reportProgress:r.reportProgress,responseType:r.responseType||"json",withCredentials:r.withCredentials})}const o=ht(s).pipe(function(n,e){return di(n,e,1)}(l=>this.handler.handle(l)));if(t instanceof $v||"events"===r.observe)return o;const a=o.pipe(Fn(l=>l instanceof rS));switch(r.observe||"body"){case"body":switch(s.responseType){case"arraybuffer":return a.pipe(Ae(l=>{if(null!==l.body&&!(l.body instanceof ArrayBuffer))throw new Error("Response is not an ArrayBuffer.");return l.body}));case"blob":return a.pipe(Ae(l=>{if(null!==l.body&&!(l.body instanceof Blob))throw new Error("Response is not a Blob.");return l.body}));case"text":return a.pipe(Ae(l=>{if(null!==l.body&&"string"!=typeof l.body)throw new Error("Response is not a string.");return l.body}));case"json":default:return a.pipe(Ae(l=>l.body))}case"response":return a;default:throw new Error(`Unreachable: unhandled observe type ${r.observe}}`)}}delete(t,i={}){return this.request("DELETE",t,i)}get(t,i={}){return this.request("GET",t,i)}head(t,i={}){return this.request("HEAD",t,i)}jsonp(t,i){return this.request("JSONP",t,{params:(new oh).append(i,"JSONP_CALLBACK"),observe:"body",responseType:"json"})}options(t,i={}){return this.request("OPTIONS",t,i)}patch(t,i,r={}){return this.request("PATCH",t,UO(r,i))}post(t,i,r={}){return this.request("POST",t,UO(r,i))}put(t,i,r={}){return this.request("PUT",t,UO(r,i))}}return n.\u0275fac=function(t){return new(t||n)(I(Cj))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();class Dj{constructor(e,t){this.next=e,this.interceptor=t}handle(e){return this.interceptor.intercept(e,this.next)}}const Oj=new ve("HTTP_INTERCEPTORS");let Coe=(()=>{class n{intercept(t,i){return i.handle(t)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();const woe=/^\)\]\}',?\n/;let Ij=(()=>{class n{constructor(t){this.xhrFactory=t}handle(t){if("JSONP"===t.method)throw new Error("Attempted to construct Jsonp request without HttpClientJsonpModule installed.");return new ce(i=>{const r=this.xhrFactory.build();if(r.open(t.method,t.urlWithParams),t.withCredentials&&(r.withCredentials=!0),t.headers.forEach((g,_)=>r.setRequestHeader(g,_.join(","))),t.headers.has("Accept")||r.setRequestHeader("Accept","application/json, text/plain, */*"),!t.headers.has("Content-Type")){const g=t.detectContentTypeHeader();null!==g&&r.setRequestHeader("Content-Type",g)}if(t.responseType){const g=t.responseType.toLowerCase();r.responseType="json"!==g?g:"text"}const s=t.serializeBody();let o=null;const a=()=>{if(null!==o)return o;const g=1223===r.status?204:r.status,_=r.statusText||"OK",y=new Yu(r.getAllResponseHeaders()),v=function(n){return"responseURL"in n&&n.responseURL?n.responseURL:/^X-Request-URL:/m.test(n.getAllResponseHeaders())?n.getResponseHeader("X-Request-URL"):null}(r)||t.url;return o=new jO({headers:y,status:g,statusText:_,url:v}),o},l=()=>{let{headers:g,status:_,statusText:y,url:v}=a(),C=null;204!==_&&(C=void 0===r.response?r.responseText:r.response),0===_&&(_=C?200:0);let w=_>=200&&_<300;if("json"===t.responseType&&"string"==typeof C){const x=C;C=C.replace(woe,"");try{C=""!==C?JSON.parse(C):null}catch(N){C=x,w&&(w=!1,C={error:N,text:C})}}w?(i.next(new rS({body:C,headers:g,status:_,statusText:y,url:v||void 0})),i.complete()):i.error(new Aj({error:C,headers:g,status:_,statusText:y,url:v||void 0}))},c=g=>{const{url:_}=a(),y=new Aj({error:g,status:r.status||0,statusText:r.statusText||"Unknown Error",url:_||void 0});i.error(y)};let d=!1;const f=g=>{d||(i.next(a()),d=!0);let _={type:Ur.DownloadProgress,loaded:g.loaded};g.lengthComputable&&(_.total=g.total),"text"===t.responseType&&!!r.responseText&&(_.partialText=r.responseText),i.next(_)},p=g=>{let _={type:Ur.UploadProgress,loaded:g.loaded};g.lengthComputable&&(_.total=g.total),i.next(_)};return r.addEventListener("load",l),r.addEventListener("error",c),r.addEventListener("timeout",c),r.addEventListener("abort",c),t.reportProgress&&(r.addEventListener("progress",f),null!==s&&r.upload&&r.upload.addEventListener("progress",p)),r.send(s),i.next({type:Ur.Sent}),()=>{r.removeEventListener("error",c),r.removeEventListener("abort",c),r.removeEventListener("load",l),r.removeEventListener("timeout",c),t.reportProgress&&(r.removeEventListener("progress",f),null!==s&&r.upload&&r.upload.removeEventListener("progress",p)),r.readyState!==r.DONE&&r.abort()}})}}return n.\u0275fac=function(t){return new(t||n)(I(aV))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();const HO=new ve("XSRF_COOKIE_NAME"),$O=new ve("XSRF_HEADER_NAME");class Pj{}let Soe=(()=>{class n{constructor(t,i,r){this.doc=t,this.platform=i,this.cookieName=r,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=Y3(t,this.cookieName),this.lastCookieString=t),this.lastToken}}return n.\u0275fac=function(t){return new(t||n)(I(ut),I(dl),I(HO))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})(),GO=(()=>{class n{constructor(t,i){this.tokenService=t,this.headerName=i}intercept(t,i){const r=t.url.toLowerCase();if("GET"===t.method||"HEAD"===t.method||r.startsWith("http://")||r.startsWith("https://"))return i.handle(t);const s=this.tokenService.getToken();return null!==s&&!t.headers.has(this.headerName)&&(t=t.clone({headers:t.headers.set(this.headerName,s)})),i.handle(t)}}return n.\u0275fac=function(t){return new(t||n)(I(Pj),I($O))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})(),Moe=(()=>{class n{constructor(t,i){this.backend=t,this.injector=i,this.chain=null}handle(t){if(null===this.chain){const i=this.injector.get(Oj,[]);this.chain=i.reduceRight((r,s)=>new Dj(r,s),this.backend)}return this.chain.handle(t)}}return n.\u0275fac=function(t){return new(t||n)(I(wj),I(Nt))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})(),xoe=(()=>{class n{static disable(){return{ngModule:n,providers:[{provide:GO,useClass:Coe}]}}static withOptions(t={}){return{ngModule:n,providers:[t.cookieName?{provide:HO,useValue:t.cookieName}:[],t.headerName?{provide:$O,useValue:t.headerName}:[]]}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({providers:[GO,{provide:Oj,useExisting:GO,multi:!0},{provide:Pj,useClass:Soe},{provide:HO,useValue:"XSRF-TOKEN"},{provide:$O,useValue:"X-XSRF-TOKEN"}]}),n})(),Rj=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({providers:[Wf,{provide:Cj,useClass:Moe},Ij,{provide:wj,useExisting:Ij}],imports:[[xoe.withOptions({cookieName:"XSRF-TOKEN",headerName:"X-XSRF-TOKEN"})]]}),n})();const Toe=["*"];function kj(n){return Error(`Unable to find icon with the name "${n}"`)}function Fj(n){return Error(`The URL provided to MatIconRegistry was not trusted as a resource URL via Angular's DomSanitizer. Attempted URL was "${n}".`)}function Nj(n){return Error(`The literal provided to MatIconRegistry was not trusted as safe HTML by Angular's DomSanitizer. Attempted literal was "${n}".`)}class qf{constructor(e,t,i){this.url=e,this.svgText=t,this.options=i}}let Gv=(()=>{class n{constructor(t,i,r,s){this._httpClient=t,this._sanitizer=i,this._errorHandler=s,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=r}addSvgIcon(t,i,r){return this.addSvgIconInNamespace("",t,i,r)}addSvgIconLiteral(t,i,r){return this.addSvgIconLiteralInNamespace("",t,i,r)}addSvgIconInNamespace(t,i,r,s){return this._addSvgIconConfig(t,i,new qf(r,null,s))}addSvgIconResolver(t){return this._resolvers.push(t),this}addSvgIconLiteralInNamespace(t,i,r,s){const o=this._sanitizer.sanitize(mn.HTML,r);if(!o)throw Nj(r);return this._addSvgIconConfig(t,i,new qf("",o,s))}addSvgIconSet(t,i){return this.addSvgIconSetInNamespace("",t,i)}addSvgIconSetLiteral(t,i){return this.addSvgIconSetLiteralInNamespace("",t,i)}addSvgIconSetInNamespace(t,i,r){return this._addSvgIconSetConfig(t,new qf(i,null,r))}addSvgIconSetLiteralInNamespace(t,i,r){const s=this._sanitizer.sanitize(mn.HTML,i);if(!s)throw Nj(i);return this._addSvgIconSetConfig(t,new qf("",s,r))}registerFontClassAlias(t,i=t){return this._fontCssClassesByAlias.set(t,i),this}classNameForFontAlias(t){return this._fontCssClassesByAlias.get(t)||t}setDefaultFontSetClass(t){return this._defaultFontSetClass=t,this}getDefaultFontSetClass(){return this._defaultFontSetClass}getSvgIconFromUrl(t){const i=this._sanitizer.sanitize(mn.RESOURCE_URL,t);if(!i)throw Fj(t);const r=this._cachedIconsByUrl.get(i);return r?ht(sS(r)):this._loadSvgIconFromConfig(new qf(t,null)).pipe(Ti(s=>this._cachedIconsByUrl.set(i,s)),Ae(s=>sS(s)))}getNamedSvgIcon(t,i=""){const r=Lj(i,t);let s=this._svgIconConfigs.get(r);if(s)return this._getSvgFromConfig(s);if(s=this._getIconConfigFromResolvers(i,t),s)return this._svgIconConfigs.set(r,s),this._getSvgFromConfig(s);const o=this._iconSetConfigs.get(i);return o?this._getSvgFromIconSetConfigs(t,o):Kg(kj(r))}ngOnDestroy(){this._resolvers=[],this._svgIconConfigs.clear(),this._iconSetConfigs.clear(),this._cachedIconsByUrl.clear()}_getSvgFromConfig(t){return t.svgText?ht(sS(this._svgElementFromConfig(t))):this._loadSvgIconFromConfig(t).pipe(Ae(i=>sS(i)))}_getSvgFromIconSetConfigs(t,i){const r=this._extractIconWithNameFromAnySet(t,i);return r?ht(r):Hv(i.filter(o=>!o.svgText).map(o=>this._loadSvgIconSetFromConfig(o).pipe(Ta(a=>{const c=`Loading icon set URL: ${this._sanitizer.sanitize(mn.RESOURCE_URL,o.url)} failed: ${a.message}`;return this._errorHandler.handleError(new Error(c)),ht(null)})))).pipe(Ae(()=>{const o=this._extractIconWithNameFromAnySet(t,i);if(!o)throw kj(t);return o}))}_extractIconWithNameFromAnySet(t,i){for(let r=i.length-1;r>=0;r--){const s=i[r];if(s.svgText&&s.svgText.indexOf(t)>-1){const o=this._svgElementFromConfig(s),a=this._extractSvgIconFromSet(o,t,s.options);if(a)return a}}return null}_loadSvgIconFromConfig(t){return this._fetchIcon(t).pipe(Ti(i=>t.svgText=i),Ae(()=>this._svgElementFromConfig(t)))}_loadSvgIconSetFromConfig(t){return t.svgText?ht(null):this._fetchIcon(t).pipe(Ti(i=>t.svgText=i))}_extractSvgIconFromSet(t,i,r){const s=t.querySelector(`[id="${i}"]`);if(!s)return null;const o=s.cloneNode(!0);if(o.removeAttribute("id"),"svg"===o.nodeName.toLowerCase())return this._setSvgAttributes(o,r);if("symbol"===o.nodeName.toLowerCase())return this._setSvgAttributes(this._toSvgElement(o),r);const a=this._svgElementFromString("");return a.appendChild(o),this._setSvgAttributes(a,r)}_svgElementFromString(t){const i=this._document.createElement("DIV");i.innerHTML=t;const r=i.querySelector("svg");if(!r)throw Error(" tag not found");return r}_toSvgElement(t){const i=this._svgElementFromString(""),r=t.attributes;for(let s=0;se.lift(new hoe(n))}(()=>this._inProgressUrlFetches.delete(a)),Vs());return this._inProgressUrlFetches.set(a,c),c}_addSvgIconConfig(t,i,r){return this._svgIconConfigs.set(Lj(t,i),r),this}_addSvgIconSetConfig(t,i){const r=this._iconSetConfigs.get(t);return r?r.push(i):this._iconSetConfigs.set(t,[i]),this}_svgElementFromConfig(t){if(!t.svgElement){const i=this._svgElementFromString(t.svgText);this._setSvgAttributes(i,t.options),t.svgElement=i}return t.svgElement}_getIconConfigFromResolvers(t,i){for(let r=0;re?e.pathname+e.search:""}}}),Bj=["clip-path","color-profile","src","cursor","fill","filter","marker","marker-start","marker-mid","marker-end","mask","stroke"],Foe=Bj.map(n=>`[${n}]`).join(", "),Noe=/^url\(['"]?#(.*?)['"]?\)$/;let rs=(()=>{class n extends Ioe{constructor(t,i,r,s,o){super(t),this._iconRegistry=i,this._location=s,this._errorHandler=o,this._inline=!1,this._currentIconFetch=Te.EMPTY,r||t.nativeElement.setAttribute("aria-hidden","true")}get inline(){return this._inline}set inline(t){this._inline=Mt(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 i=this._cleanupFontValue(t);i!==this._fontSet&&(this._fontSet=i,this._updateFontIconClasses())}get fontIcon(){return this._fontIcon}set fontIcon(t){const i=this._cleanupFontValue(t);i!==this._fontIcon&&(this._fontIcon=i,this._updateFontIconClasses())}_splitIconName(t){if(!t)return["",""];const i=t.split(":");switch(i.length){case 1:return["",i[0]];case 2:return i;default:throw Error(`Invalid icon name: "${t}"`)}}ngOnInit(){this._updateFontIconClasses()}ngAfterViewChecked(){const t=this._elementsWithExternalReferences;if(t&&t.size){const i=this._location.getPathname();i!==this._previousPath&&(this._previousPath=i,this._prependPathToReferences(i))}}ngOnDestroy(){this._currentIconFetch.unsubscribe(),this._elementsWithExternalReferences&&this._elementsWithExternalReferences.clear()}_usingFontIcon(){return!this.svgIcon}_setSvgElement(t){this._clearSvgElement();const i=t.querySelectorAll("style");for(let s=0;s{r.forEach(o=>{s.setAttribute(o.name,`url('${t}#${o.value}')`)})})}_cacheChildrenWithExternalReferences(t){const i=t.querySelectorAll(Foe),r=this._elementsWithExternalReferences=this._elementsWithExternalReferences||new Map;for(let s=0;s{const a=i[s],l=a.getAttribute(o),c=l?l.match(Noe):null;if(c){let d=r.get(a);d||(d=[],r.set(a,d)),d.push({name:o,value:c[1]})}})}_updateSvgIcon(t){if(this._svgNamespace=null,this._svgName=null,this._currentIconFetch.unsubscribe(),t){const[i,r]=this._splitIconName(t);i&&(this._svgNamespace=i),r&&(this._svgName=r),this._currentIconFetch=this._iconRegistry.getNamedSvgIcon(r,i).pipe(yi(1)).subscribe(s=>this._setSvgElement(s),s=>{this._errorHandler.handleError(new Error(`Error retrieving icon ${i}:${r}! ${s.message}`))})}}}return n.\u0275fac=function(t){return new(t||n)(E(rt),E(Gv),Zr("aria-hidden"),E(Poe),E($o))},n.\u0275cmp=Ne({type:n,selectors:[["mat-icon"]],hostAttrs:["role","img",1,"mat-icon","notranslate"],hostVars:7,hostBindings:function(t,i){2&t&&(nn("data-mat-icon-type",i._usingFontIcon()?"font":"svg")("data-mat-icon-name",i._svgName||i.fontIcon)("data-mat-icon-namespace",i._svgNamespace||i.fontSet),st("mat-icon-inline",i.inline)("mat-icon-no-color","primary"!==i.color&&"accent"!==i.color&&"warn"!==i.color))},inputs:{color:"color",inline:"inline",svgIcon:"svgIcon",fontSet:"fontSet",fontIcon:"fontIcon"},exportAs:["matIcon"],features:[ct],ngContentSelectors:Toe,decls:1,vars:0,template:function(t,i){1&t&&(wi(),Ht(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}),n})(),lr=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[On],On]}),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=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 zoe=1;const joe=Promise.resolve(),oS={};function Vj(n){return n in oS&&(delete oS[n],!0)}const zj={setImmediate(n){const e=zoe++;return oS[e]=!0,joe.then(()=>Vj(e)&&n()),e},clearImmediate(n){Vj(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=zj.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&&(zj.clearImmediate(t),e.scheduled=void 0)}});function cm(n){return!!n&&(n instanceof ce||"function"==typeof n.lift&&"function"==typeof n.subscribe)}class Woe{constructor(e){this.durationSelector=e}call(e,t){return t.subscribe(new qoe(e,this.durationSelector))}}class qoe extends ii{constructor(e,t){super(e),this.durationSelector=t,this.hasValue=!1}_next(e){if(this.value=e,this.hasValue=!0,!this.throttled){let t;try{const{durationSelector:r}=this;t=r(e)}catch(r){return this.destination.error(r)}const i=co(t,new Gr(this));!i||i.closed?this.clearThrottle():this.add(this.throttled=i)}}clearThrottle(){const{value:e,hasValue:t,throttled:i}=this;i&&(this.remove(i),this.throttled=void 0,i.unsubscribe()),t&&(this.value=void 0,this.hasValue=!1,this.destination.next(e))}notifyNext(){this.clearThrottle()}notifyComplete(){this.clearThrottle()}}function WO(n){return!we(n)&&n-parseFloat(n)+1>=0}function Xoe(n){const{index:e,period:t,subscriber:i}=n;if(i.next(e),!i.closed){if(-1===t)return i.complete();n.index=e+1,this.schedule(n,t)}}function aS(n,e=Pf){return function(n){return function(t){return t.lift(new Woe(n))}}(()=>function(n=0,e,t){let i=-1;return WO(e)?i=Number(e)<1?1:Number(e):Gn(e)&&(t=e),Gn(t)||(t=Pf),new ce(r=>{const s=WO(n)?n:+n-t.now();return t.schedule(Xoe,s,{index:0,period:i,subscriber:r})})}(n,e))}function qc(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 If(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))}class lS{constructor(e=!1,t,i=!0){this._multiple=e,this._emitChanges=i,this._selection=new Set,this._deselectedToEmit=[],this._selectedToEmit=[],this.changed=new Se,t&&t.length&&(e?t.forEach(r=>this._markSelected(r)):this._markSelected(t[0]),this._selectedToEmit.length=0)}get selected(){return this._selected||(this._selected=Array.from(this._selection.values())),this._selected}select(...e){this._verifyValueAssignment(e),e.forEach(t=>this._markSelected(t)),this._emitChangeEvent()}deselect(...e){this._verifyValueAssignment(e),e.forEach(t=>this._unmarkSelected(t)),this._emitChangeEvent()}toggle(e){this.isSelected(e)?this.deselect(e):this.select(e)}clear(){this._unmarkAll(),this._emitChangeEvent()}isSelected(e){return this._selection.has(e)}isEmpty(){return 0===this._selection.size}hasValue(){return!this.isEmpty()}sort(e){this._multiple&&this.selected&&this._selected.sort(e)}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(e){this.isSelected(e)||(this._multiple||this._unmarkAll(),this._selection.add(e),this._emitChanges&&this._selectedToEmit.push(e))}_unmarkSelected(e){this.isSelected(e)&&(this._selection.delete(e),this._emitChanges&&this._deselectedToEmit.push(e))}_unmarkAll(){this.isEmpty()||this._selection.forEach(e=>this._unmarkSelected(e))}_verifyValueAssignment(e){}}let cS=(()=>{class n{constructor(){this._listeners=[]}notify(t,i){for(let r of this._listeners)r(t,i)}listen(t){return this._listeners.push(t),()=>{this._listeners=this._listeners.filter(i=>t!==i)}}ngOnDestroy(){this._listeners=[]}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ue({factory:function(){return new n},token:n,providedIn:"root"}),n})(),um=(()=>{class n{constructor(t,i,r){this._ngZone=t,this._platform=i,this._scrolled=new Se,this._globalSubscription=null,this._scrolledCount=0,this.scrollContainers=new Map,this._document=r}register(t){this.scrollContainers.has(t)||this.scrollContainers.set(t,t.elementScrolled().subscribe(()=>this._scrolled.next(t)))}deregister(t){const i=this.scrollContainers.get(t);i&&(i.unsubscribe(),this.scrollContainers.delete(t))}scrolled(t=20){return this._platform.isBrowser?new ce(i=>{this._globalSubscription||this._addGlobalListener();const r=t>0?this._scrolled.pipe(aS(t)).subscribe(i):this._scrolled.subscribe(i);return this._scrolledCount++,()=>{r.unsubscribe(),this._scrolledCount--,this._scrolledCount||this._removeGlobalListener()}}):ht()}ngOnDestroy(){this._removeGlobalListener(),this.scrollContainers.forEach((t,i)=>this.deregister(i)),this._scrolled.complete()}ancestorScrolled(t,i){const r=this.getAncestorScrollContainers(t);return this.scrolled(i).pipe(Fn(s=>!s||r.indexOf(s)>-1))}getAncestorScrollContainers(t){const i=[];return this.scrollContainers.forEach((r,s)=>{this._scrollableContainsElement(s,t)&&i.push(s)}),i}_getWindow(){return this._document.defaultView||window}_scrollableContainsElement(t,i){let r=Wu(i),s=t.getElementRef().nativeElement;do{if(r==s)return!0}while(r=r.parentElement);return!1}_addGlobalListener(){this._globalSubscription=this._ngZone.runOutsideAngular(()=>Wc(this._getWindow().document,"scroll").subscribe(()=>this._scrolled.next()))}_removeGlobalListener(){this._globalSubscription&&(this._globalSubscription.unsubscribe(),this._globalSubscription=null)}}return n.\u0275fac=function(t){return new(t||n)(I(dt),I(si),I(ut,8))},n.\u0275prov=ue({factory:function(){return new n(I(dt),I(si),I(ut,8))},token:n,providedIn:"root"}),n})(),Yf=(()=>{class n{constructor(t,i,r){this._platform=t,this._change=new Se,this._changeListener=s=>{this._change.next(s)},this._document=r,i.runOutsideAngular(()=>{if(t.isBrowser){const s=this._getWindow();s.addEventListener("resize",this._changeListener),s.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:i,height:r}=this.getViewportSize();return{top:t.top,left:t.left,bottom:t.top+r,right:t.left+i,height:r,width:i}}getViewportScrollPosition(){if(!this._platform.isBrowser)return{top:0,left:0};const t=this._document,i=this._getWindow(),r=t.documentElement,s=r.getBoundingClientRect();return{top:-s.top||t.body.scrollTop||i.scrollY||r.scrollTop||0,left:-s.left||t.body.scrollLeft||i.scrollX||r.scrollLeft||0}}change(t=20){return t>0?this._change.pipe(aS(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 n.\u0275fac=function(t){return new(t||n)(I(si),I(dt),I(ut,8))},n.\u0275prov=ue({factory:function(){return new n(I(si),I(dt),I(ut,8))},token:n,providedIn:"root"}),n})(),Wv=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({}),n})(),Gj=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[Nv,Rv,Wv],Nv,Wv]}),n})();class qO{attach(e){return this._attachedHost=e,e.attach(this)}detach(){let e=this._attachedHost;null!=e&&(this._attachedHost=null,e.detach())}get isAttached(){return null!=this._attachedHost}setAttachedHost(e){this._attachedHost=e}}class dm extends qO{constructor(e,t,i,r){super(),this.component=e,this.viewContainerRef=t,this.injector=i,this.componentFactoryResolver=r}}class Xf extends qO{constructor(e,t,i){super(),this.templateRef=e,this.viewContainerRef=t,this.context=i}get origin(){return this.templateRef.elementRef}attach(e,t=this.context){return this.context=t,super.attach(e)}detach(){return this.context=void 0,super.detach()}}class fae extends qO{constructor(e){super(),this.element=e instanceof rt?e.nativeElement:e}}class uS{constructor(){this._isDisposed=!1,this.attachDomPortal=null}hasAttached(){return!!this._attachedPortal}attach(e){return e instanceof dm?(this._attachedPortal=e,this.attachComponentPortal(e)):e instanceof Xf?(this._attachedPortal=e,this.attachTemplatePortal(e)):this.attachDomPortal&&e instanceof fae?(this._attachedPortal=e,this.attachDomPortal(e)):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(e){this._disposeFn=e}_invokeDisposeFn(){this._disposeFn&&(this._disposeFn(),this._disposeFn=null)}}class pae extends uS{constructor(e,t,i,r,s){super(),this.outletElement=e,this._componentFactoryResolver=t,this._appRef=i,this._defaultInjector=r,this.attachDomPortal=o=>{const a=o.element,l=this._document.createComment("dom-portal");a.parentNode.insertBefore(l,a),this.outletElement.appendChild(a),this._attachedPortal=o,super.setDisposeFn(()=>{l.parentNode&&l.parentNode.replaceChild(a,l)})},this._document=s}attachComponentPortal(e){const i=(e.componentFactoryResolver||this._componentFactoryResolver).resolveComponentFactory(e.component);let r;return e.viewContainerRef?(r=e.viewContainerRef.createComponent(i,e.viewContainerRef.length,e.injector||e.viewContainerRef.injector),this.setDisposeFn(()=>r.destroy())):(r=i.create(e.injector||this._defaultInjector),this._appRef.attachView(r.hostView),this.setDisposeFn(()=>{this._appRef.detachView(r.hostView),r.destroy()})),this.outletElement.appendChild(this._getComponentRootNode(r)),this._attachedPortal=e,r}attachTemplatePortal(e){let t=e.viewContainerRef,i=t.createEmbeddedView(e.templateRef,e.context);return i.rootNodes.forEach(r=>this.outletElement.appendChild(r)),i.detectChanges(),this.setDisposeFn(()=>{let r=t.indexOf(i);-1!==r&&t.remove(r)}),this._attachedPortal=e,i}dispose(){super.dispose(),null!=this.outletElement.parentNode&&this.outletElement.parentNode.removeChild(this.outletElement)}_getComponentRootNode(e){return e.hostView.rootNodes[0]}}let Kf=(()=>{class n extends uS{constructor(t,i,r){super(),this._componentFactoryResolver=t,this._viewContainerRef=i,this._isInitialized=!1,this.attached=new Le,this.attachDomPortal=s=>{const o=s.element,a=this._document.createComment("dom-portal");s.setAttachedHost(this),o.parentNode.insertBefore(a,o),this._getRootNode().appendChild(o),this._attachedPortal=s,super.setDisposeFn(()=>{a.parentNode&&a.parentNode.replaceChild(o,a)})},this._document=r}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 i=null!=t.viewContainerRef?t.viewContainerRef:this._viewContainerRef,s=(t.componentFactoryResolver||this._componentFactoryResolver).resolveComponentFactory(t.component),o=i.createComponent(s,i.length,t.injector||i.injector);return i!==this._viewContainerRef&&this._getRootNode().appendChild(o.hostView.rootNodes[0]),super.setDisposeFn(()=>o.destroy()),this._attachedPortal=t,this._attachedRef=o,this.attached.emit(o),o}attachTemplatePortal(t){t.setAttachedHost(this);const i=this._viewContainerRef.createEmbeddedView(t.templateRef,t.context);return super.setDisposeFn(()=>this._viewContainerRef.clear()),this._attachedPortal=t,this._attachedRef=i,this.attached.emit(i),i}_getRootNode(){const t=this._viewContainerRef.element.nativeElement;return t.nodeType===t.ELEMENT_NODE?t:t.parentNode}}return n.\u0275fac=function(t){return new(t||n)(E(ll),E(ns),E(ut))},n.\u0275dir=oe({type:n,selectors:[["","cdkPortalOutlet",""]],inputs:{portal:["cdkPortalOutlet","portal"]},outputs:{attached:"attached"},exportAs:["cdkPortalOutlet"],features:[ct]}),n})(),dS=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({}),n})();function qj(n,e=!1){return t=>t.lift(new gae(n,e))}class gae{constructor(e,t){this.predicate=e,this.inclusive=t}call(e,t){return t.subscribe(new mae(e,this.predicate,this.inclusive))}}class mae extends xt{constructor(e,t,i){super(e),this.predicate=t,this.inclusive=i,this.index=0}_next(e){const t=this.destination;let i;try{i=this.predicate(e,this.index++)}catch(r){return void t.error(r)}this.nextOrComplete(e,i)}nextOrComplete(e,t){const i=this.destination;Boolean(t)?i.next(e):(this.inclusive&&i.next(e),i.complete())}}const Yj=TV();class _ae{constructor(e,t){this._viewportRuler=e,this._previousHTMLStyles={top:"",left:""},this._isEnabled=!1,this._document=t}attach(){}enable(){if(this._canBeEnabled()){const e=this._document.documentElement;this._previousScrollPosition=this._viewportRuler.getViewportScrollPosition(),this._previousHTMLStyles.left=e.style.left||"",this._previousHTMLStyles.top=e.style.top||"",e.style.left=jr(-this._previousScrollPosition.left),e.style.top=jr(-this._previousScrollPosition.top),e.classList.add("cdk-global-scrollblock"),this._isEnabled=!0}}disable(){if(this._isEnabled){const e=this._document.documentElement,i=e.style,r=this._document.body.style,s=i.scrollBehavior||"",o=r.scrollBehavior||"";this._isEnabled=!1,i.left=this._previousHTMLStyles.left,i.top=this._previousHTMLStyles.top,e.classList.remove("cdk-global-scrollblock"),Yj&&(i.scrollBehavior=r.scrollBehavior="auto"),window.scroll(this._previousScrollPosition.left,this._previousScrollPosition.top),Yj&&(i.scrollBehavior=s,r.scrollBehavior=o)}}_canBeEnabled(){if(this._document.documentElement.classList.contains("cdk-global-scrollblock")||this._isEnabled)return!1;const t=this._document.body,i=this._viewportRuler.getViewportSize();return t.scrollHeight>i.height||t.scrollWidth>i.width}}class yae{constructor(e,t,i,r){this._scrollDispatcher=e,this._ngZone=t,this._viewportRuler=i,this._config=r,this._scrollSubscription=null,this._detach=()=>{this.disable(),this._overlayRef.hasAttached()&&this._ngZone.run(()=>this._overlayRef.detach())}}attach(e){this._overlayRef=e}enable(){if(this._scrollSubscription)return;const e=this._scrollDispatcher.scrolled(0);this._config&&this._config.threshold&&this._config.threshold>1?(this._initialScrollPosition=this._viewportRuler.getViewportScrollPosition().top,this._scrollSubscription=e.subscribe(()=>{const t=this._viewportRuler.getViewportScrollPosition().top;Math.abs(t-this._initialScrollPosition)>this._config.threshold?this._detach():this._overlayRef.updatePosition()})):this._scrollSubscription=e.subscribe(this._detach)}disable(){this._scrollSubscription&&(this._scrollSubscription.unsubscribe(),this._scrollSubscription=null)}detach(){this.disable(),this._overlayRef=null}}class Xj{enable(){}disable(){}attach(){}}function YO(n,e){return e.some(t=>n.bottomt.bottom||n.rightt.right)}function Kj(n,e){return e.some(t=>n.topt.bottom||n.leftt.right)}class vae{constructor(e,t,i,r){this._scrollDispatcher=e,this._viewportRuler=t,this._ngZone=i,this._config=r,this._scrollSubscription=null}attach(e){this._overlayRef=e}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:i,height:r}=this._viewportRuler.getViewportSize();YO(t,[{width:i,height:r,bottom:r,right:i,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 bae=(()=>{class n{constructor(t,i,r,s){this._scrollDispatcher=t,this._viewportRuler=i,this._ngZone=r,this.noop=()=>new Xj,this.close=o=>new yae(this._scrollDispatcher,this._ngZone,this._viewportRuler,o),this.block=()=>new _ae(this._viewportRuler,this._document),this.reposition=o=>new vae(this._scrollDispatcher,this._viewportRuler,this._ngZone,o),this._document=s}}return n.\u0275fac=function(t){return new(t||n)(I(um),I(Yf),I(dt),I(ut))},n.\u0275prov=ue({factory:function(){return new n(I(um),I(Yf),I(dt),I(ut))},token:n,providedIn:"root"}),n})();class qv{constructor(e){if(this.scrollStrategy=new Xj,this.panelClass="",this.hasBackdrop=!1,this.backdropClass="cdk-overlay-dark-backdrop",this.disposeOnNavigation=!1,e){const t=Object.keys(e);for(const i of t)void 0!==e[i]&&(this[i]=e[i])}}}class Cae{constructor(e,t,i,r,s){this.offsetX=i,this.offsetY=r,this.panelClass=s,this.originX=e.originX,this.originY=e.originY,this.overlayX=t.overlayX,this.overlayY=t.overlayY}}class wae{constructor(e,t){this.connectionPair=e,this.scrollableViewProperties=t}}let Zj=(()=>{class n{constructor(t){this._attachedOverlays=[],this._document=t}ngOnDestroy(){this.detach()}add(t){this.remove(t),this._attachedOverlays.push(t)}remove(t){const i=this._attachedOverlays.indexOf(t);i>-1&&this._attachedOverlays.splice(i,1),0===this._attachedOverlays.length&&this.detach()}}return n.\u0275fac=function(t){return new(t||n)(I(ut))},n.\u0275prov=ue({factory:function(){return new n(I(ut))},token:n,providedIn:"root"}),n})(),Eae=(()=>{class n extends Zj{constructor(t){super(t),this._keydownListener=i=>{const r=this._attachedOverlays;for(let s=r.length-1;s>-1;s--)if(r[s]._keydownEvents.observers.length>0){r[s]._keydownEvents.next(i);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 n.\u0275fac=function(t){return new(t||n)(I(ut))},n.\u0275prov=ue({factory:function(){return new n(I(ut))},token:n,providedIn:"root"}),n})(),Sae=(()=>{class n extends Zj{constructor(t,i){super(t),this._platform=i,this._cursorStyleIsSet=!1,this._clickListener=r=>{const s=Nf(r),o=this._attachedOverlays.slice();for(let a=o.length-1;a>-1;a--){const l=o[a];if(!(l._outsidePointerEvents.observers.length<1)&&l.hasAttached()){if(l.overlayElement.contains(s))break;l._outsidePointerEvents.next(r)}}}}add(t){if(super.add(t),!this._isAttached){const i=this._document.body;i.addEventListener("click",this._clickListener,!0),i.addEventListener("auxclick",this._clickListener,!0),i.addEventListener("contextmenu",this._clickListener,!0),this._platform.IOS&&!this._cursorStyleIsSet&&(this._cursorOriginalValue=i.style.cursor,i.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 n.\u0275fac=function(t){return new(t||n)(I(ut),I(si))},n.\u0275prov=ue({factory:function(){return new n(I(ut),I(si))},token:n,providedIn:"root"}),n})();const ah="undefined"!=typeof window?window:{},Qj=void 0!==ah.__karma__&&!!ah.__karma__||void 0!==ah.jasmine&&!!ah.jasmine||void 0!==ah.jest&&!!ah.jest||void 0!==ah.Mocha&&!!ah.Mocha;let hm=(()=>{class n{constructor(t,i){this._platform=i,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||Qj){const r=this._document.querySelectorAll(`.${t}[platform="server"], .${t}[platform="test"]`);for(let s=0;sthis._backdropClick.next(d),this._keydownEvents=new Se,this._outsidePointerEvents=new Se,r.scrollStrategy&&(this._scrollStrategy=r.scrollStrategy,this._scrollStrategy.attach(this)),this._positionStrategy=r.positionStrategy}get overlayElement(){return this._pane}get backdropElement(){return this._backdropElement}get hostElement(){return this._host}attach(e){let t=this._portalOutlet.attach(e);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(yi(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),t}detach(){if(!this.hasAttached())return;this.detachBackdrop(),this._togglePointerEvents(!1),this._positionStrategy&&this._positionStrategy.detach&&this._positionStrategy.detach(),this._scrollStrategy&&this._scrollStrategy.disable();const e=this._portalOutlet.detach();return this._detachments.next(),this._keyboardDispatcher.remove(this),this._detachContentWhenStable(),this._locationChanges.unsubscribe(),this._outsideClickDispatcher.remove(this),e}dispose(){const e=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,e&&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(e){e!==this._positionStrategy&&(this._positionStrategy&&this._positionStrategy.dispose(),this._positionStrategy=e,this.hasAttached()&&(e.attach(this),this.updatePosition()))}updateSize(e){this._config=Object.assign(Object.assign({},this._config),e),this._updateElementSize()}setDirection(e){this._config=Object.assign(Object.assign({},this._config),{direction:e}),this._updateElementDirection()}addPanelClass(e){this._pane&&this._toggleClasses(this._pane,e,!0)}removePanelClass(e){this._pane&&this._toggleClasses(this._pane,e,!1)}getDirection(){const e=this._config.direction;return e?"string"==typeof e?e:e.value:"ltr"}updateScrollStrategy(e){e!==this._scrollStrategy&&(this._disposeScrollStrategy(),this._scrollStrategy=e,this.hasAttached()&&(e.attach(this),e.enable()))}_updateElementDirection(){this._host.setAttribute("dir",this.getDirection())}_updateElementSize(){if(!this._pane)return;const e=this._pane.style;e.width=jr(this._config.width),e.height=jr(this._config.height),e.minWidth=jr(this._config.minWidth),e.minHeight=jr(this._config.minHeight),e.maxWidth=jr(this._config.maxWidth),e.maxHeight=jr(this._config.maxHeight)}_togglePointerEvents(e){this._pane.style.pointerEvents=e?"":"none"}_attachBackdrop(){const e="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(e)})}):this._backdropElement.classList.add(e)}_updateStackingOrder(){this._host.nextSibling&&this._host.parentNode.appendChild(this._host)}detachBackdrop(){let e=this._backdropElement;if(!e)return;let t,i=()=>{e&&(e.removeEventListener("click",this._backdropClickHandler),e.removeEventListener("transitionend",i),e.parentNode&&e.parentNode.removeChild(e)),this._backdropElement==e&&(this._backdropElement=null),this._config.backdropClass&&this._toggleClasses(e,this._config.backdropClass,!1),clearTimeout(t)};e.classList.remove("cdk-overlay-backdrop-showing"),this._ngZone.runOutsideAngular(()=>{e.addEventListener("transitionend",i)}),e.style.pointerEvents="none",t=this._ngZone.runOutsideAngular(()=>setTimeout(i,500))}_toggleClasses(e,t,i){const r=e.classList;EE(t).forEach(s=>{s&&(i?r.add(s):r.remove(s))})}_detachContentWhenStable(){this._ngZone.runOutsideAngular(()=>{const e=this._ngZone.onStable.pipe(Tn(Ni(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)),e.unsubscribe())})})}_disposeScrollStrategy(){const e=this._scrollStrategy;e&&(e.disable(),e.detach&&e.detach())}}const Jj="cdk-overlay-connected-position-bounding-box",xae=/([A-Za-z%]+)$/;class eU{constructor(e,t,i,r,s){this._viewportRuler=t,this._document=i,this._platform=r,this._overlayContainer=s,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 Se,this._resizeSubscription=Te.EMPTY,this._offsetX=0,this._offsetY=0,this._appliedPanelClasses=[],this.positionChanges=this._positionChanges,this.setOrigin(e)}get positions(){return this._preferredPositions}attach(e){this._validatePositions(),e.hostElement.classList.add(Jj),this._overlayRef=e,this._boundingBox=e.hostElement,this._pane=e.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 e=this._originRect,t=this._overlayRect,i=this._viewportRect,r=[];let s;for(let o of this._preferredPositions){let a=this._getOriginPoint(e,o),l=this._getOverlayPoint(a,t,o),c=this._getOverlayFit(l,t,i,o);if(c.isCompletelyWithinViewport)return this._isPushed=!1,void this._applyPosition(o,a);this._canFitWithFlexibleDimensions(c,l,i)?r.push({position:o,origin:a,overlayRect:t,boundingBoxRect:this._calculateBoundingBoxRect(a,o)}):(!s||s.overlayFit.visibleAreaa&&(a=c,o=l)}return this._isPushed=!1,void this._applyPosition(o.position,o.origin)}if(this._canPush)return this._isPushed=!0,void this._applyPosition(s.position,s.originPoint);this._applyPosition(s.position,s.originPoint)}detach(){this._clearPanelClasses(),this._lastPosition=null,this._previousPushAmount=null,this._resizeSubscription.unsubscribe()}dispose(){this._isDisposed||(this._boundingBox&&Zf(this._boundingBox.style,{top:"",left:"",right:"",bottom:"",height:"",width:"",alignItems:"",justifyContent:""}),this._pane&&this._resetOverlayElementStyles(),this._overlayRef&&this._overlayRef.hostElement.classList.remove(Jj),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 e=this._lastPosition||this._preferredPositions[0],t=this._getOriginPoint(this._originRect,e);this._applyPosition(e,t)}}withScrollableContainers(e){return this._scrollables=e,this}withPositions(e){return this._preferredPositions=e,-1===e.indexOf(this._lastPosition)&&(this._lastPosition=null),this._validatePositions(),this}withViewportMargin(e){return this._viewportMargin=e,this}withFlexibleDimensions(e=!0){return this._hasFlexibleDimensions=e,this}withGrowAfterOpen(e=!0){return this._growAfterOpen=e,this}withPush(e=!0){return this._canPush=e,this}withLockedPosition(e=!0){return this._positionLocked=e,this}setOrigin(e){return this._origin=e,this}withDefaultOffsetX(e){return this._offsetX=e,this}withDefaultOffsetY(e){return this._offsetY=e,this}withTransformOriginOn(e){return this._transformOriginSelector=e,this}_getOriginPoint(e,t){let i,r;if("center"==t.originX)i=e.left+e.width/2;else{const s=this._isRtl()?e.right:e.left,o=this._isRtl()?e.left:e.right;i="start"==t.originX?s:o}return r="center"==t.originY?e.top+e.height/2:"top"==t.originY?e.top:e.bottom,{x:i,y:r}}_getOverlayPoint(e,t,i){let r,s;return r="center"==i.overlayX?-t.width/2:"start"===i.overlayX?this._isRtl()?-t.width:0:this._isRtl()?0:-t.width,s="center"==i.overlayY?-t.height/2:"top"==i.overlayY?0:-t.height,{x:e.x+r,y:e.y+s}}_getOverlayFit(e,t,i,r){const s=nU(t);let{x:o,y:a}=e,l=this._getOffset(r,"x"),c=this._getOffset(r,"y");l&&(o+=l),c&&(a+=c);let p=0-a,g=a+s.height-i.height,_=this._subtractOverflows(s.width,0-o,o+s.width-i.width),y=this._subtractOverflows(s.height,p,g),v=_*y;return{visibleArea:v,isCompletelyWithinViewport:s.width*s.height===v,fitsInViewportVertically:y===s.height,fitsInViewportHorizontally:_==s.width}}_canFitWithFlexibleDimensions(e,t,i){if(this._hasFlexibleDimensions){const r=i.bottom-t.y,s=i.right-t.x,o=tU(this._overlayRef.getConfig().minHeight),a=tU(this._overlayRef.getConfig().minWidth),c=e.fitsInViewportHorizontally||null!=a&&a<=s;return(e.fitsInViewportVertically||null!=o&&o<=r)&&c}return!1}_pushOverlayOnScreen(e,t,i){if(this._previousPushAmount&&this._positionLocked)return{x:e.x+this._previousPushAmount.x,y:e.y+this._previousPushAmount.y};const r=nU(t),s=this._viewportRect,o=Math.max(e.x+r.width-s.width,0),a=Math.max(e.y+r.height-s.height,0),l=Math.max(s.top-i.top-e.y,0),c=Math.max(s.left-i.left-e.x,0);let d=0,f=0;return d=r.width<=s.width?c||-o:e.x_&&!this._isInitialRender&&!this._growAfterOpen&&(o=e.y-_/2)}if("end"===t.overlayX&&!r||"start"===t.overlayX&&r)p=i.width-e.x+this._viewportMargin,d=e.x-this._viewportMargin;else if("start"===t.overlayX&&!r||"end"===t.overlayX&&r)f=e.x,d=i.right-e.x;else{const g=Math.min(i.right-e.x+i.left,e.x),_=this._lastBoundingBoxSize.width;d=2*g,f=e.x-g,d>_&&!this._isInitialRender&&!this._growAfterOpen&&(f=e.x-_/2)}return{top:o,left:f,bottom:a,right:p,width:d,height:s}}_setBoundingBoxStyles(e,t){const i=this._calculateBoundingBoxRect(e,t);!this._isInitialRender&&!this._growAfterOpen&&(i.height=Math.min(i.height,this._lastBoundingBoxSize.height),i.width=Math.min(i.width,this._lastBoundingBoxSize.width));const r={};if(this._hasExactPosition())r.top=r.left="0",r.bottom=r.right=r.maxHeight=r.maxWidth="",r.width=r.height="100%";else{const s=this._overlayRef.getConfig().maxHeight,o=this._overlayRef.getConfig().maxWidth;r.height=jr(i.height),r.top=jr(i.top),r.bottom=jr(i.bottom),r.width=jr(i.width),r.left=jr(i.left),r.right=jr(i.right),r.alignItems="center"===t.overlayX?"center":"end"===t.overlayX?"flex-end":"flex-start",r.justifyContent="center"===t.overlayY?"center":"bottom"===t.overlayY?"flex-end":"flex-start",s&&(r.maxHeight=jr(s)),o&&(r.maxWidth=jr(o))}this._lastBoundingBoxSize=i,Zf(this._boundingBox.style,r)}_resetBoundingBoxStyles(){Zf(this._boundingBox.style,{top:"0",left:"0",right:"0",bottom:"0",height:"",width:"",alignItems:"",justifyContent:""})}_resetOverlayElementStyles(){Zf(this._pane.style,{top:"",left:"",bottom:"",right:"",position:"",transform:""})}_setOverlayElementStyles(e,t){const i={},r=this._hasExactPosition(),s=this._hasFlexibleDimensions,o=this._overlayRef.getConfig();if(r){const d=this._viewportRuler.getViewportScrollPosition();Zf(i,this._getExactOverlayY(t,e,d)),Zf(i,this._getExactOverlayX(t,e,d))}else i.position="static";let a="",l=this._getOffset(t,"x"),c=this._getOffset(t,"y");l&&(a+=`translateX(${l}px) `),c&&(a+=`translateY(${c}px)`),i.transform=a.trim(),o.maxHeight&&(r?i.maxHeight=jr(o.maxHeight):s&&(i.maxHeight="")),o.maxWidth&&(r?i.maxWidth=jr(o.maxWidth):s&&(i.maxWidth="")),Zf(this._pane.style,i)}_getExactOverlayY(e,t,i){let r={top:"",bottom:""},s=this._getOverlayPoint(t,this._overlayRect,e);this._isPushed&&(s=this._pushOverlayOnScreen(s,this._overlayRect,i));let o=this._overlayContainer.getContainerElement().getBoundingClientRect().top;return s.y-=o,"bottom"===e.overlayY?r.bottom=this._document.documentElement.clientHeight-(s.y+this._overlayRect.height)+"px":r.top=jr(s.y),r}_getExactOverlayX(e,t,i){let o,r={left:"",right:""},s=this._getOverlayPoint(t,this._overlayRect,e);return this._isPushed&&(s=this._pushOverlayOnScreen(s,this._overlayRect,i)),o=this._isRtl()?"end"===e.overlayX?"left":"right":"end"===e.overlayX?"right":"left","right"===o?r.right=this._document.documentElement.clientWidth-(s.x+this._overlayRect.width)+"px":r.left=jr(s.x),r}_getScrollVisibility(){const e=this._getOriginRect(),t=this._pane.getBoundingClientRect(),i=this._scrollables.map(r=>r.getElementRef().nativeElement.getBoundingClientRect());return{isOriginClipped:Kj(e,i),isOriginOutsideView:YO(e,i),isOverlayClipped:Kj(t,i),isOverlayOutsideView:YO(t,i)}}_subtractOverflows(e,...t){return t.reduce((i,r)=>i-Math.max(r,0),e)}_getNarrowedViewportRect(){const e=this._document.documentElement.clientWidth,t=this._document.documentElement.clientHeight,i=this._viewportRuler.getViewportScrollPosition();return{top:i.top+this._viewportMargin,left:i.left+this._viewportMargin,right:i.left+e-this._viewportMargin,bottom:i.top+t-this._viewportMargin,width:e-2*this._viewportMargin,height:t-2*this._viewportMargin}}_isRtl(){return"rtl"===this._overlayRef.getDirection()}_hasExactPosition(){return!this._hasFlexibleDimensions||this._isPushed}_getOffset(e,t){return"x"===t?null==e.offsetX?this._offsetX:e.offsetX:null==e.offsetY?this._offsetY:e.offsetY}_validatePositions(){}_addPanelClasses(e){this._pane&&EE(e).forEach(t=>{""!==t&&-1===this._appliedPanelClasses.indexOf(t)&&(this._appliedPanelClasses.push(t),this._pane.classList.add(t))})}_clearPanelClasses(){this._pane&&(this._appliedPanelClasses.forEach(e=>{this._pane.classList.remove(e)}),this._appliedPanelClasses=[])}_getOriginRect(){const e=this._origin;if(e instanceof rt)return e.nativeElement.getBoundingClientRect();if(e instanceof Element)return e.getBoundingClientRect();const t=e.width||0,i=e.height||0;return{top:e.y,bottom:e.y+i,left:e.x,right:e.x+t,height:i,width:t}}}function Zf(n,e){for(let t in e)e.hasOwnProperty(t)&&(n[t]=e[t]);return n}function tU(n){if("number"!=typeof n&&null!=n){const[e,t]=n.split(xae);return t&&"px"!==t?null:parseFloat(e)}return n||null}function nU(n){return{top:Math.floor(n.top),right:Math.floor(n.right),bottom:Math.floor(n.bottom),left:Math.floor(n.left),width:Math.floor(n.width),height:Math.floor(n.height)}}class Tae{constructor(e,t,i,r,s,o,a){this._preferredPositions=[],this._positionStrategy=new eU(i,r,s,o,a).withFlexibleDimensions(!1).withPush(!1).withViewportMargin(0),this.withFallbackPosition(e,t),this.onPositionChange=this._positionStrategy.positionChanges}get positions(){return this._preferredPositions}attach(e){this._overlayRef=e,this._positionStrategy.attach(e),this._direction&&(e.setDirection(this._direction),this._direction=null)}dispose(){this._positionStrategy.dispose()}detach(){this._positionStrategy.detach()}apply(){this._positionStrategy.apply()}recalculateLastPosition(){this._positionStrategy.reapplyLastPosition()}withScrollableContainers(e){this._positionStrategy.withScrollableContainers(e)}withFallbackPosition(e,t,i,r){const s=new Cae(e,t,i,r);return this._preferredPositions.push(s),this._positionStrategy.withPositions(this._preferredPositions),this}withDirection(e){return this._overlayRef?this._overlayRef.setDirection(e):this._direction=e,this}withOffsetX(e){return this._positionStrategy.withDefaultOffsetX(e),this}withOffsetY(e){return this._positionStrategy.withDefaultOffsetY(e),this}withLockedPosition(e){return this._positionStrategy.withLockedPosition(e),this}withPositions(e){return this._preferredPositions=e.slice(),this._positionStrategy.withPositions(this._preferredPositions),this}setOrigin(e){return this._positionStrategy.setOrigin(e),this}}const iU="cdk-global-overlay-wrapper";class Aae{constructor(){this._cssPosition="static",this._topOffset="",this._bottomOffset="",this._leftOffset="",this._rightOffset="",this._alignItems="",this._justifyContent="",this._width="",this._height=""}attach(e){const t=e.getConfig();this._overlayRef=e,this._width&&!t.width&&e.updateSize({width:this._width}),this._height&&!t.height&&e.updateSize({height:this._height}),e.hostElement.classList.add(iU),this._isDisposed=!1}top(e=""){return this._bottomOffset="",this._topOffset=e,this._alignItems="flex-start",this}left(e=""){return this._rightOffset="",this._leftOffset=e,this._justifyContent="flex-start",this}bottom(e=""){return this._topOffset="",this._bottomOffset=e,this._alignItems="flex-end",this}right(e=""){return this._leftOffset="",this._rightOffset=e,this._justifyContent="flex-end",this}width(e=""){return this._overlayRef?this._overlayRef.updateSize({width:e}):this._width=e,this}height(e=""){return this._overlayRef?this._overlayRef.updateSize({height:e}):this._height=e,this}centerHorizontally(e=""){return this.left(e),this._justifyContent="center",this}centerVertically(e=""){return this.top(e),this._alignItems="center",this}apply(){if(!this._overlayRef||!this._overlayRef.hasAttached())return;const e=this._overlayRef.overlayElement.style,t=this._overlayRef.hostElement.style,i=this._overlayRef.getConfig(),{width:r,height:s,maxWidth:o,maxHeight:a}=i,l=!("100%"!==r&&"100vw"!==r||o&&"100%"!==o&&"100vw"!==o),c=!("100%"!==s&&"100vh"!==s||a&&"100%"!==a&&"100vh"!==a);e.position=this._cssPosition,e.marginLeft=l?"0":this._leftOffset,e.marginTop=c?"0":this._topOffset,e.marginBottom=this._bottomOffset,e.marginRight=this._rightOffset,l?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=c?"flex-start":this._alignItems}dispose(){if(this._isDisposed||!this._overlayRef)return;const e=this._overlayRef.overlayElement.style,t=this._overlayRef.hostElement,i=t.style;t.classList.remove(iU),i.justifyContent=i.alignItems=e.marginTop=e.marginBottom=e.marginLeft=e.marginRight=e.position="",this._overlayRef=null,this._isDisposed=!0}}let Dae=(()=>{class n{constructor(t,i,r,s){this._viewportRuler=t,this._document=i,this._platform=r,this._overlayContainer=s}global(){return new Aae}connectedTo(t,i,r){return new Tae(i,r,t,this._viewportRuler,this._document,this._platform,this._overlayContainer)}flexibleConnectedTo(t){return new eU(t,this._viewportRuler,this._document,this._platform,this._overlayContainer)}}return n.\u0275fac=function(t){return new(t||n)(I(Yf),I(ut),I(si),I(hm))},n.\u0275prov=ue({factory:function(){return new n(I(Yf),I(ut),I(si),I(hm))},token:n,providedIn:"root"}),n})(),Oae=0,Jo=(()=>{class n{constructor(t,i,r,s,o,a,l,c,d,f,p){this.scrollStrategies=t,this._overlayContainer=i,this._componentFactoryResolver=r,this._positionBuilder=s,this._keyboardDispatcher=o,this._injector=a,this._ngZone=l,this._document=c,this._directionality=d,this._location=f,this._outsideClickDispatcher=p}create(t){const i=this._createHostElement(),r=this._createPaneElement(i),s=this._createPortalOutlet(r),o=new qv(t);return o.direction=o.direction||this._directionality.value,new Mae(s,i,r,o,this._ngZone,this._keyboardDispatcher,this._document,this._location,this._outsideClickDispatcher)}position(){return this._positionBuilder}_createPaneElement(t){const i=this._document.createElement("div");return i.id="cdk-overlay-"+Oae++,i.classList.add("cdk-overlay-pane"),t.appendChild(i),i}_createHostElement(){const t=this._document.createElement("div");return this._overlayContainer.getContainerElement().appendChild(t),t}_createPortalOutlet(t){return this._appRef||(this._appRef=this._injector.get(Jd)),new pae(t,this._componentFactoryResolver,this._appRef,this._injector,this._document)}}return n.\u0275fac=function(t){return new(t||n)(I(bae),I(hm),I(ll),I(Dae),I(Eae),I(Nt),I(dt),I(ut),I(Qo),I(Xg),I(Sae))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();const Iae=[{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"}],rU=new ve("cdk-connected-overlay-scroll-strategy");let Pae=(()=>{class n{constructor(t){this.elementRef=t}}return n.\u0275fac=function(t){return new(t||n)(E(rt))},n.\u0275dir=oe({type:n,selectors:[["","cdk-overlay-origin",""],["","overlay-origin",""],["","cdkOverlayOrigin",""]],exportAs:["cdkOverlayOrigin"]}),n})(),sU=(()=>{class n{constructor(t,i,r,s,o){this._overlay=t,this._dir=o,this._hasBackdrop=!1,this._lockPosition=!1,this._growAfterOpen=!1,this._flexibleDimensions=!1,this._push=!1,this._backdropSubscription=Te.EMPTY,this._attachSubscription=Te.EMPTY,this._detachSubscription=Te.EMPTY,this._positionSubscription=Te.EMPTY,this.viewportMargin=0,this.open=!1,this.disableClose=!1,this.backdropClick=new Le,this.positionChange=new Le,this.attach=new Le,this.detach=new Le,this.overlayKeydown=new Le,this.overlayOutsideClick=new Le,this._templatePortal=new Xf(i,r),this._scrollStrategyFactory=s,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=Mt(t)}get lockPosition(){return this._lockPosition}set lockPosition(t){this._lockPosition=Mt(t)}get flexibleDimensions(){return this._flexibleDimensions}set flexibleDimensions(t){this._flexibleDimensions=Mt(t)}get growAfterOpen(){return this._growAfterOpen}set growAfterOpen(t){this._growAfterOpen=Mt(t)}get push(){return this._push}set push(t){this._push=Mt(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=Iae);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(i=>{this.overlayKeydown.next(i),27===i.keyCode&&!this.disableClose&&!Zs(i)&&(i.preventDefault(),this._detachOverlay())}),this._overlayRef.outsidePointerEvents().subscribe(i=>{this.overlayOutsideClick.next(i)})}_buildConfig(){const t=this._position=this.positionStrategy||this._createPositionStrategy(),i=new qv({direction:this._dir,positionStrategy:t,scrollStrategy:this.scrollStrategy,hasBackdrop:this.hasBackdrop});return(this.width||0===this.width)&&(i.width=this.width),(this.height||0===this.height)&&(i.height=this.height),(this.minWidth||0===this.minWidth)&&(i.minWidth=this.minWidth),(this.minHeight||0===this.minHeight)&&(i.minHeight=this.minHeight),this.backdropClass&&(i.backdropClass=this.backdropClass),this.panelClass&&(i.panelClass=this.panelClass),i}_updatePositionStrategy(t){const i=this.positions.map(r=>({originX:r.originX,originY:r.originY,overlayX:r.overlayX,overlayY:r.overlayY,offsetX:r.offsetX||this.offsetX,offsetY:r.offsetY||this.offsetY,panelClass:r.panelClass||void 0}));return t.setOrigin(this.origin.elementRef).withPositions(i).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(qj(()=>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 n.\u0275fac=function(t){return new(t||n)(E(Jo),E(Ys),E(ns),E(rU),E(Qo,8))},n.\u0275dir=oe({type:n,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:[zn]}),n})();const kae={provide:rU,deps:[Jo],useFactory:function(n){return()=>n.scrollStrategies.reposition()}};let Yv=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({providers:[Jo,kae],imports:[[Nv,dS,Gj],Gj]}),n})();const oU=["mat-button",""],aU=["*"],Nae=["mat-button","mat-flat-button","mat-icon-button","mat-raised-button","mat-stroked-button","mat-mini-fab","mat-fab"],Lae=Uf(jf(nc(class{constructor(n){this._elementRef=n}})));let lh=(()=>{class n extends Lae{constructor(t,i,r){super(t),this._focusMonitor=i,this._animationMode=r,this.isRoundButton=this._hasHostAttributes("mat-fab","mat-mini-fab"),this.isIconButton=this._hasHostAttributes("mat-icon-button");for(const s of Nae)this._hasHostAttributes(s)&&this._getHostElement().classList.add(s);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,i){t?this._focusMonitor.focusVia(this._getHostElement(),t,i):this._getHostElement().focus(i)}_getHostElement(){return this._elementRef.nativeElement}_isRippleDisabled(){return this.disableRipple||this.disabled}_hasHostAttributes(...t){return t.some(i=>this._getHostElement().hasAttribute(i))}}return n.\u0275fac=function(t){return new(t||n)(E(rt),E(Sa),E(Do,8))},n.\u0275cmp=Ne({type:n,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,i){if(1&t&&Jn(Js,5),2&t){let r;_t(r=yt())&&(i.ripple=r.first)}},hostAttrs:[1,"mat-focus-indicator"],hostVars:5,hostBindings:function(t,i){2&t&&(nn("disabled",i.disabled||null),st("_mat-animation-noopable","NoopAnimations"===i._animationMode)("mat-button-disabled",i.disabled))},inputs:{disabled:"disabled",disableRipple:"disableRipple",color:"color"},exportAs:["matButton"],features:[ct],attrs:oU,ngContentSelectors:aU,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,i){1&t&&(wi(),R(0,"span",0),Ht(1),k(),tt(2,"span",1),tt(3,"span",2)),2&t&&(G(2),st("mat-button-ripple-round",i.isRoundButton||i.isIconButton),ie("matRippleDisabled",i._isRippleDisabled())("matRippleCentered",i.isIconButton)("matRippleTrigger",i._getHostElement()))},directives:[Js],styles:[".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"],encapsulation:2,changeDetection:0}),n})(),ch=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[_l,On],On]}),n})();class cU extends xt{notifyNext(e,t,i,r,s){this.destination.next(t)}notifyError(e,t){this.destination.error(e)}notifyComplete(e){this.destination.complete()}}class Bae extends xt{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 uU(n,e,t,i,r=new Bae(n,t,i)){if(!r.closed)return e instanceof ce?e.subscribe(r):ki(e)(r)}const dU={};function Qi(...n){let e,t;return Gn(n[n.length-1])&&(t=n.pop()),"function"==typeof n[n.length-1]&&(e=n.pop()),1===n.length&&we(n[0])&&(n=n[0]),za(n,t).lift(new hU(e))}class hU{constructor(e){this.resultSelector=e}call(e,t){return t.subscribe(new Vae(e,this.resultSelector))}}class Vae extends cU{constructor(e,t){super(e),this.resultSelector=t,this.active=0,this.values=[],this.observables=[]}_next(e){this.values.push(dU),this.observables.push(e)}_complete(){const e=this.observables,t=e.length;if(0===t)this.destination.complete();else{this.active=t,this.toRespond=t;for(let i=0;i{class n{constructor(t){this._platform=t,this._matchMedia=this._platform.isBrowser&&window.matchMedia?window.matchMedia.bind(window):jae}matchMedia(t){return this._platform.WEBKIT&&function(n){if(!fU.has(n))try{fm||(fm=document.createElement("style"),fm.setAttribute("type","text/css"),document.head.appendChild(fm)),fm.sheet&&(fm.sheet.insertRule(`@media ${n} {.fx-query-test{ }}`,0),fU.add(n))}catch(e){console.error(e)}}(t),this._matchMedia(t)}}return n.\u0275fac=function(t){return new(t||n)(I(si))},n.\u0275prov=ue({factory:function(){return new n(I(si))},token:n,providedIn:"root"}),n})();function jae(n){return{matches:"all"===n||""===n,media:n,addListener:()=>{},removeListener:()=>{}}}let XO=(()=>{class n{constructor(t,i){this._mediaMatcher=t,this._zone=i,this._queries=new Map,this._destroySubject=new Se}ngOnDestroy(){this._destroySubject.next(),this._destroySubject.complete()}isMatched(t){return gU(EE(t)).some(r=>this._registerQuery(r).mql.matches)}observe(t){let s=Qi(gU(EE(t)).map(o=>this._registerQuery(o).observable));return s=IE(s.pipe(yi(1)),s.pipe(QD(1),Zg(0))),s.pipe(Ae(o=>{const a={matches:!1,breakpoints:{}};return o.forEach(({matches:l,query:c})=>{a.matches=a.matches||l,a.breakpoints[c]=l}),a}))}_registerQuery(t){if(this._queries.has(t))return this._queries.get(t);const i=this._mediaMatcher.matchMedia(t),s={observable:new ce(o=>{const a=l=>this._zone.run(()=>o.next(l));return i.addListener(a),()=>{i.removeListener(a)}}).pipe(Rr(i),Ae(({matches:o})=>({query:t,matches:o})),Tn(this._destroySubject)),mql:i};return this._queries.set(t,s),s}}return n.\u0275fac=function(t){return new(t||n)(I(pU),I(dt))},n.\u0275prov=ue({factory:function(){return new n(I(pU),I(dt))},token:n,providedIn:"root"}),n})();function gU(n){return n.map(e=>e.split(",")).reduce((e,t)=>e.concat(t)).map(e=>e.trim())}function Uae(n,e){if(1&n){const t=Zi();R(0,"div",1),R(1,"button",2),ge("click",function(){return en(t),Qe().action()}),De(2),k(),k()}if(2&n){const t=Qe();G(2),xi(t.data.action)}}function Hae(n,e){}const KO=new ve("MatSnackBarData");class hS{constructor(){this.politeness="assertive",this.announcementMessage="",this.duration=0,this.data=null,this.horizontalPosition="center",this.verticalPosition="bottom"}}const $ae=Math.pow(2,31)-1;class ZO{constructor(e,t){this._overlayRef=t,this._afterDismissed=new Se,this._afterOpened=new Se,this._onAction=new Se,this._dismissedByAction=!1,this.containerInstance=e,this.onAction().subscribe(()=>this.dismiss()),e._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(e){this._durationTimeoutId=setTimeout(()=>this.dismiss(),Math.min(e,$ae))}_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 Gae=(()=>{class n{constructor(t,i){this.snackBarRef=t,this.data=i}action(){this.snackBarRef.dismissWithAction()}get hasAction(){return!!this.data.action}}return n.\u0275fac=function(t){return new(t||n)(E(ZO),E(KO))},n.\u0275cmp=Ne({type:n,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,i){1&t&&(R(0,"span"),De(1),k(),mt(2,Uae,3,1,"div",0)),2&t&&(G(1),xi(i.data.message),G(1),ie("ngIf",i.hasAction))},directives:[zr,lh],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}),n})();const Wae={snackBarState:tc("state",[wr("void, hidden",ti({transform:"scale(0.8)",opacity:0})),wr("visible",ti({transform:"scale(1)",opacity:1})),Qs("* => visible",Ao("150ms cubic-bezier(0, 0, 0.2, 1)")),Qs("* => void, * => hidden",Ao("75ms cubic-bezier(0.4, 0.0, 1, 1)",ti({opacity:0})))])};let qae=(()=>{class n extends uS{constructor(t,i,r,s,o){super(),this._ngZone=t,this._elementRef=i,this._changeDetectorRef=r,this._platform=s,this.snackBarConfig=o,this._announceDelay=150,this._destroyed=!1,this._onAnnounce=new Se,this._onExit=new Se,this._onEnter=new Se,this._animationState="void",this.attachDomPortal=a=>(this._assertNotAttached(),this._applySnackBarClasses(),this._portalOutlet.attachDomPortal(a)),this._live="assertive"!==o.politeness||o.announcementMessage?"off"===o.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:i,toState:r}=t;if(("void"===r&&"void"!==i||"hidden"===r)&&this._completeExit(),"visible"===r){const s=this._onEnter;this._ngZone.run(()=>{s.next(),s.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(yi(1)).subscribe(()=>{this._onExit.next(),this._onExit.complete()})}_applySnackBarClasses(){const t=this._elementRef.nativeElement,i=this.snackBarConfig.panelClass;i&&(Array.isArray(i)?i.forEach(r=>t.classList.add(r)):t.classList.add(i)),"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]"),i=this._elementRef.nativeElement.querySelector("[aria-live]");if(t&&i){let r=null;this._platform.isBrowser&&document.activeElement instanceof HTMLElement&&t.contains(document.activeElement)&&(r=document.activeElement),t.removeAttribute("aria-hidden"),i.appendChild(t),null==r||r.focus(),this._onAnnounce.next(),this._onAnnounce.complete()}},this._announceDelay)})}}return n.\u0275fac=function(t){return new(t||n)(E(dt),E(rt),E(kn),E(si),E(hS))},n.\u0275cmp=Ne({type:n,selectors:[["snack-bar-container"]],viewQuery:function(t,i){if(1&t&&Jn(Kf,7),2&t){let r;_t(r=yt())&&(i._portalOutlet=r.first)}},hostAttrs:[1,"mat-snack-bar-container"],hostVars:1,hostBindings:function(t,i){1&t&&Qy("@state.done",function(s){return i.onAnimationEnd(s)}),2&t&&Pg("@state",i._animationState)},features:[ct],decls:3,vars:2,consts:[["aria-hidden","true"],["cdkPortalOutlet",""]],template:function(t,i){1&t&&(R(0,"div",0),mt(1,Hae,0,0,"ng-template",1),k(),tt(2,"div")),2&t&&(G(2),nn("aria-live",i._live)("role",i._role))},directives:[Kf],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:[Wae.snackBarState]}}),n})(),_U=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[Yv,dS,dn,ch,On],On]}),n})();const yU=new ve("mat-snack-bar-default-options",{providedIn:"root",factory:function(){return new hS}});let Xae=(()=>{class n{constructor(t,i,r,s,o,a){this._overlay=t,this._live=i,this._injector=r,this._breakpointObserver=s,this._parentSnackBar=o,this._defaultConfig=a,this._snackBarRefAtThisLevel=null,this.simpleSnackBarComponent=Gae,this.snackBarContainerComponent=qae,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,i){return this._attach(t,i)}openFromTemplate(t,i){return this._attach(t,i)}open(t,i="",r){const s=Object.assign(Object.assign({},this._defaultConfig),r);return s.data={message:t,action:i},s.announcementMessage===t&&(s.announcementMessage=void 0),this.openFromComponent(this.simpleSnackBarComponent,s)}dismiss(){this._openedSnackBarRef&&this._openedSnackBarRef.dismiss()}ngOnDestroy(){this._snackBarRefAtThisLevel&&this._snackBarRefAtThisLevel.dismiss()}_attachSnackBarContainer(t,i){const s=Nt.create({parent:i&&i.viewContainerRef&&i.viewContainerRef.injector||this._injector,providers:[{provide:hS,useValue:i}]}),o=new dm(this.snackBarContainerComponent,i.viewContainerRef,s),a=t.attach(o);return a.instance.snackBarConfig=i,a.instance}_attach(t,i){const r=Object.assign(Object.assign(Object.assign({},new hS),this._defaultConfig),i),s=this._createOverlay(r),o=this._attachSnackBarContainer(s,r),a=new ZO(o,s);if(t instanceof Ys){const l=new Xf(t,null,{$implicit:r.data,snackBarRef:a});a.instance=o.attachTemplatePortal(l)}else{const l=this._createInjector(r,a),c=new dm(t,void 0,l),d=o.attachComponentPortal(c);a.instance=d.instance}return this._breakpointObserver.observe("(max-width: 599.98px) and (orientation: portrait)").pipe(Tn(s.detachments())).subscribe(l=>{const c=s.overlayElement.classList;l.matches?c.add(this.handsetCssClass):c.remove(this.handsetCssClass)}),r.announcementMessage&&o._onAnnounce.subscribe(()=>{this._live.announce(r.announcementMessage,r.politeness)}),this._animateSnackBar(a,r),this._openedSnackBarRef=a,this._openedSnackBarRef}_animateSnackBar(t,i){t.afterDismissed().subscribe(()=>{this._openedSnackBarRef==t&&(this._openedSnackBarRef=null),i.announcementMessage&&this._live.clear()}),this._openedSnackBarRef?(this._openedSnackBarRef.afterDismissed().subscribe(()=>{t.containerInstance.enter()}),this._openedSnackBarRef.dismiss()):t.containerInstance.enter(),i.duration&&i.duration>0&&t.afterOpened().subscribe(()=>t._dismissAfter(i.duration))}_createOverlay(t){const i=new qv;i.direction=t.direction;let r=this._overlay.position().global();const s="rtl"===t.direction,o="left"===t.horizontalPosition||"start"===t.horizontalPosition&&!s||"end"===t.horizontalPosition&&s,a=!o&&"center"!==t.horizontalPosition;return o?r.left("0"):a?r.right("0"):r.centerHorizontally(),"top"===t.verticalPosition?r.top("0"):r.bottom("0"),i.positionStrategy=r,this._overlay.create(i)}_createInjector(t,i){return Nt.create({parent:t&&t.viewContainerRef&&t.viewContainerRef.injector||this._injector,providers:[{provide:ZO,useValue:i},{provide:KO,useValue:t.data}]})}}return n.\u0275fac=function(t){return new(t||n)(I(Jo),I(DE),I(Nt),I(XO),I(n,12),I(yU))},n.\u0275prov=ue({factory:function(){return new n(I(Jo),I(DE),I(Fc),I(XO),I(n,12),I(yU))},token:n,providedIn:_U}),n})();function xe(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 ws(n,e){return function(t,i){e(t,i,n)}}function Xe(n,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(n,e)}function yl(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 wU(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 JO(){return!("object"==typeof process&&"[object process]"===String(process)&&!process.browser)||wU()}const EU="undefined"!=typeof __VERSION__?__VERSION__:"untranspiled source",pS=JO();class Jae{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 eI(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 SU={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 MU(n){return"string"==typeof n?SU[n.toUpperCase()]||SU.WHITE:n}function gS(n,e){if(!n)throw new Error(e||"Assertion failed")}const ic={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},Xv=ic.window||ic.self||ic.global,xU=ic.process||{};function pm(){let n;if(pS&&Xv.performance)n=Xv.performance.now();else if(xU.hrtime){const e=xU.hrtime();n=1e3*e[0]+e[1]/1e6}else n=Date.now();return n}console;const gm={debug:pS&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},ole={enabled:!0,level:0};function vl(){}const TU={},AU={once:!0};function ale(n){for(const e in n)for(const t in n[e])return t||"untitled";return"empty"}let tI=(()=>{class n{constructor({id:t}={id:""}){this.id=t,this.VERSION=EU,this._startTs=pm(),this._deltaTs=pm(),this.LOG_THROTTLE_TIMEOUT=0,this._storage=new Jae("__probe-".concat(this.id,"__"),ole),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((pm()-this._startTs).toPrecision(10))}getDelta(){return Number((pm()-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){gS(t,i)}warn(t){return this._getLogFunction(0,t,gm.warn,arguments,AU)}error(t){return this._getLogFunction(0,t,gm.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,gm.log,arguments,{time:!0,once:!0})}log(t,i){return this._getLogFunction(t,i,gm.debug,arguments)}info(t,i){return this._getLogFunction(t,i,console.info,arguments)}once(t,i){return this._getLogFunction(t,i,gm.debug||gm.info,arguments,AU)}table(t,i,r){return i?this._getLogFunction(t,i,console.table||vl,r&&[r],{tag:ale(i)}):vl}image({logLevel:t,priority:i,image:r,message:s="",scale:o=1}){return this._shouldLog(t||i)?pS?function({image:n,message:e="",scale:t=1}){if("string"==typeof n){const r=new Image;return r.onload=()=>{const s=eI(r,e,t);console.log(...s)},r.src=n,vl}const i=n.nodeName||"";if("img"===i.toLowerCase())return console.log(...eI(n,e,t)),vl;if("canvas"===i.toLowerCase()){const r=new Image;return r.onload=()=>console.log(...eI(r,e,t)),r.src=n.toDataURL(),vl}return vl}({image:r,message:s,scale:o}):function({image:n,message:e="",scale:t=1}){let i=null;try{i=ze(307)}catch(r){}return i?()=>i(n,{fit:"box",width:"".concat(Math.round(80*t),"%")}).then(r=>console.log(r)):vl}({image:r,message:s,scale:o}):vl}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||vl)}group(t,i,r={collapsed:!1}){r=OU({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||vl)}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()>=DU(t)}_getLogFunction(t,i,r,s=[],o){if(this._shouldLog(t)){o=OU({logLevel:t,message:i,args:s,opts:o}),gS(r=r||o.method),o.total=this.getTotal(),o.delta=this.getDelta(),this._deltaTs=pm();const a=o.tag||o.message;if(o.once){if(TU[a])return vl;TU[a]=pm()}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!pS&&"string"==typeof n&&(e&&(e=MU(e),n="\x1b[".concat(e,"m").concat(n,"\x1b[39m")),t&&(e=MU(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 vl}}return n.VERSION=EU,n})();function DU(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 gS(Number.isFinite(e)&&e>=0),e}function OU(n){const{logLevel:e,message:t}=n;n.logLevel=DU(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 gS("string"===r||"object"===r),Object.assign(n,n.opts)}const jn=new tI({id:"deck"}),qn={DEFAULT:-1,LNGLAT:1,METER_OFFSETS:2,LNGLAT_OFFSETS:3,CARTESIAN:0};Object.defineProperty(qn,"IDENTITY",{get:()=>jn.deprecated("COORDINATE_SYSTEM.IDENTITY","COORDINATE_SYSTEM.CARTESIAN")()||0});const Yc={WEB_MERCATOR:1,GLOBE:2,WEB_MERCATOR_AUTO_OFFSET:4,IDENTITY:0},IU={click:{handler:"onClick"},panstart:{handler:"onDragStart"},panmove:{handler:"onDrag"},panend:{handler:"onDragEnd"}},vt=new tI({id:"luma.gl"});function Oo(n,e){if(!n)throw new Error(e||"luma.gl: assertion failed.")}function mS(n){return"undefined"!=typeof WebGLRenderingContext&&n instanceof WebGLRenderingContext||"undefined"!=typeof WebGL2RenderingContext&&n instanceof WebGL2RenderingContext||Boolean(n&&Number.isFinite(n._version))}function In(n){return"undefined"!=typeof WebGL2RenderingContext&&n instanceof WebGL2RenderingContext||Boolean(n&&2===n._version)}function _S(n){return Oo(mS(n),"Invalid WebGLRenderingContext"),n}function eo(n){return Oo(In(n),"Requires WebGL2"),n}const Kv={};const Zv=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{globalThis.console&&globalThis.console.log&&globalThis.console.log("OESVertexArrayObject emulation library context restored"),t.reset_()},!0),this.reset_()};Qf.prototype.VERTEX_ARRAY_BINDING_OES=34229,Qf.prototype.reset_=function(){if(void 0!==this.vertexArrayObjects)for(let i=0;iIn(n)?void 0:0,Ale={3074:n=>In(n)?void 0:36064,35723:n=>In(n)?void 0:4352,35977:Bi,32937:Bi,36795:(n,e)=>{const t=In(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(kU);return e(t&&t.UNMASKED_VENDOR_WEBGL||7936)},37446:(n,e)=>{const t=n.getExtension(kU);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:Bi,35071:Bi,37447:Bi,36063:(n,e)=>{if(!In(n)){const t=n.getExtension(RU);return t?e(t.MAX_COLOR_ATTACHMENTS_WEBGL):0}},35379:Bi,35374:Bi,35377:Bi,34852:n=>{if(!In(n)){const e=n.getExtension(RU);return e?e.MAX_DRAW_BUFFERS_WEBGL:0}},36203:n=>n.getExtension(PU)?2147483647:65535,33001:n=>n.getExtension(PU)?16777216:65535,33e3:n=>16777216,37157:Bi,35373:Bi,35657:Bi,36183:Bi,37137:Bi,34045:Bi,35978:Bi,35979:Bi,35968:Bi,35376:Bi,35375:Bi,35659:Bi,37154:Bi,35371:Bi,35658:Bi,35076:Bi,35077:Bi,35380:Bi},FU="ANGLE_instanced_arrays",NU={OES_vertex_array_object:{meta:{suffix:"OES"},createVertexArray:()=>{Oo(!1,"VertexArray requires WebGL2 or OES_vertex_array_object extension")},deleteVertexArray:()=>{},bindVertexArray:()=>{},isVertexArray:()=>!1},[FU]:{meta:{suffix:"ANGLE"},vertexAttribDivisor(n,e){Oo(0===e,"WebGL instanced rendering not supported")},drawElementsInstanced:()=>{},drawArraysInstanced:()=>{}},WEBGL_draw_buffers:{meta:{suffix:"WEBGL"},drawBuffers:()=>{Oo(!1)}},EXT_disjoint_timer_query:{meta:{suffix:"EXT"},createQuery:()=>{Oo(!1)},deleteQuery:()=>{Oo(!1)},beginQuery:()=>{Oo(!1)},endQuery:()=>{},getQuery(n,e){return this.getQueryObject(n,e)},getQueryParameter(n,e){return this.getQueryObject(n,e)},getQueryObject:()=>{}}},nI={readBuffer:(n,e,t)=>{In(n)&&e(t)},getVertexAttrib:(n,e,t,i)=>{const{webgl2:r,ext:s}=function(n,e){return{webgl2:In(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(!In(n))switch(i){case 35967:return 35981;case 35971:case 35382:return 0}return e(t,i)},getInternalformatParameter:(n,e,t,i,r)=>{if(!In(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=Ale[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 zle(n,{extension:e,target:t,target2:i}){const r=NU[e];Oo(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)}}globalThis.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 Qf(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&&zle(n,{extension:t,target:n.luma,target2:n})}(n,NU),function(n,{target:e,target2:t}){Object.keys(nI).forEach(i=>{if("function"==typeof nI[i]){const r=n[i]?n[i].bind(n):()=>{},s=nI[i].bind(null,n,r);e[i]=s,t[i]=s}})}(n,{target:e,target2:n}),e.polyfilled=!0),n};const iI={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},uh=(n,e,t)=>e?n.enable(t):n.disable(t),LU=(n,e,t)=>n.hint(t,e),Aa=(n,e,t)=>n.pixelStorei(t,e);function Qv(n){return Array.isArray(n)||ArrayBuffer.isView(n)}const Hle={3042:uh,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:uh,2885:(n,e)=>n.cullFace(e),2929:uh,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:uh,35723:LU,36006:(n,e)=>{const t=In(n)?36009:36160;return n.bindFramebuffer(t,e)},2886:(n,e)=>n.frontFace(e),33170:LU,2849:(n,e)=>n.lineWidth(e),32823:uh,32824:"polygonOffset",10752:"polygonOffset",35977:uh,32938:"sampleCoverage",32939:"sampleCoverage",3089:uh,3088:(n,e)=>n.scissor(...e),2960:uh,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:Aa,3317:Aa,37440:Aa,37441:Aa,37443:Aa,3330:Aa,3332:Aa,3331:Aa,36010:(n,e)=>n.bindFramebuffer(36008,e),3314:Aa,32878:Aa,3316:Aa,3315:Aa,32877:Aa,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=Qv(e)?e:[e,e],n.blendEquationSeparate(...e)},blendFunc:(n,e)=>{e=Qv(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=Qv(e)?e:[e,e];const[t,i]=e;n.stencilMaskSeparate(1028,t),n.stencilMaskSeparate(1029,i)},stencilFunc:(n,e)=>{e=Qv(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=Qv(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 Er(n,e,t){return void 0!==e[n]?e[n]:t[n]}const $le={blendEquation:(n,e,t)=>n.blendEquationSeparate(Er(32777,e,t),Er(34877,e,t)),blendFunc:(n,e,t)=>n.blendFuncSeparate(Er(32969,e,t),Er(32968,e,t),Er(32971,e,t),Er(32970,e,t)),polygonOffset:(n,e,t)=>n.polygonOffset(Er(32824,e,t),Er(10752,e,t)),sampleCoverage:(n,e,t)=>n.sampleCoverage(Er(32938,e,t),Er(32939,e,t)),stencilFuncFront:(n,e,t)=>n.stencilFuncSeparate(1028,Er(2962,e,t),Er(2967,e,t),Er(2963,e,t)),stencilFuncBack:(n,e,t)=>n.stencilFuncSeparate(1029,Er(34816,e,t),Er(36003,e,t),Er(36004,e,t)),stencilOpFront:(n,e,t)=>n.stencilOpSeparate(1028,Er(2964,e,t),Er(2965,e,t),Er(2966,e,t)),stencilOpBack:(n,e,t)=>n.stencilOpSeparate(1029,Er(34817,e,t),Er(34818,e,t),Er(34819,e,t))},BU={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]})},Xc=(n,e)=>n.isEnabled(e),VU={3042:Xc,2884:Xc,2929:Xc,3024:Xc,32823:Xc,32926:Xc,32928:Xc,3089:Xc,2960:Xc,35977:Xc};function zU(n){for(const e in n)return!1;return!0}function Gle(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||iI)){const r=e,s=VU[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=VU[r];i[r]=s?s(n,Number(r)):n.getParameter(Number(r))}return i}(e):Object.assign({},iI),this.log=i,this._updateCache=this._updateCache.bind(this),Object.seal(this)}push(e={}){this.stateStack.push({})}pop(){Oo(this.stateStack.length>0),Xu(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){Oo(void 0!==s);const o=e[s],a=this.cache[s];Gle(o,a)||(t=!0,i=a,r&&!(s in r)&&(r[s]=a),this.cache[s]=o)}return{valueChanged:t,oldValue:i}}}function UU(n,e={}){const{enable:t=!0,copyState:i}=e;if(Oo(void 0!==i),!n.state){const{polyfillContext:r}=globalThis;r&&r(n),n.state=new Yle(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 s in BU)Wle(n,s,BU[s]);jU(n,"getParameter"),jU(n,"isEnabled")}return n.state.enable=t,n}function HU(n){Oo(n.state),n.state.pop()}function Xu(n,e){if(Oo(mS(n),"setParameters requires a WebGL context"),zU(e))return;const t={};for(const r in e){const s=Number(r),o=Hle[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)$le[r](n,e,i)}function rc(n,e,t){if(zU(e))return t(n);const{nocatch:i=!0}=e;let r;if(function(n){n.state||UU(n,{copyState:!1}),n.state.push()}(n),Xu(n,e),i)r=t(n),HU(n);else try{r=t(n)}finally{HU(n)}return r}function yS(){return!("object"==typeof process&&"[object process]"===String(process)&&!process.browser)||function(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;return!!(e&&e.indexOf("Electron")>=0)}()}function mm(n){const{luma:e}=n;if(n.canvas&&e){const{clientWidth:t}=e.canvasSizeInfo;return t?n.drawingBufferWidth/t:1}return 1}function rI(n,e,t=!0){return function(n,e,t,i,r){const s=$U(n[0],e,t);let o=GU(n[1],e,i,r),a=$U(n[0]+1,e,t);const l=a===t-1?a:a-1;let c;return a=GU(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,mm(n),n.drawingBufferWidth,n.drawingBufferHeight,t)}function $U(n,e,t){return Math.min(Math.round(n*e),t-1)}function GU(n,e,t,i){return i?Math.max(0,t-1-Math.round(n*e)):Math.min(Math.round(n*e),t-1)}const sI=yS(),tce=sI&&"undefined"!=typeof document,WU={webgl2:!0,webgl1:!0,throwOnError:!0,manageState:!0,canvas:null,debug:!1,width:800,height:600};function qU(n={}){Oo(sI,"createGLContext only available in the browser.\nCreate your own headless context or use 'createHeadlessContext' from @luma.gl/test-utils"),n=Object.assign({},WU,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?(tce&&"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=oI(r,n),function(n){const e=In(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);vt.info(1,`${e}${n.debug?" debug":""} context ${t?`(${t.vendor},${t.renderer})`:""}`)()}(r),r):null}function oI(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({},WU,e);const{manageState:t,debug:i}=e;return t&&UU(n,{copyState:!1,log:(...r)=>vt.log(1,...r)()}),sI&&i&&(globalThis.makeDebugContext?(n=globalThis.makeDebugContext(n,e),vt.level=Math.max(vt.level,1)):vt.warn('WebGL debug mode not activated. import "@luma.gl/debug" to enable.')()),n._instrumented=!0,n}function YU(){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 XU{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=YU(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(YU()-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 aI{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 XU?e:new XU(t,i)),this.stats[t]}}const Jv="8.5.12",Jf=new class{constructor(){this.stats=new Map}get(e){return this.stats.has(e)||this.stats.set(e,new aI({id:e})),this.stats.get(e)}};if(globalThis.luma&&globalThis.luma.VERSION!==Jv)throw new Error(`luma.gl - multiple VERSIONs detected: ${globalThis.luma.VERSION} vs ${Jv}`);function nt(n,e){if(!n)throw new Error(e||"luma.gl: assertion failed.")}function lI(n,e){if("string"!=typeof e)return e;const t=Number(e);if(!isNaN(t))return t;const i=n[e=e.replace(/^.*\./,"")];return nt(void 0!==i,`Accessing undefined constant GL.${e}`),i}function dh(n,e){e=Number(e);for(const t in n)if(n[t]===e)return`GL.${t}`;return String(e)}globalThis.luma||(yS()&&vt.log(1,`luma.gl ${Jv} - set luma.log.level=1 (or higher) to trace rendering`)(),globalThis.luma=globalThis.luma||{VERSION:Jv,version:Jv,log:vt,stats:Jf,globals:{modules:{},nodeIO:{}}}),globalThis;const cI={};function ea(n="id"){return cI[n]=cI[n]||1,`${n}-${cI[n]++}`}function KU(n){return nt("number"==typeof n,"Input must be a number"),n&&0==(n&n-1)}function _m(n){let e=!0;for(const t in n){e=!1;break}return e}function ZU(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 vt.removed(`Calling removed method ${e}.${o}: `,r)(),new Error(o)})})}const ym="Resource subclass must define virtual methods";class Ku{get[Symbol.toStringTag](){return"Resource"}constructor(e,t={}){_S(e);const{id:i,userData:r={}}=t;this.gl=e,this.gl2=e,this.id=i||ea(this[Symbol.toStringTag]),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[Symbol.toStringTag]||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={}){nt(e=lI(this.gl,e));const r=(this.constructor.PARAMETERS||{})[e];if(r){const s=In(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=In(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?dh(this.gl,l):l;o[f]=this.getParameter(l,e),i&&"GLenum"===c.type&&(o[f]=dh(this.gl,o[f]))}}return o}setParameter(e,t){nt(e=lI(this.gl,e));const r=(this.constructor.PARAMETERS||{})[e];if(r){const s=In(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=lI(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 ZU(this,e,t,i)}initialize(e){}_createHandle(){throw new Error(ym)}_deleteHandle(){throw new Error(ym)}_bindHandle(e){throw new Error(ym)}_getOptsFromHandle(){throw new Error(ym)}_getParameter(e,t){throw new Error(ym)}_setParameter(e,t){throw new Error(ym)}_context(){return this.gl.luma=this.gl.luma||{},this.gl.luma}_addStats(){const e=this[Symbol.toStringTag],t=Jf.get("Resource Counts");t.get("Resources Created").incrementCount(),t.get(`${e}s Created`).incrementCount(),t.get(`${e}s Active`).incrementCount()}_removeStats(){const e=this[Symbol.toStringTag];Jf.get("Resource Counts").get(`${e}s Active`).decrementCount()}_trackAllocatedMemory(e,t=this[Symbol.toStringTag]){const i=Jf.get("Memory Usage");i.get("GPU Memory").addCount(e),i.get(`${t} Memory`).addCount(e),this.byteLength=e}_trackDeallocatedMemory(e=this[Symbol.toStringTag]){const t=Jf.get("Memory Usage");t.get("GPU Memory").subtractCount(this.byteLength),t.get(`${e} Memory`).subtractCount(this.byteLength),this.byteLength=0}}function uI(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 eb(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 fce({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 ta.getBytesPerElement(this)}get BYTES_PER_VERTEX(){return ta.getBytesPerVertex(this)}_assign(e={}){return void 0!==(e=dI("Accessor",e,gce)).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 JU={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"},mce={removedProps:{},replacedProps:{bytes:"byteLength"},deprecatedProps:JU},_ce={removedProps:JU};class Ai extends Ku{get[Symbol.toStringTag](){return"Buffer"}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/ta.getBytesPerElement(e))}getVertexCount(e=this.accessor){return Math.round(this.byteLength/ta.getBytesPerVertex(e))}initialize(e={}){return ArrayBuffer.isView(e)&&(e={data:e}),Number.isFinite(e)&&(e={byteLength:e}),e=dI("Buffer",e,mce),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=dI("Buffer",e,_ce))&&this.setAccessor(e.accessor),this}setAccessor(e){return delete(e=Object.assign({},e)).buffer,this.accessor=new ta(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;nt(t);const o=this.gl.webgl2?36663:this.target;return this.gl.bindBuffer(o,this.handle),0!==r||void 0!==s?(eo(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 eo(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}={}){eo(this.gl);const s=eb(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 nt((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):(nt(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){nt(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=uI(e);return nt(s),this.setAccessor(new ta(this.accessor,{type:s})),this}_setByteLength(e,t=this.usage){nt(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/eb(this.accessor.type||5126,{clamped:!1}).BYTES_PER_ELEMENT;return this.getElementCount()-i}_inferType(e){this.accessor.type||this.setAccessor(new ta(this.accessor,{type:uI(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 vt.deprecated("Buffer.type","Buffer.accessor.type")(),this.accessor.type}get bytes(){return vt.deprecated("Buffer.bytes","Buffer.byteLength")(),this.byteLength}setByteLength(e){return vt.deprecated("setByteLength","reallocate")(),this.reallocate(e)}updateAccessor(e){return vt.deprecated("updateAccessor(...)","setAccessor(new Accessor(buffer.accessor, ...)")(),this.accessor=new ta(this.accessor,e),this}}const hI={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}},e4={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},t4={5126:4,5125:4,5124:4,5123:2,5122:2,5131:2,5120:1,5121:1},bce=[9729,9728],n4=globalThis.WebGLBuffer||function(){};class ep extends Ku{get[Symbol.toStringTag](){return"Texture"}static isSupported(e,t={}){const{format:i,linearFiltering:r}=t;let s=!0;return i&&(s=s&&function(n,e){const t=hI[e];if(!t)return!1;if(void 0===t.gl1&&void 0===t.gl2)return!0;const i=In(n)&&t.gl2||t.gl1;return"string"==typeof i?n.getExtension(i):i}(e,i),s=s&&(!r||function(n,e){const t=hI[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=ea("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(w=>this.initialize(Object.assign({},e,{pixels:w,data:w}))),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:y=!1,mipmaps:v=!0}=e;const{depth:C=0}=e;return({width:f,height:p,compressed:y,dataFormat:g,type:_}=this._deduceParameters({format:s,type:_,dataFormat:g,compressed:y,data:t,width:f,height:p})),this.width=f,this.height=p,this.depth=C,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)),v&&this._isNPOT()&&(vt.warn(`texture: ${this} is Non-Power-Of-Two, disabling mipmaping`)(),v=!1,this._updateForNPOT(l)),this.mipmaps=v,this.setImageData({data:t,width:f,height:p,depth:C,format:s,type:_,dataFormat:g,border:o,mipmaps:v,parameters:c,compressed:y}),v&&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:y}=this;y.bindTexture(this.target,this.handle);let v=null;({data:c,dataType:v}=this._getDataType({data:c,compressed:_}));let C,w=0;return rc(this.gl,l,()=>{switch(v){case"null":y.texImage2D(t,r,s,f,p,o,g,d,c);break;case"typed-array":y.texImage2D(t,r,s,f,p,o,g,d,c,a);break;case"buffer":C=eo(y),C.bindBuffer(35052,c.handle||c),C.texImage2D(t,r,s,f,p,o,g,d,a),C.bindBuffer(35052,null);break;case"browser-object":In(y)?y.texImage2D(t,r,s,f,p,o,g,d,c):y.texImage2D(t,r,s,g,d,c);break;case"compressed":for(const[x,N]of c.entries())y.compressedTexImage2D(t,x,N.format,N.width,N.height,o,N.data),w+=N.levelSize;break;default:nt(!1,"Unknown image data type")}}),this._trackAllocatedMemory("compressed"===v?w:c&&c.byteLength?c.byteLength:this.width*this.height*(e4[this.dataFormat]||4)*(t4[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:y={}}){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})),nt(0===this.depth,"texSubImage not supported for 3D textures"),i||(i=t),i&&i.data){const v=i;i=v.data,o=v.shape[0],a=v.shape[1]}i instanceof Ai&&(i=i.handle),this.gl.bindTexture(this.target,this.handle),rc(this.gl,y,()=>{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 n4){const v=eo(this.gl);v.bindBuffer(35052,i),v.texSubImage2D(e,l,r,s,o,a,f,d,g),v.bindBuffer(35052,null)}else In(this.gl)?eo(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 vt.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 Ai?{data:e.handle,dataType:"buffer"}:e instanceof n4?{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=hI[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},nt(r,"Could not deduced texture size"),nt(void 0===t||r.width===t,"Deduced texture width does not match supplied width"),nt(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:nt(!1);break;default:this.gl.texParameteri(this.target,e,t)}return this.gl.bindTexture(this.target,null),this}_isNPOT(){return!(In(this.gl)||!this.width||!this.height||KU(this.width)&&KU(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===bce.indexOf(t)&&(t=9729);break;case 10242:case 10243:33071!==t&&(t=33071)}return t}}function Cce(n,e){return nt("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 na extends ep{get[Symbol.toStringTag](){return"Texture2D"}static isSupported(e,t){return ep.isSupported(e,t)}constructor(e,t={}){_S(e),(t instanceof Promise||"string"==typeof t)&&(t={data:t}),"string"==typeof t.data&&(t=Object.assign({},t,{data:Cce(t.data)})),super(e,Object.assign({},t,{target:3553})),this.initialize(t),Object.seal(this)}}const tp="EXT_color_buffer_float",i4={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:tp,bpp:2},33327:{gl2:tp,bpp:4},34842:{gl2:tp,bpp:8},33326:{gl2:tp,bpp:4},33328:{gl2:tp,bpp:8},34836:{gl2:tp,bpp:16},35898:{gl2:tp,bpp:4}};class vm extends Ku{get[Symbol.toStringTag](){return"Renderbuffer"}static isSupported(e,{format:t}={format:null}){return!t||function(n,e,t){const i=t[e];if(!i)return!1;const r=In(n)&&i.gl2||i.gl1;return"string"==typeof r?n.getExtension(r):r}(e,t,i4)}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 nt(e,"Needs format"),this._trackDeallocatedMemory(),this.gl.bindRenderbuffer(36161,this.handle),0!==r&&In(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)*i4[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 l4="clear: bad arguments";function pI(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)),nt(0!==o,l4),rc(n,s,()=>{n.clear(o)})}function c4(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 yn(n){return function(){var e=this,t=arguments;return new Promise(function(i,r){var s=n.apply(e,t);function o(l){c4(s,i,r,o,a,"next",l)}function a(l){c4(s,i,r,o,a,"throw",l)}o(void 0)})}}const gI=[34069,34070,34071,34072,34073,34074];let Ace=(()=>{class n extends ep{get[Symbol.toStringTag](){return"TextureCube"}constructor(t,i={}){_S(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 yn(function*(){const{gl:d}=c,f=r||s,p=yield Promise.all(gI.map(g=>{const _=f[g];return Promise.all(Array.isArray(_)?_:[_])}));c.bind(),gI.forEach((g,_)=>{p[_].length>1&&!1!==c.opts.mipmaps&&vt.warn(`${c.id} has mipmap and multiple LODs.`)(),p[_].forEach((y,v)=>{t&&i?d.texImage2D(g,v,a,t,i,o,a,l,y):d.texImage2D(g,v,a,a,l,y)})}),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=gI,n})();class Dce extends ep{get[Symbol.toStringTag](){return"Texture3D"}static isSupported(e){return In(e)}constructor(e,t={}){eo(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),rc(this.gl,f,()=>{ArrayBuffer.isView(d)&&this.gl.texImage3D(this.target,e,t,i,r,s,o,a,l,d),d instanceof Ai&&(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*(e4[this.dataFormat]||4)*(t4[this.type]||1),"Texture"),this.loaded=!0,this}}function u4(n,e){nt(n instanceof na||n instanceof Ace||n instanceof Dce);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},e))}function Oce(n,e){const{gl:t,width:i,height:r,id:s}=n;return new ss(t,Object.assign({},e,{id:`framebuffer-for-${s}`,width:i,height:r,attachments:{36064:n}}))}function vS(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}=tb(n);nt(d);const{gl:p,handle:g,attachments:_}=d;a=a||d.width,l=l||d.height,36064===s&&null===g&&(s=1028),nt(_[s]),c=c||_[s].type,o=function(n,e,t,i,r){if(n)return n;return new(eb(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 nt(!1),0}}(t))}(o,c,r,a,l),c=c||uI(o);const y=p.bindFramebuffer(36160,g);return p.readPixels(t,i,a,l,r,c,o),p.bindFramebuffer(36160,y||null),f&&d.delete(),o}function mI(n,{sourceAttachment:e=36064,targetMaxHeight:t=Number.MAX_SAFE_INTEGER}={}){let i=vS(n,{sourceAttachment:e}),{width:r,height:s}=n;for(;s>t;)({data:i,width:r,height:s}=fce({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 nt(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&&vt.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){nt(void 0!==o,"Misspelled framebuffer binding point?");const a=Number(o),l=r[a];let c=l;if(c)if(c instanceof vm)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(ss.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)&&pI(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]}={}){eo(n),rc(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:nt(!1,l4)}})}(this.gl,{drawBuffer:l,value:a})}),this.gl.bindFramebuffer(36160,o||null),this}readPixels(e={}){return vt.error("Framebuffer.readPixels() is no logner supported, use readPixelsToArray(framebuffer)")(),null}readPixelsToBuffer(e={}){return vt.error("Framebuffer.readPixelsToBuffer()is no logner supported, use readPixelsToBuffer(framebuffer)")(),null}copyToDataUrl(e={}){return vt.error("Framebuffer.copyToDataUrl() is no logner supported, use copyToDataUrl(framebuffer)")(),null}copyToImage(e={}){return vt.error("Framebuffer.copyToImage() is no logner supported, use copyToImage(framebuffer)")(),null}copyToTexture(e={}){return vt.error("Framebuffer.copyToTexture({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null}blit(e={}){return vt.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=eo(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=dh(this.gl,r)),r}getAttachmentParameters(e=36064,t,i=this.constructor.ATTACHMENT_PARAMETERS||[]){const r={};for(const s of i)r[t?dh(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?dh(this.gl,s):s]=this.getAttachmentParameters(s,e)}return i}show(){return"undefined"!=typeof window&&window.open(mI(this),"luma-debug-texture"),this}log(e=0,t=""){if(e>vt.level||"undefined"==typeof window)return this;t=t||`Framebuffer ${this.id}`;const i=mI(this,{targetMaxHeight:100});return vt.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 na(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 vm(this.gl,{id:`${this.id}-depth-stencil`,format:35056,width:r,height:111}),this.ownResources.push(o[33306])):t?(o=o||{},o[36096]=new vm(this.gl,{id:`${this.id}-depth`,format:33189,width:r,height:s}),this.ownResources.push(o[36096])):i&&nt(!1),o}_unattach(e){const t=this.attachments[e];!t||(t instanceof vm?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:eo(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:nt(!1,"Illegal texture type")}s.bindTexture(t.target,null),this.attachments[e]=t}_setReadBuffer(e){const t=function(n){return In(n)?n:null}(this.gl);t?t.readBuffer(e):nt(36064===e||1029===e,d4),this.readBuffer=e}_setDrawBuffers(e){const{gl:t}=this,i=eo(t);if(i)i.drawBuffers(e);else{const r=t.getExtension("WEBGL_draw_buffers");r?r.drawBuffersWEBGL(e):nt(1===e.length&&(36064===e[0]||1029===e[0]),d4)}this.drawBuffers=e}_getAttachmentParameterFallback(e){const t=function(n){n.luma=n.luma||{},n.luma.caps=n.luma.caps||{};for(const e in h4)void 0===n.luma.caps[e]&&(n.luma.caps[e]=p4(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)}}ss.ATTACHMENT_PARAMETERS=[36049,36048,33296,33298,33299,33300,33301,33302,33303];const h4={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 na(n,{format:6408,type:5126,dataFormat:6408}),t=new ss(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 _I(n,e){return f4(n,e)}function f4(n,e){return(e=Array.isArray(e)?e:[e]).every(t=>p4(n,t))}function p4(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=h4[e];let i;nt(t,e);const r=In(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:nt(!1);return i}(n,e)),n.luma.caps[e]||vt.log(2,`Feature: ${e} not supported`)(),n.luma.caps[e]}class yI{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()}},Hce=(Math,1/180*Math.PI),Ji={};function Gce(n,{precision:e=Ji.precision||4}={}){return n=function(n){return Math.round(n/Ji.EPSILON)*Ji.EPSILON}(n),`${parseFloat(n.toPrecision(e))}`}function hh(n){return Array.isArray(n)||ArrayBuffer.isView(n)&&!(n instanceof DataView)}function Zu(n,e,t){if(hh(n)){t=t||function(n){return n.clone?n.clone():new Array(n.length)}(n);for(let i=0;it*Hce,void 0)}(n)}function np(n,e,t){return Zu(n,i=>Math.max(e,Math.min(t,i)))}function bS(n,e,t){return hh(n)?n.map((i,r)=>bS(i,e[r],t)):t*e+(1-t)*n}function rb(n,e,t){const i=Ji.EPSILON;t&&(Ji.EPSILON=t);try{if(n===e)return!0;if(hh(n)&&hh(e)){if(n.length!==e.length)return!1;for(let r=0;r0?", ":"")+Gce(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&&(M4.length=n.length,i=M4):i=S4,(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 x4(n){return n&&n[Symbol.asyncIterator]}function EI(n,e=(()=>!0)){return Array.isArray(n)?T4(n,e,[]):e(n)?[n]:[]}function T4(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 A4(n,e){return n?(Number.isFinite(n)&&(n={duration:n}),n.type=n.type||"interpolation",K(K(K({},Mue[n.type]),e),n)):null}function D4(n,e){return e.getBuffer()?[e.getBuffer(),{divisor:0,size:e.size,normalized:e.settings.normalized}]:e.value}function O4(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 I4(n){n.push(n.shift())}function MI(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 P4({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=MI(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 C=s;s=(w,x)=>t._normalizeConstant(C(w,x))}const _=p?(C,w)=>s(g,w):(C,w)=>s(g.subarray(C,C+a),w),y=n.getData({length:i}),v=new Float32Array(f);(function({source:n,target:e,size:t,getData:i,sourceStartIndices:r,targetStartIndices:s}){if(!Array.isArray(s))return SI({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===MS||(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=MS}clearNeedsUpdate(){this.state.needsUpdate=!1,this.state.updateRanges=wue}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!==MS}),!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 v=f*a+l;for(let C=0;Cd?c.set(x,y):(e._normalizeValue(x,C.target,0),Cue({target:c,source:C.target,start:y,count:N}));y+=N*d}else e._normalizeValue(x,c,y),y+=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 TI={};function no(n){jn.level>0&&TI[n]&&TI[n].call(...arguments)}function Da(n,e){if(!n)throw new Error(e||"shadertools: assertion failed.")}const R4="out vec4 transform_output;\nvoid main() {\n transform_output = vec4(0);\n}",Aue=`#version 300 es\n${R4}`;function k4(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 F4(n={}){const{version:e=100,input:t,inputType:i,output:r}=n;if(!t)return 300===e?Aue:e>300?`#version ${e}\n${R4}`:"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 Da(!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 N4 extends Ku{get[Symbol.toStringTag](){return"TransformFeedback"}static isSupported(e){return In(e)}constructor(e,t={}){eo(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,_m(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,vt.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 Ai?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 Pue{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 Ai?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&&nt(In(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 N4(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],nt(i[s]instanceof Ai)}return{sourceBuffers:t,feedbackBuffers:i}}_createNewBuffer(e,t){const i=new Ai(this.gl,t);return this.resources[e]&&this.resources[e].delete(),this.resources[e]=i,i}_getNextIndex(){return(this.currentIndex+1)%2}}function L4(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 ab="vs",Fue={[ab]:"#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"},xS="__LUMA_INJECT_DECLARATIONS__",B4=/void\s+main\s*\([^)]*\)\s*\{\n?/,V4=/}\n?[^{}]*$/,DI=[];function z4(n,e,t,i=!1){const r=e===ab;for(const s in t){const o=t[s];o.sort((l,c)=>l.order-c.order),DI.length=o.length;for(let l=0,c=o.length;ll+a));break;case"vs:#main-end":r&&(n=n.replace(V4,l=>a+l));break;case"fs:#decl":r||(n=n.replace(xS,a));break;case"fs:#main-start":r||(n=n.replace(B4,l=>l+a));break;case"fs:#main-end":r||(n=n.replace(V4,l=>a+l));break;default:n=n.replace(s,l=>l+a)}}return n=n.replace(xS,""),i&&(n=n.replace(/\}\s*$/,s=>s+Fue[e])),n}function OI(n){const e={};return Da(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 Nue={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},TS="transform_uSize_",j4="transform_position";const $ue={10241:9728,10240:9728,10242:33071,10243:33071};class Wue{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[`${TS}${e}`]=[r,s]);for(const o in n)({width:r,height:s}=n[o]),i[`${TS}${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=vS(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 Da(!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 Ai(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 ss(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($ue)}_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=u4(e,{parameters:{10241:9728,10240:9728,10242:33071,10243:33071},pixelStore:{37440:!1}});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 y=function(n,e){const t={},i=function(n){return k4(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=`${TS}${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 Da(!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(y){const{updatedLine:v,inject:C}=y;f[g]=v,c=OI([c,C]),Object.assign(a,y.samplerTextureMap),s--}}t&&!o&&(o=function(n,e){const t=k4(n,["varying","out"]);return t&&t.name===e?t.type:null}(p,t))}),t){nt(i);const p=`${TS}${t}`;c=OI([c,{"vs:#decl":`uniform vec2 ${p};\n`,"vs:#main-start":` vec2 ${j4} = transform_getPos(${p});\n gl_Position = vec4(${j4}, 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=OI([e.inject||{},a]);return this.targetTextureType=o,this.samplerTextureMap=l,{vs:r,fs:e._fs||F4({version:L4(r),input:this.targetTextureVarying,inputType:o,output:"transform_output"}),modules:this.hasSourceTextures||this.targetTextureVarying?[Nue].concat(e.modules||[]):e.modules,uniforms:s,inject:c}}}const II={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 Yue(n){let e=U4(n);return"object"===e?n?"type"in n?Object.assign({},n,II[n.type]):"value"in n?(e=U4(n.value),Object.assign({type:e},n,II[e])):{type:"object",value:n}:{type:"object",value:null}:Object.assign({type:e,value:n},II[e])}function U4(n){return Array.isArray(n)||ArrayBuffer.isView(n)?"array":typeof n}class PI{constructor({name:e,vs:t,fs:i,dependencies:r=[],uniforms:s,getUniforms:o,deprecations:a=[],defines:l={},inject:c={},vertexShader:d,fragmentShader:f}){Da("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=Yue(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:Da(!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&&Da(s.validate(e[r],s),`${this.name}: invalid ${r}`),t[r]=e[r]):t[r]=s.value}return t}}function Que(n){return function(n){const e={},t={};return RI({modules:n,level:0,moduleMap:e,moduleDepth:t}),Object.keys(t).sort((i,r)=>t[r]-t[i]).map(i=>e[i])}($4(n))}function RI({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 PI||(Da("string"!=typeof t,`Shader module use by name is deprecated. Import shader module '${t}' and use it directly.`),Da(t.name,"shader module has no name"),(t=new PI(t)).dependencies=$4(t.dependencies)),t))}const kI={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]},ip={};function ode(n,e){return n.match(/NVIDIA/i)||e.match(/NVIDIA/i)?"NVIDIA":n.match(/INTEL/i)||e.match(/INTEL/i)?"INTEL":n.match(/AMD/i)||e.match(/AMD/i)||n.match(/ATI/i)||e.match(/ATI/i)?"AMD":"UNKNOWN GPU"}Object.keys(kI).forEach(n=>{ip[n]=n});const FI={};function G4(n,e,t={}){const i=kI[e];if(Da(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 FI)return FI[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),FI[e]=l,l}function AS(n,e){return(e=Array.isArray(e)?e:[e]).every(t=>function(n,e){const t=kI[e];Da(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 Da(!1===r||!0===r),r}(n,t))}function Cm(n){return new RegExp(`\\b${n}[ \\t]+(\\w+[ \\t]+\\w+(\\[\\w+\\])?;)`,"g")}const W4=[[/^(#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("]],ude=[...W4,[Cm("attribute"),"in $1"],[Cm("varying"),"out $1"]],dde=[...W4,[Cm("varying"),"in $1"]],q4=[[/^#version[ \t]+300[ \t]+es/,"#version 100"],[/\btexture(2D|2DProj|Cube)Lod\(/g,"texture$1LodEXT("],[/\btexture\(/g,"texture2D("],[/\btextureLod\(/g,"texture2DLodEXT("]],hde=[...q4,[Cm("in"),"attribute $1"],[Cm("out"),"varying $1"]],fde=[...q4,[Cm("in"),"varying $1"]],NI="gl_FragColor",LI=/\bout[ \t]+vec4[ \t]+(\w+)[ \t]*;\n?/,pde=/void\s+main\s*\([^)]*\)\s*\{\n?/;function DS(n,e){for(const[t,i]of e)n=n.replace(t,i);return n}const yde=`\n\n${xS}\n\n`,Y4={[ab]:"vertex",fs:"fragment"};function X4(n,{id:e,source:t,type:i,modules:r,defines:s={},hookFunctions:o=[],inject:a={},transpileToGLSL100:l=!1,prologue:c=!0,log:d}){Da("string"==typeof t,"shader source must be a string");const f=i===ab,p=t.split("\n");let g=100,_="",y=t;0===p[0].indexOf("#version ")?(g=300,_=p[0],y=p.slice(1).join("\n")):_=`#version ${g}`;const v={};r.forEach(U=>{Object.assign(v,U.getDefines())}),Object.assign(v,s);let C=c?`${_}\n${function({id:n,source:e,type:t}){return n&&"string"==typeof n&&-1===e.indexOf("SHADER_NAME")?`\n#define SHADER_NAME ${n}_${Y4[t]}\n\n`:""}({id:e,source:t,type:i})}\n${function({type:n}){return`\n#define SHADER_TYPE_${Y4[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:ode(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// 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"}}(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 AS(n,ip.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"),AS(n,ip.GLSL_DERIVATIVES)&&G4(n,ip.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"),AS(n,ip.GLSL_FRAG_DATA)&&G4(n,ip.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"),AS(n,ip.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}(v)}\n${f?"":"precision highp float;\n\n"}\n`:`${_}\n`;const w=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),x={},N={},V={};for(const U in a){const ee="string"==typeof a[U]?{injection:a[U],order:0}:a[U],de=U.match(/^(v|f)s:(#)?([\w-]+)$/);if(de){const me=de[3];de[2]?"decl"===me?N[U]=[ee]:V[U]=[ee]:x[U]=[ee]}else V[U]=[ee]}for(const U of r){d&&U.checkDeprecations(y,d),C+=U.getModuleSource(i,g);const de=U.injections[i];for(const ae in de){const me=ae.match(/^(v|f)s:#([\w-]+)$/);if(me){const Be="decl"===me[2]?N:V;Be[ae]=Be[ae]||[],Be[ae].push(de[ae])}else x[ae]=x[ae]||[],x[ae].push(de[ae])}}return C+=yde,C=z4(C,i,N),C+=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}(w[i],x),C+=y,C=z4(C,i,V),C=function(n,e,t){switch(e){case 300:return t?DS(n,ude):function(n){const e=(n=DS(n,dde)).match(LI);if(e){const t=e[1];n=n.replace(new RegExp(`\\b${NI}\\b`,"g"),t)}else{const t="fragmentColor";n=n.replace(pde,i=>`out vec4 ${t};\n${i}`).replace(new RegExp(`\\b${NI}\\b`,"g"),t)}return n}(n);case 100:return t?DS(n,hde):function(n){const e=(n=DS(n,fde)).match(LI);if(e){const t=e[1];n=n.replace(LI,"").replace(new RegExp(`\\b${t}\\b`,"g"),NI)}return n}(n);default:throw new Error(`unknown GLSL version ${e}`)}}(C,l?100:g,f),C}function Cde(n){return function(t){const i={};for(const r of n){const s=r.getUniforms(t,i);Object.assign(i,s)}return i}}const Tde={5126:er.bind(null,"uniform1fv",Oa,1,io),35664:er.bind(null,"uniform2fv",Oa,2,io),35665:er.bind(null,"uniform3fv",Oa,3,io),35666:er.bind(null,"uniform4fv",Oa,4,io),5124:er.bind(null,"uniform1iv",fh,1,io),35667:er.bind(null,"uniform2iv",fh,2,io),35668:er.bind(null,"uniform3iv",fh,3,io),35669:er.bind(null,"uniform4iv",fh,4,io),35670:er.bind(null,"uniform1iv",fh,1,io),35671:er.bind(null,"uniform2iv",fh,2,io),35672:er.bind(null,"uniform3iv",fh,3,io),35673:er.bind(null,"uniform4iv",fh,4,io),35674:er.bind(null,"uniformMatrix2fv",Oa,4,Ju),35675:er.bind(null,"uniformMatrix3fv",Oa,9,Ju),35676:er.bind(null,"uniformMatrix4fv",Oa,16,Ju),35678:Fs,35680:Fs,5125:er.bind(null,"uniform1uiv",OS,1,io),36294:er.bind(null,"uniform2uiv",OS,2,io),36295:er.bind(null,"uniform3uiv",OS,3,io),36296:er.bind(null,"uniform4uiv",OS,4,io),35685:er.bind(null,"uniformMatrix2x3fv",Oa,6,Ju),35686:er.bind(null,"uniformMatrix2x4fv",Oa,8,Ju),35687:er.bind(null,"uniformMatrix3x2fv",Oa,6,Ju),35688:er.bind(null,"uniformMatrix3x4fv",Oa,12,Ju),35689:er.bind(null,"uniformMatrix4x2fv",Oa,8,Ju),35690:er.bind(null,"uniformMatrix4x3fv",Oa,12,Ju),35678:Fs,35680:Fs,35679:Fs,35682:Fs,36289:Fs,36292:Fs,36293:Fs,36298:Fs,36299:Fs,36300:Fs,36303:Fs,36306:Fs,36307:Fs,36308:Fs,36311:Fs},Ade={},Dde={},Ode={},K4=[0];function BI(n,e,t,i){1===e&&"boolean"==typeof n&&(n=n?1:0),Number.isFinite(n)&&(K4[0]=n,n=K4);const r=n.length;if(r%e&&vt.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 er(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{nt(s===d,"Uniform length cannot change.");for(let p=0;p{const a=String(o+e);return e5(a,r-a.length)+t+s})}(e);return{shaderName:l,errors:J4(s,c),warnings:J4(o,c)}}(i,this.source,this.shaderType,this.id);throw vt.error(`GLSL compilation errors in ${r}\n${s}`)(),vt.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 VI extends lb{get[Symbol.toStringTag](){return"VertexShader"}constructor(e,t){"string"==typeof t&&(t={source:t}),super(e,Object.assign({},t,{shaderType:35633}))}_createHandle(){return this.gl.createShader(35633)}}class zI extends lb{get[Symbol.toStringTag](){return"FragmentShader"}constructor(e,t){"string"==typeof t&&(t={source:t}),super(e,Object.assign({},t,{shaderType:35632}))}_createHandle(){return this.gl.createShader(35632)}}const os=5126,cb=5124,ub=5125,jI={[os]:[os,1,"float"],35664:[os,2,"vec2"],35665:[os,3,"vec3"],35666:[os,4,"vec4"],[cb]:[cb,1,"int"],35667:[cb,2,"ivec2"],35668:[cb,3,"ivec3"],35669:[cb,4,"ivec4"],[ub]:[ub,1,"uint"],36294:[ub,2,"uvec2"],36295:[ub,3,"uvec3"],36296:[ub,4,"uvec4"],35670:[os,1,"bool"],35671:[os,2,"bvec2"],35672:[os,3,"bvec3"],35673:[os,4,"bvec4"],35674:[os,8,"mat2"],35685:[os,8,"mat2x3"],35686:[os,8,"mat2x4"],35675:[os,12,"mat3"],35687:[os,12,"mat3x2"],35688:[os,12,"mat3x4"],35676:[os,16,"mat4"],35689:[os,16,"mat4x2"],35690:[os,16,"mat4x3"]};function o5(n){const e=jI[n];if(!e)return null;const[t,i]=e;return{type:t,components:i}}function a5(n,e){switch(n){case 5120:case 5121:case 5122:case 5123:n=os}for(const t in jI){const[i,r,s]=jI[t];if(i===n&&r===e)return{glType:t,name:s}}return null}class phe{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(!In(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}=o5(i),a={type:s,size:r*o};this._inferProperties(e,t,a);const l={location:e,name:t,accessor:new ta(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}=o5(i),l={location:e,name:t,accessor:new ta({type:s,size:r*o})};this.varyingInfos.push(l),this.varyingInfosByName[l.name]=l}}const ghe=35981,mhe=["setVertexArray","setAttributes","setBuffers","unsetBuffers","use","getUniformCount","getUniformInfo","getUniformLocation","getUniformValue","getVarying","getFragDataLocation","getAttachedShaders","getAttributeCount","getAttributeLocation","getAttributeInfo"];class c5 extends Ku{get[Symbol.toStringTag](){return"Program"}constructor(e,t={}){super(e,t),this.stubRemovedMethods("Program","v6.0",mhe),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=ghe}=e;return this.hash=t||"",this.vs="string"==typeof i?new VI(this.gl,{id:`${e.id}-vs`,source:i}):i,this.fs="string"==typeof r?new zI(this.gl,{id:`${e.id}-fs`,source:r}):r,nt(this.vs instanceof VI),nt(this.fs instanceof zI),this.uniforms={},this._textureUniforms={},s&&s.length>0&&(eo(this.gl),this.varyings=s,this.gl2.transformFeedbackVaryings(this.handle,s,o)),this._compileAndLink(),this._readUniformLocationsFromLinkedProgram(),this.configuration=new phe(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:y,samplers:v}){if((y||v)&&(vt.deprecated("Program.draw({uniforms})","Program.setUniforms(uniforms)")(),this.setUniforms(y||{})),vt.priority>=e){const C=g?g.id:"default",w=`mode=${dh(this.gl,t)} verts=${i} instances=${c} indexType=${dh(this.gl,l)} isInstanced=${d} isIndexed=${a} Framebuffer=${C}`;vt.log(e,w)()}return nt(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 C=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 nt(!1),0}}(t);p.begin(C)}this._bindTextures(),rc(this.gl,_,()=>{a&&d?this.gl2.drawElementsInstanced(t,i,l,r,c):a&&In(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={}){vt.priority>=2&&function(n,e,t){for(const i in n){const r=n[i];if((!t||Boolean(t[i]))&&!Rde(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 ss&&(s=s.texture),s instanceof ep)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)&&kde(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 VI({handle:r});break;case 35632:i.fs=new zI({handle:r})}return i}_getParameter(e){return this.gl.getProgramParameter(this.handle,e)}_setId(e){if(!e){const t=this._getName();this.id=ea(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),vt.time(4,`linkProgram for ${this._getName()}`)(),e.linkProgram(this.handle),vt.timeEnd(4,`linkProgram for ${this._getName()}`)(),e.debug||vt.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(x=>this._getHash(x.name)).sort(),g=o.map(x=>this._getHash(x)),_=Object.keys(r).sort(),y=Object.keys(s).sort(),v=[],C=[];for(const x of _)v.push(this._getHash(x)),v.push(this._getHash(r[x]));for(const x of y)C.push(this._getHash(x)),C.push(this._getHash(s[x]));const w=`${d}/${f}D${v.join("/")}M${p.join("/")}I${C.join("/")}V${g.join("/")}H${this.stateHash}B${a}${l?"T":""}`;if(!this._programCache[w]){const x=function(n,e){const{vs:t,fs:i}=e,r=Que(e.modules||[]);return{gl:n,vs:X4(n,Object.assign({},e,{source:t,type:ab,modules:r})),fs:X4(n,Object.assign({},e,{source:i,type:"fs",modules:r})),getUniforms:Cde(r)}}(this.gl,{vs:t,fs:i,modules:c,inject:s,defines:r,hookFunctions:this._hookFunctions,transpileToGLSL100:l});this._programCache[w]=new c5(this.gl,{hash:w,vs:x.vs,fs:x.fs,varyings:o,bufferMode:a}),this._getUniforms[w]=x.getUniforms||(N=>{}),this._useCounts[w]=0}return this._useCounts[w]++,this._programCache[w]}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":Xv.chrome?"Chrome":Xv.safari?"Safari":Xv.mozInnerScreenX?"Firefox":"Unknown"}()}static getDefaultArray(e){return e.luma=e.luma||{},e.luma.defaultVertexArray||(e.luma.defaultVertexArray=new Ia(e,{handle:null,isDefaultArray:!0})),e.luma.defaultVertexArray}static getMaxAttributes(e){return Ia.MAX_ATTRIBUTES=Ia.MAX_ATTRIBUTES||e.getParameter(34921),Ia.MAX_ATTRIBUTES}static setConstant(e,t,i){switch(i.constructor){case Float32Array:Ia._setConstantFloatArray(e,t,i);break;case Int32Array:Ia._setConstantIntArray(e,t,i);break;case Uint32Array:Ia._setConstantUintArray(e,t,i);break;default:nt(!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 Ia.getMaxAttributes(this.gl)}initialize(e={}){return this.setProps(e)}setProps(e){return this}setElementBuffer(e=null,t={}){return nt(!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?(nt(In(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&&!Ia.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 Ai(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(!RS||RS.byteLength{switch(e){case 34373:return this.gl.getVertexAttribOffset(t,e);default:return this.gl.getVertexAttrib(t,e)}})}}const Ehe=/^(.+)__LOCATION_([0-9]+)$/,She=["setBuffers","setGeneric","clearBindings","setLocations","setGenericValues","setDivisor","enable","disable"];class Mhe{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 Ia(e),ZU(this,"VertexArray","v6.0",She),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 Ai(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,vt.once(3,()=>`unused value ${e} in ${this.id}`)(),s;const l=this._getAttributeInfo(a||o);if(!l)return s;const d=ta.resolve(l.accessor,this.accessors[o]||{},i,r),{size:f,type:p}=d;return nt(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=Ehe.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 Ai)this.setBuffer(e,t);else if(Array.isArray(t)&&t.length&&t[0]instanceof Ai)this.setBuffer(e,t[0],t[1]);else if(ArrayBuffer.isView(t)||Array.isArray(t))this.setConstant(e,t);else{if(!(t.buffer instanceof Ai))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 Ai){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 vt.deprecated("setElements","setElementBuffer")(),this.setElementBuffer(e,t)}}function hb(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+=hb(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 u5(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 Ai){const p=e,{data:g,changed:_}=p.getDebugData();let y;return d=_?"*":"",f=g,l=p.byteLength,a=l/g.BYTES_PER_ELEMENT/o,t?y=`${t.divisor>0?"I ":"P "} ${a} (x${o}=${l} bytes ${dh(r,s)})`:(c=!0,y=`${l} bytes`),{[i]:`${d}${hb(f,{size:o,isInteger:c})}`,"Format ":y}}return f=e,o=e.length,s=String(e.constructor.name).replace("Array",""),c=-1!==s.indexOf("nt"),{[i]:`${hb(f,{size:o,isInteger:c})} (constant)`,"Format ":`${o}x${s} (constant)`}}function Ahe(n,e){const{type:t,size:i}=e,r=a5(t,i);return r?`${n} (${r.name})`:n}function d5({header:n="Uniforms",program:e,uniforms:t,undefinedOnly:i=!1}){nt(e);const s=".*Matrix",a={},l=Object.keys(e._uniformSetters).sort();let c=0;for(const p of l)!p.match(".*_.*")&&!p.match(s)&&UI({table:a,header:n,uniforms:t,uniformName:p,undefinedOnly:i})&&c++;for(const p of l)p.match(s)&&UI({table:a,header:n,uniforms:t,uniformName:p,undefinedOnly:i})&&c++;for(const p of l)a[p]||UI({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]:hb(g)})}return{table:a,count:c,unusedTable:f,unusedCount:d}}function UI({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?hb(s):"N/A","Uniform Type":o?s:"NOT PROVIDED"},0))}function h5(n){const{type:e,size:t}=n.accessor,i=a5(e,t);return i?`${i.name} ${n.name}`:n.name}const Ihe={POSITION:"positions",NORMAL:"normals",COLOR_0:"colors",TEXCOORD_0:"texCoords",TEXCOORD_1:"texCoords1",TEXCOORD_2:"texCoords2"};function Rhe(n,e){const{attributeMap:t=Ihe}=e||{};return t&&t[n]||n}function khe(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}nt(Number.isFinite(e.size),`attribute ${n} needs size`)}const f5=()=>{},Lhe={};class Mm{constructor(e,t={}){const{id:i=ea("model")}=t;nt(mS(e)),this.id=i,this.gl=e,this.id=t.id||ea("Model"),this.lastLogTime=0,this.animated=!1,this.initialize(t)}initialize(e){this.props={},this.programManager=e.programManager||db.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={},nt(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 nt(Number.isFinite(e)),this.vertexCount=e,this}setInstanceCount(e){return nt(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=Rhe(s,undefined);if("indices"===s)r=o;else if(o.constant)i[a]=o.value;else{const l=o.value,c=K({},o);delete c.value,i[a]=[new Ai(n,l),c],khe(s,c)}}if(r){const s=r.value||r;nt(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 Ai(n,{data:s,target:34963}),o]}return i}(this.gl,e),this.vertexArray.setAttributes(this.geometryBuffers),this}setAttributes(e={}){if(_m(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 pI(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),vt.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&&vt.warn("Found instanced attributes on non-instanced model",this.id)();const{isInstanced:y,instanceCount:v}=this,{onBeforeRender:C=f5,onAfterRender:w=f5}=this.props;C(),this.program.setUniforms(this.uniforms);const x=this.program.draw(Object.assign(Lhe,e,{logPriority:c,uniforms:null,framebuffer:i,parameters:a,drawMode:this.getDrawMode(),vertexCount:this.getVertexCount(),vertexArray:l,transformFeedback:o,isIndexed:f,indexType:p,isInstanced:y,instanceCount:v,offset:f?g:0}));return w(),vt.priority>=2&&this._logDrawCallEnd(c,l,i),x}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 vt.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}nt(t instanceof c5,"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 Mhe(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 Ai&&t.delete()}}_setAnimationProps(e){this.animated&&nt(e,"Model.draw(): animated uniforms but no animationProps")}_setFeedbackBuffers(e={}){if(_m(e))return this;const{gl:t}=this.program;return this.transformFeedback=this.transformFeedback||new N4(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:vt.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=u5(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}: ${Ahe(s.name,a)}`),t[o]=u5(n,i[r],a,e)}}return t}({vertexArray:t,header:`${this.id} attributes`,attributes:this._attributes}),{table:o,unusedTable:a,unusedCount:l}=d5({header:`${this.id} uniforms`,program:this.program,uniforms:Object.assign({},this.program.uniforms,i)}),{table:c,count:d}=d5({header:`${this.id} uniforms`,program:this.program,uniforms:Object.assign({},this.program.uniforms,i),undefinedOnly:!0});d>0&&vt.log("MISSING UNIFORMS",Object.keys(c))(),l>0&&vt.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 ${h5(i)}`]={[t]:JSON.stringify(i.accessor)});for(const i of n.varyingInfos)i&&(e[`out ${h5(i)}`]={[t]:JSON.stringify(i.accessor)});return e}(this.vertexArray.configuration);vt.table(e,s)(),vt.table(e,o)(),vt.table(e+1,f)(),r&&r.log({logLevel:2,message:`Rendered to ${r.id}`}),vt.groupEnd(2,`>>> DRAWING MODEL ${this.id}`)()}}class HI{static isSupported(e){return In(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();nt(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 Mm(t,Object.assign({},e,{fs:e.fs||F4({version:L4(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!(_m(n.feedbackBuffers)&&_m(n.feedbackMap)&&!(n.varyings&&n.varyings.length>0))})(t)&&(this.bufferTransform=new Pue(e,t)),function(n){return!(_m(n._sourceTextures)&&!n._targetTexture&&!n._targetTextureVarying)}(t)&&(this.textureTransform=new Wue(e,t)),nt(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 kS(){}const zhe={onStart:kS,onUpdate:kS,onInterrupt:kS,onEnd:kS};class fb{constructor(e){this._inProgress=!1,this._handle=null,this.timeline=e,this.settings={}}get inProgress(){return this._inProgress}start(e){this.cancel(),this.settings=K(K({},zhe),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 Yhe={interpolation:class{constructor({gl:e,attribute:t,timeline:i}){this.gl=e,this.type="interpolation",this.transition=new fb(i),this.attribute=t,this.attributeInTransition=new xI(e,t.settings),this.currentStartIndices=t.startIndices,this.currentLength=0,this.transform=function(n,e){const t=O4(e.size);return new HI(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 Ai(e,r),new Ai(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;I4(r);const o={numInstances:t,attribute:s,fromLength:this.currentLength,fromStartIndices:this.currentStartIndices,getData:e.enter};for(const a of r)P4(K({buffer:a},o));this.currentStartIndices=s.startIndices,this.currentLength=MI(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:D4(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 fb(i),this.attribute=t,this.attributeInTransition=new xI(e,Lt(K({},t.settings),{normalized:!1})),this.currentStartIndices=t.startIndices,this.currentLength=0,this.texture=function(n){return new na(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 ss(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=O4(e.size);return new HI(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 Ai(e,r),new Ai(e,r),new Ai(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)P4(K({buffer:a},o));this.currentStartIndices=s.startIndices,this.currentLength=MI(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:D4(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]}}),I4(e),this.attributeInTransition.update({buffer:e[1],value:this.attribute.value}),vS(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 Xhe{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=HI.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 jn.warn("WebGL2 not supported by this browser. Transition for ".concat(e," is disabled."))();r&&this._removeTransition(e);const o=Yhe[i.type];o?this.transitions[e]=new o({attribute:t,timeline:this.timeline,gl:this.gl}):(jn.error("unsupported transition type '".concat(i.type,"'"))(),s=!1)}(s||t.needsRedraw())&&(this.needsRedraw=!0,this.transitions[e].start(i,this.numInstances))}}const p5="attributeManager.invalidate";class tfe{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 Xhe(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;no("attribute.updateStart",t),t.allocate(i)&&no("attribute.allocate",t,i),t.updateBuffer(e)&&(this.needsRedraw=!0,no("attribute.updateEnd",t,i))}}function m5(n,e,t,i,r){const s=e-n;return(t-e)*r+-s*i+s+e}function _5(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=A4(r)))return;const o=sfe[r.type];if(!o)return void jn.error("unsupported transition type '".concat(r.type,"'"))();const a=new o(this.timeline);a.start(Lt(K({},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 FS={COMPONENT:Symbol.for("component"),ASYNC_DEFAULTS:Symbol.for("asyncPropDefaults"),ASYNC_ORIGINAL:Symbol.for("asyncPropOriginal"),ASYNC_RESOLVED:Symbol.for("asyncPropResolved")},{COMPONENT:afe}=FS;function ufe(n,e){if(!n.transitions)return null;const t={},i=GI(n);for(const r in n.transitions){const s=i[r],o=s&&s.type;("number"===o||"color"===o||"array"===o)&&$I(n[r],e[r],s)&&(t[r]=!0)}return t}function y5({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=$I(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=$I(n[s],e[s],i[s]);if(o)return"".concat(r,".").concat(s," ").concat(o)}}return null}function $I(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 ffe(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(!vfe(i[r],e[r])){t=n(i),e=i;break}return t}}function bfe(n,e){if(!e)return n;const t=K(K({},n),e);if("defines"in e&&(t.defines=K(K({},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=K({},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 WI(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],y=e[13],v=e[14],C=e[15],w=t*a-i*o,x=t*l-r*o,N=t*c-s*o,V=i*l-r*a,U=i*c-s*a,ee=r*c-s*l,de=d*y-f*_,ae=d*v-p*_,me=d*C-g*_,Ee=f*v-p*y,Be=f*C-g*y,te=p*C-g*v,ne=w*te-x*Be+N*Ee+V*me-U*ae+ee*de;return ne?(n[0]=(a*te-l*Be+c*Ee)*(ne=1/ne),n[1]=(r*Be-i*te-s*Ee)*ne,n[2]=(y*ee-v*U+C*V)*ne,n[3]=(p*U-f*ee-g*V)*ne,n[4]=(l*me-o*te-c*ae)*ne,n[5]=(t*te-r*me+s*ae)*ne,n[6]=(v*N-_*ee-C*x)*ne,n[7]=(d*ee-p*N+g*x)*ne,n[8]=(o*Be-a*me+c*de)*ne,n[9]=(i*me-t*Be-s*de)*ne,n[10]=(_*U-y*N+C*w)*ne,n[11]=(f*N-d*U-g*w)*ne,n[12]=(a*ae-o*Ee-l*de)*ne,n[13]=(t*Ee-i*ae+r*de)*ne,n[14]=(y*x-_*V-v*w)*ne,n[15]=(d*V-f*x+p*w)*ne,n):null}function rp(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],y=e[12],v=e[13],C=e[14],w=e[15],x=t[0],N=t[1],V=t[2],U=t[3];return n[0]=x*i+N*a+V*f+U*y,n[1]=x*r+N*l+V*p+U*v,n[2]=x*s+N*c+V*g+U*C,n[3]=x*o+N*d+V*_+U*w,n[4]=(x=t[4])*i+(N=t[5])*a+(V=t[6])*f+(U=t[7])*y,n[5]=x*r+N*l+V*p+U*v,n[6]=x*s+N*c+V*g+U*C,n[7]=x*o+N*d+V*_+U*w,n[8]=(x=t[8])*i+(N=t[9])*a+(V=t[10])*f+(U=t[11])*y,n[9]=x*r+N*l+V*p+U*v,n[10]=x*s+N*c+V*g+U*C,n[11]=x*o+N*d+V*_+U*w,n[12]=(x=t[12])*i+(N=t[13])*a+(V=t[14])*f+(U=t[15])*y,n[13]=x*r+N*l+V*p+U*v,n[14]=x*s+N*c+V*g+U*C,n[15]=x*o+N*d+V*_+U*w,n}function LS(n,e,t){var o,a,l,c,d,f,p,g,_,y,v,C,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],y=e[9],v=e[10],C=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]=y,n[10]=v,n[11]=C,n[12]=o*i+d*r+_*s+e[12],n[13]=a*i+f*r+y*s+e[13],n[14]=l*i+p*r+v*s+e[14],n[15]=c*i+g*r+C*s+e[15]),n}function BS(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 b5(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 C5(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 w5(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 VS(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 ia(4);ia!=Float32Array&&(n[0]=0,n[1]=0,n[2]=0,n[3]=0)}();const E5=[0,0,0,0],qfe=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0],Yfe=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],Xfe=[0,0,0],Kfe=[0,0,0],Zfe=NS(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=E5,l=E5,c=n.cameraPosition;const{geospatialOrigin:d,shaderCoordinateOrigin:f,offsetMode:p}=S5(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=VS([],l,o),s=i||s,o=rp([],r,s),o=rp([],o,qfe)),{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:Xfe,project_uScale:n.scale,project_uViewProjectionMatrix:s,project_uCameraPosition:a};if(c){const _=n.getDistanceScales(c);switch(t){case qn.METER_OFFSETS:g.project_uCommonUnitsPerWorldUnit=_.unitsPerMeter,g.project_uCommonUnitsPerWorldUnit2=_.unitsPerMeter2;break;case qn.LNGLAT:case qn.LNGLAT_OFFSETS:g.project_uCommonUnitsPerWorldUnit=_.unitsPerDegree,g.project_uCommonUnitsPerWorldUnit2=_.unitsPerDegree2;break;case qn.CARTESIAN:g.project_uCommonUnitsPerWorldUnit=[1,1,_.unitsPerMeter[2]],g.project_uCommonUnitsPerWorldUnit2=[0,0,_.unitsPerMeter2[2]]}}return g});function S5(n,e,t=Kfe){let r,i=t,s=!0;switch(r=e===qn.LNGLAT_OFFSETS||e===qn.METER_OFFSETS?t:n.isGeospatial?[Math.fround(n.longitude),Math.fround(n.latitude),0]:null,n.projectionMode){case Yc.WEB_MERCATOR:(e===qn.LNGLAT||e===qn.CARTESIAN)&&(s=!1);break;case Yc.WEB_MERCATOR_AUTO_OFFSET:e===qn.LNGLAT?i=r:e===qn.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 Yc.IDENTITY:i=n.position.map(Math.fround);break;case Yc.GLOBE:s=!1,r=null;break;default:s=!1}return i[2]=i[2]||0,{geospatialOrigin:r,shaderCoordinateOrigin:i,offsetMode:s}}class tpe extends vI{get ELEMENTS(){return Qu(!1),0}get RANK(){return Qu(!1),0}toString(){let e="[";if(Ji.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 $t).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 function(n,e,t,i,r){var o,s=1/Math.tan(e/2);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)}(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],y=n[14],v=n[15];return(e*o-t*s)*(f*v-p*y)-(e*a-i*s)*(d*v-p*_)+(e*l-r*s)*(d*y-f*_)+(t*a-i*o)*(c*v-p*g)-(t*l-r*o)*(c*y-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 WI(this,this),this.check()}multiplyLeft(e){return rp(this,e,this),this.check()}multiplyRight(e){return rp(this,this,e),this.check()}rotateX(e){return b5(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 C5(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,_,y,v,C,w,x,N,V,U,ee,de,ae,me,Ee,Be,te,ne,Ie,r=i[0],s=i[1],o=i[2],a=Math.hypot(r,s,o);at?t:n}const qI=Math.log2||function(n){return Math.log(n)*Math.LOG2E};function ed(n,e){if(!n)throw new Error(e||"@math.gl/web-mercator: assertion failed.")}const oc=Math.PI,O5=oc/4,ac=oc/180,YI=180/oc,XI=4003e4,jS=85.051129;function US([n,e]){return ed(Number.isFinite(n)),ed(Number.isFinite(e)&&e>=-90&&e<=90,"invalid latitude"),[512*(n*ac+oc)/(2*oc),512*(oc+Math.log(Math.tan(O5+e*ac*.5)))/(2*oc)]}function Dm([n,e]){const t=n/512*(2*oc)-oc,i=2*(Math.atan(Math.exp(e/512*(2*oc)-oc))-O5);return[t*YI,i*YI]}function KI({latitude:n,longitude:e,highPrecision:t=!1}){ed(Number.isFinite(n)&&Number.isFinite(e));const i={},s=Math.cos(n*ac),o=512/360,a=o/s,l=512/XI/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=ac*Math.tan(n*ac)/s,f=512/XI*c,p=f/a*l;i.unitsPerDegree2=[0,o*c/2,f],i.unitsPerMeter2=[p,0,p]}return i}function I5(n,e){const[t,i,r]=n,[s,o,a]=e,{unitsPerMeter:l,unitsPerMeter2:c}=KI({longitude:t,latitude:i,highPrecision:!0}),d=US(n);d[0]+=s*(l[0]+c[0]*o),d[1]+=o*(l[1]+c[1]*o);const f=Dm(d),p=(r||0)+(a||0);return Number.isFinite(r)||Number.isFinite(a)?[f[0],f[1],p]:f}function R5(n){return 2*Math.atan(.5/n)*YI}function k5(n,e){const[t,i,r=0]=n;return ed(Number.isFinite(t)&&Number.isFinite(i)&&Number.isFinite(r)),Am(e,[t,i,r,1])}function gb(n,e,t=0){const[i,r,s]=n;if(ed(Number.isFinite(i)&&Number.isFinite(r),"invalid pixel coordinate"),Number.isFinite(s))return Am(e,[i,r,s,1]);const o=Am(e,[i,r,0,1]),a=Am(e,[i,r,1,1]),l=o[2],c=a[2];return x5([],o,a,l===c?0:((t||0)-l)/(c-l))}const F5=Math.PI/180;function N5(n,e,t){const{pixelUnprojectionMatrix:i}=n,r=Am(i,[e,0,1,1]),s=Am(i,[e,n.height,1,1]),c=Dm(x5([],r,s,(t*n.distanceScales.unitsPerMeter[2]-r[2])/(s[2]-r[2])));return c[2]=t,c}const _pe=Math.PI/180,ype=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],QI=[0,0,0],bpe={unitsPerMeter:[1,1,1],metersPerUnit:[1,1,1]};let Om=(()=>{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?Yc.WEB_MERCATOR:Yc.WEB_MERCATOR_AUTO_OFFSET:Yc.IDENTITY}equals(t){return t instanceof n&&(this===t||t.width===this.width&&t.height===this.height&&t.scale===this.scale&&rb(t.projectionMatrix,this.projectionMatrix)&&rb(t.viewMatrix,this.viewMatrix))}project(t,{topLeft:i=!0}={}){const s=k5(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=gb([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?US(t):t}unprojectFlat(t){return this.isGeospatial?Dm(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?KI({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 Om{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:y=1.5}=t;const v=Math.pow(2,s);g=g||1,_=_||1,y=Math.max(.75,y);const{fov:C,aspect:w,focalDistance:x,near:N,far:V}=function({width:n,height:e,fovy:t=R5(1.5),altitude:i,pitch:r=0,nearZMultiplier:s=1,farZMultiplier:o=1}){void 0!==i&&(t=R5(i));const a=.5*t*ac,l=function(n){return.5/Math.tan(.5*n*ac)}(t),c=r*ac,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}}({width:g,height:_,pitch:o,altitude:y,nearZMultiplier:l,farZMultiplier:c});let U=function({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 LS(o,o,[0,0,-i]),b5(o,o,-e*ac),C5(o,o,t*ac),BS(o,o,[r/=n,r,r]),s&&LS(o,o,function(n,e){return n[0]=-e[0],n[1]=-e[1],n[2]=-e[2],n}([],s)),o}({height:_,pitch:o,bearing:a,scale:v,altitude:y});p&&(U=(new $t).translate([512*p,0,0]).multiplyLeft(U)),super(Lt(K({},t),{width:g,height:_,viewMatrix:U,longitude:r,latitude:i,zoom:s,orthographic:d,fovyRadians:C,aspect:w,focalDistance:x,near:N,far:V})),this.latitude=i,this.longitude=r,this.zoom=s,this.pitch=o,this.bearing=a,this.altitude=y,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(Lt(K({},this),{worldOffset:s})):this;this._subViewports.push(o)}}return this._subViewports}addMetersToLngLat(t,i){return I5(t,i)}panByPosition(t,i){const r=gb(i,this.pixelUnprojectionMatrix),o=zS([],this.projectFlat(t),M5([],r)),a=zS([],this.center,o),[l,c]=this.unprojectFlat(a);return{longitude:l,latitude:c}}getBounds(t={}){const i=function(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*F5:Math.atan(.5/n.altitude))>(90-n.pitch)*F5-.01?(l=N5(n,0,e),c=N5(n,t,e)):(l=r([0,0],s),c=r([t,0],s)),[o,a,c,l]}(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}=function({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}:ed(Number.isFinite(s.top)&&Number.isFinite(s.bottom)&&Number.isFinite(s.left)&&Number.isFinite(s.right));const f=US([a,D5(d,-jS,jS)]),p=US([c,D5(l,-jS,jS)]),g=[Math.max(Math.abs(p[0]-f[0]),i),Math.max(Math.abs(p[1]-f[1]),i)],_=[n-s.left-s.right-2*Math.abs(o[0]),e-s.top-s.bottom-2*Math.abs(o[1])];ed(_[0]>0&&_[1]>0);const y=_[0]/g[0],v=_[1]/g[1],N=Dm([(p[0]+f[0])/2+(s.right-s.left)/2/y,(p[1]+f[1])/2+(s.bottom-s.top)/2/v]),V=Math.min(r,qI(Math.abs(Math.min(y,v))));return ed(Number.isFinite(V)),{longitude:N[0],latitude:N[1],zoom:V}}(K({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 JI(n,e,t=!1){const i=e.projectPosition(n);if(t&&e instanceof j5){const[r,s,o=0]=n,a=e.getDistanceScales([r,s]);i[2]=o*a.unitsPerMeter[2]}return i}function U5(n,{viewport:e,modelMatrix:t,coordinateSystem:i,coordinateOrigin:r,offsetMode:s}){let[o,a,l=0]=n;switch(t&&([o,a,l]=VS([],[o,a,l,1],t)),i){case qn.LNGLAT:return JI([o,a,l],e,s);case qn.LNGLAT_OFFSETS:return JI([o+r[0],a+r[1],l+(r[2]||0)],e,s);case qn.METER_OFFSETS:return JI(I5(r,[o,a,l]),e,s);case qn.CARTESIAN:default:return e.isGeospatial?[o+r[0],a+r[1],l+r[2]]:e.projectPosition([o,a,l])}}const Epe={10241:9987,10240:9729,10242:33071,10243:33071},eP={},xpe={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||_b(n)&&(3===n.length||4===n.length),equal:(n,e,t)=>tP(n,e)},accessor:{validate(n,e){const t=HS(n);return"function"===t||t===HS(e.value)},equal:(n,e,t)=>"function"==typeof e||tP(n,e)},array:{validate:(n,e)=>e.optional&&!n||_b(n),equal:(n,e,t)=>t.compare?tP(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 na)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 na(t,Lt(K({},e),{parameters:K(K(K({},Epe),i),n.props.textureParameters)}));return eP[r.id]=!0,r}(t,n),release:n=>{!function(n){!n||!(n instanceof na)||eP[n.id]&&(n.delete(),delete eP[n.id])}(n)}}};function tP(n,e){if(n===e)return!0;if(!_b(n)||!_b(e))return!1;const t=n.length;if(t!==e.length)return!1;for(let i=0;i{},this.oldProps=Vpe,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[Lpe]||{},i=e[Npe]||e,r=e[Bpe]||{};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(x4(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 yn(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=iP(t);c=(g=yield p.next()).done,_=yield g.value,!c;c=!0){const v=_,{dataTransform:C}=i.component?i.component.props:{};a=C?C(v,a):a.concat(v),Object.defineProperty(a,"__diff",{enumerable:!1,value:[{startRow:l,endRow:a.length}]}),l=a.length,i._setAsyncPropValue(e,a,o)}}catch(v){d=!0,f=v}finally{try{!c&&null!=p.return&&(yield p.return())}finally{if(d)throw f}}const y=null===(r=i.layer)||void 0===r?void 0:r.props.onDataLoad;y&&y(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:W5,ASYNC_RESOLVED:q5,ASYNC_DEFAULTS:zpe}=FS,jpe={};let Upe=0,Hpe=(()=>{class n{constructor(){this.props=Dpe.apply(this,arguments),this.id=this.props.id,this.count=Upe++,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[zpe])s in i[q5]?r[s]=i[q5][s]:s in i[W5]&&(r[s]=i[W5][s]);return new this.constructor(K(K(K({},i),r),t))}get stats(){return this.internalState.stats}_initState(){this.internalState=new G5({})}}return n.componentName="Component",n.defaultProps=jpe,n})();class $pe extends G5{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 lc=n=>"function"==typeof n,ph=n=>null!==n&&"object"==typeof n,X5=n=>ph(n)&&n.constructor==={}.constructor,Gpe=n=>n&&"function"==typeof n[Symbol.iterator],Wpe=n=>n&&"function"==typeof n[Symbol.asyncIterator],vb=n=>"undefined"!=typeof Response&&n instanceof Response||n&&n.arrayBuffer&&n.text&&n.json,Im=n=>"undefined"!=typeof Blob&&n instanceof Blob,K5=n=>(n=>"undefined"!=typeof ReadableStream&&n instanceof ReadableStream||ph(n)&&lc(n.tee)&&lc(n.cancel)&&lc(n.getReader))(n)||(n=>ph(n)&&lc(n.read)&&lc(n.pipe)&&(n=>"boolean"==typeof n)(n.readable))(n);function sp(n,e){if(!n)throw new Error(e||"loader assertion failed.")}function rP(n){var e;return!!n&&(Array.isArray(n)&&(n=n[0]),Array.isArray(null===(e=n)||void 0===e?void 0:e.extensions))}function sP(n){var e,t;let i;return sp(n,"null loader"),sp(rP(n),"invalid loader"),Array.isArray(n)&&(i=n[1],n=Lt(K({},n=n[0]),{options:K(K({},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 Zc={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},oP=Zc.global||Zc.self||Zc.window||{},Qpe="object"!=typeof process||"[object process]"!==String(process)||process.browser,Z5="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version);Z5&&parseFloat(Z5[1]);const lP={};function Jpe(n){for(const e in lP)n.startsWith(e)&&(n=n.replace(e,lP[e]));return!n.startsWith("http://")&&!n.startsWith("https://")&&(n=`${n}`),n}const ege=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,tge=/^([-\w.]+\/[-\w.+]+)/;function nge(n){const e=tge.exec(n);return e?e[1]:n}function Q5(n){const e=ege.exec(n);return e?e[1]:""}const ige=/\?.*/;function qS(n){if(vb(n)){const e=cP(n.url||"");return{url:e,type:nge(n.headers.get("content-type")||"")||Q5(e)}}return Im(n)?{url:cP(n.name||""),type:n.type||""}:"string"==typeof n?{url:cP(n),type:Q5(n)}:{url:"",type:""}}function rge(n){return vb(n)?n.headers["content-length"]||-1:Im(n)?n.size:"string"==typeof n?n.length:n instanceof ArrayBuffer||ArrayBuffer.isView(n)?n.byteLength:-1}function cP(n){return n.replace(ige,"")}function J5(n){return uP.apply(this,arguments)}function uP(){return(uP=yn(function*(n){if(vb(n))return n;const e={},t=rge(n);t>=0&&(e["content-length"]=String(t));const{url:i,type:r}=qS(n);r&&(e["content-type"]=r);const s=yield age(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 sge(n){return dP.apply(this,arguments)}function dP(){return(dP=yn(function*(n){if(!n.ok){const e=yield oge(n);throw new Error(e)}})).apply(this,arguments)}function oge(n){return hP.apply(this,arguments)}function hP(){return(hP=yn(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 age(n){return fP.apply(this,arguments)}function fP(){return(fP=yn(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,${lge(n.slice(0,5))}`:null})).apply(this,arguments)}function lge(n){let e="";const t=new Uint8Array(n);for(let i=0;i{}}info(){return()=>{}}warn(){return()=>{}}error(){return()=>{}}}const nH={fetch:null,mimeType:void 0,nothrow:!1,log:new class{constructor(){sn(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:[]},dge={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 gP(){oP.loaders=oP.loaders||{};const{loaders:n}=oP;return n._state=n._state||{},n._state}const mP=()=>{const n=gP();return n.globalOptions=n.globalOptions||K({},nH),n.globalOptions};function hge(n,e,t,i){return t=t||[],function(n,e){rH(n,null,nH,dge,e);for(const t of e)rH(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=K({},n.options||{});return function(n,e){e&&!("baseUri"in n)&&(n.baseUri=e)}(r,t),null===r.log&&(r.log=new cge),oH(r,mP()),oH(r,e),r}(e,n,i)}function iH(n,e){const t=mP(),i=n||t;return"function"==typeof i.fetch?i.fetch:ph(i.fetch)?r=>eH(r,i):null!=e&&e.fetch?null==e?void 0:e.fetch:eH}function rH(n,e,t,i,r){const s=e||"Top level",o=e?`${e}.`:"";for(const a in n){const l=!e&&ph(n[a]),c="baseUri"===a&&!e,d="workerUrl"===a&&e;if(!(a in t)&&!c&&!d)if(a in i)tH.warn(`${s} loader option '${o}${a}' no longer supported, use '${i[a]}'`)();else if(!l){const f=pge(a,r);tH.warn(`${s} loader option '${o}${a}' not recognized. ${f}`)()}}}function pge(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 oH(n,e){for(const t in e)t in e&&(n[t]=X5(e[t])&&X5(n[t])?K(K({},n[t]),e[t]):e[t])}function Qc(n,e){if(!n)throw new Error(e||"loaders.gl assertion failed.")}function _ge(n,e="3.0.12"){return Qc(n,"no worker provided"),!(!e||!n.version)}const Jc={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},yge=Jc.global||Jc.self||Jc.window||{},_P="object"!=typeof process||"[object process]"!==String(process)||process.browser,yP="function"==typeof importScripts,vge="undefined"!=typeof window&&void 0!==window.orientation,aH="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version),vP=(aH&&parseFloat(aH[1]),new Map);function lH(n){const e=new Blob([n],{type:"application/javascript"});return URL.createObjectURL(e)}function cH(n,e=!0,t){const i=t||new Set;if(n)if(uH(n))i.add(n);else if(uH(n.buffer))i.add(n.buffer);else if(!ArrayBuffer.isView(n)&&e&&"object"==typeof n)for(const r in n)cH(n[r],e,i);return void 0===t?Array.from(i):[]}function uH(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 bP=()=>{};class dH{static isSupported(){return"undefined"!=typeof Worker}constructor(e){sn(this,"name",void 0),sn(this,"source",void 0),sn(this,"url",void 0),sn(this,"terminated",!1),sn(this,"worker",void 0),sn(this,"onMessage",void 0),sn(this,"onError",void 0),sn(this,"_loadableURL","");const{name:t,source:i,url:r}=e;Qc(i||r),this.name=t,this.source=i,this.url=r,this.onMessage=bP,this.onError=s=>console.log(s),this.worker=this._createBrowserWorker()}destroy(){this.onMessage=bP,this.onError=bP,this.worker.terminate(),this.terminated=!0}get isRunning(){return Boolean(this.onMessage)}postMessage(e,t){t=t||cH(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){Qc(n.source&&!n.url||!n.source&&n.url);let e=vP.get(n.source||n.url);return e||(n.url&&(e=function(n){return n.startsWith("http")?lH(function(n){return`try {\n importScripts('${n}');\n} catch (error) {\n console.error(error);\n throw error;\n}`}(n)):n}(n.url),vP.set(n.url,e)),n.source&&(e=lH(n.source),vP.set(n.source,e))),Qc(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 Ege{constructor(e,t){sn(this,"name",void 0),sn(this,"workerThread",void 0),sn(this,"isRunning",void 0),sn(this,"result",void 0),sn(this,"_resolve",void 0),sn(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){Qc(this.isRunning),this.isRunning=!1,this._resolve(e)}error(e){Qc(this.isRunning),this.isRunning=!1,this._reject(e)}}class Sge{constructor(e){sn(this,"name","unnamed"),sn(this,"source",void 0),sn(this,"url",void 0),sn(this,"maxConcurrency",1),sn(this,"maxMobileConcurrency",1),sn(this,"onDebug",()=>{}),sn(this,"reuseWorkers",!0),sn(this,"props",{}),sn(this,"jobQueue",[]),sn(this,"idleQueue",[]),sn(this,"count",0),sn(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=K(K({},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 yn(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 yn(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 Ege(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 td{static isSupported(){return dH.isSupported()}static getWorkerFarm(e={}){return td._workerFarm=td._workerFarm||new td({}),td._workerFarm.setProps(e),td._workerFarm}constructor(e){sn(this,"props",void 0),sn(this,"workerPools",new Map),this.props=K({},Mge),this.setProps(e),this.workerPools=new Map}destroy(){for(const e of this.workerPools.values())e.destroy()}setProps(e){this.props=K(K({},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 Sge({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 Tge(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 Qc(r),r}function Age(n,e){return!!td.isSupported()&&n.worker&&(null==e?void 0:e.worker)}function Dge(n,e,t,i,r){return CP.apply(this,arguments)}function CP(){return(CP=yn(function*(n,e,t,i,r){const s=n.id,o=Tge(n,t),l=td.getWorkerFarm(t).getWorkerPool({name:s,url:o});t=JSON.parse(JSON.stringify(t));const c=yield l.startJob("process-on-worker",Oge.bind(null,r));return c.postMessage("process",{input:e,options:t}),yield(yield c.result).result})).apply(this,arguments)}function Oge(n,e,t,i){return wP.apply(this,arguments)}function wP(){return(wP=yn(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)}sn(td,"_workerFarm",void 0);var fH=ze(521);function pH(n){if(function(n){return n&&"object"==typeof n&&n.isBuffer}(n)&&(n=function(n){return fH.toArrayBuffer?fH.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 kge(...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 gH(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 Fge(n){return SP.apply(this,arguments)}function SP(){return(SP=yn(function*(n){const e=[];var r,t=!0,i=!1;try{for(var o,a,s=iP(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 kge(...e)})).apply(this,arguments)}const Bge=262144;function mH(n){this.wrapped=n}function bb(n){return new mH(n)}function Cb(n){var e,t;function r(o,a){try{var l=n[o](a),c=l.value,d=c instanceof mH;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 xP(n){return function(){return new Cb(n.apply(this,arguments))}}function TP(){return(TP=xP(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(OP)}function Wge(n,e,t){return IP.apply(this,arguments)}function IP(){return(IP=yn(function*(n,e,t){const i=n instanceof ArrayBuffer||ArrayBuffer.isView(n);if("string"==typeof n||i)return Gge(n,e);if(Im(n)&&(n=yield J5(n)),vb(n)){const r=n;return yield sge(r),e.binary?yield r.arrayBuffer():yield r.text()}if(K5(n)&&(n=$ge(n,t)),Gpe(n)||Wpe(n))return Fge(n);throw new Error(OP)})).apply(this,arguments)}function Yge(n,e,t=null){if(t)return t;const i=K({fetch:iH(e,n)},n);return Array.isArray(i.loaders)||(i.loaders=null),i}function Xge(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 yH=()=>{const n=gP();return n.loaderRegistry=n.loaderRegistry||[],n.loaderRegistry};function vH(n){const e=yH();n=Array.isArray(n)?n:[n];for(const t of n){const i=sP(t);e.find(r=>i===r)||e.unshift(i)}}const Zge=/\.([^.]+)$/;function Qge(n){return kP.apply(this,arguments)}function kP(){return(kP=yn(function*(n,e=[],t,i){if(!CH(n))return null;let r=bH(n,e,Lt(K({},t),{nothrow:!0}),i);if(r)return r;if(Im(n)&&(r=bH(n=yield n.slice(0,10).arrayBuffer(),e,t,i)),!(r||null!=t&&t.nothrow))throw new Error(wH(n));return r})).apply(this,arguments)}function bH(n,e=[],t,i){if(!CH(n))return null;if(e&&!Array.isArray(e))return sP(e);let r=[];e&&(r=r.concat(e)),null!=t&&t.ignoreRegisteredLoaders||r.push(...yH()),function(n){for(const e of n)sP(e)}(r);const s=function(n,e,t,i){const{url:r,type:s}=qS(n),o=r||(null==i?void 0:i.url);let a=null;return null!=t&&t.mimeType&&(a=FP(e,null==t?void 0:t.mimeType)),a=a||function(n,e){const t=e&&Zge.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||FP(e,s),a=a||function(n,e){if(!e)return null;for(const t of n)if("string"==typeof e){if(rme(e,t))return t}else if(ArrayBuffer.isView(e)){if(EH(e.buffer,e.byteOffset,t))return t}else if(e instanceof ArrayBuffer&&EH(e,0,t))return t;return null}(e,n),a=a||FP(e,null==t?void 0:t.fallbackMimeType),a}(n,r,t,i);if(!(s||null!=t&&t.nothrow))throw new Error(wH(n));return s}function CH(n){return!(n instanceof Response&&204===n.status)}function wH(n){const{url:e,type:t}=qS(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)?NP(n.buffer,n.byteOffset,e):n instanceof ArrayBuffer?NP(n,0,e):""}(n)}", contentType: "${t}"`),e&&(i+=` url: ${e}`),i}function FP(n,e){for(const t of n)if(t.mimeTypes&&t.mimeTypes.includes(e)||e===`application/x.${t.id}`)return t;return null}function rme(n,e){return e.testText?e.testText(n):(Array.isArray(e.tests)?e.tests:[e.tests]).some(i=>n.startsWith(i))}function EH(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 eu=new Uint8ClampedArray(0);const gme={data:{type:"data",value:fme,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=Lt(K({},r),{fetch:Lt(K({},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:wb(n,i),persistent:!1}),l=!0),l?o.subscribe({resourceId:n,onChange:c=>t.internalState.reloadAsyncProp(e,c),consumerId:t.id,requestId:e}):wb(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:qn.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 Eb=(()=>{class n extends Hpe{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=U5(t,{viewport:i,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem}),[s,o,a]=k5(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=K({},n);let{coordinateSystem:t}=n;const{viewport:i,coordinateOrigin:r,fromCoordinateSystem:s,fromCoordinateOrigin:o}=n;return t===qn.DEFAULT&&(t=i.isGeospatial?qn.LNGLAT:qn.CARTESIAN),void 0===s&&(e.fromCoordinateSystem=t),void 0===o&&(e.fromCoordinateOrigin=r),e.coordinateSystem=t,e}(e),{geospatialOrigin:l,shaderCoordinateOrigin:c,offsetMode:d}=S5(t,i,r),f=U5(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===qn.DEFAULT||t===qn.LNGLAT||t===qn.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){sc(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=bfe(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||!pme({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(eu.length/3);if(this.internalState.usesPickingColorCache=!0,rSH&&jn.warn("Layer has too many data objects. Picking might not be able to distinguish all objects.")(),eu=nb.allocate(eu,i,{size:3,copy:!0,maxCount:Math.max(i,SH)});const s=Math.floor(eu.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&&no("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=y5({newProps:n,oldProps:e,propTypes:GI(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&&v5(n,e,"all"))return{all:!0};const t={};let i=!1;for(const r in n.updateTriggers)"all"!==r&&v5(n,e,r)&&(t[r]=!0,i=t);return i}(n,e)),{dataChanged:i,propsChanged:t,updateTriggersChanged:r,extensionsChanged:ffe(n,e),transitionsChanged:ufe(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=GI(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 tfe(this.context.gl,{id:this.props.id,stats:this.context.stats,timeline:this.context.timeline})}_initState(){sc(!this.internalState&&!this.state),sc(isFinite(this.props.coordinateSystem));const t=this._getAttributeManager();t&&t.addInstanced({instancePickingColors:{type:5121,size:3,noAlloc:!0,update:this.calculateInstancePickingColors}}),this.internalState=new $pe({attributeManager:t,layer:this}),this.clearChangeFlags(),this.state={},Object.defineProperty(this.state,"attributeManager",{get:()=>(jn.deprecated("layer.state.attributeManager","layer.getAttributeManager()"),t)}),this.internalState.layer=this,this.internalState.uniformTransitions=new ofe(this.context.timeline),this.internalState.onAsyncPropUpdated=this._onAsyncPropUpdated.bind(this),this.internalState.setAsyncProps(this.props)}_transferState(t){no("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=gme,n})(),MH=(()=>{class n extends Eb{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:y,extensions:v,fetch:C,_subLayerProps:w}=this.props,x={opacity:i,pickable:r,visible:s,parameters:o,getPolygonOffset:a,highlightedObjectIndex:l,autoHighlight:c,highlightColor:d,coordinateSystem:f,coordinateOrigin:p,wrapLongitude:g,positionFormat:_,modelMatrix:y,extensions:v,fetch:C},N=w&&w[t.id],V=N&&N.updateTriggers,U=t.id||"sublayer";if(N){const ee=this.constructor._propTypes,de=t.type?t.type._propTypes:{};for(const ae in N){const me=de[ae]||ee[ae];me&&"accessor"===me.type&&(N[ae]=this.getSubLayerAccessor(N[ae]))}}Object.assign(x,t,N),x.id="".concat(this.props.id,"-").concat(U),x.updateTriggers=K(K({all:this.props.updateTriggers.all},t.updateTriggers),V);for(const ee of v){const de=ee.getSubLayerProps.call(this,ee);de&&Object.assign(x,de,{updateTriggers:Object.assign(x.updateTriggers,de.updateTriggers)})}return x}_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=EI(t,Boolean),this.internalState.subLayers=t),no("compositeLayer.renderLayers",this,i,t);for(const r of t)r.parent=this}}return n.layerName="CompositeLayer",n})();const _me=/([0-9]+\.?[0-9]*)(%|px)/;function XS(n){switch(typeof n){case"number":return{position:n,relative:!1};case"string":const e=n.match(_me);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 KS(n,e){return n.relative?Math.round(n.position*e):n.position}function Sb(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)&&Sb(i,r)))return!1}return!0}class zP{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=Om}=e;sc(!p||p instanceof Om),this.viewportInstance=p,this.id=t||this.constructor.displayName||"view",this.type=g,this.props=Lt(K({},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):Sb(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=K({},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:KS(this._x,e),y:KS(this._y,t),width:KS(this._width,e),height:KS(this._height,t)}}_getControllerProps(e){let t=this.props.controller;return t?!0===t?e:("function"==typeof t&&(t={type:t}),K(K({},e),t)):null}_getViewport(e,t){const{type:i}=this;return new i(K(K(K({},e),this.props),t))}_parseDimensions({x:e,y:t,width:i,height:r}){this._x=XS(e),this._y=XS(t),this._width=XS(i),this._height=XS(r)}}const Mb=()=>{},xH={transitionEasing:n=>n,transitionInterruption:1,onTransitionStart:Mb,onTransitionInterrupt:Mb,onTransitionEnd:Mb};class yme{constructor(e,t={}){this.ControllerState=e,this.props=K(K({},xH),t),this.propsInTransition=null,this.transition=new fb(t.timeline),this.onViewStateChange=t.onViewStateChange||Mb,this.onStateChange=t.onStateChange||Mb,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=K(K({},xH),e),this.props=e,this._shouldIgnoreViewportChange(i,e))return t;if(this._isTransitionEnabled(e)){const{interruption:r,endProps:s}=this.transition.settings,o=K(K({},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(K(K({},this.props),c)).getViewportProps(),this.onViewStateChange({viewState:this.propsInTransition,oldViewState:this.props})}}const TH=["longitude","latitude","zoom","bearing","pitch"],bme=["longitude","latitude","zoom"];class AH 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)||!rb(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];sc(Number.isFinite(i)||Array.isArray(i),"".concat(t," is required for transition"))})}}{constructor(e={}){super((Array.isArray(e)?e:e.transitionProps)||{compare:TH,extract:TH,required:bme}),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]=bS(e[s]||0,t[s]||0,i);if(t.aroundPosition){const s=this.opts.makeViewport(K(K({},t),r));Object.assign(r,s.panByPosition(t.aroundPosition,bS(e.around,t.around,i)))}return r}}const gh={transitionDuration:0},Cme={transitionDuration:300,transitionEasing:n=>n,transitionInterruption:1},QS=n=>1-(1-n)*(1-n),Pm_WHEEL=["wheel"],Pm_PAN=["panstart","panmove","panend"],Pm_PINCH=["pinchstart","pinchmove","pinchend"],Pm_TRIPLE_PAN=["tripanstart","tripanmove","tripanend"],Pm_DOUBLE_TAP=["doubletap"],Pm_KEYBOARD=["keydown"];class jP{constructor(e,t={}){this.ControllerState=e,this.controllerState=null,this.controllerStateProps=null,this.eventManager=null,this.transitionManager=new yme(e,Lt(K({},t),{onViewStateChange:this._onTransition.bind(this),onStateChange:this._setInteractionState.bind(this)}));const i=this.linearTransitionProps;this._transition=i&&Lt(K({},Cme),{transitionInterpolator:new AH({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(K(K({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(Pm_WHEEL,d&&i),this.toggleEvents(Pm_PAN,d&&(r||s)),this.toggleEvents(Pm_PINCH,d&&(a||l)),this.toggleEvents(Pm_TRIPLE_PAN,d&&l),this.toggleEvents(Pm_DOUBLE_TAP,d&&o),this.toggleEvents(Pm_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=K(K({},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,gh,{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,gh,{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,Lt(K({},this._getTransitionProps()),{transitionDuration:t,transitionEasing:QS}),{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,gh,{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,Lt(K({},this._getTransitionProps()),{transitionDuration:t,transitionEasing:QS}),{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,Lt(K({},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,gh,{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,gh,{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,Lt(K({},this._getTransitionProps()),{transitionDuration:t,transitionEasing:QS}),{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,gh,{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,gh,{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,Lt(K({},this._getTransitionProps({around:r})),{transitionDuration:t,transitionEasing:QS}),{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?Lt(K({},t),{transitionInterpolator:new AH(Lt(K({},e),{transitionProps:this.linearTransitionProps,makeViewport:this.controllerState.makeViewport}))}):t:gh}}class DH{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 mh_target=[0,0,0];class JS extends DH{constructor({makeViewport:e,width:t,height:i,rotationX:r=0,rotationOrbit:s=0,target:o=mh_target,zoom:a=0,minRotationX:l=-90,maxRotationX:c=90,minZoom:d=-(1/0),maxZoom:f=Infinity,startPanPosition:p,startRotatePos:g,startRotationX:_,startRotationOrbit:y,startZoomPosition:v,startZoom:C}){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:y,startZoomPosition:v,startZoom:C},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=K({},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(Lt(K({},this._viewportProps),{zoom:a}));return this._getUpdatedState(K({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),np(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 JS(K(K(K({},this._viewportProps),this._state),e))}_applyConstraints(e){const{maxZoom:t,minZoom:i,zoom:r,maxRotationX:s,minRotationX:o,rotationOrbit:a}=e;return e.zoom=np(r,i,t),e.rotationX=np(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 Eme extends jP{constructor(e){super(JS,e)}get linearTransitionProps(){return["target","zoom","rotationX","rotationOrbit"]}}class Sme extends jP{constructor(e){e.dragMode=e.dragMode||"pan",super(JS,e)}_onPanRotate(e){return!1}get linearTransitionProps(){return["target","zoom"]}}const Mme=(new $t).lookAt({eye:[0,0,1]});function xme({width:n,height:e,near:t,far:i}){return n=n||1,e=e||1,(new $t).ortho({left:-n/2,right:n/2,bottom:-e/2,top:e/2,near:t,far:i})}class Tme extends Om{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(Lt(K({},e),{longitude:null,position:a,viewMatrix:Mme.clone().scale([c,c*(l?-1:1),c]),projectionMatrix:xme({width:t,height:i,near:r,far:s}),zoom:o}))}panByPosition(e,t){const r=zS([],e,M5([],gb(t,this.pixelUnprojectionMatrix)));return{target:zS([],this.center,r)}}}let Ame=(()=>{class n extends zP{constructor(t){super(Lt(K({},t),{type:Tme}))}get controller(){return this._getControllerProps({type:Sme})}}return n.displayName="OrthographicView",n})();const eM=Math.PI/180;function Dme({height:n,fovy:e,orbitAxis:t,rotationX:i,rotationOrbit:r,zoom:s}){const o=.5/Math.tan(e*eM/2),a="Z"===t?[0,0,1]:[0,1,0],l="Z"===t?[0,-o,0]:[0,0,o],c=(new $t).lookAt({eye:l,up:a});c.rotateX(i*eM),"Z"===t?c.rotateZ(r*eM):c.rotateY(r*eM);const d=Math.pow(2,s)/(n||1);return c.scale(d),c}class Ome extends Om{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(Lt(K({},e),{longitude:null,viewMatrix:Dme({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]=gb([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 Ime=(()=>{class n extends zP{constructor(t={}){const{orbitAxis:i="Z"}=t;super(Lt(K({},t),{orbitAxis:i,type:Ome}))}get controller(){return this._getControllerProps({type:Eme})}}return n.displayName="OrbitView",n})();const Pme=[255,255,255],Rme=1;let kme=0;class OH{constructor(e={}){const{color:t=Pme}=e,{intensity:i=Rme}=e;this.id=e.id||"ambient-".concat(kme++),this.color=t,this.intensity=i,this.type="ambient"}}const Fme=[255,255,255],Nme=1,Lme=[0,0,-1];let Bme=0;class IH{constructor(e={}){const{color:t=Fme}=e,{intensity:i=Nme}=e,{direction:r=Lme}=e,{_shadow:s=!1}=e;this.id=e.id||"directional-".concat(Bme++),this.color=t,this.intensity=i,this.type="directional",this.direction=new to(r).normalize().toArray(),this.shadow=s}getProjectedLight(){return this}}class PH{constructor(e={}){const{id:t="effect"}=e;this.id=t,this.props=K({},e)}preRender(){}getModuleParameters(){}cleanup(){}}class UP extends class{constructor(e,t={}){const{id:i="pass"}=t;this.id=i,this.gl=e,this.props=K({},t)}setProps(e){Object.assign(this.props,e)}render(){}cleanup(){}}{render(e){return Xu(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){Xu(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=RH(),c={viewport:e,isPicking:i.startsWith("picking"),renderPass:i};for(let d=0;dpI(e,c))}const l={totalCount:t.length,visibleCount:0,compositeCount:0,pickableCount:0};Xu(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]||RH(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 Ume extends UP{constructor(e,t){super(e,t),this.shadowMap=new na(e,{width:1,height:1,parameters:{10241:9729,10240:9729,10242:33071,10243:33071}}),this.depthBuffer=new vm(e,{format:33189,width:1,height:1}),this.fbo=new ss(e,{id:"shadowmap",width:1,height:1,attachments:{36064:this.shadowMap,36096:this.depthBuffer}})}render(e){const t=this.fbo;rc(this.gl,{depthRange:[0,1],depthTest:!0,blend:!1,clearColor:[1,1,1,1]},()=>{const i=e.viewports[0],r=mm(this.gl),s=i.width*r,o=i.height*r;(s!==t.width||o!==t.height)&&t.resize({width:s,height:o}),super.render(Lt(K({},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 $me=Object.keys(qn).map(n=>"const int COORDINATE_SYSTEM_".concat(n," = ").concat(qn[n],";")).join(""),Gme=Object.keys(Yc).map(n=>"const int PROJECTION_MODE_".concat(n," = ").concat(Yc[n],";")).join(""),Wme="".concat($me,"\n").concat(Gme,"\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"),qme={},HP={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:Wme,getUniforms:function(n=qme){return n.viewport?function({viewport:n,devicePixelRatio:e=1,modelMatrix:t=null,coordinateSystem:i=qn.DEFAULT,coordinateOrigin:r,autoWrapLongitude:s=!1}={}){i===qn.DEFAULT&&(i=n.isGeospatial?qn.LNGLAT:qn.CARTESIAN);const o=Zfe({viewport:n,devicePixelRatio:e,coordinateSystem:i,coordinateOrigin:r});return o.project_uWrapLongitude=s,o.project_uModelMatrix=t||Yfe,o}(n):{}}},Zme=NS(function({viewport:n,center:e}){return new $t(n.viewProjectionMatrix).invert().transform(e)}),Qme=NS(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=gb([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 to(n.center).negate()),l=s.map(d=>a.transform(d)),c=(new $t).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}),Jme=[0,0,0,1],e_e=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0],$P={name:"shadow",dependencies:[HP],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||Jme,shadow_uLightId:n.shadowLightId||0,shadow_uLightCount:n.shadowMatrices.length},i=Zme({viewport:n.viewport,center:e.project_uCenter}),r=[],s=Qme({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{}}},s_e={color:[255,255,255],intensity:1},kH=[{color:[255,255,255],intensity:1,direction:[-1,3,-1]},{color:[255,255,255],intensity:.9,direction:[1,-8,-2.5]}],o_e=[0,0,0,200/255];class GP extends PH{constructor(e){super(e),this.ambientLight=null,this.directionalLights=[],this.pointLights=[],this.shadowColor=o_e,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=db.getDefaultProgramManager(e),$P&&this.programManager.addDefaultModule($P)),this.dummyShadowMap||(this.dummyShadowMap=new na(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($P),this.programManager=null)}_createLightMatrix(){const e=[];for(const t of this.directionalLights){const i=(new $t).lookAt({eye:new to(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=l_e++;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 c_e{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=wb(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 u_e{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 c_e(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 d_e=[{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"},HP],h_e=["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 f_e(n){const e=db.getDefaultProgramManager(n);for(const t of d_e)e.addDefaultModule(t);for(const t of h_e)e.addShaderHook(t);return e}const m_e=Object.seal({layerManager:null,resourceManager:null,deck:null,gl:null,stats:null,shaderCache:null,pickingFBO:null,mousePosition:null,userData:{}});class __e{constructor(e,{deck:t,stats:i,viewport:r,timeline:s}={}){this.lastRenderedLayers=[],this.layers=[],this.resourceManager=new u_e({gl:e,protocol:"deck://"}),this.context=Lt(K({},m_e),{layerManager:this,gl:e,deck:t,programManager:e&&f_e(e),stats:i||new aI({id:"deck.gl"}),viewport:r||new Om({id:"DEFAULT-INITIAL-VIEWPORT"}),timeline:s||new FH,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){no("layerManager.setLayers",this,t,e),this.lastRenderedLayers=e,e=EI(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 no("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]?jn.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&&jn.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 y_e{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=EI(e,Boolean),this._diffViews(e,this.views)&&this.setNeedsUpdate("views changed"),this.views=e}_setViewState(e){e?(!Sb(e,this.viewState)&&this.setNeedsUpdate("viewState changed"),this.viewState=e):jn.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)(K({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=Lt(K(K(K({},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 b_e extends DH{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:y,startRotatePos:v,startBearing:C,startPitch:w,startZoom:x,normalize:N}={}){sc(Number.isFinite(s)),sc(Number.isFinite(r)),sc(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:N}),this._state={startPanLngLat:_,startZoomLngLat:y,startRotatePos:v,startBearing:C,startPitch:w,startZoom:x},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(Lt(K({},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(Lt(K({},this._viewportProps),{zoom:o}));return this._getUpdatedState(K({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=K({},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(K(K(K({makeViewport:this.makeViewport},this._viewportProps),this._state),e))}_applyConstraints(e){const{maxZoom:t,minZoom:i,zoom:r}=e;e.zoom=np(r,i,t);const{maxPitch:s,minPitch:o,pitch:a}=e;e.pitch=np(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=A5(t+180,360)-180),(o<-180||o>180)&&(o=A5(o+180,360)-180);const a=qI(e/512);if(r<=a)r=a,i=0;else{const l=e/2/Math.pow(2,r),c=Dm([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 np(t+Math.log2(e),r,i)}_calculateNewPitchAndBearing({deltaScaleX:e,deltaScaleY:t,startBearing:i,startPitch:r}){t=np(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 C_e extends jP{constructor(e){e.dragMode=e.dragMode||"pan",super(b_e,e)}setProps(e){const t=this.controllerStateProps;super.setProps(e),(!t||t.height!==e.height)&&this.updateViewport(new this.ControllerState(K(K({makeViewport:this.makeViewport},this.controllerStateProps),this._state)))}get linearTransitionProps(){return["longitude","latitude","zoom","bearing","pitch"]}}let w_e=(()=>{class n extends zP{constructor(t){super(Lt(K({},t),{type:j5}))}get controller(){return this._getControllerProps({type:C_e})}}return n.displayName="MapView",n})();const E_e=new GP;class S_e{constructor(){this.effects=[],this._internalEffects=[],this._needsRedraw="Initial render",this.setEffects()}setProps(e){"effects"in e&&(e.effects.length!==this.effects.length||!Sb(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 GP)||this._internalEffects.push(E_e)}}class M_e extends UP{}const LH={blendFunc:[1,0,32771,0],blendEquation:32774};class BH extends UP{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,rc(_,Lt(K({scissorTest:!0,scissor:[a,l,c,d],clearColor:[0,0,0,0],depthMask:!0,depthTest:!0,depthRange:[0,1],colorMask:[!0,!0,!0,!0]},LH),{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}:Lt(K({},LH),{blend:!0,blendColor:[0,0,0,this.useAlpha?(t+1)/255:1]});return K(K({},e.props.parameters),i)}}class T_e{constructor(e){this.gl=e,this.layerFilter=null,this.drawPickingColors=!1,this.drawLayersPass=new M_e(e),this.pickLayersPass=new BH(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||ss.getDefaultFramebuffer(this.gl),this._preRender(e.effects,e);const i=this.lastPostProcessEffect?this.renderBuffers[0]:e.target,r=t.render(Lt(K({},e),{target:i}));this._postRender(e.effects,e),this.renderCount++,no("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 ss(this.gl),new ss(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 A_e={pickedColor:null,pickedLayer:null,pickedObjectIndex:-1};function D_e({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 v=0;v=0){const w=v+o-t,x=w*w+y;x<=d&&(d=x,f=p)}p+=4}}if(f>=0){const g=n[f+3]-1,_=n.slice(f,f+4),y=e[g];if(y){const v=y.decodePickingColor(_),C=Math.floor(f/4/l);return{pickedColor:_,pickedLayer:y,pickedObjectIndex:v,pickedX:o+(f/4-C*l),pickedY:a+C}}jn.error("Picked non-existent layer. Is picking buffer corrupt?")()}}return A_e}function VH({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 I_e(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(y=>y.props.id===p);_&&l.unshift(_)}t.layerId=g,t.index=a,t.info=null}}const c=VH(n),d=new Map;return d.set(null,c),l.forEach(f=>{let p=K({},c);f===o&&(p.color=s,p.index=a,p.picked=!0),p=zH({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 zH({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 R_e{constructor(e){this.gl=e,this.pickingFBO=null,this.pickLayersPass=new BH(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?K(K({},s),f):Object.assign(f,{color:null,object:null,index:-1})}_resizeBuffer(){const{gl:e}=this;return this.pickingFBO||(this.pickingFBO=new ss(e),ss.isSupported(e,{colorBufferFloat:!0})&&(this.depthFBO=new ss(e),this.depthFBO.attach({36064:new na(e,{format:In(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?(jn.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:VH({viewports:i,x:r,y:s})};this._resizeBuffer();const f=mm(this.gl),p=rI(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:y,height:v}=this.pickingFBO,C=this._getPickingRect({deviceX:g[0],deviceY:g[1],deviceRadius:_,deviceWidth:y,deviceHeight:v});let w;const x=[],N={};for(let V=0;V=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)}):jn.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:C,width:y.x+y.width-g,height:_-C},pass:"picking:".concat(l),redrawReason:l}),layers:e}),V=new Map,U=Number.isFinite(c);for(let ee=0;ee=c);ee++){const de=N[ee];let ae={color:de.pickedColor,layer:null,index:de.pickedObjectIndex,picked:!0,x:r,y:s,width:o,height:a,pixelRatio:f};ae=zH({layer:de.pickedLayer,info:ae,mode:l}),V.has(ae.object)||V.set(ae.object,ae)}return Array.from(V.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 vS(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 k_e={zIndex:1,position:"absolute",pointerEvents:"none",color:"#a0a7b4",backgroundColor:"#29323c",padding:"10px",top:0,left:0,display:"none"};class F_e{constructor(e){const t=e.parentElement;t&&(this.el=document.createElement("div"),this.el.className="deck-tooltip",Object.assign(this.el.style,k_e),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 jH(n,e){if(!n)throw new Error(e)}const tu={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},UH=tu.global||tu.self||tu.window,L_e="object"!=typeof process||"[object process]"!==String(process)||process.browser,HH="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version),{_parseImageNode:B_e}=(HH&&parseFloat(HH[1]),UH),WP="undefined"!=typeof Image,qP="undefined"!=typeof ImageBitmap,V_e=Boolean(B_e),YP=!!L_e||V_e;function $H(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 GH(n){switch($H(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 U_e=/^data:image\/svg\+xml/,H_e=/\.svg((\?|#).*)?$/;function XP(n){return n&&(U_e.test(n)||H_e.test(n))}function $_e(n,e){if(XP(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 qH(n,e)}function qH(n,e){if(XP(e))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(n)])}function YH(n,e,t){return KP.apply(this,arguments)}function KP(){return(KP=yn(function*(n,e,t){const i=$_e(n,t),r=self.URL||self.webkitURL,s="string"!=typeof i&&r.createObjectURL(i);try{return yield G_e(s||i,e)}finally{s&&r.revokeObjectURL(s)}})).apply(this,arguments)}function G_e(n,e){return ZP.apply(this,arguments)}function ZP(){return(ZP=yn(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 W_e={};let XH=!0;function q_e(n,e,t){return QP.apply(this,arguments)}function QP(){return(QP=yn(function*(n,e,t){let i;i=XP(t)?yield YH(n,e,t):qH(n,t);const r=e&&e.imagebitmap;return yield Y_e(i,r)})).apply(this,arguments)}function Y_e(n){return JP.apply(this,arguments)}function JP(){return(JP=yn(function*(n,e=null){if((X_e(e)||!XH)&&(e=null),e)try{return yield createImageBitmap(n,e)}catch(t){console.warn(t),XH=!1}return yield createImageBitmap(n)})).apply(this,arguments)}function X_e(n){for(const e in n||W_e)return!1;return!0}const nu=!1,xb=!0;function eR(n){const e=Tb(n);return function(n){const e=Tb(n);return e.byteLength>=24&&2303741511===e.getUint32(0,nu)?{mimeType:"image/png",width:e.getUint32(16,nu),height:e.getUint32(20,nu)}:null}(e)||function(n){const e=Tb(n);if(!(e.byteLength>=3&&65496===e.getUint16(0,nu)&&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,nu)?{mimeType:"image/gif",width:e.getUint16(6,xb),height:e.getUint16(8,xb)}:null}(e)||function(n){const e=Tb(n);return e.byteLength>=14&&16973===e.getUint16(0,nu)&&e.getUint32(2,xb)===e.byteLength?{mimeType:"image/bmp",width:e.getUint32(18,xb),height:e.getUint32(22,xb)}:null}(e)}function Tb(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 tye(n,e){const{mimeType:t}=eR(n)||{},{_parseImageNode:i}=UH;return jH(i),i(n,t,e)}function tR(){return(tR=yn(function*(n,e,t){const r=((e=e||{}).image||{}).type||"auto",{url:s}=t||{};let a;switch(iye(r)){case"imagebitmap":a=yield q_e(n,e,s);break;case"image":a=yield YH(n,e,s);break;case"data":a=yield tye(n,e);break;default:jH(!1)}return"data"===r&&(a=GH(a)),a})).apply(this,arguments)}function iye(n){switch(n){case"auto":case"data":return function(){if(qP)return"imagebitmap";if(WP)return"image";if(YP)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}();default:return function(n){switch(n){case"auto":return qP||WP||YP;case"imagebitmap":return qP;case"image":return WP;case"data":return YP;default:throw new Error(`@loaders.gl/images: image ${n} not supported in this environment`)}}(n),n}}const nR={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 tR.apply(this,arguments)},tests:[n=>Boolean(eR(new DataView(n)))],options:{image:{type:"auto",decode:!0}}};var Rm=ze(761);const sye={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},Ab="8.5.8",tM=Rm.CO.deck&&Rm.CO.deck.VERSION;if(tM&&tM!==Ab)throw new Error("deck.gl - multiple versions detected: ".concat(tM," vs ").concat(Ab));tM||(jn.log(1,"deck.gl ".concat(Ab))(),Rm.CO.deck=Object.assign(Rm.CO.deck||{},{VERSION:Ab,version:Ab,log:jn,_registerLoggers:function(n){TI=n}}),vH([sye,[nR,{imagebitmap:{premultiplyAlpha:"none"}}]]));const oye=Rm.CO.deck;class nM extends Ku{get[Symbol.toStringTag](){return"Query"}static isSupported(e,t=[]){const i=In(e),r=f4(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:nt(!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 nM.isSupported(this.gl)?this.gl2.createQuery():null}_deleteHandle(){this.gl2.deleteQuery(this.handle)}}const KH=yS()&&"undefined"!=typeof document;let mye=0;class _ye{constructor(e={}){const{onCreateContext:t=(v=>qU(v)),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:_=Jf.get("animation-loop-"+mye++)}=e;let{useDevicePixels:y=!0}=e;"useDevicePixelRatio"in e&&(vt.deprecated("useDevicePixelRatio","useDevicePixels")(),y=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:y}),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 nt("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=nM.isSupported(this.gl,["timers"])?new nM(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 yn(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 vt.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=KH?new Promise((e,t)=>{KH&&"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?oI(this.props.gl,e):this.onCreateContext(e),!mS(this.gl))throw new Error("AnimationLoop.onCreateContext - illegal context returned");(function(n){Xu(n,iI)})(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)&&(vt.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)&&(vt.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 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: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 yye=ze(524),iM=ze.n(yye);const vye={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}))}}(iM().MouseInput);const Eye=iM().Manager,iu=iM(),Sye=iu?[[iu.Pan,{event:"tripan",pointers:3,threshold:0,enable:!1}],[iu.Rotate,{enable:!1}],[iu.Pinch,{enable:!1}],[iu.Swipe,{enable:!1}],[iu.Pan,{threshold:0,enable:!1}],[iu.Press,{enable:!1}],[iu.Tap,{event:"doubletap",taps:2,enable:!1}],[iu.Tap,{event:"anytap",enable:!1}],[iu.Tap,{enable:!1}]]:null,JH={tripan:["rotate","pinch","pan"],rotate:["pinch"],pinch:["pan"],pan:["press","doubletap","anytap","tap"],doubletap:["anytap"],anytap:["tap"]},Mye={doubletap:["tap"]},xye={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"]},Tye={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"},e6={click:"tap",anyclick:"anytap",dblclick:"doubletap",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup",mouseover:"pointerover",mouseout:"pointerout",mouseleave:"pointerleave"},Aye="undefined"!=typeof navigator&&navigator.userAgent?navigator.userAgent.toLowerCase():"",km="undefined"!=typeof window?window:global;"undefined"!=typeof global?global:window,"undefined"!=typeof document&&document;let t6=!1;try{const n={get passive(){return t6=!0,!0}};km.addEventListener("test",n,n),km.removeEventListener("test",n,n)}catch(n){}const Dye=-1!==Aye.indexOf("firefox"),{WHEEL_EVENTS:Oye}=rR,i6=4.000244140625;class Rye{constructor(e,t,i={}){this.element=e,this.callback=t,this.options=Object.assign({enable:!0},i),this.events=Oye.concat(i.events||[]),this.handleEvent=this.handleEvent.bind(this),this.events.forEach(r=>e.addEventListener(r,this.handleEvent,!!t6&&{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;km.WheelEvent&&(Dye&&e.deltaMode===km.WheelEvent.DOM_DELTA_PIXEL&&(t/=km.devicePixelRatio),e.deltaMode===km.WheelEvent.DOM_DELTA_LINE&&(t*=40));const i={x:e.clientX,y:e.clientY};0!==t&&t%i6==0&&(t=Math.floor(t/i6)),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:kye}=rR,r6="pointermove",s6="pointerover",o6="pointerout",a6="pointerleave";class Fye{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=kye.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===r6&&(this.enableMoveEvent=t),e===s6&&(this.enableOverEvent=t),e===o6&&(this.enableOutEvent=t),e===a6&&(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:s6,srcEvent:e,pointerType:"mouse",target:e.target})}handleOutEvent(e){this.enableOutEvent&&"mouseout"===e.type&&this.callback({type:o6,srcEvent:e,pointerType:"mouse",target:e.target})}handleLeaveEvent(e){this.enableLeaveEvent&&"mouseleave"===e.type&&this.callback({type:a6,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:r6,srcEvent:e,pointerType:"mouse",target:e.target});break;case"mouseup":this.pressed=!1}}}const{KEY_EVENTS:Nye}=rR,l6="keydown";class Lye{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=Nye.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===l6&&(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:l6,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 u6="contextmenu";class Bye{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===u6&&(this.options.enable=t)}handleEvent(e){!this.options.enable||this.callback({type:u6,center:{x:e.clientX,y:e.clientY},srcEvent:e,pointerType:"mouse",target:e.target})}}const Vye={pointerdown:1,pointermove:2,pointerup:4,mousedown:1,mousemove:2,mouseup:4},d6={srcElement:"root",priority:0};class Zye{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({},d6,i):d6;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&&JH[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 Rye(e,this._onOtherEvent,{enable:!1}),this.moveInput=new Fye(e,this._onOtherEvent,{enable:!1}),this.keyInput=new Lye(e,this._onOtherEvent,{enable:!1,tabIndex:t.tabIndex}),this.contextmenuInput=new Bye(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=Mye[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=e6[e]||e;let c=a.get(l);c||(c=new Zye(this),a.set(l,c),c.recognizerName=Tye[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(e6[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=xye[t.type];i&&this.manager.emit(i,e)}_onOtherEvent(e){this.manager.emit(e.type,e)}}function ap(){}const h6={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:ap,onResize:ap,onViewStateChange:ap,onInteractionStateChange:ap,onBeforeRender:ap,onAfterRender:ap,onLoad:ap,onError:(n,e)=>jn.error(n)(),_onMetrics:null,getCursor:({isDragging:n})=>n?"grabbing":"grab",debug:!1,drawPickingColors:!1};class sM{constructor(e){e=K(K({},h6),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&&jn.warn("View state tracking is disabled. Use either `initialViewState` for auto update or `viewState` for manual update.")(),"IE"===(0,Rm.qs)()&&jn.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 aI({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&&nb.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&&jn.removed("onLayerHover","onHover")(),"onLayerClick"in e&&jn.removed("onLayerClick","onClick")(),e.initialViewState&&!Sb(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](K({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),sc(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 _ye({width:t,height:i,useDevicePixels:d,autoResizeDrawingBuffer:f,autoResizeViewport:!1,gl:r,onCreateContext:p=>qU(Lt(K(K({},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 w_e({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,oI(e,{enable:!0,copyState:!0})),this.tooltip=new F_e(this.canvas),Xu(e,{blend:!0,blendFunc:[770,771,1,771],polygonOffsetFill:!0,depthTest:!0,depthFunc:515}),this.props.onWebGLInitialized(e);const t=new FH;t.play(),this.animationLoop.attachTimeline(t),this.eventManager=new Jye(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 IU)this.eventManager.on(r,this._onEvent);this.viewManager=new y_e({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 __e(e,{deck:this,stats:this.stats,viewport:i,timeline:t}),this.effectManager=new S_e,this.deckRenderer=new T_e(e),this.deckPicker=new R_e(e),this.setProps(this.props),this._updateCanvasSize(),this.props.onLoad()}_drawLayers(e,t){const{gl:i}=this.layerManager.context;Xu(i,this.props.parameters),this.props.onBeforeRender({gl:i}),this.deckRenderer.renderLayers(K({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(),jn.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=Lt(K({},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=IU[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=Jf.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}}sM.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(PH)),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}},sM.defaultProps=h6,sM.VERSION=oye.VERSION;const oM={name:"project32",dependencies:[HP],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"},ive={pickingSelectedColor:null,pickingHighlightColor:new Uint8Array([0,255,255,255]),pickingActive:!1,pickingAttribute:!1},aM=K({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=ive){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}}),f6={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6};class _h{static get DRAW_MODE(){return f6}constructor(e={}){const{id:t=ea("geometry"),drawMode:i=f6.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?K({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,nt(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?(nt(!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 nt(Number.isFinite(i)),i}}const p6=()=>{},cve={10241:9987,10240:9729,10242:33071,10243:33071};function uve(n){return Math.pow(2,Math.ceil(Math.log2(n)))}function dve(n,e,t,i){return t===e.width&&i===e.height?e:(n.canvas.height=i,n.canvas.width=t,n.clearRect(0,0,n.canvas.width,n.canvas.height),n.drawImage(e,0,0,e.width,e.height,0,0,t,i),n.canvas)}function Db(n){return n&&(n.id||n.url)}function g6(n,e,t){for(let i=0;i0){const{mapping:i,xOffset:r,yOffset:s,rowHeight:o,canvasHeight:a}=function({icons:n,buffer:e,mapping:t={},xOffset:i=0,yOffset:r=0,rowHeight:s=0,canvasWidth:o}){let a=[];for(let l=0;lo&&(g6(t,a,r),i=0,r=s+r+e,s=0,a=[]),a.push({icon:c,xOffset:i}),i=i+p+e,s=Math.max(s,f)}}return a.length>0&&g6(t,a,r),{mapping:t,rowHeight:s,xOffset:i,yOffset:r,canvasWidth:o,canvasHeight:uve(s+r+e)}}({icons:t,buffer:this._buffer,canvasWidth:this._canvasWidth,mapping:this._mapping,rowHeight:this._rowHeight,xOffset:this._xOffset,yOffset:this._yOffset});this._rowHeight=o,this._mapping=i,this._xOffset=r,this._yOffset=s,this._canvasHeight=a,this._texture||(this._texture=new na(this.gl,{width:this._canvasWidth,height:this._canvasHeight,parameters:cve})),this._texture.height!==this._canvasHeight&&(this._texture=function(n,e,t,i){const r=e.width,s=e.height,o=u4(e,{width:t,height:i});return function(n,e,t={}){const{sourceX:i=0,sourceY:r=0,targetMipmaplevel:s=0,targetInternalFormat:o=6408}=t;let{targetX:a,targetY:l,targetZ:c,width:d,height:f}=t;const{framebuffer:p,deleteFramebuffer:g}=tb(n);nt(p);const{gl:_,handle:y}=p,v=void 0!==a||void 0!==l||void 0!==c;a=a||0,l=l||0,c=c||0;const C=_.bindFramebuffer(36160,y);nt(e);let w=null;if(e instanceof ep&&(w=e,d=Number.isFinite(d)?d:w.width,f=Number.isFinite(f)?f:w.height,w.bind(0),e=w.target),v)switch(e){case 3553:case 34067:_.copyTexSubImage2D(e,s,a,l,i,r,d,f);break;case 35866:case 32879:eo(_).copyTexSubImage3D(e,s,a,l,c,i,r,d,f)}else _.copyTexImage2D(e,s,o,i,r,d,f,0);w&&w.unbind(),_.bindFramebuffer(36160,C||null),g&&p.delete()}(e,o,{targetY:0,width:r,height:s}),e.delete(),o}(0,this._texture,this._canvasWidth,this._canvasHeight)),this.onUpdate(),this._loadIcons(t)}}_loadIcons(e){const t=this._canvas.getContext("2d");for(const i of e)this._pendingCount++,wb(i.url,nR,this._loadOptions).then(r=>{const s=Db(i),{x:o,y:a,width:l,height:c}=this._mapping[s],d=dve(t,r,l,c);this._texture.setSubImageData({data:d,x:o,y:a,width:l,height:c}),this._texture.generateMipmap(),this.onUpdate()}).catch(r=>{this.onError({url:i.url,source:i.source,sourceIndex:i.sourceIndex,loadOptions:this._loadOptions,error:r})}).finally(()=>{this._pendingCount--})}}const m6=[0,0,0,255],mve={iconAtlas:{type:"image",value:null,async:!0},iconMapping:{type:"object",value:{},async:!0},sizeScale:{type:"number",value:1,min:0},billboard:!0,sizeUnits:"pixels",sizeMinPixels:{type:"number",min:0,value:0},sizeMaxPixels:{type:"number",min:0,value:Number.MAX_SAFE_INTEGER},alphaCutoff:{type:"number",value:.05,min:0,max:1},getPosition:{type:"accessor",value:n=>n.position},getIcon:{type:"accessor",value:n=>n.icon},getColor:{type:"accessor",value:m6},getSize:{type:"accessor",value:1},getAngle:{type:"accessor",value:0},getPixelOffset:{type:"accessor",value:[0,0]},onIconError:{type:"function",value:null,compare:!1,optional:!0}};let _ve=(()=>{class n extends Eb{getShaders(){return super.getShaders({vs:"#define SHADER_NAME icon-layer-vertex-shader\n\nattribute vec2 positions;\n\nattribute vec3 instancePositions;\nattribute vec3 instancePositions64Low;\nattribute float instanceSizes;\nattribute float instanceAngles;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\nattribute vec4 instanceIconFrames;\nattribute float instanceColorModes;\nattribute vec2 instanceOffsets;\nattribute vec2 instancePixelOffset;\n\nuniform float sizeScale;\nuniform vec2 iconsTextureDim;\nuniform float sizeMinPixels;\nuniform float sizeMaxPixels;\nuniform bool billboard;\n\nvarying float vColorMode;\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\nvarying vec2 uv;\n\nvec2 rotate_by_angle(vec2 vertex, float angle) {\n float angle_radian = angle * PI / 180.0;\n float cos_angle = cos(angle_radian);\n float sin_angle = sin(angle_radian);\n mat2 rotationMatrix = mat2(cos_angle, -sin_angle, sin_angle, cos_angle);\n return rotationMatrix * vertex;\n}\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n geometry.uv = positions;\n geometry.pickingColor = instancePickingColors;\n uv = positions;\n\n vec2 iconSize = instanceIconFrames.zw;\n float sizePixels = clamp(\n project_size_to_pixel(instanceSizes * sizeScale), \n sizeMinPixels, sizeMaxPixels\n );\n float instanceScale = iconSize.y == 0.0 ? 0.0 : sizePixels / iconSize.y;\n vec2 pixelOffset = positions / 2.0 * iconSize + instanceOffsets;\n pixelOffset = rotate_by_angle(pixelOffset, instanceAngles) * instanceScale;\n pixelOffset += instancePixelOffset;\n pixelOffset.y *= -1.0;\n\n if (billboard) {\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, vec3(0.0), geometry.position);\n vec3 offset = vec3(pixelOffset, 0.0);\n DECKGL_FILTER_SIZE(offset, geometry);\n gl_Position.xy += project_pixel_size_to_clipspace(offset.xy);\n\n } else {\n vec3 offset_common = vec3(project_pixel_size(pixelOffset), 0.0);\n DECKGL_FILTER_SIZE(offset_common, geometry);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, offset_common, geometry.position); \n }\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n vTextureCoords = mix(\n instanceIconFrames.xy,\n instanceIconFrames.xy + iconSize,\n (positions.xy + 1.0) / 2.0\n ) / iconsTextureDim;\n\n vColor = instanceColors;\n DECKGL_FILTER_COLOR(vColor, geometry);\n\n vColorMode = instanceColorModes;\n}\n",fs:"#define SHADER_NAME icon-layer-fragment-shader\n\nprecision highp float;\n\nuniform float opacity;\nuniform sampler2D iconsTexture;\nuniform float alphaCutoff;\n\nvarying float vColorMode;\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\nvarying vec2 uv;\n\nvoid main(void) {\n geometry.uv = uv;\n\n vec4 texColor = texture2D(iconsTexture, vTextureCoords);\n vec3 color = mix(texColor.rgb, vColor.rgb, vColorMode);\n float a = texColor.a * opacity * vColor.a;\n\n if (a < alphaCutoff) {\n discard;\n }\n\n gl_FragColor = vec4(color, a);\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:[oM,aM]})}initializeState(){this.state={iconManager:new gve(this.context.gl,{onUpdate:this._onUpdate.bind(this),onError:this._onError.bind(this)})},this.getAttributeManager().addInstanced({instancePositions:{size:3,type:5130,fp64:this.use64bitPositions(),transition:!0,accessor:"getPosition"},instanceSizes:{size:1,transition:!0,accessor:"getSize",defaultValue:1},instanceOffsets:{size:2,accessor:"getIcon",transform:this.getInstanceOffset},instanceIconFrames:{size:4,accessor:"getIcon",transform:this.getInstanceIconFrame},instanceColorModes:{size:1,type:5121,accessor:"getIcon",transform:this.getInstanceColorMode},instanceColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:!0,accessor:"getColor",defaultValue:m6},instanceAngles:{size:1,transition:!0,accessor:"getAngle"},instancePixelOffset:{size:2,transition:!0,accessor:"getPixelOffset"}})}updateState({oldProps:t,props:i,changeFlags:r}){super.updateState({props:i,oldProps:t,changeFlags:r});const s=this.getAttributeManager(),{iconAtlas:o,iconMapping:a,data:l,getIcon:c}=i,{iconManager:d}=this.state;d.setProps({loadOptions:i.loadOptions});let f=!1;if(o||this.internalState.isAsyncPropLoading("iconAtlas")?(t.iconAtlas!==i.iconAtlas&&d.setProps({iconAtlas:o,autoPacking:!1}),t.iconMapping!==i.iconMapping&&(d.setProps({iconMapping:a}),f=!0)):d.setProps({autoPacking:!0}),(r.dataChanged||r.updateTriggersChanged&&(r.updateTriggersChanged.all||r.updateTriggersChanged.getIcon))&&d.setProps({data:l,getIcon:c}),f&&(s.invalidate("instanceOffsets"),s.invalidate("instanceIconFrames"),s.invalidate("instanceColorModes")),r.extensionsChanged){var g;const{gl:_}=this.context;null===(g=this.state.model)||void 0===g||g.delete(),this.state.model=this._getModel(_),s.invalidateAll()}}get isLoaded(){return super.isLoaded&&this.state.iconManager.isLoaded}finalizeState(){super.finalizeState(),this.state.iconManager.finalize()}draw({uniforms:t}){const{sizeScale:i,sizeMinPixels:r,sizeMaxPixels:s,sizeUnits:o,billboard:a,alphaCutoff:l}=this.props,{iconManager:c}=this.state,{viewport:d}=this.context,f=c.getTexture();f&&this.state.model.setUniforms(t).setUniforms({iconsTexture:f,iconsTextureDim:[f.width,f.height],sizeScale:i*("pixels"===o?d.metersPerPixel:1),sizeMinPixels:r,sizeMaxPixels:s,billboard:a,alphaCutoff:l}).draw()}_getModel(t){return new Mm(t,Lt(K({},this.getShaders()),{id:this.props.id,geometry:new _h({drawMode:6,attributes:{positions:{size:2,value:new Float32Array([-1,-1,-1,1,1,1,1,-1])}}}),isInstanced:!0}))}_onUpdate(){this.setNeedsRedraw()}_onError(t){const{onIconError:i}=this.getCurrentLayer().props;i?i(t):jn.error(t.error)()}getInstanceOffset(t){const i=this.state.iconManager.getIconMapping(t);return[i.width/2-i.anchorX||0,i.height/2-i.anchorY||0]}getInstanceColorMode(t){return this.state.iconManager.getIconMapping(t).mask?1:0}getInstanceIconFrame(t){const i=this.state.iconManager.getIconMapping(t);return[i.x||0,i.y||0,i.width||0,i.height||0]}}return n.layerName="IconLayer",n.defaultProps=mve,n})();const y6=[],vve={getIconOffsets:{type:"accessor",value:n=>n.offsets},alphaCutoff:.001,smoothing:.1,outlineWidth:0,outlineColor:{type:"color",value:[0,0,0,255]}};let bve=(()=>{class n extends _ve{getShaders(){return Lt(K({},super.getShaders()),{fs:"#define SHADER_NAME multi-icon-layer-fragment-shader\n\nprecision highp float;\n\nuniform float opacity;\nuniform sampler2D iconsTexture;\nuniform float gamma;\nuniform bool sdf;\nuniform float alphaCutoff;\nuniform float buffer;\nuniform float outlineBuffer;\nuniform vec4 outlineColor;\n\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\nvarying vec2 uv;\n\nvoid main(void) {\n geometry.uv = uv;\n\n if (!picking_uActive) {\n float alpha = texture2D(iconsTexture, vTextureCoords).a;\n vec4 color = vColor;\n if (sdf) {\n float distance = alpha;\n alpha = smoothstep(buffer - gamma, buffer + gamma, distance);\n\n if (outlineBuffer > 0.0) {\n float inFill = alpha;\n float inBorder = smoothstep(outlineBuffer - gamma, outlineBuffer + gamma, distance);\n color = mix(outlineColor, vColor, inFill);\n alpha = inBorder;\n }\n }\n float a = alpha * color.a;\n \n if (a < alphaCutoff) {\n discard;\n }\n\n gl_FragColor = vec4(color.rgb, a * opacity);\n }\n\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n"})}initializeState(){super.initializeState(),this.getAttributeManager().addInstanced({instanceOffsets:{size:2,accessor:"getIconOffsets"},instancePickingColors:{type:5121,size:3,accessor:(i,{index:r,target:s})=>this.encodePickingColor(r,s)}})}updateState(t){super.updateState(t);const{props:i,oldProps:r}=t;let{outlineColor:s}=i;s!==r.outlineColor&&(s=s.map(o=>o/255),s[3]=Number.isFinite(s[3])?s[3]:1,this.setState({outlineColor:s})),!i.sdf&&i.outlineWidth&&jn.warn("".concat(this.id,": fontSettings.sdf is required to render outline"))()}draw(t){const{sdf:i,smoothing:r,outlineWidth:s}=this.props,{outlineColor:o}=this.state;t.uniforms=Lt(K({},t.uniforms),{buffer:.75,outlineBuffer:s?Math.max(r,.75*(1-s)):-1,gamma:r,sdf:Boolean(i),outlineColor:o}),super.draw(t)}getInstanceOffset(t){return t?Array.from(t).map(i=>super.getInstanceOffset(i)):y6}getInstanceColorMode(t){return 1}getInstanceIconFrame(t){return t?Array.from(t).map(i=>super.getInstanceIconFrame(i)):y6}}return n.layerName="MultiIconLayer",n.defaultProps=vve,n})();var Cve=ze(2),wve=ze.n(Cve);const Sve=[];function Mve(n){return Math.pow(2,Math.ceil(Math.log2(n)))}function v6(n,e,t,i){let r=0;for(let s=e;si&&(oa){let f=v6(n,a,l,r);c+f>i&&(oi&&(f=b6(n,a,l,i,r,s),o=s[s.length-1])),a=l,c+=f}}(n,r,s,t,i,o),o}function Dve(n,e,t,i,r,s){let o=0,a=0;for(let l=e;l0,d=[0,0],f=[];let p=0,g=0,_=0;for(let y=0;y<=s;y++){const v=n[y];if(("\n"===v||y===s)&&(_=y),_>g){const C=c?Ave(n,t,i,r,g,_):Sve;for(let w=0;w<=C.length;w++){const x=0===w?g:C[w-1],N=wi===e);t>=0&&this._order.splice(t,1)}_appendOrder(e){this._order.push(e)}}(3),Fve=["fontFamily","fontWeight","characterSet","fontSize","sdf","buffer","cutoff","radius"];function Lve(n,e){for(let t=0;t{o in e&&(this.props[o]=e[o])});const t=this._key;this._key=this._getKey();const i=function(n,e){const t=aR.get(n);if(!t)return e;const i=[];let s=Object.keys(t.mapping);s=new Set(s);let o=e;return o instanceof Array&&(o=new Set(o)),o.forEach(a=>{s.has(a)||i.push(a)}),i}(this._key,this.props.characterSet),r=aR.get(this._key);if(r&&0===i.length)return void(this._key!==t&&(this._atlas=r));const s=this._generateFontAtlas(this._key,i,r);this._atlas=s,aR.set(this._key,s)}_generateFontAtlas(e,t,i){const{fontFamily:r,fontWeight:s,fontSize:o,buffer:a,sdf:l,radius:c,cutoff:d}=this.props;let f=i&&i.data;f||(f=document.createElement("canvas"),f.width=1024);const p=f.getContext("2d");I6(p,r,o,s);const{mapping:g,canvasHeight:_,xOffset:y,yOffset:v}=function({characterSet:n,getFontWidth:e,fontHeight:t,buffer:i,maxCanvasWidth:r,mapping:s={},xOffset:o=0,yOffset:a=0}){let l=0,c=o,d=0;for(const p of n)if(!s[p]){const g=e(p,d++);c+g+2*i>r&&(c=0,l++),s[p]={x:c+i,y:a+l*(t+2*i)+i,width:g,height:t},c+=g+2*i}const f=t+2*i;return{mapping:s,xOffset:c,yOffset:a+l*f,canvasHeight:Mve(a+(l+1)*f)}}(K({getFontWidth:C=>p.measureText(C).width,fontHeight:1.2*o,buffer:a,characterSet:t,maxCanvasWidth:1024},i&&{mapping:i.mapping,xOffset:i.xOffset,yOffset:i.yOffset}));if(f.height!==_){const C=p.getImageData(0,0,f.width,f.height);f.height=_,p.putImageData(C,0,0)}if(I6(p,r,o,s),l){const C=new(wve())(o,a,c,d,r,s),w=p.getImageData(0,0,C.size,C.size);for(const x of t)Lve(C.draw(x),w),p.putImageData(w,g[x].x-a,g[x].y+a)}else for(const C of t)p.fillText(C,g[C].x,g[C].y+.9*o);return{xOffset:y,yOffset:v,mapping:g,data:f,width:f.width,height:f.height}}_getKey(){const{fontFamily:e,fontWeight:t,fontSize:i,buffer:r,sdf:s,radius:o,cutoff:a}=this.props;return s?"".concat(e," ").concat(t," ").concat(i," ").concat(r," ").concat(o," ").concat(a):"".concat(e," ").concat(t," ").concat(i," ").concat(r)}}const jve={billboard:!0,sizeScale:1,sizeUnits:"pixels",sizeMinPixels:0,sizeMaxPixels:Number.MAX_SAFE_INTEGER,padding:{type:"array",value:[0,0,0,0]},getPosition:{type:"accessor",value:n=>n.position},getSize:{type:"accessor",value:1},getAngle:{type:"accessor",value:0},getPixelOffset:{type:"accessor",value:[0,0]},getBoundingRect:{type:"accessor",value:[0,0,0,0]},getFillColor:{type:"accessor",value:[0,0,0,255]},getLineColor:{type:"accessor",value:[0,0,0,255]},getLineWidth:{type:"accessor",value:1}};let Uve=(()=>{class n extends Eb{getShaders(){return super.getShaders({vs:"#define SHADER_NAME text-background-layer-vertex-shader\n\nattribute vec2 positions;\n\nattribute vec3 instancePositions;\nattribute vec3 instancePositions64Low;\nattribute vec4 instanceRects;\nattribute float instanceSizes;\nattribute float instanceAngles;\nattribute vec2 instancePixelOffsets;\nattribute float instanceLineWidths;\nattribute vec4 instanceFillColors;\nattribute vec4 instanceLineColors;\nattribute vec3 instancePickingColors;\n\nuniform bool billboard;\nuniform float opacity;\nuniform float sizeScale;\nuniform float sizeMinPixels;\nuniform float sizeMaxPixels;\nuniform vec4 padding;\n\nvarying vec4 vFillColor;\nvarying vec4 vLineColor;\nvarying float vLineWidth;\nvarying vec2 uv;\nvarying vec2 dimensions;\n\nvec2 rotate_by_angle(vec2 vertex, float angle) {\n float angle_radian = radians(angle);\n float cos_angle = cos(angle_radian);\n float sin_angle = sin(angle_radian);\n mat2 rotationMatrix = mat2(cos_angle, -sin_angle, sin_angle, cos_angle);\n return rotationMatrix * vertex;\n}\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n geometry.uv = positions;\n geometry.pickingColor = instancePickingColors;\n uv = positions;\n vLineWidth = instanceLineWidths;\n float sizePixels = clamp(\n project_size_to_pixel(instanceSizes * sizeScale),\n sizeMinPixels, sizeMaxPixels\n );\n\n dimensions = instanceRects.zw * sizePixels + padding.xy + padding.zw;\n\n vec2 pixelOffset = (positions * instanceRects.zw + instanceRects.xy) * sizePixels + mix(-padding.xy, padding.zw, positions);\n pixelOffset = rotate_by_angle(pixelOffset, instanceAngles);\n pixelOffset += instancePixelOffsets;\n pixelOffset.y *= -1.0;\n\n if (billboard) {\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, vec3(0.0), geometry.position);\n vec3 offset = vec3(pixelOffset, 0.0);\n DECKGL_FILTER_SIZE(offset, geometry);\n gl_Position.xy += project_pixel_size_to_clipspace(offset.xy);\n } else {\n vec3 offset_common = vec3(project_pixel_size(pixelOffset), 0.0);\n DECKGL_FILTER_SIZE(offset_common, geometry);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, offset_common, geometry.position);\n }\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n vFillColor = vec4(instanceFillColors.rgb, instanceFillColors.a * opacity);\n DECKGL_FILTER_COLOR(vFillColor, geometry);\n vLineColor = vec4(instanceLineColors.rgb, instanceLineColors.a * opacity);\n DECKGL_FILTER_COLOR(vLineColor, geometry);\n}\n",fs:"#define SHADER_NAME text-background-layer-fragment-shader\n\nprecision highp float;\n\nuniform bool stroked;\n\nvarying vec4 vFillColor;\nvarying vec4 vLineColor;\nvarying float vLineWidth;\nvarying vec2 uv;\nvarying vec2 dimensions;\n\nvoid main(void) {\n geometry.uv = uv;\n\n vec2 pixelPosition = uv * dimensions;\n if (stroked) {\n float distToEdge = min(\n min(pixelPosition.x, dimensions.x - pixelPosition.x),\n min(pixelPosition.y, dimensions.y - pixelPosition.y)\n );\n float isBorder = smoothedge(distToEdge, vLineWidth);\n gl_FragColor = mix(vFillColor, vLineColor, isBorder);\n } else {\n gl_FragColor = vFillColor;\n }\n\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:[oM,aM]})}initializeState(){this.getAttributeManager().addInstanced({instancePositions:{size:3,type:5130,fp64:this.use64bitPositions(),transition:!0,accessor:"getPosition"},instanceSizes:{size:1,transition:!0,accessor:"getSize",defaultValue:1},instanceAngles:{size:1,transition:!0,accessor:"getAngle"},instanceRects:{size:4,accessor:"getBoundingRect"},instancePixelOffsets:{size:2,transition:!0,accessor:"getPixelOffset"},instanceFillColors:{size:4,transition:!0,normalized:!0,type:5121,accessor:"getFillColor",defaultValue:[0,0,0,255]},instanceLineColors:{size:4,transition:!0,normalized:!0,type:5121,accessor:"getLineColor",defaultValue:[0,0,0,255]},instanceLineWidths:{size:1,transition:!0,accessor:"getLineWidth",defaultValue:1}})}updateState({props:t,oldProps:i,changeFlags:r}){if(super.updateState({props:t,oldProps:i,changeFlags:r}),r.extensionsChanged){var s;const{gl:o}=this.context;null===(s=this.state.model)||void 0===s||s.delete(),this.state.model=this._getModel(o),this.getAttributeManager().invalidateAll()}}draw({uniforms:t}){const{viewport:i}=this.context,{billboard:r,sizeScale:s,sizeUnits:o,sizeMinPixels:a,sizeMaxPixels:l,getLineWidth:c}=this.props;let{padding:d}=this.props;const f="pixels"===o?i.metersPerPixel:1;d.length<4&&(d=[d[0],d[1],d[0],d[1]]),this.state.model.setUniforms(t).setUniforms({billboard:r,stroked:Boolean(c),padding:d,sizeScale:s*f,sizeMinPixels:a,sizeMaxPixels:l}).draw()}_getModel(t){return new Mm(t,Lt(K({},this.getShaders()),{id:this.props.id,geometry:new _h({drawMode:6,vertexCount:4,attributes:{positions:{size:2,value:new Float32Array([0,0,1,0,1,1,0,1])}}}),isInstanced:!0}))}}return n.layerName="TextBackgroundLayer",n.defaultProps=jve,n})();const P6={fontSize:64,buffer:4,sdf:!1,radius:12,cutoff:.25,smoothing:.1},R6={start:1,middle:0,end:-1},k6={top:1,center:0,bottom:-1},lR=[0,0,0,255],$ve=["fontSize","buffer","sdf","radius","cutoff"],Gve={billboard:!0,sizeScale:1,sizeUnits:"pixels",sizeMinPixels:0,sizeMaxPixels:Number.MAX_SAFE_INTEGER,background:!1,getBackgroundColor:{type:"accessor",value:[255,255,255,255]},getBorderColor:{type:"accessor",value:lR},getBorderWidth:{type:"accessor",value:0},backgroundPadding:{type:"array",value:[0,0,0,0]},characterSet:{type:"object",value:w6},fontFamily:E6,fontWeight:"normal",lineHeight:1,outlineWidth:{type:"number",value:0,min:0},outlineColor:{type:"color",value:lR},fontSettings:{},wordBreak:"break-word",maxWidth:{type:"number",value:-1},getText:{type:"accessor",value:n=>n.text},getPosition:{type:"accessor",value:n=>n.position},getColor:{type:"accessor",value:lR},getSize:{type:"accessor",value:32},getAngle:{type:"accessor",value:0},getTextAnchor:{type:"accessor",value:"middle"},getAlignmentBaseline:{type:"accessor",value:"center"},getPixelOffset:{type:"accessor",value:[0,0]},backgroundColor:{deprecatedFor:["background","getBackgroundColor"]}};let Wve=(()=>{class n extends MH{initializeState(){this.state={styleVersion:0,fontAtlasManager:new Bve}}updateState({props:t,oldProps:i,changeFlags:r}){const o=this.state.characterSet;(r.dataChanged||r.updateTriggersChanged&&(r.updateTriggersChanged.all||r.updateTriggersChanged.getText))&&this._updateText();const a=o!==this.state.characterSet||this._fontChanged(i,t);a&&this._updateFontAtlas(i,t),(a||t.lineHeight!==i.lineHeight||t.wordBreak!==i.wordBreak||t.maxWidth!==i.maxWidth)&&this.setState({styleVersion:this.state.styleVersion+1})}getPickingInfo({info:t}){return t.object=t.index>=0?this.props.data[t.index]:null,t}_updateFontAtlas(t,i){const{fontSettings:r,fontFamily:s,fontWeight:o}=i,{fontAtlasManager:a,characterSet:l}=this.state;a.setProps(Lt(K(K({},P6),r),{characterSet:l,fontFamily:s,fontWeight:o}))}_fontChanged(t,i){if(t.fontFamily!==i.fontFamily||t.fontWeight!==i.fontWeight)return!0;if(t.fontSettings===i.fontSettings)return!1;const r=t.fontSettings||{},s=i.fontSettings||{};return $ve.some(o=>r[o]!==s[o])}_updateText(){const{data:t,characterSet:i}=this.props,r=t.attributes&&t.attributes.getText;let a,{getText:s}=this.props,{startIndices:o}=t;const l="auto"===i&&new Set;if(r&&o){const{texts:c,characterCount:d}=function({value:n,length:e,stride:t,offset:i,startIndices:r,characterSet:s}){const o=n.BYTES_PER_ELEMENT,a=t?t/o:1,l=i?i/o:0,c=r[e]||Math.ceil((n.length-l)/a),d=s&&new Set,f=new Array(e);let p=n;if(a>1||l>0){p=new n.constructor(c);for(let g=0;gc[p]}else{const{iterable:c,objectInfo:d}=SS(t);o=[0],a=0;for(const f of c){d.index++;const p=Array.from(s(f,d)||"");l&&p.forEach(l.add,l),a+=p.length,o.push(a)}}this.setState({getText:s,startIndices:o,numInstances:a,characterSet:l||i})}getBoundingRect(t,i){const r=this.state.fontAtlasManager.mapping,{getText:s}=this.state,{wordBreak:o,maxWidth:a,lineHeight:l,getTextAnchor:c,getAlignmentBaseline:d}=this.props,f=s(t,i)||"",{size:[p,g]}=C6(f,l,o,a,r);return[(R6["function"==typeof c?c(t,i):c]-1)*p/2,(k6["function"==typeof d?d(t,i):d]-1)*g/2,p,g]}getIconOffsets(t,i){const r=this.state.fontAtlasManager.mapping,{getText:s}=this.state,{wordBreak:o,maxWidth:a,lineHeight:l,getTextAnchor:c,getAlignmentBaseline:d}=this.props,f=s(t,i)||"",{x:p,y:g,rowWidth:_,size:[y,v]}=C6(f,l,o,a,r),C=R6["function"==typeof c?c(t,i):c],w=k6["function"==typeof d?d(t,i):d],x=p.length,N=new Array(2*x);let V=0;for(let U=0;Ut*e/255)}const uR={name:"lights",vs:F6,fs:F6,getUniforms:function N6(n=qve){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?cR(n):[0,0,0],e.forEach((r,s)=>{i[`lighting_uPointLight[${s}].color`]=cR(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`]=cR(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 N6({lightSources:e})}return{}},defines:{MAX_LIGHTS:3}},Xve={};const Zve={name:"phong-lighting",dependencies:[uR],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=Xve){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}}},dR=Math.PI/180,lM=new Float32Array(16),V6=new Float32Array(12);function z6(n,e,t){const i=e[0]*dR,r=e[1]*dR,s=e[2]*dR,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 j6(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 U6={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 y;g?(lM.set(a),y=j6(lM)):(y=V6,z6(y,r,s),y.set(o,9)),n.value=new Float32Array(y)}else{let y=e*n.size;const{iterable:v,objectInfo:C}=SS(i,e,t);for(const w of v){let x;C.index++,g?(lM.set(c?a:a(w,C)),x=j6(lM)):(x=V6,z6(x,f?r:r(w,C),d?s:s(w,C)),x.set(p?o:o(w,C),9)),_[y++]=x[0],_[y++]=x[1],_[y++]=x[2],_[y++]=x[3],_[y++]=x[4],_[y++]=x[5],_[y++]=x[6],_[y++]=x[7],_[y++]=x[8],_[y++]=x[9],_[y++]=x[10],_[y++]=x[11]}}}};function H6(n,e){return e===qn.CARTESIAN||e===qn.METER_OFFSETS||e===qn.DEFAULT&&!n.isGeospatial}function $6(n,e){(n.COLOR_0||n.colors)&&e||(n.colors={constant:!0,value:new Float32Array([1,1,1])}),jn.assert(n.positions||n.POSITION,'no "postions" or "POSITION" attribute in mesh')}function ebe(n,e){if(n.attributes)return $6(n.attributes,e),n instanceof _h?n:new _h(n);if(n.positions||n.POSITION)return $6(n,e),new _h({attributes:n});throw Error("Invalid mesh")}const tbe={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 nbe=(()=>{class n extends Eb{getShaders(){const t=!In(this.context.gl),i={};return _I(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:[oM,Zve,aM],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:U6}),this.setState({emptyTexture:new na(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||H6(i,s),flatShading:!this.state.hasNormals}).draw()}getModel(t){const i=new Mm(this.context.gl,Lt(K({},this.getShaders()),{id:this.props.id,geometry:ebe(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=tbe,n})();const G6={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:[uR]};class Fm{constructor(e={}){const{id:t}=e;this.id=t||ea(this.constructor.name),this.display=!0,this.position=new to,this.rotation=new to,this.scale=new to(1,1,1),this.matrix=new $t,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 nt(3===e.length,"setPosition requires vector argument"),this.position=e,this}setRotation(e){return nt(3===e.length,"setRotation requires vector argument"),this.rotation=e,this}setScale(e){return nt(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){nt(e),t=t||this.matrix;const i=new $t(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 Ob extends Fm{constructor(e={}){e=Array.isArray(e)?{children:e}:e;const{children:t=[]}=e;vt.assert(t.every(i=>i instanceof Fm),"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 $t}={}){const i=new $t(t).multiplyRight(this.matrix);for(const r of this.children)r instanceof Ob?r.traverse(e,{worldMatrix:i}):e(r,{worldMatrix:i})}}function W6(){var n=new ia(4);return ia!=Float32Array&&(n[0]=0,n[1]=0,n[2]=0),n[3]=1,n}function q6(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 Y6(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 K6=w5,_be=function(){var n=m4(),e=_4(1,0,0),t=_4(0,1,0);return function(i,r,s){var o=y4(r,s);return o<-.999999?(wS(n,e,r),function(n){return Math.hypot(n[0],n[1],n[2])}(n)<1e-6&&wS(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),q6(i,n,Math.PI),i):o>.999999?(i[0]=0,i[1]=0,i[2]=0,i[3]=1,i):(wS(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))}}();W6(),W6(),function(){var n=new ia(9);ia!=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 ybe=[0,0,0,1],bbe={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Cbe={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function J6(n){if(!n._animation){const e=Cbe[n.componentType],t=bbe[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 q6(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]=ks(e)}get y(){return this[1]}set y(e){this[1]=ks(e)}get z(){return this[2]}set z(e){this[2]=ks(e)}get w(){return this[3]}set w(e){this[3]=ks(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 _be(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 Qu(!t),Y6(this,this,e),this.check()}multiplyLeft(e,t){return Qu(!t),Y6(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 K6(this,this,e),this.check()}slerp(e,t,i){switch(arguments.length){case 1:({start:e=ybe,target:t,ratio:i}=arguments[0]);break;case 2:[t,i]=arguments,e=this}return function(n,e,t,i){var p,g,_,y,v,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>Kc?(p=Math.acos(g),_=Math.sin(p),y=Math.sin((1-i)*p)/_,v=Math.sin(i*p)/_):(y=1-i,v=i),n[0]=y*r+v*l,n[1]=y*s+v*c,n[2]=y*o+v*d,n[3]=y*a+v*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),CS(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 Abe{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:vt.warn(`Bad animation path ${s}`)()}nt(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){hR.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:J6(e.accessors[a]),interpolation:l,output:J6(e.accessors[c])})),o=t.channels.map(({sampler:a,target:l})=>({sampler:s[a],target:e.nodes[l.node],path:l.path}));return new Abe({name:r,channels:o})})}animate(e){this.setTime(e)}setTime(e){this.animations.forEach(t=>t.animate(e))}getAnimations(){return this.animations}}class Obe extends Fm{constructor(e,t={}){super(t),this.onBeforeRender=null,this.AfterRender=null,e instanceof Mm?(this.model=e,this._setModelNodeProps(t)):this.model=new Mm(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 Ibe{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},_I(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 na(this.gl,K({id:e.name||e.id,parameters:K(K({},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&&(vt.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 e8(n,e){return In(n)?`#version 300 es\n${e}`:e}const Fbe={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Nbe={modelOptions:{},pbrDebug:!1,imageBasedLightingEnvironment:null,lights:!0,useTangents:!1};class Lbe{constructor(e,t={}){this.gl=e,this.options=Object.assign({},Nbe,t)}instantiate(e){return this.gltf=e,(e.scenes||[]).map(i=>this.createScene(i))}createAnimator(){return Array.isArray(this.gltf.animations)?new Dbe(this.gltf):null}createScene(e){const i=(e.nodes||[]).map(s=>this.createNode(s));return new Ob({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 Ob({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 $t).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 Ob({id:e.name||e.id,children:i});e._mesh=r}return e._mesh}getVertexCount(e){vt.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 Ibe(n,e);vt.info(4,"createGLTFModel defines: ",a.defines)();const l=[];l.push(...a.generatedTextures),l.push(...Object.values(s).map(d=>d.buffer));const c=new Obe(n,Object.assign({id:t,drawMode:i,vertexCount:r,modules:[G6],defines:a.defines,parameters:a.parameters,vs:e8(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:e8(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))),vt.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 Ai(this.gl,{id:`from-${i.id}`,data:i.data||e.value,target:t})),i.lumaBuffers[t]}createAccessor(e,t){return new ta({buffer:t,offset:e.byteOffset||0,stride:e.bufferView.byteStride||0,type:e.componentType,size:Fbe[e.type]})}createSampler(e){return e}needsPOT(){return!1}}function t8(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 Nm(i,this.metadata)}selectAt(...e){const t=e.map(i=>this.fields[i]).filter(Boolean);return new Nm(t,this.metadata)}assign(e){let t,i=this.metadata;if(e instanceof Nm){const o=e;t=o.fields,i=s8(s8(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 Nm(s,i)}}function s8(n,e){return new Map([...n||new Map,...e||new Map])}let cr,o8,a8,l8,c8,u8,d8,h8;!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"}(cr||(cr={}));class fR{static isNull(e){return e&&e.typeId===cr.Null}static isInt(e){return e&&e.typeId===cr.Int}static isFloat(e){return e&&e.typeId===cr.Float}static isBinary(e){return e&&e.typeId===cr.Binary}static isUtf8(e){return e&&e.typeId===cr.Utf8}static isBool(e){return e&&e.typeId===cr.Bool}static isDecimal(e){return e&&e.typeId===cr.Decimal}static isDate(e){return e&&e.typeId===cr.Date}static isTime(e){return e&&e.typeId===cr.Time}static isTimestamp(e){return e&&e.typeId===cr.Timestamp}static isInterval(e){return e&&e.typeId===cr.Interval}static isList(e){return e&&e.typeId===cr.List}static isStruct(e){return e&&e.typeId===cr.Struct}static isUnion(e){return e&&e.typeId===cr.Union}static isFixedSizeBinary(e){return e&&e.typeId===cr.FixedSizeBinary}static isFixedSizeList(e){return e&&e.typeId===cr.FixedSizeList}static isMap(e){return e&&e.typeId===cr.Map}static isDictionary(e){return e&&e.typeId===cr.Dictionary}get typeId(){return cr.NONE}compareTo(e){return this===e}}Symbol,Symbol,o8=Symbol.toStringTag;class Lm extends fR{constructor(e,t){super(),sn(this,"isSigned",void 0),sn(this,"bitWidth",void 0),this.isSigned=e,this.bitWidth=t}get typeId(){return cr.Int}get[o8](){return"Int"}toString(){return`${this.isSigned?"I":"Ui"}nt${this.bitWidth}`}}class qbe extends Lm{constructor(){super(!0,8)}}class Ybe extends Lm{constructor(){super(!0,16)}}class Xbe extends Lm{constructor(){super(!0,32)}}class Kbe extends Lm{constructor(){super(!1,8)}}class Zbe extends Lm{constructor(){super(!1,16)}}class Qbe extends Lm{constructor(){super(!1,32)}}a8=Symbol.toStringTag;class f8 extends fR{constructor(e){super(),sn(this,"precision",void 0),this.precision=e}get typeId(){return cr.Float}get[a8](){return"Float"}toString(){return`Float${this.precision}`}}class Jbe extends f8{constructor(){super(32)}}class e0e extends f8{constructor(){super(64)}}Symbol,Symbol,l8=Symbol.toStringTag,c8=Symbol.toStringTag,u8=Symbol.toStringTag,d8=Symbol.toStringTag,h8=Symbol.toStringTag;class t0e extends fR{constructor(e,t){super(),sn(this,"listSize",void 0),sn(this,"children",void 0),this.listSize=e,this.children=[t]}get typeId(){return cr.FixedSizeList}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get[h8](){return"FixedSizeList"}toString(){return`FixedSizeList[${this.listSize}]<${this.valueType}>`}}class uM{constructor(e,t,i=!1,r=new Map){sn(this,"name",void 0),sn(this,"type",void 0),sn(this,"nullable",void 0),sn(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 uM(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 p8(n,e,t){const i=t?g8(t.metadata):void 0,r=function(n){switch(n.constructor){case Int8Array:return new qbe;case Uint8Array:return new Kbe;case Int16Array:return new Ybe;case Uint16Array:return new Zbe;case Int32Array:return new Xbe;case Uint32Array:return new Qbe;case Float32Array:return new Jbe;case Float64Array:return new e0e;default:throw new Error("array type not supported")}}(e.value);return new uM(n,new t0e(e.size,new uM("value",r)),!1,i)}function g8(n){const e=new Map;for(const t in n)e.set(`${t}.string`,JSON.stringify(n[t]));return e}const m8={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},s0e={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array};class a0e{constructor(e){sn(this,"draco",void 0),sn(this,"decoder",void 0),sn(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=g8(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=p8(o,n[o],s[o]);r.push(l)}if(t){const o=p8("indices",t);r.push(o)}return new Nm(r,i)}(l.attributes,a,l.indices);return Lt(K({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 dM=ze(125);const _R={};function yR(n){return vR.apply(this,arguments)}function vR(){return(vR=yn(function*(n,e=null,t={}){return e&&(n=h0e(n,e,t)),_R[n]=_R[n]||f0e(n),yield _R[n]})).apply(this,arguments)}function h0e(n,e,t){if(n.startsWith("http"))return n;const i=t.modules||{};return i[n]?i[n]:_P?t.CDN?(Qc(t.CDN.startsWith("http")),`${t.CDN}/${e}@3.0.12/dist/libs/${n}`):yP?`../src/libs/${n}`:`modules/${e}/src/libs/${n}`:`modules/${e}/dist/libs/${n}`}function f0e(n){return bR.apply(this,arguments)}function bR(){return(bR=yn(function*(n){return n.endsWith("wasm")?yield(yield fetch(n)).arrayBuffer():_P?yP?importScripts(n):p0e(yield(yield fetch(n)).text(),n):dM.requireFromFile&&(yield dM.requireFromFile(n))})).apply(this,arguments)}function p0e(n,e){if(!_P)return dM.requireFromString&&dM.requireFromString(n,e);if(yP)return eval.call(yge,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 g0e="https://www.gstatic.com/draco/versioned/decoders/1.4.1/draco_decoder.js",m0e="https://www.gstatic.com/draco/versioned/decoders/1.4.1/draco_wasm_wrapper.js",_0e="https://www.gstatic.com/draco/versioned/decoders/1.4.1/draco_decoder.wasm";let Ib;function v0e(n){return CR.apply(this,arguments)}function CR(){return(CR=yn(function*(n){const e=n.modules||{};return Ib=e.draco3d?Ib||e.draco3d.createDecoderModule({}).then(t=>({draco:t})):Ib||b0e(n),yield Ib})).apply(this,arguments)}function b0e(n){return ER.apply(this,arguments)}function ER(){return(ER=yn(function*(n){let e,t;switch(n.draco&&n.draco.decoderType){case"js":e=yield yR(g0e,"draco",n);break;case"wasm":default:[e,t]=yield Promise.all([yield yR(m0e,"draco",n),yield yR(_0e,"draco",n)])}return e=e||globalThis.DracoDecoderModule,yield C0e(e,t)})).apply(this,arguments)}function C0e(n,e){const t={};return e&&(t.wasmBinary=e),new Promise(i=>{n(Lt(K({},t),{onModuleLoaded:r=>i({draco:r})}))})}const MR=Lt(K({},r8),{parse:function(n,e){return xR.apply(this,arguments)}});function xR(){return(xR=yn(function*(n,e){const{draco:t}=yield v0e(e),i=new a0e(t);try{return i.parseSync(n,null==e?void 0:e.draco)}finally{i.destroy()}})).apply(this,arguments)}function Rb(n,e){return sp(n>=0),sp(e>0),n+(e-1)&~(e-1)}function S0e(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+Rb(i.byteLength,4)}const _8=["SCALAR","VEC2","VEC3","VEC4"],M0e=[[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Uint32Array,5125],[Float32Array,5126],[Float64Array,5130]],x0e=new Map(M0e),T0e={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},A0e={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},D0e={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function y8(n){return _8[n-1]||_8[0]}function v8(n){const e=x0e.get(n.constructor);if(!e)throw new Error("Illegal typed array");return e}function b8(n,e){const t=D0e[n.componentType],i=T0e[n.type],s=n.count*i,o=n.count*i*A0e[n.componentType];return Pa(o>=0&&o<=e.byteLength),{ArrayType:t,length:s,byteLength:o}}const O0e={asset:{version:"2.0",generator:"loaders.gl"},buffers:[]};class vh{constructor(e){sn(this,"gltf",void 0),sn(this,"sourceBuffers",void 0),sn(this,"byteLength",void 0),this.gltf=e||{json:K({},O0e),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 Pa(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}=b8(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 Pa(t),this.json.extensions=this.json.extensions||{},this.json.extensions[e]=t,this.registerUsedExtension(e),t}addRequiredExtension(e,t={}){return Pa(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=eR(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;Pa(Number.isFinite(t)),this.sourceBuffers=this.sourceBuffers||[],this.sourceBuffers.push(e);const i={buffer:0,byteOffset:this.byteLength,byteLength:t};return this.byteLength+=Rb(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:y8(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:v8(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=S0e(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*j0e(n){for(const e of n.json.meshes||[])for(const t of e.primitives)yield t}function U0e(n){return DR.apply(this,arguments)}function DR(){return(DR=yn(function*(n){const e=new vh(n),{json:t}=e;e.removeExtension(fM);for(const i of t.materials||[])i.extensions&&i.extensions.KHR_materials_unlit&&(i.unlit=!0),e.removeObjectExtension(i,fM)})).apply(this,arguments)}function H0e(n){const e=new vh(n),{json:t}=e;if(e.materials)for(const i of t.materials||[])i.unlit&&(delete i.unlit,e.addObjectExtension(i,fM,{}),e.addExtension(fM))}function $0e(n){return OR.apply(this,arguments)}function OR(){return(OR=yn(function*(n){const e=new vh(n),{json:t}=e,i=e.getExtension(Bm);i&&(e.json.lights=i.lights,e.removeExtension(Bm));for(const r of t.nodes||[]){const s=e.getObjectExtension(r,Bm);s&&(r.light=s.light),e.removeObjectExtension(r,Bm)}})).apply(this,arguments)}function G0e(n){return IR.apply(this,arguments)}function IR(){return(IR=yn(function*(n){const e=new vh(n),{json:t}=e;if(t.lights){const i=e.addExtension(Bm);Pa(!i.lights),i.lights=t.lights,delete t.lights}if(e.json.lights){for(const i of e.json.lights)e.addObjectExtension(i.node,Bm,i);delete e.json.lights}})).apply(this,arguments)}function W0e(n){return PR.apply(this,arguments)}function PR(){return(PR=yn(function*(n){const e=new vh(n),{json:t}=e,i=e.getExtension(pM);if(i){const r=Y0e(i,e);for(const s of t.materials||[]){const o=e.getObjectExtension(s,pM);o&&(s.technique=Object.assign({},o,r[o.technique]),s.technique.values=X0e(s.technique,e)),e.removeObjectExtension(s,pM)}e.removeExtension(pM)}})).apply(this,arguments)}function q0e(n,e){return RR.apply(this,arguments)}function RR(){return(RR=yn(function*(n,e){})).apply(this,arguments)}function Y0e(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 X0e(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 E8={KHR_draco_mesh_compression:wt,KHR_materials_unlit:L,KHR_lights_punctual:It,KHR_techniques_webgl:Pt};function K0e(n){return kR.apply(this,arguments)}function kR(){return(kR=yn(function*(n,e={},t){for(const r in E8){var i;const s=(null==e||null===(i=e.gltf)||void 0===i?void 0:i.excludeExtensions)||{};r in s&&!s[r]||(yield E8[r].decode(n,e,t))}})).apply(this,arguments)}const S8={accessors:"accessor",animations:"animation",buffers:"buffer",bufferViews:"bufferView",images:"image",materials:"material",meshes:"mesh",nodes:"node",samplers:"sampler",scenes:"scene",skins:"skin",textures:"texture"},Q0e={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 J0e{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 vh(n),{json:t}=e;for(const i of t.images||[]){const r=e.removeObjectExtension(i,C8);r&&Object.assign(i,r)}t.buffers&&t.buffers[0]&&delete t.buffers[0].uri,e.removeExtension(C8)}(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 S8)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 S8)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=Q0e[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 eCe(n,e={}){return(new J0e).normalize(n,e)}const tCe={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},nCe={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},bl={TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,REPEAT:10497,LINEAR:9729,NEAREST_MIPMAP_LINEAR:9986},iCe={magFilter:bl.TEXTURE_MAG_FILTER,minFilter:bl.TEXTURE_MIN_FILTER,wrapS:bl.TEXTURE_WRAP_S,wrapT:bl.TEXTURE_WRAP_T},rCe={[bl.TEXTURE_MAG_FILTER]:bl.LINEAR,[bl.TEXTURE_MIN_FILTER]:bl.NEAREST_MIPMAP_LINEAR,[bl.TEXTURE_WRAP_S]:bl.REPEAT,[bl.TEXTURE_WRAP_]:bl.REPEAT};class aCe{postProcess(e,t={}){const{json:i,buffers:r=[],images:s=[],baseUri:o=""}=e;return Pa(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=K({},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=K({},e.normalTexture),e.normalTexture.texture=this.getTexture(e.normalTexture.index)),e.occlusionTexture&&(e.occlustionTexture=K({},e.occlustionTexture),e.occlusionTexture.texture=this.getTexture(e.occlusionTexture.index)),e.emissiveTexture&&(e.emmisiveTexture=K({},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=K({},e.pbrMetallicRoughness);const i=e.pbrMetallicRoughness;i.baseColorTexture&&(i.baseColorTexture=K({},i.baseColorTexture),i.baseColorTexture.texture=this.getTexture(i.baseColorTexture.index)),i.metallicRoughnessTexture&&(i.metallicRoughnessTexture=K({},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 nCe[n]}(e.componentType),e.components=function(n){return tCe[n]}(e.type),e.bytesPerElement=e.bytesPerComponent*e.components,e.bufferView){const i=e.bufferView.buffer,{ArrayType:r,byteLength:s}=b8(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):rCe,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 iCe[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 lCe(n,e){return(new aCe).postProcess(n,e)}const M8=1735152710,Vm=!0;function NR(n,e,t,i){const r=new Uint8Array(e.buffer,t,i),o=new TextDecoder("utf8").decode(r);return n.json=JSON.parse(o),Rb(i,4)}function LR(n,e,t,i){return n.header.hasBinChunk=!0,n.binChunks.push({byteOffset:t,byteLength:i,arrayBuffer:e.buffer}),Rb(i,4)}function bCe(n,e){return BR.apply(this,arguments)}function BR(){return(BR=yn(function*(n,e,t=0,i,r){var s,o,a,l;CCe(n,e,t,i),eCe(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 wCe(n,i,r)),null!=i&&null!==(a=i.gltf)&&void 0!==a&&a.loadImages){const f=ECe(n,i,r);c.push(f)}const d=K0e(n,i,r);return c.push(d),yield Promise.all(c),null!=i&&null!==(l=i.gltf)&&void 0!==l&&l.postProcess?lCe(n,i):n})).apply(this,arguments)}function CCe(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=M8}=t,s=i.getUint32(e,!1);return s===r||s===M8}(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)?t8(n.buffer,n.byteOffset,e):n instanceof ArrayBuffer?t8(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,Vm),a=r.getUint32(t+8,Vm);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){sp(n.header.byteLength>20);const i=e.getUint32(t+0,Vm),r=e.getUint32(t+4,Vm);return t+=8,sp(0===r),NR(n,e,t,i),(t+=i)+LR(n,e,t,n.header.byteLength)}(n,r,t);case 2:return function(n,e,t,i){return sp(n.header.byteLength>20),function(n,e,t,i){for(;t+8<=n.header.byteLength;){const r=e.getUint32(t+0,Vm),s=e.getUint32(t+4,Vm);switch(t+=8,s){case 1313821514:NR(n,e,t,r);break;case 5130562:LR(n,e,t,r);break;case 0:i.strict||NR(n,e,t,r);break;case 1:i.strict||LR(n,e,t,r)}t+=Rb(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),Pa("glTF"===o.type,`Invalid GLB magic string ${o.type}`),n._glb=o,n.json=o.json}else Pa(!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 wCe(n,e,t){return VR.apply(this,arguments)}function VR(){return(VR=yn(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 TCe(()=>e.some(t=>!t.loaded))})).apply(this,arguments)}function TCe(n){return $R.apply(this,arguments)}function $R(){return($R=yn(function*(n){for(;n();)yield new Promise(e=>requestAnimationFrame(e))})).apply(this,arguments)}const x8=[255,255,255,255],OCe={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:x8},_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:[zm]};let ICe=(()=>{class n extends Eb{getShaders(){const t=[oM,aM];return"pbr"===this.props._lighting&&t.push(G6),{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:x8,transition:!0},instanceModelMatrix:U6})}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 Fm)r={scenes:[t.scenegraph]};else if(t.scenegraph&&!t.scenegraph.gltf){const l=t.scenegraph,c=function(n,e,t){const i=new Lbe(n,t);return{scenes:i.instantiate(e),animator:i.createAnimator()}}(i,l,this._getModelOptions());r=K({gltf:l},c),function(n){return HR.apply(this,arguments)}(c).then(()=>this.setNeedsRedraw())}else t.scenegraph&&(jn.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 Fm?(this._deleteScenegraph(),this._applyAllAttributes(o),this._applyAnimationsProp(o,a,t._animations),this.setState({scenegraph:o,animator:a})):null!==o&&jn.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):jn.warn("animation ".concat(o," not found"))()}})}_deleteScenegraph(){const{scenegraph:t}=this.state;t instanceof Fm&&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:K({isInstanced:!0,transpileToGLSL100:!In(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:H6(s,d),sceneModelMatrix:g,u_Camera:p.model.getUniforms().project_uCameraPosition}})})}}return n.layerName="ScenegraphLayer",n.defaultProps=OCe,n})();class PCe extends _h{constructor(e={}){const{id:t=ea("sphere-geometry")}=e,{indices:i,attributes:r}=function(n){const{nlat:e=10,nlong:t=10}=n;let{radius:i=1}=n;const o=Math.PI-0,c=2*Math.PI-0,d=(e+1)*(t+1);if("number"==typeof i){const C=i;i=(w,x,N,V,U)=>C}const f=new Float32Array(3*d),p=new Float32Array(3*d),g=new Float32Array(2*d),y=new(d>65535?Uint32Array:Uint16Array)(e*t*6);for(let C=0;C<=e;C++)for(let w=0;w<=t;w++){const x=w/t,N=C/e,V=w+C*(t+1),U=2*V,ee=3*V,de=c*x,ae=o*N,me=Math.sin(de),Ee=Math.cos(de),Be=Math.sin(ae),ne=Ee*Be,Ie=Math.cos(ae),Q=me*Be,je=i(ne,Ie,Q,x,N);f[ee+0]=je*ne,f[ee+1]=je*Ie,f[ee+2]=je*Q,p[ee+0]=ne,p[ee+1]=Ie,p[ee+2]=Q,g[U+0]=x,g[U+1]=1-N}const v=t+1;for(let C=0;Cs?(te=i,Be=1,ne=t):ne=e+Ee/s*(t-e),(-2===Ee||Ee===s+2)&&(ne=0,Be=0),te-=i/2;for(let Ie=0;Ies?0:Q*y,ee[ae+V[1]]=Ee<0?-1:Ee>s?1:v,ee[ae+V[2]]=Ee<0||Ee>s?0:je*y,de[me+0]=Ie/r,de[me+1]=Be,me+=2,ae+=3}}for(let Ee=0;Ee0){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 S){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 S){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 S){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 S){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 S){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=GCe,s=1/i;r.set(this.x*s,this.y*s,this.z*s);const o=WCe;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(A8),A8.almostEquals(e,t)}clone(){return new S(this.x,this.y,this.z)}}S.ZERO=void 0,S.UNIT_X=void 0,S.UNIT_Y=void 0,S.UNIT_Z=void 0,S.ZERO=new S(0,0,0),S.UNIT_X=new S(1,0,0),S.UNIT_Y=new S(0,1,0),S.UNIT_Z=new S(0,0,1);const GCe=new S,WCe=new S,A8=new S;class Di{constructor(e={}){this.lowerBound=void 0,this.upperBound=void 0,this.lowerBound=new S,this.upperBound=new S,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=O8;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=O8;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 D8=new S,O8=[new S,new S,new S,new S,new S,new S,new S,new S];class kr{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 S){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=YCe;e.tangents(i,XCe),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(Ui(e.length(),2)*Ui(t.length(),2))+e.dot(t),this.normalize()}return this}mult(e,t=new kr){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 kr){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 kr){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 S){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 kr(this.x,this.y,this.z,this.w)}slerp(e,t,i=new kr){const r=this.x,s=this.y,o=this.z,a=this.w;let p,g,_,y,v,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),y=Math.sin((1-t)*p)/_,v=Math.sin(t*p)/_):(y=1-t,v=t),i.x=y*r+v*l,i.y=y*s+v*c,i.z=y*o+v*d,i.w=y*a+v*f,i}integrate(e,t,i,r=new kr){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 YCe=new S,XCe=new S,KCe={SPHERE:1,PLANE:2,BOX:4,COMPOUND:8,CONVEXPOLYHEDRON:16,HEIGHTFIELD:32,PARTICLE:64,CYLINDER:128,TRIMESH:256};let bt=(()=>{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=KCe,n})();class ni{constructor(e={}){this.position=void 0,this.quaternion=void 0,this.position=new S,this.quaternion=new kr,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 S){return this.quaternion.vmult(e,t),t}static pointToLocalFrame(e,t,i,r=new S){return i.vsub(e,r),t.conjugate(P8),P8.vmult(r,r),r}static pointToWorldFrame(e,t,i,r=new S){return t.vmult(i,r),r.vadd(e,r),r}static vectorToWorldFrame(e,t,i=new S){return e.vmult(t,i),i}static vectorToLocalFrame(e,t,i,r=new S){return t.w*=-1,t.vmult(i,r),t.w*=-1,r}}const P8=new kr;class lp extends bt{constructor(e={}){const{vertices:t=[],faces:i=[],normals:r=[],axes:s,boundingSphereRadius:o}=e;super({type:bt.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 S;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=y,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 S,d=new S,f=new S,p=new S,g=new S,_=new S;let y=Number.MAX_VALUE;const v=this;if(v.uniqueAxes)for(let C=0;C!==v.uniqueAxes.length;C++){i.vmult(v.uniqueAxes[C],c);const w=v.testSepAxis(c,e,t,i,r,s);if(!1===w)return!1;w0&&o.negate(o),!0}testSepAxis(e,t,i,r,s,o){lp.project(this,e,i,r,GR),lp.project(t,e,s,o,WR);const l=GR[0],c=GR[1],d=WR[0],f=WR[1];if(l0?1/t:0,this.material=e.material||null,this.linearDamping="number"==typeof e.linearDamping?e.linearDamping:.01,this.type=t<=0?Ct.STATIC:Ct.DYNAMIC,typeof e.type==typeof Ct.STATIC&&(this.type=e.type),this.allowSleep=void 0===e.allowSleep||e.allowSleep,this.sleepState=Ct.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 S,this.quaternion=new kr,this.initQuaternion=new kr,this.previousQuaternion=new kr,this.interpolatedQuaternion=new kr,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 S,e.angularVelocity&&this.angularVelocity.copy(e.angularVelocity),this.initAngularVelocity=new S,this.shapes=[],this.shapeOffsets=[],this.shapeOrientations=[],this.inertia=new S,this.invInertia=new S,this.invInertiaWorld=new ru,this.invMassSolve=0,this.invInertiaSolve=new S,this.invInertiaWorldSolve=new ru,this.fixedRotation=void 0!==e.fixedRotation&&e.fixedRotation,this.angularDamping=void 0!==e.angularDamping?e.angularDamping:.01,this.linearFactor=new S(1,1,1),e.linearFactor&&this.linearFactor.copy(e.linearFactor),this.angularFactor=new S(1,1,1),e.angularFactor&&this.angularFactor.copy(e.angularFactor),this.aabb=new Di,this.aabbNeedsUpdate=!0,this.boundingRadius=0,this.wlambda=new S,this.isTrigger=Boolean(e.isTrigger),e.shape&&this.addShape(e.shape),this.updateMassProperties()}wakeUp(){const e=this.sleepState;this.sleepState=Ct.AWAKE,this.wakeUpAfterNarrowphase=!1,e===Ct.SLEEPING&&this.dispatchEvent(Ct.wakeupEvent)}sleep(){this.sleepState=Ct.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=Ui(this.sleepSpeedLimit,2);t===Ct.AWAKE&&ir?this.wakeUp():t===Ct.SLEEPY&&e-this.timeLastSleepy>this.sleepTimeLimit&&(this.sleep(),this.dispatchEvent(Ct.sleepEvent))}}updateSolveMassProperties(){this.sleepState===Ct.SLEEPING||this.type===Ct.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 S){return e.vsub(this.position,t),this.quaternion.conjugate().vmult(t,t),t}vectorToLocalFrame(e,t=new S){return this.quaternion.conjugate().vmult(e,t),t}pointToWorldFrame(e,t=new S){return this.quaternion.vmult(e,t),t.vadd(this.position,t),t}vectorToWorldFrame(e,t=new S){return this.quaternion.vmult(e,t),t}addShape(e,t,i){const r=new S,s=new kr;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=JCe,o=ewe,a=this.quaternion,l=this.aabb,c=twe;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=nwe,r=iwe;i.setRotationFromQuaternion(this.quaternion),i.transpose(r),i.scale(t,i),i.mmult(r,this.invInertiaWorld)}}applyForce(e,t=new S){if(this.type!==Ct.DYNAMIC)return;this.sleepState===Ct.SLEEPING&&this.wakeUp();const i=rwe;t.cross(e,i),this.force.vadd(e,this.force),this.torque.vadd(i,this.torque)}applyLocalForce(e,t=new S){if(this.type!==Ct.DYNAMIC)return;const i=swe,r=owe;this.vectorToWorldFrame(e,i),this.vectorToWorldFrame(t,r),this.applyForce(i,r)}applyTorque(e){this.type===Ct.DYNAMIC&&(this.sleepState===Ct.SLEEPING&&this.wakeUp(),this.torque.vadd(e,this.torque))}applyImpulse(e,t=new S){if(this.type!==Ct.DYNAMIC)return;this.sleepState===Ct.SLEEPING&&this.wakeUp();const i=t,r=awe;r.copy(e),r.scale(this.invMass,r),this.velocity.vadd(r,this.velocity);const s=lwe;i.cross(e,s),this.invInertiaWorld.vmult(s,s),this.angularVelocity.vadd(s,this.angularVelocity)}applyLocalImpulse(e,t=new S){if(this.type!==Ct.DYNAMIC)return;const i=cwe,r=uwe;this.vectorToWorldFrame(e,i),this.vectorToWorldFrame(t,r),this.applyImpulse(i,r)}updateMassProperties(){const e=dwe;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),mM.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 S;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!==Ct.DYNAMIC&&this.type!==Ct.KINEMATIC||this.sleepState===Ct.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,y=this.angularFactor,v=l.x*y.x,C=l.y*y.y,w=l.z*y.z;s.x+=e*(_[0]*v+_[1]*C+_[2]*w),s.y+=e*(_[3]*v+_[4]*C+_[5]*w),s.z+=e*(_[6]*v+_[7]*C+_[8]*w),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()}}Ct.idCounter=0,Ct.COLLIDE_EVENT_NAME="collide",Ct.DYNAMIC=1,Ct.STATIC=2,Ct.KINEMATIC=4,Ct.AWAKE=0,Ct.SLEEPY=1,Ct.SLEEPING=2,Ct.wakeupEvent={type:"wakeup"},Ct.sleepyEvent={type:"sleepy"},Ct.sleepEvent={type:"sleep"};const JCe=new S,ewe=new kr,twe=new Di,nwe=new ru,iwe=new ru,rwe=new S,swe=new S,owe=new S,awe=new S,lwe=new S,cwe=new S,uwe=new S,dwe=new S;new S,new S;class _M{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 S,this.rayToWorld=new S,this.hitNormalWorld=new S,this.hitPointWorld=new S,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 R8,k8,F8,N8,L8,B8,V8;R8=bt.types.SPHERE,k8=bt.types.PLANE,F8=bt.types.BOX,N8=bt.types.CYLINDER,L8=bt.types.CONVEXPOLYHEDRON,B8=bt.types.HEIGHTFIELD,V8=bt.types.TRIMESH;class Hr{get[R8](){return this._intersectSphere}get[k8](){return this._intersectPlane}get[F8](){return this._intersectBox}get[N8](){return this._intersectConvex}get[L8](){return this._intersectConvex}get[B8](){return this._intersectHeightfield}get[V8](){return this._intersectTrimesh}constructor(e=new S,t=new 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 S,this.precision=1e-4,this.checkCollisionResponse=!0,this.skipBackfaces=!1,this.collisionFilterMask=-1,this.collisionFilterGroup=-1,this.mode=Hr.ANY,this.result=new _M,this.hasHit=!1,this.callback=i=>{}}intersectWorld(e,t){return this.mode=t.mode||Hr.ANY,this.result=t.result||new _M,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(z8),KR.length=0,e.broadphase.aabbQuery(e,z8,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=ywe,s=vwe;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 S(0,0,1);t.vmult(c,c);const d=new S;o.vsub(i,d);const f=d.dot(c);if(a.vsub(i,d),f*d.dot(c)>0||o.distanceTo(a)=0&&y<=1&&(o.lerp(a,y,g),g.vsub(i,_),_.normalize(),this.reportIntersection(_,g,s,r,-1)),this.result.shouldStop)return;v>=0&&v<=1&&(o.lerp(a,v,g),g.vsub(i,_),_.normalize(),this.reportIntersection(_,g,s,r,-1))}}_intersectConvex(e,t,i,r,s,o){const a=Swe,l=U8,c=o&&o.faceList||null,d=e.faces,f=e.vertices,p=e.faceNormals,g=this.direction,_=this.from,v=_.distanceTo(this.to),C=c?c.length:d.length,w=this.result;for(let x=0;!w.shouldStop&&xv||this.reportIntersection(a,ra,s,r,N)}}}}_intersectTrimesh(e,t,i,r,s,o){const a=Mwe,l=Iwe,c=Pwe,d=U8,f=xwe,p=Twe,g=Awe,_=Owe,y=Dwe,v=e.indices,C=this.from,w=this.to,x=this.direction;c.position.copy(i),c.quaternion.copy(t),ni.vectorToLocalFrame(i,t,x,f),ni.pointToLocalFrame(i,t,C,p),ni.pointToLocalFrame(i,t,w,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 N=p.distanceSquared(g);e.tree.rayQuery(this,c,l);for(let V=0,U=l.length;!this.result.shouldStop&&V!==U;V++){const ee=l[V];e.getNormal(ee,a),e.getVertex(v[3*ee],cc),cc.vsub(p,d);const de=f.dot(a),ae=a.dot(d)/de;if(ae<0)continue;f.scale(ae,ra),ra.vadd(p,ra),e.getVertex(v[3*ee+1],ou),e.getVertex(v[3*ee+2],au);const me=ra.distanceSquared(p);!Hr.pointInTriangle(ra,ou,cc,au)&&!Hr.pointInTriangle(ra,cc,ou,au)||me>N||(ni.vectorToWorldFrame(t,a,y),ni.pointToWorldFrame(i,t,ra,_),this.reportIntersection(y,_,s,r,ee))}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 Hr.ALL:this.hasHit=!0,c.set(o,a,e,t,i,r,l),c.hasHit=!0,this.callback(c);break;case Hr.CLOSEST:(l=0&&(f=s*c-o*a)>=0&&d+fDate.now()-n}var lu=ze(517);function $m(n,e,t){e||(e=new $t($t.IDENTITY));const i=new $t($t.IDENTITY);if(!n)return!0;if(n.matrix)i.copy(n.matrix);else{if(i.identity(),n.translation&&i.translate(n.translation),n.rotation){const s=new $t($t.IDENTITY).fromQuaternion(n.rotation);i.multiplyRight(s)}n.scale&&i.scale(n.scale)}const r=new $t(e).multiplyRight(i);if(!1===t(n,r,e))return!1;for(const s of n.nodes||n.children||[])if(!1===$m(s,r,t))return!1;return!0}function R$(){vH([r8,zm])}function k$(n,e){var t;const i=null===(t=e.nodes)||void 0===t?void 0:t.find(r=>r.name===n);if(i){let r=!1;for(const s of e.scenes)r||$m(s,new $t($t.IDENTITY),(o,a)=>o!==i||(o.matrix=a,o.translation=void 0,o.rotation=void 0,o.scale=void 0,r=!0,!1));return e.scene={id:n,name:n,nodes:[i]},e.scenes=[e.scene],{scene:e.scene,scenes:e.scenes}}return e}function ek(n,e){return yl(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 YS(i,zm,{DracoLoader:MR,gltf:{decompressMeshes:!0,postProcess:!0}});return r.nodes||console.log("WARNING: Empty Scene",t,r),k$(n.scenegraphNode,r)})}function RMe(n,e){return yl(this,void 0,void 0,function*(){return k$(n,yield e)})}function tk(n,e,t){if(e&&0!==e.length){let i;switch(t.geometry){case"sphere":i=new PCe;break;case"cone":i=new NCe;break;case"cylinder":i=new LCe;break;case"cube":default:i=new HCe}return new nbe(Object.assign({id:n,pickable:!0,autoHighlight:!1,highlightColor:[30,136,229,255],coordinateSystem:qn.CARTESIAN,data:e,mesh:i,wireframe:!1,getTransformMatrix:r=>r.transformMatrix,getColor:r=>r.color||[255,255,255,229.5]},t))}}function F$(n,e,t){if(e&&0!==e.length)return new Wve(Object.assign({id:n,pickable:!0,data:e.map(i=>Object.assign(Object.assign({},i),{position:new $t(i.transformMatrix).getTranslation()})),getText:i=>i.text,getPosition:i=>i.position,getColor:i=>i.color},t))}let FMe=(()=>{class n extends MH{initializeState(){const{data:t}=this.props;this.setState({data:null!=t?t:[],zoomOpacity:.8,doCollisions:!1}),R$()}renderLayers(){var t,i;const r=this.state,s={sphere:[],cone:[],cylinder:[],cube:[],text:[],wireframe:[],scenegraph:[]};for(const l of r.data){const c=null!==(t=l.geometry)&&void 0!==t?t:"cube";l.scenegraph?s.scenegraph.push(l):void 0!==s[c]&&s[c].push(l)}const o={};for(const l of s.scenegraph)l.scenegraph&&l.scenegraphNode&&!Object.prototype.hasOwnProperty.call(o,l.scenegraph)&&(o[l.scenegraph]=ek({scenegraph:l.scenegraph},n.gltfCache));const a=[];for(const[l,c]of Object.entries(s))if("scenegraph"===l)for(const d of c)a.push(new ICe({id:"models-"+d["@id"],opacity:d.zoomBasedOpacity?r.zoomOpacity:void 0!==d.opacity?d.opacity:1,pickable:!d.unpickable,coordinateSystem:qn.CARTESIAN,data:[d],scenegraph:d.scenegraphNode?RMe(d.scenegraphNode,o[d.scenegraph]):d.scenegraph,_lighting:d._lighting,getTransformMatrix:d.transformMatrix,getColor:null!==(i=d.color)&&void 0!==i?i:[0,255,0,127.5],parameters:{depthMask:!d.zoomBasedOpacity&&(void 0===d.opacity||1===d.opacity)}}));else"text"===l?(a.push(F$("text",c.filter(d=>d.unpickable),{pickable:!1})),a.push(F$("textPickable",c.filter(d=>!d.unpickable),{pickable:!0}))):"wireframe"===l?a.push(tk(l,c,{wireframe:!0,pickable:!1,geometry:l})):(a.push(tk(l,c.filter(d=>d.unpickable),{wireframe:!1,pickable:!1,geometry:l})),a.push(tk(`${l}Pickable`,c.filter(d=>!d.unpickable),{wireframe:!1,pickable:!0,geometry:l})));return r.doCollisions&&function(n){yl(this,void 0,void 0,function*(){console.log("Starting Collisioning");const e=n.filter(o=>!o.scenegraph&&"wireframe"!==o.geometry).map(o=>{const a=new $t(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 Di({lowerBound:new S(...l.map((d,f)=>Math.min(d,c[f]))),upperBound:new S(...c.map((d,f)=>Math.max(d,l[f])))})}}),t=[];for(const o of n.filter(a=>!!a.scenegraph)){const a=yield wb(o.scenegraph,zm,{DracoLoader:MR,decompress:!0,postProcess:!0});for(const l of a.scenes)$m(l,new $t(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 Di({lowerBound:new S(...p.map((_,y)=>Math.min(_,g[y]))),upperBound:new S(...g.map((_,y)=>Math.max(_,p[y])))}),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})}(r.data),a.filter(l=>!!l)}getPickingInfo(t){return t.info}}return n.layerName="BodyUILayer",n.gltfCache={},n})();function N$(n,e=[]){for(const t of n.nodes||n.children||[])e.push(t.name),N$(t,e);return e}let LMe=(()=>{class n{constructor(t){var i,r,s,o,a;this.deckProps=t,this.bodyUILayer=new FMe({}),this.nodeClickSubject=new Se,this.nodeHoverStartSubject=new Se,this.nodeHoverStopSubject=new Se,this.sceneRotationSubject=new ar([0,0]),this.nodeDragStartSubject=new Se,this.nodeDragSubject=new Se,this.nodeDragEndSubject=new Se,this.nodeClick$=this.nodeClickSubject.pipe(Vs()),this.nodeHoverStart$=this.nodeHoverStartSubject.pipe(Vs()),this.nodeHoverStop$=this.nodeHoverStopSubject.pipe(Vs()),this.sceneRotation$=this.sceneRotationSubject.pipe(Vs()),this.nodeDragStart$=this.nodeDragStartSubject.pipe(Vs()),this.nodeDrag$=this.nodeDragSubject.pipe(Vs()),this.nodeDragEnd$=this.nodeDragEndSubject.pipe(Vs());const l=Object.assign(Object.assign({},t),{views:["orthographic"===t.camera?new Ame({flipY:!1,near:-1e3}):new Ime({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 GP({ambientLight:new OH({color:[255,255,255],intensity:10})})]),this.deck=new sM(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 yl(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 $t([.076,0,0,0,0,.076,16875389974302382e-33,0,0,-16875389974302382e-33,.076,0,.49,.034,.11,1]);(function(n,e,t){return yl(this,void 0,void 0,function*(){R$();const i=yield ek({scenegraph:n,scenegraphNode:"VHF_Kidney_L_Low1"}),r={},s=[];for(const o of i.scenes)$m(o,e=new $t(e||$t.IDENTITY),(a,l)=>{const c={"@id":a.name||a.id,"@type":"ProcessedNode",transformMatrix:new $t(l),geometry:"wireframe",node:a};if(s.push({"@id":`GLTF:${c["@id"]}`,"@type":"GLTFNode",scenegraph:n,scenegraphNode:c["@id"],transformMatrix:new $t(e||$t.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 Di({lowerBound:new S(...f.map((g,_)=>Math.min(g,p[_]))),upperBound:new S(...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 N$(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 S(.5,.5,.5)),f=o.center=a.clone().vadd(d);o.transformMatrix=new $t($t.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 $t(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 xe([lu.ZP],n.prototype,"_onHover",null),xe([lu.ZP],n.prototype,"_onClick",null),xe([lu.ZP],n.prototype,"_onViewStateChange",null),xe([lu.ZP],n.prototype,"_onDragStart",null),xe([lu.ZP],n.prototype,"_onDrag",null),xe([lu.ZP],n.prototype,"_onDragEnd",null),n})();function BMe(n,e){return n===e}function VMe(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 nk=(()=>{class n{constructor(){this.bootstrap$=new If(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=ue({token:n,factory:n.\u0275fac}),n})();const ik=new ve("INITIAL_STATE_TOKEN");let UMe=(()=>{class n{static set(t){this.value=t}static pop(){const t=this.value;return this.value={},t}}return n.value={},n})();const L$=new ve("Internals.StateContextFactory"),B$=new ve("Internals.StateFactory");function V$(n,e){return e?t=>t.pipe(V$((i,r)=>ui(n(i,r)).pipe(Ae((s,o)=>e(i,s,r,o))))):t=>t.lift(new HMe(n))}class HMe{constructor(e){this.project=e}call(e,t){return t.subscribe(new $Me(e,this.project))}}class $Me extends ii{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 Gr(this),i=this.destination;i.add(t);const r=co(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 TM(n=null){return e=>e.lift(new GMe(n))}class GMe{constructor(e){this.defaultValue=e}call(e,t){return t.subscribe(new WMe(e,this.defaultValue))}}class WMe extends xt{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()}}const Ra={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 z$=(()=>{class n{constructor(t,i){this._ngZone=t,this._platformId=i,this.verifyZoneIsNotNooped(this._ngZone)}enter(t){return kD(this._platformId)?this.runInsideAngular(t):this.runOutsideAngular(t)}leave(t){return this.runInsideAngular(t)}runInsideAngular(t){return dt.isInAngularZone()?t():this._ngZone.run(t)}runOutsideAngular(t){return dt.isInAngularZone()?this._ngZone.runOutsideAngular(t):t()}verifyZoneIsNotNooped(t){t instanceof dt||console.warn(Ra.ZONE_WARNING())}}return n.\u0275fac=function(t){return new(t||n)(I(dt),I(dl))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();const j$=new ve("ROOT_STATE_TOKEN"),U$=new ve("FEATURE_STATE_TOKEN"),rk=new ve("NGXS_PLUGINS"),H$=new ve("NG_TEST_MODE"),G$=new ve("NG_DEV_MODE"),ld="NGXS_META",W$="NGXS_OPTIONS_META",sk="NGXS_SELECTOR_META";let fp=(()=>{class n{constructor(){this.defaultsState={},this.selectorOptions={injectContainerState:!0,suppressErrors:!0},this.compatibility={strictContentSecurityPolicy:!1},this.executionStrategy=z$}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();class qMe{constructor(e,t,i){this.previousValue=e,this.currentValue=t,this.firstChange=i}}const q$=new ve("NGXS_EXECUTION_STRATEGY");function pp(n){return n.constructor&&n.constructor.type?n.constructor.type:n.type}const ok=(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},Gm=(n,e)=>e.split(".").reduce((t,i)=>t&&t[i],n),ak=n=>n&&"object"==typeof n&&!Array.isArray(n),lk=(n,...e)=>{if(!e.length)return n;const t=e.shift();if(ak(n)&&ak(t))for(const i in t)ak(t[i])?(n[i]||Object.assign(n,{[i]:{}}),lk(n[i],t[i])):Object.assign(n,{[i]:t[i]});return lk(n,...e)};function ck(n){if(!n.hasOwnProperty(ld)){const e={name:null,actions:{},defaults:{},path:null,makeRootSelector:t=>t.getStateGetter(e.name),children:[]};Object.defineProperty(n,ld,{value:e})}return jb(n)}function jb(n){return n[ld]}function uk(n){return n.hasOwnProperty(sk)||Object.defineProperty(n,sk,{value:{makeRootSelector:null,originalFn:null,containerClass:null,selectorName:null,getSelectorOptions:()=>({})}}),dk(n)}function dk(n){return n[sk]}function Y$(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(e[pp(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 Fn(t=>{const i=pp(t.action);return n[i]&&(!e||e[t.status])})}(i,r),t())}}(n,["DISPATCHED"])}function sxe(){return Ae(n=>n.action)}function AM(n){return e=>new ce(t=>e.subscribe({next(i){n.leave(()=>t.next(i))},error(i){n.leave(()=>t.error(i))},complete(){n.leave(()=>t.complete())}}))}let DM=(()=>{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)(I(q$))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();class lxe extends Se{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 OM=(()=>{class n extends lxe{}return n.\u0275fac=function(){let e;return function(i){return(e||(e=$n(n)))(i||n)}}(),n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})(),cxe=(()=>{class n extends ce{constructor(t,i){super(r=>{const s=t.pipe(AM(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)(I(OM),I(DM))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();const K$=n=>(...e)=>n.shift()(...e,(...i)=>K$(n)(...i));let IM=(()=>{class n extends ar{constructor(){super({})}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})(),hk=(()=>{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)(I(n,12),I(rk,8))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})(),fk=(()=>{class n extends Se{}return n.\u0275fac=function(){let e;return function(i){return(e||(e=$n(n)))(i||n)}}(),n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})(),Z$=(()=>{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($o),this._errorHandler.handleError(r)}catch(s){}})}),i.pipe(AM(this._ngxsExecutionStrategy))}dispatchByEvents(t){return Array.isArray(t)?0===t.length?ht(this._stateStream.getValue()):Hv(t.map(i=>this.dispatchSingle(i))):this.dispatchSingle(t)}dispatchSingle(t){if(!pp(t))return Kg(new Error(`This action doesn't have a type property: ${t.constructor.name}`));const r=this._stateStream.getValue();return K$([...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(qc())}getActionResultStream(t){return this._actionResults.pipe(Fn(i=>i.action===t&&"DISPATCHED"!==i.status),yi(1),qc())}createDispatchObservable(t){return t.pipe(V$(i=>{switch(i.status){case"SUCCESSFUL":return ht(this._stateStream.getValue());case"ERRORED":return Kg(i.error);default:return ec}})).pipe(qc())}}return n.\u0275fac=function(t){return new(t||n)(I(Nt),I(OM),I(fk),I(hk),I(IM),I(DM))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();const Q$=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])&&Q$(n[i])}),n};let J$=(()=>{class n{constructor(t,i){this.isDevMode=t,this.isTestMode=i}}return n.\u0275fac=function(t){return new(t||n)(I(G$),I(H$))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})(),eG=(()=>{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(Ra.INCORRECT_PRODUCTION()):this.isIncorrectDevelopment&&console.warn(Ra.INCORRECT_DEVELOPMENT()))}}return n.\u0275fac=function(t){return new(t||n)(I(J$),I(fp))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})(),qm=(()=>{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=Q$(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)(I(IM),I(Z$),I(fp),I(eG))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})(),PM=(()=>{class n{constructor(t){this._internalStateOperations=t}createStateContext(t){const i=this._internalStateOperations.getRootStateOperations();function r(l){return Gm(l,t.path)}function s(l,c){const d=ok(l,t.path,c),f=t.instance;if(f.ngxsOnChanges){const p=X$(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(Ra.PATCHING_ARRAY());if("object"!=typeof n)throw new Error(Ra.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)(I(qm))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();class RM{static stateNameErrorMessage(e){return Ra.STATE_NAME(e)}static checkCorrectStateName(e){if(!e)throw new Error(Ra.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(Ra.STATE_UNIQUE(r,e.name,s.name));return r}static getValidStateMeta(e){const t=jb(e);if(!t)throw new Error(Ra.STATE_DECORATOR());return t}}RM.stateNameRegex=new RegExp("^[a-zA-Z0-9_]+$");let Ym=(()=>{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=xM(()=>{const c=this;function d(p){const g=c.statePaths[p];return g?Y$(g.split("."),c._config):null}return this._parentFactory?this._parentFactory.getRuntimeSelectorContext():{getStateGetter(p){let g=d(p);return g||((..._)=>(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(RM.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[ld].name};return n.reduce((t,i)=>{const{name:r,children:s}=i[ld];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[ld].name]=t,e),{})}(i),l=[];for(const c of s){const d=a[c],f=o[c],p=d[ld];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)=>ok(o,a.path,a.defaults),{}),states:r}}connectActionHandlers(){null===this._actionsSubscription&&(this._actionsSubscription=this._actions.pipe(Fn(t=>"DISPATCHED"===t.status),di(({action:t})=>this.invokeActions(this._actions,t).pipe(Ae(()=>({action:t,status:"SUCCESSFUL"})),TM({action:t,status:"CANCELED"}),Ta(i=>ht({action:t,status:"ERRORED",error:i}))))).subscribe(t=>this._actionResults.next(t)))}invokeActions(t,i){const r=pp(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=ui(d)),d instanceof ce?(d=d.pipe(TM({})),l.options.cancelUncompleted&&(d=d.pipe(Tn(t.pipe(nxe(i)))))):d=ht({}).pipe(qc()),s.push(d)}catch(d){s.push(Kg(d))}}}return s.length||s.push(ht({})),Hv(s)}addToStatesMap(t){const i=[],r=this.statesByName;for(const s of t){const o=RM.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!==Gm(this._initialState,i);return this.statesByName[t]&&r}}return n.\u0275fac=function(t){return new(t||n)(I(Nt),I(fp),I(n,12),I(OM),I(fk),I(PM),I(ik,8))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})(),pk=(()=>{class n{constructor(t,i,r){this.internalStateOperations=t,this.stateContextFactory=i,this.bootstrapper=r}ngxsBootstrap(t,i){this.internalStateOperations.getRootStateOperations().dispatch(t).pipe(Fn(()=>!!i),Ti(()=>this.invokeInit(i.states)),di(()=>this.bootstrapper.appBootstrapped$),Fn(r=>!!r)).subscribe(()=>this.invokeBootstrap(i.states))}invokeInit(t){for(const i of t){const r=i.instance;if(r.ngxsOnChanges){const a=X$(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)(I(qm),I(PM),I(nk))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();const kM_getOptions=n=>n&&n.NGXS_SELECTOR_OPTIONS_META||{};function nG(n){const e=dk(n)||jb(n);return e&&e.makeRootSelector||(()=>n)}let cu=(()=>{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(Ae(i),Ta(r=>{const{suppressErrors:s}=this._config.selectorOptions;return r instanceof TypeError&&s?ht(void 0):Kg(r)}),Zo(),AM(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(AM(this._internalExecutionStrategy)).subscribe(t)}snapshot(){return this._internalStateOperations.getRootStateOperations().getState()}reset(t){return this._internalStateOperations.getRootStateOperations().setState(t)}getStoreBoundSelectorFn(t){return nG(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)(I(IM),I(qm),I(fp),I(DM),I(Ym),I(ik,8))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})(),Ub=(()=>{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)(I(cu),I(fp))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n.store=null,n.config=null,n})();class iG{static get type(){return"@@INIT"}}class rG{constructor(e){this.addedStates=e}static get type(){return"@@UPDATE_STATE"}}const FM=new If(1);let _xe=(()=>{class n{constructor(t,i,r,s,o=[],a){!function(){try{const n=window.ng,t=!(n.probe&&n.coreTokens)&&Mo();FM.next(t)}catch(n){FM.next(!1)}finally{FM.complete()}}();const l=t.addAndReturnDefaults(o);i.setStateToTheCurrentWithNew(l),t.connectActionHandlers(),a.ngxsBootstrap(new iG,l)}}return n.\u0275fac=function(t){return new(t||n)(I(Ym),I(qm),I(cu),I(Ub),I(j$,8),I(pk))},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({}),n})(),yxe=(()=>{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 rG(l.defaults),l))}static flattenStates(t=[]){return t.reduce((i,r)=>i.concat(r),[])}}return n.\u0275fac=function(t){return new(t||n)(I(cu),I(qm),I(Ym),I(U$,8),I(pk))},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({}),n})();class Io{static forRoot(e=[],t={}){return{ngModule:_xe,providers:[Ym,PM,cxe,OM,nk,eG,J$,pk,Z$,fk,qm,DM,cu,IM,Ub,hk,...e,...Io.ngxsTokenProviders(e,t)]}}static forFeature(e=[]){return{ngModule:yxe,providers:[Ym,hk,...e,{provide:U$,multi:!0,useValue:e}]}}static ngxsTokenProviders(e,t){return[{provide:H$,useValue:jMe},{provide:G$,useValue:Mo},{provide:q$,useClass:t.executionStrategy||z$},{provide:j$,useValue:e},{provide:Io.ROOT_OPTIONS,useValue:t},{provide:fp,useFactory:Io.ngxsConfigFactory,deps:[Io.ROOT_OPTIONS]},{provide:bv,useFactory:Io.appBootstrapListenerFactory,multi:!0,deps:[nk]},{provide:ik,useFactory:Io.getInitialState},{provide:L$,useExisting:PM},{provide:B$,useExisting:Ym}]}static ngxsConfigFactory(e){return lk(new fp,e)}static appBootstrapListenerFactory(e){return()=>e.bootstrap()}static getInitialState(){return UMe.pop()}}function gk(n,e){return(t,i)=>{if(t.hasOwnProperty("prototype"))throw new Error(Ra.ACTION_DECORATOR());const s=ck(t.constructor);Array.isArray(n)||(n=[n]);for(const o of n){const a=o.type;s.actions[a]||(s.actions[a]=[]),s.actions[a].push({fn:i,options:e||{},type:a})}}}function cd(n){return i=>{!function(n){FM.subscribe(e=>{e&&(n.\u0275prov||console.warn(Ra.UNDECORATED_STATE_IN_IVY(n.name)))})}(i);const r=i,s=ck(r),o=Object.getPrototypeOf(r),a=function(i){return Object.assign({},i[W$]||{},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;RM.checkCorrectStateName(d),s.hasOwnProperty(ld)&&(r.actions=Object.assign({},r.actions,(s[ld]||{}).actions)),r.children=a,r.defaults=l,r.name=d})({meta:s,inheritedStateClass:o,optionsWithInheritance:a}),r[W$]=a}}function NM(n,...e){return function(t,i){const r=i.toString(),s=`__${r}__selector`,o=function(n,e,t=[]){return"string"==typeof(e=e||function(n){const e=n.length-1;return 36===n.charCodeAt(e)?n.slice(0,e):n}(n))?Y$(t.length?[e,...t]:e.split("."),Ub.config):e}(r,n,e);Object.defineProperties(t,{[s]:{writable:!0,enumerable:!1,configurable:!0},[r]:{enumerable:!0,configurable:!0,get(){return this[s]||(this[s]=function(n){if(!Ub.store)throw new Error(Ra.SELECT_FACTORY_NOT_CONNECTED());return Ub.store.select(n)}(o))}}})}}function Xm(n){return(e,t,i)=>{if(!i||null===i.value)throw new Error(Ra.SELECTOR_DECORATOR());const s=i.value,o=function(n,e,t){const i=t&&t.containerClass,s=xM(function(...c){const d=e.apply(i,c);return d instanceof Function?xM.apply(null,[d]):d});Object.setPrototypeOf(s,e);const o=function(n,e){const t=uk(n);t.originalFn=n;let i=()=>({});e&&(t.containerClass=e.containerClass,t.selectorName=e.selectorName,i=e.getSelectorOptions||i);const r=Object.assign({},t);return t.getSelectorOptions=()=>function(n,e){return Object.assign({},kM_getOptions(n.containerClass)||{},kM_getOptions(n.originalFn)||{},n.getSelectorOptions()||{},e)}(r,i()),t}(e,t);return o.makeRootSelector=l=>{const{argumentSelectorFunctions:c,selectorOptions:d}=function(n,e,t=[]){const i=e.getSelectorOptions(),r=n.getSelectorOptions(i);return{selectorOptions:r,argumentSelectorFunctions:function(n=[],e,t){const i=[];return t&&(0===n.length||e.injectContainerState)&&jb(t)&&i.push(t),n&&i.push(...n),i}(t,r,e.containerClass).map(a=>nG(a)(n))}}(l,o,n);return function(p){const g=c.map(_=>_(p));try{return s(...g)}catch(_){if(_ instanceof TypeError&&d.suppressErrors)return;throw _}}},s}(n,s,{containerClass:e,selectorName:t.toString(),getSelectorOptions:()=>({})}),a={configurable:!0,get:()=>o};return a.originalFn=s,a}}Io.\u0275fac=function(e){return new(e||Io)},Io.\u0275mod=Pe({type:Io}),Io.\u0275inj=Me({}),Io.ROOT_OPTIONS=new ve("ROOT_OPTIONS");let sG=(()=>{class n{constructor(t,i){this._renderer=t,this._elementRef=i,this.onChange=r=>{},this.onTouched=()=>{}}setProperty(t,i){this._renderer.setProperty(this._elementRef.nativeElement,t,i)}registerOnTouched(t){this.onTouched=t}registerOnChange(t){this.onChange=t}setDisabledState(t){this.setProperty("disabled",t)}}return n.\u0275fac=function(t){return new(t||n)(E(zc),E(rt))},n.\u0275dir=oe({type:n}),n})(),gp=(()=>{class n extends sG{}return n.\u0275fac=function(){let e;return function(i){return(e||(e=$n(n)))(i||n)}}(),n.\u0275dir=oe({type:n,features:[ct]}),n})();const ro=new ve("NgValueAccessor"),xxe={provide:ro,useExisting:T(()=>Hb),multi:!0},Axe=new ve("CompositionEventMode");let Hb=(()=>{class n extends sG{constructor(t,i,r){super(t,i),this._compositionMode=r,this._composing=!1,null==this._compositionMode&&(this._compositionMode=!function(){const n=Uc()?Uc().getUserAgent():"";return/android (\d+)/.test(n.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 n.\u0275fac=function(t){return new(t||n)(E(zc),E(rt),E(Axe,8))},n.\u0275dir=oe({type:n,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,i){1&t&&ge("input",function(s){return i._handleInput(s.target.value)})("blur",function(){return i.onTouched()})("compositionstart",function(){return i._compositionStart()})("compositionend",function(s){return i._compositionEnd(s.target.value)})},features:[Dt([xxe]),ct]}),n})();function Ch(n){return null==n||0===n.length}function aG(n){return null!=n&&"number"==typeof n.length}const Ss=new ve("NgValidators"),wh=new ve("NgAsyncValidators"),Dxe=/^(?=.{1,254}$)(?=.{1,64}@)[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[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])?)*$/;class lG{static min(e){return function(n){return e=>{if(Ch(e.value)||Ch(n))return null;const t=parseFloat(e.value);return!isNaN(t)&&t{if(Ch(e.value)||Ch(n))return null;const t=parseFloat(e.value);return!isNaN(t)&&t>n?{max:{max:n,actual:e.value}}:null}}(e)}static required(e){return function(n){return Ch(n.value)?{required:!0}:null}(e)}static requiredTrue(e){return function(n){return!0===n.value?null:{required:!0}}(e)}static email(e){return function(n){return Ch(n.value)||Dxe.test(n.value)?null:{email:!0}}(e)}static minLength(e){return function(n){return e=>Ch(e.value)||!aG(e.value)?null:e.value.lengthaG(e.value)&&e.value.length>n?{maxlength:{requiredLength:n,actualLength:e.value.length}}:null}(e)}static pattern(e){return function(n){if(!n)return Eh;let e,t;return"string"==typeof n?(t="","^"!==n.charAt(0)&&(t+="^"),t+=n,"$"!==n.charAt(n.length-1)&&(t+="$"),e=new RegExp(t)):(t=n.toString(),e=n),i=>{if(Ch(i.value))return null;const r=i.value;return e.test(r)?null:{pattern:{requiredPattern:t,actualValue:r}}}}(e)}static nullValidator(e){return null}static compose(e){return wG(e)}static composeAsync(e){return EG(e)}}function Eh(n){return null}function _G(n){return null!=n}function yG(n){const e=Og(n)?ui(n):n;return xw(e),e}function vG(n){let e={};return n.forEach(t=>{e=null!=t?Object.assign(Object.assign({},e),t):e}),0===Object.keys(e).length?null:e}function bG(n,e){return e.map(t=>t(n))}function CG(n){return n.map(e=>function(n){return!n.validate}(e)?e:t=>e.validate(t))}function wG(n){if(!n)return null;const e=n.filter(_G);return 0==e.length?null:function(t){return vG(bG(t,e))}}function mk(n){return null!=n?wG(CG(n)):null}function EG(n){if(!n)return null;const e=n.filter(_G);return 0==e.length?null:function(t){return Hv(bG(t,e).map(yG)).pipe(Ae(vG))}}function _k(n){return null!=n?EG(CG(n)):null}function SG(n,e){return null===n?[e]:Array.isArray(n)?[...n,e]:[n,e]}function MG(n){return n._rawValidators}function xG(n){return n._rawAsyncValidators}function yk(n){return n?Array.isArray(n)?n:[n]:[]}function LM(n,e){return Array.isArray(n)?n.includes(e):n===e}function TG(n,e){const t=yk(e);return yk(n).forEach(r=>{LM(t,r)||t.push(r)}),t}function AG(n,e){return yk(e).filter(t=>!LM(n,t))}let DG=(()=>{class n{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=mk(this._rawValidators)}_setAsyncValidators(t){this._rawAsyncValidators=t||[],this._composedAsyncValidatorFn=_k(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,i){return!!this.control&&this.control.hasError(t,i)}getError(t,i){return this.control?this.control.getError(t,i):null}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275dir=oe({type:n}),n})(),Po=(()=>{class n extends DG{get formDirective(){return null}get path(){return null}}return n.\u0275fac=function(){let e;return function(i){return(e||(e=$n(n)))(i||n)}}(),n.\u0275dir=oe({type:n,features:[ct]}),n})();class uc extends DG{constructor(){super(...arguments),this._parent=null,this.name=null,this.valueAccessor=null}}let vk=(()=>{class n extends class{constructor(e){this._cd=e}is(e){var t,i,r;return"submitted"===e?!!(null===(t=this._cd)||void 0===t?void 0:t.submitted):!!(null===(r=null===(i=this._cd)||void 0===i?void 0:i.control)||void 0===r?void 0:r[e])}}{constructor(t){super(t)}}return n.\u0275fac=function(t){return new(t||n)(E(uc,2))},n.\u0275dir=oe({type:n,selectors:[["","formControlName",""],["","ngModel",""],["","formControl",""]],hostVars:14,hostBindings:function(t,i){2&t&&st("ng-untouched",i.is("untouched"))("ng-touched",i.is("touched"))("ng-pristine",i.is("pristine"))("ng-dirty",i.is("dirty"))("ng-valid",i.is("valid"))("ng-invalid",i.is("invalid"))("ng-pending",i.is("pending"))},features:[ct]}),n})();function $b(n,e){wk(n,e),e.valueAccessor.writeValue(n.value),function(n,e){e.valueAccessor.registerOnChange(t=>{n._pendingValue=t,n._pendingChange=!0,n._pendingDirty=!0,"change"===n.updateOn&&PG(n,e)})}(n,e),function(n,e){const t=(i,r)=>{e.valueAccessor.writeValue(i),r&&e.viewToModelUpdate(i)};n.registerOnChange(t),e._registerOnDestroy(()=>{n._unregisterOnChange(t)})}(n,e),function(n,e){e.valueAccessor.registerOnTouched(()=>{n._pendingTouched=!0,"blur"===n.updateOn&&n._pendingChange&&PG(n,e),"submit"!==n.updateOn&&n.markAsTouched()})}(n,e),function(n,e){if(e.valueAccessor.setDisabledState){const t=i=>{e.valueAccessor.setDisabledState(i)};n.registerOnDisabledChange(t),e._registerOnDestroy(()=>{n._unregisterOnDisabledChange(t)})}}(n,e)}function zM(n,e,t=!0){const i=()=>{};e.valueAccessor&&(e.valueAccessor.registerOnChange(i),e.valueAccessor.registerOnTouched(i)),UM(n,e),n&&(e._invokeOnDestroyCallbacks(),n._registerOnCollectionChange(()=>{}))}function jM(n,e){n.forEach(t=>{t.registerOnValidatorChange&&t.registerOnValidatorChange(e)})}function wk(n,e){const t=MG(n);null!==e.validator?n.setValidators(SG(t,e.validator)):"function"==typeof t&&n.setValidators([t]);const i=xG(n);null!==e.asyncValidator?n.setAsyncValidators(SG(i,e.asyncValidator)):"function"==typeof i&&n.setAsyncValidators([i]);const r=()=>n.updateValueAndValidity();jM(e._rawValidators,r),jM(e._rawAsyncValidators,r)}function UM(n,e){let t=!1;if(null!==n){if(null!==e.validator){const r=MG(n);if(Array.isArray(r)&&r.length>0){const s=r.filter(o=>o!==e.validator);s.length!==r.length&&(t=!0,n.setValidators(s))}}if(null!==e.asyncValidator){const r=xG(n);if(Array.isArray(r)&&r.length>0){const s=r.filter(o=>o!==e.asyncValidator);s.length!==r.length&&(t=!0,n.setAsyncValidators(s))}}}const i=()=>{};return jM(e._rawValidators,i),jM(e._rawAsyncValidators,i),t}function PG(n,e){n._pendingDirty&&n.markAsDirty(),n.setValue(n._pendingValue,{emitModelToViewChange:!1}),e.viewToModelUpdate(n._pendingValue),n._pendingChange=!1}function RG(n,e){wk(n,e)}function Ek(n,e){if(!n.hasOwnProperty("model"))return!1;const t=n.model;return!!t.isFirstChange()||!Object.is(e,t.currentValue)}function kG(n,e){n._syncPendingControls(),e.forEach(t=>{const i=t.control;"submit"===i.updateOn&&i._pendingChange&&(t.viewToModelUpdate(i._pendingValue),i._pendingChange=!1)})}function Sk(n,e){if(!e)return null;let t,i,r;return Array.isArray(e),e.forEach(s=>{s.constructor===Hb?t=s:function(n){return Object.getPrototypeOf(n.constructor)===gp}(s)?i=s:r=s}),r||i||t||null}function HM(n,e){const t=n.indexOf(e);t>-1&&n.splice(t,1)}const Gb="VALID",$M="INVALID",Km="PENDING",Wb="DISABLED";function Mk(n){return(Tk(n)?n.validators:n)||null}function FG(n){return Array.isArray(n)?mk(n):n||null}function xk(n,e){return(Tk(e)?e.asyncValidators:n)||null}function NG(n){return Array.isArray(n)?_k(n):n||null}function Tk(n){return null!=n&&!Array.isArray(n)&&"object"==typeof n}class Ak{constructor(e,t){this._hasOwnPendingAsyncValidator=!1,this._onCollectionChange=()=>{},this._parent=null,this.pristine=!0,this.touched=!1,this._onDisabledChange=[],this._rawValidators=e,this._rawAsyncValidators=t,this._composedValidatorFn=FG(this._rawValidators),this._composedAsyncValidatorFn=NG(this._rawAsyncValidators)}get validator(){return this._composedValidatorFn}set validator(e){this._rawValidators=this._composedValidatorFn=e}get asyncValidator(){return this._composedAsyncValidatorFn}set asyncValidator(e){this._rawAsyncValidators=this._composedAsyncValidatorFn=e}get parent(){return this._parent}get valid(){return this.status===Gb}get invalid(){return this.status===$M}get pending(){return this.status==Km}get disabled(){return this.status===Wb}get enabled(){return this.status!==Wb}get dirty(){return!this.pristine}get untouched(){return!this.touched}get updateOn(){return this._updateOn?this._updateOn:this.parent?this.parent.updateOn:"change"}setValidators(e){this._rawValidators=e,this._composedValidatorFn=FG(e)}setAsyncValidators(e){this._rawAsyncValidators=e,this._composedAsyncValidatorFn=NG(e)}addValidators(e){this.setValidators(TG(e,this._rawValidators))}addAsyncValidators(e){this.setAsyncValidators(TG(e,this._rawAsyncValidators))}removeValidators(e){this.setValidators(AG(e,this._rawValidators))}removeAsyncValidators(e){this.setAsyncValidators(AG(e,this._rawAsyncValidators))}hasValidator(e){return LM(this._rawValidators,e)}hasAsyncValidator(e){return LM(this._rawAsyncValidators,e)}clearValidators(){this.validator=null}clearAsyncValidators(){this.asyncValidator=null}markAsTouched(e={}){this.touched=!0,this._parent&&!e.onlySelf&&this._parent.markAsTouched(e)}markAllAsTouched(){this.markAsTouched({onlySelf:!0}),this._forEachChild(e=>e.markAllAsTouched())}markAsUntouched(e={}){this.touched=!1,this._pendingTouched=!1,this._forEachChild(t=>{t.markAsUntouched({onlySelf:!0})}),this._parent&&!e.onlySelf&&this._parent._updateTouched(e)}markAsDirty(e={}){this.pristine=!1,this._parent&&!e.onlySelf&&this._parent.markAsDirty(e)}markAsPristine(e={}){this.pristine=!0,this._pendingDirty=!1,this._forEachChild(t=>{t.markAsPristine({onlySelf:!0})}),this._parent&&!e.onlySelf&&this._parent._updatePristine(e)}markAsPending(e={}){this.status=Km,!1!==e.emitEvent&&this.statusChanges.emit(this.status),this._parent&&!e.onlySelf&&this._parent.markAsPending(e)}disable(e={}){const t=this._parentMarkedDirty(e.onlySelf);this.status=Wb,this.errors=null,this._forEachChild(i=>{i.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(i=>i(!0))}enable(e={}){const t=this._parentMarkedDirty(e.onlySelf);this.status=Gb,this._forEachChild(i=>{i.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(i=>i(!1))}_updateAncestors(e){this._parent&&!e.onlySelf&&(this._parent.updateValueAndValidity(e),e.skipPristineCheck||this._parent._updatePristine(),this._parent._updateTouched())}setParent(e){this._parent=e}updateValueAndValidity(e={}){this._setInitialStatus(),this._updateValue(),this.enabled&&(this._cancelExistingSubscription(),this.errors=this._runValidator(),this.status=this._calculateStatus(),(this.status===Gb||this.status===Km)&&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)}_updateTreeValidity(e={emitEvent:!0}){this._forEachChild(t=>t._updateTreeValidity(e)),this.updateValueAndValidity({onlySelf:!0,emitEvent:e.emitEvent})}_setInitialStatus(){this.status=this._allControlsDisabled()?Wb:Gb}_runValidator(){return this.validator?this.validator(this):null}_runAsyncValidator(e){if(this.asyncValidator){this.status=Km,this._hasOwnPendingAsyncValidator=!0;const t=yG(this.asyncValidator(this));this._asyncValidationSubscription=t.subscribe(i=>{this._hasOwnPendingAsyncValidator=!1,this.setErrors(i,{emitEvent:e})})}}_cancelExistingSubscription(){this._asyncValidationSubscription&&(this._asyncValidationSubscription.unsubscribe(),this._hasOwnPendingAsyncValidator=!1)}setErrors(e,t={}){this.errors=e,this._updateControlsErrors(!1!==t.emitEvent)}get(e){return function(n,e,t){if(null==e||(Array.isArray(e)||(e=e.split(".")),Array.isArray(e)&&0===e.length))return null;let i=n;return e.forEach(r=>{i=i instanceof Dk?i.controls.hasOwnProperty(r)?i.controls[r]:null:i instanceof Uxe&&i.at(r)||null}),i}(this,e)}getError(e,t){const i=t?this.get(t):this;return i&&i.errors?i.errors[e]:null}hasError(e,t){return!!this.getError(e,t)}get root(){let e=this;for(;e._parent;)e=e._parent;return e}_updateControlsErrors(e){this.status=this._calculateStatus(),e&&this.statusChanges.emit(this.status),this._parent&&this._parent._updateControlsErrors(e)}_initObservables(){this.valueChanges=new Le,this.statusChanges=new Le}_calculateStatus(){return this._allControlsDisabled()?Wb:this.errors?$M:this._hasOwnPendingAsyncValidator||this._anyControlsHaveStatus(Km)?Km:this._anyControlsHaveStatus($M)?$M:Gb}_anyControlsHaveStatus(e){return this._anyControls(t=>t.status===e)}_anyControlsDirty(){return this._anyControls(e=>e.dirty)}_anyControlsTouched(){return this._anyControls(e=>e.touched)}_updatePristine(e={}){this.pristine=!this._anyControlsDirty(),this._parent&&!e.onlySelf&&this._parent._updatePristine(e)}_updateTouched(e={}){this.touched=this._anyControlsTouched(),this._parent&&!e.onlySelf&&this._parent._updateTouched(e)}_isBoxedValue(e){return"object"==typeof e&&null!==e&&2===Object.keys(e).length&&"value"in e&&"disabled"in e}_registerOnCollectionChange(e){this._onCollectionChange=e}_setUpdateStrategy(e){Tk(e)&&null!=e.updateOn&&(this._updateOn=e.updateOn)}_parentMarkedDirty(e){return!e&&!(!this._parent||!this._parent.dirty)&&!this._parent._anyControlsDirty()}}class Sh extends Ak{constructor(e=null,t,i){super(Mk(t),xk(i,t)),this._onChange=[],this._applyFormState(e),this._setUpdateStrategy(t),this._initObservables(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator})}setValue(e,t={}){this.value=this._pendingValue=e,this._onChange.length&&!1!==t.emitModelToViewChange&&this._onChange.forEach(i=>i(this.value,!1!==t.emitViewToModelChange)),this.updateValueAndValidity(t)}patchValue(e,t={}){this.setValue(e,t)}reset(e=null,t={}){this._applyFormState(e),this.markAsPristine(t),this.markAsUntouched(t),this.setValue(this.value,t),this._pendingChange=!1}_updateValue(){}_anyControls(e){return!1}_allControlsDisabled(){return this.disabled}registerOnChange(e){this._onChange.push(e)}_unregisterOnChange(e){HM(this._onChange,e)}registerOnDisabledChange(e){this._onDisabledChange.push(e)}_unregisterOnDisabledChange(e){HM(this._onDisabledChange,e)}_forEachChild(e){}_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(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}}class Dk extends Ak{constructor(e,t,i){super(Mk(t),xk(i,t)),this.controls=e,this._initObservables(),this._setUpdateStrategy(t),this._setUpControls(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator})}registerControl(e,t){return this.controls[e]?this.controls[e]:(this.controls[e]=t,t.setParent(this),t._registerOnCollectionChange(this._onCollectionChange),t)}addControl(e,t,i={}){this.registerControl(e,t),this.updateValueAndValidity({emitEvent:i.emitEvent}),this._onCollectionChange()}removeControl(e,t={}){this.controls[e]&&this.controls[e]._registerOnCollectionChange(()=>{}),delete this.controls[e],this.updateValueAndValidity({emitEvent:t.emitEvent}),this._onCollectionChange()}setControl(e,t,i={}){this.controls[e]&&this.controls[e]._registerOnCollectionChange(()=>{}),delete this.controls[e],t&&this.registerControl(e,t),this.updateValueAndValidity({emitEvent:i.emitEvent}),this._onCollectionChange()}contains(e){return this.controls.hasOwnProperty(e)&&this.controls[e].enabled}setValue(e,t={}){this._checkAllValuesPresent(e),Object.keys(e).forEach(i=>{this._throwIfControlMissing(i),this.controls[i].setValue(e[i],{onlySelf:!0,emitEvent:t.emitEvent})}),this.updateValueAndValidity(t)}patchValue(e,t={}){null!=e&&(Object.keys(e).forEach(i=>{this.controls[i]&&this.controls[i].patchValue(e[i],{onlySelf:!0,emitEvent:t.emitEvent})}),this.updateValueAndValidity(t))}reset(e={},t={}){this._forEachChild((i,r)=>{i.reset(e[r],{onlySelf:!0,emitEvent:t.emitEvent})}),this._updatePristine(t),this._updateTouched(t),this.updateValueAndValidity(t)}getRawValue(){return this._reduceChildren({},(e,t,i)=>(e[i]=t instanceof Sh?t.value:t.getRawValue(),e))}_syncPendingControls(){let e=this._reduceChildren(!1,(t,i)=>!!i._syncPendingControls()||t);return e&&this.updateValueAndValidity({onlySelf:!0}),e}_throwIfControlMissing(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: ${e}.`)}_forEachChild(e){Object.keys(this.controls).forEach(t=>{const i=this.controls[t];i&&e(i,t)})}_setUpControls(){this._forEachChild(e=>{e.setParent(this),e._registerOnCollectionChange(this._onCollectionChange)})}_updateValue(){this.value=this._reduceValue()}_anyControls(e){for(const t of Object.keys(this.controls)){const i=this.controls[t];if(this.contains(t)&&e(i))return!0}return!1}_reduceValue(){return this._reduceChildren({},(e,t,i)=>((t.enabled||this.disabled)&&(e[i]=t.value),e))}_reduceChildren(e,t){let i=e;return this._forEachChild((r,s)=>{i=t(i,r,s)}),i}_allControlsDisabled(){for(const e of Object.keys(this.controls))if(this.controls[e].enabled)return!1;return Object.keys(this.controls).length>0||this.disabled}_checkAllValuesPresent(e){this._forEachChild((t,i)=>{if(void 0===e[i])throw new Error(`Must supply a value for form control with name: '${i}'.`)})}}class Uxe extends Ak{constructor(e,t,i){super(Mk(t),xk(i,t)),this.controls=e,this._initObservables(),this._setUpdateStrategy(t),this._setUpControls(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator})}at(e){return this.controls[e]}push(e,t={}){this.controls.push(e),this._registerControl(e),this.updateValueAndValidity({emitEvent:t.emitEvent}),this._onCollectionChange()}insert(e,t,i={}){this.controls.splice(e,0,t),this._registerControl(t),this.updateValueAndValidity({emitEvent:i.emitEvent})}removeAt(e,t={}){this.controls[e]&&this.controls[e]._registerOnCollectionChange(()=>{}),this.controls.splice(e,1),this.updateValueAndValidity({emitEvent:t.emitEvent})}setControl(e,t,i={}){this.controls[e]&&this.controls[e]._registerOnCollectionChange(()=>{}),this.controls.splice(e,1),t&&(this.controls.splice(e,0,t),this._registerControl(t)),this.updateValueAndValidity({emitEvent:i.emitEvent}),this._onCollectionChange()}get length(){return this.controls.length}setValue(e,t={}){this._checkAllValuesPresent(e),e.forEach((i,r)=>{this._throwIfControlMissing(r),this.at(r).setValue(i,{onlySelf:!0,emitEvent:t.emitEvent})}),this.updateValueAndValidity(t)}patchValue(e,t={}){null!=e&&(e.forEach((i,r)=>{this.at(r)&&this.at(r).patchValue(i,{onlySelf:!0,emitEvent:t.emitEvent})}),this.updateValueAndValidity(t))}reset(e=[],t={}){this._forEachChild((i,r)=>{i.reset(e[r],{onlySelf:!0,emitEvent:t.emitEvent})}),this._updatePristine(t),this._updateTouched(t),this.updateValueAndValidity(t)}getRawValue(){return this.controls.map(e=>e instanceof Sh?e.value:e.getRawValue())}clear(e={}){this.controls.length<1||(this._forEachChild(t=>t._registerOnCollectionChange(()=>{})),this.controls.splice(0),this.updateValueAndValidity({emitEvent:e.emitEvent}))}_syncPendingControls(){let e=this.controls.reduce((t,i)=>!!i._syncPendingControls()||t,!1);return e&&this.updateValueAndValidity({onlySelf:!0}),e}_throwIfControlMissing(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 ${e}`)}_forEachChild(e){this.controls.forEach((t,i)=>{e(t,i)})}_updateValue(){this.value=this.controls.filter(e=>e.enabled||this.disabled).map(e=>e.value)}_anyControls(e){return this.controls.some(t=>t.enabled&&e(t))}_setUpControls(){this._forEachChild(e=>this._registerControl(e))}_checkAllValuesPresent(e){this._forEachChild((t,i)=>{if(void 0===e[i])throw new Error(`Must supply a value for form control at index: ${i}.`)})}_allControlsDisabled(){for(const e of this.controls)if(e.enabled)return!1;return this.controls.length>0||this.disabled}_registerControl(e){e.setParent(this),e._registerOnCollectionChange(this._onCollectionChange)}}const Hxe={provide:Po,useExisting:T(()=>mp)},qb=(()=>Promise.resolve(null))();let mp=(()=>{class n extends Po{constructor(t,i){super(),this.submitted=!1,this._directives=[],this.ngSubmit=new Le,this.form=new Dk({},mk(t),_k(i))}ngAfterViewInit(){this._setUpdateStrategy()}get formDirective(){return this}get control(){return this.form}get path(){return[]}get controls(){return this.form.controls}addControl(t){qb.then(()=>{const i=this._findContainer(t.path);t.control=i.registerControl(t.name,t.control),$b(t.control,t),t.control.updateValueAndValidity({emitEvent:!1}),this._directives.push(t)})}getControl(t){return this.form.get(t.path)}removeControl(t){qb.then(()=>{const i=this._findContainer(t.path);i&&i.removeControl(t.name),HM(this._directives,t)})}addFormGroup(t){qb.then(()=>{const i=this._findContainer(t.path),r=new Dk({});RG(r,t),i.registerControl(t.name,r),r.updateValueAndValidity({emitEvent:!1})})}removeFormGroup(t){qb.then(()=>{const i=this._findContainer(t.path);i&&i.removeControl(t.name)})}getFormGroup(t){return this.form.get(t.path)}updateModel(t,i){qb.then(()=>{this.form.get(t.path).setValue(i)})}setValue(t){this.control.setValue(t)}onSubmit(t){return this.submitted=!0,kG(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 n.\u0275fac=function(t){return new(t||n)(E(Ss,10),E(wh,10))},n.\u0275dir=oe({type:n,selectors:[["form",3,"ngNoForm","",3,"formGroup",""],["ng-form"],["","ngForm",""]],hostBindings:function(t,i){1&t&&ge("submit",function(s){return i.onSubmit(s)})("reset",function(){return i.onReset()})},inputs:{options:["ngFormOptions","options"]},outputs:{ngSubmit:"ngSubmit"},exportAs:["ngForm"],features:[Dt([Hxe]),ct]}),n})();const Gxe={provide:uc,useExisting:T(()=>Ok)},VG=(()=>Promise.resolve(null))();let Ok=(()=>{class n extends uc{constructor(t,i,r,s){super(),this.control=new Sh,this._registered=!1,this.update=new Le,this._parent=t,this._setValidators(i),this._setAsyncValidators(r),this.valueAccessor=Sk(0,s)}ngOnChanges(t){this._checkForErrors(),this._registered||this._setUpControl(),"isDisabled"in t&&this._updateDisabled(t),Ek(t,this.viewModel)&&(this._updateValue(this.model),this.viewModel=this.model)}ngOnDestroy(){this.formDirective&&this.formDirective.removeControl(this)}get path(){return this._parent?function(n,e){return[...e.path,n]}(this.name,this._parent):[this.name]}get formDirective(){return this._parent?this._parent.formDirective:null}viewToModelUpdate(t){this.viewModel=t,this.update.emit(t)}_setUpControl(){this._setUpdateStrategy(),this._isStandalone()?this._setUpStandalone():this.formDirective.addControl(this),this._registered=!0}_setUpdateStrategy(){this.options&&null!=this.options.updateOn&&(this.control._updateOn=this.options.updateOn)}_isStandalone(){return!this._parent||!(!this.options||!this.options.standalone)}_setUpStandalone(){$b(this.control,this),this.control.updateValueAndValidity({emitEvent:!1})}_checkForErrors(){this._isStandalone()||this._checkParentType(),this._checkName()}_checkParentType(){}_checkName(){this.options&&this.options.name&&(this.name=this.options.name),this._isStandalone()}_updateValue(t){VG.then(()=>{this.control.setValue(t,{emitViewToModelChange:!1})})}_updateDisabled(t){const i=t.isDisabled.currentValue,r=""===i||i&&"false"!==i;VG.then(()=>{r&&!this.control.disabled?this.control.disable():!r&&this.control.disabled&&this.control.enable()})}}return n.\u0275fac=function(t){return new(t||n)(E(Po,9),E(Ss,10),E(wh,10),E(ro,10))},n.\u0275dir=oe({type:n,selectors:[["","ngModel","",3,"formControlName","",3,"formControl",""]],inputs:{name:"name",isDisabled:["disabled","isDisabled"],model:["ngModel","model"],options:["ngModelOptions","options"]},outputs:{update:"ngModelChange"},exportAs:["ngModel"],features:[Dt([Gxe]),ct,zn]}),n})(),UG=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({}),n})();const Ik=new ve("NgModelWithFormControlWarning"),Kxe={provide:uc,useExisting:T(()=>GM)};let GM=(()=>{class n extends uc{constructor(t,i,r,s){super(),this._ngModelWarningConfig=s,this.update=new Le,this._ngModelWarningSent=!1,this._setValidators(t),this._setAsyncValidators(i),this.valueAccessor=Sk(0,r)}set isDisabled(t){}ngOnChanges(t){if(this._isControlChanged(t)){const i=t.form.previousValue;i&&zM(i,this,!1),$b(this.form,this),this.control.disabled&&this.valueAccessor.setDisabledState&&this.valueAccessor.setDisabledState(!0),this.form.updateValueAndValidity({emitEvent:!1})}Ek(t,this.viewModel)&&(this.form.setValue(this.model),this.viewModel=this.model)}ngOnDestroy(){this.form&&zM(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 n.\u0275fac=function(t){return new(t||n)(E(Ss,10),E(wh,10),E(ro,10),E(Ik,8))},n.\u0275dir=oe({type:n,selectors:[["","formControl",""]],inputs:{isDisabled:["disabled","isDisabled"],form:["formControl","form"],model:["ngModel","model"]},outputs:{update:"ngModelChange"},exportAs:["ngForm"],features:[Dt([Kxe]),ct,zn]}),n._ngModelWarningSentOnce=!1,n})();const Zxe={provide:Po,useExisting:T(()=>Zm)};let Zm=(()=>{class n extends Po{constructor(t,i){super(),this.validators=t,this.asyncValidators=i,this.submitted=!1,this._onCollectionChange=()=>this._updateDomValue(),this.directives=[],this.form=null,this.ngSubmit=new Le,this._setValidators(t),this._setAsyncValidators(i)}ngOnChanges(t){this._checkFormPresent(),t.hasOwnProperty("form")&&(this._updateValidators(),this._updateDomValue(),this._updateRegistrations(),this._oldForm=this.form)}ngOnDestroy(){this.form&&(UM(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 i=this.form.get(t.path);return $b(i,t),i.updateValueAndValidity({emitEvent:!1}),this.directives.push(t),i}getControl(t){return this.form.get(t.path)}removeControl(t){zM(t.control||null,t,!1),HM(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,i){this.form.get(t.path).setValue(i)}onSubmit(t){return this.submitted=!0,kG(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 i=t.control,r=this.form.get(t.path);i!==r&&(zM(i||null,t),r instanceof Sh&&($b(r,t),t.control=r))}),this.form._updateTreeValidity({emitEvent:!1})}_setUpFormContainer(t){const i=this.form.get(t.path);RG(i,t),i.updateValueAndValidity({emitEvent:!1})}_cleanUpFormContainer(t){if(this.form){const i=this.form.get(t.path);i&&function(n,e){return UM(n,e)}(i,t)&&i.updateValueAndValidity({emitEvent:!1})}}_updateRegistrations(){this.form._registerOnCollectionChange(this._onCollectionChange),this._oldForm&&this._oldForm._registerOnCollectionChange(()=>{})}_updateValidators(){wk(this.form,this),this._oldForm&&UM(this._oldForm,this)}_checkFormPresent(){}}return n.\u0275fac=function(t){return new(t||n)(E(Ss,10),E(wh,10))},n.\u0275dir=oe({type:n,selectors:[["","formGroup",""]],hostBindings:function(t,i){1&t&&ge("submit",function(s){return i.onSubmit(s)})("reset",function(){return i.onReset()})},inputs:{form:["formGroup","form"]},outputs:{ngSubmit:"ngSubmit"},exportAs:["ngForm"],features:[Dt([Zxe]),ct,zn]}),n})(),iW=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[UG]]}),n})(),Lk=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[iW]}),n})(),Bk=(()=>{class n{static withConfig(t){return{ngModule:n,providers:[{provide:Ik,useValue:t.warnOnNgModelWithFormControl}]}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[iW]}),n})();function Yb(n){return new ce(e=>{let t;try{t=n()}catch(r){return void e.error(r)}return(t?ui(t):bE()).subscribe(e)})}function Vk(n,e=Pf){const i=function(n){return n instanceof Date&&!isNaN(+n)}(n)?+n-e.now():Math.abs(n);return r=>r.lift(new m1e(i,e))}class m1e{constructor(e,t){this.delay=e,this.scheduler=t}call(e,t){return t.subscribe(new zk(e,this.delay,this.scheduler))}}class zk extends xt{constructor(e,t,i){super(e),this.delay=t,this.scheduler=i,this.queue=[],this.active=!1,this.errored=!1}static dispatch(e){const t=e.source,i=t.queue,r=e.scheduler,s=e.destination;for(;i.length>0&&i[0].time-r.now()<=0;)i.shift().notification.observe(s);if(i.length>0){const o=Math.max(0,i[0].time-r.now());this.schedule(e,o)}else this.unsubscribe(),t.active=!1}_schedule(e){this.active=!0,this.destination.add(e.schedule(zk.dispatch,this.delay,{source:this,destination:this.destination,scheduler:e}))}scheduleNotification(e){if(!0===this.errored)return;const t=this.scheduler,i=new _1e(t.now()+this.delay,e);this.queue.push(i),!1===this.active&&this._schedule(t)}_next(e){this.scheduleNotification(Ko.createNext(e))}_error(e){this.errored=!0,this.queue=[],this.destination.error(e),this.unsubscribe()}_complete(){this.scheduleNotification(Ko.createComplete()),this.unsubscribe()}}class _1e{constructor(e,t){this.time=e,this.notification=t}}const aW=tm({passive:!0});let lW=(()=>{class n{constructor(t,i){this._platform=t,this._ngZone=i,this._monitoredElements=new Map}monitor(t){if(!this._platform.isBrowser)return ec;const i=Wu(t),r=this._monitoredElements.get(i);if(r)return r.subject;const s=new Se,o="cdk-text-field-autofilled",a=l=>{"cdk-text-field-autofill-start"!==l.animationName||i.classList.contains(o)?"cdk-text-field-autofill-end"===l.animationName&&i.classList.contains(o)&&(i.classList.remove(o),this._ngZone.run(()=>s.next({target:l.target,isAutofilled:!1}))):(i.classList.add(o),this._ngZone.run(()=>s.next({target:l.target,isAutofilled:!0})))};return this._ngZone.runOutsideAngular(()=>{i.addEventListener("animationstart",a,aW),i.classList.add("cdk-text-field-autofill-monitored")}),this._monitoredElements.set(i,{subject:s,unlisten:()=>{i.removeEventListener("animationstart",a,aW)}}),s}stopMonitoring(t){const i=Wu(t),r=this._monitoredElements.get(i);r&&(r.unlisten(),r.subject.complete(),i.classList.remove("cdk-text-field-autofill-monitored"),i.classList.remove("cdk-text-field-autofilled"),this._monitoredElements.delete(i))}ngOnDestroy(){this._monitoredElements.forEach((t,i)=>this.stopMonitoring(i))}}return n.\u0275fac=function(t){return new(t||n)(I(si),I(dt))},n.\u0275prov=ue({factory:function(){return new n(I(si),I(dt))},token:n,providedIn:"root"}),n})(),cW=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[Rv]]}),n})();const k1e=new ve("MAT_INPUT_VALUE_ACCESSOR"),F1e=["button","checkbox","file","hidden","image","radio","range","reset","submit"];let N1e=0;const L1e=FO(class{constructor(n,e,t,i){this._defaultErrorStateMatcher=n,this._parentForm=e,this._parentFormGroup=t,this.ngControl=i}});let Xb=(()=>{class n extends L1e{constructor(t,i,r,s,o,a,l,c,d,f){super(a,s,o,r),this._elementRef=t,this._platform=i,this._autofillMonitor=c,this._formField=f,this._uid="mat-input-"+N1e++,this.focused=!1,this.stateChanges=new Se,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(_=>xV().has(_));const p=this._elementRef.nativeElement,g=p.nodeName.toLowerCase();this._inputValueAccessor=l||p,this._previousNativeValue=this.value,this.id=this.id,i.IOS&&d.runOutsideAngular(()=>{t.nativeElement.addEventListener("keyup",_=>{const y=_.target;!y.value&&0===y.selectionStart&&0===y.selectionEnd&&(y.setSelectionRange(1,1),y.setSelectionRange(0,0))})}),this._isServer=!this._platform.isBrowser,this._isNativeSelect="select"===g,this._isTextarea="textarea"===g,this._isInFormField=!!f,this._isNativeSelect&&(this.controlType=p.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=Mt(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=Mt(t)}get type(){return this._type}set type(t){this._type=t||"text",this._validateType(),!this._isTextarea&&xV().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=Mt(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,i;const r=(null===(i=null===(t=this._formField)||void 0===t?void 0:t._hideControlPlaceholder)||void 0===i?void 0:i.call(t))?null:this.placeholder;if(r!==this._previousPlaceholder){const s=this._elementRef.nativeElement;this._previousPlaceholder=r,r?s.setAttribute("placeholder",r):s.removeAttribute("placeholder")}}_dirtyCheckNativeValue(){const t=this._elementRef.nativeElement.value;this._previousNativeValue!==t&&(this._previousNativeValue=t,this.stateChanges.next())}_validateType(){F1e.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,i=t.options[0];return this.focused||t.multiple||!this.empty||!!(t.selectedIndex>-1&&i&&i.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 n.\u0275fac=function(t){return new(t||n)(E(rt),E(si),E(uc,10),E(mp,8),E(Zm,8),E(Vv),E(k1e,10),E(lW),E(dt),E(nS,8))},n.\u0275dir=oe({type:n,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,i){1&t&&ge("focus",function(){return i._focusChanged(!0)})("blur",function(){return i._focusChanged(!1)})("input",function(){return i._onInput()}),2&t&&(al("disabled",i.disabled)("required",i.required),nn("id",i.id)("data-placeholder",i.placeholder)("readonly",i.readonly&&!i._isNativeSelect||null)("aria-invalid",i.empty&&i.required?null:i.errorState)("aria-required",i.required),st("mat-input-server",i._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:[Dt([{provide:jv,useExisting:n}]),ct,zn]}),n})(),Kb=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({providers:[Vv],imports:[[cW,Uv,On],cW,Uv]}),n})();function ur(...n){const e=n.length;if(0===e)throw new Error("list of properties cannot be empty.");return t=>Ae(function(n,e){return i=>{let r=i;for(let s=0;si.lift(new U1e(n,e,t.leading,t.trailing))}class U1e{constructor(e,t,i,r){this.duration=e,this.scheduler=t,this.leading=i,this.trailing=r}call(e,t){return t.subscribe(new H1e(e,this.duration,this.scheduler,this.leading,this.trailing))}}class H1e extends xt{constructor(e,t,i,r,s){super(e),this.duration=t,this.scheduler=i,this.leading=r,this.trailing=s,this._hasTrailingValue=!1,this._trailingValue=null}_next(e){this.throttled?this.trailing&&(this._trailingValue=e,this._hasTrailingValue=!0):(this.add(this.throttled=this.scheduler.schedule($1e,this.duration,{subscriber:this})),this.leading?this.destination.next(e):this.trailing&&(this._trailingValue=e,this._hasTrailingValue=!0))}_complete(){this._hasTrailingValue?(this.destination.next(this._trailingValue),this.destination.complete()):this.destination.complete()}clearThrottle(){const e=this.throttled;e&&(this.trailing&&this._hasTrailingValue&&(this.destination.next(this._trailingValue),this._trailingValue=null,this._hasTrailingValue=!1),e.unsubscribe(),this.remove(e),this.throttled=null)}}function $1e(n){const{subscriber:e}=n;e.clearThrottle()}var hW=ze(266);const G1e={tooltipState:tc("state",[wr("initial, void, hidden",ti({opacity:0,transform:"scale(0)"})),wr("visible",ti({transform:"scale(1)"})),Qs("* => visible",Ao("200ms cubic-bezier(0, 0, 0.2, 1)",zie([ti({opacity:0,transform:"scale(0)",offset:0}),ti({opacity:.5,transform:"scale(0.99)",offset:.5}),ti({opacity:1,transform:"scale(1)",offset:1})]))),Qs("* => hidden",Ao("100ms cubic-bezier(0, 0, 0.2, 1)",ti({opacity:0})))])},fW="tooltip-panel",pW=tm({passive:!0}),gW=new ve("mat-tooltip-scroll-strategy"),X1e={provide:gW,deps:[Jo],useFactory:function(n){return()=>n.scrollStrategies.reposition({scrollThrottle:20})}},K1e=new ve("mat-tooltip-default-options",{providedIn:"root",factory:function(){return{showDelay:0,hideDelay:0,touchendHideDelay:1500}}});let Q1e=(()=>{class n{constructor(t,i,r,s,o,a,l,c,d,f,p,g){this._overlay=t,this._elementRef=i,this._scrollDispatcher=r,this._viewContainerRef=s,this._ngZone=o,this._platform=a,this._ariaDescriber=l,this._focusMonitor=c,this._dir=f,this._defaultOptions=p,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 Se,this._handleKeydown=_=>{this._isTooltipVisible()&&27===_.keyCode&&!Zs(_)&&(_.preventDefault(),_.stopPropagation(),this._ngZone.run(()=>this.hide(0)))},this._scrollStrategy=d,this._document=g,p&&(p.position&&(this.position=p.position),p.touchGestures&&(this.touchGestures=p.touchGestures)),f.change.pipe(Tn(this._destroyed)).subscribe(()=>{this._overlayRef&&this._updatePosition(this._overlayRef)}),o.runOutsideAngular(()=>{i.nativeElement.addEventListener("keydown",this._handleKeydown)})}get position(){return this._position}set position(t){var i;t!==this._position&&(this._position=t,this._overlayRef&&(this._updatePosition(this._overlayRef),null===(i=this._tooltipInstance)||void 0===i||i.show(0),this._overlayRef.updatePosition()))}get disabled(){return this._disabled}set disabled(t){this._disabled=Mt(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(Tn(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(([i,r])=>{t.removeEventListener(i,r,pW)}),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 i=this._createOverlay();this._detach(),this._portal=this._portal||new dm(this._tooltipComponent,this._viewContainerRef),this._tooltipInstance=i.attach(this._portal).instance,this._tooltipInstance.afterHidden().pipe(Tn(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),i=this._overlay.position().flexibleConnectedTo(this._elementRef).withTransformOriginOn(`.${this._cssClassPrefix}-tooltip`).withFlexibleDimensions(!1).withViewportMargin(this._viewportMargin).withScrollableContainers(t);return i.positionChanges.pipe(Tn(this._destroyed)).subscribe(r=>{this._updateCurrentPositionClass(r.connectionPair),this._tooltipInstance&&r.scrollableViewProperties.isOverlayClipped&&this._tooltipInstance.isVisible()&&this._ngZone.run(()=>this.hide(0))}),this._overlayRef=this._overlay.create({direction:this._dir,positionStrategy:i,panelClass:`${this._cssClassPrefix}-${fW}`,scrollStrategy:this._scrollStrategy()}),this._updatePosition(this._overlayRef),this._overlayRef.detachments().pipe(Tn(this._destroyed)).subscribe(()=>this._detach()),this._overlayRef.outsidePointerEvents().pipe(Tn(this._destroyed)).subscribe(()=>{var r;return null===(r=this._tooltipInstance)||void 0===r?void 0:r._handleBodyInteraction()}),this._overlayRef}_detach(){this._overlayRef&&this._overlayRef.hasAttached()&&this._overlayRef.detach(),this._tooltipInstance=null}_updatePosition(t){const i=t.getConfig().positionStrategy,r=this._getOrigin(),s=this._getOverlayPosition();i.withPositions([this._addOffset(Object.assign(Object.assign({},r.main),s.main)),this._addOffset(Object.assign(Object.assign({},r.fallback),s.fallback))])}_addOffset(t){return t}_getOrigin(){const t=!this._dir||"ltr"==this._dir.value,i=this.position;let r;"above"==i||"below"==i?r={originX:"center",originY:"above"==i?"top":"bottom"}:"before"==i||"left"==i&&t||"right"==i&&!t?r={originX:"start",originY:"center"}:("after"==i||"right"==i&&t||"left"==i&&!t)&&(r={originX:"end",originY:"center"});const{x:s,y:o}=this._invertPosition(r.originX,r.originY);return{main:r,fallback:{originX:s,originY:o}}}_getOverlayPosition(){const t=!this._dir||"ltr"==this._dir.value,i=this.position;let r;"above"==i?r={overlayX:"center",overlayY:"bottom"}:"below"==i?r={overlayX:"center",overlayY:"top"}:"before"==i||"left"==i&&t||"right"==i&&!t?r={overlayX:"end",overlayY:"center"}:("after"==i||"right"==i&&t||"left"==i&&!t)&&(r={overlayX:"start",overlayY:"center"});const{x:s,y:o}=this._invertPosition(r.overlayX,r.overlayY);return{main:r,fallback:{overlayX:s,overlayY:o}}}_updateTooltipMessage(){this._tooltipInstance&&(this._tooltipInstance.message=this.message,this._tooltipInstance._markForCheck(),this._ngZone.onMicrotaskEmpty.pipe(yi(1),Tn(this._destroyed)).subscribe(()=>{this._tooltipInstance&&this._overlayRef.updatePosition()}))}_setTooltipClass(t){this._tooltipInstance&&(this._tooltipInstance.tooltipClass=t,this._tooltipInstance._markForCheck())}_invertPosition(t,i){return"above"===this.position||"below"===this.position?"top"===i?i="bottom":"bottom"===i&&(i="top"):"end"===t?t="start":"start"===t&&(t="end"),{x:t,y:i}}_updateCurrentPositionClass(t){const{overlayY:i,originX:r,originY:s}=t;let o;if(o="center"===i?this._dir&&"rtl"===this._dir.value?"end"===r?"left":"right":"start"===r?"left":"right":"bottom"===i&&"top"===s?"above":"below",o!==this._currentPosition){const a=this._overlayRef;if(a){const l=`${this._cssClassPrefix}-${fW}-`;a.removePanelClass(l+this._currentPosition),a.addPanelClass(l+o)}this._currentPosition=o}}_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",i=>this._wheelListener(i)]);else if("off"!==this.touchGestures){this._disableNativeGesturesIfNecessary();const i=()=>{clearTimeout(this._touchstartTimeout),this.hide(this._defaultOptions.touchendHideDelay)};t.push(["touchend",i],["touchcancel",i])}this._addListeners(t),this._passiveListeners.push(...t)}_addListeners(t){t.forEach(([i,r])=>{this._elementRef.nativeElement.addEventListener(i,r,pW)})}_platformSupportsMouseEvents(){return!this._platform.IOS&&!this._platform.ANDROID}_wheelListener(t){if(this._isTooltipVisible()){const i=this._document.elementFromPoint(t.clientX,t.clientY),r=this._elementRef.nativeElement;i!==r&&!r.contains(i)&&this.hide()}}_disableNativeGesturesIfNecessary(){const t=this.touchGestures;if("off"!==t){const i=this._elementRef.nativeElement,r=i.style;("on"===t||"INPUT"!==i.nodeName&&"TEXTAREA"!==i.nodeName)&&(r.userSelect=r.msUserSelect=r.webkitUserSelect=r.MozUserSelect="none"),("on"===t||!i.draggable)&&(r.webkitUserDrag="none"),r.touchAction="none",r.webkitTapHighlightColor="transparent"}}}return n.\u0275fac=function(t){return new(t||n)(E(Jo),E(rt),E(um),E(ns),E(dt),E(si),E(IV),E(Sa),E(void 0),E(Qo),E(void 0),E(ut))},n.\u0275dir=oe({type:n,inputs:{showDelay:["matTooltipShowDelay","showDelay"],hideDelay:["matTooltipHideDelay","hideDelay"],touchGestures:["matTooltipTouchGestures","touchGestures"],position:["matTooltipPosition","position"],disabled:["matTooltipDisabled","disabled"],message:["matTooltip","message"],tooltipClass:["matTooltipClass","tooltipClass"]}}),n})(),dc=(()=>{class n extends Q1e{constructor(t,i,r,s,o,a,l,c,d,f,p,g){super(t,i,r,s,o,a,l,c,d,f,p,g),this._tooltipComponent=eTe}}return n.\u0275fac=function(t){return new(t||n)(E(Jo),E(rt),E(um),E(ns),E(dt),E(si),E(IV),E(Sa),E(gW),E(Qo,8),E(K1e,8),E(ut))},n.\u0275dir=oe({type:n,selectors:[["","matTooltip",""]],hostAttrs:[1,"mat-tooltip-trigger"],exportAs:["matTooltip"],features:[ct]}),n})(),J1e=(()=>{class n{constructor(t){this._changeDetectorRef=t,this._visibility="initial",this._closeOnInteraction=!1,this._onHide=new Se}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 i=t.toState;"hidden"===i&&!this.isVisible()&&this._onHide.next(),("visible"===i||"hidden"===i)&&(this._closeOnInteraction=!0)}_handleBodyInteraction(){this._closeOnInteraction&&this.hide(0)}_markForCheck(){this._changeDetectorRef.markForCheck()}_onShow(){}}return n.\u0275fac=function(t){return new(t||n)(E(kn))},n.\u0275dir=oe({type:n}),n})(),eTe=(()=>{class n extends J1e{constructor(t,i){super(t),this._breakpointObserver=i,this._isHandset=this._breakpointObserver.observe("(max-width: 599.98px) and (orientation: portrait), (max-width: 959.98px) and (orientation: landscape)")}}return n.\u0275fac=function(t){return new(t||n)(E(kn),E(XO))},n.\u0275cmp=Ne({type:n,selectors:[["mat-tooltip-component"]],hostAttrs:["aria-hidden","true"],hostVars:2,hostBindings:function(t,i){2&t&&vf("zoom","visible"===i._visibility?1:null)},features:[ct],decls:3,vars:7,consts:[[1,"mat-tooltip",3,"ngClass"]],template:function(t,i){if(1&t&&(R(0,"div",0),ge("@state.start",function(){return i._animationStart()})("@state.done",function(s){return i._animationDone(s)}),Kt(1,"async"),De(2),k()),2&t){let r;st("mat-tooltip-handset",null==(r=rn(1,5,i._isHandset))?null:r.matches),ie("ngClass",i.tooltipClass)("@state",i._visibility),G(2),xi(i.message)}},directives:[hE],pipes:[Hc],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:[G1e.tooltipState]},changeDetection:0}),n})(),hc=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({providers:[X1e],imports:[[Nie,dn,Yv,On],On,Wv]}),n})();const tTe=["sliderWrapper"],Cl=tm({passive:!1}),oTe={provide:ro,useExisting:T(()=>jk),multi:!0};class aTe{}const lTe=Hf(Uf(jf(class{constructor(n){this._elementRef=n}}),"accent"));let jk=(()=>{class n extends lTe{constructor(t,i,r,s,o,a,l,c){super(t),this._focusMonitor=i,this._changeDetectorRef=r,this._dir=s,this._ngZone=a,this._animationMode=c,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 Le,this.input=new Le,this.valueChange=new Le,this.onTouched=()=>{},this._percent=0,this._isSliding=null,this._isActive=!1,this._tickIntervalPercent=0,this._sliderDimensions=null,this._controlValueAccessorChangeFn=()=>{},this._dirChangeSubscription=Te.EMPTY,this._pointerDown=d=>{this.disabled||this._isSliding||!Zb(d)&&0!==d.button||this._ngZone.run(()=>{this._touchId=Zb(d)?function(n,e){for(let t=0;t{if("pointer"===this._isSliding){const f=mW(d,this._touchId);if(f){d.preventDefault();const p=this.value;this._lastPointerEvent=d,this._updateValueFromPosition(f),p!=this.value&&this._emitInputEvent()}}},this._pointerUp=d=>{"pointer"===this._isSliding&&(!Zb(d)||"number"!=typeof this._touchId||Uk(d.changedTouches,this._touchId))&&(d.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=l,this.tabIndex=parseInt(o)||0,a.runOutsideAngular(()=>{const d=t.nativeElement;d.addEventListener("mousedown",this._pointerDown,Cl),d.addEventListener("touchstart",this._pointerDown,Cl)})}get invert(){return this._invert}set invert(t){this._invert=Mt(t)}get max(){return this._max}set max(t){this._max=To(t,this._max),this._percent=this._calculatePercentage(this._value),this._changeDetectorRef.markForCheck()}get min(){return this._min}set min(t){this._min=To(t,this._min),this._percent=this._calculatePercentage(this._value),this._changeDetectorRef.markForCheck()}get step(){return this._step}set step(t){this._step=To(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=Mt(t)}get tickInterval(){return this._tickInterval}set tickInterval(t){this._tickInterval="auto"===t?"auto":"number"==typeof t||"string"==typeof t?To(t,this._tickInterval):0}get value(){return null===this._value&&(this.value=this._min),this._value}set value(t){if(t!==this._value){let i=To(t,0);this._roundToDecimal&&i!==this.min&&i!==this.max&&(i=parseFloat(i.toFixed(this._roundToDecimal))),this._value=i,this._percent=this._calculatePercentage(this._value),this._changeDetectorRef.markForCheck()}}get vertical(){return this._vertical}set vertical(t){this._vertical=Mt(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 i=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(${i})`}}_getTrackFillStyles(){const t=this.percent,r=this.vertical?`1, ${t}, 1`:`${t}, 1, 1`;return{transform:`translate${this.vertical?"Y":"X"}(${this._shouldInvertMouseCoords()?"":"-"}${this._getThumbGap()}px) scale3d(${r})`,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,a={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 l=this._shouldInvertAxis();let c;c=this.vertical?l?"Bottom":"Top":l?"Right":"Left",a[`padding${c}`]=`${this._getThumbGap()}px`}return a}_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,Cl),t.removeEventListener("touchstart",this._pointerDown,Cl),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||Zs(t)||this._isSliding&&"keyboard"!==this._isSliding)return;const i=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}i!=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 i=this._document,r=Zb(t),o=r?"touchend":"mouseup";i.addEventListener(r?"touchmove":"mousemove",this._pointerMove,Cl),i.addEventListener(o,this._pointerUp,Cl),r&&i.addEventListener("touchcancel",this._pointerUp,Cl);const a=this._getWindow();void 0!==a&&a&&a.addEventListener("blur",this._windowBlur)}_removeGlobalEvents(){const t=this._document;t.removeEventListener("mousemove",this._pointerMove,Cl),t.removeEventListener("mouseup",this._pointerUp,Cl),t.removeEventListener("touchmove",this._pointerMove,Cl),t.removeEventListener("touchend",this._pointerUp,Cl),t.removeEventListener("touchcancel",this._pointerUp,Cl);const i=this._getWindow();void 0!==i&&i&&i.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 o=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()&&(o=1-o),0===o)this.value=this.min;else if(1===o)this.value=this.max;else{const a=this._calculateValue(o),l=Math.round((a-this.min)/this.step)*this.step+this.min;this.value=this._clamp(l,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,s=Math.ceil(30/(t*this.step/(this.max-this.min)))*this.step;this._tickIntervalPercent=s/t}else this._tickIntervalPercent=this.tickInterval*this.step/(this.max-this.min)}_createChangeEvent(t=this.value){let i=new aTe;return i.source=this,i.value=t,i}_calculatePercentage(t){return((t||0)-this.min)/(this.max-this.min)}_calculateValue(t){return this.min+t*(this.max-this.min)}_clamp(t,i=0,r=1){return Math.max(i,Math.min(t,r))}_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 n.\u0275fac=function(t){return new(t||n)(E(rt),E(Sa),E(kn),E(Qo,8),Zr("tabindex"),E(dt),E(ut),E(Do,8))},n.\u0275cmp=Ne({type:n,selectors:[["mat-slider"]],viewQuery:function(t,i){if(1&t&&Jn(tTe,5),2&t){let r;_t(r=yt())&&(i._sliderWrapper=r.first)}},hostAttrs:["role","slider",1,"mat-slider","mat-focus-indicator"],hostVars:29,hostBindings:function(t,i){1&t&&ge("focus",function(){return i._onFocus()})("blur",function(){return i._onBlur()})("keydown",function(s){return i._onKeydown(s)})("keyup",function(){return i._onKeyup()})("mouseenter",function(){return i._onMouseenter()})("selectstart",function(s){return s.preventDefault()}),2&t&&(al("tabIndex",i.tabIndex),nn("aria-disabled",i.disabled)("aria-valuemax",i.max)("aria-valuemin",i.min)("aria-valuenow",i.value)("aria-valuetext",null==i.valueText?i.displayValue:i.valueText)("aria-orientation",i.vertical?"vertical":"horizontal"),st("mat-slider-disabled",i.disabled)("mat-slider-has-ticks",i.tickInterval)("mat-slider-horizontal",!i.vertical)("mat-slider-axis-inverted",i._shouldInvertAxis())("mat-slider-invert-mouse-coords",i._shouldInvertMouseCoords())("mat-slider-sliding",i._isSliding)("mat-slider-thumb-label-showing",i.thumbLabel)("mat-slider-vertical",i.vertical)("mat-slider-min-value",i._isMinValue())("mat-slider-hide-last-tick",i.disabled||i._isMinValue()&&i._getThumbGap()&&i._shouldInvertAxis())("_mat-animation-noopable","NoopAnimations"===i._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:[Dt([oTe]),ct],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,i){1&t&&(R(0,"div",0,1),R(2,"div",2),tt(3,"div",3),tt(4,"div",4),k(),R(5,"div",5),tt(6,"div",6),k(),R(7,"div",7),tt(8,"div",8),tt(9,"div",9),R(10,"div",10),R(11,"span",11),De(12),k(),k(),k(),k()),2&t&&(G(3),ie("ngStyle",i._getTrackBackgroundStyles()),G(1),ie("ngStyle",i._getTrackFillStyles()),G(1),ie("ngStyle",i._getTicksContainerStyles()),G(1),ie("ngStyle",i._getTicksStyles()),G(1),ie("ngStyle",i._getThumbContainerStyles()),G(5),xi(i.displayValue))},directives:[J3],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}),n})();function Zb(n){return"t"===n.type[0]}function mW(n,e){let t;return t=Zb(n)?"number"==typeof e?Uk(n.touches,e)||Uk(n.changedTouches,e):n.touches[0]||n.changedTouches[0]:n,t?{x:t.clientX,y:t.clientY}:void 0}function Uk(n,e){for(let t=0;t{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,On],On]}),n})();function uTe(n,e){}class Hk{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 dTe={dialogContainer:tc("dialogContainer",[wr("void, exit",ti({opacity:0,transform:"scale(0.7)"})),wr("enter",ti({transform:"none"})),Qs("* => enter",Ao("150ms cubic-bezier(0, 0, 0.2, 1)",ti({transform:"none",opacity:1}))),Qs("* => void, * => exit",Ao("75ms cubic-bezier(0.4, 0.0, 0.2, 1)",ti({opacity:0})))])};let hTe=(()=>{class n extends uS{constructor(t,i,r,s,o,a){super(),this._elementRef=t,this._focusTrapFactory=i,this._changeDetectorRef=r,this._config=o,this._focusMonitor=a,this._animationStateChanged=new Le,this._elementFocusedBeforeDialogWasOpened=null,this._closeInteractionType=null,this.attachDomPortal=l=>(this._portalOutlet.hasAttached(),this._portalOutlet.attachDomPortal(l)),this._ariaLabelledBy=o.ariaLabelledBy||null,this._document=s}_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 i=xE(),r=this._elementRef.nativeElement;(!i||i===this._document.body||i===r||r.contains(i))&&(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=xE())}_focusDialogContainer(){this._elementRef.nativeElement.focus&&this._elementRef.nativeElement.focus()}_containsFocus(){const t=this._elementRef.nativeElement,i=xE();return t===i||t.contains(i)}}return n.\u0275fac=function(t){return new(t||n)(E(rt),E(BV),E(kn),E(ut,8),E(Hk),E(Sa))},n.\u0275dir=oe({type:n,viewQuery:function(t,i){if(1&t&&Jn(Kf,7),2&t){let r;_t(r=yt())&&(i._portalOutlet=r.first)}},features:[ct]}),n})(),fTe=(()=>{class n extends hTe{constructor(){super(...arguments),this._state="enter"}_onAnimationDone({toState:t,totalTime:i}){"enter"===t?(this._trapFocus(),this._animationStateChanged.next({state:"opened",totalTime:i})):"exit"===t&&(this._restoreFocus(),this._animationStateChanged.next({state:"closed",totalTime:i}))}_onAnimationStart({toState:t,totalTime:i}){"enter"===t?this._animationStateChanged.next({state:"opening",totalTime:i}):("exit"===t||"void"===t)&&this._animationStateChanged.next({state:"closing",totalTime:i})}_startExitAnimation(){this._state="exit",this._changeDetectorRef.markForCheck()}}return n.\u0275fac=function(){let e;return function(i){return(e||(e=$n(n)))(i||n)}}(),n.\u0275cmp=Ne({type:n,selectors:[["mat-dialog-container"]],hostAttrs:["tabindex","-1","aria-modal","true",1,"mat-dialog-container"],hostVars:6,hostBindings:function(t,i){1&t&&Qy("@dialogContainer.start",function(s){return i._onAnimationStart(s)})("@dialogContainer.done",function(s){return i._onAnimationDone(s)}),2&t&&(al("id",i._id),nn("role",i._config.role)("aria-labelledby",i._config.ariaLabel?null:i._ariaLabelledBy)("aria-label",i._config.ariaLabel)("aria-describedby",i._config.ariaDescribedBy||null),Pg("@dialogContainer",i._state))},features:[ct],decls:1,vars:0,consts:[["cdkPortalOutlet",""]],template:function(t,i){1&t&&mt(0,uTe,0,0,"ng-template",0)},directives:[Kf],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:[dTe.dialogContainer]}}),n})(),pTe=0;class Qm{constructor(e,t,i="mat-dialog-"+pTe++){this._overlayRef=e,this._containerInstance=t,this.id=i,this.disableClose=this._containerInstance._config.disableClose,this._afterOpened=new Se,this._afterClosed=new Se,this._beforeClosed=new Se,this._state=0,t._id=i,t._animationStateChanged.pipe(Fn(r=>"opened"===r.state),yi(1)).subscribe(()=>{this._afterOpened.next(),this._afterOpened.complete()}),t._animationStateChanged.pipe(Fn(r=>"closed"===r.state),yi(1)).subscribe(()=>{clearTimeout(this._closeFallbackTimeout),this._finishDialogClose()}),e.detachments().subscribe(()=>{this._beforeClosed.next(this._result),this._beforeClosed.complete(),this._afterClosed.next(this._result),this._afterClosed.complete(),this.componentInstance=null,this._overlayRef.dispose()}),e.keydownEvents().pipe(Fn(r=>27===r.keyCode&&!this.disableClose&&!Zs(r))).subscribe(r=>{r.preventDefault(),$k(this,"keyboard")}),e.backdropClick().subscribe(()=>{this.disableClose?this._containerInstance._recaptureFocus():$k(this,"mouse")})}close(e){this._result=e,this._containerInstance._animationStateChanged.pipe(Fn(t=>"closing"===t.state),yi(1)).subscribe(t=>{this._beforeClosed.next(e),this._beforeClosed.complete(),this._overlayRef.detachBackdrop(),this._closeFallbackTimeout=setTimeout(()=>this._finishDialogClose(),t.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(e){let 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}updateSize(e="",t=""){return this._overlayRef.updateSize({width:e,height:t}),this._overlayRef.updatePosition(),this}addPanelClass(e){return this._overlayRef.addPanelClass(e),this}removePanelClass(e){return this._overlayRef.removePanelClass(e),this}getState(){return this._state}_finishDialogClose(){this._state=2,this._overlayRef.dispose()}_getPositionStrategy(){return this._overlayRef.getConfig().positionStrategy}}function $k(n,e,t){return void 0!==n._containerInstance&&(n._containerInstance._closeInteractionType=e),n.close(t)}const Gk=new ve("MatDialogData"),gTe=new ve("mat-dialog-default-options"),yW=new ve("mat-dialog-scroll-strategy"),_Te={provide:yW,deps:[Jo],useFactory:function(n){return()=>n.scrollStrategies.block()}};let yTe=(()=>{class n{constructor(t,i,r,s,o,a,l,c,d){this._overlay=t,this._injector=i,this._defaultOptions=r,this._parentDialog=s,this._overlayContainer=o,this._dialogRefConstructor=l,this._dialogContainerType=c,this._dialogDataToken=d,this._openDialogsAtThisLevel=[],this._afterAllClosedAtThisLevel=new Se,this._afterOpenedAtThisLevel=new Se,this._ariaHiddenElements=new Map,this.afterAllClosed=Yb(()=>this.openDialogs.length?this._getAfterAllClosed():this._getAfterAllClosed().pipe(Rr(void 0))),this._scrollStrategy=a}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,i){(i=function(n,e){return Object.assign(Object.assign({},e),n)}(i,this._defaultOptions||new Hk)).id&&this.getDialogById(i.id);const r=this._createOverlay(i),s=this._attachDialogContainer(r,i),o=this._attachDialogContent(t,s,r,i);return this.openDialogs.length||this._hideNonDialogContentFromAssistiveTechnology(),this.openDialogs.push(o),o.afterClosed().subscribe(()=>this._removeOpenDialog(o)),this.afterOpened.next(o),s._initializeWithAttachedContent(),o}closeAll(){this._closeDialogs(this.openDialogs)}getDialogById(t){return this.openDialogs.find(i=>i.id===t)}ngOnDestroy(){this._closeDialogs(this._openDialogsAtThisLevel),this._afterAllClosedAtThisLevel.complete(),this._afterOpenedAtThisLevel.complete()}_createOverlay(t){const i=this._getOverlayConfig(t);return this._overlay.create(i)}_getOverlayConfig(t){const i=new qv({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&&(i.backdropClass=t.backdropClass),i}_attachDialogContainer(t,i){const s=Nt.create({parent:i&&i.viewContainerRef&&i.viewContainerRef.injector||this._injector,providers:[{provide:Hk,useValue:i}]}),o=new dm(this._dialogContainerType,i.viewContainerRef,s,i.componentFactoryResolver);return t.attach(o).instance}_attachDialogContent(t,i,r,s){const o=new this._dialogRefConstructor(r,i,s.id);if(t instanceof Ys)i.attachTemplatePortal(new Xf(t,null,{$implicit:s.data,dialogRef:o}));else{const a=this._createInjector(s,o,i),l=i.attachComponentPortal(new dm(t,s.viewContainerRef,a));o.componentInstance=l.instance}return o.updateSize(s.width,s.height).updatePosition(s.position),o}_createInjector(t,i,r){const s=t&&t.viewContainerRef&&t.viewContainerRef.injector,o=[{provide:this._dialogContainerType,useValue:r},{provide:this._dialogDataToken,useValue:t.data},{provide:this._dialogRefConstructor,useValue:i}];return t.direction&&(!s||!s.get(Qo,null,At.Optional))&&o.push({provide:Qo,useValue:{value:t.direction,change:ht()}}),Nt.create({parent:s||this._injector,providers:o})}_removeOpenDialog(t){const i=this.openDialogs.indexOf(t);i>-1&&(this.openDialogs.splice(i,1),this.openDialogs.length||(this._ariaHiddenElements.forEach((r,s)=>{r?s.setAttribute("aria-hidden",r):s.removeAttribute("aria-hidden")}),this._ariaHiddenElements.clear(),this._getAfterAllClosed().next()))}_hideNonDialogContentFromAssistiveTechnology(){const t=this._overlayContainer.getContainerElement();if(t.parentElement){const i=t.parentElement.children;for(let r=i.length-1;r>-1;r--){let s=i[r];s!==t&&"SCRIPT"!==s.nodeName&&"STYLE"!==s.nodeName&&!s.hasAttribute("aria-live")&&(this._ariaHiddenElements.set(s,s.getAttribute("aria-hidden")),s.setAttribute("aria-hidden","true"))}}}_closeDialogs(t){let i=t.length;for(;i--;)t[i].close()}}return n.\u0275fac=function(t){return new(t||n)(E(Jo),E(Nt),E(void 0),E(void 0),E(hm),E(void 0),E(Du),E(Du),E(ve))},n.\u0275dir=oe({type:n}),n})(),_p=(()=>{class n extends yTe{constructor(t,i,r,s,o,a,l){super(t,i,s,a,l,o,Qm,fTe,Gk)}}return n.\u0275fac=function(t){return new(t||n)(I(Jo),I(Nt),I(Xg,8),I(gTe,8),I(yW),I(n,12),I(hm))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})(),bTe=0,Wk=(()=>{class n{constructor(t,i,r){this._dialogRef=t,this._elementRef=i,this._dialog=r,this.id="mat-dialog-title-"+bTe++}ngOnInit(){this._dialogRef||(this._dialogRef=function(n,e){let t=n.nativeElement.parentElement;for(;t&&!t.classList.contains("mat-dialog-container");)t=t.parentElement;return t?e.find(i=>i.id===t.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 n.\u0275fac=function(t){return new(t||n)(E(Qm,8),E(rt),E(_p))},n.\u0275dir=oe({type:n,selectors:[["","mat-dialog-title",""],["","matDialogTitle",""]],hostAttrs:[1,"mat-dialog-title"],hostVars:1,hostBindings:function(t,i){2&t&&al("id",i.id)},inputs:{id:"id"},exportAs:["matDialogTitle"]}),n})(),qk=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275dir=oe({type:n,selectors:[["","mat-dialog-content",""],["mat-dialog-content"],["","matDialogContent",""]],hostAttrs:[1,"mat-dialog-content"]}),n})();let Qb=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({providers:[_p,_Te],imports:[[Yv,dS,On],On]}),n})();const Yk=new ve("CdkAccordion");let ETe=0,MTe=(()=>{class n{constructor(t,i,r){this.accordion=t,this._changeDetectorRef=i,this._expansionDispatcher=r,this._openCloseAllSubscription=Te.EMPTY,this.closed=new Le,this.opened=new Le,this.destroyed=new Le,this.expandedChange=new Le,this.id="cdk-accordion-child-"+ETe++,this._expanded=!1,this._disabled=!1,this._removeUniqueSelectionListener=()=>{},this._removeUniqueSelectionListener=r.listen((s,o)=>{this.accordion&&!this.accordion.multi&&this.accordion.id===o&&this.id!==s&&(this.expanded=!1)}),this.accordion&&(this._openCloseAllSubscription=this._subscribeToOpenCloseAllActions())}get expanded(){return this._expanded}set expanded(t){t=Mt(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=Mt(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 n.\u0275fac=function(t){return new(t||n)(E(Yk,12),E(kn),E(cS))},n.\u0275dir=oe({type:n,selectors:[["cdk-accordion-item"],["","cdkAccordionItem",""]],inputs:{expanded:"expanded",disabled:"disabled"},outputs:{closed:"closed",opened:"opened",destroyed:"destroyed",expandedChange:"expandedChange"},exportAs:["cdkAccordionItem"],features:[Dt([{provide:Yk,useValue:void 0}])]}),n})(),xTe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({}),n})();const TTe=["body"];function ATe(n,e){}const DTe=[[["mat-expansion-panel-header"]],"*",[["mat-action-row"]]],OTe=["mat-expansion-panel-header","*","mat-action-row"];function ITe(n,e){1&n&&tt(0,"span",2),2&n&&ie("@indicatorRotate",Qe()._getExpandedState())}const PTe=[[["mat-panel-title"]],[["mat-panel-description"]],"*"],RTe=["mat-panel-title","mat-panel-description","*"],Xk=new ve("MAT_ACCORDION"),bW="225ms cubic-bezier(0.4,0.0,0.2,1)",CW={indicatorRotate:tc("indicatorRotate",[wr("collapsed, void",ti({transform:"rotate(0deg)"})),wr("expanded",ti({transform:"rotate(180deg)"})),Qs("expanded <=> collapsed, void => collapsed",Ao(bW))]),bodyExpansion:tc("bodyExpansion",[wr("collapsed, void",ti({height:"0px",visibility:"hidden"})),wr("expanded",ti({height:"*",visibility:"visible"})),Qs("expanded <=> collapsed, void => collapsed",Ao(bW))])};let kTe=(()=>{class n{constructor(t){this._template=t}}return n.\u0275fac=function(t){return new(t||n)(E(Ys))},n.\u0275dir=oe({type:n,selectors:[["ng-template","matExpansionPanelContent",""]]}),n})(),FTe=0;const wW=new ve("MAT_EXPANSION_PANEL_DEFAULT_OPTIONS");let qM=(()=>{class n extends MTe{constructor(t,i,r,s,o,a,l){super(t,i,r),this._viewContainerRef=s,this._animationMode=a,this._hideToggle=!1,this.afterExpand=new Le,this.afterCollapse=new Le,this._inputChanges=new Se,this._headerId="mat-expansion-panel-header-"+FTe++,this._bodyAnimationDone=new Se,this.accordion=t,this._document=o,this._bodyAnimationDone.pipe(Zo((c,d)=>c.fromState===d.fromState&&c.toState===d.toState)).subscribe(c=>{"void"!==c.fromState&&("expanded"===c.toState?this.afterExpand.emit():"collapsed"===c.toState&&this.afterCollapse.emit())}),l&&(this.hideToggle=l.hideToggle)}get hideToggle(){return this._hideToggle||this.accordion&&this.accordion.hideToggle}set hideToggle(t){this._hideToggle=Mt(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(Rr(null),Fn(()=>this.expanded&&!this._portal),yi(1)).subscribe(()=>{this._portal=new Xf(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,i=this._body.nativeElement;return t===i||i.contains(t)}return!1}}return n.\u0275fac=function(t){return new(t||n)(E(Xk,12),E(kn),E(cS),E(ns),E(ut),E(Do,8),E(wW,8))},n.\u0275cmp=Ne({type:n,selectors:[["mat-expansion-panel"]],contentQueries:function(t,i,r){if(1&t&&ei(r,kTe,5),2&t){let s;_t(s=yt())&&(i._lazyContent=s.first)}},viewQuery:function(t,i){if(1&t&&Jn(TTe,5),2&t){let r;_t(r=yt())&&(i._body=r.first)}},hostAttrs:[1,"mat-expansion-panel"],hostVars:6,hostBindings:function(t,i){2&t&&st("mat-expanded",i.expanded)("_mat-animation-noopable","NoopAnimations"===i._animationMode)("mat-expansion-panel-spacing",i._hasSpacing())},inputs:{disabled:"disabled",expanded:"expanded",hideToggle:"hideToggle",togglePosition:"togglePosition"},outputs:{opened:"opened",closed:"closed",expandedChange:"expandedChange",afterExpand:"afterExpand",afterCollapse:"afterCollapse"},exportAs:["matExpansionPanel"],features:[Dt([{provide:Xk,useValue:void 0}]),ct,zn],ngContentSelectors:OTe,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,i){1&t&&(wi(DTe),Ht(0),R(1,"div",0,1),ge("@bodyExpansion.done",function(s){return i._bodyAnimationDone.next(s)}),R(3,"div",2),Ht(4,1),mt(5,ATe,0,0,"ng-template",3),k(),Ht(6,2),k()),2&t&&(G(1),ie("@bodyExpansion",i._getExpandedState())("id",i.id),nn("aria-labelledby",i._headerId),G(4),ie("cdkPortalOutlet",i._portal))},directives:[Kf],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:[CW.bodyExpansion]},changeDetection:0}),n})();class LTe{}const BTe=Hf(LTe);let YM=(()=>{class n extends BTe{constructor(t,i,r,s,o,a,l){super(),this.panel=t,this._element=i,this._focusMonitor=r,this._changeDetectorRef=s,this._animationMode=a,this._parentChangeSubscription=Te.EMPTY;const c=t.accordion?t.accordion._stateChanges.pipe(Fn(d=>!(!d.hideToggle&&!d.togglePosition))):ec;this.tabIndex=parseInt(l||"")||0,this._parentChangeSubscription=Ni(t.opened,t.closed,c,t._inputChanges.pipe(Fn(d=>!!(d.hideToggle||d.disabled||d.togglePosition)))).subscribe(()=>this._changeDetectorRef.markForCheck()),t.closed.pipe(Fn(()=>t._containsFocus())).subscribe(()=>r.focusVia(i,"program")),o&&(this.expandedHeight=o.expandedHeight,this.collapsedHeight=o.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:Zs(t)||(t.preventDefault(),this._toggle());break;default:return void(this.panel.accordion&&this.panel.accordion._handleHeaderKeydown(t))}}focus(t,i){t?this._focusMonitor.focusVia(this._element,t,i):this._element.nativeElement.focus(i)}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 n.\u0275fac=function(t){return new(t||n)(E(qM,1),E(rt),E(Sa),E(kn),E(wW,8),E(Do,8),Zr("tabindex"))},n.\u0275cmp=Ne({type:n,selectors:[["mat-expansion-panel-header"]],hostAttrs:["role","button",1,"mat-expansion-panel-header","mat-focus-indicator"],hostVars:15,hostBindings:function(t,i){1&t&&ge("click",function(){return i._toggle()})("keydown",function(s){return i._keydown(s)}),2&t&&(nn("id",i.panel._headerId)("tabindex",i.tabIndex)("aria-controls",i._getPanelId())("aria-expanded",i._isExpanded())("aria-disabled",i.panel.disabled),vf("height",i._getHeaderHeight()),st("mat-expanded",i._isExpanded())("mat-expansion-toggle-indicator-after","after"===i._getTogglePosition())("mat-expansion-toggle-indicator-before","before"===i._getTogglePosition())("_mat-animation-noopable","NoopAnimations"===i._animationMode))},inputs:{tabIndex:"tabIndex",expandedHeight:"expandedHeight",collapsedHeight:"collapsedHeight"},features:[ct],ngContentSelectors:RTe,decls:5,vars:1,consts:[[1,"mat-content"],["class","mat-expansion-indicator",4,"ngIf"],[1,"mat-expansion-indicator"]],template:function(t,i){1&t&&(wi(PTe),R(0,"span",0),Ht(1),Ht(2,1),Ht(3,2),k(),mt(4,ITe,1,1,"span",1)),2&t&&(G(4),ie("ngIf",i._showToggle()))},directives:[zr],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:[CW.indicatorRotate]},changeDetection:0}),n})(),EW=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275dir=oe({type:n,selectors:[["mat-panel-title"]],hostAttrs:[1,"mat-expansion-panel-header-title"]}),n})(),Kk=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,On,xTe,dS]]}),n})();var SW=ze(478);Object.create(Error.prototype);const UTe=["*"];var KM=(()=>(function(n){n.LineHighlight="line-highlight",n.LineNumbers="line-numbers"}(KM||(KM={})),KM))();class $Te{}const xW=new ve("SECURITY_CONTEXT");let Zk=(()=>{class n{constructor(t,i,r,s,o){this.platform=t,this.securityContext=i,this.http=r,this.sanitizer=o,this.initialMarkedOptions={renderer:new SW.Renderer},this.options=s}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,i=!1,r=!1,s=this.options){const o=this.trimIndentation(t),a=i?this.decodeHtml(o):o,l=r?this.renderEmoji(a):a,c=SW.parse(l,s);return this.sanitizer.sanitize(this.securityContext,c)||""}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(Ae(i=>this.handleExtension(t,i)))}highlight(t){if(Of(this.platform)&&"undefined"!=typeof Prism){t||(t=document);const i=t.querySelectorAll('pre code:not([class*="language-"])');Array.prototype.forEach.call(i,r=>r.classList.add("language-none")),Prism.highlightAllUnder(t)}}renderKatex(t,i){if(!Of(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,(r,s)=>katex.renderToString(s,i))}decodeHtml(t){if(!Of(this.platform))return t;const i=document.createElement("textarea");return i.innerHTML=t,i.value}handleExtension(t,i){const r=t?t.split("?")[0].split(".").splice(-1).join():"";return"md"!==r?"```"+r+"\n"+i+"\n```":i}renderEmoji(t){if(!Of(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 i;return t.split("\n").map(r=>{let s=i;return r.length>0&&(s=isNaN(s)?r.search(/\S|$/):Math.min(r.search(/\S|$/),s)),isNaN(i)&&(i=s),s?r.substring(s):r}).join("\n")}}return n.\u0275fac=function(t){return new(t||n)(I(dl),I(xW),I(Wf,8),I($Te,8),I(th))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})(),TW=(()=>{class n{constructor(t,i){this.element=t,this.markdownService=i,this.error=new Le,this.load=new Le,this.ready=new Le,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,i=!1){let r=this.markdownService.compile(t,i,this.emoji);r=this.katex?this.markdownService.renderKatex(r,this.katexOptions):r,this.element.nativeElement.innerHTML=r,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,KM.LineNumbers),this.setPluginOptions(this.element.nativeElement,{dataStart:this.start}))}setPluginClass(t,i){const r=t.querySelectorAll("pre");for(let s=0;s{const a=i[o];if(a){const l=this.toLispCase(o);r.item(s).setAttribute(l,a.toString())}})}toLispCase(t){const i=t.match(/([A-Z])/g);if(!i)return t;let r=t.toString();for(let s=0,o=i.length;s{class n{static forRoot(t){return{ngModule:n,providers:[Zk,t&&t.loader||[],t&&t.markedOptions||[],{provide:xW,useValue:t&&null!=t.sanitize?t.sanitize:mn.HTML}]}}static forChild(){return{ngModule:n}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({}),n})();function AW(n,e,t){return t?AW(n,e).pipe(Ae(i=>we(i)?t(...i):t(i))):new ce(i=>{const r=(...o)=>i.next(1===o.length?o[0]:o);let s;try{s=n(r)}catch(o){return void i.error(o)}if(Ke(e))return()=>e(r,s)})}function ZM(...n){return e=>{let t;return"function"==typeof n[n.length-1]&&(t=n.pop()),e.lift(new ZTe(n,t))}}class ZTe{constructor(e,t){this.observables=e,this.project=t}call(e,t){return t.subscribe(new QTe(e,this.observables,this.project))}}class QTe extends cU{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)}}class JTe{constructor(e,t,i=!1){this.accumulator=e,this.seed=t,this.hasSeed=i}call(e,t){return t.subscribe(new eAe(e,this.accumulator,this.seed,this.hasSeed))}}class eAe extends xt{constructor(e,t,i,r){super(e),this.accumulator=t,this._seed=i,this.hasSeed=r,this.index=0}get seed(){return this._seed}set seed(e){this.hasSeed=!0,this._seed=e}_next(e){if(this.hasSeed)return this._tryNext(e);this.seed=e,this.destination.next(e)}_tryNext(e){const t=this.index++;let i;try{i=this.accumulator(this.seed,e,t)}catch(r){this.destination.error(r)}this.seed=i,this.destination.next(i)}}class iAe{constructor(e){this.predicate=e}call(e,t){return t.subscribe(new rAe(e,this.predicate))}}class rAe extends xt{constructor(e,t){super(e),this.predicate=t,this.skipping=!0,this.index=0}_next(e){const t=this.destination;this.skipping&&this.tryCallPredicate(e),this.skipping||t.next(e)}tryCallPredicate(e){try{const t=this.predicate(e,this.index++);this.skipping=Boolean(t)}catch(t){this.destination.error(t)}}}const sAe=["youtubeContainer"];let IW=(()=>{class n{constructor(t,i){this._ngZone=t,this._youtubeContainer=new Se,this._destroyed=new Se,this._playerChanges=new ar(void 0),this._videoId=new ar(void 0),this._height=new ar(390),this._width=new ar(640),this._startSeconds=new ar(void 0),this._endSeconds=new ar(void 0),this._suggestedQuality=new ar(void 0),this._playerVars=new ar(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=Of(i)}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=ht(!0);if(!window.YT||!window.YT.Player){const r=new Se;this._existingApiReadyCallback=window.onYouTubeIframeAPIReady,window.onYouTubeIframeAPIReady=()=>{this._existingApiReadyCallback&&this._existingApiReadyCallback(),this._ngZone.run(()=>r.next(!0))},t=r.pipe(yi(1),Rr(!1))}const i=function(n,e,t,i,r,s,o){const a=Qi([e,s]).pipe(ZM(Qi([i,r])),Ae(([l,c])=>{const[d,f]=l,[p,g]=c;return d?{videoId:d,playerVars:f,width:p,height:g}:void 0}));return Qi([n,a,ht(o)]).pipe(function(n){return Mr(function(...n){let e=null;return"function"==typeof n[n.length-1]&&(e=n.pop()),1===n.length&&we(n[0])&&(n=n[0].slice()),t=>t.lift.call(ui([t,...n]),new hU(e))}(n),function(n){return e=>e.lift(new iAe(n))}(([e,t])=>!t),Ae(([e])=>e))}(t),function(n,e){let t=!1;return arguments.length>=2&&(t=!0),function(r){return r.lift(new JTe(n,e,t))}}(dAe,void 0),Zo())}(this._youtubeContainer,this._videoId,t,this._width,this._height,this._playerVars,this._ngZone).pipe(Ti(r=>{this._playerChanges.next(r)}),di(e=>e?PW(e)?ht(e):new ce(t=>{let i=!1,r=!1;const s=o=>{r=!0,i||(o.target.removeEventListener("onReady",s),t.next(o.target))};return e.addEventListener("onReady",s),()=>{i=!0,r||(r=>{PW(r)||r.destroy()})(e)}}).pipe(yi(1),Rr(void 0)):ht(void 0)),Tn(this._destroyed),mc(new Se));i.subscribe(r=>{this._player=r,r&&this._pendingPlayerState&&this._initializePlayer(r,this._pendingPlayerState),this._pendingPlayerState=void 0}),function(n,e,t){Qi([n,e,t]).subscribe(([i,r,s])=>i&&i.setSize(r,s))}(i,this._width,this._height),function(n,e){Qi([n,e]).subscribe(([t,i])=>t&&i&&t.setPlaybackQuality(i))}(i,this._suggestedQuality),function(n,e,t,i,r,s){const o=Qi([t,i]).pipe(Ae(([d,f])=>({startSeconds:d,endSeconds:f}))),a=o.pipe(Jk(n,d=>!!d&&!function(n){const e=n.getPlayerState();return e!==YT.PlayerState.UNSTARTED&&e!==YT.PlayerState.CUED}(d))),l=e.pipe(Jk(n,(d,f)=>!!d&&d.videoId!==f));Ni(n.pipe(Jk(Qi([e,o]),([d,f],p)=>!(!p||d==p.videoId&&!f.startSeconds&&!f.endSeconds))),l,a).pipe(ZM(Qi([n,e,o,r])),Ae(([d,f])=>f),Tn(s)).subscribe(([d,f,p,g])=>{!f||!d||(d.videoId=f,d.cueVideoById(Object.assign({videoId:f,suggestedQuality:g},p)))})}(i,this._videoId,this._startSeconds,this._endSeconds,this._suggestedQuality,this._destroyed),i.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,i){this._player?this._player.seekTo(t,i):this._getPendingState().seek={seconds:t,allowSeekAhead:i}}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,i){const{playbackState:r,playbackRate:s,volume:o,muted:a,seek:l}=i;switch(r){case YT.PlayerState.PLAYING:t.playVideo();break;case YT.PlayerState.PAUSED:t.pauseVideo();break;case YT.PlayerState.CUED:t.stopVideo()}null!=s&&t.setPlaybackRate(s),null!=o&&t.setVolume(o),null!=a&&(a?t.mute():t.unMute()),null!=l&&t.seekTo(l.seconds,l.allowSeekAhead)}_getLazyEmitter(t){return this._playerChanges.pipe(Pr(i=>i?AW(r=>{i.addEventListener(t,r)},r=>{try{i.removeEventListener&&i.removeEventListener(t,r)}catch(s){}}):ht()),i=>new ce(r=>i.subscribe({next:s=>this._ngZone.run(()=>r.next(s)),error:s=>r.error(s),complete:()=>r.complete()})),Tn(this._destroyed))}}return n.\u0275fac=function(t){return new(t||n)(E(dt),E(dl))},n.\u0275cmp=Ne({type:n,selectors:[["youtube-player"]],viewQuery:function(t,i){if(1&t&&Jn(sAe,5),2&t){let r;_t(r=yt())&&(i.youtubeContainer=r.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,i){1&t&&tt(0,"div",null,0)},encapsulation:2,changeDetection:0}),n})();function dAe(n,[e,t,i]){if(n&&t&&n.playerVars!==t.playerVars)n.destroy();else{if(!t)return void(n&&n.destroy());if(n)return n}const r=i.runOutsideAngular(()=>new YT.Player(e,t));return r.videoId=t.videoId,r.playerVars=t.playerVars,r}function PW(n){return"getPlayerStatus"in n}function Jk(n,e){return Mr(ZM(n),Fn(([t,i])=>e(i,t)),Ae(([t])=>t))}let pAe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({}),n})(),CAe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275dir=oe({type:n,selectors:[["","mat-card-sm-image",""],["","matCardImageSmall",""]],hostAttrs:[1,"mat-card-sm-image"]}),n})();function e0(n){return!0===n}function so(n){return null==n}function ka(n){return!so(n)}function eF(n){return Boolean(n)}function NW(n){return so(n)?n:JSON.parse(JSON.stringify(n))}const JM=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])&&JM(n[o])}),n};function LW(n){return ka(n)&&"object"==typeof n&&function(n){return"[object Object]"===Object.prototype.toString.call(n)}(n)}const zW="NGXS_DATA_META",nF="NGXS_META",jW="NGXS_ARGUMENT_REGISTRY_META";let UW=(()=>{class n{constructor(t){this.sequence$=new ar(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)(I(cu,8))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();function t0(n){return n[zW]}let Fa=(()=>{class n{constructor(t,i,r){n.store=t.get(cu),n.ngZone=t.get(dt),n.factory=i,n.context=r,n.computed=t.get(UW)}}return n.store=null,n.computed=null,n.context=null,n.factory=null,n.ngZone=null,n.\u0275fac=function(t){return new(t||n)(I(Nt),I(B$),I(L$))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();class Fr{constructor(){Fr.statesCachedMeta.clear()}static createStateContext(e){return Fa.context.createStateContext(e)}static ensureMappedState(e){if(so(Fa.factory)||so(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)?Fr.statesCachedMeta.get(e.name):null)||Fr.ensureMeta(e)}static getRepositoryByInstance(e){var t;const r=null!==(t=t0(Fr.getStateClassByInstance(e)))&&void 0!==t?t:null;if(so(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=Fr.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=Fr.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=Fa.factory.states)||void 0===t?void 0:t.find(r=>r.name===e.name):null;return ka(i)&&ka(e.name)&&Fr.statesCachedMeta.set(e.name,i),i}}Fr.statesCachedMeta=new Map,Fr.\u0275fac=function(e){return new(e||Fr)},Fr.\u0275prov=ue({token:Fr,factory:Fr.\u0275fac}),new If(1);class $Ae 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 HW(n){var e;return null!==(e=n.NGXS_OPTIONS_META)&&void 0!==e?e:{name:""}}function $W(n){var e;const t=HW(n),i=null!==(e=t.children)&&void 0!==e?e:[],s=NW(void 0===t.defaults?{}:t.defaults);if(i.length){if(LW(s))return function(n,e){return e.reduce((t,i)=>{const r=HW(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()]=$W(i),t},null!=n?n:{})}(s,i);throw new $Ae(s)}return s}function WW(n){var e;return null!==(e=n.__NGXS_COMPUTED_OPTION__)&&void 0!==e?e:null}function qW(){var n,e;return null!==(e=null===(n=null==Fa?void 0:Fa.computed)||void 0===n?void 0:n.sequenceValue)&&void 0!==e?e:0}function YAe(n){let e=!1;return cm(n)&&(e=!0),e}function iF(n){return n[jW]}class XAe extends Error{constructor(e,t){super(`An argument with the name '${e}' already exists in the method '${t}'`)}}class KAe{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(eF(this.argumentMap.has(e))||eF(this.payloadMap.has(e)))throw new XAe(e,t)}}function rF(n){return Mo()?JM(n):n}function tDe(n){return{enumerable:!0,configurable:!0,get(){const e=t0(n),t=Fr.ensureMappedState(e.stateMeta);return Fr.createStateContext(t)}}}function sF(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:()=>Mo()?JM(n.getState()):n.getState(),setState(e){n.setState(e)},patchState(e){n.patchState(e)}})}function oi(){return(n,e,t)=>{!function(n,e){if(!function(n,e){var t;let i=n,r=!1;if(LW(i))for(;null!==i;){if(e0(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 so(WW(n))&&Object.defineProperties(n,{__NGXS_COMPUTED_OPTION__:{enumerable:!0,configurable:!0,value:new WeakMap}}),WW(n)}(this),o=null==s?void 0:s.get(i);if(e0(null==o?void 0:o.isObservable))return null==o?void 0:o.value;if(so(o)||o.sequenceId!==qW()){s.delete(i);const l=i.apply(this,r);return s.set(i,{value:l,sequenceId:qW(),isObservable:YAe(l)}),l}return o.value},t}}const oDe={cancelUncompleted:!0,insideZone:!1};function on(n=oDe){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=Fr.getRepositoryByInstance(a),d=c.operations;let f=d[s];const p=c.stateMeta,g=iF(r);if(so(f)){const w=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),x=function(n){const{statePath:e,argumentsNames:t,methodName:i,argumentRegistry:r}=n;let s="";for(let o=0;o{var w;return e0(n.insideZone)?null===(w=Fa.ngZone)||void 0===w||w.run(()=>{l=r.apply(a,o)}):l=r.apply(a,o),cm(l)?ht(null).pipe(Ae(()=>l)):l};const v=Fr.createAction(f,o,g),C=Fa.store.dispatch(v);return cm(l)?function(n,e){return Hv([n,e]).pipe(Ae(t=>t.pop()))}(C,l):l},i}}function Ms(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 so(iF(t))&&Object.defineProperties(t,{[jW]:{enumerable:!0,configurable:!0,value:new KAe}}),iF(t)})(e,t).createPayloadType(r,t,i)}}function xh(){return n=>{const e=function(n){if(function(n){return!eF(n)}(n.hasOwnProperty(nF))){const e={name:null,actions:{},defaults:{},path:null,makeRootSelector:t=>t.getStateGetter(e.name),children:[]};Object.defineProperty(n,nF,{value:e})}return function(n){var e;return null===(e=n)||void 0===e?void 0:e[nF]}(n)}(n);if(so(e.name))throw new Error("@StateRepository should be add before decorator @State");!function(n,e){(function(n){var e;const t=null!==(e=t0(n))&&void 0!==e?e:null;return(so(t)||(null==t?void 0:t.stateClass)!==n)&&function(n){Object.defineProperty(n,zW,{writable:!0,configurable:!0,enumerable:!0,value:{stateMeta:null,operations:{},stateClass:n}})}(n),t0(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:()=>NW(t)},context:tDe(n)})}(n,e,$W(n)),function(n){var e,t;const i=t0(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(so(Fa.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]=Fa.store.select(n).pipe(Ae(o=>Mo()?JM(o):o),qc({refCount:!0,bufferSize:1})),this[s]}}})}}(n)}}var tx=(()=>(function(n){n.ID="id"}(tx||(tx={})),tx))(),n0=(()=>(function(n){n.ASC="asc",n.DESC="desc"}(n0||(n0={})),n0))();let oF=(()=>{class n{constructor(){this.browserStorageEvents$=new Se,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=ue({token:n,factory:n.\u0275fac}),n})(),cDe=(()=>{class n extends oF{get snapshot(){return rF(this.getState())}get ctx(){return sF(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=$n(n)))(i||n)}}(),n.\u0275prov=ue({token:n,factory:n.\u0275fac}),xe([oi(),Xe("design:type",Object),Xe("design:paramtypes",[])],n.prototype,"snapshot",null),xe([on(),ws(0,Ms("patchValue")),Xe("design:type",Function),Xe("design:paramtypes",[Object]),Xe("design:returntype",void 0)],n.prototype,"patchState",null),xe([on(),ws(0,Ms("stateValue")),Xe("design:type",Function),Xe("design:paramtypes",[Object]),Xe("design:returntype",void 0)],n.prototype,"setState",null),xe([on(),Xe("design:type",Function),Xe("design:paramtypes",[]),Xe("design:returntype",void 0)],n.prototype,"reset",null),n})(),uDe=(()=>{class n extends oF{constructor(){super(...arguments),this.primaryKey=tx.ID,this.comparator=null}get snapshot(){return rF(this.getState())}get ids(){return this.snapshot.ids}get entities(){return this.snapshot.entities}get entitiesArray(){const t=this.snapshot;return t.ids.map(i=>t.entities[i])}get ids$(){return this.state$.pipe(Ae(t=>t.ids))}get entities$(){return this.state$.pipe(Ae(t=>t.entities))}get entitiesArray$(){return this.state$.pipe(Ae(t=>t.ids.map(i=>t.entities[i])))}get ctx(){return sF(this.context)}setComparator(t){return this.comparator=t,this}dispatch(t){return this.ctx.dispatch(t)}getState(){return this.ctx.getState()}selectId(t){var i;return null===(i=t)||void 0===i?void 0:i[this.primaryKey]}selectOne(t){var i;return null!==(i=this.snapshot.entities[t])&&void 0!==i?i:null}selectAll(){const t=this.getState();return t.ids.map(i=>t.entities[i])}reset(){this.setEntitiesState(this.initialState),this.markAsDirtyAfterReset()}addOne(t){this.addEntityOne(t)}addMany(t){this.addEntitiesMany(t)}setOne(t){this.setEntityOne(t)}setMany(t){this.setEntitiesMany(t)}setAll(t){this.setEntitiesAll(t)}updateOne(t){this.updateEntitiesMany([t])}updateMany(t){this.updateEntitiesMany(t)}upsertOne(t){this.upsertEntitiesMany([t])}upsertMany(t){this.upsertEntitiesMany(t)}removeOne(t){this.removeEntitiesMany([t])}removeMany(t){this.removeEntitiesMany(t)}removeByEntity(t){const i=this.selectId(t);this.removeEntitiesMany([i])}removeByEntities(t){const i=[];for(const r of t){const s=this.selectId(r);i.push(s)}this.removeEntitiesMany(i)}removeAll(){this.setEntitiesState(this.initialState)}sort(t){this.comparator=null!=t?t:this.comparator,so(this.comparator)?console.warn("You must set the compare function before sorting."):this.setEntitiesState(this.getState())}addEntityOne(t){const i=this.getState(),r=this.selectIdValue(t);r in i.entities||this.setEntitiesState(Object.assign(Object.assign({},i),{ids:[...i.ids,r],entities:Object.assign(Object.assign({},i.entities),{[r]:t})}))}addEntitiesMany(t){const i=this.getState(),r={},s=[];for(const o of t){const a=this.selectIdValue(o);a in i.entities||a in r||(s.push(a),r[a]=o)}s.length&&this.setEntitiesState(Object.assign(Object.assign({},i),{ids:[...i.ids,...s],entities:Object.assign(Object.assign({},i.entities),r)}))}setEntitiesAll(t){const i=this.getState(),r={},s=[];for(const o of t){const a=this.selectIdValue(o);a in r||(s.push(a),r[a]=o)}this.setEntitiesState(Object.assign(Object.assign({},i),{ids:s,entities:r}))}setEntityOne(t){const i=this.getState(),r=this.selectIdValue(t);this.setEntitiesState(Object.assign(Object.assign({},i),r in i.entities?{entities:Object.assign(Object.assign({},i.entities),{[r]:t})}:{ids:[...i.ids,r],entities:Object.assign(Object.assign({},i.entities),{[r]:t})}))}setEntitiesMany(t){for(const i of t)this.setEntityOne(i)}updateEntitiesMany(t){const i=this.getState(),r=t.filter(a=>a.id in i.entities);if(0===r.length)return;const s=this.generateKeyMap(i),o=Object.assign({},i.entities);for(const a of r){const l=this.updateOrigin(o,a),c=this.selectIdValue(l);c!==a.id&&(delete s[a.id],delete o[a.id]),s[a.id]=c,o[c]=l}this.setEntitiesState(Object.assign(Object.assign({},i),{ids:i.ids.map(a=>{var l;return null!==(l=s[a])&&void 0!==l?l:a}),entities:o}))}upsertEntitiesMany(t){const i=this.getState(),r=[],s=[];for(const o of t){const a=this.selectIdValue(o);a in i.entities?r.push({id:a,changes:o}):s.push(o)}this.updateMany(r),this.addMany(s)}removeEntitiesMany(t){const i=this.getState(),r=this.generateKeyMap(i),s=Object.assign({},i.entities);for(const o of t)o in s&&(delete r[o],delete s[o]);this.setEntitiesState(Object.assign(Object.assign({},i),{ids:i.ids.filter(o=>o in r),entities:s}))}setEntitiesState(t){const i=this.sortKeysByComparator(t.ids,t.entities);this.ctx.setState(Object.assign(Object.assign({},t),{ids:i,entities:t.entities}))}sortKeysByComparator(t,i){if(so(this.comparator))return t;const r=t.slice(),s=this.comparator;return"function"==typeof s?r.sort((o,a)=>s(i[o],i[a])):this.sortByComparatorOptions(r,s,i)}sortByComparatorOptions(t,i,r){switch(null==i?void 0:i.sortByOrder){case n0.ASC:return t.sort((s,o)=>function(n,e,t){return(null==e?void 0:e[n])>(null==t?void 0:t[n])?1:(null==e?void 0:e[n])<(null==t?void 0:t[n])?-1:0}(null==i?void 0:i.sortBy,r[s],r[o]));case n0.DESC:return t.sort((s,o)=>function(n,e,t){return(null==e?void 0:e[n])>(null==t?void 0:t[n])?-1:(null==e?void 0:e[n])<(null==t?void 0:t[n])?1:0}(null==i?void 0:i.sortBy,r[s],r[o]));default:return Mo()&&console.warn(`Invalid --\x3e { sortByOrder: "${null==i?void 0:i.sortByOrder}" } not supported!`),t}}generateKeyMap(t){return t.ids.reduce((i,r)=>(i[r]=r,i),{})}updateOrigin(t,i){return Object.assign(Object.assign({},t[i.id]),i.changes)}selectIdValue(t){const i=this.selectId(t);return so(i)&&Mo()&&console.warn(`The entity passed to the 'selectId' implementation returned ${i}.`,"You should probably provide your own 'selectId' implementation.","The entity that was passed:",t,"The current `selectId` implementation: (entity: V): K => entity.id"),i}}return n.\u0275fac=function(){let e;return function(i){return(e||(e=$n(n)))(i||n)}}(),n.\u0275prov=ue({token:n,factory:n.\u0275fac}),xe([oi(),Xe("design:type",Object),Xe("design:paramtypes",[])],n.prototype,"snapshot",null),xe([oi(),Xe("design:type",Array),Xe("design:paramtypes",[])],n.prototype,"ids",null),xe([oi(),Xe("design:type",Object),Xe("design:paramtypes",[])],n.prototype,"entities",null),xe([oi(),Xe("design:type",Array),Xe("design:paramtypes",[])],n.prototype,"entitiesArray",null),xe([oi(),Xe("design:type",ce),Xe("design:paramtypes",[])],n.prototype,"ids$",null),xe([oi(),Xe("design:type",ce),Xe("design:paramtypes",[])],n.prototype,"entities$",null),xe([oi(),Xe("design:type",ce),Xe("design:paramtypes",[])],n.prototype,"entitiesArray$",null),xe([on(),Xe("design:type",Function),Xe("design:paramtypes",[]),Xe("design:returntype",void 0)],n.prototype,"reset",null),xe([on(),ws(0,Ms("entity")),Xe("design:type",Function),Xe("design:paramtypes",[Object]),Xe("design:returntype",void 0)],n.prototype,"addOne",null),xe([on(),ws(0,Ms("entities")),Xe("design:type",Function),Xe("design:paramtypes",[Array]),Xe("design:returntype",void 0)],n.prototype,"addMany",null),xe([on(),ws(0,Ms("entity")),Xe("design:type",Function),Xe("design:paramtypes",[Object]),Xe("design:returntype",void 0)],n.prototype,"setOne",null),xe([on(),ws(0,Ms("entities")),Xe("design:type",Function),Xe("design:paramtypes",[Array]),Xe("design:returntype",void 0)],n.prototype,"setMany",null),xe([on(),ws(0,Ms("entities")),Xe("design:type",Function),Xe("design:paramtypes",[Array]),Xe("design:returntype",void 0)],n.prototype,"setAll",null),xe([on(),ws(0,Ms("update")),Xe("design:type",Function),Xe("design:paramtypes",[Object]),Xe("design:returntype",void 0)],n.prototype,"updateOne",null),xe([on(),ws(0,Ms("updates")),Xe("design:type",Function),Xe("design:paramtypes",[Array]),Xe("design:returntype",void 0)],n.prototype,"updateMany",null),xe([on(),ws(0,Ms("entity")),Xe("design:type",Function),Xe("design:paramtypes",[Object]),Xe("design:returntype",void 0)],n.prototype,"upsertOne",null),xe([on(),ws(0,Ms("entities")),Xe("design:type",Function),Xe("design:paramtypes",[Array]),Xe("design:returntype",void 0)],n.prototype,"upsertMany",null),xe([on(),ws(0,Ms("id")),Xe("design:type",Function),Xe("design:paramtypes",[Object]),Xe("design:returntype",void 0)],n.prototype,"removeOne",null),xe([on(),ws(0,Ms("ids")),Xe("design:type",Function),Xe("design:paramtypes",[Array]),Xe("design:returntype",void 0)],n.prototype,"removeMany",null),xe([on(),ws(0,Ms("entity")),Xe("design:type",Function),Xe("design:paramtypes",[Object]),Xe("design:returntype",void 0)],n.prototype,"removeByEntity",null),xe([on(),ws(0,Ms("entities")),Xe("design:type",Function),Xe("design:paramtypes",[Array]),Xe("design:returntype",void 0)],n.prototype,"removeByEntities",null),xe([on(),Xe("design:type",Function),Xe("design:paramtypes",[]),Xe("design:returntype",void 0)],n.prototype,"removeAll",null),xe([on(),ws(0,Ms("comparator")),Xe("design:type",Function),Xe("design:paramtypes",[Object]),Xe("design:returntype",void 0)],n.prototype,"sort",null),n})(),Jm=(()=>{class n extends oF{get snapshot(){return rF(this.getState())}get ctx(){return sF(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=$n(n)))(i||n)}}(),n.\u0275prov=ue({token:n,factory:n.\u0275fac}),xe([oi(),Xe("design:type",Object),Xe("design:paramtypes",[])],n.prototype,"snapshot",null),xe([on(),ws(0,Ms("patchValue")),Xe("design:type",Function),Xe("design:paramtypes",[Object]),Xe("design:returntype",void 0)],n.prototype,"patchState",null),xe([on(),ws(0,Ms("stateValue")),Xe("design:type",Function),Xe("design:paramtypes",[Object]),Xe("design:returntype",void 0)],n.prototype,"setState",null),xe([on(),Xe("design:type",Function),Xe("design:paramtypes",[]),Xe("design:returntype",void 0)],n.prototype,"reset",null),n})();function aF(){return Fn(n=>null!=n)}const dDe={};function lF(...n){const e=n[n.length-1];let t=n,i=dDe;return"object"==typeof e&&(i=e,t=t.slice(0,-1)),r=>r.pipe(ur(...t),Zo(i.compare),qc(1))}const s_=new ve("ngx-google-analytics-settings",{factory:()=>({trackingCode:"",enableTracing:!1})}),IF=new ve("ngx-window",{providedIn:"root",factory:()=>function(n){return Of(n)?window:null}(Oc(dl))}),wIe=new ve("ngx-data-layer",{providedIn:"root",factory:()=>function(n){return n?n.dataLayer=n.dataLayer||[]:null}(Oc(IF))}),PF=new ve("ngx-gtag-fn",{providedIn:"root",factory:()=>function(n,e){return n?n.gtag=n.gtag||function(){e.push(arguments)}:null}(Oc(IF),Oc(wIe))});let xs=(()=>{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||Mo())&&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)(I(s_),I(ut),I(PF))},n.\u0275prov=ue({factory:function(){return new n(I(s_),I(ut),I(PF))},token:n,providedIn:"root"}),n})();const MIe={provide:Mf,multi:!0,useFactory:function(n,e,t){return()=>yl(this,void 0,void 0,function*(){var i;if(!n.trackingCode)return void(Mo()||console.error("Empty tracking code for Google Analytics. Make sure to provide one when initializing NgxGoogleAnalyticsModule."));if(!e)return void(Mo()||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||Mo()||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:[s_,PF,ut]};new ve("ngx-google-analytics-routing-settings",{factory:()=>({})});let RF=(()=>{class n{static forRoot(t,i=[],r,s,o){return{ngModule:n,providers:[{provide:s_,useValue:{trackingCode:t,initCommands:i,uri:r,enableTracing:s,nonce:o}},MIe]}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[]]}),n})(),f0=(()=>{class n{constructor(){this.consent="not-set",this.consentChange=new If(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=ue({token:n,factory:n.\u0275fac}),n})(),DIe=(()=>{class n{constructor(t,i,{trackingCode:r}){this.window=i,this.subscriptions=new Te,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)(I(f0),I(IF),I(s_))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();const OIe=new ve("Key under which consent is stored",{providedIn:"root",factory:()=>"ALLOW_TELEMETRY"}),Kq=[f0,DIe,(()=>{class n{constructor(t,i){this.key=i,this.subscriptions=new Te;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)(I(f0),I(OIe))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})()];function PIe(n){return Object.entries(n).reduce((e,[t,i])=>(null!=i&&(e[t]=`${i}`),e),{})}let kIe=(()=>{class n{static forRoot(t){const{providers:i=[]}=RF.forRoot(t.gaToken,function(n){const{appName:e,projectName:t,developmentMode:i}=n;return[{command:"set",values:[PIe({appName:e,projectName:t,developmentMode:i})]}]}(t));return{ngModule:n,providers:i}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({providers:[...Kq,{provide:Mf,multi:!0,useFactory:()=>()=>{},deps:Kq}],imports:[[RF]]}),n})();class Zq extends Error{constructor(){super(...arguments),this.message="NgxsDispatchPluginModule is not imported"}}function FIe(){throw new Zq}function NIe(){throw new Zq}function kF(n,e,t){e.run(()=>n.dispatch(t))}function VIe(n,e,t,i){return Og(t)?function(n,e,t){return t.then(i=>(kF(n,e,i),i))}(n,e,t):cm(t)?function(n,e,t,i){return null!==i&&(t=t.pipe(Tn(i.cancelUncompleted$))),t.subscribe({next:r=>kF(n,e,r)}),t}(n,e,t,i):(kF(n,e,t),t)}class zIe{constructor(){this.cancelUncompleted$=new Se}cancelPreviousAction(){this.cancelUncompleted$.next()}}const FF="\u0275fac",Qq=Symbol("InjectorInstance"),Jq=Symbol("FactoryHasBeenDecorated");function e9(n,e){const t=n[Qq];return t?t.get(e):null}const HIe={cancelUncompleted:!1};function t9(n=HIe){return(e,t,i)=>{let r;const s=function(n){return n?new zIe:null}(n.cancelUncompleted);function o(){null!==s&&s.cancelPreviousAction();const a=e9(this,cu)||FIe(),l=e9(this,dt)||NIe(),c=r.apply(this,arguments);return l.runOutsideAngular(()=>VIe(a,l,c,s))}"function"==typeof(null==i?void 0:i.value)?(r=i.value,i.value=o):Object.defineProperty(e,t,{set:a=>r=a,get:()=>o}),function(n){if(Jq in n.constructor.prototype)return;const e=n.constructor;"function"==typeof e[FF]&&function(n){const e=n[FF];if("function"!=typeof e)return;const t=n.\u0275prov||n.\u0275pipe||n.\u0275cmp||n.\u0275dir,i=()=>{const r=e();return r[Qq]=E(Fc),r};t&&(t.factory=i),Object.defineProperty(n,FF,{get:()=>i})}(e),n.constructor.prototype[Jq]=!0}(e)}}let n9=(()=>{class n{constructor(){this._vertical=!1,this._inset=!1}get vertical(){return this._vertical}set vertical(t){this._vertical=Mt(t)}get inset(){return this._inset}set inset(t){this._inset=Mt(t)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=Ne({type:n,selectors:[["mat-divider"]],hostAttrs:["role","separator",1,"mat-divider"],hostVars:7,hostBindings:function(t,i){2&t&&(nn("aria-orientation",i.vertical?"vertical":"horizontal"),st("mat-divider-vertical",i.vertical)("mat-divider-horizontal",!i.vertical)("mat-divider-inset",i.inset))},inputs:{vertical:"vertical",inset:"inset"},decls:0,vars:0,template:function(t,i){},styles:[".mat-divider{display:block;margin:0;border-top-width:1px;border-top-style:solid}.mat-divider.mat-divider-vertical{border-top:0;border-right-width:1px;border-right-style:solid}.mat-divider.mat-divider-inset{margin-left:80px}[dir=rtl] .mat-divider.mat-divider-inset{margin-left:auto;margin-right:80px}\n"],encapsulation:2,changeDetection:0}),n})(),yx=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[On],On]}),n})();const sPe=["input"],oPe=function(n){return{enterDuration:n}},aPe=["*"],lPe=new ve("mat-checkbox-default-options",{providedIn:"root",factory:c9});function c9(){return{color:"accent",clickAction:"check-indeterminate"}}let cPe=0;const u9=c9(),uPe={provide:ro,useExisting:T(()=>VF),multi:!0};class dPe{}const hPe=Hf(Uf(nc(jf(class{constructor(n){this._elementRef=n}}))));let VF=(()=>{class n extends hPe{constructor(t,i,r,s,o,a,l){super(t),this._changeDetectorRef=i,this._focusMonitor=r,this._ngZone=s,this._animationMode=a,this._options=l,this.ariaLabel="",this.ariaLabelledby=null,this._uniqueId="mat-checkbox-"+ ++cPe,this.id=this._uniqueId,this.labelPosition="after",this.name=null,this.change=new Le,this.indeterminateChange=new Le,this._onTouched=()=>{},this._currentAnimationClass="",this._currentCheckState=0,this._controlValueAccessorChangeFn=()=>{},this._checked=!1,this._disabled=!1,this._indeterminate=!1,this._options=this._options||u9,this.color=this.defaultColor=this._options.color||u9.color,this.tabIndex=parseInt(o)||0}get inputId(){return`${this.id||this._uniqueId}-input`}get required(){return this._required}set required(t){this._required=Mt(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 i=Mt(t);i!==this.disabled&&(this._disabled=i,this._changeDetectorRef.markForCheck())}get indeterminate(){return this._indeterminate}set indeterminate(t){const i=t!=this._indeterminate;this._indeterminate=Mt(t),i&&(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 i=this._currentCheckState,r=this._elementRef.nativeElement;if(i!==t&&(this._currentAnimationClass.length>0&&r.classList.remove(this._currentAnimationClass),this._currentAnimationClass=this._getAnimationClassForCheckStateTransition(i,t),this._currentCheckState=t,this._currentAnimationClass.length>0)){r.classList.add(this._currentAnimationClass);const s=this._currentAnimationClass;this._ngZone.runOutsideAngular(()=>{setTimeout(()=>{r.classList.remove(s)},1e3)})}}_emitChangeEvent(){const t=new dPe;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 i;const r=null===(i=this._options)||void 0===i?void 0:i.clickAction;t.stopPropagation(),this.disabled||"noop"===r?!this.disabled&&"noop"===r&&(this._inputElement.nativeElement.checked=this.checked,this._inputElement.nativeElement.indeterminate=this.indeterminate):(this.indeterminate&&"check"!==r&&Promise.resolve().then(()=>{this._indeterminate=!1,this.indeterminateChange.emit(this._indeterminate)}),this.toggle(),this._transitionCheckState(this._checked?1:2),this._emitChangeEvent())}focus(t,i){t?this._focusMonitor.focusVia(this._inputElement,t,i):this._inputElement.nativeElement.focus(i)}_onInteractionEvent(t){t.stopPropagation()}_getAnimationClassForCheckStateTransition(t,i){if("NoopAnimations"===this._animationMode)return"";let r="";switch(t){case 0:if(1===i)r="unchecked-checked";else{if(3!=i)return"";r="unchecked-indeterminate"}break;case 2:r=1===i?"unchecked-checked":"unchecked-indeterminate";break;case 1:r=2===i?"checked-unchecked":"checked-indeterminate";break;case 3:r=1===i?"indeterminate-checked":"indeterminate-unchecked"}return`mat-checkbox-anim-${r}`}_syncIndeterminate(t){const i=this._inputElement;i&&(i.nativeElement.indeterminate=t)}}return n.\u0275fac=function(t){return new(t||n)(E(rt),E(kn),E(Sa),E(dt),Zr("tabindex"),E(Do,8),E(lPe,8))},n.\u0275cmp=Ne({type:n,selectors:[["mat-checkbox"]],viewQuery:function(t,i){if(1&t&&(Jn(sPe,5),Jn(Js,5)),2&t){let r;_t(r=yt())&&(i._inputElement=r.first),_t(r=yt())&&(i.ripple=r.first)}},hostAttrs:[1,"mat-checkbox"],hostVars:12,hostBindings:function(t,i){2&t&&(al("id",i.id),nn("tabindex",null),st("mat-checkbox-indeterminate",i.indeterminate)("mat-checkbox-checked",i.checked)("mat-checkbox-disabled",i.disabled)("mat-checkbox-label-before","before"==i.labelPosition)("_mat-animation-noopable","NoopAnimations"===i._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:[Dt([uPe]),ct],ngContentSelectors:aPe,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,i){if(1&t&&(wi(),R(0,"label",0,1),R(2,"span",2),R(3,"input",3,4),ge("change",function(s){return i._onInteractionEvent(s)})("click",function(s){return i._onInputClick(s)}),k(),R(5,"span",5),tt(6,"span",6),k(),tt(7,"span",7),R(8,"span",8),Yt.lFrame.currentNamespace=Wn,R(9,"svg",9),tt(10,"path",10),k(),Yt.lFrame.currentNamespace=null,tt(11,"span",11),k(),k(),R(12,"span",12,13),ge("cdkObserveContent",function(){return i._onLabelTextChange()}),R(14,"span",14),De(15,"\xa0"),k(),Ht(16),k(),k()),2&t){const r=vs(1),s=vs(13);nn("for",i.inputId),G(2),st("mat-checkbox-inner-container-no-side-margin",!s.textContent||!s.textContent.trim()),G(1),ie("id",i.inputId)("required",i.required)("checked",i.checked)("disabled",i.disabled)("tabIndex",i.tabIndex),nn("value",i.value)("name",i.name)("aria-label",i.ariaLabel||null)("aria-labelledby",i.ariaLabelledby)("aria-checked",i._getAriaChecked())("aria-describedby",i.ariaDescribedby),G(2),ie("matRippleTrigger",r)("matRippleDisabled",i._isRippleDisabled())("matRippleRadius",20)("matRippleCentered",!0)("matRippleAnimation",Hg(19,oPe,"NoopAnimations"===i._animationMode?0:150))}},directives:[Js,WD],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}),n})(),d9=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({}),n})(),h9=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[_l,On,SE,d9],On,d9]}),n})();const gPe=["bodyCanvas"];let mPe=(()=>{class n{constructor(){this.clsName="ccf-body-ui",this.rotationChange=new Le,this.nodeDrag=new Le,this.nodeClick=new Le,this.nodeHoverStart=new Le,this.nodeHoverStop=new Le,this.initialized=new Le,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 yl(this,void 0,void 0,function*(){const i=this.bodyCanvas.nativeElement,r=new LMe({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.target&&this.bodyUI.setTarget(this.target),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))],this.initialized.emit()})}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=Ne({type:n,selectors:[["ccf-body-ui"]],viewQuery:function(t,i){if(1&t&&Jn(gPe,5,rt),2&t){let r;_t(r=yt())&&(i.bodyCanvas=r.first)}},hostVars:2,hostBindings:function(t,i){2&t&&Rn(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",initialized:"initialized"},decls:2,vars:0,consts:[[1,"body-ui"],["bodyCanvas",""]],template:function(t,i){1&t&&tt(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})(),_Pe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn]]}),n})();function wPe(n,e){if(1&n&&(R(0,"li",4),De(1),Kt(2,"json"),k()),2&n){const t=e.$implicit;G(1),Aw(" ",t[0],": ",rn(2,2,t[1])," ")}}function EPe(n,e){if(1&n&&(R(0,"div",1),R(1,"div"),De(2),k(),R(3,"ul",2),mt(4,wPe,3,4,"li",3),k(),k()),2&n){const t=e.$implicit;G(2),xi(t[0]),G(2),ie("ngForOf",t[1])}}let SPe=(()=>{class n{constructor(t,i){this.clsName="ccf-store-debug",this.root={},this.subscriptions=new Te;const r=t.subscribe(s=>{this.root=s,i.markForCheck()});this.subscriptions.add(r)}get data(){return Object.entries(this.root).map(([s,o])=>[s,Object.entries(o)]).filter(([s,o])=>o.length>0)}ngOnDestroy(){this.subscriptions.unsubscribe()}}return n.\u0275fac=function(t){return new(t||n)(E(cu),E(kn))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-store-debug"]],hostVars:2,hostBindings:function(t,i){2&t&&Rn(i.clsName)},decls:1,vars:1,consts:[["class","state",4,"ngFor","ngForOf"],[1,"state"],[1,"kvlist"],["class","kvpair",4,"ngFor","ngForOf"],[1,"kvpair"]],template:function(t,i){1&t&&mt(0,EPe,5,2,"div",0),2&t&&ie("ngForOf",i.data)},directives:[pl],pipes:[tV],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0}),n})(),MPe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn]]}),n})();new ve("Maximum number of autocomplete options displayed",{providedIn:"root",factory:()=>10});const OPe=["carouselContainer"],IPe=["itemlist"],PPe=["itemcontainer"];function RPe(n,e){if(1&n){const t=Zi();R(0,"mat-icon",9),ge("touchstart",function(){return en(t),Qe().scroll("left")})("touchend",function(){return en(t),Qe().stopScroll()})("click",function(){return en(t),Qe().shift("left")})("mousedown",function(){return en(t),Qe().scroll("left")})("mouseup",function(){return en(t),Qe().stopScroll()}),De(1,"chevron_left"),k()}2&n&&st("disabled",Qe().onLeft)}function kPe(n,e){if(1&n&&(R(0,"div",15),De(1),k()),2&n){const t=Qe().$implicit,i=Qe();G(1),xi(i.occurenceData[t.id]||0)}}function FPe(n,e){if(1&n){const t=Zi();R(0,"div",10),ge("click",function(){const s=en(t).$implicit;return Qe().selectOrgan(s)}),tt(1,"mat-icon",11),R(2,"div",12),R(3,"div",13),De(4),k(),mt(5,kPe,2,1,"div",14),k(),k()}if(2&n){const t=e.$implicit,i=Qe();st("disabled",t.disabled)("selected",i.isSelected(t)),G(1),Jy("svgIcon",t.src),G(3),xi(t.name),G(1),ie("ngIf",void 0!==t.numResults)}}function NPe(n,e){if(1&n){const t=Zi();R(0,"mat-icon",16),ge("touchstart",function(){return en(t),Qe().scroll("right")})("touchend",function(){return en(t),Qe().stopScroll()})("click",function(){return en(t),Qe().shift("right")})("mousedown",function(){return en(t),Qe().scroll("right")})("mouseup",function(){return en(t),Qe().stopScroll()}),De(1,"chevron_right"),k()}2&n&&st("disabled",Qe().onRight)}const g0=[{src:"app:skin",organ:"Skin",name:"Skin",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002097"},{src:"app:brain",organ:"Brain",name:"Brain",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000955"},{disabled:!0,src:"app:lymph-nodes",organ:"Lymph Node",name:"Lymph Node",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000029"},{src:"app:lymph-nodes",organ:"Lymph Node",name:"Lymph Node",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002509"},{disabled:!0,src:"app:eye",organ:"Eye",name:"Eye, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000970"},{src:"app:eye",organ:"Eye",name:"Eye, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0004548"},{src:"app:eye",organ:"Eye",name:"Eye, R",side:"right",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0004549"},{disabled:!0,src:"app:fallopian-tube-left",organ:"Fallopian Tube",name:"Fallopian Tube, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0003889"},{src:"app:fallopian-tube-left",organ:"Fallopian Tube",name:"Fallopian Tube, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0001303"},{src:"app:fallopian-tube-right",organ:"Fallopian Tube",name:"Fallopian Tube, R",side:"right",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0001302"},{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, L",side:"left",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"},{disabled:!0,src:"app:knee",organ:"Knee",name:"Knee, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001465"},{src:"app:knee",organ:"Knee",name:"Knee, L",side:"left",hasSex:!0,id:"http://purl.org/sig/ont/fma/fma24978"},{src:"app:knee",organ:"Knee",name:"Knee, R",side:"right",hasSex:!0,id:"http://purl.org/sig/ont/fma/fma24977"},{src:"app:liver",organ:"Liver",name:"Liver",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002107"},{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"},{disabled:!0,src:"app:mammary-gland",organ:"Mammary Gland",name:"Mammary Gland, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0001911"},{src:"app:mammary-gland",organ:"Mammary Gland",name:"Mammary Gland, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.org/sig/ont/fma/fma57991"},{src:"app:mammary-gland",organ:"Mammary Gland",name:"Mammary Gland, R",side:"right",hasSex:!1,sex:"female",id:"http://purl.org/sig/ont/fma/fma57987"},{disabled:!0,src:"app:ovary-left",organ:"Ovary",name:"Ovary, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0000992"},{src:"app:ovary-left",organ:"Ovary",name:"Ovary, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.org/sig/ont/fma/fma7214"},{src:"app:ovary-right",organ:"Ovary",name:"Ovary, R",side:"right",hasSex:!1,sex:"female",id:"http://purl.org/sig/ont/fma/fma7213"},{src:"app:pancreas",organ:"Pancreas",name:"Pancreas",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001264"},{src:"app:pelvis-f",organ:"Pelvis",name:"Pelvis",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001270"},{src:"app:placenta",organ:"Placenta",name:"Placenta",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0001987"},{src:"app:prostate",organ:"Prostate",name:"Prostate",hasSex:!1,sex:"male",id:"http://purl.obolibrary.org/obo/UBERON_0002367",disabled:!0},{src:"app:prostate",organ:"Prostate",name:"Prostate",hasSex:!1,sex:"male",id:"http://purl.obolibrary.org/obo/UBERON_0000079"},{src:"app:small-intestine",organ:"Small Intestine",name:"Small Intestine",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002108"},{src:"app:large-intestine",organ:"Large Intestine",name:"Large Intestine",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000059"},{src:"app:spinal-cord",organ:"Spinal Cord",name:"Spinal Cord",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002240"},{src:"app:spleen",organ:"Spleen",name:"Spleen",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002106"},{src:"app:thymus",organ:"Thymus",name:"Thymus",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002370"},{disabled:!0,src:"app:ureter-left",organ:"Ureter",name:"Ureter, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000056"},{src:"app:ureter-left",organ:"Ureter",name:"Ureter, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001223"},{src:"app:ureter-right",organ:"Ureter",name:"Ureter, R",side:"right",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001222"},{src:"app:bladder",organ:"Urinary Bladder",name:"Urinary Bladder",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001255"},{src:"app:uterus",organ:"Uterus",name:"Uterus",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0000995"},{src:"app:vasculature-thick",organ:"Blood Vasculature",name:"Blood Vasculature",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0004537"},{disabled:!0,src:"app:vasculature-thick",organ:"Blood Vasculature",name:"Blood Vasculature",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002049"}].sort((n,e)=>n.name.localeCompare(e.name)).filter(n=>!0!==n.disabled);let p9=(()=>{class n{constructor(){this.clsName="ccf-organ-selector",this.multiselect=!1,this.displayErrors=!1,this.organList=g0,this.selectedOrgans=[],this.expanded=!1,this.organsChanged=new Le,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 hW.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:i}=this;let r=parseInt(i.nativeElement.style.left,10)||0;this.onLeft&&"left"===t||this.onRight&&"right"===t||(r="right"===t?r-this.step:r+this.step,i.nativeElement.style.left=r+"px",this.setLeftRight(r))}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(i=>t!==i):this.selectedOrgans.concat([t]):[t],this.organsChanged.emit(this.selectedOrgans)}isSelected(t){return!!this.selectedOrgans.includes(t)}set(){const{itemList:t,itemContainer:i,carouselContainer:r}=this,s=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(s);const o=this.step*Math.floor(r.nativeElement.offsetWidth/this.step)-64;i.nativeElement.style.width=`${o}px`}}setWidth(){const{itemContainer:t,carouselContainer:i}=this,r=this.step*Math.floor(i.nativeElement.offsetWidth/this.step)-64;t.nativeElement.style.width=`${r}px`}setLeftRight(t){const{itemContainer:i}=this;this.onLeft=0===t,this.onRight=t<=i.nativeElement.offsetWidth-this.organList.length*this.step}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=Ne({type:n,selectors:[["ccf-organ-selector"]],viewQuery:function(t,i){if(1&t&&(Jn(OPe,7),Jn(IPe,7),Jn(PPe,7)),2&t){let r;_t(r=yt())&&(i.carouselContainer=r.first),_t(r=yt())&&(i.itemList=r.first),_t(r=yt())&&(i.itemContainer=r.first)}},hostVars:2,hostBindings:function(t,i){2&t&&Rn(i.clsName)},inputs:{multiselect:"multiselect",displayErrors:"displayErrors",organList:"organList",selectedOrgans:"selectedOrgans",expanded:"expanded",occurenceData:"occurenceData"},outputs:{organsChanged:"organsChanged"},features:[zn],decls:9,vars:8,consts:[["matTooltip","Select the organ your tissue block is from.",1,"container",3,"matTooltipDisabled"],["carouselContainer",""],["class","carousel-left-icon",3,"disabled","touchstart","touchend","click","mousedown","mouseup",4,"ngIf"],[1,"carousel-item-container"],["itemcontainer",""],[1,"carousel-item-list"],["itemlist",""],["class","carousel-item",3,"disabled","selected","click",4,"ngFor","ngForOf"],["class","carousel-right-icon",3,"disabled","touchstart","touchend","click","mousedown","mouseup",4,"ngIf"],[1,"carousel-left-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"],[1,"carousel-right-icon",3,"touchstart","touchend","click","mousedown","mouseup"]],template:function(t,i){1&t&&(R(0,"div",0,1),mt(2,RPe,2,2,"mat-icon",2),R(3,"div",3,4),R(5,"div",5,6),mt(7,FPe,6,7,"div",7),k(),k(),mt(8,NPe,2,2,"mat-icon",8),k()),2&t&&(st("expanded",i.expanded)("error",i.error),ie("matTooltipDisabled",i.multiselect),G(2),ie("ngIf",!i.expanded),G(5),ie("ngForOf",i.organList),G(1),ie("ngIf",!i.expanded))},directives:[dc,zr,pl,rs],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:5rem;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}[_nghost-%COMP%] .expanded[_ngcontent-%COMP%] .carousel-item-container[_ngcontent-%COMP%]{width:100%!important}[_nghost-%COMP%] .expanded[_ngcontent-%COMP%] .carousel-item-container[_ngcontent-%COMP%] .carousel-item-list[_ngcontent-%COMP%]{flex-wrap:wrap;overflow:auto;left:0rem!important}[_nghost-%COMP%] .expanded[_ngcontent-%COMP%] .carousel-item-container[_ngcontent-%COMP%] .carousel-item-list[_ngcontent-%COMP%] .carousel-item[_ngcontent-%COMP%]{height:5rem}"]}),n})(),g9=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,lr,hc]]}),n})(),LPe=(()=>{class n{constructor(){this.clsName="ccf-opacity-slider",this.opacity=20,this.visible=!0,this.opacityChange=new Le,this.visibilityToggle=new Le,this.opacityReset=new Le}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 n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=Ne({type:n,selectors:[["ccf-opacity-slider"]],hostVars:2,hostBindings:function(t,i){2&t&&Rn(i.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,i){1&t&&(R(0,"div",0),R(1,"div",1),R(2,"mat-slider",2),ge("input",function(s){return i.changeOpacity(s.value)}),k(),R(3,"span",3),De(4),k(),k(),R(5,"div",4),R(6,"mat-icon",5),ge("click",function(){return i.toggleVisibility()}),k(),R(7,"mat-icon",6),ge("click",function(){return i.toggleVisibility()}),k(),R(8,"mat-icon",7),ge("click",function(){return i.resetOpacity()}),De(9,"refresh"),k(),k(),k()),2&t&&(G(2),st("disabled",!i.visible),ie("step",1)("min",0)("max",100)("value",i.opacity),G(2),or("",i.opacity,"%"),G(2),st("hidden",i.visible),ie("matRippleCentered",!0)("matRippleUnbounded",!0),G(1),st("hidden",!i.visible),ie("matRippleCentered",!0)("matRippleUnbounded",!0),G(1),ie("matRippleCentered",!0)("matRippleUnbounded",!0))},directives:[jk,rs,Js],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}),n})(),m9=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,lr,_W,_l]]}),n})();function BPe(n,e){if(1&n&&(R(0,"div",16),tt(1,"youtube-player",17),k()),2&n){const t=Qe(3);G(1),Jy("videoId",t.videoID)}}function VPe(n,e){if(1&n&&(R(0,"mat-expansion-panel",11),R(1,"mat-expansion-panel-header"),R(2,"h2",12),De(3),k(),k(),R(4,"div",13),tt(5,"markdown",14),mt(6,BPe,2,1,"div",15),k(),k()),2&n){const t=Qe(),i=t.index,r=t.$implicit;ie("expanded",0===i),G(3),xi(r.title),G(2),st("first",0===i),ie("data",r.content),G(1),ie("ngIf",0===i)}}function zPe(n,e){if(1&n&&(R(0,"div",9),mt(1,VPe,7,6,"mat-expansion-panel",10),k()),2&n){const t=e.$implicit;G(1),ie("ngIf",t)}}let _9=(()=>{class n{constructor(t,i){this.dialogRef=t,this.data=i,this.documentationContents=i.content||[],this.infoTitle=i.title||"",this.videoID=i.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 n.\u0275fac=function(t){return new(t||n)(E(Qm),E(Gk))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-info-dialog"]],decls:11,vars:2,consts:[[1,"rui-about","wrapper"],[1,"container"],[1,"content"],[1,"header"],["mat-dialog-title","",1,"title"],[1,"close"],[1,"material-icons","close-icon",3,"click"],[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,i){1&t&&(R(0,"div",0),R(1,"div",1),R(2,"div",2),R(3,"div",3),R(4,"h2",4),De(5),k(),R(6,"div",5),R(7,"mat-icon",6),ge("click",function(){return i.close()}),De(8,"clear"),k(),k(),k(),R(9,"mat-dialog-content",7),mt(10,zPe,2,1,"div",8),k(),k(),k(),k()),2&t&&(G(5),xi(i.infoTitle),G(5),ie("ngForOf",i.documentationContents))},directives:[Wk,rs,qk,pl,zr,qM,YM,TW,IW],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%] .content[_ngcontent-%COMP%] .header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;height:3rem;margin-bottom:2.25rem;position:relative}.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%]{cursor:pointer;height:3rem;width:3rem;line-height:3rem;text-align:center;transition:.6s}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-size:1.5rem;margin:0 auto;line-height:3rem;height:3rem;justify-self:center;display:flex}.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;display:flex}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .dialog-content[_ngcontent-%COMP%] .variable-binding.first[_ngcontent-%COMP%]{padding-right:1rem;width:73%}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .dialog-content[_ngcontent-%COMP%] .variable-binding[_ngcontent-%COMP%] ul{margin:0}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .dialog-content[_ngcontent-%COMP%] .variable-binding[_ngcontent-%COMP%] img{margin-left:1rem;float:right}.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%}"]}),n})(),jPe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,Qb,lr,Kk,pAe,XTe.forRoot({})]]}),n})(),y9=(()=>{class n{constructor(t){this.http=t,this.panelContent=new ar({content:[],infoTitle:"",videoID:""})}updateData(t,i,r){this.http.get(t,{responseType:"text"}).subscribe(s=>{const o={content:this.parseMarkdown(s),infoTitle:r,videoID:i};this.panelContent.next(o)})}parseMarkdown(t){const i=[],r=t.split("# ");for(const s of r)if(s.length){const o=s.includes("\n\n")?"\n\n":"\r\n\r\n",a=s.split(o);i.push({title:a[0],content:a.splice(1).join(o)})}return i}}return n.\u0275fac=function(t){return new(t||n)(I(Wf))},n.\u0275prov=ue({token:n,factory:n.\u0275fac,providedIn:"root"}),n})(),UPe=(()=>{class n{constructor(t,i){this.dialog=t,this.infoButtonService=i,this.infoTitle="",this.subscriptions=new Te,this.subscriptions.add(i.panelContent.subscribe(r=>{r.content.length&&this.launchInfoDialog(r)}))}ngOnDestroy(){this.subscriptions.unsubscribe()}launchInfoDialog(t){0==this.dialog.openDialogs.length&&this.dialog.open(_9,{autoFocus:!1,panelClass:"modal-animated",width:"72rem",data:{title:t.infoTitle,content:t.content,videoID:t.videoID}})}onDialogButtonClick(){this.infoButtonService.updateData(this.documentationUrl,this.videoID,this.infoTitle)}}return n.\u0275fac=function(t){return new(t||n)(E(_p),E(y9))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-info-button"]],inputs:{infoTitle:"infoTitle",videoID:"videoID",documentationUrl:"documentationUrl"},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,i){1&t&&(R(0,"div",0),R(1,"mat-icon",1),ge("click",function(){return i.onDialogButtonClick()}),De(2," info "),k(),k())},directives:[rs],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}"]}),n})(),HPe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,jPe,lr,Rj]]}),n})(),$Pe=(()=>{class n{constructor(){this.clsName="ccf-call-to-action",this.callToActionClicked=new Le,this.closeClicked=new Le}close(){this.closeClicked.emit()}onDialogButtonClick(){this.callToActionClicked.emit()}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=Ne({type:n,selectors:[["ccf-call-to-action"]],hostVars:2,hostBindings:function(t,i){2&t&&Rn(i.clsName)},inputs:{infoTitle:"infoTitle",imageUrl:"imageUrl",message:"message",callToAction:"callToAction"},outputs:{callToActionClicked:"callToActionClicked",closeClicked:"closeClicked"},decls:13,vars:4,consts:[[1,"rui-about","wrapper"],[1,"container"],[1,"content"],[1,"first-row"],["mat-dialog-title","",1,"title"],[1,"cta-mat-icon","material-icons","close-icon",3,"click"],["mat-card-sm-image","","alt","preview","layout-fill","",1,"cta-image",3,"src"],[1,"mat-typography","dialog-content"],[1,"message"],["mat-button","",1,"mat-button",3,"text","click"]],template:function(t,i){1&t&&(R(0,"div",0),R(1,"div",1),R(2,"div",2),R(3,"div",3),R(4,"p",4),De(5),k(),R(6,"mat-icon",5),ge("click",function(){return i.close()}),De(7,"clear"),k(),k(),tt(8,"img",6),R(9,"mat-dialog-content",7),R(10,"div",8),De(11),k(),R(12,"a",9),ge("click",function(){return i.onDialogButtonClick()}),k(),k(),k(),k(),k()),2&t&&(G(5),xi(i.infoTitle),G(3),ie("src",i.imageUrl,Ud),G(3),or(" ",i.message,""),G(1),ie("text",i.callToAction))},directives:[Wk,rs,CAe,qk],styles:["[_nghost-%COMP%] .content[_ngcontent-%COMP%]{display:block;align-content:center;padding-left:1.6rem;padding-right:1.6rem;border-radius:.25rem}[_nghost-%COMP%] .info-button-wrapper[_ngcontent-%COMP%]{border-radius:.25rem;padding:.6rem;transition:.6s}[_nghost-%COMP%] .info-button-wrapper[_ngcontent-%COMP%] .ccf-info-button[_ngcontent-%COMP%]{cursor:pointer;transition:color .6s;font-size:1.2rem;vertical-align:sub}[_nghost-%COMP%] .first-row[_ngcontent-%COMP%]{display:flex;width:100%;line-height:.9rem}[_nghost-%COMP%] .first-row[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{padding-right:7rem;padding-left:.2rem;font-size:.875rem;padding-top:.75rem}[_nghost-%COMP%] .first-row[_ngcontent-%COMP%] .cta-mat-icon[_ngcontent-%COMP%]{height:30%;line-height:3.4rem}[_nghost-%COMP%] .message[_ngcontent-%COMP%]{padding:.5rem}[_nghost-%COMP%] .cta-image[_ngcontent-%COMP%]{align-self:center;-o-object-fit:cover;object-fit:cover;width:100%;border-radius:.25rem}[_nghost-%COMP%] .mat-button[_ngcontent-%COMP%]{background-color:#444a65;font-size:.75rem;position:relative;margin-bottom:1rem;width:100%;height:2rem;color:#fff}"],changeDetection:0}),n})(),WPe=(()=>{class n{constructor(t){this.el=t}onInputChange(t){const i=this.el.nativeElement.value;this.el.nativeElement.value=i.replace(/[^0-9]*/g,""),i!==this.el.nativeElement.value&&t.stopPropagation()}}return n.\u0275fac=function(t){return new(t||n)(E(rt))},n.\u0275dir=oe({type:n,selectors:[["input","ccfNumbersOnly",""]],hostBindings:function(t,i){1&t&&ge("input",function(s){return i.onInputChange(s)})}}),n})(),qPe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({}),n})(),v9=(()=>{class n{get obj(){const t=this.findGlobalObject();return Object.defineProperties(this,{obj:{configurable:!1,writable:!1,value:t}}),t}has(t){const{obj:i}=this;return null!=i&&t in i}get(t,i){var r;const{obj:s}=this;return null!==(r=s&&s[t])&&void 0!==r?r:i}set(t,i){const{obj:r}=this;r&&(r[t]=i)}remove(t){const{obj:i}=this;i&&delete i[t]}findGlobalObject(){if("undefined"!=typeof globalThis)return globalThis;if("undefined"!=typeof global)return global;if("undefined"!=typeof window)return window;if("undefined"!=typeof self)return self;try{return new Function("return this;")()}catch(t){}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ue({token:n,factory:n.\u0275fac,providedIn:"root"}),n})(),Ah=(()=>{let n=class extends Jm{constructor(){super(...arguments),this.optionCache=new Map}get config$(){return this.state$.pipe(aF(),qc(1))}setConfig(t){this.setState(t)}patchConfig(t){this.patchState(t)}getProperty(t){return this.config$.pipe(ur(...t),Zo(),qc(1))}getOption(...t){const i=this.getPathKey(t);if(this.optionCache.has(i))return this.optionCache.get(i);const r=this.config$.pipe(ur(...t),Zo(),qc(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=$n(n)))(i||n)}}(),n.\u0275prov=ue({token:n,factory:n.\u0275fac}),xe([oi()],n.prototype,"config$",null),n=xe([xh(),cd({name:"globalConfig",defaults:null})],n),n})();!function(){const n=localStorage.getItem("ALLOW_TELEMETRY");null===n||n.toLowerCase()}();let ZPe=(()=>{class n{constructor(t,i){t&&function(n,e){Wc(n,"mousemove").pipe(dW(1e3),Ae(r=>{const{clientWidth:s,clientHeight:o}=n,{clientX:a,clientY:l}=r;return[a,l,s,o].join("_")})).subscribe(r=>e.event("webpage","mousemove",r))}(t.body,i)}}return n.\u0275fac=function(t){return new(t||n)(I(ut),I(xs))},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({}),n})();function QPe(n,e){if(1&n){const t=Zi();R(0,"button",1),ge("click",function(){return en(t),Qe().submit(!0)}),De(1),k()}if(2&n){const t=Qe();G(1),or(" ","not-set"===t.allowTelemetry?"I understand":"Opt in","\n")}}function JPe(n,e){if(1&n){const t=Zi();R(0,"button",1),ge("click",function(){return en(t),Qe().submit(!1)}),De(1,"Opt out"),k()}}let eRe=(()=>{class n{constructor(t,i,r){this.consentService=i,this.data=r,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:i}=this;return"not-set"===i||("opt-in"===t?"rescinded"===i:"given"===i)}}return n.\u0275fac=function(t){return new(t||n)(E(rt),E(f0),E(KO))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-tracking-popup"]],hostVars:2,hostBindings:function(t,i){2&t&&Rn(i.clsName)},decls:4,vars:2,consts:[["mat-button","","color","basic",3,"click",4,"ngIf"],["mat-button","","color","basic",3,"click"]],template:function(t,i){1&t&&(R(0,"p"),De(1,"We log usage to improve this service."),k(),mt(2,QPe,2,1,"button",0),mt(3,JPe,2,0,"button",0)),2&t&&(G(2),ie("ngIf",i.showButton("opt-in")),G(1),ie("ngIf",i.showButton("opt-out")))},directives:[zr,lh],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}),n})(),tRe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,ch]]}),n})();new Se;let zF=(()=>{class n{}return n.type="[CallToAction] Learn More",n})(),jF=(()=>{class n{}return n.type="[CallToAction] Open Dialog",n})(),UF=(()=>{class n{}return n.type="[CallToAction] Close Dialog",n})();var HF;class sa{get length(){var e,t;return null!==(t=null===(e=sa.storage)||void 0===e?void 0:e.length)&&void 0!==t?t:0}key(e){var t,i;return null!==(i=null===(t=sa.storage)||void 0===t?void 0:t.key(e))&&void 0!==i?i:null}getItem(e,t){var i,r,s;return null!==(s=null!==(r=null===(i=sa.storage)||void 0===i?void 0:i.getItem(e))&&void 0!==r?r:t)&&void 0!==s?s:null}setItem(e,t){var i;try{return null===(i=sa.storage)||void 0===i||i.setItem(e,t),!0}catch(r){return!1}}removeItem(e){var t;null===(t=sa.storage)||void 0===t||t.removeItem(e)}clear(){var e;null===(e=sa.storage)||void 0===e||e.clear()}}sa.storage=(()=>{let n;try{n=window.localStorage;const e="__storage_test__";return n.setItem(e,e),n.removeItem(e),n}catch(e){return e instanceof DOMException&&(22===e.code||1014===e.code||"QuotaExceededError"===e.name||"NS_ERROR_DOM_QUOTA_REACHED"===e.name)&&n&&0!==n.length?n:void 0}})(),sa.\u0275fac=function(e){return new(e||sa)},sa.\u0275prov=ue({token:sa,factory:sa.\u0275fac,providedIn:"root"});const w9="callToActionPopupShown";let oo=HF=class{constructor(e,t,i,r,s){this.dialog=e,this.ga=t,this.storage=i,this.infoService=r,this.http=s}static ctaDatePassed(e,t=Date.now){return+t()>+new Date(e)}ngxsOnInit(e){const{expirationDate:t,popupShown:i}=e.getState(),r=this.storage.getItem(w9,`${i}`),s=HF.ctaDatePassed(t);"true"!==r&&!s&&e.dispatch(new jF)}getDialogData(){return this.http.get("assets/docs/SPATIAL_SEARCH_README.md",{responseType:"text"}).pipe(Ae(e=>this.infoService.parseMarkdown(e)))}launchLearnMore(e){this.dialog.open(_9,{autoFocus:!1,panelClass:"modal-animated",width:"72rem",data:{title:"Spatial Search",content:e,videoID:"UfxMpzatowE"}})}learnMore(e){return this.dialog.closeAll(),this.ga.event("open_learn_more","call_to_action"),this.getDialogData().pipe(Ti(t=>this.launchLearnMore(t)))}open(e){this.dialog.open(iRe,{autoFocus:!1,panelClass:"modal-animated",width:"30.75rem",height:"36.688rem"}),this.ga.event("open","call_to_action"),this.storage.setItem(w9,"true"),e.patchState({popupShown:!0})}close(e){this.dialog.closeAll(),this.ga.event("close","call_to_action")}};oo.\u0275fac=function(e){return new(e||oo)(I(_p),I(xs),I(sa),I(y9),I(Wf))},oo.\u0275prov=ue({token:oo,factory:oo.\u0275fac}),xe([gk(zF)],oo.prototype,"learnMore",null),xe([gk(jF)],oo.prototype,"open",null),xe([gk(UF)],oo.prototype,"close",null),oo=HF=xe([cd({name:"callToAction",defaults:{title:"New to the Exploration User Interface",message:"Spatial Search has arrived!",callToAction:"Learn More",imageUrl:"assets/images/spatial_search.gif",expirationDate:"Dec 1, 2022",popupShown:!1}})],oo);let vx=(()=>{class n{static title(t){return t.title}static message(t){return t.message}static callToAction(t){return t.callToAction}static imageUrl(t){return t.imageUrl}static expirationDate(t){return t.expirationDate}static popupShown(t){return t.popupShown}}return xe([Xm([oo])],n,"title",null),xe([Xm([oo])],n,"message",null),xe([Xm([oo])],n,"callToAction",null),xe([Xm([oo])],n,"imageUrl",null),xe([Xm([oo])],n,"expirationDate",null),xe([Xm([oo])],n,"popupShown",null),n})(),iRe=(()=>{class n{constructor(){this.close=()=>new UF,this.learnMore=()=>new zF}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=Ne({type:n,selectors:[["ccf-call-to-action-behavior"]],decls:5,vars:12,consts:[[3,"infoTitle","message","callToAction","imageUrl","callToActionClicked","closeClicked"]],template:function(t,i){1&t&&(R(0,"ccf-call-to-action",0),ge("callToActionClicked",function(){return i.learnMore()})("closeClicked",function(){return i.close()}),Kt(1,"async"),Kt(2,"async"),Kt(3,"async"),Kt(4,"async"),k()),2&t&&ie("infoTitle",rn(1,4,i.title$))("message",rn(2,6,i.message$))("callToAction",rn(3,8,i.callToAction$))("imageUrl",rn(4,10,i.imageUrl$))},directives:[$Pe],pipes:[Hc],styles:[""],changeDetection:0}),xe([NM(vx.title)],n.prototype,"title$",void 0),xe([NM(vx.message)],n.prototype,"message$",void 0),xe([NM(vx.callToAction)],n.prototype,"callToAction$",void 0),xe([NM(vx.imageUrl)],n.prototype,"imageUrl$",void 0),xe([t9()],n.prototype,"close",void 0),xe([t9()],n.prototype,"learnMore",void 0),n})();const oRe={initialConfig:{},parse:{},rename:{}};class aRe{constructor(e,t){this.configState=e,this.storedChanges={},this.options=Object.assign(Object.assign({},oRe),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 lRe=(()=>{class n{constructor(t,i,r={}){this.configState=t,this.cdr=i,this.options=r,this.initialized=!1,this.configManager=new aRe(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=oe({type:n,features:[zn]}),n})();const cRe={boolean:n=>"false"!=`${n}`,json:n=>"string"==typeof n?JSON.parse(n):n,function:n=>{if("function"!=typeof n)throw new Error("Expected a javascript function");return n}};var $F;const hu={production:!0,disableDbWorker:!0,dbOptions:{ccfOwlUrl:"https://ccf-ontology.hubmapconsortium.org/v2.1.0/ccf.owl",ccfContextUrl:"https://hubmapconsortium.github.io/ccf-ontology/ccf-context.jsonld",hubmapDataService:"search-api",hubmapPortalUrl:"https://portal.hubmapconsortium.org/",hubmapDataUrl:"",hubmapAssetsUrl:"https://assets.hubmapconsortium.org",hubmapToken:null!==($F=localStorage.getItem("HUBMAP_TOKEN"))&&void 0!==$F?$F:""},customization:{theme:"hubmap",header:!0,homeUrl:"https://portal.hubmapconsortium.org/",logoTooltip:"Human BioMolecular Atlas Project"},skipUnsavedChangesConfirmation:!1,googleAnalyticsToken:"portal.hubmapconsortium.org"===window.location.hostname?"G-1WRJHN9FM6":"G-J9HWV9QPJ4"};var uRe=ze(815);class hRe{constructor(e){this.value=e}call(e,t){return t.subscribe(new fRe(e,this.value))}}class fRe extends xt{constructor(e,t){super(e),this.value=t}_next(e){this.destination.next(this.value)}}class gRe{constructor(e){this.notifier=e}call(e,t){return t.subscribe(new mRe(e,this.notifier))}}class mRe extends ii{constructor(e,t){super(e),this.hasValue=!1;const i=new Gr(this);this.add(i),this.innerSubscription=i;const r=co(t,i);r!==i&&(this.add(r),this.innerSubscription=r)}_next(e){this.hasValue&&super._next(e)}notifyNext(){this.hasValue=!0,this.innerSubscription&&this.innerSubscription.unsubscribe()}notifyComplete(){}}function GF(n){return"function"==typeof n}function E9(n){return void 0===n}function yRe(n,e,t){return function(r){let s=!!n;return function(n){return"function"==typeof n}(n)&&(s=n(r)),function(n,e){return GF(n)?n(e):E9(n)?e:n}(s?e:t,r)}}function vRe(n,e){return function(i){if(function(n){return null===n||E9(n)}(n)&&i)return i;if(!Array.isArray(i))return[n];const r=i.slice();let s=0;return e>0&&(s=e),r.splice(s,0,n),r}}function m0(n){return function(t){let i=null;for(const r in n){const s=n[r],o=t[r],a=GF(s)?s(o):s;a!==o&&(i||(i=Object.assign({},t)),i[r]=a)}return i||t}}let ji=class extends Jm{constructor(e){super(),this.globalConfig=e,this.user$=this.state$.pipe(ur("user")),this.registrationStarted$=this.state$.pipe(lF("registrationStarted")),this.useCancelRegistrationCallback$=this.state$.pipe(ur("useCancelRegistrationCallback")),this.registrationCallbackSet$=this.state$.pipe(ur("registrationCallbackSet"))}get skipConfirmation$(){return this.state$.pipe(lF("skipConfirmation"))}get globalSkipConfirmation$(){return this.globalConfig.getOption("skipUnsavedChangesConfirmation").pipe(Ae(e=>null!=e?e:hu.skipUnsavedChangesConfirmation),Zo())}get hasChanges$(){return this.state$.pipe(lF("hasChanges"))}ngxsOnInit(){super.ngxsOnInit(),this.globalConfig.config$.pipe(yi(1),Ti(e=>this.setState(m0({registrationCallbackSet:!!e.register,useCancelRegistrationCallback:!!e.cancelRegistration,user:yRe(!!e.user,e.user),registrationStarted:!!e.user||void 0})))).subscribe(),this.initSkipConfirmationListeners()}cancelRegistration(){const{globalConfig:{snapshot:{cancelRegistration:e}},snapshot:{useCancelRegistrationCallback:t,skipConfirmation:i}}=this;t&&(i||confirm("Changes you made may not be saved."))&&(null==e||e())}setUseCancelRegistrationCallback(e){this.ctx.patchState({useCancelRegistrationCallback:e})}setUserName(e){this.ctx.setState(m0({user:m0(e)}))}registrationStarted(){this.ctx.setState(m0({registrationStarted:!0}))}setHasChanges(){const{snapshot:{registrationStarted:e,hasChanges:t}}=this;e&&!t&&this.ctx.patchState({hasChanges:!0})}clearHasChanges(){this.ctx.patchState({hasChanges:!1})}initSkipConfirmationListeners(){const e=i=>this.patchState({skipConfirmation:i});this.globalSkipConfirmation$.pipe(Fn(i=>i)).subscribe(e),this.hasChanges$.pipe(ZM(this.globalSkipConfirmation$),Ae(([i,r])=>r||!i),Zo()).subscribe(e);const t=i=>(i.preventDefault(),i.returnValue="Changes you made may not be saved.",i.returnValue);this.skipConfirmation$.subscribe(i=>{i?removeEventListener("beforeunload",t):addEventListener("beforeunload",t)})}};ji.\u0275fac=function(e){return new(e||ji)(I(Ah))},ji.\u0275prov=ue({token:ji,factory:ji.\u0275fac}),xe([oi()],ji.prototype,"skipConfirmation$",null),xe([oi()],ji.prototype,"globalSkipConfirmation$",null),xe([oi()],ji.prototype,"hasChanges$",null),xe([on()],ji.prototype,"setUseCancelRegistrationCallback",null),xe([on()],ji.prototype,"setUserName",null),xe([on()],ji.prototype,"registrationStarted",null),xe([on()],ji.prototype,"setHasChanges",null),xe([on()],ji.prototype,"clearHasChanges",null),ji=xe([xh(),cd({name:"page",defaults:{user:{firstName:"",lastName:""},registrationStarted:!1,useCancelRegistrationCallback:!1,registrationCallbackSet:!1,skipConfirmation:!0,hasChanges:!1}})],ji);let fc=class extends Jm{constructor(e,t){super(),this.globals=e,this.globalConfig=t}ngxsOnInit(){super.ngxsOnInit(),this.getSourceDB().subscribe(e=>{this.setState(e),hu.production||this.globals.set("db",e)})}getSourceDB(){return this.globalConfig.getOption("baseHref").pipe(Ae(e=>(null!=e?e:"")+"assets/reference-organ-data.json"),Pr(e=>ui(fetch(e)).pipe(Pr(t=>t.json()),Ta(()=>ec))))}normalizePlacement(e){const i=this.snapshot.placementPatches[null==e?void 0:e.target];if(i){const r=function(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(ib),o=[t.x_scaling,t.y_scaling,t.z_scaling];return n.translate(r).rotateXYZ(s).scale(o)}(new $t($t.IDENTITY),i),s={x:e.x_translation,y:e.y_translation,z:e.z_translation},[o,a,l]=r.transformAsPoint([s.x,s.y,s.z],[]),c=Object.assign(Object.assign({},e),{target:i.target});return c.x_translation=o,c.y_translation=a,c.z_translation=l,c}return e}getReferenceOrganIri(e,t,i,r){const s=this.snapshot;"KIDNEY"!==e.toUpperCase()&&(i=""),(null==r?void 0:r.sex)&&(t=r.sex);const o=[e,t,i||(null==r?void 0:r.side)].join("|").toUpperCase(),a=Object.keys(s.organIRILookup).find(l=>l.toUpperCase().endsWith(o));return a?s.organIRILookup[a]:void 0}getOrganData(e){var t,i,r;const o=this.snapshot.organSpatialEntities[e];if(!o)return;const a=null!==(t=o.label)&&void 0!==t?t:"",l=g0.find(c=>a.endsWith(c.organ)&&(!o.side||o.side.toLowerCase()===c.side));return l?{organ:l,sex:null===(i=o.sex)||void 0===i?void 0:i.toLowerCase(),side:null===(r=o.side)||void 0===r?void 0:r.toLowerCase()}:void 0}};fc.\u0275fac=function(e){return new(e||fc)(I(v9),I(Ah))},fc.\u0275prov=ue({token:fc,factory:fc.\u0275fac}),fc=xe([xh(),cd({name:"reference",defaults:{organIRILookup:{},organSpatialEntities:{},anatomicalStructures:{},extractionSets:{},sceneNodeLookup:{},simpleSceneNodeLookup:{},placementPatches:{}}})],fc);const qF=g0;let ai=class extends Jm{constructor(e,t,i){super(),this.ga=e,this.injector=t,this.globalConfig=i,this.id$=this.state$.pipe(ur("id")),this.blockSize$=this.state$.pipe(ur("blockSize")),this.rotation$=this.state$.pipe(ur("rotation")),this.position$=this.state$.pipe(ur("position")),this.slicesConfig$=this.state$.pipe(ur("slicesConfig")),this.viewType$=this.state$.pipe(ur("viewType")),this.viewSide$=this.state$.pipe(ur("viewSide")),this.organ$=this.state$.pipe(ur("organ")),this.organIri$=this.state$.pipe(ur("organIri")),this.organDimensions$=this.state$.pipe(ur("organDimensions")),this.sex$=this.state$.pipe(ur("sex")),this.side$=this.state$.pipe(ur("side")),this.showPrevious$=this.state$.pipe(ur("showPrevious")),this.extractionSites$=this.state$.pipe(ur("extractionSites")),this.anatomicalStructures$=this.state$.pipe(ur("anatomicalStructures")),this.extractionSets$=this.state$.pipe(ur("extractionSets"))}get modelChanged$(){const e=["viewType","viewSide","showPrevious"],t=Object.keys(this.initialState).filter(i=>!e.includes(i));return this.state$.pipe(dW(0,void 0,{leading:!1,trailing:!0}),Zo((i,r)=>{for(const s of t)if(i[s]!==r[s])return!1;return!0}),e=>e.lift(new hRe(void 0)))}ngxsOnInit(){super.ngxsOnInit(),this.referenceData=this.injector.get(fc),this.page=this.injector.get(ji),this.globalConfig.getOption("organ").pipe(aF(),Pr(e=>{var t,i;const r=e.name.toLowerCase(),s=e.side;let a=this.idMatches(e.ontologyId,s);return a||(a=this.nameMatches(r,s)),a?(this.ctx.patchState({organ:a,sex:null===(t=e.sex)||void 0===t?void 0:t.toLowerCase(),side:null===(i=null==a?void 0:a.side)||void 0===i?void 0:i.toLowerCase()}),this.referenceData.state$.pipe(Zg(100),yi(1),Vk(200),Ti(()=>this.onOrganIriChange()))):ec})).subscribe(),this.modelChanged$.pipe(function(n){return e=>e.lift(new gRe(n))}(this.page.registrationStarted$.pipe(Fn(e=>e),Vk(5)))).subscribe(()=>this.page.setHasChanges())}idMatches(e,t){return g0.find(i=>!(!e||i.id!==e||i.side&&i.side!==t))}nameMatches(e,t){return g0.find(i=>i.side?i.organ.toLowerCase()===e&&i.side===t:i.organ.toLowerCase()===e)}setBlockSize(e){this.ctx.patchState({blockSize:e})}setRotation(e){this.ctx.patchState({rotation:e})}setPosition(e){var t;this.ga.event("placement",`${null===(t=this.snapshot.organ)||void 0===t?void 0:t.name}_placement`,`${e.x.toFixed(1)}_${e.y.toFixed(1)}_${e.z.toFixed(1)}`),this.ctx.patchState({position:e})}setSlicesConfig(e){this.ctx.patchState({slicesConfig:e})}setViewType(e){this.ctx.patchState({viewType:e})}setViewSide(e){this.ctx.patchState({viewSide:e})}get defaultPosition(){const e=this.snapshot.organDimensions;return{x:e.x+2*this.snapshot.blockSize.x,y:e.y/2,z:e.z/2}}setOrgan(e){this.ga.event("organ_select","organ",e.name),this.ctx.patchState({organ:e}),e.side&&this.ctx.patchState({side:e.side}),this.onOrganIriChange()}setSex(e){this.ctx.patchState({sex:e}),this.onOrganIriChange()}setSide(e){this.ctx.patchState({side:e}),this.onOrganIriChange()}setShowPrevious(e){this.ctx.patchState({showPrevious:e})}setExtractionSites(e){this.ctx.patchState({extractionSites:e})}setAnatomicalStructures(e){this.ctx.patchState({anatomicalStructures:e})}setExtractionSets(e){this.ctx.patchState({extractionSets:e})}toggleRegistrationBlocksVisibility(e,t){if(this.setShowPrevious(e),e){const i=t.map(r=>{var s;return Object.assign(Object.assign({},r),{opacity:Math.min(20,null!==(s=r.opacity)&&void 0!==s?s:20)})});this.setAnatomicalStructures(i)}else this.setAnatomicalStructures(t)}onOrganIriChange(){var e,t,i,r,s;const o=this.referenceData.getReferenceOrganIri((null===(e=this.snapshot.organ)||void 0===e?void 0:e.organ)||"",this.snapshot.sex,this.snapshot.side,this.snapshot.organ),a={x:100,y:100,z:100};if((null===(t=this.snapshot.organ)||void 0===t?void 0:t.sex)&&this.ctx.patchState({sex:null===(i=this.snapshot.organ)||void 0===i?void 0:i.sex}),o){const l=this.referenceData.snapshot,c={};for(const p of l.anatomicalStructures[o]||[]){const g=null!==(r=p.representation_of)&&void 0!==r?r:p["@id"];c[g]||(c[g]={id:null!==(s=p.representation_of)&&void 0!==s?s:p["@id"],name:p.label,visible:!0,opacity:20,tooltip:p.comment})}this.ctx.patchState({anatomicalStructures:Object.values(c)});const d=(l.extractionSets[o]||[]).map(p=>({name:p.label,sites:(0,uRe.sortBy)(p.extractionSites.map(g=>({id:g["@id"],name:g.label,visible:!1,opacity:0,tooltip:g.comment})),"name")}));this.ctx.patchState({extractionSets:d}),this.ctx.patchState({extractionSites:d.length>0?d[0].sites:[]});const f=l.organSpatialEntities[o];a.x=f.x_dimension,a.y=f.y_dimension,a.z=f.z_dimension}this.ctx.patchState({organIri:o,organDimensions:a}),this.ctx.patchState({position:this.defaultPosition})}};ai.\u0275fac=function(e){return new(e||ai)(I(xs),I(Nt),I(Ah))},ai.\u0275prov=ue({token:ai,factory:ai.\u0275fac}),xe([oi()],ai.prototype,"modelChanged$",null),xe([on()],ai.prototype,"setBlockSize",null),xe([on()],ai.prototype,"setRotation",null),xe([on()],ai.prototype,"setPosition",null),xe([on()],ai.prototype,"setSlicesConfig",null),xe([on()],ai.prototype,"setViewType",null),xe([on()],ai.prototype,"setViewSide",null),xe([oi()],ai.prototype,"defaultPosition",null),xe([on()],ai.prototype,"setOrgan",null),xe([on()],ai.prototype,"setSex",null),xe([on()],ai.prototype,"setSide",null),xe([on()],ai.prototype,"setShowPrevious",null),xe([on()],ai.prototype,"setExtractionSites",null),xe([on()],ai.prototype,"setAnatomicalStructures",null),xe([on()],ai.prototype,"setExtractionSets",null),ai=xe([xh(),cd({name:"model",defaults:{id:"",label:"",organ:{src:"",name:""},organIri:"",organDimensions:{x:90,y:90,z:90},sex:"male",side:"left",blockSize:{x:10,y:10,z:10},rotation:{x:0,y:0,z:0},position:{x:0,y:0,z:0},slicesConfig:{thickness:NaN,numSlices:NaN},viewType:"register",viewSide:"anterior",showPrevious:!1,extractionSites:[],anatomicalStructures:[],extractionSets:[]}})],ai);const T9=new ve("Default theme class");let YF=(()=>{class n{constructor(t){this.defaultTheme=this.theme=null!=t?t:""}static initialize(t){const{injector:i,location:r}=t;i.get(n).initialize(r,i)}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,i){this.element=t,this.injector=i,this.applyThemeClass(this.getTheme())}applyThemeClass(t,i="add"){var r;const{element:s,injector:o}=this;if(!t||!s||!o)return;const a=o.get(zc,null);if(!a)return;const l=s.nativeElement,c=null===(r=o.get(hm,null))||void 0===r?void 0:r.getContainerElement(),d="add"===i?"addClass":"removeClass";a[d](l,t),c&&a[d](c,t)}}return n.\u0275fac=function(t){return new(t||n)(I(T9,8))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})(),CRe=(()=>{class n{constructor(t){this.ga=t,this.clsName="ccf-name-input",this.firstNameValidator=new Sh("",[lG.required]),this.lastNameValidator=new Sh("",[lG.required]),this._name={firstName:"",lastName:""},this.nameChange=new Le}get name(){return this._name}set name(t){this._name=t,this.firstNameValidator.setValue((null==t?void 0:t.firstName)||""),this.lastNameValidator.setValue((null==t?void 0:t.lastName)||"")}updateName(t,i){const r=t.target;this.name=Object.assign(Object.assign({},this.name),{[i]:r.value}),this.ga.event("name_updated","name_input",i),this.nameChange.emit(this.name)}}return n.\u0275fac=function(t){return new(t||n)(E(xs))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-name-input"]],hostVars:2,hostBindings:function(t,i){2&t&&Rn(i.clsName)},inputs:{name:"name"},outputs:{nameChange:"nameChange"},decls:8,vars:2,consts:[[1,"field"],[1,"text","label"],["matInput","","matTooltip","Add your first name.",1,"input",3,"value","input"],["matInput","","matTooltip","Add your last name.",1,"input",3,"value","input"]],template:function(t,i){1&t&&(R(0,"mat-form-field",0),R(1,"mat-label",1),De(2,"First Name "),k(),R(3,"input",2),ge("input",function(s){return i.updateName(s,"firstName")}),k(),k(),R(4,"mat-form-field",0),R(5,"mat-label",1),De(6,"Last Name "),k(),R(7,"input",3),ge("input",function(s){return i.updateName(s,"lastName")}),k(),k()),2&t&&(G(3),ie("value",i.firstNameValidator.value),G(4),ie("value",i.lastNameValidator.value))},directives:[am,Gf,Xb,dc],styles:["[_nghost-%COMP%]{display:flex}[_nghost-%COMP%] .field[_ngcontent-%COMP%]:not(:last-child){padding-right:.75rem}[_nghost-%COMP%] .field[_ngcontent-%COMP%] .input[_ngcontent-%COMP%]{text-align:left;width:100%}"],changeDetection:0}),n})();const wRe=["thumbContainer"],ERe=["toggleBar"],SRe=["input"],MRe=function(n){return{enterDuration:n}},xRe=["*"],TRe=new ve("mat-slide-toggle-default-options",{providedIn:"root",factory:()=>({disableToggleValue:!1})});let ARe=0;const DRe={provide:ro,useExisting:T(()=>A9),multi:!0};class ORe{constructor(e,t){this.source=e,this.checked=t}}const IRe=Hf(Uf(nc(jf(class{constructor(n){this._elementRef=n}}))));let A9=(()=>{class n extends IRe{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-"+ ++ARe,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 Le,this.toggleChange=new Le,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=Mt(t)}get checked(){return this._checked}set checked(t){this._checked=Mt(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 ORe(this,this.checked))}_onLabelTextChange(){this._changeDetectorRef.detectChanges()}}return n.\u0275fac=function(t){return new(t||n)(E(rt),E(Sa),E(kn),Zr("tabindex"),E(TRe),E(Do,8))},n.\u0275cmp=Ne({type:n,selectors:[["mat-slide-toggle"]],viewQuery:function(t,i){if(1&t&&(Jn(wRe,5),Jn(ERe,5),Jn(SRe,5)),2&t){let r;_t(r=yt())&&(i._thumbEl=r.first),_t(r=yt())&&(i._thumbBarEl=r.first),_t(r=yt())&&(i._inputElement=r.first)}},hostAttrs:[1,"mat-slide-toggle"],hostVars:12,hostBindings:function(t,i){2&t&&(al("id",i.id),nn("tabindex",i.disabled?null:-1)("aria-label",null)("aria-labelledby",null),st("mat-checked",i.checked)("mat-disabled",i.disabled)("mat-slide-toggle-label-before","before"==i.labelPosition)("_mat-animation-noopable",i._noopAnimations))},inputs:{disabled:"disabled",disableRipple:"disableRipple",color:"color",tabIndex:"tabIndex",name:"name",id:"id",labelPosition:"labelPosition",ariaLabel:["aria-label","ariaLabel"],ariaLabelledby:["aria-labelledby","ariaLabelledby"],required:"required",checked:"checked",ariaDescribedby:["aria-describedby","ariaDescribedby"]},outputs:{change:"change",toggleChange:"toggleChange"},exportAs:["matSlideToggle"],features:[Dt([DRe]),ct],ngContentSelectors:xRe,decls:16,vars:20,consts:[[1,"mat-slide-toggle-label"],["label",""],[1,"mat-slide-toggle-bar"],["toggleBar",""],["type","checkbox","role","switch",1,"mat-slide-toggle-input","cdk-visually-hidden",3,"id","required","tabIndex","checked","disabled","change","click"],["input",""],[1,"mat-slide-toggle-thumb-container"],["thumbContainer",""],[1,"mat-slide-toggle-thumb"],["mat-ripple","",1,"mat-slide-toggle-ripple","mat-focus-indicator",3,"matRippleTrigger","matRippleDisabled","matRippleCentered","matRippleRadius","matRippleAnimation"],[1,"mat-ripple-element","mat-slide-toggle-persistent-ripple"],[1,"mat-slide-toggle-content",3,"cdkObserveContent"],["labelContent",""],[2,"display","none"]],template:function(t,i){if(1&t&&(wi(),R(0,"label",0,1),R(2,"div",2,3),R(4,"input",4,5),ge("change",function(s){return i._onChangeEvent(s)})("click",function(s){return i._onInputClick(s)}),k(),R(6,"div",6,7),tt(8,"div",8),R(9,"div",9),tt(10,"div",10),k(),k(),k(),R(11,"span",11,12),ge("cdkObserveContent",function(){return i._onLabelTextChange()}),R(13,"span",13),De(14,"\xa0"),k(),Ht(15),k(),k()),2&t){const r=vs(1),s=vs(12);nn("for",i.inputId),G(2),st("mat-slide-toggle-bar-no-side-margin",!s.textContent||!s.textContent.trim()),G(2),ie("id",i.inputId)("required",i.required)("tabIndex",i.tabIndex)("checked",i.checked)("disabled",i.disabled),nn("name",i.name)("aria-checked",i.checked.toString())("aria-label",i.ariaLabel)("aria-labelledby",i.ariaLabelledby)("aria-describedby",i.ariaDescribedby),G(5),ie("matRippleTrigger",r)("matRippleDisabled",i.disableRipple||i.disabled)("matRippleCentered",!0)("matRippleRadius",20)("matRippleAnimation",Hg(18,MRe,i._noopAnimations?0:150))}},directives:[Js,WD],styles:[".mat-slide-toggle{display:inline-block;height:24px;max-width:100%;line-height:24px;white-space:nowrap;outline:none;-webkit-tap-highlight-color:transparent}.mat-slide-toggle.mat-checked .mat-slide-toggle-thumb-container{transform:translate3d(16px, 0, 0)}[dir=rtl] .mat-slide-toggle.mat-checked .mat-slide-toggle-thumb-container{transform:translate3d(-16px, 0, 0)}.mat-slide-toggle.mat-disabled{opacity:.38}.mat-slide-toggle.mat-disabled .mat-slide-toggle-label,.mat-slide-toggle.mat-disabled .mat-slide-toggle-thumb-container{cursor:default}.mat-slide-toggle-label{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:flex;flex:1;flex-direction:row;align-items:center;height:inherit;cursor:pointer}.mat-slide-toggle-content{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mat-slide-toggle-label-before .mat-slide-toggle-label{order:1}.mat-slide-toggle-label-before .mat-slide-toggle-bar{order:2}[dir=rtl] .mat-slide-toggle-label-before .mat-slide-toggle-bar,.mat-slide-toggle-bar{margin-right:8px;margin-left:0}[dir=rtl] .mat-slide-toggle-bar,.mat-slide-toggle-label-before .mat-slide-toggle-bar{margin-left:8px;margin-right:0}.mat-slide-toggle-bar-no-side-margin{margin-left:0;margin-right:0}.mat-slide-toggle-thumb-container{position:absolute;z-index:1;width:20px;height:20px;top:-3px;left:0;transform:translate3d(0, 0, 0);transition:all 80ms linear;transition-property:transform}._mat-animation-noopable .mat-slide-toggle-thumb-container{transition:none}[dir=rtl] .mat-slide-toggle-thumb-container{left:auto;right:0}.mat-slide-toggle-thumb{height:20px;width:20px;border-radius:50%}.mat-slide-toggle-bar{position:relative;width:36px;height:14px;flex-shrink:0;border-radius:8px}.mat-slide-toggle-input{bottom:0;left:10px}[dir=rtl] .mat-slide-toggle-input{left:auto;right:10px}.mat-slide-toggle-bar,.mat-slide-toggle-thumb{transition:all 80ms linear;transition-property:background-color;transition-delay:50ms}._mat-animation-noopable .mat-slide-toggle-bar,._mat-animation-noopable .mat-slide-toggle-thumb{transition:none}.mat-slide-toggle .mat-slide-toggle-ripple{position:absolute;top:calc(50% - 20px);left:calc(50% - 20px);height:40px;width:40px;z-index:1;pointer-events:none}.mat-slide-toggle .mat-slide-toggle-ripple .mat-ripple-element:not(.mat-slide-toggle-persistent-ripple){opacity:.12}.mat-slide-toggle-persistent-ripple{width:100%;height:100%;transform:none}.mat-slide-toggle-bar:hover .mat-slide-toggle-persistent-ripple{opacity:.04}.mat-slide-toggle:not(.mat-disabled).cdk-keyboard-focused .mat-slide-toggle-persistent-ripple{opacity:.12}.mat-slide-toggle-persistent-ripple,.mat-slide-toggle.mat-disabled .mat-slide-toggle-bar:hover .mat-slide-toggle-persistent-ripple{opacity:0}@media(hover: none){.mat-slide-toggle-bar:hover .mat-slide-toggle-persistent-ripple{display:none}}.cdk-high-contrast-active .mat-slide-toggle-thumb,.cdk-high-contrast-active .mat-slide-toggle-bar{border:1px solid}.cdk-high-contrast-active .mat-slide-toggle.cdk-keyboard-focused .mat-slide-toggle-bar{outline:2px dotted;outline-offset:5px}\n"],encapsulation:2,changeDetection:0}),n})(),D9=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({}),n})(),O9=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[D9,_l,On,SE],D9,On]}),n})(),XF=(()=>{class n{constructor(t){this.ga=t,this.clsName="ccf-labeled-slide-toggle",this.labels=["Left","Right"],this.value="Left",this.disabled=!1,this.valueChange=new Le}get left(){const{value:t,labels:i}=this;return t!==i[1]}updateToggle(t){this.value=t?this.labels[0]:this.labels[1],this.ga.event("slide_toggle_toggled","slide_toggle",this.value),this.valueChange.emit(this.value)}}return n.\u0275fac=function(t){return new(t||n)(E(xs))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-labeled-slide-toggle"]],hostVars:2,hostBindings:function(t,i){2&t&&Rn(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=Zi();R(0,"span",0),ge("click",function(){en(r);const o=vs(3);return i.left||o.toggle(),i.updateToggle(!0)}),De(1),k(),R(2,"mat-slide-toggle",1,2),ge("change",function(o){return i.updateToggle(!o.checked)}),k(),R(4,"span",0),ge("click",function(){en(r);const o=vs(3);return i.left&&o.toggle(),i.updateToggle(!1)}),De(5),k()}2&t&&(st("disabled",i.disabled)("highlighted",i.left),G(1),xi(i.labels[0]),G(1),ie("disabled",i.disabled)("checked",!i.left),G(2),st("disabled",i.disabled)("highlighted",!i.left),G(1),xi(i.labels[1]))},directives:[A9],styles:["[_nghost-%COMP%] .slide-label[_ngcontent-%COMP%]{margin:0 1rem;transition:color .6s;cursor:pointer}[_nghost-%COMP%] .disabled[_ngcontent-%COMP%]{opacity:30%;cursor:not-allowed}"],changeDetection:0}),n})();const kRe=function(){return["Male","Female"]},FRe=function(n){return[n]};let NRe=(()=>{class n{constructor(t,i,r){this.page=t,this.model=i,this.dialogRef=r,this.clsName="ccf-registration-content",this.sexByLabel$=this.model.sex$.pipe(Ae(s=>"female"===s?"Female":"Male")),this.organList=qF,r.disableClose=!0}setSexFromLabel(t){this.currentSex=t,this.sexSelected=!0}checkNameValid(t){this.nameValid=t.firstName.length>0&&t.lastName.length>0}organSelect(t){this.currentOrgan=t,this.organSelected=!0}registerButtonClick(t){t&&t.preventDefault(),this.organSelected&&this.nameValid&&this.closeDialog()}closeDialog(){this.model.setSex("Female"===this.currentSex?"female":"male"),this.model.setOrgan(this.currentOrgan),this.dialogRef.close(!0),this.page.registrationStarted()}}return n.\u0275fac=function(t){return new(t||n)(E(ji),E(ai),E(Qm))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-registration-content"]],hostVars:2,hostBindings:function(t,i){2&t&&Rn(i.clsName)},decls:17,vars:18,consts:[[1,"modal"],["mat-dialog-content",""],[3,"name","nameChange"],["matTooltip","Select sex to filter organs.",1,"organ-sliders"],[1,"slider-label"],[1,"toggle","gender",3,"labels","value","valueChange"],[1,"selector-label"],[1,"selector-container"],[3,"organList","selectedOrgans","expanded","organsChanged"],["organSelector",""],["mat-button","",1,"registration-button",3,"matTooltip","click"]],template:function(t,i){1&t&&(R(0,"div",0),R(1,"div",1),R(2,"ccf-name-input",2),ge("nameChange",function(s){return i.page.setUserName(s),i.checkNameValid(s)}),Kt(3,"async"),k(),R(4,"div",3),R(5,"div",4),De(6,"Donor Sex:"),k(),R(7,"ccf-labeled-slide-toggle",5),ge("valueChange",function(s){return i.setSexFromLabel(s)}),Kt(8,"async"),k(),k(),R(9,"div",6),De(10,"Select an organ"),k(),R(11,"div",7),R(12,"ccf-organ-selector",8,9),ge("organsChanged",function(s){return i.organSelect(s[0])}),Kt(14,"async"),k(),k(),k(),R(15,"button",10),ge("click",function(s){return i.registerButtonClick(s)}),De(16,"START REGISTRATION"),k(),k()),2&t&&(G(2),ie("name",rn(3,9,i.page.user$)),G(5),ie("labels",fv(15,kRe))("value",rn(8,11,i.sexByLabel$)),G(5),ie("organList",i.organList)("selectedOrgans",Hg(16,FRe,rn(14,13,i.model.organ$)))("expanded",!0),G(3),st("disabled",!i.organSelected||!i.nameValid),ie("matTooltip",i.organSelected&&i.nameValid?"":"Required: Enter first and last name, and select an organ"))},directives:[CRe,dc,XF,p9,lh],pipes:[Hc],styles:[".modal[_ngcontent-%COMP%]{padding:1rem;border-radius:4px;max-width:47rem}.modal[_ngcontent-%COMP%] .organ-sliders[_ngcontent-%COMP%]{display:flex;height:3rem;align-items:center}.modal[_ngcontent-%COMP%] .organ-sliders[_ngcontent-%COMP%] .slider-label[_ngcontent-%COMP%]{font-weight:600}.modal[_ngcontent-%COMP%] .selector-label[_ngcontent-%COMP%]{font-weight:600;height:3rem;line-height:3rem}.modal[_ngcontent-%COMP%] .selector-container[_ngcontent-%COMP%]{margin:0 auto}.modal[_ngcontent-%COMP%] .registration-button[_ngcontent-%COMP%]{display:block;margin:2rem auto 0;transition:.6s}.modal[_ngcontent-%COMP%] .registration-button.disabled[_ngcontent-%COMP%]{pointer-events:none}"],changeDetection:0}),n})(),LRe=(()=>{class n{constructor(t,i,r){this.dialog=t,this.page=i,this.model=r,this.clsName="ccf-registration-modal"}ngOnInit(){Qi([this.page.user$,this.model.organ$]).pipe(Zg(500),yi(1),Ti(([t,i])=>{""!==t.firstName&&""!==t.lastName&&""!==i.src||this.openDialog()})).subscribe()}openDialog(){this.dialog.open(NRe,{autoFocus:!1})}}return n.\u0275fac=function(t){return new(t||n)(E(_p),E(ji),E(ai))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-registration-modal"]],hostVars:2,hostBindings:function(t,i){2&t&&Rn(i.clsName)},decls:0,vars:0,template:function(t,i){},encapsulation:2}),n})();function BRe(n,e){1&n&&function(n,e,t){_f(n,e,t),yf()}(0)}function VRe(n,e){if(1&n){const t=Zi();R(0,"div",4),ge("click",function(){return en(t),Qe().page.cancelRegistration()}),R(1,"mat-icon",5),De(2,"chevron_left"),k(),R(3,"span",6),De(4,"BACK"),k(),k()}}function zRe(n,e){if(1&n&&(R(0,"a",7),tt(1,"div",8),k()),2&n){const t=Qe();ie("href",t.homeUrl,Ud)("matTooltip",t.logoTooltip)}}let jRe=(()=>{class n{constructor(t){this.page=t,this.clsName="ccf-header"}}return n.\u0275fac=function(t){return new(t||n)(E(ji))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-header"]],hostVars:2,hostBindings:function(t,i){2&t&&Rn(i.clsName)},inputs:{homeUrl:"homeUrl",logoTooltip:"logoTooltip"},decls:7,vars:5,consts:[[4,"ngIf","ngIfThen","ngIfElse"],["backButton",""],["logo",""],[1,"filler"],["rel","noreferrer noopener",1,"link","home",3,"click"],[1,"icon","backbutton"],[1,"text"],["rel","noreferrer noopener","matTooltipPosition","right",1,"link","portal",3,"href","matTooltip"],["aria-hidden","false","aria-label","Reset tool",1,"logo"]],template:function(t,i){if(1&t&&(mt(0,BRe,1,0,"ng-container",0),Kt(1,"async"),mt(2,VRe,5,0,"ng-template",null,1,jw),mt(4,zRe,2,2,"ng-template",null,2,jw),tt(6,"div",3)),2&t){const r=vs(3),s=vs(5);ie("ngIf",rn(1,3,i.page.useCancelRegistrationCallback$))("ngIfThen",r)("ngIfElse",s)}},directives:[zr,rs,dc],pipes:[Hc],styles:["[_nghost-%COMP%]{display:flex;align-items:center;min-height:4rem;padding:0 1.5rem;border-bottom-width:1px;border-bottom-style:solid}[_nghost-%COMP%] .text[_ngcontent-%COMP%]{padding:.25rem 0;height:2rem;display:flex;align-items:center;font-weight:lighter;font-size:1.5rem}[_nghost-%COMP%] .link[_ngcontent-%COMP%]{display:flex;align-items:center;cursor:pointer;text-decoration:none;padding:.25rem 0}[_nghost-%COMP%] .home[_ngcontent-%COMP%] *[_ngcontent-%COMP%]{transition:color .6s}[_nghost-%COMP%] .home[_ngcontent-%COMP%] .backbutton[_ngcontent-%COMP%]{font-size:2.25rem;width:2.25rem;height:2.25rem}[_nghost-%COMP%] .portal[_ngcontent-%COMP%]{height:100%;width:25rem;align-items:center;display:flex}[_nghost-%COMP%] .logo[_ngcontent-%COMP%]{width:100%;height:50%;background-repeat:no-repeat;background-size:contain}[_nghost-%COMP%] .filler[_ngcontent-%COMP%]{flex-grow:1;margin:0}"],changeDetection:0}),n})();const I9={isolated:!0},P9=new ve("Message service configuration",{providedIn:"root",factory:()=>I9});let URe=(()=>{class n{constructor(t,i,r){this.source=t,this.channel=i,this.messages=r}sendMessage(t){this.channel.next({id:this.nextMessageId(),source:this.source,payload:t})}getMessages(){return this.messages.pipe(Fn(t=>t.source!==this.source))}getMessagesFromSource(t){return this.getMessages().pipe(Fn(i=>i.source===t))}getMessagesFromSources(t){return this.getMessages().pipe(Fn(i=>t.includes(i.source)))}nextMessageId(){return n.counter++}}return n.counter=0,n})();const _0=(()=>{class n{constructor(t,i){this.config=t,this.parent=i,this.channel=new Se,this.messages=t.isolated||!i?this.channel.asObservable():ui([this.channel,i.messages.pipe(qj(()=>!this.channel.closed))]).pipe(uo())}ngOnDestroy(){this.channel.complete()}connect(t){return new URe(t,this.channel,this.messages)}}return n.\u0275fac=function(t){return new(t||n)(I(P9),I(n,12))},n.\u0275prov=ue({token:n,factory:n.\u0275fac,providedIn:"root"}),n})(),HRe=["*"];let bx=(()=>{class n{constructor(t,i){this.className="ccf-drawer-content",this.animationsEnabled=!1,this.leftMargin=0,this.rightMargin=0,this.faded=!1,this.drawers=[],this.subscriptions=new Te;const r=t.connect(this).getMessages();this.subscriptions.add(r.subscribe(s=>{this.handleMessage(s)&&i.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 i=t.source.position,{opened:r,width:s,margin:o}=t.payload;return this.updateMargin(i,r,s,o),this.updateFaded(),!0}default:return!1}}updateMargin(t,i,r,s){const o=i?r+s:s;"start"===t?this.leftMargin=o:this.rightMargin=o}updateFaded(){const[t,i]=this.drawers;this.faded=!!((null==t?void 0:t.opened)&&(null==t?void 0:t.expanded)||(null==i?void 0:i.opened)&&(null==i?void 0:i.expanded))}}return n.\u0275fac=function(t){return new(t||n)(E(_0),E(kn))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-drawer-content"]],hostVars:9,hostBindings:function(t,i){2&t&&(Pg("@fadeInOut",i.faded),Rn(i.className),vf("margin-left",i.leftMargin,"px")("margin-right",i.rightMargin,"px"),st("cff-drawer-content-animations",i.animationsEnabled))},ngContentSelectors:HRe,decls:1,vars:0,template:function(t,i){1&t&&(wi(),Ht(0))},styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;height:100%;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:[tc("fadeInOut",[wr("false",ti({opacity:1})),wr("true",ti({opacity:0})),Qs("false <=> true",Ao("1s"))])]},changeDetection:0}),n})();const $Re=["*"],KF={params:{width:0,margin:0,margin2:0}};class GRe{constructor(){this.initialized=!1,this.deferred=new Promise(e=>{this.resolve=e})}set(){this.initialized=!0,this.resolve()}wait(){return yl(this,void 0,void 0,function*(){return this.deferred})}valueOf(){return this.initialized}}let ZF=(()=>{class n{constructor(t,i,r){this.element=r,this.className="ccf-drawer",this._position="start",this._opened=!1,this._expanded=!1,this.openedChange=new Le(!0),this.expandedChange=new Le(!0),this.stateChange=new Le(!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 GRe,this.subscriptions=new Te,this.channel=t.connect(this),this.subscriptions.add(this.channel.getMessages().subscribe(s=>{this.handleMessage(s)&&i.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(Mt(t))}get expanded(){return this._expanded}set expanded(t){this.toggleExpanded(Mt(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 i=t.getBoundingClientRect(),r=i.right-i.left;return 0===r?0:(this._measuredWidth=r,r)}get measuredMargin(){if(this._measuredMargin>0)return this._measuredMargin;const t=this.element.nativeElement;if(!t)return 0;const s=globalThis.getComputedStyle(t).getPropertyValue("start"===this.position?"margin-right":"margin-left"),o=Number(s.slice(0,-2));return this._measuredMargin=o,o}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 yl(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 n.\u0275fac=function(t){return new(t||n)(E(_0),E(kn),E(rt))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-drawer"]],hostVars:10,hostBindings:function(t,i){1&t&&Qy("@openClose.done",function(){return i.closeOpenDone()})("@expandCollapse.done",function(){return i.expandCollapseDone()}),2&t&&(Pg("@openClose",i.openedState)("@expandCollapse",i.expandedStateObj),Rn(i.className),st("ccf-drawer-end",i.classEnd)("ccf-drawer-opened",i.opened)("ccf-drawer-expanded",i.expanded))},inputs:{position:"position",opened:"opened",expanded:"expanded"},outputs:{openedChange:"openedChange",expandedChange:"expandedChange",stateChange:"stateChange"},exportAs:["ccfDrawer"],ngContentSelectors:$Re,decls:2,vars:0,consts:[[1,"cff-drawer-inner-container"]],template:function(t,i){1&t&&(wi(),R(0,"div",0),Ht(1),k())},styles:["[_nghost-%COMP%]{display:block;position:absolute;top:0;bottom:0;z-index:2;outline:0;transform:translate(-100%)}.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:[tc("openClose",[wr("open, open-instant",ti({transform:"none"})),wr("closed",ti({})),Qs("closed => open-instant",Ao(0)),Qs("closed <=> open, open-instant => closed",Ao(".5s ease-in-out"))]),tc("expandCollapse",[wr("collapsed",ti({})),wr("half",ti({width:"calc(50% - {{ margin }}px)"}),KF),wr("extended",ti({width:"calc(100% - {{ width }}px - {{ margin }}px)"}),KF),wr("full",ti({width:"calc(100% - {{ margin }}px - {{ margin2 }}px)"}),KF),Qs("* <=> *",Ao(".5s ease-in-out"))])]},changeDetection:0}),n})();function WRe(n,e){1&n&&(R(0,"ccf-drawer-content"),Ht(1,2),k())}const qRe=[[["ccf-drawer"]],[["ccf-drawer-content"]],"*"],YRe=["ccf-drawer","ccf-drawer-content","*"];function R9(n){throw new Error(`Multiple drawers in position ${n}`)}let XRe=(()=>{class n{constructor(t,i){this.cdr=i,this.className="ccf-drawer-container",this.subscriptions=new Te,this.channel=t.connect(this),this.subscriptions.add(this.channel.getMessages().subscribe(r=>{this.handleMessage(r)&&i.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(Rr(null)).subscribe(()=>{const t=this.validateDrawers();this.channel.sendMessage({type:"drawer-containers-changed",drawers:t}),this.cdr.markForCheck()}),this.content1.changes.pipe(Rr(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(),i=t.filter(s=>"start"===s.position),r=t.filter(s=>"end"===s.position);return i.length>1&&R9("start"),r.length>1&&R9("end"),[i[0],r[0]]}}return n.\u0275fac=function(t){return new(t||n)(E(_0),E(kn))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-drawer-container"]],contentQueries:function(t,i,r){if(1&t&&(ei(r,ZF,5),ei(r,bx,5)),2&t){let s;_t(s=yt())&&(i.drawers=s),_t(s=yt())&&(i.content1=s)}},viewQuery:function(t,i){if(1&t&&Jn(bx,5),2&t){let r;_t(r=yt())&&(i.content2=r)}},hostVars:2,hostBindings:function(t,i){2&t&&Rn(i.className)},exportAs:["ccfDrawerContainer"],features:[Dt([_0])],ngContentSelectors:YRe,decls:3,vars:1,consts:[[4,"ngIf"]],template:function(t,i){1&t&&(wi(qRe),Ht(0),Ht(1,1),mt(2,WRe,2,0,"ccf-drawer-content",0)),2&t&&(G(2),ie("ngIf",!i.hasWrappedContent))},directives:[zr,bx],styles:["[_nghost-%COMP%]{display:block;position:relative;z-index:1;overflow:hidden;-webkit-overflow-scrolling:touch}"],changeDetection:0}),n})();var Cx,KRe=ze(457),ZRe=new Uint8Array(16);function QRe(){if(!Cx&&!(Cx="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Cx(ZRe)}const JRe=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,tke=function(n){return"string"==typeof n&&JRe.test(n)};for(var Ls=[],QF=0;QF<256;++QF)Ls.push((QF+256).toString(16).substr(1));const ske=function(n,e,t){var i=(n=n||{}).random||(n.rng||QRe)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,e){t=t||0;for(var r=0;r<16;++r)e[t+r]=i[r];return e}return function(n){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,t=(Ls[n[e+0]]+Ls[n[e+1]]+Ls[n[e+2]]+Ls[n[e+3]]+"-"+Ls[n[e+4]]+Ls[n[e+5]]+"-"+Ls[n[e+6]]+Ls[n[e+7]]+"-"+Ls[n[e+8]]+Ls[n[e+9]]+"-"+Ls[n[e+10]]+Ls[n[e+11]]+Ls[n[e+12]]+Ls[n[e+13]]+Ls[n[e+14]]+Ls[n[e+15]]).toLowerCase();if(!tke(t))throw TypeError("Stringified UUID is invalid");return t}(i)};function k9(n){const e=new $t(n.transformMatrix),t=e.transformAsPoint([-1,-1,-1],[]),i=e.transformAsPoint([1,1,1],[]);return new Di({lowerBound:new S(...t.map((r,s)=>Math.min(r,i[s]))),upperBound:new S(...i.map((r,s)=>Math.max(r,t[s])))})}let as=class extends Jm{constructor(e){super(),this.injector=e,this.gizmo$=ht([{"@id":"http://purl.org/ccf/latest/ccf.owl#VHMaleOrgans_VHM_Spleen_Colic_Surface","@type":"SpatialSceneNode",scenegraph:"https://hubmapconsortium.github.io/ccf-3d-reference-object-library/Assets/body4Mesh_1338.glb",transformMatrix:new $t($t.IDENTITY).scale([2,2,2]).rotateY(ib(0)),tooltip:"Gizmo",unpickable:!0,_lighting:"pbr",zoomBasedOpacity:!1,color:[255,255,255,255],opacity:1}])}get nodes$(){return Qi([this.placementCube$,this.referenceOrganNodes$,this.previousRegistrationNodes$,this.nodeCollisions$]).pipe(Ae(([e,t,i,r])=>[...e,...i,...t,...this.snapshot.showCollisions?r:[]]))}get rotatedNodes$(){return Qi([this.rotation$,this.nodes$]).pipe(Ae(([e,t])=>0===e?t:t.map(i=>Object.assign(Object.assign({},i),{transformMatrix:new $t($t.IDENTITY).rotateY(ib(e)).multiplyRight(i.transformMatrix)}))))}get referenceOrganNodes$(){return Qi([this.model.anatomicalStructures$,this.model.extractionSites$,this.model.organIri$]).pipe(Zg(400),Ae(([e,t,i])=>this.createSceneNodes(i,[...e,...t])))}get referenceOrganSimpleNodes$(){return Qi([this.model.anatomicalStructures$,this.model.organIri$,this.referenceData.state$]).pipe(Ae(([e,t,i])=>e.map(r=>{var s;return i.sceneNodeLookup[r.id]?[Object.assign(Object.assign({},i.simpleSceneNodeLookup[r.id]),{opacity:(null!==(s=r.opacity)&&void 0!==s?s:100)/100,color:[255,255,255,255]})]:(i.anatomicalStructures[t]||[]).filter(o=>o.representation_of===r.id).map(o=>{var a;return Object.assign(Object.assign({},i.simpleSceneNodeLookup[o["@id"]]),{opacity:(null!==(a=r.opacity)&&void 0!==a?a:100)/100,color:[255,255,255,255]})})}).reduce((r,s)=>r.concat(s),[])))}get nodeCollisions$(){return Qi([this.referenceOrganSimpleNodes$,this.placementCube$]).pipe(Fn(([e,t])=>t.length>0),Ae(([e,t])=>{const i=k9(t[0]);return e.filter(r=>i.overlaps(k9(r)))}))}get previousRegistrationNodes$(){return Qi([this.model.organIri$,this.model.showPrevious$,this.registration.previousRegistrations$]).pipe(Ae(([e,t,i])=>t?i.map(r=>{const s=Array.isArray(r.placement)?r.placement[0]:r.placement;if(s.target===e){const o=this.model.snapshot.organDimensions,a=[o.x,o.y,o.z].map(l=>-l/1e3/2);return{"@id":r["@id"],"@type":"SpatialSceneNode",transformMatrix:new $t($t.IDENTITY).translate([s.x_translation,s.y_translation,s.z_translation].map((l,c)=>l/1e3+a[c])).rotateXYZ([s.x_rotation,s.y_rotation,s.z_rotation].map(ib)).scale([r.x_dimension,r.y_dimension,r.z_dimension].map(l=>l/1e3/2)),color:[25,118,210,200],tooltip:r.label,unpickable:!0}}}).filter(r=>!!r):[]))}get placementCube$(){return Qi([this.model.viewType$,this.model.blockSize$,this.model.rotation$,this.model.position$,this.model.organ$]).pipe(Ae(([e,t,i,r,s])=>""===s.src?[]:[this.placementCube]))}get placementCube(){const{viewType:e,blockSize:t,rotation:i,position:r,organDimensions:s}=this.model.snapshot,o=[s.x,s.y,s.z].map(a=>-a/1e3/2);return{"@id":"#DraftPlacement","@type":"SpatialSceneNode",transformMatrix:new $t($t.IDENTITY).translate([r.x,r.y,r.z].map((a,l)=>a/1e3+o[l])).rotateXYZ([i.x,i.y,i.z].map(ib)).scale([t.x,t.y,t.z].map(a=>a/1e3/2)),color:[255,255,0,200],tooltip:"Draft Placement",unpickable:"3d"===e}}get rotation$(){return this.model.viewSide$.pipe(Ae(e=>{let t=0;switch(e){case"left":t=-90;break;case"right":t=90;break;case"posterior":t=180}return t}))}ngxsOnInit(){super.ngxsOnInit(),this.model=this.injector.get(ai),this.registration=this.injector.get(Sr),this.referenceData=this.injector.get(fc)}createSceneNodes(e,t){const i=this.referenceData.snapshot;return t.filter(r=>r.visible&&r.opacity&&r.opacity>0).map(r=>{var s;return i.sceneNodeLookup[r.id]?[Object.assign(Object.assign({},i.sceneNodeLookup[r.id]),{opacity:(null!==(s=r.opacity)&&void 0!==s?s:100)/100,color:[255,255,255,255]})]:(i.anatomicalStructures[e]||[]).filter(o=>o.representation_of===r.id).map(o=>{var a;return Object.assign(Object.assign({},i.sceneNodeLookup[o["@id"]]),{opacity:(null!==(a=r.opacity)&&void 0!==a?a:100)/100,color:[255,255,255,255]})})}).reduce((r,s)=>r.concat(s),[])}};as.\u0275fac=function(e){return new(e||as)(I(Nt))},as.\u0275prov=ue({token:as,factory:as.\u0275fac}),xe([oi()],as.prototype,"nodes$",null),xe([oi()],as.prototype,"rotatedNodes$",null),xe([oi()],as.prototype,"referenceOrganNodes$",null),xe([oi()],as.prototype,"referenceOrganSimpleNodes$",null),xe([oi()],as.prototype,"nodeCollisions$",null),xe([oi()],as.prototype,"previousRegistrationNodes$",null),xe([oi()],as.prototype,"placementCube$",null),xe([oi()],as.prototype,"placementCube",null),xe([oi()],as.prototype,"rotation$",null),as=xe([xh(),cd({name:"scene",defaults:{showCollisions:!hu.production}})],as);let ko=class extends uDe{constructor(e){super(),this.injector=e,this._latestTags=[]}get tags$(){return Qi([this.entities$,this.scene.nodeCollisions$]).pipe(Ae(([e,t])=>{const i=[],r=new Set,s=new Set;Object.entries(e).forEach(([o,a])=>{"removed"===a.type?s.add(o):(r.add(o),i.push(a))});for(const o of t){const a=o.representation_of;a&&!s.has(a)&&!r.has(a)&&(r.add(a),i.push({id:a,label:o.tooltip,type:"assigned"}))}return i}))}get latestTags(){return this._latestTags}ngxsOnInit(){super.ngxsOnInit(),this.model=this.injector.get(ai),this.scene=this.injector.get(as),this.page=this.injector.get(ji),this.tags$.subscribe(e=>{this._latestTags=e}),this.entities$.subscribe(()=>this.page.setHasChanges())}addTags(e){for(const t of e)this.addTagRaw(t)}addTag(e){this.addTagRaw(e)}removeTag(e){this.snapshot.entities[e.id]?this.updateEntitiesMany([{id:e.id,changes:{type:"removed"}}]):this.addEntityOne(Object.assign(Object.assign({},e),{type:"removed"}))}searchExternal(e,t){const i=this.model.snapshot.anatomicalStructures.filter(r=>-1!==r.name.toLowerCase().indexOf(e.toLowerCase()));return[{totalCount:i.length,results:i.map(r=>({id:r.id,label:r.name,type:"added"})).slice(0,t)}]}addTagRaw(e){this.snapshot.entities[e.id]?this.updateEntitiesMany([{id:e.id,changes:{type:"added"}}]):this.addEntityOne(Object.assign(Object.assign({},e),{type:"added"}))}};ko.\u0275fac=function(e){return new(e||ko)(I(Nt))},ko.\u0275prov=ue({token:ko,factory:ko.\u0275fac}),xe([oi()],ko.prototype,"tags$",null),xe([on()],ko.prototype,"addTags",null),xe([on()],ko.prototype,"addTag",null),xe([on()],ko.prototype,"removeTag",null),xe([lu.ak],ko.prototype,"searchExternal",null),ko=xe([xh(),cd({name:"tags",defaults:Object.assign({},{ids:[],entities:{}})})],ko);let Sr=class extends Jm{constructor(e,t){super(),this.injector=e,this.globalConfig=t,this.displayErrors$=this.state$.pipe(ur("displayErrors"))}get metadata$(){return Qi([this.page.state$,this.model.state$,this.tags.tags$]).pipe(Ae(([e,t,i])=>this.buildMetadata(e,t,i)))}get jsonld$(){return Qi([this.page.state$,this.model.state$,this.tags.tags$]).pipe(Ae(([e,t,i])=>this.buildJsonLd(e,t,i)))}get valid$(){return Qi([this.page.state$,this.model.state$]).pipe(Ae(()=>this.isValid))}get previousRegistrations$(){const{globalConfig:e,state$:t}=this;return Qi([t.pipe(ur("registrations")),e.getOption("fetchPreviousRegistrations").pipe(Pr(s=>{var o;return null!==(o=null==s?void 0:s())&&void 0!==o?o:[[]]}),Rr([]))]).pipe(Ae(([s,o])=>[...s,...o]))}get currentIdentifier(){return ske()}get currentDate(){return(new Date).toISOString().split("T")[0]}ngxsOnInit(){super.ngxsOnInit(),this.page=this.injector.get(ji),this.model=this.injector.get(ai),this.tags=this.injector.get(ko),this.refData=this.injector.get(fc),this.globalConfig.config$.pipe(yi(1),Ti(({useDownload:e,register:t})=>this.ctx.patchState({useRegistrationCallback:!(e||!t)}))).subscribe(),this.globalConfig.getOption("editRegistration").pipe(aF(),Ti(e=>this.editRegistration(e))).subscribe()}editRegistration(e){return yl(this,void 0,void 0,function*(){const t=this.refData.normalizePlacement(Array.isArray(e.placement)?e.placement[0]:e.placement),i=this.refData.getOrganData(t.target);this.page.setUserName({firstName:e.creator_first_name,lastName:e.creator_last_name}),i&&(this.model.setOrgan(i.organ),i.sex&&this.model.setSex(i.sex),i.side&&this.model.setSide(i.side)),this.model.setBlockSize({x:e.x_dimension,y:e.y_dimension,z:e.z_dimension}),this.model.setRotation({x:t.x_rotation,y:t.y_rotation,z:t.z_rotation}),this.model.setSlicesConfig({thickness:e.slice_thickness||NaN,numSlices:e.slice_count||NaN}),yield new Promise(s=>{setTimeout(s,1e3)}),this.model.setPosition({x:t.x_translation,y:t.y_translation,z:t.z_translation});const r=new Set(e.ccf_annotations);this.tags.addTags(this.model.snapshot.anatomicalStructures.filter(s=>r.has(s.id)).map(s=>({id:s.id,label:s.name,type:"added"}))),this.page.registrationStarted()})}setUseRegistrationCallback(e){this.ctx.patchState({useRegistrationCallback:e})}setDisplayErrors(e){this.ctx.patchState({displayErrors:e})}addRegistration(e){this.ctx.setState(m0({registrations:vRe(e)}))}isDataValid(e,t){return[e.user.firstName,e.user.lastName,t.organ.src,t.organ.name,t.organ.organ].every(r=>!!r)}get isValid(){return this.isDataValid(this.page.snapshot,this.model.snapshot)}register(e){if(!this.isValid)return;const{globalConfig:{snapshot:{register:t}},page:i,model:r,snapshot:s}=this,o=this.buildJsonLd(i.snapshot,r.snapshot,this.tags.latestTags),a=JSON.stringify(o,void 0,2);if(e||void 0===e&&s.useRegistrationCallback)null==t||t(a);else{const l=new Blob([a],{type:"application/json",endings:"native"});(0,KRe.saveAs)(l,"registration-data.json")}this.addRegistration(o),this.setDisplayErrors(!1),this.page.clearHasChanges()}buildMetadata(e,t,i){const r=[];return e.registrationCallbackSet||r.push({label:"First Name",value:e.user.firstName},{label:"Last Name",value:e.user.lastName}),r.push({label:"Reference Organ Name",value:t.organ.name},{label:"Tissue Block Dimensions (mm)",value:this.xyzTripletToString(t.blockSize)},{label:"Tissue Block Position (mm)",value:this.xyzTripletToString(t.position)},{label:"Tissue Block Rotation",value:this.xyzTripletToString(t.rotation)},{label:"Anatomical Structure Tags",value:i.map(s=>s.label).join(", ")},{label:"Time Stamp",value:this.currentDate},{label:"Alignment ID",value:this.currentIdentifier}),r}buildJsonLd(e,t,i){var r,s;return{"@context":"https://hubmapconsortium.github.io/ccf-ontology/ccf-context.jsonld","@id":`http://purl.org/ccf/1.5/${this.currentIdentifier}`,"@type":"SpatialEntity",label:t.label||void 0,creator:`${e.user.firstName} ${e.user.lastName}`,creator_first_name:e.user.firstName,creator_last_name:e.user.lastName,creation_date:this.currentDate,ccf_annotations:i.map(o=>o.id),slice_thickness:(null===(r=t.slicesConfig)||void 0===r?void 0:r.thickness)||void 0,slice_count:(null===(s=t.slicesConfig)||void 0===s?void 0:s.numSlices)||void 0,x_dimension:+t.blockSize.x.toFixed(3),y_dimension:+t.blockSize.y.toFixed(3),z_dimension:+t.blockSize.z.toFixed(3),dimension_units:"millimeter",placement:{"@context":"https://hubmapconsortium.github.io/ccf-ontology/ccf-context.jsonld","@id":`http://purl.org/ccf/1.5/${this.currentIdentifier}_placement`,"@type":"SpatialPlacement",target:t.organIri,placement_date:this.currentDate,x_scaling:1,y_scaling:1,z_scaling:1,scaling_units:"ratio",x_rotation:+t.rotation.x.toFixed(3),y_rotation:+t.rotation.y.toFixed(3),z_rotation:+t.rotation.z.toFixed(3),rotation_order:"XYZ",rotation_units:"degree",x_translation:+t.position.x.toFixed(3),y_translation:+t.position.y.toFixed(3),z_translation:+t.position.z.toFixed(3),translation_units:"millimeter"}}}xyzTripletToString(e){return`${Math.round(e.x)}, ${Math.round(e.y)}, ${Math.round(e.z)}`}};function ake(n,e){if(1&n){const t=Zi();R(0,"mat-icon",2),ge("click",function(){return en(t),Qe().setAllOpacity(20)}),De(1,"refresh"),k()}2&n&&ie("matRippleCentered",!0)("matRippleUnbounded",!0)}function lke(n,e){if(1&n){const t=Zi();R(0,"div",3),ge("mouseenter",function(){const s=en(t).$implicit;return Qe().mouseOver(s)})("mouseleave",function(){return en(t),Qe().mouseOut()}),tt(1,"mat-icon",4),R(2,"div",5),De(3),k(),R(4,"div",6),R(5,"ccf-opacity-slider",7,8),ge("opacityChange",function(r){return en(t),Qe().updateOpacity(r)})("opacityReset",function(){return en(t),Qe().resetItem()})("visibilityToggle",function(){const s=en(t).$implicit;return Qe().toggleVisibility(s)}),k(),k(),k()}if(2&n){const t=e.$implicit,i=Qe();st("selected",!!i.selection&&i.getId(0,i.selection)===i.getId(0,t)),G(1),st("fade",!t.visible),G(1),st("hidden",t.id===(null==i.selection?null:i.selection.id)),Jy("title",t.name),G(1),xi(t.name),G(1),st("hidden",t.id!==(null==i.selection?null:i.selection.id)),G(1),ie("visible",t.visible)("opacity",i.selection?null==i.selection?null:i.selection.opacity:20)}}Sr.\u0275fac=function(e){return new(e||Sr)(I(Nt),I(Ah))},Sr.\u0275prov=ue({token:Sr,factory:Sr.\u0275fac}),xe([oi()],Sr.prototype,"metadata$",null),xe([oi()],Sr.prototype,"jsonld$",null),xe([oi()],Sr.prototype,"valid$",null),xe([oi()],Sr.prototype,"previousRegistrations$",null),xe([oi()],Sr.prototype,"currentIdentifier",null),xe([oi()],Sr.prototype,"currentDate",null),xe([on()],Sr.prototype,"setUseRegistrationCallback",null),xe([on()],Sr.prototype,"setDisplayErrors",null),xe([on()],Sr.prototype,"addRegistration",null),xe([oi()],Sr.prototype,"isValid",null),Sr=xe([xh(),cd({name:"registration",defaults:{useRegistrationCallback:!1,displayErrors:!1,registrations:[]}})],Sr);let cke=(()=>{class n{constructor(t){this.ga=t,this.clsName="ccf-visibility-menu",this.hover=new Le,this.itemsChange=new Le}toggleVisibility(t){t=Object.assign(Object.assign({},t),{visible:!t.visible}),this.selection&&t.id===this.selection.id&&(this.selection=Object.assign(Object.assign({},this.selection),{visible:t.visible})),this.ga.event("visibility_toggled","visibility_menu",""+t.id,+t.visible),this.updateOpacity(t.opacity)}mouseOver(t){this.selection=t===this.selection?void 0:t,this.hover.emit(t)}mouseOut(){this.selection=void 0,this.hover.emit(void 0)}updateOpacity(t){if(!this.selection)return;const i=Object.assign(Object.assign({},this.selection),{opacity:t});this.selection=i,this.items=this.items.map(r=>r.id===i.id?i:r),this.ga.event("opacity_update","visibility_menu",""+i.id,i.opacity),this.itemsChange.emit(this.items)}resetItem(){if(this.selection){const t=Object.assign(Object.assign({},this.selection),{opacity:20,visible:!0});this.selection=t,this.items=this.items.map(i=>i.id===t.id?t:i),this.ga.event("item_reset","visibility_menu",""+t.id),this.itemsChange.emit(this.items)}}setAllOpacity(t){this.items=this.items.map(i=>Object.assign(Object.assign({},i),{opacity:t,visible:!0})),this.ga.event("all_items_opacity_update","visibility_menu",void 0,t),this.itemsChange.emit(this.items)}getId(t,i){return i.id}}return n.\u0275fac=function(t){return new(t||n)(E(xs))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-visibility-menu"]],hostVars:2,hostBindings:function(t,i){2&t&&Rn(i.clsName)},inputs:{items:"items",selection:"selection"},outputs:{hover:"hover",itemsChange:"itemsChange"},decls:2,vars:3,consts:[["class","icon reset","matRipple","",3,"matRippleCentered","matRippleUnbounded","click",4,"ngIf"],["class","item-entry",3,"selected","mouseenter","mouseleave",4,"ngFor","ngForOf","ngForTrackBy"],["matRipple","",1,"icon","reset",3,"matRippleCentered","matRippleUnbounded","click"],[1,"item-entry",3,"mouseenter","mouseleave"],["svgIcon","app:opacity",1,"opacity-icon"],[1,"item-name",3,"title"],[1,"slider"],[3,"visible","opacity","opacityChange","opacityReset","visibilityToggle"],["slider",""]],template:function(t,i){1&t&&(mt(0,ake,2,2,"mat-icon",0),mt(1,lke,7,12,"div",1)),2&t&&(ie("ngIf",i.items.length),G(1),ie("ngForOf",i.items)("ngForTrackBy",i.getId))},directives:[zr,pl,rs,Js,LPe],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;margin-right:0;margin-left:0;max-height:18rem;overflow-y:auto;scrollbar-width:thin}[_nghost-%COMP%] .icon[_ngcontent-%COMP%]{padding:.25rem;border-radius:.25rem}[_nghost-%COMP%] .reset[_ngcontent-%COMP%]{transform:scaleX(-1);cursor:pointer;transition:.6s;position:absolute;top:3rem}[_nghost-%COMP%] .reset[_ngcontent-%COMP%]:hover{border-radius:2px}[_nghost-%COMP%] .item-entry[_ngcontent-%COMP%]{display:flex;height:2.25rem;align-items:center;flex-shrink:0;position:relative}[_nghost-%COMP%] .item-entry[_ngcontent-%COMP%] .opacity[_ngcontent-%COMP%]{cursor:pointer}[_nghost-%COMP%] .item-entry[_ngcontent-%COMP%] .opacity-icon[_ngcontent-%COMP%]{z-index:1;transition:.6s}[_nghost-%COMP%] .item-entry[_ngcontent-%COMP%] .opacity-icon[_ngcontent-%COMP%]:hover{border-radius:2px}[_nghost-%COMP%] .item-entry[_ngcontent-%COMP%] .item-name[_ngcontent-%COMP%]{-webkit-user-select:none;user-select:none;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-left:.5rem;opacity:1;transition-duration:.4s;transition-timing-function:ease-in-out;transition-property:opacity;max-width:calc(100% - 2.5rem)}[_nghost-%COMP%] .item-entry[_ngcontent-%COMP%] .item-name.hidden[_ngcontent-%COMP%]{opacity:0}[_nghost-%COMP%] .item-entry[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%]{width:calc(100% - 2rem);transition-duration:.3s;transition-timing-function:ease-in-out;transition-property:opacity;left:2rem;position:absolute;opacity:1}[_nghost-%COMP%] .item-entry[_ngcontent-%COMP%] .slider.hidden[_ngcontent-%COMP%]{opacity:0;transition-duration:.1s;transition-timing-function:ease-in-out;transition-property:opacity}"],changeDetection:0}),n})();const uke=["*"],F9=new ve("MatChipRemove"),N9=new ve("MatChipAvatar"),L9=new ve("MatChipTrailingIcon");class dke{constructor(e){this._elementRef=e}}const hke=Hf(Uf(nc(dke),"primary"),-1);let y0=(()=>{class n extends hke{constructor(t,i,r,s,o,a,l,c){super(t),this._ngZone=i,this._changeDetectorRef=o,this._hasFocus=!1,this.chipListSelectable=!0,this._chipListMultiple=!1,this._chipListDisabled=!1,this._selected=!1,this._selectable=!0,this._disabled=!1,this._removable=!0,this._onFocus=new Se,this._onBlur=new Se,this.selectionChange=new Le,this.destroyed=new Le,this.removed=new Le,this._addHostClassName(),this._chipRippleTarget=a.createElement("div"),this._chipRippleTarget.classList.add("mat-chip-ripple"),this._elementRef.nativeElement.appendChild(this._chipRippleTarget),this._chipRipple=new oj(this,i,this._chipRippleTarget,r),this._chipRipple.setupTriggerEvents(t),this.rippleConfig=s||{},this._animationsDisabled="NoopAnimations"===l,this.tabIndex=null!=c&&parseInt(c)||-1}get rippleDisabled(){return this.disabled||this.disableRipple||this._animationsDisabled||!!this.rippleConfig.disabled}get selected(){return this._selected}set selected(t){const i=Mt(t);i!==this._selected&&(this._selected=i,this._dispatchSelectionChange())}get value(){return void 0!==this._value?this._value:this._elementRef.nativeElement.textContent}set value(t){this._value=t}get selectable(){return this._selectable&&this.chipListSelectable}set selectable(t){this._selectable=Mt(t)}get disabled(){return this._chipListDisabled||this._disabled}set disabled(t){this._disabled=Mt(t)}get removable(){return this._removable}set removable(t){this._removable=Mt(t)}get ariaSelected(){return this.selectable&&(this._chipListMultiple||this.selected)?this.selected.toString():null}_addHostClassName(){const t="mat-basic-chip",i=this._elementRef.nativeElement;i.hasAttribute(t)||i.tagName.toLowerCase()===t?i.classList.add(t):i.classList.add("mat-standard-chip")}ngOnDestroy(){this.destroyed.emit({chip:this}),this._chipRipple._removeTriggerEvents()}select(){this._selected||(this._selected=!0,this._dispatchSelectionChange(),this._changeDetectorRef.markForCheck())}deselect(){this._selected&&(this._selected=!1,this._dispatchSelectionChange(),this._changeDetectorRef.markForCheck())}selectViaInteraction(){this._selected||(this._selected=!0,this._dispatchSelectionChange(!0),this._changeDetectorRef.markForCheck())}toggleSelected(t=!1){return this._selected=!this.selected,this._dispatchSelectionChange(t),this._changeDetectorRef.markForCheck(),this.selected}focus(){this._hasFocus||(this._elementRef.nativeElement.focus(),this._onFocus.next({chip:this})),this._hasFocus=!0}remove(){this.removable&&this.removed.emit({chip:this})}_handleClick(t){this.disabled?t.preventDefault():t.stopPropagation()}_handleKeydown(t){if(!this.disabled)switch(t.keyCode){case 46:case 8:this.remove(),t.preventDefault();break;case 32:this.selectable&&this.toggleSelected(!0),t.preventDefault()}}_blur(){this._ngZone.onStable.pipe(yi(1)).subscribe(()=>{this._ngZone.run(()=>{this._hasFocus=!1,this._onBlur.next({chip:this})})})}_dispatchSelectionChange(t=!1){this.selectionChange.emit({source:this,isUserInput:t,selected:this._selected})}}return n.\u0275fac=function(t){return new(t||n)(E(rt),E(dt),E(si),E(aj,8),E(kn),E(ut),E(Do,8),Zr("tabindex"))},n.\u0275dir=oe({type:n,selectors:[["mat-basic-chip"],["","mat-basic-chip",""],["mat-chip"],["","mat-chip",""]],contentQueries:function(t,i,r){if(1&t&&(ei(r,N9,5),ei(r,L9,5),ei(r,F9,5)),2&t){let s;_t(s=yt())&&(i.avatar=s.first),_t(s=yt())&&(i.trailingIcon=s.first),_t(s=yt())&&(i.removeIcon=s.first)}},hostAttrs:["role","option",1,"mat-chip","mat-focus-indicator"],hostVars:14,hostBindings:function(t,i){1&t&&ge("click",function(s){return i._handleClick(s)})("keydown",function(s){return i._handleKeydown(s)})("focus",function(){return i.focus()})("blur",function(){return i._blur()}),2&t&&(nn("tabindex",i.disabled?null:i.tabIndex)("disabled",i.disabled||null)("aria-disabled",i.disabled.toString())("aria-selected",i.ariaSelected),st("mat-chip-selected",i.selected)("mat-chip-with-avatar",i.avatar)("mat-chip-with-trailing-icon",i.trailingIcon||i.removeIcon)("mat-chip-disabled",i.disabled)("_mat-animation-noopable",i._animationsDisabled))},inputs:{color:"color",disableRipple:"disableRipple",tabIndex:"tabIndex",selected:"selected",value:"value",selectable:"selectable",disabled:"disabled",removable:"removable"},outputs:{selectionChange:"selectionChange",destroyed:"destroyed",removed:"removed"},exportAs:["matChip"],features:[ct]}),n})(),B9=(()=>{class n{constructor(t,i){this._parentChip=t,"BUTTON"===i.nativeElement.nodeName&&i.nativeElement.setAttribute("type","button")}_handleClick(t){const i=this._parentChip;i.removable&&!i.disabled&&i.remove(),t.stopPropagation()}}return n.\u0275fac=function(t){return new(t||n)(E(y0),E(rt))},n.\u0275dir=oe({type:n,selectors:[["","matChipRemove",""]],hostAttrs:[1,"mat-chip-remove","mat-chip-trailing-icon"],hostBindings:function(t,i){1&t&&ge("click",function(s){return i._handleClick(s)})},features:[Dt([{provide:F9,useExisting:n}])]}),n})();const V9=new ve("mat-chips-default-options"),gke=FO(class{constructor(n,e,t,i){this._defaultErrorStateMatcher=n,this._parentForm=e,this._parentFormGroup=t,this.ngControl=i}});let mke=0;class _ke{constructor(e,t){this.source=e,this.value=t}}let z9=(()=>{class n extends gke{constructor(t,i,r,s,o,a,l){super(a,s,o,l),this._elementRef=t,this._changeDetectorRef=i,this._dir=r,this.controlType="mat-chip-list",this._lastDestroyedChipIndex=null,this._destroyed=new Se,this._uid="mat-chip-list-"+mke++,this._tabIndex=0,this._userTabIndex=null,this._onTouched=()=>{},this._onChange=()=>{},this._multiple=!1,this._compareWith=(c,d)=>c===d,this._required=!1,this._disabled=!1,this.ariaOrientation="horizontal",this._selectable=!0,this.change=new Le,this.valueChange=new Le,this.ngControl&&(this.ngControl.valueAccessor=this)}get selected(){var t,i;return this.multiple?(null===(t=this._selectionModel)||void 0===t?void 0:t.selected)||[]:null===(i=this._selectionModel)||void 0===i?void 0:i.selected[0]}get role(){return this.empty?null:"listbox"}get multiple(){return this._multiple}set multiple(t){this._multiple=Mt(t),this._syncChipsState()}get compareWith(){return this._compareWith}set compareWith(t){this._compareWith=t,this._selectionModel&&this._initializeSelection()}get value(){return this._value}set value(t){this.writeValue(t),this._value=t}get id(){return this._chipInput?this._chipInput.id:this._uid}get required(){return this._required}set required(t){this._required=Mt(t),this.stateChanges.next()}get placeholder(){return this._chipInput?this._chipInput.placeholder:this._placeholder}set placeholder(t){this._placeholder=t,this.stateChanges.next()}get focused(){return this._chipInput&&this._chipInput.focused||this._hasFocusedChip()}get empty(){return(!this._chipInput||this._chipInput.empty)&&(!this.chips||0===this.chips.length)}get shouldLabelFloat(){return!this.empty||this.focused}get disabled(){return this.ngControl?!!this.ngControl.disabled:this._disabled}set disabled(t){this._disabled=Mt(t),this._syncChipsState()}get selectable(){return this._selectable}set selectable(t){this._selectable=Mt(t),this.chips&&this.chips.forEach(i=>i.chipListSelectable=this._selectable)}set tabIndex(t){this._userTabIndex=t,this._tabIndex=t}get chipSelectionChanges(){return Ni(...this.chips.map(t=>t.selectionChange))}get chipFocusChanges(){return Ni(...this.chips.map(t=>t._onFocus))}get chipBlurChanges(){return Ni(...this.chips.map(t=>t._onBlur))}get chipRemoveChanges(){return Ni(...this.chips.map(t=>t.destroyed))}ngAfterContentInit(){this._keyManager=new nO(this.chips).withWrap().withVerticalOrientation().withHomeAndEnd().withHorizontalOrientation(this._dir?this._dir.value:"ltr"),this._dir&&this._dir.change.pipe(Tn(this._destroyed)).subscribe(t=>this._keyManager.withHorizontalOrientation(t)),this._keyManager.tabOut.pipe(Tn(this._destroyed)).subscribe(()=>{this._allowFocusEscape()}),this.chips.changes.pipe(Rr(null),Tn(this._destroyed)).subscribe(()=>{this.disabled&&Promise.resolve().then(()=>{this._syncChipsState()}),this._resetChips(),this._initializeSelection(),this._updateTabIndex(),this._updateFocusForDestroyedChips(),this.stateChanges.next()})}ngOnInit(){this._selectionModel=new lS(this.multiple,void 0,!1),this.stateChanges.next()}ngDoCheck(){this.ngControl&&(this.updateErrorState(),this.ngControl.disabled!==this._disabled&&(this.disabled=!!this.ngControl.disabled))}ngOnDestroy(){this._destroyed.next(),this._destroyed.complete(),this.stateChanges.complete(),this._dropSubscriptions()}registerInput(t){this._chipInput=t,this._elementRef.nativeElement.setAttribute("data-mat-chip-input",t.id)}setDescribedByIds(t){this._ariaDescribedby=t.join(" ")}writeValue(t){this.chips&&this._setSelectionByValue(t,!1)}registerOnChange(t){this._onChange=t}registerOnTouched(t){this._onTouched=t}setDisabledState(t){this.disabled=t,this.stateChanges.next()}onContainerClick(t){this._originatesFromChip(t)||this.focus()}focus(t){this.disabled||this._chipInput&&this._chipInput.focused||(this.chips.length>0?(this._keyManager.setFirstItemActive(),this.stateChanges.next()):(this._focusInput(t),this.stateChanges.next()))}_focusInput(t){this._chipInput&&this._chipInput.focus(t)}_keydown(t){const i=t.target;i&&i.classList.contains("mat-chip")&&(this._keyManager.onKeydown(t),this.stateChanges.next())}_updateTabIndex(){this._tabIndex=this._userTabIndex||(0===this.chips.length?-1:0)}_updateFocusForDestroyedChips(){if(null!=this._lastDestroyedChipIndex)if(this.chips.length){const t=Math.min(this._lastDestroyedChipIndex,this.chips.length-1);this._keyManager.setActiveItem(t)}else this.focus();this._lastDestroyedChipIndex=null}_isValidIndex(t){return t>=0&&tr.deselect()),Array.isArray(t))t.forEach(r=>this._selectValue(r,i)),this._sortValues();else{const r=this._selectValue(t,i);r&&i&&this._keyManager.setActiveItem(r)}}_selectValue(t,i=!0){const r=this.chips.find(s=>null!=s.value&&this._compareWith(s.value,t));return r&&(i?r.selectViaInteraction():r.select(),this._selectionModel.select(r)),r}_initializeSelection(){Promise.resolve().then(()=>{(this.ngControl||this._value)&&(this._setSelectionByValue(this.ngControl?this.ngControl.value:this._value,!1),this.stateChanges.next())})}_clearSelection(t){this._selectionModel.clear(),this.chips.forEach(i=>{i!==t&&i.deselect()}),this.stateChanges.next()}_sortValues(){this._multiple&&(this._selectionModel.clear(),this.chips.forEach(t=>{t.selected&&this._selectionModel.select(t)}),this.stateChanges.next())}_propagateChanges(t){let i=null;i=Array.isArray(this.selected)?this.selected.map(r=>r.value):this.selected?this.selected.value:t,this._value=i,this.change.emit(new _ke(this,i)),this.valueChange.emit(i),this._onChange(i),this._changeDetectorRef.markForCheck()}_blur(){this._hasFocusedChip()||this._keyManager.setActiveItem(-1),this.disabled||(this._chipInput?setTimeout(()=>{this.focused||this._markAsTouched()}):this._markAsTouched())}_markAsTouched(){this._onTouched(),this._changeDetectorRef.markForCheck(),this.stateChanges.next()}_allowFocusEscape(){-1!==this._tabIndex&&(this._tabIndex=-1,setTimeout(()=>{this._tabIndex=this._userTabIndex||0,this._changeDetectorRef.markForCheck()}))}_resetChips(){this._dropSubscriptions(),this._listenToChipsFocus(),this._listenToChipsSelection(),this._listenToChipsRemoved()}_dropSubscriptions(){this._chipFocusSubscription&&(this._chipFocusSubscription.unsubscribe(),this._chipFocusSubscription=null),this._chipBlurSubscription&&(this._chipBlurSubscription.unsubscribe(),this._chipBlurSubscription=null),this._chipSelectionSubscription&&(this._chipSelectionSubscription.unsubscribe(),this._chipSelectionSubscription=null),this._chipRemoveSubscription&&(this._chipRemoveSubscription.unsubscribe(),this._chipRemoveSubscription=null)}_listenToChipsSelection(){this._chipSelectionSubscription=this.chipSelectionChanges.subscribe(t=>{t.source.selected?this._selectionModel.select(t.source):this._selectionModel.deselect(t.source),this.multiple||this.chips.forEach(i=>{!this._selectionModel.isSelected(i)&&i.selected&&i.deselect()}),t.isUserInput&&this._propagateChanges()})}_listenToChipsFocus(){this._chipFocusSubscription=this.chipFocusChanges.subscribe(t=>{let i=this.chips.toArray().indexOf(t.chip);this._isValidIndex(i)&&this._keyManager.updateActiveItem(i),this.stateChanges.next()}),this._chipBlurSubscription=this.chipBlurChanges.subscribe(()=>{this._blur(),this.stateChanges.next()})}_listenToChipsRemoved(){this._chipRemoveSubscription=this.chipRemoveChanges.subscribe(t=>{const i=t.chip,r=this.chips.toArray().indexOf(t.chip);this._isValidIndex(r)&&i._hasFocus&&(this._lastDestroyedChipIndex=r)})}_originatesFromChip(t){let i=t.target;for(;i&&i!==this._elementRef.nativeElement;){if(i.classList.contains("mat-chip"))return!0;i=i.parentElement}return!1}_hasFocusedChip(){return this.chips&&this.chips.some(t=>t._hasFocus)}_syncChipsState(){this.chips&&this.chips.forEach(t=>{t._chipListDisabled=this._disabled,t._chipListMultiple=this.multiple})}}return n.\u0275fac=function(t){return new(t||n)(E(rt),E(kn),E(Qo,8),E(mp,8),E(Zm,8),E(Vv),E(uc,10))},n.\u0275cmp=Ne({type:n,selectors:[["mat-chip-list"]],contentQueries:function(t,i,r){if(1&t&&ei(r,y0,5),2&t){let s;_t(s=yt())&&(i.chips=s)}},hostAttrs:[1,"mat-chip-list"],hostVars:15,hostBindings:function(t,i){1&t&&ge("focus",function(){return i.focus()})("blur",function(){return i._blur()})("keydown",function(s){return i._keydown(s)}),2&t&&(al("id",i._uid),nn("tabindex",i.disabled?null:i._tabIndex)("aria-describedby",i._ariaDescribedby||null)("aria-required",i.role?i.required:null)("aria-disabled",i.disabled.toString())("aria-invalid",i.errorState)("aria-multiselectable",i.multiple)("role",i.role)("aria-orientation",i.ariaOrientation),st("mat-chip-list-disabled",i.disabled)("mat-chip-list-invalid",i.errorState)("mat-chip-list-required",i.required))},inputs:{ariaOrientation:["aria-orientation","ariaOrientation"],multiple:"multiple",compareWith:"compareWith",value:"value",required:"required",placeholder:"placeholder",disabled:"disabled",selectable:"selectable",tabIndex:"tabIndex",errorStateMatcher:"errorStateMatcher"},outputs:{change:"change",valueChange:"valueChange"},exportAs:["matChipList"],features:[Dt([{provide:jv,useExisting:n}]),ct],ngContentSelectors:uke,decls:2,vars:0,consts:[[1,"mat-chip-list-wrapper"]],template:function(t,i){1&t&&(wi(),R(0,"div",0),Ht(1),k())},styles:['.mat-chip{position:relative;box-sizing:border-box;-webkit-tap-highlight-color:transparent;transform:translateZ(0);border:none;-webkit-appearance:none;-moz-appearance:none}.mat-standard-chip{transition:box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);display:inline-flex;padding:7px 12px;border-radius:16px;align-items:center;cursor:default;min-height:32px;height:1px}._mat-animation-noopable.mat-standard-chip{transition:none;animation:none}.mat-standard-chip .mat-chip-remove.mat-icon{width:18px;height:18px}.mat-standard-chip::after{top:0;left:0;right:0;bottom:0;position:absolute;border-radius:inherit;opacity:0;content:"";pointer-events:none;transition:opacity 200ms cubic-bezier(0.35, 0, 0.25, 1)}.mat-standard-chip:hover::after{opacity:.12}.mat-standard-chip:focus{outline:none}.mat-standard-chip:focus::after{opacity:.16}.cdk-high-contrast-active .mat-standard-chip{outline:solid 1px}.cdk-high-contrast-active .mat-standard-chip:focus{outline:dotted 2px}.mat-standard-chip.mat-chip-disabled::after{opacity:0}.mat-standard-chip.mat-chip-disabled .mat-chip-remove,.mat-standard-chip.mat-chip-disabled .mat-chip-trailing-icon{cursor:default}.mat-standard-chip.mat-chip-with-trailing-icon.mat-chip-with-avatar,.mat-standard-chip.mat-chip-with-avatar{padding-top:0;padding-bottom:0}.mat-standard-chip.mat-chip-with-trailing-icon.mat-chip-with-avatar{padding-right:8px;padding-left:0}[dir=rtl] .mat-standard-chip.mat-chip-with-trailing-icon.mat-chip-with-avatar{padding-left:8px;padding-right:0}.mat-standard-chip.mat-chip-with-trailing-icon{padding-top:7px;padding-bottom:7px;padding-right:8px;padding-left:12px}[dir=rtl] .mat-standard-chip.mat-chip-with-trailing-icon{padding-left:8px;padding-right:12px}.mat-standard-chip.mat-chip-with-avatar{padding-left:0;padding-right:12px}[dir=rtl] .mat-standard-chip.mat-chip-with-avatar{padding-right:0;padding-left:12px}.mat-standard-chip .mat-chip-avatar{width:24px;height:24px;margin-right:8px;margin-left:4px}[dir=rtl] .mat-standard-chip .mat-chip-avatar{margin-left:8px;margin-right:4px}.mat-standard-chip .mat-chip-remove,.mat-standard-chip .mat-chip-trailing-icon{width:18px;height:18px;cursor:pointer}.mat-standard-chip .mat-chip-remove,.mat-standard-chip .mat-chip-trailing-icon{margin-left:8px;margin-right:0}[dir=rtl] .mat-standard-chip .mat-chip-remove,[dir=rtl] .mat-standard-chip .mat-chip-trailing-icon{margin-right:8px;margin-left:0}.mat-chip-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none;border-radius:inherit;overflow:hidden}.mat-chip-list-wrapper{display:flex;flex-direction:row;flex-wrap:wrap;align-items:center;margin:-4px}.mat-chip-list-wrapper input.mat-input-element,.mat-chip-list-wrapper .mat-standard-chip{margin:4px}.mat-chip-list-stacked .mat-chip-list-wrapper{flex-direction:column;align-items:flex-start}.mat-chip-list-stacked .mat-chip-list-wrapper .mat-standard-chip{width:100%}.mat-chip-avatar{border-radius:50%;justify-content:center;align-items:center;display:flex;overflow:hidden;object-fit:cover}input.mat-chip-input{width:150px;margin:4px;flex:1 0 150px}\n'],encapsulation:2,changeDetection:0}),n})();const bke={separatorKeyCodes:[13]};let j9=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({providers:[Vv,{provide:V9,useValue:bke}],imports:[[On]]}),n})(),Cke=(()=>{class n{constructor(t){this.ga=t,this.clsName="ccf-visibility-toggle",this.visible=!1,this.toggleLabel="",this.disabled=!1,this.visibilityChanged=new Le}toggleVisibility(){this.visible=!this.visible,this.ga.event("visibility_toggled","visibility_toggle",""+this.visible),this.visibilityChanged.emit(this.visible)}}return n.\u0275fac=function(t){return new(t||n)(E(xs))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-visibility-toggle"]],hostVars:2,hostBindings:function(t,i){2&t&&Rn(i.clsName)},inputs:{visible:"visible",toggleLabel:"toggleLabel",disabled:"disabled"},outputs:{visibilityChanged:"visibilityChanged"},decls:8,vars:9,consts:[[1,"toggle-div"],[1,"toggle-wrapper",3,"click"],[1,"icon-background"],["svgIcon","app:visibility_off_cube",1,"icon","block"],[1,"icon","green"],[1,"toggle-label"]],template:function(t,i){1&t&&(R(0,"div",0),R(1,"mat-chip",1),ge("click",function(){return i.toggleVisibility()}),R(2,"div",2),tt(3,"mat-icon",3),R(4,"mat-icon",4),De(5,"done"),k(),k(),R(6,"div",5),De(7),k(),k(),k()),2&t&&(G(1),st("disabled",i.disabled),G(1),st("disabled",i.disabled),G(1),st("hidden",i.visible),G(1),st("hidden",!i.visible),G(3),xi(i.toggleLabel))},directives:[y0,rs],styles:["[_nghost-%COMP%]{height:3rem;display:flex;align-items:center}[_nghost-%COMP%] .mat-chip{padding:0!important}[_nghost-%COMP%] .mat-chip.disabled{cursor:not-allowed!important}[_nghost-%COMP%] .toggle-div[_ngcontent-%COMP%]{width:100%;display:flex;justify-content:center;padding-top:1.5rem}[_nghost-%COMP%] .toggle-div[_ngcontent-%COMP%] .toggle-wrapper[_ngcontent-%COMP%]{-webkit-user-select:none;-moz-user-select:none;display:flex;padding-left:.5rem;cursor:pointer;align-items:center;position:relative;border-width:.075rem;border-style:solid;height:2.25rem;border-radius:1.5rem;transition:background-color .2s ease-in-out}[_nghost-%COMP%] .toggle-div[_ngcontent-%COMP%] .toggle-wrapper[_ngcontent-%COMP%] .icon-background[_ngcontent-%COMP%]{border-radius:1.5rem;height:2.06rem;width:2.06rem;display:flex;align-items:center;justify-content:center}[_nghost-%COMP%] .toggle-div[_ngcontent-%COMP%] .toggle-wrapper[_ngcontent-%COMP%] .icon-background[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{transition:.6s;position:absolute}[_nghost-%COMP%] .toggle-div[_ngcontent-%COMP%] .toggle-wrapper[_ngcontent-%COMP%] .icon-background[_ngcontent-%COMP%] .icon.block[_ngcontent-%COMP%]{width:1.125rem}[_nghost-%COMP%] .toggle-div[_ngcontent-%COMP%] .toggle-wrapper[_ngcontent-%COMP%] .icon-background[_ngcontent-%COMP%] .icon.hidden[_ngcontent-%COMP%]{opacity:0}[_nghost-%COMP%] .toggle-div[_ngcontent-%COMP%] .toggle-wrapper[_ngcontent-%COMP%] .toggle-label[_ngcontent-%COMP%]{font-weight:bold;margin-left:.5rem;padding-right:1.25rem;padding-left:.25rem}"],changeDetection:0}),n})();const wke=["fileInput"];let Eke=(()=>{class n{constructor(t){this.ga=t,this.clsName="ccf-json-file-reader",this.label="Upload",this.parsedJson=new Le}triggerFileInput(){this.fileInput.nativeElement.click()}handleFile(t){const i=t.target;if(!i.files)return;const r=i.files[0],s=new FileReader;s.onload=()=>{const o=JSON.parse(s.result);this.ga.event("json_file_load_end","json_file_reader"),this.parsedJson.emit(o)},this.ga.event("json_file_load_start","json_file_reader"),s.readAsText(r)}}return n.\u0275fac=function(t){return new(t||n)(E(xs))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-json-file-reader"]],viewQuery:function(t,i){if(1&t&&Jn(wke,5),2&t){let r;_t(r=yt())&&(i.fileInput=r.first)}},hostVars:2,hostBindings:function(t,i){2&t&&Rn(i.clsName)},inputs:{label:"label"},outputs:{parsedJson:"parsedJson"},decls:4,vars:1,consts:[["mat-button","",1,"upload-button",3,"click"],["type","file","accept","application/JSON","name","fileInput","id","fileInput",2,"display","none",3,"change"],["fileInput",""]],template:function(t,i){1&t&&(R(0,"button",0),ge("click",function(){return i.triggerFileInput()}),De(1),k(),R(2,"input",1,2),ge("change",function(s){return i.handleFile(s)}),k()),2&t&&(G(1),xi(i.label))},directives:[lh],styles:["[_nghost-%COMP%] .upload-button[_ngcontent-%COMP%]{width:100%;height:2.25rem;transition:.6s;cursor:pointer;font-weight:500}"]}),n})(),Ske=(()=>{class n{constructor(){this.clsName="ccf-details-label",this.details=[]}arrayToString(t){return t.join(", ")}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=Ne({type:n,selectors:[["ccf-details-label"]],hostVars:2,hostBindings:function(t,i){2&t&&Rn(i.clsName)},inputs:{details:"details"},decls:1,vars:1,template:function(t,i){1&t&&De(0),2&t&&xi(i.arrayToString(i.details))},styles:["[_nghost-%COMP%]{display:block;height:2.25rem}"],changeDetection:0}),n})();const Mke=["trigger"],xke=["panel"];function Tke(n,e){if(1&n&&(R(0,"span",8),De(1),k()),2&n){const t=Qe();G(1),xi(t.placeholder)}}function Ake(n,e){if(1&n&&(R(0,"span",12),De(1),k()),2&n){const t=Qe(2);G(1),xi(t.triggerValue)}}function Dke(n,e){1&n&&Ht(0,0,["*ngSwitchCase","true"])}function Oke(n,e){1&n&&(R(0,"span",9),mt(1,Ake,2,1,"span",10),mt(2,Dke,1,0,"ng-content",11),k()),2&n&&(ie("ngSwitch",!!Qe().customTrigger),G(2),ie("ngSwitchCase",!0))}function Ike(n,e){if(1&n){const t=Zi();R(0,"div",13),R(1,"div",14,15),ge("@transformPanel.done",function(r){return en(t),Qe()._panelDoneAnimatingStream.next(r.toState)})("keydown",function(r){return en(t),Qe()._handleKeydown(r)}),Ht(3,1),k(),k()}if(2&n){const t=Qe();ie("@transformPanelWrap",void 0),G(1),function(n,e,t){Gl(yo,Vc,Cg(Oe(),n,e,t),!0)}("mat-select-panel ",t._getPanelTheme(),""),vf("transform-origin",t._transformOrigin)("font-size",t._triggerFontSize,"px"),ie("ngClass",t.panelClass)("@transformPanel",t.multiple?"showing-multiple":"showing"),nn("id",t.id+"-panel")("aria-multiselectable",t.multiple)("aria-label",t.ariaLabel||null)("aria-labelledby",t._getPanelAriaLabelledby())}}const Pke=[[["mat-select-trigger"]],"*"],Rke=["mat-select-trigger","*"],U9={transformPanelWrap:tc("transformPanelWrap",[Qs("* => void",Uie("@transformPanel",[jie()],{optional:!0}))]),transformPanel:tc("transformPanel",[wr("void",ti({transform:"scaleY(0.8)",minWidth:"100%",opacity:0})),wr("showing",ti({opacity:1,minWidth:"calc(100% + 32px)",transform:"scaleY(1)"})),wr("showing-multiple",ti({opacity:1,minWidth:"calc(100% + 64px)",transform:"scaleY(1)"})),Qs("void => *",Ao("120ms cubic-bezier(0, 0, 0.2, 1)")),Qs("* => void",Ao("100ms 25ms linear",ti({opacity:0})))])};let H9=0;const G9=new ve("mat-select-scroll-strategy"),Lke=new ve("MAT_SELECT_CONFIG"),Bke={provide:G9,deps:[Jo],useFactory:function(n){return()=>n.scrollStrategies.reposition()}};class Vke{constructor(e,t){this.source=e,this.value=t}}const zke=nc(Hf(jf(FO(class{constructor(n,e,t,i,r){this._elementRef=n,this._defaultErrorStateMatcher=e,this._parentForm=t,this._parentFormGroup=i,this.ngControl=r}})))),W9=new ve("MatSelectTrigger");let jke=(()=>{class n extends zke{constructor(t,i,r,s,o,a,l,c,d,f,p,g,_,y){var v,C,w;super(o,s,l,c,f),this._viewportRuler=t,this._changeDetectorRef=i,this._ngZone=r,this._dir=a,this._parentFormField=d,this._liveAnnouncer=_,this._defaultOptions=y,this._panelOpen=!1,this._compareWith=(x,N)=>x===N,this._uid="mat-select-"+H9++,this._triggerAriaLabelledBy=null,this._destroy=new Se,this._onChange=()=>{},this._onTouched=()=>{},this._valueId="mat-select-value-"+H9++,this._panelDoneAnimatingStream=new Se,this._overlayPanelClass=(null===(v=this._defaultOptions)||void 0===v?void 0:v.overlayPanelClass)||"",this._focused=!1,this.controlType="mat-select",this._required=!1,this._multiple=!1,this._disableOptionCentering=null!==(w=null===(C=this._defaultOptions)||void 0===C?void 0:C.disableOptionCentering)&&void 0!==w&&w,this.ariaLabel="",this.optionSelectionChanges=Yb(()=>{const x=this.options;return x?x.changes.pipe(Rr(x),Pr(()=>Ni(...x.map(N=>N.onSelectionChange)))):this._ngZone.onStable.pipe(yi(1),Pr(()=>this.optionSelectionChanges))}),this.openedChange=new Le,this._openedStream=this.openedChange.pipe(Fn(x=>x),Ae(()=>{})),this._closedStream=this.openedChange.pipe(Fn(x=>!x),Ae(()=>{})),this.selectionChange=new Le,this.valueChange=new Le,this.ngControl&&(this.ngControl.valueAccessor=this),null!=(null==y?void 0:y.typeaheadDebounceInterval)&&(this._typeaheadDebounceInterval=y.typeaheadDebounceInterval),this._scrollStrategyFactory=g,this._scrollStrategy=this._scrollStrategyFactory(),this.tabIndex=parseInt(p)||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=Mt(t),this.stateChanges.next()}get multiple(){return this._multiple}set multiple(t){this._multiple=Mt(t)}get disableOptionCentering(){return this._disableOptionCentering}set disableOptionCentering(t){this._disableOptionCentering=Mt(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=To(t)}get id(){return this._id}set id(t){this._id=t||this._uid,this.stateChanges.next()}ngOnInit(){this._selectionModel=new lS(this.multiple),this.stateChanges.next(),this._panelDoneAnimatingStream.pipe(Zo(),Tn(this._destroy)).subscribe(()=>this._panelDoneAnimating(this.panelOpen))}ngAfterContentInit(){this._initKeyManager(),this._selectionModel.changed.pipe(Tn(this._destroy)).subscribe(t=>{t.added.forEach(i=>i.select()),t.removed.forEach(i=>i.deselect())}),this.options.changes.pipe(Rr(null),Tn(this._destroy)).subscribe(()=>{this._resetOptions(),this._initializeSelection()})}ngDoCheck(){const t=this._getTriggerAriaLabelledby();if(t!==this._triggerAriaLabelledBy){const i=this._elementRef.nativeElement;this._triggerAriaLabelledBy=t,t?i.setAttribute("aria-labelledby",t):i.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(i=>i.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 i=t.keyCode,r=40===i||38===i||37===i||39===i,s=13===i||32===i,o=this._keyManager;if(!o.isTyping()&&s&&!Zs(t)||(this.multiple||t.altKey)&&r)t.preventDefault(),this.open();else if(!this.multiple){const a=this.selected;o.onKeydown(t);const l=this.selected;l&&a!==l&&this._liveAnnouncer.announce(l.viewValue,1e4)}}_handleOpenKeydown(t){const i=this._keyManager,r=t.keyCode,s=40===r||38===r,o=i.isTyping();if(s&&t.altKey)t.preventDefault(),this.close();else if(o||13!==r&&32!==r||!i.activeItem||Zs(t))if(!o&&this._multiple&&65===r&&t.ctrlKey){t.preventDefault();const a=this.options.some(l=>!l.disabled&&!l.selected);this.options.forEach(l=>{l.disabled||(a?l.select():l.deselect())})}else{const a=i.activeItemIndex;i.onKeydown(t),this._multiple&&s&&t.shiftKey&&i.activeItem&&i.activeItemIndex!==a&&i.activeItem._selectViaInteraction()}else t.preventDefault(),i.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(yi(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(i=>i.setInactiveStyles()),this._selectionModel.clear(),this.multiple&&t)Array.isArray(t),t.forEach(i=>this._selectValue(i)),this._sortValues();else{const i=this._selectValue(t);i?this._keyManager.updateActiveItem(i):this.panelOpen||this._keyManager.updateActiveItem(-1)}this._changeDetectorRef.markForCheck()}_selectValue(t){const i=this.options.find(r=>{if(this._selectionModel.isSelected(r))return!1;try{return null!=r.value&&this._compareWith(r.value,t)}catch(s){return!1}});return i&&this._selectionModel.select(i),i}_initKeyManager(){this._keyManager=new kV(this.options).withTypeAhead(this._typeaheadDebounceInterval).withVerticalOrientation().withHorizontalOrientation(this._isRtl()?"rtl":"ltr").withHomeAndEnd().withAllowedModifierKeys(["shiftKey"]),this._keyManager.tabOut.pipe(Tn(this._destroy)).subscribe(()=>{this.panelOpen&&(!this.multiple&&this._keyManager.activeItem&&this._keyManager.activeItem._selectViaInteraction(),this.focus(),this.close())}),this._keyManager.change.pipe(Tn(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=Ni(this.options.changes,this._destroy);this.optionSelectionChanges.pipe(Tn(t)).subscribe(i=>{this._onSelect(i.source,i.isUserInput),i.isUserInput&&!this.multiple&&this._panelOpen&&(this.close(),this.focus())}),Ni(...this.options.map(i=>i._stateChanges)).pipe(Tn(t)).subscribe(()=>{this._changeDetectorRef.markForCheck(),this.stateChanges.next()})}_onSelect(t,i){const r=this._selectionModel.isSelected(t);null!=t.value||this._multiple?(r!==t.selected&&(t.selected?this._selectionModel.select(t):this._selectionModel.deselect(t)),i&&this._keyManager.setActiveItem(t),this.multiple&&(this._sortValues(),i&&this.focus())):(t.deselect(),this._selectionModel.clear(),null!=this.value&&this._propagateChanges(t.value)),r!==this._selectionModel.isSelected(t)&&this._propagateChanges(),this.stateChanges.next()}_sortValues(){if(this.multiple){const t=this.options.toArray();this._selectionModel.sort((i,r)=>this.sortComparator?this.sortComparator(i,r,t):t.indexOf(i)-t.indexOf(r)),this.stateChanges.next()}}_propagateChanges(t){let i=null;i=this.multiple?this.selected.map(r=>r.value):this.selected?this.selected.value:t,this._value=i,this.valueChange.emit(i),this._onChange(i),this.selectionChange.emit(this._getChangeEvent(i)),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 i=null===(t=this._parentFormField)||void 0===t?void 0:t.getLabelId();return this.ariaLabelledby?(i?i+" ":"")+this.ariaLabelledby:i}_getAriaActiveDescendant(){return this.panelOpen&&this._keyManager&&this._keyManager.activeItem?this._keyManager.activeItem.id:null}_getTriggerAriaLabelledby(){var t;if(this.ariaLabel)return null;const i=null===(t=this._parentFormField)||void 0===t?void 0:t.getLabelId();let r=(i?i+" ":"")+this._valueId;return this.ariaLabelledby&&(r+=" "+this.ariaLabelledby),r}_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 n.\u0275fac=function(t){return new(t||n)(E(Yf),E(kn),E(dt),E(Vv),E(rt),E(Qo,8),E(mp,8),E(Zm,8),E(nS,8),E(uc,10),Zr("tabindex"),E(G9),E(DE),E(Lke,8))},n.\u0275dir=oe({type:n,viewQuery:function(t,i){if(1&t&&(Jn(Mke,5),Jn(xke,5),Jn(sU,5)),2&t){let r;_t(r=yt())&&(i.trigger=r.first),_t(r=yt())&&(i.panel=r.first),_t(r=yt())&&(i._overlayDir=r.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:[ct,zn]}),n})(),Uke=(()=>{class n extends jke{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,i,r){const s=this._getItemHeight();return Math.min(Math.max(0,s*t-i+s/2),r)}ngOnInit(){super.ngOnInit(),this._viewportRuler.change().pipe(Tn(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(yi(1)).subscribe(()=>{this._triggerFontSize&&this._overlayDir.overlayRef&&this._overlayDir.overlayRef.overlayElement&&(this._overlayDir.overlayRef.overlayElement.style.fontSize=`${this._triggerFontSize}px`)}))}_scrollOptionIntoView(t){const i=BO(t,this.options,this.optionGroups),r=this._getItemHeight();this.panel.nativeElement.scrollTop=0===t&&1===i?0:function(n,e,t,i){return nt+i?Math.max(0,n-i+e):t}((t+i)*r,r,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 Vke(this,t)}_calculateOverlayOffsetX(){const t=this._overlayDir.overlayRef.overlayElement.getBoundingClientRect(),i=this._viewportRuler.getViewportSize(),r=this._isRtl(),s=this.multiple?56:32;let o;if(this.multiple)o=40;else if(this.disableOptionCentering)o=16;else{let c=this._selectionModel.selected[0]||this.options.first;o=c&&c.group?32:16}r||(o*=-1);const a=0-(t.left+o-(r?s:0)),l=t.right+o-i.width+(r?0:s);a>0?o+=a+8:l>0&&(o-=l+8),this._overlayDir.offsetX=Math.round(o),this._overlayDir.overlayRef.updatePosition()}_calculateOverlayOffsetY(t,i,r){const s=this._getItemHeight(),o=(s-this._triggerRect.height)/2,a=Math.floor(256/s);let l;return this.disableOptionCentering?0:(l=0===this._scrollTop?t*s:this._scrollTop===r?(t-(this._getItemCount()-a))*s+(s-(this._getItemCount()*s-256)%s):i-s/2,Math.round(-1*l-o))}_checkOverlayWithinViewport(t){const i=this._getItemHeight(),r=this._viewportRuler.getViewportSize(),s=this._triggerRect.top-8,o=r.height-this._triggerRect.bottom-8,a=Math.abs(this._offsetY),c=Math.min(this._getItemCount()*i,256)-a-this._triggerRect.height;c>o?this._adjustPanelUp(c,o):a>s?this._adjustPanelDown(a,s,t):this._transformOrigin=this._getOriginBasedOnOption()}_adjustPanelUp(t,i){const r=Math.round(t-i);this._scrollTop-=r,this._offsetY-=r,this._transformOrigin=this._getOriginBasedOnOption(),this._scrollTop<=0&&(this._scrollTop=0,this._offsetY=0,this._transformOrigin="50% bottom 0px")}_adjustPanelDown(t,i,r){const s=Math.round(t-i);if(this._scrollTop+=s,this._offsetY+=s,this._transformOrigin=this._getOriginBasedOnOption(),this._scrollTop>=r)return this._scrollTop=r,this._offsetY=0,void(this._transformOrigin="50% top 0px")}_calculateOverlayPosition(){const t=this._getItemHeight(),i=this._getItemCount(),r=Math.min(i*t,256),o=i*t-r;let a;a=this.empty?0:Math.max(this.options.toArray().indexOf(this._selectionModel.selected[0]),0),a+=BO(a,this.options,this.optionGroups);const l=r/2;this._scrollTop=this._calculateOverlayScroll(a,l,o),this._offsetY=this._calculateOverlayOffsetY(a,l,o),this._checkOverlayWithinViewport(o)}_getOriginBasedOnOption(){const t=this._getItemHeight(),i=(t-this._triggerRect.height)/2;return`50% ${Math.abs(this._offsetY)-i+t/2}px 0px`}_getItemHeight(){return 3*this._triggerFontSize}_getItemCount(){return this.options.length+this.optionGroups.length}}return n.\u0275fac=function(){let e;return function(i){return(e||(e=$n(n)))(i||n)}}(),n.\u0275cmp=Ne({type:n,selectors:[["mat-select"]],contentQueries:function(t,i,r){if(1&t&&(ei(r,W9,5),ei(r,eS,5),ei(r,JE,5)),2&t){let s;_t(s=yt())&&(i.customTrigger=s.first),_t(s=yt())&&(i.options=s),_t(s=yt())&&(i.optionGroups=s)}},hostAttrs:["role","combobox","aria-autocomplete","none","aria-haspopup","true",1,"mat-select"],hostVars:20,hostBindings:function(t,i){1&t&&ge("keydown",function(s){return i._handleKeydown(s)})("focus",function(){return i._onFocus()})("blur",function(){return i._onBlur()}),2&t&&(nn("id",i.id)("tabindex",i.tabIndex)("aria-controls",i.panelOpen?i.id+"-panel":null)("aria-expanded",i.panelOpen)("aria-label",i.ariaLabel||null)("aria-required",i.required.toString())("aria-disabled",i.disabled.toString())("aria-invalid",i.errorState)("aria-describedby",i._ariaDescribedby||null)("aria-activedescendant",i._getAriaActiveDescendant()),st("mat-select-disabled",i.disabled)("mat-select-invalid",i.errorState)("mat-select-required",i.required)("mat-select-empty",i.empty)("mat-select-multiple",i.multiple))},inputs:{disabled:"disabled",disableRipple:"disableRipple",tabIndex:"tabIndex"},exportAs:["matSelect"],features:[Dt([{provide:jv,useExisting:n},{provide:QE,useExisting:n}]),ct],ngContentSelectors:Rke,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,i){if(1&t&&(wi(Pke),R(0,"div",0,1),ge("click",function(){return i.toggle()}),R(3,"div",2),mt(4,Tke,2,1,"span",3),mt(5,Oke,3,2,"span",4),k(),R(6,"div",5),tt(7,"div",6),k(),k(),mt(8,Ike,4,14,"ng-template",7),ge("backdropClick",function(){return i.close()})("attach",function(){return i._onAttached()})("detach",function(){return i.close()})),2&t){const r=vs(1);nn("aria-owns",i.panelOpen?i.id+"-panel":null),G(3),ie("ngSwitch",i.empty),nn("id",i._valueId),G(1),ie("ngSwitchCase",!0),G(1),ie("ngSwitchCase",!1),G(3),ie("cdkConnectedOverlayPanelClass",i._overlayPanelClass)("cdkConnectedOverlayScrollStrategy",i._scrollStrategy)("cdkConnectedOverlayOrigin",r)("cdkConnectedOverlayOpen",i.panelOpen)("cdkConnectedOverlayPositions",i._positions)("cdkConnectedOverlayMinWidth",null==i._triggerRect?null:i._triggerRect.width)("cdkConnectedOverlayOffsetY",i._offsetY)}},directives:[Pae,Av,ID,sU,Z3,hE],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:[U9.transformPanelWrap,U9.transformPanel]},changeDetection:0}),n})(),q9=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({providers:[Bke],imports:[[dn,Yv,tS,On],Wv,Uv,tS,On]}),n})();function Hke(n,e){if(1&n&&(R(0,"mat-option",5),De(1),k()),2&n){const t=e.$implicit;ie("value",t),G(1),Aw(" ",t.name," (",t.sites.length,") ")}}function $ke(n,e){if(1&n){const t=Zi();R(0,"mat-form-field",1),R(1,"mat-label",2),De(2,"Landmark Set"),k(),R(3,"mat-select",3),ge("selectionChange",function(r){return en(t),Qe().extractionSetChanged(r.value)}),mt(4,Hke,2,3,"mat-option",4),k(),k()}if(2&n){const t=Qe();G(3),ie("value",t.sets[0]),G(1),ie("ngForOf",t.sets)}}let Gke=(()=>{class n{constructor(t){this.ga=t,this.clsName="ccf-extraction-set-dropdown",this.setChange=new Le}extractionSetChanged(t){this.selected=t,this.ga.event("selected_extraction_set_change","extraction_set_dropdown",t.name),this.setChange.emit(t)}isMultiple(){return this.sets.length>1}}return n.\u0275fac=function(t){return new(t||n)(E(xs))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-extraction-set-dropdown"]],hostVars:2,hostBindings:function(t,i){2&t&&Rn(i.clsName)},inputs:{sets:"sets"},outputs:{setChange:"setChange"},decls:1,vars:1,consts:[["class","dropdown-form-field","appearance","fill",4,"ngIf"],["appearance","fill",1,"dropdown-form-field"],[1,"extraction-dropdown-label"],["disableOptionCentering","true","panelClass","extraction-set-panel",3,"value","selectionChange"],["class","extraction-set-options",3,"value",4,"ngFor","ngForOf"],[1,"extraction-set-options",3,"value"]],template:function(t,i){1&t&&mt(0,$ke,5,2,"mat-form-field",0),2&t&&ie("ngIf",i.isMultiple())},directives:[zr,am,Gf,Uke,pl,eS],styles:[".extraction-set-panel{box-shadow:0 0 .3rem .1rem #9e9e9e;position:absolute;top:-1rem;left:1rem;width:10.5rem} .extraction-set-panel .extraction-set-options{height:2.5rem!important} .extraction-set-panel .extraction-set-options:first-child{margin-top:.5rem} .extraction-set-panel .extraction-set-options:last-child{margin-bottom:.5rem}[_nghost-%COMP%] .mat-form-field{width:10.5rem}[_nghost-%COMP%] .mat-form-field .mat-form-field-wrapper{padding-bottom:.5rem}[_nghost-%COMP%] .mat-form-field .mat-form-field-wrapper .mat-form-field-flex{padding:0}[_nghost-%COMP%] .mat-form-field .mat-form-field-wrapper .mat-form-field-underline{bottom:.75rem}[_nghost-%COMP%] .mat-form-field .mat-form-field-wrapper .mat-select-arrow-wrapper{transform:none} .cdk-overlay-pane{min-width:0rem!important}"],changeDetection:0}),n})();function Wke(n,e){if(1&n&&(_f(0),tt(1,"ccf-details-label",19),Kt(2,"async"),yf()),2&n){const t=Qe();G(1),ie("details",rn(2,1,t.detailsLabels$))}}function qke(n,e){if(1&n){const t=Zi();R(0,"div",9),R(1,"ccf-extraction-set-dropdown",20,21),ge("setChange",function(r){return en(t),Qe().model.setExtractionSites(r.sites)}),Kt(3,"async"),k(),R(4,"ccf-visibility-menu",22),ge("itemsChange",function(r){return en(t),Qe().model.setExtractionSites(r)})("hover",function(r){return en(t),Qe().updateExtractionSiteTooltip(r)}),Kt(5,"async"),k(),k()}if(2&n){const t=Qe();G(1),ie("sets",rn(3,2,t.model.extractionSets$)),G(3),ie("items",rn(5,4,t.model.extractionSites$))}}function Yke(n,e){if(1&n&&(R(0,"div",23),De(1),k()),2&n){const t=Qe();G(1),or(" ",t.extractionSiteTooltip," ")}}const Xke=function(){return["Male","Female"]};let Kke=(()=>{class n{constructor(t,i,r){this.page=t,this.model=i,this.registration=r,this.clsName="ccf-left-sidebar",this.disableSlider=!1,this.modalClosed=!1,this.sexByLabel$=this.model.sex$.pipe(Ae(s=>"female"===s?"Female":"Male")),this.sideByLabel$=this.model.side$.pipe(Ae(s=>"left"===s?"L":"R")),this.organSelected$=this.model.organ$.pipe(Ae(s=>void 0!==s)),this.detailsLabels$=Qi([this.model.organ$,this.model.side$,this.model.sex$]).pipe(Ae(([s,o,a])=>[null==s?void 0:s.name,o,a])),this.extractionSiteTooltip="",this.previousVisibilityItems=[...this.model.snapshot.anatomicalStructures],this.organList=qF}updateExtractionSiteTooltip(t){this.extractionSiteTooltip=(null==t?void 0:t.tooltip)?t.tooltip:""}setSexFromLabel(t){this.model.setSex("Female"===t?"female":"male")}setSideFromLabel(t){this.model.setSide("L"===t?"left":"right")}togglePreviousRegistrationBlocks(t){t&&(this.previousVisibilityItems=[...this.model.snapshot.anatomicalStructures]),this.model.toggleRegistrationBlocksVisibility(t,this.previousVisibilityItems)}updateRegistration(t){this.registration.editRegistration(t)}}return n.\u0275fac=function(t){return new(t||n)(E(ji),E(ai),E(Sr))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-left-sidebar"]],hostVars:2,hostBindings:function(t,i){2&t&&Rn(i.clsName)},inputs:{disableSlider:"disableSlider",modalClosed:"modalClosed"},decls:31,vars:22,consts:[[1,"scroll-wrapper"],[1,"container"],[4,"ngIf"],["matTooltip","Select sex to filter organs.",1,"organ-sliders"],[1,"slider-label"],[1,"toggle","gender",3,"disabled","labels","value","valueChange"],[1,"anatomical-structures-menu",3,"expanded"],[1,"expansion-header"],["matTooltip","Use opacity icons to change visibility of anatomical structures",1,"expansion-title"],[1,"expansion-content"],[3,"items","itemsChange"],[1,"extraction-menu",3,"expanded"],["matTooltip","Some organs have predefined landmarks to guide manual tissue registration--you can turn these on/off.",1,"expansion-title"],["class","expansion-content",4,"ngIf"],["toggleLabel","Previously Registered Blocks","matTooltip","If you previously registered tissue blocks, you can turn their positions on/off.",3,"visible","disabled","visibilityChanged"],[1,"space"],["class","extraction-site-tooltip mat-elevation-z8",4,"ngIf"],[1,"filler"],["label","UPLOAD PREVIOUS REGISTRATION DATA",3,"parsedJson"],[3,"details"],[3,"sets","setChange"],["dropdown",""],[3,"items","itemsChange","hover"],[1,"extraction-site-tooltip","mat-elevation-z8"]],template:function(t,i){1&t&&(R(0,"div",0),R(1,"div",1),mt(2,Wke,3,3,"ng-container",2),Kt(3,"async"),R(4,"div",3),R(5,"div",4),De(6,"Donor Sex:"),k(),R(7,"ccf-labeled-slide-toggle",5),ge("valueChange",function(s){return i.setSexFromLabel(s)}),Kt(8,"async"),k(),k(),tt(9,"mat-divider"),R(10,"mat-expansion-panel",6),R(11,"mat-expansion-panel-header",7),R(12,"mat-panel-title",8),De(13,"Anatomical Structures"),k(),k(),R(14,"div",9),R(15,"ccf-visibility-menu",10),ge("itemsChange",function(s){return i.model.setAnatomicalStructures(s)}),Kt(16,"async"),k(),k(),k(),tt(17,"mat-divider"),R(18,"mat-expansion-panel",11),R(19,"mat-expansion-panel-header",7),R(20,"mat-panel-title",12),De(21,"Landmarks"),k(),k(),mt(22,qke,6,6,"div",13),Kt(23,"async"),k(),tt(24,"mat-divider"),R(25,"ccf-visibility-toggle",14),ge("visibilityChanged",function(s){return i.togglePreviousRegistrationBlocks(s)}),Kt(26,"async"),k(),tt(27,"div",15),mt(28,Yke,2,1,"div",16),tt(29,"div",17),R(30,"ccf-json-file-reader",18),ge("parsedJson",function(s){return i.updateRegistration(s)}),k(),k(),k()),2&t&&(G(2),ie("ngIf",rn(3,11,i.page.registrationCallbackSet$)),G(5),ie("disabled",i.disableSlider)("labels",fv(21,Xke))("value",rn(8,13,i.sexByLabel$)),G(3),ie("expanded",i.modalClosed),G(5),ie("items",rn(16,15,i.model.anatomicalStructures$)),G(3),ie("expanded",i.modalClosed),G(4),ie("ngIf",rn(23,17,i.organSelected$)),G(3),ie("visible",rn(26,19,i.model.showPrevious$))("disabled",i.disableSlider),G(3),ie("ngIf",i.extractionSiteTooltip.length>0))},directives:[zr,dc,XF,n9,qM,YM,EW,cke,Cke,Eke,Ske,Gke],pipes:[Hc],styles:["[_nghost-%COMP%]{display:block;height:calc(100% - 3rem);margin-top:1.5rem;margin-bottom:1.5rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%]{overflow-y:scroll;height:100%;margin-right:.375rem;scrollbar-width:thin}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%]::-webkit-scrollbar{width:.75rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%]{display:flex;flex-direction:column;margin-left:1.5rem;margin-right:.375rem;min-height:100%}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .space[_ngcontent-%COMP%]{height:3rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] mat-divider[_ngcontent-%COMP%]{border-top-width:3px}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .ccf-organ-selector[_ngcontent-%COMP%]{margin-top:1.5rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .organ-sliders[_ngcontent-%COMP%]{display:flex;height:3rem;align-items:center}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .organ-sliders[_ngcontent-%COMP%] .slider-label[_ngcontent-%COMP%]{font-weight:600}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] mat-expansion-panel[_ngcontent-%COMP%]{box-shadow:none}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] mat-expansion-panel[_ngcontent-%COMP%] mat-expansion-panel-header[_ngcontent-%COMP%] .expansion-title[_ngcontent-%COMP%]{font-size:1rem;font-weight:600}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .mat-expansion-panel-body{padding:0}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .extraction-menu[_ngcontent-%COMP%] .expansion-header, [_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .anatomical-structures-menu[_ngcontent-%COMP%] .expansion-header{-webkit-user-select:none;-moz-user-select:none;padding:0;font-weight:bold;height:3rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .extraction-menu[_ngcontent-%COMP%] .expansion-header .mat-expansion-indicator, [_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .anatomical-structures-menu[_ngcontent-%COMP%] .expansion-header .mat-expansion-indicator{display:flex;align-items:center;justify-content:center;height:24px;width:24px}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .extraction-menu[_ngcontent-%COMP%] .expansion-content[_ngcontent-%COMP%], [_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .anatomical-structures-menu[_ngcontent-%COMP%] .expansion-content[_ngcontent-%COMP%]{margin-bottom:.75rem;text-align:center;margin-top:2.25rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .extraction-menu[_ngcontent-%COMP%] .expansion-content[_ngcontent-%COMP%] .expansion-placeholder[_ngcontent-%COMP%], [_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .anatomical-structures-menu[_ngcontent-%COMP%] .expansion-content[_ngcontent-%COMP%] .expansion-placeholder[_ngcontent-%COMP%]{width:100%;font-size:.9rem;font-weight:400}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .extraction-site-tooltip[_ngcontent-%COMP%]{position:absolute;top:4rem;left:27rem;width:21rem;padding:1rem;border-radius:.5rem;border:1px solid;z-index:2}[_nghost-%COMP%] .filler[_ngcontent-%COMP%]{flex-grow:1}"],changeDetection:0}),n})(),Zke=(()=>{class n{constructor(t,i,r){this.drawer=t,this.cdr=r,this.className="ccf-drawer-toggle-button",this.position="start",this.opened=!1,this.subscriptions=new Te;const s=i.connect(this);this.subscriptions.add(s.getMessagesFromSource(t).subscribe(o=>{this.handleMessage(o)&&r.markForCheck()}))}get classEnd(){return"end"===this.position}get icon(){let t="arrow_right",i="arrow_left";return"end"===this.position&&([t,i]=[i,t]),this.opened?i: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:i,expanded:r}=t;i?r?t.closeExpanded():t.close():t.open()}}return n.\u0275fac=function(t){return new(t||n)(E(ZF),E(_0),E(kn))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-drawer-toggle-button"]],hostVars:4,hostBindings:function(t,i){2&t&&(Rn(i.className),st("ccf-drawer-toggle-button-end",i.classEnd))},decls:4,vars:4,consts:[["aria-hidden","false","aria-label","Close side drawer",1,"expand-collapse-icon",3,"click"]],template:function(t,i){1&t&&(R(0,"mat-icon",0),ge("click",function(){return i.toggle()}),De(1," arrow_right\n"),k(),R(2,"mat-icon",0),ge("click",function(){return i.toggle()}),De(3," arrow_left\n"),k()),2&t&&(st("hidden","arrow_left"===i.icon),G(2),st("hidden","arrow_right"===i.icon))},directives:[rs],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;transition:.25s}.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:absolute;right:0rem;transition:.6s;padding-left:.15rem}[_nghost-%COMP%] .expand-collapse-icon.hidden[_ngcontent-%COMP%]{opacity:0}.ccf-drawer-toggle-button-end[_nghost-%COMP%] .expand-collapse-icon[_ngcontent-%COMP%]{right:unset;left:-.25rem}.mat-icon[_ngcontent-%COMP%]{right:.3rem;top:.675rem;padding-top:.05rem}"],changeDetection:0}),n})();const Y9={x:10,y:10,z:10};let Qke=(()=>{class n{constructor(t){this.ga=t,this.clsName="ccf-block-size-input",this.blockSize=Y9,this.blockSizeChange=new Le}updateBlockSizes(t,i){const r=t.target;this.blockSize=Object.assign(Object.assign({},this.blockSize),{[i]:+r.value}),this.ga.event("block_size_change","block_size_input",i,this.blockSize[i]),this.blockSizeChange.emit(this.blockSize)}refreshBlockSize(){this.blockSize=Y9,this.ga.event("block_size_reset","block_size_input"),this.blockSizeChange.emit(this.blockSize)}}return n.\u0275fac=function(t){return new(t||n)(E(xs))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-block-size-input"]],hostVars:2,hostBindings:function(t,i){2&t&&Rn(i.clsName)},inputs:{blockSize:"blockSize"},outputs:{blockSizeChange:"blockSizeChange"},decls:19,vars:5,consts:[["matTooltip","Set the tissue block width, height and depth (dimensions)",1,"header"],[1,"text","title"],[1,"filler"],["matRipple","",1,"icon","refresh",3,"matRippleCentered","matRippleUnbounded","click"],[1,"size-inputs"],["floatLabel","always",1,"field"],[1,"text","label"],["matInput","","type","number","placeholder","","matTooltip","Enter tissue block width.",1,"input",3,"value","input"],["matInput","","type","number","placeholder","","matTooltip","Enter tissue block height.",1,"input",3,"value","input"],["matInput","","type","number","placeholder","","matTooltip","Enter tissue block depth.",1,"input",3,"value","input"]],template:function(t,i){1&t&&(R(0,"div",0),R(1,"span",1),De(2,"Tissue Block Dimensions (mm)"),k(),tt(3,"div",2),R(4,"mat-icon",3),ge("click",function(){return i.refreshBlockSize()}),De(5,"refresh"),k(),k(),R(6,"div",4),R(7,"mat-form-field",5),R(8,"mat-label",6),De(9,"Width (X)"),k(),R(10,"input",7),ge("input",function(s){return i.updateBlockSizes(s,"x")}),k(),k(),R(11,"mat-form-field",5),R(12,"mat-label",6),De(13,"Height (Y)"),k(),R(14,"input",8),ge("input",function(s){return i.updateBlockSizes(s,"y")}),k(),k(),R(15,"mat-form-field",5),R(16,"mat-label",6),De(17,"Depth (Z)"),k(),R(18,"input",9),ge("input",function(s){return i.updateBlockSizes(s,"z")}),k(),k(),k()),2&t&&(G(4),ie("matRippleCentered",!0)("matRippleUnbounded",!0),G(6),ie("value",i.blockSize.x),G(4),ie("value",i.blockSize.y),G(4),ie("value",i.blockSize.z))},directives:[dc,rs,Js,am,Gf,Xb],styles:["[_nghost-%COMP%] input[type=number][_ngcontent-%COMP%]{-moz-appearance:textfield}[_nghost-%COMP%] .header[_ngcontent-%COMP%]{display:flex;height:1.5rem;align-items:center}[_nghost-%COMP%] .header[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-weight:600}[_nghost-%COMP%] .header[_ngcontent-%COMP%] .refresh[_ngcontent-%COMP%]{transform:scaleX(-1);cursor:pointer;transition:.6s}[_nghost-%COMP%] .header[_ngcontent-%COMP%] .refresh[_ngcontent-%COMP%]:hover{border-radius:2px}[_nghost-%COMP%] .size-inputs[_ngcontent-%COMP%]{display:flex}[_nghost-%COMP%] .size-inputs[_ngcontent-%COMP%] .field[_ngcontent-%COMP%]{width:33.33%}[_nghost-%COMP%] .size-inputs[_ngcontent-%COMP%] .field[_ngcontent-%COMP%]:not(:last-child){padding-right:.75rem}[_nghost-%COMP%] .size-inputs[_ngcontent-%COMP%] .field[_ngcontent-%COMP%] .input[_ngcontent-%COMP%]{text-align:center}[_nghost-%COMP%] .filler[_ngcontent-%COMP%]{flex-grow:1}"],changeDetection:0}),n})();const X9={thickness:NaN,numSlices:NaN};let Jke=(()=>{class n{constructor(t){this.ga=t,this.clsName="ccf-slices-input",this.slicesConfig=X9,this.slicesConfigChange=new Le}get hasThicknessValue(){return!isNaN(this.slicesConfig.thickness)}updateSlicesData(t,i){const{value:r}=t.target;this.slicesConfig=Object.assign(Object.assign({},this.slicesConfig),{[i]:""!==r?+r:NaN}),this.ga.event("slice_config_update","slice_input",i,this.slicesConfig[i]),this.slicesConfigChange.emit(this.slicesConfig)}refreshSlices(){this.slicesConfig=X9,this.ga.event("slice_config_reset","slice_input"),this.slicesConfigChange.emit(this.slicesConfig)}}return n.\u0275fac=function(t){return new(t||n)(E(xs))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-slices-input"]],hostVars:2,hostBindings:function(t,i){2&t&&Rn(i.clsName)},inputs:{slicesConfig:"slicesConfig"},outputs:{slicesConfigChange:"slicesConfigChange"},decls:17,vars:6,consts:[[1,"header"],["matTooltip","\u201cAdd thickness of tissue sections and the total number of sections",1,"text","title"],[1,"filler"],["matRipple","",1,"icon","refresh",3,"matRippleCentered","matRippleUnbounded","click"],[1,"slices-inputs"],[1,"field"],[1,"text","label"],["matInput","","ccfNumbersOnly","","type","number","matTooltip","Enter thickness of tissue sections",1,"input",3,"value","input"],["matSuffix","",1,"suffix"],["matInput","","ccfNumbersOnly","","type","number","matTooltip","Enter total number of sections",1,"input",3,"value","input"]],template:function(t,i){1&t&&(R(0,"div",0),R(1,"span",1),De(2,"Tissue Sections"),k(),tt(3,"div",2),R(4,"mat-icon",3),ge("click",function(){return i.refreshSlices()}),De(5," refresh "),k(),k(),R(6,"div",4),R(7,"mat-form-field",5),R(8,"mat-label",6),De(9,"Thickness"),k(),R(10,"input",7),ge("input",function(s){return i.updateSlicesData(s,"thickness")}),k(),R(11,"div",8),De(12,"\u03bcm"),k(),k(),R(13,"mat-form-field",5),R(14,"mat-label",6),De(15,"# Sections"),k(),R(16,"input",9),ge("input",function(s){return i.updateSlicesData(s,"numSlices")}),k(),k(),k()),2&t&&(G(4),ie("matRippleCentered",!0)("matRippleUnbounded",!0),G(6),ie("value",i.slicesConfig.thickness),G(1),st("show",i.hasThicknessValue),G(5),ie("value",i.slicesConfig.numSlices))},directives:[dc,rs,Js,am,Gf,Xb,WPe,VO],styles:["[_nghost-%COMP%] input[type=number][_ngcontent-%COMP%]{-moz-appearance:textfield}[_nghost-%COMP%] .header[_ngcontent-%COMP%]{display:flex;align-items:center;height:1.5rem}[_nghost-%COMP%] .header[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-weight:600}[_nghost-%COMP%] .header[_ngcontent-%COMP%] .refresh[_ngcontent-%COMP%]{transform:scaleX(-1);cursor:pointer;transition:.6s}[_nghost-%COMP%] .header[_ngcontent-%COMP%] .refresh[_ngcontent-%COMP%]:hover{border-radius:2px}[_nghost-%COMP%] .slices-inputs[_ngcontent-%COMP%]{display:flex}[_nghost-%COMP%] .slices-inputs[_ngcontent-%COMP%] .field[_ngcontent-%COMP%]{width:33.33%}[_nghost-%COMP%] .slices-inputs[_ngcontent-%COMP%] .field[_ngcontent-%COMP%]:not(:last-child){padding-right:.75rem}[_nghost-%COMP%] .slices-inputs[_ngcontent-%COMP%] .field[_ngcontent-%COMP%] .input[_ngcontent-%COMP%]{text-align:center}[_nghost-%COMP%] .slices-inputs[_ngcontent-%COMP%] .field[_ngcontent-%COMP%] .suffix[_ngcontent-%COMP%]{display:none}[_nghost-%COMP%] .slices-inputs[_ngcontent-%COMP%] .field.mat-focused[_ngcontent-%COMP%] .suffix[_ngcontent-%COMP%], [_nghost-%COMP%] .slices-inputs[_ngcontent-%COMP%] .field[_ngcontent-%COMP%] .suffix.show[_ngcontent-%COMP%]{display:initial}[_nghost-%COMP%] .filler[_ngcontent-%COMP%]{flex-grow:1}"],changeDetection:0}),n})();const K9={x:0,y:0,z:0};let eFe=(()=>{class n{constructor(t){this.ga=t,this.clsName="ccf-rotation-slider",this.rotation=K9,this.rotationChange=new Le}changeRotation(t,i){this.rotation=Object.assign(Object.assign({},this.rotation),{[i]:+t}),this.ga.event("rotation_update","rotation_slider",i,+t),this.rotationChange.emit(this.rotation)}resetRotation(){this.rotation=K9,this.ga.event("rotation_reset","rotation_slider"),this.rotationChange.emit(this.rotation)}}return n.\u0275fac=function(t){return new(t||n)(E(xs))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-rotation-slider"]],hostVars:2,hostBindings:function(t,i){2&t&&Rn(i.clsName)},inputs:{rotation:"rotation"},outputs:{rotationChange:"rotationChange"},decls:27,vars:23,consts:[[1,"header"],["matTooltip","Use sliders below to rotate tissue block for registration",1,"text","title"],[1,"filler"],["matRipple","",1,"icon","reset",3,"matRippleCentered","matRippleUnbounded","click"],[1,"slider-box","red"],[1,"text","label"],[1,"slider-container"],[1,"slider",3,"max","min","step","thumbLabel","tickInterval","value","input"],[1,"text","value"],[1,"slider-box","green"],[1,"slider-box","blue"]],template:function(t,i){1&t&&(R(0,"div",0),R(1,"span",1),De(2,"Tissue Block Rotation"),k(),tt(3,"div",2),R(4,"mat-icon",3),ge("click",function(){return i.resetRotation()}),De(5,"refresh"),k(),k(),R(6,"div",4),R(7,"span",5),De(8,"X"),k(),R(9,"div",6),R(10,"mat-slider",7),ge("input",function(s){return i.changeRotation(s.value,"x")}),k(),k(),R(11,"span",8),De(12),k(),k(),R(13,"div",9),R(14,"span",5),De(15,"Y"),k(),R(16,"div",6),R(17,"mat-slider",7),ge("input",function(s){return i.changeRotation(s.value,"y")}),k(),k(),R(18,"span",8),De(19),k(),k(),R(20,"div",10),R(21,"span",5),De(22,"Z"),k(),R(23,"div",6),R(24,"mat-slider",7),ge("input",function(s){return i.changeRotation(s.value,"z")}),k(),k(),R(25,"span",8),De(26),k(),k()),2&t&&(G(4),ie("matRippleCentered",!0)("matRippleUnbounded",!0),G(6),ie("max",180)("min",-180)("step",1)("thumbLabel",!0)("tickInterval",180)("value",i.rotation.x),G(2),xi(i.rotation.x),G(5),ie("max",180)("min",-180)("step",1)("thumbLabel",!0)("tickInterval",180)("value",i.rotation.y),G(2),xi(i.rotation.y),G(5),ie("max",180)("min",-180)("step",1)("thumbLabel",!0)("tickInterval",180)("value",i.rotation.z),G(2),xi(i.rotation.z))},directives:[dc,rs,Js,jk],styles:["[_nghost-%COMP%] .header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;height:1.5rem}[_nghost-%COMP%] .header[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-weight:600}[_nghost-%COMP%] .header[_ngcontent-%COMP%] .reset[_ngcontent-%COMP%]{transform:scaleX(-1);cursor:pointer;transition:.6s}[_nghost-%COMP%] .header[_ngcontent-%COMP%] .reset[_ngcontent-%COMP%]:hover{border-radius:2px}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;height:4rem;padding-left:.5rem}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{width:1rem}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .value[_ngcontent-%COMP%]{width:2.75rem;text-align:center}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .slider-container[_ngcontent-%COMP%]{width:100%;padding:1rem 2rem}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .slider-container[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%]{width:100%}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .slider-container[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%]:not(.cdk-focused) .mat-slider-thumb{width:1.25rem;height:1.25rem;transform:none}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .slider-container[_ngcontent-%COMP%] .mat-slider-horizontal .mat-slider-wrapper{right:.625rem}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .slider-container[_ngcontent-%COMP%] .mat-slider-horizontal .mat-slider-wrapper:after{margin-top:-.25rem;height:.625rem!important}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .slider-container[_ngcontent-%COMP%] .mat-slider-horizontal .mat-slider-ticks-container{margin-top:-.25rem;height:.625rem}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .slider-container[_ngcontent-%COMP%] .mat-slider-horizontal .mat-slider-ticks-container .mat-slider-ticks{height:.625rem}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .filler[_ngcontent-%COMP%]{flex-grow:1}"],changeDetection:0}),n})();function nFe(n){const{subscriber:e,counter:t,period:i}=n;e.next(t),this.schedule({subscriber:e,counter:t+1,period:i},i)}const iFe=["closeSearch"];function rFe(n,e){if(1&n){const t=Zi();R(0,"div",12),R(1,"mat-checkbox",13),ge("ngModelChange",function(r){const o=en(t).$implicit;return Qe(2).checkedResults[o.id]=r}),De(2),k(),k()}if(2&n){const t=e.$implicit,i=Qe(2);G(1),ie("ngModel",i.checkedResults[t.id]),G(1),or(" ",t.label," ")}}function sFe(n,e){if(1&n&&(R(0,"div",9),mt(1,rFe,3,2,"div",10),R(2,"div",11),De(3),Kt(4,"i18nPlural"),k(),k()),2&n){const t=Qe();G(1),ie("ngForOf",t.searchResults.results)("ngForTrackBy",t.tagId),G(2),or(" ",gv(4,3,t.searchResults.totalCount,t.countMapping)," ")}}const Z9=5,Ex={totalCount:0,results:[]};class Ep{constructor(e,t,i){this.el=e,this.ga=t,this.clsName="ccf-tag-search",this.placeholder="Add Anatomical Structures ...",this.added=new Le,this.countMapping={"=1":"1 result",other:"# results"},this.searchControl=new Sh,this.searchResults=Ex,this.checkedResults={},this.resultsVisible=!1,this.destroy$=new Se,this.searchControl.valueChanges.pipe(Tn(this.destroy$),function(n,e=uW){return t=>t.lift(new z1e(n,!!e.leading,!!e.trailing))}(()=>{var r;return function(n=0,e=Pf){return(!WO(n)||n<0)&&(n=0),(!e||"function"!=typeof e.schedule)&&(e=Pf),new ce(t=>(t.add(e.schedule(nFe,n,{subscriber:t,counter:0,period:n})),t))}(null!==(r=this.searchThrottle)&&void 0!==r?r:100)},{leading:!0,trailing:!0}),Pr(this.executeSearch)).subscribe(r=>{this.searchResults=r,this.checkedResults=this.getUpdatedCheckedResults(r),i.markForCheck()})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}tagId(e,t){return t.id}hasCheckedTags(){return Object.values(this.checkedResults).some(e=>e)}addTags(){const{searchControl:e,searchResults:t,checkedResults:i}=this,r=t.results.filter(s=>i[s.id]);r.length>0&&(e.reset(),this.searchResults=Ex,this.checkedResults={},this.ga.event("tags_added","tag_search",r.map(s=>s.label).join(",")),this.added.emit(r))}openResults(){this.resultsVisible||(this.resultsVisible=!0)}closeResults(e){const{closeSearch:t}=this;this.resultsVisible&&e.target instanceof Node&&(!this.el.nativeElement.contains(e.target)||t.nativeElement.contains(e.target))&&(this.resultsVisible=!1)}executeSearch(e){const{search:t,searchLimit:i=Z9}=this;return e&&t?ui(t(e,i)).pipe(Ta(()=>[Ex]),Ae(this.truncateResults)):[Ex]}truncateResults(e){const{searchLimit:t=Z9}=this,i=e.results;return i.length>t?Object.assign(Object.assign({},e),{results:i.slice(0,t)}):e}getUpdatedCheckedResults(e){const t=this.checkedResults;return e.results.reduce((i,{id:r})=>{var s;return i[r]=null!==(s=t[r])&&void 0!==s&&s,i},{})}}function aFe(n,e){if(1&n&&(R(0,"div",11),R(1,"div",12),De(2),k(),R(3,"div",13),De(4),k(),k()),2&n){const t=e.$implicit;G(2),xi(t.label),G(2),xi(t.value)}}Ep.\u0275fac=function(e){return new(e||Ep)(E(rt),E(xs),E(kn))},Ep.\u0275cmp=Ne({type:Ep,selectors:[["ccf-tag-search"]],viewQuery:function(e,t){if(1&e&&Jn(iFe,5,rt),2&e){let i;_t(i=yt())&&(t.closeSearch=i.first)}},hostVars:2,hostBindings:function(e,t){1&e&&ge("click",function(){return t.openResults()})("focusin",function(){return t.openResults()})("click",function(r){return t.closeResults(r)},!1,ly)("focusin",function(r){return t.closeResults(r)},!1,ly),2&e&&Rn(t.clsName)},inputs:{placeholder:"placeholder",search:"search",searchLimit:"searchLimit",searchThrottle:"searchThrottle"},outputs:{added:"added"},decls:10,vars:8,consts:[[1,"spacer"],["appearance","outline",1,"overlay"],[1,"search-box"],["matInput","","type","search",3,"placeholder","formControl"],["search",""],["matSuffix","",1,"add-button",3,"disabled","click"],["closeSearch",""],[1,"icon"],["class","results",4,"ngIf"],[1,"results"],["class","item",4,"ngFor","ngForOf","ngForTrackBy"],[1,"count"],[1,"item"],["labelPosition","after",3,"ngModel","ngModelChange"]],template:function(e,t){if(1&e){const i=Zi();tt(0,"div",0),R(1,"mat-form-field",1),R(2,"div",2),tt(3,"input",3,4),R(5,"button",5,6),ge("click",function(){en(i);const s=vs(4);return t.addTags(),s.focus()}),R(7,"mat-icon",7),De(8,"add"),k(),k(),k(),mt(9,sFe,5,6,"div",8),k()}2&e&&(G(1),st("expanded",t.resultsVisible),G(2),ie("placeholder",t.placeholder)("formControl",t.searchControl),G(2),st("active",t.hasCheckedTags()),ie("disabled",!t.hasCheckedTags()),G(4),ie("ngIf",t.resultsVisible))},directives:[am,Xb,Hb,vk,GM,VO,rs,zr,pl,VF,Ok],pipes:[eV],styles:["[_nghost-%COMP%]{display:block;position:relative}[_nghost-%COMP%] .spacer[_ngcontent-%COMP%]{height:3.25rem}[_nghost-%COMP%] .overlay[_ngcontent-%COMP%]{position:absolute;top:0;left:0;right:0;z-index:10}[_nghost-%COMP%] .overlay[_ngcontent-%COMP%] .search-box[_ngcontent-%COMP%]{display:flex;width:100%;align-items:center;height:3rem}[_nghost-%COMP%] .overlay[_ngcontent-%COMP%] .search-box[_ngcontent-%COMP%] .add-button[_ngcontent-%COMP%]{border-radius:.25rem;border:none;display:flex;justify-content:center;align-items:center;cursor:pointer;height:100%}[_nghost-%COMP%] .overlay[_ngcontent-%COMP%] .results[_ngcontent-%COMP%]{margin-top:.5rem}[_nghost-%COMP%] .overlay[_ngcontent-%COMP%] .results[_ngcontent-%COMP%] .count[_ngcontent-%COMP%]{margin-top:.5rem;font-size:.75rem;text-align:end}[_nghost-%COMP%] .overlay[_ngcontent-%COMP%] .mat-form-field-wrapper{padding-bottom:0;border-radius:.5rem}[_nghost-%COMP%] .overlay[_ngcontent-%COMP%] .mat-form-field-wrapper .mat-form-field-flex{padding-right:0!important}[_nghost-%COMP%] .overlay[_ngcontent-%COMP%] .mat-form-field-outline{opacity:1!important}[_nghost-%COMP%] .overlay[_ngcontent-%COMP%] .mat-form-field-outline-thick{opacity:0!important}[_nghost-%COMP%] .overlay[_ngcontent-%COMP%] .mat-form-field-infix{padding:.313rem .063rem .063rem;border:0}[_nghost-%COMP%] .overlay.expanded[_ngcontent-%COMP%] .mat-form-field-wrapper{box-shadow:0 0 .3rem .1rem #9e9e9e5e}"],changeDetection:0}),xe([lu.ak],Ep.prototype,"executeSearch",null),xe([lu.ak],Ep.prototype,"truncateResults",null);let lFe=(()=>{class n{constructor(t,i){this.dialogRef=t,this.data=i,this.clsName="ccf-review-modal",this.metaData=i.metaData,this.registrationCallbackSet=i.registrationCallbackSet}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 n.\u0275fac=function(t){return new(t||n)(E(Qm),E(Gk))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-review-modal"]],hostVars:2,hostBindings:function(t,i){2&t&&Rn(i.clsName)},decls:14,vars:2,consts:[[1,"ccf-about","wrapper"],[1,"container"],[1,"close"],[1,"material-icons","close-icon",3,"click"],[1,"content"],["mat-dialog-title","",1,"title"],[1,"mat-typography"],[1,"display-fields"],["class","field",4,"ngFor","ngForOf"],[1,"footer"],["mat-button","",1,"download-button",3,"click"],[1,"field"],[1,"label"],[1,"data"]],template:function(t,i){1&t&&(R(0,"div",0),R(1,"div",1),R(2,"div",2),R(3,"mat-icon",3),ge("click",function(){return i.close()}),De(4,"clear"),k(),k(),R(5,"div",4),R(6,"h2",5),De(7,"Registration Review"),k(),R(8,"mat-dialog-content",6),R(9,"div",7),mt(10,aFe,5,2,"div",8),k(),k(),R(11,"div",9),R(12,"button",10),ge("click",function(){return i.dialogRef.close(!0)}),De(13),k(),k(),k(),k(),k()),2&t&&(G(10),ie("ngForOf",i.metaData),G(3),xi(i.registrationCallbackSet?"REGISTER":"DOWNLOAD REGISTRATION DATA"))},directives:[rs,Wk,qk,pl,lh],styles:[".mat-dialog-container{padding:0}[_nghost-%COMP%] .ccf-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .content[_ngcontent-%COMP%]{padding:3rem;background-color:#fff}[_nghost-%COMP%] .ccf-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .content[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{text-align:center;font-size:1.5rem;margin-bottom:0}[_nghost-%COMP%] .ccf-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .content[_ngcontent-%COMP%] .mat-typography[_ngcontent-%COMP%]{justify-content:space-around;display:flex}[_nghost-%COMP%] .ccf-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .content[_ngcontent-%COMP%] .mat-typography[_ngcontent-%COMP%] .display-fields[_ngcontent-%COMP%]{margin-top:2rem;margin-bottom:2rem;width:100%}[_nghost-%COMP%] .ccf-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .content[_ngcontent-%COMP%] .mat-typography[_ngcontent-%COMP%] .display-fields[_ngcontent-%COMP%] .field[_ngcontent-%COMP%]{display:flex}[_nghost-%COMP%] .ccf-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .content[_ngcontent-%COMP%] .mat-typography[_ngcontent-%COMP%] .display-fields[_ngcontent-%COMP%] .field[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{width:50%;text-align:right;padding-right:1rem}[_nghost-%COMP%] .ccf-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .content[_ngcontent-%COMP%] .mat-typography[_ngcontent-%COMP%] .display-fields[_ngcontent-%COMP%] .field[_ngcontent-%COMP%] .data[_ngcontent-%COMP%]{width:50%;text-align:left;padding-left:1rem}[_nghost-%COMP%] .ccf-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .close[_ngcontent-%COMP%] .close-icon[_ngcontent-%COMP%]{float:right;margin-top:1rem;margin-right:1rem;cursor:pointer}[_nghost-%COMP%] .ccf-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .footer[_ngcontent-%COMP%]{padding-top:1.5rem;display:flex;justify-content:space-around}[_nghost-%COMP%] .ccf-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .footer[_ngcontent-%COMP%] .review-button[_ngcontent-%COMP%]{height:3rem;transition:.6s}"]}),n})(),cFe=(()=>{class n{constructor(t,i){this.dialog=t,this.ga=i,this.clsName="ccf-review-button",this.registrationCallbackSet=!0,this.metaData=[],this.displayErrors=!0,this.registrationIsValid=!1,this.registerData=new Le,this.enterErrorMode=new Le}ngOnChanges(){this.registrationIsValid=this.metaData.length>=3&&this.metaData.slice(0,3).every(t=>t.value)}get disabled(){return!this.registrationIsValid}registerButtonClick(t){return t&&t.preventDefault(),this.enterErrorMode.emit(),this.registrationIsValid&&(this.ga.event("review_start","review_button"),this.launchReviewModal()),!1}launchReviewModal(){this.dialog.open(lFe,{panelClass:"modal-animated",width:"60rem",data:{registrationCallbackSet:this.registrationCallbackSet,metaData:this.metaData}}).afterClosed().subscribe(i=>{i&&(this.ga.event("register","review_button"),this.registerData.emit())})}}return n.\u0275fac=function(t){return new(t||n)(E(_p),E(xs))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-review-button"]],hostVars:2,hostBindings:function(t,i){2&t&&Rn(i.clsName)},inputs:{registrationCallbackSet:"registrationCallbackSet",metaData:"metaData",displayErrors:"displayErrors",registrationIsValid:"registrationIsValid"},outputs:{registerData:"registerData",enterErrorMode:"enterErrorMode"},features:[zn],decls:2,vars:4,consts:[["mat-button","",1,"review-button",3,"matTooltip","click"]],template:function(t,i){1&t&&(R(0,"button",0),ge("click",function(s){return i.registerButtonClick(s)}),De(1),k()),2&t&&(st("disabled",i.disabled),ie("matTooltip",i.disabled?"Required: Select an organ and position tissue block inside organ.":"Review registration and submit/download."),G(1),or(" ",i.registrationCallbackSet?"REVIEW AND REGISTER":"REVIEW AND DOWNLOAD","\n"))},directives:[lh,dc],styles:[".review-button[_ngcontent-%COMP%]{width:100%;height:2.25rem;transition:.6s;font-weight:500}.review-button.disabled[_ngcontent-%COMP%]{cursor:not-allowed}"]}),n})();function uFe(n,e){if(1&n){const t=Zi();R(0,"mat-chip",2),ge("removed",function(){const s=en(t).$implicit;return Qe().removeTag(s)}),De(1),R(2,"mat-icon",3),De(3,"cancel"),k(),k()}if(2&n){const t=e.$implicit;Rn(Qe().tagClasses(t)),G(1),or(" ",t.label," ")}}let dFe=(()=>{class n{constructor(t){this.ga=t,this.clsName="ccf-tag-list",this.tagRemoved=new Le,this.tagsChange=new Le}tagId(t,i){return i.id}tagClasses(t){return"added"===t.type?["added"]:["assigned"]}removeTag(t){this.tags=this.tags.filter(i=>i!==t),this.ga.event("tag_removed","tag_list",t.label),this.tagRemoved.emit(t),this.tagsChange.emit(this.tags)}}return n.\u0275fac=function(t){return new(t||n)(E(xs))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-tag-list"]],hostVars:2,hostBindings:function(t,i){2&t&&Rn(i.clsName)},inputs:{tags:"tags"},outputs:{tagRemoved:"tagRemoved",tagsChange:"tagsChange"},decls:2,vars:2,consts:[["selectable","false"],["removable","","disableRipple","",3,"class","removed",4,"ngFor","ngForOf","ngForTrackBy"],["removable","","disableRipple","",3,"removed"],["matChipRemove","",1,"icon","remove"]],template:function(t,i){1&t&&(R(0,"mat-chip-list",0),mt(1,uFe,4,3,"mat-chip",1),k()),2&t&&(G(1),ie("ngForOf",i.tags)("ngForTrackBy",i.tagId))},directives:[z9,pl,y0,rs,B9],styles:["[_nghost-%COMP%]{display:block;overflow-x:hidden;overflow-y:auto}[_nghost-%COMP%] .mat-chip-list-wrapper{margin:0}"],changeDetection:0}),n})();function hFe(n,e){if(1&n){const t=Zi();R(0,"ccf-tag-list",20),ge("tagRemoved",function(r){return en(t),Qe().astags.removeTag(r)}),Kt(1,"async"),k()}2&n&&ie("tags",rn(1,1,Qe().astags.tags$))}function fFe(n,e){}const pFe=function(){return[]};let gFe=(()=>{class n{constructor(t,i,r,s){this.model=t,this.registration=i,this.page=r,this.astags=s,this.clsName="ccf-right-sidebar",this.modalClosed=!1}}return n.\u0275fac=function(t){return new(t||n)(E(ai),E(Sr),E(ji),E(ko))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-right-sidebar"]],hostVars:2,hostBindings:function(t,i){2&t&&Rn(i.clsName)},inputs:{modalClosed:"modalClosed"},decls:34,vars:28,consts:[[1,"scroll-wrapper"],[1,"container"],[1,"info-button-container"],["videoID","gY3_-LIoKaU","infoTitle","CCF Registration User Interface","documentationUrl","assets/docs/README.md"],[3,"blockSize","blockSizeChange"],[3,"slicesConfig","slicesConfigChange"],[3,"rotation","rotationChange"],[1,"tags-container",3,"expanded"],[1,"header"],["matTooltip","Review tags generated via collision detection. Add or delete tags as needed."],[3,"search","added"],["class","tag-list",3,"tags","tagRemoved",4,"ngIf","ngIfElse"],["tagListPlaceholder",""],[1,"legend"],[1,"dot","assigned"],[1,"text","assigned"],[1,"dot","added"],[1,"text","added"],[1,"filler"],[3,"registrationCallbackSet","displayErrors","registrationIsValid","metaData","registerData","enterErrorMode"],[1,"tag-list",3,"tags","tagRemoved"]],template:function(t,i){if(1&t&&(R(0,"div",0),R(1,"div",1),R(2,"div",2),tt(3,"ccf-info-button",3),k(),R(4,"ccf-block-size-input",4),ge("blockSizeChange",function(s){return i.model.setBlockSize(s)}),Kt(5,"async"),k(),R(6,"ccf-slices-input",5),ge("slicesConfigChange",function(s){return i.model.setSlicesConfig(s)}),Kt(7,"async"),k(),R(8,"ccf-rotation-slider",6),ge("rotationChange",function(s){return i.model.setRotation(s)}),Kt(9,"async"),k(),tt(10,"mat-divider"),R(11,"mat-expansion-panel",7),R(12,"mat-expansion-panel-header",8),R(13,"mat-panel-title",9),De(14,"Anatomical Structure Tags"),k(),k(),R(15,"ccf-tag-search",10),ge("added",function(s){return i.astags.addTags(s)}),k(),mt(16,hFe,2,3,"ccf-tag-list",11),Kt(17,"async"),mt(18,fFe,0,0,"ng-template",null,12,jw),R(20,"div",13),tt(21,"span",14),R(22,"span",15),De(23,"Assigned"),k(),tt(24,"span",16),R(25,"span",17),De(26,"Added"),k(),k(),k(),tt(27,"mat-divider"),tt(28,"div",18),R(29,"ccf-review-button",19),ge("registerData",function(){return i.registration.register()})("enterErrorMode",function(){return i.registration.setDisplayErrors(!i.registration.isValid)}),Kt(30,"async"),Kt(31,"async"),Kt(32,"async"),Kt(33,"async"),k(),k(),k()),2&t){const r=vs(19);let s,o;G(4),ie("blockSize",rn(5,11,i.model.blockSize$)),G(2),ie("slicesConfig",rn(7,13,i.model.slicesConfig$)),G(2),ie("rotation",rn(9,15,i.model.rotation$)),G(3),ie("expanded",i.modalClosed),G(4),ie("search",i.astags.searchExternal),G(1),ie("ngIf",null==(s=rn(17,17,i.model.organ$))?null:s.name)("ngIfElse",r),G(13),ie("registrationCallbackSet",rn(30,19,i.page.registrationCallbackSet$))("displayErrors",rn(31,21,i.registration.displayErrors$))("registrationIsValid",rn(32,23,i.registration.valid$))("metaData",null!==(o=rn(33,25,i.registration.metadata$))&&void 0!==o?o:fv(27,pFe))}},directives:[UPe,Qke,Jke,eFe,n9,qM,YM,EW,dc,Ep,zr,cFe,dFe],pipes:[Hc],styles:["[_nghost-%COMP%]{display:block;height:calc(100% - 3rem);margin-top:1.5rem;margin-bottom:1.5rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%]{height:100%;margin-right:.375rem;scrollbar-width:thin}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%]::-webkit-scrollbar{width:.75rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%]{display:flex;flex-direction:column;min-height:100%;margin-left:1.5rem;margin-right:.375rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .info-button-container[_ngcontent-%COMP%]{height:3.75rem;display:flex;justify-content:flex-end}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] mat-divider[_ngcontent-%COMP%]{border-top-width:3px}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] mat-expansion-panel[_ngcontent-%COMP%]{box-shadow:none}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] mat-expansion-panel[_ngcontent-%COMP%] mat-expansion-panel-header[_ngcontent-%COMP%]{padding:0 .5rem 0 0;font-weight:bold;-webkit-user-select:none;-moz-user-select:none;font-size:1rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .tags-container[_ngcontent-%COMP%]{overflow:visible}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .tags-container[_ngcontent-%COMP%] .mat-expansion-panel-body{padding-left:0;padding-right:0}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .tags-container[_ngcontent-%COMP%] .header[_ngcontent-%COMP%]{height:3rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .tags-container[_ngcontent-%COMP%] .search[_ngcontent-%COMP%]{margin-top:1rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .tags-container[_ngcontent-%COMP%] .search[_ngcontent-%COMP%] .icon.add[_ngcontent-%COMP%]{position:absolute;width:3.625rem;height:3.625rem;font-size:3.625rem;top:-1.9375rem;right:-1.1875rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .tags-container[_ngcontent-%COMP%] .tag-list[_ngcontent-%COMP%]{max-height:32rem;margin-left:-1rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .tags-container[_ngcontent-%COMP%] .tag-list-placeholder[_ngcontent-%COMP%]{display:flex;height:4rem;align-items:center;justify-content:center;font-weight:400}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .tags-container[_ngcontent-%COMP%] .legend[_ngcontent-%COMP%]{display:flex;width:100%;margin-top:1.5rem;align-items:center;font-size:.9rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .tags-container[_ngcontent-%COMP%] .legend[_ngcontent-%COMP%] .dot[_ngcontent-%COMP%]{display:inline-block;width:1rem;height:1rem;border-radius:50%}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .tags-container[_ngcontent-%COMP%] .legend[_ngcontent-%COMP%] .dot.assigned[_ngcontent-%COMP%]{margin-left:.5rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .tags-container[_ngcontent-%COMP%] .legend[_ngcontent-%COMP%] .dot.added[_ngcontent-%COMP%]{margin-left:1rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .tags-container[_ngcontent-%COMP%] .legend[_ngcontent-%COMP%] .text[_ngcontent-%COMP%]{margin-left:.5rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .filler[_ngcontent-%COMP%]{flex-grow:1}"],changeDetection:0}),n})();function Q9(n,e){return Zo((t,i)=>e?e(t[n],i[n]):t[n]===i[n])}const mFe=["input"],_Fe=function(n){return{enterDuration:n}},yFe=["*"],vFe=new ve("mat-radio-default-options",{providedIn:"root",factory:function(){return{color:"accent"}}});let J9=0;const CFe={provide:ro,useExisting:T(()=>i7),multi:!0};class e7{constructor(e,t){this.source=e,this.value=t}}const t7=new ve("MatRadioGroup");let n7=(()=>{class n{constructor(t){this._changeDetector=t,this._value=null,this._name="mat-radio-group-"+J9++,this._selected=null,this._isInitialized=!1,this._labelPosition="after",this._disabled=!1,this._required=!1,this._controlValueAccessorChangeFn=()=>{},this.onTouched=()=>{},this.change=new Le}get name(){return this._name}set name(t){this._name=t,this._updateRadioButtonNames()}get labelPosition(){return this._labelPosition}set labelPosition(t){this._labelPosition="before"===t?"before":"after",this._markRadiosForCheck()}get value(){return this._value}set value(t){this._value!==t&&(this._value=t,this._updateSelectedRadioFromValue(),this._checkSelectedRadioButton())}_checkSelectedRadioButton(){this._selected&&!this._selected.checked&&(this._selected.checked=!0)}get selected(){return this._selected}set selected(t){this._selected=t,this.value=t?t.value:null,this._checkSelectedRadioButton()}get disabled(){return this._disabled}set disabled(t){this._disabled=Mt(t),this._markRadiosForCheck()}get required(){return this._required}set required(t){this._required=Mt(t),this._markRadiosForCheck()}ngAfterContentInit(){this._isInitialized=!0}_touch(){this.onTouched&&this.onTouched()}_updateRadioButtonNames(){this._radios&&this._radios.forEach(t=>{t.name=this.name,t._markForCheck()})}_updateSelectedRadioFromValue(){this._radios&&(null===this._selected||this._selected.value!==this._value)&&(this._selected=null,this._radios.forEach(i=>{i.checked=this.value===i.value,i.checked&&(this._selected=i)}))}_emitChangeEvent(){this._isInitialized&&this.change.emit(new e7(this._selected,this._value))}_markRadiosForCheck(){this._radios&&this._radios.forEach(t=>t._markForCheck())}writeValue(t){this.value=t,this._changeDetector.markForCheck()}registerOnChange(t){this._controlValueAccessorChangeFn=t}registerOnTouched(t){this.onTouched=t}setDisabledState(t){this.disabled=t,this._changeDetector.markForCheck()}}return n.\u0275fac=function(t){return new(t||n)(E(kn))},n.\u0275dir=oe({type:n,inputs:{name:"name",labelPosition:"labelPosition",value:"value",selected:"selected",disabled:"disabled",required:"required",color:"color"},outputs:{change:"change"}}),n})(),i7=(()=>{class n extends n7{}return n.\u0275fac=function(){let e;return function(i){return(e||(e=$n(n)))(i||n)}}(),n.\u0275dir=oe({type:n,selectors:[["mat-radio-group"]],contentQueries:function(t,i,r){if(1&t&&ei(r,r7,5),2&t){let s;_t(s=yt())&&(i._radios=s)}},hostAttrs:["role","radiogroup",1,"mat-radio-group"],exportAs:["matRadioGroup"],features:[Dt([CFe,{provide:t7,useExisting:n}]),ct]}),n})();class wFe{constructor(e){this._elementRef=e}}const EFe=nc(Hf(wFe));let SFe=(()=>{class n extends EFe{constructor(t,i,r,s,o,a,l,c){super(i),this._changeDetector=r,this._focusMonitor=s,this._radioDispatcher=o,this._providerOverride=l,this._uniqueId="mat-radio-"+ ++J9,this.id=this._uniqueId,this.change=new Le,this._checked=!1,this._value=null,this._removeUniqueSelectionListener=()=>{},this.radioGroup=t,this._noopAnimations="NoopAnimations"===a,c&&(this.tabIndex=To(c,0)),this._removeUniqueSelectionListener=o.listen((d,f)=>{d!==this.id&&f===this.name&&(this.checked=!1)})}get checked(){return this._checked}set checked(t){const i=Mt(t);this._checked!==i&&(this._checked=i,i&&this.radioGroup&&this.radioGroup.value!==this.value?this.radioGroup.selected=this:!i&&this.radioGroup&&this.radioGroup.value===this.value&&(this.radioGroup.selected=null),i&&this._radioDispatcher.notify(this.id,this.name),this._changeDetector.markForCheck())}get value(){return this._value}set value(t){this._value!==t&&(this._value=t,null!==this.radioGroup&&(this.checked||(this.checked=this.radioGroup.value===t),this.checked&&(this.radioGroup.selected=this)))}get labelPosition(){return this._labelPosition||this.radioGroup&&this.radioGroup.labelPosition||"after"}set labelPosition(t){this._labelPosition=t}get disabled(){return this._disabled||null!==this.radioGroup&&this.radioGroup.disabled}set disabled(t){this._setDisabled(Mt(t))}get required(){return this._required||this.radioGroup&&this.radioGroup.required}set required(t){this._required=Mt(t)}get color(){return this._color||this.radioGroup&&this.radioGroup.color||this._providerOverride&&this._providerOverride.color||"accent"}set color(t){this._color=t}get inputId(){return`${this.id||this._uniqueId}-input`}focus(t,i){i?this._focusMonitor.focusVia(this._inputElement,i,t):this._inputElement.nativeElement.focus(t)}_markForCheck(){this._changeDetector.markForCheck()}ngOnInit(){this.radioGroup&&(this.checked=this.radioGroup.value===this._value,this.checked&&(this.radioGroup.selected=this),this.name=this.radioGroup.name)}ngAfterViewInit(){this._focusMonitor.monitor(this._elementRef,!0).subscribe(t=>{!t&&this.radioGroup&&this.radioGroup._touch()})}ngOnDestroy(){this._focusMonitor.stopMonitoring(this._elementRef),this._removeUniqueSelectionListener()}_emitChangeEvent(){this.change.emit(new e7(this,this._value))}_isRippleDisabled(){return this.disableRipple||this.disabled}_onInputClick(t){t.stopPropagation()}_onInputInteraction(t){if(t.stopPropagation(),!this.checked&&!this.disabled){const i=this.radioGroup&&this.value!==this.radioGroup.value;this.checked=!0,this._emitChangeEvent(),this.radioGroup&&(this.radioGroup._controlValueAccessorChangeFn(this.value),i&&this.radioGroup._emitChangeEvent())}}_setDisabled(t){this._disabled!==t&&(this._disabled=t,this._changeDetector.markForCheck())}}return n.\u0275fac=function(t){return new(t||n)(E(n7),E(rt),E(kn),E(Sa),E(cS),E(String),E(void 0),E(String))},n.\u0275dir=oe({type:n,viewQuery:function(t,i){if(1&t&&Jn(mFe,5),2&t){let r;_t(r=yt())&&(i._inputElement=r.first)}},inputs:{id:"id",checked:"checked",value:"value",labelPosition:"labelPosition",disabled:"disabled",required:"required",color:"color",name:"name",ariaLabel:["aria-label","ariaLabel"],ariaLabelledby:["aria-labelledby","ariaLabelledby"],ariaDescribedby:["aria-describedby","ariaDescribedby"]},outputs:{change:"change"},features:[ct]}),n})(),r7=(()=>{class n extends SFe{constructor(t,i,r,s,o,a,l,c){super(t,i,r,s,o,a,l,c)}}return n.\u0275fac=function(t){return new(t||n)(E(t7,8),E(rt),E(kn),E(Sa),E(cS),E(Do,8),E(vFe,8),Zr("tabindex"))},n.\u0275cmp=Ne({type:n,selectors:[["mat-radio-button"]],hostAttrs:[1,"mat-radio-button"],hostVars:17,hostBindings:function(t,i){1&t&&ge("focus",function(){return i._inputElement.nativeElement.focus()}),2&t&&(nn("tabindex",null)("id",i.id)("aria-label",null)("aria-labelledby",null)("aria-describedby",null),st("mat-radio-checked",i.checked)("mat-radio-disabled",i.disabled)("_mat-animation-noopable",i._noopAnimations)("mat-primary","primary"===i.color)("mat-accent","accent"===i.color)("mat-warn","warn"===i.color))},inputs:{disableRipple:"disableRipple",tabIndex:"tabIndex"},exportAs:["matRadioButton"],features:[ct],ngContentSelectors:yFe,decls:13,vars:20,consts:[[1,"mat-radio-label"],["label",""],[1,"mat-radio-container"],[1,"mat-radio-outer-circle"],[1,"mat-radio-inner-circle"],["type","radio",1,"mat-radio-input","cdk-visually-hidden",3,"id","checked","disabled","tabIndex","required","change","click"],["input",""],["mat-ripple","",1,"mat-radio-ripple","mat-focus-indicator",3,"matRippleTrigger","matRippleDisabled","matRippleCentered","matRippleRadius","matRippleAnimation"],[1,"mat-ripple-element","mat-radio-persistent-ripple"],[1,"mat-radio-label-content"],[2,"display","none"]],template:function(t,i){if(1&t&&(wi(),R(0,"label",0,1),R(2,"span",2),tt(3,"span",3),tt(4,"span",4),R(5,"input",5,6),ge("change",function(s){return i._onInputInteraction(s)})("click",function(s){return i._onInputClick(s)}),k(),R(7,"span",7),tt(8,"span",8),k(),k(),R(9,"span",9),R(10,"span",10),De(11,"\xa0"),k(),Ht(12),k(),k()),2&t){const r=vs(1);nn("for",i.inputId),G(5),ie("id",i.inputId)("checked",i.checked)("disabled",i.disabled)("tabIndex",i.tabIndex)("required",i.required),nn("name",i.name)("value",i.value)("aria-label",i.ariaLabel)("aria-labelledby",i.ariaLabelledby)("aria-describedby",i.ariaDescribedby),G(2),ie("matRippleTrigger",r)("matRippleDisabled",i._isRippleDisabled())("matRippleCentered",!0)("matRippleRadius",20)("matRippleAnimation",Hg(18,_Fe,i._noopAnimations?0:150)),G(2),st("mat-radio-label-before","before"==i.labelPosition)}},directives:[Js],styles:[".mat-radio-button{display:inline-block;-webkit-tap-highlight-color:transparent;outline:0}.mat-radio-label{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;display:inline-flex;align-items:center;white-space:nowrap;vertical-align:middle;width:100%}.mat-radio-container{box-sizing:border-box;display:inline-block;position:relative;width:20px;height:20px;flex-shrink:0}.mat-radio-outer-circle{box-sizing:border-box;display:block;height:20px;left:0;position:absolute;top:0;transition:border-color ease 280ms;width:20px;border-width:2px;border-style:solid;border-radius:50%}._mat-animation-noopable .mat-radio-outer-circle{transition:none}.mat-radio-inner-circle{border-radius:50%;box-sizing:border-box;display:block;height:20px;left:0;position:absolute;top:0;opacity:0;transition:transform ease 280ms,background-color ease 280ms,opacity linear 1ms 280ms;width:20px;transform:scale(0.001);-webkit-print-color-adjust:exact;color-adjust:exact}.mat-radio-checked .mat-radio-inner-circle{transform:scale(0.5);opacity:1;transition:transform ease 280ms,background-color ease 280ms}.cdk-high-contrast-active .mat-radio-checked .mat-radio-inner-circle{border:solid 10px}._mat-animation-noopable .mat-radio-inner-circle{transition:none}.mat-radio-label-content{-webkit-user-select:auto;-moz-user-select:auto;-ms-user-select:auto;user-select:auto;display:inline-block;order:0;line-height:inherit;padding-left:8px;padding-right:0}[dir=rtl] .mat-radio-label-content{padding-right:8px;padding-left:0}.mat-radio-label-content.mat-radio-label-before{order:-1;padding-left:0;padding-right:8px}[dir=rtl] .mat-radio-label-content.mat-radio-label-before{padding-right:0;padding-left:8px}.mat-radio-disabled,.mat-radio-disabled .mat-radio-label{cursor:default}.mat-radio-button .mat-radio-ripple{position:absolute;left:calc(50% - 20px);top:calc(50% - 20px);height:40px;width:40px;z-index:1;pointer-events:none}.mat-radio-button .mat-radio-ripple .mat-ripple-element:not(.mat-radio-persistent-ripple){opacity:.16}.mat-radio-persistent-ripple{width:100%;height:100%;transform:none;top:0;left:0}.mat-radio-container:hover .mat-radio-persistent-ripple{opacity:.04}.mat-radio-button:not(.mat-radio-disabled).cdk-keyboard-focused .mat-radio-persistent-ripple,.mat-radio-button:not(.mat-radio-disabled).cdk-program-focused .mat-radio-persistent-ripple{opacity:.12}.mat-radio-persistent-ripple,.mat-radio-disabled .mat-radio-container:hover .mat-radio-persistent-ripple{opacity:0}@media(hover: none){.mat-radio-container:hover .mat-radio-persistent-ripple{display:none}}.mat-radio-input{bottom:0;left:50%}.cdk-high-contrast-active .mat-radio-button:not(.mat-radio-disabled).cdk-keyboard-focused .mat-radio-ripple,.cdk-high-contrast-active .mat-radio-button:not(.mat-radio-disabled).cdk-program-focused .mat-radio-ripple{outline:solid 3px}.cdk-high-contrast-active .mat-radio-disabled{opacity:.5}\n"],encapsulation:2,changeDetection:0}),n})(),MFe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[_l,On],On]}),n})();const xFe=["label"],TFe=["options"],AFe=function(){return["Register","3D\xa0Preview"]};let DFe=(()=>{class n{constructor(t){this.ga=t,this.clsName="ccf-stage-nav",this.side="anterior",this.view3D=!1,this.sideChange=new Le,this.view3DChange=new Le,this.isDropdownActive=!1,this.isDropdownHidden=!0}set useDropdownMenu(t){this.isDropdownActive=t,this.isDropdownHidden=!0}get labelEl(){return this.labelRef.nativeElement}get optionsEl(){return this.optionsRef.nativeElement}handleClick(t){const{isDropdownHidden:i,labelEl:r,optionsEl:s}=this;r.contains(t)?this.isDropdownHidden=!i:s.contains(t)||(this.isDropdownHidden=!0)}updateSide(t){this.ga.event("side_update","stage_nav",t),"3D"===t?this.updateView(!0):(this.updateView(!1),this.side=t,this.sideChange.emit(this.side))}updateView(t){this.view3D=t,this.ga.event("view_update","stage_nav",t?"3D":"Register"),this.view3DChange.emit(this.view3D)}}return n.\u0275fac=function(t){return new(t||n)(E(xs))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-stage-nav"]],viewQuery:function(t,i){if(1&t&&(Jn(xFe,7),Jn(TFe,7)),2&t){let r;_t(r=yt())&&(i.labelRef=r.first),_t(r=yt())&&(i.optionsRef=r.first)}},hostVars:2,hostBindings:function(t,i){1&t&&ge("click",function(s){return i.handleClick(s.target)},!1,sg),2&t&&Rn(i.clsName)},inputs:{useDropdownMenu:"useDropdownMenu",side:"side",view3D:"view3D"},outputs:{sideChange:"sideChange",view3DChange:"view3DChange"},decls:18,vars:10,consts:[[1,"dropdown-label"],["label",""],[1,"stage-options"],["options",""],[1,"input-group",3,"value","change"],["value","left",1,"nav-input"],["value","right",1,"nav-input"],["value","anterior","checked","",1,"nav-input"],["value","posterior",1,"nav-input"],["matTooltip","Change view.",1,"view-slider",3,"labels","value","valueChange"]],template:function(t,i){1&t&&(R(0,"div",0,1),R(2,"mat-label"),De(3,"Options"),k(),R(4,"mat-icon"),De(5,"arrow_drop_down"),k(),k(),R(6,"div",2,3),R(8,"mat-radio-group",4),ge("change",function(s){return i.updateSide(s.value)}),R(9,"mat-radio-button",5),De(10,"Left"),k(),R(11,"mat-radio-button",6),De(12,"Right"),k(),R(13,"mat-radio-button",7),De(14,"Anterior"),k(),R(15,"mat-radio-button",8),De(16,"Posterior"),k(),k(),R(17,"ccf-labeled-slide-toggle",9),ge("valueChange",function(s){return i.updateView("Register"!==s)}),k(),k()),2&t&&(st("dropdown",i.isDropdownActive),G(6),st("dropdowncontainer",i.isDropdownActive)("hidden",i.isDropdownActive&&i.isDropdownHidden),G(2),ie("value",i.side),G(9),ie("labels",fv(9,AFe))("value",i.view3D?"3D\xa0Preview":"Register"))},directives:[Gf,rs,i7,r7,XF,dc],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;flex-wrap:wrap}[_nghost-%COMP%] .dropdown-label[_ngcontent-%COMP%]{display:none;align-items:center}[_nghost-%COMP%] .dropdown-label[_ngcontent-%COMP%] mat-label[_ngcontent-%COMP%], [_nghost-%COMP%] .dropdown-label[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{line-height:1.5rem}[_nghost-%COMP%] .dropdown-label.dropdown[_ngcontent-%COMP%]{display:flex;cursor:pointer;align-items:start}[_nghost-%COMP%] .stage-options[_ngcontent-%COMP%]{display:flex;align-items:center}[_nghost-%COMP%] .stage-options[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%] .nav-input[_ngcontent-%COMP%]{margin-right:1.5rem;margin-bottom:1.5rem}[_nghost-%COMP%] .stage-options[_ngcontent-%COMP%] .view-slider[_ngcontent-%COMP%]{margin-left:-1rem;margin-bottom:1.5rem;white-space:nowrap}[_nghost-%COMP%] .stage-options.dropdowncontainer[_ngcontent-%COMP%]{display:flex;flex-direction:column;border-radius:.25rem;width:16.5rem;position:absolute;top:3.5rem;z-index:1;transition:opacity .25s}[_nghost-%COMP%] .stage-options.dropdowncontainer[_ngcontent-%COMP%] [_ngcontent-%COMP%]:first-child{margin-top:.5rem}[_nghost-%COMP%] .stage-options.dropdowncontainer[_ngcontent-%COMP%] [_ngcontent-%COMP%]:last-child{margin-bottom:.5rem}[_nghost-%COMP%] .stage-options.dropdowncontainer[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%]{margin-left:1.5rem;margin-right:0;display:flex;flex-wrap:wrap}[_nghost-%COMP%] .stage-options.dropdowncontainer[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%] .nav-input[_ngcontent-%COMP%]{display:flex;margin:0 1.5rem 0 0;height:2.5rem}[_nghost-%COMP%] .stage-options.dropdowncontainer[_ngcontent-%COMP%] .view-slider[_ngcontent-%COMP%]{display:flex;align-items:center;height:3rem;margin:0 .5rem}[_nghost-%COMP%] .stage-options.dropdowncontainer[_ngcontent-%COMP%] mat-divider[_ngcontent-%COMP%]{visibility:visible;border-top:2px solid}[_nghost-%COMP%] .stage-options.hidden[_ngcontent-%COMP%]{visibility:hidden;opacity:0;transition:visibility .25s,opacity .25s}[_nghost-%COMP%] .stage-options.hidden[_ngcontent-%COMP%] mat-divider[_ngcontent-%COMP%]{visibility:hidden}"],changeDetection:0}),n})();function OFe(n,e){if(1&n){const t=Zi();R(0,"ccf-body-ui",16),ge("rotationChange",function(r){en(t),Qe();const s=vs(24);return s.rotation=r[0],s.rotationX=r[1]}),Kt(1,"async"),Kt(2,"async"),Kt(3,"async"),k()}if(2&n){const t=Qe();ie("scene",rn(1,5,t.scene.nodes$))("rotation",rn(2,7,t.scene.rotation$))("bounds",rn(3,9,t.bounds$))("zoom",11.5)("interactive",!0)}}function IFe(n,e){if(1&n){const t=Zi();R(0,"ccf-body-ui",17),ge("nodeDrag",function(r){return en(t),Qe().handleNodeDrag(r)}),Kt(1,"async"),Kt(2,"async"),k()}if(2&n){const t=Qe();ie("scene",rn(1,4,t.scene.rotatedNodes$))("interactive",!1)("bounds",rn(2,6,t.bounds$))("zoom",11.5)}}function PFe(n,e){1&n&&tt(0,"ccf-store-debug",18)}function RFe(n,e){if(1&n){const t=Zi();R(0,"div",19),R(1,"button",20),ge("click",function(){en(t);const r=Qe();return r.debugMode=!r.debugMode}),De(2,"State"),k(),R(3,"button",21),ge("click",function(){return en(t),Qe().registration.setUseRegistrationCallback(!0)}),De(4,"Use callback"),k(),R(5,"button",21),ge("click",function(){return en(t),Qe().registration.setUseRegistrationCallback(!1)}),De(6,"Use download"),k(),k()}}let kFe=(()=>{class n{constructor(t,i,r,s,o,a){this.model=t,this.page=i,this.registration=r,this.scene=s,this.rootRef=o,this.cdr=a,this.clsName="ccf-content",this.position$=this.model.position$.pipe(Ae(l=>({x:Math.floor(l.x),y:Math.floor(l.y),z:Math.floor(l.z)}))),this.is3DView$=this.model.viewType$.pipe(Ae(l=>"3d"===l)),this.bounds$=this.model.organDimensions$.pipe(Ae(l=>({x:Math.max(l.x,this.model.defaultPosition.x+40)/1e3,y:Math.max(l.y,this.model.defaultPosition.y+40)/1e3,z:Math.max(l.z,this.model.defaultPosition.z+40)/1e3})),Q9("x"),Q9("y")),this.isNarrowView=!1,this.debugMode=!1,this.showDebugButtons=!hu.production}ngOnInit(){this.sensor=new hW.ResizeSensor(this.rootRef.nativeElement,({width:t})=>{const i=t<440;this.isNarrowView!==i&&(this.isNarrowView=i,this.cdr.markForCheck())})}ngOnDestroy(){this.sensor.detach()}setViewType(t){this.model.setViewType(t?"3d":"register")}resetStage(){this.model.setPosition(this.model.defaultPosition),this.model.setViewSide("anterior"),this.model.setViewType("register")}handleNodeDrag(t){if("#DraftPlacement"===t.node["@id"]&&t.info.coordinate){const[i,r]=t.info.coordinate.map(d=>1e3*d),{position:s,viewSide:o,organDimensions:a}=this.model.snapshot,l=[a.x,a.y,a.z].map(d=>d/2);let c=s;switch(o){case"anterior":c={x:i+l[0],y:r+l[1],z:s.z};break;case"posterior":c={x:-i+l[0],y:r+l[1],z:s.z};break;case"left":c={x:s.x,y:r+l[1],z:-i+l[2]};break;case"right":c={x:s.x,y:r+l[1],z:i+l[2]}}this.model.setPosition(c)}}}return n.\u0275fac=function(t){return new(t||n)(E(ai),E(ji),E(Sr),E(as),E(rt),E(kn))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-content"]],hostVars:2,hostBindings:function(t,i){2&t&&Rn(i.clsName)},decls:29,vars:34,consts:[[1,"top-bar"],[3,"useDropdownMenu","view3D","side","view3DChange","sideChange"],["matRipple","","matRippleColor","rgba(204, 204, 204, 0.25)",1,"icon","reset",3,"matRippleCentered","matRippleUnbounded","click"],[1,"main-content"],["class","body-ui","camera","perspective",3,"scene","rotation","bounds","zoom","interactive","rotationChange",4,"ngIf"],["class","body-ui","camera","orthographic",3,"scene","interactive","bounds","zoom","nodeDrag",4,"ngIf"],[1,"gizmo-area"],[1,"position-display"],[1,"position"],[1,"x"],[1,"y"],[1,"z"],[1,"gizmo",3,"scene","rotation","interactive","zoom"],["gizmo",""],["class","debug",4,"ngIf"],["style","position: absolute; bottom: 1rem; display: flex; flex-direction: row; justify-content: space-between; width: 7rem;",4,"ngIf"],["camera","perspective",1,"body-ui",3,"scene","rotation","bounds","zoom","interactive","rotationChange"],["camera","orthographic",1,"body-ui",3,"scene","interactive","bounds","zoom","nodeDrag"],[1,"debug"],[2,"position","absolute","bottom","1rem","display","flex","flex-direction","row","justify-content","space-between","width","7rem"],[2,"width","3rem","font-size",".7rem",3,"click"],[3,"click"]],template:function(t,i){if(1&t&&(R(0,"div",0),R(1,"ccf-stage-nav",1),ge("view3DChange",function(s){return i.setViewType(s)})("sideChange",function(s){return i.model.setViewSide(s)}),Kt(2,"async"),Kt(3,"async"),k(),R(4,"mat-icon",2),ge("click",function(){return i.resetStage()}),De(5,"refresh"),k(),k(),R(6,"div",3),mt(7,OFe,4,11,"ccf-body-ui",4),Kt(8,"async"),mt(9,IFe,3,8,"ccf-body-ui",5),Kt(10,"async"),R(11,"div",6),R(12,"div",7),R(13,"div",8),R(14,"div",9),De(15),Kt(16,"async"),k(),R(17,"div",10),De(18),Kt(19,"async"),k(),R(20,"div",11),De(21),Kt(22,"async"),k(),k(),k(),tt(23,"ccf-body-ui",12,13),Kt(25,"async"),Kt(26,"async"),k(),k(),mt(27,PFe,1,0,"ccf-store-debug",14),mt(28,RFe,7,0,"div",15)),2&t){let r,s,o;G(1),ie("useDropdownMenu",i.isNarrowView)("view3D",rn(2,16,i.is3DView$))("side",rn(3,18,i.model.viewSide$)),G(3),ie("matRippleCentered",!0)("matRippleUnbounded",!0),G(3),ie("ngIf","3d"===rn(8,20,i.model.viewType$)),G(2),ie("ngIf","register"===rn(10,22,i.model.viewType$)),G(6),or("X: ",null==(r=rn(16,24,i.position$))?null:r.x,""),G(3),or("Y: ",null==(s=rn(19,26,i.position$))?null:s.y,""),G(3),or("Z: ",null==(o=rn(22,28,i.position$))?null:o.z,""),G(2),ie("scene",rn(25,30,i.scene.gizmo$))("rotation",rn(26,32,i.scene.rotation$))("interactive",!1)("zoom",9.5),G(4),ie("ngIf",i.showDebugButtons&&i.debugMode),G(1),ie("ngIf",i.showDebugButtons)}},directives:[DFe,rs,Js,zr,mPe,SPe],pipes:[Hc],styles:["[_nghost-%COMP%]{display:block;width:100%;height:100%;padding:1.5rem;overflow:hidden}[_nghost-%COMP%] .top-bar[_ngcontent-%COMP%]{display:flex;justify-content:space-between}[_nghost-%COMP%] .top-bar[_ngcontent-%COMP%] .reset[_ngcontent-%COMP%]{transform:scaleX(-1);cursor:pointer;transition:.6s}[_nghost-%COMP%] .main-content[_ngcontent-%COMP%]{display:flex;height:calc(100% - 1rem)}[_nghost-%COMP%] .main-content[_ngcontent-%COMP%] .body-ui[_ngcontent-%COMP%]{flex:auto;transition:opacity 1s}[_nghost-%COMP%] .main-content[_ngcontent-%COMP%] .gizmo-area[_ngcontent-%COMP%]{width:4rem;margin-top:1.5rem;margin-left:1.5rem;z-index:10}[_nghost-%COMP%] .main-content[_ngcontent-%COMP%] .gizmo-area[_ngcontent-%COMP%] .position-display[_ngcontent-%COMP%]{display:flex;justify-content:center;margin-bottom:1.5rem}[_nghost-%COMP%] .main-content[_ngcontent-%COMP%] .gizmo-area[_ngcontent-%COMP%] .gizmo[_ngcontent-%COMP%]{height:5.5rem}[_nghost-%COMP%] .main-content[_ngcontent-%COMP%] .gizmo-area[_ngcontent-%COMP%] .gizmo[_ngcontent-%COMP%] .hidden[_ngcontent-%COMP%]{opacity:0;z-index:0}[_nghost-%COMP%] .ccf-store-debug[_ngcontent-%COMP%]{color:#fff;position:absolute;top:.5rem;max-width:55rem}"],changeDetection:0}),n})();function FFe(n,e){if(1&n){const t=Zi();R(0,"div",11),ge("click",function(){en(t),Qe();const r=vs(15);return r.expanded=!r.expanded}),R(1,"mat-icon",12),De(2),k(),k()}if(2&n){Qe();const t=vs(15);G(2),or(" ",t.expanded?"arrow_drop_up":"arrow_drop_down"," ")}}function NFe(n,e){if(1&n){const t=Zi();R(0,"div",11),ge("click",function(){en(t);const r=Qe();return r.open=!r.open}),R(1,"mat-icon",13),De(2),k(),k()}if(2&n){const t=Qe();G(2),or(" ",t.open?"arrow_drop_up":"arrow_drop_down"," ")}}const LFe=function(n){return[n]};let BFe=(()=>{class n{constructor(t,i,r,s,o,a,l,c,d){this.model=t,this.page=i,this.consentService=r,this.snackbar=s,this.theming=o,this.globalConfig=c,this.organList=qF,this.open=!0,this.registrationStarted=!1,this.disablePositionChange=!1,this.theme$=this.globalConfig.getOption("theme"),this.themeMode$=new If(1),this.header$=this.globalConfig.getOption("header"),this.homeUrl$=this.globalConfig.getOption("homeUrl"),this.logoTooltip$=this.globalConfig.getOption("logoTooltip"),this.subscriptions=new Te,o.initialize(a,l),this.subscriptions.add(i.registrationCallbackSet$.subscribe(f=>{this.open=!f})),this.subscriptions.add(i.registrationStarted$.subscribe(f=>{this.registrationStarted=f})),this.theme$.subscribe(f=>{this.theme=f}),this.globalConfig.getOption("homeUrl").subscribe(f=>{this.homeUrl=f}),this.globalConfig.getOption("logoTooltip").subscribe(f=>{this.logoTooltip=f}),Qi([this.theme$,this.themeMode$]).subscribe(([f,p])=>{this.theming.setTheme(`${f}-theme-${p}`),d.markForCheck()})}get isLightTheme(){return this.theming.getTheme().endsWith("light")}ngOnInit(){const t=this.snackbar.openFromComponent(eRe,{data:{preClose:()=>{t.dismiss()}},duration:"not-set"===this.consentService.consent?1/0:3e3});this.themeMode$.next("light"),this.theming.setTheme(`${this.theme}-theme-light`)}toggleScheme(){this.themeMode$.next(this.isLightTheme?"dark":"light")}handleKey(t){const i=this.model.snapshot.position;if(this.disablePositionChange||!this.registrationStarted)return;t.preventDefault();const r=t.repeat?1:.5;let s=i;switch(t.key){case"q":s=Object.assign(Object.assign({},i),{z:i.z+r});break;case"e":s=Object.assign(Object.assign({},i),{z:i.z-r});break;case"w":s=Object.assign(Object.assign({},i),{y:i.y+r});break;case"s":s=Object.assign(Object.assign({},i),{y:i.y-r});break;case"a":s=Object.assign(Object.assign({},i),{x:i.x-r});break;case"d":s=Object.assign(Object.assign({},i),{x:i.x+r})}this.model.setPosition(s)}handleClick(t){this.disablePositionChange="INPUT"===t.nodeName}ngOnDestroy(){this.subscriptions.unsubscribe()}}return n.\u0275fac=function(t){return new(t||n)(E(ai),E(ji),E(f0),E(Xae),E(YF),E(rt),E(Nt),E(Ah),E(kn))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-root"]],hostBindings:function(t,i){1&t&&ge("keydown",function(s){return i.handleKey(s)},!1,sg)("click",function(s){return i.handleClick(s.target)},!1,sg)},decls:21,vars:35,consts:[[3,"logoTooltip","homeUrl"],["opened",""],[3,"modalClosed","disableSlider"],["position","end","opened",""],[3,"modalClosed"],[1,"selector-drawer"],[3,"organList","selectedOrgans","organsChanged"],["organSelector",""],[1,"close-button-wrapper"],["class","close-button",3,"click",4,"ngIf"],[1,"stage-content"],[1,"close-button",3,"click"],["aria-hidden","false","aria-label","Expand carousel drawer",1,"expand-collapse-icon"],["aria-hidden","false","aria-label","Close carousel drawer",1,"expand-collapse-icon"]],template:function(t,i){if(1&t&&(tt(0,"ccf-registration-modal"),tt(1,"ccf-header",0),Kt(2,"async"),Kt(3,"async"),Kt(4,"async"),R(5,"ccf-drawer-container"),R(6,"ccf-drawer",1),tt(7,"ccf-left-sidebar",2),tt(8,"ccf-drawer-toggle-button"),k(),R(9,"ccf-drawer",3),tt(10,"ccf-right-sidebar",4),tt(11,"ccf-drawer-toggle-button"),k(),R(12,"ccf-drawer-content"),R(13,"div",5),R(14,"ccf-organ-selector",6,7),ge("organsChanged",function(s){return i.model.setOrgan(s[0])}),Kt(16,"async"),k(),R(17,"div",8),mt(18,FFe,3,1,"div",9),mt(19,NFe,3,1,"div",9),k(),k(),tt(20,"ccf-content",10),k(),k()),2&t){const r=vs(15);G(1),st("header-hidden",!1===rn(2,25,i.header$)),ie("logoTooltip",rn(3,27,i.logoTooltip$))("homeUrl",rn(4,29,i.homeUrl$)),G(6),ie("modalClosed",i.registrationStarted)("disableSlider",!(null!=r.selectedOrgans[0]&&r.selectedOrgans[0].hasSex)),G(3),ie("modalClosed",i.registrationStarted),G(3),st("closed",!i.open)("expanded",r.expanded),G(1),st("closed",!i.open),ie("organList",i.organList)("selectedOrgans",Hg(33,LFe,rn(16,31,i.model.organ$))),G(3),st("closed",!i.open)("selector-expanded",r.expanded),G(1),ie("ngIf",i.open),G(1),ie("ngIf",!r.expanded),G(1),st("expanded-stage",!i.open)("retracted-stage",r.expanded)}},directives:[LRe,jRe,XRe,ZF,Kke,Zke,gFe,bx,p9,zr,kFe,rs],pipes:[Hc],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;height:100%;overflow:hidden;font-size:1rem;color:#000}[_nghost-%COMP%] .header-hidden[_ngcontent-%COMP%]{display:none}[_nghost-%COMP%] ccf-drawer-container[_ngcontent-%COMP%]{height:100%}[_nghost-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer[_ngcontent-%COMP%]{width:25.5rem}[_nghost-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%]{position:relative;z-index:1}[_nghost-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .selector-drawer[_ngcontent-%COMP%]{top:0rem;display:flex;flex-direction:column;position:relative;height:5.688rem;transition:all .5s ease-in-out}[_nghost-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .selector-drawer.expanded[_ngcontent-%COMP%]{height:15rem}[_nghost-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .selector-drawer[_ngcontent-%COMP%] ccf-organ-selector[_ngcontent-%COMP%]{height:100%;padding-top:.5rem;transition:all .5s}[_nghost-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .selector-drawer[_ngcontent-%COMP%] ccf-organ-selector.closed[_ngcontent-%COMP%]{padding-top:0}[_nghost-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .selector-drawer[_ngcontent-%COMP%] .close-button-wrapper[_ngcontent-%COMP%]{display:flex;justify-content:center;height:0;z-index:2}[_nghost-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .selector-drawer[_ngcontent-%COMP%] .close-button-wrapper[_ngcontent-%COMP%] .close-button[_ngcontent-%COMP%]{cursor:pointer;transition:.6s}[_nghost-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .selector-drawer[_ngcontent-%COMP%] .close-button-wrapper[_ngcontent-%COMP%] .close-button[_ngcontent-%COMP%] .expand-collapse-icon[_ngcontent-%COMP%]{width:3rem;height:1.2rem;display:flex;justify-content:center;align-items:center;cursor:pointer;background-color:#fff;border-bottom-left-radius:.2rem;border-bottom-right-radius:.2rem;transition:.6s}[_nghost-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .selector-drawer[_ngcontent-%COMP%] .close-button-wrapper[_ngcontent-%COMP%] .close-button[_ngcontent-%COMP%] .expand-collapse-icon[_ngcontent-%COMP%]:hover{background-color:#ececec}[_nghost-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .selector-drawer.closed[_ngcontent-%COMP%]{height:3rem;top:-2.9rem}[_nghost-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .stage-content[_ngcontent-%COMP%]{border-radius:.5rem!important;height:calc(100% - 2.688rem - 3rem - 1.5rem)}[_nghost-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .expanded-stage[_ngcontent-%COMP%]{height:calc(100% - 1.5rem);padding-bottom:1rem}[_nghost-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .retracted-stage[_ngcontent-%COMP%]{height:calc(100% - 2.688rem - 14rem)}[_nghost-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-content[_ngcontent-%COMP%]{position:absolute;transition-duration:.5s;transition-timing-function:ease-in-out;transition-property:all;bottom:1.5rem;z-index:1}"],changeDetection:0}),n})();function VFe(n,e){1&n&&tt(0,"ccf-root")}let zFe=(()=>{class n extends lRe{constructor(t,i){const r=cRe;super(t,i,{initialDelay:500,initialConfig:Object.assign(Object.assign(Object.assign({},hu.dbOptions),globalThis.ruiConfig),hu.customization),parse:{useDownload:r.boolean,user:r.json,organ:r.json,editRegistration:r.json,register:r.function,cancelRegistration:r.function,fetchPreviousRegistrations:r.function,skipUnsavedChangesConfirmation:r.boolean,header:r.boolean}})}}return n.\u0275fac=function(t){return new(t||n)(E(Ah),E(kn))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-root-wc"]],inputs:{baseHref:"baseHref",useDownload:"useDownload",user:"user",organ:"organ",editRegistration:"editRegistration",register:"register",cancelRegistration:"cancelRegistration",fetchPreviousRegistrations:"fetchPreviousRegistrations",skipUnsavedChangesConfirmation:"skipUnsavedChangesConfirmation",theme:"theme",header:"header",homeUrl:"homeUrl",logoTooltip:"logoTooltip"},features:[ct],decls:1,vars:1,consts:[[4,"ngIf"]],template:function(t,i){1&t&&mt(0,VFe,1,0,"ccf-root",0),2&t&&ie("ngIf",i.initialized)},directives:[zr,BFe],encapsulation:2,changeDetection:0}),n})();const jFe=new ve("Global configuration object");function UFe(n){return n.get("ruiConfig",{user:{firstName:"",lastName:""}})}let HFe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({providers:[{provide:jFe,useFactory:UFe,deps:[v9]}]}),n})(),$Fe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({providers:[{provide:bv,useValue:YF.initialize,multi:!0},YF]}),n})(),GFe=(()=>{class n{constructor(t,i){this.accessor=t,this.injector=i}static forRoot(t=[]){return{ngModule:n,providers:[Fr,Fa,UW,...t]}}}return n.\u0275fac=function(t){return new(t||n)(I(Fr,2),I(Fa,2))},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({}),n})();const Sx=(n,e)=>((n,e)=>new Array(e+1).join("0"))(0,e-n.toString().length)+n;class YFe{constructor(e,t,i){this.action=e,this.store=t,this.logWriter=i}dispatched(e){const t=pp(this.action),i=function(n){return Sx(n.getHours(),2)+":"+Sx(n.getMinutes(),2)+":"+Sx(n.getSeconds(),2)+"."+Sx(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 XFe{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 ve("NGXS_LOGGER_PLUGIN_OPTIONS");let KFe=(()=>{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 XFe(this._options),this._store=this._store||this._injector.get(cu);const s=new YFe(i,this._store,this._logWriter);return s.dispatched(t),r(t,i).pipe(Ti(o=>{s.completed(o)}),Ta(o=>{throw s.errored(o),o}))}}return n.\u0275fac=function(t){return new(t||n)(I(s7),I(Nt))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();const o7=new ve("LOGGER_USER_OPTIONS");function ZFe(n){return Object.assign({},{logger:console,collapsed:!1,disabled:!1,filter:()=>!0},n)}let QFe=(()=>{class n{static forRoot(t){return{ngModule:n,providers:[{provide:rk,useClass:KFe,multi:!0},{provide:o7,useValue:t},{provide:s7,useFactory:ZFe,deps:[o7]}]}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({}),n})();const JF=new ve("NGXS_STORAGE_PLUGIN_OPTION"),a7=new ve("STORAGE_ENGINE"),e2="@@STATE",l7="NGXS_OPTIONS_META";function e2e(n){return void 0!==n&&n.key&&(n.key=function(n){return Array.isArray(n)||(n=[n]),n.map(e=>(e.hasOwnProperty(l7)&&(e=e[l7].name),e instanceof class{constructor(e){this.name=e,uk(this).makeRootSelector=i=>i.getStateGetter(this.name)}getName(){return this.name}toString(){return`StateToken[${this.name}]`}}?e.getName():e))}(n.key)),Object.assign({key:[e2],storage:0,serialize:JSON.stringify,deserialize:JSON.parse,beforeSerialize:e=>e,afterDeserialize:e=>e},n)}function t2e(n,e){return kD(e)?null:0===n.storage?localStorage:1===n.storage?sessionStorage:null}let n2e=(()=>{class n{constructor(t,i,r){this._options=t,this._engine=i,this._platformId=r}handle(t,i,r){if(kD(this._platformId)&&null===this._engine)return r(t,i);const s=this._options.key,o=function(n){const e=pp(n);return function(t){return e===pp(t)}}(i),a=o(iG)||o(rG);let l=!1;if(a)for(const c of s){const d=c===e2;let f=this._engine.getItem(c);if("undefined"!==f&&null!=f){try{const p=this._options.deserialize(f);f=this._options.afterDeserialize(p,c)}catch(p){console.error("Error ocurred while deserializing the store value, falling back to empty object."),f={}}this._options.migrations&&this._options.migrations.forEach(p=>{p.version===Gm(f,p.versionKey||"version")&&(!p.key&&d||p.key===c)&&(f=p.migrate(f),l=!0)}),t=d?Object.assign({},t,f):ok(t,c,f)}}return r(t,i).pipe(Ti(c=>{if(!a||a&&l)for(const d of s){let f=c;d!==e2&&(f=Gm(c,d));try{const p=this._options.beforeSerialize(f,d);this._engine.setItem(d,this._options.serialize(p))}catch(p){console.error("Error ocurred while serializing the store value, value not updated.")}}}))}}return n.\u0275fac=function(t){return new(t||n)(I(JF),I(a7),I(dl))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();const c7=new ve("USER_OPTIONS");let i2e=(()=>{class n{static forRoot(t){return{ngModule:n,providers:[{provide:rk,useClass:n2e,multi:!0},{provide:c7,useValue:t},{provide:JF,useFactory:e2e,deps:[c7]},{provide:a7,useFactory:t2e,deps:[JF,dl]}]}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({}),n})();const u7=[{name:"bladder",namespace:"app",url:"assets/icons/organs/ico-organs-bladder.svg"},{name:"blood",namespace:"app",url:"assets/icons/organs/ico-organs-blood.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:"eye",namespace:"app",url:"assets/icons/organs/ico-organs-eye.svg"},{name:"fallopian-tube-left",namespace:"app",url:"assets/icons/organs/ico-organs-fallopian-tube-left.svg"},{name:"fallopian-tube-right",namespace:"app",url:"assets/icons/organs/ico-organs-fallopian-tube-right.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-right",namespace:"app",url:"assets/icons/organs/ico-organs-kidney-right.svg"},{name:"kidney",namespace:"app",url:"assets/icons/organs/ico-organs-kidney.svg"},{name:"knee",namespace:"app",url:"assets/icons/organs/ico-organs-knee.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-right",namespace:"app",url:"assets/icons/organs/ico-organs-lung-right.svg"},{name:"lung",namespace:"app",url:"assets/icons/organs/ico-organs-lung.svg"},{name:"lymph-nodes",namespace:"app",url:"assets/icons/organs/ico-organs-lymph-nodes.svg"},{name:"mammary-gland",namespace:"app",url:"assets/icons/organs/ico-organs-breast.svg"},{name:"neuron",namespace:"app",url:"assets/icons/organs/ico-organs-neuron.svg"},{name:"ovaries",namespace:"app",url:"assets/icons/organs/ico-organs-ovaries.svg"},{name:"ovary-left",namespace:"app",url:"assets/icons/organs/ico-organs-ovary-left.svg"},{name:"ovary-right",namespace:"app",url:"assets/icons/organs/ico-organs-ovary-right.svg"},{name:"pancreas",namespace:"app",url:"assets/icons/organs/ico-organs-pancreas.svg"},{name:"pelvis-f",namespace:"app",url:"assets/icons/organs/ico-organs-pelvis-f.svg"},{name:"placenta",namespace:"app",url:"assets/icons/organs/ico-organs-placenta.svg"},{name:"prostate",namespace:"app",url:"assets/icons/organs/ico-organs-prostate.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:"spinal-cord",namespace:"app",url:"assets/icons/organs/ico-organs-spinal-cord.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:"ureter-left",namespace:"app",url:"assets/icons/organs/ico-organs-ureter-left.svg"},{name:"ureter-right",namespace:"app",url:"assets/icons/organs/ico-organs-ureter-right.svg"},{name:"uterus",namespace:"app",url:"assets/icons/organs/ico-organs-uterus.svg"},{name:"vasculature-thick",namespace:"app",url:"assets/icons/organs/ico-organs-vasculature-thick.svg"},{name:"vasculature-thin",namespace:"app",url:"assets/icons/organs/ico-organs-vasculature-thin.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:"visibility_off_cube",namespace:"app",url:"assets/icons/ico-cube.svg"}];let hd=class extends cDe{constructor(e,t,i){super(),this.registry=e,this.sanitizer=t,this.globalConfig=i}ngxsOnInit(){var e;u7.filter(t=>void 0!==t.html).map(t=>Object.assign(Object.assign({},t),{html:this.sanitizer.bypassSecurityTrustHtml(t.html)})).forEach(t=>this.registerIconImpl(t)),null===(e=this.registry)||void 0===e||e.addSvgIconResolver((t,i)=>{var r;const s=u7.find(a=>{var l,c;return(null!==(l=a.name)&&void 0!==l?l:"")===t&&(null!==(c=a.namespace)&&void 0!==c?c:"")===i});if(void 0===s||void 0===s.url)return null;const o=null!==(r=this.globalConfig.snapshot.baseHref)&&void 0!==r?r:"";return this.sanitizer.bypassSecurityTrustResourceUrl(o+s.url)})}registerIcon(e){return this.registerIconImpl(e)}registerIconImpl(e){if(!this.registry||!e.url&&!e.html)return!1;const t=this.registry,r=t[this.getMethodName(e)],s=this.getArguments(e);if(!r)return!1;try{return r.apply(t,s),!0}catch(o){return!1}}getMethodName({name:e,namespace:t,url:i}){const r=["addSvgIcon"];return e||r.push("Set"),i||r.push("Literal"),t&&r.push("InNamespace"),r.join("")}getArguments({name:e,namespace:t,url:i,html:r}){return[t,e,null!=i?i:r].filter(o=>!!o)}};hd.\u0275fac=function(e){return new(e||hd)(I(Gv,8),I(th),I(Ah))},hd.\u0275prov=ue({token:hd,factory:hd.\u0275fac}),xe([on()],hd.prototype,"registerIcon",null),hd=xe([xh(),cd({name:"iconRegistry"})],hd);const r2e=[Ah,hd,ji,ai,ko,fc,Sr,as];let s2e=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[GFe.forRoot(),Io.forRoot(r2e,{developmentMode:!hu.production}),i2e.forRoot({key:["registration.registrations"]}),QFe.forRoot({disabled:hu.production})]]}),n})(),o2e=(()=>{class n{constructor(t){if(t)throw new Error("The core module should only be imported once in the root module")}}return n.\u0275fac=function(t){return new(t||n)(I(n,12))},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[Rj,kIe.forRoot({gaToken:hu.googleAnalyticsToken,appName:"rui"}),ZPe,HFe,s2e,$Fe]]}),n})(),t2=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,O9]]}),n})(),a2e=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,MFe,q9,lr,yx,t2,hc]]}),n})(),l2e=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,lr]]}),n})(),c2e=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,a2e,lr,MPe,l2e,_l,_Pe]]}),n})(),u2e=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,lr,hc]]}),n})(),d2e=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn]]}),n})(),h2e=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,q9]]}),n})(),d7=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,O9,Kb,Lk,Bk,hc]]}),n})(),f2e=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,lr,_l,m9]]}),n})(),h7=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,lr,j9]]}),n})(),p2e=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,ch]]}),n})(),g2e=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,Kk,lr,hc,yx,d2e,t2,d7,h7,h2e,m9,f2e,h7,p2e]]}),n})(),m2e=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,ch,hc,d7,t2,g9]]}),n})(),_2e=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,Qb,lr,m2e]]}),n})(),y2e=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,Kb,lr,_l,hc]]}),n})(),v2e=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,lr,_W,_l,hc]]}),n})(),b2e=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,Kb,lr,_l,hc,qPe]]}),n})(),C2e=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,j9,lr]]}),n})(),w2e=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,Lk,Bk,ch,h9,Uv,lr,Kb]]}),n})(),E2e=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,Qb,lr,ch]]}),n})(),S2e=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,E2e,ch,hc]]}),n})(),M2e=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,Kk,yx,lr,kO,hc,y2e,S2e,v2e,b2e,C2e,w2e,HPe]]}),n})(),x2e=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({providers:[{provide:P9,useValue:I9}],imports:[[yE,kO,lr]]}),n})(),T2e=(()=>{class n{constructor(t){this.injector=t}ngDoBootstrap(){const t=function(n,e){const t=function(n,e){return e.get(ll).resolveComponentFactory(n).inputs}(n,e.injector),i=e.strategyFactory||new Fne(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 Lne{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}(zFe,{injector:this.injector});customElements.define("ccf-rui",t)}}return n.\u0275fac=function(t){return new(t||n)(I(Nt))},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({providers:[{provide:T9,useValue:"hubmap-theme-light"},{provide:vj,useValue:{appearance:"standard",floatLabel:!1,hideRequiredMarker:!0}}],imports:[[yE,kO,o2e,lr,x2e,u2e,c2e,g2e,M2e,g9,_2e,tRe,_U]]}),n})();hu.production&&function(){if(i3)throw new Error("Cannot enable prod mode after platform setup.");n3=!1}(),rne().bootstrapModule(T2e).catch(n=>console.error(n))},948:gt=>{gt.exports=function(ze){return ze&&ze.__esModule?ze:{default:ze}},gt.exports.default=gt.exports,gt.exports.__esModule=!0},321:gt=>{function We(ze){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(gt.exports=We=function(L){return typeof L},gt.exports.default=gt.exports,gt.exports.__esModule=!0):(gt.exports=We=function(L){return L&&"function"==typeof Symbol&&L.constructor===Symbol&&L!==Symbol.prototype?"symbol":typeof L},gt.exports.default=gt.exports,gt.exports.__esModule=!0),We(ze)}gt.exports=We,gt.exports.default=gt.exports,gt.exports.__esModule=!0},833:gt=>{function We(ze){return Promise.resolve().then(()=>{var wt=new Error("Cannot find module '"+ze+"'");throw wt.code="MODULE_NOT_FOUND",wt})}We.keys=()=>[],We.resolve=We,We.id=833,gt.exports=We},521:()=>{},125:()=>{},307:()=>{}},gt=>{gt(gt.s=851)}]); \ No newline at end of file +var A2e=Object.defineProperty,D2e=Object.defineProperties,O2e=Object.getOwnPropertyDescriptors,p7=Object.getOwnPropertySymbols,I2e=Object.prototype.hasOwnProperty,P2e=Object.prototype.propertyIsEnumerable,Ui=Math.pow,g7=(gt,We,ze)=>We in gt?A2e(gt,We,{enumerable:!0,configurable:!0,writable:!0,value:ze}):gt[We]=ze,K=(gt,We)=>{for(var ze in We||(We={}))I2e.call(We,ze)&&g7(gt,ze,We[ze]);if(p7)for(var ze of p7(We))P2e.call(We,ze)&&g7(gt,ze,We[ze]);return gt},Lt=(gt,We)=>D2e(gt,O2e(We));(self.webpackChunkccf_ui=self.webpackChunkccf_ui||[]).push([[179],{2:gt=>{"use strict";gt.exports=ze,gt.exports.default=ze;var We=1e20;function ze(Ke,ft,Ze,Tt,Ft,we){this.fontSize=Ke||24,this.buffer=void 0===ft?3:ft,this.cutoff=Tt||.25,this.fontFamily=Ft||"sans-serif",this.fontWeight=we||"normal",this.radius=Ze||8;var _e=this.size=this.fontSize+2*this.buffer,ke=_e+2*this.buffer;this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=_e,this.ctx=this.canvas.getContext("2d"),this.ctx.font=this.fontWeight+" "+this.fontSize+"px "+this.fontFamily,this.ctx.textAlign="left",this.ctx.fillStyle="black",this.gridOuter=new Float64Array(ke*ke),this.gridInner=new Float64Array(ke*ke),this.f=new Float64Array(ke),this.z=new Float64Array(ke+1),this.v=new Uint16Array(ke),this.useMetrics=void 0!==this.ctx.measureText("A").actualBoundingBoxLeft,this.middle=Math.round(_e/2*(navigator.userAgent.indexOf("Gecko/")>=0?1.2:1))}function It(Ke,ft,Ze,Tt,Ft,we){for(var _e=0;_e-1);we[++ye]=ke,_e[ye]=Te,_e[ye+1]=We}for(ke=0,ye=0;ke{"use strict";var wt=(()=>{return(It=wt||(wt={})).typeOfFunction="function",It.boolTrue=!0,wt;var It})();function L(It,Pt,Ke){if(!Ke||typeof Ke.value!==wt.typeOfFunction)throw new TypeError("Only methods can be decorated with @bind. <"+Pt+"> is not a method!");return{configurable:wt.boolTrue,get:function(){var ft=Ke.value.bind(this);return Object.defineProperty(this,Pt,{value:ft,configurable:wt.boolTrue,writable:wt.boolTrue}),ft}}}We.ak=L,We.ZP=L},266:(gt,We,ze)=>{gt.exports={ResizeSensor:ze(835),ElementQueries:ze(845)}},845:function(gt,We,ze){"use strict";var wt,L,It;"undefined"!=typeof window&&window,L=[ze(835)],void 0!==(It="function"==typeof(wt=function(Pt){var Ke=function(){var Ze,Tt={},Ft=[];function we(Ve){Ve||(Ve=document.documentElement);var ce=window.getComputedStyle(Ve,null).fontSize;return parseFloat(ce)||16}function ke(Ve,ce){var zt=ce.split(/\d/),Gt=zt[zt.length-1];switch(ce=parseFloat(ce),Gt){case"px":return ce;case"em":return ce*we(Ve);case"rem":return ce*we();case"vw":return ce*document.documentElement.clientWidth/100;case"vh":return ce*document.documentElement.clientHeight/100;case"vmin":case"vmax":var Qt=document.documentElement.clientWidth/100,li=document.documentElement.clientHeight/100;return ce*(0,Math["vmin"===Gt?"min":"max"])(Qt,li);default:return ce}}function ye(Ve,ce){this.element=Ve;var zt,Gt,Qt,li,Pi,Se,pn,Gn,Ae=["min-width","min-height","max-width","max-height"];this.call=function(){for(zt in Qt=function(Ve){if(!Ve.getBoundingClientRect)return{width:Ve.offsetWidth,height:Ve.offsetHeight};var ce=Ve.getBoundingClientRect();return{width:Math.round(ce.width),height:Math.round(ce.height)}}(this.element),Se={},Tt[ce])!Tt[ce].hasOwnProperty(zt)||(li=ke(this.element,(Gt=Tt[ce][zt]).value),Pi="width"===Gt.property?Qt.width:Qt.height,pn="","min"===Gt.mode&&Pi>=li&&(pn+=Gt.value),"max"===Gt.mode&&Pi<=li&&(pn+=Gt.value),Se[Gn=Gt.mode+"-"+Gt.property]||(Se[Gn]=""),pn&&-1===(" "+Se[Gn]+" ").indexOf(" "+pn+" ")&&(Se[Gn]+=" "+pn));for(var Ri in Ae)!Ae.hasOwnProperty(Ri)||(Se[Ae[Ri]]?this.element.setAttribute(Ae[Ri],Se[Ae[Ri]].substr(1)):this.element.removeAttribute(Ae[Ri]))}}function Te(Ve,ce){Ve.elementQueriesSetupInformation||(Ve.elementQueriesSetupInformation=new ye(Ve,ce)),Ve.elementQueriesSensor||(Ve.elementQueriesSensor=new Pt(Ve,function(){Ve.elementQueriesSetupInformation.call()}))}function Vt(Ve,ce,zt,Gt){if(void 0===Tt[Ve]){Tt[Ve]=[];var Qt=Ft.length;Ze.innerHTML+="\n"+Ve+" {animation: 0.1s element-queries;}",Ze.innerHTML+="\n"+Ve+" > .resize-sensor {min-width: "+Qt+"px;}",Ft.push(Ve)}Tt[Ve].push({mode:ce,property:zt,value:Gt})}function He(Ve){var ce;if(document.querySelectorAll&&(ce=Ve?Ve.querySelectorAll.bind(Ve):document.querySelectorAll.bind(document)),!ce&&"undefined"!=typeof $$&&(ce=$$),!ce&&"undefined"!=typeof jQuery&&(ce=jQuery),!ce)throw"No document.querySelectorAll, jQuery or Mootools's $$ found.";return ce}function xt(Ve){var ce=[],zt=[],Gt=[],Qt=0,li=-1,Pi=[];for(var Se in Ve.children)if(Ve.children.hasOwnProperty(Se)&&Ve.children[Se].tagName&&"img"===Ve.children[Se].tagName.toLowerCase()){ce.push(Ve.children[Se]);var pn=Ve.children[Se].getAttribute("min-width")||Ve.children[Se].getAttribute("data-min-width"),Gn=Ve.children[Se].getAttribute("data-src")||Ve.children[Se].getAttribute("url");Gt.push(Gn),zt.push({minWidth:pn}),pn?Ve.children[Se].style.display="none":(Qt=ce.length-1,Ve.children[Se].style.display="block")}function Ri(){var xr,jt=!1;for(xr in ce)!ce.hasOwnProperty(xr)||zt[xr].minWidth&&Ve.offsetWidth>zt[xr].minWidth&&(jt=xr);if(jt||(jt=Qt),li!==jt)if(Pi[jt])ce[li].style.display="none",ce[jt].style.display="block",li=jt;else{var ls=new Image;ls.onload=function(){ce[jt].src=Gt[jt],ce[li].style.display="none",ce[jt].style.display="block",Pi[jt]=!0,li=jt},ls.src=Gt[jt]}else ce[jt].src=Gt[jt]}li=Qt,Ve.resizeSensorInstance=new Pt(Ve,Ri),Ri()}var Yn=/,?[\s\t]*([^,\n]*?)((?:\[[\s\t]*?(?:min|max)-(?:width|height)[\s\t]*?[~$\^]?=[\s\t]*?"[^"]*?"[\s\t]*?])+)([^,\n\s\{]*)/gim,Ei=/\[[\s\t]*?(min|max)-(width|height)[\s\t]*?[~$\^]?=[\s\t]*?"([^"]*?)"[\s\t]*?]/gim;function vi(Ve){var ce,zt,Gt,Qt;for(Ve=Ve.replace(/'/g,'"');null!==(ce=Yn.exec(Ve));)for(zt=ce[1]+ce[3],Gt=ce[2];null!==(Qt=Ei.exec(Gt));)Vt(zt,Qt[1],Qt[2],Qt[3])}function bi(Ve){var ce="";if(Ve)if("string"==typeof Ve)(-1!==(Ve=Ve.toLowerCase()).indexOf("min-width")||-1!==Ve.indexOf("max-width"))&&vi(Ve);else for(var zt=0,Gt=Ve.length;zt img, [data-responsive-image] {overflow: hidden; padding: 0; } [responsive-image] > img, [data-responsive-image] > img {width: 100%;}",Ze.innerHTML+="\n@keyframes element-queries { 0% { visibility: inherit; } }",document.getElementsByTagName("head")[0].appendChild(Ze),Mr=!0);for(var ce=0,zt=document.styleSheets.length;ce=_e.status}function ft(we){try{we.dispatchEvent(new MouseEvent("click"))}catch(ke){var _e=document.createEvent("MouseEvents");_e.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),we.dispatchEvent(_e)}}var Ze="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:"object"==typeof global&&global.global===global?global:void 0,Tt=Ze.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),Ft=Ze.saveAs||("object"!=typeof window||window!==Ze?function(){}:"download"in HTMLAnchorElement.prototype&&!Tt?function(we,_e,ke){var ye=Ze.URL||Ze.webkitURL,Te=document.createElement("a");Te.download=_e=_e||we.name||"download",Te.rel="noopener","string"==typeof we?(Te.href=we,Te.origin===location.origin?ft(Te):Ke(Te.href)?Pt(we,_e,ke):ft(Te,Te.target="_blank")):(Te.href=ye.createObjectURL(we),setTimeout(function(){ye.revokeObjectURL(Te.href)},4e4),setTimeout(function(){ft(Te)},0))}:"msSaveOrOpenBlob"in navigator?function(we,_e,ke){if(_e=_e||we.name||"download","string"!=typeof we)navigator.msSaveOrOpenBlob(function(we,_e){return void 0===_e?_e={autoBom:!1}:"object"!=typeof _e&&(console.warn("Deprecated: Expected third argument to be a object"),_e={autoBom:!_e}),_e.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(we.type)?new Blob(["\ufeff",we],{type:we.type}):we}(we,ke),_e);else if(Ke(we))Pt(we,_e,ke);else{var ye=document.createElement("a");ye.href=we,ye.target="_blank",setTimeout(function(){ft(ye)})}}:function(we,_e,ke,ye){if((ye=ye||open("","_blank"))&&(ye.document.title=ye.document.body.innerText="downloading..."),"string"==typeof we)return Pt(we,_e,ke);var Te="application/octet-stream"===we.type,Vt=/constructor/i.test(Ze.HTMLElement)||Ze.safari,He=/CriOS\/[\d]+/.test(navigator.userAgent);if((He||Te&&Vt||Tt)&&"undefined"!=typeof FileReader){var An=new FileReader;An.onloadend=function(){var Yn=An.result;Yn=He?Yn:Yn.replace(/^data:[^;]*;/,"data:attachment/file;"),ye?ye.location.href=Yn:location=Yn,ye=null},An.readAsDataURL(we)}else{var xt=Ze.URL||Ze.webkitURL,tn=xt.createObjectURL(we);ye?ye.location=tn:location.href=tn,ye=null,setTimeout(function(){xt.revokeObjectURL(tn)},4e4)}});Ze.saveAs=Ft.saveAs=Ft,gt.exports=Ft})?ze.apply(We,[]):ze)&&(gt.exports=L)},524:(gt,We,ze)=>{var wt;!function(L,It,Pt,Ke){"use strict";var He,ft=["","webkit","Moz","MS","ms","o"],Ze=It.createElement("div"),Ft=Math.round,we=Math.abs,_e=Date.now;function ke(A,F,j){return setTimeout(Yn(A,j),F)}function ye(A,F,j){return!!Array.isArray(A)&&(Te(A,j[F],j),!0)}function Te(A,F,j){var re;if(A)if(A.forEach)A.forEach(F,j);else if(A.length!==Ke)for(re=0;re\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",vn=L.console&&(L.console.warn||L.console.log);return vn&&vn.call(L.console,re,Ue),A.apply(this,arguments)}}He="function"!=typeof Object.assign?function(F){if(F===Ke||null===F)throw new TypeError("Cannot convert undefined or null to object");for(var j=Object(F),re=1;re-1}function zt(A){return A.trim().split(/\s+/g)}function Gt(A,F,j){if(A.indexOf&&!j)return A.indexOf(F);for(var re=0;reWr[F]}):re.sort()),re}function Pi(A,F){for(var j,re,Fe=F[0].toUpperCase()+F.slice(1),Ue=0;Ue1&&!j.firstMultiple?j.firstMultiple=Va(F):1===Fe&&(j.firstMultiple=!1);var Ue=j.firstInput,vn=j.firstMultiple,dr=vn?vn.center:Ue.center,yr=F.center=uo(re);F.timeStamp=_e(),F.deltaTime=F.timeStamp-Ue.timeStamp,F.angle=ho(dr,yr),F.distance=us(dr,yr),function(A,F){var j=F.center,re=A.offsetDelta||{},Fe=A.prevDelta||{},Ue=A.prevInput||{};(1===F.eventType||4===Ue.eventType)&&(Fe=A.prevDelta={x:Ue.deltaX||0,y:Ue.deltaY||0},re=A.offsetDelta={x:j.x,y:j.y}),F.deltaX=Fe.x+(j.x-re.x),F.deltaY=Fe.y+(j.y-re.y)}(j,F),F.offsetDirection=Ni(F.deltaX,F.deltaY);var Wr=za(F.deltaTime,F.deltaX,F.deltaY);F.overallVelocityX=Wr.x,F.overallVelocityY=Wr.y,F.overallVelocity=we(Wr.x)>we(Wr.y)?Wr.x:Wr.y,F.scale=vn?function(A,F){return us(F[0],F[1],Nr)/us(A[0],A[1],Nr)}(vn.pointers,re):1,F.rotation=vn?function(A,F){return ho(F[1],F[0],Nr)+ho(A[1],A[0],Nr)}(vn.pointers,re):0,F.maxPointers=j.prevInput?F.pointers.length>j.prevInput.maxPointers?F.pointers.length:j.prevInput.maxPointers:F.pointers.length,function(A,F){var Fe,Ue,vn,dr,j=A.lastInterval||F,re=F.timeStamp-j.timeStamp;if(8!=F.eventType&&(re>25||j.velocity===Ke)){var yr=F.deltaX-j.deltaX,Wr=F.deltaY-j.deltaY,cn=za(re,yr,Wr);Ue=cn.x,vn=cn.y,Fe=we(cn.x)>we(cn.y)?cn.x:cn.y,dr=Ni(yr,Wr),A.lastInterval=F}else Fe=j.velocity,Ue=j.velocityX,vn=j.velocityY,dr=j.direction;F.velocity=Fe,F.velocityX=Ue,F.velocityY=vn,F.direction=dr}(j,F);var cn=A.element;Ve(F.srcEvent.target,cn)&&(cn=F.srcEvent.target),F.target=cn}(A,j),A.emit("hammer.input",j),A.recognize(j),A.session.prevInput=j}function Va(A){for(var F=[],j=0;j=we(F)?A<0?2:4:F<0?8:16}function us(A,F,j){j||(j=Gr);var re=F[j[0]]-A[j[0]],Fe=F[j[1]]-A[j[1]];return Math.sqrt(re*re+Fe*Fe)}function ho(A,F,j){return j||(j=Gr),180*Math.atan2(F[j[1]]-A[j[1]],F[j[0]]-A[j[0]])/Math.PI}ii.prototype={handler:function(){},init:function(){this.evEl&&bi(this.element,this.evEl,this.domHandler),this.evTarget&&bi(this.target,this.evTarget,this.domHandler),this.evWin&&bi(Gn(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&Mr(this.element,this.evEl,this.domHandler),this.evTarget&&Mr(this.target,this.evTarget,this.domHandler),this.evWin&&Mr(Gn(this.element),this.evWin,this.domHandler)}};var fu={mousedown:1,mousemove:2,mouseup:4},pu="mousedown",gu="mousemove mouseup";function Ml(){this.evEl=pu,this.evWin=gu,this.pressed=!1,ii.apply(this,arguments)}tn(Ml,ii,{handler:function(F){var j=fu[F.type];1&j&&0===F.button&&(this.pressed=!0),2&j&&1!==F.which&&(j=4),this.pressed&&(4&j&&(this.pressed=!1),this.callback(this.manager,j,{pointers:[F],changedPointers:[F],pointerType:cs,srcEvent:F}))}});var mc={pointerdown:1,pointermove:2,pointerup:4,pointercancel:8,pointerout:8},pd={2:ls,3:"pen",4:cs,5:"kinect"},mu="pointerdown",Vs="pointermove pointerup pointercancel";function Je(){this.evEl=mu,this.evWin=Vs,ii.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}L.MSPointerEvent&&!L.PointerEvent&&(mu="MSPointerDown",Vs="MSPointerMove MSPointerUp MSPointerCancel"),tn(Je,ii,{handler:function(F){var j=this.store,re=!1,Fe=F.type.toLowerCase().replace("ms",""),Ue=mc[Fe],vn=pd[F.pointerType]||F.pointerType,dr=vn==ls,yr=Gt(j,F.pointerId,"pointerId");1&Ue&&(0===F.button||dr)?yr<0&&(j.push(F),yr=j.length-1):12&Ue&&(re=!0),!(yr<0)&&(j[yr]=F,this.callback(this.manager,Ue,{pointers:j,changedPointers:[F],pointerType:vn,srcEvent:F}),re&&j.splice(yr,1))}});var _u={touchstart:1,touchmove:2,touchend:4,touchcancel:8},W="touchstart",Y="touchstart touchmove touchend touchcancel";function J(){this.evTarget=W,this.evWin=Y,this.started=!1,ii.apply(this,arguments)}function T(A,F){var j=Qt(A.touches),re=Qt(A.changedTouches);return 12&F&&(j=li(j.concat(re),"identifier",!0)),[j,re]}tn(J,ii,{handler:function(F){var j=_u[F.type];if(1===j&&(this.started=!0),this.started){var re=T.call(this,F,j);12&j&&re[0].length-re[1].length==0&&(this.started=!1),this.callback(this.manager,j,{pointers:re[0],changedPointers:re[1],pointerType:ls,srcEvent:F})}}});var D={touchstart:1,touchmove:2,touchend:4,touchcancel:8},B="touchstart touchmove touchend touchcancel";function Z(){this.evTarget=B,this.targetIds={},ii.apply(this,arguments)}function $(A,F){var j=Qt(A.touches),re=this.targetIds;if(3&F&&1===j.length)return re[j[0].identifier]=!0,[j,j];var Fe,Ue,vn=Qt(A.changedTouches),dr=[],yr=this.target;if(Ue=j.filter(function(Wr){return Ve(Wr.target,yr)}),1===F)for(Fe=0;Fe-1&&re.splice(Ue,1)},2500)}}function xn(A){for(var F=A.srcEvent.clientX,j=A.srcEvent.clientY,re=0;re-1&&this.requireFail.splice(F,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(A){return!!this.simultaneous[A.id]},emit:function(A){var F=this,j=this.state;function re(Fe){F.manager.emit(Fe,A)}j<8&&re(F.options.event+ue(j)),re(F.options.event),A.additionalEvent&&re(A.additionalEvent),j>=8&&re(F.options.event+ue(j))},tryEmit:function(A){if(this.canEmit())return this.emit(A);this.state=32},canEmit:function(){for(var A=0;AF.threshold&&Fe&F.direction},attrTest:function(A){return rr.prototype.attrTest.call(this,A)&&(2&this.state||!(2&this.state)&&this.directionTest(A))},emit:function(A){this.pX=A.deltaX,this.pY=A.deltaY;var F=u_(A.direction);F&&(A.additionalEvent=this.options.event+F),this._super.emit.call(this,A)}}),tn(bu,rr,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[$i]},attrTest:function(A){return this._super.attrTest.call(this,A)&&(Math.abs(A.scale-1)>this.options.threshold||2&this.state)},emit:function(A){1!==A.scale&&(A.additionalEvent=this.options.event+(A.scale<1?"in":"out")),this._super.emit.call(this,A)}}),tn(Ih,ja,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return["auto"]},process:function(A){var F=this.options,j=A.pointers.length===F.pointers,re=A.distanceF.time;if(this._input=A,!re||!j||12&A.eventType&&!Fe)this.reset();else if(1&A.eventType)this.reset(),this._timer=ke(function(){this.state=8,this.tryEmit()},F.time,this);else if(4&A.eventType)return 8;return 32},reset:function(){clearTimeout(this._timer)},emit:function(A){8===this.state&&(A&&4&A.eventType?this.manager.emit(this.options.event+"up",A):(this._input.timeStamp=_e(),this.manager.emit(this.options.event,this._input)))}}),tn(Cu,rr,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[$i]},attrTest:function(A){return this._super.attrTest.call(this,A)&&(Math.abs(A.rotation)>this.options.threshold||2&this.state)}}),tn(ua,rr,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:30,pointers:1},getTouchAction:function(){return vc.prototype.getTouchAction.call(this)},attrTest:function(A){var j,F=this.options.direction;return 30&F?j=A.overallVelocity:6&F?j=A.overallVelocityX:24&F&&(j=A.overallVelocityY),this._super.attrTest.call(this,A)&&F&A.offsetDirection&&A.distance>this.options.threshold&&A.maxPointers==this.options.pointers&&we(j)>this.options.velocity&&4&A.eventType},emit:function(A){var F=u_(A.offsetDirection);F&&this.manager.emit(this.options.event+F,A),this.manager.emit(this.options.event,A)}}),tn(Tl,ja,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Hi]},process:function(A){var F=this.options,j=A.pointers.length===F.pointers,re=A.distance"']/g,Vs=RegExp(pd.source),Je=RegExp(mu.source),_u=/<%-([\s\S]+?)%>/g,W=/<%([\s\S]+?)%>/g,Y=/<%=([\s\S]+?)%>/g,J=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,T=/^\w*$/,D=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,B=/[\\^$.*+?()[\]{}|]/g,Z=RegExp(B.source),$=/^\s+/,le=/\s/,he=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,pe=/\{\n\/\* \[wrapped with (.+)\] \*/,Ge=/,? & /,an=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,xn=/[()=,{}\[\]\/\s]/,qt=/\\(\\)?/g,Et=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ln=/\w*$/,ri=/^[-+]0x[0-9a-f]+$/i,Hi=/^0b[01]+$/i,$i=/^\[object .+?Constructor\]$/,_n=/^0o[0-7]+$/i,Ci=/^(?:0|[1-9]\d*)$/,_c=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,fo=/($^)/,gd=/['\n\r\u2028\u2029\\]/g,xl="\\ud800-\\udfff",Gi="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Pn="\\u2700-\\u27bf",vu="a-z\\xdf-\\xf6\\xf8-\\xff",Me="A-Z\\xc0-\\xd6\\xd8-\\xde",rr="\\ufe0e\\ufe0f",vc="\\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",Ih="["+xl+"]",Cu="["+vc+"]",ua="["+Gi+"]",Tl="\\d+",Ua="["+Pn+"]",Sp="["+vu+"]",At="[^"+xl+vc+Tl+Pn+vu+Me+"]",Al="\\ud83c[\\udffb-\\udfff]",da="[^"+xl+"]",md="(?:\\ud83c[\\udde6-\\uddff]){2}",A="[\\ud800-\\udbff][\\udc00-\\udfff]",F="["+Me+"]",j="\\u200d",re="(?:"+Sp+"|"+At+")",Fe="(?:"+F+"|"+At+")",Ue="(?:['\u2019](?:d|ll|m|re|s|t|ve))?",vn="(?:['\u2019](?:D|LL|M|RE|S|T|VE))?",dr="(?:"+ua+"|"+Al+")?",yr="["+rr+"]?",Mx=yr+dr+"(?:"+j+"(?:"+[da,md,A].join("|")+")"+yr+dr+")*",_d="(?:"+[Ua,md,A].join("|")+")"+Mx,mi="(?:"+[da+ua+"?",ua,md,A,Ih].join("|")+")",xp=RegExp("['\u2019]","g"),d_=RegExp(ua,"g"),Ph=RegExp(Al+"(?="+Al+")|"+mi+Mx,"g"),b0=RegExp([F+"?"+Sp+"+"+Ue+"(?="+[Cu,F,"$"].join("|")+")",Fe+"+"+vn+"(?="+[Cu,F+re,"$"].join("|")+")",F+"?"+re+"+"+Ue,F+"+"+vn,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Tl,_d].join("|"),"g"),xx=RegExp("["+j+xl+Gi+rr+"]"),Dl=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Rh=["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"],Tx=-1,Ne={};Ne[uo]=Ne[za]=Ne[Ni]=Ne[us]=Ne[ho]=Ne[gc]=Ne[Sl]=Ne[fu]=Ne[pu]=!0,Ne[cs]=Ne[aa]=Ne[El]=Ne[ci]=Ne[Va]=Ne[pt]=Ne[ki]=Ne[la]=Ne[Fi]=Ne[$r]=Ne[ir]=Ne[Gr]=Ne[Nr]=Ne[ii]=Ne[di]=!1;var Si={};Si[cs]=Si[aa]=Si[El]=Si[Va]=Si[ci]=Si[pt]=Si[uo]=Si[za]=Si[Ni]=Si[us]=Si[ho]=Si[Fi]=Si[$r]=Si[ir]=Si[Gr]=Si[Nr]=Si[ii]=Si[pc]=Si[gc]=Si[Sl]=Si[fu]=Si[pu]=!0,Si[ki]=Si[la]=Si[di]=!1;var Pe={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Ax=parseFloat,S0=parseInt,oe="object"==typeof global&&global&&global.Object===Object&&global,ds="object"==typeof self&&self&&self.Object===Object&&self,Kn=oe||ds||Function("return this")(),Ol=We&&!We.nodeType&&We,ha=Ol&>&&!gt.nodeType&>,po=ha&&ha.exports===Ol,h_=po&&oe.process,Wi=function(){try{return ha&&ha.require&&ha.require("util").types||h_&&h_.binding&&h_.binding("util")}catch(fe){}}(),it=Wi&&Wi.isArrayBuffer,bn=Wi&&Wi.isDate,Oi=Wi&&Wi.isMap,js=Wi&&Wi.isRegExp,bc=Wi&&Wi.isSet,Tr=Wi&&Wi.isTypedArray;function Ar(q,fe,se){switch(se.length){case 0:return q.call(fe);case 1:return q.call(fe,se[0]);case 2:return q.call(fe,se[0],se[1]);case 3:return q.call(fe,se[0],se[1],se[2])}return q.apply(fe,se)}function hr(q,fe,se,lt){for(var Rt=-1,Wn=null==q?0:q.length;++Rt-1}function kh(q,fe,se){for(var lt=-1,Rt=null==q?0:q.length;++lt-1;);return se}function Px(q,fe){for(var se=q.length;se--&&Ha(fe,q[se],0)>-1;);return se}function r2(q,fe){for(var se=q.length,lt=0;se--;)q[se]===fe&&++lt;return lt}var s2=Fo({\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"}),o2=Fo({"&":"&","<":"<",">":">",'"':""","'":"'"});function a2(q){return"\\"+Pe[q]}function Lh(q){return xx.test(q)}function x0(q){var fe=-1,se=Array(q.size);return q.forEach(function(lt,Rt){se[++fe]=[Rt,lt]}),se}function Rx(q,fe){return function(se){return q(fe(se))}}function Eu(q,fe){for(var se=-1,lt=q.length,Rt=0,Wn=[];++se",""":'"',"'":"'"}),Vh=function q(fe){var u,se=(fe=null==fe?Kn:Vh.defaults(Kn.Object(),fe,Vh.pick(Kn,Rh))).Array,lt=fe.Date,Rt=fe.Error,Wn=fe.Function,vr=fe.Math,fi=fe.Object,v_=fe.RegExp,b_=fe.String,ga=fe.TypeError,Ii=se.prototype,Su=fi.prototype,Ap=fe["__core-js_shared__"],qi=Wn.prototype.toString,pi=Su.hasOwnProperty,f2=0,zh=(u=/[^.]+$/.exec(Ap&&Ap.keys&&Ap.keys.IE_PROTO||""))?"Symbol(src)_1."+u:"",Ts=Su.toString,Nx=qi.call(fi),C_=Kn._,Ed=v_("^"+qi.call(pi).replace(B,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),fs=po?fe.Buffer:L,Pl=fe.Symbol,Sd=fe.Uint8Array,D0=fs?fs.allocUnsafe:L,ma=Rx(fi.getPrototypeOf,fi),w_=fi.create,Dp=Su.propertyIsEnumerable,Yt=Ii.splice,Lx=Pl?Pl.isConcatSpreadable:L,jh=Pl?Pl.iterator:L,Mu=Pl?Pl.toStringTag:L,Op=function(){try{var u=Pc(fi,"defineProperty");return u({},"",{}),u}catch(h){}}(),O0=fe.clearTimeout!==Kn.clearTimeout&&fe.clearTimeout,Bx=lt&<.now!==Kn.Date.now&<.now,Vx=fe.setTimeout!==Kn.setTimeout&&fe.setTimeout,Oe=vr.ceil,Dn=vr.floor,en=fi.getOwnPropertySymbols,Dr=fs?fs.isBuffer:L,E_=fe.isFinite,Uh=Ii.join,Ga=Rx(fi.keys,fi),pr=vr.max,Lr=vr.min,p2=lt.now,zx=fe.parseInt,Hh=vr.random,Ip=Ii.reverse,Yr=Pc(fe,"DataView"),Us=Pc(fe,"Map"),Pp=Pc(fe,"Promise"),_a=Pc(fe,"Set"),mo=Pc(fe,"WeakMap"),$h=Pc(fi,"create"),Gh=mo&&new mo,Md={},jx=Lu(Yr),S_=Lu(Us),M_=Lu(Pp),I0=Lu(_a),x_=Lu(mo),Rp=Pl?Pl.prototype:L,xd=Rp?Rp.valueOf:L,Wh=Rp?Rp.toString:L;function O(u){if(Ki(u)&&!Bt(u)&&!(u instanceof Cn)){if(u instanceof _o)return u;if(pi.call(u,"__wrapped__"))return Ud(u)}return new _o(u)}var xu=function(){function u(){}return function(h){if(!Xi(h))return{};if(w_)return w_(h);u.prototype=h;var m=new u;return u.prototype=L,m}}();function qh(){}function _o(u,h){this.__wrapped__=u,this.__actions__=[],this.__chain__=!!h,this.__index__=0,this.__values__=L}function Cn(u){this.__wrapped__=u,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=jt,this.__views__=[]}function Hs(u){var h=-1,m=null==u?0:u.length;for(this.clear();++h=h?u:h)),u}function ps(u,h,m,b,M,P){var z,H=1&h,X=2&h,be=4&h;if(m&&(z=M?m(u,b,M,P):m(u)),z!==L)return z;if(!Xi(u))return u;var Ce=Bt(u);if(Ce){if(z=function(u){var h=u.length,m=new u.constructor(h);return h&&"string"==typeof u[0]&&pi.call(u,"index")&&(m.index=u.index,m.input=u.input),m}(u),!H)return Ds(u,z)}else{var Re=ms(u),et=Re==la||Re==La;if(nl(u))return Wp(u,H);if(Re==ir||Re==cs||et&&!M){if(z=X||et?{}:rC(u),!H)return X?function(u,h){return Ca(u,tC(u),h)}(u,function(u,h){return u&&Ca(h,Is(h),u)}(z,u)):function(u,h){return Ca(u,Y_(u),h)}(u,Zx(z,u))}else{if(!Si[Re])return M?u:{};z=function(u,h,m){var b=u.constructor;switch(h){case El:return Ru(u);case ci:case pt:return new b(+u);case Va:return function(u,h){var m=h?Ru(u.buffer):u.buffer;return new u.constructor(m,u.byteOffset,u.byteLength)}(u,m);case uo:case za:case Ni:case us:case ho:case gc:case Sl:case fu:case pu:return H_(u,m);case Fi:return new b;case $r:case ii:return new b(u);case Gr:return function(u){var h=new u.constructor(u.source,ln.exec(u));return h.lastIndex=u.lastIndex,h}(u);case Nr:return new b;case pc:return function(u){return xd?fi(xd.call(u)):{}}(u)}}(u,Re,H)}}P||(P=new va);var St=P.get(u);if(St)return St;P.set(u,z),gT(u)?u.forEach(function(Xt){z.add(ps(Xt,h,m,Xt,u,P))}):dT(u)&&u.forEach(function(Xt,Sn){z.set(Sn,ps(Xt,h,m,Sn,u,P))});var En=Ce?L:(be?X?W_:Bl:X?Is:es)(u);return hs(En||u,function(Xt,Sn){En&&(Xt=u[Sn=Xt]),qa(z,Sn,ps(Xt,h,m,Sn,u,P))}),z}function Vp(u,h,m){var b=m.length;if(null==u)return!b;for(u=fi(u);b--;){var M=m[b],z=u[M];if(z===L&&!(M in u)||!(0,h[M])(z))return!1}return!0}function Kh(u,h,m){if("function"!=typeof u)throw new ga(ft);return rf(function(){u.apply(L,m)},h)}function Sc(u,h,m,b){var M=-1,P=Il,z=!0,H=u.length,X=[],be=h.length;if(!H)return X;m&&(h=hi(h,Lo(m))),b?(P=kh,z=!1):h.length>=200&&(P=Nh,z=!1,h=new ya(h));e:for(;++M-1},Rl.prototype.set=function(u,h){var m=this.__data__,b=Ad(m,u);return b<0?(++this.size,m.push([u,h])):m[b][1]=h,this},Wa.prototype.clear=function(){this.size=0,this.__data__={hash:new Hs,map:new(Us||Rl),string:new Hs}},Wa.prototype.delete=function(u){var h=gs(this,u).delete(u);return this.size-=h?1:0,h},Wa.prototype.get=function(u){return gs(this,u).get(u)},Wa.prototype.has=function(u){return gs(this,u).has(u)},Wa.prototype.set=function(u,h){var m=gs(this,u),b=m.size;return m.set(u,h),this.size+=m.size==b?0:1,this},ya.prototype.add=ya.prototype.push=function(u){return this.__data__.set(u,Tt),this},ya.prototype.has=function(u){return this.__data__.has(u)},va.prototype.clear=function(){this.__data__=new Rl,this.size=0},va.prototype.delete=function(u){var h=this.__data__,m=h.delete(u);return this.size=h.size,m},va.prototype.get=function(u){return this.__data__.get(u)},va.prototype.has=function(u){return this.__data__.has(u)},va.prototype.set=function(u,h){var m=this.__data__;if(m instanceof Rl){var b=m.__data__;if(!Us||b.length<199)return b.push([u,h]),this.size=++m.size,this;m=this.__data__=new Wa(b)}return m.set(u,h),this.size=m.size,this};var Mc=Za(Xa),k_=Za(zp,!0);function L0(u,h){var m=!0;return Mc(u,function(b,M,P){return m=!!h(b,M,P)}),m}function Zh(u,h,m){for(var b=-1,M=u.length;++b0&&m(H)?h>1?Xr(H,h-1,m,b,M):fr(M,H):b||(M[M.length]=H)}return M}var Dd=W0(),Od=W0(!0);function Xa(u,h){return u&&Dd(u,h,es)}function zp(u,h){return u&&Od(u,h,es)}function Qh(u,h){return fa(h,function(m){return Wo(u[m])})}function Bo(u,h){for(var m=0,b=(h=Dc(h,u)).length;null!=u&&mh}function Id(u,h){return null!=u&&pi.call(u,h)}function Pd(u,h){return null!=u&&h in fi(u)}function Au(u,h,m){for(var b=m?kh:Il,M=u[0].length,P=u.length,z=P,H=se(P),X=1/0,be=[];z--;){var Ce=u[z];z&&h&&(Ce=hi(Ce,Lo(h))),X=Lr(Ce.length,X),H[z]=!m&&(h||M>=120&&Ce.length>=120)?new ya(z&&Ce):L}Ce=u[0];var Re=-1,et=H[0];e:for(;++Re=H?X:X*("desc"==m[b]?-1:1)}return u.index-h.index}(P,z,m)});se--;)q[se]=q[se].value;return q}(n1(u,function(P,z,H){return{criteria:hi(h,function(be){return be(P)}),index:++b,value:P}}))}function U0(u,h,m){for(var b=-1,M=h.length,P={};++b-1;)H!==u&&Yt.call(H,X,1),Yt.call(u,X,1);return u}function ef(u,h){for(var m=u?h.length:0,b=m-1;m--;){var M=h[m];if(m==b||M!==P){var P=M;bo(M)?Yt.call(u,M,1):Ou(u,M)}}return u}function kl(u,h){return u+Dn(Hh()*(h-u+1))}function Up(u,h){var m="";if(!u||h<1||h>Gn)return m;do{h%2&&(m+=u),(h=Dn(h/2))&&(u+=u)}while(h);return m}function wn(u,h){return ng(y1(u,h,Ps),u+"")}function r1(u){return O_(Zd(u))}function E2(u,h){var m=Zd(u);return jd(m,Tu(h,0,m.length))}function Hp(u,h,m,b){if(!Xi(u))return u;for(var M=-1,P=(h=Dc(h,u)).length,z=P-1,H=u;null!=H&&++MM?0:M+h),(m=m>M?M:m)<0&&(m+=M),M=h>m?0:m-h>>>0,h>>>=0;for(var P=se(M);++b>>1,z=u[P];null!==z&&!qo(z)&&(m?z<=h:z=200){var be=h?null:G_(u);if(be)return m_(be);z=!1,M=Nh,X=new ya}else X=h?[]:H;e:for(;++b=b?u:Qr(u,h,m)}var a1=O0||function(u){return Kn.clearTimeout(u)};function Wp(u,h){if(h)return u.slice();var m=u.length,b=D0?D0(m):new u.constructor(m);return u.copy(b),b}function Ru(u){var h=new u.constructor(u.byteLength);return new Sd(h).set(new Sd(u)),h}function H_(u,h){var m=h?Ru(u.buffer):u.buffer;return new u.constructor(m,u.byteOffset,u.length)}function Oc(u,h){if(u!==h){var m=u!==L,b=null===u,M=u==u,P=qo(u),z=h!==L,H=null===h,X=h==h,be=qo(h);if(!H&&!be&&!P&&u>h||P&&z&&X&&!H&&!be||b&&z&&X||!m&&X||!M)return 1;if(!b&&!P&&!be&&u1?m[M-1]:L,z=M>2?m[2]:L;for(P=u.length>3&&"function"==typeof P?(M--,P):L,z&&_s(m[0],m[1],z)&&(P=M<3?L:P,M=1),h=fi(h);++b-1?M[P?h[z]:z]:L}}function Fu(u){return Qa(function(h){var m=h.length,b=m,M=_o.prototype.thru;for(u&&h.reverse();b--;){var P=h[b];if("function"!=typeof P)throw new ga(ft);if(M&&!z&&"wrapper"==Jp(P))var z=new _o([],!0)}for(b=z?b:m;++b1&&Bn.reverse(),Ce&&XH))return!1;var be=P.get(u),Ce=P.get(h);if(be&&Ce)return be==h&&Ce==u;var Re=-1,et=!0,St=2&m?new ya:L;for(P.set(u,h),P.set(h,u);++Re-1&&u%1==0&&u1?"& ":"")+h[b],h=h.join(m>2?", ":" "),u.replace(he,"{\n/* [wrapped with "+h+"] */\n")}(b,function(u,h){return hs(Dh,function(m){var b="_."+m[0];h&m[1]&&!Il(u,b)&&u.push(b)}),u.sort()}(function(u){var h=u.match(pe);return h?h[1].split(Ge):[]}(b),m)))}function ey(u){var h=0,m=0;return function(){var b=p2(),M=16-(b-m);if(m=b,M>0){if(++h>=800)return arguments[0]}else h=0;return u.apply(L,arguments)}}function jd(u,h){var m=-1,b=u.length,M=b-1;for(h=h===L?b:h;++m1?u[h-1]:L;return m="function"==typeof m?(u.pop(),m):L,j1(u,m)});function dy(u){var h=O(u);return h.__chain__=!0,h}function $d(u,h){return h(u)}var hy=Qa(function(u){var h=u.length,m=h?u[0]:0,b=this.__wrapped__,M=function(P){return P_(P,u)};return!(h>1||this.__actions__.length)&&b instanceof Cn&&bo(m)?((b=b.slice(m,+m+(h?1:0))).__actions__.push({func:$d,args:[M],thisArg:L}),new _o(b,this.__chain__).thru(function(P){return h&&!P.length&&P.push(L),P})):this.thru(M)}),$1=br(function(u,h,m){pi.call(u,m)?++u[m]:Ya(u,m,1)}),q1=Y0(ny),Y1=Y0(iy);function my(u,h){return(Bt(u)?hs:Mc)(u,Ut(h,3))}function og(u,h){return(Bt(u)?yd:k_)(u,Ut(h,3))}var K1=br(function(u,h,m){pi.call(u,m)?u[m].push(h):Ya(u,m,[h])}),xC=wn(function(u,h,m){var b=-1,M="function"==typeof h,P=$s(u)?se(u.length):[];return Mc(u,function(z){P[++b]=M?Ar(h,z,m):ba(z,h,m)}),P}),TC=br(function(u,h,m){Ya(u,m,h)});function el(u,h){return(Bt(u)?hi:n1)(u,Ut(h,3))}var DC=br(function(u,h,m){u[m?0:1].push(h)},function(){return[[],[]]}),lg=wn(function(u,h){if(null==u)return[];var m=h.length;return m>1&&_s(u,h[0],h[1])?h=[]:m>2&&_s(h[0],h[1],h[2])&&(h=[h[0]]),Jh(u,Xr(h,1),[])}),Bu=Bx||function(){return Kn.Date.now()};function cg(u,h,m){return h=m?L:h,Ll(u,128,L,L,L,L,h=u&&null==h?u.length:h)}function yy(u,h){var m;if("function"!=typeof h)throw new ga(ft);return u=hn(u),function(){return--u>0&&(m=h.apply(this,arguments)),u<=1&&(h=L),m}}var cf=wn(function(u,h,m){var b=1;if(m.length){var M=Eu(m,zd(cf));b|=32}return Ll(u,b,h,m,M)}),Wd=wn(function(u,h,m){var b=3;if(m.length){var M=Eu(m,zd(Wd));b|=32}return Ll(h,b,u,m,M)});function NC(u,h,m){var b,M,P,z,H,X,be=0,Ce=!1,Re=!1,et=!0;if("function"!=typeof u)throw new ga(ft);function St(Qn){var sl=b,Lc=M;return b=M=L,be=Qn,z=u.apply(Lc,sl)}function Wt(Qn){return be=Qn,H=rf(Sn,h),Ce?St(Qn):z}function Xt(Qn){var sl=Qn-X;return X===L||sl>=h||sl<0||Re&&Qn-be>=P}function Sn(){var Qn=Bu();if(Xt(Qn))return Bn(Qn);H=rf(Sn,function(Qn){var sA=h-(Qn-X);return Re?Lr(sA,P-(Qn-be)):sA}(Qn))}function Bn(Qn){return H=L,et&&b?St(Qn):(b=M=L,z)}function Yo(){var Qn=Bu(),sl=Xt(Qn);if(b=arguments,M=this,X=Qn,sl){if(H===L)return Wt(X);if(Re)return a1(H),H=rf(Sn,h),St(X)}return H===L&&(H=rf(Sn,h)),z}return h=Gs(h)||0,Xi(m)&&(Ce=!!m.leading,P=(Re="maxWait"in m)?pr(Gs(m.maxWait)||0,h):P,et="trailing"in m?!!m.trailing:et),Yo.cancel=function(){H!==L&&a1(H),be=0,b=X=M=H=L},Yo.flush=function(){return H===L?z:Bn(Bu())},Yo}var eT=wn(function(u,h){return Kh(u,1,h)}),LC=wn(function(u,h,m){return Kh(u,Gs(h)||0,m)});function uf(u,h){if("function"!=typeof u||null!=h&&"function"!=typeof h)throw new ga(ft);var m=function(){var b=arguments,M=h?h.apply(this,b):b[0],P=m.cache;if(P.has(M))return P.get(M);var z=u.apply(this,b);return m.cache=P.set(M,z)||P,z};return m.cache=new(uf.Cache||Wa),m}function Cy(u){if("function"!=typeof u)throw new ga(ft);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)}}uf.Cache=Wa;var tT=o1(function(u,h){var m=(h=1==h.length&&Bt(h[0])?hi(h[0],Lo(Ut())):hi(Xr(h,1),Lo(Ut()))).length;return wn(function(b){for(var M=-1,P=Lr(b.length,m);++M=h}),tl=Qx(function(){return arguments}())?Qx:function(u){return Ki(u)&&pi.call(u,"callee")&&!Dp.call(u,"callee")},Bt=se.isArray,HC=it?Lo(it):function(u){return Ki(u)&&Kr(u)==El};function $s(u){return null!=u&&Ey(u.length)&&!Wo(u)}function Yi(u){return Ki(u)&&$s(u)}var nl=Dr||Wy,$C=bn?Lo(bn):function(u){return Ki(u)&&Kr(u)==pt};function Ea(u){if(!Ki(u))return!1;var h=Kr(u);return h==ki||"[object DOMException]"==h||"string"==typeof u.message&&"string"==typeof u.name&&!fg(u)}function Wo(u){if(!Xi(u))return!1;var h=Kr(u);return h==la||h==La||"[object AsyncFunction]"==h||"[object Proxy]"==h}function hg(u){return"number"==typeof u&&u==hn(u)}function Ey(u){return"number"==typeof u&&u>-1&&u%1==0&&u<=Gn}function Xi(u){var h=typeof u;return null!=u&&("object"==h||"function"==h)}function Ki(u){return null!=u&&"object"==typeof u}var dT=Oi?Lo(Oi):function(u){return Ki(u)&&ms(u)==Fi};function pT(u){return"number"==typeof u||Ki(u)&&Kr(u)==$r}function fg(u){if(!Ki(u)||Kr(u)!=ir)return!1;var h=ma(u);if(null===h)return!0;var m=pi.call(h,"constructor")&&h.constructor;return"function"==typeof m&&m instanceof m&&qi.call(m)==Nx}var YC=js?Lo(js):function(u){return Ki(u)&&Kr(u)==Gr},gT=bc?Lo(bc):function(u){return Ki(u)&&ms(u)==Nr};function My(u){return"string"==typeof u||!Bt(u)&&Ki(u)&&Kr(u)==ii}function qo(u){return"symbol"==typeof u||Ki(u)&&Kr(u)==pc}var df=Tr?Lo(Tr):function(u){return Ki(u)&&Ey(u.length)&&!!Ne[Kr(u)]},Rc=Kp(j0),xy=Kp(function(u,h){return u<=h});function XC(u){if(!u)return[];if($s(u))return My(u)?$a(u):Ds(u);if(jh&&u[jh])return function(q){for(var fe,se=[];!(fe=q.next()).done;)se.push(fe.value);return se}(u[jh]());var h=ms(u);return(h==Fi?x0:h==Nr?m_:Zd)(u)}function il(u){return u?(u=Gs(u))===pn||u===-pn?17976931348623157e292*(u<0?-1:1):u==u?u:0:0===u?u:0}function hn(u){var h=il(u),m=h%1;return h==h?m?h-m:h:0}function Ty(u){return u?Tu(hn(u),0,jt):0}function Gs(u){if("number"==typeof u)return u;if(qo(u))return NaN;if(Xi(u)){var h="function"==typeof u.valueOf?u.valueOf():u;u=Xi(h)?h+"":h}if("string"!=typeof u)return 0===u?u:+u;u=M0(u);var m=Hi.test(u);return m||_n.test(u)?S0(u.slice(2),m?2:8):ri.test(u)?NaN:+u}function KC(u){return Ca(u,Is(u))}function Zn(u){return null==u?"":vo(u)}var mT=Fl(function(u,h){if(tg(h)||$s(h))Ca(h,es(h),u);else for(var m in h)pi.call(h,m)&&qa(u,m,h[m])}),_T=Fl(function(u,h){Ca(h,Is(h),u)}),qd=Fl(function(u,h,m,b){Ca(h,Is(h),u,b)}),yT=Fl(function(u,h,m,b){Ca(h,es(h),u,b)}),ZC=Qa(P_),bT=wn(function(u,h){u=fi(u);var m=-1,b=h.length,M=b>2?h[2]:L;for(M&&_s(h[0],h[1],M)&&(b=1);++m1),P}),Ca(u,W_(u),m),b&&(m=ps(m,7,Zp));for(var M=h.length;M--;)Ou(m,h[M]);return m}),MT=Qa(function(u,h){return null==u?{}:function(u,h){return U0(u,h,function(m,b){return pg(u,b)})}(u,h)});function rw(u,h){if(null==u)return{};var m=hi(W_(u),function(b){return[b]});return h=Ut(h),U0(u,m,function(b,M){return h(b,M[0])})}var xT=Nu(es),ow=Nu(Is);function Zd(u){return null==u?[]:g_(u,es(u))}var IT=Nl(function(u,h,m){return h=h.toLowerCase(),u+(m?Iy(h):h)});function Iy(u){return _g(Zn(u).toLowerCase())}function Py(u){return(u=Zn(u))&&u.replace(_c,s2).replace(d_,"")}var RT=Nl(function(u,h,m){return u+(m?"-":"")+h.toLowerCase()}),kT=Nl(function(u,h,m){return u+(m?" ":"")+h.toLowerCase()}),$2=qp("toLowerCase"),VT=Nl(function(u,h,m){return u+(m?"_":"")+h.toLowerCase()}),Fy=Nl(function(u,h,m){return u+(m?" ":"")+_g(h)}),hw=Nl(function(u,h,m){return u+(m?" ":"")+h.toUpperCase()}),_g=qp("toUpperCase");function Vy(u,h,m){return u=Zn(u),(h=m?L:h)===L?function(q){return Dl.test(q)}(u)?function(q){return q.match(b0)||[]}(u):function(q){return q.match(an)||[]}(u):u.match(h)||[]}var zy=wn(function(u,h){try{return Ar(u,L,h)}catch(m){return Ea(m)?m:new Rt(m)}}),fw=Qa(function(u,h){return hs(h,function(m){m=mn(m),Ya(u,m,cf(u[m],u))}),u});function jy(u){return function(){return u}}var W2=Fu(),Fc=Fu(!0);function Ps(u){return u}function Vu(u){return t1("function"==typeof u?u:ps(u,1))}var Uy=wn(function(u,h){return function(m){return ba(m,u,h)}}),pw=wn(function(u,h){return function(m){return ba(u,m,h)}});function Hy(u,h,m){var b=es(h),M=Qh(h,b);null==m&&(!Xi(h)||!M.length&&b.length)&&(m=h,h=u,u=this,M=Qh(h,es(h)));var P=!(Xi(m)&&"chain"in m&&!m.chain),z=Wo(u);return hs(M,function(H){var X=h[H];u[H]=X,z&&(u.prototype[H]=function(){var be=this.__chain__;if(P||be){var Ce=u(this.__wrapped__),Re=Ce.__actions__=Ds(this.__actions__);return Re.push({func:X,args:arguments,thisArg:u}),Ce.__chain__=be,Ce}return X.apply(u,fr([this.value()],arguments))})}),u}function $y(){}var WT=Yp(hi),qT=Yp(gn),mw=Yp(go);function zu(u){return Uo(u)?f_(mn(u)):function(u){return function(h){return Bo(h,u)}}(u)}var XT=K0(),KT=K0(!0);function Nc(){return[]}function Wy(){return!1}var Nt=$_(function(u,h){return u+h},0),qy=Vd("ceil"),Y2=$_(function(u,h){return u/h},1),jl=Vd("floor"),bw=$_(function(u,h){return u*h},1),Cw=Vd("round"),ww=$_(function(u,h){return u-h},0);return O.after=function(u,h){if("function"!=typeof h)throw new ga(ft);return u=hn(u),function(){if(--u<1)return h.apply(this,arguments)}},O.ary=cg,O.assign=mT,O.assignIn=_T,O.assignInWith=qd,O.assignWith=yT,O.at=ZC,O.before=yy,O.bind=cf,O.bindAll=fw,O.bindKey=Wd,O.castArray=function(){if(!arguments.length)return[];var u=arguments[0];return Bt(u)?u:[u]},O.chain=dy,O.chunk=function(u,h,m){h=(m?_s(u,h,m):h===L)?1:pr(hn(h),0);var b=null==u?0:u.length;if(!b||h<1)return[];for(var M=0,P=0,z=se(Oe(b/h));MM?0:M+m),(b=b===L||b>M?M:hn(b))<0&&(b+=M),b=m>b?0:Ty(b);m>>0)?(u=Zn(u))&&("string"==typeof h||null!=h&&!YC(h))&&!(h=vo(h))&&Lh(u)?Ka($a(u),0,m):u.split(h,m):[]},O.spread=function(u,h){if("function"!=typeof u)throw new ga(ft);return h=null==h?0:pr(hn(h),0),wn(function(m){var b=m[h],M=Ka(m,0,h);return b&&fr(M,b),Ar(u,this,M)})},O.tail=function(u){var h=null==u?0:u.length;return h?Qr(u,1,h):[]},O.take=function(u,h,m){return u&&u.length?Qr(u,0,(h=m||h===L?1:hn(h))<0?0:h):[]},O.takeRight=function(u,h,m){var b=null==u?0:u.length;return b?Qr(u,(h=b-(h=m||h===L?1:hn(h)))<0?0:h,b):[]},O.takeRightWhile=function(u,h){return u&&u.length?Iu(u,Ut(h,3),!1,!0):[]},O.takeWhile=function(u,h){return u&&u.length?Iu(u,Ut(h,3)):[]},O.tap=function(u,h){return h(u),u},O.throttle=function(u,h,m){var b=!0,M=!0;if("function"!=typeof u)throw new ga(ft);return Xi(m)&&(b="leading"in m?!!m.leading:b,M="trailing"in m?!!m.trailing:M),NC(u,h,{leading:b,maxWait:h,trailing:M})},O.thru=$d,O.toArray=XC,O.toPairs=xT,O.toPairsIn=ow,O.toPath=function(u){return Bt(u)?hi(u,mn):qo(u)?[u]:Ds(lC(Zn(u)))},O.toPlainObject=KC,O.transform=function(u,h,m){var b=Bt(u),M=b||nl(u)||df(u);if(h=Ut(h,4),null==m){var P=u&&u.constructor;m=M?b?new P:[]:Xi(u)&&Wo(P)?xu(ma(u)):{}}return(M?hs:Xa)(u,function(z,H,X){return h(m,z,H,X)}),m},O.unary=function(u){return cg(u,1)},O.union=yC,O.unionBy=ly,O.unionWith=sg,O.uniq=function(u){return u&&u.length?Tc(u):[]},O.uniqBy=function(u,h){return u&&u.length?Tc(u,Ut(h,2)):[]},O.uniqWith=function(u,h){return h="function"==typeof h?h:L,u&&u.length?Tc(u,L,h):[]},O.unset=function(u,h){return null==u||Ou(u,h)},O.unzip=vC,O.unzipWith=j1,O.update=function(u,h,m){return null==u?u:$p(u,h,U_(m))},O.updateWith=function(u,h,m,b){return b="function"==typeof b?b:L,null==u?u:$p(u,h,U_(m),b)},O.values=Zd,O.valuesIn=function(u){return null==u?[]:g_(u,Is(u))},O.without=bC,O.words=Vy,O.wrap=function(u,h){return ug(U_(h),u)},O.xor=R2,O.xorBy=Co,O.xorWith=cy,O.zip=uy,O.zipObject=function(u,h){return Gp(u||[],h||[],qa)},O.zipObjectDeep=function(u,h){return Gp(u||[],h||[],Hp)},O.zipWith=lf,O.entries=xT,O.entriesIn=ow,O.extend=_T,O.extendWith=qd,Hy(O,O),O.add=Nt,O.attempt=zy,O.camelCase=IT,O.capitalize=Iy,O.ceil=qy,O.clamp=function(u,h,m){return m===L&&(m=h,h=L),m!==L&&(m=(m=Gs(m))==m?m:0),h!==L&&(h=(h=Gs(h))==h?h:0),Tu(Gs(u),h,m)},O.clone=function(u){return ps(u,4)},O.cloneDeep=function(u){return ps(u,5)},O.cloneDeepWith=function(u,h){return ps(u,5,h="function"==typeof h?h:L)},O.cloneWith=function(u,h){return ps(u,4,h="function"==typeof h?h:L)},O.conformsTo=function(u,h){return null==h||Vp(u,h,es(h))},O.deburr=Py,O.defaultTo=function(u,h){return null==u||u!=u?h:u},O.divide=Y2,O.endsWith=function(u,h,m){u=Zn(u),h=vo(h);var b=u.length,M=m=m===L?b:Tu(hn(m),0,b);return(m-=h.length)>=0&&u.slice(m,M)==h},O.eq=kt,O.escape=function(u){return(u=Zn(u))&&Je.test(u)?u.replace(mu,o2):u},O.escapeRegExp=function(u){return(u=Zn(u))&&Z.test(u)?u.replace(B,"\\$&"):u},O.every=function(u,h,m){var b=Bt(u)?gn:L0;return m&&_s(u,h,m)&&(h=L),b(u,Ut(h,3))},O.find=q1,O.findIndex=ny,O.findKey=function(u,h){return Fh(u,Ut(h,3),Xa)},O.findLast=Y1,O.findLastIndex=iy,O.findLastKey=function(u,h){return Fh(u,Ut(h,3),zp)},O.floor=jl,O.forEach=my,O.forEachRight=og,O.forIn=function(u,h){return null==u?u:Dd(u,Ut(h,3),Is)},O.forInRight=function(u,h){return null==u?u:Od(u,Ut(h,3),Is)},O.forOwn=function(u,h){return u&&Xa(u,Ut(h,3))},O.forOwnRight=function(u,h){return u&&zp(u,Ut(h,3))},O.get=pf,O.gt=G,O.gte=UC,O.has=function(u,h){return null!=u&&iC(u,h,Id)},O.hasIn=pg,O.head=uC,O.identity=Ps,O.includes=function(u,h,m,b){u=$s(u)?u:Zd(u),m=m&&!b?hn(m):0;var M=u.length;return m<0&&(m=pr(M+m,0)),My(u)?m<=M&&u.indexOf(h,m)>-1:!!M&&Ha(u,h,m)>-1},O.indexOf=function(u,h,m){var b=null==u?0:u.length;if(!b)return-1;var M=null==m?0:hn(m);return M<0&&(M=pr(b+M,0)),Ha(u,h,M)},O.inRange=function(u,h,m){return h=il(h),m===L?(m=h,h=0):m=il(m),function(u,h,m){return u>=Lr(h,m)&&u=-Gn&&u<=Gn},O.isSet=gT,O.isString=My,O.isSymbol=qo,O.isTypedArray=df,O.isUndefined=function(u){return u===L},O.isWeakMap=function(u){return Ki(u)&&ms(u)==di},O.isWeakSet=function(u){return Ki(u)&&"[object WeakSet]"==Kr(u)},O.join=function(u,h){return null==u?"":Uh.call(u,h)},O.kebabCase=RT,O.last=Ho,O.lastIndexOf=function(u,h,m){var b=null==u?0:u.length;if(!b)return-1;var M=b;return m!==L&&(M=(M=hn(m))<0?pr(b+M,0):Lr(M,b-1)),h==h?function(q,fe,se){for(var lt=se+1;lt--;)if(q[lt]===fe)return lt;return lt}(u,h,M):bd(u,Cc,M,!0)},O.lowerCase=kT,O.lowerFirst=$2,O.lt=Rc,O.lte=xy,O.max=function(u){return u&&u.length?Zh(u,Ps,Zr):L},O.maxBy=function(u,h){return u&&u.length?Zh(u,Ut(h,2),Zr):L},O.mean=function(u){return qr(u,Ps)},O.meanBy=function(u,h){return qr(u,Ut(h,2))},O.min=function(u){return u&&u.length?Zh(u,Ps,j0):L},O.minBy=function(u,h){return u&&u.length?Zh(u,Ut(h,2),j0):L},O.stubArray=Nc,O.stubFalse=Wy,O.stubObject=function(){return{}},O.stubString=function(){return""},O.stubTrue=function(){return!0},O.multiply=bw,O.nth=function(u,h){return u&&u.length?Du(u,hn(h)):L},O.noConflict=function(){return Kn._===this&&(Kn._=C_),this},O.noop=$y,O.now=Bu,O.pad=function(u,h,m){u=Zn(u);var b=(h=hn(h))?Bh(u):0;if(!h||b>=h)return u;var M=(h-b)/2;return Xp(Dn(M),m)+u+Xp(Oe(M),m)},O.padEnd=function(u,h,m){u=Zn(u);var b=(h=hn(h))?Bh(u):0;return h&&bh){var b=u;u=h,h=b}if(m||u%1||h%1){var M=Hh();return Lr(u+M*(h-u+Ax("1e-"+((M+"").length-1))),h)}return kl(u,h)},O.reduce=function(u,h,m){var b=Bt(u)?wu:No,M=arguments.length<3;return b(u,Ut(h,4),m,M,Mc)},O.reduceRight=function(u,h,m){var b=Bt(u)?vd:No,M=arguments.length<3;return b(u,Ut(h,4),m,M,k_)},O.repeat=function(u,h,m){return h=(m?_s(u,h,m):h===L)?1:hn(h),Up(Zn(u),h)},O.replace=function(){var u=arguments,h=Zn(u[0]);return u.length<3?h:h.replace(u[1],u[2])},O.result=function(u,h,m){var b=-1,M=(h=Dc(h,u)).length;for(M||(M=1,u=L);++bGn)return[];var m=jt,b=Lr(u,jt);h=Ut(h),u-=jt;for(var M=wd(b,h);++m=P)return u;var H=m-Bh(b);if(H<1)return b;var X=z?Ka(z,0,H).join(""):u.slice(0,H);if(M===L)return X+b;if(z&&(H+=X.length-H),YC(M)){if(u.slice(H).search(M)){var be,Ce=X;for(M.global||(M=v_(M.source,Zn(ln.exec(M))+"g")),M.lastIndex=0;be=M.exec(Ce);)var Re=be.index;X=X.slice(0,Re===L?H:Re)}}else if(u.indexOf(vo(M),H)!=H){var et=X.lastIndexOf(M);et>-1&&(X=X.slice(0,et))}return X+b},O.unescape=function(u){return(u=Zn(u))&&Vs.test(u)?u.replace(pd,y_):u},O.uniqueId=function(u){var h=++f2;return Zn(u)+h},O.upperCase=hw,O.upperFirst=_g,O.each=my,O.eachRight=og,O.first=uC,Hy(O,function(){var u={};return Xa(O,function(h,m){pi.call(O.prototype,m)||(u[m]=h)}),u}(),{chain:!1}),O.VERSION="4.17.21",hs(["bind","bindKey","curry","curryRight","partial","partialRight"],function(u){O[u].placeholder=O}),hs(["drop","take"],function(u,h){Cn.prototype[u]=function(m){m=m===L?1:pr(hn(m),0);var b=this.__filtered__&&!h?new Cn(this):this.clone();return b.__filtered__?b.__takeCount__=Lr(m,b.__takeCount__):b.__views__.push({size:Lr(m,jt),type:u+(b.__dir__<0?"Right":"")}),b},Cn.prototype[u+"Right"]=function(m){return this.reverse()[u](m).reverse()}}),hs(["filter","map","takeWhile"],function(u,h){var m=h+1,b=1==m||3==m;Cn.prototype[u]=function(M){var P=this.clone();return P.__iteratees__.push({iteratee:Ut(M,3),type:m}),P.__filtered__=P.__filtered__||b,P}}),hs(["head","last"],function(u,h){var m="take"+(h?"Right":"");Cn.prototype[u]=function(){return this[m](1).value()[0]}}),hs(["initial","tail"],function(u,h){var m="drop"+(h?"":"Right");Cn.prototype[u]=function(){return this.__filtered__?new Cn(this):this[m](1)}}),Cn.prototype.compact=function(){return this.filter(Ps)},Cn.prototype.find=function(u){return this.filter(u).head()},Cn.prototype.findLast=function(u){return this.reverse().find(u)},Cn.prototype.invokeMap=wn(function(u,h){return"function"==typeof u?new Cn(this):this.map(function(m){return ba(m,u,h)})}),Cn.prototype.reject=function(u){return this.filter(Cy(Ut(u)))},Cn.prototype.slice=function(u,h){u=hn(u);var m=this;return m.__filtered__&&(u>0||h<0)?new Cn(m):(u<0?m=m.takeRight(-u):u&&(m=m.drop(u)),h!==L&&(m=(h=hn(h))<0?m.dropRight(-h):m.take(h-u)),m)},Cn.prototype.takeRightWhile=function(u){return this.reverse().takeWhile(u).reverse()},Cn.prototype.toArray=function(){return this.take(jt)},Xa(Cn.prototype,function(u,h){var m=/^(?:filter|find|map|reject)|While$/.test(h),b=/^(?:head|last)$/.test(h),M=O[b?"take"+("last"==h?"Right":""):h],P=b||/^find/.test(h);!M||(O.prototype[h]=function(){var z=this.__wrapped__,H=b?[1]:arguments,X=z instanceof Cn,be=H[0],Ce=X||Bt(z),Re=function(Sn){var Bn=M.apply(O,fr([Sn],H));return b&&et?Bn[0]:Bn};Ce&&m&&"function"==typeof be&&1!=be.length&&(X=Ce=!1);var et=this.__chain__,St=!!this.__actions__.length,Wt=P&&!et,En=X&&!St;if(!P&&Ce){z=En?z:new Cn(this);var Xt=u.apply(z,H);return Xt.__actions__.push({func:$d,args:[Re],thisArg:L}),new _o(Xt,et)}return Wt&&En?u.apply(this,H):(Xt=this.thru(Re),Wt?b?Xt.value()[0]:Xt.value():Xt)})}),hs(["pop","push","shift","sort","splice","unshift"],function(u){var h=Ii[u],m=/^(?:push|sort|unshift)$/.test(u)?"tap":"thru",b=/^(?:pop|shift)$/.test(u);O.prototype[u]=function(){var M=arguments;if(b&&!this.__chain__){var P=this.value();return h.apply(Bt(P)?P:[],M)}return this[m](function(z){return h.apply(Bt(z)?z:[],M)})}}),Xa(Cn.prototype,function(u,h){var m=O[h];if(m){var b=m.name+"";pi.call(Md,b)||(Md[b]=[]),Md[b].push({name:h,func:m})}}),Md[Ic(L,2).name]=[{name:"wrapper",func:L}],Cn.prototype.clone=function(){var u=new Cn(this.__wrapped__);return u.__actions__=Ds(this.__actions__),u.__dir__=this.__dir__,u.__filtered__=this.__filtered__,u.__iteratees__=Ds(this.__iteratees__),u.__takeCount__=this.__takeCount__,u.__views__=Ds(this.__views__),u},Cn.prototype.reverse=function(){if(this.__filtered__){var u=new Cn(this);u.__dir__=-1,u.__filtered__=!0}else(u=this.clone()).__dir__*=-1;return u},Cn.prototype.value=function(){var u=this.__wrapped__.value(),h=this.__dir__,m=Bt(u),b=h<0,M=m?u.length:0,P=function(u,h,m){for(var b=-1,M=m.length;++b=this.__values__.length;return{done:u,value:u?L:this.__values__[this.__index__++]}},O.prototype.plant=function(u){for(var h,m=this;m instanceof qh;){var b=Ud(m);b.__index__=0,b.__values__=L,h?M.__wrapped__=b:h=b;var M=b;m=m.__wrapped__}return M.__wrapped__=u,h},O.prototype.reverse=function(){var u=this.__wrapped__;if(u instanceof Cn){var h=u;return this.__actions__.length&&(h=new Cn(this)),(h=h.reverse()).__actions__.push({func:$d,args:[ay],thisArg:L}),new _o(h,this.__chain__)}return this.thru(ay)},O.prototype.toJSON=O.prototype.valueOf=O.prototype.value=function(){return s1(this.__wrapped__,this.__actions__)},O.prototype.first=O.prototype.head,jh&&(O.prototype[jh]=function(){return this}),O}();Kn._=Vh,(wt=function(){return Vh}.call(We,ze,We,gt))!==L&&(gt.exports=wt)}.call(this)},478:function(gt){gt.exports=function(){"use strict";function We(W,Y){for(var J=0;JW.length)&&(Y=W.length);for(var J=0,T=new Array(Y);J=W.length?{done:!0}:{done:!1,value:W[T++]}}}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 Pt={exports:{}};function Ke(){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}}Pt.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:Ke,changeDefaults:function(W){Pt.exports.defaults=W}};var Ze=/[&<>"']/,Tt=/[&<>"']/g,Ft=/[<>"']|&(?!#?\w+;)/,we=/[<>"']|&(?!#?\w+;)/g,_e={"&":"&","<":"<",">":">",'"':""","'":"'"},ke=function(Y){return _e[Y]};var Te=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function Vt(W){return W.replace(Te,function(Y,J){return"colon"===(J=J.toLowerCase())?":":"#"===J.charAt(0)?"x"===J.charAt(1)?String.fromCharCode(parseInt(J.substring(2),16)):String.fromCharCode(+J.substring(1)):""})}var He=/(^|[^\[])\^/g;var xt=/[^\w:]/g,tn=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;var Ei={},vi=/^[^:]+:\/*[^/]*$/,bi=/^([^:]+:)[\s\S]*$/,Mr=/^([^:]+:\/*[^/]*)[\s\S]*$/;function Ve(W,Y){Ei[" "+W]||(Ei[" "+W]=vi.test(W)?W+"/":Qt(W,"/",!0));var J=-1===(W=Ei[" "+W]).indexOf(":");return"//"===Y.substring(0,2)?J?Y:W.replace(bi,"$1")+Y:"/"===Y.charAt(0)?J?Y:W.replace(Mr,"$1")+Y:W+Y}function Qt(W,Y,J){var T=W.length;if(0===T)return"";for(var D=0;D1;)1&Y&&(J+=W),Y>>=1,W+=W;return J+W},Gn=Pt.exports.defaults,Ae=Qt,Ri=function(W,Y){var T=W.replace(/\|/g,function(B,Z,$){for(var le=!1,he=Z;--he>=0&&"\\"===$[he];)le=!le;return le?"|":" |"}).split(/ \|/),D=0;if(T.length>Y)T.splice(Y);else for(;T.length1?{type:"space",raw:D[0]}:{raw:"\n"}},Y.code=function(T){var D=this.rules.block.code.exec(T);if(D){var B=D[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:D[0],codeBlockStyle:"indented",text:this.options.pedantic?B:Ae(B,"\n")}}},Y.fences=function(T){var D=this.rules.block.fences.exec(T);if(D){var B=D[0],Z=function(W,Y){var J=W.match(/^(\s+)(?:```)/);if(null===J)return Y;var T=J[1];return Y.split("\n").map(function(D){var B=D.match(/^\s+/);return null===B?D:B[0].length>=T.length?D.slice(T.length):D}).join("\n")}(B,D[3]||"");return{type:"code",raw:B,lang:D[2]?D[2].trim():D[2],text:Z}}},Y.heading=function(T){var D=this.rules.block.heading.exec(T);if(D){var B=D[2].trim();if(/#$/.test(B)){var Z=Ae(B,"#");(this.options.pedantic||!Z||/ $/.test(Z))&&(B=Z.trim())}return{type:"heading",raw:D[0],depth:D[1].length,text:B}}},Y.nptable=function(T){var D=this.rules.block.nptable.exec(T);if(D){var B={type:"table",header:Ri(D[1].replace(/^ *| *\| *$/g,"")),align:D[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:D[3]?D[3].replace(/\n$/,"").split("\n"):[],raw:D[0]};if(B.header.length===B.align.length){var $,Z=B.align.length;for($=0;$ ?/gm,"");return{type:"blockquote",raw:D[0],text:B}}},Y.list=function(T){var D=this.rules.block.list.exec(T);if(D){var Ge,an,xn,qt,Et,ln,ri,Hi,$i,B=D[0],Z=D[2],$=Z.length>1,le={type:"list",raw:B,ordered:$,start:$?+Z.slice(0,-1):"",loose:!1,items:[]},he=D[0].match(this.rules.block.item),pe=!1,_n=he.length;xn=this.rules.block.listItemStart.exec(he[0]);for(var Ci=0;Ci<_n;Ci++){if(B=Ge=he[Ci],this.options.pedantic||($i=Ge.match(new RegExp("\\n\\s*\\n {0,"+(xn[0].length-1)+"}\\S")))&&(Et=Ge.length-$i.index+he.slice(Ci+1).join("\n").length,le.raw=le.raw.substring(0,le.raw.length-Et),B=Ge=Ge.substring(0,$i.index),_n=Ci+1),Ci!==_n-1){if(qt=this.rules.block.listItemStart.exec(he[Ci+1]),this.options.pedantic?qt[1].length>xn[1].length:qt[1].length>=xn[0].length||qt[1].length>3){he.splice(Ci,2,he[Ci]+(!this.options.pedantic&&qt[1].length/i.test(Z[0])&&(D=!1),!B&&/^<(pre|code|kbd|script)(\s|>)/i.test(Z[0])?B=!0:B&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(Z[0])&&(B=!1),{type:this.options.sanitize?"text":"html",raw:Z[0],inLink:D,inRawBlock:B,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Z[0]):jt(Z[0]):Z[0]}},Y.link=function(T){var D=this.rules.inline.link.exec(T);if(D){var B=D[2].trim();if(!this.options.pedantic&&/^$/.test(B))return;var Z=Ae(B.slice(0,-1),"\\");if((B.length-Z.length)%2==0)return}else{var $=xr(D[2],"()");if($>-1){var he=(0===D[0].indexOf("!")?5:4)+D[1].length+$;D[2]=D[2].substring(0,$),D[0]=D[0].substring(0,he).trim(),D[3]=""}}var pe=D[2],Ge="";if(this.options.pedantic){var an=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(pe);an&&(pe=an[1],Ge=an[3])}else Ge=D[3]?D[3].slice(1,-1):"";return pe=pe.trim(),/^$/.test(B)?pe.slice(1):pe.slice(1,-1)),ls(D,{href:pe&&pe.replace(this.rules.inline._escapes,"$1"),title:Ge&&Ge.replace(this.rules.inline._escapes,"$1")},D[0])}},Y.reflink=function(T,D){var B;if((B=this.rules.inline.reflink.exec(T))||(B=this.rules.inline.nolink.exec(T))){var Z=(B[2]||B[1]).replace(/\s+/g," ");if(!(Z=D[Z.toLowerCase()])||!Z.href){var $=B[0].charAt(0);return{type:"text",raw:$,text:$}}return ls(B,Z,B[0])}},Y.emStrong=function(T,D,B){void 0===B&&(B="");var Z=this.rules.inline.emStrong.lDelim.exec(T);if(Z&&(!Z[3]||!B.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 $=Z[1]||Z[2]||"";if(!$||$&&(""===B||this.rules.inline.punctuation.exec(B))){var he,pe,le=Z[0].length-1,Ge=le,an=0,xn="*"===Z[0][0]?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(xn.lastIndex=0,D=D.slice(-1*T.length+le);null!=(Z=xn.exec(D));)if(he=Z[1]||Z[2]||Z[3]||Z[4]||Z[5]||Z[6]){if(pe=he.length,Z[3]||Z[4]){Ge+=pe;continue}if((Z[5]||Z[6])&&le%3&&!((le+pe)%3)){an+=pe;continue}if(!((Ge-=pe)>0))return pe=Math.min(pe,pe+Ge+an),Math.min(le,pe)%2?{type:"em",raw:T.slice(0,le+Z.index+pe+1),text:T.slice(1,le+Z.index+pe)}:{type:"strong",raw:T.slice(0,le+Z.index+pe+1),text:T.slice(2,le+Z.index+pe-1)}}}}},Y.codespan=function(T){var D=this.rules.inline.code.exec(T);if(D){var B=D[2].replace(/\n/g," "),Z=/[^ ]/.test(B),$=/^ /.test(B)&&/ $/.test(B);return Z&&$&&(B=B.substring(1,B.length-1)),B=jt(B,!0),{type:"codespan",raw:D[0],text:B}}},Y.br=function(T){var D=this.rules.inline.br.exec(T);if(D)return{type:"br",raw:D[0]}},Y.del=function(T){var D=this.rules.inline.del.exec(T);if(D)return{type:"del",raw:D[0],text:D[2]}},Y.autolink=function(T,D){var Z,$,B=this.rules.inline.autolink.exec(T);if(B)return $="@"===B[2]?"mailto:"+(Z=jt(this.options.mangle?D(B[1]):B[1])):Z=jt(B[1]),{type:"link",raw:B[0],text:Z,href:$,tokens:[{type:"text",raw:Z,text:Z}]}},Y.url=function(T,D){var B;if(B=this.rules.inline.url.exec(T)){var Z,$;if("@"===B[2])$="mailto:"+(Z=jt(this.options.mangle?D(B[0]):B[0]));else{var le;do{le=B[0],B[0]=this.rules.inline._backpedal.exec(B[0])[0]}while(le!==B[0]);Z=jt(B[0]),$="www."===B[1]?"http://"+Z:Z}return{type:"link",raw:B[0],text:Z,href:$,tokens:[{type:"text",raw:Z,text:Z}]}}},Y.inlineText=function(T,D,B){var $,Z=this.rules.inline.text.exec(T);if(Z)return $=D?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Z[0]):jt(Z[0]):Z[0]:jt(this.options.smartypants?B(Z[0]):Z[0]),{type:"text",raw:Z[0],text:$}},W}(),aa=pn_noopTest,Xn=pn_edit,ci=pn_merge,pt={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:aa,table:aa,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?'|\([^()]*\))/};pt.def=Xn(pt.def).replace("label",pt._label).replace("title",pt._title).getRegex(),pt.bullet=/(?:[*+-]|\d{1,9}[.)])/,pt.item=/^( *)(bull) ?[^\n]*(?:\n(?! *bull ?)[^\n]*)*/,pt.item=Xn(pt.item,"gm").replace(/bull/g,pt.bullet).getRegex(),pt.listItemStart=Xn(/^( *)(bull) */).replace("bull",pt.bullet).getRegex(),pt.list=Xn(pt.list).replace(/bull/g,pt.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+pt.def.source+")").getRegex(),pt._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",pt._comment=/|$)/,pt.html=Xn(pt.html,"i").replace("comment",pt._comment).replace("tag",pt._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),pt.paragraph=Xn(pt._paragraph).replace("hr",pt.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",pt._tag).getRegex(),pt.blockquote=Xn(pt.blockquote).replace("paragraph",pt.paragraph).getRegex(),pt.normal=ci({},pt),pt.gfm=ci({},pt.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*|$)"}),pt.gfm.nptable=Xn(pt.gfm.nptable).replace("hr",pt.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",pt._tag).getRegex(),pt.gfm.table=Xn(pt.gfm.table).replace("hr",pt.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",pt._tag).getRegex(),pt.pedantic=ci({},pt.normal,{html:Xn("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",pt._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:aa,paragraph:Xn(pt.normal._paragraph).replace("hr",pt.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",pt.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var Ye={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:aa,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:aa,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~"};Ye.punctuation=Xn(Ye.punctuation).replace(/punctuation/g,Ye._punctuation).getRegex(),Ye.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,Ye.escapedEmSt=/\\\*|\\_/g,Ye._comment=Xn(pt._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),Ye.emStrong.lDelim=Xn(Ye.emStrong.lDelim).replace(/punct/g,Ye._punctuation).getRegex(),Ye.emStrong.rDelimAst=Xn(Ye.emStrong.rDelimAst,"g").replace(/punct/g,Ye._punctuation).getRegex(),Ye.emStrong.rDelimUnd=Xn(Ye.emStrong.rDelimUnd,"g").replace(/punct/g,Ye._punctuation).getRegex(),Ye._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,Ye._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,Ye._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])?)+(?![-_])/,Ye.autolink=Xn(Ye.autolink).replace("scheme",Ye._scheme).replace("email",Ye._email).getRegex(),Ye._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,Ye.tag=Xn(Ye.tag).replace("comment",Ye._comment).replace("attribute",Ye._attribute).getRegex(),Ye._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Ye._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,Ye._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,Ye.link=Xn(Ye.link).replace("label",Ye._label).replace("href",Ye._href).replace("title",Ye._title).getRegex(),Ye.reflink=Xn(Ye.reflink).replace("label",Ye._label).getRegex(),Ye.reflinkSearch=Xn(Ye.reflinkSearch,"g").replace("reflink",Ye.reflink).replace("nolink",Ye.nolink).getRegex(),Ye.normal=ci({},Ye),Ye.pedantic=ci({},Ye.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:Xn(/^!?\[(label)\]\((.*?)\)/).replace("label",Ye._label).getRegex(),reflink:Xn(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Ye._label).getRegex()}),Ye.gfm=ci({},Ye.normal,{escape:Xn(Ye.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&&(T="x"+T.toString(16)),Y+="&#"+T+";";return Y}var ui=function(){function W(J){this.tokens=[],this.tokens.links=Object.create(null),this.options=J||La,this.options.tokenizer=this.options.tokenizer||new la,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var T={block:Fi.normal,inline:$r.normal};this.options.pedantic?(T.block=Fi.pedantic,T.inline=$r.pedantic):this.options.gfm&&(T.block=Fi.gfm,T.inline=this.options.breaks?$r.breaks:$r.gfm),this.tokenizer.rules=T}W.lex=function(T,D){return new W(D).lex(T)},W.lexInline=function(T,D){return new W(D).inlineTokens(T)};var Y=W.prototype;return Y.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},Y.blockTokens=function(T,D,B){var $,le,he,pe,Ge,an,Z=this;for(void 0===D&&(D=[]),void 0===B&&(B=!0),this.options.pedantic&&(T=T.replace(/^ +$/gm,""));T;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(function(qt){return!!($=qt.call(Z,T,D))&&(T=T.substring($.raw.length),D.push($),!0)}))){if($=this.tokenizer.space(T)){T=T.substring($.raw.length),$.type&&D.push($);continue}if($=this.tokenizer.code(T)){T=T.substring($.raw.length),(pe=D[D.length-1])&&"paragraph"===pe.type?(pe.raw+="\n"+$.raw,pe.text+="\n"+$.text):D.push($);continue}if($=this.tokenizer.fences(T)){T=T.substring($.raw.length),D.push($);continue}if($=this.tokenizer.heading(T)){T=T.substring($.raw.length),D.push($);continue}if($=this.tokenizer.nptable(T)){T=T.substring($.raw.length),D.push($);continue}if($=this.tokenizer.hr(T)){T=T.substring($.raw.length),D.push($);continue}if($=this.tokenizer.blockquote(T)){T=T.substring($.raw.length),$.tokens=this.blockTokens($.text,[],B),D.push($);continue}if($=this.tokenizer.list(T)){for(T=T.substring($.raw.length),he=$.items.length,le=0;le=0&&(qt=Math.min(qt,ln))}),qt<1/0&&qt>=0&&(Ge=T.substring(0,qt+1))}(),B&&($=this.tokenizer.paragraph(Ge))){pe=D[D.length-1],an&&"paragraph"===pe.type?(pe.raw+="\n"+$.raw,pe.text+="\n"+$.text):D.push($),an=Ge.length!==T.length,T=T.substring($.raw.length);continue}if($=this.tokenizer.text(T)){T=T.substring($.raw.length),(pe=D[D.length-1])&&"text"===pe.type?(pe.raw+="\n"+$.raw,pe.text+="\n"+$.text):D.push($);continue}if(T){var xn="Infinite loop on byte: "+T.charCodeAt(0);if(this.options.silent){console.error(xn);break}throw new Error(xn)}}return D},Y.inline=function(T){var D,B,Z,$,le,he,pe=T.length;for(D=0;D0)for(;null!=(an=this.tokenizer.rules.inline.reflinkSearch.exec(Ge));)Et.includes(an[0].slice(an[0].lastIndexOf("[")+1,-1))&&(Ge=Ge.slice(0,an.index)+"["+Ba("a",an[0].length-2)+"]"+Ge.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(an=this.tokenizer.rules.inline.blockSkip.exec(Ge));)Ge=Ge.slice(0,an.index)+"["+Ba("a",an[0].length-2)+"]"+Ge.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(an=this.tokenizer.rules.inline.escapedEmSt.exec(Ge));)Ge=Ge.slice(0,an.index)+"++"+Ge.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;T;)if(xn||(qt=""),xn=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(function(ri){return!!(le=ri.call($,T,D))&&(T=T.substring(le.raw.length),D.push(le),!0)}))){if(le=this.tokenizer.escape(T)){T=T.substring(le.raw.length),D.push(le);continue}if(le=this.tokenizer.tag(T,B,Z)){T=T.substring(le.raw.length),B=le.inLink,Z=le.inRawBlock,(he=D[D.length-1])&&"text"===le.type&&"text"===he.type?(he.raw+=le.raw,he.text+=le.text):D.push(le);continue}if(le=this.tokenizer.link(T)){T=T.substring(le.raw.length),"link"===le.type&&(le.tokens=this.inlineTokens(le.text,[],!0,Z)),D.push(le);continue}if(le=this.tokenizer.reflink(T,this.tokens.links)){T=T.substring(le.raw.length),he=D[D.length-1],"link"===le.type?(le.tokens=this.inlineTokens(le.text,[],!0,Z),D.push(le)):he&&"text"===le.type&&"text"===he.type?(he.raw+=le.raw,he.text+=le.text):D.push(le);continue}if(le=this.tokenizer.emStrong(T,Ge,qt)){T=T.substring(le.raw.length),le.tokens=this.inlineTokens(le.text,[],B,Z),D.push(le);continue}if(le=this.tokenizer.codespan(T)){T=T.substring(le.raw.length),D.push(le);continue}if(le=this.tokenizer.br(T)){T=T.substring(le.raw.length),D.push(le);continue}if(le=this.tokenizer.del(T)){T=T.substring(le.raw.length),le.tokens=this.inlineTokens(le.text,[],B,Z),D.push(le);continue}if(le=this.tokenizer.autolink(T,lo)){T=T.substring(le.raw.length),D.push(le);continue}if(!B&&(le=this.tokenizer.url(T,lo))){T=T.substring(le.raw.length),D.push(le);continue}if(pe=T,this.options.extensions&&this.options.extensions.startInline&&function(){var ri=1/0,Hi=T.slice(1),$i=void 0;$.options.extensions.startInline.forEach(function(_n){"number"==typeof($i=_n.call(this,Hi))&&$i>=0&&(ri=Math.min(ri,$i))}),ri<1/0&&ri>=0&&(pe=T.substring(0,ri+1))}(),le=this.tokenizer.inlineText(pe,Z,ir)){T=T.substring(le.raw.length),"_"!==le.raw.slice(-1)&&(qt=le.raw.slice(-1)),xn=!0,(he=D[D.length-1])&&"text"===he.type?(he.raw+=le.raw,he.text+=le.text):D.push(le);continue}if(T){var ln="Infinite loop on byte: "+T.charCodeAt(0);if(this.options.silent){console.error(ln);break}throw new Error(ln)}}return D},function(W,Y,J){Y&&We(W.prototype,Y),J&&We(W,J)}(W,null,[{key:"rules",get:function(){return{block:Fi,inline:$r}}}]),W}(),Gr=Pt.exports.defaults,Nr=pn_cleanUrl,ii=pn_escape,pc=function(){function W(J){this.options=J||Gr}var Y=W.prototype;return Y.code=function(T,D,B){var Z=(D||"").match(/\S*/)[0];if(this.options.highlight){var $=this.options.highlight(T,Z);null!=$&&$!==T&&(B=!0,T=$)}return T=T.replace(/\n$/,"")+"\n",Z?'
    '+(B?T:ii(T,!0))+"
    \n":"
    "+(B?T:ii(T,!0))+"
    \n"},Y.blockquote=function(T){return"
    \n"+T+"
    \n"},Y.html=function(T){return T},Y.heading=function(T,D,B,Z){return this.options.headerIds?"'+T+"\n":""+T+"\n"},Y.hr=function(){return this.options.xhtml?"
    \n":"
    \n"},Y.list=function(T,D,B){var Z=D?"ol":"ul";return"<"+Z+(D&&1!==B?' start="'+B+'"':"")+">\n"+T+"\n"},Y.listitem=function(T){return"
  • "+T+"
  • \n"},Y.checkbox=function(T){return" "},Y.paragraph=function(T){return"

    "+T+"

    \n"},Y.table=function(T,D){return D&&(D=""+D+""),"\n\n"+T+"\n"+D+"
    \n"},Y.tablerow=function(T){return"\n"+T+"\n"},Y.tablecell=function(T,D){var B=D.header?"th":"td";return(D.align?"<"+B+' align="'+D.align+'">':"<"+B+">")+T+"\n"},Y.strong=function(T){return""+T+""},Y.em=function(T){return""+T+""},Y.codespan=function(T){return""+T+""},Y.br=function(){return this.options.xhtml?"
    ":"
    "},Y.del=function(T){return""+T+""},Y.link=function(T,D,B){if(null===(T=Nr(this.options.sanitize,this.options.baseUrl,T)))return B;var Z='"+B+""},Y.image=function(T,D,B){if(null===(T=Nr(this.options.sanitize,this.options.baseUrl,T)))return B;var Z=''+B+'":">")},Y.text=function(T){return T},W}(),co=function(){function W(){}var Y=W.prototype;return Y.strong=function(T){return T},Y.em=function(T){return T},Y.codespan=function(T){return T},Y.del=function(T){return T},Y.html=function(T){return T},Y.text=function(T){return T},Y.link=function(T,D,B){return""+B},Y.image=function(T,D,B){return""+B},Y.br=function(){return""},W}(),di=function(){function W(){this.seen={}}var Y=W.prototype;return Y.serialize=function(T){return T.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")},Y.getNextSafeSlug=function(T,D){var B=T,Z=0;if(this.seen.hasOwnProperty(B)){Z=this.seen[T];do{B=T+"-"+ ++Z}while(this.seen.hasOwnProperty(B))}return D||(this.seen[T]=Z,this.seen[B]=0),B},Y.slug=function(T,D){void 0===D&&(D={});var B=this.serialize(T);return this.getNextSafeSlug(B,D.dryrun)},W}(),Oh=pc,El=co,Va=di,uo=Pt.exports.defaults,za=pn_unescape,us=ui,ho=function(){function W(J){this.options=J||uo,this.options.renderer=this.options.renderer||new Oh,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new El,this.slugger=new Va}W.parse=function(T,D){return new W(D).parse(T)},W.parseInline=function(T,D){return new W(D).parseInline(T)};var Y=W.prototype;return Y.parse=function(T,D){void 0===D&&(D=!0);var Z,$,le,he,pe,Ge,an,xn,qt,Et,ln,ri,Hi,$i,_n,Ci,_c,fo,gd,B="",xl=T.length;for(Z=0;Z0&&"text"===_n.tokens[0].type?(_n.tokens[0].text=fo+" "+_n.tokens[0].text,_n.tokens[0].tokens&&_n.tokens[0].tokens.length>0&&"text"===_n.tokens[0].tokens[0].type&&(_n.tokens[0].tokens[0].text=fo+" "+_n.tokens[0].tokens[0].text)):_n.tokens.unshift({type:"text",text:fo}):$i+=fo),$i+=this.parse(_n.tokens,Hi),qt+=this.renderer.listitem($i,_c,Ci);B+=this.renderer.list(qt,ln,ri);continue;case"html":B+=this.renderer.html(Et.text);continue;case"paragraph":B+=this.renderer.paragraph(this.parseInline(Et.tokens));continue;case"text":for(qt=Et.tokens?this.parseInline(Et.tokens):Et.text;Z+1An error occurred:

    "+mc(le.message+"",!0)+"
    ";throw le}}return Je.options=Je.setOptions=function(W){return gu(Je.defaults,W),mu(Je.defaults),Je},Je.getDefaults=pd,Je.defaults=Vs,Je.use=function(){for(var W=this,Y=arguments.length,J=new Array(Y),T=0;TAn error occurred:

    "+mc(T.message+"",!0)+"
    ";throw T}},Je.Parser=ho,Je.parser=ho.parse,Je.Renderer=Sl,Je.TextRenderer=fu,Je.Lexer=us,Je.lexer=us.lex,Je.Tokenizer=gc,Je.Slugger=pu,Je.parse=Je,Je}()},310:(gt,We,ze)=>{"use strict";var wt=ze(948);Object.defineProperty(We,"__esModule",{value:!0}),We.isMobile=function(){return void 0!==L.window.orientation},We.default=function(Ze){if(!Ze&&!(0,It.default)())return"Node";if((0,Pt.default)(Ze))return"Electron";var Tt="undefined"!=typeof navigator?navigator:{},Ft=Ze||Tt.userAgent||"";if(Ft.indexOf("Edge")>-1)return"Edge";var we=-1!==Ft.indexOf("MSIE "),_e=-1!==Ft.indexOf("Trident/");return we||_e?"IE":L.window.chrome?"Chrome":L.window.safari?"Safari":L.window.mozInnerScreenX?"Firefox":"Unknown"};var L=ze(151),It=wt(ze(602)),Pt=wt(ze(344))},151:(gt,We,ze)=>{"use strict";var wt=ze(948);Object.defineProperty(We,"__esModule",{value:!0}),We.console=We.process=We.document=We.global=We.window=We.self=void 0;var L=wt(ze(321)),It={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,L.default)(process))&&process};We.self=It.self||It.window||It.global,We.window=It.window||It.self||It.global,We.global=It.global||It.self||It.window,We.document=It.document||{},We.process=It.process||{};var Ft=console;We.console=Ft},761:(gt,We,ze)=>{"use strict";var L=ze(948),It=ze(321);Object.defineProperty(We,"CO",{enumerable:!0,get:function(){return Pt.global}}),Object.defineProperty(We,"qs",{enumerable:!0,get:function(){return ft.default}});var Pt=ze(151),ft=(Ft(ze(602)),Ft(ze(310)));L(ze(344));function Tt(we){if("function"!=typeof WeakMap)return null;var _e=new WeakMap,ke=new WeakMap;return(Tt=function(Te){return Te?ke:_e})(we)}function Ft(we,_e){if(!_e&&we&&we.__esModule)return we;if(null===we||"object"!==It(we)&&"function"!=typeof we)return{default:we};var ke=Tt(_e);if(ke&&ke.has(we))return ke.get(we);var ye={},Te=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var Vt in we)if("default"!==Vt&&Object.prototype.hasOwnProperty.call(we,Vt)){var He=Te?Object.getOwnPropertyDescriptor(we,Vt):null;He&&(He.get||He.set)?Object.defineProperty(ye,Vt,He):ye[Vt]=we[Vt]}return ye.default=we,ke&&ke.set(we,ye),ye}},602:(gt,We,ze)=>{"use strict";var wt=ze(948);Object.defineProperty(We,"__esModule",{value:!0}),We.default=Pt,We.isBrowserMainThread=function(){return Pt()&&"undefined"!=typeof document};var L=wt(ze(321)),It=wt(ze(344));function Pt(){return!("object"===("undefined"==typeof process?"undefined":(0,L.default)(process))&&"[object process]"===String(process)&&!process.browser)||(0,It.default)()}},344:(gt,We,ze)=>{"use strict";var wt=ze(948);Object.defineProperty(We,"__esModule",{value:!0}),We.default=function(Pt){if("undefined"!=typeof window&&"object"===(0,L.default)(window.process)&&"renderer"===window.process.type||"undefined"!=typeof process&&"object"===(0,L.default)(process.versions)&&Boolean(process.versions.electron))return!0;var Ke="object"===("undefined"==typeof navigator?"undefined":(0,L.default)(navigator))&&"string"==typeof navigator.userAgent&&navigator.userAgent,ft=Pt||Ke;return!!(ft&&ft.indexOf("Electron")>=0)};var L=wt(ze(321))},851:(gt,We,ze)=>{"use strict";var wt={};ze.r(wt),ze.d(wt,{decode:()=>N0e,encode:()=>L0e});var L={};ze.r(L),ze.d(L,{decode:()=>U0e,encode:()=>H0e});var It={};ze.r(It),ze.d(It,{decode:()=>$0e,encode:()=>G0e});var Pt={};function Ke(n){return"function"==typeof n}ze.r(Pt),ze.d(Pt,{decode:()=>W0e,encode:()=>q0e});let ft=!1;const Ze={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 ft&&console.log("RxJS: Back to a better error behavior. Thank you. <3");ft=n},get useDeprecatedSynchronousErrorHandling(){return ft}};function Tt(n){setTimeout(()=>{throw n},0)}const Ft={closed:!0,next(n){},error(n){if(Ze.useDeprecatedSynchronousErrorHandling)throw n;Tt(n)},complete(){}},we=Array.isArray||(n=>n&&"number"==typeof n.length);function _e(n){return null!==n&&"object"==typeof n}const ye=(()=>{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 Te{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 Te)t.remove(this);else if(null!==t)for(let o=0;oe.concat(t instanceof ye?t.errors:t),[])}Te.EMPTY=((n=new Te).closed=!0,n);const He="function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random();class xt extends Te{constructor(e,t,i){switch(super(),this.syncErrorValue=null,this.syncErrorThrown=!1,this.syncErrorThrowable=!1,this.isStopped=!1,arguments.length){case 0:this.destination=Ft;break;case 1:if(!e){this.destination=Ft;break}if("object"==typeof e){e instanceof xt?(this.syncErrorThrowable=e.syncErrorThrowable,this.destination=e,e.add(this)):(this.syncErrorThrowable=!0,this.destination=new tn(this,e));break}default:this.syncErrorThrowable=!0,this.destination=new tn(this,e,t,i)}}[He](){return this}static create(e,t,i){const r=new xt(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 tn extends xt{constructor(e,t,i,r){super(),this._parentSubscriber=e;let s,o=this;Ke(t)?s=t:t&&(s=t.next,i=t.error,r=t.complete,t!==Ft&&(o=Object.create(t),Ke(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;Ze.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}=Ze;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):Tt(e),this.unsubscribe();else{if(this.unsubscribe(),i)throw e;Tt(e)}}}complete(){if(!this.isStopped){const{_parentSubscriber:e}=this;if(this._complete){const t=()=>this._complete.call(this._context);Ze.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(),Ze.useDeprecatedSynchronousErrorHandling)throw i;Tt(i)}}__tryOrSetError(e,t,i){if(!Ze.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{t.call(this._context,i)}catch(r){return Ze.useDeprecatedSynchronousErrorHandling?(e.syncErrorValue=r,e.syncErrorThrown=!0,!0):(Tt(r),!0)}return!1}_unsubscribe(){const{_parentSubscriber:e}=this;this._context=null,this._parentSubscriber=null,e.unsubscribe()}}const vi="function"==typeof Symbol&&Symbol.observable||"@@observable";function bi(n){return n}function Mr(...n){return Ve(n)}function Ve(n){return 0===n.length?bi:1===n.length?n[0]:function(t){return n.reduce((i,r)=>r(i),t)}}let ce=(()=>{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 xt)return n;if(n[He])return n[He]()}return n||e||t?new xt(n,e,t):new xt(Ft)}(t,i,r);if(o.add(s?s.call(o,this.source):this.source||Ze.useDeprecatedSynchronousErrorHandling&&!o.syncErrorThrowable?this._subscribe(o):this._trySubscribe(o)),Ze.useDeprecatedSynchronousErrorHandling&&o.syncErrorThrowable&&(o.syncErrorThrowable=!1,o.syncErrorThrown))throw o.syncErrorValue;return o}_trySubscribe(t){try{return this._subscribe(t)}catch(i){Ze.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 xt?t:null}return!0}(t)?t.error(i):console.warn(i)}}forEach(t,i){return new(i=zt(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)}[vi](){return this}pipe(...t){return 0===t.length?this:Ve(t)(this)}toPromise(t){return new(t=zt(t))((i,r)=>{let s;this.subscribe(o=>s=o,o=>r(o),()=>i(s))})}}return n.create=e=>new n(e),n})();function zt(n){if(n||(n=Ze.Promise||Promise),!n)throw new Error("no Promise impl found");return n}const Qt=(()=>{function n(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return n.prototype=Object.create(Error.prototype),n})();class li extends Te{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 Pi extends xt{constructor(e){super(e),this.destination=e}}let Se=(()=>{class n extends ce{constructor(){super(),this.observers=[],this.closed=!1,this.isStopped=!1,this.hasError=!1,this.thrownError=null}[He](){return new Pi(this)}lift(t){const i=new pn(this,this);return i.operator=t,i}next(t){if(this.closed)throw new Qt;if(!this.isStopped){const{observers:i}=this,r=i.length,s=i.slice();for(let o=0;onew pn(e,t),n})();class pn extends Se{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):Te.EMPTY}}function Gn(n){return n&&"function"==typeof n.schedule}function Ae(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 Ri(n,e))}}class Ri{constructor(e,t){this.project=e,this.thisArg=t}call(e,t){return t.subscribe(new jt(e,this.project,this.thisArg))}}class jt extends xt{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 xr=n=>e=>{for(let t=0,i=n.length;tn&&"number"==typeof n.length&&"function"!=typeof n;function Ye(n){return!!n&&"function"!=typeof n.subscribe&&"function"==typeof n.then}const ki=n=>{if(n&&"function"==typeof n[vi])return(n=>e=>{const t=n[vi]();if("function"!=typeof t.subscribe)throw new TypeError("Provided object does not correctly implement Symbol.observable");return t.subscribe(e)})(n);if(pt(n))return xr(n);if(Ye(n))return(n=>e=>(n.then(t=>{e.closed||(e.next(t),e.complete())},t=>e.error(t)).then(null,Tt),e))(n);if(n&&"function"==typeof n[cs])return(n=>e=>{const t=n[cs]();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 ${_e(n)?"an invalid object":`'${n}'`} where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.`;throw new TypeError(t)}};function Fi(n,e){return new ce(t=>{const i=new Te;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 ui(n,e){return e?function(n,e){if(null!=n){if(function(n){return n&&"function"==typeof n[vi]}(n))return function(n,e){return new ce(t=>{const i=new Te;return i.add(e.schedule(()=>{const r=n[vi]();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(Ye(n))return function(n,e){return new ce(t=>{const i=new Te;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(pt(n))return Fi(n,e);if(function(n){return n&&"function"==typeof n[cs]}(n)||"string"==typeof n)return function(n,e){if(!n)throw new Error("Iterable cannot be null");return new ce(t=>{const i=new Te;let r;return i.add(()=>{r&&"function"==typeof r.return&&r.return()}),i.add(e.schedule(()=>{r=n[cs](),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 ce?n:new ce(ki(n))}class Gr extends xt{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 ii extends xt{notifyNext(e){this.destination.next(e)}notifyError(e){this.destination.error(e)}notifyComplete(){this.destination.complete()}}function co(n,e){if(e.closed)return;if(n instanceof ce)return n.subscribe(e);let t;try{t=ki(n)(e)}catch(i){e.error(i)}return t}function di(n,e,t=Number.POSITIVE_INFINITY){return"function"==typeof e?i=>i.pipe(di((r,s)=>ui(n(r,s)).pipe(Ae((o,a)=>e(r,o,s,a))),t)):("number"==typeof e&&(t=e),i=>i.lift(new Oh(n,t)))}class Oh{constructor(e,t=Number.POSITIVE_INFINITY){this.project=e,this.concurrent=t}call(e,t){return t.subscribe(new El(e,this.project,this.concurrent))}}class El extends ii{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 uo(n=Number.POSITIVE_INFINITY){return di(bi,n)}function za(n,e){return e?Fi(n,e):new ce(xr(n))}function Ni(...n){let e=Number.POSITIVE_INFINITY,t=null,i=n[n.length-1];return Gn(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 ce?n[0]:uo(e)(za(n,t))}function us(){return function(e){return e.lift(new ho(e))}}class ho{constructor(e){this.connectable=e}call(e,t){const{connectable:i}=this;i._refCount++;const r=new gc(e,i),s=t.subscribe(r);return r.closed||(r.connection=i.connect()),s}}class gc extends xt{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 Sl extends ce{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 Te,e.add(this.source.subscribe(new pu(this.getSubject(),this))),e.closed&&(this._connection=null,e=Te.EMPTY)),e}refCount(){return us()(this)}}const fu=(()=>{const n=Sl.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 pu extends Pi{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()}}}function mc(n,e){return function(i){let r;if(r="function"==typeof n?n:function(){return n},"function"==typeof e)return i.lift(new pd(r,e));const s=Object.create(i,fu);return s.source=i,s.subjectFactory=r,s}}class pd{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 mu(){return new Se}function Vs(){return n=>us()(mc(mu)(n))}function Je(n){for(let e in n)if(n[e]===Je)return e;throw Error("Could not find renamed property on target object.")}function _u(n,e){for(const t in e)e.hasOwnProperty(t)&&!n.hasOwnProperty(t)&&(n[t]=e[t])}function W(n){if("string"==typeof n)return n;if(Array.isArray(n))return"["+n.map(W).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 Y(n,e){return null==n||""===n?null===e?"":e:null==e||""===e?n:n+" "+e}const J=Je({__forward_ref__:Je});function T(n){return n.__forward_ref__=T,n.toString=function(){return W(this())},n}function D(n){return B(n)?n():n}function B(n){return"function"==typeof n&&n.hasOwnProperty(J)&&n.__forward_ref__===T}class $ extends Error{constructor(e,t){super(function(n,e){return`${n?`NG0${n}: `:""}${e}`}(e,t)),this.code=e}}function pe(n){return"string"==typeof n?n:null==n?"":String(n)}function Ge(n){return"function"==typeof n?n.name||n.toString():"object"==typeof n&&null!=n&&"function"==typeof n.type?n.type.name||n.type.toString():pe(n)}function Et(n,e){const t=e?` in ${e}`:"";throw new $("201",`No provider for ${Ge(n)} found${t}`)}function Gi(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 ue(n){return{token:n.token,providedIn:n.providedIn||null,factory:n.factory,value:void 0}}function Me(n){return{providers:n.providers||[],imports:n.imports||[]}}function rr(n){return vc(n,ua)||vc(n,Ua)}function vc(n,e){return n.hasOwnProperty(e)?n[e]:null}function Cu(n){return n&&(n.hasOwnProperty(Tl)||n.hasOwnProperty(Sp))?n[Tl]:null}const ua=Je({\u0275prov:Je}),Tl=Je({\u0275inj:Je}),Ua=Je({ngInjectableDef:Je}),Sp=Je({ngInjectorDef:Je});var At=(()=>((At=At||{})[At.Default=0]="Default",At[At.Host=1]="Host",At[At.Self=2]="Self",At[At.SkipSelf=4]="SkipSelf",At[At.Optional=8]="Optional",At))();let Al;function da(n){const e=Al;return Al=n,e}function md(n,e,t){const i=rr(n);return i&&"root"==i.providedIn?void 0===i.value?i.value=i.factory():i.value:t&At.Optional?null:void 0!==e?e:void Et(W(n),"Injector")}function F(n){return{toString:n}.toString()}var j=(()=>((j=j||{})[j.OnPush=0]="OnPush",j[j.Default=1]="Default",j))(),Ue=(()=>((Ue=Ue||{})[Ue.Emulated=0]="Emulated",Ue[Ue.None=2]="None",Ue[Ue.ShadowDom=3]="ShadowDom",Ue))();const vn="undefined"!=typeof globalThis&&globalThis,dr="undefined"!=typeof window&&window,yr="undefined"!=typeof self&&"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&self,Wr="undefined"!=typeof global&&global,cn=vn||Wr||dr||yr,_d={},mi=[],xp=Je({\u0275cmp:Je}),d_=Je({\u0275dir:Je}),Ph=Je({\u0275pipe:Je}),b0=Je({\u0275mod:Je}),xx=Je({\u0275loc:Je}),Dl=Je({\u0275fac:Je}),Rh=Je({__NG_ELEMENT_ID__:Je});let Tx=0;function Ne(n){return F(()=>{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===j.OnPush,directiveDefs:null,pipeDefs:null,selectors:n.selectors||mi,viewQuery:n.viewQuery||null,features:n.features||null,data:n.data||{},encapsulation:n.encapsulation||Ue.Emulated,id:"c",styles:n.styles||mi,_:null,setInput:null,schemas:n.schemas||null,tView:null},r=n.directives,s=n.features,o=n.pipes;return i.id+=Tx++,i.inputs=S0(n.inputs,t),i.outputs=S0(n.outputs),s&&s.forEach(a=>a(i)),i.directiveDefs=r?()=>("function"==typeof r?r():r).map(C0):null,i.pipeDefs=o?()=>("function"==typeof o?o():o).map(w0):null,i})}function C0(n){return Kn(n)||function(n){return n[d_]||null}(n)}function w0(n){return function(n){return n[Ph]||null}(n)}const E0={};function Pe(n){return F(()=>{const e={type:n.type,bootstrap:n.bootstrap||mi,declarations:n.declarations||mi,imports:n.imports||mi,exports:n.exports||mi,transitiveCompileScopes:null,schemas:n.schemas||null,id:n.id||null};return null!=n.id&&(E0[n.id]=n.type),e})}function S0(n,e){if(null==n)return _d;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 oe=Ne;function ds(n){return{type:n.type,name:n.name,factory:null,pure:!1!==n.pure,onDestroy:n.type.prototype.ngOnDestroy||null}}function Kn(n){return n[xp]||null}function po(n,e){const t=n[b0]||null;if(!t&&!0===e)throw new Error(`Type ${W(n)} does not have '\u0275mod' property.`);return t}function Fo(n){return Array.isArray(n)&&"object"==typeof n[1]}function No(n){return Array.isArray(n)&&!0===n[1]}function p_(n){return 0!=(8&n.flags)}function Cd(n){return 2==(2&n.flags)}function wd(n){return 1==(1&n.flags)}function pa(n){return null!==n.template}function M0(n){return 0!=(512&n[2])}function wc(n,e){return n.hasOwnProperty(Dl)?n[Dl]:null}class y_{constructor(e,t,i){this.previousValue=e,this.currentValue=t,this.firstChange=i}isFirstChange(){return this.firstChange}}function zn(){return A0}function A0(n){return n.type.prototype.ngOnChanges&&(n.setInput=Fx),kx}function kx(){const n=q(this),e=null==n?void 0:n.current;if(e){const t=n.previous;if(t===_d)n.previous=e;else for(let i in e)t[i]=e[i];n.current=null,this.ngOnChanges(e)}}function Fx(n,e,t,i){const r=q(n)||function(n,e){return n[Vh]=e}(n,{previous:_d,current:null}),s=r.current||(r.current={}),o=r.previous,a=this.declaredInputs[t],l=o[a];s[a]=new y_(l&&l.currentValue,e,o===_d),n[i]=e}zn.ngInherit=!0;const Vh="__ngSimpleChanges__";function q(n){return n[Vh]||null}const Wn="http://www.w3.org/2000/svg";let fi;function Ii(n){return!!n.listen}const Su={createRenderer:(n,e)=>void 0!==fi?fi:"undefined"!=typeof document?document:void 0};function qi(n){for(;Array.isArray(n);)n=n[0];return n}function zh(n,e){return qi(e[n])}function Ts(n,e){return qi(e[n.index])}function C_(n,e){return n.data[e]}function Ed(n,e){return n[e]}function fs(n,e){const t=e[n];return Fo(t)?t:t[0]}function Pl(n){return 4==(4&n[2])}function Sd(n){return 128==(128&n[2])}function ma(n,e){return null==e?null:n[e]}function w_(n){n[18]=0}function Dp(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 Yt={lFrame:xu(null),bindingsEnabled:!0,isInCheckNoChangesMode:!1};function O0(){return Yt.bindingsEnabled}function Oe(){return Yt.lFrame.lView}function Dn(){return Yt.lFrame.tView}function en(n){return Yt.lFrame.contextLView=n,n[8]}function Dr(){let n=E_();for(;null!==n&&64===n.type;)n=n.parent;return n}function E_(){return Yt.lFrame.currentTNode}function Ga(n,e){const t=Yt.lFrame;t.currentTNode=n,t.isParent=e}function pr(){return Yt.lFrame.isParent}function Lr(){Yt.lFrame.isParent=!1}function Hh(){return Yt.isInCheckNoChangesMode}function Ip(n){Yt.isInCheckNoChangesMode=n}function Yr(){const n=Yt.lFrame;let e=n.bindingRootIndex;return-1===e&&(e=n.bindingRootIndex=n.tView.bindingStartIndex),e}function Us(){return Yt.lFrame.bindingIndex}function _a(){return Yt.lFrame.bindingIndex++}function mo(n){const e=Yt.lFrame,t=e.bindingIndex;return e.bindingIndex=e.bindingIndex+n,t}function Md(n,e){const t=Yt.lFrame;t.bindingIndex=t.bindingRootIndex=n,S_(e)}function S_(n){Yt.lFrame.currentDirectiveIndex=n}function M_(n){const e=Yt.lFrame.currentDirectiveIndex;return-1===e?null:n[e]}function I0(){return Yt.lFrame.currentQueryIndex}function x_(n){Yt.lFrame.currentQueryIndex=n}function Rp(n){const e=n[1];return 2===e.type?e.declTNode:1===e.type?n[6]:null}function xd(n,e,t){if(t&At.SkipSelf){let r=e,s=n;for(;!(r=r.parent,null!==r||t&At.Host||(r=Rp(s),null===r||(s=s[15],10&r.type))););if(null===r)return!1;e=r,n=s}const i=Yt.lFrame=O();return i.currentTNode=e,i.lView=n,!0}function Wh(n){const e=O(),t=n[1];Yt.lFrame=e,e.currentTNode=t.firstChild,e.lView=n,e.tView=t,e.contextLView=n,e.bindingIndex=t.bindingStartIndex,e.inI18n=!1}function O(){const n=Yt.lFrame,e=null===n?null:n.child;return null===e?xu(n):e}function xu(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 qh(){const n=Yt.lFrame;return Yt.lFrame=n.parent,n.currentTNode=null,n.lView=null,n}const _o=qh;function Cn(){const n=qh();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 As(){return Yt.lFrame.selectedIndex}function Hs(n){Yt.lFrame.selectedIndex=n}function sr(){const n=Yt.lFrame;return C_(n.tView,n.selectedIndex)}function kp(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 Yh{constructor(e,t,i){this.factory=e,this.resolving=!1,this.canSeeViewProviders=t,this.injectImpl=i}}function Lp(n,e,t){const i=Ii(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 Ad=!0;function Bp(n){const e=Ad;return Ad=n,e}let P_=0;function ps(n,e){const t=Vp(n,e);if(-1!==t)return t;const i=e[1];i.firstCreatePass&&(n.injectorIndex=e.length,R_(i.data,n),R_(e,null),R_(i.blueprint,null));const r=Kh(n,e),s=n.injectorIndex;if(F0(r)){const o=Td(r),a=qa(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 R_(n,e){n.push(0,0,0,0,0,0,0,0,e)}function Vp(n,e){return-1===n.injectorIndex||n.parent&&n.parent.injectorIndex===n.injectorIndex||null===e[n.injectorIndex+8]?-1:n.injectorIndex}function Kh(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 Sc(n,e,t){!function(n,e,t){let i;"string"==typeof t?i=t.charCodeAt(0)||0:t.hasOwnProperty(Rh)&&(i=t[Rh]),null==i&&(i=t[Rh]=P_++);const r=255&i;e.data[n+(r>>5)]|=1<=0?255&e:V0:e}(t);if("function"==typeof s){if(!xd(e,n,i))return i&At.Host?k_(r,t,i):L0(e,t,i,r);try{const o=s(i);if(null!=o||i&At.Optional)return o;Et(t)}finally{_o()}}else if("number"==typeof s){let o=null,a=Vp(n,e),l=-1,c=i&At.Host?e[16][6]:null;for((-1===a||i&At.SkipSelf)&&(l=-1===a?Kh(n,e):e[a+8],-1!==l&&Qh(i,!1)?(o=e[1],a=Td(l),e=qa(l,e)):a=-1);-1!==a;){const d=e[1];if(zp(s,a,d.data)){const f=Xr(a,e,t,o,i,c);if(f!==B0)return f}l=e[a+8],-1!==l&&Qh(i,e[1].data[a+8]===c)&&zp(s,a,e)?(o=d,a=Td(l),e=qa(l,e)):a=-1}}}return L0(e,t,i,r)}const B0={};function V0(){return new Bo(Dr(),Oe())}function Xr(n,e,t,i,r,s){const o=e[1],a=o.data[n+8],d=Dd(a,o,t,null==i?Cd(a)&&Ad:i!=o&&0!=(3&a.type),r&At.Host&&s===a);return null!==d?Od(e,o,d,a):B0}function Dd(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&&pa(g)&&g.type===t)return l}return null}function Od(n,e,t,i){let r=n[t];const s=e.data;if(function(n){return n instanceof Yh}(r)){const o=r;o.resolving&&function(n,e){throw new $("200",`Circular dependency in DI detected for ${n}`)}(Ge(s[t]));const a=Bp(o.canSeeViewProviders);o.resolving=!0;const l=o.injectImpl?da(o.injectImpl):null;xd(n,i,At.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=A0(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&&da(l),Bp(a),o.resolving=!1,_o()}}return r}function zp(n,e,t){return!!(t[e+(n>>5)]&1<{const e=n.prototype.constructor,t=e[Dl]||Kr(e),i=Object.prototype;let r=Object.getPrototypeOf(n.prototype).constructor;for(;r&&r!==i;){const s=r[Dl]||Kr(r);if(s&&s!==t)return s;r=Object.getPrototypeOf(r)}return s=>new s})}function Kr(n){return B(n)?()=>{const e=Kr(D(n));return e&&e()}:wc(n)}function Zr(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{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(Pd)?l[Pd]:Object.defineProperty(l,Pd,{value:[]})[Pd];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 ve{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=ue({token:this,providedIn:t.providedIn||"root",factory:t.factory}))}toString(){return`InjectionToken ${this._desc}`}}const Du=Function;function Vo(n,e){void 0===e&&(e=n);for(let t=0;tArray.isArray(t)?zo(t,e):e(t))}function ef(n,e,t){e>=n.length?n.push(t):n.splice(e,0,t)}function kl(n,e){return e>=n.length-1?n.pop():n.splice(e,1)[0]}function xc(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 z_(n,e){const t=Qr(n,e);if(t>=0)return n[1|t]}function Qr(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):W(a)))}r=`{${s.join(", ")}}`}return`${t}${i?"("+i+")":""}[${r}]: ${n.replace(Dc,"\n ")}`}("\n"+n.message,r,t,i),n.ngTokenPath=r,n[Ac]=null,n}const Ld=Nd(ba("Inject",n=>({token:n})),-1),br=Nd(ba("Optional"),8),Za=Nd(ba("SkipSelf"),4);let Vd;function Nu(n){var e;return(null===(e=function(){if(void 0===Vd&&(Vd=null,cn.trustedTypes))try{Vd=cn.trustedTypes.createPolicy("angular",{createHTML:n=>n,createScript:n=>n,createScriptURL:n=>n})}catch(n){}return Vd}())||void 0===e?void 0:e.createHTML(n))||n}class Bl{constructor(e){this.changingThisBreaksApplicationSecurity=e}toString(){return`SafeValue must use [property]=binding: ${this.changingThisBreaksApplicationSecurity} (see https://g.co/ng/security#xss)`}}class W_ extends Bl{getTypeName(){return"HTML"}}class q_ extends Bl{getTypeName(){return"Style"}}class Jp extends Bl{getTypeName(){return"Script"}}class zd extends Bl{getTypeName(){return"URL"}}class Ut extends Bl{getTypeName(){return"ResourceURL"}}function gs(n){return n instanceof Bl?n.changingThisBreaksApplicationSecurity:n}function jo(n,e){const t=Pc(n);if(null!=t&&t!==e){if("ResourceURL"===t&&"URL"===e)return!0;throw new Error(`Required a safe ${e}, got a ${t} (see https://g.co/ng/security#xss)`)}return t===e}function Pc(n){return n instanceof Bl&&n.getTypeName()||null}class iC{constructor(e){this.inertDocumentHelper=e}getInertBodyElement(e){e=""+e;try{const t=(new window.DOMParser).parseFromString(Nu(e),"text/html").body;return null===t?this.inertDocumentHelper.getInertBodyElement(e):(t.removeChild(t.firstChild),t)}catch(t){return null}}}class f1{constructor(e){if(this.defaultDoc=e,this.inertDocument=this.defaultDoc.implementation.createHTMLDocument("sanitization-inert"),null==this.inertDocument.body){const t=this.inertDocument.createElement("html");this.inertDocument.appendChild(t);const i=this.inertDocument.createElement("body");t.appendChild(i)}}getInertBodyElement(e){const t=this.inertDocument.createElement("template");if("content"in t)return t.innerHTML=Nu(e),t;const i=this.inertDocument.createElement("body");return i.innerHTML=Nu(e),this.defaultDoc.documentMode&&this.stripCustomNsAttrs(i),i}stripCustomNsAttrs(e){const t=e.attributes;for(let r=t.length-1;0bo(e.trim())).join(", ")}function Uo(n){const e={};for(const t of n.split(","))e[t]=!0;return e}function nf(...n){const e={};for(const t of n)for(const i in t)t.hasOwnProperty(i)&&(e[i]=!0);return e}const eg=Uo("area,br,col,hr,img,wbr"),sC=Uo("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr"),oC=Uo("rp,rt"),X_=nf(eg,nf(sC,Uo("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")),nf(oC,Uo("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")),nf(oC,sC)),K_=Uo("background,cite,href,itemtype,longdesc,poster,src,xlink:href"),Z_=Uo("srcset"),Q_=nf(K_,Z_,Uo("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"),Uo("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")),v1=Uo("script,style,template");class J_{constructor(){this.sanitizedSomething=!1,this.buf=[]}sanitizeChildren(e){let t=e.firstChild,i=!0;for(;t;)if(t.nodeType===Node.ELEMENT_NODE?i=this.startElement(t):t.nodeType===Node.TEXT_NODE?this.chars(t.nodeValue):this.sanitizedSomething=!0,i&&t.firstChild)t=t.firstChild;else for(;t;){t.nodeType===Node.ELEMENT_NODE&&this.endElement(t);let r=this.checkClobberedElement(t,t.nextSibling);if(r){t=r;break}t=this.checkClobberedElement(t,t.parentNode)}return this.buf.join("")}startElement(e){const t=e.nodeName.toLowerCase();if(!X_.hasOwnProperty(t))return this.sanitizedSomething=!0,!v1.hasOwnProperty(t);this.buf.push("<"),this.buf.push(t);const i=e.attributes;for(let r=0;r"),!0}endElement(e){const t=e.nodeName.toLowerCase();X_.hasOwnProperty(t)&&!eg.hasOwnProperty(t)&&(this.buf.push(""))}chars(e){this.buf.push(ng(e))}checkClobberedElement(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: ${e.outerHTML}`);return t}}const aC=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,rf=/([^\#-~ |!])/g;function ng(n){return n.replace(/&/g,"&").replace(aC,function(e){return"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";"}).replace(rf,function(e){return"&#"+e.charCodeAt(0)+";"}).replace(//g,">")}let sf;function ey(n,e){let t=null;try{sf=sf||function(n){const e=new f1(n);return function(){try{return!!(new window.DOMParser).parseFromString(Nu(""),"text/html")}catch(n){return!1}}()?new iC(e):e}(n);let i=e?String(e):"";t=sf.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=t.innerHTML,t=sf.getInertBodyElement(i)}while(i!==s);return Nu((new J_).sanitizeChildren(jd(t)||t))}finally{if(t){const i=jd(t)||t;for(;i.firstChild;)i.removeChild(i.firstChild)}}}function jd(n){return"content"in n&&function(n){return n.nodeType===Node.ELEMENT_NODE&&"TEMPLATE"===n.nodeName}(n)?n.content:null}var mn=(()=>((mn=mn||{})[mn.NONE=0]="NONE",mn[mn.HTML=1]="HTML",mn[mn.STYLE=2]="STYLE",mn[mn.SCRIPT=3]="SCRIPT",mn[mn.URL=4]="URL",mn[mn.RESOURCE_URL=5]="RESOURCE_URL",mn))();function Ud(n){const e=function(){const n=Oe();return n&&n[12]}();return e?e.sanitize(mn.URL,n)||"":jo(n,"URL")?gs(n):bo(pe(n))}const iy="__ngContext__";function Jr(n,e){n[iy]=e}function ry(n){const e=function(n){return n[iy]||null}(n);return e?Array.isArray(e)?e:e.lView:null}function ig(n){return n.ngOriginalError}function P1(n,...e){n.error(...e)}class $o{constructor(){this._console=console}handleError(e){const t=this._findOriginalError(e),i=this._findContext(e),r=function(n){return n&&n.ngErrorLogger||P1}(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(ig(e)):null}_findOriginalError(e){let t=e&&ig(e);for(;t&&ig(t);)t=ig(t);return t||null}}const yC=(()=>("undefined"!=typeof requestAnimationFrame&&requestAnimationFrame||setTimeout).bind(cn))();function ly(n){return n.ownerDocument.defaultView}function sg(n){return n.ownerDocument}function Ja(n){return n instanceof Function?n():n}var Co=(()=>((Co=Co||{})[Co.Important=1]="Important",Co[Co.DashCase=2]="DashCase",Co))();function uy(n,e){return undefined(n,e)}function lf(n){const e=n[3];return No(e)?e[3]:e}function $d(n){return EC(n[13])}function hy(n){return EC(n[4])}function EC(n){for(;null!==n&&!No(n);)n=n[4];return n}function Gd(n,e,t,i,r){if(null!=i){let s,o=!1;No(i)?s=i:Fo(i)&&(o=!0,i=i[0]);const a=qi(i);0===n&&null!==t?null==r?AC(e,t,a):el(e,t,a,r||null,!0):1===n&&null!==t?el(e,t,a,r||null,!0):2===n?function(n,e,t){const i=ag(n,e);i&&function(n,e,t,i){Ii(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!==qi(t)&&Gd(e,n,i,s,r);for(let a=10;a0&&(n[t-1][4]=i[4]);const s=kl(n,10+e);!function(n,e){Wd(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 my(n,e){if(!(256&e[2])){const t=e[11];Ii(t)&&t.destroyNode&&Wd(n,e,t,3,null,null),function(n){let e=n[13];if(!e)return og(n[1],n);for(;e;){let t=null;if(Fo(e))t=e[13];else{const i=e[10];i&&(t=i)}if(!t){for(;e&&!e[4]&&e!==n;)Fo(e)&&og(e[1],e),e=e[3];null===e&&(e=n),Fo(e)&&og(e[1],e),t=e&&e[4]}e=t}}(e)}}function og(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!==uf(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 iT(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+=jC(s,r),r=""),i=o,s=s||!wa(i);t++}return""!==r&&(e+=jC(s,r)),e}const kt={};function G(n){UC(Dn(),Oe(),As()+n,Hh())}function UC(n,e,t,i){if(!i)if(3==(3&e[2])){const s=n.preOrderCheckHooks;null!==s&&Fp(e,s,t)}else{const s=n.preOrderHooks;null!==s&&Np(e,s,0,t)}Hs(t)}function tl(n,e){return n<<17|e<<2}function Bt(n){return n>>17&32767}function Yi(n){return 2|n}function Vl(n){return(131068&n)>>2}function nl(n,e){return-131069&n|e<<2}function wy(n){return 1|n}function ZC(n,e){const t=n.contentQueries;if(null!==t)for(let i=0;i20&&UC(n,e,20,Hh()),t(i,r)}finally{Hs(s)}}function JC(n,e,t){if(p_(e)){const r=e.directiveEnd;for(let s=e.directiveStart;s0;){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 lw(n,e){null!==n.hostBindings&&n.hostBindings(1,e)}function cw(n,e){e.flags|=2,(n.components||(n.components=[])).push(e.index)}function IT(n,e,t){if(t){if(e.exportAs)for(let i=0;i0&&ky(t)}}function ky(n){for(let i=$d(n);null!==i;i=hy(i))for(let r=10;r0&&ky(s)}const t=n[1].components;if(null!==t)for(let i=0;i0&&ky(r)}}function BT(n,e){const t=fs(e,n),i=t[1];(function(n,e){for(let t=e.length;tPromise.resolve(null))();function hw(n){return n[7]||(n[7]=[])}function _g(n){return n.cleanup||(n.cleanup=[])}function Vy(n,e,t){return(null===n||pa(n))&&(t=function(n){for(;Array.isArray(n);){if("object"==typeof n[1])return n;n=n[0]}return null}(t[e.index])),t[11]}function zy(n,e){const t=n[9],i=t?t.get($o,null):null;i&&i.handleError(e)}function fw(n,e,t,i,r){for(let s=0;sthis.processProvider(a,e,t)),zo([e],a=>this.processInjectorType(a,[],s)),this.records.set(Fc,zu(void 0,this));const o=this.records.get(Vu);this.scope=null!=o?o.value:null,this.source=r||("object"==typeof e?null:W(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=Pu,i=At.Default){this.assertNotDestroyed();const r=Fd(this),s=da(void 0);try{if(!(i&At.SkipSelf)){let a=this.records.get(e);if(void 0===a){const l=function(n){return"function"==typeof n||"object"==typeof n&&n instanceof ve}(e)&&rr(e);a=l&&this.injectableDefInScope(l)?zu(Gy(e),gf):null,this.records.set(e,a)}if(null!=a)return this.hydrate(e,a)}return(i&At.Self?pw():this.parent).get(e,t=i&At.Optional&&t===Pu?null:t)}catch(o){if("NullInjectorError"===o.name){if((o[Ac]=o[Ac]||[]).unshift(W(e)),r)throw o;return Ds(o,e,"R3InjectorError",this.source)}throw o}finally{da(s),Fd(r)}}_resolveInjectorDefTypes(){this.injectorDefTypes.forEach(e=>this.get(e))}toString(){const e=[];return this.records.forEach((i,r)=>e.push(W(r))),`R3Injector[${e.join(", ")}]`}assertNotDestroyed(){if(this._destroyed)throw new Error("Injector has already been destroyed.")}processInjectorType(e,t,i){if(!(e=D(e)))return!1;let r=Cu(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=Cu(s)),null==r)return!1;if(null!=r.imports&&!a){let d;i.push(o);try{zo(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||mi))}}this.injectorDefTypes.add(o);const l=wc(o)||(()=>new o);this.records.set(o,zu(l,gf));const c=r.providers;if(null!=c&&!a){const d=e;zo(c,f=>this.processProvider(f,d,c))}return void 0!==s&&void 0!==e.providers}processProvider(e,t,i){let r=Nc(e=D(e))?e:D(e&&e.provide);const s=function(n,e,t){return _w(n)?zu(void 0,n.useValue):zu(mw(n),gf)}(e);if(Nc(e)||!0!==e.multi)this.records.get(r);else{let o=this.records.get(r);o||(o=zu(void 0,gf,!0),o.factory=()=>ku(o.multi),this.records.set(r,o)),r=e,o.multi.push(e)}this.records.set(r,s)}hydrate(e,t){return t.value===gf&&(t.value=GT,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=D(e.providedIn);return"string"==typeof t?"any"===t||t===this.scope:this.injectorDefTypes.has(t)}}function Gy(n){const e=rr(n),t=null!==e?e.factory:wc(n);if(null!==t)return t;if(n instanceof ve)throw new Error(`Token ${W(n)} is missing a \u0275prov definition.`);if(n instanceof Function)return function(n){const e=n.length;if(e>0){const i=xc(e,"?");throw new Error(`Can't resolve all parameters for ${W(n)}: (${i.join(", ")}).`)}const t=function(n){const e=n&&(n[ua]||n[Ua]);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 mw(n,e,t){let i;if(Nc(n)){const r=D(n);return wc(r)||Gy(r)}if(_w(n))i=()=>D(n.useValue);else if(function(n){return!(!n||!n.useFactory)}(n))i=()=>n.useFactory(...ku(n.deps||[]));else if(function(n){return!(!n||!n.useExisting)}(n))i=()=>I(D(n.useExisting));else{const r=D(n&&(n.useClass||n.provide));if(!function(n){return!!n.deps}(n))return wc(r)||Gy(r);i=()=>new r(...ku(n.deps))}return i}function zu(n,e,t=!1){return{factory:n,value:e,multi:t?[]:void 0}}function _w(n){return null!==n&&"object"==typeof n&&Wp in n}function Nc(n){return"function"==typeof n}const yw=function(n,e,t){return function(n,e=null,t=null,i){const r=gw(n,e,t,i);return r._resolveInjectorDefTypes(),r}({name:t},e,n,t)};class Nt{static create(e,t){return Array.isArray(e)?yw(e,t,""):yw(e.providers,e.parent,e.name||"")}}function m7(n,e){kp(ry(n)[1],Dr())}function ct(n){let e=function(n){return Object.getPrototypeOf(n.prototype).constructor}(n.type),t=!0;const i=[n];for(;e;){let r;if(pa(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=oA(n.inputs),o.declaredInputs=oA(n.declaredInputs),o.outputs=oA(n.outputs);const a=r.hostBindings;a&&b7(n,a);const l=r.viewQuery,c=r.contentQueries;if(l&&y7(n,l),c&&v7(n,c),_u(n.inputs,r.inputs),_u(n.declaredInputs,r.declaredInputs),_u(n.outputs,r.outputs),pa(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=Xh(r.hostAttrs,t=Xh(t,r.hostAttrs))}}(i)}function oA(n){return n===_d?{}:n===mi?[]:n}function y7(n,e){const t=n.viewQuery;n.viewQuery=t?(i,r)=>{e(i,r),t(i,r)}:e}function v7(n,e){const t=n.contentQueries;n.contentQueries=t?(i,r,s)=>{e(i,r,s),t(i,r,s)}:e}function b7(n,e){const t=n.hostBindings;n.hostBindings=t?(i,r)=>{e(i,r),t(i,r)}:e}Nt.THROW_IF_NOT_FOUND=Pu,Nt.NULL=new Ps,Nt.\u0275prov=ue({token:Nt,providedIn:"any",factory:()=>I(Fc)}),Nt.__NG_ELEMENT_ID__=-1;let Ew=null;function vg(){if(!Ew){const n=cn.Symbol;if(n&&n.iterator)Ew=n.iterator;else{const e=Object.getOwnPropertyNames(Map.prototype);for(let t=0;ta(qi(N[i.index])):i.index;if(Ii(t)){let N=null;if(!a&&l&&(N=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!==N)(N.__ngLastListenerFn__||N).__ngNextListenerFn__=s,N.__ngLastListenerFn__=s,g=!1;else{s=fA(i,e,f,s,!1);const V=t.listen(C,r,s);p.push(s,V),d&&d.push(r,x,w,w+1)}}else s=fA(i,e,f,s,!0),C.addEventListener(r,s,o),p.push(s),d&&d.push(r,x,w,o)}else s=fA(i,e,f,s,!1);const _=i.outputs;let y;if(g&&null!==_&&(y=_[r])){const v=y.length;if(v)for(let C=0;C0;)e=e[15],n--;return e}(n,Yt.lFrame.contextLView))[8]}(n)}function J7(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 ts={textEnd:0,key:0,keyEnd:0,value:0,valueEnd:0};function FN(n){return n.substring(ts.key,ts.keyEnd)}function NN(n,e){const t=ts.textEnd;return t===e?-1:(e=ts.keyEnd=function(n,e,t){for(;e32;)e++;return e}(n,ts.key=e,t),Ig(n,e,t))}function Ig(n,e,t){for(;e=0;t=NN(e,t))yo(n,FN(e),!0)}function $l(n,e,t,i){const r=Oe(),s=Dn(),o=mo(2);s.firstUpdatePass&&UN(s,n,o,i),e!==kt&&qs(r,o,e)&&$N(s,s.data[As()],r,r[11],n,r[o+1]=function(n,e){return null==n||("string"==typeof e?n+=e:"object"==typeof n&&(n=W(gs(n)))),n}(e,t),i,o)}function Gl(n,e,t,i){const r=Dn(),s=mo(2);r.firstUpdatePass&&UN(r,null,s,i);const o=Oe();if(t!==kt&&qs(o,s,t)){const a=r.data[As()];if(WN(a,i)&&!jN(r,s)){let l=i?a.classesWithoutHost:a.stylesWithoutHost;null!==l&&(t=Y(l,t||"")),hA(r,a,o,t,i)}else!function(n,e,t,i,r,s,o,a){r===kt&&(r=mi);let l=0,c=0,d=0=n.expandoStartIndex}function UN(n,e,t,i){const r=n.data;if(null===r[t+1]){const s=r[As()],o=jN(n,t);WN(s,i)&&null===e&&!o&&(e=!1),e=function(n,e,t,i){const r=M_(n);let s=i?e.residualClasses:e.residualStyles;if(null===r)0===(i?e.classBindings:e.styleBindings)&&(t=ev(t=gA(null,n,e,t,i),e.attrs,i),s=null);else{const o=e.directiveStylingLast;if(-1===o||n[o]!==r)if(t=gA(r,n,e,t,i),null===s){let l=function(n,e,t){const i=t?e.classBindings:e.styleBindings;if(0!==Vl(i))return n[Bt(i)]}(n,e,i);void 0!==l&&Array.isArray(l)&&(l=gA(null,n,e,l[1],i),l=ev(l,e.attrs,i),function(n,e,t,i){n[Bt(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=Bt(n[a+1]);n[i+1]=tl(p,a),0!==p&&(n[p+1]=nl(n[p+1],i)),n[a+1]=function(n,e){return 131071&n|e<<17}(n[a+1],i)}else n[i+1]=tl(a,0),0!==a&&(n[a+1]=nl(n[a+1],i)),a=i;else n[i+1]=tl(l,0),0===a?a=i:n[l+1]=nl(n[l+1],i),l=i;c&&(n[i+1]=Yi(n[i+1])),kN(n,d,i,!0),kN(n,d,i,!1),function(n,e,t,i,r){const s=r?n.residualClasses:n.residualStyles;null!=s&&"string"==typeof e&&Qr(s,e)>=0&&(t[i+1]=wy(t[i+1]))}(e,d,n,i,s),o=tl(a,l),s?e.classBindings=o:e.styleBindings=o}(r,s,e,t,o,i)}}function gA(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===kt&&(p=f?mi:void 0);let g=f?z_(p,i):d===i?p:void 0;if(c&&!Tw(g)&&(g=z_(l,i)),Tw(g)&&(a=g,o))return a;const _=n[r+1];r=o?Bt(_):Vl(_)}if(null!==e){let l=s?e.residualClasses:e.residualStyles;null!=l&&(a=z_(l,i))}return a}function Tw(n){return void 0!==n}function WN(n,e){return 0!=(n.flags&(e?16:32))}function De(n,e=""){const t=Oe(),i=Dn(),r=n+20,s=i.firstCreatePass?Yd(i,r,1,e,null):i.data[r],o=t[r]=function(n,e){return Ii(n)?n.createText(e):n.createTextNode(e)}(t[11],e);lg(i,t,o,s),Ga(s,!1)}function xi(n){return or("",n,""),xi}function or(n,e,t){const i=Oe(),r=Cg(i,n,e,t);return r!==kt&&zl(i,As(),r),or}function Aw(n,e,t,i,r){const s=Oe(),o=function(n,e,t,i,r,s){const a=mf(n,Us(),t,r);return mo(2),a?e+pe(t)+i+pe(r)+s:kt}(s,n,e,t,i,r);return o!==kt&&zl(s,As(),o),Aw}function al(n,e,t){const i=Oe();return qs(i,_a(),e)&&wo(Dn(),sr(),i,n,e,i[11],t,!0),al}function Pg(n,e,t){const i=Oe();if(qs(i,_a(),e)){const s=Dn(),o=sr();wo(s,o,i,n,e,Vy(M_(s.data),o,i),t,!0)}return Pg}const bf=void 0;var FY=["en",[["a","p"],["AM","PM"],bf],[["AM","PM"],bf,bf],[["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"]],bf,[["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"]],bf,[["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}",bf,"{1} 'at' {0}",bf],[".",",",";","%","+","-","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 Rg={};function dL(n){return n in Rg||(Rg[n]=cn.ng&&cn.ng.common&&cn.ng.common.locales&&cn.ng.common.locales[n]),Rg[n]}var at=(()=>((at=at||{})[at.LocaleId=0]="LocaleId",at[at.DayPeriodsFormat=1]="DayPeriodsFormat",at[at.DayPeriodsStandalone=2]="DayPeriodsStandalone",at[at.DaysFormat=3]="DaysFormat",at[at.DaysStandalone=4]="DaysStandalone",at[at.MonthsFormat=5]="MonthsFormat",at[at.MonthsStandalone=6]="MonthsStandalone",at[at.Eras=7]="Eras",at[at.FirstDayOfWeek=8]="FirstDayOfWeek",at[at.WeekendRange=9]="WeekendRange",at[at.DateFormat=10]="DateFormat",at[at.TimeFormat=11]="TimeFormat",at[at.DateTimeFormat=12]="DateTimeFormat",at[at.NumberSymbols=13]="NumberSymbols",at[at.NumberFormats=14]="NumberFormats",at[at.CurrencyCode=15]="CurrencyCode",at[at.CurrencySymbol=16]="CurrencySymbol",at[at.CurrencyName=17]="CurrencyName",at[at.Currencies=18]="Currencies",at[at.Directionality=19]="Directionality",at[at.PluralCase=20]="PluralCase",at[at.ExtraData=21]="ExtraData",at))();const Dw="en-US";let hL=Dw;function mA(n){Gi(n,"Expected localeId to be defined"),"string"==typeof n&&(hL=n.toLowerCase().replace(/_/g,"-"))}function vA(n,e,t,i,r){if(n=D(n),Array.isArray(n))for(let s=0;s>20;if(Nc(n)||!n.multi){const g=new Yh(l,r,E),_=CA(a,e,r?d:d+p,f);-1===_?(Sc(ps(c,o),s,a),bA(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=CA(a,e,d+p,f),_=CA(a,e,d,d+p),y=g>=0&&t[g],v=_>=0&&t[_];if(r&&!v||!r&&!y){Sc(ps(c,o),s,a);const C=function(n,e,t,i,r){const s=new Yh(n,t,E);return s.multi=[],s.index=e,s.componentProviders=0,NL(s,r,i&&!t),s}(r?PX:IX,t.length,r,i,l);!r&&v&&(t[_].providerFactory=C),bA(s,n,e.length,0),e.push(a),c.directiveStart++,c.directiveEnd++,r&&(c.providerIndexes+=1048576),t.push(C),o.push(C)}else bA(s,n,g>-1?g:_,NL(t[r?_:g],l,!r&&i));!r&&i&&v&&t[_].componentProviders++}}}function bA(n,e,t,i){const r=Nc(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 NL(n,e,t){return t&&n.componentProviders++,n.multi.push(e)-1}function CA(n,e,t,i){for(let r=t;r{t.providersResolver=(i,r)=>function(n,e,t){const i=Dn();if(i.firstCreatePass){const r=pa(n);vA(t,i.data,i.blueprint,r,!0),vA(e,i.data,i.blueprint,r,!1)}}(i,r?r(n):n,e)}}class LL{}const VL="ngComponent";class FX{resolveComponentFactory(e){throw function(n){const e=Error(`No component factory found for ${W(n)}. Did you add it to @NgModule.entryComponents?`);return e[VL]=n,e}(e)}}class ll{}function kw(...n){}function Fg(n,e){return new rt(Ts(n,e))}ll.NULL=new FX;const BX=function(){return Fg(Dr(),Oe())};let rt=(()=>{class n{constructor(t){this.nativeElement=t}}return n.__NG_ELEMENT_ID__=BX,n})();function zL(n){return n instanceof rt?n.nativeElement:n}class Cf{}let zc=(()=>{class n{}return n.__NG_ELEMENT_ID__=()=>zX(),n})();const zX=function(){const n=Oe(),t=fs(Dr().index,n);return function(n){return n[11]}(Fo(t)?t:n)};let SA=(()=>{class n{}return n.\u0275prov=ue({token:n,providedIn:"root",factory:()=>null}),n})();class ju{constructor(e){this.full=e,this.major=e.split(".")[0],this.minor=e.split(".")[1],this.patch=e.split(".").slice(2).join(".")}}const jL=new ju("12.2.5");class UL{constructor(){}supports(e){return Ky(e)}create(e){return new $X(e)}}const HX=(n,e)=>e;class $X{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||HX}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<$L(i,r,s)?t:i,a=$L(o,r,s),l=o.currentIndex;if(o===i)r--,i=i._nextRemoved;else if(t=t._next,null==o.previousIndex)r++;else{s||(s=[]);const c=a-r,d=l-r;if(c!=d){for(let p=0;p{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 GX(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 HL),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 HL),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 GX{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 WX{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 HL{constructor(){this.map=new Map}put(e){const t=e.trackById;let i=this.map.get(t);i||(i=new WX,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 $L(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 YX(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 YX{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 WL(){return new Ng([new UL])}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||WL()),deps:[[n,new Za,new br]]}}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=ue({token:n,providedIn:"root",factory:WL}),n})();function qL(){return new Lg([new GL])}let Lg=(()=>{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||qL()),deps:[[n,new Za,new br]]}}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=ue({token:n,providedIn:"root",factory:qL}),n})();function Fw(n,e,t,i,r=!1){for(;null!==t;){const s=e[t.index];if(null!==s&&i.push(qi(s)),No(s))for(let a=10;a-1&&(gy(e,i),kl(t,i))}this._attachedToViewContainer=!1}my(this._lView[1],this._lView)}onDestroy(e){tw(this._lView[1],this._lView,null,e)}markForCheck(){Fy(this._cdRefInjectingView||this._lView)}detach(){this._lView[2]&=-129}reattach(){this._lView[2]|=128}detectChanges(){Ly(this._lView[1],this._lView,this.context)}checkNoChanges(){!function(n,e,t){Ip(!0);try{Ly(n,e,t)}finally{Ip(!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){Wd(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 KX extends sv{constructor(e){super(e),this._view=e}detectChanges(){dw(this._view)}checkNoChanges(){!function(n){Ip(!0);try{dw(n)}finally{Ip(!1)}}(this._view)}get context(){return null}}const QX=function(n){return function(n,e,t){if(Cd(n)&&!t){const i=fs(n.index,e);return new sv(i,i)}return 47&n.type?new sv(e[16],e):null}(Dr(),Oe(),16==(16&n))};let kn=(()=>{class n{}return n.__NG_ELEMENT_ID__=QX,n})();const tK=[new GL],iK=new Ng([new UL]),rK=new Lg(tK),oK=function(){return Nw(Dr(),Oe())};let Ys=(()=>{class n{}return n.__NG_ELEMENT_ID__=oK,n})();const aK=Ys,lK=class extends aK{constructor(e,t,i){super(),this._declarationLView=e,this._declarationTContainer=t,this.elementRef=i}createEmbeddedView(e){const t=this._declarationTContainer.tViews,i=hf(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)),ff(t,i,e),new sv(i)}};function Nw(n,e){return 4&n.type?new lK(e,n,Fg(n,e)):null}class jc{}const dK=function(){return ZL(Dr(),Oe())};let ns=(()=>{class n{}return n.__NG_ELEMENT_ID__=dK,n})();const fK=ns,XL=class extends fK{constructor(e,t,i){super(),this._lContainer=e,this._hostTNode=t,this._hostLView=i}get element(){return Fg(this._hostTNode,this._hostLView)}get injector(){return new Bo(this._hostTNode,this._hostLView)}get parentInjector(){const e=Kh(this._hostTNode,this._hostLView);if(F0(e)){const t=qa(e,this._hostLView),i=Td(e);return new Bo(t[1].data[i+8],t)}return new Bo(null,this._hostLView)}clear(){for(;this.length>0;)this.remove(this.length-1)}get(e){const t=KL(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(jc,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 No(n[3])}(i)){const d=this.indexOf(e);if(-1!==d)this.detach(d);else{const f=i[3],p=new XL(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),iyC});class vB extends LL{constructor(e,t){super(),this.componentDef=e,this.ngModule=t,this.componentType=e.type,this.selector=function(n){return n.map(lT).join(",")}(e.selectors),this.ngContentSelectors=e.ngContentSelectors?e.ngContentSelectors:[],this.isBoundToModule=!!t}get inputs(){return yB(this.componentDef.inputs)}get outputs(){return yB(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,jg,r);return s!==jg||i===jg?s:e.get(t,i,r)}}}(e,r.injector):e,o=s.get(Cf,Su),a=s.get(SA,null),l=o.createRenderer(null,this.componentDef),c=this.componentDef.selectors[0][0]||"div",d=i?function(n,e,t){if(Ii(n))return n.selectRootElement(e,t===Ue.ShadowDom);let i="string"==typeof e?n.querySelector(e):e;return i.textContent="",i}(l,i,this.componentDef.encapsulation):py(o.createRenderer(null,this.componentDef),c,function(n){const e=n.toLowerCase();return"svg"===e?Wn:"math"===e?"http://www.w3.org/1998/MathML/":null}(c)),f=this.componentDef.onPush?576:528,p=function(n,e){return{components:[],scheduler:n||yC,clean:HT,playerHandler:e||null,flags:0}}(),g=gg(0,null,null,1,0,null,null,null,null,null),_=hf(null,g,p,f,null,null,o,l,a,s);let y,v;Wh(_);try{const C=function(n,e,t,i,r,s){const o=t[1];t[20]=n;const l=Yd(o,20,2,"#host",null),c=l.mergedAttrs=e.hostAttrs;null!==c&&(yg(l,c,!0),null!==n&&(Lp(r,n,c),null!==l.classes&&by(r,n,l.classes),null!==l.styles&&LC(r,n,l.styles)));const d=i.createRenderer(n,e),f=hf(t,pg(e),null,e.onPush?64:16,t[20],l,i,d,s||null,null);return o.firstCreatePass&&(Sc(ps(l,t),o,e.type),cw(o,l),Iy(l,t.length,1)),mg(t,f),t[20]=f}(d,this.componentDef,_,o,l);if(d)if(i)Lp(l,d,["ng-version",jL.full]);else{const{attrs:w,classes:x}=function(n){const e=[],t=[];let i=1,r=2;for(;i0&&by(l,d,x.join(" "))}if(v=C_(g,20),void 0!==t){const w=v.projection=[];for(let x=0;xl(o,e)),e.contentQueries){const l=Dr();e.contentQueries(1,o,l.directiveStart)}const a=Dr();return!s.firstCreatePass||null===e.hostBindings&&null===e.hostAttrs||(Hs(a.index),aw(t[1],a,0,a.directiveStart,a.directiveEnd,e),lw(e,o)),o}(C,this.componentDef,_,p,[m7]),ff(g,_,null)}finally{Cn()}return new hZ(this.componentType,y,Fg(v,_),_,v)}}class hZ 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 KX(r),this.componentType=e}get injector(){return new Bo(this._tNode,this._rootLView)}destroy(){this.hostView.destroy()}onDestroy(e){this.hostView.onDestroy(e)}}const Ug=new Map;class gZ extends jc{constructor(e,t){super(),this._parent=t,this._bootstrapComponents=[],this.injector=this,this.destroyCbs=[],this.componentFactoryResolver=new _B(this);const i=po(e),r=function(n){return n[xx]||null}(e);r&&mA(r),this._bootstrapComponents=Ja(i.bootstrap),this._r3Injector=gw(e,t,[{provide:jc,useValue:this},{provide:ll,useValue:this.componentFactoryResolver}],W(e)),this._r3Injector._resolveInjectorDefTypes(),this.instance=this.get(e)}get(e,t=Nt.THROW_IF_NOT_FOUND,i=At.Default){return e===Nt||e===jc||e===Fc?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 BA extends class{}{constructor(e){super(),this.moduleType=e,null!==po(e)&&function(n){const e=new Set;!function t(i){const r=po(i,!0),s=r.id;null!==s&&(function(n,e,t){if(e&&e!==t)throw new Error(`Duplicate module registered for ${n} - ${W(e)} vs ${W(e.name)}`)}(s,Ug.get(s),i),Ug.set(s,i));const o=Ja(r.imports);for(const a of o)e.has(a)||(e.add(a),t(a))}(n)}(e)}create(e){return new gZ(this.moduleType,e)}}function fv(n,e,t){const i=Yr()+n,r=Oe();return r[i]===kt?Bc(r,i,t?e.call(t):e()):function(n,e){return n[e]}(r,i)}function Hg(n,e,t,i){return wB(Oe(),Yr(),n,e,t,i)}function pv(n,e){const t=n[e];return t===kt?void 0:t}function wB(n,e,t,i,r,s){const o=e+t;return qs(n,o,r)?Bc(n,o+1,s?i.call(s,r):i(r)):pv(n,o+1)}function Kt(n,e){const t=Dn();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 $("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=wc(i.type)),o=da(E);try{const a=Bp(!1),l=s();return Bp(a),function(n,e,t,i){t>=n.data.length&&(n.data[t]=null,n.blueprint[t]=null),e[t]=i}(t,Oe(),r,l),l}finally{da(o)}}function rn(n,e,t){const i=n+20,r=Oe(),s=Ed(r,i);return _v(r,mv(r,i)?wB(r,Yr(),e,s.transform,t,s):s.transform(t))}function gv(n,e,t,i){const r=n+20,s=Oe(),o=Ed(s,r);return _v(s,mv(s,r)?function(n,e,t,i,r,s,o){const a=e+t;return mf(n,a,r,s)?Bc(n,a+2,o?i.call(o,r,s):i(r,s)):pv(n,a+2)}(s,Yr(),e,o.transform,t,i,o):o.transform(t,i))}function mv(n,e){return n[1].data[e].pure}function _v(n,e){return Ul.isWrapped(e)&&(e=Ul.unwrap(e),n[Us()]=kt),e}function VA(n){return e=>{setTimeout(n,void 0,e)}}const Le=class extends Se{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=VA(l),a&&(a=VA(a)),c&&(c=VA(c)));const d=super.subscribe({next:a,error:l,complete:c});return e instanceof Te&&e.add(d),d}};function DZ(){return this._results[vg()]()}class Sf{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=vg(),i=Sf.prototype;i[t]||(i[t]=DZ)}get changes(){return this._changes||(this._changes=new Le)}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=Vo(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=kw,this.reject=kw,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)(I(Mf,8))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();const vv=new ve("AppId"),uQ={provide:vv,useFactory:function(){return`${KA()}${KA()}${KA()}`},deps:[]};function KA(){return String.fromCharCode(97+Math.floor(25*Math.random()))}const XB=new ve("Platform Initializer"),dl=new ve("Platform ID"),bv=new ve("appBootstrapListener");let $w=(()=>{class n{log(t){console.log(t)}warn(t){console.warn(t)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();const Uu=new ve("LocaleId"),KB=new ve("DefaultCurrencyCode");class hQ{constructor(e,t){this.ngModuleFactory=e,this.componentFactories=t}}const ZA=function(n){return new BA(n)},fQ=ZA,pQ=function(n){return Promise.resolve(ZA(n))},ZB=function(n){const e=ZA(n),i=Ja(po(n).declarations).reduce((r,s)=>{const o=Kn(s);return o&&r.push(new vB(o)),r},[]);return new hQ(e,i)},gQ=ZB,mQ=function(n){return Promise.resolve(ZB(n))};let xf=(()=>{class n{constructor(){this.compileModuleSync=fQ,this.compileModuleAsync=pQ,this.compileModuleAndAllComponentsSync=gQ,this.compileModuleAndAllComponentsAsync=mQ}clearCache(){}clearCacheFor(t){}getModuleId(t){}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();const QB=new ve("compilerOptions"),yQ=(()=>Promise.resolve(0))();function QA(n){"undefined"==typeof Zone?yQ.then(()=>{n&&n.apply(null,null)}):Zone.current.scheduleMicroTask("scheduleMicrotask",n)}class dt{constructor({enableLongStackTrace:e=!1,shouldCoalesceEventChangeDetection:t=!1,shouldCoalesceRunChangeDetection:i=!1}){if(this.hasPendingMacrotasks=!1,this.hasPendingMicrotasks=!1,this.isStable=!0,this.onUnstable=new Le(!1),this.onMicrotaskEmpty=new Le(!1),this.onStable=new Le(!1),this.onError=new Le(!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=cn.requestAnimationFrame,e=cn.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(cn,()=>{n.fakeTopEventTask||(n.fakeTopEventTask=Zone.root.scheduleEventTask("fakeTopEventTask",()=>{n.lastRequestAnimationFrameId=-1,eD(n),n.isCheckStableRunning=!0,JA(n),n.isCheckStableRunning=!1},void 0,()=>{},()=>{})),n.fakeTopEventTask.invoke()}),eD(n))}(n)};n._inner=n._inner.fork({name:"angular",properties:{isAngularZone:!0},onInvokeTask:(t,i,r,s,o,a)=>{try{return JB(n),t.invokeTask(r,s,o,a)}finally{(n.shouldCoalesceEventChangeDetection&&"eventTask"===s.type||n.shouldCoalesceRunChangeDetection)&&e(),e3(n)}},onInvoke:(t,i,r,s,o,a,l)=>{try{return JB(n),t.invoke(r,s,o,a,l)}finally{n.shouldCoalesceRunChangeDetection&&e(),e3(n)}},onHasTask:(t,i,r,s)=>{t.hasTask(r,s),i===r&&("microTask"==s.change?(n._hasPendingMicrotasks=s.microTask,eD(n),JA(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(!dt.isInAngularZone())throw new Error("Expected to be in Angular Zone, but it is not!")}static assertNotInAngularZone(){if(dt.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,bQ,kw,kw);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 bQ={};function JA(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 eD(n){n.hasPendingMicrotasks=!!(n._hasPendingMicrotasks||(n.shouldCoalesceEventChangeDetection||n.shouldCoalesceRunChangeDetection)&&-1!==n.lastRequestAnimationFrameId)}function JB(n){n._nesting++,n.isStable&&(n.isStable=!1,n.onUnstable.emit(null))}function e3(n){n._nesting--,JA(n)}class EQ{constructor(){this.hasPendingMicrotasks=!1,this.hasPendingMacrotasks=!1,this.isStable=!0,this.onUnstable=new Le,this.onMicrotaskEmpty=new Le,this.onStable=new Le,this.onError=new Le}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 tD=(()=>{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:()=>{dt.assertNotInAngularZone(),QA(()=>{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())QA(()=>{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)(I(dt))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})(),t3=(()=>{class n{constructor(){this._applications=new Map,nD.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 nD.findTestabilityInTree(this,t,i)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();class SQ{addToWindow(e){}findTestabilityInTree(e,t,i){return null}}let nD=new SQ,n3=!0,i3=!1;function Mo(){return i3=!0,n3}let Yl;const r3=new ve("AllowMultipleToken");function s3(n,e,t=[]){const i=`Platform: ${e}`,r=new ve(i);return(s=[])=>{let o=rD();if(!o||o.injector.get(r3,!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(Yl&&!Yl.destroyed&&!Yl.injector.get(r3,!1))throw new Error("There can be only one platform. Destroy the previous one to create a new one.");Yl=n.get(o3);const e=n.get(XB,null);e&&e.forEach(t=>t())}(Nt.create({providers:a,name:i}))}return function(n){const e=rD();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 rD(){return Yl&&!Yl.destroyed?Yl:null}let o3=(()=>{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 EQ:("zone.js"===n?void 0:n)||new dt({enableLongStackTrace:Mo(),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:dt,useValue:a}];return a.run(()=>{const c=Nt.create({providers:l,parent:this.injector,name:t.moduleType.name}),d=t.create(c),f=d.injector.get($o,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(()=>{sD(this._modules,d),p.unsubscribe()})}),function(n,e,t){try{const i=t();return Og(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(Gg);return p.runInitializers(),p.donePromise.then(()=>(mA(d.injector.get(Uu,Dw)||Dw),this._moduleDoBootstrap(d),d))})})}bootstrapModule(t,i=[]){const r=a3({},i);return function(n,e,t){const i=new BA(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 ${W(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)(I(Nt))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();function a3(n,e){return Array.isArray(e)?e.reduce(a3,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 ce(c=>{this._stable=this._zone.isStable&&!this._zone.hasPendingMacrotasks&&!this._zone.hasPendingMicrotasks,this._zone.runOutsideAngular(()=>{c.next(this._stable),c.complete()})}),l=new ce(c=>{let d;this._zone.runOutsideAngular(()=>{d=this._zone.onStable.subscribe(()=>{dt.assertNotInAngularZone(),QA(()=>{!this._stable&&!this._zone.hasPendingMacrotasks&&!this._zone.hasPendingMicrotasks&&(this._stable=!0,c.next(!0))})})});const f=this._zone.onUnstable.subscribe(()=>{dt.assertInAngularZone(),this._stable&&(this._stable=!1,this._zone.runOutsideAngular(()=>{c.next(!1)}))});return()=>{d.unsubscribe(),f.unsubscribe()}});this.isStable=Ni(a,l.pipe(Vs()))}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 LL?t:this._componentFactoryResolver.resolveComponentFactory(t),this.componentTypes.push(r.componentType);const s=function(n){return n.isBoundToModule}(r)?void 0:this._injector.get(jc),a=r.create(Nt.NULL,[],i||r.selector,s),l=a.location.nativeElement,c=a.injector.get(tD,null),d=c&&a.injector.get(t3);return c&&d&&d.registerApplication(l,c),a.onDestroy(()=>{this.detachView(a.hostView),sD(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;sD(this._views,i),i.detachFromAppRef()}_loadComponent(t){this.attachView(t.hostView),this.tick(),this.components.push(t),this._injector.get(bv,[]).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)(I(dt),I(Nt),I($o),I(ll),I(Gg))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();function sD(n,e){const t=n.indexOf(e);t>-1&&n.splice(t,1)}const ZQ=s3(null,"core",[{provide:dl,useValue:"unknown"},{provide:o3,deps:[Nt]},{provide:t3,deps:[]},{provide:$w,deps:[]}]),nJ=[{provide:Jd,useClass:Jd,deps:[dt,Nt,$o,ll,Gg]},{provide:cZ,deps:[dt],useFactory:function(n){let e=[];return n.onStable.subscribe(()=>{for(;e.length;)e.pop()()}),function(t){e.push(t)}}},{provide:Gg,useClass:Gg,deps:[[new br,Mf]]},{provide:xf,useClass:xf,deps:[]},uQ,{provide:Ng,useFactory:function(){return iK},deps:[]},{provide:Lg,useFactory:function(){return rK},deps:[]},{provide:Uu,useFactory:function(n){return mA(n=n||"undefined"!=typeof $localize&&$localize.locale||Dw),n},deps:[[new Ld(Uu),new br,new Za]]},{provide:KB,useValue:"USD"}];let rJ=(()=>{class n{constructor(t){}}return n.\u0275fac=function(t){return new(t||n)(I(Jd))},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({providers:nJ}),n})(),tE=null;function Uc(){return tE}const ut=new ve("DocumentToken");let Df=(()=>{class n{historyGo(t){throw new Error("Not implemented")}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ue({factory:iee,token:n,providedIn:"platform"}),n})();function iee(){return I(F3)}let F3=(()=>{class n extends Df{constructor(t){super(),this._doc=t,this._init()}_init(){this.location=window.location,this._history=window.history}getBaseHrefFromDOM(){return Uc().getBaseHref(this._doc)}onPopState(t){const i=Uc().getGlobalEventTarget(this._doc,"window");return i.addEventListener("popstate",t,!1),()=>i.removeEventListener("popstate",t)}onHashChange(t){const i=Uc().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){N3()?this._history.pushState(t,i,r):this.location.hash=r}replaceState(t,i,r){N3()?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)(I(ut))},n.\u0275prov=ue({factory:see,token:n,providedIn:"platform"}),n})();function N3(){return!!window.history.pushState}function see(){return new F3(I(ut))}function bD(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}function L3(n){const e=n.match(/#|\?|$/),t=e&&e.index||n.length;return n.slice(0,t-("/"===n[t-1]?1:0))+n.slice(t)}function $u(n){return n&&"?"!==n[0]?"?"+n:n}let Yg=(()=>{class n{historyGo(t){throw new Error("Not implemented")}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ue({factory:oee,token:n,providedIn:"root"}),n})();function oee(n){const e=I(ut).location;return new B3(I(Df),e&&e.origin||"")}const CD=new ve("appBaseHref");let B3=(()=>{class n extends Yg{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 bD(this._baseHref,t)}path(t=!1){const i=this._platformLocation.pathname+$u(this._platformLocation.search),r=this._platformLocation.hash;return r&&t?`${i}${r}`:i}pushState(t,i,r,s){const o=this.prepareExternalUrl(r+$u(s));this._platformLocation.pushState(t,i,o)}replaceState(t,i,r,s){const o=this.prepareExternalUrl(r+$u(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)(I(Df),I(CD,8))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})(),Xg=(()=>{class n{constructor(t,i){this._subject=new Le,this._urlChangeListeners=[],this._platformStrategy=t;const r=this._platformStrategy.getBaseHref();this._platformLocation=i,this._baseHref=L3(V3(r)),this._platformStrategy.onPopState(s=>{this._subject.emit({url:this.path(!0),pop:!0,state:s.state,type:s.type})})}path(t=!1){return this.normalize(this._platformStrategy.path(t))}getState(){return this._platformLocation.getState()}isCurrentPathEqualTo(t,i=""){return this.path()==this.normalize(t+$u(i))}normalize(t){return n.stripTrailingSlash(function(n,e){return n&&e.startsWith(n)?e.substring(n.length):e}(this._baseHref,V3(t)))}prepareExternalUrl(t){return t&&"/"!==t[0]&&(t="/"+t),this._platformStrategy.prepareExternalUrl(t)}go(t,i="",r=null){this._platformStrategy.pushState(r,"",t,i),this._notifyUrlChangeListeners(this.prepareExternalUrl(t+$u(i)),r)}replaceState(t,i="",r=null){this._platformStrategy.replaceState(r,"",t,i),this._notifyUrlChangeListeners(this.prepareExternalUrl(t+$u(i)),r)}forward(){this._platformStrategy.forward()}back(){this._platformStrategy.back()}historyGo(t=0){var i,r;null===(r=(i=this._platformStrategy).historyGo)||void 0===r||r.call(i,t)}onUrlChange(t){this._urlChangeListeners.push(t),this._urlChangeSubscription||(this._urlChangeSubscription=this.subscribe(i=>{this._notifyUrlChangeListeners(i.url,i.state)}))}_notifyUrlChangeListeners(t="",i){this._urlChangeListeners.forEach(r=>r(t,i))}subscribe(t,i,r){return this._subject.subscribe({next:t,error:i,complete:r})}}return n.\u0275fac=function(t){return new(t||n)(I(Yg),I(Df))},n.normalizeQueryParams=$u,n.joinWithSlash=bD,n.stripTrailingSlash=L3,n.\u0275prov=ue({factory:lee,token:n,providedIn:"root"}),n})();function lee(){return new Xg(I(Yg),I(Df))}function V3(n){return n.replace(/\/index.html$/,"")}var Br=(()=>((Br=Br||{})[Br.Zero=0]="Zero",Br[Br.One=1]="One",Br[Br.Two=2]="Two",Br[Br.Few=3]="Few",Br[Br.Many=4]="Many",Br[Br.Other=5]="Other",Br))();const mee=function(n){return function(n){const e=function(n){return n.toLowerCase().replace(/_/g,"-")}(n);let t=dL(e);if(t)return t;const i=e.split("-")[0];if(t=dL(i),t)return t;if("en"===i)return FY;throw new Error(`Missing locale data for the locale "${n}".`)}(n)[at.PluralCase]};class dE{}let Gee=(()=>{class n extends dE{constructor(t){super(),this.locale=t}getPluralCategory(t,i){switch(mee(i||this.locale)(t)){case Br.Zero:return"zero";case Br.One:return"one";case Br.Two:return"two";case Br.Few:return"few";case Br.Many:return"many";default:return"other"}}}return n.\u0275fac=function(t){return new(t||n)(I(Uu))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();function Y3(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}let hE=(()=>{class n{constructor(t,i,r,s){this._iterableDiffers=t,this._keyValueDiffers=i,this._ngEl=r,this._renderer=s,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&&(Ky(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(i=>this._toggleClass(i.key,i.currentValue)),t.forEachChangedItem(i=>this._toggleClass(i.key,i.currentValue)),t.forEachRemovedItem(i=>{i.previousValue&&this._toggleClass(i.key,!1)})}_applyIterableChanges(t){t.forEachAddedItem(i=>{if("string"!=typeof i.item)throw new Error(`NgClass can only toggle CSS classes expressed as strings, got ${W(i.item)}`);this._toggleClass(i.item,!0)}),t.forEachRemovedItem(i=>this._toggleClass(i.item,!1))}_applyClasses(t){t&&(Array.isArray(t)||t instanceof Set?t.forEach(i=>this._toggleClass(i,!0)):Object.keys(t).forEach(i=>this._toggleClass(i,!!t[i])))}_removeClasses(t){t&&(Array.isArray(t)||t instanceof Set?t.forEach(i=>this._toggleClass(i,!1)):Object.keys(t).forEach(i=>this._toggleClass(i,!1)))}_toggleClass(t,i){(t=t.trim())&&t.split(/\s+/g).forEach(r=>{i?this._renderer.addClass(this._ngEl.nativeElement,r):this._renderer.removeClass(this._ngEl.nativeElement,r)})}}return n.\u0275fac=function(t){return new(t||n)(E(Ng),E(Lg),E(rt),E(zc))},n.\u0275dir=oe({type:n,selectors:[["","ngClass",""]],inputs:{klass:["class","klass"],ngClass:"ngClass"}}),n})();class qee{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 pl=(()=>{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 qee(null,this._ngForOf,-1,-1),null===o?void 0:o),l=new X3(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 X3(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)(E(ns),E(Ys),E(Ng))},n.\u0275dir=oe({type:n,selectors:[["","ngFor","","ngForOf",""]],inputs:{ngForOf:"ngForOf",ngForTrackBy:"ngForTrackBy",ngForTemplate:"ngForTemplate"}}),n})();class X3{constructor(e,t){this.record=e,this.view=t}}let zr=(()=>{class n{constructor(t,i){this._viewContainer=t,this._context=new Xee,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){K3("ngIfThen",t),this._thenTemplateRef=t,this._thenViewRef=null,this._updateView()}set ngIfElse(t){K3("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)(E(ns),E(Ys))},n.\u0275dir=oe({type:n,selectors:[["","ngIf",""]],inputs:{ngIf:"ngIf",ngIfThen:"ngIfThen",ngIfElse:"ngIfElse"}}),n})();class Xee{constructor(){this.$implicit=null,this.ngIf=null}}function K3(n,e){if(e&&!e.createEmbeddedView)throw new Error(`${n} must be a TemplateRef, but received '${W(e)}'.`)}class OD{constructor(e,t){this._viewContainerRef=e,this._templateRef=t,this._created=!1}create(){this._created=!0,this._viewContainerRef.createEmbeddedView(this._templateRef)}destroy(){this._created=!1,this._viewContainerRef.clear()}enforceState(e){e&&!this._created?this.create():!e&&this._created&&this.destroy()}}let Av=(()=>{class n{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 i=t==this._ngSwitch;return this._lastCasesMatched=this._lastCasesMatched||i,this._lastCaseCheckIndex++,this._lastCaseCheckIndex===this._caseCount&&(this._updateDefaultCases(!this._lastCasesMatched),this._lastCaseCheckIndex=0,this._lastCasesMatched=!1),i}_updateDefaultCases(t){if(this._defaultViews&&t!==this._defaultUsed){this._defaultUsed=t;for(let i=0;i{class n{constructor(t,i,r){this.ngSwitch=r,r._addCase(),this._view=new OD(t,i)}ngDoCheck(){this._view.enforceState(this.ngSwitch._matchCase(this.ngSwitchCase))}}return n.\u0275fac=function(t){return new(t||n)(E(ns),E(Ys),E(Av,9))},n.\u0275dir=oe({type:n,selectors:[["","ngSwitchCase",""]],inputs:{ngSwitchCase:"ngSwitchCase"}}),n})(),Z3=(()=>{class n{constructor(t,i,r){r._addDefault(new OD(t,i))}}return n.\u0275fac=function(t){return new(t||n)(E(ns),E(Ys),E(Av,9))},n.\u0275dir=oe({type:n,selectors:[["","ngSwitchDefault",""]]}),n})(),J3=(()=>{class n{constructor(t,i,r){this._ngEl=t,this._differs=i,this._renderer=r,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,i){const[r,s]=t.split(".");null!=(i=null!=i&&s?`${i}${s}`:i)?this._renderer.setStyle(this._ngEl.nativeElement,r,i):this._renderer.removeStyle(this._ngEl.nativeElement,r)}_applyChanges(t){t.forEachRemovedItem(i=>this._setStyle(i.key,null)),t.forEachAddedItem(i=>this._setStyle(i.key,i.currentValue)),t.forEachChangedItem(i=>this._setStyle(i.key,i.currentValue))}}return n.\u0275fac=function(t){return new(t||n)(E(rt),E(Lg),E(zc))},n.\u0275dir=oe({type:n,selectors:[["","ngStyle",""]],inputs:{ngStyle:"ngStyle"}}),n})();function Ql(n,e){return Error(`InvalidPipeArgument: '${e}' for pipe '${W(n)}'`)}class Qee{createSubscription(e,t){return e.subscribe({next:t,error:i=>{throw i}})}dispose(e){e.unsubscribe()}onDestroy(e){e.unsubscribe()}}class Jee{createSubscription(e,t){return e.then(t,i=>{throw i})}dispose(e){}onDestroy(e){}}const ete=new Jee,tte=new Qee;let Hc=(()=>{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(Og(t))return ete;if(EN(t))return tte;throw Ql(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)(E(kn,16))},n.\u0275pipe=ds({name:"async",type:n,pure:!1}),n})();const ate=/#/g;let eV=(()=>{class n{constructor(t){this._localization=t}transform(t,i,r){if(null==t)return"";if("object"!=typeof i||null===i)throw Ql(n,i);return i[function(n,e,t,i){let r=`=${n}`;if(e.indexOf(r)>-1||(r=t.getPluralCategory(n,i),e.indexOf(r)>-1))return r;if(e.indexOf("other")>-1)return"other";throw new Error(`No plural message found for value "${n}"`)}(t,Object.keys(i),this._localization,r)].replace(ate,t.toString())}}return n.\u0275fac=function(t){return new(t||n)(E(dE,16))},n.\u0275pipe=ds({name:"i18nPlural",type:n,pure:!0}),n})(),tV=(()=>{class n{transform(t){return JSON.stringify(t,null,2)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275pipe=ds({name:"json",type:n,pure:!1}),n})(),dn=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({providers:[{provide:dE,useClass:Gee}]}),n})();const rV="browser";function Of(n){return n===rV}function kD(n){return"server"===n}class aV{}class FD extends class extends class{}{constructor(){super(...arguments),this.supportsDOMEvents=!0}}{static makeCurrent(){!function(n){tE||(tE=n)}(new FD)}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=(Dv=Dv||document.querySelector("base"),Dv?Dv.getAttribute("href"):null);return null==t?null:function(n){fE=fE||document.createElement("a"),fE.setAttribute("href",n);const e=fE.pathname;return"/"===e.charAt(0)?e:`/${e}`}(t)}resetBaseElement(){Dv=null}getUserAgent(){return window.navigator.userAgent}getCookie(e){return Y3(document.cookie,e)}}let fE,Dv=null;const lV=new ve("TRANSITION_ID"),Ete=[{provide:Mf,useFactory:function(n,e,t){return()=>{t.get(Gg).donePromise.then(()=>{const i=Uc(),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},cn.getAllAngularTestabilities=()=>e.getAllTestabilities(),cn.getAllAngularRootElements=()=>e.getAllRootElements(),cn.frameworkStabilizers||(cn.frameworkStabilizers=[]),cn.frameworkStabilizers.push(i=>{const r=cn.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?Uc().isShadowRoot(t)?this.findTestabilityInTree(e,t.host,!0):this.findTestabilityInTree(e,t.parentElement,!0):null}}let Ste=(()=>{class n{build(){return new XMLHttpRequest}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();const Ov=new ve("EventManagerPlugins");let gE=(()=>{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=ue({token:n,factory:n.\u0275fac}),n})(),Iv=(()=>{class n extends uV{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(dV),this._hostNodes.delete(t)}onStylesAdded(t){this._hostNodes.forEach((i,r)=>{this._addStylesToHost(t,r,i)})}ngOnDestroy(){this._hostNodes.forEach(t=>t.forEach(dV))}}return n.\u0275fac=function(t){return new(t||n)(I(ut))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();function dV(n){Uc().remove(n)}const BD={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/"},VD=/%COMP%/g;function mE(n,e,t){for(let i=0;i{if("__ngUnwrap__"===e)return n;!1===n(e)&&(e.preventDefault(),e.returnValue=!1)}}let _E=(()=>{class n{constructor(t,i,r){this.eventManager=t,this.sharedStylesHost=i,this.appId=r,this.rendererByCompId=new Map,this.defaultRenderer=new zD(t)}createRenderer(t,i){if(!t||!i)return this.defaultRenderer;switch(i.encapsulation){case Ue.Emulated:{let r=this.rendererByCompId.get(i.id);return r||(r=new Vte(this.eventManager,this.sharedStylesHost,i,this.appId),this.rendererByCompId.set(i.id,r)),r.applyToHost(t),r}case 1:case Ue.ShadowDom:return new zte(this.eventManager,this.sharedStylesHost,t,i);default:if(!this.rendererByCompId.has(i.id)){const r=mE(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)(I(gE),I(Iv),I(vv))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();class zD{constructor(e){this.eventManager=e,this.data=Object.create(null)}destroy(){}createElement(e,t){return t?document.createElementNS(BD[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=BD[r];s?e.setAttributeNS(s,t,i):e.setAttribute(t,i)}else e.setAttribute(t,i)}removeAttribute(e,t,i){if(i){const r=BD[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&(Co.DashCase|Co.Important)?e.style.setProperty(t,i,r&Co.Important?"important":""):e.style[t]=i}removeStyle(e,t,i){i&Co.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,pV(i)):this.eventManager.addEventListener(e,t,pV(i))}}class Vte extends zD{constructor(e,t,i,r){super(e),this.component=i;const s=mE(r+"-"+i.id,i.styles,[]);t.addStyles(s),this.contentAttr=function(n){return"_ngcontent-%COMP%".replace(VD,n)}(r+"-"+i.id),this.hostAttr=function(n){return"_nghost-%COMP%".replace(VD,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 zte extends zD{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=mE(r.id,r.styles,[]);for(let o=0;o{class n extends LD{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)(I(ut))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();const _V=["alt","control","meta","shift"],Yte={"\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"},yV={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"},Xte={alt:n=>n.altKey,control:n=>n.ctrlKey,meta:n=>n.metaKey,shift:n=>n.shiftKey};let Kte=(()=>{class n extends LD{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(()=>Uc().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(_V.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&&yV.hasOwnProperty(e)&&(e=yV[e]))}return Yte[e]||e}(t);return r=r.toLowerCase()," "===r?r="space":"."===r&&(r="dot"),_V.forEach(s=>{s!=r&&Xte[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)(I(ut))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})(),th=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ue({factory:function(){return I(UD)},token:n,providedIn:"root"}),n})(),UD=(()=>{class n extends th{constructor(t){super(),this._doc=t}sanitize(t,i){if(null==i)return null;switch(t){case mn.NONE:return i;case mn.HTML:return jo(i,"HTML")?gs(i):ey(this._doc,String(i)).toString();case mn.STYLE:return jo(i,"Style")?gs(i):i;case mn.SCRIPT:if(jo(i,"Script"))return gs(i);throw new Error("unsafe value used in a script context");case mn.URL:return Pc(i),jo(i,"URL")?gs(i):bo(String(i));case mn.RESOURCE_URL:if(jo(i,"ResourceURL"))return gs(i);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(n){return new W_(n)}(t)}bypassSecurityTrustStyle(t){return function(n){return new q_(n)}(t)}bypassSecurityTrustScript(t){return function(n){return new Jp(n)}(t)}bypassSecurityTrustUrl(t){return function(n){return new zd(n)}(t)}bypassSecurityTrustResourceUrl(t){return function(n){return new Ut(n)}(t)}}return n.\u0275fac=function(t){return new(t||n)(I(ut))},n.\u0275prov=ue({factory:function(){return function(n){return new UD(n.get(ut))}(I(Fc))},token:n,providedIn:"root"}),n})();const rne=s3(ZQ,"browser",[{provide:dl,useValue:rV},{provide:XB,useValue:function(){FD.makeCurrent(),ND.init()},multi:!0},{provide:ut,useFactory:function(){return function(n){fi=n}(document),document},deps:[]}]),sne=[[],{provide:Vu,useValue:"root"},{provide:$o,useFactory:function(){return new $o},deps:[]},{provide:Ov,useClass:jte,multi:!0,deps:[ut,dt,dl]},{provide:Ov,useClass:Kte,multi:!0,deps:[ut]},[],{provide:_E,useClass:_E,deps:[gE,Iv,vv]},{provide:Cf,useExisting:_E},{provide:uV,useExisting:Iv},{provide:Iv,useClass:Iv,deps:[ut]},{provide:tD,useClass:tD,deps:[dt]},{provide:gE,useClass:gE,deps:[Ov,dt]},{provide:aV,useClass:Ste,deps:[]},[]];let yE=(()=>{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:vv,useValue:t.appId},{provide:lV,useExisting:vv},Ete]}}}return n.\u0275fac=function(t){return new(t||n)(I(n,12))},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({providers:sne,imports:[dn,rJ]}),n})();"undefined"!=typeof window&&window;class fne extends Te{constructor(e,t){super()}schedule(e,t=0){return this}}class vE extends fne{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 bV=(()=>{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 bV{constructor(e,t=bV.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 mne=new class extends Jl{}(class extends vE{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)}}),ec=new ce(n=>n.complete());function bE(n){return n?function(n){return new ce(e=>n.schedule(()=>e.complete()))}(n):ec}function ht(...n){let e=n[n.length-1];return Gn(e)?(n.pop(),Fi(n,e)):za(n)}function Kg(n,e){return new ce(e?t=>e.schedule(yne,0,{error:n,subscriber:t}):t=>t.error(n))}function yne({error:n,subscriber:e}){e.error(n)}class Ko{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 ht(this.value);case"E":return Kg(this.error);case"C":return bE()}throw new Error("unexpected notification kind value")}static createNext(e){return void 0!==e?new Ko("N",e):Ko.undefinedValueNotification}static createError(e){return new Ko("E",void 0,e)}static createComplete(){return Ko.completeNotification}}Ko.completeNotification=new Ko("C"),Ko.undefinedValueNotification=new Ko("N",void 0);class CE extends xt{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(CE.dispatch,this.delay,new bne(e,this.destination)))}_next(e){this.scheduleMessage(Ko.createNext(e))}_error(e){this.scheduleMessage(Ko.createError(e)),this.unsubscribe()}_complete(){this.scheduleMessage(Ko.createComplete()),this.unsubscribe()}}class bne{constructor(e,t){this.notification=e,this.destination=t}}class If extends Se{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 Cne(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 Qt;if(this.isStopped||this.hasError?o=Te.EMPTY:(this.observers.push(e),o=new li(this,e)),r&&e.add(e=new CE(e,r)),t)for(let a=0;at&&(o=Math.max(o,s-t)),o>0&&r.splice(0,o),r}}class Cne{constructor(e,t){this.time=e,this.value=t}}function Pr(n,e){return"function"==typeof e?t=>t.pipe(Pr((i,r)=>ui(n(i,r)).pipe(Ae((s,o)=>e(i,s,r,o))))):t=>t.lift(new wne(n))}class wne{constructor(e){this.project=e}call(e,t){return t.subscribe(new Ene(e,this.project))}}class Ene extends ii{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 Gr(this),r=this.destination;r.add(i),this.innerSubscription=co(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 wE={schedule(n,e){const t=setTimeout(n,e);return()=>clearTimeout(t)},scheduleBeforeRender(n){if("undefined"==typeof window)return wE.schedule(n,0);if(void 0===window.requestAnimationFrame)return wE.schedule(n,16);const e=window.requestAnimationFrame(n);return()=>window.cancelAnimationFrame(e)}};let $D;function Rne(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(!$D){const t=Element.prototype;$D=t.matches||t.matchesSelector||t.mozMatchesSelector||t.msMatchesSelector||t.oMatchesSelector||t.webkitMatchesSelector}return n.nodeType===Node.ELEMENT_NODE&&$D.call(n,e)}(n,r)||(i=s,0))),i}class Fne{constructor(e,t){this.componentFactory=t.get(ll).resolveComponentFactory(e)}create(e){return new Nne(this.componentFactory,e)}}class Nne{constructor(e,t){this.componentFactory=e,this.injector=t,this.eventEmitters=new If(1),this.events=this.eventEmitters.pipe(Pr(i=>Ni(...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(dt),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=wE.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=Nt.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(Ae(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=wE.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 y_(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 Lne extends HTMLElement{constructor(){super(...arguments),this.ngElementEventsSubscription=null}}function Mt(n){return null!=n&&"false"!=`${n}`}function To(n,e=0){return function(n){return!isNaN(parseFloat(n))&&!isNaN(Number(n))}(n)?Number(n):e}function EE(n){return Array.isArray(n)?n:[n]}function jr(n){return null==n?"":"string"==typeof n?n:`${n}px`}function Wu(n){return n instanceof rt?n.nativeElement:n}const Pf=new Jl(vE);function Zg(n,e=Pf){return t=>t.lift(new jne(n,e))}class jne{constructor(e,t){this.dueTime=e,this.scheduler=t}call(e,t){return t.subscribe(new Une(e,this.dueTime,this.scheduler))}}class Une extends xt{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(Hne,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 Hne(n){n.debouncedNext()}let GD=(()=>{class n{create(t){return"undefined"==typeof MutationObserver?null:new MutationObserver(t)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ue({factory:function(){return new n},token:n,providedIn:"root"}),n})(),CV=(()=>{class n{constructor(t){this._mutationObserverFactory=t,this._observedElements=new Map}ngOnDestroy(){this._observedElements.forEach((t,i)=>this._cleanupObserver(i))}observe(t){const i=Wu(t);return new ce(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 Se,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)(I(GD))},n.\u0275prov=ue({factory:function(){return new n(I(GD))},token:n,providedIn:"root"}),n})(),WD=(()=>{class n{constructor(t,i,r){this._contentObserver=t,this._elementRef=i,this._ngZone=r,this.event=new Le,this._disabled=!1,this._currentSubscription=null}get disabled(){return this._disabled}set disabled(t){this._disabled=Mt(t),this._disabled?this._unsubscribe():this._subscribe()}get debounce(){return this._debounce}set debounce(t){this._debounce=To(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(Zg(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)(E(CV),E(rt),E(dt))},n.\u0275dir=oe({type:n,selectors:[["","cdkObserveContent",""]],inputs:{disabled:["cdkObserveContentDisabled","disabled"],debounce:"debounce"},outputs:{event:"cdkObserveContent"},exportAs:["cdkObserveContent"]}),n})(),SE=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({providers:[GD]}),n})();class ar extends Se{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 Qt;return this._value}next(e){super.next(this._value=e)}}function Zs(n,...e){return e.length?e.some(t=>n[t]):n.altKey||n.shiftKey||n.ctrlKey||n.metaKey}function ih(){}function Ti(n,e,t){return function(r){return r.lift(new tie(n,e,t))}}class tie{constructor(e,t,i){this.nextOrObserver=e,this.error=t,this.complete=i}call(e,t){return t.subscribe(new nie(e,this.nextOrObserver,this.error,this.complete))}}class nie extends xt{constructor(e,t,i,r){super(e),this._tapNext=ih,this._tapError=ih,this._tapComplete=ih,this._tapError=i||ih,this._tapComplete=r||ih,Ke(t)?(this._context=this,this._tapNext=t):t&&(this._context=t,this._tapNext=t.next||ih,this._tapError=t.error||ih,this._tapComplete=t.complete||ih)}_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 Fn(n,e){return function(i){return i.lift(new iie(n,e))}}class iie{constructor(e,t){this.predicate=e,this.thisArg=t}call(e,t){return t.subscribe(new rie(e,this.predicate,this.thisArg))}}class rie extends xt{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)}}const SV=(()=>{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?bE():e.lift(new sie(n))}class sie{constructor(e){if(this.total=e,this.total<0)throw new SV}call(e,t){return t.subscribe(new oie(e,this.total))}}class oie extends xt{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 QD(n){return e=>e.lift(new aie(n))}class aie{constructor(e){this.total=e}call(e,t){return t.subscribe(new lie(e,this.total))}}class lie extends xt{constructor(e,t){super(e),this.total=t,this.count=0}_next(e){++this.count>this.total&&this.destination.next(e)}}function Zo(n,e){return t=>t.lift(new cie(n,e))}class cie{constructor(e,t){this.compare=e,this.keySelector=t}call(e,t){return t.subscribe(new uie(e,this.compare,this.keySelector))}}class uie extends xt{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))}}function Tn(n){return e=>e.lift(new die(n))}class die{constructor(e){this.notifier=e}call(e,t){const i=new hie(e),r=co(this.notifier,new Gr(i));return r&&!i.seenValue?(i.add(r),t.subscribe(i)):i}}class hie extends ii{constructor(e){super(e),this.seenValue=!1}notifyNext(){this.seenValue=!0,this.complete()}notifyComplete(){}}let JD;try{JD="undefined"!=typeof Intl&&Intl.v8BreakIterator}catch(n){JD=!1}let em,si=(()=>{class n{constructor(t){this._platformId=t,this.isBrowser=this._platformId?Of(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&&!JD)&&"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)(I(dl))},n.\u0275prov=ue({factory:function(){return new n(I(dl))},token:n,providedIn:"root"}),n})(),Rv=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({}),n})();const MV=["color","button","checkbox","date","datetime-local","email","file","hidden","image","month","number","password","radio","range","reset","search","submit","tel","text","time","url","week"];function xV(){if(em)return em;if("object"!=typeof document||!document)return em=new Set(MV),em;let n=document.createElement("input");return em=new Set(MV.filter(e=>(n.setAttribute("type",e),n.type===e))),em}let kv,Ff,eO;function tm(n){return function(){if(null==kv&&"undefined"!=typeof window)try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:()=>kv=!0}))}finally{kv=kv||!1}return kv}()?n:!!n.capture}function TV(){if(null==Ff){if("object"!=typeof document||!document||"function"!=typeof Element||!Element)return Ff=!1,Ff;if("scrollBehavior"in document.documentElement.style)Ff=!0;else{const n=Element.prototype.scrollTo;Ff=!!n&&!/\{\s*\[native code\]\s*\}/.test(n.toString())}}return Ff}function xE(){let n="undefined"!=typeof document&&document?document.activeElement:null;for(;n&&n.shadowRoot;){const e=n.shadowRoot.activeElement;if(e===n)break;n=e}return n}function Nf(n){return n.composedPath?n.composedPath()[0]:n.target}function TE(n,e){return(n.getAttribute(e)||"").match(/\S+/g)||[]}const DV="cdk-describedby-message-container",OV="cdk-describedby-message",AE="cdk-describedby-host";let yie=0;const $c=new Map;let Rs=null,IV=(()=>{class n{constructor(t){this._document=t}describe(t,i,r){if(!this._canBeDescribed(t,i))return;const s=tO(i,r);"string"!=typeof i?(PV(i),$c.set(s,{messageElement:i,referenceCount:0})):$c.has(s)||this._createMessageElement(i,r),this._isElementDescribedByMessage(t,s)||this._addMessageReference(t,s)}removeDescription(t,i,r){if(!i||!this._isElementNode(t))return;const s=tO(i,r);if(this._isElementDescribedByMessage(t,s)&&this._removeMessageReference(t,s),"string"==typeof i){const o=$c.get(s);o&&0===o.referenceCount&&this._deleteMessageElement(s)}Rs&&0===Rs.childNodes.length&&this._deleteMessagesContainer()}ngOnDestroy(){const t=this._document.querySelectorAll(`[${AE}]`);for(let i=0;i0!=r.indexOf(OV));t.setAttribute("aria-describedby",i.join(" "))}_addMessageReference(t,i){const r=$c.get(i);(function(n,e,t){const i=TE(n,e);i.some(r=>r.trim()==t.trim())||(i.push(t.trim()),n.setAttribute(e,i.join(" ")))})(t,"aria-describedby",r.messageElement.id),t.setAttribute(AE,""),r.referenceCount++}_removeMessageReference(t,i){const r=$c.get(i);r.referenceCount--,function(n,e,t){const r=TE(n,e).filter(s=>s!=t.trim());r.length?n.setAttribute(e,r.join(" ")):n.removeAttribute(e)}(t,"aria-describedby",r.messageElement.id),t.removeAttribute(AE)}_isElementDescribedByMessage(t,i){const r=TE(t,"aria-describedby"),s=$c.get(i),o=s&&s.messageElement.id;return!!o&&-1!=r.indexOf(o)}_canBeDescribed(t,i){if(!this._isElementNode(t))return!1;if(i&&"object"==typeof i)return!0;const r=null==i?"":`${i}`.trim(),s=t.getAttribute("aria-label");return!(!r||s&&s.trim()===r)}_isElementNode(t){return t.nodeType===this._document.ELEMENT_NODE}}return n.\u0275fac=function(t){return new(t||n)(I(ut))},n.\u0275prov=ue({factory:function(){return new n(I(ut))},token:n,providedIn:"root"}),n})();function tO(n,e){return"string"==typeof n?`${e||""}/${n}`:n}function PV(n){n.id||(n.id=`${OV}-${yie++}`)}class RV{constructor(e){this._items=e,this._activeItemIndex=-1,this._activeItem=null,this._wrap=!1,this._letterKeyStream=new Se,this._typeaheadSubscription=Te.EMPTY,this._vertical=!0,this._allowedModifierKeys=[],this._homeAndEnd=!1,this._skipPredicateFn=t=>t.disabled,this._pressedLetters=[],this.tabOut=new Se,this.change=new Se,e instanceof Sf&&e.changes.subscribe(t=>{if(this._activeItem){const r=t.toArray().indexOf(this._activeItem);r>-1&&r!==this._activeItemIndex&&(this._activeItemIndex=r)}})}skipPredicate(e){return this._skipPredicateFn=e,this}withWrap(e=!0){return this._wrap=e,this}withVerticalOrientation(e=!0){return this._vertical=e,this}withHorizontalOrientation(e){return this._horizontal=e,this}withAllowedModifierKeys(e){return this._allowedModifierKeys=e,this}withTypeAhead(e=200){return this._typeaheadSubscription.unsubscribe(),this._typeaheadSubscription=this._letterKeyStream.pipe(Ti(t=>this._pressedLetters.push(t)),Zg(e),Fn(()=>this._pressedLetters.length>0),Ae(()=>this._pressedLetters.join(""))).subscribe(t=>{const i=this._getItemsArray();for(let r=1;r!e[s]||this._allowedModifierKeys.indexOf(s)>-1);switch(t){case 9:return void this.tabOut.next();case 40:if(this._vertical&&r){this.setNextItemActive();break}return;case 38:if(this._vertical&&r){this.setPreviousItemActive();break}return;case 39:if(this._horizontal&&r){"rtl"===this._horizontal?this.setPreviousItemActive():this.setNextItemActive();break}return;case 37:if(this._horizontal&&r){"rtl"===this._horizontal?this.setNextItemActive():this.setPreviousItemActive();break}return;case 36:if(this._homeAndEnd&&r){this.setFirstItemActive();break}return;case 35:if(this._homeAndEnd&&r){this.setLastItemActive();break}return;default:return void((r||Zs(e,"shiftKey"))&&(e.key&&1===e.key.length?this._letterKeyStream.next(e.key.toLocaleUpperCase()):(t>=65&&t<=90||t>=48&&t<=57)&&this._letterKeyStream.next(String.fromCharCode(t))))}this._pressedLetters=[],e.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(e){const t=this._getItemsArray(),i="number"==typeof e?e:t.indexOf(e),r=t[i];this._activeItem=null==r?null:r,this._activeItemIndex=i}_setActiveItemByDelta(e){this._wrap?this._setActiveInWrapMode(e):this._setActiveInDefaultMode(e)}_setActiveInWrapMode(e){const t=this._getItemsArray();for(let i=1;i<=t.length;i++){const r=(this._activeItemIndex+e*i+t.length)%t.length;if(!this._skipPredicateFn(t[r]))return void this.setActiveItem(r)}}_setActiveInDefaultMode(e){this._setActiveItemByIndex(this._activeItemIndex+e,e)}_setActiveItemByIndex(e,t){const i=this._getItemsArray();if(i[e]){for(;this._skipPredicateFn(i[e]);)if(!i[e+=t])return;this.setActiveItem(e)}}_getItemsArray(){return this._items instanceof Sf?this._items.toArray():this._items}}class kV extends RV{setActiveItem(e){this.activeItem&&this.activeItem.setInactiveStyles(),super.setActiveItem(e),this.activeItem&&this.activeItem.setActiveStyles()}}class nO extends RV{constructor(){super(...arguments),this._origin="program"}setFocusOrigin(e){return this._origin=e,this}setActiveItem(e){super.setActiveItem(e),this.activeItem&&this.activeItem.focus(this._origin)}}let FV=(()=>{class n{constructor(t){this._platform=t}isDisabled(t){return t.hasAttribute("disabled")}isVisible(t){return function(n){return!!(n.offsetWidth||n.offsetHeight||"function"==typeof n.getClientRects&&n.getClientRects().length)}(t)&&"visible"===getComputedStyle(t).visibility}isTabbable(t){if(!this._platform.isBrowser)return!1;const i=function(n){try{return n.frameElement}catch(e){return null}}(function(n){return n.ownerDocument&&n.ownerDocument.defaultView||window}(t));if(i&&(-1===LV(i)||!this.isVisible(i)))return!1;let r=t.nodeName.toLowerCase(),s=LV(t);return t.hasAttribute("contenteditable")?-1!==s:!("iframe"===r||"object"===r||this._platform.WEBKIT&&this._platform.IOS&&!function(n){let e=n.nodeName.toLowerCase(),t="input"===e&&n.type;return"text"===t||"password"===t||"select"===e||"textarea"===e}(t))&&("audio"===r?!!t.hasAttribute("controls")&&-1!==s:"video"===r?-1!==s&&(null!==s||this._platform.FIREFOX||t.hasAttribute("controls")):t.tabIndex>=0)}isFocusable(t,i){return function(n){return!function(n){return function(n){return"input"==n.nodeName.toLowerCase()}(n)&&"hidden"==n.type}(n)&&(function(n){let e=n.nodeName.toLowerCase();return"input"===e||"select"===e||"button"===e||"textarea"===e}(n)||function(n){return function(n){return"a"==n.nodeName.toLowerCase()}(n)&&n.hasAttribute("href")}(n)||n.hasAttribute("contenteditable")||NV(n))}(t)&&!this.isDisabled(t)&&((null==i?void 0:i.ignoreVisibility)||this.isVisible(t))}}return n.\u0275fac=function(t){return new(t||n)(I(si))},n.\u0275prov=ue({factory:function(){return new n(I(si))},token:n,providedIn:"root"}),n})();function NV(n){if(!n.hasAttribute("tabindex")||void 0===n.tabIndex)return!1;let e=n.getAttribute("tabindex");return"-32768"!=e&&!(!e||isNaN(parseInt(e,10)))}function LV(n){if(!NV(n))return null;const e=parseInt(n.getAttribute("tabindex")||"",10);return isNaN(e)?-1:e}class Die{constructor(e,t,i,r,s=!1){this._element=e,this._checker=t,this._ngZone=i,this._document=r,this._hasAttached=!1,this.startAnchorListener=()=>this.focusLastTabbableElement(),this.endAnchorListener=()=>this.focusFirstTabbableElement(),this._enabled=!0,s||this.attachAnchors()}get enabled(){return this._enabled}set enabled(e){this._enabled=e,this._startAnchor&&this._endAnchor&&(this._toggleAnchorTabIndex(e,this._startAnchor),this._toggleAnchorTabIndex(e,this._endAnchor))}destroy(){const 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}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(e){return new Promise(t=>{this._executeOnStable(()=>t(this.focusInitialElement(e)))})}focusFirstTabbableElementWhenReady(e){return new Promise(t=>{this._executeOnStable(()=>t(this.focusFirstTabbableElement(e)))})}focusLastTabbableElementWhenReady(e){return new Promise(t=>{this._executeOnStable(()=>t(this.focusLastTabbableElement(e)))})}_getRegionBoundary(e){let t=this._element.querySelectorAll(`[cdk-focus-region-${e}], [cdkFocusRegion${e}], [cdk-focus-${e}]`);for(let i=0;i=0;i--){let r=t[i].nodeType===this._document.ELEMENT_NODE?this._getLastTabbableElement(t[i]):null;if(r)return r}return null}_createAnchor(){const 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}_toggleAnchorTabIndex(e,t){e?t.setAttribute("tabindex","0"):t.removeAttribute("tabindex")}toggleAnchors(e){this._startAnchor&&this._endAnchor&&(this._toggleAnchorTabIndex(e,this._startAnchor),this._toggleAnchorTabIndex(e,this._endAnchor))}_executeOnStable(e){this._ngZone.isStable?e():this._ngZone.onStable.pipe(yi(1)).subscribe(e)}}let BV=(()=>{class n{constructor(t,i,r){this._checker=t,this._ngZone=i,this._document=r}create(t,i=!1){return new Die(t,this._checker,this._ngZone,this._document,i)}}return n.\u0275fac=function(t){return new(t||n)(I(FV),I(dt),I(ut))},n.\u0275prov=ue({factory:function(){return new n(I(FV),I(dt),I(ut))},token:n,providedIn:"root"}),n})();function VV(n){return 0===n.offsetX&&0===n.offsetY}function zV(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 jV=new ve("cdk-input-modality-detector-options"),kie={ignoreKeys:[18,17,224,91,16]},nm=tm({passive:!0,capture:!0});let HV=(()=>{class n{constructor(t,i,r,s){this._platform=t,this._mostRecentTarget=null,this._modality=new ar(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=Nf(o))},this._onMousedown=o=>{Date.now()-this._lastTouchMs<650||(this._modality.next(VV(o)?"keyboard":"mouse"),this._mostRecentTarget=Nf(o))},this._onTouchstart=o=>{zV(o)?this._modality.next("keyboard"):(this._lastTouchMs=Date.now(),this._modality.next("touch"),this._mostRecentTarget=Nf(o))},this._options=Object.assign(Object.assign({},kie),s),this.modalityDetected=this._modality.pipe(QD(1)),this.modalityChanged=this.modalityDetected.pipe(Zo()),t.isBrowser&&i.runOutsideAngular(()=>{r.addEventListener("keydown",this._onKeydown,nm),r.addEventListener("mousedown",this._onMousedown,nm),r.addEventListener("touchstart",this._onTouchstart,nm)})}get mostRecentModality(){return this._modality.value}ngOnDestroy(){!this._platform.isBrowser||(document.removeEventListener("keydown",this._onKeydown,nm),document.removeEventListener("mousedown",this._onMousedown,nm),document.removeEventListener("touchstart",this._onTouchstart,nm))}}return n.\u0275fac=function(t){return new(t||n)(I(si),I(dt),I(ut),I(jV,8))},n.\u0275prov=ue({factory:function(){return new n(I(si),I(dt),I(ut),I(jV,8))},token:n,providedIn:"root"}),n})();const $V=new ve("liveAnnouncerElement",{providedIn:"root",factory:function(){return null}}),GV=new ve("LIVE_ANNOUNCER_DEFAULT_OPTIONS");let DE=(()=>{class n{constructor(t,i,r,s){this._ngZone=i,this._defaultOptions=s,this._document=r,this._liveElement=t||this._createLiveElement()}announce(t,...i){const r=this._defaultOptions;let s,o;return 1===i.length&&"number"==typeof i[0]?o=i[0]:[s,o]=i,this.clear(),clearTimeout(this._previousTimeout),s||(s=r&&r.politeness?r.politeness:"polite"),null==o&&r&&(o=r.duration),this._liveElement.setAttribute("aria-live",s),this._ngZone.runOutsideAngular(()=>new Promise(a=>{clearTimeout(this._previousTimeout),this._previousTimeout=setTimeout(()=>{this._liveElement.textContent=t,a(),"number"==typeof o&&(this._previousTimeout=setTimeout(()=>this.clear(),o))},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",i=this._document.getElementsByClassName(t),r=this._document.createElement("div");for(let s=0;s{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 Se,this._rootNodeFocusAndBlurListener=a=>{const l=Nf(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=Wu(t);if(!this._platform.isBrowser||1!==r.nodeType)return ht(null);const s=function(n){if(function(){if(null==eO){const n="undefined"!=typeof document?document.head:null;eO=!(!n||!n.createShadowRoot&&!n.attachShadow)}return eO}()){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 Se,rootNode:s};return this._elementInfo.set(r,a),this._registerGlobalListeners(a),a.subject}stopMonitoring(t){const i=Wu(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=Wu(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=Nf(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,OE),i.addEventListener("blur",this._rootNodeFocusAndBlurListener,OE)}),this._rootNodeFocusListenerCount.set(i,r+1),1==++this._monitoredElementCount&&(this._ngZone.runOutsideAngular(()=>{this._getWindow().addEventListener("focus",this._windowFocusListener)}),this._inputModalityDetector.modalityDetected.pipe(Tn(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,OE),i.removeEventListener("blur",this._rootNodeFocusAndBlurListener,OE),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)(I(dt),I(si),I(HV),I(ut,8),I(WV,8))},n.\u0275prov=ue({factory:function(){return new n(I(dt),I(si),I(HV),I(ut,8),I(WV,8))},token:n,providedIn:"root"}),n})();const qV="cdk-high-contrast-black-on-white",YV="cdk-high-contrast-white-on-black",iO="cdk-high-contrast-active";let XV=(()=>{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(iO),t.remove(qV),t.remove(YV),this._hasCheckedHighContrastMode=!0;const i=this.getHighContrastMode();1===i?(t.add(iO),t.add(qV)):2===i&&(t.add(iO),t.add(YV))}}}return n.\u0275fac=function(t){return new(t||n)(I(si),I(ut))},n.\u0275prov=ue({factory:function(){return new n(I(si),I(ut))},token:n,providedIn:"root"}),n})(),Nie=(()=>{class n{constructor(t){t._applyBodyHighContrastModeCssClasses()}}return n.\u0275fac=function(t){return new(t||n)(I(XV))},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[Rv,SE]]}),n})();const KV=new ve("cdk-dir-doc",{providedIn:"root",factory:function(){return Oc(ut)}});let Qo=(()=>{class n{constructor(t){if(this.value="ltr",this.change=new Le,t){const r=t.documentElement?t.documentElement.dir:null,s=(t.body?t.body.dir:null)||r;this.value="ltr"===s||"rtl"===s?s:"ltr"}}ngOnDestroy(){this.change.complete()}}return n.\u0275fac=function(t){return new(t||n)(I(KV,8))},n.\u0275prov=ue({factory:function(){return new n(I(KV,8))},token:n,providedIn:"root"}),n})(),Nv=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({}),n})();const ZV=new ju("12.2.5");function IE(...n){return uo(1)(ht(...n))}function Rr(...n){const e=n[n.length-1];return Gn(e)?(n.pop(),t=>IE(n,t,e)):t=>IE(n,t)}class QV{}const qu="*";function tc(n,e){return{type:7,name:n,definitions:e,options:{}}}function Ao(n,e=null){return{type:4,styles:e,timings:n}}function JV(n,e=null){return{type:2,steps:n,options:e}}function ti(n){return{type:6,styles:n,offset:null}}function wr(n,e,t){return{type:0,name:n,styles:e,options:t}}function zie(n){return{type:5,steps:n}}function Qs(n,e,t=null){return{type:1,expr:n,animation:e,options:t}}function jie(n=null){return{type:9,options:n}}function Uie(n,e,t=null){return{type:11,selector:n,animation:e,options:t}}function ez(n){Promise.resolve(null).then(n)}class im{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(){ez(()=>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}}class tz{constructor(e){this._onDoneFns=[],this._onStartFns=[],this._finished=!1,this._started=!1,this._destroyed=!1,this._onDestroyFns=[],this.parentPlayer=null,this.totalTime=0,this.players=e;let t=0,i=0,r=0;const s=this.players.length;0==s?ez(()=>this._onFinish()):this.players.forEach(o=>{o.onDone(()=>{++t==s&&this._onFinish()}),o.onDestroy(()=>{++i==s&&this._onDestroy()}),o.onStart(()=>{++r==s&&this._onStart()})}),this.totalTime=this.players.reduce((o,a)=>Math.max(o,a.totalTime),0)}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(e=>e()),this._onDoneFns=[])}init(){this.players.forEach(e=>e.init())}onStart(e){this._onStartFns.push(e)}_onStart(){this.hasStarted()||(this._started=!0,this._onStartFns.forEach(e=>e()),this._onStartFns=[])}onDone(e){this._onDoneFns.push(e)}onDestroy(e){this._onDestroyFns.push(e)}hasStarted(){return this._started}play(){this.parentPlayer||this.init(),this._onStart(),this.players.forEach(e=>e.play())}pause(){this.players.forEach(e=>e.pause())}restart(){this.players.forEach(e=>e.restart())}finish(){this._onFinish(),this.players.forEach(e=>e.finish())}destroy(){this._onDestroy()}_onDestroy(){this._destroyed||(this._destroyed=!0,this._onFinish(),this.players.forEach(e=>e.destroy()),this._onDestroyFns.forEach(e=>e()),this._onDestroyFns=[])}reset(){this.players.forEach(e=>e.reset()),this._destroyed=!1,this._finished=!1,this._started=!1}setPosition(e){const t=e*this.totalTime;this.players.forEach(i=>{const r=i.totalTime?Math.min(1,t/i.totalTime):1;i.setPosition(r)})}getPosition(){const e=this.players.reduce((t,i)=>null===t||i.totalTime>t.totalTime?i:t,null);return null!=e?e.getPosition():0}beforeDestroy(){this.players.forEach(e=>{e.beforeDestroy&&e.beforeDestroy()})}triggerCallback(e){const t="start"==e?this._onStartFns:this._onDoneFns;t.forEach(i=>i()),t.length=0}}function nz(){return"undefined"!=typeof window&&void 0!==window.document}function sO(){return"undefined"!=typeof process&&"[object process]"==={}.toString.call(process)}function rh(n){switch(n.length){case 0:return new im;case 1:return n[0];default:return new tz(n)}}function iz(n,e,t,i,r={},s={}){const o=[],a=[];let l=-1,c=null;if(i.forEach(d=>{const f=d.offset,p=f==l,g=p&&c||{};Object.keys(d).forEach(_=>{let y=_,v=d[_];if("offset"!==_)switch(y=e.normalizePropertyName(y,o),v){case"!":v=r[_];break;case qu:v=s[_];break;default:v=e.normalizeStyleValue(_,y,v,o)}g[y]=v}),p||a.push(g),c=g,l=f}),o.length){const d="\n - ";throw new Error(`Unable to animate due to the following errors:${d}${o.join(d)}`)}return a}function oO(n,e,t,i){switch(e){case"start":n.onStart(()=>i(t&&aO(t,"start",n)));break;case"done":n.onDone(()=>i(t&&aO(t,"done",n)));break;case"destroy":n.onDestroy(()=>i(t&&aO(t,"destroy",n)))}}function aO(n,e,t){const i=t.totalTime,s=lO(n.element,n.triggerName,n.fromState,n.toState,e||n.phaseName,null==i?n.totalTime:i,!!t.disabled),o=n._data;return null!=o&&(s._data=o),s}function lO(n,e,t,i,r="",s=0,o){return{element:n,triggerName:e,fromState:t,toState:i,phaseName:r,totalTime:s,disabled:!!o}}function Ma(n,e,t){let i;return n instanceof Map?(i=n.get(e),i||n.set(e,i=t)):(i=n[e],i||(i=n[e]=t)),i}function rz(n){const e=n.indexOf(":");return[n.substring(1,e),n.substr(e+1)]}let cO=(n,e)=>!1,uO=(n,e)=>!1,sz=(n,e,t)=>[];const oz=sO();(oz||"undefined"!=typeof Element)&&(cO=nz()?(n,e)=>{for(;e&&e!==document.documentElement;){if(e===n)return!0;e=e.parentNode||e.host}return!1}:(n,e)=>n.contains(e),uO=(()=>{if(oz||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]):uO}})(),sz=(n,e,t)=>{let i=[];if(t){const r=n.querySelectorAll(e);for(let s=0;s{const i=t.replace(/([a-z])([A-Z])/g,"$1-$2");e[i]=n[t]}),e}let cz=(()=>{class n{validateStyleProperty(t){return dO(t)}matchesElement(t,i){return hO(t,i)}containsElement(t,i){return fO(t,i)}query(t,i,r){return pO(t,i,r)}computeStyle(t,i,r){return r||""}animate(t,i,r,s,o,a=[],l){return new im(r,s)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();class PE{}PE.NOOP=new cz;const gO="ng-enter",RE="ng-leave",kE="ng-trigger",FE=".ng-trigger",dz="ng-animating",mO=".ng-animating";function Bf(n){if("number"==typeof n)return n;const e=n.match(/^(-?[\.\d]+)(m?s)/);return!e||e.length<2?0:_O(parseFloat(e[1]),e[2])}function _O(n,e){switch(e){case"s":return 1e3*n;default:return n}}function NE(n,e,t){return n.hasOwnProperty("duration")?n:function(n,e,t){let r,s=0,o="";if("string"==typeof n){const a=n.match(/^(-?[\.\d]+)(m?s)(?:\s+(-?[\.\d]+)(m?s))?(?:\s+([-a-z]+(?:\(.+?\))?))?$/i);if(null===a)return e.push(`The provided timing value "${n}" is invalid.`),{duration:0,delay:0,easing:""};r=_O(parseFloat(a[1]),a[2]);const l=a[3];null!=l&&(s=_O(parseFloat(l),a[4]));const c=a[5];c&&(o=c)}else r=n;if(!t){let a=!1,l=e.length;r<0&&(e.push("Duration values below 0 are not allowed for this animation step."),a=!0),s<0&&(e.push("Delay values below 0 are not allowed for this animation step."),a=!0),a&&e.splice(l,0,`The provided timing value "${n}" is invalid.`)}return{duration:r,delay:s,easing:o}}(n,e,t)}function rm(n,e={}){return Object.keys(n).forEach(t=>{e[t]=n[t]}),e}function sh(n,e,t={}){if(e)for(let i in n)t[i]=n[i];else rm(n,t);return t}function fz(n,e,t){return t?e+":"+t+";":""}function pz(n){let e="";for(let t=0;t{const r=vO(i);t&&!t.hasOwnProperty(i)&&(t[i]=n.style[r]),n.style[r]=e[i]}),sO()&&pz(n))}function Vf(n,e){n.style&&(Object.keys(e).forEach(t=>{const i=vO(t);n.style[i]=""}),sO()&&pz(n))}function Lv(n){return Array.isArray(n)?1==n.length?n[0]:JV(n):n}const yO=new RegExp("{{\\s*(.+?)\\s*}}","g");function gz(n){let e=[];if("string"==typeof n){let t;for(;t=yO.exec(n);)e.push(t[1]);yO.lastIndex=0}return e}function LE(n,e,t){const i=n.toString(),r=i.replace(yO,(s,o)=>{let a=e[o];return e.hasOwnProperty(o)||(t.push(`Please provide a value for the animation param ${o}`),a=""),a.toString()});return r==i?n:r}function BE(n){const e=[];let t=n.next();for(;!t.done;)e.push(t.value),t=n.next();return e}const Xie=/-+([a-z0-9])/g;function vO(n){return n.replace(Xie,(...e)=>e[1].toUpperCase())}function Kie(n){return n.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function mz(n,e){return 0===n||0===e}function _z(n,e,t){const i=Object.keys(t);if(i.length&&e.length){let s=e[0],o=[];if(i.forEach(a=>{s.hasOwnProperty(a)||o.push(a),s[a]=t[a]}),o.length)for(var r=1;rfunction(n,e,t){if(":"==n[0]){const l=function(n,e){switch(n){case":enter":return"void => *";case":leave":return"* => void";case":increment":return(t,i)=>parseFloat(i)>parseFloat(t);case":decrement":return(t,i)=>parseFloat(i) *"}}(n,t);if("function"==typeof l)return void e.push(l);n=l}const i=n.match(/^(\*|[-\w]+)\s*()\s*(\*|[-\w]+)$/);if(null==i||i.length<4)return t.push(`The provided transition expression "${n}" is not supported`),e;const r=i[1],s=i[2],o=i[3];e.push(yz(r,o));"<"==s[0]&&!("*"==r&&"*"==o)&&e.push(yz(o,r))}(i,t,e)):t.push(n),t}const zE=new Set(["true","1"]),jE=new Set(["false","0"]);function yz(n,e){const t=zE.has(n)||jE.has(n),i=zE.has(e)||jE.has(e);return(r,s)=>{let o="*"==n||n==r,a="*"==e||e==s;return!o&&t&&"boolean"==typeof r&&(o=r?zE.has(n):jE.has(n)),!a&&i&&"boolean"==typeof s&&(a=s?zE.has(e):jE.has(e)),o&&a}}const ere=new RegExp("s*:selfs*,?","g");function CO(n,e,t){return new tre(n).build(e,t)}class tre{constructor(e){this._driver=e}build(e,t){const i=new rre(t);return this._resetContextStyleTimingState(i),xa(this,Lv(e),i)}_resetContextStyleTimingState(e){e.currentQuerySelector="",e.collectedStyles={},e.collectedStyles[""]={},e.currentTime=0}visitTrigger(e,t){let i=t.queryCount=0,r=t.depCount=0;const s=[],o=[];return"@"==e.name.charAt(0)&&t.errors.push("animation triggers cannot be prefixed with an `@` sign (e.g. trigger('@foo', [...]))"),e.definitions.forEach(a=>{if(this._resetContextStyleTimingState(t),0==a.type){const l=a,c=l.name;c.toString().split(/\s*,\s*/).forEach(d=>{l.name=d,s.push(this.visitState(l,t))}),l.name=c}else if(1==a.type){const l=this.visitTransition(a,t);i+=l.queryCount,r+=l.depCount,o.push(l)}else t.errors.push("only state() and transition() definitions can sit inside of a trigger()")}),{type:7,name:e.name,states:s,transitions:o,queryCount:i,depCount:r,options:null}}visitState(e,t){const i=this.visitStyle(e.styles,t),r=e.options&&e.options.params||null;if(i.containsDynamicStyles){const s=new Set,o=r||{};if(i.styles.forEach(a=>{if(UE(a)){const l=a;Object.keys(l).forEach(c=>{gz(l[c]).forEach(d=>{o.hasOwnProperty(d)||s.add(d)})})}}),s.size){const a=BE(s.values());t.errors.push(`state("${e.name}", ...) must define default values for all the following style substitutions: ${a.join(", ")}`)}}return{type:0,name:e.name,style:i,options:r?{params:r}:null}}visitTransition(e,t){t.queryCount=0,t.depCount=0;const i=xa(this,Lv(e.animation),t);return{type:1,matchers:Zie(e.expr,t.errors),animation:i,queryCount:t.queryCount,depCount:t.depCount,options:zf(e.options)}}visitSequence(e,t){return{type:2,steps:e.steps.map(i=>xa(this,i,t)),options:zf(e.options)}}visitGroup(e,t){const i=t.currentTime;let r=0;const s=e.steps.map(o=>{t.currentTime=i;const a=xa(this,o,t);return r=Math.max(r,t.currentTime),a});return t.currentTime=r,{type:3,steps:s,options:zf(e.options)}}visitAnimate(e,t){const i=function(n,e){let t=null;if(n.hasOwnProperty("duration"))t=n;else if("number"==typeof n)return wO(NE(n,e).duration,0,"");const i=n;if(i.split(/\s+/).some(s=>"{"==s.charAt(0)&&"{"==s.charAt(1))){const s=wO(0,0,"");return s.dynamic=!0,s.strValue=i,s}return t=t||NE(i,e),wO(t.duration,t.delay,t.easing)}(e.timings,t.errors);t.currentAnimateTimings=i;let r,s=e.styles?e.styles:ti({});if(5==s.type)r=this.visitKeyframes(s,t);else{let o=e.styles,a=!1;if(!o){a=!0;const c={};i.easing&&(c.easing=i.easing),o=ti(c)}t.currentTime+=i.duration+i.delay;const l=this.visitStyle(o,t);l.isEmptyStep=a,r=l}return t.currentAnimateTimings=null,{type:4,timings:i,style:r,options:null}}visitStyle(e,t){const i=this._makeStyleAst(e,t);return this._validateStyleAst(i,t),i}_makeStyleAst(e,t){const i=[];Array.isArray(e.styles)?e.styles.forEach(o=>{"string"==typeof o?o==qu?i.push(o):t.errors.push(`The provided style string value ${o} is not allowed.`):i.push(o)}):i.push(e.styles);let r=!1,s=null;return i.forEach(o=>{if(UE(o)){const a=o,l=a.easing;if(l&&(s=l,delete a.easing),!r)for(let c in a)if(a[c].toString().indexOf("{{")>=0){r=!0;break}}}),{type:6,styles:i,easing:s,offset:e.offset,containsDynamicStyles:r,options:null}}_validateStyleAst(e,t){const i=t.currentAnimateTimings;let r=t.currentTime,s=t.currentTime;i&&s>0&&(s-=i.duration+i.delay),e.styles.forEach(o=>{"string"!=typeof o&&Object.keys(o).forEach(a=>{if(!this._driver.validateStyleProperty(a))return void t.errors.push(`The provided animation property "${a}" is not a supported CSS property for animations`);const l=t.collectedStyles[t.currentQuerySelector],c=l[a];let d=!0;c&&(s!=r&&s>=c.startTime&&r<=c.endTime&&(t.errors.push(`The CSS property "${a}" that exists between the times of "${c.startTime}ms" and "${c.endTime}ms" is also being animated in a parallel animation between the times of "${s}ms" and "${r}ms"`),d=!1),s=c.startTime),d&&(l[a]={startTime:s,endTime:r}),t.options&&function(n,e,t){const i=e.params||{},r=gz(n);r.length&&r.forEach(s=>{i.hasOwnProperty(s)||t.push(`Unable to resolve the local animation param ${s} in the given list of values`)})}(o[a],t.options,t.errors)})})}visitKeyframes(e,t){const i={type:5,styles:[],options:null};if(!t.currentAnimateTimings)return t.errors.push("keyframes() must be placed inside of a call to animate()"),i;let s=0;const o=[];let a=!1,l=!1,c=0;const d=e.steps.map(C=>{const w=this._makeStyleAst(C,t);let x=null!=w.offset?w.offset:function(n){if("string"==typeof n)return null;let e=null;if(Array.isArray(n))n.forEach(t=>{if(UE(t)&&t.hasOwnProperty("offset")){const i=t;e=parseFloat(i.offset),delete i.offset}});else if(UE(n)&&n.hasOwnProperty("offset")){const t=n;e=parseFloat(t.offset),delete t.offset}return e}(w.styles),N=0;return null!=x&&(s++,N=w.offset=x),l=l||N<0||N>1,a=a||N0&&s{const x=p>0?w==g?1:p*w:o[w],N=x*v;t.currentTime=_+y.delay+N,y.duration=N,this._validateStyleAst(C,t),C.offset=x,i.styles.push(C)}),i}visitReference(e,t){return{type:8,animation:xa(this,Lv(e.animation),t),options:zf(e.options)}}visitAnimateChild(e,t){return t.depCount++,{type:9,options:zf(e.options)}}visitAnimateRef(e,t){return{type:10,animation:this.visitReference(e.animation,t),options:zf(e.options)}}visitQuery(e,t){const i=t.currentQuerySelector,r=e.options||{};t.queryCount++,t.currentQuery=e;const[s,o]=function(n){const e=!!n.split(/\s*,\s*/).find(t=>":self"==t);return e&&(n=n.replace(ere,"")),[n=n.replace(/@\*/g,FE).replace(/@\w+/g,t=>FE+"-"+t.substr(1)).replace(/:animating/g,mO),e]}(e.selector);t.currentQuerySelector=i.length?i+" "+s:s,Ma(t.collectedStyles,t.currentQuerySelector,{});const a=xa(this,Lv(e.animation),t);return t.currentQuery=null,t.currentQuerySelector=i,{type:11,selector:s,limit:r.limit||0,optional:!!r.optional,includeSelf:o,animation:a,originalSelector:e.selector,options:zf(e.options)}}visitStagger(e,t){t.currentQuery||t.errors.push("stagger() can only be used inside of query()");const i="full"===e.timings?{duration:0,delay:0,easing:"full"}:NE(e.timings,t.errors,!0);return{type:12,animation:xa(this,Lv(e.animation),t),timings:i,options:null}}}class rre{constructor(e){this.errors=e,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 UE(n){return!Array.isArray(n)&&"object"==typeof n}function zf(n){return n?(n=rm(n)).params&&(n.params=function(n){return n?rm(n):null}(n.params)):n={},n}function wO(n,e,t){return{duration:n,delay:e,easing:t}}function EO(n,e,t,i,r,s,o=null,a=!1){return{type:1,element:n,keyframes:e,preStyleProps:t,postStyleProps:i,duration:r,delay:s,totalTime:r+s,easing:o,subTimeline:a}}class HE{constructor(){this._map=new Map}consume(e){let t=this._map.get(e);return t?this._map.delete(e):t=[],t}append(e,t){let i=this._map.get(e);i||this._map.set(e,i=[]),i.push(...t)}has(e){return this._map.has(e)}clear(){this._map.clear()}}const cre=new RegExp(":enter","g"),dre=new RegExp(":leave","g");function SO(n,e,t,i,r,s={},o={},a,l,c=[]){return(new hre).buildKeyframes(n,e,t,i,r,s,o,a,l,c)}class hre{buildKeyframes(e,t,i,r,s,o,a,l,c,d=[]){c=c||new HE;const f=new MO(e,t,c,r,s,d,[]);f.options=l,f.currentTimeline.setStyles([o],null,f.errors,l),xa(this,i,f);const p=f.timelines.filter(g=>g.containsAnimation());if(p.length&&Object.keys(a).length){const g=p[p.length-1];g.allowOnlyTimelineStyles()||g.setStyles([a],null,f.errors,l)}return p.length?p.map(g=>g.buildKeyframes()):[EO(t,[],[],[],0,0,"",!1)]}visitTrigger(e,t){}visitState(e,t){}visitTransition(e,t){}visitAnimateChild(e,t){const i=t.subInstructions.consume(t.element);if(i){const r=t.createSubContext(e.options),s=t.currentTimeline.currentTime,o=this._visitSubInstructions(i,r,r.options);s!=o&&t.transformIntoNewTimeline(o)}t.previousNode=e}visitAnimateRef(e,t){const i=t.createSubContext(e.options);i.transformIntoNewTimeline(),this.visitReference(e.animation,i),t.transformIntoNewTimeline(i.currentTimeline.currentTime),t.previousNode=e}_visitSubInstructions(e,t,i){let s=t.currentTimeline.currentTime;const o=null!=i.duration?Bf(i.duration):null,a=null!=i.delay?Bf(i.delay):null;return 0!==o&&e.forEach(l=>{const c=t.appendInstructionToTimeline(l,o,a);s=Math.max(s,c.duration+c.delay)}),s}visitReference(e,t){t.updateOptions(e.options,!0),xa(this,e.animation,t),t.previousNode=e}visitSequence(e,t){const i=t.subContextCount;let r=t;const s=e.options;if(s&&(s.params||s.delay)&&(r=t.createSubContext(s),r.transformIntoNewTimeline(),null!=s.delay)){6==r.previousNode.type&&(r.currentTimeline.snapshotCurrentStyles(),r.previousNode=$E);const o=Bf(s.delay);r.delayNextStep(o)}e.steps.length&&(e.steps.forEach(o=>xa(this,o,r)),r.currentTimeline.applyStylesToKeyframe(),r.subContextCount>i&&r.transformIntoNewTimeline()),t.previousNode=e}visitGroup(e,t){const i=[];let r=t.currentTimeline.currentTime;const s=e.options&&e.options.delay?Bf(e.options.delay):0;e.steps.forEach(o=>{const a=t.createSubContext(e.options);s&&a.delayNextStep(s),xa(this,o,a),r=Math.max(r,a.currentTimeline.currentTime),i.push(a.currentTimeline)}),i.forEach(o=>t.currentTimeline.mergeTimelineCollectedStyles(o)),t.transformIntoNewTimeline(r),t.previousNode=e}_visitTiming(e,t){if(e.dynamic){const i=e.strValue;return NE(t.params?LE(i,t.params,t.errors):i,t.errors)}return{duration:e.duration,delay:e.delay,easing:e.easing}}visitAnimate(e,t){const i=t.currentAnimateTimings=this._visitTiming(e.timings,t),r=t.currentTimeline;i.delay&&(t.incrementTime(i.delay),r.snapshotCurrentStyles());const s=e.style;5==s.type?this.visitKeyframes(s,t):(t.incrementTime(i.duration),this.visitStyle(s,t),r.applyStylesToKeyframe()),t.currentAnimateTimings=null,t.previousNode=e}visitStyle(e,t){const i=t.currentTimeline,r=t.currentAnimateTimings;!r&&i.getCurrentStyleProperties().length&&i.forwardFrame();const s=r&&r.easing||e.easing;e.isEmptyStep?i.applyEmptyStep(s):i.setStyles(e.styles,s,t.errors,t.options),t.previousNode=e}visitKeyframes(e,t){const i=t.currentAnimateTimings,r=t.currentTimeline.duration,s=i.duration,a=t.createSubContext().currentTimeline;a.easing=i.easing,e.styles.forEach(l=>{a.forwardTime((l.offset||0)*s),a.setStyles(l.styles,l.easing,t.errors,t.options),a.applyStylesToKeyframe()}),t.currentTimeline.mergeTimelineCollectedStyles(a),t.transformIntoNewTimeline(r+s),t.previousNode=e}visitQuery(e,t){const i=t.currentTimeline.currentTime,r=e.options||{},s=r.delay?Bf(r.delay):0;s&&(6===t.previousNode.type||0==i&&t.currentTimeline.getCurrentStyleProperties().length)&&(t.currentTimeline.snapshotCurrentStyles(),t.previousNode=$E);let o=i;const a=t.invokeQuery(e.selector,e.originalSelector,e.limit,e.includeSelf,!!r.optional,t.errors);t.currentQueryTotal=a.length;let l=null;a.forEach((c,d)=>{t.currentQueryIndex=d;const f=t.createSubContext(e.options,c);s&&f.delayNextStep(s),c===t.element&&(l=f.currentTimeline),xa(this,e.animation,f),f.currentTimeline.applyStylesToKeyframe(),o=Math.max(o,f.currentTimeline.currentTime)}),t.currentQueryIndex=0,t.currentQueryTotal=0,t.transformIntoNewTimeline(o),l&&(t.currentTimeline.mergeTimelineCollectedStyles(l),t.currentTimeline.snapshotCurrentStyles()),t.previousNode=e}visitStagger(e,t){const i=t.parentContext,r=t.currentTimeline,s=e.timings,o=Math.abs(s.duration),a=o*(t.currentQueryTotal-1);let l=o*t.currentQueryIndex;switch(s.duration<0?"reverse":s.easing){case"reverse":l=a-l;break;case"full":l=i.currentStaggerTime}const d=t.currentTimeline;l&&d.delayNextStep(l);const f=d.currentTime;xa(this,e.animation,t),t.previousNode=e,i.currentStaggerTime=r.currentTime-f+(r.startTime-i.currentTimeline.startTime)}}const $E={};class MO{constructor(e,t,i,r,s,o,a,l){this._driver=e,this.element=t,this.subInstructions=i,this._enterClassName=r,this._leaveClassName=s,this.errors=o,this.timelines=a,this.parentContext=null,this.currentAnimateTimings=null,this.previousNode=$E,this.subContextCount=0,this.options={},this.currentQueryIndex=0,this.currentQueryTotal=0,this.currentStaggerTime=0,this.currentTimeline=l||new GE(this._driver,t,0),a.push(this.currentTimeline)}get params(){return this.options.params}updateOptions(e,t){if(!e)return;const i=e;let r=this.options;null!=i.duration&&(r.duration=Bf(i.duration)),null!=i.delay&&(r.delay=Bf(i.delay));const s=i.params;if(s){let o=r.params;o||(o=this.options.params={}),Object.keys(s).forEach(a=>{(!t||!o.hasOwnProperty(a))&&(o[a]=LE(s[a],o,this.errors))})}}_copyOptions(){const e={};if(this.options){const t=this.options.params;if(t){const i=e.params={};Object.keys(t).forEach(r=>{i[r]=t[r]})}}return e}createSubContext(e=null,t,i){const r=t||this.element,s=new MO(this._driver,r,this.subInstructions,this._enterClassName,this._leaveClassName,this.errors,this.timelines,this.currentTimeline.fork(r,i||0));return s.previousNode=this.previousNode,s.currentAnimateTimings=this.currentAnimateTimings,s.options=this._copyOptions(),s.updateOptions(e),s.currentQueryIndex=this.currentQueryIndex,s.currentQueryTotal=this.currentQueryTotal,s.parentContext=this,this.subContextCount++,s}transformIntoNewTimeline(e){return this.previousNode=$E,this.currentTimeline=this.currentTimeline.fork(this.element,e),this.timelines.push(this.currentTimeline),this.currentTimeline}appendInstructionToTimeline(e,t,i){const r={duration:null!=t?t:e.duration,delay:this.currentTimeline.currentTime+(null!=i?i:0)+e.delay,easing:""},s=new fre(this._driver,e.element,e.keyframes,e.preStyleProps,e.postStyleProps,r,e.stretchStartingKeyframe);return this.timelines.push(s),r}incrementTime(e){this.currentTimeline.forwardTime(this.currentTimeline.duration+e)}delayNextStep(e){e>0&&this.currentTimeline.delayNextStep(e)}invokeQuery(e,t,i,r,s,o){let a=[];if(r&&a.push(this.element),e.length>0){e=(e=e.replace(cre,"."+this._enterClassName)).replace(dre,"."+this._leaveClassName);let c=this._driver.query(this.element,e,1!=i);0!==i&&(c=i<0?c.slice(c.length+i,c.length):c.slice(0,i)),a.push(...c)}return!s&&0==a.length&&o.push(`\`query("${t}")\` returned zero elements. (Use \`query("${t}", { optional: true })\` if you wish to allow this.)`),a}}class GE{constructor(e,t,i,r){this._driver=e,this.element=t,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(t),this._globalTimelineStyles||(this._globalTimelineStyles=this._localTimelineStyles,this._elementTimelineStylesLookup.set(t,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(e){const t=1==this._keyframes.size&&Object.keys(this._pendingStyles).length;this.duration||t?(this.forwardTime(this.currentTime+e),t&&this.snapshotCurrentStyles()):this.startTime+=e}fork(e,t){return this.applyStylesToKeyframe(),new GE(this._driver,e,t||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(e){this.applyStylesToKeyframe(),this.duration=e,this._loadKeyframe()}_updateStyle(e,t){this._localTimelineStyles[e]=t,this._globalTimelineStyles[e]=t,this._styleSummary[e]={time:this.currentTime,value:t}}allowOnlyTimelineStyles(){return this._currentEmptyStepKeyframe!==this._currentKeyframe}applyEmptyStep(e){e&&(this._previousKeyframe.easing=e),Object.keys(this._globalTimelineStyles).forEach(t=>{this._backFill[t]=this._globalTimelineStyles[t]||qu,this._currentKeyframe[t]=qu}),this._currentEmptyStepKeyframe=this._currentKeyframe}setStyles(e,t,i,r){t&&(this._previousKeyframe.easing=t);const s=r&&r.params||{},o=function(n,e){const t={};let i;return n.forEach(r=>{"*"===r?(i=i||Object.keys(e),i.forEach(s=>{t[s]=qu})):sh(r,!1,t)}),t}(e,this._globalTimelineStyles);Object.keys(o).forEach(a=>{const l=LE(o[a],s,i);this._pendingStyles[a]=l,this._localTimelineStyles.hasOwnProperty(a)||(this._backFill[a]=this._globalTimelineStyles.hasOwnProperty(a)?this._globalTimelineStyles[a]:qu),this._updateStyle(a,l)})}applyStylesToKeyframe(){const e=this._pendingStyles,t=Object.keys(e);0!=t.length&&(this._pendingStyles={},t.forEach(i=>{this._currentKeyframe[i]=e[i]}),Object.keys(this._localTimelineStyles).forEach(i=>{this._currentKeyframe.hasOwnProperty(i)||(this._currentKeyframe[i]=this._localTimelineStyles[i])}))}snapshotCurrentStyles(){Object.keys(this._localTimelineStyles).forEach(e=>{const t=this._localTimelineStyles[e];this._pendingStyles[e]=t,this._updateStyle(e,t)})}getFinalKeyframe(){return this._keyframes.get(this.duration)}get properties(){const e=[];for(let t in this._currentKeyframe)e.push(t);return e}mergeTimelineCollectedStyles(e){Object.keys(e._styleSummary).forEach(t=>{const i=this._styleSummary[t],r=e._styleSummary[t];(!i||r.time>i.time)&&this._updateStyle(t,r.value)})}buildKeyframes(){this.applyStylesToKeyframe();const e=new Set,t=new Set,i=1===this._keyframes.size&&0===this.duration;let r=[];this._keyframes.forEach((a,l)=>{const c=sh(a,!0);Object.keys(c).forEach(d=>{const f=c[d];"!"==f?e.add(d):f==qu&&t.add(d)}),i||(c.offset=l/this.duration),r.push(c)});const s=e.size?BE(e.values()):[],o=t.size?BE(t.values()):[];if(i){const a=r[0],l=rm(a);a.offset=0,l.offset=1,r=[a,l]}return EO(this.element,r,s,o,this.duration,this.startTime,this.easing,!1)}}class fre extends GE{constructor(e,t,i,r,s,o,a=!1){super(e,t,o.delay),this.keyframes=i,this.preStyleProps=r,this.postStyleProps=s,this._stretchStartingKeyframe=a,this.timings={duration:o.duration,delay:o.delay,easing:o.easing}}containsAnimation(){return this.keyframes.length>1}buildKeyframes(){let e=this.keyframes,{delay:t,duration:i,easing:r}=this.timings;if(this._stretchStartingKeyframe&&t){const s=[],o=i+t,a=t/o,l=sh(e[0],!1);l.offset=0,s.push(l);const c=sh(e[0],!1);c.offset=Cz(a),s.push(c);const d=e.length-1;for(let f=1;f<=d;f++){let p=sh(e[f],!1);p.offset=Cz((t+p.offset*i)/o),s.push(p)}i=o,t=0,r="",e=s}return EO(this.element,e,this.preStyleProps,this.postStyleProps,i,t,r,!0)}}function Cz(n,e=3){const t=Math.pow(10,e-1);return Math.round(n*t)/t}class xO{}class gre extends xO{normalizePropertyName(e,t){return vO(e)}normalizeStyleValue(e,t,i,r){let s="";const o=i.toString().trim();if(mre[t]&&0!==i&&"0"!==i)if("number"==typeof i)s="px";else{const a=i.match(/^[+-]?[\d\.]+([a-z]*)$/);a&&0==a[1].length&&r.push(`Please provide a CSS unit value for ${e}:${i}`)}return o+s}}const mre=(()=>function(n){const e={};return n.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 wz(n,e,t,i,r,s,o,a,l,c,d,f,p){return{type:0,element:n,triggerName:e,isRemovalTransition:r,fromState:t,fromStyles:s,toState:i,toStyles:o,timelines:a,queriedElements:l,preStyleProps:c,postStyleProps:d,totalTime:f,errors:p}}const TO={};class Ez{constructor(e,t,i){this._triggerName=e,this.ast=t,this._stateStyles=i}match(e,t,i,r){return function(n,e,t,i,r){return n.some(s=>s(e,t,i,r))}(this.ast.matchers,e,t,i,r)}buildStyles(e,t,i){const r=this._stateStyles["*"],s=this._stateStyles[e],o=r?r.buildStyles(t,i):{};return s?s.buildStyles(t,i):o}build(e,t,i,r,s,o,a,l,c,d){const f=[],p=this.ast.options&&this.ast.options.params||TO,_=this.buildStyles(i,a&&a.params||TO,f),y=l&&l.params||TO,v=this.buildStyles(r,y,f),C=new Set,w=new Map,x=new Map,N="void"===r,V={params:Object.assign(Object.assign({},p),y)},U=d?[]:SO(e,t,this.ast.animation,s,o,_,v,V,c,f);let ee=0;if(U.forEach(ae=>{ee=Math.max(ae.duration+ae.delay,ee)}),f.length)return wz(t,this._triggerName,i,r,N,_,v,[],[],w,x,ee,f);U.forEach(ae=>{const me=ae.element,Ee=Ma(w,me,{});ae.preStyleProps.forEach(te=>Ee[te]=!0);const Be=Ma(x,me,{});ae.postStyleProps.forEach(te=>Be[te]=!0),me!==t&&C.add(me)});const de=BE(C.values());return wz(t,this._triggerName,i,r,N,_,v,U,de,w,x,ee)}}class vre{constructor(e,t,i){this.styles=e,this.defaultParams=t,this.normalizer=i}buildStyles(e,t){const i={},r=rm(this.defaultParams);return Object.keys(e).forEach(s=>{const o=e[s];null!=o&&(r[s]=o)}),this.styles.styles.forEach(s=>{if("string"!=typeof s){const o=s;Object.keys(o).forEach(a=>{let l=o[a];l.length>1&&(l=LE(l,r,t));const c=this.normalizer.normalizePropertyName(a,t);l=this.normalizer.normalizeStyleValue(a,c,l,t),i[c]=l})}}),i}}class Cre{constructor(e,t,i){this.name=e,this.ast=t,this._normalizer=i,this.transitionFactories=[],this.states={},t.states.forEach(r=>{this.states[r.name]=new vre(r.style,r.options&&r.options.params||{},i)}),Sz(this.states,"true","1"),Sz(this.states,"false","0"),t.transitions.forEach(r=>{this.transitionFactories.push(new Ez(e,r,this.states))}),this.fallbackTransition=function(n,e,t){return new Ez(n,{type:1,animation:{type:2,steps:[],options:null},matchers:[(o,a)=>!0],options:null,queryCount:0,depCount:0},e)}(e,this.states)}get containsQueries(){return this.ast.queryCount>0}matchTransition(e,t,i,r){return this.transitionFactories.find(o=>o.match(e,t,i,r))||null}matchStyles(e,t,i){return this.fallbackTransition.buildStyles(e,t,i)}}function Sz(n,e,t){n.hasOwnProperty(e)?n.hasOwnProperty(t)||(n[t]=n[e]):n.hasOwnProperty(t)&&(n[e]=n[t])}const Ere=new HE;class Sre{constructor(e,t,i){this.bodyNode=e,this._driver=t,this._normalizer=i,this._animations={},this._playersById={},this.players=[]}register(e,t){const i=[],r=CO(this._driver,t,i);if(i.length)throw new Error(`Unable to build the animation due to the following errors: ${i.join("\n")}`);this._animations[e]=r}_buildPlayer(e,t,i){const r=e.element,s=iz(0,this._normalizer,0,e.keyframes,t,i);return this._driver.animate(r,s,e.duration,e.delay,e.easing,[],!0)}create(e,t,i={}){const r=[],s=this._animations[e];let o;const a=new Map;if(s?(o=SO(this._driver,t,s,gO,RE,{},{},i,Ere,r),o.forEach(d=>{const f=Ma(a,d.element,{});d.postStyleProps.forEach(p=>f[p]=null)})):(r.push("The requested animation doesn't exist or has already been destroyed"),o=[]),r.length)throw new Error(`Unable to create the animation due to the following errors: ${r.join("\n")}`);a.forEach((d,f)=>{Object.keys(d).forEach(p=>{d[p]=this._driver.computeStyle(f,p,qu)})});const c=rh(o.map(d=>{const f=a.get(d.element);return this._buildPlayer(d,{},f)}));return this._playersById[e]=c,c.onDestroy(()=>this.destroy(e)),this.players.push(c),c}destroy(e){const t=this._getPlayer(e);t.destroy(),delete this._playersById[e];const i=this.players.indexOf(t);i>=0&&this.players.splice(i,1)}_getPlayer(e){const t=this._playersById[e];if(!t)throw new Error(`Unable to find the timeline player referenced by ${e}`);return t}listen(e,t,i,r){const s=lO(t,"","","");return oO(this._getPlayer(e),i,s,r),()=>{}}command(e,t,i,r){if("register"==i)return void this.register(e,r[0]);if("create"==i)return void this.create(e,t,r[0]||{});const s=this._getPlayer(e);switch(i){case"play":s.play();break;case"pause":s.pause();break;case"reset":s.reset();break;case"restart":s.restart();break;case"finish":s.finish();break;case"init":s.init();break;case"setPosition":s.setPosition(parseFloat(r[0]));break;case"destroy":this.destroy(e)}}}const Mz="ng-animate-queued",xz="ng-animate-disabled",Tz=".ng-animate-disabled",Are=[],Az={namespaceId:"",setForRemoval:!1,setForMove:!1,hasAnimation:!1,removedBeforeQueried:!1},Dre={namespaceId:"",setForMove:!1,setForRemoval:!1,hasAnimation:!1,removedBeforeQueried:!0},gl="__ng_removed";class AO{constructor(e,t=""){this.namespaceId=t;const i=e&&e.hasOwnProperty("value");if(this.value=function(n){return null!=n?n:null}(i?e.value:e),i){const s=rm(e);delete s.value,this.options=s}else this.options={};this.options.params||(this.options.params={})}get params(){return this.options.params}absorbOptions(e){const t=e.params;if(t){const i=this.options.params;Object.keys(t).forEach(r=>{null==i[r]&&(i[r]=t[r])})}}}const Bv="void",DO=new AO(Bv);class Ore{constructor(e,t,i){this.id=e,this.hostElement=t,this._engine=i,this.players=[],this._triggers={},this._queue=[],this._elementListeners=new Map,this._hostClassName="ng-tns-"+e,ml(t,this._hostClassName)}listen(e,t,i,r){if(!this._triggers.hasOwnProperty(t))throw new Error(`Unable to listen on the animation trigger event "${i}" because the animation trigger "${t}" doesn't exist!`);if(null==i||0==i.length)throw new Error(`Unable to listen on the animation trigger "${t}" because the provided event is undefined!`);if(!function(n){return"start"==n||"done"==n}(i))throw new Error(`The provided animation trigger event "${i}" for the animation trigger "${t}" is not supported!`);const s=Ma(this._elementListeners,e,[]),o={name:t,phase:i,callback:r};s.push(o);const a=Ma(this._engine.statesByElement,e,{});return a.hasOwnProperty(t)||(ml(e,kE),ml(e,kE+"-"+t),a[t]=DO),()=>{this._engine.afterFlush(()=>{const l=s.indexOf(o);l>=0&&s.splice(l,1),this._triggers[t]||delete a[t]})}}register(e,t){return!this._triggers[e]&&(this._triggers[e]=t,!0)}_getTrigger(e){const t=this._triggers[e];if(!t)throw new Error(`The provided animation trigger "${e}" has not been registered!`);return t}trigger(e,t,i,r=!0){const s=this._getTrigger(t),o=new OO(this.id,t,e);let a=this._engine.statesByElement.get(e);a||(ml(e,kE),ml(e,kE+"-"+t),this._engine.statesByElement.set(e,a={}));let l=a[t];const c=new AO(i,this.id);if(!(i&&i.hasOwnProperty("value"))&&l&&c.absorbOptions(l.options),a[t]=c,l||(l=DO),c.value!==Bv&&l.value===c.value){if(!function(n,e){const t=Object.keys(n),i=Object.keys(e);if(t.length!=i.length)return!1;for(let r=0;r{Vf(e,v),Gc(e,C)})}return}const p=Ma(this._engine.playersByElement,e,[]);p.forEach(y=>{y.namespaceId==this.id&&y.triggerName==t&&y.queued&&y.destroy()});let g=s.matchTransition(l.value,c.value,e,c.params),_=!1;if(!g){if(!r)return;g=s.fallbackTransition,_=!0}return this._engine.totalQueuedPlayers++,this._queue.push({element:e,triggerName:t,transition:g,fromState:l,toState:c,player:o,isFallbackTransition:_}),_||(ml(e,Mz),o.onStart(()=>{sm(e,Mz)})),o.onDone(()=>{let y=this.players.indexOf(o);y>=0&&this.players.splice(y,1);const v=this._engine.playersByElement.get(e);if(v){let C=v.indexOf(o);C>=0&&v.splice(C,1)}}),this.players.push(o),p.push(o),o}deregister(e){delete this._triggers[e],this._engine.statesByElement.forEach((t,i)=>{delete t[e]}),this._elementListeners.forEach((t,i)=>{this._elementListeners.set(i,t.filter(r=>r.name!=e))})}clearElementCache(e){this._engine.statesByElement.delete(e),this._elementListeners.delete(e);const t=this._engine.playersByElement.get(e);t&&(t.forEach(i=>i.destroy()),this._engine.playersByElement.delete(e))}_signalRemovalForInnerTriggers(e,t){const i=this._engine.driver.query(e,FE,!0);i.forEach(r=>{if(r[gl])return;const s=this._engine.fetchNamespacesByElement(r);s.size?s.forEach(o=>o.triggerLeaveAnimation(r,t,!1,!0)):this.clearElementCache(r)}),this._engine.afterFlushAnimationsDone(()=>i.forEach(r=>this.clearElementCache(r)))}triggerLeaveAnimation(e,t,i,r){const s=this._engine.statesByElement.get(e);if(s){const o=[];if(Object.keys(s).forEach(a=>{if(this._triggers[a]){const l=this.trigger(e,a,Bv,r);l&&o.push(l)}}),o.length)return this._engine.markElementAsRemoved(this.id,e,!0,t),i&&rh(o).onDone(()=>this._engine.processLeaveNode(e)),!0}return!1}prepareLeaveAnimationListeners(e){const t=this._elementListeners.get(e),i=this._engine.statesByElement.get(e);if(t&&i){const r=new Set;t.forEach(s=>{const o=s.name;if(r.has(o))return;r.add(o);const l=this._triggers[o].fallbackTransition,c=i[o]||DO,d=new AO(Bv),f=new OO(this.id,o,e);this._engine.totalQueuedPlayers++,this._queue.push({element:e,triggerName:o,transition:l,fromState:c,toState:d,player:f,isFallbackTransition:!0})})}}removeNode(e,t){const i=this._engine;if(e.childElementCount&&this._signalRemovalForInnerTriggers(e,t),this.triggerLeaveAnimation(e,t,!0))return;let r=!1;if(i.totalAnimations){const s=i.players.length?i.playersByQueriedElement.get(e):[];if(s&&s.length)r=!0;else{let o=e;for(;o=o.parentNode;)if(i.statesByElement.get(o)){r=!0;break}}}if(this.prepareLeaveAnimationListeners(e),r)i.markElementAsRemoved(this.id,e,!1,t);else{const s=e[gl];(!s||s===Az)&&(i.afterFlush(()=>this.clearElementCache(e)),i.destroyInnerAnimations(e),i._onRemovalComplete(e,t))}}insertNode(e,t){ml(e,this._hostClassName)}drainQueuedTransitions(e){const t=[];return this._queue.forEach(i=>{const r=i.player;if(r.destroyed)return;const s=i.element,o=this._elementListeners.get(s);o&&o.forEach(a=>{if(a.name==i.triggerName){const l=lO(s,i.triggerName,i.fromState.value,i.toState.value);l._data=e,oO(i.player,a.phase,l,a.callback)}}),r.markedForDestroy?this._engine.afterFlush(()=>{r.destroy()}):t.push(i)}),this._queue=[],t.sort((i,r)=>{const s=i.transition.ast.depCount,o=r.transition.ast.depCount;return 0==s||0==o?s-o:this._engine.driver.containsElement(i.element,r.element)?1:-1})}destroy(e){this.players.forEach(t=>t.destroy()),this._signalRemovalForInnerTriggers(this.hostElement,e)}elementContainsData(e){let t=!1;return this._elementListeners.has(e)&&(t=!0),t=!!this._queue.find(i=>i.element===e)||t,t}}class Ire{constructor(e,t,i){this.bodyNode=e,this.driver=t,this._normalizer=i,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=(r,s)=>{}}_onRemovalComplete(e,t){this.onRemovalComplete(e,t)}get queuedPlayers(){const e=[];return this._namespaceList.forEach(t=>{t.players.forEach(i=>{i.queued&&e.push(i)})}),e}createNamespace(e,t){const i=new Ore(e,t,this);return this.bodyNode&&this.driver.containsElement(this.bodyNode,t)?this._balanceNamespaceList(i,t):(this.newHostElements.set(t,i),this.collectEnterElement(t)),this._namespaceLookup[e]=i}_balanceNamespaceList(e,t){const i=this._namespaceList.length-1;if(i>=0){let r=!1;for(let s=i;s>=0;s--)if(this.driver.containsElement(this._namespaceList[s].hostElement,t)){this._namespaceList.splice(s+1,0,e),r=!0;break}r||this._namespaceList.splice(0,0,e)}else this._namespaceList.push(e);return this.namespacesByHostElement.set(t,e),e}register(e,t){let i=this._namespaceLookup[e];return i||(i=this.createNamespace(e,t)),i}registerTrigger(e,t,i){let r=this._namespaceLookup[e];r&&r.register(t,i)&&this.totalAnimations++}destroy(e,t){if(!e)return;const i=this._fetchNamespace(e);this.afterFlush(()=>{this.namespacesByHostElement.delete(i.hostElement),delete this._namespaceLookup[e];const r=this._namespaceList.indexOf(i);r>=0&&this._namespaceList.splice(r,1)}),this.afterFlushAnimationsDone(()=>i.destroy(t))}_fetchNamespace(e){return this._namespaceLookup[e]}fetchNamespacesByElement(e){const t=new Set,i=this.statesByElement.get(e);if(i){const r=Object.keys(i);for(let s=0;s=0&&this.collectedLeaveElements.splice(o,1)}if(e){const o=this._fetchNamespace(e);o&&o.insertNode(t,i)}r&&this.collectEnterElement(t)}collectEnterElement(e){this.collectedEnterElements.push(e)}markElementAsDisabled(e,t){t?this.disabledNodes.has(e)||(this.disabledNodes.add(e),ml(e,xz)):this.disabledNodes.has(e)&&(this.disabledNodes.delete(e),sm(e,xz))}removeNode(e,t,i,r){if(WE(t)){const s=e?this._fetchNamespace(e):null;if(s?s.removeNode(t,r):this.markElementAsRemoved(e,t,!1,r),i){const o=this.namespacesByHostElement.get(t);o&&o.id!==e&&o.removeNode(t,r)}}else this._onRemovalComplete(t,r)}markElementAsRemoved(e,t,i,r){this.collectedLeaveElements.push(t),t[gl]={namespaceId:e,setForRemoval:r,hasAnimation:i,removedBeforeQueried:!1}}listen(e,t,i,r,s){return WE(t)?this._fetchNamespace(e).listen(t,i,r,s):()=>{}}_buildInstruction(e,t,i,r,s){return e.transition.build(this.driver,e.element,e.fromState.value,e.toState.value,i,r,e.fromState.options,e.toState.options,t,s)}destroyInnerAnimations(e){let t=this.driver.query(e,FE,!0);t.forEach(i=>this.destroyActiveAnimationsForElement(i)),0!=this.playersByQueriedElement.size&&(t=this.driver.query(e,mO,!0),t.forEach(i=>this.finishActiveQueriedAnimationOnElement(i)))}destroyActiveAnimationsForElement(e){const t=this.playersByElement.get(e);t&&t.forEach(i=>{i.queued?i.markedForDestroy=!0:i.destroy()})}finishActiveQueriedAnimationOnElement(e){const t=this.playersByQueriedElement.get(e);t&&t.forEach(i=>i.finish())}whenRenderingDone(){return new Promise(e=>{if(this.players.length)return rh(this.players).onDone(()=>e());e()})}processLeaveNode(e){const t=e[gl];if(t&&t.setForRemoval){if(e[gl]=Az,t.namespaceId){this.destroyInnerAnimations(e);const i=this._fetchNamespace(t.namespaceId);i&&i.clearElementCache(e)}this._onRemovalComplete(e,t.setForRemoval)}this.driver.matchesElement(e,Tz)&&this.markElementAsDisabled(e,!1),this.driver.query(e,Tz,!0).forEach(i=>{this.markElementAsDisabled(i,!1)})}flush(e=-1){let t=[];if(this.newHostElements.size&&(this.newHostElements.forEach((i,r)=>this._balanceNamespaceList(i,r)),this.newHostElements.clear()),this.totalAnimations&&this.collectedEnterElements.length)for(let i=0;ii()),this._flushFns=[],this._whenQuietFns.length){const i=this._whenQuietFns;this._whenQuietFns=[],t.length?rh(t).onDone(()=>{i.forEach(r=>r())}):i.forEach(r=>r())}}reportError(e){throw new Error(`Unable to process animations due to the following failed trigger transitions\n ${e.join("\n")}`)}_flushAnimations(e,t){const i=new HE,r=[],s=new Map,o=[],a=new Map,l=new Map,c=new Map,d=new Set;this.disabledNodes.forEach(Q=>{d.add(Q);const je=this.driver.query(Q,".ng-animate-queued",!0);for(let $e=0;$e{const $e=gO+y++;_.set(je,$e),Q.forEach(qe=>ml(qe,$e))});const v=[],C=new Set,w=new Set;for(let Q=0;QC.add(qe)):w.add(je))}const x=new Map,N=Iz(p,Array.from(C));N.forEach((Q,je)=>{const $e=RE+y++;x.set(je,$e),Q.forEach(qe=>ml(qe,$e))}),e.push(()=>{g.forEach((Q,je)=>{const $e=_.get(je);Q.forEach(qe=>sm(qe,$e))}),N.forEach((Q,je)=>{const $e=x.get(je);Q.forEach(qe=>sm(qe,$e))}),v.forEach(Q=>{this.processLeaveNode(Q)})});const V=[],U=[];for(let Q=this._namespaceList.length-1;Q>=0;Q--)this._namespaceList[Q].drainQueuedTransitions(t).forEach($e=>{const qe=$e.player,Ot=$e.element;if(V.push(qe),this.collectedEnterElements.length){const gi=Ot[gl];if(gi&&gi.setForMove)return void qe.destroy()}const Hn=!f||!this.driver.containsElement(f,Ot),ot=x.get(Ot),nr=_.get(Ot),Ln=this._buildInstruction($e,i,nr,ot,Hn);if(Ln.errors&&Ln.errors.length)U.push(Ln);else{if(Hn)return qe.onStart(()=>Vf(Ot,Ln.fromStyles)),qe.onDestroy(()=>Gc(Ot,Ln.toStyles)),void r.push(qe);if($e.isFallbackTransition)return qe.onStart(()=>Vf(Ot,Ln.fromStyles)),qe.onDestroy(()=>Gc(Ot,Ln.toStyles)),void r.push(qe);Ln.timelines.forEach(gi=>gi.stretchStartingKeyframe=!0),i.append(Ot,Ln.timelines),o.push({instruction:Ln,player:qe,element:Ot}),Ln.queriedElements.forEach(gi=>Ma(a,gi,[]).push(qe)),Ln.preStyleProps.forEach((gi,_r)=>{const oa=Object.keys(gi);if(oa.length){let Bs=l.get(_r);Bs||l.set(_r,Bs=new Set),oa.forEach(Na=>Bs.add(Na))}}),Ln.postStyleProps.forEach((gi,_r)=>{const oa=Object.keys(gi);let Bs=c.get(_r);Bs||c.set(_r,Bs=new Set),oa.forEach(Na=>Bs.add(Na))})}});if(U.length){const Q=[];U.forEach(je=>{Q.push(`@${je.triggerName} has failed due to:\n`),je.errors.forEach($e=>Q.push(`- ${$e}\n`))}),V.forEach(je=>je.destroy()),this.reportError(Q)}const ee=new Map,de=new Map;o.forEach(Q=>{const je=Q.element;i.has(je)&&(de.set(je,je),this._beforeAnimationBuild(Q.player.namespaceId,Q.instruction,ee))}),r.forEach(Q=>{const je=Q.element;this._getPreviousPlayers(je,!1,Q.namespaceId,Q.triggerName,null).forEach(qe=>{Ma(ee,je,[]).push(qe),qe.destroy()})});const ae=v.filter(Q=>Rz(Q,l,c)),me=new Map;Oz(me,this.driver,w,c,qu).forEach(Q=>{Rz(Q,l,c)&&ae.push(Q)});const Be=new Map;g.forEach((Q,je)=>{Oz(Be,this.driver,new Set(Q),l,"!")}),ae.forEach(Q=>{const je=me.get(Q),$e=Be.get(Q);me.set(Q,Object.assign(Object.assign({},je),$e))});const te=[],ne=[],Ie={};o.forEach(Q=>{const{element:je,player:$e,instruction:qe}=Q;if(i.has(je)){if(d.has(je))return $e.onDestroy(()=>Gc(je,qe.toStyles)),$e.disabled=!0,$e.overrideTotalTime(qe.totalTime),void r.push($e);let Ot=Ie;if(de.size>1){let ot=je;const nr=[];for(;ot=ot.parentNode;){const Ln=de.get(ot);if(Ln){Ot=Ln;break}nr.push(ot)}nr.forEach(Ln=>de.set(Ln,Ot))}const Hn=this._buildAnimation($e.namespaceId,qe,ee,s,Be,me);if($e.setRealPlayer(Hn),Ot===Ie)te.push($e);else{const ot=this.playersByElement.get(Ot);ot&&ot.length&&($e.parentPlayer=rh(ot)),r.push($e)}}else Vf(je,qe.fromStyles),$e.onDestroy(()=>Gc(je,qe.toStyles)),ne.push($e),d.has(je)&&r.push($e)}),ne.forEach(Q=>{const je=s.get(Q.element);if(je&&je.length){const $e=rh(je);Q.setRealPlayer($e)}}),r.forEach(Q=>{Q.parentPlayer?Q.syncPlayerEvents(Q.parentPlayer):Q.destroy()});for(let Q=0;Q!Hn.destroyed);Ot.length?Fre(this,je,Ot):this.processLeaveNode(je)}return v.length=0,te.forEach(Q=>{this.players.push(Q),Q.onDone(()=>{Q.destroy();const je=this.players.indexOf(Q);this.players.splice(je,1)}),Q.play()}),te}elementContainsData(e,t){let i=!1;const r=t[gl];return r&&r.setForRemoval&&(i=!0),this.playersByElement.has(t)&&(i=!0),this.playersByQueriedElement.has(t)&&(i=!0),this.statesByElement.has(t)&&(i=!0),this._fetchNamespace(e).elementContainsData(t)||i}afterFlush(e){this._flushFns.push(e)}afterFlushAnimationsDone(e){this._whenQuietFns.push(e)}_getPreviousPlayers(e,t,i,r,s){let o=[];if(t){const a=this.playersByQueriedElement.get(e);a&&(o=a)}else{const a=this.playersByElement.get(e);if(a){const l=!s||s==Bv;a.forEach(c=>{c.queued||!l&&c.triggerName!=r||o.push(c)})}}return(i||r)&&(o=o.filter(a=>!(i&&i!=a.namespaceId||r&&r!=a.triggerName))),o}_beforeAnimationBuild(e,t,i){const s=t.element,o=t.isRemovalTransition?void 0:e,a=t.isRemovalTransition?void 0:t.triggerName;for(const l of t.timelines){const c=l.element,d=c!==s,f=Ma(i,c,[]);this._getPreviousPlayers(c,d,o,a,t.toState).forEach(g=>{const _=g.getRealPlayer();_.beforeDestroy&&_.beforeDestroy(),g.destroy(),f.push(g)})}Vf(s,t.fromStyles)}_buildAnimation(e,t,i,r,s,o){const a=t.triggerName,l=t.element,c=[],d=new Set,f=new Set,p=t.timelines.map(_=>{const y=_.element;d.add(y);const v=y[gl];if(v&&v.removedBeforeQueried)return new im(_.duration,_.delay);const C=y!==l,w=function(n){const e=[];return Pz(n,e),e}((i.get(y)||Are).map(ee=>ee.getRealPlayer())).filter(ee=>!!ee.element&&ee.element===y),x=s.get(y),N=o.get(y),V=iz(0,this._normalizer,0,_.keyframes,x,N),U=this._buildPlayer(_,V,w);if(_.subTimeline&&r&&f.add(y),C){const ee=new OO(e,a,y);ee.setRealPlayer(U),c.push(ee)}return U});c.forEach(_=>{Ma(this.playersByQueriedElement,_.element,[]).push(_),_.onDone(()=>function(n,e,t){let i;if(n instanceof Map){if(i=n.get(e),i){if(i.length){const r=i.indexOf(t);i.splice(r,1)}0==i.length&&n.delete(e)}}else if(i=n[e],i){if(i.length){const r=i.indexOf(t);i.splice(r,1)}0==i.length&&delete n[e]}return i}(this.playersByQueriedElement,_.element,_))}),d.forEach(_=>ml(_,dz));const g=rh(p);return g.onDestroy(()=>{d.forEach(_=>sm(_,dz)),Gc(l,t.toStyles)}),f.forEach(_=>{Ma(r,_,[]).push(g)}),g}_buildPlayer(e,t,i){return t.length>0?this.driver.animate(e.element,t,e.duration,e.delay,e.easing,i):new im(e.duration,e.delay)}}class OO{constructor(e,t,i){this.namespaceId=e,this.triggerName=t,this.element=i,this._player=new im,this._containsRealPlayer=!1,this._queuedCallbacks={},this.destroyed=!1,this.markedForDestroy=!1,this.disabled=!1,this.queued=!0,this.totalTime=0}setRealPlayer(e){this._containsRealPlayer||(this._player=e,Object.keys(this._queuedCallbacks).forEach(t=>{this._queuedCallbacks[t].forEach(i=>oO(e,t,void 0,i))}),this._queuedCallbacks={},this._containsRealPlayer=!0,this.overrideTotalTime(e.totalTime),this.queued=!1)}getRealPlayer(){return this._player}overrideTotalTime(e){this.totalTime=e}syncPlayerEvents(e){const t=this._player;t.triggerCallback&&e.onStart(()=>t.triggerCallback("start")),e.onDone(()=>this.finish()),e.onDestroy(()=>this.destroy())}_queueEvent(e,t){Ma(this._queuedCallbacks,e,[]).push(t)}onDone(e){this.queued&&this._queueEvent("done",e),this._player.onDone(e)}onStart(e){this.queued&&this._queueEvent("start",e),this._player.onStart(e)}onDestroy(e){this.queued&&this._queueEvent("destroy",e),this._player.onDestroy(e)}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(e){this.queued||this._player.setPosition(e)}getPosition(){return this.queued?0:this._player.getPosition()}triggerCallback(e){const t=this._player;t.triggerCallback&&t.triggerCallback(e)}}function WE(n){return n&&1===n.nodeType}function Dz(n,e){const t=n.style.display;return n.style.display=null!=e?e:"none",t}function Oz(n,e,t,i,r){const s=[];t.forEach(l=>s.push(Dz(l)));const o=[];i.forEach((l,c)=>{const d={};l.forEach(f=>{const p=d[f]=e.computeStyle(c,f,r);(!p||0==p.length)&&(c[gl]=Dre,o.push(c))}),n.set(c,d)});let a=0;return t.forEach(l=>Dz(l,s[a++])),o}function Iz(n,e){const t=new Map;if(n.forEach(a=>t.set(a,[])),0==e.length)return t;const r=new Set(e),s=new Map;function o(a){if(!a)return 1;let l=s.get(a);if(l)return l;const c=a.parentNode;return l=t.has(c)?c:r.has(c)?1:o(c),s.set(a,l),l}return e.forEach(a=>{const l=o(a);1!==l&&t.get(l).push(a)}),t}const qE="$$classes";function ml(n,e){if(n.classList)n.classList.add(e);else{let t=n[qE];t||(t=n[qE]={}),t[e]=!0}}function sm(n,e){if(n.classList)n.classList.remove(e);else{let t=n[qE];t&&delete t[e]}}function Fre(n,e,t){rh(t).onDone(()=>n.processLeaveNode(e))}function Pz(n,e){for(let t=0;tr.add(s)):e.set(n,i),t.delete(n),!0}class YE{constructor(e,t,i){this.bodyNode=e,this._driver=t,this._normalizer=i,this._triggerCache={},this.onRemovalComplete=(r,s)=>{},this._transitionEngine=new Ire(e,t,i),this._timelineEngine=new Sre(e,t,i),this._transitionEngine.onRemovalComplete=(r,s)=>this.onRemovalComplete(r,s)}registerTrigger(e,t,i,r,s){const o=e+"-"+r;let a=this._triggerCache[o];if(!a){const l=[],c=CO(this._driver,s,l);if(l.length)throw new Error(`The animation trigger "${r}" has failed to build due to the following errors:\n - ${l.join("\n - ")}`);a=function(n,e,t){return new Cre(n,e,t)}(r,c,this._normalizer),this._triggerCache[o]=a}this._transitionEngine.registerTrigger(t,r,a)}register(e,t){this._transitionEngine.register(e,t)}destroy(e,t){this._transitionEngine.destroy(e,t)}onInsert(e,t,i,r){this._transitionEngine.insertNode(e,t,i,r)}onRemove(e,t,i,r){this._transitionEngine.removeNode(e,t,r||!1,i)}disableAnimations(e,t){this._transitionEngine.markElementAsDisabled(e,t)}process(e,t,i,r){if("@"==i.charAt(0)){const[s,o]=rz(i);this._timelineEngine.command(s,t,o,r)}else this._transitionEngine.trigger(e,t,i,r)}listen(e,t,i,r,s){if("@"==i.charAt(0)){const[o,a]=rz(i);return this._timelineEngine.listen(o,t,a,s)}return this._transitionEngine.listen(e,t,i,r,s)}flush(e=-1){this._transitionEngine.flush(e)}get players(){return this._transitionEngine.players.concat(this._timelineEngine.players)}whenRenderingDone(){return this._transitionEngine.whenRenderingDone()}}function kz(n,e){let t=null,i=null;return Array.isArray(e)&&e.length?(t=IO(e[0]),e.length>1&&(i=IO(e[e.length-1]))):e&&(t=IO(e)),t||i?new om(n,t,i):null}class om{constructor(e,t,i){this._element=e,this._startStyles=t,this._endStyles=i,this._state=0;let r=om.initialStylesByElement.get(e);r||om.initialStylesByElement.set(e,r={}),this._initialStyles=r}start(){this._state<1&&(this._startStyles&&Gc(this._element,this._startStyles,this._initialStyles),this._state=1)}finish(){this.start(),this._state<2&&(Gc(this._element,this._initialStyles),this._endStyles&&(Gc(this._element,this._endStyles),this._endStyles=null),this._state=1)}destroy(){this.finish(),this._state<3&&(om.initialStylesByElement.delete(this._element),this._startStyles&&(Vf(this._element,this._startStyles),this._endStyles=null),this._endStyles&&(Vf(this._element,this._endStyles),this._endStyles=null),Gc(this._element,this._initialStyles),this._state=3)}}function IO(n){let e=null;const t=Object.keys(n);for(let i=0;ithis._handleCallback(l)}apply(){(function(n,e){const t=RO(n,"").trim();let i=0;t.length&&(function(n,e){let t=0;for(let i=0;i=this._delay&&i>=this._duration&&this.finish()}finish(){this._finished||(this._finished=!0,this._onDoneFn(),Vz(this._element,this._eventFn,!0))}destroy(){this._destroyed||(this._destroyed=!0,this.finish(),function(n,e){const i=RO(n,"").split(","),r=PO(i,e);r>=0&&(i.splice(r,1),XE(n,"",i.join(",")))}(this._element,this._name))}}function Lz(n,e,t){XE(n,"PlayState",t,Bz(n,e))}function Bz(n,e){const t=RO(n,"");return t.indexOf(",")>0?PO(t.split(","),e):PO([t],e)}function PO(n,e){for(let t=0;t=0)return t;return-1}function Vz(n,e,t){t?n.removeEventListener(Nz,e):n.addEventListener(Nz,e)}function XE(n,e,t,i){const r=Fz+e;if(null!=i){const s=n.style[r];if(s.length){const o=s.split(",");o[i]=t,t=o.join(",")}}n.style[r]=t}function RO(n,e){return n.style[Fz+e]||""}class zz{constructor(e,t,i,r,s,o,a,l){this.element=e,this.keyframes=t,this.animationName=i,this._duration=r,this._delay=s,this._finalStyles=a,this._specialStyles=l,this._onDoneFns=[],this._onStartFns=[],this._onDestroyFns=[],this.currentSnapshot={},this._state=0,this.easing=o||"linear",this.totalTime=r+s,this._buildStyler()}onStart(e){this._onStartFns.push(e)}onDone(e){this._onDoneFns.push(e)}onDestroy(e){this._onDestroyFns.push(e)}destroy(){this.init(),!(this._state>=4)&&(this._state=4,this._styler.destroy(),this._flushStartFns(),this._flushDoneFns(),this._specialStyles&&this._specialStyles.destroy(),this._onDestroyFns.forEach(e=>e()),this._onDestroyFns=[])}_flushDoneFns(){this._onDoneFns.forEach(e=>e()),this._onDoneFns=[]}_flushStartFns(){this._onStartFns.forEach(e=>e()),this._onStartFns=[]}finish(){this.init(),!(this._state>=3)&&(this._state=3,this._styler.finish(),this._flushStartFns(),this._specialStyles&&this._specialStyles.finish(),this._flushDoneFns())}setPosition(e){this._styler.setPosition(e)}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 jre(this.element,this.animationName,this._duration,this._delay,this.easing,"forwards",()=>this.finish())}triggerCallback(e){const t="start"==e?this._onStartFns:this._onDoneFns;t.forEach(i=>i()),t.length=0}beforeDestroy(){this.init();const e={};if(this.hasStarted()){const t=this._state>=3;Object.keys(this._finalStyles).forEach(i=>{"offset"!=i&&(e[i]=t?this._finalStyles[i]:bO(this.element,i))})}this.currentSnapshot=e}}class qre extends im{constructor(e,t){super(),this.element=e,this._startingStyles={},this.__initialized=!1,this._styles=lz(t)}init(){this.__initialized||!this._startingStyles||(this.__initialized=!0,Object.keys(this._styles).forEach(e=>{this._startingStyles[e]=this.element.style[e]}),super.init())}play(){!this._startingStyles||(this.init(),Object.keys(this._styles).forEach(e=>this.element.style.setProperty(e,this._styles[e])),super.play())}destroy(){!this._startingStyles||(Object.keys(this._startingStyles).forEach(e=>{const t=this._startingStyles[e];t?this.element.style.setProperty(e,t):this.element.style.removeProperty(e)}),this._startingStyles=null,super.destroy())}}class Uz{constructor(){this._count=0}validateStyleProperty(e){return dO(e)}matchesElement(e,t){return hO(e,t)}containsElement(e,t){return fO(e,t)}query(e,t,i){return pO(e,t,i)}computeStyle(e,t,i){return window.getComputedStyle(e)[t]}buildKeyframeElement(e,t,i){i=i.map(a=>lz(a));let r=`@keyframes ${t} {\n`,s="";i.forEach(a=>{s=" ";const l=parseFloat(a.offset);r+=`${s}${100*l}% {\n`,s+=" ",Object.keys(a).forEach(c=>{const d=a[c];switch(c){case"offset":return;case"easing":return void(d&&(r+=`${s}animation-timing-function: ${d};\n`));default:return void(r+=`${s}${c}: ${d};\n`)}}),r+=`${s}}\n`}),r+="}\n";const o=document.createElement("style");return o.textContent=r,o}animate(e,t,i,r,s,o=[],a){const l=o.filter(v=>v instanceof zz),c={};mz(i,r)&&l.forEach(v=>{let C=v.currentSnapshot;Object.keys(C).forEach(w=>c[w]=C[w])});const d=function(n){let e={};return n&&(Array.isArray(n)?n:[n]).forEach(i=>{Object.keys(i).forEach(r=>{"offset"==r||"easing"==r||(e[r]=i[r])})}),e}(t=_z(e,t,c));if(0==i)return new qre(e,d);const f="gen_css_kf_"+this._count++,p=this.buildKeyframeElement(e,f,t);(function(n){var e;const t=null===(e=n.getRootNode)||void 0===e?void 0:e.call(n);return"undefined"!=typeof ShadowRoot&&t instanceof ShadowRoot?t:document.head})(e).appendChild(p);const _=kz(e,t),y=new zz(e,t,f,i,r,s,d,_);return y.onDestroy(()=>function(n){n.parentNode.removeChild(n)}(p)),y}}class $z{constructor(e,t,i,r){this.element=e,this.keyframes=t,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}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(e=>e()),this._onDoneFns=[])}init(){this._buildPlayer(),this._preparePlayerBeforeStart()}_buildPlayer(){if(this._initialized)return;this._initialized=!0;const e=this.keyframes;this.domPlayer=this._triggerWebAnimation(this.element,e,this.options),this._finalKeyframe=e.length?e[e.length-1]:{},this.domPlayer.addEventListener("finish",()=>this._onFinish())}_preparePlayerBeforeStart(){this._delay?this._resetDomPlayerState():this.domPlayer.pause()}_triggerWebAnimation(e,t,i){return e.animate(t,i)}onStart(e){this._onStartFns.push(e)}onDone(e){this._onDoneFns.push(e)}onDestroy(e){this._onDestroyFns.push(e)}play(){this._buildPlayer(),this.hasStarted()||(this._onStartFns.forEach(e=>e()),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(e=>e()),this._onDestroyFns=[])}setPosition(e){void 0===this.domPlayer&&this.init(),this.domPlayer.currentTime=e*this.time}getPosition(){return this.domPlayer.currentTime/this.time}get totalTime(){return this._delay+this._duration}beforeDestroy(){const e={};this.hasStarted()&&Object.keys(this._finalKeyframe).forEach(t=>{"offset"!=t&&(e[t]=this._finished?this._finalKeyframe[t]:bO(this.element,t))}),this.currentSnapshot=e}triggerCallback(e){const t="start"==e?this._onStartFns:this._onDoneFns;t.forEach(i=>i()),t.length=0}}class Qre{constructor(){this._isNativeImpl=/\{\s*\[native\s+code\]\s*\}/.test(Gz().toString()),this._cssKeyframesDriver=new Uz}validateStyleProperty(e){return dO(e)}matchesElement(e,t){return hO(e,t)}containsElement(e,t){return fO(e,t)}query(e,t,i){return pO(e,t,i)}computeStyle(e,t,i){return window.getComputedStyle(e)[t]}overrideWebAnimationsSupport(e){this._isNativeImpl=e}animate(e,t,i,r,s,o=[],a){if(!a&&!this._isNativeImpl)return this._cssKeyframesDriver.animate(e,t,i,r,s,o);const d={duration:i,delay:r,fill:0==r?"both":"forwards"};s&&(d.easing=s);const f={},p=o.filter(_=>_ instanceof $z);mz(i,r)&&p.forEach(_=>{let y=_.currentSnapshot;Object.keys(y).forEach(v=>f[v]=y[v])});const g=kz(e,t=_z(e,t=t.map(_=>sh(_,!1)),f));return new $z(e,t,d,g)}}function Gz(){return nz()&&Element.prototype.animate||{}}let ese=(()=>{class n extends QV{constructor(t,i){super(),this._nextAnimationId=0,this._renderer=t.createRenderer(i.body,{id:"0",encapsulation:Ue.None,styles:[],data:{animation:[]}})}build(t){const i=this._nextAnimationId.toString();this._nextAnimationId++;const r=Array.isArray(t)?JV(t):t;return Wz(this._renderer,null,i,"register",[r]),new tse(i,this._renderer)}}return n.\u0275fac=function(t){return new(t||n)(I(Cf),I(ut))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();class tse extends class{}{constructor(e,t){super(),this._id=e,this._renderer=t}create(e,t){return new nse(this._id,e,t||{},this._renderer)}}class nse{constructor(e,t,i,r){this.id=e,this.element=t,this._renderer=r,this.parentPlayer=null,this._started=!1,this.totalTime=0,this._command("create",i)}_listen(e,t){return this._renderer.listen(this.element,`@@${this.id}:${e}`,t)}_command(e,...t){return Wz(this._renderer,this.element,this.id,e,t)}onDone(e){this._listen("done",e)}onStart(e){this._listen("start",e)}onDestroy(e){this._listen("destroy",e)}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(e){this._command("setPosition",e)}getPosition(){var e,t;return null!==(t=null===(e=this._renderer.engine.players[+this.id])||void 0===e?void 0:e.getPosition())&&void 0!==t?t:0}}function Wz(n,e,t,i,r){return n.setProperty(e,`@@${t}:${i}`,r)}const qz="@.disabled";let ise=(()=>{class n{constructor(t,i,r){this.delegate=t,this.engine=i,this._zone=r,this._currentId=0,this._microtaskId=1,this._animationCallbacksBuffer=[],this._rendererCache=new Map,this._cdRecurDepth=0,this.promise=Promise.resolve(0),i.onRemovalComplete=(s,o)=>{o&&o.parentNode(s)&&o.removeChild(s.parentNode,s)}}createRenderer(t,i){const s=this.delegate.createRenderer(t,i);if(!(t&&i&&i.data&&i.data.animation)){let d=this._rendererCache.get(s);return d||(d=new Yz("",s,this.engine),this._rendererCache.set(s,d)),d}const o=i.id,a=i.id+"-"+this._currentId;this._currentId++,this.engine.register(a,t);const l=d=>{Array.isArray(d)?d.forEach(l):this.engine.registerTrigger(o,a,t,d.name,d)};return i.data.animation.forEach(l),new rse(this,a,s,this.engine)}begin(){this._cdRecurDepth++,this.delegate.begin&&this.delegate.begin()}_scheduleCountTask(){this.promise.then(()=>{this._microtaskId++})}scheduleListenerCallback(t,i,r){t>=0&&ti(r)):(0==this._animationCallbacksBuffer.length&&Promise.resolve(null).then(()=>{this._zone.run(()=>{this._animationCallbacksBuffer.forEach(s=>{const[o,a]=s;o(a)}),this._animationCallbacksBuffer=[]})}),this._animationCallbacksBuffer.push([i,r]))}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 n.\u0275fac=function(t){return new(t||n)(I(Cf),I(YE),I(dt))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();class Yz{constructor(e,t,i){this.namespaceId=e,this.delegate=t,this.engine=i,this.destroyNode=this.delegate.destroyNode?r=>t.destroyNode(r):null}get data(){return this.delegate.data}destroy(){this.engine.destroy(this.namespaceId,this.delegate),this.delegate.destroy()}createElement(e,t){return this.delegate.createElement(e,t)}createComment(e){return this.delegate.createComment(e)}createText(e){return this.delegate.createText(e)}appendChild(e,t){this.delegate.appendChild(e,t),this.engine.onInsert(this.namespaceId,t,e,!1)}insertBefore(e,t,i,r=!0){this.delegate.insertBefore(e,t,i),this.engine.onInsert(this.namespaceId,t,e,r)}removeChild(e,t,i){this.engine.onRemove(this.namespaceId,t,this.delegate,i)}selectRootElement(e,t){return this.delegate.selectRootElement(e,t)}parentNode(e){return this.delegate.parentNode(e)}nextSibling(e){return this.delegate.nextSibling(e)}setAttribute(e,t,i,r){this.delegate.setAttribute(e,t,i,r)}removeAttribute(e,t,i){this.delegate.removeAttribute(e,t,i)}addClass(e,t){this.delegate.addClass(e,t)}removeClass(e,t){this.delegate.removeClass(e,t)}setStyle(e,t,i,r){this.delegate.setStyle(e,t,i,r)}removeStyle(e,t,i){this.delegate.removeStyle(e,t,i)}setProperty(e,t,i){"@"==t.charAt(0)&&t==qz?this.disableAnimations(e,!!i):this.delegate.setProperty(e,t,i)}setValue(e,t){this.delegate.setValue(e,t)}listen(e,t,i){return this.delegate.listen(e,t,i)}disableAnimations(e,t){this.engine.disableAnimations(e,t)}}class rse extends Yz{constructor(e,t,i,r){super(t,i,r),this.factory=e,this.namespaceId=t}setProperty(e,t,i){"@"==t.charAt(0)?"."==t.charAt(1)&&t==qz?this.disableAnimations(e,i=void 0===i||!!i):this.engine.process(this.namespaceId,e,t.substr(1),i):this.delegate.setProperty(e,t,i)}listen(e,t,i){if("@"==t.charAt(0)){const r=function(n){switch(n){case"body":return document.body;case"document":return document;case"window":return window;default:return n}}(e);let s=t.substr(1),o="";return"@"!=s.charAt(0)&&([s,o]=function(n){const e=n.indexOf(".");return[n.substring(0,e),n.substr(e+1)]}(s)),this.engine.listen(this.namespaceId,r,s,o,a=>{this.factory.scheduleListenerCallback(a._data||-1,i,a)})}return this.delegate.listen(e,t,i)}}let ase=(()=>{class n extends YE{constructor(t,i,r){super(t.body,i,r)}ngOnDestroy(){this.flush()}}return n.\u0275fac=function(t){return new(t||n)(I(ut),I(PE),I(xO))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();const Do=new ve("AnimationModuleType"),Xz=[{provide:QV,useClass:ese},{provide:xO,useFactory:function(){return new gre}},{provide:YE,useClass:ase},{provide:Cf,useFactory:function(n,e,t){return new ise(n,e,t)},deps:[_E,YE,dt]}],Kz=[{provide:PE,useFactory:function(){return"function"==typeof Gz()?new Qre:new Uz}},{provide:Do,useValue:"BrowserAnimations"},...Xz],Zz=[{provide:PE,useClass:cz},{provide:Do,useValue:"NoopAnimations"},...Xz];let kO=(()=>{class n{static withConfig(t){return{ngModule:n,providers:t.disableAnimations?Zz:Kz}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({providers:Kz,imports:[yE]}),n})();function fse(n,e){if(1&n&&tt(0,"mat-pseudo-checkbox",4),2&n){const t=Qe();ie("state",t.selected?"checked":"unchecked")("disabled",t.disabled)}}function pse(n,e){if(1&n&&(R(0,"span",5),De(1),k()),2&n){const t=Qe();G(1),or("(",t.group.label,")")}}const gse=["*"],Qz=new ju("12.2.5"),_se=new ve("mat-sanity-checks",{providedIn:"root",factory:function(){return!0}});let $f,On=(()=>{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!(!Mo()||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")&&Qz.full!==ZV.full&&console.warn("The Angular Material version ("+Qz.full+") does not match the Angular CDK version ("+ZV.full+").\nPlease ensure the versions of these two packages exactly match.")}}return n.\u0275fac=function(t){return new(t||n)(I(XV),I(_se,8),I(ut))},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[Nv],Nv]}),n})();function jf(n){return class extends n{constructor(...e){super(...e),this._disabled=!1}get disabled(){return this._disabled}set disabled(e){this._disabled=Mt(e)}}}function Uf(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 nc(n){return class extends n{constructor(...e){super(...e),this._disableRipple=!1}get disableRipple(){return this._disableRipple}set disableRipple(e){this._disableRipple=Mt(e)}}}function Hf(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?To(t):this.defaultTabIndex}}}function FO(n){return class extends n{constructor(...e){super(...e),this.stateChanges=new Se,this.errorState=!1}updateErrorState(){const e=this.errorState,s=(this.errorStateMatcher||this._defaultErrorStateMatcher).isErrorState(this.ngControl?this.ngControl.control:null,this._parentFormGroup||this._parentForm);s!==e&&(this.errorState=s,this.stateChanges.next())}}}try{$f="undefined"!=typeof Intl}catch(n){$f=!1}let Vv=(()=>{class n{isErrorState(t,i){return!!(t&&t.invalid&&(t.touched||i&&i.submitted))}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ue({factory:function(){return new n},token:n,providedIn:"root"}),n})();class Dse{constructor(e,t,i){this._renderer=e,this.element=t,this.config=i,this.state=3}fadeOut(){this._renderer.fadeOutRipple(this)}}const ij={enterDuration:225,exitDuration:150},NO=tm({passive:!0}),rj=["mousedown","touchstart"],sj=["mouseup","mouseleave","touchend","touchcancel"];class oj{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=Wu(i))}fadeInRipple(e,t,i={}){const r=this._containerRect=this._containerRect||this._containerElement.getBoundingClientRect(),s=Object.assign(Object.assign({},ij),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 Dse(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({},ij),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=Wu(e);!t||t===this._triggerElement||(this._removeTriggerEvents(),this._triggerElement=t,this._registerEvents(rj))}handleEvent(e){"mousedown"===e.type?this._onMousedown(e):"touchstart"===e.type?this._onTouchStart(e):this._onPointerUp(),this._pointerUpEventsRegistered||(this._registerEvents(sj),this._pointerUpEventsRegistered=!0)}_onMousedown(e){const t=VV(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,NO)})})}_removeTriggerEvents(){this._triggerElement&&(rj.forEach(e=>{this._triggerElement.removeEventListener(e,this,NO)}),this._pointerUpEventsRegistered&&sj.forEach(e=>{this._triggerElement.removeEventListener(e,this,NO)}))}}const aj=new ve("mat-ripple-global-options");let Js=(()=>{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 oj(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)(E(rt),E(dt),E(si),E(aj,8),E(Do,8))},n.\u0275dir=oe({type:n,selectors:[["","mat-ripple",""],["","matRipple",""]],hostAttrs:[1,"mat-ripple"],hostVars:2,hostBindings:function(t,i){2&t&&st("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})(),_l=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[On,Rv],On]}),n})(),lj=(()=>{class n{constructor(t){this._animationMode=t,this.state="unchecked",this.disabled=!1}}return n.\u0275fac=function(t){return new(t||n)(E(Do,8))},n.\u0275cmp=Ne({type:n,selectors:[["mat-pseudo-checkbox"]],hostAttrs:[1,"mat-pseudo-checkbox"],hostVars:8,hostBindings:function(t,i){2&t&&st("mat-pseudo-checkbox-indeterminate","indeterminate"===i.state)("mat-pseudo-checkbox-checked","checked"===i.state)("mat-pseudo-checkbox-disabled",i.disabled)("_mat-animation-noopable","NoopAnimations"===i._animationMode)},inputs:{state:"state",disabled:"disabled"},decls:0,vars:0,template:function(t,i){},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}),n})(),LO=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[On]]}),n})();const QE=new ve("MAT_OPTION_PARENT_COMPONENT"),Rse=jf(class{});let kse=0,cj=(()=>{class n extends Rse{constructor(t){var i;super(),this._labelId="mat-optgroup-label-"+kse++,this._inert=null!==(i=null==t?void 0:t.inertGroups)&&void 0!==i&&i}}return n.\u0275fac=function(t){return new(t||n)(E(QE,8))},n.\u0275dir=oe({type:n,inputs:{label:"label"},features:[ct]}),n})();const JE=new ve("MatOptgroup");let Fse=0;class uj{constructor(e,t=!1){this.source=e,this.isUserInput=t}}let Nse=(()=>{class n{constructor(t,i,r,s){this._element=t,this._changeDetectorRef=i,this._parent=r,this.group=s,this._selected=!1,this._active=!1,this._disabled=!1,this._mostRecentViewValue="",this.id="mat-option-"+Fse++,this.onSelectionChange=new Le,this._stateChanges=new Se}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=Mt(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,i){const r=this._getHostElement();"function"==typeof r.focus&&r.focus(i)}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)&&!Zs(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 uj(this,t))}}return n.\u0275fac=function(t){return new(t||n)(E(rt),E(kn),E(void 0),E(cj))},n.\u0275dir=oe({type:n,inputs:{id:"id",disabled:"disabled",value:"value"},outputs:{onSelectionChange:"onSelectionChange"}}),n})(),eS=(()=>{class n extends Nse{constructor(t,i,r,s){super(t,i,r,s)}}return n.\u0275fac=function(t){return new(t||n)(E(rt),E(kn),E(QE,8),E(JE,8))},n.\u0275cmp=Ne({type:n,selectors:[["mat-option"]],hostAttrs:["role","option",1,"mat-option","mat-focus-indicator"],hostVars:12,hostBindings:function(t,i){1&t&&ge("click",function(){return i._selectViaInteraction()})("keydown",function(s){return i._handleKeydown(s)}),2&t&&(al("id",i.id),nn("tabindex",i._getTabIndex())("aria-selected",i._getAriaSelected())("aria-disabled",i.disabled.toString()),st("mat-selected",i.selected)("mat-option-multiple",i.multiple)("mat-active",i.active)("mat-option-disabled",i.disabled))},exportAs:["matOption"],features:[ct],ngContentSelectors:gse,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,i){1&t&&(wi(),mt(0,fse,1,2,"mat-pseudo-checkbox",0),R(1,"span",1),Ht(2),k(),mt(3,pse,2,1,"span",2),tt(4,"div",3)),2&t&&(ie("ngIf",i.multiple),G(3),ie("ngIf",i.group&&i.group._inert),G(1),ie("matRippleTrigger",i._getHostElement())("matRippleDisabled",i.disabled||i.disableRipple))},directives:[zr,Js,lj],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}),n})();function BO(n,e,t){if(t.length){let i=e.toArray(),r=t.toArray(),s=0;for(let o=0;o{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[_l,dn,On,LO]]}),n})();function Wc(n,e,t,i){return Ke(t)&&(i=t,t=void 0),i?Wc(n,e,t).pipe(Ae(r=>we(r)?i(...r):i(r))):new ce(r=>{hj(n,e,function(o){r.next(arguments.length>1?Array.prototype.slice.call(arguments):o)},r,t)})}function hj(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 enter",[ti({opacity:0,transform:"translateY(-5px)"}),Ao("300ms cubic-bezier(0.55, 0, 0.55, 0.2)")])])};let jv=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275dir=oe({type:n}),n})();const pj=new ve("MatHint");let Gf=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275dir=oe({type:n,selectors:[["mat-label"]]}),n})(),ooe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275dir=oe({type:n,selectors:[["mat-placeholder"]]}),n})();const gj=new ve("MatPrefix"),mj=new ve("MatSuffix");let VO=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275dir=oe({type:n,selectors:[["","matSuffix",""]],features:[Dt([{provide:mj,useExisting:n}])]}),n})(),_j=0;const coe=Uf(class{constructor(n){this._elementRef=n}},"primary"),vj=new ve("MAT_FORM_FIELD_DEFAULT_OPTIONS"),nS=new ve("MatFormField");let am=(()=>{class n extends coe{constructor(t,i,r,s,o,a,l,c){super(t),this._changeDetectorRef=i,this._dir=s,this._defaults=o,this._platform=a,this._ngZone=l,this._outlineGapCalculationNeededImmediately=!1,this._outlineGapCalculationNeededOnStable=!1,this._destroyed=new Se,this._showAlwaysAnimate=!1,this._subscriptAnimationState="",this._hintLabel="",this._hintLabelId="mat-hint-"+_j++,this._labelId="mat-form-field-label-"+_j++,this.floatLabel=this._getDefaultFloatLabelState(),this._animationsEnabled="NoopAnimations"!==c,this.appearance=o&&o.appearance?o.appearance:"legacy",this._hideRequiredMarker=!(!o||null==o.hideRequiredMarker)&&o.hideRequiredMarker}get appearance(){return this._appearance}set appearance(t){const i=this._appearance;this._appearance=t||this._defaults&&this._defaults.appearance||"legacy","outline"===this._appearance&&i!==t&&(this._outlineGapCalculationNeededOnStable=!0)}get hideRequiredMarker(){return this._hideRequiredMarker}set hideRequiredMarker(t){this._hideRequiredMarker=Mt(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(Rr(null)).subscribe(()=>{this._validatePlaceholders(),this._syncDescribedByIds(),this._changeDetectorRef.markForCheck()}),t.ngControl&&t.ngControl.valueChanges&&t.ngControl.valueChanges.pipe(Tn(this._destroyed)).subscribe(()=>this._changeDetectorRef.markForCheck()),this._ngZone.runOutsideAngular(()=>{this._ngZone.onStable.pipe(Tn(this._destroyed)).subscribe(()=>{this._outlineGapCalculationNeededOnStable&&this.updateOutlineGap()})}),Ni(this._prefixChildren.changes,this._suffixChildren.changes).subscribe(()=>{this._outlineGapCalculationNeededOnStable=!0,this._changeDetectorRef.markForCheck()}),this._hintChildren.changes.pipe(Rr(null)).subscribe(()=>{this._processHints(),this._changeDetectorRef.markForCheck()}),this._errorChildren.changes.pipe(Rr(null)).subscribe(()=>{this._syncDescribedByIds(),this._changeDetectorRef.markForCheck()}),this._dir&&this._dir.change.pipe(Tn(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 i=this._control?this._control.ngControl:null;return i&&i[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,Wc(this._label.nativeElement,"transitionend").pipe(yi(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 i=this._hintChildren?this._hintChildren.find(s=>"start"===s.align):null,r=this._hintChildren?this._hintChildren.find(s=>"end"===s.align):null;i?t.push(i.id):this._hintLabel&&t.push(this._hintLabelId),r&&t.push(r.id)}else this._errorChildren&&t.push(...this._errorChildren.map(i=>i.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 i=0,r=0;const s=this._connectionContainerRef.nativeElement,o=s.querySelectorAll(".mat-form-field-outline-start"),a=s.querySelectorAll(".mat-form-field-outline-gap");if(this._label&&this._label.nativeElement.children.length){const l=s.getBoundingClientRect();if(0===l.width&&0===l.height)return this._outlineGapCalculationNeededOnStable=!0,void(this._outlineGapCalculationNeededImmediately=!1);const c=this._getStartEnd(l),d=t.children,f=this._getStartEnd(d[0].getBoundingClientRect());let p=0;for(let g=0;g0?.75*p+10:0}for(let l=0;l{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,On,SE],On]}),n})();function Hv(...n){if(1===n.length){const e=n[0];if(we(e))return iS(e,null);if(_e(e)&&Object.getPrototypeOf(e)===Object.prototype){const t=Object.keys(e);return iS(t.map(i=>e[i]),t)}}if("function"==typeof n[n.length-1]){const e=n.pop();return iS(n=1===n.length&&we(n[0])?n[0]:n,null).pipe(Ae(t=>e(...t)))}return iS(n,null)}function iS(n,e){return new ce(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 Ta(n){return function(t){const i=new uoe(n),r=t.lift(i);return i.caught=r}}class uoe{constructor(e){this.selector=e}call(e,t){return t.subscribe(new doe(e,this.selector,this.caught))}}class doe extends ii{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 Gr(this);this.add(i);const r=co(t,i);r!==i&&this.add(r)}}}class hoe{constructor(e){this.callback=e}call(e,t){return t.subscribe(new foe(e,this.callback))}}class foe extends xt{constructor(e,t){super(e),this.add(new Te(t))}}class Cj{}class wj{}class Yu{constructor(e){this.normalizedNames=new Map,this.lazyUpdate=null,e?this.lazyInit="string"==typeof e?()=>{this.headers=new Map,e.split("\n").forEach(t=>{const i=t.indexOf(":");if(i>0){const r=t.slice(0,i),s=r.toLowerCase(),o=t.slice(i+1).trim();this.maybeSetNormalizedName(r,s),this.headers.has(s)?this.headers.get(s).push(o):this.headers.set(s,[o])}})}:()=>{this.headers=new Map,Object.keys(e).forEach(t=>{let i=e[t];const r=t.toLowerCase();"string"==typeof i&&(i=[i]),i.length>0&&(this.headers.set(r,i),this.maybeSetNormalizedName(t,r))})}:this.headers=new Map}has(e){return this.init(),this.headers.has(e.toLowerCase())}get(e){this.init();const t=this.headers.get(e.toLowerCase());return t&&t.length>0?t[0]:null}keys(){return this.init(),Array.from(this.normalizedNames.values())}getAll(e){return this.init(),this.headers.get(e.toLowerCase())||null}append(e,t){return this.clone({name:e,value:t,op:"a"})}set(e,t){return this.clone({name:e,value:t,op:"s"})}delete(e,t){return this.clone({name:e,value:t,op:"d"})}maybeSetNormalizedName(e,t){this.normalizedNames.has(t)||this.normalizedNames.set(t,e)}init(){this.lazyInit&&(this.lazyInit instanceof Yu?this.copyFrom(this.lazyInit):this.lazyInit(),this.lazyInit=null,this.lazyUpdate&&(this.lazyUpdate.forEach(e=>this.applyUpdate(e)),this.lazyUpdate=null))}copyFrom(e){e.init(),Array.from(e.headers.keys()).forEach(t=>{this.headers.set(t,e.headers.get(t)),this.normalizedNames.set(t,e.normalizedNames.get(t))})}clone(e){const t=new Yu;return t.lazyInit=this.lazyInit&&this.lazyInit instanceof Yu?this.lazyInit:this,t.lazyUpdate=(this.lazyUpdate||[]).concat([e]),t}applyUpdate(e){const t=e.name.toLowerCase();switch(e.op){case"a":case"s":let i=e.value;if("string"==typeof i&&(i=[i]),0===i.length)return;this.maybeSetNormalizedName(e.name,t);const r=("a"===e.op?this.headers.get(t):void 0)||[];r.push(...i),this.headers.set(t,r);break;case"d":const s=e.value;if(s){let o=this.headers.get(t);if(!o)return;o=o.filter(a=>-1===s.indexOf(a)),0===o.length?(this.headers.delete(t),this.normalizedNames.delete(t)):this.headers.set(t,o)}else this.headers.delete(t),this.normalizedNames.delete(t)}}forEach(e){this.init(),Array.from(this.normalizedNames.keys()).forEach(t=>e(this.normalizedNames.get(t),this.headers.get(t)))}}class poe{encodeKey(e){return Ej(e)}encodeValue(e){return Ej(e)}decodeKey(e){return decodeURIComponent(e)}decodeValue(e){return decodeURIComponent(e)}}const moe=/%(\d[a-f0-9])/gi,_oe={40:"@","3A":":",24:"$","2C":",","3B":";","2B":"+","3D":"=","3F":"?","2F":"/"};function Ej(n){return encodeURIComponent(n).replace(moe,(e,t)=>{var i;return null!==(i=_oe[t])&&void 0!==i?i:e})}function Sj(n){return`${n}`}class oh{constructor(e={}){if(this.updates=null,this.cloneFrom=null,this.encoder=e.encoder||new poe,e.fromString){if(e.fromObject)throw new Error("Cannot specify both fromString and fromObject.");this.map=function(n,e){const t=new Map;return n.length>0&&n.replace(/^\?/,"").split("&").forEach(r=>{const s=r.indexOf("="),[o,a]=-1==s?[e.decodeKey(r),""]:[e.decodeKey(r.slice(0,s)),e.decodeValue(r.slice(s+1))],l=t.get(o)||[];l.push(a),t.set(o,l)}),t}(e.fromString,this.encoder)}else e.fromObject?(this.map=new Map,Object.keys(e.fromObject).forEach(t=>{const i=e.fromObject[t];this.map.set(t,Array.isArray(i)?i:[i])})):this.map=null}has(e){return this.init(),this.map.has(e)}get(e){this.init();const t=this.map.get(e);return t?t[0]:null}getAll(e){return this.init(),this.map.get(e)||null}keys(){return this.init(),Array.from(this.map.keys())}append(e,t){return this.clone({param:e,value:t,op:"a"})}appendAll(e){const t=[];return Object.keys(e).forEach(i=>{const r=e[i];Array.isArray(r)?r.forEach(s=>{t.push({param:i,value:s,op:"a"})}):t.push({param:i,value:r,op:"a"})}),this.clone(t)}set(e,t){return this.clone({param:e,value:t,op:"s"})}delete(e,t){return this.clone({param:e,value:t,op:"d"})}toString(){return this.init(),this.keys().map(e=>{const t=this.encoder.encodeKey(e);return this.map.get(e).map(i=>t+"="+this.encoder.encodeValue(i)).join("&")}).filter(e=>""!==e).join("&")}clone(e){const t=new oh({encoder:this.encoder});return t.cloneFrom=this.cloneFrom||this,t.updates=(this.updates||[]).concat(e),t}init(){null===this.map&&(this.map=new Map),null!==this.cloneFrom&&(this.cloneFrom.init(),this.cloneFrom.keys().forEach(e=>this.map.set(e,this.cloneFrom.map.get(e))),this.updates.forEach(e=>{switch(e.op){case"a":case"s":const t=("a"===e.op?this.map.get(e.param):void 0)||[];t.push(Sj(e.value)),this.map.set(e.param,t);break;case"d":if(void 0===e.value){this.map.delete(e.param);break}{let i=this.map.get(e.param)||[];const r=i.indexOf(Sj(e.value));-1!==r&&i.splice(r,1),i.length>0?this.map.set(e.param,i):this.map.delete(e.param)}}}),this.cloneFrom=this.updates=null)}}class yoe{constructor(){this.map=new Map}set(e,t){return this.map.set(e,t),this}get(e){return this.map.has(e)||this.map.set(e,e.defaultValue()),this.map.get(e)}delete(e){return this.map.delete(e),this}keys(){return this.map.keys()}}function Mj(n){return"undefined"!=typeof ArrayBuffer&&n instanceof ArrayBuffer}function xj(n){return"undefined"!=typeof Blob&&n instanceof Blob}function Tj(n){return"undefined"!=typeof FormData&&n instanceof FormData}class $v{constructor(e,t,i,r){let s;if(this.url=t,this.body=null,this.reportProgress=!1,this.withCredentials=!1,this.responseType="json",this.method=e.toUpperCase(),function(n){switch(n){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,s=r):s=i,s&&(this.reportProgress=!!s.reportProgress,this.withCredentials=!!s.withCredentials,s.responseType&&(this.responseType=s.responseType),s.headers&&(this.headers=s.headers),s.context&&(this.context=s.context),s.params&&(this.params=s.params)),this.headers||(this.headers=new Yu),this.context||(this.context=new yoe),this.params){const o=this.params.toString();if(0===o.length)this.urlWithParams=t;else{const a=t.indexOf("?");this.urlWithParams=t+(-1===a?"?":ap.set(g,e.setHeaders[g]),c)),e.setParams&&(d=Object.keys(e.setParams).reduce((p,g)=>p.set(g,e.setParams[g]),d)),new $v(i,r,o,{params:d,headers:c,context:f,reportProgress:l,responseType:s,withCredentials:a})}}var Ur=(()=>((Ur=Ur||{})[Ur.Sent=0]="Sent",Ur[Ur.UploadProgress=1]="UploadProgress",Ur[Ur.ResponseHeader=2]="ResponseHeader",Ur[Ur.DownloadProgress=3]="DownloadProgress",Ur[Ur.Response=4]="Response",Ur[Ur.User=5]="User",Ur))();class zO{constructor(e,t=200,i="OK"){this.headers=e.headers||new Yu,this.status=void 0!==e.status?e.status:t,this.statusText=e.statusText||i,this.url=e.url||null,this.ok=this.status>=200&&this.status<300}}class jO extends zO{constructor(e={}){super(e),this.type=Ur.ResponseHeader}clone(e={}){return new jO({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})}}class rS extends zO{constructor(e={}){super(e),this.type=Ur.Response,this.body=void 0!==e.body?e.body:null}clone(e={}){return new rS({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})}}class Aj extends zO{constructor(e){super(e,0,"Unknown Error"),this.name="HttpErrorResponse",this.ok=!1,this.message=this.status>=200&&this.status<300?`Http failure during parsing for ${e.url||"(unknown url)"}`:`Http failure response for ${e.url||"(unknown url)"}: ${e.status} ${e.statusText}`,this.error=e.error||null}}function UO(n,e){return{body:e,headers:n.headers,context:n.context,observe:n.observe,params:n.params,reportProgress:n.reportProgress,responseType:n.responseType,withCredentials:n.withCredentials}}let Wf=(()=>{class n{constructor(t){this.handler=t}request(t,i,r={}){let s;if(t instanceof $v)s=t;else{let l,c;l=r.headers instanceof Yu?r.headers:new Yu(r.headers),r.params&&(c=r.params instanceof oh?r.params:new oh({fromObject:r.params})),s=new $v(t,i,void 0!==r.body?r.body:null,{headers:l,context:r.context,params:c,reportProgress:r.reportProgress,responseType:r.responseType||"json",withCredentials:r.withCredentials})}const o=ht(s).pipe(function(n,e){return di(n,e,1)}(l=>this.handler.handle(l)));if(t instanceof $v||"events"===r.observe)return o;const a=o.pipe(Fn(l=>l instanceof rS));switch(r.observe||"body"){case"body":switch(s.responseType){case"arraybuffer":return a.pipe(Ae(l=>{if(null!==l.body&&!(l.body instanceof ArrayBuffer))throw new Error("Response is not an ArrayBuffer.");return l.body}));case"blob":return a.pipe(Ae(l=>{if(null!==l.body&&!(l.body instanceof Blob))throw new Error("Response is not a Blob.");return l.body}));case"text":return a.pipe(Ae(l=>{if(null!==l.body&&"string"!=typeof l.body)throw new Error("Response is not a string.");return l.body}));case"json":default:return a.pipe(Ae(l=>l.body))}case"response":return a;default:throw new Error(`Unreachable: unhandled observe type ${r.observe}}`)}}delete(t,i={}){return this.request("DELETE",t,i)}get(t,i={}){return this.request("GET",t,i)}head(t,i={}){return this.request("HEAD",t,i)}jsonp(t,i){return this.request("JSONP",t,{params:(new oh).append(i,"JSONP_CALLBACK"),observe:"body",responseType:"json"})}options(t,i={}){return this.request("OPTIONS",t,i)}patch(t,i,r={}){return this.request("PATCH",t,UO(r,i))}post(t,i,r={}){return this.request("POST",t,UO(r,i))}put(t,i,r={}){return this.request("PUT",t,UO(r,i))}}return n.\u0275fac=function(t){return new(t||n)(I(Cj))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();class Dj{constructor(e,t){this.next=e,this.interceptor=t}handle(e){return this.interceptor.intercept(e,this.next)}}const Oj=new ve("HTTP_INTERCEPTORS");let Coe=(()=>{class n{intercept(t,i){return i.handle(t)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();const woe=/^\)\]\}',?\n/;let Ij=(()=>{class n{constructor(t){this.xhrFactory=t}handle(t){if("JSONP"===t.method)throw new Error("Attempted to construct Jsonp request without HttpClientJsonpModule installed.");return new ce(i=>{const r=this.xhrFactory.build();if(r.open(t.method,t.urlWithParams),t.withCredentials&&(r.withCredentials=!0),t.headers.forEach((g,_)=>r.setRequestHeader(g,_.join(","))),t.headers.has("Accept")||r.setRequestHeader("Accept","application/json, text/plain, */*"),!t.headers.has("Content-Type")){const g=t.detectContentTypeHeader();null!==g&&r.setRequestHeader("Content-Type",g)}if(t.responseType){const g=t.responseType.toLowerCase();r.responseType="json"!==g?g:"text"}const s=t.serializeBody();let o=null;const a=()=>{if(null!==o)return o;const g=1223===r.status?204:r.status,_=r.statusText||"OK",y=new Yu(r.getAllResponseHeaders()),v=function(n){return"responseURL"in n&&n.responseURL?n.responseURL:/^X-Request-URL:/m.test(n.getAllResponseHeaders())?n.getResponseHeader("X-Request-URL"):null}(r)||t.url;return o=new jO({headers:y,status:g,statusText:_,url:v}),o},l=()=>{let{headers:g,status:_,statusText:y,url:v}=a(),C=null;204!==_&&(C=void 0===r.response?r.responseText:r.response),0===_&&(_=C?200:0);let w=_>=200&&_<300;if("json"===t.responseType&&"string"==typeof C){const x=C;C=C.replace(woe,"");try{C=""!==C?JSON.parse(C):null}catch(N){C=x,w&&(w=!1,C={error:N,text:C})}}w?(i.next(new rS({body:C,headers:g,status:_,statusText:y,url:v||void 0})),i.complete()):i.error(new Aj({error:C,headers:g,status:_,statusText:y,url:v||void 0}))},c=g=>{const{url:_}=a(),y=new Aj({error:g,status:r.status||0,statusText:r.statusText||"Unknown Error",url:_||void 0});i.error(y)};let d=!1;const f=g=>{d||(i.next(a()),d=!0);let _={type:Ur.DownloadProgress,loaded:g.loaded};g.lengthComputable&&(_.total=g.total),"text"===t.responseType&&!!r.responseText&&(_.partialText=r.responseText),i.next(_)},p=g=>{let _={type:Ur.UploadProgress,loaded:g.loaded};g.lengthComputable&&(_.total=g.total),i.next(_)};return r.addEventListener("load",l),r.addEventListener("error",c),r.addEventListener("timeout",c),r.addEventListener("abort",c),t.reportProgress&&(r.addEventListener("progress",f),null!==s&&r.upload&&r.upload.addEventListener("progress",p)),r.send(s),i.next({type:Ur.Sent}),()=>{r.removeEventListener("error",c),r.removeEventListener("abort",c),r.removeEventListener("load",l),r.removeEventListener("timeout",c),t.reportProgress&&(r.removeEventListener("progress",f),null!==s&&r.upload&&r.upload.removeEventListener("progress",p)),r.readyState!==r.DONE&&r.abort()}})}}return n.\u0275fac=function(t){return new(t||n)(I(aV))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();const HO=new ve("XSRF_COOKIE_NAME"),$O=new ve("XSRF_HEADER_NAME");class Pj{}let Soe=(()=>{class n{constructor(t,i,r){this.doc=t,this.platform=i,this.cookieName=r,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=Y3(t,this.cookieName),this.lastCookieString=t),this.lastToken}}return n.\u0275fac=function(t){return new(t||n)(I(ut),I(dl),I(HO))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})(),GO=(()=>{class n{constructor(t,i){this.tokenService=t,this.headerName=i}intercept(t,i){const r=t.url.toLowerCase();if("GET"===t.method||"HEAD"===t.method||r.startsWith("http://")||r.startsWith("https://"))return i.handle(t);const s=this.tokenService.getToken();return null!==s&&!t.headers.has(this.headerName)&&(t=t.clone({headers:t.headers.set(this.headerName,s)})),i.handle(t)}}return n.\u0275fac=function(t){return new(t||n)(I(Pj),I($O))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})(),Moe=(()=>{class n{constructor(t,i){this.backend=t,this.injector=i,this.chain=null}handle(t){if(null===this.chain){const i=this.injector.get(Oj,[]);this.chain=i.reduceRight((r,s)=>new Dj(r,s),this.backend)}return this.chain.handle(t)}}return n.\u0275fac=function(t){return new(t||n)(I(wj),I(Nt))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})(),xoe=(()=>{class n{static disable(){return{ngModule:n,providers:[{provide:GO,useClass:Coe}]}}static withOptions(t={}){return{ngModule:n,providers:[t.cookieName?{provide:HO,useValue:t.cookieName}:[],t.headerName?{provide:$O,useValue:t.headerName}:[]]}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({providers:[GO,{provide:Oj,useExisting:GO,multi:!0},{provide:Pj,useClass:Soe},{provide:HO,useValue:"XSRF-TOKEN"},{provide:$O,useValue:"X-XSRF-TOKEN"}]}),n})(),Rj=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({providers:[Wf,{provide:Cj,useClass:Moe},Ij,{provide:wj,useExisting:Ij}],imports:[[xoe.withOptions({cookieName:"XSRF-TOKEN",headerName:"X-XSRF-TOKEN"})]]}),n})();const Toe=["*"];function kj(n){return Error(`Unable to find icon with the name "${n}"`)}function Fj(n){return Error(`The URL provided to MatIconRegistry was not trusted as a resource URL via Angular's DomSanitizer. Attempted URL was "${n}".`)}function Nj(n){return Error(`The literal provided to MatIconRegistry was not trusted as safe HTML by Angular's DomSanitizer. Attempted literal was "${n}".`)}class qf{constructor(e,t,i){this.url=e,this.svgText=t,this.options=i}}let Gv=(()=>{class n{constructor(t,i,r,s){this._httpClient=t,this._sanitizer=i,this._errorHandler=s,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=r}addSvgIcon(t,i,r){return this.addSvgIconInNamespace("",t,i,r)}addSvgIconLiteral(t,i,r){return this.addSvgIconLiteralInNamespace("",t,i,r)}addSvgIconInNamespace(t,i,r,s){return this._addSvgIconConfig(t,i,new qf(r,null,s))}addSvgIconResolver(t){return this._resolvers.push(t),this}addSvgIconLiteralInNamespace(t,i,r,s){const o=this._sanitizer.sanitize(mn.HTML,r);if(!o)throw Nj(r);return this._addSvgIconConfig(t,i,new qf("",o,s))}addSvgIconSet(t,i){return this.addSvgIconSetInNamespace("",t,i)}addSvgIconSetLiteral(t,i){return this.addSvgIconSetLiteralInNamespace("",t,i)}addSvgIconSetInNamespace(t,i,r){return this._addSvgIconSetConfig(t,new qf(i,null,r))}addSvgIconSetLiteralInNamespace(t,i,r){const s=this._sanitizer.sanitize(mn.HTML,i);if(!s)throw Nj(i);return this._addSvgIconSetConfig(t,new qf("",s,r))}registerFontClassAlias(t,i=t){return this._fontCssClassesByAlias.set(t,i),this}classNameForFontAlias(t){return this._fontCssClassesByAlias.get(t)||t}setDefaultFontSetClass(t){return this._defaultFontSetClass=t,this}getDefaultFontSetClass(){return this._defaultFontSetClass}getSvgIconFromUrl(t){const i=this._sanitizer.sanitize(mn.RESOURCE_URL,t);if(!i)throw Fj(t);const r=this._cachedIconsByUrl.get(i);return r?ht(sS(r)):this._loadSvgIconFromConfig(new qf(t,null)).pipe(Ti(s=>this._cachedIconsByUrl.set(i,s)),Ae(s=>sS(s)))}getNamedSvgIcon(t,i=""){const r=Lj(i,t);let s=this._svgIconConfigs.get(r);if(s)return this._getSvgFromConfig(s);if(s=this._getIconConfigFromResolvers(i,t),s)return this._svgIconConfigs.set(r,s),this._getSvgFromConfig(s);const o=this._iconSetConfigs.get(i);return o?this._getSvgFromIconSetConfigs(t,o):Kg(kj(r))}ngOnDestroy(){this._resolvers=[],this._svgIconConfigs.clear(),this._iconSetConfigs.clear(),this._cachedIconsByUrl.clear()}_getSvgFromConfig(t){return t.svgText?ht(sS(this._svgElementFromConfig(t))):this._loadSvgIconFromConfig(t).pipe(Ae(i=>sS(i)))}_getSvgFromIconSetConfigs(t,i){const r=this._extractIconWithNameFromAnySet(t,i);return r?ht(r):Hv(i.filter(o=>!o.svgText).map(o=>this._loadSvgIconSetFromConfig(o).pipe(Ta(a=>{const c=`Loading icon set URL: ${this._sanitizer.sanitize(mn.RESOURCE_URL,o.url)} failed: ${a.message}`;return this._errorHandler.handleError(new Error(c)),ht(null)})))).pipe(Ae(()=>{const o=this._extractIconWithNameFromAnySet(t,i);if(!o)throw kj(t);return o}))}_extractIconWithNameFromAnySet(t,i){for(let r=i.length-1;r>=0;r--){const s=i[r];if(s.svgText&&s.svgText.indexOf(t)>-1){const o=this._svgElementFromConfig(s),a=this._extractSvgIconFromSet(o,t,s.options);if(a)return a}}return null}_loadSvgIconFromConfig(t){return this._fetchIcon(t).pipe(Ti(i=>t.svgText=i),Ae(()=>this._svgElementFromConfig(t)))}_loadSvgIconSetFromConfig(t){return t.svgText?ht(null):this._fetchIcon(t).pipe(Ti(i=>t.svgText=i))}_extractSvgIconFromSet(t,i,r){const s=t.querySelector(`[id="${i}"]`);if(!s)return null;const o=s.cloneNode(!0);if(o.removeAttribute("id"),"svg"===o.nodeName.toLowerCase())return this._setSvgAttributes(o,r);if("symbol"===o.nodeName.toLowerCase())return this._setSvgAttributes(this._toSvgElement(o),r);const a=this._svgElementFromString("");return a.appendChild(o),this._setSvgAttributes(a,r)}_svgElementFromString(t){const i=this._document.createElement("DIV");i.innerHTML=t;const r=i.querySelector("svg");if(!r)throw Error(" tag not found");return r}_toSvgElement(t){const i=this._svgElementFromString(""),r=t.attributes;for(let s=0;se.lift(new hoe(n))}(()=>this._inProgressUrlFetches.delete(a)),Vs());return this._inProgressUrlFetches.set(a,c),c}_addSvgIconConfig(t,i,r){return this._svgIconConfigs.set(Lj(t,i),r),this}_addSvgIconSetConfig(t,i){const r=this._iconSetConfigs.get(t);return r?r.push(i):this._iconSetConfigs.set(t,[i]),this}_svgElementFromConfig(t){if(!t.svgElement){const i=this._svgElementFromString(t.svgText);this._setSvgAttributes(i,t.options),t.svgElement=i}return t.svgElement}_getIconConfigFromResolvers(t,i){for(let r=0;re?e.pathname+e.search:""}}}),Bj=["clip-path","color-profile","src","cursor","fill","filter","marker","marker-start","marker-mid","marker-end","mask","stroke"],Foe=Bj.map(n=>`[${n}]`).join(", "),Noe=/^url\(['"]?#(.*?)['"]?\)$/;let rs=(()=>{class n extends Ioe{constructor(t,i,r,s,o){super(t),this._iconRegistry=i,this._location=s,this._errorHandler=o,this._inline=!1,this._currentIconFetch=Te.EMPTY,r||t.nativeElement.setAttribute("aria-hidden","true")}get inline(){return this._inline}set inline(t){this._inline=Mt(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 i=this._cleanupFontValue(t);i!==this._fontSet&&(this._fontSet=i,this._updateFontIconClasses())}get fontIcon(){return this._fontIcon}set fontIcon(t){const i=this._cleanupFontValue(t);i!==this._fontIcon&&(this._fontIcon=i,this._updateFontIconClasses())}_splitIconName(t){if(!t)return["",""];const i=t.split(":");switch(i.length){case 1:return["",i[0]];case 2:return i;default:throw Error(`Invalid icon name: "${t}"`)}}ngOnInit(){this._updateFontIconClasses()}ngAfterViewChecked(){const t=this._elementsWithExternalReferences;if(t&&t.size){const i=this._location.getPathname();i!==this._previousPath&&(this._previousPath=i,this._prependPathToReferences(i))}}ngOnDestroy(){this._currentIconFetch.unsubscribe(),this._elementsWithExternalReferences&&this._elementsWithExternalReferences.clear()}_usingFontIcon(){return!this.svgIcon}_setSvgElement(t){this._clearSvgElement();const i=t.querySelectorAll("style");for(let s=0;s{r.forEach(o=>{s.setAttribute(o.name,`url('${t}#${o.value}')`)})})}_cacheChildrenWithExternalReferences(t){const i=t.querySelectorAll(Foe),r=this._elementsWithExternalReferences=this._elementsWithExternalReferences||new Map;for(let s=0;s{const a=i[s],l=a.getAttribute(o),c=l?l.match(Noe):null;if(c){let d=r.get(a);d||(d=[],r.set(a,d)),d.push({name:o,value:c[1]})}})}_updateSvgIcon(t){if(this._svgNamespace=null,this._svgName=null,this._currentIconFetch.unsubscribe(),t){const[i,r]=this._splitIconName(t);i&&(this._svgNamespace=i),r&&(this._svgName=r),this._currentIconFetch=this._iconRegistry.getNamedSvgIcon(r,i).pipe(yi(1)).subscribe(s=>this._setSvgElement(s),s=>{this._errorHandler.handleError(new Error(`Error retrieving icon ${i}:${r}! ${s.message}`))})}}}return n.\u0275fac=function(t){return new(t||n)(E(rt),E(Gv),Zr("aria-hidden"),E(Poe),E($o))},n.\u0275cmp=Ne({type:n,selectors:[["mat-icon"]],hostAttrs:["role","img",1,"mat-icon","notranslate"],hostVars:7,hostBindings:function(t,i){2&t&&(nn("data-mat-icon-type",i._usingFontIcon()?"font":"svg")("data-mat-icon-name",i._svgName||i.fontIcon)("data-mat-icon-namespace",i._svgNamespace||i.fontSet),st("mat-icon-inline",i.inline)("mat-icon-no-color","primary"!==i.color&&"accent"!==i.color&&"warn"!==i.color))},inputs:{color:"color",inline:"inline",svgIcon:"svgIcon",fontSet:"fontSet",fontIcon:"fontIcon"},exportAs:["matIcon"],features:[ct],ngContentSelectors:Toe,decls:1,vars:0,template:function(t,i){1&t&&(wi(),Ht(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}),n})(),lr=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[On],On]}),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=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 zoe=1;const joe=Promise.resolve(),oS={};function Vj(n){return n in oS&&(delete oS[n],!0)}const zj={setImmediate(n){const e=zoe++;return oS[e]=!0,joe.then(()=>Vj(e)&&n()),e},clearImmediate(n){Vj(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=zj.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&&(zj.clearImmediate(t),e.scheduled=void 0)}});function cm(n){return!!n&&(n instanceof ce||"function"==typeof n.lift&&"function"==typeof n.subscribe)}class Woe{constructor(e){this.durationSelector=e}call(e,t){return t.subscribe(new qoe(e,this.durationSelector))}}class qoe extends ii{constructor(e,t){super(e),this.durationSelector=t,this.hasValue=!1}_next(e){if(this.value=e,this.hasValue=!0,!this.throttled){let t;try{const{durationSelector:r}=this;t=r(e)}catch(r){return this.destination.error(r)}const i=co(t,new Gr(this));!i||i.closed?this.clearThrottle():this.add(this.throttled=i)}}clearThrottle(){const{value:e,hasValue:t,throttled:i}=this;i&&(this.remove(i),this.throttled=void 0,i.unsubscribe()),t&&(this.value=void 0,this.hasValue=!1,this.destination.next(e))}notifyNext(){this.clearThrottle()}notifyComplete(){this.clearThrottle()}}function WO(n){return!we(n)&&n-parseFloat(n)+1>=0}function Xoe(n){const{index:e,period:t,subscriber:i}=n;if(i.next(e),!i.closed){if(-1===t)return i.complete();n.index=e+1,this.schedule(n,t)}}function aS(n,e=Pf){return function(n){return function(t){return t.lift(new Woe(n))}}(()=>function(n=0,e,t){let i=-1;return WO(e)?i=Number(e)<1?1:Number(e):Gn(e)&&(t=e),Gn(t)||(t=Pf),new ce(r=>{const s=WO(n)?n:+n-t.now();return t.schedule(Xoe,s,{index:0,period:i,subscriber:r})})}(n,e))}function qc(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 If(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))}class lS{constructor(e=!1,t,i=!0){this._multiple=e,this._emitChanges=i,this._selection=new Set,this._deselectedToEmit=[],this._selectedToEmit=[],this.changed=new Se,t&&t.length&&(e?t.forEach(r=>this._markSelected(r)):this._markSelected(t[0]),this._selectedToEmit.length=0)}get selected(){return this._selected||(this._selected=Array.from(this._selection.values())),this._selected}select(...e){this._verifyValueAssignment(e),e.forEach(t=>this._markSelected(t)),this._emitChangeEvent()}deselect(...e){this._verifyValueAssignment(e),e.forEach(t=>this._unmarkSelected(t)),this._emitChangeEvent()}toggle(e){this.isSelected(e)?this.deselect(e):this.select(e)}clear(){this._unmarkAll(),this._emitChangeEvent()}isSelected(e){return this._selection.has(e)}isEmpty(){return 0===this._selection.size}hasValue(){return!this.isEmpty()}sort(e){this._multiple&&this.selected&&this._selected.sort(e)}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(e){this.isSelected(e)||(this._multiple||this._unmarkAll(),this._selection.add(e),this._emitChanges&&this._selectedToEmit.push(e))}_unmarkSelected(e){this.isSelected(e)&&(this._selection.delete(e),this._emitChanges&&this._deselectedToEmit.push(e))}_unmarkAll(){this.isEmpty()||this._selection.forEach(e=>this._unmarkSelected(e))}_verifyValueAssignment(e){}}let cS=(()=>{class n{constructor(){this._listeners=[]}notify(t,i){for(let r of this._listeners)r(t,i)}listen(t){return this._listeners.push(t),()=>{this._listeners=this._listeners.filter(i=>t!==i)}}ngOnDestroy(){this._listeners=[]}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ue({factory:function(){return new n},token:n,providedIn:"root"}),n})(),um=(()=>{class n{constructor(t,i,r){this._ngZone=t,this._platform=i,this._scrolled=new Se,this._globalSubscription=null,this._scrolledCount=0,this.scrollContainers=new Map,this._document=r}register(t){this.scrollContainers.has(t)||this.scrollContainers.set(t,t.elementScrolled().subscribe(()=>this._scrolled.next(t)))}deregister(t){const i=this.scrollContainers.get(t);i&&(i.unsubscribe(),this.scrollContainers.delete(t))}scrolled(t=20){return this._platform.isBrowser?new ce(i=>{this._globalSubscription||this._addGlobalListener();const r=t>0?this._scrolled.pipe(aS(t)).subscribe(i):this._scrolled.subscribe(i);return this._scrolledCount++,()=>{r.unsubscribe(),this._scrolledCount--,this._scrolledCount||this._removeGlobalListener()}}):ht()}ngOnDestroy(){this._removeGlobalListener(),this.scrollContainers.forEach((t,i)=>this.deregister(i)),this._scrolled.complete()}ancestorScrolled(t,i){const r=this.getAncestorScrollContainers(t);return this.scrolled(i).pipe(Fn(s=>!s||r.indexOf(s)>-1))}getAncestorScrollContainers(t){const i=[];return this.scrollContainers.forEach((r,s)=>{this._scrollableContainsElement(s,t)&&i.push(s)}),i}_getWindow(){return this._document.defaultView||window}_scrollableContainsElement(t,i){let r=Wu(i),s=t.getElementRef().nativeElement;do{if(r==s)return!0}while(r=r.parentElement);return!1}_addGlobalListener(){this._globalSubscription=this._ngZone.runOutsideAngular(()=>Wc(this._getWindow().document,"scroll").subscribe(()=>this._scrolled.next()))}_removeGlobalListener(){this._globalSubscription&&(this._globalSubscription.unsubscribe(),this._globalSubscription=null)}}return n.\u0275fac=function(t){return new(t||n)(I(dt),I(si),I(ut,8))},n.\u0275prov=ue({factory:function(){return new n(I(dt),I(si),I(ut,8))},token:n,providedIn:"root"}),n})(),Yf=(()=>{class n{constructor(t,i,r){this._platform=t,this._change=new Se,this._changeListener=s=>{this._change.next(s)},this._document=r,i.runOutsideAngular(()=>{if(t.isBrowser){const s=this._getWindow();s.addEventListener("resize",this._changeListener),s.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:i,height:r}=this.getViewportSize();return{top:t.top,left:t.left,bottom:t.top+r,right:t.left+i,height:r,width:i}}getViewportScrollPosition(){if(!this._platform.isBrowser)return{top:0,left:0};const t=this._document,i=this._getWindow(),r=t.documentElement,s=r.getBoundingClientRect();return{top:-s.top||t.body.scrollTop||i.scrollY||r.scrollTop||0,left:-s.left||t.body.scrollLeft||i.scrollX||r.scrollLeft||0}}change(t=20){return t>0?this._change.pipe(aS(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 n.\u0275fac=function(t){return new(t||n)(I(si),I(dt),I(ut,8))},n.\u0275prov=ue({factory:function(){return new n(I(si),I(dt),I(ut,8))},token:n,providedIn:"root"}),n})(),Wv=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({}),n})(),Gj=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[Nv,Rv,Wv],Nv,Wv]}),n})();class qO{attach(e){return this._attachedHost=e,e.attach(this)}detach(){let e=this._attachedHost;null!=e&&(this._attachedHost=null,e.detach())}get isAttached(){return null!=this._attachedHost}setAttachedHost(e){this._attachedHost=e}}class dm extends qO{constructor(e,t,i,r){super(),this.component=e,this.viewContainerRef=t,this.injector=i,this.componentFactoryResolver=r}}class Xf extends qO{constructor(e,t,i){super(),this.templateRef=e,this.viewContainerRef=t,this.context=i}get origin(){return this.templateRef.elementRef}attach(e,t=this.context){return this.context=t,super.attach(e)}detach(){return this.context=void 0,super.detach()}}class fae extends qO{constructor(e){super(),this.element=e instanceof rt?e.nativeElement:e}}class uS{constructor(){this._isDisposed=!1,this.attachDomPortal=null}hasAttached(){return!!this._attachedPortal}attach(e){return e instanceof dm?(this._attachedPortal=e,this.attachComponentPortal(e)):e instanceof Xf?(this._attachedPortal=e,this.attachTemplatePortal(e)):this.attachDomPortal&&e instanceof fae?(this._attachedPortal=e,this.attachDomPortal(e)):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(e){this._disposeFn=e}_invokeDisposeFn(){this._disposeFn&&(this._disposeFn(),this._disposeFn=null)}}class pae extends uS{constructor(e,t,i,r,s){super(),this.outletElement=e,this._componentFactoryResolver=t,this._appRef=i,this._defaultInjector=r,this.attachDomPortal=o=>{const a=o.element,l=this._document.createComment("dom-portal");a.parentNode.insertBefore(l,a),this.outletElement.appendChild(a),this._attachedPortal=o,super.setDisposeFn(()=>{l.parentNode&&l.parentNode.replaceChild(a,l)})},this._document=s}attachComponentPortal(e){const i=(e.componentFactoryResolver||this._componentFactoryResolver).resolveComponentFactory(e.component);let r;return e.viewContainerRef?(r=e.viewContainerRef.createComponent(i,e.viewContainerRef.length,e.injector||e.viewContainerRef.injector),this.setDisposeFn(()=>r.destroy())):(r=i.create(e.injector||this._defaultInjector),this._appRef.attachView(r.hostView),this.setDisposeFn(()=>{this._appRef.detachView(r.hostView),r.destroy()})),this.outletElement.appendChild(this._getComponentRootNode(r)),this._attachedPortal=e,r}attachTemplatePortal(e){let t=e.viewContainerRef,i=t.createEmbeddedView(e.templateRef,e.context);return i.rootNodes.forEach(r=>this.outletElement.appendChild(r)),i.detectChanges(),this.setDisposeFn(()=>{let r=t.indexOf(i);-1!==r&&t.remove(r)}),this._attachedPortal=e,i}dispose(){super.dispose(),null!=this.outletElement.parentNode&&this.outletElement.parentNode.removeChild(this.outletElement)}_getComponentRootNode(e){return e.hostView.rootNodes[0]}}let Kf=(()=>{class n extends uS{constructor(t,i,r){super(),this._componentFactoryResolver=t,this._viewContainerRef=i,this._isInitialized=!1,this.attached=new Le,this.attachDomPortal=s=>{const o=s.element,a=this._document.createComment("dom-portal");s.setAttachedHost(this),o.parentNode.insertBefore(a,o),this._getRootNode().appendChild(o),this._attachedPortal=s,super.setDisposeFn(()=>{a.parentNode&&a.parentNode.replaceChild(o,a)})},this._document=r}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 i=null!=t.viewContainerRef?t.viewContainerRef:this._viewContainerRef,s=(t.componentFactoryResolver||this._componentFactoryResolver).resolveComponentFactory(t.component),o=i.createComponent(s,i.length,t.injector||i.injector);return i!==this._viewContainerRef&&this._getRootNode().appendChild(o.hostView.rootNodes[0]),super.setDisposeFn(()=>o.destroy()),this._attachedPortal=t,this._attachedRef=o,this.attached.emit(o),o}attachTemplatePortal(t){t.setAttachedHost(this);const i=this._viewContainerRef.createEmbeddedView(t.templateRef,t.context);return super.setDisposeFn(()=>this._viewContainerRef.clear()),this._attachedPortal=t,this._attachedRef=i,this.attached.emit(i),i}_getRootNode(){const t=this._viewContainerRef.element.nativeElement;return t.nodeType===t.ELEMENT_NODE?t:t.parentNode}}return n.\u0275fac=function(t){return new(t||n)(E(ll),E(ns),E(ut))},n.\u0275dir=oe({type:n,selectors:[["","cdkPortalOutlet",""]],inputs:{portal:["cdkPortalOutlet","portal"]},outputs:{attached:"attached"},exportAs:["cdkPortalOutlet"],features:[ct]}),n})(),dS=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({}),n})();function qj(n,e=!1){return t=>t.lift(new gae(n,e))}class gae{constructor(e,t){this.predicate=e,this.inclusive=t}call(e,t){return t.subscribe(new mae(e,this.predicate,this.inclusive))}}class mae extends xt{constructor(e,t,i){super(e),this.predicate=t,this.inclusive=i,this.index=0}_next(e){const t=this.destination;let i;try{i=this.predicate(e,this.index++)}catch(r){return void t.error(r)}this.nextOrComplete(e,i)}nextOrComplete(e,t){const i=this.destination;Boolean(t)?i.next(e):(this.inclusive&&i.next(e),i.complete())}}const Yj=TV();class _ae{constructor(e,t){this._viewportRuler=e,this._previousHTMLStyles={top:"",left:""},this._isEnabled=!1,this._document=t}attach(){}enable(){if(this._canBeEnabled()){const e=this._document.documentElement;this._previousScrollPosition=this._viewportRuler.getViewportScrollPosition(),this._previousHTMLStyles.left=e.style.left||"",this._previousHTMLStyles.top=e.style.top||"",e.style.left=jr(-this._previousScrollPosition.left),e.style.top=jr(-this._previousScrollPosition.top),e.classList.add("cdk-global-scrollblock"),this._isEnabled=!0}}disable(){if(this._isEnabled){const e=this._document.documentElement,i=e.style,r=this._document.body.style,s=i.scrollBehavior||"",o=r.scrollBehavior||"";this._isEnabled=!1,i.left=this._previousHTMLStyles.left,i.top=this._previousHTMLStyles.top,e.classList.remove("cdk-global-scrollblock"),Yj&&(i.scrollBehavior=r.scrollBehavior="auto"),window.scroll(this._previousScrollPosition.left,this._previousScrollPosition.top),Yj&&(i.scrollBehavior=s,r.scrollBehavior=o)}}_canBeEnabled(){if(this._document.documentElement.classList.contains("cdk-global-scrollblock")||this._isEnabled)return!1;const t=this._document.body,i=this._viewportRuler.getViewportSize();return t.scrollHeight>i.height||t.scrollWidth>i.width}}class yae{constructor(e,t,i,r){this._scrollDispatcher=e,this._ngZone=t,this._viewportRuler=i,this._config=r,this._scrollSubscription=null,this._detach=()=>{this.disable(),this._overlayRef.hasAttached()&&this._ngZone.run(()=>this._overlayRef.detach())}}attach(e){this._overlayRef=e}enable(){if(this._scrollSubscription)return;const e=this._scrollDispatcher.scrolled(0);this._config&&this._config.threshold&&this._config.threshold>1?(this._initialScrollPosition=this._viewportRuler.getViewportScrollPosition().top,this._scrollSubscription=e.subscribe(()=>{const t=this._viewportRuler.getViewportScrollPosition().top;Math.abs(t-this._initialScrollPosition)>this._config.threshold?this._detach():this._overlayRef.updatePosition()})):this._scrollSubscription=e.subscribe(this._detach)}disable(){this._scrollSubscription&&(this._scrollSubscription.unsubscribe(),this._scrollSubscription=null)}detach(){this.disable(),this._overlayRef=null}}class Xj{enable(){}disable(){}attach(){}}function YO(n,e){return e.some(t=>n.bottomt.bottom||n.rightt.right)}function Kj(n,e){return e.some(t=>n.topt.bottom||n.leftt.right)}class vae{constructor(e,t,i,r){this._scrollDispatcher=e,this._viewportRuler=t,this._ngZone=i,this._config=r,this._scrollSubscription=null}attach(e){this._overlayRef=e}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:i,height:r}=this._viewportRuler.getViewportSize();YO(t,[{width:i,height:r,bottom:r,right:i,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 bae=(()=>{class n{constructor(t,i,r,s){this._scrollDispatcher=t,this._viewportRuler=i,this._ngZone=r,this.noop=()=>new Xj,this.close=o=>new yae(this._scrollDispatcher,this._ngZone,this._viewportRuler,o),this.block=()=>new _ae(this._viewportRuler,this._document),this.reposition=o=>new vae(this._scrollDispatcher,this._viewportRuler,this._ngZone,o),this._document=s}}return n.\u0275fac=function(t){return new(t||n)(I(um),I(Yf),I(dt),I(ut))},n.\u0275prov=ue({factory:function(){return new n(I(um),I(Yf),I(dt),I(ut))},token:n,providedIn:"root"}),n})();class qv{constructor(e){if(this.scrollStrategy=new Xj,this.panelClass="",this.hasBackdrop=!1,this.backdropClass="cdk-overlay-dark-backdrop",this.disposeOnNavigation=!1,e){const t=Object.keys(e);for(const i of t)void 0!==e[i]&&(this[i]=e[i])}}}class Cae{constructor(e,t,i,r,s){this.offsetX=i,this.offsetY=r,this.panelClass=s,this.originX=e.originX,this.originY=e.originY,this.overlayX=t.overlayX,this.overlayY=t.overlayY}}class wae{constructor(e,t){this.connectionPair=e,this.scrollableViewProperties=t}}let Zj=(()=>{class n{constructor(t){this._attachedOverlays=[],this._document=t}ngOnDestroy(){this.detach()}add(t){this.remove(t),this._attachedOverlays.push(t)}remove(t){const i=this._attachedOverlays.indexOf(t);i>-1&&this._attachedOverlays.splice(i,1),0===this._attachedOverlays.length&&this.detach()}}return n.\u0275fac=function(t){return new(t||n)(I(ut))},n.\u0275prov=ue({factory:function(){return new n(I(ut))},token:n,providedIn:"root"}),n})(),Eae=(()=>{class n extends Zj{constructor(t){super(t),this._keydownListener=i=>{const r=this._attachedOverlays;for(let s=r.length-1;s>-1;s--)if(r[s]._keydownEvents.observers.length>0){r[s]._keydownEvents.next(i);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 n.\u0275fac=function(t){return new(t||n)(I(ut))},n.\u0275prov=ue({factory:function(){return new n(I(ut))},token:n,providedIn:"root"}),n})(),Sae=(()=>{class n extends Zj{constructor(t,i){super(t),this._platform=i,this._cursorStyleIsSet=!1,this._clickListener=r=>{const s=Nf(r),o=this._attachedOverlays.slice();for(let a=o.length-1;a>-1;a--){const l=o[a];if(!(l._outsidePointerEvents.observers.length<1)&&l.hasAttached()){if(l.overlayElement.contains(s))break;l._outsidePointerEvents.next(r)}}}}add(t){if(super.add(t),!this._isAttached){const i=this._document.body;i.addEventListener("click",this._clickListener,!0),i.addEventListener("auxclick",this._clickListener,!0),i.addEventListener("contextmenu",this._clickListener,!0),this._platform.IOS&&!this._cursorStyleIsSet&&(this._cursorOriginalValue=i.style.cursor,i.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 n.\u0275fac=function(t){return new(t||n)(I(ut),I(si))},n.\u0275prov=ue({factory:function(){return new n(I(ut),I(si))},token:n,providedIn:"root"}),n})();const ah="undefined"!=typeof window?window:{},Qj=void 0!==ah.__karma__&&!!ah.__karma__||void 0!==ah.jasmine&&!!ah.jasmine||void 0!==ah.jest&&!!ah.jest||void 0!==ah.Mocha&&!!ah.Mocha;let hm=(()=>{class n{constructor(t,i){this._platform=i,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||Qj){const r=this._document.querySelectorAll(`.${t}[platform="server"], .${t}[platform="test"]`);for(let s=0;sthis._backdropClick.next(d),this._keydownEvents=new Se,this._outsidePointerEvents=new Se,r.scrollStrategy&&(this._scrollStrategy=r.scrollStrategy,this._scrollStrategy.attach(this)),this._positionStrategy=r.positionStrategy}get overlayElement(){return this._pane}get backdropElement(){return this._backdropElement}get hostElement(){return this._host}attach(e){let t=this._portalOutlet.attach(e);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(yi(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),t}detach(){if(!this.hasAttached())return;this.detachBackdrop(),this._togglePointerEvents(!1),this._positionStrategy&&this._positionStrategy.detach&&this._positionStrategy.detach(),this._scrollStrategy&&this._scrollStrategy.disable();const e=this._portalOutlet.detach();return this._detachments.next(),this._keyboardDispatcher.remove(this),this._detachContentWhenStable(),this._locationChanges.unsubscribe(),this._outsideClickDispatcher.remove(this),e}dispose(){const e=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,e&&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(e){e!==this._positionStrategy&&(this._positionStrategy&&this._positionStrategy.dispose(),this._positionStrategy=e,this.hasAttached()&&(e.attach(this),this.updatePosition()))}updateSize(e){this._config=Object.assign(Object.assign({},this._config),e),this._updateElementSize()}setDirection(e){this._config=Object.assign(Object.assign({},this._config),{direction:e}),this._updateElementDirection()}addPanelClass(e){this._pane&&this._toggleClasses(this._pane,e,!0)}removePanelClass(e){this._pane&&this._toggleClasses(this._pane,e,!1)}getDirection(){const e=this._config.direction;return e?"string"==typeof e?e:e.value:"ltr"}updateScrollStrategy(e){e!==this._scrollStrategy&&(this._disposeScrollStrategy(),this._scrollStrategy=e,this.hasAttached()&&(e.attach(this),e.enable()))}_updateElementDirection(){this._host.setAttribute("dir",this.getDirection())}_updateElementSize(){if(!this._pane)return;const e=this._pane.style;e.width=jr(this._config.width),e.height=jr(this._config.height),e.minWidth=jr(this._config.minWidth),e.minHeight=jr(this._config.minHeight),e.maxWidth=jr(this._config.maxWidth),e.maxHeight=jr(this._config.maxHeight)}_togglePointerEvents(e){this._pane.style.pointerEvents=e?"":"none"}_attachBackdrop(){const e="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(e)})}):this._backdropElement.classList.add(e)}_updateStackingOrder(){this._host.nextSibling&&this._host.parentNode.appendChild(this._host)}detachBackdrop(){let e=this._backdropElement;if(!e)return;let t,i=()=>{e&&(e.removeEventListener("click",this._backdropClickHandler),e.removeEventListener("transitionend",i),e.parentNode&&e.parentNode.removeChild(e)),this._backdropElement==e&&(this._backdropElement=null),this._config.backdropClass&&this._toggleClasses(e,this._config.backdropClass,!1),clearTimeout(t)};e.classList.remove("cdk-overlay-backdrop-showing"),this._ngZone.runOutsideAngular(()=>{e.addEventListener("transitionend",i)}),e.style.pointerEvents="none",t=this._ngZone.runOutsideAngular(()=>setTimeout(i,500))}_toggleClasses(e,t,i){const r=e.classList;EE(t).forEach(s=>{s&&(i?r.add(s):r.remove(s))})}_detachContentWhenStable(){this._ngZone.runOutsideAngular(()=>{const e=this._ngZone.onStable.pipe(Tn(Ni(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)),e.unsubscribe())})})}_disposeScrollStrategy(){const e=this._scrollStrategy;e&&(e.disable(),e.detach&&e.detach())}}const Jj="cdk-overlay-connected-position-bounding-box",xae=/([A-Za-z%]+)$/;class eU{constructor(e,t,i,r,s){this._viewportRuler=t,this._document=i,this._platform=r,this._overlayContainer=s,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 Se,this._resizeSubscription=Te.EMPTY,this._offsetX=0,this._offsetY=0,this._appliedPanelClasses=[],this.positionChanges=this._positionChanges,this.setOrigin(e)}get positions(){return this._preferredPositions}attach(e){this._validatePositions(),e.hostElement.classList.add(Jj),this._overlayRef=e,this._boundingBox=e.hostElement,this._pane=e.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 e=this._originRect,t=this._overlayRect,i=this._viewportRect,r=[];let s;for(let o of this._preferredPositions){let a=this._getOriginPoint(e,o),l=this._getOverlayPoint(a,t,o),c=this._getOverlayFit(l,t,i,o);if(c.isCompletelyWithinViewport)return this._isPushed=!1,void this._applyPosition(o,a);this._canFitWithFlexibleDimensions(c,l,i)?r.push({position:o,origin:a,overlayRect:t,boundingBoxRect:this._calculateBoundingBoxRect(a,o)}):(!s||s.overlayFit.visibleAreaa&&(a=c,o=l)}return this._isPushed=!1,void this._applyPosition(o.position,o.origin)}if(this._canPush)return this._isPushed=!0,void this._applyPosition(s.position,s.originPoint);this._applyPosition(s.position,s.originPoint)}detach(){this._clearPanelClasses(),this._lastPosition=null,this._previousPushAmount=null,this._resizeSubscription.unsubscribe()}dispose(){this._isDisposed||(this._boundingBox&&Zf(this._boundingBox.style,{top:"",left:"",right:"",bottom:"",height:"",width:"",alignItems:"",justifyContent:""}),this._pane&&this._resetOverlayElementStyles(),this._overlayRef&&this._overlayRef.hostElement.classList.remove(Jj),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 e=this._lastPosition||this._preferredPositions[0],t=this._getOriginPoint(this._originRect,e);this._applyPosition(e,t)}}withScrollableContainers(e){return this._scrollables=e,this}withPositions(e){return this._preferredPositions=e,-1===e.indexOf(this._lastPosition)&&(this._lastPosition=null),this._validatePositions(),this}withViewportMargin(e){return this._viewportMargin=e,this}withFlexibleDimensions(e=!0){return this._hasFlexibleDimensions=e,this}withGrowAfterOpen(e=!0){return this._growAfterOpen=e,this}withPush(e=!0){return this._canPush=e,this}withLockedPosition(e=!0){return this._positionLocked=e,this}setOrigin(e){return this._origin=e,this}withDefaultOffsetX(e){return this._offsetX=e,this}withDefaultOffsetY(e){return this._offsetY=e,this}withTransformOriginOn(e){return this._transformOriginSelector=e,this}_getOriginPoint(e,t){let i,r;if("center"==t.originX)i=e.left+e.width/2;else{const s=this._isRtl()?e.right:e.left,o=this._isRtl()?e.left:e.right;i="start"==t.originX?s:o}return r="center"==t.originY?e.top+e.height/2:"top"==t.originY?e.top:e.bottom,{x:i,y:r}}_getOverlayPoint(e,t,i){let r,s;return r="center"==i.overlayX?-t.width/2:"start"===i.overlayX?this._isRtl()?-t.width:0:this._isRtl()?0:-t.width,s="center"==i.overlayY?-t.height/2:"top"==i.overlayY?0:-t.height,{x:e.x+r,y:e.y+s}}_getOverlayFit(e,t,i,r){const s=nU(t);let{x:o,y:a}=e,l=this._getOffset(r,"x"),c=this._getOffset(r,"y");l&&(o+=l),c&&(a+=c);let p=0-a,g=a+s.height-i.height,_=this._subtractOverflows(s.width,0-o,o+s.width-i.width),y=this._subtractOverflows(s.height,p,g),v=_*y;return{visibleArea:v,isCompletelyWithinViewport:s.width*s.height===v,fitsInViewportVertically:y===s.height,fitsInViewportHorizontally:_==s.width}}_canFitWithFlexibleDimensions(e,t,i){if(this._hasFlexibleDimensions){const r=i.bottom-t.y,s=i.right-t.x,o=tU(this._overlayRef.getConfig().minHeight),a=tU(this._overlayRef.getConfig().minWidth),c=e.fitsInViewportHorizontally||null!=a&&a<=s;return(e.fitsInViewportVertically||null!=o&&o<=r)&&c}return!1}_pushOverlayOnScreen(e,t,i){if(this._previousPushAmount&&this._positionLocked)return{x:e.x+this._previousPushAmount.x,y:e.y+this._previousPushAmount.y};const r=nU(t),s=this._viewportRect,o=Math.max(e.x+r.width-s.width,0),a=Math.max(e.y+r.height-s.height,0),l=Math.max(s.top-i.top-e.y,0),c=Math.max(s.left-i.left-e.x,0);let d=0,f=0;return d=r.width<=s.width?c||-o:e.x_&&!this._isInitialRender&&!this._growAfterOpen&&(o=e.y-_/2)}if("end"===t.overlayX&&!r||"start"===t.overlayX&&r)p=i.width-e.x+this._viewportMargin,d=e.x-this._viewportMargin;else if("start"===t.overlayX&&!r||"end"===t.overlayX&&r)f=e.x,d=i.right-e.x;else{const g=Math.min(i.right-e.x+i.left,e.x),_=this._lastBoundingBoxSize.width;d=2*g,f=e.x-g,d>_&&!this._isInitialRender&&!this._growAfterOpen&&(f=e.x-_/2)}return{top:o,left:f,bottom:a,right:p,width:d,height:s}}_setBoundingBoxStyles(e,t){const i=this._calculateBoundingBoxRect(e,t);!this._isInitialRender&&!this._growAfterOpen&&(i.height=Math.min(i.height,this._lastBoundingBoxSize.height),i.width=Math.min(i.width,this._lastBoundingBoxSize.width));const r={};if(this._hasExactPosition())r.top=r.left="0",r.bottom=r.right=r.maxHeight=r.maxWidth="",r.width=r.height="100%";else{const s=this._overlayRef.getConfig().maxHeight,o=this._overlayRef.getConfig().maxWidth;r.height=jr(i.height),r.top=jr(i.top),r.bottom=jr(i.bottom),r.width=jr(i.width),r.left=jr(i.left),r.right=jr(i.right),r.alignItems="center"===t.overlayX?"center":"end"===t.overlayX?"flex-end":"flex-start",r.justifyContent="center"===t.overlayY?"center":"bottom"===t.overlayY?"flex-end":"flex-start",s&&(r.maxHeight=jr(s)),o&&(r.maxWidth=jr(o))}this._lastBoundingBoxSize=i,Zf(this._boundingBox.style,r)}_resetBoundingBoxStyles(){Zf(this._boundingBox.style,{top:"0",left:"0",right:"0",bottom:"0",height:"",width:"",alignItems:"",justifyContent:""})}_resetOverlayElementStyles(){Zf(this._pane.style,{top:"",left:"",bottom:"",right:"",position:"",transform:""})}_setOverlayElementStyles(e,t){const i={},r=this._hasExactPosition(),s=this._hasFlexibleDimensions,o=this._overlayRef.getConfig();if(r){const d=this._viewportRuler.getViewportScrollPosition();Zf(i,this._getExactOverlayY(t,e,d)),Zf(i,this._getExactOverlayX(t,e,d))}else i.position="static";let a="",l=this._getOffset(t,"x"),c=this._getOffset(t,"y");l&&(a+=`translateX(${l}px) `),c&&(a+=`translateY(${c}px)`),i.transform=a.trim(),o.maxHeight&&(r?i.maxHeight=jr(o.maxHeight):s&&(i.maxHeight="")),o.maxWidth&&(r?i.maxWidth=jr(o.maxWidth):s&&(i.maxWidth="")),Zf(this._pane.style,i)}_getExactOverlayY(e,t,i){let r={top:"",bottom:""},s=this._getOverlayPoint(t,this._overlayRect,e);this._isPushed&&(s=this._pushOverlayOnScreen(s,this._overlayRect,i));let o=this._overlayContainer.getContainerElement().getBoundingClientRect().top;return s.y-=o,"bottom"===e.overlayY?r.bottom=this._document.documentElement.clientHeight-(s.y+this._overlayRect.height)+"px":r.top=jr(s.y),r}_getExactOverlayX(e,t,i){let o,r={left:"",right:""},s=this._getOverlayPoint(t,this._overlayRect,e);return this._isPushed&&(s=this._pushOverlayOnScreen(s,this._overlayRect,i)),o=this._isRtl()?"end"===e.overlayX?"left":"right":"end"===e.overlayX?"right":"left","right"===o?r.right=this._document.documentElement.clientWidth-(s.x+this._overlayRect.width)+"px":r.left=jr(s.x),r}_getScrollVisibility(){const e=this._getOriginRect(),t=this._pane.getBoundingClientRect(),i=this._scrollables.map(r=>r.getElementRef().nativeElement.getBoundingClientRect());return{isOriginClipped:Kj(e,i),isOriginOutsideView:YO(e,i),isOverlayClipped:Kj(t,i),isOverlayOutsideView:YO(t,i)}}_subtractOverflows(e,...t){return t.reduce((i,r)=>i-Math.max(r,0),e)}_getNarrowedViewportRect(){const e=this._document.documentElement.clientWidth,t=this._document.documentElement.clientHeight,i=this._viewportRuler.getViewportScrollPosition();return{top:i.top+this._viewportMargin,left:i.left+this._viewportMargin,right:i.left+e-this._viewportMargin,bottom:i.top+t-this._viewportMargin,width:e-2*this._viewportMargin,height:t-2*this._viewportMargin}}_isRtl(){return"rtl"===this._overlayRef.getDirection()}_hasExactPosition(){return!this._hasFlexibleDimensions||this._isPushed}_getOffset(e,t){return"x"===t?null==e.offsetX?this._offsetX:e.offsetX:null==e.offsetY?this._offsetY:e.offsetY}_validatePositions(){}_addPanelClasses(e){this._pane&&EE(e).forEach(t=>{""!==t&&-1===this._appliedPanelClasses.indexOf(t)&&(this._appliedPanelClasses.push(t),this._pane.classList.add(t))})}_clearPanelClasses(){this._pane&&(this._appliedPanelClasses.forEach(e=>{this._pane.classList.remove(e)}),this._appliedPanelClasses=[])}_getOriginRect(){const e=this._origin;if(e instanceof rt)return e.nativeElement.getBoundingClientRect();if(e instanceof Element)return e.getBoundingClientRect();const t=e.width||0,i=e.height||0;return{top:e.y,bottom:e.y+i,left:e.x,right:e.x+t,height:i,width:t}}}function Zf(n,e){for(let t in e)e.hasOwnProperty(t)&&(n[t]=e[t]);return n}function tU(n){if("number"!=typeof n&&null!=n){const[e,t]=n.split(xae);return t&&"px"!==t?null:parseFloat(e)}return n||null}function nU(n){return{top:Math.floor(n.top),right:Math.floor(n.right),bottom:Math.floor(n.bottom),left:Math.floor(n.left),width:Math.floor(n.width),height:Math.floor(n.height)}}class Tae{constructor(e,t,i,r,s,o,a){this._preferredPositions=[],this._positionStrategy=new eU(i,r,s,o,a).withFlexibleDimensions(!1).withPush(!1).withViewportMargin(0),this.withFallbackPosition(e,t),this.onPositionChange=this._positionStrategy.positionChanges}get positions(){return this._preferredPositions}attach(e){this._overlayRef=e,this._positionStrategy.attach(e),this._direction&&(e.setDirection(this._direction),this._direction=null)}dispose(){this._positionStrategy.dispose()}detach(){this._positionStrategy.detach()}apply(){this._positionStrategy.apply()}recalculateLastPosition(){this._positionStrategy.reapplyLastPosition()}withScrollableContainers(e){this._positionStrategy.withScrollableContainers(e)}withFallbackPosition(e,t,i,r){const s=new Cae(e,t,i,r);return this._preferredPositions.push(s),this._positionStrategy.withPositions(this._preferredPositions),this}withDirection(e){return this._overlayRef?this._overlayRef.setDirection(e):this._direction=e,this}withOffsetX(e){return this._positionStrategy.withDefaultOffsetX(e),this}withOffsetY(e){return this._positionStrategy.withDefaultOffsetY(e),this}withLockedPosition(e){return this._positionStrategy.withLockedPosition(e),this}withPositions(e){return this._preferredPositions=e.slice(),this._positionStrategy.withPositions(this._preferredPositions),this}setOrigin(e){return this._positionStrategy.setOrigin(e),this}}const iU="cdk-global-overlay-wrapper";class Aae{constructor(){this._cssPosition="static",this._topOffset="",this._bottomOffset="",this._leftOffset="",this._rightOffset="",this._alignItems="",this._justifyContent="",this._width="",this._height=""}attach(e){const t=e.getConfig();this._overlayRef=e,this._width&&!t.width&&e.updateSize({width:this._width}),this._height&&!t.height&&e.updateSize({height:this._height}),e.hostElement.classList.add(iU),this._isDisposed=!1}top(e=""){return this._bottomOffset="",this._topOffset=e,this._alignItems="flex-start",this}left(e=""){return this._rightOffset="",this._leftOffset=e,this._justifyContent="flex-start",this}bottom(e=""){return this._topOffset="",this._bottomOffset=e,this._alignItems="flex-end",this}right(e=""){return this._leftOffset="",this._rightOffset=e,this._justifyContent="flex-end",this}width(e=""){return this._overlayRef?this._overlayRef.updateSize({width:e}):this._width=e,this}height(e=""){return this._overlayRef?this._overlayRef.updateSize({height:e}):this._height=e,this}centerHorizontally(e=""){return this.left(e),this._justifyContent="center",this}centerVertically(e=""){return this.top(e),this._alignItems="center",this}apply(){if(!this._overlayRef||!this._overlayRef.hasAttached())return;const e=this._overlayRef.overlayElement.style,t=this._overlayRef.hostElement.style,i=this._overlayRef.getConfig(),{width:r,height:s,maxWidth:o,maxHeight:a}=i,l=!("100%"!==r&&"100vw"!==r||o&&"100%"!==o&&"100vw"!==o),c=!("100%"!==s&&"100vh"!==s||a&&"100%"!==a&&"100vh"!==a);e.position=this._cssPosition,e.marginLeft=l?"0":this._leftOffset,e.marginTop=c?"0":this._topOffset,e.marginBottom=this._bottomOffset,e.marginRight=this._rightOffset,l?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=c?"flex-start":this._alignItems}dispose(){if(this._isDisposed||!this._overlayRef)return;const e=this._overlayRef.overlayElement.style,t=this._overlayRef.hostElement,i=t.style;t.classList.remove(iU),i.justifyContent=i.alignItems=e.marginTop=e.marginBottom=e.marginLeft=e.marginRight=e.position="",this._overlayRef=null,this._isDisposed=!0}}let Dae=(()=>{class n{constructor(t,i,r,s){this._viewportRuler=t,this._document=i,this._platform=r,this._overlayContainer=s}global(){return new Aae}connectedTo(t,i,r){return new Tae(i,r,t,this._viewportRuler,this._document,this._platform,this._overlayContainer)}flexibleConnectedTo(t){return new eU(t,this._viewportRuler,this._document,this._platform,this._overlayContainer)}}return n.\u0275fac=function(t){return new(t||n)(I(Yf),I(ut),I(si),I(hm))},n.\u0275prov=ue({factory:function(){return new n(I(Yf),I(ut),I(si),I(hm))},token:n,providedIn:"root"}),n})(),Oae=0,Jo=(()=>{class n{constructor(t,i,r,s,o,a,l,c,d,f,p){this.scrollStrategies=t,this._overlayContainer=i,this._componentFactoryResolver=r,this._positionBuilder=s,this._keyboardDispatcher=o,this._injector=a,this._ngZone=l,this._document=c,this._directionality=d,this._location=f,this._outsideClickDispatcher=p}create(t){const i=this._createHostElement(),r=this._createPaneElement(i),s=this._createPortalOutlet(r),o=new qv(t);return o.direction=o.direction||this._directionality.value,new Mae(s,i,r,o,this._ngZone,this._keyboardDispatcher,this._document,this._location,this._outsideClickDispatcher)}position(){return this._positionBuilder}_createPaneElement(t){const i=this._document.createElement("div");return i.id="cdk-overlay-"+Oae++,i.classList.add("cdk-overlay-pane"),t.appendChild(i),i}_createHostElement(){const t=this._document.createElement("div");return this._overlayContainer.getContainerElement().appendChild(t),t}_createPortalOutlet(t){return this._appRef||(this._appRef=this._injector.get(Jd)),new pae(t,this._componentFactoryResolver,this._appRef,this._injector,this._document)}}return n.\u0275fac=function(t){return new(t||n)(I(bae),I(hm),I(ll),I(Dae),I(Eae),I(Nt),I(dt),I(ut),I(Qo),I(Xg),I(Sae))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();const Iae=[{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"}],rU=new ve("cdk-connected-overlay-scroll-strategy");let Pae=(()=>{class n{constructor(t){this.elementRef=t}}return n.\u0275fac=function(t){return new(t||n)(E(rt))},n.\u0275dir=oe({type:n,selectors:[["","cdk-overlay-origin",""],["","overlay-origin",""],["","cdkOverlayOrigin",""]],exportAs:["cdkOverlayOrigin"]}),n})(),sU=(()=>{class n{constructor(t,i,r,s,o){this._overlay=t,this._dir=o,this._hasBackdrop=!1,this._lockPosition=!1,this._growAfterOpen=!1,this._flexibleDimensions=!1,this._push=!1,this._backdropSubscription=Te.EMPTY,this._attachSubscription=Te.EMPTY,this._detachSubscription=Te.EMPTY,this._positionSubscription=Te.EMPTY,this.viewportMargin=0,this.open=!1,this.disableClose=!1,this.backdropClick=new Le,this.positionChange=new Le,this.attach=new Le,this.detach=new Le,this.overlayKeydown=new Le,this.overlayOutsideClick=new Le,this._templatePortal=new Xf(i,r),this._scrollStrategyFactory=s,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=Mt(t)}get lockPosition(){return this._lockPosition}set lockPosition(t){this._lockPosition=Mt(t)}get flexibleDimensions(){return this._flexibleDimensions}set flexibleDimensions(t){this._flexibleDimensions=Mt(t)}get growAfterOpen(){return this._growAfterOpen}set growAfterOpen(t){this._growAfterOpen=Mt(t)}get push(){return this._push}set push(t){this._push=Mt(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=Iae);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(i=>{this.overlayKeydown.next(i),27===i.keyCode&&!this.disableClose&&!Zs(i)&&(i.preventDefault(),this._detachOverlay())}),this._overlayRef.outsidePointerEvents().subscribe(i=>{this.overlayOutsideClick.next(i)})}_buildConfig(){const t=this._position=this.positionStrategy||this._createPositionStrategy(),i=new qv({direction:this._dir,positionStrategy:t,scrollStrategy:this.scrollStrategy,hasBackdrop:this.hasBackdrop});return(this.width||0===this.width)&&(i.width=this.width),(this.height||0===this.height)&&(i.height=this.height),(this.minWidth||0===this.minWidth)&&(i.minWidth=this.minWidth),(this.minHeight||0===this.minHeight)&&(i.minHeight=this.minHeight),this.backdropClass&&(i.backdropClass=this.backdropClass),this.panelClass&&(i.panelClass=this.panelClass),i}_updatePositionStrategy(t){const i=this.positions.map(r=>({originX:r.originX,originY:r.originY,overlayX:r.overlayX,overlayY:r.overlayY,offsetX:r.offsetX||this.offsetX,offsetY:r.offsetY||this.offsetY,panelClass:r.panelClass||void 0}));return t.setOrigin(this.origin.elementRef).withPositions(i).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(qj(()=>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 n.\u0275fac=function(t){return new(t||n)(E(Jo),E(Ys),E(ns),E(rU),E(Qo,8))},n.\u0275dir=oe({type:n,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:[zn]}),n})();const kae={provide:rU,deps:[Jo],useFactory:function(n){return()=>n.scrollStrategies.reposition()}};let Yv=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({providers:[Jo,kae],imports:[[Nv,dS,Gj],Gj]}),n})();const oU=["mat-button",""],aU=["*"],Nae=["mat-button","mat-flat-button","mat-icon-button","mat-raised-button","mat-stroked-button","mat-mini-fab","mat-fab"],Lae=Uf(jf(nc(class{constructor(n){this._elementRef=n}})));let lh=(()=>{class n extends Lae{constructor(t,i,r){super(t),this._focusMonitor=i,this._animationMode=r,this.isRoundButton=this._hasHostAttributes("mat-fab","mat-mini-fab"),this.isIconButton=this._hasHostAttributes("mat-icon-button");for(const s of Nae)this._hasHostAttributes(s)&&this._getHostElement().classList.add(s);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,i){t?this._focusMonitor.focusVia(this._getHostElement(),t,i):this._getHostElement().focus(i)}_getHostElement(){return this._elementRef.nativeElement}_isRippleDisabled(){return this.disableRipple||this.disabled}_hasHostAttributes(...t){return t.some(i=>this._getHostElement().hasAttribute(i))}}return n.\u0275fac=function(t){return new(t||n)(E(rt),E(Sa),E(Do,8))},n.\u0275cmp=Ne({type:n,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,i){if(1&t&&Jn(Js,5),2&t){let r;_t(r=yt())&&(i.ripple=r.first)}},hostAttrs:[1,"mat-focus-indicator"],hostVars:5,hostBindings:function(t,i){2&t&&(nn("disabled",i.disabled||null),st("_mat-animation-noopable","NoopAnimations"===i._animationMode)("mat-button-disabled",i.disabled))},inputs:{disabled:"disabled",disableRipple:"disableRipple",color:"color"},exportAs:["matButton"],features:[ct],attrs:oU,ngContentSelectors:aU,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,i){1&t&&(wi(),R(0,"span",0),Ht(1),k(),tt(2,"span",1),tt(3,"span",2)),2&t&&(G(2),st("mat-button-ripple-round",i.isRoundButton||i.isIconButton),ie("matRippleDisabled",i._isRippleDisabled())("matRippleCentered",i.isIconButton)("matRippleTrigger",i._getHostElement()))},directives:[Js],styles:[".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"],encapsulation:2,changeDetection:0}),n})(),ch=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[_l,On],On]}),n})();class cU extends xt{notifyNext(e,t,i,r,s){this.destination.next(t)}notifyError(e,t){this.destination.error(e)}notifyComplete(e){this.destination.complete()}}class Bae extends xt{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 uU(n,e,t,i,r=new Bae(n,t,i)){if(!r.closed)return e instanceof ce?e.subscribe(r):ki(e)(r)}const dU={};function Qi(...n){let e,t;return Gn(n[n.length-1])&&(t=n.pop()),"function"==typeof n[n.length-1]&&(e=n.pop()),1===n.length&&we(n[0])&&(n=n[0]),za(n,t).lift(new hU(e))}class hU{constructor(e){this.resultSelector=e}call(e,t){return t.subscribe(new Vae(e,this.resultSelector))}}class Vae extends cU{constructor(e,t){super(e),this.resultSelector=t,this.active=0,this.values=[],this.observables=[]}_next(e){this.values.push(dU),this.observables.push(e)}_complete(){const e=this.observables,t=e.length;if(0===t)this.destination.complete();else{this.active=t,this.toRespond=t;for(let i=0;i{class n{constructor(t){this._platform=t,this._matchMedia=this._platform.isBrowser&&window.matchMedia?window.matchMedia.bind(window):jae}matchMedia(t){return this._platform.WEBKIT&&function(n){if(!fU.has(n))try{fm||(fm=document.createElement("style"),fm.setAttribute("type","text/css"),document.head.appendChild(fm)),fm.sheet&&(fm.sheet.insertRule(`@media ${n} {.fx-query-test{ }}`,0),fU.add(n))}catch(e){console.error(e)}}(t),this._matchMedia(t)}}return n.\u0275fac=function(t){return new(t||n)(I(si))},n.\u0275prov=ue({factory:function(){return new n(I(si))},token:n,providedIn:"root"}),n})();function jae(n){return{matches:"all"===n||""===n,media:n,addListener:()=>{},removeListener:()=>{}}}let XO=(()=>{class n{constructor(t,i){this._mediaMatcher=t,this._zone=i,this._queries=new Map,this._destroySubject=new Se}ngOnDestroy(){this._destroySubject.next(),this._destroySubject.complete()}isMatched(t){return gU(EE(t)).some(r=>this._registerQuery(r).mql.matches)}observe(t){let s=Qi(gU(EE(t)).map(o=>this._registerQuery(o).observable));return s=IE(s.pipe(yi(1)),s.pipe(QD(1),Zg(0))),s.pipe(Ae(o=>{const a={matches:!1,breakpoints:{}};return o.forEach(({matches:l,query:c})=>{a.matches=a.matches||l,a.breakpoints[c]=l}),a}))}_registerQuery(t){if(this._queries.has(t))return this._queries.get(t);const i=this._mediaMatcher.matchMedia(t),s={observable:new ce(o=>{const a=l=>this._zone.run(()=>o.next(l));return i.addListener(a),()=>{i.removeListener(a)}}).pipe(Rr(i),Ae(({matches:o})=>({query:t,matches:o})),Tn(this._destroySubject)),mql:i};return this._queries.set(t,s),s}}return n.\u0275fac=function(t){return new(t||n)(I(pU),I(dt))},n.\u0275prov=ue({factory:function(){return new n(I(pU),I(dt))},token:n,providedIn:"root"}),n})();function gU(n){return n.map(e=>e.split(",")).reduce((e,t)=>e.concat(t)).map(e=>e.trim())}function Uae(n,e){if(1&n){const t=Zi();R(0,"div",1),R(1,"button",2),ge("click",function(){return en(t),Qe().action()}),De(2),k(),k()}if(2&n){const t=Qe();G(2),xi(t.data.action)}}function Hae(n,e){}const KO=new ve("MatSnackBarData");class hS{constructor(){this.politeness="assertive",this.announcementMessage="",this.duration=0,this.data=null,this.horizontalPosition="center",this.verticalPosition="bottom"}}const $ae=Math.pow(2,31)-1;class ZO{constructor(e,t){this._overlayRef=t,this._afterDismissed=new Se,this._afterOpened=new Se,this._onAction=new Se,this._dismissedByAction=!1,this.containerInstance=e,this.onAction().subscribe(()=>this.dismiss()),e._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(e){this._durationTimeoutId=setTimeout(()=>this.dismiss(),Math.min(e,$ae))}_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 Gae=(()=>{class n{constructor(t,i){this.snackBarRef=t,this.data=i}action(){this.snackBarRef.dismissWithAction()}get hasAction(){return!!this.data.action}}return n.\u0275fac=function(t){return new(t||n)(E(ZO),E(KO))},n.\u0275cmp=Ne({type:n,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,i){1&t&&(R(0,"span"),De(1),k(),mt(2,Uae,3,1,"div",0)),2&t&&(G(1),xi(i.data.message),G(1),ie("ngIf",i.hasAction))},directives:[zr,lh],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}),n})();const Wae={snackBarState:tc("state",[wr("void, hidden",ti({transform:"scale(0.8)",opacity:0})),wr("visible",ti({transform:"scale(1)",opacity:1})),Qs("* => visible",Ao("150ms cubic-bezier(0, 0, 0.2, 1)")),Qs("* => void, * => hidden",Ao("75ms cubic-bezier(0.4, 0.0, 1, 1)",ti({opacity:0})))])};let qae=(()=>{class n extends uS{constructor(t,i,r,s,o){super(),this._ngZone=t,this._elementRef=i,this._changeDetectorRef=r,this._platform=s,this.snackBarConfig=o,this._announceDelay=150,this._destroyed=!1,this._onAnnounce=new Se,this._onExit=new Se,this._onEnter=new Se,this._animationState="void",this.attachDomPortal=a=>(this._assertNotAttached(),this._applySnackBarClasses(),this._portalOutlet.attachDomPortal(a)),this._live="assertive"!==o.politeness||o.announcementMessage?"off"===o.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:i,toState:r}=t;if(("void"===r&&"void"!==i||"hidden"===r)&&this._completeExit(),"visible"===r){const s=this._onEnter;this._ngZone.run(()=>{s.next(),s.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(yi(1)).subscribe(()=>{this._onExit.next(),this._onExit.complete()})}_applySnackBarClasses(){const t=this._elementRef.nativeElement,i=this.snackBarConfig.panelClass;i&&(Array.isArray(i)?i.forEach(r=>t.classList.add(r)):t.classList.add(i)),"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]"),i=this._elementRef.nativeElement.querySelector("[aria-live]");if(t&&i){let r=null;this._platform.isBrowser&&document.activeElement instanceof HTMLElement&&t.contains(document.activeElement)&&(r=document.activeElement),t.removeAttribute("aria-hidden"),i.appendChild(t),null==r||r.focus(),this._onAnnounce.next(),this._onAnnounce.complete()}},this._announceDelay)})}}return n.\u0275fac=function(t){return new(t||n)(E(dt),E(rt),E(kn),E(si),E(hS))},n.\u0275cmp=Ne({type:n,selectors:[["snack-bar-container"]],viewQuery:function(t,i){if(1&t&&Jn(Kf,7),2&t){let r;_t(r=yt())&&(i._portalOutlet=r.first)}},hostAttrs:[1,"mat-snack-bar-container"],hostVars:1,hostBindings:function(t,i){1&t&&Qy("@state.done",function(s){return i.onAnimationEnd(s)}),2&t&&Pg("@state",i._animationState)},features:[ct],decls:3,vars:2,consts:[["aria-hidden","true"],["cdkPortalOutlet",""]],template:function(t,i){1&t&&(R(0,"div",0),mt(1,Hae,0,0,"ng-template",1),k(),tt(2,"div")),2&t&&(G(2),nn("aria-live",i._live)("role",i._role))},directives:[Kf],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:[Wae.snackBarState]}}),n})(),_U=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[Yv,dS,dn,ch,On],On]}),n})();const yU=new ve("mat-snack-bar-default-options",{providedIn:"root",factory:function(){return new hS}});let Xae=(()=>{class n{constructor(t,i,r,s,o,a){this._overlay=t,this._live=i,this._injector=r,this._breakpointObserver=s,this._parentSnackBar=o,this._defaultConfig=a,this._snackBarRefAtThisLevel=null,this.simpleSnackBarComponent=Gae,this.snackBarContainerComponent=qae,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,i){return this._attach(t,i)}openFromTemplate(t,i){return this._attach(t,i)}open(t,i="",r){const s=Object.assign(Object.assign({},this._defaultConfig),r);return s.data={message:t,action:i},s.announcementMessage===t&&(s.announcementMessage=void 0),this.openFromComponent(this.simpleSnackBarComponent,s)}dismiss(){this._openedSnackBarRef&&this._openedSnackBarRef.dismiss()}ngOnDestroy(){this._snackBarRefAtThisLevel&&this._snackBarRefAtThisLevel.dismiss()}_attachSnackBarContainer(t,i){const s=Nt.create({parent:i&&i.viewContainerRef&&i.viewContainerRef.injector||this._injector,providers:[{provide:hS,useValue:i}]}),o=new dm(this.snackBarContainerComponent,i.viewContainerRef,s),a=t.attach(o);return a.instance.snackBarConfig=i,a.instance}_attach(t,i){const r=Object.assign(Object.assign(Object.assign({},new hS),this._defaultConfig),i),s=this._createOverlay(r),o=this._attachSnackBarContainer(s,r),a=new ZO(o,s);if(t instanceof Ys){const l=new Xf(t,null,{$implicit:r.data,snackBarRef:a});a.instance=o.attachTemplatePortal(l)}else{const l=this._createInjector(r,a),c=new dm(t,void 0,l),d=o.attachComponentPortal(c);a.instance=d.instance}return this._breakpointObserver.observe("(max-width: 599.98px) and (orientation: portrait)").pipe(Tn(s.detachments())).subscribe(l=>{const c=s.overlayElement.classList;l.matches?c.add(this.handsetCssClass):c.remove(this.handsetCssClass)}),r.announcementMessage&&o._onAnnounce.subscribe(()=>{this._live.announce(r.announcementMessage,r.politeness)}),this._animateSnackBar(a,r),this._openedSnackBarRef=a,this._openedSnackBarRef}_animateSnackBar(t,i){t.afterDismissed().subscribe(()=>{this._openedSnackBarRef==t&&(this._openedSnackBarRef=null),i.announcementMessage&&this._live.clear()}),this._openedSnackBarRef?(this._openedSnackBarRef.afterDismissed().subscribe(()=>{t.containerInstance.enter()}),this._openedSnackBarRef.dismiss()):t.containerInstance.enter(),i.duration&&i.duration>0&&t.afterOpened().subscribe(()=>t._dismissAfter(i.duration))}_createOverlay(t){const i=new qv;i.direction=t.direction;let r=this._overlay.position().global();const s="rtl"===t.direction,o="left"===t.horizontalPosition||"start"===t.horizontalPosition&&!s||"end"===t.horizontalPosition&&s,a=!o&&"center"!==t.horizontalPosition;return o?r.left("0"):a?r.right("0"):r.centerHorizontally(),"top"===t.verticalPosition?r.top("0"):r.bottom("0"),i.positionStrategy=r,this._overlay.create(i)}_createInjector(t,i){return Nt.create({parent:t&&t.viewContainerRef&&t.viewContainerRef.injector||this._injector,providers:[{provide:ZO,useValue:i},{provide:KO,useValue:t.data}]})}}return n.\u0275fac=function(t){return new(t||n)(I(Jo),I(DE),I(Nt),I(XO),I(n,12),I(yU))},n.\u0275prov=ue({factory:function(){return new n(I(Jo),I(DE),I(Fc),I(XO),I(n,12),I(yU))},token:n,providedIn:_U}),n})();function xe(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 ws(n,e){return function(t,i){e(t,i,n)}}function Xe(n,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(n,e)}function yl(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 wU(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 JO(){return!("object"==typeof process&&"[object process]"===String(process)&&!process.browser)||wU()}const EU="undefined"!=typeof __VERSION__?__VERSION__:"untranspiled source",pS=JO();class Jae{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 eI(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 SU={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 MU(n){return"string"==typeof n?SU[n.toUpperCase()]||SU.WHITE:n}function gS(n,e){if(!n)throw new Error(e||"Assertion failed")}const ic={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},Xv=ic.window||ic.self||ic.global,xU=ic.process||{};function pm(){let n;if(pS&&Xv.performance)n=Xv.performance.now();else if(xU.hrtime){const e=xU.hrtime();n=1e3*e[0]+e[1]/1e6}else n=Date.now();return n}console;const gm={debug:pS&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},ole={enabled:!0,level:0};function vl(){}const TU={},AU={once:!0};function ale(n){for(const e in n)for(const t in n[e])return t||"untitled";return"empty"}let tI=(()=>{class n{constructor({id:t}={id:""}){this.id=t,this.VERSION=EU,this._startTs=pm(),this._deltaTs=pm(),this.LOG_THROTTLE_TIMEOUT=0,this._storage=new Jae("__probe-".concat(this.id,"__"),ole),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((pm()-this._startTs).toPrecision(10))}getDelta(){return Number((pm()-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){gS(t,i)}warn(t){return this._getLogFunction(0,t,gm.warn,arguments,AU)}error(t){return this._getLogFunction(0,t,gm.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,gm.log,arguments,{time:!0,once:!0})}log(t,i){return this._getLogFunction(t,i,gm.debug,arguments)}info(t,i){return this._getLogFunction(t,i,console.info,arguments)}once(t,i){return this._getLogFunction(t,i,gm.debug||gm.info,arguments,AU)}table(t,i,r){return i?this._getLogFunction(t,i,console.table||vl,r&&[r],{tag:ale(i)}):vl}image({logLevel:t,priority:i,image:r,message:s="",scale:o=1}){return this._shouldLog(t||i)?pS?function({image:n,message:e="",scale:t=1}){if("string"==typeof n){const r=new Image;return r.onload=()=>{const s=eI(r,e,t);console.log(...s)},r.src=n,vl}const i=n.nodeName||"";if("img"===i.toLowerCase())return console.log(...eI(n,e,t)),vl;if("canvas"===i.toLowerCase()){const r=new Image;return r.onload=()=>console.log(...eI(r,e,t)),r.src=n.toDataURL(),vl}return vl}({image:r,message:s,scale:o}):function({image:n,message:e="",scale:t=1}){let i=null;try{i=ze(307)}catch(r){}return i?()=>i(n,{fit:"box",width:"".concat(Math.round(80*t),"%")}).then(r=>console.log(r)):vl}({image:r,message:s,scale:o}):vl}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||vl)}group(t,i,r={collapsed:!1}){r=OU({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||vl)}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()>=DU(t)}_getLogFunction(t,i,r,s=[],o){if(this._shouldLog(t)){o=OU({logLevel:t,message:i,args:s,opts:o}),gS(r=r||o.method),o.total=this.getTotal(),o.delta=this.getDelta(),this._deltaTs=pm();const a=o.tag||o.message;if(o.once){if(TU[a])return vl;TU[a]=pm()}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!pS&&"string"==typeof n&&(e&&(e=MU(e),n="\x1b[".concat(e,"m").concat(n,"\x1b[39m")),t&&(e=MU(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 vl}}return n.VERSION=EU,n})();function DU(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 gS(Number.isFinite(e)&&e>=0),e}function OU(n){const{logLevel:e,message:t}=n;n.logLevel=DU(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 gS("string"===r||"object"===r),Object.assign(n,n.opts)}const jn=new tI({id:"deck"}),qn={DEFAULT:-1,LNGLAT:1,METER_OFFSETS:2,LNGLAT_OFFSETS:3,CARTESIAN:0};Object.defineProperty(qn,"IDENTITY",{get:()=>jn.deprecated("COORDINATE_SYSTEM.IDENTITY","COORDINATE_SYSTEM.CARTESIAN")()||0});const Yc={WEB_MERCATOR:1,GLOBE:2,WEB_MERCATOR_AUTO_OFFSET:4,IDENTITY:0},IU={click:{handler:"onClick"},panstart:{handler:"onDragStart"},panmove:{handler:"onDrag"},panend:{handler:"onDragEnd"}},vt=new tI({id:"luma.gl"});function Oo(n,e){if(!n)throw new Error(e||"luma.gl: assertion failed.")}function mS(n){return"undefined"!=typeof WebGLRenderingContext&&n instanceof WebGLRenderingContext||"undefined"!=typeof WebGL2RenderingContext&&n instanceof WebGL2RenderingContext||Boolean(n&&Number.isFinite(n._version))}function In(n){return"undefined"!=typeof WebGL2RenderingContext&&n instanceof WebGL2RenderingContext||Boolean(n&&2===n._version)}function _S(n){return Oo(mS(n),"Invalid WebGLRenderingContext"),n}function eo(n){return Oo(In(n),"Requires WebGL2"),n}const Kv={};const Zv=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{globalThis.console&&globalThis.console.log&&globalThis.console.log("OESVertexArrayObject emulation library context restored"),t.reset_()},!0),this.reset_()};Qf.prototype.VERTEX_ARRAY_BINDING_OES=34229,Qf.prototype.reset_=function(){if(void 0!==this.vertexArrayObjects)for(let i=0;iIn(n)?void 0:0,Ale={3074:n=>In(n)?void 0:36064,35723:n=>In(n)?void 0:4352,35977:Bi,32937:Bi,36795:(n,e)=>{const t=In(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(kU);return e(t&&t.UNMASKED_VENDOR_WEBGL||7936)},37446:(n,e)=>{const t=n.getExtension(kU);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:Bi,35071:Bi,37447:Bi,36063:(n,e)=>{if(!In(n)){const t=n.getExtension(RU);return t?e(t.MAX_COLOR_ATTACHMENTS_WEBGL):0}},35379:Bi,35374:Bi,35377:Bi,34852:n=>{if(!In(n)){const e=n.getExtension(RU);return e?e.MAX_DRAW_BUFFERS_WEBGL:0}},36203:n=>n.getExtension(PU)?2147483647:65535,33001:n=>n.getExtension(PU)?16777216:65535,33e3:n=>16777216,37157:Bi,35373:Bi,35657:Bi,36183:Bi,37137:Bi,34045:Bi,35978:Bi,35979:Bi,35968:Bi,35376:Bi,35375:Bi,35659:Bi,37154:Bi,35371:Bi,35658:Bi,35076:Bi,35077:Bi,35380:Bi},FU="ANGLE_instanced_arrays",NU={OES_vertex_array_object:{meta:{suffix:"OES"},createVertexArray:()=>{Oo(!1,"VertexArray requires WebGL2 or OES_vertex_array_object extension")},deleteVertexArray:()=>{},bindVertexArray:()=>{},isVertexArray:()=>!1},[FU]:{meta:{suffix:"ANGLE"},vertexAttribDivisor(n,e){Oo(0===e,"WebGL instanced rendering not supported")},drawElementsInstanced:()=>{},drawArraysInstanced:()=>{}},WEBGL_draw_buffers:{meta:{suffix:"WEBGL"},drawBuffers:()=>{Oo(!1)}},EXT_disjoint_timer_query:{meta:{suffix:"EXT"},createQuery:()=>{Oo(!1)},deleteQuery:()=>{Oo(!1)},beginQuery:()=>{Oo(!1)},endQuery:()=>{},getQuery(n,e){return this.getQueryObject(n,e)},getQueryParameter(n,e){return this.getQueryObject(n,e)},getQueryObject:()=>{}}},nI={readBuffer:(n,e,t)=>{In(n)&&e(t)},getVertexAttrib:(n,e,t,i)=>{const{webgl2:r,ext:s}=function(n,e){return{webgl2:In(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(!In(n))switch(i){case 35967:return 35981;case 35971:case 35382:return 0}return e(t,i)},getInternalformatParameter:(n,e,t,i,r)=>{if(!In(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=Ale[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 zle(n,{extension:e,target:t,target2:i}){const r=NU[e];Oo(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)}}globalThis.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 Qf(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&&zle(n,{extension:t,target:n.luma,target2:n})}(n,NU),function(n,{target:e,target2:t}){Object.keys(nI).forEach(i=>{if("function"==typeof nI[i]){const r=n[i]?n[i].bind(n):()=>{},s=nI[i].bind(null,n,r);e[i]=s,t[i]=s}})}(n,{target:e,target2:n}),e.polyfilled=!0),n};const iI={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},uh=(n,e,t)=>e?n.enable(t):n.disable(t),LU=(n,e,t)=>n.hint(t,e),Aa=(n,e,t)=>n.pixelStorei(t,e);function Qv(n){return Array.isArray(n)||ArrayBuffer.isView(n)}const Hle={3042:uh,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:uh,2885:(n,e)=>n.cullFace(e),2929:uh,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:uh,35723:LU,36006:(n,e)=>{const t=In(n)?36009:36160;return n.bindFramebuffer(t,e)},2886:(n,e)=>n.frontFace(e),33170:LU,2849:(n,e)=>n.lineWidth(e),32823:uh,32824:"polygonOffset",10752:"polygonOffset",35977:uh,32938:"sampleCoverage",32939:"sampleCoverage",3089:uh,3088:(n,e)=>n.scissor(...e),2960:uh,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:Aa,3317:Aa,37440:Aa,37441:Aa,37443:Aa,3330:Aa,3332:Aa,3331:Aa,36010:(n,e)=>n.bindFramebuffer(36008,e),3314:Aa,32878:Aa,3316:Aa,3315:Aa,32877:Aa,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=Qv(e)?e:[e,e],n.blendEquationSeparate(...e)},blendFunc:(n,e)=>{e=Qv(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=Qv(e)?e:[e,e];const[t,i]=e;n.stencilMaskSeparate(1028,t),n.stencilMaskSeparate(1029,i)},stencilFunc:(n,e)=>{e=Qv(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=Qv(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 Er(n,e,t){return void 0!==e[n]?e[n]:t[n]}const $le={blendEquation:(n,e,t)=>n.blendEquationSeparate(Er(32777,e,t),Er(34877,e,t)),blendFunc:(n,e,t)=>n.blendFuncSeparate(Er(32969,e,t),Er(32968,e,t),Er(32971,e,t),Er(32970,e,t)),polygonOffset:(n,e,t)=>n.polygonOffset(Er(32824,e,t),Er(10752,e,t)),sampleCoverage:(n,e,t)=>n.sampleCoverage(Er(32938,e,t),Er(32939,e,t)),stencilFuncFront:(n,e,t)=>n.stencilFuncSeparate(1028,Er(2962,e,t),Er(2967,e,t),Er(2963,e,t)),stencilFuncBack:(n,e,t)=>n.stencilFuncSeparate(1029,Er(34816,e,t),Er(36003,e,t),Er(36004,e,t)),stencilOpFront:(n,e,t)=>n.stencilOpSeparate(1028,Er(2964,e,t),Er(2965,e,t),Er(2966,e,t)),stencilOpBack:(n,e,t)=>n.stencilOpSeparate(1029,Er(34817,e,t),Er(34818,e,t),Er(34819,e,t))},BU={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]})},Xc=(n,e)=>n.isEnabled(e),VU={3042:Xc,2884:Xc,2929:Xc,3024:Xc,32823:Xc,32926:Xc,32928:Xc,3089:Xc,2960:Xc,35977:Xc};function zU(n){for(const e in n)return!1;return!0}function Gle(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||iI)){const r=e,s=VU[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=VU[r];i[r]=s?s(n,Number(r)):n.getParameter(Number(r))}return i}(e):Object.assign({},iI),this.log=i,this._updateCache=this._updateCache.bind(this),Object.seal(this)}push(e={}){this.stateStack.push({})}pop(){Oo(this.stateStack.length>0),Xu(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){Oo(void 0!==s);const o=e[s],a=this.cache[s];Gle(o,a)||(t=!0,i=a,r&&!(s in r)&&(r[s]=a),this.cache[s]=o)}return{valueChanged:t,oldValue:i}}}function UU(n,e={}){const{enable:t=!0,copyState:i}=e;if(Oo(void 0!==i),!n.state){const{polyfillContext:r}=globalThis;r&&r(n),n.state=new Yle(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 s in BU)Wle(n,s,BU[s]);jU(n,"getParameter"),jU(n,"isEnabled")}return n.state.enable=t,n}function HU(n){Oo(n.state),n.state.pop()}function Xu(n,e){if(Oo(mS(n),"setParameters requires a WebGL context"),zU(e))return;const t={};for(const r in e){const s=Number(r),o=Hle[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)$le[r](n,e,i)}function rc(n,e,t){if(zU(e))return t(n);const{nocatch:i=!0}=e;let r;if(function(n){n.state||UU(n,{copyState:!1}),n.state.push()}(n),Xu(n,e),i)r=t(n),HU(n);else try{r=t(n)}finally{HU(n)}return r}function yS(){return!("object"==typeof process&&"[object process]"===String(process)&&!process.browser)||function(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;return!!(e&&e.indexOf("Electron")>=0)}()}function mm(n){const{luma:e}=n;if(n.canvas&&e){const{clientWidth:t}=e.canvasSizeInfo;return t?n.drawingBufferWidth/t:1}return 1}function rI(n,e,t=!0){return function(n,e,t,i,r){const s=$U(n[0],e,t);let o=GU(n[1],e,i,r),a=$U(n[0]+1,e,t);const l=a===t-1?a:a-1;let c;return a=GU(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,mm(n),n.drawingBufferWidth,n.drawingBufferHeight,t)}function $U(n,e,t){return Math.min(Math.round(n*e),t-1)}function GU(n,e,t,i){return i?Math.max(0,t-1-Math.round(n*e)):Math.min(Math.round(n*e),t-1)}const sI=yS(),tce=sI&&"undefined"!=typeof document,WU={webgl2:!0,webgl1:!0,throwOnError:!0,manageState:!0,canvas:null,debug:!1,width:800,height:600};function qU(n={}){Oo(sI,"createGLContext only available in the browser.\nCreate your own headless context or use 'createHeadlessContext' from @luma.gl/test-utils"),n=Object.assign({},WU,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?(tce&&"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=oI(r,n),function(n){const e=In(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);vt.info(1,`${e}${n.debug?" debug":""} context ${t?`(${t.vendor},${t.renderer})`:""}`)()}(r),r):null}function oI(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({},WU,e);const{manageState:t,debug:i}=e;return t&&UU(n,{copyState:!1,log:(...r)=>vt.log(1,...r)()}),sI&&i&&(globalThis.makeDebugContext?(n=globalThis.makeDebugContext(n,e),vt.level=Math.max(vt.level,1)):vt.warn('WebGL debug mode not activated. import "@luma.gl/debug" to enable.')()),n._instrumented=!0,n}function YU(){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 XU{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=YU(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(YU()-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 aI{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 XU?e:new XU(t,i)),this.stats[t]}}const Jv="8.5.12",Jf=new class{constructor(){this.stats=new Map}get(e){return this.stats.has(e)||this.stats.set(e,new aI({id:e})),this.stats.get(e)}};if(globalThis.luma&&globalThis.luma.VERSION!==Jv)throw new Error(`luma.gl - multiple VERSIONs detected: ${globalThis.luma.VERSION} vs ${Jv}`);function nt(n,e){if(!n)throw new Error(e||"luma.gl: assertion failed.")}function lI(n,e){if("string"!=typeof e)return e;const t=Number(e);if(!isNaN(t))return t;const i=n[e=e.replace(/^.*\./,"")];return nt(void 0!==i,`Accessing undefined constant GL.${e}`),i}function dh(n,e){e=Number(e);for(const t in n)if(n[t]===e)return`GL.${t}`;return String(e)}globalThis.luma||(yS()&&vt.log(1,`luma.gl ${Jv} - set luma.log.level=1 (or higher) to trace rendering`)(),globalThis.luma=globalThis.luma||{VERSION:Jv,version:Jv,log:vt,stats:Jf,globals:{modules:{},nodeIO:{}}}),globalThis;const cI={};function ea(n="id"){return cI[n]=cI[n]||1,`${n}-${cI[n]++}`}function KU(n){return nt("number"==typeof n,"Input must be a number"),n&&0==(n&n-1)}function _m(n){let e=!0;for(const t in n){e=!1;break}return e}function ZU(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 vt.removed(`Calling removed method ${e}.${o}: `,r)(),new Error(o)})})}const ym="Resource subclass must define virtual methods";class Ku{get[Symbol.toStringTag](){return"Resource"}constructor(e,t={}){_S(e);const{id:i,userData:r={}}=t;this.gl=e,this.gl2=e,this.id=i||ea(this[Symbol.toStringTag]),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[Symbol.toStringTag]||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={}){nt(e=lI(this.gl,e));const r=(this.constructor.PARAMETERS||{})[e];if(r){const s=In(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=In(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?dh(this.gl,l):l;o[f]=this.getParameter(l,e),i&&"GLenum"===c.type&&(o[f]=dh(this.gl,o[f]))}}return o}setParameter(e,t){nt(e=lI(this.gl,e));const r=(this.constructor.PARAMETERS||{})[e];if(r){const s=In(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=lI(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 ZU(this,e,t,i)}initialize(e){}_createHandle(){throw new Error(ym)}_deleteHandle(){throw new Error(ym)}_bindHandle(e){throw new Error(ym)}_getOptsFromHandle(){throw new Error(ym)}_getParameter(e,t){throw new Error(ym)}_setParameter(e,t){throw new Error(ym)}_context(){return this.gl.luma=this.gl.luma||{},this.gl.luma}_addStats(){const e=this[Symbol.toStringTag],t=Jf.get("Resource Counts");t.get("Resources Created").incrementCount(),t.get(`${e}s Created`).incrementCount(),t.get(`${e}s Active`).incrementCount()}_removeStats(){const e=this[Symbol.toStringTag];Jf.get("Resource Counts").get(`${e}s Active`).decrementCount()}_trackAllocatedMemory(e,t=this[Symbol.toStringTag]){const i=Jf.get("Memory Usage");i.get("GPU Memory").addCount(e),i.get(`${t} Memory`).addCount(e),this.byteLength=e}_trackDeallocatedMemory(e=this[Symbol.toStringTag]){const t=Jf.get("Memory Usage");t.get("GPU Memory").subtractCount(this.byteLength),t.get(`${e} Memory`).subtractCount(this.byteLength),this.byteLength=0}}function uI(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 eb(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 fce({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 ta.getBytesPerElement(this)}get BYTES_PER_VERTEX(){return ta.getBytesPerVertex(this)}_assign(e={}){return void 0!==(e=dI("Accessor",e,gce)).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 JU={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"},mce={removedProps:{},replacedProps:{bytes:"byteLength"},deprecatedProps:JU},_ce={removedProps:JU};class Ai extends Ku{get[Symbol.toStringTag](){return"Buffer"}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/ta.getBytesPerElement(e))}getVertexCount(e=this.accessor){return Math.round(this.byteLength/ta.getBytesPerVertex(e))}initialize(e={}){return ArrayBuffer.isView(e)&&(e={data:e}),Number.isFinite(e)&&(e={byteLength:e}),e=dI("Buffer",e,mce),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=dI("Buffer",e,_ce))&&this.setAccessor(e.accessor),this}setAccessor(e){return delete(e=Object.assign({},e)).buffer,this.accessor=new ta(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;nt(t);const o=this.gl.webgl2?36663:this.target;return this.gl.bindBuffer(o,this.handle),0!==r||void 0!==s?(eo(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 eo(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}={}){eo(this.gl);const s=eb(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 nt((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):(nt(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){nt(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=uI(e);return nt(s),this.setAccessor(new ta(this.accessor,{type:s})),this}_setByteLength(e,t=this.usage){nt(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/eb(this.accessor.type||5126,{clamped:!1}).BYTES_PER_ELEMENT;return this.getElementCount()-i}_inferType(e){this.accessor.type||this.setAccessor(new ta(this.accessor,{type:uI(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 vt.deprecated("Buffer.type","Buffer.accessor.type")(),this.accessor.type}get bytes(){return vt.deprecated("Buffer.bytes","Buffer.byteLength")(),this.byteLength}setByteLength(e){return vt.deprecated("setByteLength","reallocate")(),this.reallocate(e)}updateAccessor(e){return vt.deprecated("updateAccessor(...)","setAccessor(new Accessor(buffer.accessor, ...)")(),this.accessor=new ta(this.accessor,e),this}}const hI={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}},e4={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},t4={5126:4,5125:4,5124:4,5123:2,5122:2,5131:2,5120:1,5121:1},bce=[9729,9728],n4=globalThis.WebGLBuffer||function(){};class ep extends Ku{get[Symbol.toStringTag](){return"Texture"}static isSupported(e,t={}){const{format:i,linearFiltering:r}=t;let s=!0;return i&&(s=s&&function(n,e){const t=hI[e];if(!t)return!1;if(void 0===t.gl1&&void 0===t.gl2)return!0;const i=In(n)&&t.gl2||t.gl1;return"string"==typeof i?n.getExtension(i):i}(e,i),s=s&&(!r||function(n,e){const t=hI[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=ea("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(w=>this.initialize(Object.assign({},e,{pixels:w,data:w}))),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:y=!1,mipmaps:v=!0}=e;const{depth:C=0}=e;return({width:f,height:p,compressed:y,dataFormat:g,type:_}=this._deduceParameters({format:s,type:_,dataFormat:g,compressed:y,data:t,width:f,height:p})),this.width=f,this.height=p,this.depth=C,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)),v&&this._isNPOT()&&(vt.warn(`texture: ${this} is Non-Power-Of-Two, disabling mipmaping`)(),v=!1,this._updateForNPOT(l)),this.mipmaps=v,this.setImageData({data:t,width:f,height:p,depth:C,format:s,type:_,dataFormat:g,border:o,mipmaps:v,parameters:c,compressed:y}),v&&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:y}=this;y.bindTexture(this.target,this.handle);let v=null;({data:c,dataType:v}=this._getDataType({data:c,compressed:_}));let C,w=0;return rc(this.gl,l,()=>{switch(v){case"null":y.texImage2D(t,r,s,f,p,o,g,d,c);break;case"typed-array":y.texImage2D(t,r,s,f,p,o,g,d,c,a);break;case"buffer":C=eo(y),C.bindBuffer(35052,c.handle||c),C.texImage2D(t,r,s,f,p,o,g,d,a),C.bindBuffer(35052,null);break;case"browser-object":In(y)?y.texImage2D(t,r,s,f,p,o,g,d,c):y.texImage2D(t,r,s,g,d,c);break;case"compressed":for(const[x,N]of c.entries())y.compressedTexImage2D(t,x,N.format,N.width,N.height,o,N.data),w+=N.levelSize;break;default:nt(!1,"Unknown image data type")}}),this._trackAllocatedMemory("compressed"===v?w:c&&c.byteLength?c.byteLength:this.width*this.height*(e4[this.dataFormat]||4)*(t4[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:y={}}){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})),nt(0===this.depth,"texSubImage not supported for 3D textures"),i||(i=t),i&&i.data){const v=i;i=v.data,o=v.shape[0],a=v.shape[1]}i instanceof Ai&&(i=i.handle),this.gl.bindTexture(this.target,this.handle),rc(this.gl,y,()=>{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 n4){const v=eo(this.gl);v.bindBuffer(35052,i),v.texSubImage2D(e,l,r,s,o,a,f,d,g),v.bindBuffer(35052,null)}else In(this.gl)?eo(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 vt.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 Ai?{data:e.handle,dataType:"buffer"}:e instanceof n4?{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=hI[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},nt(r,"Could not deduced texture size"),nt(void 0===t||r.width===t,"Deduced texture width does not match supplied width"),nt(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:nt(!1);break;default:this.gl.texParameteri(this.target,e,t)}return this.gl.bindTexture(this.target,null),this}_isNPOT(){return!(In(this.gl)||!this.width||!this.height||KU(this.width)&&KU(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===bce.indexOf(t)&&(t=9729);break;case 10242:case 10243:33071!==t&&(t=33071)}return t}}function Cce(n,e){return nt("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 na extends ep{get[Symbol.toStringTag](){return"Texture2D"}static isSupported(e,t){return ep.isSupported(e,t)}constructor(e,t={}){_S(e),(t instanceof Promise||"string"==typeof t)&&(t={data:t}),"string"==typeof t.data&&(t=Object.assign({},t,{data:Cce(t.data)})),super(e,Object.assign({},t,{target:3553})),this.initialize(t),Object.seal(this)}}const tp="EXT_color_buffer_float",i4={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:tp,bpp:2},33327:{gl2:tp,bpp:4},34842:{gl2:tp,bpp:8},33326:{gl2:tp,bpp:4},33328:{gl2:tp,bpp:8},34836:{gl2:tp,bpp:16},35898:{gl2:tp,bpp:4}};class vm extends Ku{get[Symbol.toStringTag](){return"Renderbuffer"}static isSupported(e,{format:t}={format:null}){return!t||function(n,e,t){const i=t[e];if(!i)return!1;const r=In(n)&&i.gl2||i.gl1;return"string"==typeof r?n.getExtension(r):r}(e,t,i4)}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 nt(e,"Needs format"),this._trackDeallocatedMemory(),this.gl.bindRenderbuffer(36161,this.handle),0!==r&&In(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)*i4[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 l4="clear: bad arguments";function pI(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)),nt(0!==o,l4),rc(n,s,()=>{n.clear(o)})}function c4(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 yn(n){return function(){var e=this,t=arguments;return new Promise(function(i,r){var s=n.apply(e,t);function o(l){c4(s,i,r,o,a,"next",l)}function a(l){c4(s,i,r,o,a,"throw",l)}o(void 0)})}}const gI=[34069,34070,34071,34072,34073,34074];let Ace=(()=>{class n extends ep{get[Symbol.toStringTag](){return"TextureCube"}constructor(t,i={}){_S(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 yn(function*(){const{gl:d}=c,f=r||s,p=yield Promise.all(gI.map(g=>{const _=f[g];return Promise.all(Array.isArray(_)?_:[_])}));c.bind(),gI.forEach((g,_)=>{p[_].length>1&&!1!==c.opts.mipmaps&&vt.warn(`${c.id} has mipmap and multiple LODs.`)(),p[_].forEach((y,v)=>{t&&i?d.texImage2D(g,v,a,t,i,o,a,l,y):d.texImage2D(g,v,a,a,l,y)})}),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=gI,n})();class Dce extends ep{get[Symbol.toStringTag](){return"Texture3D"}static isSupported(e){return In(e)}constructor(e,t={}){eo(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),rc(this.gl,f,()=>{ArrayBuffer.isView(d)&&this.gl.texImage3D(this.target,e,t,i,r,s,o,a,l,d),d instanceof Ai&&(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*(e4[this.dataFormat]||4)*(t4[this.type]||1),"Texture"),this.loaded=!0,this}}function u4(n,e){nt(n instanceof na||n instanceof Ace||n instanceof Dce);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},e))}function Oce(n,e){const{gl:t,width:i,height:r,id:s}=n;return new ss(t,Object.assign({},e,{id:`framebuffer-for-${s}`,width:i,height:r,attachments:{36064:n}}))}function vS(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}=tb(n);nt(d);const{gl:p,handle:g,attachments:_}=d;a=a||d.width,l=l||d.height,36064===s&&null===g&&(s=1028),nt(_[s]),c=c||_[s].type,o=function(n,e,t,i,r){if(n)return n;return new(eb(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 nt(!1),0}}(t))}(o,c,r,a,l),c=c||uI(o);const y=p.bindFramebuffer(36160,g);return p.readPixels(t,i,a,l,r,c,o),p.bindFramebuffer(36160,y||null),f&&d.delete(),o}function mI(n,{sourceAttachment:e=36064,targetMaxHeight:t=Number.MAX_SAFE_INTEGER}={}){let i=vS(n,{sourceAttachment:e}),{width:r,height:s}=n;for(;s>t;)({data:i,width:r,height:s}=fce({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 nt(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&&vt.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){nt(void 0!==o,"Misspelled framebuffer binding point?");const a=Number(o),l=r[a];let c=l;if(c)if(c instanceof vm)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(ss.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)&&pI(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]}={}){eo(n),rc(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:nt(!1,l4)}})}(this.gl,{drawBuffer:l,value:a})}),this.gl.bindFramebuffer(36160,o||null),this}readPixels(e={}){return vt.error("Framebuffer.readPixels() is no logner supported, use readPixelsToArray(framebuffer)")(),null}readPixelsToBuffer(e={}){return vt.error("Framebuffer.readPixelsToBuffer()is no logner supported, use readPixelsToBuffer(framebuffer)")(),null}copyToDataUrl(e={}){return vt.error("Framebuffer.copyToDataUrl() is no logner supported, use copyToDataUrl(framebuffer)")(),null}copyToImage(e={}){return vt.error("Framebuffer.copyToImage() is no logner supported, use copyToImage(framebuffer)")(),null}copyToTexture(e={}){return vt.error("Framebuffer.copyToTexture({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null}blit(e={}){return vt.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=eo(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=dh(this.gl,r)),r}getAttachmentParameters(e=36064,t,i=this.constructor.ATTACHMENT_PARAMETERS||[]){const r={};for(const s of i)r[t?dh(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?dh(this.gl,s):s]=this.getAttachmentParameters(s,e)}return i}show(){return"undefined"!=typeof window&&window.open(mI(this),"luma-debug-texture"),this}log(e=0,t=""){if(e>vt.level||"undefined"==typeof window)return this;t=t||`Framebuffer ${this.id}`;const i=mI(this,{targetMaxHeight:100});return vt.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 na(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 vm(this.gl,{id:`${this.id}-depth-stencil`,format:35056,width:r,height:111}),this.ownResources.push(o[33306])):t?(o=o||{},o[36096]=new vm(this.gl,{id:`${this.id}-depth`,format:33189,width:r,height:s}),this.ownResources.push(o[36096])):i&&nt(!1),o}_unattach(e){const t=this.attachments[e];!t||(t instanceof vm?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:eo(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:nt(!1,"Illegal texture type")}s.bindTexture(t.target,null),this.attachments[e]=t}_setReadBuffer(e){const t=function(n){return In(n)?n:null}(this.gl);t?t.readBuffer(e):nt(36064===e||1029===e,d4),this.readBuffer=e}_setDrawBuffers(e){const{gl:t}=this,i=eo(t);if(i)i.drawBuffers(e);else{const r=t.getExtension("WEBGL_draw_buffers");r?r.drawBuffersWEBGL(e):nt(1===e.length&&(36064===e[0]||1029===e[0]),d4)}this.drawBuffers=e}_getAttachmentParameterFallback(e){const t=function(n){n.luma=n.luma||{},n.luma.caps=n.luma.caps||{};for(const e in h4)void 0===n.luma.caps[e]&&(n.luma.caps[e]=p4(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)}}ss.ATTACHMENT_PARAMETERS=[36049,36048,33296,33298,33299,33300,33301,33302,33303];const h4={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 na(n,{format:6408,type:5126,dataFormat:6408}),t=new ss(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 _I(n,e){return f4(n,e)}function f4(n,e){return(e=Array.isArray(e)?e:[e]).every(t=>p4(n,t))}function p4(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=h4[e];let i;nt(t,e);const r=In(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:nt(!1);return i}(n,e)),n.luma.caps[e]||vt.log(2,`Feature: ${e} not supported`)(),n.luma.caps[e]}class yI{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()}},Hce=(Math,1/180*Math.PI),Ji={};function Gce(n,{precision:e=Ji.precision||4}={}){return n=function(n){return Math.round(n/Ji.EPSILON)*Ji.EPSILON}(n),`${parseFloat(n.toPrecision(e))}`}function hh(n){return Array.isArray(n)||ArrayBuffer.isView(n)&&!(n instanceof DataView)}function Zu(n,e,t){if(hh(n)){t=t||function(n){return n.clone?n.clone():new Array(n.length)}(n);for(let i=0;it*Hce,void 0)}(n)}function np(n,e,t){return Zu(n,i=>Math.max(e,Math.min(t,i)))}function bS(n,e,t){return hh(n)?n.map((i,r)=>bS(i,e[r],t)):t*e+(1-t)*n}function rb(n,e,t){const i=Ji.EPSILON;t&&(Ji.EPSILON=t);try{if(n===e)return!0;if(hh(n)&&hh(e)){if(n.length!==e.length)return!1;for(let r=0;r0?", ":"")+Gce(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&&(M4.length=n.length,i=M4):i=S4,(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 x4(n){return n&&n[Symbol.asyncIterator]}function EI(n,e=(()=>!0)){return Array.isArray(n)?T4(n,e,[]):e(n)?[n]:[]}function T4(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 A4(n,e){return n?(Number.isFinite(n)&&(n={duration:n}),n.type=n.type||"interpolation",K(K(K({},Mue[n.type]),e),n)):null}function D4(n,e){return e.getBuffer()?[e.getBuffer(),{divisor:0,size:e.size,normalized:e.settings.normalized}]:e.value}function O4(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 I4(n){n.push(n.shift())}function MI(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 P4({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=MI(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 C=s;s=(w,x)=>t._normalizeConstant(C(w,x))}const _=p?(C,w)=>s(g,w):(C,w)=>s(g.subarray(C,C+a),w),y=n.getData({length:i}),v=new Float32Array(f);(function({source:n,target:e,size:t,getData:i,sourceStartIndices:r,targetStartIndices:s}){if(!Array.isArray(s))return SI({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===MS||(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=MS}clearNeedsUpdate(){this.state.needsUpdate=!1,this.state.updateRanges=wue}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!==MS}),!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 v=f*a+l;for(let C=0;Cd?c.set(x,y):(e._normalizeValue(x,C.target,0),Cue({target:c,source:C.target,start:y,count:N}));y+=N*d}else e._normalizeValue(x,c,y),y+=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 TI={};function no(n){jn.level>0&&TI[n]&&TI[n].call(...arguments)}function Da(n,e){if(!n)throw new Error(e||"shadertools: assertion failed.")}const R4="out vec4 transform_output;\nvoid main() {\n transform_output = vec4(0);\n}",Aue=`#version 300 es\n${R4}`;function k4(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 F4(n={}){const{version:e=100,input:t,inputType:i,output:r}=n;if(!t)return 300===e?Aue:e>300?`#version ${e}\n${R4}`:"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 Da(!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 N4 extends Ku{get[Symbol.toStringTag](){return"TransformFeedback"}static isSupported(e){return In(e)}constructor(e,t={}){eo(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,_m(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,vt.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 Ai?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 Pue{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 Ai?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&&nt(In(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 N4(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],nt(i[s]instanceof Ai)}return{sourceBuffers:t,feedbackBuffers:i}}_createNewBuffer(e,t){const i=new Ai(this.gl,t);return this.resources[e]&&this.resources[e].delete(),this.resources[e]=i,i}_getNextIndex(){return(this.currentIndex+1)%2}}function L4(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 ab="vs",Fue={[ab]:"#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"},xS="__LUMA_INJECT_DECLARATIONS__",B4=/void\s+main\s*\([^)]*\)\s*\{\n?/,V4=/}\n?[^{}]*$/,DI=[];function z4(n,e,t,i=!1){const r=e===ab;for(const s in t){const o=t[s];o.sort((l,c)=>l.order-c.order),DI.length=o.length;for(let l=0,c=o.length;ll+a));break;case"vs:#main-end":r&&(n=n.replace(V4,l=>a+l));break;case"fs:#decl":r||(n=n.replace(xS,a));break;case"fs:#main-start":r||(n=n.replace(B4,l=>l+a));break;case"fs:#main-end":r||(n=n.replace(V4,l=>a+l));break;default:n=n.replace(s,l=>l+a)}}return n=n.replace(xS,""),i&&(n=n.replace(/\}\s*$/,s=>s+Fue[e])),n}function OI(n){const e={};return Da(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 Nue={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},TS="transform_uSize_",j4="transform_position";const $ue={10241:9728,10240:9728,10242:33071,10243:33071};class Wue{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[`${TS}${e}`]=[r,s]);for(const o in n)({width:r,height:s}=n[o]),i[`${TS}${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=vS(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 Da(!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 Ai(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 ss(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($ue)}_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=u4(e,{parameters:{10241:9728,10240:9728,10242:33071,10243:33071},pixelStore:{37440:!1}});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 y=function(n,e){const t={},i=function(n){return k4(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=`${TS}${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 Da(!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(y){const{updatedLine:v,inject:C}=y;f[g]=v,c=OI([c,C]),Object.assign(a,y.samplerTextureMap),s--}}t&&!o&&(o=function(n,e){const t=k4(n,["varying","out"]);return t&&t.name===e?t.type:null}(p,t))}),t){nt(i);const p=`${TS}${t}`;c=OI([c,{"vs:#decl":`uniform vec2 ${p};\n`,"vs:#main-start":` vec2 ${j4} = transform_getPos(${p});\n gl_Position = vec4(${j4}, 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=OI([e.inject||{},a]);return this.targetTextureType=o,this.samplerTextureMap=l,{vs:r,fs:e._fs||F4({version:L4(r),input:this.targetTextureVarying,inputType:o,output:"transform_output"}),modules:this.hasSourceTextures||this.targetTextureVarying?[Nue].concat(e.modules||[]):e.modules,uniforms:s,inject:c}}}const II={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 Yue(n){let e=U4(n);return"object"===e?n?"type"in n?Object.assign({},n,II[n.type]):"value"in n?(e=U4(n.value),Object.assign({type:e},n,II[e])):{type:"object",value:n}:{type:"object",value:null}:Object.assign({type:e,value:n},II[e])}function U4(n){return Array.isArray(n)||ArrayBuffer.isView(n)?"array":typeof n}class PI{constructor({name:e,vs:t,fs:i,dependencies:r=[],uniforms:s,getUniforms:o,deprecations:a=[],defines:l={},inject:c={},vertexShader:d,fragmentShader:f}){Da("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=Yue(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:Da(!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&&Da(s.validate(e[r],s),`${this.name}: invalid ${r}`),t[r]=e[r]):t[r]=s.value}return t}}function Que(n){return function(n){const e={},t={};return RI({modules:n,level:0,moduleMap:e,moduleDepth:t}),Object.keys(t).sort((i,r)=>t[r]-t[i]).map(i=>e[i])}($4(n))}function RI({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 PI||(Da("string"!=typeof t,`Shader module use by name is deprecated. Import shader module '${t}' and use it directly.`),Da(t.name,"shader module has no name"),(t=new PI(t)).dependencies=$4(t.dependencies)),t))}const kI={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]},ip={};function ode(n,e){return n.match(/NVIDIA/i)||e.match(/NVIDIA/i)?"NVIDIA":n.match(/INTEL/i)||e.match(/INTEL/i)?"INTEL":n.match(/AMD/i)||e.match(/AMD/i)||n.match(/ATI/i)||e.match(/ATI/i)?"AMD":"UNKNOWN GPU"}Object.keys(kI).forEach(n=>{ip[n]=n});const FI={};function G4(n,e,t={}){const i=kI[e];if(Da(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 FI)return FI[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),FI[e]=l,l}function AS(n,e){return(e=Array.isArray(e)?e:[e]).every(t=>function(n,e){const t=kI[e];Da(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 Da(!1===r||!0===r),r}(n,t))}function Cm(n){return new RegExp(`\\b${n}[ \\t]+(\\w+[ \\t]+\\w+(\\[\\w+\\])?;)`,"g")}const W4=[[/^(#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("]],ude=[...W4,[Cm("attribute"),"in $1"],[Cm("varying"),"out $1"]],dde=[...W4,[Cm("varying"),"in $1"]],q4=[[/^#version[ \t]+300[ \t]+es/,"#version 100"],[/\btexture(2D|2DProj|Cube)Lod\(/g,"texture$1LodEXT("],[/\btexture\(/g,"texture2D("],[/\btextureLod\(/g,"texture2DLodEXT("]],hde=[...q4,[Cm("in"),"attribute $1"],[Cm("out"),"varying $1"]],fde=[...q4,[Cm("in"),"varying $1"]],NI="gl_FragColor",LI=/\bout[ \t]+vec4[ \t]+(\w+)[ \t]*;\n?/,pde=/void\s+main\s*\([^)]*\)\s*\{\n?/;function DS(n,e){for(const[t,i]of e)n=n.replace(t,i);return n}const yde=`\n\n${xS}\n\n`,Y4={[ab]:"vertex",fs:"fragment"};function X4(n,{id:e,source:t,type:i,modules:r,defines:s={},hookFunctions:o=[],inject:a={},transpileToGLSL100:l=!1,prologue:c=!0,log:d}){Da("string"==typeof t,"shader source must be a string");const f=i===ab,p=t.split("\n");let g=100,_="",y=t;0===p[0].indexOf("#version ")?(g=300,_=p[0],y=p.slice(1).join("\n")):_=`#version ${g}`;const v={};r.forEach(U=>{Object.assign(v,U.getDefines())}),Object.assign(v,s);let C=c?`${_}\n${function({id:n,source:e,type:t}){return n&&"string"==typeof n&&-1===e.indexOf("SHADER_NAME")?`\n#define SHADER_NAME ${n}_${Y4[t]}\n\n`:""}({id:e,source:t,type:i})}\n${function({type:n}){return`\n#define SHADER_TYPE_${Y4[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:ode(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// 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"}}(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 AS(n,ip.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"),AS(n,ip.GLSL_DERIVATIVES)&&G4(n,ip.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"),AS(n,ip.GLSL_FRAG_DATA)&&G4(n,ip.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"),AS(n,ip.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}(v)}\n${f?"":"precision highp float;\n\n"}\n`:`${_}\n`;const w=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),x={},N={},V={};for(const U in a){const ee="string"==typeof a[U]?{injection:a[U],order:0}:a[U],de=U.match(/^(v|f)s:(#)?([\w-]+)$/);if(de){const me=de[3];de[2]?"decl"===me?N[U]=[ee]:V[U]=[ee]:x[U]=[ee]}else V[U]=[ee]}for(const U of r){d&&U.checkDeprecations(y,d),C+=U.getModuleSource(i,g);const de=U.injections[i];for(const ae in de){const me=ae.match(/^(v|f)s:#([\w-]+)$/);if(me){const Be="decl"===me[2]?N:V;Be[ae]=Be[ae]||[],Be[ae].push(de[ae])}else x[ae]=x[ae]||[],x[ae].push(de[ae])}}return C+=yde,C=z4(C,i,N),C+=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}(w[i],x),C+=y,C=z4(C,i,V),C=function(n,e,t){switch(e){case 300:return t?DS(n,ude):function(n){const e=(n=DS(n,dde)).match(LI);if(e){const t=e[1];n=n.replace(new RegExp(`\\b${NI}\\b`,"g"),t)}else{const t="fragmentColor";n=n.replace(pde,i=>`out vec4 ${t};\n${i}`).replace(new RegExp(`\\b${NI}\\b`,"g"),t)}return n}(n);case 100:return t?DS(n,hde):function(n){const e=(n=DS(n,fde)).match(LI);if(e){const t=e[1];n=n.replace(LI,"").replace(new RegExp(`\\b${t}\\b`,"g"),NI)}return n}(n);default:throw new Error(`unknown GLSL version ${e}`)}}(C,l?100:g,f),C}function Cde(n){return function(t){const i={};for(const r of n){const s=r.getUniforms(t,i);Object.assign(i,s)}return i}}const Tde={5126:er.bind(null,"uniform1fv",Oa,1,io),35664:er.bind(null,"uniform2fv",Oa,2,io),35665:er.bind(null,"uniform3fv",Oa,3,io),35666:er.bind(null,"uniform4fv",Oa,4,io),5124:er.bind(null,"uniform1iv",fh,1,io),35667:er.bind(null,"uniform2iv",fh,2,io),35668:er.bind(null,"uniform3iv",fh,3,io),35669:er.bind(null,"uniform4iv",fh,4,io),35670:er.bind(null,"uniform1iv",fh,1,io),35671:er.bind(null,"uniform2iv",fh,2,io),35672:er.bind(null,"uniform3iv",fh,3,io),35673:er.bind(null,"uniform4iv",fh,4,io),35674:er.bind(null,"uniformMatrix2fv",Oa,4,Ju),35675:er.bind(null,"uniformMatrix3fv",Oa,9,Ju),35676:er.bind(null,"uniformMatrix4fv",Oa,16,Ju),35678:Fs,35680:Fs,5125:er.bind(null,"uniform1uiv",OS,1,io),36294:er.bind(null,"uniform2uiv",OS,2,io),36295:er.bind(null,"uniform3uiv",OS,3,io),36296:er.bind(null,"uniform4uiv",OS,4,io),35685:er.bind(null,"uniformMatrix2x3fv",Oa,6,Ju),35686:er.bind(null,"uniformMatrix2x4fv",Oa,8,Ju),35687:er.bind(null,"uniformMatrix3x2fv",Oa,6,Ju),35688:er.bind(null,"uniformMatrix3x4fv",Oa,12,Ju),35689:er.bind(null,"uniformMatrix4x2fv",Oa,8,Ju),35690:er.bind(null,"uniformMatrix4x3fv",Oa,12,Ju),35678:Fs,35680:Fs,35679:Fs,35682:Fs,36289:Fs,36292:Fs,36293:Fs,36298:Fs,36299:Fs,36300:Fs,36303:Fs,36306:Fs,36307:Fs,36308:Fs,36311:Fs},Ade={},Dde={},Ode={},K4=[0];function BI(n,e,t,i){1===e&&"boolean"==typeof n&&(n=n?1:0),Number.isFinite(n)&&(K4[0]=n,n=K4);const r=n.length;if(r%e&&vt.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 er(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{nt(s===d,"Uniform length cannot change.");for(let p=0;p{const a=String(o+e);return e5(a,r-a.length)+t+s})}(e);return{shaderName:l,errors:J4(s,c),warnings:J4(o,c)}}(i,this.source,this.shaderType,this.id);throw vt.error(`GLSL compilation errors in ${r}\n${s}`)(),vt.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 VI extends lb{get[Symbol.toStringTag](){return"VertexShader"}constructor(e,t){"string"==typeof t&&(t={source:t}),super(e,Object.assign({},t,{shaderType:35633}))}_createHandle(){return this.gl.createShader(35633)}}class zI extends lb{get[Symbol.toStringTag](){return"FragmentShader"}constructor(e,t){"string"==typeof t&&(t={source:t}),super(e,Object.assign({},t,{shaderType:35632}))}_createHandle(){return this.gl.createShader(35632)}}const os=5126,cb=5124,ub=5125,jI={[os]:[os,1,"float"],35664:[os,2,"vec2"],35665:[os,3,"vec3"],35666:[os,4,"vec4"],[cb]:[cb,1,"int"],35667:[cb,2,"ivec2"],35668:[cb,3,"ivec3"],35669:[cb,4,"ivec4"],[ub]:[ub,1,"uint"],36294:[ub,2,"uvec2"],36295:[ub,3,"uvec3"],36296:[ub,4,"uvec4"],35670:[os,1,"bool"],35671:[os,2,"bvec2"],35672:[os,3,"bvec3"],35673:[os,4,"bvec4"],35674:[os,8,"mat2"],35685:[os,8,"mat2x3"],35686:[os,8,"mat2x4"],35675:[os,12,"mat3"],35687:[os,12,"mat3x2"],35688:[os,12,"mat3x4"],35676:[os,16,"mat4"],35689:[os,16,"mat4x2"],35690:[os,16,"mat4x3"]};function o5(n){const e=jI[n];if(!e)return null;const[t,i]=e;return{type:t,components:i}}function a5(n,e){switch(n){case 5120:case 5121:case 5122:case 5123:n=os}for(const t in jI){const[i,r,s]=jI[t];if(i===n&&r===e)return{glType:t,name:s}}return null}class phe{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(!In(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}=o5(i),a={type:s,size:r*o};this._inferProperties(e,t,a);const l={location:e,name:t,accessor:new ta(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}=o5(i),l={location:e,name:t,accessor:new ta({type:s,size:r*o})};this.varyingInfos.push(l),this.varyingInfosByName[l.name]=l}}const ghe=35981,mhe=["setVertexArray","setAttributes","setBuffers","unsetBuffers","use","getUniformCount","getUniformInfo","getUniformLocation","getUniformValue","getVarying","getFragDataLocation","getAttachedShaders","getAttributeCount","getAttributeLocation","getAttributeInfo"];class c5 extends Ku{get[Symbol.toStringTag](){return"Program"}constructor(e,t={}){super(e,t),this.stubRemovedMethods("Program","v6.0",mhe),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=ghe}=e;return this.hash=t||"",this.vs="string"==typeof i?new VI(this.gl,{id:`${e.id}-vs`,source:i}):i,this.fs="string"==typeof r?new zI(this.gl,{id:`${e.id}-fs`,source:r}):r,nt(this.vs instanceof VI),nt(this.fs instanceof zI),this.uniforms={},this._textureUniforms={},s&&s.length>0&&(eo(this.gl),this.varyings=s,this.gl2.transformFeedbackVaryings(this.handle,s,o)),this._compileAndLink(),this._readUniformLocationsFromLinkedProgram(),this.configuration=new phe(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:y,samplers:v}){if((y||v)&&(vt.deprecated("Program.draw({uniforms})","Program.setUniforms(uniforms)")(),this.setUniforms(y||{})),vt.priority>=e){const C=g?g.id:"default",w=`mode=${dh(this.gl,t)} verts=${i} instances=${c} indexType=${dh(this.gl,l)} isInstanced=${d} isIndexed=${a} Framebuffer=${C}`;vt.log(e,w)()}return nt(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 C=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 nt(!1),0}}(t);p.begin(C)}this._bindTextures(),rc(this.gl,_,()=>{a&&d?this.gl2.drawElementsInstanced(t,i,l,r,c):a&&In(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={}){vt.priority>=2&&function(n,e,t){for(const i in n){const r=n[i];if((!t||Boolean(t[i]))&&!Rde(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 ss&&(s=s.texture),s instanceof ep)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)&&kde(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 VI({handle:r});break;case 35632:i.fs=new zI({handle:r})}return i}_getParameter(e){return this.gl.getProgramParameter(this.handle,e)}_setId(e){if(!e){const t=this._getName();this.id=ea(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),vt.time(4,`linkProgram for ${this._getName()}`)(),e.linkProgram(this.handle),vt.timeEnd(4,`linkProgram for ${this._getName()}`)(),e.debug||vt.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(x=>this._getHash(x.name)).sort(),g=o.map(x=>this._getHash(x)),_=Object.keys(r).sort(),y=Object.keys(s).sort(),v=[],C=[];for(const x of _)v.push(this._getHash(x)),v.push(this._getHash(r[x]));for(const x of y)C.push(this._getHash(x)),C.push(this._getHash(s[x]));const w=`${d}/${f}D${v.join("/")}M${p.join("/")}I${C.join("/")}V${g.join("/")}H${this.stateHash}B${a}${l?"T":""}`;if(!this._programCache[w]){const x=function(n,e){const{vs:t,fs:i}=e,r=Que(e.modules||[]);return{gl:n,vs:X4(n,Object.assign({},e,{source:t,type:ab,modules:r})),fs:X4(n,Object.assign({},e,{source:i,type:"fs",modules:r})),getUniforms:Cde(r)}}(this.gl,{vs:t,fs:i,modules:c,inject:s,defines:r,hookFunctions:this._hookFunctions,transpileToGLSL100:l});this._programCache[w]=new c5(this.gl,{hash:w,vs:x.vs,fs:x.fs,varyings:o,bufferMode:a}),this._getUniforms[w]=x.getUniforms||(N=>{}),this._useCounts[w]=0}return this._useCounts[w]++,this._programCache[w]}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":Xv.chrome?"Chrome":Xv.safari?"Safari":Xv.mozInnerScreenX?"Firefox":"Unknown"}()}static getDefaultArray(e){return e.luma=e.luma||{},e.luma.defaultVertexArray||(e.luma.defaultVertexArray=new Ia(e,{handle:null,isDefaultArray:!0})),e.luma.defaultVertexArray}static getMaxAttributes(e){return Ia.MAX_ATTRIBUTES=Ia.MAX_ATTRIBUTES||e.getParameter(34921),Ia.MAX_ATTRIBUTES}static setConstant(e,t,i){switch(i.constructor){case Float32Array:Ia._setConstantFloatArray(e,t,i);break;case Int32Array:Ia._setConstantIntArray(e,t,i);break;case Uint32Array:Ia._setConstantUintArray(e,t,i);break;default:nt(!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 Ia.getMaxAttributes(this.gl)}initialize(e={}){return this.setProps(e)}setProps(e){return this}setElementBuffer(e=null,t={}){return nt(!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?(nt(In(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&&!Ia.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 Ai(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(!RS||RS.byteLength{switch(e){case 34373:return this.gl.getVertexAttribOffset(t,e);default:return this.gl.getVertexAttrib(t,e)}})}}const Ehe=/^(.+)__LOCATION_([0-9]+)$/,She=["setBuffers","setGeneric","clearBindings","setLocations","setGenericValues","setDivisor","enable","disable"];class Mhe{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 Ia(e),ZU(this,"VertexArray","v6.0",She),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 Ai(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,vt.once(3,()=>`unused value ${e} in ${this.id}`)(),s;const l=this._getAttributeInfo(a||o);if(!l)return s;const d=ta.resolve(l.accessor,this.accessors[o]||{},i,r),{size:f,type:p}=d;return nt(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=Ehe.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 Ai)this.setBuffer(e,t);else if(Array.isArray(t)&&t.length&&t[0]instanceof Ai)this.setBuffer(e,t[0],t[1]);else if(ArrayBuffer.isView(t)||Array.isArray(t))this.setConstant(e,t);else{if(!(t.buffer instanceof Ai))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 Ai){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 vt.deprecated("setElements","setElementBuffer")(),this.setElementBuffer(e,t)}}function hb(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+=hb(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 u5(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 Ai){const p=e,{data:g,changed:_}=p.getDebugData();let y;return d=_?"*":"",f=g,l=p.byteLength,a=l/g.BYTES_PER_ELEMENT/o,t?y=`${t.divisor>0?"I ":"P "} ${a} (x${o}=${l} bytes ${dh(r,s)})`:(c=!0,y=`${l} bytes`),{[i]:`${d}${hb(f,{size:o,isInteger:c})}`,"Format ":y}}return f=e,o=e.length,s=String(e.constructor.name).replace("Array",""),c=-1!==s.indexOf("nt"),{[i]:`${hb(f,{size:o,isInteger:c})} (constant)`,"Format ":`${o}x${s} (constant)`}}function Ahe(n,e){const{type:t,size:i}=e,r=a5(t,i);return r?`${n} (${r.name})`:n}function d5({header:n="Uniforms",program:e,uniforms:t,undefinedOnly:i=!1}){nt(e);const s=".*Matrix",a={},l=Object.keys(e._uniformSetters).sort();let c=0;for(const p of l)!p.match(".*_.*")&&!p.match(s)&&UI({table:a,header:n,uniforms:t,uniformName:p,undefinedOnly:i})&&c++;for(const p of l)p.match(s)&&UI({table:a,header:n,uniforms:t,uniformName:p,undefinedOnly:i})&&c++;for(const p of l)a[p]||UI({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]:hb(g)})}return{table:a,count:c,unusedTable:f,unusedCount:d}}function UI({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?hb(s):"N/A","Uniform Type":o?s:"NOT PROVIDED"},0))}function h5(n){const{type:e,size:t}=n.accessor,i=a5(e,t);return i?`${i.name} ${n.name}`:n.name}const Ihe={POSITION:"positions",NORMAL:"normals",COLOR_0:"colors",TEXCOORD_0:"texCoords",TEXCOORD_1:"texCoords1",TEXCOORD_2:"texCoords2"};function Rhe(n,e){const{attributeMap:t=Ihe}=e||{};return t&&t[n]||n}function khe(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}nt(Number.isFinite(e.size),`attribute ${n} needs size`)}const f5=()=>{},Lhe={};class Mm{constructor(e,t={}){const{id:i=ea("model")}=t;nt(mS(e)),this.id=i,this.gl=e,this.id=t.id||ea("Model"),this.lastLogTime=0,this.animated=!1,this.initialize(t)}initialize(e){this.props={},this.programManager=e.programManager||db.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={},nt(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 nt(Number.isFinite(e)),this.vertexCount=e,this}setInstanceCount(e){return nt(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=Rhe(s,undefined);if("indices"===s)r=o;else if(o.constant)i[a]=o.value;else{const l=o.value,c=K({},o);delete c.value,i[a]=[new Ai(n,l),c],khe(s,c)}}if(r){const s=r.value||r;nt(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 Ai(n,{data:s,target:34963}),o]}return i}(this.gl,e),this.vertexArray.setAttributes(this.geometryBuffers),this}setAttributes(e={}){if(_m(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 pI(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),vt.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&&vt.warn("Found instanced attributes on non-instanced model",this.id)();const{isInstanced:y,instanceCount:v}=this,{onBeforeRender:C=f5,onAfterRender:w=f5}=this.props;C(),this.program.setUniforms(this.uniforms);const x=this.program.draw(Object.assign(Lhe,e,{logPriority:c,uniforms:null,framebuffer:i,parameters:a,drawMode:this.getDrawMode(),vertexCount:this.getVertexCount(),vertexArray:l,transformFeedback:o,isIndexed:f,indexType:p,isInstanced:y,instanceCount:v,offset:f?g:0}));return w(),vt.priority>=2&&this._logDrawCallEnd(c,l,i),x}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 vt.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}nt(t instanceof c5,"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 Mhe(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 Ai&&t.delete()}}_setAnimationProps(e){this.animated&&nt(e,"Model.draw(): animated uniforms but no animationProps")}_setFeedbackBuffers(e={}){if(_m(e))return this;const{gl:t}=this.program;return this.transformFeedback=this.transformFeedback||new N4(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:vt.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=u5(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}: ${Ahe(s.name,a)}`),t[o]=u5(n,i[r],a,e)}}return t}({vertexArray:t,header:`${this.id} attributes`,attributes:this._attributes}),{table:o,unusedTable:a,unusedCount:l}=d5({header:`${this.id} uniforms`,program:this.program,uniforms:Object.assign({},this.program.uniforms,i)}),{table:c,count:d}=d5({header:`${this.id} uniforms`,program:this.program,uniforms:Object.assign({},this.program.uniforms,i),undefinedOnly:!0});d>0&&vt.log("MISSING UNIFORMS",Object.keys(c))(),l>0&&vt.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 ${h5(i)}`]={[t]:JSON.stringify(i.accessor)});for(const i of n.varyingInfos)i&&(e[`out ${h5(i)}`]={[t]:JSON.stringify(i.accessor)});return e}(this.vertexArray.configuration);vt.table(e,s)(),vt.table(e,o)(),vt.table(e+1,f)(),r&&r.log({logLevel:2,message:`Rendered to ${r.id}`}),vt.groupEnd(2,`>>> DRAWING MODEL ${this.id}`)()}}class HI{static isSupported(e){return In(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();nt(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 Mm(t,Object.assign({},e,{fs:e.fs||F4({version:L4(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!(_m(n.feedbackBuffers)&&_m(n.feedbackMap)&&!(n.varyings&&n.varyings.length>0))})(t)&&(this.bufferTransform=new Pue(e,t)),function(n){return!(_m(n._sourceTextures)&&!n._targetTexture&&!n._targetTextureVarying)}(t)&&(this.textureTransform=new Wue(e,t)),nt(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 kS(){}const zhe={onStart:kS,onUpdate:kS,onInterrupt:kS,onEnd:kS};class fb{constructor(e){this._inProgress=!1,this._handle=null,this.timeline=e,this.settings={}}get inProgress(){return this._inProgress}start(e){this.cancel(),this.settings=K(K({},zhe),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 Yhe={interpolation:class{constructor({gl:e,attribute:t,timeline:i}){this.gl=e,this.type="interpolation",this.transition=new fb(i),this.attribute=t,this.attributeInTransition=new xI(e,t.settings),this.currentStartIndices=t.startIndices,this.currentLength=0,this.transform=function(n,e){const t=O4(e.size);return new HI(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 Ai(e,r),new Ai(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;I4(r);const o={numInstances:t,attribute:s,fromLength:this.currentLength,fromStartIndices:this.currentStartIndices,getData:e.enter};for(const a of r)P4(K({buffer:a},o));this.currentStartIndices=s.startIndices,this.currentLength=MI(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:D4(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 fb(i),this.attribute=t,this.attributeInTransition=new xI(e,Lt(K({},t.settings),{normalized:!1})),this.currentStartIndices=t.startIndices,this.currentLength=0,this.texture=function(n){return new na(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 ss(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=O4(e.size);return new HI(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 Ai(e,r),new Ai(e,r),new Ai(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)P4(K({buffer:a},o));this.currentStartIndices=s.startIndices,this.currentLength=MI(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:D4(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]}}),I4(e),this.attributeInTransition.update({buffer:e[1],value:this.attribute.value}),vS(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 Xhe{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=HI.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 jn.warn("WebGL2 not supported by this browser. Transition for ".concat(e," is disabled."))();r&&this._removeTransition(e);const o=Yhe[i.type];o?this.transitions[e]=new o({attribute:t,timeline:this.timeline,gl:this.gl}):(jn.error("unsupported transition type '".concat(i.type,"'"))(),s=!1)}(s||t.needsRedraw())&&(this.needsRedraw=!0,this.transitions[e].start(i,this.numInstances))}}const p5="attributeManager.invalidate";class tfe{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 Xhe(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;no("attribute.updateStart",t),t.allocate(i)&&no("attribute.allocate",t,i),t.updateBuffer(e)&&(this.needsRedraw=!0,no("attribute.updateEnd",t,i))}}function m5(n,e,t,i,r){const s=e-n;return(t-e)*r+-s*i+s+e}function _5(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=A4(r)))return;const o=sfe[r.type];if(!o)return void jn.error("unsupported transition type '".concat(r.type,"'"))();const a=new o(this.timeline);a.start(Lt(K({},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 FS={COMPONENT:Symbol.for("component"),ASYNC_DEFAULTS:Symbol.for("asyncPropDefaults"),ASYNC_ORIGINAL:Symbol.for("asyncPropOriginal"),ASYNC_RESOLVED:Symbol.for("asyncPropResolved")},{COMPONENT:afe}=FS;function ufe(n,e){if(!n.transitions)return null;const t={},i=GI(n);for(const r in n.transitions){const s=i[r],o=s&&s.type;("number"===o||"color"===o||"array"===o)&&$I(n[r],e[r],s)&&(t[r]=!0)}return t}function y5({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=$I(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=$I(n[s],e[s],i[s]);if(o)return"".concat(r,".").concat(s," ").concat(o)}}return null}function $I(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 ffe(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(!vfe(i[r],e[r])){t=n(i),e=i;break}return t}}function bfe(n,e){if(!e)return n;const t=K(K({},n),e);if("defines"in e&&(t.defines=K(K({},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=K({},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 WI(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],y=e[13],v=e[14],C=e[15],w=t*a-i*o,x=t*l-r*o,N=t*c-s*o,V=i*l-r*a,U=i*c-s*a,ee=r*c-s*l,de=d*y-f*_,ae=d*v-p*_,me=d*C-g*_,Ee=f*v-p*y,Be=f*C-g*y,te=p*C-g*v,ne=w*te-x*Be+N*Ee+V*me-U*ae+ee*de;return ne?(n[0]=(a*te-l*Be+c*Ee)*(ne=1/ne),n[1]=(r*Be-i*te-s*Ee)*ne,n[2]=(y*ee-v*U+C*V)*ne,n[3]=(p*U-f*ee-g*V)*ne,n[4]=(l*me-o*te-c*ae)*ne,n[5]=(t*te-r*me+s*ae)*ne,n[6]=(v*N-_*ee-C*x)*ne,n[7]=(d*ee-p*N+g*x)*ne,n[8]=(o*Be-a*me+c*de)*ne,n[9]=(i*me-t*Be-s*de)*ne,n[10]=(_*U-y*N+C*w)*ne,n[11]=(f*N-d*U-g*w)*ne,n[12]=(a*ae-o*Ee-l*de)*ne,n[13]=(t*Ee-i*ae+r*de)*ne,n[14]=(y*x-_*V-v*w)*ne,n[15]=(d*V-f*x+p*w)*ne,n):null}function rp(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],y=e[12],v=e[13],C=e[14],w=e[15],x=t[0],N=t[1],V=t[2],U=t[3];return n[0]=x*i+N*a+V*f+U*y,n[1]=x*r+N*l+V*p+U*v,n[2]=x*s+N*c+V*g+U*C,n[3]=x*o+N*d+V*_+U*w,n[4]=(x=t[4])*i+(N=t[5])*a+(V=t[6])*f+(U=t[7])*y,n[5]=x*r+N*l+V*p+U*v,n[6]=x*s+N*c+V*g+U*C,n[7]=x*o+N*d+V*_+U*w,n[8]=(x=t[8])*i+(N=t[9])*a+(V=t[10])*f+(U=t[11])*y,n[9]=x*r+N*l+V*p+U*v,n[10]=x*s+N*c+V*g+U*C,n[11]=x*o+N*d+V*_+U*w,n[12]=(x=t[12])*i+(N=t[13])*a+(V=t[14])*f+(U=t[15])*y,n[13]=x*r+N*l+V*p+U*v,n[14]=x*s+N*c+V*g+U*C,n[15]=x*o+N*d+V*_+U*w,n}function LS(n,e,t){var o,a,l,c,d,f,p,g,_,y,v,C,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],y=e[9],v=e[10],C=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]=y,n[10]=v,n[11]=C,n[12]=o*i+d*r+_*s+e[12],n[13]=a*i+f*r+y*s+e[13],n[14]=l*i+p*r+v*s+e[14],n[15]=c*i+g*r+C*s+e[15]),n}function BS(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 b5(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 C5(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 w5(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 VS(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 ia(4);ia!=Float32Array&&(n[0]=0,n[1]=0,n[2]=0,n[3]=0)}();const E5=[0,0,0,0],qfe=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0],Yfe=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],Xfe=[0,0,0],Kfe=[0,0,0],Zfe=NS(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=E5,l=E5,c=n.cameraPosition;const{geospatialOrigin:d,shaderCoordinateOrigin:f,offsetMode:p}=S5(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=VS([],l,o),s=i||s,o=rp([],r,s),o=rp([],o,qfe)),{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:Xfe,project_uScale:n.scale,project_uViewProjectionMatrix:s,project_uCameraPosition:a};if(c){const _=n.getDistanceScales(c);switch(t){case qn.METER_OFFSETS:g.project_uCommonUnitsPerWorldUnit=_.unitsPerMeter,g.project_uCommonUnitsPerWorldUnit2=_.unitsPerMeter2;break;case qn.LNGLAT:case qn.LNGLAT_OFFSETS:g.project_uCommonUnitsPerWorldUnit=_.unitsPerDegree,g.project_uCommonUnitsPerWorldUnit2=_.unitsPerDegree2;break;case qn.CARTESIAN:g.project_uCommonUnitsPerWorldUnit=[1,1,_.unitsPerMeter[2]],g.project_uCommonUnitsPerWorldUnit2=[0,0,_.unitsPerMeter2[2]]}}return g});function S5(n,e,t=Kfe){let r,i=t,s=!0;switch(r=e===qn.LNGLAT_OFFSETS||e===qn.METER_OFFSETS?t:n.isGeospatial?[Math.fround(n.longitude),Math.fround(n.latitude),0]:null,n.projectionMode){case Yc.WEB_MERCATOR:(e===qn.LNGLAT||e===qn.CARTESIAN)&&(s=!1);break;case Yc.WEB_MERCATOR_AUTO_OFFSET:e===qn.LNGLAT?i=r:e===qn.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 Yc.IDENTITY:i=n.position.map(Math.fround);break;case Yc.GLOBE:s=!1,r=null;break;default:s=!1}return i[2]=i[2]||0,{geospatialOrigin:r,shaderCoordinateOrigin:i,offsetMode:s}}class tpe extends vI{get ELEMENTS(){return Qu(!1),0}get RANK(){return Qu(!1),0}toString(){let e="[";if(Ji.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 $t).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 function(n,e,t,i,r){var o,s=1/Math.tan(e/2);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)}(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],y=n[14],v=n[15];return(e*o-t*s)*(f*v-p*y)-(e*a-i*s)*(d*v-p*_)+(e*l-r*s)*(d*y-f*_)+(t*a-i*o)*(c*v-p*g)-(t*l-r*o)*(c*y-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 WI(this,this),this.check()}multiplyLeft(e){return rp(this,e,this),this.check()}multiplyRight(e){return rp(this,this,e),this.check()}rotateX(e){return b5(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 C5(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,_,y,v,C,w,x,N,V,U,ee,de,ae,me,Ee,Be,te,ne,Ie,r=i[0],s=i[1],o=i[2],a=Math.hypot(r,s,o);at?t:n}const qI=Math.log2||function(n){return Math.log(n)*Math.LOG2E};function ed(n,e){if(!n)throw new Error(e||"@math.gl/web-mercator: assertion failed.")}const oc=Math.PI,O5=oc/4,ac=oc/180,YI=180/oc,XI=4003e4,jS=85.051129;function US([n,e]){return ed(Number.isFinite(n)),ed(Number.isFinite(e)&&e>=-90&&e<=90,"invalid latitude"),[512*(n*ac+oc)/(2*oc),512*(oc+Math.log(Math.tan(O5+e*ac*.5)))/(2*oc)]}function Dm([n,e]){const t=n/512*(2*oc)-oc,i=2*(Math.atan(Math.exp(e/512*(2*oc)-oc))-O5);return[t*YI,i*YI]}function KI({latitude:n,longitude:e,highPrecision:t=!1}){ed(Number.isFinite(n)&&Number.isFinite(e));const i={},s=Math.cos(n*ac),o=512/360,a=o/s,l=512/XI/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=ac*Math.tan(n*ac)/s,f=512/XI*c,p=f/a*l;i.unitsPerDegree2=[0,o*c/2,f],i.unitsPerMeter2=[p,0,p]}return i}function I5(n,e){const[t,i,r]=n,[s,o,a]=e,{unitsPerMeter:l,unitsPerMeter2:c}=KI({longitude:t,latitude:i,highPrecision:!0}),d=US(n);d[0]+=s*(l[0]+c[0]*o),d[1]+=o*(l[1]+c[1]*o);const f=Dm(d),p=(r||0)+(a||0);return Number.isFinite(r)||Number.isFinite(a)?[f[0],f[1],p]:f}function R5(n){return 2*Math.atan(.5/n)*YI}function k5(n,e){const[t,i,r=0]=n;return ed(Number.isFinite(t)&&Number.isFinite(i)&&Number.isFinite(r)),Am(e,[t,i,r,1])}function gb(n,e,t=0){const[i,r,s]=n;if(ed(Number.isFinite(i)&&Number.isFinite(r),"invalid pixel coordinate"),Number.isFinite(s))return Am(e,[i,r,s,1]);const o=Am(e,[i,r,0,1]),a=Am(e,[i,r,1,1]),l=o[2],c=a[2];return x5([],o,a,l===c?0:((t||0)-l)/(c-l))}const F5=Math.PI/180;function N5(n,e,t){const{pixelUnprojectionMatrix:i}=n,r=Am(i,[e,0,1,1]),s=Am(i,[e,n.height,1,1]),c=Dm(x5([],r,s,(t*n.distanceScales.unitsPerMeter[2]-r[2])/(s[2]-r[2])));return c[2]=t,c}const _pe=Math.PI/180,ype=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],QI=[0,0,0],bpe={unitsPerMeter:[1,1,1],metersPerUnit:[1,1,1]};let Om=(()=>{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?Yc.WEB_MERCATOR:Yc.WEB_MERCATOR_AUTO_OFFSET:Yc.IDENTITY}equals(t){return t instanceof n&&(this===t||t.width===this.width&&t.height===this.height&&t.scale===this.scale&&rb(t.projectionMatrix,this.projectionMatrix)&&rb(t.viewMatrix,this.viewMatrix))}project(t,{topLeft:i=!0}={}){const s=k5(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=gb([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?US(t):t}unprojectFlat(t){return this.isGeospatial?Dm(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?KI({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 Om{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:y=1.5}=t;const v=Math.pow(2,s);g=g||1,_=_||1,y=Math.max(.75,y);const{fov:C,aspect:w,focalDistance:x,near:N,far:V}=function({width:n,height:e,fovy:t=R5(1.5),altitude:i,pitch:r=0,nearZMultiplier:s=1,farZMultiplier:o=1}){void 0!==i&&(t=R5(i));const a=.5*t*ac,l=function(n){return.5/Math.tan(.5*n*ac)}(t),c=r*ac,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}}({width:g,height:_,pitch:o,altitude:y,nearZMultiplier:l,farZMultiplier:c});let U=function({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 LS(o,o,[0,0,-i]),b5(o,o,-e*ac),C5(o,o,t*ac),BS(o,o,[r/=n,r,r]),s&&LS(o,o,function(n,e){return n[0]=-e[0],n[1]=-e[1],n[2]=-e[2],n}([],s)),o}({height:_,pitch:o,bearing:a,scale:v,altitude:y});p&&(U=(new $t).translate([512*p,0,0]).multiplyLeft(U)),super(Lt(K({},t),{width:g,height:_,viewMatrix:U,longitude:r,latitude:i,zoom:s,orthographic:d,fovyRadians:C,aspect:w,focalDistance:x,near:N,far:V})),this.latitude=i,this.longitude=r,this.zoom=s,this.pitch=o,this.bearing=a,this.altitude=y,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(Lt(K({},this),{worldOffset:s})):this;this._subViewports.push(o)}}return this._subViewports}addMetersToLngLat(t,i){return I5(t,i)}panByPosition(t,i){const r=gb(i,this.pixelUnprojectionMatrix),o=zS([],this.projectFlat(t),M5([],r)),a=zS([],this.center,o),[l,c]=this.unprojectFlat(a);return{longitude:l,latitude:c}}getBounds(t={}){const i=function(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*F5:Math.atan(.5/n.altitude))>(90-n.pitch)*F5-.01?(l=N5(n,0,e),c=N5(n,t,e)):(l=r([0,0],s),c=r([t,0],s)),[o,a,c,l]}(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}=function({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}:ed(Number.isFinite(s.top)&&Number.isFinite(s.bottom)&&Number.isFinite(s.left)&&Number.isFinite(s.right));const f=US([a,D5(d,-jS,jS)]),p=US([c,D5(l,-jS,jS)]),g=[Math.max(Math.abs(p[0]-f[0]),i),Math.max(Math.abs(p[1]-f[1]),i)],_=[n-s.left-s.right-2*Math.abs(o[0]),e-s.top-s.bottom-2*Math.abs(o[1])];ed(_[0]>0&&_[1]>0);const y=_[0]/g[0],v=_[1]/g[1],N=Dm([(p[0]+f[0])/2+(s.right-s.left)/2/y,(p[1]+f[1])/2+(s.bottom-s.top)/2/v]),V=Math.min(r,qI(Math.abs(Math.min(y,v))));return ed(Number.isFinite(V)),{longitude:N[0],latitude:N[1],zoom:V}}(K({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 JI(n,e,t=!1){const i=e.projectPosition(n);if(t&&e instanceof j5){const[r,s,o=0]=n,a=e.getDistanceScales([r,s]);i[2]=o*a.unitsPerMeter[2]}return i}function U5(n,{viewport:e,modelMatrix:t,coordinateSystem:i,coordinateOrigin:r,offsetMode:s}){let[o,a,l=0]=n;switch(t&&([o,a,l]=VS([],[o,a,l,1],t)),i){case qn.LNGLAT:return JI([o,a,l],e,s);case qn.LNGLAT_OFFSETS:return JI([o+r[0],a+r[1],l+(r[2]||0)],e,s);case qn.METER_OFFSETS:return JI(I5(r,[o,a,l]),e,s);case qn.CARTESIAN:default:return e.isGeospatial?[o+r[0],a+r[1],l+r[2]]:e.projectPosition([o,a,l])}}const Epe={10241:9987,10240:9729,10242:33071,10243:33071},eP={},xpe={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||_b(n)&&(3===n.length||4===n.length),equal:(n,e,t)=>tP(n,e)},accessor:{validate(n,e){const t=HS(n);return"function"===t||t===HS(e.value)},equal:(n,e,t)=>"function"==typeof e||tP(n,e)},array:{validate:(n,e)=>e.optional&&!n||_b(n),equal:(n,e,t)=>t.compare?tP(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 na)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 na(t,Lt(K({},e),{parameters:K(K(K({},Epe),i),n.props.textureParameters)}));return eP[r.id]=!0,r}(t,n),release:n=>{!function(n){!n||!(n instanceof na)||eP[n.id]&&(n.delete(),delete eP[n.id])}(n)}}};function tP(n,e){if(n===e)return!0;if(!_b(n)||!_b(e))return!1;const t=n.length;if(t!==e.length)return!1;for(let i=0;i{},this.oldProps=Vpe,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[Lpe]||{},i=e[Npe]||e,r=e[Bpe]||{};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(x4(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 yn(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=iP(t);c=(g=yield p.next()).done,_=yield g.value,!c;c=!0){const v=_,{dataTransform:C}=i.component?i.component.props:{};a=C?C(v,a):a.concat(v),Object.defineProperty(a,"__diff",{enumerable:!1,value:[{startRow:l,endRow:a.length}]}),l=a.length,i._setAsyncPropValue(e,a,o)}}catch(v){d=!0,f=v}finally{try{!c&&null!=p.return&&(yield p.return())}finally{if(d)throw f}}const y=null===(r=i.layer)||void 0===r?void 0:r.props.onDataLoad;y&&y(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:W5,ASYNC_RESOLVED:q5,ASYNC_DEFAULTS:zpe}=FS,jpe={};let Upe=0,Hpe=(()=>{class n{constructor(){this.props=Dpe.apply(this,arguments),this.id=this.props.id,this.count=Upe++,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[zpe])s in i[q5]?r[s]=i[q5][s]:s in i[W5]&&(r[s]=i[W5][s]);return new this.constructor(K(K(K({},i),r),t))}get stats(){return this.internalState.stats}_initState(){this.internalState=new G5({})}}return n.componentName="Component",n.defaultProps=jpe,n})();class $pe extends G5{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 lc=n=>"function"==typeof n,ph=n=>null!==n&&"object"==typeof n,X5=n=>ph(n)&&n.constructor==={}.constructor,Gpe=n=>n&&"function"==typeof n[Symbol.iterator],Wpe=n=>n&&"function"==typeof n[Symbol.asyncIterator],vb=n=>"undefined"!=typeof Response&&n instanceof Response||n&&n.arrayBuffer&&n.text&&n.json,Im=n=>"undefined"!=typeof Blob&&n instanceof Blob,K5=n=>(n=>"undefined"!=typeof ReadableStream&&n instanceof ReadableStream||ph(n)&&lc(n.tee)&&lc(n.cancel)&&lc(n.getReader))(n)||(n=>ph(n)&&lc(n.read)&&lc(n.pipe)&&(n=>"boolean"==typeof n)(n.readable))(n);function sp(n,e){if(!n)throw new Error(e||"loader assertion failed.")}function rP(n){var e;return!!n&&(Array.isArray(n)&&(n=n[0]),Array.isArray(null===(e=n)||void 0===e?void 0:e.extensions))}function sP(n){var e,t;let i;return sp(n,"null loader"),sp(rP(n),"invalid loader"),Array.isArray(n)&&(i=n[1],n=Lt(K({},n=n[0]),{options:K(K({},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 Zc={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},oP=Zc.global||Zc.self||Zc.window||{},Qpe="object"!=typeof process||"[object process]"!==String(process)||process.browser,Z5="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version);Z5&&parseFloat(Z5[1]);const lP={};function Jpe(n){for(const e in lP)n.startsWith(e)&&(n=n.replace(e,lP[e]));return!n.startsWith("http://")&&!n.startsWith("https://")&&(n=`${n}`),n}const ege=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,tge=/^([-\w.]+\/[-\w.+]+)/;function nge(n){const e=tge.exec(n);return e?e[1]:n}function Q5(n){const e=ege.exec(n);return e?e[1]:""}const ige=/\?.*/;function qS(n){if(vb(n)){const e=cP(n.url||"");return{url:e,type:nge(n.headers.get("content-type")||"")||Q5(e)}}return Im(n)?{url:cP(n.name||""),type:n.type||""}:"string"==typeof n?{url:cP(n),type:Q5(n)}:{url:"",type:""}}function rge(n){return vb(n)?n.headers["content-length"]||-1:Im(n)?n.size:"string"==typeof n?n.length:n instanceof ArrayBuffer||ArrayBuffer.isView(n)?n.byteLength:-1}function cP(n){return n.replace(ige,"")}function J5(n){return uP.apply(this,arguments)}function uP(){return(uP=yn(function*(n){if(vb(n))return n;const e={},t=rge(n);t>=0&&(e["content-length"]=String(t));const{url:i,type:r}=qS(n);r&&(e["content-type"]=r);const s=yield age(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 sge(n){return dP.apply(this,arguments)}function dP(){return(dP=yn(function*(n){if(!n.ok){const e=yield oge(n);throw new Error(e)}})).apply(this,arguments)}function oge(n){return hP.apply(this,arguments)}function hP(){return(hP=yn(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 age(n){return fP.apply(this,arguments)}function fP(){return(fP=yn(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,${lge(n.slice(0,5))}`:null})).apply(this,arguments)}function lge(n){let e="";const t=new Uint8Array(n);for(let i=0;i{}}info(){return()=>{}}warn(){return()=>{}}error(){return()=>{}}}const nH={fetch:null,mimeType:void 0,nothrow:!1,log:new class{constructor(){sn(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:[]},dge={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 gP(){oP.loaders=oP.loaders||{};const{loaders:n}=oP;return n._state=n._state||{},n._state}const mP=()=>{const n=gP();return n.globalOptions=n.globalOptions||K({},nH),n.globalOptions};function hge(n,e,t,i){return t=t||[],function(n,e){rH(n,null,nH,dge,e);for(const t of e)rH(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=K({},n.options||{});return function(n,e){e&&!("baseUri"in n)&&(n.baseUri=e)}(r,t),null===r.log&&(r.log=new cge),oH(r,mP()),oH(r,e),r}(e,n,i)}function iH(n,e){const t=mP(),i=n||t;return"function"==typeof i.fetch?i.fetch:ph(i.fetch)?r=>eH(r,i):null!=e&&e.fetch?null==e?void 0:e.fetch:eH}function rH(n,e,t,i,r){const s=e||"Top level",o=e?`${e}.`:"";for(const a in n){const l=!e&&ph(n[a]),c="baseUri"===a&&!e,d="workerUrl"===a&&e;if(!(a in t)&&!c&&!d)if(a in i)tH.warn(`${s} loader option '${o}${a}' no longer supported, use '${i[a]}'`)();else if(!l){const f=pge(a,r);tH.warn(`${s} loader option '${o}${a}' not recognized. ${f}`)()}}}function pge(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 oH(n,e){for(const t in e)t in e&&(n[t]=X5(e[t])&&X5(n[t])?K(K({},n[t]),e[t]):e[t])}function Qc(n,e){if(!n)throw new Error(e||"loaders.gl assertion failed.")}function _ge(n,e="3.0.12"){return Qc(n,"no worker provided"),!(!e||!n.version)}const Jc={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},yge=Jc.global||Jc.self||Jc.window||{},_P="object"!=typeof process||"[object process]"!==String(process)||process.browser,yP="function"==typeof importScripts,vge="undefined"!=typeof window&&void 0!==window.orientation,aH="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version),vP=(aH&&parseFloat(aH[1]),new Map);function lH(n){const e=new Blob([n],{type:"application/javascript"});return URL.createObjectURL(e)}function cH(n,e=!0,t){const i=t||new Set;if(n)if(uH(n))i.add(n);else if(uH(n.buffer))i.add(n.buffer);else if(!ArrayBuffer.isView(n)&&e&&"object"==typeof n)for(const r in n)cH(n[r],e,i);return void 0===t?Array.from(i):[]}function uH(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 bP=()=>{};class dH{static isSupported(){return"undefined"!=typeof Worker}constructor(e){sn(this,"name",void 0),sn(this,"source",void 0),sn(this,"url",void 0),sn(this,"terminated",!1),sn(this,"worker",void 0),sn(this,"onMessage",void 0),sn(this,"onError",void 0),sn(this,"_loadableURL","");const{name:t,source:i,url:r}=e;Qc(i||r),this.name=t,this.source=i,this.url=r,this.onMessage=bP,this.onError=s=>console.log(s),this.worker=this._createBrowserWorker()}destroy(){this.onMessage=bP,this.onError=bP,this.worker.terminate(),this.terminated=!0}get isRunning(){return Boolean(this.onMessage)}postMessage(e,t){t=t||cH(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){Qc(n.source&&!n.url||!n.source&&n.url);let e=vP.get(n.source||n.url);return e||(n.url&&(e=function(n){return n.startsWith("http")?lH(function(n){return`try {\n importScripts('${n}');\n} catch (error) {\n console.error(error);\n throw error;\n}`}(n)):n}(n.url),vP.set(n.url,e)),n.source&&(e=lH(n.source),vP.set(n.source,e))),Qc(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 Ege{constructor(e,t){sn(this,"name",void 0),sn(this,"workerThread",void 0),sn(this,"isRunning",void 0),sn(this,"result",void 0),sn(this,"_resolve",void 0),sn(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){Qc(this.isRunning),this.isRunning=!1,this._resolve(e)}error(e){Qc(this.isRunning),this.isRunning=!1,this._reject(e)}}class Sge{constructor(e){sn(this,"name","unnamed"),sn(this,"source",void 0),sn(this,"url",void 0),sn(this,"maxConcurrency",1),sn(this,"maxMobileConcurrency",1),sn(this,"onDebug",()=>{}),sn(this,"reuseWorkers",!0),sn(this,"props",{}),sn(this,"jobQueue",[]),sn(this,"idleQueue",[]),sn(this,"count",0),sn(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=K(K({},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 yn(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 yn(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 Ege(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 td{static isSupported(){return dH.isSupported()}static getWorkerFarm(e={}){return td._workerFarm=td._workerFarm||new td({}),td._workerFarm.setProps(e),td._workerFarm}constructor(e){sn(this,"props",void 0),sn(this,"workerPools",new Map),this.props=K({},Mge),this.setProps(e),this.workerPools=new Map}destroy(){for(const e of this.workerPools.values())e.destroy()}setProps(e){this.props=K(K({},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 Sge({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 Tge(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 Qc(r),r}function Age(n,e){return!!td.isSupported()&&n.worker&&(null==e?void 0:e.worker)}function Dge(n,e,t,i,r){return CP.apply(this,arguments)}function CP(){return(CP=yn(function*(n,e,t,i,r){const s=n.id,o=Tge(n,t),l=td.getWorkerFarm(t).getWorkerPool({name:s,url:o});t=JSON.parse(JSON.stringify(t));const c=yield l.startJob("process-on-worker",Oge.bind(null,r));return c.postMessage("process",{input:e,options:t}),yield(yield c.result).result})).apply(this,arguments)}function Oge(n,e,t,i){return wP.apply(this,arguments)}function wP(){return(wP=yn(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)}sn(td,"_workerFarm",void 0);var fH=ze(521);function pH(n){if(function(n){return n&&"object"==typeof n&&n.isBuffer}(n)&&(n=function(n){return fH.toArrayBuffer?fH.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 kge(...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 gH(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 Fge(n){return SP.apply(this,arguments)}function SP(){return(SP=yn(function*(n){const e=[];var r,t=!0,i=!1;try{for(var o,a,s=iP(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 kge(...e)})).apply(this,arguments)}const Bge=262144;function mH(n){this.wrapped=n}function bb(n){return new mH(n)}function Cb(n){var e,t;function r(o,a){try{var l=n[o](a),c=l.value,d=c instanceof mH;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 xP(n){return function(){return new Cb(n.apply(this,arguments))}}function TP(){return(TP=xP(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(OP)}function Wge(n,e,t){return IP.apply(this,arguments)}function IP(){return(IP=yn(function*(n,e,t){const i=n instanceof ArrayBuffer||ArrayBuffer.isView(n);if("string"==typeof n||i)return Gge(n,e);if(Im(n)&&(n=yield J5(n)),vb(n)){const r=n;return yield sge(r),e.binary?yield r.arrayBuffer():yield r.text()}if(K5(n)&&(n=$ge(n,t)),Gpe(n)||Wpe(n))return Fge(n);throw new Error(OP)})).apply(this,arguments)}function Yge(n,e,t=null){if(t)return t;const i=K({fetch:iH(e,n)},n);return Array.isArray(i.loaders)||(i.loaders=null),i}function Xge(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 yH=()=>{const n=gP();return n.loaderRegistry=n.loaderRegistry||[],n.loaderRegistry};function vH(n){const e=yH();n=Array.isArray(n)?n:[n];for(const t of n){const i=sP(t);e.find(r=>i===r)||e.unshift(i)}}const Zge=/\.([^.]+)$/;function Qge(n){return kP.apply(this,arguments)}function kP(){return(kP=yn(function*(n,e=[],t,i){if(!CH(n))return null;let r=bH(n,e,Lt(K({},t),{nothrow:!0}),i);if(r)return r;if(Im(n)&&(r=bH(n=yield n.slice(0,10).arrayBuffer(),e,t,i)),!(r||null!=t&&t.nothrow))throw new Error(wH(n));return r})).apply(this,arguments)}function bH(n,e=[],t,i){if(!CH(n))return null;if(e&&!Array.isArray(e))return sP(e);let r=[];e&&(r=r.concat(e)),null!=t&&t.ignoreRegisteredLoaders||r.push(...yH()),function(n){for(const e of n)sP(e)}(r);const s=function(n,e,t,i){const{url:r,type:s}=qS(n),o=r||(null==i?void 0:i.url);let a=null;return null!=t&&t.mimeType&&(a=FP(e,null==t?void 0:t.mimeType)),a=a||function(n,e){const t=e&&Zge.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||FP(e,s),a=a||function(n,e){if(!e)return null;for(const t of n)if("string"==typeof e){if(rme(e,t))return t}else if(ArrayBuffer.isView(e)){if(EH(e.buffer,e.byteOffset,t))return t}else if(e instanceof ArrayBuffer&&EH(e,0,t))return t;return null}(e,n),a=a||FP(e,null==t?void 0:t.fallbackMimeType),a}(n,r,t,i);if(!(s||null!=t&&t.nothrow))throw new Error(wH(n));return s}function CH(n){return!(n instanceof Response&&204===n.status)}function wH(n){const{url:e,type:t}=qS(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)?NP(n.buffer,n.byteOffset,e):n instanceof ArrayBuffer?NP(n,0,e):""}(n)}", contentType: "${t}"`),e&&(i+=` url: ${e}`),i}function FP(n,e){for(const t of n)if(t.mimeTypes&&t.mimeTypes.includes(e)||e===`application/x.${t.id}`)return t;return null}function rme(n,e){return e.testText?e.testText(n):(Array.isArray(e.tests)?e.tests:[e.tests]).some(i=>n.startsWith(i))}function EH(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 eu=new Uint8ClampedArray(0);const gme={data:{type:"data",value:fme,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=Lt(K({},r),{fetch:Lt(K({},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:wb(n,i),persistent:!1}),l=!0),l?o.subscribe({resourceId:n,onChange:c=>t.internalState.reloadAsyncProp(e,c),consumerId:t.id,requestId:e}):wb(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:qn.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 Eb=(()=>{class n extends Hpe{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=U5(t,{viewport:i,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem}),[s,o,a]=k5(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=K({},n);let{coordinateSystem:t}=n;const{viewport:i,coordinateOrigin:r,fromCoordinateSystem:s,fromCoordinateOrigin:o}=n;return t===qn.DEFAULT&&(t=i.isGeospatial?qn.LNGLAT:qn.CARTESIAN),void 0===s&&(e.fromCoordinateSystem=t),void 0===o&&(e.fromCoordinateOrigin=r),e.coordinateSystem=t,e}(e),{geospatialOrigin:l,shaderCoordinateOrigin:c,offsetMode:d}=S5(t,i,r),f=U5(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===qn.DEFAULT||t===qn.LNGLAT||t===qn.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){sc(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=bfe(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||!pme({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(eu.length/3);if(this.internalState.usesPickingColorCache=!0,rSH&&jn.warn("Layer has too many data objects. Picking might not be able to distinguish all objects.")(),eu=nb.allocate(eu,i,{size:3,copy:!0,maxCount:Math.max(i,SH)});const s=Math.floor(eu.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&&no("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=y5({newProps:n,oldProps:e,propTypes:GI(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&&v5(n,e,"all"))return{all:!0};const t={};let i=!1;for(const r in n.updateTriggers)"all"!==r&&v5(n,e,r)&&(t[r]=!0,i=t);return i}(n,e)),{dataChanged:i,propsChanged:t,updateTriggersChanged:r,extensionsChanged:ffe(n,e),transitionsChanged:ufe(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=GI(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 tfe(this.context.gl,{id:this.props.id,stats:this.context.stats,timeline:this.context.timeline})}_initState(){sc(!this.internalState&&!this.state),sc(isFinite(this.props.coordinateSystem));const t=this._getAttributeManager();t&&t.addInstanced({instancePickingColors:{type:5121,size:3,noAlloc:!0,update:this.calculateInstancePickingColors}}),this.internalState=new $pe({attributeManager:t,layer:this}),this.clearChangeFlags(),this.state={},Object.defineProperty(this.state,"attributeManager",{get:()=>(jn.deprecated("layer.state.attributeManager","layer.getAttributeManager()"),t)}),this.internalState.layer=this,this.internalState.uniformTransitions=new ofe(this.context.timeline),this.internalState.onAsyncPropUpdated=this._onAsyncPropUpdated.bind(this),this.internalState.setAsyncProps(this.props)}_transferState(t){no("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=gme,n})(),MH=(()=>{class n extends Eb{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:y,extensions:v,fetch:C,_subLayerProps:w}=this.props,x={opacity:i,pickable:r,visible:s,parameters:o,getPolygonOffset:a,highlightedObjectIndex:l,autoHighlight:c,highlightColor:d,coordinateSystem:f,coordinateOrigin:p,wrapLongitude:g,positionFormat:_,modelMatrix:y,extensions:v,fetch:C},N=w&&w[t.id],V=N&&N.updateTriggers,U=t.id||"sublayer";if(N){const ee=this.constructor._propTypes,de=t.type?t.type._propTypes:{};for(const ae in N){const me=de[ae]||ee[ae];me&&"accessor"===me.type&&(N[ae]=this.getSubLayerAccessor(N[ae]))}}Object.assign(x,t,N),x.id="".concat(this.props.id,"-").concat(U),x.updateTriggers=K(K({all:this.props.updateTriggers.all},t.updateTriggers),V);for(const ee of v){const de=ee.getSubLayerProps.call(this,ee);de&&Object.assign(x,de,{updateTriggers:Object.assign(x.updateTriggers,de.updateTriggers)})}return x}_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=EI(t,Boolean),this.internalState.subLayers=t),no("compositeLayer.renderLayers",this,i,t);for(const r of t)r.parent=this}}return n.layerName="CompositeLayer",n})();const _me=/([0-9]+\.?[0-9]*)(%|px)/;function XS(n){switch(typeof n){case"number":return{position:n,relative:!1};case"string":const e=n.match(_me);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 KS(n,e){return n.relative?Math.round(n.position*e):n.position}function Sb(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)&&Sb(i,r)))return!1}return!0}class zP{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=Om}=e;sc(!p||p instanceof Om),this.viewportInstance=p,this.id=t||this.constructor.displayName||"view",this.type=g,this.props=Lt(K({},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):Sb(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=K({},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:KS(this._x,e),y:KS(this._y,t),width:KS(this._width,e),height:KS(this._height,t)}}_getControllerProps(e){let t=this.props.controller;return t?!0===t?e:("function"==typeof t&&(t={type:t}),K(K({},e),t)):null}_getViewport(e,t){const{type:i}=this;return new i(K(K(K({},e),this.props),t))}_parseDimensions({x:e,y:t,width:i,height:r}){this._x=XS(e),this._y=XS(t),this._width=XS(i),this._height=XS(r)}}const Mb=()=>{},xH={transitionEasing:n=>n,transitionInterruption:1,onTransitionStart:Mb,onTransitionInterrupt:Mb,onTransitionEnd:Mb};class yme{constructor(e,t={}){this.ControllerState=e,this.props=K(K({},xH),t),this.propsInTransition=null,this.transition=new fb(t.timeline),this.onViewStateChange=t.onViewStateChange||Mb,this.onStateChange=t.onStateChange||Mb,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=K(K({},xH),e),this.props=e,this._shouldIgnoreViewportChange(i,e))return t;if(this._isTransitionEnabled(e)){const{interruption:r,endProps:s}=this.transition.settings,o=K(K({},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(K(K({},this.props),c)).getViewportProps(),this.onViewStateChange({viewState:this.propsInTransition,oldViewState:this.props})}}const TH=["longitude","latitude","zoom","bearing","pitch"],bme=["longitude","latitude","zoom"];class AH 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)||!rb(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];sc(Number.isFinite(i)||Array.isArray(i),"".concat(t," is required for transition"))})}}{constructor(e={}){super((Array.isArray(e)?e:e.transitionProps)||{compare:TH,extract:TH,required:bme}),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]=bS(e[s]||0,t[s]||0,i);if(t.aroundPosition){const s=this.opts.makeViewport(K(K({},t),r));Object.assign(r,s.panByPosition(t.aroundPosition,bS(e.around,t.around,i)))}return r}}const gh={transitionDuration:0},Cme={transitionDuration:300,transitionEasing:n=>n,transitionInterruption:1},QS=n=>1-(1-n)*(1-n),Pm_WHEEL=["wheel"],Pm_PAN=["panstart","panmove","panend"],Pm_PINCH=["pinchstart","pinchmove","pinchend"],Pm_TRIPLE_PAN=["tripanstart","tripanmove","tripanend"],Pm_DOUBLE_TAP=["doubletap"],Pm_KEYBOARD=["keydown"];class jP{constructor(e,t={}){this.ControllerState=e,this.controllerState=null,this.controllerStateProps=null,this.eventManager=null,this.transitionManager=new yme(e,Lt(K({},t),{onViewStateChange:this._onTransition.bind(this),onStateChange:this._setInteractionState.bind(this)}));const i=this.linearTransitionProps;this._transition=i&&Lt(K({},Cme),{transitionInterpolator:new AH({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(K(K({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(Pm_WHEEL,d&&i),this.toggleEvents(Pm_PAN,d&&(r||s)),this.toggleEvents(Pm_PINCH,d&&(a||l)),this.toggleEvents(Pm_TRIPLE_PAN,d&&l),this.toggleEvents(Pm_DOUBLE_TAP,d&&o),this.toggleEvents(Pm_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=K(K({},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,gh,{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,gh,{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,Lt(K({},this._getTransitionProps()),{transitionDuration:t,transitionEasing:QS}),{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,gh,{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,Lt(K({},this._getTransitionProps()),{transitionDuration:t,transitionEasing:QS}),{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,Lt(K({},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,gh,{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,gh,{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,Lt(K({},this._getTransitionProps()),{transitionDuration:t,transitionEasing:QS}),{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,gh,{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,gh,{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,Lt(K({},this._getTransitionProps({around:r})),{transitionDuration:t,transitionEasing:QS}),{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?Lt(K({},t),{transitionInterpolator:new AH(Lt(K({},e),{transitionProps:this.linearTransitionProps,makeViewport:this.controllerState.makeViewport}))}):t:gh}}class DH{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 mh_target=[0,0,0];class JS extends DH{constructor({makeViewport:e,width:t,height:i,rotationX:r=0,rotationOrbit:s=0,target:o=mh_target,zoom:a=0,minRotationX:l=-90,maxRotationX:c=90,minZoom:d=-(1/0),maxZoom:f=Infinity,startPanPosition:p,startRotatePos:g,startRotationX:_,startRotationOrbit:y,startZoomPosition:v,startZoom:C}){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:y,startZoomPosition:v,startZoom:C},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=K({},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(Lt(K({},this._viewportProps),{zoom:a}));return this._getUpdatedState(K({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),np(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 JS(K(K(K({},this._viewportProps),this._state),e))}_applyConstraints(e){const{maxZoom:t,minZoom:i,zoom:r,maxRotationX:s,minRotationX:o,rotationOrbit:a}=e;return e.zoom=np(r,i,t),e.rotationX=np(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 Eme extends jP{constructor(e){super(JS,e)}get linearTransitionProps(){return["target","zoom","rotationX","rotationOrbit"]}}class Sme extends jP{constructor(e){e.dragMode=e.dragMode||"pan",super(JS,e)}_onPanRotate(e){return!1}get linearTransitionProps(){return["target","zoom"]}}const Mme=(new $t).lookAt({eye:[0,0,1]});function xme({width:n,height:e,near:t,far:i}){return n=n||1,e=e||1,(new $t).ortho({left:-n/2,right:n/2,bottom:-e/2,top:e/2,near:t,far:i})}class Tme extends Om{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(Lt(K({},e),{longitude:null,position:a,viewMatrix:Mme.clone().scale([c,c*(l?-1:1),c]),projectionMatrix:xme({width:t,height:i,near:r,far:s}),zoom:o}))}panByPosition(e,t){const r=zS([],e,M5([],gb(t,this.pixelUnprojectionMatrix)));return{target:zS([],this.center,r)}}}let Ame=(()=>{class n extends zP{constructor(t){super(Lt(K({},t),{type:Tme}))}get controller(){return this._getControllerProps({type:Sme})}}return n.displayName="OrthographicView",n})();const eM=Math.PI/180;function Dme({height:n,fovy:e,orbitAxis:t,rotationX:i,rotationOrbit:r,zoom:s}){const o=.5/Math.tan(e*eM/2),a="Z"===t?[0,0,1]:[0,1,0],l="Z"===t?[0,-o,0]:[0,0,o],c=(new $t).lookAt({eye:l,up:a});c.rotateX(i*eM),"Z"===t?c.rotateZ(r*eM):c.rotateY(r*eM);const d=Math.pow(2,s)/(n||1);return c.scale(d),c}class Ome extends Om{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(Lt(K({},e),{longitude:null,viewMatrix:Dme({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]=gb([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 Ime=(()=>{class n extends zP{constructor(t={}){const{orbitAxis:i="Z"}=t;super(Lt(K({},t),{orbitAxis:i,type:Ome}))}get controller(){return this._getControllerProps({type:Eme})}}return n.displayName="OrbitView",n})();const Pme=[255,255,255],Rme=1;let kme=0;class OH{constructor(e={}){const{color:t=Pme}=e,{intensity:i=Rme}=e;this.id=e.id||"ambient-".concat(kme++),this.color=t,this.intensity=i,this.type="ambient"}}const Fme=[255,255,255],Nme=1,Lme=[0,0,-1];let Bme=0;class IH{constructor(e={}){const{color:t=Fme}=e,{intensity:i=Nme}=e,{direction:r=Lme}=e,{_shadow:s=!1}=e;this.id=e.id||"directional-".concat(Bme++),this.color=t,this.intensity=i,this.type="directional",this.direction=new to(r).normalize().toArray(),this.shadow=s}getProjectedLight(){return this}}class PH{constructor(e={}){const{id:t="effect"}=e;this.id=t,this.props=K({},e)}preRender(){}getModuleParameters(){}cleanup(){}}class UP extends class{constructor(e,t={}){const{id:i="pass"}=t;this.id=i,this.gl=e,this.props=K({},t)}setProps(e){Object.assign(this.props,e)}render(){}cleanup(){}}{render(e){return Xu(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){Xu(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=RH(),c={viewport:e,isPicking:i.startsWith("picking"),renderPass:i};for(let d=0;dpI(e,c))}const l={totalCount:t.length,visibleCount:0,compositeCount:0,pickableCount:0};Xu(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]||RH(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 Ume extends UP{constructor(e,t){super(e,t),this.shadowMap=new na(e,{width:1,height:1,parameters:{10241:9729,10240:9729,10242:33071,10243:33071}}),this.depthBuffer=new vm(e,{format:33189,width:1,height:1}),this.fbo=new ss(e,{id:"shadowmap",width:1,height:1,attachments:{36064:this.shadowMap,36096:this.depthBuffer}})}render(e){const t=this.fbo;rc(this.gl,{depthRange:[0,1],depthTest:!0,blend:!1,clearColor:[1,1,1,1]},()=>{const i=e.viewports[0],r=mm(this.gl),s=i.width*r,o=i.height*r;(s!==t.width||o!==t.height)&&t.resize({width:s,height:o}),super.render(Lt(K({},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 $me=Object.keys(qn).map(n=>"const int COORDINATE_SYSTEM_".concat(n," = ").concat(qn[n],";")).join(""),Gme=Object.keys(Yc).map(n=>"const int PROJECTION_MODE_".concat(n," = ").concat(Yc[n],";")).join(""),Wme="".concat($me,"\n").concat(Gme,"\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"),qme={},HP={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:Wme,getUniforms:function(n=qme){return n.viewport?function({viewport:n,devicePixelRatio:e=1,modelMatrix:t=null,coordinateSystem:i=qn.DEFAULT,coordinateOrigin:r,autoWrapLongitude:s=!1}={}){i===qn.DEFAULT&&(i=n.isGeospatial?qn.LNGLAT:qn.CARTESIAN);const o=Zfe({viewport:n,devicePixelRatio:e,coordinateSystem:i,coordinateOrigin:r});return o.project_uWrapLongitude=s,o.project_uModelMatrix=t||Yfe,o}(n):{}}},Zme=NS(function({viewport:n,center:e}){return new $t(n.viewProjectionMatrix).invert().transform(e)}),Qme=NS(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=gb([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 to(n.center).negate()),l=s.map(d=>a.transform(d)),c=(new $t).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}),Jme=[0,0,0,1],e_e=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0],$P={name:"shadow",dependencies:[HP],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||Jme,shadow_uLightId:n.shadowLightId||0,shadow_uLightCount:n.shadowMatrices.length},i=Zme({viewport:n.viewport,center:e.project_uCenter}),r=[],s=Qme({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{}}},s_e={color:[255,255,255],intensity:1},kH=[{color:[255,255,255],intensity:1,direction:[-1,3,-1]},{color:[255,255,255],intensity:.9,direction:[1,-8,-2.5]}],o_e=[0,0,0,200/255];class GP extends PH{constructor(e){super(e),this.ambientLight=null,this.directionalLights=[],this.pointLights=[],this.shadowColor=o_e,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=db.getDefaultProgramManager(e),$P&&this.programManager.addDefaultModule($P)),this.dummyShadowMap||(this.dummyShadowMap=new na(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($P),this.programManager=null)}_createLightMatrix(){const e=[];for(const t of this.directionalLights){const i=(new $t).lookAt({eye:new to(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=l_e++;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 c_e{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=wb(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 u_e{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 c_e(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 d_e=[{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"},HP],h_e=["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 f_e(n){const e=db.getDefaultProgramManager(n);for(const t of d_e)e.addDefaultModule(t);for(const t of h_e)e.addShaderHook(t);return e}const m_e=Object.seal({layerManager:null,resourceManager:null,deck:null,gl:null,stats:null,shaderCache:null,pickingFBO:null,mousePosition:null,userData:{}});class __e{constructor(e,{deck:t,stats:i,viewport:r,timeline:s}={}){this.lastRenderedLayers=[],this.layers=[],this.resourceManager=new u_e({gl:e,protocol:"deck://"}),this.context=Lt(K({},m_e),{layerManager:this,gl:e,deck:t,programManager:e&&f_e(e),stats:i||new aI({id:"deck.gl"}),viewport:r||new Om({id:"DEFAULT-INITIAL-VIEWPORT"}),timeline:s||new FH,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){no("layerManager.setLayers",this,t,e),this.lastRenderedLayers=e,e=EI(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 no("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]?jn.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&&jn.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 y_e{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=EI(e,Boolean),this._diffViews(e,this.views)&&this.setNeedsUpdate("views changed"),this.views=e}_setViewState(e){e?(!Sb(e,this.viewState)&&this.setNeedsUpdate("viewState changed"),this.viewState=e):jn.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)(K({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=Lt(K(K(K({},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 b_e extends DH{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:y,startRotatePos:v,startBearing:C,startPitch:w,startZoom:x,normalize:N}={}){sc(Number.isFinite(s)),sc(Number.isFinite(r)),sc(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:N}),this._state={startPanLngLat:_,startZoomLngLat:y,startRotatePos:v,startBearing:C,startPitch:w,startZoom:x},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(Lt(K({},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(Lt(K({},this._viewportProps),{zoom:o}));return this._getUpdatedState(K({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=K({},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(K(K(K({makeViewport:this.makeViewport},this._viewportProps),this._state),e))}_applyConstraints(e){const{maxZoom:t,minZoom:i,zoom:r}=e;e.zoom=np(r,i,t);const{maxPitch:s,minPitch:o,pitch:a}=e;e.pitch=np(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=A5(t+180,360)-180),(o<-180||o>180)&&(o=A5(o+180,360)-180);const a=qI(e/512);if(r<=a)r=a,i=0;else{const l=e/2/Math.pow(2,r),c=Dm([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 np(t+Math.log2(e),r,i)}_calculateNewPitchAndBearing({deltaScaleX:e,deltaScaleY:t,startBearing:i,startPitch:r}){t=np(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 C_e extends jP{constructor(e){e.dragMode=e.dragMode||"pan",super(b_e,e)}setProps(e){const t=this.controllerStateProps;super.setProps(e),(!t||t.height!==e.height)&&this.updateViewport(new this.ControllerState(K(K({makeViewport:this.makeViewport},this.controllerStateProps),this._state)))}get linearTransitionProps(){return["longitude","latitude","zoom","bearing","pitch"]}}let w_e=(()=>{class n extends zP{constructor(t){super(Lt(K({},t),{type:j5}))}get controller(){return this._getControllerProps({type:C_e})}}return n.displayName="MapView",n})();const E_e=new GP;class S_e{constructor(){this.effects=[],this._internalEffects=[],this._needsRedraw="Initial render",this.setEffects()}setProps(e){"effects"in e&&(e.effects.length!==this.effects.length||!Sb(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 GP)||this._internalEffects.push(E_e)}}class M_e extends UP{}const LH={blendFunc:[1,0,32771,0],blendEquation:32774};class BH extends UP{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,rc(_,Lt(K({scissorTest:!0,scissor:[a,l,c,d],clearColor:[0,0,0,0],depthMask:!0,depthTest:!0,depthRange:[0,1],colorMask:[!0,!0,!0,!0]},LH),{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}:Lt(K({},LH),{blend:!0,blendColor:[0,0,0,this.useAlpha?(t+1)/255:1]});return K(K({},e.props.parameters),i)}}class T_e{constructor(e){this.gl=e,this.layerFilter=null,this.drawPickingColors=!1,this.drawLayersPass=new M_e(e),this.pickLayersPass=new BH(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||ss.getDefaultFramebuffer(this.gl),this._preRender(e.effects,e);const i=this.lastPostProcessEffect?this.renderBuffers[0]:e.target,r=t.render(Lt(K({},e),{target:i}));this._postRender(e.effects,e),this.renderCount++,no("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 ss(this.gl),new ss(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 A_e={pickedColor:null,pickedLayer:null,pickedObjectIndex:-1};function D_e({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 v=0;v=0){const w=v+o-t,x=w*w+y;x<=d&&(d=x,f=p)}p+=4}}if(f>=0){const g=n[f+3]-1,_=n.slice(f,f+4),y=e[g];if(y){const v=y.decodePickingColor(_),C=Math.floor(f/4/l);return{pickedColor:_,pickedLayer:y,pickedObjectIndex:v,pickedX:o+(f/4-C*l),pickedY:a+C}}jn.error("Picked non-existent layer. Is picking buffer corrupt?")()}}return A_e}function VH({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 I_e(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(y=>y.props.id===p);_&&l.unshift(_)}t.layerId=g,t.index=a,t.info=null}}const c=VH(n),d=new Map;return d.set(null,c),l.forEach(f=>{let p=K({},c);f===o&&(p.color=s,p.index=a,p.picked=!0),p=zH({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 zH({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 R_e{constructor(e){this.gl=e,this.pickingFBO=null,this.pickLayersPass=new BH(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?K(K({},s),f):Object.assign(f,{color:null,object:null,index:-1})}_resizeBuffer(){const{gl:e}=this;return this.pickingFBO||(this.pickingFBO=new ss(e),ss.isSupported(e,{colorBufferFloat:!0})&&(this.depthFBO=new ss(e),this.depthFBO.attach({36064:new na(e,{format:In(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?(jn.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:VH({viewports:i,x:r,y:s})};this._resizeBuffer();const f=mm(this.gl),p=rI(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:y,height:v}=this.pickingFBO,C=this._getPickingRect({deviceX:g[0],deviceY:g[1],deviceRadius:_,deviceWidth:y,deviceHeight:v});let w;const x=[],N={};for(let V=0;V=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)}):jn.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:C,width:y.x+y.width-g,height:_-C},pass:"picking:".concat(l),redrawReason:l}),layers:e}),V=new Map,U=Number.isFinite(c);for(let ee=0;ee=c);ee++){const de=N[ee];let ae={color:de.pickedColor,layer:null,index:de.pickedObjectIndex,picked:!0,x:r,y:s,width:o,height:a,pixelRatio:f};ae=zH({layer:de.pickedLayer,info:ae,mode:l}),V.has(ae.object)||V.set(ae.object,ae)}return Array.from(V.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 vS(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 k_e={zIndex:1,position:"absolute",pointerEvents:"none",color:"#a0a7b4",backgroundColor:"#29323c",padding:"10px",top:0,left:0,display:"none"};class F_e{constructor(e){const t=e.parentElement;t&&(this.el=document.createElement("div"),this.el.className="deck-tooltip",Object.assign(this.el.style,k_e),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 jH(n,e){if(!n)throw new Error(e)}const tu={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},UH=tu.global||tu.self||tu.window,L_e="object"!=typeof process||"[object process]"!==String(process)||process.browser,HH="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version),{_parseImageNode:B_e}=(HH&&parseFloat(HH[1]),UH),WP="undefined"!=typeof Image,qP="undefined"!=typeof ImageBitmap,V_e=Boolean(B_e),YP=!!L_e||V_e;function $H(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 GH(n){switch($H(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 U_e=/^data:image\/svg\+xml/,H_e=/\.svg((\?|#).*)?$/;function XP(n){return n&&(U_e.test(n)||H_e.test(n))}function $_e(n,e){if(XP(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 qH(n,e)}function qH(n,e){if(XP(e))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(n)])}function YH(n,e,t){return KP.apply(this,arguments)}function KP(){return(KP=yn(function*(n,e,t){const i=$_e(n,t),r=self.URL||self.webkitURL,s="string"!=typeof i&&r.createObjectURL(i);try{return yield G_e(s||i,e)}finally{s&&r.revokeObjectURL(s)}})).apply(this,arguments)}function G_e(n,e){return ZP.apply(this,arguments)}function ZP(){return(ZP=yn(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 W_e={};let XH=!0;function q_e(n,e,t){return QP.apply(this,arguments)}function QP(){return(QP=yn(function*(n,e,t){let i;i=XP(t)?yield YH(n,e,t):qH(n,t);const r=e&&e.imagebitmap;return yield Y_e(i,r)})).apply(this,arguments)}function Y_e(n){return JP.apply(this,arguments)}function JP(){return(JP=yn(function*(n,e=null){if((X_e(e)||!XH)&&(e=null),e)try{return yield createImageBitmap(n,e)}catch(t){console.warn(t),XH=!1}return yield createImageBitmap(n)})).apply(this,arguments)}function X_e(n){for(const e in n||W_e)return!1;return!0}const nu=!1,xb=!0;function eR(n){const e=Tb(n);return function(n){const e=Tb(n);return e.byteLength>=24&&2303741511===e.getUint32(0,nu)?{mimeType:"image/png",width:e.getUint32(16,nu),height:e.getUint32(20,nu)}:null}(e)||function(n){const e=Tb(n);if(!(e.byteLength>=3&&65496===e.getUint16(0,nu)&&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,nu)?{mimeType:"image/gif",width:e.getUint16(6,xb),height:e.getUint16(8,xb)}:null}(e)||function(n){const e=Tb(n);return e.byteLength>=14&&16973===e.getUint16(0,nu)&&e.getUint32(2,xb)===e.byteLength?{mimeType:"image/bmp",width:e.getUint32(18,xb),height:e.getUint32(22,xb)}:null}(e)}function Tb(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 tye(n,e){const{mimeType:t}=eR(n)||{},{_parseImageNode:i}=UH;return jH(i),i(n,t,e)}function tR(){return(tR=yn(function*(n,e,t){const r=((e=e||{}).image||{}).type||"auto",{url:s}=t||{};let a;switch(iye(r)){case"imagebitmap":a=yield q_e(n,e,s);break;case"image":a=yield YH(n,e,s);break;case"data":a=yield tye(n,e);break;default:jH(!1)}return"data"===r&&(a=GH(a)),a})).apply(this,arguments)}function iye(n){switch(n){case"auto":case"data":return function(){if(qP)return"imagebitmap";if(WP)return"image";if(YP)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}();default:return function(n){switch(n){case"auto":return qP||WP||YP;case"imagebitmap":return qP;case"image":return WP;case"data":return YP;default:throw new Error(`@loaders.gl/images: image ${n} not supported in this environment`)}}(n),n}}const nR={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 tR.apply(this,arguments)},tests:[n=>Boolean(eR(new DataView(n)))],options:{image:{type:"auto",decode:!0}}};var Rm=ze(761);const sye={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},Ab="8.5.8",tM=Rm.CO.deck&&Rm.CO.deck.VERSION;if(tM&&tM!==Ab)throw new Error("deck.gl - multiple versions detected: ".concat(tM," vs ").concat(Ab));tM||(jn.log(1,"deck.gl ".concat(Ab))(),Rm.CO.deck=Object.assign(Rm.CO.deck||{},{VERSION:Ab,version:Ab,log:jn,_registerLoggers:function(n){TI=n}}),vH([sye,[nR,{imagebitmap:{premultiplyAlpha:"none"}}]]));const oye=Rm.CO.deck;class nM extends Ku{get[Symbol.toStringTag](){return"Query"}static isSupported(e,t=[]){const i=In(e),r=f4(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:nt(!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 nM.isSupported(this.gl)?this.gl2.createQuery():null}_deleteHandle(){this.gl2.deleteQuery(this.handle)}}const KH=yS()&&"undefined"!=typeof document;let mye=0;class _ye{constructor(e={}){const{onCreateContext:t=(v=>qU(v)),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:_=Jf.get("animation-loop-"+mye++)}=e;let{useDevicePixels:y=!0}=e;"useDevicePixelRatio"in e&&(vt.deprecated("useDevicePixelRatio","useDevicePixels")(),y=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:y}),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 nt("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=nM.isSupported(this.gl,["timers"])?new nM(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 yn(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 vt.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=KH?new Promise((e,t)=>{KH&&"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?oI(this.props.gl,e):this.onCreateContext(e),!mS(this.gl))throw new Error("AnimationLoop.onCreateContext - illegal context returned");(function(n){Xu(n,iI)})(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)&&(vt.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)&&(vt.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 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: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 yye=ze(524),iM=ze.n(yye);const vye={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}))}}(iM().MouseInput);const Eye=iM().Manager,iu=iM(),Sye=iu?[[iu.Pan,{event:"tripan",pointers:3,threshold:0,enable:!1}],[iu.Rotate,{enable:!1}],[iu.Pinch,{enable:!1}],[iu.Swipe,{enable:!1}],[iu.Pan,{threshold:0,enable:!1}],[iu.Press,{enable:!1}],[iu.Tap,{event:"doubletap",taps:2,enable:!1}],[iu.Tap,{event:"anytap",enable:!1}],[iu.Tap,{enable:!1}]]:null,JH={tripan:["rotate","pinch","pan"],rotate:["pinch"],pinch:["pan"],pan:["press","doubletap","anytap","tap"],doubletap:["anytap"],anytap:["tap"]},Mye={doubletap:["tap"]},xye={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"]},Tye={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"},e6={click:"tap",anyclick:"anytap",dblclick:"doubletap",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup",mouseover:"pointerover",mouseout:"pointerout",mouseleave:"pointerleave"},Aye="undefined"!=typeof navigator&&navigator.userAgent?navigator.userAgent.toLowerCase():"",km="undefined"!=typeof window?window:global;"undefined"!=typeof global?global:window,"undefined"!=typeof document&&document;let t6=!1;try{const n={get passive(){return t6=!0,!0}};km.addEventListener("test",n,n),km.removeEventListener("test",n,n)}catch(n){}const Dye=-1!==Aye.indexOf("firefox"),{WHEEL_EVENTS:Oye}=rR,i6=4.000244140625;class Rye{constructor(e,t,i={}){this.element=e,this.callback=t,this.options=Object.assign({enable:!0},i),this.events=Oye.concat(i.events||[]),this.handleEvent=this.handleEvent.bind(this),this.events.forEach(r=>e.addEventListener(r,this.handleEvent,!!t6&&{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;km.WheelEvent&&(Dye&&e.deltaMode===km.WheelEvent.DOM_DELTA_PIXEL&&(t/=km.devicePixelRatio),e.deltaMode===km.WheelEvent.DOM_DELTA_LINE&&(t*=40));const i={x:e.clientX,y:e.clientY};0!==t&&t%i6==0&&(t=Math.floor(t/i6)),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:kye}=rR,r6="pointermove",s6="pointerover",o6="pointerout",a6="pointerleave";class Fye{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=kye.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===r6&&(this.enableMoveEvent=t),e===s6&&(this.enableOverEvent=t),e===o6&&(this.enableOutEvent=t),e===a6&&(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:s6,srcEvent:e,pointerType:"mouse",target:e.target})}handleOutEvent(e){this.enableOutEvent&&"mouseout"===e.type&&this.callback({type:o6,srcEvent:e,pointerType:"mouse",target:e.target})}handleLeaveEvent(e){this.enableLeaveEvent&&"mouseleave"===e.type&&this.callback({type:a6,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:r6,srcEvent:e,pointerType:"mouse",target:e.target});break;case"mouseup":this.pressed=!1}}}const{KEY_EVENTS:Nye}=rR,l6="keydown";class Lye{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=Nye.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===l6&&(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:l6,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 u6="contextmenu";class Bye{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===u6&&(this.options.enable=t)}handleEvent(e){!this.options.enable||this.callback({type:u6,center:{x:e.clientX,y:e.clientY},srcEvent:e,pointerType:"mouse",target:e.target})}}const Vye={pointerdown:1,pointermove:2,pointerup:4,mousedown:1,mousemove:2,mouseup:4},d6={srcElement:"root",priority:0};class Zye{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({},d6,i):d6;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&&JH[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 Rye(e,this._onOtherEvent,{enable:!1}),this.moveInput=new Fye(e,this._onOtherEvent,{enable:!1}),this.keyInput=new Lye(e,this._onOtherEvent,{enable:!1,tabIndex:t.tabIndex}),this.contextmenuInput=new Bye(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=Mye[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=e6[e]||e;let c=a.get(l);c||(c=new Zye(this),a.set(l,c),c.recognizerName=Tye[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(e6[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=xye[t.type];i&&this.manager.emit(i,e)}_onOtherEvent(e){this.manager.emit(e.type,e)}}function ap(){}const h6={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:ap,onResize:ap,onViewStateChange:ap,onInteractionStateChange:ap,onBeforeRender:ap,onAfterRender:ap,onLoad:ap,onError:(n,e)=>jn.error(n)(),_onMetrics:null,getCursor:({isDragging:n})=>n?"grabbing":"grab",debug:!1,drawPickingColors:!1};class sM{constructor(e){e=K(K({},h6),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&&jn.warn("View state tracking is disabled. Use either `initialViewState` for auto update or `viewState` for manual update.")(),"IE"===(0,Rm.qs)()&&jn.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 aI({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&&nb.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&&jn.removed("onLayerHover","onHover")(),"onLayerClick"in e&&jn.removed("onLayerClick","onClick")(),e.initialViewState&&!Sb(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](K({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),sc(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 _ye({width:t,height:i,useDevicePixels:d,autoResizeDrawingBuffer:f,autoResizeViewport:!1,gl:r,onCreateContext:p=>qU(Lt(K(K({},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 w_e({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,oI(e,{enable:!0,copyState:!0})),this.tooltip=new F_e(this.canvas),Xu(e,{blend:!0,blendFunc:[770,771,1,771],polygonOffsetFill:!0,depthTest:!0,depthFunc:515}),this.props.onWebGLInitialized(e);const t=new FH;t.play(),this.animationLoop.attachTimeline(t),this.eventManager=new Jye(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 IU)this.eventManager.on(r,this._onEvent);this.viewManager=new y_e({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 __e(e,{deck:this,stats:this.stats,viewport:i,timeline:t}),this.effectManager=new S_e,this.deckRenderer=new T_e(e),this.deckPicker=new R_e(e),this.setProps(this.props),this._updateCanvasSize(),this.props.onLoad()}_drawLayers(e,t){const{gl:i}=this.layerManager.context;Xu(i,this.props.parameters),this.props.onBeforeRender({gl:i}),this.deckRenderer.renderLayers(K({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(),jn.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=Lt(K({},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=IU[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=Jf.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}}sM.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(PH)),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}},sM.defaultProps=h6,sM.VERSION=oye.VERSION;const oM={name:"project32",dependencies:[HP],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"},ive={pickingSelectedColor:null,pickingHighlightColor:new Uint8Array([0,255,255,255]),pickingActive:!1,pickingAttribute:!1},aM=K({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=ive){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}}),f6={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6};class _h{static get DRAW_MODE(){return f6}constructor(e={}){const{id:t=ea("geometry"),drawMode:i=f6.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?K({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,nt(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?(nt(!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 nt(Number.isFinite(i)),i}}const p6=()=>{},cve={10241:9987,10240:9729,10242:33071,10243:33071};function uve(n){return Math.pow(2,Math.ceil(Math.log2(n)))}function dve(n,e,t,i){return t===e.width&&i===e.height?e:(n.canvas.height=i,n.canvas.width=t,n.clearRect(0,0,n.canvas.width,n.canvas.height),n.drawImage(e,0,0,e.width,e.height,0,0,t,i),n.canvas)}function Db(n){return n&&(n.id||n.url)}function g6(n,e,t){for(let i=0;i0){const{mapping:i,xOffset:r,yOffset:s,rowHeight:o,canvasHeight:a}=function({icons:n,buffer:e,mapping:t={},xOffset:i=0,yOffset:r=0,rowHeight:s=0,canvasWidth:o}){let a=[];for(let l=0;lo&&(g6(t,a,r),i=0,r=s+r+e,s=0,a=[]),a.push({icon:c,xOffset:i}),i=i+p+e,s=Math.max(s,f)}}return a.length>0&&g6(t,a,r),{mapping:t,rowHeight:s,xOffset:i,yOffset:r,canvasWidth:o,canvasHeight:uve(s+r+e)}}({icons:t,buffer:this._buffer,canvasWidth:this._canvasWidth,mapping:this._mapping,rowHeight:this._rowHeight,xOffset:this._xOffset,yOffset:this._yOffset});this._rowHeight=o,this._mapping=i,this._xOffset=r,this._yOffset=s,this._canvasHeight=a,this._texture||(this._texture=new na(this.gl,{width:this._canvasWidth,height:this._canvasHeight,parameters:cve})),this._texture.height!==this._canvasHeight&&(this._texture=function(n,e,t,i){const r=e.width,s=e.height,o=u4(e,{width:t,height:i});return function(n,e,t={}){const{sourceX:i=0,sourceY:r=0,targetMipmaplevel:s=0,targetInternalFormat:o=6408}=t;let{targetX:a,targetY:l,targetZ:c,width:d,height:f}=t;const{framebuffer:p,deleteFramebuffer:g}=tb(n);nt(p);const{gl:_,handle:y}=p,v=void 0!==a||void 0!==l||void 0!==c;a=a||0,l=l||0,c=c||0;const C=_.bindFramebuffer(36160,y);nt(e);let w=null;if(e instanceof ep&&(w=e,d=Number.isFinite(d)?d:w.width,f=Number.isFinite(f)?f:w.height,w.bind(0),e=w.target),v)switch(e){case 3553:case 34067:_.copyTexSubImage2D(e,s,a,l,i,r,d,f);break;case 35866:case 32879:eo(_).copyTexSubImage3D(e,s,a,l,c,i,r,d,f)}else _.copyTexImage2D(e,s,o,i,r,d,f,0);w&&w.unbind(),_.bindFramebuffer(36160,C||null),g&&p.delete()}(e,o,{targetY:0,width:r,height:s}),e.delete(),o}(0,this._texture,this._canvasWidth,this._canvasHeight)),this.onUpdate(),this._loadIcons(t)}}_loadIcons(e){const t=this._canvas.getContext("2d");for(const i of e)this._pendingCount++,wb(i.url,nR,this._loadOptions).then(r=>{const s=Db(i),{x:o,y:a,width:l,height:c}=this._mapping[s],d=dve(t,r,l,c);this._texture.setSubImageData({data:d,x:o,y:a,width:l,height:c}),this._texture.generateMipmap(),this.onUpdate()}).catch(r=>{this.onError({url:i.url,source:i.source,sourceIndex:i.sourceIndex,loadOptions:this._loadOptions,error:r})}).finally(()=>{this._pendingCount--})}}const m6=[0,0,0,255],mve={iconAtlas:{type:"image",value:null,async:!0},iconMapping:{type:"object",value:{},async:!0},sizeScale:{type:"number",value:1,min:0},billboard:!0,sizeUnits:"pixels",sizeMinPixels:{type:"number",min:0,value:0},sizeMaxPixels:{type:"number",min:0,value:Number.MAX_SAFE_INTEGER},alphaCutoff:{type:"number",value:.05,min:0,max:1},getPosition:{type:"accessor",value:n=>n.position},getIcon:{type:"accessor",value:n=>n.icon},getColor:{type:"accessor",value:m6},getSize:{type:"accessor",value:1},getAngle:{type:"accessor",value:0},getPixelOffset:{type:"accessor",value:[0,0]},onIconError:{type:"function",value:null,compare:!1,optional:!0}};let _ve=(()=>{class n extends Eb{getShaders(){return super.getShaders({vs:"#define SHADER_NAME icon-layer-vertex-shader\n\nattribute vec2 positions;\n\nattribute vec3 instancePositions;\nattribute vec3 instancePositions64Low;\nattribute float instanceSizes;\nattribute float instanceAngles;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\nattribute vec4 instanceIconFrames;\nattribute float instanceColorModes;\nattribute vec2 instanceOffsets;\nattribute vec2 instancePixelOffset;\n\nuniform float sizeScale;\nuniform vec2 iconsTextureDim;\nuniform float sizeMinPixels;\nuniform float sizeMaxPixels;\nuniform bool billboard;\n\nvarying float vColorMode;\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\nvarying vec2 uv;\n\nvec2 rotate_by_angle(vec2 vertex, float angle) {\n float angle_radian = angle * PI / 180.0;\n float cos_angle = cos(angle_radian);\n float sin_angle = sin(angle_radian);\n mat2 rotationMatrix = mat2(cos_angle, -sin_angle, sin_angle, cos_angle);\n return rotationMatrix * vertex;\n}\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n geometry.uv = positions;\n geometry.pickingColor = instancePickingColors;\n uv = positions;\n\n vec2 iconSize = instanceIconFrames.zw;\n float sizePixels = clamp(\n project_size_to_pixel(instanceSizes * sizeScale), \n sizeMinPixels, sizeMaxPixels\n );\n float instanceScale = iconSize.y == 0.0 ? 0.0 : sizePixels / iconSize.y;\n vec2 pixelOffset = positions / 2.0 * iconSize + instanceOffsets;\n pixelOffset = rotate_by_angle(pixelOffset, instanceAngles) * instanceScale;\n pixelOffset += instancePixelOffset;\n pixelOffset.y *= -1.0;\n\n if (billboard) {\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, vec3(0.0), geometry.position);\n vec3 offset = vec3(pixelOffset, 0.0);\n DECKGL_FILTER_SIZE(offset, geometry);\n gl_Position.xy += project_pixel_size_to_clipspace(offset.xy);\n\n } else {\n vec3 offset_common = vec3(project_pixel_size(pixelOffset), 0.0);\n DECKGL_FILTER_SIZE(offset_common, geometry);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, offset_common, geometry.position); \n }\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n vTextureCoords = mix(\n instanceIconFrames.xy,\n instanceIconFrames.xy + iconSize,\n (positions.xy + 1.0) / 2.0\n ) / iconsTextureDim;\n\n vColor = instanceColors;\n DECKGL_FILTER_COLOR(vColor, geometry);\n\n vColorMode = instanceColorModes;\n}\n",fs:"#define SHADER_NAME icon-layer-fragment-shader\n\nprecision highp float;\n\nuniform float opacity;\nuniform sampler2D iconsTexture;\nuniform float alphaCutoff;\n\nvarying float vColorMode;\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\nvarying vec2 uv;\n\nvoid main(void) {\n geometry.uv = uv;\n\n vec4 texColor = texture2D(iconsTexture, vTextureCoords);\n vec3 color = mix(texColor.rgb, vColor.rgb, vColorMode);\n float a = texColor.a * opacity * vColor.a;\n\n if (a < alphaCutoff) {\n discard;\n }\n\n gl_FragColor = vec4(color, a);\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:[oM,aM]})}initializeState(){this.state={iconManager:new gve(this.context.gl,{onUpdate:this._onUpdate.bind(this),onError:this._onError.bind(this)})},this.getAttributeManager().addInstanced({instancePositions:{size:3,type:5130,fp64:this.use64bitPositions(),transition:!0,accessor:"getPosition"},instanceSizes:{size:1,transition:!0,accessor:"getSize",defaultValue:1},instanceOffsets:{size:2,accessor:"getIcon",transform:this.getInstanceOffset},instanceIconFrames:{size:4,accessor:"getIcon",transform:this.getInstanceIconFrame},instanceColorModes:{size:1,type:5121,accessor:"getIcon",transform:this.getInstanceColorMode},instanceColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:!0,accessor:"getColor",defaultValue:m6},instanceAngles:{size:1,transition:!0,accessor:"getAngle"},instancePixelOffset:{size:2,transition:!0,accessor:"getPixelOffset"}})}updateState({oldProps:t,props:i,changeFlags:r}){super.updateState({props:i,oldProps:t,changeFlags:r});const s=this.getAttributeManager(),{iconAtlas:o,iconMapping:a,data:l,getIcon:c}=i,{iconManager:d}=this.state;d.setProps({loadOptions:i.loadOptions});let f=!1;if(o||this.internalState.isAsyncPropLoading("iconAtlas")?(t.iconAtlas!==i.iconAtlas&&d.setProps({iconAtlas:o,autoPacking:!1}),t.iconMapping!==i.iconMapping&&(d.setProps({iconMapping:a}),f=!0)):d.setProps({autoPacking:!0}),(r.dataChanged||r.updateTriggersChanged&&(r.updateTriggersChanged.all||r.updateTriggersChanged.getIcon))&&d.setProps({data:l,getIcon:c}),f&&(s.invalidate("instanceOffsets"),s.invalidate("instanceIconFrames"),s.invalidate("instanceColorModes")),r.extensionsChanged){var g;const{gl:_}=this.context;null===(g=this.state.model)||void 0===g||g.delete(),this.state.model=this._getModel(_),s.invalidateAll()}}get isLoaded(){return super.isLoaded&&this.state.iconManager.isLoaded}finalizeState(){super.finalizeState(),this.state.iconManager.finalize()}draw({uniforms:t}){const{sizeScale:i,sizeMinPixels:r,sizeMaxPixels:s,sizeUnits:o,billboard:a,alphaCutoff:l}=this.props,{iconManager:c}=this.state,{viewport:d}=this.context,f=c.getTexture();f&&this.state.model.setUniforms(t).setUniforms({iconsTexture:f,iconsTextureDim:[f.width,f.height],sizeScale:i*("pixels"===o?d.metersPerPixel:1),sizeMinPixels:r,sizeMaxPixels:s,billboard:a,alphaCutoff:l}).draw()}_getModel(t){return new Mm(t,Lt(K({},this.getShaders()),{id:this.props.id,geometry:new _h({drawMode:6,attributes:{positions:{size:2,value:new Float32Array([-1,-1,-1,1,1,1,1,-1])}}}),isInstanced:!0}))}_onUpdate(){this.setNeedsRedraw()}_onError(t){const{onIconError:i}=this.getCurrentLayer().props;i?i(t):jn.error(t.error)()}getInstanceOffset(t){const i=this.state.iconManager.getIconMapping(t);return[i.width/2-i.anchorX||0,i.height/2-i.anchorY||0]}getInstanceColorMode(t){return this.state.iconManager.getIconMapping(t).mask?1:0}getInstanceIconFrame(t){const i=this.state.iconManager.getIconMapping(t);return[i.x||0,i.y||0,i.width||0,i.height||0]}}return n.layerName="IconLayer",n.defaultProps=mve,n})();const y6=[],vve={getIconOffsets:{type:"accessor",value:n=>n.offsets},alphaCutoff:.001,smoothing:.1,outlineWidth:0,outlineColor:{type:"color",value:[0,0,0,255]}};let bve=(()=>{class n extends _ve{getShaders(){return Lt(K({},super.getShaders()),{fs:"#define SHADER_NAME multi-icon-layer-fragment-shader\n\nprecision highp float;\n\nuniform float opacity;\nuniform sampler2D iconsTexture;\nuniform float gamma;\nuniform bool sdf;\nuniform float alphaCutoff;\nuniform float buffer;\nuniform float outlineBuffer;\nuniform vec4 outlineColor;\n\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\nvarying vec2 uv;\n\nvoid main(void) {\n geometry.uv = uv;\n\n if (!picking_uActive) {\n float alpha = texture2D(iconsTexture, vTextureCoords).a;\n vec4 color = vColor;\n if (sdf) {\n float distance = alpha;\n alpha = smoothstep(buffer - gamma, buffer + gamma, distance);\n\n if (outlineBuffer > 0.0) {\n float inFill = alpha;\n float inBorder = smoothstep(outlineBuffer - gamma, outlineBuffer + gamma, distance);\n color = mix(outlineColor, vColor, inFill);\n alpha = inBorder;\n }\n }\n float a = alpha * color.a;\n \n if (a < alphaCutoff) {\n discard;\n }\n\n gl_FragColor = vec4(color.rgb, a * opacity);\n }\n\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n"})}initializeState(){super.initializeState(),this.getAttributeManager().addInstanced({instanceOffsets:{size:2,accessor:"getIconOffsets"},instancePickingColors:{type:5121,size:3,accessor:(i,{index:r,target:s})=>this.encodePickingColor(r,s)}})}updateState(t){super.updateState(t);const{props:i,oldProps:r}=t;let{outlineColor:s}=i;s!==r.outlineColor&&(s=s.map(o=>o/255),s[3]=Number.isFinite(s[3])?s[3]:1,this.setState({outlineColor:s})),!i.sdf&&i.outlineWidth&&jn.warn("".concat(this.id,": fontSettings.sdf is required to render outline"))()}draw(t){const{sdf:i,smoothing:r,outlineWidth:s}=this.props,{outlineColor:o}=this.state;t.uniforms=Lt(K({},t.uniforms),{buffer:.75,outlineBuffer:s?Math.max(r,.75*(1-s)):-1,gamma:r,sdf:Boolean(i),outlineColor:o}),super.draw(t)}getInstanceOffset(t){return t?Array.from(t).map(i=>super.getInstanceOffset(i)):y6}getInstanceColorMode(t){return 1}getInstanceIconFrame(t){return t?Array.from(t).map(i=>super.getInstanceIconFrame(i)):y6}}return n.layerName="MultiIconLayer",n.defaultProps=vve,n})();var Cve=ze(2),wve=ze.n(Cve);const Sve=[];function Mve(n){return Math.pow(2,Math.ceil(Math.log2(n)))}function v6(n,e,t,i){let r=0;for(let s=e;si&&(oa){let f=v6(n,a,l,r);c+f>i&&(oi&&(f=b6(n,a,l,i,r,s),o=s[s.length-1])),a=l,c+=f}}(n,r,s,t,i,o),o}function Dve(n,e,t,i,r,s){let o=0,a=0;for(let l=e;l0,d=[0,0],f=[];let p=0,g=0,_=0;for(let y=0;y<=s;y++){const v=n[y];if(("\n"===v||y===s)&&(_=y),_>g){const C=c?Ave(n,t,i,r,g,_):Sve;for(let w=0;w<=C.length;w++){const x=0===w?g:C[w-1],N=wi===e);t>=0&&this._order.splice(t,1)}_appendOrder(e){this._order.push(e)}}(3),Fve=["fontFamily","fontWeight","characterSet","fontSize","sdf","buffer","cutoff","radius"];function Lve(n,e){for(let t=0;t{o in e&&(this.props[o]=e[o])});const t=this._key;this._key=this._getKey();const i=function(n,e){const t=aR.get(n);if(!t)return e;const i=[];let s=Object.keys(t.mapping);s=new Set(s);let o=e;return o instanceof Array&&(o=new Set(o)),o.forEach(a=>{s.has(a)||i.push(a)}),i}(this._key,this.props.characterSet),r=aR.get(this._key);if(r&&0===i.length)return void(this._key!==t&&(this._atlas=r));const s=this._generateFontAtlas(this._key,i,r);this._atlas=s,aR.set(this._key,s)}_generateFontAtlas(e,t,i){const{fontFamily:r,fontWeight:s,fontSize:o,buffer:a,sdf:l,radius:c,cutoff:d}=this.props;let f=i&&i.data;f||(f=document.createElement("canvas"),f.width=1024);const p=f.getContext("2d");I6(p,r,o,s);const{mapping:g,canvasHeight:_,xOffset:y,yOffset:v}=function({characterSet:n,getFontWidth:e,fontHeight:t,buffer:i,maxCanvasWidth:r,mapping:s={},xOffset:o=0,yOffset:a=0}){let l=0,c=o,d=0;for(const p of n)if(!s[p]){const g=e(p,d++);c+g+2*i>r&&(c=0,l++),s[p]={x:c+i,y:a+l*(t+2*i)+i,width:g,height:t},c+=g+2*i}const f=t+2*i;return{mapping:s,xOffset:c,yOffset:a+l*f,canvasHeight:Mve(a+(l+1)*f)}}(K({getFontWidth:C=>p.measureText(C).width,fontHeight:1.2*o,buffer:a,characterSet:t,maxCanvasWidth:1024},i&&{mapping:i.mapping,xOffset:i.xOffset,yOffset:i.yOffset}));if(f.height!==_){const C=p.getImageData(0,0,f.width,f.height);f.height=_,p.putImageData(C,0,0)}if(I6(p,r,o,s),l){const C=new(wve())(o,a,c,d,r,s),w=p.getImageData(0,0,C.size,C.size);for(const x of t)Lve(C.draw(x),w),p.putImageData(w,g[x].x-a,g[x].y+a)}else for(const C of t)p.fillText(C,g[C].x,g[C].y+.9*o);return{xOffset:y,yOffset:v,mapping:g,data:f,width:f.width,height:f.height}}_getKey(){const{fontFamily:e,fontWeight:t,fontSize:i,buffer:r,sdf:s,radius:o,cutoff:a}=this.props;return s?"".concat(e," ").concat(t," ").concat(i," ").concat(r," ").concat(o," ").concat(a):"".concat(e," ").concat(t," ").concat(i," ").concat(r)}}const jve={billboard:!0,sizeScale:1,sizeUnits:"pixels",sizeMinPixels:0,sizeMaxPixels:Number.MAX_SAFE_INTEGER,padding:{type:"array",value:[0,0,0,0]},getPosition:{type:"accessor",value:n=>n.position},getSize:{type:"accessor",value:1},getAngle:{type:"accessor",value:0},getPixelOffset:{type:"accessor",value:[0,0]},getBoundingRect:{type:"accessor",value:[0,0,0,0]},getFillColor:{type:"accessor",value:[0,0,0,255]},getLineColor:{type:"accessor",value:[0,0,0,255]},getLineWidth:{type:"accessor",value:1}};let Uve=(()=>{class n extends Eb{getShaders(){return super.getShaders({vs:"#define SHADER_NAME text-background-layer-vertex-shader\n\nattribute vec2 positions;\n\nattribute vec3 instancePositions;\nattribute vec3 instancePositions64Low;\nattribute vec4 instanceRects;\nattribute float instanceSizes;\nattribute float instanceAngles;\nattribute vec2 instancePixelOffsets;\nattribute float instanceLineWidths;\nattribute vec4 instanceFillColors;\nattribute vec4 instanceLineColors;\nattribute vec3 instancePickingColors;\n\nuniform bool billboard;\nuniform float opacity;\nuniform float sizeScale;\nuniform float sizeMinPixels;\nuniform float sizeMaxPixels;\nuniform vec4 padding;\n\nvarying vec4 vFillColor;\nvarying vec4 vLineColor;\nvarying float vLineWidth;\nvarying vec2 uv;\nvarying vec2 dimensions;\n\nvec2 rotate_by_angle(vec2 vertex, float angle) {\n float angle_radian = radians(angle);\n float cos_angle = cos(angle_radian);\n float sin_angle = sin(angle_radian);\n mat2 rotationMatrix = mat2(cos_angle, -sin_angle, sin_angle, cos_angle);\n return rotationMatrix * vertex;\n}\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n geometry.uv = positions;\n geometry.pickingColor = instancePickingColors;\n uv = positions;\n vLineWidth = instanceLineWidths;\n float sizePixels = clamp(\n project_size_to_pixel(instanceSizes * sizeScale),\n sizeMinPixels, sizeMaxPixels\n );\n\n dimensions = instanceRects.zw * sizePixels + padding.xy + padding.zw;\n\n vec2 pixelOffset = (positions * instanceRects.zw + instanceRects.xy) * sizePixels + mix(-padding.xy, padding.zw, positions);\n pixelOffset = rotate_by_angle(pixelOffset, instanceAngles);\n pixelOffset += instancePixelOffsets;\n pixelOffset.y *= -1.0;\n\n if (billboard) {\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, vec3(0.0), geometry.position);\n vec3 offset = vec3(pixelOffset, 0.0);\n DECKGL_FILTER_SIZE(offset, geometry);\n gl_Position.xy += project_pixel_size_to_clipspace(offset.xy);\n } else {\n vec3 offset_common = vec3(project_pixel_size(pixelOffset), 0.0);\n DECKGL_FILTER_SIZE(offset_common, geometry);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, offset_common, geometry.position);\n }\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n vFillColor = vec4(instanceFillColors.rgb, instanceFillColors.a * opacity);\n DECKGL_FILTER_COLOR(vFillColor, geometry);\n vLineColor = vec4(instanceLineColors.rgb, instanceLineColors.a * opacity);\n DECKGL_FILTER_COLOR(vLineColor, geometry);\n}\n",fs:"#define SHADER_NAME text-background-layer-fragment-shader\n\nprecision highp float;\n\nuniform bool stroked;\n\nvarying vec4 vFillColor;\nvarying vec4 vLineColor;\nvarying float vLineWidth;\nvarying vec2 uv;\nvarying vec2 dimensions;\n\nvoid main(void) {\n geometry.uv = uv;\n\n vec2 pixelPosition = uv * dimensions;\n if (stroked) {\n float distToEdge = min(\n min(pixelPosition.x, dimensions.x - pixelPosition.x),\n min(pixelPosition.y, dimensions.y - pixelPosition.y)\n );\n float isBorder = smoothedge(distToEdge, vLineWidth);\n gl_FragColor = mix(vFillColor, vLineColor, isBorder);\n } else {\n gl_FragColor = vFillColor;\n }\n\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:[oM,aM]})}initializeState(){this.getAttributeManager().addInstanced({instancePositions:{size:3,type:5130,fp64:this.use64bitPositions(),transition:!0,accessor:"getPosition"},instanceSizes:{size:1,transition:!0,accessor:"getSize",defaultValue:1},instanceAngles:{size:1,transition:!0,accessor:"getAngle"},instanceRects:{size:4,accessor:"getBoundingRect"},instancePixelOffsets:{size:2,transition:!0,accessor:"getPixelOffset"},instanceFillColors:{size:4,transition:!0,normalized:!0,type:5121,accessor:"getFillColor",defaultValue:[0,0,0,255]},instanceLineColors:{size:4,transition:!0,normalized:!0,type:5121,accessor:"getLineColor",defaultValue:[0,0,0,255]},instanceLineWidths:{size:1,transition:!0,accessor:"getLineWidth",defaultValue:1}})}updateState({props:t,oldProps:i,changeFlags:r}){if(super.updateState({props:t,oldProps:i,changeFlags:r}),r.extensionsChanged){var s;const{gl:o}=this.context;null===(s=this.state.model)||void 0===s||s.delete(),this.state.model=this._getModel(o),this.getAttributeManager().invalidateAll()}}draw({uniforms:t}){const{viewport:i}=this.context,{billboard:r,sizeScale:s,sizeUnits:o,sizeMinPixels:a,sizeMaxPixels:l,getLineWidth:c}=this.props;let{padding:d}=this.props;const f="pixels"===o?i.metersPerPixel:1;d.length<4&&(d=[d[0],d[1],d[0],d[1]]),this.state.model.setUniforms(t).setUniforms({billboard:r,stroked:Boolean(c),padding:d,sizeScale:s*f,sizeMinPixels:a,sizeMaxPixels:l}).draw()}_getModel(t){return new Mm(t,Lt(K({},this.getShaders()),{id:this.props.id,geometry:new _h({drawMode:6,vertexCount:4,attributes:{positions:{size:2,value:new Float32Array([0,0,1,0,1,1,0,1])}}}),isInstanced:!0}))}}return n.layerName="TextBackgroundLayer",n.defaultProps=jve,n})();const P6={fontSize:64,buffer:4,sdf:!1,radius:12,cutoff:.25,smoothing:.1},R6={start:1,middle:0,end:-1},k6={top:1,center:0,bottom:-1},lR=[0,0,0,255],$ve=["fontSize","buffer","sdf","radius","cutoff"],Gve={billboard:!0,sizeScale:1,sizeUnits:"pixels",sizeMinPixels:0,sizeMaxPixels:Number.MAX_SAFE_INTEGER,background:!1,getBackgroundColor:{type:"accessor",value:[255,255,255,255]},getBorderColor:{type:"accessor",value:lR},getBorderWidth:{type:"accessor",value:0},backgroundPadding:{type:"array",value:[0,0,0,0]},characterSet:{type:"object",value:w6},fontFamily:E6,fontWeight:"normal",lineHeight:1,outlineWidth:{type:"number",value:0,min:0},outlineColor:{type:"color",value:lR},fontSettings:{},wordBreak:"break-word",maxWidth:{type:"number",value:-1},getText:{type:"accessor",value:n=>n.text},getPosition:{type:"accessor",value:n=>n.position},getColor:{type:"accessor",value:lR},getSize:{type:"accessor",value:32},getAngle:{type:"accessor",value:0},getTextAnchor:{type:"accessor",value:"middle"},getAlignmentBaseline:{type:"accessor",value:"center"},getPixelOffset:{type:"accessor",value:[0,0]},backgroundColor:{deprecatedFor:["background","getBackgroundColor"]}};let Wve=(()=>{class n extends MH{initializeState(){this.state={styleVersion:0,fontAtlasManager:new Bve}}updateState({props:t,oldProps:i,changeFlags:r}){const o=this.state.characterSet;(r.dataChanged||r.updateTriggersChanged&&(r.updateTriggersChanged.all||r.updateTriggersChanged.getText))&&this._updateText();const a=o!==this.state.characterSet||this._fontChanged(i,t);a&&this._updateFontAtlas(i,t),(a||t.lineHeight!==i.lineHeight||t.wordBreak!==i.wordBreak||t.maxWidth!==i.maxWidth)&&this.setState({styleVersion:this.state.styleVersion+1})}getPickingInfo({info:t}){return t.object=t.index>=0?this.props.data[t.index]:null,t}_updateFontAtlas(t,i){const{fontSettings:r,fontFamily:s,fontWeight:o}=i,{fontAtlasManager:a,characterSet:l}=this.state;a.setProps(Lt(K(K({},P6),r),{characterSet:l,fontFamily:s,fontWeight:o}))}_fontChanged(t,i){if(t.fontFamily!==i.fontFamily||t.fontWeight!==i.fontWeight)return!0;if(t.fontSettings===i.fontSettings)return!1;const r=t.fontSettings||{},s=i.fontSettings||{};return $ve.some(o=>r[o]!==s[o])}_updateText(){const{data:t,characterSet:i}=this.props,r=t.attributes&&t.attributes.getText;let a,{getText:s}=this.props,{startIndices:o}=t;const l="auto"===i&&new Set;if(r&&o){const{texts:c,characterCount:d}=function({value:n,length:e,stride:t,offset:i,startIndices:r,characterSet:s}){const o=n.BYTES_PER_ELEMENT,a=t?t/o:1,l=i?i/o:0,c=r[e]||Math.ceil((n.length-l)/a),d=s&&new Set,f=new Array(e);let p=n;if(a>1||l>0){p=new n.constructor(c);for(let g=0;gc[p]}else{const{iterable:c,objectInfo:d}=SS(t);o=[0],a=0;for(const f of c){d.index++;const p=Array.from(s(f,d)||"");l&&p.forEach(l.add,l),a+=p.length,o.push(a)}}this.setState({getText:s,startIndices:o,numInstances:a,characterSet:l||i})}getBoundingRect(t,i){const r=this.state.fontAtlasManager.mapping,{getText:s}=this.state,{wordBreak:o,maxWidth:a,lineHeight:l,getTextAnchor:c,getAlignmentBaseline:d}=this.props,f=s(t,i)||"",{size:[p,g]}=C6(f,l,o,a,r);return[(R6["function"==typeof c?c(t,i):c]-1)*p/2,(k6["function"==typeof d?d(t,i):d]-1)*g/2,p,g]}getIconOffsets(t,i){const r=this.state.fontAtlasManager.mapping,{getText:s}=this.state,{wordBreak:o,maxWidth:a,lineHeight:l,getTextAnchor:c,getAlignmentBaseline:d}=this.props,f=s(t,i)||"",{x:p,y:g,rowWidth:_,size:[y,v]}=C6(f,l,o,a,r),C=R6["function"==typeof c?c(t,i):c],w=k6["function"==typeof d?d(t,i):d],x=p.length,N=new Array(2*x);let V=0;for(let U=0;Ut*e/255)}const uR={name:"lights",vs:F6,fs:F6,getUniforms:function N6(n=qve){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?cR(n):[0,0,0],e.forEach((r,s)=>{i[`lighting_uPointLight[${s}].color`]=cR(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`]=cR(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 N6({lightSources:e})}return{}},defines:{MAX_LIGHTS:3}},Xve={};const Zve={name:"phong-lighting",dependencies:[uR],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=Xve){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}}},dR=Math.PI/180,lM=new Float32Array(16),V6=new Float32Array(12);function z6(n,e,t){const i=e[0]*dR,r=e[1]*dR,s=e[2]*dR,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 j6(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 U6={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 y;g?(lM.set(a),y=j6(lM)):(y=V6,z6(y,r,s),y.set(o,9)),n.value=new Float32Array(y)}else{let y=e*n.size;const{iterable:v,objectInfo:C}=SS(i,e,t);for(const w of v){let x;C.index++,g?(lM.set(c?a:a(w,C)),x=j6(lM)):(x=V6,z6(x,f?r:r(w,C),d?s:s(w,C)),x.set(p?o:o(w,C),9)),_[y++]=x[0],_[y++]=x[1],_[y++]=x[2],_[y++]=x[3],_[y++]=x[4],_[y++]=x[5],_[y++]=x[6],_[y++]=x[7],_[y++]=x[8],_[y++]=x[9],_[y++]=x[10],_[y++]=x[11]}}}};function H6(n,e){return e===qn.CARTESIAN||e===qn.METER_OFFSETS||e===qn.DEFAULT&&!n.isGeospatial}function $6(n,e){(n.COLOR_0||n.colors)&&e||(n.colors={constant:!0,value:new Float32Array([1,1,1])}),jn.assert(n.positions||n.POSITION,'no "postions" or "POSITION" attribute in mesh')}function ebe(n,e){if(n.attributes)return $6(n.attributes,e),n instanceof _h?n:new _h(n);if(n.positions||n.POSITION)return $6(n,e),new _h({attributes:n});throw Error("Invalid mesh")}const tbe={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 nbe=(()=>{class n extends Eb{getShaders(){const t=!In(this.context.gl),i={};return _I(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:[oM,Zve,aM],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:U6}),this.setState({emptyTexture:new na(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||H6(i,s),flatShading:!this.state.hasNormals}).draw()}getModel(t){const i=new Mm(this.context.gl,Lt(K({},this.getShaders()),{id:this.props.id,geometry:ebe(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=tbe,n})();const G6={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:[uR]};class Fm{constructor(e={}){const{id:t}=e;this.id=t||ea(this.constructor.name),this.display=!0,this.position=new to,this.rotation=new to,this.scale=new to(1,1,1),this.matrix=new $t,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 nt(3===e.length,"setPosition requires vector argument"),this.position=e,this}setRotation(e){return nt(3===e.length,"setRotation requires vector argument"),this.rotation=e,this}setScale(e){return nt(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){nt(e),t=t||this.matrix;const i=new $t(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 Ob extends Fm{constructor(e={}){e=Array.isArray(e)?{children:e}:e;const{children:t=[]}=e;vt.assert(t.every(i=>i instanceof Fm),"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 $t}={}){const i=new $t(t).multiplyRight(this.matrix);for(const r of this.children)r instanceof Ob?r.traverse(e,{worldMatrix:i}):e(r,{worldMatrix:i})}}function W6(){var n=new ia(4);return ia!=Float32Array&&(n[0]=0,n[1]=0,n[2]=0),n[3]=1,n}function q6(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 Y6(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 K6=w5,_be=function(){var n=m4(),e=_4(1,0,0),t=_4(0,1,0);return function(i,r,s){var o=y4(r,s);return o<-.999999?(wS(n,e,r),function(n){return Math.hypot(n[0],n[1],n[2])}(n)<1e-6&&wS(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),q6(i,n,Math.PI),i):o>.999999?(i[0]=0,i[1]=0,i[2]=0,i[3]=1,i):(wS(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))}}();W6(),W6(),function(){var n=new ia(9);ia!=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 ybe=[0,0,0,1],bbe={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Cbe={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function J6(n){if(!n._animation){const e=Cbe[n.componentType],t=bbe[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 q6(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]=ks(e)}get y(){return this[1]}set y(e){this[1]=ks(e)}get z(){return this[2]}set z(e){this[2]=ks(e)}get w(){return this[3]}set w(e){this[3]=ks(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 _be(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 Qu(!t),Y6(this,this,e),this.check()}multiplyLeft(e,t){return Qu(!t),Y6(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 K6(this,this,e),this.check()}slerp(e,t,i){switch(arguments.length){case 1:({start:e=ybe,target:t,ratio:i}=arguments[0]);break;case 2:[t,i]=arguments,e=this}return function(n,e,t,i){var p,g,_,y,v,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>Kc?(p=Math.acos(g),_=Math.sin(p),y=Math.sin((1-i)*p)/_,v=Math.sin(i*p)/_):(y=1-i,v=i),n[0]=y*r+v*l,n[1]=y*s+v*c,n[2]=y*o+v*d,n[3]=y*a+v*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),CS(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 Abe{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:vt.warn(`Bad animation path ${s}`)()}nt(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){hR.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:J6(e.accessors[a]),interpolation:l,output:J6(e.accessors[c])})),o=t.channels.map(({sampler:a,target:l})=>({sampler:s[a],target:e.nodes[l.node],path:l.path}));return new Abe({name:r,channels:o})})}animate(e){this.setTime(e)}setTime(e){this.animations.forEach(t=>t.animate(e))}getAnimations(){return this.animations}}class Obe extends Fm{constructor(e,t={}){super(t),this.onBeforeRender=null,this.AfterRender=null,e instanceof Mm?(this.model=e,this._setModelNodeProps(t)):this.model=new Mm(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 Ibe{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},_I(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 na(this.gl,K({id:e.name||e.id,parameters:K(K({},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&&(vt.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 e8(n,e){return In(n)?`#version 300 es\n${e}`:e}const Fbe={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Nbe={modelOptions:{},pbrDebug:!1,imageBasedLightingEnvironment:null,lights:!0,useTangents:!1};class Lbe{constructor(e,t={}){this.gl=e,this.options=Object.assign({},Nbe,t)}instantiate(e){return this.gltf=e,(e.scenes||[]).map(i=>this.createScene(i))}createAnimator(){return Array.isArray(this.gltf.animations)?new Dbe(this.gltf):null}createScene(e){const i=(e.nodes||[]).map(s=>this.createNode(s));return new Ob({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 Ob({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 $t).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 Ob({id:e.name||e.id,children:i});e._mesh=r}return e._mesh}getVertexCount(e){vt.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 Ibe(n,e);vt.info(4,"createGLTFModel defines: ",a.defines)();const l=[];l.push(...a.generatedTextures),l.push(...Object.values(s).map(d=>d.buffer));const c=new Obe(n,Object.assign({id:t,drawMode:i,vertexCount:r,modules:[G6],defines:a.defines,parameters:a.parameters,vs:e8(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:e8(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))),vt.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 Ai(this.gl,{id:`from-${i.id}`,data:i.data||e.value,target:t})),i.lumaBuffers[t]}createAccessor(e,t){return new ta({buffer:t,offset:e.byteOffset||0,stride:e.bufferView.byteStride||0,type:e.componentType,size:Fbe[e.type]})}createSampler(e){return e}needsPOT(){return!1}}function t8(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 Nm(i,this.metadata)}selectAt(...e){const t=e.map(i=>this.fields[i]).filter(Boolean);return new Nm(t,this.metadata)}assign(e){let t,i=this.metadata;if(e instanceof Nm){const o=e;t=o.fields,i=s8(s8(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 Nm(s,i)}}function s8(n,e){return new Map([...n||new Map,...e||new Map])}let cr,o8,a8,l8,c8,u8,d8,h8;!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"}(cr||(cr={}));class fR{static isNull(e){return e&&e.typeId===cr.Null}static isInt(e){return e&&e.typeId===cr.Int}static isFloat(e){return e&&e.typeId===cr.Float}static isBinary(e){return e&&e.typeId===cr.Binary}static isUtf8(e){return e&&e.typeId===cr.Utf8}static isBool(e){return e&&e.typeId===cr.Bool}static isDecimal(e){return e&&e.typeId===cr.Decimal}static isDate(e){return e&&e.typeId===cr.Date}static isTime(e){return e&&e.typeId===cr.Time}static isTimestamp(e){return e&&e.typeId===cr.Timestamp}static isInterval(e){return e&&e.typeId===cr.Interval}static isList(e){return e&&e.typeId===cr.List}static isStruct(e){return e&&e.typeId===cr.Struct}static isUnion(e){return e&&e.typeId===cr.Union}static isFixedSizeBinary(e){return e&&e.typeId===cr.FixedSizeBinary}static isFixedSizeList(e){return e&&e.typeId===cr.FixedSizeList}static isMap(e){return e&&e.typeId===cr.Map}static isDictionary(e){return e&&e.typeId===cr.Dictionary}get typeId(){return cr.NONE}compareTo(e){return this===e}}Symbol,Symbol,o8=Symbol.toStringTag;class Lm extends fR{constructor(e,t){super(),sn(this,"isSigned",void 0),sn(this,"bitWidth",void 0),this.isSigned=e,this.bitWidth=t}get typeId(){return cr.Int}get[o8](){return"Int"}toString(){return`${this.isSigned?"I":"Ui"}nt${this.bitWidth}`}}class qbe extends Lm{constructor(){super(!0,8)}}class Ybe extends Lm{constructor(){super(!0,16)}}class Xbe extends Lm{constructor(){super(!0,32)}}class Kbe extends Lm{constructor(){super(!1,8)}}class Zbe extends Lm{constructor(){super(!1,16)}}class Qbe extends Lm{constructor(){super(!1,32)}}a8=Symbol.toStringTag;class f8 extends fR{constructor(e){super(),sn(this,"precision",void 0),this.precision=e}get typeId(){return cr.Float}get[a8](){return"Float"}toString(){return`Float${this.precision}`}}class Jbe extends f8{constructor(){super(32)}}class e0e extends f8{constructor(){super(64)}}Symbol,Symbol,l8=Symbol.toStringTag,c8=Symbol.toStringTag,u8=Symbol.toStringTag,d8=Symbol.toStringTag,h8=Symbol.toStringTag;class t0e extends fR{constructor(e,t){super(),sn(this,"listSize",void 0),sn(this,"children",void 0),this.listSize=e,this.children=[t]}get typeId(){return cr.FixedSizeList}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get[h8](){return"FixedSizeList"}toString(){return`FixedSizeList[${this.listSize}]<${this.valueType}>`}}class uM{constructor(e,t,i=!1,r=new Map){sn(this,"name",void 0),sn(this,"type",void 0),sn(this,"nullable",void 0),sn(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 uM(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 p8(n,e,t){const i=t?g8(t.metadata):void 0,r=function(n){switch(n.constructor){case Int8Array:return new qbe;case Uint8Array:return new Kbe;case Int16Array:return new Ybe;case Uint16Array:return new Zbe;case Int32Array:return new Xbe;case Uint32Array:return new Qbe;case Float32Array:return new Jbe;case Float64Array:return new e0e;default:throw new Error("array type not supported")}}(e.value);return new uM(n,new t0e(e.size,new uM("value",r)),!1,i)}function g8(n){const e=new Map;for(const t in n)e.set(`${t}.string`,JSON.stringify(n[t]));return e}const m8={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},s0e={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array};class a0e{constructor(e){sn(this,"draco",void 0),sn(this,"decoder",void 0),sn(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=g8(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=p8(o,n[o],s[o]);r.push(l)}if(t){const o=p8("indices",t);r.push(o)}return new Nm(r,i)}(l.attributes,a,l.indices);return Lt(K({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 dM=ze(125);const _R={};function yR(n){return vR.apply(this,arguments)}function vR(){return(vR=yn(function*(n,e=null,t={}){return e&&(n=h0e(n,e,t)),_R[n]=_R[n]||f0e(n),yield _R[n]})).apply(this,arguments)}function h0e(n,e,t){if(n.startsWith("http"))return n;const i=t.modules||{};return i[n]?i[n]:_P?t.CDN?(Qc(t.CDN.startsWith("http")),`${t.CDN}/${e}@3.0.12/dist/libs/${n}`):yP?`../src/libs/${n}`:`modules/${e}/src/libs/${n}`:`modules/${e}/dist/libs/${n}`}function f0e(n){return bR.apply(this,arguments)}function bR(){return(bR=yn(function*(n){return n.endsWith("wasm")?yield(yield fetch(n)).arrayBuffer():_P?yP?importScripts(n):p0e(yield(yield fetch(n)).text(),n):dM.requireFromFile&&(yield dM.requireFromFile(n))})).apply(this,arguments)}function p0e(n,e){if(!_P)return dM.requireFromString&&dM.requireFromString(n,e);if(yP)return eval.call(yge,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 g0e="https://www.gstatic.com/draco/versioned/decoders/1.4.1/draco_decoder.js",m0e="https://www.gstatic.com/draco/versioned/decoders/1.4.1/draco_wasm_wrapper.js",_0e="https://www.gstatic.com/draco/versioned/decoders/1.4.1/draco_decoder.wasm";let Ib;function v0e(n){return CR.apply(this,arguments)}function CR(){return(CR=yn(function*(n){const e=n.modules||{};return Ib=e.draco3d?Ib||e.draco3d.createDecoderModule({}).then(t=>({draco:t})):Ib||b0e(n),yield Ib})).apply(this,arguments)}function b0e(n){return ER.apply(this,arguments)}function ER(){return(ER=yn(function*(n){let e,t;switch(n.draco&&n.draco.decoderType){case"js":e=yield yR(g0e,"draco",n);break;case"wasm":default:[e,t]=yield Promise.all([yield yR(m0e,"draco",n),yield yR(_0e,"draco",n)])}return e=e||globalThis.DracoDecoderModule,yield C0e(e,t)})).apply(this,arguments)}function C0e(n,e){const t={};return e&&(t.wasmBinary=e),new Promise(i=>{n(Lt(K({},t),{onModuleLoaded:r=>i({draco:r})}))})}const MR=Lt(K({},r8),{parse:function(n,e){return xR.apply(this,arguments)}});function xR(){return(xR=yn(function*(n,e){const{draco:t}=yield v0e(e),i=new a0e(t);try{return i.parseSync(n,null==e?void 0:e.draco)}finally{i.destroy()}})).apply(this,arguments)}function Rb(n,e){return sp(n>=0),sp(e>0),n+(e-1)&~(e-1)}function S0e(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+Rb(i.byteLength,4)}const _8=["SCALAR","VEC2","VEC3","VEC4"],M0e=[[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Uint32Array,5125],[Float32Array,5126],[Float64Array,5130]],x0e=new Map(M0e),T0e={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},A0e={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},D0e={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function y8(n){return _8[n-1]||_8[0]}function v8(n){const e=x0e.get(n.constructor);if(!e)throw new Error("Illegal typed array");return e}function b8(n,e){const t=D0e[n.componentType],i=T0e[n.type],s=n.count*i,o=n.count*i*A0e[n.componentType];return Pa(o>=0&&o<=e.byteLength),{ArrayType:t,length:s,byteLength:o}}const O0e={asset:{version:"2.0",generator:"loaders.gl"},buffers:[]};class vh{constructor(e){sn(this,"gltf",void 0),sn(this,"sourceBuffers",void 0),sn(this,"byteLength",void 0),this.gltf=e||{json:K({},O0e),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 Pa(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}=b8(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 Pa(t),this.json.extensions=this.json.extensions||{},this.json.extensions[e]=t,this.registerUsedExtension(e),t}addRequiredExtension(e,t={}){return Pa(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=eR(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;Pa(Number.isFinite(t)),this.sourceBuffers=this.sourceBuffers||[],this.sourceBuffers.push(e);const i={buffer:0,byteOffset:this.byteLength,byteLength:t};return this.byteLength+=Rb(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:y8(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:v8(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=S0e(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*j0e(n){for(const e of n.json.meshes||[])for(const t of e.primitives)yield t}function U0e(n){return DR.apply(this,arguments)}function DR(){return(DR=yn(function*(n){const e=new vh(n),{json:t}=e;e.removeExtension(fM);for(const i of t.materials||[])i.extensions&&i.extensions.KHR_materials_unlit&&(i.unlit=!0),e.removeObjectExtension(i,fM)})).apply(this,arguments)}function H0e(n){const e=new vh(n),{json:t}=e;if(e.materials)for(const i of t.materials||[])i.unlit&&(delete i.unlit,e.addObjectExtension(i,fM,{}),e.addExtension(fM))}function $0e(n){return OR.apply(this,arguments)}function OR(){return(OR=yn(function*(n){const e=new vh(n),{json:t}=e,i=e.getExtension(Bm);i&&(e.json.lights=i.lights,e.removeExtension(Bm));for(const r of t.nodes||[]){const s=e.getObjectExtension(r,Bm);s&&(r.light=s.light),e.removeObjectExtension(r,Bm)}})).apply(this,arguments)}function G0e(n){return IR.apply(this,arguments)}function IR(){return(IR=yn(function*(n){const e=new vh(n),{json:t}=e;if(t.lights){const i=e.addExtension(Bm);Pa(!i.lights),i.lights=t.lights,delete t.lights}if(e.json.lights){for(const i of e.json.lights)e.addObjectExtension(i.node,Bm,i);delete e.json.lights}})).apply(this,arguments)}function W0e(n){return PR.apply(this,arguments)}function PR(){return(PR=yn(function*(n){const e=new vh(n),{json:t}=e,i=e.getExtension(pM);if(i){const r=Y0e(i,e);for(const s of t.materials||[]){const o=e.getObjectExtension(s,pM);o&&(s.technique=Object.assign({},o,r[o.technique]),s.technique.values=X0e(s.technique,e)),e.removeObjectExtension(s,pM)}e.removeExtension(pM)}})).apply(this,arguments)}function q0e(n,e){return RR.apply(this,arguments)}function RR(){return(RR=yn(function*(n,e){})).apply(this,arguments)}function Y0e(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 X0e(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 E8={KHR_draco_mesh_compression:wt,KHR_materials_unlit:L,KHR_lights_punctual:It,KHR_techniques_webgl:Pt};function K0e(n){return kR.apply(this,arguments)}function kR(){return(kR=yn(function*(n,e={},t){for(const r in E8){var i;const s=(null==e||null===(i=e.gltf)||void 0===i?void 0:i.excludeExtensions)||{};r in s&&!s[r]||(yield E8[r].decode(n,e,t))}})).apply(this,arguments)}const S8={accessors:"accessor",animations:"animation",buffers:"buffer",bufferViews:"bufferView",images:"image",materials:"material",meshes:"mesh",nodes:"node",samplers:"sampler",scenes:"scene",skins:"skin",textures:"texture"},Q0e={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 J0e{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 vh(n),{json:t}=e;for(const i of t.images||[]){const r=e.removeObjectExtension(i,C8);r&&Object.assign(i,r)}t.buffers&&t.buffers[0]&&delete t.buffers[0].uri,e.removeExtension(C8)}(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 S8)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 S8)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=Q0e[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 eCe(n,e={}){return(new J0e).normalize(n,e)}const tCe={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},nCe={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},bl={TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,REPEAT:10497,LINEAR:9729,NEAREST_MIPMAP_LINEAR:9986},iCe={magFilter:bl.TEXTURE_MAG_FILTER,minFilter:bl.TEXTURE_MIN_FILTER,wrapS:bl.TEXTURE_WRAP_S,wrapT:bl.TEXTURE_WRAP_T},rCe={[bl.TEXTURE_MAG_FILTER]:bl.LINEAR,[bl.TEXTURE_MIN_FILTER]:bl.NEAREST_MIPMAP_LINEAR,[bl.TEXTURE_WRAP_S]:bl.REPEAT,[bl.TEXTURE_WRAP_]:bl.REPEAT};class aCe{postProcess(e,t={}){const{json:i,buffers:r=[],images:s=[],baseUri:o=""}=e;return Pa(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=K({},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=K({},e.normalTexture),e.normalTexture.texture=this.getTexture(e.normalTexture.index)),e.occlusionTexture&&(e.occlustionTexture=K({},e.occlustionTexture),e.occlusionTexture.texture=this.getTexture(e.occlusionTexture.index)),e.emissiveTexture&&(e.emmisiveTexture=K({},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=K({},e.pbrMetallicRoughness);const i=e.pbrMetallicRoughness;i.baseColorTexture&&(i.baseColorTexture=K({},i.baseColorTexture),i.baseColorTexture.texture=this.getTexture(i.baseColorTexture.index)),i.metallicRoughnessTexture&&(i.metallicRoughnessTexture=K({},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 nCe[n]}(e.componentType),e.components=function(n){return tCe[n]}(e.type),e.bytesPerElement=e.bytesPerComponent*e.components,e.bufferView){const i=e.bufferView.buffer,{ArrayType:r,byteLength:s}=b8(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):rCe,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 iCe[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 lCe(n,e){return(new aCe).postProcess(n,e)}const M8=1735152710,Vm=!0;function NR(n,e,t,i){const r=new Uint8Array(e.buffer,t,i),o=new TextDecoder("utf8").decode(r);return n.json=JSON.parse(o),Rb(i,4)}function LR(n,e,t,i){return n.header.hasBinChunk=!0,n.binChunks.push({byteOffset:t,byteLength:i,arrayBuffer:e.buffer}),Rb(i,4)}function bCe(n,e){return BR.apply(this,arguments)}function BR(){return(BR=yn(function*(n,e,t=0,i,r){var s,o,a,l;CCe(n,e,t,i),eCe(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 wCe(n,i,r)),null!=i&&null!==(a=i.gltf)&&void 0!==a&&a.loadImages){const f=ECe(n,i,r);c.push(f)}const d=K0e(n,i,r);return c.push(d),yield Promise.all(c),null!=i&&null!==(l=i.gltf)&&void 0!==l&&l.postProcess?lCe(n,i):n})).apply(this,arguments)}function CCe(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=M8}=t,s=i.getUint32(e,!1);return s===r||s===M8}(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)?t8(n.buffer,n.byteOffset,e):n instanceof ArrayBuffer?t8(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,Vm),a=r.getUint32(t+8,Vm);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){sp(n.header.byteLength>20);const i=e.getUint32(t+0,Vm),r=e.getUint32(t+4,Vm);return t+=8,sp(0===r),NR(n,e,t,i),(t+=i)+LR(n,e,t,n.header.byteLength)}(n,r,t);case 2:return function(n,e,t,i){return sp(n.header.byteLength>20),function(n,e,t,i){for(;t+8<=n.header.byteLength;){const r=e.getUint32(t+0,Vm),s=e.getUint32(t+4,Vm);switch(t+=8,s){case 1313821514:NR(n,e,t,r);break;case 5130562:LR(n,e,t,r);break;case 0:i.strict||NR(n,e,t,r);break;case 1:i.strict||LR(n,e,t,r)}t+=Rb(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),Pa("glTF"===o.type,`Invalid GLB magic string ${o.type}`),n._glb=o,n.json=o.json}else Pa(!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 wCe(n,e,t){return VR.apply(this,arguments)}function VR(){return(VR=yn(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 TCe(()=>e.some(t=>!t.loaded))})).apply(this,arguments)}function TCe(n){return $R.apply(this,arguments)}function $R(){return($R=yn(function*(n){for(;n();)yield new Promise(e=>requestAnimationFrame(e))})).apply(this,arguments)}const x8=[255,255,255,255],OCe={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:x8},_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:[zm]};let ICe=(()=>{class n extends Eb{getShaders(){const t=[oM,aM];return"pbr"===this.props._lighting&&t.push(G6),{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:x8,transition:!0},instanceModelMatrix:U6})}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 Fm)r={scenes:[t.scenegraph]};else if(t.scenegraph&&!t.scenegraph.gltf){const l=t.scenegraph,c=function(n,e,t){const i=new Lbe(n,t);return{scenes:i.instantiate(e),animator:i.createAnimator()}}(i,l,this._getModelOptions());r=K({gltf:l},c),function(n){return HR.apply(this,arguments)}(c).then(()=>this.setNeedsRedraw())}else t.scenegraph&&(jn.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 Fm?(this._deleteScenegraph(),this._applyAllAttributes(o),this._applyAnimationsProp(o,a,t._animations),this.setState({scenegraph:o,animator:a})):null!==o&&jn.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):jn.warn("animation ".concat(o," not found"))()}})}_deleteScenegraph(){const{scenegraph:t}=this.state;t instanceof Fm&&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:K({isInstanced:!0,transpileToGLSL100:!In(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:H6(s,d),sceneModelMatrix:g,u_Camera:p.model.getUniforms().project_uCameraPosition}})})}}return n.layerName="ScenegraphLayer",n.defaultProps=OCe,n})();class PCe extends _h{constructor(e={}){const{id:t=ea("sphere-geometry")}=e,{indices:i,attributes:r}=function(n){const{nlat:e=10,nlong:t=10}=n;let{radius:i=1}=n;const o=Math.PI-0,c=2*Math.PI-0,d=(e+1)*(t+1);if("number"==typeof i){const C=i;i=(w,x,N,V,U)=>C}const f=new Float32Array(3*d),p=new Float32Array(3*d),g=new Float32Array(2*d),y=new(d>65535?Uint32Array:Uint16Array)(e*t*6);for(let C=0;C<=e;C++)for(let w=0;w<=t;w++){const x=w/t,N=C/e,V=w+C*(t+1),U=2*V,ee=3*V,de=c*x,ae=o*N,me=Math.sin(de),Ee=Math.cos(de),Be=Math.sin(ae),ne=Ee*Be,Ie=Math.cos(ae),Q=me*Be,je=i(ne,Ie,Q,x,N);f[ee+0]=je*ne,f[ee+1]=je*Ie,f[ee+2]=je*Q,p[ee+0]=ne,p[ee+1]=Ie,p[ee+2]=Q,g[U+0]=x,g[U+1]=1-N}const v=t+1;for(let C=0;Cs?(te=i,Be=1,ne=t):ne=e+Ee/s*(t-e),(-2===Ee||Ee===s+2)&&(ne=0,Be=0),te-=i/2;for(let Ie=0;Ies?0:Q*y,ee[ae+V[1]]=Ee<0?-1:Ee>s?1:v,ee[ae+V[2]]=Ee<0||Ee>s?0:je*y,de[me+0]=Ie/r,de[me+1]=Be,me+=2,ae+=3}}for(let Ee=0;Ee0){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 S){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 S){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 S){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 S){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 S){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=GCe,s=1/i;r.set(this.x*s,this.y*s,this.z*s);const o=WCe;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(A8),A8.almostEquals(e,t)}clone(){return new S(this.x,this.y,this.z)}}S.ZERO=void 0,S.UNIT_X=void 0,S.UNIT_Y=void 0,S.UNIT_Z=void 0,S.ZERO=new S(0,0,0),S.UNIT_X=new S(1,0,0),S.UNIT_Y=new S(0,1,0),S.UNIT_Z=new S(0,0,1);const GCe=new S,WCe=new S,A8=new S;class Di{constructor(e={}){this.lowerBound=void 0,this.upperBound=void 0,this.lowerBound=new S,this.upperBound=new S,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=O8;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=O8;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 D8=new S,O8=[new S,new S,new S,new S,new S,new S,new S,new S];class kr{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 S){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=YCe;e.tangents(i,XCe),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(Ui(e.length(),2)*Ui(t.length(),2))+e.dot(t),this.normalize()}return this}mult(e,t=new kr){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 kr){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 kr){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 S){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 kr(this.x,this.y,this.z,this.w)}slerp(e,t,i=new kr){const r=this.x,s=this.y,o=this.z,a=this.w;let p,g,_,y,v,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),y=Math.sin((1-t)*p)/_,v=Math.sin(t*p)/_):(y=1-t,v=t),i.x=y*r+v*l,i.y=y*s+v*c,i.z=y*o+v*d,i.w=y*a+v*f,i}integrate(e,t,i,r=new kr){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 YCe=new S,XCe=new S,KCe={SPHERE:1,PLANE:2,BOX:4,COMPOUND:8,CONVEXPOLYHEDRON:16,HEIGHTFIELD:32,PARTICLE:64,CYLINDER:128,TRIMESH:256};let bt=(()=>{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=KCe,n})();class ni{constructor(e={}){this.position=void 0,this.quaternion=void 0,this.position=new S,this.quaternion=new kr,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 S){return this.quaternion.vmult(e,t),t}static pointToLocalFrame(e,t,i,r=new S){return i.vsub(e,r),t.conjugate(P8),P8.vmult(r,r),r}static pointToWorldFrame(e,t,i,r=new S){return t.vmult(i,r),r.vadd(e,r),r}static vectorToWorldFrame(e,t,i=new S){return e.vmult(t,i),i}static vectorToLocalFrame(e,t,i,r=new S){return t.w*=-1,t.vmult(i,r),t.w*=-1,r}}const P8=new kr;class lp extends bt{constructor(e={}){const{vertices:t=[],faces:i=[],normals:r=[],axes:s,boundingSphereRadius:o}=e;super({type:bt.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 S;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=y,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 S,d=new S,f=new S,p=new S,g=new S,_=new S;let y=Number.MAX_VALUE;const v=this;if(v.uniqueAxes)for(let C=0;C!==v.uniqueAxes.length;C++){i.vmult(v.uniqueAxes[C],c);const w=v.testSepAxis(c,e,t,i,r,s);if(!1===w)return!1;w0&&o.negate(o),!0}testSepAxis(e,t,i,r,s,o){lp.project(this,e,i,r,GR),lp.project(t,e,s,o,WR);const l=GR[0],c=GR[1],d=WR[0],f=WR[1];if(l0?1/t:0,this.material=e.material||null,this.linearDamping="number"==typeof e.linearDamping?e.linearDamping:.01,this.type=t<=0?Ct.STATIC:Ct.DYNAMIC,typeof e.type==typeof Ct.STATIC&&(this.type=e.type),this.allowSleep=void 0===e.allowSleep||e.allowSleep,this.sleepState=Ct.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 S,this.quaternion=new kr,this.initQuaternion=new kr,this.previousQuaternion=new kr,this.interpolatedQuaternion=new kr,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 S,e.angularVelocity&&this.angularVelocity.copy(e.angularVelocity),this.initAngularVelocity=new S,this.shapes=[],this.shapeOffsets=[],this.shapeOrientations=[],this.inertia=new S,this.invInertia=new S,this.invInertiaWorld=new ru,this.invMassSolve=0,this.invInertiaSolve=new S,this.invInertiaWorldSolve=new ru,this.fixedRotation=void 0!==e.fixedRotation&&e.fixedRotation,this.angularDamping=void 0!==e.angularDamping?e.angularDamping:.01,this.linearFactor=new S(1,1,1),e.linearFactor&&this.linearFactor.copy(e.linearFactor),this.angularFactor=new S(1,1,1),e.angularFactor&&this.angularFactor.copy(e.angularFactor),this.aabb=new Di,this.aabbNeedsUpdate=!0,this.boundingRadius=0,this.wlambda=new S,this.isTrigger=Boolean(e.isTrigger),e.shape&&this.addShape(e.shape),this.updateMassProperties()}wakeUp(){const e=this.sleepState;this.sleepState=Ct.AWAKE,this.wakeUpAfterNarrowphase=!1,e===Ct.SLEEPING&&this.dispatchEvent(Ct.wakeupEvent)}sleep(){this.sleepState=Ct.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=Ui(this.sleepSpeedLimit,2);t===Ct.AWAKE&&ir?this.wakeUp():t===Ct.SLEEPY&&e-this.timeLastSleepy>this.sleepTimeLimit&&(this.sleep(),this.dispatchEvent(Ct.sleepEvent))}}updateSolveMassProperties(){this.sleepState===Ct.SLEEPING||this.type===Ct.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 S){return e.vsub(this.position,t),this.quaternion.conjugate().vmult(t,t),t}vectorToLocalFrame(e,t=new S){return this.quaternion.conjugate().vmult(e,t),t}pointToWorldFrame(e,t=new S){return this.quaternion.vmult(e,t),t.vadd(this.position,t),t}vectorToWorldFrame(e,t=new S){return this.quaternion.vmult(e,t),t}addShape(e,t,i){const r=new S,s=new kr;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=JCe,o=ewe,a=this.quaternion,l=this.aabb,c=twe;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=nwe,r=iwe;i.setRotationFromQuaternion(this.quaternion),i.transpose(r),i.scale(t,i),i.mmult(r,this.invInertiaWorld)}}applyForce(e,t=new S){if(this.type!==Ct.DYNAMIC)return;this.sleepState===Ct.SLEEPING&&this.wakeUp();const i=rwe;t.cross(e,i),this.force.vadd(e,this.force),this.torque.vadd(i,this.torque)}applyLocalForce(e,t=new S){if(this.type!==Ct.DYNAMIC)return;const i=swe,r=owe;this.vectorToWorldFrame(e,i),this.vectorToWorldFrame(t,r),this.applyForce(i,r)}applyTorque(e){this.type===Ct.DYNAMIC&&(this.sleepState===Ct.SLEEPING&&this.wakeUp(),this.torque.vadd(e,this.torque))}applyImpulse(e,t=new S){if(this.type!==Ct.DYNAMIC)return;this.sleepState===Ct.SLEEPING&&this.wakeUp();const i=t,r=awe;r.copy(e),r.scale(this.invMass,r),this.velocity.vadd(r,this.velocity);const s=lwe;i.cross(e,s),this.invInertiaWorld.vmult(s,s),this.angularVelocity.vadd(s,this.angularVelocity)}applyLocalImpulse(e,t=new S){if(this.type!==Ct.DYNAMIC)return;const i=cwe,r=uwe;this.vectorToWorldFrame(e,i),this.vectorToWorldFrame(t,r),this.applyImpulse(i,r)}updateMassProperties(){const e=dwe;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),mM.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 S;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!==Ct.DYNAMIC&&this.type!==Ct.KINEMATIC||this.sleepState===Ct.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,y=this.angularFactor,v=l.x*y.x,C=l.y*y.y,w=l.z*y.z;s.x+=e*(_[0]*v+_[1]*C+_[2]*w),s.y+=e*(_[3]*v+_[4]*C+_[5]*w),s.z+=e*(_[6]*v+_[7]*C+_[8]*w),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()}}Ct.idCounter=0,Ct.COLLIDE_EVENT_NAME="collide",Ct.DYNAMIC=1,Ct.STATIC=2,Ct.KINEMATIC=4,Ct.AWAKE=0,Ct.SLEEPY=1,Ct.SLEEPING=2,Ct.wakeupEvent={type:"wakeup"},Ct.sleepyEvent={type:"sleepy"},Ct.sleepEvent={type:"sleep"};const JCe=new S,ewe=new kr,twe=new Di,nwe=new ru,iwe=new ru,rwe=new S,swe=new S,owe=new S,awe=new S,lwe=new S,cwe=new S,uwe=new S,dwe=new S;new S,new S;class _M{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 S,this.rayToWorld=new S,this.hitNormalWorld=new S,this.hitPointWorld=new S,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 R8,k8,F8,N8,L8,B8,V8;R8=bt.types.SPHERE,k8=bt.types.PLANE,F8=bt.types.BOX,N8=bt.types.CYLINDER,L8=bt.types.CONVEXPOLYHEDRON,B8=bt.types.HEIGHTFIELD,V8=bt.types.TRIMESH;class Hr{get[R8](){return this._intersectSphere}get[k8](){return this._intersectPlane}get[F8](){return this._intersectBox}get[N8](){return this._intersectConvex}get[L8](){return this._intersectConvex}get[B8](){return this._intersectHeightfield}get[V8](){return this._intersectTrimesh}constructor(e=new S,t=new 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 S,this.precision=1e-4,this.checkCollisionResponse=!0,this.skipBackfaces=!1,this.collisionFilterMask=-1,this.collisionFilterGroup=-1,this.mode=Hr.ANY,this.result=new _M,this.hasHit=!1,this.callback=i=>{}}intersectWorld(e,t){return this.mode=t.mode||Hr.ANY,this.result=t.result||new _M,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(z8),KR.length=0,e.broadphase.aabbQuery(e,z8,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=ywe,s=vwe;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 S(0,0,1);t.vmult(c,c);const d=new S;o.vsub(i,d);const f=d.dot(c);if(a.vsub(i,d),f*d.dot(c)>0||o.distanceTo(a)=0&&y<=1&&(o.lerp(a,y,g),g.vsub(i,_),_.normalize(),this.reportIntersection(_,g,s,r,-1)),this.result.shouldStop)return;v>=0&&v<=1&&(o.lerp(a,v,g),g.vsub(i,_),_.normalize(),this.reportIntersection(_,g,s,r,-1))}}_intersectConvex(e,t,i,r,s,o){const a=Swe,l=U8,c=o&&o.faceList||null,d=e.faces,f=e.vertices,p=e.faceNormals,g=this.direction,_=this.from,v=_.distanceTo(this.to),C=c?c.length:d.length,w=this.result;for(let x=0;!w.shouldStop&&xv||this.reportIntersection(a,ra,s,r,N)}}}}_intersectTrimesh(e,t,i,r,s,o){const a=Mwe,l=Iwe,c=Pwe,d=U8,f=xwe,p=Twe,g=Awe,_=Owe,y=Dwe,v=e.indices,C=this.from,w=this.to,x=this.direction;c.position.copy(i),c.quaternion.copy(t),ni.vectorToLocalFrame(i,t,x,f),ni.pointToLocalFrame(i,t,C,p),ni.pointToLocalFrame(i,t,w,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 N=p.distanceSquared(g);e.tree.rayQuery(this,c,l);for(let V=0,U=l.length;!this.result.shouldStop&&V!==U;V++){const ee=l[V];e.getNormal(ee,a),e.getVertex(v[3*ee],cc),cc.vsub(p,d);const de=f.dot(a),ae=a.dot(d)/de;if(ae<0)continue;f.scale(ae,ra),ra.vadd(p,ra),e.getVertex(v[3*ee+1],ou),e.getVertex(v[3*ee+2],au);const me=ra.distanceSquared(p);!Hr.pointInTriangle(ra,ou,cc,au)&&!Hr.pointInTriangle(ra,cc,ou,au)||me>N||(ni.vectorToWorldFrame(t,a,y),ni.pointToWorldFrame(i,t,ra,_),this.reportIntersection(y,_,s,r,ee))}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 Hr.ALL:this.hasHit=!0,c.set(o,a,e,t,i,r,l),c.hasHit=!0,this.callback(c);break;case Hr.CLOSEST:(l=0&&(f=s*c-o*a)>=0&&d+fDate.now()-n}var lu=ze(517);function $m(n,e,t){e||(e=new $t($t.IDENTITY));const i=new $t($t.IDENTITY);if(!n)return!0;if(n.matrix)i.copy(n.matrix);else{if(i.identity(),n.translation&&i.translate(n.translation),n.rotation){const s=new $t($t.IDENTITY).fromQuaternion(n.rotation);i.multiplyRight(s)}n.scale&&i.scale(n.scale)}const r=new $t(e).multiplyRight(i);if(!1===t(n,r,e))return!1;for(const s of n.nodes||n.children||[])if(!1===$m(s,r,t))return!1;return!0}function R$(){vH([r8,zm])}function k$(n,e){var t;const i=null===(t=e.nodes)||void 0===t?void 0:t.find(r=>r.name===n);if(i){let r=!1;for(const s of e.scenes)r||$m(s,new $t($t.IDENTITY),(o,a)=>o!==i||(o.matrix=a,o.translation=void 0,o.rotation=void 0,o.scale=void 0,r=!0,!1));return e.scene={id:n,name:n,nodes:[i]},e.scenes=[e.scene],{scene:e.scene,scenes:e.scenes}}return e}function ek(n,e){return yl(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 YS(i,zm,{DracoLoader:MR,gltf:{decompressMeshes:!0,postProcess:!0}});return r.nodes||console.log("WARNING: Empty Scene",t,r),k$(n.scenegraphNode,r)})}function RMe(n,e){return yl(this,void 0,void 0,function*(){return k$(n,yield e)})}function tk(n,e,t){if(e&&0!==e.length){let i;switch(t.geometry){case"sphere":i=new PCe;break;case"cone":i=new NCe;break;case"cylinder":i=new LCe;break;case"cube":default:i=new HCe}return new nbe(Object.assign({id:n,pickable:!0,autoHighlight:!1,highlightColor:[30,136,229,255],coordinateSystem:qn.CARTESIAN,data:e,mesh:i,wireframe:!1,getTransformMatrix:r=>r.transformMatrix,getColor:r=>r.color||[255,255,255,229.5]},t))}}function F$(n,e,t){if(e&&0!==e.length)return new Wve(Object.assign({id:n,pickable:!0,data:e.map(i=>Object.assign(Object.assign({},i),{position:new $t(i.transformMatrix).getTranslation()})),getText:i=>i.text,getPosition:i=>i.position,getColor:i=>i.color},t))}let FMe=(()=>{class n extends MH{initializeState(){const{data:t}=this.props;this.setState({data:null!=t?t:[],zoomOpacity:.8,doCollisions:!1}),R$()}renderLayers(){var t,i;const r=this.state,s={sphere:[],cone:[],cylinder:[],cube:[],text:[],wireframe:[],scenegraph:[]};for(const l of r.data){const c=null!==(t=l.geometry)&&void 0!==t?t:"cube";l.scenegraph?s.scenegraph.push(l):void 0!==s[c]&&s[c].push(l)}const o={};for(const l of s.scenegraph)l.scenegraph&&l.scenegraphNode&&!Object.prototype.hasOwnProperty.call(o,l.scenegraph)&&(o[l.scenegraph]=ek({scenegraph:l.scenegraph},n.gltfCache));const a=[];for(const[l,c]of Object.entries(s))if("scenegraph"===l)for(const d of c)a.push(new ICe({id:"models-"+d["@id"],opacity:d.zoomBasedOpacity?r.zoomOpacity:void 0!==d.opacity?d.opacity:1,pickable:!d.unpickable,coordinateSystem:qn.CARTESIAN,data:[d],scenegraph:d.scenegraphNode?RMe(d.scenegraphNode,o[d.scenegraph]):d.scenegraph,_lighting:d._lighting,getTransformMatrix:d.transformMatrix,getColor:null!==(i=d.color)&&void 0!==i?i:[0,255,0,127.5],parameters:{depthMask:!d.zoomBasedOpacity&&(void 0===d.opacity||1===d.opacity)}}));else"text"===l?(a.push(F$("text",c.filter(d=>d.unpickable),{pickable:!1})),a.push(F$("textPickable",c.filter(d=>!d.unpickable),{pickable:!0}))):"wireframe"===l?a.push(tk(l,c,{wireframe:!0,pickable:!1,geometry:l})):(a.push(tk(l,c.filter(d=>d.unpickable),{wireframe:!1,pickable:!1,geometry:l})),a.push(tk(`${l}Pickable`,c.filter(d=>!d.unpickable),{wireframe:!1,pickable:!0,geometry:l})));return r.doCollisions&&function(n){yl(this,void 0,void 0,function*(){console.log("Starting Collisioning");const e=n.filter(o=>!o.scenegraph&&"wireframe"!==o.geometry).map(o=>{const a=new $t(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 Di({lowerBound:new S(...l.map((d,f)=>Math.min(d,c[f]))),upperBound:new S(...c.map((d,f)=>Math.max(d,l[f])))})}}),t=[];for(const o of n.filter(a=>!!a.scenegraph)){const a=yield wb(o.scenegraph,zm,{DracoLoader:MR,decompress:!0,postProcess:!0});for(const l of a.scenes)$m(l,new $t(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 Di({lowerBound:new S(...p.map((_,y)=>Math.min(_,g[y]))),upperBound:new S(...g.map((_,y)=>Math.max(_,p[y])))}),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})}(r.data),a.filter(l=>!!l)}getPickingInfo(t){return t.info}}return n.layerName="BodyUILayer",n.gltfCache={},n})();function N$(n,e=[]){for(const t of n.nodes||n.children||[])e.push(t.name),N$(t,e);return e}let LMe=(()=>{class n{constructor(t){var i,r,s,o,a;this.deckProps=t,this.bodyUILayer=new FMe({}),this.nodeClickSubject=new Se,this.nodeHoverStartSubject=new Se,this.nodeHoverStopSubject=new Se,this.sceneRotationSubject=new ar([0,0]),this.nodeDragStartSubject=new Se,this.nodeDragSubject=new Se,this.nodeDragEndSubject=new Se,this.nodeClick$=this.nodeClickSubject.pipe(Vs()),this.nodeHoverStart$=this.nodeHoverStartSubject.pipe(Vs()),this.nodeHoverStop$=this.nodeHoverStopSubject.pipe(Vs()),this.sceneRotation$=this.sceneRotationSubject.pipe(Vs()),this.nodeDragStart$=this.nodeDragStartSubject.pipe(Vs()),this.nodeDrag$=this.nodeDragSubject.pipe(Vs()),this.nodeDragEnd$=this.nodeDragEndSubject.pipe(Vs());const l=Object.assign(Object.assign({},t),{views:["orthographic"===t.camera?new Ame({flipY:!1,near:-1e3}):new Ime({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 GP({ambientLight:new OH({color:[255,255,255],intensity:10})})]),this.deck=new sM(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 yl(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 $t([.076,0,0,0,0,.076,16875389974302382e-33,0,0,-16875389974302382e-33,.076,0,.49,.034,.11,1]);(function(n,e,t,i){return yl(this,void 0,void 0,function*(){R$();const r=yield ek({scenegraph:n,scenegraphNode:"VHF_Kidney_L_Low1"},undefined),s={},o=[];for(const a of r.scenes)$m(a,e=new $t(e||$t.IDENTITY),(l,c)=>{const d={"@id":l.name||l.id,"@type":"ProcessedNode",transformMatrix:new $t(c),geometry:"wireframe",node:l};if(o.push({"@id":`GLTF:${d["@id"]}`,"@type":"GLTFNode",scenegraph:n,scenegraphNode:d["@id"],transformMatrix:new $t(e||$t.IDENTITY),tooltip:l.name||l.id,color:[255,255,255,255],_lighting:"pbr",zoomBasedOpacity:!0,node:l}),l.mesh&&l.mesh.primitives&&l.mesh.primitives.length>0)for(const f of l.mesh.primitives)if(f.attributes.POSITION&&f.attributes.POSITION.min){const p=c.transformAsPoint(f.attributes.POSITION.min,[]),g=c.transformAsPoint(f.attributes.POSITION.max,[]);d.bbox=new Di({lowerBound:new S(...p.map((_,y)=>Math.min(_,g[y]))),upperBound:new S(...g.map((_,y)=>Math.max(_,p[y])))})}return s[d["@id"]]=d,!0});for(const a of Object.values(s).filter(l=>!l.bbox)){for(const l of N$(a.node).map(c=>s[c]).filter(c=>c.bbox))a.bbox?a.bbox.extend(l.bbox):a.bbox=l.bbox.clone();a.bbox||delete s[a["@id"]]}for(const a of Object.values(s)){const l=a.bbox.lowerBound,f=(a.size=a.bbox.upperBound.clone().vsub(l)).clone().vmul(new S(.5,.5,.5)),p=a.center=l.clone().vadd(f);a.transformMatrix=new $t($t.IDENTITY).translate(p.toArray()).scale(f.toArray())}for(const a of o)s[a["@id"]]=a;return s})})(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 $t(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 xe([lu.ZP],n.prototype,"_onHover",null),xe([lu.ZP],n.prototype,"_onClick",null),xe([lu.ZP],n.prototype,"_onViewStateChange",null),xe([lu.ZP],n.prototype,"_onDragStart",null),xe([lu.ZP],n.prototype,"_onDrag",null),xe([lu.ZP],n.prototype,"_onDragEnd",null),n})();function BMe(n,e){return n===e}function VMe(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 nk=(()=>{class n{constructor(){this.bootstrap$=new If(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=ue({token:n,factory:n.\u0275fac}),n})();const ik=new ve("INITIAL_STATE_TOKEN");let UMe=(()=>{class n{static set(t){this.value=t}static pop(){const t=this.value;return this.value={},t}}return n.value={},n})();const L$=new ve("Internals.StateContextFactory"),B$=new ve("Internals.StateFactory");function V$(n,e){return e?t=>t.pipe(V$((i,r)=>ui(n(i,r)).pipe(Ae((s,o)=>e(i,s,r,o))))):t=>t.lift(new HMe(n))}class HMe{constructor(e){this.project=e}call(e,t){return t.subscribe(new $Me(e,this.project))}}class $Me extends ii{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 Gr(this),i=this.destination;i.add(t);const r=co(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 TM(n=null){return e=>e.lift(new GMe(n))}class GMe{constructor(e){this.defaultValue=e}call(e,t){return t.subscribe(new WMe(e,this.defaultValue))}}class WMe extends xt{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()}}const Ra={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 z$=(()=>{class n{constructor(t,i){this._ngZone=t,this._platformId=i,this.verifyZoneIsNotNooped(this._ngZone)}enter(t){return kD(this._platformId)?this.runInsideAngular(t):this.runOutsideAngular(t)}leave(t){return this.runInsideAngular(t)}runInsideAngular(t){return dt.isInAngularZone()?t():this._ngZone.run(t)}runOutsideAngular(t){return dt.isInAngularZone()?this._ngZone.runOutsideAngular(t):t()}verifyZoneIsNotNooped(t){t instanceof dt||console.warn(Ra.ZONE_WARNING())}}return n.\u0275fac=function(t){return new(t||n)(I(dt),I(dl))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();const j$=new ve("ROOT_STATE_TOKEN"),U$=new ve("FEATURE_STATE_TOKEN"),rk=new ve("NGXS_PLUGINS"),H$=new ve("NG_TEST_MODE"),G$=new ve("NG_DEV_MODE"),ld="NGXS_META",W$="NGXS_OPTIONS_META",sk="NGXS_SELECTOR_META";let fp=(()=>{class n{constructor(){this.defaultsState={},this.selectorOptions={injectContainerState:!0,suppressErrors:!0},this.compatibility={strictContentSecurityPolicy:!1},this.executionStrategy=z$}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();class qMe{constructor(e,t,i){this.previousValue=e,this.currentValue=t,this.firstChange=i}}const q$=new ve("NGXS_EXECUTION_STRATEGY");function pp(n){return n.constructor&&n.constructor.type?n.constructor.type:n.type}const ok=(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},Gm=(n,e)=>e.split(".").reduce((t,i)=>t&&t[i],n),ak=n=>n&&"object"==typeof n&&!Array.isArray(n),lk=(n,...e)=>{if(!e.length)return n;const t=e.shift();if(ak(n)&&ak(t))for(const i in t)ak(t[i])?(n[i]||Object.assign(n,{[i]:{}}),lk(n[i],t[i])):Object.assign(n,{[i]:t[i]});return lk(n,...e)};function ck(n){if(!n.hasOwnProperty(ld)){const e={name:null,actions:{},defaults:{},path:null,makeRootSelector:t=>t.getStateGetter(e.name),children:[]};Object.defineProperty(n,ld,{value:e})}return jb(n)}function jb(n){return n[ld]}function uk(n){return n.hasOwnProperty(sk)||Object.defineProperty(n,sk,{value:{makeRootSelector:null,originalFn:null,containerClass:null,selectorName:null,getSelectorOptions:()=>({})}}),dk(n)}function dk(n){return n[sk]}function Y$(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(e[pp(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 Fn(t=>{const i=pp(t.action);return n[i]&&(!e||e[t.status])})}(i,r),t())}}(n,["DISPATCHED"])}function sxe(){return Ae(n=>n.action)}function AM(n){return e=>new ce(t=>e.subscribe({next(i){n.leave(()=>t.next(i))},error(i){n.leave(()=>t.error(i))},complete(){n.leave(()=>t.complete())}}))}let DM=(()=>{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)(I(q$))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();class lxe extends Se{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 OM=(()=>{class n extends lxe{}return n.\u0275fac=function(){let e;return function(i){return(e||(e=$n(n)))(i||n)}}(),n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})(),cxe=(()=>{class n extends ce{constructor(t,i){super(r=>{const s=t.pipe(AM(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)(I(OM),I(DM))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();const K$=n=>(...e)=>n.shift()(...e,(...i)=>K$(n)(...i));let IM=(()=>{class n extends ar{constructor(){super({})}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})(),hk=(()=>{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)(I(n,12),I(rk,8))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})(),fk=(()=>{class n extends Se{}return n.\u0275fac=function(){let e;return function(i){return(e||(e=$n(n)))(i||n)}}(),n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})(),Z$=(()=>{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($o),this._errorHandler.handleError(r)}catch(s){}})}),i.pipe(AM(this._ngxsExecutionStrategy))}dispatchByEvents(t){return Array.isArray(t)?0===t.length?ht(this._stateStream.getValue()):Hv(t.map(i=>this.dispatchSingle(i))):this.dispatchSingle(t)}dispatchSingle(t){if(!pp(t))return Kg(new Error(`This action doesn't have a type property: ${t.constructor.name}`));const r=this._stateStream.getValue();return K$([...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(qc())}getActionResultStream(t){return this._actionResults.pipe(Fn(i=>i.action===t&&"DISPATCHED"!==i.status),yi(1),qc())}createDispatchObservable(t){return t.pipe(V$(i=>{switch(i.status){case"SUCCESSFUL":return ht(this._stateStream.getValue());case"ERRORED":return Kg(i.error);default:return ec}})).pipe(qc())}}return n.\u0275fac=function(t){return new(t||n)(I(Nt),I(OM),I(fk),I(hk),I(IM),I(DM))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();const Q$=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])&&Q$(n[i])}),n};let J$=(()=>{class n{constructor(t,i){this.isDevMode=t,this.isTestMode=i}}return n.\u0275fac=function(t){return new(t||n)(I(G$),I(H$))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})(),eG=(()=>{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(Ra.INCORRECT_PRODUCTION()):this.isIncorrectDevelopment&&console.warn(Ra.INCORRECT_DEVELOPMENT()))}}return n.\u0275fac=function(t){return new(t||n)(I(J$),I(fp))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})(),qm=(()=>{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=Q$(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)(I(IM),I(Z$),I(fp),I(eG))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})(),PM=(()=>{class n{constructor(t){this._internalStateOperations=t}createStateContext(t){const i=this._internalStateOperations.getRootStateOperations();function r(l){return Gm(l,t.path)}function s(l,c){const d=ok(l,t.path,c),f=t.instance;if(f.ngxsOnChanges){const p=X$(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(Ra.PATCHING_ARRAY());if("object"!=typeof n)throw new Error(Ra.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)(I(qm))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();class RM{static stateNameErrorMessage(e){return Ra.STATE_NAME(e)}static checkCorrectStateName(e){if(!e)throw new Error(Ra.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(Ra.STATE_UNIQUE(r,e.name,s.name));return r}static getValidStateMeta(e){const t=jb(e);if(!t)throw new Error(Ra.STATE_DECORATOR());return t}}RM.stateNameRegex=new RegExp("^[a-zA-Z0-9_]+$");let Ym=(()=>{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=xM(()=>{const c=this;function d(p){const g=c.statePaths[p];return g?Y$(g.split("."),c._config):null}return this._parentFactory?this._parentFactory.getRuntimeSelectorContext():{getStateGetter(p){let g=d(p);return g||((..._)=>(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(RM.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[ld].name};return n.reduce((t,i)=>{const{name:r,children:s}=i[ld];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[ld].name]=t,e),{})}(i),l=[];for(const c of s){const d=a[c],f=o[c],p=d[ld];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)=>ok(o,a.path,a.defaults),{}),states:r}}connectActionHandlers(){null===this._actionsSubscription&&(this._actionsSubscription=this._actions.pipe(Fn(t=>"DISPATCHED"===t.status),di(({action:t})=>this.invokeActions(this._actions,t).pipe(Ae(()=>({action:t,status:"SUCCESSFUL"})),TM({action:t,status:"CANCELED"}),Ta(i=>ht({action:t,status:"ERRORED",error:i}))))).subscribe(t=>this._actionResults.next(t)))}invokeActions(t,i){const r=pp(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=ui(d)),d instanceof ce?(d=d.pipe(TM({})),l.options.cancelUncompleted&&(d=d.pipe(Tn(t.pipe(nxe(i)))))):d=ht({}).pipe(qc()),s.push(d)}catch(d){s.push(Kg(d))}}}return s.length||s.push(ht({})),Hv(s)}addToStatesMap(t){const i=[],r=this.statesByName;for(const s of t){const o=RM.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!==Gm(this._initialState,i);return this.statesByName[t]&&r}}return n.\u0275fac=function(t){return new(t||n)(I(Nt),I(fp),I(n,12),I(OM),I(fk),I(PM),I(ik,8))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})(),pk=(()=>{class n{constructor(t,i,r){this.internalStateOperations=t,this.stateContextFactory=i,this.bootstrapper=r}ngxsBootstrap(t,i){this.internalStateOperations.getRootStateOperations().dispatch(t).pipe(Fn(()=>!!i),Ti(()=>this.invokeInit(i.states)),di(()=>this.bootstrapper.appBootstrapped$),Fn(r=>!!r)).subscribe(()=>this.invokeBootstrap(i.states))}invokeInit(t){for(const i of t){const r=i.instance;if(r.ngxsOnChanges){const a=X$(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)(I(qm),I(PM),I(nk))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();const kM_getOptions=n=>n&&n.NGXS_SELECTOR_OPTIONS_META||{};function nG(n){const e=dk(n)||jb(n);return e&&e.makeRootSelector||(()=>n)}let cu=(()=>{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(Ae(i),Ta(r=>{const{suppressErrors:s}=this._config.selectorOptions;return r instanceof TypeError&&s?ht(void 0):Kg(r)}),Zo(),AM(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(AM(this._internalExecutionStrategy)).subscribe(t)}snapshot(){return this._internalStateOperations.getRootStateOperations().getState()}reset(t){return this._internalStateOperations.getRootStateOperations().setState(t)}getStoreBoundSelectorFn(t){return nG(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)(I(IM),I(qm),I(fp),I(DM),I(Ym),I(ik,8))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})(),Ub=(()=>{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)(I(cu),I(fp))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n.store=null,n.config=null,n})();class iG{static get type(){return"@@INIT"}}class rG{constructor(e){this.addedStates=e}static get type(){return"@@UPDATE_STATE"}}const FM=new If(1);let _xe=(()=>{class n{constructor(t,i,r,s,o=[],a){!function(){try{const n=window.ng,t=!(n.probe&&n.coreTokens)&&Mo();FM.next(t)}catch(n){FM.next(!1)}finally{FM.complete()}}();const l=t.addAndReturnDefaults(o);i.setStateToTheCurrentWithNew(l),t.connectActionHandlers(),a.ngxsBootstrap(new iG,l)}}return n.\u0275fac=function(t){return new(t||n)(I(Ym),I(qm),I(cu),I(Ub),I(j$,8),I(pk))},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({}),n})(),yxe=(()=>{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 rG(l.defaults),l))}static flattenStates(t=[]){return t.reduce((i,r)=>i.concat(r),[])}}return n.\u0275fac=function(t){return new(t||n)(I(cu),I(qm),I(Ym),I(U$,8),I(pk))},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({}),n})();class Io{static forRoot(e=[],t={}){return{ngModule:_xe,providers:[Ym,PM,cxe,OM,nk,eG,J$,pk,Z$,fk,qm,DM,cu,IM,Ub,hk,...e,...Io.ngxsTokenProviders(e,t)]}}static forFeature(e=[]){return{ngModule:yxe,providers:[Ym,hk,...e,{provide:U$,multi:!0,useValue:e}]}}static ngxsTokenProviders(e,t){return[{provide:H$,useValue:jMe},{provide:G$,useValue:Mo},{provide:q$,useClass:t.executionStrategy||z$},{provide:j$,useValue:e},{provide:Io.ROOT_OPTIONS,useValue:t},{provide:fp,useFactory:Io.ngxsConfigFactory,deps:[Io.ROOT_OPTIONS]},{provide:bv,useFactory:Io.appBootstrapListenerFactory,multi:!0,deps:[nk]},{provide:ik,useFactory:Io.getInitialState},{provide:L$,useExisting:PM},{provide:B$,useExisting:Ym}]}static ngxsConfigFactory(e){return lk(new fp,e)}static appBootstrapListenerFactory(e){return()=>e.bootstrap()}static getInitialState(){return UMe.pop()}}function gk(n,e){return(t,i)=>{if(t.hasOwnProperty("prototype"))throw new Error(Ra.ACTION_DECORATOR());const s=ck(t.constructor);Array.isArray(n)||(n=[n]);for(const o of n){const a=o.type;s.actions[a]||(s.actions[a]=[]),s.actions[a].push({fn:i,options:e||{},type:a})}}}function cd(n){return i=>{!function(n){FM.subscribe(e=>{e&&(n.\u0275prov||console.warn(Ra.UNDECORATED_STATE_IN_IVY(n.name)))})}(i);const r=i,s=ck(r),o=Object.getPrototypeOf(r),a=function(i){return Object.assign({},i[W$]||{},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;RM.checkCorrectStateName(d),s.hasOwnProperty(ld)&&(r.actions=Object.assign({},r.actions,(s[ld]||{}).actions)),r.children=a,r.defaults=l,r.name=d})({meta:s,inheritedStateClass:o,optionsWithInheritance:a}),r[W$]=a}}function NM(n,...e){return function(t,i){const r=i.toString(),s=`__${r}__selector`,o=function(n,e,t=[]){return"string"==typeof(e=e||function(n){const e=n.length-1;return 36===n.charCodeAt(e)?n.slice(0,e):n}(n))?Y$(t.length?[e,...t]:e.split("."),Ub.config):e}(r,n,e);Object.defineProperties(t,{[s]:{writable:!0,enumerable:!1,configurable:!0},[r]:{enumerable:!0,configurable:!0,get(){return this[s]||(this[s]=function(n){if(!Ub.store)throw new Error(Ra.SELECT_FACTORY_NOT_CONNECTED());return Ub.store.select(n)}(o))}}})}}function Xm(n){return(e,t,i)=>{if(!i||null===i.value)throw new Error(Ra.SELECTOR_DECORATOR());const s=i.value,o=function(n,e,t){const i=t&&t.containerClass,s=xM(function(...c){const d=e.apply(i,c);return d instanceof Function?xM.apply(null,[d]):d});Object.setPrototypeOf(s,e);const o=function(n,e){const t=uk(n);t.originalFn=n;let i=()=>({});e&&(t.containerClass=e.containerClass,t.selectorName=e.selectorName,i=e.getSelectorOptions||i);const r=Object.assign({},t);return t.getSelectorOptions=()=>function(n,e){return Object.assign({},kM_getOptions(n.containerClass)||{},kM_getOptions(n.originalFn)||{},n.getSelectorOptions()||{},e)}(r,i()),t}(e,t);return o.makeRootSelector=l=>{const{argumentSelectorFunctions:c,selectorOptions:d}=function(n,e,t=[]){const i=e.getSelectorOptions(),r=n.getSelectorOptions(i);return{selectorOptions:r,argumentSelectorFunctions:function(n=[],e,t){const i=[];return t&&(0===n.length||e.injectContainerState)&&jb(t)&&i.push(t),n&&i.push(...n),i}(t,r,e.containerClass).map(a=>nG(a)(n))}}(l,o,n);return function(p){const g=c.map(_=>_(p));try{return s(...g)}catch(_){if(_ instanceof TypeError&&d.suppressErrors)return;throw _}}},s}(n,s,{containerClass:e,selectorName:t.toString(),getSelectorOptions:()=>({})}),a={configurable:!0,get:()=>o};return a.originalFn=s,a}}Io.\u0275fac=function(e){return new(e||Io)},Io.\u0275mod=Pe({type:Io}),Io.\u0275inj=Me({}),Io.ROOT_OPTIONS=new ve("ROOT_OPTIONS");let sG=(()=>{class n{constructor(t,i){this._renderer=t,this._elementRef=i,this.onChange=r=>{},this.onTouched=()=>{}}setProperty(t,i){this._renderer.setProperty(this._elementRef.nativeElement,t,i)}registerOnTouched(t){this.onTouched=t}registerOnChange(t){this.onChange=t}setDisabledState(t){this.setProperty("disabled",t)}}return n.\u0275fac=function(t){return new(t||n)(E(zc),E(rt))},n.\u0275dir=oe({type:n}),n})(),gp=(()=>{class n extends sG{}return n.\u0275fac=function(){let e;return function(i){return(e||(e=$n(n)))(i||n)}}(),n.\u0275dir=oe({type:n,features:[ct]}),n})();const ro=new ve("NgValueAccessor"),xxe={provide:ro,useExisting:T(()=>Hb),multi:!0},Axe=new ve("CompositionEventMode");let Hb=(()=>{class n extends sG{constructor(t,i,r){super(t,i),this._compositionMode=r,this._composing=!1,null==this._compositionMode&&(this._compositionMode=!function(){const n=Uc()?Uc().getUserAgent():"";return/android (\d+)/.test(n.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 n.\u0275fac=function(t){return new(t||n)(E(zc),E(rt),E(Axe,8))},n.\u0275dir=oe({type:n,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,i){1&t&&ge("input",function(s){return i._handleInput(s.target.value)})("blur",function(){return i.onTouched()})("compositionstart",function(){return i._compositionStart()})("compositionend",function(s){return i._compositionEnd(s.target.value)})},features:[Dt([xxe]),ct]}),n})();function Ch(n){return null==n||0===n.length}function aG(n){return null!=n&&"number"==typeof n.length}const Ss=new ve("NgValidators"),wh=new ve("NgAsyncValidators"),Dxe=/^(?=.{1,254}$)(?=.{1,64}@)[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[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])?)*$/;class lG{static min(e){return function(n){return e=>{if(Ch(e.value)||Ch(n))return null;const t=parseFloat(e.value);return!isNaN(t)&&t{if(Ch(e.value)||Ch(n))return null;const t=parseFloat(e.value);return!isNaN(t)&&t>n?{max:{max:n,actual:e.value}}:null}}(e)}static required(e){return function(n){return Ch(n.value)?{required:!0}:null}(e)}static requiredTrue(e){return function(n){return!0===n.value?null:{required:!0}}(e)}static email(e){return function(n){return Ch(n.value)||Dxe.test(n.value)?null:{email:!0}}(e)}static minLength(e){return function(n){return e=>Ch(e.value)||!aG(e.value)?null:e.value.lengthaG(e.value)&&e.value.length>n?{maxlength:{requiredLength:n,actualLength:e.value.length}}:null}(e)}static pattern(e){return function(n){if(!n)return Eh;let e,t;return"string"==typeof n?(t="","^"!==n.charAt(0)&&(t+="^"),t+=n,"$"!==n.charAt(n.length-1)&&(t+="$"),e=new RegExp(t)):(t=n.toString(),e=n),i=>{if(Ch(i.value))return null;const r=i.value;return e.test(r)?null:{pattern:{requiredPattern:t,actualValue:r}}}}(e)}static nullValidator(e){return null}static compose(e){return wG(e)}static composeAsync(e){return EG(e)}}function Eh(n){return null}function _G(n){return null!=n}function yG(n){const e=Og(n)?ui(n):n;return xw(e),e}function vG(n){let e={};return n.forEach(t=>{e=null!=t?Object.assign(Object.assign({},e),t):e}),0===Object.keys(e).length?null:e}function bG(n,e){return e.map(t=>t(n))}function CG(n){return n.map(e=>function(n){return!n.validate}(e)?e:t=>e.validate(t))}function wG(n){if(!n)return null;const e=n.filter(_G);return 0==e.length?null:function(t){return vG(bG(t,e))}}function mk(n){return null!=n?wG(CG(n)):null}function EG(n){if(!n)return null;const e=n.filter(_G);return 0==e.length?null:function(t){return Hv(bG(t,e).map(yG)).pipe(Ae(vG))}}function _k(n){return null!=n?EG(CG(n)):null}function SG(n,e){return null===n?[e]:Array.isArray(n)?[...n,e]:[n,e]}function MG(n){return n._rawValidators}function xG(n){return n._rawAsyncValidators}function yk(n){return n?Array.isArray(n)?n:[n]:[]}function LM(n,e){return Array.isArray(n)?n.includes(e):n===e}function TG(n,e){const t=yk(e);return yk(n).forEach(r=>{LM(t,r)||t.push(r)}),t}function AG(n,e){return yk(e).filter(t=>!LM(n,t))}let DG=(()=>{class n{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=mk(this._rawValidators)}_setAsyncValidators(t){this._rawAsyncValidators=t||[],this._composedAsyncValidatorFn=_k(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,i){return!!this.control&&this.control.hasError(t,i)}getError(t,i){return this.control?this.control.getError(t,i):null}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275dir=oe({type:n}),n})(),Po=(()=>{class n extends DG{get formDirective(){return null}get path(){return null}}return n.\u0275fac=function(){let e;return function(i){return(e||(e=$n(n)))(i||n)}}(),n.\u0275dir=oe({type:n,features:[ct]}),n})();class uc extends DG{constructor(){super(...arguments),this._parent=null,this.name=null,this.valueAccessor=null}}let vk=(()=>{class n extends class{constructor(e){this._cd=e}is(e){var t,i,r;return"submitted"===e?!!(null===(t=this._cd)||void 0===t?void 0:t.submitted):!!(null===(r=null===(i=this._cd)||void 0===i?void 0:i.control)||void 0===r?void 0:r[e])}}{constructor(t){super(t)}}return n.\u0275fac=function(t){return new(t||n)(E(uc,2))},n.\u0275dir=oe({type:n,selectors:[["","formControlName",""],["","ngModel",""],["","formControl",""]],hostVars:14,hostBindings:function(t,i){2&t&&st("ng-untouched",i.is("untouched"))("ng-touched",i.is("touched"))("ng-pristine",i.is("pristine"))("ng-dirty",i.is("dirty"))("ng-valid",i.is("valid"))("ng-invalid",i.is("invalid"))("ng-pending",i.is("pending"))},features:[ct]}),n})();function $b(n,e){wk(n,e),e.valueAccessor.writeValue(n.value),function(n,e){e.valueAccessor.registerOnChange(t=>{n._pendingValue=t,n._pendingChange=!0,n._pendingDirty=!0,"change"===n.updateOn&&PG(n,e)})}(n,e),function(n,e){const t=(i,r)=>{e.valueAccessor.writeValue(i),r&&e.viewToModelUpdate(i)};n.registerOnChange(t),e._registerOnDestroy(()=>{n._unregisterOnChange(t)})}(n,e),function(n,e){e.valueAccessor.registerOnTouched(()=>{n._pendingTouched=!0,"blur"===n.updateOn&&n._pendingChange&&PG(n,e),"submit"!==n.updateOn&&n.markAsTouched()})}(n,e),function(n,e){if(e.valueAccessor.setDisabledState){const t=i=>{e.valueAccessor.setDisabledState(i)};n.registerOnDisabledChange(t),e._registerOnDestroy(()=>{n._unregisterOnDisabledChange(t)})}}(n,e)}function zM(n,e,t=!0){const i=()=>{};e.valueAccessor&&(e.valueAccessor.registerOnChange(i),e.valueAccessor.registerOnTouched(i)),UM(n,e),n&&(e._invokeOnDestroyCallbacks(),n._registerOnCollectionChange(()=>{}))}function jM(n,e){n.forEach(t=>{t.registerOnValidatorChange&&t.registerOnValidatorChange(e)})}function wk(n,e){const t=MG(n);null!==e.validator?n.setValidators(SG(t,e.validator)):"function"==typeof t&&n.setValidators([t]);const i=xG(n);null!==e.asyncValidator?n.setAsyncValidators(SG(i,e.asyncValidator)):"function"==typeof i&&n.setAsyncValidators([i]);const r=()=>n.updateValueAndValidity();jM(e._rawValidators,r),jM(e._rawAsyncValidators,r)}function UM(n,e){let t=!1;if(null!==n){if(null!==e.validator){const r=MG(n);if(Array.isArray(r)&&r.length>0){const s=r.filter(o=>o!==e.validator);s.length!==r.length&&(t=!0,n.setValidators(s))}}if(null!==e.asyncValidator){const r=xG(n);if(Array.isArray(r)&&r.length>0){const s=r.filter(o=>o!==e.asyncValidator);s.length!==r.length&&(t=!0,n.setAsyncValidators(s))}}}const i=()=>{};return jM(e._rawValidators,i),jM(e._rawAsyncValidators,i),t}function PG(n,e){n._pendingDirty&&n.markAsDirty(),n.setValue(n._pendingValue,{emitModelToViewChange:!1}),e.viewToModelUpdate(n._pendingValue),n._pendingChange=!1}function RG(n,e){wk(n,e)}function Ek(n,e){if(!n.hasOwnProperty("model"))return!1;const t=n.model;return!!t.isFirstChange()||!Object.is(e,t.currentValue)}function kG(n,e){n._syncPendingControls(),e.forEach(t=>{const i=t.control;"submit"===i.updateOn&&i._pendingChange&&(t.viewToModelUpdate(i._pendingValue),i._pendingChange=!1)})}function Sk(n,e){if(!e)return null;let t,i,r;return Array.isArray(e),e.forEach(s=>{s.constructor===Hb?t=s:function(n){return Object.getPrototypeOf(n.constructor)===gp}(s)?i=s:r=s}),r||i||t||null}function HM(n,e){const t=n.indexOf(e);t>-1&&n.splice(t,1)}const Gb="VALID",$M="INVALID",Km="PENDING",Wb="DISABLED";function Mk(n){return(Tk(n)?n.validators:n)||null}function FG(n){return Array.isArray(n)?mk(n):n||null}function xk(n,e){return(Tk(e)?e.asyncValidators:n)||null}function NG(n){return Array.isArray(n)?_k(n):n||null}function Tk(n){return null!=n&&!Array.isArray(n)&&"object"==typeof n}class Ak{constructor(e,t){this._hasOwnPendingAsyncValidator=!1,this._onCollectionChange=()=>{},this._parent=null,this.pristine=!0,this.touched=!1,this._onDisabledChange=[],this._rawValidators=e,this._rawAsyncValidators=t,this._composedValidatorFn=FG(this._rawValidators),this._composedAsyncValidatorFn=NG(this._rawAsyncValidators)}get validator(){return this._composedValidatorFn}set validator(e){this._rawValidators=this._composedValidatorFn=e}get asyncValidator(){return this._composedAsyncValidatorFn}set asyncValidator(e){this._rawAsyncValidators=this._composedAsyncValidatorFn=e}get parent(){return this._parent}get valid(){return this.status===Gb}get invalid(){return this.status===$M}get pending(){return this.status==Km}get disabled(){return this.status===Wb}get enabled(){return this.status!==Wb}get dirty(){return!this.pristine}get untouched(){return!this.touched}get updateOn(){return this._updateOn?this._updateOn:this.parent?this.parent.updateOn:"change"}setValidators(e){this._rawValidators=e,this._composedValidatorFn=FG(e)}setAsyncValidators(e){this._rawAsyncValidators=e,this._composedAsyncValidatorFn=NG(e)}addValidators(e){this.setValidators(TG(e,this._rawValidators))}addAsyncValidators(e){this.setAsyncValidators(TG(e,this._rawAsyncValidators))}removeValidators(e){this.setValidators(AG(e,this._rawValidators))}removeAsyncValidators(e){this.setAsyncValidators(AG(e,this._rawAsyncValidators))}hasValidator(e){return LM(this._rawValidators,e)}hasAsyncValidator(e){return LM(this._rawAsyncValidators,e)}clearValidators(){this.validator=null}clearAsyncValidators(){this.asyncValidator=null}markAsTouched(e={}){this.touched=!0,this._parent&&!e.onlySelf&&this._parent.markAsTouched(e)}markAllAsTouched(){this.markAsTouched({onlySelf:!0}),this._forEachChild(e=>e.markAllAsTouched())}markAsUntouched(e={}){this.touched=!1,this._pendingTouched=!1,this._forEachChild(t=>{t.markAsUntouched({onlySelf:!0})}),this._parent&&!e.onlySelf&&this._parent._updateTouched(e)}markAsDirty(e={}){this.pristine=!1,this._parent&&!e.onlySelf&&this._parent.markAsDirty(e)}markAsPristine(e={}){this.pristine=!0,this._pendingDirty=!1,this._forEachChild(t=>{t.markAsPristine({onlySelf:!0})}),this._parent&&!e.onlySelf&&this._parent._updatePristine(e)}markAsPending(e={}){this.status=Km,!1!==e.emitEvent&&this.statusChanges.emit(this.status),this._parent&&!e.onlySelf&&this._parent.markAsPending(e)}disable(e={}){const t=this._parentMarkedDirty(e.onlySelf);this.status=Wb,this.errors=null,this._forEachChild(i=>{i.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(i=>i(!0))}enable(e={}){const t=this._parentMarkedDirty(e.onlySelf);this.status=Gb,this._forEachChild(i=>{i.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(i=>i(!1))}_updateAncestors(e){this._parent&&!e.onlySelf&&(this._parent.updateValueAndValidity(e),e.skipPristineCheck||this._parent._updatePristine(),this._parent._updateTouched())}setParent(e){this._parent=e}updateValueAndValidity(e={}){this._setInitialStatus(),this._updateValue(),this.enabled&&(this._cancelExistingSubscription(),this.errors=this._runValidator(),this.status=this._calculateStatus(),(this.status===Gb||this.status===Km)&&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)}_updateTreeValidity(e={emitEvent:!0}){this._forEachChild(t=>t._updateTreeValidity(e)),this.updateValueAndValidity({onlySelf:!0,emitEvent:e.emitEvent})}_setInitialStatus(){this.status=this._allControlsDisabled()?Wb:Gb}_runValidator(){return this.validator?this.validator(this):null}_runAsyncValidator(e){if(this.asyncValidator){this.status=Km,this._hasOwnPendingAsyncValidator=!0;const t=yG(this.asyncValidator(this));this._asyncValidationSubscription=t.subscribe(i=>{this._hasOwnPendingAsyncValidator=!1,this.setErrors(i,{emitEvent:e})})}}_cancelExistingSubscription(){this._asyncValidationSubscription&&(this._asyncValidationSubscription.unsubscribe(),this._hasOwnPendingAsyncValidator=!1)}setErrors(e,t={}){this.errors=e,this._updateControlsErrors(!1!==t.emitEvent)}get(e){return function(n,e,t){if(null==e||(Array.isArray(e)||(e=e.split(".")),Array.isArray(e)&&0===e.length))return null;let i=n;return e.forEach(r=>{i=i instanceof Dk?i.controls.hasOwnProperty(r)?i.controls[r]:null:i instanceof Uxe&&i.at(r)||null}),i}(this,e)}getError(e,t){const i=t?this.get(t):this;return i&&i.errors?i.errors[e]:null}hasError(e,t){return!!this.getError(e,t)}get root(){let e=this;for(;e._parent;)e=e._parent;return e}_updateControlsErrors(e){this.status=this._calculateStatus(),e&&this.statusChanges.emit(this.status),this._parent&&this._parent._updateControlsErrors(e)}_initObservables(){this.valueChanges=new Le,this.statusChanges=new Le}_calculateStatus(){return this._allControlsDisabled()?Wb:this.errors?$M:this._hasOwnPendingAsyncValidator||this._anyControlsHaveStatus(Km)?Km:this._anyControlsHaveStatus($M)?$M:Gb}_anyControlsHaveStatus(e){return this._anyControls(t=>t.status===e)}_anyControlsDirty(){return this._anyControls(e=>e.dirty)}_anyControlsTouched(){return this._anyControls(e=>e.touched)}_updatePristine(e={}){this.pristine=!this._anyControlsDirty(),this._parent&&!e.onlySelf&&this._parent._updatePristine(e)}_updateTouched(e={}){this.touched=this._anyControlsTouched(),this._parent&&!e.onlySelf&&this._parent._updateTouched(e)}_isBoxedValue(e){return"object"==typeof e&&null!==e&&2===Object.keys(e).length&&"value"in e&&"disabled"in e}_registerOnCollectionChange(e){this._onCollectionChange=e}_setUpdateStrategy(e){Tk(e)&&null!=e.updateOn&&(this._updateOn=e.updateOn)}_parentMarkedDirty(e){return!e&&!(!this._parent||!this._parent.dirty)&&!this._parent._anyControlsDirty()}}class Sh extends Ak{constructor(e=null,t,i){super(Mk(t),xk(i,t)),this._onChange=[],this._applyFormState(e),this._setUpdateStrategy(t),this._initObservables(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator})}setValue(e,t={}){this.value=this._pendingValue=e,this._onChange.length&&!1!==t.emitModelToViewChange&&this._onChange.forEach(i=>i(this.value,!1!==t.emitViewToModelChange)),this.updateValueAndValidity(t)}patchValue(e,t={}){this.setValue(e,t)}reset(e=null,t={}){this._applyFormState(e),this.markAsPristine(t),this.markAsUntouched(t),this.setValue(this.value,t),this._pendingChange=!1}_updateValue(){}_anyControls(e){return!1}_allControlsDisabled(){return this.disabled}registerOnChange(e){this._onChange.push(e)}_unregisterOnChange(e){HM(this._onChange,e)}registerOnDisabledChange(e){this._onDisabledChange.push(e)}_unregisterOnDisabledChange(e){HM(this._onDisabledChange,e)}_forEachChild(e){}_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(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}}class Dk extends Ak{constructor(e,t,i){super(Mk(t),xk(i,t)),this.controls=e,this._initObservables(),this._setUpdateStrategy(t),this._setUpControls(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator})}registerControl(e,t){return this.controls[e]?this.controls[e]:(this.controls[e]=t,t.setParent(this),t._registerOnCollectionChange(this._onCollectionChange),t)}addControl(e,t,i={}){this.registerControl(e,t),this.updateValueAndValidity({emitEvent:i.emitEvent}),this._onCollectionChange()}removeControl(e,t={}){this.controls[e]&&this.controls[e]._registerOnCollectionChange(()=>{}),delete this.controls[e],this.updateValueAndValidity({emitEvent:t.emitEvent}),this._onCollectionChange()}setControl(e,t,i={}){this.controls[e]&&this.controls[e]._registerOnCollectionChange(()=>{}),delete this.controls[e],t&&this.registerControl(e,t),this.updateValueAndValidity({emitEvent:i.emitEvent}),this._onCollectionChange()}contains(e){return this.controls.hasOwnProperty(e)&&this.controls[e].enabled}setValue(e,t={}){this._checkAllValuesPresent(e),Object.keys(e).forEach(i=>{this._throwIfControlMissing(i),this.controls[i].setValue(e[i],{onlySelf:!0,emitEvent:t.emitEvent})}),this.updateValueAndValidity(t)}patchValue(e,t={}){null!=e&&(Object.keys(e).forEach(i=>{this.controls[i]&&this.controls[i].patchValue(e[i],{onlySelf:!0,emitEvent:t.emitEvent})}),this.updateValueAndValidity(t))}reset(e={},t={}){this._forEachChild((i,r)=>{i.reset(e[r],{onlySelf:!0,emitEvent:t.emitEvent})}),this._updatePristine(t),this._updateTouched(t),this.updateValueAndValidity(t)}getRawValue(){return this._reduceChildren({},(e,t,i)=>(e[i]=t instanceof Sh?t.value:t.getRawValue(),e))}_syncPendingControls(){let e=this._reduceChildren(!1,(t,i)=>!!i._syncPendingControls()||t);return e&&this.updateValueAndValidity({onlySelf:!0}),e}_throwIfControlMissing(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: ${e}.`)}_forEachChild(e){Object.keys(this.controls).forEach(t=>{const i=this.controls[t];i&&e(i,t)})}_setUpControls(){this._forEachChild(e=>{e.setParent(this),e._registerOnCollectionChange(this._onCollectionChange)})}_updateValue(){this.value=this._reduceValue()}_anyControls(e){for(const t of Object.keys(this.controls)){const i=this.controls[t];if(this.contains(t)&&e(i))return!0}return!1}_reduceValue(){return this._reduceChildren({},(e,t,i)=>((t.enabled||this.disabled)&&(e[i]=t.value),e))}_reduceChildren(e,t){let i=e;return this._forEachChild((r,s)=>{i=t(i,r,s)}),i}_allControlsDisabled(){for(const e of Object.keys(this.controls))if(this.controls[e].enabled)return!1;return Object.keys(this.controls).length>0||this.disabled}_checkAllValuesPresent(e){this._forEachChild((t,i)=>{if(void 0===e[i])throw new Error(`Must supply a value for form control with name: '${i}'.`)})}}class Uxe extends Ak{constructor(e,t,i){super(Mk(t),xk(i,t)),this.controls=e,this._initObservables(),this._setUpdateStrategy(t),this._setUpControls(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator})}at(e){return this.controls[e]}push(e,t={}){this.controls.push(e),this._registerControl(e),this.updateValueAndValidity({emitEvent:t.emitEvent}),this._onCollectionChange()}insert(e,t,i={}){this.controls.splice(e,0,t),this._registerControl(t),this.updateValueAndValidity({emitEvent:i.emitEvent})}removeAt(e,t={}){this.controls[e]&&this.controls[e]._registerOnCollectionChange(()=>{}),this.controls.splice(e,1),this.updateValueAndValidity({emitEvent:t.emitEvent})}setControl(e,t,i={}){this.controls[e]&&this.controls[e]._registerOnCollectionChange(()=>{}),this.controls.splice(e,1),t&&(this.controls.splice(e,0,t),this._registerControl(t)),this.updateValueAndValidity({emitEvent:i.emitEvent}),this._onCollectionChange()}get length(){return this.controls.length}setValue(e,t={}){this._checkAllValuesPresent(e),e.forEach((i,r)=>{this._throwIfControlMissing(r),this.at(r).setValue(i,{onlySelf:!0,emitEvent:t.emitEvent})}),this.updateValueAndValidity(t)}patchValue(e,t={}){null!=e&&(e.forEach((i,r)=>{this.at(r)&&this.at(r).patchValue(i,{onlySelf:!0,emitEvent:t.emitEvent})}),this.updateValueAndValidity(t))}reset(e=[],t={}){this._forEachChild((i,r)=>{i.reset(e[r],{onlySelf:!0,emitEvent:t.emitEvent})}),this._updatePristine(t),this._updateTouched(t),this.updateValueAndValidity(t)}getRawValue(){return this.controls.map(e=>e instanceof Sh?e.value:e.getRawValue())}clear(e={}){this.controls.length<1||(this._forEachChild(t=>t._registerOnCollectionChange(()=>{})),this.controls.splice(0),this.updateValueAndValidity({emitEvent:e.emitEvent}))}_syncPendingControls(){let e=this.controls.reduce((t,i)=>!!i._syncPendingControls()||t,!1);return e&&this.updateValueAndValidity({onlySelf:!0}),e}_throwIfControlMissing(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 ${e}`)}_forEachChild(e){this.controls.forEach((t,i)=>{e(t,i)})}_updateValue(){this.value=this.controls.filter(e=>e.enabled||this.disabled).map(e=>e.value)}_anyControls(e){return this.controls.some(t=>t.enabled&&e(t))}_setUpControls(){this._forEachChild(e=>this._registerControl(e))}_checkAllValuesPresent(e){this._forEachChild((t,i)=>{if(void 0===e[i])throw new Error(`Must supply a value for form control at index: ${i}.`)})}_allControlsDisabled(){for(const e of this.controls)if(e.enabled)return!1;return this.controls.length>0||this.disabled}_registerControl(e){e.setParent(this),e._registerOnCollectionChange(this._onCollectionChange)}}const Hxe={provide:Po,useExisting:T(()=>mp)},qb=(()=>Promise.resolve(null))();let mp=(()=>{class n extends Po{constructor(t,i){super(),this.submitted=!1,this._directives=[],this.ngSubmit=new Le,this.form=new Dk({},mk(t),_k(i))}ngAfterViewInit(){this._setUpdateStrategy()}get formDirective(){return this}get control(){return this.form}get path(){return[]}get controls(){return this.form.controls}addControl(t){qb.then(()=>{const i=this._findContainer(t.path);t.control=i.registerControl(t.name,t.control),$b(t.control,t),t.control.updateValueAndValidity({emitEvent:!1}),this._directives.push(t)})}getControl(t){return this.form.get(t.path)}removeControl(t){qb.then(()=>{const i=this._findContainer(t.path);i&&i.removeControl(t.name),HM(this._directives,t)})}addFormGroup(t){qb.then(()=>{const i=this._findContainer(t.path),r=new Dk({});RG(r,t),i.registerControl(t.name,r),r.updateValueAndValidity({emitEvent:!1})})}removeFormGroup(t){qb.then(()=>{const i=this._findContainer(t.path);i&&i.removeControl(t.name)})}getFormGroup(t){return this.form.get(t.path)}updateModel(t,i){qb.then(()=>{this.form.get(t.path).setValue(i)})}setValue(t){this.control.setValue(t)}onSubmit(t){return this.submitted=!0,kG(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 n.\u0275fac=function(t){return new(t||n)(E(Ss,10),E(wh,10))},n.\u0275dir=oe({type:n,selectors:[["form",3,"ngNoForm","",3,"formGroup",""],["ng-form"],["","ngForm",""]],hostBindings:function(t,i){1&t&&ge("submit",function(s){return i.onSubmit(s)})("reset",function(){return i.onReset()})},inputs:{options:["ngFormOptions","options"]},outputs:{ngSubmit:"ngSubmit"},exportAs:["ngForm"],features:[Dt([Hxe]),ct]}),n})();const Gxe={provide:uc,useExisting:T(()=>Ok)},VG=(()=>Promise.resolve(null))();let Ok=(()=>{class n extends uc{constructor(t,i,r,s){super(),this.control=new Sh,this._registered=!1,this.update=new Le,this._parent=t,this._setValidators(i),this._setAsyncValidators(r),this.valueAccessor=Sk(0,s)}ngOnChanges(t){this._checkForErrors(),this._registered||this._setUpControl(),"isDisabled"in t&&this._updateDisabled(t),Ek(t,this.viewModel)&&(this._updateValue(this.model),this.viewModel=this.model)}ngOnDestroy(){this.formDirective&&this.formDirective.removeControl(this)}get path(){return this._parent?function(n,e){return[...e.path,n]}(this.name,this._parent):[this.name]}get formDirective(){return this._parent?this._parent.formDirective:null}viewToModelUpdate(t){this.viewModel=t,this.update.emit(t)}_setUpControl(){this._setUpdateStrategy(),this._isStandalone()?this._setUpStandalone():this.formDirective.addControl(this),this._registered=!0}_setUpdateStrategy(){this.options&&null!=this.options.updateOn&&(this.control._updateOn=this.options.updateOn)}_isStandalone(){return!this._parent||!(!this.options||!this.options.standalone)}_setUpStandalone(){$b(this.control,this),this.control.updateValueAndValidity({emitEvent:!1})}_checkForErrors(){this._isStandalone()||this._checkParentType(),this._checkName()}_checkParentType(){}_checkName(){this.options&&this.options.name&&(this.name=this.options.name),this._isStandalone()}_updateValue(t){VG.then(()=>{this.control.setValue(t,{emitViewToModelChange:!1})})}_updateDisabled(t){const i=t.isDisabled.currentValue,r=""===i||i&&"false"!==i;VG.then(()=>{r&&!this.control.disabled?this.control.disable():!r&&this.control.disabled&&this.control.enable()})}}return n.\u0275fac=function(t){return new(t||n)(E(Po,9),E(Ss,10),E(wh,10),E(ro,10))},n.\u0275dir=oe({type:n,selectors:[["","ngModel","",3,"formControlName","",3,"formControl",""]],inputs:{name:"name",isDisabled:["disabled","isDisabled"],model:["ngModel","model"],options:["ngModelOptions","options"]},outputs:{update:"ngModelChange"},exportAs:["ngModel"],features:[Dt([Gxe]),ct,zn]}),n})(),UG=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({}),n})();const Ik=new ve("NgModelWithFormControlWarning"),Kxe={provide:uc,useExisting:T(()=>GM)};let GM=(()=>{class n extends uc{constructor(t,i,r,s){super(),this._ngModelWarningConfig=s,this.update=new Le,this._ngModelWarningSent=!1,this._setValidators(t),this._setAsyncValidators(i),this.valueAccessor=Sk(0,r)}set isDisabled(t){}ngOnChanges(t){if(this._isControlChanged(t)){const i=t.form.previousValue;i&&zM(i,this,!1),$b(this.form,this),this.control.disabled&&this.valueAccessor.setDisabledState&&this.valueAccessor.setDisabledState(!0),this.form.updateValueAndValidity({emitEvent:!1})}Ek(t,this.viewModel)&&(this.form.setValue(this.model),this.viewModel=this.model)}ngOnDestroy(){this.form&&zM(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 n.\u0275fac=function(t){return new(t||n)(E(Ss,10),E(wh,10),E(ro,10),E(Ik,8))},n.\u0275dir=oe({type:n,selectors:[["","formControl",""]],inputs:{isDisabled:["disabled","isDisabled"],form:["formControl","form"],model:["ngModel","model"]},outputs:{update:"ngModelChange"},exportAs:["ngForm"],features:[Dt([Kxe]),ct,zn]}),n._ngModelWarningSentOnce=!1,n})();const Zxe={provide:Po,useExisting:T(()=>Zm)};let Zm=(()=>{class n extends Po{constructor(t,i){super(),this.validators=t,this.asyncValidators=i,this.submitted=!1,this._onCollectionChange=()=>this._updateDomValue(),this.directives=[],this.form=null,this.ngSubmit=new Le,this._setValidators(t),this._setAsyncValidators(i)}ngOnChanges(t){this._checkFormPresent(),t.hasOwnProperty("form")&&(this._updateValidators(),this._updateDomValue(),this._updateRegistrations(),this._oldForm=this.form)}ngOnDestroy(){this.form&&(UM(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 i=this.form.get(t.path);return $b(i,t),i.updateValueAndValidity({emitEvent:!1}),this.directives.push(t),i}getControl(t){return this.form.get(t.path)}removeControl(t){zM(t.control||null,t,!1),HM(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,i){this.form.get(t.path).setValue(i)}onSubmit(t){return this.submitted=!0,kG(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 i=t.control,r=this.form.get(t.path);i!==r&&(zM(i||null,t),r instanceof Sh&&($b(r,t),t.control=r))}),this.form._updateTreeValidity({emitEvent:!1})}_setUpFormContainer(t){const i=this.form.get(t.path);RG(i,t),i.updateValueAndValidity({emitEvent:!1})}_cleanUpFormContainer(t){if(this.form){const i=this.form.get(t.path);i&&function(n,e){return UM(n,e)}(i,t)&&i.updateValueAndValidity({emitEvent:!1})}}_updateRegistrations(){this.form._registerOnCollectionChange(this._onCollectionChange),this._oldForm&&this._oldForm._registerOnCollectionChange(()=>{})}_updateValidators(){wk(this.form,this),this._oldForm&&UM(this._oldForm,this)}_checkFormPresent(){}}return n.\u0275fac=function(t){return new(t||n)(E(Ss,10),E(wh,10))},n.\u0275dir=oe({type:n,selectors:[["","formGroup",""]],hostBindings:function(t,i){1&t&&ge("submit",function(s){return i.onSubmit(s)})("reset",function(){return i.onReset()})},inputs:{form:["formGroup","form"]},outputs:{ngSubmit:"ngSubmit"},exportAs:["ngForm"],features:[Dt([Zxe]),ct,zn]}),n})(),iW=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[UG]]}),n})(),Lk=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[iW]}),n})(),Bk=(()=>{class n{static withConfig(t){return{ngModule:n,providers:[{provide:Ik,useValue:t.warnOnNgModelWithFormControl}]}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[iW]}),n})();function Yb(n){return new ce(e=>{let t;try{t=n()}catch(r){return void e.error(r)}return(t?ui(t):bE()).subscribe(e)})}function Vk(n,e=Pf){const i=function(n){return n instanceof Date&&!isNaN(+n)}(n)?+n-e.now():Math.abs(n);return r=>r.lift(new m1e(i,e))}class m1e{constructor(e,t){this.delay=e,this.scheduler=t}call(e,t){return t.subscribe(new zk(e,this.delay,this.scheduler))}}class zk extends xt{constructor(e,t,i){super(e),this.delay=t,this.scheduler=i,this.queue=[],this.active=!1,this.errored=!1}static dispatch(e){const t=e.source,i=t.queue,r=e.scheduler,s=e.destination;for(;i.length>0&&i[0].time-r.now()<=0;)i.shift().notification.observe(s);if(i.length>0){const o=Math.max(0,i[0].time-r.now());this.schedule(e,o)}else this.unsubscribe(),t.active=!1}_schedule(e){this.active=!0,this.destination.add(e.schedule(zk.dispatch,this.delay,{source:this,destination:this.destination,scheduler:e}))}scheduleNotification(e){if(!0===this.errored)return;const t=this.scheduler,i=new _1e(t.now()+this.delay,e);this.queue.push(i),!1===this.active&&this._schedule(t)}_next(e){this.scheduleNotification(Ko.createNext(e))}_error(e){this.errored=!0,this.queue=[],this.destination.error(e),this.unsubscribe()}_complete(){this.scheduleNotification(Ko.createComplete()),this.unsubscribe()}}class _1e{constructor(e,t){this.time=e,this.notification=t}}const aW=tm({passive:!0});let lW=(()=>{class n{constructor(t,i){this._platform=t,this._ngZone=i,this._monitoredElements=new Map}monitor(t){if(!this._platform.isBrowser)return ec;const i=Wu(t),r=this._monitoredElements.get(i);if(r)return r.subject;const s=new Se,o="cdk-text-field-autofilled",a=l=>{"cdk-text-field-autofill-start"!==l.animationName||i.classList.contains(o)?"cdk-text-field-autofill-end"===l.animationName&&i.classList.contains(o)&&(i.classList.remove(o),this._ngZone.run(()=>s.next({target:l.target,isAutofilled:!1}))):(i.classList.add(o),this._ngZone.run(()=>s.next({target:l.target,isAutofilled:!0})))};return this._ngZone.runOutsideAngular(()=>{i.addEventListener("animationstart",a,aW),i.classList.add("cdk-text-field-autofill-monitored")}),this._monitoredElements.set(i,{subject:s,unlisten:()=>{i.removeEventListener("animationstart",a,aW)}}),s}stopMonitoring(t){const i=Wu(t),r=this._monitoredElements.get(i);r&&(r.unlisten(),r.subject.complete(),i.classList.remove("cdk-text-field-autofill-monitored"),i.classList.remove("cdk-text-field-autofilled"),this._monitoredElements.delete(i))}ngOnDestroy(){this._monitoredElements.forEach((t,i)=>this.stopMonitoring(i))}}return n.\u0275fac=function(t){return new(t||n)(I(si),I(dt))},n.\u0275prov=ue({factory:function(){return new n(I(si),I(dt))},token:n,providedIn:"root"}),n})(),cW=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[Rv]]}),n})();const k1e=new ve("MAT_INPUT_VALUE_ACCESSOR"),F1e=["button","checkbox","file","hidden","image","radio","range","reset","submit"];let N1e=0;const L1e=FO(class{constructor(n,e,t,i){this._defaultErrorStateMatcher=n,this._parentForm=e,this._parentFormGroup=t,this.ngControl=i}});let Xb=(()=>{class n extends L1e{constructor(t,i,r,s,o,a,l,c,d,f){super(a,s,o,r),this._elementRef=t,this._platform=i,this._autofillMonitor=c,this._formField=f,this._uid="mat-input-"+N1e++,this.focused=!1,this.stateChanges=new Se,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(_=>xV().has(_));const p=this._elementRef.nativeElement,g=p.nodeName.toLowerCase();this._inputValueAccessor=l||p,this._previousNativeValue=this.value,this.id=this.id,i.IOS&&d.runOutsideAngular(()=>{t.nativeElement.addEventListener("keyup",_=>{const y=_.target;!y.value&&0===y.selectionStart&&0===y.selectionEnd&&(y.setSelectionRange(1,1),y.setSelectionRange(0,0))})}),this._isServer=!this._platform.isBrowser,this._isNativeSelect="select"===g,this._isTextarea="textarea"===g,this._isInFormField=!!f,this._isNativeSelect&&(this.controlType=p.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=Mt(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=Mt(t)}get type(){return this._type}set type(t){this._type=t||"text",this._validateType(),!this._isTextarea&&xV().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=Mt(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,i;const r=(null===(i=null===(t=this._formField)||void 0===t?void 0:t._hideControlPlaceholder)||void 0===i?void 0:i.call(t))?null:this.placeholder;if(r!==this._previousPlaceholder){const s=this._elementRef.nativeElement;this._previousPlaceholder=r,r?s.setAttribute("placeholder",r):s.removeAttribute("placeholder")}}_dirtyCheckNativeValue(){const t=this._elementRef.nativeElement.value;this._previousNativeValue!==t&&(this._previousNativeValue=t,this.stateChanges.next())}_validateType(){F1e.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,i=t.options[0];return this.focused||t.multiple||!this.empty||!!(t.selectedIndex>-1&&i&&i.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 n.\u0275fac=function(t){return new(t||n)(E(rt),E(si),E(uc,10),E(mp,8),E(Zm,8),E(Vv),E(k1e,10),E(lW),E(dt),E(nS,8))},n.\u0275dir=oe({type:n,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,i){1&t&&ge("focus",function(){return i._focusChanged(!0)})("blur",function(){return i._focusChanged(!1)})("input",function(){return i._onInput()}),2&t&&(al("disabled",i.disabled)("required",i.required),nn("id",i.id)("data-placeholder",i.placeholder)("readonly",i.readonly&&!i._isNativeSelect||null)("aria-invalid",i.empty&&i.required?null:i.errorState)("aria-required",i.required),st("mat-input-server",i._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:[Dt([{provide:jv,useExisting:n}]),ct,zn]}),n})(),Kb=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({providers:[Vv],imports:[[cW,Uv,On],cW,Uv]}),n})();function ur(...n){const e=n.length;if(0===e)throw new Error("list of properties cannot be empty.");return t=>Ae(function(n,e){return i=>{let r=i;for(let s=0;si.lift(new U1e(n,e,t.leading,t.trailing))}class U1e{constructor(e,t,i,r){this.duration=e,this.scheduler=t,this.leading=i,this.trailing=r}call(e,t){return t.subscribe(new H1e(e,this.duration,this.scheduler,this.leading,this.trailing))}}class H1e extends xt{constructor(e,t,i,r,s){super(e),this.duration=t,this.scheduler=i,this.leading=r,this.trailing=s,this._hasTrailingValue=!1,this._trailingValue=null}_next(e){this.throttled?this.trailing&&(this._trailingValue=e,this._hasTrailingValue=!0):(this.add(this.throttled=this.scheduler.schedule($1e,this.duration,{subscriber:this})),this.leading?this.destination.next(e):this.trailing&&(this._trailingValue=e,this._hasTrailingValue=!0))}_complete(){this._hasTrailingValue?(this.destination.next(this._trailingValue),this.destination.complete()):this.destination.complete()}clearThrottle(){const e=this.throttled;e&&(this.trailing&&this._hasTrailingValue&&(this.destination.next(this._trailingValue),this._trailingValue=null,this._hasTrailingValue=!1),e.unsubscribe(),this.remove(e),this.throttled=null)}}function $1e(n){const{subscriber:e}=n;e.clearThrottle()}var hW=ze(266);const G1e={tooltipState:tc("state",[wr("initial, void, hidden",ti({opacity:0,transform:"scale(0)"})),wr("visible",ti({transform:"scale(1)"})),Qs("* => visible",Ao("200ms cubic-bezier(0, 0, 0.2, 1)",zie([ti({opacity:0,transform:"scale(0)",offset:0}),ti({opacity:.5,transform:"scale(0.99)",offset:.5}),ti({opacity:1,transform:"scale(1)",offset:1})]))),Qs("* => hidden",Ao("100ms cubic-bezier(0, 0, 0.2, 1)",ti({opacity:0})))])},fW="tooltip-panel",pW=tm({passive:!0}),gW=new ve("mat-tooltip-scroll-strategy"),X1e={provide:gW,deps:[Jo],useFactory:function(n){return()=>n.scrollStrategies.reposition({scrollThrottle:20})}},K1e=new ve("mat-tooltip-default-options",{providedIn:"root",factory:function(){return{showDelay:0,hideDelay:0,touchendHideDelay:1500}}});let Q1e=(()=>{class n{constructor(t,i,r,s,o,a,l,c,d,f,p,g){this._overlay=t,this._elementRef=i,this._scrollDispatcher=r,this._viewContainerRef=s,this._ngZone=o,this._platform=a,this._ariaDescriber=l,this._focusMonitor=c,this._dir=f,this._defaultOptions=p,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 Se,this._handleKeydown=_=>{this._isTooltipVisible()&&27===_.keyCode&&!Zs(_)&&(_.preventDefault(),_.stopPropagation(),this._ngZone.run(()=>this.hide(0)))},this._scrollStrategy=d,this._document=g,p&&(p.position&&(this.position=p.position),p.touchGestures&&(this.touchGestures=p.touchGestures)),f.change.pipe(Tn(this._destroyed)).subscribe(()=>{this._overlayRef&&this._updatePosition(this._overlayRef)}),o.runOutsideAngular(()=>{i.nativeElement.addEventListener("keydown",this._handleKeydown)})}get position(){return this._position}set position(t){var i;t!==this._position&&(this._position=t,this._overlayRef&&(this._updatePosition(this._overlayRef),null===(i=this._tooltipInstance)||void 0===i||i.show(0),this._overlayRef.updatePosition()))}get disabled(){return this._disabled}set disabled(t){this._disabled=Mt(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(Tn(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(([i,r])=>{t.removeEventListener(i,r,pW)}),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 i=this._createOverlay();this._detach(),this._portal=this._portal||new dm(this._tooltipComponent,this._viewContainerRef),this._tooltipInstance=i.attach(this._portal).instance,this._tooltipInstance.afterHidden().pipe(Tn(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),i=this._overlay.position().flexibleConnectedTo(this._elementRef).withTransformOriginOn(`.${this._cssClassPrefix}-tooltip`).withFlexibleDimensions(!1).withViewportMargin(this._viewportMargin).withScrollableContainers(t);return i.positionChanges.pipe(Tn(this._destroyed)).subscribe(r=>{this._updateCurrentPositionClass(r.connectionPair),this._tooltipInstance&&r.scrollableViewProperties.isOverlayClipped&&this._tooltipInstance.isVisible()&&this._ngZone.run(()=>this.hide(0))}),this._overlayRef=this._overlay.create({direction:this._dir,positionStrategy:i,panelClass:`${this._cssClassPrefix}-${fW}`,scrollStrategy:this._scrollStrategy()}),this._updatePosition(this._overlayRef),this._overlayRef.detachments().pipe(Tn(this._destroyed)).subscribe(()=>this._detach()),this._overlayRef.outsidePointerEvents().pipe(Tn(this._destroyed)).subscribe(()=>{var r;return null===(r=this._tooltipInstance)||void 0===r?void 0:r._handleBodyInteraction()}),this._overlayRef}_detach(){this._overlayRef&&this._overlayRef.hasAttached()&&this._overlayRef.detach(),this._tooltipInstance=null}_updatePosition(t){const i=t.getConfig().positionStrategy,r=this._getOrigin(),s=this._getOverlayPosition();i.withPositions([this._addOffset(Object.assign(Object.assign({},r.main),s.main)),this._addOffset(Object.assign(Object.assign({},r.fallback),s.fallback))])}_addOffset(t){return t}_getOrigin(){const t=!this._dir||"ltr"==this._dir.value,i=this.position;let r;"above"==i||"below"==i?r={originX:"center",originY:"above"==i?"top":"bottom"}:"before"==i||"left"==i&&t||"right"==i&&!t?r={originX:"start",originY:"center"}:("after"==i||"right"==i&&t||"left"==i&&!t)&&(r={originX:"end",originY:"center"});const{x:s,y:o}=this._invertPosition(r.originX,r.originY);return{main:r,fallback:{originX:s,originY:o}}}_getOverlayPosition(){const t=!this._dir||"ltr"==this._dir.value,i=this.position;let r;"above"==i?r={overlayX:"center",overlayY:"bottom"}:"below"==i?r={overlayX:"center",overlayY:"top"}:"before"==i||"left"==i&&t||"right"==i&&!t?r={overlayX:"end",overlayY:"center"}:("after"==i||"right"==i&&t||"left"==i&&!t)&&(r={overlayX:"start",overlayY:"center"});const{x:s,y:o}=this._invertPosition(r.overlayX,r.overlayY);return{main:r,fallback:{overlayX:s,overlayY:o}}}_updateTooltipMessage(){this._tooltipInstance&&(this._tooltipInstance.message=this.message,this._tooltipInstance._markForCheck(),this._ngZone.onMicrotaskEmpty.pipe(yi(1),Tn(this._destroyed)).subscribe(()=>{this._tooltipInstance&&this._overlayRef.updatePosition()}))}_setTooltipClass(t){this._tooltipInstance&&(this._tooltipInstance.tooltipClass=t,this._tooltipInstance._markForCheck())}_invertPosition(t,i){return"above"===this.position||"below"===this.position?"top"===i?i="bottom":"bottom"===i&&(i="top"):"end"===t?t="start":"start"===t&&(t="end"),{x:t,y:i}}_updateCurrentPositionClass(t){const{overlayY:i,originX:r,originY:s}=t;let o;if(o="center"===i?this._dir&&"rtl"===this._dir.value?"end"===r?"left":"right":"start"===r?"left":"right":"bottom"===i&&"top"===s?"above":"below",o!==this._currentPosition){const a=this._overlayRef;if(a){const l=`${this._cssClassPrefix}-${fW}-`;a.removePanelClass(l+this._currentPosition),a.addPanelClass(l+o)}this._currentPosition=o}}_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",i=>this._wheelListener(i)]);else if("off"!==this.touchGestures){this._disableNativeGesturesIfNecessary();const i=()=>{clearTimeout(this._touchstartTimeout),this.hide(this._defaultOptions.touchendHideDelay)};t.push(["touchend",i],["touchcancel",i])}this._addListeners(t),this._passiveListeners.push(...t)}_addListeners(t){t.forEach(([i,r])=>{this._elementRef.nativeElement.addEventListener(i,r,pW)})}_platformSupportsMouseEvents(){return!this._platform.IOS&&!this._platform.ANDROID}_wheelListener(t){if(this._isTooltipVisible()){const i=this._document.elementFromPoint(t.clientX,t.clientY),r=this._elementRef.nativeElement;i!==r&&!r.contains(i)&&this.hide()}}_disableNativeGesturesIfNecessary(){const t=this.touchGestures;if("off"!==t){const i=this._elementRef.nativeElement,r=i.style;("on"===t||"INPUT"!==i.nodeName&&"TEXTAREA"!==i.nodeName)&&(r.userSelect=r.msUserSelect=r.webkitUserSelect=r.MozUserSelect="none"),("on"===t||!i.draggable)&&(r.webkitUserDrag="none"),r.touchAction="none",r.webkitTapHighlightColor="transparent"}}}return n.\u0275fac=function(t){return new(t||n)(E(Jo),E(rt),E(um),E(ns),E(dt),E(si),E(IV),E(Sa),E(void 0),E(Qo),E(void 0),E(ut))},n.\u0275dir=oe({type:n,inputs:{showDelay:["matTooltipShowDelay","showDelay"],hideDelay:["matTooltipHideDelay","hideDelay"],touchGestures:["matTooltipTouchGestures","touchGestures"],position:["matTooltipPosition","position"],disabled:["matTooltipDisabled","disabled"],message:["matTooltip","message"],tooltipClass:["matTooltipClass","tooltipClass"]}}),n})(),dc=(()=>{class n extends Q1e{constructor(t,i,r,s,o,a,l,c,d,f,p,g){super(t,i,r,s,o,a,l,c,d,f,p,g),this._tooltipComponent=eTe}}return n.\u0275fac=function(t){return new(t||n)(E(Jo),E(rt),E(um),E(ns),E(dt),E(si),E(IV),E(Sa),E(gW),E(Qo,8),E(K1e,8),E(ut))},n.\u0275dir=oe({type:n,selectors:[["","matTooltip",""]],hostAttrs:[1,"mat-tooltip-trigger"],exportAs:["matTooltip"],features:[ct]}),n})(),J1e=(()=>{class n{constructor(t){this._changeDetectorRef=t,this._visibility="initial",this._closeOnInteraction=!1,this._onHide=new Se}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 i=t.toState;"hidden"===i&&!this.isVisible()&&this._onHide.next(),("visible"===i||"hidden"===i)&&(this._closeOnInteraction=!0)}_handleBodyInteraction(){this._closeOnInteraction&&this.hide(0)}_markForCheck(){this._changeDetectorRef.markForCheck()}_onShow(){}}return n.\u0275fac=function(t){return new(t||n)(E(kn))},n.\u0275dir=oe({type:n}),n})(),eTe=(()=>{class n extends J1e{constructor(t,i){super(t),this._breakpointObserver=i,this._isHandset=this._breakpointObserver.observe("(max-width: 599.98px) and (orientation: portrait), (max-width: 959.98px) and (orientation: landscape)")}}return n.\u0275fac=function(t){return new(t||n)(E(kn),E(XO))},n.\u0275cmp=Ne({type:n,selectors:[["mat-tooltip-component"]],hostAttrs:["aria-hidden","true"],hostVars:2,hostBindings:function(t,i){2&t&&vf("zoom","visible"===i._visibility?1:null)},features:[ct],decls:3,vars:7,consts:[[1,"mat-tooltip",3,"ngClass"]],template:function(t,i){if(1&t&&(R(0,"div",0),ge("@state.start",function(){return i._animationStart()})("@state.done",function(s){return i._animationDone(s)}),Kt(1,"async"),De(2),k()),2&t){let r;st("mat-tooltip-handset",null==(r=rn(1,5,i._isHandset))?null:r.matches),ie("ngClass",i.tooltipClass)("@state",i._visibility),G(2),xi(i.message)}},directives:[hE],pipes:[Hc],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:[G1e.tooltipState]},changeDetection:0}),n})(),hc=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({providers:[X1e],imports:[[Nie,dn,Yv,On],On,Wv]}),n})();const tTe=["sliderWrapper"],Cl=tm({passive:!1}),oTe={provide:ro,useExisting:T(()=>jk),multi:!0};class aTe{}const lTe=Hf(Uf(jf(class{constructor(n){this._elementRef=n}}),"accent"));let jk=(()=>{class n extends lTe{constructor(t,i,r,s,o,a,l,c){super(t),this._focusMonitor=i,this._changeDetectorRef=r,this._dir=s,this._ngZone=a,this._animationMode=c,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 Le,this.input=new Le,this.valueChange=new Le,this.onTouched=()=>{},this._percent=0,this._isSliding=null,this._isActive=!1,this._tickIntervalPercent=0,this._sliderDimensions=null,this._controlValueAccessorChangeFn=()=>{},this._dirChangeSubscription=Te.EMPTY,this._pointerDown=d=>{this.disabled||this._isSliding||!Zb(d)&&0!==d.button||this._ngZone.run(()=>{this._touchId=Zb(d)?function(n,e){for(let t=0;t{if("pointer"===this._isSliding){const f=mW(d,this._touchId);if(f){d.preventDefault();const p=this.value;this._lastPointerEvent=d,this._updateValueFromPosition(f),p!=this.value&&this._emitInputEvent()}}},this._pointerUp=d=>{"pointer"===this._isSliding&&(!Zb(d)||"number"!=typeof this._touchId||Uk(d.changedTouches,this._touchId))&&(d.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=l,this.tabIndex=parseInt(o)||0,a.runOutsideAngular(()=>{const d=t.nativeElement;d.addEventListener("mousedown",this._pointerDown,Cl),d.addEventListener("touchstart",this._pointerDown,Cl)})}get invert(){return this._invert}set invert(t){this._invert=Mt(t)}get max(){return this._max}set max(t){this._max=To(t,this._max),this._percent=this._calculatePercentage(this._value),this._changeDetectorRef.markForCheck()}get min(){return this._min}set min(t){this._min=To(t,this._min),this._percent=this._calculatePercentage(this._value),this._changeDetectorRef.markForCheck()}get step(){return this._step}set step(t){this._step=To(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=Mt(t)}get tickInterval(){return this._tickInterval}set tickInterval(t){this._tickInterval="auto"===t?"auto":"number"==typeof t||"string"==typeof t?To(t,this._tickInterval):0}get value(){return null===this._value&&(this.value=this._min),this._value}set value(t){if(t!==this._value){let i=To(t,0);this._roundToDecimal&&i!==this.min&&i!==this.max&&(i=parseFloat(i.toFixed(this._roundToDecimal))),this._value=i,this._percent=this._calculatePercentage(this._value),this._changeDetectorRef.markForCheck()}}get vertical(){return this._vertical}set vertical(t){this._vertical=Mt(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 i=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(${i})`}}_getTrackFillStyles(){const t=this.percent,r=this.vertical?`1, ${t}, 1`:`${t}, 1, 1`;return{transform:`translate${this.vertical?"Y":"X"}(${this._shouldInvertMouseCoords()?"":"-"}${this._getThumbGap()}px) scale3d(${r})`,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,a={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 l=this._shouldInvertAxis();let c;c=this.vertical?l?"Bottom":"Top":l?"Right":"Left",a[`padding${c}`]=`${this._getThumbGap()}px`}return a}_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,Cl),t.removeEventListener("touchstart",this._pointerDown,Cl),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||Zs(t)||this._isSliding&&"keyboard"!==this._isSliding)return;const i=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}i!=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 i=this._document,r=Zb(t),o=r?"touchend":"mouseup";i.addEventListener(r?"touchmove":"mousemove",this._pointerMove,Cl),i.addEventListener(o,this._pointerUp,Cl),r&&i.addEventListener("touchcancel",this._pointerUp,Cl);const a=this._getWindow();void 0!==a&&a&&a.addEventListener("blur",this._windowBlur)}_removeGlobalEvents(){const t=this._document;t.removeEventListener("mousemove",this._pointerMove,Cl),t.removeEventListener("mouseup",this._pointerUp,Cl),t.removeEventListener("touchmove",this._pointerMove,Cl),t.removeEventListener("touchend",this._pointerUp,Cl),t.removeEventListener("touchcancel",this._pointerUp,Cl);const i=this._getWindow();void 0!==i&&i&&i.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 o=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()&&(o=1-o),0===o)this.value=this.min;else if(1===o)this.value=this.max;else{const a=this._calculateValue(o),l=Math.round((a-this.min)/this.step)*this.step+this.min;this.value=this._clamp(l,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,s=Math.ceil(30/(t*this.step/(this.max-this.min)))*this.step;this._tickIntervalPercent=s/t}else this._tickIntervalPercent=this.tickInterval*this.step/(this.max-this.min)}_createChangeEvent(t=this.value){let i=new aTe;return i.source=this,i.value=t,i}_calculatePercentage(t){return((t||0)-this.min)/(this.max-this.min)}_calculateValue(t){return this.min+t*(this.max-this.min)}_clamp(t,i=0,r=1){return Math.max(i,Math.min(t,r))}_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 n.\u0275fac=function(t){return new(t||n)(E(rt),E(Sa),E(kn),E(Qo,8),Zr("tabindex"),E(dt),E(ut),E(Do,8))},n.\u0275cmp=Ne({type:n,selectors:[["mat-slider"]],viewQuery:function(t,i){if(1&t&&Jn(tTe,5),2&t){let r;_t(r=yt())&&(i._sliderWrapper=r.first)}},hostAttrs:["role","slider",1,"mat-slider","mat-focus-indicator"],hostVars:29,hostBindings:function(t,i){1&t&&ge("focus",function(){return i._onFocus()})("blur",function(){return i._onBlur()})("keydown",function(s){return i._onKeydown(s)})("keyup",function(){return i._onKeyup()})("mouseenter",function(){return i._onMouseenter()})("selectstart",function(s){return s.preventDefault()}),2&t&&(al("tabIndex",i.tabIndex),nn("aria-disabled",i.disabled)("aria-valuemax",i.max)("aria-valuemin",i.min)("aria-valuenow",i.value)("aria-valuetext",null==i.valueText?i.displayValue:i.valueText)("aria-orientation",i.vertical?"vertical":"horizontal"),st("mat-slider-disabled",i.disabled)("mat-slider-has-ticks",i.tickInterval)("mat-slider-horizontal",!i.vertical)("mat-slider-axis-inverted",i._shouldInvertAxis())("mat-slider-invert-mouse-coords",i._shouldInvertMouseCoords())("mat-slider-sliding",i._isSliding)("mat-slider-thumb-label-showing",i.thumbLabel)("mat-slider-vertical",i.vertical)("mat-slider-min-value",i._isMinValue())("mat-slider-hide-last-tick",i.disabled||i._isMinValue()&&i._getThumbGap()&&i._shouldInvertAxis())("_mat-animation-noopable","NoopAnimations"===i._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:[Dt([oTe]),ct],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,i){1&t&&(R(0,"div",0,1),R(2,"div",2),tt(3,"div",3),tt(4,"div",4),k(),R(5,"div",5),tt(6,"div",6),k(),R(7,"div",7),tt(8,"div",8),tt(9,"div",9),R(10,"div",10),R(11,"span",11),De(12),k(),k(),k(),k()),2&t&&(G(3),ie("ngStyle",i._getTrackBackgroundStyles()),G(1),ie("ngStyle",i._getTrackFillStyles()),G(1),ie("ngStyle",i._getTicksContainerStyles()),G(1),ie("ngStyle",i._getTicksStyles()),G(1),ie("ngStyle",i._getThumbContainerStyles()),G(5),xi(i.displayValue))},directives:[J3],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}),n})();function Zb(n){return"t"===n.type[0]}function mW(n,e){let t;return t=Zb(n)?"number"==typeof e?Uk(n.touches,e)||Uk(n.changedTouches,e):n.touches[0]||n.changedTouches[0]:n,t?{x:t.clientX,y:t.clientY}:void 0}function Uk(n,e){for(let t=0;t{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,On],On]}),n})();function uTe(n,e){}class Hk{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 dTe={dialogContainer:tc("dialogContainer",[wr("void, exit",ti({opacity:0,transform:"scale(0.7)"})),wr("enter",ti({transform:"none"})),Qs("* => enter",Ao("150ms cubic-bezier(0, 0, 0.2, 1)",ti({transform:"none",opacity:1}))),Qs("* => void, * => exit",Ao("75ms cubic-bezier(0.4, 0.0, 0.2, 1)",ti({opacity:0})))])};let hTe=(()=>{class n extends uS{constructor(t,i,r,s,o,a){super(),this._elementRef=t,this._focusTrapFactory=i,this._changeDetectorRef=r,this._config=o,this._focusMonitor=a,this._animationStateChanged=new Le,this._elementFocusedBeforeDialogWasOpened=null,this._closeInteractionType=null,this.attachDomPortal=l=>(this._portalOutlet.hasAttached(),this._portalOutlet.attachDomPortal(l)),this._ariaLabelledBy=o.ariaLabelledBy||null,this._document=s}_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 i=xE(),r=this._elementRef.nativeElement;(!i||i===this._document.body||i===r||r.contains(i))&&(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=xE())}_focusDialogContainer(){this._elementRef.nativeElement.focus&&this._elementRef.nativeElement.focus()}_containsFocus(){const t=this._elementRef.nativeElement,i=xE();return t===i||t.contains(i)}}return n.\u0275fac=function(t){return new(t||n)(E(rt),E(BV),E(kn),E(ut,8),E(Hk),E(Sa))},n.\u0275dir=oe({type:n,viewQuery:function(t,i){if(1&t&&Jn(Kf,7),2&t){let r;_t(r=yt())&&(i._portalOutlet=r.first)}},features:[ct]}),n})(),fTe=(()=>{class n extends hTe{constructor(){super(...arguments),this._state="enter"}_onAnimationDone({toState:t,totalTime:i}){"enter"===t?(this._trapFocus(),this._animationStateChanged.next({state:"opened",totalTime:i})):"exit"===t&&(this._restoreFocus(),this._animationStateChanged.next({state:"closed",totalTime:i}))}_onAnimationStart({toState:t,totalTime:i}){"enter"===t?this._animationStateChanged.next({state:"opening",totalTime:i}):("exit"===t||"void"===t)&&this._animationStateChanged.next({state:"closing",totalTime:i})}_startExitAnimation(){this._state="exit",this._changeDetectorRef.markForCheck()}}return n.\u0275fac=function(){let e;return function(i){return(e||(e=$n(n)))(i||n)}}(),n.\u0275cmp=Ne({type:n,selectors:[["mat-dialog-container"]],hostAttrs:["tabindex","-1","aria-modal","true",1,"mat-dialog-container"],hostVars:6,hostBindings:function(t,i){1&t&&Qy("@dialogContainer.start",function(s){return i._onAnimationStart(s)})("@dialogContainer.done",function(s){return i._onAnimationDone(s)}),2&t&&(al("id",i._id),nn("role",i._config.role)("aria-labelledby",i._config.ariaLabel?null:i._ariaLabelledBy)("aria-label",i._config.ariaLabel)("aria-describedby",i._config.ariaDescribedBy||null),Pg("@dialogContainer",i._state))},features:[ct],decls:1,vars:0,consts:[["cdkPortalOutlet",""]],template:function(t,i){1&t&&mt(0,uTe,0,0,"ng-template",0)},directives:[Kf],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:[dTe.dialogContainer]}}),n})(),pTe=0;class Qm{constructor(e,t,i="mat-dialog-"+pTe++){this._overlayRef=e,this._containerInstance=t,this.id=i,this.disableClose=this._containerInstance._config.disableClose,this._afterOpened=new Se,this._afterClosed=new Se,this._beforeClosed=new Se,this._state=0,t._id=i,t._animationStateChanged.pipe(Fn(r=>"opened"===r.state),yi(1)).subscribe(()=>{this._afterOpened.next(),this._afterOpened.complete()}),t._animationStateChanged.pipe(Fn(r=>"closed"===r.state),yi(1)).subscribe(()=>{clearTimeout(this._closeFallbackTimeout),this._finishDialogClose()}),e.detachments().subscribe(()=>{this._beforeClosed.next(this._result),this._beforeClosed.complete(),this._afterClosed.next(this._result),this._afterClosed.complete(),this.componentInstance=null,this._overlayRef.dispose()}),e.keydownEvents().pipe(Fn(r=>27===r.keyCode&&!this.disableClose&&!Zs(r))).subscribe(r=>{r.preventDefault(),$k(this,"keyboard")}),e.backdropClick().subscribe(()=>{this.disableClose?this._containerInstance._recaptureFocus():$k(this,"mouse")})}close(e){this._result=e,this._containerInstance._animationStateChanged.pipe(Fn(t=>"closing"===t.state),yi(1)).subscribe(t=>{this._beforeClosed.next(e),this._beforeClosed.complete(),this._overlayRef.detachBackdrop(),this._closeFallbackTimeout=setTimeout(()=>this._finishDialogClose(),t.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(e){let 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}updateSize(e="",t=""){return this._overlayRef.updateSize({width:e,height:t}),this._overlayRef.updatePosition(),this}addPanelClass(e){return this._overlayRef.addPanelClass(e),this}removePanelClass(e){return this._overlayRef.removePanelClass(e),this}getState(){return this._state}_finishDialogClose(){this._state=2,this._overlayRef.dispose()}_getPositionStrategy(){return this._overlayRef.getConfig().positionStrategy}}function $k(n,e,t){return void 0!==n._containerInstance&&(n._containerInstance._closeInteractionType=e),n.close(t)}const Gk=new ve("MatDialogData"),gTe=new ve("mat-dialog-default-options"),yW=new ve("mat-dialog-scroll-strategy"),_Te={provide:yW,deps:[Jo],useFactory:function(n){return()=>n.scrollStrategies.block()}};let yTe=(()=>{class n{constructor(t,i,r,s,o,a,l,c,d){this._overlay=t,this._injector=i,this._defaultOptions=r,this._parentDialog=s,this._overlayContainer=o,this._dialogRefConstructor=l,this._dialogContainerType=c,this._dialogDataToken=d,this._openDialogsAtThisLevel=[],this._afterAllClosedAtThisLevel=new Se,this._afterOpenedAtThisLevel=new Se,this._ariaHiddenElements=new Map,this.afterAllClosed=Yb(()=>this.openDialogs.length?this._getAfterAllClosed():this._getAfterAllClosed().pipe(Rr(void 0))),this._scrollStrategy=a}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,i){(i=function(n,e){return Object.assign(Object.assign({},e),n)}(i,this._defaultOptions||new Hk)).id&&this.getDialogById(i.id);const r=this._createOverlay(i),s=this._attachDialogContainer(r,i),o=this._attachDialogContent(t,s,r,i);return this.openDialogs.length||this._hideNonDialogContentFromAssistiveTechnology(),this.openDialogs.push(o),o.afterClosed().subscribe(()=>this._removeOpenDialog(o)),this.afterOpened.next(o),s._initializeWithAttachedContent(),o}closeAll(){this._closeDialogs(this.openDialogs)}getDialogById(t){return this.openDialogs.find(i=>i.id===t)}ngOnDestroy(){this._closeDialogs(this._openDialogsAtThisLevel),this._afterAllClosedAtThisLevel.complete(),this._afterOpenedAtThisLevel.complete()}_createOverlay(t){const i=this._getOverlayConfig(t);return this._overlay.create(i)}_getOverlayConfig(t){const i=new qv({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&&(i.backdropClass=t.backdropClass),i}_attachDialogContainer(t,i){const s=Nt.create({parent:i&&i.viewContainerRef&&i.viewContainerRef.injector||this._injector,providers:[{provide:Hk,useValue:i}]}),o=new dm(this._dialogContainerType,i.viewContainerRef,s,i.componentFactoryResolver);return t.attach(o).instance}_attachDialogContent(t,i,r,s){const o=new this._dialogRefConstructor(r,i,s.id);if(t instanceof Ys)i.attachTemplatePortal(new Xf(t,null,{$implicit:s.data,dialogRef:o}));else{const a=this._createInjector(s,o,i),l=i.attachComponentPortal(new dm(t,s.viewContainerRef,a));o.componentInstance=l.instance}return o.updateSize(s.width,s.height).updatePosition(s.position),o}_createInjector(t,i,r){const s=t&&t.viewContainerRef&&t.viewContainerRef.injector,o=[{provide:this._dialogContainerType,useValue:r},{provide:this._dialogDataToken,useValue:t.data},{provide:this._dialogRefConstructor,useValue:i}];return t.direction&&(!s||!s.get(Qo,null,At.Optional))&&o.push({provide:Qo,useValue:{value:t.direction,change:ht()}}),Nt.create({parent:s||this._injector,providers:o})}_removeOpenDialog(t){const i=this.openDialogs.indexOf(t);i>-1&&(this.openDialogs.splice(i,1),this.openDialogs.length||(this._ariaHiddenElements.forEach((r,s)=>{r?s.setAttribute("aria-hidden",r):s.removeAttribute("aria-hidden")}),this._ariaHiddenElements.clear(),this._getAfterAllClosed().next()))}_hideNonDialogContentFromAssistiveTechnology(){const t=this._overlayContainer.getContainerElement();if(t.parentElement){const i=t.parentElement.children;for(let r=i.length-1;r>-1;r--){let s=i[r];s!==t&&"SCRIPT"!==s.nodeName&&"STYLE"!==s.nodeName&&!s.hasAttribute("aria-live")&&(this._ariaHiddenElements.set(s,s.getAttribute("aria-hidden")),s.setAttribute("aria-hidden","true"))}}}_closeDialogs(t){let i=t.length;for(;i--;)t[i].close()}}return n.\u0275fac=function(t){return new(t||n)(E(Jo),E(Nt),E(void 0),E(void 0),E(hm),E(void 0),E(Du),E(Du),E(ve))},n.\u0275dir=oe({type:n}),n})(),_p=(()=>{class n extends yTe{constructor(t,i,r,s,o,a,l){super(t,i,s,a,l,o,Qm,fTe,Gk)}}return n.\u0275fac=function(t){return new(t||n)(I(Jo),I(Nt),I(Xg,8),I(gTe,8),I(yW),I(n,12),I(hm))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})(),bTe=0,Wk=(()=>{class n{constructor(t,i,r){this._dialogRef=t,this._elementRef=i,this._dialog=r,this.id="mat-dialog-title-"+bTe++}ngOnInit(){this._dialogRef||(this._dialogRef=function(n,e){let t=n.nativeElement.parentElement;for(;t&&!t.classList.contains("mat-dialog-container");)t=t.parentElement;return t?e.find(i=>i.id===t.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 n.\u0275fac=function(t){return new(t||n)(E(Qm,8),E(rt),E(_p))},n.\u0275dir=oe({type:n,selectors:[["","mat-dialog-title",""],["","matDialogTitle",""]],hostAttrs:[1,"mat-dialog-title"],hostVars:1,hostBindings:function(t,i){2&t&&al("id",i.id)},inputs:{id:"id"},exportAs:["matDialogTitle"]}),n})(),qk=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275dir=oe({type:n,selectors:[["","mat-dialog-content",""],["mat-dialog-content"],["","matDialogContent",""]],hostAttrs:[1,"mat-dialog-content"]}),n})();let Qb=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({providers:[_p,_Te],imports:[[Yv,dS,On],On]}),n})();const Yk=new ve("CdkAccordion");let ETe=0,MTe=(()=>{class n{constructor(t,i,r){this.accordion=t,this._changeDetectorRef=i,this._expansionDispatcher=r,this._openCloseAllSubscription=Te.EMPTY,this.closed=new Le,this.opened=new Le,this.destroyed=new Le,this.expandedChange=new Le,this.id="cdk-accordion-child-"+ETe++,this._expanded=!1,this._disabled=!1,this._removeUniqueSelectionListener=()=>{},this._removeUniqueSelectionListener=r.listen((s,o)=>{this.accordion&&!this.accordion.multi&&this.accordion.id===o&&this.id!==s&&(this.expanded=!1)}),this.accordion&&(this._openCloseAllSubscription=this._subscribeToOpenCloseAllActions())}get expanded(){return this._expanded}set expanded(t){t=Mt(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=Mt(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 n.\u0275fac=function(t){return new(t||n)(E(Yk,12),E(kn),E(cS))},n.\u0275dir=oe({type:n,selectors:[["cdk-accordion-item"],["","cdkAccordionItem",""]],inputs:{expanded:"expanded",disabled:"disabled"},outputs:{closed:"closed",opened:"opened",destroyed:"destroyed",expandedChange:"expandedChange"},exportAs:["cdkAccordionItem"],features:[Dt([{provide:Yk,useValue:void 0}])]}),n})(),xTe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({}),n})();const TTe=["body"];function ATe(n,e){}const DTe=[[["mat-expansion-panel-header"]],"*",[["mat-action-row"]]],OTe=["mat-expansion-panel-header","*","mat-action-row"];function ITe(n,e){1&n&&tt(0,"span",2),2&n&&ie("@indicatorRotate",Qe()._getExpandedState())}const PTe=[[["mat-panel-title"]],[["mat-panel-description"]],"*"],RTe=["mat-panel-title","mat-panel-description","*"],Xk=new ve("MAT_ACCORDION"),bW="225ms cubic-bezier(0.4,0.0,0.2,1)",CW={indicatorRotate:tc("indicatorRotate",[wr("collapsed, void",ti({transform:"rotate(0deg)"})),wr("expanded",ti({transform:"rotate(180deg)"})),Qs("expanded <=> collapsed, void => collapsed",Ao(bW))]),bodyExpansion:tc("bodyExpansion",[wr("collapsed, void",ti({height:"0px",visibility:"hidden"})),wr("expanded",ti({height:"*",visibility:"visible"})),Qs("expanded <=> collapsed, void => collapsed",Ao(bW))])};let kTe=(()=>{class n{constructor(t){this._template=t}}return n.\u0275fac=function(t){return new(t||n)(E(Ys))},n.\u0275dir=oe({type:n,selectors:[["ng-template","matExpansionPanelContent",""]]}),n})(),FTe=0;const wW=new ve("MAT_EXPANSION_PANEL_DEFAULT_OPTIONS");let qM=(()=>{class n extends MTe{constructor(t,i,r,s,o,a,l){super(t,i,r),this._viewContainerRef=s,this._animationMode=a,this._hideToggle=!1,this.afterExpand=new Le,this.afterCollapse=new Le,this._inputChanges=new Se,this._headerId="mat-expansion-panel-header-"+FTe++,this._bodyAnimationDone=new Se,this.accordion=t,this._document=o,this._bodyAnimationDone.pipe(Zo((c,d)=>c.fromState===d.fromState&&c.toState===d.toState)).subscribe(c=>{"void"!==c.fromState&&("expanded"===c.toState?this.afterExpand.emit():"collapsed"===c.toState&&this.afterCollapse.emit())}),l&&(this.hideToggle=l.hideToggle)}get hideToggle(){return this._hideToggle||this.accordion&&this.accordion.hideToggle}set hideToggle(t){this._hideToggle=Mt(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(Rr(null),Fn(()=>this.expanded&&!this._portal),yi(1)).subscribe(()=>{this._portal=new Xf(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,i=this._body.nativeElement;return t===i||i.contains(t)}return!1}}return n.\u0275fac=function(t){return new(t||n)(E(Xk,12),E(kn),E(cS),E(ns),E(ut),E(Do,8),E(wW,8))},n.\u0275cmp=Ne({type:n,selectors:[["mat-expansion-panel"]],contentQueries:function(t,i,r){if(1&t&&ei(r,kTe,5),2&t){let s;_t(s=yt())&&(i._lazyContent=s.first)}},viewQuery:function(t,i){if(1&t&&Jn(TTe,5),2&t){let r;_t(r=yt())&&(i._body=r.first)}},hostAttrs:[1,"mat-expansion-panel"],hostVars:6,hostBindings:function(t,i){2&t&&st("mat-expanded",i.expanded)("_mat-animation-noopable","NoopAnimations"===i._animationMode)("mat-expansion-panel-spacing",i._hasSpacing())},inputs:{disabled:"disabled",expanded:"expanded",hideToggle:"hideToggle",togglePosition:"togglePosition"},outputs:{opened:"opened",closed:"closed",expandedChange:"expandedChange",afterExpand:"afterExpand",afterCollapse:"afterCollapse"},exportAs:["matExpansionPanel"],features:[Dt([{provide:Xk,useValue:void 0}]),ct,zn],ngContentSelectors:OTe,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,i){1&t&&(wi(DTe),Ht(0),R(1,"div",0,1),ge("@bodyExpansion.done",function(s){return i._bodyAnimationDone.next(s)}),R(3,"div",2),Ht(4,1),mt(5,ATe,0,0,"ng-template",3),k(),Ht(6,2),k()),2&t&&(G(1),ie("@bodyExpansion",i._getExpandedState())("id",i.id),nn("aria-labelledby",i._headerId),G(4),ie("cdkPortalOutlet",i._portal))},directives:[Kf],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:[CW.bodyExpansion]},changeDetection:0}),n})();class LTe{}const BTe=Hf(LTe);let YM=(()=>{class n extends BTe{constructor(t,i,r,s,o,a,l){super(),this.panel=t,this._element=i,this._focusMonitor=r,this._changeDetectorRef=s,this._animationMode=a,this._parentChangeSubscription=Te.EMPTY;const c=t.accordion?t.accordion._stateChanges.pipe(Fn(d=>!(!d.hideToggle&&!d.togglePosition))):ec;this.tabIndex=parseInt(l||"")||0,this._parentChangeSubscription=Ni(t.opened,t.closed,c,t._inputChanges.pipe(Fn(d=>!!(d.hideToggle||d.disabled||d.togglePosition)))).subscribe(()=>this._changeDetectorRef.markForCheck()),t.closed.pipe(Fn(()=>t._containsFocus())).subscribe(()=>r.focusVia(i,"program")),o&&(this.expandedHeight=o.expandedHeight,this.collapsedHeight=o.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:Zs(t)||(t.preventDefault(),this._toggle());break;default:return void(this.panel.accordion&&this.panel.accordion._handleHeaderKeydown(t))}}focus(t,i){t?this._focusMonitor.focusVia(this._element,t,i):this._element.nativeElement.focus(i)}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 n.\u0275fac=function(t){return new(t||n)(E(qM,1),E(rt),E(Sa),E(kn),E(wW,8),E(Do,8),Zr("tabindex"))},n.\u0275cmp=Ne({type:n,selectors:[["mat-expansion-panel-header"]],hostAttrs:["role","button",1,"mat-expansion-panel-header","mat-focus-indicator"],hostVars:15,hostBindings:function(t,i){1&t&&ge("click",function(){return i._toggle()})("keydown",function(s){return i._keydown(s)}),2&t&&(nn("id",i.panel._headerId)("tabindex",i.tabIndex)("aria-controls",i._getPanelId())("aria-expanded",i._isExpanded())("aria-disabled",i.panel.disabled),vf("height",i._getHeaderHeight()),st("mat-expanded",i._isExpanded())("mat-expansion-toggle-indicator-after","after"===i._getTogglePosition())("mat-expansion-toggle-indicator-before","before"===i._getTogglePosition())("_mat-animation-noopable","NoopAnimations"===i._animationMode))},inputs:{tabIndex:"tabIndex",expandedHeight:"expandedHeight",collapsedHeight:"collapsedHeight"},features:[ct],ngContentSelectors:RTe,decls:5,vars:1,consts:[[1,"mat-content"],["class","mat-expansion-indicator",4,"ngIf"],[1,"mat-expansion-indicator"]],template:function(t,i){1&t&&(wi(PTe),R(0,"span",0),Ht(1),Ht(2,1),Ht(3,2),k(),mt(4,ITe,1,1,"span",1)),2&t&&(G(4),ie("ngIf",i._showToggle()))},directives:[zr],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:[CW.indicatorRotate]},changeDetection:0}),n})(),EW=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275dir=oe({type:n,selectors:[["mat-panel-title"]],hostAttrs:[1,"mat-expansion-panel-header-title"]}),n})(),Kk=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,On,xTe,dS]]}),n})();var SW=ze(478);Object.create(Error.prototype);const UTe=["*"];var KM=(()=>(function(n){n.LineHighlight="line-highlight",n.LineNumbers="line-numbers"}(KM||(KM={})),KM))();class $Te{}const xW=new ve("SECURITY_CONTEXT");let Zk=(()=>{class n{constructor(t,i,r,s,o){this.platform=t,this.securityContext=i,this.http=r,this.sanitizer=o,this.initialMarkedOptions={renderer:new SW.Renderer},this.options=s}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,i=!1,r=!1,s=this.options){const o=this.trimIndentation(t),a=i?this.decodeHtml(o):o,l=r?this.renderEmoji(a):a,c=SW.parse(l,s);return this.sanitizer.sanitize(this.securityContext,c)||""}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(Ae(i=>this.handleExtension(t,i)))}highlight(t){if(Of(this.platform)&&"undefined"!=typeof Prism){t||(t=document);const i=t.querySelectorAll('pre code:not([class*="language-"])');Array.prototype.forEach.call(i,r=>r.classList.add("language-none")),Prism.highlightAllUnder(t)}}renderKatex(t,i){if(!Of(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,(r,s)=>katex.renderToString(s,i))}decodeHtml(t){if(!Of(this.platform))return t;const i=document.createElement("textarea");return i.innerHTML=t,i.value}handleExtension(t,i){const r=t?t.split("?")[0].split(".").splice(-1).join():"";return"md"!==r?"```"+r+"\n"+i+"\n```":i}renderEmoji(t){if(!Of(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 i;return t.split("\n").map(r=>{let s=i;return r.length>0&&(s=isNaN(s)?r.search(/\S|$/):Math.min(r.search(/\S|$/),s)),isNaN(i)&&(i=s),s?r.substring(s):r}).join("\n")}}return n.\u0275fac=function(t){return new(t||n)(I(dl),I(xW),I(Wf,8),I($Te,8),I(th))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})(),TW=(()=>{class n{constructor(t,i){this.element=t,this.markdownService=i,this.error=new Le,this.load=new Le,this.ready=new Le,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,i=!1){let r=this.markdownService.compile(t,i,this.emoji);r=this.katex?this.markdownService.renderKatex(r,this.katexOptions):r,this.element.nativeElement.innerHTML=r,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,KM.LineNumbers),this.setPluginOptions(this.element.nativeElement,{dataStart:this.start}))}setPluginClass(t,i){const r=t.querySelectorAll("pre");for(let s=0;s{const a=i[o];if(a){const l=this.toLispCase(o);r.item(s).setAttribute(l,a.toString())}})}toLispCase(t){const i=t.match(/([A-Z])/g);if(!i)return t;let r=t.toString();for(let s=0,o=i.length;s{class n{static forRoot(t){return{ngModule:n,providers:[Zk,t&&t.loader||[],t&&t.markedOptions||[],{provide:xW,useValue:t&&null!=t.sanitize?t.sanitize:mn.HTML}]}}static forChild(){return{ngModule:n}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({}),n})();function AW(n,e,t){return t?AW(n,e).pipe(Ae(i=>we(i)?t(...i):t(i))):new ce(i=>{const r=(...o)=>i.next(1===o.length?o[0]:o);let s;try{s=n(r)}catch(o){return void i.error(o)}if(Ke(e))return()=>e(r,s)})}function ZM(...n){return e=>{let t;return"function"==typeof n[n.length-1]&&(t=n.pop()),e.lift(new ZTe(n,t))}}class ZTe{constructor(e,t){this.observables=e,this.project=t}call(e,t){return t.subscribe(new QTe(e,this.observables,this.project))}}class QTe extends cU{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)}}class JTe{constructor(e,t,i=!1){this.accumulator=e,this.seed=t,this.hasSeed=i}call(e,t){return t.subscribe(new eAe(e,this.accumulator,this.seed,this.hasSeed))}}class eAe extends xt{constructor(e,t,i,r){super(e),this.accumulator=t,this._seed=i,this.hasSeed=r,this.index=0}get seed(){return this._seed}set seed(e){this.hasSeed=!0,this._seed=e}_next(e){if(this.hasSeed)return this._tryNext(e);this.seed=e,this.destination.next(e)}_tryNext(e){const t=this.index++;let i;try{i=this.accumulator(this.seed,e,t)}catch(r){this.destination.error(r)}this.seed=i,this.destination.next(i)}}class iAe{constructor(e){this.predicate=e}call(e,t){return t.subscribe(new rAe(e,this.predicate))}}class rAe extends xt{constructor(e,t){super(e),this.predicate=t,this.skipping=!0,this.index=0}_next(e){const t=this.destination;this.skipping&&this.tryCallPredicate(e),this.skipping||t.next(e)}tryCallPredicate(e){try{const t=this.predicate(e,this.index++);this.skipping=Boolean(t)}catch(t){this.destination.error(t)}}}const sAe=["youtubeContainer"];let IW=(()=>{class n{constructor(t,i){this._ngZone=t,this._youtubeContainer=new Se,this._destroyed=new Se,this._playerChanges=new ar(void 0),this._videoId=new ar(void 0),this._height=new ar(390),this._width=new ar(640),this._startSeconds=new ar(void 0),this._endSeconds=new ar(void 0),this._suggestedQuality=new ar(void 0),this._playerVars=new ar(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=Of(i)}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=ht(!0);if(!window.YT||!window.YT.Player){const r=new Se;this._existingApiReadyCallback=window.onYouTubeIframeAPIReady,window.onYouTubeIframeAPIReady=()=>{this._existingApiReadyCallback&&this._existingApiReadyCallback(),this._ngZone.run(()=>r.next(!0))},t=r.pipe(yi(1),Rr(!1))}const i=function(n,e,t,i,r,s,o){const a=Qi([e,s]).pipe(ZM(Qi([i,r])),Ae(([l,c])=>{const[d,f]=l,[p,g]=c;return d?{videoId:d,playerVars:f,width:p,height:g}:void 0}));return Qi([n,a,ht(o)]).pipe(function(n){return Mr(function(...n){let e=null;return"function"==typeof n[n.length-1]&&(e=n.pop()),1===n.length&&we(n[0])&&(n=n[0].slice()),t=>t.lift.call(ui([t,...n]),new hU(e))}(n),function(n){return e=>e.lift(new iAe(n))}(([e,t])=>!t),Ae(([e])=>e))}(t),function(n,e){let t=!1;return arguments.length>=2&&(t=!0),function(r){return r.lift(new JTe(n,e,t))}}(dAe,void 0),Zo())}(this._youtubeContainer,this._videoId,t,this._width,this._height,this._playerVars,this._ngZone).pipe(Ti(r=>{this._playerChanges.next(r)}),di(e=>e?PW(e)?ht(e):new ce(t=>{let i=!1,r=!1;const s=o=>{r=!0,i||(o.target.removeEventListener("onReady",s),t.next(o.target))};return e.addEventListener("onReady",s),()=>{i=!0,r||(r=>{PW(r)||r.destroy()})(e)}}).pipe(yi(1),Rr(void 0)):ht(void 0)),Tn(this._destroyed),mc(new Se));i.subscribe(r=>{this._player=r,r&&this._pendingPlayerState&&this._initializePlayer(r,this._pendingPlayerState),this._pendingPlayerState=void 0}),function(n,e,t){Qi([n,e,t]).subscribe(([i,r,s])=>i&&i.setSize(r,s))}(i,this._width,this._height),function(n,e){Qi([n,e]).subscribe(([t,i])=>t&&i&&t.setPlaybackQuality(i))}(i,this._suggestedQuality),function(n,e,t,i,r,s){const o=Qi([t,i]).pipe(Ae(([d,f])=>({startSeconds:d,endSeconds:f}))),a=o.pipe(Jk(n,d=>!!d&&!function(n){const e=n.getPlayerState();return e!==YT.PlayerState.UNSTARTED&&e!==YT.PlayerState.CUED}(d))),l=e.pipe(Jk(n,(d,f)=>!!d&&d.videoId!==f));Ni(n.pipe(Jk(Qi([e,o]),([d,f],p)=>!(!p||d==p.videoId&&!f.startSeconds&&!f.endSeconds))),l,a).pipe(ZM(Qi([n,e,o,r])),Ae(([d,f])=>f),Tn(s)).subscribe(([d,f,p,g])=>{!f||!d||(d.videoId=f,d.cueVideoById(Object.assign({videoId:f,suggestedQuality:g},p)))})}(i,this._videoId,this._startSeconds,this._endSeconds,this._suggestedQuality,this._destroyed),i.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,i){this._player?this._player.seekTo(t,i):this._getPendingState().seek={seconds:t,allowSeekAhead:i}}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,i){const{playbackState:r,playbackRate:s,volume:o,muted:a,seek:l}=i;switch(r){case YT.PlayerState.PLAYING:t.playVideo();break;case YT.PlayerState.PAUSED:t.pauseVideo();break;case YT.PlayerState.CUED:t.stopVideo()}null!=s&&t.setPlaybackRate(s),null!=o&&t.setVolume(o),null!=a&&(a?t.mute():t.unMute()),null!=l&&t.seekTo(l.seconds,l.allowSeekAhead)}_getLazyEmitter(t){return this._playerChanges.pipe(Pr(i=>i?AW(r=>{i.addEventListener(t,r)},r=>{try{i.removeEventListener&&i.removeEventListener(t,r)}catch(s){}}):ht()),i=>new ce(r=>i.subscribe({next:s=>this._ngZone.run(()=>r.next(s)),error:s=>r.error(s),complete:()=>r.complete()})),Tn(this._destroyed))}}return n.\u0275fac=function(t){return new(t||n)(E(dt),E(dl))},n.\u0275cmp=Ne({type:n,selectors:[["youtube-player"]],viewQuery:function(t,i){if(1&t&&Jn(sAe,5),2&t){let r;_t(r=yt())&&(i.youtubeContainer=r.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,i){1&t&&tt(0,"div",null,0)},encapsulation:2,changeDetection:0}),n})();function dAe(n,[e,t,i]){if(n&&t&&n.playerVars!==t.playerVars)n.destroy();else{if(!t)return void(n&&n.destroy());if(n)return n}const r=i.runOutsideAngular(()=>new YT.Player(e,t));return r.videoId=t.videoId,r.playerVars=t.playerVars,r}function PW(n){return"getPlayerStatus"in n}function Jk(n,e){return Mr(ZM(n),Fn(([t,i])=>e(i,t)),Ae(([t])=>t))}let pAe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({}),n})(),CAe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275dir=oe({type:n,selectors:[["","mat-card-sm-image",""],["","matCardImageSmall",""]],hostAttrs:[1,"mat-card-sm-image"]}),n})();function e0(n){return!0===n}function so(n){return null==n}function ka(n){return!so(n)}function eF(n){return Boolean(n)}function NW(n){return so(n)?n:JSON.parse(JSON.stringify(n))}const JM=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])&&JM(n[o])}),n};function LW(n){return ka(n)&&"object"==typeof n&&function(n){return"[object Object]"===Object.prototype.toString.call(n)}(n)}const zW="NGXS_DATA_META",nF="NGXS_META",jW="NGXS_ARGUMENT_REGISTRY_META";let UW=(()=>{class n{constructor(t){this.sequence$=new ar(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)(I(cu,8))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();function t0(n){return n[zW]}let Fa=(()=>{class n{constructor(t,i,r){n.store=t.get(cu),n.ngZone=t.get(dt),n.factory=i,n.context=r,n.computed=t.get(UW)}}return n.store=null,n.computed=null,n.context=null,n.factory=null,n.ngZone=null,n.\u0275fac=function(t){return new(t||n)(I(Nt),I(B$),I(L$))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();class Fr{constructor(){Fr.statesCachedMeta.clear()}static createStateContext(e){return Fa.context.createStateContext(e)}static ensureMappedState(e){if(so(Fa.factory)||so(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)?Fr.statesCachedMeta.get(e.name):null)||Fr.ensureMeta(e)}static getRepositoryByInstance(e){var t;const r=null!==(t=t0(Fr.getStateClassByInstance(e)))&&void 0!==t?t:null;if(so(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=Fr.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=Fr.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=Fa.factory.states)||void 0===t?void 0:t.find(r=>r.name===e.name):null;return ka(i)&&ka(e.name)&&Fr.statesCachedMeta.set(e.name,i),i}}Fr.statesCachedMeta=new Map,Fr.\u0275fac=function(e){return new(e||Fr)},Fr.\u0275prov=ue({token:Fr,factory:Fr.\u0275fac}),new If(1);class $Ae 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 HW(n){var e;return null!==(e=n.NGXS_OPTIONS_META)&&void 0!==e?e:{name:""}}function $W(n){var e;const t=HW(n),i=null!==(e=t.children)&&void 0!==e?e:[],s=NW(void 0===t.defaults?{}:t.defaults);if(i.length){if(LW(s))return function(n,e){return e.reduce((t,i)=>{const r=HW(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()]=$W(i),t},null!=n?n:{})}(s,i);throw new $Ae(s)}return s}function WW(n){var e;return null!==(e=n.__NGXS_COMPUTED_OPTION__)&&void 0!==e?e:null}function qW(){var n,e;return null!==(e=null===(n=null==Fa?void 0:Fa.computed)||void 0===n?void 0:n.sequenceValue)&&void 0!==e?e:0}function YAe(n){let e=!1;return cm(n)&&(e=!0),e}function iF(n){return n[jW]}class XAe extends Error{constructor(e,t){super(`An argument with the name '${e}' already exists in the method '${t}'`)}}class KAe{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(eF(this.argumentMap.has(e))||eF(this.payloadMap.has(e)))throw new XAe(e,t)}}function rF(n){return Mo()?JM(n):n}function tDe(n){return{enumerable:!0,configurable:!0,get(){const e=t0(n),t=Fr.ensureMappedState(e.stateMeta);return Fr.createStateContext(t)}}}function sF(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:()=>Mo()?JM(n.getState()):n.getState(),setState(e){n.setState(e)},patchState(e){n.patchState(e)}})}function oi(){return(n,e,t)=>{!function(n,e){if(!function(n,e){var t;let i=n,r=!1;if(LW(i))for(;null!==i;){if(e0(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 so(WW(n))&&Object.defineProperties(n,{__NGXS_COMPUTED_OPTION__:{enumerable:!0,configurable:!0,value:new WeakMap}}),WW(n)}(this),o=null==s?void 0:s.get(i);if(e0(null==o?void 0:o.isObservable))return null==o?void 0:o.value;if(so(o)||o.sequenceId!==qW()){s.delete(i);const l=i.apply(this,r);return s.set(i,{value:l,sequenceId:qW(),isObservable:YAe(l)}),l}return o.value},t}}const oDe={cancelUncompleted:!0,insideZone:!1};function on(n=oDe){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=Fr.getRepositoryByInstance(a),d=c.operations;let f=d[s];const p=c.stateMeta,g=iF(r);if(so(f)){const w=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),x=function(n){const{statePath:e,argumentsNames:t,methodName:i,argumentRegistry:r}=n;let s="";for(let o=0;o{var w;return e0(n.insideZone)?null===(w=Fa.ngZone)||void 0===w||w.run(()=>{l=r.apply(a,o)}):l=r.apply(a,o),cm(l)?ht(null).pipe(Ae(()=>l)):l};const v=Fr.createAction(f,o,g),C=Fa.store.dispatch(v);return cm(l)?function(n,e){return Hv([n,e]).pipe(Ae(t=>t.pop()))}(C,l):l},i}}function Ms(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 so(iF(t))&&Object.defineProperties(t,{[jW]:{enumerable:!0,configurable:!0,value:new KAe}}),iF(t)})(e,t).createPayloadType(r,t,i)}}function xh(){return n=>{const e=function(n){if(function(n){return!eF(n)}(n.hasOwnProperty(nF))){const e={name:null,actions:{},defaults:{},path:null,makeRootSelector:t=>t.getStateGetter(e.name),children:[]};Object.defineProperty(n,nF,{value:e})}return function(n){var e;return null===(e=n)||void 0===e?void 0:e[nF]}(n)}(n);if(so(e.name))throw new Error("@StateRepository should be add before decorator @State");!function(n,e){(function(n){var e;const t=null!==(e=t0(n))&&void 0!==e?e:null;return(so(t)||(null==t?void 0:t.stateClass)!==n)&&function(n){Object.defineProperty(n,zW,{writable:!0,configurable:!0,enumerable:!0,value:{stateMeta:null,operations:{},stateClass:n}})}(n),t0(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:()=>NW(t)},context:tDe(n)})}(n,e,$W(n)),function(n){var e,t;const i=t0(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(so(Fa.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]=Fa.store.select(n).pipe(Ae(o=>Mo()?JM(o):o),qc({refCount:!0,bufferSize:1})),this[s]}}})}}(n)}}var tx=(()=>(function(n){n.ID="id"}(tx||(tx={})),tx))(),n0=(()=>(function(n){n.ASC="asc",n.DESC="desc"}(n0||(n0={})),n0))();let oF=(()=>{class n{constructor(){this.browserStorageEvents$=new Se,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=ue({token:n,factory:n.\u0275fac}),n})(),cDe=(()=>{class n extends oF{get snapshot(){return rF(this.getState())}get ctx(){return sF(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=$n(n)))(i||n)}}(),n.\u0275prov=ue({token:n,factory:n.\u0275fac}),xe([oi(),Xe("design:type",Object),Xe("design:paramtypes",[])],n.prototype,"snapshot",null),xe([on(),ws(0,Ms("patchValue")),Xe("design:type",Function),Xe("design:paramtypes",[Object]),Xe("design:returntype",void 0)],n.prototype,"patchState",null),xe([on(),ws(0,Ms("stateValue")),Xe("design:type",Function),Xe("design:paramtypes",[Object]),Xe("design:returntype",void 0)],n.prototype,"setState",null),xe([on(),Xe("design:type",Function),Xe("design:paramtypes",[]),Xe("design:returntype",void 0)],n.prototype,"reset",null),n})(),uDe=(()=>{class n extends oF{constructor(){super(...arguments),this.primaryKey=tx.ID,this.comparator=null}get snapshot(){return rF(this.getState())}get ids(){return this.snapshot.ids}get entities(){return this.snapshot.entities}get entitiesArray(){const t=this.snapshot;return t.ids.map(i=>t.entities[i])}get ids$(){return this.state$.pipe(Ae(t=>t.ids))}get entities$(){return this.state$.pipe(Ae(t=>t.entities))}get entitiesArray$(){return this.state$.pipe(Ae(t=>t.ids.map(i=>t.entities[i])))}get ctx(){return sF(this.context)}setComparator(t){return this.comparator=t,this}dispatch(t){return this.ctx.dispatch(t)}getState(){return this.ctx.getState()}selectId(t){var i;return null===(i=t)||void 0===i?void 0:i[this.primaryKey]}selectOne(t){var i;return null!==(i=this.snapshot.entities[t])&&void 0!==i?i:null}selectAll(){const t=this.getState();return t.ids.map(i=>t.entities[i])}reset(){this.setEntitiesState(this.initialState),this.markAsDirtyAfterReset()}addOne(t){this.addEntityOne(t)}addMany(t){this.addEntitiesMany(t)}setOne(t){this.setEntityOne(t)}setMany(t){this.setEntitiesMany(t)}setAll(t){this.setEntitiesAll(t)}updateOne(t){this.updateEntitiesMany([t])}updateMany(t){this.updateEntitiesMany(t)}upsertOne(t){this.upsertEntitiesMany([t])}upsertMany(t){this.upsertEntitiesMany(t)}removeOne(t){this.removeEntitiesMany([t])}removeMany(t){this.removeEntitiesMany(t)}removeByEntity(t){const i=this.selectId(t);this.removeEntitiesMany([i])}removeByEntities(t){const i=[];for(const r of t){const s=this.selectId(r);i.push(s)}this.removeEntitiesMany(i)}removeAll(){this.setEntitiesState(this.initialState)}sort(t){this.comparator=null!=t?t:this.comparator,so(this.comparator)?console.warn("You must set the compare function before sorting."):this.setEntitiesState(this.getState())}addEntityOne(t){const i=this.getState(),r=this.selectIdValue(t);r in i.entities||this.setEntitiesState(Object.assign(Object.assign({},i),{ids:[...i.ids,r],entities:Object.assign(Object.assign({},i.entities),{[r]:t})}))}addEntitiesMany(t){const i=this.getState(),r={},s=[];for(const o of t){const a=this.selectIdValue(o);a in i.entities||a in r||(s.push(a),r[a]=o)}s.length&&this.setEntitiesState(Object.assign(Object.assign({},i),{ids:[...i.ids,...s],entities:Object.assign(Object.assign({},i.entities),r)}))}setEntitiesAll(t){const i=this.getState(),r={},s=[];for(const o of t){const a=this.selectIdValue(o);a in r||(s.push(a),r[a]=o)}this.setEntitiesState(Object.assign(Object.assign({},i),{ids:s,entities:r}))}setEntityOne(t){const i=this.getState(),r=this.selectIdValue(t);this.setEntitiesState(Object.assign(Object.assign({},i),r in i.entities?{entities:Object.assign(Object.assign({},i.entities),{[r]:t})}:{ids:[...i.ids,r],entities:Object.assign(Object.assign({},i.entities),{[r]:t})}))}setEntitiesMany(t){for(const i of t)this.setEntityOne(i)}updateEntitiesMany(t){const i=this.getState(),r=t.filter(a=>a.id in i.entities);if(0===r.length)return;const s=this.generateKeyMap(i),o=Object.assign({},i.entities);for(const a of r){const l=this.updateOrigin(o,a),c=this.selectIdValue(l);c!==a.id&&(delete s[a.id],delete o[a.id]),s[a.id]=c,o[c]=l}this.setEntitiesState(Object.assign(Object.assign({},i),{ids:i.ids.map(a=>{var l;return null!==(l=s[a])&&void 0!==l?l:a}),entities:o}))}upsertEntitiesMany(t){const i=this.getState(),r=[],s=[];for(const o of t){const a=this.selectIdValue(o);a in i.entities?r.push({id:a,changes:o}):s.push(o)}this.updateMany(r),this.addMany(s)}removeEntitiesMany(t){const i=this.getState(),r=this.generateKeyMap(i),s=Object.assign({},i.entities);for(const o of t)o in s&&(delete r[o],delete s[o]);this.setEntitiesState(Object.assign(Object.assign({},i),{ids:i.ids.filter(o=>o in r),entities:s}))}setEntitiesState(t){const i=this.sortKeysByComparator(t.ids,t.entities);this.ctx.setState(Object.assign(Object.assign({},t),{ids:i,entities:t.entities}))}sortKeysByComparator(t,i){if(so(this.comparator))return t;const r=t.slice(),s=this.comparator;return"function"==typeof s?r.sort((o,a)=>s(i[o],i[a])):this.sortByComparatorOptions(r,s,i)}sortByComparatorOptions(t,i,r){switch(null==i?void 0:i.sortByOrder){case n0.ASC:return t.sort((s,o)=>function(n,e,t){return(null==e?void 0:e[n])>(null==t?void 0:t[n])?1:(null==e?void 0:e[n])<(null==t?void 0:t[n])?-1:0}(null==i?void 0:i.sortBy,r[s],r[o]));case n0.DESC:return t.sort((s,o)=>function(n,e,t){return(null==e?void 0:e[n])>(null==t?void 0:t[n])?-1:(null==e?void 0:e[n])<(null==t?void 0:t[n])?1:0}(null==i?void 0:i.sortBy,r[s],r[o]));default:return Mo()&&console.warn(`Invalid --\x3e { sortByOrder: "${null==i?void 0:i.sortByOrder}" } not supported!`),t}}generateKeyMap(t){return t.ids.reduce((i,r)=>(i[r]=r,i),{})}updateOrigin(t,i){return Object.assign(Object.assign({},t[i.id]),i.changes)}selectIdValue(t){const i=this.selectId(t);return so(i)&&Mo()&&console.warn(`The entity passed to the 'selectId' implementation returned ${i}.`,"You should probably provide your own 'selectId' implementation.","The entity that was passed:",t,"The current `selectId` implementation: (entity: V): K => entity.id"),i}}return n.\u0275fac=function(){let e;return function(i){return(e||(e=$n(n)))(i||n)}}(),n.\u0275prov=ue({token:n,factory:n.\u0275fac}),xe([oi(),Xe("design:type",Object),Xe("design:paramtypes",[])],n.prototype,"snapshot",null),xe([oi(),Xe("design:type",Array),Xe("design:paramtypes",[])],n.prototype,"ids",null),xe([oi(),Xe("design:type",Object),Xe("design:paramtypes",[])],n.prototype,"entities",null),xe([oi(),Xe("design:type",Array),Xe("design:paramtypes",[])],n.prototype,"entitiesArray",null),xe([oi(),Xe("design:type",ce),Xe("design:paramtypes",[])],n.prototype,"ids$",null),xe([oi(),Xe("design:type",ce),Xe("design:paramtypes",[])],n.prototype,"entities$",null),xe([oi(),Xe("design:type",ce),Xe("design:paramtypes",[])],n.prototype,"entitiesArray$",null),xe([on(),Xe("design:type",Function),Xe("design:paramtypes",[]),Xe("design:returntype",void 0)],n.prototype,"reset",null),xe([on(),ws(0,Ms("entity")),Xe("design:type",Function),Xe("design:paramtypes",[Object]),Xe("design:returntype",void 0)],n.prototype,"addOne",null),xe([on(),ws(0,Ms("entities")),Xe("design:type",Function),Xe("design:paramtypes",[Array]),Xe("design:returntype",void 0)],n.prototype,"addMany",null),xe([on(),ws(0,Ms("entity")),Xe("design:type",Function),Xe("design:paramtypes",[Object]),Xe("design:returntype",void 0)],n.prototype,"setOne",null),xe([on(),ws(0,Ms("entities")),Xe("design:type",Function),Xe("design:paramtypes",[Array]),Xe("design:returntype",void 0)],n.prototype,"setMany",null),xe([on(),ws(0,Ms("entities")),Xe("design:type",Function),Xe("design:paramtypes",[Array]),Xe("design:returntype",void 0)],n.prototype,"setAll",null),xe([on(),ws(0,Ms("update")),Xe("design:type",Function),Xe("design:paramtypes",[Object]),Xe("design:returntype",void 0)],n.prototype,"updateOne",null),xe([on(),ws(0,Ms("updates")),Xe("design:type",Function),Xe("design:paramtypes",[Array]),Xe("design:returntype",void 0)],n.prototype,"updateMany",null),xe([on(),ws(0,Ms("entity")),Xe("design:type",Function),Xe("design:paramtypes",[Object]),Xe("design:returntype",void 0)],n.prototype,"upsertOne",null),xe([on(),ws(0,Ms("entities")),Xe("design:type",Function),Xe("design:paramtypes",[Array]),Xe("design:returntype",void 0)],n.prototype,"upsertMany",null),xe([on(),ws(0,Ms("id")),Xe("design:type",Function),Xe("design:paramtypes",[Object]),Xe("design:returntype",void 0)],n.prototype,"removeOne",null),xe([on(),ws(0,Ms("ids")),Xe("design:type",Function),Xe("design:paramtypes",[Array]),Xe("design:returntype",void 0)],n.prototype,"removeMany",null),xe([on(),ws(0,Ms("entity")),Xe("design:type",Function),Xe("design:paramtypes",[Object]),Xe("design:returntype",void 0)],n.prototype,"removeByEntity",null),xe([on(),ws(0,Ms("entities")),Xe("design:type",Function),Xe("design:paramtypes",[Array]),Xe("design:returntype",void 0)],n.prototype,"removeByEntities",null),xe([on(),Xe("design:type",Function),Xe("design:paramtypes",[]),Xe("design:returntype",void 0)],n.prototype,"removeAll",null),xe([on(),ws(0,Ms("comparator")),Xe("design:type",Function),Xe("design:paramtypes",[Object]),Xe("design:returntype",void 0)],n.prototype,"sort",null),n})(),Jm=(()=>{class n extends oF{get snapshot(){return rF(this.getState())}get ctx(){return sF(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=$n(n)))(i||n)}}(),n.\u0275prov=ue({token:n,factory:n.\u0275fac}),xe([oi(),Xe("design:type",Object),Xe("design:paramtypes",[])],n.prototype,"snapshot",null),xe([on(),ws(0,Ms("patchValue")),Xe("design:type",Function),Xe("design:paramtypes",[Object]),Xe("design:returntype",void 0)],n.prototype,"patchState",null),xe([on(),ws(0,Ms("stateValue")),Xe("design:type",Function),Xe("design:paramtypes",[Object]),Xe("design:returntype",void 0)],n.prototype,"setState",null),xe([on(),Xe("design:type",Function),Xe("design:paramtypes",[]),Xe("design:returntype",void 0)],n.prototype,"reset",null),n})();function aF(){return Fn(n=>null!=n)}const dDe={};function lF(...n){const e=n[n.length-1];let t=n,i=dDe;return"object"==typeof e&&(i=e,t=t.slice(0,-1)),r=>r.pipe(ur(...t),Zo(i.compare),qc(1))}const s_=new ve("ngx-google-analytics-settings",{factory:()=>({trackingCode:"",enableTracing:!1})}),IF=new ve("ngx-window",{providedIn:"root",factory:()=>function(n){return Of(n)?window:null}(Oc(dl))}),wIe=new ve("ngx-data-layer",{providedIn:"root",factory:()=>function(n){return n?n.dataLayer=n.dataLayer||[]:null}(Oc(IF))}),PF=new ve("ngx-gtag-fn",{providedIn:"root",factory:()=>function(n,e){return n?n.gtag=n.gtag||function(){e.push(arguments)}:null}(Oc(IF),Oc(wIe))});let xs=(()=>{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||Mo())&&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)(I(s_),I(ut),I(PF))},n.\u0275prov=ue({factory:function(){return new n(I(s_),I(ut),I(PF))},token:n,providedIn:"root"}),n})();const MIe={provide:Mf,multi:!0,useFactory:function(n,e,t){return()=>yl(this,void 0,void 0,function*(){var i;if(!n.trackingCode)return void(Mo()||console.error("Empty tracking code for Google Analytics. Make sure to provide one when initializing NgxGoogleAnalyticsModule."));if(!e)return void(Mo()||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||Mo()||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:[s_,PF,ut]};new ve("ngx-google-analytics-routing-settings",{factory:()=>({})});let RF=(()=>{class n{static forRoot(t,i=[],r,s,o){return{ngModule:n,providers:[{provide:s_,useValue:{trackingCode:t,initCommands:i,uri:r,enableTracing:s,nonce:o}},MIe]}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[]]}),n})(),f0=(()=>{class n{constructor(){this.consent="not-set",this.consentChange=new If(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=ue({token:n,factory:n.\u0275fac}),n})(),DIe=(()=>{class n{constructor(t,i,{trackingCode:r}){this.window=i,this.subscriptions=new Te,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)(I(f0),I(IF),I(s_))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();const OIe=new ve("Key under which consent is stored",{providedIn:"root",factory:()=>"ALLOW_TELEMETRY"}),Kq=[f0,DIe,(()=>{class n{constructor(t,i){this.key=i,this.subscriptions=new Te;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)(I(f0),I(OIe))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})()];function PIe(n){return Object.entries(n).reduce((e,[t,i])=>(null!=i&&(e[t]=`${i}`),e),{})}let kIe=(()=>{class n{static forRoot(t){const{providers:i=[]}=RF.forRoot(t.gaToken,function(n){const{appName:e,projectName:t,developmentMode:i}=n;return[{command:"set",values:[PIe({appName:e,projectName:t,developmentMode:i})]}]}(t));return{ngModule:n,providers:i}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({providers:[...Kq,{provide:Mf,multi:!0,useFactory:()=>()=>{},deps:Kq}],imports:[[RF]]}),n})();class Zq extends Error{constructor(){super(...arguments),this.message="NgxsDispatchPluginModule is not imported"}}function FIe(){throw new Zq}function NIe(){throw new Zq}function kF(n,e,t){e.run(()=>n.dispatch(t))}function VIe(n,e,t,i){return Og(t)?function(n,e,t){return t.then(i=>(kF(n,e,i),i))}(n,e,t):cm(t)?function(n,e,t,i){return null!==i&&(t=t.pipe(Tn(i.cancelUncompleted$))),t.subscribe({next:r=>kF(n,e,r)}),t}(n,e,t,i):(kF(n,e,t),t)}class zIe{constructor(){this.cancelUncompleted$=new Se}cancelPreviousAction(){this.cancelUncompleted$.next()}}const FF="\u0275fac",Qq=Symbol("InjectorInstance"),Jq=Symbol("FactoryHasBeenDecorated");function e9(n,e){const t=n[Qq];return t?t.get(e):null}const HIe={cancelUncompleted:!1};function t9(n=HIe){return(e,t,i)=>{let r;const s=function(n){return n?new zIe:null}(n.cancelUncompleted);function o(){null!==s&&s.cancelPreviousAction();const a=e9(this,cu)||FIe(),l=e9(this,dt)||NIe(),c=r.apply(this,arguments);return l.runOutsideAngular(()=>VIe(a,l,c,s))}"function"==typeof(null==i?void 0:i.value)?(r=i.value,i.value=o):Object.defineProperty(e,t,{set:a=>r=a,get:()=>o}),function(n){if(Jq in n.constructor.prototype)return;const e=n.constructor;"function"==typeof e[FF]&&function(n){const e=n[FF];if("function"!=typeof e)return;const t=n.\u0275prov||n.\u0275pipe||n.\u0275cmp||n.\u0275dir,i=()=>{const r=e();return r[Qq]=E(Fc),r};t&&(t.factory=i),Object.defineProperty(n,FF,{get:()=>i})}(e),n.constructor.prototype[Jq]=!0}(e)}}let n9=(()=>{class n{constructor(){this._vertical=!1,this._inset=!1}get vertical(){return this._vertical}set vertical(t){this._vertical=Mt(t)}get inset(){return this._inset}set inset(t){this._inset=Mt(t)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=Ne({type:n,selectors:[["mat-divider"]],hostAttrs:["role","separator",1,"mat-divider"],hostVars:7,hostBindings:function(t,i){2&t&&(nn("aria-orientation",i.vertical?"vertical":"horizontal"),st("mat-divider-vertical",i.vertical)("mat-divider-horizontal",!i.vertical)("mat-divider-inset",i.inset))},inputs:{vertical:"vertical",inset:"inset"},decls:0,vars:0,template:function(t,i){},styles:[".mat-divider{display:block;margin:0;border-top-width:1px;border-top-style:solid}.mat-divider.mat-divider-vertical{border-top:0;border-right-width:1px;border-right-style:solid}.mat-divider.mat-divider-inset{margin-left:80px}[dir=rtl] .mat-divider.mat-divider-inset{margin-left:auto;margin-right:80px}\n"],encapsulation:2,changeDetection:0}),n})(),yx=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[On],On]}),n})();const sPe=["input"],oPe=function(n){return{enterDuration:n}},aPe=["*"],lPe=new ve("mat-checkbox-default-options",{providedIn:"root",factory:c9});function c9(){return{color:"accent",clickAction:"check-indeterminate"}}let cPe=0;const u9=c9(),uPe={provide:ro,useExisting:T(()=>VF),multi:!0};class dPe{}const hPe=Hf(Uf(nc(jf(class{constructor(n){this._elementRef=n}}))));let VF=(()=>{class n extends hPe{constructor(t,i,r,s,o,a,l){super(t),this._changeDetectorRef=i,this._focusMonitor=r,this._ngZone=s,this._animationMode=a,this._options=l,this.ariaLabel="",this.ariaLabelledby=null,this._uniqueId="mat-checkbox-"+ ++cPe,this.id=this._uniqueId,this.labelPosition="after",this.name=null,this.change=new Le,this.indeterminateChange=new Le,this._onTouched=()=>{},this._currentAnimationClass="",this._currentCheckState=0,this._controlValueAccessorChangeFn=()=>{},this._checked=!1,this._disabled=!1,this._indeterminate=!1,this._options=this._options||u9,this.color=this.defaultColor=this._options.color||u9.color,this.tabIndex=parseInt(o)||0}get inputId(){return`${this.id||this._uniqueId}-input`}get required(){return this._required}set required(t){this._required=Mt(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 i=Mt(t);i!==this.disabled&&(this._disabled=i,this._changeDetectorRef.markForCheck())}get indeterminate(){return this._indeterminate}set indeterminate(t){const i=t!=this._indeterminate;this._indeterminate=Mt(t),i&&(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 i=this._currentCheckState,r=this._elementRef.nativeElement;if(i!==t&&(this._currentAnimationClass.length>0&&r.classList.remove(this._currentAnimationClass),this._currentAnimationClass=this._getAnimationClassForCheckStateTransition(i,t),this._currentCheckState=t,this._currentAnimationClass.length>0)){r.classList.add(this._currentAnimationClass);const s=this._currentAnimationClass;this._ngZone.runOutsideAngular(()=>{setTimeout(()=>{r.classList.remove(s)},1e3)})}}_emitChangeEvent(){const t=new dPe;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 i;const r=null===(i=this._options)||void 0===i?void 0:i.clickAction;t.stopPropagation(),this.disabled||"noop"===r?!this.disabled&&"noop"===r&&(this._inputElement.nativeElement.checked=this.checked,this._inputElement.nativeElement.indeterminate=this.indeterminate):(this.indeterminate&&"check"!==r&&Promise.resolve().then(()=>{this._indeterminate=!1,this.indeterminateChange.emit(this._indeterminate)}),this.toggle(),this._transitionCheckState(this._checked?1:2),this._emitChangeEvent())}focus(t,i){t?this._focusMonitor.focusVia(this._inputElement,t,i):this._inputElement.nativeElement.focus(i)}_onInteractionEvent(t){t.stopPropagation()}_getAnimationClassForCheckStateTransition(t,i){if("NoopAnimations"===this._animationMode)return"";let r="";switch(t){case 0:if(1===i)r="unchecked-checked";else{if(3!=i)return"";r="unchecked-indeterminate"}break;case 2:r=1===i?"unchecked-checked":"unchecked-indeterminate";break;case 1:r=2===i?"checked-unchecked":"checked-indeterminate";break;case 3:r=1===i?"indeterminate-checked":"indeterminate-unchecked"}return`mat-checkbox-anim-${r}`}_syncIndeterminate(t){const i=this._inputElement;i&&(i.nativeElement.indeterminate=t)}}return n.\u0275fac=function(t){return new(t||n)(E(rt),E(kn),E(Sa),E(dt),Zr("tabindex"),E(Do,8),E(lPe,8))},n.\u0275cmp=Ne({type:n,selectors:[["mat-checkbox"]],viewQuery:function(t,i){if(1&t&&(Jn(sPe,5),Jn(Js,5)),2&t){let r;_t(r=yt())&&(i._inputElement=r.first),_t(r=yt())&&(i.ripple=r.first)}},hostAttrs:[1,"mat-checkbox"],hostVars:12,hostBindings:function(t,i){2&t&&(al("id",i.id),nn("tabindex",null),st("mat-checkbox-indeterminate",i.indeterminate)("mat-checkbox-checked",i.checked)("mat-checkbox-disabled",i.disabled)("mat-checkbox-label-before","before"==i.labelPosition)("_mat-animation-noopable","NoopAnimations"===i._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:[Dt([uPe]),ct],ngContentSelectors:aPe,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,i){if(1&t&&(wi(),R(0,"label",0,1),R(2,"span",2),R(3,"input",3,4),ge("change",function(s){return i._onInteractionEvent(s)})("click",function(s){return i._onInputClick(s)}),k(),R(5,"span",5),tt(6,"span",6),k(),tt(7,"span",7),R(8,"span",8),Yt.lFrame.currentNamespace=Wn,R(9,"svg",9),tt(10,"path",10),k(),Yt.lFrame.currentNamespace=null,tt(11,"span",11),k(),k(),R(12,"span",12,13),ge("cdkObserveContent",function(){return i._onLabelTextChange()}),R(14,"span",14),De(15,"\xa0"),k(),Ht(16),k(),k()),2&t){const r=vs(1),s=vs(13);nn("for",i.inputId),G(2),st("mat-checkbox-inner-container-no-side-margin",!s.textContent||!s.textContent.trim()),G(1),ie("id",i.inputId)("required",i.required)("checked",i.checked)("disabled",i.disabled)("tabIndex",i.tabIndex),nn("value",i.value)("name",i.name)("aria-label",i.ariaLabel||null)("aria-labelledby",i.ariaLabelledby)("aria-checked",i._getAriaChecked())("aria-describedby",i.ariaDescribedby),G(2),ie("matRippleTrigger",r)("matRippleDisabled",i._isRippleDisabled())("matRippleRadius",20)("matRippleCentered",!0)("matRippleAnimation",Hg(19,oPe,"NoopAnimations"===i._animationMode?0:150))}},directives:[Js,WD],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}),n})(),d9=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({}),n})(),h9=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[_l,On,SE,d9],On,d9]}),n})();const gPe=["bodyCanvas"];let mPe=(()=>{class n{constructor(){this.clsName="ccf-body-ui",this.rotationChange=new Le,this.nodeDrag=new Le,this.nodeClick=new Le,this.nodeHoverStart=new Le,this.nodeHoverStop=new Le,this.initialized=new Le,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 yl(this,void 0,void 0,function*(){const i=this.bodyCanvas.nativeElement,r=new LMe({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.target&&this.bodyUI.setTarget(this.target),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))],this.initialized.emit()})}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=Ne({type:n,selectors:[["ccf-body-ui"]],viewQuery:function(t,i){if(1&t&&Jn(gPe,5,rt),2&t){let r;_t(r=yt())&&(i.bodyCanvas=r.first)}},hostVars:2,hostBindings:function(t,i){2&t&&Rn(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",initialized:"initialized"},decls:2,vars:0,consts:[[1,"body-ui"],["bodyCanvas",""]],template:function(t,i){1&t&&tt(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})(),_Pe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn]]}),n})();function wPe(n,e){if(1&n&&(R(0,"li",4),De(1),Kt(2,"json"),k()),2&n){const t=e.$implicit;G(1),Aw(" ",t[0],": ",rn(2,2,t[1])," ")}}function EPe(n,e){if(1&n&&(R(0,"div",1),R(1,"div"),De(2),k(),R(3,"ul",2),mt(4,wPe,3,4,"li",3),k(),k()),2&n){const t=e.$implicit;G(2),xi(t[0]),G(2),ie("ngForOf",t[1])}}let SPe=(()=>{class n{constructor(t,i){this.clsName="ccf-store-debug",this.root={},this.subscriptions=new Te;const r=t.subscribe(s=>{this.root=s,i.markForCheck()});this.subscriptions.add(r)}get data(){return Object.entries(this.root).map(([s,o])=>[s,Object.entries(o)]).filter(([s,o])=>o.length>0)}ngOnDestroy(){this.subscriptions.unsubscribe()}}return n.\u0275fac=function(t){return new(t||n)(E(cu),E(kn))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-store-debug"]],hostVars:2,hostBindings:function(t,i){2&t&&Rn(i.clsName)},decls:1,vars:1,consts:[["class","state",4,"ngFor","ngForOf"],[1,"state"],[1,"kvlist"],["class","kvpair",4,"ngFor","ngForOf"],[1,"kvpair"]],template:function(t,i){1&t&&mt(0,EPe,5,2,"div",0),2&t&&ie("ngForOf",i.data)},directives:[pl],pipes:[tV],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0}),n})(),MPe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn]]}),n})();new ve("Maximum number of autocomplete options displayed",{providedIn:"root",factory:()=>10});const OPe=["carouselContainer"],IPe=["itemlist"],PPe=["itemcontainer"];function RPe(n,e){if(1&n){const t=Zi();R(0,"mat-icon",9),ge("touchstart",function(){return en(t),Qe().scroll("left")})("touchend",function(){return en(t),Qe().stopScroll()})("click",function(){return en(t),Qe().shift("left")})("mousedown",function(){return en(t),Qe().scroll("left")})("mouseup",function(){return en(t),Qe().stopScroll()}),De(1,"chevron_left"),k()}2&n&&st("disabled",Qe().onLeft)}function kPe(n,e){if(1&n&&(R(0,"div",15),De(1),k()),2&n){const t=Qe().$implicit,i=Qe();G(1),xi(i.occurenceData[t.id]||0)}}function FPe(n,e){if(1&n){const t=Zi();R(0,"div",10),ge("click",function(){const s=en(t).$implicit;return Qe().selectOrgan(s)}),tt(1,"mat-icon",11),R(2,"div",12),R(3,"div",13),De(4),k(),mt(5,kPe,2,1,"div",14),k(),k()}if(2&n){const t=e.$implicit,i=Qe();st("disabled",t.disabled)("selected",i.isSelected(t)),G(1),Jy("svgIcon",t.src),G(3),xi(t.name),G(1),ie("ngIf",void 0!==t.numResults)}}function NPe(n,e){if(1&n){const t=Zi();R(0,"mat-icon",16),ge("touchstart",function(){return en(t),Qe().scroll("right")})("touchend",function(){return en(t),Qe().stopScroll()})("click",function(){return en(t),Qe().shift("right")})("mousedown",function(){return en(t),Qe().scroll("right")})("mouseup",function(){return en(t),Qe().stopScroll()}),De(1,"chevron_right"),k()}2&n&&st("disabled",Qe().onRight)}const g0=[{src:"app:skin",organ:"Skin",name:"Skin",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002097"},{src:"app:brain",organ:"Brain",name:"Brain",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000955"},{disabled:!0,src:"app:lymph-nodes",organ:"Lymph Node",name:"Lymph Node",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000029"},{src:"app:lymph-nodes",organ:"Lymph Node",name:"Lymph Node",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002509"},{disabled:!0,src:"app:eye",organ:"Eye",name:"Eye, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000970"},{src:"app:eye",organ:"Eye",name:"Eye, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0004548"},{src:"app:eye",organ:"Eye",name:"Eye, R",side:"right",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0004549"},{disabled:!0,src:"app:fallopian-tube-left",organ:"Fallopian Tube",name:"Fallopian Tube, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0003889"},{src:"app:fallopian-tube-left",organ:"Fallopian Tube",name:"Fallopian Tube, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0001303"},{src:"app:fallopian-tube-right",organ:"Fallopian Tube",name:"Fallopian Tube, R",side:"right",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0001302"},{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, L",side:"left",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"},{disabled:!0,src:"app:knee",organ:"Knee",name:"Knee, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001465"},{src:"app:knee",organ:"Knee",name:"Knee, L",side:"left",hasSex:!0,id:"http://purl.org/sig/ont/fma/fma24978"},{src:"app:knee",organ:"Knee",name:"Knee, R",side:"right",hasSex:!0,id:"http://purl.org/sig/ont/fma/fma24977"},{src:"app:liver",organ:"Liver",name:"Liver",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002107"},{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"},{disabled:!0,src:"app:mammary-gland",organ:"Mammary Gland",name:"Mammary Gland, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0001911"},{src:"app:mammary-gland",organ:"Mammary Gland",name:"Mammary Gland, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.org/sig/ont/fma/fma57991"},{src:"app:mammary-gland",organ:"Mammary Gland",name:"Mammary Gland, R",side:"right",hasSex:!1,sex:"female",id:"http://purl.org/sig/ont/fma/fma57987"},{disabled:!0,src:"app:ovary-left",organ:"Ovary",name:"Ovary, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0000992"},{src:"app:ovary-left",organ:"Ovary",name:"Ovary, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.org/sig/ont/fma/fma7214"},{src:"app:ovary-right",organ:"Ovary",name:"Ovary, R",side:"right",hasSex:!1,sex:"female",id:"http://purl.org/sig/ont/fma/fma7213"},{src:"app:pancreas",organ:"Pancreas",name:"Pancreas",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001264"},{src:"app:pelvis-f",organ:"Pelvis",name:"Pelvis",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001270"},{src:"app:placenta",organ:"Placenta",name:"Placenta",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0001987"},{src:"app:prostate",organ:"Prostate",name:"Prostate",hasSex:!1,sex:"male",id:"http://purl.obolibrary.org/obo/UBERON_0002367",disabled:!0},{src:"app:prostate",organ:"Prostate",name:"Prostate",hasSex:!1,sex:"male",id:"http://purl.obolibrary.org/obo/UBERON_0000079"},{src:"app:small-intestine",organ:"Small Intestine",name:"Small Intestine",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002108"},{src:"app:large-intestine",organ:"Large Intestine",name:"Large Intestine",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000059"},{src:"app:spinal-cord",organ:"Spinal Cord",name:"Spinal Cord",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002240"},{src:"app:spleen",organ:"Spleen",name:"Spleen",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002106"},{src:"app:thymus",organ:"Thymus",name:"Thymus",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002370"},{disabled:!0,src:"app:ureter-left",organ:"Ureter",name:"Ureter, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000056"},{src:"app:ureter-left",organ:"Ureter",name:"Ureter, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001223"},{src:"app:ureter-right",organ:"Ureter",name:"Ureter, R",side:"right",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001222"},{src:"app:bladder",organ:"Urinary Bladder",name:"Urinary Bladder",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001255"},{src:"app:uterus",organ:"Uterus",name:"Uterus",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0000995"},{src:"app:vasculature-thick",organ:"Blood Vasculature",name:"Blood Vasculature",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0004537"},{disabled:!0,src:"app:vasculature-thick",organ:"Blood Vasculature",name:"Blood Vasculature",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002049"}].sort((n,e)=>n.name.localeCompare(e.name)).filter(n=>!0!==n.disabled);let p9=(()=>{class n{constructor(){this.clsName="ccf-organ-selector",this.multiselect=!1,this.displayErrors=!1,this.organList=g0,this.selectedOrgans=[],this.expanded=!1,this.organsChanged=new Le,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 hW.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:i}=this;let r=parseInt(i.nativeElement.style.left,10)||0;this.onLeft&&"left"===t||this.onRight&&"right"===t||(r="right"===t?r-this.step:r+this.step,i.nativeElement.style.left=r+"px",this.setLeftRight(r))}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(i=>t!==i):this.selectedOrgans.concat([t]):[t],this.organsChanged.emit(this.selectedOrgans)}isSelected(t){return!!this.selectedOrgans.includes(t)}set(){const{itemList:t,itemContainer:i,carouselContainer:r}=this,s=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(s);const o=this.step*Math.floor(r.nativeElement.offsetWidth/this.step)-64;i.nativeElement.style.width=`${o}px`}}setWidth(){const{itemContainer:t,carouselContainer:i}=this,r=this.step*Math.floor(i.nativeElement.offsetWidth/this.step)-64;t.nativeElement.style.width=`${r}px`}setLeftRight(t){const{itemContainer:i}=this;this.onLeft=0===t,this.onRight=t<=i.nativeElement.offsetWidth-this.organList.length*this.step}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=Ne({type:n,selectors:[["ccf-organ-selector"]],viewQuery:function(t,i){if(1&t&&(Jn(OPe,7),Jn(IPe,7),Jn(PPe,7)),2&t){let r;_t(r=yt())&&(i.carouselContainer=r.first),_t(r=yt())&&(i.itemList=r.first),_t(r=yt())&&(i.itemContainer=r.first)}},hostVars:2,hostBindings:function(t,i){2&t&&Rn(i.clsName)},inputs:{multiselect:"multiselect",displayErrors:"displayErrors",organList:"organList",selectedOrgans:"selectedOrgans",expanded:"expanded",occurenceData:"occurenceData"},outputs:{organsChanged:"organsChanged"},features:[zn],decls:9,vars:8,consts:[["matTooltip","Select the organ your tissue block is from.",1,"container",3,"matTooltipDisabled"],["carouselContainer",""],["class","carousel-left-icon",3,"disabled","touchstart","touchend","click","mousedown","mouseup",4,"ngIf"],[1,"carousel-item-container"],["itemcontainer",""],[1,"carousel-item-list"],["itemlist",""],["class","carousel-item",3,"disabled","selected","click",4,"ngFor","ngForOf"],["class","carousel-right-icon",3,"disabled","touchstart","touchend","click","mousedown","mouseup",4,"ngIf"],[1,"carousel-left-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"],[1,"carousel-right-icon",3,"touchstart","touchend","click","mousedown","mouseup"]],template:function(t,i){1&t&&(R(0,"div",0,1),mt(2,RPe,2,2,"mat-icon",2),R(3,"div",3,4),R(5,"div",5,6),mt(7,FPe,6,7,"div",7),k(),k(),mt(8,NPe,2,2,"mat-icon",8),k()),2&t&&(st("expanded",i.expanded)("error",i.error),ie("matTooltipDisabled",i.multiselect),G(2),ie("ngIf",!i.expanded),G(5),ie("ngForOf",i.organList),G(1),ie("ngIf",!i.expanded))},directives:[dc,zr,pl,rs],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:5rem;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}[_nghost-%COMP%] .expanded[_ngcontent-%COMP%] .carousel-item-container[_ngcontent-%COMP%]{width:100%!important}[_nghost-%COMP%] .expanded[_ngcontent-%COMP%] .carousel-item-container[_ngcontent-%COMP%] .carousel-item-list[_ngcontent-%COMP%]{flex-wrap:wrap;overflow:auto;left:0rem!important}[_nghost-%COMP%] .expanded[_ngcontent-%COMP%] .carousel-item-container[_ngcontent-%COMP%] .carousel-item-list[_ngcontent-%COMP%] .carousel-item[_ngcontent-%COMP%]{height:5rem}"]}),n})(),g9=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,lr,hc]]}),n})(),LPe=(()=>{class n{constructor(){this.clsName="ccf-opacity-slider",this.opacity=20,this.visible=!0,this.opacityChange=new Le,this.visibilityToggle=new Le,this.opacityReset=new Le}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 n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=Ne({type:n,selectors:[["ccf-opacity-slider"]],hostVars:2,hostBindings:function(t,i){2&t&&Rn(i.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,i){1&t&&(R(0,"div",0),R(1,"div",1),R(2,"mat-slider",2),ge("input",function(s){return i.changeOpacity(s.value)}),k(),R(3,"span",3),De(4),k(),k(),R(5,"div",4),R(6,"mat-icon",5),ge("click",function(){return i.toggleVisibility()}),k(),R(7,"mat-icon",6),ge("click",function(){return i.toggleVisibility()}),k(),R(8,"mat-icon",7),ge("click",function(){return i.resetOpacity()}),De(9,"refresh"),k(),k(),k()),2&t&&(G(2),st("disabled",!i.visible),ie("step",1)("min",0)("max",100)("value",i.opacity),G(2),or("",i.opacity,"%"),G(2),st("hidden",i.visible),ie("matRippleCentered",!0)("matRippleUnbounded",!0),G(1),st("hidden",!i.visible),ie("matRippleCentered",!0)("matRippleUnbounded",!0),G(1),ie("matRippleCentered",!0)("matRippleUnbounded",!0))},directives:[jk,rs,Js],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}),n})(),m9=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,lr,_W,_l]]}),n})();function BPe(n,e){if(1&n&&(R(0,"div",16),tt(1,"youtube-player",17),k()),2&n){const t=Qe(3);G(1),Jy("videoId",t.videoID)}}function VPe(n,e){if(1&n&&(R(0,"mat-expansion-panel",11),R(1,"mat-expansion-panel-header"),R(2,"h2",12),De(3),k(),k(),R(4,"div",13),tt(5,"markdown",14),mt(6,BPe,2,1,"div",15),k(),k()),2&n){const t=Qe(),i=t.index,r=t.$implicit;ie("expanded",0===i),G(3),xi(r.title),G(2),st("first",0===i),ie("data",r.content),G(1),ie("ngIf",0===i)}}function zPe(n,e){if(1&n&&(R(0,"div",9),mt(1,VPe,7,6,"mat-expansion-panel",10),k()),2&n){const t=e.$implicit;G(1),ie("ngIf",t)}}let _9=(()=>{class n{constructor(t,i){this.dialogRef=t,this.data=i,this.documentationContents=i.content||[],this.infoTitle=i.title||"",this.videoID=i.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 n.\u0275fac=function(t){return new(t||n)(E(Qm),E(Gk))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-info-dialog"]],decls:11,vars:2,consts:[[1,"rui-about","wrapper"],[1,"container"],[1,"content"],[1,"header"],["mat-dialog-title","",1,"title"],[1,"close"],[1,"material-icons","close-icon",3,"click"],[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,i){1&t&&(R(0,"div",0),R(1,"div",1),R(2,"div",2),R(3,"div",3),R(4,"h2",4),De(5),k(),R(6,"div",5),R(7,"mat-icon",6),ge("click",function(){return i.close()}),De(8,"clear"),k(),k(),k(),R(9,"mat-dialog-content",7),mt(10,zPe,2,1,"div",8),k(),k(),k(),k()),2&t&&(G(5),xi(i.infoTitle),G(5),ie("ngForOf",i.documentationContents))},directives:[Wk,rs,qk,pl,zr,qM,YM,TW,IW],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%] .content[_ngcontent-%COMP%] .header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;height:3rem;margin-bottom:2.25rem;position:relative}.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%]{cursor:pointer;height:3rem;width:3rem;line-height:3rem;text-align:center;transition:.6s}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-size:1.5rem;margin:0 auto;line-height:3rem;height:3rem;justify-self:center;display:flex}.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;display:flex}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .dialog-content[_ngcontent-%COMP%] .variable-binding.first[_ngcontent-%COMP%]{padding-right:1rem;width:73%}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .dialog-content[_ngcontent-%COMP%] .variable-binding[_ngcontent-%COMP%] ul{margin:0}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .dialog-content[_ngcontent-%COMP%] .variable-binding[_ngcontent-%COMP%] img{margin-left:1rem;float:right}.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%}"]}),n})(),jPe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,Qb,lr,Kk,pAe,XTe.forRoot({})]]}),n})(),y9=(()=>{class n{constructor(t){this.http=t,this.panelContent=new ar({content:[],infoTitle:"",videoID:""})}updateData(t,i,r){this.http.get(t,{responseType:"text"}).subscribe(s=>{const o={content:this.parseMarkdown(s),infoTitle:r,videoID:i};this.panelContent.next(o)})}parseMarkdown(t){const i=[],r=t.split("# ");for(const s of r)if(s.length){const o=s.includes("\n\n")?"\n\n":"\r\n\r\n",a=s.split(o);i.push({title:a[0],content:a.splice(1).join(o)})}return i}}return n.\u0275fac=function(t){return new(t||n)(I(Wf))},n.\u0275prov=ue({token:n,factory:n.\u0275fac,providedIn:"root"}),n})(),UPe=(()=>{class n{constructor(t,i){this.dialog=t,this.infoButtonService=i,this.infoTitle="",this.subscriptions=new Te,this.subscriptions.add(i.panelContent.subscribe(r=>{r.content.length&&this.launchInfoDialog(r)}))}ngOnDestroy(){this.subscriptions.unsubscribe()}launchInfoDialog(t){0==this.dialog.openDialogs.length&&this.dialog.open(_9,{autoFocus:!1,panelClass:"modal-animated",width:"72rem",data:{title:t.infoTitle,content:t.content,videoID:t.videoID}})}onDialogButtonClick(){this.infoButtonService.updateData(this.documentationUrl,this.videoID,this.infoTitle)}}return n.\u0275fac=function(t){return new(t||n)(E(_p),E(y9))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-info-button"]],inputs:{infoTitle:"infoTitle",videoID:"videoID",documentationUrl:"documentationUrl"},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,i){1&t&&(R(0,"div",0),R(1,"mat-icon",1),ge("click",function(){return i.onDialogButtonClick()}),De(2," info "),k(),k())},directives:[rs],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}"]}),n})(),HPe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,jPe,lr,Rj]]}),n})(),$Pe=(()=>{class n{constructor(){this.clsName="ccf-call-to-action",this.callToActionClicked=new Le,this.closeClicked=new Le}close(){this.closeClicked.emit()}onDialogButtonClick(){this.callToActionClicked.emit()}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=Ne({type:n,selectors:[["ccf-call-to-action"]],hostVars:2,hostBindings:function(t,i){2&t&&Rn(i.clsName)},inputs:{infoTitle:"infoTitle",imageUrl:"imageUrl",message:"message",callToAction:"callToAction"},outputs:{callToActionClicked:"callToActionClicked",closeClicked:"closeClicked"},decls:13,vars:4,consts:[[1,"rui-about","wrapper"],[1,"container"],[1,"content"],[1,"first-row"],["mat-dialog-title","",1,"title"],[1,"cta-mat-icon","material-icons","close-icon",3,"click"],["mat-card-sm-image","","alt","preview","layout-fill","",1,"cta-image",3,"src"],[1,"mat-typography","dialog-content"],[1,"message"],["mat-button","",1,"mat-button",3,"text","click"]],template:function(t,i){1&t&&(R(0,"div",0),R(1,"div",1),R(2,"div",2),R(3,"div",3),R(4,"p",4),De(5),k(),R(6,"mat-icon",5),ge("click",function(){return i.close()}),De(7,"clear"),k(),k(),tt(8,"img",6),R(9,"mat-dialog-content",7),R(10,"div",8),De(11),k(),R(12,"a",9),ge("click",function(){return i.onDialogButtonClick()}),k(),k(),k(),k(),k()),2&t&&(G(5),xi(i.infoTitle),G(3),ie("src",i.imageUrl,Ud),G(3),or(" ",i.message,""),G(1),ie("text",i.callToAction))},directives:[Wk,rs,CAe,qk],styles:["[_nghost-%COMP%] .content[_ngcontent-%COMP%]{display:block;align-content:center;padding-left:1.6rem;padding-right:1.6rem;border-radius:.25rem}[_nghost-%COMP%] .info-button-wrapper[_ngcontent-%COMP%]{border-radius:.25rem;padding:.6rem;transition:.6s}[_nghost-%COMP%] .info-button-wrapper[_ngcontent-%COMP%] .ccf-info-button[_ngcontent-%COMP%]{cursor:pointer;transition:color .6s;font-size:1.2rem;vertical-align:sub}[_nghost-%COMP%] .first-row[_ngcontent-%COMP%]{display:flex;width:100%;line-height:.9rem}[_nghost-%COMP%] .first-row[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{padding-right:7rem;padding-left:.2rem;font-size:.875rem;padding-top:.75rem}[_nghost-%COMP%] .first-row[_ngcontent-%COMP%] .cta-mat-icon[_ngcontent-%COMP%]{height:30%;line-height:3.4rem}[_nghost-%COMP%] .message[_ngcontent-%COMP%]{padding:.5rem}[_nghost-%COMP%] .cta-image[_ngcontent-%COMP%]{align-self:center;-o-object-fit:cover;object-fit:cover;width:100%;border-radius:.25rem}[_nghost-%COMP%] .mat-button[_ngcontent-%COMP%]{background-color:#444a65;font-size:.75rem;position:relative;margin-bottom:1rem;width:100%;height:2rem;color:#fff}"],changeDetection:0}),n})(),WPe=(()=>{class n{constructor(t){this.el=t}onInputChange(t){const i=this.el.nativeElement.value;this.el.nativeElement.value=i.replace(/[^0-9]*/g,""),i!==this.el.nativeElement.value&&t.stopPropagation()}}return n.\u0275fac=function(t){return new(t||n)(E(rt))},n.\u0275dir=oe({type:n,selectors:[["input","ccfNumbersOnly",""]],hostBindings:function(t,i){1&t&&ge("input",function(s){return i.onInputChange(s)})}}),n})(),qPe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({}),n})(),v9=(()=>{class n{get obj(){const t=this.findGlobalObject();return Object.defineProperties(this,{obj:{configurable:!1,writable:!1,value:t}}),t}has(t){const{obj:i}=this;return null!=i&&t in i}get(t,i){var r;const{obj:s}=this;return null!==(r=s&&s[t])&&void 0!==r?r:i}set(t,i){const{obj:r}=this;r&&(r[t]=i)}remove(t){const{obj:i}=this;i&&delete i[t]}findGlobalObject(){if("undefined"!=typeof globalThis)return globalThis;if("undefined"!=typeof global)return global;if("undefined"!=typeof window)return window;if("undefined"!=typeof self)return self;try{return new Function("return this;")()}catch(t){}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ue({token:n,factory:n.\u0275fac,providedIn:"root"}),n})(),Ah=(()=>{let n=class extends Jm{constructor(){super(...arguments),this.optionCache=new Map}get config$(){return this.state$.pipe(aF(),qc(1))}setConfig(t){this.setState(t)}patchConfig(t){this.patchState(t)}getProperty(t){return this.config$.pipe(ur(...t),Zo(),qc(1))}getOption(...t){const i=this.getPathKey(t);if(this.optionCache.has(i))return this.optionCache.get(i);const r=this.config$.pipe(ur(...t),Zo(),qc(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=$n(n)))(i||n)}}(),n.\u0275prov=ue({token:n,factory:n.\u0275fac}),xe([oi()],n.prototype,"config$",null),n=xe([xh(),cd({name:"globalConfig",defaults:null})],n),n})();!function(){const n=localStorage.getItem("ALLOW_TELEMETRY");null===n||n.toLowerCase()}();let ZPe=(()=>{class n{constructor(t,i){t&&function(n,e){Wc(n,"mousemove").pipe(dW(1e3),Ae(r=>{const{clientWidth:s,clientHeight:o}=n,{clientX:a,clientY:l}=r;return[a,l,s,o].join("_")})).subscribe(r=>e.event("webpage","mousemove",r))}(t.body,i)}}return n.\u0275fac=function(t){return new(t||n)(I(ut),I(xs))},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({}),n})();function QPe(n,e){if(1&n){const t=Zi();R(0,"button",1),ge("click",function(){return en(t),Qe().submit(!0)}),De(1),k()}if(2&n){const t=Qe();G(1),or(" ","not-set"===t.allowTelemetry?"I understand":"Opt in","\n")}}function JPe(n,e){if(1&n){const t=Zi();R(0,"button",1),ge("click",function(){return en(t),Qe().submit(!1)}),De(1,"Opt out"),k()}}let eRe=(()=>{class n{constructor(t,i,r){this.consentService=i,this.data=r,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:i}=this;return"not-set"===i||("opt-in"===t?"rescinded"===i:"given"===i)}}return n.\u0275fac=function(t){return new(t||n)(E(rt),E(f0),E(KO))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-tracking-popup"]],hostVars:2,hostBindings:function(t,i){2&t&&Rn(i.clsName)},decls:4,vars:2,consts:[["mat-button","","color","basic",3,"click",4,"ngIf"],["mat-button","","color","basic",3,"click"]],template:function(t,i){1&t&&(R(0,"p"),De(1,"We log usage to improve this service."),k(),mt(2,QPe,2,1,"button",0),mt(3,JPe,2,0,"button",0)),2&t&&(G(2),ie("ngIf",i.showButton("opt-in")),G(1),ie("ngIf",i.showButton("opt-out")))},directives:[zr,lh],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}),n})(),tRe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,ch]]}),n})();new Se;let zF=(()=>{class n{}return n.type="[CallToAction] Learn More",n})(),jF=(()=>{class n{}return n.type="[CallToAction] Open Dialog",n})(),UF=(()=>{class n{}return n.type="[CallToAction] Close Dialog",n})();var HF;class sa{get length(){var e,t;return null!==(t=null===(e=sa.storage)||void 0===e?void 0:e.length)&&void 0!==t?t:0}key(e){var t,i;return null!==(i=null===(t=sa.storage)||void 0===t?void 0:t.key(e))&&void 0!==i?i:null}getItem(e,t){var i,r,s;return null!==(s=null!==(r=null===(i=sa.storage)||void 0===i?void 0:i.getItem(e))&&void 0!==r?r:t)&&void 0!==s?s:null}setItem(e,t){var i;try{return null===(i=sa.storage)||void 0===i||i.setItem(e,t),!0}catch(r){return!1}}removeItem(e){var t;null===(t=sa.storage)||void 0===t||t.removeItem(e)}clear(){var e;null===(e=sa.storage)||void 0===e||e.clear()}}sa.storage=(()=>{let n;try{n=window.localStorage;const e="__storage_test__";return n.setItem(e,e),n.removeItem(e),n}catch(e){return e instanceof DOMException&&(22===e.code||1014===e.code||"QuotaExceededError"===e.name||"NS_ERROR_DOM_QUOTA_REACHED"===e.name)&&n&&0!==n.length?n:void 0}})(),sa.\u0275fac=function(e){return new(e||sa)},sa.\u0275prov=ue({token:sa,factory:sa.\u0275fac,providedIn:"root"});const w9="callToActionPopupShown";let oo=HF=class{constructor(e,t,i,r,s){this.dialog=e,this.ga=t,this.storage=i,this.infoService=r,this.http=s}static ctaDatePassed(e,t=Date.now){return+t()>+new Date(e)}ngxsOnInit(e){const{expirationDate:t,popupShown:i}=e.getState(),r=this.storage.getItem(w9,`${i}`),s=HF.ctaDatePassed(t);"true"!==r&&!s&&e.dispatch(new jF)}getDialogData(){return this.http.get("assets/docs/SPATIAL_SEARCH_README.md",{responseType:"text"}).pipe(Ae(e=>this.infoService.parseMarkdown(e)))}launchLearnMore(e){this.dialog.open(_9,{autoFocus:!1,panelClass:"modal-animated",width:"72rem",data:{title:"Spatial Search",content:e,videoID:"UfxMpzatowE"}})}learnMore(e){return this.dialog.closeAll(),this.ga.event("open_learn_more","call_to_action"),this.getDialogData().pipe(Ti(t=>this.launchLearnMore(t)))}open(e){this.dialog.open(iRe,{autoFocus:!1,panelClass:"modal-animated",width:"30.75rem",height:"36.688rem"}),this.ga.event("open","call_to_action"),this.storage.setItem(w9,"true"),e.patchState({popupShown:!0})}close(e){this.dialog.closeAll(),this.ga.event("close","call_to_action")}};oo.\u0275fac=function(e){return new(e||oo)(I(_p),I(xs),I(sa),I(y9),I(Wf))},oo.\u0275prov=ue({token:oo,factory:oo.\u0275fac}),xe([gk(zF)],oo.prototype,"learnMore",null),xe([gk(jF)],oo.prototype,"open",null),xe([gk(UF)],oo.prototype,"close",null),oo=HF=xe([cd({name:"callToAction",defaults:{title:"New to the Exploration User Interface",message:"Spatial Search has arrived!",callToAction:"Learn More",imageUrl:"assets/images/spatial_search.gif",expirationDate:"Dec 1, 2022",popupShown:!1}})],oo);let vx=(()=>{class n{static title(t){return t.title}static message(t){return t.message}static callToAction(t){return t.callToAction}static imageUrl(t){return t.imageUrl}static expirationDate(t){return t.expirationDate}static popupShown(t){return t.popupShown}}return xe([Xm([oo])],n,"title",null),xe([Xm([oo])],n,"message",null),xe([Xm([oo])],n,"callToAction",null),xe([Xm([oo])],n,"imageUrl",null),xe([Xm([oo])],n,"expirationDate",null),xe([Xm([oo])],n,"popupShown",null),n})(),iRe=(()=>{class n{constructor(){this.close=()=>new UF,this.learnMore=()=>new zF}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=Ne({type:n,selectors:[["ccf-call-to-action-behavior"]],decls:5,vars:12,consts:[[3,"infoTitle","message","callToAction","imageUrl","callToActionClicked","closeClicked"]],template:function(t,i){1&t&&(R(0,"ccf-call-to-action",0),ge("callToActionClicked",function(){return i.learnMore()})("closeClicked",function(){return i.close()}),Kt(1,"async"),Kt(2,"async"),Kt(3,"async"),Kt(4,"async"),k()),2&t&&ie("infoTitle",rn(1,4,i.title$))("message",rn(2,6,i.message$))("callToAction",rn(3,8,i.callToAction$))("imageUrl",rn(4,10,i.imageUrl$))},directives:[$Pe],pipes:[Hc],styles:[""],changeDetection:0}),xe([NM(vx.title)],n.prototype,"title$",void 0),xe([NM(vx.message)],n.prototype,"message$",void 0),xe([NM(vx.callToAction)],n.prototype,"callToAction$",void 0),xe([NM(vx.imageUrl)],n.prototype,"imageUrl$",void 0),xe([t9()],n.prototype,"close",void 0),xe([t9()],n.prototype,"learnMore",void 0),n})();const oRe={initialConfig:{},parse:{},rename:{}};class aRe{constructor(e,t){this.configState=e,this.storedChanges={},this.options=Object.assign(Object.assign({},oRe),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 lRe=(()=>{class n{constructor(t,i,r={}){this.configState=t,this.cdr=i,this.options=r,this.initialized=!1,this.configManager=new aRe(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=oe({type:n,features:[zn]}),n})();const cRe={boolean:n=>"false"!=`${n}`,json:n=>"string"==typeof n?JSON.parse(n):n,function:n=>{if("function"!=typeof n)throw new Error("Expected a javascript function");return n}};var $F;const hu={production:!0,disableDbWorker:!0,dbOptions:{ccfOwlUrl:"https://ccf-ontology.hubmapconsortium.org/v2.1.0/ccf.owl",ccfContextUrl:"https://hubmapconsortium.github.io/ccf-ontology/ccf-context.jsonld",hubmapDataService:"search-api",hubmapPortalUrl:"https://portal.hubmapconsortium.org/",hubmapDataUrl:"",hubmapAssetsUrl:"https://assets.hubmapconsortium.org",hubmapToken:null!==($F=localStorage.getItem("HUBMAP_TOKEN"))&&void 0!==$F?$F:""},customization:{theme:"hubmap",header:!0,homeUrl:"https://portal.hubmapconsortium.org/",logoTooltip:"Human BioMolecular Atlas Project"},skipUnsavedChangesConfirmation:!1,googleAnalyticsToken:"portal.hubmapconsortium.org"===window.location.hostname?"G-1WRJHN9FM6":"G-J9HWV9QPJ4"};var uRe=ze(815);class hRe{constructor(e){this.value=e}call(e,t){return t.subscribe(new fRe(e,this.value))}}class fRe extends xt{constructor(e,t){super(e),this.value=t}_next(e){this.destination.next(this.value)}}class gRe{constructor(e){this.notifier=e}call(e,t){return t.subscribe(new mRe(e,this.notifier))}}class mRe extends ii{constructor(e,t){super(e),this.hasValue=!1;const i=new Gr(this);this.add(i),this.innerSubscription=i;const r=co(t,i);r!==i&&(this.add(r),this.innerSubscription=r)}_next(e){this.hasValue&&super._next(e)}notifyNext(){this.hasValue=!0,this.innerSubscription&&this.innerSubscription.unsubscribe()}notifyComplete(){}}function GF(n){return"function"==typeof n}function E9(n){return void 0===n}function yRe(n,e,t){return function(r){let s=!!n;return function(n){return"function"==typeof n}(n)&&(s=n(r)),function(n,e){return GF(n)?n(e):E9(n)?e:n}(s?e:t,r)}}function vRe(n,e){return function(i){if(function(n){return null===n||E9(n)}(n)&&i)return i;if(!Array.isArray(i))return[n];const r=i.slice();let s=0;return e>0&&(s=e),r.splice(s,0,n),r}}function m0(n){return function(t){let i=null;for(const r in n){const s=n[r],o=t[r],a=GF(s)?s(o):s;a!==o&&(i||(i=Object.assign({},t)),i[r]=a)}return i||t}}let ji=class extends Jm{constructor(e){super(),this.globalConfig=e,this.user$=this.state$.pipe(ur("user")),this.registrationStarted$=this.state$.pipe(lF("registrationStarted")),this.useCancelRegistrationCallback$=this.state$.pipe(ur("useCancelRegistrationCallback")),this.registrationCallbackSet$=this.state$.pipe(ur("registrationCallbackSet"))}get skipConfirmation$(){return this.state$.pipe(lF("skipConfirmation"))}get globalSkipConfirmation$(){return this.globalConfig.getOption("skipUnsavedChangesConfirmation").pipe(Ae(e=>null!=e?e:hu.skipUnsavedChangesConfirmation),Zo())}get hasChanges$(){return this.state$.pipe(lF("hasChanges"))}ngxsOnInit(){super.ngxsOnInit(),this.globalConfig.config$.pipe(yi(1),Ti(e=>this.setState(m0({registrationCallbackSet:!!e.register,useCancelRegistrationCallback:!!e.cancelRegistration,user:yRe(!!e.user,e.user),registrationStarted:!!e.user||void 0})))).subscribe(),this.initSkipConfirmationListeners()}cancelRegistration(){const{globalConfig:{snapshot:{cancelRegistration:e}},snapshot:{useCancelRegistrationCallback:t,skipConfirmation:i}}=this;t&&(i||confirm("Changes you made may not be saved."))&&(null==e||e())}setUseCancelRegistrationCallback(e){this.ctx.patchState({useCancelRegistrationCallback:e})}setUserName(e){this.ctx.setState(m0({user:m0(e)}))}registrationStarted(){this.ctx.setState(m0({registrationStarted:!0}))}setHasChanges(){const{snapshot:{registrationStarted:e,hasChanges:t}}=this;e&&!t&&this.ctx.patchState({hasChanges:!0})}clearHasChanges(){this.ctx.patchState({hasChanges:!1})}initSkipConfirmationListeners(){const e=i=>this.patchState({skipConfirmation:i});this.globalSkipConfirmation$.pipe(Fn(i=>i)).subscribe(e),this.hasChanges$.pipe(ZM(this.globalSkipConfirmation$),Ae(([i,r])=>r||!i),Zo()).subscribe(e);const t=i=>(i.preventDefault(),i.returnValue="Changes you made may not be saved.",i.returnValue);this.skipConfirmation$.subscribe(i=>{i?removeEventListener("beforeunload",t):addEventListener("beforeunload",t)})}};ji.\u0275fac=function(e){return new(e||ji)(I(Ah))},ji.\u0275prov=ue({token:ji,factory:ji.\u0275fac}),xe([oi()],ji.prototype,"skipConfirmation$",null),xe([oi()],ji.prototype,"globalSkipConfirmation$",null),xe([oi()],ji.prototype,"hasChanges$",null),xe([on()],ji.prototype,"setUseCancelRegistrationCallback",null),xe([on()],ji.prototype,"setUserName",null),xe([on()],ji.prototype,"registrationStarted",null),xe([on()],ji.prototype,"setHasChanges",null),xe([on()],ji.prototype,"clearHasChanges",null),ji=xe([xh(),cd({name:"page",defaults:{user:{firstName:"",lastName:""},registrationStarted:!1,useCancelRegistrationCallback:!1,registrationCallbackSet:!1,skipConfirmation:!0,hasChanges:!1}})],ji);let fc=class extends Jm{constructor(e,t){super(),this.globals=e,this.globalConfig=t}ngxsOnInit(){super.ngxsOnInit(),this.getSourceDB().subscribe(e=>{this.setState(e),hu.production||this.globals.set("db",e)})}getSourceDB(){return this.globalConfig.getOption("baseHref").pipe(Ae(e=>(null!=e?e:"")+"assets/reference-organ-data.json"),Pr(e=>ui(fetch(e)).pipe(Pr(t=>t.json()),Ta(()=>ec))))}normalizePlacement(e){const i=this.snapshot.placementPatches[null==e?void 0:e.target];if(i){const r=function(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(ib),o=[t.x_scaling,t.y_scaling,t.z_scaling];return n.translate(r).rotateXYZ(s).scale(o)}(new $t($t.IDENTITY),i),s={x:e.x_translation,y:e.y_translation,z:e.z_translation},[o,a,l]=r.transformAsPoint([s.x,s.y,s.z],[]),c=Object.assign(Object.assign({},e),{target:i.target});return c.x_translation=o,c.y_translation=a,c.z_translation=l,c}return e}getReferenceOrganIri(e,t,i,r){const s=this.snapshot;"KIDNEY"!==e.toUpperCase()&&(i=""),(null==r?void 0:r.sex)&&(t=r.sex);const o=[e,t,i||(null==r?void 0:r.side)].join("|").toUpperCase(),a=Object.keys(s.organIRILookup).find(l=>l.toUpperCase().endsWith(o));return a?s.organIRILookup[a]:void 0}getOrganData(e){var t,i,r;const o=this.snapshot.organSpatialEntities[e];if(!o)return;const a=null!==(t=o.label)&&void 0!==t?t:"",l=g0.find(c=>a.endsWith(c.organ)&&(!o.side||o.side.toLowerCase()===c.side));return l?{organ:l,sex:null===(i=o.sex)||void 0===i?void 0:i.toLowerCase(),side:null===(r=o.side)||void 0===r?void 0:r.toLowerCase()}:void 0}};fc.\u0275fac=function(e){return new(e||fc)(I(v9),I(Ah))},fc.\u0275prov=ue({token:fc,factory:fc.\u0275fac}),fc=xe([xh(),cd({name:"reference",defaults:{organIRILookup:{},organSpatialEntities:{},anatomicalStructures:{},extractionSets:{},sceneNodeLookup:{},simpleSceneNodeLookup:{},placementPatches:{}}})],fc);const qF=g0;let ai=class extends Jm{constructor(e,t,i){super(),this.ga=e,this.injector=t,this.globalConfig=i,this.id$=this.state$.pipe(ur("id")),this.blockSize$=this.state$.pipe(ur("blockSize")),this.rotation$=this.state$.pipe(ur("rotation")),this.position$=this.state$.pipe(ur("position")),this.slicesConfig$=this.state$.pipe(ur("slicesConfig")),this.viewType$=this.state$.pipe(ur("viewType")),this.viewSide$=this.state$.pipe(ur("viewSide")),this.organ$=this.state$.pipe(ur("organ")),this.organIri$=this.state$.pipe(ur("organIri")),this.organDimensions$=this.state$.pipe(ur("organDimensions")),this.sex$=this.state$.pipe(ur("sex")),this.side$=this.state$.pipe(ur("side")),this.showPrevious$=this.state$.pipe(ur("showPrevious")),this.extractionSites$=this.state$.pipe(ur("extractionSites")),this.anatomicalStructures$=this.state$.pipe(ur("anatomicalStructures")),this.extractionSets$=this.state$.pipe(ur("extractionSets"))}get modelChanged$(){const e=["viewType","viewSide","showPrevious"],t=Object.keys(this.initialState).filter(i=>!e.includes(i));return this.state$.pipe(dW(0,void 0,{leading:!1,trailing:!0}),Zo((i,r)=>{for(const s of t)if(i[s]!==r[s])return!1;return!0}),e=>e.lift(new hRe(void 0)))}ngxsOnInit(){super.ngxsOnInit(),this.referenceData=this.injector.get(fc),this.page=this.injector.get(ji),this.globalConfig.getOption("organ").pipe(aF(),Pr(e=>{var t,i;const r=e.name.toLowerCase(),s=e.side;let a=this.idMatches(e.ontologyId,s);return a||(a=this.nameMatches(r,s)),a?(this.ctx.patchState({organ:a,sex:null===(t=e.sex)||void 0===t?void 0:t.toLowerCase(),side:null===(i=null==a?void 0:a.side)||void 0===i?void 0:i.toLowerCase()}),this.referenceData.state$.pipe(Zg(100),yi(1),Vk(200),Ti(()=>this.onOrganIriChange()))):ec})).subscribe(),this.modelChanged$.pipe(function(n){return e=>e.lift(new gRe(n))}(this.page.registrationStarted$.pipe(Fn(e=>e),Vk(5)))).subscribe(()=>this.page.setHasChanges())}idMatches(e,t){return g0.find(i=>!(!e||i.id!==e||i.side&&i.side!==t))}nameMatches(e,t){return g0.find(i=>i.side?i.organ.toLowerCase()===e&&i.side===t:i.organ.toLowerCase()===e)}setBlockSize(e){this.ctx.patchState({blockSize:e})}setRotation(e){this.ctx.patchState({rotation:e})}setPosition(e){var t;this.ga.event("placement",`${null===(t=this.snapshot.organ)||void 0===t?void 0:t.name}_placement`,`${e.x.toFixed(1)}_${e.y.toFixed(1)}_${e.z.toFixed(1)}`),this.ctx.patchState({position:e})}setSlicesConfig(e){this.ctx.patchState({slicesConfig:e})}setViewType(e){this.ctx.patchState({viewType:e})}setViewSide(e){this.ctx.patchState({viewSide:e})}get defaultPosition(){const e=this.snapshot.organDimensions;return{x:e.x+2*this.snapshot.blockSize.x,y:e.y/2,z:e.z/2}}setOrgan(e){this.ga.event("organ_select","organ",e.name),this.ctx.patchState({organ:e}),e.side&&this.ctx.patchState({side:e.side}),this.onOrganIriChange()}setSex(e){this.ctx.patchState({sex:e}),this.onOrganIriChange()}setSide(e){this.ctx.patchState({side:e}),this.onOrganIriChange()}setShowPrevious(e){this.ctx.patchState({showPrevious:e})}setExtractionSites(e){this.ctx.patchState({extractionSites:e})}setAnatomicalStructures(e){this.ctx.patchState({anatomicalStructures:e})}setExtractionSets(e){this.ctx.patchState({extractionSets:e})}toggleRegistrationBlocksVisibility(e,t){if(this.setShowPrevious(e),e){const i=t.map(r=>{var s;return Object.assign(Object.assign({},r),{opacity:Math.min(20,null!==(s=r.opacity)&&void 0!==s?s:20)})});this.setAnatomicalStructures(i)}else this.setAnatomicalStructures(t)}onOrganIriChange(){var e,t,i,r,s;const o=this.referenceData.getReferenceOrganIri((null===(e=this.snapshot.organ)||void 0===e?void 0:e.organ)||"",this.snapshot.sex,this.snapshot.side,this.snapshot.organ),a={x:100,y:100,z:100};if((null===(t=this.snapshot.organ)||void 0===t?void 0:t.sex)&&this.ctx.patchState({sex:null===(i=this.snapshot.organ)||void 0===i?void 0:i.sex}),o){const l=this.referenceData.snapshot,c={};for(const p of l.anatomicalStructures[o]||[]){const g=null!==(r=p.representation_of)&&void 0!==r?r:p["@id"];c[g]||(c[g]={id:null!==(s=p.representation_of)&&void 0!==s?s:p["@id"],name:p.label,visible:!0,opacity:20,tooltip:p.comment})}this.ctx.patchState({anatomicalStructures:Object.values(c)});const d=(l.extractionSets[o]||[]).map(p=>({name:p.label,sites:(0,uRe.sortBy)(p.extractionSites.map(g=>({id:g["@id"],name:g.label,visible:!1,opacity:0,tooltip:g.comment})),"name")}));this.ctx.patchState({extractionSets:d}),this.ctx.patchState({extractionSites:d.length>0?d[0].sites:[]});const f=l.organSpatialEntities[o];a.x=f.x_dimension,a.y=f.y_dimension,a.z=f.z_dimension}this.ctx.patchState({organIri:o,organDimensions:a}),this.ctx.patchState({position:this.defaultPosition})}};ai.\u0275fac=function(e){return new(e||ai)(I(xs),I(Nt),I(Ah))},ai.\u0275prov=ue({token:ai,factory:ai.\u0275fac}),xe([oi()],ai.prototype,"modelChanged$",null),xe([on()],ai.prototype,"setBlockSize",null),xe([on()],ai.prototype,"setRotation",null),xe([on()],ai.prototype,"setPosition",null),xe([on()],ai.prototype,"setSlicesConfig",null),xe([on()],ai.prototype,"setViewType",null),xe([on()],ai.prototype,"setViewSide",null),xe([oi()],ai.prototype,"defaultPosition",null),xe([on()],ai.prototype,"setOrgan",null),xe([on()],ai.prototype,"setSex",null),xe([on()],ai.prototype,"setSide",null),xe([on()],ai.prototype,"setShowPrevious",null),xe([on()],ai.prototype,"setExtractionSites",null),xe([on()],ai.prototype,"setAnatomicalStructures",null),xe([on()],ai.prototype,"setExtractionSets",null),ai=xe([xh(),cd({name:"model",defaults:{id:"",label:"",organ:{src:"",name:""},organIri:"",organDimensions:{x:90,y:90,z:90},sex:"male",side:"left",blockSize:{x:10,y:10,z:10},rotation:{x:0,y:0,z:0},position:{x:0,y:0,z:0},slicesConfig:{thickness:NaN,numSlices:NaN},viewType:"register",viewSide:"anterior",showPrevious:!1,extractionSites:[],anatomicalStructures:[],extractionSets:[]}})],ai);const T9=new ve("Default theme class");let YF=(()=>{class n{constructor(t){this.defaultTheme=this.theme=null!=t?t:""}static initialize(t){const{injector:i,location:r}=t;i.get(n).initialize(r,i)}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,i){this.element=t,this.injector=i,this.applyThemeClass(this.getTheme())}applyThemeClass(t,i="add"){var r;const{element:s,injector:o}=this;if(!t||!s||!o)return;const a=o.get(zc,null);if(!a)return;const l=s.nativeElement,c=null===(r=o.get(hm,null))||void 0===r?void 0:r.getContainerElement(),d="add"===i?"addClass":"removeClass";a[d](l,t),c&&a[d](c,t)}}return n.\u0275fac=function(t){return new(t||n)(I(T9,8))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})(),CRe=(()=>{class n{constructor(t){this.ga=t,this.clsName="ccf-name-input",this.firstNameValidator=new Sh("",[lG.required]),this.lastNameValidator=new Sh("",[lG.required]),this._name={firstName:"",lastName:""},this.nameChange=new Le}get name(){return this._name}set name(t){this._name=t,this.firstNameValidator.setValue((null==t?void 0:t.firstName)||""),this.lastNameValidator.setValue((null==t?void 0:t.lastName)||"")}updateName(t,i){const r=t.target;this.name=Object.assign(Object.assign({},this.name),{[i]:r.value}),this.ga.event("name_updated","name_input",i),this.nameChange.emit(this.name)}}return n.\u0275fac=function(t){return new(t||n)(E(xs))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-name-input"]],hostVars:2,hostBindings:function(t,i){2&t&&Rn(i.clsName)},inputs:{name:"name"},outputs:{nameChange:"nameChange"},decls:8,vars:2,consts:[[1,"field"],[1,"text","label"],["matInput","","matTooltip","Add your first name.",1,"input",3,"value","input"],["matInput","","matTooltip","Add your last name.",1,"input",3,"value","input"]],template:function(t,i){1&t&&(R(0,"mat-form-field",0),R(1,"mat-label",1),De(2,"First Name "),k(),R(3,"input",2),ge("input",function(s){return i.updateName(s,"firstName")}),k(),k(),R(4,"mat-form-field",0),R(5,"mat-label",1),De(6,"Last Name "),k(),R(7,"input",3),ge("input",function(s){return i.updateName(s,"lastName")}),k(),k()),2&t&&(G(3),ie("value",i.firstNameValidator.value),G(4),ie("value",i.lastNameValidator.value))},directives:[am,Gf,Xb,dc],styles:["[_nghost-%COMP%]{display:flex}[_nghost-%COMP%] .field[_ngcontent-%COMP%]:not(:last-child){padding-right:.75rem}[_nghost-%COMP%] .field[_ngcontent-%COMP%] .input[_ngcontent-%COMP%]{text-align:left;width:100%}"],changeDetection:0}),n})();const wRe=["thumbContainer"],ERe=["toggleBar"],SRe=["input"],MRe=function(n){return{enterDuration:n}},xRe=["*"],TRe=new ve("mat-slide-toggle-default-options",{providedIn:"root",factory:()=>({disableToggleValue:!1})});let ARe=0;const DRe={provide:ro,useExisting:T(()=>A9),multi:!0};class ORe{constructor(e,t){this.source=e,this.checked=t}}const IRe=Hf(Uf(nc(jf(class{constructor(n){this._elementRef=n}}))));let A9=(()=>{class n extends IRe{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-"+ ++ARe,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 Le,this.toggleChange=new Le,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=Mt(t)}get checked(){return this._checked}set checked(t){this._checked=Mt(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 ORe(this,this.checked))}_onLabelTextChange(){this._changeDetectorRef.detectChanges()}}return n.\u0275fac=function(t){return new(t||n)(E(rt),E(Sa),E(kn),Zr("tabindex"),E(TRe),E(Do,8))},n.\u0275cmp=Ne({type:n,selectors:[["mat-slide-toggle"]],viewQuery:function(t,i){if(1&t&&(Jn(wRe,5),Jn(ERe,5),Jn(SRe,5)),2&t){let r;_t(r=yt())&&(i._thumbEl=r.first),_t(r=yt())&&(i._thumbBarEl=r.first),_t(r=yt())&&(i._inputElement=r.first)}},hostAttrs:[1,"mat-slide-toggle"],hostVars:12,hostBindings:function(t,i){2&t&&(al("id",i.id),nn("tabindex",i.disabled?null:-1)("aria-label",null)("aria-labelledby",null),st("mat-checked",i.checked)("mat-disabled",i.disabled)("mat-slide-toggle-label-before","before"==i.labelPosition)("_mat-animation-noopable",i._noopAnimations))},inputs:{disabled:"disabled",disableRipple:"disableRipple",color:"color",tabIndex:"tabIndex",name:"name",id:"id",labelPosition:"labelPosition",ariaLabel:["aria-label","ariaLabel"],ariaLabelledby:["aria-labelledby","ariaLabelledby"],required:"required",checked:"checked",ariaDescribedby:["aria-describedby","ariaDescribedby"]},outputs:{change:"change",toggleChange:"toggleChange"},exportAs:["matSlideToggle"],features:[Dt([DRe]),ct],ngContentSelectors:xRe,decls:16,vars:20,consts:[[1,"mat-slide-toggle-label"],["label",""],[1,"mat-slide-toggle-bar"],["toggleBar",""],["type","checkbox","role","switch",1,"mat-slide-toggle-input","cdk-visually-hidden",3,"id","required","tabIndex","checked","disabled","change","click"],["input",""],[1,"mat-slide-toggle-thumb-container"],["thumbContainer",""],[1,"mat-slide-toggle-thumb"],["mat-ripple","",1,"mat-slide-toggle-ripple","mat-focus-indicator",3,"matRippleTrigger","matRippleDisabled","matRippleCentered","matRippleRadius","matRippleAnimation"],[1,"mat-ripple-element","mat-slide-toggle-persistent-ripple"],[1,"mat-slide-toggle-content",3,"cdkObserveContent"],["labelContent",""],[2,"display","none"]],template:function(t,i){if(1&t&&(wi(),R(0,"label",0,1),R(2,"div",2,3),R(4,"input",4,5),ge("change",function(s){return i._onChangeEvent(s)})("click",function(s){return i._onInputClick(s)}),k(),R(6,"div",6,7),tt(8,"div",8),R(9,"div",9),tt(10,"div",10),k(),k(),k(),R(11,"span",11,12),ge("cdkObserveContent",function(){return i._onLabelTextChange()}),R(13,"span",13),De(14,"\xa0"),k(),Ht(15),k(),k()),2&t){const r=vs(1),s=vs(12);nn("for",i.inputId),G(2),st("mat-slide-toggle-bar-no-side-margin",!s.textContent||!s.textContent.trim()),G(2),ie("id",i.inputId)("required",i.required)("tabIndex",i.tabIndex)("checked",i.checked)("disabled",i.disabled),nn("name",i.name)("aria-checked",i.checked.toString())("aria-label",i.ariaLabel)("aria-labelledby",i.ariaLabelledby)("aria-describedby",i.ariaDescribedby),G(5),ie("matRippleTrigger",r)("matRippleDisabled",i.disableRipple||i.disabled)("matRippleCentered",!0)("matRippleRadius",20)("matRippleAnimation",Hg(18,MRe,i._noopAnimations?0:150))}},directives:[Js,WD],styles:[".mat-slide-toggle{display:inline-block;height:24px;max-width:100%;line-height:24px;white-space:nowrap;outline:none;-webkit-tap-highlight-color:transparent}.mat-slide-toggle.mat-checked .mat-slide-toggle-thumb-container{transform:translate3d(16px, 0, 0)}[dir=rtl] .mat-slide-toggle.mat-checked .mat-slide-toggle-thumb-container{transform:translate3d(-16px, 0, 0)}.mat-slide-toggle.mat-disabled{opacity:.38}.mat-slide-toggle.mat-disabled .mat-slide-toggle-label,.mat-slide-toggle.mat-disabled .mat-slide-toggle-thumb-container{cursor:default}.mat-slide-toggle-label{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:flex;flex:1;flex-direction:row;align-items:center;height:inherit;cursor:pointer}.mat-slide-toggle-content{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mat-slide-toggle-label-before .mat-slide-toggle-label{order:1}.mat-slide-toggle-label-before .mat-slide-toggle-bar{order:2}[dir=rtl] .mat-slide-toggle-label-before .mat-slide-toggle-bar,.mat-slide-toggle-bar{margin-right:8px;margin-left:0}[dir=rtl] .mat-slide-toggle-bar,.mat-slide-toggle-label-before .mat-slide-toggle-bar{margin-left:8px;margin-right:0}.mat-slide-toggle-bar-no-side-margin{margin-left:0;margin-right:0}.mat-slide-toggle-thumb-container{position:absolute;z-index:1;width:20px;height:20px;top:-3px;left:0;transform:translate3d(0, 0, 0);transition:all 80ms linear;transition-property:transform}._mat-animation-noopable .mat-slide-toggle-thumb-container{transition:none}[dir=rtl] .mat-slide-toggle-thumb-container{left:auto;right:0}.mat-slide-toggle-thumb{height:20px;width:20px;border-radius:50%}.mat-slide-toggle-bar{position:relative;width:36px;height:14px;flex-shrink:0;border-radius:8px}.mat-slide-toggle-input{bottom:0;left:10px}[dir=rtl] .mat-slide-toggle-input{left:auto;right:10px}.mat-slide-toggle-bar,.mat-slide-toggle-thumb{transition:all 80ms linear;transition-property:background-color;transition-delay:50ms}._mat-animation-noopable .mat-slide-toggle-bar,._mat-animation-noopable .mat-slide-toggle-thumb{transition:none}.mat-slide-toggle .mat-slide-toggle-ripple{position:absolute;top:calc(50% - 20px);left:calc(50% - 20px);height:40px;width:40px;z-index:1;pointer-events:none}.mat-slide-toggle .mat-slide-toggle-ripple .mat-ripple-element:not(.mat-slide-toggle-persistent-ripple){opacity:.12}.mat-slide-toggle-persistent-ripple{width:100%;height:100%;transform:none}.mat-slide-toggle-bar:hover .mat-slide-toggle-persistent-ripple{opacity:.04}.mat-slide-toggle:not(.mat-disabled).cdk-keyboard-focused .mat-slide-toggle-persistent-ripple{opacity:.12}.mat-slide-toggle-persistent-ripple,.mat-slide-toggle.mat-disabled .mat-slide-toggle-bar:hover .mat-slide-toggle-persistent-ripple{opacity:0}@media(hover: none){.mat-slide-toggle-bar:hover .mat-slide-toggle-persistent-ripple{display:none}}.cdk-high-contrast-active .mat-slide-toggle-thumb,.cdk-high-contrast-active .mat-slide-toggle-bar{border:1px solid}.cdk-high-contrast-active .mat-slide-toggle.cdk-keyboard-focused .mat-slide-toggle-bar{outline:2px dotted;outline-offset:5px}\n"],encapsulation:2,changeDetection:0}),n})(),D9=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({}),n})(),O9=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[D9,_l,On,SE],D9,On]}),n})(),XF=(()=>{class n{constructor(t){this.ga=t,this.clsName="ccf-labeled-slide-toggle",this.labels=["Left","Right"],this.value="Left",this.disabled=!1,this.valueChange=new Le}get left(){const{value:t,labels:i}=this;return t!==i[1]}updateToggle(t){this.value=t?this.labels[0]:this.labels[1],this.ga.event("slide_toggle_toggled","slide_toggle",this.value),this.valueChange.emit(this.value)}}return n.\u0275fac=function(t){return new(t||n)(E(xs))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-labeled-slide-toggle"]],hostVars:2,hostBindings:function(t,i){2&t&&Rn(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=Zi();R(0,"span",0),ge("click",function(){en(r);const o=vs(3);return i.left||o.toggle(),i.updateToggle(!0)}),De(1),k(),R(2,"mat-slide-toggle",1,2),ge("change",function(o){return i.updateToggle(!o.checked)}),k(),R(4,"span",0),ge("click",function(){en(r);const o=vs(3);return i.left&&o.toggle(),i.updateToggle(!1)}),De(5),k()}2&t&&(st("disabled",i.disabled)("highlighted",i.left),G(1),xi(i.labels[0]),G(1),ie("disabled",i.disabled)("checked",!i.left),G(2),st("disabled",i.disabled)("highlighted",!i.left),G(1),xi(i.labels[1]))},directives:[A9],styles:["[_nghost-%COMP%] .slide-label[_ngcontent-%COMP%]{margin:0 1rem;transition:color .6s;cursor:pointer}[_nghost-%COMP%] .disabled[_ngcontent-%COMP%]{opacity:30%;cursor:not-allowed}"],changeDetection:0}),n})();const kRe=function(){return["Male","Female"]},FRe=function(n){return[n]};let NRe=(()=>{class n{constructor(t,i,r){this.page=t,this.model=i,this.dialogRef=r,this.clsName="ccf-registration-content",this.sexByLabel$=this.model.sex$.pipe(Ae(s=>"female"===s?"Female":"Male")),this.organList=qF,r.disableClose=!0}setSexFromLabel(t){this.currentSex=t,this.sexSelected=!0}checkNameValid(t){this.nameValid=t.firstName.length>0&&t.lastName.length>0}organSelect(t){this.currentOrgan=t,this.organSelected=!0}registerButtonClick(t){t&&t.preventDefault(),this.organSelected&&this.nameValid&&this.closeDialog()}closeDialog(){this.model.setSex("Female"===this.currentSex?"female":"male"),this.model.setOrgan(this.currentOrgan),this.dialogRef.close(!0),this.page.registrationStarted()}}return n.\u0275fac=function(t){return new(t||n)(E(ji),E(ai),E(Qm))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-registration-content"]],hostVars:2,hostBindings:function(t,i){2&t&&Rn(i.clsName)},decls:17,vars:18,consts:[[1,"modal"],["mat-dialog-content",""],[3,"name","nameChange"],["matTooltip","Select sex to filter organs.",1,"organ-sliders"],[1,"slider-label"],[1,"toggle","gender",3,"labels","value","valueChange"],[1,"selector-label"],[1,"selector-container"],[3,"organList","selectedOrgans","expanded","organsChanged"],["organSelector",""],["mat-button","",1,"registration-button",3,"matTooltip","click"]],template:function(t,i){1&t&&(R(0,"div",0),R(1,"div",1),R(2,"ccf-name-input",2),ge("nameChange",function(s){return i.page.setUserName(s),i.checkNameValid(s)}),Kt(3,"async"),k(),R(4,"div",3),R(5,"div",4),De(6,"Donor Sex:"),k(),R(7,"ccf-labeled-slide-toggle",5),ge("valueChange",function(s){return i.setSexFromLabel(s)}),Kt(8,"async"),k(),k(),R(9,"div",6),De(10,"Select an organ"),k(),R(11,"div",7),R(12,"ccf-organ-selector",8,9),ge("organsChanged",function(s){return i.organSelect(s[0])}),Kt(14,"async"),k(),k(),k(),R(15,"button",10),ge("click",function(s){return i.registerButtonClick(s)}),De(16,"START REGISTRATION"),k(),k()),2&t&&(G(2),ie("name",rn(3,9,i.page.user$)),G(5),ie("labels",fv(15,kRe))("value",rn(8,11,i.sexByLabel$)),G(5),ie("organList",i.organList)("selectedOrgans",Hg(16,FRe,rn(14,13,i.model.organ$)))("expanded",!0),G(3),st("disabled",!i.organSelected||!i.nameValid),ie("matTooltip",i.organSelected&&i.nameValid?"":"Required: Enter first and last name, and select an organ"))},directives:[CRe,dc,XF,p9,lh],pipes:[Hc],styles:[".modal[_ngcontent-%COMP%]{padding:1rem;border-radius:4px;max-width:47rem}.modal[_ngcontent-%COMP%] .organ-sliders[_ngcontent-%COMP%]{display:flex;height:3rem;align-items:center}.modal[_ngcontent-%COMP%] .organ-sliders[_ngcontent-%COMP%] .slider-label[_ngcontent-%COMP%]{font-weight:600}.modal[_ngcontent-%COMP%] .selector-label[_ngcontent-%COMP%]{font-weight:600;height:3rem;line-height:3rem}.modal[_ngcontent-%COMP%] .selector-container[_ngcontent-%COMP%]{margin:0 auto}.modal[_ngcontent-%COMP%] .registration-button[_ngcontent-%COMP%]{display:block;margin:2rem auto 0;transition:.6s}.modal[_ngcontent-%COMP%] .registration-button.disabled[_ngcontent-%COMP%]{pointer-events:none}"],changeDetection:0}),n})(),LRe=(()=>{class n{constructor(t,i,r){this.dialog=t,this.page=i,this.model=r,this.clsName="ccf-registration-modal"}ngOnInit(){Qi([this.page.user$,this.model.organ$]).pipe(Zg(500),yi(1),Ti(([t,i])=>{""!==t.firstName&&""!==t.lastName&&""!==i.src||this.openDialog()})).subscribe()}openDialog(){this.dialog.open(NRe,{autoFocus:!1})}}return n.\u0275fac=function(t){return new(t||n)(E(_p),E(ji),E(ai))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-registration-modal"]],hostVars:2,hostBindings:function(t,i){2&t&&Rn(i.clsName)},decls:0,vars:0,template:function(t,i){},encapsulation:2}),n})();function BRe(n,e){1&n&&function(n,e,t){_f(n,e,t),yf()}(0)}function VRe(n,e){if(1&n){const t=Zi();R(0,"div",4),ge("click",function(){return en(t),Qe().page.cancelRegistration()}),R(1,"mat-icon",5),De(2,"chevron_left"),k(),R(3,"span",6),De(4,"BACK"),k(),k()}}function zRe(n,e){if(1&n&&(R(0,"a",7),tt(1,"div",8),k()),2&n){const t=Qe();ie("href",t.homeUrl,Ud)("matTooltip",t.logoTooltip)}}let jRe=(()=>{class n{constructor(t){this.page=t,this.clsName="ccf-header"}}return n.\u0275fac=function(t){return new(t||n)(E(ji))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-header"]],hostVars:2,hostBindings:function(t,i){2&t&&Rn(i.clsName)},inputs:{homeUrl:"homeUrl",logoTooltip:"logoTooltip"},decls:7,vars:5,consts:[[4,"ngIf","ngIfThen","ngIfElse"],["backButton",""],["logo",""],[1,"filler"],["rel","noreferrer noopener",1,"link","home",3,"click"],[1,"icon","backbutton"],[1,"text"],["rel","noreferrer noopener","matTooltipPosition","right",1,"link","portal",3,"href","matTooltip"],["aria-hidden","false","aria-label","Reset tool",1,"logo"]],template:function(t,i){if(1&t&&(mt(0,BRe,1,0,"ng-container",0),Kt(1,"async"),mt(2,VRe,5,0,"ng-template",null,1,jw),mt(4,zRe,2,2,"ng-template",null,2,jw),tt(6,"div",3)),2&t){const r=vs(3),s=vs(5);ie("ngIf",rn(1,3,i.page.useCancelRegistrationCallback$))("ngIfThen",r)("ngIfElse",s)}},directives:[zr,rs,dc],pipes:[Hc],styles:["[_nghost-%COMP%]{display:flex;align-items:center;min-height:4rem;padding:0 1.5rem;border-bottom-width:1px;border-bottom-style:solid}[_nghost-%COMP%] .text[_ngcontent-%COMP%]{padding:.25rem 0;height:2rem;display:flex;align-items:center;font-weight:lighter;font-size:1.5rem}[_nghost-%COMP%] .link[_ngcontent-%COMP%]{display:flex;align-items:center;cursor:pointer;text-decoration:none;padding:.25rem 0}[_nghost-%COMP%] .home[_ngcontent-%COMP%] *[_ngcontent-%COMP%]{transition:color .6s}[_nghost-%COMP%] .home[_ngcontent-%COMP%] .backbutton[_ngcontent-%COMP%]{font-size:2.25rem;width:2.25rem;height:2.25rem}[_nghost-%COMP%] .portal[_ngcontent-%COMP%]{height:100%;width:25rem;align-items:center;display:flex}[_nghost-%COMP%] .logo[_ngcontent-%COMP%]{width:100%;height:50%;background-repeat:no-repeat;background-size:contain}[_nghost-%COMP%] .filler[_ngcontent-%COMP%]{flex-grow:1;margin:0}"],changeDetection:0}),n})();const I9={isolated:!0},P9=new ve("Message service configuration",{providedIn:"root",factory:()=>I9});let URe=(()=>{class n{constructor(t,i,r){this.source=t,this.channel=i,this.messages=r}sendMessage(t){this.channel.next({id:this.nextMessageId(),source:this.source,payload:t})}getMessages(){return this.messages.pipe(Fn(t=>t.source!==this.source))}getMessagesFromSource(t){return this.getMessages().pipe(Fn(i=>i.source===t))}getMessagesFromSources(t){return this.getMessages().pipe(Fn(i=>t.includes(i.source)))}nextMessageId(){return n.counter++}}return n.counter=0,n})();const _0=(()=>{class n{constructor(t,i){this.config=t,this.parent=i,this.channel=new Se,this.messages=t.isolated||!i?this.channel.asObservable():ui([this.channel,i.messages.pipe(qj(()=>!this.channel.closed))]).pipe(uo())}ngOnDestroy(){this.channel.complete()}connect(t){return new URe(t,this.channel,this.messages)}}return n.\u0275fac=function(t){return new(t||n)(I(P9),I(n,12))},n.\u0275prov=ue({token:n,factory:n.\u0275fac,providedIn:"root"}),n})(),HRe=["*"];let bx=(()=>{class n{constructor(t,i){this.className="ccf-drawer-content",this.animationsEnabled=!1,this.leftMargin=0,this.rightMargin=0,this.faded=!1,this.drawers=[],this.subscriptions=new Te;const r=t.connect(this).getMessages();this.subscriptions.add(r.subscribe(s=>{this.handleMessage(s)&&i.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 i=t.source.position,{opened:r,width:s,margin:o}=t.payload;return this.updateMargin(i,r,s,o),this.updateFaded(),!0}default:return!1}}updateMargin(t,i,r,s){const o=i?r+s:s;"start"===t?this.leftMargin=o:this.rightMargin=o}updateFaded(){const[t,i]=this.drawers;this.faded=!!((null==t?void 0:t.opened)&&(null==t?void 0:t.expanded)||(null==i?void 0:i.opened)&&(null==i?void 0:i.expanded))}}return n.\u0275fac=function(t){return new(t||n)(E(_0),E(kn))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-drawer-content"]],hostVars:9,hostBindings:function(t,i){2&t&&(Pg("@fadeInOut",i.faded),Rn(i.className),vf("margin-left",i.leftMargin,"px")("margin-right",i.rightMargin,"px"),st("cff-drawer-content-animations",i.animationsEnabled))},ngContentSelectors:HRe,decls:1,vars:0,template:function(t,i){1&t&&(wi(),Ht(0))},styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;height:100%;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:[tc("fadeInOut",[wr("false",ti({opacity:1})),wr("true",ti({opacity:0})),Qs("false <=> true",Ao("1s"))])]},changeDetection:0}),n})();const $Re=["*"],KF={params:{width:0,margin:0,margin2:0}};class GRe{constructor(){this.initialized=!1,this.deferred=new Promise(e=>{this.resolve=e})}set(){this.initialized=!0,this.resolve()}wait(){return yl(this,void 0,void 0,function*(){return this.deferred})}valueOf(){return this.initialized}}let ZF=(()=>{class n{constructor(t,i,r){this.element=r,this.className="ccf-drawer",this._position="start",this._opened=!1,this._expanded=!1,this.openedChange=new Le(!0),this.expandedChange=new Le(!0),this.stateChange=new Le(!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 GRe,this.subscriptions=new Te,this.channel=t.connect(this),this.subscriptions.add(this.channel.getMessages().subscribe(s=>{this.handleMessage(s)&&i.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(Mt(t))}get expanded(){return this._expanded}set expanded(t){this.toggleExpanded(Mt(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 i=t.getBoundingClientRect(),r=i.right-i.left;return 0===r?0:(this._measuredWidth=r,r)}get measuredMargin(){if(this._measuredMargin>0)return this._measuredMargin;const t=this.element.nativeElement;if(!t)return 0;const s=globalThis.getComputedStyle(t).getPropertyValue("start"===this.position?"margin-right":"margin-left"),o=Number(s.slice(0,-2));return this._measuredMargin=o,o}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 yl(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 n.\u0275fac=function(t){return new(t||n)(E(_0),E(kn),E(rt))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-drawer"]],hostVars:10,hostBindings:function(t,i){1&t&&Qy("@openClose.done",function(){return i.closeOpenDone()})("@expandCollapse.done",function(){return i.expandCollapseDone()}),2&t&&(Pg("@openClose",i.openedState)("@expandCollapse",i.expandedStateObj),Rn(i.className),st("ccf-drawer-end",i.classEnd)("ccf-drawer-opened",i.opened)("ccf-drawer-expanded",i.expanded))},inputs:{position:"position",opened:"opened",expanded:"expanded"},outputs:{openedChange:"openedChange",expandedChange:"expandedChange",stateChange:"stateChange"},exportAs:["ccfDrawer"],ngContentSelectors:$Re,decls:2,vars:0,consts:[[1,"cff-drawer-inner-container"]],template:function(t,i){1&t&&(wi(),R(0,"div",0),Ht(1),k())},styles:["[_nghost-%COMP%]{display:block;position:absolute;top:0;bottom:0;z-index:2;outline:0;transform:translate(-100%)}.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:[tc("openClose",[wr("open, open-instant",ti({transform:"none"})),wr("closed",ti({})),Qs("closed => open-instant",Ao(0)),Qs("closed <=> open, open-instant => closed",Ao(".5s ease-in-out"))]),tc("expandCollapse",[wr("collapsed",ti({})),wr("half",ti({width:"calc(50% - {{ margin }}px)"}),KF),wr("extended",ti({width:"calc(100% - {{ width }}px - {{ margin }}px)"}),KF),wr("full",ti({width:"calc(100% - {{ margin }}px - {{ margin2 }}px)"}),KF),Qs("* <=> *",Ao(".5s ease-in-out"))])]},changeDetection:0}),n})();function WRe(n,e){1&n&&(R(0,"ccf-drawer-content"),Ht(1,2),k())}const qRe=[[["ccf-drawer"]],[["ccf-drawer-content"]],"*"],YRe=["ccf-drawer","ccf-drawer-content","*"];function R9(n){throw new Error(`Multiple drawers in position ${n}`)}let XRe=(()=>{class n{constructor(t,i){this.cdr=i,this.className="ccf-drawer-container",this.subscriptions=new Te,this.channel=t.connect(this),this.subscriptions.add(this.channel.getMessages().subscribe(r=>{this.handleMessage(r)&&i.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(Rr(null)).subscribe(()=>{const t=this.validateDrawers();this.channel.sendMessage({type:"drawer-containers-changed",drawers:t}),this.cdr.markForCheck()}),this.content1.changes.pipe(Rr(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(),i=t.filter(s=>"start"===s.position),r=t.filter(s=>"end"===s.position);return i.length>1&&R9("start"),r.length>1&&R9("end"),[i[0],r[0]]}}return n.\u0275fac=function(t){return new(t||n)(E(_0),E(kn))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-drawer-container"]],contentQueries:function(t,i,r){if(1&t&&(ei(r,ZF,5),ei(r,bx,5)),2&t){let s;_t(s=yt())&&(i.drawers=s),_t(s=yt())&&(i.content1=s)}},viewQuery:function(t,i){if(1&t&&Jn(bx,5),2&t){let r;_t(r=yt())&&(i.content2=r)}},hostVars:2,hostBindings:function(t,i){2&t&&Rn(i.className)},exportAs:["ccfDrawerContainer"],features:[Dt([_0])],ngContentSelectors:YRe,decls:3,vars:1,consts:[[4,"ngIf"]],template:function(t,i){1&t&&(wi(qRe),Ht(0),Ht(1,1),mt(2,WRe,2,0,"ccf-drawer-content",0)),2&t&&(G(2),ie("ngIf",!i.hasWrappedContent))},directives:[zr,bx],styles:["[_nghost-%COMP%]{display:block;position:relative;z-index:1;overflow:hidden;-webkit-overflow-scrolling:touch}"],changeDetection:0}),n})();var Cx,KRe=ze(457),ZRe=new Uint8Array(16);function QRe(){if(!Cx&&!(Cx="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Cx(ZRe)}const JRe=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,tke=function(n){return"string"==typeof n&&JRe.test(n)};for(var Ls=[],QF=0;QF<256;++QF)Ls.push((QF+256).toString(16).substr(1));const ske=function(n,e,t){var i=(n=n||{}).random||(n.rng||QRe)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,e){t=t||0;for(var r=0;r<16;++r)e[t+r]=i[r];return e}return function(n){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,t=(Ls[n[e+0]]+Ls[n[e+1]]+Ls[n[e+2]]+Ls[n[e+3]]+"-"+Ls[n[e+4]]+Ls[n[e+5]]+"-"+Ls[n[e+6]]+Ls[n[e+7]]+"-"+Ls[n[e+8]]+Ls[n[e+9]]+"-"+Ls[n[e+10]]+Ls[n[e+11]]+Ls[n[e+12]]+Ls[n[e+13]]+Ls[n[e+14]]+Ls[n[e+15]]).toLowerCase();if(!tke(t))throw TypeError("Stringified UUID is invalid");return t}(i)};function k9(n){const e=new $t(n.transformMatrix),t=e.transformAsPoint([-1,-1,-1],[]),i=e.transformAsPoint([1,1,1],[]);return new Di({lowerBound:new S(...t.map((r,s)=>Math.min(r,i[s]))),upperBound:new S(...i.map((r,s)=>Math.max(r,t[s])))})}let as=class extends Jm{constructor(e){super(),this.injector=e,this.gizmo$=ht([{"@id":"http://purl.org/ccf/latest/ccf.owl#VHMaleOrgans_VHM_Spleen_Colic_Surface","@type":"SpatialSceneNode",scenegraph:"https://hubmapconsortium.github.io/ccf-3d-reference-object-library/Assets/body4Mesh_1338.glb",transformMatrix:new $t($t.IDENTITY).scale([2,2,2]).rotateY(ib(0)),tooltip:"Gizmo",unpickable:!0,_lighting:"pbr",zoomBasedOpacity:!1,color:[255,255,255,255],opacity:1}])}get nodes$(){return Qi([this.placementCube$,this.referenceOrganNodes$,this.previousRegistrationNodes$,this.nodeCollisions$]).pipe(Ae(([e,t,i,r])=>[...e,...i,...t,...this.snapshot.showCollisions?r:[]]))}get rotatedNodes$(){return Qi([this.rotation$,this.nodes$]).pipe(Ae(([e,t])=>0===e?t:t.map(i=>Object.assign(Object.assign({},i),{transformMatrix:new $t($t.IDENTITY).rotateY(ib(e)).multiplyRight(i.transformMatrix)}))))}get referenceOrganNodes$(){return Qi([this.model.anatomicalStructures$,this.model.extractionSites$,this.model.organIri$]).pipe(Zg(400),Ae(([e,t,i])=>this.createSceneNodes(i,[...e,...t])))}get referenceOrganSimpleNodes$(){return Qi([this.model.anatomicalStructures$,this.model.organIri$,this.referenceData.state$]).pipe(Ae(([e,t,i])=>e.map(r=>{var s;return i.sceneNodeLookup[r.id]?[Object.assign(Object.assign({},i.simpleSceneNodeLookup[r.id]),{opacity:(null!==(s=r.opacity)&&void 0!==s?s:100)/100,color:[255,255,255,255]})]:(i.anatomicalStructures[t]||[]).filter(o=>o.representation_of===r.id).map(o=>{var a;return Object.assign(Object.assign({},i.simpleSceneNodeLookup[o["@id"]]),{opacity:(null!==(a=r.opacity)&&void 0!==a?a:100)/100,color:[255,255,255,255]})})}).reduce((r,s)=>r.concat(s),[])))}get nodeCollisions$(){return Qi([this.referenceOrganSimpleNodes$,this.placementCube$]).pipe(Fn(([e,t])=>t.length>0),Ae(([e,t])=>{const i=k9(t[0]);return e.filter(r=>i.overlaps(k9(r)))}))}get previousRegistrationNodes$(){return Qi([this.model.organIri$,this.model.showPrevious$,this.registration.previousRegistrations$]).pipe(Ae(([e,t,i])=>t?i.map(r=>{const s=Array.isArray(r.placement)?r.placement[0]:r.placement;if(s.target===e){const o=this.model.snapshot.organDimensions,a=[o.x,o.y,o.z].map(l=>-l/1e3/2);return{"@id":r["@id"],"@type":"SpatialSceneNode",transformMatrix:new $t($t.IDENTITY).translate([s.x_translation,s.y_translation,s.z_translation].map((l,c)=>l/1e3+a[c])).rotateXYZ([s.x_rotation,s.y_rotation,s.z_rotation].map(ib)).scale([r.x_dimension,r.y_dimension,r.z_dimension].map(l=>l/1e3/2)),color:[25,118,210,200],tooltip:r.label,unpickable:!0}}}).filter(r=>!!r):[]))}get placementCube$(){return Qi([this.model.viewType$,this.model.blockSize$,this.model.rotation$,this.model.position$,this.model.organ$]).pipe(Ae(([e,t,i,r,s])=>""===s.src?[]:[this.placementCube]))}get placementCube(){const{viewType:e,blockSize:t,rotation:i,position:r,organDimensions:s}=this.model.snapshot,o=[s.x,s.y,s.z].map(a=>-a/1e3/2);return{"@id":"#DraftPlacement","@type":"SpatialSceneNode",transformMatrix:new $t($t.IDENTITY).translate([r.x,r.y,r.z].map((a,l)=>a/1e3+o[l])).rotateXYZ([i.x,i.y,i.z].map(ib)).scale([t.x,t.y,t.z].map(a=>a/1e3/2)),color:[255,255,0,200],tooltip:"Draft Placement",unpickable:"3d"===e}}get rotation$(){return this.model.viewSide$.pipe(Ae(e=>{let t=0;switch(e){case"left":t=-90;break;case"right":t=90;break;case"posterior":t=180}return t}))}ngxsOnInit(){super.ngxsOnInit(),this.model=this.injector.get(ai),this.registration=this.injector.get(Sr),this.referenceData=this.injector.get(fc)}createSceneNodes(e,t){const i=this.referenceData.snapshot;return t.filter(r=>r.visible&&r.opacity&&r.opacity>0).map(r=>{var s;return i.sceneNodeLookup[r.id]?[Object.assign(Object.assign({},i.sceneNodeLookup[r.id]),{opacity:(null!==(s=r.opacity)&&void 0!==s?s:100)/100,color:[255,255,255,255]})]:(i.anatomicalStructures[e]||[]).filter(o=>o.representation_of===r.id).map(o=>{var a;return Object.assign(Object.assign({},i.sceneNodeLookup[o["@id"]]),{opacity:(null!==(a=r.opacity)&&void 0!==a?a:100)/100,color:[255,255,255,255]})})}).reduce((r,s)=>r.concat(s),[])}};as.\u0275fac=function(e){return new(e||as)(I(Nt))},as.\u0275prov=ue({token:as,factory:as.\u0275fac}),xe([oi()],as.prototype,"nodes$",null),xe([oi()],as.prototype,"rotatedNodes$",null),xe([oi()],as.prototype,"referenceOrganNodes$",null),xe([oi()],as.prototype,"referenceOrganSimpleNodes$",null),xe([oi()],as.prototype,"nodeCollisions$",null),xe([oi()],as.prototype,"previousRegistrationNodes$",null),xe([oi()],as.prototype,"placementCube$",null),xe([oi()],as.prototype,"placementCube",null),xe([oi()],as.prototype,"rotation$",null),as=xe([xh(),cd({name:"scene",defaults:{showCollisions:!hu.production}})],as);let ko=class extends uDe{constructor(e){super(),this.injector=e,this._latestTags=[]}get tags$(){return Qi([this.entities$,this.scene.nodeCollisions$]).pipe(Ae(([e,t])=>{const i=[],r=new Set,s=new Set;Object.entries(e).forEach(([o,a])=>{"removed"===a.type?s.add(o):(r.add(o),i.push(a))});for(const o of t){const a=o.representation_of;a&&!s.has(a)&&!r.has(a)&&(r.add(a),i.push({id:a,label:o.tooltip,type:"assigned"}))}return i}))}get latestTags(){return this._latestTags}ngxsOnInit(){super.ngxsOnInit(),this.model=this.injector.get(ai),this.scene=this.injector.get(as),this.page=this.injector.get(ji),this.tags$.subscribe(e=>{this._latestTags=e}),this.entities$.subscribe(()=>this.page.setHasChanges())}addTags(e){for(const t of e)this.addTagRaw(t)}addTag(e){this.addTagRaw(e)}removeTag(e){this.snapshot.entities[e.id]?this.updateEntitiesMany([{id:e.id,changes:{type:"removed"}}]):this.addEntityOne(Object.assign(Object.assign({},e),{type:"removed"}))}searchExternal(e,t){const i=this.model.snapshot.anatomicalStructures.filter(r=>-1!==r.name.toLowerCase().indexOf(e.toLowerCase()));return[{totalCount:i.length,results:i.map(r=>({id:r.id,label:r.name,type:"added"})).slice(0,t)}]}addTagRaw(e){this.snapshot.entities[e.id]?this.updateEntitiesMany([{id:e.id,changes:{type:"added"}}]):this.addEntityOne(Object.assign(Object.assign({},e),{type:"added"}))}};ko.\u0275fac=function(e){return new(e||ko)(I(Nt))},ko.\u0275prov=ue({token:ko,factory:ko.\u0275fac}),xe([oi()],ko.prototype,"tags$",null),xe([on()],ko.prototype,"addTags",null),xe([on()],ko.prototype,"addTag",null),xe([on()],ko.prototype,"removeTag",null),xe([lu.ak],ko.prototype,"searchExternal",null),ko=xe([xh(),cd({name:"tags",defaults:Object.assign({},{ids:[],entities:{}})})],ko);let Sr=class extends Jm{constructor(e,t){super(),this.injector=e,this.globalConfig=t,this.displayErrors$=this.state$.pipe(ur("displayErrors"))}get metadata$(){return Qi([this.page.state$,this.model.state$,this.tags.tags$]).pipe(Ae(([e,t,i])=>this.buildMetadata(e,t,i)))}get jsonld$(){return Qi([this.page.state$,this.model.state$,this.tags.tags$]).pipe(Ae(([e,t,i])=>this.buildJsonLd(e,t,i)))}get valid$(){return Qi([this.page.state$,this.model.state$]).pipe(Ae(()=>this.isValid))}get previousRegistrations$(){const{globalConfig:e,state$:t}=this;return Qi([t.pipe(ur("registrations")),e.getOption("fetchPreviousRegistrations").pipe(Pr(s=>{var o;return null!==(o=null==s?void 0:s())&&void 0!==o?o:[[]]}),Rr([]))]).pipe(Ae(([s,o])=>[...s,...o]))}get currentIdentifier(){return ske()}get currentDate(){return(new Date).toISOString().split("T")[0]}ngxsOnInit(){super.ngxsOnInit(),this.page=this.injector.get(ji),this.model=this.injector.get(ai),this.tags=this.injector.get(ko),this.refData=this.injector.get(fc),this.globalConfig.config$.pipe(yi(1),Ti(({useDownload:e,register:t})=>this.ctx.patchState({useRegistrationCallback:!(e||!t)}))).subscribe(),this.globalConfig.getOption("editRegistration").pipe(aF(),Ti(e=>this.editRegistration(e))).subscribe()}editRegistration(e){return yl(this,void 0,void 0,function*(){const t=this.refData.normalizePlacement(Array.isArray(e.placement)?e.placement[0]:e.placement),i=this.refData.getOrganData(t.target);this.page.setUserName({firstName:e.creator_first_name,lastName:e.creator_last_name}),i&&(this.model.setOrgan(i.organ),i.sex&&this.model.setSex(i.sex),i.side&&this.model.setSide(i.side)),this.model.setBlockSize({x:e.x_dimension,y:e.y_dimension,z:e.z_dimension}),this.model.setRotation({x:t.x_rotation,y:t.y_rotation,z:t.z_rotation}),this.model.setSlicesConfig({thickness:e.slice_thickness||NaN,numSlices:e.slice_count||NaN}),yield new Promise(s=>{setTimeout(s,1e3)}),this.model.setPosition({x:t.x_translation,y:t.y_translation,z:t.z_translation});const r=new Set(e.ccf_annotations);this.tags.addTags(this.model.snapshot.anatomicalStructures.filter(s=>r.has(s.id)).map(s=>({id:s.id,label:s.name,type:"added"}))),this.page.registrationStarted()})}setUseRegistrationCallback(e){this.ctx.patchState({useRegistrationCallback:e})}setDisplayErrors(e){this.ctx.patchState({displayErrors:e})}addRegistration(e){this.ctx.setState(m0({registrations:vRe(e)}))}isDataValid(e,t){return[e.user.firstName,e.user.lastName,t.organ.src,t.organ.name,t.organ.organ].every(r=>!!r)}get isValid(){return this.isDataValid(this.page.snapshot,this.model.snapshot)}register(e){if(!this.isValid)return;const{globalConfig:{snapshot:{register:t}},page:i,model:r,snapshot:s}=this,o=this.buildJsonLd(i.snapshot,r.snapshot,this.tags.latestTags),a=JSON.stringify(o,void 0,2);if(e||void 0===e&&s.useRegistrationCallback)null==t||t(a);else{const l=new Blob([a],{type:"application/json",endings:"native"});(0,KRe.saveAs)(l,"registration-data.json")}this.addRegistration(o),this.setDisplayErrors(!1),this.page.clearHasChanges()}buildMetadata(e,t,i){const r=[];return e.registrationCallbackSet||r.push({label:"First Name",value:e.user.firstName},{label:"Last Name",value:e.user.lastName}),r.push({label:"Reference Organ Name",value:t.organ.name},{label:"Tissue Block Dimensions (mm)",value:this.xyzTripletToString(t.blockSize)},{label:"Tissue Block Position (mm)",value:this.xyzTripletToString(t.position)},{label:"Tissue Block Rotation",value:this.xyzTripletToString(t.rotation)},{label:"Anatomical Structure Tags",value:i.map(s=>s.label).join(", ")},{label:"Time Stamp",value:this.currentDate},{label:"Alignment ID",value:this.currentIdentifier}),r}buildJsonLd(e,t,i){var r,s;return{"@context":"https://hubmapconsortium.github.io/ccf-ontology/ccf-context.jsonld","@id":`http://purl.org/ccf/1.5/${this.currentIdentifier}`,"@type":"SpatialEntity",label:t.label||void 0,creator:`${e.user.firstName} ${e.user.lastName}`,creator_first_name:e.user.firstName,creator_last_name:e.user.lastName,creation_date:this.currentDate,ccf_annotations:i.map(o=>o.id),slice_thickness:(null===(r=t.slicesConfig)||void 0===r?void 0:r.thickness)||void 0,slice_count:(null===(s=t.slicesConfig)||void 0===s?void 0:s.numSlices)||void 0,x_dimension:+t.blockSize.x.toFixed(3),y_dimension:+t.blockSize.y.toFixed(3),z_dimension:+t.blockSize.z.toFixed(3),dimension_units:"millimeter",placement:{"@context":"https://hubmapconsortium.github.io/ccf-ontology/ccf-context.jsonld","@id":`http://purl.org/ccf/1.5/${this.currentIdentifier}_placement`,"@type":"SpatialPlacement",target:t.organIri,placement_date:this.currentDate,x_scaling:1,y_scaling:1,z_scaling:1,scaling_units:"ratio",x_rotation:+t.rotation.x.toFixed(3),y_rotation:+t.rotation.y.toFixed(3),z_rotation:+t.rotation.z.toFixed(3),rotation_order:"XYZ",rotation_units:"degree",x_translation:+t.position.x.toFixed(3),y_translation:+t.position.y.toFixed(3),z_translation:+t.position.z.toFixed(3),translation_units:"millimeter"}}}xyzTripletToString(e){return`${Math.round(e.x)}, ${Math.round(e.y)}, ${Math.round(e.z)}`}};function ake(n,e){if(1&n){const t=Zi();R(0,"mat-icon",2),ge("click",function(){return en(t),Qe().setAllOpacity(20)}),De(1,"refresh"),k()}2&n&&ie("matRippleCentered",!0)("matRippleUnbounded",!0)}function lke(n,e){if(1&n){const t=Zi();R(0,"div",3),ge("mouseenter",function(){const s=en(t).$implicit;return Qe().mouseOver(s)})("mouseleave",function(){return en(t),Qe().mouseOut()}),tt(1,"mat-icon",4),R(2,"div",5),De(3),k(),R(4,"div",6),R(5,"ccf-opacity-slider",7,8),ge("opacityChange",function(r){return en(t),Qe().updateOpacity(r)})("opacityReset",function(){return en(t),Qe().resetItem()})("visibilityToggle",function(){const s=en(t).$implicit;return Qe().toggleVisibility(s)}),k(),k(),k()}if(2&n){const t=e.$implicit,i=Qe();st("selected",!!i.selection&&i.getId(0,i.selection)===i.getId(0,t)),G(1),st("fade",!t.visible),G(1),st("hidden",t.id===(null==i.selection?null:i.selection.id)),Jy("title",t.name),G(1),xi(t.name),G(1),st("hidden",t.id!==(null==i.selection?null:i.selection.id)),G(1),ie("visible",t.visible)("opacity",i.selection?null==i.selection?null:i.selection.opacity:20)}}Sr.\u0275fac=function(e){return new(e||Sr)(I(Nt),I(Ah))},Sr.\u0275prov=ue({token:Sr,factory:Sr.\u0275fac}),xe([oi()],Sr.prototype,"metadata$",null),xe([oi()],Sr.prototype,"jsonld$",null),xe([oi()],Sr.prototype,"valid$",null),xe([oi()],Sr.prototype,"previousRegistrations$",null),xe([oi()],Sr.prototype,"currentIdentifier",null),xe([oi()],Sr.prototype,"currentDate",null),xe([on()],Sr.prototype,"setUseRegistrationCallback",null),xe([on()],Sr.prototype,"setDisplayErrors",null),xe([on()],Sr.prototype,"addRegistration",null),xe([oi()],Sr.prototype,"isValid",null),Sr=xe([xh(),cd({name:"registration",defaults:{useRegistrationCallback:!1,displayErrors:!1,registrations:[]}})],Sr);let cke=(()=>{class n{constructor(t){this.ga=t,this.clsName="ccf-visibility-menu",this.hover=new Le,this.itemsChange=new Le}toggleVisibility(t){t=Object.assign(Object.assign({},t),{visible:!t.visible}),this.selection&&t.id===this.selection.id&&(this.selection=Object.assign(Object.assign({},this.selection),{visible:t.visible})),this.ga.event("visibility_toggled","visibility_menu",""+t.id,+t.visible),this.updateOpacity(t.opacity)}mouseOver(t){this.selection=t===this.selection?void 0:t,this.hover.emit(t)}mouseOut(){this.selection=void 0,this.hover.emit(void 0)}updateOpacity(t){if(!this.selection)return;const i=Object.assign(Object.assign({},this.selection),{opacity:t});this.selection=i,this.items=this.items.map(r=>r.id===i.id?i:r),this.ga.event("opacity_update","visibility_menu",""+i.id,i.opacity),this.itemsChange.emit(this.items)}resetItem(){if(this.selection){const t=Object.assign(Object.assign({},this.selection),{opacity:20,visible:!0});this.selection=t,this.items=this.items.map(i=>i.id===t.id?t:i),this.ga.event("item_reset","visibility_menu",""+t.id),this.itemsChange.emit(this.items)}}setAllOpacity(t){this.items=this.items.map(i=>Object.assign(Object.assign({},i),{opacity:t,visible:!0})),this.ga.event("all_items_opacity_update","visibility_menu",void 0,t),this.itemsChange.emit(this.items)}getId(t,i){return i.id}}return n.\u0275fac=function(t){return new(t||n)(E(xs))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-visibility-menu"]],hostVars:2,hostBindings:function(t,i){2&t&&Rn(i.clsName)},inputs:{items:"items",selection:"selection"},outputs:{hover:"hover",itemsChange:"itemsChange"},decls:2,vars:3,consts:[["class","icon reset","matRipple","",3,"matRippleCentered","matRippleUnbounded","click",4,"ngIf"],["class","item-entry",3,"selected","mouseenter","mouseleave",4,"ngFor","ngForOf","ngForTrackBy"],["matRipple","",1,"icon","reset",3,"matRippleCentered","matRippleUnbounded","click"],[1,"item-entry",3,"mouseenter","mouseleave"],["svgIcon","app:opacity",1,"opacity-icon"],[1,"item-name",3,"title"],[1,"slider"],[3,"visible","opacity","opacityChange","opacityReset","visibilityToggle"],["slider",""]],template:function(t,i){1&t&&(mt(0,ake,2,2,"mat-icon",0),mt(1,lke,7,12,"div",1)),2&t&&(ie("ngIf",i.items.length),G(1),ie("ngForOf",i.items)("ngForTrackBy",i.getId))},directives:[zr,pl,rs,Js,LPe],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;margin-right:0;margin-left:0;max-height:18rem;overflow-y:auto;scrollbar-width:thin}[_nghost-%COMP%] .icon[_ngcontent-%COMP%]{padding:.25rem;border-radius:.25rem}[_nghost-%COMP%] .reset[_ngcontent-%COMP%]{transform:scaleX(-1);cursor:pointer;transition:.6s;position:absolute;top:3rem}[_nghost-%COMP%] .reset[_ngcontent-%COMP%]:hover{border-radius:2px}[_nghost-%COMP%] .item-entry[_ngcontent-%COMP%]{display:flex;height:2.25rem;align-items:center;flex-shrink:0;position:relative}[_nghost-%COMP%] .item-entry[_ngcontent-%COMP%] .opacity[_ngcontent-%COMP%]{cursor:pointer}[_nghost-%COMP%] .item-entry[_ngcontent-%COMP%] .opacity-icon[_ngcontent-%COMP%]{z-index:1;transition:.6s}[_nghost-%COMP%] .item-entry[_ngcontent-%COMP%] .opacity-icon[_ngcontent-%COMP%]:hover{border-radius:2px}[_nghost-%COMP%] .item-entry[_ngcontent-%COMP%] .item-name[_ngcontent-%COMP%]{-webkit-user-select:none;user-select:none;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-left:.5rem;opacity:1;transition-duration:.4s;transition-timing-function:ease-in-out;transition-property:opacity;max-width:calc(100% - 2.5rem)}[_nghost-%COMP%] .item-entry[_ngcontent-%COMP%] .item-name.hidden[_ngcontent-%COMP%]{opacity:0}[_nghost-%COMP%] .item-entry[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%]{width:calc(100% - 2rem);transition-duration:.3s;transition-timing-function:ease-in-out;transition-property:opacity;left:2rem;position:absolute;opacity:1}[_nghost-%COMP%] .item-entry[_ngcontent-%COMP%] .slider.hidden[_ngcontent-%COMP%]{opacity:0;transition-duration:.1s;transition-timing-function:ease-in-out;transition-property:opacity}"],changeDetection:0}),n})();const uke=["*"],F9=new ve("MatChipRemove"),N9=new ve("MatChipAvatar"),L9=new ve("MatChipTrailingIcon");class dke{constructor(e){this._elementRef=e}}const hke=Hf(Uf(nc(dke),"primary"),-1);let y0=(()=>{class n extends hke{constructor(t,i,r,s,o,a,l,c){super(t),this._ngZone=i,this._changeDetectorRef=o,this._hasFocus=!1,this.chipListSelectable=!0,this._chipListMultiple=!1,this._chipListDisabled=!1,this._selected=!1,this._selectable=!0,this._disabled=!1,this._removable=!0,this._onFocus=new Se,this._onBlur=new Se,this.selectionChange=new Le,this.destroyed=new Le,this.removed=new Le,this._addHostClassName(),this._chipRippleTarget=a.createElement("div"),this._chipRippleTarget.classList.add("mat-chip-ripple"),this._elementRef.nativeElement.appendChild(this._chipRippleTarget),this._chipRipple=new oj(this,i,this._chipRippleTarget,r),this._chipRipple.setupTriggerEvents(t),this.rippleConfig=s||{},this._animationsDisabled="NoopAnimations"===l,this.tabIndex=null!=c&&parseInt(c)||-1}get rippleDisabled(){return this.disabled||this.disableRipple||this._animationsDisabled||!!this.rippleConfig.disabled}get selected(){return this._selected}set selected(t){const i=Mt(t);i!==this._selected&&(this._selected=i,this._dispatchSelectionChange())}get value(){return void 0!==this._value?this._value:this._elementRef.nativeElement.textContent}set value(t){this._value=t}get selectable(){return this._selectable&&this.chipListSelectable}set selectable(t){this._selectable=Mt(t)}get disabled(){return this._chipListDisabled||this._disabled}set disabled(t){this._disabled=Mt(t)}get removable(){return this._removable}set removable(t){this._removable=Mt(t)}get ariaSelected(){return this.selectable&&(this._chipListMultiple||this.selected)?this.selected.toString():null}_addHostClassName(){const t="mat-basic-chip",i=this._elementRef.nativeElement;i.hasAttribute(t)||i.tagName.toLowerCase()===t?i.classList.add(t):i.classList.add("mat-standard-chip")}ngOnDestroy(){this.destroyed.emit({chip:this}),this._chipRipple._removeTriggerEvents()}select(){this._selected||(this._selected=!0,this._dispatchSelectionChange(),this._changeDetectorRef.markForCheck())}deselect(){this._selected&&(this._selected=!1,this._dispatchSelectionChange(),this._changeDetectorRef.markForCheck())}selectViaInteraction(){this._selected||(this._selected=!0,this._dispatchSelectionChange(!0),this._changeDetectorRef.markForCheck())}toggleSelected(t=!1){return this._selected=!this.selected,this._dispatchSelectionChange(t),this._changeDetectorRef.markForCheck(),this.selected}focus(){this._hasFocus||(this._elementRef.nativeElement.focus(),this._onFocus.next({chip:this})),this._hasFocus=!0}remove(){this.removable&&this.removed.emit({chip:this})}_handleClick(t){this.disabled?t.preventDefault():t.stopPropagation()}_handleKeydown(t){if(!this.disabled)switch(t.keyCode){case 46:case 8:this.remove(),t.preventDefault();break;case 32:this.selectable&&this.toggleSelected(!0),t.preventDefault()}}_blur(){this._ngZone.onStable.pipe(yi(1)).subscribe(()=>{this._ngZone.run(()=>{this._hasFocus=!1,this._onBlur.next({chip:this})})})}_dispatchSelectionChange(t=!1){this.selectionChange.emit({source:this,isUserInput:t,selected:this._selected})}}return n.\u0275fac=function(t){return new(t||n)(E(rt),E(dt),E(si),E(aj,8),E(kn),E(ut),E(Do,8),Zr("tabindex"))},n.\u0275dir=oe({type:n,selectors:[["mat-basic-chip"],["","mat-basic-chip",""],["mat-chip"],["","mat-chip",""]],contentQueries:function(t,i,r){if(1&t&&(ei(r,N9,5),ei(r,L9,5),ei(r,F9,5)),2&t){let s;_t(s=yt())&&(i.avatar=s.first),_t(s=yt())&&(i.trailingIcon=s.first),_t(s=yt())&&(i.removeIcon=s.first)}},hostAttrs:["role","option",1,"mat-chip","mat-focus-indicator"],hostVars:14,hostBindings:function(t,i){1&t&&ge("click",function(s){return i._handleClick(s)})("keydown",function(s){return i._handleKeydown(s)})("focus",function(){return i.focus()})("blur",function(){return i._blur()}),2&t&&(nn("tabindex",i.disabled?null:i.tabIndex)("disabled",i.disabled||null)("aria-disabled",i.disabled.toString())("aria-selected",i.ariaSelected),st("mat-chip-selected",i.selected)("mat-chip-with-avatar",i.avatar)("mat-chip-with-trailing-icon",i.trailingIcon||i.removeIcon)("mat-chip-disabled",i.disabled)("_mat-animation-noopable",i._animationsDisabled))},inputs:{color:"color",disableRipple:"disableRipple",tabIndex:"tabIndex",selected:"selected",value:"value",selectable:"selectable",disabled:"disabled",removable:"removable"},outputs:{selectionChange:"selectionChange",destroyed:"destroyed",removed:"removed"},exportAs:["matChip"],features:[ct]}),n})(),B9=(()=>{class n{constructor(t,i){this._parentChip=t,"BUTTON"===i.nativeElement.nodeName&&i.nativeElement.setAttribute("type","button")}_handleClick(t){const i=this._parentChip;i.removable&&!i.disabled&&i.remove(),t.stopPropagation()}}return n.\u0275fac=function(t){return new(t||n)(E(y0),E(rt))},n.\u0275dir=oe({type:n,selectors:[["","matChipRemove",""]],hostAttrs:[1,"mat-chip-remove","mat-chip-trailing-icon"],hostBindings:function(t,i){1&t&&ge("click",function(s){return i._handleClick(s)})},features:[Dt([{provide:F9,useExisting:n}])]}),n})();const V9=new ve("mat-chips-default-options"),gke=FO(class{constructor(n,e,t,i){this._defaultErrorStateMatcher=n,this._parentForm=e,this._parentFormGroup=t,this.ngControl=i}});let mke=0;class _ke{constructor(e,t){this.source=e,this.value=t}}let z9=(()=>{class n extends gke{constructor(t,i,r,s,o,a,l){super(a,s,o,l),this._elementRef=t,this._changeDetectorRef=i,this._dir=r,this.controlType="mat-chip-list",this._lastDestroyedChipIndex=null,this._destroyed=new Se,this._uid="mat-chip-list-"+mke++,this._tabIndex=0,this._userTabIndex=null,this._onTouched=()=>{},this._onChange=()=>{},this._multiple=!1,this._compareWith=(c,d)=>c===d,this._required=!1,this._disabled=!1,this.ariaOrientation="horizontal",this._selectable=!0,this.change=new Le,this.valueChange=new Le,this.ngControl&&(this.ngControl.valueAccessor=this)}get selected(){var t,i;return this.multiple?(null===(t=this._selectionModel)||void 0===t?void 0:t.selected)||[]:null===(i=this._selectionModel)||void 0===i?void 0:i.selected[0]}get role(){return this.empty?null:"listbox"}get multiple(){return this._multiple}set multiple(t){this._multiple=Mt(t),this._syncChipsState()}get compareWith(){return this._compareWith}set compareWith(t){this._compareWith=t,this._selectionModel&&this._initializeSelection()}get value(){return this._value}set value(t){this.writeValue(t),this._value=t}get id(){return this._chipInput?this._chipInput.id:this._uid}get required(){return this._required}set required(t){this._required=Mt(t),this.stateChanges.next()}get placeholder(){return this._chipInput?this._chipInput.placeholder:this._placeholder}set placeholder(t){this._placeholder=t,this.stateChanges.next()}get focused(){return this._chipInput&&this._chipInput.focused||this._hasFocusedChip()}get empty(){return(!this._chipInput||this._chipInput.empty)&&(!this.chips||0===this.chips.length)}get shouldLabelFloat(){return!this.empty||this.focused}get disabled(){return this.ngControl?!!this.ngControl.disabled:this._disabled}set disabled(t){this._disabled=Mt(t),this._syncChipsState()}get selectable(){return this._selectable}set selectable(t){this._selectable=Mt(t),this.chips&&this.chips.forEach(i=>i.chipListSelectable=this._selectable)}set tabIndex(t){this._userTabIndex=t,this._tabIndex=t}get chipSelectionChanges(){return Ni(...this.chips.map(t=>t.selectionChange))}get chipFocusChanges(){return Ni(...this.chips.map(t=>t._onFocus))}get chipBlurChanges(){return Ni(...this.chips.map(t=>t._onBlur))}get chipRemoveChanges(){return Ni(...this.chips.map(t=>t.destroyed))}ngAfterContentInit(){this._keyManager=new nO(this.chips).withWrap().withVerticalOrientation().withHomeAndEnd().withHorizontalOrientation(this._dir?this._dir.value:"ltr"),this._dir&&this._dir.change.pipe(Tn(this._destroyed)).subscribe(t=>this._keyManager.withHorizontalOrientation(t)),this._keyManager.tabOut.pipe(Tn(this._destroyed)).subscribe(()=>{this._allowFocusEscape()}),this.chips.changes.pipe(Rr(null),Tn(this._destroyed)).subscribe(()=>{this.disabled&&Promise.resolve().then(()=>{this._syncChipsState()}),this._resetChips(),this._initializeSelection(),this._updateTabIndex(),this._updateFocusForDestroyedChips(),this.stateChanges.next()})}ngOnInit(){this._selectionModel=new lS(this.multiple,void 0,!1),this.stateChanges.next()}ngDoCheck(){this.ngControl&&(this.updateErrorState(),this.ngControl.disabled!==this._disabled&&(this.disabled=!!this.ngControl.disabled))}ngOnDestroy(){this._destroyed.next(),this._destroyed.complete(),this.stateChanges.complete(),this._dropSubscriptions()}registerInput(t){this._chipInput=t,this._elementRef.nativeElement.setAttribute("data-mat-chip-input",t.id)}setDescribedByIds(t){this._ariaDescribedby=t.join(" ")}writeValue(t){this.chips&&this._setSelectionByValue(t,!1)}registerOnChange(t){this._onChange=t}registerOnTouched(t){this._onTouched=t}setDisabledState(t){this.disabled=t,this.stateChanges.next()}onContainerClick(t){this._originatesFromChip(t)||this.focus()}focus(t){this.disabled||this._chipInput&&this._chipInput.focused||(this.chips.length>0?(this._keyManager.setFirstItemActive(),this.stateChanges.next()):(this._focusInput(t),this.stateChanges.next()))}_focusInput(t){this._chipInput&&this._chipInput.focus(t)}_keydown(t){const i=t.target;i&&i.classList.contains("mat-chip")&&(this._keyManager.onKeydown(t),this.stateChanges.next())}_updateTabIndex(){this._tabIndex=this._userTabIndex||(0===this.chips.length?-1:0)}_updateFocusForDestroyedChips(){if(null!=this._lastDestroyedChipIndex)if(this.chips.length){const t=Math.min(this._lastDestroyedChipIndex,this.chips.length-1);this._keyManager.setActiveItem(t)}else this.focus();this._lastDestroyedChipIndex=null}_isValidIndex(t){return t>=0&&tr.deselect()),Array.isArray(t))t.forEach(r=>this._selectValue(r,i)),this._sortValues();else{const r=this._selectValue(t,i);r&&i&&this._keyManager.setActiveItem(r)}}_selectValue(t,i=!0){const r=this.chips.find(s=>null!=s.value&&this._compareWith(s.value,t));return r&&(i?r.selectViaInteraction():r.select(),this._selectionModel.select(r)),r}_initializeSelection(){Promise.resolve().then(()=>{(this.ngControl||this._value)&&(this._setSelectionByValue(this.ngControl?this.ngControl.value:this._value,!1),this.stateChanges.next())})}_clearSelection(t){this._selectionModel.clear(),this.chips.forEach(i=>{i!==t&&i.deselect()}),this.stateChanges.next()}_sortValues(){this._multiple&&(this._selectionModel.clear(),this.chips.forEach(t=>{t.selected&&this._selectionModel.select(t)}),this.stateChanges.next())}_propagateChanges(t){let i=null;i=Array.isArray(this.selected)?this.selected.map(r=>r.value):this.selected?this.selected.value:t,this._value=i,this.change.emit(new _ke(this,i)),this.valueChange.emit(i),this._onChange(i),this._changeDetectorRef.markForCheck()}_blur(){this._hasFocusedChip()||this._keyManager.setActiveItem(-1),this.disabled||(this._chipInput?setTimeout(()=>{this.focused||this._markAsTouched()}):this._markAsTouched())}_markAsTouched(){this._onTouched(),this._changeDetectorRef.markForCheck(),this.stateChanges.next()}_allowFocusEscape(){-1!==this._tabIndex&&(this._tabIndex=-1,setTimeout(()=>{this._tabIndex=this._userTabIndex||0,this._changeDetectorRef.markForCheck()}))}_resetChips(){this._dropSubscriptions(),this._listenToChipsFocus(),this._listenToChipsSelection(),this._listenToChipsRemoved()}_dropSubscriptions(){this._chipFocusSubscription&&(this._chipFocusSubscription.unsubscribe(),this._chipFocusSubscription=null),this._chipBlurSubscription&&(this._chipBlurSubscription.unsubscribe(),this._chipBlurSubscription=null),this._chipSelectionSubscription&&(this._chipSelectionSubscription.unsubscribe(),this._chipSelectionSubscription=null),this._chipRemoveSubscription&&(this._chipRemoveSubscription.unsubscribe(),this._chipRemoveSubscription=null)}_listenToChipsSelection(){this._chipSelectionSubscription=this.chipSelectionChanges.subscribe(t=>{t.source.selected?this._selectionModel.select(t.source):this._selectionModel.deselect(t.source),this.multiple||this.chips.forEach(i=>{!this._selectionModel.isSelected(i)&&i.selected&&i.deselect()}),t.isUserInput&&this._propagateChanges()})}_listenToChipsFocus(){this._chipFocusSubscription=this.chipFocusChanges.subscribe(t=>{let i=this.chips.toArray().indexOf(t.chip);this._isValidIndex(i)&&this._keyManager.updateActiveItem(i),this.stateChanges.next()}),this._chipBlurSubscription=this.chipBlurChanges.subscribe(()=>{this._blur(),this.stateChanges.next()})}_listenToChipsRemoved(){this._chipRemoveSubscription=this.chipRemoveChanges.subscribe(t=>{const i=t.chip,r=this.chips.toArray().indexOf(t.chip);this._isValidIndex(r)&&i._hasFocus&&(this._lastDestroyedChipIndex=r)})}_originatesFromChip(t){let i=t.target;for(;i&&i!==this._elementRef.nativeElement;){if(i.classList.contains("mat-chip"))return!0;i=i.parentElement}return!1}_hasFocusedChip(){return this.chips&&this.chips.some(t=>t._hasFocus)}_syncChipsState(){this.chips&&this.chips.forEach(t=>{t._chipListDisabled=this._disabled,t._chipListMultiple=this.multiple})}}return n.\u0275fac=function(t){return new(t||n)(E(rt),E(kn),E(Qo,8),E(mp,8),E(Zm,8),E(Vv),E(uc,10))},n.\u0275cmp=Ne({type:n,selectors:[["mat-chip-list"]],contentQueries:function(t,i,r){if(1&t&&ei(r,y0,5),2&t){let s;_t(s=yt())&&(i.chips=s)}},hostAttrs:[1,"mat-chip-list"],hostVars:15,hostBindings:function(t,i){1&t&&ge("focus",function(){return i.focus()})("blur",function(){return i._blur()})("keydown",function(s){return i._keydown(s)}),2&t&&(al("id",i._uid),nn("tabindex",i.disabled?null:i._tabIndex)("aria-describedby",i._ariaDescribedby||null)("aria-required",i.role?i.required:null)("aria-disabled",i.disabled.toString())("aria-invalid",i.errorState)("aria-multiselectable",i.multiple)("role",i.role)("aria-orientation",i.ariaOrientation),st("mat-chip-list-disabled",i.disabled)("mat-chip-list-invalid",i.errorState)("mat-chip-list-required",i.required))},inputs:{ariaOrientation:["aria-orientation","ariaOrientation"],multiple:"multiple",compareWith:"compareWith",value:"value",required:"required",placeholder:"placeholder",disabled:"disabled",selectable:"selectable",tabIndex:"tabIndex",errorStateMatcher:"errorStateMatcher"},outputs:{change:"change",valueChange:"valueChange"},exportAs:["matChipList"],features:[Dt([{provide:jv,useExisting:n}]),ct],ngContentSelectors:uke,decls:2,vars:0,consts:[[1,"mat-chip-list-wrapper"]],template:function(t,i){1&t&&(wi(),R(0,"div",0),Ht(1),k())},styles:['.mat-chip{position:relative;box-sizing:border-box;-webkit-tap-highlight-color:transparent;transform:translateZ(0);border:none;-webkit-appearance:none;-moz-appearance:none}.mat-standard-chip{transition:box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);display:inline-flex;padding:7px 12px;border-radius:16px;align-items:center;cursor:default;min-height:32px;height:1px}._mat-animation-noopable.mat-standard-chip{transition:none;animation:none}.mat-standard-chip .mat-chip-remove.mat-icon{width:18px;height:18px}.mat-standard-chip::after{top:0;left:0;right:0;bottom:0;position:absolute;border-radius:inherit;opacity:0;content:"";pointer-events:none;transition:opacity 200ms cubic-bezier(0.35, 0, 0.25, 1)}.mat-standard-chip:hover::after{opacity:.12}.mat-standard-chip:focus{outline:none}.mat-standard-chip:focus::after{opacity:.16}.cdk-high-contrast-active .mat-standard-chip{outline:solid 1px}.cdk-high-contrast-active .mat-standard-chip:focus{outline:dotted 2px}.mat-standard-chip.mat-chip-disabled::after{opacity:0}.mat-standard-chip.mat-chip-disabled .mat-chip-remove,.mat-standard-chip.mat-chip-disabled .mat-chip-trailing-icon{cursor:default}.mat-standard-chip.mat-chip-with-trailing-icon.mat-chip-with-avatar,.mat-standard-chip.mat-chip-with-avatar{padding-top:0;padding-bottom:0}.mat-standard-chip.mat-chip-with-trailing-icon.mat-chip-with-avatar{padding-right:8px;padding-left:0}[dir=rtl] .mat-standard-chip.mat-chip-with-trailing-icon.mat-chip-with-avatar{padding-left:8px;padding-right:0}.mat-standard-chip.mat-chip-with-trailing-icon{padding-top:7px;padding-bottom:7px;padding-right:8px;padding-left:12px}[dir=rtl] .mat-standard-chip.mat-chip-with-trailing-icon{padding-left:8px;padding-right:12px}.mat-standard-chip.mat-chip-with-avatar{padding-left:0;padding-right:12px}[dir=rtl] .mat-standard-chip.mat-chip-with-avatar{padding-right:0;padding-left:12px}.mat-standard-chip .mat-chip-avatar{width:24px;height:24px;margin-right:8px;margin-left:4px}[dir=rtl] .mat-standard-chip .mat-chip-avatar{margin-left:8px;margin-right:4px}.mat-standard-chip .mat-chip-remove,.mat-standard-chip .mat-chip-trailing-icon{width:18px;height:18px;cursor:pointer}.mat-standard-chip .mat-chip-remove,.mat-standard-chip .mat-chip-trailing-icon{margin-left:8px;margin-right:0}[dir=rtl] .mat-standard-chip .mat-chip-remove,[dir=rtl] .mat-standard-chip .mat-chip-trailing-icon{margin-right:8px;margin-left:0}.mat-chip-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none;border-radius:inherit;overflow:hidden}.mat-chip-list-wrapper{display:flex;flex-direction:row;flex-wrap:wrap;align-items:center;margin:-4px}.mat-chip-list-wrapper input.mat-input-element,.mat-chip-list-wrapper .mat-standard-chip{margin:4px}.mat-chip-list-stacked .mat-chip-list-wrapper{flex-direction:column;align-items:flex-start}.mat-chip-list-stacked .mat-chip-list-wrapper .mat-standard-chip{width:100%}.mat-chip-avatar{border-radius:50%;justify-content:center;align-items:center;display:flex;overflow:hidden;object-fit:cover}input.mat-chip-input{width:150px;margin:4px;flex:1 0 150px}\n'],encapsulation:2,changeDetection:0}),n})();const bke={separatorKeyCodes:[13]};let j9=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({providers:[Vv,{provide:V9,useValue:bke}],imports:[[On]]}),n})(),Cke=(()=>{class n{constructor(t){this.ga=t,this.clsName="ccf-visibility-toggle",this.visible=!1,this.toggleLabel="",this.disabled=!1,this.visibilityChanged=new Le}toggleVisibility(){this.visible=!this.visible,this.ga.event("visibility_toggled","visibility_toggle",""+this.visible),this.visibilityChanged.emit(this.visible)}}return n.\u0275fac=function(t){return new(t||n)(E(xs))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-visibility-toggle"]],hostVars:2,hostBindings:function(t,i){2&t&&Rn(i.clsName)},inputs:{visible:"visible",toggleLabel:"toggleLabel",disabled:"disabled"},outputs:{visibilityChanged:"visibilityChanged"},decls:8,vars:9,consts:[[1,"toggle-div"],[1,"toggle-wrapper",3,"click"],[1,"icon-background"],["svgIcon","app:visibility_off_cube",1,"icon","block"],[1,"icon","green"],[1,"toggle-label"]],template:function(t,i){1&t&&(R(0,"div",0),R(1,"mat-chip",1),ge("click",function(){return i.toggleVisibility()}),R(2,"div",2),tt(3,"mat-icon",3),R(4,"mat-icon",4),De(5,"done"),k(),k(),R(6,"div",5),De(7),k(),k(),k()),2&t&&(G(1),st("disabled",i.disabled),G(1),st("disabled",i.disabled),G(1),st("hidden",i.visible),G(1),st("hidden",!i.visible),G(3),xi(i.toggleLabel))},directives:[y0,rs],styles:["[_nghost-%COMP%]{height:3rem;display:flex;align-items:center}[_nghost-%COMP%] .mat-chip{padding:0!important}[_nghost-%COMP%] .mat-chip.disabled{cursor:not-allowed!important}[_nghost-%COMP%] .toggle-div[_ngcontent-%COMP%]{width:100%;display:flex;justify-content:center;padding-top:1.5rem}[_nghost-%COMP%] .toggle-div[_ngcontent-%COMP%] .toggle-wrapper[_ngcontent-%COMP%]{-webkit-user-select:none;-moz-user-select:none;display:flex;padding-left:.5rem;cursor:pointer;align-items:center;position:relative;border-width:.075rem;border-style:solid;height:2.25rem;border-radius:1.5rem;transition:background-color .2s ease-in-out}[_nghost-%COMP%] .toggle-div[_ngcontent-%COMP%] .toggle-wrapper[_ngcontent-%COMP%] .icon-background[_ngcontent-%COMP%]{border-radius:1.5rem;height:2.06rem;width:2.06rem;display:flex;align-items:center;justify-content:center}[_nghost-%COMP%] .toggle-div[_ngcontent-%COMP%] .toggle-wrapper[_ngcontent-%COMP%] .icon-background[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{transition:.6s;position:absolute}[_nghost-%COMP%] .toggle-div[_ngcontent-%COMP%] .toggle-wrapper[_ngcontent-%COMP%] .icon-background[_ngcontent-%COMP%] .icon.block[_ngcontent-%COMP%]{width:1.125rem}[_nghost-%COMP%] .toggle-div[_ngcontent-%COMP%] .toggle-wrapper[_ngcontent-%COMP%] .icon-background[_ngcontent-%COMP%] .icon.hidden[_ngcontent-%COMP%]{opacity:0}[_nghost-%COMP%] .toggle-div[_ngcontent-%COMP%] .toggle-wrapper[_ngcontent-%COMP%] .toggle-label[_ngcontent-%COMP%]{font-weight:bold;margin-left:.5rem;padding-right:1.25rem;padding-left:.25rem}"],changeDetection:0}),n})();const wke=["fileInput"];let Eke=(()=>{class n{constructor(t){this.ga=t,this.clsName="ccf-json-file-reader",this.label="Upload",this.parsedJson=new Le}triggerFileInput(){this.fileInput.nativeElement.click()}handleFile(t){const i=t.target;if(!i.files)return;const r=i.files[0],s=new FileReader;s.onload=()=>{const o=JSON.parse(s.result);this.ga.event("json_file_load_end","json_file_reader"),this.parsedJson.emit(o)},this.ga.event("json_file_load_start","json_file_reader"),s.readAsText(r)}}return n.\u0275fac=function(t){return new(t||n)(E(xs))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-json-file-reader"]],viewQuery:function(t,i){if(1&t&&Jn(wke,5),2&t){let r;_t(r=yt())&&(i.fileInput=r.first)}},hostVars:2,hostBindings:function(t,i){2&t&&Rn(i.clsName)},inputs:{label:"label"},outputs:{parsedJson:"parsedJson"},decls:4,vars:1,consts:[["mat-button","",1,"upload-button",3,"click"],["type","file","accept","application/JSON","name","fileInput","id","fileInput",2,"display","none",3,"change"],["fileInput",""]],template:function(t,i){1&t&&(R(0,"button",0),ge("click",function(){return i.triggerFileInput()}),De(1),k(),R(2,"input",1,2),ge("change",function(s){return i.handleFile(s)}),k()),2&t&&(G(1),xi(i.label))},directives:[lh],styles:["[_nghost-%COMP%] .upload-button[_ngcontent-%COMP%]{width:100%;height:2.25rem;transition:.6s;cursor:pointer;font-weight:500}"]}),n})(),Ske=(()=>{class n{constructor(){this.clsName="ccf-details-label",this.details=[]}arrayToString(t){return t.join(", ")}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=Ne({type:n,selectors:[["ccf-details-label"]],hostVars:2,hostBindings:function(t,i){2&t&&Rn(i.clsName)},inputs:{details:"details"},decls:1,vars:1,template:function(t,i){1&t&&De(0),2&t&&xi(i.arrayToString(i.details))},styles:["[_nghost-%COMP%]{display:block;height:2.25rem}"],changeDetection:0}),n})();const Mke=["trigger"],xke=["panel"];function Tke(n,e){if(1&n&&(R(0,"span",8),De(1),k()),2&n){const t=Qe();G(1),xi(t.placeholder)}}function Ake(n,e){if(1&n&&(R(0,"span",12),De(1),k()),2&n){const t=Qe(2);G(1),xi(t.triggerValue)}}function Dke(n,e){1&n&&Ht(0,0,["*ngSwitchCase","true"])}function Oke(n,e){1&n&&(R(0,"span",9),mt(1,Ake,2,1,"span",10),mt(2,Dke,1,0,"ng-content",11),k()),2&n&&(ie("ngSwitch",!!Qe().customTrigger),G(2),ie("ngSwitchCase",!0))}function Ike(n,e){if(1&n){const t=Zi();R(0,"div",13),R(1,"div",14,15),ge("@transformPanel.done",function(r){return en(t),Qe()._panelDoneAnimatingStream.next(r.toState)})("keydown",function(r){return en(t),Qe()._handleKeydown(r)}),Ht(3,1),k(),k()}if(2&n){const t=Qe();ie("@transformPanelWrap",void 0),G(1),function(n,e,t){Gl(yo,Vc,Cg(Oe(),n,e,t),!0)}("mat-select-panel ",t._getPanelTheme(),""),vf("transform-origin",t._transformOrigin)("font-size",t._triggerFontSize,"px"),ie("ngClass",t.panelClass)("@transformPanel",t.multiple?"showing-multiple":"showing"),nn("id",t.id+"-panel")("aria-multiselectable",t.multiple)("aria-label",t.ariaLabel||null)("aria-labelledby",t._getPanelAriaLabelledby())}}const Pke=[[["mat-select-trigger"]],"*"],Rke=["mat-select-trigger","*"],U9={transformPanelWrap:tc("transformPanelWrap",[Qs("* => void",Uie("@transformPanel",[jie()],{optional:!0}))]),transformPanel:tc("transformPanel",[wr("void",ti({transform:"scaleY(0.8)",minWidth:"100%",opacity:0})),wr("showing",ti({opacity:1,minWidth:"calc(100% + 32px)",transform:"scaleY(1)"})),wr("showing-multiple",ti({opacity:1,minWidth:"calc(100% + 64px)",transform:"scaleY(1)"})),Qs("void => *",Ao("120ms cubic-bezier(0, 0, 0.2, 1)")),Qs("* => void",Ao("100ms 25ms linear",ti({opacity:0})))])};let H9=0;const G9=new ve("mat-select-scroll-strategy"),Lke=new ve("MAT_SELECT_CONFIG"),Bke={provide:G9,deps:[Jo],useFactory:function(n){return()=>n.scrollStrategies.reposition()}};class Vke{constructor(e,t){this.source=e,this.value=t}}const zke=nc(Hf(jf(FO(class{constructor(n,e,t,i,r){this._elementRef=n,this._defaultErrorStateMatcher=e,this._parentForm=t,this._parentFormGroup=i,this.ngControl=r}})))),W9=new ve("MatSelectTrigger");let jke=(()=>{class n extends zke{constructor(t,i,r,s,o,a,l,c,d,f,p,g,_,y){var v,C,w;super(o,s,l,c,f),this._viewportRuler=t,this._changeDetectorRef=i,this._ngZone=r,this._dir=a,this._parentFormField=d,this._liveAnnouncer=_,this._defaultOptions=y,this._panelOpen=!1,this._compareWith=(x,N)=>x===N,this._uid="mat-select-"+H9++,this._triggerAriaLabelledBy=null,this._destroy=new Se,this._onChange=()=>{},this._onTouched=()=>{},this._valueId="mat-select-value-"+H9++,this._panelDoneAnimatingStream=new Se,this._overlayPanelClass=(null===(v=this._defaultOptions)||void 0===v?void 0:v.overlayPanelClass)||"",this._focused=!1,this.controlType="mat-select",this._required=!1,this._multiple=!1,this._disableOptionCentering=null!==(w=null===(C=this._defaultOptions)||void 0===C?void 0:C.disableOptionCentering)&&void 0!==w&&w,this.ariaLabel="",this.optionSelectionChanges=Yb(()=>{const x=this.options;return x?x.changes.pipe(Rr(x),Pr(()=>Ni(...x.map(N=>N.onSelectionChange)))):this._ngZone.onStable.pipe(yi(1),Pr(()=>this.optionSelectionChanges))}),this.openedChange=new Le,this._openedStream=this.openedChange.pipe(Fn(x=>x),Ae(()=>{})),this._closedStream=this.openedChange.pipe(Fn(x=>!x),Ae(()=>{})),this.selectionChange=new Le,this.valueChange=new Le,this.ngControl&&(this.ngControl.valueAccessor=this),null!=(null==y?void 0:y.typeaheadDebounceInterval)&&(this._typeaheadDebounceInterval=y.typeaheadDebounceInterval),this._scrollStrategyFactory=g,this._scrollStrategy=this._scrollStrategyFactory(),this.tabIndex=parseInt(p)||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=Mt(t),this.stateChanges.next()}get multiple(){return this._multiple}set multiple(t){this._multiple=Mt(t)}get disableOptionCentering(){return this._disableOptionCentering}set disableOptionCentering(t){this._disableOptionCentering=Mt(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=To(t)}get id(){return this._id}set id(t){this._id=t||this._uid,this.stateChanges.next()}ngOnInit(){this._selectionModel=new lS(this.multiple),this.stateChanges.next(),this._panelDoneAnimatingStream.pipe(Zo(),Tn(this._destroy)).subscribe(()=>this._panelDoneAnimating(this.panelOpen))}ngAfterContentInit(){this._initKeyManager(),this._selectionModel.changed.pipe(Tn(this._destroy)).subscribe(t=>{t.added.forEach(i=>i.select()),t.removed.forEach(i=>i.deselect())}),this.options.changes.pipe(Rr(null),Tn(this._destroy)).subscribe(()=>{this._resetOptions(),this._initializeSelection()})}ngDoCheck(){const t=this._getTriggerAriaLabelledby();if(t!==this._triggerAriaLabelledBy){const i=this._elementRef.nativeElement;this._triggerAriaLabelledBy=t,t?i.setAttribute("aria-labelledby",t):i.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(i=>i.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 i=t.keyCode,r=40===i||38===i||37===i||39===i,s=13===i||32===i,o=this._keyManager;if(!o.isTyping()&&s&&!Zs(t)||(this.multiple||t.altKey)&&r)t.preventDefault(),this.open();else if(!this.multiple){const a=this.selected;o.onKeydown(t);const l=this.selected;l&&a!==l&&this._liveAnnouncer.announce(l.viewValue,1e4)}}_handleOpenKeydown(t){const i=this._keyManager,r=t.keyCode,s=40===r||38===r,o=i.isTyping();if(s&&t.altKey)t.preventDefault(),this.close();else if(o||13!==r&&32!==r||!i.activeItem||Zs(t))if(!o&&this._multiple&&65===r&&t.ctrlKey){t.preventDefault();const a=this.options.some(l=>!l.disabled&&!l.selected);this.options.forEach(l=>{l.disabled||(a?l.select():l.deselect())})}else{const a=i.activeItemIndex;i.onKeydown(t),this._multiple&&s&&t.shiftKey&&i.activeItem&&i.activeItemIndex!==a&&i.activeItem._selectViaInteraction()}else t.preventDefault(),i.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(yi(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(i=>i.setInactiveStyles()),this._selectionModel.clear(),this.multiple&&t)Array.isArray(t),t.forEach(i=>this._selectValue(i)),this._sortValues();else{const i=this._selectValue(t);i?this._keyManager.updateActiveItem(i):this.panelOpen||this._keyManager.updateActiveItem(-1)}this._changeDetectorRef.markForCheck()}_selectValue(t){const i=this.options.find(r=>{if(this._selectionModel.isSelected(r))return!1;try{return null!=r.value&&this._compareWith(r.value,t)}catch(s){return!1}});return i&&this._selectionModel.select(i),i}_initKeyManager(){this._keyManager=new kV(this.options).withTypeAhead(this._typeaheadDebounceInterval).withVerticalOrientation().withHorizontalOrientation(this._isRtl()?"rtl":"ltr").withHomeAndEnd().withAllowedModifierKeys(["shiftKey"]),this._keyManager.tabOut.pipe(Tn(this._destroy)).subscribe(()=>{this.panelOpen&&(!this.multiple&&this._keyManager.activeItem&&this._keyManager.activeItem._selectViaInteraction(),this.focus(),this.close())}),this._keyManager.change.pipe(Tn(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=Ni(this.options.changes,this._destroy);this.optionSelectionChanges.pipe(Tn(t)).subscribe(i=>{this._onSelect(i.source,i.isUserInput),i.isUserInput&&!this.multiple&&this._panelOpen&&(this.close(),this.focus())}),Ni(...this.options.map(i=>i._stateChanges)).pipe(Tn(t)).subscribe(()=>{this._changeDetectorRef.markForCheck(),this.stateChanges.next()})}_onSelect(t,i){const r=this._selectionModel.isSelected(t);null!=t.value||this._multiple?(r!==t.selected&&(t.selected?this._selectionModel.select(t):this._selectionModel.deselect(t)),i&&this._keyManager.setActiveItem(t),this.multiple&&(this._sortValues(),i&&this.focus())):(t.deselect(),this._selectionModel.clear(),null!=this.value&&this._propagateChanges(t.value)),r!==this._selectionModel.isSelected(t)&&this._propagateChanges(),this.stateChanges.next()}_sortValues(){if(this.multiple){const t=this.options.toArray();this._selectionModel.sort((i,r)=>this.sortComparator?this.sortComparator(i,r,t):t.indexOf(i)-t.indexOf(r)),this.stateChanges.next()}}_propagateChanges(t){let i=null;i=this.multiple?this.selected.map(r=>r.value):this.selected?this.selected.value:t,this._value=i,this.valueChange.emit(i),this._onChange(i),this.selectionChange.emit(this._getChangeEvent(i)),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 i=null===(t=this._parentFormField)||void 0===t?void 0:t.getLabelId();return this.ariaLabelledby?(i?i+" ":"")+this.ariaLabelledby:i}_getAriaActiveDescendant(){return this.panelOpen&&this._keyManager&&this._keyManager.activeItem?this._keyManager.activeItem.id:null}_getTriggerAriaLabelledby(){var t;if(this.ariaLabel)return null;const i=null===(t=this._parentFormField)||void 0===t?void 0:t.getLabelId();let r=(i?i+" ":"")+this._valueId;return this.ariaLabelledby&&(r+=" "+this.ariaLabelledby),r}_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 n.\u0275fac=function(t){return new(t||n)(E(Yf),E(kn),E(dt),E(Vv),E(rt),E(Qo,8),E(mp,8),E(Zm,8),E(nS,8),E(uc,10),Zr("tabindex"),E(G9),E(DE),E(Lke,8))},n.\u0275dir=oe({type:n,viewQuery:function(t,i){if(1&t&&(Jn(Mke,5),Jn(xke,5),Jn(sU,5)),2&t){let r;_t(r=yt())&&(i.trigger=r.first),_t(r=yt())&&(i.panel=r.first),_t(r=yt())&&(i._overlayDir=r.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:[ct,zn]}),n})(),Uke=(()=>{class n extends jke{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,i,r){const s=this._getItemHeight();return Math.min(Math.max(0,s*t-i+s/2),r)}ngOnInit(){super.ngOnInit(),this._viewportRuler.change().pipe(Tn(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(yi(1)).subscribe(()=>{this._triggerFontSize&&this._overlayDir.overlayRef&&this._overlayDir.overlayRef.overlayElement&&(this._overlayDir.overlayRef.overlayElement.style.fontSize=`${this._triggerFontSize}px`)}))}_scrollOptionIntoView(t){const i=BO(t,this.options,this.optionGroups),r=this._getItemHeight();this.panel.nativeElement.scrollTop=0===t&&1===i?0:function(n,e,t,i){return nt+i?Math.max(0,n-i+e):t}((t+i)*r,r,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 Vke(this,t)}_calculateOverlayOffsetX(){const t=this._overlayDir.overlayRef.overlayElement.getBoundingClientRect(),i=this._viewportRuler.getViewportSize(),r=this._isRtl(),s=this.multiple?56:32;let o;if(this.multiple)o=40;else if(this.disableOptionCentering)o=16;else{let c=this._selectionModel.selected[0]||this.options.first;o=c&&c.group?32:16}r||(o*=-1);const a=0-(t.left+o-(r?s:0)),l=t.right+o-i.width+(r?0:s);a>0?o+=a+8:l>0&&(o-=l+8),this._overlayDir.offsetX=Math.round(o),this._overlayDir.overlayRef.updatePosition()}_calculateOverlayOffsetY(t,i,r){const s=this._getItemHeight(),o=(s-this._triggerRect.height)/2,a=Math.floor(256/s);let l;return this.disableOptionCentering?0:(l=0===this._scrollTop?t*s:this._scrollTop===r?(t-(this._getItemCount()-a))*s+(s-(this._getItemCount()*s-256)%s):i-s/2,Math.round(-1*l-o))}_checkOverlayWithinViewport(t){const i=this._getItemHeight(),r=this._viewportRuler.getViewportSize(),s=this._triggerRect.top-8,o=r.height-this._triggerRect.bottom-8,a=Math.abs(this._offsetY),c=Math.min(this._getItemCount()*i,256)-a-this._triggerRect.height;c>o?this._adjustPanelUp(c,o):a>s?this._adjustPanelDown(a,s,t):this._transformOrigin=this._getOriginBasedOnOption()}_adjustPanelUp(t,i){const r=Math.round(t-i);this._scrollTop-=r,this._offsetY-=r,this._transformOrigin=this._getOriginBasedOnOption(),this._scrollTop<=0&&(this._scrollTop=0,this._offsetY=0,this._transformOrigin="50% bottom 0px")}_adjustPanelDown(t,i,r){const s=Math.round(t-i);if(this._scrollTop+=s,this._offsetY+=s,this._transformOrigin=this._getOriginBasedOnOption(),this._scrollTop>=r)return this._scrollTop=r,this._offsetY=0,void(this._transformOrigin="50% top 0px")}_calculateOverlayPosition(){const t=this._getItemHeight(),i=this._getItemCount(),r=Math.min(i*t,256),o=i*t-r;let a;a=this.empty?0:Math.max(this.options.toArray().indexOf(this._selectionModel.selected[0]),0),a+=BO(a,this.options,this.optionGroups);const l=r/2;this._scrollTop=this._calculateOverlayScroll(a,l,o),this._offsetY=this._calculateOverlayOffsetY(a,l,o),this._checkOverlayWithinViewport(o)}_getOriginBasedOnOption(){const t=this._getItemHeight(),i=(t-this._triggerRect.height)/2;return`50% ${Math.abs(this._offsetY)-i+t/2}px 0px`}_getItemHeight(){return 3*this._triggerFontSize}_getItemCount(){return this.options.length+this.optionGroups.length}}return n.\u0275fac=function(){let e;return function(i){return(e||(e=$n(n)))(i||n)}}(),n.\u0275cmp=Ne({type:n,selectors:[["mat-select"]],contentQueries:function(t,i,r){if(1&t&&(ei(r,W9,5),ei(r,eS,5),ei(r,JE,5)),2&t){let s;_t(s=yt())&&(i.customTrigger=s.first),_t(s=yt())&&(i.options=s),_t(s=yt())&&(i.optionGroups=s)}},hostAttrs:["role","combobox","aria-autocomplete","none","aria-haspopup","true",1,"mat-select"],hostVars:20,hostBindings:function(t,i){1&t&&ge("keydown",function(s){return i._handleKeydown(s)})("focus",function(){return i._onFocus()})("blur",function(){return i._onBlur()}),2&t&&(nn("id",i.id)("tabindex",i.tabIndex)("aria-controls",i.panelOpen?i.id+"-panel":null)("aria-expanded",i.panelOpen)("aria-label",i.ariaLabel||null)("aria-required",i.required.toString())("aria-disabled",i.disabled.toString())("aria-invalid",i.errorState)("aria-describedby",i._ariaDescribedby||null)("aria-activedescendant",i._getAriaActiveDescendant()),st("mat-select-disabled",i.disabled)("mat-select-invalid",i.errorState)("mat-select-required",i.required)("mat-select-empty",i.empty)("mat-select-multiple",i.multiple))},inputs:{disabled:"disabled",disableRipple:"disableRipple",tabIndex:"tabIndex"},exportAs:["matSelect"],features:[Dt([{provide:jv,useExisting:n},{provide:QE,useExisting:n}]),ct],ngContentSelectors:Rke,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,i){if(1&t&&(wi(Pke),R(0,"div",0,1),ge("click",function(){return i.toggle()}),R(3,"div",2),mt(4,Tke,2,1,"span",3),mt(5,Oke,3,2,"span",4),k(),R(6,"div",5),tt(7,"div",6),k(),k(),mt(8,Ike,4,14,"ng-template",7),ge("backdropClick",function(){return i.close()})("attach",function(){return i._onAttached()})("detach",function(){return i.close()})),2&t){const r=vs(1);nn("aria-owns",i.panelOpen?i.id+"-panel":null),G(3),ie("ngSwitch",i.empty),nn("id",i._valueId),G(1),ie("ngSwitchCase",!0),G(1),ie("ngSwitchCase",!1),G(3),ie("cdkConnectedOverlayPanelClass",i._overlayPanelClass)("cdkConnectedOverlayScrollStrategy",i._scrollStrategy)("cdkConnectedOverlayOrigin",r)("cdkConnectedOverlayOpen",i.panelOpen)("cdkConnectedOverlayPositions",i._positions)("cdkConnectedOverlayMinWidth",null==i._triggerRect?null:i._triggerRect.width)("cdkConnectedOverlayOffsetY",i._offsetY)}},directives:[Pae,Av,ID,sU,Z3,hE],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:[U9.transformPanelWrap,U9.transformPanel]},changeDetection:0}),n})(),q9=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({providers:[Bke],imports:[[dn,Yv,tS,On],Wv,Uv,tS,On]}),n})();function Hke(n,e){if(1&n&&(R(0,"mat-option",5),De(1),k()),2&n){const t=e.$implicit;ie("value",t),G(1),Aw(" ",t.name," (",t.sites.length,") ")}}function $ke(n,e){if(1&n){const t=Zi();R(0,"mat-form-field",1),R(1,"mat-label",2),De(2,"Landmark Set"),k(),R(3,"mat-select",3),ge("selectionChange",function(r){return en(t),Qe().extractionSetChanged(r.value)}),mt(4,Hke,2,3,"mat-option",4),k(),k()}if(2&n){const t=Qe();G(3),ie("value",t.sets[0]),G(1),ie("ngForOf",t.sets)}}let Gke=(()=>{class n{constructor(t){this.ga=t,this.clsName="ccf-extraction-set-dropdown",this.setChange=new Le}extractionSetChanged(t){this.selected=t,this.ga.event("selected_extraction_set_change","extraction_set_dropdown",t.name),this.setChange.emit(t)}isMultiple(){return this.sets.length>1}}return n.\u0275fac=function(t){return new(t||n)(E(xs))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-extraction-set-dropdown"]],hostVars:2,hostBindings:function(t,i){2&t&&Rn(i.clsName)},inputs:{sets:"sets"},outputs:{setChange:"setChange"},decls:1,vars:1,consts:[["class","dropdown-form-field","appearance","fill",4,"ngIf"],["appearance","fill",1,"dropdown-form-field"],[1,"extraction-dropdown-label"],["disableOptionCentering","true","panelClass","extraction-set-panel",3,"value","selectionChange"],["class","extraction-set-options",3,"value",4,"ngFor","ngForOf"],[1,"extraction-set-options",3,"value"]],template:function(t,i){1&t&&mt(0,$ke,5,2,"mat-form-field",0),2&t&&ie("ngIf",i.isMultiple())},directives:[zr,am,Gf,Uke,pl,eS],styles:[".extraction-set-panel{box-shadow:0 0 .3rem .1rem #9e9e9e;position:absolute;top:-1rem;left:1rem;width:10.5rem} .extraction-set-panel .extraction-set-options{height:2.5rem!important} .extraction-set-panel .extraction-set-options:first-child{margin-top:.5rem} .extraction-set-panel .extraction-set-options:last-child{margin-bottom:.5rem}[_nghost-%COMP%] .mat-form-field{width:10.5rem}[_nghost-%COMP%] .mat-form-field .mat-form-field-wrapper{padding-bottom:.5rem}[_nghost-%COMP%] .mat-form-field .mat-form-field-wrapper .mat-form-field-flex{padding:0}[_nghost-%COMP%] .mat-form-field .mat-form-field-wrapper .mat-form-field-underline{bottom:.75rem}[_nghost-%COMP%] .mat-form-field .mat-form-field-wrapper .mat-select-arrow-wrapper{transform:none} .cdk-overlay-pane{min-width:0rem!important}"],changeDetection:0}),n})();function Wke(n,e){if(1&n&&(_f(0),tt(1,"ccf-details-label",19),Kt(2,"async"),yf()),2&n){const t=Qe();G(1),ie("details",rn(2,1,t.detailsLabels$))}}function qke(n,e){if(1&n){const t=Zi();R(0,"div",9),R(1,"ccf-extraction-set-dropdown",20,21),ge("setChange",function(r){return en(t),Qe().model.setExtractionSites(r.sites)}),Kt(3,"async"),k(),R(4,"ccf-visibility-menu",22),ge("itemsChange",function(r){return en(t),Qe().model.setExtractionSites(r)})("hover",function(r){return en(t),Qe().updateExtractionSiteTooltip(r)}),Kt(5,"async"),k(),k()}if(2&n){const t=Qe();G(1),ie("sets",rn(3,2,t.model.extractionSets$)),G(3),ie("items",rn(5,4,t.model.extractionSites$))}}function Yke(n,e){if(1&n&&(R(0,"div",23),De(1),k()),2&n){const t=Qe();G(1),or(" ",t.extractionSiteTooltip," ")}}const Xke=function(){return["Male","Female"]};let Kke=(()=>{class n{constructor(t,i,r){this.page=t,this.model=i,this.registration=r,this.clsName="ccf-left-sidebar",this.disableSlider=!1,this.modalClosed=!1,this.sexByLabel$=this.model.sex$.pipe(Ae(s=>"female"===s?"Female":"Male")),this.sideByLabel$=this.model.side$.pipe(Ae(s=>"left"===s?"L":"R")),this.organSelected$=this.model.organ$.pipe(Ae(s=>void 0!==s)),this.detailsLabels$=Qi([this.model.organ$,this.model.side$,this.model.sex$]).pipe(Ae(([s,o,a])=>[null==s?void 0:s.name,o,a])),this.extractionSiteTooltip="",this.previousVisibilityItems=[...this.model.snapshot.anatomicalStructures],this.organList=qF}updateExtractionSiteTooltip(t){this.extractionSiteTooltip=(null==t?void 0:t.tooltip)?t.tooltip:""}setSexFromLabel(t){this.model.setSex("Female"===t?"female":"male")}setSideFromLabel(t){this.model.setSide("L"===t?"left":"right")}togglePreviousRegistrationBlocks(t){t&&(this.previousVisibilityItems=[...this.model.snapshot.anatomicalStructures]),this.model.toggleRegistrationBlocksVisibility(t,this.previousVisibilityItems)}updateRegistration(t){this.registration.editRegistration(t)}}return n.\u0275fac=function(t){return new(t||n)(E(ji),E(ai),E(Sr))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-left-sidebar"]],hostVars:2,hostBindings:function(t,i){2&t&&Rn(i.clsName)},inputs:{disableSlider:"disableSlider",modalClosed:"modalClosed"},decls:31,vars:22,consts:[[1,"scroll-wrapper"],[1,"container"],[4,"ngIf"],["matTooltip","Select sex to filter organs.",1,"organ-sliders"],[1,"slider-label"],[1,"toggle","gender",3,"disabled","labels","value","valueChange"],[1,"anatomical-structures-menu",3,"expanded"],[1,"expansion-header"],["matTooltip","Use opacity icons to change visibility of anatomical structures",1,"expansion-title"],[1,"expansion-content"],[3,"items","itemsChange"],[1,"extraction-menu",3,"expanded"],["matTooltip","Some organs have predefined landmarks to guide manual tissue registration--you can turn these on/off.",1,"expansion-title"],["class","expansion-content",4,"ngIf"],["toggleLabel","Previously Registered Blocks","matTooltip","If you previously registered tissue blocks, you can turn their positions on/off.",3,"visible","disabled","visibilityChanged"],[1,"space"],["class","extraction-site-tooltip mat-elevation-z8",4,"ngIf"],[1,"filler"],["label","UPLOAD PREVIOUS REGISTRATION DATA",3,"parsedJson"],[3,"details"],[3,"sets","setChange"],["dropdown",""],[3,"items","itemsChange","hover"],[1,"extraction-site-tooltip","mat-elevation-z8"]],template:function(t,i){1&t&&(R(0,"div",0),R(1,"div",1),mt(2,Wke,3,3,"ng-container",2),Kt(3,"async"),R(4,"div",3),R(5,"div",4),De(6,"Donor Sex:"),k(),R(7,"ccf-labeled-slide-toggle",5),ge("valueChange",function(s){return i.setSexFromLabel(s)}),Kt(8,"async"),k(),k(),tt(9,"mat-divider"),R(10,"mat-expansion-panel",6),R(11,"mat-expansion-panel-header",7),R(12,"mat-panel-title",8),De(13,"Anatomical Structures"),k(),k(),R(14,"div",9),R(15,"ccf-visibility-menu",10),ge("itemsChange",function(s){return i.model.setAnatomicalStructures(s)}),Kt(16,"async"),k(),k(),k(),tt(17,"mat-divider"),R(18,"mat-expansion-panel",11),R(19,"mat-expansion-panel-header",7),R(20,"mat-panel-title",12),De(21,"Landmarks"),k(),k(),mt(22,qke,6,6,"div",13),Kt(23,"async"),k(),tt(24,"mat-divider"),R(25,"ccf-visibility-toggle",14),ge("visibilityChanged",function(s){return i.togglePreviousRegistrationBlocks(s)}),Kt(26,"async"),k(),tt(27,"div",15),mt(28,Yke,2,1,"div",16),tt(29,"div",17),R(30,"ccf-json-file-reader",18),ge("parsedJson",function(s){return i.updateRegistration(s)}),k(),k(),k()),2&t&&(G(2),ie("ngIf",rn(3,11,i.page.registrationCallbackSet$)),G(5),ie("disabled",i.disableSlider)("labels",fv(21,Xke))("value",rn(8,13,i.sexByLabel$)),G(3),ie("expanded",i.modalClosed),G(5),ie("items",rn(16,15,i.model.anatomicalStructures$)),G(3),ie("expanded",i.modalClosed),G(4),ie("ngIf",rn(23,17,i.organSelected$)),G(3),ie("visible",rn(26,19,i.model.showPrevious$))("disabled",i.disableSlider),G(3),ie("ngIf",i.extractionSiteTooltip.length>0))},directives:[zr,dc,XF,n9,qM,YM,EW,cke,Cke,Eke,Ske,Gke],pipes:[Hc],styles:["[_nghost-%COMP%]{display:block;height:calc(100% - 3rem);margin-top:1.5rem;margin-bottom:1.5rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%]{overflow-y:scroll;height:100%;margin-right:.375rem;scrollbar-width:thin}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%]::-webkit-scrollbar{width:.75rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%]{display:flex;flex-direction:column;margin-left:1.5rem;margin-right:.375rem;min-height:100%}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .space[_ngcontent-%COMP%]{height:3rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] mat-divider[_ngcontent-%COMP%]{border-top-width:3px}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .ccf-organ-selector[_ngcontent-%COMP%]{margin-top:1.5rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .organ-sliders[_ngcontent-%COMP%]{display:flex;height:3rem;align-items:center}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .organ-sliders[_ngcontent-%COMP%] .slider-label[_ngcontent-%COMP%]{font-weight:600}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] mat-expansion-panel[_ngcontent-%COMP%]{box-shadow:none}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] mat-expansion-panel[_ngcontent-%COMP%] mat-expansion-panel-header[_ngcontent-%COMP%] .expansion-title[_ngcontent-%COMP%]{font-size:1rem;font-weight:600}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .mat-expansion-panel-body{padding:0}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .extraction-menu[_ngcontent-%COMP%] .expansion-header, [_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .anatomical-structures-menu[_ngcontent-%COMP%] .expansion-header{-webkit-user-select:none;-moz-user-select:none;padding:0;font-weight:bold;height:3rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .extraction-menu[_ngcontent-%COMP%] .expansion-header .mat-expansion-indicator, [_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .anatomical-structures-menu[_ngcontent-%COMP%] .expansion-header .mat-expansion-indicator{display:flex;align-items:center;justify-content:center;height:24px;width:24px}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .extraction-menu[_ngcontent-%COMP%] .expansion-content[_ngcontent-%COMP%], [_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .anatomical-structures-menu[_ngcontent-%COMP%] .expansion-content[_ngcontent-%COMP%]{margin-bottom:.75rem;text-align:center;margin-top:2.25rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .extraction-menu[_ngcontent-%COMP%] .expansion-content[_ngcontent-%COMP%] .expansion-placeholder[_ngcontent-%COMP%], [_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .anatomical-structures-menu[_ngcontent-%COMP%] .expansion-content[_ngcontent-%COMP%] .expansion-placeholder[_ngcontent-%COMP%]{width:100%;font-size:.9rem;font-weight:400}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .extraction-site-tooltip[_ngcontent-%COMP%]{position:absolute;top:4rem;left:27rem;width:21rem;padding:1rem;border-radius:.5rem;border:1px solid;z-index:2}[_nghost-%COMP%] .filler[_ngcontent-%COMP%]{flex-grow:1}"],changeDetection:0}),n})(),Zke=(()=>{class n{constructor(t,i,r){this.drawer=t,this.cdr=r,this.className="ccf-drawer-toggle-button",this.position="start",this.opened=!1,this.subscriptions=new Te;const s=i.connect(this);this.subscriptions.add(s.getMessagesFromSource(t).subscribe(o=>{this.handleMessage(o)&&r.markForCheck()}))}get classEnd(){return"end"===this.position}get icon(){let t="arrow_right",i="arrow_left";return"end"===this.position&&([t,i]=[i,t]),this.opened?i: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:i,expanded:r}=t;i?r?t.closeExpanded():t.close():t.open()}}return n.\u0275fac=function(t){return new(t||n)(E(ZF),E(_0),E(kn))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-drawer-toggle-button"]],hostVars:4,hostBindings:function(t,i){2&t&&(Rn(i.className),st("ccf-drawer-toggle-button-end",i.classEnd))},decls:4,vars:4,consts:[["aria-hidden","false","aria-label","Close side drawer",1,"expand-collapse-icon",3,"click"]],template:function(t,i){1&t&&(R(0,"mat-icon",0),ge("click",function(){return i.toggle()}),De(1," arrow_right\n"),k(),R(2,"mat-icon",0),ge("click",function(){return i.toggle()}),De(3," arrow_left\n"),k()),2&t&&(st("hidden","arrow_left"===i.icon),G(2),st("hidden","arrow_right"===i.icon))},directives:[rs],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;transition:.25s}.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:absolute;right:0rem;transition:.6s;padding-left:.15rem}[_nghost-%COMP%] .expand-collapse-icon.hidden[_ngcontent-%COMP%]{opacity:0}.ccf-drawer-toggle-button-end[_nghost-%COMP%] .expand-collapse-icon[_ngcontent-%COMP%]{right:unset;left:-.25rem}.mat-icon[_ngcontent-%COMP%]{right:.3rem;top:.675rem;padding-top:.05rem}"],changeDetection:0}),n})();const Y9={x:10,y:10,z:10};let Qke=(()=>{class n{constructor(t){this.ga=t,this.clsName="ccf-block-size-input",this.blockSize=Y9,this.blockSizeChange=new Le}updateBlockSizes(t,i){const r=t.target;this.blockSize=Object.assign(Object.assign({},this.blockSize),{[i]:+r.value}),this.ga.event("block_size_change","block_size_input",i,this.blockSize[i]),this.blockSizeChange.emit(this.blockSize)}refreshBlockSize(){this.blockSize=Y9,this.ga.event("block_size_reset","block_size_input"),this.blockSizeChange.emit(this.blockSize)}}return n.\u0275fac=function(t){return new(t||n)(E(xs))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-block-size-input"]],hostVars:2,hostBindings:function(t,i){2&t&&Rn(i.clsName)},inputs:{blockSize:"blockSize"},outputs:{blockSizeChange:"blockSizeChange"},decls:19,vars:5,consts:[["matTooltip","Set the tissue block width, height and depth (dimensions)",1,"header"],[1,"text","title"],[1,"filler"],["matRipple","",1,"icon","refresh",3,"matRippleCentered","matRippleUnbounded","click"],[1,"size-inputs"],["floatLabel","always",1,"field"],[1,"text","label"],["matInput","","type","number","placeholder","","matTooltip","Enter tissue block width.",1,"input",3,"value","input"],["matInput","","type","number","placeholder","","matTooltip","Enter tissue block height.",1,"input",3,"value","input"],["matInput","","type","number","placeholder","","matTooltip","Enter tissue block depth.",1,"input",3,"value","input"]],template:function(t,i){1&t&&(R(0,"div",0),R(1,"span",1),De(2,"Tissue Block Dimensions (mm)"),k(),tt(3,"div",2),R(4,"mat-icon",3),ge("click",function(){return i.refreshBlockSize()}),De(5,"refresh"),k(),k(),R(6,"div",4),R(7,"mat-form-field",5),R(8,"mat-label",6),De(9,"Width (X)"),k(),R(10,"input",7),ge("input",function(s){return i.updateBlockSizes(s,"x")}),k(),k(),R(11,"mat-form-field",5),R(12,"mat-label",6),De(13,"Height (Y)"),k(),R(14,"input",8),ge("input",function(s){return i.updateBlockSizes(s,"y")}),k(),k(),R(15,"mat-form-field",5),R(16,"mat-label",6),De(17,"Depth (Z)"),k(),R(18,"input",9),ge("input",function(s){return i.updateBlockSizes(s,"z")}),k(),k(),k()),2&t&&(G(4),ie("matRippleCentered",!0)("matRippleUnbounded",!0),G(6),ie("value",i.blockSize.x),G(4),ie("value",i.blockSize.y),G(4),ie("value",i.blockSize.z))},directives:[dc,rs,Js,am,Gf,Xb],styles:["[_nghost-%COMP%] input[type=number][_ngcontent-%COMP%]{-moz-appearance:textfield}[_nghost-%COMP%] .header[_ngcontent-%COMP%]{display:flex;height:1.5rem;align-items:center}[_nghost-%COMP%] .header[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-weight:600}[_nghost-%COMP%] .header[_ngcontent-%COMP%] .refresh[_ngcontent-%COMP%]{transform:scaleX(-1);cursor:pointer;transition:.6s}[_nghost-%COMP%] .header[_ngcontent-%COMP%] .refresh[_ngcontent-%COMP%]:hover{border-radius:2px}[_nghost-%COMP%] .size-inputs[_ngcontent-%COMP%]{display:flex}[_nghost-%COMP%] .size-inputs[_ngcontent-%COMP%] .field[_ngcontent-%COMP%]{width:33.33%}[_nghost-%COMP%] .size-inputs[_ngcontent-%COMP%] .field[_ngcontent-%COMP%]:not(:last-child){padding-right:.75rem}[_nghost-%COMP%] .size-inputs[_ngcontent-%COMP%] .field[_ngcontent-%COMP%] .input[_ngcontent-%COMP%]{text-align:center}[_nghost-%COMP%] .filler[_ngcontent-%COMP%]{flex-grow:1}"],changeDetection:0}),n})();const X9={thickness:NaN,numSlices:NaN};let Jke=(()=>{class n{constructor(t){this.ga=t,this.clsName="ccf-slices-input",this.slicesConfig=X9,this.slicesConfigChange=new Le}get hasThicknessValue(){return!isNaN(this.slicesConfig.thickness)}updateSlicesData(t,i){const{value:r}=t.target;this.slicesConfig=Object.assign(Object.assign({},this.slicesConfig),{[i]:""!==r?+r:NaN}),this.ga.event("slice_config_update","slice_input",i,this.slicesConfig[i]),this.slicesConfigChange.emit(this.slicesConfig)}refreshSlices(){this.slicesConfig=X9,this.ga.event("slice_config_reset","slice_input"),this.slicesConfigChange.emit(this.slicesConfig)}}return n.\u0275fac=function(t){return new(t||n)(E(xs))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-slices-input"]],hostVars:2,hostBindings:function(t,i){2&t&&Rn(i.clsName)},inputs:{slicesConfig:"slicesConfig"},outputs:{slicesConfigChange:"slicesConfigChange"},decls:17,vars:6,consts:[[1,"header"],["matTooltip","\u201cAdd thickness of tissue sections and the total number of sections",1,"text","title"],[1,"filler"],["matRipple","",1,"icon","refresh",3,"matRippleCentered","matRippleUnbounded","click"],[1,"slices-inputs"],[1,"field"],[1,"text","label"],["matInput","","ccfNumbersOnly","","type","number","matTooltip","Enter thickness of tissue sections",1,"input",3,"value","input"],["matSuffix","",1,"suffix"],["matInput","","ccfNumbersOnly","","type","number","matTooltip","Enter total number of sections",1,"input",3,"value","input"]],template:function(t,i){1&t&&(R(0,"div",0),R(1,"span",1),De(2,"Tissue Sections"),k(),tt(3,"div",2),R(4,"mat-icon",3),ge("click",function(){return i.refreshSlices()}),De(5," refresh "),k(),k(),R(6,"div",4),R(7,"mat-form-field",5),R(8,"mat-label",6),De(9,"Thickness"),k(),R(10,"input",7),ge("input",function(s){return i.updateSlicesData(s,"thickness")}),k(),R(11,"div",8),De(12,"\u03bcm"),k(),k(),R(13,"mat-form-field",5),R(14,"mat-label",6),De(15,"# Sections"),k(),R(16,"input",9),ge("input",function(s){return i.updateSlicesData(s,"numSlices")}),k(),k(),k()),2&t&&(G(4),ie("matRippleCentered",!0)("matRippleUnbounded",!0),G(6),ie("value",i.slicesConfig.thickness),G(1),st("show",i.hasThicknessValue),G(5),ie("value",i.slicesConfig.numSlices))},directives:[dc,rs,Js,am,Gf,Xb,WPe,VO],styles:["[_nghost-%COMP%] input[type=number][_ngcontent-%COMP%]{-moz-appearance:textfield}[_nghost-%COMP%] .header[_ngcontent-%COMP%]{display:flex;align-items:center;height:1.5rem}[_nghost-%COMP%] .header[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-weight:600}[_nghost-%COMP%] .header[_ngcontent-%COMP%] .refresh[_ngcontent-%COMP%]{transform:scaleX(-1);cursor:pointer;transition:.6s}[_nghost-%COMP%] .header[_ngcontent-%COMP%] .refresh[_ngcontent-%COMP%]:hover{border-radius:2px}[_nghost-%COMP%] .slices-inputs[_ngcontent-%COMP%]{display:flex}[_nghost-%COMP%] .slices-inputs[_ngcontent-%COMP%] .field[_ngcontent-%COMP%]{width:33.33%}[_nghost-%COMP%] .slices-inputs[_ngcontent-%COMP%] .field[_ngcontent-%COMP%]:not(:last-child){padding-right:.75rem}[_nghost-%COMP%] .slices-inputs[_ngcontent-%COMP%] .field[_ngcontent-%COMP%] .input[_ngcontent-%COMP%]{text-align:center}[_nghost-%COMP%] .slices-inputs[_ngcontent-%COMP%] .field[_ngcontent-%COMP%] .suffix[_ngcontent-%COMP%]{display:none}[_nghost-%COMP%] .slices-inputs[_ngcontent-%COMP%] .field.mat-focused[_ngcontent-%COMP%] .suffix[_ngcontent-%COMP%], [_nghost-%COMP%] .slices-inputs[_ngcontent-%COMP%] .field[_ngcontent-%COMP%] .suffix.show[_ngcontent-%COMP%]{display:initial}[_nghost-%COMP%] .filler[_ngcontent-%COMP%]{flex-grow:1}"],changeDetection:0}),n})();const K9={x:0,y:0,z:0};let eFe=(()=>{class n{constructor(t){this.ga=t,this.clsName="ccf-rotation-slider",this.rotation=K9,this.rotationChange=new Le}changeRotation(t,i){this.rotation=Object.assign(Object.assign({},this.rotation),{[i]:+t}),this.ga.event("rotation_update","rotation_slider",i,+t),this.rotationChange.emit(this.rotation)}resetRotation(){this.rotation=K9,this.ga.event("rotation_reset","rotation_slider"),this.rotationChange.emit(this.rotation)}}return n.\u0275fac=function(t){return new(t||n)(E(xs))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-rotation-slider"]],hostVars:2,hostBindings:function(t,i){2&t&&Rn(i.clsName)},inputs:{rotation:"rotation"},outputs:{rotationChange:"rotationChange"},decls:27,vars:23,consts:[[1,"header"],["matTooltip","Use sliders below to rotate tissue block for registration",1,"text","title"],[1,"filler"],["matRipple","",1,"icon","reset",3,"matRippleCentered","matRippleUnbounded","click"],[1,"slider-box","red"],[1,"text","label"],[1,"slider-container"],[1,"slider",3,"max","min","step","thumbLabel","tickInterval","value","input"],[1,"text","value"],[1,"slider-box","green"],[1,"slider-box","blue"]],template:function(t,i){1&t&&(R(0,"div",0),R(1,"span",1),De(2,"Tissue Block Rotation"),k(),tt(3,"div",2),R(4,"mat-icon",3),ge("click",function(){return i.resetRotation()}),De(5,"refresh"),k(),k(),R(6,"div",4),R(7,"span",5),De(8,"X"),k(),R(9,"div",6),R(10,"mat-slider",7),ge("input",function(s){return i.changeRotation(s.value,"x")}),k(),k(),R(11,"span",8),De(12),k(),k(),R(13,"div",9),R(14,"span",5),De(15,"Y"),k(),R(16,"div",6),R(17,"mat-slider",7),ge("input",function(s){return i.changeRotation(s.value,"y")}),k(),k(),R(18,"span",8),De(19),k(),k(),R(20,"div",10),R(21,"span",5),De(22,"Z"),k(),R(23,"div",6),R(24,"mat-slider",7),ge("input",function(s){return i.changeRotation(s.value,"z")}),k(),k(),R(25,"span",8),De(26),k(),k()),2&t&&(G(4),ie("matRippleCentered",!0)("matRippleUnbounded",!0),G(6),ie("max",180)("min",-180)("step",1)("thumbLabel",!0)("tickInterval",180)("value",i.rotation.x),G(2),xi(i.rotation.x),G(5),ie("max",180)("min",-180)("step",1)("thumbLabel",!0)("tickInterval",180)("value",i.rotation.y),G(2),xi(i.rotation.y),G(5),ie("max",180)("min",-180)("step",1)("thumbLabel",!0)("tickInterval",180)("value",i.rotation.z),G(2),xi(i.rotation.z))},directives:[dc,rs,Js,jk],styles:["[_nghost-%COMP%] .header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;height:1.5rem}[_nghost-%COMP%] .header[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-weight:600}[_nghost-%COMP%] .header[_ngcontent-%COMP%] .reset[_ngcontent-%COMP%]{transform:scaleX(-1);cursor:pointer;transition:.6s}[_nghost-%COMP%] .header[_ngcontent-%COMP%] .reset[_ngcontent-%COMP%]:hover{border-radius:2px}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;height:4rem;padding-left:.5rem}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{width:1rem}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .value[_ngcontent-%COMP%]{width:2.75rem;text-align:center}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .slider-container[_ngcontent-%COMP%]{width:100%;padding:1rem 2rem}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .slider-container[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%]{width:100%}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .slider-container[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%]:not(.cdk-focused) .mat-slider-thumb{width:1.25rem;height:1.25rem;transform:none}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .slider-container[_ngcontent-%COMP%] .mat-slider-horizontal .mat-slider-wrapper{right:.625rem}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .slider-container[_ngcontent-%COMP%] .mat-slider-horizontal .mat-slider-wrapper:after{margin-top:-.25rem;height:.625rem!important}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .slider-container[_ngcontent-%COMP%] .mat-slider-horizontal .mat-slider-ticks-container{margin-top:-.25rem;height:.625rem}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .slider-container[_ngcontent-%COMP%] .mat-slider-horizontal .mat-slider-ticks-container .mat-slider-ticks{height:.625rem}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .filler[_ngcontent-%COMP%]{flex-grow:1}"],changeDetection:0}),n})();function nFe(n){const{subscriber:e,counter:t,period:i}=n;e.next(t),this.schedule({subscriber:e,counter:t+1,period:i},i)}const iFe=["closeSearch"];function rFe(n,e){if(1&n){const t=Zi();R(0,"div",12),R(1,"mat-checkbox",13),ge("ngModelChange",function(r){const o=en(t).$implicit;return Qe(2).checkedResults[o.id]=r}),De(2),k(),k()}if(2&n){const t=e.$implicit,i=Qe(2);G(1),ie("ngModel",i.checkedResults[t.id]),G(1),or(" ",t.label," ")}}function sFe(n,e){if(1&n&&(R(0,"div",9),mt(1,rFe,3,2,"div",10),R(2,"div",11),De(3),Kt(4,"i18nPlural"),k(),k()),2&n){const t=Qe();G(1),ie("ngForOf",t.searchResults.results)("ngForTrackBy",t.tagId),G(2),or(" ",gv(4,3,t.searchResults.totalCount,t.countMapping)," ")}}const Z9=5,Ex={totalCount:0,results:[]};class Ep{constructor(e,t,i){this.el=e,this.ga=t,this.clsName="ccf-tag-search",this.placeholder="Add Anatomical Structures ...",this.added=new Le,this.countMapping={"=1":"1 result",other:"# results"},this.searchControl=new Sh,this.searchResults=Ex,this.checkedResults={},this.resultsVisible=!1,this.destroy$=new Se,this.searchControl.valueChanges.pipe(Tn(this.destroy$),function(n,e=uW){return t=>t.lift(new z1e(n,!!e.leading,!!e.trailing))}(()=>{var r;return function(n=0,e=Pf){return(!WO(n)||n<0)&&(n=0),(!e||"function"!=typeof e.schedule)&&(e=Pf),new ce(t=>(t.add(e.schedule(nFe,n,{subscriber:t,counter:0,period:n})),t))}(null!==(r=this.searchThrottle)&&void 0!==r?r:100)},{leading:!0,trailing:!0}),Pr(this.executeSearch)).subscribe(r=>{this.searchResults=r,this.checkedResults=this.getUpdatedCheckedResults(r),i.markForCheck()})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}tagId(e,t){return t.id}hasCheckedTags(){return Object.values(this.checkedResults).some(e=>e)}addTags(){const{searchControl:e,searchResults:t,checkedResults:i}=this,r=t.results.filter(s=>i[s.id]);r.length>0&&(e.reset(),this.searchResults=Ex,this.checkedResults={},this.ga.event("tags_added","tag_search",r.map(s=>s.label).join(",")),this.added.emit(r))}openResults(){this.resultsVisible||(this.resultsVisible=!0)}closeResults(e){const{closeSearch:t}=this;this.resultsVisible&&e.target instanceof Node&&(!this.el.nativeElement.contains(e.target)||t.nativeElement.contains(e.target))&&(this.resultsVisible=!1)}executeSearch(e){const{search:t,searchLimit:i=Z9}=this;return e&&t?ui(t(e,i)).pipe(Ta(()=>[Ex]),Ae(this.truncateResults)):[Ex]}truncateResults(e){const{searchLimit:t=Z9}=this,i=e.results;return i.length>t?Object.assign(Object.assign({},e),{results:i.slice(0,t)}):e}getUpdatedCheckedResults(e){const t=this.checkedResults;return e.results.reduce((i,{id:r})=>{var s;return i[r]=null!==(s=t[r])&&void 0!==s&&s,i},{})}}function aFe(n,e){if(1&n&&(R(0,"div",11),R(1,"div",12),De(2),k(),R(3,"div",13),De(4),k(),k()),2&n){const t=e.$implicit;G(2),xi(t.label),G(2),xi(t.value)}}Ep.\u0275fac=function(e){return new(e||Ep)(E(rt),E(xs),E(kn))},Ep.\u0275cmp=Ne({type:Ep,selectors:[["ccf-tag-search"]],viewQuery:function(e,t){if(1&e&&Jn(iFe,5,rt),2&e){let i;_t(i=yt())&&(t.closeSearch=i.first)}},hostVars:2,hostBindings:function(e,t){1&e&&ge("click",function(){return t.openResults()})("focusin",function(){return t.openResults()})("click",function(r){return t.closeResults(r)},!1,ly)("focusin",function(r){return t.closeResults(r)},!1,ly),2&e&&Rn(t.clsName)},inputs:{placeholder:"placeholder",search:"search",searchLimit:"searchLimit",searchThrottle:"searchThrottle"},outputs:{added:"added"},decls:10,vars:8,consts:[[1,"spacer"],["appearance","outline",1,"overlay"],[1,"search-box"],["matInput","","type","search",3,"placeholder","formControl"],["search",""],["matSuffix","",1,"add-button",3,"disabled","click"],["closeSearch",""],[1,"icon"],["class","results",4,"ngIf"],[1,"results"],["class","item",4,"ngFor","ngForOf","ngForTrackBy"],[1,"count"],[1,"item"],["labelPosition","after",3,"ngModel","ngModelChange"]],template:function(e,t){if(1&e){const i=Zi();tt(0,"div",0),R(1,"mat-form-field",1),R(2,"div",2),tt(3,"input",3,4),R(5,"button",5,6),ge("click",function(){en(i);const s=vs(4);return t.addTags(),s.focus()}),R(7,"mat-icon",7),De(8,"add"),k(),k(),k(),mt(9,sFe,5,6,"div",8),k()}2&e&&(G(1),st("expanded",t.resultsVisible),G(2),ie("placeholder",t.placeholder)("formControl",t.searchControl),G(2),st("active",t.hasCheckedTags()),ie("disabled",!t.hasCheckedTags()),G(4),ie("ngIf",t.resultsVisible))},directives:[am,Xb,Hb,vk,GM,VO,rs,zr,pl,VF,Ok],pipes:[eV],styles:["[_nghost-%COMP%]{display:block;position:relative}[_nghost-%COMP%] .spacer[_ngcontent-%COMP%]{height:3.25rem}[_nghost-%COMP%] .overlay[_ngcontent-%COMP%]{position:absolute;top:0;left:0;right:0;z-index:10}[_nghost-%COMP%] .overlay[_ngcontent-%COMP%] .search-box[_ngcontent-%COMP%]{display:flex;width:100%;align-items:center;height:3rem}[_nghost-%COMP%] .overlay[_ngcontent-%COMP%] .search-box[_ngcontent-%COMP%] .add-button[_ngcontent-%COMP%]{border-radius:.25rem;border:none;display:flex;justify-content:center;align-items:center;cursor:pointer;height:100%}[_nghost-%COMP%] .overlay[_ngcontent-%COMP%] .results[_ngcontent-%COMP%]{margin-top:.5rem}[_nghost-%COMP%] .overlay[_ngcontent-%COMP%] .results[_ngcontent-%COMP%] .count[_ngcontent-%COMP%]{margin-top:.5rem;font-size:.75rem;text-align:end}[_nghost-%COMP%] .overlay[_ngcontent-%COMP%] .mat-form-field-wrapper{padding-bottom:0;border-radius:.5rem}[_nghost-%COMP%] .overlay[_ngcontent-%COMP%] .mat-form-field-wrapper .mat-form-field-flex{padding-right:0!important}[_nghost-%COMP%] .overlay[_ngcontent-%COMP%] .mat-form-field-outline{opacity:1!important}[_nghost-%COMP%] .overlay[_ngcontent-%COMP%] .mat-form-field-outline-thick{opacity:0!important}[_nghost-%COMP%] .overlay[_ngcontent-%COMP%] .mat-form-field-infix{padding:.313rem .063rem .063rem;border:0}[_nghost-%COMP%] .overlay.expanded[_ngcontent-%COMP%] .mat-form-field-wrapper{box-shadow:0 0 .3rem .1rem #9e9e9e5e}"],changeDetection:0}),xe([lu.ak],Ep.prototype,"executeSearch",null),xe([lu.ak],Ep.prototype,"truncateResults",null);let lFe=(()=>{class n{constructor(t,i){this.dialogRef=t,this.data=i,this.clsName="ccf-review-modal",this.metaData=i.metaData,this.registrationCallbackSet=i.registrationCallbackSet}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 n.\u0275fac=function(t){return new(t||n)(E(Qm),E(Gk))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-review-modal"]],hostVars:2,hostBindings:function(t,i){2&t&&Rn(i.clsName)},decls:14,vars:2,consts:[[1,"ccf-about","wrapper"],[1,"container"],[1,"close"],[1,"material-icons","close-icon",3,"click"],[1,"content"],["mat-dialog-title","",1,"title"],[1,"mat-typography"],[1,"display-fields"],["class","field",4,"ngFor","ngForOf"],[1,"footer"],["mat-button","",1,"download-button",3,"click"],[1,"field"],[1,"label"],[1,"data"]],template:function(t,i){1&t&&(R(0,"div",0),R(1,"div",1),R(2,"div",2),R(3,"mat-icon",3),ge("click",function(){return i.close()}),De(4,"clear"),k(),k(),R(5,"div",4),R(6,"h2",5),De(7,"Registration Review"),k(),R(8,"mat-dialog-content",6),R(9,"div",7),mt(10,aFe,5,2,"div",8),k(),k(),R(11,"div",9),R(12,"button",10),ge("click",function(){return i.dialogRef.close(!0)}),De(13),k(),k(),k(),k(),k()),2&t&&(G(10),ie("ngForOf",i.metaData),G(3),xi(i.registrationCallbackSet?"REGISTER":"DOWNLOAD REGISTRATION DATA"))},directives:[rs,Wk,qk,pl,lh],styles:[".mat-dialog-container{padding:0}[_nghost-%COMP%] .ccf-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .content[_ngcontent-%COMP%]{padding:3rem;background-color:#fff}[_nghost-%COMP%] .ccf-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .content[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{text-align:center;font-size:1.5rem;margin-bottom:0}[_nghost-%COMP%] .ccf-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .content[_ngcontent-%COMP%] .mat-typography[_ngcontent-%COMP%]{justify-content:space-around;display:flex}[_nghost-%COMP%] .ccf-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .content[_ngcontent-%COMP%] .mat-typography[_ngcontent-%COMP%] .display-fields[_ngcontent-%COMP%]{margin-top:2rem;margin-bottom:2rem;width:100%}[_nghost-%COMP%] .ccf-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .content[_ngcontent-%COMP%] .mat-typography[_ngcontent-%COMP%] .display-fields[_ngcontent-%COMP%] .field[_ngcontent-%COMP%]{display:flex}[_nghost-%COMP%] .ccf-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .content[_ngcontent-%COMP%] .mat-typography[_ngcontent-%COMP%] .display-fields[_ngcontent-%COMP%] .field[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{width:50%;text-align:right;padding-right:1rem}[_nghost-%COMP%] .ccf-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .content[_ngcontent-%COMP%] .mat-typography[_ngcontent-%COMP%] .display-fields[_ngcontent-%COMP%] .field[_ngcontent-%COMP%] .data[_ngcontent-%COMP%]{width:50%;text-align:left;padding-left:1rem}[_nghost-%COMP%] .ccf-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .close[_ngcontent-%COMP%] .close-icon[_ngcontent-%COMP%]{float:right;margin-top:1rem;margin-right:1rem;cursor:pointer}[_nghost-%COMP%] .ccf-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .footer[_ngcontent-%COMP%]{padding-top:1.5rem;display:flex;justify-content:space-around}[_nghost-%COMP%] .ccf-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .footer[_ngcontent-%COMP%] .review-button[_ngcontent-%COMP%]{height:3rem;transition:.6s}"]}),n})(),cFe=(()=>{class n{constructor(t,i){this.dialog=t,this.ga=i,this.clsName="ccf-review-button",this.registrationCallbackSet=!0,this.metaData=[],this.displayErrors=!0,this.registrationIsValid=!1,this.registerData=new Le,this.enterErrorMode=new Le}ngOnChanges(){this.registrationIsValid=this.metaData.length>=3&&this.metaData.slice(0,3).every(t=>t.value)}get disabled(){return!this.registrationIsValid}registerButtonClick(t){return t&&t.preventDefault(),this.enterErrorMode.emit(),this.registrationIsValid&&(this.ga.event("review_start","review_button"),this.launchReviewModal()),!1}launchReviewModal(){this.dialog.open(lFe,{panelClass:"modal-animated",width:"60rem",data:{registrationCallbackSet:this.registrationCallbackSet,metaData:this.metaData}}).afterClosed().subscribe(i=>{i&&(this.ga.event("register","review_button"),this.registerData.emit())})}}return n.\u0275fac=function(t){return new(t||n)(E(_p),E(xs))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-review-button"]],hostVars:2,hostBindings:function(t,i){2&t&&Rn(i.clsName)},inputs:{registrationCallbackSet:"registrationCallbackSet",metaData:"metaData",displayErrors:"displayErrors",registrationIsValid:"registrationIsValid"},outputs:{registerData:"registerData",enterErrorMode:"enterErrorMode"},features:[zn],decls:2,vars:4,consts:[["mat-button","",1,"review-button",3,"matTooltip","click"]],template:function(t,i){1&t&&(R(0,"button",0),ge("click",function(s){return i.registerButtonClick(s)}),De(1),k()),2&t&&(st("disabled",i.disabled),ie("matTooltip",i.disabled?"Required: Select an organ and position tissue block inside organ.":"Review registration and submit/download."),G(1),or(" ",i.registrationCallbackSet?"REVIEW AND REGISTER":"REVIEW AND DOWNLOAD","\n"))},directives:[lh,dc],styles:[".review-button[_ngcontent-%COMP%]{width:100%;height:2.25rem;transition:.6s;font-weight:500}.review-button.disabled[_ngcontent-%COMP%]{cursor:not-allowed}"]}),n})();function uFe(n,e){if(1&n){const t=Zi();R(0,"mat-chip",2),ge("removed",function(){const s=en(t).$implicit;return Qe().removeTag(s)}),De(1),R(2,"mat-icon",3),De(3,"cancel"),k(),k()}if(2&n){const t=e.$implicit;Rn(Qe().tagClasses(t)),G(1),or(" ",t.label," ")}}let dFe=(()=>{class n{constructor(t){this.ga=t,this.clsName="ccf-tag-list",this.tagRemoved=new Le,this.tagsChange=new Le}tagId(t,i){return i.id}tagClasses(t){return"added"===t.type?["added"]:["assigned"]}removeTag(t){this.tags=this.tags.filter(i=>i!==t),this.ga.event("tag_removed","tag_list",t.label),this.tagRemoved.emit(t),this.tagsChange.emit(this.tags)}}return n.\u0275fac=function(t){return new(t||n)(E(xs))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-tag-list"]],hostVars:2,hostBindings:function(t,i){2&t&&Rn(i.clsName)},inputs:{tags:"tags"},outputs:{tagRemoved:"tagRemoved",tagsChange:"tagsChange"},decls:2,vars:2,consts:[["selectable","false"],["removable","","disableRipple","",3,"class","removed",4,"ngFor","ngForOf","ngForTrackBy"],["removable","","disableRipple","",3,"removed"],["matChipRemove","",1,"icon","remove"]],template:function(t,i){1&t&&(R(0,"mat-chip-list",0),mt(1,uFe,4,3,"mat-chip",1),k()),2&t&&(G(1),ie("ngForOf",i.tags)("ngForTrackBy",i.tagId))},directives:[z9,pl,y0,rs,B9],styles:["[_nghost-%COMP%]{display:block;overflow-x:hidden;overflow-y:auto}[_nghost-%COMP%] .mat-chip-list-wrapper{margin:0}"],changeDetection:0}),n})();function hFe(n,e){if(1&n){const t=Zi();R(0,"ccf-tag-list",20),ge("tagRemoved",function(r){return en(t),Qe().astags.removeTag(r)}),Kt(1,"async"),k()}2&n&&ie("tags",rn(1,1,Qe().astags.tags$))}function fFe(n,e){}const pFe=function(){return[]};let gFe=(()=>{class n{constructor(t,i,r,s){this.model=t,this.registration=i,this.page=r,this.astags=s,this.clsName="ccf-right-sidebar",this.modalClosed=!1}}return n.\u0275fac=function(t){return new(t||n)(E(ai),E(Sr),E(ji),E(ko))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-right-sidebar"]],hostVars:2,hostBindings:function(t,i){2&t&&Rn(i.clsName)},inputs:{modalClosed:"modalClosed"},decls:34,vars:28,consts:[[1,"scroll-wrapper"],[1,"container"],[1,"info-button-container"],["videoID","gY3_-LIoKaU","infoTitle","CCF Registration User Interface","documentationUrl","assets/docs/README.md"],[3,"blockSize","blockSizeChange"],[3,"slicesConfig","slicesConfigChange"],[3,"rotation","rotationChange"],[1,"tags-container",3,"expanded"],[1,"header"],["matTooltip","Review tags generated via collision detection. Add or delete tags as needed."],[3,"search","added"],["class","tag-list",3,"tags","tagRemoved",4,"ngIf","ngIfElse"],["tagListPlaceholder",""],[1,"legend"],[1,"dot","assigned"],[1,"text","assigned"],[1,"dot","added"],[1,"text","added"],[1,"filler"],[3,"registrationCallbackSet","displayErrors","registrationIsValid","metaData","registerData","enterErrorMode"],[1,"tag-list",3,"tags","tagRemoved"]],template:function(t,i){if(1&t&&(R(0,"div",0),R(1,"div",1),R(2,"div",2),tt(3,"ccf-info-button",3),k(),R(4,"ccf-block-size-input",4),ge("blockSizeChange",function(s){return i.model.setBlockSize(s)}),Kt(5,"async"),k(),R(6,"ccf-slices-input",5),ge("slicesConfigChange",function(s){return i.model.setSlicesConfig(s)}),Kt(7,"async"),k(),R(8,"ccf-rotation-slider",6),ge("rotationChange",function(s){return i.model.setRotation(s)}),Kt(9,"async"),k(),tt(10,"mat-divider"),R(11,"mat-expansion-panel",7),R(12,"mat-expansion-panel-header",8),R(13,"mat-panel-title",9),De(14,"Anatomical Structure Tags"),k(),k(),R(15,"ccf-tag-search",10),ge("added",function(s){return i.astags.addTags(s)}),k(),mt(16,hFe,2,3,"ccf-tag-list",11),Kt(17,"async"),mt(18,fFe,0,0,"ng-template",null,12,jw),R(20,"div",13),tt(21,"span",14),R(22,"span",15),De(23,"Assigned"),k(),tt(24,"span",16),R(25,"span",17),De(26,"Added"),k(),k(),k(),tt(27,"mat-divider"),tt(28,"div",18),R(29,"ccf-review-button",19),ge("registerData",function(){return i.registration.register()})("enterErrorMode",function(){return i.registration.setDisplayErrors(!i.registration.isValid)}),Kt(30,"async"),Kt(31,"async"),Kt(32,"async"),Kt(33,"async"),k(),k(),k()),2&t){const r=vs(19);let s,o;G(4),ie("blockSize",rn(5,11,i.model.blockSize$)),G(2),ie("slicesConfig",rn(7,13,i.model.slicesConfig$)),G(2),ie("rotation",rn(9,15,i.model.rotation$)),G(3),ie("expanded",i.modalClosed),G(4),ie("search",i.astags.searchExternal),G(1),ie("ngIf",null==(s=rn(17,17,i.model.organ$))?null:s.name)("ngIfElse",r),G(13),ie("registrationCallbackSet",rn(30,19,i.page.registrationCallbackSet$))("displayErrors",rn(31,21,i.registration.displayErrors$))("registrationIsValid",rn(32,23,i.registration.valid$))("metaData",null!==(o=rn(33,25,i.registration.metadata$))&&void 0!==o?o:fv(27,pFe))}},directives:[UPe,Qke,Jke,eFe,n9,qM,YM,EW,dc,Ep,zr,cFe,dFe],pipes:[Hc],styles:["[_nghost-%COMP%]{display:block;height:calc(100% - 3rem);margin-top:1.5rem;margin-bottom:1.5rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%]{height:100%;margin-right:.375rem;scrollbar-width:thin}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%]::-webkit-scrollbar{width:.75rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%]{display:flex;flex-direction:column;min-height:100%;margin-left:1.5rem;margin-right:.375rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .info-button-container[_ngcontent-%COMP%]{height:3.75rem;display:flex;justify-content:flex-end}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] mat-divider[_ngcontent-%COMP%]{border-top-width:3px}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] mat-expansion-panel[_ngcontent-%COMP%]{box-shadow:none}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] mat-expansion-panel[_ngcontent-%COMP%] mat-expansion-panel-header[_ngcontent-%COMP%]{padding:0 .5rem 0 0;font-weight:bold;-webkit-user-select:none;-moz-user-select:none;font-size:1rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .tags-container[_ngcontent-%COMP%]{overflow:visible}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .tags-container[_ngcontent-%COMP%] .mat-expansion-panel-body{padding-left:0;padding-right:0}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .tags-container[_ngcontent-%COMP%] .header[_ngcontent-%COMP%]{height:3rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .tags-container[_ngcontent-%COMP%] .search[_ngcontent-%COMP%]{margin-top:1rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .tags-container[_ngcontent-%COMP%] .search[_ngcontent-%COMP%] .icon.add[_ngcontent-%COMP%]{position:absolute;width:3.625rem;height:3.625rem;font-size:3.625rem;top:-1.9375rem;right:-1.1875rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .tags-container[_ngcontent-%COMP%] .tag-list[_ngcontent-%COMP%]{max-height:32rem;margin-left:-1rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .tags-container[_ngcontent-%COMP%] .tag-list-placeholder[_ngcontent-%COMP%]{display:flex;height:4rem;align-items:center;justify-content:center;font-weight:400}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .tags-container[_ngcontent-%COMP%] .legend[_ngcontent-%COMP%]{display:flex;width:100%;margin-top:1.5rem;align-items:center;font-size:.9rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .tags-container[_ngcontent-%COMP%] .legend[_ngcontent-%COMP%] .dot[_ngcontent-%COMP%]{display:inline-block;width:1rem;height:1rem;border-radius:50%}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .tags-container[_ngcontent-%COMP%] .legend[_ngcontent-%COMP%] .dot.assigned[_ngcontent-%COMP%]{margin-left:.5rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .tags-container[_ngcontent-%COMP%] .legend[_ngcontent-%COMP%] .dot.added[_ngcontent-%COMP%]{margin-left:1rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .tags-container[_ngcontent-%COMP%] .legend[_ngcontent-%COMP%] .text[_ngcontent-%COMP%]{margin-left:.5rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .filler[_ngcontent-%COMP%]{flex-grow:1}"],changeDetection:0}),n})();function Q9(n,e){return Zo((t,i)=>e?e(t[n],i[n]):t[n]===i[n])}const mFe=["input"],_Fe=function(n){return{enterDuration:n}},yFe=["*"],vFe=new ve("mat-radio-default-options",{providedIn:"root",factory:function(){return{color:"accent"}}});let J9=0;const CFe={provide:ro,useExisting:T(()=>i7),multi:!0};class e7{constructor(e,t){this.source=e,this.value=t}}const t7=new ve("MatRadioGroup");let n7=(()=>{class n{constructor(t){this._changeDetector=t,this._value=null,this._name="mat-radio-group-"+J9++,this._selected=null,this._isInitialized=!1,this._labelPosition="after",this._disabled=!1,this._required=!1,this._controlValueAccessorChangeFn=()=>{},this.onTouched=()=>{},this.change=new Le}get name(){return this._name}set name(t){this._name=t,this._updateRadioButtonNames()}get labelPosition(){return this._labelPosition}set labelPosition(t){this._labelPosition="before"===t?"before":"after",this._markRadiosForCheck()}get value(){return this._value}set value(t){this._value!==t&&(this._value=t,this._updateSelectedRadioFromValue(),this._checkSelectedRadioButton())}_checkSelectedRadioButton(){this._selected&&!this._selected.checked&&(this._selected.checked=!0)}get selected(){return this._selected}set selected(t){this._selected=t,this.value=t?t.value:null,this._checkSelectedRadioButton()}get disabled(){return this._disabled}set disabled(t){this._disabled=Mt(t),this._markRadiosForCheck()}get required(){return this._required}set required(t){this._required=Mt(t),this._markRadiosForCheck()}ngAfterContentInit(){this._isInitialized=!0}_touch(){this.onTouched&&this.onTouched()}_updateRadioButtonNames(){this._radios&&this._radios.forEach(t=>{t.name=this.name,t._markForCheck()})}_updateSelectedRadioFromValue(){this._radios&&(null===this._selected||this._selected.value!==this._value)&&(this._selected=null,this._radios.forEach(i=>{i.checked=this.value===i.value,i.checked&&(this._selected=i)}))}_emitChangeEvent(){this._isInitialized&&this.change.emit(new e7(this._selected,this._value))}_markRadiosForCheck(){this._radios&&this._radios.forEach(t=>t._markForCheck())}writeValue(t){this.value=t,this._changeDetector.markForCheck()}registerOnChange(t){this._controlValueAccessorChangeFn=t}registerOnTouched(t){this.onTouched=t}setDisabledState(t){this.disabled=t,this._changeDetector.markForCheck()}}return n.\u0275fac=function(t){return new(t||n)(E(kn))},n.\u0275dir=oe({type:n,inputs:{name:"name",labelPosition:"labelPosition",value:"value",selected:"selected",disabled:"disabled",required:"required",color:"color"},outputs:{change:"change"}}),n})(),i7=(()=>{class n extends n7{}return n.\u0275fac=function(){let e;return function(i){return(e||(e=$n(n)))(i||n)}}(),n.\u0275dir=oe({type:n,selectors:[["mat-radio-group"]],contentQueries:function(t,i,r){if(1&t&&ei(r,r7,5),2&t){let s;_t(s=yt())&&(i._radios=s)}},hostAttrs:["role","radiogroup",1,"mat-radio-group"],exportAs:["matRadioGroup"],features:[Dt([CFe,{provide:t7,useExisting:n}]),ct]}),n})();class wFe{constructor(e){this._elementRef=e}}const EFe=nc(Hf(wFe));let SFe=(()=>{class n extends EFe{constructor(t,i,r,s,o,a,l,c){super(i),this._changeDetector=r,this._focusMonitor=s,this._radioDispatcher=o,this._providerOverride=l,this._uniqueId="mat-radio-"+ ++J9,this.id=this._uniqueId,this.change=new Le,this._checked=!1,this._value=null,this._removeUniqueSelectionListener=()=>{},this.radioGroup=t,this._noopAnimations="NoopAnimations"===a,c&&(this.tabIndex=To(c,0)),this._removeUniqueSelectionListener=o.listen((d,f)=>{d!==this.id&&f===this.name&&(this.checked=!1)})}get checked(){return this._checked}set checked(t){const i=Mt(t);this._checked!==i&&(this._checked=i,i&&this.radioGroup&&this.radioGroup.value!==this.value?this.radioGroup.selected=this:!i&&this.radioGroup&&this.radioGroup.value===this.value&&(this.radioGroup.selected=null),i&&this._radioDispatcher.notify(this.id,this.name),this._changeDetector.markForCheck())}get value(){return this._value}set value(t){this._value!==t&&(this._value=t,null!==this.radioGroup&&(this.checked||(this.checked=this.radioGroup.value===t),this.checked&&(this.radioGroup.selected=this)))}get labelPosition(){return this._labelPosition||this.radioGroup&&this.radioGroup.labelPosition||"after"}set labelPosition(t){this._labelPosition=t}get disabled(){return this._disabled||null!==this.radioGroup&&this.radioGroup.disabled}set disabled(t){this._setDisabled(Mt(t))}get required(){return this._required||this.radioGroup&&this.radioGroup.required}set required(t){this._required=Mt(t)}get color(){return this._color||this.radioGroup&&this.radioGroup.color||this._providerOverride&&this._providerOverride.color||"accent"}set color(t){this._color=t}get inputId(){return`${this.id||this._uniqueId}-input`}focus(t,i){i?this._focusMonitor.focusVia(this._inputElement,i,t):this._inputElement.nativeElement.focus(t)}_markForCheck(){this._changeDetector.markForCheck()}ngOnInit(){this.radioGroup&&(this.checked=this.radioGroup.value===this._value,this.checked&&(this.radioGroup.selected=this),this.name=this.radioGroup.name)}ngAfterViewInit(){this._focusMonitor.monitor(this._elementRef,!0).subscribe(t=>{!t&&this.radioGroup&&this.radioGroup._touch()})}ngOnDestroy(){this._focusMonitor.stopMonitoring(this._elementRef),this._removeUniqueSelectionListener()}_emitChangeEvent(){this.change.emit(new e7(this,this._value))}_isRippleDisabled(){return this.disableRipple||this.disabled}_onInputClick(t){t.stopPropagation()}_onInputInteraction(t){if(t.stopPropagation(),!this.checked&&!this.disabled){const i=this.radioGroup&&this.value!==this.radioGroup.value;this.checked=!0,this._emitChangeEvent(),this.radioGroup&&(this.radioGroup._controlValueAccessorChangeFn(this.value),i&&this.radioGroup._emitChangeEvent())}}_setDisabled(t){this._disabled!==t&&(this._disabled=t,this._changeDetector.markForCheck())}}return n.\u0275fac=function(t){return new(t||n)(E(n7),E(rt),E(kn),E(Sa),E(cS),E(String),E(void 0),E(String))},n.\u0275dir=oe({type:n,viewQuery:function(t,i){if(1&t&&Jn(mFe,5),2&t){let r;_t(r=yt())&&(i._inputElement=r.first)}},inputs:{id:"id",checked:"checked",value:"value",labelPosition:"labelPosition",disabled:"disabled",required:"required",color:"color",name:"name",ariaLabel:["aria-label","ariaLabel"],ariaLabelledby:["aria-labelledby","ariaLabelledby"],ariaDescribedby:["aria-describedby","ariaDescribedby"]},outputs:{change:"change"},features:[ct]}),n})(),r7=(()=>{class n extends SFe{constructor(t,i,r,s,o,a,l,c){super(t,i,r,s,o,a,l,c)}}return n.\u0275fac=function(t){return new(t||n)(E(t7,8),E(rt),E(kn),E(Sa),E(cS),E(Do,8),E(vFe,8),Zr("tabindex"))},n.\u0275cmp=Ne({type:n,selectors:[["mat-radio-button"]],hostAttrs:[1,"mat-radio-button"],hostVars:17,hostBindings:function(t,i){1&t&&ge("focus",function(){return i._inputElement.nativeElement.focus()}),2&t&&(nn("tabindex",null)("id",i.id)("aria-label",null)("aria-labelledby",null)("aria-describedby",null),st("mat-radio-checked",i.checked)("mat-radio-disabled",i.disabled)("_mat-animation-noopable",i._noopAnimations)("mat-primary","primary"===i.color)("mat-accent","accent"===i.color)("mat-warn","warn"===i.color))},inputs:{disableRipple:"disableRipple",tabIndex:"tabIndex"},exportAs:["matRadioButton"],features:[ct],ngContentSelectors:yFe,decls:13,vars:20,consts:[[1,"mat-radio-label"],["label",""],[1,"mat-radio-container"],[1,"mat-radio-outer-circle"],[1,"mat-radio-inner-circle"],["type","radio",1,"mat-radio-input","cdk-visually-hidden",3,"id","checked","disabled","tabIndex","required","change","click"],["input",""],["mat-ripple","",1,"mat-radio-ripple","mat-focus-indicator",3,"matRippleTrigger","matRippleDisabled","matRippleCentered","matRippleRadius","matRippleAnimation"],[1,"mat-ripple-element","mat-radio-persistent-ripple"],[1,"mat-radio-label-content"],[2,"display","none"]],template:function(t,i){if(1&t&&(wi(),R(0,"label",0,1),R(2,"span",2),tt(3,"span",3),tt(4,"span",4),R(5,"input",5,6),ge("change",function(s){return i._onInputInteraction(s)})("click",function(s){return i._onInputClick(s)}),k(),R(7,"span",7),tt(8,"span",8),k(),k(),R(9,"span",9),R(10,"span",10),De(11,"\xa0"),k(),Ht(12),k(),k()),2&t){const r=vs(1);nn("for",i.inputId),G(5),ie("id",i.inputId)("checked",i.checked)("disabled",i.disabled)("tabIndex",i.tabIndex)("required",i.required),nn("name",i.name)("value",i.value)("aria-label",i.ariaLabel)("aria-labelledby",i.ariaLabelledby)("aria-describedby",i.ariaDescribedby),G(2),ie("matRippleTrigger",r)("matRippleDisabled",i._isRippleDisabled())("matRippleCentered",!0)("matRippleRadius",20)("matRippleAnimation",Hg(18,_Fe,i._noopAnimations?0:150)),G(2),st("mat-radio-label-before","before"==i.labelPosition)}},directives:[Js],styles:[".mat-radio-button{display:inline-block;-webkit-tap-highlight-color:transparent;outline:0}.mat-radio-label{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;display:inline-flex;align-items:center;white-space:nowrap;vertical-align:middle;width:100%}.mat-radio-container{box-sizing:border-box;display:inline-block;position:relative;width:20px;height:20px;flex-shrink:0}.mat-radio-outer-circle{box-sizing:border-box;display:block;height:20px;left:0;position:absolute;top:0;transition:border-color ease 280ms;width:20px;border-width:2px;border-style:solid;border-radius:50%}._mat-animation-noopable .mat-radio-outer-circle{transition:none}.mat-radio-inner-circle{border-radius:50%;box-sizing:border-box;display:block;height:20px;left:0;position:absolute;top:0;opacity:0;transition:transform ease 280ms,background-color ease 280ms,opacity linear 1ms 280ms;width:20px;transform:scale(0.001);-webkit-print-color-adjust:exact;color-adjust:exact}.mat-radio-checked .mat-radio-inner-circle{transform:scale(0.5);opacity:1;transition:transform ease 280ms,background-color ease 280ms}.cdk-high-contrast-active .mat-radio-checked .mat-radio-inner-circle{border:solid 10px}._mat-animation-noopable .mat-radio-inner-circle{transition:none}.mat-radio-label-content{-webkit-user-select:auto;-moz-user-select:auto;-ms-user-select:auto;user-select:auto;display:inline-block;order:0;line-height:inherit;padding-left:8px;padding-right:0}[dir=rtl] .mat-radio-label-content{padding-right:8px;padding-left:0}.mat-radio-label-content.mat-radio-label-before{order:-1;padding-left:0;padding-right:8px}[dir=rtl] .mat-radio-label-content.mat-radio-label-before{padding-right:0;padding-left:8px}.mat-radio-disabled,.mat-radio-disabled .mat-radio-label{cursor:default}.mat-radio-button .mat-radio-ripple{position:absolute;left:calc(50% - 20px);top:calc(50% - 20px);height:40px;width:40px;z-index:1;pointer-events:none}.mat-radio-button .mat-radio-ripple .mat-ripple-element:not(.mat-radio-persistent-ripple){opacity:.16}.mat-radio-persistent-ripple{width:100%;height:100%;transform:none;top:0;left:0}.mat-radio-container:hover .mat-radio-persistent-ripple{opacity:.04}.mat-radio-button:not(.mat-radio-disabled).cdk-keyboard-focused .mat-radio-persistent-ripple,.mat-radio-button:not(.mat-radio-disabled).cdk-program-focused .mat-radio-persistent-ripple{opacity:.12}.mat-radio-persistent-ripple,.mat-radio-disabled .mat-radio-container:hover .mat-radio-persistent-ripple{opacity:0}@media(hover: none){.mat-radio-container:hover .mat-radio-persistent-ripple{display:none}}.mat-radio-input{bottom:0;left:50%}.cdk-high-contrast-active .mat-radio-button:not(.mat-radio-disabled).cdk-keyboard-focused .mat-radio-ripple,.cdk-high-contrast-active .mat-radio-button:not(.mat-radio-disabled).cdk-program-focused .mat-radio-ripple{outline:solid 3px}.cdk-high-contrast-active .mat-radio-disabled{opacity:.5}\n"],encapsulation:2,changeDetection:0}),n})(),MFe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[_l,On],On]}),n})();const xFe=["label"],TFe=["options"],AFe=function(){return["Register","3D\xa0Preview"]};let DFe=(()=>{class n{constructor(t){this.ga=t,this.clsName="ccf-stage-nav",this.side="anterior",this.view3D=!1,this.sideChange=new Le,this.view3DChange=new Le,this.isDropdownActive=!1,this.isDropdownHidden=!0}set useDropdownMenu(t){this.isDropdownActive=t,this.isDropdownHidden=!0}get labelEl(){return this.labelRef.nativeElement}get optionsEl(){return this.optionsRef.nativeElement}handleClick(t){const{isDropdownHidden:i,labelEl:r,optionsEl:s}=this;r.contains(t)?this.isDropdownHidden=!i:s.contains(t)||(this.isDropdownHidden=!0)}updateSide(t){this.ga.event("side_update","stage_nav",t),"3D"===t?this.updateView(!0):(this.updateView(!1),this.side=t,this.sideChange.emit(this.side))}updateView(t){this.view3D=t,this.ga.event("view_update","stage_nav",t?"3D":"Register"),this.view3DChange.emit(this.view3D)}}return n.\u0275fac=function(t){return new(t||n)(E(xs))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-stage-nav"]],viewQuery:function(t,i){if(1&t&&(Jn(xFe,7),Jn(TFe,7)),2&t){let r;_t(r=yt())&&(i.labelRef=r.first),_t(r=yt())&&(i.optionsRef=r.first)}},hostVars:2,hostBindings:function(t,i){1&t&&ge("click",function(s){return i.handleClick(s.target)},!1,sg),2&t&&Rn(i.clsName)},inputs:{useDropdownMenu:"useDropdownMenu",side:"side",view3D:"view3D"},outputs:{sideChange:"sideChange",view3DChange:"view3DChange"},decls:18,vars:10,consts:[[1,"dropdown-label"],["label",""],[1,"stage-options"],["options",""],[1,"input-group",3,"value","change"],["value","left",1,"nav-input"],["value","right",1,"nav-input"],["value","anterior","checked","",1,"nav-input"],["value","posterior",1,"nav-input"],["matTooltip","Change view.",1,"view-slider",3,"labels","value","valueChange"]],template:function(t,i){1&t&&(R(0,"div",0,1),R(2,"mat-label"),De(3,"Options"),k(),R(4,"mat-icon"),De(5,"arrow_drop_down"),k(),k(),R(6,"div",2,3),R(8,"mat-radio-group",4),ge("change",function(s){return i.updateSide(s.value)}),R(9,"mat-radio-button",5),De(10,"Left"),k(),R(11,"mat-radio-button",6),De(12,"Right"),k(),R(13,"mat-radio-button",7),De(14,"Anterior"),k(),R(15,"mat-radio-button",8),De(16,"Posterior"),k(),k(),R(17,"ccf-labeled-slide-toggle",9),ge("valueChange",function(s){return i.updateView("Register"!==s)}),k(),k()),2&t&&(st("dropdown",i.isDropdownActive),G(6),st("dropdowncontainer",i.isDropdownActive)("hidden",i.isDropdownActive&&i.isDropdownHidden),G(2),ie("value",i.side),G(9),ie("labels",fv(9,AFe))("value",i.view3D?"3D\xa0Preview":"Register"))},directives:[Gf,rs,i7,r7,XF,dc],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;flex-wrap:wrap}[_nghost-%COMP%] .dropdown-label[_ngcontent-%COMP%]{display:none;align-items:center}[_nghost-%COMP%] .dropdown-label[_ngcontent-%COMP%] mat-label[_ngcontent-%COMP%], [_nghost-%COMP%] .dropdown-label[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{line-height:1.5rem}[_nghost-%COMP%] .dropdown-label.dropdown[_ngcontent-%COMP%]{display:flex;cursor:pointer;align-items:start}[_nghost-%COMP%] .stage-options[_ngcontent-%COMP%]{display:flex;align-items:center}[_nghost-%COMP%] .stage-options[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%] .nav-input[_ngcontent-%COMP%]{margin-right:1.5rem;margin-bottom:1.5rem}[_nghost-%COMP%] .stage-options[_ngcontent-%COMP%] .view-slider[_ngcontent-%COMP%]{margin-left:-1rem;margin-bottom:1.5rem;white-space:nowrap}[_nghost-%COMP%] .stage-options.dropdowncontainer[_ngcontent-%COMP%]{display:flex;flex-direction:column;border-radius:.25rem;width:16.5rem;position:absolute;top:3.5rem;z-index:1;transition:opacity .25s}[_nghost-%COMP%] .stage-options.dropdowncontainer[_ngcontent-%COMP%] [_ngcontent-%COMP%]:first-child{margin-top:.5rem}[_nghost-%COMP%] .stage-options.dropdowncontainer[_ngcontent-%COMP%] [_ngcontent-%COMP%]:last-child{margin-bottom:.5rem}[_nghost-%COMP%] .stage-options.dropdowncontainer[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%]{margin-left:1.5rem;margin-right:0;display:flex;flex-wrap:wrap}[_nghost-%COMP%] .stage-options.dropdowncontainer[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%] .nav-input[_ngcontent-%COMP%]{display:flex;margin:0 1.5rem 0 0;height:2.5rem}[_nghost-%COMP%] .stage-options.dropdowncontainer[_ngcontent-%COMP%] .view-slider[_ngcontent-%COMP%]{display:flex;align-items:center;height:3rem;margin:0 .5rem}[_nghost-%COMP%] .stage-options.dropdowncontainer[_ngcontent-%COMP%] mat-divider[_ngcontent-%COMP%]{visibility:visible;border-top:2px solid}[_nghost-%COMP%] .stage-options.hidden[_ngcontent-%COMP%]{visibility:hidden;opacity:0;transition:visibility .25s,opacity .25s}[_nghost-%COMP%] .stage-options.hidden[_ngcontent-%COMP%] mat-divider[_ngcontent-%COMP%]{visibility:hidden}"],changeDetection:0}),n})();function OFe(n,e){if(1&n){const t=Zi();R(0,"ccf-body-ui",16),ge("rotationChange",function(r){en(t),Qe();const s=vs(24);return s.rotation=r[0],s.rotationX=r[1]}),Kt(1,"async"),Kt(2,"async"),Kt(3,"async"),k()}if(2&n){const t=Qe();ie("scene",rn(1,5,t.scene.nodes$))("rotation",rn(2,7,t.scene.rotation$))("bounds",rn(3,9,t.bounds$))("zoom",11.5)("interactive",!0)}}function IFe(n,e){if(1&n){const t=Zi();R(0,"ccf-body-ui",17),ge("nodeDrag",function(r){return en(t),Qe().handleNodeDrag(r)}),Kt(1,"async"),Kt(2,"async"),k()}if(2&n){const t=Qe();ie("scene",rn(1,4,t.scene.rotatedNodes$))("interactive",!1)("bounds",rn(2,6,t.bounds$))("zoom",11.5)}}function PFe(n,e){1&n&&tt(0,"ccf-store-debug",18)}function RFe(n,e){if(1&n){const t=Zi();R(0,"div",19),R(1,"button",20),ge("click",function(){en(t);const r=Qe();return r.debugMode=!r.debugMode}),De(2,"State"),k(),R(3,"button",21),ge("click",function(){return en(t),Qe().registration.setUseRegistrationCallback(!0)}),De(4,"Use callback"),k(),R(5,"button",21),ge("click",function(){return en(t),Qe().registration.setUseRegistrationCallback(!1)}),De(6,"Use download"),k(),k()}}let kFe=(()=>{class n{constructor(t,i,r,s,o,a){this.model=t,this.page=i,this.registration=r,this.scene=s,this.rootRef=o,this.cdr=a,this.clsName="ccf-content",this.position$=this.model.position$.pipe(Ae(l=>({x:Math.floor(l.x),y:Math.floor(l.y),z:Math.floor(l.z)}))),this.is3DView$=this.model.viewType$.pipe(Ae(l=>"3d"===l)),this.bounds$=this.model.organDimensions$.pipe(Ae(l=>({x:Math.max(l.x,this.model.defaultPosition.x+40)/1e3,y:Math.max(l.y,this.model.defaultPosition.y+40)/1e3,z:Math.max(l.z,this.model.defaultPosition.z+40)/1e3})),Q9("x"),Q9("y")),this.isNarrowView=!1,this.debugMode=!1,this.showDebugButtons=!hu.production}ngOnInit(){this.sensor=new hW.ResizeSensor(this.rootRef.nativeElement,({width:t})=>{const i=t<440;this.isNarrowView!==i&&(this.isNarrowView=i,this.cdr.markForCheck())})}ngOnDestroy(){this.sensor.detach()}setViewType(t){this.model.setViewType(t?"3d":"register")}resetStage(){this.model.setPosition(this.model.defaultPosition),this.model.setViewSide("anterior"),this.model.setViewType("register")}handleNodeDrag(t){if("#DraftPlacement"===t.node["@id"]&&t.info.coordinate){const[i,r]=t.info.coordinate.map(d=>1e3*d),{position:s,viewSide:o,organDimensions:a}=this.model.snapshot,l=[a.x,a.y,a.z].map(d=>d/2);let c=s;switch(o){case"anterior":c={x:i+l[0],y:r+l[1],z:s.z};break;case"posterior":c={x:-i+l[0],y:r+l[1],z:s.z};break;case"left":c={x:s.x,y:r+l[1],z:-i+l[2]};break;case"right":c={x:s.x,y:r+l[1],z:i+l[2]}}this.model.setPosition(c)}}}return n.\u0275fac=function(t){return new(t||n)(E(ai),E(ji),E(Sr),E(as),E(rt),E(kn))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-content"]],hostVars:2,hostBindings:function(t,i){2&t&&Rn(i.clsName)},decls:29,vars:34,consts:[[1,"top-bar"],[3,"useDropdownMenu","view3D","side","view3DChange","sideChange"],["matRipple","","matRippleColor","rgba(204, 204, 204, 0.25)",1,"icon","reset",3,"matRippleCentered","matRippleUnbounded","click"],[1,"main-content"],["class","body-ui","camera","perspective",3,"scene","rotation","bounds","zoom","interactive","rotationChange",4,"ngIf"],["class","body-ui","camera","orthographic",3,"scene","interactive","bounds","zoom","nodeDrag",4,"ngIf"],[1,"gizmo-area"],[1,"position-display"],[1,"position"],[1,"x"],[1,"y"],[1,"z"],[1,"gizmo",3,"scene","rotation","interactive","zoom"],["gizmo",""],["class","debug",4,"ngIf"],["style","position: absolute; bottom: 1rem; display: flex; flex-direction: row; justify-content: space-between; width: 7rem;",4,"ngIf"],["camera","perspective",1,"body-ui",3,"scene","rotation","bounds","zoom","interactive","rotationChange"],["camera","orthographic",1,"body-ui",3,"scene","interactive","bounds","zoom","nodeDrag"],[1,"debug"],[2,"position","absolute","bottom","1rem","display","flex","flex-direction","row","justify-content","space-between","width","7rem"],[2,"width","3rem","font-size",".7rem",3,"click"],[3,"click"]],template:function(t,i){if(1&t&&(R(0,"div",0),R(1,"ccf-stage-nav",1),ge("view3DChange",function(s){return i.setViewType(s)})("sideChange",function(s){return i.model.setViewSide(s)}),Kt(2,"async"),Kt(3,"async"),k(),R(4,"mat-icon",2),ge("click",function(){return i.resetStage()}),De(5,"refresh"),k(),k(),R(6,"div",3),mt(7,OFe,4,11,"ccf-body-ui",4),Kt(8,"async"),mt(9,IFe,3,8,"ccf-body-ui",5),Kt(10,"async"),R(11,"div",6),R(12,"div",7),R(13,"div",8),R(14,"div",9),De(15),Kt(16,"async"),k(),R(17,"div",10),De(18),Kt(19,"async"),k(),R(20,"div",11),De(21),Kt(22,"async"),k(),k(),k(),tt(23,"ccf-body-ui",12,13),Kt(25,"async"),Kt(26,"async"),k(),k(),mt(27,PFe,1,0,"ccf-store-debug",14),mt(28,RFe,7,0,"div",15)),2&t){let r,s,o;G(1),ie("useDropdownMenu",i.isNarrowView)("view3D",rn(2,16,i.is3DView$))("side",rn(3,18,i.model.viewSide$)),G(3),ie("matRippleCentered",!0)("matRippleUnbounded",!0),G(3),ie("ngIf","3d"===rn(8,20,i.model.viewType$)),G(2),ie("ngIf","register"===rn(10,22,i.model.viewType$)),G(6),or("X: ",null==(r=rn(16,24,i.position$))?null:r.x,""),G(3),or("Y: ",null==(s=rn(19,26,i.position$))?null:s.y,""),G(3),or("Z: ",null==(o=rn(22,28,i.position$))?null:o.z,""),G(2),ie("scene",rn(25,30,i.scene.gizmo$))("rotation",rn(26,32,i.scene.rotation$))("interactive",!1)("zoom",9.5),G(4),ie("ngIf",i.showDebugButtons&&i.debugMode),G(1),ie("ngIf",i.showDebugButtons)}},directives:[DFe,rs,Js,zr,mPe,SPe],pipes:[Hc],styles:["[_nghost-%COMP%]{display:block;width:100%;height:100%;padding:1.5rem;overflow:hidden}[_nghost-%COMP%] .top-bar[_ngcontent-%COMP%]{display:flex;justify-content:space-between}[_nghost-%COMP%] .top-bar[_ngcontent-%COMP%] .reset[_ngcontent-%COMP%]{transform:scaleX(-1);cursor:pointer;transition:.6s}[_nghost-%COMP%] .main-content[_ngcontent-%COMP%]{display:flex;height:calc(100% - 1rem)}[_nghost-%COMP%] .main-content[_ngcontent-%COMP%] .body-ui[_ngcontent-%COMP%]{flex:auto;transition:opacity 1s}[_nghost-%COMP%] .main-content[_ngcontent-%COMP%] .gizmo-area[_ngcontent-%COMP%]{width:4rem;margin-top:1.5rem;margin-left:1.5rem;z-index:10}[_nghost-%COMP%] .main-content[_ngcontent-%COMP%] .gizmo-area[_ngcontent-%COMP%] .position-display[_ngcontent-%COMP%]{display:flex;justify-content:center;margin-bottom:1.5rem}[_nghost-%COMP%] .main-content[_ngcontent-%COMP%] .gizmo-area[_ngcontent-%COMP%] .gizmo[_ngcontent-%COMP%]{height:5.5rem}[_nghost-%COMP%] .main-content[_ngcontent-%COMP%] .gizmo-area[_ngcontent-%COMP%] .gizmo[_ngcontent-%COMP%] .hidden[_ngcontent-%COMP%]{opacity:0;z-index:0}[_nghost-%COMP%] .ccf-store-debug[_ngcontent-%COMP%]{color:#fff;position:absolute;top:.5rem;max-width:55rem}"],changeDetection:0}),n})();function FFe(n,e){if(1&n){const t=Zi();R(0,"div",11),ge("click",function(){en(t),Qe();const r=vs(15);return r.expanded=!r.expanded}),R(1,"mat-icon",12),De(2),k(),k()}if(2&n){Qe();const t=vs(15);G(2),or(" ",t.expanded?"arrow_drop_up":"arrow_drop_down"," ")}}function NFe(n,e){if(1&n){const t=Zi();R(0,"div",11),ge("click",function(){en(t);const r=Qe();return r.open=!r.open}),R(1,"mat-icon",13),De(2),k(),k()}if(2&n){const t=Qe();G(2),or(" ",t.open?"arrow_drop_up":"arrow_drop_down"," ")}}const LFe=function(n){return[n]};let BFe=(()=>{class n{constructor(t,i,r,s,o,a,l,c,d){this.model=t,this.page=i,this.consentService=r,this.snackbar=s,this.theming=o,this.globalConfig=c,this.organList=qF,this.open=!0,this.registrationStarted=!1,this.disablePositionChange=!1,this.theme$=this.globalConfig.getOption("theme"),this.themeMode$=new If(1),this.header$=this.globalConfig.getOption("header"),this.homeUrl$=this.globalConfig.getOption("homeUrl"),this.logoTooltip$=this.globalConfig.getOption("logoTooltip"),this.subscriptions=new Te,o.initialize(a,l),this.subscriptions.add(i.registrationCallbackSet$.subscribe(f=>{this.open=!f})),this.subscriptions.add(i.registrationStarted$.subscribe(f=>{this.registrationStarted=f})),this.theme$.subscribe(f=>{this.theme=f}),this.globalConfig.getOption("homeUrl").subscribe(f=>{this.homeUrl=f}),this.globalConfig.getOption("logoTooltip").subscribe(f=>{this.logoTooltip=f}),Qi([this.theme$,this.themeMode$]).subscribe(([f,p])=>{this.theming.setTheme(`${f}-theme-${p}`),d.markForCheck()})}get isLightTheme(){return this.theming.getTheme().endsWith("light")}ngOnInit(){const t=this.snackbar.openFromComponent(eRe,{data:{preClose:()=>{t.dismiss()}},duration:"not-set"===this.consentService.consent?1/0:3e3});this.themeMode$.next("light"),this.theming.setTheme(`${this.theme}-theme-light`)}toggleScheme(){this.themeMode$.next(this.isLightTheme?"dark":"light")}handleKey(t){const i=this.model.snapshot.position;if(this.disablePositionChange||!this.registrationStarted)return;t.preventDefault();const r=t.repeat?1:.5;let s=i;switch(t.key){case"q":s=Object.assign(Object.assign({},i),{z:i.z+r});break;case"e":s=Object.assign(Object.assign({},i),{z:i.z-r});break;case"w":s=Object.assign(Object.assign({},i),{y:i.y+r});break;case"s":s=Object.assign(Object.assign({},i),{y:i.y-r});break;case"a":s=Object.assign(Object.assign({},i),{x:i.x-r});break;case"d":s=Object.assign(Object.assign({},i),{x:i.x+r})}this.model.setPosition(s)}handleClick(t){this.disablePositionChange="INPUT"===t.nodeName}ngOnDestroy(){this.subscriptions.unsubscribe()}}return n.\u0275fac=function(t){return new(t||n)(E(ai),E(ji),E(f0),E(Xae),E(YF),E(rt),E(Nt),E(Ah),E(kn))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-root"]],hostBindings:function(t,i){1&t&&ge("keydown",function(s){return i.handleKey(s)},!1,sg)("click",function(s){return i.handleClick(s.target)},!1,sg)},decls:21,vars:35,consts:[[3,"logoTooltip","homeUrl"],["opened",""],[3,"modalClosed","disableSlider"],["position","end","opened",""],[3,"modalClosed"],[1,"selector-drawer"],[3,"organList","selectedOrgans","organsChanged"],["organSelector",""],[1,"close-button-wrapper"],["class","close-button",3,"click",4,"ngIf"],[1,"stage-content"],[1,"close-button",3,"click"],["aria-hidden","false","aria-label","Expand carousel drawer",1,"expand-collapse-icon"],["aria-hidden","false","aria-label","Close carousel drawer",1,"expand-collapse-icon"]],template:function(t,i){if(1&t&&(tt(0,"ccf-registration-modal"),tt(1,"ccf-header",0),Kt(2,"async"),Kt(3,"async"),Kt(4,"async"),R(5,"ccf-drawer-container"),R(6,"ccf-drawer",1),tt(7,"ccf-left-sidebar",2),tt(8,"ccf-drawer-toggle-button"),k(),R(9,"ccf-drawer",3),tt(10,"ccf-right-sidebar",4),tt(11,"ccf-drawer-toggle-button"),k(),R(12,"ccf-drawer-content"),R(13,"div",5),R(14,"ccf-organ-selector",6,7),ge("organsChanged",function(s){return i.model.setOrgan(s[0])}),Kt(16,"async"),k(),R(17,"div",8),mt(18,FFe,3,1,"div",9),mt(19,NFe,3,1,"div",9),k(),k(),tt(20,"ccf-content",10),k(),k()),2&t){const r=vs(15);G(1),st("header-hidden",!1===rn(2,25,i.header$)),ie("logoTooltip",rn(3,27,i.logoTooltip$))("homeUrl",rn(4,29,i.homeUrl$)),G(6),ie("modalClosed",i.registrationStarted)("disableSlider",!(null!=r.selectedOrgans[0]&&r.selectedOrgans[0].hasSex)),G(3),ie("modalClosed",i.registrationStarted),G(3),st("closed",!i.open)("expanded",r.expanded),G(1),st("closed",!i.open),ie("organList",i.organList)("selectedOrgans",Hg(33,LFe,rn(16,31,i.model.organ$))),G(3),st("closed",!i.open)("selector-expanded",r.expanded),G(1),ie("ngIf",i.open),G(1),ie("ngIf",!r.expanded),G(1),st("expanded-stage",!i.open)("retracted-stage",r.expanded)}},directives:[LRe,jRe,XRe,ZF,Kke,Zke,gFe,bx,p9,zr,kFe,rs],pipes:[Hc],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;height:100%;overflow:hidden;font-size:1rem;color:#000}[_nghost-%COMP%] .header-hidden[_ngcontent-%COMP%]{display:none}[_nghost-%COMP%] ccf-drawer-container[_ngcontent-%COMP%]{height:100%}[_nghost-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer[_ngcontent-%COMP%]{width:25.5rem}[_nghost-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%]{position:relative;z-index:1}[_nghost-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .selector-drawer[_ngcontent-%COMP%]{top:0rem;display:flex;flex-direction:column;position:relative;height:5.688rem;transition:all .5s ease-in-out}[_nghost-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .selector-drawer.expanded[_ngcontent-%COMP%]{height:15rem}[_nghost-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .selector-drawer[_ngcontent-%COMP%] ccf-organ-selector[_ngcontent-%COMP%]{height:100%;padding-top:.5rem;transition:all .5s}[_nghost-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .selector-drawer[_ngcontent-%COMP%] ccf-organ-selector.closed[_ngcontent-%COMP%]{padding-top:0}[_nghost-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .selector-drawer[_ngcontent-%COMP%] .close-button-wrapper[_ngcontent-%COMP%]{display:flex;justify-content:center;height:0;z-index:2}[_nghost-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .selector-drawer[_ngcontent-%COMP%] .close-button-wrapper[_ngcontent-%COMP%] .close-button[_ngcontent-%COMP%]{cursor:pointer;transition:.6s}[_nghost-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .selector-drawer[_ngcontent-%COMP%] .close-button-wrapper[_ngcontent-%COMP%] .close-button[_ngcontent-%COMP%] .expand-collapse-icon[_ngcontent-%COMP%]{width:3rem;height:1.2rem;display:flex;justify-content:center;align-items:center;cursor:pointer;background-color:#fff;border-bottom-left-radius:.2rem;border-bottom-right-radius:.2rem;transition:.6s}[_nghost-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .selector-drawer[_ngcontent-%COMP%] .close-button-wrapper[_ngcontent-%COMP%] .close-button[_ngcontent-%COMP%] .expand-collapse-icon[_ngcontent-%COMP%]:hover{background-color:#ececec}[_nghost-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .selector-drawer.closed[_ngcontent-%COMP%]{height:3rem;top:-2.9rem}[_nghost-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .stage-content[_ngcontent-%COMP%]{border-radius:.5rem!important;height:calc(100% - 2.688rem - 3rem - 1.5rem)}[_nghost-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .expanded-stage[_ngcontent-%COMP%]{height:calc(100% - 1.5rem);padding-bottom:1rem}[_nghost-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .retracted-stage[_ngcontent-%COMP%]{height:calc(100% - 2.688rem - 14rem)}[_nghost-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-content[_ngcontent-%COMP%]{position:absolute;transition-duration:.5s;transition-timing-function:ease-in-out;transition-property:all;bottom:1.5rem;z-index:1}"],changeDetection:0}),n})();function VFe(n,e){1&n&&tt(0,"ccf-root")}let zFe=(()=>{class n extends lRe{constructor(t,i){const r=cRe;super(t,i,{initialDelay:500,initialConfig:Object.assign(Object.assign(Object.assign({},hu.dbOptions),globalThis.ruiConfig),hu.customization),parse:{useDownload:r.boolean,user:r.json,organ:r.json,editRegistration:r.json,register:r.function,cancelRegistration:r.function,fetchPreviousRegistrations:r.function,skipUnsavedChangesConfirmation:r.boolean,header:r.boolean}})}}return n.\u0275fac=function(t){return new(t||n)(E(Ah),E(kn))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-root-wc"]],inputs:{baseHref:"baseHref",useDownload:"useDownload",user:"user",organ:"organ",editRegistration:"editRegistration",register:"register",cancelRegistration:"cancelRegistration",fetchPreviousRegistrations:"fetchPreviousRegistrations",skipUnsavedChangesConfirmation:"skipUnsavedChangesConfirmation",theme:"theme",header:"header",homeUrl:"homeUrl",logoTooltip:"logoTooltip"},features:[ct],decls:1,vars:1,consts:[[4,"ngIf"]],template:function(t,i){1&t&&mt(0,VFe,1,0,"ccf-root",0),2&t&&ie("ngIf",i.initialized)},directives:[zr,BFe],encapsulation:2,changeDetection:0}),n})();const jFe=new ve("Global configuration object");function UFe(n){return n.get("ruiConfig",{user:{firstName:"",lastName:""}})}let HFe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({providers:[{provide:jFe,useFactory:UFe,deps:[v9]}]}),n})(),$Fe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({providers:[{provide:bv,useValue:YF.initialize,multi:!0},YF]}),n})(),GFe=(()=>{class n{constructor(t,i){this.accessor=t,this.injector=i}static forRoot(t=[]){return{ngModule:n,providers:[Fr,Fa,UW,...t]}}}return n.\u0275fac=function(t){return new(t||n)(I(Fr,2),I(Fa,2))},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({}),n})();const Sx=(n,e)=>((n,e)=>new Array(e+1).join("0"))(0,e-n.toString().length)+n;class YFe{constructor(e,t,i){this.action=e,this.store=t,this.logWriter=i}dispatched(e){const t=pp(this.action),i=function(n){return Sx(n.getHours(),2)+":"+Sx(n.getMinutes(),2)+":"+Sx(n.getSeconds(),2)+"."+Sx(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 XFe{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 ve("NGXS_LOGGER_PLUGIN_OPTIONS");let KFe=(()=>{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 XFe(this._options),this._store=this._store||this._injector.get(cu);const s=new YFe(i,this._store,this._logWriter);return s.dispatched(t),r(t,i).pipe(Ti(o=>{s.completed(o)}),Ta(o=>{throw s.errored(o),o}))}}return n.\u0275fac=function(t){return new(t||n)(I(s7),I(Nt))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();const o7=new ve("LOGGER_USER_OPTIONS");function ZFe(n){return Object.assign({},{logger:console,collapsed:!1,disabled:!1,filter:()=>!0},n)}let QFe=(()=>{class n{static forRoot(t){return{ngModule:n,providers:[{provide:rk,useClass:KFe,multi:!0},{provide:o7,useValue:t},{provide:s7,useFactory:ZFe,deps:[o7]}]}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({}),n})();const JF=new ve("NGXS_STORAGE_PLUGIN_OPTION"),a7=new ve("STORAGE_ENGINE"),e2="@@STATE",l7="NGXS_OPTIONS_META";function e2e(n){return void 0!==n&&n.key&&(n.key=function(n){return Array.isArray(n)||(n=[n]),n.map(e=>(e.hasOwnProperty(l7)&&(e=e[l7].name),e instanceof class{constructor(e){this.name=e,uk(this).makeRootSelector=i=>i.getStateGetter(this.name)}getName(){return this.name}toString(){return`StateToken[${this.name}]`}}?e.getName():e))}(n.key)),Object.assign({key:[e2],storage:0,serialize:JSON.stringify,deserialize:JSON.parse,beforeSerialize:e=>e,afterDeserialize:e=>e},n)}function t2e(n,e){return kD(e)?null:0===n.storage?localStorage:1===n.storage?sessionStorage:null}let n2e=(()=>{class n{constructor(t,i,r){this._options=t,this._engine=i,this._platformId=r}handle(t,i,r){if(kD(this._platformId)&&null===this._engine)return r(t,i);const s=this._options.key,o=function(n){const e=pp(n);return function(t){return e===pp(t)}}(i),a=o(iG)||o(rG);let l=!1;if(a)for(const c of s){const d=c===e2;let f=this._engine.getItem(c);if("undefined"!==f&&null!=f){try{const p=this._options.deserialize(f);f=this._options.afterDeserialize(p,c)}catch(p){console.error("Error ocurred while deserializing the store value, falling back to empty object."),f={}}this._options.migrations&&this._options.migrations.forEach(p=>{p.version===Gm(f,p.versionKey||"version")&&(!p.key&&d||p.key===c)&&(f=p.migrate(f),l=!0)}),t=d?Object.assign({},t,f):ok(t,c,f)}}return r(t,i).pipe(Ti(c=>{if(!a||a&&l)for(const d of s){let f=c;d!==e2&&(f=Gm(c,d));try{const p=this._options.beforeSerialize(f,d);this._engine.setItem(d,this._options.serialize(p))}catch(p){console.error("Error ocurred while serializing the store value, value not updated.")}}}))}}return n.\u0275fac=function(t){return new(t||n)(I(JF),I(a7),I(dl))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();const c7=new ve("USER_OPTIONS");let i2e=(()=>{class n{static forRoot(t){return{ngModule:n,providers:[{provide:rk,useClass:n2e,multi:!0},{provide:c7,useValue:t},{provide:JF,useFactory:e2e,deps:[c7]},{provide:a7,useFactory:t2e,deps:[JF,dl]}]}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({}),n})();const u7=[{name:"bladder",namespace:"app",url:"assets/icons/organs/ico-organs-bladder.svg"},{name:"blood",namespace:"app",url:"assets/icons/organs/ico-organs-blood.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:"eye",namespace:"app",url:"assets/icons/organs/ico-organs-eye.svg"},{name:"fallopian-tube-left",namespace:"app",url:"assets/icons/organs/ico-organs-fallopian-tube-left.svg"},{name:"fallopian-tube-right",namespace:"app",url:"assets/icons/organs/ico-organs-fallopian-tube-right.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-right",namespace:"app",url:"assets/icons/organs/ico-organs-kidney-right.svg"},{name:"kidney",namespace:"app",url:"assets/icons/organs/ico-organs-kidney.svg"},{name:"knee",namespace:"app",url:"assets/icons/organs/ico-organs-knee.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-right",namespace:"app",url:"assets/icons/organs/ico-organs-lung-right.svg"},{name:"lung",namespace:"app",url:"assets/icons/organs/ico-organs-lung.svg"},{name:"lymph-nodes",namespace:"app",url:"assets/icons/organs/ico-organs-lymph-nodes.svg"},{name:"mammary-gland",namespace:"app",url:"assets/icons/organs/ico-organs-breast.svg"},{name:"neuron",namespace:"app",url:"assets/icons/organs/ico-organs-neuron.svg"},{name:"ovaries",namespace:"app",url:"assets/icons/organs/ico-organs-ovaries.svg"},{name:"ovary-left",namespace:"app",url:"assets/icons/organs/ico-organs-ovary-left.svg"},{name:"ovary-right",namespace:"app",url:"assets/icons/organs/ico-organs-ovary-right.svg"},{name:"pancreas",namespace:"app",url:"assets/icons/organs/ico-organs-pancreas.svg"},{name:"pelvis-f",namespace:"app",url:"assets/icons/organs/ico-organs-pelvis-f.svg"},{name:"placenta",namespace:"app",url:"assets/icons/organs/ico-organs-placenta.svg"},{name:"prostate",namespace:"app",url:"assets/icons/organs/ico-organs-prostate.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:"spinal-cord",namespace:"app",url:"assets/icons/organs/ico-organs-spinal-cord.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:"ureter-left",namespace:"app",url:"assets/icons/organs/ico-organs-ureter-left.svg"},{name:"ureter-right",namespace:"app",url:"assets/icons/organs/ico-organs-ureter-right.svg"},{name:"uterus",namespace:"app",url:"assets/icons/organs/ico-organs-uterus.svg"},{name:"vasculature-thick",namespace:"app",url:"assets/icons/organs/ico-organs-vasculature-thick.svg"},{name:"vasculature-thin",namespace:"app",url:"assets/icons/organs/ico-organs-vasculature-thin.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:"visibility_off_cube",namespace:"app",url:"assets/icons/ico-cube.svg"}];let hd=class extends cDe{constructor(e,t,i){super(),this.registry=e,this.sanitizer=t,this.globalConfig=i}ngxsOnInit(){var e;u7.filter(t=>void 0!==t.html).map(t=>Object.assign(Object.assign({},t),{html:this.sanitizer.bypassSecurityTrustHtml(t.html)})).forEach(t=>this.registerIconImpl(t)),null===(e=this.registry)||void 0===e||e.addSvgIconResolver((t,i)=>{var r;const s=u7.find(a=>{var l,c;return(null!==(l=a.name)&&void 0!==l?l:"")===t&&(null!==(c=a.namespace)&&void 0!==c?c:"")===i});if(void 0===s||void 0===s.url)return null;const o=null!==(r=this.globalConfig.snapshot.baseHref)&&void 0!==r?r:"";return this.sanitizer.bypassSecurityTrustResourceUrl(o+s.url)})}registerIcon(e){return this.registerIconImpl(e)}registerIconImpl(e){if(!this.registry||!e.url&&!e.html)return!1;const t=this.registry,r=t[this.getMethodName(e)],s=this.getArguments(e);if(!r)return!1;try{return r.apply(t,s),!0}catch(o){return!1}}getMethodName({name:e,namespace:t,url:i}){const r=["addSvgIcon"];return e||r.push("Set"),i||r.push("Literal"),t&&r.push("InNamespace"),r.join("")}getArguments({name:e,namespace:t,url:i,html:r}){return[t,e,null!=i?i:r].filter(o=>!!o)}};hd.\u0275fac=function(e){return new(e||hd)(I(Gv,8),I(th),I(Ah))},hd.\u0275prov=ue({token:hd,factory:hd.\u0275fac}),xe([on()],hd.prototype,"registerIcon",null),hd=xe([xh(),cd({name:"iconRegistry"})],hd);const r2e=[Ah,hd,ji,ai,ko,fc,Sr,as];let s2e=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[GFe.forRoot(),Io.forRoot(r2e,{developmentMode:!hu.production}),i2e.forRoot({key:["registration.registrations"]}),QFe.forRoot({disabled:hu.production})]]}),n})(),o2e=(()=>{class n{constructor(t){if(t)throw new Error("The core module should only be imported once in the root module")}}return n.\u0275fac=function(t){return new(t||n)(I(n,12))},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[Rj,kIe.forRoot({gaToken:hu.googleAnalyticsToken,appName:"rui"}),ZPe,HFe,s2e,$Fe]]}),n})(),t2=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,O9]]}),n})(),a2e=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,MFe,q9,lr,yx,t2,hc]]}),n})(),l2e=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,lr]]}),n})(),c2e=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,a2e,lr,MPe,l2e,_l,_Pe]]}),n})(),u2e=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,lr,hc]]}),n})(),d2e=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn]]}),n})(),h2e=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,q9]]}),n})(),d7=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,O9,Kb,Lk,Bk,hc]]}),n})(),f2e=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,lr,_l,m9]]}),n})(),h7=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,lr,j9]]}),n})(),p2e=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,ch]]}),n})(),g2e=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,Kk,lr,hc,yx,d2e,t2,d7,h7,h2e,m9,f2e,h7,p2e]]}),n})(),m2e=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,ch,hc,d7,t2,g9]]}),n})(),_2e=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,Qb,lr,m2e]]}),n})(),y2e=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,Kb,lr,_l,hc]]}),n})(),v2e=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,lr,_W,_l,hc]]}),n})(),b2e=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,Kb,lr,_l,hc,qPe]]}),n})(),C2e=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,j9,lr]]}),n})(),w2e=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,Lk,Bk,ch,h9,Uv,lr,Kb]]}),n})(),E2e=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,Qb,lr,ch]]}),n})(),S2e=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,E2e,ch,hc]]}),n})(),M2e=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,Kk,yx,lr,kO,hc,y2e,S2e,v2e,b2e,C2e,w2e,HPe]]}),n})(),x2e=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({providers:[{provide:P9,useValue:I9}],imports:[[yE,kO,lr]]}),n})(),T2e=(()=>{class n{constructor(t){this.injector=t}ngDoBootstrap(){const t=function(n,e){const t=function(n,e){return e.get(ll).resolveComponentFactory(n).inputs}(n,e.injector),i=e.strategyFactory||new Fne(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 Lne{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}(zFe,{injector:this.injector});customElements.define("ccf-rui",t)}}return n.\u0275fac=function(t){return new(t||n)(I(Nt))},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({providers:[{provide:T9,useValue:"hubmap-theme-light"},{provide:vj,useValue:{appearance:"standard",floatLabel:!1,hideRequiredMarker:!0}}],imports:[[yE,kO,o2e,lr,x2e,u2e,c2e,g2e,M2e,g9,_2e,tRe,_U]]}),n})();hu.production&&function(){if(i3)throw new Error("Cannot enable prod mode after platform setup.");n3=!1}(),rne().bootstrapModule(T2e).catch(n=>console.error(n))},948:gt=>{gt.exports=function(ze){return ze&&ze.__esModule?ze:{default:ze}},gt.exports.default=gt.exports,gt.exports.__esModule=!0},321:gt=>{function We(ze){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(gt.exports=We=function(L){return typeof L},gt.exports.default=gt.exports,gt.exports.__esModule=!0):(gt.exports=We=function(L){return L&&"function"==typeof Symbol&&L.constructor===Symbol&&L!==Symbol.prototype?"symbol":typeof L},gt.exports.default=gt.exports,gt.exports.__esModule=!0),We(ze)}gt.exports=We,gt.exports.default=gt.exports,gt.exports.__esModule=!0},833:gt=>{function We(ze){return Promise.resolve().then(()=>{var wt=new Error("Cannot find module '"+ze+"'");throw wt.code="MODULE_NOT_FOUND",wt})}We.keys=()=>[],We.resolve=We,We.id=833,gt.exports=We},521:()=>{},125:()=>{},307:()=>{}},gt=>{gt(gt.s=851)}]); \ No newline at end of file diff --git a/rui/wc.js b/rui/wc.js index 0239cb50d..82274acf4 100644 --- a/rui/wc.js +++ b/rui/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"))})},648:(G,ne,he)=>{"use strict";he(277),he(142),he(138)}},G=>{G(G.s=648)}]); /*! (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 A2e=Object.defineProperty,D2e=Object.defineProperties,O2e=Object.getOwnPropertyDescriptors,p7=Object.getOwnPropertySymbols,I2e=Object.prototype.hasOwnProperty,P2e=Object.prototype.propertyIsEnumerable,Ui=Math.pow,g7=(gt,We,ze)=>We in gt?A2e(gt,We,{enumerable:!0,configurable:!0,writable:!0,value:ze}):gt[We]=ze,K=(gt,We)=>{for(var ze in We||(We={}))I2e.call(We,ze)&&g7(gt,ze,We[ze]);if(p7)for(var ze of p7(We))P2e.call(We,ze)&&g7(gt,ze,We[ze]);return gt},Lt=(gt,We)=>D2e(gt,O2e(We));(self.webpackChunkccf_ui=self.webpackChunkccf_ui||[]).push([[179],{2:gt=>{"use strict";gt.exports=ze,gt.exports.default=ze;var We=1e20;function ze(Ke,ft,Ze,Tt,Ft,we){this.fontSize=Ke||24,this.buffer=void 0===ft?3:ft,this.cutoff=Tt||.25,this.fontFamily=Ft||"sans-serif",this.fontWeight=we||"normal",this.radius=Ze||8;var _e=this.size=this.fontSize+2*this.buffer,ke=_e+2*this.buffer;this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=_e,this.ctx=this.canvas.getContext("2d"),this.ctx.font=this.fontWeight+" "+this.fontSize+"px "+this.fontFamily,this.ctx.textAlign="left",this.ctx.fillStyle="black",this.gridOuter=new Float64Array(ke*ke),this.gridInner=new Float64Array(ke*ke),this.f=new Float64Array(ke),this.z=new Float64Array(ke+1),this.v=new Uint16Array(ke),this.useMetrics=void 0!==this.ctx.measureText("A").actualBoundingBoxLeft,this.middle=Math.round(_e/2*(navigator.userAgent.indexOf("Gecko/")>=0?1.2:1))}function It(Ke,ft,Ze,Tt,Ft,we){for(var _e=0;_e-1);we[++ye]=ke,_e[ye]=Te,_e[ye+1]=We}for(ke=0,ye=0;ke{"use strict";var wt=(()=>{return(It=wt||(wt={})).typeOfFunction="function",It.boolTrue=!0,wt;var It})();function L(It,Pt,Ke){if(!Ke||typeof Ke.value!==wt.typeOfFunction)throw new TypeError("Only methods can be decorated with @bind. <"+Pt+"> is not a method!");return{configurable:wt.boolTrue,get:function(){var ft=Ke.value.bind(this);return Object.defineProperty(this,Pt,{value:ft,configurable:wt.boolTrue,writable:wt.boolTrue}),ft}}}We.ak=L,We.ZP=L},266:(gt,We,ze)=>{gt.exports={ResizeSensor:ze(835),ElementQueries:ze(845)}},845:function(gt,We,ze){"use strict";var wt,L,It;"undefined"!=typeof window&&window,L=[ze(835)],void 0!==(It="function"==typeof(wt=function(Pt){var Ke=function(){var Ze,Tt={},Ft=[];function we(Ve){Ve||(Ve=document.documentElement);var ce=window.getComputedStyle(Ve,null).fontSize;return parseFloat(ce)||16}function ke(Ve,ce){var zt=ce.split(/\d/),Gt=zt[zt.length-1];switch(ce=parseFloat(ce),Gt){case"px":return ce;case"em":return ce*we(Ve);case"rem":return ce*we();case"vw":return ce*document.documentElement.clientWidth/100;case"vh":return ce*document.documentElement.clientHeight/100;case"vmin":case"vmax":var Qt=document.documentElement.clientWidth/100,li=document.documentElement.clientHeight/100;return ce*(0,Math["vmin"===Gt?"min":"max"])(Qt,li);default:return ce}}function ye(Ve,ce){this.element=Ve;var zt,Gt,Qt,li,Pi,Se,pn,Gn,Ae=["min-width","min-height","max-width","max-height"];this.call=function(){for(zt in Qt=function(Ve){if(!Ve.getBoundingClientRect)return{width:Ve.offsetWidth,height:Ve.offsetHeight};var ce=Ve.getBoundingClientRect();return{width:Math.round(ce.width),height:Math.round(ce.height)}}(this.element),Se={},Tt[ce])!Tt[ce].hasOwnProperty(zt)||(li=ke(this.element,(Gt=Tt[ce][zt]).value),Pi="width"===Gt.property?Qt.width:Qt.height,pn="","min"===Gt.mode&&Pi>=li&&(pn+=Gt.value),"max"===Gt.mode&&Pi<=li&&(pn+=Gt.value),Se[Gn=Gt.mode+"-"+Gt.property]||(Se[Gn]=""),pn&&-1===(" "+Se[Gn]+" ").indexOf(" "+pn+" ")&&(Se[Gn]+=" "+pn));for(var Ri in Ae)!Ae.hasOwnProperty(Ri)||(Se[Ae[Ri]]?this.element.setAttribute(Ae[Ri],Se[Ae[Ri]].substr(1)):this.element.removeAttribute(Ae[Ri]))}}function Te(Ve,ce){Ve.elementQueriesSetupInformation||(Ve.elementQueriesSetupInformation=new ye(Ve,ce)),Ve.elementQueriesSensor||(Ve.elementQueriesSensor=new Pt(Ve,function(){Ve.elementQueriesSetupInformation.call()}))}function Vt(Ve,ce,zt,Gt){if(void 0===Tt[Ve]){Tt[Ve]=[];var Qt=Ft.length;Ze.innerHTML+="\n"+Ve+" {animation: 0.1s element-queries;}",Ze.innerHTML+="\n"+Ve+" > .resize-sensor {min-width: "+Qt+"px;}",Ft.push(Ve)}Tt[Ve].push({mode:ce,property:zt,value:Gt})}function He(Ve){var ce;if(document.querySelectorAll&&(ce=Ve?Ve.querySelectorAll.bind(Ve):document.querySelectorAll.bind(document)),!ce&&"undefined"!=typeof $$&&(ce=$$),!ce&&"undefined"!=typeof jQuery&&(ce=jQuery),!ce)throw"No document.querySelectorAll, jQuery or Mootools's $$ found.";return ce}function xt(Ve){var ce=[],zt=[],Gt=[],Qt=0,li=-1,Pi=[];for(var Se in Ve.children)if(Ve.children.hasOwnProperty(Se)&&Ve.children[Se].tagName&&"img"===Ve.children[Se].tagName.toLowerCase()){ce.push(Ve.children[Se]);var pn=Ve.children[Se].getAttribute("min-width")||Ve.children[Se].getAttribute("data-min-width"),Gn=Ve.children[Se].getAttribute("data-src")||Ve.children[Se].getAttribute("url");Gt.push(Gn),zt.push({minWidth:pn}),pn?Ve.children[Se].style.display="none":(Qt=ce.length-1,Ve.children[Se].style.display="block")}function Ri(){var xr,jt=!1;for(xr in ce)!ce.hasOwnProperty(xr)||zt[xr].minWidth&&Ve.offsetWidth>zt[xr].minWidth&&(jt=xr);if(jt||(jt=Qt),li!==jt)if(Pi[jt])ce[li].style.display="none",ce[jt].style.display="block",li=jt;else{var ls=new Image;ls.onload=function(){ce[jt].src=Gt[jt],ce[li].style.display="none",ce[jt].style.display="block",Pi[jt]=!0,li=jt},ls.src=Gt[jt]}else ce[jt].src=Gt[jt]}li=Qt,Ve.resizeSensorInstance=new Pt(Ve,Ri),Ri()}var Yn=/,?[\s\t]*([^,\n]*?)((?:\[[\s\t]*?(?:min|max)-(?:width|height)[\s\t]*?[~$\^]?=[\s\t]*?"[^"]*?"[\s\t]*?])+)([^,\n\s\{]*)/gim,Ei=/\[[\s\t]*?(min|max)-(width|height)[\s\t]*?[~$\^]?=[\s\t]*?"([^"]*?)"[\s\t]*?]/gim;function vi(Ve){var ce,zt,Gt,Qt;for(Ve=Ve.replace(/'/g,'"');null!==(ce=Yn.exec(Ve));)for(zt=ce[1]+ce[3],Gt=ce[2];null!==(Qt=Ei.exec(Gt));)Vt(zt,Qt[1],Qt[2],Qt[3])}function bi(Ve){var ce="";if(Ve)if("string"==typeof Ve)(-1!==(Ve=Ve.toLowerCase()).indexOf("min-width")||-1!==Ve.indexOf("max-width"))&&vi(Ve);else for(var zt=0,Gt=Ve.length;zt img, [data-responsive-image] {overflow: hidden; padding: 0; } [responsive-image] > img, [data-responsive-image] > img {width: 100%;}",Ze.innerHTML+="\n@keyframes element-queries { 0% { visibility: inherit; } }",document.getElementsByTagName("head")[0].appendChild(Ze),Mr=!0);for(var ce=0,zt=document.styleSheets.length;ce=_e.status}function ft(we){try{we.dispatchEvent(new MouseEvent("click"))}catch(ke){var _e=document.createEvent("MouseEvents");_e.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),we.dispatchEvent(_e)}}var Ze="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:"object"==typeof global&&global.global===global?global:void 0,Tt=Ze.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),Ft=Ze.saveAs||("object"!=typeof window||window!==Ze?function(){}:"download"in HTMLAnchorElement.prototype&&!Tt?function(we,_e,ke){var ye=Ze.URL||Ze.webkitURL,Te=document.createElement("a");Te.download=_e=_e||we.name||"download",Te.rel="noopener","string"==typeof we?(Te.href=we,Te.origin===location.origin?ft(Te):Ke(Te.href)?Pt(we,_e,ke):ft(Te,Te.target="_blank")):(Te.href=ye.createObjectURL(we),setTimeout(function(){ye.revokeObjectURL(Te.href)},4e4),setTimeout(function(){ft(Te)},0))}:"msSaveOrOpenBlob"in navigator?function(we,_e,ke){if(_e=_e||we.name||"download","string"!=typeof we)navigator.msSaveOrOpenBlob(function(we,_e){return void 0===_e?_e={autoBom:!1}:"object"!=typeof _e&&(console.warn("Deprecated: Expected third argument to be a object"),_e={autoBom:!_e}),_e.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(we.type)?new Blob(["\ufeff",we],{type:we.type}):we}(we,ke),_e);else if(Ke(we))Pt(we,_e,ke);else{var ye=document.createElement("a");ye.href=we,ye.target="_blank",setTimeout(function(){ft(ye)})}}:function(we,_e,ke,ye){if((ye=ye||open("","_blank"))&&(ye.document.title=ye.document.body.innerText="downloading..."),"string"==typeof we)return Pt(we,_e,ke);var Te="application/octet-stream"===we.type,Vt=/constructor/i.test(Ze.HTMLElement)||Ze.safari,He=/CriOS\/[\d]+/.test(navigator.userAgent);if((He||Te&&Vt||Tt)&&"undefined"!=typeof FileReader){var An=new FileReader;An.onloadend=function(){var Yn=An.result;Yn=He?Yn:Yn.replace(/^data:[^;]*;/,"data:attachment/file;"),ye?ye.location.href=Yn:location=Yn,ye=null},An.readAsDataURL(we)}else{var xt=Ze.URL||Ze.webkitURL,tn=xt.createObjectURL(we);ye?ye.location=tn:location.href=tn,ye=null,setTimeout(function(){xt.revokeObjectURL(tn)},4e4)}});Ze.saveAs=Ft.saveAs=Ft,gt.exports=Ft})?ze.apply(We,[]):ze)&&(gt.exports=L)},524:(gt,We,ze)=>{var wt;!function(L,It,Pt,Ke){"use strict";var He,ft=["","webkit","Moz","MS","ms","o"],Ze=It.createElement("div"),Ft=Math.round,we=Math.abs,_e=Date.now;function ke(A,F,j){return setTimeout(Yn(A,j),F)}function ye(A,F,j){return!!Array.isArray(A)&&(Te(A,j[F],j),!0)}function Te(A,F,j){var re;if(A)if(A.forEach)A.forEach(F,j);else if(A.length!==Ke)for(re=0;re\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",vn=L.console&&(L.console.warn||L.console.log);return vn&&vn.call(L.console,re,Ue),A.apply(this,arguments)}}He="function"!=typeof Object.assign?function(F){if(F===Ke||null===F)throw new TypeError("Cannot convert undefined or null to object");for(var j=Object(F),re=1;re-1}function zt(A){return A.trim().split(/\s+/g)}function Gt(A,F,j){if(A.indexOf&&!j)return A.indexOf(F);for(var re=0;reWr[F]}):re.sort()),re}function Pi(A,F){for(var j,re,Fe=F[0].toUpperCase()+F.slice(1),Ue=0;Ue1&&!j.firstMultiple?j.firstMultiple=Va(F):1===Fe&&(j.firstMultiple=!1);var Ue=j.firstInput,vn=j.firstMultiple,dr=vn?vn.center:Ue.center,yr=F.center=uo(re);F.timeStamp=_e(),F.deltaTime=F.timeStamp-Ue.timeStamp,F.angle=ho(dr,yr),F.distance=us(dr,yr),function(A,F){var j=F.center,re=A.offsetDelta||{},Fe=A.prevDelta||{},Ue=A.prevInput||{};(1===F.eventType||4===Ue.eventType)&&(Fe=A.prevDelta={x:Ue.deltaX||0,y:Ue.deltaY||0},re=A.offsetDelta={x:j.x,y:j.y}),F.deltaX=Fe.x+(j.x-re.x),F.deltaY=Fe.y+(j.y-re.y)}(j,F),F.offsetDirection=Ni(F.deltaX,F.deltaY);var Wr=za(F.deltaTime,F.deltaX,F.deltaY);F.overallVelocityX=Wr.x,F.overallVelocityY=Wr.y,F.overallVelocity=we(Wr.x)>we(Wr.y)?Wr.x:Wr.y,F.scale=vn?function(A,F){return us(F[0],F[1],Nr)/us(A[0],A[1],Nr)}(vn.pointers,re):1,F.rotation=vn?function(A,F){return ho(F[1],F[0],Nr)+ho(A[1],A[0],Nr)}(vn.pointers,re):0,F.maxPointers=j.prevInput?F.pointers.length>j.prevInput.maxPointers?F.pointers.length:j.prevInput.maxPointers:F.pointers.length,function(A,F){var Fe,Ue,vn,dr,j=A.lastInterval||F,re=F.timeStamp-j.timeStamp;if(8!=F.eventType&&(re>25||j.velocity===Ke)){var yr=F.deltaX-j.deltaX,Wr=F.deltaY-j.deltaY,cn=za(re,yr,Wr);Ue=cn.x,vn=cn.y,Fe=we(cn.x)>we(cn.y)?cn.x:cn.y,dr=Ni(yr,Wr),A.lastInterval=F}else Fe=j.velocity,Ue=j.velocityX,vn=j.velocityY,dr=j.direction;F.velocity=Fe,F.velocityX=Ue,F.velocityY=vn,F.direction=dr}(j,F);var cn=A.element;Ve(F.srcEvent.target,cn)&&(cn=F.srcEvent.target),F.target=cn}(A,j),A.emit("hammer.input",j),A.recognize(j),A.session.prevInput=j}function Va(A){for(var F=[],j=0;j=we(F)?A<0?2:4:F<0?8:16}function us(A,F,j){j||(j=Gr);var re=F[j[0]]-A[j[0]],Fe=F[j[1]]-A[j[1]];return Math.sqrt(re*re+Fe*Fe)}function ho(A,F,j){return j||(j=Gr),180*Math.atan2(F[j[1]]-A[j[1]],F[j[0]]-A[j[0]])/Math.PI}ii.prototype={handler:function(){},init:function(){this.evEl&&bi(this.element,this.evEl,this.domHandler),this.evTarget&&bi(this.target,this.evTarget,this.domHandler),this.evWin&&bi(Gn(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&Mr(this.element,this.evEl,this.domHandler),this.evTarget&&Mr(this.target,this.evTarget,this.domHandler),this.evWin&&Mr(Gn(this.element),this.evWin,this.domHandler)}};var fu={mousedown:1,mousemove:2,mouseup:4},pu="mousedown",gu="mousemove mouseup";function Ml(){this.evEl=pu,this.evWin=gu,this.pressed=!1,ii.apply(this,arguments)}tn(Ml,ii,{handler:function(F){var j=fu[F.type];1&j&&0===F.button&&(this.pressed=!0),2&j&&1!==F.which&&(j=4),this.pressed&&(4&j&&(this.pressed=!1),this.callback(this.manager,j,{pointers:[F],changedPointers:[F],pointerType:cs,srcEvent:F}))}});var mc={pointerdown:1,pointermove:2,pointerup:4,pointercancel:8,pointerout:8},pd={2:ls,3:"pen",4:cs,5:"kinect"},mu="pointerdown",Vs="pointermove pointerup pointercancel";function Je(){this.evEl=mu,this.evWin=Vs,ii.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}L.MSPointerEvent&&!L.PointerEvent&&(mu="MSPointerDown",Vs="MSPointerMove MSPointerUp MSPointerCancel"),tn(Je,ii,{handler:function(F){var j=this.store,re=!1,Fe=F.type.toLowerCase().replace("ms",""),Ue=mc[Fe],vn=pd[F.pointerType]||F.pointerType,dr=vn==ls,yr=Gt(j,F.pointerId,"pointerId");1&Ue&&(0===F.button||dr)?yr<0&&(j.push(F),yr=j.length-1):12&Ue&&(re=!0),!(yr<0)&&(j[yr]=F,this.callback(this.manager,Ue,{pointers:j,changedPointers:[F],pointerType:vn,srcEvent:F}),re&&j.splice(yr,1))}});var _u={touchstart:1,touchmove:2,touchend:4,touchcancel:8},W="touchstart",Y="touchstart touchmove touchend touchcancel";function J(){this.evTarget=W,this.evWin=Y,this.started=!1,ii.apply(this,arguments)}function T(A,F){var j=Qt(A.touches),re=Qt(A.changedTouches);return 12&F&&(j=li(j.concat(re),"identifier",!0)),[j,re]}tn(J,ii,{handler:function(F){var j=_u[F.type];if(1===j&&(this.started=!0),this.started){var re=T.call(this,F,j);12&j&&re[0].length-re[1].length==0&&(this.started=!1),this.callback(this.manager,j,{pointers:re[0],changedPointers:re[1],pointerType:ls,srcEvent:F})}}});var D={touchstart:1,touchmove:2,touchend:4,touchcancel:8},B="touchstart touchmove touchend touchcancel";function Z(){this.evTarget=B,this.targetIds={},ii.apply(this,arguments)}function $(A,F){var j=Qt(A.touches),re=this.targetIds;if(3&F&&1===j.length)return re[j[0].identifier]=!0,[j,j];var Fe,Ue,vn=Qt(A.changedTouches),dr=[],yr=this.target;if(Ue=j.filter(function(Wr){return Ve(Wr.target,yr)}),1===F)for(Fe=0;Fe-1&&re.splice(Ue,1)},2500)}}function xn(A){for(var F=A.srcEvent.clientX,j=A.srcEvent.clientY,re=0;re-1&&this.requireFail.splice(F,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(A){return!!this.simultaneous[A.id]},emit:function(A){var F=this,j=this.state;function re(Fe){F.manager.emit(Fe,A)}j<8&&re(F.options.event+ue(j)),re(F.options.event),A.additionalEvent&&re(A.additionalEvent),j>=8&&re(F.options.event+ue(j))},tryEmit:function(A){if(this.canEmit())return this.emit(A);this.state=32},canEmit:function(){for(var A=0;AF.threshold&&Fe&F.direction},attrTest:function(A){return rr.prototype.attrTest.call(this,A)&&(2&this.state||!(2&this.state)&&this.directionTest(A))},emit:function(A){this.pX=A.deltaX,this.pY=A.deltaY;var F=u_(A.direction);F&&(A.additionalEvent=this.options.event+F),this._super.emit.call(this,A)}}),tn(bu,rr,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[$i]},attrTest:function(A){return this._super.attrTest.call(this,A)&&(Math.abs(A.scale-1)>this.options.threshold||2&this.state)},emit:function(A){1!==A.scale&&(A.additionalEvent=this.options.event+(A.scale<1?"in":"out")),this._super.emit.call(this,A)}}),tn(Ih,ja,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return["auto"]},process:function(A){var F=this.options,j=A.pointers.length===F.pointers,re=A.distanceF.time;if(this._input=A,!re||!j||12&A.eventType&&!Fe)this.reset();else if(1&A.eventType)this.reset(),this._timer=ke(function(){this.state=8,this.tryEmit()},F.time,this);else if(4&A.eventType)return 8;return 32},reset:function(){clearTimeout(this._timer)},emit:function(A){8===this.state&&(A&&4&A.eventType?this.manager.emit(this.options.event+"up",A):(this._input.timeStamp=_e(),this.manager.emit(this.options.event,this._input)))}}),tn(Cu,rr,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[$i]},attrTest:function(A){return this._super.attrTest.call(this,A)&&(Math.abs(A.rotation)>this.options.threshold||2&this.state)}}),tn(ua,rr,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:30,pointers:1},getTouchAction:function(){return vc.prototype.getTouchAction.call(this)},attrTest:function(A){var j,F=this.options.direction;return 30&F?j=A.overallVelocity:6&F?j=A.overallVelocityX:24&F&&(j=A.overallVelocityY),this._super.attrTest.call(this,A)&&F&A.offsetDirection&&A.distance>this.options.threshold&&A.maxPointers==this.options.pointers&&we(j)>this.options.velocity&&4&A.eventType},emit:function(A){var F=u_(A.offsetDirection);F&&this.manager.emit(this.options.event+F,A),this.manager.emit(this.options.event,A)}}),tn(Tl,ja,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Hi]},process:function(A){var F=this.options,j=A.pointers.length===F.pointers,re=A.distance"']/g,Vs=RegExp(pd.source),Je=RegExp(mu.source),_u=/<%-([\s\S]+?)%>/g,W=/<%([\s\S]+?)%>/g,Y=/<%=([\s\S]+?)%>/g,J=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,T=/^\w*$/,D=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,B=/[\\^$.*+?()[\]{}|]/g,Z=RegExp(B.source),$=/^\s+/,le=/\s/,he=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,pe=/\{\n\/\* \[wrapped with (.+)\] \*/,Ge=/,? & /,an=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,xn=/[()=,{}\[\]\/\s]/,qt=/\\(\\)?/g,Et=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ln=/\w*$/,ri=/^[-+]0x[0-9a-f]+$/i,Hi=/^0b[01]+$/i,$i=/^\[object .+?Constructor\]$/,_n=/^0o[0-7]+$/i,Ci=/^(?:0|[1-9]\d*)$/,_c=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,fo=/($^)/,gd=/['\n\r\u2028\u2029\\]/g,xl="\\ud800-\\udfff",Gi="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Pn="\\u2700-\\u27bf",vu="a-z\\xdf-\\xf6\\xf8-\\xff",Me="A-Z\\xc0-\\xd6\\xd8-\\xde",rr="\\ufe0e\\ufe0f",vc="\\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",Ih="["+xl+"]",Cu="["+vc+"]",ua="["+Gi+"]",Tl="\\d+",Ua="["+Pn+"]",Sp="["+vu+"]",At="[^"+xl+vc+Tl+Pn+vu+Me+"]",Al="\\ud83c[\\udffb-\\udfff]",da="[^"+xl+"]",md="(?:\\ud83c[\\udde6-\\uddff]){2}",A="[\\ud800-\\udbff][\\udc00-\\udfff]",F="["+Me+"]",j="\\u200d",re="(?:"+Sp+"|"+At+")",Fe="(?:"+F+"|"+At+")",Ue="(?:['\u2019](?:d|ll|m|re|s|t|ve))?",vn="(?:['\u2019](?:D|LL|M|RE|S|T|VE))?",dr="(?:"+ua+"|"+Al+")?",yr="["+rr+"]?",Mx=yr+dr+"(?:"+j+"(?:"+[da,md,A].join("|")+")"+yr+dr+")*",_d="(?:"+[Ua,md,A].join("|")+")"+Mx,mi="(?:"+[da+ua+"?",ua,md,A,Ih].join("|")+")",xp=RegExp("['\u2019]","g"),d_=RegExp(ua,"g"),Ph=RegExp(Al+"(?="+Al+")|"+mi+Mx,"g"),b0=RegExp([F+"?"+Sp+"+"+Ue+"(?="+[Cu,F,"$"].join("|")+")",Fe+"+"+vn+"(?="+[Cu,F+re,"$"].join("|")+")",F+"?"+re+"+"+Ue,F+"+"+vn,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Tl,_d].join("|"),"g"),xx=RegExp("["+j+xl+Gi+rr+"]"),Dl=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Rh=["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"],Tx=-1,Ne={};Ne[uo]=Ne[za]=Ne[Ni]=Ne[us]=Ne[ho]=Ne[gc]=Ne[Sl]=Ne[fu]=Ne[pu]=!0,Ne[cs]=Ne[aa]=Ne[El]=Ne[ci]=Ne[Va]=Ne[pt]=Ne[ki]=Ne[la]=Ne[Fi]=Ne[$r]=Ne[ir]=Ne[Gr]=Ne[Nr]=Ne[ii]=Ne[di]=!1;var Si={};Si[cs]=Si[aa]=Si[El]=Si[Va]=Si[ci]=Si[pt]=Si[uo]=Si[za]=Si[Ni]=Si[us]=Si[ho]=Si[Fi]=Si[$r]=Si[ir]=Si[Gr]=Si[Nr]=Si[ii]=Si[pc]=Si[gc]=Si[Sl]=Si[fu]=Si[pu]=!0,Si[ki]=Si[la]=Si[di]=!1;var Pe={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Ax=parseFloat,S0=parseInt,oe="object"==typeof global&&global&&global.Object===Object&&global,ds="object"==typeof self&&self&&self.Object===Object&&self,Kn=oe||ds||Function("return this")(),Ol=We&&!We.nodeType&&We,ha=Ol&>&&!gt.nodeType&>,po=ha&&ha.exports===Ol,h_=po&&oe.process,Wi=function(){try{return ha&&ha.require&&ha.require("util").types||h_&&h_.binding&&h_.binding("util")}catch(fe){}}(),it=Wi&&Wi.isArrayBuffer,bn=Wi&&Wi.isDate,Oi=Wi&&Wi.isMap,js=Wi&&Wi.isRegExp,bc=Wi&&Wi.isSet,Tr=Wi&&Wi.isTypedArray;function Ar(q,fe,se){switch(se.length){case 0:return q.call(fe);case 1:return q.call(fe,se[0]);case 2:return q.call(fe,se[0],se[1]);case 3:return q.call(fe,se[0],se[1],se[2])}return q.apply(fe,se)}function hr(q,fe,se,lt){for(var Rt=-1,Wn=null==q?0:q.length;++Rt-1}function kh(q,fe,se){for(var lt=-1,Rt=null==q?0:q.length;++lt-1;);return se}function Px(q,fe){for(var se=q.length;se--&&Ha(fe,q[se],0)>-1;);return se}function r2(q,fe){for(var se=q.length,lt=0;se--;)q[se]===fe&&++lt;return lt}var s2=Fo({\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"}),o2=Fo({"&":"&","<":"<",">":">",'"':""","'":"'"});function a2(q){return"\\"+Pe[q]}function Lh(q){return xx.test(q)}function x0(q){var fe=-1,se=Array(q.size);return q.forEach(function(lt,Rt){se[++fe]=[Rt,lt]}),se}function Rx(q,fe){return function(se){return q(fe(se))}}function Eu(q,fe){for(var se=-1,lt=q.length,Rt=0,Wn=[];++se",""":'"',"'":"'"}),Vh=function q(fe){var u,se=(fe=null==fe?Kn:Vh.defaults(Kn.Object(),fe,Vh.pick(Kn,Rh))).Array,lt=fe.Date,Rt=fe.Error,Wn=fe.Function,vr=fe.Math,fi=fe.Object,v_=fe.RegExp,b_=fe.String,ga=fe.TypeError,Ii=se.prototype,Su=fi.prototype,Ap=fe["__core-js_shared__"],qi=Wn.prototype.toString,pi=Su.hasOwnProperty,f2=0,zh=(u=/[^.]+$/.exec(Ap&&Ap.keys&&Ap.keys.IE_PROTO||""))?"Symbol(src)_1."+u:"",Ts=Su.toString,Nx=qi.call(fi),C_=Kn._,Ed=v_("^"+qi.call(pi).replace(B,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),fs=po?fe.Buffer:L,Pl=fe.Symbol,Sd=fe.Uint8Array,D0=fs?fs.allocUnsafe:L,ma=Rx(fi.getPrototypeOf,fi),w_=fi.create,Dp=Su.propertyIsEnumerable,Yt=Ii.splice,Lx=Pl?Pl.isConcatSpreadable:L,jh=Pl?Pl.iterator:L,Mu=Pl?Pl.toStringTag:L,Op=function(){try{var u=Pc(fi,"defineProperty");return u({},"",{}),u}catch(h){}}(),O0=fe.clearTimeout!==Kn.clearTimeout&&fe.clearTimeout,Bx=lt&<.now!==Kn.Date.now&<.now,Vx=fe.setTimeout!==Kn.setTimeout&&fe.setTimeout,Oe=vr.ceil,Dn=vr.floor,en=fi.getOwnPropertySymbols,Dr=fs?fs.isBuffer:L,E_=fe.isFinite,Uh=Ii.join,Ga=Rx(fi.keys,fi),pr=vr.max,Lr=vr.min,p2=lt.now,zx=fe.parseInt,Hh=vr.random,Ip=Ii.reverse,Yr=Pc(fe,"DataView"),Us=Pc(fe,"Map"),Pp=Pc(fe,"Promise"),_a=Pc(fe,"Set"),mo=Pc(fe,"WeakMap"),$h=Pc(fi,"create"),Gh=mo&&new mo,Md={},jx=Lu(Yr),S_=Lu(Us),M_=Lu(Pp),I0=Lu(_a),x_=Lu(mo),Rp=Pl?Pl.prototype:L,xd=Rp?Rp.valueOf:L,Wh=Rp?Rp.toString:L;function O(u){if(Ki(u)&&!Bt(u)&&!(u instanceof Cn)){if(u instanceof _o)return u;if(pi.call(u,"__wrapped__"))return Ud(u)}return new _o(u)}var xu=function(){function u(){}return function(h){if(!Xi(h))return{};if(w_)return w_(h);u.prototype=h;var m=new u;return u.prototype=L,m}}();function qh(){}function _o(u,h){this.__wrapped__=u,this.__actions__=[],this.__chain__=!!h,this.__index__=0,this.__values__=L}function Cn(u){this.__wrapped__=u,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=jt,this.__views__=[]}function Hs(u){var h=-1,m=null==u?0:u.length;for(this.clear();++h=h?u:h)),u}function ps(u,h,m,b,M,P){var z,H=1&h,X=2&h,be=4&h;if(m&&(z=M?m(u,b,M,P):m(u)),z!==L)return z;if(!Xi(u))return u;var Ce=Bt(u);if(Ce){if(z=function(u){var h=u.length,m=new u.constructor(h);return h&&"string"==typeof u[0]&&pi.call(u,"index")&&(m.index=u.index,m.input=u.input),m}(u),!H)return Ds(u,z)}else{var Re=ms(u),et=Re==la||Re==La;if(nl(u))return Wp(u,H);if(Re==ir||Re==cs||et&&!M){if(z=X||et?{}:rC(u),!H)return X?function(u,h){return Ca(u,tC(u),h)}(u,function(u,h){return u&&Ca(h,Is(h),u)}(z,u)):function(u,h){return Ca(u,Y_(u),h)}(u,Zx(z,u))}else{if(!Si[Re])return M?u:{};z=function(u,h,m){var b=u.constructor;switch(h){case El:return Ru(u);case ci:case pt:return new b(+u);case Va:return function(u,h){var m=h?Ru(u.buffer):u.buffer;return new u.constructor(m,u.byteOffset,u.byteLength)}(u,m);case uo:case za:case Ni:case us:case ho:case gc:case Sl:case fu:case pu:return H_(u,m);case Fi:return new b;case $r:case ii:return new b(u);case Gr:return function(u){var h=new u.constructor(u.source,ln.exec(u));return h.lastIndex=u.lastIndex,h}(u);case Nr:return new b;case pc:return function(u){return xd?fi(xd.call(u)):{}}(u)}}(u,Re,H)}}P||(P=new va);var St=P.get(u);if(St)return St;P.set(u,z),gT(u)?u.forEach(function(Xt){z.add(ps(Xt,h,m,Xt,u,P))}):dT(u)&&u.forEach(function(Xt,Sn){z.set(Sn,ps(Xt,h,m,Sn,u,P))});var En=Ce?L:(be?X?W_:Bl:X?Is:es)(u);return hs(En||u,function(Xt,Sn){En&&(Xt=u[Sn=Xt]),qa(z,Sn,ps(Xt,h,m,Sn,u,P))}),z}function Vp(u,h,m){var b=m.length;if(null==u)return!b;for(u=fi(u);b--;){var M=m[b],z=u[M];if(z===L&&!(M in u)||!(0,h[M])(z))return!1}return!0}function Kh(u,h,m){if("function"!=typeof u)throw new ga(ft);return rf(function(){u.apply(L,m)},h)}function Sc(u,h,m,b){var M=-1,P=Il,z=!0,H=u.length,X=[],be=h.length;if(!H)return X;m&&(h=hi(h,Lo(m))),b?(P=kh,z=!1):h.length>=200&&(P=Nh,z=!1,h=new ya(h));e:for(;++M-1},Rl.prototype.set=function(u,h){var m=this.__data__,b=Ad(m,u);return b<0?(++this.size,m.push([u,h])):m[b][1]=h,this},Wa.prototype.clear=function(){this.size=0,this.__data__={hash:new Hs,map:new(Us||Rl),string:new Hs}},Wa.prototype.delete=function(u){var h=gs(this,u).delete(u);return this.size-=h?1:0,h},Wa.prototype.get=function(u){return gs(this,u).get(u)},Wa.prototype.has=function(u){return gs(this,u).has(u)},Wa.prototype.set=function(u,h){var m=gs(this,u),b=m.size;return m.set(u,h),this.size+=m.size==b?0:1,this},ya.prototype.add=ya.prototype.push=function(u){return this.__data__.set(u,Tt),this},ya.prototype.has=function(u){return this.__data__.has(u)},va.prototype.clear=function(){this.__data__=new Rl,this.size=0},va.prototype.delete=function(u){var h=this.__data__,m=h.delete(u);return this.size=h.size,m},va.prototype.get=function(u){return this.__data__.get(u)},va.prototype.has=function(u){return this.__data__.has(u)},va.prototype.set=function(u,h){var m=this.__data__;if(m instanceof Rl){var b=m.__data__;if(!Us||b.length<199)return b.push([u,h]),this.size=++m.size,this;m=this.__data__=new Wa(b)}return m.set(u,h),this.size=m.size,this};var Mc=Za(Xa),k_=Za(zp,!0);function L0(u,h){var m=!0;return Mc(u,function(b,M,P){return m=!!h(b,M,P)}),m}function Zh(u,h,m){for(var b=-1,M=u.length;++b0&&m(H)?h>1?Xr(H,h-1,m,b,M):fr(M,H):b||(M[M.length]=H)}return M}var Dd=W0(),Od=W0(!0);function Xa(u,h){return u&&Dd(u,h,es)}function zp(u,h){return u&&Od(u,h,es)}function Qh(u,h){return fa(h,function(m){return Wo(u[m])})}function Bo(u,h){for(var m=0,b=(h=Dc(h,u)).length;null!=u&&mh}function Id(u,h){return null!=u&&pi.call(u,h)}function Pd(u,h){return null!=u&&h in fi(u)}function Au(u,h,m){for(var b=m?kh:Il,M=u[0].length,P=u.length,z=P,H=se(P),X=1/0,be=[];z--;){var Ce=u[z];z&&h&&(Ce=hi(Ce,Lo(h))),X=Lr(Ce.length,X),H[z]=!m&&(h||M>=120&&Ce.length>=120)?new ya(z&&Ce):L}Ce=u[0];var Re=-1,et=H[0];e:for(;++Re=H?X:X*("desc"==m[b]?-1:1)}return u.index-h.index}(P,z,m)});se--;)q[se]=q[se].value;return q}(n1(u,function(P,z,H){return{criteria:hi(h,function(be){return be(P)}),index:++b,value:P}}))}function U0(u,h,m){for(var b=-1,M=h.length,P={};++b-1;)H!==u&&Yt.call(H,X,1),Yt.call(u,X,1);return u}function ef(u,h){for(var m=u?h.length:0,b=m-1;m--;){var M=h[m];if(m==b||M!==P){var P=M;bo(M)?Yt.call(u,M,1):Ou(u,M)}}return u}function kl(u,h){return u+Dn(Hh()*(h-u+1))}function Up(u,h){var m="";if(!u||h<1||h>Gn)return m;do{h%2&&(m+=u),(h=Dn(h/2))&&(u+=u)}while(h);return m}function wn(u,h){return ng(y1(u,h,Ps),u+"")}function r1(u){return O_(Zd(u))}function E2(u,h){var m=Zd(u);return jd(m,Tu(h,0,m.length))}function Hp(u,h,m,b){if(!Xi(u))return u;for(var M=-1,P=(h=Dc(h,u)).length,z=P-1,H=u;null!=H&&++MM?0:M+h),(m=m>M?M:m)<0&&(m+=M),M=h>m?0:m-h>>>0,h>>>=0;for(var P=se(M);++b>>1,z=u[P];null!==z&&!qo(z)&&(m?z<=h:z=200){var be=h?null:G_(u);if(be)return m_(be);z=!1,M=Nh,X=new ya}else X=h?[]:H;e:for(;++b=b?u:Qr(u,h,m)}var a1=O0||function(u){return Kn.clearTimeout(u)};function Wp(u,h){if(h)return u.slice();var m=u.length,b=D0?D0(m):new u.constructor(m);return u.copy(b),b}function Ru(u){var h=new u.constructor(u.byteLength);return new Sd(h).set(new Sd(u)),h}function H_(u,h){var m=h?Ru(u.buffer):u.buffer;return new u.constructor(m,u.byteOffset,u.length)}function Oc(u,h){if(u!==h){var m=u!==L,b=null===u,M=u==u,P=qo(u),z=h!==L,H=null===h,X=h==h,be=qo(h);if(!H&&!be&&!P&&u>h||P&&z&&X&&!H&&!be||b&&z&&X||!m&&X||!M)return 1;if(!b&&!P&&!be&&u1?m[M-1]:L,z=M>2?m[2]:L;for(P=u.length>3&&"function"==typeof P?(M--,P):L,z&&_s(m[0],m[1],z)&&(P=M<3?L:P,M=1),h=fi(h);++b-1?M[P?h[z]:z]:L}}function Fu(u){return Qa(function(h){var m=h.length,b=m,M=_o.prototype.thru;for(u&&h.reverse();b--;){var P=h[b];if("function"!=typeof P)throw new ga(ft);if(M&&!z&&"wrapper"==Jp(P))var z=new _o([],!0)}for(b=z?b:m;++b1&&Bn.reverse(),Ce&&XH))return!1;var be=P.get(u),Ce=P.get(h);if(be&&Ce)return be==h&&Ce==u;var Re=-1,et=!0,St=2&m?new ya:L;for(P.set(u,h),P.set(h,u);++Re-1&&u%1==0&&u1?"& ":"")+h[b],h=h.join(m>2?", ":" "),u.replace(he,"{\n/* [wrapped with "+h+"] */\n")}(b,function(u,h){return hs(Dh,function(m){var b="_."+m[0];h&m[1]&&!Il(u,b)&&u.push(b)}),u.sort()}(function(u){var h=u.match(pe);return h?h[1].split(Ge):[]}(b),m)))}function ey(u){var h=0,m=0;return function(){var b=p2(),M=16-(b-m);if(m=b,M>0){if(++h>=800)return arguments[0]}else h=0;return u.apply(L,arguments)}}function jd(u,h){var m=-1,b=u.length,M=b-1;for(h=h===L?b:h;++m1?u[h-1]:L;return m="function"==typeof m?(u.pop(),m):L,j1(u,m)});function dy(u){var h=O(u);return h.__chain__=!0,h}function $d(u,h){return h(u)}var hy=Qa(function(u){var h=u.length,m=h?u[0]:0,b=this.__wrapped__,M=function(P){return P_(P,u)};return!(h>1||this.__actions__.length)&&b instanceof Cn&&bo(m)?((b=b.slice(m,+m+(h?1:0))).__actions__.push({func:$d,args:[M],thisArg:L}),new _o(b,this.__chain__).thru(function(P){return h&&!P.length&&P.push(L),P})):this.thru(M)}),$1=br(function(u,h,m){pi.call(u,m)?++u[m]:Ya(u,m,1)}),q1=Y0(ny),Y1=Y0(iy);function my(u,h){return(Bt(u)?hs:Mc)(u,Ut(h,3))}function og(u,h){return(Bt(u)?yd:k_)(u,Ut(h,3))}var K1=br(function(u,h,m){pi.call(u,m)?u[m].push(h):Ya(u,m,[h])}),xC=wn(function(u,h,m){var b=-1,M="function"==typeof h,P=$s(u)?se(u.length):[];return Mc(u,function(z){P[++b]=M?Ar(h,z,m):ba(z,h,m)}),P}),TC=br(function(u,h,m){Ya(u,m,h)});function el(u,h){return(Bt(u)?hi:n1)(u,Ut(h,3))}var DC=br(function(u,h,m){u[m?0:1].push(h)},function(){return[[],[]]}),lg=wn(function(u,h){if(null==u)return[];var m=h.length;return m>1&&_s(u,h[0],h[1])?h=[]:m>2&&_s(h[0],h[1],h[2])&&(h=[h[0]]),Jh(u,Xr(h,1),[])}),Bu=Bx||function(){return Kn.Date.now()};function cg(u,h,m){return h=m?L:h,Ll(u,128,L,L,L,L,h=u&&null==h?u.length:h)}function yy(u,h){var m;if("function"!=typeof h)throw new ga(ft);return u=hn(u),function(){return--u>0&&(m=h.apply(this,arguments)),u<=1&&(h=L),m}}var cf=wn(function(u,h,m){var b=1;if(m.length){var M=Eu(m,zd(cf));b|=32}return Ll(u,b,h,m,M)}),Wd=wn(function(u,h,m){var b=3;if(m.length){var M=Eu(m,zd(Wd));b|=32}return Ll(h,b,u,m,M)});function NC(u,h,m){var b,M,P,z,H,X,be=0,Ce=!1,Re=!1,et=!0;if("function"!=typeof u)throw new ga(ft);function St(Qn){var sl=b,Lc=M;return b=M=L,be=Qn,z=u.apply(Lc,sl)}function Wt(Qn){return be=Qn,H=rf(Sn,h),Ce?St(Qn):z}function Xt(Qn){var sl=Qn-X;return X===L||sl>=h||sl<0||Re&&Qn-be>=P}function Sn(){var Qn=Bu();if(Xt(Qn))return Bn(Qn);H=rf(Sn,function(Qn){var sA=h-(Qn-X);return Re?Lr(sA,P-(Qn-be)):sA}(Qn))}function Bn(Qn){return H=L,et&&b?St(Qn):(b=M=L,z)}function Yo(){var Qn=Bu(),sl=Xt(Qn);if(b=arguments,M=this,X=Qn,sl){if(H===L)return Wt(X);if(Re)return a1(H),H=rf(Sn,h),St(X)}return H===L&&(H=rf(Sn,h)),z}return h=Gs(h)||0,Xi(m)&&(Ce=!!m.leading,P=(Re="maxWait"in m)?pr(Gs(m.maxWait)||0,h):P,et="trailing"in m?!!m.trailing:et),Yo.cancel=function(){H!==L&&a1(H),be=0,b=X=M=H=L},Yo.flush=function(){return H===L?z:Bn(Bu())},Yo}var eT=wn(function(u,h){return Kh(u,1,h)}),LC=wn(function(u,h,m){return Kh(u,Gs(h)||0,m)});function uf(u,h){if("function"!=typeof u||null!=h&&"function"!=typeof h)throw new ga(ft);var m=function(){var b=arguments,M=h?h.apply(this,b):b[0],P=m.cache;if(P.has(M))return P.get(M);var z=u.apply(this,b);return m.cache=P.set(M,z)||P,z};return m.cache=new(uf.Cache||Wa),m}function Cy(u){if("function"!=typeof u)throw new ga(ft);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)}}uf.Cache=Wa;var tT=o1(function(u,h){var m=(h=1==h.length&&Bt(h[0])?hi(h[0],Lo(Ut())):hi(Xr(h,1),Lo(Ut()))).length;return wn(function(b){for(var M=-1,P=Lr(b.length,m);++M=h}),tl=Qx(function(){return arguments}())?Qx:function(u){return Ki(u)&&pi.call(u,"callee")&&!Dp.call(u,"callee")},Bt=se.isArray,HC=it?Lo(it):function(u){return Ki(u)&&Kr(u)==El};function $s(u){return null!=u&&Ey(u.length)&&!Wo(u)}function Yi(u){return Ki(u)&&$s(u)}var nl=Dr||Wy,$C=bn?Lo(bn):function(u){return Ki(u)&&Kr(u)==pt};function Ea(u){if(!Ki(u))return!1;var h=Kr(u);return h==ki||"[object DOMException]"==h||"string"==typeof u.message&&"string"==typeof u.name&&!fg(u)}function Wo(u){if(!Xi(u))return!1;var h=Kr(u);return h==la||h==La||"[object AsyncFunction]"==h||"[object Proxy]"==h}function hg(u){return"number"==typeof u&&u==hn(u)}function Ey(u){return"number"==typeof u&&u>-1&&u%1==0&&u<=Gn}function Xi(u){var h=typeof u;return null!=u&&("object"==h||"function"==h)}function Ki(u){return null!=u&&"object"==typeof u}var dT=Oi?Lo(Oi):function(u){return Ki(u)&&ms(u)==Fi};function pT(u){return"number"==typeof u||Ki(u)&&Kr(u)==$r}function fg(u){if(!Ki(u)||Kr(u)!=ir)return!1;var h=ma(u);if(null===h)return!0;var m=pi.call(h,"constructor")&&h.constructor;return"function"==typeof m&&m instanceof m&&qi.call(m)==Nx}var YC=js?Lo(js):function(u){return Ki(u)&&Kr(u)==Gr},gT=bc?Lo(bc):function(u){return Ki(u)&&ms(u)==Nr};function My(u){return"string"==typeof u||!Bt(u)&&Ki(u)&&Kr(u)==ii}function qo(u){return"symbol"==typeof u||Ki(u)&&Kr(u)==pc}var df=Tr?Lo(Tr):function(u){return Ki(u)&&Ey(u.length)&&!!Ne[Kr(u)]},Rc=Kp(j0),xy=Kp(function(u,h){return u<=h});function XC(u){if(!u)return[];if($s(u))return My(u)?$a(u):Ds(u);if(jh&&u[jh])return function(q){for(var fe,se=[];!(fe=q.next()).done;)se.push(fe.value);return se}(u[jh]());var h=ms(u);return(h==Fi?x0:h==Nr?m_:Zd)(u)}function il(u){return u?(u=Gs(u))===pn||u===-pn?17976931348623157e292*(u<0?-1:1):u==u?u:0:0===u?u:0}function hn(u){var h=il(u),m=h%1;return h==h?m?h-m:h:0}function Ty(u){return u?Tu(hn(u),0,jt):0}function Gs(u){if("number"==typeof u)return u;if(qo(u))return NaN;if(Xi(u)){var h="function"==typeof u.valueOf?u.valueOf():u;u=Xi(h)?h+"":h}if("string"!=typeof u)return 0===u?u:+u;u=M0(u);var m=Hi.test(u);return m||_n.test(u)?S0(u.slice(2),m?2:8):ri.test(u)?NaN:+u}function KC(u){return Ca(u,Is(u))}function Zn(u){return null==u?"":vo(u)}var mT=Fl(function(u,h){if(tg(h)||$s(h))Ca(h,es(h),u);else for(var m in h)pi.call(h,m)&&qa(u,m,h[m])}),_T=Fl(function(u,h){Ca(h,Is(h),u)}),qd=Fl(function(u,h,m,b){Ca(h,Is(h),u,b)}),yT=Fl(function(u,h,m,b){Ca(h,es(h),u,b)}),ZC=Qa(P_),bT=wn(function(u,h){u=fi(u);var m=-1,b=h.length,M=b>2?h[2]:L;for(M&&_s(h[0],h[1],M)&&(b=1);++m1),P}),Ca(u,W_(u),m),b&&(m=ps(m,7,Zp));for(var M=h.length;M--;)Ou(m,h[M]);return m}),MT=Qa(function(u,h){return null==u?{}:function(u,h){return U0(u,h,function(m,b){return pg(u,b)})}(u,h)});function rw(u,h){if(null==u)return{};var m=hi(W_(u),function(b){return[b]});return h=Ut(h),U0(u,m,function(b,M){return h(b,M[0])})}var xT=Nu(es),ow=Nu(Is);function Zd(u){return null==u?[]:g_(u,es(u))}var IT=Nl(function(u,h,m){return h=h.toLowerCase(),u+(m?Iy(h):h)});function Iy(u){return _g(Zn(u).toLowerCase())}function Py(u){return(u=Zn(u))&&u.replace(_c,s2).replace(d_,"")}var RT=Nl(function(u,h,m){return u+(m?"-":"")+h.toLowerCase()}),kT=Nl(function(u,h,m){return u+(m?" ":"")+h.toLowerCase()}),$2=qp("toLowerCase"),VT=Nl(function(u,h,m){return u+(m?"_":"")+h.toLowerCase()}),Fy=Nl(function(u,h,m){return u+(m?" ":"")+_g(h)}),hw=Nl(function(u,h,m){return u+(m?" ":"")+h.toUpperCase()}),_g=qp("toUpperCase");function Vy(u,h,m){return u=Zn(u),(h=m?L:h)===L?function(q){return Dl.test(q)}(u)?function(q){return q.match(b0)||[]}(u):function(q){return q.match(an)||[]}(u):u.match(h)||[]}var zy=wn(function(u,h){try{return Ar(u,L,h)}catch(m){return Ea(m)?m:new Rt(m)}}),fw=Qa(function(u,h){return hs(h,function(m){m=mn(m),Ya(u,m,cf(u[m],u))}),u});function jy(u){return function(){return u}}var W2=Fu(),Fc=Fu(!0);function Ps(u){return u}function Vu(u){return t1("function"==typeof u?u:ps(u,1))}var Uy=wn(function(u,h){return function(m){return ba(m,u,h)}}),pw=wn(function(u,h){return function(m){return ba(u,m,h)}});function Hy(u,h,m){var b=es(h),M=Qh(h,b);null==m&&(!Xi(h)||!M.length&&b.length)&&(m=h,h=u,u=this,M=Qh(h,es(h)));var P=!(Xi(m)&&"chain"in m&&!m.chain),z=Wo(u);return hs(M,function(H){var X=h[H];u[H]=X,z&&(u.prototype[H]=function(){var be=this.__chain__;if(P||be){var Ce=u(this.__wrapped__),Re=Ce.__actions__=Ds(this.__actions__);return Re.push({func:X,args:arguments,thisArg:u}),Ce.__chain__=be,Ce}return X.apply(u,fr([this.value()],arguments))})}),u}function $y(){}var WT=Yp(hi),qT=Yp(gn),mw=Yp(go);function zu(u){return Uo(u)?f_(mn(u)):function(u){return function(h){return Bo(h,u)}}(u)}var XT=K0(),KT=K0(!0);function Nc(){return[]}function Wy(){return!1}var Nt=$_(function(u,h){return u+h},0),qy=Vd("ceil"),Y2=$_(function(u,h){return u/h},1),jl=Vd("floor"),bw=$_(function(u,h){return u*h},1),Cw=Vd("round"),ww=$_(function(u,h){return u-h},0);return O.after=function(u,h){if("function"!=typeof h)throw new ga(ft);return u=hn(u),function(){if(--u<1)return h.apply(this,arguments)}},O.ary=cg,O.assign=mT,O.assignIn=_T,O.assignInWith=qd,O.assignWith=yT,O.at=ZC,O.before=yy,O.bind=cf,O.bindAll=fw,O.bindKey=Wd,O.castArray=function(){if(!arguments.length)return[];var u=arguments[0];return Bt(u)?u:[u]},O.chain=dy,O.chunk=function(u,h,m){h=(m?_s(u,h,m):h===L)?1:pr(hn(h),0);var b=null==u?0:u.length;if(!b||h<1)return[];for(var M=0,P=0,z=se(Oe(b/h));MM?0:M+m),(b=b===L||b>M?M:hn(b))<0&&(b+=M),b=m>b?0:Ty(b);m>>0)?(u=Zn(u))&&("string"==typeof h||null!=h&&!YC(h))&&!(h=vo(h))&&Lh(u)?Ka($a(u),0,m):u.split(h,m):[]},O.spread=function(u,h){if("function"!=typeof u)throw new ga(ft);return h=null==h?0:pr(hn(h),0),wn(function(m){var b=m[h],M=Ka(m,0,h);return b&&fr(M,b),Ar(u,this,M)})},O.tail=function(u){var h=null==u?0:u.length;return h?Qr(u,1,h):[]},O.take=function(u,h,m){return u&&u.length?Qr(u,0,(h=m||h===L?1:hn(h))<0?0:h):[]},O.takeRight=function(u,h,m){var b=null==u?0:u.length;return b?Qr(u,(h=b-(h=m||h===L?1:hn(h)))<0?0:h,b):[]},O.takeRightWhile=function(u,h){return u&&u.length?Iu(u,Ut(h,3),!1,!0):[]},O.takeWhile=function(u,h){return u&&u.length?Iu(u,Ut(h,3)):[]},O.tap=function(u,h){return h(u),u},O.throttle=function(u,h,m){var b=!0,M=!0;if("function"!=typeof u)throw new ga(ft);return Xi(m)&&(b="leading"in m?!!m.leading:b,M="trailing"in m?!!m.trailing:M),NC(u,h,{leading:b,maxWait:h,trailing:M})},O.thru=$d,O.toArray=XC,O.toPairs=xT,O.toPairsIn=ow,O.toPath=function(u){return Bt(u)?hi(u,mn):qo(u)?[u]:Ds(lC(Zn(u)))},O.toPlainObject=KC,O.transform=function(u,h,m){var b=Bt(u),M=b||nl(u)||df(u);if(h=Ut(h,4),null==m){var P=u&&u.constructor;m=M?b?new P:[]:Xi(u)&&Wo(P)?xu(ma(u)):{}}return(M?hs:Xa)(u,function(z,H,X){return h(m,z,H,X)}),m},O.unary=function(u){return cg(u,1)},O.union=yC,O.unionBy=ly,O.unionWith=sg,O.uniq=function(u){return u&&u.length?Tc(u):[]},O.uniqBy=function(u,h){return u&&u.length?Tc(u,Ut(h,2)):[]},O.uniqWith=function(u,h){return h="function"==typeof h?h:L,u&&u.length?Tc(u,L,h):[]},O.unset=function(u,h){return null==u||Ou(u,h)},O.unzip=vC,O.unzipWith=j1,O.update=function(u,h,m){return null==u?u:$p(u,h,U_(m))},O.updateWith=function(u,h,m,b){return b="function"==typeof b?b:L,null==u?u:$p(u,h,U_(m),b)},O.values=Zd,O.valuesIn=function(u){return null==u?[]:g_(u,Is(u))},O.without=bC,O.words=Vy,O.wrap=function(u,h){return ug(U_(h),u)},O.xor=R2,O.xorBy=Co,O.xorWith=cy,O.zip=uy,O.zipObject=function(u,h){return Gp(u||[],h||[],qa)},O.zipObjectDeep=function(u,h){return Gp(u||[],h||[],Hp)},O.zipWith=lf,O.entries=xT,O.entriesIn=ow,O.extend=_T,O.extendWith=qd,Hy(O,O),O.add=Nt,O.attempt=zy,O.camelCase=IT,O.capitalize=Iy,O.ceil=qy,O.clamp=function(u,h,m){return m===L&&(m=h,h=L),m!==L&&(m=(m=Gs(m))==m?m:0),h!==L&&(h=(h=Gs(h))==h?h:0),Tu(Gs(u),h,m)},O.clone=function(u){return ps(u,4)},O.cloneDeep=function(u){return ps(u,5)},O.cloneDeepWith=function(u,h){return ps(u,5,h="function"==typeof h?h:L)},O.cloneWith=function(u,h){return ps(u,4,h="function"==typeof h?h:L)},O.conformsTo=function(u,h){return null==h||Vp(u,h,es(h))},O.deburr=Py,O.defaultTo=function(u,h){return null==u||u!=u?h:u},O.divide=Y2,O.endsWith=function(u,h,m){u=Zn(u),h=vo(h);var b=u.length,M=m=m===L?b:Tu(hn(m),0,b);return(m-=h.length)>=0&&u.slice(m,M)==h},O.eq=kt,O.escape=function(u){return(u=Zn(u))&&Je.test(u)?u.replace(mu,o2):u},O.escapeRegExp=function(u){return(u=Zn(u))&&Z.test(u)?u.replace(B,"\\$&"):u},O.every=function(u,h,m){var b=Bt(u)?gn:L0;return m&&_s(u,h,m)&&(h=L),b(u,Ut(h,3))},O.find=q1,O.findIndex=ny,O.findKey=function(u,h){return Fh(u,Ut(h,3),Xa)},O.findLast=Y1,O.findLastIndex=iy,O.findLastKey=function(u,h){return Fh(u,Ut(h,3),zp)},O.floor=jl,O.forEach=my,O.forEachRight=og,O.forIn=function(u,h){return null==u?u:Dd(u,Ut(h,3),Is)},O.forInRight=function(u,h){return null==u?u:Od(u,Ut(h,3),Is)},O.forOwn=function(u,h){return u&&Xa(u,Ut(h,3))},O.forOwnRight=function(u,h){return u&&zp(u,Ut(h,3))},O.get=pf,O.gt=G,O.gte=UC,O.has=function(u,h){return null!=u&&iC(u,h,Id)},O.hasIn=pg,O.head=uC,O.identity=Ps,O.includes=function(u,h,m,b){u=$s(u)?u:Zd(u),m=m&&!b?hn(m):0;var M=u.length;return m<0&&(m=pr(M+m,0)),My(u)?m<=M&&u.indexOf(h,m)>-1:!!M&&Ha(u,h,m)>-1},O.indexOf=function(u,h,m){var b=null==u?0:u.length;if(!b)return-1;var M=null==m?0:hn(m);return M<0&&(M=pr(b+M,0)),Ha(u,h,M)},O.inRange=function(u,h,m){return h=il(h),m===L?(m=h,h=0):m=il(m),function(u,h,m){return u>=Lr(h,m)&&u=-Gn&&u<=Gn},O.isSet=gT,O.isString=My,O.isSymbol=qo,O.isTypedArray=df,O.isUndefined=function(u){return u===L},O.isWeakMap=function(u){return Ki(u)&&ms(u)==di},O.isWeakSet=function(u){return Ki(u)&&"[object WeakSet]"==Kr(u)},O.join=function(u,h){return null==u?"":Uh.call(u,h)},O.kebabCase=RT,O.last=Ho,O.lastIndexOf=function(u,h,m){var b=null==u?0:u.length;if(!b)return-1;var M=b;return m!==L&&(M=(M=hn(m))<0?pr(b+M,0):Lr(M,b-1)),h==h?function(q,fe,se){for(var lt=se+1;lt--;)if(q[lt]===fe)return lt;return lt}(u,h,M):bd(u,Cc,M,!0)},O.lowerCase=kT,O.lowerFirst=$2,O.lt=Rc,O.lte=xy,O.max=function(u){return u&&u.length?Zh(u,Ps,Zr):L},O.maxBy=function(u,h){return u&&u.length?Zh(u,Ut(h,2),Zr):L},O.mean=function(u){return qr(u,Ps)},O.meanBy=function(u,h){return qr(u,Ut(h,2))},O.min=function(u){return u&&u.length?Zh(u,Ps,j0):L},O.minBy=function(u,h){return u&&u.length?Zh(u,Ut(h,2),j0):L},O.stubArray=Nc,O.stubFalse=Wy,O.stubObject=function(){return{}},O.stubString=function(){return""},O.stubTrue=function(){return!0},O.multiply=bw,O.nth=function(u,h){return u&&u.length?Du(u,hn(h)):L},O.noConflict=function(){return Kn._===this&&(Kn._=C_),this},O.noop=$y,O.now=Bu,O.pad=function(u,h,m){u=Zn(u);var b=(h=hn(h))?Bh(u):0;if(!h||b>=h)return u;var M=(h-b)/2;return Xp(Dn(M),m)+u+Xp(Oe(M),m)},O.padEnd=function(u,h,m){u=Zn(u);var b=(h=hn(h))?Bh(u):0;return h&&bh){var b=u;u=h,h=b}if(m||u%1||h%1){var M=Hh();return Lr(u+M*(h-u+Ax("1e-"+((M+"").length-1))),h)}return kl(u,h)},O.reduce=function(u,h,m){var b=Bt(u)?wu:No,M=arguments.length<3;return b(u,Ut(h,4),m,M,Mc)},O.reduceRight=function(u,h,m){var b=Bt(u)?vd:No,M=arguments.length<3;return b(u,Ut(h,4),m,M,k_)},O.repeat=function(u,h,m){return h=(m?_s(u,h,m):h===L)?1:hn(h),Up(Zn(u),h)},O.replace=function(){var u=arguments,h=Zn(u[0]);return u.length<3?h:h.replace(u[1],u[2])},O.result=function(u,h,m){var b=-1,M=(h=Dc(h,u)).length;for(M||(M=1,u=L);++bGn)return[];var m=jt,b=Lr(u,jt);h=Ut(h),u-=jt;for(var M=wd(b,h);++m=P)return u;var H=m-Bh(b);if(H<1)return b;var X=z?Ka(z,0,H).join(""):u.slice(0,H);if(M===L)return X+b;if(z&&(H+=X.length-H),YC(M)){if(u.slice(H).search(M)){var be,Ce=X;for(M.global||(M=v_(M.source,Zn(ln.exec(M))+"g")),M.lastIndex=0;be=M.exec(Ce);)var Re=be.index;X=X.slice(0,Re===L?H:Re)}}else if(u.indexOf(vo(M),H)!=H){var et=X.lastIndexOf(M);et>-1&&(X=X.slice(0,et))}return X+b},O.unescape=function(u){return(u=Zn(u))&&Vs.test(u)?u.replace(pd,y_):u},O.uniqueId=function(u){var h=++f2;return Zn(u)+h},O.upperCase=hw,O.upperFirst=_g,O.each=my,O.eachRight=og,O.first=uC,Hy(O,function(){var u={};return Xa(O,function(h,m){pi.call(O.prototype,m)||(u[m]=h)}),u}(),{chain:!1}),O.VERSION="4.17.21",hs(["bind","bindKey","curry","curryRight","partial","partialRight"],function(u){O[u].placeholder=O}),hs(["drop","take"],function(u,h){Cn.prototype[u]=function(m){m=m===L?1:pr(hn(m),0);var b=this.__filtered__&&!h?new Cn(this):this.clone();return b.__filtered__?b.__takeCount__=Lr(m,b.__takeCount__):b.__views__.push({size:Lr(m,jt),type:u+(b.__dir__<0?"Right":"")}),b},Cn.prototype[u+"Right"]=function(m){return this.reverse()[u](m).reverse()}}),hs(["filter","map","takeWhile"],function(u,h){var m=h+1,b=1==m||3==m;Cn.prototype[u]=function(M){var P=this.clone();return P.__iteratees__.push({iteratee:Ut(M,3),type:m}),P.__filtered__=P.__filtered__||b,P}}),hs(["head","last"],function(u,h){var m="take"+(h?"Right":"");Cn.prototype[u]=function(){return this[m](1).value()[0]}}),hs(["initial","tail"],function(u,h){var m="drop"+(h?"":"Right");Cn.prototype[u]=function(){return this.__filtered__?new Cn(this):this[m](1)}}),Cn.prototype.compact=function(){return this.filter(Ps)},Cn.prototype.find=function(u){return this.filter(u).head()},Cn.prototype.findLast=function(u){return this.reverse().find(u)},Cn.prototype.invokeMap=wn(function(u,h){return"function"==typeof u?new Cn(this):this.map(function(m){return ba(m,u,h)})}),Cn.prototype.reject=function(u){return this.filter(Cy(Ut(u)))},Cn.prototype.slice=function(u,h){u=hn(u);var m=this;return m.__filtered__&&(u>0||h<0)?new Cn(m):(u<0?m=m.takeRight(-u):u&&(m=m.drop(u)),h!==L&&(m=(h=hn(h))<0?m.dropRight(-h):m.take(h-u)),m)},Cn.prototype.takeRightWhile=function(u){return this.reverse().takeWhile(u).reverse()},Cn.prototype.toArray=function(){return this.take(jt)},Xa(Cn.prototype,function(u,h){var m=/^(?:filter|find|map|reject)|While$/.test(h),b=/^(?:head|last)$/.test(h),M=O[b?"take"+("last"==h?"Right":""):h],P=b||/^find/.test(h);!M||(O.prototype[h]=function(){var z=this.__wrapped__,H=b?[1]:arguments,X=z instanceof Cn,be=H[0],Ce=X||Bt(z),Re=function(Sn){var Bn=M.apply(O,fr([Sn],H));return b&&et?Bn[0]:Bn};Ce&&m&&"function"==typeof be&&1!=be.length&&(X=Ce=!1);var et=this.__chain__,St=!!this.__actions__.length,Wt=P&&!et,En=X&&!St;if(!P&&Ce){z=En?z:new Cn(this);var Xt=u.apply(z,H);return Xt.__actions__.push({func:$d,args:[Re],thisArg:L}),new _o(Xt,et)}return Wt&&En?u.apply(this,H):(Xt=this.thru(Re),Wt?b?Xt.value()[0]:Xt.value():Xt)})}),hs(["pop","push","shift","sort","splice","unshift"],function(u){var h=Ii[u],m=/^(?:push|sort|unshift)$/.test(u)?"tap":"thru",b=/^(?:pop|shift)$/.test(u);O.prototype[u]=function(){var M=arguments;if(b&&!this.__chain__){var P=this.value();return h.apply(Bt(P)?P:[],M)}return this[m](function(z){return h.apply(Bt(z)?z:[],M)})}}),Xa(Cn.prototype,function(u,h){var m=O[h];if(m){var b=m.name+"";pi.call(Md,b)||(Md[b]=[]),Md[b].push({name:h,func:m})}}),Md[Ic(L,2).name]=[{name:"wrapper",func:L}],Cn.prototype.clone=function(){var u=new Cn(this.__wrapped__);return u.__actions__=Ds(this.__actions__),u.__dir__=this.__dir__,u.__filtered__=this.__filtered__,u.__iteratees__=Ds(this.__iteratees__),u.__takeCount__=this.__takeCount__,u.__views__=Ds(this.__views__),u},Cn.prototype.reverse=function(){if(this.__filtered__){var u=new Cn(this);u.__dir__=-1,u.__filtered__=!0}else(u=this.clone()).__dir__*=-1;return u},Cn.prototype.value=function(){var u=this.__wrapped__.value(),h=this.__dir__,m=Bt(u),b=h<0,M=m?u.length:0,P=function(u,h,m){for(var b=-1,M=m.length;++b=this.__values__.length;return{done:u,value:u?L:this.__values__[this.__index__++]}},O.prototype.plant=function(u){for(var h,m=this;m instanceof qh;){var b=Ud(m);b.__index__=0,b.__values__=L,h?M.__wrapped__=b:h=b;var M=b;m=m.__wrapped__}return M.__wrapped__=u,h},O.prototype.reverse=function(){var u=this.__wrapped__;if(u instanceof Cn){var h=u;return this.__actions__.length&&(h=new Cn(this)),(h=h.reverse()).__actions__.push({func:$d,args:[ay],thisArg:L}),new _o(h,this.__chain__)}return this.thru(ay)},O.prototype.toJSON=O.prototype.valueOf=O.prototype.value=function(){return s1(this.__wrapped__,this.__actions__)},O.prototype.first=O.prototype.head,jh&&(O.prototype[jh]=function(){return this}),O}();Kn._=Vh,(wt=function(){return Vh}.call(We,ze,We,gt))!==L&&(gt.exports=wt)}.call(this)},478:function(gt){gt.exports=function(){"use strict";function We(W,Y){for(var J=0;JW.length)&&(Y=W.length);for(var J=0,T=new Array(Y);J=W.length?{done:!0}:{done:!1,value:W[T++]}}}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 Pt={exports:{}};function Ke(){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}}Pt.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:Ke,changeDefaults:function(W){Pt.exports.defaults=W}};var Ze=/[&<>"']/,Tt=/[&<>"']/g,Ft=/[<>"']|&(?!#?\w+;)/,we=/[<>"']|&(?!#?\w+;)/g,_e={"&":"&","<":"<",">":">",'"':""","'":"'"},ke=function(Y){return _e[Y]};var Te=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function Vt(W){return W.replace(Te,function(Y,J){return"colon"===(J=J.toLowerCase())?":":"#"===J.charAt(0)?"x"===J.charAt(1)?String.fromCharCode(parseInt(J.substring(2),16)):String.fromCharCode(+J.substring(1)):""})}var He=/(^|[^\[])\^/g;var xt=/[^\w:]/g,tn=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;var Ei={},vi=/^[^:]+:\/*[^/]*$/,bi=/^([^:]+:)[\s\S]*$/,Mr=/^([^:]+:\/*[^/]*)[\s\S]*$/;function Ve(W,Y){Ei[" "+W]||(Ei[" "+W]=vi.test(W)?W+"/":Qt(W,"/",!0));var J=-1===(W=Ei[" "+W]).indexOf(":");return"//"===Y.substring(0,2)?J?Y:W.replace(bi,"$1")+Y:"/"===Y.charAt(0)?J?Y:W.replace(Mr,"$1")+Y:W+Y}function Qt(W,Y,J){var T=W.length;if(0===T)return"";for(var D=0;D1;)1&Y&&(J+=W),Y>>=1,W+=W;return J+W},Gn=Pt.exports.defaults,Ae=Qt,Ri=function(W,Y){var T=W.replace(/\|/g,function(B,Z,$){for(var le=!1,he=Z;--he>=0&&"\\"===$[he];)le=!le;return le?"|":" |"}).split(/ \|/),D=0;if(T.length>Y)T.splice(Y);else for(;T.length1?{type:"space",raw:D[0]}:{raw:"\n"}},Y.code=function(T){var D=this.rules.block.code.exec(T);if(D){var B=D[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:D[0],codeBlockStyle:"indented",text:this.options.pedantic?B:Ae(B,"\n")}}},Y.fences=function(T){var D=this.rules.block.fences.exec(T);if(D){var B=D[0],Z=function(W,Y){var J=W.match(/^(\s+)(?:```)/);if(null===J)return Y;var T=J[1];return Y.split("\n").map(function(D){var B=D.match(/^\s+/);return null===B?D:B[0].length>=T.length?D.slice(T.length):D}).join("\n")}(B,D[3]||"");return{type:"code",raw:B,lang:D[2]?D[2].trim():D[2],text:Z}}},Y.heading=function(T){var D=this.rules.block.heading.exec(T);if(D){var B=D[2].trim();if(/#$/.test(B)){var Z=Ae(B,"#");(this.options.pedantic||!Z||/ $/.test(Z))&&(B=Z.trim())}return{type:"heading",raw:D[0],depth:D[1].length,text:B}}},Y.nptable=function(T){var D=this.rules.block.nptable.exec(T);if(D){var B={type:"table",header:Ri(D[1].replace(/^ *| *\| *$/g,"")),align:D[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:D[3]?D[3].replace(/\n$/,"").split("\n"):[],raw:D[0]};if(B.header.length===B.align.length){var $,Z=B.align.length;for($=0;$ ?/gm,"");return{type:"blockquote",raw:D[0],text:B}}},Y.list=function(T){var D=this.rules.block.list.exec(T);if(D){var Ge,an,xn,qt,Et,ln,ri,Hi,$i,B=D[0],Z=D[2],$=Z.length>1,le={type:"list",raw:B,ordered:$,start:$?+Z.slice(0,-1):"",loose:!1,items:[]},he=D[0].match(this.rules.block.item),pe=!1,_n=he.length;xn=this.rules.block.listItemStart.exec(he[0]);for(var Ci=0;Ci<_n;Ci++){if(B=Ge=he[Ci],this.options.pedantic||($i=Ge.match(new RegExp("\\n\\s*\\n {0,"+(xn[0].length-1)+"}\\S")))&&(Et=Ge.length-$i.index+he.slice(Ci+1).join("\n").length,le.raw=le.raw.substring(0,le.raw.length-Et),B=Ge=Ge.substring(0,$i.index),_n=Ci+1),Ci!==_n-1){if(qt=this.rules.block.listItemStart.exec(he[Ci+1]),this.options.pedantic?qt[1].length>xn[1].length:qt[1].length>=xn[0].length||qt[1].length>3){he.splice(Ci,2,he[Ci]+(!this.options.pedantic&&qt[1].length/i.test(Z[0])&&(D=!1),!B&&/^<(pre|code|kbd|script)(\s|>)/i.test(Z[0])?B=!0:B&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(Z[0])&&(B=!1),{type:this.options.sanitize?"text":"html",raw:Z[0],inLink:D,inRawBlock:B,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Z[0]):jt(Z[0]):Z[0]}},Y.link=function(T){var D=this.rules.inline.link.exec(T);if(D){var B=D[2].trim();if(!this.options.pedantic&&/^$/.test(B))return;var Z=Ae(B.slice(0,-1),"\\");if((B.length-Z.length)%2==0)return}else{var $=xr(D[2],"()");if($>-1){var he=(0===D[0].indexOf("!")?5:4)+D[1].length+$;D[2]=D[2].substring(0,$),D[0]=D[0].substring(0,he).trim(),D[3]=""}}var pe=D[2],Ge="";if(this.options.pedantic){var an=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(pe);an&&(pe=an[1],Ge=an[3])}else Ge=D[3]?D[3].slice(1,-1):"";return pe=pe.trim(),/^$/.test(B)?pe.slice(1):pe.slice(1,-1)),ls(D,{href:pe&&pe.replace(this.rules.inline._escapes,"$1"),title:Ge&&Ge.replace(this.rules.inline._escapes,"$1")},D[0])}},Y.reflink=function(T,D){var B;if((B=this.rules.inline.reflink.exec(T))||(B=this.rules.inline.nolink.exec(T))){var Z=(B[2]||B[1]).replace(/\s+/g," ");if(!(Z=D[Z.toLowerCase()])||!Z.href){var $=B[0].charAt(0);return{type:"text",raw:$,text:$}}return ls(B,Z,B[0])}},Y.emStrong=function(T,D,B){void 0===B&&(B="");var Z=this.rules.inline.emStrong.lDelim.exec(T);if(Z&&(!Z[3]||!B.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 $=Z[1]||Z[2]||"";if(!$||$&&(""===B||this.rules.inline.punctuation.exec(B))){var he,pe,le=Z[0].length-1,Ge=le,an=0,xn="*"===Z[0][0]?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(xn.lastIndex=0,D=D.slice(-1*T.length+le);null!=(Z=xn.exec(D));)if(he=Z[1]||Z[2]||Z[3]||Z[4]||Z[5]||Z[6]){if(pe=he.length,Z[3]||Z[4]){Ge+=pe;continue}if((Z[5]||Z[6])&&le%3&&!((le+pe)%3)){an+=pe;continue}if(!((Ge-=pe)>0))return pe=Math.min(pe,pe+Ge+an),Math.min(le,pe)%2?{type:"em",raw:T.slice(0,le+Z.index+pe+1),text:T.slice(1,le+Z.index+pe)}:{type:"strong",raw:T.slice(0,le+Z.index+pe+1),text:T.slice(2,le+Z.index+pe-1)}}}}},Y.codespan=function(T){var D=this.rules.inline.code.exec(T);if(D){var B=D[2].replace(/\n/g," "),Z=/[^ ]/.test(B),$=/^ /.test(B)&&/ $/.test(B);return Z&&$&&(B=B.substring(1,B.length-1)),B=jt(B,!0),{type:"codespan",raw:D[0],text:B}}},Y.br=function(T){var D=this.rules.inline.br.exec(T);if(D)return{type:"br",raw:D[0]}},Y.del=function(T){var D=this.rules.inline.del.exec(T);if(D)return{type:"del",raw:D[0],text:D[2]}},Y.autolink=function(T,D){var Z,$,B=this.rules.inline.autolink.exec(T);if(B)return $="@"===B[2]?"mailto:"+(Z=jt(this.options.mangle?D(B[1]):B[1])):Z=jt(B[1]),{type:"link",raw:B[0],text:Z,href:$,tokens:[{type:"text",raw:Z,text:Z}]}},Y.url=function(T,D){var B;if(B=this.rules.inline.url.exec(T)){var Z,$;if("@"===B[2])$="mailto:"+(Z=jt(this.options.mangle?D(B[0]):B[0]));else{var le;do{le=B[0],B[0]=this.rules.inline._backpedal.exec(B[0])[0]}while(le!==B[0]);Z=jt(B[0]),$="www."===B[1]?"http://"+Z:Z}return{type:"link",raw:B[0],text:Z,href:$,tokens:[{type:"text",raw:Z,text:Z}]}}},Y.inlineText=function(T,D,B){var $,Z=this.rules.inline.text.exec(T);if(Z)return $=D?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Z[0]):jt(Z[0]):Z[0]:jt(this.options.smartypants?B(Z[0]):Z[0]),{type:"text",raw:Z[0],text:$}},W}(),aa=pn_noopTest,Xn=pn_edit,ci=pn_merge,pt={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:aa,table:aa,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?'|\([^()]*\))/};pt.def=Xn(pt.def).replace("label",pt._label).replace("title",pt._title).getRegex(),pt.bullet=/(?:[*+-]|\d{1,9}[.)])/,pt.item=/^( *)(bull) ?[^\n]*(?:\n(?! *bull ?)[^\n]*)*/,pt.item=Xn(pt.item,"gm").replace(/bull/g,pt.bullet).getRegex(),pt.listItemStart=Xn(/^( *)(bull) */).replace("bull",pt.bullet).getRegex(),pt.list=Xn(pt.list).replace(/bull/g,pt.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+pt.def.source+")").getRegex(),pt._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",pt._comment=/|$)/,pt.html=Xn(pt.html,"i").replace("comment",pt._comment).replace("tag",pt._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),pt.paragraph=Xn(pt._paragraph).replace("hr",pt.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",pt._tag).getRegex(),pt.blockquote=Xn(pt.blockquote).replace("paragraph",pt.paragraph).getRegex(),pt.normal=ci({},pt),pt.gfm=ci({},pt.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*|$)"}),pt.gfm.nptable=Xn(pt.gfm.nptable).replace("hr",pt.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",pt._tag).getRegex(),pt.gfm.table=Xn(pt.gfm.table).replace("hr",pt.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",pt._tag).getRegex(),pt.pedantic=ci({},pt.normal,{html:Xn("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",pt._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:aa,paragraph:Xn(pt.normal._paragraph).replace("hr",pt.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",pt.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var Ye={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:aa,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:aa,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~"};Ye.punctuation=Xn(Ye.punctuation).replace(/punctuation/g,Ye._punctuation).getRegex(),Ye.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,Ye.escapedEmSt=/\\\*|\\_/g,Ye._comment=Xn(pt._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),Ye.emStrong.lDelim=Xn(Ye.emStrong.lDelim).replace(/punct/g,Ye._punctuation).getRegex(),Ye.emStrong.rDelimAst=Xn(Ye.emStrong.rDelimAst,"g").replace(/punct/g,Ye._punctuation).getRegex(),Ye.emStrong.rDelimUnd=Xn(Ye.emStrong.rDelimUnd,"g").replace(/punct/g,Ye._punctuation).getRegex(),Ye._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,Ye._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,Ye._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])?)+(?![-_])/,Ye.autolink=Xn(Ye.autolink).replace("scheme",Ye._scheme).replace("email",Ye._email).getRegex(),Ye._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,Ye.tag=Xn(Ye.tag).replace("comment",Ye._comment).replace("attribute",Ye._attribute).getRegex(),Ye._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Ye._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,Ye._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,Ye.link=Xn(Ye.link).replace("label",Ye._label).replace("href",Ye._href).replace("title",Ye._title).getRegex(),Ye.reflink=Xn(Ye.reflink).replace("label",Ye._label).getRegex(),Ye.reflinkSearch=Xn(Ye.reflinkSearch,"g").replace("reflink",Ye.reflink).replace("nolink",Ye.nolink).getRegex(),Ye.normal=ci({},Ye),Ye.pedantic=ci({},Ye.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:Xn(/^!?\[(label)\]\((.*?)\)/).replace("label",Ye._label).getRegex(),reflink:Xn(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Ye._label).getRegex()}),Ye.gfm=ci({},Ye.normal,{escape:Xn(Ye.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&&(T="x"+T.toString(16)),Y+="&#"+T+";";return Y}var ui=function(){function W(J){this.tokens=[],this.tokens.links=Object.create(null),this.options=J||La,this.options.tokenizer=this.options.tokenizer||new la,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var T={block:Fi.normal,inline:$r.normal};this.options.pedantic?(T.block=Fi.pedantic,T.inline=$r.pedantic):this.options.gfm&&(T.block=Fi.gfm,T.inline=this.options.breaks?$r.breaks:$r.gfm),this.tokenizer.rules=T}W.lex=function(T,D){return new W(D).lex(T)},W.lexInline=function(T,D){return new W(D).inlineTokens(T)};var Y=W.prototype;return Y.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},Y.blockTokens=function(T,D,B){var $,le,he,pe,Ge,an,Z=this;for(void 0===D&&(D=[]),void 0===B&&(B=!0),this.options.pedantic&&(T=T.replace(/^ +$/gm,""));T;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(function(qt){return!!($=qt.call(Z,T,D))&&(T=T.substring($.raw.length),D.push($),!0)}))){if($=this.tokenizer.space(T)){T=T.substring($.raw.length),$.type&&D.push($);continue}if($=this.tokenizer.code(T)){T=T.substring($.raw.length),(pe=D[D.length-1])&&"paragraph"===pe.type?(pe.raw+="\n"+$.raw,pe.text+="\n"+$.text):D.push($);continue}if($=this.tokenizer.fences(T)){T=T.substring($.raw.length),D.push($);continue}if($=this.tokenizer.heading(T)){T=T.substring($.raw.length),D.push($);continue}if($=this.tokenizer.nptable(T)){T=T.substring($.raw.length),D.push($);continue}if($=this.tokenizer.hr(T)){T=T.substring($.raw.length),D.push($);continue}if($=this.tokenizer.blockquote(T)){T=T.substring($.raw.length),$.tokens=this.blockTokens($.text,[],B),D.push($);continue}if($=this.tokenizer.list(T)){for(T=T.substring($.raw.length),he=$.items.length,le=0;le=0&&(qt=Math.min(qt,ln))}),qt<1/0&&qt>=0&&(Ge=T.substring(0,qt+1))}(),B&&($=this.tokenizer.paragraph(Ge))){pe=D[D.length-1],an&&"paragraph"===pe.type?(pe.raw+="\n"+$.raw,pe.text+="\n"+$.text):D.push($),an=Ge.length!==T.length,T=T.substring($.raw.length);continue}if($=this.tokenizer.text(T)){T=T.substring($.raw.length),(pe=D[D.length-1])&&"text"===pe.type?(pe.raw+="\n"+$.raw,pe.text+="\n"+$.text):D.push($);continue}if(T){var xn="Infinite loop on byte: "+T.charCodeAt(0);if(this.options.silent){console.error(xn);break}throw new Error(xn)}}return D},Y.inline=function(T){var D,B,Z,$,le,he,pe=T.length;for(D=0;D0)for(;null!=(an=this.tokenizer.rules.inline.reflinkSearch.exec(Ge));)Et.includes(an[0].slice(an[0].lastIndexOf("[")+1,-1))&&(Ge=Ge.slice(0,an.index)+"["+Ba("a",an[0].length-2)+"]"+Ge.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(an=this.tokenizer.rules.inline.blockSkip.exec(Ge));)Ge=Ge.slice(0,an.index)+"["+Ba("a",an[0].length-2)+"]"+Ge.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(an=this.tokenizer.rules.inline.escapedEmSt.exec(Ge));)Ge=Ge.slice(0,an.index)+"++"+Ge.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;T;)if(xn||(qt=""),xn=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(function(ri){return!!(le=ri.call($,T,D))&&(T=T.substring(le.raw.length),D.push(le),!0)}))){if(le=this.tokenizer.escape(T)){T=T.substring(le.raw.length),D.push(le);continue}if(le=this.tokenizer.tag(T,B,Z)){T=T.substring(le.raw.length),B=le.inLink,Z=le.inRawBlock,(he=D[D.length-1])&&"text"===le.type&&"text"===he.type?(he.raw+=le.raw,he.text+=le.text):D.push(le);continue}if(le=this.tokenizer.link(T)){T=T.substring(le.raw.length),"link"===le.type&&(le.tokens=this.inlineTokens(le.text,[],!0,Z)),D.push(le);continue}if(le=this.tokenizer.reflink(T,this.tokens.links)){T=T.substring(le.raw.length),he=D[D.length-1],"link"===le.type?(le.tokens=this.inlineTokens(le.text,[],!0,Z),D.push(le)):he&&"text"===le.type&&"text"===he.type?(he.raw+=le.raw,he.text+=le.text):D.push(le);continue}if(le=this.tokenizer.emStrong(T,Ge,qt)){T=T.substring(le.raw.length),le.tokens=this.inlineTokens(le.text,[],B,Z),D.push(le);continue}if(le=this.tokenizer.codespan(T)){T=T.substring(le.raw.length),D.push(le);continue}if(le=this.tokenizer.br(T)){T=T.substring(le.raw.length),D.push(le);continue}if(le=this.tokenizer.del(T)){T=T.substring(le.raw.length),le.tokens=this.inlineTokens(le.text,[],B,Z),D.push(le);continue}if(le=this.tokenizer.autolink(T,lo)){T=T.substring(le.raw.length),D.push(le);continue}if(!B&&(le=this.tokenizer.url(T,lo))){T=T.substring(le.raw.length),D.push(le);continue}if(pe=T,this.options.extensions&&this.options.extensions.startInline&&function(){var ri=1/0,Hi=T.slice(1),$i=void 0;$.options.extensions.startInline.forEach(function(_n){"number"==typeof($i=_n.call(this,Hi))&&$i>=0&&(ri=Math.min(ri,$i))}),ri<1/0&&ri>=0&&(pe=T.substring(0,ri+1))}(),le=this.tokenizer.inlineText(pe,Z,ir)){T=T.substring(le.raw.length),"_"!==le.raw.slice(-1)&&(qt=le.raw.slice(-1)),xn=!0,(he=D[D.length-1])&&"text"===he.type?(he.raw+=le.raw,he.text+=le.text):D.push(le);continue}if(T){var ln="Infinite loop on byte: "+T.charCodeAt(0);if(this.options.silent){console.error(ln);break}throw new Error(ln)}}return D},function(W,Y,J){Y&&We(W.prototype,Y),J&&We(W,J)}(W,null,[{key:"rules",get:function(){return{block:Fi,inline:$r}}}]),W}(),Gr=Pt.exports.defaults,Nr=pn_cleanUrl,ii=pn_escape,pc=function(){function W(J){this.options=J||Gr}var Y=W.prototype;return Y.code=function(T,D,B){var Z=(D||"").match(/\S*/)[0];if(this.options.highlight){var $=this.options.highlight(T,Z);null!=$&&$!==T&&(B=!0,T=$)}return T=T.replace(/\n$/,"")+"\n",Z?'
    '+(B?T:ii(T,!0))+"
    \n":"
    "+(B?T:ii(T,!0))+"
    \n"},Y.blockquote=function(T){return"
    \n"+T+"
    \n"},Y.html=function(T){return T},Y.heading=function(T,D,B,Z){return this.options.headerIds?"'+T+"\n":""+T+"\n"},Y.hr=function(){return this.options.xhtml?"
    \n":"
    \n"},Y.list=function(T,D,B){var Z=D?"ol":"ul";return"<"+Z+(D&&1!==B?' start="'+B+'"':"")+">\n"+T+"\n"},Y.listitem=function(T){return"
  • "+T+"
  • \n"},Y.checkbox=function(T){return" "},Y.paragraph=function(T){return"

    "+T+"

    \n"},Y.table=function(T,D){return D&&(D=""+D+""),"\n\n"+T+"\n"+D+"
    \n"},Y.tablerow=function(T){return"\n"+T+"\n"},Y.tablecell=function(T,D){var B=D.header?"th":"td";return(D.align?"<"+B+' align="'+D.align+'">':"<"+B+">")+T+"\n"},Y.strong=function(T){return""+T+""},Y.em=function(T){return""+T+""},Y.codespan=function(T){return""+T+""},Y.br=function(){return this.options.xhtml?"
    ":"
    "},Y.del=function(T){return""+T+""},Y.link=function(T,D,B){if(null===(T=Nr(this.options.sanitize,this.options.baseUrl,T)))return B;var Z='"+B+""},Y.image=function(T,D,B){if(null===(T=Nr(this.options.sanitize,this.options.baseUrl,T)))return B;var Z=''+B+'":">")},Y.text=function(T){return T},W}(),co=function(){function W(){}var Y=W.prototype;return Y.strong=function(T){return T},Y.em=function(T){return T},Y.codespan=function(T){return T},Y.del=function(T){return T},Y.html=function(T){return T},Y.text=function(T){return T},Y.link=function(T,D,B){return""+B},Y.image=function(T,D,B){return""+B},Y.br=function(){return""},W}(),di=function(){function W(){this.seen={}}var Y=W.prototype;return Y.serialize=function(T){return T.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")},Y.getNextSafeSlug=function(T,D){var B=T,Z=0;if(this.seen.hasOwnProperty(B)){Z=this.seen[T];do{B=T+"-"+ ++Z}while(this.seen.hasOwnProperty(B))}return D||(this.seen[T]=Z,this.seen[B]=0),B},Y.slug=function(T,D){void 0===D&&(D={});var B=this.serialize(T);return this.getNextSafeSlug(B,D.dryrun)},W}(),Oh=pc,El=co,Va=di,uo=Pt.exports.defaults,za=pn_unescape,us=ui,ho=function(){function W(J){this.options=J||uo,this.options.renderer=this.options.renderer||new Oh,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new El,this.slugger=new Va}W.parse=function(T,D){return new W(D).parse(T)},W.parseInline=function(T,D){return new W(D).parseInline(T)};var Y=W.prototype;return Y.parse=function(T,D){void 0===D&&(D=!0);var Z,$,le,he,pe,Ge,an,xn,qt,Et,ln,ri,Hi,$i,_n,Ci,_c,fo,gd,B="",xl=T.length;for(Z=0;Z0&&"text"===_n.tokens[0].type?(_n.tokens[0].text=fo+" "+_n.tokens[0].text,_n.tokens[0].tokens&&_n.tokens[0].tokens.length>0&&"text"===_n.tokens[0].tokens[0].type&&(_n.tokens[0].tokens[0].text=fo+" "+_n.tokens[0].tokens[0].text)):_n.tokens.unshift({type:"text",text:fo}):$i+=fo),$i+=this.parse(_n.tokens,Hi),qt+=this.renderer.listitem($i,_c,Ci);B+=this.renderer.list(qt,ln,ri);continue;case"html":B+=this.renderer.html(Et.text);continue;case"paragraph":B+=this.renderer.paragraph(this.parseInline(Et.tokens));continue;case"text":for(qt=Et.tokens?this.parseInline(Et.tokens):Et.text;Z+1An error occurred:

    "+mc(le.message+"",!0)+"
    ";throw le}}return Je.options=Je.setOptions=function(W){return gu(Je.defaults,W),mu(Je.defaults),Je},Je.getDefaults=pd,Je.defaults=Vs,Je.use=function(){for(var W=this,Y=arguments.length,J=new Array(Y),T=0;TAn error occurred:

    "+mc(T.message+"",!0)+"
    ";throw T}},Je.Parser=ho,Je.parser=ho.parse,Je.Renderer=Sl,Je.TextRenderer=fu,Je.Lexer=us,Je.lexer=us.lex,Je.Tokenizer=gc,Je.Slugger=pu,Je.parse=Je,Je}()},310:(gt,We,ze)=>{"use strict";var wt=ze(948);Object.defineProperty(We,"__esModule",{value:!0}),We.isMobile=function(){return void 0!==L.window.orientation},We.default=function(Ze){if(!Ze&&!(0,It.default)())return"Node";if((0,Pt.default)(Ze))return"Electron";var Tt="undefined"!=typeof navigator?navigator:{},Ft=Ze||Tt.userAgent||"";if(Ft.indexOf("Edge")>-1)return"Edge";var we=-1!==Ft.indexOf("MSIE "),_e=-1!==Ft.indexOf("Trident/");return we||_e?"IE":L.window.chrome?"Chrome":L.window.safari?"Safari":L.window.mozInnerScreenX?"Firefox":"Unknown"};var L=ze(151),It=wt(ze(602)),Pt=wt(ze(344))},151:(gt,We,ze)=>{"use strict";var wt=ze(948);Object.defineProperty(We,"__esModule",{value:!0}),We.console=We.process=We.document=We.global=We.window=We.self=void 0;var L=wt(ze(321)),It={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,L.default)(process))&&process};We.self=It.self||It.window||It.global,We.window=It.window||It.self||It.global,We.global=It.global||It.self||It.window,We.document=It.document||{},We.process=It.process||{};var Ft=console;We.console=Ft},761:(gt,We,ze)=>{"use strict";var L=ze(948),It=ze(321);Object.defineProperty(We,"CO",{enumerable:!0,get:function(){return Pt.global}}),Object.defineProperty(We,"qs",{enumerable:!0,get:function(){return ft.default}});var Pt=ze(151),ft=(Ft(ze(602)),Ft(ze(310)));L(ze(344));function Tt(we){if("function"!=typeof WeakMap)return null;var _e=new WeakMap,ke=new WeakMap;return(Tt=function(Te){return Te?ke:_e})(we)}function Ft(we,_e){if(!_e&&we&&we.__esModule)return we;if(null===we||"object"!==It(we)&&"function"!=typeof we)return{default:we};var ke=Tt(_e);if(ke&&ke.has(we))return ke.get(we);var ye={},Te=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var Vt in we)if("default"!==Vt&&Object.prototype.hasOwnProperty.call(we,Vt)){var He=Te?Object.getOwnPropertyDescriptor(we,Vt):null;He&&(He.get||He.set)?Object.defineProperty(ye,Vt,He):ye[Vt]=we[Vt]}return ye.default=we,ke&&ke.set(we,ye),ye}},602:(gt,We,ze)=>{"use strict";var wt=ze(948);Object.defineProperty(We,"__esModule",{value:!0}),We.default=Pt,We.isBrowserMainThread=function(){return Pt()&&"undefined"!=typeof document};var L=wt(ze(321)),It=wt(ze(344));function Pt(){return!("object"===("undefined"==typeof process?"undefined":(0,L.default)(process))&&"[object process]"===String(process)&&!process.browser)||(0,It.default)()}},344:(gt,We,ze)=>{"use strict";var wt=ze(948);Object.defineProperty(We,"__esModule",{value:!0}),We.default=function(Pt){if("undefined"!=typeof window&&"object"===(0,L.default)(window.process)&&"renderer"===window.process.type||"undefined"!=typeof process&&"object"===(0,L.default)(process.versions)&&Boolean(process.versions.electron))return!0;var Ke="object"===("undefined"==typeof navigator?"undefined":(0,L.default)(navigator))&&"string"==typeof navigator.userAgent&&navigator.userAgent,ft=Pt||Ke;return!!(ft&&ft.indexOf("Electron")>=0)};var L=wt(ze(321))},851:(gt,We,ze)=>{"use strict";var wt={};ze.r(wt),ze.d(wt,{decode:()=>N0e,encode:()=>L0e});var L={};ze.r(L),ze.d(L,{decode:()=>U0e,encode:()=>H0e});var It={};ze.r(It),ze.d(It,{decode:()=>$0e,encode:()=>G0e});var Pt={};function Ke(n){return"function"==typeof n}ze.r(Pt),ze.d(Pt,{decode:()=>W0e,encode:()=>q0e});let ft=!1;const Ze={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 ft&&console.log("RxJS: Back to a better error behavior. Thank you. <3");ft=n},get useDeprecatedSynchronousErrorHandling(){return ft}};function Tt(n){setTimeout(()=>{throw n},0)}const Ft={closed:!0,next(n){},error(n){if(Ze.useDeprecatedSynchronousErrorHandling)throw n;Tt(n)},complete(){}},we=Array.isArray||(n=>n&&"number"==typeof n.length);function _e(n){return null!==n&&"object"==typeof n}const ye=(()=>{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 Te{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 Te)t.remove(this);else if(null!==t)for(let o=0;oe.concat(t instanceof ye?t.errors:t),[])}Te.EMPTY=((n=new Te).closed=!0,n);const He="function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random();class xt extends Te{constructor(e,t,i){switch(super(),this.syncErrorValue=null,this.syncErrorThrown=!1,this.syncErrorThrowable=!1,this.isStopped=!1,arguments.length){case 0:this.destination=Ft;break;case 1:if(!e){this.destination=Ft;break}if("object"==typeof e){e instanceof xt?(this.syncErrorThrowable=e.syncErrorThrowable,this.destination=e,e.add(this)):(this.syncErrorThrowable=!0,this.destination=new tn(this,e));break}default:this.syncErrorThrowable=!0,this.destination=new tn(this,e,t,i)}}[He](){return this}static create(e,t,i){const r=new xt(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 tn extends xt{constructor(e,t,i,r){super(),this._parentSubscriber=e;let s,o=this;Ke(t)?s=t:t&&(s=t.next,i=t.error,r=t.complete,t!==Ft&&(o=Object.create(t),Ke(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;Ze.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}=Ze;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):Tt(e),this.unsubscribe();else{if(this.unsubscribe(),i)throw e;Tt(e)}}}complete(){if(!this.isStopped){const{_parentSubscriber:e}=this;if(this._complete){const t=()=>this._complete.call(this._context);Ze.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(),Ze.useDeprecatedSynchronousErrorHandling)throw i;Tt(i)}}__tryOrSetError(e,t,i){if(!Ze.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{t.call(this._context,i)}catch(r){return Ze.useDeprecatedSynchronousErrorHandling?(e.syncErrorValue=r,e.syncErrorThrown=!0,!0):(Tt(r),!0)}return!1}_unsubscribe(){const{_parentSubscriber:e}=this;this._context=null,this._parentSubscriber=null,e.unsubscribe()}}const vi="function"==typeof Symbol&&Symbol.observable||"@@observable";function bi(n){return n}function Mr(...n){return Ve(n)}function Ve(n){return 0===n.length?bi:1===n.length?n[0]:function(t){return n.reduce((i,r)=>r(i),t)}}let ce=(()=>{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 xt)return n;if(n[He])return n[He]()}return n||e||t?new xt(n,e,t):new xt(Ft)}(t,i,r);if(o.add(s?s.call(o,this.source):this.source||Ze.useDeprecatedSynchronousErrorHandling&&!o.syncErrorThrowable?this._subscribe(o):this._trySubscribe(o)),Ze.useDeprecatedSynchronousErrorHandling&&o.syncErrorThrowable&&(o.syncErrorThrowable=!1,o.syncErrorThrown))throw o.syncErrorValue;return o}_trySubscribe(t){try{return this._subscribe(t)}catch(i){Ze.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 xt?t:null}return!0}(t)?t.error(i):console.warn(i)}}forEach(t,i){return new(i=zt(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)}[vi](){return this}pipe(...t){return 0===t.length?this:Ve(t)(this)}toPromise(t){return new(t=zt(t))((i,r)=>{let s;this.subscribe(o=>s=o,o=>r(o),()=>i(s))})}}return n.create=e=>new n(e),n})();function zt(n){if(n||(n=Ze.Promise||Promise),!n)throw new Error("no Promise impl found");return n}const Qt=(()=>{function n(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return n.prototype=Object.create(Error.prototype),n})();class li extends Te{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 Pi extends xt{constructor(e){super(e),this.destination=e}}let Se=(()=>{class n extends ce{constructor(){super(),this.observers=[],this.closed=!1,this.isStopped=!1,this.hasError=!1,this.thrownError=null}[He](){return new Pi(this)}lift(t){const i=new pn(this,this);return i.operator=t,i}next(t){if(this.closed)throw new Qt;if(!this.isStopped){const{observers:i}=this,r=i.length,s=i.slice();for(let o=0;onew pn(e,t),n})();class pn extends Se{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):Te.EMPTY}}function Gn(n){return n&&"function"==typeof n.schedule}function Ae(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 Ri(n,e))}}class Ri{constructor(e,t){this.project=e,this.thisArg=t}call(e,t){return t.subscribe(new jt(e,this.project,this.thisArg))}}class jt extends xt{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 xr=n=>e=>{for(let t=0,i=n.length;tn&&"number"==typeof n.length&&"function"!=typeof n;function Ye(n){return!!n&&"function"!=typeof n.subscribe&&"function"==typeof n.then}const ki=n=>{if(n&&"function"==typeof n[vi])return(n=>e=>{const t=n[vi]();if("function"!=typeof t.subscribe)throw new TypeError("Provided object does not correctly implement Symbol.observable");return t.subscribe(e)})(n);if(pt(n))return xr(n);if(Ye(n))return(n=>e=>(n.then(t=>{e.closed||(e.next(t),e.complete())},t=>e.error(t)).then(null,Tt),e))(n);if(n&&"function"==typeof n[cs])return(n=>e=>{const t=n[cs]();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 ${_e(n)?"an invalid object":`'${n}'`} where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.`;throw new TypeError(t)}};function Fi(n,e){return new ce(t=>{const i=new Te;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 ui(n,e){return e?function(n,e){if(null!=n){if(function(n){return n&&"function"==typeof n[vi]}(n))return function(n,e){return new ce(t=>{const i=new Te;return i.add(e.schedule(()=>{const r=n[vi]();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(Ye(n))return function(n,e){return new ce(t=>{const i=new Te;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(pt(n))return Fi(n,e);if(function(n){return n&&"function"==typeof n[cs]}(n)||"string"==typeof n)return function(n,e){if(!n)throw new Error("Iterable cannot be null");return new ce(t=>{const i=new Te;let r;return i.add(()=>{r&&"function"==typeof r.return&&r.return()}),i.add(e.schedule(()=>{r=n[cs](),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 ce?n:new ce(ki(n))}class Gr extends xt{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 ii extends xt{notifyNext(e){this.destination.next(e)}notifyError(e){this.destination.error(e)}notifyComplete(){this.destination.complete()}}function co(n,e){if(e.closed)return;if(n instanceof ce)return n.subscribe(e);let t;try{t=ki(n)(e)}catch(i){e.error(i)}return t}function di(n,e,t=Number.POSITIVE_INFINITY){return"function"==typeof e?i=>i.pipe(di((r,s)=>ui(n(r,s)).pipe(Ae((o,a)=>e(r,o,s,a))),t)):("number"==typeof e&&(t=e),i=>i.lift(new Oh(n,t)))}class Oh{constructor(e,t=Number.POSITIVE_INFINITY){this.project=e,this.concurrent=t}call(e,t){return t.subscribe(new El(e,this.project,this.concurrent))}}class El extends ii{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 uo(n=Number.POSITIVE_INFINITY){return di(bi,n)}function za(n,e){return e?Fi(n,e):new ce(xr(n))}function Ni(...n){let e=Number.POSITIVE_INFINITY,t=null,i=n[n.length-1];return Gn(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 ce?n[0]:uo(e)(za(n,t))}function us(){return function(e){return e.lift(new ho(e))}}class ho{constructor(e){this.connectable=e}call(e,t){const{connectable:i}=this;i._refCount++;const r=new gc(e,i),s=t.subscribe(r);return r.closed||(r.connection=i.connect()),s}}class gc extends xt{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 Sl extends ce{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 Te,e.add(this.source.subscribe(new pu(this.getSubject(),this))),e.closed&&(this._connection=null,e=Te.EMPTY)),e}refCount(){return us()(this)}}const fu=(()=>{const n=Sl.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 pu extends Pi{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()}}}function mc(n,e){return function(i){let r;if(r="function"==typeof n?n:function(){return n},"function"==typeof e)return i.lift(new pd(r,e));const s=Object.create(i,fu);return s.source=i,s.subjectFactory=r,s}}class pd{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 mu(){return new Se}function Vs(){return n=>us()(mc(mu)(n))}function Je(n){for(let e in n)if(n[e]===Je)return e;throw Error("Could not find renamed property on target object.")}function _u(n,e){for(const t in e)e.hasOwnProperty(t)&&!n.hasOwnProperty(t)&&(n[t]=e[t])}function W(n){if("string"==typeof n)return n;if(Array.isArray(n))return"["+n.map(W).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 Y(n,e){return null==n||""===n?null===e?"":e:null==e||""===e?n:n+" "+e}const J=Je({__forward_ref__:Je});function T(n){return n.__forward_ref__=T,n.toString=function(){return W(this())},n}function D(n){return B(n)?n():n}function B(n){return"function"==typeof n&&n.hasOwnProperty(J)&&n.__forward_ref__===T}class $ extends Error{constructor(e,t){super(function(n,e){return`${n?`NG0${n}: `:""}${e}`}(e,t)),this.code=e}}function pe(n){return"string"==typeof n?n:null==n?"":String(n)}function Ge(n){return"function"==typeof n?n.name||n.toString():"object"==typeof n&&null!=n&&"function"==typeof n.type?n.type.name||n.type.toString():pe(n)}function Et(n,e){const t=e?` in ${e}`:"";throw new $("201",`No provider for ${Ge(n)} found${t}`)}function Gi(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 ue(n){return{token:n.token,providedIn:n.providedIn||null,factory:n.factory,value:void 0}}function Me(n){return{providers:n.providers||[],imports:n.imports||[]}}function rr(n){return vc(n,ua)||vc(n,Ua)}function vc(n,e){return n.hasOwnProperty(e)?n[e]:null}function Cu(n){return n&&(n.hasOwnProperty(Tl)||n.hasOwnProperty(Sp))?n[Tl]:null}const ua=Je({\u0275prov:Je}),Tl=Je({\u0275inj:Je}),Ua=Je({ngInjectableDef:Je}),Sp=Je({ngInjectorDef:Je});var At=(()=>((At=At||{})[At.Default=0]="Default",At[At.Host=1]="Host",At[At.Self=2]="Self",At[At.SkipSelf=4]="SkipSelf",At[At.Optional=8]="Optional",At))();let Al;function da(n){const e=Al;return Al=n,e}function md(n,e,t){const i=rr(n);return i&&"root"==i.providedIn?void 0===i.value?i.value=i.factory():i.value:t&At.Optional?null:void 0!==e?e:void Et(W(n),"Injector")}function F(n){return{toString:n}.toString()}var j=(()=>((j=j||{})[j.OnPush=0]="OnPush",j[j.Default=1]="Default",j))(),Ue=(()=>((Ue=Ue||{})[Ue.Emulated=0]="Emulated",Ue[Ue.None=2]="None",Ue[Ue.ShadowDom=3]="ShadowDom",Ue))();const vn="undefined"!=typeof globalThis&&globalThis,dr="undefined"!=typeof window&&window,yr="undefined"!=typeof self&&"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&self,Wr="undefined"!=typeof global&&global,cn=vn||Wr||dr||yr,_d={},mi=[],xp=Je({\u0275cmp:Je}),d_=Je({\u0275dir:Je}),Ph=Je({\u0275pipe:Je}),b0=Je({\u0275mod:Je}),xx=Je({\u0275loc:Je}),Dl=Je({\u0275fac:Je}),Rh=Je({__NG_ELEMENT_ID__:Je});let Tx=0;function Ne(n){return F(()=>{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===j.OnPush,directiveDefs:null,pipeDefs:null,selectors:n.selectors||mi,viewQuery:n.viewQuery||null,features:n.features||null,data:n.data||{},encapsulation:n.encapsulation||Ue.Emulated,id:"c",styles:n.styles||mi,_:null,setInput:null,schemas:n.schemas||null,tView:null},r=n.directives,s=n.features,o=n.pipes;return i.id+=Tx++,i.inputs=S0(n.inputs,t),i.outputs=S0(n.outputs),s&&s.forEach(a=>a(i)),i.directiveDefs=r?()=>("function"==typeof r?r():r).map(C0):null,i.pipeDefs=o?()=>("function"==typeof o?o():o).map(w0):null,i})}function C0(n){return Kn(n)||function(n){return n[d_]||null}(n)}function w0(n){return function(n){return n[Ph]||null}(n)}const E0={};function Pe(n){return F(()=>{const e={type:n.type,bootstrap:n.bootstrap||mi,declarations:n.declarations||mi,imports:n.imports||mi,exports:n.exports||mi,transitiveCompileScopes:null,schemas:n.schemas||null,id:n.id||null};return null!=n.id&&(E0[n.id]=n.type),e})}function S0(n,e){if(null==n)return _d;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 oe=Ne;function ds(n){return{type:n.type,name:n.name,factory:null,pure:!1!==n.pure,onDestroy:n.type.prototype.ngOnDestroy||null}}function Kn(n){return n[xp]||null}function po(n,e){const t=n[b0]||null;if(!t&&!0===e)throw new Error(`Type ${W(n)} does not have '\u0275mod' property.`);return t}function Fo(n){return Array.isArray(n)&&"object"==typeof n[1]}function No(n){return Array.isArray(n)&&!0===n[1]}function p_(n){return 0!=(8&n.flags)}function Cd(n){return 2==(2&n.flags)}function wd(n){return 1==(1&n.flags)}function pa(n){return null!==n.template}function M0(n){return 0!=(512&n[2])}function wc(n,e){return n.hasOwnProperty(Dl)?n[Dl]:null}class y_{constructor(e,t,i){this.previousValue=e,this.currentValue=t,this.firstChange=i}isFirstChange(){return this.firstChange}}function zn(){return A0}function A0(n){return n.type.prototype.ngOnChanges&&(n.setInput=Fx),kx}function kx(){const n=q(this),e=null==n?void 0:n.current;if(e){const t=n.previous;if(t===_d)n.previous=e;else for(let i in e)t[i]=e[i];n.current=null,this.ngOnChanges(e)}}function Fx(n,e,t,i){const r=q(n)||function(n,e){return n[Vh]=e}(n,{previous:_d,current:null}),s=r.current||(r.current={}),o=r.previous,a=this.declaredInputs[t],l=o[a];s[a]=new y_(l&&l.currentValue,e,o===_d),n[i]=e}zn.ngInherit=!0;const Vh="__ngSimpleChanges__";function q(n){return n[Vh]||null}const Wn="http://www.w3.org/2000/svg";let fi;function Ii(n){return!!n.listen}const Su={createRenderer:(n,e)=>void 0!==fi?fi:"undefined"!=typeof document?document:void 0};function qi(n){for(;Array.isArray(n);)n=n[0];return n}function zh(n,e){return qi(e[n])}function Ts(n,e){return qi(e[n.index])}function C_(n,e){return n.data[e]}function Ed(n,e){return n[e]}function fs(n,e){const t=e[n];return Fo(t)?t:t[0]}function Pl(n){return 4==(4&n[2])}function Sd(n){return 128==(128&n[2])}function ma(n,e){return null==e?null:n[e]}function w_(n){n[18]=0}function Dp(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 Yt={lFrame:xu(null),bindingsEnabled:!0,isInCheckNoChangesMode:!1};function O0(){return Yt.bindingsEnabled}function Oe(){return Yt.lFrame.lView}function Dn(){return Yt.lFrame.tView}function en(n){return Yt.lFrame.contextLView=n,n[8]}function Dr(){let n=E_();for(;null!==n&&64===n.type;)n=n.parent;return n}function E_(){return Yt.lFrame.currentTNode}function Ga(n,e){const t=Yt.lFrame;t.currentTNode=n,t.isParent=e}function pr(){return Yt.lFrame.isParent}function Lr(){Yt.lFrame.isParent=!1}function Hh(){return Yt.isInCheckNoChangesMode}function Ip(n){Yt.isInCheckNoChangesMode=n}function Yr(){const n=Yt.lFrame;let e=n.bindingRootIndex;return-1===e&&(e=n.bindingRootIndex=n.tView.bindingStartIndex),e}function Us(){return Yt.lFrame.bindingIndex}function _a(){return Yt.lFrame.bindingIndex++}function mo(n){const e=Yt.lFrame,t=e.bindingIndex;return e.bindingIndex=e.bindingIndex+n,t}function Md(n,e){const t=Yt.lFrame;t.bindingIndex=t.bindingRootIndex=n,S_(e)}function S_(n){Yt.lFrame.currentDirectiveIndex=n}function M_(n){const e=Yt.lFrame.currentDirectiveIndex;return-1===e?null:n[e]}function I0(){return Yt.lFrame.currentQueryIndex}function x_(n){Yt.lFrame.currentQueryIndex=n}function Rp(n){const e=n[1];return 2===e.type?e.declTNode:1===e.type?n[6]:null}function xd(n,e,t){if(t&At.SkipSelf){let r=e,s=n;for(;!(r=r.parent,null!==r||t&At.Host||(r=Rp(s),null===r||(s=s[15],10&r.type))););if(null===r)return!1;e=r,n=s}const i=Yt.lFrame=O();return i.currentTNode=e,i.lView=n,!0}function Wh(n){const e=O(),t=n[1];Yt.lFrame=e,e.currentTNode=t.firstChild,e.lView=n,e.tView=t,e.contextLView=n,e.bindingIndex=t.bindingStartIndex,e.inI18n=!1}function O(){const n=Yt.lFrame,e=null===n?null:n.child;return null===e?xu(n):e}function xu(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 qh(){const n=Yt.lFrame;return Yt.lFrame=n.parent,n.currentTNode=null,n.lView=null,n}const _o=qh;function Cn(){const n=qh();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 As(){return Yt.lFrame.selectedIndex}function Hs(n){Yt.lFrame.selectedIndex=n}function sr(){const n=Yt.lFrame;return C_(n.tView,n.selectedIndex)}function kp(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 Yh{constructor(e,t,i){this.factory=e,this.resolving=!1,this.canSeeViewProviders=t,this.injectImpl=i}}function Lp(n,e,t){const i=Ii(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 Ad=!0;function Bp(n){const e=Ad;return Ad=n,e}let P_=0;function ps(n,e){const t=Vp(n,e);if(-1!==t)return t;const i=e[1];i.firstCreatePass&&(n.injectorIndex=e.length,R_(i.data,n),R_(e,null),R_(i.blueprint,null));const r=Kh(n,e),s=n.injectorIndex;if(F0(r)){const o=Td(r),a=qa(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 R_(n,e){n.push(0,0,0,0,0,0,0,0,e)}function Vp(n,e){return-1===n.injectorIndex||n.parent&&n.parent.injectorIndex===n.injectorIndex||null===e[n.injectorIndex+8]?-1:n.injectorIndex}function Kh(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 Sc(n,e,t){!function(n,e,t){let i;"string"==typeof t?i=t.charCodeAt(0)||0:t.hasOwnProperty(Rh)&&(i=t[Rh]),null==i&&(i=t[Rh]=P_++);const r=255&i;e.data[n+(r>>5)]|=1<=0?255&e:V0:e}(t);if("function"==typeof s){if(!xd(e,n,i))return i&At.Host?k_(r,t,i):L0(e,t,i,r);try{const o=s(i);if(null!=o||i&At.Optional)return o;Et(t)}finally{_o()}}else if("number"==typeof s){let o=null,a=Vp(n,e),l=-1,c=i&At.Host?e[16][6]:null;for((-1===a||i&At.SkipSelf)&&(l=-1===a?Kh(n,e):e[a+8],-1!==l&&Qh(i,!1)?(o=e[1],a=Td(l),e=qa(l,e)):a=-1);-1!==a;){const d=e[1];if(zp(s,a,d.data)){const f=Xr(a,e,t,o,i,c);if(f!==B0)return f}l=e[a+8],-1!==l&&Qh(i,e[1].data[a+8]===c)&&zp(s,a,e)?(o=d,a=Td(l),e=qa(l,e)):a=-1}}}return L0(e,t,i,r)}const B0={};function V0(){return new Bo(Dr(),Oe())}function Xr(n,e,t,i,r,s){const o=e[1],a=o.data[n+8],d=Dd(a,o,t,null==i?Cd(a)&&Ad:i!=o&&0!=(3&a.type),r&At.Host&&s===a);return null!==d?Od(e,o,d,a):B0}function Dd(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&&pa(g)&&g.type===t)return l}return null}function Od(n,e,t,i){let r=n[t];const s=e.data;if(function(n){return n instanceof Yh}(r)){const o=r;o.resolving&&function(n,e){throw new $("200",`Circular dependency in DI detected for ${n}`)}(Ge(s[t]));const a=Bp(o.canSeeViewProviders);o.resolving=!0;const l=o.injectImpl?da(o.injectImpl):null;xd(n,i,At.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=A0(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&&da(l),Bp(a),o.resolving=!1,_o()}}return r}function zp(n,e,t){return!!(t[e+(n>>5)]&1<{const e=n.prototype.constructor,t=e[Dl]||Kr(e),i=Object.prototype;let r=Object.getPrototypeOf(n.prototype).constructor;for(;r&&r!==i;){const s=r[Dl]||Kr(r);if(s&&s!==t)return s;r=Object.getPrototypeOf(r)}return s=>new s})}function Kr(n){return B(n)?()=>{const e=Kr(D(n));return e&&e()}:wc(n)}function Zr(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{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(Pd)?l[Pd]:Object.defineProperty(l,Pd,{value:[]})[Pd];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 ve{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=ue({token:this,providedIn:t.providedIn||"root",factory:t.factory}))}toString(){return`InjectionToken ${this._desc}`}}const Du=Function;function Vo(n,e){void 0===e&&(e=n);for(let t=0;tArray.isArray(t)?zo(t,e):e(t))}function ef(n,e,t){e>=n.length?n.push(t):n.splice(e,0,t)}function kl(n,e){return e>=n.length-1?n.pop():n.splice(e,1)[0]}function xc(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 z_(n,e){const t=Qr(n,e);if(t>=0)return n[1|t]}function Qr(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):W(a)))}r=`{${s.join(", ")}}`}return`${t}${i?"("+i+")":""}[${r}]: ${n.replace(Dc,"\n ")}`}("\n"+n.message,r,t,i),n.ngTokenPath=r,n[Ac]=null,n}const Ld=Nd(ba("Inject",n=>({token:n})),-1),br=Nd(ba("Optional"),8),Za=Nd(ba("SkipSelf"),4);let Vd;function Nu(n){var e;return(null===(e=function(){if(void 0===Vd&&(Vd=null,cn.trustedTypes))try{Vd=cn.trustedTypes.createPolicy("angular",{createHTML:n=>n,createScript:n=>n,createScriptURL:n=>n})}catch(n){}return Vd}())||void 0===e?void 0:e.createHTML(n))||n}class Bl{constructor(e){this.changingThisBreaksApplicationSecurity=e}toString(){return`SafeValue must use [property]=binding: ${this.changingThisBreaksApplicationSecurity} (see https://g.co/ng/security#xss)`}}class W_ extends Bl{getTypeName(){return"HTML"}}class q_ extends Bl{getTypeName(){return"Style"}}class Jp extends Bl{getTypeName(){return"Script"}}class zd extends Bl{getTypeName(){return"URL"}}class Ut extends Bl{getTypeName(){return"ResourceURL"}}function gs(n){return n instanceof Bl?n.changingThisBreaksApplicationSecurity:n}function jo(n,e){const t=Pc(n);if(null!=t&&t!==e){if("ResourceURL"===t&&"URL"===e)return!0;throw new Error(`Required a safe ${e}, got a ${t} (see https://g.co/ng/security#xss)`)}return t===e}function Pc(n){return n instanceof Bl&&n.getTypeName()||null}class iC{constructor(e){this.inertDocumentHelper=e}getInertBodyElement(e){e=""+e;try{const t=(new window.DOMParser).parseFromString(Nu(e),"text/html").body;return null===t?this.inertDocumentHelper.getInertBodyElement(e):(t.removeChild(t.firstChild),t)}catch(t){return null}}}class f1{constructor(e){if(this.defaultDoc=e,this.inertDocument=this.defaultDoc.implementation.createHTMLDocument("sanitization-inert"),null==this.inertDocument.body){const t=this.inertDocument.createElement("html");this.inertDocument.appendChild(t);const i=this.inertDocument.createElement("body");t.appendChild(i)}}getInertBodyElement(e){const t=this.inertDocument.createElement("template");if("content"in t)return t.innerHTML=Nu(e),t;const i=this.inertDocument.createElement("body");return i.innerHTML=Nu(e),this.defaultDoc.documentMode&&this.stripCustomNsAttrs(i),i}stripCustomNsAttrs(e){const t=e.attributes;for(let r=t.length-1;0bo(e.trim())).join(", ")}function Uo(n){const e={};for(const t of n.split(","))e[t]=!0;return e}function nf(...n){const e={};for(const t of n)for(const i in t)t.hasOwnProperty(i)&&(e[i]=!0);return e}const eg=Uo("area,br,col,hr,img,wbr"),sC=Uo("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr"),oC=Uo("rp,rt"),X_=nf(eg,nf(sC,Uo("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")),nf(oC,Uo("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")),nf(oC,sC)),K_=Uo("background,cite,href,itemtype,longdesc,poster,src,xlink:href"),Z_=Uo("srcset"),Q_=nf(K_,Z_,Uo("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"),Uo("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")),v1=Uo("script,style,template");class J_{constructor(){this.sanitizedSomething=!1,this.buf=[]}sanitizeChildren(e){let t=e.firstChild,i=!0;for(;t;)if(t.nodeType===Node.ELEMENT_NODE?i=this.startElement(t):t.nodeType===Node.TEXT_NODE?this.chars(t.nodeValue):this.sanitizedSomething=!0,i&&t.firstChild)t=t.firstChild;else for(;t;){t.nodeType===Node.ELEMENT_NODE&&this.endElement(t);let r=this.checkClobberedElement(t,t.nextSibling);if(r){t=r;break}t=this.checkClobberedElement(t,t.parentNode)}return this.buf.join("")}startElement(e){const t=e.nodeName.toLowerCase();if(!X_.hasOwnProperty(t))return this.sanitizedSomething=!0,!v1.hasOwnProperty(t);this.buf.push("<"),this.buf.push(t);const i=e.attributes;for(let r=0;r"),!0}endElement(e){const t=e.nodeName.toLowerCase();X_.hasOwnProperty(t)&&!eg.hasOwnProperty(t)&&(this.buf.push(""))}chars(e){this.buf.push(ng(e))}checkClobberedElement(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: ${e.outerHTML}`);return t}}const aC=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,rf=/([^\#-~ |!])/g;function ng(n){return n.replace(/&/g,"&").replace(aC,function(e){return"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";"}).replace(rf,function(e){return"&#"+e.charCodeAt(0)+";"}).replace(//g,">")}let sf;function ey(n,e){let t=null;try{sf=sf||function(n){const e=new f1(n);return function(){try{return!!(new window.DOMParser).parseFromString(Nu(""),"text/html")}catch(n){return!1}}()?new iC(e):e}(n);let i=e?String(e):"";t=sf.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=t.innerHTML,t=sf.getInertBodyElement(i)}while(i!==s);return Nu((new J_).sanitizeChildren(jd(t)||t))}finally{if(t){const i=jd(t)||t;for(;i.firstChild;)i.removeChild(i.firstChild)}}}function jd(n){return"content"in n&&function(n){return n.nodeType===Node.ELEMENT_NODE&&"TEMPLATE"===n.nodeName}(n)?n.content:null}var mn=(()=>((mn=mn||{})[mn.NONE=0]="NONE",mn[mn.HTML=1]="HTML",mn[mn.STYLE=2]="STYLE",mn[mn.SCRIPT=3]="SCRIPT",mn[mn.URL=4]="URL",mn[mn.RESOURCE_URL=5]="RESOURCE_URL",mn))();function Ud(n){const e=function(){const n=Oe();return n&&n[12]}();return e?e.sanitize(mn.URL,n)||"":jo(n,"URL")?gs(n):bo(pe(n))}const iy="__ngContext__";function Jr(n,e){n[iy]=e}function ry(n){const e=function(n){return n[iy]||null}(n);return e?Array.isArray(e)?e:e.lView:null}function ig(n){return n.ngOriginalError}function P1(n,...e){n.error(...e)}class $o{constructor(){this._console=console}handleError(e){const t=this._findOriginalError(e),i=this._findContext(e),r=function(n){return n&&n.ngErrorLogger||P1}(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(ig(e)):null}_findOriginalError(e){let t=e&&ig(e);for(;t&&ig(t);)t=ig(t);return t||null}}const yC=(()=>("undefined"!=typeof requestAnimationFrame&&requestAnimationFrame||setTimeout).bind(cn))();function ly(n){return n.ownerDocument.defaultView}function sg(n){return n.ownerDocument}function Ja(n){return n instanceof Function?n():n}var Co=(()=>((Co=Co||{})[Co.Important=1]="Important",Co[Co.DashCase=2]="DashCase",Co))();function uy(n,e){return undefined(n,e)}function lf(n){const e=n[3];return No(e)?e[3]:e}function $d(n){return EC(n[13])}function hy(n){return EC(n[4])}function EC(n){for(;null!==n&&!No(n);)n=n[4];return n}function Gd(n,e,t,i,r){if(null!=i){let s,o=!1;No(i)?s=i:Fo(i)&&(o=!0,i=i[0]);const a=qi(i);0===n&&null!==t?null==r?AC(e,t,a):el(e,t,a,r||null,!0):1===n&&null!==t?el(e,t,a,r||null,!0):2===n?function(n,e,t){const i=ag(n,e);i&&function(n,e,t,i){Ii(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!==qi(t)&&Gd(e,n,i,s,r);for(let a=10;a0&&(n[t-1][4]=i[4]);const s=kl(n,10+e);!function(n,e){Wd(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 my(n,e){if(!(256&e[2])){const t=e[11];Ii(t)&&t.destroyNode&&Wd(n,e,t,3,null,null),function(n){let e=n[13];if(!e)return og(n[1],n);for(;e;){let t=null;if(Fo(e))t=e[13];else{const i=e[10];i&&(t=i)}if(!t){for(;e&&!e[4]&&e!==n;)Fo(e)&&og(e[1],e),e=e[3];null===e&&(e=n),Fo(e)&&og(e[1],e),t=e&&e[4]}e=t}}(e)}}function og(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!==uf(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 iT(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+=jC(s,r),r=""),i=o,s=s||!wa(i);t++}return""!==r&&(e+=jC(s,r)),e}const kt={};function G(n){UC(Dn(),Oe(),As()+n,Hh())}function UC(n,e,t,i){if(!i)if(3==(3&e[2])){const s=n.preOrderCheckHooks;null!==s&&Fp(e,s,t)}else{const s=n.preOrderHooks;null!==s&&Np(e,s,0,t)}Hs(t)}function tl(n,e){return n<<17|e<<2}function Bt(n){return n>>17&32767}function Yi(n){return 2|n}function Vl(n){return(131068&n)>>2}function nl(n,e){return-131069&n|e<<2}function wy(n){return 1|n}function ZC(n,e){const t=n.contentQueries;if(null!==t)for(let i=0;i20&&UC(n,e,20,Hh()),t(i,r)}finally{Hs(s)}}function JC(n,e,t){if(p_(e)){const r=e.directiveEnd;for(let s=e.directiveStart;s0;){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 lw(n,e){null!==n.hostBindings&&n.hostBindings(1,e)}function cw(n,e){e.flags|=2,(n.components||(n.components=[])).push(e.index)}function IT(n,e,t){if(t){if(e.exportAs)for(let i=0;i0&&ky(t)}}function ky(n){for(let i=$d(n);null!==i;i=hy(i))for(let r=10;r0&&ky(s)}const t=n[1].components;if(null!==t)for(let i=0;i0&&ky(r)}}function BT(n,e){const t=fs(e,n),i=t[1];(function(n,e){for(let t=e.length;tPromise.resolve(null))();function hw(n){return n[7]||(n[7]=[])}function _g(n){return n.cleanup||(n.cleanup=[])}function Vy(n,e,t){return(null===n||pa(n))&&(t=function(n){for(;Array.isArray(n);){if("object"==typeof n[1])return n;n=n[0]}return null}(t[e.index])),t[11]}function zy(n,e){const t=n[9],i=t?t.get($o,null):null;i&&i.handleError(e)}function fw(n,e,t,i,r){for(let s=0;sthis.processProvider(a,e,t)),zo([e],a=>this.processInjectorType(a,[],s)),this.records.set(Fc,zu(void 0,this));const o=this.records.get(Vu);this.scope=null!=o?o.value:null,this.source=r||("object"==typeof e?null:W(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=Pu,i=At.Default){this.assertNotDestroyed();const r=Fd(this),s=da(void 0);try{if(!(i&At.SkipSelf)){let a=this.records.get(e);if(void 0===a){const l=function(n){return"function"==typeof n||"object"==typeof n&&n instanceof ve}(e)&&rr(e);a=l&&this.injectableDefInScope(l)?zu(Gy(e),gf):null,this.records.set(e,a)}if(null!=a)return this.hydrate(e,a)}return(i&At.Self?pw():this.parent).get(e,t=i&At.Optional&&t===Pu?null:t)}catch(o){if("NullInjectorError"===o.name){if((o[Ac]=o[Ac]||[]).unshift(W(e)),r)throw o;return Ds(o,e,"R3InjectorError",this.source)}throw o}finally{da(s),Fd(r)}}_resolveInjectorDefTypes(){this.injectorDefTypes.forEach(e=>this.get(e))}toString(){const e=[];return this.records.forEach((i,r)=>e.push(W(r))),`R3Injector[${e.join(", ")}]`}assertNotDestroyed(){if(this._destroyed)throw new Error("Injector has already been destroyed.")}processInjectorType(e,t,i){if(!(e=D(e)))return!1;let r=Cu(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=Cu(s)),null==r)return!1;if(null!=r.imports&&!a){let d;i.push(o);try{zo(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||mi))}}this.injectorDefTypes.add(o);const l=wc(o)||(()=>new o);this.records.set(o,zu(l,gf));const c=r.providers;if(null!=c&&!a){const d=e;zo(c,f=>this.processProvider(f,d,c))}return void 0!==s&&void 0!==e.providers}processProvider(e,t,i){let r=Nc(e=D(e))?e:D(e&&e.provide);const s=function(n,e,t){return _w(n)?zu(void 0,n.useValue):zu(mw(n),gf)}(e);if(Nc(e)||!0!==e.multi)this.records.get(r);else{let o=this.records.get(r);o||(o=zu(void 0,gf,!0),o.factory=()=>ku(o.multi),this.records.set(r,o)),r=e,o.multi.push(e)}this.records.set(r,s)}hydrate(e,t){return t.value===gf&&(t.value=GT,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=D(e.providedIn);return"string"==typeof t?"any"===t||t===this.scope:this.injectorDefTypes.has(t)}}function Gy(n){const e=rr(n),t=null!==e?e.factory:wc(n);if(null!==t)return t;if(n instanceof ve)throw new Error(`Token ${W(n)} is missing a \u0275prov definition.`);if(n instanceof Function)return function(n){const e=n.length;if(e>0){const i=xc(e,"?");throw new Error(`Can't resolve all parameters for ${W(n)}: (${i.join(", ")}).`)}const t=function(n){const e=n&&(n[ua]||n[Ua]);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 mw(n,e,t){let i;if(Nc(n)){const r=D(n);return wc(r)||Gy(r)}if(_w(n))i=()=>D(n.useValue);else if(function(n){return!(!n||!n.useFactory)}(n))i=()=>n.useFactory(...ku(n.deps||[]));else if(function(n){return!(!n||!n.useExisting)}(n))i=()=>I(D(n.useExisting));else{const r=D(n&&(n.useClass||n.provide));if(!function(n){return!!n.deps}(n))return wc(r)||Gy(r);i=()=>new r(...ku(n.deps))}return i}function zu(n,e,t=!1){return{factory:n,value:e,multi:t?[]:void 0}}function _w(n){return null!==n&&"object"==typeof n&&Wp in n}function Nc(n){return"function"==typeof n}const yw=function(n,e,t){return function(n,e=null,t=null,i){const r=gw(n,e,t,i);return r._resolveInjectorDefTypes(),r}({name:t},e,n,t)};class Nt{static create(e,t){return Array.isArray(e)?yw(e,t,""):yw(e.providers,e.parent,e.name||"")}}function m7(n,e){kp(ry(n)[1],Dr())}function ct(n){let e=function(n){return Object.getPrototypeOf(n.prototype).constructor}(n.type),t=!0;const i=[n];for(;e;){let r;if(pa(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=oA(n.inputs),o.declaredInputs=oA(n.declaredInputs),o.outputs=oA(n.outputs);const a=r.hostBindings;a&&b7(n,a);const l=r.viewQuery,c=r.contentQueries;if(l&&y7(n,l),c&&v7(n,c),_u(n.inputs,r.inputs),_u(n.declaredInputs,r.declaredInputs),_u(n.outputs,r.outputs),pa(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=Xh(r.hostAttrs,t=Xh(t,r.hostAttrs))}}(i)}function oA(n){return n===_d?{}:n===mi?[]:n}function y7(n,e){const t=n.viewQuery;n.viewQuery=t?(i,r)=>{e(i,r),t(i,r)}:e}function v7(n,e){const t=n.contentQueries;n.contentQueries=t?(i,r,s)=>{e(i,r,s),t(i,r,s)}:e}function b7(n,e){const t=n.hostBindings;n.hostBindings=t?(i,r)=>{e(i,r),t(i,r)}:e}Nt.THROW_IF_NOT_FOUND=Pu,Nt.NULL=new Ps,Nt.\u0275prov=ue({token:Nt,providedIn:"any",factory:()=>I(Fc)}),Nt.__NG_ELEMENT_ID__=-1;let Ew=null;function vg(){if(!Ew){const n=cn.Symbol;if(n&&n.iterator)Ew=n.iterator;else{const e=Object.getOwnPropertyNames(Map.prototype);for(let t=0;ta(qi(N[i.index])):i.index;if(Ii(t)){let N=null;if(!a&&l&&(N=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!==N)(N.__ngLastListenerFn__||N).__ngNextListenerFn__=s,N.__ngLastListenerFn__=s,g=!1;else{s=fA(i,e,f,s,!1);const V=t.listen(C,r,s);p.push(s,V),d&&d.push(r,x,w,w+1)}}else s=fA(i,e,f,s,!0),C.addEventListener(r,s,o),p.push(s),d&&d.push(r,x,w,o)}else s=fA(i,e,f,s,!1);const _=i.outputs;let y;if(g&&null!==_&&(y=_[r])){const v=y.length;if(v)for(let C=0;C0;)e=e[15],n--;return e}(n,Yt.lFrame.contextLView))[8]}(n)}function J7(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 ts={textEnd:0,key:0,keyEnd:0,value:0,valueEnd:0};function FN(n){return n.substring(ts.key,ts.keyEnd)}function NN(n,e){const t=ts.textEnd;return t===e?-1:(e=ts.keyEnd=function(n,e,t){for(;e32;)e++;return e}(n,ts.key=e,t),Ig(n,e,t))}function Ig(n,e,t){for(;e=0;t=NN(e,t))yo(n,FN(e),!0)}function $l(n,e,t,i){const r=Oe(),s=Dn(),o=mo(2);s.firstUpdatePass&&UN(s,n,o,i),e!==kt&&qs(r,o,e)&&$N(s,s.data[As()],r,r[11],n,r[o+1]=function(n,e){return null==n||("string"==typeof e?n+=e:"object"==typeof n&&(n=W(gs(n)))),n}(e,t),i,o)}function Gl(n,e,t,i){const r=Dn(),s=mo(2);r.firstUpdatePass&&UN(r,null,s,i);const o=Oe();if(t!==kt&&qs(o,s,t)){const a=r.data[As()];if(WN(a,i)&&!jN(r,s)){let l=i?a.classesWithoutHost:a.stylesWithoutHost;null!==l&&(t=Y(l,t||"")),hA(r,a,o,t,i)}else!function(n,e,t,i,r,s,o,a){r===kt&&(r=mi);let l=0,c=0,d=0=n.expandoStartIndex}function UN(n,e,t,i){const r=n.data;if(null===r[t+1]){const s=r[As()],o=jN(n,t);WN(s,i)&&null===e&&!o&&(e=!1),e=function(n,e,t,i){const r=M_(n);let s=i?e.residualClasses:e.residualStyles;if(null===r)0===(i?e.classBindings:e.styleBindings)&&(t=ev(t=gA(null,n,e,t,i),e.attrs,i),s=null);else{const o=e.directiveStylingLast;if(-1===o||n[o]!==r)if(t=gA(r,n,e,t,i),null===s){let l=function(n,e,t){const i=t?e.classBindings:e.styleBindings;if(0!==Vl(i))return n[Bt(i)]}(n,e,i);void 0!==l&&Array.isArray(l)&&(l=gA(null,n,e,l[1],i),l=ev(l,e.attrs,i),function(n,e,t,i){n[Bt(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=Bt(n[a+1]);n[i+1]=tl(p,a),0!==p&&(n[p+1]=nl(n[p+1],i)),n[a+1]=function(n,e){return 131071&n|e<<17}(n[a+1],i)}else n[i+1]=tl(a,0),0!==a&&(n[a+1]=nl(n[a+1],i)),a=i;else n[i+1]=tl(l,0),0===a?a=i:n[l+1]=nl(n[l+1],i),l=i;c&&(n[i+1]=Yi(n[i+1])),kN(n,d,i,!0),kN(n,d,i,!1),function(n,e,t,i,r){const s=r?n.residualClasses:n.residualStyles;null!=s&&"string"==typeof e&&Qr(s,e)>=0&&(t[i+1]=wy(t[i+1]))}(e,d,n,i,s),o=tl(a,l),s?e.classBindings=o:e.styleBindings=o}(r,s,e,t,o,i)}}function gA(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===kt&&(p=f?mi:void 0);let g=f?z_(p,i):d===i?p:void 0;if(c&&!Tw(g)&&(g=z_(l,i)),Tw(g)&&(a=g,o))return a;const _=n[r+1];r=o?Bt(_):Vl(_)}if(null!==e){let l=s?e.residualClasses:e.residualStyles;null!=l&&(a=z_(l,i))}return a}function Tw(n){return void 0!==n}function WN(n,e){return 0!=(n.flags&(e?16:32))}function De(n,e=""){const t=Oe(),i=Dn(),r=n+20,s=i.firstCreatePass?Yd(i,r,1,e,null):i.data[r],o=t[r]=function(n,e){return Ii(n)?n.createText(e):n.createTextNode(e)}(t[11],e);lg(i,t,o,s),Ga(s,!1)}function xi(n){return or("",n,""),xi}function or(n,e,t){const i=Oe(),r=Cg(i,n,e,t);return r!==kt&&zl(i,As(),r),or}function Aw(n,e,t,i,r){const s=Oe(),o=function(n,e,t,i,r,s){const a=mf(n,Us(),t,r);return mo(2),a?e+pe(t)+i+pe(r)+s:kt}(s,n,e,t,i,r);return o!==kt&&zl(s,As(),o),Aw}function al(n,e,t){const i=Oe();return qs(i,_a(),e)&&wo(Dn(),sr(),i,n,e,i[11],t,!0),al}function Pg(n,e,t){const i=Oe();if(qs(i,_a(),e)){const s=Dn(),o=sr();wo(s,o,i,n,e,Vy(M_(s.data),o,i),t,!0)}return Pg}const bf=void 0;var FY=["en",[["a","p"],["AM","PM"],bf],[["AM","PM"],bf,bf],[["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"]],bf,[["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"]],bf,[["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}",bf,"{1} 'at' {0}",bf],[".",",",";","%","+","-","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 Rg={};function dL(n){return n in Rg||(Rg[n]=cn.ng&&cn.ng.common&&cn.ng.common.locales&&cn.ng.common.locales[n]),Rg[n]}var at=(()=>((at=at||{})[at.LocaleId=0]="LocaleId",at[at.DayPeriodsFormat=1]="DayPeriodsFormat",at[at.DayPeriodsStandalone=2]="DayPeriodsStandalone",at[at.DaysFormat=3]="DaysFormat",at[at.DaysStandalone=4]="DaysStandalone",at[at.MonthsFormat=5]="MonthsFormat",at[at.MonthsStandalone=6]="MonthsStandalone",at[at.Eras=7]="Eras",at[at.FirstDayOfWeek=8]="FirstDayOfWeek",at[at.WeekendRange=9]="WeekendRange",at[at.DateFormat=10]="DateFormat",at[at.TimeFormat=11]="TimeFormat",at[at.DateTimeFormat=12]="DateTimeFormat",at[at.NumberSymbols=13]="NumberSymbols",at[at.NumberFormats=14]="NumberFormats",at[at.CurrencyCode=15]="CurrencyCode",at[at.CurrencySymbol=16]="CurrencySymbol",at[at.CurrencyName=17]="CurrencyName",at[at.Currencies=18]="Currencies",at[at.Directionality=19]="Directionality",at[at.PluralCase=20]="PluralCase",at[at.ExtraData=21]="ExtraData",at))();const Dw="en-US";let hL=Dw;function mA(n){Gi(n,"Expected localeId to be defined"),"string"==typeof n&&(hL=n.toLowerCase().replace(/_/g,"-"))}function vA(n,e,t,i,r){if(n=D(n),Array.isArray(n))for(let s=0;s>20;if(Nc(n)||!n.multi){const g=new Yh(l,r,E),_=CA(a,e,r?d:d+p,f);-1===_?(Sc(ps(c,o),s,a),bA(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=CA(a,e,d+p,f),_=CA(a,e,d,d+p),y=g>=0&&t[g],v=_>=0&&t[_];if(r&&!v||!r&&!y){Sc(ps(c,o),s,a);const C=function(n,e,t,i,r){const s=new Yh(n,t,E);return s.multi=[],s.index=e,s.componentProviders=0,NL(s,r,i&&!t),s}(r?PX:IX,t.length,r,i,l);!r&&v&&(t[_].providerFactory=C),bA(s,n,e.length,0),e.push(a),c.directiveStart++,c.directiveEnd++,r&&(c.providerIndexes+=1048576),t.push(C),o.push(C)}else bA(s,n,g>-1?g:_,NL(t[r?_:g],l,!r&&i));!r&&i&&v&&t[_].componentProviders++}}}function bA(n,e,t,i){const r=Nc(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 NL(n,e,t){return t&&n.componentProviders++,n.multi.push(e)-1}function CA(n,e,t,i){for(let r=t;r{t.providersResolver=(i,r)=>function(n,e,t){const i=Dn();if(i.firstCreatePass){const r=pa(n);vA(t,i.data,i.blueprint,r,!0),vA(e,i.data,i.blueprint,r,!1)}}(i,r?r(n):n,e)}}class LL{}const VL="ngComponent";class FX{resolveComponentFactory(e){throw function(n){const e=Error(`No component factory found for ${W(n)}. Did you add it to @NgModule.entryComponents?`);return e[VL]=n,e}(e)}}class ll{}function kw(...n){}function Fg(n,e){return new rt(Ts(n,e))}ll.NULL=new FX;const BX=function(){return Fg(Dr(),Oe())};let rt=(()=>{class n{constructor(t){this.nativeElement=t}}return n.__NG_ELEMENT_ID__=BX,n})();function zL(n){return n instanceof rt?n.nativeElement:n}class Cf{}let zc=(()=>{class n{}return n.__NG_ELEMENT_ID__=()=>zX(),n})();const zX=function(){const n=Oe(),t=fs(Dr().index,n);return function(n){return n[11]}(Fo(t)?t:n)};let SA=(()=>{class n{}return n.\u0275prov=ue({token:n,providedIn:"root",factory:()=>null}),n})();class ju{constructor(e){this.full=e,this.major=e.split(".")[0],this.minor=e.split(".")[1],this.patch=e.split(".").slice(2).join(".")}}const jL=new ju("12.2.5");class UL{constructor(){}supports(e){return Ky(e)}create(e){return new $X(e)}}const HX=(n,e)=>e;class $X{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||HX}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<$L(i,r,s)?t:i,a=$L(o,r,s),l=o.currentIndex;if(o===i)r--,i=i._nextRemoved;else if(t=t._next,null==o.previousIndex)r++;else{s||(s=[]);const c=a-r,d=l-r;if(c!=d){for(let p=0;p{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 GX(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 HL),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 HL),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 GX{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 WX{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 HL{constructor(){this.map=new Map}put(e){const t=e.trackById;let i=this.map.get(t);i||(i=new WX,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 $L(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 YX(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 YX{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 WL(){return new Ng([new UL])}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||WL()),deps:[[n,new Za,new br]]}}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=ue({token:n,providedIn:"root",factory:WL}),n})();function qL(){return new Lg([new GL])}let Lg=(()=>{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||qL()),deps:[[n,new Za,new br]]}}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=ue({token:n,providedIn:"root",factory:qL}),n})();function Fw(n,e,t,i,r=!1){for(;null!==t;){const s=e[t.index];if(null!==s&&i.push(qi(s)),No(s))for(let a=10;a-1&&(gy(e,i),kl(t,i))}this._attachedToViewContainer=!1}my(this._lView[1],this._lView)}onDestroy(e){tw(this._lView[1],this._lView,null,e)}markForCheck(){Fy(this._cdRefInjectingView||this._lView)}detach(){this._lView[2]&=-129}reattach(){this._lView[2]|=128}detectChanges(){Ly(this._lView[1],this._lView,this.context)}checkNoChanges(){!function(n,e,t){Ip(!0);try{Ly(n,e,t)}finally{Ip(!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){Wd(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 KX extends sv{constructor(e){super(e),this._view=e}detectChanges(){dw(this._view)}checkNoChanges(){!function(n){Ip(!0);try{dw(n)}finally{Ip(!1)}}(this._view)}get context(){return null}}const QX=function(n){return function(n,e,t){if(Cd(n)&&!t){const i=fs(n.index,e);return new sv(i,i)}return 47&n.type?new sv(e[16],e):null}(Dr(),Oe(),16==(16&n))};let kn=(()=>{class n{}return n.__NG_ELEMENT_ID__=QX,n})();const tK=[new GL],iK=new Ng([new UL]),rK=new Lg(tK),oK=function(){return Nw(Dr(),Oe())};let Ys=(()=>{class n{}return n.__NG_ELEMENT_ID__=oK,n})();const aK=Ys,lK=class extends aK{constructor(e,t,i){super(),this._declarationLView=e,this._declarationTContainer=t,this.elementRef=i}createEmbeddedView(e){const t=this._declarationTContainer.tViews,i=hf(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)),ff(t,i,e),new sv(i)}};function Nw(n,e){return 4&n.type?new lK(e,n,Fg(n,e)):null}class jc{}const dK=function(){return ZL(Dr(),Oe())};let ns=(()=>{class n{}return n.__NG_ELEMENT_ID__=dK,n})();const fK=ns,XL=class extends fK{constructor(e,t,i){super(),this._lContainer=e,this._hostTNode=t,this._hostLView=i}get element(){return Fg(this._hostTNode,this._hostLView)}get injector(){return new Bo(this._hostTNode,this._hostLView)}get parentInjector(){const e=Kh(this._hostTNode,this._hostLView);if(F0(e)){const t=qa(e,this._hostLView),i=Td(e);return new Bo(t[1].data[i+8],t)}return new Bo(null,this._hostLView)}clear(){for(;this.length>0;)this.remove(this.length-1)}get(e){const t=KL(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(jc,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 No(n[3])}(i)){const d=this.indexOf(e);if(-1!==d)this.detach(d);else{const f=i[3],p=new XL(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),iyC});class vB extends LL{constructor(e,t){super(),this.componentDef=e,this.ngModule=t,this.componentType=e.type,this.selector=function(n){return n.map(lT).join(",")}(e.selectors),this.ngContentSelectors=e.ngContentSelectors?e.ngContentSelectors:[],this.isBoundToModule=!!t}get inputs(){return yB(this.componentDef.inputs)}get outputs(){return yB(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,jg,r);return s!==jg||i===jg?s:e.get(t,i,r)}}}(e,r.injector):e,o=s.get(Cf,Su),a=s.get(SA,null),l=o.createRenderer(null,this.componentDef),c=this.componentDef.selectors[0][0]||"div",d=i?function(n,e,t){if(Ii(n))return n.selectRootElement(e,t===Ue.ShadowDom);let i="string"==typeof e?n.querySelector(e):e;return i.textContent="",i}(l,i,this.componentDef.encapsulation):py(o.createRenderer(null,this.componentDef),c,function(n){const e=n.toLowerCase();return"svg"===e?Wn:"math"===e?"http://www.w3.org/1998/MathML/":null}(c)),f=this.componentDef.onPush?576:528,p=function(n,e){return{components:[],scheduler:n||yC,clean:HT,playerHandler:e||null,flags:0}}(),g=gg(0,null,null,1,0,null,null,null,null,null),_=hf(null,g,p,f,null,null,o,l,a,s);let y,v;Wh(_);try{const C=function(n,e,t,i,r,s){const o=t[1];t[20]=n;const l=Yd(o,20,2,"#host",null),c=l.mergedAttrs=e.hostAttrs;null!==c&&(yg(l,c,!0),null!==n&&(Lp(r,n,c),null!==l.classes&&by(r,n,l.classes),null!==l.styles&&LC(r,n,l.styles)));const d=i.createRenderer(n,e),f=hf(t,pg(e),null,e.onPush?64:16,t[20],l,i,d,s||null,null);return o.firstCreatePass&&(Sc(ps(l,t),o,e.type),cw(o,l),Iy(l,t.length,1)),mg(t,f),t[20]=f}(d,this.componentDef,_,o,l);if(d)if(i)Lp(l,d,["ng-version",jL.full]);else{const{attrs:w,classes:x}=function(n){const e=[],t=[];let i=1,r=2;for(;i0&&by(l,d,x.join(" "))}if(v=C_(g,20),void 0!==t){const w=v.projection=[];for(let x=0;xl(o,e)),e.contentQueries){const l=Dr();e.contentQueries(1,o,l.directiveStart)}const a=Dr();return!s.firstCreatePass||null===e.hostBindings&&null===e.hostAttrs||(Hs(a.index),aw(t[1],a,0,a.directiveStart,a.directiveEnd,e),lw(e,o)),o}(C,this.componentDef,_,p,[m7]),ff(g,_,null)}finally{Cn()}return new hZ(this.componentType,y,Fg(v,_),_,v)}}class hZ 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 KX(r),this.componentType=e}get injector(){return new Bo(this._tNode,this._rootLView)}destroy(){this.hostView.destroy()}onDestroy(e){this.hostView.onDestroy(e)}}const Ug=new Map;class gZ extends jc{constructor(e,t){super(),this._parent=t,this._bootstrapComponents=[],this.injector=this,this.destroyCbs=[],this.componentFactoryResolver=new _B(this);const i=po(e),r=function(n){return n[xx]||null}(e);r&&mA(r),this._bootstrapComponents=Ja(i.bootstrap),this._r3Injector=gw(e,t,[{provide:jc,useValue:this},{provide:ll,useValue:this.componentFactoryResolver}],W(e)),this._r3Injector._resolveInjectorDefTypes(),this.instance=this.get(e)}get(e,t=Nt.THROW_IF_NOT_FOUND,i=At.Default){return e===Nt||e===jc||e===Fc?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 BA extends class{}{constructor(e){super(),this.moduleType=e,null!==po(e)&&function(n){const e=new Set;!function t(i){const r=po(i,!0),s=r.id;null!==s&&(function(n,e,t){if(e&&e!==t)throw new Error(`Duplicate module registered for ${n} - ${W(e)} vs ${W(e.name)}`)}(s,Ug.get(s),i),Ug.set(s,i));const o=Ja(r.imports);for(const a of o)e.has(a)||(e.add(a),t(a))}(n)}(e)}create(e){return new gZ(this.moduleType,e)}}function fv(n,e,t){const i=Yr()+n,r=Oe();return r[i]===kt?Bc(r,i,t?e.call(t):e()):function(n,e){return n[e]}(r,i)}function Hg(n,e,t,i){return wB(Oe(),Yr(),n,e,t,i)}function pv(n,e){const t=n[e];return t===kt?void 0:t}function wB(n,e,t,i,r,s){const o=e+t;return qs(n,o,r)?Bc(n,o+1,s?i.call(s,r):i(r)):pv(n,o+1)}function Kt(n,e){const t=Dn();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 $("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=wc(i.type)),o=da(E);try{const a=Bp(!1),l=s();return Bp(a),function(n,e,t,i){t>=n.data.length&&(n.data[t]=null,n.blueprint[t]=null),e[t]=i}(t,Oe(),r,l),l}finally{da(o)}}function rn(n,e,t){const i=n+20,r=Oe(),s=Ed(r,i);return _v(r,mv(r,i)?wB(r,Yr(),e,s.transform,t,s):s.transform(t))}function gv(n,e,t,i){const r=n+20,s=Oe(),o=Ed(s,r);return _v(s,mv(s,r)?function(n,e,t,i,r,s,o){const a=e+t;return mf(n,a,r,s)?Bc(n,a+2,o?i.call(o,r,s):i(r,s)):pv(n,a+2)}(s,Yr(),e,o.transform,t,i,o):o.transform(t,i))}function mv(n,e){return n[1].data[e].pure}function _v(n,e){return Ul.isWrapped(e)&&(e=Ul.unwrap(e),n[Us()]=kt),e}function VA(n){return e=>{setTimeout(n,void 0,e)}}const Le=class extends Se{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=VA(l),a&&(a=VA(a)),c&&(c=VA(c)));const d=super.subscribe({next:a,error:l,complete:c});return e instanceof Te&&e.add(d),d}};function DZ(){return this._results[vg()]()}class Sf{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=vg(),i=Sf.prototype;i[t]||(i[t]=DZ)}get changes(){return this._changes||(this._changes=new Le)}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=Vo(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=kw,this.reject=kw,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)(I(Mf,8))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();const vv=new ve("AppId"),uQ={provide:vv,useFactory:function(){return`${KA()}${KA()}${KA()}`},deps:[]};function KA(){return String.fromCharCode(97+Math.floor(25*Math.random()))}const XB=new ve("Platform Initializer"),dl=new ve("Platform ID"),bv=new ve("appBootstrapListener");let $w=(()=>{class n{log(t){console.log(t)}warn(t){console.warn(t)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();const Uu=new ve("LocaleId"),KB=new ve("DefaultCurrencyCode");class hQ{constructor(e,t){this.ngModuleFactory=e,this.componentFactories=t}}const ZA=function(n){return new BA(n)},fQ=ZA,pQ=function(n){return Promise.resolve(ZA(n))},ZB=function(n){const e=ZA(n),i=Ja(po(n).declarations).reduce((r,s)=>{const o=Kn(s);return o&&r.push(new vB(o)),r},[]);return new hQ(e,i)},gQ=ZB,mQ=function(n){return Promise.resolve(ZB(n))};let xf=(()=>{class n{constructor(){this.compileModuleSync=fQ,this.compileModuleAsync=pQ,this.compileModuleAndAllComponentsSync=gQ,this.compileModuleAndAllComponentsAsync=mQ}clearCache(){}clearCacheFor(t){}getModuleId(t){}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();const QB=new ve("compilerOptions"),yQ=(()=>Promise.resolve(0))();function QA(n){"undefined"==typeof Zone?yQ.then(()=>{n&&n.apply(null,null)}):Zone.current.scheduleMicroTask("scheduleMicrotask",n)}class dt{constructor({enableLongStackTrace:e=!1,shouldCoalesceEventChangeDetection:t=!1,shouldCoalesceRunChangeDetection:i=!1}){if(this.hasPendingMacrotasks=!1,this.hasPendingMicrotasks=!1,this.isStable=!0,this.onUnstable=new Le(!1),this.onMicrotaskEmpty=new Le(!1),this.onStable=new Le(!1),this.onError=new Le(!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=cn.requestAnimationFrame,e=cn.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(cn,()=>{n.fakeTopEventTask||(n.fakeTopEventTask=Zone.root.scheduleEventTask("fakeTopEventTask",()=>{n.lastRequestAnimationFrameId=-1,eD(n),n.isCheckStableRunning=!0,JA(n),n.isCheckStableRunning=!1},void 0,()=>{},()=>{})),n.fakeTopEventTask.invoke()}),eD(n))}(n)};n._inner=n._inner.fork({name:"angular",properties:{isAngularZone:!0},onInvokeTask:(t,i,r,s,o,a)=>{try{return JB(n),t.invokeTask(r,s,o,a)}finally{(n.shouldCoalesceEventChangeDetection&&"eventTask"===s.type||n.shouldCoalesceRunChangeDetection)&&e(),e3(n)}},onInvoke:(t,i,r,s,o,a,l)=>{try{return JB(n),t.invoke(r,s,o,a,l)}finally{n.shouldCoalesceRunChangeDetection&&e(),e3(n)}},onHasTask:(t,i,r,s)=>{t.hasTask(r,s),i===r&&("microTask"==s.change?(n._hasPendingMicrotasks=s.microTask,eD(n),JA(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(!dt.isInAngularZone())throw new Error("Expected to be in Angular Zone, but it is not!")}static assertNotInAngularZone(){if(dt.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,bQ,kw,kw);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 bQ={};function JA(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 eD(n){n.hasPendingMicrotasks=!!(n._hasPendingMicrotasks||(n.shouldCoalesceEventChangeDetection||n.shouldCoalesceRunChangeDetection)&&-1!==n.lastRequestAnimationFrameId)}function JB(n){n._nesting++,n.isStable&&(n.isStable=!1,n.onUnstable.emit(null))}function e3(n){n._nesting--,JA(n)}class EQ{constructor(){this.hasPendingMicrotasks=!1,this.hasPendingMacrotasks=!1,this.isStable=!0,this.onUnstable=new Le,this.onMicrotaskEmpty=new Le,this.onStable=new Le,this.onError=new Le}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 tD=(()=>{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:()=>{dt.assertNotInAngularZone(),QA(()=>{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())QA(()=>{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)(I(dt))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})(),t3=(()=>{class n{constructor(){this._applications=new Map,nD.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 nD.findTestabilityInTree(this,t,i)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();class SQ{addToWindow(e){}findTestabilityInTree(e,t,i){return null}}let nD=new SQ,n3=!0,i3=!1;function Mo(){return i3=!0,n3}let Yl;const r3=new ve("AllowMultipleToken");function s3(n,e,t=[]){const i=`Platform: ${e}`,r=new ve(i);return(s=[])=>{let o=rD();if(!o||o.injector.get(r3,!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(Yl&&!Yl.destroyed&&!Yl.injector.get(r3,!1))throw new Error("There can be only one platform. Destroy the previous one to create a new one.");Yl=n.get(o3);const e=n.get(XB,null);e&&e.forEach(t=>t())}(Nt.create({providers:a,name:i}))}return function(n){const e=rD();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 rD(){return Yl&&!Yl.destroyed?Yl:null}let o3=(()=>{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 EQ:("zone.js"===n?void 0:n)||new dt({enableLongStackTrace:Mo(),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:dt,useValue:a}];return a.run(()=>{const c=Nt.create({providers:l,parent:this.injector,name:t.moduleType.name}),d=t.create(c),f=d.injector.get($o,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(()=>{sD(this._modules,d),p.unsubscribe()})}),function(n,e,t){try{const i=t();return Og(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(Gg);return p.runInitializers(),p.donePromise.then(()=>(mA(d.injector.get(Uu,Dw)||Dw),this._moduleDoBootstrap(d),d))})})}bootstrapModule(t,i=[]){const r=a3({},i);return function(n,e,t){const i=new BA(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 ${W(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)(I(Nt))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();function a3(n,e){return Array.isArray(e)?e.reduce(a3,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 ce(c=>{this._stable=this._zone.isStable&&!this._zone.hasPendingMacrotasks&&!this._zone.hasPendingMicrotasks,this._zone.runOutsideAngular(()=>{c.next(this._stable),c.complete()})}),l=new ce(c=>{let d;this._zone.runOutsideAngular(()=>{d=this._zone.onStable.subscribe(()=>{dt.assertNotInAngularZone(),QA(()=>{!this._stable&&!this._zone.hasPendingMacrotasks&&!this._zone.hasPendingMicrotasks&&(this._stable=!0,c.next(!0))})})});const f=this._zone.onUnstable.subscribe(()=>{dt.assertInAngularZone(),this._stable&&(this._stable=!1,this._zone.runOutsideAngular(()=>{c.next(!1)}))});return()=>{d.unsubscribe(),f.unsubscribe()}});this.isStable=Ni(a,l.pipe(Vs()))}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 LL?t:this._componentFactoryResolver.resolveComponentFactory(t),this.componentTypes.push(r.componentType);const s=function(n){return n.isBoundToModule}(r)?void 0:this._injector.get(jc),a=r.create(Nt.NULL,[],i||r.selector,s),l=a.location.nativeElement,c=a.injector.get(tD,null),d=c&&a.injector.get(t3);return c&&d&&d.registerApplication(l,c),a.onDestroy(()=>{this.detachView(a.hostView),sD(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;sD(this._views,i),i.detachFromAppRef()}_loadComponent(t){this.attachView(t.hostView),this.tick(),this.components.push(t),this._injector.get(bv,[]).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)(I(dt),I(Nt),I($o),I(ll),I(Gg))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();function sD(n,e){const t=n.indexOf(e);t>-1&&n.splice(t,1)}const ZQ=s3(null,"core",[{provide:dl,useValue:"unknown"},{provide:o3,deps:[Nt]},{provide:t3,deps:[]},{provide:$w,deps:[]}]),nJ=[{provide:Jd,useClass:Jd,deps:[dt,Nt,$o,ll,Gg]},{provide:cZ,deps:[dt],useFactory:function(n){let e=[];return n.onStable.subscribe(()=>{for(;e.length;)e.pop()()}),function(t){e.push(t)}}},{provide:Gg,useClass:Gg,deps:[[new br,Mf]]},{provide:xf,useClass:xf,deps:[]},uQ,{provide:Ng,useFactory:function(){return iK},deps:[]},{provide:Lg,useFactory:function(){return rK},deps:[]},{provide:Uu,useFactory:function(n){return mA(n=n||"undefined"!=typeof $localize&&$localize.locale||Dw),n},deps:[[new Ld(Uu),new br,new Za]]},{provide:KB,useValue:"USD"}];let rJ=(()=>{class n{constructor(t){}}return n.\u0275fac=function(t){return new(t||n)(I(Jd))},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({providers:nJ}),n})(),tE=null;function Uc(){return tE}const ut=new ve("DocumentToken");let Df=(()=>{class n{historyGo(t){throw new Error("Not implemented")}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ue({factory:iee,token:n,providedIn:"platform"}),n})();function iee(){return I(F3)}let F3=(()=>{class n extends Df{constructor(t){super(),this._doc=t,this._init()}_init(){this.location=window.location,this._history=window.history}getBaseHrefFromDOM(){return Uc().getBaseHref(this._doc)}onPopState(t){const i=Uc().getGlobalEventTarget(this._doc,"window");return i.addEventListener("popstate",t,!1),()=>i.removeEventListener("popstate",t)}onHashChange(t){const i=Uc().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){N3()?this._history.pushState(t,i,r):this.location.hash=r}replaceState(t,i,r){N3()?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)(I(ut))},n.\u0275prov=ue({factory:see,token:n,providedIn:"platform"}),n})();function N3(){return!!window.history.pushState}function see(){return new F3(I(ut))}function bD(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}function L3(n){const e=n.match(/#|\?|$/),t=e&&e.index||n.length;return n.slice(0,t-("/"===n[t-1]?1:0))+n.slice(t)}function $u(n){return n&&"?"!==n[0]?"?"+n:n}let Yg=(()=>{class n{historyGo(t){throw new Error("Not implemented")}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ue({factory:oee,token:n,providedIn:"root"}),n})();function oee(n){const e=I(ut).location;return new B3(I(Df),e&&e.origin||"")}const CD=new ve("appBaseHref");let B3=(()=>{class n extends Yg{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 bD(this._baseHref,t)}path(t=!1){const i=this._platformLocation.pathname+$u(this._platformLocation.search),r=this._platformLocation.hash;return r&&t?`${i}${r}`:i}pushState(t,i,r,s){const o=this.prepareExternalUrl(r+$u(s));this._platformLocation.pushState(t,i,o)}replaceState(t,i,r,s){const o=this.prepareExternalUrl(r+$u(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)(I(Df),I(CD,8))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})(),Xg=(()=>{class n{constructor(t,i){this._subject=new Le,this._urlChangeListeners=[],this._platformStrategy=t;const r=this._platformStrategy.getBaseHref();this._platformLocation=i,this._baseHref=L3(V3(r)),this._platformStrategy.onPopState(s=>{this._subject.emit({url:this.path(!0),pop:!0,state:s.state,type:s.type})})}path(t=!1){return this.normalize(this._platformStrategy.path(t))}getState(){return this._platformLocation.getState()}isCurrentPathEqualTo(t,i=""){return this.path()==this.normalize(t+$u(i))}normalize(t){return n.stripTrailingSlash(function(n,e){return n&&e.startsWith(n)?e.substring(n.length):e}(this._baseHref,V3(t)))}prepareExternalUrl(t){return t&&"/"!==t[0]&&(t="/"+t),this._platformStrategy.prepareExternalUrl(t)}go(t,i="",r=null){this._platformStrategy.pushState(r,"",t,i),this._notifyUrlChangeListeners(this.prepareExternalUrl(t+$u(i)),r)}replaceState(t,i="",r=null){this._platformStrategy.replaceState(r,"",t,i),this._notifyUrlChangeListeners(this.prepareExternalUrl(t+$u(i)),r)}forward(){this._platformStrategy.forward()}back(){this._platformStrategy.back()}historyGo(t=0){var i,r;null===(r=(i=this._platformStrategy).historyGo)||void 0===r||r.call(i,t)}onUrlChange(t){this._urlChangeListeners.push(t),this._urlChangeSubscription||(this._urlChangeSubscription=this.subscribe(i=>{this._notifyUrlChangeListeners(i.url,i.state)}))}_notifyUrlChangeListeners(t="",i){this._urlChangeListeners.forEach(r=>r(t,i))}subscribe(t,i,r){return this._subject.subscribe({next:t,error:i,complete:r})}}return n.\u0275fac=function(t){return new(t||n)(I(Yg),I(Df))},n.normalizeQueryParams=$u,n.joinWithSlash=bD,n.stripTrailingSlash=L3,n.\u0275prov=ue({factory:lee,token:n,providedIn:"root"}),n})();function lee(){return new Xg(I(Yg),I(Df))}function V3(n){return n.replace(/\/index.html$/,"")}var Br=(()=>((Br=Br||{})[Br.Zero=0]="Zero",Br[Br.One=1]="One",Br[Br.Two=2]="Two",Br[Br.Few=3]="Few",Br[Br.Many=4]="Many",Br[Br.Other=5]="Other",Br))();const mee=function(n){return function(n){const e=function(n){return n.toLowerCase().replace(/_/g,"-")}(n);let t=dL(e);if(t)return t;const i=e.split("-")[0];if(t=dL(i),t)return t;if("en"===i)return FY;throw new Error(`Missing locale data for the locale "${n}".`)}(n)[at.PluralCase]};class dE{}let Gee=(()=>{class n extends dE{constructor(t){super(),this.locale=t}getPluralCategory(t,i){switch(mee(i||this.locale)(t)){case Br.Zero:return"zero";case Br.One:return"one";case Br.Two:return"two";case Br.Few:return"few";case Br.Many:return"many";default:return"other"}}}return n.\u0275fac=function(t){return new(t||n)(I(Uu))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();function Y3(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}let hE=(()=>{class n{constructor(t,i,r,s){this._iterableDiffers=t,this._keyValueDiffers=i,this._ngEl=r,this._renderer=s,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&&(Ky(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(i=>this._toggleClass(i.key,i.currentValue)),t.forEachChangedItem(i=>this._toggleClass(i.key,i.currentValue)),t.forEachRemovedItem(i=>{i.previousValue&&this._toggleClass(i.key,!1)})}_applyIterableChanges(t){t.forEachAddedItem(i=>{if("string"!=typeof i.item)throw new Error(`NgClass can only toggle CSS classes expressed as strings, got ${W(i.item)}`);this._toggleClass(i.item,!0)}),t.forEachRemovedItem(i=>this._toggleClass(i.item,!1))}_applyClasses(t){t&&(Array.isArray(t)||t instanceof Set?t.forEach(i=>this._toggleClass(i,!0)):Object.keys(t).forEach(i=>this._toggleClass(i,!!t[i])))}_removeClasses(t){t&&(Array.isArray(t)||t instanceof Set?t.forEach(i=>this._toggleClass(i,!1)):Object.keys(t).forEach(i=>this._toggleClass(i,!1)))}_toggleClass(t,i){(t=t.trim())&&t.split(/\s+/g).forEach(r=>{i?this._renderer.addClass(this._ngEl.nativeElement,r):this._renderer.removeClass(this._ngEl.nativeElement,r)})}}return n.\u0275fac=function(t){return new(t||n)(E(Ng),E(Lg),E(rt),E(zc))},n.\u0275dir=oe({type:n,selectors:[["","ngClass",""]],inputs:{klass:["class","klass"],ngClass:"ngClass"}}),n})();class qee{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 pl=(()=>{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 qee(null,this._ngForOf,-1,-1),null===o?void 0:o),l=new X3(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 X3(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)(E(ns),E(Ys),E(Ng))},n.\u0275dir=oe({type:n,selectors:[["","ngFor","","ngForOf",""]],inputs:{ngForOf:"ngForOf",ngForTrackBy:"ngForTrackBy",ngForTemplate:"ngForTemplate"}}),n})();class X3{constructor(e,t){this.record=e,this.view=t}}let zr=(()=>{class n{constructor(t,i){this._viewContainer=t,this._context=new Xee,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){K3("ngIfThen",t),this._thenTemplateRef=t,this._thenViewRef=null,this._updateView()}set ngIfElse(t){K3("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)(E(ns),E(Ys))},n.\u0275dir=oe({type:n,selectors:[["","ngIf",""]],inputs:{ngIf:"ngIf",ngIfThen:"ngIfThen",ngIfElse:"ngIfElse"}}),n})();class Xee{constructor(){this.$implicit=null,this.ngIf=null}}function K3(n,e){if(e&&!e.createEmbeddedView)throw new Error(`${n} must be a TemplateRef, but received '${W(e)}'.`)}class OD{constructor(e,t){this._viewContainerRef=e,this._templateRef=t,this._created=!1}create(){this._created=!0,this._viewContainerRef.createEmbeddedView(this._templateRef)}destroy(){this._created=!1,this._viewContainerRef.clear()}enforceState(e){e&&!this._created?this.create():!e&&this._created&&this.destroy()}}let Av=(()=>{class n{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 i=t==this._ngSwitch;return this._lastCasesMatched=this._lastCasesMatched||i,this._lastCaseCheckIndex++,this._lastCaseCheckIndex===this._caseCount&&(this._updateDefaultCases(!this._lastCasesMatched),this._lastCaseCheckIndex=0,this._lastCasesMatched=!1),i}_updateDefaultCases(t){if(this._defaultViews&&t!==this._defaultUsed){this._defaultUsed=t;for(let i=0;i{class n{constructor(t,i,r){this.ngSwitch=r,r._addCase(),this._view=new OD(t,i)}ngDoCheck(){this._view.enforceState(this.ngSwitch._matchCase(this.ngSwitchCase))}}return n.\u0275fac=function(t){return new(t||n)(E(ns),E(Ys),E(Av,9))},n.\u0275dir=oe({type:n,selectors:[["","ngSwitchCase",""]],inputs:{ngSwitchCase:"ngSwitchCase"}}),n})(),Z3=(()=>{class n{constructor(t,i,r){r._addDefault(new OD(t,i))}}return n.\u0275fac=function(t){return new(t||n)(E(ns),E(Ys),E(Av,9))},n.\u0275dir=oe({type:n,selectors:[["","ngSwitchDefault",""]]}),n})(),J3=(()=>{class n{constructor(t,i,r){this._ngEl=t,this._differs=i,this._renderer=r,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,i){const[r,s]=t.split(".");null!=(i=null!=i&&s?`${i}${s}`:i)?this._renderer.setStyle(this._ngEl.nativeElement,r,i):this._renderer.removeStyle(this._ngEl.nativeElement,r)}_applyChanges(t){t.forEachRemovedItem(i=>this._setStyle(i.key,null)),t.forEachAddedItem(i=>this._setStyle(i.key,i.currentValue)),t.forEachChangedItem(i=>this._setStyle(i.key,i.currentValue))}}return n.\u0275fac=function(t){return new(t||n)(E(rt),E(Lg),E(zc))},n.\u0275dir=oe({type:n,selectors:[["","ngStyle",""]],inputs:{ngStyle:"ngStyle"}}),n})();function Ql(n,e){return Error(`InvalidPipeArgument: '${e}' for pipe '${W(n)}'`)}class Qee{createSubscription(e,t){return e.subscribe({next:t,error:i=>{throw i}})}dispose(e){e.unsubscribe()}onDestroy(e){e.unsubscribe()}}class Jee{createSubscription(e,t){return e.then(t,i=>{throw i})}dispose(e){}onDestroy(e){}}const ete=new Jee,tte=new Qee;let Hc=(()=>{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(Og(t))return ete;if(EN(t))return tte;throw Ql(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)(E(kn,16))},n.\u0275pipe=ds({name:"async",type:n,pure:!1}),n})();const ate=/#/g;let eV=(()=>{class n{constructor(t){this._localization=t}transform(t,i,r){if(null==t)return"";if("object"!=typeof i||null===i)throw Ql(n,i);return i[function(n,e,t,i){let r=`=${n}`;if(e.indexOf(r)>-1||(r=t.getPluralCategory(n,i),e.indexOf(r)>-1))return r;if(e.indexOf("other")>-1)return"other";throw new Error(`No plural message found for value "${n}"`)}(t,Object.keys(i),this._localization,r)].replace(ate,t.toString())}}return n.\u0275fac=function(t){return new(t||n)(E(dE,16))},n.\u0275pipe=ds({name:"i18nPlural",type:n,pure:!0}),n})(),tV=(()=>{class n{transform(t){return JSON.stringify(t,null,2)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275pipe=ds({name:"json",type:n,pure:!1}),n})(),dn=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({providers:[{provide:dE,useClass:Gee}]}),n})();const rV="browser";function Of(n){return n===rV}function kD(n){return"server"===n}class aV{}class FD extends class extends class{}{constructor(){super(...arguments),this.supportsDOMEvents=!0}}{static makeCurrent(){!function(n){tE||(tE=n)}(new FD)}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=(Dv=Dv||document.querySelector("base"),Dv?Dv.getAttribute("href"):null);return null==t?null:function(n){fE=fE||document.createElement("a"),fE.setAttribute("href",n);const e=fE.pathname;return"/"===e.charAt(0)?e:`/${e}`}(t)}resetBaseElement(){Dv=null}getUserAgent(){return window.navigator.userAgent}getCookie(e){return Y3(document.cookie,e)}}let fE,Dv=null;const lV=new ve("TRANSITION_ID"),Ete=[{provide:Mf,useFactory:function(n,e,t){return()=>{t.get(Gg).donePromise.then(()=>{const i=Uc(),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},cn.getAllAngularTestabilities=()=>e.getAllTestabilities(),cn.getAllAngularRootElements=()=>e.getAllRootElements(),cn.frameworkStabilizers||(cn.frameworkStabilizers=[]),cn.frameworkStabilizers.push(i=>{const r=cn.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?Uc().isShadowRoot(t)?this.findTestabilityInTree(e,t.host,!0):this.findTestabilityInTree(e,t.parentElement,!0):null}}let Ste=(()=>{class n{build(){return new XMLHttpRequest}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();const Ov=new ve("EventManagerPlugins");let gE=(()=>{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=ue({token:n,factory:n.\u0275fac}),n})(),Iv=(()=>{class n extends uV{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(dV),this._hostNodes.delete(t)}onStylesAdded(t){this._hostNodes.forEach((i,r)=>{this._addStylesToHost(t,r,i)})}ngOnDestroy(){this._hostNodes.forEach(t=>t.forEach(dV))}}return n.\u0275fac=function(t){return new(t||n)(I(ut))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();function dV(n){Uc().remove(n)}const BD={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/"},VD=/%COMP%/g;function mE(n,e,t){for(let i=0;i{if("__ngUnwrap__"===e)return n;!1===n(e)&&(e.preventDefault(),e.returnValue=!1)}}let _E=(()=>{class n{constructor(t,i,r){this.eventManager=t,this.sharedStylesHost=i,this.appId=r,this.rendererByCompId=new Map,this.defaultRenderer=new zD(t)}createRenderer(t,i){if(!t||!i)return this.defaultRenderer;switch(i.encapsulation){case Ue.Emulated:{let r=this.rendererByCompId.get(i.id);return r||(r=new Vte(this.eventManager,this.sharedStylesHost,i,this.appId),this.rendererByCompId.set(i.id,r)),r.applyToHost(t),r}case 1:case Ue.ShadowDom:return new zte(this.eventManager,this.sharedStylesHost,t,i);default:if(!this.rendererByCompId.has(i.id)){const r=mE(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)(I(gE),I(Iv),I(vv))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();class zD{constructor(e){this.eventManager=e,this.data=Object.create(null)}destroy(){}createElement(e,t){return t?document.createElementNS(BD[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=BD[r];s?e.setAttributeNS(s,t,i):e.setAttribute(t,i)}else e.setAttribute(t,i)}removeAttribute(e,t,i){if(i){const r=BD[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&(Co.DashCase|Co.Important)?e.style.setProperty(t,i,r&Co.Important?"important":""):e.style[t]=i}removeStyle(e,t,i){i&Co.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,pV(i)):this.eventManager.addEventListener(e,t,pV(i))}}class Vte extends zD{constructor(e,t,i,r){super(e),this.component=i;const s=mE(r+"-"+i.id,i.styles,[]);t.addStyles(s),this.contentAttr=function(n){return"_ngcontent-%COMP%".replace(VD,n)}(r+"-"+i.id),this.hostAttr=function(n){return"_nghost-%COMP%".replace(VD,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 zte extends zD{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=mE(r.id,r.styles,[]);for(let o=0;o{class n extends LD{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)(I(ut))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();const _V=["alt","control","meta","shift"],Yte={"\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"},yV={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"},Xte={alt:n=>n.altKey,control:n=>n.ctrlKey,meta:n=>n.metaKey,shift:n=>n.shiftKey};let Kte=(()=>{class n extends LD{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(()=>Uc().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(_V.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&&yV.hasOwnProperty(e)&&(e=yV[e]))}return Yte[e]||e}(t);return r=r.toLowerCase()," "===r?r="space":"."===r&&(r="dot"),_V.forEach(s=>{s!=r&&Xte[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)(I(ut))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})(),th=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ue({factory:function(){return I(UD)},token:n,providedIn:"root"}),n})(),UD=(()=>{class n extends th{constructor(t){super(),this._doc=t}sanitize(t,i){if(null==i)return null;switch(t){case mn.NONE:return i;case mn.HTML:return jo(i,"HTML")?gs(i):ey(this._doc,String(i)).toString();case mn.STYLE:return jo(i,"Style")?gs(i):i;case mn.SCRIPT:if(jo(i,"Script"))return gs(i);throw new Error("unsafe value used in a script context");case mn.URL:return Pc(i),jo(i,"URL")?gs(i):bo(String(i));case mn.RESOURCE_URL:if(jo(i,"ResourceURL"))return gs(i);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(n){return new W_(n)}(t)}bypassSecurityTrustStyle(t){return function(n){return new q_(n)}(t)}bypassSecurityTrustScript(t){return function(n){return new Jp(n)}(t)}bypassSecurityTrustUrl(t){return function(n){return new zd(n)}(t)}bypassSecurityTrustResourceUrl(t){return function(n){return new Ut(n)}(t)}}return n.\u0275fac=function(t){return new(t||n)(I(ut))},n.\u0275prov=ue({factory:function(){return function(n){return new UD(n.get(ut))}(I(Fc))},token:n,providedIn:"root"}),n})();const rne=s3(ZQ,"browser",[{provide:dl,useValue:rV},{provide:XB,useValue:function(){FD.makeCurrent(),ND.init()},multi:!0},{provide:ut,useFactory:function(){return function(n){fi=n}(document),document},deps:[]}]),sne=[[],{provide:Vu,useValue:"root"},{provide:$o,useFactory:function(){return new $o},deps:[]},{provide:Ov,useClass:jte,multi:!0,deps:[ut,dt,dl]},{provide:Ov,useClass:Kte,multi:!0,deps:[ut]},[],{provide:_E,useClass:_E,deps:[gE,Iv,vv]},{provide:Cf,useExisting:_E},{provide:uV,useExisting:Iv},{provide:Iv,useClass:Iv,deps:[ut]},{provide:tD,useClass:tD,deps:[dt]},{provide:gE,useClass:gE,deps:[Ov,dt]},{provide:aV,useClass:Ste,deps:[]},[]];let yE=(()=>{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:vv,useValue:t.appId},{provide:lV,useExisting:vv},Ete]}}}return n.\u0275fac=function(t){return new(t||n)(I(n,12))},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({providers:sne,imports:[dn,rJ]}),n})();"undefined"!=typeof window&&window;class fne extends Te{constructor(e,t){super()}schedule(e,t=0){return this}}class vE extends fne{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 bV=(()=>{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 bV{constructor(e,t=bV.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 mne=new class extends Jl{}(class extends vE{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)}}),ec=new ce(n=>n.complete());function bE(n){return n?function(n){return new ce(e=>n.schedule(()=>e.complete()))}(n):ec}function ht(...n){let e=n[n.length-1];return Gn(e)?(n.pop(),Fi(n,e)):za(n)}function Kg(n,e){return new ce(e?t=>e.schedule(yne,0,{error:n,subscriber:t}):t=>t.error(n))}function yne({error:n,subscriber:e}){e.error(n)}class Ko{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 ht(this.value);case"E":return Kg(this.error);case"C":return bE()}throw new Error("unexpected notification kind value")}static createNext(e){return void 0!==e?new Ko("N",e):Ko.undefinedValueNotification}static createError(e){return new Ko("E",void 0,e)}static createComplete(){return Ko.completeNotification}}Ko.completeNotification=new Ko("C"),Ko.undefinedValueNotification=new Ko("N",void 0);class CE extends xt{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(CE.dispatch,this.delay,new bne(e,this.destination)))}_next(e){this.scheduleMessage(Ko.createNext(e))}_error(e){this.scheduleMessage(Ko.createError(e)),this.unsubscribe()}_complete(){this.scheduleMessage(Ko.createComplete()),this.unsubscribe()}}class bne{constructor(e,t){this.notification=e,this.destination=t}}class If extends Se{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 Cne(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 Qt;if(this.isStopped||this.hasError?o=Te.EMPTY:(this.observers.push(e),o=new li(this,e)),r&&e.add(e=new CE(e,r)),t)for(let a=0;at&&(o=Math.max(o,s-t)),o>0&&r.splice(0,o),r}}class Cne{constructor(e,t){this.time=e,this.value=t}}function Pr(n,e){return"function"==typeof e?t=>t.pipe(Pr((i,r)=>ui(n(i,r)).pipe(Ae((s,o)=>e(i,s,r,o))))):t=>t.lift(new wne(n))}class wne{constructor(e){this.project=e}call(e,t){return t.subscribe(new Ene(e,this.project))}}class Ene extends ii{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 Gr(this),r=this.destination;r.add(i),this.innerSubscription=co(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 wE={schedule(n,e){const t=setTimeout(n,e);return()=>clearTimeout(t)},scheduleBeforeRender(n){if("undefined"==typeof window)return wE.schedule(n,0);if(void 0===window.requestAnimationFrame)return wE.schedule(n,16);const e=window.requestAnimationFrame(n);return()=>window.cancelAnimationFrame(e)}};let $D;function Rne(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(!$D){const t=Element.prototype;$D=t.matches||t.matchesSelector||t.mozMatchesSelector||t.msMatchesSelector||t.oMatchesSelector||t.webkitMatchesSelector}return n.nodeType===Node.ELEMENT_NODE&&$D.call(n,e)}(n,r)||(i=s,0))),i}class Fne{constructor(e,t){this.componentFactory=t.get(ll).resolveComponentFactory(e)}create(e){return new Nne(this.componentFactory,e)}}class Nne{constructor(e,t){this.componentFactory=e,this.injector=t,this.eventEmitters=new If(1),this.events=this.eventEmitters.pipe(Pr(i=>Ni(...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(dt),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=wE.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=Nt.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(Ae(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=wE.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 y_(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 Lne extends HTMLElement{constructor(){super(...arguments),this.ngElementEventsSubscription=null}}function Mt(n){return null!=n&&"false"!=`${n}`}function To(n,e=0){return function(n){return!isNaN(parseFloat(n))&&!isNaN(Number(n))}(n)?Number(n):e}function EE(n){return Array.isArray(n)?n:[n]}function jr(n){return null==n?"":"string"==typeof n?n:`${n}px`}function Wu(n){return n instanceof rt?n.nativeElement:n}const Pf=new Jl(vE);function Zg(n,e=Pf){return t=>t.lift(new jne(n,e))}class jne{constructor(e,t){this.dueTime=e,this.scheduler=t}call(e,t){return t.subscribe(new Une(e,this.dueTime,this.scheduler))}}class Une extends xt{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(Hne,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 Hne(n){n.debouncedNext()}let GD=(()=>{class n{create(t){return"undefined"==typeof MutationObserver?null:new MutationObserver(t)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ue({factory:function(){return new n},token:n,providedIn:"root"}),n})(),CV=(()=>{class n{constructor(t){this._mutationObserverFactory=t,this._observedElements=new Map}ngOnDestroy(){this._observedElements.forEach((t,i)=>this._cleanupObserver(i))}observe(t){const i=Wu(t);return new ce(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 Se,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)(I(GD))},n.\u0275prov=ue({factory:function(){return new n(I(GD))},token:n,providedIn:"root"}),n})(),WD=(()=>{class n{constructor(t,i,r){this._contentObserver=t,this._elementRef=i,this._ngZone=r,this.event=new Le,this._disabled=!1,this._currentSubscription=null}get disabled(){return this._disabled}set disabled(t){this._disabled=Mt(t),this._disabled?this._unsubscribe():this._subscribe()}get debounce(){return this._debounce}set debounce(t){this._debounce=To(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(Zg(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)(E(CV),E(rt),E(dt))},n.\u0275dir=oe({type:n,selectors:[["","cdkObserveContent",""]],inputs:{disabled:["cdkObserveContentDisabled","disabled"],debounce:"debounce"},outputs:{event:"cdkObserveContent"},exportAs:["cdkObserveContent"]}),n})(),SE=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({providers:[GD]}),n})();class ar extends Se{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 Qt;return this._value}next(e){super.next(this._value=e)}}function Zs(n,...e){return e.length?e.some(t=>n[t]):n.altKey||n.shiftKey||n.ctrlKey||n.metaKey}function ih(){}function Ti(n,e,t){return function(r){return r.lift(new tie(n,e,t))}}class tie{constructor(e,t,i){this.nextOrObserver=e,this.error=t,this.complete=i}call(e,t){return t.subscribe(new nie(e,this.nextOrObserver,this.error,this.complete))}}class nie extends xt{constructor(e,t,i,r){super(e),this._tapNext=ih,this._tapError=ih,this._tapComplete=ih,this._tapError=i||ih,this._tapComplete=r||ih,Ke(t)?(this._context=this,this._tapNext=t):t&&(this._context=t,this._tapNext=t.next||ih,this._tapError=t.error||ih,this._tapComplete=t.complete||ih)}_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 Fn(n,e){return function(i){return i.lift(new iie(n,e))}}class iie{constructor(e,t){this.predicate=e,this.thisArg=t}call(e,t){return t.subscribe(new rie(e,this.predicate,this.thisArg))}}class rie extends xt{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)}}const SV=(()=>{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?bE():e.lift(new sie(n))}class sie{constructor(e){if(this.total=e,this.total<0)throw new SV}call(e,t){return t.subscribe(new oie(e,this.total))}}class oie extends xt{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 QD(n){return e=>e.lift(new aie(n))}class aie{constructor(e){this.total=e}call(e,t){return t.subscribe(new lie(e,this.total))}}class lie extends xt{constructor(e,t){super(e),this.total=t,this.count=0}_next(e){++this.count>this.total&&this.destination.next(e)}}function Zo(n,e){return t=>t.lift(new cie(n,e))}class cie{constructor(e,t){this.compare=e,this.keySelector=t}call(e,t){return t.subscribe(new uie(e,this.compare,this.keySelector))}}class uie extends xt{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))}}function Tn(n){return e=>e.lift(new die(n))}class die{constructor(e){this.notifier=e}call(e,t){const i=new hie(e),r=co(this.notifier,new Gr(i));return r&&!i.seenValue?(i.add(r),t.subscribe(i)):i}}class hie extends ii{constructor(e){super(e),this.seenValue=!1}notifyNext(){this.seenValue=!0,this.complete()}notifyComplete(){}}let JD;try{JD="undefined"!=typeof Intl&&Intl.v8BreakIterator}catch(n){JD=!1}let em,si=(()=>{class n{constructor(t){this._platformId=t,this.isBrowser=this._platformId?Of(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&&!JD)&&"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)(I(dl))},n.\u0275prov=ue({factory:function(){return new n(I(dl))},token:n,providedIn:"root"}),n})(),Rv=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({}),n})();const MV=["color","button","checkbox","date","datetime-local","email","file","hidden","image","month","number","password","radio","range","reset","search","submit","tel","text","time","url","week"];function xV(){if(em)return em;if("object"!=typeof document||!document)return em=new Set(MV),em;let n=document.createElement("input");return em=new Set(MV.filter(e=>(n.setAttribute("type",e),n.type===e))),em}let kv,Ff,eO;function tm(n){return function(){if(null==kv&&"undefined"!=typeof window)try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:()=>kv=!0}))}finally{kv=kv||!1}return kv}()?n:!!n.capture}function TV(){if(null==Ff){if("object"!=typeof document||!document||"function"!=typeof Element||!Element)return Ff=!1,Ff;if("scrollBehavior"in document.documentElement.style)Ff=!0;else{const n=Element.prototype.scrollTo;Ff=!!n&&!/\{\s*\[native code\]\s*\}/.test(n.toString())}}return Ff}function xE(){let n="undefined"!=typeof document&&document?document.activeElement:null;for(;n&&n.shadowRoot;){const e=n.shadowRoot.activeElement;if(e===n)break;n=e}return n}function Nf(n){return n.composedPath?n.composedPath()[0]:n.target}function TE(n,e){return(n.getAttribute(e)||"").match(/\S+/g)||[]}const DV="cdk-describedby-message-container",OV="cdk-describedby-message",AE="cdk-describedby-host";let yie=0;const $c=new Map;let Rs=null,IV=(()=>{class n{constructor(t){this._document=t}describe(t,i,r){if(!this._canBeDescribed(t,i))return;const s=tO(i,r);"string"!=typeof i?(PV(i),$c.set(s,{messageElement:i,referenceCount:0})):$c.has(s)||this._createMessageElement(i,r),this._isElementDescribedByMessage(t,s)||this._addMessageReference(t,s)}removeDescription(t,i,r){if(!i||!this._isElementNode(t))return;const s=tO(i,r);if(this._isElementDescribedByMessage(t,s)&&this._removeMessageReference(t,s),"string"==typeof i){const o=$c.get(s);o&&0===o.referenceCount&&this._deleteMessageElement(s)}Rs&&0===Rs.childNodes.length&&this._deleteMessagesContainer()}ngOnDestroy(){const t=this._document.querySelectorAll(`[${AE}]`);for(let i=0;i0!=r.indexOf(OV));t.setAttribute("aria-describedby",i.join(" "))}_addMessageReference(t,i){const r=$c.get(i);(function(n,e,t){const i=TE(n,e);i.some(r=>r.trim()==t.trim())||(i.push(t.trim()),n.setAttribute(e,i.join(" ")))})(t,"aria-describedby",r.messageElement.id),t.setAttribute(AE,""),r.referenceCount++}_removeMessageReference(t,i){const r=$c.get(i);r.referenceCount--,function(n,e,t){const r=TE(n,e).filter(s=>s!=t.trim());r.length?n.setAttribute(e,r.join(" ")):n.removeAttribute(e)}(t,"aria-describedby",r.messageElement.id),t.removeAttribute(AE)}_isElementDescribedByMessage(t,i){const r=TE(t,"aria-describedby"),s=$c.get(i),o=s&&s.messageElement.id;return!!o&&-1!=r.indexOf(o)}_canBeDescribed(t,i){if(!this._isElementNode(t))return!1;if(i&&"object"==typeof i)return!0;const r=null==i?"":`${i}`.trim(),s=t.getAttribute("aria-label");return!(!r||s&&s.trim()===r)}_isElementNode(t){return t.nodeType===this._document.ELEMENT_NODE}}return n.\u0275fac=function(t){return new(t||n)(I(ut))},n.\u0275prov=ue({factory:function(){return new n(I(ut))},token:n,providedIn:"root"}),n})();function tO(n,e){return"string"==typeof n?`${e||""}/${n}`:n}function PV(n){n.id||(n.id=`${OV}-${yie++}`)}class RV{constructor(e){this._items=e,this._activeItemIndex=-1,this._activeItem=null,this._wrap=!1,this._letterKeyStream=new Se,this._typeaheadSubscription=Te.EMPTY,this._vertical=!0,this._allowedModifierKeys=[],this._homeAndEnd=!1,this._skipPredicateFn=t=>t.disabled,this._pressedLetters=[],this.tabOut=new Se,this.change=new Se,e instanceof Sf&&e.changes.subscribe(t=>{if(this._activeItem){const r=t.toArray().indexOf(this._activeItem);r>-1&&r!==this._activeItemIndex&&(this._activeItemIndex=r)}})}skipPredicate(e){return this._skipPredicateFn=e,this}withWrap(e=!0){return this._wrap=e,this}withVerticalOrientation(e=!0){return this._vertical=e,this}withHorizontalOrientation(e){return this._horizontal=e,this}withAllowedModifierKeys(e){return this._allowedModifierKeys=e,this}withTypeAhead(e=200){return this._typeaheadSubscription.unsubscribe(),this._typeaheadSubscription=this._letterKeyStream.pipe(Ti(t=>this._pressedLetters.push(t)),Zg(e),Fn(()=>this._pressedLetters.length>0),Ae(()=>this._pressedLetters.join(""))).subscribe(t=>{const i=this._getItemsArray();for(let r=1;r!e[s]||this._allowedModifierKeys.indexOf(s)>-1);switch(t){case 9:return void this.tabOut.next();case 40:if(this._vertical&&r){this.setNextItemActive();break}return;case 38:if(this._vertical&&r){this.setPreviousItemActive();break}return;case 39:if(this._horizontal&&r){"rtl"===this._horizontal?this.setPreviousItemActive():this.setNextItemActive();break}return;case 37:if(this._horizontal&&r){"rtl"===this._horizontal?this.setNextItemActive():this.setPreviousItemActive();break}return;case 36:if(this._homeAndEnd&&r){this.setFirstItemActive();break}return;case 35:if(this._homeAndEnd&&r){this.setLastItemActive();break}return;default:return void((r||Zs(e,"shiftKey"))&&(e.key&&1===e.key.length?this._letterKeyStream.next(e.key.toLocaleUpperCase()):(t>=65&&t<=90||t>=48&&t<=57)&&this._letterKeyStream.next(String.fromCharCode(t))))}this._pressedLetters=[],e.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(e){const t=this._getItemsArray(),i="number"==typeof e?e:t.indexOf(e),r=t[i];this._activeItem=null==r?null:r,this._activeItemIndex=i}_setActiveItemByDelta(e){this._wrap?this._setActiveInWrapMode(e):this._setActiveInDefaultMode(e)}_setActiveInWrapMode(e){const t=this._getItemsArray();for(let i=1;i<=t.length;i++){const r=(this._activeItemIndex+e*i+t.length)%t.length;if(!this._skipPredicateFn(t[r]))return void this.setActiveItem(r)}}_setActiveInDefaultMode(e){this._setActiveItemByIndex(this._activeItemIndex+e,e)}_setActiveItemByIndex(e,t){const i=this._getItemsArray();if(i[e]){for(;this._skipPredicateFn(i[e]);)if(!i[e+=t])return;this.setActiveItem(e)}}_getItemsArray(){return this._items instanceof Sf?this._items.toArray():this._items}}class kV extends RV{setActiveItem(e){this.activeItem&&this.activeItem.setInactiveStyles(),super.setActiveItem(e),this.activeItem&&this.activeItem.setActiveStyles()}}class nO extends RV{constructor(){super(...arguments),this._origin="program"}setFocusOrigin(e){return this._origin=e,this}setActiveItem(e){super.setActiveItem(e),this.activeItem&&this.activeItem.focus(this._origin)}}let FV=(()=>{class n{constructor(t){this._platform=t}isDisabled(t){return t.hasAttribute("disabled")}isVisible(t){return function(n){return!!(n.offsetWidth||n.offsetHeight||"function"==typeof n.getClientRects&&n.getClientRects().length)}(t)&&"visible"===getComputedStyle(t).visibility}isTabbable(t){if(!this._platform.isBrowser)return!1;const i=function(n){try{return n.frameElement}catch(e){return null}}(function(n){return n.ownerDocument&&n.ownerDocument.defaultView||window}(t));if(i&&(-1===LV(i)||!this.isVisible(i)))return!1;let r=t.nodeName.toLowerCase(),s=LV(t);return t.hasAttribute("contenteditable")?-1!==s:!("iframe"===r||"object"===r||this._platform.WEBKIT&&this._platform.IOS&&!function(n){let e=n.nodeName.toLowerCase(),t="input"===e&&n.type;return"text"===t||"password"===t||"select"===e||"textarea"===e}(t))&&("audio"===r?!!t.hasAttribute("controls")&&-1!==s:"video"===r?-1!==s&&(null!==s||this._platform.FIREFOX||t.hasAttribute("controls")):t.tabIndex>=0)}isFocusable(t,i){return function(n){return!function(n){return function(n){return"input"==n.nodeName.toLowerCase()}(n)&&"hidden"==n.type}(n)&&(function(n){let e=n.nodeName.toLowerCase();return"input"===e||"select"===e||"button"===e||"textarea"===e}(n)||function(n){return function(n){return"a"==n.nodeName.toLowerCase()}(n)&&n.hasAttribute("href")}(n)||n.hasAttribute("contenteditable")||NV(n))}(t)&&!this.isDisabled(t)&&((null==i?void 0:i.ignoreVisibility)||this.isVisible(t))}}return n.\u0275fac=function(t){return new(t||n)(I(si))},n.\u0275prov=ue({factory:function(){return new n(I(si))},token:n,providedIn:"root"}),n})();function NV(n){if(!n.hasAttribute("tabindex")||void 0===n.tabIndex)return!1;let e=n.getAttribute("tabindex");return"-32768"!=e&&!(!e||isNaN(parseInt(e,10)))}function LV(n){if(!NV(n))return null;const e=parseInt(n.getAttribute("tabindex")||"",10);return isNaN(e)?-1:e}class Die{constructor(e,t,i,r,s=!1){this._element=e,this._checker=t,this._ngZone=i,this._document=r,this._hasAttached=!1,this.startAnchorListener=()=>this.focusLastTabbableElement(),this.endAnchorListener=()=>this.focusFirstTabbableElement(),this._enabled=!0,s||this.attachAnchors()}get enabled(){return this._enabled}set enabled(e){this._enabled=e,this._startAnchor&&this._endAnchor&&(this._toggleAnchorTabIndex(e,this._startAnchor),this._toggleAnchorTabIndex(e,this._endAnchor))}destroy(){const 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}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(e){return new Promise(t=>{this._executeOnStable(()=>t(this.focusInitialElement(e)))})}focusFirstTabbableElementWhenReady(e){return new Promise(t=>{this._executeOnStable(()=>t(this.focusFirstTabbableElement(e)))})}focusLastTabbableElementWhenReady(e){return new Promise(t=>{this._executeOnStable(()=>t(this.focusLastTabbableElement(e)))})}_getRegionBoundary(e){let t=this._element.querySelectorAll(`[cdk-focus-region-${e}], [cdkFocusRegion${e}], [cdk-focus-${e}]`);for(let i=0;i=0;i--){let r=t[i].nodeType===this._document.ELEMENT_NODE?this._getLastTabbableElement(t[i]):null;if(r)return r}return null}_createAnchor(){const 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}_toggleAnchorTabIndex(e,t){e?t.setAttribute("tabindex","0"):t.removeAttribute("tabindex")}toggleAnchors(e){this._startAnchor&&this._endAnchor&&(this._toggleAnchorTabIndex(e,this._startAnchor),this._toggleAnchorTabIndex(e,this._endAnchor))}_executeOnStable(e){this._ngZone.isStable?e():this._ngZone.onStable.pipe(yi(1)).subscribe(e)}}let BV=(()=>{class n{constructor(t,i,r){this._checker=t,this._ngZone=i,this._document=r}create(t,i=!1){return new Die(t,this._checker,this._ngZone,this._document,i)}}return n.\u0275fac=function(t){return new(t||n)(I(FV),I(dt),I(ut))},n.\u0275prov=ue({factory:function(){return new n(I(FV),I(dt),I(ut))},token:n,providedIn:"root"}),n})();function VV(n){return 0===n.offsetX&&0===n.offsetY}function zV(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 jV=new ve("cdk-input-modality-detector-options"),kie={ignoreKeys:[18,17,224,91,16]},nm=tm({passive:!0,capture:!0});let HV=(()=>{class n{constructor(t,i,r,s){this._platform=t,this._mostRecentTarget=null,this._modality=new ar(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=Nf(o))},this._onMousedown=o=>{Date.now()-this._lastTouchMs<650||(this._modality.next(VV(o)?"keyboard":"mouse"),this._mostRecentTarget=Nf(o))},this._onTouchstart=o=>{zV(o)?this._modality.next("keyboard"):(this._lastTouchMs=Date.now(),this._modality.next("touch"),this._mostRecentTarget=Nf(o))},this._options=Object.assign(Object.assign({},kie),s),this.modalityDetected=this._modality.pipe(QD(1)),this.modalityChanged=this.modalityDetected.pipe(Zo()),t.isBrowser&&i.runOutsideAngular(()=>{r.addEventListener("keydown",this._onKeydown,nm),r.addEventListener("mousedown",this._onMousedown,nm),r.addEventListener("touchstart",this._onTouchstart,nm)})}get mostRecentModality(){return this._modality.value}ngOnDestroy(){!this._platform.isBrowser||(document.removeEventListener("keydown",this._onKeydown,nm),document.removeEventListener("mousedown",this._onMousedown,nm),document.removeEventListener("touchstart",this._onTouchstart,nm))}}return n.\u0275fac=function(t){return new(t||n)(I(si),I(dt),I(ut),I(jV,8))},n.\u0275prov=ue({factory:function(){return new n(I(si),I(dt),I(ut),I(jV,8))},token:n,providedIn:"root"}),n})();const $V=new ve("liveAnnouncerElement",{providedIn:"root",factory:function(){return null}}),GV=new ve("LIVE_ANNOUNCER_DEFAULT_OPTIONS");let DE=(()=>{class n{constructor(t,i,r,s){this._ngZone=i,this._defaultOptions=s,this._document=r,this._liveElement=t||this._createLiveElement()}announce(t,...i){const r=this._defaultOptions;let s,o;return 1===i.length&&"number"==typeof i[0]?o=i[0]:[s,o]=i,this.clear(),clearTimeout(this._previousTimeout),s||(s=r&&r.politeness?r.politeness:"polite"),null==o&&r&&(o=r.duration),this._liveElement.setAttribute("aria-live",s),this._ngZone.runOutsideAngular(()=>new Promise(a=>{clearTimeout(this._previousTimeout),this._previousTimeout=setTimeout(()=>{this._liveElement.textContent=t,a(),"number"==typeof o&&(this._previousTimeout=setTimeout(()=>this.clear(),o))},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",i=this._document.getElementsByClassName(t),r=this._document.createElement("div");for(let s=0;s{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 Se,this._rootNodeFocusAndBlurListener=a=>{const l=Nf(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=Wu(t);if(!this._platform.isBrowser||1!==r.nodeType)return ht(null);const s=function(n){if(function(){if(null==eO){const n="undefined"!=typeof document?document.head:null;eO=!(!n||!n.createShadowRoot&&!n.attachShadow)}return eO}()){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 Se,rootNode:s};return this._elementInfo.set(r,a),this._registerGlobalListeners(a),a.subject}stopMonitoring(t){const i=Wu(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=Wu(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=Nf(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,OE),i.addEventListener("blur",this._rootNodeFocusAndBlurListener,OE)}),this._rootNodeFocusListenerCount.set(i,r+1),1==++this._monitoredElementCount&&(this._ngZone.runOutsideAngular(()=>{this._getWindow().addEventListener("focus",this._windowFocusListener)}),this._inputModalityDetector.modalityDetected.pipe(Tn(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,OE),i.removeEventListener("blur",this._rootNodeFocusAndBlurListener,OE),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)(I(dt),I(si),I(HV),I(ut,8),I(WV,8))},n.\u0275prov=ue({factory:function(){return new n(I(dt),I(si),I(HV),I(ut,8),I(WV,8))},token:n,providedIn:"root"}),n})();const qV="cdk-high-contrast-black-on-white",YV="cdk-high-contrast-white-on-black",iO="cdk-high-contrast-active";let XV=(()=>{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(iO),t.remove(qV),t.remove(YV),this._hasCheckedHighContrastMode=!0;const i=this.getHighContrastMode();1===i?(t.add(iO),t.add(qV)):2===i&&(t.add(iO),t.add(YV))}}}return n.\u0275fac=function(t){return new(t||n)(I(si),I(ut))},n.\u0275prov=ue({factory:function(){return new n(I(si),I(ut))},token:n,providedIn:"root"}),n})(),Nie=(()=>{class n{constructor(t){t._applyBodyHighContrastModeCssClasses()}}return n.\u0275fac=function(t){return new(t||n)(I(XV))},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[Rv,SE]]}),n})();const KV=new ve("cdk-dir-doc",{providedIn:"root",factory:function(){return Oc(ut)}});let Qo=(()=>{class n{constructor(t){if(this.value="ltr",this.change=new Le,t){const r=t.documentElement?t.documentElement.dir:null,s=(t.body?t.body.dir:null)||r;this.value="ltr"===s||"rtl"===s?s:"ltr"}}ngOnDestroy(){this.change.complete()}}return n.\u0275fac=function(t){return new(t||n)(I(KV,8))},n.\u0275prov=ue({factory:function(){return new n(I(KV,8))},token:n,providedIn:"root"}),n})(),Nv=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({}),n})();const ZV=new ju("12.2.5");function IE(...n){return uo(1)(ht(...n))}function Rr(...n){const e=n[n.length-1];return Gn(e)?(n.pop(),t=>IE(n,t,e)):t=>IE(n,t)}class QV{}const qu="*";function tc(n,e){return{type:7,name:n,definitions:e,options:{}}}function Ao(n,e=null){return{type:4,styles:e,timings:n}}function JV(n,e=null){return{type:2,steps:n,options:e}}function ti(n){return{type:6,styles:n,offset:null}}function wr(n,e,t){return{type:0,name:n,styles:e,options:t}}function zie(n){return{type:5,steps:n}}function Qs(n,e,t=null){return{type:1,expr:n,animation:e,options:t}}function jie(n=null){return{type:9,options:n}}function Uie(n,e,t=null){return{type:11,selector:n,animation:e,options:t}}function ez(n){Promise.resolve(null).then(n)}class im{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(){ez(()=>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}}class tz{constructor(e){this._onDoneFns=[],this._onStartFns=[],this._finished=!1,this._started=!1,this._destroyed=!1,this._onDestroyFns=[],this.parentPlayer=null,this.totalTime=0,this.players=e;let t=0,i=0,r=0;const s=this.players.length;0==s?ez(()=>this._onFinish()):this.players.forEach(o=>{o.onDone(()=>{++t==s&&this._onFinish()}),o.onDestroy(()=>{++i==s&&this._onDestroy()}),o.onStart(()=>{++r==s&&this._onStart()})}),this.totalTime=this.players.reduce((o,a)=>Math.max(o,a.totalTime),0)}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(e=>e()),this._onDoneFns=[])}init(){this.players.forEach(e=>e.init())}onStart(e){this._onStartFns.push(e)}_onStart(){this.hasStarted()||(this._started=!0,this._onStartFns.forEach(e=>e()),this._onStartFns=[])}onDone(e){this._onDoneFns.push(e)}onDestroy(e){this._onDestroyFns.push(e)}hasStarted(){return this._started}play(){this.parentPlayer||this.init(),this._onStart(),this.players.forEach(e=>e.play())}pause(){this.players.forEach(e=>e.pause())}restart(){this.players.forEach(e=>e.restart())}finish(){this._onFinish(),this.players.forEach(e=>e.finish())}destroy(){this._onDestroy()}_onDestroy(){this._destroyed||(this._destroyed=!0,this._onFinish(),this.players.forEach(e=>e.destroy()),this._onDestroyFns.forEach(e=>e()),this._onDestroyFns=[])}reset(){this.players.forEach(e=>e.reset()),this._destroyed=!1,this._finished=!1,this._started=!1}setPosition(e){const t=e*this.totalTime;this.players.forEach(i=>{const r=i.totalTime?Math.min(1,t/i.totalTime):1;i.setPosition(r)})}getPosition(){const e=this.players.reduce((t,i)=>null===t||i.totalTime>t.totalTime?i:t,null);return null!=e?e.getPosition():0}beforeDestroy(){this.players.forEach(e=>{e.beforeDestroy&&e.beforeDestroy()})}triggerCallback(e){const t="start"==e?this._onStartFns:this._onDoneFns;t.forEach(i=>i()),t.length=0}}function nz(){return"undefined"!=typeof window&&void 0!==window.document}function sO(){return"undefined"!=typeof process&&"[object process]"==={}.toString.call(process)}function rh(n){switch(n.length){case 0:return new im;case 1:return n[0];default:return new tz(n)}}function iz(n,e,t,i,r={},s={}){const o=[],a=[];let l=-1,c=null;if(i.forEach(d=>{const f=d.offset,p=f==l,g=p&&c||{};Object.keys(d).forEach(_=>{let y=_,v=d[_];if("offset"!==_)switch(y=e.normalizePropertyName(y,o),v){case"!":v=r[_];break;case qu:v=s[_];break;default:v=e.normalizeStyleValue(_,y,v,o)}g[y]=v}),p||a.push(g),c=g,l=f}),o.length){const d="\n - ";throw new Error(`Unable to animate due to the following errors:${d}${o.join(d)}`)}return a}function oO(n,e,t,i){switch(e){case"start":n.onStart(()=>i(t&&aO(t,"start",n)));break;case"done":n.onDone(()=>i(t&&aO(t,"done",n)));break;case"destroy":n.onDestroy(()=>i(t&&aO(t,"destroy",n)))}}function aO(n,e,t){const i=t.totalTime,s=lO(n.element,n.triggerName,n.fromState,n.toState,e||n.phaseName,null==i?n.totalTime:i,!!t.disabled),o=n._data;return null!=o&&(s._data=o),s}function lO(n,e,t,i,r="",s=0,o){return{element:n,triggerName:e,fromState:t,toState:i,phaseName:r,totalTime:s,disabled:!!o}}function Ma(n,e,t){let i;return n instanceof Map?(i=n.get(e),i||n.set(e,i=t)):(i=n[e],i||(i=n[e]=t)),i}function rz(n){const e=n.indexOf(":");return[n.substring(1,e),n.substr(e+1)]}let cO=(n,e)=>!1,uO=(n,e)=>!1,sz=(n,e,t)=>[];const oz=sO();(oz||"undefined"!=typeof Element)&&(cO=nz()?(n,e)=>{for(;e&&e!==document.documentElement;){if(e===n)return!0;e=e.parentNode||e.host}return!1}:(n,e)=>n.contains(e),uO=(()=>{if(oz||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]):uO}})(),sz=(n,e,t)=>{let i=[];if(t){const r=n.querySelectorAll(e);for(let s=0;s{const i=t.replace(/([a-z])([A-Z])/g,"$1-$2");e[i]=n[t]}),e}let cz=(()=>{class n{validateStyleProperty(t){return dO(t)}matchesElement(t,i){return hO(t,i)}containsElement(t,i){return fO(t,i)}query(t,i,r){return pO(t,i,r)}computeStyle(t,i,r){return r||""}animate(t,i,r,s,o,a=[],l){return new im(r,s)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();class PE{}PE.NOOP=new cz;const gO="ng-enter",RE="ng-leave",kE="ng-trigger",FE=".ng-trigger",dz="ng-animating",mO=".ng-animating";function Bf(n){if("number"==typeof n)return n;const e=n.match(/^(-?[\.\d]+)(m?s)/);return!e||e.length<2?0:_O(parseFloat(e[1]),e[2])}function _O(n,e){switch(e){case"s":return 1e3*n;default:return n}}function NE(n,e,t){return n.hasOwnProperty("duration")?n:function(n,e,t){let r,s=0,o="";if("string"==typeof n){const a=n.match(/^(-?[\.\d]+)(m?s)(?:\s+(-?[\.\d]+)(m?s))?(?:\s+([-a-z]+(?:\(.+?\))?))?$/i);if(null===a)return e.push(`The provided timing value "${n}" is invalid.`),{duration:0,delay:0,easing:""};r=_O(parseFloat(a[1]),a[2]);const l=a[3];null!=l&&(s=_O(parseFloat(l),a[4]));const c=a[5];c&&(o=c)}else r=n;if(!t){let a=!1,l=e.length;r<0&&(e.push("Duration values below 0 are not allowed for this animation step."),a=!0),s<0&&(e.push("Delay values below 0 are not allowed for this animation step."),a=!0),a&&e.splice(l,0,`The provided timing value "${n}" is invalid.`)}return{duration:r,delay:s,easing:o}}(n,e,t)}function rm(n,e={}){return Object.keys(n).forEach(t=>{e[t]=n[t]}),e}function sh(n,e,t={}){if(e)for(let i in n)t[i]=n[i];else rm(n,t);return t}function fz(n,e,t){return t?e+":"+t+";":""}function pz(n){let e="";for(let t=0;t{const r=vO(i);t&&!t.hasOwnProperty(i)&&(t[i]=n.style[r]),n.style[r]=e[i]}),sO()&&pz(n))}function Vf(n,e){n.style&&(Object.keys(e).forEach(t=>{const i=vO(t);n.style[i]=""}),sO()&&pz(n))}function Lv(n){return Array.isArray(n)?1==n.length?n[0]:JV(n):n}const yO=new RegExp("{{\\s*(.+?)\\s*}}","g");function gz(n){let e=[];if("string"==typeof n){let t;for(;t=yO.exec(n);)e.push(t[1]);yO.lastIndex=0}return e}function LE(n,e,t){const i=n.toString(),r=i.replace(yO,(s,o)=>{let a=e[o];return e.hasOwnProperty(o)||(t.push(`Please provide a value for the animation param ${o}`),a=""),a.toString()});return r==i?n:r}function BE(n){const e=[];let t=n.next();for(;!t.done;)e.push(t.value),t=n.next();return e}const Xie=/-+([a-z0-9])/g;function vO(n){return n.replace(Xie,(...e)=>e[1].toUpperCase())}function Kie(n){return n.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function mz(n,e){return 0===n||0===e}function _z(n,e,t){const i=Object.keys(t);if(i.length&&e.length){let s=e[0],o=[];if(i.forEach(a=>{s.hasOwnProperty(a)||o.push(a),s[a]=t[a]}),o.length)for(var r=1;rfunction(n,e,t){if(":"==n[0]){const l=function(n,e){switch(n){case":enter":return"void => *";case":leave":return"* => void";case":increment":return(t,i)=>parseFloat(i)>parseFloat(t);case":decrement":return(t,i)=>parseFloat(i) *"}}(n,t);if("function"==typeof l)return void e.push(l);n=l}const i=n.match(/^(\*|[-\w]+)\s*()\s*(\*|[-\w]+)$/);if(null==i||i.length<4)return t.push(`The provided transition expression "${n}" is not supported`),e;const r=i[1],s=i[2],o=i[3];e.push(yz(r,o));"<"==s[0]&&!("*"==r&&"*"==o)&&e.push(yz(o,r))}(i,t,e)):t.push(n),t}const zE=new Set(["true","1"]),jE=new Set(["false","0"]);function yz(n,e){const t=zE.has(n)||jE.has(n),i=zE.has(e)||jE.has(e);return(r,s)=>{let o="*"==n||n==r,a="*"==e||e==s;return!o&&t&&"boolean"==typeof r&&(o=r?zE.has(n):jE.has(n)),!a&&i&&"boolean"==typeof s&&(a=s?zE.has(e):jE.has(e)),o&&a}}const ere=new RegExp("s*:selfs*,?","g");function CO(n,e,t){return new tre(n).build(e,t)}class tre{constructor(e){this._driver=e}build(e,t){const i=new rre(t);return this._resetContextStyleTimingState(i),xa(this,Lv(e),i)}_resetContextStyleTimingState(e){e.currentQuerySelector="",e.collectedStyles={},e.collectedStyles[""]={},e.currentTime=0}visitTrigger(e,t){let i=t.queryCount=0,r=t.depCount=0;const s=[],o=[];return"@"==e.name.charAt(0)&&t.errors.push("animation triggers cannot be prefixed with an `@` sign (e.g. trigger('@foo', [...]))"),e.definitions.forEach(a=>{if(this._resetContextStyleTimingState(t),0==a.type){const l=a,c=l.name;c.toString().split(/\s*,\s*/).forEach(d=>{l.name=d,s.push(this.visitState(l,t))}),l.name=c}else if(1==a.type){const l=this.visitTransition(a,t);i+=l.queryCount,r+=l.depCount,o.push(l)}else t.errors.push("only state() and transition() definitions can sit inside of a trigger()")}),{type:7,name:e.name,states:s,transitions:o,queryCount:i,depCount:r,options:null}}visitState(e,t){const i=this.visitStyle(e.styles,t),r=e.options&&e.options.params||null;if(i.containsDynamicStyles){const s=new Set,o=r||{};if(i.styles.forEach(a=>{if(UE(a)){const l=a;Object.keys(l).forEach(c=>{gz(l[c]).forEach(d=>{o.hasOwnProperty(d)||s.add(d)})})}}),s.size){const a=BE(s.values());t.errors.push(`state("${e.name}", ...) must define default values for all the following style substitutions: ${a.join(", ")}`)}}return{type:0,name:e.name,style:i,options:r?{params:r}:null}}visitTransition(e,t){t.queryCount=0,t.depCount=0;const i=xa(this,Lv(e.animation),t);return{type:1,matchers:Zie(e.expr,t.errors),animation:i,queryCount:t.queryCount,depCount:t.depCount,options:zf(e.options)}}visitSequence(e,t){return{type:2,steps:e.steps.map(i=>xa(this,i,t)),options:zf(e.options)}}visitGroup(e,t){const i=t.currentTime;let r=0;const s=e.steps.map(o=>{t.currentTime=i;const a=xa(this,o,t);return r=Math.max(r,t.currentTime),a});return t.currentTime=r,{type:3,steps:s,options:zf(e.options)}}visitAnimate(e,t){const i=function(n,e){let t=null;if(n.hasOwnProperty("duration"))t=n;else if("number"==typeof n)return wO(NE(n,e).duration,0,"");const i=n;if(i.split(/\s+/).some(s=>"{"==s.charAt(0)&&"{"==s.charAt(1))){const s=wO(0,0,"");return s.dynamic=!0,s.strValue=i,s}return t=t||NE(i,e),wO(t.duration,t.delay,t.easing)}(e.timings,t.errors);t.currentAnimateTimings=i;let r,s=e.styles?e.styles:ti({});if(5==s.type)r=this.visitKeyframes(s,t);else{let o=e.styles,a=!1;if(!o){a=!0;const c={};i.easing&&(c.easing=i.easing),o=ti(c)}t.currentTime+=i.duration+i.delay;const l=this.visitStyle(o,t);l.isEmptyStep=a,r=l}return t.currentAnimateTimings=null,{type:4,timings:i,style:r,options:null}}visitStyle(e,t){const i=this._makeStyleAst(e,t);return this._validateStyleAst(i,t),i}_makeStyleAst(e,t){const i=[];Array.isArray(e.styles)?e.styles.forEach(o=>{"string"==typeof o?o==qu?i.push(o):t.errors.push(`The provided style string value ${o} is not allowed.`):i.push(o)}):i.push(e.styles);let r=!1,s=null;return i.forEach(o=>{if(UE(o)){const a=o,l=a.easing;if(l&&(s=l,delete a.easing),!r)for(let c in a)if(a[c].toString().indexOf("{{")>=0){r=!0;break}}}),{type:6,styles:i,easing:s,offset:e.offset,containsDynamicStyles:r,options:null}}_validateStyleAst(e,t){const i=t.currentAnimateTimings;let r=t.currentTime,s=t.currentTime;i&&s>0&&(s-=i.duration+i.delay),e.styles.forEach(o=>{"string"!=typeof o&&Object.keys(o).forEach(a=>{if(!this._driver.validateStyleProperty(a))return void t.errors.push(`The provided animation property "${a}" is not a supported CSS property for animations`);const l=t.collectedStyles[t.currentQuerySelector],c=l[a];let d=!0;c&&(s!=r&&s>=c.startTime&&r<=c.endTime&&(t.errors.push(`The CSS property "${a}" that exists between the times of "${c.startTime}ms" and "${c.endTime}ms" is also being animated in a parallel animation between the times of "${s}ms" and "${r}ms"`),d=!1),s=c.startTime),d&&(l[a]={startTime:s,endTime:r}),t.options&&function(n,e,t){const i=e.params||{},r=gz(n);r.length&&r.forEach(s=>{i.hasOwnProperty(s)||t.push(`Unable to resolve the local animation param ${s} in the given list of values`)})}(o[a],t.options,t.errors)})})}visitKeyframes(e,t){const i={type:5,styles:[],options:null};if(!t.currentAnimateTimings)return t.errors.push("keyframes() must be placed inside of a call to animate()"),i;let s=0;const o=[];let a=!1,l=!1,c=0;const d=e.steps.map(C=>{const w=this._makeStyleAst(C,t);let x=null!=w.offset?w.offset:function(n){if("string"==typeof n)return null;let e=null;if(Array.isArray(n))n.forEach(t=>{if(UE(t)&&t.hasOwnProperty("offset")){const i=t;e=parseFloat(i.offset),delete i.offset}});else if(UE(n)&&n.hasOwnProperty("offset")){const t=n;e=parseFloat(t.offset),delete t.offset}return e}(w.styles),N=0;return null!=x&&(s++,N=w.offset=x),l=l||N<0||N>1,a=a||N0&&s{const x=p>0?w==g?1:p*w:o[w],N=x*v;t.currentTime=_+y.delay+N,y.duration=N,this._validateStyleAst(C,t),C.offset=x,i.styles.push(C)}),i}visitReference(e,t){return{type:8,animation:xa(this,Lv(e.animation),t),options:zf(e.options)}}visitAnimateChild(e,t){return t.depCount++,{type:9,options:zf(e.options)}}visitAnimateRef(e,t){return{type:10,animation:this.visitReference(e.animation,t),options:zf(e.options)}}visitQuery(e,t){const i=t.currentQuerySelector,r=e.options||{};t.queryCount++,t.currentQuery=e;const[s,o]=function(n){const e=!!n.split(/\s*,\s*/).find(t=>":self"==t);return e&&(n=n.replace(ere,"")),[n=n.replace(/@\*/g,FE).replace(/@\w+/g,t=>FE+"-"+t.substr(1)).replace(/:animating/g,mO),e]}(e.selector);t.currentQuerySelector=i.length?i+" "+s:s,Ma(t.collectedStyles,t.currentQuerySelector,{});const a=xa(this,Lv(e.animation),t);return t.currentQuery=null,t.currentQuerySelector=i,{type:11,selector:s,limit:r.limit||0,optional:!!r.optional,includeSelf:o,animation:a,originalSelector:e.selector,options:zf(e.options)}}visitStagger(e,t){t.currentQuery||t.errors.push("stagger() can only be used inside of query()");const i="full"===e.timings?{duration:0,delay:0,easing:"full"}:NE(e.timings,t.errors,!0);return{type:12,animation:xa(this,Lv(e.animation),t),timings:i,options:null}}}class rre{constructor(e){this.errors=e,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 UE(n){return!Array.isArray(n)&&"object"==typeof n}function zf(n){return n?(n=rm(n)).params&&(n.params=function(n){return n?rm(n):null}(n.params)):n={},n}function wO(n,e,t){return{duration:n,delay:e,easing:t}}function EO(n,e,t,i,r,s,o=null,a=!1){return{type:1,element:n,keyframes:e,preStyleProps:t,postStyleProps:i,duration:r,delay:s,totalTime:r+s,easing:o,subTimeline:a}}class HE{constructor(){this._map=new Map}consume(e){let t=this._map.get(e);return t?this._map.delete(e):t=[],t}append(e,t){let i=this._map.get(e);i||this._map.set(e,i=[]),i.push(...t)}has(e){return this._map.has(e)}clear(){this._map.clear()}}const cre=new RegExp(":enter","g"),dre=new RegExp(":leave","g");function SO(n,e,t,i,r,s={},o={},a,l,c=[]){return(new hre).buildKeyframes(n,e,t,i,r,s,o,a,l,c)}class hre{buildKeyframes(e,t,i,r,s,o,a,l,c,d=[]){c=c||new HE;const f=new MO(e,t,c,r,s,d,[]);f.options=l,f.currentTimeline.setStyles([o],null,f.errors,l),xa(this,i,f);const p=f.timelines.filter(g=>g.containsAnimation());if(p.length&&Object.keys(a).length){const g=p[p.length-1];g.allowOnlyTimelineStyles()||g.setStyles([a],null,f.errors,l)}return p.length?p.map(g=>g.buildKeyframes()):[EO(t,[],[],[],0,0,"",!1)]}visitTrigger(e,t){}visitState(e,t){}visitTransition(e,t){}visitAnimateChild(e,t){const i=t.subInstructions.consume(t.element);if(i){const r=t.createSubContext(e.options),s=t.currentTimeline.currentTime,o=this._visitSubInstructions(i,r,r.options);s!=o&&t.transformIntoNewTimeline(o)}t.previousNode=e}visitAnimateRef(e,t){const i=t.createSubContext(e.options);i.transformIntoNewTimeline(),this.visitReference(e.animation,i),t.transformIntoNewTimeline(i.currentTimeline.currentTime),t.previousNode=e}_visitSubInstructions(e,t,i){let s=t.currentTimeline.currentTime;const o=null!=i.duration?Bf(i.duration):null,a=null!=i.delay?Bf(i.delay):null;return 0!==o&&e.forEach(l=>{const c=t.appendInstructionToTimeline(l,o,a);s=Math.max(s,c.duration+c.delay)}),s}visitReference(e,t){t.updateOptions(e.options,!0),xa(this,e.animation,t),t.previousNode=e}visitSequence(e,t){const i=t.subContextCount;let r=t;const s=e.options;if(s&&(s.params||s.delay)&&(r=t.createSubContext(s),r.transformIntoNewTimeline(),null!=s.delay)){6==r.previousNode.type&&(r.currentTimeline.snapshotCurrentStyles(),r.previousNode=$E);const o=Bf(s.delay);r.delayNextStep(o)}e.steps.length&&(e.steps.forEach(o=>xa(this,o,r)),r.currentTimeline.applyStylesToKeyframe(),r.subContextCount>i&&r.transformIntoNewTimeline()),t.previousNode=e}visitGroup(e,t){const i=[];let r=t.currentTimeline.currentTime;const s=e.options&&e.options.delay?Bf(e.options.delay):0;e.steps.forEach(o=>{const a=t.createSubContext(e.options);s&&a.delayNextStep(s),xa(this,o,a),r=Math.max(r,a.currentTimeline.currentTime),i.push(a.currentTimeline)}),i.forEach(o=>t.currentTimeline.mergeTimelineCollectedStyles(o)),t.transformIntoNewTimeline(r),t.previousNode=e}_visitTiming(e,t){if(e.dynamic){const i=e.strValue;return NE(t.params?LE(i,t.params,t.errors):i,t.errors)}return{duration:e.duration,delay:e.delay,easing:e.easing}}visitAnimate(e,t){const i=t.currentAnimateTimings=this._visitTiming(e.timings,t),r=t.currentTimeline;i.delay&&(t.incrementTime(i.delay),r.snapshotCurrentStyles());const s=e.style;5==s.type?this.visitKeyframes(s,t):(t.incrementTime(i.duration),this.visitStyle(s,t),r.applyStylesToKeyframe()),t.currentAnimateTimings=null,t.previousNode=e}visitStyle(e,t){const i=t.currentTimeline,r=t.currentAnimateTimings;!r&&i.getCurrentStyleProperties().length&&i.forwardFrame();const s=r&&r.easing||e.easing;e.isEmptyStep?i.applyEmptyStep(s):i.setStyles(e.styles,s,t.errors,t.options),t.previousNode=e}visitKeyframes(e,t){const i=t.currentAnimateTimings,r=t.currentTimeline.duration,s=i.duration,a=t.createSubContext().currentTimeline;a.easing=i.easing,e.styles.forEach(l=>{a.forwardTime((l.offset||0)*s),a.setStyles(l.styles,l.easing,t.errors,t.options),a.applyStylesToKeyframe()}),t.currentTimeline.mergeTimelineCollectedStyles(a),t.transformIntoNewTimeline(r+s),t.previousNode=e}visitQuery(e,t){const i=t.currentTimeline.currentTime,r=e.options||{},s=r.delay?Bf(r.delay):0;s&&(6===t.previousNode.type||0==i&&t.currentTimeline.getCurrentStyleProperties().length)&&(t.currentTimeline.snapshotCurrentStyles(),t.previousNode=$E);let o=i;const a=t.invokeQuery(e.selector,e.originalSelector,e.limit,e.includeSelf,!!r.optional,t.errors);t.currentQueryTotal=a.length;let l=null;a.forEach((c,d)=>{t.currentQueryIndex=d;const f=t.createSubContext(e.options,c);s&&f.delayNextStep(s),c===t.element&&(l=f.currentTimeline),xa(this,e.animation,f),f.currentTimeline.applyStylesToKeyframe(),o=Math.max(o,f.currentTimeline.currentTime)}),t.currentQueryIndex=0,t.currentQueryTotal=0,t.transformIntoNewTimeline(o),l&&(t.currentTimeline.mergeTimelineCollectedStyles(l),t.currentTimeline.snapshotCurrentStyles()),t.previousNode=e}visitStagger(e,t){const i=t.parentContext,r=t.currentTimeline,s=e.timings,o=Math.abs(s.duration),a=o*(t.currentQueryTotal-1);let l=o*t.currentQueryIndex;switch(s.duration<0?"reverse":s.easing){case"reverse":l=a-l;break;case"full":l=i.currentStaggerTime}const d=t.currentTimeline;l&&d.delayNextStep(l);const f=d.currentTime;xa(this,e.animation,t),t.previousNode=e,i.currentStaggerTime=r.currentTime-f+(r.startTime-i.currentTimeline.startTime)}}const $E={};class MO{constructor(e,t,i,r,s,o,a,l){this._driver=e,this.element=t,this.subInstructions=i,this._enterClassName=r,this._leaveClassName=s,this.errors=o,this.timelines=a,this.parentContext=null,this.currentAnimateTimings=null,this.previousNode=$E,this.subContextCount=0,this.options={},this.currentQueryIndex=0,this.currentQueryTotal=0,this.currentStaggerTime=0,this.currentTimeline=l||new GE(this._driver,t,0),a.push(this.currentTimeline)}get params(){return this.options.params}updateOptions(e,t){if(!e)return;const i=e;let r=this.options;null!=i.duration&&(r.duration=Bf(i.duration)),null!=i.delay&&(r.delay=Bf(i.delay));const s=i.params;if(s){let o=r.params;o||(o=this.options.params={}),Object.keys(s).forEach(a=>{(!t||!o.hasOwnProperty(a))&&(o[a]=LE(s[a],o,this.errors))})}}_copyOptions(){const e={};if(this.options){const t=this.options.params;if(t){const i=e.params={};Object.keys(t).forEach(r=>{i[r]=t[r]})}}return e}createSubContext(e=null,t,i){const r=t||this.element,s=new MO(this._driver,r,this.subInstructions,this._enterClassName,this._leaveClassName,this.errors,this.timelines,this.currentTimeline.fork(r,i||0));return s.previousNode=this.previousNode,s.currentAnimateTimings=this.currentAnimateTimings,s.options=this._copyOptions(),s.updateOptions(e),s.currentQueryIndex=this.currentQueryIndex,s.currentQueryTotal=this.currentQueryTotal,s.parentContext=this,this.subContextCount++,s}transformIntoNewTimeline(e){return this.previousNode=$E,this.currentTimeline=this.currentTimeline.fork(this.element,e),this.timelines.push(this.currentTimeline),this.currentTimeline}appendInstructionToTimeline(e,t,i){const r={duration:null!=t?t:e.duration,delay:this.currentTimeline.currentTime+(null!=i?i:0)+e.delay,easing:""},s=new fre(this._driver,e.element,e.keyframes,e.preStyleProps,e.postStyleProps,r,e.stretchStartingKeyframe);return this.timelines.push(s),r}incrementTime(e){this.currentTimeline.forwardTime(this.currentTimeline.duration+e)}delayNextStep(e){e>0&&this.currentTimeline.delayNextStep(e)}invokeQuery(e,t,i,r,s,o){let a=[];if(r&&a.push(this.element),e.length>0){e=(e=e.replace(cre,"."+this._enterClassName)).replace(dre,"."+this._leaveClassName);let c=this._driver.query(this.element,e,1!=i);0!==i&&(c=i<0?c.slice(c.length+i,c.length):c.slice(0,i)),a.push(...c)}return!s&&0==a.length&&o.push(`\`query("${t}")\` returned zero elements. (Use \`query("${t}", { optional: true })\` if you wish to allow this.)`),a}}class GE{constructor(e,t,i,r){this._driver=e,this.element=t,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(t),this._globalTimelineStyles||(this._globalTimelineStyles=this._localTimelineStyles,this._elementTimelineStylesLookup.set(t,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(e){const t=1==this._keyframes.size&&Object.keys(this._pendingStyles).length;this.duration||t?(this.forwardTime(this.currentTime+e),t&&this.snapshotCurrentStyles()):this.startTime+=e}fork(e,t){return this.applyStylesToKeyframe(),new GE(this._driver,e,t||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(e){this.applyStylesToKeyframe(),this.duration=e,this._loadKeyframe()}_updateStyle(e,t){this._localTimelineStyles[e]=t,this._globalTimelineStyles[e]=t,this._styleSummary[e]={time:this.currentTime,value:t}}allowOnlyTimelineStyles(){return this._currentEmptyStepKeyframe!==this._currentKeyframe}applyEmptyStep(e){e&&(this._previousKeyframe.easing=e),Object.keys(this._globalTimelineStyles).forEach(t=>{this._backFill[t]=this._globalTimelineStyles[t]||qu,this._currentKeyframe[t]=qu}),this._currentEmptyStepKeyframe=this._currentKeyframe}setStyles(e,t,i,r){t&&(this._previousKeyframe.easing=t);const s=r&&r.params||{},o=function(n,e){const t={};let i;return n.forEach(r=>{"*"===r?(i=i||Object.keys(e),i.forEach(s=>{t[s]=qu})):sh(r,!1,t)}),t}(e,this._globalTimelineStyles);Object.keys(o).forEach(a=>{const l=LE(o[a],s,i);this._pendingStyles[a]=l,this._localTimelineStyles.hasOwnProperty(a)||(this._backFill[a]=this._globalTimelineStyles.hasOwnProperty(a)?this._globalTimelineStyles[a]:qu),this._updateStyle(a,l)})}applyStylesToKeyframe(){const e=this._pendingStyles,t=Object.keys(e);0!=t.length&&(this._pendingStyles={},t.forEach(i=>{this._currentKeyframe[i]=e[i]}),Object.keys(this._localTimelineStyles).forEach(i=>{this._currentKeyframe.hasOwnProperty(i)||(this._currentKeyframe[i]=this._localTimelineStyles[i])}))}snapshotCurrentStyles(){Object.keys(this._localTimelineStyles).forEach(e=>{const t=this._localTimelineStyles[e];this._pendingStyles[e]=t,this._updateStyle(e,t)})}getFinalKeyframe(){return this._keyframes.get(this.duration)}get properties(){const e=[];for(let t in this._currentKeyframe)e.push(t);return e}mergeTimelineCollectedStyles(e){Object.keys(e._styleSummary).forEach(t=>{const i=this._styleSummary[t],r=e._styleSummary[t];(!i||r.time>i.time)&&this._updateStyle(t,r.value)})}buildKeyframes(){this.applyStylesToKeyframe();const e=new Set,t=new Set,i=1===this._keyframes.size&&0===this.duration;let r=[];this._keyframes.forEach((a,l)=>{const c=sh(a,!0);Object.keys(c).forEach(d=>{const f=c[d];"!"==f?e.add(d):f==qu&&t.add(d)}),i||(c.offset=l/this.duration),r.push(c)});const s=e.size?BE(e.values()):[],o=t.size?BE(t.values()):[];if(i){const a=r[0],l=rm(a);a.offset=0,l.offset=1,r=[a,l]}return EO(this.element,r,s,o,this.duration,this.startTime,this.easing,!1)}}class fre extends GE{constructor(e,t,i,r,s,o,a=!1){super(e,t,o.delay),this.keyframes=i,this.preStyleProps=r,this.postStyleProps=s,this._stretchStartingKeyframe=a,this.timings={duration:o.duration,delay:o.delay,easing:o.easing}}containsAnimation(){return this.keyframes.length>1}buildKeyframes(){let e=this.keyframes,{delay:t,duration:i,easing:r}=this.timings;if(this._stretchStartingKeyframe&&t){const s=[],o=i+t,a=t/o,l=sh(e[0],!1);l.offset=0,s.push(l);const c=sh(e[0],!1);c.offset=Cz(a),s.push(c);const d=e.length-1;for(let f=1;f<=d;f++){let p=sh(e[f],!1);p.offset=Cz((t+p.offset*i)/o),s.push(p)}i=o,t=0,r="",e=s}return EO(this.element,e,this.preStyleProps,this.postStyleProps,i,t,r,!0)}}function Cz(n,e=3){const t=Math.pow(10,e-1);return Math.round(n*t)/t}class xO{}class gre extends xO{normalizePropertyName(e,t){return vO(e)}normalizeStyleValue(e,t,i,r){let s="";const o=i.toString().trim();if(mre[t]&&0!==i&&"0"!==i)if("number"==typeof i)s="px";else{const a=i.match(/^[+-]?[\d\.]+([a-z]*)$/);a&&0==a[1].length&&r.push(`Please provide a CSS unit value for ${e}:${i}`)}return o+s}}const mre=(()=>function(n){const e={};return n.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 wz(n,e,t,i,r,s,o,a,l,c,d,f,p){return{type:0,element:n,triggerName:e,isRemovalTransition:r,fromState:t,fromStyles:s,toState:i,toStyles:o,timelines:a,queriedElements:l,preStyleProps:c,postStyleProps:d,totalTime:f,errors:p}}const TO={};class Ez{constructor(e,t,i){this._triggerName=e,this.ast=t,this._stateStyles=i}match(e,t,i,r){return function(n,e,t,i,r){return n.some(s=>s(e,t,i,r))}(this.ast.matchers,e,t,i,r)}buildStyles(e,t,i){const r=this._stateStyles["*"],s=this._stateStyles[e],o=r?r.buildStyles(t,i):{};return s?s.buildStyles(t,i):o}build(e,t,i,r,s,o,a,l,c,d){const f=[],p=this.ast.options&&this.ast.options.params||TO,_=this.buildStyles(i,a&&a.params||TO,f),y=l&&l.params||TO,v=this.buildStyles(r,y,f),C=new Set,w=new Map,x=new Map,N="void"===r,V={params:Object.assign(Object.assign({},p),y)},U=d?[]:SO(e,t,this.ast.animation,s,o,_,v,V,c,f);let ee=0;if(U.forEach(ae=>{ee=Math.max(ae.duration+ae.delay,ee)}),f.length)return wz(t,this._triggerName,i,r,N,_,v,[],[],w,x,ee,f);U.forEach(ae=>{const me=ae.element,Ee=Ma(w,me,{});ae.preStyleProps.forEach(te=>Ee[te]=!0);const Be=Ma(x,me,{});ae.postStyleProps.forEach(te=>Be[te]=!0),me!==t&&C.add(me)});const de=BE(C.values());return wz(t,this._triggerName,i,r,N,_,v,U,de,w,x,ee)}}class vre{constructor(e,t,i){this.styles=e,this.defaultParams=t,this.normalizer=i}buildStyles(e,t){const i={},r=rm(this.defaultParams);return Object.keys(e).forEach(s=>{const o=e[s];null!=o&&(r[s]=o)}),this.styles.styles.forEach(s=>{if("string"!=typeof s){const o=s;Object.keys(o).forEach(a=>{let l=o[a];l.length>1&&(l=LE(l,r,t));const c=this.normalizer.normalizePropertyName(a,t);l=this.normalizer.normalizeStyleValue(a,c,l,t),i[c]=l})}}),i}}class Cre{constructor(e,t,i){this.name=e,this.ast=t,this._normalizer=i,this.transitionFactories=[],this.states={},t.states.forEach(r=>{this.states[r.name]=new vre(r.style,r.options&&r.options.params||{},i)}),Sz(this.states,"true","1"),Sz(this.states,"false","0"),t.transitions.forEach(r=>{this.transitionFactories.push(new Ez(e,r,this.states))}),this.fallbackTransition=function(n,e,t){return new Ez(n,{type:1,animation:{type:2,steps:[],options:null},matchers:[(o,a)=>!0],options:null,queryCount:0,depCount:0},e)}(e,this.states)}get containsQueries(){return this.ast.queryCount>0}matchTransition(e,t,i,r){return this.transitionFactories.find(o=>o.match(e,t,i,r))||null}matchStyles(e,t,i){return this.fallbackTransition.buildStyles(e,t,i)}}function Sz(n,e,t){n.hasOwnProperty(e)?n.hasOwnProperty(t)||(n[t]=n[e]):n.hasOwnProperty(t)&&(n[e]=n[t])}const Ere=new HE;class Sre{constructor(e,t,i){this.bodyNode=e,this._driver=t,this._normalizer=i,this._animations={},this._playersById={},this.players=[]}register(e,t){const i=[],r=CO(this._driver,t,i);if(i.length)throw new Error(`Unable to build the animation due to the following errors: ${i.join("\n")}`);this._animations[e]=r}_buildPlayer(e,t,i){const r=e.element,s=iz(0,this._normalizer,0,e.keyframes,t,i);return this._driver.animate(r,s,e.duration,e.delay,e.easing,[],!0)}create(e,t,i={}){const r=[],s=this._animations[e];let o;const a=new Map;if(s?(o=SO(this._driver,t,s,gO,RE,{},{},i,Ere,r),o.forEach(d=>{const f=Ma(a,d.element,{});d.postStyleProps.forEach(p=>f[p]=null)})):(r.push("The requested animation doesn't exist or has already been destroyed"),o=[]),r.length)throw new Error(`Unable to create the animation due to the following errors: ${r.join("\n")}`);a.forEach((d,f)=>{Object.keys(d).forEach(p=>{d[p]=this._driver.computeStyle(f,p,qu)})});const c=rh(o.map(d=>{const f=a.get(d.element);return this._buildPlayer(d,{},f)}));return this._playersById[e]=c,c.onDestroy(()=>this.destroy(e)),this.players.push(c),c}destroy(e){const t=this._getPlayer(e);t.destroy(),delete this._playersById[e];const i=this.players.indexOf(t);i>=0&&this.players.splice(i,1)}_getPlayer(e){const t=this._playersById[e];if(!t)throw new Error(`Unable to find the timeline player referenced by ${e}`);return t}listen(e,t,i,r){const s=lO(t,"","","");return oO(this._getPlayer(e),i,s,r),()=>{}}command(e,t,i,r){if("register"==i)return void this.register(e,r[0]);if("create"==i)return void this.create(e,t,r[0]||{});const s=this._getPlayer(e);switch(i){case"play":s.play();break;case"pause":s.pause();break;case"reset":s.reset();break;case"restart":s.restart();break;case"finish":s.finish();break;case"init":s.init();break;case"setPosition":s.setPosition(parseFloat(r[0]));break;case"destroy":this.destroy(e)}}}const Mz="ng-animate-queued",xz="ng-animate-disabled",Tz=".ng-animate-disabled",Are=[],Az={namespaceId:"",setForRemoval:!1,setForMove:!1,hasAnimation:!1,removedBeforeQueried:!1},Dre={namespaceId:"",setForMove:!1,setForRemoval:!1,hasAnimation:!1,removedBeforeQueried:!0},gl="__ng_removed";class AO{constructor(e,t=""){this.namespaceId=t;const i=e&&e.hasOwnProperty("value");if(this.value=function(n){return null!=n?n:null}(i?e.value:e),i){const s=rm(e);delete s.value,this.options=s}else this.options={};this.options.params||(this.options.params={})}get params(){return this.options.params}absorbOptions(e){const t=e.params;if(t){const i=this.options.params;Object.keys(t).forEach(r=>{null==i[r]&&(i[r]=t[r])})}}}const Bv="void",DO=new AO(Bv);class Ore{constructor(e,t,i){this.id=e,this.hostElement=t,this._engine=i,this.players=[],this._triggers={},this._queue=[],this._elementListeners=new Map,this._hostClassName="ng-tns-"+e,ml(t,this._hostClassName)}listen(e,t,i,r){if(!this._triggers.hasOwnProperty(t))throw new Error(`Unable to listen on the animation trigger event "${i}" because the animation trigger "${t}" doesn't exist!`);if(null==i||0==i.length)throw new Error(`Unable to listen on the animation trigger "${t}" because the provided event is undefined!`);if(!function(n){return"start"==n||"done"==n}(i))throw new Error(`The provided animation trigger event "${i}" for the animation trigger "${t}" is not supported!`);const s=Ma(this._elementListeners,e,[]),o={name:t,phase:i,callback:r};s.push(o);const a=Ma(this._engine.statesByElement,e,{});return a.hasOwnProperty(t)||(ml(e,kE),ml(e,kE+"-"+t),a[t]=DO),()=>{this._engine.afterFlush(()=>{const l=s.indexOf(o);l>=0&&s.splice(l,1),this._triggers[t]||delete a[t]})}}register(e,t){return!this._triggers[e]&&(this._triggers[e]=t,!0)}_getTrigger(e){const t=this._triggers[e];if(!t)throw new Error(`The provided animation trigger "${e}" has not been registered!`);return t}trigger(e,t,i,r=!0){const s=this._getTrigger(t),o=new OO(this.id,t,e);let a=this._engine.statesByElement.get(e);a||(ml(e,kE),ml(e,kE+"-"+t),this._engine.statesByElement.set(e,a={}));let l=a[t];const c=new AO(i,this.id);if(!(i&&i.hasOwnProperty("value"))&&l&&c.absorbOptions(l.options),a[t]=c,l||(l=DO),c.value!==Bv&&l.value===c.value){if(!function(n,e){const t=Object.keys(n),i=Object.keys(e);if(t.length!=i.length)return!1;for(let r=0;r{Vf(e,v),Gc(e,C)})}return}const p=Ma(this._engine.playersByElement,e,[]);p.forEach(y=>{y.namespaceId==this.id&&y.triggerName==t&&y.queued&&y.destroy()});let g=s.matchTransition(l.value,c.value,e,c.params),_=!1;if(!g){if(!r)return;g=s.fallbackTransition,_=!0}return this._engine.totalQueuedPlayers++,this._queue.push({element:e,triggerName:t,transition:g,fromState:l,toState:c,player:o,isFallbackTransition:_}),_||(ml(e,Mz),o.onStart(()=>{sm(e,Mz)})),o.onDone(()=>{let y=this.players.indexOf(o);y>=0&&this.players.splice(y,1);const v=this._engine.playersByElement.get(e);if(v){let C=v.indexOf(o);C>=0&&v.splice(C,1)}}),this.players.push(o),p.push(o),o}deregister(e){delete this._triggers[e],this._engine.statesByElement.forEach((t,i)=>{delete t[e]}),this._elementListeners.forEach((t,i)=>{this._elementListeners.set(i,t.filter(r=>r.name!=e))})}clearElementCache(e){this._engine.statesByElement.delete(e),this._elementListeners.delete(e);const t=this._engine.playersByElement.get(e);t&&(t.forEach(i=>i.destroy()),this._engine.playersByElement.delete(e))}_signalRemovalForInnerTriggers(e,t){const i=this._engine.driver.query(e,FE,!0);i.forEach(r=>{if(r[gl])return;const s=this._engine.fetchNamespacesByElement(r);s.size?s.forEach(o=>o.triggerLeaveAnimation(r,t,!1,!0)):this.clearElementCache(r)}),this._engine.afterFlushAnimationsDone(()=>i.forEach(r=>this.clearElementCache(r)))}triggerLeaveAnimation(e,t,i,r){const s=this._engine.statesByElement.get(e);if(s){const o=[];if(Object.keys(s).forEach(a=>{if(this._triggers[a]){const l=this.trigger(e,a,Bv,r);l&&o.push(l)}}),o.length)return this._engine.markElementAsRemoved(this.id,e,!0,t),i&&rh(o).onDone(()=>this._engine.processLeaveNode(e)),!0}return!1}prepareLeaveAnimationListeners(e){const t=this._elementListeners.get(e),i=this._engine.statesByElement.get(e);if(t&&i){const r=new Set;t.forEach(s=>{const o=s.name;if(r.has(o))return;r.add(o);const l=this._triggers[o].fallbackTransition,c=i[o]||DO,d=new AO(Bv),f=new OO(this.id,o,e);this._engine.totalQueuedPlayers++,this._queue.push({element:e,triggerName:o,transition:l,fromState:c,toState:d,player:f,isFallbackTransition:!0})})}}removeNode(e,t){const i=this._engine;if(e.childElementCount&&this._signalRemovalForInnerTriggers(e,t),this.triggerLeaveAnimation(e,t,!0))return;let r=!1;if(i.totalAnimations){const s=i.players.length?i.playersByQueriedElement.get(e):[];if(s&&s.length)r=!0;else{let o=e;for(;o=o.parentNode;)if(i.statesByElement.get(o)){r=!0;break}}}if(this.prepareLeaveAnimationListeners(e),r)i.markElementAsRemoved(this.id,e,!1,t);else{const s=e[gl];(!s||s===Az)&&(i.afterFlush(()=>this.clearElementCache(e)),i.destroyInnerAnimations(e),i._onRemovalComplete(e,t))}}insertNode(e,t){ml(e,this._hostClassName)}drainQueuedTransitions(e){const t=[];return this._queue.forEach(i=>{const r=i.player;if(r.destroyed)return;const s=i.element,o=this._elementListeners.get(s);o&&o.forEach(a=>{if(a.name==i.triggerName){const l=lO(s,i.triggerName,i.fromState.value,i.toState.value);l._data=e,oO(i.player,a.phase,l,a.callback)}}),r.markedForDestroy?this._engine.afterFlush(()=>{r.destroy()}):t.push(i)}),this._queue=[],t.sort((i,r)=>{const s=i.transition.ast.depCount,o=r.transition.ast.depCount;return 0==s||0==o?s-o:this._engine.driver.containsElement(i.element,r.element)?1:-1})}destroy(e){this.players.forEach(t=>t.destroy()),this._signalRemovalForInnerTriggers(this.hostElement,e)}elementContainsData(e){let t=!1;return this._elementListeners.has(e)&&(t=!0),t=!!this._queue.find(i=>i.element===e)||t,t}}class Ire{constructor(e,t,i){this.bodyNode=e,this.driver=t,this._normalizer=i,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=(r,s)=>{}}_onRemovalComplete(e,t){this.onRemovalComplete(e,t)}get queuedPlayers(){const e=[];return this._namespaceList.forEach(t=>{t.players.forEach(i=>{i.queued&&e.push(i)})}),e}createNamespace(e,t){const i=new Ore(e,t,this);return this.bodyNode&&this.driver.containsElement(this.bodyNode,t)?this._balanceNamespaceList(i,t):(this.newHostElements.set(t,i),this.collectEnterElement(t)),this._namespaceLookup[e]=i}_balanceNamespaceList(e,t){const i=this._namespaceList.length-1;if(i>=0){let r=!1;for(let s=i;s>=0;s--)if(this.driver.containsElement(this._namespaceList[s].hostElement,t)){this._namespaceList.splice(s+1,0,e),r=!0;break}r||this._namespaceList.splice(0,0,e)}else this._namespaceList.push(e);return this.namespacesByHostElement.set(t,e),e}register(e,t){let i=this._namespaceLookup[e];return i||(i=this.createNamespace(e,t)),i}registerTrigger(e,t,i){let r=this._namespaceLookup[e];r&&r.register(t,i)&&this.totalAnimations++}destroy(e,t){if(!e)return;const i=this._fetchNamespace(e);this.afterFlush(()=>{this.namespacesByHostElement.delete(i.hostElement),delete this._namespaceLookup[e];const r=this._namespaceList.indexOf(i);r>=0&&this._namespaceList.splice(r,1)}),this.afterFlushAnimationsDone(()=>i.destroy(t))}_fetchNamespace(e){return this._namespaceLookup[e]}fetchNamespacesByElement(e){const t=new Set,i=this.statesByElement.get(e);if(i){const r=Object.keys(i);for(let s=0;s=0&&this.collectedLeaveElements.splice(o,1)}if(e){const o=this._fetchNamespace(e);o&&o.insertNode(t,i)}r&&this.collectEnterElement(t)}collectEnterElement(e){this.collectedEnterElements.push(e)}markElementAsDisabled(e,t){t?this.disabledNodes.has(e)||(this.disabledNodes.add(e),ml(e,xz)):this.disabledNodes.has(e)&&(this.disabledNodes.delete(e),sm(e,xz))}removeNode(e,t,i,r){if(WE(t)){const s=e?this._fetchNamespace(e):null;if(s?s.removeNode(t,r):this.markElementAsRemoved(e,t,!1,r),i){const o=this.namespacesByHostElement.get(t);o&&o.id!==e&&o.removeNode(t,r)}}else this._onRemovalComplete(t,r)}markElementAsRemoved(e,t,i,r){this.collectedLeaveElements.push(t),t[gl]={namespaceId:e,setForRemoval:r,hasAnimation:i,removedBeforeQueried:!1}}listen(e,t,i,r,s){return WE(t)?this._fetchNamespace(e).listen(t,i,r,s):()=>{}}_buildInstruction(e,t,i,r,s){return e.transition.build(this.driver,e.element,e.fromState.value,e.toState.value,i,r,e.fromState.options,e.toState.options,t,s)}destroyInnerAnimations(e){let t=this.driver.query(e,FE,!0);t.forEach(i=>this.destroyActiveAnimationsForElement(i)),0!=this.playersByQueriedElement.size&&(t=this.driver.query(e,mO,!0),t.forEach(i=>this.finishActiveQueriedAnimationOnElement(i)))}destroyActiveAnimationsForElement(e){const t=this.playersByElement.get(e);t&&t.forEach(i=>{i.queued?i.markedForDestroy=!0:i.destroy()})}finishActiveQueriedAnimationOnElement(e){const t=this.playersByQueriedElement.get(e);t&&t.forEach(i=>i.finish())}whenRenderingDone(){return new Promise(e=>{if(this.players.length)return rh(this.players).onDone(()=>e());e()})}processLeaveNode(e){const t=e[gl];if(t&&t.setForRemoval){if(e[gl]=Az,t.namespaceId){this.destroyInnerAnimations(e);const i=this._fetchNamespace(t.namespaceId);i&&i.clearElementCache(e)}this._onRemovalComplete(e,t.setForRemoval)}this.driver.matchesElement(e,Tz)&&this.markElementAsDisabled(e,!1),this.driver.query(e,Tz,!0).forEach(i=>{this.markElementAsDisabled(i,!1)})}flush(e=-1){let t=[];if(this.newHostElements.size&&(this.newHostElements.forEach((i,r)=>this._balanceNamespaceList(i,r)),this.newHostElements.clear()),this.totalAnimations&&this.collectedEnterElements.length)for(let i=0;ii()),this._flushFns=[],this._whenQuietFns.length){const i=this._whenQuietFns;this._whenQuietFns=[],t.length?rh(t).onDone(()=>{i.forEach(r=>r())}):i.forEach(r=>r())}}reportError(e){throw new Error(`Unable to process animations due to the following failed trigger transitions\n ${e.join("\n")}`)}_flushAnimations(e,t){const i=new HE,r=[],s=new Map,o=[],a=new Map,l=new Map,c=new Map,d=new Set;this.disabledNodes.forEach(Q=>{d.add(Q);const je=this.driver.query(Q,".ng-animate-queued",!0);for(let $e=0;$e{const $e=gO+y++;_.set(je,$e),Q.forEach(qe=>ml(qe,$e))});const v=[],C=new Set,w=new Set;for(let Q=0;QC.add(qe)):w.add(je))}const x=new Map,N=Iz(p,Array.from(C));N.forEach((Q,je)=>{const $e=RE+y++;x.set(je,$e),Q.forEach(qe=>ml(qe,$e))}),e.push(()=>{g.forEach((Q,je)=>{const $e=_.get(je);Q.forEach(qe=>sm(qe,$e))}),N.forEach((Q,je)=>{const $e=x.get(je);Q.forEach(qe=>sm(qe,$e))}),v.forEach(Q=>{this.processLeaveNode(Q)})});const V=[],U=[];for(let Q=this._namespaceList.length-1;Q>=0;Q--)this._namespaceList[Q].drainQueuedTransitions(t).forEach($e=>{const qe=$e.player,Ot=$e.element;if(V.push(qe),this.collectedEnterElements.length){const gi=Ot[gl];if(gi&&gi.setForMove)return void qe.destroy()}const Hn=!f||!this.driver.containsElement(f,Ot),ot=x.get(Ot),nr=_.get(Ot),Ln=this._buildInstruction($e,i,nr,ot,Hn);if(Ln.errors&&Ln.errors.length)U.push(Ln);else{if(Hn)return qe.onStart(()=>Vf(Ot,Ln.fromStyles)),qe.onDestroy(()=>Gc(Ot,Ln.toStyles)),void r.push(qe);if($e.isFallbackTransition)return qe.onStart(()=>Vf(Ot,Ln.fromStyles)),qe.onDestroy(()=>Gc(Ot,Ln.toStyles)),void r.push(qe);Ln.timelines.forEach(gi=>gi.stretchStartingKeyframe=!0),i.append(Ot,Ln.timelines),o.push({instruction:Ln,player:qe,element:Ot}),Ln.queriedElements.forEach(gi=>Ma(a,gi,[]).push(qe)),Ln.preStyleProps.forEach((gi,_r)=>{const oa=Object.keys(gi);if(oa.length){let Bs=l.get(_r);Bs||l.set(_r,Bs=new Set),oa.forEach(Na=>Bs.add(Na))}}),Ln.postStyleProps.forEach((gi,_r)=>{const oa=Object.keys(gi);let Bs=c.get(_r);Bs||c.set(_r,Bs=new Set),oa.forEach(Na=>Bs.add(Na))})}});if(U.length){const Q=[];U.forEach(je=>{Q.push(`@${je.triggerName} has failed due to:\n`),je.errors.forEach($e=>Q.push(`- ${$e}\n`))}),V.forEach(je=>je.destroy()),this.reportError(Q)}const ee=new Map,de=new Map;o.forEach(Q=>{const je=Q.element;i.has(je)&&(de.set(je,je),this._beforeAnimationBuild(Q.player.namespaceId,Q.instruction,ee))}),r.forEach(Q=>{const je=Q.element;this._getPreviousPlayers(je,!1,Q.namespaceId,Q.triggerName,null).forEach(qe=>{Ma(ee,je,[]).push(qe),qe.destroy()})});const ae=v.filter(Q=>Rz(Q,l,c)),me=new Map;Oz(me,this.driver,w,c,qu).forEach(Q=>{Rz(Q,l,c)&&ae.push(Q)});const Be=new Map;g.forEach((Q,je)=>{Oz(Be,this.driver,new Set(Q),l,"!")}),ae.forEach(Q=>{const je=me.get(Q),$e=Be.get(Q);me.set(Q,Object.assign(Object.assign({},je),$e))});const te=[],ne=[],Ie={};o.forEach(Q=>{const{element:je,player:$e,instruction:qe}=Q;if(i.has(je)){if(d.has(je))return $e.onDestroy(()=>Gc(je,qe.toStyles)),$e.disabled=!0,$e.overrideTotalTime(qe.totalTime),void r.push($e);let Ot=Ie;if(de.size>1){let ot=je;const nr=[];for(;ot=ot.parentNode;){const Ln=de.get(ot);if(Ln){Ot=Ln;break}nr.push(ot)}nr.forEach(Ln=>de.set(Ln,Ot))}const Hn=this._buildAnimation($e.namespaceId,qe,ee,s,Be,me);if($e.setRealPlayer(Hn),Ot===Ie)te.push($e);else{const ot=this.playersByElement.get(Ot);ot&&ot.length&&($e.parentPlayer=rh(ot)),r.push($e)}}else Vf(je,qe.fromStyles),$e.onDestroy(()=>Gc(je,qe.toStyles)),ne.push($e),d.has(je)&&r.push($e)}),ne.forEach(Q=>{const je=s.get(Q.element);if(je&&je.length){const $e=rh(je);Q.setRealPlayer($e)}}),r.forEach(Q=>{Q.parentPlayer?Q.syncPlayerEvents(Q.parentPlayer):Q.destroy()});for(let Q=0;Q!Hn.destroyed);Ot.length?Fre(this,je,Ot):this.processLeaveNode(je)}return v.length=0,te.forEach(Q=>{this.players.push(Q),Q.onDone(()=>{Q.destroy();const je=this.players.indexOf(Q);this.players.splice(je,1)}),Q.play()}),te}elementContainsData(e,t){let i=!1;const r=t[gl];return r&&r.setForRemoval&&(i=!0),this.playersByElement.has(t)&&(i=!0),this.playersByQueriedElement.has(t)&&(i=!0),this.statesByElement.has(t)&&(i=!0),this._fetchNamespace(e).elementContainsData(t)||i}afterFlush(e){this._flushFns.push(e)}afterFlushAnimationsDone(e){this._whenQuietFns.push(e)}_getPreviousPlayers(e,t,i,r,s){let o=[];if(t){const a=this.playersByQueriedElement.get(e);a&&(o=a)}else{const a=this.playersByElement.get(e);if(a){const l=!s||s==Bv;a.forEach(c=>{c.queued||!l&&c.triggerName!=r||o.push(c)})}}return(i||r)&&(o=o.filter(a=>!(i&&i!=a.namespaceId||r&&r!=a.triggerName))),o}_beforeAnimationBuild(e,t,i){const s=t.element,o=t.isRemovalTransition?void 0:e,a=t.isRemovalTransition?void 0:t.triggerName;for(const l of t.timelines){const c=l.element,d=c!==s,f=Ma(i,c,[]);this._getPreviousPlayers(c,d,o,a,t.toState).forEach(g=>{const _=g.getRealPlayer();_.beforeDestroy&&_.beforeDestroy(),g.destroy(),f.push(g)})}Vf(s,t.fromStyles)}_buildAnimation(e,t,i,r,s,o){const a=t.triggerName,l=t.element,c=[],d=new Set,f=new Set,p=t.timelines.map(_=>{const y=_.element;d.add(y);const v=y[gl];if(v&&v.removedBeforeQueried)return new im(_.duration,_.delay);const C=y!==l,w=function(n){const e=[];return Pz(n,e),e}((i.get(y)||Are).map(ee=>ee.getRealPlayer())).filter(ee=>!!ee.element&&ee.element===y),x=s.get(y),N=o.get(y),V=iz(0,this._normalizer,0,_.keyframes,x,N),U=this._buildPlayer(_,V,w);if(_.subTimeline&&r&&f.add(y),C){const ee=new OO(e,a,y);ee.setRealPlayer(U),c.push(ee)}return U});c.forEach(_=>{Ma(this.playersByQueriedElement,_.element,[]).push(_),_.onDone(()=>function(n,e,t){let i;if(n instanceof Map){if(i=n.get(e),i){if(i.length){const r=i.indexOf(t);i.splice(r,1)}0==i.length&&n.delete(e)}}else if(i=n[e],i){if(i.length){const r=i.indexOf(t);i.splice(r,1)}0==i.length&&delete n[e]}return i}(this.playersByQueriedElement,_.element,_))}),d.forEach(_=>ml(_,dz));const g=rh(p);return g.onDestroy(()=>{d.forEach(_=>sm(_,dz)),Gc(l,t.toStyles)}),f.forEach(_=>{Ma(r,_,[]).push(g)}),g}_buildPlayer(e,t,i){return t.length>0?this.driver.animate(e.element,t,e.duration,e.delay,e.easing,i):new im(e.duration,e.delay)}}class OO{constructor(e,t,i){this.namespaceId=e,this.triggerName=t,this.element=i,this._player=new im,this._containsRealPlayer=!1,this._queuedCallbacks={},this.destroyed=!1,this.markedForDestroy=!1,this.disabled=!1,this.queued=!0,this.totalTime=0}setRealPlayer(e){this._containsRealPlayer||(this._player=e,Object.keys(this._queuedCallbacks).forEach(t=>{this._queuedCallbacks[t].forEach(i=>oO(e,t,void 0,i))}),this._queuedCallbacks={},this._containsRealPlayer=!0,this.overrideTotalTime(e.totalTime),this.queued=!1)}getRealPlayer(){return this._player}overrideTotalTime(e){this.totalTime=e}syncPlayerEvents(e){const t=this._player;t.triggerCallback&&e.onStart(()=>t.triggerCallback("start")),e.onDone(()=>this.finish()),e.onDestroy(()=>this.destroy())}_queueEvent(e,t){Ma(this._queuedCallbacks,e,[]).push(t)}onDone(e){this.queued&&this._queueEvent("done",e),this._player.onDone(e)}onStart(e){this.queued&&this._queueEvent("start",e),this._player.onStart(e)}onDestroy(e){this.queued&&this._queueEvent("destroy",e),this._player.onDestroy(e)}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(e){this.queued||this._player.setPosition(e)}getPosition(){return this.queued?0:this._player.getPosition()}triggerCallback(e){const t=this._player;t.triggerCallback&&t.triggerCallback(e)}}function WE(n){return n&&1===n.nodeType}function Dz(n,e){const t=n.style.display;return n.style.display=null!=e?e:"none",t}function Oz(n,e,t,i,r){const s=[];t.forEach(l=>s.push(Dz(l)));const o=[];i.forEach((l,c)=>{const d={};l.forEach(f=>{const p=d[f]=e.computeStyle(c,f,r);(!p||0==p.length)&&(c[gl]=Dre,o.push(c))}),n.set(c,d)});let a=0;return t.forEach(l=>Dz(l,s[a++])),o}function Iz(n,e){const t=new Map;if(n.forEach(a=>t.set(a,[])),0==e.length)return t;const r=new Set(e),s=new Map;function o(a){if(!a)return 1;let l=s.get(a);if(l)return l;const c=a.parentNode;return l=t.has(c)?c:r.has(c)?1:o(c),s.set(a,l),l}return e.forEach(a=>{const l=o(a);1!==l&&t.get(l).push(a)}),t}const qE="$$classes";function ml(n,e){if(n.classList)n.classList.add(e);else{let t=n[qE];t||(t=n[qE]={}),t[e]=!0}}function sm(n,e){if(n.classList)n.classList.remove(e);else{let t=n[qE];t&&delete t[e]}}function Fre(n,e,t){rh(t).onDone(()=>n.processLeaveNode(e))}function Pz(n,e){for(let t=0;tr.add(s)):e.set(n,i),t.delete(n),!0}class YE{constructor(e,t,i){this.bodyNode=e,this._driver=t,this._normalizer=i,this._triggerCache={},this.onRemovalComplete=(r,s)=>{},this._transitionEngine=new Ire(e,t,i),this._timelineEngine=new Sre(e,t,i),this._transitionEngine.onRemovalComplete=(r,s)=>this.onRemovalComplete(r,s)}registerTrigger(e,t,i,r,s){const o=e+"-"+r;let a=this._triggerCache[o];if(!a){const l=[],c=CO(this._driver,s,l);if(l.length)throw new Error(`The animation trigger "${r}" has failed to build due to the following errors:\n - ${l.join("\n - ")}`);a=function(n,e,t){return new Cre(n,e,t)}(r,c,this._normalizer),this._triggerCache[o]=a}this._transitionEngine.registerTrigger(t,r,a)}register(e,t){this._transitionEngine.register(e,t)}destroy(e,t){this._transitionEngine.destroy(e,t)}onInsert(e,t,i,r){this._transitionEngine.insertNode(e,t,i,r)}onRemove(e,t,i,r){this._transitionEngine.removeNode(e,t,r||!1,i)}disableAnimations(e,t){this._transitionEngine.markElementAsDisabled(e,t)}process(e,t,i,r){if("@"==i.charAt(0)){const[s,o]=rz(i);this._timelineEngine.command(s,t,o,r)}else this._transitionEngine.trigger(e,t,i,r)}listen(e,t,i,r,s){if("@"==i.charAt(0)){const[o,a]=rz(i);return this._timelineEngine.listen(o,t,a,s)}return this._transitionEngine.listen(e,t,i,r,s)}flush(e=-1){this._transitionEngine.flush(e)}get players(){return this._transitionEngine.players.concat(this._timelineEngine.players)}whenRenderingDone(){return this._transitionEngine.whenRenderingDone()}}function kz(n,e){let t=null,i=null;return Array.isArray(e)&&e.length?(t=IO(e[0]),e.length>1&&(i=IO(e[e.length-1]))):e&&(t=IO(e)),t||i?new om(n,t,i):null}class om{constructor(e,t,i){this._element=e,this._startStyles=t,this._endStyles=i,this._state=0;let r=om.initialStylesByElement.get(e);r||om.initialStylesByElement.set(e,r={}),this._initialStyles=r}start(){this._state<1&&(this._startStyles&&Gc(this._element,this._startStyles,this._initialStyles),this._state=1)}finish(){this.start(),this._state<2&&(Gc(this._element,this._initialStyles),this._endStyles&&(Gc(this._element,this._endStyles),this._endStyles=null),this._state=1)}destroy(){this.finish(),this._state<3&&(om.initialStylesByElement.delete(this._element),this._startStyles&&(Vf(this._element,this._startStyles),this._endStyles=null),this._endStyles&&(Vf(this._element,this._endStyles),this._endStyles=null),Gc(this._element,this._initialStyles),this._state=3)}}function IO(n){let e=null;const t=Object.keys(n);for(let i=0;ithis._handleCallback(l)}apply(){(function(n,e){const t=RO(n,"").trim();let i=0;t.length&&(function(n,e){let t=0;for(let i=0;i=this._delay&&i>=this._duration&&this.finish()}finish(){this._finished||(this._finished=!0,this._onDoneFn(),Vz(this._element,this._eventFn,!0))}destroy(){this._destroyed||(this._destroyed=!0,this.finish(),function(n,e){const i=RO(n,"").split(","),r=PO(i,e);r>=0&&(i.splice(r,1),XE(n,"",i.join(",")))}(this._element,this._name))}}function Lz(n,e,t){XE(n,"PlayState",t,Bz(n,e))}function Bz(n,e){const t=RO(n,"");return t.indexOf(",")>0?PO(t.split(","),e):PO([t],e)}function PO(n,e){for(let t=0;t=0)return t;return-1}function Vz(n,e,t){t?n.removeEventListener(Nz,e):n.addEventListener(Nz,e)}function XE(n,e,t,i){const r=Fz+e;if(null!=i){const s=n.style[r];if(s.length){const o=s.split(",");o[i]=t,t=o.join(",")}}n.style[r]=t}function RO(n,e){return n.style[Fz+e]||""}class zz{constructor(e,t,i,r,s,o,a,l){this.element=e,this.keyframes=t,this.animationName=i,this._duration=r,this._delay=s,this._finalStyles=a,this._specialStyles=l,this._onDoneFns=[],this._onStartFns=[],this._onDestroyFns=[],this.currentSnapshot={},this._state=0,this.easing=o||"linear",this.totalTime=r+s,this._buildStyler()}onStart(e){this._onStartFns.push(e)}onDone(e){this._onDoneFns.push(e)}onDestroy(e){this._onDestroyFns.push(e)}destroy(){this.init(),!(this._state>=4)&&(this._state=4,this._styler.destroy(),this._flushStartFns(),this._flushDoneFns(),this._specialStyles&&this._specialStyles.destroy(),this._onDestroyFns.forEach(e=>e()),this._onDestroyFns=[])}_flushDoneFns(){this._onDoneFns.forEach(e=>e()),this._onDoneFns=[]}_flushStartFns(){this._onStartFns.forEach(e=>e()),this._onStartFns=[]}finish(){this.init(),!(this._state>=3)&&(this._state=3,this._styler.finish(),this._flushStartFns(),this._specialStyles&&this._specialStyles.finish(),this._flushDoneFns())}setPosition(e){this._styler.setPosition(e)}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 jre(this.element,this.animationName,this._duration,this._delay,this.easing,"forwards",()=>this.finish())}triggerCallback(e){const t="start"==e?this._onStartFns:this._onDoneFns;t.forEach(i=>i()),t.length=0}beforeDestroy(){this.init();const e={};if(this.hasStarted()){const t=this._state>=3;Object.keys(this._finalStyles).forEach(i=>{"offset"!=i&&(e[i]=t?this._finalStyles[i]:bO(this.element,i))})}this.currentSnapshot=e}}class qre extends im{constructor(e,t){super(),this.element=e,this._startingStyles={},this.__initialized=!1,this._styles=lz(t)}init(){this.__initialized||!this._startingStyles||(this.__initialized=!0,Object.keys(this._styles).forEach(e=>{this._startingStyles[e]=this.element.style[e]}),super.init())}play(){!this._startingStyles||(this.init(),Object.keys(this._styles).forEach(e=>this.element.style.setProperty(e,this._styles[e])),super.play())}destroy(){!this._startingStyles||(Object.keys(this._startingStyles).forEach(e=>{const t=this._startingStyles[e];t?this.element.style.setProperty(e,t):this.element.style.removeProperty(e)}),this._startingStyles=null,super.destroy())}}class Uz{constructor(){this._count=0}validateStyleProperty(e){return dO(e)}matchesElement(e,t){return hO(e,t)}containsElement(e,t){return fO(e,t)}query(e,t,i){return pO(e,t,i)}computeStyle(e,t,i){return window.getComputedStyle(e)[t]}buildKeyframeElement(e,t,i){i=i.map(a=>lz(a));let r=`@keyframes ${t} {\n`,s="";i.forEach(a=>{s=" ";const l=parseFloat(a.offset);r+=`${s}${100*l}% {\n`,s+=" ",Object.keys(a).forEach(c=>{const d=a[c];switch(c){case"offset":return;case"easing":return void(d&&(r+=`${s}animation-timing-function: ${d};\n`));default:return void(r+=`${s}${c}: ${d};\n`)}}),r+=`${s}}\n`}),r+="}\n";const o=document.createElement("style");return o.textContent=r,o}animate(e,t,i,r,s,o=[],a){const l=o.filter(v=>v instanceof zz),c={};mz(i,r)&&l.forEach(v=>{let C=v.currentSnapshot;Object.keys(C).forEach(w=>c[w]=C[w])});const d=function(n){let e={};return n&&(Array.isArray(n)?n:[n]).forEach(i=>{Object.keys(i).forEach(r=>{"offset"==r||"easing"==r||(e[r]=i[r])})}),e}(t=_z(e,t,c));if(0==i)return new qre(e,d);const f="gen_css_kf_"+this._count++,p=this.buildKeyframeElement(e,f,t);(function(n){var e;const t=null===(e=n.getRootNode)||void 0===e?void 0:e.call(n);return"undefined"!=typeof ShadowRoot&&t instanceof ShadowRoot?t:document.head})(e).appendChild(p);const _=kz(e,t),y=new zz(e,t,f,i,r,s,d,_);return y.onDestroy(()=>function(n){n.parentNode.removeChild(n)}(p)),y}}class $z{constructor(e,t,i,r){this.element=e,this.keyframes=t,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}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(e=>e()),this._onDoneFns=[])}init(){this._buildPlayer(),this._preparePlayerBeforeStart()}_buildPlayer(){if(this._initialized)return;this._initialized=!0;const e=this.keyframes;this.domPlayer=this._triggerWebAnimation(this.element,e,this.options),this._finalKeyframe=e.length?e[e.length-1]:{},this.domPlayer.addEventListener("finish",()=>this._onFinish())}_preparePlayerBeforeStart(){this._delay?this._resetDomPlayerState():this.domPlayer.pause()}_triggerWebAnimation(e,t,i){return e.animate(t,i)}onStart(e){this._onStartFns.push(e)}onDone(e){this._onDoneFns.push(e)}onDestroy(e){this._onDestroyFns.push(e)}play(){this._buildPlayer(),this.hasStarted()||(this._onStartFns.forEach(e=>e()),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(e=>e()),this._onDestroyFns=[])}setPosition(e){void 0===this.domPlayer&&this.init(),this.domPlayer.currentTime=e*this.time}getPosition(){return this.domPlayer.currentTime/this.time}get totalTime(){return this._delay+this._duration}beforeDestroy(){const e={};this.hasStarted()&&Object.keys(this._finalKeyframe).forEach(t=>{"offset"!=t&&(e[t]=this._finished?this._finalKeyframe[t]:bO(this.element,t))}),this.currentSnapshot=e}triggerCallback(e){const t="start"==e?this._onStartFns:this._onDoneFns;t.forEach(i=>i()),t.length=0}}class Qre{constructor(){this._isNativeImpl=/\{\s*\[native\s+code\]\s*\}/.test(Gz().toString()),this._cssKeyframesDriver=new Uz}validateStyleProperty(e){return dO(e)}matchesElement(e,t){return hO(e,t)}containsElement(e,t){return fO(e,t)}query(e,t,i){return pO(e,t,i)}computeStyle(e,t,i){return window.getComputedStyle(e)[t]}overrideWebAnimationsSupport(e){this._isNativeImpl=e}animate(e,t,i,r,s,o=[],a){if(!a&&!this._isNativeImpl)return this._cssKeyframesDriver.animate(e,t,i,r,s,o);const d={duration:i,delay:r,fill:0==r?"both":"forwards"};s&&(d.easing=s);const f={},p=o.filter(_=>_ instanceof $z);mz(i,r)&&p.forEach(_=>{let y=_.currentSnapshot;Object.keys(y).forEach(v=>f[v]=y[v])});const g=kz(e,t=_z(e,t=t.map(_=>sh(_,!1)),f));return new $z(e,t,d,g)}}function Gz(){return nz()&&Element.prototype.animate||{}}let ese=(()=>{class n extends QV{constructor(t,i){super(),this._nextAnimationId=0,this._renderer=t.createRenderer(i.body,{id:"0",encapsulation:Ue.None,styles:[],data:{animation:[]}})}build(t){const i=this._nextAnimationId.toString();this._nextAnimationId++;const r=Array.isArray(t)?JV(t):t;return Wz(this._renderer,null,i,"register",[r]),new tse(i,this._renderer)}}return n.\u0275fac=function(t){return new(t||n)(I(Cf),I(ut))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();class tse extends class{}{constructor(e,t){super(),this._id=e,this._renderer=t}create(e,t){return new nse(this._id,e,t||{},this._renderer)}}class nse{constructor(e,t,i,r){this.id=e,this.element=t,this._renderer=r,this.parentPlayer=null,this._started=!1,this.totalTime=0,this._command("create",i)}_listen(e,t){return this._renderer.listen(this.element,`@@${this.id}:${e}`,t)}_command(e,...t){return Wz(this._renderer,this.element,this.id,e,t)}onDone(e){this._listen("done",e)}onStart(e){this._listen("start",e)}onDestroy(e){this._listen("destroy",e)}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(e){this._command("setPosition",e)}getPosition(){var e,t;return null!==(t=null===(e=this._renderer.engine.players[+this.id])||void 0===e?void 0:e.getPosition())&&void 0!==t?t:0}}function Wz(n,e,t,i,r){return n.setProperty(e,`@@${t}:${i}`,r)}const qz="@.disabled";let ise=(()=>{class n{constructor(t,i,r){this.delegate=t,this.engine=i,this._zone=r,this._currentId=0,this._microtaskId=1,this._animationCallbacksBuffer=[],this._rendererCache=new Map,this._cdRecurDepth=0,this.promise=Promise.resolve(0),i.onRemovalComplete=(s,o)=>{o&&o.parentNode(s)&&o.removeChild(s.parentNode,s)}}createRenderer(t,i){const s=this.delegate.createRenderer(t,i);if(!(t&&i&&i.data&&i.data.animation)){let d=this._rendererCache.get(s);return d||(d=new Yz("",s,this.engine),this._rendererCache.set(s,d)),d}const o=i.id,a=i.id+"-"+this._currentId;this._currentId++,this.engine.register(a,t);const l=d=>{Array.isArray(d)?d.forEach(l):this.engine.registerTrigger(o,a,t,d.name,d)};return i.data.animation.forEach(l),new rse(this,a,s,this.engine)}begin(){this._cdRecurDepth++,this.delegate.begin&&this.delegate.begin()}_scheduleCountTask(){this.promise.then(()=>{this._microtaskId++})}scheduleListenerCallback(t,i,r){t>=0&&ti(r)):(0==this._animationCallbacksBuffer.length&&Promise.resolve(null).then(()=>{this._zone.run(()=>{this._animationCallbacksBuffer.forEach(s=>{const[o,a]=s;o(a)}),this._animationCallbacksBuffer=[]})}),this._animationCallbacksBuffer.push([i,r]))}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 n.\u0275fac=function(t){return new(t||n)(I(Cf),I(YE),I(dt))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();class Yz{constructor(e,t,i){this.namespaceId=e,this.delegate=t,this.engine=i,this.destroyNode=this.delegate.destroyNode?r=>t.destroyNode(r):null}get data(){return this.delegate.data}destroy(){this.engine.destroy(this.namespaceId,this.delegate),this.delegate.destroy()}createElement(e,t){return this.delegate.createElement(e,t)}createComment(e){return this.delegate.createComment(e)}createText(e){return this.delegate.createText(e)}appendChild(e,t){this.delegate.appendChild(e,t),this.engine.onInsert(this.namespaceId,t,e,!1)}insertBefore(e,t,i,r=!0){this.delegate.insertBefore(e,t,i),this.engine.onInsert(this.namespaceId,t,e,r)}removeChild(e,t,i){this.engine.onRemove(this.namespaceId,t,this.delegate,i)}selectRootElement(e,t){return this.delegate.selectRootElement(e,t)}parentNode(e){return this.delegate.parentNode(e)}nextSibling(e){return this.delegate.nextSibling(e)}setAttribute(e,t,i,r){this.delegate.setAttribute(e,t,i,r)}removeAttribute(e,t,i){this.delegate.removeAttribute(e,t,i)}addClass(e,t){this.delegate.addClass(e,t)}removeClass(e,t){this.delegate.removeClass(e,t)}setStyle(e,t,i,r){this.delegate.setStyle(e,t,i,r)}removeStyle(e,t,i){this.delegate.removeStyle(e,t,i)}setProperty(e,t,i){"@"==t.charAt(0)&&t==qz?this.disableAnimations(e,!!i):this.delegate.setProperty(e,t,i)}setValue(e,t){this.delegate.setValue(e,t)}listen(e,t,i){return this.delegate.listen(e,t,i)}disableAnimations(e,t){this.engine.disableAnimations(e,t)}}class rse extends Yz{constructor(e,t,i,r){super(t,i,r),this.factory=e,this.namespaceId=t}setProperty(e,t,i){"@"==t.charAt(0)?"."==t.charAt(1)&&t==qz?this.disableAnimations(e,i=void 0===i||!!i):this.engine.process(this.namespaceId,e,t.substr(1),i):this.delegate.setProperty(e,t,i)}listen(e,t,i){if("@"==t.charAt(0)){const r=function(n){switch(n){case"body":return document.body;case"document":return document;case"window":return window;default:return n}}(e);let s=t.substr(1),o="";return"@"!=s.charAt(0)&&([s,o]=function(n){const e=n.indexOf(".");return[n.substring(0,e),n.substr(e+1)]}(s)),this.engine.listen(this.namespaceId,r,s,o,a=>{this.factory.scheduleListenerCallback(a._data||-1,i,a)})}return this.delegate.listen(e,t,i)}}let ase=(()=>{class n extends YE{constructor(t,i,r){super(t.body,i,r)}ngOnDestroy(){this.flush()}}return n.\u0275fac=function(t){return new(t||n)(I(ut),I(PE),I(xO))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();const Do=new ve("AnimationModuleType"),Xz=[{provide:QV,useClass:ese},{provide:xO,useFactory:function(){return new gre}},{provide:YE,useClass:ase},{provide:Cf,useFactory:function(n,e,t){return new ise(n,e,t)},deps:[_E,YE,dt]}],Kz=[{provide:PE,useFactory:function(){return"function"==typeof Gz()?new Qre:new Uz}},{provide:Do,useValue:"BrowserAnimations"},...Xz],Zz=[{provide:PE,useClass:cz},{provide:Do,useValue:"NoopAnimations"},...Xz];let kO=(()=>{class n{static withConfig(t){return{ngModule:n,providers:t.disableAnimations?Zz:Kz}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({providers:Kz,imports:[yE]}),n})();function fse(n,e){if(1&n&&tt(0,"mat-pseudo-checkbox",4),2&n){const t=Qe();ie("state",t.selected?"checked":"unchecked")("disabled",t.disabled)}}function pse(n,e){if(1&n&&(R(0,"span",5),De(1),k()),2&n){const t=Qe();G(1),or("(",t.group.label,")")}}const gse=["*"],Qz=new ju("12.2.5"),_se=new ve("mat-sanity-checks",{providedIn:"root",factory:function(){return!0}});let $f,On=(()=>{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!(!Mo()||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")&&Qz.full!==ZV.full&&console.warn("The Angular Material version ("+Qz.full+") does not match the Angular CDK version ("+ZV.full+").\nPlease ensure the versions of these two packages exactly match.")}}return n.\u0275fac=function(t){return new(t||n)(I(XV),I(_se,8),I(ut))},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[Nv],Nv]}),n})();function jf(n){return class extends n{constructor(...e){super(...e),this._disabled=!1}get disabled(){return this._disabled}set disabled(e){this._disabled=Mt(e)}}}function Uf(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 nc(n){return class extends n{constructor(...e){super(...e),this._disableRipple=!1}get disableRipple(){return this._disableRipple}set disableRipple(e){this._disableRipple=Mt(e)}}}function Hf(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?To(t):this.defaultTabIndex}}}function FO(n){return class extends n{constructor(...e){super(...e),this.stateChanges=new Se,this.errorState=!1}updateErrorState(){const e=this.errorState,s=(this.errorStateMatcher||this._defaultErrorStateMatcher).isErrorState(this.ngControl?this.ngControl.control:null,this._parentFormGroup||this._parentForm);s!==e&&(this.errorState=s,this.stateChanges.next())}}}try{$f="undefined"!=typeof Intl}catch(n){$f=!1}let Vv=(()=>{class n{isErrorState(t,i){return!!(t&&t.invalid&&(t.touched||i&&i.submitted))}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ue({factory:function(){return new n},token:n,providedIn:"root"}),n})();class Dse{constructor(e,t,i){this._renderer=e,this.element=t,this.config=i,this.state=3}fadeOut(){this._renderer.fadeOutRipple(this)}}const ij={enterDuration:225,exitDuration:150},NO=tm({passive:!0}),rj=["mousedown","touchstart"],sj=["mouseup","mouseleave","touchend","touchcancel"];class oj{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=Wu(i))}fadeInRipple(e,t,i={}){const r=this._containerRect=this._containerRect||this._containerElement.getBoundingClientRect(),s=Object.assign(Object.assign({},ij),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 Dse(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({},ij),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=Wu(e);!t||t===this._triggerElement||(this._removeTriggerEvents(),this._triggerElement=t,this._registerEvents(rj))}handleEvent(e){"mousedown"===e.type?this._onMousedown(e):"touchstart"===e.type?this._onTouchStart(e):this._onPointerUp(),this._pointerUpEventsRegistered||(this._registerEvents(sj),this._pointerUpEventsRegistered=!0)}_onMousedown(e){const t=VV(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,NO)})})}_removeTriggerEvents(){this._triggerElement&&(rj.forEach(e=>{this._triggerElement.removeEventListener(e,this,NO)}),this._pointerUpEventsRegistered&&sj.forEach(e=>{this._triggerElement.removeEventListener(e,this,NO)}))}}const aj=new ve("mat-ripple-global-options");let Js=(()=>{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 oj(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)(E(rt),E(dt),E(si),E(aj,8),E(Do,8))},n.\u0275dir=oe({type:n,selectors:[["","mat-ripple",""],["","matRipple",""]],hostAttrs:[1,"mat-ripple"],hostVars:2,hostBindings:function(t,i){2&t&&st("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})(),_l=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[On,Rv],On]}),n})(),lj=(()=>{class n{constructor(t){this._animationMode=t,this.state="unchecked",this.disabled=!1}}return n.\u0275fac=function(t){return new(t||n)(E(Do,8))},n.\u0275cmp=Ne({type:n,selectors:[["mat-pseudo-checkbox"]],hostAttrs:[1,"mat-pseudo-checkbox"],hostVars:8,hostBindings:function(t,i){2&t&&st("mat-pseudo-checkbox-indeterminate","indeterminate"===i.state)("mat-pseudo-checkbox-checked","checked"===i.state)("mat-pseudo-checkbox-disabled",i.disabled)("_mat-animation-noopable","NoopAnimations"===i._animationMode)},inputs:{state:"state",disabled:"disabled"},decls:0,vars:0,template:function(t,i){},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}),n})(),LO=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[On]]}),n})();const QE=new ve("MAT_OPTION_PARENT_COMPONENT"),Rse=jf(class{});let kse=0,cj=(()=>{class n extends Rse{constructor(t){var i;super(),this._labelId="mat-optgroup-label-"+kse++,this._inert=null!==(i=null==t?void 0:t.inertGroups)&&void 0!==i&&i}}return n.\u0275fac=function(t){return new(t||n)(E(QE,8))},n.\u0275dir=oe({type:n,inputs:{label:"label"},features:[ct]}),n})();const JE=new ve("MatOptgroup");let Fse=0;class uj{constructor(e,t=!1){this.source=e,this.isUserInput=t}}let Nse=(()=>{class n{constructor(t,i,r,s){this._element=t,this._changeDetectorRef=i,this._parent=r,this.group=s,this._selected=!1,this._active=!1,this._disabled=!1,this._mostRecentViewValue="",this.id="mat-option-"+Fse++,this.onSelectionChange=new Le,this._stateChanges=new Se}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=Mt(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,i){const r=this._getHostElement();"function"==typeof r.focus&&r.focus(i)}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)&&!Zs(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 uj(this,t))}}return n.\u0275fac=function(t){return new(t||n)(E(rt),E(kn),E(void 0),E(cj))},n.\u0275dir=oe({type:n,inputs:{id:"id",disabled:"disabled",value:"value"},outputs:{onSelectionChange:"onSelectionChange"}}),n})(),eS=(()=>{class n extends Nse{constructor(t,i,r,s){super(t,i,r,s)}}return n.\u0275fac=function(t){return new(t||n)(E(rt),E(kn),E(QE,8),E(JE,8))},n.\u0275cmp=Ne({type:n,selectors:[["mat-option"]],hostAttrs:["role","option",1,"mat-option","mat-focus-indicator"],hostVars:12,hostBindings:function(t,i){1&t&&ge("click",function(){return i._selectViaInteraction()})("keydown",function(s){return i._handleKeydown(s)}),2&t&&(al("id",i.id),nn("tabindex",i._getTabIndex())("aria-selected",i._getAriaSelected())("aria-disabled",i.disabled.toString()),st("mat-selected",i.selected)("mat-option-multiple",i.multiple)("mat-active",i.active)("mat-option-disabled",i.disabled))},exportAs:["matOption"],features:[ct],ngContentSelectors:gse,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,i){1&t&&(wi(),mt(0,fse,1,2,"mat-pseudo-checkbox",0),R(1,"span",1),Ht(2),k(),mt(3,pse,2,1,"span",2),tt(4,"div",3)),2&t&&(ie("ngIf",i.multiple),G(3),ie("ngIf",i.group&&i.group._inert),G(1),ie("matRippleTrigger",i._getHostElement())("matRippleDisabled",i.disabled||i.disableRipple))},directives:[zr,Js,lj],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}),n})();function BO(n,e,t){if(t.length){let i=e.toArray(),r=t.toArray(),s=0;for(let o=0;o{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[_l,dn,On,LO]]}),n})();function Wc(n,e,t,i){return Ke(t)&&(i=t,t=void 0),i?Wc(n,e,t).pipe(Ae(r=>we(r)?i(...r):i(r))):new ce(r=>{hj(n,e,function(o){r.next(arguments.length>1?Array.prototype.slice.call(arguments):o)},r,t)})}function hj(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 enter",[ti({opacity:0,transform:"translateY(-5px)"}),Ao("300ms cubic-bezier(0.55, 0, 0.55, 0.2)")])])};let jv=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275dir=oe({type:n}),n})();const pj=new ve("MatHint");let Gf=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275dir=oe({type:n,selectors:[["mat-label"]]}),n})(),ooe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275dir=oe({type:n,selectors:[["mat-placeholder"]]}),n})();const gj=new ve("MatPrefix"),mj=new ve("MatSuffix");let VO=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275dir=oe({type:n,selectors:[["","matSuffix",""]],features:[Dt([{provide:mj,useExisting:n}])]}),n})(),_j=0;const coe=Uf(class{constructor(n){this._elementRef=n}},"primary"),vj=new ve("MAT_FORM_FIELD_DEFAULT_OPTIONS"),nS=new ve("MatFormField");let am=(()=>{class n extends coe{constructor(t,i,r,s,o,a,l,c){super(t),this._changeDetectorRef=i,this._dir=s,this._defaults=o,this._platform=a,this._ngZone=l,this._outlineGapCalculationNeededImmediately=!1,this._outlineGapCalculationNeededOnStable=!1,this._destroyed=new Se,this._showAlwaysAnimate=!1,this._subscriptAnimationState="",this._hintLabel="",this._hintLabelId="mat-hint-"+_j++,this._labelId="mat-form-field-label-"+_j++,this.floatLabel=this._getDefaultFloatLabelState(),this._animationsEnabled="NoopAnimations"!==c,this.appearance=o&&o.appearance?o.appearance:"legacy",this._hideRequiredMarker=!(!o||null==o.hideRequiredMarker)&&o.hideRequiredMarker}get appearance(){return this._appearance}set appearance(t){const i=this._appearance;this._appearance=t||this._defaults&&this._defaults.appearance||"legacy","outline"===this._appearance&&i!==t&&(this._outlineGapCalculationNeededOnStable=!0)}get hideRequiredMarker(){return this._hideRequiredMarker}set hideRequiredMarker(t){this._hideRequiredMarker=Mt(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(Rr(null)).subscribe(()=>{this._validatePlaceholders(),this._syncDescribedByIds(),this._changeDetectorRef.markForCheck()}),t.ngControl&&t.ngControl.valueChanges&&t.ngControl.valueChanges.pipe(Tn(this._destroyed)).subscribe(()=>this._changeDetectorRef.markForCheck()),this._ngZone.runOutsideAngular(()=>{this._ngZone.onStable.pipe(Tn(this._destroyed)).subscribe(()=>{this._outlineGapCalculationNeededOnStable&&this.updateOutlineGap()})}),Ni(this._prefixChildren.changes,this._suffixChildren.changes).subscribe(()=>{this._outlineGapCalculationNeededOnStable=!0,this._changeDetectorRef.markForCheck()}),this._hintChildren.changes.pipe(Rr(null)).subscribe(()=>{this._processHints(),this._changeDetectorRef.markForCheck()}),this._errorChildren.changes.pipe(Rr(null)).subscribe(()=>{this._syncDescribedByIds(),this._changeDetectorRef.markForCheck()}),this._dir&&this._dir.change.pipe(Tn(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 i=this._control?this._control.ngControl:null;return i&&i[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,Wc(this._label.nativeElement,"transitionend").pipe(yi(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 i=this._hintChildren?this._hintChildren.find(s=>"start"===s.align):null,r=this._hintChildren?this._hintChildren.find(s=>"end"===s.align):null;i?t.push(i.id):this._hintLabel&&t.push(this._hintLabelId),r&&t.push(r.id)}else this._errorChildren&&t.push(...this._errorChildren.map(i=>i.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 i=0,r=0;const s=this._connectionContainerRef.nativeElement,o=s.querySelectorAll(".mat-form-field-outline-start"),a=s.querySelectorAll(".mat-form-field-outline-gap");if(this._label&&this._label.nativeElement.children.length){const l=s.getBoundingClientRect();if(0===l.width&&0===l.height)return this._outlineGapCalculationNeededOnStable=!0,void(this._outlineGapCalculationNeededImmediately=!1);const c=this._getStartEnd(l),d=t.children,f=this._getStartEnd(d[0].getBoundingClientRect());let p=0;for(let g=0;g0?.75*p+10:0}for(let l=0;l{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,On,SE],On]}),n})();function Hv(...n){if(1===n.length){const e=n[0];if(we(e))return iS(e,null);if(_e(e)&&Object.getPrototypeOf(e)===Object.prototype){const t=Object.keys(e);return iS(t.map(i=>e[i]),t)}}if("function"==typeof n[n.length-1]){const e=n.pop();return iS(n=1===n.length&&we(n[0])?n[0]:n,null).pipe(Ae(t=>e(...t)))}return iS(n,null)}function iS(n,e){return new ce(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 Ta(n){return function(t){const i=new uoe(n),r=t.lift(i);return i.caught=r}}class uoe{constructor(e){this.selector=e}call(e,t){return t.subscribe(new doe(e,this.selector,this.caught))}}class doe extends ii{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 Gr(this);this.add(i);const r=co(t,i);r!==i&&this.add(r)}}}class hoe{constructor(e){this.callback=e}call(e,t){return t.subscribe(new foe(e,this.callback))}}class foe extends xt{constructor(e,t){super(e),this.add(new Te(t))}}class Cj{}class wj{}class Yu{constructor(e){this.normalizedNames=new Map,this.lazyUpdate=null,e?this.lazyInit="string"==typeof e?()=>{this.headers=new Map,e.split("\n").forEach(t=>{const i=t.indexOf(":");if(i>0){const r=t.slice(0,i),s=r.toLowerCase(),o=t.slice(i+1).trim();this.maybeSetNormalizedName(r,s),this.headers.has(s)?this.headers.get(s).push(o):this.headers.set(s,[o])}})}:()=>{this.headers=new Map,Object.keys(e).forEach(t=>{let i=e[t];const r=t.toLowerCase();"string"==typeof i&&(i=[i]),i.length>0&&(this.headers.set(r,i),this.maybeSetNormalizedName(t,r))})}:this.headers=new Map}has(e){return this.init(),this.headers.has(e.toLowerCase())}get(e){this.init();const t=this.headers.get(e.toLowerCase());return t&&t.length>0?t[0]:null}keys(){return this.init(),Array.from(this.normalizedNames.values())}getAll(e){return this.init(),this.headers.get(e.toLowerCase())||null}append(e,t){return this.clone({name:e,value:t,op:"a"})}set(e,t){return this.clone({name:e,value:t,op:"s"})}delete(e,t){return this.clone({name:e,value:t,op:"d"})}maybeSetNormalizedName(e,t){this.normalizedNames.has(t)||this.normalizedNames.set(t,e)}init(){this.lazyInit&&(this.lazyInit instanceof Yu?this.copyFrom(this.lazyInit):this.lazyInit(),this.lazyInit=null,this.lazyUpdate&&(this.lazyUpdate.forEach(e=>this.applyUpdate(e)),this.lazyUpdate=null))}copyFrom(e){e.init(),Array.from(e.headers.keys()).forEach(t=>{this.headers.set(t,e.headers.get(t)),this.normalizedNames.set(t,e.normalizedNames.get(t))})}clone(e){const t=new Yu;return t.lazyInit=this.lazyInit&&this.lazyInit instanceof Yu?this.lazyInit:this,t.lazyUpdate=(this.lazyUpdate||[]).concat([e]),t}applyUpdate(e){const t=e.name.toLowerCase();switch(e.op){case"a":case"s":let i=e.value;if("string"==typeof i&&(i=[i]),0===i.length)return;this.maybeSetNormalizedName(e.name,t);const r=("a"===e.op?this.headers.get(t):void 0)||[];r.push(...i),this.headers.set(t,r);break;case"d":const s=e.value;if(s){let o=this.headers.get(t);if(!o)return;o=o.filter(a=>-1===s.indexOf(a)),0===o.length?(this.headers.delete(t),this.normalizedNames.delete(t)):this.headers.set(t,o)}else this.headers.delete(t),this.normalizedNames.delete(t)}}forEach(e){this.init(),Array.from(this.normalizedNames.keys()).forEach(t=>e(this.normalizedNames.get(t),this.headers.get(t)))}}class poe{encodeKey(e){return Ej(e)}encodeValue(e){return Ej(e)}decodeKey(e){return decodeURIComponent(e)}decodeValue(e){return decodeURIComponent(e)}}const moe=/%(\d[a-f0-9])/gi,_oe={40:"@","3A":":",24:"$","2C":",","3B":";","2B":"+","3D":"=","3F":"?","2F":"/"};function Ej(n){return encodeURIComponent(n).replace(moe,(e,t)=>{var i;return null!==(i=_oe[t])&&void 0!==i?i:e})}function Sj(n){return`${n}`}class oh{constructor(e={}){if(this.updates=null,this.cloneFrom=null,this.encoder=e.encoder||new poe,e.fromString){if(e.fromObject)throw new Error("Cannot specify both fromString and fromObject.");this.map=function(n,e){const t=new Map;return n.length>0&&n.replace(/^\?/,"").split("&").forEach(r=>{const s=r.indexOf("="),[o,a]=-1==s?[e.decodeKey(r),""]:[e.decodeKey(r.slice(0,s)),e.decodeValue(r.slice(s+1))],l=t.get(o)||[];l.push(a),t.set(o,l)}),t}(e.fromString,this.encoder)}else e.fromObject?(this.map=new Map,Object.keys(e.fromObject).forEach(t=>{const i=e.fromObject[t];this.map.set(t,Array.isArray(i)?i:[i])})):this.map=null}has(e){return this.init(),this.map.has(e)}get(e){this.init();const t=this.map.get(e);return t?t[0]:null}getAll(e){return this.init(),this.map.get(e)||null}keys(){return this.init(),Array.from(this.map.keys())}append(e,t){return this.clone({param:e,value:t,op:"a"})}appendAll(e){const t=[];return Object.keys(e).forEach(i=>{const r=e[i];Array.isArray(r)?r.forEach(s=>{t.push({param:i,value:s,op:"a"})}):t.push({param:i,value:r,op:"a"})}),this.clone(t)}set(e,t){return this.clone({param:e,value:t,op:"s"})}delete(e,t){return this.clone({param:e,value:t,op:"d"})}toString(){return this.init(),this.keys().map(e=>{const t=this.encoder.encodeKey(e);return this.map.get(e).map(i=>t+"="+this.encoder.encodeValue(i)).join("&")}).filter(e=>""!==e).join("&")}clone(e){const t=new oh({encoder:this.encoder});return t.cloneFrom=this.cloneFrom||this,t.updates=(this.updates||[]).concat(e),t}init(){null===this.map&&(this.map=new Map),null!==this.cloneFrom&&(this.cloneFrom.init(),this.cloneFrom.keys().forEach(e=>this.map.set(e,this.cloneFrom.map.get(e))),this.updates.forEach(e=>{switch(e.op){case"a":case"s":const t=("a"===e.op?this.map.get(e.param):void 0)||[];t.push(Sj(e.value)),this.map.set(e.param,t);break;case"d":if(void 0===e.value){this.map.delete(e.param);break}{let i=this.map.get(e.param)||[];const r=i.indexOf(Sj(e.value));-1!==r&&i.splice(r,1),i.length>0?this.map.set(e.param,i):this.map.delete(e.param)}}}),this.cloneFrom=this.updates=null)}}class yoe{constructor(){this.map=new Map}set(e,t){return this.map.set(e,t),this}get(e){return this.map.has(e)||this.map.set(e,e.defaultValue()),this.map.get(e)}delete(e){return this.map.delete(e),this}keys(){return this.map.keys()}}function Mj(n){return"undefined"!=typeof ArrayBuffer&&n instanceof ArrayBuffer}function xj(n){return"undefined"!=typeof Blob&&n instanceof Blob}function Tj(n){return"undefined"!=typeof FormData&&n instanceof FormData}class $v{constructor(e,t,i,r){let s;if(this.url=t,this.body=null,this.reportProgress=!1,this.withCredentials=!1,this.responseType="json",this.method=e.toUpperCase(),function(n){switch(n){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,s=r):s=i,s&&(this.reportProgress=!!s.reportProgress,this.withCredentials=!!s.withCredentials,s.responseType&&(this.responseType=s.responseType),s.headers&&(this.headers=s.headers),s.context&&(this.context=s.context),s.params&&(this.params=s.params)),this.headers||(this.headers=new Yu),this.context||(this.context=new yoe),this.params){const o=this.params.toString();if(0===o.length)this.urlWithParams=t;else{const a=t.indexOf("?");this.urlWithParams=t+(-1===a?"?":ap.set(g,e.setHeaders[g]),c)),e.setParams&&(d=Object.keys(e.setParams).reduce((p,g)=>p.set(g,e.setParams[g]),d)),new $v(i,r,o,{params:d,headers:c,context:f,reportProgress:l,responseType:s,withCredentials:a})}}var Ur=(()=>((Ur=Ur||{})[Ur.Sent=0]="Sent",Ur[Ur.UploadProgress=1]="UploadProgress",Ur[Ur.ResponseHeader=2]="ResponseHeader",Ur[Ur.DownloadProgress=3]="DownloadProgress",Ur[Ur.Response=4]="Response",Ur[Ur.User=5]="User",Ur))();class zO{constructor(e,t=200,i="OK"){this.headers=e.headers||new Yu,this.status=void 0!==e.status?e.status:t,this.statusText=e.statusText||i,this.url=e.url||null,this.ok=this.status>=200&&this.status<300}}class jO extends zO{constructor(e={}){super(e),this.type=Ur.ResponseHeader}clone(e={}){return new jO({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})}}class rS extends zO{constructor(e={}){super(e),this.type=Ur.Response,this.body=void 0!==e.body?e.body:null}clone(e={}){return new rS({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})}}class Aj extends zO{constructor(e){super(e,0,"Unknown Error"),this.name="HttpErrorResponse",this.ok=!1,this.message=this.status>=200&&this.status<300?`Http failure during parsing for ${e.url||"(unknown url)"}`:`Http failure response for ${e.url||"(unknown url)"}: ${e.status} ${e.statusText}`,this.error=e.error||null}}function UO(n,e){return{body:e,headers:n.headers,context:n.context,observe:n.observe,params:n.params,reportProgress:n.reportProgress,responseType:n.responseType,withCredentials:n.withCredentials}}let Wf=(()=>{class n{constructor(t){this.handler=t}request(t,i,r={}){let s;if(t instanceof $v)s=t;else{let l,c;l=r.headers instanceof Yu?r.headers:new Yu(r.headers),r.params&&(c=r.params instanceof oh?r.params:new oh({fromObject:r.params})),s=new $v(t,i,void 0!==r.body?r.body:null,{headers:l,context:r.context,params:c,reportProgress:r.reportProgress,responseType:r.responseType||"json",withCredentials:r.withCredentials})}const o=ht(s).pipe(function(n,e){return di(n,e,1)}(l=>this.handler.handle(l)));if(t instanceof $v||"events"===r.observe)return o;const a=o.pipe(Fn(l=>l instanceof rS));switch(r.observe||"body"){case"body":switch(s.responseType){case"arraybuffer":return a.pipe(Ae(l=>{if(null!==l.body&&!(l.body instanceof ArrayBuffer))throw new Error("Response is not an ArrayBuffer.");return l.body}));case"blob":return a.pipe(Ae(l=>{if(null!==l.body&&!(l.body instanceof Blob))throw new Error("Response is not a Blob.");return l.body}));case"text":return a.pipe(Ae(l=>{if(null!==l.body&&"string"!=typeof l.body)throw new Error("Response is not a string.");return l.body}));case"json":default:return a.pipe(Ae(l=>l.body))}case"response":return a;default:throw new Error(`Unreachable: unhandled observe type ${r.observe}}`)}}delete(t,i={}){return this.request("DELETE",t,i)}get(t,i={}){return this.request("GET",t,i)}head(t,i={}){return this.request("HEAD",t,i)}jsonp(t,i){return this.request("JSONP",t,{params:(new oh).append(i,"JSONP_CALLBACK"),observe:"body",responseType:"json"})}options(t,i={}){return this.request("OPTIONS",t,i)}patch(t,i,r={}){return this.request("PATCH",t,UO(r,i))}post(t,i,r={}){return this.request("POST",t,UO(r,i))}put(t,i,r={}){return this.request("PUT",t,UO(r,i))}}return n.\u0275fac=function(t){return new(t||n)(I(Cj))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();class Dj{constructor(e,t){this.next=e,this.interceptor=t}handle(e){return this.interceptor.intercept(e,this.next)}}const Oj=new ve("HTTP_INTERCEPTORS");let Coe=(()=>{class n{intercept(t,i){return i.handle(t)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();const woe=/^\)\]\}',?\n/;let Ij=(()=>{class n{constructor(t){this.xhrFactory=t}handle(t){if("JSONP"===t.method)throw new Error("Attempted to construct Jsonp request without HttpClientJsonpModule installed.");return new ce(i=>{const r=this.xhrFactory.build();if(r.open(t.method,t.urlWithParams),t.withCredentials&&(r.withCredentials=!0),t.headers.forEach((g,_)=>r.setRequestHeader(g,_.join(","))),t.headers.has("Accept")||r.setRequestHeader("Accept","application/json, text/plain, */*"),!t.headers.has("Content-Type")){const g=t.detectContentTypeHeader();null!==g&&r.setRequestHeader("Content-Type",g)}if(t.responseType){const g=t.responseType.toLowerCase();r.responseType="json"!==g?g:"text"}const s=t.serializeBody();let o=null;const a=()=>{if(null!==o)return o;const g=1223===r.status?204:r.status,_=r.statusText||"OK",y=new Yu(r.getAllResponseHeaders()),v=function(n){return"responseURL"in n&&n.responseURL?n.responseURL:/^X-Request-URL:/m.test(n.getAllResponseHeaders())?n.getResponseHeader("X-Request-URL"):null}(r)||t.url;return o=new jO({headers:y,status:g,statusText:_,url:v}),o},l=()=>{let{headers:g,status:_,statusText:y,url:v}=a(),C=null;204!==_&&(C=void 0===r.response?r.responseText:r.response),0===_&&(_=C?200:0);let w=_>=200&&_<300;if("json"===t.responseType&&"string"==typeof C){const x=C;C=C.replace(woe,"");try{C=""!==C?JSON.parse(C):null}catch(N){C=x,w&&(w=!1,C={error:N,text:C})}}w?(i.next(new rS({body:C,headers:g,status:_,statusText:y,url:v||void 0})),i.complete()):i.error(new Aj({error:C,headers:g,status:_,statusText:y,url:v||void 0}))},c=g=>{const{url:_}=a(),y=new Aj({error:g,status:r.status||0,statusText:r.statusText||"Unknown Error",url:_||void 0});i.error(y)};let d=!1;const f=g=>{d||(i.next(a()),d=!0);let _={type:Ur.DownloadProgress,loaded:g.loaded};g.lengthComputable&&(_.total=g.total),"text"===t.responseType&&!!r.responseText&&(_.partialText=r.responseText),i.next(_)},p=g=>{let _={type:Ur.UploadProgress,loaded:g.loaded};g.lengthComputable&&(_.total=g.total),i.next(_)};return r.addEventListener("load",l),r.addEventListener("error",c),r.addEventListener("timeout",c),r.addEventListener("abort",c),t.reportProgress&&(r.addEventListener("progress",f),null!==s&&r.upload&&r.upload.addEventListener("progress",p)),r.send(s),i.next({type:Ur.Sent}),()=>{r.removeEventListener("error",c),r.removeEventListener("abort",c),r.removeEventListener("load",l),r.removeEventListener("timeout",c),t.reportProgress&&(r.removeEventListener("progress",f),null!==s&&r.upload&&r.upload.removeEventListener("progress",p)),r.readyState!==r.DONE&&r.abort()}})}}return n.\u0275fac=function(t){return new(t||n)(I(aV))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();const HO=new ve("XSRF_COOKIE_NAME"),$O=new ve("XSRF_HEADER_NAME");class Pj{}let Soe=(()=>{class n{constructor(t,i,r){this.doc=t,this.platform=i,this.cookieName=r,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=Y3(t,this.cookieName),this.lastCookieString=t),this.lastToken}}return n.\u0275fac=function(t){return new(t||n)(I(ut),I(dl),I(HO))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})(),GO=(()=>{class n{constructor(t,i){this.tokenService=t,this.headerName=i}intercept(t,i){const r=t.url.toLowerCase();if("GET"===t.method||"HEAD"===t.method||r.startsWith("http://")||r.startsWith("https://"))return i.handle(t);const s=this.tokenService.getToken();return null!==s&&!t.headers.has(this.headerName)&&(t=t.clone({headers:t.headers.set(this.headerName,s)})),i.handle(t)}}return n.\u0275fac=function(t){return new(t||n)(I(Pj),I($O))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})(),Moe=(()=>{class n{constructor(t,i){this.backend=t,this.injector=i,this.chain=null}handle(t){if(null===this.chain){const i=this.injector.get(Oj,[]);this.chain=i.reduceRight((r,s)=>new Dj(r,s),this.backend)}return this.chain.handle(t)}}return n.\u0275fac=function(t){return new(t||n)(I(wj),I(Nt))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})(),xoe=(()=>{class n{static disable(){return{ngModule:n,providers:[{provide:GO,useClass:Coe}]}}static withOptions(t={}){return{ngModule:n,providers:[t.cookieName?{provide:HO,useValue:t.cookieName}:[],t.headerName?{provide:$O,useValue:t.headerName}:[]]}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({providers:[GO,{provide:Oj,useExisting:GO,multi:!0},{provide:Pj,useClass:Soe},{provide:HO,useValue:"XSRF-TOKEN"},{provide:$O,useValue:"X-XSRF-TOKEN"}]}),n})(),Rj=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({providers:[Wf,{provide:Cj,useClass:Moe},Ij,{provide:wj,useExisting:Ij}],imports:[[xoe.withOptions({cookieName:"XSRF-TOKEN",headerName:"X-XSRF-TOKEN"})]]}),n})();const Toe=["*"];function kj(n){return Error(`Unable to find icon with the name "${n}"`)}function Fj(n){return Error(`The URL provided to MatIconRegistry was not trusted as a resource URL via Angular's DomSanitizer. Attempted URL was "${n}".`)}function Nj(n){return Error(`The literal provided to MatIconRegistry was not trusted as safe HTML by Angular's DomSanitizer. Attempted literal was "${n}".`)}class qf{constructor(e,t,i){this.url=e,this.svgText=t,this.options=i}}let Gv=(()=>{class n{constructor(t,i,r,s){this._httpClient=t,this._sanitizer=i,this._errorHandler=s,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=r}addSvgIcon(t,i,r){return this.addSvgIconInNamespace("",t,i,r)}addSvgIconLiteral(t,i,r){return this.addSvgIconLiteralInNamespace("",t,i,r)}addSvgIconInNamespace(t,i,r,s){return this._addSvgIconConfig(t,i,new qf(r,null,s))}addSvgIconResolver(t){return this._resolvers.push(t),this}addSvgIconLiteralInNamespace(t,i,r,s){const o=this._sanitizer.sanitize(mn.HTML,r);if(!o)throw Nj(r);return this._addSvgIconConfig(t,i,new qf("",o,s))}addSvgIconSet(t,i){return this.addSvgIconSetInNamespace("",t,i)}addSvgIconSetLiteral(t,i){return this.addSvgIconSetLiteralInNamespace("",t,i)}addSvgIconSetInNamespace(t,i,r){return this._addSvgIconSetConfig(t,new qf(i,null,r))}addSvgIconSetLiteralInNamespace(t,i,r){const s=this._sanitizer.sanitize(mn.HTML,i);if(!s)throw Nj(i);return this._addSvgIconSetConfig(t,new qf("",s,r))}registerFontClassAlias(t,i=t){return this._fontCssClassesByAlias.set(t,i),this}classNameForFontAlias(t){return this._fontCssClassesByAlias.get(t)||t}setDefaultFontSetClass(t){return this._defaultFontSetClass=t,this}getDefaultFontSetClass(){return this._defaultFontSetClass}getSvgIconFromUrl(t){const i=this._sanitizer.sanitize(mn.RESOURCE_URL,t);if(!i)throw Fj(t);const r=this._cachedIconsByUrl.get(i);return r?ht(sS(r)):this._loadSvgIconFromConfig(new qf(t,null)).pipe(Ti(s=>this._cachedIconsByUrl.set(i,s)),Ae(s=>sS(s)))}getNamedSvgIcon(t,i=""){const r=Lj(i,t);let s=this._svgIconConfigs.get(r);if(s)return this._getSvgFromConfig(s);if(s=this._getIconConfigFromResolvers(i,t),s)return this._svgIconConfigs.set(r,s),this._getSvgFromConfig(s);const o=this._iconSetConfigs.get(i);return o?this._getSvgFromIconSetConfigs(t,o):Kg(kj(r))}ngOnDestroy(){this._resolvers=[],this._svgIconConfigs.clear(),this._iconSetConfigs.clear(),this._cachedIconsByUrl.clear()}_getSvgFromConfig(t){return t.svgText?ht(sS(this._svgElementFromConfig(t))):this._loadSvgIconFromConfig(t).pipe(Ae(i=>sS(i)))}_getSvgFromIconSetConfigs(t,i){const r=this._extractIconWithNameFromAnySet(t,i);return r?ht(r):Hv(i.filter(o=>!o.svgText).map(o=>this._loadSvgIconSetFromConfig(o).pipe(Ta(a=>{const c=`Loading icon set URL: ${this._sanitizer.sanitize(mn.RESOURCE_URL,o.url)} failed: ${a.message}`;return this._errorHandler.handleError(new Error(c)),ht(null)})))).pipe(Ae(()=>{const o=this._extractIconWithNameFromAnySet(t,i);if(!o)throw kj(t);return o}))}_extractIconWithNameFromAnySet(t,i){for(let r=i.length-1;r>=0;r--){const s=i[r];if(s.svgText&&s.svgText.indexOf(t)>-1){const o=this._svgElementFromConfig(s),a=this._extractSvgIconFromSet(o,t,s.options);if(a)return a}}return null}_loadSvgIconFromConfig(t){return this._fetchIcon(t).pipe(Ti(i=>t.svgText=i),Ae(()=>this._svgElementFromConfig(t)))}_loadSvgIconSetFromConfig(t){return t.svgText?ht(null):this._fetchIcon(t).pipe(Ti(i=>t.svgText=i))}_extractSvgIconFromSet(t,i,r){const s=t.querySelector(`[id="${i}"]`);if(!s)return null;const o=s.cloneNode(!0);if(o.removeAttribute("id"),"svg"===o.nodeName.toLowerCase())return this._setSvgAttributes(o,r);if("symbol"===o.nodeName.toLowerCase())return this._setSvgAttributes(this._toSvgElement(o),r);const a=this._svgElementFromString("");return a.appendChild(o),this._setSvgAttributes(a,r)}_svgElementFromString(t){const i=this._document.createElement("DIV");i.innerHTML=t;const r=i.querySelector("svg");if(!r)throw Error(" tag not found");return r}_toSvgElement(t){const i=this._svgElementFromString(""),r=t.attributes;for(let s=0;se.lift(new hoe(n))}(()=>this._inProgressUrlFetches.delete(a)),Vs());return this._inProgressUrlFetches.set(a,c),c}_addSvgIconConfig(t,i,r){return this._svgIconConfigs.set(Lj(t,i),r),this}_addSvgIconSetConfig(t,i){const r=this._iconSetConfigs.get(t);return r?r.push(i):this._iconSetConfigs.set(t,[i]),this}_svgElementFromConfig(t){if(!t.svgElement){const i=this._svgElementFromString(t.svgText);this._setSvgAttributes(i,t.options),t.svgElement=i}return t.svgElement}_getIconConfigFromResolvers(t,i){for(let r=0;re?e.pathname+e.search:""}}}),Bj=["clip-path","color-profile","src","cursor","fill","filter","marker","marker-start","marker-mid","marker-end","mask","stroke"],Foe=Bj.map(n=>`[${n}]`).join(", "),Noe=/^url\(['"]?#(.*?)['"]?\)$/;let rs=(()=>{class n extends Ioe{constructor(t,i,r,s,o){super(t),this._iconRegistry=i,this._location=s,this._errorHandler=o,this._inline=!1,this._currentIconFetch=Te.EMPTY,r||t.nativeElement.setAttribute("aria-hidden","true")}get inline(){return this._inline}set inline(t){this._inline=Mt(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 i=this._cleanupFontValue(t);i!==this._fontSet&&(this._fontSet=i,this._updateFontIconClasses())}get fontIcon(){return this._fontIcon}set fontIcon(t){const i=this._cleanupFontValue(t);i!==this._fontIcon&&(this._fontIcon=i,this._updateFontIconClasses())}_splitIconName(t){if(!t)return["",""];const i=t.split(":");switch(i.length){case 1:return["",i[0]];case 2:return i;default:throw Error(`Invalid icon name: "${t}"`)}}ngOnInit(){this._updateFontIconClasses()}ngAfterViewChecked(){const t=this._elementsWithExternalReferences;if(t&&t.size){const i=this._location.getPathname();i!==this._previousPath&&(this._previousPath=i,this._prependPathToReferences(i))}}ngOnDestroy(){this._currentIconFetch.unsubscribe(),this._elementsWithExternalReferences&&this._elementsWithExternalReferences.clear()}_usingFontIcon(){return!this.svgIcon}_setSvgElement(t){this._clearSvgElement();const i=t.querySelectorAll("style");for(let s=0;s{r.forEach(o=>{s.setAttribute(o.name,`url('${t}#${o.value}')`)})})}_cacheChildrenWithExternalReferences(t){const i=t.querySelectorAll(Foe),r=this._elementsWithExternalReferences=this._elementsWithExternalReferences||new Map;for(let s=0;s{const a=i[s],l=a.getAttribute(o),c=l?l.match(Noe):null;if(c){let d=r.get(a);d||(d=[],r.set(a,d)),d.push({name:o,value:c[1]})}})}_updateSvgIcon(t){if(this._svgNamespace=null,this._svgName=null,this._currentIconFetch.unsubscribe(),t){const[i,r]=this._splitIconName(t);i&&(this._svgNamespace=i),r&&(this._svgName=r),this._currentIconFetch=this._iconRegistry.getNamedSvgIcon(r,i).pipe(yi(1)).subscribe(s=>this._setSvgElement(s),s=>{this._errorHandler.handleError(new Error(`Error retrieving icon ${i}:${r}! ${s.message}`))})}}}return n.\u0275fac=function(t){return new(t||n)(E(rt),E(Gv),Zr("aria-hidden"),E(Poe),E($o))},n.\u0275cmp=Ne({type:n,selectors:[["mat-icon"]],hostAttrs:["role","img",1,"mat-icon","notranslate"],hostVars:7,hostBindings:function(t,i){2&t&&(nn("data-mat-icon-type",i._usingFontIcon()?"font":"svg")("data-mat-icon-name",i._svgName||i.fontIcon)("data-mat-icon-namespace",i._svgNamespace||i.fontSet),st("mat-icon-inline",i.inline)("mat-icon-no-color","primary"!==i.color&&"accent"!==i.color&&"warn"!==i.color))},inputs:{color:"color",inline:"inline",svgIcon:"svgIcon",fontSet:"fontSet",fontIcon:"fontIcon"},exportAs:["matIcon"],features:[ct],ngContentSelectors:Toe,decls:1,vars:0,template:function(t,i){1&t&&(wi(),Ht(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}),n})(),lr=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[On],On]}),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=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 zoe=1;const joe=Promise.resolve(),oS={};function Vj(n){return n in oS&&(delete oS[n],!0)}const zj={setImmediate(n){const e=zoe++;return oS[e]=!0,joe.then(()=>Vj(e)&&n()),e},clearImmediate(n){Vj(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=zj.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&&(zj.clearImmediate(t),e.scheduled=void 0)}});function cm(n){return!!n&&(n instanceof ce||"function"==typeof n.lift&&"function"==typeof n.subscribe)}class Woe{constructor(e){this.durationSelector=e}call(e,t){return t.subscribe(new qoe(e,this.durationSelector))}}class qoe extends ii{constructor(e,t){super(e),this.durationSelector=t,this.hasValue=!1}_next(e){if(this.value=e,this.hasValue=!0,!this.throttled){let t;try{const{durationSelector:r}=this;t=r(e)}catch(r){return this.destination.error(r)}const i=co(t,new Gr(this));!i||i.closed?this.clearThrottle():this.add(this.throttled=i)}}clearThrottle(){const{value:e,hasValue:t,throttled:i}=this;i&&(this.remove(i),this.throttled=void 0,i.unsubscribe()),t&&(this.value=void 0,this.hasValue=!1,this.destination.next(e))}notifyNext(){this.clearThrottle()}notifyComplete(){this.clearThrottle()}}function WO(n){return!we(n)&&n-parseFloat(n)+1>=0}function Xoe(n){const{index:e,period:t,subscriber:i}=n;if(i.next(e),!i.closed){if(-1===t)return i.complete();n.index=e+1,this.schedule(n,t)}}function aS(n,e=Pf){return function(n){return function(t){return t.lift(new Woe(n))}}(()=>function(n=0,e,t){let i=-1;return WO(e)?i=Number(e)<1?1:Number(e):Gn(e)&&(t=e),Gn(t)||(t=Pf),new ce(r=>{const s=WO(n)?n:+n-t.now();return t.schedule(Xoe,s,{index:0,period:i,subscriber:r})})}(n,e))}function qc(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 If(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))}class lS{constructor(e=!1,t,i=!0){this._multiple=e,this._emitChanges=i,this._selection=new Set,this._deselectedToEmit=[],this._selectedToEmit=[],this.changed=new Se,t&&t.length&&(e?t.forEach(r=>this._markSelected(r)):this._markSelected(t[0]),this._selectedToEmit.length=0)}get selected(){return this._selected||(this._selected=Array.from(this._selection.values())),this._selected}select(...e){this._verifyValueAssignment(e),e.forEach(t=>this._markSelected(t)),this._emitChangeEvent()}deselect(...e){this._verifyValueAssignment(e),e.forEach(t=>this._unmarkSelected(t)),this._emitChangeEvent()}toggle(e){this.isSelected(e)?this.deselect(e):this.select(e)}clear(){this._unmarkAll(),this._emitChangeEvent()}isSelected(e){return this._selection.has(e)}isEmpty(){return 0===this._selection.size}hasValue(){return!this.isEmpty()}sort(e){this._multiple&&this.selected&&this._selected.sort(e)}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(e){this.isSelected(e)||(this._multiple||this._unmarkAll(),this._selection.add(e),this._emitChanges&&this._selectedToEmit.push(e))}_unmarkSelected(e){this.isSelected(e)&&(this._selection.delete(e),this._emitChanges&&this._deselectedToEmit.push(e))}_unmarkAll(){this.isEmpty()||this._selection.forEach(e=>this._unmarkSelected(e))}_verifyValueAssignment(e){}}let cS=(()=>{class n{constructor(){this._listeners=[]}notify(t,i){for(let r of this._listeners)r(t,i)}listen(t){return this._listeners.push(t),()=>{this._listeners=this._listeners.filter(i=>t!==i)}}ngOnDestroy(){this._listeners=[]}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ue({factory:function(){return new n},token:n,providedIn:"root"}),n})(),um=(()=>{class n{constructor(t,i,r){this._ngZone=t,this._platform=i,this._scrolled=new Se,this._globalSubscription=null,this._scrolledCount=0,this.scrollContainers=new Map,this._document=r}register(t){this.scrollContainers.has(t)||this.scrollContainers.set(t,t.elementScrolled().subscribe(()=>this._scrolled.next(t)))}deregister(t){const i=this.scrollContainers.get(t);i&&(i.unsubscribe(),this.scrollContainers.delete(t))}scrolled(t=20){return this._platform.isBrowser?new ce(i=>{this._globalSubscription||this._addGlobalListener();const r=t>0?this._scrolled.pipe(aS(t)).subscribe(i):this._scrolled.subscribe(i);return this._scrolledCount++,()=>{r.unsubscribe(),this._scrolledCount--,this._scrolledCount||this._removeGlobalListener()}}):ht()}ngOnDestroy(){this._removeGlobalListener(),this.scrollContainers.forEach((t,i)=>this.deregister(i)),this._scrolled.complete()}ancestorScrolled(t,i){const r=this.getAncestorScrollContainers(t);return this.scrolled(i).pipe(Fn(s=>!s||r.indexOf(s)>-1))}getAncestorScrollContainers(t){const i=[];return this.scrollContainers.forEach((r,s)=>{this._scrollableContainsElement(s,t)&&i.push(s)}),i}_getWindow(){return this._document.defaultView||window}_scrollableContainsElement(t,i){let r=Wu(i),s=t.getElementRef().nativeElement;do{if(r==s)return!0}while(r=r.parentElement);return!1}_addGlobalListener(){this._globalSubscription=this._ngZone.runOutsideAngular(()=>Wc(this._getWindow().document,"scroll").subscribe(()=>this._scrolled.next()))}_removeGlobalListener(){this._globalSubscription&&(this._globalSubscription.unsubscribe(),this._globalSubscription=null)}}return n.\u0275fac=function(t){return new(t||n)(I(dt),I(si),I(ut,8))},n.\u0275prov=ue({factory:function(){return new n(I(dt),I(si),I(ut,8))},token:n,providedIn:"root"}),n})(),Yf=(()=>{class n{constructor(t,i,r){this._platform=t,this._change=new Se,this._changeListener=s=>{this._change.next(s)},this._document=r,i.runOutsideAngular(()=>{if(t.isBrowser){const s=this._getWindow();s.addEventListener("resize",this._changeListener),s.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:i,height:r}=this.getViewportSize();return{top:t.top,left:t.left,bottom:t.top+r,right:t.left+i,height:r,width:i}}getViewportScrollPosition(){if(!this._platform.isBrowser)return{top:0,left:0};const t=this._document,i=this._getWindow(),r=t.documentElement,s=r.getBoundingClientRect();return{top:-s.top||t.body.scrollTop||i.scrollY||r.scrollTop||0,left:-s.left||t.body.scrollLeft||i.scrollX||r.scrollLeft||0}}change(t=20){return t>0?this._change.pipe(aS(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 n.\u0275fac=function(t){return new(t||n)(I(si),I(dt),I(ut,8))},n.\u0275prov=ue({factory:function(){return new n(I(si),I(dt),I(ut,8))},token:n,providedIn:"root"}),n})(),Wv=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({}),n})(),Gj=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[Nv,Rv,Wv],Nv,Wv]}),n})();class qO{attach(e){return this._attachedHost=e,e.attach(this)}detach(){let e=this._attachedHost;null!=e&&(this._attachedHost=null,e.detach())}get isAttached(){return null!=this._attachedHost}setAttachedHost(e){this._attachedHost=e}}class dm extends qO{constructor(e,t,i,r){super(),this.component=e,this.viewContainerRef=t,this.injector=i,this.componentFactoryResolver=r}}class Xf extends qO{constructor(e,t,i){super(),this.templateRef=e,this.viewContainerRef=t,this.context=i}get origin(){return this.templateRef.elementRef}attach(e,t=this.context){return this.context=t,super.attach(e)}detach(){return this.context=void 0,super.detach()}}class fae extends qO{constructor(e){super(),this.element=e instanceof rt?e.nativeElement:e}}class uS{constructor(){this._isDisposed=!1,this.attachDomPortal=null}hasAttached(){return!!this._attachedPortal}attach(e){return e instanceof dm?(this._attachedPortal=e,this.attachComponentPortal(e)):e instanceof Xf?(this._attachedPortal=e,this.attachTemplatePortal(e)):this.attachDomPortal&&e instanceof fae?(this._attachedPortal=e,this.attachDomPortal(e)):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(e){this._disposeFn=e}_invokeDisposeFn(){this._disposeFn&&(this._disposeFn(),this._disposeFn=null)}}class pae extends uS{constructor(e,t,i,r,s){super(),this.outletElement=e,this._componentFactoryResolver=t,this._appRef=i,this._defaultInjector=r,this.attachDomPortal=o=>{const a=o.element,l=this._document.createComment("dom-portal");a.parentNode.insertBefore(l,a),this.outletElement.appendChild(a),this._attachedPortal=o,super.setDisposeFn(()=>{l.parentNode&&l.parentNode.replaceChild(a,l)})},this._document=s}attachComponentPortal(e){const i=(e.componentFactoryResolver||this._componentFactoryResolver).resolveComponentFactory(e.component);let r;return e.viewContainerRef?(r=e.viewContainerRef.createComponent(i,e.viewContainerRef.length,e.injector||e.viewContainerRef.injector),this.setDisposeFn(()=>r.destroy())):(r=i.create(e.injector||this._defaultInjector),this._appRef.attachView(r.hostView),this.setDisposeFn(()=>{this._appRef.detachView(r.hostView),r.destroy()})),this.outletElement.appendChild(this._getComponentRootNode(r)),this._attachedPortal=e,r}attachTemplatePortal(e){let t=e.viewContainerRef,i=t.createEmbeddedView(e.templateRef,e.context);return i.rootNodes.forEach(r=>this.outletElement.appendChild(r)),i.detectChanges(),this.setDisposeFn(()=>{let r=t.indexOf(i);-1!==r&&t.remove(r)}),this._attachedPortal=e,i}dispose(){super.dispose(),null!=this.outletElement.parentNode&&this.outletElement.parentNode.removeChild(this.outletElement)}_getComponentRootNode(e){return e.hostView.rootNodes[0]}}let Kf=(()=>{class n extends uS{constructor(t,i,r){super(),this._componentFactoryResolver=t,this._viewContainerRef=i,this._isInitialized=!1,this.attached=new Le,this.attachDomPortal=s=>{const o=s.element,a=this._document.createComment("dom-portal");s.setAttachedHost(this),o.parentNode.insertBefore(a,o),this._getRootNode().appendChild(o),this._attachedPortal=s,super.setDisposeFn(()=>{a.parentNode&&a.parentNode.replaceChild(o,a)})},this._document=r}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 i=null!=t.viewContainerRef?t.viewContainerRef:this._viewContainerRef,s=(t.componentFactoryResolver||this._componentFactoryResolver).resolveComponentFactory(t.component),o=i.createComponent(s,i.length,t.injector||i.injector);return i!==this._viewContainerRef&&this._getRootNode().appendChild(o.hostView.rootNodes[0]),super.setDisposeFn(()=>o.destroy()),this._attachedPortal=t,this._attachedRef=o,this.attached.emit(o),o}attachTemplatePortal(t){t.setAttachedHost(this);const i=this._viewContainerRef.createEmbeddedView(t.templateRef,t.context);return super.setDisposeFn(()=>this._viewContainerRef.clear()),this._attachedPortal=t,this._attachedRef=i,this.attached.emit(i),i}_getRootNode(){const t=this._viewContainerRef.element.nativeElement;return t.nodeType===t.ELEMENT_NODE?t:t.parentNode}}return n.\u0275fac=function(t){return new(t||n)(E(ll),E(ns),E(ut))},n.\u0275dir=oe({type:n,selectors:[["","cdkPortalOutlet",""]],inputs:{portal:["cdkPortalOutlet","portal"]},outputs:{attached:"attached"},exportAs:["cdkPortalOutlet"],features:[ct]}),n})(),dS=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({}),n})();function qj(n,e=!1){return t=>t.lift(new gae(n,e))}class gae{constructor(e,t){this.predicate=e,this.inclusive=t}call(e,t){return t.subscribe(new mae(e,this.predicate,this.inclusive))}}class mae extends xt{constructor(e,t,i){super(e),this.predicate=t,this.inclusive=i,this.index=0}_next(e){const t=this.destination;let i;try{i=this.predicate(e,this.index++)}catch(r){return void t.error(r)}this.nextOrComplete(e,i)}nextOrComplete(e,t){const i=this.destination;Boolean(t)?i.next(e):(this.inclusive&&i.next(e),i.complete())}}const Yj=TV();class _ae{constructor(e,t){this._viewportRuler=e,this._previousHTMLStyles={top:"",left:""},this._isEnabled=!1,this._document=t}attach(){}enable(){if(this._canBeEnabled()){const e=this._document.documentElement;this._previousScrollPosition=this._viewportRuler.getViewportScrollPosition(),this._previousHTMLStyles.left=e.style.left||"",this._previousHTMLStyles.top=e.style.top||"",e.style.left=jr(-this._previousScrollPosition.left),e.style.top=jr(-this._previousScrollPosition.top),e.classList.add("cdk-global-scrollblock"),this._isEnabled=!0}}disable(){if(this._isEnabled){const e=this._document.documentElement,i=e.style,r=this._document.body.style,s=i.scrollBehavior||"",o=r.scrollBehavior||"";this._isEnabled=!1,i.left=this._previousHTMLStyles.left,i.top=this._previousHTMLStyles.top,e.classList.remove("cdk-global-scrollblock"),Yj&&(i.scrollBehavior=r.scrollBehavior="auto"),window.scroll(this._previousScrollPosition.left,this._previousScrollPosition.top),Yj&&(i.scrollBehavior=s,r.scrollBehavior=o)}}_canBeEnabled(){if(this._document.documentElement.classList.contains("cdk-global-scrollblock")||this._isEnabled)return!1;const t=this._document.body,i=this._viewportRuler.getViewportSize();return t.scrollHeight>i.height||t.scrollWidth>i.width}}class yae{constructor(e,t,i,r){this._scrollDispatcher=e,this._ngZone=t,this._viewportRuler=i,this._config=r,this._scrollSubscription=null,this._detach=()=>{this.disable(),this._overlayRef.hasAttached()&&this._ngZone.run(()=>this._overlayRef.detach())}}attach(e){this._overlayRef=e}enable(){if(this._scrollSubscription)return;const e=this._scrollDispatcher.scrolled(0);this._config&&this._config.threshold&&this._config.threshold>1?(this._initialScrollPosition=this._viewportRuler.getViewportScrollPosition().top,this._scrollSubscription=e.subscribe(()=>{const t=this._viewportRuler.getViewportScrollPosition().top;Math.abs(t-this._initialScrollPosition)>this._config.threshold?this._detach():this._overlayRef.updatePosition()})):this._scrollSubscription=e.subscribe(this._detach)}disable(){this._scrollSubscription&&(this._scrollSubscription.unsubscribe(),this._scrollSubscription=null)}detach(){this.disable(),this._overlayRef=null}}class Xj{enable(){}disable(){}attach(){}}function YO(n,e){return e.some(t=>n.bottomt.bottom||n.rightt.right)}function Kj(n,e){return e.some(t=>n.topt.bottom||n.leftt.right)}class vae{constructor(e,t,i,r){this._scrollDispatcher=e,this._viewportRuler=t,this._ngZone=i,this._config=r,this._scrollSubscription=null}attach(e){this._overlayRef=e}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:i,height:r}=this._viewportRuler.getViewportSize();YO(t,[{width:i,height:r,bottom:r,right:i,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 bae=(()=>{class n{constructor(t,i,r,s){this._scrollDispatcher=t,this._viewportRuler=i,this._ngZone=r,this.noop=()=>new Xj,this.close=o=>new yae(this._scrollDispatcher,this._ngZone,this._viewportRuler,o),this.block=()=>new _ae(this._viewportRuler,this._document),this.reposition=o=>new vae(this._scrollDispatcher,this._viewportRuler,this._ngZone,o),this._document=s}}return n.\u0275fac=function(t){return new(t||n)(I(um),I(Yf),I(dt),I(ut))},n.\u0275prov=ue({factory:function(){return new n(I(um),I(Yf),I(dt),I(ut))},token:n,providedIn:"root"}),n})();class qv{constructor(e){if(this.scrollStrategy=new Xj,this.panelClass="",this.hasBackdrop=!1,this.backdropClass="cdk-overlay-dark-backdrop",this.disposeOnNavigation=!1,e){const t=Object.keys(e);for(const i of t)void 0!==e[i]&&(this[i]=e[i])}}}class Cae{constructor(e,t,i,r,s){this.offsetX=i,this.offsetY=r,this.panelClass=s,this.originX=e.originX,this.originY=e.originY,this.overlayX=t.overlayX,this.overlayY=t.overlayY}}class wae{constructor(e,t){this.connectionPair=e,this.scrollableViewProperties=t}}let Zj=(()=>{class n{constructor(t){this._attachedOverlays=[],this._document=t}ngOnDestroy(){this.detach()}add(t){this.remove(t),this._attachedOverlays.push(t)}remove(t){const i=this._attachedOverlays.indexOf(t);i>-1&&this._attachedOverlays.splice(i,1),0===this._attachedOverlays.length&&this.detach()}}return n.\u0275fac=function(t){return new(t||n)(I(ut))},n.\u0275prov=ue({factory:function(){return new n(I(ut))},token:n,providedIn:"root"}),n})(),Eae=(()=>{class n extends Zj{constructor(t){super(t),this._keydownListener=i=>{const r=this._attachedOverlays;for(let s=r.length-1;s>-1;s--)if(r[s]._keydownEvents.observers.length>0){r[s]._keydownEvents.next(i);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 n.\u0275fac=function(t){return new(t||n)(I(ut))},n.\u0275prov=ue({factory:function(){return new n(I(ut))},token:n,providedIn:"root"}),n})(),Sae=(()=>{class n extends Zj{constructor(t,i){super(t),this._platform=i,this._cursorStyleIsSet=!1,this._clickListener=r=>{const s=Nf(r),o=this._attachedOverlays.slice();for(let a=o.length-1;a>-1;a--){const l=o[a];if(!(l._outsidePointerEvents.observers.length<1)&&l.hasAttached()){if(l.overlayElement.contains(s))break;l._outsidePointerEvents.next(r)}}}}add(t){if(super.add(t),!this._isAttached){const i=this._document.body;i.addEventListener("click",this._clickListener,!0),i.addEventListener("auxclick",this._clickListener,!0),i.addEventListener("contextmenu",this._clickListener,!0),this._platform.IOS&&!this._cursorStyleIsSet&&(this._cursorOriginalValue=i.style.cursor,i.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 n.\u0275fac=function(t){return new(t||n)(I(ut),I(si))},n.\u0275prov=ue({factory:function(){return new n(I(ut),I(si))},token:n,providedIn:"root"}),n})();const ah="undefined"!=typeof window?window:{},Qj=void 0!==ah.__karma__&&!!ah.__karma__||void 0!==ah.jasmine&&!!ah.jasmine||void 0!==ah.jest&&!!ah.jest||void 0!==ah.Mocha&&!!ah.Mocha;let hm=(()=>{class n{constructor(t,i){this._platform=i,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||Qj){const r=this._document.querySelectorAll(`.${t}[platform="server"], .${t}[platform="test"]`);for(let s=0;sthis._backdropClick.next(d),this._keydownEvents=new Se,this._outsidePointerEvents=new Se,r.scrollStrategy&&(this._scrollStrategy=r.scrollStrategy,this._scrollStrategy.attach(this)),this._positionStrategy=r.positionStrategy}get overlayElement(){return this._pane}get backdropElement(){return this._backdropElement}get hostElement(){return this._host}attach(e){let t=this._portalOutlet.attach(e);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(yi(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),t}detach(){if(!this.hasAttached())return;this.detachBackdrop(),this._togglePointerEvents(!1),this._positionStrategy&&this._positionStrategy.detach&&this._positionStrategy.detach(),this._scrollStrategy&&this._scrollStrategy.disable();const e=this._portalOutlet.detach();return this._detachments.next(),this._keyboardDispatcher.remove(this),this._detachContentWhenStable(),this._locationChanges.unsubscribe(),this._outsideClickDispatcher.remove(this),e}dispose(){const e=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,e&&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(e){e!==this._positionStrategy&&(this._positionStrategy&&this._positionStrategy.dispose(),this._positionStrategy=e,this.hasAttached()&&(e.attach(this),this.updatePosition()))}updateSize(e){this._config=Object.assign(Object.assign({},this._config),e),this._updateElementSize()}setDirection(e){this._config=Object.assign(Object.assign({},this._config),{direction:e}),this._updateElementDirection()}addPanelClass(e){this._pane&&this._toggleClasses(this._pane,e,!0)}removePanelClass(e){this._pane&&this._toggleClasses(this._pane,e,!1)}getDirection(){const e=this._config.direction;return e?"string"==typeof e?e:e.value:"ltr"}updateScrollStrategy(e){e!==this._scrollStrategy&&(this._disposeScrollStrategy(),this._scrollStrategy=e,this.hasAttached()&&(e.attach(this),e.enable()))}_updateElementDirection(){this._host.setAttribute("dir",this.getDirection())}_updateElementSize(){if(!this._pane)return;const e=this._pane.style;e.width=jr(this._config.width),e.height=jr(this._config.height),e.minWidth=jr(this._config.minWidth),e.minHeight=jr(this._config.minHeight),e.maxWidth=jr(this._config.maxWidth),e.maxHeight=jr(this._config.maxHeight)}_togglePointerEvents(e){this._pane.style.pointerEvents=e?"":"none"}_attachBackdrop(){const e="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(e)})}):this._backdropElement.classList.add(e)}_updateStackingOrder(){this._host.nextSibling&&this._host.parentNode.appendChild(this._host)}detachBackdrop(){let e=this._backdropElement;if(!e)return;let t,i=()=>{e&&(e.removeEventListener("click",this._backdropClickHandler),e.removeEventListener("transitionend",i),e.parentNode&&e.parentNode.removeChild(e)),this._backdropElement==e&&(this._backdropElement=null),this._config.backdropClass&&this._toggleClasses(e,this._config.backdropClass,!1),clearTimeout(t)};e.classList.remove("cdk-overlay-backdrop-showing"),this._ngZone.runOutsideAngular(()=>{e.addEventListener("transitionend",i)}),e.style.pointerEvents="none",t=this._ngZone.runOutsideAngular(()=>setTimeout(i,500))}_toggleClasses(e,t,i){const r=e.classList;EE(t).forEach(s=>{s&&(i?r.add(s):r.remove(s))})}_detachContentWhenStable(){this._ngZone.runOutsideAngular(()=>{const e=this._ngZone.onStable.pipe(Tn(Ni(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)),e.unsubscribe())})})}_disposeScrollStrategy(){const e=this._scrollStrategy;e&&(e.disable(),e.detach&&e.detach())}}const Jj="cdk-overlay-connected-position-bounding-box",xae=/([A-Za-z%]+)$/;class eU{constructor(e,t,i,r,s){this._viewportRuler=t,this._document=i,this._platform=r,this._overlayContainer=s,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 Se,this._resizeSubscription=Te.EMPTY,this._offsetX=0,this._offsetY=0,this._appliedPanelClasses=[],this.positionChanges=this._positionChanges,this.setOrigin(e)}get positions(){return this._preferredPositions}attach(e){this._validatePositions(),e.hostElement.classList.add(Jj),this._overlayRef=e,this._boundingBox=e.hostElement,this._pane=e.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 e=this._originRect,t=this._overlayRect,i=this._viewportRect,r=[];let s;for(let o of this._preferredPositions){let a=this._getOriginPoint(e,o),l=this._getOverlayPoint(a,t,o),c=this._getOverlayFit(l,t,i,o);if(c.isCompletelyWithinViewport)return this._isPushed=!1,void this._applyPosition(o,a);this._canFitWithFlexibleDimensions(c,l,i)?r.push({position:o,origin:a,overlayRect:t,boundingBoxRect:this._calculateBoundingBoxRect(a,o)}):(!s||s.overlayFit.visibleAreaa&&(a=c,o=l)}return this._isPushed=!1,void this._applyPosition(o.position,o.origin)}if(this._canPush)return this._isPushed=!0,void this._applyPosition(s.position,s.originPoint);this._applyPosition(s.position,s.originPoint)}detach(){this._clearPanelClasses(),this._lastPosition=null,this._previousPushAmount=null,this._resizeSubscription.unsubscribe()}dispose(){this._isDisposed||(this._boundingBox&&Zf(this._boundingBox.style,{top:"",left:"",right:"",bottom:"",height:"",width:"",alignItems:"",justifyContent:""}),this._pane&&this._resetOverlayElementStyles(),this._overlayRef&&this._overlayRef.hostElement.classList.remove(Jj),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 e=this._lastPosition||this._preferredPositions[0],t=this._getOriginPoint(this._originRect,e);this._applyPosition(e,t)}}withScrollableContainers(e){return this._scrollables=e,this}withPositions(e){return this._preferredPositions=e,-1===e.indexOf(this._lastPosition)&&(this._lastPosition=null),this._validatePositions(),this}withViewportMargin(e){return this._viewportMargin=e,this}withFlexibleDimensions(e=!0){return this._hasFlexibleDimensions=e,this}withGrowAfterOpen(e=!0){return this._growAfterOpen=e,this}withPush(e=!0){return this._canPush=e,this}withLockedPosition(e=!0){return this._positionLocked=e,this}setOrigin(e){return this._origin=e,this}withDefaultOffsetX(e){return this._offsetX=e,this}withDefaultOffsetY(e){return this._offsetY=e,this}withTransformOriginOn(e){return this._transformOriginSelector=e,this}_getOriginPoint(e,t){let i,r;if("center"==t.originX)i=e.left+e.width/2;else{const s=this._isRtl()?e.right:e.left,o=this._isRtl()?e.left:e.right;i="start"==t.originX?s:o}return r="center"==t.originY?e.top+e.height/2:"top"==t.originY?e.top:e.bottom,{x:i,y:r}}_getOverlayPoint(e,t,i){let r,s;return r="center"==i.overlayX?-t.width/2:"start"===i.overlayX?this._isRtl()?-t.width:0:this._isRtl()?0:-t.width,s="center"==i.overlayY?-t.height/2:"top"==i.overlayY?0:-t.height,{x:e.x+r,y:e.y+s}}_getOverlayFit(e,t,i,r){const s=nU(t);let{x:o,y:a}=e,l=this._getOffset(r,"x"),c=this._getOffset(r,"y");l&&(o+=l),c&&(a+=c);let p=0-a,g=a+s.height-i.height,_=this._subtractOverflows(s.width,0-o,o+s.width-i.width),y=this._subtractOverflows(s.height,p,g),v=_*y;return{visibleArea:v,isCompletelyWithinViewport:s.width*s.height===v,fitsInViewportVertically:y===s.height,fitsInViewportHorizontally:_==s.width}}_canFitWithFlexibleDimensions(e,t,i){if(this._hasFlexibleDimensions){const r=i.bottom-t.y,s=i.right-t.x,o=tU(this._overlayRef.getConfig().minHeight),a=tU(this._overlayRef.getConfig().minWidth),c=e.fitsInViewportHorizontally||null!=a&&a<=s;return(e.fitsInViewportVertically||null!=o&&o<=r)&&c}return!1}_pushOverlayOnScreen(e,t,i){if(this._previousPushAmount&&this._positionLocked)return{x:e.x+this._previousPushAmount.x,y:e.y+this._previousPushAmount.y};const r=nU(t),s=this._viewportRect,o=Math.max(e.x+r.width-s.width,0),a=Math.max(e.y+r.height-s.height,0),l=Math.max(s.top-i.top-e.y,0),c=Math.max(s.left-i.left-e.x,0);let d=0,f=0;return d=r.width<=s.width?c||-o:e.x_&&!this._isInitialRender&&!this._growAfterOpen&&(o=e.y-_/2)}if("end"===t.overlayX&&!r||"start"===t.overlayX&&r)p=i.width-e.x+this._viewportMargin,d=e.x-this._viewportMargin;else if("start"===t.overlayX&&!r||"end"===t.overlayX&&r)f=e.x,d=i.right-e.x;else{const g=Math.min(i.right-e.x+i.left,e.x),_=this._lastBoundingBoxSize.width;d=2*g,f=e.x-g,d>_&&!this._isInitialRender&&!this._growAfterOpen&&(f=e.x-_/2)}return{top:o,left:f,bottom:a,right:p,width:d,height:s}}_setBoundingBoxStyles(e,t){const i=this._calculateBoundingBoxRect(e,t);!this._isInitialRender&&!this._growAfterOpen&&(i.height=Math.min(i.height,this._lastBoundingBoxSize.height),i.width=Math.min(i.width,this._lastBoundingBoxSize.width));const r={};if(this._hasExactPosition())r.top=r.left="0",r.bottom=r.right=r.maxHeight=r.maxWidth="",r.width=r.height="100%";else{const s=this._overlayRef.getConfig().maxHeight,o=this._overlayRef.getConfig().maxWidth;r.height=jr(i.height),r.top=jr(i.top),r.bottom=jr(i.bottom),r.width=jr(i.width),r.left=jr(i.left),r.right=jr(i.right),r.alignItems="center"===t.overlayX?"center":"end"===t.overlayX?"flex-end":"flex-start",r.justifyContent="center"===t.overlayY?"center":"bottom"===t.overlayY?"flex-end":"flex-start",s&&(r.maxHeight=jr(s)),o&&(r.maxWidth=jr(o))}this._lastBoundingBoxSize=i,Zf(this._boundingBox.style,r)}_resetBoundingBoxStyles(){Zf(this._boundingBox.style,{top:"0",left:"0",right:"0",bottom:"0",height:"",width:"",alignItems:"",justifyContent:""})}_resetOverlayElementStyles(){Zf(this._pane.style,{top:"",left:"",bottom:"",right:"",position:"",transform:""})}_setOverlayElementStyles(e,t){const i={},r=this._hasExactPosition(),s=this._hasFlexibleDimensions,o=this._overlayRef.getConfig();if(r){const d=this._viewportRuler.getViewportScrollPosition();Zf(i,this._getExactOverlayY(t,e,d)),Zf(i,this._getExactOverlayX(t,e,d))}else i.position="static";let a="",l=this._getOffset(t,"x"),c=this._getOffset(t,"y");l&&(a+=`translateX(${l}px) `),c&&(a+=`translateY(${c}px)`),i.transform=a.trim(),o.maxHeight&&(r?i.maxHeight=jr(o.maxHeight):s&&(i.maxHeight="")),o.maxWidth&&(r?i.maxWidth=jr(o.maxWidth):s&&(i.maxWidth="")),Zf(this._pane.style,i)}_getExactOverlayY(e,t,i){let r={top:"",bottom:""},s=this._getOverlayPoint(t,this._overlayRect,e);this._isPushed&&(s=this._pushOverlayOnScreen(s,this._overlayRect,i));let o=this._overlayContainer.getContainerElement().getBoundingClientRect().top;return s.y-=o,"bottom"===e.overlayY?r.bottom=this._document.documentElement.clientHeight-(s.y+this._overlayRect.height)+"px":r.top=jr(s.y),r}_getExactOverlayX(e,t,i){let o,r={left:"",right:""},s=this._getOverlayPoint(t,this._overlayRect,e);return this._isPushed&&(s=this._pushOverlayOnScreen(s,this._overlayRect,i)),o=this._isRtl()?"end"===e.overlayX?"left":"right":"end"===e.overlayX?"right":"left","right"===o?r.right=this._document.documentElement.clientWidth-(s.x+this._overlayRect.width)+"px":r.left=jr(s.x),r}_getScrollVisibility(){const e=this._getOriginRect(),t=this._pane.getBoundingClientRect(),i=this._scrollables.map(r=>r.getElementRef().nativeElement.getBoundingClientRect());return{isOriginClipped:Kj(e,i),isOriginOutsideView:YO(e,i),isOverlayClipped:Kj(t,i),isOverlayOutsideView:YO(t,i)}}_subtractOverflows(e,...t){return t.reduce((i,r)=>i-Math.max(r,0),e)}_getNarrowedViewportRect(){const e=this._document.documentElement.clientWidth,t=this._document.documentElement.clientHeight,i=this._viewportRuler.getViewportScrollPosition();return{top:i.top+this._viewportMargin,left:i.left+this._viewportMargin,right:i.left+e-this._viewportMargin,bottom:i.top+t-this._viewportMargin,width:e-2*this._viewportMargin,height:t-2*this._viewportMargin}}_isRtl(){return"rtl"===this._overlayRef.getDirection()}_hasExactPosition(){return!this._hasFlexibleDimensions||this._isPushed}_getOffset(e,t){return"x"===t?null==e.offsetX?this._offsetX:e.offsetX:null==e.offsetY?this._offsetY:e.offsetY}_validatePositions(){}_addPanelClasses(e){this._pane&&EE(e).forEach(t=>{""!==t&&-1===this._appliedPanelClasses.indexOf(t)&&(this._appliedPanelClasses.push(t),this._pane.classList.add(t))})}_clearPanelClasses(){this._pane&&(this._appliedPanelClasses.forEach(e=>{this._pane.classList.remove(e)}),this._appliedPanelClasses=[])}_getOriginRect(){const e=this._origin;if(e instanceof rt)return e.nativeElement.getBoundingClientRect();if(e instanceof Element)return e.getBoundingClientRect();const t=e.width||0,i=e.height||0;return{top:e.y,bottom:e.y+i,left:e.x,right:e.x+t,height:i,width:t}}}function Zf(n,e){for(let t in e)e.hasOwnProperty(t)&&(n[t]=e[t]);return n}function tU(n){if("number"!=typeof n&&null!=n){const[e,t]=n.split(xae);return t&&"px"!==t?null:parseFloat(e)}return n||null}function nU(n){return{top:Math.floor(n.top),right:Math.floor(n.right),bottom:Math.floor(n.bottom),left:Math.floor(n.left),width:Math.floor(n.width),height:Math.floor(n.height)}}class Tae{constructor(e,t,i,r,s,o,a){this._preferredPositions=[],this._positionStrategy=new eU(i,r,s,o,a).withFlexibleDimensions(!1).withPush(!1).withViewportMargin(0),this.withFallbackPosition(e,t),this.onPositionChange=this._positionStrategy.positionChanges}get positions(){return this._preferredPositions}attach(e){this._overlayRef=e,this._positionStrategy.attach(e),this._direction&&(e.setDirection(this._direction),this._direction=null)}dispose(){this._positionStrategy.dispose()}detach(){this._positionStrategy.detach()}apply(){this._positionStrategy.apply()}recalculateLastPosition(){this._positionStrategy.reapplyLastPosition()}withScrollableContainers(e){this._positionStrategy.withScrollableContainers(e)}withFallbackPosition(e,t,i,r){const s=new Cae(e,t,i,r);return this._preferredPositions.push(s),this._positionStrategy.withPositions(this._preferredPositions),this}withDirection(e){return this._overlayRef?this._overlayRef.setDirection(e):this._direction=e,this}withOffsetX(e){return this._positionStrategy.withDefaultOffsetX(e),this}withOffsetY(e){return this._positionStrategy.withDefaultOffsetY(e),this}withLockedPosition(e){return this._positionStrategy.withLockedPosition(e),this}withPositions(e){return this._preferredPositions=e.slice(),this._positionStrategy.withPositions(this._preferredPositions),this}setOrigin(e){return this._positionStrategy.setOrigin(e),this}}const iU="cdk-global-overlay-wrapper";class Aae{constructor(){this._cssPosition="static",this._topOffset="",this._bottomOffset="",this._leftOffset="",this._rightOffset="",this._alignItems="",this._justifyContent="",this._width="",this._height=""}attach(e){const t=e.getConfig();this._overlayRef=e,this._width&&!t.width&&e.updateSize({width:this._width}),this._height&&!t.height&&e.updateSize({height:this._height}),e.hostElement.classList.add(iU),this._isDisposed=!1}top(e=""){return this._bottomOffset="",this._topOffset=e,this._alignItems="flex-start",this}left(e=""){return this._rightOffset="",this._leftOffset=e,this._justifyContent="flex-start",this}bottom(e=""){return this._topOffset="",this._bottomOffset=e,this._alignItems="flex-end",this}right(e=""){return this._leftOffset="",this._rightOffset=e,this._justifyContent="flex-end",this}width(e=""){return this._overlayRef?this._overlayRef.updateSize({width:e}):this._width=e,this}height(e=""){return this._overlayRef?this._overlayRef.updateSize({height:e}):this._height=e,this}centerHorizontally(e=""){return this.left(e),this._justifyContent="center",this}centerVertically(e=""){return this.top(e),this._alignItems="center",this}apply(){if(!this._overlayRef||!this._overlayRef.hasAttached())return;const e=this._overlayRef.overlayElement.style,t=this._overlayRef.hostElement.style,i=this._overlayRef.getConfig(),{width:r,height:s,maxWidth:o,maxHeight:a}=i,l=!("100%"!==r&&"100vw"!==r||o&&"100%"!==o&&"100vw"!==o),c=!("100%"!==s&&"100vh"!==s||a&&"100%"!==a&&"100vh"!==a);e.position=this._cssPosition,e.marginLeft=l?"0":this._leftOffset,e.marginTop=c?"0":this._topOffset,e.marginBottom=this._bottomOffset,e.marginRight=this._rightOffset,l?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=c?"flex-start":this._alignItems}dispose(){if(this._isDisposed||!this._overlayRef)return;const e=this._overlayRef.overlayElement.style,t=this._overlayRef.hostElement,i=t.style;t.classList.remove(iU),i.justifyContent=i.alignItems=e.marginTop=e.marginBottom=e.marginLeft=e.marginRight=e.position="",this._overlayRef=null,this._isDisposed=!0}}let Dae=(()=>{class n{constructor(t,i,r,s){this._viewportRuler=t,this._document=i,this._platform=r,this._overlayContainer=s}global(){return new Aae}connectedTo(t,i,r){return new Tae(i,r,t,this._viewportRuler,this._document,this._platform,this._overlayContainer)}flexibleConnectedTo(t){return new eU(t,this._viewportRuler,this._document,this._platform,this._overlayContainer)}}return n.\u0275fac=function(t){return new(t||n)(I(Yf),I(ut),I(si),I(hm))},n.\u0275prov=ue({factory:function(){return new n(I(Yf),I(ut),I(si),I(hm))},token:n,providedIn:"root"}),n})(),Oae=0,Jo=(()=>{class n{constructor(t,i,r,s,o,a,l,c,d,f,p){this.scrollStrategies=t,this._overlayContainer=i,this._componentFactoryResolver=r,this._positionBuilder=s,this._keyboardDispatcher=o,this._injector=a,this._ngZone=l,this._document=c,this._directionality=d,this._location=f,this._outsideClickDispatcher=p}create(t){const i=this._createHostElement(),r=this._createPaneElement(i),s=this._createPortalOutlet(r),o=new qv(t);return o.direction=o.direction||this._directionality.value,new Mae(s,i,r,o,this._ngZone,this._keyboardDispatcher,this._document,this._location,this._outsideClickDispatcher)}position(){return this._positionBuilder}_createPaneElement(t){const i=this._document.createElement("div");return i.id="cdk-overlay-"+Oae++,i.classList.add("cdk-overlay-pane"),t.appendChild(i),i}_createHostElement(){const t=this._document.createElement("div");return this._overlayContainer.getContainerElement().appendChild(t),t}_createPortalOutlet(t){return this._appRef||(this._appRef=this._injector.get(Jd)),new pae(t,this._componentFactoryResolver,this._appRef,this._injector,this._document)}}return n.\u0275fac=function(t){return new(t||n)(I(bae),I(hm),I(ll),I(Dae),I(Eae),I(Nt),I(dt),I(ut),I(Qo),I(Xg),I(Sae))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();const Iae=[{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"}],rU=new ve("cdk-connected-overlay-scroll-strategy");let Pae=(()=>{class n{constructor(t){this.elementRef=t}}return n.\u0275fac=function(t){return new(t||n)(E(rt))},n.\u0275dir=oe({type:n,selectors:[["","cdk-overlay-origin",""],["","overlay-origin",""],["","cdkOverlayOrigin",""]],exportAs:["cdkOverlayOrigin"]}),n})(),sU=(()=>{class n{constructor(t,i,r,s,o){this._overlay=t,this._dir=o,this._hasBackdrop=!1,this._lockPosition=!1,this._growAfterOpen=!1,this._flexibleDimensions=!1,this._push=!1,this._backdropSubscription=Te.EMPTY,this._attachSubscription=Te.EMPTY,this._detachSubscription=Te.EMPTY,this._positionSubscription=Te.EMPTY,this.viewportMargin=0,this.open=!1,this.disableClose=!1,this.backdropClick=new Le,this.positionChange=new Le,this.attach=new Le,this.detach=new Le,this.overlayKeydown=new Le,this.overlayOutsideClick=new Le,this._templatePortal=new Xf(i,r),this._scrollStrategyFactory=s,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=Mt(t)}get lockPosition(){return this._lockPosition}set lockPosition(t){this._lockPosition=Mt(t)}get flexibleDimensions(){return this._flexibleDimensions}set flexibleDimensions(t){this._flexibleDimensions=Mt(t)}get growAfterOpen(){return this._growAfterOpen}set growAfterOpen(t){this._growAfterOpen=Mt(t)}get push(){return this._push}set push(t){this._push=Mt(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=Iae);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(i=>{this.overlayKeydown.next(i),27===i.keyCode&&!this.disableClose&&!Zs(i)&&(i.preventDefault(),this._detachOverlay())}),this._overlayRef.outsidePointerEvents().subscribe(i=>{this.overlayOutsideClick.next(i)})}_buildConfig(){const t=this._position=this.positionStrategy||this._createPositionStrategy(),i=new qv({direction:this._dir,positionStrategy:t,scrollStrategy:this.scrollStrategy,hasBackdrop:this.hasBackdrop});return(this.width||0===this.width)&&(i.width=this.width),(this.height||0===this.height)&&(i.height=this.height),(this.minWidth||0===this.minWidth)&&(i.minWidth=this.minWidth),(this.minHeight||0===this.minHeight)&&(i.minHeight=this.minHeight),this.backdropClass&&(i.backdropClass=this.backdropClass),this.panelClass&&(i.panelClass=this.panelClass),i}_updatePositionStrategy(t){const i=this.positions.map(r=>({originX:r.originX,originY:r.originY,overlayX:r.overlayX,overlayY:r.overlayY,offsetX:r.offsetX||this.offsetX,offsetY:r.offsetY||this.offsetY,panelClass:r.panelClass||void 0}));return t.setOrigin(this.origin.elementRef).withPositions(i).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(qj(()=>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 n.\u0275fac=function(t){return new(t||n)(E(Jo),E(Ys),E(ns),E(rU),E(Qo,8))},n.\u0275dir=oe({type:n,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:[zn]}),n})();const kae={provide:rU,deps:[Jo],useFactory:function(n){return()=>n.scrollStrategies.reposition()}};let Yv=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({providers:[Jo,kae],imports:[[Nv,dS,Gj],Gj]}),n})();const oU=["mat-button",""],aU=["*"],Nae=["mat-button","mat-flat-button","mat-icon-button","mat-raised-button","mat-stroked-button","mat-mini-fab","mat-fab"],Lae=Uf(jf(nc(class{constructor(n){this._elementRef=n}})));let lh=(()=>{class n extends Lae{constructor(t,i,r){super(t),this._focusMonitor=i,this._animationMode=r,this.isRoundButton=this._hasHostAttributes("mat-fab","mat-mini-fab"),this.isIconButton=this._hasHostAttributes("mat-icon-button");for(const s of Nae)this._hasHostAttributes(s)&&this._getHostElement().classList.add(s);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,i){t?this._focusMonitor.focusVia(this._getHostElement(),t,i):this._getHostElement().focus(i)}_getHostElement(){return this._elementRef.nativeElement}_isRippleDisabled(){return this.disableRipple||this.disabled}_hasHostAttributes(...t){return t.some(i=>this._getHostElement().hasAttribute(i))}}return n.\u0275fac=function(t){return new(t||n)(E(rt),E(Sa),E(Do,8))},n.\u0275cmp=Ne({type:n,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,i){if(1&t&&Jn(Js,5),2&t){let r;_t(r=yt())&&(i.ripple=r.first)}},hostAttrs:[1,"mat-focus-indicator"],hostVars:5,hostBindings:function(t,i){2&t&&(nn("disabled",i.disabled||null),st("_mat-animation-noopable","NoopAnimations"===i._animationMode)("mat-button-disabled",i.disabled))},inputs:{disabled:"disabled",disableRipple:"disableRipple",color:"color"},exportAs:["matButton"],features:[ct],attrs:oU,ngContentSelectors:aU,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,i){1&t&&(wi(),R(0,"span",0),Ht(1),k(),tt(2,"span",1),tt(3,"span",2)),2&t&&(G(2),st("mat-button-ripple-round",i.isRoundButton||i.isIconButton),ie("matRippleDisabled",i._isRippleDisabled())("matRippleCentered",i.isIconButton)("matRippleTrigger",i._getHostElement()))},directives:[Js],styles:[".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"],encapsulation:2,changeDetection:0}),n})(),ch=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[_l,On],On]}),n})();class cU extends xt{notifyNext(e,t,i,r,s){this.destination.next(t)}notifyError(e,t){this.destination.error(e)}notifyComplete(e){this.destination.complete()}}class Bae extends xt{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 uU(n,e,t,i,r=new Bae(n,t,i)){if(!r.closed)return e instanceof ce?e.subscribe(r):ki(e)(r)}const dU={};function Qi(...n){let e,t;return Gn(n[n.length-1])&&(t=n.pop()),"function"==typeof n[n.length-1]&&(e=n.pop()),1===n.length&&we(n[0])&&(n=n[0]),za(n,t).lift(new hU(e))}class hU{constructor(e){this.resultSelector=e}call(e,t){return t.subscribe(new Vae(e,this.resultSelector))}}class Vae extends cU{constructor(e,t){super(e),this.resultSelector=t,this.active=0,this.values=[],this.observables=[]}_next(e){this.values.push(dU),this.observables.push(e)}_complete(){const e=this.observables,t=e.length;if(0===t)this.destination.complete();else{this.active=t,this.toRespond=t;for(let i=0;i{class n{constructor(t){this._platform=t,this._matchMedia=this._platform.isBrowser&&window.matchMedia?window.matchMedia.bind(window):jae}matchMedia(t){return this._platform.WEBKIT&&function(n){if(!fU.has(n))try{fm||(fm=document.createElement("style"),fm.setAttribute("type","text/css"),document.head.appendChild(fm)),fm.sheet&&(fm.sheet.insertRule(`@media ${n} {.fx-query-test{ }}`,0),fU.add(n))}catch(e){console.error(e)}}(t),this._matchMedia(t)}}return n.\u0275fac=function(t){return new(t||n)(I(si))},n.\u0275prov=ue({factory:function(){return new n(I(si))},token:n,providedIn:"root"}),n})();function jae(n){return{matches:"all"===n||""===n,media:n,addListener:()=>{},removeListener:()=>{}}}let XO=(()=>{class n{constructor(t,i){this._mediaMatcher=t,this._zone=i,this._queries=new Map,this._destroySubject=new Se}ngOnDestroy(){this._destroySubject.next(),this._destroySubject.complete()}isMatched(t){return gU(EE(t)).some(r=>this._registerQuery(r).mql.matches)}observe(t){let s=Qi(gU(EE(t)).map(o=>this._registerQuery(o).observable));return s=IE(s.pipe(yi(1)),s.pipe(QD(1),Zg(0))),s.pipe(Ae(o=>{const a={matches:!1,breakpoints:{}};return o.forEach(({matches:l,query:c})=>{a.matches=a.matches||l,a.breakpoints[c]=l}),a}))}_registerQuery(t){if(this._queries.has(t))return this._queries.get(t);const i=this._mediaMatcher.matchMedia(t),s={observable:new ce(o=>{const a=l=>this._zone.run(()=>o.next(l));return i.addListener(a),()=>{i.removeListener(a)}}).pipe(Rr(i),Ae(({matches:o})=>({query:t,matches:o})),Tn(this._destroySubject)),mql:i};return this._queries.set(t,s),s}}return n.\u0275fac=function(t){return new(t||n)(I(pU),I(dt))},n.\u0275prov=ue({factory:function(){return new n(I(pU),I(dt))},token:n,providedIn:"root"}),n})();function gU(n){return n.map(e=>e.split(",")).reduce((e,t)=>e.concat(t)).map(e=>e.trim())}function Uae(n,e){if(1&n){const t=Zi();R(0,"div",1),R(1,"button",2),ge("click",function(){return en(t),Qe().action()}),De(2),k(),k()}if(2&n){const t=Qe();G(2),xi(t.data.action)}}function Hae(n,e){}const KO=new ve("MatSnackBarData");class hS{constructor(){this.politeness="assertive",this.announcementMessage="",this.duration=0,this.data=null,this.horizontalPosition="center",this.verticalPosition="bottom"}}const $ae=Math.pow(2,31)-1;class ZO{constructor(e,t){this._overlayRef=t,this._afterDismissed=new Se,this._afterOpened=new Se,this._onAction=new Se,this._dismissedByAction=!1,this.containerInstance=e,this.onAction().subscribe(()=>this.dismiss()),e._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(e){this._durationTimeoutId=setTimeout(()=>this.dismiss(),Math.min(e,$ae))}_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 Gae=(()=>{class n{constructor(t,i){this.snackBarRef=t,this.data=i}action(){this.snackBarRef.dismissWithAction()}get hasAction(){return!!this.data.action}}return n.\u0275fac=function(t){return new(t||n)(E(ZO),E(KO))},n.\u0275cmp=Ne({type:n,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,i){1&t&&(R(0,"span"),De(1),k(),mt(2,Uae,3,1,"div",0)),2&t&&(G(1),xi(i.data.message),G(1),ie("ngIf",i.hasAction))},directives:[zr,lh],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}),n})();const Wae={snackBarState:tc("state",[wr("void, hidden",ti({transform:"scale(0.8)",opacity:0})),wr("visible",ti({transform:"scale(1)",opacity:1})),Qs("* => visible",Ao("150ms cubic-bezier(0, 0, 0.2, 1)")),Qs("* => void, * => hidden",Ao("75ms cubic-bezier(0.4, 0.0, 1, 1)",ti({opacity:0})))])};let qae=(()=>{class n extends uS{constructor(t,i,r,s,o){super(),this._ngZone=t,this._elementRef=i,this._changeDetectorRef=r,this._platform=s,this.snackBarConfig=o,this._announceDelay=150,this._destroyed=!1,this._onAnnounce=new Se,this._onExit=new Se,this._onEnter=new Se,this._animationState="void",this.attachDomPortal=a=>(this._assertNotAttached(),this._applySnackBarClasses(),this._portalOutlet.attachDomPortal(a)),this._live="assertive"!==o.politeness||o.announcementMessage?"off"===o.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:i,toState:r}=t;if(("void"===r&&"void"!==i||"hidden"===r)&&this._completeExit(),"visible"===r){const s=this._onEnter;this._ngZone.run(()=>{s.next(),s.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(yi(1)).subscribe(()=>{this._onExit.next(),this._onExit.complete()})}_applySnackBarClasses(){const t=this._elementRef.nativeElement,i=this.snackBarConfig.panelClass;i&&(Array.isArray(i)?i.forEach(r=>t.classList.add(r)):t.classList.add(i)),"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]"),i=this._elementRef.nativeElement.querySelector("[aria-live]");if(t&&i){let r=null;this._platform.isBrowser&&document.activeElement instanceof HTMLElement&&t.contains(document.activeElement)&&(r=document.activeElement),t.removeAttribute("aria-hidden"),i.appendChild(t),null==r||r.focus(),this._onAnnounce.next(),this._onAnnounce.complete()}},this._announceDelay)})}}return n.\u0275fac=function(t){return new(t||n)(E(dt),E(rt),E(kn),E(si),E(hS))},n.\u0275cmp=Ne({type:n,selectors:[["snack-bar-container"]],viewQuery:function(t,i){if(1&t&&Jn(Kf,7),2&t){let r;_t(r=yt())&&(i._portalOutlet=r.first)}},hostAttrs:[1,"mat-snack-bar-container"],hostVars:1,hostBindings:function(t,i){1&t&&Qy("@state.done",function(s){return i.onAnimationEnd(s)}),2&t&&Pg("@state",i._animationState)},features:[ct],decls:3,vars:2,consts:[["aria-hidden","true"],["cdkPortalOutlet",""]],template:function(t,i){1&t&&(R(0,"div",0),mt(1,Hae,0,0,"ng-template",1),k(),tt(2,"div")),2&t&&(G(2),nn("aria-live",i._live)("role",i._role))},directives:[Kf],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:[Wae.snackBarState]}}),n})(),_U=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[Yv,dS,dn,ch,On],On]}),n})();const yU=new ve("mat-snack-bar-default-options",{providedIn:"root",factory:function(){return new hS}});let Xae=(()=>{class n{constructor(t,i,r,s,o,a){this._overlay=t,this._live=i,this._injector=r,this._breakpointObserver=s,this._parentSnackBar=o,this._defaultConfig=a,this._snackBarRefAtThisLevel=null,this.simpleSnackBarComponent=Gae,this.snackBarContainerComponent=qae,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,i){return this._attach(t,i)}openFromTemplate(t,i){return this._attach(t,i)}open(t,i="",r){const s=Object.assign(Object.assign({},this._defaultConfig),r);return s.data={message:t,action:i},s.announcementMessage===t&&(s.announcementMessage=void 0),this.openFromComponent(this.simpleSnackBarComponent,s)}dismiss(){this._openedSnackBarRef&&this._openedSnackBarRef.dismiss()}ngOnDestroy(){this._snackBarRefAtThisLevel&&this._snackBarRefAtThisLevel.dismiss()}_attachSnackBarContainer(t,i){const s=Nt.create({parent:i&&i.viewContainerRef&&i.viewContainerRef.injector||this._injector,providers:[{provide:hS,useValue:i}]}),o=new dm(this.snackBarContainerComponent,i.viewContainerRef,s),a=t.attach(o);return a.instance.snackBarConfig=i,a.instance}_attach(t,i){const r=Object.assign(Object.assign(Object.assign({},new hS),this._defaultConfig),i),s=this._createOverlay(r),o=this._attachSnackBarContainer(s,r),a=new ZO(o,s);if(t instanceof Ys){const l=new Xf(t,null,{$implicit:r.data,snackBarRef:a});a.instance=o.attachTemplatePortal(l)}else{const l=this._createInjector(r,a),c=new dm(t,void 0,l),d=o.attachComponentPortal(c);a.instance=d.instance}return this._breakpointObserver.observe("(max-width: 599.98px) and (orientation: portrait)").pipe(Tn(s.detachments())).subscribe(l=>{const c=s.overlayElement.classList;l.matches?c.add(this.handsetCssClass):c.remove(this.handsetCssClass)}),r.announcementMessage&&o._onAnnounce.subscribe(()=>{this._live.announce(r.announcementMessage,r.politeness)}),this._animateSnackBar(a,r),this._openedSnackBarRef=a,this._openedSnackBarRef}_animateSnackBar(t,i){t.afterDismissed().subscribe(()=>{this._openedSnackBarRef==t&&(this._openedSnackBarRef=null),i.announcementMessage&&this._live.clear()}),this._openedSnackBarRef?(this._openedSnackBarRef.afterDismissed().subscribe(()=>{t.containerInstance.enter()}),this._openedSnackBarRef.dismiss()):t.containerInstance.enter(),i.duration&&i.duration>0&&t.afterOpened().subscribe(()=>t._dismissAfter(i.duration))}_createOverlay(t){const i=new qv;i.direction=t.direction;let r=this._overlay.position().global();const s="rtl"===t.direction,o="left"===t.horizontalPosition||"start"===t.horizontalPosition&&!s||"end"===t.horizontalPosition&&s,a=!o&&"center"!==t.horizontalPosition;return o?r.left("0"):a?r.right("0"):r.centerHorizontally(),"top"===t.verticalPosition?r.top("0"):r.bottom("0"),i.positionStrategy=r,this._overlay.create(i)}_createInjector(t,i){return Nt.create({parent:t&&t.viewContainerRef&&t.viewContainerRef.injector||this._injector,providers:[{provide:ZO,useValue:i},{provide:KO,useValue:t.data}]})}}return n.\u0275fac=function(t){return new(t||n)(I(Jo),I(DE),I(Nt),I(XO),I(n,12),I(yU))},n.\u0275prov=ue({factory:function(){return new n(I(Jo),I(DE),I(Fc),I(XO),I(n,12),I(yU))},token:n,providedIn:_U}),n})();function xe(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 ws(n,e){return function(t,i){e(t,i,n)}}function Xe(n,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(n,e)}function yl(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 wU(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 JO(){return!("object"==typeof process&&"[object process]"===String(process)&&!process.browser)||wU()}const EU="undefined"!=typeof __VERSION__?__VERSION__:"untranspiled source",pS=JO();class Jae{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 eI(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 SU={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 MU(n){return"string"==typeof n?SU[n.toUpperCase()]||SU.WHITE:n}function gS(n,e){if(!n)throw new Error(e||"Assertion failed")}const ic={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},Xv=ic.window||ic.self||ic.global,xU=ic.process||{};function pm(){let n;if(pS&&Xv.performance)n=Xv.performance.now();else if(xU.hrtime){const e=xU.hrtime();n=1e3*e[0]+e[1]/1e6}else n=Date.now();return n}console;const gm={debug:pS&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},ole={enabled:!0,level:0};function vl(){}const TU={},AU={once:!0};function ale(n){for(const e in n)for(const t in n[e])return t||"untitled";return"empty"}let tI=(()=>{class n{constructor({id:t}={id:""}){this.id=t,this.VERSION=EU,this._startTs=pm(),this._deltaTs=pm(),this.LOG_THROTTLE_TIMEOUT=0,this._storage=new Jae("__probe-".concat(this.id,"__"),ole),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((pm()-this._startTs).toPrecision(10))}getDelta(){return Number((pm()-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){gS(t,i)}warn(t){return this._getLogFunction(0,t,gm.warn,arguments,AU)}error(t){return this._getLogFunction(0,t,gm.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,gm.log,arguments,{time:!0,once:!0})}log(t,i){return this._getLogFunction(t,i,gm.debug,arguments)}info(t,i){return this._getLogFunction(t,i,console.info,arguments)}once(t,i){return this._getLogFunction(t,i,gm.debug||gm.info,arguments,AU)}table(t,i,r){return i?this._getLogFunction(t,i,console.table||vl,r&&[r],{tag:ale(i)}):vl}image({logLevel:t,priority:i,image:r,message:s="",scale:o=1}){return this._shouldLog(t||i)?pS?function({image:n,message:e="",scale:t=1}){if("string"==typeof n){const r=new Image;return r.onload=()=>{const s=eI(r,e,t);console.log(...s)},r.src=n,vl}const i=n.nodeName||"";if("img"===i.toLowerCase())return console.log(...eI(n,e,t)),vl;if("canvas"===i.toLowerCase()){const r=new Image;return r.onload=()=>console.log(...eI(r,e,t)),r.src=n.toDataURL(),vl}return vl}({image:r,message:s,scale:o}):function({image:n,message:e="",scale:t=1}){let i=null;try{i=ze(307)}catch(r){}return i?()=>i(n,{fit:"box",width:"".concat(Math.round(80*t),"%")}).then(r=>console.log(r)):vl}({image:r,message:s,scale:o}):vl}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||vl)}group(t,i,r={collapsed:!1}){r=OU({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||vl)}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()>=DU(t)}_getLogFunction(t,i,r,s=[],o){if(this._shouldLog(t)){o=OU({logLevel:t,message:i,args:s,opts:o}),gS(r=r||o.method),o.total=this.getTotal(),o.delta=this.getDelta(),this._deltaTs=pm();const a=o.tag||o.message;if(o.once){if(TU[a])return vl;TU[a]=pm()}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!pS&&"string"==typeof n&&(e&&(e=MU(e),n="\x1b[".concat(e,"m").concat(n,"\x1b[39m")),t&&(e=MU(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 vl}}return n.VERSION=EU,n})();function DU(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 gS(Number.isFinite(e)&&e>=0),e}function OU(n){const{logLevel:e,message:t}=n;n.logLevel=DU(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 gS("string"===r||"object"===r),Object.assign(n,n.opts)}const jn=new tI({id:"deck"}),qn={DEFAULT:-1,LNGLAT:1,METER_OFFSETS:2,LNGLAT_OFFSETS:3,CARTESIAN:0};Object.defineProperty(qn,"IDENTITY",{get:()=>jn.deprecated("COORDINATE_SYSTEM.IDENTITY","COORDINATE_SYSTEM.CARTESIAN")()||0});const Yc={WEB_MERCATOR:1,GLOBE:2,WEB_MERCATOR_AUTO_OFFSET:4,IDENTITY:0},IU={click:{handler:"onClick"},panstart:{handler:"onDragStart"},panmove:{handler:"onDrag"},panend:{handler:"onDragEnd"}},vt=new tI({id:"luma.gl"});function Oo(n,e){if(!n)throw new Error(e||"luma.gl: assertion failed.")}function mS(n){return"undefined"!=typeof WebGLRenderingContext&&n instanceof WebGLRenderingContext||"undefined"!=typeof WebGL2RenderingContext&&n instanceof WebGL2RenderingContext||Boolean(n&&Number.isFinite(n._version))}function In(n){return"undefined"!=typeof WebGL2RenderingContext&&n instanceof WebGL2RenderingContext||Boolean(n&&2===n._version)}function _S(n){return Oo(mS(n),"Invalid WebGLRenderingContext"),n}function eo(n){return Oo(In(n),"Requires WebGL2"),n}const Kv={};const Zv=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{globalThis.console&&globalThis.console.log&&globalThis.console.log("OESVertexArrayObject emulation library context restored"),t.reset_()},!0),this.reset_()};Qf.prototype.VERTEX_ARRAY_BINDING_OES=34229,Qf.prototype.reset_=function(){if(void 0!==this.vertexArrayObjects)for(let i=0;iIn(n)?void 0:0,Ale={3074:n=>In(n)?void 0:36064,35723:n=>In(n)?void 0:4352,35977:Bi,32937:Bi,36795:(n,e)=>{const t=In(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(kU);return e(t&&t.UNMASKED_VENDOR_WEBGL||7936)},37446:(n,e)=>{const t=n.getExtension(kU);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:Bi,35071:Bi,37447:Bi,36063:(n,e)=>{if(!In(n)){const t=n.getExtension(RU);return t?e(t.MAX_COLOR_ATTACHMENTS_WEBGL):0}},35379:Bi,35374:Bi,35377:Bi,34852:n=>{if(!In(n)){const e=n.getExtension(RU);return e?e.MAX_DRAW_BUFFERS_WEBGL:0}},36203:n=>n.getExtension(PU)?2147483647:65535,33001:n=>n.getExtension(PU)?16777216:65535,33e3:n=>16777216,37157:Bi,35373:Bi,35657:Bi,36183:Bi,37137:Bi,34045:Bi,35978:Bi,35979:Bi,35968:Bi,35376:Bi,35375:Bi,35659:Bi,37154:Bi,35371:Bi,35658:Bi,35076:Bi,35077:Bi,35380:Bi},FU="ANGLE_instanced_arrays",NU={OES_vertex_array_object:{meta:{suffix:"OES"},createVertexArray:()=>{Oo(!1,"VertexArray requires WebGL2 or OES_vertex_array_object extension")},deleteVertexArray:()=>{},bindVertexArray:()=>{},isVertexArray:()=>!1},[FU]:{meta:{suffix:"ANGLE"},vertexAttribDivisor(n,e){Oo(0===e,"WebGL instanced rendering not supported")},drawElementsInstanced:()=>{},drawArraysInstanced:()=>{}},WEBGL_draw_buffers:{meta:{suffix:"WEBGL"},drawBuffers:()=>{Oo(!1)}},EXT_disjoint_timer_query:{meta:{suffix:"EXT"},createQuery:()=>{Oo(!1)},deleteQuery:()=>{Oo(!1)},beginQuery:()=>{Oo(!1)},endQuery:()=>{},getQuery(n,e){return this.getQueryObject(n,e)},getQueryParameter(n,e){return this.getQueryObject(n,e)},getQueryObject:()=>{}}},nI={readBuffer:(n,e,t)=>{In(n)&&e(t)},getVertexAttrib:(n,e,t,i)=>{const{webgl2:r,ext:s}=function(n,e){return{webgl2:In(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(!In(n))switch(i){case 35967:return 35981;case 35971:case 35382:return 0}return e(t,i)},getInternalformatParameter:(n,e,t,i,r)=>{if(!In(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=Ale[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 zle(n,{extension:e,target:t,target2:i}){const r=NU[e];Oo(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)}}globalThis.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 Qf(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&&zle(n,{extension:t,target:n.luma,target2:n})}(n,NU),function(n,{target:e,target2:t}){Object.keys(nI).forEach(i=>{if("function"==typeof nI[i]){const r=n[i]?n[i].bind(n):()=>{},s=nI[i].bind(null,n,r);e[i]=s,t[i]=s}})}(n,{target:e,target2:n}),e.polyfilled=!0),n};const iI={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},uh=(n,e,t)=>e?n.enable(t):n.disable(t),LU=(n,e,t)=>n.hint(t,e),Aa=(n,e,t)=>n.pixelStorei(t,e);function Qv(n){return Array.isArray(n)||ArrayBuffer.isView(n)}const Hle={3042:uh,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:uh,2885:(n,e)=>n.cullFace(e),2929:uh,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:uh,35723:LU,36006:(n,e)=>{const t=In(n)?36009:36160;return n.bindFramebuffer(t,e)},2886:(n,e)=>n.frontFace(e),33170:LU,2849:(n,e)=>n.lineWidth(e),32823:uh,32824:"polygonOffset",10752:"polygonOffset",35977:uh,32938:"sampleCoverage",32939:"sampleCoverage",3089:uh,3088:(n,e)=>n.scissor(...e),2960:uh,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:Aa,3317:Aa,37440:Aa,37441:Aa,37443:Aa,3330:Aa,3332:Aa,3331:Aa,36010:(n,e)=>n.bindFramebuffer(36008,e),3314:Aa,32878:Aa,3316:Aa,3315:Aa,32877:Aa,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=Qv(e)?e:[e,e],n.blendEquationSeparate(...e)},blendFunc:(n,e)=>{e=Qv(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=Qv(e)?e:[e,e];const[t,i]=e;n.stencilMaskSeparate(1028,t),n.stencilMaskSeparate(1029,i)},stencilFunc:(n,e)=>{e=Qv(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=Qv(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 Er(n,e,t){return void 0!==e[n]?e[n]:t[n]}const $le={blendEquation:(n,e,t)=>n.blendEquationSeparate(Er(32777,e,t),Er(34877,e,t)),blendFunc:(n,e,t)=>n.blendFuncSeparate(Er(32969,e,t),Er(32968,e,t),Er(32971,e,t),Er(32970,e,t)),polygonOffset:(n,e,t)=>n.polygonOffset(Er(32824,e,t),Er(10752,e,t)),sampleCoverage:(n,e,t)=>n.sampleCoverage(Er(32938,e,t),Er(32939,e,t)),stencilFuncFront:(n,e,t)=>n.stencilFuncSeparate(1028,Er(2962,e,t),Er(2967,e,t),Er(2963,e,t)),stencilFuncBack:(n,e,t)=>n.stencilFuncSeparate(1029,Er(34816,e,t),Er(36003,e,t),Er(36004,e,t)),stencilOpFront:(n,e,t)=>n.stencilOpSeparate(1028,Er(2964,e,t),Er(2965,e,t),Er(2966,e,t)),stencilOpBack:(n,e,t)=>n.stencilOpSeparate(1029,Er(34817,e,t),Er(34818,e,t),Er(34819,e,t))},BU={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]})},Xc=(n,e)=>n.isEnabled(e),VU={3042:Xc,2884:Xc,2929:Xc,3024:Xc,32823:Xc,32926:Xc,32928:Xc,3089:Xc,2960:Xc,35977:Xc};function zU(n){for(const e in n)return!1;return!0}function Gle(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||iI)){const r=e,s=VU[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=VU[r];i[r]=s?s(n,Number(r)):n.getParameter(Number(r))}return i}(e):Object.assign({},iI),this.log=i,this._updateCache=this._updateCache.bind(this),Object.seal(this)}push(e={}){this.stateStack.push({})}pop(){Oo(this.stateStack.length>0),Xu(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){Oo(void 0!==s);const o=e[s],a=this.cache[s];Gle(o,a)||(t=!0,i=a,r&&!(s in r)&&(r[s]=a),this.cache[s]=o)}return{valueChanged:t,oldValue:i}}}function UU(n,e={}){const{enable:t=!0,copyState:i}=e;if(Oo(void 0!==i),!n.state){const{polyfillContext:r}=globalThis;r&&r(n),n.state=new Yle(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 s in BU)Wle(n,s,BU[s]);jU(n,"getParameter"),jU(n,"isEnabled")}return n.state.enable=t,n}function HU(n){Oo(n.state),n.state.pop()}function Xu(n,e){if(Oo(mS(n),"setParameters requires a WebGL context"),zU(e))return;const t={};for(const r in e){const s=Number(r),o=Hle[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)$le[r](n,e,i)}function rc(n,e,t){if(zU(e))return t(n);const{nocatch:i=!0}=e;let r;if(function(n){n.state||UU(n,{copyState:!1}),n.state.push()}(n),Xu(n,e),i)r=t(n),HU(n);else try{r=t(n)}finally{HU(n)}return r}function yS(){return!("object"==typeof process&&"[object process]"===String(process)&&!process.browser)||function(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;return!!(e&&e.indexOf("Electron")>=0)}()}function mm(n){const{luma:e}=n;if(n.canvas&&e){const{clientWidth:t}=e.canvasSizeInfo;return t?n.drawingBufferWidth/t:1}return 1}function rI(n,e,t=!0){return function(n,e,t,i,r){const s=$U(n[0],e,t);let o=GU(n[1],e,i,r),a=$U(n[0]+1,e,t);const l=a===t-1?a:a-1;let c;return a=GU(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,mm(n),n.drawingBufferWidth,n.drawingBufferHeight,t)}function $U(n,e,t){return Math.min(Math.round(n*e),t-1)}function GU(n,e,t,i){return i?Math.max(0,t-1-Math.round(n*e)):Math.min(Math.round(n*e),t-1)}const sI=yS(),tce=sI&&"undefined"!=typeof document,WU={webgl2:!0,webgl1:!0,throwOnError:!0,manageState:!0,canvas:null,debug:!1,width:800,height:600};function qU(n={}){Oo(sI,"createGLContext only available in the browser.\nCreate your own headless context or use 'createHeadlessContext' from @luma.gl/test-utils"),n=Object.assign({},WU,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?(tce&&"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=oI(r,n),function(n){const e=In(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);vt.info(1,`${e}${n.debug?" debug":""} context ${t?`(${t.vendor},${t.renderer})`:""}`)()}(r),r):null}function oI(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({},WU,e);const{manageState:t,debug:i}=e;return t&&UU(n,{copyState:!1,log:(...r)=>vt.log(1,...r)()}),sI&&i&&(globalThis.makeDebugContext?(n=globalThis.makeDebugContext(n,e),vt.level=Math.max(vt.level,1)):vt.warn('WebGL debug mode not activated. import "@luma.gl/debug" to enable.')()),n._instrumented=!0,n}function YU(){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 XU{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=YU(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(YU()-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 aI{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 XU?e:new XU(t,i)),this.stats[t]}}const Jv="8.5.12",Jf=new class{constructor(){this.stats=new Map}get(e){return this.stats.has(e)||this.stats.set(e,new aI({id:e})),this.stats.get(e)}};if(globalThis.luma&&globalThis.luma.VERSION!==Jv)throw new Error(`luma.gl - multiple VERSIONs detected: ${globalThis.luma.VERSION} vs ${Jv}`);function nt(n,e){if(!n)throw new Error(e||"luma.gl: assertion failed.")}function lI(n,e){if("string"!=typeof e)return e;const t=Number(e);if(!isNaN(t))return t;const i=n[e=e.replace(/^.*\./,"")];return nt(void 0!==i,`Accessing undefined constant GL.${e}`),i}function dh(n,e){e=Number(e);for(const t in n)if(n[t]===e)return`GL.${t}`;return String(e)}globalThis.luma||(yS()&&vt.log(1,`luma.gl ${Jv} - set luma.log.level=1 (or higher) to trace rendering`)(),globalThis.luma=globalThis.luma||{VERSION:Jv,version:Jv,log:vt,stats:Jf,globals:{modules:{},nodeIO:{}}}),globalThis;const cI={};function ea(n="id"){return cI[n]=cI[n]||1,`${n}-${cI[n]++}`}function KU(n){return nt("number"==typeof n,"Input must be a number"),n&&0==(n&n-1)}function _m(n){let e=!0;for(const t in n){e=!1;break}return e}function ZU(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 vt.removed(`Calling removed method ${e}.${o}: `,r)(),new Error(o)})})}const ym="Resource subclass must define virtual methods";class Ku{get[Symbol.toStringTag](){return"Resource"}constructor(e,t={}){_S(e);const{id:i,userData:r={}}=t;this.gl=e,this.gl2=e,this.id=i||ea(this[Symbol.toStringTag]),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[Symbol.toStringTag]||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={}){nt(e=lI(this.gl,e));const r=(this.constructor.PARAMETERS||{})[e];if(r){const s=In(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=In(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?dh(this.gl,l):l;o[f]=this.getParameter(l,e),i&&"GLenum"===c.type&&(o[f]=dh(this.gl,o[f]))}}return o}setParameter(e,t){nt(e=lI(this.gl,e));const r=(this.constructor.PARAMETERS||{})[e];if(r){const s=In(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=lI(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 ZU(this,e,t,i)}initialize(e){}_createHandle(){throw new Error(ym)}_deleteHandle(){throw new Error(ym)}_bindHandle(e){throw new Error(ym)}_getOptsFromHandle(){throw new Error(ym)}_getParameter(e,t){throw new Error(ym)}_setParameter(e,t){throw new Error(ym)}_context(){return this.gl.luma=this.gl.luma||{},this.gl.luma}_addStats(){const e=this[Symbol.toStringTag],t=Jf.get("Resource Counts");t.get("Resources Created").incrementCount(),t.get(`${e}s Created`).incrementCount(),t.get(`${e}s Active`).incrementCount()}_removeStats(){const e=this[Symbol.toStringTag];Jf.get("Resource Counts").get(`${e}s Active`).decrementCount()}_trackAllocatedMemory(e,t=this[Symbol.toStringTag]){const i=Jf.get("Memory Usage");i.get("GPU Memory").addCount(e),i.get(`${t} Memory`).addCount(e),this.byteLength=e}_trackDeallocatedMemory(e=this[Symbol.toStringTag]){const t=Jf.get("Memory Usage");t.get("GPU Memory").subtractCount(this.byteLength),t.get(`${e} Memory`).subtractCount(this.byteLength),this.byteLength=0}}function uI(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 eb(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 fce({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 ta.getBytesPerElement(this)}get BYTES_PER_VERTEX(){return ta.getBytesPerVertex(this)}_assign(e={}){return void 0!==(e=dI("Accessor",e,gce)).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 JU={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"},mce={removedProps:{},replacedProps:{bytes:"byteLength"},deprecatedProps:JU},_ce={removedProps:JU};class Ai extends Ku{get[Symbol.toStringTag](){return"Buffer"}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/ta.getBytesPerElement(e))}getVertexCount(e=this.accessor){return Math.round(this.byteLength/ta.getBytesPerVertex(e))}initialize(e={}){return ArrayBuffer.isView(e)&&(e={data:e}),Number.isFinite(e)&&(e={byteLength:e}),e=dI("Buffer",e,mce),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=dI("Buffer",e,_ce))&&this.setAccessor(e.accessor),this}setAccessor(e){return delete(e=Object.assign({},e)).buffer,this.accessor=new ta(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;nt(t);const o=this.gl.webgl2?36663:this.target;return this.gl.bindBuffer(o,this.handle),0!==r||void 0!==s?(eo(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 eo(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}={}){eo(this.gl);const s=eb(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 nt((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):(nt(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){nt(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=uI(e);return nt(s),this.setAccessor(new ta(this.accessor,{type:s})),this}_setByteLength(e,t=this.usage){nt(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/eb(this.accessor.type||5126,{clamped:!1}).BYTES_PER_ELEMENT;return this.getElementCount()-i}_inferType(e){this.accessor.type||this.setAccessor(new ta(this.accessor,{type:uI(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 vt.deprecated("Buffer.type","Buffer.accessor.type")(),this.accessor.type}get bytes(){return vt.deprecated("Buffer.bytes","Buffer.byteLength")(),this.byteLength}setByteLength(e){return vt.deprecated("setByteLength","reallocate")(),this.reallocate(e)}updateAccessor(e){return vt.deprecated("updateAccessor(...)","setAccessor(new Accessor(buffer.accessor, ...)")(),this.accessor=new ta(this.accessor,e),this}}const hI={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}},e4={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},t4={5126:4,5125:4,5124:4,5123:2,5122:2,5131:2,5120:1,5121:1},bce=[9729,9728],n4=globalThis.WebGLBuffer||function(){};class ep extends Ku{get[Symbol.toStringTag](){return"Texture"}static isSupported(e,t={}){const{format:i,linearFiltering:r}=t;let s=!0;return i&&(s=s&&function(n,e){const t=hI[e];if(!t)return!1;if(void 0===t.gl1&&void 0===t.gl2)return!0;const i=In(n)&&t.gl2||t.gl1;return"string"==typeof i?n.getExtension(i):i}(e,i),s=s&&(!r||function(n,e){const t=hI[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=ea("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(w=>this.initialize(Object.assign({},e,{pixels:w,data:w}))),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:y=!1,mipmaps:v=!0}=e;const{depth:C=0}=e;return({width:f,height:p,compressed:y,dataFormat:g,type:_}=this._deduceParameters({format:s,type:_,dataFormat:g,compressed:y,data:t,width:f,height:p})),this.width=f,this.height=p,this.depth=C,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)),v&&this._isNPOT()&&(vt.warn(`texture: ${this} is Non-Power-Of-Two, disabling mipmaping`)(),v=!1,this._updateForNPOT(l)),this.mipmaps=v,this.setImageData({data:t,width:f,height:p,depth:C,format:s,type:_,dataFormat:g,border:o,mipmaps:v,parameters:c,compressed:y}),v&&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:y}=this;y.bindTexture(this.target,this.handle);let v=null;({data:c,dataType:v}=this._getDataType({data:c,compressed:_}));let C,w=0;return rc(this.gl,l,()=>{switch(v){case"null":y.texImage2D(t,r,s,f,p,o,g,d,c);break;case"typed-array":y.texImage2D(t,r,s,f,p,o,g,d,c,a);break;case"buffer":C=eo(y),C.bindBuffer(35052,c.handle||c),C.texImage2D(t,r,s,f,p,o,g,d,a),C.bindBuffer(35052,null);break;case"browser-object":In(y)?y.texImage2D(t,r,s,f,p,o,g,d,c):y.texImage2D(t,r,s,g,d,c);break;case"compressed":for(const[x,N]of c.entries())y.compressedTexImage2D(t,x,N.format,N.width,N.height,o,N.data),w+=N.levelSize;break;default:nt(!1,"Unknown image data type")}}),this._trackAllocatedMemory("compressed"===v?w:c&&c.byteLength?c.byteLength:this.width*this.height*(e4[this.dataFormat]||4)*(t4[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:y={}}){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})),nt(0===this.depth,"texSubImage not supported for 3D textures"),i||(i=t),i&&i.data){const v=i;i=v.data,o=v.shape[0],a=v.shape[1]}i instanceof Ai&&(i=i.handle),this.gl.bindTexture(this.target,this.handle),rc(this.gl,y,()=>{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 n4){const v=eo(this.gl);v.bindBuffer(35052,i),v.texSubImage2D(e,l,r,s,o,a,f,d,g),v.bindBuffer(35052,null)}else In(this.gl)?eo(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 vt.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 Ai?{data:e.handle,dataType:"buffer"}:e instanceof n4?{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=hI[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},nt(r,"Could not deduced texture size"),nt(void 0===t||r.width===t,"Deduced texture width does not match supplied width"),nt(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:nt(!1);break;default:this.gl.texParameteri(this.target,e,t)}return this.gl.bindTexture(this.target,null),this}_isNPOT(){return!(In(this.gl)||!this.width||!this.height||KU(this.width)&&KU(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===bce.indexOf(t)&&(t=9729);break;case 10242:case 10243:33071!==t&&(t=33071)}return t}}function Cce(n,e){return nt("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 na extends ep{get[Symbol.toStringTag](){return"Texture2D"}static isSupported(e,t){return ep.isSupported(e,t)}constructor(e,t={}){_S(e),(t instanceof Promise||"string"==typeof t)&&(t={data:t}),"string"==typeof t.data&&(t=Object.assign({},t,{data:Cce(t.data)})),super(e,Object.assign({},t,{target:3553})),this.initialize(t),Object.seal(this)}}const tp="EXT_color_buffer_float",i4={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:tp,bpp:2},33327:{gl2:tp,bpp:4},34842:{gl2:tp,bpp:8},33326:{gl2:tp,bpp:4},33328:{gl2:tp,bpp:8},34836:{gl2:tp,bpp:16},35898:{gl2:tp,bpp:4}};class vm extends Ku{get[Symbol.toStringTag](){return"Renderbuffer"}static isSupported(e,{format:t}={format:null}){return!t||function(n,e,t){const i=t[e];if(!i)return!1;const r=In(n)&&i.gl2||i.gl1;return"string"==typeof r?n.getExtension(r):r}(e,t,i4)}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 nt(e,"Needs format"),this._trackDeallocatedMemory(),this.gl.bindRenderbuffer(36161,this.handle),0!==r&&In(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)*i4[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 l4="clear: bad arguments";function pI(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)),nt(0!==o,l4),rc(n,s,()=>{n.clear(o)})}function c4(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 yn(n){return function(){var e=this,t=arguments;return new Promise(function(i,r){var s=n.apply(e,t);function o(l){c4(s,i,r,o,a,"next",l)}function a(l){c4(s,i,r,o,a,"throw",l)}o(void 0)})}}const gI=[34069,34070,34071,34072,34073,34074];let Ace=(()=>{class n extends ep{get[Symbol.toStringTag](){return"TextureCube"}constructor(t,i={}){_S(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 yn(function*(){const{gl:d}=c,f=r||s,p=yield Promise.all(gI.map(g=>{const _=f[g];return Promise.all(Array.isArray(_)?_:[_])}));c.bind(),gI.forEach((g,_)=>{p[_].length>1&&!1!==c.opts.mipmaps&&vt.warn(`${c.id} has mipmap and multiple LODs.`)(),p[_].forEach((y,v)=>{t&&i?d.texImage2D(g,v,a,t,i,o,a,l,y):d.texImage2D(g,v,a,a,l,y)})}),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=gI,n})();class Dce extends ep{get[Symbol.toStringTag](){return"Texture3D"}static isSupported(e){return In(e)}constructor(e,t={}){eo(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),rc(this.gl,f,()=>{ArrayBuffer.isView(d)&&this.gl.texImage3D(this.target,e,t,i,r,s,o,a,l,d),d instanceof Ai&&(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*(e4[this.dataFormat]||4)*(t4[this.type]||1),"Texture"),this.loaded=!0,this}}function u4(n,e){nt(n instanceof na||n instanceof Ace||n instanceof Dce);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},e))}function Oce(n,e){const{gl:t,width:i,height:r,id:s}=n;return new ss(t,Object.assign({},e,{id:`framebuffer-for-${s}`,width:i,height:r,attachments:{36064:n}}))}function vS(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}=tb(n);nt(d);const{gl:p,handle:g,attachments:_}=d;a=a||d.width,l=l||d.height,36064===s&&null===g&&(s=1028),nt(_[s]),c=c||_[s].type,o=function(n,e,t,i,r){if(n)return n;return new(eb(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 nt(!1),0}}(t))}(o,c,r,a,l),c=c||uI(o);const y=p.bindFramebuffer(36160,g);return p.readPixels(t,i,a,l,r,c,o),p.bindFramebuffer(36160,y||null),f&&d.delete(),o}function mI(n,{sourceAttachment:e=36064,targetMaxHeight:t=Number.MAX_SAFE_INTEGER}={}){let i=vS(n,{sourceAttachment:e}),{width:r,height:s}=n;for(;s>t;)({data:i,width:r,height:s}=fce({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 nt(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&&vt.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){nt(void 0!==o,"Misspelled framebuffer binding point?");const a=Number(o),l=r[a];let c=l;if(c)if(c instanceof vm)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(ss.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)&&pI(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]}={}){eo(n),rc(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:nt(!1,l4)}})}(this.gl,{drawBuffer:l,value:a})}),this.gl.bindFramebuffer(36160,o||null),this}readPixels(e={}){return vt.error("Framebuffer.readPixels() is no logner supported, use readPixelsToArray(framebuffer)")(),null}readPixelsToBuffer(e={}){return vt.error("Framebuffer.readPixelsToBuffer()is no logner supported, use readPixelsToBuffer(framebuffer)")(),null}copyToDataUrl(e={}){return vt.error("Framebuffer.copyToDataUrl() is no logner supported, use copyToDataUrl(framebuffer)")(),null}copyToImage(e={}){return vt.error("Framebuffer.copyToImage() is no logner supported, use copyToImage(framebuffer)")(),null}copyToTexture(e={}){return vt.error("Framebuffer.copyToTexture({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null}blit(e={}){return vt.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=eo(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=dh(this.gl,r)),r}getAttachmentParameters(e=36064,t,i=this.constructor.ATTACHMENT_PARAMETERS||[]){const r={};for(const s of i)r[t?dh(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?dh(this.gl,s):s]=this.getAttachmentParameters(s,e)}return i}show(){return"undefined"!=typeof window&&window.open(mI(this),"luma-debug-texture"),this}log(e=0,t=""){if(e>vt.level||"undefined"==typeof window)return this;t=t||`Framebuffer ${this.id}`;const i=mI(this,{targetMaxHeight:100});return vt.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 na(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 vm(this.gl,{id:`${this.id}-depth-stencil`,format:35056,width:r,height:111}),this.ownResources.push(o[33306])):t?(o=o||{},o[36096]=new vm(this.gl,{id:`${this.id}-depth`,format:33189,width:r,height:s}),this.ownResources.push(o[36096])):i&&nt(!1),o}_unattach(e){const t=this.attachments[e];!t||(t instanceof vm?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:eo(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:nt(!1,"Illegal texture type")}s.bindTexture(t.target,null),this.attachments[e]=t}_setReadBuffer(e){const t=function(n){return In(n)?n:null}(this.gl);t?t.readBuffer(e):nt(36064===e||1029===e,d4),this.readBuffer=e}_setDrawBuffers(e){const{gl:t}=this,i=eo(t);if(i)i.drawBuffers(e);else{const r=t.getExtension("WEBGL_draw_buffers");r?r.drawBuffersWEBGL(e):nt(1===e.length&&(36064===e[0]||1029===e[0]),d4)}this.drawBuffers=e}_getAttachmentParameterFallback(e){const t=function(n){n.luma=n.luma||{},n.luma.caps=n.luma.caps||{};for(const e in h4)void 0===n.luma.caps[e]&&(n.luma.caps[e]=p4(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)}}ss.ATTACHMENT_PARAMETERS=[36049,36048,33296,33298,33299,33300,33301,33302,33303];const h4={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 na(n,{format:6408,type:5126,dataFormat:6408}),t=new ss(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 _I(n,e){return f4(n,e)}function f4(n,e){return(e=Array.isArray(e)?e:[e]).every(t=>p4(n,t))}function p4(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=h4[e];let i;nt(t,e);const r=In(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:nt(!1);return i}(n,e)),n.luma.caps[e]||vt.log(2,`Feature: ${e} not supported`)(),n.luma.caps[e]}class yI{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()}},Hce=(Math,1/180*Math.PI),Ji={};function Gce(n,{precision:e=Ji.precision||4}={}){return n=function(n){return Math.round(n/Ji.EPSILON)*Ji.EPSILON}(n),`${parseFloat(n.toPrecision(e))}`}function hh(n){return Array.isArray(n)||ArrayBuffer.isView(n)&&!(n instanceof DataView)}function Zu(n,e,t){if(hh(n)){t=t||function(n){return n.clone?n.clone():new Array(n.length)}(n);for(let i=0;it*Hce,void 0)}(n)}function np(n,e,t){return Zu(n,i=>Math.max(e,Math.min(t,i)))}function bS(n,e,t){return hh(n)?n.map((i,r)=>bS(i,e[r],t)):t*e+(1-t)*n}function rb(n,e,t){const i=Ji.EPSILON;t&&(Ji.EPSILON=t);try{if(n===e)return!0;if(hh(n)&&hh(e)){if(n.length!==e.length)return!1;for(let r=0;r0?", ":"")+Gce(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&&(M4.length=n.length,i=M4):i=S4,(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 x4(n){return n&&n[Symbol.asyncIterator]}function EI(n,e=(()=>!0)){return Array.isArray(n)?T4(n,e,[]):e(n)?[n]:[]}function T4(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 A4(n,e){return n?(Number.isFinite(n)&&(n={duration:n}),n.type=n.type||"interpolation",K(K(K({},Mue[n.type]),e),n)):null}function D4(n,e){return e.getBuffer()?[e.getBuffer(),{divisor:0,size:e.size,normalized:e.settings.normalized}]:e.value}function O4(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 I4(n){n.push(n.shift())}function MI(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 P4({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=MI(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 C=s;s=(w,x)=>t._normalizeConstant(C(w,x))}const _=p?(C,w)=>s(g,w):(C,w)=>s(g.subarray(C,C+a),w),y=n.getData({length:i}),v=new Float32Array(f);(function({source:n,target:e,size:t,getData:i,sourceStartIndices:r,targetStartIndices:s}){if(!Array.isArray(s))return SI({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===MS||(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=MS}clearNeedsUpdate(){this.state.needsUpdate=!1,this.state.updateRanges=wue}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!==MS}),!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 v=f*a+l;for(let C=0;Cd?c.set(x,y):(e._normalizeValue(x,C.target,0),Cue({target:c,source:C.target,start:y,count:N}));y+=N*d}else e._normalizeValue(x,c,y),y+=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 TI={};function no(n){jn.level>0&&TI[n]&&TI[n].call(...arguments)}function Da(n,e){if(!n)throw new Error(e||"shadertools: assertion failed.")}const R4="out vec4 transform_output;\nvoid main() {\n transform_output = vec4(0);\n}",Aue=`#version 300 es\n${R4}`;function k4(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 F4(n={}){const{version:e=100,input:t,inputType:i,output:r}=n;if(!t)return 300===e?Aue:e>300?`#version ${e}\n${R4}`:"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 Da(!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 N4 extends Ku{get[Symbol.toStringTag](){return"TransformFeedback"}static isSupported(e){return In(e)}constructor(e,t={}){eo(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,_m(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,vt.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 Ai?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 Pue{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 Ai?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&&nt(In(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 N4(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],nt(i[s]instanceof Ai)}return{sourceBuffers:t,feedbackBuffers:i}}_createNewBuffer(e,t){const i=new Ai(this.gl,t);return this.resources[e]&&this.resources[e].delete(),this.resources[e]=i,i}_getNextIndex(){return(this.currentIndex+1)%2}}function L4(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 ab="vs",Fue={[ab]:"#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"},xS="__LUMA_INJECT_DECLARATIONS__",B4=/void\s+main\s*\([^)]*\)\s*\{\n?/,V4=/}\n?[^{}]*$/,DI=[];function z4(n,e,t,i=!1){const r=e===ab;for(const s in t){const o=t[s];o.sort((l,c)=>l.order-c.order),DI.length=o.length;for(let l=0,c=o.length;ll+a));break;case"vs:#main-end":r&&(n=n.replace(V4,l=>a+l));break;case"fs:#decl":r||(n=n.replace(xS,a));break;case"fs:#main-start":r||(n=n.replace(B4,l=>l+a));break;case"fs:#main-end":r||(n=n.replace(V4,l=>a+l));break;default:n=n.replace(s,l=>l+a)}}return n=n.replace(xS,""),i&&(n=n.replace(/\}\s*$/,s=>s+Fue[e])),n}function OI(n){const e={};return Da(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 Nue={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},TS="transform_uSize_",j4="transform_position";const $ue={10241:9728,10240:9728,10242:33071,10243:33071};class Wue{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[`${TS}${e}`]=[r,s]);for(const o in n)({width:r,height:s}=n[o]),i[`${TS}${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=vS(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 Da(!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 Ai(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 ss(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($ue)}_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=u4(e,{parameters:{10241:9728,10240:9728,10242:33071,10243:33071},pixelStore:{37440:!1}});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 y=function(n,e){const t={},i=function(n){return k4(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=`${TS}${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 Da(!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(y){const{updatedLine:v,inject:C}=y;f[g]=v,c=OI([c,C]),Object.assign(a,y.samplerTextureMap),s--}}t&&!o&&(o=function(n,e){const t=k4(n,["varying","out"]);return t&&t.name===e?t.type:null}(p,t))}),t){nt(i);const p=`${TS}${t}`;c=OI([c,{"vs:#decl":`uniform vec2 ${p};\n`,"vs:#main-start":` vec2 ${j4} = transform_getPos(${p});\n gl_Position = vec4(${j4}, 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=OI([e.inject||{},a]);return this.targetTextureType=o,this.samplerTextureMap=l,{vs:r,fs:e._fs||F4({version:L4(r),input:this.targetTextureVarying,inputType:o,output:"transform_output"}),modules:this.hasSourceTextures||this.targetTextureVarying?[Nue].concat(e.modules||[]):e.modules,uniforms:s,inject:c}}}const II={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 Yue(n){let e=U4(n);return"object"===e?n?"type"in n?Object.assign({},n,II[n.type]):"value"in n?(e=U4(n.value),Object.assign({type:e},n,II[e])):{type:"object",value:n}:{type:"object",value:null}:Object.assign({type:e,value:n},II[e])}function U4(n){return Array.isArray(n)||ArrayBuffer.isView(n)?"array":typeof n}class PI{constructor({name:e,vs:t,fs:i,dependencies:r=[],uniforms:s,getUniforms:o,deprecations:a=[],defines:l={},inject:c={},vertexShader:d,fragmentShader:f}){Da("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=Yue(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:Da(!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&&Da(s.validate(e[r],s),`${this.name}: invalid ${r}`),t[r]=e[r]):t[r]=s.value}return t}}function Que(n){return function(n){const e={},t={};return RI({modules:n,level:0,moduleMap:e,moduleDepth:t}),Object.keys(t).sort((i,r)=>t[r]-t[i]).map(i=>e[i])}($4(n))}function RI({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 PI||(Da("string"!=typeof t,`Shader module use by name is deprecated. Import shader module '${t}' and use it directly.`),Da(t.name,"shader module has no name"),(t=new PI(t)).dependencies=$4(t.dependencies)),t))}const kI={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]},ip={};function ode(n,e){return n.match(/NVIDIA/i)||e.match(/NVIDIA/i)?"NVIDIA":n.match(/INTEL/i)||e.match(/INTEL/i)?"INTEL":n.match(/AMD/i)||e.match(/AMD/i)||n.match(/ATI/i)||e.match(/ATI/i)?"AMD":"UNKNOWN GPU"}Object.keys(kI).forEach(n=>{ip[n]=n});const FI={};function G4(n,e,t={}){const i=kI[e];if(Da(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 FI)return FI[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),FI[e]=l,l}function AS(n,e){return(e=Array.isArray(e)?e:[e]).every(t=>function(n,e){const t=kI[e];Da(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 Da(!1===r||!0===r),r}(n,t))}function Cm(n){return new RegExp(`\\b${n}[ \\t]+(\\w+[ \\t]+\\w+(\\[\\w+\\])?;)`,"g")}const W4=[[/^(#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("]],ude=[...W4,[Cm("attribute"),"in $1"],[Cm("varying"),"out $1"]],dde=[...W4,[Cm("varying"),"in $1"]],q4=[[/^#version[ \t]+300[ \t]+es/,"#version 100"],[/\btexture(2D|2DProj|Cube)Lod\(/g,"texture$1LodEXT("],[/\btexture\(/g,"texture2D("],[/\btextureLod\(/g,"texture2DLodEXT("]],hde=[...q4,[Cm("in"),"attribute $1"],[Cm("out"),"varying $1"]],fde=[...q4,[Cm("in"),"varying $1"]],NI="gl_FragColor",LI=/\bout[ \t]+vec4[ \t]+(\w+)[ \t]*;\n?/,pde=/void\s+main\s*\([^)]*\)\s*\{\n?/;function DS(n,e){for(const[t,i]of e)n=n.replace(t,i);return n}const yde=`\n\n${xS}\n\n`,Y4={[ab]:"vertex",fs:"fragment"};function X4(n,{id:e,source:t,type:i,modules:r,defines:s={},hookFunctions:o=[],inject:a={},transpileToGLSL100:l=!1,prologue:c=!0,log:d}){Da("string"==typeof t,"shader source must be a string");const f=i===ab,p=t.split("\n");let g=100,_="",y=t;0===p[0].indexOf("#version ")?(g=300,_=p[0],y=p.slice(1).join("\n")):_=`#version ${g}`;const v={};r.forEach(U=>{Object.assign(v,U.getDefines())}),Object.assign(v,s);let C=c?`${_}\n${function({id:n,source:e,type:t}){return n&&"string"==typeof n&&-1===e.indexOf("SHADER_NAME")?`\n#define SHADER_NAME ${n}_${Y4[t]}\n\n`:""}({id:e,source:t,type:i})}\n${function({type:n}){return`\n#define SHADER_TYPE_${Y4[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:ode(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// 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"}}(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 AS(n,ip.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"),AS(n,ip.GLSL_DERIVATIVES)&&G4(n,ip.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"),AS(n,ip.GLSL_FRAG_DATA)&&G4(n,ip.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"),AS(n,ip.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}(v)}\n${f?"":"precision highp float;\n\n"}\n`:`${_}\n`;const w=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),x={},N={},V={};for(const U in a){const ee="string"==typeof a[U]?{injection:a[U],order:0}:a[U],de=U.match(/^(v|f)s:(#)?([\w-]+)$/);if(de){const me=de[3];de[2]?"decl"===me?N[U]=[ee]:V[U]=[ee]:x[U]=[ee]}else V[U]=[ee]}for(const U of r){d&&U.checkDeprecations(y,d),C+=U.getModuleSource(i,g);const de=U.injections[i];for(const ae in de){const me=ae.match(/^(v|f)s:#([\w-]+)$/);if(me){const Be="decl"===me[2]?N:V;Be[ae]=Be[ae]||[],Be[ae].push(de[ae])}else x[ae]=x[ae]||[],x[ae].push(de[ae])}}return C+=yde,C=z4(C,i,N),C+=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}(w[i],x),C+=y,C=z4(C,i,V),C=function(n,e,t){switch(e){case 300:return t?DS(n,ude):function(n){const e=(n=DS(n,dde)).match(LI);if(e){const t=e[1];n=n.replace(new RegExp(`\\b${NI}\\b`,"g"),t)}else{const t="fragmentColor";n=n.replace(pde,i=>`out vec4 ${t};\n${i}`).replace(new RegExp(`\\b${NI}\\b`,"g"),t)}return n}(n);case 100:return t?DS(n,hde):function(n){const e=(n=DS(n,fde)).match(LI);if(e){const t=e[1];n=n.replace(LI,"").replace(new RegExp(`\\b${t}\\b`,"g"),NI)}return n}(n);default:throw new Error(`unknown GLSL version ${e}`)}}(C,l?100:g,f),C}function Cde(n){return function(t){const i={};for(const r of n){const s=r.getUniforms(t,i);Object.assign(i,s)}return i}}const Tde={5126:er.bind(null,"uniform1fv",Oa,1,io),35664:er.bind(null,"uniform2fv",Oa,2,io),35665:er.bind(null,"uniform3fv",Oa,3,io),35666:er.bind(null,"uniform4fv",Oa,4,io),5124:er.bind(null,"uniform1iv",fh,1,io),35667:er.bind(null,"uniform2iv",fh,2,io),35668:er.bind(null,"uniform3iv",fh,3,io),35669:er.bind(null,"uniform4iv",fh,4,io),35670:er.bind(null,"uniform1iv",fh,1,io),35671:er.bind(null,"uniform2iv",fh,2,io),35672:er.bind(null,"uniform3iv",fh,3,io),35673:er.bind(null,"uniform4iv",fh,4,io),35674:er.bind(null,"uniformMatrix2fv",Oa,4,Ju),35675:er.bind(null,"uniformMatrix3fv",Oa,9,Ju),35676:er.bind(null,"uniformMatrix4fv",Oa,16,Ju),35678:Fs,35680:Fs,5125:er.bind(null,"uniform1uiv",OS,1,io),36294:er.bind(null,"uniform2uiv",OS,2,io),36295:er.bind(null,"uniform3uiv",OS,3,io),36296:er.bind(null,"uniform4uiv",OS,4,io),35685:er.bind(null,"uniformMatrix2x3fv",Oa,6,Ju),35686:er.bind(null,"uniformMatrix2x4fv",Oa,8,Ju),35687:er.bind(null,"uniformMatrix3x2fv",Oa,6,Ju),35688:er.bind(null,"uniformMatrix3x4fv",Oa,12,Ju),35689:er.bind(null,"uniformMatrix4x2fv",Oa,8,Ju),35690:er.bind(null,"uniformMatrix4x3fv",Oa,12,Ju),35678:Fs,35680:Fs,35679:Fs,35682:Fs,36289:Fs,36292:Fs,36293:Fs,36298:Fs,36299:Fs,36300:Fs,36303:Fs,36306:Fs,36307:Fs,36308:Fs,36311:Fs},Ade={},Dde={},Ode={},K4=[0];function BI(n,e,t,i){1===e&&"boolean"==typeof n&&(n=n?1:0),Number.isFinite(n)&&(K4[0]=n,n=K4);const r=n.length;if(r%e&&vt.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 er(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{nt(s===d,"Uniform length cannot change.");for(let p=0;p{const a=String(o+e);return e5(a,r-a.length)+t+s})}(e);return{shaderName:l,errors:J4(s,c),warnings:J4(o,c)}}(i,this.source,this.shaderType,this.id);throw vt.error(`GLSL compilation errors in ${r}\n${s}`)(),vt.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 VI extends lb{get[Symbol.toStringTag](){return"VertexShader"}constructor(e,t){"string"==typeof t&&(t={source:t}),super(e,Object.assign({},t,{shaderType:35633}))}_createHandle(){return this.gl.createShader(35633)}}class zI extends lb{get[Symbol.toStringTag](){return"FragmentShader"}constructor(e,t){"string"==typeof t&&(t={source:t}),super(e,Object.assign({},t,{shaderType:35632}))}_createHandle(){return this.gl.createShader(35632)}}const os=5126,cb=5124,ub=5125,jI={[os]:[os,1,"float"],35664:[os,2,"vec2"],35665:[os,3,"vec3"],35666:[os,4,"vec4"],[cb]:[cb,1,"int"],35667:[cb,2,"ivec2"],35668:[cb,3,"ivec3"],35669:[cb,4,"ivec4"],[ub]:[ub,1,"uint"],36294:[ub,2,"uvec2"],36295:[ub,3,"uvec3"],36296:[ub,4,"uvec4"],35670:[os,1,"bool"],35671:[os,2,"bvec2"],35672:[os,3,"bvec3"],35673:[os,4,"bvec4"],35674:[os,8,"mat2"],35685:[os,8,"mat2x3"],35686:[os,8,"mat2x4"],35675:[os,12,"mat3"],35687:[os,12,"mat3x2"],35688:[os,12,"mat3x4"],35676:[os,16,"mat4"],35689:[os,16,"mat4x2"],35690:[os,16,"mat4x3"]};function o5(n){const e=jI[n];if(!e)return null;const[t,i]=e;return{type:t,components:i}}function a5(n,e){switch(n){case 5120:case 5121:case 5122:case 5123:n=os}for(const t in jI){const[i,r,s]=jI[t];if(i===n&&r===e)return{glType:t,name:s}}return null}class phe{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(!In(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}=o5(i),a={type:s,size:r*o};this._inferProperties(e,t,a);const l={location:e,name:t,accessor:new ta(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}=o5(i),l={location:e,name:t,accessor:new ta({type:s,size:r*o})};this.varyingInfos.push(l),this.varyingInfosByName[l.name]=l}}const ghe=35981,mhe=["setVertexArray","setAttributes","setBuffers","unsetBuffers","use","getUniformCount","getUniformInfo","getUniformLocation","getUniformValue","getVarying","getFragDataLocation","getAttachedShaders","getAttributeCount","getAttributeLocation","getAttributeInfo"];class c5 extends Ku{get[Symbol.toStringTag](){return"Program"}constructor(e,t={}){super(e,t),this.stubRemovedMethods("Program","v6.0",mhe),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=ghe}=e;return this.hash=t||"",this.vs="string"==typeof i?new VI(this.gl,{id:`${e.id}-vs`,source:i}):i,this.fs="string"==typeof r?new zI(this.gl,{id:`${e.id}-fs`,source:r}):r,nt(this.vs instanceof VI),nt(this.fs instanceof zI),this.uniforms={},this._textureUniforms={},s&&s.length>0&&(eo(this.gl),this.varyings=s,this.gl2.transformFeedbackVaryings(this.handle,s,o)),this._compileAndLink(),this._readUniformLocationsFromLinkedProgram(),this.configuration=new phe(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:y,samplers:v}){if((y||v)&&(vt.deprecated("Program.draw({uniforms})","Program.setUniforms(uniforms)")(),this.setUniforms(y||{})),vt.priority>=e){const C=g?g.id:"default",w=`mode=${dh(this.gl,t)} verts=${i} instances=${c} indexType=${dh(this.gl,l)} isInstanced=${d} isIndexed=${a} Framebuffer=${C}`;vt.log(e,w)()}return nt(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 C=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 nt(!1),0}}(t);p.begin(C)}this._bindTextures(),rc(this.gl,_,()=>{a&&d?this.gl2.drawElementsInstanced(t,i,l,r,c):a&&In(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={}){vt.priority>=2&&function(n,e,t){for(const i in n){const r=n[i];if((!t||Boolean(t[i]))&&!Rde(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 ss&&(s=s.texture),s instanceof ep)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)&&kde(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 VI({handle:r});break;case 35632:i.fs=new zI({handle:r})}return i}_getParameter(e){return this.gl.getProgramParameter(this.handle,e)}_setId(e){if(!e){const t=this._getName();this.id=ea(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),vt.time(4,`linkProgram for ${this._getName()}`)(),e.linkProgram(this.handle),vt.timeEnd(4,`linkProgram for ${this._getName()}`)(),e.debug||vt.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(x=>this._getHash(x.name)).sort(),g=o.map(x=>this._getHash(x)),_=Object.keys(r).sort(),y=Object.keys(s).sort(),v=[],C=[];for(const x of _)v.push(this._getHash(x)),v.push(this._getHash(r[x]));for(const x of y)C.push(this._getHash(x)),C.push(this._getHash(s[x]));const w=`${d}/${f}D${v.join("/")}M${p.join("/")}I${C.join("/")}V${g.join("/")}H${this.stateHash}B${a}${l?"T":""}`;if(!this._programCache[w]){const x=function(n,e){const{vs:t,fs:i}=e,r=Que(e.modules||[]);return{gl:n,vs:X4(n,Object.assign({},e,{source:t,type:ab,modules:r})),fs:X4(n,Object.assign({},e,{source:i,type:"fs",modules:r})),getUniforms:Cde(r)}}(this.gl,{vs:t,fs:i,modules:c,inject:s,defines:r,hookFunctions:this._hookFunctions,transpileToGLSL100:l});this._programCache[w]=new c5(this.gl,{hash:w,vs:x.vs,fs:x.fs,varyings:o,bufferMode:a}),this._getUniforms[w]=x.getUniforms||(N=>{}),this._useCounts[w]=0}return this._useCounts[w]++,this._programCache[w]}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":Xv.chrome?"Chrome":Xv.safari?"Safari":Xv.mozInnerScreenX?"Firefox":"Unknown"}()}static getDefaultArray(e){return e.luma=e.luma||{},e.luma.defaultVertexArray||(e.luma.defaultVertexArray=new Ia(e,{handle:null,isDefaultArray:!0})),e.luma.defaultVertexArray}static getMaxAttributes(e){return Ia.MAX_ATTRIBUTES=Ia.MAX_ATTRIBUTES||e.getParameter(34921),Ia.MAX_ATTRIBUTES}static setConstant(e,t,i){switch(i.constructor){case Float32Array:Ia._setConstantFloatArray(e,t,i);break;case Int32Array:Ia._setConstantIntArray(e,t,i);break;case Uint32Array:Ia._setConstantUintArray(e,t,i);break;default:nt(!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 Ia.getMaxAttributes(this.gl)}initialize(e={}){return this.setProps(e)}setProps(e){return this}setElementBuffer(e=null,t={}){return nt(!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?(nt(In(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&&!Ia.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 Ai(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(!RS||RS.byteLength{switch(e){case 34373:return this.gl.getVertexAttribOffset(t,e);default:return this.gl.getVertexAttrib(t,e)}})}}const Ehe=/^(.+)__LOCATION_([0-9]+)$/,She=["setBuffers","setGeneric","clearBindings","setLocations","setGenericValues","setDivisor","enable","disable"];class Mhe{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 Ia(e),ZU(this,"VertexArray","v6.0",She),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 Ai(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,vt.once(3,()=>`unused value ${e} in ${this.id}`)(),s;const l=this._getAttributeInfo(a||o);if(!l)return s;const d=ta.resolve(l.accessor,this.accessors[o]||{},i,r),{size:f,type:p}=d;return nt(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=Ehe.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 Ai)this.setBuffer(e,t);else if(Array.isArray(t)&&t.length&&t[0]instanceof Ai)this.setBuffer(e,t[0],t[1]);else if(ArrayBuffer.isView(t)||Array.isArray(t))this.setConstant(e,t);else{if(!(t.buffer instanceof Ai))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 Ai){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 vt.deprecated("setElements","setElementBuffer")(),this.setElementBuffer(e,t)}}function hb(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+=hb(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 u5(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 Ai){const p=e,{data:g,changed:_}=p.getDebugData();let y;return d=_?"*":"",f=g,l=p.byteLength,a=l/g.BYTES_PER_ELEMENT/o,t?y=`${t.divisor>0?"I ":"P "} ${a} (x${o}=${l} bytes ${dh(r,s)})`:(c=!0,y=`${l} bytes`),{[i]:`${d}${hb(f,{size:o,isInteger:c})}`,"Format ":y}}return f=e,o=e.length,s=String(e.constructor.name).replace("Array",""),c=-1!==s.indexOf("nt"),{[i]:`${hb(f,{size:o,isInteger:c})} (constant)`,"Format ":`${o}x${s} (constant)`}}function Ahe(n,e){const{type:t,size:i}=e,r=a5(t,i);return r?`${n} (${r.name})`:n}function d5({header:n="Uniforms",program:e,uniforms:t,undefinedOnly:i=!1}){nt(e);const s=".*Matrix",a={},l=Object.keys(e._uniformSetters).sort();let c=0;for(const p of l)!p.match(".*_.*")&&!p.match(s)&&UI({table:a,header:n,uniforms:t,uniformName:p,undefinedOnly:i})&&c++;for(const p of l)p.match(s)&&UI({table:a,header:n,uniforms:t,uniformName:p,undefinedOnly:i})&&c++;for(const p of l)a[p]||UI({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]:hb(g)})}return{table:a,count:c,unusedTable:f,unusedCount:d}}function UI({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?hb(s):"N/A","Uniform Type":o?s:"NOT PROVIDED"},0))}function h5(n){const{type:e,size:t}=n.accessor,i=a5(e,t);return i?`${i.name} ${n.name}`:n.name}const Ihe={POSITION:"positions",NORMAL:"normals",COLOR_0:"colors",TEXCOORD_0:"texCoords",TEXCOORD_1:"texCoords1",TEXCOORD_2:"texCoords2"};function Rhe(n,e){const{attributeMap:t=Ihe}=e||{};return t&&t[n]||n}function khe(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}nt(Number.isFinite(e.size),`attribute ${n} needs size`)}const f5=()=>{},Lhe={};class Mm{constructor(e,t={}){const{id:i=ea("model")}=t;nt(mS(e)),this.id=i,this.gl=e,this.id=t.id||ea("Model"),this.lastLogTime=0,this.animated=!1,this.initialize(t)}initialize(e){this.props={},this.programManager=e.programManager||db.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={},nt(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 nt(Number.isFinite(e)),this.vertexCount=e,this}setInstanceCount(e){return nt(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=Rhe(s,undefined);if("indices"===s)r=o;else if(o.constant)i[a]=o.value;else{const l=o.value,c=K({},o);delete c.value,i[a]=[new Ai(n,l),c],khe(s,c)}}if(r){const s=r.value||r;nt(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 Ai(n,{data:s,target:34963}),o]}return i}(this.gl,e),this.vertexArray.setAttributes(this.geometryBuffers),this}setAttributes(e={}){if(_m(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 pI(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),vt.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&&vt.warn("Found instanced attributes on non-instanced model",this.id)();const{isInstanced:y,instanceCount:v}=this,{onBeforeRender:C=f5,onAfterRender:w=f5}=this.props;C(),this.program.setUniforms(this.uniforms);const x=this.program.draw(Object.assign(Lhe,e,{logPriority:c,uniforms:null,framebuffer:i,parameters:a,drawMode:this.getDrawMode(),vertexCount:this.getVertexCount(),vertexArray:l,transformFeedback:o,isIndexed:f,indexType:p,isInstanced:y,instanceCount:v,offset:f?g:0}));return w(),vt.priority>=2&&this._logDrawCallEnd(c,l,i),x}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 vt.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}nt(t instanceof c5,"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 Mhe(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 Ai&&t.delete()}}_setAnimationProps(e){this.animated&&nt(e,"Model.draw(): animated uniforms but no animationProps")}_setFeedbackBuffers(e={}){if(_m(e))return this;const{gl:t}=this.program;return this.transformFeedback=this.transformFeedback||new N4(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:vt.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=u5(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}: ${Ahe(s.name,a)}`),t[o]=u5(n,i[r],a,e)}}return t}({vertexArray:t,header:`${this.id} attributes`,attributes:this._attributes}),{table:o,unusedTable:a,unusedCount:l}=d5({header:`${this.id} uniforms`,program:this.program,uniforms:Object.assign({},this.program.uniforms,i)}),{table:c,count:d}=d5({header:`${this.id} uniforms`,program:this.program,uniforms:Object.assign({},this.program.uniforms,i),undefinedOnly:!0});d>0&&vt.log("MISSING UNIFORMS",Object.keys(c))(),l>0&&vt.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 ${h5(i)}`]={[t]:JSON.stringify(i.accessor)});for(const i of n.varyingInfos)i&&(e[`out ${h5(i)}`]={[t]:JSON.stringify(i.accessor)});return e}(this.vertexArray.configuration);vt.table(e,s)(),vt.table(e,o)(),vt.table(e+1,f)(),r&&r.log({logLevel:2,message:`Rendered to ${r.id}`}),vt.groupEnd(2,`>>> DRAWING MODEL ${this.id}`)()}}class HI{static isSupported(e){return In(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();nt(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 Mm(t,Object.assign({},e,{fs:e.fs||F4({version:L4(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!(_m(n.feedbackBuffers)&&_m(n.feedbackMap)&&!(n.varyings&&n.varyings.length>0))})(t)&&(this.bufferTransform=new Pue(e,t)),function(n){return!(_m(n._sourceTextures)&&!n._targetTexture&&!n._targetTextureVarying)}(t)&&(this.textureTransform=new Wue(e,t)),nt(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 kS(){}const zhe={onStart:kS,onUpdate:kS,onInterrupt:kS,onEnd:kS};class fb{constructor(e){this._inProgress=!1,this._handle=null,this.timeline=e,this.settings={}}get inProgress(){return this._inProgress}start(e){this.cancel(),this.settings=K(K({},zhe),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 Yhe={interpolation:class{constructor({gl:e,attribute:t,timeline:i}){this.gl=e,this.type="interpolation",this.transition=new fb(i),this.attribute=t,this.attributeInTransition=new xI(e,t.settings),this.currentStartIndices=t.startIndices,this.currentLength=0,this.transform=function(n,e){const t=O4(e.size);return new HI(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 Ai(e,r),new Ai(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;I4(r);const o={numInstances:t,attribute:s,fromLength:this.currentLength,fromStartIndices:this.currentStartIndices,getData:e.enter};for(const a of r)P4(K({buffer:a},o));this.currentStartIndices=s.startIndices,this.currentLength=MI(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:D4(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 fb(i),this.attribute=t,this.attributeInTransition=new xI(e,Lt(K({},t.settings),{normalized:!1})),this.currentStartIndices=t.startIndices,this.currentLength=0,this.texture=function(n){return new na(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 ss(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=O4(e.size);return new HI(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 Ai(e,r),new Ai(e,r),new Ai(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)P4(K({buffer:a},o));this.currentStartIndices=s.startIndices,this.currentLength=MI(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:D4(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]}}),I4(e),this.attributeInTransition.update({buffer:e[1],value:this.attribute.value}),vS(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 Xhe{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=HI.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 jn.warn("WebGL2 not supported by this browser. Transition for ".concat(e," is disabled."))();r&&this._removeTransition(e);const o=Yhe[i.type];o?this.transitions[e]=new o({attribute:t,timeline:this.timeline,gl:this.gl}):(jn.error("unsupported transition type '".concat(i.type,"'"))(),s=!1)}(s||t.needsRedraw())&&(this.needsRedraw=!0,this.transitions[e].start(i,this.numInstances))}}const p5="attributeManager.invalidate";class tfe{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 Xhe(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;no("attribute.updateStart",t),t.allocate(i)&&no("attribute.allocate",t,i),t.updateBuffer(e)&&(this.needsRedraw=!0,no("attribute.updateEnd",t,i))}}function m5(n,e,t,i,r){const s=e-n;return(t-e)*r+-s*i+s+e}function _5(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=A4(r)))return;const o=sfe[r.type];if(!o)return void jn.error("unsupported transition type '".concat(r.type,"'"))();const a=new o(this.timeline);a.start(Lt(K({},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 FS={COMPONENT:Symbol.for("component"),ASYNC_DEFAULTS:Symbol.for("asyncPropDefaults"),ASYNC_ORIGINAL:Symbol.for("asyncPropOriginal"),ASYNC_RESOLVED:Symbol.for("asyncPropResolved")},{COMPONENT:afe}=FS;function ufe(n,e){if(!n.transitions)return null;const t={},i=GI(n);for(const r in n.transitions){const s=i[r],o=s&&s.type;("number"===o||"color"===o||"array"===o)&&$I(n[r],e[r],s)&&(t[r]=!0)}return t}function y5({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=$I(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=$I(n[s],e[s],i[s]);if(o)return"".concat(r,".").concat(s," ").concat(o)}}return null}function $I(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 ffe(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(!vfe(i[r],e[r])){t=n(i),e=i;break}return t}}function bfe(n,e){if(!e)return n;const t=K(K({},n),e);if("defines"in e&&(t.defines=K(K({},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=K({},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 WI(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],y=e[13],v=e[14],C=e[15],w=t*a-i*o,x=t*l-r*o,N=t*c-s*o,V=i*l-r*a,U=i*c-s*a,ee=r*c-s*l,de=d*y-f*_,ae=d*v-p*_,me=d*C-g*_,Ee=f*v-p*y,Be=f*C-g*y,te=p*C-g*v,ne=w*te-x*Be+N*Ee+V*me-U*ae+ee*de;return ne?(n[0]=(a*te-l*Be+c*Ee)*(ne=1/ne),n[1]=(r*Be-i*te-s*Ee)*ne,n[2]=(y*ee-v*U+C*V)*ne,n[3]=(p*U-f*ee-g*V)*ne,n[4]=(l*me-o*te-c*ae)*ne,n[5]=(t*te-r*me+s*ae)*ne,n[6]=(v*N-_*ee-C*x)*ne,n[7]=(d*ee-p*N+g*x)*ne,n[8]=(o*Be-a*me+c*de)*ne,n[9]=(i*me-t*Be-s*de)*ne,n[10]=(_*U-y*N+C*w)*ne,n[11]=(f*N-d*U-g*w)*ne,n[12]=(a*ae-o*Ee-l*de)*ne,n[13]=(t*Ee-i*ae+r*de)*ne,n[14]=(y*x-_*V-v*w)*ne,n[15]=(d*V-f*x+p*w)*ne,n):null}function rp(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],y=e[12],v=e[13],C=e[14],w=e[15],x=t[0],N=t[1],V=t[2],U=t[3];return n[0]=x*i+N*a+V*f+U*y,n[1]=x*r+N*l+V*p+U*v,n[2]=x*s+N*c+V*g+U*C,n[3]=x*o+N*d+V*_+U*w,n[4]=(x=t[4])*i+(N=t[5])*a+(V=t[6])*f+(U=t[7])*y,n[5]=x*r+N*l+V*p+U*v,n[6]=x*s+N*c+V*g+U*C,n[7]=x*o+N*d+V*_+U*w,n[8]=(x=t[8])*i+(N=t[9])*a+(V=t[10])*f+(U=t[11])*y,n[9]=x*r+N*l+V*p+U*v,n[10]=x*s+N*c+V*g+U*C,n[11]=x*o+N*d+V*_+U*w,n[12]=(x=t[12])*i+(N=t[13])*a+(V=t[14])*f+(U=t[15])*y,n[13]=x*r+N*l+V*p+U*v,n[14]=x*s+N*c+V*g+U*C,n[15]=x*o+N*d+V*_+U*w,n}function LS(n,e,t){var o,a,l,c,d,f,p,g,_,y,v,C,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],y=e[9],v=e[10],C=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]=y,n[10]=v,n[11]=C,n[12]=o*i+d*r+_*s+e[12],n[13]=a*i+f*r+y*s+e[13],n[14]=l*i+p*r+v*s+e[14],n[15]=c*i+g*r+C*s+e[15]),n}function BS(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 b5(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 C5(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 w5(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 VS(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 ia(4);ia!=Float32Array&&(n[0]=0,n[1]=0,n[2]=0,n[3]=0)}();const E5=[0,0,0,0],qfe=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0],Yfe=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],Xfe=[0,0,0],Kfe=[0,0,0],Zfe=NS(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=E5,l=E5,c=n.cameraPosition;const{geospatialOrigin:d,shaderCoordinateOrigin:f,offsetMode:p}=S5(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=VS([],l,o),s=i||s,o=rp([],r,s),o=rp([],o,qfe)),{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:Xfe,project_uScale:n.scale,project_uViewProjectionMatrix:s,project_uCameraPosition:a};if(c){const _=n.getDistanceScales(c);switch(t){case qn.METER_OFFSETS:g.project_uCommonUnitsPerWorldUnit=_.unitsPerMeter,g.project_uCommonUnitsPerWorldUnit2=_.unitsPerMeter2;break;case qn.LNGLAT:case qn.LNGLAT_OFFSETS:g.project_uCommonUnitsPerWorldUnit=_.unitsPerDegree,g.project_uCommonUnitsPerWorldUnit2=_.unitsPerDegree2;break;case qn.CARTESIAN:g.project_uCommonUnitsPerWorldUnit=[1,1,_.unitsPerMeter[2]],g.project_uCommonUnitsPerWorldUnit2=[0,0,_.unitsPerMeter2[2]]}}return g});function S5(n,e,t=Kfe){let r,i=t,s=!0;switch(r=e===qn.LNGLAT_OFFSETS||e===qn.METER_OFFSETS?t:n.isGeospatial?[Math.fround(n.longitude),Math.fround(n.latitude),0]:null,n.projectionMode){case Yc.WEB_MERCATOR:(e===qn.LNGLAT||e===qn.CARTESIAN)&&(s=!1);break;case Yc.WEB_MERCATOR_AUTO_OFFSET:e===qn.LNGLAT?i=r:e===qn.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 Yc.IDENTITY:i=n.position.map(Math.fround);break;case Yc.GLOBE:s=!1,r=null;break;default:s=!1}return i[2]=i[2]||0,{geospatialOrigin:r,shaderCoordinateOrigin:i,offsetMode:s}}class tpe extends vI{get ELEMENTS(){return Qu(!1),0}get RANK(){return Qu(!1),0}toString(){let e="[";if(Ji.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 $t).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 function(n,e,t,i,r){var o,s=1/Math.tan(e/2);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)}(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],y=n[14],v=n[15];return(e*o-t*s)*(f*v-p*y)-(e*a-i*s)*(d*v-p*_)+(e*l-r*s)*(d*y-f*_)+(t*a-i*o)*(c*v-p*g)-(t*l-r*o)*(c*y-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 WI(this,this),this.check()}multiplyLeft(e){return rp(this,e,this),this.check()}multiplyRight(e){return rp(this,this,e),this.check()}rotateX(e){return b5(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 C5(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,_,y,v,C,w,x,N,V,U,ee,de,ae,me,Ee,Be,te,ne,Ie,r=i[0],s=i[1],o=i[2],a=Math.hypot(r,s,o);at?t:n}const qI=Math.log2||function(n){return Math.log(n)*Math.LOG2E};function ed(n,e){if(!n)throw new Error(e||"@math.gl/web-mercator: assertion failed.")}const oc=Math.PI,O5=oc/4,ac=oc/180,YI=180/oc,XI=4003e4,jS=85.051129;function US([n,e]){return ed(Number.isFinite(n)),ed(Number.isFinite(e)&&e>=-90&&e<=90,"invalid latitude"),[512*(n*ac+oc)/(2*oc),512*(oc+Math.log(Math.tan(O5+e*ac*.5)))/(2*oc)]}function Dm([n,e]){const t=n/512*(2*oc)-oc,i=2*(Math.atan(Math.exp(e/512*(2*oc)-oc))-O5);return[t*YI,i*YI]}function KI({latitude:n,longitude:e,highPrecision:t=!1}){ed(Number.isFinite(n)&&Number.isFinite(e));const i={},s=Math.cos(n*ac),o=512/360,a=o/s,l=512/XI/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=ac*Math.tan(n*ac)/s,f=512/XI*c,p=f/a*l;i.unitsPerDegree2=[0,o*c/2,f],i.unitsPerMeter2=[p,0,p]}return i}function I5(n,e){const[t,i,r]=n,[s,o,a]=e,{unitsPerMeter:l,unitsPerMeter2:c}=KI({longitude:t,latitude:i,highPrecision:!0}),d=US(n);d[0]+=s*(l[0]+c[0]*o),d[1]+=o*(l[1]+c[1]*o);const f=Dm(d),p=(r||0)+(a||0);return Number.isFinite(r)||Number.isFinite(a)?[f[0],f[1],p]:f}function R5(n){return 2*Math.atan(.5/n)*YI}function k5(n,e){const[t,i,r=0]=n;return ed(Number.isFinite(t)&&Number.isFinite(i)&&Number.isFinite(r)),Am(e,[t,i,r,1])}function gb(n,e,t=0){const[i,r,s]=n;if(ed(Number.isFinite(i)&&Number.isFinite(r),"invalid pixel coordinate"),Number.isFinite(s))return Am(e,[i,r,s,1]);const o=Am(e,[i,r,0,1]),a=Am(e,[i,r,1,1]),l=o[2],c=a[2];return x5([],o,a,l===c?0:((t||0)-l)/(c-l))}const F5=Math.PI/180;function N5(n,e,t){const{pixelUnprojectionMatrix:i}=n,r=Am(i,[e,0,1,1]),s=Am(i,[e,n.height,1,1]),c=Dm(x5([],r,s,(t*n.distanceScales.unitsPerMeter[2]-r[2])/(s[2]-r[2])));return c[2]=t,c}const _pe=Math.PI/180,ype=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],QI=[0,0,0],bpe={unitsPerMeter:[1,1,1],metersPerUnit:[1,1,1]};let Om=(()=>{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?Yc.WEB_MERCATOR:Yc.WEB_MERCATOR_AUTO_OFFSET:Yc.IDENTITY}equals(t){return t instanceof n&&(this===t||t.width===this.width&&t.height===this.height&&t.scale===this.scale&&rb(t.projectionMatrix,this.projectionMatrix)&&rb(t.viewMatrix,this.viewMatrix))}project(t,{topLeft:i=!0}={}){const s=k5(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=gb([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?US(t):t}unprojectFlat(t){return this.isGeospatial?Dm(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?KI({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 Om{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:y=1.5}=t;const v=Math.pow(2,s);g=g||1,_=_||1,y=Math.max(.75,y);const{fov:C,aspect:w,focalDistance:x,near:N,far:V}=function({width:n,height:e,fovy:t=R5(1.5),altitude:i,pitch:r=0,nearZMultiplier:s=1,farZMultiplier:o=1}){void 0!==i&&(t=R5(i));const a=.5*t*ac,l=function(n){return.5/Math.tan(.5*n*ac)}(t),c=r*ac,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}}({width:g,height:_,pitch:o,altitude:y,nearZMultiplier:l,farZMultiplier:c});let U=function({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 LS(o,o,[0,0,-i]),b5(o,o,-e*ac),C5(o,o,t*ac),BS(o,o,[r/=n,r,r]),s&&LS(o,o,function(n,e){return n[0]=-e[0],n[1]=-e[1],n[2]=-e[2],n}([],s)),o}({height:_,pitch:o,bearing:a,scale:v,altitude:y});p&&(U=(new $t).translate([512*p,0,0]).multiplyLeft(U)),super(Lt(K({},t),{width:g,height:_,viewMatrix:U,longitude:r,latitude:i,zoom:s,orthographic:d,fovyRadians:C,aspect:w,focalDistance:x,near:N,far:V})),this.latitude=i,this.longitude=r,this.zoom=s,this.pitch=o,this.bearing=a,this.altitude=y,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(Lt(K({},this),{worldOffset:s})):this;this._subViewports.push(o)}}return this._subViewports}addMetersToLngLat(t,i){return I5(t,i)}panByPosition(t,i){const r=gb(i,this.pixelUnprojectionMatrix),o=zS([],this.projectFlat(t),M5([],r)),a=zS([],this.center,o),[l,c]=this.unprojectFlat(a);return{longitude:l,latitude:c}}getBounds(t={}){const i=function(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*F5:Math.atan(.5/n.altitude))>(90-n.pitch)*F5-.01?(l=N5(n,0,e),c=N5(n,t,e)):(l=r([0,0],s),c=r([t,0],s)),[o,a,c,l]}(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}=function({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}:ed(Number.isFinite(s.top)&&Number.isFinite(s.bottom)&&Number.isFinite(s.left)&&Number.isFinite(s.right));const f=US([a,D5(d,-jS,jS)]),p=US([c,D5(l,-jS,jS)]),g=[Math.max(Math.abs(p[0]-f[0]),i),Math.max(Math.abs(p[1]-f[1]),i)],_=[n-s.left-s.right-2*Math.abs(o[0]),e-s.top-s.bottom-2*Math.abs(o[1])];ed(_[0]>0&&_[1]>0);const y=_[0]/g[0],v=_[1]/g[1],N=Dm([(p[0]+f[0])/2+(s.right-s.left)/2/y,(p[1]+f[1])/2+(s.bottom-s.top)/2/v]),V=Math.min(r,qI(Math.abs(Math.min(y,v))));return ed(Number.isFinite(V)),{longitude:N[0],latitude:N[1],zoom:V}}(K({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 JI(n,e,t=!1){const i=e.projectPosition(n);if(t&&e instanceof j5){const[r,s,o=0]=n,a=e.getDistanceScales([r,s]);i[2]=o*a.unitsPerMeter[2]}return i}function U5(n,{viewport:e,modelMatrix:t,coordinateSystem:i,coordinateOrigin:r,offsetMode:s}){let[o,a,l=0]=n;switch(t&&([o,a,l]=VS([],[o,a,l,1],t)),i){case qn.LNGLAT:return JI([o,a,l],e,s);case qn.LNGLAT_OFFSETS:return JI([o+r[0],a+r[1],l+(r[2]||0)],e,s);case qn.METER_OFFSETS:return JI(I5(r,[o,a,l]),e,s);case qn.CARTESIAN:default:return e.isGeospatial?[o+r[0],a+r[1],l+r[2]]:e.projectPosition([o,a,l])}}const Epe={10241:9987,10240:9729,10242:33071,10243:33071},eP={},xpe={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||_b(n)&&(3===n.length||4===n.length),equal:(n,e,t)=>tP(n,e)},accessor:{validate(n,e){const t=HS(n);return"function"===t||t===HS(e.value)},equal:(n,e,t)=>"function"==typeof e||tP(n,e)},array:{validate:(n,e)=>e.optional&&!n||_b(n),equal:(n,e,t)=>t.compare?tP(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 na)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 na(t,Lt(K({},e),{parameters:K(K(K({},Epe),i),n.props.textureParameters)}));return eP[r.id]=!0,r}(t,n),release:n=>{!function(n){!n||!(n instanceof na)||eP[n.id]&&(n.delete(),delete eP[n.id])}(n)}}};function tP(n,e){if(n===e)return!0;if(!_b(n)||!_b(e))return!1;const t=n.length;if(t!==e.length)return!1;for(let i=0;i{},this.oldProps=Vpe,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[Lpe]||{},i=e[Npe]||e,r=e[Bpe]||{};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(x4(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 yn(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=iP(t);c=(g=yield p.next()).done,_=yield g.value,!c;c=!0){const v=_,{dataTransform:C}=i.component?i.component.props:{};a=C?C(v,a):a.concat(v),Object.defineProperty(a,"__diff",{enumerable:!1,value:[{startRow:l,endRow:a.length}]}),l=a.length,i._setAsyncPropValue(e,a,o)}}catch(v){d=!0,f=v}finally{try{!c&&null!=p.return&&(yield p.return())}finally{if(d)throw f}}const y=null===(r=i.layer)||void 0===r?void 0:r.props.onDataLoad;y&&y(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:W5,ASYNC_RESOLVED:q5,ASYNC_DEFAULTS:zpe}=FS,jpe={};let Upe=0,Hpe=(()=>{class n{constructor(){this.props=Dpe.apply(this,arguments),this.id=this.props.id,this.count=Upe++,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[zpe])s in i[q5]?r[s]=i[q5][s]:s in i[W5]&&(r[s]=i[W5][s]);return new this.constructor(K(K(K({},i),r),t))}get stats(){return this.internalState.stats}_initState(){this.internalState=new G5({})}}return n.componentName="Component",n.defaultProps=jpe,n})();class $pe extends G5{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 lc=n=>"function"==typeof n,ph=n=>null!==n&&"object"==typeof n,X5=n=>ph(n)&&n.constructor==={}.constructor,Gpe=n=>n&&"function"==typeof n[Symbol.iterator],Wpe=n=>n&&"function"==typeof n[Symbol.asyncIterator],vb=n=>"undefined"!=typeof Response&&n instanceof Response||n&&n.arrayBuffer&&n.text&&n.json,Im=n=>"undefined"!=typeof Blob&&n instanceof Blob,K5=n=>(n=>"undefined"!=typeof ReadableStream&&n instanceof ReadableStream||ph(n)&&lc(n.tee)&&lc(n.cancel)&&lc(n.getReader))(n)||(n=>ph(n)&&lc(n.read)&&lc(n.pipe)&&(n=>"boolean"==typeof n)(n.readable))(n);function sp(n,e){if(!n)throw new Error(e||"loader assertion failed.")}function rP(n){var e;return!!n&&(Array.isArray(n)&&(n=n[0]),Array.isArray(null===(e=n)||void 0===e?void 0:e.extensions))}function sP(n){var e,t;let i;return sp(n,"null loader"),sp(rP(n),"invalid loader"),Array.isArray(n)&&(i=n[1],n=Lt(K({},n=n[0]),{options:K(K({},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 Zc={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},oP=Zc.global||Zc.self||Zc.window||{},Qpe="object"!=typeof process||"[object process]"!==String(process)||process.browser,Z5="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version);Z5&&parseFloat(Z5[1]);const lP={};function Jpe(n){for(const e in lP)n.startsWith(e)&&(n=n.replace(e,lP[e]));return!n.startsWith("http://")&&!n.startsWith("https://")&&(n=`${n}`),n}const ege=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,tge=/^([-\w.]+\/[-\w.+]+)/;function nge(n){const e=tge.exec(n);return e?e[1]:n}function Q5(n){const e=ege.exec(n);return e?e[1]:""}const ige=/\?.*/;function qS(n){if(vb(n)){const e=cP(n.url||"");return{url:e,type:nge(n.headers.get("content-type")||"")||Q5(e)}}return Im(n)?{url:cP(n.name||""),type:n.type||""}:"string"==typeof n?{url:cP(n),type:Q5(n)}:{url:"",type:""}}function rge(n){return vb(n)?n.headers["content-length"]||-1:Im(n)?n.size:"string"==typeof n?n.length:n instanceof ArrayBuffer||ArrayBuffer.isView(n)?n.byteLength:-1}function cP(n){return n.replace(ige,"")}function J5(n){return uP.apply(this,arguments)}function uP(){return(uP=yn(function*(n){if(vb(n))return n;const e={},t=rge(n);t>=0&&(e["content-length"]=String(t));const{url:i,type:r}=qS(n);r&&(e["content-type"]=r);const s=yield age(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 sge(n){return dP.apply(this,arguments)}function dP(){return(dP=yn(function*(n){if(!n.ok){const e=yield oge(n);throw new Error(e)}})).apply(this,arguments)}function oge(n){return hP.apply(this,arguments)}function hP(){return(hP=yn(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 age(n){return fP.apply(this,arguments)}function fP(){return(fP=yn(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,${lge(n.slice(0,5))}`:null})).apply(this,arguments)}function lge(n){let e="";const t=new Uint8Array(n);for(let i=0;i{}}info(){return()=>{}}warn(){return()=>{}}error(){return()=>{}}}const nH={fetch:null,mimeType:void 0,nothrow:!1,log:new class{constructor(){sn(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:[]},dge={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 gP(){oP.loaders=oP.loaders||{};const{loaders:n}=oP;return n._state=n._state||{},n._state}const mP=()=>{const n=gP();return n.globalOptions=n.globalOptions||K({},nH),n.globalOptions};function hge(n,e,t,i){return t=t||[],function(n,e){rH(n,null,nH,dge,e);for(const t of e)rH(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=K({},n.options||{});return function(n,e){e&&!("baseUri"in n)&&(n.baseUri=e)}(r,t),null===r.log&&(r.log=new cge),oH(r,mP()),oH(r,e),r}(e,n,i)}function iH(n,e){const t=mP(),i=n||t;return"function"==typeof i.fetch?i.fetch:ph(i.fetch)?r=>eH(r,i):null!=e&&e.fetch?null==e?void 0:e.fetch:eH}function rH(n,e,t,i,r){const s=e||"Top level",o=e?`${e}.`:"";for(const a in n){const l=!e&&ph(n[a]),c="baseUri"===a&&!e,d="workerUrl"===a&&e;if(!(a in t)&&!c&&!d)if(a in i)tH.warn(`${s} loader option '${o}${a}' no longer supported, use '${i[a]}'`)();else if(!l){const f=pge(a,r);tH.warn(`${s} loader option '${o}${a}' not recognized. ${f}`)()}}}function pge(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 oH(n,e){for(const t in e)t in e&&(n[t]=X5(e[t])&&X5(n[t])?K(K({},n[t]),e[t]):e[t])}function Qc(n,e){if(!n)throw new Error(e||"loaders.gl assertion failed.")}function _ge(n,e="3.0.12"){return Qc(n,"no worker provided"),!(!e||!n.version)}const Jc={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},yge=Jc.global||Jc.self||Jc.window||{},_P="object"!=typeof process||"[object process]"!==String(process)||process.browser,yP="function"==typeof importScripts,vge="undefined"!=typeof window&&void 0!==window.orientation,aH="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version),vP=(aH&&parseFloat(aH[1]),new Map);function lH(n){const e=new Blob([n],{type:"application/javascript"});return URL.createObjectURL(e)}function cH(n,e=!0,t){const i=t||new Set;if(n)if(uH(n))i.add(n);else if(uH(n.buffer))i.add(n.buffer);else if(!ArrayBuffer.isView(n)&&e&&"object"==typeof n)for(const r in n)cH(n[r],e,i);return void 0===t?Array.from(i):[]}function uH(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 bP=()=>{};class dH{static isSupported(){return"undefined"!=typeof Worker}constructor(e){sn(this,"name",void 0),sn(this,"source",void 0),sn(this,"url",void 0),sn(this,"terminated",!1),sn(this,"worker",void 0),sn(this,"onMessage",void 0),sn(this,"onError",void 0),sn(this,"_loadableURL","");const{name:t,source:i,url:r}=e;Qc(i||r),this.name=t,this.source=i,this.url=r,this.onMessage=bP,this.onError=s=>console.log(s),this.worker=this._createBrowserWorker()}destroy(){this.onMessage=bP,this.onError=bP,this.worker.terminate(),this.terminated=!0}get isRunning(){return Boolean(this.onMessage)}postMessage(e,t){t=t||cH(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){Qc(n.source&&!n.url||!n.source&&n.url);let e=vP.get(n.source||n.url);return e||(n.url&&(e=function(n){return n.startsWith("http")?lH(function(n){return`try {\n importScripts('${n}');\n} catch (error) {\n console.error(error);\n throw error;\n}`}(n)):n}(n.url),vP.set(n.url,e)),n.source&&(e=lH(n.source),vP.set(n.source,e))),Qc(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 Ege{constructor(e,t){sn(this,"name",void 0),sn(this,"workerThread",void 0),sn(this,"isRunning",void 0),sn(this,"result",void 0),sn(this,"_resolve",void 0),sn(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){Qc(this.isRunning),this.isRunning=!1,this._resolve(e)}error(e){Qc(this.isRunning),this.isRunning=!1,this._reject(e)}}class Sge{constructor(e){sn(this,"name","unnamed"),sn(this,"source",void 0),sn(this,"url",void 0),sn(this,"maxConcurrency",1),sn(this,"maxMobileConcurrency",1),sn(this,"onDebug",()=>{}),sn(this,"reuseWorkers",!0),sn(this,"props",{}),sn(this,"jobQueue",[]),sn(this,"idleQueue",[]),sn(this,"count",0),sn(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=K(K({},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 yn(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 yn(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 Ege(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 td{static isSupported(){return dH.isSupported()}static getWorkerFarm(e={}){return td._workerFarm=td._workerFarm||new td({}),td._workerFarm.setProps(e),td._workerFarm}constructor(e){sn(this,"props",void 0),sn(this,"workerPools",new Map),this.props=K({},Mge),this.setProps(e),this.workerPools=new Map}destroy(){for(const e of this.workerPools.values())e.destroy()}setProps(e){this.props=K(K({},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 Sge({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 Tge(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 Qc(r),r}function Age(n,e){return!!td.isSupported()&&n.worker&&(null==e?void 0:e.worker)}function Dge(n,e,t,i,r){return CP.apply(this,arguments)}function CP(){return(CP=yn(function*(n,e,t,i,r){const s=n.id,o=Tge(n,t),l=td.getWorkerFarm(t).getWorkerPool({name:s,url:o});t=JSON.parse(JSON.stringify(t));const c=yield l.startJob("process-on-worker",Oge.bind(null,r));return c.postMessage("process",{input:e,options:t}),yield(yield c.result).result})).apply(this,arguments)}function Oge(n,e,t,i){return wP.apply(this,arguments)}function wP(){return(wP=yn(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)}sn(td,"_workerFarm",void 0);var fH=ze(521);function pH(n){if(function(n){return n&&"object"==typeof n&&n.isBuffer}(n)&&(n=function(n){return fH.toArrayBuffer?fH.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 kge(...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 gH(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 Fge(n){return SP.apply(this,arguments)}function SP(){return(SP=yn(function*(n){const e=[];var r,t=!0,i=!1;try{for(var o,a,s=iP(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 kge(...e)})).apply(this,arguments)}const Bge=262144;function mH(n){this.wrapped=n}function bb(n){return new mH(n)}function Cb(n){var e,t;function r(o,a){try{var l=n[o](a),c=l.value,d=c instanceof mH;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 xP(n){return function(){return new Cb(n.apply(this,arguments))}}function TP(){return(TP=xP(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(OP)}function Wge(n,e,t){return IP.apply(this,arguments)}function IP(){return(IP=yn(function*(n,e,t){const i=n instanceof ArrayBuffer||ArrayBuffer.isView(n);if("string"==typeof n||i)return Gge(n,e);if(Im(n)&&(n=yield J5(n)),vb(n)){const r=n;return yield sge(r),e.binary?yield r.arrayBuffer():yield r.text()}if(K5(n)&&(n=$ge(n,t)),Gpe(n)||Wpe(n))return Fge(n);throw new Error(OP)})).apply(this,arguments)}function Yge(n,e,t=null){if(t)return t;const i=K({fetch:iH(e,n)},n);return Array.isArray(i.loaders)||(i.loaders=null),i}function Xge(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 yH=()=>{const n=gP();return n.loaderRegistry=n.loaderRegistry||[],n.loaderRegistry};function vH(n){const e=yH();n=Array.isArray(n)?n:[n];for(const t of n){const i=sP(t);e.find(r=>i===r)||e.unshift(i)}}const Zge=/\.([^.]+)$/;function Qge(n){return kP.apply(this,arguments)}function kP(){return(kP=yn(function*(n,e=[],t,i){if(!CH(n))return null;let r=bH(n,e,Lt(K({},t),{nothrow:!0}),i);if(r)return r;if(Im(n)&&(r=bH(n=yield n.slice(0,10).arrayBuffer(),e,t,i)),!(r||null!=t&&t.nothrow))throw new Error(wH(n));return r})).apply(this,arguments)}function bH(n,e=[],t,i){if(!CH(n))return null;if(e&&!Array.isArray(e))return sP(e);let r=[];e&&(r=r.concat(e)),null!=t&&t.ignoreRegisteredLoaders||r.push(...yH()),function(n){for(const e of n)sP(e)}(r);const s=function(n,e,t,i){const{url:r,type:s}=qS(n),o=r||(null==i?void 0:i.url);let a=null;return null!=t&&t.mimeType&&(a=FP(e,null==t?void 0:t.mimeType)),a=a||function(n,e){const t=e&&Zge.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||FP(e,s),a=a||function(n,e){if(!e)return null;for(const t of n)if("string"==typeof e){if(rme(e,t))return t}else if(ArrayBuffer.isView(e)){if(EH(e.buffer,e.byteOffset,t))return t}else if(e instanceof ArrayBuffer&&EH(e,0,t))return t;return null}(e,n),a=a||FP(e,null==t?void 0:t.fallbackMimeType),a}(n,r,t,i);if(!(s||null!=t&&t.nothrow))throw new Error(wH(n));return s}function CH(n){return!(n instanceof Response&&204===n.status)}function wH(n){const{url:e,type:t}=qS(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)?NP(n.buffer,n.byteOffset,e):n instanceof ArrayBuffer?NP(n,0,e):""}(n)}", contentType: "${t}"`),e&&(i+=` url: ${e}`),i}function FP(n,e){for(const t of n)if(t.mimeTypes&&t.mimeTypes.includes(e)||e===`application/x.${t.id}`)return t;return null}function rme(n,e){return e.testText?e.testText(n):(Array.isArray(e.tests)?e.tests:[e.tests]).some(i=>n.startsWith(i))}function EH(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 eu=new Uint8ClampedArray(0);const gme={data:{type:"data",value:fme,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=Lt(K({},r),{fetch:Lt(K({},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:wb(n,i),persistent:!1}),l=!0),l?o.subscribe({resourceId:n,onChange:c=>t.internalState.reloadAsyncProp(e,c),consumerId:t.id,requestId:e}):wb(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:qn.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 Eb=(()=>{class n extends Hpe{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=U5(t,{viewport:i,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem}),[s,o,a]=k5(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=K({},n);let{coordinateSystem:t}=n;const{viewport:i,coordinateOrigin:r,fromCoordinateSystem:s,fromCoordinateOrigin:o}=n;return t===qn.DEFAULT&&(t=i.isGeospatial?qn.LNGLAT:qn.CARTESIAN),void 0===s&&(e.fromCoordinateSystem=t),void 0===o&&(e.fromCoordinateOrigin=r),e.coordinateSystem=t,e}(e),{geospatialOrigin:l,shaderCoordinateOrigin:c,offsetMode:d}=S5(t,i,r),f=U5(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===qn.DEFAULT||t===qn.LNGLAT||t===qn.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){sc(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=bfe(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||!pme({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(eu.length/3);if(this.internalState.usesPickingColorCache=!0,rSH&&jn.warn("Layer has too many data objects. Picking might not be able to distinguish all objects.")(),eu=nb.allocate(eu,i,{size:3,copy:!0,maxCount:Math.max(i,SH)});const s=Math.floor(eu.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&&no("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=y5({newProps:n,oldProps:e,propTypes:GI(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&&v5(n,e,"all"))return{all:!0};const t={};let i=!1;for(const r in n.updateTriggers)"all"!==r&&v5(n,e,r)&&(t[r]=!0,i=t);return i}(n,e)),{dataChanged:i,propsChanged:t,updateTriggersChanged:r,extensionsChanged:ffe(n,e),transitionsChanged:ufe(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=GI(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 tfe(this.context.gl,{id:this.props.id,stats:this.context.stats,timeline:this.context.timeline})}_initState(){sc(!this.internalState&&!this.state),sc(isFinite(this.props.coordinateSystem));const t=this._getAttributeManager();t&&t.addInstanced({instancePickingColors:{type:5121,size:3,noAlloc:!0,update:this.calculateInstancePickingColors}}),this.internalState=new $pe({attributeManager:t,layer:this}),this.clearChangeFlags(),this.state={},Object.defineProperty(this.state,"attributeManager",{get:()=>(jn.deprecated("layer.state.attributeManager","layer.getAttributeManager()"),t)}),this.internalState.layer=this,this.internalState.uniformTransitions=new ofe(this.context.timeline),this.internalState.onAsyncPropUpdated=this._onAsyncPropUpdated.bind(this),this.internalState.setAsyncProps(this.props)}_transferState(t){no("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=gme,n})(),MH=(()=>{class n extends Eb{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:y,extensions:v,fetch:C,_subLayerProps:w}=this.props,x={opacity:i,pickable:r,visible:s,parameters:o,getPolygonOffset:a,highlightedObjectIndex:l,autoHighlight:c,highlightColor:d,coordinateSystem:f,coordinateOrigin:p,wrapLongitude:g,positionFormat:_,modelMatrix:y,extensions:v,fetch:C},N=w&&w[t.id],V=N&&N.updateTriggers,U=t.id||"sublayer";if(N){const ee=this.constructor._propTypes,de=t.type?t.type._propTypes:{};for(const ae in N){const me=de[ae]||ee[ae];me&&"accessor"===me.type&&(N[ae]=this.getSubLayerAccessor(N[ae]))}}Object.assign(x,t,N),x.id="".concat(this.props.id,"-").concat(U),x.updateTriggers=K(K({all:this.props.updateTriggers.all},t.updateTriggers),V);for(const ee of v){const de=ee.getSubLayerProps.call(this,ee);de&&Object.assign(x,de,{updateTriggers:Object.assign(x.updateTriggers,de.updateTriggers)})}return x}_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=EI(t,Boolean),this.internalState.subLayers=t),no("compositeLayer.renderLayers",this,i,t);for(const r of t)r.parent=this}}return n.layerName="CompositeLayer",n})();const _me=/([0-9]+\.?[0-9]*)(%|px)/;function XS(n){switch(typeof n){case"number":return{position:n,relative:!1};case"string":const e=n.match(_me);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 KS(n,e){return n.relative?Math.round(n.position*e):n.position}function Sb(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)&&Sb(i,r)))return!1}return!0}class zP{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=Om}=e;sc(!p||p instanceof Om),this.viewportInstance=p,this.id=t||this.constructor.displayName||"view",this.type=g,this.props=Lt(K({},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):Sb(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=K({},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:KS(this._x,e),y:KS(this._y,t),width:KS(this._width,e),height:KS(this._height,t)}}_getControllerProps(e){let t=this.props.controller;return t?!0===t?e:("function"==typeof t&&(t={type:t}),K(K({},e),t)):null}_getViewport(e,t){const{type:i}=this;return new i(K(K(K({},e),this.props),t))}_parseDimensions({x:e,y:t,width:i,height:r}){this._x=XS(e),this._y=XS(t),this._width=XS(i),this._height=XS(r)}}const Mb=()=>{},xH={transitionEasing:n=>n,transitionInterruption:1,onTransitionStart:Mb,onTransitionInterrupt:Mb,onTransitionEnd:Mb};class yme{constructor(e,t={}){this.ControllerState=e,this.props=K(K({},xH),t),this.propsInTransition=null,this.transition=new fb(t.timeline),this.onViewStateChange=t.onViewStateChange||Mb,this.onStateChange=t.onStateChange||Mb,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=K(K({},xH),e),this.props=e,this._shouldIgnoreViewportChange(i,e))return t;if(this._isTransitionEnabled(e)){const{interruption:r,endProps:s}=this.transition.settings,o=K(K({},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(K(K({},this.props),c)).getViewportProps(),this.onViewStateChange({viewState:this.propsInTransition,oldViewState:this.props})}}const TH=["longitude","latitude","zoom","bearing","pitch"],bme=["longitude","latitude","zoom"];class AH 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)||!rb(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];sc(Number.isFinite(i)||Array.isArray(i),"".concat(t," is required for transition"))})}}{constructor(e={}){super((Array.isArray(e)?e:e.transitionProps)||{compare:TH,extract:TH,required:bme}),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]=bS(e[s]||0,t[s]||0,i);if(t.aroundPosition){const s=this.opts.makeViewport(K(K({},t),r));Object.assign(r,s.panByPosition(t.aroundPosition,bS(e.around,t.around,i)))}return r}}const gh={transitionDuration:0},Cme={transitionDuration:300,transitionEasing:n=>n,transitionInterruption:1},QS=n=>1-(1-n)*(1-n),Pm_WHEEL=["wheel"],Pm_PAN=["panstart","panmove","panend"],Pm_PINCH=["pinchstart","pinchmove","pinchend"],Pm_TRIPLE_PAN=["tripanstart","tripanmove","tripanend"],Pm_DOUBLE_TAP=["doubletap"],Pm_KEYBOARD=["keydown"];class jP{constructor(e,t={}){this.ControllerState=e,this.controllerState=null,this.controllerStateProps=null,this.eventManager=null,this.transitionManager=new yme(e,Lt(K({},t),{onViewStateChange:this._onTransition.bind(this),onStateChange:this._setInteractionState.bind(this)}));const i=this.linearTransitionProps;this._transition=i&&Lt(K({},Cme),{transitionInterpolator:new AH({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(K(K({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(Pm_WHEEL,d&&i),this.toggleEvents(Pm_PAN,d&&(r||s)),this.toggleEvents(Pm_PINCH,d&&(a||l)),this.toggleEvents(Pm_TRIPLE_PAN,d&&l),this.toggleEvents(Pm_DOUBLE_TAP,d&&o),this.toggleEvents(Pm_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=K(K({},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,gh,{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,gh,{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,Lt(K({},this._getTransitionProps()),{transitionDuration:t,transitionEasing:QS}),{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,gh,{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,Lt(K({},this._getTransitionProps()),{transitionDuration:t,transitionEasing:QS}),{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,Lt(K({},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,gh,{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,gh,{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,Lt(K({},this._getTransitionProps()),{transitionDuration:t,transitionEasing:QS}),{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,gh,{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,gh,{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,Lt(K({},this._getTransitionProps({around:r})),{transitionDuration:t,transitionEasing:QS}),{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?Lt(K({},t),{transitionInterpolator:new AH(Lt(K({},e),{transitionProps:this.linearTransitionProps,makeViewport:this.controllerState.makeViewport}))}):t:gh}}class DH{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 mh_target=[0,0,0];class JS extends DH{constructor({makeViewport:e,width:t,height:i,rotationX:r=0,rotationOrbit:s=0,target:o=mh_target,zoom:a=0,minRotationX:l=-90,maxRotationX:c=90,minZoom:d=-(1/0),maxZoom:f=Infinity,startPanPosition:p,startRotatePos:g,startRotationX:_,startRotationOrbit:y,startZoomPosition:v,startZoom:C}){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:y,startZoomPosition:v,startZoom:C},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=K({},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(Lt(K({},this._viewportProps),{zoom:a}));return this._getUpdatedState(K({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),np(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 JS(K(K(K({},this._viewportProps),this._state),e))}_applyConstraints(e){const{maxZoom:t,minZoom:i,zoom:r,maxRotationX:s,minRotationX:o,rotationOrbit:a}=e;return e.zoom=np(r,i,t),e.rotationX=np(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 Eme extends jP{constructor(e){super(JS,e)}get linearTransitionProps(){return["target","zoom","rotationX","rotationOrbit"]}}class Sme extends jP{constructor(e){e.dragMode=e.dragMode||"pan",super(JS,e)}_onPanRotate(e){return!1}get linearTransitionProps(){return["target","zoom"]}}const Mme=(new $t).lookAt({eye:[0,0,1]});function xme({width:n,height:e,near:t,far:i}){return n=n||1,e=e||1,(new $t).ortho({left:-n/2,right:n/2,bottom:-e/2,top:e/2,near:t,far:i})}class Tme extends Om{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(Lt(K({},e),{longitude:null,position:a,viewMatrix:Mme.clone().scale([c,c*(l?-1:1),c]),projectionMatrix:xme({width:t,height:i,near:r,far:s}),zoom:o}))}panByPosition(e,t){const r=zS([],e,M5([],gb(t,this.pixelUnprojectionMatrix)));return{target:zS([],this.center,r)}}}let Ame=(()=>{class n extends zP{constructor(t){super(Lt(K({},t),{type:Tme}))}get controller(){return this._getControllerProps({type:Sme})}}return n.displayName="OrthographicView",n})();const eM=Math.PI/180;function Dme({height:n,fovy:e,orbitAxis:t,rotationX:i,rotationOrbit:r,zoom:s}){const o=.5/Math.tan(e*eM/2),a="Z"===t?[0,0,1]:[0,1,0],l="Z"===t?[0,-o,0]:[0,0,o],c=(new $t).lookAt({eye:l,up:a});c.rotateX(i*eM),"Z"===t?c.rotateZ(r*eM):c.rotateY(r*eM);const d=Math.pow(2,s)/(n||1);return c.scale(d),c}class Ome extends Om{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(Lt(K({},e),{longitude:null,viewMatrix:Dme({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]=gb([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 Ime=(()=>{class n extends zP{constructor(t={}){const{orbitAxis:i="Z"}=t;super(Lt(K({},t),{orbitAxis:i,type:Ome}))}get controller(){return this._getControllerProps({type:Eme})}}return n.displayName="OrbitView",n})();const Pme=[255,255,255],Rme=1;let kme=0;class OH{constructor(e={}){const{color:t=Pme}=e,{intensity:i=Rme}=e;this.id=e.id||"ambient-".concat(kme++),this.color=t,this.intensity=i,this.type="ambient"}}const Fme=[255,255,255],Nme=1,Lme=[0,0,-1];let Bme=0;class IH{constructor(e={}){const{color:t=Fme}=e,{intensity:i=Nme}=e,{direction:r=Lme}=e,{_shadow:s=!1}=e;this.id=e.id||"directional-".concat(Bme++),this.color=t,this.intensity=i,this.type="directional",this.direction=new to(r).normalize().toArray(),this.shadow=s}getProjectedLight(){return this}}class PH{constructor(e={}){const{id:t="effect"}=e;this.id=t,this.props=K({},e)}preRender(){}getModuleParameters(){}cleanup(){}}class UP extends class{constructor(e,t={}){const{id:i="pass"}=t;this.id=i,this.gl=e,this.props=K({},t)}setProps(e){Object.assign(this.props,e)}render(){}cleanup(){}}{render(e){return Xu(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){Xu(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=RH(),c={viewport:e,isPicking:i.startsWith("picking"),renderPass:i};for(let d=0;dpI(e,c))}const l={totalCount:t.length,visibleCount:0,compositeCount:0,pickableCount:0};Xu(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]||RH(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 Ume extends UP{constructor(e,t){super(e,t),this.shadowMap=new na(e,{width:1,height:1,parameters:{10241:9729,10240:9729,10242:33071,10243:33071}}),this.depthBuffer=new vm(e,{format:33189,width:1,height:1}),this.fbo=new ss(e,{id:"shadowmap",width:1,height:1,attachments:{36064:this.shadowMap,36096:this.depthBuffer}})}render(e){const t=this.fbo;rc(this.gl,{depthRange:[0,1],depthTest:!0,blend:!1,clearColor:[1,1,1,1]},()=>{const i=e.viewports[0],r=mm(this.gl),s=i.width*r,o=i.height*r;(s!==t.width||o!==t.height)&&t.resize({width:s,height:o}),super.render(Lt(K({},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 $me=Object.keys(qn).map(n=>"const int COORDINATE_SYSTEM_".concat(n," = ").concat(qn[n],";")).join(""),Gme=Object.keys(Yc).map(n=>"const int PROJECTION_MODE_".concat(n," = ").concat(Yc[n],";")).join(""),Wme="".concat($me,"\n").concat(Gme,"\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"),qme={},HP={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:Wme,getUniforms:function(n=qme){return n.viewport?function({viewport:n,devicePixelRatio:e=1,modelMatrix:t=null,coordinateSystem:i=qn.DEFAULT,coordinateOrigin:r,autoWrapLongitude:s=!1}={}){i===qn.DEFAULT&&(i=n.isGeospatial?qn.LNGLAT:qn.CARTESIAN);const o=Zfe({viewport:n,devicePixelRatio:e,coordinateSystem:i,coordinateOrigin:r});return o.project_uWrapLongitude=s,o.project_uModelMatrix=t||Yfe,o}(n):{}}},Zme=NS(function({viewport:n,center:e}){return new $t(n.viewProjectionMatrix).invert().transform(e)}),Qme=NS(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=gb([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 to(n.center).negate()),l=s.map(d=>a.transform(d)),c=(new $t).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}),Jme=[0,0,0,1],e_e=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0],$P={name:"shadow",dependencies:[HP],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||Jme,shadow_uLightId:n.shadowLightId||0,shadow_uLightCount:n.shadowMatrices.length},i=Zme({viewport:n.viewport,center:e.project_uCenter}),r=[],s=Qme({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{}}},s_e={color:[255,255,255],intensity:1},kH=[{color:[255,255,255],intensity:1,direction:[-1,3,-1]},{color:[255,255,255],intensity:.9,direction:[1,-8,-2.5]}],o_e=[0,0,0,200/255];class GP extends PH{constructor(e){super(e),this.ambientLight=null,this.directionalLights=[],this.pointLights=[],this.shadowColor=o_e,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=db.getDefaultProgramManager(e),$P&&this.programManager.addDefaultModule($P)),this.dummyShadowMap||(this.dummyShadowMap=new na(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($P),this.programManager=null)}_createLightMatrix(){const e=[];for(const t of this.directionalLights){const i=(new $t).lookAt({eye:new to(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=l_e++;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 c_e{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=wb(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 u_e{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 c_e(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 d_e=[{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"},HP],h_e=["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 f_e(n){const e=db.getDefaultProgramManager(n);for(const t of d_e)e.addDefaultModule(t);for(const t of h_e)e.addShaderHook(t);return e}const m_e=Object.seal({layerManager:null,resourceManager:null,deck:null,gl:null,stats:null,shaderCache:null,pickingFBO:null,mousePosition:null,userData:{}});class __e{constructor(e,{deck:t,stats:i,viewport:r,timeline:s}={}){this.lastRenderedLayers=[],this.layers=[],this.resourceManager=new u_e({gl:e,protocol:"deck://"}),this.context=Lt(K({},m_e),{layerManager:this,gl:e,deck:t,programManager:e&&f_e(e),stats:i||new aI({id:"deck.gl"}),viewport:r||new Om({id:"DEFAULT-INITIAL-VIEWPORT"}),timeline:s||new FH,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){no("layerManager.setLayers",this,t,e),this.lastRenderedLayers=e,e=EI(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 no("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]?jn.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&&jn.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 y_e{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=EI(e,Boolean),this._diffViews(e,this.views)&&this.setNeedsUpdate("views changed"),this.views=e}_setViewState(e){e?(!Sb(e,this.viewState)&&this.setNeedsUpdate("viewState changed"),this.viewState=e):jn.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)(K({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=Lt(K(K(K({},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 b_e extends DH{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:y,startRotatePos:v,startBearing:C,startPitch:w,startZoom:x,normalize:N}={}){sc(Number.isFinite(s)),sc(Number.isFinite(r)),sc(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:N}),this._state={startPanLngLat:_,startZoomLngLat:y,startRotatePos:v,startBearing:C,startPitch:w,startZoom:x},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(Lt(K({},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(Lt(K({},this._viewportProps),{zoom:o}));return this._getUpdatedState(K({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=K({},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(K(K(K({makeViewport:this.makeViewport},this._viewportProps),this._state),e))}_applyConstraints(e){const{maxZoom:t,minZoom:i,zoom:r}=e;e.zoom=np(r,i,t);const{maxPitch:s,minPitch:o,pitch:a}=e;e.pitch=np(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=A5(t+180,360)-180),(o<-180||o>180)&&(o=A5(o+180,360)-180);const a=qI(e/512);if(r<=a)r=a,i=0;else{const l=e/2/Math.pow(2,r),c=Dm([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 np(t+Math.log2(e),r,i)}_calculateNewPitchAndBearing({deltaScaleX:e,deltaScaleY:t,startBearing:i,startPitch:r}){t=np(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 C_e extends jP{constructor(e){e.dragMode=e.dragMode||"pan",super(b_e,e)}setProps(e){const t=this.controllerStateProps;super.setProps(e),(!t||t.height!==e.height)&&this.updateViewport(new this.ControllerState(K(K({makeViewport:this.makeViewport},this.controllerStateProps),this._state)))}get linearTransitionProps(){return["longitude","latitude","zoom","bearing","pitch"]}}let w_e=(()=>{class n extends zP{constructor(t){super(Lt(K({},t),{type:j5}))}get controller(){return this._getControllerProps({type:C_e})}}return n.displayName="MapView",n})();const E_e=new GP;class S_e{constructor(){this.effects=[],this._internalEffects=[],this._needsRedraw="Initial render",this.setEffects()}setProps(e){"effects"in e&&(e.effects.length!==this.effects.length||!Sb(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 GP)||this._internalEffects.push(E_e)}}class M_e extends UP{}const LH={blendFunc:[1,0,32771,0],blendEquation:32774};class BH extends UP{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,rc(_,Lt(K({scissorTest:!0,scissor:[a,l,c,d],clearColor:[0,0,0,0],depthMask:!0,depthTest:!0,depthRange:[0,1],colorMask:[!0,!0,!0,!0]},LH),{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}:Lt(K({},LH),{blend:!0,blendColor:[0,0,0,this.useAlpha?(t+1)/255:1]});return K(K({},e.props.parameters),i)}}class T_e{constructor(e){this.gl=e,this.layerFilter=null,this.drawPickingColors=!1,this.drawLayersPass=new M_e(e),this.pickLayersPass=new BH(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||ss.getDefaultFramebuffer(this.gl),this._preRender(e.effects,e);const i=this.lastPostProcessEffect?this.renderBuffers[0]:e.target,r=t.render(Lt(K({},e),{target:i}));this._postRender(e.effects,e),this.renderCount++,no("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 ss(this.gl),new ss(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 A_e={pickedColor:null,pickedLayer:null,pickedObjectIndex:-1};function D_e({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 v=0;v=0){const w=v+o-t,x=w*w+y;x<=d&&(d=x,f=p)}p+=4}}if(f>=0){const g=n[f+3]-1,_=n.slice(f,f+4),y=e[g];if(y){const v=y.decodePickingColor(_),C=Math.floor(f/4/l);return{pickedColor:_,pickedLayer:y,pickedObjectIndex:v,pickedX:o+(f/4-C*l),pickedY:a+C}}jn.error("Picked non-existent layer. Is picking buffer corrupt?")()}}return A_e}function VH({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 I_e(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(y=>y.props.id===p);_&&l.unshift(_)}t.layerId=g,t.index=a,t.info=null}}const c=VH(n),d=new Map;return d.set(null,c),l.forEach(f=>{let p=K({},c);f===o&&(p.color=s,p.index=a,p.picked=!0),p=zH({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 zH({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 R_e{constructor(e){this.gl=e,this.pickingFBO=null,this.pickLayersPass=new BH(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?K(K({},s),f):Object.assign(f,{color:null,object:null,index:-1})}_resizeBuffer(){const{gl:e}=this;return this.pickingFBO||(this.pickingFBO=new ss(e),ss.isSupported(e,{colorBufferFloat:!0})&&(this.depthFBO=new ss(e),this.depthFBO.attach({36064:new na(e,{format:In(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?(jn.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:VH({viewports:i,x:r,y:s})};this._resizeBuffer();const f=mm(this.gl),p=rI(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:y,height:v}=this.pickingFBO,C=this._getPickingRect({deviceX:g[0],deviceY:g[1],deviceRadius:_,deviceWidth:y,deviceHeight:v});let w;const x=[],N={};for(let V=0;V=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)}):jn.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:C,width:y.x+y.width-g,height:_-C},pass:"picking:".concat(l),redrawReason:l}),layers:e}),V=new Map,U=Number.isFinite(c);for(let ee=0;ee=c);ee++){const de=N[ee];let ae={color:de.pickedColor,layer:null,index:de.pickedObjectIndex,picked:!0,x:r,y:s,width:o,height:a,pixelRatio:f};ae=zH({layer:de.pickedLayer,info:ae,mode:l}),V.has(ae.object)||V.set(ae.object,ae)}return Array.from(V.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 vS(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 k_e={zIndex:1,position:"absolute",pointerEvents:"none",color:"#a0a7b4",backgroundColor:"#29323c",padding:"10px",top:0,left:0,display:"none"};class F_e{constructor(e){const t=e.parentElement;t&&(this.el=document.createElement("div"),this.el.className="deck-tooltip",Object.assign(this.el.style,k_e),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 jH(n,e){if(!n)throw new Error(e)}const tu={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},UH=tu.global||tu.self||tu.window,L_e="object"!=typeof process||"[object process]"!==String(process)||process.browser,HH="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version),{_parseImageNode:B_e}=(HH&&parseFloat(HH[1]),UH),WP="undefined"!=typeof Image,qP="undefined"!=typeof ImageBitmap,V_e=Boolean(B_e),YP=!!L_e||V_e;function $H(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 GH(n){switch($H(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 U_e=/^data:image\/svg\+xml/,H_e=/\.svg((\?|#).*)?$/;function XP(n){return n&&(U_e.test(n)||H_e.test(n))}function $_e(n,e){if(XP(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 qH(n,e)}function qH(n,e){if(XP(e))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(n)])}function YH(n,e,t){return KP.apply(this,arguments)}function KP(){return(KP=yn(function*(n,e,t){const i=$_e(n,t),r=self.URL||self.webkitURL,s="string"!=typeof i&&r.createObjectURL(i);try{return yield G_e(s||i,e)}finally{s&&r.revokeObjectURL(s)}})).apply(this,arguments)}function G_e(n,e){return ZP.apply(this,arguments)}function ZP(){return(ZP=yn(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 W_e={};let XH=!0;function q_e(n,e,t){return QP.apply(this,arguments)}function QP(){return(QP=yn(function*(n,e,t){let i;i=XP(t)?yield YH(n,e,t):qH(n,t);const r=e&&e.imagebitmap;return yield Y_e(i,r)})).apply(this,arguments)}function Y_e(n){return JP.apply(this,arguments)}function JP(){return(JP=yn(function*(n,e=null){if((X_e(e)||!XH)&&(e=null),e)try{return yield createImageBitmap(n,e)}catch(t){console.warn(t),XH=!1}return yield createImageBitmap(n)})).apply(this,arguments)}function X_e(n){for(const e in n||W_e)return!1;return!0}const nu=!1,xb=!0;function eR(n){const e=Tb(n);return function(n){const e=Tb(n);return e.byteLength>=24&&2303741511===e.getUint32(0,nu)?{mimeType:"image/png",width:e.getUint32(16,nu),height:e.getUint32(20,nu)}:null}(e)||function(n){const e=Tb(n);if(!(e.byteLength>=3&&65496===e.getUint16(0,nu)&&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,nu)?{mimeType:"image/gif",width:e.getUint16(6,xb),height:e.getUint16(8,xb)}:null}(e)||function(n){const e=Tb(n);return e.byteLength>=14&&16973===e.getUint16(0,nu)&&e.getUint32(2,xb)===e.byteLength?{mimeType:"image/bmp",width:e.getUint32(18,xb),height:e.getUint32(22,xb)}:null}(e)}function Tb(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 tye(n,e){const{mimeType:t}=eR(n)||{},{_parseImageNode:i}=UH;return jH(i),i(n,t,e)}function tR(){return(tR=yn(function*(n,e,t){const r=((e=e||{}).image||{}).type||"auto",{url:s}=t||{};let a;switch(iye(r)){case"imagebitmap":a=yield q_e(n,e,s);break;case"image":a=yield YH(n,e,s);break;case"data":a=yield tye(n,e);break;default:jH(!1)}return"data"===r&&(a=GH(a)),a})).apply(this,arguments)}function iye(n){switch(n){case"auto":case"data":return function(){if(qP)return"imagebitmap";if(WP)return"image";if(YP)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}();default:return function(n){switch(n){case"auto":return qP||WP||YP;case"imagebitmap":return qP;case"image":return WP;case"data":return YP;default:throw new Error(`@loaders.gl/images: image ${n} not supported in this environment`)}}(n),n}}const nR={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 tR.apply(this,arguments)},tests:[n=>Boolean(eR(new DataView(n)))],options:{image:{type:"auto",decode:!0}}};var Rm=ze(761);const sye={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},Ab="8.5.8",tM=Rm.CO.deck&&Rm.CO.deck.VERSION;if(tM&&tM!==Ab)throw new Error("deck.gl - multiple versions detected: ".concat(tM," vs ").concat(Ab));tM||(jn.log(1,"deck.gl ".concat(Ab))(),Rm.CO.deck=Object.assign(Rm.CO.deck||{},{VERSION:Ab,version:Ab,log:jn,_registerLoggers:function(n){TI=n}}),vH([sye,[nR,{imagebitmap:{premultiplyAlpha:"none"}}]]));const oye=Rm.CO.deck;class nM extends Ku{get[Symbol.toStringTag](){return"Query"}static isSupported(e,t=[]){const i=In(e),r=f4(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:nt(!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 nM.isSupported(this.gl)?this.gl2.createQuery():null}_deleteHandle(){this.gl2.deleteQuery(this.handle)}}const KH=yS()&&"undefined"!=typeof document;let mye=0;class _ye{constructor(e={}){const{onCreateContext:t=(v=>qU(v)),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:_=Jf.get("animation-loop-"+mye++)}=e;let{useDevicePixels:y=!0}=e;"useDevicePixelRatio"in e&&(vt.deprecated("useDevicePixelRatio","useDevicePixels")(),y=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:y}),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 nt("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=nM.isSupported(this.gl,["timers"])?new nM(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 yn(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 vt.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=KH?new Promise((e,t)=>{KH&&"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?oI(this.props.gl,e):this.onCreateContext(e),!mS(this.gl))throw new Error("AnimationLoop.onCreateContext - illegal context returned");(function(n){Xu(n,iI)})(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)&&(vt.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)&&(vt.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 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: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 yye=ze(524),iM=ze.n(yye);const vye={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}))}}(iM().MouseInput);const Eye=iM().Manager,iu=iM(),Sye=iu?[[iu.Pan,{event:"tripan",pointers:3,threshold:0,enable:!1}],[iu.Rotate,{enable:!1}],[iu.Pinch,{enable:!1}],[iu.Swipe,{enable:!1}],[iu.Pan,{threshold:0,enable:!1}],[iu.Press,{enable:!1}],[iu.Tap,{event:"doubletap",taps:2,enable:!1}],[iu.Tap,{event:"anytap",enable:!1}],[iu.Tap,{enable:!1}]]:null,JH={tripan:["rotate","pinch","pan"],rotate:["pinch"],pinch:["pan"],pan:["press","doubletap","anytap","tap"],doubletap:["anytap"],anytap:["tap"]},Mye={doubletap:["tap"]},xye={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"]},Tye={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"},e6={click:"tap",anyclick:"anytap",dblclick:"doubletap",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup",mouseover:"pointerover",mouseout:"pointerout",mouseleave:"pointerleave"},Aye="undefined"!=typeof navigator&&navigator.userAgent?navigator.userAgent.toLowerCase():"",km="undefined"!=typeof window?window:global;"undefined"!=typeof global?global:window,"undefined"!=typeof document&&document;let t6=!1;try{const n={get passive(){return t6=!0,!0}};km.addEventListener("test",n,n),km.removeEventListener("test",n,n)}catch(n){}const Dye=-1!==Aye.indexOf("firefox"),{WHEEL_EVENTS:Oye}=rR,i6=4.000244140625;class Rye{constructor(e,t,i={}){this.element=e,this.callback=t,this.options=Object.assign({enable:!0},i),this.events=Oye.concat(i.events||[]),this.handleEvent=this.handleEvent.bind(this),this.events.forEach(r=>e.addEventListener(r,this.handleEvent,!!t6&&{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;km.WheelEvent&&(Dye&&e.deltaMode===km.WheelEvent.DOM_DELTA_PIXEL&&(t/=km.devicePixelRatio),e.deltaMode===km.WheelEvent.DOM_DELTA_LINE&&(t*=40));const i={x:e.clientX,y:e.clientY};0!==t&&t%i6==0&&(t=Math.floor(t/i6)),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:kye}=rR,r6="pointermove",s6="pointerover",o6="pointerout",a6="pointerleave";class Fye{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=kye.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===r6&&(this.enableMoveEvent=t),e===s6&&(this.enableOverEvent=t),e===o6&&(this.enableOutEvent=t),e===a6&&(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:s6,srcEvent:e,pointerType:"mouse",target:e.target})}handleOutEvent(e){this.enableOutEvent&&"mouseout"===e.type&&this.callback({type:o6,srcEvent:e,pointerType:"mouse",target:e.target})}handleLeaveEvent(e){this.enableLeaveEvent&&"mouseleave"===e.type&&this.callback({type:a6,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:r6,srcEvent:e,pointerType:"mouse",target:e.target});break;case"mouseup":this.pressed=!1}}}const{KEY_EVENTS:Nye}=rR,l6="keydown";class Lye{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=Nye.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===l6&&(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:l6,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 u6="contextmenu";class Bye{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===u6&&(this.options.enable=t)}handleEvent(e){!this.options.enable||this.callback({type:u6,center:{x:e.clientX,y:e.clientY},srcEvent:e,pointerType:"mouse",target:e.target})}}const Vye={pointerdown:1,pointermove:2,pointerup:4,mousedown:1,mousemove:2,mouseup:4},d6={srcElement:"root",priority:0};class Zye{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({},d6,i):d6;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&&JH[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 Rye(e,this._onOtherEvent,{enable:!1}),this.moveInput=new Fye(e,this._onOtherEvent,{enable:!1}),this.keyInput=new Lye(e,this._onOtherEvent,{enable:!1,tabIndex:t.tabIndex}),this.contextmenuInput=new Bye(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=Mye[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=e6[e]||e;let c=a.get(l);c||(c=new Zye(this),a.set(l,c),c.recognizerName=Tye[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(e6[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=xye[t.type];i&&this.manager.emit(i,e)}_onOtherEvent(e){this.manager.emit(e.type,e)}}function ap(){}const h6={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:ap,onResize:ap,onViewStateChange:ap,onInteractionStateChange:ap,onBeforeRender:ap,onAfterRender:ap,onLoad:ap,onError:(n,e)=>jn.error(n)(),_onMetrics:null,getCursor:({isDragging:n})=>n?"grabbing":"grab",debug:!1,drawPickingColors:!1};class sM{constructor(e){e=K(K({},h6),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&&jn.warn("View state tracking is disabled. Use either `initialViewState` for auto update or `viewState` for manual update.")(),"IE"===(0,Rm.qs)()&&jn.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 aI({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&&nb.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&&jn.removed("onLayerHover","onHover")(),"onLayerClick"in e&&jn.removed("onLayerClick","onClick")(),e.initialViewState&&!Sb(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](K({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),sc(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 _ye({width:t,height:i,useDevicePixels:d,autoResizeDrawingBuffer:f,autoResizeViewport:!1,gl:r,onCreateContext:p=>qU(Lt(K(K({},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 w_e({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,oI(e,{enable:!0,copyState:!0})),this.tooltip=new F_e(this.canvas),Xu(e,{blend:!0,blendFunc:[770,771,1,771],polygonOffsetFill:!0,depthTest:!0,depthFunc:515}),this.props.onWebGLInitialized(e);const t=new FH;t.play(),this.animationLoop.attachTimeline(t),this.eventManager=new Jye(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 IU)this.eventManager.on(r,this._onEvent);this.viewManager=new y_e({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 __e(e,{deck:this,stats:this.stats,viewport:i,timeline:t}),this.effectManager=new S_e,this.deckRenderer=new T_e(e),this.deckPicker=new R_e(e),this.setProps(this.props),this._updateCanvasSize(),this.props.onLoad()}_drawLayers(e,t){const{gl:i}=this.layerManager.context;Xu(i,this.props.parameters),this.props.onBeforeRender({gl:i}),this.deckRenderer.renderLayers(K({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(),jn.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=Lt(K({},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=IU[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=Jf.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}}sM.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(PH)),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}},sM.defaultProps=h6,sM.VERSION=oye.VERSION;const oM={name:"project32",dependencies:[HP],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"},ive={pickingSelectedColor:null,pickingHighlightColor:new Uint8Array([0,255,255,255]),pickingActive:!1,pickingAttribute:!1},aM=K({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=ive){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}}),f6={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6};class _h{static get DRAW_MODE(){return f6}constructor(e={}){const{id:t=ea("geometry"),drawMode:i=f6.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?K({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,nt(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?(nt(!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 nt(Number.isFinite(i)),i}}const p6=()=>{},cve={10241:9987,10240:9729,10242:33071,10243:33071};function uve(n){return Math.pow(2,Math.ceil(Math.log2(n)))}function dve(n,e,t,i){return t===e.width&&i===e.height?e:(n.canvas.height=i,n.canvas.width=t,n.clearRect(0,0,n.canvas.width,n.canvas.height),n.drawImage(e,0,0,e.width,e.height,0,0,t,i),n.canvas)}function Db(n){return n&&(n.id||n.url)}function g6(n,e,t){for(let i=0;i0){const{mapping:i,xOffset:r,yOffset:s,rowHeight:o,canvasHeight:a}=function({icons:n,buffer:e,mapping:t={},xOffset:i=0,yOffset:r=0,rowHeight:s=0,canvasWidth:o}){let a=[];for(let l=0;lo&&(g6(t,a,r),i=0,r=s+r+e,s=0,a=[]),a.push({icon:c,xOffset:i}),i=i+p+e,s=Math.max(s,f)}}return a.length>0&&g6(t,a,r),{mapping:t,rowHeight:s,xOffset:i,yOffset:r,canvasWidth:o,canvasHeight:uve(s+r+e)}}({icons:t,buffer:this._buffer,canvasWidth:this._canvasWidth,mapping:this._mapping,rowHeight:this._rowHeight,xOffset:this._xOffset,yOffset:this._yOffset});this._rowHeight=o,this._mapping=i,this._xOffset=r,this._yOffset=s,this._canvasHeight=a,this._texture||(this._texture=new na(this.gl,{width:this._canvasWidth,height:this._canvasHeight,parameters:cve})),this._texture.height!==this._canvasHeight&&(this._texture=function(n,e,t,i){const r=e.width,s=e.height,o=u4(e,{width:t,height:i});return function(n,e,t={}){const{sourceX:i=0,sourceY:r=0,targetMipmaplevel:s=0,targetInternalFormat:o=6408}=t;let{targetX:a,targetY:l,targetZ:c,width:d,height:f}=t;const{framebuffer:p,deleteFramebuffer:g}=tb(n);nt(p);const{gl:_,handle:y}=p,v=void 0!==a||void 0!==l||void 0!==c;a=a||0,l=l||0,c=c||0;const C=_.bindFramebuffer(36160,y);nt(e);let w=null;if(e instanceof ep&&(w=e,d=Number.isFinite(d)?d:w.width,f=Number.isFinite(f)?f:w.height,w.bind(0),e=w.target),v)switch(e){case 3553:case 34067:_.copyTexSubImage2D(e,s,a,l,i,r,d,f);break;case 35866:case 32879:eo(_).copyTexSubImage3D(e,s,a,l,c,i,r,d,f)}else _.copyTexImage2D(e,s,o,i,r,d,f,0);w&&w.unbind(),_.bindFramebuffer(36160,C||null),g&&p.delete()}(e,o,{targetY:0,width:r,height:s}),e.delete(),o}(0,this._texture,this._canvasWidth,this._canvasHeight)),this.onUpdate(),this._loadIcons(t)}}_loadIcons(e){const t=this._canvas.getContext("2d");for(const i of e)this._pendingCount++,wb(i.url,nR,this._loadOptions).then(r=>{const s=Db(i),{x:o,y:a,width:l,height:c}=this._mapping[s],d=dve(t,r,l,c);this._texture.setSubImageData({data:d,x:o,y:a,width:l,height:c}),this._texture.generateMipmap(),this.onUpdate()}).catch(r=>{this.onError({url:i.url,source:i.source,sourceIndex:i.sourceIndex,loadOptions:this._loadOptions,error:r})}).finally(()=>{this._pendingCount--})}}const m6=[0,0,0,255],mve={iconAtlas:{type:"image",value:null,async:!0},iconMapping:{type:"object",value:{},async:!0},sizeScale:{type:"number",value:1,min:0},billboard:!0,sizeUnits:"pixels",sizeMinPixels:{type:"number",min:0,value:0},sizeMaxPixels:{type:"number",min:0,value:Number.MAX_SAFE_INTEGER},alphaCutoff:{type:"number",value:.05,min:0,max:1},getPosition:{type:"accessor",value:n=>n.position},getIcon:{type:"accessor",value:n=>n.icon},getColor:{type:"accessor",value:m6},getSize:{type:"accessor",value:1},getAngle:{type:"accessor",value:0},getPixelOffset:{type:"accessor",value:[0,0]},onIconError:{type:"function",value:null,compare:!1,optional:!0}};let _ve=(()=>{class n extends Eb{getShaders(){return super.getShaders({vs:"#define SHADER_NAME icon-layer-vertex-shader\n\nattribute vec2 positions;\n\nattribute vec3 instancePositions;\nattribute vec3 instancePositions64Low;\nattribute float instanceSizes;\nattribute float instanceAngles;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\nattribute vec4 instanceIconFrames;\nattribute float instanceColorModes;\nattribute vec2 instanceOffsets;\nattribute vec2 instancePixelOffset;\n\nuniform float sizeScale;\nuniform vec2 iconsTextureDim;\nuniform float sizeMinPixels;\nuniform float sizeMaxPixels;\nuniform bool billboard;\n\nvarying float vColorMode;\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\nvarying vec2 uv;\n\nvec2 rotate_by_angle(vec2 vertex, float angle) {\n float angle_radian = angle * PI / 180.0;\n float cos_angle = cos(angle_radian);\n float sin_angle = sin(angle_radian);\n mat2 rotationMatrix = mat2(cos_angle, -sin_angle, sin_angle, cos_angle);\n return rotationMatrix * vertex;\n}\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n geometry.uv = positions;\n geometry.pickingColor = instancePickingColors;\n uv = positions;\n\n vec2 iconSize = instanceIconFrames.zw;\n float sizePixels = clamp(\n project_size_to_pixel(instanceSizes * sizeScale), \n sizeMinPixels, sizeMaxPixels\n );\n float instanceScale = iconSize.y == 0.0 ? 0.0 : sizePixels / iconSize.y;\n vec2 pixelOffset = positions / 2.0 * iconSize + instanceOffsets;\n pixelOffset = rotate_by_angle(pixelOffset, instanceAngles) * instanceScale;\n pixelOffset += instancePixelOffset;\n pixelOffset.y *= -1.0;\n\n if (billboard) {\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, vec3(0.0), geometry.position);\n vec3 offset = vec3(pixelOffset, 0.0);\n DECKGL_FILTER_SIZE(offset, geometry);\n gl_Position.xy += project_pixel_size_to_clipspace(offset.xy);\n\n } else {\n vec3 offset_common = vec3(project_pixel_size(pixelOffset), 0.0);\n DECKGL_FILTER_SIZE(offset_common, geometry);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, offset_common, geometry.position); \n }\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n vTextureCoords = mix(\n instanceIconFrames.xy,\n instanceIconFrames.xy + iconSize,\n (positions.xy + 1.0) / 2.0\n ) / iconsTextureDim;\n\n vColor = instanceColors;\n DECKGL_FILTER_COLOR(vColor, geometry);\n\n vColorMode = instanceColorModes;\n}\n",fs:"#define SHADER_NAME icon-layer-fragment-shader\n\nprecision highp float;\n\nuniform float opacity;\nuniform sampler2D iconsTexture;\nuniform float alphaCutoff;\n\nvarying float vColorMode;\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\nvarying vec2 uv;\n\nvoid main(void) {\n geometry.uv = uv;\n\n vec4 texColor = texture2D(iconsTexture, vTextureCoords);\n vec3 color = mix(texColor.rgb, vColor.rgb, vColorMode);\n float a = texColor.a * opacity * vColor.a;\n\n if (a < alphaCutoff) {\n discard;\n }\n\n gl_FragColor = vec4(color, a);\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:[oM,aM]})}initializeState(){this.state={iconManager:new gve(this.context.gl,{onUpdate:this._onUpdate.bind(this),onError:this._onError.bind(this)})},this.getAttributeManager().addInstanced({instancePositions:{size:3,type:5130,fp64:this.use64bitPositions(),transition:!0,accessor:"getPosition"},instanceSizes:{size:1,transition:!0,accessor:"getSize",defaultValue:1},instanceOffsets:{size:2,accessor:"getIcon",transform:this.getInstanceOffset},instanceIconFrames:{size:4,accessor:"getIcon",transform:this.getInstanceIconFrame},instanceColorModes:{size:1,type:5121,accessor:"getIcon",transform:this.getInstanceColorMode},instanceColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:!0,accessor:"getColor",defaultValue:m6},instanceAngles:{size:1,transition:!0,accessor:"getAngle"},instancePixelOffset:{size:2,transition:!0,accessor:"getPixelOffset"}})}updateState({oldProps:t,props:i,changeFlags:r}){super.updateState({props:i,oldProps:t,changeFlags:r});const s=this.getAttributeManager(),{iconAtlas:o,iconMapping:a,data:l,getIcon:c}=i,{iconManager:d}=this.state;d.setProps({loadOptions:i.loadOptions});let f=!1;if(o||this.internalState.isAsyncPropLoading("iconAtlas")?(t.iconAtlas!==i.iconAtlas&&d.setProps({iconAtlas:o,autoPacking:!1}),t.iconMapping!==i.iconMapping&&(d.setProps({iconMapping:a}),f=!0)):d.setProps({autoPacking:!0}),(r.dataChanged||r.updateTriggersChanged&&(r.updateTriggersChanged.all||r.updateTriggersChanged.getIcon))&&d.setProps({data:l,getIcon:c}),f&&(s.invalidate("instanceOffsets"),s.invalidate("instanceIconFrames"),s.invalidate("instanceColorModes")),r.extensionsChanged){var g;const{gl:_}=this.context;null===(g=this.state.model)||void 0===g||g.delete(),this.state.model=this._getModel(_),s.invalidateAll()}}get isLoaded(){return super.isLoaded&&this.state.iconManager.isLoaded}finalizeState(){super.finalizeState(),this.state.iconManager.finalize()}draw({uniforms:t}){const{sizeScale:i,sizeMinPixels:r,sizeMaxPixels:s,sizeUnits:o,billboard:a,alphaCutoff:l}=this.props,{iconManager:c}=this.state,{viewport:d}=this.context,f=c.getTexture();f&&this.state.model.setUniforms(t).setUniforms({iconsTexture:f,iconsTextureDim:[f.width,f.height],sizeScale:i*("pixels"===o?d.metersPerPixel:1),sizeMinPixels:r,sizeMaxPixels:s,billboard:a,alphaCutoff:l}).draw()}_getModel(t){return new Mm(t,Lt(K({},this.getShaders()),{id:this.props.id,geometry:new _h({drawMode:6,attributes:{positions:{size:2,value:new Float32Array([-1,-1,-1,1,1,1,1,-1])}}}),isInstanced:!0}))}_onUpdate(){this.setNeedsRedraw()}_onError(t){const{onIconError:i}=this.getCurrentLayer().props;i?i(t):jn.error(t.error)()}getInstanceOffset(t){const i=this.state.iconManager.getIconMapping(t);return[i.width/2-i.anchorX||0,i.height/2-i.anchorY||0]}getInstanceColorMode(t){return this.state.iconManager.getIconMapping(t).mask?1:0}getInstanceIconFrame(t){const i=this.state.iconManager.getIconMapping(t);return[i.x||0,i.y||0,i.width||0,i.height||0]}}return n.layerName="IconLayer",n.defaultProps=mve,n})();const y6=[],vve={getIconOffsets:{type:"accessor",value:n=>n.offsets},alphaCutoff:.001,smoothing:.1,outlineWidth:0,outlineColor:{type:"color",value:[0,0,0,255]}};let bve=(()=>{class n extends _ve{getShaders(){return Lt(K({},super.getShaders()),{fs:"#define SHADER_NAME multi-icon-layer-fragment-shader\n\nprecision highp float;\n\nuniform float opacity;\nuniform sampler2D iconsTexture;\nuniform float gamma;\nuniform bool sdf;\nuniform float alphaCutoff;\nuniform float buffer;\nuniform float outlineBuffer;\nuniform vec4 outlineColor;\n\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\nvarying vec2 uv;\n\nvoid main(void) {\n geometry.uv = uv;\n\n if (!picking_uActive) {\n float alpha = texture2D(iconsTexture, vTextureCoords).a;\n vec4 color = vColor;\n if (sdf) {\n float distance = alpha;\n alpha = smoothstep(buffer - gamma, buffer + gamma, distance);\n\n if (outlineBuffer > 0.0) {\n float inFill = alpha;\n float inBorder = smoothstep(outlineBuffer - gamma, outlineBuffer + gamma, distance);\n color = mix(outlineColor, vColor, inFill);\n alpha = inBorder;\n }\n }\n float a = alpha * color.a;\n \n if (a < alphaCutoff) {\n discard;\n }\n\n gl_FragColor = vec4(color.rgb, a * opacity);\n }\n\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n"})}initializeState(){super.initializeState(),this.getAttributeManager().addInstanced({instanceOffsets:{size:2,accessor:"getIconOffsets"},instancePickingColors:{type:5121,size:3,accessor:(i,{index:r,target:s})=>this.encodePickingColor(r,s)}})}updateState(t){super.updateState(t);const{props:i,oldProps:r}=t;let{outlineColor:s}=i;s!==r.outlineColor&&(s=s.map(o=>o/255),s[3]=Number.isFinite(s[3])?s[3]:1,this.setState({outlineColor:s})),!i.sdf&&i.outlineWidth&&jn.warn("".concat(this.id,": fontSettings.sdf is required to render outline"))()}draw(t){const{sdf:i,smoothing:r,outlineWidth:s}=this.props,{outlineColor:o}=this.state;t.uniforms=Lt(K({},t.uniforms),{buffer:.75,outlineBuffer:s?Math.max(r,.75*(1-s)):-1,gamma:r,sdf:Boolean(i),outlineColor:o}),super.draw(t)}getInstanceOffset(t){return t?Array.from(t).map(i=>super.getInstanceOffset(i)):y6}getInstanceColorMode(t){return 1}getInstanceIconFrame(t){return t?Array.from(t).map(i=>super.getInstanceIconFrame(i)):y6}}return n.layerName="MultiIconLayer",n.defaultProps=vve,n})();var Cve=ze(2),wve=ze.n(Cve);const Sve=[];function Mve(n){return Math.pow(2,Math.ceil(Math.log2(n)))}function v6(n,e,t,i){let r=0;for(let s=e;si&&(oa){let f=v6(n,a,l,r);c+f>i&&(oi&&(f=b6(n,a,l,i,r,s),o=s[s.length-1])),a=l,c+=f}}(n,r,s,t,i,o),o}function Dve(n,e,t,i,r,s){let o=0,a=0;for(let l=e;l0,d=[0,0],f=[];let p=0,g=0,_=0;for(let y=0;y<=s;y++){const v=n[y];if(("\n"===v||y===s)&&(_=y),_>g){const C=c?Ave(n,t,i,r,g,_):Sve;for(let w=0;w<=C.length;w++){const x=0===w?g:C[w-1],N=wi===e);t>=0&&this._order.splice(t,1)}_appendOrder(e){this._order.push(e)}}(3),Fve=["fontFamily","fontWeight","characterSet","fontSize","sdf","buffer","cutoff","radius"];function Lve(n,e){for(let t=0;t{o in e&&(this.props[o]=e[o])});const t=this._key;this._key=this._getKey();const i=function(n,e){const t=aR.get(n);if(!t)return e;const i=[];let s=Object.keys(t.mapping);s=new Set(s);let o=e;return o instanceof Array&&(o=new Set(o)),o.forEach(a=>{s.has(a)||i.push(a)}),i}(this._key,this.props.characterSet),r=aR.get(this._key);if(r&&0===i.length)return void(this._key!==t&&(this._atlas=r));const s=this._generateFontAtlas(this._key,i,r);this._atlas=s,aR.set(this._key,s)}_generateFontAtlas(e,t,i){const{fontFamily:r,fontWeight:s,fontSize:o,buffer:a,sdf:l,radius:c,cutoff:d}=this.props;let f=i&&i.data;f||(f=document.createElement("canvas"),f.width=1024);const p=f.getContext("2d");I6(p,r,o,s);const{mapping:g,canvasHeight:_,xOffset:y,yOffset:v}=function({characterSet:n,getFontWidth:e,fontHeight:t,buffer:i,maxCanvasWidth:r,mapping:s={},xOffset:o=0,yOffset:a=0}){let l=0,c=o,d=0;for(const p of n)if(!s[p]){const g=e(p,d++);c+g+2*i>r&&(c=0,l++),s[p]={x:c+i,y:a+l*(t+2*i)+i,width:g,height:t},c+=g+2*i}const f=t+2*i;return{mapping:s,xOffset:c,yOffset:a+l*f,canvasHeight:Mve(a+(l+1)*f)}}(K({getFontWidth:C=>p.measureText(C).width,fontHeight:1.2*o,buffer:a,characterSet:t,maxCanvasWidth:1024},i&&{mapping:i.mapping,xOffset:i.xOffset,yOffset:i.yOffset}));if(f.height!==_){const C=p.getImageData(0,0,f.width,f.height);f.height=_,p.putImageData(C,0,0)}if(I6(p,r,o,s),l){const C=new(wve())(o,a,c,d,r,s),w=p.getImageData(0,0,C.size,C.size);for(const x of t)Lve(C.draw(x),w),p.putImageData(w,g[x].x-a,g[x].y+a)}else for(const C of t)p.fillText(C,g[C].x,g[C].y+.9*o);return{xOffset:y,yOffset:v,mapping:g,data:f,width:f.width,height:f.height}}_getKey(){const{fontFamily:e,fontWeight:t,fontSize:i,buffer:r,sdf:s,radius:o,cutoff:a}=this.props;return s?"".concat(e," ").concat(t," ").concat(i," ").concat(r," ").concat(o," ").concat(a):"".concat(e," ").concat(t," ").concat(i," ").concat(r)}}const jve={billboard:!0,sizeScale:1,sizeUnits:"pixels",sizeMinPixels:0,sizeMaxPixels:Number.MAX_SAFE_INTEGER,padding:{type:"array",value:[0,0,0,0]},getPosition:{type:"accessor",value:n=>n.position},getSize:{type:"accessor",value:1},getAngle:{type:"accessor",value:0},getPixelOffset:{type:"accessor",value:[0,0]},getBoundingRect:{type:"accessor",value:[0,0,0,0]},getFillColor:{type:"accessor",value:[0,0,0,255]},getLineColor:{type:"accessor",value:[0,0,0,255]},getLineWidth:{type:"accessor",value:1}};let Uve=(()=>{class n extends Eb{getShaders(){return super.getShaders({vs:"#define SHADER_NAME text-background-layer-vertex-shader\n\nattribute vec2 positions;\n\nattribute vec3 instancePositions;\nattribute vec3 instancePositions64Low;\nattribute vec4 instanceRects;\nattribute float instanceSizes;\nattribute float instanceAngles;\nattribute vec2 instancePixelOffsets;\nattribute float instanceLineWidths;\nattribute vec4 instanceFillColors;\nattribute vec4 instanceLineColors;\nattribute vec3 instancePickingColors;\n\nuniform bool billboard;\nuniform float opacity;\nuniform float sizeScale;\nuniform float sizeMinPixels;\nuniform float sizeMaxPixels;\nuniform vec4 padding;\n\nvarying vec4 vFillColor;\nvarying vec4 vLineColor;\nvarying float vLineWidth;\nvarying vec2 uv;\nvarying vec2 dimensions;\n\nvec2 rotate_by_angle(vec2 vertex, float angle) {\n float angle_radian = radians(angle);\n float cos_angle = cos(angle_radian);\n float sin_angle = sin(angle_radian);\n mat2 rotationMatrix = mat2(cos_angle, -sin_angle, sin_angle, cos_angle);\n return rotationMatrix * vertex;\n}\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n geometry.uv = positions;\n geometry.pickingColor = instancePickingColors;\n uv = positions;\n vLineWidth = instanceLineWidths;\n float sizePixels = clamp(\n project_size_to_pixel(instanceSizes * sizeScale),\n sizeMinPixels, sizeMaxPixels\n );\n\n dimensions = instanceRects.zw * sizePixels + padding.xy + padding.zw;\n\n vec2 pixelOffset = (positions * instanceRects.zw + instanceRects.xy) * sizePixels + mix(-padding.xy, padding.zw, positions);\n pixelOffset = rotate_by_angle(pixelOffset, instanceAngles);\n pixelOffset += instancePixelOffsets;\n pixelOffset.y *= -1.0;\n\n if (billboard) {\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, vec3(0.0), geometry.position);\n vec3 offset = vec3(pixelOffset, 0.0);\n DECKGL_FILTER_SIZE(offset, geometry);\n gl_Position.xy += project_pixel_size_to_clipspace(offset.xy);\n } else {\n vec3 offset_common = vec3(project_pixel_size(pixelOffset), 0.0);\n DECKGL_FILTER_SIZE(offset_common, geometry);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, offset_common, geometry.position);\n }\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n vFillColor = vec4(instanceFillColors.rgb, instanceFillColors.a * opacity);\n DECKGL_FILTER_COLOR(vFillColor, geometry);\n vLineColor = vec4(instanceLineColors.rgb, instanceLineColors.a * opacity);\n DECKGL_FILTER_COLOR(vLineColor, geometry);\n}\n",fs:"#define SHADER_NAME text-background-layer-fragment-shader\n\nprecision highp float;\n\nuniform bool stroked;\n\nvarying vec4 vFillColor;\nvarying vec4 vLineColor;\nvarying float vLineWidth;\nvarying vec2 uv;\nvarying vec2 dimensions;\n\nvoid main(void) {\n geometry.uv = uv;\n\n vec2 pixelPosition = uv * dimensions;\n if (stroked) {\n float distToEdge = min(\n min(pixelPosition.x, dimensions.x - pixelPosition.x),\n min(pixelPosition.y, dimensions.y - pixelPosition.y)\n );\n float isBorder = smoothedge(distToEdge, vLineWidth);\n gl_FragColor = mix(vFillColor, vLineColor, isBorder);\n } else {\n gl_FragColor = vFillColor;\n }\n\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:[oM,aM]})}initializeState(){this.getAttributeManager().addInstanced({instancePositions:{size:3,type:5130,fp64:this.use64bitPositions(),transition:!0,accessor:"getPosition"},instanceSizes:{size:1,transition:!0,accessor:"getSize",defaultValue:1},instanceAngles:{size:1,transition:!0,accessor:"getAngle"},instanceRects:{size:4,accessor:"getBoundingRect"},instancePixelOffsets:{size:2,transition:!0,accessor:"getPixelOffset"},instanceFillColors:{size:4,transition:!0,normalized:!0,type:5121,accessor:"getFillColor",defaultValue:[0,0,0,255]},instanceLineColors:{size:4,transition:!0,normalized:!0,type:5121,accessor:"getLineColor",defaultValue:[0,0,0,255]},instanceLineWidths:{size:1,transition:!0,accessor:"getLineWidth",defaultValue:1}})}updateState({props:t,oldProps:i,changeFlags:r}){if(super.updateState({props:t,oldProps:i,changeFlags:r}),r.extensionsChanged){var s;const{gl:o}=this.context;null===(s=this.state.model)||void 0===s||s.delete(),this.state.model=this._getModel(o),this.getAttributeManager().invalidateAll()}}draw({uniforms:t}){const{viewport:i}=this.context,{billboard:r,sizeScale:s,sizeUnits:o,sizeMinPixels:a,sizeMaxPixels:l,getLineWidth:c}=this.props;let{padding:d}=this.props;const f="pixels"===o?i.metersPerPixel:1;d.length<4&&(d=[d[0],d[1],d[0],d[1]]),this.state.model.setUniforms(t).setUniforms({billboard:r,stroked:Boolean(c),padding:d,sizeScale:s*f,sizeMinPixels:a,sizeMaxPixels:l}).draw()}_getModel(t){return new Mm(t,Lt(K({},this.getShaders()),{id:this.props.id,geometry:new _h({drawMode:6,vertexCount:4,attributes:{positions:{size:2,value:new Float32Array([0,0,1,0,1,1,0,1])}}}),isInstanced:!0}))}}return n.layerName="TextBackgroundLayer",n.defaultProps=jve,n})();const P6={fontSize:64,buffer:4,sdf:!1,radius:12,cutoff:.25,smoothing:.1},R6={start:1,middle:0,end:-1},k6={top:1,center:0,bottom:-1},lR=[0,0,0,255],$ve=["fontSize","buffer","sdf","radius","cutoff"],Gve={billboard:!0,sizeScale:1,sizeUnits:"pixels",sizeMinPixels:0,sizeMaxPixels:Number.MAX_SAFE_INTEGER,background:!1,getBackgroundColor:{type:"accessor",value:[255,255,255,255]},getBorderColor:{type:"accessor",value:lR},getBorderWidth:{type:"accessor",value:0},backgroundPadding:{type:"array",value:[0,0,0,0]},characterSet:{type:"object",value:w6},fontFamily:E6,fontWeight:"normal",lineHeight:1,outlineWidth:{type:"number",value:0,min:0},outlineColor:{type:"color",value:lR},fontSettings:{},wordBreak:"break-word",maxWidth:{type:"number",value:-1},getText:{type:"accessor",value:n=>n.text},getPosition:{type:"accessor",value:n=>n.position},getColor:{type:"accessor",value:lR},getSize:{type:"accessor",value:32},getAngle:{type:"accessor",value:0},getTextAnchor:{type:"accessor",value:"middle"},getAlignmentBaseline:{type:"accessor",value:"center"},getPixelOffset:{type:"accessor",value:[0,0]},backgroundColor:{deprecatedFor:["background","getBackgroundColor"]}};let Wve=(()=>{class n extends MH{initializeState(){this.state={styleVersion:0,fontAtlasManager:new Bve}}updateState({props:t,oldProps:i,changeFlags:r}){const o=this.state.characterSet;(r.dataChanged||r.updateTriggersChanged&&(r.updateTriggersChanged.all||r.updateTriggersChanged.getText))&&this._updateText();const a=o!==this.state.characterSet||this._fontChanged(i,t);a&&this._updateFontAtlas(i,t),(a||t.lineHeight!==i.lineHeight||t.wordBreak!==i.wordBreak||t.maxWidth!==i.maxWidth)&&this.setState({styleVersion:this.state.styleVersion+1})}getPickingInfo({info:t}){return t.object=t.index>=0?this.props.data[t.index]:null,t}_updateFontAtlas(t,i){const{fontSettings:r,fontFamily:s,fontWeight:o}=i,{fontAtlasManager:a,characterSet:l}=this.state;a.setProps(Lt(K(K({},P6),r),{characterSet:l,fontFamily:s,fontWeight:o}))}_fontChanged(t,i){if(t.fontFamily!==i.fontFamily||t.fontWeight!==i.fontWeight)return!0;if(t.fontSettings===i.fontSettings)return!1;const r=t.fontSettings||{},s=i.fontSettings||{};return $ve.some(o=>r[o]!==s[o])}_updateText(){const{data:t,characterSet:i}=this.props,r=t.attributes&&t.attributes.getText;let a,{getText:s}=this.props,{startIndices:o}=t;const l="auto"===i&&new Set;if(r&&o){const{texts:c,characterCount:d}=function({value:n,length:e,stride:t,offset:i,startIndices:r,characterSet:s}){const o=n.BYTES_PER_ELEMENT,a=t?t/o:1,l=i?i/o:0,c=r[e]||Math.ceil((n.length-l)/a),d=s&&new Set,f=new Array(e);let p=n;if(a>1||l>0){p=new n.constructor(c);for(let g=0;gc[p]}else{const{iterable:c,objectInfo:d}=SS(t);o=[0],a=0;for(const f of c){d.index++;const p=Array.from(s(f,d)||"");l&&p.forEach(l.add,l),a+=p.length,o.push(a)}}this.setState({getText:s,startIndices:o,numInstances:a,characterSet:l||i})}getBoundingRect(t,i){const r=this.state.fontAtlasManager.mapping,{getText:s}=this.state,{wordBreak:o,maxWidth:a,lineHeight:l,getTextAnchor:c,getAlignmentBaseline:d}=this.props,f=s(t,i)||"",{size:[p,g]}=C6(f,l,o,a,r);return[(R6["function"==typeof c?c(t,i):c]-1)*p/2,(k6["function"==typeof d?d(t,i):d]-1)*g/2,p,g]}getIconOffsets(t,i){const r=this.state.fontAtlasManager.mapping,{getText:s}=this.state,{wordBreak:o,maxWidth:a,lineHeight:l,getTextAnchor:c,getAlignmentBaseline:d}=this.props,f=s(t,i)||"",{x:p,y:g,rowWidth:_,size:[y,v]}=C6(f,l,o,a,r),C=R6["function"==typeof c?c(t,i):c],w=k6["function"==typeof d?d(t,i):d],x=p.length,N=new Array(2*x);let V=0;for(let U=0;Ut*e/255)}const uR={name:"lights",vs:F6,fs:F6,getUniforms:function N6(n=qve){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?cR(n):[0,0,0],e.forEach((r,s)=>{i[`lighting_uPointLight[${s}].color`]=cR(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`]=cR(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 N6({lightSources:e})}return{}},defines:{MAX_LIGHTS:3}},Xve={};const Zve={name:"phong-lighting",dependencies:[uR],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=Xve){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}}},dR=Math.PI/180,lM=new Float32Array(16),V6=new Float32Array(12);function z6(n,e,t){const i=e[0]*dR,r=e[1]*dR,s=e[2]*dR,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 j6(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 U6={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 y;g?(lM.set(a),y=j6(lM)):(y=V6,z6(y,r,s),y.set(o,9)),n.value=new Float32Array(y)}else{let y=e*n.size;const{iterable:v,objectInfo:C}=SS(i,e,t);for(const w of v){let x;C.index++,g?(lM.set(c?a:a(w,C)),x=j6(lM)):(x=V6,z6(x,f?r:r(w,C),d?s:s(w,C)),x.set(p?o:o(w,C),9)),_[y++]=x[0],_[y++]=x[1],_[y++]=x[2],_[y++]=x[3],_[y++]=x[4],_[y++]=x[5],_[y++]=x[6],_[y++]=x[7],_[y++]=x[8],_[y++]=x[9],_[y++]=x[10],_[y++]=x[11]}}}};function H6(n,e){return e===qn.CARTESIAN||e===qn.METER_OFFSETS||e===qn.DEFAULT&&!n.isGeospatial}function $6(n,e){(n.COLOR_0||n.colors)&&e||(n.colors={constant:!0,value:new Float32Array([1,1,1])}),jn.assert(n.positions||n.POSITION,'no "postions" or "POSITION" attribute in mesh')}function ebe(n,e){if(n.attributes)return $6(n.attributes,e),n instanceof _h?n:new _h(n);if(n.positions||n.POSITION)return $6(n,e),new _h({attributes:n});throw Error("Invalid mesh")}const tbe={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 nbe=(()=>{class n extends Eb{getShaders(){const t=!In(this.context.gl),i={};return _I(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:[oM,Zve,aM],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:U6}),this.setState({emptyTexture:new na(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||H6(i,s),flatShading:!this.state.hasNormals}).draw()}getModel(t){const i=new Mm(this.context.gl,Lt(K({},this.getShaders()),{id:this.props.id,geometry:ebe(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=tbe,n})();const G6={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:[uR]};class Fm{constructor(e={}){const{id:t}=e;this.id=t||ea(this.constructor.name),this.display=!0,this.position=new to,this.rotation=new to,this.scale=new to(1,1,1),this.matrix=new $t,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 nt(3===e.length,"setPosition requires vector argument"),this.position=e,this}setRotation(e){return nt(3===e.length,"setRotation requires vector argument"),this.rotation=e,this}setScale(e){return nt(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){nt(e),t=t||this.matrix;const i=new $t(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 Ob extends Fm{constructor(e={}){e=Array.isArray(e)?{children:e}:e;const{children:t=[]}=e;vt.assert(t.every(i=>i instanceof Fm),"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 $t}={}){const i=new $t(t).multiplyRight(this.matrix);for(const r of this.children)r instanceof Ob?r.traverse(e,{worldMatrix:i}):e(r,{worldMatrix:i})}}function W6(){var n=new ia(4);return ia!=Float32Array&&(n[0]=0,n[1]=0,n[2]=0),n[3]=1,n}function q6(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 Y6(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 K6=w5,_be=function(){var n=m4(),e=_4(1,0,0),t=_4(0,1,0);return function(i,r,s){var o=y4(r,s);return o<-.999999?(wS(n,e,r),function(n){return Math.hypot(n[0],n[1],n[2])}(n)<1e-6&&wS(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),q6(i,n,Math.PI),i):o>.999999?(i[0]=0,i[1]=0,i[2]=0,i[3]=1,i):(wS(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))}}();W6(),W6(),function(){var n=new ia(9);ia!=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 ybe=[0,0,0,1],bbe={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Cbe={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function J6(n){if(!n._animation){const e=Cbe[n.componentType],t=bbe[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 q6(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]=ks(e)}get y(){return this[1]}set y(e){this[1]=ks(e)}get z(){return this[2]}set z(e){this[2]=ks(e)}get w(){return this[3]}set w(e){this[3]=ks(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 _be(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 Qu(!t),Y6(this,this,e),this.check()}multiplyLeft(e,t){return Qu(!t),Y6(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 K6(this,this,e),this.check()}slerp(e,t,i){switch(arguments.length){case 1:({start:e=ybe,target:t,ratio:i}=arguments[0]);break;case 2:[t,i]=arguments,e=this}return function(n,e,t,i){var p,g,_,y,v,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>Kc?(p=Math.acos(g),_=Math.sin(p),y=Math.sin((1-i)*p)/_,v=Math.sin(i*p)/_):(y=1-i,v=i),n[0]=y*r+v*l,n[1]=y*s+v*c,n[2]=y*o+v*d,n[3]=y*a+v*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),CS(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 Abe{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:vt.warn(`Bad animation path ${s}`)()}nt(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){hR.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:J6(e.accessors[a]),interpolation:l,output:J6(e.accessors[c])})),o=t.channels.map(({sampler:a,target:l})=>({sampler:s[a],target:e.nodes[l.node],path:l.path}));return new Abe({name:r,channels:o})})}animate(e){this.setTime(e)}setTime(e){this.animations.forEach(t=>t.animate(e))}getAnimations(){return this.animations}}class Obe extends Fm{constructor(e,t={}){super(t),this.onBeforeRender=null,this.AfterRender=null,e instanceof Mm?(this.model=e,this._setModelNodeProps(t)):this.model=new Mm(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 Ibe{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},_I(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 na(this.gl,K({id:e.name||e.id,parameters:K(K({},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&&(vt.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 e8(n,e){return In(n)?`#version 300 es\n${e}`:e}const Fbe={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Nbe={modelOptions:{},pbrDebug:!1,imageBasedLightingEnvironment:null,lights:!0,useTangents:!1};class Lbe{constructor(e,t={}){this.gl=e,this.options=Object.assign({},Nbe,t)}instantiate(e){return this.gltf=e,(e.scenes||[]).map(i=>this.createScene(i))}createAnimator(){return Array.isArray(this.gltf.animations)?new Dbe(this.gltf):null}createScene(e){const i=(e.nodes||[]).map(s=>this.createNode(s));return new Ob({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 Ob({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 $t).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 Ob({id:e.name||e.id,children:i});e._mesh=r}return e._mesh}getVertexCount(e){vt.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 Ibe(n,e);vt.info(4,"createGLTFModel defines: ",a.defines)();const l=[];l.push(...a.generatedTextures),l.push(...Object.values(s).map(d=>d.buffer));const c=new Obe(n,Object.assign({id:t,drawMode:i,vertexCount:r,modules:[G6],defines:a.defines,parameters:a.parameters,vs:e8(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:e8(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))),vt.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 Ai(this.gl,{id:`from-${i.id}`,data:i.data||e.value,target:t})),i.lumaBuffers[t]}createAccessor(e,t){return new ta({buffer:t,offset:e.byteOffset||0,stride:e.bufferView.byteStride||0,type:e.componentType,size:Fbe[e.type]})}createSampler(e){return e}needsPOT(){return!1}}function t8(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 Nm(i,this.metadata)}selectAt(...e){const t=e.map(i=>this.fields[i]).filter(Boolean);return new Nm(t,this.metadata)}assign(e){let t,i=this.metadata;if(e instanceof Nm){const o=e;t=o.fields,i=s8(s8(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 Nm(s,i)}}function s8(n,e){return new Map([...n||new Map,...e||new Map])}let cr,o8,a8,l8,c8,u8,d8,h8;!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"}(cr||(cr={}));class fR{static isNull(e){return e&&e.typeId===cr.Null}static isInt(e){return e&&e.typeId===cr.Int}static isFloat(e){return e&&e.typeId===cr.Float}static isBinary(e){return e&&e.typeId===cr.Binary}static isUtf8(e){return e&&e.typeId===cr.Utf8}static isBool(e){return e&&e.typeId===cr.Bool}static isDecimal(e){return e&&e.typeId===cr.Decimal}static isDate(e){return e&&e.typeId===cr.Date}static isTime(e){return e&&e.typeId===cr.Time}static isTimestamp(e){return e&&e.typeId===cr.Timestamp}static isInterval(e){return e&&e.typeId===cr.Interval}static isList(e){return e&&e.typeId===cr.List}static isStruct(e){return e&&e.typeId===cr.Struct}static isUnion(e){return e&&e.typeId===cr.Union}static isFixedSizeBinary(e){return e&&e.typeId===cr.FixedSizeBinary}static isFixedSizeList(e){return e&&e.typeId===cr.FixedSizeList}static isMap(e){return e&&e.typeId===cr.Map}static isDictionary(e){return e&&e.typeId===cr.Dictionary}get typeId(){return cr.NONE}compareTo(e){return this===e}}Symbol,Symbol,o8=Symbol.toStringTag;class Lm extends fR{constructor(e,t){super(),sn(this,"isSigned",void 0),sn(this,"bitWidth",void 0),this.isSigned=e,this.bitWidth=t}get typeId(){return cr.Int}get[o8](){return"Int"}toString(){return`${this.isSigned?"I":"Ui"}nt${this.bitWidth}`}}class qbe extends Lm{constructor(){super(!0,8)}}class Ybe extends Lm{constructor(){super(!0,16)}}class Xbe extends Lm{constructor(){super(!0,32)}}class Kbe extends Lm{constructor(){super(!1,8)}}class Zbe extends Lm{constructor(){super(!1,16)}}class Qbe extends Lm{constructor(){super(!1,32)}}a8=Symbol.toStringTag;class f8 extends fR{constructor(e){super(),sn(this,"precision",void 0),this.precision=e}get typeId(){return cr.Float}get[a8](){return"Float"}toString(){return`Float${this.precision}`}}class Jbe extends f8{constructor(){super(32)}}class e0e extends f8{constructor(){super(64)}}Symbol,Symbol,l8=Symbol.toStringTag,c8=Symbol.toStringTag,u8=Symbol.toStringTag,d8=Symbol.toStringTag,h8=Symbol.toStringTag;class t0e extends fR{constructor(e,t){super(),sn(this,"listSize",void 0),sn(this,"children",void 0),this.listSize=e,this.children=[t]}get typeId(){return cr.FixedSizeList}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get[h8](){return"FixedSizeList"}toString(){return`FixedSizeList[${this.listSize}]<${this.valueType}>`}}class uM{constructor(e,t,i=!1,r=new Map){sn(this,"name",void 0),sn(this,"type",void 0),sn(this,"nullable",void 0),sn(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 uM(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 p8(n,e,t){const i=t?g8(t.metadata):void 0,r=function(n){switch(n.constructor){case Int8Array:return new qbe;case Uint8Array:return new Kbe;case Int16Array:return new Ybe;case Uint16Array:return new Zbe;case Int32Array:return new Xbe;case Uint32Array:return new Qbe;case Float32Array:return new Jbe;case Float64Array:return new e0e;default:throw new Error("array type not supported")}}(e.value);return new uM(n,new t0e(e.size,new uM("value",r)),!1,i)}function g8(n){const e=new Map;for(const t in n)e.set(`${t}.string`,JSON.stringify(n[t]));return e}const m8={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},s0e={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array};class a0e{constructor(e){sn(this,"draco",void 0),sn(this,"decoder",void 0),sn(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=g8(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=p8(o,n[o],s[o]);r.push(l)}if(t){const o=p8("indices",t);r.push(o)}return new Nm(r,i)}(l.attributes,a,l.indices);return Lt(K({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 dM=ze(125);const _R={};function yR(n){return vR.apply(this,arguments)}function vR(){return(vR=yn(function*(n,e=null,t={}){return e&&(n=h0e(n,e,t)),_R[n]=_R[n]||f0e(n),yield _R[n]})).apply(this,arguments)}function h0e(n,e,t){if(n.startsWith("http"))return n;const i=t.modules||{};return i[n]?i[n]:_P?t.CDN?(Qc(t.CDN.startsWith("http")),`${t.CDN}/${e}@3.0.12/dist/libs/${n}`):yP?`../src/libs/${n}`:`modules/${e}/src/libs/${n}`:`modules/${e}/dist/libs/${n}`}function f0e(n){return bR.apply(this,arguments)}function bR(){return(bR=yn(function*(n){return n.endsWith("wasm")?yield(yield fetch(n)).arrayBuffer():_P?yP?importScripts(n):p0e(yield(yield fetch(n)).text(),n):dM.requireFromFile&&(yield dM.requireFromFile(n))})).apply(this,arguments)}function p0e(n,e){if(!_P)return dM.requireFromString&&dM.requireFromString(n,e);if(yP)return eval.call(yge,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 g0e="https://www.gstatic.com/draco/versioned/decoders/1.4.1/draco_decoder.js",m0e="https://www.gstatic.com/draco/versioned/decoders/1.4.1/draco_wasm_wrapper.js",_0e="https://www.gstatic.com/draco/versioned/decoders/1.4.1/draco_decoder.wasm";let Ib;function v0e(n){return CR.apply(this,arguments)}function CR(){return(CR=yn(function*(n){const e=n.modules||{};return Ib=e.draco3d?Ib||e.draco3d.createDecoderModule({}).then(t=>({draco:t})):Ib||b0e(n),yield Ib})).apply(this,arguments)}function b0e(n){return ER.apply(this,arguments)}function ER(){return(ER=yn(function*(n){let e,t;switch(n.draco&&n.draco.decoderType){case"js":e=yield yR(g0e,"draco",n);break;case"wasm":default:[e,t]=yield Promise.all([yield yR(m0e,"draco",n),yield yR(_0e,"draco",n)])}return e=e||globalThis.DracoDecoderModule,yield C0e(e,t)})).apply(this,arguments)}function C0e(n,e){const t={};return e&&(t.wasmBinary=e),new Promise(i=>{n(Lt(K({},t),{onModuleLoaded:r=>i({draco:r})}))})}const MR=Lt(K({},r8),{parse:function(n,e){return xR.apply(this,arguments)}});function xR(){return(xR=yn(function*(n,e){const{draco:t}=yield v0e(e),i=new a0e(t);try{return i.parseSync(n,null==e?void 0:e.draco)}finally{i.destroy()}})).apply(this,arguments)}function Rb(n,e){return sp(n>=0),sp(e>0),n+(e-1)&~(e-1)}function S0e(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+Rb(i.byteLength,4)}const _8=["SCALAR","VEC2","VEC3","VEC4"],M0e=[[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Uint32Array,5125],[Float32Array,5126],[Float64Array,5130]],x0e=new Map(M0e),T0e={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},A0e={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},D0e={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function y8(n){return _8[n-1]||_8[0]}function v8(n){const e=x0e.get(n.constructor);if(!e)throw new Error("Illegal typed array");return e}function b8(n,e){const t=D0e[n.componentType],i=T0e[n.type],s=n.count*i,o=n.count*i*A0e[n.componentType];return Pa(o>=0&&o<=e.byteLength),{ArrayType:t,length:s,byteLength:o}}const O0e={asset:{version:"2.0",generator:"loaders.gl"},buffers:[]};class vh{constructor(e){sn(this,"gltf",void 0),sn(this,"sourceBuffers",void 0),sn(this,"byteLength",void 0),this.gltf=e||{json:K({},O0e),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 Pa(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}=b8(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 Pa(t),this.json.extensions=this.json.extensions||{},this.json.extensions[e]=t,this.registerUsedExtension(e),t}addRequiredExtension(e,t={}){return Pa(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=eR(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;Pa(Number.isFinite(t)),this.sourceBuffers=this.sourceBuffers||[],this.sourceBuffers.push(e);const i={buffer:0,byteOffset:this.byteLength,byteLength:t};return this.byteLength+=Rb(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:y8(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:v8(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=S0e(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*j0e(n){for(const e of n.json.meshes||[])for(const t of e.primitives)yield t}function U0e(n){return DR.apply(this,arguments)}function DR(){return(DR=yn(function*(n){const e=new vh(n),{json:t}=e;e.removeExtension(fM);for(const i of t.materials||[])i.extensions&&i.extensions.KHR_materials_unlit&&(i.unlit=!0),e.removeObjectExtension(i,fM)})).apply(this,arguments)}function H0e(n){const e=new vh(n),{json:t}=e;if(e.materials)for(const i of t.materials||[])i.unlit&&(delete i.unlit,e.addObjectExtension(i,fM,{}),e.addExtension(fM))}function $0e(n){return OR.apply(this,arguments)}function OR(){return(OR=yn(function*(n){const e=new vh(n),{json:t}=e,i=e.getExtension(Bm);i&&(e.json.lights=i.lights,e.removeExtension(Bm));for(const r of t.nodes||[]){const s=e.getObjectExtension(r,Bm);s&&(r.light=s.light),e.removeObjectExtension(r,Bm)}})).apply(this,arguments)}function G0e(n){return IR.apply(this,arguments)}function IR(){return(IR=yn(function*(n){const e=new vh(n),{json:t}=e;if(t.lights){const i=e.addExtension(Bm);Pa(!i.lights),i.lights=t.lights,delete t.lights}if(e.json.lights){for(const i of e.json.lights)e.addObjectExtension(i.node,Bm,i);delete e.json.lights}})).apply(this,arguments)}function W0e(n){return PR.apply(this,arguments)}function PR(){return(PR=yn(function*(n){const e=new vh(n),{json:t}=e,i=e.getExtension(pM);if(i){const r=Y0e(i,e);for(const s of t.materials||[]){const o=e.getObjectExtension(s,pM);o&&(s.technique=Object.assign({},o,r[o.technique]),s.technique.values=X0e(s.technique,e)),e.removeObjectExtension(s,pM)}e.removeExtension(pM)}})).apply(this,arguments)}function q0e(n,e){return RR.apply(this,arguments)}function RR(){return(RR=yn(function*(n,e){})).apply(this,arguments)}function Y0e(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 X0e(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 E8={KHR_draco_mesh_compression:wt,KHR_materials_unlit:L,KHR_lights_punctual:It,KHR_techniques_webgl:Pt};function K0e(n){return kR.apply(this,arguments)}function kR(){return(kR=yn(function*(n,e={},t){for(const r in E8){var i;const s=(null==e||null===(i=e.gltf)||void 0===i?void 0:i.excludeExtensions)||{};r in s&&!s[r]||(yield E8[r].decode(n,e,t))}})).apply(this,arguments)}const S8={accessors:"accessor",animations:"animation",buffers:"buffer",bufferViews:"bufferView",images:"image",materials:"material",meshes:"mesh",nodes:"node",samplers:"sampler",scenes:"scene",skins:"skin",textures:"texture"},Q0e={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 J0e{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 vh(n),{json:t}=e;for(const i of t.images||[]){const r=e.removeObjectExtension(i,C8);r&&Object.assign(i,r)}t.buffers&&t.buffers[0]&&delete t.buffers[0].uri,e.removeExtension(C8)}(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 S8)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 S8)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=Q0e[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 eCe(n,e={}){return(new J0e).normalize(n,e)}const tCe={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},nCe={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},bl={TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,REPEAT:10497,LINEAR:9729,NEAREST_MIPMAP_LINEAR:9986},iCe={magFilter:bl.TEXTURE_MAG_FILTER,minFilter:bl.TEXTURE_MIN_FILTER,wrapS:bl.TEXTURE_WRAP_S,wrapT:bl.TEXTURE_WRAP_T},rCe={[bl.TEXTURE_MAG_FILTER]:bl.LINEAR,[bl.TEXTURE_MIN_FILTER]:bl.NEAREST_MIPMAP_LINEAR,[bl.TEXTURE_WRAP_S]:bl.REPEAT,[bl.TEXTURE_WRAP_]:bl.REPEAT};class aCe{postProcess(e,t={}){const{json:i,buffers:r=[],images:s=[],baseUri:o=""}=e;return Pa(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=K({},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=K({},e.normalTexture),e.normalTexture.texture=this.getTexture(e.normalTexture.index)),e.occlusionTexture&&(e.occlustionTexture=K({},e.occlustionTexture),e.occlusionTexture.texture=this.getTexture(e.occlusionTexture.index)),e.emissiveTexture&&(e.emmisiveTexture=K({},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=K({},e.pbrMetallicRoughness);const i=e.pbrMetallicRoughness;i.baseColorTexture&&(i.baseColorTexture=K({},i.baseColorTexture),i.baseColorTexture.texture=this.getTexture(i.baseColorTexture.index)),i.metallicRoughnessTexture&&(i.metallicRoughnessTexture=K({},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 nCe[n]}(e.componentType),e.components=function(n){return tCe[n]}(e.type),e.bytesPerElement=e.bytesPerComponent*e.components,e.bufferView){const i=e.bufferView.buffer,{ArrayType:r,byteLength:s}=b8(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):rCe,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 iCe[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 lCe(n,e){return(new aCe).postProcess(n,e)}const M8=1735152710,Vm=!0;function NR(n,e,t,i){const r=new Uint8Array(e.buffer,t,i),o=new TextDecoder("utf8").decode(r);return n.json=JSON.parse(o),Rb(i,4)}function LR(n,e,t,i){return n.header.hasBinChunk=!0,n.binChunks.push({byteOffset:t,byteLength:i,arrayBuffer:e.buffer}),Rb(i,4)}function bCe(n,e){return BR.apply(this,arguments)}function BR(){return(BR=yn(function*(n,e,t=0,i,r){var s,o,a,l;CCe(n,e,t,i),eCe(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 wCe(n,i,r)),null!=i&&null!==(a=i.gltf)&&void 0!==a&&a.loadImages){const f=ECe(n,i,r);c.push(f)}const d=K0e(n,i,r);return c.push(d),yield Promise.all(c),null!=i&&null!==(l=i.gltf)&&void 0!==l&&l.postProcess?lCe(n,i):n})).apply(this,arguments)}function CCe(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=M8}=t,s=i.getUint32(e,!1);return s===r||s===M8}(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)?t8(n.buffer,n.byteOffset,e):n instanceof ArrayBuffer?t8(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,Vm),a=r.getUint32(t+8,Vm);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){sp(n.header.byteLength>20);const i=e.getUint32(t+0,Vm),r=e.getUint32(t+4,Vm);return t+=8,sp(0===r),NR(n,e,t,i),(t+=i)+LR(n,e,t,n.header.byteLength)}(n,r,t);case 2:return function(n,e,t,i){return sp(n.header.byteLength>20),function(n,e,t,i){for(;t+8<=n.header.byteLength;){const r=e.getUint32(t+0,Vm),s=e.getUint32(t+4,Vm);switch(t+=8,s){case 1313821514:NR(n,e,t,r);break;case 5130562:LR(n,e,t,r);break;case 0:i.strict||NR(n,e,t,r);break;case 1:i.strict||LR(n,e,t,r)}t+=Rb(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),Pa("glTF"===o.type,`Invalid GLB magic string ${o.type}`),n._glb=o,n.json=o.json}else Pa(!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 wCe(n,e,t){return VR.apply(this,arguments)}function VR(){return(VR=yn(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 TCe(()=>e.some(t=>!t.loaded))})).apply(this,arguments)}function TCe(n){return $R.apply(this,arguments)}function $R(){return($R=yn(function*(n){for(;n();)yield new Promise(e=>requestAnimationFrame(e))})).apply(this,arguments)}const x8=[255,255,255,255],OCe={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:x8},_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:[zm]};let ICe=(()=>{class n extends Eb{getShaders(){const t=[oM,aM];return"pbr"===this.props._lighting&&t.push(G6),{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:x8,transition:!0},instanceModelMatrix:U6})}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 Fm)r={scenes:[t.scenegraph]};else if(t.scenegraph&&!t.scenegraph.gltf){const l=t.scenegraph,c=function(n,e,t){const i=new Lbe(n,t);return{scenes:i.instantiate(e),animator:i.createAnimator()}}(i,l,this._getModelOptions());r=K({gltf:l},c),function(n){return HR.apply(this,arguments)}(c).then(()=>this.setNeedsRedraw())}else t.scenegraph&&(jn.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 Fm?(this._deleteScenegraph(),this._applyAllAttributes(o),this._applyAnimationsProp(o,a,t._animations),this.setState({scenegraph:o,animator:a})):null!==o&&jn.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):jn.warn("animation ".concat(o," not found"))()}})}_deleteScenegraph(){const{scenegraph:t}=this.state;t instanceof Fm&&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:K({isInstanced:!0,transpileToGLSL100:!In(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:H6(s,d),sceneModelMatrix:g,u_Camera:p.model.getUniforms().project_uCameraPosition}})})}}return n.layerName="ScenegraphLayer",n.defaultProps=OCe,n})();class PCe extends _h{constructor(e={}){const{id:t=ea("sphere-geometry")}=e,{indices:i,attributes:r}=function(n){const{nlat:e=10,nlong:t=10}=n;let{radius:i=1}=n;const o=Math.PI-0,c=2*Math.PI-0,d=(e+1)*(t+1);if("number"==typeof i){const C=i;i=(w,x,N,V,U)=>C}const f=new Float32Array(3*d),p=new Float32Array(3*d),g=new Float32Array(2*d),y=new(d>65535?Uint32Array:Uint16Array)(e*t*6);for(let C=0;C<=e;C++)for(let w=0;w<=t;w++){const x=w/t,N=C/e,V=w+C*(t+1),U=2*V,ee=3*V,de=c*x,ae=o*N,me=Math.sin(de),Ee=Math.cos(de),Be=Math.sin(ae),ne=Ee*Be,Ie=Math.cos(ae),Q=me*Be,je=i(ne,Ie,Q,x,N);f[ee+0]=je*ne,f[ee+1]=je*Ie,f[ee+2]=je*Q,p[ee+0]=ne,p[ee+1]=Ie,p[ee+2]=Q,g[U+0]=x,g[U+1]=1-N}const v=t+1;for(let C=0;Cs?(te=i,Be=1,ne=t):ne=e+Ee/s*(t-e),(-2===Ee||Ee===s+2)&&(ne=0,Be=0),te-=i/2;for(let Ie=0;Ies?0:Q*y,ee[ae+V[1]]=Ee<0?-1:Ee>s?1:v,ee[ae+V[2]]=Ee<0||Ee>s?0:je*y,de[me+0]=Ie/r,de[me+1]=Be,me+=2,ae+=3}}for(let Ee=0;Ee0){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 S){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 S){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 S){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 S){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 S){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=GCe,s=1/i;r.set(this.x*s,this.y*s,this.z*s);const o=WCe;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(A8),A8.almostEquals(e,t)}clone(){return new S(this.x,this.y,this.z)}}S.ZERO=void 0,S.UNIT_X=void 0,S.UNIT_Y=void 0,S.UNIT_Z=void 0,S.ZERO=new S(0,0,0),S.UNIT_X=new S(1,0,0),S.UNIT_Y=new S(0,1,0),S.UNIT_Z=new S(0,0,1);const GCe=new S,WCe=new S,A8=new S;class Di{constructor(e={}){this.lowerBound=void 0,this.upperBound=void 0,this.lowerBound=new S,this.upperBound=new S,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=O8;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=O8;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 D8=new S,O8=[new S,new S,new S,new S,new S,new S,new S,new S];class kr{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 S){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=YCe;e.tangents(i,XCe),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(Ui(e.length(),2)*Ui(t.length(),2))+e.dot(t),this.normalize()}return this}mult(e,t=new kr){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 kr){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 kr){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 S){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 kr(this.x,this.y,this.z,this.w)}slerp(e,t,i=new kr){const r=this.x,s=this.y,o=this.z,a=this.w;let p,g,_,y,v,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),y=Math.sin((1-t)*p)/_,v=Math.sin(t*p)/_):(y=1-t,v=t),i.x=y*r+v*l,i.y=y*s+v*c,i.z=y*o+v*d,i.w=y*a+v*f,i}integrate(e,t,i,r=new kr){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 YCe=new S,XCe=new S,KCe={SPHERE:1,PLANE:2,BOX:4,COMPOUND:8,CONVEXPOLYHEDRON:16,HEIGHTFIELD:32,PARTICLE:64,CYLINDER:128,TRIMESH:256};let bt=(()=>{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=KCe,n})();class ni{constructor(e={}){this.position=void 0,this.quaternion=void 0,this.position=new S,this.quaternion=new kr,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 S){return this.quaternion.vmult(e,t),t}static pointToLocalFrame(e,t,i,r=new S){return i.vsub(e,r),t.conjugate(P8),P8.vmult(r,r),r}static pointToWorldFrame(e,t,i,r=new S){return t.vmult(i,r),r.vadd(e,r),r}static vectorToWorldFrame(e,t,i=new S){return e.vmult(t,i),i}static vectorToLocalFrame(e,t,i,r=new S){return t.w*=-1,t.vmult(i,r),t.w*=-1,r}}const P8=new kr;class lp extends bt{constructor(e={}){const{vertices:t=[],faces:i=[],normals:r=[],axes:s,boundingSphereRadius:o}=e;super({type:bt.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 S;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=y,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 S,d=new S,f=new S,p=new S,g=new S,_=new S;let y=Number.MAX_VALUE;const v=this;if(v.uniqueAxes)for(let C=0;C!==v.uniqueAxes.length;C++){i.vmult(v.uniqueAxes[C],c);const w=v.testSepAxis(c,e,t,i,r,s);if(!1===w)return!1;w0&&o.negate(o),!0}testSepAxis(e,t,i,r,s,o){lp.project(this,e,i,r,GR),lp.project(t,e,s,o,WR);const l=GR[0],c=GR[1],d=WR[0],f=WR[1];if(l0?1/t:0,this.material=e.material||null,this.linearDamping="number"==typeof e.linearDamping?e.linearDamping:.01,this.type=t<=0?Ct.STATIC:Ct.DYNAMIC,typeof e.type==typeof Ct.STATIC&&(this.type=e.type),this.allowSleep=void 0===e.allowSleep||e.allowSleep,this.sleepState=Ct.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 S,this.quaternion=new kr,this.initQuaternion=new kr,this.previousQuaternion=new kr,this.interpolatedQuaternion=new kr,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 S,e.angularVelocity&&this.angularVelocity.copy(e.angularVelocity),this.initAngularVelocity=new S,this.shapes=[],this.shapeOffsets=[],this.shapeOrientations=[],this.inertia=new S,this.invInertia=new S,this.invInertiaWorld=new ru,this.invMassSolve=0,this.invInertiaSolve=new S,this.invInertiaWorldSolve=new ru,this.fixedRotation=void 0!==e.fixedRotation&&e.fixedRotation,this.angularDamping=void 0!==e.angularDamping?e.angularDamping:.01,this.linearFactor=new S(1,1,1),e.linearFactor&&this.linearFactor.copy(e.linearFactor),this.angularFactor=new S(1,1,1),e.angularFactor&&this.angularFactor.copy(e.angularFactor),this.aabb=new Di,this.aabbNeedsUpdate=!0,this.boundingRadius=0,this.wlambda=new S,this.isTrigger=Boolean(e.isTrigger),e.shape&&this.addShape(e.shape),this.updateMassProperties()}wakeUp(){const e=this.sleepState;this.sleepState=Ct.AWAKE,this.wakeUpAfterNarrowphase=!1,e===Ct.SLEEPING&&this.dispatchEvent(Ct.wakeupEvent)}sleep(){this.sleepState=Ct.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=Ui(this.sleepSpeedLimit,2);t===Ct.AWAKE&&ir?this.wakeUp():t===Ct.SLEEPY&&e-this.timeLastSleepy>this.sleepTimeLimit&&(this.sleep(),this.dispatchEvent(Ct.sleepEvent))}}updateSolveMassProperties(){this.sleepState===Ct.SLEEPING||this.type===Ct.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 S){return e.vsub(this.position,t),this.quaternion.conjugate().vmult(t,t),t}vectorToLocalFrame(e,t=new S){return this.quaternion.conjugate().vmult(e,t),t}pointToWorldFrame(e,t=new S){return this.quaternion.vmult(e,t),t.vadd(this.position,t),t}vectorToWorldFrame(e,t=new S){return this.quaternion.vmult(e,t),t}addShape(e,t,i){const r=new S,s=new kr;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=JCe,o=ewe,a=this.quaternion,l=this.aabb,c=twe;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=nwe,r=iwe;i.setRotationFromQuaternion(this.quaternion),i.transpose(r),i.scale(t,i),i.mmult(r,this.invInertiaWorld)}}applyForce(e,t=new S){if(this.type!==Ct.DYNAMIC)return;this.sleepState===Ct.SLEEPING&&this.wakeUp();const i=rwe;t.cross(e,i),this.force.vadd(e,this.force),this.torque.vadd(i,this.torque)}applyLocalForce(e,t=new S){if(this.type!==Ct.DYNAMIC)return;const i=swe,r=owe;this.vectorToWorldFrame(e,i),this.vectorToWorldFrame(t,r),this.applyForce(i,r)}applyTorque(e){this.type===Ct.DYNAMIC&&(this.sleepState===Ct.SLEEPING&&this.wakeUp(),this.torque.vadd(e,this.torque))}applyImpulse(e,t=new S){if(this.type!==Ct.DYNAMIC)return;this.sleepState===Ct.SLEEPING&&this.wakeUp();const i=t,r=awe;r.copy(e),r.scale(this.invMass,r),this.velocity.vadd(r,this.velocity);const s=lwe;i.cross(e,s),this.invInertiaWorld.vmult(s,s),this.angularVelocity.vadd(s,this.angularVelocity)}applyLocalImpulse(e,t=new S){if(this.type!==Ct.DYNAMIC)return;const i=cwe,r=uwe;this.vectorToWorldFrame(e,i),this.vectorToWorldFrame(t,r),this.applyImpulse(i,r)}updateMassProperties(){const e=dwe;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),mM.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 S;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!==Ct.DYNAMIC&&this.type!==Ct.KINEMATIC||this.sleepState===Ct.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,y=this.angularFactor,v=l.x*y.x,C=l.y*y.y,w=l.z*y.z;s.x+=e*(_[0]*v+_[1]*C+_[2]*w),s.y+=e*(_[3]*v+_[4]*C+_[5]*w),s.z+=e*(_[6]*v+_[7]*C+_[8]*w),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()}}Ct.idCounter=0,Ct.COLLIDE_EVENT_NAME="collide",Ct.DYNAMIC=1,Ct.STATIC=2,Ct.KINEMATIC=4,Ct.AWAKE=0,Ct.SLEEPY=1,Ct.SLEEPING=2,Ct.wakeupEvent={type:"wakeup"},Ct.sleepyEvent={type:"sleepy"},Ct.sleepEvent={type:"sleep"};const JCe=new S,ewe=new kr,twe=new Di,nwe=new ru,iwe=new ru,rwe=new S,swe=new S,owe=new S,awe=new S,lwe=new S,cwe=new S,uwe=new S,dwe=new S;new S,new S;class _M{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 S,this.rayToWorld=new S,this.hitNormalWorld=new S,this.hitPointWorld=new S,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 R8,k8,F8,N8,L8,B8,V8;R8=bt.types.SPHERE,k8=bt.types.PLANE,F8=bt.types.BOX,N8=bt.types.CYLINDER,L8=bt.types.CONVEXPOLYHEDRON,B8=bt.types.HEIGHTFIELD,V8=bt.types.TRIMESH;class Hr{get[R8](){return this._intersectSphere}get[k8](){return this._intersectPlane}get[F8](){return this._intersectBox}get[N8](){return this._intersectConvex}get[L8](){return this._intersectConvex}get[B8](){return this._intersectHeightfield}get[V8](){return this._intersectTrimesh}constructor(e=new S,t=new 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 S,this.precision=1e-4,this.checkCollisionResponse=!0,this.skipBackfaces=!1,this.collisionFilterMask=-1,this.collisionFilterGroup=-1,this.mode=Hr.ANY,this.result=new _M,this.hasHit=!1,this.callback=i=>{}}intersectWorld(e,t){return this.mode=t.mode||Hr.ANY,this.result=t.result||new _M,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(z8),KR.length=0,e.broadphase.aabbQuery(e,z8,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=ywe,s=vwe;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 S(0,0,1);t.vmult(c,c);const d=new S;o.vsub(i,d);const f=d.dot(c);if(a.vsub(i,d),f*d.dot(c)>0||o.distanceTo(a)=0&&y<=1&&(o.lerp(a,y,g),g.vsub(i,_),_.normalize(),this.reportIntersection(_,g,s,r,-1)),this.result.shouldStop)return;v>=0&&v<=1&&(o.lerp(a,v,g),g.vsub(i,_),_.normalize(),this.reportIntersection(_,g,s,r,-1))}}_intersectConvex(e,t,i,r,s,o){const a=Swe,l=U8,c=o&&o.faceList||null,d=e.faces,f=e.vertices,p=e.faceNormals,g=this.direction,_=this.from,v=_.distanceTo(this.to),C=c?c.length:d.length,w=this.result;for(let x=0;!w.shouldStop&&xv||this.reportIntersection(a,ra,s,r,N)}}}}_intersectTrimesh(e,t,i,r,s,o){const a=Mwe,l=Iwe,c=Pwe,d=U8,f=xwe,p=Twe,g=Awe,_=Owe,y=Dwe,v=e.indices,C=this.from,w=this.to,x=this.direction;c.position.copy(i),c.quaternion.copy(t),ni.vectorToLocalFrame(i,t,x,f),ni.pointToLocalFrame(i,t,C,p),ni.pointToLocalFrame(i,t,w,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 N=p.distanceSquared(g);e.tree.rayQuery(this,c,l);for(let V=0,U=l.length;!this.result.shouldStop&&V!==U;V++){const ee=l[V];e.getNormal(ee,a),e.getVertex(v[3*ee],cc),cc.vsub(p,d);const de=f.dot(a),ae=a.dot(d)/de;if(ae<0)continue;f.scale(ae,ra),ra.vadd(p,ra),e.getVertex(v[3*ee+1],ou),e.getVertex(v[3*ee+2],au);const me=ra.distanceSquared(p);!Hr.pointInTriangle(ra,ou,cc,au)&&!Hr.pointInTriangle(ra,cc,ou,au)||me>N||(ni.vectorToWorldFrame(t,a,y),ni.pointToWorldFrame(i,t,ra,_),this.reportIntersection(y,_,s,r,ee))}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 Hr.ALL:this.hasHit=!0,c.set(o,a,e,t,i,r,l),c.hasHit=!0,this.callback(c);break;case Hr.CLOSEST:(l=0&&(f=s*c-o*a)>=0&&d+fDate.now()-n}var lu=ze(517);function $m(n,e,t){e||(e=new $t($t.IDENTITY));const i=new $t($t.IDENTITY);if(!n)return!0;if(n.matrix)i.copy(n.matrix);else{if(i.identity(),n.translation&&i.translate(n.translation),n.rotation){const s=new $t($t.IDENTITY).fromQuaternion(n.rotation);i.multiplyRight(s)}n.scale&&i.scale(n.scale)}const r=new $t(e).multiplyRight(i);if(!1===t(n,r,e))return!1;for(const s of n.nodes||n.children||[])if(!1===$m(s,r,t))return!1;return!0}function R$(){vH([r8,zm])}function k$(n,e){var t;const i=null===(t=e.nodes)||void 0===t?void 0:t.find(r=>r.name===n);if(i){let r=!1;for(const s of e.scenes)r||$m(s,new $t($t.IDENTITY),(o,a)=>o!==i||(o.matrix=a,o.translation=void 0,o.rotation=void 0,o.scale=void 0,r=!0,!1));return e.scene={id:n,name:n,nodes:[i]},e.scenes=[e.scene],{scene:e.scene,scenes:e.scenes}}return e}function ek(n,e){return yl(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 YS(i,zm,{DracoLoader:MR,gltf:{decompressMeshes:!0,postProcess:!0}});return r.nodes||console.log("WARNING: Empty Scene",t,r),k$(n.scenegraphNode,r)})}function RMe(n,e){return yl(this,void 0,void 0,function*(){return k$(n,yield e)})}function tk(n,e,t){if(e&&0!==e.length){let i;switch(t.geometry){case"sphere":i=new PCe;break;case"cone":i=new NCe;break;case"cylinder":i=new LCe;break;case"cube":default:i=new HCe}return new nbe(Object.assign({id:n,pickable:!0,autoHighlight:!1,highlightColor:[30,136,229,255],coordinateSystem:qn.CARTESIAN,data:e,mesh:i,wireframe:!1,getTransformMatrix:r=>r.transformMatrix,getColor:r=>r.color||[255,255,255,229.5]},t))}}function F$(n,e,t){if(e&&0!==e.length)return new Wve(Object.assign({id:n,pickable:!0,data:e.map(i=>Object.assign(Object.assign({},i),{position:new $t(i.transformMatrix).getTranslation()})),getText:i=>i.text,getPosition:i=>i.position,getColor:i=>i.color},t))}let FMe=(()=>{class n extends MH{initializeState(){const{data:t}=this.props;this.setState({data:null!=t?t:[],zoomOpacity:.8,doCollisions:!1}),R$()}renderLayers(){var t,i;const r=this.state,s={sphere:[],cone:[],cylinder:[],cube:[],text:[],wireframe:[],scenegraph:[]};for(const l of r.data){const c=null!==(t=l.geometry)&&void 0!==t?t:"cube";l.scenegraph?s.scenegraph.push(l):void 0!==s[c]&&s[c].push(l)}const o={};for(const l of s.scenegraph)l.scenegraph&&l.scenegraphNode&&!Object.prototype.hasOwnProperty.call(o,l.scenegraph)&&(o[l.scenegraph]=ek({scenegraph:l.scenegraph},n.gltfCache));const a=[];for(const[l,c]of Object.entries(s))if("scenegraph"===l)for(const d of c)a.push(new ICe({id:"models-"+d["@id"],opacity:d.zoomBasedOpacity?r.zoomOpacity:void 0!==d.opacity?d.opacity:1,pickable:!d.unpickable,coordinateSystem:qn.CARTESIAN,data:[d],scenegraph:d.scenegraphNode?RMe(d.scenegraphNode,o[d.scenegraph]):d.scenegraph,_lighting:d._lighting,getTransformMatrix:d.transformMatrix,getColor:null!==(i=d.color)&&void 0!==i?i:[0,255,0,127.5],parameters:{depthMask:!d.zoomBasedOpacity&&(void 0===d.opacity||1===d.opacity)}}));else"text"===l?(a.push(F$("text",c.filter(d=>d.unpickable),{pickable:!1})),a.push(F$("textPickable",c.filter(d=>!d.unpickable),{pickable:!0}))):"wireframe"===l?a.push(tk(l,c,{wireframe:!0,pickable:!1,geometry:l})):(a.push(tk(l,c.filter(d=>d.unpickable),{wireframe:!1,pickable:!1,geometry:l})),a.push(tk(`${l}Pickable`,c.filter(d=>!d.unpickable),{wireframe:!1,pickable:!0,geometry:l})));return r.doCollisions&&function(n){yl(this,void 0,void 0,function*(){console.log("Starting Collisioning");const e=n.filter(o=>!o.scenegraph&&"wireframe"!==o.geometry).map(o=>{const a=new $t(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 Di({lowerBound:new S(...l.map((d,f)=>Math.min(d,c[f]))),upperBound:new S(...c.map((d,f)=>Math.max(d,l[f])))})}}),t=[];for(const o of n.filter(a=>!!a.scenegraph)){const a=yield wb(o.scenegraph,zm,{DracoLoader:MR,decompress:!0,postProcess:!0});for(const l of a.scenes)$m(l,new $t(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 Di({lowerBound:new S(...p.map((_,y)=>Math.min(_,g[y]))),upperBound:new S(...g.map((_,y)=>Math.max(_,p[y])))}),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})}(r.data),a.filter(l=>!!l)}getPickingInfo(t){return t.info}}return n.layerName="BodyUILayer",n.gltfCache={},n})();function N$(n,e=[]){for(const t of n.nodes||n.children||[])e.push(t.name),N$(t,e);return e}let LMe=(()=>{class n{constructor(t){var i,r,s,o,a;this.deckProps=t,this.bodyUILayer=new FMe({}),this.nodeClickSubject=new Se,this.nodeHoverStartSubject=new Se,this.nodeHoverStopSubject=new Se,this.sceneRotationSubject=new ar([0,0]),this.nodeDragStartSubject=new Se,this.nodeDragSubject=new Se,this.nodeDragEndSubject=new Se,this.nodeClick$=this.nodeClickSubject.pipe(Vs()),this.nodeHoverStart$=this.nodeHoverStartSubject.pipe(Vs()),this.nodeHoverStop$=this.nodeHoverStopSubject.pipe(Vs()),this.sceneRotation$=this.sceneRotationSubject.pipe(Vs()),this.nodeDragStart$=this.nodeDragStartSubject.pipe(Vs()),this.nodeDrag$=this.nodeDragSubject.pipe(Vs()),this.nodeDragEnd$=this.nodeDragEndSubject.pipe(Vs());const l=Object.assign(Object.assign({},t),{views:["orthographic"===t.camera?new Ame({flipY:!1,near:-1e3}):new Ime({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 GP({ambientLight:new OH({color:[255,255,255],intensity:10})})]),this.deck=new sM(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 yl(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 $t([.076,0,0,0,0,.076,16875389974302382e-33,0,0,-16875389974302382e-33,.076,0,.49,.034,.11,1]);(function(n,e,t){return yl(this,void 0,void 0,function*(){R$();const i=yield ek({scenegraph:n,scenegraphNode:"VHF_Kidney_L_Low1"}),r={},s=[];for(const o of i.scenes)$m(o,e=new $t(e||$t.IDENTITY),(a,l)=>{const c={"@id":a.name||a.id,"@type":"ProcessedNode",transformMatrix:new $t(l),geometry:"wireframe",node:a};if(s.push({"@id":`GLTF:${c["@id"]}`,"@type":"GLTFNode",scenegraph:n,scenegraphNode:c["@id"],transformMatrix:new $t(e||$t.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 Di({lowerBound:new S(...f.map((g,_)=>Math.min(g,p[_]))),upperBound:new S(...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 N$(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 S(.5,.5,.5)),f=o.center=a.clone().vadd(d);o.transformMatrix=new $t($t.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 $t(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 xe([lu.ZP],n.prototype,"_onHover",null),xe([lu.ZP],n.prototype,"_onClick",null),xe([lu.ZP],n.prototype,"_onViewStateChange",null),xe([lu.ZP],n.prototype,"_onDragStart",null),xe([lu.ZP],n.prototype,"_onDrag",null),xe([lu.ZP],n.prototype,"_onDragEnd",null),n})();function BMe(n,e){return n===e}function VMe(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 nk=(()=>{class n{constructor(){this.bootstrap$=new If(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=ue({token:n,factory:n.\u0275fac}),n})();const ik=new ve("INITIAL_STATE_TOKEN");let UMe=(()=>{class n{static set(t){this.value=t}static pop(){const t=this.value;return this.value={},t}}return n.value={},n})();const L$=new ve("Internals.StateContextFactory"),B$=new ve("Internals.StateFactory");function V$(n,e){return e?t=>t.pipe(V$((i,r)=>ui(n(i,r)).pipe(Ae((s,o)=>e(i,s,r,o))))):t=>t.lift(new HMe(n))}class HMe{constructor(e){this.project=e}call(e,t){return t.subscribe(new $Me(e,this.project))}}class $Me extends ii{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 Gr(this),i=this.destination;i.add(t);const r=co(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 TM(n=null){return e=>e.lift(new GMe(n))}class GMe{constructor(e){this.defaultValue=e}call(e,t){return t.subscribe(new WMe(e,this.defaultValue))}}class WMe extends xt{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()}}const Ra={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 z$=(()=>{class n{constructor(t,i){this._ngZone=t,this._platformId=i,this.verifyZoneIsNotNooped(this._ngZone)}enter(t){return kD(this._platformId)?this.runInsideAngular(t):this.runOutsideAngular(t)}leave(t){return this.runInsideAngular(t)}runInsideAngular(t){return dt.isInAngularZone()?t():this._ngZone.run(t)}runOutsideAngular(t){return dt.isInAngularZone()?this._ngZone.runOutsideAngular(t):t()}verifyZoneIsNotNooped(t){t instanceof dt||console.warn(Ra.ZONE_WARNING())}}return n.\u0275fac=function(t){return new(t||n)(I(dt),I(dl))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();const j$=new ve("ROOT_STATE_TOKEN"),U$=new ve("FEATURE_STATE_TOKEN"),rk=new ve("NGXS_PLUGINS"),H$=new ve("NG_TEST_MODE"),G$=new ve("NG_DEV_MODE"),ld="NGXS_META",W$="NGXS_OPTIONS_META",sk="NGXS_SELECTOR_META";let fp=(()=>{class n{constructor(){this.defaultsState={},this.selectorOptions={injectContainerState:!0,suppressErrors:!0},this.compatibility={strictContentSecurityPolicy:!1},this.executionStrategy=z$}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();class qMe{constructor(e,t,i){this.previousValue=e,this.currentValue=t,this.firstChange=i}}const q$=new ve("NGXS_EXECUTION_STRATEGY");function pp(n){return n.constructor&&n.constructor.type?n.constructor.type:n.type}const ok=(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},Gm=(n,e)=>e.split(".").reduce((t,i)=>t&&t[i],n),ak=n=>n&&"object"==typeof n&&!Array.isArray(n),lk=(n,...e)=>{if(!e.length)return n;const t=e.shift();if(ak(n)&&ak(t))for(const i in t)ak(t[i])?(n[i]||Object.assign(n,{[i]:{}}),lk(n[i],t[i])):Object.assign(n,{[i]:t[i]});return lk(n,...e)};function ck(n){if(!n.hasOwnProperty(ld)){const e={name:null,actions:{},defaults:{},path:null,makeRootSelector:t=>t.getStateGetter(e.name),children:[]};Object.defineProperty(n,ld,{value:e})}return jb(n)}function jb(n){return n[ld]}function uk(n){return n.hasOwnProperty(sk)||Object.defineProperty(n,sk,{value:{makeRootSelector:null,originalFn:null,containerClass:null,selectorName:null,getSelectorOptions:()=>({})}}),dk(n)}function dk(n){return n[sk]}function Y$(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(e[pp(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 Fn(t=>{const i=pp(t.action);return n[i]&&(!e||e[t.status])})}(i,r),t())}}(n,["DISPATCHED"])}function sxe(){return Ae(n=>n.action)}function AM(n){return e=>new ce(t=>e.subscribe({next(i){n.leave(()=>t.next(i))},error(i){n.leave(()=>t.error(i))},complete(){n.leave(()=>t.complete())}}))}let DM=(()=>{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)(I(q$))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();class lxe extends Se{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 OM=(()=>{class n extends lxe{}return n.\u0275fac=function(){let e;return function(i){return(e||(e=$n(n)))(i||n)}}(),n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})(),cxe=(()=>{class n extends ce{constructor(t,i){super(r=>{const s=t.pipe(AM(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)(I(OM),I(DM))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();const K$=n=>(...e)=>n.shift()(...e,(...i)=>K$(n)(...i));let IM=(()=>{class n extends ar{constructor(){super({})}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})(),hk=(()=>{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)(I(n,12),I(rk,8))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})(),fk=(()=>{class n extends Se{}return n.\u0275fac=function(){let e;return function(i){return(e||(e=$n(n)))(i||n)}}(),n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})(),Z$=(()=>{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($o),this._errorHandler.handleError(r)}catch(s){}})}),i.pipe(AM(this._ngxsExecutionStrategy))}dispatchByEvents(t){return Array.isArray(t)?0===t.length?ht(this._stateStream.getValue()):Hv(t.map(i=>this.dispatchSingle(i))):this.dispatchSingle(t)}dispatchSingle(t){if(!pp(t))return Kg(new Error(`This action doesn't have a type property: ${t.constructor.name}`));const r=this._stateStream.getValue();return K$([...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(qc())}getActionResultStream(t){return this._actionResults.pipe(Fn(i=>i.action===t&&"DISPATCHED"!==i.status),yi(1),qc())}createDispatchObservable(t){return t.pipe(V$(i=>{switch(i.status){case"SUCCESSFUL":return ht(this._stateStream.getValue());case"ERRORED":return Kg(i.error);default:return ec}})).pipe(qc())}}return n.\u0275fac=function(t){return new(t||n)(I(Nt),I(OM),I(fk),I(hk),I(IM),I(DM))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();const Q$=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])&&Q$(n[i])}),n};let J$=(()=>{class n{constructor(t,i){this.isDevMode=t,this.isTestMode=i}}return n.\u0275fac=function(t){return new(t||n)(I(G$),I(H$))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})(),eG=(()=>{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(Ra.INCORRECT_PRODUCTION()):this.isIncorrectDevelopment&&console.warn(Ra.INCORRECT_DEVELOPMENT()))}}return n.\u0275fac=function(t){return new(t||n)(I(J$),I(fp))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})(),qm=(()=>{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=Q$(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)(I(IM),I(Z$),I(fp),I(eG))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})(),PM=(()=>{class n{constructor(t){this._internalStateOperations=t}createStateContext(t){const i=this._internalStateOperations.getRootStateOperations();function r(l){return Gm(l,t.path)}function s(l,c){const d=ok(l,t.path,c),f=t.instance;if(f.ngxsOnChanges){const p=X$(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(Ra.PATCHING_ARRAY());if("object"!=typeof n)throw new Error(Ra.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)(I(qm))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();class RM{static stateNameErrorMessage(e){return Ra.STATE_NAME(e)}static checkCorrectStateName(e){if(!e)throw new Error(Ra.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(Ra.STATE_UNIQUE(r,e.name,s.name));return r}static getValidStateMeta(e){const t=jb(e);if(!t)throw new Error(Ra.STATE_DECORATOR());return t}}RM.stateNameRegex=new RegExp("^[a-zA-Z0-9_]+$");let Ym=(()=>{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=xM(()=>{const c=this;function d(p){const g=c.statePaths[p];return g?Y$(g.split("."),c._config):null}return this._parentFactory?this._parentFactory.getRuntimeSelectorContext():{getStateGetter(p){let g=d(p);return g||((..._)=>(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(RM.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[ld].name};return n.reduce((t,i)=>{const{name:r,children:s}=i[ld];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[ld].name]=t,e),{})}(i),l=[];for(const c of s){const d=a[c],f=o[c],p=d[ld];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)=>ok(o,a.path,a.defaults),{}),states:r}}connectActionHandlers(){null===this._actionsSubscription&&(this._actionsSubscription=this._actions.pipe(Fn(t=>"DISPATCHED"===t.status),di(({action:t})=>this.invokeActions(this._actions,t).pipe(Ae(()=>({action:t,status:"SUCCESSFUL"})),TM({action:t,status:"CANCELED"}),Ta(i=>ht({action:t,status:"ERRORED",error:i}))))).subscribe(t=>this._actionResults.next(t)))}invokeActions(t,i){const r=pp(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=ui(d)),d instanceof ce?(d=d.pipe(TM({})),l.options.cancelUncompleted&&(d=d.pipe(Tn(t.pipe(nxe(i)))))):d=ht({}).pipe(qc()),s.push(d)}catch(d){s.push(Kg(d))}}}return s.length||s.push(ht({})),Hv(s)}addToStatesMap(t){const i=[],r=this.statesByName;for(const s of t){const o=RM.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!==Gm(this._initialState,i);return this.statesByName[t]&&r}}return n.\u0275fac=function(t){return new(t||n)(I(Nt),I(fp),I(n,12),I(OM),I(fk),I(PM),I(ik,8))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})(),pk=(()=>{class n{constructor(t,i,r){this.internalStateOperations=t,this.stateContextFactory=i,this.bootstrapper=r}ngxsBootstrap(t,i){this.internalStateOperations.getRootStateOperations().dispatch(t).pipe(Fn(()=>!!i),Ti(()=>this.invokeInit(i.states)),di(()=>this.bootstrapper.appBootstrapped$),Fn(r=>!!r)).subscribe(()=>this.invokeBootstrap(i.states))}invokeInit(t){for(const i of t){const r=i.instance;if(r.ngxsOnChanges){const a=X$(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)(I(qm),I(PM),I(nk))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();const kM_getOptions=n=>n&&n.NGXS_SELECTOR_OPTIONS_META||{};function nG(n){const e=dk(n)||jb(n);return e&&e.makeRootSelector||(()=>n)}let cu=(()=>{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(Ae(i),Ta(r=>{const{suppressErrors:s}=this._config.selectorOptions;return r instanceof TypeError&&s?ht(void 0):Kg(r)}),Zo(),AM(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(AM(this._internalExecutionStrategy)).subscribe(t)}snapshot(){return this._internalStateOperations.getRootStateOperations().getState()}reset(t){return this._internalStateOperations.getRootStateOperations().setState(t)}getStoreBoundSelectorFn(t){return nG(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)(I(IM),I(qm),I(fp),I(DM),I(Ym),I(ik,8))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})(),Ub=(()=>{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)(I(cu),I(fp))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n.store=null,n.config=null,n})();class iG{static get type(){return"@@INIT"}}class rG{constructor(e){this.addedStates=e}static get type(){return"@@UPDATE_STATE"}}const FM=new If(1);let _xe=(()=>{class n{constructor(t,i,r,s,o=[],a){!function(){try{const n=window.ng,t=!(n.probe&&n.coreTokens)&&Mo();FM.next(t)}catch(n){FM.next(!1)}finally{FM.complete()}}();const l=t.addAndReturnDefaults(o);i.setStateToTheCurrentWithNew(l),t.connectActionHandlers(),a.ngxsBootstrap(new iG,l)}}return n.\u0275fac=function(t){return new(t||n)(I(Ym),I(qm),I(cu),I(Ub),I(j$,8),I(pk))},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({}),n})(),yxe=(()=>{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 rG(l.defaults),l))}static flattenStates(t=[]){return t.reduce((i,r)=>i.concat(r),[])}}return n.\u0275fac=function(t){return new(t||n)(I(cu),I(qm),I(Ym),I(U$,8),I(pk))},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({}),n})();class Io{static forRoot(e=[],t={}){return{ngModule:_xe,providers:[Ym,PM,cxe,OM,nk,eG,J$,pk,Z$,fk,qm,DM,cu,IM,Ub,hk,...e,...Io.ngxsTokenProviders(e,t)]}}static forFeature(e=[]){return{ngModule:yxe,providers:[Ym,hk,...e,{provide:U$,multi:!0,useValue:e}]}}static ngxsTokenProviders(e,t){return[{provide:H$,useValue:jMe},{provide:G$,useValue:Mo},{provide:q$,useClass:t.executionStrategy||z$},{provide:j$,useValue:e},{provide:Io.ROOT_OPTIONS,useValue:t},{provide:fp,useFactory:Io.ngxsConfigFactory,deps:[Io.ROOT_OPTIONS]},{provide:bv,useFactory:Io.appBootstrapListenerFactory,multi:!0,deps:[nk]},{provide:ik,useFactory:Io.getInitialState},{provide:L$,useExisting:PM},{provide:B$,useExisting:Ym}]}static ngxsConfigFactory(e){return lk(new fp,e)}static appBootstrapListenerFactory(e){return()=>e.bootstrap()}static getInitialState(){return UMe.pop()}}function gk(n,e){return(t,i)=>{if(t.hasOwnProperty("prototype"))throw new Error(Ra.ACTION_DECORATOR());const s=ck(t.constructor);Array.isArray(n)||(n=[n]);for(const o of n){const a=o.type;s.actions[a]||(s.actions[a]=[]),s.actions[a].push({fn:i,options:e||{},type:a})}}}function cd(n){return i=>{!function(n){FM.subscribe(e=>{e&&(n.\u0275prov||console.warn(Ra.UNDECORATED_STATE_IN_IVY(n.name)))})}(i);const r=i,s=ck(r),o=Object.getPrototypeOf(r),a=function(i){return Object.assign({},i[W$]||{},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;RM.checkCorrectStateName(d),s.hasOwnProperty(ld)&&(r.actions=Object.assign({},r.actions,(s[ld]||{}).actions)),r.children=a,r.defaults=l,r.name=d})({meta:s,inheritedStateClass:o,optionsWithInheritance:a}),r[W$]=a}}function NM(n,...e){return function(t,i){const r=i.toString(),s=`__${r}__selector`,o=function(n,e,t=[]){return"string"==typeof(e=e||function(n){const e=n.length-1;return 36===n.charCodeAt(e)?n.slice(0,e):n}(n))?Y$(t.length?[e,...t]:e.split("."),Ub.config):e}(r,n,e);Object.defineProperties(t,{[s]:{writable:!0,enumerable:!1,configurable:!0},[r]:{enumerable:!0,configurable:!0,get(){return this[s]||(this[s]=function(n){if(!Ub.store)throw new Error(Ra.SELECT_FACTORY_NOT_CONNECTED());return Ub.store.select(n)}(o))}}})}}function Xm(n){return(e,t,i)=>{if(!i||null===i.value)throw new Error(Ra.SELECTOR_DECORATOR());const s=i.value,o=function(n,e,t){const i=t&&t.containerClass,s=xM(function(...c){const d=e.apply(i,c);return d instanceof Function?xM.apply(null,[d]):d});Object.setPrototypeOf(s,e);const o=function(n,e){const t=uk(n);t.originalFn=n;let i=()=>({});e&&(t.containerClass=e.containerClass,t.selectorName=e.selectorName,i=e.getSelectorOptions||i);const r=Object.assign({},t);return t.getSelectorOptions=()=>function(n,e){return Object.assign({},kM_getOptions(n.containerClass)||{},kM_getOptions(n.originalFn)||{},n.getSelectorOptions()||{},e)}(r,i()),t}(e,t);return o.makeRootSelector=l=>{const{argumentSelectorFunctions:c,selectorOptions:d}=function(n,e,t=[]){const i=e.getSelectorOptions(),r=n.getSelectorOptions(i);return{selectorOptions:r,argumentSelectorFunctions:function(n=[],e,t){const i=[];return t&&(0===n.length||e.injectContainerState)&&jb(t)&&i.push(t),n&&i.push(...n),i}(t,r,e.containerClass).map(a=>nG(a)(n))}}(l,o,n);return function(p){const g=c.map(_=>_(p));try{return s(...g)}catch(_){if(_ instanceof TypeError&&d.suppressErrors)return;throw _}}},s}(n,s,{containerClass:e,selectorName:t.toString(),getSelectorOptions:()=>({})}),a={configurable:!0,get:()=>o};return a.originalFn=s,a}}Io.\u0275fac=function(e){return new(e||Io)},Io.\u0275mod=Pe({type:Io}),Io.\u0275inj=Me({}),Io.ROOT_OPTIONS=new ve("ROOT_OPTIONS");let sG=(()=>{class n{constructor(t,i){this._renderer=t,this._elementRef=i,this.onChange=r=>{},this.onTouched=()=>{}}setProperty(t,i){this._renderer.setProperty(this._elementRef.nativeElement,t,i)}registerOnTouched(t){this.onTouched=t}registerOnChange(t){this.onChange=t}setDisabledState(t){this.setProperty("disabled",t)}}return n.\u0275fac=function(t){return new(t||n)(E(zc),E(rt))},n.\u0275dir=oe({type:n}),n})(),gp=(()=>{class n extends sG{}return n.\u0275fac=function(){let e;return function(i){return(e||(e=$n(n)))(i||n)}}(),n.\u0275dir=oe({type:n,features:[ct]}),n})();const ro=new ve("NgValueAccessor"),xxe={provide:ro,useExisting:T(()=>Hb),multi:!0},Axe=new ve("CompositionEventMode");let Hb=(()=>{class n extends sG{constructor(t,i,r){super(t,i),this._compositionMode=r,this._composing=!1,null==this._compositionMode&&(this._compositionMode=!function(){const n=Uc()?Uc().getUserAgent():"";return/android (\d+)/.test(n.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 n.\u0275fac=function(t){return new(t||n)(E(zc),E(rt),E(Axe,8))},n.\u0275dir=oe({type:n,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,i){1&t&&ge("input",function(s){return i._handleInput(s.target.value)})("blur",function(){return i.onTouched()})("compositionstart",function(){return i._compositionStart()})("compositionend",function(s){return i._compositionEnd(s.target.value)})},features:[Dt([xxe]),ct]}),n})();function Ch(n){return null==n||0===n.length}function aG(n){return null!=n&&"number"==typeof n.length}const Ss=new ve("NgValidators"),wh=new ve("NgAsyncValidators"),Dxe=/^(?=.{1,254}$)(?=.{1,64}@)[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[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])?)*$/;class lG{static min(e){return function(n){return e=>{if(Ch(e.value)||Ch(n))return null;const t=parseFloat(e.value);return!isNaN(t)&&t{if(Ch(e.value)||Ch(n))return null;const t=parseFloat(e.value);return!isNaN(t)&&t>n?{max:{max:n,actual:e.value}}:null}}(e)}static required(e){return function(n){return Ch(n.value)?{required:!0}:null}(e)}static requiredTrue(e){return function(n){return!0===n.value?null:{required:!0}}(e)}static email(e){return function(n){return Ch(n.value)||Dxe.test(n.value)?null:{email:!0}}(e)}static minLength(e){return function(n){return e=>Ch(e.value)||!aG(e.value)?null:e.value.lengthaG(e.value)&&e.value.length>n?{maxlength:{requiredLength:n,actualLength:e.value.length}}:null}(e)}static pattern(e){return function(n){if(!n)return Eh;let e,t;return"string"==typeof n?(t="","^"!==n.charAt(0)&&(t+="^"),t+=n,"$"!==n.charAt(n.length-1)&&(t+="$"),e=new RegExp(t)):(t=n.toString(),e=n),i=>{if(Ch(i.value))return null;const r=i.value;return e.test(r)?null:{pattern:{requiredPattern:t,actualValue:r}}}}(e)}static nullValidator(e){return null}static compose(e){return wG(e)}static composeAsync(e){return EG(e)}}function Eh(n){return null}function _G(n){return null!=n}function yG(n){const e=Og(n)?ui(n):n;return xw(e),e}function vG(n){let e={};return n.forEach(t=>{e=null!=t?Object.assign(Object.assign({},e),t):e}),0===Object.keys(e).length?null:e}function bG(n,e){return e.map(t=>t(n))}function CG(n){return n.map(e=>function(n){return!n.validate}(e)?e:t=>e.validate(t))}function wG(n){if(!n)return null;const e=n.filter(_G);return 0==e.length?null:function(t){return vG(bG(t,e))}}function mk(n){return null!=n?wG(CG(n)):null}function EG(n){if(!n)return null;const e=n.filter(_G);return 0==e.length?null:function(t){return Hv(bG(t,e).map(yG)).pipe(Ae(vG))}}function _k(n){return null!=n?EG(CG(n)):null}function SG(n,e){return null===n?[e]:Array.isArray(n)?[...n,e]:[n,e]}function MG(n){return n._rawValidators}function xG(n){return n._rawAsyncValidators}function yk(n){return n?Array.isArray(n)?n:[n]:[]}function LM(n,e){return Array.isArray(n)?n.includes(e):n===e}function TG(n,e){const t=yk(e);return yk(n).forEach(r=>{LM(t,r)||t.push(r)}),t}function AG(n,e){return yk(e).filter(t=>!LM(n,t))}let DG=(()=>{class n{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=mk(this._rawValidators)}_setAsyncValidators(t){this._rawAsyncValidators=t||[],this._composedAsyncValidatorFn=_k(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,i){return!!this.control&&this.control.hasError(t,i)}getError(t,i){return this.control?this.control.getError(t,i):null}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275dir=oe({type:n}),n})(),Po=(()=>{class n extends DG{get formDirective(){return null}get path(){return null}}return n.\u0275fac=function(){let e;return function(i){return(e||(e=$n(n)))(i||n)}}(),n.\u0275dir=oe({type:n,features:[ct]}),n})();class uc extends DG{constructor(){super(...arguments),this._parent=null,this.name=null,this.valueAccessor=null}}let vk=(()=>{class n extends class{constructor(e){this._cd=e}is(e){var t,i,r;return"submitted"===e?!!(null===(t=this._cd)||void 0===t?void 0:t.submitted):!!(null===(r=null===(i=this._cd)||void 0===i?void 0:i.control)||void 0===r?void 0:r[e])}}{constructor(t){super(t)}}return n.\u0275fac=function(t){return new(t||n)(E(uc,2))},n.\u0275dir=oe({type:n,selectors:[["","formControlName",""],["","ngModel",""],["","formControl",""]],hostVars:14,hostBindings:function(t,i){2&t&&st("ng-untouched",i.is("untouched"))("ng-touched",i.is("touched"))("ng-pristine",i.is("pristine"))("ng-dirty",i.is("dirty"))("ng-valid",i.is("valid"))("ng-invalid",i.is("invalid"))("ng-pending",i.is("pending"))},features:[ct]}),n})();function $b(n,e){wk(n,e),e.valueAccessor.writeValue(n.value),function(n,e){e.valueAccessor.registerOnChange(t=>{n._pendingValue=t,n._pendingChange=!0,n._pendingDirty=!0,"change"===n.updateOn&&PG(n,e)})}(n,e),function(n,e){const t=(i,r)=>{e.valueAccessor.writeValue(i),r&&e.viewToModelUpdate(i)};n.registerOnChange(t),e._registerOnDestroy(()=>{n._unregisterOnChange(t)})}(n,e),function(n,e){e.valueAccessor.registerOnTouched(()=>{n._pendingTouched=!0,"blur"===n.updateOn&&n._pendingChange&&PG(n,e),"submit"!==n.updateOn&&n.markAsTouched()})}(n,e),function(n,e){if(e.valueAccessor.setDisabledState){const t=i=>{e.valueAccessor.setDisabledState(i)};n.registerOnDisabledChange(t),e._registerOnDestroy(()=>{n._unregisterOnDisabledChange(t)})}}(n,e)}function zM(n,e,t=!0){const i=()=>{};e.valueAccessor&&(e.valueAccessor.registerOnChange(i),e.valueAccessor.registerOnTouched(i)),UM(n,e),n&&(e._invokeOnDestroyCallbacks(),n._registerOnCollectionChange(()=>{}))}function jM(n,e){n.forEach(t=>{t.registerOnValidatorChange&&t.registerOnValidatorChange(e)})}function wk(n,e){const t=MG(n);null!==e.validator?n.setValidators(SG(t,e.validator)):"function"==typeof t&&n.setValidators([t]);const i=xG(n);null!==e.asyncValidator?n.setAsyncValidators(SG(i,e.asyncValidator)):"function"==typeof i&&n.setAsyncValidators([i]);const r=()=>n.updateValueAndValidity();jM(e._rawValidators,r),jM(e._rawAsyncValidators,r)}function UM(n,e){let t=!1;if(null!==n){if(null!==e.validator){const r=MG(n);if(Array.isArray(r)&&r.length>0){const s=r.filter(o=>o!==e.validator);s.length!==r.length&&(t=!0,n.setValidators(s))}}if(null!==e.asyncValidator){const r=xG(n);if(Array.isArray(r)&&r.length>0){const s=r.filter(o=>o!==e.asyncValidator);s.length!==r.length&&(t=!0,n.setAsyncValidators(s))}}}const i=()=>{};return jM(e._rawValidators,i),jM(e._rawAsyncValidators,i),t}function PG(n,e){n._pendingDirty&&n.markAsDirty(),n.setValue(n._pendingValue,{emitModelToViewChange:!1}),e.viewToModelUpdate(n._pendingValue),n._pendingChange=!1}function RG(n,e){wk(n,e)}function Ek(n,e){if(!n.hasOwnProperty("model"))return!1;const t=n.model;return!!t.isFirstChange()||!Object.is(e,t.currentValue)}function kG(n,e){n._syncPendingControls(),e.forEach(t=>{const i=t.control;"submit"===i.updateOn&&i._pendingChange&&(t.viewToModelUpdate(i._pendingValue),i._pendingChange=!1)})}function Sk(n,e){if(!e)return null;let t,i,r;return Array.isArray(e),e.forEach(s=>{s.constructor===Hb?t=s:function(n){return Object.getPrototypeOf(n.constructor)===gp}(s)?i=s:r=s}),r||i||t||null}function HM(n,e){const t=n.indexOf(e);t>-1&&n.splice(t,1)}const Gb="VALID",$M="INVALID",Km="PENDING",Wb="DISABLED";function Mk(n){return(Tk(n)?n.validators:n)||null}function FG(n){return Array.isArray(n)?mk(n):n||null}function xk(n,e){return(Tk(e)?e.asyncValidators:n)||null}function NG(n){return Array.isArray(n)?_k(n):n||null}function Tk(n){return null!=n&&!Array.isArray(n)&&"object"==typeof n}class Ak{constructor(e,t){this._hasOwnPendingAsyncValidator=!1,this._onCollectionChange=()=>{},this._parent=null,this.pristine=!0,this.touched=!1,this._onDisabledChange=[],this._rawValidators=e,this._rawAsyncValidators=t,this._composedValidatorFn=FG(this._rawValidators),this._composedAsyncValidatorFn=NG(this._rawAsyncValidators)}get validator(){return this._composedValidatorFn}set validator(e){this._rawValidators=this._composedValidatorFn=e}get asyncValidator(){return this._composedAsyncValidatorFn}set asyncValidator(e){this._rawAsyncValidators=this._composedAsyncValidatorFn=e}get parent(){return this._parent}get valid(){return this.status===Gb}get invalid(){return this.status===$M}get pending(){return this.status==Km}get disabled(){return this.status===Wb}get enabled(){return this.status!==Wb}get dirty(){return!this.pristine}get untouched(){return!this.touched}get updateOn(){return this._updateOn?this._updateOn:this.parent?this.parent.updateOn:"change"}setValidators(e){this._rawValidators=e,this._composedValidatorFn=FG(e)}setAsyncValidators(e){this._rawAsyncValidators=e,this._composedAsyncValidatorFn=NG(e)}addValidators(e){this.setValidators(TG(e,this._rawValidators))}addAsyncValidators(e){this.setAsyncValidators(TG(e,this._rawAsyncValidators))}removeValidators(e){this.setValidators(AG(e,this._rawValidators))}removeAsyncValidators(e){this.setAsyncValidators(AG(e,this._rawAsyncValidators))}hasValidator(e){return LM(this._rawValidators,e)}hasAsyncValidator(e){return LM(this._rawAsyncValidators,e)}clearValidators(){this.validator=null}clearAsyncValidators(){this.asyncValidator=null}markAsTouched(e={}){this.touched=!0,this._parent&&!e.onlySelf&&this._parent.markAsTouched(e)}markAllAsTouched(){this.markAsTouched({onlySelf:!0}),this._forEachChild(e=>e.markAllAsTouched())}markAsUntouched(e={}){this.touched=!1,this._pendingTouched=!1,this._forEachChild(t=>{t.markAsUntouched({onlySelf:!0})}),this._parent&&!e.onlySelf&&this._parent._updateTouched(e)}markAsDirty(e={}){this.pristine=!1,this._parent&&!e.onlySelf&&this._parent.markAsDirty(e)}markAsPristine(e={}){this.pristine=!0,this._pendingDirty=!1,this._forEachChild(t=>{t.markAsPristine({onlySelf:!0})}),this._parent&&!e.onlySelf&&this._parent._updatePristine(e)}markAsPending(e={}){this.status=Km,!1!==e.emitEvent&&this.statusChanges.emit(this.status),this._parent&&!e.onlySelf&&this._parent.markAsPending(e)}disable(e={}){const t=this._parentMarkedDirty(e.onlySelf);this.status=Wb,this.errors=null,this._forEachChild(i=>{i.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(i=>i(!0))}enable(e={}){const t=this._parentMarkedDirty(e.onlySelf);this.status=Gb,this._forEachChild(i=>{i.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(i=>i(!1))}_updateAncestors(e){this._parent&&!e.onlySelf&&(this._parent.updateValueAndValidity(e),e.skipPristineCheck||this._parent._updatePristine(),this._parent._updateTouched())}setParent(e){this._parent=e}updateValueAndValidity(e={}){this._setInitialStatus(),this._updateValue(),this.enabled&&(this._cancelExistingSubscription(),this.errors=this._runValidator(),this.status=this._calculateStatus(),(this.status===Gb||this.status===Km)&&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)}_updateTreeValidity(e={emitEvent:!0}){this._forEachChild(t=>t._updateTreeValidity(e)),this.updateValueAndValidity({onlySelf:!0,emitEvent:e.emitEvent})}_setInitialStatus(){this.status=this._allControlsDisabled()?Wb:Gb}_runValidator(){return this.validator?this.validator(this):null}_runAsyncValidator(e){if(this.asyncValidator){this.status=Km,this._hasOwnPendingAsyncValidator=!0;const t=yG(this.asyncValidator(this));this._asyncValidationSubscription=t.subscribe(i=>{this._hasOwnPendingAsyncValidator=!1,this.setErrors(i,{emitEvent:e})})}}_cancelExistingSubscription(){this._asyncValidationSubscription&&(this._asyncValidationSubscription.unsubscribe(),this._hasOwnPendingAsyncValidator=!1)}setErrors(e,t={}){this.errors=e,this._updateControlsErrors(!1!==t.emitEvent)}get(e){return function(n,e,t){if(null==e||(Array.isArray(e)||(e=e.split(".")),Array.isArray(e)&&0===e.length))return null;let i=n;return e.forEach(r=>{i=i instanceof Dk?i.controls.hasOwnProperty(r)?i.controls[r]:null:i instanceof Uxe&&i.at(r)||null}),i}(this,e)}getError(e,t){const i=t?this.get(t):this;return i&&i.errors?i.errors[e]:null}hasError(e,t){return!!this.getError(e,t)}get root(){let e=this;for(;e._parent;)e=e._parent;return e}_updateControlsErrors(e){this.status=this._calculateStatus(),e&&this.statusChanges.emit(this.status),this._parent&&this._parent._updateControlsErrors(e)}_initObservables(){this.valueChanges=new Le,this.statusChanges=new Le}_calculateStatus(){return this._allControlsDisabled()?Wb:this.errors?$M:this._hasOwnPendingAsyncValidator||this._anyControlsHaveStatus(Km)?Km:this._anyControlsHaveStatus($M)?$M:Gb}_anyControlsHaveStatus(e){return this._anyControls(t=>t.status===e)}_anyControlsDirty(){return this._anyControls(e=>e.dirty)}_anyControlsTouched(){return this._anyControls(e=>e.touched)}_updatePristine(e={}){this.pristine=!this._anyControlsDirty(),this._parent&&!e.onlySelf&&this._parent._updatePristine(e)}_updateTouched(e={}){this.touched=this._anyControlsTouched(),this._parent&&!e.onlySelf&&this._parent._updateTouched(e)}_isBoxedValue(e){return"object"==typeof e&&null!==e&&2===Object.keys(e).length&&"value"in e&&"disabled"in e}_registerOnCollectionChange(e){this._onCollectionChange=e}_setUpdateStrategy(e){Tk(e)&&null!=e.updateOn&&(this._updateOn=e.updateOn)}_parentMarkedDirty(e){return!e&&!(!this._parent||!this._parent.dirty)&&!this._parent._anyControlsDirty()}}class Sh extends Ak{constructor(e=null,t,i){super(Mk(t),xk(i,t)),this._onChange=[],this._applyFormState(e),this._setUpdateStrategy(t),this._initObservables(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator})}setValue(e,t={}){this.value=this._pendingValue=e,this._onChange.length&&!1!==t.emitModelToViewChange&&this._onChange.forEach(i=>i(this.value,!1!==t.emitViewToModelChange)),this.updateValueAndValidity(t)}patchValue(e,t={}){this.setValue(e,t)}reset(e=null,t={}){this._applyFormState(e),this.markAsPristine(t),this.markAsUntouched(t),this.setValue(this.value,t),this._pendingChange=!1}_updateValue(){}_anyControls(e){return!1}_allControlsDisabled(){return this.disabled}registerOnChange(e){this._onChange.push(e)}_unregisterOnChange(e){HM(this._onChange,e)}registerOnDisabledChange(e){this._onDisabledChange.push(e)}_unregisterOnDisabledChange(e){HM(this._onDisabledChange,e)}_forEachChild(e){}_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(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}}class Dk extends Ak{constructor(e,t,i){super(Mk(t),xk(i,t)),this.controls=e,this._initObservables(),this._setUpdateStrategy(t),this._setUpControls(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator})}registerControl(e,t){return this.controls[e]?this.controls[e]:(this.controls[e]=t,t.setParent(this),t._registerOnCollectionChange(this._onCollectionChange),t)}addControl(e,t,i={}){this.registerControl(e,t),this.updateValueAndValidity({emitEvent:i.emitEvent}),this._onCollectionChange()}removeControl(e,t={}){this.controls[e]&&this.controls[e]._registerOnCollectionChange(()=>{}),delete this.controls[e],this.updateValueAndValidity({emitEvent:t.emitEvent}),this._onCollectionChange()}setControl(e,t,i={}){this.controls[e]&&this.controls[e]._registerOnCollectionChange(()=>{}),delete this.controls[e],t&&this.registerControl(e,t),this.updateValueAndValidity({emitEvent:i.emitEvent}),this._onCollectionChange()}contains(e){return this.controls.hasOwnProperty(e)&&this.controls[e].enabled}setValue(e,t={}){this._checkAllValuesPresent(e),Object.keys(e).forEach(i=>{this._throwIfControlMissing(i),this.controls[i].setValue(e[i],{onlySelf:!0,emitEvent:t.emitEvent})}),this.updateValueAndValidity(t)}patchValue(e,t={}){null!=e&&(Object.keys(e).forEach(i=>{this.controls[i]&&this.controls[i].patchValue(e[i],{onlySelf:!0,emitEvent:t.emitEvent})}),this.updateValueAndValidity(t))}reset(e={},t={}){this._forEachChild((i,r)=>{i.reset(e[r],{onlySelf:!0,emitEvent:t.emitEvent})}),this._updatePristine(t),this._updateTouched(t),this.updateValueAndValidity(t)}getRawValue(){return this._reduceChildren({},(e,t,i)=>(e[i]=t instanceof Sh?t.value:t.getRawValue(),e))}_syncPendingControls(){let e=this._reduceChildren(!1,(t,i)=>!!i._syncPendingControls()||t);return e&&this.updateValueAndValidity({onlySelf:!0}),e}_throwIfControlMissing(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: ${e}.`)}_forEachChild(e){Object.keys(this.controls).forEach(t=>{const i=this.controls[t];i&&e(i,t)})}_setUpControls(){this._forEachChild(e=>{e.setParent(this),e._registerOnCollectionChange(this._onCollectionChange)})}_updateValue(){this.value=this._reduceValue()}_anyControls(e){for(const t of Object.keys(this.controls)){const i=this.controls[t];if(this.contains(t)&&e(i))return!0}return!1}_reduceValue(){return this._reduceChildren({},(e,t,i)=>((t.enabled||this.disabled)&&(e[i]=t.value),e))}_reduceChildren(e,t){let i=e;return this._forEachChild((r,s)=>{i=t(i,r,s)}),i}_allControlsDisabled(){for(const e of Object.keys(this.controls))if(this.controls[e].enabled)return!1;return Object.keys(this.controls).length>0||this.disabled}_checkAllValuesPresent(e){this._forEachChild((t,i)=>{if(void 0===e[i])throw new Error(`Must supply a value for form control with name: '${i}'.`)})}}class Uxe extends Ak{constructor(e,t,i){super(Mk(t),xk(i,t)),this.controls=e,this._initObservables(),this._setUpdateStrategy(t),this._setUpControls(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator})}at(e){return this.controls[e]}push(e,t={}){this.controls.push(e),this._registerControl(e),this.updateValueAndValidity({emitEvent:t.emitEvent}),this._onCollectionChange()}insert(e,t,i={}){this.controls.splice(e,0,t),this._registerControl(t),this.updateValueAndValidity({emitEvent:i.emitEvent})}removeAt(e,t={}){this.controls[e]&&this.controls[e]._registerOnCollectionChange(()=>{}),this.controls.splice(e,1),this.updateValueAndValidity({emitEvent:t.emitEvent})}setControl(e,t,i={}){this.controls[e]&&this.controls[e]._registerOnCollectionChange(()=>{}),this.controls.splice(e,1),t&&(this.controls.splice(e,0,t),this._registerControl(t)),this.updateValueAndValidity({emitEvent:i.emitEvent}),this._onCollectionChange()}get length(){return this.controls.length}setValue(e,t={}){this._checkAllValuesPresent(e),e.forEach((i,r)=>{this._throwIfControlMissing(r),this.at(r).setValue(i,{onlySelf:!0,emitEvent:t.emitEvent})}),this.updateValueAndValidity(t)}patchValue(e,t={}){null!=e&&(e.forEach((i,r)=>{this.at(r)&&this.at(r).patchValue(i,{onlySelf:!0,emitEvent:t.emitEvent})}),this.updateValueAndValidity(t))}reset(e=[],t={}){this._forEachChild((i,r)=>{i.reset(e[r],{onlySelf:!0,emitEvent:t.emitEvent})}),this._updatePristine(t),this._updateTouched(t),this.updateValueAndValidity(t)}getRawValue(){return this.controls.map(e=>e instanceof Sh?e.value:e.getRawValue())}clear(e={}){this.controls.length<1||(this._forEachChild(t=>t._registerOnCollectionChange(()=>{})),this.controls.splice(0),this.updateValueAndValidity({emitEvent:e.emitEvent}))}_syncPendingControls(){let e=this.controls.reduce((t,i)=>!!i._syncPendingControls()||t,!1);return e&&this.updateValueAndValidity({onlySelf:!0}),e}_throwIfControlMissing(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 ${e}`)}_forEachChild(e){this.controls.forEach((t,i)=>{e(t,i)})}_updateValue(){this.value=this.controls.filter(e=>e.enabled||this.disabled).map(e=>e.value)}_anyControls(e){return this.controls.some(t=>t.enabled&&e(t))}_setUpControls(){this._forEachChild(e=>this._registerControl(e))}_checkAllValuesPresent(e){this._forEachChild((t,i)=>{if(void 0===e[i])throw new Error(`Must supply a value for form control at index: ${i}.`)})}_allControlsDisabled(){for(const e of this.controls)if(e.enabled)return!1;return this.controls.length>0||this.disabled}_registerControl(e){e.setParent(this),e._registerOnCollectionChange(this._onCollectionChange)}}const Hxe={provide:Po,useExisting:T(()=>mp)},qb=(()=>Promise.resolve(null))();let mp=(()=>{class n extends Po{constructor(t,i){super(),this.submitted=!1,this._directives=[],this.ngSubmit=new Le,this.form=new Dk({},mk(t),_k(i))}ngAfterViewInit(){this._setUpdateStrategy()}get formDirective(){return this}get control(){return this.form}get path(){return[]}get controls(){return this.form.controls}addControl(t){qb.then(()=>{const i=this._findContainer(t.path);t.control=i.registerControl(t.name,t.control),$b(t.control,t),t.control.updateValueAndValidity({emitEvent:!1}),this._directives.push(t)})}getControl(t){return this.form.get(t.path)}removeControl(t){qb.then(()=>{const i=this._findContainer(t.path);i&&i.removeControl(t.name),HM(this._directives,t)})}addFormGroup(t){qb.then(()=>{const i=this._findContainer(t.path),r=new Dk({});RG(r,t),i.registerControl(t.name,r),r.updateValueAndValidity({emitEvent:!1})})}removeFormGroup(t){qb.then(()=>{const i=this._findContainer(t.path);i&&i.removeControl(t.name)})}getFormGroup(t){return this.form.get(t.path)}updateModel(t,i){qb.then(()=>{this.form.get(t.path).setValue(i)})}setValue(t){this.control.setValue(t)}onSubmit(t){return this.submitted=!0,kG(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 n.\u0275fac=function(t){return new(t||n)(E(Ss,10),E(wh,10))},n.\u0275dir=oe({type:n,selectors:[["form",3,"ngNoForm","",3,"formGroup",""],["ng-form"],["","ngForm",""]],hostBindings:function(t,i){1&t&&ge("submit",function(s){return i.onSubmit(s)})("reset",function(){return i.onReset()})},inputs:{options:["ngFormOptions","options"]},outputs:{ngSubmit:"ngSubmit"},exportAs:["ngForm"],features:[Dt([Hxe]),ct]}),n})();const Gxe={provide:uc,useExisting:T(()=>Ok)},VG=(()=>Promise.resolve(null))();let Ok=(()=>{class n extends uc{constructor(t,i,r,s){super(),this.control=new Sh,this._registered=!1,this.update=new Le,this._parent=t,this._setValidators(i),this._setAsyncValidators(r),this.valueAccessor=Sk(0,s)}ngOnChanges(t){this._checkForErrors(),this._registered||this._setUpControl(),"isDisabled"in t&&this._updateDisabled(t),Ek(t,this.viewModel)&&(this._updateValue(this.model),this.viewModel=this.model)}ngOnDestroy(){this.formDirective&&this.formDirective.removeControl(this)}get path(){return this._parent?function(n,e){return[...e.path,n]}(this.name,this._parent):[this.name]}get formDirective(){return this._parent?this._parent.formDirective:null}viewToModelUpdate(t){this.viewModel=t,this.update.emit(t)}_setUpControl(){this._setUpdateStrategy(),this._isStandalone()?this._setUpStandalone():this.formDirective.addControl(this),this._registered=!0}_setUpdateStrategy(){this.options&&null!=this.options.updateOn&&(this.control._updateOn=this.options.updateOn)}_isStandalone(){return!this._parent||!(!this.options||!this.options.standalone)}_setUpStandalone(){$b(this.control,this),this.control.updateValueAndValidity({emitEvent:!1})}_checkForErrors(){this._isStandalone()||this._checkParentType(),this._checkName()}_checkParentType(){}_checkName(){this.options&&this.options.name&&(this.name=this.options.name),this._isStandalone()}_updateValue(t){VG.then(()=>{this.control.setValue(t,{emitViewToModelChange:!1})})}_updateDisabled(t){const i=t.isDisabled.currentValue,r=""===i||i&&"false"!==i;VG.then(()=>{r&&!this.control.disabled?this.control.disable():!r&&this.control.disabled&&this.control.enable()})}}return n.\u0275fac=function(t){return new(t||n)(E(Po,9),E(Ss,10),E(wh,10),E(ro,10))},n.\u0275dir=oe({type:n,selectors:[["","ngModel","",3,"formControlName","",3,"formControl",""]],inputs:{name:"name",isDisabled:["disabled","isDisabled"],model:["ngModel","model"],options:["ngModelOptions","options"]},outputs:{update:"ngModelChange"},exportAs:["ngModel"],features:[Dt([Gxe]),ct,zn]}),n})(),UG=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({}),n})();const Ik=new ve("NgModelWithFormControlWarning"),Kxe={provide:uc,useExisting:T(()=>GM)};let GM=(()=>{class n extends uc{constructor(t,i,r,s){super(),this._ngModelWarningConfig=s,this.update=new Le,this._ngModelWarningSent=!1,this._setValidators(t),this._setAsyncValidators(i),this.valueAccessor=Sk(0,r)}set isDisabled(t){}ngOnChanges(t){if(this._isControlChanged(t)){const i=t.form.previousValue;i&&zM(i,this,!1),$b(this.form,this),this.control.disabled&&this.valueAccessor.setDisabledState&&this.valueAccessor.setDisabledState(!0),this.form.updateValueAndValidity({emitEvent:!1})}Ek(t,this.viewModel)&&(this.form.setValue(this.model),this.viewModel=this.model)}ngOnDestroy(){this.form&&zM(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 n.\u0275fac=function(t){return new(t||n)(E(Ss,10),E(wh,10),E(ro,10),E(Ik,8))},n.\u0275dir=oe({type:n,selectors:[["","formControl",""]],inputs:{isDisabled:["disabled","isDisabled"],form:["formControl","form"],model:["ngModel","model"]},outputs:{update:"ngModelChange"},exportAs:["ngForm"],features:[Dt([Kxe]),ct,zn]}),n._ngModelWarningSentOnce=!1,n})();const Zxe={provide:Po,useExisting:T(()=>Zm)};let Zm=(()=>{class n extends Po{constructor(t,i){super(),this.validators=t,this.asyncValidators=i,this.submitted=!1,this._onCollectionChange=()=>this._updateDomValue(),this.directives=[],this.form=null,this.ngSubmit=new Le,this._setValidators(t),this._setAsyncValidators(i)}ngOnChanges(t){this._checkFormPresent(),t.hasOwnProperty("form")&&(this._updateValidators(),this._updateDomValue(),this._updateRegistrations(),this._oldForm=this.form)}ngOnDestroy(){this.form&&(UM(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 i=this.form.get(t.path);return $b(i,t),i.updateValueAndValidity({emitEvent:!1}),this.directives.push(t),i}getControl(t){return this.form.get(t.path)}removeControl(t){zM(t.control||null,t,!1),HM(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,i){this.form.get(t.path).setValue(i)}onSubmit(t){return this.submitted=!0,kG(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 i=t.control,r=this.form.get(t.path);i!==r&&(zM(i||null,t),r instanceof Sh&&($b(r,t),t.control=r))}),this.form._updateTreeValidity({emitEvent:!1})}_setUpFormContainer(t){const i=this.form.get(t.path);RG(i,t),i.updateValueAndValidity({emitEvent:!1})}_cleanUpFormContainer(t){if(this.form){const i=this.form.get(t.path);i&&function(n,e){return UM(n,e)}(i,t)&&i.updateValueAndValidity({emitEvent:!1})}}_updateRegistrations(){this.form._registerOnCollectionChange(this._onCollectionChange),this._oldForm&&this._oldForm._registerOnCollectionChange(()=>{})}_updateValidators(){wk(this.form,this),this._oldForm&&UM(this._oldForm,this)}_checkFormPresent(){}}return n.\u0275fac=function(t){return new(t||n)(E(Ss,10),E(wh,10))},n.\u0275dir=oe({type:n,selectors:[["","formGroup",""]],hostBindings:function(t,i){1&t&&ge("submit",function(s){return i.onSubmit(s)})("reset",function(){return i.onReset()})},inputs:{form:["formGroup","form"]},outputs:{ngSubmit:"ngSubmit"},exportAs:["ngForm"],features:[Dt([Zxe]),ct,zn]}),n})(),iW=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[UG]]}),n})(),Lk=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[iW]}),n})(),Bk=(()=>{class n{static withConfig(t){return{ngModule:n,providers:[{provide:Ik,useValue:t.warnOnNgModelWithFormControl}]}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[iW]}),n})();function Yb(n){return new ce(e=>{let t;try{t=n()}catch(r){return void e.error(r)}return(t?ui(t):bE()).subscribe(e)})}function Vk(n,e=Pf){const i=function(n){return n instanceof Date&&!isNaN(+n)}(n)?+n-e.now():Math.abs(n);return r=>r.lift(new m1e(i,e))}class m1e{constructor(e,t){this.delay=e,this.scheduler=t}call(e,t){return t.subscribe(new zk(e,this.delay,this.scheduler))}}class zk extends xt{constructor(e,t,i){super(e),this.delay=t,this.scheduler=i,this.queue=[],this.active=!1,this.errored=!1}static dispatch(e){const t=e.source,i=t.queue,r=e.scheduler,s=e.destination;for(;i.length>0&&i[0].time-r.now()<=0;)i.shift().notification.observe(s);if(i.length>0){const o=Math.max(0,i[0].time-r.now());this.schedule(e,o)}else this.unsubscribe(),t.active=!1}_schedule(e){this.active=!0,this.destination.add(e.schedule(zk.dispatch,this.delay,{source:this,destination:this.destination,scheduler:e}))}scheduleNotification(e){if(!0===this.errored)return;const t=this.scheduler,i=new _1e(t.now()+this.delay,e);this.queue.push(i),!1===this.active&&this._schedule(t)}_next(e){this.scheduleNotification(Ko.createNext(e))}_error(e){this.errored=!0,this.queue=[],this.destination.error(e),this.unsubscribe()}_complete(){this.scheduleNotification(Ko.createComplete()),this.unsubscribe()}}class _1e{constructor(e,t){this.time=e,this.notification=t}}const aW=tm({passive:!0});let lW=(()=>{class n{constructor(t,i){this._platform=t,this._ngZone=i,this._monitoredElements=new Map}monitor(t){if(!this._platform.isBrowser)return ec;const i=Wu(t),r=this._monitoredElements.get(i);if(r)return r.subject;const s=new Se,o="cdk-text-field-autofilled",a=l=>{"cdk-text-field-autofill-start"!==l.animationName||i.classList.contains(o)?"cdk-text-field-autofill-end"===l.animationName&&i.classList.contains(o)&&(i.classList.remove(o),this._ngZone.run(()=>s.next({target:l.target,isAutofilled:!1}))):(i.classList.add(o),this._ngZone.run(()=>s.next({target:l.target,isAutofilled:!0})))};return this._ngZone.runOutsideAngular(()=>{i.addEventListener("animationstart",a,aW),i.classList.add("cdk-text-field-autofill-monitored")}),this._monitoredElements.set(i,{subject:s,unlisten:()=>{i.removeEventListener("animationstart",a,aW)}}),s}stopMonitoring(t){const i=Wu(t),r=this._monitoredElements.get(i);r&&(r.unlisten(),r.subject.complete(),i.classList.remove("cdk-text-field-autofill-monitored"),i.classList.remove("cdk-text-field-autofilled"),this._monitoredElements.delete(i))}ngOnDestroy(){this._monitoredElements.forEach((t,i)=>this.stopMonitoring(i))}}return n.\u0275fac=function(t){return new(t||n)(I(si),I(dt))},n.\u0275prov=ue({factory:function(){return new n(I(si),I(dt))},token:n,providedIn:"root"}),n})(),cW=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[Rv]]}),n})();const k1e=new ve("MAT_INPUT_VALUE_ACCESSOR"),F1e=["button","checkbox","file","hidden","image","radio","range","reset","submit"];let N1e=0;const L1e=FO(class{constructor(n,e,t,i){this._defaultErrorStateMatcher=n,this._parentForm=e,this._parentFormGroup=t,this.ngControl=i}});let Xb=(()=>{class n extends L1e{constructor(t,i,r,s,o,a,l,c,d,f){super(a,s,o,r),this._elementRef=t,this._platform=i,this._autofillMonitor=c,this._formField=f,this._uid="mat-input-"+N1e++,this.focused=!1,this.stateChanges=new Se,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(_=>xV().has(_));const p=this._elementRef.nativeElement,g=p.nodeName.toLowerCase();this._inputValueAccessor=l||p,this._previousNativeValue=this.value,this.id=this.id,i.IOS&&d.runOutsideAngular(()=>{t.nativeElement.addEventListener("keyup",_=>{const y=_.target;!y.value&&0===y.selectionStart&&0===y.selectionEnd&&(y.setSelectionRange(1,1),y.setSelectionRange(0,0))})}),this._isServer=!this._platform.isBrowser,this._isNativeSelect="select"===g,this._isTextarea="textarea"===g,this._isInFormField=!!f,this._isNativeSelect&&(this.controlType=p.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=Mt(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=Mt(t)}get type(){return this._type}set type(t){this._type=t||"text",this._validateType(),!this._isTextarea&&xV().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=Mt(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,i;const r=(null===(i=null===(t=this._formField)||void 0===t?void 0:t._hideControlPlaceholder)||void 0===i?void 0:i.call(t))?null:this.placeholder;if(r!==this._previousPlaceholder){const s=this._elementRef.nativeElement;this._previousPlaceholder=r,r?s.setAttribute("placeholder",r):s.removeAttribute("placeholder")}}_dirtyCheckNativeValue(){const t=this._elementRef.nativeElement.value;this._previousNativeValue!==t&&(this._previousNativeValue=t,this.stateChanges.next())}_validateType(){F1e.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,i=t.options[0];return this.focused||t.multiple||!this.empty||!!(t.selectedIndex>-1&&i&&i.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 n.\u0275fac=function(t){return new(t||n)(E(rt),E(si),E(uc,10),E(mp,8),E(Zm,8),E(Vv),E(k1e,10),E(lW),E(dt),E(nS,8))},n.\u0275dir=oe({type:n,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,i){1&t&&ge("focus",function(){return i._focusChanged(!0)})("blur",function(){return i._focusChanged(!1)})("input",function(){return i._onInput()}),2&t&&(al("disabled",i.disabled)("required",i.required),nn("id",i.id)("data-placeholder",i.placeholder)("readonly",i.readonly&&!i._isNativeSelect||null)("aria-invalid",i.empty&&i.required?null:i.errorState)("aria-required",i.required),st("mat-input-server",i._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:[Dt([{provide:jv,useExisting:n}]),ct,zn]}),n})(),Kb=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({providers:[Vv],imports:[[cW,Uv,On],cW,Uv]}),n})();function ur(...n){const e=n.length;if(0===e)throw new Error("list of properties cannot be empty.");return t=>Ae(function(n,e){return i=>{let r=i;for(let s=0;si.lift(new U1e(n,e,t.leading,t.trailing))}class U1e{constructor(e,t,i,r){this.duration=e,this.scheduler=t,this.leading=i,this.trailing=r}call(e,t){return t.subscribe(new H1e(e,this.duration,this.scheduler,this.leading,this.trailing))}}class H1e extends xt{constructor(e,t,i,r,s){super(e),this.duration=t,this.scheduler=i,this.leading=r,this.trailing=s,this._hasTrailingValue=!1,this._trailingValue=null}_next(e){this.throttled?this.trailing&&(this._trailingValue=e,this._hasTrailingValue=!0):(this.add(this.throttled=this.scheduler.schedule($1e,this.duration,{subscriber:this})),this.leading?this.destination.next(e):this.trailing&&(this._trailingValue=e,this._hasTrailingValue=!0))}_complete(){this._hasTrailingValue?(this.destination.next(this._trailingValue),this.destination.complete()):this.destination.complete()}clearThrottle(){const e=this.throttled;e&&(this.trailing&&this._hasTrailingValue&&(this.destination.next(this._trailingValue),this._trailingValue=null,this._hasTrailingValue=!1),e.unsubscribe(),this.remove(e),this.throttled=null)}}function $1e(n){const{subscriber:e}=n;e.clearThrottle()}var hW=ze(266);const G1e={tooltipState:tc("state",[wr("initial, void, hidden",ti({opacity:0,transform:"scale(0)"})),wr("visible",ti({transform:"scale(1)"})),Qs("* => visible",Ao("200ms cubic-bezier(0, 0, 0.2, 1)",zie([ti({opacity:0,transform:"scale(0)",offset:0}),ti({opacity:.5,transform:"scale(0.99)",offset:.5}),ti({opacity:1,transform:"scale(1)",offset:1})]))),Qs("* => hidden",Ao("100ms cubic-bezier(0, 0, 0.2, 1)",ti({opacity:0})))])},fW="tooltip-panel",pW=tm({passive:!0}),gW=new ve("mat-tooltip-scroll-strategy"),X1e={provide:gW,deps:[Jo],useFactory:function(n){return()=>n.scrollStrategies.reposition({scrollThrottle:20})}},K1e=new ve("mat-tooltip-default-options",{providedIn:"root",factory:function(){return{showDelay:0,hideDelay:0,touchendHideDelay:1500}}});let Q1e=(()=>{class n{constructor(t,i,r,s,o,a,l,c,d,f,p,g){this._overlay=t,this._elementRef=i,this._scrollDispatcher=r,this._viewContainerRef=s,this._ngZone=o,this._platform=a,this._ariaDescriber=l,this._focusMonitor=c,this._dir=f,this._defaultOptions=p,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 Se,this._handleKeydown=_=>{this._isTooltipVisible()&&27===_.keyCode&&!Zs(_)&&(_.preventDefault(),_.stopPropagation(),this._ngZone.run(()=>this.hide(0)))},this._scrollStrategy=d,this._document=g,p&&(p.position&&(this.position=p.position),p.touchGestures&&(this.touchGestures=p.touchGestures)),f.change.pipe(Tn(this._destroyed)).subscribe(()=>{this._overlayRef&&this._updatePosition(this._overlayRef)}),o.runOutsideAngular(()=>{i.nativeElement.addEventListener("keydown",this._handleKeydown)})}get position(){return this._position}set position(t){var i;t!==this._position&&(this._position=t,this._overlayRef&&(this._updatePosition(this._overlayRef),null===(i=this._tooltipInstance)||void 0===i||i.show(0),this._overlayRef.updatePosition()))}get disabled(){return this._disabled}set disabled(t){this._disabled=Mt(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(Tn(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(([i,r])=>{t.removeEventListener(i,r,pW)}),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 i=this._createOverlay();this._detach(),this._portal=this._portal||new dm(this._tooltipComponent,this._viewContainerRef),this._tooltipInstance=i.attach(this._portal).instance,this._tooltipInstance.afterHidden().pipe(Tn(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),i=this._overlay.position().flexibleConnectedTo(this._elementRef).withTransformOriginOn(`.${this._cssClassPrefix}-tooltip`).withFlexibleDimensions(!1).withViewportMargin(this._viewportMargin).withScrollableContainers(t);return i.positionChanges.pipe(Tn(this._destroyed)).subscribe(r=>{this._updateCurrentPositionClass(r.connectionPair),this._tooltipInstance&&r.scrollableViewProperties.isOverlayClipped&&this._tooltipInstance.isVisible()&&this._ngZone.run(()=>this.hide(0))}),this._overlayRef=this._overlay.create({direction:this._dir,positionStrategy:i,panelClass:`${this._cssClassPrefix}-${fW}`,scrollStrategy:this._scrollStrategy()}),this._updatePosition(this._overlayRef),this._overlayRef.detachments().pipe(Tn(this._destroyed)).subscribe(()=>this._detach()),this._overlayRef.outsidePointerEvents().pipe(Tn(this._destroyed)).subscribe(()=>{var r;return null===(r=this._tooltipInstance)||void 0===r?void 0:r._handleBodyInteraction()}),this._overlayRef}_detach(){this._overlayRef&&this._overlayRef.hasAttached()&&this._overlayRef.detach(),this._tooltipInstance=null}_updatePosition(t){const i=t.getConfig().positionStrategy,r=this._getOrigin(),s=this._getOverlayPosition();i.withPositions([this._addOffset(Object.assign(Object.assign({},r.main),s.main)),this._addOffset(Object.assign(Object.assign({},r.fallback),s.fallback))])}_addOffset(t){return t}_getOrigin(){const t=!this._dir||"ltr"==this._dir.value,i=this.position;let r;"above"==i||"below"==i?r={originX:"center",originY:"above"==i?"top":"bottom"}:"before"==i||"left"==i&&t||"right"==i&&!t?r={originX:"start",originY:"center"}:("after"==i||"right"==i&&t||"left"==i&&!t)&&(r={originX:"end",originY:"center"});const{x:s,y:o}=this._invertPosition(r.originX,r.originY);return{main:r,fallback:{originX:s,originY:o}}}_getOverlayPosition(){const t=!this._dir||"ltr"==this._dir.value,i=this.position;let r;"above"==i?r={overlayX:"center",overlayY:"bottom"}:"below"==i?r={overlayX:"center",overlayY:"top"}:"before"==i||"left"==i&&t||"right"==i&&!t?r={overlayX:"end",overlayY:"center"}:("after"==i||"right"==i&&t||"left"==i&&!t)&&(r={overlayX:"start",overlayY:"center"});const{x:s,y:o}=this._invertPosition(r.overlayX,r.overlayY);return{main:r,fallback:{overlayX:s,overlayY:o}}}_updateTooltipMessage(){this._tooltipInstance&&(this._tooltipInstance.message=this.message,this._tooltipInstance._markForCheck(),this._ngZone.onMicrotaskEmpty.pipe(yi(1),Tn(this._destroyed)).subscribe(()=>{this._tooltipInstance&&this._overlayRef.updatePosition()}))}_setTooltipClass(t){this._tooltipInstance&&(this._tooltipInstance.tooltipClass=t,this._tooltipInstance._markForCheck())}_invertPosition(t,i){return"above"===this.position||"below"===this.position?"top"===i?i="bottom":"bottom"===i&&(i="top"):"end"===t?t="start":"start"===t&&(t="end"),{x:t,y:i}}_updateCurrentPositionClass(t){const{overlayY:i,originX:r,originY:s}=t;let o;if(o="center"===i?this._dir&&"rtl"===this._dir.value?"end"===r?"left":"right":"start"===r?"left":"right":"bottom"===i&&"top"===s?"above":"below",o!==this._currentPosition){const a=this._overlayRef;if(a){const l=`${this._cssClassPrefix}-${fW}-`;a.removePanelClass(l+this._currentPosition),a.addPanelClass(l+o)}this._currentPosition=o}}_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",i=>this._wheelListener(i)]);else if("off"!==this.touchGestures){this._disableNativeGesturesIfNecessary();const i=()=>{clearTimeout(this._touchstartTimeout),this.hide(this._defaultOptions.touchendHideDelay)};t.push(["touchend",i],["touchcancel",i])}this._addListeners(t),this._passiveListeners.push(...t)}_addListeners(t){t.forEach(([i,r])=>{this._elementRef.nativeElement.addEventListener(i,r,pW)})}_platformSupportsMouseEvents(){return!this._platform.IOS&&!this._platform.ANDROID}_wheelListener(t){if(this._isTooltipVisible()){const i=this._document.elementFromPoint(t.clientX,t.clientY),r=this._elementRef.nativeElement;i!==r&&!r.contains(i)&&this.hide()}}_disableNativeGesturesIfNecessary(){const t=this.touchGestures;if("off"!==t){const i=this._elementRef.nativeElement,r=i.style;("on"===t||"INPUT"!==i.nodeName&&"TEXTAREA"!==i.nodeName)&&(r.userSelect=r.msUserSelect=r.webkitUserSelect=r.MozUserSelect="none"),("on"===t||!i.draggable)&&(r.webkitUserDrag="none"),r.touchAction="none",r.webkitTapHighlightColor="transparent"}}}return n.\u0275fac=function(t){return new(t||n)(E(Jo),E(rt),E(um),E(ns),E(dt),E(si),E(IV),E(Sa),E(void 0),E(Qo),E(void 0),E(ut))},n.\u0275dir=oe({type:n,inputs:{showDelay:["matTooltipShowDelay","showDelay"],hideDelay:["matTooltipHideDelay","hideDelay"],touchGestures:["matTooltipTouchGestures","touchGestures"],position:["matTooltipPosition","position"],disabled:["matTooltipDisabled","disabled"],message:["matTooltip","message"],tooltipClass:["matTooltipClass","tooltipClass"]}}),n})(),dc=(()=>{class n extends Q1e{constructor(t,i,r,s,o,a,l,c,d,f,p,g){super(t,i,r,s,o,a,l,c,d,f,p,g),this._tooltipComponent=eTe}}return n.\u0275fac=function(t){return new(t||n)(E(Jo),E(rt),E(um),E(ns),E(dt),E(si),E(IV),E(Sa),E(gW),E(Qo,8),E(K1e,8),E(ut))},n.\u0275dir=oe({type:n,selectors:[["","matTooltip",""]],hostAttrs:[1,"mat-tooltip-trigger"],exportAs:["matTooltip"],features:[ct]}),n})(),J1e=(()=>{class n{constructor(t){this._changeDetectorRef=t,this._visibility="initial",this._closeOnInteraction=!1,this._onHide=new Se}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 i=t.toState;"hidden"===i&&!this.isVisible()&&this._onHide.next(),("visible"===i||"hidden"===i)&&(this._closeOnInteraction=!0)}_handleBodyInteraction(){this._closeOnInteraction&&this.hide(0)}_markForCheck(){this._changeDetectorRef.markForCheck()}_onShow(){}}return n.\u0275fac=function(t){return new(t||n)(E(kn))},n.\u0275dir=oe({type:n}),n})(),eTe=(()=>{class n extends J1e{constructor(t,i){super(t),this._breakpointObserver=i,this._isHandset=this._breakpointObserver.observe("(max-width: 599.98px) and (orientation: portrait), (max-width: 959.98px) and (orientation: landscape)")}}return n.\u0275fac=function(t){return new(t||n)(E(kn),E(XO))},n.\u0275cmp=Ne({type:n,selectors:[["mat-tooltip-component"]],hostAttrs:["aria-hidden","true"],hostVars:2,hostBindings:function(t,i){2&t&&vf("zoom","visible"===i._visibility?1:null)},features:[ct],decls:3,vars:7,consts:[[1,"mat-tooltip",3,"ngClass"]],template:function(t,i){if(1&t&&(R(0,"div",0),ge("@state.start",function(){return i._animationStart()})("@state.done",function(s){return i._animationDone(s)}),Kt(1,"async"),De(2),k()),2&t){let r;st("mat-tooltip-handset",null==(r=rn(1,5,i._isHandset))?null:r.matches),ie("ngClass",i.tooltipClass)("@state",i._visibility),G(2),xi(i.message)}},directives:[hE],pipes:[Hc],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:[G1e.tooltipState]},changeDetection:0}),n})(),hc=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({providers:[X1e],imports:[[Nie,dn,Yv,On],On,Wv]}),n})();const tTe=["sliderWrapper"],Cl=tm({passive:!1}),oTe={provide:ro,useExisting:T(()=>jk),multi:!0};class aTe{}const lTe=Hf(Uf(jf(class{constructor(n){this._elementRef=n}}),"accent"));let jk=(()=>{class n extends lTe{constructor(t,i,r,s,o,a,l,c){super(t),this._focusMonitor=i,this._changeDetectorRef=r,this._dir=s,this._ngZone=a,this._animationMode=c,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 Le,this.input=new Le,this.valueChange=new Le,this.onTouched=()=>{},this._percent=0,this._isSliding=null,this._isActive=!1,this._tickIntervalPercent=0,this._sliderDimensions=null,this._controlValueAccessorChangeFn=()=>{},this._dirChangeSubscription=Te.EMPTY,this._pointerDown=d=>{this.disabled||this._isSliding||!Zb(d)&&0!==d.button||this._ngZone.run(()=>{this._touchId=Zb(d)?function(n,e){for(let t=0;t{if("pointer"===this._isSliding){const f=mW(d,this._touchId);if(f){d.preventDefault();const p=this.value;this._lastPointerEvent=d,this._updateValueFromPosition(f),p!=this.value&&this._emitInputEvent()}}},this._pointerUp=d=>{"pointer"===this._isSliding&&(!Zb(d)||"number"!=typeof this._touchId||Uk(d.changedTouches,this._touchId))&&(d.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=l,this.tabIndex=parseInt(o)||0,a.runOutsideAngular(()=>{const d=t.nativeElement;d.addEventListener("mousedown",this._pointerDown,Cl),d.addEventListener("touchstart",this._pointerDown,Cl)})}get invert(){return this._invert}set invert(t){this._invert=Mt(t)}get max(){return this._max}set max(t){this._max=To(t,this._max),this._percent=this._calculatePercentage(this._value),this._changeDetectorRef.markForCheck()}get min(){return this._min}set min(t){this._min=To(t,this._min),this._percent=this._calculatePercentage(this._value),this._changeDetectorRef.markForCheck()}get step(){return this._step}set step(t){this._step=To(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=Mt(t)}get tickInterval(){return this._tickInterval}set tickInterval(t){this._tickInterval="auto"===t?"auto":"number"==typeof t||"string"==typeof t?To(t,this._tickInterval):0}get value(){return null===this._value&&(this.value=this._min),this._value}set value(t){if(t!==this._value){let i=To(t,0);this._roundToDecimal&&i!==this.min&&i!==this.max&&(i=parseFloat(i.toFixed(this._roundToDecimal))),this._value=i,this._percent=this._calculatePercentage(this._value),this._changeDetectorRef.markForCheck()}}get vertical(){return this._vertical}set vertical(t){this._vertical=Mt(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 i=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(${i})`}}_getTrackFillStyles(){const t=this.percent,r=this.vertical?`1, ${t}, 1`:`${t}, 1, 1`;return{transform:`translate${this.vertical?"Y":"X"}(${this._shouldInvertMouseCoords()?"":"-"}${this._getThumbGap()}px) scale3d(${r})`,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,a={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 l=this._shouldInvertAxis();let c;c=this.vertical?l?"Bottom":"Top":l?"Right":"Left",a[`padding${c}`]=`${this._getThumbGap()}px`}return a}_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,Cl),t.removeEventListener("touchstart",this._pointerDown,Cl),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||Zs(t)||this._isSliding&&"keyboard"!==this._isSliding)return;const i=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}i!=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 i=this._document,r=Zb(t),o=r?"touchend":"mouseup";i.addEventListener(r?"touchmove":"mousemove",this._pointerMove,Cl),i.addEventListener(o,this._pointerUp,Cl),r&&i.addEventListener("touchcancel",this._pointerUp,Cl);const a=this._getWindow();void 0!==a&&a&&a.addEventListener("blur",this._windowBlur)}_removeGlobalEvents(){const t=this._document;t.removeEventListener("mousemove",this._pointerMove,Cl),t.removeEventListener("mouseup",this._pointerUp,Cl),t.removeEventListener("touchmove",this._pointerMove,Cl),t.removeEventListener("touchend",this._pointerUp,Cl),t.removeEventListener("touchcancel",this._pointerUp,Cl);const i=this._getWindow();void 0!==i&&i&&i.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 o=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()&&(o=1-o),0===o)this.value=this.min;else if(1===o)this.value=this.max;else{const a=this._calculateValue(o),l=Math.round((a-this.min)/this.step)*this.step+this.min;this.value=this._clamp(l,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,s=Math.ceil(30/(t*this.step/(this.max-this.min)))*this.step;this._tickIntervalPercent=s/t}else this._tickIntervalPercent=this.tickInterval*this.step/(this.max-this.min)}_createChangeEvent(t=this.value){let i=new aTe;return i.source=this,i.value=t,i}_calculatePercentage(t){return((t||0)-this.min)/(this.max-this.min)}_calculateValue(t){return this.min+t*(this.max-this.min)}_clamp(t,i=0,r=1){return Math.max(i,Math.min(t,r))}_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 n.\u0275fac=function(t){return new(t||n)(E(rt),E(Sa),E(kn),E(Qo,8),Zr("tabindex"),E(dt),E(ut),E(Do,8))},n.\u0275cmp=Ne({type:n,selectors:[["mat-slider"]],viewQuery:function(t,i){if(1&t&&Jn(tTe,5),2&t){let r;_t(r=yt())&&(i._sliderWrapper=r.first)}},hostAttrs:["role","slider",1,"mat-slider","mat-focus-indicator"],hostVars:29,hostBindings:function(t,i){1&t&&ge("focus",function(){return i._onFocus()})("blur",function(){return i._onBlur()})("keydown",function(s){return i._onKeydown(s)})("keyup",function(){return i._onKeyup()})("mouseenter",function(){return i._onMouseenter()})("selectstart",function(s){return s.preventDefault()}),2&t&&(al("tabIndex",i.tabIndex),nn("aria-disabled",i.disabled)("aria-valuemax",i.max)("aria-valuemin",i.min)("aria-valuenow",i.value)("aria-valuetext",null==i.valueText?i.displayValue:i.valueText)("aria-orientation",i.vertical?"vertical":"horizontal"),st("mat-slider-disabled",i.disabled)("mat-slider-has-ticks",i.tickInterval)("mat-slider-horizontal",!i.vertical)("mat-slider-axis-inverted",i._shouldInvertAxis())("mat-slider-invert-mouse-coords",i._shouldInvertMouseCoords())("mat-slider-sliding",i._isSliding)("mat-slider-thumb-label-showing",i.thumbLabel)("mat-slider-vertical",i.vertical)("mat-slider-min-value",i._isMinValue())("mat-slider-hide-last-tick",i.disabled||i._isMinValue()&&i._getThumbGap()&&i._shouldInvertAxis())("_mat-animation-noopable","NoopAnimations"===i._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:[Dt([oTe]),ct],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,i){1&t&&(R(0,"div",0,1),R(2,"div",2),tt(3,"div",3),tt(4,"div",4),k(),R(5,"div",5),tt(6,"div",6),k(),R(7,"div",7),tt(8,"div",8),tt(9,"div",9),R(10,"div",10),R(11,"span",11),De(12),k(),k(),k(),k()),2&t&&(G(3),ie("ngStyle",i._getTrackBackgroundStyles()),G(1),ie("ngStyle",i._getTrackFillStyles()),G(1),ie("ngStyle",i._getTicksContainerStyles()),G(1),ie("ngStyle",i._getTicksStyles()),G(1),ie("ngStyle",i._getThumbContainerStyles()),G(5),xi(i.displayValue))},directives:[J3],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}),n})();function Zb(n){return"t"===n.type[0]}function mW(n,e){let t;return t=Zb(n)?"number"==typeof e?Uk(n.touches,e)||Uk(n.changedTouches,e):n.touches[0]||n.changedTouches[0]:n,t?{x:t.clientX,y:t.clientY}:void 0}function Uk(n,e){for(let t=0;t{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,On],On]}),n})();function uTe(n,e){}class Hk{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 dTe={dialogContainer:tc("dialogContainer",[wr("void, exit",ti({opacity:0,transform:"scale(0.7)"})),wr("enter",ti({transform:"none"})),Qs("* => enter",Ao("150ms cubic-bezier(0, 0, 0.2, 1)",ti({transform:"none",opacity:1}))),Qs("* => void, * => exit",Ao("75ms cubic-bezier(0.4, 0.0, 0.2, 1)",ti({opacity:0})))])};let hTe=(()=>{class n extends uS{constructor(t,i,r,s,o,a){super(),this._elementRef=t,this._focusTrapFactory=i,this._changeDetectorRef=r,this._config=o,this._focusMonitor=a,this._animationStateChanged=new Le,this._elementFocusedBeforeDialogWasOpened=null,this._closeInteractionType=null,this.attachDomPortal=l=>(this._portalOutlet.hasAttached(),this._portalOutlet.attachDomPortal(l)),this._ariaLabelledBy=o.ariaLabelledBy||null,this._document=s}_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 i=xE(),r=this._elementRef.nativeElement;(!i||i===this._document.body||i===r||r.contains(i))&&(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=xE())}_focusDialogContainer(){this._elementRef.nativeElement.focus&&this._elementRef.nativeElement.focus()}_containsFocus(){const t=this._elementRef.nativeElement,i=xE();return t===i||t.contains(i)}}return n.\u0275fac=function(t){return new(t||n)(E(rt),E(BV),E(kn),E(ut,8),E(Hk),E(Sa))},n.\u0275dir=oe({type:n,viewQuery:function(t,i){if(1&t&&Jn(Kf,7),2&t){let r;_t(r=yt())&&(i._portalOutlet=r.first)}},features:[ct]}),n})(),fTe=(()=>{class n extends hTe{constructor(){super(...arguments),this._state="enter"}_onAnimationDone({toState:t,totalTime:i}){"enter"===t?(this._trapFocus(),this._animationStateChanged.next({state:"opened",totalTime:i})):"exit"===t&&(this._restoreFocus(),this._animationStateChanged.next({state:"closed",totalTime:i}))}_onAnimationStart({toState:t,totalTime:i}){"enter"===t?this._animationStateChanged.next({state:"opening",totalTime:i}):("exit"===t||"void"===t)&&this._animationStateChanged.next({state:"closing",totalTime:i})}_startExitAnimation(){this._state="exit",this._changeDetectorRef.markForCheck()}}return n.\u0275fac=function(){let e;return function(i){return(e||(e=$n(n)))(i||n)}}(),n.\u0275cmp=Ne({type:n,selectors:[["mat-dialog-container"]],hostAttrs:["tabindex","-1","aria-modal","true",1,"mat-dialog-container"],hostVars:6,hostBindings:function(t,i){1&t&&Qy("@dialogContainer.start",function(s){return i._onAnimationStart(s)})("@dialogContainer.done",function(s){return i._onAnimationDone(s)}),2&t&&(al("id",i._id),nn("role",i._config.role)("aria-labelledby",i._config.ariaLabel?null:i._ariaLabelledBy)("aria-label",i._config.ariaLabel)("aria-describedby",i._config.ariaDescribedBy||null),Pg("@dialogContainer",i._state))},features:[ct],decls:1,vars:0,consts:[["cdkPortalOutlet",""]],template:function(t,i){1&t&&mt(0,uTe,0,0,"ng-template",0)},directives:[Kf],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:[dTe.dialogContainer]}}),n})(),pTe=0;class Qm{constructor(e,t,i="mat-dialog-"+pTe++){this._overlayRef=e,this._containerInstance=t,this.id=i,this.disableClose=this._containerInstance._config.disableClose,this._afterOpened=new Se,this._afterClosed=new Se,this._beforeClosed=new Se,this._state=0,t._id=i,t._animationStateChanged.pipe(Fn(r=>"opened"===r.state),yi(1)).subscribe(()=>{this._afterOpened.next(),this._afterOpened.complete()}),t._animationStateChanged.pipe(Fn(r=>"closed"===r.state),yi(1)).subscribe(()=>{clearTimeout(this._closeFallbackTimeout),this._finishDialogClose()}),e.detachments().subscribe(()=>{this._beforeClosed.next(this._result),this._beforeClosed.complete(),this._afterClosed.next(this._result),this._afterClosed.complete(),this.componentInstance=null,this._overlayRef.dispose()}),e.keydownEvents().pipe(Fn(r=>27===r.keyCode&&!this.disableClose&&!Zs(r))).subscribe(r=>{r.preventDefault(),$k(this,"keyboard")}),e.backdropClick().subscribe(()=>{this.disableClose?this._containerInstance._recaptureFocus():$k(this,"mouse")})}close(e){this._result=e,this._containerInstance._animationStateChanged.pipe(Fn(t=>"closing"===t.state),yi(1)).subscribe(t=>{this._beforeClosed.next(e),this._beforeClosed.complete(),this._overlayRef.detachBackdrop(),this._closeFallbackTimeout=setTimeout(()=>this._finishDialogClose(),t.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(e){let 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}updateSize(e="",t=""){return this._overlayRef.updateSize({width:e,height:t}),this._overlayRef.updatePosition(),this}addPanelClass(e){return this._overlayRef.addPanelClass(e),this}removePanelClass(e){return this._overlayRef.removePanelClass(e),this}getState(){return this._state}_finishDialogClose(){this._state=2,this._overlayRef.dispose()}_getPositionStrategy(){return this._overlayRef.getConfig().positionStrategy}}function $k(n,e,t){return void 0!==n._containerInstance&&(n._containerInstance._closeInteractionType=e),n.close(t)}const Gk=new ve("MatDialogData"),gTe=new ve("mat-dialog-default-options"),yW=new ve("mat-dialog-scroll-strategy"),_Te={provide:yW,deps:[Jo],useFactory:function(n){return()=>n.scrollStrategies.block()}};let yTe=(()=>{class n{constructor(t,i,r,s,o,a,l,c,d){this._overlay=t,this._injector=i,this._defaultOptions=r,this._parentDialog=s,this._overlayContainer=o,this._dialogRefConstructor=l,this._dialogContainerType=c,this._dialogDataToken=d,this._openDialogsAtThisLevel=[],this._afterAllClosedAtThisLevel=new Se,this._afterOpenedAtThisLevel=new Se,this._ariaHiddenElements=new Map,this.afterAllClosed=Yb(()=>this.openDialogs.length?this._getAfterAllClosed():this._getAfterAllClosed().pipe(Rr(void 0))),this._scrollStrategy=a}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,i){(i=function(n,e){return Object.assign(Object.assign({},e),n)}(i,this._defaultOptions||new Hk)).id&&this.getDialogById(i.id);const r=this._createOverlay(i),s=this._attachDialogContainer(r,i),o=this._attachDialogContent(t,s,r,i);return this.openDialogs.length||this._hideNonDialogContentFromAssistiveTechnology(),this.openDialogs.push(o),o.afterClosed().subscribe(()=>this._removeOpenDialog(o)),this.afterOpened.next(o),s._initializeWithAttachedContent(),o}closeAll(){this._closeDialogs(this.openDialogs)}getDialogById(t){return this.openDialogs.find(i=>i.id===t)}ngOnDestroy(){this._closeDialogs(this._openDialogsAtThisLevel),this._afterAllClosedAtThisLevel.complete(),this._afterOpenedAtThisLevel.complete()}_createOverlay(t){const i=this._getOverlayConfig(t);return this._overlay.create(i)}_getOverlayConfig(t){const i=new qv({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&&(i.backdropClass=t.backdropClass),i}_attachDialogContainer(t,i){const s=Nt.create({parent:i&&i.viewContainerRef&&i.viewContainerRef.injector||this._injector,providers:[{provide:Hk,useValue:i}]}),o=new dm(this._dialogContainerType,i.viewContainerRef,s,i.componentFactoryResolver);return t.attach(o).instance}_attachDialogContent(t,i,r,s){const o=new this._dialogRefConstructor(r,i,s.id);if(t instanceof Ys)i.attachTemplatePortal(new Xf(t,null,{$implicit:s.data,dialogRef:o}));else{const a=this._createInjector(s,o,i),l=i.attachComponentPortal(new dm(t,s.viewContainerRef,a));o.componentInstance=l.instance}return o.updateSize(s.width,s.height).updatePosition(s.position),o}_createInjector(t,i,r){const s=t&&t.viewContainerRef&&t.viewContainerRef.injector,o=[{provide:this._dialogContainerType,useValue:r},{provide:this._dialogDataToken,useValue:t.data},{provide:this._dialogRefConstructor,useValue:i}];return t.direction&&(!s||!s.get(Qo,null,At.Optional))&&o.push({provide:Qo,useValue:{value:t.direction,change:ht()}}),Nt.create({parent:s||this._injector,providers:o})}_removeOpenDialog(t){const i=this.openDialogs.indexOf(t);i>-1&&(this.openDialogs.splice(i,1),this.openDialogs.length||(this._ariaHiddenElements.forEach((r,s)=>{r?s.setAttribute("aria-hidden",r):s.removeAttribute("aria-hidden")}),this._ariaHiddenElements.clear(),this._getAfterAllClosed().next()))}_hideNonDialogContentFromAssistiveTechnology(){const t=this._overlayContainer.getContainerElement();if(t.parentElement){const i=t.parentElement.children;for(let r=i.length-1;r>-1;r--){let s=i[r];s!==t&&"SCRIPT"!==s.nodeName&&"STYLE"!==s.nodeName&&!s.hasAttribute("aria-live")&&(this._ariaHiddenElements.set(s,s.getAttribute("aria-hidden")),s.setAttribute("aria-hidden","true"))}}}_closeDialogs(t){let i=t.length;for(;i--;)t[i].close()}}return n.\u0275fac=function(t){return new(t||n)(E(Jo),E(Nt),E(void 0),E(void 0),E(hm),E(void 0),E(Du),E(Du),E(ve))},n.\u0275dir=oe({type:n}),n})(),_p=(()=>{class n extends yTe{constructor(t,i,r,s,o,a,l){super(t,i,s,a,l,o,Qm,fTe,Gk)}}return n.\u0275fac=function(t){return new(t||n)(I(Jo),I(Nt),I(Xg,8),I(gTe,8),I(yW),I(n,12),I(hm))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})(),bTe=0,Wk=(()=>{class n{constructor(t,i,r){this._dialogRef=t,this._elementRef=i,this._dialog=r,this.id="mat-dialog-title-"+bTe++}ngOnInit(){this._dialogRef||(this._dialogRef=function(n,e){let t=n.nativeElement.parentElement;for(;t&&!t.classList.contains("mat-dialog-container");)t=t.parentElement;return t?e.find(i=>i.id===t.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 n.\u0275fac=function(t){return new(t||n)(E(Qm,8),E(rt),E(_p))},n.\u0275dir=oe({type:n,selectors:[["","mat-dialog-title",""],["","matDialogTitle",""]],hostAttrs:[1,"mat-dialog-title"],hostVars:1,hostBindings:function(t,i){2&t&&al("id",i.id)},inputs:{id:"id"},exportAs:["matDialogTitle"]}),n})(),qk=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275dir=oe({type:n,selectors:[["","mat-dialog-content",""],["mat-dialog-content"],["","matDialogContent",""]],hostAttrs:[1,"mat-dialog-content"]}),n})();let Qb=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({providers:[_p,_Te],imports:[[Yv,dS,On],On]}),n})();const Yk=new ve("CdkAccordion");let ETe=0,MTe=(()=>{class n{constructor(t,i,r){this.accordion=t,this._changeDetectorRef=i,this._expansionDispatcher=r,this._openCloseAllSubscription=Te.EMPTY,this.closed=new Le,this.opened=new Le,this.destroyed=new Le,this.expandedChange=new Le,this.id="cdk-accordion-child-"+ETe++,this._expanded=!1,this._disabled=!1,this._removeUniqueSelectionListener=()=>{},this._removeUniqueSelectionListener=r.listen((s,o)=>{this.accordion&&!this.accordion.multi&&this.accordion.id===o&&this.id!==s&&(this.expanded=!1)}),this.accordion&&(this._openCloseAllSubscription=this._subscribeToOpenCloseAllActions())}get expanded(){return this._expanded}set expanded(t){t=Mt(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=Mt(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 n.\u0275fac=function(t){return new(t||n)(E(Yk,12),E(kn),E(cS))},n.\u0275dir=oe({type:n,selectors:[["cdk-accordion-item"],["","cdkAccordionItem",""]],inputs:{expanded:"expanded",disabled:"disabled"},outputs:{closed:"closed",opened:"opened",destroyed:"destroyed",expandedChange:"expandedChange"},exportAs:["cdkAccordionItem"],features:[Dt([{provide:Yk,useValue:void 0}])]}),n})(),xTe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({}),n})();const TTe=["body"];function ATe(n,e){}const DTe=[[["mat-expansion-panel-header"]],"*",[["mat-action-row"]]],OTe=["mat-expansion-panel-header","*","mat-action-row"];function ITe(n,e){1&n&&tt(0,"span",2),2&n&&ie("@indicatorRotate",Qe()._getExpandedState())}const PTe=[[["mat-panel-title"]],[["mat-panel-description"]],"*"],RTe=["mat-panel-title","mat-panel-description","*"],Xk=new ve("MAT_ACCORDION"),bW="225ms cubic-bezier(0.4,0.0,0.2,1)",CW={indicatorRotate:tc("indicatorRotate",[wr("collapsed, void",ti({transform:"rotate(0deg)"})),wr("expanded",ti({transform:"rotate(180deg)"})),Qs("expanded <=> collapsed, void => collapsed",Ao(bW))]),bodyExpansion:tc("bodyExpansion",[wr("collapsed, void",ti({height:"0px",visibility:"hidden"})),wr("expanded",ti({height:"*",visibility:"visible"})),Qs("expanded <=> collapsed, void => collapsed",Ao(bW))])};let kTe=(()=>{class n{constructor(t){this._template=t}}return n.\u0275fac=function(t){return new(t||n)(E(Ys))},n.\u0275dir=oe({type:n,selectors:[["ng-template","matExpansionPanelContent",""]]}),n})(),FTe=0;const wW=new ve("MAT_EXPANSION_PANEL_DEFAULT_OPTIONS");let qM=(()=>{class n extends MTe{constructor(t,i,r,s,o,a,l){super(t,i,r),this._viewContainerRef=s,this._animationMode=a,this._hideToggle=!1,this.afterExpand=new Le,this.afterCollapse=new Le,this._inputChanges=new Se,this._headerId="mat-expansion-panel-header-"+FTe++,this._bodyAnimationDone=new Se,this.accordion=t,this._document=o,this._bodyAnimationDone.pipe(Zo((c,d)=>c.fromState===d.fromState&&c.toState===d.toState)).subscribe(c=>{"void"!==c.fromState&&("expanded"===c.toState?this.afterExpand.emit():"collapsed"===c.toState&&this.afterCollapse.emit())}),l&&(this.hideToggle=l.hideToggle)}get hideToggle(){return this._hideToggle||this.accordion&&this.accordion.hideToggle}set hideToggle(t){this._hideToggle=Mt(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(Rr(null),Fn(()=>this.expanded&&!this._portal),yi(1)).subscribe(()=>{this._portal=new Xf(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,i=this._body.nativeElement;return t===i||i.contains(t)}return!1}}return n.\u0275fac=function(t){return new(t||n)(E(Xk,12),E(kn),E(cS),E(ns),E(ut),E(Do,8),E(wW,8))},n.\u0275cmp=Ne({type:n,selectors:[["mat-expansion-panel"]],contentQueries:function(t,i,r){if(1&t&&ei(r,kTe,5),2&t){let s;_t(s=yt())&&(i._lazyContent=s.first)}},viewQuery:function(t,i){if(1&t&&Jn(TTe,5),2&t){let r;_t(r=yt())&&(i._body=r.first)}},hostAttrs:[1,"mat-expansion-panel"],hostVars:6,hostBindings:function(t,i){2&t&&st("mat-expanded",i.expanded)("_mat-animation-noopable","NoopAnimations"===i._animationMode)("mat-expansion-panel-spacing",i._hasSpacing())},inputs:{disabled:"disabled",expanded:"expanded",hideToggle:"hideToggle",togglePosition:"togglePosition"},outputs:{opened:"opened",closed:"closed",expandedChange:"expandedChange",afterExpand:"afterExpand",afterCollapse:"afterCollapse"},exportAs:["matExpansionPanel"],features:[Dt([{provide:Xk,useValue:void 0}]),ct,zn],ngContentSelectors:OTe,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,i){1&t&&(wi(DTe),Ht(0),R(1,"div",0,1),ge("@bodyExpansion.done",function(s){return i._bodyAnimationDone.next(s)}),R(3,"div",2),Ht(4,1),mt(5,ATe,0,0,"ng-template",3),k(),Ht(6,2),k()),2&t&&(G(1),ie("@bodyExpansion",i._getExpandedState())("id",i.id),nn("aria-labelledby",i._headerId),G(4),ie("cdkPortalOutlet",i._portal))},directives:[Kf],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:[CW.bodyExpansion]},changeDetection:0}),n})();class LTe{}const BTe=Hf(LTe);let YM=(()=>{class n extends BTe{constructor(t,i,r,s,o,a,l){super(),this.panel=t,this._element=i,this._focusMonitor=r,this._changeDetectorRef=s,this._animationMode=a,this._parentChangeSubscription=Te.EMPTY;const c=t.accordion?t.accordion._stateChanges.pipe(Fn(d=>!(!d.hideToggle&&!d.togglePosition))):ec;this.tabIndex=parseInt(l||"")||0,this._parentChangeSubscription=Ni(t.opened,t.closed,c,t._inputChanges.pipe(Fn(d=>!!(d.hideToggle||d.disabled||d.togglePosition)))).subscribe(()=>this._changeDetectorRef.markForCheck()),t.closed.pipe(Fn(()=>t._containsFocus())).subscribe(()=>r.focusVia(i,"program")),o&&(this.expandedHeight=o.expandedHeight,this.collapsedHeight=o.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:Zs(t)||(t.preventDefault(),this._toggle());break;default:return void(this.panel.accordion&&this.panel.accordion._handleHeaderKeydown(t))}}focus(t,i){t?this._focusMonitor.focusVia(this._element,t,i):this._element.nativeElement.focus(i)}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 n.\u0275fac=function(t){return new(t||n)(E(qM,1),E(rt),E(Sa),E(kn),E(wW,8),E(Do,8),Zr("tabindex"))},n.\u0275cmp=Ne({type:n,selectors:[["mat-expansion-panel-header"]],hostAttrs:["role","button",1,"mat-expansion-panel-header","mat-focus-indicator"],hostVars:15,hostBindings:function(t,i){1&t&&ge("click",function(){return i._toggle()})("keydown",function(s){return i._keydown(s)}),2&t&&(nn("id",i.panel._headerId)("tabindex",i.tabIndex)("aria-controls",i._getPanelId())("aria-expanded",i._isExpanded())("aria-disabled",i.panel.disabled),vf("height",i._getHeaderHeight()),st("mat-expanded",i._isExpanded())("mat-expansion-toggle-indicator-after","after"===i._getTogglePosition())("mat-expansion-toggle-indicator-before","before"===i._getTogglePosition())("_mat-animation-noopable","NoopAnimations"===i._animationMode))},inputs:{tabIndex:"tabIndex",expandedHeight:"expandedHeight",collapsedHeight:"collapsedHeight"},features:[ct],ngContentSelectors:RTe,decls:5,vars:1,consts:[[1,"mat-content"],["class","mat-expansion-indicator",4,"ngIf"],[1,"mat-expansion-indicator"]],template:function(t,i){1&t&&(wi(PTe),R(0,"span",0),Ht(1),Ht(2,1),Ht(3,2),k(),mt(4,ITe,1,1,"span",1)),2&t&&(G(4),ie("ngIf",i._showToggle()))},directives:[zr],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:[CW.indicatorRotate]},changeDetection:0}),n})(),EW=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275dir=oe({type:n,selectors:[["mat-panel-title"]],hostAttrs:[1,"mat-expansion-panel-header-title"]}),n})(),Kk=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,On,xTe,dS]]}),n})();var SW=ze(478);Object.create(Error.prototype);const UTe=["*"];var KM=(()=>(function(n){n.LineHighlight="line-highlight",n.LineNumbers="line-numbers"}(KM||(KM={})),KM))();class $Te{}const xW=new ve("SECURITY_CONTEXT");let Zk=(()=>{class n{constructor(t,i,r,s,o){this.platform=t,this.securityContext=i,this.http=r,this.sanitizer=o,this.initialMarkedOptions={renderer:new SW.Renderer},this.options=s}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,i=!1,r=!1,s=this.options){const o=this.trimIndentation(t),a=i?this.decodeHtml(o):o,l=r?this.renderEmoji(a):a,c=SW.parse(l,s);return this.sanitizer.sanitize(this.securityContext,c)||""}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(Ae(i=>this.handleExtension(t,i)))}highlight(t){if(Of(this.platform)&&"undefined"!=typeof Prism){t||(t=document);const i=t.querySelectorAll('pre code:not([class*="language-"])');Array.prototype.forEach.call(i,r=>r.classList.add("language-none")),Prism.highlightAllUnder(t)}}renderKatex(t,i){if(!Of(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,(r,s)=>katex.renderToString(s,i))}decodeHtml(t){if(!Of(this.platform))return t;const i=document.createElement("textarea");return i.innerHTML=t,i.value}handleExtension(t,i){const r=t?t.split("?")[0].split(".").splice(-1).join():"";return"md"!==r?"```"+r+"\n"+i+"\n```":i}renderEmoji(t){if(!Of(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 i;return t.split("\n").map(r=>{let s=i;return r.length>0&&(s=isNaN(s)?r.search(/\S|$/):Math.min(r.search(/\S|$/),s)),isNaN(i)&&(i=s),s?r.substring(s):r}).join("\n")}}return n.\u0275fac=function(t){return new(t||n)(I(dl),I(xW),I(Wf,8),I($Te,8),I(th))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})(),TW=(()=>{class n{constructor(t,i){this.element=t,this.markdownService=i,this.error=new Le,this.load=new Le,this.ready=new Le,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,i=!1){let r=this.markdownService.compile(t,i,this.emoji);r=this.katex?this.markdownService.renderKatex(r,this.katexOptions):r,this.element.nativeElement.innerHTML=r,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,KM.LineNumbers),this.setPluginOptions(this.element.nativeElement,{dataStart:this.start}))}setPluginClass(t,i){const r=t.querySelectorAll("pre");for(let s=0;s{const a=i[o];if(a){const l=this.toLispCase(o);r.item(s).setAttribute(l,a.toString())}})}toLispCase(t){const i=t.match(/([A-Z])/g);if(!i)return t;let r=t.toString();for(let s=0,o=i.length;s{class n{static forRoot(t){return{ngModule:n,providers:[Zk,t&&t.loader||[],t&&t.markedOptions||[],{provide:xW,useValue:t&&null!=t.sanitize?t.sanitize:mn.HTML}]}}static forChild(){return{ngModule:n}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({}),n})();function AW(n,e,t){return t?AW(n,e).pipe(Ae(i=>we(i)?t(...i):t(i))):new ce(i=>{const r=(...o)=>i.next(1===o.length?o[0]:o);let s;try{s=n(r)}catch(o){return void i.error(o)}if(Ke(e))return()=>e(r,s)})}function ZM(...n){return e=>{let t;return"function"==typeof n[n.length-1]&&(t=n.pop()),e.lift(new ZTe(n,t))}}class ZTe{constructor(e,t){this.observables=e,this.project=t}call(e,t){return t.subscribe(new QTe(e,this.observables,this.project))}}class QTe extends cU{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)}}class JTe{constructor(e,t,i=!1){this.accumulator=e,this.seed=t,this.hasSeed=i}call(e,t){return t.subscribe(new eAe(e,this.accumulator,this.seed,this.hasSeed))}}class eAe extends xt{constructor(e,t,i,r){super(e),this.accumulator=t,this._seed=i,this.hasSeed=r,this.index=0}get seed(){return this._seed}set seed(e){this.hasSeed=!0,this._seed=e}_next(e){if(this.hasSeed)return this._tryNext(e);this.seed=e,this.destination.next(e)}_tryNext(e){const t=this.index++;let i;try{i=this.accumulator(this.seed,e,t)}catch(r){this.destination.error(r)}this.seed=i,this.destination.next(i)}}class iAe{constructor(e){this.predicate=e}call(e,t){return t.subscribe(new rAe(e,this.predicate))}}class rAe extends xt{constructor(e,t){super(e),this.predicate=t,this.skipping=!0,this.index=0}_next(e){const t=this.destination;this.skipping&&this.tryCallPredicate(e),this.skipping||t.next(e)}tryCallPredicate(e){try{const t=this.predicate(e,this.index++);this.skipping=Boolean(t)}catch(t){this.destination.error(t)}}}const sAe=["youtubeContainer"];let IW=(()=>{class n{constructor(t,i){this._ngZone=t,this._youtubeContainer=new Se,this._destroyed=new Se,this._playerChanges=new ar(void 0),this._videoId=new ar(void 0),this._height=new ar(390),this._width=new ar(640),this._startSeconds=new ar(void 0),this._endSeconds=new ar(void 0),this._suggestedQuality=new ar(void 0),this._playerVars=new ar(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=Of(i)}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=ht(!0);if(!window.YT||!window.YT.Player){const r=new Se;this._existingApiReadyCallback=window.onYouTubeIframeAPIReady,window.onYouTubeIframeAPIReady=()=>{this._existingApiReadyCallback&&this._existingApiReadyCallback(),this._ngZone.run(()=>r.next(!0))},t=r.pipe(yi(1),Rr(!1))}const i=function(n,e,t,i,r,s,o){const a=Qi([e,s]).pipe(ZM(Qi([i,r])),Ae(([l,c])=>{const[d,f]=l,[p,g]=c;return d?{videoId:d,playerVars:f,width:p,height:g}:void 0}));return Qi([n,a,ht(o)]).pipe(function(n){return Mr(function(...n){let e=null;return"function"==typeof n[n.length-1]&&(e=n.pop()),1===n.length&&we(n[0])&&(n=n[0].slice()),t=>t.lift.call(ui([t,...n]),new hU(e))}(n),function(n){return e=>e.lift(new iAe(n))}(([e,t])=>!t),Ae(([e])=>e))}(t),function(n,e){let t=!1;return arguments.length>=2&&(t=!0),function(r){return r.lift(new JTe(n,e,t))}}(dAe,void 0),Zo())}(this._youtubeContainer,this._videoId,t,this._width,this._height,this._playerVars,this._ngZone).pipe(Ti(r=>{this._playerChanges.next(r)}),di(e=>e?PW(e)?ht(e):new ce(t=>{let i=!1,r=!1;const s=o=>{r=!0,i||(o.target.removeEventListener("onReady",s),t.next(o.target))};return e.addEventListener("onReady",s),()=>{i=!0,r||(r=>{PW(r)||r.destroy()})(e)}}).pipe(yi(1),Rr(void 0)):ht(void 0)),Tn(this._destroyed),mc(new Se));i.subscribe(r=>{this._player=r,r&&this._pendingPlayerState&&this._initializePlayer(r,this._pendingPlayerState),this._pendingPlayerState=void 0}),function(n,e,t){Qi([n,e,t]).subscribe(([i,r,s])=>i&&i.setSize(r,s))}(i,this._width,this._height),function(n,e){Qi([n,e]).subscribe(([t,i])=>t&&i&&t.setPlaybackQuality(i))}(i,this._suggestedQuality),function(n,e,t,i,r,s){const o=Qi([t,i]).pipe(Ae(([d,f])=>({startSeconds:d,endSeconds:f}))),a=o.pipe(Jk(n,d=>!!d&&!function(n){const e=n.getPlayerState();return e!==YT.PlayerState.UNSTARTED&&e!==YT.PlayerState.CUED}(d))),l=e.pipe(Jk(n,(d,f)=>!!d&&d.videoId!==f));Ni(n.pipe(Jk(Qi([e,o]),([d,f],p)=>!(!p||d==p.videoId&&!f.startSeconds&&!f.endSeconds))),l,a).pipe(ZM(Qi([n,e,o,r])),Ae(([d,f])=>f),Tn(s)).subscribe(([d,f,p,g])=>{!f||!d||(d.videoId=f,d.cueVideoById(Object.assign({videoId:f,suggestedQuality:g},p)))})}(i,this._videoId,this._startSeconds,this._endSeconds,this._suggestedQuality,this._destroyed),i.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,i){this._player?this._player.seekTo(t,i):this._getPendingState().seek={seconds:t,allowSeekAhead:i}}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,i){const{playbackState:r,playbackRate:s,volume:o,muted:a,seek:l}=i;switch(r){case YT.PlayerState.PLAYING:t.playVideo();break;case YT.PlayerState.PAUSED:t.pauseVideo();break;case YT.PlayerState.CUED:t.stopVideo()}null!=s&&t.setPlaybackRate(s),null!=o&&t.setVolume(o),null!=a&&(a?t.mute():t.unMute()),null!=l&&t.seekTo(l.seconds,l.allowSeekAhead)}_getLazyEmitter(t){return this._playerChanges.pipe(Pr(i=>i?AW(r=>{i.addEventListener(t,r)},r=>{try{i.removeEventListener&&i.removeEventListener(t,r)}catch(s){}}):ht()),i=>new ce(r=>i.subscribe({next:s=>this._ngZone.run(()=>r.next(s)),error:s=>r.error(s),complete:()=>r.complete()})),Tn(this._destroyed))}}return n.\u0275fac=function(t){return new(t||n)(E(dt),E(dl))},n.\u0275cmp=Ne({type:n,selectors:[["youtube-player"]],viewQuery:function(t,i){if(1&t&&Jn(sAe,5),2&t){let r;_t(r=yt())&&(i.youtubeContainer=r.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,i){1&t&&tt(0,"div",null,0)},encapsulation:2,changeDetection:0}),n})();function dAe(n,[e,t,i]){if(n&&t&&n.playerVars!==t.playerVars)n.destroy();else{if(!t)return void(n&&n.destroy());if(n)return n}const r=i.runOutsideAngular(()=>new YT.Player(e,t));return r.videoId=t.videoId,r.playerVars=t.playerVars,r}function PW(n){return"getPlayerStatus"in n}function Jk(n,e){return Mr(ZM(n),Fn(([t,i])=>e(i,t)),Ae(([t])=>t))}let pAe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({}),n})(),CAe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275dir=oe({type:n,selectors:[["","mat-card-sm-image",""],["","matCardImageSmall",""]],hostAttrs:[1,"mat-card-sm-image"]}),n})();function e0(n){return!0===n}function so(n){return null==n}function ka(n){return!so(n)}function eF(n){return Boolean(n)}function NW(n){return so(n)?n:JSON.parse(JSON.stringify(n))}const JM=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])&&JM(n[o])}),n};function LW(n){return ka(n)&&"object"==typeof n&&function(n){return"[object Object]"===Object.prototype.toString.call(n)}(n)}const zW="NGXS_DATA_META",nF="NGXS_META",jW="NGXS_ARGUMENT_REGISTRY_META";let UW=(()=>{class n{constructor(t){this.sequence$=new ar(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)(I(cu,8))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();function t0(n){return n[zW]}let Fa=(()=>{class n{constructor(t,i,r){n.store=t.get(cu),n.ngZone=t.get(dt),n.factory=i,n.context=r,n.computed=t.get(UW)}}return n.store=null,n.computed=null,n.context=null,n.factory=null,n.ngZone=null,n.\u0275fac=function(t){return new(t||n)(I(Nt),I(B$),I(L$))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();class Fr{constructor(){Fr.statesCachedMeta.clear()}static createStateContext(e){return Fa.context.createStateContext(e)}static ensureMappedState(e){if(so(Fa.factory)||so(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)?Fr.statesCachedMeta.get(e.name):null)||Fr.ensureMeta(e)}static getRepositoryByInstance(e){var t;const r=null!==(t=t0(Fr.getStateClassByInstance(e)))&&void 0!==t?t:null;if(so(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=Fr.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=Fr.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=Fa.factory.states)||void 0===t?void 0:t.find(r=>r.name===e.name):null;return ka(i)&&ka(e.name)&&Fr.statesCachedMeta.set(e.name,i),i}}Fr.statesCachedMeta=new Map,Fr.\u0275fac=function(e){return new(e||Fr)},Fr.\u0275prov=ue({token:Fr,factory:Fr.\u0275fac}),new If(1);class $Ae 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 HW(n){var e;return null!==(e=n.NGXS_OPTIONS_META)&&void 0!==e?e:{name:""}}function $W(n){var e;const t=HW(n),i=null!==(e=t.children)&&void 0!==e?e:[],s=NW(void 0===t.defaults?{}:t.defaults);if(i.length){if(LW(s))return function(n,e){return e.reduce((t,i)=>{const r=HW(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()]=$W(i),t},null!=n?n:{})}(s,i);throw new $Ae(s)}return s}function WW(n){var e;return null!==(e=n.__NGXS_COMPUTED_OPTION__)&&void 0!==e?e:null}function qW(){var n,e;return null!==(e=null===(n=null==Fa?void 0:Fa.computed)||void 0===n?void 0:n.sequenceValue)&&void 0!==e?e:0}function YAe(n){let e=!1;return cm(n)&&(e=!0),e}function iF(n){return n[jW]}class XAe extends Error{constructor(e,t){super(`An argument with the name '${e}' already exists in the method '${t}'`)}}class KAe{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(eF(this.argumentMap.has(e))||eF(this.payloadMap.has(e)))throw new XAe(e,t)}}function rF(n){return Mo()?JM(n):n}function tDe(n){return{enumerable:!0,configurable:!0,get(){const e=t0(n),t=Fr.ensureMappedState(e.stateMeta);return Fr.createStateContext(t)}}}function sF(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:()=>Mo()?JM(n.getState()):n.getState(),setState(e){n.setState(e)},patchState(e){n.patchState(e)}})}function oi(){return(n,e,t)=>{!function(n,e){if(!function(n,e){var t;let i=n,r=!1;if(LW(i))for(;null!==i;){if(e0(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 so(WW(n))&&Object.defineProperties(n,{__NGXS_COMPUTED_OPTION__:{enumerable:!0,configurable:!0,value:new WeakMap}}),WW(n)}(this),o=null==s?void 0:s.get(i);if(e0(null==o?void 0:o.isObservable))return null==o?void 0:o.value;if(so(o)||o.sequenceId!==qW()){s.delete(i);const l=i.apply(this,r);return s.set(i,{value:l,sequenceId:qW(),isObservable:YAe(l)}),l}return o.value},t}}const oDe={cancelUncompleted:!0,insideZone:!1};function on(n=oDe){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=Fr.getRepositoryByInstance(a),d=c.operations;let f=d[s];const p=c.stateMeta,g=iF(r);if(so(f)){const w=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),x=function(n){const{statePath:e,argumentsNames:t,methodName:i,argumentRegistry:r}=n;let s="";for(let o=0;o{var w;return e0(n.insideZone)?null===(w=Fa.ngZone)||void 0===w||w.run(()=>{l=r.apply(a,o)}):l=r.apply(a,o),cm(l)?ht(null).pipe(Ae(()=>l)):l};const v=Fr.createAction(f,o,g),C=Fa.store.dispatch(v);return cm(l)?function(n,e){return Hv([n,e]).pipe(Ae(t=>t.pop()))}(C,l):l},i}}function Ms(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 so(iF(t))&&Object.defineProperties(t,{[jW]:{enumerable:!0,configurable:!0,value:new KAe}}),iF(t)})(e,t).createPayloadType(r,t,i)}}function xh(){return n=>{const e=function(n){if(function(n){return!eF(n)}(n.hasOwnProperty(nF))){const e={name:null,actions:{},defaults:{},path:null,makeRootSelector:t=>t.getStateGetter(e.name),children:[]};Object.defineProperty(n,nF,{value:e})}return function(n){var e;return null===(e=n)||void 0===e?void 0:e[nF]}(n)}(n);if(so(e.name))throw new Error("@StateRepository should be add before decorator @State");!function(n,e){(function(n){var e;const t=null!==(e=t0(n))&&void 0!==e?e:null;return(so(t)||(null==t?void 0:t.stateClass)!==n)&&function(n){Object.defineProperty(n,zW,{writable:!0,configurable:!0,enumerable:!0,value:{stateMeta:null,operations:{},stateClass:n}})}(n),t0(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:()=>NW(t)},context:tDe(n)})}(n,e,$W(n)),function(n){var e,t;const i=t0(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(so(Fa.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]=Fa.store.select(n).pipe(Ae(o=>Mo()?JM(o):o),qc({refCount:!0,bufferSize:1})),this[s]}}})}}(n)}}var tx=(()=>(function(n){n.ID="id"}(tx||(tx={})),tx))(),n0=(()=>(function(n){n.ASC="asc",n.DESC="desc"}(n0||(n0={})),n0))();let oF=(()=>{class n{constructor(){this.browserStorageEvents$=new Se,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=ue({token:n,factory:n.\u0275fac}),n})(),cDe=(()=>{class n extends oF{get snapshot(){return rF(this.getState())}get ctx(){return sF(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=$n(n)))(i||n)}}(),n.\u0275prov=ue({token:n,factory:n.\u0275fac}),xe([oi(),Xe("design:type",Object),Xe("design:paramtypes",[])],n.prototype,"snapshot",null),xe([on(),ws(0,Ms("patchValue")),Xe("design:type",Function),Xe("design:paramtypes",[Object]),Xe("design:returntype",void 0)],n.prototype,"patchState",null),xe([on(),ws(0,Ms("stateValue")),Xe("design:type",Function),Xe("design:paramtypes",[Object]),Xe("design:returntype",void 0)],n.prototype,"setState",null),xe([on(),Xe("design:type",Function),Xe("design:paramtypes",[]),Xe("design:returntype",void 0)],n.prototype,"reset",null),n})(),uDe=(()=>{class n extends oF{constructor(){super(...arguments),this.primaryKey=tx.ID,this.comparator=null}get snapshot(){return rF(this.getState())}get ids(){return this.snapshot.ids}get entities(){return this.snapshot.entities}get entitiesArray(){const t=this.snapshot;return t.ids.map(i=>t.entities[i])}get ids$(){return this.state$.pipe(Ae(t=>t.ids))}get entities$(){return this.state$.pipe(Ae(t=>t.entities))}get entitiesArray$(){return this.state$.pipe(Ae(t=>t.ids.map(i=>t.entities[i])))}get ctx(){return sF(this.context)}setComparator(t){return this.comparator=t,this}dispatch(t){return this.ctx.dispatch(t)}getState(){return this.ctx.getState()}selectId(t){var i;return null===(i=t)||void 0===i?void 0:i[this.primaryKey]}selectOne(t){var i;return null!==(i=this.snapshot.entities[t])&&void 0!==i?i:null}selectAll(){const t=this.getState();return t.ids.map(i=>t.entities[i])}reset(){this.setEntitiesState(this.initialState),this.markAsDirtyAfterReset()}addOne(t){this.addEntityOne(t)}addMany(t){this.addEntitiesMany(t)}setOne(t){this.setEntityOne(t)}setMany(t){this.setEntitiesMany(t)}setAll(t){this.setEntitiesAll(t)}updateOne(t){this.updateEntitiesMany([t])}updateMany(t){this.updateEntitiesMany(t)}upsertOne(t){this.upsertEntitiesMany([t])}upsertMany(t){this.upsertEntitiesMany(t)}removeOne(t){this.removeEntitiesMany([t])}removeMany(t){this.removeEntitiesMany(t)}removeByEntity(t){const i=this.selectId(t);this.removeEntitiesMany([i])}removeByEntities(t){const i=[];for(const r of t){const s=this.selectId(r);i.push(s)}this.removeEntitiesMany(i)}removeAll(){this.setEntitiesState(this.initialState)}sort(t){this.comparator=null!=t?t:this.comparator,so(this.comparator)?console.warn("You must set the compare function before sorting."):this.setEntitiesState(this.getState())}addEntityOne(t){const i=this.getState(),r=this.selectIdValue(t);r in i.entities||this.setEntitiesState(Object.assign(Object.assign({},i),{ids:[...i.ids,r],entities:Object.assign(Object.assign({},i.entities),{[r]:t})}))}addEntitiesMany(t){const i=this.getState(),r={},s=[];for(const o of t){const a=this.selectIdValue(o);a in i.entities||a in r||(s.push(a),r[a]=o)}s.length&&this.setEntitiesState(Object.assign(Object.assign({},i),{ids:[...i.ids,...s],entities:Object.assign(Object.assign({},i.entities),r)}))}setEntitiesAll(t){const i=this.getState(),r={},s=[];for(const o of t){const a=this.selectIdValue(o);a in r||(s.push(a),r[a]=o)}this.setEntitiesState(Object.assign(Object.assign({},i),{ids:s,entities:r}))}setEntityOne(t){const i=this.getState(),r=this.selectIdValue(t);this.setEntitiesState(Object.assign(Object.assign({},i),r in i.entities?{entities:Object.assign(Object.assign({},i.entities),{[r]:t})}:{ids:[...i.ids,r],entities:Object.assign(Object.assign({},i.entities),{[r]:t})}))}setEntitiesMany(t){for(const i of t)this.setEntityOne(i)}updateEntitiesMany(t){const i=this.getState(),r=t.filter(a=>a.id in i.entities);if(0===r.length)return;const s=this.generateKeyMap(i),o=Object.assign({},i.entities);for(const a of r){const l=this.updateOrigin(o,a),c=this.selectIdValue(l);c!==a.id&&(delete s[a.id],delete o[a.id]),s[a.id]=c,o[c]=l}this.setEntitiesState(Object.assign(Object.assign({},i),{ids:i.ids.map(a=>{var l;return null!==(l=s[a])&&void 0!==l?l:a}),entities:o}))}upsertEntitiesMany(t){const i=this.getState(),r=[],s=[];for(const o of t){const a=this.selectIdValue(o);a in i.entities?r.push({id:a,changes:o}):s.push(o)}this.updateMany(r),this.addMany(s)}removeEntitiesMany(t){const i=this.getState(),r=this.generateKeyMap(i),s=Object.assign({},i.entities);for(const o of t)o in s&&(delete r[o],delete s[o]);this.setEntitiesState(Object.assign(Object.assign({},i),{ids:i.ids.filter(o=>o in r),entities:s}))}setEntitiesState(t){const i=this.sortKeysByComparator(t.ids,t.entities);this.ctx.setState(Object.assign(Object.assign({},t),{ids:i,entities:t.entities}))}sortKeysByComparator(t,i){if(so(this.comparator))return t;const r=t.slice(),s=this.comparator;return"function"==typeof s?r.sort((o,a)=>s(i[o],i[a])):this.sortByComparatorOptions(r,s,i)}sortByComparatorOptions(t,i,r){switch(null==i?void 0:i.sortByOrder){case n0.ASC:return t.sort((s,o)=>function(n,e,t){return(null==e?void 0:e[n])>(null==t?void 0:t[n])?1:(null==e?void 0:e[n])<(null==t?void 0:t[n])?-1:0}(null==i?void 0:i.sortBy,r[s],r[o]));case n0.DESC:return t.sort((s,o)=>function(n,e,t){return(null==e?void 0:e[n])>(null==t?void 0:t[n])?-1:(null==e?void 0:e[n])<(null==t?void 0:t[n])?1:0}(null==i?void 0:i.sortBy,r[s],r[o]));default:return Mo()&&console.warn(`Invalid --\x3e { sortByOrder: "${null==i?void 0:i.sortByOrder}" } not supported!`),t}}generateKeyMap(t){return t.ids.reduce((i,r)=>(i[r]=r,i),{})}updateOrigin(t,i){return Object.assign(Object.assign({},t[i.id]),i.changes)}selectIdValue(t){const i=this.selectId(t);return so(i)&&Mo()&&console.warn(`The entity passed to the 'selectId' implementation returned ${i}.`,"You should probably provide your own 'selectId' implementation.","The entity that was passed:",t,"The current `selectId` implementation: (entity: V): K => entity.id"),i}}return n.\u0275fac=function(){let e;return function(i){return(e||(e=$n(n)))(i||n)}}(),n.\u0275prov=ue({token:n,factory:n.\u0275fac}),xe([oi(),Xe("design:type",Object),Xe("design:paramtypes",[])],n.prototype,"snapshot",null),xe([oi(),Xe("design:type",Array),Xe("design:paramtypes",[])],n.prototype,"ids",null),xe([oi(),Xe("design:type",Object),Xe("design:paramtypes",[])],n.prototype,"entities",null),xe([oi(),Xe("design:type",Array),Xe("design:paramtypes",[])],n.prototype,"entitiesArray",null),xe([oi(),Xe("design:type",ce),Xe("design:paramtypes",[])],n.prototype,"ids$",null),xe([oi(),Xe("design:type",ce),Xe("design:paramtypes",[])],n.prototype,"entities$",null),xe([oi(),Xe("design:type",ce),Xe("design:paramtypes",[])],n.prototype,"entitiesArray$",null),xe([on(),Xe("design:type",Function),Xe("design:paramtypes",[]),Xe("design:returntype",void 0)],n.prototype,"reset",null),xe([on(),ws(0,Ms("entity")),Xe("design:type",Function),Xe("design:paramtypes",[Object]),Xe("design:returntype",void 0)],n.prototype,"addOne",null),xe([on(),ws(0,Ms("entities")),Xe("design:type",Function),Xe("design:paramtypes",[Array]),Xe("design:returntype",void 0)],n.prototype,"addMany",null),xe([on(),ws(0,Ms("entity")),Xe("design:type",Function),Xe("design:paramtypes",[Object]),Xe("design:returntype",void 0)],n.prototype,"setOne",null),xe([on(),ws(0,Ms("entities")),Xe("design:type",Function),Xe("design:paramtypes",[Array]),Xe("design:returntype",void 0)],n.prototype,"setMany",null),xe([on(),ws(0,Ms("entities")),Xe("design:type",Function),Xe("design:paramtypes",[Array]),Xe("design:returntype",void 0)],n.prototype,"setAll",null),xe([on(),ws(0,Ms("update")),Xe("design:type",Function),Xe("design:paramtypes",[Object]),Xe("design:returntype",void 0)],n.prototype,"updateOne",null),xe([on(),ws(0,Ms("updates")),Xe("design:type",Function),Xe("design:paramtypes",[Array]),Xe("design:returntype",void 0)],n.prototype,"updateMany",null),xe([on(),ws(0,Ms("entity")),Xe("design:type",Function),Xe("design:paramtypes",[Object]),Xe("design:returntype",void 0)],n.prototype,"upsertOne",null),xe([on(),ws(0,Ms("entities")),Xe("design:type",Function),Xe("design:paramtypes",[Array]),Xe("design:returntype",void 0)],n.prototype,"upsertMany",null),xe([on(),ws(0,Ms("id")),Xe("design:type",Function),Xe("design:paramtypes",[Object]),Xe("design:returntype",void 0)],n.prototype,"removeOne",null),xe([on(),ws(0,Ms("ids")),Xe("design:type",Function),Xe("design:paramtypes",[Array]),Xe("design:returntype",void 0)],n.prototype,"removeMany",null),xe([on(),ws(0,Ms("entity")),Xe("design:type",Function),Xe("design:paramtypes",[Object]),Xe("design:returntype",void 0)],n.prototype,"removeByEntity",null),xe([on(),ws(0,Ms("entities")),Xe("design:type",Function),Xe("design:paramtypes",[Array]),Xe("design:returntype",void 0)],n.prototype,"removeByEntities",null),xe([on(),Xe("design:type",Function),Xe("design:paramtypes",[]),Xe("design:returntype",void 0)],n.prototype,"removeAll",null),xe([on(),ws(0,Ms("comparator")),Xe("design:type",Function),Xe("design:paramtypes",[Object]),Xe("design:returntype",void 0)],n.prototype,"sort",null),n})(),Jm=(()=>{class n extends oF{get snapshot(){return rF(this.getState())}get ctx(){return sF(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=$n(n)))(i||n)}}(),n.\u0275prov=ue({token:n,factory:n.\u0275fac}),xe([oi(),Xe("design:type",Object),Xe("design:paramtypes",[])],n.prototype,"snapshot",null),xe([on(),ws(0,Ms("patchValue")),Xe("design:type",Function),Xe("design:paramtypes",[Object]),Xe("design:returntype",void 0)],n.prototype,"patchState",null),xe([on(),ws(0,Ms("stateValue")),Xe("design:type",Function),Xe("design:paramtypes",[Object]),Xe("design:returntype",void 0)],n.prototype,"setState",null),xe([on(),Xe("design:type",Function),Xe("design:paramtypes",[]),Xe("design:returntype",void 0)],n.prototype,"reset",null),n})();function aF(){return Fn(n=>null!=n)}const dDe={};function lF(...n){const e=n[n.length-1];let t=n,i=dDe;return"object"==typeof e&&(i=e,t=t.slice(0,-1)),r=>r.pipe(ur(...t),Zo(i.compare),qc(1))}const s_=new ve("ngx-google-analytics-settings",{factory:()=>({trackingCode:"",enableTracing:!1})}),IF=new ve("ngx-window",{providedIn:"root",factory:()=>function(n){return Of(n)?window:null}(Oc(dl))}),wIe=new ve("ngx-data-layer",{providedIn:"root",factory:()=>function(n){return n?n.dataLayer=n.dataLayer||[]:null}(Oc(IF))}),PF=new ve("ngx-gtag-fn",{providedIn:"root",factory:()=>function(n,e){return n?n.gtag=n.gtag||function(){e.push(arguments)}:null}(Oc(IF),Oc(wIe))});let xs=(()=>{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||Mo())&&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)(I(s_),I(ut),I(PF))},n.\u0275prov=ue({factory:function(){return new n(I(s_),I(ut),I(PF))},token:n,providedIn:"root"}),n})();const MIe={provide:Mf,multi:!0,useFactory:function(n,e,t){return()=>yl(this,void 0,void 0,function*(){var i;if(!n.trackingCode)return void(Mo()||console.error("Empty tracking code for Google Analytics. Make sure to provide one when initializing NgxGoogleAnalyticsModule."));if(!e)return void(Mo()||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||Mo()||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:[s_,PF,ut]};new ve("ngx-google-analytics-routing-settings",{factory:()=>({})});let RF=(()=>{class n{static forRoot(t,i=[],r,s,o){return{ngModule:n,providers:[{provide:s_,useValue:{trackingCode:t,initCommands:i,uri:r,enableTracing:s,nonce:o}},MIe]}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[]]}),n})(),f0=(()=>{class n{constructor(){this.consent="not-set",this.consentChange=new If(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=ue({token:n,factory:n.\u0275fac}),n})(),DIe=(()=>{class n{constructor(t,i,{trackingCode:r}){this.window=i,this.subscriptions=new Te,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)(I(f0),I(IF),I(s_))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();const OIe=new ve("Key under which consent is stored",{providedIn:"root",factory:()=>"ALLOW_TELEMETRY"}),Kq=[f0,DIe,(()=>{class n{constructor(t,i){this.key=i,this.subscriptions=new Te;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)(I(f0),I(OIe))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})()];function PIe(n){return Object.entries(n).reduce((e,[t,i])=>(null!=i&&(e[t]=`${i}`),e),{})}let kIe=(()=>{class n{static forRoot(t){const{providers:i=[]}=RF.forRoot(t.gaToken,function(n){const{appName:e,projectName:t,developmentMode:i}=n;return[{command:"set",values:[PIe({appName:e,projectName:t,developmentMode:i})]}]}(t));return{ngModule:n,providers:i}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({providers:[...Kq,{provide:Mf,multi:!0,useFactory:()=>()=>{},deps:Kq}],imports:[[RF]]}),n})();class Zq extends Error{constructor(){super(...arguments),this.message="NgxsDispatchPluginModule is not imported"}}function FIe(){throw new Zq}function NIe(){throw new Zq}function kF(n,e,t){e.run(()=>n.dispatch(t))}function VIe(n,e,t,i){return Og(t)?function(n,e,t){return t.then(i=>(kF(n,e,i),i))}(n,e,t):cm(t)?function(n,e,t,i){return null!==i&&(t=t.pipe(Tn(i.cancelUncompleted$))),t.subscribe({next:r=>kF(n,e,r)}),t}(n,e,t,i):(kF(n,e,t),t)}class zIe{constructor(){this.cancelUncompleted$=new Se}cancelPreviousAction(){this.cancelUncompleted$.next()}}const FF="\u0275fac",Qq=Symbol("InjectorInstance"),Jq=Symbol("FactoryHasBeenDecorated");function e9(n,e){const t=n[Qq];return t?t.get(e):null}const HIe={cancelUncompleted:!1};function t9(n=HIe){return(e,t,i)=>{let r;const s=function(n){return n?new zIe:null}(n.cancelUncompleted);function o(){null!==s&&s.cancelPreviousAction();const a=e9(this,cu)||FIe(),l=e9(this,dt)||NIe(),c=r.apply(this,arguments);return l.runOutsideAngular(()=>VIe(a,l,c,s))}"function"==typeof(null==i?void 0:i.value)?(r=i.value,i.value=o):Object.defineProperty(e,t,{set:a=>r=a,get:()=>o}),function(n){if(Jq in n.constructor.prototype)return;const e=n.constructor;"function"==typeof e[FF]&&function(n){const e=n[FF];if("function"!=typeof e)return;const t=n.\u0275prov||n.\u0275pipe||n.\u0275cmp||n.\u0275dir,i=()=>{const r=e();return r[Qq]=E(Fc),r};t&&(t.factory=i),Object.defineProperty(n,FF,{get:()=>i})}(e),n.constructor.prototype[Jq]=!0}(e)}}let n9=(()=>{class n{constructor(){this._vertical=!1,this._inset=!1}get vertical(){return this._vertical}set vertical(t){this._vertical=Mt(t)}get inset(){return this._inset}set inset(t){this._inset=Mt(t)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=Ne({type:n,selectors:[["mat-divider"]],hostAttrs:["role","separator",1,"mat-divider"],hostVars:7,hostBindings:function(t,i){2&t&&(nn("aria-orientation",i.vertical?"vertical":"horizontal"),st("mat-divider-vertical",i.vertical)("mat-divider-horizontal",!i.vertical)("mat-divider-inset",i.inset))},inputs:{vertical:"vertical",inset:"inset"},decls:0,vars:0,template:function(t,i){},styles:[".mat-divider{display:block;margin:0;border-top-width:1px;border-top-style:solid}.mat-divider.mat-divider-vertical{border-top:0;border-right-width:1px;border-right-style:solid}.mat-divider.mat-divider-inset{margin-left:80px}[dir=rtl] .mat-divider.mat-divider-inset{margin-left:auto;margin-right:80px}\n"],encapsulation:2,changeDetection:0}),n})(),yx=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[On],On]}),n})();const sPe=["input"],oPe=function(n){return{enterDuration:n}},aPe=["*"],lPe=new ve("mat-checkbox-default-options",{providedIn:"root",factory:c9});function c9(){return{color:"accent",clickAction:"check-indeterminate"}}let cPe=0;const u9=c9(),uPe={provide:ro,useExisting:T(()=>VF),multi:!0};class dPe{}const hPe=Hf(Uf(nc(jf(class{constructor(n){this._elementRef=n}}))));let VF=(()=>{class n extends hPe{constructor(t,i,r,s,o,a,l){super(t),this._changeDetectorRef=i,this._focusMonitor=r,this._ngZone=s,this._animationMode=a,this._options=l,this.ariaLabel="",this.ariaLabelledby=null,this._uniqueId="mat-checkbox-"+ ++cPe,this.id=this._uniqueId,this.labelPosition="after",this.name=null,this.change=new Le,this.indeterminateChange=new Le,this._onTouched=()=>{},this._currentAnimationClass="",this._currentCheckState=0,this._controlValueAccessorChangeFn=()=>{},this._checked=!1,this._disabled=!1,this._indeterminate=!1,this._options=this._options||u9,this.color=this.defaultColor=this._options.color||u9.color,this.tabIndex=parseInt(o)||0}get inputId(){return`${this.id||this._uniqueId}-input`}get required(){return this._required}set required(t){this._required=Mt(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 i=Mt(t);i!==this.disabled&&(this._disabled=i,this._changeDetectorRef.markForCheck())}get indeterminate(){return this._indeterminate}set indeterminate(t){const i=t!=this._indeterminate;this._indeterminate=Mt(t),i&&(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 i=this._currentCheckState,r=this._elementRef.nativeElement;if(i!==t&&(this._currentAnimationClass.length>0&&r.classList.remove(this._currentAnimationClass),this._currentAnimationClass=this._getAnimationClassForCheckStateTransition(i,t),this._currentCheckState=t,this._currentAnimationClass.length>0)){r.classList.add(this._currentAnimationClass);const s=this._currentAnimationClass;this._ngZone.runOutsideAngular(()=>{setTimeout(()=>{r.classList.remove(s)},1e3)})}}_emitChangeEvent(){const t=new dPe;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 i;const r=null===(i=this._options)||void 0===i?void 0:i.clickAction;t.stopPropagation(),this.disabled||"noop"===r?!this.disabled&&"noop"===r&&(this._inputElement.nativeElement.checked=this.checked,this._inputElement.nativeElement.indeterminate=this.indeterminate):(this.indeterminate&&"check"!==r&&Promise.resolve().then(()=>{this._indeterminate=!1,this.indeterminateChange.emit(this._indeterminate)}),this.toggle(),this._transitionCheckState(this._checked?1:2),this._emitChangeEvent())}focus(t,i){t?this._focusMonitor.focusVia(this._inputElement,t,i):this._inputElement.nativeElement.focus(i)}_onInteractionEvent(t){t.stopPropagation()}_getAnimationClassForCheckStateTransition(t,i){if("NoopAnimations"===this._animationMode)return"";let r="";switch(t){case 0:if(1===i)r="unchecked-checked";else{if(3!=i)return"";r="unchecked-indeterminate"}break;case 2:r=1===i?"unchecked-checked":"unchecked-indeterminate";break;case 1:r=2===i?"checked-unchecked":"checked-indeterminate";break;case 3:r=1===i?"indeterminate-checked":"indeterminate-unchecked"}return`mat-checkbox-anim-${r}`}_syncIndeterminate(t){const i=this._inputElement;i&&(i.nativeElement.indeterminate=t)}}return n.\u0275fac=function(t){return new(t||n)(E(rt),E(kn),E(Sa),E(dt),Zr("tabindex"),E(Do,8),E(lPe,8))},n.\u0275cmp=Ne({type:n,selectors:[["mat-checkbox"]],viewQuery:function(t,i){if(1&t&&(Jn(sPe,5),Jn(Js,5)),2&t){let r;_t(r=yt())&&(i._inputElement=r.first),_t(r=yt())&&(i.ripple=r.first)}},hostAttrs:[1,"mat-checkbox"],hostVars:12,hostBindings:function(t,i){2&t&&(al("id",i.id),nn("tabindex",null),st("mat-checkbox-indeterminate",i.indeterminate)("mat-checkbox-checked",i.checked)("mat-checkbox-disabled",i.disabled)("mat-checkbox-label-before","before"==i.labelPosition)("_mat-animation-noopable","NoopAnimations"===i._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:[Dt([uPe]),ct],ngContentSelectors:aPe,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,i){if(1&t&&(wi(),R(0,"label",0,1),R(2,"span",2),R(3,"input",3,4),ge("change",function(s){return i._onInteractionEvent(s)})("click",function(s){return i._onInputClick(s)}),k(),R(5,"span",5),tt(6,"span",6),k(),tt(7,"span",7),R(8,"span",8),Yt.lFrame.currentNamespace=Wn,R(9,"svg",9),tt(10,"path",10),k(),Yt.lFrame.currentNamespace=null,tt(11,"span",11),k(),k(),R(12,"span",12,13),ge("cdkObserveContent",function(){return i._onLabelTextChange()}),R(14,"span",14),De(15,"\xa0"),k(),Ht(16),k(),k()),2&t){const r=vs(1),s=vs(13);nn("for",i.inputId),G(2),st("mat-checkbox-inner-container-no-side-margin",!s.textContent||!s.textContent.trim()),G(1),ie("id",i.inputId)("required",i.required)("checked",i.checked)("disabled",i.disabled)("tabIndex",i.tabIndex),nn("value",i.value)("name",i.name)("aria-label",i.ariaLabel||null)("aria-labelledby",i.ariaLabelledby)("aria-checked",i._getAriaChecked())("aria-describedby",i.ariaDescribedby),G(2),ie("matRippleTrigger",r)("matRippleDisabled",i._isRippleDisabled())("matRippleRadius",20)("matRippleCentered",!0)("matRippleAnimation",Hg(19,oPe,"NoopAnimations"===i._animationMode?0:150))}},directives:[Js,WD],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}),n})(),d9=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({}),n})(),h9=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[_l,On,SE,d9],On,d9]}),n})();const gPe=["bodyCanvas"];let mPe=(()=>{class n{constructor(){this.clsName="ccf-body-ui",this.rotationChange=new Le,this.nodeDrag=new Le,this.nodeClick=new Le,this.nodeHoverStart=new Le,this.nodeHoverStop=new Le,this.initialized=new Le,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 yl(this,void 0,void 0,function*(){const i=this.bodyCanvas.nativeElement,r=new LMe({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.target&&this.bodyUI.setTarget(this.target),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))],this.initialized.emit()})}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=Ne({type:n,selectors:[["ccf-body-ui"]],viewQuery:function(t,i){if(1&t&&Jn(gPe,5,rt),2&t){let r;_t(r=yt())&&(i.bodyCanvas=r.first)}},hostVars:2,hostBindings:function(t,i){2&t&&Rn(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",initialized:"initialized"},decls:2,vars:0,consts:[[1,"body-ui"],["bodyCanvas",""]],template:function(t,i){1&t&&tt(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})(),_Pe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn]]}),n})();function wPe(n,e){if(1&n&&(R(0,"li",4),De(1),Kt(2,"json"),k()),2&n){const t=e.$implicit;G(1),Aw(" ",t[0],": ",rn(2,2,t[1])," ")}}function EPe(n,e){if(1&n&&(R(0,"div",1),R(1,"div"),De(2),k(),R(3,"ul",2),mt(4,wPe,3,4,"li",3),k(),k()),2&n){const t=e.$implicit;G(2),xi(t[0]),G(2),ie("ngForOf",t[1])}}let SPe=(()=>{class n{constructor(t,i){this.clsName="ccf-store-debug",this.root={},this.subscriptions=new Te;const r=t.subscribe(s=>{this.root=s,i.markForCheck()});this.subscriptions.add(r)}get data(){return Object.entries(this.root).map(([s,o])=>[s,Object.entries(o)]).filter(([s,o])=>o.length>0)}ngOnDestroy(){this.subscriptions.unsubscribe()}}return n.\u0275fac=function(t){return new(t||n)(E(cu),E(kn))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-store-debug"]],hostVars:2,hostBindings:function(t,i){2&t&&Rn(i.clsName)},decls:1,vars:1,consts:[["class","state",4,"ngFor","ngForOf"],[1,"state"],[1,"kvlist"],["class","kvpair",4,"ngFor","ngForOf"],[1,"kvpair"]],template:function(t,i){1&t&&mt(0,EPe,5,2,"div",0),2&t&&ie("ngForOf",i.data)},directives:[pl],pipes:[tV],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0}),n})(),MPe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn]]}),n})();new ve("Maximum number of autocomplete options displayed",{providedIn:"root",factory:()=>10});const OPe=["carouselContainer"],IPe=["itemlist"],PPe=["itemcontainer"];function RPe(n,e){if(1&n){const t=Zi();R(0,"mat-icon",9),ge("touchstart",function(){return en(t),Qe().scroll("left")})("touchend",function(){return en(t),Qe().stopScroll()})("click",function(){return en(t),Qe().shift("left")})("mousedown",function(){return en(t),Qe().scroll("left")})("mouseup",function(){return en(t),Qe().stopScroll()}),De(1,"chevron_left"),k()}2&n&&st("disabled",Qe().onLeft)}function kPe(n,e){if(1&n&&(R(0,"div",15),De(1),k()),2&n){const t=Qe().$implicit,i=Qe();G(1),xi(i.occurenceData[t.id]||0)}}function FPe(n,e){if(1&n){const t=Zi();R(0,"div",10),ge("click",function(){const s=en(t).$implicit;return Qe().selectOrgan(s)}),tt(1,"mat-icon",11),R(2,"div",12),R(3,"div",13),De(4),k(),mt(5,kPe,2,1,"div",14),k(),k()}if(2&n){const t=e.$implicit,i=Qe();st("disabled",t.disabled)("selected",i.isSelected(t)),G(1),Jy("svgIcon",t.src),G(3),xi(t.name),G(1),ie("ngIf",void 0!==t.numResults)}}function NPe(n,e){if(1&n){const t=Zi();R(0,"mat-icon",16),ge("touchstart",function(){return en(t),Qe().scroll("right")})("touchend",function(){return en(t),Qe().stopScroll()})("click",function(){return en(t),Qe().shift("right")})("mousedown",function(){return en(t),Qe().scroll("right")})("mouseup",function(){return en(t),Qe().stopScroll()}),De(1,"chevron_right"),k()}2&n&&st("disabled",Qe().onRight)}const g0=[{src:"app:skin",organ:"Skin",name:"Skin",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002097"},{src:"app:brain",organ:"Brain",name:"Brain",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000955"},{disabled:!0,src:"app:lymph-nodes",organ:"Lymph Node",name:"Lymph Node",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000029"},{src:"app:lymph-nodes",organ:"Lymph Node",name:"Lymph Node",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002509"},{disabled:!0,src:"app:eye",organ:"Eye",name:"Eye, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000970"},{src:"app:eye",organ:"Eye",name:"Eye, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0004548"},{src:"app:eye",organ:"Eye",name:"Eye, R",side:"right",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0004549"},{disabled:!0,src:"app:fallopian-tube-left",organ:"Fallopian Tube",name:"Fallopian Tube, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0003889"},{src:"app:fallopian-tube-left",organ:"Fallopian Tube",name:"Fallopian Tube, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0001303"},{src:"app:fallopian-tube-right",organ:"Fallopian Tube",name:"Fallopian Tube, R",side:"right",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0001302"},{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, L",side:"left",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"},{disabled:!0,src:"app:knee",organ:"Knee",name:"Knee, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001465"},{src:"app:knee",organ:"Knee",name:"Knee, L",side:"left",hasSex:!0,id:"http://purl.org/sig/ont/fma/fma24978"},{src:"app:knee",organ:"Knee",name:"Knee, R",side:"right",hasSex:!0,id:"http://purl.org/sig/ont/fma/fma24977"},{src:"app:liver",organ:"Liver",name:"Liver",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002107"},{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"},{disabled:!0,src:"app:mammary-gland",organ:"Mammary Gland",name:"Mammary Gland, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0001911"},{src:"app:mammary-gland",organ:"Mammary Gland",name:"Mammary Gland, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.org/sig/ont/fma/fma57991"},{src:"app:mammary-gland",organ:"Mammary Gland",name:"Mammary Gland, R",side:"right",hasSex:!1,sex:"female",id:"http://purl.org/sig/ont/fma/fma57987"},{disabled:!0,src:"app:ovary-left",organ:"Ovary",name:"Ovary, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0000992"},{src:"app:ovary-left",organ:"Ovary",name:"Ovary, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.org/sig/ont/fma/fma7214"},{src:"app:ovary-right",organ:"Ovary",name:"Ovary, R",side:"right",hasSex:!1,sex:"female",id:"http://purl.org/sig/ont/fma/fma7213"},{src:"app:pancreas",organ:"Pancreas",name:"Pancreas",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001264"},{src:"app:pelvis-f",organ:"Pelvis",name:"Pelvis",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001270"},{src:"app:placenta",organ:"Placenta",name:"Placenta",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0001987"},{src:"app:prostate",organ:"Prostate",name:"Prostate",hasSex:!1,sex:"male",id:"http://purl.obolibrary.org/obo/UBERON_0002367",disabled:!0},{src:"app:prostate",organ:"Prostate",name:"Prostate",hasSex:!1,sex:"male",id:"http://purl.obolibrary.org/obo/UBERON_0000079"},{src:"app:small-intestine",organ:"Small Intestine",name:"Small Intestine",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002108"},{src:"app:large-intestine",organ:"Large Intestine",name:"Large Intestine",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000059"},{src:"app:spinal-cord",organ:"Spinal Cord",name:"Spinal Cord",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002240"},{src:"app:spleen",organ:"Spleen",name:"Spleen",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002106"},{src:"app:thymus",organ:"Thymus",name:"Thymus",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002370"},{disabled:!0,src:"app:ureter-left",organ:"Ureter",name:"Ureter, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000056"},{src:"app:ureter-left",organ:"Ureter",name:"Ureter, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001223"},{src:"app:ureter-right",organ:"Ureter",name:"Ureter, R",side:"right",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001222"},{src:"app:bladder",organ:"Urinary Bladder",name:"Urinary Bladder",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001255"},{src:"app:uterus",organ:"Uterus",name:"Uterus",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0000995"},{src:"app:vasculature-thick",organ:"Blood Vasculature",name:"Blood Vasculature",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0004537"},{disabled:!0,src:"app:vasculature-thick",organ:"Blood Vasculature",name:"Blood Vasculature",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002049"}].sort((n,e)=>n.name.localeCompare(e.name)).filter(n=>!0!==n.disabled);let p9=(()=>{class n{constructor(){this.clsName="ccf-organ-selector",this.multiselect=!1,this.displayErrors=!1,this.organList=g0,this.selectedOrgans=[],this.expanded=!1,this.organsChanged=new Le,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 hW.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:i}=this;let r=parseInt(i.nativeElement.style.left,10)||0;this.onLeft&&"left"===t||this.onRight&&"right"===t||(r="right"===t?r-this.step:r+this.step,i.nativeElement.style.left=r+"px",this.setLeftRight(r))}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(i=>t!==i):this.selectedOrgans.concat([t]):[t],this.organsChanged.emit(this.selectedOrgans)}isSelected(t){return!!this.selectedOrgans.includes(t)}set(){const{itemList:t,itemContainer:i,carouselContainer:r}=this,s=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(s);const o=this.step*Math.floor(r.nativeElement.offsetWidth/this.step)-64;i.nativeElement.style.width=`${o}px`}}setWidth(){const{itemContainer:t,carouselContainer:i}=this,r=this.step*Math.floor(i.nativeElement.offsetWidth/this.step)-64;t.nativeElement.style.width=`${r}px`}setLeftRight(t){const{itemContainer:i}=this;this.onLeft=0===t,this.onRight=t<=i.nativeElement.offsetWidth-this.organList.length*this.step}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=Ne({type:n,selectors:[["ccf-organ-selector"]],viewQuery:function(t,i){if(1&t&&(Jn(OPe,7),Jn(IPe,7),Jn(PPe,7)),2&t){let r;_t(r=yt())&&(i.carouselContainer=r.first),_t(r=yt())&&(i.itemList=r.first),_t(r=yt())&&(i.itemContainer=r.first)}},hostVars:2,hostBindings:function(t,i){2&t&&Rn(i.clsName)},inputs:{multiselect:"multiselect",displayErrors:"displayErrors",organList:"organList",selectedOrgans:"selectedOrgans",expanded:"expanded",occurenceData:"occurenceData"},outputs:{organsChanged:"organsChanged"},features:[zn],decls:9,vars:8,consts:[["matTooltip","Select the organ your tissue block is from.",1,"container",3,"matTooltipDisabled"],["carouselContainer",""],["class","carousel-left-icon",3,"disabled","touchstart","touchend","click","mousedown","mouseup",4,"ngIf"],[1,"carousel-item-container"],["itemcontainer",""],[1,"carousel-item-list"],["itemlist",""],["class","carousel-item",3,"disabled","selected","click",4,"ngFor","ngForOf"],["class","carousel-right-icon",3,"disabled","touchstart","touchend","click","mousedown","mouseup",4,"ngIf"],[1,"carousel-left-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"],[1,"carousel-right-icon",3,"touchstart","touchend","click","mousedown","mouseup"]],template:function(t,i){1&t&&(R(0,"div",0,1),mt(2,RPe,2,2,"mat-icon",2),R(3,"div",3,4),R(5,"div",5,6),mt(7,FPe,6,7,"div",7),k(),k(),mt(8,NPe,2,2,"mat-icon",8),k()),2&t&&(st("expanded",i.expanded)("error",i.error),ie("matTooltipDisabled",i.multiselect),G(2),ie("ngIf",!i.expanded),G(5),ie("ngForOf",i.organList),G(1),ie("ngIf",!i.expanded))},directives:[dc,zr,pl,rs],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:5rem;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}[_nghost-%COMP%] .expanded[_ngcontent-%COMP%] .carousel-item-container[_ngcontent-%COMP%]{width:100%!important}[_nghost-%COMP%] .expanded[_ngcontent-%COMP%] .carousel-item-container[_ngcontent-%COMP%] .carousel-item-list[_ngcontent-%COMP%]{flex-wrap:wrap;overflow:auto;left:0rem!important}[_nghost-%COMP%] .expanded[_ngcontent-%COMP%] .carousel-item-container[_ngcontent-%COMP%] .carousel-item-list[_ngcontent-%COMP%] .carousel-item[_ngcontent-%COMP%]{height:5rem}"]}),n})(),g9=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,lr,hc]]}),n})(),LPe=(()=>{class n{constructor(){this.clsName="ccf-opacity-slider",this.opacity=20,this.visible=!0,this.opacityChange=new Le,this.visibilityToggle=new Le,this.opacityReset=new Le}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 n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=Ne({type:n,selectors:[["ccf-opacity-slider"]],hostVars:2,hostBindings:function(t,i){2&t&&Rn(i.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,i){1&t&&(R(0,"div",0),R(1,"div",1),R(2,"mat-slider",2),ge("input",function(s){return i.changeOpacity(s.value)}),k(),R(3,"span",3),De(4),k(),k(),R(5,"div",4),R(6,"mat-icon",5),ge("click",function(){return i.toggleVisibility()}),k(),R(7,"mat-icon",6),ge("click",function(){return i.toggleVisibility()}),k(),R(8,"mat-icon",7),ge("click",function(){return i.resetOpacity()}),De(9,"refresh"),k(),k(),k()),2&t&&(G(2),st("disabled",!i.visible),ie("step",1)("min",0)("max",100)("value",i.opacity),G(2),or("",i.opacity,"%"),G(2),st("hidden",i.visible),ie("matRippleCentered",!0)("matRippleUnbounded",!0),G(1),st("hidden",!i.visible),ie("matRippleCentered",!0)("matRippleUnbounded",!0),G(1),ie("matRippleCentered",!0)("matRippleUnbounded",!0))},directives:[jk,rs,Js],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}),n})(),m9=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,lr,_W,_l]]}),n})();function BPe(n,e){if(1&n&&(R(0,"div",16),tt(1,"youtube-player",17),k()),2&n){const t=Qe(3);G(1),Jy("videoId",t.videoID)}}function VPe(n,e){if(1&n&&(R(0,"mat-expansion-panel",11),R(1,"mat-expansion-panel-header"),R(2,"h2",12),De(3),k(),k(),R(4,"div",13),tt(5,"markdown",14),mt(6,BPe,2,1,"div",15),k(),k()),2&n){const t=Qe(),i=t.index,r=t.$implicit;ie("expanded",0===i),G(3),xi(r.title),G(2),st("first",0===i),ie("data",r.content),G(1),ie("ngIf",0===i)}}function zPe(n,e){if(1&n&&(R(0,"div",9),mt(1,VPe,7,6,"mat-expansion-panel",10),k()),2&n){const t=e.$implicit;G(1),ie("ngIf",t)}}let _9=(()=>{class n{constructor(t,i){this.dialogRef=t,this.data=i,this.documentationContents=i.content||[],this.infoTitle=i.title||"",this.videoID=i.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 n.\u0275fac=function(t){return new(t||n)(E(Qm),E(Gk))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-info-dialog"]],decls:11,vars:2,consts:[[1,"rui-about","wrapper"],[1,"container"],[1,"content"],[1,"header"],["mat-dialog-title","",1,"title"],[1,"close"],[1,"material-icons","close-icon",3,"click"],[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,i){1&t&&(R(0,"div",0),R(1,"div",1),R(2,"div",2),R(3,"div",3),R(4,"h2",4),De(5),k(),R(6,"div",5),R(7,"mat-icon",6),ge("click",function(){return i.close()}),De(8,"clear"),k(),k(),k(),R(9,"mat-dialog-content",7),mt(10,zPe,2,1,"div",8),k(),k(),k(),k()),2&t&&(G(5),xi(i.infoTitle),G(5),ie("ngForOf",i.documentationContents))},directives:[Wk,rs,qk,pl,zr,qM,YM,TW,IW],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%] .content[_ngcontent-%COMP%] .header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;height:3rem;margin-bottom:2.25rem;position:relative}.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%]{cursor:pointer;height:3rem;width:3rem;line-height:3rem;text-align:center;transition:.6s}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-size:1.5rem;margin:0 auto;line-height:3rem;height:3rem;justify-self:center;display:flex}.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;display:flex}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .dialog-content[_ngcontent-%COMP%] .variable-binding.first[_ngcontent-%COMP%]{padding-right:1rem;width:73%}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .dialog-content[_ngcontent-%COMP%] .variable-binding[_ngcontent-%COMP%] ul{margin:0}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .dialog-content[_ngcontent-%COMP%] .variable-binding[_ngcontent-%COMP%] img{margin-left:1rem;float:right}.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%}"]}),n})(),jPe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,Qb,lr,Kk,pAe,XTe.forRoot({})]]}),n})(),y9=(()=>{class n{constructor(t){this.http=t,this.panelContent=new ar({content:[],infoTitle:"",videoID:""})}updateData(t,i,r){this.http.get(t,{responseType:"text"}).subscribe(s=>{const o={content:this.parseMarkdown(s),infoTitle:r,videoID:i};this.panelContent.next(o)})}parseMarkdown(t){const i=[],r=t.split("# ");for(const s of r)if(s.length){const o=s.includes("\n\n")?"\n\n":"\r\n\r\n",a=s.split(o);i.push({title:a[0],content:a.splice(1).join(o)})}return i}}return n.\u0275fac=function(t){return new(t||n)(I(Wf))},n.\u0275prov=ue({token:n,factory:n.\u0275fac,providedIn:"root"}),n})(),UPe=(()=>{class n{constructor(t,i){this.dialog=t,this.infoButtonService=i,this.infoTitle="",this.subscriptions=new Te,this.subscriptions.add(i.panelContent.subscribe(r=>{r.content.length&&this.launchInfoDialog(r)}))}ngOnDestroy(){this.subscriptions.unsubscribe()}launchInfoDialog(t){0==this.dialog.openDialogs.length&&this.dialog.open(_9,{autoFocus:!1,panelClass:"modal-animated",width:"72rem",data:{title:t.infoTitle,content:t.content,videoID:t.videoID}})}onDialogButtonClick(){this.infoButtonService.updateData(this.documentationUrl,this.videoID,this.infoTitle)}}return n.\u0275fac=function(t){return new(t||n)(E(_p),E(y9))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-info-button"]],inputs:{infoTitle:"infoTitle",videoID:"videoID",documentationUrl:"documentationUrl"},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,i){1&t&&(R(0,"div",0),R(1,"mat-icon",1),ge("click",function(){return i.onDialogButtonClick()}),De(2," info "),k(),k())},directives:[rs],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}"]}),n})(),HPe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,jPe,lr,Rj]]}),n})(),$Pe=(()=>{class n{constructor(){this.clsName="ccf-call-to-action",this.callToActionClicked=new Le,this.closeClicked=new Le}close(){this.closeClicked.emit()}onDialogButtonClick(){this.callToActionClicked.emit()}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=Ne({type:n,selectors:[["ccf-call-to-action"]],hostVars:2,hostBindings:function(t,i){2&t&&Rn(i.clsName)},inputs:{infoTitle:"infoTitle",imageUrl:"imageUrl",message:"message",callToAction:"callToAction"},outputs:{callToActionClicked:"callToActionClicked",closeClicked:"closeClicked"},decls:13,vars:4,consts:[[1,"rui-about","wrapper"],[1,"container"],[1,"content"],[1,"first-row"],["mat-dialog-title","",1,"title"],[1,"cta-mat-icon","material-icons","close-icon",3,"click"],["mat-card-sm-image","","alt","preview","layout-fill","",1,"cta-image",3,"src"],[1,"mat-typography","dialog-content"],[1,"message"],["mat-button","",1,"mat-button",3,"text","click"]],template:function(t,i){1&t&&(R(0,"div",0),R(1,"div",1),R(2,"div",2),R(3,"div",3),R(4,"p",4),De(5),k(),R(6,"mat-icon",5),ge("click",function(){return i.close()}),De(7,"clear"),k(),k(),tt(8,"img",6),R(9,"mat-dialog-content",7),R(10,"div",8),De(11),k(),R(12,"a",9),ge("click",function(){return i.onDialogButtonClick()}),k(),k(),k(),k(),k()),2&t&&(G(5),xi(i.infoTitle),G(3),ie("src",i.imageUrl,Ud),G(3),or(" ",i.message,""),G(1),ie("text",i.callToAction))},directives:[Wk,rs,CAe,qk],styles:["[_nghost-%COMP%] .content[_ngcontent-%COMP%]{display:block;align-content:center;padding-left:1.6rem;padding-right:1.6rem;border-radius:.25rem}[_nghost-%COMP%] .info-button-wrapper[_ngcontent-%COMP%]{border-radius:.25rem;padding:.6rem;transition:.6s}[_nghost-%COMP%] .info-button-wrapper[_ngcontent-%COMP%] .ccf-info-button[_ngcontent-%COMP%]{cursor:pointer;transition:color .6s;font-size:1.2rem;vertical-align:sub}[_nghost-%COMP%] .first-row[_ngcontent-%COMP%]{display:flex;width:100%;line-height:.9rem}[_nghost-%COMP%] .first-row[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{padding-right:7rem;padding-left:.2rem;font-size:.875rem;padding-top:.75rem}[_nghost-%COMP%] .first-row[_ngcontent-%COMP%] .cta-mat-icon[_ngcontent-%COMP%]{height:30%;line-height:3.4rem}[_nghost-%COMP%] .message[_ngcontent-%COMP%]{padding:.5rem}[_nghost-%COMP%] .cta-image[_ngcontent-%COMP%]{align-self:center;-o-object-fit:cover;object-fit:cover;width:100%;border-radius:.25rem}[_nghost-%COMP%] .mat-button[_ngcontent-%COMP%]{background-color:#444a65;font-size:.75rem;position:relative;margin-bottom:1rem;width:100%;height:2rem;color:#fff}"],changeDetection:0}),n})(),WPe=(()=>{class n{constructor(t){this.el=t}onInputChange(t){const i=this.el.nativeElement.value;this.el.nativeElement.value=i.replace(/[^0-9]*/g,""),i!==this.el.nativeElement.value&&t.stopPropagation()}}return n.\u0275fac=function(t){return new(t||n)(E(rt))},n.\u0275dir=oe({type:n,selectors:[["input","ccfNumbersOnly",""]],hostBindings:function(t,i){1&t&&ge("input",function(s){return i.onInputChange(s)})}}),n})(),qPe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({}),n})(),v9=(()=>{class n{get obj(){const t=this.findGlobalObject();return Object.defineProperties(this,{obj:{configurable:!1,writable:!1,value:t}}),t}has(t){const{obj:i}=this;return null!=i&&t in i}get(t,i){var r;const{obj:s}=this;return null!==(r=s&&s[t])&&void 0!==r?r:i}set(t,i){const{obj:r}=this;r&&(r[t]=i)}remove(t){const{obj:i}=this;i&&delete i[t]}findGlobalObject(){if("undefined"!=typeof globalThis)return globalThis;if("undefined"!=typeof global)return global;if("undefined"!=typeof window)return window;if("undefined"!=typeof self)return self;try{return new Function("return this;")()}catch(t){}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ue({token:n,factory:n.\u0275fac,providedIn:"root"}),n})(),Ah=(()=>{let n=class extends Jm{constructor(){super(...arguments),this.optionCache=new Map}get config$(){return this.state$.pipe(aF(),qc(1))}setConfig(t){this.setState(t)}patchConfig(t){this.patchState(t)}getProperty(t){return this.config$.pipe(ur(...t),Zo(),qc(1))}getOption(...t){const i=this.getPathKey(t);if(this.optionCache.has(i))return this.optionCache.get(i);const r=this.config$.pipe(ur(...t),Zo(),qc(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=$n(n)))(i||n)}}(),n.\u0275prov=ue({token:n,factory:n.\u0275fac}),xe([oi()],n.prototype,"config$",null),n=xe([xh(),cd({name:"globalConfig",defaults:null})],n),n})();!function(){const n=localStorage.getItem("ALLOW_TELEMETRY");null===n||n.toLowerCase()}();let ZPe=(()=>{class n{constructor(t,i){t&&function(n,e){Wc(n,"mousemove").pipe(dW(1e3),Ae(r=>{const{clientWidth:s,clientHeight:o}=n,{clientX:a,clientY:l}=r;return[a,l,s,o].join("_")})).subscribe(r=>e.event("webpage","mousemove",r))}(t.body,i)}}return n.\u0275fac=function(t){return new(t||n)(I(ut),I(xs))},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({}),n})();function QPe(n,e){if(1&n){const t=Zi();R(0,"button",1),ge("click",function(){return en(t),Qe().submit(!0)}),De(1),k()}if(2&n){const t=Qe();G(1),or(" ","not-set"===t.allowTelemetry?"I understand":"Opt in","\n")}}function JPe(n,e){if(1&n){const t=Zi();R(0,"button",1),ge("click",function(){return en(t),Qe().submit(!1)}),De(1,"Opt out"),k()}}let eRe=(()=>{class n{constructor(t,i,r){this.consentService=i,this.data=r,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:i}=this;return"not-set"===i||("opt-in"===t?"rescinded"===i:"given"===i)}}return n.\u0275fac=function(t){return new(t||n)(E(rt),E(f0),E(KO))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-tracking-popup"]],hostVars:2,hostBindings:function(t,i){2&t&&Rn(i.clsName)},decls:4,vars:2,consts:[["mat-button","","color","basic",3,"click",4,"ngIf"],["mat-button","","color","basic",3,"click"]],template:function(t,i){1&t&&(R(0,"p"),De(1,"We log usage to improve this service."),k(),mt(2,QPe,2,1,"button",0),mt(3,JPe,2,0,"button",0)),2&t&&(G(2),ie("ngIf",i.showButton("opt-in")),G(1),ie("ngIf",i.showButton("opt-out")))},directives:[zr,lh],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}),n})(),tRe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,ch]]}),n})();new Se;let zF=(()=>{class n{}return n.type="[CallToAction] Learn More",n})(),jF=(()=>{class n{}return n.type="[CallToAction] Open Dialog",n})(),UF=(()=>{class n{}return n.type="[CallToAction] Close Dialog",n})();var HF;class sa{get length(){var e,t;return null!==(t=null===(e=sa.storage)||void 0===e?void 0:e.length)&&void 0!==t?t:0}key(e){var t,i;return null!==(i=null===(t=sa.storage)||void 0===t?void 0:t.key(e))&&void 0!==i?i:null}getItem(e,t){var i,r,s;return null!==(s=null!==(r=null===(i=sa.storage)||void 0===i?void 0:i.getItem(e))&&void 0!==r?r:t)&&void 0!==s?s:null}setItem(e,t){var i;try{return null===(i=sa.storage)||void 0===i||i.setItem(e,t),!0}catch(r){return!1}}removeItem(e){var t;null===(t=sa.storage)||void 0===t||t.removeItem(e)}clear(){var e;null===(e=sa.storage)||void 0===e||e.clear()}}sa.storage=(()=>{let n;try{n=window.localStorage;const e="__storage_test__";return n.setItem(e,e),n.removeItem(e),n}catch(e){return e instanceof DOMException&&(22===e.code||1014===e.code||"QuotaExceededError"===e.name||"NS_ERROR_DOM_QUOTA_REACHED"===e.name)&&n&&0!==n.length?n:void 0}})(),sa.\u0275fac=function(e){return new(e||sa)},sa.\u0275prov=ue({token:sa,factory:sa.\u0275fac,providedIn:"root"});const w9="callToActionPopupShown";let oo=HF=class{constructor(e,t,i,r,s){this.dialog=e,this.ga=t,this.storage=i,this.infoService=r,this.http=s}static ctaDatePassed(e,t=Date.now){return+t()>+new Date(e)}ngxsOnInit(e){const{expirationDate:t,popupShown:i}=e.getState(),r=this.storage.getItem(w9,`${i}`),s=HF.ctaDatePassed(t);"true"!==r&&!s&&e.dispatch(new jF)}getDialogData(){return this.http.get("assets/docs/SPATIAL_SEARCH_README.md",{responseType:"text"}).pipe(Ae(e=>this.infoService.parseMarkdown(e)))}launchLearnMore(e){this.dialog.open(_9,{autoFocus:!1,panelClass:"modal-animated",width:"72rem",data:{title:"Spatial Search",content:e,videoID:"UfxMpzatowE"}})}learnMore(e){return this.dialog.closeAll(),this.ga.event("open_learn_more","call_to_action"),this.getDialogData().pipe(Ti(t=>this.launchLearnMore(t)))}open(e){this.dialog.open(iRe,{autoFocus:!1,panelClass:"modal-animated",width:"30.75rem",height:"36.688rem"}),this.ga.event("open","call_to_action"),this.storage.setItem(w9,"true"),e.patchState({popupShown:!0})}close(e){this.dialog.closeAll(),this.ga.event("close","call_to_action")}};oo.\u0275fac=function(e){return new(e||oo)(I(_p),I(xs),I(sa),I(y9),I(Wf))},oo.\u0275prov=ue({token:oo,factory:oo.\u0275fac}),xe([gk(zF)],oo.prototype,"learnMore",null),xe([gk(jF)],oo.prototype,"open",null),xe([gk(UF)],oo.prototype,"close",null),oo=HF=xe([cd({name:"callToAction",defaults:{title:"New to the Exploration User Interface",message:"Spatial Search has arrived!",callToAction:"Learn More",imageUrl:"assets/images/spatial_search.gif",expirationDate:"Dec 1, 2022",popupShown:!1}})],oo);let vx=(()=>{class n{static title(t){return t.title}static message(t){return t.message}static callToAction(t){return t.callToAction}static imageUrl(t){return t.imageUrl}static expirationDate(t){return t.expirationDate}static popupShown(t){return t.popupShown}}return xe([Xm([oo])],n,"title",null),xe([Xm([oo])],n,"message",null),xe([Xm([oo])],n,"callToAction",null),xe([Xm([oo])],n,"imageUrl",null),xe([Xm([oo])],n,"expirationDate",null),xe([Xm([oo])],n,"popupShown",null),n})(),iRe=(()=>{class n{constructor(){this.close=()=>new UF,this.learnMore=()=>new zF}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=Ne({type:n,selectors:[["ccf-call-to-action-behavior"]],decls:5,vars:12,consts:[[3,"infoTitle","message","callToAction","imageUrl","callToActionClicked","closeClicked"]],template:function(t,i){1&t&&(R(0,"ccf-call-to-action",0),ge("callToActionClicked",function(){return i.learnMore()})("closeClicked",function(){return i.close()}),Kt(1,"async"),Kt(2,"async"),Kt(3,"async"),Kt(4,"async"),k()),2&t&&ie("infoTitle",rn(1,4,i.title$))("message",rn(2,6,i.message$))("callToAction",rn(3,8,i.callToAction$))("imageUrl",rn(4,10,i.imageUrl$))},directives:[$Pe],pipes:[Hc],styles:[""],changeDetection:0}),xe([NM(vx.title)],n.prototype,"title$",void 0),xe([NM(vx.message)],n.prototype,"message$",void 0),xe([NM(vx.callToAction)],n.prototype,"callToAction$",void 0),xe([NM(vx.imageUrl)],n.prototype,"imageUrl$",void 0),xe([t9()],n.prototype,"close",void 0),xe([t9()],n.prototype,"learnMore",void 0),n})();const oRe={initialConfig:{},parse:{},rename:{}};class aRe{constructor(e,t){this.configState=e,this.storedChanges={},this.options=Object.assign(Object.assign({},oRe),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 lRe=(()=>{class n{constructor(t,i,r={}){this.configState=t,this.cdr=i,this.options=r,this.initialized=!1,this.configManager=new aRe(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=oe({type:n,features:[zn]}),n})();const cRe={boolean:n=>"false"!=`${n}`,json:n=>"string"==typeof n?JSON.parse(n):n,function:n=>{if("function"!=typeof n)throw new Error("Expected a javascript function");return n}};var $F;const hu={production:!0,disableDbWorker:!0,dbOptions:{ccfOwlUrl:"https://ccf-ontology.hubmapconsortium.org/v2.1.0/ccf.owl",ccfContextUrl:"https://hubmapconsortium.github.io/ccf-ontology/ccf-context.jsonld",hubmapDataService:"search-api",hubmapPortalUrl:"https://portal.hubmapconsortium.org/",hubmapDataUrl:"",hubmapAssetsUrl:"https://assets.hubmapconsortium.org",hubmapToken:null!==($F=localStorage.getItem("HUBMAP_TOKEN"))&&void 0!==$F?$F:""},customization:{theme:"hubmap",header:!0,homeUrl:"https://portal.hubmapconsortium.org/",logoTooltip:"Human BioMolecular Atlas Project"},skipUnsavedChangesConfirmation:!1,googleAnalyticsToken:"portal.hubmapconsortium.org"===window.location.hostname?"G-1WRJHN9FM6":"G-J9HWV9QPJ4"};var uRe=ze(815);class hRe{constructor(e){this.value=e}call(e,t){return t.subscribe(new fRe(e,this.value))}}class fRe extends xt{constructor(e,t){super(e),this.value=t}_next(e){this.destination.next(this.value)}}class gRe{constructor(e){this.notifier=e}call(e,t){return t.subscribe(new mRe(e,this.notifier))}}class mRe extends ii{constructor(e,t){super(e),this.hasValue=!1;const i=new Gr(this);this.add(i),this.innerSubscription=i;const r=co(t,i);r!==i&&(this.add(r),this.innerSubscription=r)}_next(e){this.hasValue&&super._next(e)}notifyNext(){this.hasValue=!0,this.innerSubscription&&this.innerSubscription.unsubscribe()}notifyComplete(){}}function GF(n){return"function"==typeof n}function E9(n){return void 0===n}function yRe(n,e,t){return function(r){let s=!!n;return function(n){return"function"==typeof n}(n)&&(s=n(r)),function(n,e){return GF(n)?n(e):E9(n)?e:n}(s?e:t,r)}}function vRe(n,e){return function(i){if(function(n){return null===n||E9(n)}(n)&&i)return i;if(!Array.isArray(i))return[n];const r=i.slice();let s=0;return e>0&&(s=e),r.splice(s,0,n),r}}function m0(n){return function(t){let i=null;for(const r in n){const s=n[r],o=t[r],a=GF(s)?s(o):s;a!==o&&(i||(i=Object.assign({},t)),i[r]=a)}return i||t}}let ji=class extends Jm{constructor(e){super(),this.globalConfig=e,this.user$=this.state$.pipe(ur("user")),this.registrationStarted$=this.state$.pipe(lF("registrationStarted")),this.useCancelRegistrationCallback$=this.state$.pipe(ur("useCancelRegistrationCallback")),this.registrationCallbackSet$=this.state$.pipe(ur("registrationCallbackSet"))}get skipConfirmation$(){return this.state$.pipe(lF("skipConfirmation"))}get globalSkipConfirmation$(){return this.globalConfig.getOption("skipUnsavedChangesConfirmation").pipe(Ae(e=>null!=e?e:hu.skipUnsavedChangesConfirmation),Zo())}get hasChanges$(){return this.state$.pipe(lF("hasChanges"))}ngxsOnInit(){super.ngxsOnInit(),this.globalConfig.config$.pipe(yi(1),Ti(e=>this.setState(m0({registrationCallbackSet:!!e.register,useCancelRegistrationCallback:!!e.cancelRegistration,user:yRe(!!e.user,e.user),registrationStarted:!!e.user||void 0})))).subscribe(),this.initSkipConfirmationListeners()}cancelRegistration(){const{globalConfig:{snapshot:{cancelRegistration:e}},snapshot:{useCancelRegistrationCallback:t,skipConfirmation:i}}=this;t&&(i||confirm("Changes you made may not be saved."))&&(null==e||e())}setUseCancelRegistrationCallback(e){this.ctx.patchState({useCancelRegistrationCallback:e})}setUserName(e){this.ctx.setState(m0({user:m0(e)}))}registrationStarted(){this.ctx.setState(m0({registrationStarted:!0}))}setHasChanges(){const{snapshot:{registrationStarted:e,hasChanges:t}}=this;e&&!t&&this.ctx.patchState({hasChanges:!0})}clearHasChanges(){this.ctx.patchState({hasChanges:!1})}initSkipConfirmationListeners(){const e=i=>this.patchState({skipConfirmation:i});this.globalSkipConfirmation$.pipe(Fn(i=>i)).subscribe(e),this.hasChanges$.pipe(ZM(this.globalSkipConfirmation$),Ae(([i,r])=>r||!i),Zo()).subscribe(e);const t=i=>(i.preventDefault(),i.returnValue="Changes you made may not be saved.",i.returnValue);this.skipConfirmation$.subscribe(i=>{i?removeEventListener("beforeunload",t):addEventListener("beforeunload",t)})}};ji.\u0275fac=function(e){return new(e||ji)(I(Ah))},ji.\u0275prov=ue({token:ji,factory:ji.\u0275fac}),xe([oi()],ji.prototype,"skipConfirmation$",null),xe([oi()],ji.prototype,"globalSkipConfirmation$",null),xe([oi()],ji.prototype,"hasChanges$",null),xe([on()],ji.prototype,"setUseCancelRegistrationCallback",null),xe([on()],ji.prototype,"setUserName",null),xe([on()],ji.prototype,"registrationStarted",null),xe([on()],ji.prototype,"setHasChanges",null),xe([on()],ji.prototype,"clearHasChanges",null),ji=xe([xh(),cd({name:"page",defaults:{user:{firstName:"",lastName:""},registrationStarted:!1,useCancelRegistrationCallback:!1,registrationCallbackSet:!1,skipConfirmation:!0,hasChanges:!1}})],ji);let fc=class extends Jm{constructor(e,t){super(),this.globals=e,this.globalConfig=t}ngxsOnInit(){super.ngxsOnInit(),this.getSourceDB().subscribe(e=>{this.setState(e),hu.production||this.globals.set("db",e)})}getSourceDB(){return this.globalConfig.getOption("baseHref").pipe(Ae(e=>(null!=e?e:"")+"assets/reference-organ-data.json"),Pr(e=>ui(fetch(e)).pipe(Pr(t=>t.json()),Ta(()=>ec))))}normalizePlacement(e){const i=this.snapshot.placementPatches[null==e?void 0:e.target];if(i){const r=function(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(ib),o=[t.x_scaling,t.y_scaling,t.z_scaling];return n.translate(r).rotateXYZ(s).scale(o)}(new $t($t.IDENTITY),i),s={x:e.x_translation,y:e.y_translation,z:e.z_translation},[o,a,l]=r.transformAsPoint([s.x,s.y,s.z],[]),c=Object.assign(Object.assign({},e),{target:i.target});return c.x_translation=o,c.y_translation=a,c.z_translation=l,c}return e}getReferenceOrganIri(e,t,i,r){const s=this.snapshot;"KIDNEY"!==e.toUpperCase()&&(i=""),(null==r?void 0:r.sex)&&(t=r.sex);const o=[e,t,i||(null==r?void 0:r.side)].join("|").toUpperCase(),a=Object.keys(s.organIRILookup).find(l=>l.toUpperCase().endsWith(o));return a?s.organIRILookup[a]:void 0}getOrganData(e){var t,i,r;const o=this.snapshot.organSpatialEntities[e];if(!o)return;const a=null!==(t=o.label)&&void 0!==t?t:"",l=g0.find(c=>a.endsWith(c.organ)&&(!o.side||o.side.toLowerCase()===c.side));return l?{organ:l,sex:null===(i=o.sex)||void 0===i?void 0:i.toLowerCase(),side:null===(r=o.side)||void 0===r?void 0:r.toLowerCase()}:void 0}};fc.\u0275fac=function(e){return new(e||fc)(I(v9),I(Ah))},fc.\u0275prov=ue({token:fc,factory:fc.\u0275fac}),fc=xe([xh(),cd({name:"reference",defaults:{organIRILookup:{},organSpatialEntities:{},anatomicalStructures:{},extractionSets:{},sceneNodeLookup:{},simpleSceneNodeLookup:{},placementPatches:{}}})],fc);const qF=g0;let ai=class extends Jm{constructor(e,t,i){super(),this.ga=e,this.injector=t,this.globalConfig=i,this.id$=this.state$.pipe(ur("id")),this.blockSize$=this.state$.pipe(ur("blockSize")),this.rotation$=this.state$.pipe(ur("rotation")),this.position$=this.state$.pipe(ur("position")),this.slicesConfig$=this.state$.pipe(ur("slicesConfig")),this.viewType$=this.state$.pipe(ur("viewType")),this.viewSide$=this.state$.pipe(ur("viewSide")),this.organ$=this.state$.pipe(ur("organ")),this.organIri$=this.state$.pipe(ur("organIri")),this.organDimensions$=this.state$.pipe(ur("organDimensions")),this.sex$=this.state$.pipe(ur("sex")),this.side$=this.state$.pipe(ur("side")),this.showPrevious$=this.state$.pipe(ur("showPrevious")),this.extractionSites$=this.state$.pipe(ur("extractionSites")),this.anatomicalStructures$=this.state$.pipe(ur("anatomicalStructures")),this.extractionSets$=this.state$.pipe(ur("extractionSets"))}get modelChanged$(){const e=["viewType","viewSide","showPrevious"],t=Object.keys(this.initialState).filter(i=>!e.includes(i));return this.state$.pipe(dW(0,void 0,{leading:!1,trailing:!0}),Zo((i,r)=>{for(const s of t)if(i[s]!==r[s])return!1;return!0}),e=>e.lift(new hRe(void 0)))}ngxsOnInit(){super.ngxsOnInit(),this.referenceData=this.injector.get(fc),this.page=this.injector.get(ji),this.globalConfig.getOption("organ").pipe(aF(),Pr(e=>{var t,i;const r=e.name.toLowerCase(),s=e.side;let a=this.idMatches(e.ontologyId,s);return a||(a=this.nameMatches(r,s)),a?(this.ctx.patchState({organ:a,sex:null===(t=e.sex)||void 0===t?void 0:t.toLowerCase(),side:null===(i=null==a?void 0:a.side)||void 0===i?void 0:i.toLowerCase()}),this.referenceData.state$.pipe(Zg(100),yi(1),Vk(200),Ti(()=>this.onOrganIriChange()))):ec})).subscribe(),this.modelChanged$.pipe(function(n){return e=>e.lift(new gRe(n))}(this.page.registrationStarted$.pipe(Fn(e=>e),Vk(5)))).subscribe(()=>this.page.setHasChanges())}idMatches(e,t){return g0.find(i=>!(!e||i.id!==e||i.side&&i.side!==t))}nameMatches(e,t){return g0.find(i=>i.side?i.organ.toLowerCase()===e&&i.side===t:i.organ.toLowerCase()===e)}setBlockSize(e){this.ctx.patchState({blockSize:e})}setRotation(e){this.ctx.patchState({rotation:e})}setPosition(e){var t;this.ga.event("placement",`${null===(t=this.snapshot.organ)||void 0===t?void 0:t.name}_placement`,`${e.x.toFixed(1)}_${e.y.toFixed(1)}_${e.z.toFixed(1)}`),this.ctx.patchState({position:e})}setSlicesConfig(e){this.ctx.patchState({slicesConfig:e})}setViewType(e){this.ctx.patchState({viewType:e})}setViewSide(e){this.ctx.patchState({viewSide:e})}get defaultPosition(){const e=this.snapshot.organDimensions;return{x:e.x+2*this.snapshot.blockSize.x,y:e.y/2,z:e.z/2}}setOrgan(e){this.ga.event("organ_select","organ",e.name),this.ctx.patchState({organ:e}),e.side&&this.ctx.patchState({side:e.side}),this.onOrganIriChange()}setSex(e){this.ctx.patchState({sex:e}),this.onOrganIriChange()}setSide(e){this.ctx.patchState({side:e}),this.onOrganIriChange()}setShowPrevious(e){this.ctx.patchState({showPrevious:e})}setExtractionSites(e){this.ctx.patchState({extractionSites:e})}setAnatomicalStructures(e){this.ctx.patchState({anatomicalStructures:e})}setExtractionSets(e){this.ctx.patchState({extractionSets:e})}toggleRegistrationBlocksVisibility(e,t){if(this.setShowPrevious(e),e){const i=t.map(r=>{var s;return Object.assign(Object.assign({},r),{opacity:Math.min(20,null!==(s=r.opacity)&&void 0!==s?s:20)})});this.setAnatomicalStructures(i)}else this.setAnatomicalStructures(t)}onOrganIriChange(){var e,t,i,r,s;const o=this.referenceData.getReferenceOrganIri((null===(e=this.snapshot.organ)||void 0===e?void 0:e.organ)||"",this.snapshot.sex,this.snapshot.side,this.snapshot.organ),a={x:100,y:100,z:100};if((null===(t=this.snapshot.organ)||void 0===t?void 0:t.sex)&&this.ctx.patchState({sex:null===(i=this.snapshot.organ)||void 0===i?void 0:i.sex}),o){const l=this.referenceData.snapshot,c={};for(const p of l.anatomicalStructures[o]||[]){const g=null!==(r=p.representation_of)&&void 0!==r?r:p["@id"];c[g]||(c[g]={id:null!==(s=p.representation_of)&&void 0!==s?s:p["@id"],name:p.label,visible:!0,opacity:20,tooltip:p.comment})}this.ctx.patchState({anatomicalStructures:Object.values(c)});const d=(l.extractionSets[o]||[]).map(p=>({name:p.label,sites:(0,uRe.sortBy)(p.extractionSites.map(g=>({id:g["@id"],name:g.label,visible:!1,opacity:0,tooltip:g.comment})),"name")}));this.ctx.patchState({extractionSets:d}),this.ctx.patchState({extractionSites:d.length>0?d[0].sites:[]});const f=l.organSpatialEntities[o];a.x=f.x_dimension,a.y=f.y_dimension,a.z=f.z_dimension}this.ctx.patchState({organIri:o,organDimensions:a}),this.ctx.patchState({position:this.defaultPosition})}};ai.\u0275fac=function(e){return new(e||ai)(I(xs),I(Nt),I(Ah))},ai.\u0275prov=ue({token:ai,factory:ai.\u0275fac}),xe([oi()],ai.prototype,"modelChanged$",null),xe([on()],ai.prototype,"setBlockSize",null),xe([on()],ai.prototype,"setRotation",null),xe([on()],ai.prototype,"setPosition",null),xe([on()],ai.prototype,"setSlicesConfig",null),xe([on()],ai.prototype,"setViewType",null),xe([on()],ai.prototype,"setViewSide",null),xe([oi()],ai.prototype,"defaultPosition",null),xe([on()],ai.prototype,"setOrgan",null),xe([on()],ai.prototype,"setSex",null),xe([on()],ai.prototype,"setSide",null),xe([on()],ai.prototype,"setShowPrevious",null),xe([on()],ai.prototype,"setExtractionSites",null),xe([on()],ai.prototype,"setAnatomicalStructures",null),xe([on()],ai.prototype,"setExtractionSets",null),ai=xe([xh(),cd({name:"model",defaults:{id:"",label:"",organ:{src:"",name:""},organIri:"",organDimensions:{x:90,y:90,z:90},sex:"male",side:"left",blockSize:{x:10,y:10,z:10},rotation:{x:0,y:0,z:0},position:{x:0,y:0,z:0},slicesConfig:{thickness:NaN,numSlices:NaN},viewType:"register",viewSide:"anterior",showPrevious:!1,extractionSites:[],anatomicalStructures:[],extractionSets:[]}})],ai);const T9=new ve("Default theme class");let YF=(()=>{class n{constructor(t){this.defaultTheme=this.theme=null!=t?t:""}static initialize(t){const{injector:i,location:r}=t;i.get(n).initialize(r,i)}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,i){this.element=t,this.injector=i,this.applyThemeClass(this.getTheme())}applyThemeClass(t,i="add"){var r;const{element:s,injector:o}=this;if(!t||!s||!o)return;const a=o.get(zc,null);if(!a)return;const l=s.nativeElement,c=null===(r=o.get(hm,null))||void 0===r?void 0:r.getContainerElement(),d="add"===i?"addClass":"removeClass";a[d](l,t),c&&a[d](c,t)}}return n.\u0275fac=function(t){return new(t||n)(I(T9,8))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})(),CRe=(()=>{class n{constructor(t){this.ga=t,this.clsName="ccf-name-input",this.firstNameValidator=new Sh("",[lG.required]),this.lastNameValidator=new Sh("",[lG.required]),this._name={firstName:"",lastName:""},this.nameChange=new Le}get name(){return this._name}set name(t){this._name=t,this.firstNameValidator.setValue((null==t?void 0:t.firstName)||""),this.lastNameValidator.setValue((null==t?void 0:t.lastName)||"")}updateName(t,i){const r=t.target;this.name=Object.assign(Object.assign({},this.name),{[i]:r.value}),this.ga.event("name_updated","name_input",i),this.nameChange.emit(this.name)}}return n.\u0275fac=function(t){return new(t||n)(E(xs))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-name-input"]],hostVars:2,hostBindings:function(t,i){2&t&&Rn(i.clsName)},inputs:{name:"name"},outputs:{nameChange:"nameChange"},decls:8,vars:2,consts:[[1,"field"],[1,"text","label"],["matInput","","matTooltip","Add your first name.",1,"input",3,"value","input"],["matInput","","matTooltip","Add your last name.",1,"input",3,"value","input"]],template:function(t,i){1&t&&(R(0,"mat-form-field",0),R(1,"mat-label",1),De(2,"First Name "),k(),R(3,"input",2),ge("input",function(s){return i.updateName(s,"firstName")}),k(),k(),R(4,"mat-form-field",0),R(5,"mat-label",1),De(6,"Last Name "),k(),R(7,"input",3),ge("input",function(s){return i.updateName(s,"lastName")}),k(),k()),2&t&&(G(3),ie("value",i.firstNameValidator.value),G(4),ie("value",i.lastNameValidator.value))},directives:[am,Gf,Xb,dc],styles:["[_nghost-%COMP%]{display:flex}[_nghost-%COMP%] .field[_ngcontent-%COMP%]:not(:last-child){padding-right:.75rem}[_nghost-%COMP%] .field[_ngcontent-%COMP%] .input[_ngcontent-%COMP%]{text-align:left;width:100%}"],changeDetection:0}),n})();const wRe=["thumbContainer"],ERe=["toggleBar"],SRe=["input"],MRe=function(n){return{enterDuration:n}},xRe=["*"],TRe=new ve("mat-slide-toggle-default-options",{providedIn:"root",factory:()=>({disableToggleValue:!1})});let ARe=0;const DRe={provide:ro,useExisting:T(()=>A9),multi:!0};class ORe{constructor(e,t){this.source=e,this.checked=t}}const IRe=Hf(Uf(nc(jf(class{constructor(n){this._elementRef=n}}))));let A9=(()=>{class n extends IRe{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-"+ ++ARe,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 Le,this.toggleChange=new Le,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=Mt(t)}get checked(){return this._checked}set checked(t){this._checked=Mt(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 ORe(this,this.checked))}_onLabelTextChange(){this._changeDetectorRef.detectChanges()}}return n.\u0275fac=function(t){return new(t||n)(E(rt),E(Sa),E(kn),Zr("tabindex"),E(TRe),E(Do,8))},n.\u0275cmp=Ne({type:n,selectors:[["mat-slide-toggle"]],viewQuery:function(t,i){if(1&t&&(Jn(wRe,5),Jn(ERe,5),Jn(SRe,5)),2&t){let r;_t(r=yt())&&(i._thumbEl=r.first),_t(r=yt())&&(i._thumbBarEl=r.first),_t(r=yt())&&(i._inputElement=r.first)}},hostAttrs:[1,"mat-slide-toggle"],hostVars:12,hostBindings:function(t,i){2&t&&(al("id",i.id),nn("tabindex",i.disabled?null:-1)("aria-label",null)("aria-labelledby",null),st("mat-checked",i.checked)("mat-disabled",i.disabled)("mat-slide-toggle-label-before","before"==i.labelPosition)("_mat-animation-noopable",i._noopAnimations))},inputs:{disabled:"disabled",disableRipple:"disableRipple",color:"color",tabIndex:"tabIndex",name:"name",id:"id",labelPosition:"labelPosition",ariaLabel:["aria-label","ariaLabel"],ariaLabelledby:["aria-labelledby","ariaLabelledby"],required:"required",checked:"checked",ariaDescribedby:["aria-describedby","ariaDescribedby"]},outputs:{change:"change",toggleChange:"toggleChange"},exportAs:["matSlideToggle"],features:[Dt([DRe]),ct],ngContentSelectors:xRe,decls:16,vars:20,consts:[[1,"mat-slide-toggle-label"],["label",""],[1,"mat-slide-toggle-bar"],["toggleBar",""],["type","checkbox","role","switch",1,"mat-slide-toggle-input","cdk-visually-hidden",3,"id","required","tabIndex","checked","disabled","change","click"],["input",""],[1,"mat-slide-toggle-thumb-container"],["thumbContainer",""],[1,"mat-slide-toggle-thumb"],["mat-ripple","",1,"mat-slide-toggle-ripple","mat-focus-indicator",3,"matRippleTrigger","matRippleDisabled","matRippleCentered","matRippleRadius","matRippleAnimation"],[1,"mat-ripple-element","mat-slide-toggle-persistent-ripple"],[1,"mat-slide-toggle-content",3,"cdkObserveContent"],["labelContent",""],[2,"display","none"]],template:function(t,i){if(1&t&&(wi(),R(0,"label",0,1),R(2,"div",2,3),R(4,"input",4,5),ge("change",function(s){return i._onChangeEvent(s)})("click",function(s){return i._onInputClick(s)}),k(),R(6,"div",6,7),tt(8,"div",8),R(9,"div",9),tt(10,"div",10),k(),k(),k(),R(11,"span",11,12),ge("cdkObserveContent",function(){return i._onLabelTextChange()}),R(13,"span",13),De(14,"\xa0"),k(),Ht(15),k(),k()),2&t){const r=vs(1),s=vs(12);nn("for",i.inputId),G(2),st("mat-slide-toggle-bar-no-side-margin",!s.textContent||!s.textContent.trim()),G(2),ie("id",i.inputId)("required",i.required)("tabIndex",i.tabIndex)("checked",i.checked)("disabled",i.disabled),nn("name",i.name)("aria-checked",i.checked.toString())("aria-label",i.ariaLabel)("aria-labelledby",i.ariaLabelledby)("aria-describedby",i.ariaDescribedby),G(5),ie("matRippleTrigger",r)("matRippleDisabled",i.disableRipple||i.disabled)("matRippleCentered",!0)("matRippleRadius",20)("matRippleAnimation",Hg(18,MRe,i._noopAnimations?0:150))}},directives:[Js,WD],styles:[".mat-slide-toggle{display:inline-block;height:24px;max-width:100%;line-height:24px;white-space:nowrap;outline:none;-webkit-tap-highlight-color:transparent}.mat-slide-toggle.mat-checked .mat-slide-toggle-thumb-container{transform:translate3d(16px, 0, 0)}[dir=rtl] .mat-slide-toggle.mat-checked .mat-slide-toggle-thumb-container{transform:translate3d(-16px, 0, 0)}.mat-slide-toggle.mat-disabled{opacity:.38}.mat-slide-toggle.mat-disabled .mat-slide-toggle-label,.mat-slide-toggle.mat-disabled .mat-slide-toggle-thumb-container{cursor:default}.mat-slide-toggle-label{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:flex;flex:1;flex-direction:row;align-items:center;height:inherit;cursor:pointer}.mat-slide-toggle-content{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mat-slide-toggle-label-before .mat-slide-toggle-label{order:1}.mat-slide-toggle-label-before .mat-slide-toggle-bar{order:2}[dir=rtl] .mat-slide-toggle-label-before .mat-slide-toggle-bar,.mat-slide-toggle-bar{margin-right:8px;margin-left:0}[dir=rtl] .mat-slide-toggle-bar,.mat-slide-toggle-label-before .mat-slide-toggle-bar{margin-left:8px;margin-right:0}.mat-slide-toggle-bar-no-side-margin{margin-left:0;margin-right:0}.mat-slide-toggle-thumb-container{position:absolute;z-index:1;width:20px;height:20px;top:-3px;left:0;transform:translate3d(0, 0, 0);transition:all 80ms linear;transition-property:transform}._mat-animation-noopable .mat-slide-toggle-thumb-container{transition:none}[dir=rtl] .mat-slide-toggle-thumb-container{left:auto;right:0}.mat-slide-toggle-thumb{height:20px;width:20px;border-radius:50%}.mat-slide-toggle-bar{position:relative;width:36px;height:14px;flex-shrink:0;border-radius:8px}.mat-slide-toggle-input{bottom:0;left:10px}[dir=rtl] .mat-slide-toggle-input{left:auto;right:10px}.mat-slide-toggle-bar,.mat-slide-toggle-thumb{transition:all 80ms linear;transition-property:background-color;transition-delay:50ms}._mat-animation-noopable .mat-slide-toggle-bar,._mat-animation-noopable .mat-slide-toggle-thumb{transition:none}.mat-slide-toggle .mat-slide-toggle-ripple{position:absolute;top:calc(50% - 20px);left:calc(50% - 20px);height:40px;width:40px;z-index:1;pointer-events:none}.mat-slide-toggle .mat-slide-toggle-ripple .mat-ripple-element:not(.mat-slide-toggle-persistent-ripple){opacity:.12}.mat-slide-toggle-persistent-ripple{width:100%;height:100%;transform:none}.mat-slide-toggle-bar:hover .mat-slide-toggle-persistent-ripple{opacity:.04}.mat-slide-toggle:not(.mat-disabled).cdk-keyboard-focused .mat-slide-toggle-persistent-ripple{opacity:.12}.mat-slide-toggle-persistent-ripple,.mat-slide-toggle.mat-disabled .mat-slide-toggle-bar:hover .mat-slide-toggle-persistent-ripple{opacity:0}@media(hover: none){.mat-slide-toggle-bar:hover .mat-slide-toggle-persistent-ripple{display:none}}.cdk-high-contrast-active .mat-slide-toggle-thumb,.cdk-high-contrast-active .mat-slide-toggle-bar{border:1px solid}.cdk-high-contrast-active .mat-slide-toggle.cdk-keyboard-focused .mat-slide-toggle-bar{outline:2px dotted;outline-offset:5px}\n"],encapsulation:2,changeDetection:0}),n})(),D9=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({}),n})(),O9=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[D9,_l,On,SE],D9,On]}),n})(),XF=(()=>{class n{constructor(t){this.ga=t,this.clsName="ccf-labeled-slide-toggle",this.labels=["Left","Right"],this.value="Left",this.disabled=!1,this.valueChange=new Le}get left(){const{value:t,labels:i}=this;return t!==i[1]}updateToggle(t){this.value=t?this.labels[0]:this.labels[1],this.ga.event("slide_toggle_toggled","slide_toggle",this.value),this.valueChange.emit(this.value)}}return n.\u0275fac=function(t){return new(t||n)(E(xs))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-labeled-slide-toggle"]],hostVars:2,hostBindings:function(t,i){2&t&&Rn(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=Zi();R(0,"span",0),ge("click",function(){en(r);const o=vs(3);return i.left||o.toggle(),i.updateToggle(!0)}),De(1),k(),R(2,"mat-slide-toggle",1,2),ge("change",function(o){return i.updateToggle(!o.checked)}),k(),R(4,"span",0),ge("click",function(){en(r);const o=vs(3);return i.left&&o.toggle(),i.updateToggle(!1)}),De(5),k()}2&t&&(st("disabled",i.disabled)("highlighted",i.left),G(1),xi(i.labels[0]),G(1),ie("disabled",i.disabled)("checked",!i.left),G(2),st("disabled",i.disabled)("highlighted",!i.left),G(1),xi(i.labels[1]))},directives:[A9],styles:["[_nghost-%COMP%] .slide-label[_ngcontent-%COMP%]{margin:0 1rem;transition:color .6s;cursor:pointer}[_nghost-%COMP%] .disabled[_ngcontent-%COMP%]{opacity:30%;cursor:not-allowed}"],changeDetection:0}),n})();const kRe=function(){return["Male","Female"]},FRe=function(n){return[n]};let NRe=(()=>{class n{constructor(t,i,r){this.page=t,this.model=i,this.dialogRef=r,this.clsName="ccf-registration-content",this.sexByLabel$=this.model.sex$.pipe(Ae(s=>"female"===s?"Female":"Male")),this.organList=qF,r.disableClose=!0}setSexFromLabel(t){this.currentSex=t,this.sexSelected=!0}checkNameValid(t){this.nameValid=t.firstName.length>0&&t.lastName.length>0}organSelect(t){this.currentOrgan=t,this.organSelected=!0}registerButtonClick(t){t&&t.preventDefault(),this.organSelected&&this.nameValid&&this.closeDialog()}closeDialog(){this.model.setSex("Female"===this.currentSex?"female":"male"),this.model.setOrgan(this.currentOrgan),this.dialogRef.close(!0),this.page.registrationStarted()}}return n.\u0275fac=function(t){return new(t||n)(E(ji),E(ai),E(Qm))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-registration-content"]],hostVars:2,hostBindings:function(t,i){2&t&&Rn(i.clsName)},decls:17,vars:18,consts:[[1,"modal"],["mat-dialog-content",""],[3,"name","nameChange"],["matTooltip","Select sex to filter organs.",1,"organ-sliders"],[1,"slider-label"],[1,"toggle","gender",3,"labels","value","valueChange"],[1,"selector-label"],[1,"selector-container"],[3,"organList","selectedOrgans","expanded","organsChanged"],["organSelector",""],["mat-button","",1,"registration-button",3,"matTooltip","click"]],template:function(t,i){1&t&&(R(0,"div",0),R(1,"div",1),R(2,"ccf-name-input",2),ge("nameChange",function(s){return i.page.setUserName(s),i.checkNameValid(s)}),Kt(3,"async"),k(),R(4,"div",3),R(5,"div",4),De(6,"Donor Sex:"),k(),R(7,"ccf-labeled-slide-toggle",5),ge("valueChange",function(s){return i.setSexFromLabel(s)}),Kt(8,"async"),k(),k(),R(9,"div",6),De(10,"Select an organ"),k(),R(11,"div",7),R(12,"ccf-organ-selector",8,9),ge("organsChanged",function(s){return i.organSelect(s[0])}),Kt(14,"async"),k(),k(),k(),R(15,"button",10),ge("click",function(s){return i.registerButtonClick(s)}),De(16,"START REGISTRATION"),k(),k()),2&t&&(G(2),ie("name",rn(3,9,i.page.user$)),G(5),ie("labels",fv(15,kRe))("value",rn(8,11,i.sexByLabel$)),G(5),ie("organList",i.organList)("selectedOrgans",Hg(16,FRe,rn(14,13,i.model.organ$)))("expanded",!0),G(3),st("disabled",!i.organSelected||!i.nameValid),ie("matTooltip",i.organSelected&&i.nameValid?"":"Required: Enter first and last name, and select an organ"))},directives:[CRe,dc,XF,p9,lh],pipes:[Hc],styles:[".modal[_ngcontent-%COMP%]{padding:1rem;border-radius:4px;max-width:47rem}.modal[_ngcontent-%COMP%] .organ-sliders[_ngcontent-%COMP%]{display:flex;height:3rem;align-items:center}.modal[_ngcontent-%COMP%] .organ-sliders[_ngcontent-%COMP%] .slider-label[_ngcontent-%COMP%]{font-weight:600}.modal[_ngcontent-%COMP%] .selector-label[_ngcontent-%COMP%]{font-weight:600;height:3rem;line-height:3rem}.modal[_ngcontent-%COMP%] .selector-container[_ngcontent-%COMP%]{margin:0 auto}.modal[_ngcontent-%COMP%] .registration-button[_ngcontent-%COMP%]{display:block;margin:2rem auto 0;transition:.6s}.modal[_ngcontent-%COMP%] .registration-button.disabled[_ngcontent-%COMP%]{pointer-events:none}"],changeDetection:0}),n})(),LRe=(()=>{class n{constructor(t,i,r){this.dialog=t,this.page=i,this.model=r,this.clsName="ccf-registration-modal"}ngOnInit(){Qi([this.page.user$,this.model.organ$]).pipe(Zg(500),yi(1),Ti(([t,i])=>{""!==t.firstName&&""!==t.lastName&&""!==i.src||this.openDialog()})).subscribe()}openDialog(){this.dialog.open(NRe,{autoFocus:!1})}}return n.\u0275fac=function(t){return new(t||n)(E(_p),E(ji),E(ai))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-registration-modal"]],hostVars:2,hostBindings:function(t,i){2&t&&Rn(i.clsName)},decls:0,vars:0,template:function(t,i){},encapsulation:2}),n})();function BRe(n,e){1&n&&function(n,e,t){_f(n,e,t),yf()}(0)}function VRe(n,e){if(1&n){const t=Zi();R(0,"div",4),ge("click",function(){return en(t),Qe().page.cancelRegistration()}),R(1,"mat-icon",5),De(2,"chevron_left"),k(),R(3,"span",6),De(4,"BACK"),k(),k()}}function zRe(n,e){if(1&n&&(R(0,"a",7),tt(1,"div",8),k()),2&n){const t=Qe();ie("href",t.homeUrl,Ud)("matTooltip",t.logoTooltip)}}let jRe=(()=>{class n{constructor(t){this.page=t,this.clsName="ccf-header"}}return n.\u0275fac=function(t){return new(t||n)(E(ji))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-header"]],hostVars:2,hostBindings:function(t,i){2&t&&Rn(i.clsName)},inputs:{homeUrl:"homeUrl",logoTooltip:"logoTooltip"},decls:7,vars:5,consts:[[4,"ngIf","ngIfThen","ngIfElse"],["backButton",""],["logo",""],[1,"filler"],["rel","noreferrer noopener",1,"link","home",3,"click"],[1,"icon","backbutton"],[1,"text"],["rel","noreferrer noopener","matTooltipPosition","right",1,"link","portal",3,"href","matTooltip"],["aria-hidden","false","aria-label","Reset tool",1,"logo"]],template:function(t,i){if(1&t&&(mt(0,BRe,1,0,"ng-container",0),Kt(1,"async"),mt(2,VRe,5,0,"ng-template",null,1,jw),mt(4,zRe,2,2,"ng-template",null,2,jw),tt(6,"div",3)),2&t){const r=vs(3),s=vs(5);ie("ngIf",rn(1,3,i.page.useCancelRegistrationCallback$))("ngIfThen",r)("ngIfElse",s)}},directives:[zr,rs,dc],pipes:[Hc],styles:["[_nghost-%COMP%]{display:flex;align-items:center;min-height:4rem;padding:0 1.5rem;border-bottom-width:1px;border-bottom-style:solid}[_nghost-%COMP%] .text[_ngcontent-%COMP%]{padding:.25rem 0;height:2rem;display:flex;align-items:center;font-weight:lighter;font-size:1.5rem}[_nghost-%COMP%] .link[_ngcontent-%COMP%]{display:flex;align-items:center;cursor:pointer;text-decoration:none;padding:.25rem 0}[_nghost-%COMP%] .home[_ngcontent-%COMP%] *[_ngcontent-%COMP%]{transition:color .6s}[_nghost-%COMP%] .home[_ngcontent-%COMP%] .backbutton[_ngcontent-%COMP%]{font-size:2.25rem;width:2.25rem;height:2.25rem}[_nghost-%COMP%] .portal[_ngcontent-%COMP%]{height:100%;width:25rem;align-items:center;display:flex}[_nghost-%COMP%] .logo[_ngcontent-%COMP%]{width:100%;height:50%;background-repeat:no-repeat;background-size:contain}[_nghost-%COMP%] .filler[_ngcontent-%COMP%]{flex-grow:1;margin:0}"],changeDetection:0}),n})();const I9={isolated:!0},P9=new ve("Message service configuration",{providedIn:"root",factory:()=>I9});let URe=(()=>{class n{constructor(t,i,r){this.source=t,this.channel=i,this.messages=r}sendMessage(t){this.channel.next({id:this.nextMessageId(),source:this.source,payload:t})}getMessages(){return this.messages.pipe(Fn(t=>t.source!==this.source))}getMessagesFromSource(t){return this.getMessages().pipe(Fn(i=>i.source===t))}getMessagesFromSources(t){return this.getMessages().pipe(Fn(i=>t.includes(i.source)))}nextMessageId(){return n.counter++}}return n.counter=0,n})();const _0=(()=>{class n{constructor(t,i){this.config=t,this.parent=i,this.channel=new Se,this.messages=t.isolated||!i?this.channel.asObservable():ui([this.channel,i.messages.pipe(qj(()=>!this.channel.closed))]).pipe(uo())}ngOnDestroy(){this.channel.complete()}connect(t){return new URe(t,this.channel,this.messages)}}return n.\u0275fac=function(t){return new(t||n)(I(P9),I(n,12))},n.\u0275prov=ue({token:n,factory:n.\u0275fac,providedIn:"root"}),n})(),HRe=["*"];let bx=(()=>{class n{constructor(t,i){this.className="ccf-drawer-content",this.animationsEnabled=!1,this.leftMargin=0,this.rightMargin=0,this.faded=!1,this.drawers=[],this.subscriptions=new Te;const r=t.connect(this).getMessages();this.subscriptions.add(r.subscribe(s=>{this.handleMessage(s)&&i.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 i=t.source.position,{opened:r,width:s,margin:o}=t.payload;return this.updateMargin(i,r,s,o),this.updateFaded(),!0}default:return!1}}updateMargin(t,i,r,s){const o=i?r+s:s;"start"===t?this.leftMargin=o:this.rightMargin=o}updateFaded(){const[t,i]=this.drawers;this.faded=!!((null==t?void 0:t.opened)&&(null==t?void 0:t.expanded)||(null==i?void 0:i.opened)&&(null==i?void 0:i.expanded))}}return n.\u0275fac=function(t){return new(t||n)(E(_0),E(kn))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-drawer-content"]],hostVars:9,hostBindings:function(t,i){2&t&&(Pg("@fadeInOut",i.faded),Rn(i.className),vf("margin-left",i.leftMargin,"px")("margin-right",i.rightMargin,"px"),st("cff-drawer-content-animations",i.animationsEnabled))},ngContentSelectors:HRe,decls:1,vars:0,template:function(t,i){1&t&&(wi(),Ht(0))},styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;height:100%;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:[tc("fadeInOut",[wr("false",ti({opacity:1})),wr("true",ti({opacity:0})),Qs("false <=> true",Ao("1s"))])]},changeDetection:0}),n})();const $Re=["*"],KF={params:{width:0,margin:0,margin2:0}};class GRe{constructor(){this.initialized=!1,this.deferred=new Promise(e=>{this.resolve=e})}set(){this.initialized=!0,this.resolve()}wait(){return yl(this,void 0,void 0,function*(){return this.deferred})}valueOf(){return this.initialized}}let ZF=(()=>{class n{constructor(t,i,r){this.element=r,this.className="ccf-drawer",this._position="start",this._opened=!1,this._expanded=!1,this.openedChange=new Le(!0),this.expandedChange=new Le(!0),this.stateChange=new Le(!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 GRe,this.subscriptions=new Te,this.channel=t.connect(this),this.subscriptions.add(this.channel.getMessages().subscribe(s=>{this.handleMessage(s)&&i.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(Mt(t))}get expanded(){return this._expanded}set expanded(t){this.toggleExpanded(Mt(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 i=t.getBoundingClientRect(),r=i.right-i.left;return 0===r?0:(this._measuredWidth=r,r)}get measuredMargin(){if(this._measuredMargin>0)return this._measuredMargin;const t=this.element.nativeElement;if(!t)return 0;const s=globalThis.getComputedStyle(t).getPropertyValue("start"===this.position?"margin-right":"margin-left"),o=Number(s.slice(0,-2));return this._measuredMargin=o,o}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 yl(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 n.\u0275fac=function(t){return new(t||n)(E(_0),E(kn),E(rt))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-drawer"]],hostVars:10,hostBindings:function(t,i){1&t&&Qy("@openClose.done",function(){return i.closeOpenDone()})("@expandCollapse.done",function(){return i.expandCollapseDone()}),2&t&&(Pg("@openClose",i.openedState)("@expandCollapse",i.expandedStateObj),Rn(i.className),st("ccf-drawer-end",i.classEnd)("ccf-drawer-opened",i.opened)("ccf-drawer-expanded",i.expanded))},inputs:{position:"position",opened:"opened",expanded:"expanded"},outputs:{openedChange:"openedChange",expandedChange:"expandedChange",stateChange:"stateChange"},exportAs:["ccfDrawer"],ngContentSelectors:$Re,decls:2,vars:0,consts:[[1,"cff-drawer-inner-container"]],template:function(t,i){1&t&&(wi(),R(0,"div",0),Ht(1),k())},styles:["[_nghost-%COMP%]{display:block;position:absolute;top:0;bottom:0;z-index:2;outline:0;transform:translate(-100%)}.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:[tc("openClose",[wr("open, open-instant",ti({transform:"none"})),wr("closed",ti({})),Qs("closed => open-instant",Ao(0)),Qs("closed <=> open, open-instant => closed",Ao(".5s ease-in-out"))]),tc("expandCollapse",[wr("collapsed",ti({})),wr("half",ti({width:"calc(50% - {{ margin }}px)"}),KF),wr("extended",ti({width:"calc(100% - {{ width }}px - {{ margin }}px)"}),KF),wr("full",ti({width:"calc(100% - {{ margin }}px - {{ margin2 }}px)"}),KF),Qs("* <=> *",Ao(".5s ease-in-out"))])]},changeDetection:0}),n})();function WRe(n,e){1&n&&(R(0,"ccf-drawer-content"),Ht(1,2),k())}const qRe=[[["ccf-drawer"]],[["ccf-drawer-content"]],"*"],YRe=["ccf-drawer","ccf-drawer-content","*"];function R9(n){throw new Error(`Multiple drawers in position ${n}`)}let XRe=(()=>{class n{constructor(t,i){this.cdr=i,this.className="ccf-drawer-container",this.subscriptions=new Te,this.channel=t.connect(this),this.subscriptions.add(this.channel.getMessages().subscribe(r=>{this.handleMessage(r)&&i.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(Rr(null)).subscribe(()=>{const t=this.validateDrawers();this.channel.sendMessage({type:"drawer-containers-changed",drawers:t}),this.cdr.markForCheck()}),this.content1.changes.pipe(Rr(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(),i=t.filter(s=>"start"===s.position),r=t.filter(s=>"end"===s.position);return i.length>1&&R9("start"),r.length>1&&R9("end"),[i[0],r[0]]}}return n.\u0275fac=function(t){return new(t||n)(E(_0),E(kn))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-drawer-container"]],contentQueries:function(t,i,r){if(1&t&&(ei(r,ZF,5),ei(r,bx,5)),2&t){let s;_t(s=yt())&&(i.drawers=s),_t(s=yt())&&(i.content1=s)}},viewQuery:function(t,i){if(1&t&&Jn(bx,5),2&t){let r;_t(r=yt())&&(i.content2=r)}},hostVars:2,hostBindings:function(t,i){2&t&&Rn(i.className)},exportAs:["ccfDrawerContainer"],features:[Dt([_0])],ngContentSelectors:YRe,decls:3,vars:1,consts:[[4,"ngIf"]],template:function(t,i){1&t&&(wi(qRe),Ht(0),Ht(1,1),mt(2,WRe,2,0,"ccf-drawer-content",0)),2&t&&(G(2),ie("ngIf",!i.hasWrappedContent))},directives:[zr,bx],styles:["[_nghost-%COMP%]{display:block;position:relative;z-index:1;overflow:hidden;-webkit-overflow-scrolling:touch}"],changeDetection:0}),n})();var Cx,KRe=ze(457),ZRe=new Uint8Array(16);function QRe(){if(!Cx&&!(Cx="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Cx(ZRe)}const JRe=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,tke=function(n){return"string"==typeof n&&JRe.test(n)};for(var Ls=[],QF=0;QF<256;++QF)Ls.push((QF+256).toString(16).substr(1));const ske=function(n,e,t){var i=(n=n||{}).random||(n.rng||QRe)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,e){t=t||0;for(var r=0;r<16;++r)e[t+r]=i[r];return e}return function(n){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,t=(Ls[n[e+0]]+Ls[n[e+1]]+Ls[n[e+2]]+Ls[n[e+3]]+"-"+Ls[n[e+4]]+Ls[n[e+5]]+"-"+Ls[n[e+6]]+Ls[n[e+7]]+"-"+Ls[n[e+8]]+Ls[n[e+9]]+"-"+Ls[n[e+10]]+Ls[n[e+11]]+Ls[n[e+12]]+Ls[n[e+13]]+Ls[n[e+14]]+Ls[n[e+15]]).toLowerCase();if(!tke(t))throw TypeError("Stringified UUID is invalid");return t}(i)};function k9(n){const e=new $t(n.transformMatrix),t=e.transformAsPoint([-1,-1,-1],[]),i=e.transformAsPoint([1,1,1],[]);return new Di({lowerBound:new S(...t.map((r,s)=>Math.min(r,i[s]))),upperBound:new S(...i.map((r,s)=>Math.max(r,t[s])))})}let as=class extends Jm{constructor(e){super(),this.injector=e,this.gizmo$=ht([{"@id":"http://purl.org/ccf/latest/ccf.owl#VHMaleOrgans_VHM_Spleen_Colic_Surface","@type":"SpatialSceneNode",scenegraph:"https://hubmapconsortium.github.io/ccf-3d-reference-object-library/Assets/body4Mesh_1338.glb",transformMatrix:new $t($t.IDENTITY).scale([2,2,2]).rotateY(ib(0)),tooltip:"Gizmo",unpickable:!0,_lighting:"pbr",zoomBasedOpacity:!1,color:[255,255,255,255],opacity:1}])}get nodes$(){return Qi([this.placementCube$,this.referenceOrganNodes$,this.previousRegistrationNodes$,this.nodeCollisions$]).pipe(Ae(([e,t,i,r])=>[...e,...i,...t,...this.snapshot.showCollisions?r:[]]))}get rotatedNodes$(){return Qi([this.rotation$,this.nodes$]).pipe(Ae(([e,t])=>0===e?t:t.map(i=>Object.assign(Object.assign({},i),{transformMatrix:new $t($t.IDENTITY).rotateY(ib(e)).multiplyRight(i.transformMatrix)}))))}get referenceOrganNodes$(){return Qi([this.model.anatomicalStructures$,this.model.extractionSites$,this.model.organIri$]).pipe(Zg(400),Ae(([e,t,i])=>this.createSceneNodes(i,[...e,...t])))}get referenceOrganSimpleNodes$(){return Qi([this.model.anatomicalStructures$,this.model.organIri$,this.referenceData.state$]).pipe(Ae(([e,t,i])=>e.map(r=>{var s;return i.sceneNodeLookup[r.id]?[Object.assign(Object.assign({},i.simpleSceneNodeLookup[r.id]),{opacity:(null!==(s=r.opacity)&&void 0!==s?s:100)/100,color:[255,255,255,255]})]:(i.anatomicalStructures[t]||[]).filter(o=>o.representation_of===r.id).map(o=>{var a;return Object.assign(Object.assign({},i.simpleSceneNodeLookup[o["@id"]]),{opacity:(null!==(a=r.opacity)&&void 0!==a?a:100)/100,color:[255,255,255,255]})})}).reduce((r,s)=>r.concat(s),[])))}get nodeCollisions$(){return Qi([this.referenceOrganSimpleNodes$,this.placementCube$]).pipe(Fn(([e,t])=>t.length>0),Ae(([e,t])=>{const i=k9(t[0]);return e.filter(r=>i.overlaps(k9(r)))}))}get previousRegistrationNodes$(){return Qi([this.model.organIri$,this.model.showPrevious$,this.registration.previousRegistrations$]).pipe(Ae(([e,t,i])=>t?i.map(r=>{const s=Array.isArray(r.placement)?r.placement[0]:r.placement;if(s.target===e){const o=this.model.snapshot.organDimensions,a=[o.x,o.y,o.z].map(l=>-l/1e3/2);return{"@id":r["@id"],"@type":"SpatialSceneNode",transformMatrix:new $t($t.IDENTITY).translate([s.x_translation,s.y_translation,s.z_translation].map((l,c)=>l/1e3+a[c])).rotateXYZ([s.x_rotation,s.y_rotation,s.z_rotation].map(ib)).scale([r.x_dimension,r.y_dimension,r.z_dimension].map(l=>l/1e3/2)),color:[25,118,210,200],tooltip:r.label,unpickable:!0}}}).filter(r=>!!r):[]))}get placementCube$(){return Qi([this.model.viewType$,this.model.blockSize$,this.model.rotation$,this.model.position$,this.model.organ$]).pipe(Ae(([e,t,i,r,s])=>""===s.src?[]:[this.placementCube]))}get placementCube(){const{viewType:e,blockSize:t,rotation:i,position:r,organDimensions:s}=this.model.snapshot,o=[s.x,s.y,s.z].map(a=>-a/1e3/2);return{"@id":"#DraftPlacement","@type":"SpatialSceneNode",transformMatrix:new $t($t.IDENTITY).translate([r.x,r.y,r.z].map((a,l)=>a/1e3+o[l])).rotateXYZ([i.x,i.y,i.z].map(ib)).scale([t.x,t.y,t.z].map(a=>a/1e3/2)),color:[255,255,0,200],tooltip:"Draft Placement",unpickable:"3d"===e}}get rotation$(){return this.model.viewSide$.pipe(Ae(e=>{let t=0;switch(e){case"left":t=-90;break;case"right":t=90;break;case"posterior":t=180}return t}))}ngxsOnInit(){super.ngxsOnInit(),this.model=this.injector.get(ai),this.registration=this.injector.get(Sr),this.referenceData=this.injector.get(fc)}createSceneNodes(e,t){const i=this.referenceData.snapshot;return t.filter(r=>r.visible&&r.opacity&&r.opacity>0).map(r=>{var s;return i.sceneNodeLookup[r.id]?[Object.assign(Object.assign({},i.sceneNodeLookup[r.id]),{opacity:(null!==(s=r.opacity)&&void 0!==s?s:100)/100,color:[255,255,255,255]})]:(i.anatomicalStructures[e]||[]).filter(o=>o.representation_of===r.id).map(o=>{var a;return Object.assign(Object.assign({},i.sceneNodeLookup[o["@id"]]),{opacity:(null!==(a=r.opacity)&&void 0!==a?a:100)/100,color:[255,255,255,255]})})}).reduce((r,s)=>r.concat(s),[])}};as.\u0275fac=function(e){return new(e||as)(I(Nt))},as.\u0275prov=ue({token:as,factory:as.\u0275fac}),xe([oi()],as.prototype,"nodes$",null),xe([oi()],as.prototype,"rotatedNodes$",null),xe([oi()],as.prototype,"referenceOrganNodes$",null),xe([oi()],as.prototype,"referenceOrganSimpleNodes$",null),xe([oi()],as.prototype,"nodeCollisions$",null),xe([oi()],as.prototype,"previousRegistrationNodes$",null),xe([oi()],as.prototype,"placementCube$",null),xe([oi()],as.prototype,"placementCube",null),xe([oi()],as.prototype,"rotation$",null),as=xe([xh(),cd({name:"scene",defaults:{showCollisions:!hu.production}})],as);let ko=class extends uDe{constructor(e){super(),this.injector=e,this._latestTags=[]}get tags$(){return Qi([this.entities$,this.scene.nodeCollisions$]).pipe(Ae(([e,t])=>{const i=[],r=new Set,s=new Set;Object.entries(e).forEach(([o,a])=>{"removed"===a.type?s.add(o):(r.add(o),i.push(a))});for(const o of t){const a=o.representation_of;a&&!s.has(a)&&!r.has(a)&&(r.add(a),i.push({id:a,label:o.tooltip,type:"assigned"}))}return i}))}get latestTags(){return this._latestTags}ngxsOnInit(){super.ngxsOnInit(),this.model=this.injector.get(ai),this.scene=this.injector.get(as),this.page=this.injector.get(ji),this.tags$.subscribe(e=>{this._latestTags=e}),this.entities$.subscribe(()=>this.page.setHasChanges())}addTags(e){for(const t of e)this.addTagRaw(t)}addTag(e){this.addTagRaw(e)}removeTag(e){this.snapshot.entities[e.id]?this.updateEntitiesMany([{id:e.id,changes:{type:"removed"}}]):this.addEntityOne(Object.assign(Object.assign({},e),{type:"removed"}))}searchExternal(e,t){const i=this.model.snapshot.anatomicalStructures.filter(r=>-1!==r.name.toLowerCase().indexOf(e.toLowerCase()));return[{totalCount:i.length,results:i.map(r=>({id:r.id,label:r.name,type:"added"})).slice(0,t)}]}addTagRaw(e){this.snapshot.entities[e.id]?this.updateEntitiesMany([{id:e.id,changes:{type:"added"}}]):this.addEntityOne(Object.assign(Object.assign({},e),{type:"added"}))}};ko.\u0275fac=function(e){return new(e||ko)(I(Nt))},ko.\u0275prov=ue({token:ko,factory:ko.\u0275fac}),xe([oi()],ko.prototype,"tags$",null),xe([on()],ko.prototype,"addTags",null),xe([on()],ko.prototype,"addTag",null),xe([on()],ko.prototype,"removeTag",null),xe([lu.ak],ko.prototype,"searchExternal",null),ko=xe([xh(),cd({name:"tags",defaults:Object.assign({},{ids:[],entities:{}})})],ko);let Sr=class extends Jm{constructor(e,t){super(),this.injector=e,this.globalConfig=t,this.displayErrors$=this.state$.pipe(ur("displayErrors"))}get metadata$(){return Qi([this.page.state$,this.model.state$,this.tags.tags$]).pipe(Ae(([e,t,i])=>this.buildMetadata(e,t,i)))}get jsonld$(){return Qi([this.page.state$,this.model.state$,this.tags.tags$]).pipe(Ae(([e,t,i])=>this.buildJsonLd(e,t,i)))}get valid$(){return Qi([this.page.state$,this.model.state$]).pipe(Ae(()=>this.isValid))}get previousRegistrations$(){const{globalConfig:e,state$:t}=this;return Qi([t.pipe(ur("registrations")),e.getOption("fetchPreviousRegistrations").pipe(Pr(s=>{var o;return null!==(o=null==s?void 0:s())&&void 0!==o?o:[[]]}),Rr([]))]).pipe(Ae(([s,o])=>[...s,...o]))}get currentIdentifier(){return ske()}get currentDate(){return(new Date).toISOString().split("T")[0]}ngxsOnInit(){super.ngxsOnInit(),this.page=this.injector.get(ji),this.model=this.injector.get(ai),this.tags=this.injector.get(ko),this.refData=this.injector.get(fc),this.globalConfig.config$.pipe(yi(1),Ti(({useDownload:e,register:t})=>this.ctx.patchState({useRegistrationCallback:!(e||!t)}))).subscribe(),this.globalConfig.getOption("editRegistration").pipe(aF(),Ti(e=>this.editRegistration(e))).subscribe()}editRegistration(e){return yl(this,void 0,void 0,function*(){const t=this.refData.normalizePlacement(Array.isArray(e.placement)?e.placement[0]:e.placement),i=this.refData.getOrganData(t.target);this.page.setUserName({firstName:e.creator_first_name,lastName:e.creator_last_name}),i&&(this.model.setOrgan(i.organ),i.sex&&this.model.setSex(i.sex),i.side&&this.model.setSide(i.side)),this.model.setBlockSize({x:e.x_dimension,y:e.y_dimension,z:e.z_dimension}),this.model.setRotation({x:t.x_rotation,y:t.y_rotation,z:t.z_rotation}),this.model.setSlicesConfig({thickness:e.slice_thickness||NaN,numSlices:e.slice_count||NaN}),yield new Promise(s=>{setTimeout(s,1e3)}),this.model.setPosition({x:t.x_translation,y:t.y_translation,z:t.z_translation});const r=new Set(e.ccf_annotations);this.tags.addTags(this.model.snapshot.anatomicalStructures.filter(s=>r.has(s.id)).map(s=>({id:s.id,label:s.name,type:"added"}))),this.page.registrationStarted()})}setUseRegistrationCallback(e){this.ctx.patchState({useRegistrationCallback:e})}setDisplayErrors(e){this.ctx.patchState({displayErrors:e})}addRegistration(e){this.ctx.setState(m0({registrations:vRe(e)}))}isDataValid(e,t){return[e.user.firstName,e.user.lastName,t.organ.src,t.organ.name,t.organ.organ].every(r=>!!r)}get isValid(){return this.isDataValid(this.page.snapshot,this.model.snapshot)}register(e){if(!this.isValid)return;const{globalConfig:{snapshot:{register:t}},page:i,model:r,snapshot:s}=this,o=this.buildJsonLd(i.snapshot,r.snapshot,this.tags.latestTags),a=JSON.stringify(o,void 0,2);if(e||void 0===e&&s.useRegistrationCallback)null==t||t(a);else{const l=new Blob([a],{type:"application/json",endings:"native"});(0,KRe.saveAs)(l,"registration-data.json")}this.addRegistration(o),this.setDisplayErrors(!1),this.page.clearHasChanges()}buildMetadata(e,t,i){const r=[];return e.registrationCallbackSet||r.push({label:"First Name",value:e.user.firstName},{label:"Last Name",value:e.user.lastName}),r.push({label:"Reference Organ Name",value:t.organ.name},{label:"Tissue Block Dimensions (mm)",value:this.xyzTripletToString(t.blockSize)},{label:"Tissue Block Position (mm)",value:this.xyzTripletToString(t.position)},{label:"Tissue Block Rotation",value:this.xyzTripletToString(t.rotation)},{label:"Anatomical Structure Tags",value:i.map(s=>s.label).join(", ")},{label:"Time Stamp",value:this.currentDate},{label:"Alignment ID",value:this.currentIdentifier}),r}buildJsonLd(e,t,i){var r,s;return{"@context":"https://hubmapconsortium.github.io/ccf-ontology/ccf-context.jsonld","@id":`http://purl.org/ccf/1.5/${this.currentIdentifier}`,"@type":"SpatialEntity",label:t.label||void 0,creator:`${e.user.firstName} ${e.user.lastName}`,creator_first_name:e.user.firstName,creator_last_name:e.user.lastName,creation_date:this.currentDate,ccf_annotations:i.map(o=>o.id),slice_thickness:(null===(r=t.slicesConfig)||void 0===r?void 0:r.thickness)||void 0,slice_count:(null===(s=t.slicesConfig)||void 0===s?void 0:s.numSlices)||void 0,x_dimension:+t.blockSize.x.toFixed(3),y_dimension:+t.blockSize.y.toFixed(3),z_dimension:+t.blockSize.z.toFixed(3),dimension_units:"millimeter",placement:{"@context":"https://hubmapconsortium.github.io/ccf-ontology/ccf-context.jsonld","@id":`http://purl.org/ccf/1.5/${this.currentIdentifier}_placement`,"@type":"SpatialPlacement",target:t.organIri,placement_date:this.currentDate,x_scaling:1,y_scaling:1,z_scaling:1,scaling_units:"ratio",x_rotation:+t.rotation.x.toFixed(3),y_rotation:+t.rotation.y.toFixed(3),z_rotation:+t.rotation.z.toFixed(3),rotation_order:"XYZ",rotation_units:"degree",x_translation:+t.position.x.toFixed(3),y_translation:+t.position.y.toFixed(3),z_translation:+t.position.z.toFixed(3),translation_units:"millimeter"}}}xyzTripletToString(e){return`${Math.round(e.x)}, ${Math.round(e.y)}, ${Math.round(e.z)}`}};function ake(n,e){if(1&n){const t=Zi();R(0,"mat-icon",2),ge("click",function(){return en(t),Qe().setAllOpacity(20)}),De(1,"refresh"),k()}2&n&&ie("matRippleCentered",!0)("matRippleUnbounded",!0)}function lke(n,e){if(1&n){const t=Zi();R(0,"div",3),ge("mouseenter",function(){const s=en(t).$implicit;return Qe().mouseOver(s)})("mouseleave",function(){return en(t),Qe().mouseOut()}),tt(1,"mat-icon",4),R(2,"div",5),De(3),k(),R(4,"div",6),R(5,"ccf-opacity-slider",7,8),ge("opacityChange",function(r){return en(t),Qe().updateOpacity(r)})("opacityReset",function(){return en(t),Qe().resetItem()})("visibilityToggle",function(){const s=en(t).$implicit;return Qe().toggleVisibility(s)}),k(),k(),k()}if(2&n){const t=e.$implicit,i=Qe();st("selected",!!i.selection&&i.getId(0,i.selection)===i.getId(0,t)),G(1),st("fade",!t.visible),G(1),st("hidden",t.id===(null==i.selection?null:i.selection.id)),Jy("title",t.name),G(1),xi(t.name),G(1),st("hidden",t.id!==(null==i.selection?null:i.selection.id)),G(1),ie("visible",t.visible)("opacity",i.selection?null==i.selection?null:i.selection.opacity:20)}}Sr.\u0275fac=function(e){return new(e||Sr)(I(Nt),I(Ah))},Sr.\u0275prov=ue({token:Sr,factory:Sr.\u0275fac}),xe([oi()],Sr.prototype,"metadata$",null),xe([oi()],Sr.prototype,"jsonld$",null),xe([oi()],Sr.prototype,"valid$",null),xe([oi()],Sr.prototype,"previousRegistrations$",null),xe([oi()],Sr.prototype,"currentIdentifier",null),xe([oi()],Sr.prototype,"currentDate",null),xe([on()],Sr.prototype,"setUseRegistrationCallback",null),xe([on()],Sr.prototype,"setDisplayErrors",null),xe([on()],Sr.prototype,"addRegistration",null),xe([oi()],Sr.prototype,"isValid",null),Sr=xe([xh(),cd({name:"registration",defaults:{useRegistrationCallback:!1,displayErrors:!1,registrations:[]}})],Sr);let cke=(()=>{class n{constructor(t){this.ga=t,this.clsName="ccf-visibility-menu",this.hover=new Le,this.itemsChange=new Le}toggleVisibility(t){t=Object.assign(Object.assign({},t),{visible:!t.visible}),this.selection&&t.id===this.selection.id&&(this.selection=Object.assign(Object.assign({},this.selection),{visible:t.visible})),this.ga.event("visibility_toggled","visibility_menu",""+t.id,+t.visible),this.updateOpacity(t.opacity)}mouseOver(t){this.selection=t===this.selection?void 0:t,this.hover.emit(t)}mouseOut(){this.selection=void 0,this.hover.emit(void 0)}updateOpacity(t){if(!this.selection)return;const i=Object.assign(Object.assign({},this.selection),{opacity:t});this.selection=i,this.items=this.items.map(r=>r.id===i.id?i:r),this.ga.event("opacity_update","visibility_menu",""+i.id,i.opacity),this.itemsChange.emit(this.items)}resetItem(){if(this.selection){const t=Object.assign(Object.assign({},this.selection),{opacity:20,visible:!0});this.selection=t,this.items=this.items.map(i=>i.id===t.id?t:i),this.ga.event("item_reset","visibility_menu",""+t.id),this.itemsChange.emit(this.items)}}setAllOpacity(t){this.items=this.items.map(i=>Object.assign(Object.assign({},i),{opacity:t,visible:!0})),this.ga.event("all_items_opacity_update","visibility_menu",void 0,t),this.itemsChange.emit(this.items)}getId(t,i){return i.id}}return n.\u0275fac=function(t){return new(t||n)(E(xs))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-visibility-menu"]],hostVars:2,hostBindings:function(t,i){2&t&&Rn(i.clsName)},inputs:{items:"items",selection:"selection"},outputs:{hover:"hover",itemsChange:"itemsChange"},decls:2,vars:3,consts:[["class","icon reset","matRipple","",3,"matRippleCentered","matRippleUnbounded","click",4,"ngIf"],["class","item-entry",3,"selected","mouseenter","mouseleave",4,"ngFor","ngForOf","ngForTrackBy"],["matRipple","",1,"icon","reset",3,"matRippleCentered","matRippleUnbounded","click"],[1,"item-entry",3,"mouseenter","mouseleave"],["svgIcon","app:opacity",1,"opacity-icon"],[1,"item-name",3,"title"],[1,"slider"],[3,"visible","opacity","opacityChange","opacityReset","visibilityToggle"],["slider",""]],template:function(t,i){1&t&&(mt(0,ake,2,2,"mat-icon",0),mt(1,lke,7,12,"div",1)),2&t&&(ie("ngIf",i.items.length),G(1),ie("ngForOf",i.items)("ngForTrackBy",i.getId))},directives:[zr,pl,rs,Js,LPe],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;margin-right:0;margin-left:0;max-height:18rem;overflow-y:auto;scrollbar-width:thin}[_nghost-%COMP%] .icon[_ngcontent-%COMP%]{padding:.25rem;border-radius:.25rem}[_nghost-%COMP%] .reset[_ngcontent-%COMP%]{transform:scaleX(-1);cursor:pointer;transition:.6s;position:absolute;top:3rem}[_nghost-%COMP%] .reset[_ngcontent-%COMP%]:hover{border-radius:2px}[_nghost-%COMP%] .item-entry[_ngcontent-%COMP%]{display:flex;height:2.25rem;align-items:center;flex-shrink:0;position:relative}[_nghost-%COMP%] .item-entry[_ngcontent-%COMP%] .opacity[_ngcontent-%COMP%]{cursor:pointer}[_nghost-%COMP%] .item-entry[_ngcontent-%COMP%] .opacity-icon[_ngcontent-%COMP%]{z-index:1;transition:.6s}[_nghost-%COMP%] .item-entry[_ngcontent-%COMP%] .opacity-icon[_ngcontent-%COMP%]:hover{border-radius:2px}[_nghost-%COMP%] .item-entry[_ngcontent-%COMP%] .item-name[_ngcontent-%COMP%]{-webkit-user-select:none;user-select:none;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-left:.5rem;opacity:1;transition-duration:.4s;transition-timing-function:ease-in-out;transition-property:opacity;max-width:calc(100% - 2.5rem)}[_nghost-%COMP%] .item-entry[_ngcontent-%COMP%] .item-name.hidden[_ngcontent-%COMP%]{opacity:0}[_nghost-%COMP%] .item-entry[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%]{width:calc(100% - 2rem);transition-duration:.3s;transition-timing-function:ease-in-out;transition-property:opacity;left:2rem;position:absolute;opacity:1}[_nghost-%COMP%] .item-entry[_ngcontent-%COMP%] .slider.hidden[_ngcontent-%COMP%]{opacity:0;transition-duration:.1s;transition-timing-function:ease-in-out;transition-property:opacity}"],changeDetection:0}),n})();const uke=["*"],F9=new ve("MatChipRemove"),N9=new ve("MatChipAvatar"),L9=new ve("MatChipTrailingIcon");class dke{constructor(e){this._elementRef=e}}const hke=Hf(Uf(nc(dke),"primary"),-1);let y0=(()=>{class n extends hke{constructor(t,i,r,s,o,a,l,c){super(t),this._ngZone=i,this._changeDetectorRef=o,this._hasFocus=!1,this.chipListSelectable=!0,this._chipListMultiple=!1,this._chipListDisabled=!1,this._selected=!1,this._selectable=!0,this._disabled=!1,this._removable=!0,this._onFocus=new Se,this._onBlur=new Se,this.selectionChange=new Le,this.destroyed=new Le,this.removed=new Le,this._addHostClassName(),this._chipRippleTarget=a.createElement("div"),this._chipRippleTarget.classList.add("mat-chip-ripple"),this._elementRef.nativeElement.appendChild(this._chipRippleTarget),this._chipRipple=new oj(this,i,this._chipRippleTarget,r),this._chipRipple.setupTriggerEvents(t),this.rippleConfig=s||{},this._animationsDisabled="NoopAnimations"===l,this.tabIndex=null!=c&&parseInt(c)||-1}get rippleDisabled(){return this.disabled||this.disableRipple||this._animationsDisabled||!!this.rippleConfig.disabled}get selected(){return this._selected}set selected(t){const i=Mt(t);i!==this._selected&&(this._selected=i,this._dispatchSelectionChange())}get value(){return void 0!==this._value?this._value:this._elementRef.nativeElement.textContent}set value(t){this._value=t}get selectable(){return this._selectable&&this.chipListSelectable}set selectable(t){this._selectable=Mt(t)}get disabled(){return this._chipListDisabled||this._disabled}set disabled(t){this._disabled=Mt(t)}get removable(){return this._removable}set removable(t){this._removable=Mt(t)}get ariaSelected(){return this.selectable&&(this._chipListMultiple||this.selected)?this.selected.toString():null}_addHostClassName(){const t="mat-basic-chip",i=this._elementRef.nativeElement;i.hasAttribute(t)||i.tagName.toLowerCase()===t?i.classList.add(t):i.classList.add("mat-standard-chip")}ngOnDestroy(){this.destroyed.emit({chip:this}),this._chipRipple._removeTriggerEvents()}select(){this._selected||(this._selected=!0,this._dispatchSelectionChange(),this._changeDetectorRef.markForCheck())}deselect(){this._selected&&(this._selected=!1,this._dispatchSelectionChange(),this._changeDetectorRef.markForCheck())}selectViaInteraction(){this._selected||(this._selected=!0,this._dispatchSelectionChange(!0),this._changeDetectorRef.markForCheck())}toggleSelected(t=!1){return this._selected=!this.selected,this._dispatchSelectionChange(t),this._changeDetectorRef.markForCheck(),this.selected}focus(){this._hasFocus||(this._elementRef.nativeElement.focus(),this._onFocus.next({chip:this})),this._hasFocus=!0}remove(){this.removable&&this.removed.emit({chip:this})}_handleClick(t){this.disabled?t.preventDefault():t.stopPropagation()}_handleKeydown(t){if(!this.disabled)switch(t.keyCode){case 46:case 8:this.remove(),t.preventDefault();break;case 32:this.selectable&&this.toggleSelected(!0),t.preventDefault()}}_blur(){this._ngZone.onStable.pipe(yi(1)).subscribe(()=>{this._ngZone.run(()=>{this._hasFocus=!1,this._onBlur.next({chip:this})})})}_dispatchSelectionChange(t=!1){this.selectionChange.emit({source:this,isUserInput:t,selected:this._selected})}}return n.\u0275fac=function(t){return new(t||n)(E(rt),E(dt),E(si),E(aj,8),E(kn),E(ut),E(Do,8),Zr("tabindex"))},n.\u0275dir=oe({type:n,selectors:[["mat-basic-chip"],["","mat-basic-chip",""],["mat-chip"],["","mat-chip",""]],contentQueries:function(t,i,r){if(1&t&&(ei(r,N9,5),ei(r,L9,5),ei(r,F9,5)),2&t){let s;_t(s=yt())&&(i.avatar=s.first),_t(s=yt())&&(i.trailingIcon=s.first),_t(s=yt())&&(i.removeIcon=s.first)}},hostAttrs:["role","option",1,"mat-chip","mat-focus-indicator"],hostVars:14,hostBindings:function(t,i){1&t&&ge("click",function(s){return i._handleClick(s)})("keydown",function(s){return i._handleKeydown(s)})("focus",function(){return i.focus()})("blur",function(){return i._blur()}),2&t&&(nn("tabindex",i.disabled?null:i.tabIndex)("disabled",i.disabled||null)("aria-disabled",i.disabled.toString())("aria-selected",i.ariaSelected),st("mat-chip-selected",i.selected)("mat-chip-with-avatar",i.avatar)("mat-chip-with-trailing-icon",i.trailingIcon||i.removeIcon)("mat-chip-disabled",i.disabled)("_mat-animation-noopable",i._animationsDisabled))},inputs:{color:"color",disableRipple:"disableRipple",tabIndex:"tabIndex",selected:"selected",value:"value",selectable:"selectable",disabled:"disabled",removable:"removable"},outputs:{selectionChange:"selectionChange",destroyed:"destroyed",removed:"removed"},exportAs:["matChip"],features:[ct]}),n})(),B9=(()=>{class n{constructor(t,i){this._parentChip=t,"BUTTON"===i.nativeElement.nodeName&&i.nativeElement.setAttribute("type","button")}_handleClick(t){const i=this._parentChip;i.removable&&!i.disabled&&i.remove(),t.stopPropagation()}}return n.\u0275fac=function(t){return new(t||n)(E(y0),E(rt))},n.\u0275dir=oe({type:n,selectors:[["","matChipRemove",""]],hostAttrs:[1,"mat-chip-remove","mat-chip-trailing-icon"],hostBindings:function(t,i){1&t&&ge("click",function(s){return i._handleClick(s)})},features:[Dt([{provide:F9,useExisting:n}])]}),n})();const V9=new ve("mat-chips-default-options"),gke=FO(class{constructor(n,e,t,i){this._defaultErrorStateMatcher=n,this._parentForm=e,this._parentFormGroup=t,this.ngControl=i}});let mke=0;class _ke{constructor(e,t){this.source=e,this.value=t}}let z9=(()=>{class n extends gke{constructor(t,i,r,s,o,a,l){super(a,s,o,l),this._elementRef=t,this._changeDetectorRef=i,this._dir=r,this.controlType="mat-chip-list",this._lastDestroyedChipIndex=null,this._destroyed=new Se,this._uid="mat-chip-list-"+mke++,this._tabIndex=0,this._userTabIndex=null,this._onTouched=()=>{},this._onChange=()=>{},this._multiple=!1,this._compareWith=(c,d)=>c===d,this._required=!1,this._disabled=!1,this.ariaOrientation="horizontal",this._selectable=!0,this.change=new Le,this.valueChange=new Le,this.ngControl&&(this.ngControl.valueAccessor=this)}get selected(){var t,i;return this.multiple?(null===(t=this._selectionModel)||void 0===t?void 0:t.selected)||[]:null===(i=this._selectionModel)||void 0===i?void 0:i.selected[0]}get role(){return this.empty?null:"listbox"}get multiple(){return this._multiple}set multiple(t){this._multiple=Mt(t),this._syncChipsState()}get compareWith(){return this._compareWith}set compareWith(t){this._compareWith=t,this._selectionModel&&this._initializeSelection()}get value(){return this._value}set value(t){this.writeValue(t),this._value=t}get id(){return this._chipInput?this._chipInput.id:this._uid}get required(){return this._required}set required(t){this._required=Mt(t),this.stateChanges.next()}get placeholder(){return this._chipInput?this._chipInput.placeholder:this._placeholder}set placeholder(t){this._placeholder=t,this.stateChanges.next()}get focused(){return this._chipInput&&this._chipInput.focused||this._hasFocusedChip()}get empty(){return(!this._chipInput||this._chipInput.empty)&&(!this.chips||0===this.chips.length)}get shouldLabelFloat(){return!this.empty||this.focused}get disabled(){return this.ngControl?!!this.ngControl.disabled:this._disabled}set disabled(t){this._disabled=Mt(t),this._syncChipsState()}get selectable(){return this._selectable}set selectable(t){this._selectable=Mt(t),this.chips&&this.chips.forEach(i=>i.chipListSelectable=this._selectable)}set tabIndex(t){this._userTabIndex=t,this._tabIndex=t}get chipSelectionChanges(){return Ni(...this.chips.map(t=>t.selectionChange))}get chipFocusChanges(){return Ni(...this.chips.map(t=>t._onFocus))}get chipBlurChanges(){return Ni(...this.chips.map(t=>t._onBlur))}get chipRemoveChanges(){return Ni(...this.chips.map(t=>t.destroyed))}ngAfterContentInit(){this._keyManager=new nO(this.chips).withWrap().withVerticalOrientation().withHomeAndEnd().withHorizontalOrientation(this._dir?this._dir.value:"ltr"),this._dir&&this._dir.change.pipe(Tn(this._destroyed)).subscribe(t=>this._keyManager.withHorizontalOrientation(t)),this._keyManager.tabOut.pipe(Tn(this._destroyed)).subscribe(()=>{this._allowFocusEscape()}),this.chips.changes.pipe(Rr(null),Tn(this._destroyed)).subscribe(()=>{this.disabled&&Promise.resolve().then(()=>{this._syncChipsState()}),this._resetChips(),this._initializeSelection(),this._updateTabIndex(),this._updateFocusForDestroyedChips(),this.stateChanges.next()})}ngOnInit(){this._selectionModel=new lS(this.multiple,void 0,!1),this.stateChanges.next()}ngDoCheck(){this.ngControl&&(this.updateErrorState(),this.ngControl.disabled!==this._disabled&&(this.disabled=!!this.ngControl.disabled))}ngOnDestroy(){this._destroyed.next(),this._destroyed.complete(),this.stateChanges.complete(),this._dropSubscriptions()}registerInput(t){this._chipInput=t,this._elementRef.nativeElement.setAttribute("data-mat-chip-input",t.id)}setDescribedByIds(t){this._ariaDescribedby=t.join(" ")}writeValue(t){this.chips&&this._setSelectionByValue(t,!1)}registerOnChange(t){this._onChange=t}registerOnTouched(t){this._onTouched=t}setDisabledState(t){this.disabled=t,this.stateChanges.next()}onContainerClick(t){this._originatesFromChip(t)||this.focus()}focus(t){this.disabled||this._chipInput&&this._chipInput.focused||(this.chips.length>0?(this._keyManager.setFirstItemActive(),this.stateChanges.next()):(this._focusInput(t),this.stateChanges.next()))}_focusInput(t){this._chipInput&&this._chipInput.focus(t)}_keydown(t){const i=t.target;i&&i.classList.contains("mat-chip")&&(this._keyManager.onKeydown(t),this.stateChanges.next())}_updateTabIndex(){this._tabIndex=this._userTabIndex||(0===this.chips.length?-1:0)}_updateFocusForDestroyedChips(){if(null!=this._lastDestroyedChipIndex)if(this.chips.length){const t=Math.min(this._lastDestroyedChipIndex,this.chips.length-1);this._keyManager.setActiveItem(t)}else this.focus();this._lastDestroyedChipIndex=null}_isValidIndex(t){return t>=0&&tr.deselect()),Array.isArray(t))t.forEach(r=>this._selectValue(r,i)),this._sortValues();else{const r=this._selectValue(t,i);r&&i&&this._keyManager.setActiveItem(r)}}_selectValue(t,i=!0){const r=this.chips.find(s=>null!=s.value&&this._compareWith(s.value,t));return r&&(i?r.selectViaInteraction():r.select(),this._selectionModel.select(r)),r}_initializeSelection(){Promise.resolve().then(()=>{(this.ngControl||this._value)&&(this._setSelectionByValue(this.ngControl?this.ngControl.value:this._value,!1),this.stateChanges.next())})}_clearSelection(t){this._selectionModel.clear(),this.chips.forEach(i=>{i!==t&&i.deselect()}),this.stateChanges.next()}_sortValues(){this._multiple&&(this._selectionModel.clear(),this.chips.forEach(t=>{t.selected&&this._selectionModel.select(t)}),this.stateChanges.next())}_propagateChanges(t){let i=null;i=Array.isArray(this.selected)?this.selected.map(r=>r.value):this.selected?this.selected.value:t,this._value=i,this.change.emit(new _ke(this,i)),this.valueChange.emit(i),this._onChange(i),this._changeDetectorRef.markForCheck()}_blur(){this._hasFocusedChip()||this._keyManager.setActiveItem(-1),this.disabled||(this._chipInput?setTimeout(()=>{this.focused||this._markAsTouched()}):this._markAsTouched())}_markAsTouched(){this._onTouched(),this._changeDetectorRef.markForCheck(),this.stateChanges.next()}_allowFocusEscape(){-1!==this._tabIndex&&(this._tabIndex=-1,setTimeout(()=>{this._tabIndex=this._userTabIndex||0,this._changeDetectorRef.markForCheck()}))}_resetChips(){this._dropSubscriptions(),this._listenToChipsFocus(),this._listenToChipsSelection(),this._listenToChipsRemoved()}_dropSubscriptions(){this._chipFocusSubscription&&(this._chipFocusSubscription.unsubscribe(),this._chipFocusSubscription=null),this._chipBlurSubscription&&(this._chipBlurSubscription.unsubscribe(),this._chipBlurSubscription=null),this._chipSelectionSubscription&&(this._chipSelectionSubscription.unsubscribe(),this._chipSelectionSubscription=null),this._chipRemoveSubscription&&(this._chipRemoveSubscription.unsubscribe(),this._chipRemoveSubscription=null)}_listenToChipsSelection(){this._chipSelectionSubscription=this.chipSelectionChanges.subscribe(t=>{t.source.selected?this._selectionModel.select(t.source):this._selectionModel.deselect(t.source),this.multiple||this.chips.forEach(i=>{!this._selectionModel.isSelected(i)&&i.selected&&i.deselect()}),t.isUserInput&&this._propagateChanges()})}_listenToChipsFocus(){this._chipFocusSubscription=this.chipFocusChanges.subscribe(t=>{let i=this.chips.toArray().indexOf(t.chip);this._isValidIndex(i)&&this._keyManager.updateActiveItem(i),this.stateChanges.next()}),this._chipBlurSubscription=this.chipBlurChanges.subscribe(()=>{this._blur(),this.stateChanges.next()})}_listenToChipsRemoved(){this._chipRemoveSubscription=this.chipRemoveChanges.subscribe(t=>{const i=t.chip,r=this.chips.toArray().indexOf(t.chip);this._isValidIndex(r)&&i._hasFocus&&(this._lastDestroyedChipIndex=r)})}_originatesFromChip(t){let i=t.target;for(;i&&i!==this._elementRef.nativeElement;){if(i.classList.contains("mat-chip"))return!0;i=i.parentElement}return!1}_hasFocusedChip(){return this.chips&&this.chips.some(t=>t._hasFocus)}_syncChipsState(){this.chips&&this.chips.forEach(t=>{t._chipListDisabled=this._disabled,t._chipListMultiple=this.multiple})}}return n.\u0275fac=function(t){return new(t||n)(E(rt),E(kn),E(Qo,8),E(mp,8),E(Zm,8),E(Vv),E(uc,10))},n.\u0275cmp=Ne({type:n,selectors:[["mat-chip-list"]],contentQueries:function(t,i,r){if(1&t&&ei(r,y0,5),2&t){let s;_t(s=yt())&&(i.chips=s)}},hostAttrs:[1,"mat-chip-list"],hostVars:15,hostBindings:function(t,i){1&t&&ge("focus",function(){return i.focus()})("blur",function(){return i._blur()})("keydown",function(s){return i._keydown(s)}),2&t&&(al("id",i._uid),nn("tabindex",i.disabled?null:i._tabIndex)("aria-describedby",i._ariaDescribedby||null)("aria-required",i.role?i.required:null)("aria-disabled",i.disabled.toString())("aria-invalid",i.errorState)("aria-multiselectable",i.multiple)("role",i.role)("aria-orientation",i.ariaOrientation),st("mat-chip-list-disabled",i.disabled)("mat-chip-list-invalid",i.errorState)("mat-chip-list-required",i.required))},inputs:{ariaOrientation:["aria-orientation","ariaOrientation"],multiple:"multiple",compareWith:"compareWith",value:"value",required:"required",placeholder:"placeholder",disabled:"disabled",selectable:"selectable",tabIndex:"tabIndex",errorStateMatcher:"errorStateMatcher"},outputs:{change:"change",valueChange:"valueChange"},exportAs:["matChipList"],features:[Dt([{provide:jv,useExisting:n}]),ct],ngContentSelectors:uke,decls:2,vars:0,consts:[[1,"mat-chip-list-wrapper"]],template:function(t,i){1&t&&(wi(),R(0,"div",0),Ht(1),k())},styles:['.mat-chip{position:relative;box-sizing:border-box;-webkit-tap-highlight-color:transparent;transform:translateZ(0);border:none;-webkit-appearance:none;-moz-appearance:none}.mat-standard-chip{transition:box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);display:inline-flex;padding:7px 12px;border-radius:16px;align-items:center;cursor:default;min-height:32px;height:1px}._mat-animation-noopable.mat-standard-chip{transition:none;animation:none}.mat-standard-chip .mat-chip-remove.mat-icon{width:18px;height:18px}.mat-standard-chip::after{top:0;left:0;right:0;bottom:0;position:absolute;border-radius:inherit;opacity:0;content:"";pointer-events:none;transition:opacity 200ms cubic-bezier(0.35, 0, 0.25, 1)}.mat-standard-chip:hover::after{opacity:.12}.mat-standard-chip:focus{outline:none}.mat-standard-chip:focus::after{opacity:.16}.cdk-high-contrast-active .mat-standard-chip{outline:solid 1px}.cdk-high-contrast-active .mat-standard-chip:focus{outline:dotted 2px}.mat-standard-chip.mat-chip-disabled::after{opacity:0}.mat-standard-chip.mat-chip-disabled .mat-chip-remove,.mat-standard-chip.mat-chip-disabled .mat-chip-trailing-icon{cursor:default}.mat-standard-chip.mat-chip-with-trailing-icon.mat-chip-with-avatar,.mat-standard-chip.mat-chip-with-avatar{padding-top:0;padding-bottom:0}.mat-standard-chip.mat-chip-with-trailing-icon.mat-chip-with-avatar{padding-right:8px;padding-left:0}[dir=rtl] .mat-standard-chip.mat-chip-with-trailing-icon.mat-chip-with-avatar{padding-left:8px;padding-right:0}.mat-standard-chip.mat-chip-with-trailing-icon{padding-top:7px;padding-bottom:7px;padding-right:8px;padding-left:12px}[dir=rtl] .mat-standard-chip.mat-chip-with-trailing-icon{padding-left:8px;padding-right:12px}.mat-standard-chip.mat-chip-with-avatar{padding-left:0;padding-right:12px}[dir=rtl] .mat-standard-chip.mat-chip-with-avatar{padding-right:0;padding-left:12px}.mat-standard-chip .mat-chip-avatar{width:24px;height:24px;margin-right:8px;margin-left:4px}[dir=rtl] .mat-standard-chip .mat-chip-avatar{margin-left:8px;margin-right:4px}.mat-standard-chip .mat-chip-remove,.mat-standard-chip .mat-chip-trailing-icon{width:18px;height:18px;cursor:pointer}.mat-standard-chip .mat-chip-remove,.mat-standard-chip .mat-chip-trailing-icon{margin-left:8px;margin-right:0}[dir=rtl] .mat-standard-chip .mat-chip-remove,[dir=rtl] .mat-standard-chip .mat-chip-trailing-icon{margin-right:8px;margin-left:0}.mat-chip-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none;border-radius:inherit;overflow:hidden}.mat-chip-list-wrapper{display:flex;flex-direction:row;flex-wrap:wrap;align-items:center;margin:-4px}.mat-chip-list-wrapper input.mat-input-element,.mat-chip-list-wrapper .mat-standard-chip{margin:4px}.mat-chip-list-stacked .mat-chip-list-wrapper{flex-direction:column;align-items:flex-start}.mat-chip-list-stacked .mat-chip-list-wrapper .mat-standard-chip{width:100%}.mat-chip-avatar{border-radius:50%;justify-content:center;align-items:center;display:flex;overflow:hidden;object-fit:cover}input.mat-chip-input{width:150px;margin:4px;flex:1 0 150px}\n'],encapsulation:2,changeDetection:0}),n})();const bke={separatorKeyCodes:[13]};let j9=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({providers:[Vv,{provide:V9,useValue:bke}],imports:[[On]]}),n})(),Cke=(()=>{class n{constructor(t){this.ga=t,this.clsName="ccf-visibility-toggle",this.visible=!1,this.toggleLabel="",this.disabled=!1,this.visibilityChanged=new Le}toggleVisibility(){this.visible=!this.visible,this.ga.event("visibility_toggled","visibility_toggle",""+this.visible),this.visibilityChanged.emit(this.visible)}}return n.\u0275fac=function(t){return new(t||n)(E(xs))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-visibility-toggle"]],hostVars:2,hostBindings:function(t,i){2&t&&Rn(i.clsName)},inputs:{visible:"visible",toggleLabel:"toggleLabel",disabled:"disabled"},outputs:{visibilityChanged:"visibilityChanged"},decls:8,vars:9,consts:[[1,"toggle-div"],[1,"toggle-wrapper",3,"click"],[1,"icon-background"],["svgIcon","app:visibility_off_cube",1,"icon","block"],[1,"icon","green"],[1,"toggle-label"]],template:function(t,i){1&t&&(R(0,"div",0),R(1,"mat-chip",1),ge("click",function(){return i.toggleVisibility()}),R(2,"div",2),tt(3,"mat-icon",3),R(4,"mat-icon",4),De(5,"done"),k(),k(),R(6,"div",5),De(7),k(),k(),k()),2&t&&(G(1),st("disabled",i.disabled),G(1),st("disabled",i.disabled),G(1),st("hidden",i.visible),G(1),st("hidden",!i.visible),G(3),xi(i.toggleLabel))},directives:[y0,rs],styles:["[_nghost-%COMP%]{height:3rem;display:flex;align-items:center}[_nghost-%COMP%] .mat-chip{padding:0!important}[_nghost-%COMP%] .mat-chip.disabled{cursor:not-allowed!important}[_nghost-%COMP%] .toggle-div[_ngcontent-%COMP%]{width:100%;display:flex;justify-content:center;padding-top:1.5rem}[_nghost-%COMP%] .toggle-div[_ngcontent-%COMP%] .toggle-wrapper[_ngcontent-%COMP%]{-webkit-user-select:none;-moz-user-select:none;display:flex;padding-left:.5rem;cursor:pointer;align-items:center;position:relative;border-width:.075rem;border-style:solid;height:2.25rem;border-radius:1.5rem;transition:background-color .2s ease-in-out}[_nghost-%COMP%] .toggle-div[_ngcontent-%COMP%] .toggle-wrapper[_ngcontent-%COMP%] .icon-background[_ngcontent-%COMP%]{border-radius:1.5rem;height:2.06rem;width:2.06rem;display:flex;align-items:center;justify-content:center}[_nghost-%COMP%] .toggle-div[_ngcontent-%COMP%] .toggle-wrapper[_ngcontent-%COMP%] .icon-background[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{transition:.6s;position:absolute}[_nghost-%COMP%] .toggle-div[_ngcontent-%COMP%] .toggle-wrapper[_ngcontent-%COMP%] .icon-background[_ngcontent-%COMP%] .icon.block[_ngcontent-%COMP%]{width:1.125rem}[_nghost-%COMP%] .toggle-div[_ngcontent-%COMP%] .toggle-wrapper[_ngcontent-%COMP%] .icon-background[_ngcontent-%COMP%] .icon.hidden[_ngcontent-%COMP%]{opacity:0}[_nghost-%COMP%] .toggle-div[_ngcontent-%COMP%] .toggle-wrapper[_ngcontent-%COMP%] .toggle-label[_ngcontent-%COMP%]{font-weight:bold;margin-left:.5rem;padding-right:1.25rem;padding-left:.25rem}"],changeDetection:0}),n})();const wke=["fileInput"];let Eke=(()=>{class n{constructor(t){this.ga=t,this.clsName="ccf-json-file-reader",this.label="Upload",this.parsedJson=new Le}triggerFileInput(){this.fileInput.nativeElement.click()}handleFile(t){const i=t.target;if(!i.files)return;const r=i.files[0],s=new FileReader;s.onload=()=>{const o=JSON.parse(s.result);this.ga.event("json_file_load_end","json_file_reader"),this.parsedJson.emit(o)},this.ga.event("json_file_load_start","json_file_reader"),s.readAsText(r)}}return n.\u0275fac=function(t){return new(t||n)(E(xs))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-json-file-reader"]],viewQuery:function(t,i){if(1&t&&Jn(wke,5),2&t){let r;_t(r=yt())&&(i.fileInput=r.first)}},hostVars:2,hostBindings:function(t,i){2&t&&Rn(i.clsName)},inputs:{label:"label"},outputs:{parsedJson:"parsedJson"},decls:4,vars:1,consts:[["mat-button","",1,"upload-button",3,"click"],["type","file","accept","application/JSON","name","fileInput","id","fileInput",2,"display","none",3,"change"],["fileInput",""]],template:function(t,i){1&t&&(R(0,"button",0),ge("click",function(){return i.triggerFileInput()}),De(1),k(),R(2,"input",1,2),ge("change",function(s){return i.handleFile(s)}),k()),2&t&&(G(1),xi(i.label))},directives:[lh],styles:["[_nghost-%COMP%] .upload-button[_ngcontent-%COMP%]{width:100%;height:2.25rem;transition:.6s;cursor:pointer;font-weight:500}"]}),n})(),Ske=(()=>{class n{constructor(){this.clsName="ccf-details-label",this.details=[]}arrayToString(t){return t.join(", ")}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=Ne({type:n,selectors:[["ccf-details-label"]],hostVars:2,hostBindings:function(t,i){2&t&&Rn(i.clsName)},inputs:{details:"details"},decls:1,vars:1,template:function(t,i){1&t&&De(0),2&t&&xi(i.arrayToString(i.details))},styles:["[_nghost-%COMP%]{display:block;height:2.25rem}"],changeDetection:0}),n})();const Mke=["trigger"],xke=["panel"];function Tke(n,e){if(1&n&&(R(0,"span",8),De(1),k()),2&n){const t=Qe();G(1),xi(t.placeholder)}}function Ake(n,e){if(1&n&&(R(0,"span",12),De(1),k()),2&n){const t=Qe(2);G(1),xi(t.triggerValue)}}function Dke(n,e){1&n&&Ht(0,0,["*ngSwitchCase","true"])}function Oke(n,e){1&n&&(R(0,"span",9),mt(1,Ake,2,1,"span",10),mt(2,Dke,1,0,"ng-content",11),k()),2&n&&(ie("ngSwitch",!!Qe().customTrigger),G(2),ie("ngSwitchCase",!0))}function Ike(n,e){if(1&n){const t=Zi();R(0,"div",13),R(1,"div",14,15),ge("@transformPanel.done",function(r){return en(t),Qe()._panelDoneAnimatingStream.next(r.toState)})("keydown",function(r){return en(t),Qe()._handleKeydown(r)}),Ht(3,1),k(),k()}if(2&n){const t=Qe();ie("@transformPanelWrap",void 0),G(1),function(n,e,t){Gl(yo,Vc,Cg(Oe(),n,e,t),!0)}("mat-select-panel ",t._getPanelTheme(),""),vf("transform-origin",t._transformOrigin)("font-size",t._triggerFontSize,"px"),ie("ngClass",t.panelClass)("@transformPanel",t.multiple?"showing-multiple":"showing"),nn("id",t.id+"-panel")("aria-multiselectable",t.multiple)("aria-label",t.ariaLabel||null)("aria-labelledby",t._getPanelAriaLabelledby())}}const Pke=[[["mat-select-trigger"]],"*"],Rke=["mat-select-trigger","*"],U9={transformPanelWrap:tc("transformPanelWrap",[Qs("* => void",Uie("@transformPanel",[jie()],{optional:!0}))]),transformPanel:tc("transformPanel",[wr("void",ti({transform:"scaleY(0.8)",minWidth:"100%",opacity:0})),wr("showing",ti({opacity:1,minWidth:"calc(100% + 32px)",transform:"scaleY(1)"})),wr("showing-multiple",ti({opacity:1,minWidth:"calc(100% + 64px)",transform:"scaleY(1)"})),Qs("void => *",Ao("120ms cubic-bezier(0, 0, 0.2, 1)")),Qs("* => void",Ao("100ms 25ms linear",ti({opacity:0})))])};let H9=0;const G9=new ve("mat-select-scroll-strategy"),Lke=new ve("MAT_SELECT_CONFIG"),Bke={provide:G9,deps:[Jo],useFactory:function(n){return()=>n.scrollStrategies.reposition()}};class Vke{constructor(e,t){this.source=e,this.value=t}}const zke=nc(Hf(jf(FO(class{constructor(n,e,t,i,r){this._elementRef=n,this._defaultErrorStateMatcher=e,this._parentForm=t,this._parentFormGroup=i,this.ngControl=r}})))),W9=new ve("MatSelectTrigger");let jke=(()=>{class n extends zke{constructor(t,i,r,s,o,a,l,c,d,f,p,g,_,y){var v,C,w;super(o,s,l,c,f),this._viewportRuler=t,this._changeDetectorRef=i,this._ngZone=r,this._dir=a,this._parentFormField=d,this._liveAnnouncer=_,this._defaultOptions=y,this._panelOpen=!1,this._compareWith=(x,N)=>x===N,this._uid="mat-select-"+H9++,this._triggerAriaLabelledBy=null,this._destroy=new Se,this._onChange=()=>{},this._onTouched=()=>{},this._valueId="mat-select-value-"+H9++,this._panelDoneAnimatingStream=new Se,this._overlayPanelClass=(null===(v=this._defaultOptions)||void 0===v?void 0:v.overlayPanelClass)||"",this._focused=!1,this.controlType="mat-select",this._required=!1,this._multiple=!1,this._disableOptionCentering=null!==(w=null===(C=this._defaultOptions)||void 0===C?void 0:C.disableOptionCentering)&&void 0!==w&&w,this.ariaLabel="",this.optionSelectionChanges=Yb(()=>{const x=this.options;return x?x.changes.pipe(Rr(x),Pr(()=>Ni(...x.map(N=>N.onSelectionChange)))):this._ngZone.onStable.pipe(yi(1),Pr(()=>this.optionSelectionChanges))}),this.openedChange=new Le,this._openedStream=this.openedChange.pipe(Fn(x=>x),Ae(()=>{})),this._closedStream=this.openedChange.pipe(Fn(x=>!x),Ae(()=>{})),this.selectionChange=new Le,this.valueChange=new Le,this.ngControl&&(this.ngControl.valueAccessor=this),null!=(null==y?void 0:y.typeaheadDebounceInterval)&&(this._typeaheadDebounceInterval=y.typeaheadDebounceInterval),this._scrollStrategyFactory=g,this._scrollStrategy=this._scrollStrategyFactory(),this.tabIndex=parseInt(p)||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=Mt(t),this.stateChanges.next()}get multiple(){return this._multiple}set multiple(t){this._multiple=Mt(t)}get disableOptionCentering(){return this._disableOptionCentering}set disableOptionCentering(t){this._disableOptionCentering=Mt(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=To(t)}get id(){return this._id}set id(t){this._id=t||this._uid,this.stateChanges.next()}ngOnInit(){this._selectionModel=new lS(this.multiple),this.stateChanges.next(),this._panelDoneAnimatingStream.pipe(Zo(),Tn(this._destroy)).subscribe(()=>this._panelDoneAnimating(this.panelOpen))}ngAfterContentInit(){this._initKeyManager(),this._selectionModel.changed.pipe(Tn(this._destroy)).subscribe(t=>{t.added.forEach(i=>i.select()),t.removed.forEach(i=>i.deselect())}),this.options.changes.pipe(Rr(null),Tn(this._destroy)).subscribe(()=>{this._resetOptions(),this._initializeSelection()})}ngDoCheck(){const t=this._getTriggerAriaLabelledby();if(t!==this._triggerAriaLabelledBy){const i=this._elementRef.nativeElement;this._triggerAriaLabelledBy=t,t?i.setAttribute("aria-labelledby",t):i.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(i=>i.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 i=t.keyCode,r=40===i||38===i||37===i||39===i,s=13===i||32===i,o=this._keyManager;if(!o.isTyping()&&s&&!Zs(t)||(this.multiple||t.altKey)&&r)t.preventDefault(),this.open();else if(!this.multiple){const a=this.selected;o.onKeydown(t);const l=this.selected;l&&a!==l&&this._liveAnnouncer.announce(l.viewValue,1e4)}}_handleOpenKeydown(t){const i=this._keyManager,r=t.keyCode,s=40===r||38===r,o=i.isTyping();if(s&&t.altKey)t.preventDefault(),this.close();else if(o||13!==r&&32!==r||!i.activeItem||Zs(t))if(!o&&this._multiple&&65===r&&t.ctrlKey){t.preventDefault();const a=this.options.some(l=>!l.disabled&&!l.selected);this.options.forEach(l=>{l.disabled||(a?l.select():l.deselect())})}else{const a=i.activeItemIndex;i.onKeydown(t),this._multiple&&s&&t.shiftKey&&i.activeItem&&i.activeItemIndex!==a&&i.activeItem._selectViaInteraction()}else t.preventDefault(),i.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(yi(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(i=>i.setInactiveStyles()),this._selectionModel.clear(),this.multiple&&t)Array.isArray(t),t.forEach(i=>this._selectValue(i)),this._sortValues();else{const i=this._selectValue(t);i?this._keyManager.updateActiveItem(i):this.panelOpen||this._keyManager.updateActiveItem(-1)}this._changeDetectorRef.markForCheck()}_selectValue(t){const i=this.options.find(r=>{if(this._selectionModel.isSelected(r))return!1;try{return null!=r.value&&this._compareWith(r.value,t)}catch(s){return!1}});return i&&this._selectionModel.select(i),i}_initKeyManager(){this._keyManager=new kV(this.options).withTypeAhead(this._typeaheadDebounceInterval).withVerticalOrientation().withHorizontalOrientation(this._isRtl()?"rtl":"ltr").withHomeAndEnd().withAllowedModifierKeys(["shiftKey"]),this._keyManager.tabOut.pipe(Tn(this._destroy)).subscribe(()=>{this.panelOpen&&(!this.multiple&&this._keyManager.activeItem&&this._keyManager.activeItem._selectViaInteraction(),this.focus(),this.close())}),this._keyManager.change.pipe(Tn(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=Ni(this.options.changes,this._destroy);this.optionSelectionChanges.pipe(Tn(t)).subscribe(i=>{this._onSelect(i.source,i.isUserInput),i.isUserInput&&!this.multiple&&this._panelOpen&&(this.close(),this.focus())}),Ni(...this.options.map(i=>i._stateChanges)).pipe(Tn(t)).subscribe(()=>{this._changeDetectorRef.markForCheck(),this.stateChanges.next()})}_onSelect(t,i){const r=this._selectionModel.isSelected(t);null!=t.value||this._multiple?(r!==t.selected&&(t.selected?this._selectionModel.select(t):this._selectionModel.deselect(t)),i&&this._keyManager.setActiveItem(t),this.multiple&&(this._sortValues(),i&&this.focus())):(t.deselect(),this._selectionModel.clear(),null!=this.value&&this._propagateChanges(t.value)),r!==this._selectionModel.isSelected(t)&&this._propagateChanges(),this.stateChanges.next()}_sortValues(){if(this.multiple){const t=this.options.toArray();this._selectionModel.sort((i,r)=>this.sortComparator?this.sortComparator(i,r,t):t.indexOf(i)-t.indexOf(r)),this.stateChanges.next()}}_propagateChanges(t){let i=null;i=this.multiple?this.selected.map(r=>r.value):this.selected?this.selected.value:t,this._value=i,this.valueChange.emit(i),this._onChange(i),this.selectionChange.emit(this._getChangeEvent(i)),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 i=null===(t=this._parentFormField)||void 0===t?void 0:t.getLabelId();return this.ariaLabelledby?(i?i+" ":"")+this.ariaLabelledby:i}_getAriaActiveDescendant(){return this.panelOpen&&this._keyManager&&this._keyManager.activeItem?this._keyManager.activeItem.id:null}_getTriggerAriaLabelledby(){var t;if(this.ariaLabel)return null;const i=null===(t=this._parentFormField)||void 0===t?void 0:t.getLabelId();let r=(i?i+" ":"")+this._valueId;return this.ariaLabelledby&&(r+=" "+this.ariaLabelledby),r}_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 n.\u0275fac=function(t){return new(t||n)(E(Yf),E(kn),E(dt),E(Vv),E(rt),E(Qo,8),E(mp,8),E(Zm,8),E(nS,8),E(uc,10),Zr("tabindex"),E(G9),E(DE),E(Lke,8))},n.\u0275dir=oe({type:n,viewQuery:function(t,i){if(1&t&&(Jn(Mke,5),Jn(xke,5),Jn(sU,5)),2&t){let r;_t(r=yt())&&(i.trigger=r.first),_t(r=yt())&&(i.panel=r.first),_t(r=yt())&&(i._overlayDir=r.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:[ct,zn]}),n})(),Uke=(()=>{class n extends jke{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,i,r){const s=this._getItemHeight();return Math.min(Math.max(0,s*t-i+s/2),r)}ngOnInit(){super.ngOnInit(),this._viewportRuler.change().pipe(Tn(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(yi(1)).subscribe(()=>{this._triggerFontSize&&this._overlayDir.overlayRef&&this._overlayDir.overlayRef.overlayElement&&(this._overlayDir.overlayRef.overlayElement.style.fontSize=`${this._triggerFontSize}px`)}))}_scrollOptionIntoView(t){const i=BO(t,this.options,this.optionGroups),r=this._getItemHeight();this.panel.nativeElement.scrollTop=0===t&&1===i?0:function(n,e,t,i){return nt+i?Math.max(0,n-i+e):t}((t+i)*r,r,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 Vke(this,t)}_calculateOverlayOffsetX(){const t=this._overlayDir.overlayRef.overlayElement.getBoundingClientRect(),i=this._viewportRuler.getViewportSize(),r=this._isRtl(),s=this.multiple?56:32;let o;if(this.multiple)o=40;else if(this.disableOptionCentering)o=16;else{let c=this._selectionModel.selected[0]||this.options.first;o=c&&c.group?32:16}r||(o*=-1);const a=0-(t.left+o-(r?s:0)),l=t.right+o-i.width+(r?0:s);a>0?o+=a+8:l>0&&(o-=l+8),this._overlayDir.offsetX=Math.round(o),this._overlayDir.overlayRef.updatePosition()}_calculateOverlayOffsetY(t,i,r){const s=this._getItemHeight(),o=(s-this._triggerRect.height)/2,a=Math.floor(256/s);let l;return this.disableOptionCentering?0:(l=0===this._scrollTop?t*s:this._scrollTop===r?(t-(this._getItemCount()-a))*s+(s-(this._getItemCount()*s-256)%s):i-s/2,Math.round(-1*l-o))}_checkOverlayWithinViewport(t){const i=this._getItemHeight(),r=this._viewportRuler.getViewportSize(),s=this._triggerRect.top-8,o=r.height-this._triggerRect.bottom-8,a=Math.abs(this._offsetY),c=Math.min(this._getItemCount()*i,256)-a-this._triggerRect.height;c>o?this._adjustPanelUp(c,o):a>s?this._adjustPanelDown(a,s,t):this._transformOrigin=this._getOriginBasedOnOption()}_adjustPanelUp(t,i){const r=Math.round(t-i);this._scrollTop-=r,this._offsetY-=r,this._transformOrigin=this._getOriginBasedOnOption(),this._scrollTop<=0&&(this._scrollTop=0,this._offsetY=0,this._transformOrigin="50% bottom 0px")}_adjustPanelDown(t,i,r){const s=Math.round(t-i);if(this._scrollTop+=s,this._offsetY+=s,this._transformOrigin=this._getOriginBasedOnOption(),this._scrollTop>=r)return this._scrollTop=r,this._offsetY=0,void(this._transformOrigin="50% top 0px")}_calculateOverlayPosition(){const t=this._getItemHeight(),i=this._getItemCount(),r=Math.min(i*t,256),o=i*t-r;let a;a=this.empty?0:Math.max(this.options.toArray().indexOf(this._selectionModel.selected[0]),0),a+=BO(a,this.options,this.optionGroups);const l=r/2;this._scrollTop=this._calculateOverlayScroll(a,l,o),this._offsetY=this._calculateOverlayOffsetY(a,l,o),this._checkOverlayWithinViewport(o)}_getOriginBasedOnOption(){const t=this._getItemHeight(),i=(t-this._triggerRect.height)/2;return`50% ${Math.abs(this._offsetY)-i+t/2}px 0px`}_getItemHeight(){return 3*this._triggerFontSize}_getItemCount(){return this.options.length+this.optionGroups.length}}return n.\u0275fac=function(){let e;return function(i){return(e||(e=$n(n)))(i||n)}}(),n.\u0275cmp=Ne({type:n,selectors:[["mat-select"]],contentQueries:function(t,i,r){if(1&t&&(ei(r,W9,5),ei(r,eS,5),ei(r,JE,5)),2&t){let s;_t(s=yt())&&(i.customTrigger=s.first),_t(s=yt())&&(i.options=s),_t(s=yt())&&(i.optionGroups=s)}},hostAttrs:["role","combobox","aria-autocomplete","none","aria-haspopup","true",1,"mat-select"],hostVars:20,hostBindings:function(t,i){1&t&&ge("keydown",function(s){return i._handleKeydown(s)})("focus",function(){return i._onFocus()})("blur",function(){return i._onBlur()}),2&t&&(nn("id",i.id)("tabindex",i.tabIndex)("aria-controls",i.panelOpen?i.id+"-panel":null)("aria-expanded",i.panelOpen)("aria-label",i.ariaLabel||null)("aria-required",i.required.toString())("aria-disabled",i.disabled.toString())("aria-invalid",i.errorState)("aria-describedby",i._ariaDescribedby||null)("aria-activedescendant",i._getAriaActiveDescendant()),st("mat-select-disabled",i.disabled)("mat-select-invalid",i.errorState)("mat-select-required",i.required)("mat-select-empty",i.empty)("mat-select-multiple",i.multiple))},inputs:{disabled:"disabled",disableRipple:"disableRipple",tabIndex:"tabIndex"},exportAs:["matSelect"],features:[Dt([{provide:jv,useExisting:n},{provide:QE,useExisting:n}]),ct],ngContentSelectors:Rke,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,i){if(1&t&&(wi(Pke),R(0,"div",0,1),ge("click",function(){return i.toggle()}),R(3,"div",2),mt(4,Tke,2,1,"span",3),mt(5,Oke,3,2,"span",4),k(),R(6,"div",5),tt(7,"div",6),k(),k(),mt(8,Ike,4,14,"ng-template",7),ge("backdropClick",function(){return i.close()})("attach",function(){return i._onAttached()})("detach",function(){return i.close()})),2&t){const r=vs(1);nn("aria-owns",i.panelOpen?i.id+"-panel":null),G(3),ie("ngSwitch",i.empty),nn("id",i._valueId),G(1),ie("ngSwitchCase",!0),G(1),ie("ngSwitchCase",!1),G(3),ie("cdkConnectedOverlayPanelClass",i._overlayPanelClass)("cdkConnectedOverlayScrollStrategy",i._scrollStrategy)("cdkConnectedOverlayOrigin",r)("cdkConnectedOverlayOpen",i.panelOpen)("cdkConnectedOverlayPositions",i._positions)("cdkConnectedOverlayMinWidth",null==i._triggerRect?null:i._triggerRect.width)("cdkConnectedOverlayOffsetY",i._offsetY)}},directives:[Pae,Av,ID,sU,Z3,hE],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:[U9.transformPanelWrap,U9.transformPanel]},changeDetection:0}),n})(),q9=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({providers:[Bke],imports:[[dn,Yv,tS,On],Wv,Uv,tS,On]}),n})();function Hke(n,e){if(1&n&&(R(0,"mat-option",5),De(1),k()),2&n){const t=e.$implicit;ie("value",t),G(1),Aw(" ",t.name," (",t.sites.length,") ")}}function $ke(n,e){if(1&n){const t=Zi();R(0,"mat-form-field",1),R(1,"mat-label",2),De(2,"Landmark Set"),k(),R(3,"mat-select",3),ge("selectionChange",function(r){return en(t),Qe().extractionSetChanged(r.value)}),mt(4,Hke,2,3,"mat-option",4),k(),k()}if(2&n){const t=Qe();G(3),ie("value",t.sets[0]),G(1),ie("ngForOf",t.sets)}}let Gke=(()=>{class n{constructor(t){this.ga=t,this.clsName="ccf-extraction-set-dropdown",this.setChange=new Le}extractionSetChanged(t){this.selected=t,this.ga.event("selected_extraction_set_change","extraction_set_dropdown",t.name),this.setChange.emit(t)}isMultiple(){return this.sets.length>1}}return n.\u0275fac=function(t){return new(t||n)(E(xs))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-extraction-set-dropdown"]],hostVars:2,hostBindings:function(t,i){2&t&&Rn(i.clsName)},inputs:{sets:"sets"},outputs:{setChange:"setChange"},decls:1,vars:1,consts:[["class","dropdown-form-field","appearance","fill",4,"ngIf"],["appearance","fill",1,"dropdown-form-field"],[1,"extraction-dropdown-label"],["disableOptionCentering","true","panelClass","extraction-set-panel",3,"value","selectionChange"],["class","extraction-set-options",3,"value",4,"ngFor","ngForOf"],[1,"extraction-set-options",3,"value"]],template:function(t,i){1&t&&mt(0,$ke,5,2,"mat-form-field",0),2&t&&ie("ngIf",i.isMultiple())},directives:[zr,am,Gf,Uke,pl,eS],styles:[".extraction-set-panel{box-shadow:0 0 .3rem .1rem #9e9e9e;position:absolute;top:-1rem;left:1rem;width:10.5rem} .extraction-set-panel .extraction-set-options{height:2.5rem!important} .extraction-set-panel .extraction-set-options:first-child{margin-top:.5rem} .extraction-set-panel .extraction-set-options:last-child{margin-bottom:.5rem}[_nghost-%COMP%] .mat-form-field{width:10.5rem}[_nghost-%COMP%] .mat-form-field .mat-form-field-wrapper{padding-bottom:.5rem}[_nghost-%COMP%] .mat-form-field .mat-form-field-wrapper .mat-form-field-flex{padding:0}[_nghost-%COMP%] .mat-form-field .mat-form-field-wrapper .mat-form-field-underline{bottom:.75rem}[_nghost-%COMP%] .mat-form-field .mat-form-field-wrapper .mat-select-arrow-wrapper{transform:none} .cdk-overlay-pane{min-width:0rem!important}"],changeDetection:0}),n})();function Wke(n,e){if(1&n&&(_f(0),tt(1,"ccf-details-label",19),Kt(2,"async"),yf()),2&n){const t=Qe();G(1),ie("details",rn(2,1,t.detailsLabels$))}}function qke(n,e){if(1&n){const t=Zi();R(0,"div",9),R(1,"ccf-extraction-set-dropdown",20,21),ge("setChange",function(r){return en(t),Qe().model.setExtractionSites(r.sites)}),Kt(3,"async"),k(),R(4,"ccf-visibility-menu",22),ge("itemsChange",function(r){return en(t),Qe().model.setExtractionSites(r)})("hover",function(r){return en(t),Qe().updateExtractionSiteTooltip(r)}),Kt(5,"async"),k(),k()}if(2&n){const t=Qe();G(1),ie("sets",rn(3,2,t.model.extractionSets$)),G(3),ie("items",rn(5,4,t.model.extractionSites$))}}function Yke(n,e){if(1&n&&(R(0,"div",23),De(1),k()),2&n){const t=Qe();G(1),or(" ",t.extractionSiteTooltip," ")}}const Xke=function(){return["Male","Female"]};let Kke=(()=>{class n{constructor(t,i,r){this.page=t,this.model=i,this.registration=r,this.clsName="ccf-left-sidebar",this.disableSlider=!1,this.modalClosed=!1,this.sexByLabel$=this.model.sex$.pipe(Ae(s=>"female"===s?"Female":"Male")),this.sideByLabel$=this.model.side$.pipe(Ae(s=>"left"===s?"L":"R")),this.organSelected$=this.model.organ$.pipe(Ae(s=>void 0!==s)),this.detailsLabels$=Qi([this.model.organ$,this.model.side$,this.model.sex$]).pipe(Ae(([s,o,a])=>[null==s?void 0:s.name,o,a])),this.extractionSiteTooltip="",this.previousVisibilityItems=[...this.model.snapshot.anatomicalStructures],this.organList=qF}updateExtractionSiteTooltip(t){this.extractionSiteTooltip=(null==t?void 0:t.tooltip)?t.tooltip:""}setSexFromLabel(t){this.model.setSex("Female"===t?"female":"male")}setSideFromLabel(t){this.model.setSide("L"===t?"left":"right")}togglePreviousRegistrationBlocks(t){t&&(this.previousVisibilityItems=[...this.model.snapshot.anatomicalStructures]),this.model.toggleRegistrationBlocksVisibility(t,this.previousVisibilityItems)}updateRegistration(t){this.registration.editRegistration(t)}}return n.\u0275fac=function(t){return new(t||n)(E(ji),E(ai),E(Sr))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-left-sidebar"]],hostVars:2,hostBindings:function(t,i){2&t&&Rn(i.clsName)},inputs:{disableSlider:"disableSlider",modalClosed:"modalClosed"},decls:31,vars:22,consts:[[1,"scroll-wrapper"],[1,"container"],[4,"ngIf"],["matTooltip","Select sex to filter organs.",1,"organ-sliders"],[1,"slider-label"],[1,"toggle","gender",3,"disabled","labels","value","valueChange"],[1,"anatomical-structures-menu",3,"expanded"],[1,"expansion-header"],["matTooltip","Use opacity icons to change visibility of anatomical structures",1,"expansion-title"],[1,"expansion-content"],[3,"items","itemsChange"],[1,"extraction-menu",3,"expanded"],["matTooltip","Some organs have predefined landmarks to guide manual tissue registration--you can turn these on/off.",1,"expansion-title"],["class","expansion-content",4,"ngIf"],["toggleLabel","Previously Registered Blocks","matTooltip","If you previously registered tissue blocks, you can turn their positions on/off.",3,"visible","disabled","visibilityChanged"],[1,"space"],["class","extraction-site-tooltip mat-elevation-z8",4,"ngIf"],[1,"filler"],["label","UPLOAD PREVIOUS REGISTRATION DATA",3,"parsedJson"],[3,"details"],[3,"sets","setChange"],["dropdown",""],[3,"items","itemsChange","hover"],[1,"extraction-site-tooltip","mat-elevation-z8"]],template:function(t,i){1&t&&(R(0,"div",0),R(1,"div",1),mt(2,Wke,3,3,"ng-container",2),Kt(3,"async"),R(4,"div",3),R(5,"div",4),De(6,"Donor Sex:"),k(),R(7,"ccf-labeled-slide-toggle",5),ge("valueChange",function(s){return i.setSexFromLabel(s)}),Kt(8,"async"),k(),k(),tt(9,"mat-divider"),R(10,"mat-expansion-panel",6),R(11,"mat-expansion-panel-header",7),R(12,"mat-panel-title",8),De(13,"Anatomical Structures"),k(),k(),R(14,"div",9),R(15,"ccf-visibility-menu",10),ge("itemsChange",function(s){return i.model.setAnatomicalStructures(s)}),Kt(16,"async"),k(),k(),k(),tt(17,"mat-divider"),R(18,"mat-expansion-panel",11),R(19,"mat-expansion-panel-header",7),R(20,"mat-panel-title",12),De(21,"Landmarks"),k(),k(),mt(22,qke,6,6,"div",13),Kt(23,"async"),k(),tt(24,"mat-divider"),R(25,"ccf-visibility-toggle",14),ge("visibilityChanged",function(s){return i.togglePreviousRegistrationBlocks(s)}),Kt(26,"async"),k(),tt(27,"div",15),mt(28,Yke,2,1,"div",16),tt(29,"div",17),R(30,"ccf-json-file-reader",18),ge("parsedJson",function(s){return i.updateRegistration(s)}),k(),k(),k()),2&t&&(G(2),ie("ngIf",rn(3,11,i.page.registrationCallbackSet$)),G(5),ie("disabled",i.disableSlider)("labels",fv(21,Xke))("value",rn(8,13,i.sexByLabel$)),G(3),ie("expanded",i.modalClosed),G(5),ie("items",rn(16,15,i.model.anatomicalStructures$)),G(3),ie("expanded",i.modalClosed),G(4),ie("ngIf",rn(23,17,i.organSelected$)),G(3),ie("visible",rn(26,19,i.model.showPrevious$))("disabled",i.disableSlider),G(3),ie("ngIf",i.extractionSiteTooltip.length>0))},directives:[zr,dc,XF,n9,qM,YM,EW,cke,Cke,Eke,Ske,Gke],pipes:[Hc],styles:["[_nghost-%COMP%]{display:block;height:calc(100% - 3rem);margin-top:1.5rem;margin-bottom:1.5rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%]{overflow-y:scroll;height:100%;margin-right:.375rem;scrollbar-width:thin}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%]::-webkit-scrollbar{width:.75rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%]{display:flex;flex-direction:column;margin-left:1.5rem;margin-right:.375rem;min-height:100%}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .space[_ngcontent-%COMP%]{height:3rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] mat-divider[_ngcontent-%COMP%]{border-top-width:3px}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .ccf-organ-selector[_ngcontent-%COMP%]{margin-top:1.5rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .organ-sliders[_ngcontent-%COMP%]{display:flex;height:3rem;align-items:center}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .organ-sliders[_ngcontent-%COMP%] .slider-label[_ngcontent-%COMP%]{font-weight:600}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] mat-expansion-panel[_ngcontent-%COMP%]{box-shadow:none}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] mat-expansion-panel[_ngcontent-%COMP%] mat-expansion-panel-header[_ngcontent-%COMP%] .expansion-title[_ngcontent-%COMP%]{font-size:1rem;font-weight:600}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .mat-expansion-panel-body{padding:0}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .extraction-menu[_ngcontent-%COMP%] .expansion-header, [_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .anatomical-structures-menu[_ngcontent-%COMP%] .expansion-header{-webkit-user-select:none;-moz-user-select:none;padding:0;font-weight:bold;height:3rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .extraction-menu[_ngcontent-%COMP%] .expansion-header .mat-expansion-indicator, [_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .anatomical-structures-menu[_ngcontent-%COMP%] .expansion-header .mat-expansion-indicator{display:flex;align-items:center;justify-content:center;height:24px;width:24px}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .extraction-menu[_ngcontent-%COMP%] .expansion-content[_ngcontent-%COMP%], [_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .anatomical-structures-menu[_ngcontent-%COMP%] .expansion-content[_ngcontent-%COMP%]{margin-bottom:.75rem;text-align:center;margin-top:2.25rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .extraction-menu[_ngcontent-%COMP%] .expansion-content[_ngcontent-%COMP%] .expansion-placeholder[_ngcontent-%COMP%], [_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .anatomical-structures-menu[_ngcontent-%COMP%] .expansion-content[_ngcontent-%COMP%] .expansion-placeholder[_ngcontent-%COMP%]{width:100%;font-size:.9rem;font-weight:400}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .extraction-site-tooltip[_ngcontent-%COMP%]{position:absolute;top:4rem;left:27rem;width:21rem;padding:1rem;border-radius:.5rem;border:1px solid;z-index:2}[_nghost-%COMP%] .filler[_ngcontent-%COMP%]{flex-grow:1}"],changeDetection:0}),n})(),Zke=(()=>{class n{constructor(t,i,r){this.drawer=t,this.cdr=r,this.className="ccf-drawer-toggle-button",this.position="start",this.opened=!1,this.subscriptions=new Te;const s=i.connect(this);this.subscriptions.add(s.getMessagesFromSource(t).subscribe(o=>{this.handleMessage(o)&&r.markForCheck()}))}get classEnd(){return"end"===this.position}get icon(){let t="arrow_right",i="arrow_left";return"end"===this.position&&([t,i]=[i,t]),this.opened?i: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:i,expanded:r}=t;i?r?t.closeExpanded():t.close():t.open()}}return n.\u0275fac=function(t){return new(t||n)(E(ZF),E(_0),E(kn))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-drawer-toggle-button"]],hostVars:4,hostBindings:function(t,i){2&t&&(Rn(i.className),st("ccf-drawer-toggle-button-end",i.classEnd))},decls:4,vars:4,consts:[["aria-hidden","false","aria-label","Close side drawer",1,"expand-collapse-icon",3,"click"]],template:function(t,i){1&t&&(R(0,"mat-icon",0),ge("click",function(){return i.toggle()}),De(1," arrow_right\n"),k(),R(2,"mat-icon",0),ge("click",function(){return i.toggle()}),De(3," arrow_left\n"),k()),2&t&&(st("hidden","arrow_left"===i.icon),G(2),st("hidden","arrow_right"===i.icon))},directives:[rs],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;transition:.25s}.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:absolute;right:0rem;transition:.6s;padding-left:.15rem}[_nghost-%COMP%] .expand-collapse-icon.hidden[_ngcontent-%COMP%]{opacity:0}.ccf-drawer-toggle-button-end[_nghost-%COMP%] .expand-collapse-icon[_ngcontent-%COMP%]{right:unset;left:-.25rem}.mat-icon[_ngcontent-%COMP%]{right:.3rem;top:.675rem;padding-top:.05rem}"],changeDetection:0}),n})();const Y9={x:10,y:10,z:10};let Qke=(()=>{class n{constructor(t){this.ga=t,this.clsName="ccf-block-size-input",this.blockSize=Y9,this.blockSizeChange=new Le}updateBlockSizes(t,i){const r=t.target;this.blockSize=Object.assign(Object.assign({},this.blockSize),{[i]:+r.value}),this.ga.event("block_size_change","block_size_input",i,this.blockSize[i]),this.blockSizeChange.emit(this.blockSize)}refreshBlockSize(){this.blockSize=Y9,this.ga.event("block_size_reset","block_size_input"),this.blockSizeChange.emit(this.blockSize)}}return n.\u0275fac=function(t){return new(t||n)(E(xs))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-block-size-input"]],hostVars:2,hostBindings:function(t,i){2&t&&Rn(i.clsName)},inputs:{blockSize:"blockSize"},outputs:{blockSizeChange:"blockSizeChange"},decls:19,vars:5,consts:[["matTooltip","Set the tissue block width, height and depth (dimensions)",1,"header"],[1,"text","title"],[1,"filler"],["matRipple","",1,"icon","refresh",3,"matRippleCentered","matRippleUnbounded","click"],[1,"size-inputs"],["floatLabel","always",1,"field"],[1,"text","label"],["matInput","","type","number","placeholder","","matTooltip","Enter tissue block width.",1,"input",3,"value","input"],["matInput","","type","number","placeholder","","matTooltip","Enter tissue block height.",1,"input",3,"value","input"],["matInput","","type","number","placeholder","","matTooltip","Enter tissue block depth.",1,"input",3,"value","input"]],template:function(t,i){1&t&&(R(0,"div",0),R(1,"span",1),De(2,"Tissue Block Dimensions (mm)"),k(),tt(3,"div",2),R(4,"mat-icon",3),ge("click",function(){return i.refreshBlockSize()}),De(5,"refresh"),k(),k(),R(6,"div",4),R(7,"mat-form-field",5),R(8,"mat-label",6),De(9,"Width (X)"),k(),R(10,"input",7),ge("input",function(s){return i.updateBlockSizes(s,"x")}),k(),k(),R(11,"mat-form-field",5),R(12,"mat-label",6),De(13,"Height (Y)"),k(),R(14,"input",8),ge("input",function(s){return i.updateBlockSizes(s,"y")}),k(),k(),R(15,"mat-form-field",5),R(16,"mat-label",6),De(17,"Depth (Z)"),k(),R(18,"input",9),ge("input",function(s){return i.updateBlockSizes(s,"z")}),k(),k(),k()),2&t&&(G(4),ie("matRippleCentered",!0)("matRippleUnbounded",!0),G(6),ie("value",i.blockSize.x),G(4),ie("value",i.blockSize.y),G(4),ie("value",i.blockSize.z))},directives:[dc,rs,Js,am,Gf,Xb],styles:["[_nghost-%COMP%] input[type=number][_ngcontent-%COMP%]{-moz-appearance:textfield}[_nghost-%COMP%] .header[_ngcontent-%COMP%]{display:flex;height:1.5rem;align-items:center}[_nghost-%COMP%] .header[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-weight:600}[_nghost-%COMP%] .header[_ngcontent-%COMP%] .refresh[_ngcontent-%COMP%]{transform:scaleX(-1);cursor:pointer;transition:.6s}[_nghost-%COMP%] .header[_ngcontent-%COMP%] .refresh[_ngcontent-%COMP%]:hover{border-radius:2px}[_nghost-%COMP%] .size-inputs[_ngcontent-%COMP%]{display:flex}[_nghost-%COMP%] .size-inputs[_ngcontent-%COMP%] .field[_ngcontent-%COMP%]{width:33.33%}[_nghost-%COMP%] .size-inputs[_ngcontent-%COMP%] .field[_ngcontent-%COMP%]:not(:last-child){padding-right:.75rem}[_nghost-%COMP%] .size-inputs[_ngcontent-%COMP%] .field[_ngcontent-%COMP%] .input[_ngcontent-%COMP%]{text-align:center}[_nghost-%COMP%] .filler[_ngcontent-%COMP%]{flex-grow:1}"],changeDetection:0}),n})();const X9={thickness:NaN,numSlices:NaN};let Jke=(()=>{class n{constructor(t){this.ga=t,this.clsName="ccf-slices-input",this.slicesConfig=X9,this.slicesConfigChange=new Le}get hasThicknessValue(){return!isNaN(this.slicesConfig.thickness)}updateSlicesData(t,i){const{value:r}=t.target;this.slicesConfig=Object.assign(Object.assign({},this.slicesConfig),{[i]:""!==r?+r:NaN}),this.ga.event("slice_config_update","slice_input",i,this.slicesConfig[i]),this.slicesConfigChange.emit(this.slicesConfig)}refreshSlices(){this.slicesConfig=X9,this.ga.event("slice_config_reset","slice_input"),this.slicesConfigChange.emit(this.slicesConfig)}}return n.\u0275fac=function(t){return new(t||n)(E(xs))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-slices-input"]],hostVars:2,hostBindings:function(t,i){2&t&&Rn(i.clsName)},inputs:{slicesConfig:"slicesConfig"},outputs:{slicesConfigChange:"slicesConfigChange"},decls:17,vars:6,consts:[[1,"header"],["matTooltip","\u201cAdd thickness of tissue sections and the total number of sections",1,"text","title"],[1,"filler"],["matRipple","",1,"icon","refresh",3,"matRippleCentered","matRippleUnbounded","click"],[1,"slices-inputs"],[1,"field"],[1,"text","label"],["matInput","","ccfNumbersOnly","","type","number","matTooltip","Enter thickness of tissue sections",1,"input",3,"value","input"],["matSuffix","",1,"suffix"],["matInput","","ccfNumbersOnly","","type","number","matTooltip","Enter total number of sections",1,"input",3,"value","input"]],template:function(t,i){1&t&&(R(0,"div",0),R(1,"span",1),De(2,"Tissue Sections"),k(),tt(3,"div",2),R(4,"mat-icon",3),ge("click",function(){return i.refreshSlices()}),De(5," refresh "),k(),k(),R(6,"div",4),R(7,"mat-form-field",5),R(8,"mat-label",6),De(9,"Thickness"),k(),R(10,"input",7),ge("input",function(s){return i.updateSlicesData(s,"thickness")}),k(),R(11,"div",8),De(12,"\u03bcm"),k(),k(),R(13,"mat-form-field",5),R(14,"mat-label",6),De(15,"# Sections"),k(),R(16,"input",9),ge("input",function(s){return i.updateSlicesData(s,"numSlices")}),k(),k(),k()),2&t&&(G(4),ie("matRippleCentered",!0)("matRippleUnbounded",!0),G(6),ie("value",i.slicesConfig.thickness),G(1),st("show",i.hasThicknessValue),G(5),ie("value",i.slicesConfig.numSlices))},directives:[dc,rs,Js,am,Gf,Xb,WPe,VO],styles:["[_nghost-%COMP%] input[type=number][_ngcontent-%COMP%]{-moz-appearance:textfield}[_nghost-%COMP%] .header[_ngcontent-%COMP%]{display:flex;align-items:center;height:1.5rem}[_nghost-%COMP%] .header[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-weight:600}[_nghost-%COMP%] .header[_ngcontent-%COMP%] .refresh[_ngcontent-%COMP%]{transform:scaleX(-1);cursor:pointer;transition:.6s}[_nghost-%COMP%] .header[_ngcontent-%COMP%] .refresh[_ngcontent-%COMP%]:hover{border-radius:2px}[_nghost-%COMP%] .slices-inputs[_ngcontent-%COMP%]{display:flex}[_nghost-%COMP%] .slices-inputs[_ngcontent-%COMP%] .field[_ngcontent-%COMP%]{width:33.33%}[_nghost-%COMP%] .slices-inputs[_ngcontent-%COMP%] .field[_ngcontent-%COMP%]:not(:last-child){padding-right:.75rem}[_nghost-%COMP%] .slices-inputs[_ngcontent-%COMP%] .field[_ngcontent-%COMP%] .input[_ngcontent-%COMP%]{text-align:center}[_nghost-%COMP%] .slices-inputs[_ngcontent-%COMP%] .field[_ngcontent-%COMP%] .suffix[_ngcontent-%COMP%]{display:none}[_nghost-%COMP%] .slices-inputs[_ngcontent-%COMP%] .field.mat-focused[_ngcontent-%COMP%] .suffix[_ngcontent-%COMP%], [_nghost-%COMP%] .slices-inputs[_ngcontent-%COMP%] .field[_ngcontent-%COMP%] .suffix.show[_ngcontent-%COMP%]{display:initial}[_nghost-%COMP%] .filler[_ngcontent-%COMP%]{flex-grow:1}"],changeDetection:0}),n})();const K9={x:0,y:0,z:0};let eFe=(()=>{class n{constructor(t){this.ga=t,this.clsName="ccf-rotation-slider",this.rotation=K9,this.rotationChange=new Le}changeRotation(t,i){this.rotation=Object.assign(Object.assign({},this.rotation),{[i]:+t}),this.ga.event("rotation_update","rotation_slider",i,+t),this.rotationChange.emit(this.rotation)}resetRotation(){this.rotation=K9,this.ga.event("rotation_reset","rotation_slider"),this.rotationChange.emit(this.rotation)}}return n.\u0275fac=function(t){return new(t||n)(E(xs))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-rotation-slider"]],hostVars:2,hostBindings:function(t,i){2&t&&Rn(i.clsName)},inputs:{rotation:"rotation"},outputs:{rotationChange:"rotationChange"},decls:27,vars:23,consts:[[1,"header"],["matTooltip","Use sliders below to rotate tissue block for registration",1,"text","title"],[1,"filler"],["matRipple","",1,"icon","reset",3,"matRippleCentered","matRippleUnbounded","click"],[1,"slider-box","red"],[1,"text","label"],[1,"slider-container"],[1,"slider",3,"max","min","step","thumbLabel","tickInterval","value","input"],[1,"text","value"],[1,"slider-box","green"],[1,"slider-box","blue"]],template:function(t,i){1&t&&(R(0,"div",0),R(1,"span",1),De(2,"Tissue Block Rotation"),k(),tt(3,"div",2),R(4,"mat-icon",3),ge("click",function(){return i.resetRotation()}),De(5,"refresh"),k(),k(),R(6,"div",4),R(7,"span",5),De(8,"X"),k(),R(9,"div",6),R(10,"mat-slider",7),ge("input",function(s){return i.changeRotation(s.value,"x")}),k(),k(),R(11,"span",8),De(12),k(),k(),R(13,"div",9),R(14,"span",5),De(15,"Y"),k(),R(16,"div",6),R(17,"mat-slider",7),ge("input",function(s){return i.changeRotation(s.value,"y")}),k(),k(),R(18,"span",8),De(19),k(),k(),R(20,"div",10),R(21,"span",5),De(22,"Z"),k(),R(23,"div",6),R(24,"mat-slider",7),ge("input",function(s){return i.changeRotation(s.value,"z")}),k(),k(),R(25,"span",8),De(26),k(),k()),2&t&&(G(4),ie("matRippleCentered",!0)("matRippleUnbounded",!0),G(6),ie("max",180)("min",-180)("step",1)("thumbLabel",!0)("tickInterval",180)("value",i.rotation.x),G(2),xi(i.rotation.x),G(5),ie("max",180)("min",-180)("step",1)("thumbLabel",!0)("tickInterval",180)("value",i.rotation.y),G(2),xi(i.rotation.y),G(5),ie("max",180)("min",-180)("step",1)("thumbLabel",!0)("tickInterval",180)("value",i.rotation.z),G(2),xi(i.rotation.z))},directives:[dc,rs,Js,jk],styles:["[_nghost-%COMP%] .header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;height:1.5rem}[_nghost-%COMP%] .header[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-weight:600}[_nghost-%COMP%] .header[_ngcontent-%COMP%] .reset[_ngcontent-%COMP%]{transform:scaleX(-1);cursor:pointer;transition:.6s}[_nghost-%COMP%] .header[_ngcontent-%COMP%] .reset[_ngcontent-%COMP%]:hover{border-radius:2px}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;height:4rem;padding-left:.5rem}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{width:1rem}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .value[_ngcontent-%COMP%]{width:2.75rem;text-align:center}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .slider-container[_ngcontent-%COMP%]{width:100%;padding:1rem 2rem}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .slider-container[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%]{width:100%}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .slider-container[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%]:not(.cdk-focused) .mat-slider-thumb{width:1.25rem;height:1.25rem;transform:none}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .slider-container[_ngcontent-%COMP%] .mat-slider-horizontal .mat-slider-wrapper{right:.625rem}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .slider-container[_ngcontent-%COMP%] .mat-slider-horizontal .mat-slider-wrapper:after{margin-top:-.25rem;height:.625rem!important}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .slider-container[_ngcontent-%COMP%] .mat-slider-horizontal .mat-slider-ticks-container{margin-top:-.25rem;height:.625rem}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .slider-container[_ngcontent-%COMP%] .mat-slider-horizontal .mat-slider-ticks-container .mat-slider-ticks{height:.625rem}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .filler[_ngcontent-%COMP%]{flex-grow:1}"],changeDetection:0}),n})();function nFe(n){const{subscriber:e,counter:t,period:i}=n;e.next(t),this.schedule({subscriber:e,counter:t+1,period:i},i)}const iFe=["closeSearch"];function rFe(n,e){if(1&n){const t=Zi();R(0,"div",12),R(1,"mat-checkbox",13),ge("ngModelChange",function(r){const o=en(t).$implicit;return Qe(2).checkedResults[o.id]=r}),De(2),k(),k()}if(2&n){const t=e.$implicit,i=Qe(2);G(1),ie("ngModel",i.checkedResults[t.id]),G(1),or(" ",t.label," ")}}function sFe(n,e){if(1&n&&(R(0,"div",9),mt(1,rFe,3,2,"div",10),R(2,"div",11),De(3),Kt(4,"i18nPlural"),k(),k()),2&n){const t=Qe();G(1),ie("ngForOf",t.searchResults.results)("ngForTrackBy",t.tagId),G(2),or(" ",gv(4,3,t.searchResults.totalCount,t.countMapping)," ")}}const Z9=5,Ex={totalCount:0,results:[]};class Ep{constructor(e,t,i){this.el=e,this.ga=t,this.clsName="ccf-tag-search",this.placeholder="Add Anatomical Structures ...",this.added=new Le,this.countMapping={"=1":"1 result",other:"# results"},this.searchControl=new Sh,this.searchResults=Ex,this.checkedResults={},this.resultsVisible=!1,this.destroy$=new Se,this.searchControl.valueChanges.pipe(Tn(this.destroy$),function(n,e=uW){return t=>t.lift(new z1e(n,!!e.leading,!!e.trailing))}(()=>{var r;return function(n=0,e=Pf){return(!WO(n)||n<0)&&(n=0),(!e||"function"!=typeof e.schedule)&&(e=Pf),new ce(t=>(t.add(e.schedule(nFe,n,{subscriber:t,counter:0,period:n})),t))}(null!==(r=this.searchThrottle)&&void 0!==r?r:100)},{leading:!0,trailing:!0}),Pr(this.executeSearch)).subscribe(r=>{this.searchResults=r,this.checkedResults=this.getUpdatedCheckedResults(r),i.markForCheck()})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}tagId(e,t){return t.id}hasCheckedTags(){return Object.values(this.checkedResults).some(e=>e)}addTags(){const{searchControl:e,searchResults:t,checkedResults:i}=this,r=t.results.filter(s=>i[s.id]);r.length>0&&(e.reset(),this.searchResults=Ex,this.checkedResults={},this.ga.event("tags_added","tag_search",r.map(s=>s.label).join(",")),this.added.emit(r))}openResults(){this.resultsVisible||(this.resultsVisible=!0)}closeResults(e){const{closeSearch:t}=this;this.resultsVisible&&e.target instanceof Node&&(!this.el.nativeElement.contains(e.target)||t.nativeElement.contains(e.target))&&(this.resultsVisible=!1)}executeSearch(e){const{search:t,searchLimit:i=Z9}=this;return e&&t?ui(t(e,i)).pipe(Ta(()=>[Ex]),Ae(this.truncateResults)):[Ex]}truncateResults(e){const{searchLimit:t=Z9}=this,i=e.results;return i.length>t?Object.assign(Object.assign({},e),{results:i.slice(0,t)}):e}getUpdatedCheckedResults(e){const t=this.checkedResults;return e.results.reduce((i,{id:r})=>{var s;return i[r]=null!==(s=t[r])&&void 0!==s&&s,i},{})}}function aFe(n,e){if(1&n&&(R(0,"div",11),R(1,"div",12),De(2),k(),R(3,"div",13),De(4),k(),k()),2&n){const t=e.$implicit;G(2),xi(t.label),G(2),xi(t.value)}}Ep.\u0275fac=function(e){return new(e||Ep)(E(rt),E(xs),E(kn))},Ep.\u0275cmp=Ne({type:Ep,selectors:[["ccf-tag-search"]],viewQuery:function(e,t){if(1&e&&Jn(iFe,5,rt),2&e){let i;_t(i=yt())&&(t.closeSearch=i.first)}},hostVars:2,hostBindings:function(e,t){1&e&&ge("click",function(){return t.openResults()})("focusin",function(){return t.openResults()})("click",function(r){return t.closeResults(r)},!1,ly)("focusin",function(r){return t.closeResults(r)},!1,ly),2&e&&Rn(t.clsName)},inputs:{placeholder:"placeholder",search:"search",searchLimit:"searchLimit",searchThrottle:"searchThrottle"},outputs:{added:"added"},decls:10,vars:8,consts:[[1,"spacer"],["appearance","outline",1,"overlay"],[1,"search-box"],["matInput","","type","search",3,"placeholder","formControl"],["search",""],["matSuffix","",1,"add-button",3,"disabled","click"],["closeSearch",""],[1,"icon"],["class","results",4,"ngIf"],[1,"results"],["class","item",4,"ngFor","ngForOf","ngForTrackBy"],[1,"count"],[1,"item"],["labelPosition","after",3,"ngModel","ngModelChange"]],template:function(e,t){if(1&e){const i=Zi();tt(0,"div",0),R(1,"mat-form-field",1),R(2,"div",2),tt(3,"input",3,4),R(5,"button",5,6),ge("click",function(){en(i);const s=vs(4);return t.addTags(),s.focus()}),R(7,"mat-icon",7),De(8,"add"),k(),k(),k(),mt(9,sFe,5,6,"div",8),k()}2&e&&(G(1),st("expanded",t.resultsVisible),G(2),ie("placeholder",t.placeholder)("formControl",t.searchControl),G(2),st("active",t.hasCheckedTags()),ie("disabled",!t.hasCheckedTags()),G(4),ie("ngIf",t.resultsVisible))},directives:[am,Xb,Hb,vk,GM,VO,rs,zr,pl,VF,Ok],pipes:[eV],styles:["[_nghost-%COMP%]{display:block;position:relative}[_nghost-%COMP%] .spacer[_ngcontent-%COMP%]{height:3.25rem}[_nghost-%COMP%] .overlay[_ngcontent-%COMP%]{position:absolute;top:0;left:0;right:0;z-index:10}[_nghost-%COMP%] .overlay[_ngcontent-%COMP%] .search-box[_ngcontent-%COMP%]{display:flex;width:100%;align-items:center;height:3rem}[_nghost-%COMP%] .overlay[_ngcontent-%COMP%] .search-box[_ngcontent-%COMP%] .add-button[_ngcontent-%COMP%]{border-radius:.25rem;border:none;display:flex;justify-content:center;align-items:center;cursor:pointer;height:100%}[_nghost-%COMP%] .overlay[_ngcontent-%COMP%] .results[_ngcontent-%COMP%]{margin-top:.5rem}[_nghost-%COMP%] .overlay[_ngcontent-%COMP%] .results[_ngcontent-%COMP%] .count[_ngcontent-%COMP%]{margin-top:.5rem;font-size:.75rem;text-align:end}[_nghost-%COMP%] .overlay[_ngcontent-%COMP%] .mat-form-field-wrapper{padding-bottom:0;border-radius:.5rem}[_nghost-%COMP%] .overlay[_ngcontent-%COMP%] .mat-form-field-wrapper .mat-form-field-flex{padding-right:0!important}[_nghost-%COMP%] .overlay[_ngcontent-%COMP%] .mat-form-field-outline{opacity:1!important}[_nghost-%COMP%] .overlay[_ngcontent-%COMP%] .mat-form-field-outline-thick{opacity:0!important}[_nghost-%COMP%] .overlay[_ngcontent-%COMP%] .mat-form-field-infix{padding:.313rem .063rem .063rem;border:0}[_nghost-%COMP%] .overlay.expanded[_ngcontent-%COMP%] .mat-form-field-wrapper{box-shadow:0 0 .3rem .1rem #9e9e9e5e}"],changeDetection:0}),xe([lu.ak],Ep.prototype,"executeSearch",null),xe([lu.ak],Ep.prototype,"truncateResults",null);let lFe=(()=>{class n{constructor(t,i){this.dialogRef=t,this.data=i,this.clsName="ccf-review-modal",this.metaData=i.metaData,this.registrationCallbackSet=i.registrationCallbackSet}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 n.\u0275fac=function(t){return new(t||n)(E(Qm),E(Gk))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-review-modal"]],hostVars:2,hostBindings:function(t,i){2&t&&Rn(i.clsName)},decls:14,vars:2,consts:[[1,"ccf-about","wrapper"],[1,"container"],[1,"close"],[1,"material-icons","close-icon",3,"click"],[1,"content"],["mat-dialog-title","",1,"title"],[1,"mat-typography"],[1,"display-fields"],["class","field",4,"ngFor","ngForOf"],[1,"footer"],["mat-button","",1,"download-button",3,"click"],[1,"field"],[1,"label"],[1,"data"]],template:function(t,i){1&t&&(R(0,"div",0),R(1,"div",1),R(2,"div",2),R(3,"mat-icon",3),ge("click",function(){return i.close()}),De(4,"clear"),k(),k(),R(5,"div",4),R(6,"h2",5),De(7,"Registration Review"),k(),R(8,"mat-dialog-content",6),R(9,"div",7),mt(10,aFe,5,2,"div",8),k(),k(),R(11,"div",9),R(12,"button",10),ge("click",function(){return i.dialogRef.close(!0)}),De(13),k(),k(),k(),k(),k()),2&t&&(G(10),ie("ngForOf",i.metaData),G(3),xi(i.registrationCallbackSet?"REGISTER":"DOWNLOAD REGISTRATION DATA"))},directives:[rs,Wk,qk,pl,lh],styles:[".mat-dialog-container{padding:0}[_nghost-%COMP%] .ccf-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .content[_ngcontent-%COMP%]{padding:3rem;background-color:#fff}[_nghost-%COMP%] .ccf-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .content[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{text-align:center;font-size:1.5rem;margin-bottom:0}[_nghost-%COMP%] .ccf-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .content[_ngcontent-%COMP%] .mat-typography[_ngcontent-%COMP%]{justify-content:space-around;display:flex}[_nghost-%COMP%] .ccf-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .content[_ngcontent-%COMP%] .mat-typography[_ngcontent-%COMP%] .display-fields[_ngcontent-%COMP%]{margin-top:2rem;margin-bottom:2rem;width:100%}[_nghost-%COMP%] .ccf-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .content[_ngcontent-%COMP%] .mat-typography[_ngcontent-%COMP%] .display-fields[_ngcontent-%COMP%] .field[_ngcontent-%COMP%]{display:flex}[_nghost-%COMP%] .ccf-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .content[_ngcontent-%COMP%] .mat-typography[_ngcontent-%COMP%] .display-fields[_ngcontent-%COMP%] .field[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{width:50%;text-align:right;padding-right:1rem}[_nghost-%COMP%] .ccf-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .content[_ngcontent-%COMP%] .mat-typography[_ngcontent-%COMP%] .display-fields[_ngcontent-%COMP%] .field[_ngcontent-%COMP%] .data[_ngcontent-%COMP%]{width:50%;text-align:left;padding-left:1rem}[_nghost-%COMP%] .ccf-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .close[_ngcontent-%COMP%] .close-icon[_ngcontent-%COMP%]{float:right;margin-top:1rem;margin-right:1rem;cursor:pointer}[_nghost-%COMP%] .ccf-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .footer[_ngcontent-%COMP%]{padding-top:1.5rem;display:flex;justify-content:space-around}[_nghost-%COMP%] .ccf-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .footer[_ngcontent-%COMP%] .review-button[_ngcontent-%COMP%]{height:3rem;transition:.6s}"]}),n})(),cFe=(()=>{class n{constructor(t,i){this.dialog=t,this.ga=i,this.clsName="ccf-review-button",this.registrationCallbackSet=!0,this.metaData=[],this.displayErrors=!0,this.registrationIsValid=!1,this.registerData=new Le,this.enterErrorMode=new Le}ngOnChanges(){this.registrationIsValid=this.metaData.length>=3&&this.metaData.slice(0,3).every(t=>t.value)}get disabled(){return!this.registrationIsValid}registerButtonClick(t){return t&&t.preventDefault(),this.enterErrorMode.emit(),this.registrationIsValid&&(this.ga.event("review_start","review_button"),this.launchReviewModal()),!1}launchReviewModal(){this.dialog.open(lFe,{panelClass:"modal-animated",width:"60rem",data:{registrationCallbackSet:this.registrationCallbackSet,metaData:this.metaData}}).afterClosed().subscribe(i=>{i&&(this.ga.event("register","review_button"),this.registerData.emit())})}}return n.\u0275fac=function(t){return new(t||n)(E(_p),E(xs))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-review-button"]],hostVars:2,hostBindings:function(t,i){2&t&&Rn(i.clsName)},inputs:{registrationCallbackSet:"registrationCallbackSet",metaData:"metaData",displayErrors:"displayErrors",registrationIsValid:"registrationIsValid"},outputs:{registerData:"registerData",enterErrorMode:"enterErrorMode"},features:[zn],decls:2,vars:4,consts:[["mat-button","",1,"review-button",3,"matTooltip","click"]],template:function(t,i){1&t&&(R(0,"button",0),ge("click",function(s){return i.registerButtonClick(s)}),De(1),k()),2&t&&(st("disabled",i.disabled),ie("matTooltip",i.disabled?"Required: Select an organ and position tissue block inside organ.":"Review registration and submit/download."),G(1),or(" ",i.registrationCallbackSet?"REVIEW AND REGISTER":"REVIEW AND DOWNLOAD","\n"))},directives:[lh,dc],styles:[".review-button[_ngcontent-%COMP%]{width:100%;height:2.25rem;transition:.6s;font-weight:500}.review-button.disabled[_ngcontent-%COMP%]{cursor:not-allowed}"]}),n})();function uFe(n,e){if(1&n){const t=Zi();R(0,"mat-chip",2),ge("removed",function(){const s=en(t).$implicit;return Qe().removeTag(s)}),De(1),R(2,"mat-icon",3),De(3,"cancel"),k(),k()}if(2&n){const t=e.$implicit;Rn(Qe().tagClasses(t)),G(1),or(" ",t.label," ")}}let dFe=(()=>{class n{constructor(t){this.ga=t,this.clsName="ccf-tag-list",this.tagRemoved=new Le,this.tagsChange=new Le}tagId(t,i){return i.id}tagClasses(t){return"added"===t.type?["added"]:["assigned"]}removeTag(t){this.tags=this.tags.filter(i=>i!==t),this.ga.event("tag_removed","tag_list",t.label),this.tagRemoved.emit(t),this.tagsChange.emit(this.tags)}}return n.\u0275fac=function(t){return new(t||n)(E(xs))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-tag-list"]],hostVars:2,hostBindings:function(t,i){2&t&&Rn(i.clsName)},inputs:{tags:"tags"},outputs:{tagRemoved:"tagRemoved",tagsChange:"tagsChange"},decls:2,vars:2,consts:[["selectable","false"],["removable","","disableRipple","",3,"class","removed",4,"ngFor","ngForOf","ngForTrackBy"],["removable","","disableRipple","",3,"removed"],["matChipRemove","",1,"icon","remove"]],template:function(t,i){1&t&&(R(0,"mat-chip-list",0),mt(1,uFe,4,3,"mat-chip",1),k()),2&t&&(G(1),ie("ngForOf",i.tags)("ngForTrackBy",i.tagId))},directives:[z9,pl,y0,rs,B9],styles:["[_nghost-%COMP%]{display:block;overflow-x:hidden;overflow-y:auto}[_nghost-%COMP%] .mat-chip-list-wrapper{margin:0}"],changeDetection:0}),n})();function hFe(n,e){if(1&n){const t=Zi();R(0,"ccf-tag-list",20),ge("tagRemoved",function(r){return en(t),Qe().astags.removeTag(r)}),Kt(1,"async"),k()}2&n&&ie("tags",rn(1,1,Qe().astags.tags$))}function fFe(n,e){}const pFe=function(){return[]};let gFe=(()=>{class n{constructor(t,i,r,s){this.model=t,this.registration=i,this.page=r,this.astags=s,this.clsName="ccf-right-sidebar",this.modalClosed=!1}}return n.\u0275fac=function(t){return new(t||n)(E(ai),E(Sr),E(ji),E(ko))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-right-sidebar"]],hostVars:2,hostBindings:function(t,i){2&t&&Rn(i.clsName)},inputs:{modalClosed:"modalClosed"},decls:34,vars:28,consts:[[1,"scroll-wrapper"],[1,"container"],[1,"info-button-container"],["videoID","gY3_-LIoKaU","infoTitle","CCF Registration User Interface","documentationUrl","assets/docs/README.md"],[3,"blockSize","blockSizeChange"],[3,"slicesConfig","slicesConfigChange"],[3,"rotation","rotationChange"],[1,"tags-container",3,"expanded"],[1,"header"],["matTooltip","Review tags generated via collision detection. Add or delete tags as needed."],[3,"search","added"],["class","tag-list",3,"tags","tagRemoved",4,"ngIf","ngIfElse"],["tagListPlaceholder",""],[1,"legend"],[1,"dot","assigned"],[1,"text","assigned"],[1,"dot","added"],[1,"text","added"],[1,"filler"],[3,"registrationCallbackSet","displayErrors","registrationIsValid","metaData","registerData","enterErrorMode"],[1,"tag-list",3,"tags","tagRemoved"]],template:function(t,i){if(1&t&&(R(0,"div",0),R(1,"div",1),R(2,"div",2),tt(3,"ccf-info-button",3),k(),R(4,"ccf-block-size-input",4),ge("blockSizeChange",function(s){return i.model.setBlockSize(s)}),Kt(5,"async"),k(),R(6,"ccf-slices-input",5),ge("slicesConfigChange",function(s){return i.model.setSlicesConfig(s)}),Kt(7,"async"),k(),R(8,"ccf-rotation-slider",6),ge("rotationChange",function(s){return i.model.setRotation(s)}),Kt(9,"async"),k(),tt(10,"mat-divider"),R(11,"mat-expansion-panel",7),R(12,"mat-expansion-panel-header",8),R(13,"mat-panel-title",9),De(14,"Anatomical Structure Tags"),k(),k(),R(15,"ccf-tag-search",10),ge("added",function(s){return i.astags.addTags(s)}),k(),mt(16,hFe,2,3,"ccf-tag-list",11),Kt(17,"async"),mt(18,fFe,0,0,"ng-template",null,12,jw),R(20,"div",13),tt(21,"span",14),R(22,"span",15),De(23,"Assigned"),k(),tt(24,"span",16),R(25,"span",17),De(26,"Added"),k(),k(),k(),tt(27,"mat-divider"),tt(28,"div",18),R(29,"ccf-review-button",19),ge("registerData",function(){return i.registration.register()})("enterErrorMode",function(){return i.registration.setDisplayErrors(!i.registration.isValid)}),Kt(30,"async"),Kt(31,"async"),Kt(32,"async"),Kt(33,"async"),k(),k(),k()),2&t){const r=vs(19);let s,o;G(4),ie("blockSize",rn(5,11,i.model.blockSize$)),G(2),ie("slicesConfig",rn(7,13,i.model.slicesConfig$)),G(2),ie("rotation",rn(9,15,i.model.rotation$)),G(3),ie("expanded",i.modalClosed),G(4),ie("search",i.astags.searchExternal),G(1),ie("ngIf",null==(s=rn(17,17,i.model.organ$))?null:s.name)("ngIfElse",r),G(13),ie("registrationCallbackSet",rn(30,19,i.page.registrationCallbackSet$))("displayErrors",rn(31,21,i.registration.displayErrors$))("registrationIsValid",rn(32,23,i.registration.valid$))("metaData",null!==(o=rn(33,25,i.registration.metadata$))&&void 0!==o?o:fv(27,pFe))}},directives:[UPe,Qke,Jke,eFe,n9,qM,YM,EW,dc,Ep,zr,cFe,dFe],pipes:[Hc],styles:["[_nghost-%COMP%]{display:block;height:calc(100% - 3rem);margin-top:1.5rem;margin-bottom:1.5rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%]{height:100%;margin-right:.375rem;scrollbar-width:thin}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%]::-webkit-scrollbar{width:.75rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%]{display:flex;flex-direction:column;min-height:100%;margin-left:1.5rem;margin-right:.375rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .info-button-container[_ngcontent-%COMP%]{height:3.75rem;display:flex;justify-content:flex-end}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] mat-divider[_ngcontent-%COMP%]{border-top-width:3px}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] mat-expansion-panel[_ngcontent-%COMP%]{box-shadow:none}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] mat-expansion-panel[_ngcontent-%COMP%] mat-expansion-panel-header[_ngcontent-%COMP%]{padding:0 .5rem 0 0;font-weight:bold;-webkit-user-select:none;-moz-user-select:none;font-size:1rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .tags-container[_ngcontent-%COMP%]{overflow:visible}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .tags-container[_ngcontent-%COMP%] .mat-expansion-panel-body{padding-left:0;padding-right:0}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .tags-container[_ngcontent-%COMP%] .header[_ngcontent-%COMP%]{height:3rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .tags-container[_ngcontent-%COMP%] .search[_ngcontent-%COMP%]{margin-top:1rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .tags-container[_ngcontent-%COMP%] .search[_ngcontent-%COMP%] .icon.add[_ngcontent-%COMP%]{position:absolute;width:3.625rem;height:3.625rem;font-size:3.625rem;top:-1.9375rem;right:-1.1875rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .tags-container[_ngcontent-%COMP%] .tag-list[_ngcontent-%COMP%]{max-height:32rem;margin-left:-1rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .tags-container[_ngcontent-%COMP%] .tag-list-placeholder[_ngcontent-%COMP%]{display:flex;height:4rem;align-items:center;justify-content:center;font-weight:400}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .tags-container[_ngcontent-%COMP%] .legend[_ngcontent-%COMP%]{display:flex;width:100%;margin-top:1.5rem;align-items:center;font-size:.9rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .tags-container[_ngcontent-%COMP%] .legend[_ngcontent-%COMP%] .dot[_ngcontent-%COMP%]{display:inline-block;width:1rem;height:1rem;border-radius:50%}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .tags-container[_ngcontent-%COMP%] .legend[_ngcontent-%COMP%] .dot.assigned[_ngcontent-%COMP%]{margin-left:.5rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .tags-container[_ngcontent-%COMP%] .legend[_ngcontent-%COMP%] .dot.added[_ngcontent-%COMP%]{margin-left:1rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .tags-container[_ngcontent-%COMP%] .legend[_ngcontent-%COMP%] .text[_ngcontent-%COMP%]{margin-left:.5rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .filler[_ngcontent-%COMP%]{flex-grow:1}"],changeDetection:0}),n})();function Q9(n,e){return Zo((t,i)=>e?e(t[n],i[n]):t[n]===i[n])}const mFe=["input"],_Fe=function(n){return{enterDuration:n}},yFe=["*"],vFe=new ve("mat-radio-default-options",{providedIn:"root",factory:function(){return{color:"accent"}}});let J9=0;const CFe={provide:ro,useExisting:T(()=>i7),multi:!0};class e7{constructor(e,t){this.source=e,this.value=t}}const t7=new ve("MatRadioGroup");let n7=(()=>{class n{constructor(t){this._changeDetector=t,this._value=null,this._name="mat-radio-group-"+J9++,this._selected=null,this._isInitialized=!1,this._labelPosition="after",this._disabled=!1,this._required=!1,this._controlValueAccessorChangeFn=()=>{},this.onTouched=()=>{},this.change=new Le}get name(){return this._name}set name(t){this._name=t,this._updateRadioButtonNames()}get labelPosition(){return this._labelPosition}set labelPosition(t){this._labelPosition="before"===t?"before":"after",this._markRadiosForCheck()}get value(){return this._value}set value(t){this._value!==t&&(this._value=t,this._updateSelectedRadioFromValue(),this._checkSelectedRadioButton())}_checkSelectedRadioButton(){this._selected&&!this._selected.checked&&(this._selected.checked=!0)}get selected(){return this._selected}set selected(t){this._selected=t,this.value=t?t.value:null,this._checkSelectedRadioButton()}get disabled(){return this._disabled}set disabled(t){this._disabled=Mt(t),this._markRadiosForCheck()}get required(){return this._required}set required(t){this._required=Mt(t),this._markRadiosForCheck()}ngAfterContentInit(){this._isInitialized=!0}_touch(){this.onTouched&&this.onTouched()}_updateRadioButtonNames(){this._radios&&this._radios.forEach(t=>{t.name=this.name,t._markForCheck()})}_updateSelectedRadioFromValue(){this._radios&&(null===this._selected||this._selected.value!==this._value)&&(this._selected=null,this._radios.forEach(i=>{i.checked=this.value===i.value,i.checked&&(this._selected=i)}))}_emitChangeEvent(){this._isInitialized&&this.change.emit(new e7(this._selected,this._value))}_markRadiosForCheck(){this._radios&&this._radios.forEach(t=>t._markForCheck())}writeValue(t){this.value=t,this._changeDetector.markForCheck()}registerOnChange(t){this._controlValueAccessorChangeFn=t}registerOnTouched(t){this.onTouched=t}setDisabledState(t){this.disabled=t,this._changeDetector.markForCheck()}}return n.\u0275fac=function(t){return new(t||n)(E(kn))},n.\u0275dir=oe({type:n,inputs:{name:"name",labelPosition:"labelPosition",value:"value",selected:"selected",disabled:"disabled",required:"required",color:"color"},outputs:{change:"change"}}),n})(),i7=(()=>{class n extends n7{}return n.\u0275fac=function(){let e;return function(i){return(e||(e=$n(n)))(i||n)}}(),n.\u0275dir=oe({type:n,selectors:[["mat-radio-group"]],contentQueries:function(t,i,r){if(1&t&&ei(r,r7,5),2&t){let s;_t(s=yt())&&(i._radios=s)}},hostAttrs:["role","radiogroup",1,"mat-radio-group"],exportAs:["matRadioGroup"],features:[Dt([CFe,{provide:t7,useExisting:n}]),ct]}),n})();class wFe{constructor(e){this._elementRef=e}}const EFe=nc(Hf(wFe));let SFe=(()=>{class n extends EFe{constructor(t,i,r,s,o,a,l,c){super(i),this._changeDetector=r,this._focusMonitor=s,this._radioDispatcher=o,this._providerOverride=l,this._uniqueId="mat-radio-"+ ++J9,this.id=this._uniqueId,this.change=new Le,this._checked=!1,this._value=null,this._removeUniqueSelectionListener=()=>{},this.radioGroup=t,this._noopAnimations="NoopAnimations"===a,c&&(this.tabIndex=To(c,0)),this._removeUniqueSelectionListener=o.listen((d,f)=>{d!==this.id&&f===this.name&&(this.checked=!1)})}get checked(){return this._checked}set checked(t){const i=Mt(t);this._checked!==i&&(this._checked=i,i&&this.radioGroup&&this.radioGroup.value!==this.value?this.radioGroup.selected=this:!i&&this.radioGroup&&this.radioGroup.value===this.value&&(this.radioGroup.selected=null),i&&this._radioDispatcher.notify(this.id,this.name),this._changeDetector.markForCheck())}get value(){return this._value}set value(t){this._value!==t&&(this._value=t,null!==this.radioGroup&&(this.checked||(this.checked=this.radioGroup.value===t),this.checked&&(this.radioGroup.selected=this)))}get labelPosition(){return this._labelPosition||this.radioGroup&&this.radioGroup.labelPosition||"after"}set labelPosition(t){this._labelPosition=t}get disabled(){return this._disabled||null!==this.radioGroup&&this.radioGroup.disabled}set disabled(t){this._setDisabled(Mt(t))}get required(){return this._required||this.radioGroup&&this.radioGroup.required}set required(t){this._required=Mt(t)}get color(){return this._color||this.radioGroup&&this.radioGroup.color||this._providerOverride&&this._providerOverride.color||"accent"}set color(t){this._color=t}get inputId(){return`${this.id||this._uniqueId}-input`}focus(t,i){i?this._focusMonitor.focusVia(this._inputElement,i,t):this._inputElement.nativeElement.focus(t)}_markForCheck(){this._changeDetector.markForCheck()}ngOnInit(){this.radioGroup&&(this.checked=this.radioGroup.value===this._value,this.checked&&(this.radioGroup.selected=this),this.name=this.radioGroup.name)}ngAfterViewInit(){this._focusMonitor.monitor(this._elementRef,!0).subscribe(t=>{!t&&this.radioGroup&&this.radioGroup._touch()})}ngOnDestroy(){this._focusMonitor.stopMonitoring(this._elementRef),this._removeUniqueSelectionListener()}_emitChangeEvent(){this.change.emit(new e7(this,this._value))}_isRippleDisabled(){return this.disableRipple||this.disabled}_onInputClick(t){t.stopPropagation()}_onInputInteraction(t){if(t.stopPropagation(),!this.checked&&!this.disabled){const i=this.radioGroup&&this.value!==this.radioGroup.value;this.checked=!0,this._emitChangeEvent(),this.radioGroup&&(this.radioGroup._controlValueAccessorChangeFn(this.value),i&&this.radioGroup._emitChangeEvent())}}_setDisabled(t){this._disabled!==t&&(this._disabled=t,this._changeDetector.markForCheck())}}return n.\u0275fac=function(t){return new(t||n)(E(n7),E(rt),E(kn),E(Sa),E(cS),E(String),E(void 0),E(String))},n.\u0275dir=oe({type:n,viewQuery:function(t,i){if(1&t&&Jn(mFe,5),2&t){let r;_t(r=yt())&&(i._inputElement=r.first)}},inputs:{id:"id",checked:"checked",value:"value",labelPosition:"labelPosition",disabled:"disabled",required:"required",color:"color",name:"name",ariaLabel:["aria-label","ariaLabel"],ariaLabelledby:["aria-labelledby","ariaLabelledby"],ariaDescribedby:["aria-describedby","ariaDescribedby"]},outputs:{change:"change"},features:[ct]}),n})(),r7=(()=>{class n extends SFe{constructor(t,i,r,s,o,a,l,c){super(t,i,r,s,o,a,l,c)}}return n.\u0275fac=function(t){return new(t||n)(E(t7,8),E(rt),E(kn),E(Sa),E(cS),E(Do,8),E(vFe,8),Zr("tabindex"))},n.\u0275cmp=Ne({type:n,selectors:[["mat-radio-button"]],hostAttrs:[1,"mat-radio-button"],hostVars:17,hostBindings:function(t,i){1&t&&ge("focus",function(){return i._inputElement.nativeElement.focus()}),2&t&&(nn("tabindex",null)("id",i.id)("aria-label",null)("aria-labelledby",null)("aria-describedby",null),st("mat-radio-checked",i.checked)("mat-radio-disabled",i.disabled)("_mat-animation-noopable",i._noopAnimations)("mat-primary","primary"===i.color)("mat-accent","accent"===i.color)("mat-warn","warn"===i.color))},inputs:{disableRipple:"disableRipple",tabIndex:"tabIndex"},exportAs:["matRadioButton"],features:[ct],ngContentSelectors:yFe,decls:13,vars:20,consts:[[1,"mat-radio-label"],["label",""],[1,"mat-radio-container"],[1,"mat-radio-outer-circle"],[1,"mat-radio-inner-circle"],["type","radio",1,"mat-radio-input","cdk-visually-hidden",3,"id","checked","disabled","tabIndex","required","change","click"],["input",""],["mat-ripple","",1,"mat-radio-ripple","mat-focus-indicator",3,"matRippleTrigger","matRippleDisabled","matRippleCentered","matRippleRadius","matRippleAnimation"],[1,"mat-ripple-element","mat-radio-persistent-ripple"],[1,"mat-radio-label-content"],[2,"display","none"]],template:function(t,i){if(1&t&&(wi(),R(0,"label",0,1),R(2,"span",2),tt(3,"span",3),tt(4,"span",4),R(5,"input",5,6),ge("change",function(s){return i._onInputInteraction(s)})("click",function(s){return i._onInputClick(s)}),k(),R(7,"span",7),tt(8,"span",8),k(),k(),R(9,"span",9),R(10,"span",10),De(11,"\xa0"),k(),Ht(12),k(),k()),2&t){const r=vs(1);nn("for",i.inputId),G(5),ie("id",i.inputId)("checked",i.checked)("disabled",i.disabled)("tabIndex",i.tabIndex)("required",i.required),nn("name",i.name)("value",i.value)("aria-label",i.ariaLabel)("aria-labelledby",i.ariaLabelledby)("aria-describedby",i.ariaDescribedby),G(2),ie("matRippleTrigger",r)("matRippleDisabled",i._isRippleDisabled())("matRippleCentered",!0)("matRippleRadius",20)("matRippleAnimation",Hg(18,_Fe,i._noopAnimations?0:150)),G(2),st("mat-radio-label-before","before"==i.labelPosition)}},directives:[Js],styles:[".mat-radio-button{display:inline-block;-webkit-tap-highlight-color:transparent;outline:0}.mat-radio-label{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;display:inline-flex;align-items:center;white-space:nowrap;vertical-align:middle;width:100%}.mat-radio-container{box-sizing:border-box;display:inline-block;position:relative;width:20px;height:20px;flex-shrink:0}.mat-radio-outer-circle{box-sizing:border-box;display:block;height:20px;left:0;position:absolute;top:0;transition:border-color ease 280ms;width:20px;border-width:2px;border-style:solid;border-radius:50%}._mat-animation-noopable .mat-radio-outer-circle{transition:none}.mat-radio-inner-circle{border-radius:50%;box-sizing:border-box;display:block;height:20px;left:0;position:absolute;top:0;opacity:0;transition:transform ease 280ms,background-color ease 280ms,opacity linear 1ms 280ms;width:20px;transform:scale(0.001);-webkit-print-color-adjust:exact;color-adjust:exact}.mat-radio-checked .mat-radio-inner-circle{transform:scale(0.5);opacity:1;transition:transform ease 280ms,background-color ease 280ms}.cdk-high-contrast-active .mat-radio-checked .mat-radio-inner-circle{border:solid 10px}._mat-animation-noopable .mat-radio-inner-circle{transition:none}.mat-radio-label-content{-webkit-user-select:auto;-moz-user-select:auto;-ms-user-select:auto;user-select:auto;display:inline-block;order:0;line-height:inherit;padding-left:8px;padding-right:0}[dir=rtl] .mat-radio-label-content{padding-right:8px;padding-left:0}.mat-radio-label-content.mat-radio-label-before{order:-1;padding-left:0;padding-right:8px}[dir=rtl] .mat-radio-label-content.mat-radio-label-before{padding-right:0;padding-left:8px}.mat-radio-disabled,.mat-radio-disabled .mat-radio-label{cursor:default}.mat-radio-button .mat-radio-ripple{position:absolute;left:calc(50% - 20px);top:calc(50% - 20px);height:40px;width:40px;z-index:1;pointer-events:none}.mat-radio-button .mat-radio-ripple .mat-ripple-element:not(.mat-radio-persistent-ripple){opacity:.16}.mat-radio-persistent-ripple{width:100%;height:100%;transform:none;top:0;left:0}.mat-radio-container:hover .mat-radio-persistent-ripple{opacity:.04}.mat-radio-button:not(.mat-radio-disabled).cdk-keyboard-focused .mat-radio-persistent-ripple,.mat-radio-button:not(.mat-radio-disabled).cdk-program-focused .mat-radio-persistent-ripple{opacity:.12}.mat-radio-persistent-ripple,.mat-radio-disabled .mat-radio-container:hover .mat-radio-persistent-ripple{opacity:0}@media(hover: none){.mat-radio-container:hover .mat-radio-persistent-ripple{display:none}}.mat-radio-input{bottom:0;left:50%}.cdk-high-contrast-active .mat-radio-button:not(.mat-radio-disabled).cdk-keyboard-focused .mat-radio-ripple,.cdk-high-contrast-active .mat-radio-button:not(.mat-radio-disabled).cdk-program-focused .mat-radio-ripple{outline:solid 3px}.cdk-high-contrast-active .mat-radio-disabled{opacity:.5}\n"],encapsulation:2,changeDetection:0}),n})(),MFe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[_l,On],On]}),n})();const xFe=["label"],TFe=["options"],AFe=function(){return["Register","3D\xa0Preview"]};let DFe=(()=>{class n{constructor(t){this.ga=t,this.clsName="ccf-stage-nav",this.side="anterior",this.view3D=!1,this.sideChange=new Le,this.view3DChange=new Le,this.isDropdownActive=!1,this.isDropdownHidden=!0}set useDropdownMenu(t){this.isDropdownActive=t,this.isDropdownHidden=!0}get labelEl(){return this.labelRef.nativeElement}get optionsEl(){return this.optionsRef.nativeElement}handleClick(t){const{isDropdownHidden:i,labelEl:r,optionsEl:s}=this;r.contains(t)?this.isDropdownHidden=!i:s.contains(t)||(this.isDropdownHidden=!0)}updateSide(t){this.ga.event("side_update","stage_nav",t),"3D"===t?this.updateView(!0):(this.updateView(!1),this.side=t,this.sideChange.emit(this.side))}updateView(t){this.view3D=t,this.ga.event("view_update","stage_nav",t?"3D":"Register"),this.view3DChange.emit(this.view3D)}}return n.\u0275fac=function(t){return new(t||n)(E(xs))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-stage-nav"]],viewQuery:function(t,i){if(1&t&&(Jn(xFe,7),Jn(TFe,7)),2&t){let r;_t(r=yt())&&(i.labelRef=r.first),_t(r=yt())&&(i.optionsRef=r.first)}},hostVars:2,hostBindings:function(t,i){1&t&&ge("click",function(s){return i.handleClick(s.target)},!1,sg),2&t&&Rn(i.clsName)},inputs:{useDropdownMenu:"useDropdownMenu",side:"side",view3D:"view3D"},outputs:{sideChange:"sideChange",view3DChange:"view3DChange"},decls:18,vars:10,consts:[[1,"dropdown-label"],["label",""],[1,"stage-options"],["options",""],[1,"input-group",3,"value","change"],["value","left",1,"nav-input"],["value","right",1,"nav-input"],["value","anterior","checked","",1,"nav-input"],["value","posterior",1,"nav-input"],["matTooltip","Change view.",1,"view-slider",3,"labels","value","valueChange"]],template:function(t,i){1&t&&(R(0,"div",0,1),R(2,"mat-label"),De(3,"Options"),k(),R(4,"mat-icon"),De(5,"arrow_drop_down"),k(),k(),R(6,"div",2,3),R(8,"mat-radio-group",4),ge("change",function(s){return i.updateSide(s.value)}),R(9,"mat-radio-button",5),De(10,"Left"),k(),R(11,"mat-radio-button",6),De(12,"Right"),k(),R(13,"mat-radio-button",7),De(14,"Anterior"),k(),R(15,"mat-radio-button",8),De(16,"Posterior"),k(),k(),R(17,"ccf-labeled-slide-toggle",9),ge("valueChange",function(s){return i.updateView("Register"!==s)}),k(),k()),2&t&&(st("dropdown",i.isDropdownActive),G(6),st("dropdowncontainer",i.isDropdownActive)("hidden",i.isDropdownActive&&i.isDropdownHidden),G(2),ie("value",i.side),G(9),ie("labels",fv(9,AFe))("value",i.view3D?"3D\xa0Preview":"Register"))},directives:[Gf,rs,i7,r7,XF,dc],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;flex-wrap:wrap}[_nghost-%COMP%] .dropdown-label[_ngcontent-%COMP%]{display:none;align-items:center}[_nghost-%COMP%] .dropdown-label[_ngcontent-%COMP%] mat-label[_ngcontent-%COMP%], [_nghost-%COMP%] .dropdown-label[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{line-height:1.5rem}[_nghost-%COMP%] .dropdown-label.dropdown[_ngcontent-%COMP%]{display:flex;cursor:pointer;align-items:start}[_nghost-%COMP%] .stage-options[_ngcontent-%COMP%]{display:flex;align-items:center}[_nghost-%COMP%] .stage-options[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%] .nav-input[_ngcontent-%COMP%]{margin-right:1.5rem;margin-bottom:1.5rem}[_nghost-%COMP%] .stage-options[_ngcontent-%COMP%] .view-slider[_ngcontent-%COMP%]{margin-left:-1rem;margin-bottom:1.5rem;white-space:nowrap}[_nghost-%COMP%] .stage-options.dropdowncontainer[_ngcontent-%COMP%]{display:flex;flex-direction:column;border-radius:.25rem;width:16.5rem;position:absolute;top:3.5rem;z-index:1;transition:opacity .25s}[_nghost-%COMP%] .stage-options.dropdowncontainer[_ngcontent-%COMP%] [_ngcontent-%COMP%]:first-child{margin-top:.5rem}[_nghost-%COMP%] .stage-options.dropdowncontainer[_ngcontent-%COMP%] [_ngcontent-%COMP%]:last-child{margin-bottom:.5rem}[_nghost-%COMP%] .stage-options.dropdowncontainer[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%]{margin-left:1.5rem;margin-right:0;display:flex;flex-wrap:wrap}[_nghost-%COMP%] .stage-options.dropdowncontainer[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%] .nav-input[_ngcontent-%COMP%]{display:flex;margin:0 1.5rem 0 0;height:2.5rem}[_nghost-%COMP%] .stage-options.dropdowncontainer[_ngcontent-%COMP%] .view-slider[_ngcontent-%COMP%]{display:flex;align-items:center;height:3rem;margin:0 .5rem}[_nghost-%COMP%] .stage-options.dropdowncontainer[_ngcontent-%COMP%] mat-divider[_ngcontent-%COMP%]{visibility:visible;border-top:2px solid}[_nghost-%COMP%] .stage-options.hidden[_ngcontent-%COMP%]{visibility:hidden;opacity:0;transition:visibility .25s,opacity .25s}[_nghost-%COMP%] .stage-options.hidden[_ngcontent-%COMP%] mat-divider[_ngcontent-%COMP%]{visibility:hidden}"],changeDetection:0}),n})();function OFe(n,e){if(1&n){const t=Zi();R(0,"ccf-body-ui",16),ge("rotationChange",function(r){en(t),Qe();const s=vs(24);return s.rotation=r[0],s.rotationX=r[1]}),Kt(1,"async"),Kt(2,"async"),Kt(3,"async"),k()}if(2&n){const t=Qe();ie("scene",rn(1,5,t.scene.nodes$))("rotation",rn(2,7,t.scene.rotation$))("bounds",rn(3,9,t.bounds$))("zoom",11.5)("interactive",!0)}}function IFe(n,e){if(1&n){const t=Zi();R(0,"ccf-body-ui",17),ge("nodeDrag",function(r){return en(t),Qe().handleNodeDrag(r)}),Kt(1,"async"),Kt(2,"async"),k()}if(2&n){const t=Qe();ie("scene",rn(1,4,t.scene.rotatedNodes$))("interactive",!1)("bounds",rn(2,6,t.bounds$))("zoom",11.5)}}function PFe(n,e){1&n&&tt(0,"ccf-store-debug",18)}function RFe(n,e){if(1&n){const t=Zi();R(0,"div",19),R(1,"button",20),ge("click",function(){en(t);const r=Qe();return r.debugMode=!r.debugMode}),De(2,"State"),k(),R(3,"button",21),ge("click",function(){return en(t),Qe().registration.setUseRegistrationCallback(!0)}),De(4,"Use callback"),k(),R(5,"button",21),ge("click",function(){return en(t),Qe().registration.setUseRegistrationCallback(!1)}),De(6,"Use download"),k(),k()}}let kFe=(()=>{class n{constructor(t,i,r,s,o,a){this.model=t,this.page=i,this.registration=r,this.scene=s,this.rootRef=o,this.cdr=a,this.clsName="ccf-content",this.position$=this.model.position$.pipe(Ae(l=>({x:Math.floor(l.x),y:Math.floor(l.y),z:Math.floor(l.z)}))),this.is3DView$=this.model.viewType$.pipe(Ae(l=>"3d"===l)),this.bounds$=this.model.organDimensions$.pipe(Ae(l=>({x:Math.max(l.x,this.model.defaultPosition.x+40)/1e3,y:Math.max(l.y,this.model.defaultPosition.y+40)/1e3,z:Math.max(l.z,this.model.defaultPosition.z+40)/1e3})),Q9("x"),Q9("y")),this.isNarrowView=!1,this.debugMode=!1,this.showDebugButtons=!hu.production}ngOnInit(){this.sensor=new hW.ResizeSensor(this.rootRef.nativeElement,({width:t})=>{const i=t<440;this.isNarrowView!==i&&(this.isNarrowView=i,this.cdr.markForCheck())})}ngOnDestroy(){this.sensor.detach()}setViewType(t){this.model.setViewType(t?"3d":"register")}resetStage(){this.model.setPosition(this.model.defaultPosition),this.model.setViewSide("anterior"),this.model.setViewType("register")}handleNodeDrag(t){if("#DraftPlacement"===t.node["@id"]&&t.info.coordinate){const[i,r]=t.info.coordinate.map(d=>1e3*d),{position:s,viewSide:o,organDimensions:a}=this.model.snapshot,l=[a.x,a.y,a.z].map(d=>d/2);let c=s;switch(o){case"anterior":c={x:i+l[0],y:r+l[1],z:s.z};break;case"posterior":c={x:-i+l[0],y:r+l[1],z:s.z};break;case"left":c={x:s.x,y:r+l[1],z:-i+l[2]};break;case"right":c={x:s.x,y:r+l[1],z:i+l[2]}}this.model.setPosition(c)}}}return n.\u0275fac=function(t){return new(t||n)(E(ai),E(ji),E(Sr),E(as),E(rt),E(kn))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-content"]],hostVars:2,hostBindings:function(t,i){2&t&&Rn(i.clsName)},decls:29,vars:34,consts:[[1,"top-bar"],[3,"useDropdownMenu","view3D","side","view3DChange","sideChange"],["matRipple","","matRippleColor","rgba(204, 204, 204, 0.25)",1,"icon","reset",3,"matRippleCentered","matRippleUnbounded","click"],[1,"main-content"],["class","body-ui","camera","perspective",3,"scene","rotation","bounds","zoom","interactive","rotationChange",4,"ngIf"],["class","body-ui","camera","orthographic",3,"scene","interactive","bounds","zoom","nodeDrag",4,"ngIf"],[1,"gizmo-area"],[1,"position-display"],[1,"position"],[1,"x"],[1,"y"],[1,"z"],[1,"gizmo",3,"scene","rotation","interactive","zoom"],["gizmo",""],["class","debug",4,"ngIf"],["style","position: absolute; bottom: 1rem; display: flex; flex-direction: row; justify-content: space-between; width: 7rem;",4,"ngIf"],["camera","perspective",1,"body-ui",3,"scene","rotation","bounds","zoom","interactive","rotationChange"],["camera","orthographic",1,"body-ui",3,"scene","interactive","bounds","zoom","nodeDrag"],[1,"debug"],[2,"position","absolute","bottom","1rem","display","flex","flex-direction","row","justify-content","space-between","width","7rem"],[2,"width","3rem","font-size",".7rem",3,"click"],[3,"click"]],template:function(t,i){if(1&t&&(R(0,"div",0),R(1,"ccf-stage-nav",1),ge("view3DChange",function(s){return i.setViewType(s)})("sideChange",function(s){return i.model.setViewSide(s)}),Kt(2,"async"),Kt(3,"async"),k(),R(4,"mat-icon",2),ge("click",function(){return i.resetStage()}),De(5,"refresh"),k(),k(),R(6,"div",3),mt(7,OFe,4,11,"ccf-body-ui",4),Kt(8,"async"),mt(9,IFe,3,8,"ccf-body-ui",5),Kt(10,"async"),R(11,"div",6),R(12,"div",7),R(13,"div",8),R(14,"div",9),De(15),Kt(16,"async"),k(),R(17,"div",10),De(18),Kt(19,"async"),k(),R(20,"div",11),De(21),Kt(22,"async"),k(),k(),k(),tt(23,"ccf-body-ui",12,13),Kt(25,"async"),Kt(26,"async"),k(),k(),mt(27,PFe,1,0,"ccf-store-debug",14),mt(28,RFe,7,0,"div",15)),2&t){let r,s,o;G(1),ie("useDropdownMenu",i.isNarrowView)("view3D",rn(2,16,i.is3DView$))("side",rn(3,18,i.model.viewSide$)),G(3),ie("matRippleCentered",!0)("matRippleUnbounded",!0),G(3),ie("ngIf","3d"===rn(8,20,i.model.viewType$)),G(2),ie("ngIf","register"===rn(10,22,i.model.viewType$)),G(6),or("X: ",null==(r=rn(16,24,i.position$))?null:r.x,""),G(3),or("Y: ",null==(s=rn(19,26,i.position$))?null:s.y,""),G(3),or("Z: ",null==(o=rn(22,28,i.position$))?null:o.z,""),G(2),ie("scene",rn(25,30,i.scene.gizmo$))("rotation",rn(26,32,i.scene.rotation$))("interactive",!1)("zoom",9.5),G(4),ie("ngIf",i.showDebugButtons&&i.debugMode),G(1),ie("ngIf",i.showDebugButtons)}},directives:[DFe,rs,Js,zr,mPe,SPe],pipes:[Hc],styles:["[_nghost-%COMP%]{display:block;width:100%;height:100%;padding:1.5rem;overflow:hidden}[_nghost-%COMP%] .top-bar[_ngcontent-%COMP%]{display:flex;justify-content:space-between}[_nghost-%COMP%] .top-bar[_ngcontent-%COMP%] .reset[_ngcontent-%COMP%]{transform:scaleX(-1);cursor:pointer;transition:.6s}[_nghost-%COMP%] .main-content[_ngcontent-%COMP%]{display:flex;height:calc(100% - 1rem)}[_nghost-%COMP%] .main-content[_ngcontent-%COMP%] .body-ui[_ngcontent-%COMP%]{flex:auto;transition:opacity 1s}[_nghost-%COMP%] .main-content[_ngcontent-%COMP%] .gizmo-area[_ngcontent-%COMP%]{width:4rem;margin-top:1.5rem;margin-left:1.5rem;z-index:10}[_nghost-%COMP%] .main-content[_ngcontent-%COMP%] .gizmo-area[_ngcontent-%COMP%] .position-display[_ngcontent-%COMP%]{display:flex;justify-content:center;margin-bottom:1.5rem}[_nghost-%COMP%] .main-content[_ngcontent-%COMP%] .gizmo-area[_ngcontent-%COMP%] .gizmo[_ngcontent-%COMP%]{height:5.5rem}[_nghost-%COMP%] .main-content[_ngcontent-%COMP%] .gizmo-area[_ngcontent-%COMP%] .gizmo[_ngcontent-%COMP%] .hidden[_ngcontent-%COMP%]{opacity:0;z-index:0}[_nghost-%COMP%] .ccf-store-debug[_ngcontent-%COMP%]{color:#fff;position:absolute;top:.5rem;max-width:55rem}"],changeDetection:0}),n})();function FFe(n,e){if(1&n){const t=Zi();R(0,"div",11),ge("click",function(){en(t),Qe();const r=vs(15);return r.expanded=!r.expanded}),R(1,"mat-icon",12),De(2),k(),k()}if(2&n){Qe();const t=vs(15);G(2),or(" ",t.expanded?"arrow_drop_up":"arrow_drop_down"," ")}}function NFe(n,e){if(1&n){const t=Zi();R(0,"div",11),ge("click",function(){en(t);const r=Qe();return r.open=!r.open}),R(1,"mat-icon",13),De(2),k(),k()}if(2&n){const t=Qe();G(2),or(" ",t.open?"arrow_drop_up":"arrow_drop_down"," ")}}const LFe=function(n){return[n]};let BFe=(()=>{class n{constructor(t,i,r,s,o,a,l,c,d){this.model=t,this.page=i,this.consentService=r,this.snackbar=s,this.theming=o,this.globalConfig=c,this.organList=qF,this.open=!0,this.registrationStarted=!1,this.disablePositionChange=!1,this.theme$=this.globalConfig.getOption("theme"),this.themeMode$=new If(1),this.header$=this.globalConfig.getOption("header"),this.homeUrl$=this.globalConfig.getOption("homeUrl"),this.logoTooltip$=this.globalConfig.getOption("logoTooltip"),this.subscriptions=new Te,o.initialize(a,l),this.subscriptions.add(i.registrationCallbackSet$.subscribe(f=>{this.open=!f})),this.subscriptions.add(i.registrationStarted$.subscribe(f=>{this.registrationStarted=f})),this.theme$.subscribe(f=>{this.theme=f}),this.globalConfig.getOption("homeUrl").subscribe(f=>{this.homeUrl=f}),this.globalConfig.getOption("logoTooltip").subscribe(f=>{this.logoTooltip=f}),Qi([this.theme$,this.themeMode$]).subscribe(([f,p])=>{this.theming.setTheme(`${f}-theme-${p}`),d.markForCheck()})}get isLightTheme(){return this.theming.getTheme().endsWith("light")}ngOnInit(){const t=this.snackbar.openFromComponent(eRe,{data:{preClose:()=>{t.dismiss()}},duration:"not-set"===this.consentService.consent?1/0:3e3});this.themeMode$.next("light"),this.theming.setTheme(`${this.theme}-theme-light`)}toggleScheme(){this.themeMode$.next(this.isLightTheme?"dark":"light")}handleKey(t){const i=this.model.snapshot.position;if(this.disablePositionChange||!this.registrationStarted)return;t.preventDefault();const r=t.repeat?1:.5;let s=i;switch(t.key){case"q":s=Object.assign(Object.assign({},i),{z:i.z+r});break;case"e":s=Object.assign(Object.assign({},i),{z:i.z-r});break;case"w":s=Object.assign(Object.assign({},i),{y:i.y+r});break;case"s":s=Object.assign(Object.assign({},i),{y:i.y-r});break;case"a":s=Object.assign(Object.assign({},i),{x:i.x-r});break;case"d":s=Object.assign(Object.assign({},i),{x:i.x+r})}this.model.setPosition(s)}handleClick(t){this.disablePositionChange="INPUT"===t.nodeName}ngOnDestroy(){this.subscriptions.unsubscribe()}}return n.\u0275fac=function(t){return new(t||n)(E(ai),E(ji),E(f0),E(Xae),E(YF),E(rt),E(Nt),E(Ah),E(kn))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-root"]],hostBindings:function(t,i){1&t&&ge("keydown",function(s){return i.handleKey(s)},!1,sg)("click",function(s){return i.handleClick(s.target)},!1,sg)},decls:21,vars:35,consts:[[3,"logoTooltip","homeUrl"],["opened",""],[3,"modalClosed","disableSlider"],["position","end","opened",""],[3,"modalClosed"],[1,"selector-drawer"],[3,"organList","selectedOrgans","organsChanged"],["organSelector",""],[1,"close-button-wrapper"],["class","close-button",3,"click",4,"ngIf"],[1,"stage-content"],[1,"close-button",3,"click"],["aria-hidden","false","aria-label","Expand carousel drawer",1,"expand-collapse-icon"],["aria-hidden","false","aria-label","Close carousel drawer",1,"expand-collapse-icon"]],template:function(t,i){if(1&t&&(tt(0,"ccf-registration-modal"),tt(1,"ccf-header",0),Kt(2,"async"),Kt(3,"async"),Kt(4,"async"),R(5,"ccf-drawer-container"),R(6,"ccf-drawer",1),tt(7,"ccf-left-sidebar",2),tt(8,"ccf-drawer-toggle-button"),k(),R(9,"ccf-drawer",3),tt(10,"ccf-right-sidebar",4),tt(11,"ccf-drawer-toggle-button"),k(),R(12,"ccf-drawer-content"),R(13,"div",5),R(14,"ccf-organ-selector",6,7),ge("organsChanged",function(s){return i.model.setOrgan(s[0])}),Kt(16,"async"),k(),R(17,"div",8),mt(18,FFe,3,1,"div",9),mt(19,NFe,3,1,"div",9),k(),k(),tt(20,"ccf-content",10),k(),k()),2&t){const r=vs(15);G(1),st("header-hidden",!1===rn(2,25,i.header$)),ie("logoTooltip",rn(3,27,i.logoTooltip$))("homeUrl",rn(4,29,i.homeUrl$)),G(6),ie("modalClosed",i.registrationStarted)("disableSlider",!(null!=r.selectedOrgans[0]&&r.selectedOrgans[0].hasSex)),G(3),ie("modalClosed",i.registrationStarted),G(3),st("closed",!i.open)("expanded",r.expanded),G(1),st("closed",!i.open),ie("organList",i.organList)("selectedOrgans",Hg(33,LFe,rn(16,31,i.model.organ$))),G(3),st("closed",!i.open)("selector-expanded",r.expanded),G(1),ie("ngIf",i.open),G(1),ie("ngIf",!r.expanded),G(1),st("expanded-stage",!i.open)("retracted-stage",r.expanded)}},directives:[LRe,jRe,XRe,ZF,Kke,Zke,gFe,bx,p9,zr,kFe,rs],pipes:[Hc],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;height:100%;overflow:hidden;font-size:1rem;color:#000}[_nghost-%COMP%] .header-hidden[_ngcontent-%COMP%]{display:none}[_nghost-%COMP%] ccf-drawer-container[_ngcontent-%COMP%]{height:100%}[_nghost-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer[_ngcontent-%COMP%]{width:25.5rem}[_nghost-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%]{position:relative;z-index:1}[_nghost-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .selector-drawer[_ngcontent-%COMP%]{top:0rem;display:flex;flex-direction:column;position:relative;height:5.688rem;transition:all .5s ease-in-out}[_nghost-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .selector-drawer.expanded[_ngcontent-%COMP%]{height:15rem}[_nghost-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .selector-drawer[_ngcontent-%COMP%] ccf-organ-selector[_ngcontent-%COMP%]{height:100%;padding-top:.5rem;transition:all .5s}[_nghost-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .selector-drawer[_ngcontent-%COMP%] ccf-organ-selector.closed[_ngcontent-%COMP%]{padding-top:0}[_nghost-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .selector-drawer[_ngcontent-%COMP%] .close-button-wrapper[_ngcontent-%COMP%]{display:flex;justify-content:center;height:0;z-index:2}[_nghost-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .selector-drawer[_ngcontent-%COMP%] .close-button-wrapper[_ngcontent-%COMP%] .close-button[_ngcontent-%COMP%]{cursor:pointer;transition:.6s}[_nghost-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .selector-drawer[_ngcontent-%COMP%] .close-button-wrapper[_ngcontent-%COMP%] .close-button[_ngcontent-%COMP%] .expand-collapse-icon[_ngcontent-%COMP%]{width:3rem;height:1.2rem;display:flex;justify-content:center;align-items:center;cursor:pointer;background-color:#fff;border-bottom-left-radius:.2rem;border-bottom-right-radius:.2rem;transition:.6s}[_nghost-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .selector-drawer[_ngcontent-%COMP%] .close-button-wrapper[_ngcontent-%COMP%] .close-button[_ngcontent-%COMP%] .expand-collapse-icon[_ngcontent-%COMP%]:hover{background-color:#ececec}[_nghost-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .selector-drawer.closed[_ngcontent-%COMP%]{height:3rem;top:-2.9rem}[_nghost-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .stage-content[_ngcontent-%COMP%]{border-radius:.5rem!important;height:calc(100% - 2.688rem - 3rem - 1.5rem)}[_nghost-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .expanded-stage[_ngcontent-%COMP%]{height:calc(100% - 1.5rem);padding-bottom:1rem}[_nghost-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .retracted-stage[_ngcontent-%COMP%]{height:calc(100% - 2.688rem - 14rem)}[_nghost-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-content[_ngcontent-%COMP%]{position:absolute;transition-duration:.5s;transition-timing-function:ease-in-out;transition-property:all;bottom:1.5rem;z-index:1}"],changeDetection:0}),n})();function VFe(n,e){1&n&&tt(0,"ccf-root")}let zFe=(()=>{class n extends lRe{constructor(t,i){const r=cRe;super(t,i,{initialDelay:500,initialConfig:Object.assign(Object.assign(Object.assign({},hu.dbOptions),globalThis.ruiConfig),hu.customization),parse:{useDownload:r.boolean,user:r.json,organ:r.json,editRegistration:r.json,register:r.function,cancelRegistration:r.function,fetchPreviousRegistrations:r.function,skipUnsavedChangesConfirmation:r.boolean,header:r.boolean}})}}return n.\u0275fac=function(t){return new(t||n)(E(Ah),E(kn))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-root-wc"]],inputs:{baseHref:"baseHref",useDownload:"useDownload",user:"user",organ:"organ",editRegistration:"editRegistration",register:"register",cancelRegistration:"cancelRegistration",fetchPreviousRegistrations:"fetchPreviousRegistrations",skipUnsavedChangesConfirmation:"skipUnsavedChangesConfirmation",theme:"theme",header:"header",homeUrl:"homeUrl",logoTooltip:"logoTooltip"},features:[ct],decls:1,vars:1,consts:[[4,"ngIf"]],template:function(t,i){1&t&&mt(0,VFe,1,0,"ccf-root",0),2&t&&ie("ngIf",i.initialized)},directives:[zr,BFe],encapsulation:2,changeDetection:0}),n})();const jFe=new ve("Global configuration object");function UFe(n){return n.get("ruiConfig",{user:{firstName:"",lastName:""}})}let HFe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({providers:[{provide:jFe,useFactory:UFe,deps:[v9]}]}),n})(),$Fe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({providers:[{provide:bv,useValue:YF.initialize,multi:!0},YF]}),n})(),GFe=(()=>{class n{constructor(t,i){this.accessor=t,this.injector=i}static forRoot(t=[]){return{ngModule:n,providers:[Fr,Fa,UW,...t]}}}return n.\u0275fac=function(t){return new(t||n)(I(Fr,2),I(Fa,2))},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({}),n})();const Sx=(n,e)=>((n,e)=>new Array(e+1).join("0"))(0,e-n.toString().length)+n;class YFe{constructor(e,t,i){this.action=e,this.store=t,this.logWriter=i}dispatched(e){const t=pp(this.action),i=function(n){return Sx(n.getHours(),2)+":"+Sx(n.getMinutes(),2)+":"+Sx(n.getSeconds(),2)+"."+Sx(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 XFe{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 ve("NGXS_LOGGER_PLUGIN_OPTIONS");let KFe=(()=>{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 XFe(this._options),this._store=this._store||this._injector.get(cu);const s=new YFe(i,this._store,this._logWriter);return s.dispatched(t),r(t,i).pipe(Ti(o=>{s.completed(o)}),Ta(o=>{throw s.errored(o),o}))}}return n.\u0275fac=function(t){return new(t||n)(I(s7),I(Nt))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();const o7=new ve("LOGGER_USER_OPTIONS");function ZFe(n){return Object.assign({},{logger:console,collapsed:!1,disabled:!1,filter:()=>!0},n)}let QFe=(()=>{class n{static forRoot(t){return{ngModule:n,providers:[{provide:rk,useClass:KFe,multi:!0},{provide:o7,useValue:t},{provide:s7,useFactory:ZFe,deps:[o7]}]}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({}),n})();const JF=new ve("NGXS_STORAGE_PLUGIN_OPTION"),a7=new ve("STORAGE_ENGINE"),e2="@@STATE",l7="NGXS_OPTIONS_META";function e2e(n){return void 0!==n&&n.key&&(n.key=function(n){return Array.isArray(n)||(n=[n]),n.map(e=>(e.hasOwnProperty(l7)&&(e=e[l7].name),e instanceof class{constructor(e){this.name=e,uk(this).makeRootSelector=i=>i.getStateGetter(this.name)}getName(){return this.name}toString(){return`StateToken[${this.name}]`}}?e.getName():e))}(n.key)),Object.assign({key:[e2],storage:0,serialize:JSON.stringify,deserialize:JSON.parse,beforeSerialize:e=>e,afterDeserialize:e=>e},n)}function t2e(n,e){return kD(e)?null:0===n.storage?localStorage:1===n.storage?sessionStorage:null}let n2e=(()=>{class n{constructor(t,i,r){this._options=t,this._engine=i,this._platformId=r}handle(t,i,r){if(kD(this._platformId)&&null===this._engine)return r(t,i);const s=this._options.key,o=function(n){const e=pp(n);return function(t){return e===pp(t)}}(i),a=o(iG)||o(rG);let l=!1;if(a)for(const c of s){const d=c===e2;let f=this._engine.getItem(c);if("undefined"!==f&&null!=f){try{const p=this._options.deserialize(f);f=this._options.afterDeserialize(p,c)}catch(p){console.error("Error ocurred while deserializing the store value, falling back to empty object."),f={}}this._options.migrations&&this._options.migrations.forEach(p=>{p.version===Gm(f,p.versionKey||"version")&&(!p.key&&d||p.key===c)&&(f=p.migrate(f),l=!0)}),t=d?Object.assign({},t,f):ok(t,c,f)}}return r(t,i).pipe(Ti(c=>{if(!a||a&&l)for(const d of s){let f=c;d!==e2&&(f=Gm(c,d));try{const p=this._options.beforeSerialize(f,d);this._engine.setItem(d,this._options.serialize(p))}catch(p){console.error("Error ocurred while serializing the store value, value not updated.")}}}))}}return n.\u0275fac=function(t){return new(t||n)(I(JF),I(a7),I(dl))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();const c7=new ve("USER_OPTIONS");let i2e=(()=>{class n{static forRoot(t){return{ngModule:n,providers:[{provide:rk,useClass:n2e,multi:!0},{provide:c7,useValue:t},{provide:JF,useFactory:e2e,deps:[c7]},{provide:a7,useFactory:t2e,deps:[JF,dl]}]}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({}),n})();const u7=[{name:"bladder",namespace:"app",url:"assets/icons/organs/ico-organs-bladder.svg"},{name:"blood",namespace:"app",url:"assets/icons/organs/ico-organs-blood.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:"eye",namespace:"app",url:"assets/icons/organs/ico-organs-eye.svg"},{name:"fallopian-tube-left",namespace:"app",url:"assets/icons/organs/ico-organs-fallopian-tube-left.svg"},{name:"fallopian-tube-right",namespace:"app",url:"assets/icons/organs/ico-organs-fallopian-tube-right.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-right",namespace:"app",url:"assets/icons/organs/ico-organs-kidney-right.svg"},{name:"kidney",namespace:"app",url:"assets/icons/organs/ico-organs-kidney.svg"},{name:"knee",namespace:"app",url:"assets/icons/organs/ico-organs-knee.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-right",namespace:"app",url:"assets/icons/organs/ico-organs-lung-right.svg"},{name:"lung",namespace:"app",url:"assets/icons/organs/ico-organs-lung.svg"},{name:"lymph-nodes",namespace:"app",url:"assets/icons/organs/ico-organs-lymph-nodes.svg"},{name:"mammary-gland",namespace:"app",url:"assets/icons/organs/ico-organs-breast.svg"},{name:"neuron",namespace:"app",url:"assets/icons/organs/ico-organs-neuron.svg"},{name:"ovaries",namespace:"app",url:"assets/icons/organs/ico-organs-ovaries.svg"},{name:"ovary-left",namespace:"app",url:"assets/icons/organs/ico-organs-ovary-left.svg"},{name:"ovary-right",namespace:"app",url:"assets/icons/organs/ico-organs-ovary-right.svg"},{name:"pancreas",namespace:"app",url:"assets/icons/organs/ico-organs-pancreas.svg"},{name:"pelvis-f",namespace:"app",url:"assets/icons/organs/ico-organs-pelvis-f.svg"},{name:"placenta",namespace:"app",url:"assets/icons/organs/ico-organs-placenta.svg"},{name:"prostate",namespace:"app",url:"assets/icons/organs/ico-organs-prostate.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:"spinal-cord",namespace:"app",url:"assets/icons/organs/ico-organs-spinal-cord.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:"ureter-left",namespace:"app",url:"assets/icons/organs/ico-organs-ureter-left.svg"},{name:"ureter-right",namespace:"app",url:"assets/icons/organs/ico-organs-ureter-right.svg"},{name:"uterus",namespace:"app",url:"assets/icons/organs/ico-organs-uterus.svg"},{name:"vasculature-thick",namespace:"app",url:"assets/icons/organs/ico-organs-vasculature-thick.svg"},{name:"vasculature-thin",namespace:"app",url:"assets/icons/organs/ico-organs-vasculature-thin.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:"visibility_off_cube",namespace:"app",url:"assets/icons/ico-cube.svg"}];let hd=class extends cDe{constructor(e,t,i){super(),this.registry=e,this.sanitizer=t,this.globalConfig=i}ngxsOnInit(){var e;u7.filter(t=>void 0!==t.html).map(t=>Object.assign(Object.assign({},t),{html:this.sanitizer.bypassSecurityTrustHtml(t.html)})).forEach(t=>this.registerIconImpl(t)),null===(e=this.registry)||void 0===e||e.addSvgIconResolver((t,i)=>{var r;const s=u7.find(a=>{var l,c;return(null!==(l=a.name)&&void 0!==l?l:"")===t&&(null!==(c=a.namespace)&&void 0!==c?c:"")===i});if(void 0===s||void 0===s.url)return null;const o=null!==(r=this.globalConfig.snapshot.baseHref)&&void 0!==r?r:"";return this.sanitizer.bypassSecurityTrustResourceUrl(o+s.url)})}registerIcon(e){return this.registerIconImpl(e)}registerIconImpl(e){if(!this.registry||!e.url&&!e.html)return!1;const t=this.registry,r=t[this.getMethodName(e)],s=this.getArguments(e);if(!r)return!1;try{return r.apply(t,s),!0}catch(o){return!1}}getMethodName({name:e,namespace:t,url:i}){const r=["addSvgIcon"];return e||r.push("Set"),i||r.push("Literal"),t&&r.push("InNamespace"),r.join("")}getArguments({name:e,namespace:t,url:i,html:r}){return[t,e,null!=i?i:r].filter(o=>!!o)}};hd.\u0275fac=function(e){return new(e||hd)(I(Gv,8),I(th),I(Ah))},hd.\u0275prov=ue({token:hd,factory:hd.\u0275fac}),xe([on()],hd.prototype,"registerIcon",null),hd=xe([xh(),cd({name:"iconRegistry"})],hd);const r2e=[Ah,hd,ji,ai,ko,fc,Sr,as];let s2e=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[GFe.forRoot(),Io.forRoot(r2e,{developmentMode:!hu.production}),i2e.forRoot({key:["registration.registrations"]}),QFe.forRoot({disabled:hu.production})]]}),n})(),o2e=(()=>{class n{constructor(t){if(t)throw new Error("The core module should only be imported once in the root module")}}return n.\u0275fac=function(t){return new(t||n)(I(n,12))},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[Rj,kIe.forRoot({gaToken:hu.googleAnalyticsToken,appName:"rui"}),ZPe,HFe,s2e,$Fe]]}),n})(),t2=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,O9]]}),n})(),a2e=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,MFe,q9,lr,yx,t2,hc]]}),n})(),l2e=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,lr]]}),n})(),c2e=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,a2e,lr,MPe,l2e,_l,_Pe]]}),n})(),u2e=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,lr,hc]]}),n})(),d2e=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn]]}),n})(),h2e=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,q9]]}),n})(),d7=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,O9,Kb,Lk,Bk,hc]]}),n})(),f2e=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,lr,_l,m9]]}),n})(),h7=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,lr,j9]]}),n})(),p2e=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,ch]]}),n})(),g2e=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,Kk,lr,hc,yx,d2e,t2,d7,h7,h2e,m9,f2e,h7,p2e]]}),n})(),m2e=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,ch,hc,d7,t2,g9]]}),n})(),_2e=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,Qb,lr,m2e]]}),n})(),y2e=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,Kb,lr,_l,hc]]}),n})(),v2e=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,lr,_W,_l,hc]]}),n})(),b2e=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,Kb,lr,_l,hc,qPe]]}),n})(),C2e=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,j9,lr]]}),n})(),w2e=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,Lk,Bk,ch,h9,Uv,lr,Kb]]}),n})(),E2e=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,Qb,lr,ch]]}),n})(),S2e=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,E2e,ch,hc]]}),n})(),M2e=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,Kk,yx,lr,kO,hc,y2e,S2e,v2e,b2e,C2e,w2e,HPe]]}),n})(),x2e=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({providers:[{provide:P9,useValue:I9}],imports:[[yE,kO,lr]]}),n})(),T2e=(()=>{class n{constructor(t){this.injector=t}ngDoBootstrap(){const t=function(n,e){const t=function(n,e){return e.get(ll).resolveComponentFactory(n).inputs}(n,e.injector),i=e.strategyFactory||new Fne(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 Lne{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}(zFe,{injector:this.injector});customElements.define("ccf-rui",t)}}return n.\u0275fac=function(t){return new(t||n)(I(Nt))},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({providers:[{provide:T9,useValue:"hubmap-theme-light"},{provide:vj,useValue:{appearance:"standard",floatLabel:!1,hideRequiredMarker:!0}}],imports:[[yE,kO,o2e,lr,x2e,u2e,c2e,g2e,M2e,g9,_2e,tRe,_U]]}),n})();hu.production&&function(){if(i3)throw new Error("Cannot enable prod mode after platform setup.");n3=!1}(),rne().bootstrapModule(T2e).catch(n=>console.error(n))},948:gt=>{gt.exports=function(ze){return ze&&ze.__esModule?ze:{default:ze}},gt.exports.default=gt.exports,gt.exports.__esModule=!0},321:gt=>{function We(ze){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(gt.exports=We=function(L){return typeof L},gt.exports.default=gt.exports,gt.exports.__esModule=!0):(gt.exports=We=function(L){return L&&"function"==typeof Symbol&&L.constructor===Symbol&&L!==Symbol.prototype?"symbol":typeof L},gt.exports.default=gt.exports,gt.exports.__esModule=!0),We(ze)}gt.exports=We,gt.exports.default=gt.exports,gt.exports.__esModule=!0},833:gt=>{function We(ze){return Promise.resolve().then(()=>{var wt=new Error("Cannot find module '"+ze+"'");throw wt.code="MODULE_NOT_FOUND",wt})}We.keys=()=>[],We.resolve=We,We.id=833,gt.exports=We},521:()=>{},125:()=>{},307:()=>{}},gt=>{gt(gt.s=851)}]); \ No newline at end of file +var A2e=Object.defineProperty,D2e=Object.defineProperties,O2e=Object.getOwnPropertyDescriptors,p7=Object.getOwnPropertySymbols,I2e=Object.prototype.hasOwnProperty,P2e=Object.prototype.propertyIsEnumerable,Ui=Math.pow,g7=(gt,We,ze)=>We in gt?A2e(gt,We,{enumerable:!0,configurable:!0,writable:!0,value:ze}):gt[We]=ze,K=(gt,We)=>{for(var ze in We||(We={}))I2e.call(We,ze)&&g7(gt,ze,We[ze]);if(p7)for(var ze of p7(We))P2e.call(We,ze)&&g7(gt,ze,We[ze]);return gt},Lt=(gt,We)=>D2e(gt,O2e(We));(self.webpackChunkccf_ui=self.webpackChunkccf_ui||[]).push([[179],{2:gt=>{"use strict";gt.exports=ze,gt.exports.default=ze;var We=1e20;function ze(Ke,ft,Ze,Tt,Ft,we){this.fontSize=Ke||24,this.buffer=void 0===ft?3:ft,this.cutoff=Tt||.25,this.fontFamily=Ft||"sans-serif",this.fontWeight=we||"normal",this.radius=Ze||8;var _e=this.size=this.fontSize+2*this.buffer,ke=_e+2*this.buffer;this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=_e,this.ctx=this.canvas.getContext("2d"),this.ctx.font=this.fontWeight+" "+this.fontSize+"px "+this.fontFamily,this.ctx.textAlign="left",this.ctx.fillStyle="black",this.gridOuter=new Float64Array(ke*ke),this.gridInner=new Float64Array(ke*ke),this.f=new Float64Array(ke),this.z=new Float64Array(ke+1),this.v=new Uint16Array(ke),this.useMetrics=void 0!==this.ctx.measureText("A").actualBoundingBoxLeft,this.middle=Math.round(_e/2*(navigator.userAgent.indexOf("Gecko/")>=0?1.2:1))}function It(Ke,ft,Ze,Tt,Ft,we){for(var _e=0;_e-1);we[++ye]=ke,_e[ye]=Te,_e[ye+1]=We}for(ke=0,ye=0;ke{"use strict";var wt=(()=>{return(It=wt||(wt={})).typeOfFunction="function",It.boolTrue=!0,wt;var It})();function L(It,Pt,Ke){if(!Ke||typeof Ke.value!==wt.typeOfFunction)throw new TypeError("Only methods can be decorated with @bind. <"+Pt+"> is not a method!");return{configurable:wt.boolTrue,get:function(){var ft=Ke.value.bind(this);return Object.defineProperty(this,Pt,{value:ft,configurable:wt.boolTrue,writable:wt.boolTrue}),ft}}}We.ak=L,We.ZP=L},266:(gt,We,ze)=>{gt.exports={ResizeSensor:ze(835),ElementQueries:ze(845)}},845:function(gt,We,ze){"use strict";var wt,L,It;"undefined"!=typeof window&&window,L=[ze(835)],void 0!==(It="function"==typeof(wt=function(Pt){var Ke=function(){var Ze,Tt={},Ft=[];function we(Ve){Ve||(Ve=document.documentElement);var ce=window.getComputedStyle(Ve,null).fontSize;return parseFloat(ce)||16}function ke(Ve,ce){var zt=ce.split(/\d/),Gt=zt[zt.length-1];switch(ce=parseFloat(ce),Gt){case"px":return ce;case"em":return ce*we(Ve);case"rem":return ce*we();case"vw":return ce*document.documentElement.clientWidth/100;case"vh":return ce*document.documentElement.clientHeight/100;case"vmin":case"vmax":var Qt=document.documentElement.clientWidth/100,li=document.documentElement.clientHeight/100;return ce*(0,Math["vmin"===Gt?"min":"max"])(Qt,li);default:return ce}}function ye(Ve,ce){this.element=Ve;var zt,Gt,Qt,li,Pi,Se,pn,Gn,Ae=["min-width","min-height","max-width","max-height"];this.call=function(){for(zt in Qt=function(Ve){if(!Ve.getBoundingClientRect)return{width:Ve.offsetWidth,height:Ve.offsetHeight};var ce=Ve.getBoundingClientRect();return{width:Math.round(ce.width),height:Math.round(ce.height)}}(this.element),Se={},Tt[ce])!Tt[ce].hasOwnProperty(zt)||(li=ke(this.element,(Gt=Tt[ce][zt]).value),Pi="width"===Gt.property?Qt.width:Qt.height,pn="","min"===Gt.mode&&Pi>=li&&(pn+=Gt.value),"max"===Gt.mode&&Pi<=li&&(pn+=Gt.value),Se[Gn=Gt.mode+"-"+Gt.property]||(Se[Gn]=""),pn&&-1===(" "+Se[Gn]+" ").indexOf(" "+pn+" ")&&(Se[Gn]+=" "+pn));for(var Ri in Ae)!Ae.hasOwnProperty(Ri)||(Se[Ae[Ri]]?this.element.setAttribute(Ae[Ri],Se[Ae[Ri]].substr(1)):this.element.removeAttribute(Ae[Ri]))}}function Te(Ve,ce){Ve.elementQueriesSetupInformation||(Ve.elementQueriesSetupInformation=new ye(Ve,ce)),Ve.elementQueriesSensor||(Ve.elementQueriesSensor=new Pt(Ve,function(){Ve.elementQueriesSetupInformation.call()}))}function Vt(Ve,ce,zt,Gt){if(void 0===Tt[Ve]){Tt[Ve]=[];var Qt=Ft.length;Ze.innerHTML+="\n"+Ve+" {animation: 0.1s element-queries;}",Ze.innerHTML+="\n"+Ve+" > .resize-sensor {min-width: "+Qt+"px;}",Ft.push(Ve)}Tt[Ve].push({mode:ce,property:zt,value:Gt})}function He(Ve){var ce;if(document.querySelectorAll&&(ce=Ve?Ve.querySelectorAll.bind(Ve):document.querySelectorAll.bind(document)),!ce&&"undefined"!=typeof $$&&(ce=$$),!ce&&"undefined"!=typeof jQuery&&(ce=jQuery),!ce)throw"No document.querySelectorAll, jQuery or Mootools's $$ found.";return ce}function xt(Ve){var ce=[],zt=[],Gt=[],Qt=0,li=-1,Pi=[];for(var Se in Ve.children)if(Ve.children.hasOwnProperty(Se)&&Ve.children[Se].tagName&&"img"===Ve.children[Se].tagName.toLowerCase()){ce.push(Ve.children[Se]);var pn=Ve.children[Se].getAttribute("min-width")||Ve.children[Se].getAttribute("data-min-width"),Gn=Ve.children[Se].getAttribute("data-src")||Ve.children[Se].getAttribute("url");Gt.push(Gn),zt.push({minWidth:pn}),pn?Ve.children[Se].style.display="none":(Qt=ce.length-1,Ve.children[Se].style.display="block")}function Ri(){var xr,jt=!1;for(xr in ce)!ce.hasOwnProperty(xr)||zt[xr].minWidth&&Ve.offsetWidth>zt[xr].minWidth&&(jt=xr);if(jt||(jt=Qt),li!==jt)if(Pi[jt])ce[li].style.display="none",ce[jt].style.display="block",li=jt;else{var ls=new Image;ls.onload=function(){ce[jt].src=Gt[jt],ce[li].style.display="none",ce[jt].style.display="block",Pi[jt]=!0,li=jt},ls.src=Gt[jt]}else ce[jt].src=Gt[jt]}li=Qt,Ve.resizeSensorInstance=new Pt(Ve,Ri),Ri()}var Yn=/,?[\s\t]*([^,\n]*?)((?:\[[\s\t]*?(?:min|max)-(?:width|height)[\s\t]*?[~$\^]?=[\s\t]*?"[^"]*?"[\s\t]*?])+)([^,\n\s\{]*)/gim,Ei=/\[[\s\t]*?(min|max)-(width|height)[\s\t]*?[~$\^]?=[\s\t]*?"([^"]*?)"[\s\t]*?]/gim;function vi(Ve){var ce,zt,Gt,Qt;for(Ve=Ve.replace(/'/g,'"');null!==(ce=Yn.exec(Ve));)for(zt=ce[1]+ce[3],Gt=ce[2];null!==(Qt=Ei.exec(Gt));)Vt(zt,Qt[1],Qt[2],Qt[3])}function bi(Ve){var ce="";if(Ve)if("string"==typeof Ve)(-1!==(Ve=Ve.toLowerCase()).indexOf("min-width")||-1!==Ve.indexOf("max-width"))&&vi(Ve);else for(var zt=0,Gt=Ve.length;zt img, [data-responsive-image] {overflow: hidden; padding: 0; } [responsive-image] > img, [data-responsive-image] > img {width: 100%;}",Ze.innerHTML+="\n@keyframes element-queries { 0% { visibility: inherit; } }",document.getElementsByTagName("head")[0].appendChild(Ze),Mr=!0);for(var ce=0,zt=document.styleSheets.length;ce=_e.status}function ft(we){try{we.dispatchEvent(new MouseEvent("click"))}catch(ke){var _e=document.createEvent("MouseEvents");_e.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),we.dispatchEvent(_e)}}var Ze="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:"object"==typeof global&&global.global===global?global:void 0,Tt=Ze.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),Ft=Ze.saveAs||("object"!=typeof window||window!==Ze?function(){}:"download"in HTMLAnchorElement.prototype&&!Tt?function(we,_e,ke){var ye=Ze.URL||Ze.webkitURL,Te=document.createElement("a");Te.download=_e=_e||we.name||"download",Te.rel="noopener","string"==typeof we?(Te.href=we,Te.origin===location.origin?ft(Te):Ke(Te.href)?Pt(we,_e,ke):ft(Te,Te.target="_blank")):(Te.href=ye.createObjectURL(we),setTimeout(function(){ye.revokeObjectURL(Te.href)},4e4),setTimeout(function(){ft(Te)},0))}:"msSaveOrOpenBlob"in navigator?function(we,_e,ke){if(_e=_e||we.name||"download","string"!=typeof we)navigator.msSaveOrOpenBlob(function(we,_e){return void 0===_e?_e={autoBom:!1}:"object"!=typeof _e&&(console.warn("Deprecated: Expected third argument to be a object"),_e={autoBom:!_e}),_e.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(we.type)?new Blob(["\ufeff",we],{type:we.type}):we}(we,ke),_e);else if(Ke(we))Pt(we,_e,ke);else{var ye=document.createElement("a");ye.href=we,ye.target="_blank",setTimeout(function(){ft(ye)})}}:function(we,_e,ke,ye){if((ye=ye||open("","_blank"))&&(ye.document.title=ye.document.body.innerText="downloading..."),"string"==typeof we)return Pt(we,_e,ke);var Te="application/octet-stream"===we.type,Vt=/constructor/i.test(Ze.HTMLElement)||Ze.safari,He=/CriOS\/[\d]+/.test(navigator.userAgent);if((He||Te&&Vt||Tt)&&"undefined"!=typeof FileReader){var An=new FileReader;An.onloadend=function(){var Yn=An.result;Yn=He?Yn:Yn.replace(/^data:[^;]*;/,"data:attachment/file;"),ye?ye.location.href=Yn:location=Yn,ye=null},An.readAsDataURL(we)}else{var xt=Ze.URL||Ze.webkitURL,tn=xt.createObjectURL(we);ye?ye.location=tn:location.href=tn,ye=null,setTimeout(function(){xt.revokeObjectURL(tn)},4e4)}});Ze.saveAs=Ft.saveAs=Ft,gt.exports=Ft})?ze.apply(We,[]):ze)&&(gt.exports=L)},524:(gt,We,ze)=>{var wt;!function(L,It,Pt,Ke){"use strict";var He,ft=["","webkit","Moz","MS","ms","o"],Ze=It.createElement("div"),Ft=Math.round,we=Math.abs,_e=Date.now;function ke(A,F,j){return setTimeout(Yn(A,j),F)}function ye(A,F,j){return!!Array.isArray(A)&&(Te(A,j[F],j),!0)}function Te(A,F,j){var re;if(A)if(A.forEach)A.forEach(F,j);else if(A.length!==Ke)for(re=0;re\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",vn=L.console&&(L.console.warn||L.console.log);return vn&&vn.call(L.console,re,Ue),A.apply(this,arguments)}}He="function"!=typeof Object.assign?function(F){if(F===Ke||null===F)throw new TypeError("Cannot convert undefined or null to object");for(var j=Object(F),re=1;re-1}function zt(A){return A.trim().split(/\s+/g)}function Gt(A,F,j){if(A.indexOf&&!j)return A.indexOf(F);for(var re=0;reWr[F]}):re.sort()),re}function Pi(A,F){for(var j,re,Fe=F[0].toUpperCase()+F.slice(1),Ue=0;Ue1&&!j.firstMultiple?j.firstMultiple=Va(F):1===Fe&&(j.firstMultiple=!1);var Ue=j.firstInput,vn=j.firstMultiple,dr=vn?vn.center:Ue.center,yr=F.center=uo(re);F.timeStamp=_e(),F.deltaTime=F.timeStamp-Ue.timeStamp,F.angle=ho(dr,yr),F.distance=us(dr,yr),function(A,F){var j=F.center,re=A.offsetDelta||{},Fe=A.prevDelta||{},Ue=A.prevInput||{};(1===F.eventType||4===Ue.eventType)&&(Fe=A.prevDelta={x:Ue.deltaX||0,y:Ue.deltaY||0},re=A.offsetDelta={x:j.x,y:j.y}),F.deltaX=Fe.x+(j.x-re.x),F.deltaY=Fe.y+(j.y-re.y)}(j,F),F.offsetDirection=Ni(F.deltaX,F.deltaY);var Wr=za(F.deltaTime,F.deltaX,F.deltaY);F.overallVelocityX=Wr.x,F.overallVelocityY=Wr.y,F.overallVelocity=we(Wr.x)>we(Wr.y)?Wr.x:Wr.y,F.scale=vn?function(A,F){return us(F[0],F[1],Nr)/us(A[0],A[1],Nr)}(vn.pointers,re):1,F.rotation=vn?function(A,F){return ho(F[1],F[0],Nr)+ho(A[1],A[0],Nr)}(vn.pointers,re):0,F.maxPointers=j.prevInput?F.pointers.length>j.prevInput.maxPointers?F.pointers.length:j.prevInput.maxPointers:F.pointers.length,function(A,F){var Fe,Ue,vn,dr,j=A.lastInterval||F,re=F.timeStamp-j.timeStamp;if(8!=F.eventType&&(re>25||j.velocity===Ke)){var yr=F.deltaX-j.deltaX,Wr=F.deltaY-j.deltaY,cn=za(re,yr,Wr);Ue=cn.x,vn=cn.y,Fe=we(cn.x)>we(cn.y)?cn.x:cn.y,dr=Ni(yr,Wr),A.lastInterval=F}else Fe=j.velocity,Ue=j.velocityX,vn=j.velocityY,dr=j.direction;F.velocity=Fe,F.velocityX=Ue,F.velocityY=vn,F.direction=dr}(j,F);var cn=A.element;Ve(F.srcEvent.target,cn)&&(cn=F.srcEvent.target),F.target=cn}(A,j),A.emit("hammer.input",j),A.recognize(j),A.session.prevInput=j}function Va(A){for(var F=[],j=0;j=we(F)?A<0?2:4:F<0?8:16}function us(A,F,j){j||(j=Gr);var re=F[j[0]]-A[j[0]],Fe=F[j[1]]-A[j[1]];return Math.sqrt(re*re+Fe*Fe)}function ho(A,F,j){return j||(j=Gr),180*Math.atan2(F[j[1]]-A[j[1]],F[j[0]]-A[j[0]])/Math.PI}ii.prototype={handler:function(){},init:function(){this.evEl&&bi(this.element,this.evEl,this.domHandler),this.evTarget&&bi(this.target,this.evTarget,this.domHandler),this.evWin&&bi(Gn(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&Mr(this.element,this.evEl,this.domHandler),this.evTarget&&Mr(this.target,this.evTarget,this.domHandler),this.evWin&&Mr(Gn(this.element),this.evWin,this.domHandler)}};var fu={mousedown:1,mousemove:2,mouseup:4},pu="mousedown",gu="mousemove mouseup";function Ml(){this.evEl=pu,this.evWin=gu,this.pressed=!1,ii.apply(this,arguments)}tn(Ml,ii,{handler:function(F){var j=fu[F.type];1&j&&0===F.button&&(this.pressed=!0),2&j&&1!==F.which&&(j=4),this.pressed&&(4&j&&(this.pressed=!1),this.callback(this.manager,j,{pointers:[F],changedPointers:[F],pointerType:cs,srcEvent:F}))}});var mc={pointerdown:1,pointermove:2,pointerup:4,pointercancel:8,pointerout:8},pd={2:ls,3:"pen",4:cs,5:"kinect"},mu="pointerdown",Vs="pointermove pointerup pointercancel";function Je(){this.evEl=mu,this.evWin=Vs,ii.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}L.MSPointerEvent&&!L.PointerEvent&&(mu="MSPointerDown",Vs="MSPointerMove MSPointerUp MSPointerCancel"),tn(Je,ii,{handler:function(F){var j=this.store,re=!1,Fe=F.type.toLowerCase().replace("ms",""),Ue=mc[Fe],vn=pd[F.pointerType]||F.pointerType,dr=vn==ls,yr=Gt(j,F.pointerId,"pointerId");1&Ue&&(0===F.button||dr)?yr<0&&(j.push(F),yr=j.length-1):12&Ue&&(re=!0),!(yr<0)&&(j[yr]=F,this.callback(this.manager,Ue,{pointers:j,changedPointers:[F],pointerType:vn,srcEvent:F}),re&&j.splice(yr,1))}});var _u={touchstart:1,touchmove:2,touchend:4,touchcancel:8},W="touchstart",Y="touchstart touchmove touchend touchcancel";function J(){this.evTarget=W,this.evWin=Y,this.started=!1,ii.apply(this,arguments)}function T(A,F){var j=Qt(A.touches),re=Qt(A.changedTouches);return 12&F&&(j=li(j.concat(re),"identifier",!0)),[j,re]}tn(J,ii,{handler:function(F){var j=_u[F.type];if(1===j&&(this.started=!0),this.started){var re=T.call(this,F,j);12&j&&re[0].length-re[1].length==0&&(this.started=!1),this.callback(this.manager,j,{pointers:re[0],changedPointers:re[1],pointerType:ls,srcEvent:F})}}});var D={touchstart:1,touchmove:2,touchend:4,touchcancel:8},B="touchstart touchmove touchend touchcancel";function Z(){this.evTarget=B,this.targetIds={},ii.apply(this,arguments)}function $(A,F){var j=Qt(A.touches),re=this.targetIds;if(3&F&&1===j.length)return re[j[0].identifier]=!0,[j,j];var Fe,Ue,vn=Qt(A.changedTouches),dr=[],yr=this.target;if(Ue=j.filter(function(Wr){return Ve(Wr.target,yr)}),1===F)for(Fe=0;Fe-1&&re.splice(Ue,1)},2500)}}function xn(A){for(var F=A.srcEvent.clientX,j=A.srcEvent.clientY,re=0;re-1&&this.requireFail.splice(F,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(A){return!!this.simultaneous[A.id]},emit:function(A){var F=this,j=this.state;function re(Fe){F.manager.emit(Fe,A)}j<8&&re(F.options.event+ue(j)),re(F.options.event),A.additionalEvent&&re(A.additionalEvent),j>=8&&re(F.options.event+ue(j))},tryEmit:function(A){if(this.canEmit())return this.emit(A);this.state=32},canEmit:function(){for(var A=0;AF.threshold&&Fe&F.direction},attrTest:function(A){return rr.prototype.attrTest.call(this,A)&&(2&this.state||!(2&this.state)&&this.directionTest(A))},emit:function(A){this.pX=A.deltaX,this.pY=A.deltaY;var F=u_(A.direction);F&&(A.additionalEvent=this.options.event+F),this._super.emit.call(this,A)}}),tn(bu,rr,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[$i]},attrTest:function(A){return this._super.attrTest.call(this,A)&&(Math.abs(A.scale-1)>this.options.threshold||2&this.state)},emit:function(A){1!==A.scale&&(A.additionalEvent=this.options.event+(A.scale<1?"in":"out")),this._super.emit.call(this,A)}}),tn(Ih,ja,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return["auto"]},process:function(A){var F=this.options,j=A.pointers.length===F.pointers,re=A.distanceF.time;if(this._input=A,!re||!j||12&A.eventType&&!Fe)this.reset();else if(1&A.eventType)this.reset(),this._timer=ke(function(){this.state=8,this.tryEmit()},F.time,this);else if(4&A.eventType)return 8;return 32},reset:function(){clearTimeout(this._timer)},emit:function(A){8===this.state&&(A&&4&A.eventType?this.manager.emit(this.options.event+"up",A):(this._input.timeStamp=_e(),this.manager.emit(this.options.event,this._input)))}}),tn(Cu,rr,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[$i]},attrTest:function(A){return this._super.attrTest.call(this,A)&&(Math.abs(A.rotation)>this.options.threshold||2&this.state)}}),tn(ua,rr,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:30,pointers:1},getTouchAction:function(){return vc.prototype.getTouchAction.call(this)},attrTest:function(A){var j,F=this.options.direction;return 30&F?j=A.overallVelocity:6&F?j=A.overallVelocityX:24&F&&(j=A.overallVelocityY),this._super.attrTest.call(this,A)&&F&A.offsetDirection&&A.distance>this.options.threshold&&A.maxPointers==this.options.pointers&&we(j)>this.options.velocity&&4&A.eventType},emit:function(A){var F=u_(A.offsetDirection);F&&this.manager.emit(this.options.event+F,A),this.manager.emit(this.options.event,A)}}),tn(Tl,ja,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Hi]},process:function(A){var F=this.options,j=A.pointers.length===F.pointers,re=A.distance"']/g,Vs=RegExp(pd.source),Je=RegExp(mu.source),_u=/<%-([\s\S]+?)%>/g,W=/<%([\s\S]+?)%>/g,Y=/<%=([\s\S]+?)%>/g,J=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,T=/^\w*$/,D=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,B=/[\\^$.*+?()[\]{}|]/g,Z=RegExp(B.source),$=/^\s+/,le=/\s/,he=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,pe=/\{\n\/\* \[wrapped with (.+)\] \*/,Ge=/,? & /,an=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,xn=/[()=,{}\[\]\/\s]/,qt=/\\(\\)?/g,Et=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ln=/\w*$/,ri=/^[-+]0x[0-9a-f]+$/i,Hi=/^0b[01]+$/i,$i=/^\[object .+?Constructor\]$/,_n=/^0o[0-7]+$/i,Ci=/^(?:0|[1-9]\d*)$/,_c=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,fo=/($^)/,gd=/['\n\r\u2028\u2029\\]/g,xl="\\ud800-\\udfff",Gi="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Pn="\\u2700-\\u27bf",vu="a-z\\xdf-\\xf6\\xf8-\\xff",Me="A-Z\\xc0-\\xd6\\xd8-\\xde",rr="\\ufe0e\\ufe0f",vc="\\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",Ih="["+xl+"]",Cu="["+vc+"]",ua="["+Gi+"]",Tl="\\d+",Ua="["+Pn+"]",Sp="["+vu+"]",At="[^"+xl+vc+Tl+Pn+vu+Me+"]",Al="\\ud83c[\\udffb-\\udfff]",da="[^"+xl+"]",md="(?:\\ud83c[\\udde6-\\uddff]){2}",A="[\\ud800-\\udbff][\\udc00-\\udfff]",F="["+Me+"]",j="\\u200d",re="(?:"+Sp+"|"+At+")",Fe="(?:"+F+"|"+At+")",Ue="(?:['\u2019](?:d|ll|m|re|s|t|ve))?",vn="(?:['\u2019](?:D|LL|M|RE|S|T|VE))?",dr="(?:"+ua+"|"+Al+")?",yr="["+rr+"]?",Mx=yr+dr+"(?:"+j+"(?:"+[da,md,A].join("|")+")"+yr+dr+")*",_d="(?:"+[Ua,md,A].join("|")+")"+Mx,mi="(?:"+[da+ua+"?",ua,md,A,Ih].join("|")+")",xp=RegExp("['\u2019]","g"),d_=RegExp(ua,"g"),Ph=RegExp(Al+"(?="+Al+")|"+mi+Mx,"g"),b0=RegExp([F+"?"+Sp+"+"+Ue+"(?="+[Cu,F,"$"].join("|")+")",Fe+"+"+vn+"(?="+[Cu,F+re,"$"].join("|")+")",F+"?"+re+"+"+Ue,F+"+"+vn,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Tl,_d].join("|"),"g"),xx=RegExp("["+j+xl+Gi+rr+"]"),Dl=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Rh=["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"],Tx=-1,Ne={};Ne[uo]=Ne[za]=Ne[Ni]=Ne[us]=Ne[ho]=Ne[gc]=Ne[Sl]=Ne[fu]=Ne[pu]=!0,Ne[cs]=Ne[aa]=Ne[El]=Ne[ci]=Ne[Va]=Ne[pt]=Ne[ki]=Ne[la]=Ne[Fi]=Ne[$r]=Ne[ir]=Ne[Gr]=Ne[Nr]=Ne[ii]=Ne[di]=!1;var Si={};Si[cs]=Si[aa]=Si[El]=Si[Va]=Si[ci]=Si[pt]=Si[uo]=Si[za]=Si[Ni]=Si[us]=Si[ho]=Si[Fi]=Si[$r]=Si[ir]=Si[Gr]=Si[Nr]=Si[ii]=Si[pc]=Si[gc]=Si[Sl]=Si[fu]=Si[pu]=!0,Si[ki]=Si[la]=Si[di]=!1;var Pe={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Ax=parseFloat,S0=parseInt,oe="object"==typeof global&&global&&global.Object===Object&&global,ds="object"==typeof self&&self&&self.Object===Object&&self,Kn=oe||ds||Function("return this")(),Ol=We&&!We.nodeType&&We,ha=Ol&>&&!gt.nodeType&>,po=ha&&ha.exports===Ol,h_=po&&oe.process,Wi=function(){try{return ha&&ha.require&&ha.require("util").types||h_&&h_.binding&&h_.binding("util")}catch(fe){}}(),it=Wi&&Wi.isArrayBuffer,bn=Wi&&Wi.isDate,Oi=Wi&&Wi.isMap,js=Wi&&Wi.isRegExp,bc=Wi&&Wi.isSet,Tr=Wi&&Wi.isTypedArray;function Ar(q,fe,se){switch(se.length){case 0:return q.call(fe);case 1:return q.call(fe,se[0]);case 2:return q.call(fe,se[0],se[1]);case 3:return q.call(fe,se[0],se[1],se[2])}return q.apply(fe,se)}function hr(q,fe,se,lt){for(var Rt=-1,Wn=null==q?0:q.length;++Rt-1}function kh(q,fe,se){for(var lt=-1,Rt=null==q?0:q.length;++lt-1;);return se}function Px(q,fe){for(var se=q.length;se--&&Ha(fe,q[se],0)>-1;);return se}function r2(q,fe){for(var se=q.length,lt=0;se--;)q[se]===fe&&++lt;return lt}var s2=Fo({\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"}),o2=Fo({"&":"&","<":"<",">":">",'"':""","'":"'"});function a2(q){return"\\"+Pe[q]}function Lh(q){return xx.test(q)}function x0(q){var fe=-1,se=Array(q.size);return q.forEach(function(lt,Rt){se[++fe]=[Rt,lt]}),se}function Rx(q,fe){return function(se){return q(fe(se))}}function Eu(q,fe){for(var se=-1,lt=q.length,Rt=0,Wn=[];++se",""":'"',"'":"'"}),Vh=function q(fe){var u,se=(fe=null==fe?Kn:Vh.defaults(Kn.Object(),fe,Vh.pick(Kn,Rh))).Array,lt=fe.Date,Rt=fe.Error,Wn=fe.Function,vr=fe.Math,fi=fe.Object,v_=fe.RegExp,b_=fe.String,ga=fe.TypeError,Ii=se.prototype,Su=fi.prototype,Ap=fe["__core-js_shared__"],qi=Wn.prototype.toString,pi=Su.hasOwnProperty,f2=0,zh=(u=/[^.]+$/.exec(Ap&&Ap.keys&&Ap.keys.IE_PROTO||""))?"Symbol(src)_1."+u:"",Ts=Su.toString,Nx=qi.call(fi),C_=Kn._,Ed=v_("^"+qi.call(pi).replace(B,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),fs=po?fe.Buffer:L,Pl=fe.Symbol,Sd=fe.Uint8Array,D0=fs?fs.allocUnsafe:L,ma=Rx(fi.getPrototypeOf,fi),w_=fi.create,Dp=Su.propertyIsEnumerable,Yt=Ii.splice,Lx=Pl?Pl.isConcatSpreadable:L,jh=Pl?Pl.iterator:L,Mu=Pl?Pl.toStringTag:L,Op=function(){try{var u=Pc(fi,"defineProperty");return u({},"",{}),u}catch(h){}}(),O0=fe.clearTimeout!==Kn.clearTimeout&&fe.clearTimeout,Bx=lt&<.now!==Kn.Date.now&<.now,Vx=fe.setTimeout!==Kn.setTimeout&&fe.setTimeout,Oe=vr.ceil,Dn=vr.floor,en=fi.getOwnPropertySymbols,Dr=fs?fs.isBuffer:L,E_=fe.isFinite,Uh=Ii.join,Ga=Rx(fi.keys,fi),pr=vr.max,Lr=vr.min,p2=lt.now,zx=fe.parseInt,Hh=vr.random,Ip=Ii.reverse,Yr=Pc(fe,"DataView"),Us=Pc(fe,"Map"),Pp=Pc(fe,"Promise"),_a=Pc(fe,"Set"),mo=Pc(fe,"WeakMap"),$h=Pc(fi,"create"),Gh=mo&&new mo,Md={},jx=Lu(Yr),S_=Lu(Us),M_=Lu(Pp),I0=Lu(_a),x_=Lu(mo),Rp=Pl?Pl.prototype:L,xd=Rp?Rp.valueOf:L,Wh=Rp?Rp.toString:L;function O(u){if(Ki(u)&&!Bt(u)&&!(u instanceof Cn)){if(u instanceof _o)return u;if(pi.call(u,"__wrapped__"))return Ud(u)}return new _o(u)}var xu=function(){function u(){}return function(h){if(!Xi(h))return{};if(w_)return w_(h);u.prototype=h;var m=new u;return u.prototype=L,m}}();function qh(){}function _o(u,h){this.__wrapped__=u,this.__actions__=[],this.__chain__=!!h,this.__index__=0,this.__values__=L}function Cn(u){this.__wrapped__=u,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=jt,this.__views__=[]}function Hs(u){var h=-1,m=null==u?0:u.length;for(this.clear();++h=h?u:h)),u}function ps(u,h,m,b,M,P){var z,H=1&h,X=2&h,be=4&h;if(m&&(z=M?m(u,b,M,P):m(u)),z!==L)return z;if(!Xi(u))return u;var Ce=Bt(u);if(Ce){if(z=function(u){var h=u.length,m=new u.constructor(h);return h&&"string"==typeof u[0]&&pi.call(u,"index")&&(m.index=u.index,m.input=u.input),m}(u),!H)return Ds(u,z)}else{var Re=ms(u),et=Re==la||Re==La;if(nl(u))return Wp(u,H);if(Re==ir||Re==cs||et&&!M){if(z=X||et?{}:rC(u),!H)return X?function(u,h){return Ca(u,tC(u),h)}(u,function(u,h){return u&&Ca(h,Is(h),u)}(z,u)):function(u,h){return Ca(u,Y_(u),h)}(u,Zx(z,u))}else{if(!Si[Re])return M?u:{};z=function(u,h,m){var b=u.constructor;switch(h){case El:return Ru(u);case ci:case pt:return new b(+u);case Va:return function(u,h){var m=h?Ru(u.buffer):u.buffer;return new u.constructor(m,u.byteOffset,u.byteLength)}(u,m);case uo:case za:case Ni:case us:case ho:case gc:case Sl:case fu:case pu:return H_(u,m);case Fi:return new b;case $r:case ii:return new b(u);case Gr:return function(u){var h=new u.constructor(u.source,ln.exec(u));return h.lastIndex=u.lastIndex,h}(u);case Nr:return new b;case pc:return function(u){return xd?fi(xd.call(u)):{}}(u)}}(u,Re,H)}}P||(P=new va);var St=P.get(u);if(St)return St;P.set(u,z),gT(u)?u.forEach(function(Xt){z.add(ps(Xt,h,m,Xt,u,P))}):dT(u)&&u.forEach(function(Xt,Sn){z.set(Sn,ps(Xt,h,m,Sn,u,P))});var En=Ce?L:(be?X?W_:Bl:X?Is:es)(u);return hs(En||u,function(Xt,Sn){En&&(Xt=u[Sn=Xt]),qa(z,Sn,ps(Xt,h,m,Sn,u,P))}),z}function Vp(u,h,m){var b=m.length;if(null==u)return!b;for(u=fi(u);b--;){var M=m[b],z=u[M];if(z===L&&!(M in u)||!(0,h[M])(z))return!1}return!0}function Kh(u,h,m){if("function"!=typeof u)throw new ga(ft);return rf(function(){u.apply(L,m)},h)}function Sc(u,h,m,b){var M=-1,P=Il,z=!0,H=u.length,X=[],be=h.length;if(!H)return X;m&&(h=hi(h,Lo(m))),b?(P=kh,z=!1):h.length>=200&&(P=Nh,z=!1,h=new ya(h));e:for(;++M-1},Rl.prototype.set=function(u,h){var m=this.__data__,b=Ad(m,u);return b<0?(++this.size,m.push([u,h])):m[b][1]=h,this},Wa.prototype.clear=function(){this.size=0,this.__data__={hash:new Hs,map:new(Us||Rl),string:new Hs}},Wa.prototype.delete=function(u){var h=gs(this,u).delete(u);return this.size-=h?1:0,h},Wa.prototype.get=function(u){return gs(this,u).get(u)},Wa.prototype.has=function(u){return gs(this,u).has(u)},Wa.prototype.set=function(u,h){var m=gs(this,u),b=m.size;return m.set(u,h),this.size+=m.size==b?0:1,this},ya.prototype.add=ya.prototype.push=function(u){return this.__data__.set(u,Tt),this},ya.prototype.has=function(u){return this.__data__.has(u)},va.prototype.clear=function(){this.__data__=new Rl,this.size=0},va.prototype.delete=function(u){var h=this.__data__,m=h.delete(u);return this.size=h.size,m},va.prototype.get=function(u){return this.__data__.get(u)},va.prototype.has=function(u){return this.__data__.has(u)},va.prototype.set=function(u,h){var m=this.__data__;if(m instanceof Rl){var b=m.__data__;if(!Us||b.length<199)return b.push([u,h]),this.size=++m.size,this;m=this.__data__=new Wa(b)}return m.set(u,h),this.size=m.size,this};var Mc=Za(Xa),k_=Za(zp,!0);function L0(u,h){var m=!0;return Mc(u,function(b,M,P){return m=!!h(b,M,P)}),m}function Zh(u,h,m){for(var b=-1,M=u.length;++b0&&m(H)?h>1?Xr(H,h-1,m,b,M):fr(M,H):b||(M[M.length]=H)}return M}var Dd=W0(),Od=W0(!0);function Xa(u,h){return u&&Dd(u,h,es)}function zp(u,h){return u&&Od(u,h,es)}function Qh(u,h){return fa(h,function(m){return Wo(u[m])})}function Bo(u,h){for(var m=0,b=(h=Dc(h,u)).length;null!=u&&mh}function Id(u,h){return null!=u&&pi.call(u,h)}function Pd(u,h){return null!=u&&h in fi(u)}function Au(u,h,m){for(var b=m?kh:Il,M=u[0].length,P=u.length,z=P,H=se(P),X=1/0,be=[];z--;){var Ce=u[z];z&&h&&(Ce=hi(Ce,Lo(h))),X=Lr(Ce.length,X),H[z]=!m&&(h||M>=120&&Ce.length>=120)?new ya(z&&Ce):L}Ce=u[0];var Re=-1,et=H[0];e:for(;++Re=H?X:X*("desc"==m[b]?-1:1)}return u.index-h.index}(P,z,m)});se--;)q[se]=q[se].value;return q}(n1(u,function(P,z,H){return{criteria:hi(h,function(be){return be(P)}),index:++b,value:P}}))}function U0(u,h,m){for(var b=-1,M=h.length,P={};++b-1;)H!==u&&Yt.call(H,X,1),Yt.call(u,X,1);return u}function ef(u,h){for(var m=u?h.length:0,b=m-1;m--;){var M=h[m];if(m==b||M!==P){var P=M;bo(M)?Yt.call(u,M,1):Ou(u,M)}}return u}function kl(u,h){return u+Dn(Hh()*(h-u+1))}function Up(u,h){var m="";if(!u||h<1||h>Gn)return m;do{h%2&&(m+=u),(h=Dn(h/2))&&(u+=u)}while(h);return m}function wn(u,h){return ng(y1(u,h,Ps),u+"")}function r1(u){return O_(Zd(u))}function E2(u,h){var m=Zd(u);return jd(m,Tu(h,0,m.length))}function Hp(u,h,m,b){if(!Xi(u))return u;for(var M=-1,P=(h=Dc(h,u)).length,z=P-1,H=u;null!=H&&++MM?0:M+h),(m=m>M?M:m)<0&&(m+=M),M=h>m?0:m-h>>>0,h>>>=0;for(var P=se(M);++b>>1,z=u[P];null!==z&&!qo(z)&&(m?z<=h:z=200){var be=h?null:G_(u);if(be)return m_(be);z=!1,M=Nh,X=new ya}else X=h?[]:H;e:for(;++b=b?u:Qr(u,h,m)}var a1=O0||function(u){return Kn.clearTimeout(u)};function Wp(u,h){if(h)return u.slice();var m=u.length,b=D0?D0(m):new u.constructor(m);return u.copy(b),b}function Ru(u){var h=new u.constructor(u.byteLength);return new Sd(h).set(new Sd(u)),h}function H_(u,h){var m=h?Ru(u.buffer):u.buffer;return new u.constructor(m,u.byteOffset,u.length)}function Oc(u,h){if(u!==h){var m=u!==L,b=null===u,M=u==u,P=qo(u),z=h!==L,H=null===h,X=h==h,be=qo(h);if(!H&&!be&&!P&&u>h||P&&z&&X&&!H&&!be||b&&z&&X||!m&&X||!M)return 1;if(!b&&!P&&!be&&u1?m[M-1]:L,z=M>2?m[2]:L;for(P=u.length>3&&"function"==typeof P?(M--,P):L,z&&_s(m[0],m[1],z)&&(P=M<3?L:P,M=1),h=fi(h);++b-1?M[P?h[z]:z]:L}}function Fu(u){return Qa(function(h){var m=h.length,b=m,M=_o.prototype.thru;for(u&&h.reverse();b--;){var P=h[b];if("function"!=typeof P)throw new ga(ft);if(M&&!z&&"wrapper"==Jp(P))var z=new _o([],!0)}for(b=z?b:m;++b1&&Bn.reverse(),Ce&&XH))return!1;var be=P.get(u),Ce=P.get(h);if(be&&Ce)return be==h&&Ce==u;var Re=-1,et=!0,St=2&m?new ya:L;for(P.set(u,h),P.set(h,u);++Re-1&&u%1==0&&u1?"& ":"")+h[b],h=h.join(m>2?", ":" "),u.replace(he,"{\n/* [wrapped with "+h+"] */\n")}(b,function(u,h){return hs(Dh,function(m){var b="_."+m[0];h&m[1]&&!Il(u,b)&&u.push(b)}),u.sort()}(function(u){var h=u.match(pe);return h?h[1].split(Ge):[]}(b),m)))}function ey(u){var h=0,m=0;return function(){var b=p2(),M=16-(b-m);if(m=b,M>0){if(++h>=800)return arguments[0]}else h=0;return u.apply(L,arguments)}}function jd(u,h){var m=-1,b=u.length,M=b-1;for(h=h===L?b:h;++m1?u[h-1]:L;return m="function"==typeof m?(u.pop(),m):L,j1(u,m)});function dy(u){var h=O(u);return h.__chain__=!0,h}function $d(u,h){return h(u)}var hy=Qa(function(u){var h=u.length,m=h?u[0]:0,b=this.__wrapped__,M=function(P){return P_(P,u)};return!(h>1||this.__actions__.length)&&b instanceof Cn&&bo(m)?((b=b.slice(m,+m+(h?1:0))).__actions__.push({func:$d,args:[M],thisArg:L}),new _o(b,this.__chain__).thru(function(P){return h&&!P.length&&P.push(L),P})):this.thru(M)}),$1=br(function(u,h,m){pi.call(u,m)?++u[m]:Ya(u,m,1)}),q1=Y0(ny),Y1=Y0(iy);function my(u,h){return(Bt(u)?hs:Mc)(u,Ut(h,3))}function og(u,h){return(Bt(u)?yd:k_)(u,Ut(h,3))}var K1=br(function(u,h,m){pi.call(u,m)?u[m].push(h):Ya(u,m,[h])}),xC=wn(function(u,h,m){var b=-1,M="function"==typeof h,P=$s(u)?se(u.length):[];return Mc(u,function(z){P[++b]=M?Ar(h,z,m):ba(z,h,m)}),P}),TC=br(function(u,h,m){Ya(u,m,h)});function el(u,h){return(Bt(u)?hi:n1)(u,Ut(h,3))}var DC=br(function(u,h,m){u[m?0:1].push(h)},function(){return[[],[]]}),lg=wn(function(u,h){if(null==u)return[];var m=h.length;return m>1&&_s(u,h[0],h[1])?h=[]:m>2&&_s(h[0],h[1],h[2])&&(h=[h[0]]),Jh(u,Xr(h,1),[])}),Bu=Bx||function(){return Kn.Date.now()};function cg(u,h,m){return h=m?L:h,Ll(u,128,L,L,L,L,h=u&&null==h?u.length:h)}function yy(u,h){var m;if("function"!=typeof h)throw new ga(ft);return u=hn(u),function(){return--u>0&&(m=h.apply(this,arguments)),u<=1&&(h=L),m}}var cf=wn(function(u,h,m){var b=1;if(m.length){var M=Eu(m,zd(cf));b|=32}return Ll(u,b,h,m,M)}),Wd=wn(function(u,h,m){var b=3;if(m.length){var M=Eu(m,zd(Wd));b|=32}return Ll(h,b,u,m,M)});function NC(u,h,m){var b,M,P,z,H,X,be=0,Ce=!1,Re=!1,et=!0;if("function"!=typeof u)throw new ga(ft);function St(Qn){var sl=b,Lc=M;return b=M=L,be=Qn,z=u.apply(Lc,sl)}function Wt(Qn){return be=Qn,H=rf(Sn,h),Ce?St(Qn):z}function Xt(Qn){var sl=Qn-X;return X===L||sl>=h||sl<0||Re&&Qn-be>=P}function Sn(){var Qn=Bu();if(Xt(Qn))return Bn(Qn);H=rf(Sn,function(Qn){var sA=h-(Qn-X);return Re?Lr(sA,P-(Qn-be)):sA}(Qn))}function Bn(Qn){return H=L,et&&b?St(Qn):(b=M=L,z)}function Yo(){var Qn=Bu(),sl=Xt(Qn);if(b=arguments,M=this,X=Qn,sl){if(H===L)return Wt(X);if(Re)return a1(H),H=rf(Sn,h),St(X)}return H===L&&(H=rf(Sn,h)),z}return h=Gs(h)||0,Xi(m)&&(Ce=!!m.leading,P=(Re="maxWait"in m)?pr(Gs(m.maxWait)||0,h):P,et="trailing"in m?!!m.trailing:et),Yo.cancel=function(){H!==L&&a1(H),be=0,b=X=M=H=L},Yo.flush=function(){return H===L?z:Bn(Bu())},Yo}var eT=wn(function(u,h){return Kh(u,1,h)}),LC=wn(function(u,h,m){return Kh(u,Gs(h)||0,m)});function uf(u,h){if("function"!=typeof u||null!=h&&"function"!=typeof h)throw new ga(ft);var m=function(){var b=arguments,M=h?h.apply(this,b):b[0],P=m.cache;if(P.has(M))return P.get(M);var z=u.apply(this,b);return m.cache=P.set(M,z)||P,z};return m.cache=new(uf.Cache||Wa),m}function Cy(u){if("function"!=typeof u)throw new ga(ft);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)}}uf.Cache=Wa;var tT=o1(function(u,h){var m=(h=1==h.length&&Bt(h[0])?hi(h[0],Lo(Ut())):hi(Xr(h,1),Lo(Ut()))).length;return wn(function(b){for(var M=-1,P=Lr(b.length,m);++M=h}),tl=Qx(function(){return arguments}())?Qx:function(u){return Ki(u)&&pi.call(u,"callee")&&!Dp.call(u,"callee")},Bt=se.isArray,HC=it?Lo(it):function(u){return Ki(u)&&Kr(u)==El};function $s(u){return null!=u&&Ey(u.length)&&!Wo(u)}function Yi(u){return Ki(u)&&$s(u)}var nl=Dr||Wy,$C=bn?Lo(bn):function(u){return Ki(u)&&Kr(u)==pt};function Ea(u){if(!Ki(u))return!1;var h=Kr(u);return h==ki||"[object DOMException]"==h||"string"==typeof u.message&&"string"==typeof u.name&&!fg(u)}function Wo(u){if(!Xi(u))return!1;var h=Kr(u);return h==la||h==La||"[object AsyncFunction]"==h||"[object Proxy]"==h}function hg(u){return"number"==typeof u&&u==hn(u)}function Ey(u){return"number"==typeof u&&u>-1&&u%1==0&&u<=Gn}function Xi(u){var h=typeof u;return null!=u&&("object"==h||"function"==h)}function Ki(u){return null!=u&&"object"==typeof u}var dT=Oi?Lo(Oi):function(u){return Ki(u)&&ms(u)==Fi};function pT(u){return"number"==typeof u||Ki(u)&&Kr(u)==$r}function fg(u){if(!Ki(u)||Kr(u)!=ir)return!1;var h=ma(u);if(null===h)return!0;var m=pi.call(h,"constructor")&&h.constructor;return"function"==typeof m&&m instanceof m&&qi.call(m)==Nx}var YC=js?Lo(js):function(u){return Ki(u)&&Kr(u)==Gr},gT=bc?Lo(bc):function(u){return Ki(u)&&ms(u)==Nr};function My(u){return"string"==typeof u||!Bt(u)&&Ki(u)&&Kr(u)==ii}function qo(u){return"symbol"==typeof u||Ki(u)&&Kr(u)==pc}var df=Tr?Lo(Tr):function(u){return Ki(u)&&Ey(u.length)&&!!Ne[Kr(u)]},Rc=Kp(j0),xy=Kp(function(u,h){return u<=h});function XC(u){if(!u)return[];if($s(u))return My(u)?$a(u):Ds(u);if(jh&&u[jh])return function(q){for(var fe,se=[];!(fe=q.next()).done;)se.push(fe.value);return se}(u[jh]());var h=ms(u);return(h==Fi?x0:h==Nr?m_:Zd)(u)}function il(u){return u?(u=Gs(u))===pn||u===-pn?17976931348623157e292*(u<0?-1:1):u==u?u:0:0===u?u:0}function hn(u){var h=il(u),m=h%1;return h==h?m?h-m:h:0}function Ty(u){return u?Tu(hn(u),0,jt):0}function Gs(u){if("number"==typeof u)return u;if(qo(u))return NaN;if(Xi(u)){var h="function"==typeof u.valueOf?u.valueOf():u;u=Xi(h)?h+"":h}if("string"!=typeof u)return 0===u?u:+u;u=M0(u);var m=Hi.test(u);return m||_n.test(u)?S0(u.slice(2),m?2:8):ri.test(u)?NaN:+u}function KC(u){return Ca(u,Is(u))}function Zn(u){return null==u?"":vo(u)}var mT=Fl(function(u,h){if(tg(h)||$s(h))Ca(h,es(h),u);else for(var m in h)pi.call(h,m)&&qa(u,m,h[m])}),_T=Fl(function(u,h){Ca(h,Is(h),u)}),qd=Fl(function(u,h,m,b){Ca(h,Is(h),u,b)}),yT=Fl(function(u,h,m,b){Ca(h,es(h),u,b)}),ZC=Qa(P_),bT=wn(function(u,h){u=fi(u);var m=-1,b=h.length,M=b>2?h[2]:L;for(M&&_s(h[0],h[1],M)&&(b=1);++m1),P}),Ca(u,W_(u),m),b&&(m=ps(m,7,Zp));for(var M=h.length;M--;)Ou(m,h[M]);return m}),MT=Qa(function(u,h){return null==u?{}:function(u,h){return U0(u,h,function(m,b){return pg(u,b)})}(u,h)});function rw(u,h){if(null==u)return{};var m=hi(W_(u),function(b){return[b]});return h=Ut(h),U0(u,m,function(b,M){return h(b,M[0])})}var xT=Nu(es),ow=Nu(Is);function Zd(u){return null==u?[]:g_(u,es(u))}var IT=Nl(function(u,h,m){return h=h.toLowerCase(),u+(m?Iy(h):h)});function Iy(u){return _g(Zn(u).toLowerCase())}function Py(u){return(u=Zn(u))&&u.replace(_c,s2).replace(d_,"")}var RT=Nl(function(u,h,m){return u+(m?"-":"")+h.toLowerCase()}),kT=Nl(function(u,h,m){return u+(m?" ":"")+h.toLowerCase()}),$2=qp("toLowerCase"),VT=Nl(function(u,h,m){return u+(m?"_":"")+h.toLowerCase()}),Fy=Nl(function(u,h,m){return u+(m?" ":"")+_g(h)}),hw=Nl(function(u,h,m){return u+(m?" ":"")+h.toUpperCase()}),_g=qp("toUpperCase");function Vy(u,h,m){return u=Zn(u),(h=m?L:h)===L?function(q){return Dl.test(q)}(u)?function(q){return q.match(b0)||[]}(u):function(q){return q.match(an)||[]}(u):u.match(h)||[]}var zy=wn(function(u,h){try{return Ar(u,L,h)}catch(m){return Ea(m)?m:new Rt(m)}}),fw=Qa(function(u,h){return hs(h,function(m){m=mn(m),Ya(u,m,cf(u[m],u))}),u});function jy(u){return function(){return u}}var W2=Fu(),Fc=Fu(!0);function Ps(u){return u}function Vu(u){return t1("function"==typeof u?u:ps(u,1))}var Uy=wn(function(u,h){return function(m){return ba(m,u,h)}}),pw=wn(function(u,h){return function(m){return ba(u,m,h)}});function Hy(u,h,m){var b=es(h),M=Qh(h,b);null==m&&(!Xi(h)||!M.length&&b.length)&&(m=h,h=u,u=this,M=Qh(h,es(h)));var P=!(Xi(m)&&"chain"in m&&!m.chain),z=Wo(u);return hs(M,function(H){var X=h[H];u[H]=X,z&&(u.prototype[H]=function(){var be=this.__chain__;if(P||be){var Ce=u(this.__wrapped__),Re=Ce.__actions__=Ds(this.__actions__);return Re.push({func:X,args:arguments,thisArg:u}),Ce.__chain__=be,Ce}return X.apply(u,fr([this.value()],arguments))})}),u}function $y(){}var WT=Yp(hi),qT=Yp(gn),mw=Yp(go);function zu(u){return Uo(u)?f_(mn(u)):function(u){return function(h){return Bo(h,u)}}(u)}var XT=K0(),KT=K0(!0);function Nc(){return[]}function Wy(){return!1}var Nt=$_(function(u,h){return u+h},0),qy=Vd("ceil"),Y2=$_(function(u,h){return u/h},1),jl=Vd("floor"),bw=$_(function(u,h){return u*h},1),Cw=Vd("round"),ww=$_(function(u,h){return u-h},0);return O.after=function(u,h){if("function"!=typeof h)throw new ga(ft);return u=hn(u),function(){if(--u<1)return h.apply(this,arguments)}},O.ary=cg,O.assign=mT,O.assignIn=_T,O.assignInWith=qd,O.assignWith=yT,O.at=ZC,O.before=yy,O.bind=cf,O.bindAll=fw,O.bindKey=Wd,O.castArray=function(){if(!arguments.length)return[];var u=arguments[0];return Bt(u)?u:[u]},O.chain=dy,O.chunk=function(u,h,m){h=(m?_s(u,h,m):h===L)?1:pr(hn(h),0);var b=null==u?0:u.length;if(!b||h<1)return[];for(var M=0,P=0,z=se(Oe(b/h));MM?0:M+m),(b=b===L||b>M?M:hn(b))<0&&(b+=M),b=m>b?0:Ty(b);m>>0)?(u=Zn(u))&&("string"==typeof h||null!=h&&!YC(h))&&!(h=vo(h))&&Lh(u)?Ka($a(u),0,m):u.split(h,m):[]},O.spread=function(u,h){if("function"!=typeof u)throw new ga(ft);return h=null==h?0:pr(hn(h),0),wn(function(m){var b=m[h],M=Ka(m,0,h);return b&&fr(M,b),Ar(u,this,M)})},O.tail=function(u){var h=null==u?0:u.length;return h?Qr(u,1,h):[]},O.take=function(u,h,m){return u&&u.length?Qr(u,0,(h=m||h===L?1:hn(h))<0?0:h):[]},O.takeRight=function(u,h,m){var b=null==u?0:u.length;return b?Qr(u,(h=b-(h=m||h===L?1:hn(h)))<0?0:h,b):[]},O.takeRightWhile=function(u,h){return u&&u.length?Iu(u,Ut(h,3),!1,!0):[]},O.takeWhile=function(u,h){return u&&u.length?Iu(u,Ut(h,3)):[]},O.tap=function(u,h){return h(u),u},O.throttle=function(u,h,m){var b=!0,M=!0;if("function"!=typeof u)throw new ga(ft);return Xi(m)&&(b="leading"in m?!!m.leading:b,M="trailing"in m?!!m.trailing:M),NC(u,h,{leading:b,maxWait:h,trailing:M})},O.thru=$d,O.toArray=XC,O.toPairs=xT,O.toPairsIn=ow,O.toPath=function(u){return Bt(u)?hi(u,mn):qo(u)?[u]:Ds(lC(Zn(u)))},O.toPlainObject=KC,O.transform=function(u,h,m){var b=Bt(u),M=b||nl(u)||df(u);if(h=Ut(h,4),null==m){var P=u&&u.constructor;m=M?b?new P:[]:Xi(u)&&Wo(P)?xu(ma(u)):{}}return(M?hs:Xa)(u,function(z,H,X){return h(m,z,H,X)}),m},O.unary=function(u){return cg(u,1)},O.union=yC,O.unionBy=ly,O.unionWith=sg,O.uniq=function(u){return u&&u.length?Tc(u):[]},O.uniqBy=function(u,h){return u&&u.length?Tc(u,Ut(h,2)):[]},O.uniqWith=function(u,h){return h="function"==typeof h?h:L,u&&u.length?Tc(u,L,h):[]},O.unset=function(u,h){return null==u||Ou(u,h)},O.unzip=vC,O.unzipWith=j1,O.update=function(u,h,m){return null==u?u:$p(u,h,U_(m))},O.updateWith=function(u,h,m,b){return b="function"==typeof b?b:L,null==u?u:$p(u,h,U_(m),b)},O.values=Zd,O.valuesIn=function(u){return null==u?[]:g_(u,Is(u))},O.without=bC,O.words=Vy,O.wrap=function(u,h){return ug(U_(h),u)},O.xor=R2,O.xorBy=Co,O.xorWith=cy,O.zip=uy,O.zipObject=function(u,h){return Gp(u||[],h||[],qa)},O.zipObjectDeep=function(u,h){return Gp(u||[],h||[],Hp)},O.zipWith=lf,O.entries=xT,O.entriesIn=ow,O.extend=_T,O.extendWith=qd,Hy(O,O),O.add=Nt,O.attempt=zy,O.camelCase=IT,O.capitalize=Iy,O.ceil=qy,O.clamp=function(u,h,m){return m===L&&(m=h,h=L),m!==L&&(m=(m=Gs(m))==m?m:0),h!==L&&(h=(h=Gs(h))==h?h:0),Tu(Gs(u),h,m)},O.clone=function(u){return ps(u,4)},O.cloneDeep=function(u){return ps(u,5)},O.cloneDeepWith=function(u,h){return ps(u,5,h="function"==typeof h?h:L)},O.cloneWith=function(u,h){return ps(u,4,h="function"==typeof h?h:L)},O.conformsTo=function(u,h){return null==h||Vp(u,h,es(h))},O.deburr=Py,O.defaultTo=function(u,h){return null==u||u!=u?h:u},O.divide=Y2,O.endsWith=function(u,h,m){u=Zn(u),h=vo(h);var b=u.length,M=m=m===L?b:Tu(hn(m),0,b);return(m-=h.length)>=0&&u.slice(m,M)==h},O.eq=kt,O.escape=function(u){return(u=Zn(u))&&Je.test(u)?u.replace(mu,o2):u},O.escapeRegExp=function(u){return(u=Zn(u))&&Z.test(u)?u.replace(B,"\\$&"):u},O.every=function(u,h,m){var b=Bt(u)?gn:L0;return m&&_s(u,h,m)&&(h=L),b(u,Ut(h,3))},O.find=q1,O.findIndex=ny,O.findKey=function(u,h){return Fh(u,Ut(h,3),Xa)},O.findLast=Y1,O.findLastIndex=iy,O.findLastKey=function(u,h){return Fh(u,Ut(h,3),zp)},O.floor=jl,O.forEach=my,O.forEachRight=og,O.forIn=function(u,h){return null==u?u:Dd(u,Ut(h,3),Is)},O.forInRight=function(u,h){return null==u?u:Od(u,Ut(h,3),Is)},O.forOwn=function(u,h){return u&&Xa(u,Ut(h,3))},O.forOwnRight=function(u,h){return u&&zp(u,Ut(h,3))},O.get=pf,O.gt=G,O.gte=UC,O.has=function(u,h){return null!=u&&iC(u,h,Id)},O.hasIn=pg,O.head=uC,O.identity=Ps,O.includes=function(u,h,m,b){u=$s(u)?u:Zd(u),m=m&&!b?hn(m):0;var M=u.length;return m<0&&(m=pr(M+m,0)),My(u)?m<=M&&u.indexOf(h,m)>-1:!!M&&Ha(u,h,m)>-1},O.indexOf=function(u,h,m){var b=null==u?0:u.length;if(!b)return-1;var M=null==m?0:hn(m);return M<0&&(M=pr(b+M,0)),Ha(u,h,M)},O.inRange=function(u,h,m){return h=il(h),m===L?(m=h,h=0):m=il(m),function(u,h,m){return u>=Lr(h,m)&&u=-Gn&&u<=Gn},O.isSet=gT,O.isString=My,O.isSymbol=qo,O.isTypedArray=df,O.isUndefined=function(u){return u===L},O.isWeakMap=function(u){return Ki(u)&&ms(u)==di},O.isWeakSet=function(u){return Ki(u)&&"[object WeakSet]"==Kr(u)},O.join=function(u,h){return null==u?"":Uh.call(u,h)},O.kebabCase=RT,O.last=Ho,O.lastIndexOf=function(u,h,m){var b=null==u?0:u.length;if(!b)return-1;var M=b;return m!==L&&(M=(M=hn(m))<0?pr(b+M,0):Lr(M,b-1)),h==h?function(q,fe,se){for(var lt=se+1;lt--;)if(q[lt]===fe)return lt;return lt}(u,h,M):bd(u,Cc,M,!0)},O.lowerCase=kT,O.lowerFirst=$2,O.lt=Rc,O.lte=xy,O.max=function(u){return u&&u.length?Zh(u,Ps,Zr):L},O.maxBy=function(u,h){return u&&u.length?Zh(u,Ut(h,2),Zr):L},O.mean=function(u){return qr(u,Ps)},O.meanBy=function(u,h){return qr(u,Ut(h,2))},O.min=function(u){return u&&u.length?Zh(u,Ps,j0):L},O.minBy=function(u,h){return u&&u.length?Zh(u,Ut(h,2),j0):L},O.stubArray=Nc,O.stubFalse=Wy,O.stubObject=function(){return{}},O.stubString=function(){return""},O.stubTrue=function(){return!0},O.multiply=bw,O.nth=function(u,h){return u&&u.length?Du(u,hn(h)):L},O.noConflict=function(){return Kn._===this&&(Kn._=C_),this},O.noop=$y,O.now=Bu,O.pad=function(u,h,m){u=Zn(u);var b=(h=hn(h))?Bh(u):0;if(!h||b>=h)return u;var M=(h-b)/2;return Xp(Dn(M),m)+u+Xp(Oe(M),m)},O.padEnd=function(u,h,m){u=Zn(u);var b=(h=hn(h))?Bh(u):0;return h&&bh){var b=u;u=h,h=b}if(m||u%1||h%1){var M=Hh();return Lr(u+M*(h-u+Ax("1e-"+((M+"").length-1))),h)}return kl(u,h)},O.reduce=function(u,h,m){var b=Bt(u)?wu:No,M=arguments.length<3;return b(u,Ut(h,4),m,M,Mc)},O.reduceRight=function(u,h,m){var b=Bt(u)?vd:No,M=arguments.length<3;return b(u,Ut(h,4),m,M,k_)},O.repeat=function(u,h,m){return h=(m?_s(u,h,m):h===L)?1:hn(h),Up(Zn(u),h)},O.replace=function(){var u=arguments,h=Zn(u[0]);return u.length<3?h:h.replace(u[1],u[2])},O.result=function(u,h,m){var b=-1,M=(h=Dc(h,u)).length;for(M||(M=1,u=L);++bGn)return[];var m=jt,b=Lr(u,jt);h=Ut(h),u-=jt;for(var M=wd(b,h);++m=P)return u;var H=m-Bh(b);if(H<1)return b;var X=z?Ka(z,0,H).join(""):u.slice(0,H);if(M===L)return X+b;if(z&&(H+=X.length-H),YC(M)){if(u.slice(H).search(M)){var be,Ce=X;for(M.global||(M=v_(M.source,Zn(ln.exec(M))+"g")),M.lastIndex=0;be=M.exec(Ce);)var Re=be.index;X=X.slice(0,Re===L?H:Re)}}else if(u.indexOf(vo(M),H)!=H){var et=X.lastIndexOf(M);et>-1&&(X=X.slice(0,et))}return X+b},O.unescape=function(u){return(u=Zn(u))&&Vs.test(u)?u.replace(pd,y_):u},O.uniqueId=function(u){var h=++f2;return Zn(u)+h},O.upperCase=hw,O.upperFirst=_g,O.each=my,O.eachRight=og,O.first=uC,Hy(O,function(){var u={};return Xa(O,function(h,m){pi.call(O.prototype,m)||(u[m]=h)}),u}(),{chain:!1}),O.VERSION="4.17.21",hs(["bind","bindKey","curry","curryRight","partial","partialRight"],function(u){O[u].placeholder=O}),hs(["drop","take"],function(u,h){Cn.prototype[u]=function(m){m=m===L?1:pr(hn(m),0);var b=this.__filtered__&&!h?new Cn(this):this.clone();return b.__filtered__?b.__takeCount__=Lr(m,b.__takeCount__):b.__views__.push({size:Lr(m,jt),type:u+(b.__dir__<0?"Right":"")}),b},Cn.prototype[u+"Right"]=function(m){return this.reverse()[u](m).reverse()}}),hs(["filter","map","takeWhile"],function(u,h){var m=h+1,b=1==m||3==m;Cn.prototype[u]=function(M){var P=this.clone();return P.__iteratees__.push({iteratee:Ut(M,3),type:m}),P.__filtered__=P.__filtered__||b,P}}),hs(["head","last"],function(u,h){var m="take"+(h?"Right":"");Cn.prototype[u]=function(){return this[m](1).value()[0]}}),hs(["initial","tail"],function(u,h){var m="drop"+(h?"":"Right");Cn.prototype[u]=function(){return this.__filtered__?new Cn(this):this[m](1)}}),Cn.prototype.compact=function(){return this.filter(Ps)},Cn.prototype.find=function(u){return this.filter(u).head()},Cn.prototype.findLast=function(u){return this.reverse().find(u)},Cn.prototype.invokeMap=wn(function(u,h){return"function"==typeof u?new Cn(this):this.map(function(m){return ba(m,u,h)})}),Cn.prototype.reject=function(u){return this.filter(Cy(Ut(u)))},Cn.prototype.slice=function(u,h){u=hn(u);var m=this;return m.__filtered__&&(u>0||h<0)?new Cn(m):(u<0?m=m.takeRight(-u):u&&(m=m.drop(u)),h!==L&&(m=(h=hn(h))<0?m.dropRight(-h):m.take(h-u)),m)},Cn.prototype.takeRightWhile=function(u){return this.reverse().takeWhile(u).reverse()},Cn.prototype.toArray=function(){return this.take(jt)},Xa(Cn.prototype,function(u,h){var m=/^(?:filter|find|map|reject)|While$/.test(h),b=/^(?:head|last)$/.test(h),M=O[b?"take"+("last"==h?"Right":""):h],P=b||/^find/.test(h);!M||(O.prototype[h]=function(){var z=this.__wrapped__,H=b?[1]:arguments,X=z instanceof Cn,be=H[0],Ce=X||Bt(z),Re=function(Sn){var Bn=M.apply(O,fr([Sn],H));return b&&et?Bn[0]:Bn};Ce&&m&&"function"==typeof be&&1!=be.length&&(X=Ce=!1);var et=this.__chain__,St=!!this.__actions__.length,Wt=P&&!et,En=X&&!St;if(!P&&Ce){z=En?z:new Cn(this);var Xt=u.apply(z,H);return Xt.__actions__.push({func:$d,args:[Re],thisArg:L}),new _o(Xt,et)}return Wt&&En?u.apply(this,H):(Xt=this.thru(Re),Wt?b?Xt.value()[0]:Xt.value():Xt)})}),hs(["pop","push","shift","sort","splice","unshift"],function(u){var h=Ii[u],m=/^(?:push|sort|unshift)$/.test(u)?"tap":"thru",b=/^(?:pop|shift)$/.test(u);O.prototype[u]=function(){var M=arguments;if(b&&!this.__chain__){var P=this.value();return h.apply(Bt(P)?P:[],M)}return this[m](function(z){return h.apply(Bt(z)?z:[],M)})}}),Xa(Cn.prototype,function(u,h){var m=O[h];if(m){var b=m.name+"";pi.call(Md,b)||(Md[b]=[]),Md[b].push({name:h,func:m})}}),Md[Ic(L,2).name]=[{name:"wrapper",func:L}],Cn.prototype.clone=function(){var u=new Cn(this.__wrapped__);return u.__actions__=Ds(this.__actions__),u.__dir__=this.__dir__,u.__filtered__=this.__filtered__,u.__iteratees__=Ds(this.__iteratees__),u.__takeCount__=this.__takeCount__,u.__views__=Ds(this.__views__),u},Cn.prototype.reverse=function(){if(this.__filtered__){var u=new Cn(this);u.__dir__=-1,u.__filtered__=!0}else(u=this.clone()).__dir__*=-1;return u},Cn.prototype.value=function(){var u=this.__wrapped__.value(),h=this.__dir__,m=Bt(u),b=h<0,M=m?u.length:0,P=function(u,h,m){for(var b=-1,M=m.length;++b=this.__values__.length;return{done:u,value:u?L:this.__values__[this.__index__++]}},O.prototype.plant=function(u){for(var h,m=this;m instanceof qh;){var b=Ud(m);b.__index__=0,b.__values__=L,h?M.__wrapped__=b:h=b;var M=b;m=m.__wrapped__}return M.__wrapped__=u,h},O.prototype.reverse=function(){var u=this.__wrapped__;if(u instanceof Cn){var h=u;return this.__actions__.length&&(h=new Cn(this)),(h=h.reverse()).__actions__.push({func:$d,args:[ay],thisArg:L}),new _o(h,this.__chain__)}return this.thru(ay)},O.prototype.toJSON=O.prototype.valueOf=O.prototype.value=function(){return s1(this.__wrapped__,this.__actions__)},O.prototype.first=O.prototype.head,jh&&(O.prototype[jh]=function(){return this}),O}();Kn._=Vh,(wt=function(){return Vh}.call(We,ze,We,gt))!==L&&(gt.exports=wt)}.call(this)},478:function(gt){gt.exports=function(){"use strict";function We(W,Y){for(var J=0;JW.length)&&(Y=W.length);for(var J=0,T=new Array(Y);J=W.length?{done:!0}:{done:!1,value:W[T++]}}}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 Pt={exports:{}};function Ke(){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}}Pt.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:Ke,changeDefaults:function(W){Pt.exports.defaults=W}};var Ze=/[&<>"']/,Tt=/[&<>"']/g,Ft=/[<>"']|&(?!#?\w+;)/,we=/[<>"']|&(?!#?\w+;)/g,_e={"&":"&","<":"<",">":">",'"':""","'":"'"},ke=function(Y){return _e[Y]};var Te=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function Vt(W){return W.replace(Te,function(Y,J){return"colon"===(J=J.toLowerCase())?":":"#"===J.charAt(0)?"x"===J.charAt(1)?String.fromCharCode(parseInt(J.substring(2),16)):String.fromCharCode(+J.substring(1)):""})}var He=/(^|[^\[])\^/g;var xt=/[^\w:]/g,tn=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;var Ei={},vi=/^[^:]+:\/*[^/]*$/,bi=/^([^:]+:)[\s\S]*$/,Mr=/^([^:]+:\/*[^/]*)[\s\S]*$/;function Ve(W,Y){Ei[" "+W]||(Ei[" "+W]=vi.test(W)?W+"/":Qt(W,"/",!0));var J=-1===(W=Ei[" "+W]).indexOf(":");return"//"===Y.substring(0,2)?J?Y:W.replace(bi,"$1")+Y:"/"===Y.charAt(0)?J?Y:W.replace(Mr,"$1")+Y:W+Y}function Qt(W,Y,J){var T=W.length;if(0===T)return"";for(var D=0;D1;)1&Y&&(J+=W),Y>>=1,W+=W;return J+W},Gn=Pt.exports.defaults,Ae=Qt,Ri=function(W,Y){var T=W.replace(/\|/g,function(B,Z,$){for(var le=!1,he=Z;--he>=0&&"\\"===$[he];)le=!le;return le?"|":" |"}).split(/ \|/),D=0;if(T.length>Y)T.splice(Y);else for(;T.length1?{type:"space",raw:D[0]}:{raw:"\n"}},Y.code=function(T){var D=this.rules.block.code.exec(T);if(D){var B=D[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:D[0],codeBlockStyle:"indented",text:this.options.pedantic?B:Ae(B,"\n")}}},Y.fences=function(T){var D=this.rules.block.fences.exec(T);if(D){var B=D[0],Z=function(W,Y){var J=W.match(/^(\s+)(?:```)/);if(null===J)return Y;var T=J[1];return Y.split("\n").map(function(D){var B=D.match(/^\s+/);return null===B?D:B[0].length>=T.length?D.slice(T.length):D}).join("\n")}(B,D[3]||"");return{type:"code",raw:B,lang:D[2]?D[2].trim():D[2],text:Z}}},Y.heading=function(T){var D=this.rules.block.heading.exec(T);if(D){var B=D[2].trim();if(/#$/.test(B)){var Z=Ae(B,"#");(this.options.pedantic||!Z||/ $/.test(Z))&&(B=Z.trim())}return{type:"heading",raw:D[0],depth:D[1].length,text:B}}},Y.nptable=function(T){var D=this.rules.block.nptable.exec(T);if(D){var B={type:"table",header:Ri(D[1].replace(/^ *| *\| *$/g,"")),align:D[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:D[3]?D[3].replace(/\n$/,"").split("\n"):[],raw:D[0]};if(B.header.length===B.align.length){var $,Z=B.align.length;for($=0;$ ?/gm,"");return{type:"blockquote",raw:D[0],text:B}}},Y.list=function(T){var D=this.rules.block.list.exec(T);if(D){var Ge,an,xn,qt,Et,ln,ri,Hi,$i,B=D[0],Z=D[2],$=Z.length>1,le={type:"list",raw:B,ordered:$,start:$?+Z.slice(0,-1):"",loose:!1,items:[]},he=D[0].match(this.rules.block.item),pe=!1,_n=he.length;xn=this.rules.block.listItemStart.exec(he[0]);for(var Ci=0;Ci<_n;Ci++){if(B=Ge=he[Ci],this.options.pedantic||($i=Ge.match(new RegExp("\\n\\s*\\n {0,"+(xn[0].length-1)+"}\\S")))&&(Et=Ge.length-$i.index+he.slice(Ci+1).join("\n").length,le.raw=le.raw.substring(0,le.raw.length-Et),B=Ge=Ge.substring(0,$i.index),_n=Ci+1),Ci!==_n-1){if(qt=this.rules.block.listItemStart.exec(he[Ci+1]),this.options.pedantic?qt[1].length>xn[1].length:qt[1].length>=xn[0].length||qt[1].length>3){he.splice(Ci,2,he[Ci]+(!this.options.pedantic&&qt[1].length/i.test(Z[0])&&(D=!1),!B&&/^<(pre|code|kbd|script)(\s|>)/i.test(Z[0])?B=!0:B&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(Z[0])&&(B=!1),{type:this.options.sanitize?"text":"html",raw:Z[0],inLink:D,inRawBlock:B,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Z[0]):jt(Z[0]):Z[0]}},Y.link=function(T){var D=this.rules.inline.link.exec(T);if(D){var B=D[2].trim();if(!this.options.pedantic&&/^$/.test(B))return;var Z=Ae(B.slice(0,-1),"\\");if((B.length-Z.length)%2==0)return}else{var $=xr(D[2],"()");if($>-1){var he=(0===D[0].indexOf("!")?5:4)+D[1].length+$;D[2]=D[2].substring(0,$),D[0]=D[0].substring(0,he).trim(),D[3]=""}}var pe=D[2],Ge="";if(this.options.pedantic){var an=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(pe);an&&(pe=an[1],Ge=an[3])}else Ge=D[3]?D[3].slice(1,-1):"";return pe=pe.trim(),/^$/.test(B)?pe.slice(1):pe.slice(1,-1)),ls(D,{href:pe&&pe.replace(this.rules.inline._escapes,"$1"),title:Ge&&Ge.replace(this.rules.inline._escapes,"$1")},D[0])}},Y.reflink=function(T,D){var B;if((B=this.rules.inline.reflink.exec(T))||(B=this.rules.inline.nolink.exec(T))){var Z=(B[2]||B[1]).replace(/\s+/g," ");if(!(Z=D[Z.toLowerCase()])||!Z.href){var $=B[0].charAt(0);return{type:"text",raw:$,text:$}}return ls(B,Z,B[0])}},Y.emStrong=function(T,D,B){void 0===B&&(B="");var Z=this.rules.inline.emStrong.lDelim.exec(T);if(Z&&(!Z[3]||!B.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 $=Z[1]||Z[2]||"";if(!$||$&&(""===B||this.rules.inline.punctuation.exec(B))){var he,pe,le=Z[0].length-1,Ge=le,an=0,xn="*"===Z[0][0]?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(xn.lastIndex=0,D=D.slice(-1*T.length+le);null!=(Z=xn.exec(D));)if(he=Z[1]||Z[2]||Z[3]||Z[4]||Z[5]||Z[6]){if(pe=he.length,Z[3]||Z[4]){Ge+=pe;continue}if((Z[5]||Z[6])&&le%3&&!((le+pe)%3)){an+=pe;continue}if(!((Ge-=pe)>0))return pe=Math.min(pe,pe+Ge+an),Math.min(le,pe)%2?{type:"em",raw:T.slice(0,le+Z.index+pe+1),text:T.slice(1,le+Z.index+pe)}:{type:"strong",raw:T.slice(0,le+Z.index+pe+1),text:T.slice(2,le+Z.index+pe-1)}}}}},Y.codespan=function(T){var D=this.rules.inline.code.exec(T);if(D){var B=D[2].replace(/\n/g," "),Z=/[^ ]/.test(B),$=/^ /.test(B)&&/ $/.test(B);return Z&&$&&(B=B.substring(1,B.length-1)),B=jt(B,!0),{type:"codespan",raw:D[0],text:B}}},Y.br=function(T){var D=this.rules.inline.br.exec(T);if(D)return{type:"br",raw:D[0]}},Y.del=function(T){var D=this.rules.inline.del.exec(T);if(D)return{type:"del",raw:D[0],text:D[2]}},Y.autolink=function(T,D){var Z,$,B=this.rules.inline.autolink.exec(T);if(B)return $="@"===B[2]?"mailto:"+(Z=jt(this.options.mangle?D(B[1]):B[1])):Z=jt(B[1]),{type:"link",raw:B[0],text:Z,href:$,tokens:[{type:"text",raw:Z,text:Z}]}},Y.url=function(T,D){var B;if(B=this.rules.inline.url.exec(T)){var Z,$;if("@"===B[2])$="mailto:"+(Z=jt(this.options.mangle?D(B[0]):B[0]));else{var le;do{le=B[0],B[0]=this.rules.inline._backpedal.exec(B[0])[0]}while(le!==B[0]);Z=jt(B[0]),$="www."===B[1]?"http://"+Z:Z}return{type:"link",raw:B[0],text:Z,href:$,tokens:[{type:"text",raw:Z,text:Z}]}}},Y.inlineText=function(T,D,B){var $,Z=this.rules.inline.text.exec(T);if(Z)return $=D?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Z[0]):jt(Z[0]):Z[0]:jt(this.options.smartypants?B(Z[0]):Z[0]),{type:"text",raw:Z[0],text:$}},W}(),aa=pn_noopTest,Xn=pn_edit,ci=pn_merge,pt={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:aa,table:aa,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?'|\([^()]*\))/};pt.def=Xn(pt.def).replace("label",pt._label).replace("title",pt._title).getRegex(),pt.bullet=/(?:[*+-]|\d{1,9}[.)])/,pt.item=/^( *)(bull) ?[^\n]*(?:\n(?! *bull ?)[^\n]*)*/,pt.item=Xn(pt.item,"gm").replace(/bull/g,pt.bullet).getRegex(),pt.listItemStart=Xn(/^( *)(bull) */).replace("bull",pt.bullet).getRegex(),pt.list=Xn(pt.list).replace(/bull/g,pt.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+pt.def.source+")").getRegex(),pt._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",pt._comment=/|$)/,pt.html=Xn(pt.html,"i").replace("comment",pt._comment).replace("tag",pt._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),pt.paragraph=Xn(pt._paragraph).replace("hr",pt.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",pt._tag).getRegex(),pt.blockquote=Xn(pt.blockquote).replace("paragraph",pt.paragraph).getRegex(),pt.normal=ci({},pt),pt.gfm=ci({},pt.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*|$)"}),pt.gfm.nptable=Xn(pt.gfm.nptable).replace("hr",pt.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",pt._tag).getRegex(),pt.gfm.table=Xn(pt.gfm.table).replace("hr",pt.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",pt._tag).getRegex(),pt.pedantic=ci({},pt.normal,{html:Xn("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",pt._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:aa,paragraph:Xn(pt.normal._paragraph).replace("hr",pt.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",pt.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var Ye={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:aa,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:aa,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~"};Ye.punctuation=Xn(Ye.punctuation).replace(/punctuation/g,Ye._punctuation).getRegex(),Ye.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,Ye.escapedEmSt=/\\\*|\\_/g,Ye._comment=Xn(pt._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),Ye.emStrong.lDelim=Xn(Ye.emStrong.lDelim).replace(/punct/g,Ye._punctuation).getRegex(),Ye.emStrong.rDelimAst=Xn(Ye.emStrong.rDelimAst,"g").replace(/punct/g,Ye._punctuation).getRegex(),Ye.emStrong.rDelimUnd=Xn(Ye.emStrong.rDelimUnd,"g").replace(/punct/g,Ye._punctuation).getRegex(),Ye._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,Ye._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,Ye._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])?)+(?![-_])/,Ye.autolink=Xn(Ye.autolink).replace("scheme",Ye._scheme).replace("email",Ye._email).getRegex(),Ye._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,Ye.tag=Xn(Ye.tag).replace("comment",Ye._comment).replace("attribute",Ye._attribute).getRegex(),Ye._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Ye._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,Ye._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,Ye.link=Xn(Ye.link).replace("label",Ye._label).replace("href",Ye._href).replace("title",Ye._title).getRegex(),Ye.reflink=Xn(Ye.reflink).replace("label",Ye._label).getRegex(),Ye.reflinkSearch=Xn(Ye.reflinkSearch,"g").replace("reflink",Ye.reflink).replace("nolink",Ye.nolink).getRegex(),Ye.normal=ci({},Ye),Ye.pedantic=ci({},Ye.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:Xn(/^!?\[(label)\]\((.*?)\)/).replace("label",Ye._label).getRegex(),reflink:Xn(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Ye._label).getRegex()}),Ye.gfm=ci({},Ye.normal,{escape:Xn(Ye.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&&(T="x"+T.toString(16)),Y+="&#"+T+";";return Y}var ui=function(){function W(J){this.tokens=[],this.tokens.links=Object.create(null),this.options=J||La,this.options.tokenizer=this.options.tokenizer||new la,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var T={block:Fi.normal,inline:$r.normal};this.options.pedantic?(T.block=Fi.pedantic,T.inline=$r.pedantic):this.options.gfm&&(T.block=Fi.gfm,T.inline=this.options.breaks?$r.breaks:$r.gfm),this.tokenizer.rules=T}W.lex=function(T,D){return new W(D).lex(T)},W.lexInline=function(T,D){return new W(D).inlineTokens(T)};var Y=W.prototype;return Y.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},Y.blockTokens=function(T,D,B){var $,le,he,pe,Ge,an,Z=this;for(void 0===D&&(D=[]),void 0===B&&(B=!0),this.options.pedantic&&(T=T.replace(/^ +$/gm,""));T;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(function(qt){return!!($=qt.call(Z,T,D))&&(T=T.substring($.raw.length),D.push($),!0)}))){if($=this.tokenizer.space(T)){T=T.substring($.raw.length),$.type&&D.push($);continue}if($=this.tokenizer.code(T)){T=T.substring($.raw.length),(pe=D[D.length-1])&&"paragraph"===pe.type?(pe.raw+="\n"+$.raw,pe.text+="\n"+$.text):D.push($);continue}if($=this.tokenizer.fences(T)){T=T.substring($.raw.length),D.push($);continue}if($=this.tokenizer.heading(T)){T=T.substring($.raw.length),D.push($);continue}if($=this.tokenizer.nptable(T)){T=T.substring($.raw.length),D.push($);continue}if($=this.tokenizer.hr(T)){T=T.substring($.raw.length),D.push($);continue}if($=this.tokenizer.blockquote(T)){T=T.substring($.raw.length),$.tokens=this.blockTokens($.text,[],B),D.push($);continue}if($=this.tokenizer.list(T)){for(T=T.substring($.raw.length),he=$.items.length,le=0;le=0&&(qt=Math.min(qt,ln))}),qt<1/0&&qt>=0&&(Ge=T.substring(0,qt+1))}(),B&&($=this.tokenizer.paragraph(Ge))){pe=D[D.length-1],an&&"paragraph"===pe.type?(pe.raw+="\n"+$.raw,pe.text+="\n"+$.text):D.push($),an=Ge.length!==T.length,T=T.substring($.raw.length);continue}if($=this.tokenizer.text(T)){T=T.substring($.raw.length),(pe=D[D.length-1])&&"text"===pe.type?(pe.raw+="\n"+$.raw,pe.text+="\n"+$.text):D.push($);continue}if(T){var xn="Infinite loop on byte: "+T.charCodeAt(0);if(this.options.silent){console.error(xn);break}throw new Error(xn)}}return D},Y.inline=function(T){var D,B,Z,$,le,he,pe=T.length;for(D=0;D0)for(;null!=(an=this.tokenizer.rules.inline.reflinkSearch.exec(Ge));)Et.includes(an[0].slice(an[0].lastIndexOf("[")+1,-1))&&(Ge=Ge.slice(0,an.index)+"["+Ba("a",an[0].length-2)+"]"+Ge.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(an=this.tokenizer.rules.inline.blockSkip.exec(Ge));)Ge=Ge.slice(0,an.index)+"["+Ba("a",an[0].length-2)+"]"+Ge.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(an=this.tokenizer.rules.inline.escapedEmSt.exec(Ge));)Ge=Ge.slice(0,an.index)+"++"+Ge.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;T;)if(xn||(qt=""),xn=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(function(ri){return!!(le=ri.call($,T,D))&&(T=T.substring(le.raw.length),D.push(le),!0)}))){if(le=this.tokenizer.escape(T)){T=T.substring(le.raw.length),D.push(le);continue}if(le=this.tokenizer.tag(T,B,Z)){T=T.substring(le.raw.length),B=le.inLink,Z=le.inRawBlock,(he=D[D.length-1])&&"text"===le.type&&"text"===he.type?(he.raw+=le.raw,he.text+=le.text):D.push(le);continue}if(le=this.tokenizer.link(T)){T=T.substring(le.raw.length),"link"===le.type&&(le.tokens=this.inlineTokens(le.text,[],!0,Z)),D.push(le);continue}if(le=this.tokenizer.reflink(T,this.tokens.links)){T=T.substring(le.raw.length),he=D[D.length-1],"link"===le.type?(le.tokens=this.inlineTokens(le.text,[],!0,Z),D.push(le)):he&&"text"===le.type&&"text"===he.type?(he.raw+=le.raw,he.text+=le.text):D.push(le);continue}if(le=this.tokenizer.emStrong(T,Ge,qt)){T=T.substring(le.raw.length),le.tokens=this.inlineTokens(le.text,[],B,Z),D.push(le);continue}if(le=this.tokenizer.codespan(T)){T=T.substring(le.raw.length),D.push(le);continue}if(le=this.tokenizer.br(T)){T=T.substring(le.raw.length),D.push(le);continue}if(le=this.tokenizer.del(T)){T=T.substring(le.raw.length),le.tokens=this.inlineTokens(le.text,[],B,Z),D.push(le);continue}if(le=this.tokenizer.autolink(T,lo)){T=T.substring(le.raw.length),D.push(le);continue}if(!B&&(le=this.tokenizer.url(T,lo))){T=T.substring(le.raw.length),D.push(le);continue}if(pe=T,this.options.extensions&&this.options.extensions.startInline&&function(){var ri=1/0,Hi=T.slice(1),$i=void 0;$.options.extensions.startInline.forEach(function(_n){"number"==typeof($i=_n.call(this,Hi))&&$i>=0&&(ri=Math.min(ri,$i))}),ri<1/0&&ri>=0&&(pe=T.substring(0,ri+1))}(),le=this.tokenizer.inlineText(pe,Z,ir)){T=T.substring(le.raw.length),"_"!==le.raw.slice(-1)&&(qt=le.raw.slice(-1)),xn=!0,(he=D[D.length-1])&&"text"===he.type?(he.raw+=le.raw,he.text+=le.text):D.push(le);continue}if(T){var ln="Infinite loop on byte: "+T.charCodeAt(0);if(this.options.silent){console.error(ln);break}throw new Error(ln)}}return D},function(W,Y,J){Y&&We(W.prototype,Y),J&&We(W,J)}(W,null,[{key:"rules",get:function(){return{block:Fi,inline:$r}}}]),W}(),Gr=Pt.exports.defaults,Nr=pn_cleanUrl,ii=pn_escape,pc=function(){function W(J){this.options=J||Gr}var Y=W.prototype;return Y.code=function(T,D,B){var Z=(D||"").match(/\S*/)[0];if(this.options.highlight){var $=this.options.highlight(T,Z);null!=$&&$!==T&&(B=!0,T=$)}return T=T.replace(/\n$/,"")+"\n",Z?'
    '+(B?T:ii(T,!0))+"
    \n":"
    "+(B?T:ii(T,!0))+"
    \n"},Y.blockquote=function(T){return"
    \n"+T+"
    \n"},Y.html=function(T){return T},Y.heading=function(T,D,B,Z){return this.options.headerIds?"'+T+"\n":""+T+"\n"},Y.hr=function(){return this.options.xhtml?"
    \n":"
    \n"},Y.list=function(T,D,B){var Z=D?"ol":"ul";return"<"+Z+(D&&1!==B?' start="'+B+'"':"")+">\n"+T+"\n"},Y.listitem=function(T){return"
  • "+T+"
  • \n"},Y.checkbox=function(T){return" "},Y.paragraph=function(T){return"

    "+T+"

    \n"},Y.table=function(T,D){return D&&(D=""+D+""),"\n\n"+T+"\n"+D+"
    \n"},Y.tablerow=function(T){return"\n"+T+"\n"},Y.tablecell=function(T,D){var B=D.header?"th":"td";return(D.align?"<"+B+' align="'+D.align+'">':"<"+B+">")+T+"\n"},Y.strong=function(T){return""+T+""},Y.em=function(T){return""+T+""},Y.codespan=function(T){return""+T+""},Y.br=function(){return this.options.xhtml?"
    ":"
    "},Y.del=function(T){return""+T+""},Y.link=function(T,D,B){if(null===(T=Nr(this.options.sanitize,this.options.baseUrl,T)))return B;var Z='"+B+""},Y.image=function(T,D,B){if(null===(T=Nr(this.options.sanitize,this.options.baseUrl,T)))return B;var Z=''+B+'":">")},Y.text=function(T){return T},W}(),co=function(){function W(){}var Y=W.prototype;return Y.strong=function(T){return T},Y.em=function(T){return T},Y.codespan=function(T){return T},Y.del=function(T){return T},Y.html=function(T){return T},Y.text=function(T){return T},Y.link=function(T,D,B){return""+B},Y.image=function(T,D,B){return""+B},Y.br=function(){return""},W}(),di=function(){function W(){this.seen={}}var Y=W.prototype;return Y.serialize=function(T){return T.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")},Y.getNextSafeSlug=function(T,D){var B=T,Z=0;if(this.seen.hasOwnProperty(B)){Z=this.seen[T];do{B=T+"-"+ ++Z}while(this.seen.hasOwnProperty(B))}return D||(this.seen[T]=Z,this.seen[B]=0),B},Y.slug=function(T,D){void 0===D&&(D={});var B=this.serialize(T);return this.getNextSafeSlug(B,D.dryrun)},W}(),Oh=pc,El=co,Va=di,uo=Pt.exports.defaults,za=pn_unescape,us=ui,ho=function(){function W(J){this.options=J||uo,this.options.renderer=this.options.renderer||new Oh,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new El,this.slugger=new Va}W.parse=function(T,D){return new W(D).parse(T)},W.parseInline=function(T,D){return new W(D).parseInline(T)};var Y=W.prototype;return Y.parse=function(T,D){void 0===D&&(D=!0);var Z,$,le,he,pe,Ge,an,xn,qt,Et,ln,ri,Hi,$i,_n,Ci,_c,fo,gd,B="",xl=T.length;for(Z=0;Z0&&"text"===_n.tokens[0].type?(_n.tokens[0].text=fo+" "+_n.tokens[0].text,_n.tokens[0].tokens&&_n.tokens[0].tokens.length>0&&"text"===_n.tokens[0].tokens[0].type&&(_n.tokens[0].tokens[0].text=fo+" "+_n.tokens[0].tokens[0].text)):_n.tokens.unshift({type:"text",text:fo}):$i+=fo),$i+=this.parse(_n.tokens,Hi),qt+=this.renderer.listitem($i,_c,Ci);B+=this.renderer.list(qt,ln,ri);continue;case"html":B+=this.renderer.html(Et.text);continue;case"paragraph":B+=this.renderer.paragraph(this.parseInline(Et.tokens));continue;case"text":for(qt=Et.tokens?this.parseInline(Et.tokens):Et.text;Z+1An error occurred:

    "+mc(le.message+"",!0)+"
    ";throw le}}return Je.options=Je.setOptions=function(W){return gu(Je.defaults,W),mu(Je.defaults),Je},Je.getDefaults=pd,Je.defaults=Vs,Je.use=function(){for(var W=this,Y=arguments.length,J=new Array(Y),T=0;TAn error occurred:

    "+mc(T.message+"",!0)+"
    ";throw T}},Je.Parser=ho,Je.parser=ho.parse,Je.Renderer=Sl,Je.TextRenderer=fu,Je.Lexer=us,Je.lexer=us.lex,Je.Tokenizer=gc,Je.Slugger=pu,Je.parse=Je,Je}()},310:(gt,We,ze)=>{"use strict";var wt=ze(948);Object.defineProperty(We,"__esModule",{value:!0}),We.isMobile=function(){return void 0!==L.window.orientation},We.default=function(Ze){if(!Ze&&!(0,It.default)())return"Node";if((0,Pt.default)(Ze))return"Electron";var Tt="undefined"!=typeof navigator?navigator:{},Ft=Ze||Tt.userAgent||"";if(Ft.indexOf("Edge")>-1)return"Edge";var we=-1!==Ft.indexOf("MSIE "),_e=-1!==Ft.indexOf("Trident/");return we||_e?"IE":L.window.chrome?"Chrome":L.window.safari?"Safari":L.window.mozInnerScreenX?"Firefox":"Unknown"};var L=ze(151),It=wt(ze(602)),Pt=wt(ze(344))},151:(gt,We,ze)=>{"use strict";var wt=ze(948);Object.defineProperty(We,"__esModule",{value:!0}),We.console=We.process=We.document=We.global=We.window=We.self=void 0;var L=wt(ze(321)),It={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,L.default)(process))&&process};We.self=It.self||It.window||It.global,We.window=It.window||It.self||It.global,We.global=It.global||It.self||It.window,We.document=It.document||{},We.process=It.process||{};var Ft=console;We.console=Ft},761:(gt,We,ze)=>{"use strict";var L=ze(948),It=ze(321);Object.defineProperty(We,"CO",{enumerable:!0,get:function(){return Pt.global}}),Object.defineProperty(We,"qs",{enumerable:!0,get:function(){return ft.default}});var Pt=ze(151),ft=(Ft(ze(602)),Ft(ze(310)));L(ze(344));function Tt(we){if("function"!=typeof WeakMap)return null;var _e=new WeakMap,ke=new WeakMap;return(Tt=function(Te){return Te?ke:_e})(we)}function Ft(we,_e){if(!_e&&we&&we.__esModule)return we;if(null===we||"object"!==It(we)&&"function"!=typeof we)return{default:we};var ke=Tt(_e);if(ke&&ke.has(we))return ke.get(we);var ye={},Te=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var Vt in we)if("default"!==Vt&&Object.prototype.hasOwnProperty.call(we,Vt)){var He=Te?Object.getOwnPropertyDescriptor(we,Vt):null;He&&(He.get||He.set)?Object.defineProperty(ye,Vt,He):ye[Vt]=we[Vt]}return ye.default=we,ke&&ke.set(we,ye),ye}},602:(gt,We,ze)=>{"use strict";var wt=ze(948);Object.defineProperty(We,"__esModule",{value:!0}),We.default=Pt,We.isBrowserMainThread=function(){return Pt()&&"undefined"!=typeof document};var L=wt(ze(321)),It=wt(ze(344));function Pt(){return!("object"===("undefined"==typeof process?"undefined":(0,L.default)(process))&&"[object process]"===String(process)&&!process.browser)||(0,It.default)()}},344:(gt,We,ze)=>{"use strict";var wt=ze(948);Object.defineProperty(We,"__esModule",{value:!0}),We.default=function(Pt){if("undefined"!=typeof window&&"object"===(0,L.default)(window.process)&&"renderer"===window.process.type||"undefined"!=typeof process&&"object"===(0,L.default)(process.versions)&&Boolean(process.versions.electron))return!0;var Ke="object"===("undefined"==typeof navigator?"undefined":(0,L.default)(navigator))&&"string"==typeof navigator.userAgent&&navigator.userAgent,ft=Pt||Ke;return!!(ft&&ft.indexOf("Electron")>=0)};var L=wt(ze(321))},851:(gt,We,ze)=>{"use strict";var wt={};ze.r(wt),ze.d(wt,{decode:()=>N0e,encode:()=>L0e});var L={};ze.r(L),ze.d(L,{decode:()=>U0e,encode:()=>H0e});var It={};ze.r(It),ze.d(It,{decode:()=>$0e,encode:()=>G0e});var Pt={};function Ke(n){return"function"==typeof n}ze.r(Pt),ze.d(Pt,{decode:()=>W0e,encode:()=>q0e});let ft=!1;const Ze={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 ft&&console.log("RxJS: Back to a better error behavior. Thank you. <3");ft=n},get useDeprecatedSynchronousErrorHandling(){return ft}};function Tt(n){setTimeout(()=>{throw n},0)}const Ft={closed:!0,next(n){},error(n){if(Ze.useDeprecatedSynchronousErrorHandling)throw n;Tt(n)},complete(){}},we=Array.isArray||(n=>n&&"number"==typeof n.length);function _e(n){return null!==n&&"object"==typeof n}const ye=(()=>{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 Te{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 Te)t.remove(this);else if(null!==t)for(let o=0;oe.concat(t instanceof ye?t.errors:t),[])}Te.EMPTY=((n=new Te).closed=!0,n);const He="function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random();class xt extends Te{constructor(e,t,i){switch(super(),this.syncErrorValue=null,this.syncErrorThrown=!1,this.syncErrorThrowable=!1,this.isStopped=!1,arguments.length){case 0:this.destination=Ft;break;case 1:if(!e){this.destination=Ft;break}if("object"==typeof e){e instanceof xt?(this.syncErrorThrowable=e.syncErrorThrowable,this.destination=e,e.add(this)):(this.syncErrorThrowable=!0,this.destination=new tn(this,e));break}default:this.syncErrorThrowable=!0,this.destination=new tn(this,e,t,i)}}[He](){return this}static create(e,t,i){const r=new xt(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 tn extends xt{constructor(e,t,i,r){super(),this._parentSubscriber=e;let s,o=this;Ke(t)?s=t:t&&(s=t.next,i=t.error,r=t.complete,t!==Ft&&(o=Object.create(t),Ke(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;Ze.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}=Ze;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):Tt(e),this.unsubscribe();else{if(this.unsubscribe(),i)throw e;Tt(e)}}}complete(){if(!this.isStopped){const{_parentSubscriber:e}=this;if(this._complete){const t=()=>this._complete.call(this._context);Ze.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(),Ze.useDeprecatedSynchronousErrorHandling)throw i;Tt(i)}}__tryOrSetError(e,t,i){if(!Ze.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{t.call(this._context,i)}catch(r){return Ze.useDeprecatedSynchronousErrorHandling?(e.syncErrorValue=r,e.syncErrorThrown=!0,!0):(Tt(r),!0)}return!1}_unsubscribe(){const{_parentSubscriber:e}=this;this._context=null,this._parentSubscriber=null,e.unsubscribe()}}const vi="function"==typeof Symbol&&Symbol.observable||"@@observable";function bi(n){return n}function Mr(...n){return Ve(n)}function Ve(n){return 0===n.length?bi:1===n.length?n[0]:function(t){return n.reduce((i,r)=>r(i),t)}}let ce=(()=>{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 xt)return n;if(n[He])return n[He]()}return n||e||t?new xt(n,e,t):new xt(Ft)}(t,i,r);if(o.add(s?s.call(o,this.source):this.source||Ze.useDeprecatedSynchronousErrorHandling&&!o.syncErrorThrowable?this._subscribe(o):this._trySubscribe(o)),Ze.useDeprecatedSynchronousErrorHandling&&o.syncErrorThrowable&&(o.syncErrorThrowable=!1,o.syncErrorThrown))throw o.syncErrorValue;return o}_trySubscribe(t){try{return this._subscribe(t)}catch(i){Ze.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 xt?t:null}return!0}(t)?t.error(i):console.warn(i)}}forEach(t,i){return new(i=zt(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)}[vi](){return this}pipe(...t){return 0===t.length?this:Ve(t)(this)}toPromise(t){return new(t=zt(t))((i,r)=>{let s;this.subscribe(o=>s=o,o=>r(o),()=>i(s))})}}return n.create=e=>new n(e),n})();function zt(n){if(n||(n=Ze.Promise||Promise),!n)throw new Error("no Promise impl found");return n}const Qt=(()=>{function n(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return n.prototype=Object.create(Error.prototype),n})();class li extends Te{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 Pi extends xt{constructor(e){super(e),this.destination=e}}let Se=(()=>{class n extends ce{constructor(){super(),this.observers=[],this.closed=!1,this.isStopped=!1,this.hasError=!1,this.thrownError=null}[He](){return new Pi(this)}lift(t){const i=new pn(this,this);return i.operator=t,i}next(t){if(this.closed)throw new Qt;if(!this.isStopped){const{observers:i}=this,r=i.length,s=i.slice();for(let o=0;onew pn(e,t),n})();class pn extends Se{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):Te.EMPTY}}function Gn(n){return n&&"function"==typeof n.schedule}function Ae(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 Ri(n,e))}}class Ri{constructor(e,t){this.project=e,this.thisArg=t}call(e,t){return t.subscribe(new jt(e,this.project,this.thisArg))}}class jt extends xt{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 xr=n=>e=>{for(let t=0,i=n.length;tn&&"number"==typeof n.length&&"function"!=typeof n;function Ye(n){return!!n&&"function"!=typeof n.subscribe&&"function"==typeof n.then}const ki=n=>{if(n&&"function"==typeof n[vi])return(n=>e=>{const t=n[vi]();if("function"!=typeof t.subscribe)throw new TypeError("Provided object does not correctly implement Symbol.observable");return t.subscribe(e)})(n);if(pt(n))return xr(n);if(Ye(n))return(n=>e=>(n.then(t=>{e.closed||(e.next(t),e.complete())},t=>e.error(t)).then(null,Tt),e))(n);if(n&&"function"==typeof n[cs])return(n=>e=>{const t=n[cs]();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 ${_e(n)?"an invalid object":`'${n}'`} where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.`;throw new TypeError(t)}};function Fi(n,e){return new ce(t=>{const i=new Te;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 ui(n,e){return e?function(n,e){if(null!=n){if(function(n){return n&&"function"==typeof n[vi]}(n))return function(n,e){return new ce(t=>{const i=new Te;return i.add(e.schedule(()=>{const r=n[vi]();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(Ye(n))return function(n,e){return new ce(t=>{const i=new Te;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(pt(n))return Fi(n,e);if(function(n){return n&&"function"==typeof n[cs]}(n)||"string"==typeof n)return function(n,e){if(!n)throw new Error("Iterable cannot be null");return new ce(t=>{const i=new Te;let r;return i.add(()=>{r&&"function"==typeof r.return&&r.return()}),i.add(e.schedule(()=>{r=n[cs](),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 ce?n:new ce(ki(n))}class Gr extends xt{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 ii extends xt{notifyNext(e){this.destination.next(e)}notifyError(e){this.destination.error(e)}notifyComplete(){this.destination.complete()}}function co(n,e){if(e.closed)return;if(n instanceof ce)return n.subscribe(e);let t;try{t=ki(n)(e)}catch(i){e.error(i)}return t}function di(n,e,t=Number.POSITIVE_INFINITY){return"function"==typeof e?i=>i.pipe(di((r,s)=>ui(n(r,s)).pipe(Ae((o,a)=>e(r,o,s,a))),t)):("number"==typeof e&&(t=e),i=>i.lift(new Oh(n,t)))}class Oh{constructor(e,t=Number.POSITIVE_INFINITY){this.project=e,this.concurrent=t}call(e,t){return t.subscribe(new El(e,this.project,this.concurrent))}}class El extends ii{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 uo(n=Number.POSITIVE_INFINITY){return di(bi,n)}function za(n,e){return e?Fi(n,e):new ce(xr(n))}function Ni(...n){let e=Number.POSITIVE_INFINITY,t=null,i=n[n.length-1];return Gn(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 ce?n[0]:uo(e)(za(n,t))}function us(){return function(e){return e.lift(new ho(e))}}class ho{constructor(e){this.connectable=e}call(e,t){const{connectable:i}=this;i._refCount++;const r=new gc(e,i),s=t.subscribe(r);return r.closed||(r.connection=i.connect()),s}}class gc extends xt{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 Sl extends ce{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 Te,e.add(this.source.subscribe(new pu(this.getSubject(),this))),e.closed&&(this._connection=null,e=Te.EMPTY)),e}refCount(){return us()(this)}}const fu=(()=>{const n=Sl.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 pu extends Pi{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()}}}function mc(n,e){return function(i){let r;if(r="function"==typeof n?n:function(){return n},"function"==typeof e)return i.lift(new pd(r,e));const s=Object.create(i,fu);return s.source=i,s.subjectFactory=r,s}}class pd{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 mu(){return new Se}function Vs(){return n=>us()(mc(mu)(n))}function Je(n){for(let e in n)if(n[e]===Je)return e;throw Error("Could not find renamed property on target object.")}function _u(n,e){for(const t in e)e.hasOwnProperty(t)&&!n.hasOwnProperty(t)&&(n[t]=e[t])}function W(n){if("string"==typeof n)return n;if(Array.isArray(n))return"["+n.map(W).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 Y(n,e){return null==n||""===n?null===e?"":e:null==e||""===e?n:n+" "+e}const J=Je({__forward_ref__:Je});function T(n){return n.__forward_ref__=T,n.toString=function(){return W(this())},n}function D(n){return B(n)?n():n}function B(n){return"function"==typeof n&&n.hasOwnProperty(J)&&n.__forward_ref__===T}class $ extends Error{constructor(e,t){super(function(n,e){return`${n?`NG0${n}: `:""}${e}`}(e,t)),this.code=e}}function pe(n){return"string"==typeof n?n:null==n?"":String(n)}function Ge(n){return"function"==typeof n?n.name||n.toString():"object"==typeof n&&null!=n&&"function"==typeof n.type?n.type.name||n.type.toString():pe(n)}function Et(n,e){const t=e?` in ${e}`:"";throw new $("201",`No provider for ${Ge(n)} found${t}`)}function Gi(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 ue(n){return{token:n.token,providedIn:n.providedIn||null,factory:n.factory,value:void 0}}function Me(n){return{providers:n.providers||[],imports:n.imports||[]}}function rr(n){return vc(n,ua)||vc(n,Ua)}function vc(n,e){return n.hasOwnProperty(e)?n[e]:null}function Cu(n){return n&&(n.hasOwnProperty(Tl)||n.hasOwnProperty(Sp))?n[Tl]:null}const ua=Je({\u0275prov:Je}),Tl=Je({\u0275inj:Je}),Ua=Je({ngInjectableDef:Je}),Sp=Je({ngInjectorDef:Je});var At=(()=>((At=At||{})[At.Default=0]="Default",At[At.Host=1]="Host",At[At.Self=2]="Self",At[At.SkipSelf=4]="SkipSelf",At[At.Optional=8]="Optional",At))();let Al;function da(n){const e=Al;return Al=n,e}function md(n,e,t){const i=rr(n);return i&&"root"==i.providedIn?void 0===i.value?i.value=i.factory():i.value:t&At.Optional?null:void 0!==e?e:void Et(W(n),"Injector")}function F(n){return{toString:n}.toString()}var j=(()=>((j=j||{})[j.OnPush=0]="OnPush",j[j.Default=1]="Default",j))(),Ue=(()=>((Ue=Ue||{})[Ue.Emulated=0]="Emulated",Ue[Ue.None=2]="None",Ue[Ue.ShadowDom=3]="ShadowDom",Ue))();const vn="undefined"!=typeof globalThis&&globalThis,dr="undefined"!=typeof window&&window,yr="undefined"!=typeof self&&"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&self,Wr="undefined"!=typeof global&&global,cn=vn||Wr||dr||yr,_d={},mi=[],xp=Je({\u0275cmp:Je}),d_=Je({\u0275dir:Je}),Ph=Je({\u0275pipe:Je}),b0=Je({\u0275mod:Je}),xx=Je({\u0275loc:Je}),Dl=Je({\u0275fac:Je}),Rh=Je({__NG_ELEMENT_ID__:Je});let Tx=0;function Ne(n){return F(()=>{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===j.OnPush,directiveDefs:null,pipeDefs:null,selectors:n.selectors||mi,viewQuery:n.viewQuery||null,features:n.features||null,data:n.data||{},encapsulation:n.encapsulation||Ue.Emulated,id:"c",styles:n.styles||mi,_:null,setInput:null,schemas:n.schemas||null,tView:null},r=n.directives,s=n.features,o=n.pipes;return i.id+=Tx++,i.inputs=S0(n.inputs,t),i.outputs=S0(n.outputs),s&&s.forEach(a=>a(i)),i.directiveDefs=r?()=>("function"==typeof r?r():r).map(C0):null,i.pipeDefs=o?()=>("function"==typeof o?o():o).map(w0):null,i})}function C0(n){return Kn(n)||function(n){return n[d_]||null}(n)}function w0(n){return function(n){return n[Ph]||null}(n)}const E0={};function Pe(n){return F(()=>{const e={type:n.type,bootstrap:n.bootstrap||mi,declarations:n.declarations||mi,imports:n.imports||mi,exports:n.exports||mi,transitiveCompileScopes:null,schemas:n.schemas||null,id:n.id||null};return null!=n.id&&(E0[n.id]=n.type),e})}function S0(n,e){if(null==n)return _d;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 oe=Ne;function ds(n){return{type:n.type,name:n.name,factory:null,pure:!1!==n.pure,onDestroy:n.type.prototype.ngOnDestroy||null}}function Kn(n){return n[xp]||null}function po(n,e){const t=n[b0]||null;if(!t&&!0===e)throw new Error(`Type ${W(n)} does not have '\u0275mod' property.`);return t}function Fo(n){return Array.isArray(n)&&"object"==typeof n[1]}function No(n){return Array.isArray(n)&&!0===n[1]}function p_(n){return 0!=(8&n.flags)}function Cd(n){return 2==(2&n.flags)}function wd(n){return 1==(1&n.flags)}function pa(n){return null!==n.template}function M0(n){return 0!=(512&n[2])}function wc(n,e){return n.hasOwnProperty(Dl)?n[Dl]:null}class y_{constructor(e,t,i){this.previousValue=e,this.currentValue=t,this.firstChange=i}isFirstChange(){return this.firstChange}}function zn(){return A0}function A0(n){return n.type.prototype.ngOnChanges&&(n.setInput=Fx),kx}function kx(){const n=q(this),e=null==n?void 0:n.current;if(e){const t=n.previous;if(t===_d)n.previous=e;else for(let i in e)t[i]=e[i];n.current=null,this.ngOnChanges(e)}}function Fx(n,e,t,i){const r=q(n)||function(n,e){return n[Vh]=e}(n,{previous:_d,current:null}),s=r.current||(r.current={}),o=r.previous,a=this.declaredInputs[t],l=o[a];s[a]=new y_(l&&l.currentValue,e,o===_d),n[i]=e}zn.ngInherit=!0;const Vh="__ngSimpleChanges__";function q(n){return n[Vh]||null}const Wn="http://www.w3.org/2000/svg";let fi;function Ii(n){return!!n.listen}const Su={createRenderer:(n,e)=>void 0!==fi?fi:"undefined"!=typeof document?document:void 0};function qi(n){for(;Array.isArray(n);)n=n[0];return n}function zh(n,e){return qi(e[n])}function Ts(n,e){return qi(e[n.index])}function C_(n,e){return n.data[e]}function Ed(n,e){return n[e]}function fs(n,e){const t=e[n];return Fo(t)?t:t[0]}function Pl(n){return 4==(4&n[2])}function Sd(n){return 128==(128&n[2])}function ma(n,e){return null==e?null:n[e]}function w_(n){n[18]=0}function Dp(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 Yt={lFrame:xu(null),bindingsEnabled:!0,isInCheckNoChangesMode:!1};function O0(){return Yt.bindingsEnabled}function Oe(){return Yt.lFrame.lView}function Dn(){return Yt.lFrame.tView}function en(n){return Yt.lFrame.contextLView=n,n[8]}function Dr(){let n=E_();for(;null!==n&&64===n.type;)n=n.parent;return n}function E_(){return Yt.lFrame.currentTNode}function Ga(n,e){const t=Yt.lFrame;t.currentTNode=n,t.isParent=e}function pr(){return Yt.lFrame.isParent}function Lr(){Yt.lFrame.isParent=!1}function Hh(){return Yt.isInCheckNoChangesMode}function Ip(n){Yt.isInCheckNoChangesMode=n}function Yr(){const n=Yt.lFrame;let e=n.bindingRootIndex;return-1===e&&(e=n.bindingRootIndex=n.tView.bindingStartIndex),e}function Us(){return Yt.lFrame.bindingIndex}function _a(){return Yt.lFrame.bindingIndex++}function mo(n){const e=Yt.lFrame,t=e.bindingIndex;return e.bindingIndex=e.bindingIndex+n,t}function Md(n,e){const t=Yt.lFrame;t.bindingIndex=t.bindingRootIndex=n,S_(e)}function S_(n){Yt.lFrame.currentDirectiveIndex=n}function M_(n){const e=Yt.lFrame.currentDirectiveIndex;return-1===e?null:n[e]}function I0(){return Yt.lFrame.currentQueryIndex}function x_(n){Yt.lFrame.currentQueryIndex=n}function Rp(n){const e=n[1];return 2===e.type?e.declTNode:1===e.type?n[6]:null}function xd(n,e,t){if(t&At.SkipSelf){let r=e,s=n;for(;!(r=r.parent,null!==r||t&At.Host||(r=Rp(s),null===r||(s=s[15],10&r.type))););if(null===r)return!1;e=r,n=s}const i=Yt.lFrame=O();return i.currentTNode=e,i.lView=n,!0}function Wh(n){const e=O(),t=n[1];Yt.lFrame=e,e.currentTNode=t.firstChild,e.lView=n,e.tView=t,e.contextLView=n,e.bindingIndex=t.bindingStartIndex,e.inI18n=!1}function O(){const n=Yt.lFrame,e=null===n?null:n.child;return null===e?xu(n):e}function xu(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 qh(){const n=Yt.lFrame;return Yt.lFrame=n.parent,n.currentTNode=null,n.lView=null,n}const _o=qh;function Cn(){const n=qh();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 As(){return Yt.lFrame.selectedIndex}function Hs(n){Yt.lFrame.selectedIndex=n}function sr(){const n=Yt.lFrame;return C_(n.tView,n.selectedIndex)}function kp(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 Yh{constructor(e,t,i){this.factory=e,this.resolving=!1,this.canSeeViewProviders=t,this.injectImpl=i}}function Lp(n,e,t){const i=Ii(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 Ad=!0;function Bp(n){const e=Ad;return Ad=n,e}let P_=0;function ps(n,e){const t=Vp(n,e);if(-1!==t)return t;const i=e[1];i.firstCreatePass&&(n.injectorIndex=e.length,R_(i.data,n),R_(e,null),R_(i.blueprint,null));const r=Kh(n,e),s=n.injectorIndex;if(F0(r)){const o=Td(r),a=qa(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 R_(n,e){n.push(0,0,0,0,0,0,0,0,e)}function Vp(n,e){return-1===n.injectorIndex||n.parent&&n.parent.injectorIndex===n.injectorIndex||null===e[n.injectorIndex+8]?-1:n.injectorIndex}function Kh(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 Sc(n,e,t){!function(n,e,t){let i;"string"==typeof t?i=t.charCodeAt(0)||0:t.hasOwnProperty(Rh)&&(i=t[Rh]),null==i&&(i=t[Rh]=P_++);const r=255&i;e.data[n+(r>>5)]|=1<=0?255&e:V0:e}(t);if("function"==typeof s){if(!xd(e,n,i))return i&At.Host?k_(r,t,i):L0(e,t,i,r);try{const o=s(i);if(null!=o||i&At.Optional)return o;Et(t)}finally{_o()}}else if("number"==typeof s){let o=null,a=Vp(n,e),l=-1,c=i&At.Host?e[16][6]:null;for((-1===a||i&At.SkipSelf)&&(l=-1===a?Kh(n,e):e[a+8],-1!==l&&Qh(i,!1)?(o=e[1],a=Td(l),e=qa(l,e)):a=-1);-1!==a;){const d=e[1];if(zp(s,a,d.data)){const f=Xr(a,e,t,o,i,c);if(f!==B0)return f}l=e[a+8],-1!==l&&Qh(i,e[1].data[a+8]===c)&&zp(s,a,e)?(o=d,a=Td(l),e=qa(l,e)):a=-1}}}return L0(e,t,i,r)}const B0={};function V0(){return new Bo(Dr(),Oe())}function Xr(n,e,t,i,r,s){const o=e[1],a=o.data[n+8],d=Dd(a,o,t,null==i?Cd(a)&&Ad:i!=o&&0!=(3&a.type),r&At.Host&&s===a);return null!==d?Od(e,o,d,a):B0}function Dd(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&&pa(g)&&g.type===t)return l}return null}function Od(n,e,t,i){let r=n[t];const s=e.data;if(function(n){return n instanceof Yh}(r)){const o=r;o.resolving&&function(n,e){throw new $("200",`Circular dependency in DI detected for ${n}`)}(Ge(s[t]));const a=Bp(o.canSeeViewProviders);o.resolving=!0;const l=o.injectImpl?da(o.injectImpl):null;xd(n,i,At.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=A0(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&&da(l),Bp(a),o.resolving=!1,_o()}}return r}function zp(n,e,t){return!!(t[e+(n>>5)]&1<{const e=n.prototype.constructor,t=e[Dl]||Kr(e),i=Object.prototype;let r=Object.getPrototypeOf(n.prototype).constructor;for(;r&&r!==i;){const s=r[Dl]||Kr(r);if(s&&s!==t)return s;r=Object.getPrototypeOf(r)}return s=>new s})}function Kr(n){return B(n)?()=>{const e=Kr(D(n));return e&&e()}:wc(n)}function Zr(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{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(Pd)?l[Pd]:Object.defineProperty(l,Pd,{value:[]})[Pd];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 ve{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=ue({token:this,providedIn:t.providedIn||"root",factory:t.factory}))}toString(){return`InjectionToken ${this._desc}`}}const Du=Function;function Vo(n,e){void 0===e&&(e=n);for(let t=0;tArray.isArray(t)?zo(t,e):e(t))}function ef(n,e,t){e>=n.length?n.push(t):n.splice(e,0,t)}function kl(n,e){return e>=n.length-1?n.pop():n.splice(e,1)[0]}function xc(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 z_(n,e){const t=Qr(n,e);if(t>=0)return n[1|t]}function Qr(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):W(a)))}r=`{${s.join(", ")}}`}return`${t}${i?"("+i+")":""}[${r}]: ${n.replace(Dc,"\n ")}`}("\n"+n.message,r,t,i),n.ngTokenPath=r,n[Ac]=null,n}const Ld=Nd(ba("Inject",n=>({token:n})),-1),br=Nd(ba("Optional"),8),Za=Nd(ba("SkipSelf"),4);let Vd;function Nu(n){var e;return(null===(e=function(){if(void 0===Vd&&(Vd=null,cn.trustedTypes))try{Vd=cn.trustedTypes.createPolicy("angular",{createHTML:n=>n,createScript:n=>n,createScriptURL:n=>n})}catch(n){}return Vd}())||void 0===e?void 0:e.createHTML(n))||n}class Bl{constructor(e){this.changingThisBreaksApplicationSecurity=e}toString(){return`SafeValue must use [property]=binding: ${this.changingThisBreaksApplicationSecurity} (see https://g.co/ng/security#xss)`}}class W_ extends Bl{getTypeName(){return"HTML"}}class q_ extends Bl{getTypeName(){return"Style"}}class Jp extends Bl{getTypeName(){return"Script"}}class zd extends Bl{getTypeName(){return"URL"}}class Ut extends Bl{getTypeName(){return"ResourceURL"}}function gs(n){return n instanceof Bl?n.changingThisBreaksApplicationSecurity:n}function jo(n,e){const t=Pc(n);if(null!=t&&t!==e){if("ResourceURL"===t&&"URL"===e)return!0;throw new Error(`Required a safe ${e}, got a ${t} (see https://g.co/ng/security#xss)`)}return t===e}function Pc(n){return n instanceof Bl&&n.getTypeName()||null}class iC{constructor(e){this.inertDocumentHelper=e}getInertBodyElement(e){e=""+e;try{const t=(new window.DOMParser).parseFromString(Nu(e),"text/html").body;return null===t?this.inertDocumentHelper.getInertBodyElement(e):(t.removeChild(t.firstChild),t)}catch(t){return null}}}class f1{constructor(e){if(this.defaultDoc=e,this.inertDocument=this.defaultDoc.implementation.createHTMLDocument("sanitization-inert"),null==this.inertDocument.body){const t=this.inertDocument.createElement("html");this.inertDocument.appendChild(t);const i=this.inertDocument.createElement("body");t.appendChild(i)}}getInertBodyElement(e){const t=this.inertDocument.createElement("template");if("content"in t)return t.innerHTML=Nu(e),t;const i=this.inertDocument.createElement("body");return i.innerHTML=Nu(e),this.defaultDoc.documentMode&&this.stripCustomNsAttrs(i),i}stripCustomNsAttrs(e){const t=e.attributes;for(let r=t.length-1;0bo(e.trim())).join(", ")}function Uo(n){const e={};for(const t of n.split(","))e[t]=!0;return e}function nf(...n){const e={};for(const t of n)for(const i in t)t.hasOwnProperty(i)&&(e[i]=!0);return e}const eg=Uo("area,br,col,hr,img,wbr"),sC=Uo("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr"),oC=Uo("rp,rt"),X_=nf(eg,nf(sC,Uo("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")),nf(oC,Uo("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")),nf(oC,sC)),K_=Uo("background,cite,href,itemtype,longdesc,poster,src,xlink:href"),Z_=Uo("srcset"),Q_=nf(K_,Z_,Uo("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"),Uo("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")),v1=Uo("script,style,template");class J_{constructor(){this.sanitizedSomething=!1,this.buf=[]}sanitizeChildren(e){let t=e.firstChild,i=!0;for(;t;)if(t.nodeType===Node.ELEMENT_NODE?i=this.startElement(t):t.nodeType===Node.TEXT_NODE?this.chars(t.nodeValue):this.sanitizedSomething=!0,i&&t.firstChild)t=t.firstChild;else for(;t;){t.nodeType===Node.ELEMENT_NODE&&this.endElement(t);let r=this.checkClobberedElement(t,t.nextSibling);if(r){t=r;break}t=this.checkClobberedElement(t,t.parentNode)}return this.buf.join("")}startElement(e){const t=e.nodeName.toLowerCase();if(!X_.hasOwnProperty(t))return this.sanitizedSomething=!0,!v1.hasOwnProperty(t);this.buf.push("<"),this.buf.push(t);const i=e.attributes;for(let r=0;r"),!0}endElement(e){const t=e.nodeName.toLowerCase();X_.hasOwnProperty(t)&&!eg.hasOwnProperty(t)&&(this.buf.push(""))}chars(e){this.buf.push(ng(e))}checkClobberedElement(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: ${e.outerHTML}`);return t}}const aC=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,rf=/([^\#-~ |!])/g;function ng(n){return n.replace(/&/g,"&").replace(aC,function(e){return"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";"}).replace(rf,function(e){return"&#"+e.charCodeAt(0)+";"}).replace(//g,">")}let sf;function ey(n,e){let t=null;try{sf=sf||function(n){const e=new f1(n);return function(){try{return!!(new window.DOMParser).parseFromString(Nu(""),"text/html")}catch(n){return!1}}()?new iC(e):e}(n);let i=e?String(e):"";t=sf.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=t.innerHTML,t=sf.getInertBodyElement(i)}while(i!==s);return Nu((new J_).sanitizeChildren(jd(t)||t))}finally{if(t){const i=jd(t)||t;for(;i.firstChild;)i.removeChild(i.firstChild)}}}function jd(n){return"content"in n&&function(n){return n.nodeType===Node.ELEMENT_NODE&&"TEMPLATE"===n.nodeName}(n)?n.content:null}var mn=(()=>((mn=mn||{})[mn.NONE=0]="NONE",mn[mn.HTML=1]="HTML",mn[mn.STYLE=2]="STYLE",mn[mn.SCRIPT=3]="SCRIPT",mn[mn.URL=4]="URL",mn[mn.RESOURCE_URL=5]="RESOURCE_URL",mn))();function Ud(n){const e=function(){const n=Oe();return n&&n[12]}();return e?e.sanitize(mn.URL,n)||"":jo(n,"URL")?gs(n):bo(pe(n))}const iy="__ngContext__";function Jr(n,e){n[iy]=e}function ry(n){const e=function(n){return n[iy]||null}(n);return e?Array.isArray(e)?e:e.lView:null}function ig(n){return n.ngOriginalError}function P1(n,...e){n.error(...e)}class $o{constructor(){this._console=console}handleError(e){const t=this._findOriginalError(e),i=this._findContext(e),r=function(n){return n&&n.ngErrorLogger||P1}(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(ig(e)):null}_findOriginalError(e){let t=e&&ig(e);for(;t&&ig(t);)t=ig(t);return t||null}}const yC=(()=>("undefined"!=typeof requestAnimationFrame&&requestAnimationFrame||setTimeout).bind(cn))();function ly(n){return n.ownerDocument.defaultView}function sg(n){return n.ownerDocument}function Ja(n){return n instanceof Function?n():n}var Co=(()=>((Co=Co||{})[Co.Important=1]="Important",Co[Co.DashCase=2]="DashCase",Co))();function uy(n,e){return undefined(n,e)}function lf(n){const e=n[3];return No(e)?e[3]:e}function $d(n){return EC(n[13])}function hy(n){return EC(n[4])}function EC(n){for(;null!==n&&!No(n);)n=n[4];return n}function Gd(n,e,t,i,r){if(null!=i){let s,o=!1;No(i)?s=i:Fo(i)&&(o=!0,i=i[0]);const a=qi(i);0===n&&null!==t?null==r?AC(e,t,a):el(e,t,a,r||null,!0):1===n&&null!==t?el(e,t,a,r||null,!0):2===n?function(n,e,t){const i=ag(n,e);i&&function(n,e,t,i){Ii(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!==qi(t)&&Gd(e,n,i,s,r);for(let a=10;a0&&(n[t-1][4]=i[4]);const s=kl(n,10+e);!function(n,e){Wd(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 my(n,e){if(!(256&e[2])){const t=e[11];Ii(t)&&t.destroyNode&&Wd(n,e,t,3,null,null),function(n){let e=n[13];if(!e)return og(n[1],n);for(;e;){let t=null;if(Fo(e))t=e[13];else{const i=e[10];i&&(t=i)}if(!t){for(;e&&!e[4]&&e!==n;)Fo(e)&&og(e[1],e),e=e[3];null===e&&(e=n),Fo(e)&&og(e[1],e),t=e&&e[4]}e=t}}(e)}}function og(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!==uf(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 iT(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+=jC(s,r),r=""),i=o,s=s||!wa(i);t++}return""!==r&&(e+=jC(s,r)),e}const kt={};function G(n){UC(Dn(),Oe(),As()+n,Hh())}function UC(n,e,t,i){if(!i)if(3==(3&e[2])){const s=n.preOrderCheckHooks;null!==s&&Fp(e,s,t)}else{const s=n.preOrderHooks;null!==s&&Np(e,s,0,t)}Hs(t)}function tl(n,e){return n<<17|e<<2}function Bt(n){return n>>17&32767}function Yi(n){return 2|n}function Vl(n){return(131068&n)>>2}function nl(n,e){return-131069&n|e<<2}function wy(n){return 1|n}function ZC(n,e){const t=n.contentQueries;if(null!==t)for(let i=0;i20&&UC(n,e,20,Hh()),t(i,r)}finally{Hs(s)}}function JC(n,e,t){if(p_(e)){const r=e.directiveEnd;for(let s=e.directiveStart;s0;){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 lw(n,e){null!==n.hostBindings&&n.hostBindings(1,e)}function cw(n,e){e.flags|=2,(n.components||(n.components=[])).push(e.index)}function IT(n,e,t){if(t){if(e.exportAs)for(let i=0;i0&&ky(t)}}function ky(n){for(let i=$d(n);null!==i;i=hy(i))for(let r=10;r0&&ky(s)}const t=n[1].components;if(null!==t)for(let i=0;i0&&ky(r)}}function BT(n,e){const t=fs(e,n),i=t[1];(function(n,e){for(let t=e.length;tPromise.resolve(null))();function hw(n){return n[7]||(n[7]=[])}function _g(n){return n.cleanup||(n.cleanup=[])}function Vy(n,e,t){return(null===n||pa(n))&&(t=function(n){for(;Array.isArray(n);){if("object"==typeof n[1])return n;n=n[0]}return null}(t[e.index])),t[11]}function zy(n,e){const t=n[9],i=t?t.get($o,null):null;i&&i.handleError(e)}function fw(n,e,t,i,r){for(let s=0;sthis.processProvider(a,e,t)),zo([e],a=>this.processInjectorType(a,[],s)),this.records.set(Fc,zu(void 0,this));const o=this.records.get(Vu);this.scope=null!=o?o.value:null,this.source=r||("object"==typeof e?null:W(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=Pu,i=At.Default){this.assertNotDestroyed();const r=Fd(this),s=da(void 0);try{if(!(i&At.SkipSelf)){let a=this.records.get(e);if(void 0===a){const l=function(n){return"function"==typeof n||"object"==typeof n&&n instanceof ve}(e)&&rr(e);a=l&&this.injectableDefInScope(l)?zu(Gy(e),gf):null,this.records.set(e,a)}if(null!=a)return this.hydrate(e,a)}return(i&At.Self?pw():this.parent).get(e,t=i&At.Optional&&t===Pu?null:t)}catch(o){if("NullInjectorError"===o.name){if((o[Ac]=o[Ac]||[]).unshift(W(e)),r)throw o;return Ds(o,e,"R3InjectorError",this.source)}throw o}finally{da(s),Fd(r)}}_resolveInjectorDefTypes(){this.injectorDefTypes.forEach(e=>this.get(e))}toString(){const e=[];return this.records.forEach((i,r)=>e.push(W(r))),`R3Injector[${e.join(", ")}]`}assertNotDestroyed(){if(this._destroyed)throw new Error("Injector has already been destroyed.")}processInjectorType(e,t,i){if(!(e=D(e)))return!1;let r=Cu(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=Cu(s)),null==r)return!1;if(null!=r.imports&&!a){let d;i.push(o);try{zo(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||mi))}}this.injectorDefTypes.add(o);const l=wc(o)||(()=>new o);this.records.set(o,zu(l,gf));const c=r.providers;if(null!=c&&!a){const d=e;zo(c,f=>this.processProvider(f,d,c))}return void 0!==s&&void 0!==e.providers}processProvider(e,t,i){let r=Nc(e=D(e))?e:D(e&&e.provide);const s=function(n,e,t){return _w(n)?zu(void 0,n.useValue):zu(mw(n),gf)}(e);if(Nc(e)||!0!==e.multi)this.records.get(r);else{let o=this.records.get(r);o||(o=zu(void 0,gf,!0),o.factory=()=>ku(o.multi),this.records.set(r,o)),r=e,o.multi.push(e)}this.records.set(r,s)}hydrate(e,t){return t.value===gf&&(t.value=GT,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=D(e.providedIn);return"string"==typeof t?"any"===t||t===this.scope:this.injectorDefTypes.has(t)}}function Gy(n){const e=rr(n),t=null!==e?e.factory:wc(n);if(null!==t)return t;if(n instanceof ve)throw new Error(`Token ${W(n)} is missing a \u0275prov definition.`);if(n instanceof Function)return function(n){const e=n.length;if(e>0){const i=xc(e,"?");throw new Error(`Can't resolve all parameters for ${W(n)}: (${i.join(", ")}).`)}const t=function(n){const e=n&&(n[ua]||n[Ua]);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 mw(n,e,t){let i;if(Nc(n)){const r=D(n);return wc(r)||Gy(r)}if(_w(n))i=()=>D(n.useValue);else if(function(n){return!(!n||!n.useFactory)}(n))i=()=>n.useFactory(...ku(n.deps||[]));else if(function(n){return!(!n||!n.useExisting)}(n))i=()=>I(D(n.useExisting));else{const r=D(n&&(n.useClass||n.provide));if(!function(n){return!!n.deps}(n))return wc(r)||Gy(r);i=()=>new r(...ku(n.deps))}return i}function zu(n,e,t=!1){return{factory:n,value:e,multi:t?[]:void 0}}function _w(n){return null!==n&&"object"==typeof n&&Wp in n}function Nc(n){return"function"==typeof n}const yw=function(n,e,t){return function(n,e=null,t=null,i){const r=gw(n,e,t,i);return r._resolveInjectorDefTypes(),r}({name:t},e,n,t)};class Nt{static create(e,t){return Array.isArray(e)?yw(e,t,""):yw(e.providers,e.parent,e.name||"")}}function m7(n,e){kp(ry(n)[1],Dr())}function ct(n){let e=function(n){return Object.getPrototypeOf(n.prototype).constructor}(n.type),t=!0;const i=[n];for(;e;){let r;if(pa(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=oA(n.inputs),o.declaredInputs=oA(n.declaredInputs),o.outputs=oA(n.outputs);const a=r.hostBindings;a&&b7(n,a);const l=r.viewQuery,c=r.contentQueries;if(l&&y7(n,l),c&&v7(n,c),_u(n.inputs,r.inputs),_u(n.declaredInputs,r.declaredInputs),_u(n.outputs,r.outputs),pa(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=Xh(r.hostAttrs,t=Xh(t,r.hostAttrs))}}(i)}function oA(n){return n===_d?{}:n===mi?[]:n}function y7(n,e){const t=n.viewQuery;n.viewQuery=t?(i,r)=>{e(i,r),t(i,r)}:e}function v7(n,e){const t=n.contentQueries;n.contentQueries=t?(i,r,s)=>{e(i,r,s),t(i,r,s)}:e}function b7(n,e){const t=n.hostBindings;n.hostBindings=t?(i,r)=>{e(i,r),t(i,r)}:e}Nt.THROW_IF_NOT_FOUND=Pu,Nt.NULL=new Ps,Nt.\u0275prov=ue({token:Nt,providedIn:"any",factory:()=>I(Fc)}),Nt.__NG_ELEMENT_ID__=-1;let Ew=null;function vg(){if(!Ew){const n=cn.Symbol;if(n&&n.iterator)Ew=n.iterator;else{const e=Object.getOwnPropertyNames(Map.prototype);for(let t=0;ta(qi(N[i.index])):i.index;if(Ii(t)){let N=null;if(!a&&l&&(N=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!==N)(N.__ngLastListenerFn__||N).__ngNextListenerFn__=s,N.__ngLastListenerFn__=s,g=!1;else{s=fA(i,e,f,s,!1);const V=t.listen(C,r,s);p.push(s,V),d&&d.push(r,x,w,w+1)}}else s=fA(i,e,f,s,!0),C.addEventListener(r,s,o),p.push(s),d&&d.push(r,x,w,o)}else s=fA(i,e,f,s,!1);const _=i.outputs;let y;if(g&&null!==_&&(y=_[r])){const v=y.length;if(v)for(let C=0;C0;)e=e[15],n--;return e}(n,Yt.lFrame.contextLView))[8]}(n)}function J7(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 ts={textEnd:0,key:0,keyEnd:0,value:0,valueEnd:0};function FN(n){return n.substring(ts.key,ts.keyEnd)}function NN(n,e){const t=ts.textEnd;return t===e?-1:(e=ts.keyEnd=function(n,e,t){for(;e32;)e++;return e}(n,ts.key=e,t),Ig(n,e,t))}function Ig(n,e,t){for(;e=0;t=NN(e,t))yo(n,FN(e),!0)}function $l(n,e,t,i){const r=Oe(),s=Dn(),o=mo(2);s.firstUpdatePass&&UN(s,n,o,i),e!==kt&&qs(r,o,e)&&$N(s,s.data[As()],r,r[11],n,r[o+1]=function(n,e){return null==n||("string"==typeof e?n+=e:"object"==typeof n&&(n=W(gs(n)))),n}(e,t),i,o)}function Gl(n,e,t,i){const r=Dn(),s=mo(2);r.firstUpdatePass&&UN(r,null,s,i);const o=Oe();if(t!==kt&&qs(o,s,t)){const a=r.data[As()];if(WN(a,i)&&!jN(r,s)){let l=i?a.classesWithoutHost:a.stylesWithoutHost;null!==l&&(t=Y(l,t||"")),hA(r,a,o,t,i)}else!function(n,e,t,i,r,s,o,a){r===kt&&(r=mi);let l=0,c=0,d=0=n.expandoStartIndex}function UN(n,e,t,i){const r=n.data;if(null===r[t+1]){const s=r[As()],o=jN(n,t);WN(s,i)&&null===e&&!o&&(e=!1),e=function(n,e,t,i){const r=M_(n);let s=i?e.residualClasses:e.residualStyles;if(null===r)0===(i?e.classBindings:e.styleBindings)&&(t=ev(t=gA(null,n,e,t,i),e.attrs,i),s=null);else{const o=e.directiveStylingLast;if(-1===o||n[o]!==r)if(t=gA(r,n,e,t,i),null===s){let l=function(n,e,t){const i=t?e.classBindings:e.styleBindings;if(0!==Vl(i))return n[Bt(i)]}(n,e,i);void 0!==l&&Array.isArray(l)&&(l=gA(null,n,e,l[1],i),l=ev(l,e.attrs,i),function(n,e,t,i){n[Bt(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=Bt(n[a+1]);n[i+1]=tl(p,a),0!==p&&(n[p+1]=nl(n[p+1],i)),n[a+1]=function(n,e){return 131071&n|e<<17}(n[a+1],i)}else n[i+1]=tl(a,0),0!==a&&(n[a+1]=nl(n[a+1],i)),a=i;else n[i+1]=tl(l,0),0===a?a=i:n[l+1]=nl(n[l+1],i),l=i;c&&(n[i+1]=Yi(n[i+1])),kN(n,d,i,!0),kN(n,d,i,!1),function(n,e,t,i,r){const s=r?n.residualClasses:n.residualStyles;null!=s&&"string"==typeof e&&Qr(s,e)>=0&&(t[i+1]=wy(t[i+1]))}(e,d,n,i,s),o=tl(a,l),s?e.classBindings=o:e.styleBindings=o}(r,s,e,t,o,i)}}function gA(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===kt&&(p=f?mi:void 0);let g=f?z_(p,i):d===i?p:void 0;if(c&&!Tw(g)&&(g=z_(l,i)),Tw(g)&&(a=g,o))return a;const _=n[r+1];r=o?Bt(_):Vl(_)}if(null!==e){let l=s?e.residualClasses:e.residualStyles;null!=l&&(a=z_(l,i))}return a}function Tw(n){return void 0!==n}function WN(n,e){return 0!=(n.flags&(e?16:32))}function De(n,e=""){const t=Oe(),i=Dn(),r=n+20,s=i.firstCreatePass?Yd(i,r,1,e,null):i.data[r],o=t[r]=function(n,e){return Ii(n)?n.createText(e):n.createTextNode(e)}(t[11],e);lg(i,t,o,s),Ga(s,!1)}function xi(n){return or("",n,""),xi}function or(n,e,t){const i=Oe(),r=Cg(i,n,e,t);return r!==kt&&zl(i,As(),r),or}function Aw(n,e,t,i,r){const s=Oe(),o=function(n,e,t,i,r,s){const a=mf(n,Us(),t,r);return mo(2),a?e+pe(t)+i+pe(r)+s:kt}(s,n,e,t,i,r);return o!==kt&&zl(s,As(),o),Aw}function al(n,e,t){const i=Oe();return qs(i,_a(),e)&&wo(Dn(),sr(),i,n,e,i[11],t,!0),al}function Pg(n,e,t){const i=Oe();if(qs(i,_a(),e)){const s=Dn(),o=sr();wo(s,o,i,n,e,Vy(M_(s.data),o,i),t,!0)}return Pg}const bf=void 0;var FY=["en",[["a","p"],["AM","PM"],bf],[["AM","PM"],bf,bf],[["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"]],bf,[["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"]],bf,[["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}",bf,"{1} 'at' {0}",bf],[".",",",";","%","+","-","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 Rg={};function dL(n){return n in Rg||(Rg[n]=cn.ng&&cn.ng.common&&cn.ng.common.locales&&cn.ng.common.locales[n]),Rg[n]}var at=(()=>((at=at||{})[at.LocaleId=0]="LocaleId",at[at.DayPeriodsFormat=1]="DayPeriodsFormat",at[at.DayPeriodsStandalone=2]="DayPeriodsStandalone",at[at.DaysFormat=3]="DaysFormat",at[at.DaysStandalone=4]="DaysStandalone",at[at.MonthsFormat=5]="MonthsFormat",at[at.MonthsStandalone=6]="MonthsStandalone",at[at.Eras=7]="Eras",at[at.FirstDayOfWeek=8]="FirstDayOfWeek",at[at.WeekendRange=9]="WeekendRange",at[at.DateFormat=10]="DateFormat",at[at.TimeFormat=11]="TimeFormat",at[at.DateTimeFormat=12]="DateTimeFormat",at[at.NumberSymbols=13]="NumberSymbols",at[at.NumberFormats=14]="NumberFormats",at[at.CurrencyCode=15]="CurrencyCode",at[at.CurrencySymbol=16]="CurrencySymbol",at[at.CurrencyName=17]="CurrencyName",at[at.Currencies=18]="Currencies",at[at.Directionality=19]="Directionality",at[at.PluralCase=20]="PluralCase",at[at.ExtraData=21]="ExtraData",at))();const Dw="en-US";let hL=Dw;function mA(n){Gi(n,"Expected localeId to be defined"),"string"==typeof n&&(hL=n.toLowerCase().replace(/_/g,"-"))}function vA(n,e,t,i,r){if(n=D(n),Array.isArray(n))for(let s=0;s>20;if(Nc(n)||!n.multi){const g=new Yh(l,r,E),_=CA(a,e,r?d:d+p,f);-1===_?(Sc(ps(c,o),s,a),bA(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=CA(a,e,d+p,f),_=CA(a,e,d,d+p),y=g>=0&&t[g],v=_>=0&&t[_];if(r&&!v||!r&&!y){Sc(ps(c,o),s,a);const C=function(n,e,t,i,r){const s=new Yh(n,t,E);return s.multi=[],s.index=e,s.componentProviders=0,NL(s,r,i&&!t),s}(r?PX:IX,t.length,r,i,l);!r&&v&&(t[_].providerFactory=C),bA(s,n,e.length,0),e.push(a),c.directiveStart++,c.directiveEnd++,r&&(c.providerIndexes+=1048576),t.push(C),o.push(C)}else bA(s,n,g>-1?g:_,NL(t[r?_:g],l,!r&&i));!r&&i&&v&&t[_].componentProviders++}}}function bA(n,e,t,i){const r=Nc(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 NL(n,e,t){return t&&n.componentProviders++,n.multi.push(e)-1}function CA(n,e,t,i){for(let r=t;r{t.providersResolver=(i,r)=>function(n,e,t){const i=Dn();if(i.firstCreatePass){const r=pa(n);vA(t,i.data,i.blueprint,r,!0),vA(e,i.data,i.blueprint,r,!1)}}(i,r?r(n):n,e)}}class LL{}const VL="ngComponent";class FX{resolveComponentFactory(e){throw function(n){const e=Error(`No component factory found for ${W(n)}. Did you add it to @NgModule.entryComponents?`);return e[VL]=n,e}(e)}}class ll{}function kw(...n){}function Fg(n,e){return new rt(Ts(n,e))}ll.NULL=new FX;const BX=function(){return Fg(Dr(),Oe())};let rt=(()=>{class n{constructor(t){this.nativeElement=t}}return n.__NG_ELEMENT_ID__=BX,n})();function zL(n){return n instanceof rt?n.nativeElement:n}class Cf{}let zc=(()=>{class n{}return n.__NG_ELEMENT_ID__=()=>zX(),n})();const zX=function(){const n=Oe(),t=fs(Dr().index,n);return function(n){return n[11]}(Fo(t)?t:n)};let SA=(()=>{class n{}return n.\u0275prov=ue({token:n,providedIn:"root",factory:()=>null}),n})();class ju{constructor(e){this.full=e,this.major=e.split(".")[0],this.minor=e.split(".")[1],this.patch=e.split(".").slice(2).join(".")}}const jL=new ju("12.2.5");class UL{constructor(){}supports(e){return Ky(e)}create(e){return new $X(e)}}const HX=(n,e)=>e;class $X{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||HX}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<$L(i,r,s)?t:i,a=$L(o,r,s),l=o.currentIndex;if(o===i)r--,i=i._nextRemoved;else if(t=t._next,null==o.previousIndex)r++;else{s||(s=[]);const c=a-r,d=l-r;if(c!=d){for(let p=0;p{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 GX(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 HL),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 HL),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 GX{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 WX{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 HL{constructor(){this.map=new Map}put(e){const t=e.trackById;let i=this.map.get(t);i||(i=new WX,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 $L(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 YX(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 YX{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 WL(){return new Ng([new UL])}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||WL()),deps:[[n,new Za,new br]]}}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=ue({token:n,providedIn:"root",factory:WL}),n})();function qL(){return new Lg([new GL])}let Lg=(()=>{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||qL()),deps:[[n,new Za,new br]]}}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=ue({token:n,providedIn:"root",factory:qL}),n})();function Fw(n,e,t,i,r=!1){for(;null!==t;){const s=e[t.index];if(null!==s&&i.push(qi(s)),No(s))for(let a=10;a-1&&(gy(e,i),kl(t,i))}this._attachedToViewContainer=!1}my(this._lView[1],this._lView)}onDestroy(e){tw(this._lView[1],this._lView,null,e)}markForCheck(){Fy(this._cdRefInjectingView||this._lView)}detach(){this._lView[2]&=-129}reattach(){this._lView[2]|=128}detectChanges(){Ly(this._lView[1],this._lView,this.context)}checkNoChanges(){!function(n,e,t){Ip(!0);try{Ly(n,e,t)}finally{Ip(!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){Wd(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 KX extends sv{constructor(e){super(e),this._view=e}detectChanges(){dw(this._view)}checkNoChanges(){!function(n){Ip(!0);try{dw(n)}finally{Ip(!1)}}(this._view)}get context(){return null}}const QX=function(n){return function(n,e,t){if(Cd(n)&&!t){const i=fs(n.index,e);return new sv(i,i)}return 47&n.type?new sv(e[16],e):null}(Dr(),Oe(),16==(16&n))};let kn=(()=>{class n{}return n.__NG_ELEMENT_ID__=QX,n})();const tK=[new GL],iK=new Ng([new UL]),rK=new Lg(tK),oK=function(){return Nw(Dr(),Oe())};let Ys=(()=>{class n{}return n.__NG_ELEMENT_ID__=oK,n})();const aK=Ys,lK=class extends aK{constructor(e,t,i){super(),this._declarationLView=e,this._declarationTContainer=t,this.elementRef=i}createEmbeddedView(e){const t=this._declarationTContainer.tViews,i=hf(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)),ff(t,i,e),new sv(i)}};function Nw(n,e){return 4&n.type?new lK(e,n,Fg(n,e)):null}class jc{}const dK=function(){return ZL(Dr(),Oe())};let ns=(()=>{class n{}return n.__NG_ELEMENT_ID__=dK,n})();const fK=ns,XL=class extends fK{constructor(e,t,i){super(),this._lContainer=e,this._hostTNode=t,this._hostLView=i}get element(){return Fg(this._hostTNode,this._hostLView)}get injector(){return new Bo(this._hostTNode,this._hostLView)}get parentInjector(){const e=Kh(this._hostTNode,this._hostLView);if(F0(e)){const t=qa(e,this._hostLView),i=Td(e);return new Bo(t[1].data[i+8],t)}return new Bo(null,this._hostLView)}clear(){for(;this.length>0;)this.remove(this.length-1)}get(e){const t=KL(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(jc,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 No(n[3])}(i)){const d=this.indexOf(e);if(-1!==d)this.detach(d);else{const f=i[3],p=new XL(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),iyC});class vB extends LL{constructor(e,t){super(),this.componentDef=e,this.ngModule=t,this.componentType=e.type,this.selector=function(n){return n.map(lT).join(",")}(e.selectors),this.ngContentSelectors=e.ngContentSelectors?e.ngContentSelectors:[],this.isBoundToModule=!!t}get inputs(){return yB(this.componentDef.inputs)}get outputs(){return yB(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,jg,r);return s!==jg||i===jg?s:e.get(t,i,r)}}}(e,r.injector):e,o=s.get(Cf,Su),a=s.get(SA,null),l=o.createRenderer(null,this.componentDef),c=this.componentDef.selectors[0][0]||"div",d=i?function(n,e,t){if(Ii(n))return n.selectRootElement(e,t===Ue.ShadowDom);let i="string"==typeof e?n.querySelector(e):e;return i.textContent="",i}(l,i,this.componentDef.encapsulation):py(o.createRenderer(null,this.componentDef),c,function(n){const e=n.toLowerCase();return"svg"===e?Wn:"math"===e?"http://www.w3.org/1998/MathML/":null}(c)),f=this.componentDef.onPush?576:528,p=function(n,e){return{components:[],scheduler:n||yC,clean:HT,playerHandler:e||null,flags:0}}(),g=gg(0,null,null,1,0,null,null,null,null,null),_=hf(null,g,p,f,null,null,o,l,a,s);let y,v;Wh(_);try{const C=function(n,e,t,i,r,s){const o=t[1];t[20]=n;const l=Yd(o,20,2,"#host",null),c=l.mergedAttrs=e.hostAttrs;null!==c&&(yg(l,c,!0),null!==n&&(Lp(r,n,c),null!==l.classes&&by(r,n,l.classes),null!==l.styles&&LC(r,n,l.styles)));const d=i.createRenderer(n,e),f=hf(t,pg(e),null,e.onPush?64:16,t[20],l,i,d,s||null,null);return o.firstCreatePass&&(Sc(ps(l,t),o,e.type),cw(o,l),Iy(l,t.length,1)),mg(t,f),t[20]=f}(d,this.componentDef,_,o,l);if(d)if(i)Lp(l,d,["ng-version",jL.full]);else{const{attrs:w,classes:x}=function(n){const e=[],t=[];let i=1,r=2;for(;i0&&by(l,d,x.join(" "))}if(v=C_(g,20),void 0!==t){const w=v.projection=[];for(let x=0;xl(o,e)),e.contentQueries){const l=Dr();e.contentQueries(1,o,l.directiveStart)}const a=Dr();return!s.firstCreatePass||null===e.hostBindings&&null===e.hostAttrs||(Hs(a.index),aw(t[1],a,0,a.directiveStart,a.directiveEnd,e),lw(e,o)),o}(C,this.componentDef,_,p,[m7]),ff(g,_,null)}finally{Cn()}return new hZ(this.componentType,y,Fg(v,_),_,v)}}class hZ 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 KX(r),this.componentType=e}get injector(){return new Bo(this._tNode,this._rootLView)}destroy(){this.hostView.destroy()}onDestroy(e){this.hostView.onDestroy(e)}}const Ug=new Map;class gZ extends jc{constructor(e,t){super(),this._parent=t,this._bootstrapComponents=[],this.injector=this,this.destroyCbs=[],this.componentFactoryResolver=new _B(this);const i=po(e),r=function(n){return n[xx]||null}(e);r&&mA(r),this._bootstrapComponents=Ja(i.bootstrap),this._r3Injector=gw(e,t,[{provide:jc,useValue:this},{provide:ll,useValue:this.componentFactoryResolver}],W(e)),this._r3Injector._resolveInjectorDefTypes(),this.instance=this.get(e)}get(e,t=Nt.THROW_IF_NOT_FOUND,i=At.Default){return e===Nt||e===jc||e===Fc?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 BA extends class{}{constructor(e){super(),this.moduleType=e,null!==po(e)&&function(n){const e=new Set;!function t(i){const r=po(i,!0),s=r.id;null!==s&&(function(n,e,t){if(e&&e!==t)throw new Error(`Duplicate module registered for ${n} - ${W(e)} vs ${W(e.name)}`)}(s,Ug.get(s),i),Ug.set(s,i));const o=Ja(r.imports);for(const a of o)e.has(a)||(e.add(a),t(a))}(n)}(e)}create(e){return new gZ(this.moduleType,e)}}function fv(n,e,t){const i=Yr()+n,r=Oe();return r[i]===kt?Bc(r,i,t?e.call(t):e()):function(n,e){return n[e]}(r,i)}function Hg(n,e,t,i){return wB(Oe(),Yr(),n,e,t,i)}function pv(n,e){const t=n[e];return t===kt?void 0:t}function wB(n,e,t,i,r,s){const o=e+t;return qs(n,o,r)?Bc(n,o+1,s?i.call(s,r):i(r)):pv(n,o+1)}function Kt(n,e){const t=Dn();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 $("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=wc(i.type)),o=da(E);try{const a=Bp(!1),l=s();return Bp(a),function(n,e,t,i){t>=n.data.length&&(n.data[t]=null,n.blueprint[t]=null),e[t]=i}(t,Oe(),r,l),l}finally{da(o)}}function rn(n,e,t){const i=n+20,r=Oe(),s=Ed(r,i);return _v(r,mv(r,i)?wB(r,Yr(),e,s.transform,t,s):s.transform(t))}function gv(n,e,t,i){const r=n+20,s=Oe(),o=Ed(s,r);return _v(s,mv(s,r)?function(n,e,t,i,r,s,o){const a=e+t;return mf(n,a,r,s)?Bc(n,a+2,o?i.call(o,r,s):i(r,s)):pv(n,a+2)}(s,Yr(),e,o.transform,t,i,o):o.transform(t,i))}function mv(n,e){return n[1].data[e].pure}function _v(n,e){return Ul.isWrapped(e)&&(e=Ul.unwrap(e),n[Us()]=kt),e}function VA(n){return e=>{setTimeout(n,void 0,e)}}const Le=class extends Se{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=VA(l),a&&(a=VA(a)),c&&(c=VA(c)));const d=super.subscribe({next:a,error:l,complete:c});return e instanceof Te&&e.add(d),d}};function DZ(){return this._results[vg()]()}class Sf{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=vg(),i=Sf.prototype;i[t]||(i[t]=DZ)}get changes(){return this._changes||(this._changes=new Le)}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=Vo(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=kw,this.reject=kw,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)(I(Mf,8))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();const vv=new ve("AppId"),uQ={provide:vv,useFactory:function(){return`${KA()}${KA()}${KA()}`},deps:[]};function KA(){return String.fromCharCode(97+Math.floor(25*Math.random()))}const XB=new ve("Platform Initializer"),dl=new ve("Platform ID"),bv=new ve("appBootstrapListener");let $w=(()=>{class n{log(t){console.log(t)}warn(t){console.warn(t)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();const Uu=new ve("LocaleId"),KB=new ve("DefaultCurrencyCode");class hQ{constructor(e,t){this.ngModuleFactory=e,this.componentFactories=t}}const ZA=function(n){return new BA(n)},fQ=ZA,pQ=function(n){return Promise.resolve(ZA(n))},ZB=function(n){const e=ZA(n),i=Ja(po(n).declarations).reduce((r,s)=>{const o=Kn(s);return o&&r.push(new vB(o)),r},[]);return new hQ(e,i)},gQ=ZB,mQ=function(n){return Promise.resolve(ZB(n))};let xf=(()=>{class n{constructor(){this.compileModuleSync=fQ,this.compileModuleAsync=pQ,this.compileModuleAndAllComponentsSync=gQ,this.compileModuleAndAllComponentsAsync=mQ}clearCache(){}clearCacheFor(t){}getModuleId(t){}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();const QB=new ve("compilerOptions"),yQ=(()=>Promise.resolve(0))();function QA(n){"undefined"==typeof Zone?yQ.then(()=>{n&&n.apply(null,null)}):Zone.current.scheduleMicroTask("scheduleMicrotask",n)}class dt{constructor({enableLongStackTrace:e=!1,shouldCoalesceEventChangeDetection:t=!1,shouldCoalesceRunChangeDetection:i=!1}){if(this.hasPendingMacrotasks=!1,this.hasPendingMicrotasks=!1,this.isStable=!0,this.onUnstable=new Le(!1),this.onMicrotaskEmpty=new Le(!1),this.onStable=new Le(!1),this.onError=new Le(!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=cn.requestAnimationFrame,e=cn.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(cn,()=>{n.fakeTopEventTask||(n.fakeTopEventTask=Zone.root.scheduleEventTask("fakeTopEventTask",()=>{n.lastRequestAnimationFrameId=-1,eD(n),n.isCheckStableRunning=!0,JA(n),n.isCheckStableRunning=!1},void 0,()=>{},()=>{})),n.fakeTopEventTask.invoke()}),eD(n))}(n)};n._inner=n._inner.fork({name:"angular",properties:{isAngularZone:!0},onInvokeTask:(t,i,r,s,o,a)=>{try{return JB(n),t.invokeTask(r,s,o,a)}finally{(n.shouldCoalesceEventChangeDetection&&"eventTask"===s.type||n.shouldCoalesceRunChangeDetection)&&e(),e3(n)}},onInvoke:(t,i,r,s,o,a,l)=>{try{return JB(n),t.invoke(r,s,o,a,l)}finally{n.shouldCoalesceRunChangeDetection&&e(),e3(n)}},onHasTask:(t,i,r,s)=>{t.hasTask(r,s),i===r&&("microTask"==s.change?(n._hasPendingMicrotasks=s.microTask,eD(n),JA(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(!dt.isInAngularZone())throw new Error("Expected to be in Angular Zone, but it is not!")}static assertNotInAngularZone(){if(dt.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,bQ,kw,kw);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 bQ={};function JA(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 eD(n){n.hasPendingMicrotasks=!!(n._hasPendingMicrotasks||(n.shouldCoalesceEventChangeDetection||n.shouldCoalesceRunChangeDetection)&&-1!==n.lastRequestAnimationFrameId)}function JB(n){n._nesting++,n.isStable&&(n.isStable=!1,n.onUnstable.emit(null))}function e3(n){n._nesting--,JA(n)}class EQ{constructor(){this.hasPendingMicrotasks=!1,this.hasPendingMacrotasks=!1,this.isStable=!0,this.onUnstable=new Le,this.onMicrotaskEmpty=new Le,this.onStable=new Le,this.onError=new Le}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 tD=(()=>{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:()=>{dt.assertNotInAngularZone(),QA(()=>{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())QA(()=>{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)(I(dt))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})(),t3=(()=>{class n{constructor(){this._applications=new Map,nD.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 nD.findTestabilityInTree(this,t,i)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();class SQ{addToWindow(e){}findTestabilityInTree(e,t,i){return null}}let nD=new SQ,n3=!0,i3=!1;function Mo(){return i3=!0,n3}let Yl;const r3=new ve("AllowMultipleToken");function s3(n,e,t=[]){const i=`Platform: ${e}`,r=new ve(i);return(s=[])=>{let o=rD();if(!o||o.injector.get(r3,!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(Yl&&!Yl.destroyed&&!Yl.injector.get(r3,!1))throw new Error("There can be only one platform. Destroy the previous one to create a new one.");Yl=n.get(o3);const e=n.get(XB,null);e&&e.forEach(t=>t())}(Nt.create({providers:a,name:i}))}return function(n){const e=rD();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 rD(){return Yl&&!Yl.destroyed?Yl:null}let o3=(()=>{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 EQ:("zone.js"===n?void 0:n)||new dt({enableLongStackTrace:Mo(),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:dt,useValue:a}];return a.run(()=>{const c=Nt.create({providers:l,parent:this.injector,name:t.moduleType.name}),d=t.create(c),f=d.injector.get($o,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(()=>{sD(this._modules,d),p.unsubscribe()})}),function(n,e,t){try{const i=t();return Og(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(Gg);return p.runInitializers(),p.donePromise.then(()=>(mA(d.injector.get(Uu,Dw)||Dw),this._moduleDoBootstrap(d),d))})})}bootstrapModule(t,i=[]){const r=a3({},i);return function(n,e,t){const i=new BA(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 ${W(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)(I(Nt))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();function a3(n,e){return Array.isArray(e)?e.reduce(a3,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 ce(c=>{this._stable=this._zone.isStable&&!this._zone.hasPendingMacrotasks&&!this._zone.hasPendingMicrotasks,this._zone.runOutsideAngular(()=>{c.next(this._stable),c.complete()})}),l=new ce(c=>{let d;this._zone.runOutsideAngular(()=>{d=this._zone.onStable.subscribe(()=>{dt.assertNotInAngularZone(),QA(()=>{!this._stable&&!this._zone.hasPendingMacrotasks&&!this._zone.hasPendingMicrotasks&&(this._stable=!0,c.next(!0))})})});const f=this._zone.onUnstable.subscribe(()=>{dt.assertInAngularZone(),this._stable&&(this._stable=!1,this._zone.runOutsideAngular(()=>{c.next(!1)}))});return()=>{d.unsubscribe(),f.unsubscribe()}});this.isStable=Ni(a,l.pipe(Vs()))}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 LL?t:this._componentFactoryResolver.resolveComponentFactory(t),this.componentTypes.push(r.componentType);const s=function(n){return n.isBoundToModule}(r)?void 0:this._injector.get(jc),a=r.create(Nt.NULL,[],i||r.selector,s),l=a.location.nativeElement,c=a.injector.get(tD,null),d=c&&a.injector.get(t3);return c&&d&&d.registerApplication(l,c),a.onDestroy(()=>{this.detachView(a.hostView),sD(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;sD(this._views,i),i.detachFromAppRef()}_loadComponent(t){this.attachView(t.hostView),this.tick(),this.components.push(t),this._injector.get(bv,[]).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)(I(dt),I(Nt),I($o),I(ll),I(Gg))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();function sD(n,e){const t=n.indexOf(e);t>-1&&n.splice(t,1)}const ZQ=s3(null,"core",[{provide:dl,useValue:"unknown"},{provide:o3,deps:[Nt]},{provide:t3,deps:[]},{provide:$w,deps:[]}]),nJ=[{provide:Jd,useClass:Jd,deps:[dt,Nt,$o,ll,Gg]},{provide:cZ,deps:[dt],useFactory:function(n){let e=[];return n.onStable.subscribe(()=>{for(;e.length;)e.pop()()}),function(t){e.push(t)}}},{provide:Gg,useClass:Gg,deps:[[new br,Mf]]},{provide:xf,useClass:xf,deps:[]},uQ,{provide:Ng,useFactory:function(){return iK},deps:[]},{provide:Lg,useFactory:function(){return rK},deps:[]},{provide:Uu,useFactory:function(n){return mA(n=n||"undefined"!=typeof $localize&&$localize.locale||Dw),n},deps:[[new Ld(Uu),new br,new Za]]},{provide:KB,useValue:"USD"}];let rJ=(()=>{class n{constructor(t){}}return n.\u0275fac=function(t){return new(t||n)(I(Jd))},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({providers:nJ}),n})(),tE=null;function Uc(){return tE}const ut=new ve("DocumentToken");let Df=(()=>{class n{historyGo(t){throw new Error("Not implemented")}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ue({factory:iee,token:n,providedIn:"platform"}),n})();function iee(){return I(F3)}let F3=(()=>{class n extends Df{constructor(t){super(),this._doc=t,this._init()}_init(){this.location=window.location,this._history=window.history}getBaseHrefFromDOM(){return Uc().getBaseHref(this._doc)}onPopState(t){const i=Uc().getGlobalEventTarget(this._doc,"window");return i.addEventListener("popstate",t,!1),()=>i.removeEventListener("popstate",t)}onHashChange(t){const i=Uc().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){N3()?this._history.pushState(t,i,r):this.location.hash=r}replaceState(t,i,r){N3()?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)(I(ut))},n.\u0275prov=ue({factory:see,token:n,providedIn:"platform"}),n})();function N3(){return!!window.history.pushState}function see(){return new F3(I(ut))}function bD(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}function L3(n){const e=n.match(/#|\?|$/),t=e&&e.index||n.length;return n.slice(0,t-("/"===n[t-1]?1:0))+n.slice(t)}function $u(n){return n&&"?"!==n[0]?"?"+n:n}let Yg=(()=>{class n{historyGo(t){throw new Error("Not implemented")}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ue({factory:oee,token:n,providedIn:"root"}),n})();function oee(n){const e=I(ut).location;return new B3(I(Df),e&&e.origin||"")}const CD=new ve("appBaseHref");let B3=(()=>{class n extends Yg{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 bD(this._baseHref,t)}path(t=!1){const i=this._platformLocation.pathname+$u(this._platformLocation.search),r=this._platformLocation.hash;return r&&t?`${i}${r}`:i}pushState(t,i,r,s){const o=this.prepareExternalUrl(r+$u(s));this._platformLocation.pushState(t,i,o)}replaceState(t,i,r,s){const o=this.prepareExternalUrl(r+$u(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)(I(Df),I(CD,8))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})(),Xg=(()=>{class n{constructor(t,i){this._subject=new Le,this._urlChangeListeners=[],this._platformStrategy=t;const r=this._platformStrategy.getBaseHref();this._platformLocation=i,this._baseHref=L3(V3(r)),this._platformStrategy.onPopState(s=>{this._subject.emit({url:this.path(!0),pop:!0,state:s.state,type:s.type})})}path(t=!1){return this.normalize(this._platformStrategy.path(t))}getState(){return this._platformLocation.getState()}isCurrentPathEqualTo(t,i=""){return this.path()==this.normalize(t+$u(i))}normalize(t){return n.stripTrailingSlash(function(n,e){return n&&e.startsWith(n)?e.substring(n.length):e}(this._baseHref,V3(t)))}prepareExternalUrl(t){return t&&"/"!==t[0]&&(t="/"+t),this._platformStrategy.prepareExternalUrl(t)}go(t,i="",r=null){this._platformStrategy.pushState(r,"",t,i),this._notifyUrlChangeListeners(this.prepareExternalUrl(t+$u(i)),r)}replaceState(t,i="",r=null){this._platformStrategy.replaceState(r,"",t,i),this._notifyUrlChangeListeners(this.prepareExternalUrl(t+$u(i)),r)}forward(){this._platformStrategy.forward()}back(){this._platformStrategy.back()}historyGo(t=0){var i,r;null===(r=(i=this._platformStrategy).historyGo)||void 0===r||r.call(i,t)}onUrlChange(t){this._urlChangeListeners.push(t),this._urlChangeSubscription||(this._urlChangeSubscription=this.subscribe(i=>{this._notifyUrlChangeListeners(i.url,i.state)}))}_notifyUrlChangeListeners(t="",i){this._urlChangeListeners.forEach(r=>r(t,i))}subscribe(t,i,r){return this._subject.subscribe({next:t,error:i,complete:r})}}return n.\u0275fac=function(t){return new(t||n)(I(Yg),I(Df))},n.normalizeQueryParams=$u,n.joinWithSlash=bD,n.stripTrailingSlash=L3,n.\u0275prov=ue({factory:lee,token:n,providedIn:"root"}),n})();function lee(){return new Xg(I(Yg),I(Df))}function V3(n){return n.replace(/\/index.html$/,"")}var Br=(()=>((Br=Br||{})[Br.Zero=0]="Zero",Br[Br.One=1]="One",Br[Br.Two=2]="Two",Br[Br.Few=3]="Few",Br[Br.Many=4]="Many",Br[Br.Other=5]="Other",Br))();const mee=function(n){return function(n){const e=function(n){return n.toLowerCase().replace(/_/g,"-")}(n);let t=dL(e);if(t)return t;const i=e.split("-")[0];if(t=dL(i),t)return t;if("en"===i)return FY;throw new Error(`Missing locale data for the locale "${n}".`)}(n)[at.PluralCase]};class dE{}let Gee=(()=>{class n extends dE{constructor(t){super(),this.locale=t}getPluralCategory(t,i){switch(mee(i||this.locale)(t)){case Br.Zero:return"zero";case Br.One:return"one";case Br.Two:return"two";case Br.Few:return"few";case Br.Many:return"many";default:return"other"}}}return n.\u0275fac=function(t){return new(t||n)(I(Uu))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();function Y3(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}let hE=(()=>{class n{constructor(t,i,r,s){this._iterableDiffers=t,this._keyValueDiffers=i,this._ngEl=r,this._renderer=s,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&&(Ky(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(i=>this._toggleClass(i.key,i.currentValue)),t.forEachChangedItem(i=>this._toggleClass(i.key,i.currentValue)),t.forEachRemovedItem(i=>{i.previousValue&&this._toggleClass(i.key,!1)})}_applyIterableChanges(t){t.forEachAddedItem(i=>{if("string"!=typeof i.item)throw new Error(`NgClass can only toggle CSS classes expressed as strings, got ${W(i.item)}`);this._toggleClass(i.item,!0)}),t.forEachRemovedItem(i=>this._toggleClass(i.item,!1))}_applyClasses(t){t&&(Array.isArray(t)||t instanceof Set?t.forEach(i=>this._toggleClass(i,!0)):Object.keys(t).forEach(i=>this._toggleClass(i,!!t[i])))}_removeClasses(t){t&&(Array.isArray(t)||t instanceof Set?t.forEach(i=>this._toggleClass(i,!1)):Object.keys(t).forEach(i=>this._toggleClass(i,!1)))}_toggleClass(t,i){(t=t.trim())&&t.split(/\s+/g).forEach(r=>{i?this._renderer.addClass(this._ngEl.nativeElement,r):this._renderer.removeClass(this._ngEl.nativeElement,r)})}}return n.\u0275fac=function(t){return new(t||n)(E(Ng),E(Lg),E(rt),E(zc))},n.\u0275dir=oe({type:n,selectors:[["","ngClass",""]],inputs:{klass:["class","klass"],ngClass:"ngClass"}}),n})();class qee{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 pl=(()=>{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 qee(null,this._ngForOf,-1,-1),null===o?void 0:o),l=new X3(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 X3(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)(E(ns),E(Ys),E(Ng))},n.\u0275dir=oe({type:n,selectors:[["","ngFor","","ngForOf",""]],inputs:{ngForOf:"ngForOf",ngForTrackBy:"ngForTrackBy",ngForTemplate:"ngForTemplate"}}),n})();class X3{constructor(e,t){this.record=e,this.view=t}}let zr=(()=>{class n{constructor(t,i){this._viewContainer=t,this._context=new Xee,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){K3("ngIfThen",t),this._thenTemplateRef=t,this._thenViewRef=null,this._updateView()}set ngIfElse(t){K3("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)(E(ns),E(Ys))},n.\u0275dir=oe({type:n,selectors:[["","ngIf",""]],inputs:{ngIf:"ngIf",ngIfThen:"ngIfThen",ngIfElse:"ngIfElse"}}),n})();class Xee{constructor(){this.$implicit=null,this.ngIf=null}}function K3(n,e){if(e&&!e.createEmbeddedView)throw new Error(`${n} must be a TemplateRef, but received '${W(e)}'.`)}class OD{constructor(e,t){this._viewContainerRef=e,this._templateRef=t,this._created=!1}create(){this._created=!0,this._viewContainerRef.createEmbeddedView(this._templateRef)}destroy(){this._created=!1,this._viewContainerRef.clear()}enforceState(e){e&&!this._created?this.create():!e&&this._created&&this.destroy()}}let Av=(()=>{class n{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 i=t==this._ngSwitch;return this._lastCasesMatched=this._lastCasesMatched||i,this._lastCaseCheckIndex++,this._lastCaseCheckIndex===this._caseCount&&(this._updateDefaultCases(!this._lastCasesMatched),this._lastCaseCheckIndex=0,this._lastCasesMatched=!1),i}_updateDefaultCases(t){if(this._defaultViews&&t!==this._defaultUsed){this._defaultUsed=t;for(let i=0;i{class n{constructor(t,i,r){this.ngSwitch=r,r._addCase(),this._view=new OD(t,i)}ngDoCheck(){this._view.enforceState(this.ngSwitch._matchCase(this.ngSwitchCase))}}return n.\u0275fac=function(t){return new(t||n)(E(ns),E(Ys),E(Av,9))},n.\u0275dir=oe({type:n,selectors:[["","ngSwitchCase",""]],inputs:{ngSwitchCase:"ngSwitchCase"}}),n})(),Z3=(()=>{class n{constructor(t,i,r){r._addDefault(new OD(t,i))}}return n.\u0275fac=function(t){return new(t||n)(E(ns),E(Ys),E(Av,9))},n.\u0275dir=oe({type:n,selectors:[["","ngSwitchDefault",""]]}),n})(),J3=(()=>{class n{constructor(t,i,r){this._ngEl=t,this._differs=i,this._renderer=r,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,i){const[r,s]=t.split(".");null!=(i=null!=i&&s?`${i}${s}`:i)?this._renderer.setStyle(this._ngEl.nativeElement,r,i):this._renderer.removeStyle(this._ngEl.nativeElement,r)}_applyChanges(t){t.forEachRemovedItem(i=>this._setStyle(i.key,null)),t.forEachAddedItem(i=>this._setStyle(i.key,i.currentValue)),t.forEachChangedItem(i=>this._setStyle(i.key,i.currentValue))}}return n.\u0275fac=function(t){return new(t||n)(E(rt),E(Lg),E(zc))},n.\u0275dir=oe({type:n,selectors:[["","ngStyle",""]],inputs:{ngStyle:"ngStyle"}}),n})();function Ql(n,e){return Error(`InvalidPipeArgument: '${e}' for pipe '${W(n)}'`)}class Qee{createSubscription(e,t){return e.subscribe({next:t,error:i=>{throw i}})}dispose(e){e.unsubscribe()}onDestroy(e){e.unsubscribe()}}class Jee{createSubscription(e,t){return e.then(t,i=>{throw i})}dispose(e){}onDestroy(e){}}const ete=new Jee,tte=new Qee;let Hc=(()=>{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(Og(t))return ete;if(EN(t))return tte;throw Ql(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)(E(kn,16))},n.\u0275pipe=ds({name:"async",type:n,pure:!1}),n})();const ate=/#/g;let eV=(()=>{class n{constructor(t){this._localization=t}transform(t,i,r){if(null==t)return"";if("object"!=typeof i||null===i)throw Ql(n,i);return i[function(n,e,t,i){let r=`=${n}`;if(e.indexOf(r)>-1||(r=t.getPluralCategory(n,i),e.indexOf(r)>-1))return r;if(e.indexOf("other")>-1)return"other";throw new Error(`No plural message found for value "${n}"`)}(t,Object.keys(i),this._localization,r)].replace(ate,t.toString())}}return n.\u0275fac=function(t){return new(t||n)(E(dE,16))},n.\u0275pipe=ds({name:"i18nPlural",type:n,pure:!0}),n})(),tV=(()=>{class n{transform(t){return JSON.stringify(t,null,2)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275pipe=ds({name:"json",type:n,pure:!1}),n})(),dn=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({providers:[{provide:dE,useClass:Gee}]}),n})();const rV="browser";function Of(n){return n===rV}function kD(n){return"server"===n}class aV{}class FD extends class extends class{}{constructor(){super(...arguments),this.supportsDOMEvents=!0}}{static makeCurrent(){!function(n){tE||(tE=n)}(new FD)}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=(Dv=Dv||document.querySelector("base"),Dv?Dv.getAttribute("href"):null);return null==t?null:function(n){fE=fE||document.createElement("a"),fE.setAttribute("href",n);const e=fE.pathname;return"/"===e.charAt(0)?e:`/${e}`}(t)}resetBaseElement(){Dv=null}getUserAgent(){return window.navigator.userAgent}getCookie(e){return Y3(document.cookie,e)}}let fE,Dv=null;const lV=new ve("TRANSITION_ID"),Ete=[{provide:Mf,useFactory:function(n,e,t){return()=>{t.get(Gg).donePromise.then(()=>{const i=Uc(),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},cn.getAllAngularTestabilities=()=>e.getAllTestabilities(),cn.getAllAngularRootElements=()=>e.getAllRootElements(),cn.frameworkStabilizers||(cn.frameworkStabilizers=[]),cn.frameworkStabilizers.push(i=>{const r=cn.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?Uc().isShadowRoot(t)?this.findTestabilityInTree(e,t.host,!0):this.findTestabilityInTree(e,t.parentElement,!0):null}}let Ste=(()=>{class n{build(){return new XMLHttpRequest}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();const Ov=new ve("EventManagerPlugins");let gE=(()=>{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=ue({token:n,factory:n.\u0275fac}),n})(),Iv=(()=>{class n extends uV{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(dV),this._hostNodes.delete(t)}onStylesAdded(t){this._hostNodes.forEach((i,r)=>{this._addStylesToHost(t,r,i)})}ngOnDestroy(){this._hostNodes.forEach(t=>t.forEach(dV))}}return n.\u0275fac=function(t){return new(t||n)(I(ut))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();function dV(n){Uc().remove(n)}const BD={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/"},VD=/%COMP%/g;function mE(n,e,t){for(let i=0;i{if("__ngUnwrap__"===e)return n;!1===n(e)&&(e.preventDefault(),e.returnValue=!1)}}let _E=(()=>{class n{constructor(t,i,r){this.eventManager=t,this.sharedStylesHost=i,this.appId=r,this.rendererByCompId=new Map,this.defaultRenderer=new zD(t)}createRenderer(t,i){if(!t||!i)return this.defaultRenderer;switch(i.encapsulation){case Ue.Emulated:{let r=this.rendererByCompId.get(i.id);return r||(r=new Vte(this.eventManager,this.sharedStylesHost,i,this.appId),this.rendererByCompId.set(i.id,r)),r.applyToHost(t),r}case 1:case Ue.ShadowDom:return new zte(this.eventManager,this.sharedStylesHost,t,i);default:if(!this.rendererByCompId.has(i.id)){const r=mE(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)(I(gE),I(Iv),I(vv))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();class zD{constructor(e){this.eventManager=e,this.data=Object.create(null)}destroy(){}createElement(e,t){return t?document.createElementNS(BD[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=BD[r];s?e.setAttributeNS(s,t,i):e.setAttribute(t,i)}else e.setAttribute(t,i)}removeAttribute(e,t,i){if(i){const r=BD[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&(Co.DashCase|Co.Important)?e.style.setProperty(t,i,r&Co.Important?"important":""):e.style[t]=i}removeStyle(e,t,i){i&Co.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,pV(i)):this.eventManager.addEventListener(e,t,pV(i))}}class Vte extends zD{constructor(e,t,i,r){super(e),this.component=i;const s=mE(r+"-"+i.id,i.styles,[]);t.addStyles(s),this.contentAttr=function(n){return"_ngcontent-%COMP%".replace(VD,n)}(r+"-"+i.id),this.hostAttr=function(n){return"_nghost-%COMP%".replace(VD,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 zte extends zD{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=mE(r.id,r.styles,[]);for(let o=0;o{class n extends LD{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)(I(ut))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();const _V=["alt","control","meta","shift"],Yte={"\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"},yV={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"},Xte={alt:n=>n.altKey,control:n=>n.ctrlKey,meta:n=>n.metaKey,shift:n=>n.shiftKey};let Kte=(()=>{class n extends LD{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(()=>Uc().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(_V.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&&yV.hasOwnProperty(e)&&(e=yV[e]))}return Yte[e]||e}(t);return r=r.toLowerCase()," "===r?r="space":"."===r&&(r="dot"),_V.forEach(s=>{s!=r&&Xte[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)(I(ut))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})(),th=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ue({factory:function(){return I(UD)},token:n,providedIn:"root"}),n})(),UD=(()=>{class n extends th{constructor(t){super(),this._doc=t}sanitize(t,i){if(null==i)return null;switch(t){case mn.NONE:return i;case mn.HTML:return jo(i,"HTML")?gs(i):ey(this._doc,String(i)).toString();case mn.STYLE:return jo(i,"Style")?gs(i):i;case mn.SCRIPT:if(jo(i,"Script"))return gs(i);throw new Error("unsafe value used in a script context");case mn.URL:return Pc(i),jo(i,"URL")?gs(i):bo(String(i));case mn.RESOURCE_URL:if(jo(i,"ResourceURL"))return gs(i);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(n){return new W_(n)}(t)}bypassSecurityTrustStyle(t){return function(n){return new q_(n)}(t)}bypassSecurityTrustScript(t){return function(n){return new Jp(n)}(t)}bypassSecurityTrustUrl(t){return function(n){return new zd(n)}(t)}bypassSecurityTrustResourceUrl(t){return function(n){return new Ut(n)}(t)}}return n.\u0275fac=function(t){return new(t||n)(I(ut))},n.\u0275prov=ue({factory:function(){return function(n){return new UD(n.get(ut))}(I(Fc))},token:n,providedIn:"root"}),n})();const rne=s3(ZQ,"browser",[{provide:dl,useValue:rV},{provide:XB,useValue:function(){FD.makeCurrent(),ND.init()},multi:!0},{provide:ut,useFactory:function(){return function(n){fi=n}(document),document},deps:[]}]),sne=[[],{provide:Vu,useValue:"root"},{provide:$o,useFactory:function(){return new $o},deps:[]},{provide:Ov,useClass:jte,multi:!0,deps:[ut,dt,dl]},{provide:Ov,useClass:Kte,multi:!0,deps:[ut]},[],{provide:_E,useClass:_E,deps:[gE,Iv,vv]},{provide:Cf,useExisting:_E},{provide:uV,useExisting:Iv},{provide:Iv,useClass:Iv,deps:[ut]},{provide:tD,useClass:tD,deps:[dt]},{provide:gE,useClass:gE,deps:[Ov,dt]},{provide:aV,useClass:Ste,deps:[]},[]];let yE=(()=>{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:vv,useValue:t.appId},{provide:lV,useExisting:vv},Ete]}}}return n.\u0275fac=function(t){return new(t||n)(I(n,12))},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({providers:sne,imports:[dn,rJ]}),n})();"undefined"!=typeof window&&window;class fne extends Te{constructor(e,t){super()}schedule(e,t=0){return this}}class vE extends fne{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 bV=(()=>{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 bV{constructor(e,t=bV.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 mne=new class extends Jl{}(class extends vE{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)}}),ec=new ce(n=>n.complete());function bE(n){return n?function(n){return new ce(e=>n.schedule(()=>e.complete()))}(n):ec}function ht(...n){let e=n[n.length-1];return Gn(e)?(n.pop(),Fi(n,e)):za(n)}function Kg(n,e){return new ce(e?t=>e.schedule(yne,0,{error:n,subscriber:t}):t=>t.error(n))}function yne({error:n,subscriber:e}){e.error(n)}class Ko{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 ht(this.value);case"E":return Kg(this.error);case"C":return bE()}throw new Error("unexpected notification kind value")}static createNext(e){return void 0!==e?new Ko("N",e):Ko.undefinedValueNotification}static createError(e){return new Ko("E",void 0,e)}static createComplete(){return Ko.completeNotification}}Ko.completeNotification=new Ko("C"),Ko.undefinedValueNotification=new Ko("N",void 0);class CE extends xt{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(CE.dispatch,this.delay,new bne(e,this.destination)))}_next(e){this.scheduleMessage(Ko.createNext(e))}_error(e){this.scheduleMessage(Ko.createError(e)),this.unsubscribe()}_complete(){this.scheduleMessage(Ko.createComplete()),this.unsubscribe()}}class bne{constructor(e,t){this.notification=e,this.destination=t}}class If extends Se{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 Cne(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 Qt;if(this.isStopped||this.hasError?o=Te.EMPTY:(this.observers.push(e),o=new li(this,e)),r&&e.add(e=new CE(e,r)),t)for(let a=0;at&&(o=Math.max(o,s-t)),o>0&&r.splice(0,o),r}}class Cne{constructor(e,t){this.time=e,this.value=t}}function Pr(n,e){return"function"==typeof e?t=>t.pipe(Pr((i,r)=>ui(n(i,r)).pipe(Ae((s,o)=>e(i,s,r,o))))):t=>t.lift(new wne(n))}class wne{constructor(e){this.project=e}call(e,t){return t.subscribe(new Ene(e,this.project))}}class Ene extends ii{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 Gr(this),r=this.destination;r.add(i),this.innerSubscription=co(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 wE={schedule(n,e){const t=setTimeout(n,e);return()=>clearTimeout(t)},scheduleBeforeRender(n){if("undefined"==typeof window)return wE.schedule(n,0);if(void 0===window.requestAnimationFrame)return wE.schedule(n,16);const e=window.requestAnimationFrame(n);return()=>window.cancelAnimationFrame(e)}};let $D;function Rne(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(!$D){const t=Element.prototype;$D=t.matches||t.matchesSelector||t.mozMatchesSelector||t.msMatchesSelector||t.oMatchesSelector||t.webkitMatchesSelector}return n.nodeType===Node.ELEMENT_NODE&&$D.call(n,e)}(n,r)||(i=s,0))),i}class Fne{constructor(e,t){this.componentFactory=t.get(ll).resolveComponentFactory(e)}create(e){return new Nne(this.componentFactory,e)}}class Nne{constructor(e,t){this.componentFactory=e,this.injector=t,this.eventEmitters=new If(1),this.events=this.eventEmitters.pipe(Pr(i=>Ni(...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(dt),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=wE.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=Nt.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(Ae(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=wE.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 y_(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 Lne extends HTMLElement{constructor(){super(...arguments),this.ngElementEventsSubscription=null}}function Mt(n){return null!=n&&"false"!=`${n}`}function To(n,e=0){return function(n){return!isNaN(parseFloat(n))&&!isNaN(Number(n))}(n)?Number(n):e}function EE(n){return Array.isArray(n)?n:[n]}function jr(n){return null==n?"":"string"==typeof n?n:`${n}px`}function Wu(n){return n instanceof rt?n.nativeElement:n}const Pf=new Jl(vE);function Zg(n,e=Pf){return t=>t.lift(new jne(n,e))}class jne{constructor(e,t){this.dueTime=e,this.scheduler=t}call(e,t){return t.subscribe(new Une(e,this.dueTime,this.scheduler))}}class Une extends xt{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(Hne,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 Hne(n){n.debouncedNext()}let GD=(()=>{class n{create(t){return"undefined"==typeof MutationObserver?null:new MutationObserver(t)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ue({factory:function(){return new n},token:n,providedIn:"root"}),n})(),CV=(()=>{class n{constructor(t){this._mutationObserverFactory=t,this._observedElements=new Map}ngOnDestroy(){this._observedElements.forEach((t,i)=>this._cleanupObserver(i))}observe(t){const i=Wu(t);return new ce(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 Se,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)(I(GD))},n.\u0275prov=ue({factory:function(){return new n(I(GD))},token:n,providedIn:"root"}),n})(),WD=(()=>{class n{constructor(t,i,r){this._contentObserver=t,this._elementRef=i,this._ngZone=r,this.event=new Le,this._disabled=!1,this._currentSubscription=null}get disabled(){return this._disabled}set disabled(t){this._disabled=Mt(t),this._disabled?this._unsubscribe():this._subscribe()}get debounce(){return this._debounce}set debounce(t){this._debounce=To(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(Zg(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)(E(CV),E(rt),E(dt))},n.\u0275dir=oe({type:n,selectors:[["","cdkObserveContent",""]],inputs:{disabled:["cdkObserveContentDisabled","disabled"],debounce:"debounce"},outputs:{event:"cdkObserveContent"},exportAs:["cdkObserveContent"]}),n})(),SE=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({providers:[GD]}),n})();class ar extends Se{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 Qt;return this._value}next(e){super.next(this._value=e)}}function Zs(n,...e){return e.length?e.some(t=>n[t]):n.altKey||n.shiftKey||n.ctrlKey||n.metaKey}function ih(){}function Ti(n,e,t){return function(r){return r.lift(new tie(n,e,t))}}class tie{constructor(e,t,i){this.nextOrObserver=e,this.error=t,this.complete=i}call(e,t){return t.subscribe(new nie(e,this.nextOrObserver,this.error,this.complete))}}class nie extends xt{constructor(e,t,i,r){super(e),this._tapNext=ih,this._tapError=ih,this._tapComplete=ih,this._tapError=i||ih,this._tapComplete=r||ih,Ke(t)?(this._context=this,this._tapNext=t):t&&(this._context=t,this._tapNext=t.next||ih,this._tapError=t.error||ih,this._tapComplete=t.complete||ih)}_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 Fn(n,e){return function(i){return i.lift(new iie(n,e))}}class iie{constructor(e,t){this.predicate=e,this.thisArg=t}call(e,t){return t.subscribe(new rie(e,this.predicate,this.thisArg))}}class rie extends xt{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)}}const SV=(()=>{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?bE():e.lift(new sie(n))}class sie{constructor(e){if(this.total=e,this.total<0)throw new SV}call(e,t){return t.subscribe(new oie(e,this.total))}}class oie extends xt{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 QD(n){return e=>e.lift(new aie(n))}class aie{constructor(e){this.total=e}call(e,t){return t.subscribe(new lie(e,this.total))}}class lie extends xt{constructor(e,t){super(e),this.total=t,this.count=0}_next(e){++this.count>this.total&&this.destination.next(e)}}function Zo(n,e){return t=>t.lift(new cie(n,e))}class cie{constructor(e,t){this.compare=e,this.keySelector=t}call(e,t){return t.subscribe(new uie(e,this.compare,this.keySelector))}}class uie extends xt{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))}}function Tn(n){return e=>e.lift(new die(n))}class die{constructor(e){this.notifier=e}call(e,t){const i=new hie(e),r=co(this.notifier,new Gr(i));return r&&!i.seenValue?(i.add(r),t.subscribe(i)):i}}class hie extends ii{constructor(e){super(e),this.seenValue=!1}notifyNext(){this.seenValue=!0,this.complete()}notifyComplete(){}}let JD;try{JD="undefined"!=typeof Intl&&Intl.v8BreakIterator}catch(n){JD=!1}let em,si=(()=>{class n{constructor(t){this._platformId=t,this.isBrowser=this._platformId?Of(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&&!JD)&&"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)(I(dl))},n.\u0275prov=ue({factory:function(){return new n(I(dl))},token:n,providedIn:"root"}),n})(),Rv=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({}),n})();const MV=["color","button","checkbox","date","datetime-local","email","file","hidden","image","month","number","password","radio","range","reset","search","submit","tel","text","time","url","week"];function xV(){if(em)return em;if("object"!=typeof document||!document)return em=new Set(MV),em;let n=document.createElement("input");return em=new Set(MV.filter(e=>(n.setAttribute("type",e),n.type===e))),em}let kv,Ff,eO;function tm(n){return function(){if(null==kv&&"undefined"!=typeof window)try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:()=>kv=!0}))}finally{kv=kv||!1}return kv}()?n:!!n.capture}function TV(){if(null==Ff){if("object"!=typeof document||!document||"function"!=typeof Element||!Element)return Ff=!1,Ff;if("scrollBehavior"in document.documentElement.style)Ff=!0;else{const n=Element.prototype.scrollTo;Ff=!!n&&!/\{\s*\[native code\]\s*\}/.test(n.toString())}}return Ff}function xE(){let n="undefined"!=typeof document&&document?document.activeElement:null;for(;n&&n.shadowRoot;){const e=n.shadowRoot.activeElement;if(e===n)break;n=e}return n}function Nf(n){return n.composedPath?n.composedPath()[0]:n.target}function TE(n,e){return(n.getAttribute(e)||"").match(/\S+/g)||[]}const DV="cdk-describedby-message-container",OV="cdk-describedby-message",AE="cdk-describedby-host";let yie=0;const $c=new Map;let Rs=null,IV=(()=>{class n{constructor(t){this._document=t}describe(t,i,r){if(!this._canBeDescribed(t,i))return;const s=tO(i,r);"string"!=typeof i?(PV(i),$c.set(s,{messageElement:i,referenceCount:0})):$c.has(s)||this._createMessageElement(i,r),this._isElementDescribedByMessage(t,s)||this._addMessageReference(t,s)}removeDescription(t,i,r){if(!i||!this._isElementNode(t))return;const s=tO(i,r);if(this._isElementDescribedByMessage(t,s)&&this._removeMessageReference(t,s),"string"==typeof i){const o=$c.get(s);o&&0===o.referenceCount&&this._deleteMessageElement(s)}Rs&&0===Rs.childNodes.length&&this._deleteMessagesContainer()}ngOnDestroy(){const t=this._document.querySelectorAll(`[${AE}]`);for(let i=0;i0!=r.indexOf(OV));t.setAttribute("aria-describedby",i.join(" "))}_addMessageReference(t,i){const r=$c.get(i);(function(n,e,t){const i=TE(n,e);i.some(r=>r.trim()==t.trim())||(i.push(t.trim()),n.setAttribute(e,i.join(" ")))})(t,"aria-describedby",r.messageElement.id),t.setAttribute(AE,""),r.referenceCount++}_removeMessageReference(t,i){const r=$c.get(i);r.referenceCount--,function(n,e,t){const r=TE(n,e).filter(s=>s!=t.trim());r.length?n.setAttribute(e,r.join(" ")):n.removeAttribute(e)}(t,"aria-describedby",r.messageElement.id),t.removeAttribute(AE)}_isElementDescribedByMessage(t,i){const r=TE(t,"aria-describedby"),s=$c.get(i),o=s&&s.messageElement.id;return!!o&&-1!=r.indexOf(o)}_canBeDescribed(t,i){if(!this._isElementNode(t))return!1;if(i&&"object"==typeof i)return!0;const r=null==i?"":`${i}`.trim(),s=t.getAttribute("aria-label");return!(!r||s&&s.trim()===r)}_isElementNode(t){return t.nodeType===this._document.ELEMENT_NODE}}return n.\u0275fac=function(t){return new(t||n)(I(ut))},n.\u0275prov=ue({factory:function(){return new n(I(ut))},token:n,providedIn:"root"}),n})();function tO(n,e){return"string"==typeof n?`${e||""}/${n}`:n}function PV(n){n.id||(n.id=`${OV}-${yie++}`)}class RV{constructor(e){this._items=e,this._activeItemIndex=-1,this._activeItem=null,this._wrap=!1,this._letterKeyStream=new Se,this._typeaheadSubscription=Te.EMPTY,this._vertical=!0,this._allowedModifierKeys=[],this._homeAndEnd=!1,this._skipPredicateFn=t=>t.disabled,this._pressedLetters=[],this.tabOut=new Se,this.change=new Se,e instanceof Sf&&e.changes.subscribe(t=>{if(this._activeItem){const r=t.toArray().indexOf(this._activeItem);r>-1&&r!==this._activeItemIndex&&(this._activeItemIndex=r)}})}skipPredicate(e){return this._skipPredicateFn=e,this}withWrap(e=!0){return this._wrap=e,this}withVerticalOrientation(e=!0){return this._vertical=e,this}withHorizontalOrientation(e){return this._horizontal=e,this}withAllowedModifierKeys(e){return this._allowedModifierKeys=e,this}withTypeAhead(e=200){return this._typeaheadSubscription.unsubscribe(),this._typeaheadSubscription=this._letterKeyStream.pipe(Ti(t=>this._pressedLetters.push(t)),Zg(e),Fn(()=>this._pressedLetters.length>0),Ae(()=>this._pressedLetters.join(""))).subscribe(t=>{const i=this._getItemsArray();for(let r=1;r!e[s]||this._allowedModifierKeys.indexOf(s)>-1);switch(t){case 9:return void this.tabOut.next();case 40:if(this._vertical&&r){this.setNextItemActive();break}return;case 38:if(this._vertical&&r){this.setPreviousItemActive();break}return;case 39:if(this._horizontal&&r){"rtl"===this._horizontal?this.setPreviousItemActive():this.setNextItemActive();break}return;case 37:if(this._horizontal&&r){"rtl"===this._horizontal?this.setNextItemActive():this.setPreviousItemActive();break}return;case 36:if(this._homeAndEnd&&r){this.setFirstItemActive();break}return;case 35:if(this._homeAndEnd&&r){this.setLastItemActive();break}return;default:return void((r||Zs(e,"shiftKey"))&&(e.key&&1===e.key.length?this._letterKeyStream.next(e.key.toLocaleUpperCase()):(t>=65&&t<=90||t>=48&&t<=57)&&this._letterKeyStream.next(String.fromCharCode(t))))}this._pressedLetters=[],e.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(e){const t=this._getItemsArray(),i="number"==typeof e?e:t.indexOf(e),r=t[i];this._activeItem=null==r?null:r,this._activeItemIndex=i}_setActiveItemByDelta(e){this._wrap?this._setActiveInWrapMode(e):this._setActiveInDefaultMode(e)}_setActiveInWrapMode(e){const t=this._getItemsArray();for(let i=1;i<=t.length;i++){const r=(this._activeItemIndex+e*i+t.length)%t.length;if(!this._skipPredicateFn(t[r]))return void this.setActiveItem(r)}}_setActiveInDefaultMode(e){this._setActiveItemByIndex(this._activeItemIndex+e,e)}_setActiveItemByIndex(e,t){const i=this._getItemsArray();if(i[e]){for(;this._skipPredicateFn(i[e]);)if(!i[e+=t])return;this.setActiveItem(e)}}_getItemsArray(){return this._items instanceof Sf?this._items.toArray():this._items}}class kV extends RV{setActiveItem(e){this.activeItem&&this.activeItem.setInactiveStyles(),super.setActiveItem(e),this.activeItem&&this.activeItem.setActiveStyles()}}class nO extends RV{constructor(){super(...arguments),this._origin="program"}setFocusOrigin(e){return this._origin=e,this}setActiveItem(e){super.setActiveItem(e),this.activeItem&&this.activeItem.focus(this._origin)}}let FV=(()=>{class n{constructor(t){this._platform=t}isDisabled(t){return t.hasAttribute("disabled")}isVisible(t){return function(n){return!!(n.offsetWidth||n.offsetHeight||"function"==typeof n.getClientRects&&n.getClientRects().length)}(t)&&"visible"===getComputedStyle(t).visibility}isTabbable(t){if(!this._platform.isBrowser)return!1;const i=function(n){try{return n.frameElement}catch(e){return null}}(function(n){return n.ownerDocument&&n.ownerDocument.defaultView||window}(t));if(i&&(-1===LV(i)||!this.isVisible(i)))return!1;let r=t.nodeName.toLowerCase(),s=LV(t);return t.hasAttribute("contenteditable")?-1!==s:!("iframe"===r||"object"===r||this._platform.WEBKIT&&this._platform.IOS&&!function(n){let e=n.nodeName.toLowerCase(),t="input"===e&&n.type;return"text"===t||"password"===t||"select"===e||"textarea"===e}(t))&&("audio"===r?!!t.hasAttribute("controls")&&-1!==s:"video"===r?-1!==s&&(null!==s||this._platform.FIREFOX||t.hasAttribute("controls")):t.tabIndex>=0)}isFocusable(t,i){return function(n){return!function(n){return function(n){return"input"==n.nodeName.toLowerCase()}(n)&&"hidden"==n.type}(n)&&(function(n){let e=n.nodeName.toLowerCase();return"input"===e||"select"===e||"button"===e||"textarea"===e}(n)||function(n){return function(n){return"a"==n.nodeName.toLowerCase()}(n)&&n.hasAttribute("href")}(n)||n.hasAttribute("contenteditable")||NV(n))}(t)&&!this.isDisabled(t)&&((null==i?void 0:i.ignoreVisibility)||this.isVisible(t))}}return n.\u0275fac=function(t){return new(t||n)(I(si))},n.\u0275prov=ue({factory:function(){return new n(I(si))},token:n,providedIn:"root"}),n})();function NV(n){if(!n.hasAttribute("tabindex")||void 0===n.tabIndex)return!1;let e=n.getAttribute("tabindex");return"-32768"!=e&&!(!e||isNaN(parseInt(e,10)))}function LV(n){if(!NV(n))return null;const e=parseInt(n.getAttribute("tabindex")||"",10);return isNaN(e)?-1:e}class Die{constructor(e,t,i,r,s=!1){this._element=e,this._checker=t,this._ngZone=i,this._document=r,this._hasAttached=!1,this.startAnchorListener=()=>this.focusLastTabbableElement(),this.endAnchorListener=()=>this.focusFirstTabbableElement(),this._enabled=!0,s||this.attachAnchors()}get enabled(){return this._enabled}set enabled(e){this._enabled=e,this._startAnchor&&this._endAnchor&&(this._toggleAnchorTabIndex(e,this._startAnchor),this._toggleAnchorTabIndex(e,this._endAnchor))}destroy(){const 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}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(e){return new Promise(t=>{this._executeOnStable(()=>t(this.focusInitialElement(e)))})}focusFirstTabbableElementWhenReady(e){return new Promise(t=>{this._executeOnStable(()=>t(this.focusFirstTabbableElement(e)))})}focusLastTabbableElementWhenReady(e){return new Promise(t=>{this._executeOnStable(()=>t(this.focusLastTabbableElement(e)))})}_getRegionBoundary(e){let t=this._element.querySelectorAll(`[cdk-focus-region-${e}], [cdkFocusRegion${e}], [cdk-focus-${e}]`);for(let i=0;i=0;i--){let r=t[i].nodeType===this._document.ELEMENT_NODE?this._getLastTabbableElement(t[i]):null;if(r)return r}return null}_createAnchor(){const 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}_toggleAnchorTabIndex(e,t){e?t.setAttribute("tabindex","0"):t.removeAttribute("tabindex")}toggleAnchors(e){this._startAnchor&&this._endAnchor&&(this._toggleAnchorTabIndex(e,this._startAnchor),this._toggleAnchorTabIndex(e,this._endAnchor))}_executeOnStable(e){this._ngZone.isStable?e():this._ngZone.onStable.pipe(yi(1)).subscribe(e)}}let BV=(()=>{class n{constructor(t,i,r){this._checker=t,this._ngZone=i,this._document=r}create(t,i=!1){return new Die(t,this._checker,this._ngZone,this._document,i)}}return n.\u0275fac=function(t){return new(t||n)(I(FV),I(dt),I(ut))},n.\u0275prov=ue({factory:function(){return new n(I(FV),I(dt),I(ut))},token:n,providedIn:"root"}),n})();function VV(n){return 0===n.offsetX&&0===n.offsetY}function zV(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 jV=new ve("cdk-input-modality-detector-options"),kie={ignoreKeys:[18,17,224,91,16]},nm=tm({passive:!0,capture:!0});let HV=(()=>{class n{constructor(t,i,r,s){this._platform=t,this._mostRecentTarget=null,this._modality=new ar(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=Nf(o))},this._onMousedown=o=>{Date.now()-this._lastTouchMs<650||(this._modality.next(VV(o)?"keyboard":"mouse"),this._mostRecentTarget=Nf(o))},this._onTouchstart=o=>{zV(o)?this._modality.next("keyboard"):(this._lastTouchMs=Date.now(),this._modality.next("touch"),this._mostRecentTarget=Nf(o))},this._options=Object.assign(Object.assign({},kie),s),this.modalityDetected=this._modality.pipe(QD(1)),this.modalityChanged=this.modalityDetected.pipe(Zo()),t.isBrowser&&i.runOutsideAngular(()=>{r.addEventListener("keydown",this._onKeydown,nm),r.addEventListener("mousedown",this._onMousedown,nm),r.addEventListener("touchstart",this._onTouchstart,nm)})}get mostRecentModality(){return this._modality.value}ngOnDestroy(){!this._platform.isBrowser||(document.removeEventListener("keydown",this._onKeydown,nm),document.removeEventListener("mousedown",this._onMousedown,nm),document.removeEventListener("touchstart",this._onTouchstart,nm))}}return n.\u0275fac=function(t){return new(t||n)(I(si),I(dt),I(ut),I(jV,8))},n.\u0275prov=ue({factory:function(){return new n(I(si),I(dt),I(ut),I(jV,8))},token:n,providedIn:"root"}),n})();const $V=new ve("liveAnnouncerElement",{providedIn:"root",factory:function(){return null}}),GV=new ve("LIVE_ANNOUNCER_DEFAULT_OPTIONS");let DE=(()=>{class n{constructor(t,i,r,s){this._ngZone=i,this._defaultOptions=s,this._document=r,this._liveElement=t||this._createLiveElement()}announce(t,...i){const r=this._defaultOptions;let s,o;return 1===i.length&&"number"==typeof i[0]?o=i[0]:[s,o]=i,this.clear(),clearTimeout(this._previousTimeout),s||(s=r&&r.politeness?r.politeness:"polite"),null==o&&r&&(o=r.duration),this._liveElement.setAttribute("aria-live",s),this._ngZone.runOutsideAngular(()=>new Promise(a=>{clearTimeout(this._previousTimeout),this._previousTimeout=setTimeout(()=>{this._liveElement.textContent=t,a(),"number"==typeof o&&(this._previousTimeout=setTimeout(()=>this.clear(),o))},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",i=this._document.getElementsByClassName(t),r=this._document.createElement("div");for(let s=0;s{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 Se,this._rootNodeFocusAndBlurListener=a=>{const l=Nf(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=Wu(t);if(!this._platform.isBrowser||1!==r.nodeType)return ht(null);const s=function(n){if(function(){if(null==eO){const n="undefined"!=typeof document?document.head:null;eO=!(!n||!n.createShadowRoot&&!n.attachShadow)}return eO}()){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 Se,rootNode:s};return this._elementInfo.set(r,a),this._registerGlobalListeners(a),a.subject}stopMonitoring(t){const i=Wu(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=Wu(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=Nf(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,OE),i.addEventListener("blur",this._rootNodeFocusAndBlurListener,OE)}),this._rootNodeFocusListenerCount.set(i,r+1),1==++this._monitoredElementCount&&(this._ngZone.runOutsideAngular(()=>{this._getWindow().addEventListener("focus",this._windowFocusListener)}),this._inputModalityDetector.modalityDetected.pipe(Tn(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,OE),i.removeEventListener("blur",this._rootNodeFocusAndBlurListener,OE),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)(I(dt),I(si),I(HV),I(ut,8),I(WV,8))},n.\u0275prov=ue({factory:function(){return new n(I(dt),I(si),I(HV),I(ut,8),I(WV,8))},token:n,providedIn:"root"}),n})();const qV="cdk-high-contrast-black-on-white",YV="cdk-high-contrast-white-on-black",iO="cdk-high-contrast-active";let XV=(()=>{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(iO),t.remove(qV),t.remove(YV),this._hasCheckedHighContrastMode=!0;const i=this.getHighContrastMode();1===i?(t.add(iO),t.add(qV)):2===i&&(t.add(iO),t.add(YV))}}}return n.\u0275fac=function(t){return new(t||n)(I(si),I(ut))},n.\u0275prov=ue({factory:function(){return new n(I(si),I(ut))},token:n,providedIn:"root"}),n})(),Nie=(()=>{class n{constructor(t){t._applyBodyHighContrastModeCssClasses()}}return n.\u0275fac=function(t){return new(t||n)(I(XV))},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[Rv,SE]]}),n})();const KV=new ve("cdk-dir-doc",{providedIn:"root",factory:function(){return Oc(ut)}});let Qo=(()=>{class n{constructor(t){if(this.value="ltr",this.change=new Le,t){const r=t.documentElement?t.documentElement.dir:null,s=(t.body?t.body.dir:null)||r;this.value="ltr"===s||"rtl"===s?s:"ltr"}}ngOnDestroy(){this.change.complete()}}return n.\u0275fac=function(t){return new(t||n)(I(KV,8))},n.\u0275prov=ue({factory:function(){return new n(I(KV,8))},token:n,providedIn:"root"}),n})(),Nv=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({}),n})();const ZV=new ju("12.2.5");function IE(...n){return uo(1)(ht(...n))}function Rr(...n){const e=n[n.length-1];return Gn(e)?(n.pop(),t=>IE(n,t,e)):t=>IE(n,t)}class QV{}const qu="*";function tc(n,e){return{type:7,name:n,definitions:e,options:{}}}function Ao(n,e=null){return{type:4,styles:e,timings:n}}function JV(n,e=null){return{type:2,steps:n,options:e}}function ti(n){return{type:6,styles:n,offset:null}}function wr(n,e,t){return{type:0,name:n,styles:e,options:t}}function zie(n){return{type:5,steps:n}}function Qs(n,e,t=null){return{type:1,expr:n,animation:e,options:t}}function jie(n=null){return{type:9,options:n}}function Uie(n,e,t=null){return{type:11,selector:n,animation:e,options:t}}function ez(n){Promise.resolve(null).then(n)}class im{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(){ez(()=>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}}class tz{constructor(e){this._onDoneFns=[],this._onStartFns=[],this._finished=!1,this._started=!1,this._destroyed=!1,this._onDestroyFns=[],this.parentPlayer=null,this.totalTime=0,this.players=e;let t=0,i=0,r=0;const s=this.players.length;0==s?ez(()=>this._onFinish()):this.players.forEach(o=>{o.onDone(()=>{++t==s&&this._onFinish()}),o.onDestroy(()=>{++i==s&&this._onDestroy()}),o.onStart(()=>{++r==s&&this._onStart()})}),this.totalTime=this.players.reduce((o,a)=>Math.max(o,a.totalTime),0)}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(e=>e()),this._onDoneFns=[])}init(){this.players.forEach(e=>e.init())}onStart(e){this._onStartFns.push(e)}_onStart(){this.hasStarted()||(this._started=!0,this._onStartFns.forEach(e=>e()),this._onStartFns=[])}onDone(e){this._onDoneFns.push(e)}onDestroy(e){this._onDestroyFns.push(e)}hasStarted(){return this._started}play(){this.parentPlayer||this.init(),this._onStart(),this.players.forEach(e=>e.play())}pause(){this.players.forEach(e=>e.pause())}restart(){this.players.forEach(e=>e.restart())}finish(){this._onFinish(),this.players.forEach(e=>e.finish())}destroy(){this._onDestroy()}_onDestroy(){this._destroyed||(this._destroyed=!0,this._onFinish(),this.players.forEach(e=>e.destroy()),this._onDestroyFns.forEach(e=>e()),this._onDestroyFns=[])}reset(){this.players.forEach(e=>e.reset()),this._destroyed=!1,this._finished=!1,this._started=!1}setPosition(e){const t=e*this.totalTime;this.players.forEach(i=>{const r=i.totalTime?Math.min(1,t/i.totalTime):1;i.setPosition(r)})}getPosition(){const e=this.players.reduce((t,i)=>null===t||i.totalTime>t.totalTime?i:t,null);return null!=e?e.getPosition():0}beforeDestroy(){this.players.forEach(e=>{e.beforeDestroy&&e.beforeDestroy()})}triggerCallback(e){const t="start"==e?this._onStartFns:this._onDoneFns;t.forEach(i=>i()),t.length=0}}function nz(){return"undefined"!=typeof window&&void 0!==window.document}function sO(){return"undefined"!=typeof process&&"[object process]"==={}.toString.call(process)}function rh(n){switch(n.length){case 0:return new im;case 1:return n[0];default:return new tz(n)}}function iz(n,e,t,i,r={},s={}){const o=[],a=[];let l=-1,c=null;if(i.forEach(d=>{const f=d.offset,p=f==l,g=p&&c||{};Object.keys(d).forEach(_=>{let y=_,v=d[_];if("offset"!==_)switch(y=e.normalizePropertyName(y,o),v){case"!":v=r[_];break;case qu:v=s[_];break;default:v=e.normalizeStyleValue(_,y,v,o)}g[y]=v}),p||a.push(g),c=g,l=f}),o.length){const d="\n - ";throw new Error(`Unable to animate due to the following errors:${d}${o.join(d)}`)}return a}function oO(n,e,t,i){switch(e){case"start":n.onStart(()=>i(t&&aO(t,"start",n)));break;case"done":n.onDone(()=>i(t&&aO(t,"done",n)));break;case"destroy":n.onDestroy(()=>i(t&&aO(t,"destroy",n)))}}function aO(n,e,t){const i=t.totalTime,s=lO(n.element,n.triggerName,n.fromState,n.toState,e||n.phaseName,null==i?n.totalTime:i,!!t.disabled),o=n._data;return null!=o&&(s._data=o),s}function lO(n,e,t,i,r="",s=0,o){return{element:n,triggerName:e,fromState:t,toState:i,phaseName:r,totalTime:s,disabled:!!o}}function Ma(n,e,t){let i;return n instanceof Map?(i=n.get(e),i||n.set(e,i=t)):(i=n[e],i||(i=n[e]=t)),i}function rz(n){const e=n.indexOf(":");return[n.substring(1,e),n.substr(e+1)]}let cO=(n,e)=>!1,uO=(n,e)=>!1,sz=(n,e,t)=>[];const oz=sO();(oz||"undefined"!=typeof Element)&&(cO=nz()?(n,e)=>{for(;e&&e!==document.documentElement;){if(e===n)return!0;e=e.parentNode||e.host}return!1}:(n,e)=>n.contains(e),uO=(()=>{if(oz||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]):uO}})(),sz=(n,e,t)=>{let i=[];if(t){const r=n.querySelectorAll(e);for(let s=0;s{const i=t.replace(/([a-z])([A-Z])/g,"$1-$2");e[i]=n[t]}),e}let cz=(()=>{class n{validateStyleProperty(t){return dO(t)}matchesElement(t,i){return hO(t,i)}containsElement(t,i){return fO(t,i)}query(t,i,r){return pO(t,i,r)}computeStyle(t,i,r){return r||""}animate(t,i,r,s,o,a=[],l){return new im(r,s)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();class PE{}PE.NOOP=new cz;const gO="ng-enter",RE="ng-leave",kE="ng-trigger",FE=".ng-trigger",dz="ng-animating",mO=".ng-animating";function Bf(n){if("number"==typeof n)return n;const e=n.match(/^(-?[\.\d]+)(m?s)/);return!e||e.length<2?0:_O(parseFloat(e[1]),e[2])}function _O(n,e){switch(e){case"s":return 1e3*n;default:return n}}function NE(n,e,t){return n.hasOwnProperty("duration")?n:function(n,e,t){let r,s=0,o="";if("string"==typeof n){const a=n.match(/^(-?[\.\d]+)(m?s)(?:\s+(-?[\.\d]+)(m?s))?(?:\s+([-a-z]+(?:\(.+?\))?))?$/i);if(null===a)return e.push(`The provided timing value "${n}" is invalid.`),{duration:0,delay:0,easing:""};r=_O(parseFloat(a[1]),a[2]);const l=a[3];null!=l&&(s=_O(parseFloat(l),a[4]));const c=a[5];c&&(o=c)}else r=n;if(!t){let a=!1,l=e.length;r<0&&(e.push("Duration values below 0 are not allowed for this animation step."),a=!0),s<0&&(e.push("Delay values below 0 are not allowed for this animation step."),a=!0),a&&e.splice(l,0,`The provided timing value "${n}" is invalid.`)}return{duration:r,delay:s,easing:o}}(n,e,t)}function rm(n,e={}){return Object.keys(n).forEach(t=>{e[t]=n[t]}),e}function sh(n,e,t={}){if(e)for(let i in n)t[i]=n[i];else rm(n,t);return t}function fz(n,e,t){return t?e+":"+t+";":""}function pz(n){let e="";for(let t=0;t{const r=vO(i);t&&!t.hasOwnProperty(i)&&(t[i]=n.style[r]),n.style[r]=e[i]}),sO()&&pz(n))}function Vf(n,e){n.style&&(Object.keys(e).forEach(t=>{const i=vO(t);n.style[i]=""}),sO()&&pz(n))}function Lv(n){return Array.isArray(n)?1==n.length?n[0]:JV(n):n}const yO=new RegExp("{{\\s*(.+?)\\s*}}","g");function gz(n){let e=[];if("string"==typeof n){let t;for(;t=yO.exec(n);)e.push(t[1]);yO.lastIndex=0}return e}function LE(n,e,t){const i=n.toString(),r=i.replace(yO,(s,o)=>{let a=e[o];return e.hasOwnProperty(o)||(t.push(`Please provide a value for the animation param ${o}`),a=""),a.toString()});return r==i?n:r}function BE(n){const e=[];let t=n.next();for(;!t.done;)e.push(t.value),t=n.next();return e}const Xie=/-+([a-z0-9])/g;function vO(n){return n.replace(Xie,(...e)=>e[1].toUpperCase())}function Kie(n){return n.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function mz(n,e){return 0===n||0===e}function _z(n,e,t){const i=Object.keys(t);if(i.length&&e.length){let s=e[0],o=[];if(i.forEach(a=>{s.hasOwnProperty(a)||o.push(a),s[a]=t[a]}),o.length)for(var r=1;rfunction(n,e,t){if(":"==n[0]){const l=function(n,e){switch(n){case":enter":return"void => *";case":leave":return"* => void";case":increment":return(t,i)=>parseFloat(i)>parseFloat(t);case":decrement":return(t,i)=>parseFloat(i) *"}}(n,t);if("function"==typeof l)return void e.push(l);n=l}const i=n.match(/^(\*|[-\w]+)\s*()\s*(\*|[-\w]+)$/);if(null==i||i.length<4)return t.push(`The provided transition expression "${n}" is not supported`),e;const r=i[1],s=i[2],o=i[3];e.push(yz(r,o));"<"==s[0]&&!("*"==r&&"*"==o)&&e.push(yz(o,r))}(i,t,e)):t.push(n),t}const zE=new Set(["true","1"]),jE=new Set(["false","0"]);function yz(n,e){const t=zE.has(n)||jE.has(n),i=zE.has(e)||jE.has(e);return(r,s)=>{let o="*"==n||n==r,a="*"==e||e==s;return!o&&t&&"boolean"==typeof r&&(o=r?zE.has(n):jE.has(n)),!a&&i&&"boolean"==typeof s&&(a=s?zE.has(e):jE.has(e)),o&&a}}const ere=new RegExp("s*:selfs*,?","g");function CO(n,e,t){return new tre(n).build(e,t)}class tre{constructor(e){this._driver=e}build(e,t){const i=new rre(t);return this._resetContextStyleTimingState(i),xa(this,Lv(e),i)}_resetContextStyleTimingState(e){e.currentQuerySelector="",e.collectedStyles={},e.collectedStyles[""]={},e.currentTime=0}visitTrigger(e,t){let i=t.queryCount=0,r=t.depCount=0;const s=[],o=[];return"@"==e.name.charAt(0)&&t.errors.push("animation triggers cannot be prefixed with an `@` sign (e.g. trigger('@foo', [...]))"),e.definitions.forEach(a=>{if(this._resetContextStyleTimingState(t),0==a.type){const l=a,c=l.name;c.toString().split(/\s*,\s*/).forEach(d=>{l.name=d,s.push(this.visitState(l,t))}),l.name=c}else if(1==a.type){const l=this.visitTransition(a,t);i+=l.queryCount,r+=l.depCount,o.push(l)}else t.errors.push("only state() and transition() definitions can sit inside of a trigger()")}),{type:7,name:e.name,states:s,transitions:o,queryCount:i,depCount:r,options:null}}visitState(e,t){const i=this.visitStyle(e.styles,t),r=e.options&&e.options.params||null;if(i.containsDynamicStyles){const s=new Set,o=r||{};if(i.styles.forEach(a=>{if(UE(a)){const l=a;Object.keys(l).forEach(c=>{gz(l[c]).forEach(d=>{o.hasOwnProperty(d)||s.add(d)})})}}),s.size){const a=BE(s.values());t.errors.push(`state("${e.name}", ...) must define default values for all the following style substitutions: ${a.join(", ")}`)}}return{type:0,name:e.name,style:i,options:r?{params:r}:null}}visitTransition(e,t){t.queryCount=0,t.depCount=0;const i=xa(this,Lv(e.animation),t);return{type:1,matchers:Zie(e.expr,t.errors),animation:i,queryCount:t.queryCount,depCount:t.depCount,options:zf(e.options)}}visitSequence(e,t){return{type:2,steps:e.steps.map(i=>xa(this,i,t)),options:zf(e.options)}}visitGroup(e,t){const i=t.currentTime;let r=0;const s=e.steps.map(o=>{t.currentTime=i;const a=xa(this,o,t);return r=Math.max(r,t.currentTime),a});return t.currentTime=r,{type:3,steps:s,options:zf(e.options)}}visitAnimate(e,t){const i=function(n,e){let t=null;if(n.hasOwnProperty("duration"))t=n;else if("number"==typeof n)return wO(NE(n,e).duration,0,"");const i=n;if(i.split(/\s+/).some(s=>"{"==s.charAt(0)&&"{"==s.charAt(1))){const s=wO(0,0,"");return s.dynamic=!0,s.strValue=i,s}return t=t||NE(i,e),wO(t.duration,t.delay,t.easing)}(e.timings,t.errors);t.currentAnimateTimings=i;let r,s=e.styles?e.styles:ti({});if(5==s.type)r=this.visitKeyframes(s,t);else{let o=e.styles,a=!1;if(!o){a=!0;const c={};i.easing&&(c.easing=i.easing),o=ti(c)}t.currentTime+=i.duration+i.delay;const l=this.visitStyle(o,t);l.isEmptyStep=a,r=l}return t.currentAnimateTimings=null,{type:4,timings:i,style:r,options:null}}visitStyle(e,t){const i=this._makeStyleAst(e,t);return this._validateStyleAst(i,t),i}_makeStyleAst(e,t){const i=[];Array.isArray(e.styles)?e.styles.forEach(o=>{"string"==typeof o?o==qu?i.push(o):t.errors.push(`The provided style string value ${o} is not allowed.`):i.push(o)}):i.push(e.styles);let r=!1,s=null;return i.forEach(o=>{if(UE(o)){const a=o,l=a.easing;if(l&&(s=l,delete a.easing),!r)for(let c in a)if(a[c].toString().indexOf("{{")>=0){r=!0;break}}}),{type:6,styles:i,easing:s,offset:e.offset,containsDynamicStyles:r,options:null}}_validateStyleAst(e,t){const i=t.currentAnimateTimings;let r=t.currentTime,s=t.currentTime;i&&s>0&&(s-=i.duration+i.delay),e.styles.forEach(o=>{"string"!=typeof o&&Object.keys(o).forEach(a=>{if(!this._driver.validateStyleProperty(a))return void t.errors.push(`The provided animation property "${a}" is not a supported CSS property for animations`);const l=t.collectedStyles[t.currentQuerySelector],c=l[a];let d=!0;c&&(s!=r&&s>=c.startTime&&r<=c.endTime&&(t.errors.push(`The CSS property "${a}" that exists between the times of "${c.startTime}ms" and "${c.endTime}ms" is also being animated in a parallel animation between the times of "${s}ms" and "${r}ms"`),d=!1),s=c.startTime),d&&(l[a]={startTime:s,endTime:r}),t.options&&function(n,e,t){const i=e.params||{},r=gz(n);r.length&&r.forEach(s=>{i.hasOwnProperty(s)||t.push(`Unable to resolve the local animation param ${s} in the given list of values`)})}(o[a],t.options,t.errors)})})}visitKeyframes(e,t){const i={type:5,styles:[],options:null};if(!t.currentAnimateTimings)return t.errors.push("keyframes() must be placed inside of a call to animate()"),i;let s=0;const o=[];let a=!1,l=!1,c=0;const d=e.steps.map(C=>{const w=this._makeStyleAst(C,t);let x=null!=w.offset?w.offset:function(n){if("string"==typeof n)return null;let e=null;if(Array.isArray(n))n.forEach(t=>{if(UE(t)&&t.hasOwnProperty("offset")){const i=t;e=parseFloat(i.offset),delete i.offset}});else if(UE(n)&&n.hasOwnProperty("offset")){const t=n;e=parseFloat(t.offset),delete t.offset}return e}(w.styles),N=0;return null!=x&&(s++,N=w.offset=x),l=l||N<0||N>1,a=a||N0&&s{const x=p>0?w==g?1:p*w:o[w],N=x*v;t.currentTime=_+y.delay+N,y.duration=N,this._validateStyleAst(C,t),C.offset=x,i.styles.push(C)}),i}visitReference(e,t){return{type:8,animation:xa(this,Lv(e.animation),t),options:zf(e.options)}}visitAnimateChild(e,t){return t.depCount++,{type:9,options:zf(e.options)}}visitAnimateRef(e,t){return{type:10,animation:this.visitReference(e.animation,t),options:zf(e.options)}}visitQuery(e,t){const i=t.currentQuerySelector,r=e.options||{};t.queryCount++,t.currentQuery=e;const[s,o]=function(n){const e=!!n.split(/\s*,\s*/).find(t=>":self"==t);return e&&(n=n.replace(ere,"")),[n=n.replace(/@\*/g,FE).replace(/@\w+/g,t=>FE+"-"+t.substr(1)).replace(/:animating/g,mO),e]}(e.selector);t.currentQuerySelector=i.length?i+" "+s:s,Ma(t.collectedStyles,t.currentQuerySelector,{});const a=xa(this,Lv(e.animation),t);return t.currentQuery=null,t.currentQuerySelector=i,{type:11,selector:s,limit:r.limit||0,optional:!!r.optional,includeSelf:o,animation:a,originalSelector:e.selector,options:zf(e.options)}}visitStagger(e,t){t.currentQuery||t.errors.push("stagger() can only be used inside of query()");const i="full"===e.timings?{duration:0,delay:0,easing:"full"}:NE(e.timings,t.errors,!0);return{type:12,animation:xa(this,Lv(e.animation),t),timings:i,options:null}}}class rre{constructor(e){this.errors=e,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 UE(n){return!Array.isArray(n)&&"object"==typeof n}function zf(n){return n?(n=rm(n)).params&&(n.params=function(n){return n?rm(n):null}(n.params)):n={},n}function wO(n,e,t){return{duration:n,delay:e,easing:t}}function EO(n,e,t,i,r,s,o=null,a=!1){return{type:1,element:n,keyframes:e,preStyleProps:t,postStyleProps:i,duration:r,delay:s,totalTime:r+s,easing:o,subTimeline:a}}class HE{constructor(){this._map=new Map}consume(e){let t=this._map.get(e);return t?this._map.delete(e):t=[],t}append(e,t){let i=this._map.get(e);i||this._map.set(e,i=[]),i.push(...t)}has(e){return this._map.has(e)}clear(){this._map.clear()}}const cre=new RegExp(":enter","g"),dre=new RegExp(":leave","g");function SO(n,e,t,i,r,s={},o={},a,l,c=[]){return(new hre).buildKeyframes(n,e,t,i,r,s,o,a,l,c)}class hre{buildKeyframes(e,t,i,r,s,o,a,l,c,d=[]){c=c||new HE;const f=new MO(e,t,c,r,s,d,[]);f.options=l,f.currentTimeline.setStyles([o],null,f.errors,l),xa(this,i,f);const p=f.timelines.filter(g=>g.containsAnimation());if(p.length&&Object.keys(a).length){const g=p[p.length-1];g.allowOnlyTimelineStyles()||g.setStyles([a],null,f.errors,l)}return p.length?p.map(g=>g.buildKeyframes()):[EO(t,[],[],[],0,0,"",!1)]}visitTrigger(e,t){}visitState(e,t){}visitTransition(e,t){}visitAnimateChild(e,t){const i=t.subInstructions.consume(t.element);if(i){const r=t.createSubContext(e.options),s=t.currentTimeline.currentTime,o=this._visitSubInstructions(i,r,r.options);s!=o&&t.transformIntoNewTimeline(o)}t.previousNode=e}visitAnimateRef(e,t){const i=t.createSubContext(e.options);i.transformIntoNewTimeline(),this.visitReference(e.animation,i),t.transformIntoNewTimeline(i.currentTimeline.currentTime),t.previousNode=e}_visitSubInstructions(e,t,i){let s=t.currentTimeline.currentTime;const o=null!=i.duration?Bf(i.duration):null,a=null!=i.delay?Bf(i.delay):null;return 0!==o&&e.forEach(l=>{const c=t.appendInstructionToTimeline(l,o,a);s=Math.max(s,c.duration+c.delay)}),s}visitReference(e,t){t.updateOptions(e.options,!0),xa(this,e.animation,t),t.previousNode=e}visitSequence(e,t){const i=t.subContextCount;let r=t;const s=e.options;if(s&&(s.params||s.delay)&&(r=t.createSubContext(s),r.transformIntoNewTimeline(),null!=s.delay)){6==r.previousNode.type&&(r.currentTimeline.snapshotCurrentStyles(),r.previousNode=$E);const o=Bf(s.delay);r.delayNextStep(o)}e.steps.length&&(e.steps.forEach(o=>xa(this,o,r)),r.currentTimeline.applyStylesToKeyframe(),r.subContextCount>i&&r.transformIntoNewTimeline()),t.previousNode=e}visitGroup(e,t){const i=[];let r=t.currentTimeline.currentTime;const s=e.options&&e.options.delay?Bf(e.options.delay):0;e.steps.forEach(o=>{const a=t.createSubContext(e.options);s&&a.delayNextStep(s),xa(this,o,a),r=Math.max(r,a.currentTimeline.currentTime),i.push(a.currentTimeline)}),i.forEach(o=>t.currentTimeline.mergeTimelineCollectedStyles(o)),t.transformIntoNewTimeline(r),t.previousNode=e}_visitTiming(e,t){if(e.dynamic){const i=e.strValue;return NE(t.params?LE(i,t.params,t.errors):i,t.errors)}return{duration:e.duration,delay:e.delay,easing:e.easing}}visitAnimate(e,t){const i=t.currentAnimateTimings=this._visitTiming(e.timings,t),r=t.currentTimeline;i.delay&&(t.incrementTime(i.delay),r.snapshotCurrentStyles());const s=e.style;5==s.type?this.visitKeyframes(s,t):(t.incrementTime(i.duration),this.visitStyle(s,t),r.applyStylesToKeyframe()),t.currentAnimateTimings=null,t.previousNode=e}visitStyle(e,t){const i=t.currentTimeline,r=t.currentAnimateTimings;!r&&i.getCurrentStyleProperties().length&&i.forwardFrame();const s=r&&r.easing||e.easing;e.isEmptyStep?i.applyEmptyStep(s):i.setStyles(e.styles,s,t.errors,t.options),t.previousNode=e}visitKeyframes(e,t){const i=t.currentAnimateTimings,r=t.currentTimeline.duration,s=i.duration,a=t.createSubContext().currentTimeline;a.easing=i.easing,e.styles.forEach(l=>{a.forwardTime((l.offset||0)*s),a.setStyles(l.styles,l.easing,t.errors,t.options),a.applyStylesToKeyframe()}),t.currentTimeline.mergeTimelineCollectedStyles(a),t.transformIntoNewTimeline(r+s),t.previousNode=e}visitQuery(e,t){const i=t.currentTimeline.currentTime,r=e.options||{},s=r.delay?Bf(r.delay):0;s&&(6===t.previousNode.type||0==i&&t.currentTimeline.getCurrentStyleProperties().length)&&(t.currentTimeline.snapshotCurrentStyles(),t.previousNode=$E);let o=i;const a=t.invokeQuery(e.selector,e.originalSelector,e.limit,e.includeSelf,!!r.optional,t.errors);t.currentQueryTotal=a.length;let l=null;a.forEach((c,d)=>{t.currentQueryIndex=d;const f=t.createSubContext(e.options,c);s&&f.delayNextStep(s),c===t.element&&(l=f.currentTimeline),xa(this,e.animation,f),f.currentTimeline.applyStylesToKeyframe(),o=Math.max(o,f.currentTimeline.currentTime)}),t.currentQueryIndex=0,t.currentQueryTotal=0,t.transformIntoNewTimeline(o),l&&(t.currentTimeline.mergeTimelineCollectedStyles(l),t.currentTimeline.snapshotCurrentStyles()),t.previousNode=e}visitStagger(e,t){const i=t.parentContext,r=t.currentTimeline,s=e.timings,o=Math.abs(s.duration),a=o*(t.currentQueryTotal-1);let l=o*t.currentQueryIndex;switch(s.duration<0?"reverse":s.easing){case"reverse":l=a-l;break;case"full":l=i.currentStaggerTime}const d=t.currentTimeline;l&&d.delayNextStep(l);const f=d.currentTime;xa(this,e.animation,t),t.previousNode=e,i.currentStaggerTime=r.currentTime-f+(r.startTime-i.currentTimeline.startTime)}}const $E={};class MO{constructor(e,t,i,r,s,o,a,l){this._driver=e,this.element=t,this.subInstructions=i,this._enterClassName=r,this._leaveClassName=s,this.errors=o,this.timelines=a,this.parentContext=null,this.currentAnimateTimings=null,this.previousNode=$E,this.subContextCount=0,this.options={},this.currentQueryIndex=0,this.currentQueryTotal=0,this.currentStaggerTime=0,this.currentTimeline=l||new GE(this._driver,t,0),a.push(this.currentTimeline)}get params(){return this.options.params}updateOptions(e,t){if(!e)return;const i=e;let r=this.options;null!=i.duration&&(r.duration=Bf(i.duration)),null!=i.delay&&(r.delay=Bf(i.delay));const s=i.params;if(s){let o=r.params;o||(o=this.options.params={}),Object.keys(s).forEach(a=>{(!t||!o.hasOwnProperty(a))&&(o[a]=LE(s[a],o,this.errors))})}}_copyOptions(){const e={};if(this.options){const t=this.options.params;if(t){const i=e.params={};Object.keys(t).forEach(r=>{i[r]=t[r]})}}return e}createSubContext(e=null,t,i){const r=t||this.element,s=new MO(this._driver,r,this.subInstructions,this._enterClassName,this._leaveClassName,this.errors,this.timelines,this.currentTimeline.fork(r,i||0));return s.previousNode=this.previousNode,s.currentAnimateTimings=this.currentAnimateTimings,s.options=this._copyOptions(),s.updateOptions(e),s.currentQueryIndex=this.currentQueryIndex,s.currentQueryTotal=this.currentQueryTotal,s.parentContext=this,this.subContextCount++,s}transformIntoNewTimeline(e){return this.previousNode=$E,this.currentTimeline=this.currentTimeline.fork(this.element,e),this.timelines.push(this.currentTimeline),this.currentTimeline}appendInstructionToTimeline(e,t,i){const r={duration:null!=t?t:e.duration,delay:this.currentTimeline.currentTime+(null!=i?i:0)+e.delay,easing:""},s=new fre(this._driver,e.element,e.keyframes,e.preStyleProps,e.postStyleProps,r,e.stretchStartingKeyframe);return this.timelines.push(s),r}incrementTime(e){this.currentTimeline.forwardTime(this.currentTimeline.duration+e)}delayNextStep(e){e>0&&this.currentTimeline.delayNextStep(e)}invokeQuery(e,t,i,r,s,o){let a=[];if(r&&a.push(this.element),e.length>0){e=(e=e.replace(cre,"."+this._enterClassName)).replace(dre,"."+this._leaveClassName);let c=this._driver.query(this.element,e,1!=i);0!==i&&(c=i<0?c.slice(c.length+i,c.length):c.slice(0,i)),a.push(...c)}return!s&&0==a.length&&o.push(`\`query("${t}")\` returned zero elements. (Use \`query("${t}", { optional: true })\` if you wish to allow this.)`),a}}class GE{constructor(e,t,i,r){this._driver=e,this.element=t,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(t),this._globalTimelineStyles||(this._globalTimelineStyles=this._localTimelineStyles,this._elementTimelineStylesLookup.set(t,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(e){const t=1==this._keyframes.size&&Object.keys(this._pendingStyles).length;this.duration||t?(this.forwardTime(this.currentTime+e),t&&this.snapshotCurrentStyles()):this.startTime+=e}fork(e,t){return this.applyStylesToKeyframe(),new GE(this._driver,e,t||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(e){this.applyStylesToKeyframe(),this.duration=e,this._loadKeyframe()}_updateStyle(e,t){this._localTimelineStyles[e]=t,this._globalTimelineStyles[e]=t,this._styleSummary[e]={time:this.currentTime,value:t}}allowOnlyTimelineStyles(){return this._currentEmptyStepKeyframe!==this._currentKeyframe}applyEmptyStep(e){e&&(this._previousKeyframe.easing=e),Object.keys(this._globalTimelineStyles).forEach(t=>{this._backFill[t]=this._globalTimelineStyles[t]||qu,this._currentKeyframe[t]=qu}),this._currentEmptyStepKeyframe=this._currentKeyframe}setStyles(e,t,i,r){t&&(this._previousKeyframe.easing=t);const s=r&&r.params||{},o=function(n,e){const t={};let i;return n.forEach(r=>{"*"===r?(i=i||Object.keys(e),i.forEach(s=>{t[s]=qu})):sh(r,!1,t)}),t}(e,this._globalTimelineStyles);Object.keys(o).forEach(a=>{const l=LE(o[a],s,i);this._pendingStyles[a]=l,this._localTimelineStyles.hasOwnProperty(a)||(this._backFill[a]=this._globalTimelineStyles.hasOwnProperty(a)?this._globalTimelineStyles[a]:qu),this._updateStyle(a,l)})}applyStylesToKeyframe(){const e=this._pendingStyles,t=Object.keys(e);0!=t.length&&(this._pendingStyles={},t.forEach(i=>{this._currentKeyframe[i]=e[i]}),Object.keys(this._localTimelineStyles).forEach(i=>{this._currentKeyframe.hasOwnProperty(i)||(this._currentKeyframe[i]=this._localTimelineStyles[i])}))}snapshotCurrentStyles(){Object.keys(this._localTimelineStyles).forEach(e=>{const t=this._localTimelineStyles[e];this._pendingStyles[e]=t,this._updateStyle(e,t)})}getFinalKeyframe(){return this._keyframes.get(this.duration)}get properties(){const e=[];for(let t in this._currentKeyframe)e.push(t);return e}mergeTimelineCollectedStyles(e){Object.keys(e._styleSummary).forEach(t=>{const i=this._styleSummary[t],r=e._styleSummary[t];(!i||r.time>i.time)&&this._updateStyle(t,r.value)})}buildKeyframes(){this.applyStylesToKeyframe();const e=new Set,t=new Set,i=1===this._keyframes.size&&0===this.duration;let r=[];this._keyframes.forEach((a,l)=>{const c=sh(a,!0);Object.keys(c).forEach(d=>{const f=c[d];"!"==f?e.add(d):f==qu&&t.add(d)}),i||(c.offset=l/this.duration),r.push(c)});const s=e.size?BE(e.values()):[],o=t.size?BE(t.values()):[];if(i){const a=r[0],l=rm(a);a.offset=0,l.offset=1,r=[a,l]}return EO(this.element,r,s,o,this.duration,this.startTime,this.easing,!1)}}class fre extends GE{constructor(e,t,i,r,s,o,a=!1){super(e,t,o.delay),this.keyframes=i,this.preStyleProps=r,this.postStyleProps=s,this._stretchStartingKeyframe=a,this.timings={duration:o.duration,delay:o.delay,easing:o.easing}}containsAnimation(){return this.keyframes.length>1}buildKeyframes(){let e=this.keyframes,{delay:t,duration:i,easing:r}=this.timings;if(this._stretchStartingKeyframe&&t){const s=[],o=i+t,a=t/o,l=sh(e[0],!1);l.offset=0,s.push(l);const c=sh(e[0],!1);c.offset=Cz(a),s.push(c);const d=e.length-1;for(let f=1;f<=d;f++){let p=sh(e[f],!1);p.offset=Cz((t+p.offset*i)/o),s.push(p)}i=o,t=0,r="",e=s}return EO(this.element,e,this.preStyleProps,this.postStyleProps,i,t,r,!0)}}function Cz(n,e=3){const t=Math.pow(10,e-1);return Math.round(n*t)/t}class xO{}class gre extends xO{normalizePropertyName(e,t){return vO(e)}normalizeStyleValue(e,t,i,r){let s="";const o=i.toString().trim();if(mre[t]&&0!==i&&"0"!==i)if("number"==typeof i)s="px";else{const a=i.match(/^[+-]?[\d\.]+([a-z]*)$/);a&&0==a[1].length&&r.push(`Please provide a CSS unit value for ${e}:${i}`)}return o+s}}const mre=(()=>function(n){const e={};return n.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 wz(n,e,t,i,r,s,o,a,l,c,d,f,p){return{type:0,element:n,triggerName:e,isRemovalTransition:r,fromState:t,fromStyles:s,toState:i,toStyles:o,timelines:a,queriedElements:l,preStyleProps:c,postStyleProps:d,totalTime:f,errors:p}}const TO={};class Ez{constructor(e,t,i){this._triggerName=e,this.ast=t,this._stateStyles=i}match(e,t,i,r){return function(n,e,t,i,r){return n.some(s=>s(e,t,i,r))}(this.ast.matchers,e,t,i,r)}buildStyles(e,t,i){const r=this._stateStyles["*"],s=this._stateStyles[e],o=r?r.buildStyles(t,i):{};return s?s.buildStyles(t,i):o}build(e,t,i,r,s,o,a,l,c,d){const f=[],p=this.ast.options&&this.ast.options.params||TO,_=this.buildStyles(i,a&&a.params||TO,f),y=l&&l.params||TO,v=this.buildStyles(r,y,f),C=new Set,w=new Map,x=new Map,N="void"===r,V={params:Object.assign(Object.assign({},p),y)},U=d?[]:SO(e,t,this.ast.animation,s,o,_,v,V,c,f);let ee=0;if(U.forEach(ae=>{ee=Math.max(ae.duration+ae.delay,ee)}),f.length)return wz(t,this._triggerName,i,r,N,_,v,[],[],w,x,ee,f);U.forEach(ae=>{const me=ae.element,Ee=Ma(w,me,{});ae.preStyleProps.forEach(te=>Ee[te]=!0);const Be=Ma(x,me,{});ae.postStyleProps.forEach(te=>Be[te]=!0),me!==t&&C.add(me)});const de=BE(C.values());return wz(t,this._triggerName,i,r,N,_,v,U,de,w,x,ee)}}class vre{constructor(e,t,i){this.styles=e,this.defaultParams=t,this.normalizer=i}buildStyles(e,t){const i={},r=rm(this.defaultParams);return Object.keys(e).forEach(s=>{const o=e[s];null!=o&&(r[s]=o)}),this.styles.styles.forEach(s=>{if("string"!=typeof s){const o=s;Object.keys(o).forEach(a=>{let l=o[a];l.length>1&&(l=LE(l,r,t));const c=this.normalizer.normalizePropertyName(a,t);l=this.normalizer.normalizeStyleValue(a,c,l,t),i[c]=l})}}),i}}class Cre{constructor(e,t,i){this.name=e,this.ast=t,this._normalizer=i,this.transitionFactories=[],this.states={},t.states.forEach(r=>{this.states[r.name]=new vre(r.style,r.options&&r.options.params||{},i)}),Sz(this.states,"true","1"),Sz(this.states,"false","0"),t.transitions.forEach(r=>{this.transitionFactories.push(new Ez(e,r,this.states))}),this.fallbackTransition=function(n,e,t){return new Ez(n,{type:1,animation:{type:2,steps:[],options:null},matchers:[(o,a)=>!0],options:null,queryCount:0,depCount:0},e)}(e,this.states)}get containsQueries(){return this.ast.queryCount>0}matchTransition(e,t,i,r){return this.transitionFactories.find(o=>o.match(e,t,i,r))||null}matchStyles(e,t,i){return this.fallbackTransition.buildStyles(e,t,i)}}function Sz(n,e,t){n.hasOwnProperty(e)?n.hasOwnProperty(t)||(n[t]=n[e]):n.hasOwnProperty(t)&&(n[e]=n[t])}const Ere=new HE;class Sre{constructor(e,t,i){this.bodyNode=e,this._driver=t,this._normalizer=i,this._animations={},this._playersById={},this.players=[]}register(e,t){const i=[],r=CO(this._driver,t,i);if(i.length)throw new Error(`Unable to build the animation due to the following errors: ${i.join("\n")}`);this._animations[e]=r}_buildPlayer(e,t,i){const r=e.element,s=iz(0,this._normalizer,0,e.keyframes,t,i);return this._driver.animate(r,s,e.duration,e.delay,e.easing,[],!0)}create(e,t,i={}){const r=[],s=this._animations[e];let o;const a=new Map;if(s?(o=SO(this._driver,t,s,gO,RE,{},{},i,Ere,r),o.forEach(d=>{const f=Ma(a,d.element,{});d.postStyleProps.forEach(p=>f[p]=null)})):(r.push("The requested animation doesn't exist or has already been destroyed"),o=[]),r.length)throw new Error(`Unable to create the animation due to the following errors: ${r.join("\n")}`);a.forEach((d,f)=>{Object.keys(d).forEach(p=>{d[p]=this._driver.computeStyle(f,p,qu)})});const c=rh(o.map(d=>{const f=a.get(d.element);return this._buildPlayer(d,{},f)}));return this._playersById[e]=c,c.onDestroy(()=>this.destroy(e)),this.players.push(c),c}destroy(e){const t=this._getPlayer(e);t.destroy(),delete this._playersById[e];const i=this.players.indexOf(t);i>=0&&this.players.splice(i,1)}_getPlayer(e){const t=this._playersById[e];if(!t)throw new Error(`Unable to find the timeline player referenced by ${e}`);return t}listen(e,t,i,r){const s=lO(t,"","","");return oO(this._getPlayer(e),i,s,r),()=>{}}command(e,t,i,r){if("register"==i)return void this.register(e,r[0]);if("create"==i)return void this.create(e,t,r[0]||{});const s=this._getPlayer(e);switch(i){case"play":s.play();break;case"pause":s.pause();break;case"reset":s.reset();break;case"restart":s.restart();break;case"finish":s.finish();break;case"init":s.init();break;case"setPosition":s.setPosition(parseFloat(r[0]));break;case"destroy":this.destroy(e)}}}const Mz="ng-animate-queued",xz="ng-animate-disabled",Tz=".ng-animate-disabled",Are=[],Az={namespaceId:"",setForRemoval:!1,setForMove:!1,hasAnimation:!1,removedBeforeQueried:!1},Dre={namespaceId:"",setForMove:!1,setForRemoval:!1,hasAnimation:!1,removedBeforeQueried:!0},gl="__ng_removed";class AO{constructor(e,t=""){this.namespaceId=t;const i=e&&e.hasOwnProperty("value");if(this.value=function(n){return null!=n?n:null}(i?e.value:e),i){const s=rm(e);delete s.value,this.options=s}else this.options={};this.options.params||(this.options.params={})}get params(){return this.options.params}absorbOptions(e){const t=e.params;if(t){const i=this.options.params;Object.keys(t).forEach(r=>{null==i[r]&&(i[r]=t[r])})}}}const Bv="void",DO=new AO(Bv);class Ore{constructor(e,t,i){this.id=e,this.hostElement=t,this._engine=i,this.players=[],this._triggers={},this._queue=[],this._elementListeners=new Map,this._hostClassName="ng-tns-"+e,ml(t,this._hostClassName)}listen(e,t,i,r){if(!this._triggers.hasOwnProperty(t))throw new Error(`Unable to listen on the animation trigger event "${i}" because the animation trigger "${t}" doesn't exist!`);if(null==i||0==i.length)throw new Error(`Unable to listen on the animation trigger "${t}" because the provided event is undefined!`);if(!function(n){return"start"==n||"done"==n}(i))throw new Error(`The provided animation trigger event "${i}" for the animation trigger "${t}" is not supported!`);const s=Ma(this._elementListeners,e,[]),o={name:t,phase:i,callback:r};s.push(o);const a=Ma(this._engine.statesByElement,e,{});return a.hasOwnProperty(t)||(ml(e,kE),ml(e,kE+"-"+t),a[t]=DO),()=>{this._engine.afterFlush(()=>{const l=s.indexOf(o);l>=0&&s.splice(l,1),this._triggers[t]||delete a[t]})}}register(e,t){return!this._triggers[e]&&(this._triggers[e]=t,!0)}_getTrigger(e){const t=this._triggers[e];if(!t)throw new Error(`The provided animation trigger "${e}" has not been registered!`);return t}trigger(e,t,i,r=!0){const s=this._getTrigger(t),o=new OO(this.id,t,e);let a=this._engine.statesByElement.get(e);a||(ml(e,kE),ml(e,kE+"-"+t),this._engine.statesByElement.set(e,a={}));let l=a[t];const c=new AO(i,this.id);if(!(i&&i.hasOwnProperty("value"))&&l&&c.absorbOptions(l.options),a[t]=c,l||(l=DO),c.value!==Bv&&l.value===c.value){if(!function(n,e){const t=Object.keys(n),i=Object.keys(e);if(t.length!=i.length)return!1;for(let r=0;r{Vf(e,v),Gc(e,C)})}return}const p=Ma(this._engine.playersByElement,e,[]);p.forEach(y=>{y.namespaceId==this.id&&y.triggerName==t&&y.queued&&y.destroy()});let g=s.matchTransition(l.value,c.value,e,c.params),_=!1;if(!g){if(!r)return;g=s.fallbackTransition,_=!0}return this._engine.totalQueuedPlayers++,this._queue.push({element:e,triggerName:t,transition:g,fromState:l,toState:c,player:o,isFallbackTransition:_}),_||(ml(e,Mz),o.onStart(()=>{sm(e,Mz)})),o.onDone(()=>{let y=this.players.indexOf(o);y>=0&&this.players.splice(y,1);const v=this._engine.playersByElement.get(e);if(v){let C=v.indexOf(o);C>=0&&v.splice(C,1)}}),this.players.push(o),p.push(o),o}deregister(e){delete this._triggers[e],this._engine.statesByElement.forEach((t,i)=>{delete t[e]}),this._elementListeners.forEach((t,i)=>{this._elementListeners.set(i,t.filter(r=>r.name!=e))})}clearElementCache(e){this._engine.statesByElement.delete(e),this._elementListeners.delete(e);const t=this._engine.playersByElement.get(e);t&&(t.forEach(i=>i.destroy()),this._engine.playersByElement.delete(e))}_signalRemovalForInnerTriggers(e,t){const i=this._engine.driver.query(e,FE,!0);i.forEach(r=>{if(r[gl])return;const s=this._engine.fetchNamespacesByElement(r);s.size?s.forEach(o=>o.triggerLeaveAnimation(r,t,!1,!0)):this.clearElementCache(r)}),this._engine.afterFlushAnimationsDone(()=>i.forEach(r=>this.clearElementCache(r)))}triggerLeaveAnimation(e,t,i,r){const s=this._engine.statesByElement.get(e);if(s){const o=[];if(Object.keys(s).forEach(a=>{if(this._triggers[a]){const l=this.trigger(e,a,Bv,r);l&&o.push(l)}}),o.length)return this._engine.markElementAsRemoved(this.id,e,!0,t),i&&rh(o).onDone(()=>this._engine.processLeaveNode(e)),!0}return!1}prepareLeaveAnimationListeners(e){const t=this._elementListeners.get(e),i=this._engine.statesByElement.get(e);if(t&&i){const r=new Set;t.forEach(s=>{const o=s.name;if(r.has(o))return;r.add(o);const l=this._triggers[o].fallbackTransition,c=i[o]||DO,d=new AO(Bv),f=new OO(this.id,o,e);this._engine.totalQueuedPlayers++,this._queue.push({element:e,triggerName:o,transition:l,fromState:c,toState:d,player:f,isFallbackTransition:!0})})}}removeNode(e,t){const i=this._engine;if(e.childElementCount&&this._signalRemovalForInnerTriggers(e,t),this.triggerLeaveAnimation(e,t,!0))return;let r=!1;if(i.totalAnimations){const s=i.players.length?i.playersByQueriedElement.get(e):[];if(s&&s.length)r=!0;else{let o=e;for(;o=o.parentNode;)if(i.statesByElement.get(o)){r=!0;break}}}if(this.prepareLeaveAnimationListeners(e),r)i.markElementAsRemoved(this.id,e,!1,t);else{const s=e[gl];(!s||s===Az)&&(i.afterFlush(()=>this.clearElementCache(e)),i.destroyInnerAnimations(e),i._onRemovalComplete(e,t))}}insertNode(e,t){ml(e,this._hostClassName)}drainQueuedTransitions(e){const t=[];return this._queue.forEach(i=>{const r=i.player;if(r.destroyed)return;const s=i.element,o=this._elementListeners.get(s);o&&o.forEach(a=>{if(a.name==i.triggerName){const l=lO(s,i.triggerName,i.fromState.value,i.toState.value);l._data=e,oO(i.player,a.phase,l,a.callback)}}),r.markedForDestroy?this._engine.afterFlush(()=>{r.destroy()}):t.push(i)}),this._queue=[],t.sort((i,r)=>{const s=i.transition.ast.depCount,o=r.transition.ast.depCount;return 0==s||0==o?s-o:this._engine.driver.containsElement(i.element,r.element)?1:-1})}destroy(e){this.players.forEach(t=>t.destroy()),this._signalRemovalForInnerTriggers(this.hostElement,e)}elementContainsData(e){let t=!1;return this._elementListeners.has(e)&&(t=!0),t=!!this._queue.find(i=>i.element===e)||t,t}}class Ire{constructor(e,t,i){this.bodyNode=e,this.driver=t,this._normalizer=i,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=(r,s)=>{}}_onRemovalComplete(e,t){this.onRemovalComplete(e,t)}get queuedPlayers(){const e=[];return this._namespaceList.forEach(t=>{t.players.forEach(i=>{i.queued&&e.push(i)})}),e}createNamespace(e,t){const i=new Ore(e,t,this);return this.bodyNode&&this.driver.containsElement(this.bodyNode,t)?this._balanceNamespaceList(i,t):(this.newHostElements.set(t,i),this.collectEnterElement(t)),this._namespaceLookup[e]=i}_balanceNamespaceList(e,t){const i=this._namespaceList.length-1;if(i>=0){let r=!1;for(let s=i;s>=0;s--)if(this.driver.containsElement(this._namespaceList[s].hostElement,t)){this._namespaceList.splice(s+1,0,e),r=!0;break}r||this._namespaceList.splice(0,0,e)}else this._namespaceList.push(e);return this.namespacesByHostElement.set(t,e),e}register(e,t){let i=this._namespaceLookup[e];return i||(i=this.createNamespace(e,t)),i}registerTrigger(e,t,i){let r=this._namespaceLookup[e];r&&r.register(t,i)&&this.totalAnimations++}destroy(e,t){if(!e)return;const i=this._fetchNamespace(e);this.afterFlush(()=>{this.namespacesByHostElement.delete(i.hostElement),delete this._namespaceLookup[e];const r=this._namespaceList.indexOf(i);r>=0&&this._namespaceList.splice(r,1)}),this.afterFlushAnimationsDone(()=>i.destroy(t))}_fetchNamespace(e){return this._namespaceLookup[e]}fetchNamespacesByElement(e){const t=new Set,i=this.statesByElement.get(e);if(i){const r=Object.keys(i);for(let s=0;s=0&&this.collectedLeaveElements.splice(o,1)}if(e){const o=this._fetchNamespace(e);o&&o.insertNode(t,i)}r&&this.collectEnterElement(t)}collectEnterElement(e){this.collectedEnterElements.push(e)}markElementAsDisabled(e,t){t?this.disabledNodes.has(e)||(this.disabledNodes.add(e),ml(e,xz)):this.disabledNodes.has(e)&&(this.disabledNodes.delete(e),sm(e,xz))}removeNode(e,t,i,r){if(WE(t)){const s=e?this._fetchNamespace(e):null;if(s?s.removeNode(t,r):this.markElementAsRemoved(e,t,!1,r),i){const o=this.namespacesByHostElement.get(t);o&&o.id!==e&&o.removeNode(t,r)}}else this._onRemovalComplete(t,r)}markElementAsRemoved(e,t,i,r){this.collectedLeaveElements.push(t),t[gl]={namespaceId:e,setForRemoval:r,hasAnimation:i,removedBeforeQueried:!1}}listen(e,t,i,r,s){return WE(t)?this._fetchNamespace(e).listen(t,i,r,s):()=>{}}_buildInstruction(e,t,i,r,s){return e.transition.build(this.driver,e.element,e.fromState.value,e.toState.value,i,r,e.fromState.options,e.toState.options,t,s)}destroyInnerAnimations(e){let t=this.driver.query(e,FE,!0);t.forEach(i=>this.destroyActiveAnimationsForElement(i)),0!=this.playersByQueriedElement.size&&(t=this.driver.query(e,mO,!0),t.forEach(i=>this.finishActiveQueriedAnimationOnElement(i)))}destroyActiveAnimationsForElement(e){const t=this.playersByElement.get(e);t&&t.forEach(i=>{i.queued?i.markedForDestroy=!0:i.destroy()})}finishActiveQueriedAnimationOnElement(e){const t=this.playersByQueriedElement.get(e);t&&t.forEach(i=>i.finish())}whenRenderingDone(){return new Promise(e=>{if(this.players.length)return rh(this.players).onDone(()=>e());e()})}processLeaveNode(e){const t=e[gl];if(t&&t.setForRemoval){if(e[gl]=Az,t.namespaceId){this.destroyInnerAnimations(e);const i=this._fetchNamespace(t.namespaceId);i&&i.clearElementCache(e)}this._onRemovalComplete(e,t.setForRemoval)}this.driver.matchesElement(e,Tz)&&this.markElementAsDisabled(e,!1),this.driver.query(e,Tz,!0).forEach(i=>{this.markElementAsDisabled(i,!1)})}flush(e=-1){let t=[];if(this.newHostElements.size&&(this.newHostElements.forEach((i,r)=>this._balanceNamespaceList(i,r)),this.newHostElements.clear()),this.totalAnimations&&this.collectedEnterElements.length)for(let i=0;ii()),this._flushFns=[],this._whenQuietFns.length){const i=this._whenQuietFns;this._whenQuietFns=[],t.length?rh(t).onDone(()=>{i.forEach(r=>r())}):i.forEach(r=>r())}}reportError(e){throw new Error(`Unable to process animations due to the following failed trigger transitions\n ${e.join("\n")}`)}_flushAnimations(e,t){const i=new HE,r=[],s=new Map,o=[],a=new Map,l=new Map,c=new Map,d=new Set;this.disabledNodes.forEach(Q=>{d.add(Q);const je=this.driver.query(Q,".ng-animate-queued",!0);for(let $e=0;$e{const $e=gO+y++;_.set(je,$e),Q.forEach(qe=>ml(qe,$e))});const v=[],C=new Set,w=new Set;for(let Q=0;QC.add(qe)):w.add(je))}const x=new Map,N=Iz(p,Array.from(C));N.forEach((Q,je)=>{const $e=RE+y++;x.set(je,$e),Q.forEach(qe=>ml(qe,$e))}),e.push(()=>{g.forEach((Q,je)=>{const $e=_.get(je);Q.forEach(qe=>sm(qe,$e))}),N.forEach((Q,je)=>{const $e=x.get(je);Q.forEach(qe=>sm(qe,$e))}),v.forEach(Q=>{this.processLeaveNode(Q)})});const V=[],U=[];for(let Q=this._namespaceList.length-1;Q>=0;Q--)this._namespaceList[Q].drainQueuedTransitions(t).forEach($e=>{const qe=$e.player,Ot=$e.element;if(V.push(qe),this.collectedEnterElements.length){const gi=Ot[gl];if(gi&&gi.setForMove)return void qe.destroy()}const Hn=!f||!this.driver.containsElement(f,Ot),ot=x.get(Ot),nr=_.get(Ot),Ln=this._buildInstruction($e,i,nr,ot,Hn);if(Ln.errors&&Ln.errors.length)U.push(Ln);else{if(Hn)return qe.onStart(()=>Vf(Ot,Ln.fromStyles)),qe.onDestroy(()=>Gc(Ot,Ln.toStyles)),void r.push(qe);if($e.isFallbackTransition)return qe.onStart(()=>Vf(Ot,Ln.fromStyles)),qe.onDestroy(()=>Gc(Ot,Ln.toStyles)),void r.push(qe);Ln.timelines.forEach(gi=>gi.stretchStartingKeyframe=!0),i.append(Ot,Ln.timelines),o.push({instruction:Ln,player:qe,element:Ot}),Ln.queriedElements.forEach(gi=>Ma(a,gi,[]).push(qe)),Ln.preStyleProps.forEach((gi,_r)=>{const oa=Object.keys(gi);if(oa.length){let Bs=l.get(_r);Bs||l.set(_r,Bs=new Set),oa.forEach(Na=>Bs.add(Na))}}),Ln.postStyleProps.forEach((gi,_r)=>{const oa=Object.keys(gi);let Bs=c.get(_r);Bs||c.set(_r,Bs=new Set),oa.forEach(Na=>Bs.add(Na))})}});if(U.length){const Q=[];U.forEach(je=>{Q.push(`@${je.triggerName} has failed due to:\n`),je.errors.forEach($e=>Q.push(`- ${$e}\n`))}),V.forEach(je=>je.destroy()),this.reportError(Q)}const ee=new Map,de=new Map;o.forEach(Q=>{const je=Q.element;i.has(je)&&(de.set(je,je),this._beforeAnimationBuild(Q.player.namespaceId,Q.instruction,ee))}),r.forEach(Q=>{const je=Q.element;this._getPreviousPlayers(je,!1,Q.namespaceId,Q.triggerName,null).forEach(qe=>{Ma(ee,je,[]).push(qe),qe.destroy()})});const ae=v.filter(Q=>Rz(Q,l,c)),me=new Map;Oz(me,this.driver,w,c,qu).forEach(Q=>{Rz(Q,l,c)&&ae.push(Q)});const Be=new Map;g.forEach((Q,je)=>{Oz(Be,this.driver,new Set(Q),l,"!")}),ae.forEach(Q=>{const je=me.get(Q),$e=Be.get(Q);me.set(Q,Object.assign(Object.assign({},je),$e))});const te=[],ne=[],Ie={};o.forEach(Q=>{const{element:je,player:$e,instruction:qe}=Q;if(i.has(je)){if(d.has(je))return $e.onDestroy(()=>Gc(je,qe.toStyles)),$e.disabled=!0,$e.overrideTotalTime(qe.totalTime),void r.push($e);let Ot=Ie;if(de.size>1){let ot=je;const nr=[];for(;ot=ot.parentNode;){const Ln=de.get(ot);if(Ln){Ot=Ln;break}nr.push(ot)}nr.forEach(Ln=>de.set(Ln,Ot))}const Hn=this._buildAnimation($e.namespaceId,qe,ee,s,Be,me);if($e.setRealPlayer(Hn),Ot===Ie)te.push($e);else{const ot=this.playersByElement.get(Ot);ot&&ot.length&&($e.parentPlayer=rh(ot)),r.push($e)}}else Vf(je,qe.fromStyles),$e.onDestroy(()=>Gc(je,qe.toStyles)),ne.push($e),d.has(je)&&r.push($e)}),ne.forEach(Q=>{const je=s.get(Q.element);if(je&&je.length){const $e=rh(je);Q.setRealPlayer($e)}}),r.forEach(Q=>{Q.parentPlayer?Q.syncPlayerEvents(Q.parentPlayer):Q.destroy()});for(let Q=0;Q!Hn.destroyed);Ot.length?Fre(this,je,Ot):this.processLeaveNode(je)}return v.length=0,te.forEach(Q=>{this.players.push(Q),Q.onDone(()=>{Q.destroy();const je=this.players.indexOf(Q);this.players.splice(je,1)}),Q.play()}),te}elementContainsData(e,t){let i=!1;const r=t[gl];return r&&r.setForRemoval&&(i=!0),this.playersByElement.has(t)&&(i=!0),this.playersByQueriedElement.has(t)&&(i=!0),this.statesByElement.has(t)&&(i=!0),this._fetchNamespace(e).elementContainsData(t)||i}afterFlush(e){this._flushFns.push(e)}afterFlushAnimationsDone(e){this._whenQuietFns.push(e)}_getPreviousPlayers(e,t,i,r,s){let o=[];if(t){const a=this.playersByQueriedElement.get(e);a&&(o=a)}else{const a=this.playersByElement.get(e);if(a){const l=!s||s==Bv;a.forEach(c=>{c.queued||!l&&c.triggerName!=r||o.push(c)})}}return(i||r)&&(o=o.filter(a=>!(i&&i!=a.namespaceId||r&&r!=a.triggerName))),o}_beforeAnimationBuild(e,t,i){const s=t.element,o=t.isRemovalTransition?void 0:e,a=t.isRemovalTransition?void 0:t.triggerName;for(const l of t.timelines){const c=l.element,d=c!==s,f=Ma(i,c,[]);this._getPreviousPlayers(c,d,o,a,t.toState).forEach(g=>{const _=g.getRealPlayer();_.beforeDestroy&&_.beforeDestroy(),g.destroy(),f.push(g)})}Vf(s,t.fromStyles)}_buildAnimation(e,t,i,r,s,o){const a=t.triggerName,l=t.element,c=[],d=new Set,f=new Set,p=t.timelines.map(_=>{const y=_.element;d.add(y);const v=y[gl];if(v&&v.removedBeforeQueried)return new im(_.duration,_.delay);const C=y!==l,w=function(n){const e=[];return Pz(n,e),e}((i.get(y)||Are).map(ee=>ee.getRealPlayer())).filter(ee=>!!ee.element&&ee.element===y),x=s.get(y),N=o.get(y),V=iz(0,this._normalizer,0,_.keyframes,x,N),U=this._buildPlayer(_,V,w);if(_.subTimeline&&r&&f.add(y),C){const ee=new OO(e,a,y);ee.setRealPlayer(U),c.push(ee)}return U});c.forEach(_=>{Ma(this.playersByQueriedElement,_.element,[]).push(_),_.onDone(()=>function(n,e,t){let i;if(n instanceof Map){if(i=n.get(e),i){if(i.length){const r=i.indexOf(t);i.splice(r,1)}0==i.length&&n.delete(e)}}else if(i=n[e],i){if(i.length){const r=i.indexOf(t);i.splice(r,1)}0==i.length&&delete n[e]}return i}(this.playersByQueriedElement,_.element,_))}),d.forEach(_=>ml(_,dz));const g=rh(p);return g.onDestroy(()=>{d.forEach(_=>sm(_,dz)),Gc(l,t.toStyles)}),f.forEach(_=>{Ma(r,_,[]).push(g)}),g}_buildPlayer(e,t,i){return t.length>0?this.driver.animate(e.element,t,e.duration,e.delay,e.easing,i):new im(e.duration,e.delay)}}class OO{constructor(e,t,i){this.namespaceId=e,this.triggerName=t,this.element=i,this._player=new im,this._containsRealPlayer=!1,this._queuedCallbacks={},this.destroyed=!1,this.markedForDestroy=!1,this.disabled=!1,this.queued=!0,this.totalTime=0}setRealPlayer(e){this._containsRealPlayer||(this._player=e,Object.keys(this._queuedCallbacks).forEach(t=>{this._queuedCallbacks[t].forEach(i=>oO(e,t,void 0,i))}),this._queuedCallbacks={},this._containsRealPlayer=!0,this.overrideTotalTime(e.totalTime),this.queued=!1)}getRealPlayer(){return this._player}overrideTotalTime(e){this.totalTime=e}syncPlayerEvents(e){const t=this._player;t.triggerCallback&&e.onStart(()=>t.triggerCallback("start")),e.onDone(()=>this.finish()),e.onDestroy(()=>this.destroy())}_queueEvent(e,t){Ma(this._queuedCallbacks,e,[]).push(t)}onDone(e){this.queued&&this._queueEvent("done",e),this._player.onDone(e)}onStart(e){this.queued&&this._queueEvent("start",e),this._player.onStart(e)}onDestroy(e){this.queued&&this._queueEvent("destroy",e),this._player.onDestroy(e)}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(e){this.queued||this._player.setPosition(e)}getPosition(){return this.queued?0:this._player.getPosition()}triggerCallback(e){const t=this._player;t.triggerCallback&&t.triggerCallback(e)}}function WE(n){return n&&1===n.nodeType}function Dz(n,e){const t=n.style.display;return n.style.display=null!=e?e:"none",t}function Oz(n,e,t,i,r){const s=[];t.forEach(l=>s.push(Dz(l)));const o=[];i.forEach((l,c)=>{const d={};l.forEach(f=>{const p=d[f]=e.computeStyle(c,f,r);(!p||0==p.length)&&(c[gl]=Dre,o.push(c))}),n.set(c,d)});let a=0;return t.forEach(l=>Dz(l,s[a++])),o}function Iz(n,e){const t=new Map;if(n.forEach(a=>t.set(a,[])),0==e.length)return t;const r=new Set(e),s=new Map;function o(a){if(!a)return 1;let l=s.get(a);if(l)return l;const c=a.parentNode;return l=t.has(c)?c:r.has(c)?1:o(c),s.set(a,l),l}return e.forEach(a=>{const l=o(a);1!==l&&t.get(l).push(a)}),t}const qE="$$classes";function ml(n,e){if(n.classList)n.classList.add(e);else{let t=n[qE];t||(t=n[qE]={}),t[e]=!0}}function sm(n,e){if(n.classList)n.classList.remove(e);else{let t=n[qE];t&&delete t[e]}}function Fre(n,e,t){rh(t).onDone(()=>n.processLeaveNode(e))}function Pz(n,e){for(let t=0;tr.add(s)):e.set(n,i),t.delete(n),!0}class YE{constructor(e,t,i){this.bodyNode=e,this._driver=t,this._normalizer=i,this._triggerCache={},this.onRemovalComplete=(r,s)=>{},this._transitionEngine=new Ire(e,t,i),this._timelineEngine=new Sre(e,t,i),this._transitionEngine.onRemovalComplete=(r,s)=>this.onRemovalComplete(r,s)}registerTrigger(e,t,i,r,s){const o=e+"-"+r;let a=this._triggerCache[o];if(!a){const l=[],c=CO(this._driver,s,l);if(l.length)throw new Error(`The animation trigger "${r}" has failed to build due to the following errors:\n - ${l.join("\n - ")}`);a=function(n,e,t){return new Cre(n,e,t)}(r,c,this._normalizer),this._triggerCache[o]=a}this._transitionEngine.registerTrigger(t,r,a)}register(e,t){this._transitionEngine.register(e,t)}destroy(e,t){this._transitionEngine.destroy(e,t)}onInsert(e,t,i,r){this._transitionEngine.insertNode(e,t,i,r)}onRemove(e,t,i,r){this._transitionEngine.removeNode(e,t,r||!1,i)}disableAnimations(e,t){this._transitionEngine.markElementAsDisabled(e,t)}process(e,t,i,r){if("@"==i.charAt(0)){const[s,o]=rz(i);this._timelineEngine.command(s,t,o,r)}else this._transitionEngine.trigger(e,t,i,r)}listen(e,t,i,r,s){if("@"==i.charAt(0)){const[o,a]=rz(i);return this._timelineEngine.listen(o,t,a,s)}return this._transitionEngine.listen(e,t,i,r,s)}flush(e=-1){this._transitionEngine.flush(e)}get players(){return this._transitionEngine.players.concat(this._timelineEngine.players)}whenRenderingDone(){return this._transitionEngine.whenRenderingDone()}}function kz(n,e){let t=null,i=null;return Array.isArray(e)&&e.length?(t=IO(e[0]),e.length>1&&(i=IO(e[e.length-1]))):e&&(t=IO(e)),t||i?new om(n,t,i):null}class om{constructor(e,t,i){this._element=e,this._startStyles=t,this._endStyles=i,this._state=0;let r=om.initialStylesByElement.get(e);r||om.initialStylesByElement.set(e,r={}),this._initialStyles=r}start(){this._state<1&&(this._startStyles&&Gc(this._element,this._startStyles,this._initialStyles),this._state=1)}finish(){this.start(),this._state<2&&(Gc(this._element,this._initialStyles),this._endStyles&&(Gc(this._element,this._endStyles),this._endStyles=null),this._state=1)}destroy(){this.finish(),this._state<3&&(om.initialStylesByElement.delete(this._element),this._startStyles&&(Vf(this._element,this._startStyles),this._endStyles=null),this._endStyles&&(Vf(this._element,this._endStyles),this._endStyles=null),Gc(this._element,this._initialStyles),this._state=3)}}function IO(n){let e=null;const t=Object.keys(n);for(let i=0;ithis._handleCallback(l)}apply(){(function(n,e){const t=RO(n,"").trim();let i=0;t.length&&(function(n,e){let t=0;for(let i=0;i=this._delay&&i>=this._duration&&this.finish()}finish(){this._finished||(this._finished=!0,this._onDoneFn(),Vz(this._element,this._eventFn,!0))}destroy(){this._destroyed||(this._destroyed=!0,this.finish(),function(n,e){const i=RO(n,"").split(","),r=PO(i,e);r>=0&&(i.splice(r,1),XE(n,"",i.join(",")))}(this._element,this._name))}}function Lz(n,e,t){XE(n,"PlayState",t,Bz(n,e))}function Bz(n,e){const t=RO(n,"");return t.indexOf(",")>0?PO(t.split(","),e):PO([t],e)}function PO(n,e){for(let t=0;t=0)return t;return-1}function Vz(n,e,t){t?n.removeEventListener(Nz,e):n.addEventListener(Nz,e)}function XE(n,e,t,i){const r=Fz+e;if(null!=i){const s=n.style[r];if(s.length){const o=s.split(",");o[i]=t,t=o.join(",")}}n.style[r]=t}function RO(n,e){return n.style[Fz+e]||""}class zz{constructor(e,t,i,r,s,o,a,l){this.element=e,this.keyframes=t,this.animationName=i,this._duration=r,this._delay=s,this._finalStyles=a,this._specialStyles=l,this._onDoneFns=[],this._onStartFns=[],this._onDestroyFns=[],this.currentSnapshot={},this._state=0,this.easing=o||"linear",this.totalTime=r+s,this._buildStyler()}onStart(e){this._onStartFns.push(e)}onDone(e){this._onDoneFns.push(e)}onDestroy(e){this._onDestroyFns.push(e)}destroy(){this.init(),!(this._state>=4)&&(this._state=4,this._styler.destroy(),this._flushStartFns(),this._flushDoneFns(),this._specialStyles&&this._specialStyles.destroy(),this._onDestroyFns.forEach(e=>e()),this._onDestroyFns=[])}_flushDoneFns(){this._onDoneFns.forEach(e=>e()),this._onDoneFns=[]}_flushStartFns(){this._onStartFns.forEach(e=>e()),this._onStartFns=[]}finish(){this.init(),!(this._state>=3)&&(this._state=3,this._styler.finish(),this._flushStartFns(),this._specialStyles&&this._specialStyles.finish(),this._flushDoneFns())}setPosition(e){this._styler.setPosition(e)}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 jre(this.element,this.animationName,this._duration,this._delay,this.easing,"forwards",()=>this.finish())}triggerCallback(e){const t="start"==e?this._onStartFns:this._onDoneFns;t.forEach(i=>i()),t.length=0}beforeDestroy(){this.init();const e={};if(this.hasStarted()){const t=this._state>=3;Object.keys(this._finalStyles).forEach(i=>{"offset"!=i&&(e[i]=t?this._finalStyles[i]:bO(this.element,i))})}this.currentSnapshot=e}}class qre extends im{constructor(e,t){super(),this.element=e,this._startingStyles={},this.__initialized=!1,this._styles=lz(t)}init(){this.__initialized||!this._startingStyles||(this.__initialized=!0,Object.keys(this._styles).forEach(e=>{this._startingStyles[e]=this.element.style[e]}),super.init())}play(){!this._startingStyles||(this.init(),Object.keys(this._styles).forEach(e=>this.element.style.setProperty(e,this._styles[e])),super.play())}destroy(){!this._startingStyles||(Object.keys(this._startingStyles).forEach(e=>{const t=this._startingStyles[e];t?this.element.style.setProperty(e,t):this.element.style.removeProperty(e)}),this._startingStyles=null,super.destroy())}}class Uz{constructor(){this._count=0}validateStyleProperty(e){return dO(e)}matchesElement(e,t){return hO(e,t)}containsElement(e,t){return fO(e,t)}query(e,t,i){return pO(e,t,i)}computeStyle(e,t,i){return window.getComputedStyle(e)[t]}buildKeyframeElement(e,t,i){i=i.map(a=>lz(a));let r=`@keyframes ${t} {\n`,s="";i.forEach(a=>{s=" ";const l=parseFloat(a.offset);r+=`${s}${100*l}% {\n`,s+=" ",Object.keys(a).forEach(c=>{const d=a[c];switch(c){case"offset":return;case"easing":return void(d&&(r+=`${s}animation-timing-function: ${d};\n`));default:return void(r+=`${s}${c}: ${d};\n`)}}),r+=`${s}}\n`}),r+="}\n";const o=document.createElement("style");return o.textContent=r,o}animate(e,t,i,r,s,o=[],a){const l=o.filter(v=>v instanceof zz),c={};mz(i,r)&&l.forEach(v=>{let C=v.currentSnapshot;Object.keys(C).forEach(w=>c[w]=C[w])});const d=function(n){let e={};return n&&(Array.isArray(n)?n:[n]).forEach(i=>{Object.keys(i).forEach(r=>{"offset"==r||"easing"==r||(e[r]=i[r])})}),e}(t=_z(e,t,c));if(0==i)return new qre(e,d);const f="gen_css_kf_"+this._count++,p=this.buildKeyframeElement(e,f,t);(function(n){var e;const t=null===(e=n.getRootNode)||void 0===e?void 0:e.call(n);return"undefined"!=typeof ShadowRoot&&t instanceof ShadowRoot?t:document.head})(e).appendChild(p);const _=kz(e,t),y=new zz(e,t,f,i,r,s,d,_);return y.onDestroy(()=>function(n){n.parentNode.removeChild(n)}(p)),y}}class $z{constructor(e,t,i,r){this.element=e,this.keyframes=t,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}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(e=>e()),this._onDoneFns=[])}init(){this._buildPlayer(),this._preparePlayerBeforeStart()}_buildPlayer(){if(this._initialized)return;this._initialized=!0;const e=this.keyframes;this.domPlayer=this._triggerWebAnimation(this.element,e,this.options),this._finalKeyframe=e.length?e[e.length-1]:{},this.domPlayer.addEventListener("finish",()=>this._onFinish())}_preparePlayerBeforeStart(){this._delay?this._resetDomPlayerState():this.domPlayer.pause()}_triggerWebAnimation(e,t,i){return e.animate(t,i)}onStart(e){this._onStartFns.push(e)}onDone(e){this._onDoneFns.push(e)}onDestroy(e){this._onDestroyFns.push(e)}play(){this._buildPlayer(),this.hasStarted()||(this._onStartFns.forEach(e=>e()),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(e=>e()),this._onDestroyFns=[])}setPosition(e){void 0===this.domPlayer&&this.init(),this.domPlayer.currentTime=e*this.time}getPosition(){return this.domPlayer.currentTime/this.time}get totalTime(){return this._delay+this._duration}beforeDestroy(){const e={};this.hasStarted()&&Object.keys(this._finalKeyframe).forEach(t=>{"offset"!=t&&(e[t]=this._finished?this._finalKeyframe[t]:bO(this.element,t))}),this.currentSnapshot=e}triggerCallback(e){const t="start"==e?this._onStartFns:this._onDoneFns;t.forEach(i=>i()),t.length=0}}class Qre{constructor(){this._isNativeImpl=/\{\s*\[native\s+code\]\s*\}/.test(Gz().toString()),this._cssKeyframesDriver=new Uz}validateStyleProperty(e){return dO(e)}matchesElement(e,t){return hO(e,t)}containsElement(e,t){return fO(e,t)}query(e,t,i){return pO(e,t,i)}computeStyle(e,t,i){return window.getComputedStyle(e)[t]}overrideWebAnimationsSupport(e){this._isNativeImpl=e}animate(e,t,i,r,s,o=[],a){if(!a&&!this._isNativeImpl)return this._cssKeyframesDriver.animate(e,t,i,r,s,o);const d={duration:i,delay:r,fill:0==r?"both":"forwards"};s&&(d.easing=s);const f={},p=o.filter(_=>_ instanceof $z);mz(i,r)&&p.forEach(_=>{let y=_.currentSnapshot;Object.keys(y).forEach(v=>f[v]=y[v])});const g=kz(e,t=_z(e,t=t.map(_=>sh(_,!1)),f));return new $z(e,t,d,g)}}function Gz(){return nz()&&Element.prototype.animate||{}}let ese=(()=>{class n extends QV{constructor(t,i){super(),this._nextAnimationId=0,this._renderer=t.createRenderer(i.body,{id:"0",encapsulation:Ue.None,styles:[],data:{animation:[]}})}build(t){const i=this._nextAnimationId.toString();this._nextAnimationId++;const r=Array.isArray(t)?JV(t):t;return Wz(this._renderer,null,i,"register",[r]),new tse(i,this._renderer)}}return n.\u0275fac=function(t){return new(t||n)(I(Cf),I(ut))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();class tse extends class{}{constructor(e,t){super(),this._id=e,this._renderer=t}create(e,t){return new nse(this._id,e,t||{},this._renderer)}}class nse{constructor(e,t,i,r){this.id=e,this.element=t,this._renderer=r,this.parentPlayer=null,this._started=!1,this.totalTime=0,this._command("create",i)}_listen(e,t){return this._renderer.listen(this.element,`@@${this.id}:${e}`,t)}_command(e,...t){return Wz(this._renderer,this.element,this.id,e,t)}onDone(e){this._listen("done",e)}onStart(e){this._listen("start",e)}onDestroy(e){this._listen("destroy",e)}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(e){this._command("setPosition",e)}getPosition(){var e,t;return null!==(t=null===(e=this._renderer.engine.players[+this.id])||void 0===e?void 0:e.getPosition())&&void 0!==t?t:0}}function Wz(n,e,t,i,r){return n.setProperty(e,`@@${t}:${i}`,r)}const qz="@.disabled";let ise=(()=>{class n{constructor(t,i,r){this.delegate=t,this.engine=i,this._zone=r,this._currentId=0,this._microtaskId=1,this._animationCallbacksBuffer=[],this._rendererCache=new Map,this._cdRecurDepth=0,this.promise=Promise.resolve(0),i.onRemovalComplete=(s,o)=>{o&&o.parentNode(s)&&o.removeChild(s.parentNode,s)}}createRenderer(t,i){const s=this.delegate.createRenderer(t,i);if(!(t&&i&&i.data&&i.data.animation)){let d=this._rendererCache.get(s);return d||(d=new Yz("",s,this.engine),this._rendererCache.set(s,d)),d}const o=i.id,a=i.id+"-"+this._currentId;this._currentId++,this.engine.register(a,t);const l=d=>{Array.isArray(d)?d.forEach(l):this.engine.registerTrigger(o,a,t,d.name,d)};return i.data.animation.forEach(l),new rse(this,a,s,this.engine)}begin(){this._cdRecurDepth++,this.delegate.begin&&this.delegate.begin()}_scheduleCountTask(){this.promise.then(()=>{this._microtaskId++})}scheduleListenerCallback(t,i,r){t>=0&&ti(r)):(0==this._animationCallbacksBuffer.length&&Promise.resolve(null).then(()=>{this._zone.run(()=>{this._animationCallbacksBuffer.forEach(s=>{const[o,a]=s;o(a)}),this._animationCallbacksBuffer=[]})}),this._animationCallbacksBuffer.push([i,r]))}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 n.\u0275fac=function(t){return new(t||n)(I(Cf),I(YE),I(dt))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();class Yz{constructor(e,t,i){this.namespaceId=e,this.delegate=t,this.engine=i,this.destroyNode=this.delegate.destroyNode?r=>t.destroyNode(r):null}get data(){return this.delegate.data}destroy(){this.engine.destroy(this.namespaceId,this.delegate),this.delegate.destroy()}createElement(e,t){return this.delegate.createElement(e,t)}createComment(e){return this.delegate.createComment(e)}createText(e){return this.delegate.createText(e)}appendChild(e,t){this.delegate.appendChild(e,t),this.engine.onInsert(this.namespaceId,t,e,!1)}insertBefore(e,t,i,r=!0){this.delegate.insertBefore(e,t,i),this.engine.onInsert(this.namespaceId,t,e,r)}removeChild(e,t,i){this.engine.onRemove(this.namespaceId,t,this.delegate,i)}selectRootElement(e,t){return this.delegate.selectRootElement(e,t)}parentNode(e){return this.delegate.parentNode(e)}nextSibling(e){return this.delegate.nextSibling(e)}setAttribute(e,t,i,r){this.delegate.setAttribute(e,t,i,r)}removeAttribute(e,t,i){this.delegate.removeAttribute(e,t,i)}addClass(e,t){this.delegate.addClass(e,t)}removeClass(e,t){this.delegate.removeClass(e,t)}setStyle(e,t,i,r){this.delegate.setStyle(e,t,i,r)}removeStyle(e,t,i){this.delegate.removeStyle(e,t,i)}setProperty(e,t,i){"@"==t.charAt(0)&&t==qz?this.disableAnimations(e,!!i):this.delegate.setProperty(e,t,i)}setValue(e,t){this.delegate.setValue(e,t)}listen(e,t,i){return this.delegate.listen(e,t,i)}disableAnimations(e,t){this.engine.disableAnimations(e,t)}}class rse extends Yz{constructor(e,t,i,r){super(t,i,r),this.factory=e,this.namespaceId=t}setProperty(e,t,i){"@"==t.charAt(0)?"."==t.charAt(1)&&t==qz?this.disableAnimations(e,i=void 0===i||!!i):this.engine.process(this.namespaceId,e,t.substr(1),i):this.delegate.setProperty(e,t,i)}listen(e,t,i){if("@"==t.charAt(0)){const r=function(n){switch(n){case"body":return document.body;case"document":return document;case"window":return window;default:return n}}(e);let s=t.substr(1),o="";return"@"!=s.charAt(0)&&([s,o]=function(n){const e=n.indexOf(".");return[n.substring(0,e),n.substr(e+1)]}(s)),this.engine.listen(this.namespaceId,r,s,o,a=>{this.factory.scheduleListenerCallback(a._data||-1,i,a)})}return this.delegate.listen(e,t,i)}}let ase=(()=>{class n extends YE{constructor(t,i,r){super(t.body,i,r)}ngOnDestroy(){this.flush()}}return n.\u0275fac=function(t){return new(t||n)(I(ut),I(PE),I(xO))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();const Do=new ve("AnimationModuleType"),Xz=[{provide:QV,useClass:ese},{provide:xO,useFactory:function(){return new gre}},{provide:YE,useClass:ase},{provide:Cf,useFactory:function(n,e,t){return new ise(n,e,t)},deps:[_E,YE,dt]}],Kz=[{provide:PE,useFactory:function(){return"function"==typeof Gz()?new Qre:new Uz}},{provide:Do,useValue:"BrowserAnimations"},...Xz],Zz=[{provide:PE,useClass:cz},{provide:Do,useValue:"NoopAnimations"},...Xz];let kO=(()=>{class n{static withConfig(t){return{ngModule:n,providers:t.disableAnimations?Zz:Kz}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({providers:Kz,imports:[yE]}),n})();function fse(n,e){if(1&n&&tt(0,"mat-pseudo-checkbox",4),2&n){const t=Qe();ie("state",t.selected?"checked":"unchecked")("disabled",t.disabled)}}function pse(n,e){if(1&n&&(R(0,"span",5),De(1),k()),2&n){const t=Qe();G(1),or("(",t.group.label,")")}}const gse=["*"],Qz=new ju("12.2.5"),_se=new ve("mat-sanity-checks",{providedIn:"root",factory:function(){return!0}});let $f,On=(()=>{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!(!Mo()||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")&&Qz.full!==ZV.full&&console.warn("The Angular Material version ("+Qz.full+") does not match the Angular CDK version ("+ZV.full+").\nPlease ensure the versions of these two packages exactly match.")}}return n.\u0275fac=function(t){return new(t||n)(I(XV),I(_se,8),I(ut))},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[Nv],Nv]}),n})();function jf(n){return class extends n{constructor(...e){super(...e),this._disabled=!1}get disabled(){return this._disabled}set disabled(e){this._disabled=Mt(e)}}}function Uf(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 nc(n){return class extends n{constructor(...e){super(...e),this._disableRipple=!1}get disableRipple(){return this._disableRipple}set disableRipple(e){this._disableRipple=Mt(e)}}}function Hf(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?To(t):this.defaultTabIndex}}}function FO(n){return class extends n{constructor(...e){super(...e),this.stateChanges=new Se,this.errorState=!1}updateErrorState(){const e=this.errorState,s=(this.errorStateMatcher||this._defaultErrorStateMatcher).isErrorState(this.ngControl?this.ngControl.control:null,this._parentFormGroup||this._parentForm);s!==e&&(this.errorState=s,this.stateChanges.next())}}}try{$f="undefined"!=typeof Intl}catch(n){$f=!1}let Vv=(()=>{class n{isErrorState(t,i){return!!(t&&t.invalid&&(t.touched||i&&i.submitted))}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ue({factory:function(){return new n},token:n,providedIn:"root"}),n})();class Dse{constructor(e,t,i){this._renderer=e,this.element=t,this.config=i,this.state=3}fadeOut(){this._renderer.fadeOutRipple(this)}}const ij={enterDuration:225,exitDuration:150},NO=tm({passive:!0}),rj=["mousedown","touchstart"],sj=["mouseup","mouseleave","touchend","touchcancel"];class oj{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=Wu(i))}fadeInRipple(e,t,i={}){const r=this._containerRect=this._containerRect||this._containerElement.getBoundingClientRect(),s=Object.assign(Object.assign({},ij),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 Dse(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({},ij),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=Wu(e);!t||t===this._triggerElement||(this._removeTriggerEvents(),this._triggerElement=t,this._registerEvents(rj))}handleEvent(e){"mousedown"===e.type?this._onMousedown(e):"touchstart"===e.type?this._onTouchStart(e):this._onPointerUp(),this._pointerUpEventsRegistered||(this._registerEvents(sj),this._pointerUpEventsRegistered=!0)}_onMousedown(e){const t=VV(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,NO)})})}_removeTriggerEvents(){this._triggerElement&&(rj.forEach(e=>{this._triggerElement.removeEventListener(e,this,NO)}),this._pointerUpEventsRegistered&&sj.forEach(e=>{this._triggerElement.removeEventListener(e,this,NO)}))}}const aj=new ve("mat-ripple-global-options");let Js=(()=>{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 oj(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)(E(rt),E(dt),E(si),E(aj,8),E(Do,8))},n.\u0275dir=oe({type:n,selectors:[["","mat-ripple",""],["","matRipple",""]],hostAttrs:[1,"mat-ripple"],hostVars:2,hostBindings:function(t,i){2&t&&st("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})(),_l=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[On,Rv],On]}),n})(),lj=(()=>{class n{constructor(t){this._animationMode=t,this.state="unchecked",this.disabled=!1}}return n.\u0275fac=function(t){return new(t||n)(E(Do,8))},n.\u0275cmp=Ne({type:n,selectors:[["mat-pseudo-checkbox"]],hostAttrs:[1,"mat-pseudo-checkbox"],hostVars:8,hostBindings:function(t,i){2&t&&st("mat-pseudo-checkbox-indeterminate","indeterminate"===i.state)("mat-pseudo-checkbox-checked","checked"===i.state)("mat-pseudo-checkbox-disabled",i.disabled)("_mat-animation-noopable","NoopAnimations"===i._animationMode)},inputs:{state:"state",disabled:"disabled"},decls:0,vars:0,template:function(t,i){},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}),n})(),LO=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[On]]}),n})();const QE=new ve("MAT_OPTION_PARENT_COMPONENT"),Rse=jf(class{});let kse=0,cj=(()=>{class n extends Rse{constructor(t){var i;super(),this._labelId="mat-optgroup-label-"+kse++,this._inert=null!==(i=null==t?void 0:t.inertGroups)&&void 0!==i&&i}}return n.\u0275fac=function(t){return new(t||n)(E(QE,8))},n.\u0275dir=oe({type:n,inputs:{label:"label"},features:[ct]}),n})();const JE=new ve("MatOptgroup");let Fse=0;class uj{constructor(e,t=!1){this.source=e,this.isUserInput=t}}let Nse=(()=>{class n{constructor(t,i,r,s){this._element=t,this._changeDetectorRef=i,this._parent=r,this.group=s,this._selected=!1,this._active=!1,this._disabled=!1,this._mostRecentViewValue="",this.id="mat-option-"+Fse++,this.onSelectionChange=new Le,this._stateChanges=new Se}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=Mt(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,i){const r=this._getHostElement();"function"==typeof r.focus&&r.focus(i)}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)&&!Zs(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 uj(this,t))}}return n.\u0275fac=function(t){return new(t||n)(E(rt),E(kn),E(void 0),E(cj))},n.\u0275dir=oe({type:n,inputs:{id:"id",disabled:"disabled",value:"value"},outputs:{onSelectionChange:"onSelectionChange"}}),n})(),eS=(()=>{class n extends Nse{constructor(t,i,r,s){super(t,i,r,s)}}return n.\u0275fac=function(t){return new(t||n)(E(rt),E(kn),E(QE,8),E(JE,8))},n.\u0275cmp=Ne({type:n,selectors:[["mat-option"]],hostAttrs:["role","option",1,"mat-option","mat-focus-indicator"],hostVars:12,hostBindings:function(t,i){1&t&&ge("click",function(){return i._selectViaInteraction()})("keydown",function(s){return i._handleKeydown(s)}),2&t&&(al("id",i.id),nn("tabindex",i._getTabIndex())("aria-selected",i._getAriaSelected())("aria-disabled",i.disabled.toString()),st("mat-selected",i.selected)("mat-option-multiple",i.multiple)("mat-active",i.active)("mat-option-disabled",i.disabled))},exportAs:["matOption"],features:[ct],ngContentSelectors:gse,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,i){1&t&&(wi(),mt(0,fse,1,2,"mat-pseudo-checkbox",0),R(1,"span",1),Ht(2),k(),mt(3,pse,2,1,"span",2),tt(4,"div",3)),2&t&&(ie("ngIf",i.multiple),G(3),ie("ngIf",i.group&&i.group._inert),G(1),ie("matRippleTrigger",i._getHostElement())("matRippleDisabled",i.disabled||i.disableRipple))},directives:[zr,Js,lj],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}),n})();function BO(n,e,t){if(t.length){let i=e.toArray(),r=t.toArray(),s=0;for(let o=0;o{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[_l,dn,On,LO]]}),n})();function Wc(n,e,t,i){return Ke(t)&&(i=t,t=void 0),i?Wc(n,e,t).pipe(Ae(r=>we(r)?i(...r):i(r))):new ce(r=>{hj(n,e,function(o){r.next(arguments.length>1?Array.prototype.slice.call(arguments):o)},r,t)})}function hj(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 enter",[ti({opacity:0,transform:"translateY(-5px)"}),Ao("300ms cubic-bezier(0.55, 0, 0.55, 0.2)")])])};let jv=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275dir=oe({type:n}),n})();const pj=new ve("MatHint");let Gf=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275dir=oe({type:n,selectors:[["mat-label"]]}),n})(),ooe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275dir=oe({type:n,selectors:[["mat-placeholder"]]}),n})();const gj=new ve("MatPrefix"),mj=new ve("MatSuffix");let VO=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275dir=oe({type:n,selectors:[["","matSuffix",""]],features:[Dt([{provide:mj,useExisting:n}])]}),n})(),_j=0;const coe=Uf(class{constructor(n){this._elementRef=n}},"primary"),vj=new ve("MAT_FORM_FIELD_DEFAULT_OPTIONS"),nS=new ve("MatFormField");let am=(()=>{class n extends coe{constructor(t,i,r,s,o,a,l,c){super(t),this._changeDetectorRef=i,this._dir=s,this._defaults=o,this._platform=a,this._ngZone=l,this._outlineGapCalculationNeededImmediately=!1,this._outlineGapCalculationNeededOnStable=!1,this._destroyed=new Se,this._showAlwaysAnimate=!1,this._subscriptAnimationState="",this._hintLabel="",this._hintLabelId="mat-hint-"+_j++,this._labelId="mat-form-field-label-"+_j++,this.floatLabel=this._getDefaultFloatLabelState(),this._animationsEnabled="NoopAnimations"!==c,this.appearance=o&&o.appearance?o.appearance:"legacy",this._hideRequiredMarker=!(!o||null==o.hideRequiredMarker)&&o.hideRequiredMarker}get appearance(){return this._appearance}set appearance(t){const i=this._appearance;this._appearance=t||this._defaults&&this._defaults.appearance||"legacy","outline"===this._appearance&&i!==t&&(this._outlineGapCalculationNeededOnStable=!0)}get hideRequiredMarker(){return this._hideRequiredMarker}set hideRequiredMarker(t){this._hideRequiredMarker=Mt(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(Rr(null)).subscribe(()=>{this._validatePlaceholders(),this._syncDescribedByIds(),this._changeDetectorRef.markForCheck()}),t.ngControl&&t.ngControl.valueChanges&&t.ngControl.valueChanges.pipe(Tn(this._destroyed)).subscribe(()=>this._changeDetectorRef.markForCheck()),this._ngZone.runOutsideAngular(()=>{this._ngZone.onStable.pipe(Tn(this._destroyed)).subscribe(()=>{this._outlineGapCalculationNeededOnStable&&this.updateOutlineGap()})}),Ni(this._prefixChildren.changes,this._suffixChildren.changes).subscribe(()=>{this._outlineGapCalculationNeededOnStable=!0,this._changeDetectorRef.markForCheck()}),this._hintChildren.changes.pipe(Rr(null)).subscribe(()=>{this._processHints(),this._changeDetectorRef.markForCheck()}),this._errorChildren.changes.pipe(Rr(null)).subscribe(()=>{this._syncDescribedByIds(),this._changeDetectorRef.markForCheck()}),this._dir&&this._dir.change.pipe(Tn(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 i=this._control?this._control.ngControl:null;return i&&i[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,Wc(this._label.nativeElement,"transitionend").pipe(yi(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 i=this._hintChildren?this._hintChildren.find(s=>"start"===s.align):null,r=this._hintChildren?this._hintChildren.find(s=>"end"===s.align):null;i?t.push(i.id):this._hintLabel&&t.push(this._hintLabelId),r&&t.push(r.id)}else this._errorChildren&&t.push(...this._errorChildren.map(i=>i.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 i=0,r=0;const s=this._connectionContainerRef.nativeElement,o=s.querySelectorAll(".mat-form-field-outline-start"),a=s.querySelectorAll(".mat-form-field-outline-gap");if(this._label&&this._label.nativeElement.children.length){const l=s.getBoundingClientRect();if(0===l.width&&0===l.height)return this._outlineGapCalculationNeededOnStable=!0,void(this._outlineGapCalculationNeededImmediately=!1);const c=this._getStartEnd(l),d=t.children,f=this._getStartEnd(d[0].getBoundingClientRect());let p=0;for(let g=0;g0?.75*p+10:0}for(let l=0;l{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,On,SE],On]}),n})();function Hv(...n){if(1===n.length){const e=n[0];if(we(e))return iS(e,null);if(_e(e)&&Object.getPrototypeOf(e)===Object.prototype){const t=Object.keys(e);return iS(t.map(i=>e[i]),t)}}if("function"==typeof n[n.length-1]){const e=n.pop();return iS(n=1===n.length&&we(n[0])?n[0]:n,null).pipe(Ae(t=>e(...t)))}return iS(n,null)}function iS(n,e){return new ce(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 Ta(n){return function(t){const i=new uoe(n),r=t.lift(i);return i.caught=r}}class uoe{constructor(e){this.selector=e}call(e,t){return t.subscribe(new doe(e,this.selector,this.caught))}}class doe extends ii{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 Gr(this);this.add(i);const r=co(t,i);r!==i&&this.add(r)}}}class hoe{constructor(e){this.callback=e}call(e,t){return t.subscribe(new foe(e,this.callback))}}class foe extends xt{constructor(e,t){super(e),this.add(new Te(t))}}class Cj{}class wj{}class Yu{constructor(e){this.normalizedNames=new Map,this.lazyUpdate=null,e?this.lazyInit="string"==typeof e?()=>{this.headers=new Map,e.split("\n").forEach(t=>{const i=t.indexOf(":");if(i>0){const r=t.slice(0,i),s=r.toLowerCase(),o=t.slice(i+1).trim();this.maybeSetNormalizedName(r,s),this.headers.has(s)?this.headers.get(s).push(o):this.headers.set(s,[o])}})}:()=>{this.headers=new Map,Object.keys(e).forEach(t=>{let i=e[t];const r=t.toLowerCase();"string"==typeof i&&(i=[i]),i.length>0&&(this.headers.set(r,i),this.maybeSetNormalizedName(t,r))})}:this.headers=new Map}has(e){return this.init(),this.headers.has(e.toLowerCase())}get(e){this.init();const t=this.headers.get(e.toLowerCase());return t&&t.length>0?t[0]:null}keys(){return this.init(),Array.from(this.normalizedNames.values())}getAll(e){return this.init(),this.headers.get(e.toLowerCase())||null}append(e,t){return this.clone({name:e,value:t,op:"a"})}set(e,t){return this.clone({name:e,value:t,op:"s"})}delete(e,t){return this.clone({name:e,value:t,op:"d"})}maybeSetNormalizedName(e,t){this.normalizedNames.has(t)||this.normalizedNames.set(t,e)}init(){this.lazyInit&&(this.lazyInit instanceof Yu?this.copyFrom(this.lazyInit):this.lazyInit(),this.lazyInit=null,this.lazyUpdate&&(this.lazyUpdate.forEach(e=>this.applyUpdate(e)),this.lazyUpdate=null))}copyFrom(e){e.init(),Array.from(e.headers.keys()).forEach(t=>{this.headers.set(t,e.headers.get(t)),this.normalizedNames.set(t,e.normalizedNames.get(t))})}clone(e){const t=new Yu;return t.lazyInit=this.lazyInit&&this.lazyInit instanceof Yu?this.lazyInit:this,t.lazyUpdate=(this.lazyUpdate||[]).concat([e]),t}applyUpdate(e){const t=e.name.toLowerCase();switch(e.op){case"a":case"s":let i=e.value;if("string"==typeof i&&(i=[i]),0===i.length)return;this.maybeSetNormalizedName(e.name,t);const r=("a"===e.op?this.headers.get(t):void 0)||[];r.push(...i),this.headers.set(t,r);break;case"d":const s=e.value;if(s){let o=this.headers.get(t);if(!o)return;o=o.filter(a=>-1===s.indexOf(a)),0===o.length?(this.headers.delete(t),this.normalizedNames.delete(t)):this.headers.set(t,o)}else this.headers.delete(t),this.normalizedNames.delete(t)}}forEach(e){this.init(),Array.from(this.normalizedNames.keys()).forEach(t=>e(this.normalizedNames.get(t),this.headers.get(t)))}}class poe{encodeKey(e){return Ej(e)}encodeValue(e){return Ej(e)}decodeKey(e){return decodeURIComponent(e)}decodeValue(e){return decodeURIComponent(e)}}const moe=/%(\d[a-f0-9])/gi,_oe={40:"@","3A":":",24:"$","2C":",","3B":";","2B":"+","3D":"=","3F":"?","2F":"/"};function Ej(n){return encodeURIComponent(n).replace(moe,(e,t)=>{var i;return null!==(i=_oe[t])&&void 0!==i?i:e})}function Sj(n){return`${n}`}class oh{constructor(e={}){if(this.updates=null,this.cloneFrom=null,this.encoder=e.encoder||new poe,e.fromString){if(e.fromObject)throw new Error("Cannot specify both fromString and fromObject.");this.map=function(n,e){const t=new Map;return n.length>0&&n.replace(/^\?/,"").split("&").forEach(r=>{const s=r.indexOf("="),[o,a]=-1==s?[e.decodeKey(r),""]:[e.decodeKey(r.slice(0,s)),e.decodeValue(r.slice(s+1))],l=t.get(o)||[];l.push(a),t.set(o,l)}),t}(e.fromString,this.encoder)}else e.fromObject?(this.map=new Map,Object.keys(e.fromObject).forEach(t=>{const i=e.fromObject[t];this.map.set(t,Array.isArray(i)?i:[i])})):this.map=null}has(e){return this.init(),this.map.has(e)}get(e){this.init();const t=this.map.get(e);return t?t[0]:null}getAll(e){return this.init(),this.map.get(e)||null}keys(){return this.init(),Array.from(this.map.keys())}append(e,t){return this.clone({param:e,value:t,op:"a"})}appendAll(e){const t=[];return Object.keys(e).forEach(i=>{const r=e[i];Array.isArray(r)?r.forEach(s=>{t.push({param:i,value:s,op:"a"})}):t.push({param:i,value:r,op:"a"})}),this.clone(t)}set(e,t){return this.clone({param:e,value:t,op:"s"})}delete(e,t){return this.clone({param:e,value:t,op:"d"})}toString(){return this.init(),this.keys().map(e=>{const t=this.encoder.encodeKey(e);return this.map.get(e).map(i=>t+"="+this.encoder.encodeValue(i)).join("&")}).filter(e=>""!==e).join("&")}clone(e){const t=new oh({encoder:this.encoder});return t.cloneFrom=this.cloneFrom||this,t.updates=(this.updates||[]).concat(e),t}init(){null===this.map&&(this.map=new Map),null!==this.cloneFrom&&(this.cloneFrom.init(),this.cloneFrom.keys().forEach(e=>this.map.set(e,this.cloneFrom.map.get(e))),this.updates.forEach(e=>{switch(e.op){case"a":case"s":const t=("a"===e.op?this.map.get(e.param):void 0)||[];t.push(Sj(e.value)),this.map.set(e.param,t);break;case"d":if(void 0===e.value){this.map.delete(e.param);break}{let i=this.map.get(e.param)||[];const r=i.indexOf(Sj(e.value));-1!==r&&i.splice(r,1),i.length>0?this.map.set(e.param,i):this.map.delete(e.param)}}}),this.cloneFrom=this.updates=null)}}class yoe{constructor(){this.map=new Map}set(e,t){return this.map.set(e,t),this}get(e){return this.map.has(e)||this.map.set(e,e.defaultValue()),this.map.get(e)}delete(e){return this.map.delete(e),this}keys(){return this.map.keys()}}function Mj(n){return"undefined"!=typeof ArrayBuffer&&n instanceof ArrayBuffer}function xj(n){return"undefined"!=typeof Blob&&n instanceof Blob}function Tj(n){return"undefined"!=typeof FormData&&n instanceof FormData}class $v{constructor(e,t,i,r){let s;if(this.url=t,this.body=null,this.reportProgress=!1,this.withCredentials=!1,this.responseType="json",this.method=e.toUpperCase(),function(n){switch(n){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,s=r):s=i,s&&(this.reportProgress=!!s.reportProgress,this.withCredentials=!!s.withCredentials,s.responseType&&(this.responseType=s.responseType),s.headers&&(this.headers=s.headers),s.context&&(this.context=s.context),s.params&&(this.params=s.params)),this.headers||(this.headers=new Yu),this.context||(this.context=new yoe),this.params){const o=this.params.toString();if(0===o.length)this.urlWithParams=t;else{const a=t.indexOf("?");this.urlWithParams=t+(-1===a?"?":ap.set(g,e.setHeaders[g]),c)),e.setParams&&(d=Object.keys(e.setParams).reduce((p,g)=>p.set(g,e.setParams[g]),d)),new $v(i,r,o,{params:d,headers:c,context:f,reportProgress:l,responseType:s,withCredentials:a})}}var Ur=(()=>((Ur=Ur||{})[Ur.Sent=0]="Sent",Ur[Ur.UploadProgress=1]="UploadProgress",Ur[Ur.ResponseHeader=2]="ResponseHeader",Ur[Ur.DownloadProgress=3]="DownloadProgress",Ur[Ur.Response=4]="Response",Ur[Ur.User=5]="User",Ur))();class zO{constructor(e,t=200,i="OK"){this.headers=e.headers||new Yu,this.status=void 0!==e.status?e.status:t,this.statusText=e.statusText||i,this.url=e.url||null,this.ok=this.status>=200&&this.status<300}}class jO extends zO{constructor(e={}){super(e),this.type=Ur.ResponseHeader}clone(e={}){return new jO({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})}}class rS extends zO{constructor(e={}){super(e),this.type=Ur.Response,this.body=void 0!==e.body?e.body:null}clone(e={}){return new rS({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})}}class Aj extends zO{constructor(e){super(e,0,"Unknown Error"),this.name="HttpErrorResponse",this.ok=!1,this.message=this.status>=200&&this.status<300?`Http failure during parsing for ${e.url||"(unknown url)"}`:`Http failure response for ${e.url||"(unknown url)"}: ${e.status} ${e.statusText}`,this.error=e.error||null}}function UO(n,e){return{body:e,headers:n.headers,context:n.context,observe:n.observe,params:n.params,reportProgress:n.reportProgress,responseType:n.responseType,withCredentials:n.withCredentials}}let Wf=(()=>{class n{constructor(t){this.handler=t}request(t,i,r={}){let s;if(t instanceof $v)s=t;else{let l,c;l=r.headers instanceof Yu?r.headers:new Yu(r.headers),r.params&&(c=r.params instanceof oh?r.params:new oh({fromObject:r.params})),s=new $v(t,i,void 0!==r.body?r.body:null,{headers:l,context:r.context,params:c,reportProgress:r.reportProgress,responseType:r.responseType||"json",withCredentials:r.withCredentials})}const o=ht(s).pipe(function(n,e){return di(n,e,1)}(l=>this.handler.handle(l)));if(t instanceof $v||"events"===r.observe)return o;const a=o.pipe(Fn(l=>l instanceof rS));switch(r.observe||"body"){case"body":switch(s.responseType){case"arraybuffer":return a.pipe(Ae(l=>{if(null!==l.body&&!(l.body instanceof ArrayBuffer))throw new Error("Response is not an ArrayBuffer.");return l.body}));case"blob":return a.pipe(Ae(l=>{if(null!==l.body&&!(l.body instanceof Blob))throw new Error("Response is not a Blob.");return l.body}));case"text":return a.pipe(Ae(l=>{if(null!==l.body&&"string"!=typeof l.body)throw new Error("Response is not a string.");return l.body}));case"json":default:return a.pipe(Ae(l=>l.body))}case"response":return a;default:throw new Error(`Unreachable: unhandled observe type ${r.observe}}`)}}delete(t,i={}){return this.request("DELETE",t,i)}get(t,i={}){return this.request("GET",t,i)}head(t,i={}){return this.request("HEAD",t,i)}jsonp(t,i){return this.request("JSONP",t,{params:(new oh).append(i,"JSONP_CALLBACK"),observe:"body",responseType:"json"})}options(t,i={}){return this.request("OPTIONS",t,i)}patch(t,i,r={}){return this.request("PATCH",t,UO(r,i))}post(t,i,r={}){return this.request("POST",t,UO(r,i))}put(t,i,r={}){return this.request("PUT",t,UO(r,i))}}return n.\u0275fac=function(t){return new(t||n)(I(Cj))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();class Dj{constructor(e,t){this.next=e,this.interceptor=t}handle(e){return this.interceptor.intercept(e,this.next)}}const Oj=new ve("HTTP_INTERCEPTORS");let Coe=(()=>{class n{intercept(t,i){return i.handle(t)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();const woe=/^\)\]\}',?\n/;let Ij=(()=>{class n{constructor(t){this.xhrFactory=t}handle(t){if("JSONP"===t.method)throw new Error("Attempted to construct Jsonp request without HttpClientJsonpModule installed.");return new ce(i=>{const r=this.xhrFactory.build();if(r.open(t.method,t.urlWithParams),t.withCredentials&&(r.withCredentials=!0),t.headers.forEach((g,_)=>r.setRequestHeader(g,_.join(","))),t.headers.has("Accept")||r.setRequestHeader("Accept","application/json, text/plain, */*"),!t.headers.has("Content-Type")){const g=t.detectContentTypeHeader();null!==g&&r.setRequestHeader("Content-Type",g)}if(t.responseType){const g=t.responseType.toLowerCase();r.responseType="json"!==g?g:"text"}const s=t.serializeBody();let o=null;const a=()=>{if(null!==o)return o;const g=1223===r.status?204:r.status,_=r.statusText||"OK",y=new Yu(r.getAllResponseHeaders()),v=function(n){return"responseURL"in n&&n.responseURL?n.responseURL:/^X-Request-URL:/m.test(n.getAllResponseHeaders())?n.getResponseHeader("X-Request-URL"):null}(r)||t.url;return o=new jO({headers:y,status:g,statusText:_,url:v}),o},l=()=>{let{headers:g,status:_,statusText:y,url:v}=a(),C=null;204!==_&&(C=void 0===r.response?r.responseText:r.response),0===_&&(_=C?200:0);let w=_>=200&&_<300;if("json"===t.responseType&&"string"==typeof C){const x=C;C=C.replace(woe,"");try{C=""!==C?JSON.parse(C):null}catch(N){C=x,w&&(w=!1,C={error:N,text:C})}}w?(i.next(new rS({body:C,headers:g,status:_,statusText:y,url:v||void 0})),i.complete()):i.error(new Aj({error:C,headers:g,status:_,statusText:y,url:v||void 0}))},c=g=>{const{url:_}=a(),y=new Aj({error:g,status:r.status||0,statusText:r.statusText||"Unknown Error",url:_||void 0});i.error(y)};let d=!1;const f=g=>{d||(i.next(a()),d=!0);let _={type:Ur.DownloadProgress,loaded:g.loaded};g.lengthComputable&&(_.total=g.total),"text"===t.responseType&&!!r.responseText&&(_.partialText=r.responseText),i.next(_)},p=g=>{let _={type:Ur.UploadProgress,loaded:g.loaded};g.lengthComputable&&(_.total=g.total),i.next(_)};return r.addEventListener("load",l),r.addEventListener("error",c),r.addEventListener("timeout",c),r.addEventListener("abort",c),t.reportProgress&&(r.addEventListener("progress",f),null!==s&&r.upload&&r.upload.addEventListener("progress",p)),r.send(s),i.next({type:Ur.Sent}),()=>{r.removeEventListener("error",c),r.removeEventListener("abort",c),r.removeEventListener("load",l),r.removeEventListener("timeout",c),t.reportProgress&&(r.removeEventListener("progress",f),null!==s&&r.upload&&r.upload.removeEventListener("progress",p)),r.readyState!==r.DONE&&r.abort()}})}}return n.\u0275fac=function(t){return new(t||n)(I(aV))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();const HO=new ve("XSRF_COOKIE_NAME"),$O=new ve("XSRF_HEADER_NAME");class Pj{}let Soe=(()=>{class n{constructor(t,i,r){this.doc=t,this.platform=i,this.cookieName=r,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=Y3(t,this.cookieName),this.lastCookieString=t),this.lastToken}}return n.\u0275fac=function(t){return new(t||n)(I(ut),I(dl),I(HO))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})(),GO=(()=>{class n{constructor(t,i){this.tokenService=t,this.headerName=i}intercept(t,i){const r=t.url.toLowerCase();if("GET"===t.method||"HEAD"===t.method||r.startsWith("http://")||r.startsWith("https://"))return i.handle(t);const s=this.tokenService.getToken();return null!==s&&!t.headers.has(this.headerName)&&(t=t.clone({headers:t.headers.set(this.headerName,s)})),i.handle(t)}}return n.\u0275fac=function(t){return new(t||n)(I(Pj),I($O))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})(),Moe=(()=>{class n{constructor(t,i){this.backend=t,this.injector=i,this.chain=null}handle(t){if(null===this.chain){const i=this.injector.get(Oj,[]);this.chain=i.reduceRight((r,s)=>new Dj(r,s),this.backend)}return this.chain.handle(t)}}return n.\u0275fac=function(t){return new(t||n)(I(wj),I(Nt))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})(),xoe=(()=>{class n{static disable(){return{ngModule:n,providers:[{provide:GO,useClass:Coe}]}}static withOptions(t={}){return{ngModule:n,providers:[t.cookieName?{provide:HO,useValue:t.cookieName}:[],t.headerName?{provide:$O,useValue:t.headerName}:[]]}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({providers:[GO,{provide:Oj,useExisting:GO,multi:!0},{provide:Pj,useClass:Soe},{provide:HO,useValue:"XSRF-TOKEN"},{provide:$O,useValue:"X-XSRF-TOKEN"}]}),n})(),Rj=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({providers:[Wf,{provide:Cj,useClass:Moe},Ij,{provide:wj,useExisting:Ij}],imports:[[xoe.withOptions({cookieName:"XSRF-TOKEN",headerName:"X-XSRF-TOKEN"})]]}),n})();const Toe=["*"];function kj(n){return Error(`Unable to find icon with the name "${n}"`)}function Fj(n){return Error(`The URL provided to MatIconRegistry was not trusted as a resource URL via Angular's DomSanitizer. Attempted URL was "${n}".`)}function Nj(n){return Error(`The literal provided to MatIconRegistry was not trusted as safe HTML by Angular's DomSanitizer. Attempted literal was "${n}".`)}class qf{constructor(e,t,i){this.url=e,this.svgText=t,this.options=i}}let Gv=(()=>{class n{constructor(t,i,r,s){this._httpClient=t,this._sanitizer=i,this._errorHandler=s,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=r}addSvgIcon(t,i,r){return this.addSvgIconInNamespace("",t,i,r)}addSvgIconLiteral(t,i,r){return this.addSvgIconLiteralInNamespace("",t,i,r)}addSvgIconInNamespace(t,i,r,s){return this._addSvgIconConfig(t,i,new qf(r,null,s))}addSvgIconResolver(t){return this._resolvers.push(t),this}addSvgIconLiteralInNamespace(t,i,r,s){const o=this._sanitizer.sanitize(mn.HTML,r);if(!o)throw Nj(r);return this._addSvgIconConfig(t,i,new qf("",o,s))}addSvgIconSet(t,i){return this.addSvgIconSetInNamespace("",t,i)}addSvgIconSetLiteral(t,i){return this.addSvgIconSetLiteralInNamespace("",t,i)}addSvgIconSetInNamespace(t,i,r){return this._addSvgIconSetConfig(t,new qf(i,null,r))}addSvgIconSetLiteralInNamespace(t,i,r){const s=this._sanitizer.sanitize(mn.HTML,i);if(!s)throw Nj(i);return this._addSvgIconSetConfig(t,new qf("",s,r))}registerFontClassAlias(t,i=t){return this._fontCssClassesByAlias.set(t,i),this}classNameForFontAlias(t){return this._fontCssClassesByAlias.get(t)||t}setDefaultFontSetClass(t){return this._defaultFontSetClass=t,this}getDefaultFontSetClass(){return this._defaultFontSetClass}getSvgIconFromUrl(t){const i=this._sanitizer.sanitize(mn.RESOURCE_URL,t);if(!i)throw Fj(t);const r=this._cachedIconsByUrl.get(i);return r?ht(sS(r)):this._loadSvgIconFromConfig(new qf(t,null)).pipe(Ti(s=>this._cachedIconsByUrl.set(i,s)),Ae(s=>sS(s)))}getNamedSvgIcon(t,i=""){const r=Lj(i,t);let s=this._svgIconConfigs.get(r);if(s)return this._getSvgFromConfig(s);if(s=this._getIconConfigFromResolvers(i,t),s)return this._svgIconConfigs.set(r,s),this._getSvgFromConfig(s);const o=this._iconSetConfigs.get(i);return o?this._getSvgFromIconSetConfigs(t,o):Kg(kj(r))}ngOnDestroy(){this._resolvers=[],this._svgIconConfigs.clear(),this._iconSetConfigs.clear(),this._cachedIconsByUrl.clear()}_getSvgFromConfig(t){return t.svgText?ht(sS(this._svgElementFromConfig(t))):this._loadSvgIconFromConfig(t).pipe(Ae(i=>sS(i)))}_getSvgFromIconSetConfigs(t,i){const r=this._extractIconWithNameFromAnySet(t,i);return r?ht(r):Hv(i.filter(o=>!o.svgText).map(o=>this._loadSvgIconSetFromConfig(o).pipe(Ta(a=>{const c=`Loading icon set URL: ${this._sanitizer.sanitize(mn.RESOURCE_URL,o.url)} failed: ${a.message}`;return this._errorHandler.handleError(new Error(c)),ht(null)})))).pipe(Ae(()=>{const o=this._extractIconWithNameFromAnySet(t,i);if(!o)throw kj(t);return o}))}_extractIconWithNameFromAnySet(t,i){for(let r=i.length-1;r>=0;r--){const s=i[r];if(s.svgText&&s.svgText.indexOf(t)>-1){const o=this._svgElementFromConfig(s),a=this._extractSvgIconFromSet(o,t,s.options);if(a)return a}}return null}_loadSvgIconFromConfig(t){return this._fetchIcon(t).pipe(Ti(i=>t.svgText=i),Ae(()=>this._svgElementFromConfig(t)))}_loadSvgIconSetFromConfig(t){return t.svgText?ht(null):this._fetchIcon(t).pipe(Ti(i=>t.svgText=i))}_extractSvgIconFromSet(t,i,r){const s=t.querySelector(`[id="${i}"]`);if(!s)return null;const o=s.cloneNode(!0);if(o.removeAttribute("id"),"svg"===o.nodeName.toLowerCase())return this._setSvgAttributes(o,r);if("symbol"===o.nodeName.toLowerCase())return this._setSvgAttributes(this._toSvgElement(o),r);const a=this._svgElementFromString("");return a.appendChild(o),this._setSvgAttributes(a,r)}_svgElementFromString(t){const i=this._document.createElement("DIV");i.innerHTML=t;const r=i.querySelector("svg");if(!r)throw Error(" tag not found");return r}_toSvgElement(t){const i=this._svgElementFromString(""),r=t.attributes;for(let s=0;se.lift(new hoe(n))}(()=>this._inProgressUrlFetches.delete(a)),Vs());return this._inProgressUrlFetches.set(a,c),c}_addSvgIconConfig(t,i,r){return this._svgIconConfigs.set(Lj(t,i),r),this}_addSvgIconSetConfig(t,i){const r=this._iconSetConfigs.get(t);return r?r.push(i):this._iconSetConfigs.set(t,[i]),this}_svgElementFromConfig(t){if(!t.svgElement){const i=this._svgElementFromString(t.svgText);this._setSvgAttributes(i,t.options),t.svgElement=i}return t.svgElement}_getIconConfigFromResolvers(t,i){for(let r=0;re?e.pathname+e.search:""}}}),Bj=["clip-path","color-profile","src","cursor","fill","filter","marker","marker-start","marker-mid","marker-end","mask","stroke"],Foe=Bj.map(n=>`[${n}]`).join(", "),Noe=/^url\(['"]?#(.*?)['"]?\)$/;let rs=(()=>{class n extends Ioe{constructor(t,i,r,s,o){super(t),this._iconRegistry=i,this._location=s,this._errorHandler=o,this._inline=!1,this._currentIconFetch=Te.EMPTY,r||t.nativeElement.setAttribute("aria-hidden","true")}get inline(){return this._inline}set inline(t){this._inline=Mt(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 i=this._cleanupFontValue(t);i!==this._fontSet&&(this._fontSet=i,this._updateFontIconClasses())}get fontIcon(){return this._fontIcon}set fontIcon(t){const i=this._cleanupFontValue(t);i!==this._fontIcon&&(this._fontIcon=i,this._updateFontIconClasses())}_splitIconName(t){if(!t)return["",""];const i=t.split(":");switch(i.length){case 1:return["",i[0]];case 2:return i;default:throw Error(`Invalid icon name: "${t}"`)}}ngOnInit(){this._updateFontIconClasses()}ngAfterViewChecked(){const t=this._elementsWithExternalReferences;if(t&&t.size){const i=this._location.getPathname();i!==this._previousPath&&(this._previousPath=i,this._prependPathToReferences(i))}}ngOnDestroy(){this._currentIconFetch.unsubscribe(),this._elementsWithExternalReferences&&this._elementsWithExternalReferences.clear()}_usingFontIcon(){return!this.svgIcon}_setSvgElement(t){this._clearSvgElement();const i=t.querySelectorAll("style");for(let s=0;s{r.forEach(o=>{s.setAttribute(o.name,`url('${t}#${o.value}')`)})})}_cacheChildrenWithExternalReferences(t){const i=t.querySelectorAll(Foe),r=this._elementsWithExternalReferences=this._elementsWithExternalReferences||new Map;for(let s=0;s{const a=i[s],l=a.getAttribute(o),c=l?l.match(Noe):null;if(c){let d=r.get(a);d||(d=[],r.set(a,d)),d.push({name:o,value:c[1]})}})}_updateSvgIcon(t){if(this._svgNamespace=null,this._svgName=null,this._currentIconFetch.unsubscribe(),t){const[i,r]=this._splitIconName(t);i&&(this._svgNamespace=i),r&&(this._svgName=r),this._currentIconFetch=this._iconRegistry.getNamedSvgIcon(r,i).pipe(yi(1)).subscribe(s=>this._setSvgElement(s),s=>{this._errorHandler.handleError(new Error(`Error retrieving icon ${i}:${r}! ${s.message}`))})}}}return n.\u0275fac=function(t){return new(t||n)(E(rt),E(Gv),Zr("aria-hidden"),E(Poe),E($o))},n.\u0275cmp=Ne({type:n,selectors:[["mat-icon"]],hostAttrs:["role","img",1,"mat-icon","notranslate"],hostVars:7,hostBindings:function(t,i){2&t&&(nn("data-mat-icon-type",i._usingFontIcon()?"font":"svg")("data-mat-icon-name",i._svgName||i.fontIcon)("data-mat-icon-namespace",i._svgNamespace||i.fontSet),st("mat-icon-inline",i.inline)("mat-icon-no-color","primary"!==i.color&&"accent"!==i.color&&"warn"!==i.color))},inputs:{color:"color",inline:"inline",svgIcon:"svgIcon",fontSet:"fontSet",fontIcon:"fontIcon"},exportAs:["matIcon"],features:[ct],ngContentSelectors:Toe,decls:1,vars:0,template:function(t,i){1&t&&(wi(),Ht(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}),n})(),lr=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[On],On]}),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=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 zoe=1;const joe=Promise.resolve(),oS={};function Vj(n){return n in oS&&(delete oS[n],!0)}const zj={setImmediate(n){const e=zoe++;return oS[e]=!0,joe.then(()=>Vj(e)&&n()),e},clearImmediate(n){Vj(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=zj.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&&(zj.clearImmediate(t),e.scheduled=void 0)}});function cm(n){return!!n&&(n instanceof ce||"function"==typeof n.lift&&"function"==typeof n.subscribe)}class Woe{constructor(e){this.durationSelector=e}call(e,t){return t.subscribe(new qoe(e,this.durationSelector))}}class qoe extends ii{constructor(e,t){super(e),this.durationSelector=t,this.hasValue=!1}_next(e){if(this.value=e,this.hasValue=!0,!this.throttled){let t;try{const{durationSelector:r}=this;t=r(e)}catch(r){return this.destination.error(r)}const i=co(t,new Gr(this));!i||i.closed?this.clearThrottle():this.add(this.throttled=i)}}clearThrottle(){const{value:e,hasValue:t,throttled:i}=this;i&&(this.remove(i),this.throttled=void 0,i.unsubscribe()),t&&(this.value=void 0,this.hasValue=!1,this.destination.next(e))}notifyNext(){this.clearThrottle()}notifyComplete(){this.clearThrottle()}}function WO(n){return!we(n)&&n-parseFloat(n)+1>=0}function Xoe(n){const{index:e,period:t,subscriber:i}=n;if(i.next(e),!i.closed){if(-1===t)return i.complete();n.index=e+1,this.schedule(n,t)}}function aS(n,e=Pf){return function(n){return function(t){return t.lift(new Woe(n))}}(()=>function(n=0,e,t){let i=-1;return WO(e)?i=Number(e)<1?1:Number(e):Gn(e)&&(t=e),Gn(t)||(t=Pf),new ce(r=>{const s=WO(n)?n:+n-t.now();return t.schedule(Xoe,s,{index:0,period:i,subscriber:r})})}(n,e))}function qc(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 If(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))}class lS{constructor(e=!1,t,i=!0){this._multiple=e,this._emitChanges=i,this._selection=new Set,this._deselectedToEmit=[],this._selectedToEmit=[],this.changed=new Se,t&&t.length&&(e?t.forEach(r=>this._markSelected(r)):this._markSelected(t[0]),this._selectedToEmit.length=0)}get selected(){return this._selected||(this._selected=Array.from(this._selection.values())),this._selected}select(...e){this._verifyValueAssignment(e),e.forEach(t=>this._markSelected(t)),this._emitChangeEvent()}deselect(...e){this._verifyValueAssignment(e),e.forEach(t=>this._unmarkSelected(t)),this._emitChangeEvent()}toggle(e){this.isSelected(e)?this.deselect(e):this.select(e)}clear(){this._unmarkAll(),this._emitChangeEvent()}isSelected(e){return this._selection.has(e)}isEmpty(){return 0===this._selection.size}hasValue(){return!this.isEmpty()}sort(e){this._multiple&&this.selected&&this._selected.sort(e)}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(e){this.isSelected(e)||(this._multiple||this._unmarkAll(),this._selection.add(e),this._emitChanges&&this._selectedToEmit.push(e))}_unmarkSelected(e){this.isSelected(e)&&(this._selection.delete(e),this._emitChanges&&this._deselectedToEmit.push(e))}_unmarkAll(){this.isEmpty()||this._selection.forEach(e=>this._unmarkSelected(e))}_verifyValueAssignment(e){}}let cS=(()=>{class n{constructor(){this._listeners=[]}notify(t,i){for(let r of this._listeners)r(t,i)}listen(t){return this._listeners.push(t),()=>{this._listeners=this._listeners.filter(i=>t!==i)}}ngOnDestroy(){this._listeners=[]}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ue({factory:function(){return new n},token:n,providedIn:"root"}),n})(),um=(()=>{class n{constructor(t,i,r){this._ngZone=t,this._platform=i,this._scrolled=new Se,this._globalSubscription=null,this._scrolledCount=0,this.scrollContainers=new Map,this._document=r}register(t){this.scrollContainers.has(t)||this.scrollContainers.set(t,t.elementScrolled().subscribe(()=>this._scrolled.next(t)))}deregister(t){const i=this.scrollContainers.get(t);i&&(i.unsubscribe(),this.scrollContainers.delete(t))}scrolled(t=20){return this._platform.isBrowser?new ce(i=>{this._globalSubscription||this._addGlobalListener();const r=t>0?this._scrolled.pipe(aS(t)).subscribe(i):this._scrolled.subscribe(i);return this._scrolledCount++,()=>{r.unsubscribe(),this._scrolledCount--,this._scrolledCount||this._removeGlobalListener()}}):ht()}ngOnDestroy(){this._removeGlobalListener(),this.scrollContainers.forEach((t,i)=>this.deregister(i)),this._scrolled.complete()}ancestorScrolled(t,i){const r=this.getAncestorScrollContainers(t);return this.scrolled(i).pipe(Fn(s=>!s||r.indexOf(s)>-1))}getAncestorScrollContainers(t){const i=[];return this.scrollContainers.forEach((r,s)=>{this._scrollableContainsElement(s,t)&&i.push(s)}),i}_getWindow(){return this._document.defaultView||window}_scrollableContainsElement(t,i){let r=Wu(i),s=t.getElementRef().nativeElement;do{if(r==s)return!0}while(r=r.parentElement);return!1}_addGlobalListener(){this._globalSubscription=this._ngZone.runOutsideAngular(()=>Wc(this._getWindow().document,"scroll").subscribe(()=>this._scrolled.next()))}_removeGlobalListener(){this._globalSubscription&&(this._globalSubscription.unsubscribe(),this._globalSubscription=null)}}return n.\u0275fac=function(t){return new(t||n)(I(dt),I(si),I(ut,8))},n.\u0275prov=ue({factory:function(){return new n(I(dt),I(si),I(ut,8))},token:n,providedIn:"root"}),n})(),Yf=(()=>{class n{constructor(t,i,r){this._platform=t,this._change=new Se,this._changeListener=s=>{this._change.next(s)},this._document=r,i.runOutsideAngular(()=>{if(t.isBrowser){const s=this._getWindow();s.addEventListener("resize",this._changeListener),s.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:i,height:r}=this.getViewportSize();return{top:t.top,left:t.left,bottom:t.top+r,right:t.left+i,height:r,width:i}}getViewportScrollPosition(){if(!this._platform.isBrowser)return{top:0,left:0};const t=this._document,i=this._getWindow(),r=t.documentElement,s=r.getBoundingClientRect();return{top:-s.top||t.body.scrollTop||i.scrollY||r.scrollTop||0,left:-s.left||t.body.scrollLeft||i.scrollX||r.scrollLeft||0}}change(t=20){return t>0?this._change.pipe(aS(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 n.\u0275fac=function(t){return new(t||n)(I(si),I(dt),I(ut,8))},n.\u0275prov=ue({factory:function(){return new n(I(si),I(dt),I(ut,8))},token:n,providedIn:"root"}),n})(),Wv=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({}),n})(),Gj=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[Nv,Rv,Wv],Nv,Wv]}),n})();class qO{attach(e){return this._attachedHost=e,e.attach(this)}detach(){let e=this._attachedHost;null!=e&&(this._attachedHost=null,e.detach())}get isAttached(){return null!=this._attachedHost}setAttachedHost(e){this._attachedHost=e}}class dm extends qO{constructor(e,t,i,r){super(),this.component=e,this.viewContainerRef=t,this.injector=i,this.componentFactoryResolver=r}}class Xf extends qO{constructor(e,t,i){super(),this.templateRef=e,this.viewContainerRef=t,this.context=i}get origin(){return this.templateRef.elementRef}attach(e,t=this.context){return this.context=t,super.attach(e)}detach(){return this.context=void 0,super.detach()}}class fae extends qO{constructor(e){super(),this.element=e instanceof rt?e.nativeElement:e}}class uS{constructor(){this._isDisposed=!1,this.attachDomPortal=null}hasAttached(){return!!this._attachedPortal}attach(e){return e instanceof dm?(this._attachedPortal=e,this.attachComponentPortal(e)):e instanceof Xf?(this._attachedPortal=e,this.attachTemplatePortal(e)):this.attachDomPortal&&e instanceof fae?(this._attachedPortal=e,this.attachDomPortal(e)):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(e){this._disposeFn=e}_invokeDisposeFn(){this._disposeFn&&(this._disposeFn(),this._disposeFn=null)}}class pae extends uS{constructor(e,t,i,r,s){super(),this.outletElement=e,this._componentFactoryResolver=t,this._appRef=i,this._defaultInjector=r,this.attachDomPortal=o=>{const a=o.element,l=this._document.createComment("dom-portal");a.parentNode.insertBefore(l,a),this.outletElement.appendChild(a),this._attachedPortal=o,super.setDisposeFn(()=>{l.parentNode&&l.parentNode.replaceChild(a,l)})},this._document=s}attachComponentPortal(e){const i=(e.componentFactoryResolver||this._componentFactoryResolver).resolveComponentFactory(e.component);let r;return e.viewContainerRef?(r=e.viewContainerRef.createComponent(i,e.viewContainerRef.length,e.injector||e.viewContainerRef.injector),this.setDisposeFn(()=>r.destroy())):(r=i.create(e.injector||this._defaultInjector),this._appRef.attachView(r.hostView),this.setDisposeFn(()=>{this._appRef.detachView(r.hostView),r.destroy()})),this.outletElement.appendChild(this._getComponentRootNode(r)),this._attachedPortal=e,r}attachTemplatePortal(e){let t=e.viewContainerRef,i=t.createEmbeddedView(e.templateRef,e.context);return i.rootNodes.forEach(r=>this.outletElement.appendChild(r)),i.detectChanges(),this.setDisposeFn(()=>{let r=t.indexOf(i);-1!==r&&t.remove(r)}),this._attachedPortal=e,i}dispose(){super.dispose(),null!=this.outletElement.parentNode&&this.outletElement.parentNode.removeChild(this.outletElement)}_getComponentRootNode(e){return e.hostView.rootNodes[0]}}let Kf=(()=>{class n extends uS{constructor(t,i,r){super(),this._componentFactoryResolver=t,this._viewContainerRef=i,this._isInitialized=!1,this.attached=new Le,this.attachDomPortal=s=>{const o=s.element,a=this._document.createComment("dom-portal");s.setAttachedHost(this),o.parentNode.insertBefore(a,o),this._getRootNode().appendChild(o),this._attachedPortal=s,super.setDisposeFn(()=>{a.parentNode&&a.parentNode.replaceChild(o,a)})},this._document=r}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 i=null!=t.viewContainerRef?t.viewContainerRef:this._viewContainerRef,s=(t.componentFactoryResolver||this._componentFactoryResolver).resolveComponentFactory(t.component),o=i.createComponent(s,i.length,t.injector||i.injector);return i!==this._viewContainerRef&&this._getRootNode().appendChild(o.hostView.rootNodes[0]),super.setDisposeFn(()=>o.destroy()),this._attachedPortal=t,this._attachedRef=o,this.attached.emit(o),o}attachTemplatePortal(t){t.setAttachedHost(this);const i=this._viewContainerRef.createEmbeddedView(t.templateRef,t.context);return super.setDisposeFn(()=>this._viewContainerRef.clear()),this._attachedPortal=t,this._attachedRef=i,this.attached.emit(i),i}_getRootNode(){const t=this._viewContainerRef.element.nativeElement;return t.nodeType===t.ELEMENT_NODE?t:t.parentNode}}return n.\u0275fac=function(t){return new(t||n)(E(ll),E(ns),E(ut))},n.\u0275dir=oe({type:n,selectors:[["","cdkPortalOutlet",""]],inputs:{portal:["cdkPortalOutlet","portal"]},outputs:{attached:"attached"},exportAs:["cdkPortalOutlet"],features:[ct]}),n})(),dS=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({}),n})();function qj(n,e=!1){return t=>t.lift(new gae(n,e))}class gae{constructor(e,t){this.predicate=e,this.inclusive=t}call(e,t){return t.subscribe(new mae(e,this.predicate,this.inclusive))}}class mae extends xt{constructor(e,t,i){super(e),this.predicate=t,this.inclusive=i,this.index=0}_next(e){const t=this.destination;let i;try{i=this.predicate(e,this.index++)}catch(r){return void t.error(r)}this.nextOrComplete(e,i)}nextOrComplete(e,t){const i=this.destination;Boolean(t)?i.next(e):(this.inclusive&&i.next(e),i.complete())}}const Yj=TV();class _ae{constructor(e,t){this._viewportRuler=e,this._previousHTMLStyles={top:"",left:""},this._isEnabled=!1,this._document=t}attach(){}enable(){if(this._canBeEnabled()){const e=this._document.documentElement;this._previousScrollPosition=this._viewportRuler.getViewportScrollPosition(),this._previousHTMLStyles.left=e.style.left||"",this._previousHTMLStyles.top=e.style.top||"",e.style.left=jr(-this._previousScrollPosition.left),e.style.top=jr(-this._previousScrollPosition.top),e.classList.add("cdk-global-scrollblock"),this._isEnabled=!0}}disable(){if(this._isEnabled){const e=this._document.documentElement,i=e.style,r=this._document.body.style,s=i.scrollBehavior||"",o=r.scrollBehavior||"";this._isEnabled=!1,i.left=this._previousHTMLStyles.left,i.top=this._previousHTMLStyles.top,e.classList.remove("cdk-global-scrollblock"),Yj&&(i.scrollBehavior=r.scrollBehavior="auto"),window.scroll(this._previousScrollPosition.left,this._previousScrollPosition.top),Yj&&(i.scrollBehavior=s,r.scrollBehavior=o)}}_canBeEnabled(){if(this._document.documentElement.classList.contains("cdk-global-scrollblock")||this._isEnabled)return!1;const t=this._document.body,i=this._viewportRuler.getViewportSize();return t.scrollHeight>i.height||t.scrollWidth>i.width}}class yae{constructor(e,t,i,r){this._scrollDispatcher=e,this._ngZone=t,this._viewportRuler=i,this._config=r,this._scrollSubscription=null,this._detach=()=>{this.disable(),this._overlayRef.hasAttached()&&this._ngZone.run(()=>this._overlayRef.detach())}}attach(e){this._overlayRef=e}enable(){if(this._scrollSubscription)return;const e=this._scrollDispatcher.scrolled(0);this._config&&this._config.threshold&&this._config.threshold>1?(this._initialScrollPosition=this._viewportRuler.getViewportScrollPosition().top,this._scrollSubscription=e.subscribe(()=>{const t=this._viewportRuler.getViewportScrollPosition().top;Math.abs(t-this._initialScrollPosition)>this._config.threshold?this._detach():this._overlayRef.updatePosition()})):this._scrollSubscription=e.subscribe(this._detach)}disable(){this._scrollSubscription&&(this._scrollSubscription.unsubscribe(),this._scrollSubscription=null)}detach(){this.disable(),this._overlayRef=null}}class Xj{enable(){}disable(){}attach(){}}function YO(n,e){return e.some(t=>n.bottomt.bottom||n.rightt.right)}function Kj(n,e){return e.some(t=>n.topt.bottom||n.leftt.right)}class vae{constructor(e,t,i,r){this._scrollDispatcher=e,this._viewportRuler=t,this._ngZone=i,this._config=r,this._scrollSubscription=null}attach(e){this._overlayRef=e}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:i,height:r}=this._viewportRuler.getViewportSize();YO(t,[{width:i,height:r,bottom:r,right:i,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 bae=(()=>{class n{constructor(t,i,r,s){this._scrollDispatcher=t,this._viewportRuler=i,this._ngZone=r,this.noop=()=>new Xj,this.close=o=>new yae(this._scrollDispatcher,this._ngZone,this._viewportRuler,o),this.block=()=>new _ae(this._viewportRuler,this._document),this.reposition=o=>new vae(this._scrollDispatcher,this._viewportRuler,this._ngZone,o),this._document=s}}return n.\u0275fac=function(t){return new(t||n)(I(um),I(Yf),I(dt),I(ut))},n.\u0275prov=ue({factory:function(){return new n(I(um),I(Yf),I(dt),I(ut))},token:n,providedIn:"root"}),n})();class qv{constructor(e){if(this.scrollStrategy=new Xj,this.panelClass="",this.hasBackdrop=!1,this.backdropClass="cdk-overlay-dark-backdrop",this.disposeOnNavigation=!1,e){const t=Object.keys(e);for(const i of t)void 0!==e[i]&&(this[i]=e[i])}}}class Cae{constructor(e,t,i,r,s){this.offsetX=i,this.offsetY=r,this.panelClass=s,this.originX=e.originX,this.originY=e.originY,this.overlayX=t.overlayX,this.overlayY=t.overlayY}}class wae{constructor(e,t){this.connectionPair=e,this.scrollableViewProperties=t}}let Zj=(()=>{class n{constructor(t){this._attachedOverlays=[],this._document=t}ngOnDestroy(){this.detach()}add(t){this.remove(t),this._attachedOverlays.push(t)}remove(t){const i=this._attachedOverlays.indexOf(t);i>-1&&this._attachedOverlays.splice(i,1),0===this._attachedOverlays.length&&this.detach()}}return n.\u0275fac=function(t){return new(t||n)(I(ut))},n.\u0275prov=ue({factory:function(){return new n(I(ut))},token:n,providedIn:"root"}),n})(),Eae=(()=>{class n extends Zj{constructor(t){super(t),this._keydownListener=i=>{const r=this._attachedOverlays;for(let s=r.length-1;s>-1;s--)if(r[s]._keydownEvents.observers.length>0){r[s]._keydownEvents.next(i);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 n.\u0275fac=function(t){return new(t||n)(I(ut))},n.\u0275prov=ue({factory:function(){return new n(I(ut))},token:n,providedIn:"root"}),n})(),Sae=(()=>{class n extends Zj{constructor(t,i){super(t),this._platform=i,this._cursorStyleIsSet=!1,this._clickListener=r=>{const s=Nf(r),o=this._attachedOverlays.slice();for(let a=o.length-1;a>-1;a--){const l=o[a];if(!(l._outsidePointerEvents.observers.length<1)&&l.hasAttached()){if(l.overlayElement.contains(s))break;l._outsidePointerEvents.next(r)}}}}add(t){if(super.add(t),!this._isAttached){const i=this._document.body;i.addEventListener("click",this._clickListener,!0),i.addEventListener("auxclick",this._clickListener,!0),i.addEventListener("contextmenu",this._clickListener,!0),this._platform.IOS&&!this._cursorStyleIsSet&&(this._cursorOriginalValue=i.style.cursor,i.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 n.\u0275fac=function(t){return new(t||n)(I(ut),I(si))},n.\u0275prov=ue({factory:function(){return new n(I(ut),I(si))},token:n,providedIn:"root"}),n})();const ah="undefined"!=typeof window?window:{},Qj=void 0!==ah.__karma__&&!!ah.__karma__||void 0!==ah.jasmine&&!!ah.jasmine||void 0!==ah.jest&&!!ah.jest||void 0!==ah.Mocha&&!!ah.Mocha;let hm=(()=>{class n{constructor(t,i){this._platform=i,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||Qj){const r=this._document.querySelectorAll(`.${t}[platform="server"], .${t}[platform="test"]`);for(let s=0;sthis._backdropClick.next(d),this._keydownEvents=new Se,this._outsidePointerEvents=new Se,r.scrollStrategy&&(this._scrollStrategy=r.scrollStrategy,this._scrollStrategy.attach(this)),this._positionStrategy=r.positionStrategy}get overlayElement(){return this._pane}get backdropElement(){return this._backdropElement}get hostElement(){return this._host}attach(e){let t=this._portalOutlet.attach(e);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(yi(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),t}detach(){if(!this.hasAttached())return;this.detachBackdrop(),this._togglePointerEvents(!1),this._positionStrategy&&this._positionStrategy.detach&&this._positionStrategy.detach(),this._scrollStrategy&&this._scrollStrategy.disable();const e=this._portalOutlet.detach();return this._detachments.next(),this._keyboardDispatcher.remove(this),this._detachContentWhenStable(),this._locationChanges.unsubscribe(),this._outsideClickDispatcher.remove(this),e}dispose(){const e=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,e&&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(e){e!==this._positionStrategy&&(this._positionStrategy&&this._positionStrategy.dispose(),this._positionStrategy=e,this.hasAttached()&&(e.attach(this),this.updatePosition()))}updateSize(e){this._config=Object.assign(Object.assign({},this._config),e),this._updateElementSize()}setDirection(e){this._config=Object.assign(Object.assign({},this._config),{direction:e}),this._updateElementDirection()}addPanelClass(e){this._pane&&this._toggleClasses(this._pane,e,!0)}removePanelClass(e){this._pane&&this._toggleClasses(this._pane,e,!1)}getDirection(){const e=this._config.direction;return e?"string"==typeof e?e:e.value:"ltr"}updateScrollStrategy(e){e!==this._scrollStrategy&&(this._disposeScrollStrategy(),this._scrollStrategy=e,this.hasAttached()&&(e.attach(this),e.enable()))}_updateElementDirection(){this._host.setAttribute("dir",this.getDirection())}_updateElementSize(){if(!this._pane)return;const e=this._pane.style;e.width=jr(this._config.width),e.height=jr(this._config.height),e.minWidth=jr(this._config.minWidth),e.minHeight=jr(this._config.minHeight),e.maxWidth=jr(this._config.maxWidth),e.maxHeight=jr(this._config.maxHeight)}_togglePointerEvents(e){this._pane.style.pointerEvents=e?"":"none"}_attachBackdrop(){const e="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(e)})}):this._backdropElement.classList.add(e)}_updateStackingOrder(){this._host.nextSibling&&this._host.parentNode.appendChild(this._host)}detachBackdrop(){let e=this._backdropElement;if(!e)return;let t,i=()=>{e&&(e.removeEventListener("click",this._backdropClickHandler),e.removeEventListener("transitionend",i),e.parentNode&&e.parentNode.removeChild(e)),this._backdropElement==e&&(this._backdropElement=null),this._config.backdropClass&&this._toggleClasses(e,this._config.backdropClass,!1),clearTimeout(t)};e.classList.remove("cdk-overlay-backdrop-showing"),this._ngZone.runOutsideAngular(()=>{e.addEventListener("transitionend",i)}),e.style.pointerEvents="none",t=this._ngZone.runOutsideAngular(()=>setTimeout(i,500))}_toggleClasses(e,t,i){const r=e.classList;EE(t).forEach(s=>{s&&(i?r.add(s):r.remove(s))})}_detachContentWhenStable(){this._ngZone.runOutsideAngular(()=>{const e=this._ngZone.onStable.pipe(Tn(Ni(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)),e.unsubscribe())})})}_disposeScrollStrategy(){const e=this._scrollStrategy;e&&(e.disable(),e.detach&&e.detach())}}const Jj="cdk-overlay-connected-position-bounding-box",xae=/([A-Za-z%]+)$/;class eU{constructor(e,t,i,r,s){this._viewportRuler=t,this._document=i,this._platform=r,this._overlayContainer=s,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 Se,this._resizeSubscription=Te.EMPTY,this._offsetX=0,this._offsetY=0,this._appliedPanelClasses=[],this.positionChanges=this._positionChanges,this.setOrigin(e)}get positions(){return this._preferredPositions}attach(e){this._validatePositions(),e.hostElement.classList.add(Jj),this._overlayRef=e,this._boundingBox=e.hostElement,this._pane=e.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 e=this._originRect,t=this._overlayRect,i=this._viewportRect,r=[];let s;for(let o of this._preferredPositions){let a=this._getOriginPoint(e,o),l=this._getOverlayPoint(a,t,o),c=this._getOverlayFit(l,t,i,o);if(c.isCompletelyWithinViewport)return this._isPushed=!1,void this._applyPosition(o,a);this._canFitWithFlexibleDimensions(c,l,i)?r.push({position:o,origin:a,overlayRect:t,boundingBoxRect:this._calculateBoundingBoxRect(a,o)}):(!s||s.overlayFit.visibleAreaa&&(a=c,o=l)}return this._isPushed=!1,void this._applyPosition(o.position,o.origin)}if(this._canPush)return this._isPushed=!0,void this._applyPosition(s.position,s.originPoint);this._applyPosition(s.position,s.originPoint)}detach(){this._clearPanelClasses(),this._lastPosition=null,this._previousPushAmount=null,this._resizeSubscription.unsubscribe()}dispose(){this._isDisposed||(this._boundingBox&&Zf(this._boundingBox.style,{top:"",left:"",right:"",bottom:"",height:"",width:"",alignItems:"",justifyContent:""}),this._pane&&this._resetOverlayElementStyles(),this._overlayRef&&this._overlayRef.hostElement.classList.remove(Jj),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 e=this._lastPosition||this._preferredPositions[0],t=this._getOriginPoint(this._originRect,e);this._applyPosition(e,t)}}withScrollableContainers(e){return this._scrollables=e,this}withPositions(e){return this._preferredPositions=e,-1===e.indexOf(this._lastPosition)&&(this._lastPosition=null),this._validatePositions(),this}withViewportMargin(e){return this._viewportMargin=e,this}withFlexibleDimensions(e=!0){return this._hasFlexibleDimensions=e,this}withGrowAfterOpen(e=!0){return this._growAfterOpen=e,this}withPush(e=!0){return this._canPush=e,this}withLockedPosition(e=!0){return this._positionLocked=e,this}setOrigin(e){return this._origin=e,this}withDefaultOffsetX(e){return this._offsetX=e,this}withDefaultOffsetY(e){return this._offsetY=e,this}withTransformOriginOn(e){return this._transformOriginSelector=e,this}_getOriginPoint(e,t){let i,r;if("center"==t.originX)i=e.left+e.width/2;else{const s=this._isRtl()?e.right:e.left,o=this._isRtl()?e.left:e.right;i="start"==t.originX?s:o}return r="center"==t.originY?e.top+e.height/2:"top"==t.originY?e.top:e.bottom,{x:i,y:r}}_getOverlayPoint(e,t,i){let r,s;return r="center"==i.overlayX?-t.width/2:"start"===i.overlayX?this._isRtl()?-t.width:0:this._isRtl()?0:-t.width,s="center"==i.overlayY?-t.height/2:"top"==i.overlayY?0:-t.height,{x:e.x+r,y:e.y+s}}_getOverlayFit(e,t,i,r){const s=nU(t);let{x:o,y:a}=e,l=this._getOffset(r,"x"),c=this._getOffset(r,"y");l&&(o+=l),c&&(a+=c);let p=0-a,g=a+s.height-i.height,_=this._subtractOverflows(s.width,0-o,o+s.width-i.width),y=this._subtractOverflows(s.height,p,g),v=_*y;return{visibleArea:v,isCompletelyWithinViewport:s.width*s.height===v,fitsInViewportVertically:y===s.height,fitsInViewportHorizontally:_==s.width}}_canFitWithFlexibleDimensions(e,t,i){if(this._hasFlexibleDimensions){const r=i.bottom-t.y,s=i.right-t.x,o=tU(this._overlayRef.getConfig().minHeight),a=tU(this._overlayRef.getConfig().minWidth),c=e.fitsInViewportHorizontally||null!=a&&a<=s;return(e.fitsInViewportVertically||null!=o&&o<=r)&&c}return!1}_pushOverlayOnScreen(e,t,i){if(this._previousPushAmount&&this._positionLocked)return{x:e.x+this._previousPushAmount.x,y:e.y+this._previousPushAmount.y};const r=nU(t),s=this._viewportRect,o=Math.max(e.x+r.width-s.width,0),a=Math.max(e.y+r.height-s.height,0),l=Math.max(s.top-i.top-e.y,0),c=Math.max(s.left-i.left-e.x,0);let d=0,f=0;return d=r.width<=s.width?c||-o:e.x_&&!this._isInitialRender&&!this._growAfterOpen&&(o=e.y-_/2)}if("end"===t.overlayX&&!r||"start"===t.overlayX&&r)p=i.width-e.x+this._viewportMargin,d=e.x-this._viewportMargin;else if("start"===t.overlayX&&!r||"end"===t.overlayX&&r)f=e.x,d=i.right-e.x;else{const g=Math.min(i.right-e.x+i.left,e.x),_=this._lastBoundingBoxSize.width;d=2*g,f=e.x-g,d>_&&!this._isInitialRender&&!this._growAfterOpen&&(f=e.x-_/2)}return{top:o,left:f,bottom:a,right:p,width:d,height:s}}_setBoundingBoxStyles(e,t){const i=this._calculateBoundingBoxRect(e,t);!this._isInitialRender&&!this._growAfterOpen&&(i.height=Math.min(i.height,this._lastBoundingBoxSize.height),i.width=Math.min(i.width,this._lastBoundingBoxSize.width));const r={};if(this._hasExactPosition())r.top=r.left="0",r.bottom=r.right=r.maxHeight=r.maxWidth="",r.width=r.height="100%";else{const s=this._overlayRef.getConfig().maxHeight,o=this._overlayRef.getConfig().maxWidth;r.height=jr(i.height),r.top=jr(i.top),r.bottom=jr(i.bottom),r.width=jr(i.width),r.left=jr(i.left),r.right=jr(i.right),r.alignItems="center"===t.overlayX?"center":"end"===t.overlayX?"flex-end":"flex-start",r.justifyContent="center"===t.overlayY?"center":"bottom"===t.overlayY?"flex-end":"flex-start",s&&(r.maxHeight=jr(s)),o&&(r.maxWidth=jr(o))}this._lastBoundingBoxSize=i,Zf(this._boundingBox.style,r)}_resetBoundingBoxStyles(){Zf(this._boundingBox.style,{top:"0",left:"0",right:"0",bottom:"0",height:"",width:"",alignItems:"",justifyContent:""})}_resetOverlayElementStyles(){Zf(this._pane.style,{top:"",left:"",bottom:"",right:"",position:"",transform:""})}_setOverlayElementStyles(e,t){const i={},r=this._hasExactPosition(),s=this._hasFlexibleDimensions,o=this._overlayRef.getConfig();if(r){const d=this._viewportRuler.getViewportScrollPosition();Zf(i,this._getExactOverlayY(t,e,d)),Zf(i,this._getExactOverlayX(t,e,d))}else i.position="static";let a="",l=this._getOffset(t,"x"),c=this._getOffset(t,"y");l&&(a+=`translateX(${l}px) `),c&&(a+=`translateY(${c}px)`),i.transform=a.trim(),o.maxHeight&&(r?i.maxHeight=jr(o.maxHeight):s&&(i.maxHeight="")),o.maxWidth&&(r?i.maxWidth=jr(o.maxWidth):s&&(i.maxWidth="")),Zf(this._pane.style,i)}_getExactOverlayY(e,t,i){let r={top:"",bottom:""},s=this._getOverlayPoint(t,this._overlayRect,e);this._isPushed&&(s=this._pushOverlayOnScreen(s,this._overlayRect,i));let o=this._overlayContainer.getContainerElement().getBoundingClientRect().top;return s.y-=o,"bottom"===e.overlayY?r.bottom=this._document.documentElement.clientHeight-(s.y+this._overlayRect.height)+"px":r.top=jr(s.y),r}_getExactOverlayX(e,t,i){let o,r={left:"",right:""},s=this._getOverlayPoint(t,this._overlayRect,e);return this._isPushed&&(s=this._pushOverlayOnScreen(s,this._overlayRect,i)),o=this._isRtl()?"end"===e.overlayX?"left":"right":"end"===e.overlayX?"right":"left","right"===o?r.right=this._document.documentElement.clientWidth-(s.x+this._overlayRect.width)+"px":r.left=jr(s.x),r}_getScrollVisibility(){const e=this._getOriginRect(),t=this._pane.getBoundingClientRect(),i=this._scrollables.map(r=>r.getElementRef().nativeElement.getBoundingClientRect());return{isOriginClipped:Kj(e,i),isOriginOutsideView:YO(e,i),isOverlayClipped:Kj(t,i),isOverlayOutsideView:YO(t,i)}}_subtractOverflows(e,...t){return t.reduce((i,r)=>i-Math.max(r,0),e)}_getNarrowedViewportRect(){const e=this._document.documentElement.clientWidth,t=this._document.documentElement.clientHeight,i=this._viewportRuler.getViewportScrollPosition();return{top:i.top+this._viewportMargin,left:i.left+this._viewportMargin,right:i.left+e-this._viewportMargin,bottom:i.top+t-this._viewportMargin,width:e-2*this._viewportMargin,height:t-2*this._viewportMargin}}_isRtl(){return"rtl"===this._overlayRef.getDirection()}_hasExactPosition(){return!this._hasFlexibleDimensions||this._isPushed}_getOffset(e,t){return"x"===t?null==e.offsetX?this._offsetX:e.offsetX:null==e.offsetY?this._offsetY:e.offsetY}_validatePositions(){}_addPanelClasses(e){this._pane&&EE(e).forEach(t=>{""!==t&&-1===this._appliedPanelClasses.indexOf(t)&&(this._appliedPanelClasses.push(t),this._pane.classList.add(t))})}_clearPanelClasses(){this._pane&&(this._appliedPanelClasses.forEach(e=>{this._pane.classList.remove(e)}),this._appliedPanelClasses=[])}_getOriginRect(){const e=this._origin;if(e instanceof rt)return e.nativeElement.getBoundingClientRect();if(e instanceof Element)return e.getBoundingClientRect();const t=e.width||0,i=e.height||0;return{top:e.y,bottom:e.y+i,left:e.x,right:e.x+t,height:i,width:t}}}function Zf(n,e){for(let t in e)e.hasOwnProperty(t)&&(n[t]=e[t]);return n}function tU(n){if("number"!=typeof n&&null!=n){const[e,t]=n.split(xae);return t&&"px"!==t?null:parseFloat(e)}return n||null}function nU(n){return{top:Math.floor(n.top),right:Math.floor(n.right),bottom:Math.floor(n.bottom),left:Math.floor(n.left),width:Math.floor(n.width),height:Math.floor(n.height)}}class Tae{constructor(e,t,i,r,s,o,a){this._preferredPositions=[],this._positionStrategy=new eU(i,r,s,o,a).withFlexibleDimensions(!1).withPush(!1).withViewportMargin(0),this.withFallbackPosition(e,t),this.onPositionChange=this._positionStrategy.positionChanges}get positions(){return this._preferredPositions}attach(e){this._overlayRef=e,this._positionStrategy.attach(e),this._direction&&(e.setDirection(this._direction),this._direction=null)}dispose(){this._positionStrategy.dispose()}detach(){this._positionStrategy.detach()}apply(){this._positionStrategy.apply()}recalculateLastPosition(){this._positionStrategy.reapplyLastPosition()}withScrollableContainers(e){this._positionStrategy.withScrollableContainers(e)}withFallbackPosition(e,t,i,r){const s=new Cae(e,t,i,r);return this._preferredPositions.push(s),this._positionStrategy.withPositions(this._preferredPositions),this}withDirection(e){return this._overlayRef?this._overlayRef.setDirection(e):this._direction=e,this}withOffsetX(e){return this._positionStrategy.withDefaultOffsetX(e),this}withOffsetY(e){return this._positionStrategy.withDefaultOffsetY(e),this}withLockedPosition(e){return this._positionStrategy.withLockedPosition(e),this}withPositions(e){return this._preferredPositions=e.slice(),this._positionStrategy.withPositions(this._preferredPositions),this}setOrigin(e){return this._positionStrategy.setOrigin(e),this}}const iU="cdk-global-overlay-wrapper";class Aae{constructor(){this._cssPosition="static",this._topOffset="",this._bottomOffset="",this._leftOffset="",this._rightOffset="",this._alignItems="",this._justifyContent="",this._width="",this._height=""}attach(e){const t=e.getConfig();this._overlayRef=e,this._width&&!t.width&&e.updateSize({width:this._width}),this._height&&!t.height&&e.updateSize({height:this._height}),e.hostElement.classList.add(iU),this._isDisposed=!1}top(e=""){return this._bottomOffset="",this._topOffset=e,this._alignItems="flex-start",this}left(e=""){return this._rightOffset="",this._leftOffset=e,this._justifyContent="flex-start",this}bottom(e=""){return this._topOffset="",this._bottomOffset=e,this._alignItems="flex-end",this}right(e=""){return this._leftOffset="",this._rightOffset=e,this._justifyContent="flex-end",this}width(e=""){return this._overlayRef?this._overlayRef.updateSize({width:e}):this._width=e,this}height(e=""){return this._overlayRef?this._overlayRef.updateSize({height:e}):this._height=e,this}centerHorizontally(e=""){return this.left(e),this._justifyContent="center",this}centerVertically(e=""){return this.top(e),this._alignItems="center",this}apply(){if(!this._overlayRef||!this._overlayRef.hasAttached())return;const e=this._overlayRef.overlayElement.style,t=this._overlayRef.hostElement.style,i=this._overlayRef.getConfig(),{width:r,height:s,maxWidth:o,maxHeight:a}=i,l=!("100%"!==r&&"100vw"!==r||o&&"100%"!==o&&"100vw"!==o),c=!("100%"!==s&&"100vh"!==s||a&&"100%"!==a&&"100vh"!==a);e.position=this._cssPosition,e.marginLeft=l?"0":this._leftOffset,e.marginTop=c?"0":this._topOffset,e.marginBottom=this._bottomOffset,e.marginRight=this._rightOffset,l?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=c?"flex-start":this._alignItems}dispose(){if(this._isDisposed||!this._overlayRef)return;const e=this._overlayRef.overlayElement.style,t=this._overlayRef.hostElement,i=t.style;t.classList.remove(iU),i.justifyContent=i.alignItems=e.marginTop=e.marginBottom=e.marginLeft=e.marginRight=e.position="",this._overlayRef=null,this._isDisposed=!0}}let Dae=(()=>{class n{constructor(t,i,r,s){this._viewportRuler=t,this._document=i,this._platform=r,this._overlayContainer=s}global(){return new Aae}connectedTo(t,i,r){return new Tae(i,r,t,this._viewportRuler,this._document,this._platform,this._overlayContainer)}flexibleConnectedTo(t){return new eU(t,this._viewportRuler,this._document,this._platform,this._overlayContainer)}}return n.\u0275fac=function(t){return new(t||n)(I(Yf),I(ut),I(si),I(hm))},n.\u0275prov=ue({factory:function(){return new n(I(Yf),I(ut),I(si),I(hm))},token:n,providedIn:"root"}),n})(),Oae=0,Jo=(()=>{class n{constructor(t,i,r,s,o,a,l,c,d,f,p){this.scrollStrategies=t,this._overlayContainer=i,this._componentFactoryResolver=r,this._positionBuilder=s,this._keyboardDispatcher=o,this._injector=a,this._ngZone=l,this._document=c,this._directionality=d,this._location=f,this._outsideClickDispatcher=p}create(t){const i=this._createHostElement(),r=this._createPaneElement(i),s=this._createPortalOutlet(r),o=new qv(t);return o.direction=o.direction||this._directionality.value,new Mae(s,i,r,o,this._ngZone,this._keyboardDispatcher,this._document,this._location,this._outsideClickDispatcher)}position(){return this._positionBuilder}_createPaneElement(t){const i=this._document.createElement("div");return i.id="cdk-overlay-"+Oae++,i.classList.add("cdk-overlay-pane"),t.appendChild(i),i}_createHostElement(){const t=this._document.createElement("div");return this._overlayContainer.getContainerElement().appendChild(t),t}_createPortalOutlet(t){return this._appRef||(this._appRef=this._injector.get(Jd)),new pae(t,this._componentFactoryResolver,this._appRef,this._injector,this._document)}}return n.\u0275fac=function(t){return new(t||n)(I(bae),I(hm),I(ll),I(Dae),I(Eae),I(Nt),I(dt),I(ut),I(Qo),I(Xg),I(Sae))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();const Iae=[{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"}],rU=new ve("cdk-connected-overlay-scroll-strategy");let Pae=(()=>{class n{constructor(t){this.elementRef=t}}return n.\u0275fac=function(t){return new(t||n)(E(rt))},n.\u0275dir=oe({type:n,selectors:[["","cdk-overlay-origin",""],["","overlay-origin",""],["","cdkOverlayOrigin",""]],exportAs:["cdkOverlayOrigin"]}),n})(),sU=(()=>{class n{constructor(t,i,r,s,o){this._overlay=t,this._dir=o,this._hasBackdrop=!1,this._lockPosition=!1,this._growAfterOpen=!1,this._flexibleDimensions=!1,this._push=!1,this._backdropSubscription=Te.EMPTY,this._attachSubscription=Te.EMPTY,this._detachSubscription=Te.EMPTY,this._positionSubscription=Te.EMPTY,this.viewportMargin=0,this.open=!1,this.disableClose=!1,this.backdropClick=new Le,this.positionChange=new Le,this.attach=new Le,this.detach=new Le,this.overlayKeydown=new Le,this.overlayOutsideClick=new Le,this._templatePortal=new Xf(i,r),this._scrollStrategyFactory=s,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=Mt(t)}get lockPosition(){return this._lockPosition}set lockPosition(t){this._lockPosition=Mt(t)}get flexibleDimensions(){return this._flexibleDimensions}set flexibleDimensions(t){this._flexibleDimensions=Mt(t)}get growAfterOpen(){return this._growAfterOpen}set growAfterOpen(t){this._growAfterOpen=Mt(t)}get push(){return this._push}set push(t){this._push=Mt(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=Iae);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(i=>{this.overlayKeydown.next(i),27===i.keyCode&&!this.disableClose&&!Zs(i)&&(i.preventDefault(),this._detachOverlay())}),this._overlayRef.outsidePointerEvents().subscribe(i=>{this.overlayOutsideClick.next(i)})}_buildConfig(){const t=this._position=this.positionStrategy||this._createPositionStrategy(),i=new qv({direction:this._dir,positionStrategy:t,scrollStrategy:this.scrollStrategy,hasBackdrop:this.hasBackdrop});return(this.width||0===this.width)&&(i.width=this.width),(this.height||0===this.height)&&(i.height=this.height),(this.minWidth||0===this.minWidth)&&(i.minWidth=this.minWidth),(this.minHeight||0===this.minHeight)&&(i.minHeight=this.minHeight),this.backdropClass&&(i.backdropClass=this.backdropClass),this.panelClass&&(i.panelClass=this.panelClass),i}_updatePositionStrategy(t){const i=this.positions.map(r=>({originX:r.originX,originY:r.originY,overlayX:r.overlayX,overlayY:r.overlayY,offsetX:r.offsetX||this.offsetX,offsetY:r.offsetY||this.offsetY,panelClass:r.panelClass||void 0}));return t.setOrigin(this.origin.elementRef).withPositions(i).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(qj(()=>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 n.\u0275fac=function(t){return new(t||n)(E(Jo),E(Ys),E(ns),E(rU),E(Qo,8))},n.\u0275dir=oe({type:n,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:[zn]}),n})();const kae={provide:rU,deps:[Jo],useFactory:function(n){return()=>n.scrollStrategies.reposition()}};let Yv=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({providers:[Jo,kae],imports:[[Nv,dS,Gj],Gj]}),n})();const oU=["mat-button",""],aU=["*"],Nae=["mat-button","mat-flat-button","mat-icon-button","mat-raised-button","mat-stroked-button","mat-mini-fab","mat-fab"],Lae=Uf(jf(nc(class{constructor(n){this._elementRef=n}})));let lh=(()=>{class n extends Lae{constructor(t,i,r){super(t),this._focusMonitor=i,this._animationMode=r,this.isRoundButton=this._hasHostAttributes("mat-fab","mat-mini-fab"),this.isIconButton=this._hasHostAttributes("mat-icon-button");for(const s of Nae)this._hasHostAttributes(s)&&this._getHostElement().classList.add(s);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,i){t?this._focusMonitor.focusVia(this._getHostElement(),t,i):this._getHostElement().focus(i)}_getHostElement(){return this._elementRef.nativeElement}_isRippleDisabled(){return this.disableRipple||this.disabled}_hasHostAttributes(...t){return t.some(i=>this._getHostElement().hasAttribute(i))}}return n.\u0275fac=function(t){return new(t||n)(E(rt),E(Sa),E(Do,8))},n.\u0275cmp=Ne({type:n,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,i){if(1&t&&Jn(Js,5),2&t){let r;_t(r=yt())&&(i.ripple=r.first)}},hostAttrs:[1,"mat-focus-indicator"],hostVars:5,hostBindings:function(t,i){2&t&&(nn("disabled",i.disabled||null),st("_mat-animation-noopable","NoopAnimations"===i._animationMode)("mat-button-disabled",i.disabled))},inputs:{disabled:"disabled",disableRipple:"disableRipple",color:"color"},exportAs:["matButton"],features:[ct],attrs:oU,ngContentSelectors:aU,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,i){1&t&&(wi(),R(0,"span",0),Ht(1),k(),tt(2,"span",1),tt(3,"span",2)),2&t&&(G(2),st("mat-button-ripple-round",i.isRoundButton||i.isIconButton),ie("matRippleDisabled",i._isRippleDisabled())("matRippleCentered",i.isIconButton)("matRippleTrigger",i._getHostElement()))},directives:[Js],styles:[".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"],encapsulation:2,changeDetection:0}),n})(),ch=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[_l,On],On]}),n})();class cU extends xt{notifyNext(e,t,i,r,s){this.destination.next(t)}notifyError(e,t){this.destination.error(e)}notifyComplete(e){this.destination.complete()}}class Bae extends xt{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 uU(n,e,t,i,r=new Bae(n,t,i)){if(!r.closed)return e instanceof ce?e.subscribe(r):ki(e)(r)}const dU={};function Qi(...n){let e,t;return Gn(n[n.length-1])&&(t=n.pop()),"function"==typeof n[n.length-1]&&(e=n.pop()),1===n.length&&we(n[0])&&(n=n[0]),za(n,t).lift(new hU(e))}class hU{constructor(e){this.resultSelector=e}call(e,t){return t.subscribe(new Vae(e,this.resultSelector))}}class Vae extends cU{constructor(e,t){super(e),this.resultSelector=t,this.active=0,this.values=[],this.observables=[]}_next(e){this.values.push(dU),this.observables.push(e)}_complete(){const e=this.observables,t=e.length;if(0===t)this.destination.complete();else{this.active=t,this.toRespond=t;for(let i=0;i{class n{constructor(t){this._platform=t,this._matchMedia=this._platform.isBrowser&&window.matchMedia?window.matchMedia.bind(window):jae}matchMedia(t){return this._platform.WEBKIT&&function(n){if(!fU.has(n))try{fm||(fm=document.createElement("style"),fm.setAttribute("type","text/css"),document.head.appendChild(fm)),fm.sheet&&(fm.sheet.insertRule(`@media ${n} {.fx-query-test{ }}`,0),fU.add(n))}catch(e){console.error(e)}}(t),this._matchMedia(t)}}return n.\u0275fac=function(t){return new(t||n)(I(si))},n.\u0275prov=ue({factory:function(){return new n(I(si))},token:n,providedIn:"root"}),n})();function jae(n){return{matches:"all"===n||""===n,media:n,addListener:()=>{},removeListener:()=>{}}}let XO=(()=>{class n{constructor(t,i){this._mediaMatcher=t,this._zone=i,this._queries=new Map,this._destroySubject=new Se}ngOnDestroy(){this._destroySubject.next(),this._destroySubject.complete()}isMatched(t){return gU(EE(t)).some(r=>this._registerQuery(r).mql.matches)}observe(t){let s=Qi(gU(EE(t)).map(o=>this._registerQuery(o).observable));return s=IE(s.pipe(yi(1)),s.pipe(QD(1),Zg(0))),s.pipe(Ae(o=>{const a={matches:!1,breakpoints:{}};return o.forEach(({matches:l,query:c})=>{a.matches=a.matches||l,a.breakpoints[c]=l}),a}))}_registerQuery(t){if(this._queries.has(t))return this._queries.get(t);const i=this._mediaMatcher.matchMedia(t),s={observable:new ce(o=>{const a=l=>this._zone.run(()=>o.next(l));return i.addListener(a),()=>{i.removeListener(a)}}).pipe(Rr(i),Ae(({matches:o})=>({query:t,matches:o})),Tn(this._destroySubject)),mql:i};return this._queries.set(t,s),s}}return n.\u0275fac=function(t){return new(t||n)(I(pU),I(dt))},n.\u0275prov=ue({factory:function(){return new n(I(pU),I(dt))},token:n,providedIn:"root"}),n})();function gU(n){return n.map(e=>e.split(",")).reduce((e,t)=>e.concat(t)).map(e=>e.trim())}function Uae(n,e){if(1&n){const t=Zi();R(0,"div",1),R(1,"button",2),ge("click",function(){return en(t),Qe().action()}),De(2),k(),k()}if(2&n){const t=Qe();G(2),xi(t.data.action)}}function Hae(n,e){}const KO=new ve("MatSnackBarData");class hS{constructor(){this.politeness="assertive",this.announcementMessage="",this.duration=0,this.data=null,this.horizontalPosition="center",this.verticalPosition="bottom"}}const $ae=Math.pow(2,31)-1;class ZO{constructor(e,t){this._overlayRef=t,this._afterDismissed=new Se,this._afterOpened=new Se,this._onAction=new Se,this._dismissedByAction=!1,this.containerInstance=e,this.onAction().subscribe(()=>this.dismiss()),e._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(e){this._durationTimeoutId=setTimeout(()=>this.dismiss(),Math.min(e,$ae))}_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 Gae=(()=>{class n{constructor(t,i){this.snackBarRef=t,this.data=i}action(){this.snackBarRef.dismissWithAction()}get hasAction(){return!!this.data.action}}return n.\u0275fac=function(t){return new(t||n)(E(ZO),E(KO))},n.\u0275cmp=Ne({type:n,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,i){1&t&&(R(0,"span"),De(1),k(),mt(2,Uae,3,1,"div",0)),2&t&&(G(1),xi(i.data.message),G(1),ie("ngIf",i.hasAction))},directives:[zr,lh],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}),n})();const Wae={snackBarState:tc("state",[wr("void, hidden",ti({transform:"scale(0.8)",opacity:0})),wr("visible",ti({transform:"scale(1)",opacity:1})),Qs("* => visible",Ao("150ms cubic-bezier(0, 0, 0.2, 1)")),Qs("* => void, * => hidden",Ao("75ms cubic-bezier(0.4, 0.0, 1, 1)",ti({opacity:0})))])};let qae=(()=>{class n extends uS{constructor(t,i,r,s,o){super(),this._ngZone=t,this._elementRef=i,this._changeDetectorRef=r,this._platform=s,this.snackBarConfig=o,this._announceDelay=150,this._destroyed=!1,this._onAnnounce=new Se,this._onExit=new Se,this._onEnter=new Se,this._animationState="void",this.attachDomPortal=a=>(this._assertNotAttached(),this._applySnackBarClasses(),this._portalOutlet.attachDomPortal(a)),this._live="assertive"!==o.politeness||o.announcementMessage?"off"===o.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:i,toState:r}=t;if(("void"===r&&"void"!==i||"hidden"===r)&&this._completeExit(),"visible"===r){const s=this._onEnter;this._ngZone.run(()=>{s.next(),s.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(yi(1)).subscribe(()=>{this._onExit.next(),this._onExit.complete()})}_applySnackBarClasses(){const t=this._elementRef.nativeElement,i=this.snackBarConfig.panelClass;i&&(Array.isArray(i)?i.forEach(r=>t.classList.add(r)):t.classList.add(i)),"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]"),i=this._elementRef.nativeElement.querySelector("[aria-live]");if(t&&i){let r=null;this._platform.isBrowser&&document.activeElement instanceof HTMLElement&&t.contains(document.activeElement)&&(r=document.activeElement),t.removeAttribute("aria-hidden"),i.appendChild(t),null==r||r.focus(),this._onAnnounce.next(),this._onAnnounce.complete()}},this._announceDelay)})}}return n.\u0275fac=function(t){return new(t||n)(E(dt),E(rt),E(kn),E(si),E(hS))},n.\u0275cmp=Ne({type:n,selectors:[["snack-bar-container"]],viewQuery:function(t,i){if(1&t&&Jn(Kf,7),2&t){let r;_t(r=yt())&&(i._portalOutlet=r.first)}},hostAttrs:[1,"mat-snack-bar-container"],hostVars:1,hostBindings:function(t,i){1&t&&Qy("@state.done",function(s){return i.onAnimationEnd(s)}),2&t&&Pg("@state",i._animationState)},features:[ct],decls:3,vars:2,consts:[["aria-hidden","true"],["cdkPortalOutlet",""]],template:function(t,i){1&t&&(R(0,"div",0),mt(1,Hae,0,0,"ng-template",1),k(),tt(2,"div")),2&t&&(G(2),nn("aria-live",i._live)("role",i._role))},directives:[Kf],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:[Wae.snackBarState]}}),n})(),_U=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[Yv,dS,dn,ch,On],On]}),n})();const yU=new ve("mat-snack-bar-default-options",{providedIn:"root",factory:function(){return new hS}});let Xae=(()=>{class n{constructor(t,i,r,s,o,a){this._overlay=t,this._live=i,this._injector=r,this._breakpointObserver=s,this._parentSnackBar=o,this._defaultConfig=a,this._snackBarRefAtThisLevel=null,this.simpleSnackBarComponent=Gae,this.snackBarContainerComponent=qae,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,i){return this._attach(t,i)}openFromTemplate(t,i){return this._attach(t,i)}open(t,i="",r){const s=Object.assign(Object.assign({},this._defaultConfig),r);return s.data={message:t,action:i},s.announcementMessage===t&&(s.announcementMessage=void 0),this.openFromComponent(this.simpleSnackBarComponent,s)}dismiss(){this._openedSnackBarRef&&this._openedSnackBarRef.dismiss()}ngOnDestroy(){this._snackBarRefAtThisLevel&&this._snackBarRefAtThisLevel.dismiss()}_attachSnackBarContainer(t,i){const s=Nt.create({parent:i&&i.viewContainerRef&&i.viewContainerRef.injector||this._injector,providers:[{provide:hS,useValue:i}]}),o=new dm(this.snackBarContainerComponent,i.viewContainerRef,s),a=t.attach(o);return a.instance.snackBarConfig=i,a.instance}_attach(t,i){const r=Object.assign(Object.assign(Object.assign({},new hS),this._defaultConfig),i),s=this._createOverlay(r),o=this._attachSnackBarContainer(s,r),a=new ZO(o,s);if(t instanceof Ys){const l=new Xf(t,null,{$implicit:r.data,snackBarRef:a});a.instance=o.attachTemplatePortal(l)}else{const l=this._createInjector(r,a),c=new dm(t,void 0,l),d=o.attachComponentPortal(c);a.instance=d.instance}return this._breakpointObserver.observe("(max-width: 599.98px) and (orientation: portrait)").pipe(Tn(s.detachments())).subscribe(l=>{const c=s.overlayElement.classList;l.matches?c.add(this.handsetCssClass):c.remove(this.handsetCssClass)}),r.announcementMessage&&o._onAnnounce.subscribe(()=>{this._live.announce(r.announcementMessage,r.politeness)}),this._animateSnackBar(a,r),this._openedSnackBarRef=a,this._openedSnackBarRef}_animateSnackBar(t,i){t.afterDismissed().subscribe(()=>{this._openedSnackBarRef==t&&(this._openedSnackBarRef=null),i.announcementMessage&&this._live.clear()}),this._openedSnackBarRef?(this._openedSnackBarRef.afterDismissed().subscribe(()=>{t.containerInstance.enter()}),this._openedSnackBarRef.dismiss()):t.containerInstance.enter(),i.duration&&i.duration>0&&t.afterOpened().subscribe(()=>t._dismissAfter(i.duration))}_createOverlay(t){const i=new qv;i.direction=t.direction;let r=this._overlay.position().global();const s="rtl"===t.direction,o="left"===t.horizontalPosition||"start"===t.horizontalPosition&&!s||"end"===t.horizontalPosition&&s,a=!o&&"center"!==t.horizontalPosition;return o?r.left("0"):a?r.right("0"):r.centerHorizontally(),"top"===t.verticalPosition?r.top("0"):r.bottom("0"),i.positionStrategy=r,this._overlay.create(i)}_createInjector(t,i){return Nt.create({parent:t&&t.viewContainerRef&&t.viewContainerRef.injector||this._injector,providers:[{provide:ZO,useValue:i},{provide:KO,useValue:t.data}]})}}return n.\u0275fac=function(t){return new(t||n)(I(Jo),I(DE),I(Nt),I(XO),I(n,12),I(yU))},n.\u0275prov=ue({factory:function(){return new n(I(Jo),I(DE),I(Fc),I(XO),I(n,12),I(yU))},token:n,providedIn:_U}),n})();function xe(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 ws(n,e){return function(t,i){e(t,i,n)}}function Xe(n,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(n,e)}function yl(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 wU(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 JO(){return!("object"==typeof process&&"[object process]"===String(process)&&!process.browser)||wU()}const EU="undefined"!=typeof __VERSION__?__VERSION__:"untranspiled source",pS=JO();class Jae{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 eI(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 SU={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 MU(n){return"string"==typeof n?SU[n.toUpperCase()]||SU.WHITE:n}function gS(n,e){if(!n)throw new Error(e||"Assertion failed")}const ic={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},Xv=ic.window||ic.self||ic.global,xU=ic.process||{};function pm(){let n;if(pS&&Xv.performance)n=Xv.performance.now();else if(xU.hrtime){const e=xU.hrtime();n=1e3*e[0]+e[1]/1e6}else n=Date.now();return n}console;const gm={debug:pS&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},ole={enabled:!0,level:0};function vl(){}const TU={},AU={once:!0};function ale(n){for(const e in n)for(const t in n[e])return t||"untitled";return"empty"}let tI=(()=>{class n{constructor({id:t}={id:""}){this.id=t,this.VERSION=EU,this._startTs=pm(),this._deltaTs=pm(),this.LOG_THROTTLE_TIMEOUT=0,this._storage=new Jae("__probe-".concat(this.id,"__"),ole),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((pm()-this._startTs).toPrecision(10))}getDelta(){return Number((pm()-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){gS(t,i)}warn(t){return this._getLogFunction(0,t,gm.warn,arguments,AU)}error(t){return this._getLogFunction(0,t,gm.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,gm.log,arguments,{time:!0,once:!0})}log(t,i){return this._getLogFunction(t,i,gm.debug,arguments)}info(t,i){return this._getLogFunction(t,i,console.info,arguments)}once(t,i){return this._getLogFunction(t,i,gm.debug||gm.info,arguments,AU)}table(t,i,r){return i?this._getLogFunction(t,i,console.table||vl,r&&[r],{tag:ale(i)}):vl}image({logLevel:t,priority:i,image:r,message:s="",scale:o=1}){return this._shouldLog(t||i)?pS?function({image:n,message:e="",scale:t=1}){if("string"==typeof n){const r=new Image;return r.onload=()=>{const s=eI(r,e,t);console.log(...s)},r.src=n,vl}const i=n.nodeName||"";if("img"===i.toLowerCase())return console.log(...eI(n,e,t)),vl;if("canvas"===i.toLowerCase()){const r=new Image;return r.onload=()=>console.log(...eI(r,e,t)),r.src=n.toDataURL(),vl}return vl}({image:r,message:s,scale:o}):function({image:n,message:e="",scale:t=1}){let i=null;try{i=ze(307)}catch(r){}return i?()=>i(n,{fit:"box",width:"".concat(Math.round(80*t),"%")}).then(r=>console.log(r)):vl}({image:r,message:s,scale:o}):vl}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||vl)}group(t,i,r={collapsed:!1}){r=OU({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||vl)}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()>=DU(t)}_getLogFunction(t,i,r,s=[],o){if(this._shouldLog(t)){o=OU({logLevel:t,message:i,args:s,opts:o}),gS(r=r||o.method),o.total=this.getTotal(),o.delta=this.getDelta(),this._deltaTs=pm();const a=o.tag||o.message;if(o.once){if(TU[a])return vl;TU[a]=pm()}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!pS&&"string"==typeof n&&(e&&(e=MU(e),n="\x1b[".concat(e,"m").concat(n,"\x1b[39m")),t&&(e=MU(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 vl}}return n.VERSION=EU,n})();function DU(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 gS(Number.isFinite(e)&&e>=0),e}function OU(n){const{logLevel:e,message:t}=n;n.logLevel=DU(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 gS("string"===r||"object"===r),Object.assign(n,n.opts)}const jn=new tI({id:"deck"}),qn={DEFAULT:-1,LNGLAT:1,METER_OFFSETS:2,LNGLAT_OFFSETS:3,CARTESIAN:0};Object.defineProperty(qn,"IDENTITY",{get:()=>jn.deprecated("COORDINATE_SYSTEM.IDENTITY","COORDINATE_SYSTEM.CARTESIAN")()||0});const Yc={WEB_MERCATOR:1,GLOBE:2,WEB_MERCATOR_AUTO_OFFSET:4,IDENTITY:0},IU={click:{handler:"onClick"},panstart:{handler:"onDragStart"},panmove:{handler:"onDrag"},panend:{handler:"onDragEnd"}},vt=new tI({id:"luma.gl"});function Oo(n,e){if(!n)throw new Error(e||"luma.gl: assertion failed.")}function mS(n){return"undefined"!=typeof WebGLRenderingContext&&n instanceof WebGLRenderingContext||"undefined"!=typeof WebGL2RenderingContext&&n instanceof WebGL2RenderingContext||Boolean(n&&Number.isFinite(n._version))}function In(n){return"undefined"!=typeof WebGL2RenderingContext&&n instanceof WebGL2RenderingContext||Boolean(n&&2===n._version)}function _S(n){return Oo(mS(n),"Invalid WebGLRenderingContext"),n}function eo(n){return Oo(In(n),"Requires WebGL2"),n}const Kv={};const Zv=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{globalThis.console&&globalThis.console.log&&globalThis.console.log("OESVertexArrayObject emulation library context restored"),t.reset_()},!0),this.reset_()};Qf.prototype.VERTEX_ARRAY_BINDING_OES=34229,Qf.prototype.reset_=function(){if(void 0!==this.vertexArrayObjects)for(let i=0;iIn(n)?void 0:0,Ale={3074:n=>In(n)?void 0:36064,35723:n=>In(n)?void 0:4352,35977:Bi,32937:Bi,36795:(n,e)=>{const t=In(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(kU);return e(t&&t.UNMASKED_VENDOR_WEBGL||7936)},37446:(n,e)=>{const t=n.getExtension(kU);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:Bi,35071:Bi,37447:Bi,36063:(n,e)=>{if(!In(n)){const t=n.getExtension(RU);return t?e(t.MAX_COLOR_ATTACHMENTS_WEBGL):0}},35379:Bi,35374:Bi,35377:Bi,34852:n=>{if(!In(n)){const e=n.getExtension(RU);return e?e.MAX_DRAW_BUFFERS_WEBGL:0}},36203:n=>n.getExtension(PU)?2147483647:65535,33001:n=>n.getExtension(PU)?16777216:65535,33e3:n=>16777216,37157:Bi,35373:Bi,35657:Bi,36183:Bi,37137:Bi,34045:Bi,35978:Bi,35979:Bi,35968:Bi,35376:Bi,35375:Bi,35659:Bi,37154:Bi,35371:Bi,35658:Bi,35076:Bi,35077:Bi,35380:Bi},FU="ANGLE_instanced_arrays",NU={OES_vertex_array_object:{meta:{suffix:"OES"},createVertexArray:()=>{Oo(!1,"VertexArray requires WebGL2 or OES_vertex_array_object extension")},deleteVertexArray:()=>{},bindVertexArray:()=>{},isVertexArray:()=>!1},[FU]:{meta:{suffix:"ANGLE"},vertexAttribDivisor(n,e){Oo(0===e,"WebGL instanced rendering not supported")},drawElementsInstanced:()=>{},drawArraysInstanced:()=>{}},WEBGL_draw_buffers:{meta:{suffix:"WEBGL"},drawBuffers:()=>{Oo(!1)}},EXT_disjoint_timer_query:{meta:{suffix:"EXT"},createQuery:()=>{Oo(!1)},deleteQuery:()=>{Oo(!1)},beginQuery:()=>{Oo(!1)},endQuery:()=>{},getQuery(n,e){return this.getQueryObject(n,e)},getQueryParameter(n,e){return this.getQueryObject(n,e)},getQueryObject:()=>{}}},nI={readBuffer:(n,e,t)=>{In(n)&&e(t)},getVertexAttrib:(n,e,t,i)=>{const{webgl2:r,ext:s}=function(n,e){return{webgl2:In(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(!In(n))switch(i){case 35967:return 35981;case 35971:case 35382:return 0}return e(t,i)},getInternalformatParameter:(n,e,t,i,r)=>{if(!In(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=Ale[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 zle(n,{extension:e,target:t,target2:i}){const r=NU[e];Oo(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)}}globalThis.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 Qf(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&&zle(n,{extension:t,target:n.luma,target2:n})}(n,NU),function(n,{target:e,target2:t}){Object.keys(nI).forEach(i=>{if("function"==typeof nI[i]){const r=n[i]?n[i].bind(n):()=>{},s=nI[i].bind(null,n,r);e[i]=s,t[i]=s}})}(n,{target:e,target2:n}),e.polyfilled=!0),n};const iI={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},uh=(n,e,t)=>e?n.enable(t):n.disable(t),LU=(n,e,t)=>n.hint(t,e),Aa=(n,e,t)=>n.pixelStorei(t,e);function Qv(n){return Array.isArray(n)||ArrayBuffer.isView(n)}const Hle={3042:uh,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:uh,2885:(n,e)=>n.cullFace(e),2929:uh,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:uh,35723:LU,36006:(n,e)=>{const t=In(n)?36009:36160;return n.bindFramebuffer(t,e)},2886:(n,e)=>n.frontFace(e),33170:LU,2849:(n,e)=>n.lineWidth(e),32823:uh,32824:"polygonOffset",10752:"polygonOffset",35977:uh,32938:"sampleCoverage",32939:"sampleCoverage",3089:uh,3088:(n,e)=>n.scissor(...e),2960:uh,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:Aa,3317:Aa,37440:Aa,37441:Aa,37443:Aa,3330:Aa,3332:Aa,3331:Aa,36010:(n,e)=>n.bindFramebuffer(36008,e),3314:Aa,32878:Aa,3316:Aa,3315:Aa,32877:Aa,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=Qv(e)?e:[e,e],n.blendEquationSeparate(...e)},blendFunc:(n,e)=>{e=Qv(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=Qv(e)?e:[e,e];const[t,i]=e;n.stencilMaskSeparate(1028,t),n.stencilMaskSeparate(1029,i)},stencilFunc:(n,e)=>{e=Qv(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=Qv(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 Er(n,e,t){return void 0!==e[n]?e[n]:t[n]}const $le={blendEquation:(n,e,t)=>n.blendEquationSeparate(Er(32777,e,t),Er(34877,e,t)),blendFunc:(n,e,t)=>n.blendFuncSeparate(Er(32969,e,t),Er(32968,e,t),Er(32971,e,t),Er(32970,e,t)),polygonOffset:(n,e,t)=>n.polygonOffset(Er(32824,e,t),Er(10752,e,t)),sampleCoverage:(n,e,t)=>n.sampleCoverage(Er(32938,e,t),Er(32939,e,t)),stencilFuncFront:(n,e,t)=>n.stencilFuncSeparate(1028,Er(2962,e,t),Er(2967,e,t),Er(2963,e,t)),stencilFuncBack:(n,e,t)=>n.stencilFuncSeparate(1029,Er(34816,e,t),Er(36003,e,t),Er(36004,e,t)),stencilOpFront:(n,e,t)=>n.stencilOpSeparate(1028,Er(2964,e,t),Er(2965,e,t),Er(2966,e,t)),stencilOpBack:(n,e,t)=>n.stencilOpSeparate(1029,Er(34817,e,t),Er(34818,e,t),Er(34819,e,t))},BU={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]})},Xc=(n,e)=>n.isEnabled(e),VU={3042:Xc,2884:Xc,2929:Xc,3024:Xc,32823:Xc,32926:Xc,32928:Xc,3089:Xc,2960:Xc,35977:Xc};function zU(n){for(const e in n)return!1;return!0}function Gle(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||iI)){const r=e,s=VU[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=VU[r];i[r]=s?s(n,Number(r)):n.getParameter(Number(r))}return i}(e):Object.assign({},iI),this.log=i,this._updateCache=this._updateCache.bind(this),Object.seal(this)}push(e={}){this.stateStack.push({})}pop(){Oo(this.stateStack.length>0),Xu(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){Oo(void 0!==s);const o=e[s],a=this.cache[s];Gle(o,a)||(t=!0,i=a,r&&!(s in r)&&(r[s]=a),this.cache[s]=o)}return{valueChanged:t,oldValue:i}}}function UU(n,e={}){const{enable:t=!0,copyState:i}=e;if(Oo(void 0!==i),!n.state){const{polyfillContext:r}=globalThis;r&&r(n),n.state=new Yle(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 s in BU)Wle(n,s,BU[s]);jU(n,"getParameter"),jU(n,"isEnabled")}return n.state.enable=t,n}function HU(n){Oo(n.state),n.state.pop()}function Xu(n,e){if(Oo(mS(n),"setParameters requires a WebGL context"),zU(e))return;const t={};for(const r in e){const s=Number(r),o=Hle[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)$le[r](n,e,i)}function rc(n,e,t){if(zU(e))return t(n);const{nocatch:i=!0}=e;let r;if(function(n){n.state||UU(n,{copyState:!1}),n.state.push()}(n),Xu(n,e),i)r=t(n),HU(n);else try{r=t(n)}finally{HU(n)}return r}function yS(){return!("object"==typeof process&&"[object process]"===String(process)&&!process.browser)||function(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;return!!(e&&e.indexOf("Electron")>=0)}()}function mm(n){const{luma:e}=n;if(n.canvas&&e){const{clientWidth:t}=e.canvasSizeInfo;return t?n.drawingBufferWidth/t:1}return 1}function rI(n,e,t=!0){return function(n,e,t,i,r){const s=$U(n[0],e,t);let o=GU(n[1],e,i,r),a=$U(n[0]+1,e,t);const l=a===t-1?a:a-1;let c;return a=GU(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,mm(n),n.drawingBufferWidth,n.drawingBufferHeight,t)}function $U(n,e,t){return Math.min(Math.round(n*e),t-1)}function GU(n,e,t,i){return i?Math.max(0,t-1-Math.round(n*e)):Math.min(Math.round(n*e),t-1)}const sI=yS(),tce=sI&&"undefined"!=typeof document,WU={webgl2:!0,webgl1:!0,throwOnError:!0,manageState:!0,canvas:null,debug:!1,width:800,height:600};function qU(n={}){Oo(sI,"createGLContext only available in the browser.\nCreate your own headless context or use 'createHeadlessContext' from @luma.gl/test-utils"),n=Object.assign({},WU,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?(tce&&"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=oI(r,n),function(n){const e=In(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);vt.info(1,`${e}${n.debug?" debug":""} context ${t?`(${t.vendor},${t.renderer})`:""}`)()}(r),r):null}function oI(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({},WU,e);const{manageState:t,debug:i}=e;return t&&UU(n,{copyState:!1,log:(...r)=>vt.log(1,...r)()}),sI&&i&&(globalThis.makeDebugContext?(n=globalThis.makeDebugContext(n,e),vt.level=Math.max(vt.level,1)):vt.warn('WebGL debug mode not activated. import "@luma.gl/debug" to enable.')()),n._instrumented=!0,n}function YU(){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 XU{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=YU(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(YU()-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 aI{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 XU?e:new XU(t,i)),this.stats[t]}}const Jv="8.5.12",Jf=new class{constructor(){this.stats=new Map}get(e){return this.stats.has(e)||this.stats.set(e,new aI({id:e})),this.stats.get(e)}};if(globalThis.luma&&globalThis.luma.VERSION!==Jv)throw new Error(`luma.gl - multiple VERSIONs detected: ${globalThis.luma.VERSION} vs ${Jv}`);function nt(n,e){if(!n)throw new Error(e||"luma.gl: assertion failed.")}function lI(n,e){if("string"!=typeof e)return e;const t=Number(e);if(!isNaN(t))return t;const i=n[e=e.replace(/^.*\./,"")];return nt(void 0!==i,`Accessing undefined constant GL.${e}`),i}function dh(n,e){e=Number(e);for(const t in n)if(n[t]===e)return`GL.${t}`;return String(e)}globalThis.luma||(yS()&&vt.log(1,`luma.gl ${Jv} - set luma.log.level=1 (or higher) to trace rendering`)(),globalThis.luma=globalThis.luma||{VERSION:Jv,version:Jv,log:vt,stats:Jf,globals:{modules:{},nodeIO:{}}}),globalThis;const cI={};function ea(n="id"){return cI[n]=cI[n]||1,`${n}-${cI[n]++}`}function KU(n){return nt("number"==typeof n,"Input must be a number"),n&&0==(n&n-1)}function _m(n){let e=!0;for(const t in n){e=!1;break}return e}function ZU(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 vt.removed(`Calling removed method ${e}.${o}: `,r)(),new Error(o)})})}const ym="Resource subclass must define virtual methods";class Ku{get[Symbol.toStringTag](){return"Resource"}constructor(e,t={}){_S(e);const{id:i,userData:r={}}=t;this.gl=e,this.gl2=e,this.id=i||ea(this[Symbol.toStringTag]),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[Symbol.toStringTag]||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={}){nt(e=lI(this.gl,e));const r=(this.constructor.PARAMETERS||{})[e];if(r){const s=In(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=In(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?dh(this.gl,l):l;o[f]=this.getParameter(l,e),i&&"GLenum"===c.type&&(o[f]=dh(this.gl,o[f]))}}return o}setParameter(e,t){nt(e=lI(this.gl,e));const r=(this.constructor.PARAMETERS||{})[e];if(r){const s=In(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=lI(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 ZU(this,e,t,i)}initialize(e){}_createHandle(){throw new Error(ym)}_deleteHandle(){throw new Error(ym)}_bindHandle(e){throw new Error(ym)}_getOptsFromHandle(){throw new Error(ym)}_getParameter(e,t){throw new Error(ym)}_setParameter(e,t){throw new Error(ym)}_context(){return this.gl.luma=this.gl.luma||{},this.gl.luma}_addStats(){const e=this[Symbol.toStringTag],t=Jf.get("Resource Counts");t.get("Resources Created").incrementCount(),t.get(`${e}s Created`).incrementCount(),t.get(`${e}s Active`).incrementCount()}_removeStats(){const e=this[Symbol.toStringTag];Jf.get("Resource Counts").get(`${e}s Active`).decrementCount()}_trackAllocatedMemory(e,t=this[Symbol.toStringTag]){const i=Jf.get("Memory Usage");i.get("GPU Memory").addCount(e),i.get(`${t} Memory`).addCount(e),this.byteLength=e}_trackDeallocatedMemory(e=this[Symbol.toStringTag]){const t=Jf.get("Memory Usage");t.get("GPU Memory").subtractCount(this.byteLength),t.get(`${e} Memory`).subtractCount(this.byteLength),this.byteLength=0}}function uI(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 eb(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 fce({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 ta.getBytesPerElement(this)}get BYTES_PER_VERTEX(){return ta.getBytesPerVertex(this)}_assign(e={}){return void 0!==(e=dI("Accessor",e,gce)).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 JU={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"},mce={removedProps:{},replacedProps:{bytes:"byteLength"},deprecatedProps:JU},_ce={removedProps:JU};class Ai extends Ku{get[Symbol.toStringTag](){return"Buffer"}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/ta.getBytesPerElement(e))}getVertexCount(e=this.accessor){return Math.round(this.byteLength/ta.getBytesPerVertex(e))}initialize(e={}){return ArrayBuffer.isView(e)&&(e={data:e}),Number.isFinite(e)&&(e={byteLength:e}),e=dI("Buffer",e,mce),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=dI("Buffer",e,_ce))&&this.setAccessor(e.accessor),this}setAccessor(e){return delete(e=Object.assign({},e)).buffer,this.accessor=new ta(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;nt(t);const o=this.gl.webgl2?36663:this.target;return this.gl.bindBuffer(o,this.handle),0!==r||void 0!==s?(eo(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 eo(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}={}){eo(this.gl);const s=eb(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 nt((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):(nt(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){nt(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=uI(e);return nt(s),this.setAccessor(new ta(this.accessor,{type:s})),this}_setByteLength(e,t=this.usage){nt(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/eb(this.accessor.type||5126,{clamped:!1}).BYTES_PER_ELEMENT;return this.getElementCount()-i}_inferType(e){this.accessor.type||this.setAccessor(new ta(this.accessor,{type:uI(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 vt.deprecated("Buffer.type","Buffer.accessor.type")(),this.accessor.type}get bytes(){return vt.deprecated("Buffer.bytes","Buffer.byteLength")(),this.byteLength}setByteLength(e){return vt.deprecated("setByteLength","reallocate")(),this.reallocate(e)}updateAccessor(e){return vt.deprecated("updateAccessor(...)","setAccessor(new Accessor(buffer.accessor, ...)")(),this.accessor=new ta(this.accessor,e),this}}const hI={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}},e4={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},t4={5126:4,5125:4,5124:4,5123:2,5122:2,5131:2,5120:1,5121:1},bce=[9729,9728],n4=globalThis.WebGLBuffer||function(){};class ep extends Ku{get[Symbol.toStringTag](){return"Texture"}static isSupported(e,t={}){const{format:i,linearFiltering:r}=t;let s=!0;return i&&(s=s&&function(n,e){const t=hI[e];if(!t)return!1;if(void 0===t.gl1&&void 0===t.gl2)return!0;const i=In(n)&&t.gl2||t.gl1;return"string"==typeof i?n.getExtension(i):i}(e,i),s=s&&(!r||function(n,e){const t=hI[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=ea("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(w=>this.initialize(Object.assign({},e,{pixels:w,data:w}))),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:y=!1,mipmaps:v=!0}=e;const{depth:C=0}=e;return({width:f,height:p,compressed:y,dataFormat:g,type:_}=this._deduceParameters({format:s,type:_,dataFormat:g,compressed:y,data:t,width:f,height:p})),this.width=f,this.height=p,this.depth=C,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)),v&&this._isNPOT()&&(vt.warn(`texture: ${this} is Non-Power-Of-Two, disabling mipmaping`)(),v=!1,this._updateForNPOT(l)),this.mipmaps=v,this.setImageData({data:t,width:f,height:p,depth:C,format:s,type:_,dataFormat:g,border:o,mipmaps:v,parameters:c,compressed:y}),v&&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:y}=this;y.bindTexture(this.target,this.handle);let v=null;({data:c,dataType:v}=this._getDataType({data:c,compressed:_}));let C,w=0;return rc(this.gl,l,()=>{switch(v){case"null":y.texImage2D(t,r,s,f,p,o,g,d,c);break;case"typed-array":y.texImage2D(t,r,s,f,p,o,g,d,c,a);break;case"buffer":C=eo(y),C.bindBuffer(35052,c.handle||c),C.texImage2D(t,r,s,f,p,o,g,d,a),C.bindBuffer(35052,null);break;case"browser-object":In(y)?y.texImage2D(t,r,s,f,p,o,g,d,c):y.texImage2D(t,r,s,g,d,c);break;case"compressed":for(const[x,N]of c.entries())y.compressedTexImage2D(t,x,N.format,N.width,N.height,o,N.data),w+=N.levelSize;break;default:nt(!1,"Unknown image data type")}}),this._trackAllocatedMemory("compressed"===v?w:c&&c.byteLength?c.byteLength:this.width*this.height*(e4[this.dataFormat]||4)*(t4[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:y={}}){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})),nt(0===this.depth,"texSubImage not supported for 3D textures"),i||(i=t),i&&i.data){const v=i;i=v.data,o=v.shape[0],a=v.shape[1]}i instanceof Ai&&(i=i.handle),this.gl.bindTexture(this.target,this.handle),rc(this.gl,y,()=>{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 n4){const v=eo(this.gl);v.bindBuffer(35052,i),v.texSubImage2D(e,l,r,s,o,a,f,d,g),v.bindBuffer(35052,null)}else In(this.gl)?eo(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 vt.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 Ai?{data:e.handle,dataType:"buffer"}:e instanceof n4?{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=hI[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},nt(r,"Could not deduced texture size"),nt(void 0===t||r.width===t,"Deduced texture width does not match supplied width"),nt(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:nt(!1);break;default:this.gl.texParameteri(this.target,e,t)}return this.gl.bindTexture(this.target,null),this}_isNPOT(){return!(In(this.gl)||!this.width||!this.height||KU(this.width)&&KU(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===bce.indexOf(t)&&(t=9729);break;case 10242:case 10243:33071!==t&&(t=33071)}return t}}function Cce(n,e){return nt("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 na extends ep{get[Symbol.toStringTag](){return"Texture2D"}static isSupported(e,t){return ep.isSupported(e,t)}constructor(e,t={}){_S(e),(t instanceof Promise||"string"==typeof t)&&(t={data:t}),"string"==typeof t.data&&(t=Object.assign({},t,{data:Cce(t.data)})),super(e,Object.assign({},t,{target:3553})),this.initialize(t),Object.seal(this)}}const tp="EXT_color_buffer_float",i4={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:tp,bpp:2},33327:{gl2:tp,bpp:4},34842:{gl2:tp,bpp:8},33326:{gl2:tp,bpp:4},33328:{gl2:tp,bpp:8},34836:{gl2:tp,bpp:16},35898:{gl2:tp,bpp:4}};class vm extends Ku{get[Symbol.toStringTag](){return"Renderbuffer"}static isSupported(e,{format:t}={format:null}){return!t||function(n,e,t){const i=t[e];if(!i)return!1;const r=In(n)&&i.gl2||i.gl1;return"string"==typeof r?n.getExtension(r):r}(e,t,i4)}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 nt(e,"Needs format"),this._trackDeallocatedMemory(),this.gl.bindRenderbuffer(36161,this.handle),0!==r&&In(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)*i4[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 l4="clear: bad arguments";function pI(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)),nt(0!==o,l4),rc(n,s,()=>{n.clear(o)})}function c4(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 yn(n){return function(){var e=this,t=arguments;return new Promise(function(i,r){var s=n.apply(e,t);function o(l){c4(s,i,r,o,a,"next",l)}function a(l){c4(s,i,r,o,a,"throw",l)}o(void 0)})}}const gI=[34069,34070,34071,34072,34073,34074];let Ace=(()=>{class n extends ep{get[Symbol.toStringTag](){return"TextureCube"}constructor(t,i={}){_S(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 yn(function*(){const{gl:d}=c,f=r||s,p=yield Promise.all(gI.map(g=>{const _=f[g];return Promise.all(Array.isArray(_)?_:[_])}));c.bind(),gI.forEach((g,_)=>{p[_].length>1&&!1!==c.opts.mipmaps&&vt.warn(`${c.id} has mipmap and multiple LODs.`)(),p[_].forEach((y,v)=>{t&&i?d.texImage2D(g,v,a,t,i,o,a,l,y):d.texImage2D(g,v,a,a,l,y)})}),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=gI,n})();class Dce extends ep{get[Symbol.toStringTag](){return"Texture3D"}static isSupported(e){return In(e)}constructor(e,t={}){eo(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),rc(this.gl,f,()=>{ArrayBuffer.isView(d)&&this.gl.texImage3D(this.target,e,t,i,r,s,o,a,l,d),d instanceof Ai&&(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*(e4[this.dataFormat]||4)*(t4[this.type]||1),"Texture"),this.loaded=!0,this}}function u4(n,e){nt(n instanceof na||n instanceof Ace||n instanceof Dce);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},e))}function Oce(n,e){const{gl:t,width:i,height:r,id:s}=n;return new ss(t,Object.assign({},e,{id:`framebuffer-for-${s}`,width:i,height:r,attachments:{36064:n}}))}function vS(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}=tb(n);nt(d);const{gl:p,handle:g,attachments:_}=d;a=a||d.width,l=l||d.height,36064===s&&null===g&&(s=1028),nt(_[s]),c=c||_[s].type,o=function(n,e,t,i,r){if(n)return n;return new(eb(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 nt(!1),0}}(t))}(o,c,r,a,l),c=c||uI(o);const y=p.bindFramebuffer(36160,g);return p.readPixels(t,i,a,l,r,c,o),p.bindFramebuffer(36160,y||null),f&&d.delete(),o}function mI(n,{sourceAttachment:e=36064,targetMaxHeight:t=Number.MAX_SAFE_INTEGER}={}){let i=vS(n,{sourceAttachment:e}),{width:r,height:s}=n;for(;s>t;)({data:i,width:r,height:s}=fce({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 nt(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&&vt.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){nt(void 0!==o,"Misspelled framebuffer binding point?");const a=Number(o),l=r[a];let c=l;if(c)if(c instanceof vm)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(ss.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)&&pI(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]}={}){eo(n),rc(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:nt(!1,l4)}})}(this.gl,{drawBuffer:l,value:a})}),this.gl.bindFramebuffer(36160,o||null),this}readPixels(e={}){return vt.error("Framebuffer.readPixels() is no logner supported, use readPixelsToArray(framebuffer)")(),null}readPixelsToBuffer(e={}){return vt.error("Framebuffer.readPixelsToBuffer()is no logner supported, use readPixelsToBuffer(framebuffer)")(),null}copyToDataUrl(e={}){return vt.error("Framebuffer.copyToDataUrl() is no logner supported, use copyToDataUrl(framebuffer)")(),null}copyToImage(e={}){return vt.error("Framebuffer.copyToImage() is no logner supported, use copyToImage(framebuffer)")(),null}copyToTexture(e={}){return vt.error("Framebuffer.copyToTexture({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null}blit(e={}){return vt.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=eo(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=dh(this.gl,r)),r}getAttachmentParameters(e=36064,t,i=this.constructor.ATTACHMENT_PARAMETERS||[]){const r={};for(const s of i)r[t?dh(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?dh(this.gl,s):s]=this.getAttachmentParameters(s,e)}return i}show(){return"undefined"!=typeof window&&window.open(mI(this),"luma-debug-texture"),this}log(e=0,t=""){if(e>vt.level||"undefined"==typeof window)return this;t=t||`Framebuffer ${this.id}`;const i=mI(this,{targetMaxHeight:100});return vt.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 na(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 vm(this.gl,{id:`${this.id}-depth-stencil`,format:35056,width:r,height:111}),this.ownResources.push(o[33306])):t?(o=o||{},o[36096]=new vm(this.gl,{id:`${this.id}-depth`,format:33189,width:r,height:s}),this.ownResources.push(o[36096])):i&&nt(!1),o}_unattach(e){const t=this.attachments[e];!t||(t instanceof vm?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:eo(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:nt(!1,"Illegal texture type")}s.bindTexture(t.target,null),this.attachments[e]=t}_setReadBuffer(e){const t=function(n){return In(n)?n:null}(this.gl);t?t.readBuffer(e):nt(36064===e||1029===e,d4),this.readBuffer=e}_setDrawBuffers(e){const{gl:t}=this,i=eo(t);if(i)i.drawBuffers(e);else{const r=t.getExtension("WEBGL_draw_buffers");r?r.drawBuffersWEBGL(e):nt(1===e.length&&(36064===e[0]||1029===e[0]),d4)}this.drawBuffers=e}_getAttachmentParameterFallback(e){const t=function(n){n.luma=n.luma||{},n.luma.caps=n.luma.caps||{};for(const e in h4)void 0===n.luma.caps[e]&&(n.luma.caps[e]=p4(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)}}ss.ATTACHMENT_PARAMETERS=[36049,36048,33296,33298,33299,33300,33301,33302,33303];const h4={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 na(n,{format:6408,type:5126,dataFormat:6408}),t=new ss(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 _I(n,e){return f4(n,e)}function f4(n,e){return(e=Array.isArray(e)?e:[e]).every(t=>p4(n,t))}function p4(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=h4[e];let i;nt(t,e);const r=In(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:nt(!1);return i}(n,e)),n.luma.caps[e]||vt.log(2,`Feature: ${e} not supported`)(),n.luma.caps[e]}class yI{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()}},Hce=(Math,1/180*Math.PI),Ji={};function Gce(n,{precision:e=Ji.precision||4}={}){return n=function(n){return Math.round(n/Ji.EPSILON)*Ji.EPSILON}(n),`${parseFloat(n.toPrecision(e))}`}function hh(n){return Array.isArray(n)||ArrayBuffer.isView(n)&&!(n instanceof DataView)}function Zu(n,e,t){if(hh(n)){t=t||function(n){return n.clone?n.clone():new Array(n.length)}(n);for(let i=0;it*Hce,void 0)}(n)}function np(n,e,t){return Zu(n,i=>Math.max(e,Math.min(t,i)))}function bS(n,e,t){return hh(n)?n.map((i,r)=>bS(i,e[r],t)):t*e+(1-t)*n}function rb(n,e,t){const i=Ji.EPSILON;t&&(Ji.EPSILON=t);try{if(n===e)return!0;if(hh(n)&&hh(e)){if(n.length!==e.length)return!1;for(let r=0;r0?", ":"")+Gce(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&&(M4.length=n.length,i=M4):i=S4,(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 x4(n){return n&&n[Symbol.asyncIterator]}function EI(n,e=(()=>!0)){return Array.isArray(n)?T4(n,e,[]):e(n)?[n]:[]}function T4(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 A4(n,e){return n?(Number.isFinite(n)&&(n={duration:n}),n.type=n.type||"interpolation",K(K(K({},Mue[n.type]),e),n)):null}function D4(n,e){return e.getBuffer()?[e.getBuffer(),{divisor:0,size:e.size,normalized:e.settings.normalized}]:e.value}function O4(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 I4(n){n.push(n.shift())}function MI(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 P4({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=MI(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 C=s;s=(w,x)=>t._normalizeConstant(C(w,x))}const _=p?(C,w)=>s(g,w):(C,w)=>s(g.subarray(C,C+a),w),y=n.getData({length:i}),v=new Float32Array(f);(function({source:n,target:e,size:t,getData:i,sourceStartIndices:r,targetStartIndices:s}){if(!Array.isArray(s))return SI({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===MS||(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=MS}clearNeedsUpdate(){this.state.needsUpdate=!1,this.state.updateRanges=wue}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!==MS}),!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 v=f*a+l;for(let C=0;Cd?c.set(x,y):(e._normalizeValue(x,C.target,0),Cue({target:c,source:C.target,start:y,count:N}));y+=N*d}else e._normalizeValue(x,c,y),y+=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 TI={};function no(n){jn.level>0&&TI[n]&&TI[n].call(...arguments)}function Da(n,e){if(!n)throw new Error(e||"shadertools: assertion failed.")}const R4="out vec4 transform_output;\nvoid main() {\n transform_output = vec4(0);\n}",Aue=`#version 300 es\n${R4}`;function k4(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 F4(n={}){const{version:e=100,input:t,inputType:i,output:r}=n;if(!t)return 300===e?Aue:e>300?`#version ${e}\n${R4}`:"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 Da(!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 N4 extends Ku{get[Symbol.toStringTag](){return"TransformFeedback"}static isSupported(e){return In(e)}constructor(e,t={}){eo(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,_m(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,vt.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 Ai?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 Pue{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 Ai?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&&nt(In(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 N4(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],nt(i[s]instanceof Ai)}return{sourceBuffers:t,feedbackBuffers:i}}_createNewBuffer(e,t){const i=new Ai(this.gl,t);return this.resources[e]&&this.resources[e].delete(),this.resources[e]=i,i}_getNextIndex(){return(this.currentIndex+1)%2}}function L4(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 ab="vs",Fue={[ab]:"#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"},xS="__LUMA_INJECT_DECLARATIONS__",B4=/void\s+main\s*\([^)]*\)\s*\{\n?/,V4=/}\n?[^{}]*$/,DI=[];function z4(n,e,t,i=!1){const r=e===ab;for(const s in t){const o=t[s];o.sort((l,c)=>l.order-c.order),DI.length=o.length;for(let l=0,c=o.length;ll+a));break;case"vs:#main-end":r&&(n=n.replace(V4,l=>a+l));break;case"fs:#decl":r||(n=n.replace(xS,a));break;case"fs:#main-start":r||(n=n.replace(B4,l=>l+a));break;case"fs:#main-end":r||(n=n.replace(V4,l=>a+l));break;default:n=n.replace(s,l=>l+a)}}return n=n.replace(xS,""),i&&(n=n.replace(/\}\s*$/,s=>s+Fue[e])),n}function OI(n){const e={};return Da(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 Nue={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},TS="transform_uSize_",j4="transform_position";const $ue={10241:9728,10240:9728,10242:33071,10243:33071};class Wue{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[`${TS}${e}`]=[r,s]);for(const o in n)({width:r,height:s}=n[o]),i[`${TS}${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=vS(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 Da(!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 Ai(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 ss(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($ue)}_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=u4(e,{parameters:{10241:9728,10240:9728,10242:33071,10243:33071},pixelStore:{37440:!1}});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 y=function(n,e){const t={},i=function(n){return k4(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=`${TS}${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 Da(!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(y){const{updatedLine:v,inject:C}=y;f[g]=v,c=OI([c,C]),Object.assign(a,y.samplerTextureMap),s--}}t&&!o&&(o=function(n,e){const t=k4(n,["varying","out"]);return t&&t.name===e?t.type:null}(p,t))}),t){nt(i);const p=`${TS}${t}`;c=OI([c,{"vs:#decl":`uniform vec2 ${p};\n`,"vs:#main-start":` vec2 ${j4} = transform_getPos(${p});\n gl_Position = vec4(${j4}, 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=OI([e.inject||{},a]);return this.targetTextureType=o,this.samplerTextureMap=l,{vs:r,fs:e._fs||F4({version:L4(r),input:this.targetTextureVarying,inputType:o,output:"transform_output"}),modules:this.hasSourceTextures||this.targetTextureVarying?[Nue].concat(e.modules||[]):e.modules,uniforms:s,inject:c}}}const II={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 Yue(n){let e=U4(n);return"object"===e?n?"type"in n?Object.assign({},n,II[n.type]):"value"in n?(e=U4(n.value),Object.assign({type:e},n,II[e])):{type:"object",value:n}:{type:"object",value:null}:Object.assign({type:e,value:n},II[e])}function U4(n){return Array.isArray(n)||ArrayBuffer.isView(n)?"array":typeof n}class PI{constructor({name:e,vs:t,fs:i,dependencies:r=[],uniforms:s,getUniforms:o,deprecations:a=[],defines:l={},inject:c={},vertexShader:d,fragmentShader:f}){Da("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=Yue(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:Da(!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&&Da(s.validate(e[r],s),`${this.name}: invalid ${r}`),t[r]=e[r]):t[r]=s.value}return t}}function Que(n){return function(n){const e={},t={};return RI({modules:n,level:0,moduleMap:e,moduleDepth:t}),Object.keys(t).sort((i,r)=>t[r]-t[i]).map(i=>e[i])}($4(n))}function RI({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 PI||(Da("string"!=typeof t,`Shader module use by name is deprecated. Import shader module '${t}' and use it directly.`),Da(t.name,"shader module has no name"),(t=new PI(t)).dependencies=$4(t.dependencies)),t))}const kI={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]},ip={};function ode(n,e){return n.match(/NVIDIA/i)||e.match(/NVIDIA/i)?"NVIDIA":n.match(/INTEL/i)||e.match(/INTEL/i)?"INTEL":n.match(/AMD/i)||e.match(/AMD/i)||n.match(/ATI/i)||e.match(/ATI/i)?"AMD":"UNKNOWN GPU"}Object.keys(kI).forEach(n=>{ip[n]=n});const FI={};function G4(n,e,t={}){const i=kI[e];if(Da(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 FI)return FI[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),FI[e]=l,l}function AS(n,e){return(e=Array.isArray(e)?e:[e]).every(t=>function(n,e){const t=kI[e];Da(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 Da(!1===r||!0===r),r}(n,t))}function Cm(n){return new RegExp(`\\b${n}[ \\t]+(\\w+[ \\t]+\\w+(\\[\\w+\\])?;)`,"g")}const W4=[[/^(#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("]],ude=[...W4,[Cm("attribute"),"in $1"],[Cm("varying"),"out $1"]],dde=[...W4,[Cm("varying"),"in $1"]],q4=[[/^#version[ \t]+300[ \t]+es/,"#version 100"],[/\btexture(2D|2DProj|Cube)Lod\(/g,"texture$1LodEXT("],[/\btexture\(/g,"texture2D("],[/\btextureLod\(/g,"texture2DLodEXT("]],hde=[...q4,[Cm("in"),"attribute $1"],[Cm("out"),"varying $1"]],fde=[...q4,[Cm("in"),"varying $1"]],NI="gl_FragColor",LI=/\bout[ \t]+vec4[ \t]+(\w+)[ \t]*;\n?/,pde=/void\s+main\s*\([^)]*\)\s*\{\n?/;function DS(n,e){for(const[t,i]of e)n=n.replace(t,i);return n}const yde=`\n\n${xS}\n\n`,Y4={[ab]:"vertex",fs:"fragment"};function X4(n,{id:e,source:t,type:i,modules:r,defines:s={},hookFunctions:o=[],inject:a={},transpileToGLSL100:l=!1,prologue:c=!0,log:d}){Da("string"==typeof t,"shader source must be a string");const f=i===ab,p=t.split("\n");let g=100,_="",y=t;0===p[0].indexOf("#version ")?(g=300,_=p[0],y=p.slice(1).join("\n")):_=`#version ${g}`;const v={};r.forEach(U=>{Object.assign(v,U.getDefines())}),Object.assign(v,s);let C=c?`${_}\n${function({id:n,source:e,type:t}){return n&&"string"==typeof n&&-1===e.indexOf("SHADER_NAME")?`\n#define SHADER_NAME ${n}_${Y4[t]}\n\n`:""}({id:e,source:t,type:i})}\n${function({type:n}){return`\n#define SHADER_TYPE_${Y4[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:ode(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// 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"}}(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 AS(n,ip.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"),AS(n,ip.GLSL_DERIVATIVES)&&G4(n,ip.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"),AS(n,ip.GLSL_FRAG_DATA)&&G4(n,ip.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"),AS(n,ip.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}(v)}\n${f?"":"precision highp float;\n\n"}\n`:`${_}\n`;const w=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),x={},N={},V={};for(const U in a){const ee="string"==typeof a[U]?{injection:a[U],order:0}:a[U],de=U.match(/^(v|f)s:(#)?([\w-]+)$/);if(de){const me=de[3];de[2]?"decl"===me?N[U]=[ee]:V[U]=[ee]:x[U]=[ee]}else V[U]=[ee]}for(const U of r){d&&U.checkDeprecations(y,d),C+=U.getModuleSource(i,g);const de=U.injections[i];for(const ae in de){const me=ae.match(/^(v|f)s:#([\w-]+)$/);if(me){const Be="decl"===me[2]?N:V;Be[ae]=Be[ae]||[],Be[ae].push(de[ae])}else x[ae]=x[ae]||[],x[ae].push(de[ae])}}return C+=yde,C=z4(C,i,N),C+=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}(w[i],x),C+=y,C=z4(C,i,V),C=function(n,e,t){switch(e){case 300:return t?DS(n,ude):function(n){const e=(n=DS(n,dde)).match(LI);if(e){const t=e[1];n=n.replace(new RegExp(`\\b${NI}\\b`,"g"),t)}else{const t="fragmentColor";n=n.replace(pde,i=>`out vec4 ${t};\n${i}`).replace(new RegExp(`\\b${NI}\\b`,"g"),t)}return n}(n);case 100:return t?DS(n,hde):function(n){const e=(n=DS(n,fde)).match(LI);if(e){const t=e[1];n=n.replace(LI,"").replace(new RegExp(`\\b${t}\\b`,"g"),NI)}return n}(n);default:throw new Error(`unknown GLSL version ${e}`)}}(C,l?100:g,f),C}function Cde(n){return function(t){const i={};for(const r of n){const s=r.getUniforms(t,i);Object.assign(i,s)}return i}}const Tde={5126:er.bind(null,"uniform1fv",Oa,1,io),35664:er.bind(null,"uniform2fv",Oa,2,io),35665:er.bind(null,"uniform3fv",Oa,3,io),35666:er.bind(null,"uniform4fv",Oa,4,io),5124:er.bind(null,"uniform1iv",fh,1,io),35667:er.bind(null,"uniform2iv",fh,2,io),35668:er.bind(null,"uniform3iv",fh,3,io),35669:er.bind(null,"uniform4iv",fh,4,io),35670:er.bind(null,"uniform1iv",fh,1,io),35671:er.bind(null,"uniform2iv",fh,2,io),35672:er.bind(null,"uniform3iv",fh,3,io),35673:er.bind(null,"uniform4iv",fh,4,io),35674:er.bind(null,"uniformMatrix2fv",Oa,4,Ju),35675:er.bind(null,"uniformMatrix3fv",Oa,9,Ju),35676:er.bind(null,"uniformMatrix4fv",Oa,16,Ju),35678:Fs,35680:Fs,5125:er.bind(null,"uniform1uiv",OS,1,io),36294:er.bind(null,"uniform2uiv",OS,2,io),36295:er.bind(null,"uniform3uiv",OS,3,io),36296:er.bind(null,"uniform4uiv",OS,4,io),35685:er.bind(null,"uniformMatrix2x3fv",Oa,6,Ju),35686:er.bind(null,"uniformMatrix2x4fv",Oa,8,Ju),35687:er.bind(null,"uniformMatrix3x2fv",Oa,6,Ju),35688:er.bind(null,"uniformMatrix3x4fv",Oa,12,Ju),35689:er.bind(null,"uniformMatrix4x2fv",Oa,8,Ju),35690:er.bind(null,"uniformMatrix4x3fv",Oa,12,Ju),35678:Fs,35680:Fs,35679:Fs,35682:Fs,36289:Fs,36292:Fs,36293:Fs,36298:Fs,36299:Fs,36300:Fs,36303:Fs,36306:Fs,36307:Fs,36308:Fs,36311:Fs},Ade={},Dde={},Ode={},K4=[0];function BI(n,e,t,i){1===e&&"boolean"==typeof n&&(n=n?1:0),Number.isFinite(n)&&(K4[0]=n,n=K4);const r=n.length;if(r%e&&vt.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 er(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{nt(s===d,"Uniform length cannot change.");for(let p=0;p{const a=String(o+e);return e5(a,r-a.length)+t+s})}(e);return{shaderName:l,errors:J4(s,c),warnings:J4(o,c)}}(i,this.source,this.shaderType,this.id);throw vt.error(`GLSL compilation errors in ${r}\n${s}`)(),vt.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 VI extends lb{get[Symbol.toStringTag](){return"VertexShader"}constructor(e,t){"string"==typeof t&&(t={source:t}),super(e,Object.assign({},t,{shaderType:35633}))}_createHandle(){return this.gl.createShader(35633)}}class zI extends lb{get[Symbol.toStringTag](){return"FragmentShader"}constructor(e,t){"string"==typeof t&&(t={source:t}),super(e,Object.assign({},t,{shaderType:35632}))}_createHandle(){return this.gl.createShader(35632)}}const os=5126,cb=5124,ub=5125,jI={[os]:[os,1,"float"],35664:[os,2,"vec2"],35665:[os,3,"vec3"],35666:[os,4,"vec4"],[cb]:[cb,1,"int"],35667:[cb,2,"ivec2"],35668:[cb,3,"ivec3"],35669:[cb,4,"ivec4"],[ub]:[ub,1,"uint"],36294:[ub,2,"uvec2"],36295:[ub,3,"uvec3"],36296:[ub,4,"uvec4"],35670:[os,1,"bool"],35671:[os,2,"bvec2"],35672:[os,3,"bvec3"],35673:[os,4,"bvec4"],35674:[os,8,"mat2"],35685:[os,8,"mat2x3"],35686:[os,8,"mat2x4"],35675:[os,12,"mat3"],35687:[os,12,"mat3x2"],35688:[os,12,"mat3x4"],35676:[os,16,"mat4"],35689:[os,16,"mat4x2"],35690:[os,16,"mat4x3"]};function o5(n){const e=jI[n];if(!e)return null;const[t,i]=e;return{type:t,components:i}}function a5(n,e){switch(n){case 5120:case 5121:case 5122:case 5123:n=os}for(const t in jI){const[i,r,s]=jI[t];if(i===n&&r===e)return{glType:t,name:s}}return null}class phe{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(!In(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}=o5(i),a={type:s,size:r*o};this._inferProperties(e,t,a);const l={location:e,name:t,accessor:new ta(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}=o5(i),l={location:e,name:t,accessor:new ta({type:s,size:r*o})};this.varyingInfos.push(l),this.varyingInfosByName[l.name]=l}}const ghe=35981,mhe=["setVertexArray","setAttributes","setBuffers","unsetBuffers","use","getUniformCount","getUniformInfo","getUniformLocation","getUniformValue","getVarying","getFragDataLocation","getAttachedShaders","getAttributeCount","getAttributeLocation","getAttributeInfo"];class c5 extends Ku{get[Symbol.toStringTag](){return"Program"}constructor(e,t={}){super(e,t),this.stubRemovedMethods("Program","v6.0",mhe),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=ghe}=e;return this.hash=t||"",this.vs="string"==typeof i?new VI(this.gl,{id:`${e.id}-vs`,source:i}):i,this.fs="string"==typeof r?new zI(this.gl,{id:`${e.id}-fs`,source:r}):r,nt(this.vs instanceof VI),nt(this.fs instanceof zI),this.uniforms={},this._textureUniforms={},s&&s.length>0&&(eo(this.gl),this.varyings=s,this.gl2.transformFeedbackVaryings(this.handle,s,o)),this._compileAndLink(),this._readUniformLocationsFromLinkedProgram(),this.configuration=new phe(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:y,samplers:v}){if((y||v)&&(vt.deprecated("Program.draw({uniforms})","Program.setUniforms(uniforms)")(),this.setUniforms(y||{})),vt.priority>=e){const C=g?g.id:"default",w=`mode=${dh(this.gl,t)} verts=${i} instances=${c} indexType=${dh(this.gl,l)} isInstanced=${d} isIndexed=${a} Framebuffer=${C}`;vt.log(e,w)()}return nt(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 C=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 nt(!1),0}}(t);p.begin(C)}this._bindTextures(),rc(this.gl,_,()=>{a&&d?this.gl2.drawElementsInstanced(t,i,l,r,c):a&&In(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={}){vt.priority>=2&&function(n,e,t){for(const i in n){const r=n[i];if((!t||Boolean(t[i]))&&!Rde(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 ss&&(s=s.texture),s instanceof ep)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)&&kde(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 VI({handle:r});break;case 35632:i.fs=new zI({handle:r})}return i}_getParameter(e){return this.gl.getProgramParameter(this.handle,e)}_setId(e){if(!e){const t=this._getName();this.id=ea(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),vt.time(4,`linkProgram for ${this._getName()}`)(),e.linkProgram(this.handle),vt.timeEnd(4,`linkProgram for ${this._getName()}`)(),e.debug||vt.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(x=>this._getHash(x.name)).sort(),g=o.map(x=>this._getHash(x)),_=Object.keys(r).sort(),y=Object.keys(s).sort(),v=[],C=[];for(const x of _)v.push(this._getHash(x)),v.push(this._getHash(r[x]));for(const x of y)C.push(this._getHash(x)),C.push(this._getHash(s[x]));const w=`${d}/${f}D${v.join("/")}M${p.join("/")}I${C.join("/")}V${g.join("/")}H${this.stateHash}B${a}${l?"T":""}`;if(!this._programCache[w]){const x=function(n,e){const{vs:t,fs:i}=e,r=Que(e.modules||[]);return{gl:n,vs:X4(n,Object.assign({},e,{source:t,type:ab,modules:r})),fs:X4(n,Object.assign({},e,{source:i,type:"fs",modules:r})),getUniforms:Cde(r)}}(this.gl,{vs:t,fs:i,modules:c,inject:s,defines:r,hookFunctions:this._hookFunctions,transpileToGLSL100:l});this._programCache[w]=new c5(this.gl,{hash:w,vs:x.vs,fs:x.fs,varyings:o,bufferMode:a}),this._getUniforms[w]=x.getUniforms||(N=>{}),this._useCounts[w]=0}return this._useCounts[w]++,this._programCache[w]}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":Xv.chrome?"Chrome":Xv.safari?"Safari":Xv.mozInnerScreenX?"Firefox":"Unknown"}()}static getDefaultArray(e){return e.luma=e.luma||{},e.luma.defaultVertexArray||(e.luma.defaultVertexArray=new Ia(e,{handle:null,isDefaultArray:!0})),e.luma.defaultVertexArray}static getMaxAttributes(e){return Ia.MAX_ATTRIBUTES=Ia.MAX_ATTRIBUTES||e.getParameter(34921),Ia.MAX_ATTRIBUTES}static setConstant(e,t,i){switch(i.constructor){case Float32Array:Ia._setConstantFloatArray(e,t,i);break;case Int32Array:Ia._setConstantIntArray(e,t,i);break;case Uint32Array:Ia._setConstantUintArray(e,t,i);break;default:nt(!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 Ia.getMaxAttributes(this.gl)}initialize(e={}){return this.setProps(e)}setProps(e){return this}setElementBuffer(e=null,t={}){return nt(!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?(nt(In(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&&!Ia.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 Ai(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(!RS||RS.byteLength{switch(e){case 34373:return this.gl.getVertexAttribOffset(t,e);default:return this.gl.getVertexAttrib(t,e)}})}}const Ehe=/^(.+)__LOCATION_([0-9]+)$/,She=["setBuffers","setGeneric","clearBindings","setLocations","setGenericValues","setDivisor","enable","disable"];class Mhe{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 Ia(e),ZU(this,"VertexArray","v6.0",She),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 Ai(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,vt.once(3,()=>`unused value ${e} in ${this.id}`)(),s;const l=this._getAttributeInfo(a||o);if(!l)return s;const d=ta.resolve(l.accessor,this.accessors[o]||{},i,r),{size:f,type:p}=d;return nt(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=Ehe.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 Ai)this.setBuffer(e,t);else if(Array.isArray(t)&&t.length&&t[0]instanceof Ai)this.setBuffer(e,t[0],t[1]);else if(ArrayBuffer.isView(t)||Array.isArray(t))this.setConstant(e,t);else{if(!(t.buffer instanceof Ai))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 Ai){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 vt.deprecated("setElements","setElementBuffer")(),this.setElementBuffer(e,t)}}function hb(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+=hb(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 u5(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 Ai){const p=e,{data:g,changed:_}=p.getDebugData();let y;return d=_?"*":"",f=g,l=p.byteLength,a=l/g.BYTES_PER_ELEMENT/o,t?y=`${t.divisor>0?"I ":"P "} ${a} (x${o}=${l} bytes ${dh(r,s)})`:(c=!0,y=`${l} bytes`),{[i]:`${d}${hb(f,{size:o,isInteger:c})}`,"Format ":y}}return f=e,o=e.length,s=String(e.constructor.name).replace("Array",""),c=-1!==s.indexOf("nt"),{[i]:`${hb(f,{size:o,isInteger:c})} (constant)`,"Format ":`${o}x${s} (constant)`}}function Ahe(n,e){const{type:t,size:i}=e,r=a5(t,i);return r?`${n} (${r.name})`:n}function d5({header:n="Uniforms",program:e,uniforms:t,undefinedOnly:i=!1}){nt(e);const s=".*Matrix",a={},l=Object.keys(e._uniformSetters).sort();let c=0;for(const p of l)!p.match(".*_.*")&&!p.match(s)&&UI({table:a,header:n,uniforms:t,uniformName:p,undefinedOnly:i})&&c++;for(const p of l)p.match(s)&&UI({table:a,header:n,uniforms:t,uniformName:p,undefinedOnly:i})&&c++;for(const p of l)a[p]||UI({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]:hb(g)})}return{table:a,count:c,unusedTable:f,unusedCount:d}}function UI({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?hb(s):"N/A","Uniform Type":o?s:"NOT PROVIDED"},0))}function h5(n){const{type:e,size:t}=n.accessor,i=a5(e,t);return i?`${i.name} ${n.name}`:n.name}const Ihe={POSITION:"positions",NORMAL:"normals",COLOR_0:"colors",TEXCOORD_0:"texCoords",TEXCOORD_1:"texCoords1",TEXCOORD_2:"texCoords2"};function Rhe(n,e){const{attributeMap:t=Ihe}=e||{};return t&&t[n]||n}function khe(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}nt(Number.isFinite(e.size),`attribute ${n} needs size`)}const f5=()=>{},Lhe={};class Mm{constructor(e,t={}){const{id:i=ea("model")}=t;nt(mS(e)),this.id=i,this.gl=e,this.id=t.id||ea("Model"),this.lastLogTime=0,this.animated=!1,this.initialize(t)}initialize(e){this.props={},this.programManager=e.programManager||db.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={},nt(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 nt(Number.isFinite(e)),this.vertexCount=e,this}setInstanceCount(e){return nt(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=Rhe(s,undefined);if("indices"===s)r=o;else if(o.constant)i[a]=o.value;else{const l=o.value,c=K({},o);delete c.value,i[a]=[new Ai(n,l),c],khe(s,c)}}if(r){const s=r.value||r;nt(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 Ai(n,{data:s,target:34963}),o]}return i}(this.gl,e),this.vertexArray.setAttributes(this.geometryBuffers),this}setAttributes(e={}){if(_m(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 pI(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),vt.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&&vt.warn("Found instanced attributes on non-instanced model",this.id)();const{isInstanced:y,instanceCount:v}=this,{onBeforeRender:C=f5,onAfterRender:w=f5}=this.props;C(),this.program.setUniforms(this.uniforms);const x=this.program.draw(Object.assign(Lhe,e,{logPriority:c,uniforms:null,framebuffer:i,parameters:a,drawMode:this.getDrawMode(),vertexCount:this.getVertexCount(),vertexArray:l,transformFeedback:o,isIndexed:f,indexType:p,isInstanced:y,instanceCount:v,offset:f?g:0}));return w(),vt.priority>=2&&this._logDrawCallEnd(c,l,i),x}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 vt.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}nt(t instanceof c5,"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 Mhe(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 Ai&&t.delete()}}_setAnimationProps(e){this.animated&&nt(e,"Model.draw(): animated uniforms but no animationProps")}_setFeedbackBuffers(e={}){if(_m(e))return this;const{gl:t}=this.program;return this.transformFeedback=this.transformFeedback||new N4(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:vt.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=u5(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}: ${Ahe(s.name,a)}`),t[o]=u5(n,i[r],a,e)}}return t}({vertexArray:t,header:`${this.id} attributes`,attributes:this._attributes}),{table:o,unusedTable:a,unusedCount:l}=d5({header:`${this.id} uniforms`,program:this.program,uniforms:Object.assign({},this.program.uniforms,i)}),{table:c,count:d}=d5({header:`${this.id} uniforms`,program:this.program,uniforms:Object.assign({},this.program.uniforms,i),undefinedOnly:!0});d>0&&vt.log("MISSING UNIFORMS",Object.keys(c))(),l>0&&vt.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 ${h5(i)}`]={[t]:JSON.stringify(i.accessor)});for(const i of n.varyingInfos)i&&(e[`out ${h5(i)}`]={[t]:JSON.stringify(i.accessor)});return e}(this.vertexArray.configuration);vt.table(e,s)(),vt.table(e,o)(),vt.table(e+1,f)(),r&&r.log({logLevel:2,message:`Rendered to ${r.id}`}),vt.groupEnd(2,`>>> DRAWING MODEL ${this.id}`)()}}class HI{static isSupported(e){return In(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();nt(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 Mm(t,Object.assign({},e,{fs:e.fs||F4({version:L4(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!(_m(n.feedbackBuffers)&&_m(n.feedbackMap)&&!(n.varyings&&n.varyings.length>0))})(t)&&(this.bufferTransform=new Pue(e,t)),function(n){return!(_m(n._sourceTextures)&&!n._targetTexture&&!n._targetTextureVarying)}(t)&&(this.textureTransform=new Wue(e,t)),nt(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 kS(){}const zhe={onStart:kS,onUpdate:kS,onInterrupt:kS,onEnd:kS};class fb{constructor(e){this._inProgress=!1,this._handle=null,this.timeline=e,this.settings={}}get inProgress(){return this._inProgress}start(e){this.cancel(),this.settings=K(K({},zhe),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 Yhe={interpolation:class{constructor({gl:e,attribute:t,timeline:i}){this.gl=e,this.type="interpolation",this.transition=new fb(i),this.attribute=t,this.attributeInTransition=new xI(e,t.settings),this.currentStartIndices=t.startIndices,this.currentLength=0,this.transform=function(n,e){const t=O4(e.size);return new HI(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 Ai(e,r),new Ai(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;I4(r);const o={numInstances:t,attribute:s,fromLength:this.currentLength,fromStartIndices:this.currentStartIndices,getData:e.enter};for(const a of r)P4(K({buffer:a},o));this.currentStartIndices=s.startIndices,this.currentLength=MI(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:D4(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 fb(i),this.attribute=t,this.attributeInTransition=new xI(e,Lt(K({},t.settings),{normalized:!1})),this.currentStartIndices=t.startIndices,this.currentLength=0,this.texture=function(n){return new na(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 ss(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=O4(e.size);return new HI(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 Ai(e,r),new Ai(e,r),new Ai(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)P4(K({buffer:a},o));this.currentStartIndices=s.startIndices,this.currentLength=MI(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:D4(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]}}),I4(e),this.attributeInTransition.update({buffer:e[1],value:this.attribute.value}),vS(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 Xhe{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=HI.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 jn.warn("WebGL2 not supported by this browser. Transition for ".concat(e," is disabled."))();r&&this._removeTransition(e);const o=Yhe[i.type];o?this.transitions[e]=new o({attribute:t,timeline:this.timeline,gl:this.gl}):(jn.error("unsupported transition type '".concat(i.type,"'"))(),s=!1)}(s||t.needsRedraw())&&(this.needsRedraw=!0,this.transitions[e].start(i,this.numInstances))}}const p5="attributeManager.invalidate";class tfe{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 Xhe(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;no("attribute.updateStart",t),t.allocate(i)&&no("attribute.allocate",t,i),t.updateBuffer(e)&&(this.needsRedraw=!0,no("attribute.updateEnd",t,i))}}function m5(n,e,t,i,r){const s=e-n;return(t-e)*r+-s*i+s+e}function _5(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=A4(r)))return;const o=sfe[r.type];if(!o)return void jn.error("unsupported transition type '".concat(r.type,"'"))();const a=new o(this.timeline);a.start(Lt(K({},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 FS={COMPONENT:Symbol.for("component"),ASYNC_DEFAULTS:Symbol.for("asyncPropDefaults"),ASYNC_ORIGINAL:Symbol.for("asyncPropOriginal"),ASYNC_RESOLVED:Symbol.for("asyncPropResolved")},{COMPONENT:afe}=FS;function ufe(n,e){if(!n.transitions)return null;const t={},i=GI(n);for(const r in n.transitions){const s=i[r],o=s&&s.type;("number"===o||"color"===o||"array"===o)&&$I(n[r],e[r],s)&&(t[r]=!0)}return t}function y5({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=$I(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=$I(n[s],e[s],i[s]);if(o)return"".concat(r,".").concat(s," ").concat(o)}}return null}function $I(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 ffe(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(!vfe(i[r],e[r])){t=n(i),e=i;break}return t}}function bfe(n,e){if(!e)return n;const t=K(K({},n),e);if("defines"in e&&(t.defines=K(K({},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=K({},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 WI(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],y=e[13],v=e[14],C=e[15],w=t*a-i*o,x=t*l-r*o,N=t*c-s*o,V=i*l-r*a,U=i*c-s*a,ee=r*c-s*l,de=d*y-f*_,ae=d*v-p*_,me=d*C-g*_,Ee=f*v-p*y,Be=f*C-g*y,te=p*C-g*v,ne=w*te-x*Be+N*Ee+V*me-U*ae+ee*de;return ne?(n[0]=(a*te-l*Be+c*Ee)*(ne=1/ne),n[1]=(r*Be-i*te-s*Ee)*ne,n[2]=(y*ee-v*U+C*V)*ne,n[3]=(p*U-f*ee-g*V)*ne,n[4]=(l*me-o*te-c*ae)*ne,n[5]=(t*te-r*me+s*ae)*ne,n[6]=(v*N-_*ee-C*x)*ne,n[7]=(d*ee-p*N+g*x)*ne,n[8]=(o*Be-a*me+c*de)*ne,n[9]=(i*me-t*Be-s*de)*ne,n[10]=(_*U-y*N+C*w)*ne,n[11]=(f*N-d*U-g*w)*ne,n[12]=(a*ae-o*Ee-l*de)*ne,n[13]=(t*Ee-i*ae+r*de)*ne,n[14]=(y*x-_*V-v*w)*ne,n[15]=(d*V-f*x+p*w)*ne,n):null}function rp(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],y=e[12],v=e[13],C=e[14],w=e[15],x=t[0],N=t[1],V=t[2],U=t[3];return n[0]=x*i+N*a+V*f+U*y,n[1]=x*r+N*l+V*p+U*v,n[2]=x*s+N*c+V*g+U*C,n[3]=x*o+N*d+V*_+U*w,n[4]=(x=t[4])*i+(N=t[5])*a+(V=t[6])*f+(U=t[7])*y,n[5]=x*r+N*l+V*p+U*v,n[6]=x*s+N*c+V*g+U*C,n[7]=x*o+N*d+V*_+U*w,n[8]=(x=t[8])*i+(N=t[9])*a+(V=t[10])*f+(U=t[11])*y,n[9]=x*r+N*l+V*p+U*v,n[10]=x*s+N*c+V*g+U*C,n[11]=x*o+N*d+V*_+U*w,n[12]=(x=t[12])*i+(N=t[13])*a+(V=t[14])*f+(U=t[15])*y,n[13]=x*r+N*l+V*p+U*v,n[14]=x*s+N*c+V*g+U*C,n[15]=x*o+N*d+V*_+U*w,n}function LS(n,e,t){var o,a,l,c,d,f,p,g,_,y,v,C,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],y=e[9],v=e[10],C=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]=y,n[10]=v,n[11]=C,n[12]=o*i+d*r+_*s+e[12],n[13]=a*i+f*r+y*s+e[13],n[14]=l*i+p*r+v*s+e[14],n[15]=c*i+g*r+C*s+e[15]),n}function BS(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 b5(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 C5(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 w5(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 VS(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 ia(4);ia!=Float32Array&&(n[0]=0,n[1]=0,n[2]=0,n[3]=0)}();const E5=[0,0,0,0],qfe=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0],Yfe=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],Xfe=[0,0,0],Kfe=[0,0,0],Zfe=NS(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=E5,l=E5,c=n.cameraPosition;const{geospatialOrigin:d,shaderCoordinateOrigin:f,offsetMode:p}=S5(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=VS([],l,o),s=i||s,o=rp([],r,s),o=rp([],o,qfe)),{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:Xfe,project_uScale:n.scale,project_uViewProjectionMatrix:s,project_uCameraPosition:a};if(c){const _=n.getDistanceScales(c);switch(t){case qn.METER_OFFSETS:g.project_uCommonUnitsPerWorldUnit=_.unitsPerMeter,g.project_uCommonUnitsPerWorldUnit2=_.unitsPerMeter2;break;case qn.LNGLAT:case qn.LNGLAT_OFFSETS:g.project_uCommonUnitsPerWorldUnit=_.unitsPerDegree,g.project_uCommonUnitsPerWorldUnit2=_.unitsPerDegree2;break;case qn.CARTESIAN:g.project_uCommonUnitsPerWorldUnit=[1,1,_.unitsPerMeter[2]],g.project_uCommonUnitsPerWorldUnit2=[0,0,_.unitsPerMeter2[2]]}}return g});function S5(n,e,t=Kfe){let r,i=t,s=!0;switch(r=e===qn.LNGLAT_OFFSETS||e===qn.METER_OFFSETS?t:n.isGeospatial?[Math.fround(n.longitude),Math.fround(n.latitude),0]:null,n.projectionMode){case Yc.WEB_MERCATOR:(e===qn.LNGLAT||e===qn.CARTESIAN)&&(s=!1);break;case Yc.WEB_MERCATOR_AUTO_OFFSET:e===qn.LNGLAT?i=r:e===qn.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 Yc.IDENTITY:i=n.position.map(Math.fround);break;case Yc.GLOBE:s=!1,r=null;break;default:s=!1}return i[2]=i[2]||0,{geospatialOrigin:r,shaderCoordinateOrigin:i,offsetMode:s}}class tpe extends vI{get ELEMENTS(){return Qu(!1),0}get RANK(){return Qu(!1),0}toString(){let e="[";if(Ji.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 $t).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 function(n,e,t,i,r){var o,s=1/Math.tan(e/2);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)}(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],y=n[14],v=n[15];return(e*o-t*s)*(f*v-p*y)-(e*a-i*s)*(d*v-p*_)+(e*l-r*s)*(d*y-f*_)+(t*a-i*o)*(c*v-p*g)-(t*l-r*o)*(c*y-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 WI(this,this),this.check()}multiplyLeft(e){return rp(this,e,this),this.check()}multiplyRight(e){return rp(this,this,e),this.check()}rotateX(e){return b5(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 C5(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,_,y,v,C,w,x,N,V,U,ee,de,ae,me,Ee,Be,te,ne,Ie,r=i[0],s=i[1],o=i[2],a=Math.hypot(r,s,o);at?t:n}const qI=Math.log2||function(n){return Math.log(n)*Math.LOG2E};function ed(n,e){if(!n)throw new Error(e||"@math.gl/web-mercator: assertion failed.")}const oc=Math.PI,O5=oc/4,ac=oc/180,YI=180/oc,XI=4003e4,jS=85.051129;function US([n,e]){return ed(Number.isFinite(n)),ed(Number.isFinite(e)&&e>=-90&&e<=90,"invalid latitude"),[512*(n*ac+oc)/(2*oc),512*(oc+Math.log(Math.tan(O5+e*ac*.5)))/(2*oc)]}function Dm([n,e]){const t=n/512*(2*oc)-oc,i=2*(Math.atan(Math.exp(e/512*(2*oc)-oc))-O5);return[t*YI,i*YI]}function KI({latitude:n,longitude:e,highPrecision:t=!1}){ed(Number.isFinite(n)&&Number.isFinite(e));const i={},s=Math.cos(n*ac),o=512/360,a=o/s,l=512/XI/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=ac*Math.tan(n*ac)/s,f=512/XI*c,p=f/a*l;i.unitsPerDegree2=[0,o*c/2,f],i.unitsPerMeter2=[p,0,p]}return i}function I5(n,e){const[t,i,r]=n,[s,o,a]=e,{unitsPerMeter:l,unitsPerMeter2:c}=KI({longitude:t,latitude:i,highPrecision:!0}),d=US(n);d[0]+=s*(l[0]+c[0]*o),d[1]+=o*(l[1]+c[1]*o);const f=Dm(d),p=(r||0)+(a||0);return Number.isFinite(r)||Number.isFinite(a)?[f[0],f[1],p]:f}function R5(n){return 2*Math.atan(.5/n)*YI}function k5(n,e){const[t,i,r=0]=n;return ed(Number.isFinite(t)&&Number.isFinite(i)&&Number.isFinite(r)),Am(e,[t,i,r,1])}function gb(n,e,t=0){const[i,r,s]=n;if(ed(Number.isFinite(i)&&Number.isFinite(r),"invalid pixel coordinate"),Number.isFinite(s))return Am(e,[i,r,s,1]);const o=Am(e,[i,r,0,1]),a=Am(e,[i,r,1,1]),l=o[2],c=a[2];return x5([],o,a,l===c?0:((t||0)-l)/(c-l))}const F5=Math.PI/180;function N5(n,e,t){const{pixelUnprojectionMatrix:i}=n,r=Am(i,[e,0,1,1]),s=Am(i,[e,n.height,1,1]),c=Dm(x5([],r,s,(t*n.distanceScales.unitsPerMeter[2]-r[2])/(s[2]-r[2])));return c[2]=t,c}const _pe=Math.PI/180,ype=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],QI=[0,0,0],bpe={unitsPerMeter:[1,1,1],metersPerUnit:[1,1,1]};let Om=(()=>{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?Yc.WEB_MERCATOR:Yc.WEB_MERCATOR_AUTO_OFFSET:Yc.IDENTITY}equals(t){return t instanceof n&&(this===t||t.width===this.width&&t.height===this.height&&t.scale===this.scale&&rb(t.projectionMatrix,this.projectionMatrix)&&rb(t.viewMatrix,this.viewMatrix))}project(t,{topLeft:i=!0}={}){const s=k5(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=gb([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?US(t):t}unprojectFlat(t){return this.isGeospatial?Dm(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?KI({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 Om{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:y=1.5}=t;const v=Math.pow(2,s);g=g||1,_=_||1,y=Math.max(.75,y);const{fov:C,aspect:w,focalDistance:x,near:N,far:V}=function({width:n,height:e,fovy:t=R5(1.5),altitude:i,pitch:r=0,nearZMultiplier:s=1,farZMultiplier:o=1}){void 0!==i&&(t=R5(i));const a=.5*t*ac,l=function(n){return.5/Math.tan(.5*n*ac)}(t),c=r*ac,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}}({width:g,height:_,pitch:o,altitude:y,nearZMultiplier:l,farZMultiplier:c});let U=function({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 LS(o,o,[0,0,-i]),b5(o,o,-e*ac),C5(o,o,t*ac),BS(o,o,[r/=n,r,r]),s&&LS(o,o,function(n,e){return n[0]=-e[0],n[1]=-e[1],n[2]=-e[2],n}([],s)),o}({height:_,pitch:o,bearing:a,scale:v,altitude:y});p&&(U=(new $t).translate([512*p,0,0]).multiplyLeft(U)),super(Lt(K({},t),{width:g,height:_,viewMatrix:U,longitude:r,latitude:i,zoom:s,orthographic:d,fovyRadians:C,aspect:w,focalDistance:x,near:N,far:V})),this.latitude=i,this.longitude=r,this.zoom=s,this.pitch=o,this.bearing=a,this.altitude=y,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(Lt(K({},this),{worldOffset:s})):this;this._subViewports.push(o)}}return this._subViewports}addMetersToLngLat(t,i){return I5(t,i)}panByPosition(t,i){const r=gb(i,this.pixelUnprojectionMatrix),o=zS([],this.projectFlat(t),M5([],r)),a=zS([],this.center,o),[l,c]=this.unprojectFlat(a);return{longitude:l,latitude:c}}getBounds(t={}){const i=function(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*F5:Math.atan(.5/n.altitude))>(90-n.pitch)*F5-.01?(l=N5(n,0,e),c=N5(n,t,e)):(l=r([0,0],s),c=r([t,0],s)),[o,a,c,l]}(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}=function({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}:ed(Number.isFinite(s.top)&&Number.isFinite(s.bottom)&&Number.isFinite(s.left)&&Number.isFinite(s.right));const f=US([a,D5(d,-jS,jS)]),p=US([c,D5(l,-jS,jS)]),g=[Math.max(Math.abs(p[0]-f[0]),i),Math.max(Math.abs(p[1]-f[1]),i)],_=[n-s.left-s.right-2*Math.abs(o[0]),e-s.top-s.bottom-2*Math.abs(o[1])];ed(_[0]>0&&_[1]>0);const y=_[0]/g[0],v=_[1]/g[1],N=Dm([(p[0]+f[0])/2+(s.right-s.left)/2/y,(p[1]+f[1])/2+(s.bottom-s.top)/2/v]),V=Math.min(r,qI(Math.abs(Math.min(y,v))));return ed(Number.isFinite(V)),{longitude:N[0],latitude:N[1],zoom:V}}(K({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 JI(n,e,t=!1){const i=e.projectPosition(n);if(t&&e instanceof j5){const[r,s,o=0]=n,a=e.getDistanceScales([r,s]);i[2]=o*a.unitsPerMeter[2]}return i}function U5(n,{viewport:e,modelMatrix:t,coordinateSystem:i,coordinateOrigin:r,offsetMode:s}){let[o,a,l=0]=n;switch(t&&([o,a,l]=VS([],[o,a,l,1],t)),i){case qn.LNGLAT:return JI([o,a,l],e,s);case qn.LNGLAT_OFFSETS:return JI([o+r[0],a+r[1],l+(r[2]||0)],e,s);case qn.METER_OFFSETS:return JI(I5(r,[o,a,l]),e,s);case qn.CARTESIAN:default:return e.isGeospatial?[o+r[0],a+r[1],l+r[2]]:e.projectPosition([o,a,l])}}const Epe={10241:9987,10240:9729,10242:33071,10243:33071},eP={},xpe={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||_b(n)&&(3===n.length||4===n.length),equal:(n,e,t)=>tP(n,e)},accessor:{validate(n,e){const t=HS(n);return"function"===t||t===HS(e.value)},equal:(n,e,t)=>"function"==typeof e||tP(n,e)},array:{validate:(n,e)=>e.optional&&!n||_b(n),equal:(n,e,t)=>t.compare?tP(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 na)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 na(t,Lt(K({},e),{parameters:K(K(K({},Epe),i),n.props.textureParameters)}));return eP[r.id]=!0,r}(t,n),release:n=>{!function(n){!n||!(n instanceof na)||eP[n.id]&&(n.delete(),delete eP[n.id])}(n)}}};function tP(n,e){if(n===e)return!0;if(!_b(n)||!_b(e))return!1;const t=n.length;if(t!==e.length)return!1;for(let i=0;i{},this.oldProps=Vpe,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[Lpe]||{},i=e[Npe]||e,r=e[Bpe]||{};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(x4(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 yn(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=iP(t);c=(g=yield p.next()).done,_=yield g.value,!c;c=!0){const v=_,{dataTransform:C}=i.component?i.component.props:{};a=C?C(v,a):a.concat(v),Object.defineProperty(a,"__diff",{enumerable:!1,value:[{startRow:l,endRow:a.length}]}),l=a.length,i._setAsyncPropValue(e,a,o)}}catch(v){d=!0,f=v}finally{try{!c&&null!=p.return&&(yield p.return())}finally{if(d)throw f}}const y=null===(r=i.layer)||void 0===r?void 0:r.props.onDataLoad;y&&y(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:W5,ASYNC_RESOLVED:q5,ASYNC_DEFAULTS:zpe}=FS,jpe={};let Upe=0,Hpe=(()=>{class n{constructor(){this.props=Dpe.apply(this,arguments),this.id=this.props.id,this.count=Upe++,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[zpe])s in i[q5]?r[s]=i[q5][s]:s in i[W5]&&(r[s]=i[W5][s]);return new this.constructor(K(K(K({},i),r),t))}get stats(){return this.internalState.stats}_initState(){this.internalState=new G5({})}}return n.componentName="Component",n.defaultProps=jpe,n})();class $pe extends G5{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 lc=n=>"function"==typeof n,ph=n=>null!==n&&"object"==typeof n,X5=n=>ph(n)&&n.constructor==={}.constructor,Gpe=n=>n&&"function"==typeof n[Symbol.iterator],Wpe=n=>n&&"function"==typeof n[Symbol.asyncIterator],vb=n=>"undefined"!=typeof Response&&n instanceof Response||n&&n.arrayBuffer&&n.text&&n.json,Im=n=>"undefined"!=typeof Blob&&n instanceof Blob,K5=n=>(n=>"undefined"!=typeof ReadableStream&&n instanceof ReadableStream||ph(n)&&lc(n.tee)&&lc(n.cancel)&&lc(n.getReader))(n)||(n=>ph(n)&&lc(n.read)&&lc(n.pipe)&&(n=>"boolean"==typeof n)(n.readable))(n);function sp(n,e){if(!n)throw new Error(e||"loader assertion failed.")}function rP(n){var e;return!!n&&(Array.isArray(n)&&(n=n[0]),Array.isArray(null===(e=n)||void 0===e?void 0:e.extensions))}function sP(n){var e,t;let i;return sp(n,"null loader"),sp(rP(n),"invalid loader"),Array.isArray(n)&&(i=n[1],n=Lt(K({},n=n[0]),{options:K(K({},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 Zc={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},oP=Zc.global||Zc.self||Zc.window||{},Qpe="object"!=typeof process||"[object process]"!==String(process)||process.browser,Z5="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version);Z5&&parseFloat(Z5[1]);const lP={};function Jpe(n){for(const e in lP)n.startsWith(e)&&(n=n.replace(e,lP[e]));return!n.startsWith("http://")&&!n.startsWith("https://")&&(n=`${n}`),n}const ege=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,tge=/^([-\w.]+\/[-\w.+]+)/;function nge(n){const e=tge.exec(n);return e?e[1]:n}function Q5(n){const e=ege.exec(n);return e?e[1]:""}const ige=/\?.*/;function qS(n){if(vb(n)){const e=cP(n.url||"");return{url:e,type:nge(n.headers.get("content-type")||"")||Q5(e)}}return Im(n)?{url:cP(n.name||""),type:n.type||""}:"string"==typeof n?{url:cP(n),type:Q5(n)}:{url:"",type:""}}function rge(n){return vb(n)?n.headers["content-length"]||-1:Im(n)?n.size:"string"==typeof n?n.length:n instanceof ArrayBuffer||ArrayBuffer.isView(n)?n.byteLength:-1}function cP(n){return n.replace(ige,"")}function J5(n){return uP.apply(this,arguments)}function uP(){return(uP=yn(function*(n){if(vb(n))return n;const e={},t=rge(n);t>=0&&(e["content-length"]=String(t));const{url:i,type:r}=qS(n);r&&(e["content-type"]=r);const s=yield age(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 sge(n){return dP.apply(this,arguments)}function dP(){return(dP=yn(function*(n){if(!n.ok){const e=yield oge(n);throw new Error(e)}})).apply(this,arguments)}function oge(n){return hP.apply(this,arguments)}function hP(){return(hP=yn(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 age(n){return fP.apply(this,arguments)}function fP(){return(fP=yn(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,${lge(n.slice(0,5))}`:null})).apply(this,arguments)}function lge(n){let e="";const t=new Uint8Array(n);for(let i=0;i{}}info(){return()=>{}}warn(){return()=>{}}error(){return()=>{}}}const nH={fetch:null,mimeType:void 0,nothrow:!1,log:new class{constructor(){sn(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:[]},dge={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 gP(){oP.loaders=oP.loaders||{};const{loaders:n}=oP;return n._state=n._state||{},n._state}const mP=()=>{const n=gP();return n.globalOptions=n.globalOptions||K({},nH),n.globalOptions};function hge(n,e,t,i){return t=t||[],function(n,e){rH(n,null,nH,dge,e);for(const t of e)rH(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=K({},n.options||{});return function(n,e){e&&!("baseUri"in n)&&(n.baseUri=e)}(r,t),null===r.log&&(r.log=new cge),oH(r,mP()),oH(r,e),r}(e,n,i)}function iH(n,e){const t=mP(),i=n||t;return"function"==typeof i.fetch?i.fetch:ph(i.fetch)?r=>eH(r,i):null!=e&&e.fetch?null==e?void 0:e.fetch:eH}function rH(n,e,t,i,r){const s=e||"Top level",o=e?`${e}.`:"";for(const a in n){const l=!e&&ph(n[a]),c="baseUri"===a&&!e,d="workerUrl"===a&&e;if(!(a in t)&&!c&&!d)if(a in i)tH.warn(`${s} loader option '${o}${a}' no longer supported, use '${i[a]}'`)();else if(!l){const f=pge(a,r);tH.warn(`${s} loader option '${o}${a}' not recognized. ${f}`)()}}}function pge(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 oH(n,e){for(const t in e)t in e&&(n[t]=X5(e[t])&&X5(n[t])?K(K({},n[t]),e[t]):e[t])}function Qc(n,e){if(!n)throw new Error(e||"loaders.gl assertion failed.")}function _ge(n,e="3.0.12"){return Qc(n,"no worker provided"),!(!e||!n.version)}const Jc={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},yge=Jc.global||Jc.self||Jc.window||{},_P="object"!=typeof process||"[object process]"!==String(process)||process.browser,yP="function"==typeof importScripts,vge="undefined"!=typeof window&&void 0!==window.orientation,aH="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version),vP=(aH&&parseFloat(aH[1]),new Map);function lH(n){const e=new Blob([n],{type:"application/javascript"});return URL.createObjectURL(e)}function cH(n,e=!0,t){const i=t||new Set;if(n)if(uH(n))i.add(n);else if(uH(n.buffer))i.add(n.buffer);else if(!ArrayBuffer.isView(n)&&e&&"object"==typeof n)for(const r in n)cH(n[r],e,i);return void 0===t?Array.from(i):[]}function uH(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 bP=()=>{};class dH{static isSupported(){return"undefined"!=typeof Worker}constructor(e){sn(this,"name",void 0),sn(this,"source",void 0),sn(this,"url",void 0),sn(this,"terminated",!1),sn(this,"worker",void 0),sn(this,"onMessage",void 0),sn(this,"onError",void 0),sn(this,"_loadableURL","");const{name:t,source:i,url:r}=e;Qc(i||r),this.name=t,this.source=i,this.url=r,this.onMessage=bP,this.onError=s=>console.log(s),this.worker=this._createBrowserWorker()}destroy(){this.onMessage=bP,this.onError=bP,this.worker.terminate(),this.terminated=!0}get isRunning(){return Boolean(this.onMessage)}postMessage(e,t){t=t||cH(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){Qc(n.source&&!n.url||!n.source&&n.url);let e=vP.get(n.source||n.url);return e||(n.url&&(e=function(n){return n.startsWith("http")?lH(function(n){return`try {\n importScripts('${n}');\n} catch (error) {\n console.error(error);\n throw error;\n}`}(n)):n}(n.url),vP.set(n.url,e)),n.source&&(e=lH(n.source),vP.set(n.source,e))),Qc(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 Ege{constructor(e,t){sn(this,"name",void 0),sn(this,"workerThread",void 0),sn(this,"isRunning",void 0),sn(this,"result",void 0),sn(this,"_resolve",void 0),sn(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){Qc(this.isRunning),this.isRunning=!1,this._resolve(e)}error(e){Qc(this.isRunning),this.isRunning=!1,this._reject(e)}}class Sge{constructor(e){sn(this,"name","unnamed"),sn(this,"source",void 0),sn(this,"url",void 0),sn(this,"maxConcurrency",1),sn(this,"maxMobileConcurrency",1),sn(this,"onDebug",()=>{}),sn(this,"reuseWorkers",!0),sn(this,"props",{}),sn(this,"jobQueue",[]),sn(this,"idleQueue",[]),sn(this,"count",0),sn(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=K(K({},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 yn(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 yn(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 Ege(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 td{static isSupported(){return dH.isSupported()}static getWorkerFarm(e={}){return td._workerFarm=td._workerFarm||new td({}),td._workerFarm.setProps(e),td._workerFarm}constructor(e){sn(this,"props",void 0),sn(this,"workerPools",new Map),this.props=K({},Mge),this.setProps(e),this.workerPools=new Map}destroy(){for(const e of this.workerPools.values())e.destroy()}setProps(e){this.props=K(K({},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 Sge({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 Tge(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 Qc(r),r}function Age(n,e){return!!td.isSupported()&&n.worker&&(null==e?void 0:e.worker)}function Dge(n,e,t,i,r){return CP.apply(this,arguments)}function CP(){return(CP=yn(function*(n,e,t,i,r){const s=n.id,o=Tge(n,t),l=td.getWorkerFarm(t).getWorkerPool({name:s,url:o});t=JSON.parse(JSON.stringify(t));const c=yield l.startJob("process-on-worker",Oge.bind(null,r));return c.postMessage("process",{input:e,options:t}),yield(yield c.result).result})).apply(this,arguments)}function Oge(n,e,t,i){return wP.apply(this,arguments)}function wP(){return(wP=yn(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)}sn(td,"_workerFarm",void 0);var fH=ze(521);function pH(n){if(function(n){return n&&"object"==typeof n&&n.isBuffer}(n)&&(n=function(n){return fH.toArrayBuffer?fH.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 kge(...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 gH(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 Fge(n){return SP.apply(this,arguments)}function SP(){return(SP=yn(function*(n){const e=[];var r,t=!0,i=!1;try{for(var o,a,s=iP(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 kge(...e)})).apply(this,arguments)}const Bge=262144;function mH(n){this.wrapped=n}function bb(n){return new mH(n)}function Cb(n){var e,t;function r(o,a){try{var l=n[o](a),c=l.value,d=c instanceof mH;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 xP(n){return function(){return new Cb(n.apply(this,arguments))}}function TP(){return(TP=xP(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(OP)}function Wge(n,e,t){return IP.apply(this,arguments)}function IP(){return(IP=yn(function*(n,e,t){const i=n instanceof ArrayBuffer||ArrayBuffer.isView(n);if("string"==typeof n||i)return Gge(n,e);if(Im(n)&&(n=yield J5(n)),vb(n)){const r=n;return yield sge(r),e.binary?yield r.arrayBuffer():yield r.text()}if(K5(n)&&(n=$ge(n,t)),Gpe(n)||Wpe(n))return Fge(n);throw new Error(OP)})).apply(this,arguments)}function Yge(n,e,t=null){if(t)return t;const i=K({fetch:iH(e,n)},n);return Array.isArray(i.loaders)||(i.loaders=null),i}function Xge(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 yH=()=>{const n=gP();return n.loaderRegistry=n.loaderRegistry||[],n.loaderRegistry};function vH(n){const e=yH();n=Array.isArray(n)?n:[n];for(const t of n){const i=sP(t);e.find(r=>i===r)||e.unshift(i)}}const Zge=/\.([^.]+)$/;function Qge(n){return kP.apply(this,arguments)}function kP(){return(kP=yn(function*(n,e=[],t,i){if(!CH(n))return null;let r=bH(n,e,Lt(K({},t),{nothrow:!0}),i);if(r)return r;if(Im(n)&&(r=bH(n=yield n.slice(0,10).arrayBuffer(),e,t,i)),!(r||null!=t&&t.nothrow))throw new Error(wH(n));return r})).apply(this,arguments)}function bH(n,e=[],t,i){if(!CH(n))return null;if(e&&!Array.isArray(e))return sP(e);let r=[];e&&(r=r.concat(e)),null!=t&&t.ignoreRegisteredLoaders||r.push(...yH()),function(n){for(const e of n)sP(e)}(r);const s=function(n,e,t,i){const{url:r,type:s}=qS(n),o=r||(null==i?void 0:i.url);let a=null;return null!=t&&t.mimeType&&(a=FP(e,null==t?void 0:t.mimeType)),a=a||function(n,e){const t=e&&Zge.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||FP(e,s),a=a||function(n,e){if(!e)return null;for(const t of n)if("string"==typeof e){if(rme(e,t))return t}else if(ArrayBuffer.isView(e)){if(EH(e.buffer,e.byteOffset,t))return t}else if(e instanceof ArrayBuffer&&EH(e,0,t))return t;return null}(e,n),a=a||FP(e,null==t?void 0:t.fallbackMimeType),a}(n,r,t,i);if(!(s||null!=t&&t.nothrow))throw new Error(wH(n));return s}function CH(n){return!(n instanceof Response&&204===n.status)}function wH(n){const{url:e,type:t}=qS(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)?NP(n.buffer,n.byteOffset,e):n instanceof ArrayBuffer?NP(n,0,e):""}(n)}", contentType: "${t}"`),e&&(i+=` url: ${e}`),i}function FP(n,e){for(const t of n)if(t.mimeTypes&&t.mimeTypes.includes(e)||e===`application/x.${t.id}`)return t;return null}function rme(n,e){return e.testText?e.testText(n):(Array.isArray(e.tests)?e.tests:[e.tests]).some(i=>n.startsWith(i))}function EH(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 eu=new Uint8ClampedArray(0);const gme={data:{type:"data",value:fme,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=Lt(K({},r),{fetch:Lt(K({},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:wb(n,i),persistent:!1}),l=!0),l?o.subscribe({resourceId:n,onChange:c=>t.internalState.reloadAsyncProp(e,c),consumerId:t.id,requestId:e}):wb(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:qn.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 Eb=(()=>{class n extends Hpe{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=U5(t,{viewport:i,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem}),[s,o,a]=k5(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=K({},n);let{coordinateSystem:t}=n;const{viewport:i,coordinateOrigin:r,fromCoordinateSystem:s,fromCoordinateOrigin:o}=n;return t===qn.DEFAULT&&(t=i.isGeospatial?qn.LNGLAT:qn.CARTESIAN),void 0===s&&(e.fromCoordinateSystem=t),void 0===o&&(e.fromCoordinateOrigin=r),e.coordinateSystem=t,e}(e),{geospatialOrigin:l,shaderCoordinateOrigin:c,offsetMode:d}=S5(t,i,r),f=U5(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===qn.DEFAULT||t===qn.LNGLAT||t===qn.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){sc(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=bfe(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||!pme({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(eu.length/3);if(this.internalState.usesPickingColorCache=!0,rSH&&jn.warn("Layer has too many data objects. Picking might not be able to distinguish all objects.")(),eu=nb.allocate(eu,i,{size:3,copy:!0,maxCount:Math.max(i,SH)});const s=Math.floor(eu.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&&no("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=y5({newProps:n,oldProps:e,propTypes:GI(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&&v5(n,e,"all"))return{all:!0};const t={};let i=!1;for(const r in n.updateTriggers)"all"!==r&&v5(n,e,r)&&(t[r]=!0,i=t);return i}(n,e)),{dataChanged:i,propsChanged:t,updateTriggersChanged:r,extensionsChanged:ffe(n,e),transitionsChanged:ufe(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=GI(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 tfe(this.context.gl,{id:this.props.id,stats:this.context.stats,timeline:this.context.timeline})}_initState(){sc(!this.internalState&&!this.state),sc(isFinite(this.props.coordinateSystem));const t=this._getAttributeManager();t&&t.addInstanced({instancePickingColors:{type:5121,size:3,noAlloc:!0,update:this.calculateInstancePickingColors}}),this.internalState=new $pe({attributeManager:t,layer:this}),this.clearChangeFlags(),this.state={},Object.defineProperty(this.state,"attributeManager",{get:()=>(jn.deprecated("layer.state.attributeManager","layer.getAttributeManager()"),t)}),this.internalState.layer=this,this.internalState.uniformTransitions=new ofe(this.context.timeline),this.internalState.onAsyncPropUpdated=this._onAsyncPropUpdated.bind(this),this.internalState.setAsyncProps(this.props)}_transferState(t){no("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=gme,n})(),MH=(()=>{class n extends Eb{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:y,extensions:v,fetch:C,_subLayerProps:w}=this.props,x={opacity:i,pickable:r,visible:s,parameters:o,getPolygonOffset:a,highlightedObjectIndex:l,autoHighlight:c,highlightColor:d,coordinateSystem:f,coordinateOrigin:p,wrapLongitude:g,positionFormat:_,modelMatrix:y,extensions:v,fetch:C},N=w&&w[t.id],V=N&&N.updateTriggers,U=t.id||"sublayer";if(N){const ee=this.constructor._propTypes,de=t.type?t.type._propTypes:{};for(const ae in N){const me=de[ae]||ee[ae];me&&"accessor"===me.type&&(N[ae]=this.getSubLayerAccessor(N[ae]))}}Object.assign(x,t,N),x.id="".concat(this.props.id,"-").concat(U),x.updateTriggers=K(K({all:this.props.updateTriggers.all},t.updateTriggers),V);for(const ee of v){const de=ee.getSubLayerProps.call(this,ee);de&&Object.assign(x,de,{updateTriggers:Object.assign(x.updateTriggers,de.updateTriggers)})}return x}_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=EI(t,Boolean),this.internalState.subLayers=t),no("compositeLayer.renderLayers",this,i,t);for(const r of t)r.parent=this}}return n.layerName="CompositeLayer",n})();const _me=/([0-9]+\.?[0-9]*)(%|px)/;function XS(n){switch(typeof n){case"number":return{position:n,relative:!1};case"string":const e=n.match(_me);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 KS(n,e){return n.relative?Math.round(n.position*e):n.position}function Sb(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)&&Sb(i,r)))return!1}return!0}class zP{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=Om}=e;sc(!p||p instanceof Om),this.viewportInstance=p,this.id=t||this.constructor.displayName||"view",this.type=g,this.props=Lt(K({},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):Sb(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=K({},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:KS(this._x,e),y:KS(this._y,t),width:KS(this._width,e),height:KS(this._height,t)}}_getControllerProps(e){let t=this.props.controller;return t?!0===t?e:("function"==typeof t&&(t={type:t}),K(K({},e),t)):null}_getViewport(e,t){const{type:i}=this;return new i(K(K(K({},e),this.props),t))}_parseDimensions({x:e,y:t,width:i,height:r}){this._x=XS(e),this._y=XS(t),this._width=XS(i),this._height=XS(r)}}const Mb=()=>{},xH={transitionEasing:n=>n,transitionInterruption:1,onTransitionStart:Mb,onTransitionInterrupt:Mb,onTransitionEnd:Mb};class yme{constructor(e,t={}){this.ControllerState=e,this.props=K(K({},xH),t),this.propsInTransition=null,this.transition=new fb(t.timeline),this.onViewStateChange=t.onViewStateChange||Mb,this.onStateChange=t.onStateChange||Mb,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=K(K({},xH),e),this.props=e,this._shouldIgnoreViewportChange(i,e))return t;if(this._isTransitionEnabled(e)){const{interruption:r,endProps:s}=this.transition.settings,o=K(K({},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(K(K({},this.props),c)).getViewportProps(),this.onViewStateChange({viewState:this.propsInTransition,oldViewState:this.props})}}const TH=["longitude","latitude","zoom","bearing","pitch"],bme=["longitude","latitude","zoom"];class AH 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)||!rb(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];sc(Number.isFinite(i)||Array.isArray(i),"".concat(t," is required for transition"))})}}{constructor(e={}){super((Array.isArray(e)?e:e.transitionProps)||{compare:TH,extract:TH,required:bme}),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]=bS(e[s]||0,t[s]||0,i);if(t.aroundPosition){const s=this.opts.makeViewport(K(K({},t),r));Object.assign(r,s.panByPosition(t.aroundPosition,bS(e.around,t.around,i)))}return r}}const gh={transitionDuration:0},Cme={transitionDuration:300,transitionEasing:n=>n,transitionInterruption:1},QS=n=>1-(1-n)*(1-n),Pm_WHEEL=["wheel"],Pm_PAN=["panstart","panmove","panend"],Pm_PINCH=["pinchstart","pinchmove","pinchend"],Pm_TRIPLE_PAN=["tripanstart","tripanmove","tripanend"],Pm_DOUBLE_TAP=["doubletap"],Pm_KEYBOARD=["keydown"];class jP{constructor(e,t={}){this.ControllerState=e,this.controllerState=null,this.controllerStateProps=null,this.eventManager=null,this.transitionManager=new yme(e,Lt(K({},t),{onViewStateChange:this._onTransition.bind(this),onStateChange:this._setInteractionState.bind(this)}));const i=this.linearTransitionProps;this._transition=i&&Lt(K({},Cme),{transitionInterpolator:new AH({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(K(K({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(Pm_WHEEL,d&&i),this.toggleEvents(Pm_PAN,d&&(r||s)),this.toggleEvents(Pm_PINCH,d&&(a||l)),this.toggleEvents(Pm_TRIPLE_PAN,d&&l),this.toggleEvents(Pm_DOUBLE_TAP,d&&o),this.toggleEvents(Pm_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=K(K({},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,gh,{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,gh,{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,Lt(K({},this._getTransitionProps()),{transitionDuration:t,transitionEasing:QS}),{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,gh,{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,Lt(K({},this._getTransitionProps()),{transitionDuration:t,transitionEasing:QS}),{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,Lt(K({},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,gh,{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,gh,{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,Lt(K({},this._getTransitionProps()),{transitionDuration:t,transitionEasing:QS}),{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,gh,{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,gh,{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,Lt(K({},this._getTransitionProps({around:r})),{transitionDuration:t,transitionEasing:QS}),{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?Lt(K({},t),{transitionInterpolator:new AH(Lt(K({},e),{transitionProps:this.linearTransitionProps,makeViewport:this.controllerState.makeViewport}))}):t:gh}}class DH{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 mh_target=[0,0,0];class JS extends DH{constructor({makeViewport:e,width:t,height:i,rotationX:r=0,rotationOrbit:s=0,target:o=mh_target,zoom:a=0,minRotationX:l=-90,maxRotationX:c=90,minZoom:d=-(1/0),maxZoom:f=Infinity,startPanPosition:p,startRotatePos:g,startRotationX:_,startRotationOrbit:y,startZoomPosition:v,startZoom:C}){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:y,startZoomPosition:v,startZoom:C},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=K({},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(Lt(K({},this._viewportProps),{zoom:a}));return this._getUpdatedState(K({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),np(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 JS(K(K(K({},this._viewportProps),this._state),e))}_applyConstraints(e){const{maxZoom:t,minZoom:i,zoom:r,maxRotationX:s,minRotationX:o,rotationOrbit:a}=e;return e.zoom=np(r,i,t),e.rotationX=np(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 Eme extends jP{constructor(e){super(JS,e)}get linearTransitionProps(){return["target","zoom","rotationX","rotationOrbit"]}}class Sme extends jP{constructor(e){e.dragMode=e.dragMode||"pan",super(JS,e)}_onPanRotate(e){return!1}get linearTransitionProps(){return["target","zoom"]}}const Mme=(new $t).lookAt({eye:[0,0,1]});function xme({width:n,height:e,near:t,far:i}){return n=n||1,e=e||1,(new $t).ortho({left:-n/2,right:n/2,bottom:-e/2,top:e/2,near:t,far:i})}class Tme extends Om{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(Lt(K({},e),{longitude:null,position:a,viewMatrix:Mme.clone().scale([c,c*(l?-1:1),c]),projectionMatrix:xme({width:t,height:i,near:r,far:s}),zoom:o}))}panByPosition(e,t){const r=zS([],e,M5([],gb(t,this.pixelUnprojectionMatrix)));return{target:zS([],this.center,r)}}}let Ame=(()=>{class n extends zP{constructor(t){super(Lt(K({},t),{type:Tme}))}get controller(){return this._getControllerProps({type:Sme})}}return n.displayName="OrthographicView",n})();const eM=Math.PI/180;function Dme({height:n,fovy:e,orbitAxis:t,rotationX:i,rotationOrbit:r,zoom:s}){const o=.5/Math.tan(e*eM/2),a="Z"===t?[0,0,1]:[0,1,0],l="Z"===t?[0,-o,0]:[0,0,o],c=(new $t).lookAt({eye:l,up:a});c.rotateX(i*eM),"Z"===t?c.rotateZ(r*eM):c.rotateY(r*eM);const d=Math.pow(2,s)/(n||1);return c.scale(d),c}class Ome extends Om{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(Lt(K({},e),{longitude:null,viewMatrix:Dme({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]=gb([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 Ime=(()=>{class n extends zP{constructor(t={}){const{orbitAxis:i="Z"}=t;super(Lt(K({},t),{orbitAxis:i,type:Ome}))}get controller(){return this._getControllerProps({type:Eme})}}return n.displayName="OrbitView",n})();const Pme=[255,255,255],Rme=1;let kme=0;class OH{constructor(e={}){const{color:t=Pme}=e,{intensity:i=Rme}=e;this.id=e.id||"ambient-".concat(kme++),this.color=t,this.intensity=i,this.type="ambient"}}const Fme=[255,255,255],Nme=1,Lme=[0,0,-1];let Bme=0;class IH{constructor(e={}){const{color:t=Fme}=e,{intensity:i=Nme}=e,{direction:r=Lme}=e,{_shadow:s=!1}=e;this.id=e.id||"directional-".concat(Bme++),this.color=t,this.intensity=i,this.type="directional",this.direction=new to(r).normalize().toArray(),this.shadow=s}getProjectedLight(){return this}}class PH{constructor(e={}){const{id:t="effect"}=e;this.id=t,this.props=K({},e)}preRender(){}getModuleParameters(){}cleanup(){}}class UP extends class{constructor(e,t={}){const{id:i="pass"}=t;this.id=i,this.gl=e,this.props=K({},t)}setProps(e){Object.assign(this.props,e)}render(){}cleanup(){}}{render(e){return Xu(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){Xu(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=RH(),c={viewport:e,isPicking:i.startsWith("picking"),renderPass:i};for(let d=0;dpI(e,c))}const l={totalCount:t.length,visibleCount:0,compositeCount:0,pickableCount:0};Xu(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]||RH(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 Ume extends UP{constructor(e,t){super(e,t),this.shadowMap=new na(e,{width:1,height:1,parameters:{10241:9729,10240:9729,10242:33071,10243:33071}}),this.depthBuffer=new vm(e,{format:33189,width:1,height:1}),this.fbo=new ss(e,{id:"shadowmap",width:1,height:1,attachments:{36064:this.shadowMap,36096:this.depthBuffer}})}render(e){const t=this.fbo;rc(this.gl,{depthRange:[0,1],depthTest:!0,blend:!1,clearColor:[1,1,1,1]},()=>{const i=e.viewports[0],r=mm(this.gl),s=i.width*r,o=i.height*r;(s!==t.width||o!==t.height)&&t.resize({width:s,height:o}),super.render(Lt(K({},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 $me=Object.keys(qn).map(n=>"const int COORDINATE_SYSTEM_".concat(n," = ").concat(qn[n],";")).join(""),Gme=Object.keys(Yc).map(n=>"const int PROJECTION_MODE_".concat(n," = ").concat(Yc[n],";")).join(""),Wme="".concat($me,"\n").concat(Gme,"\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"),qme={},HP={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:Wme,getUniforms:function(n=qme){return n.viewport?function({viewport:n,devicePixelRatio:e=1,modelMatrix:t=null,coordinateSystem:i=qn.DEFAULT,coordinateOrigin:r,autoWrapLongitude:s=!1}={}){i===qn.DEFAULT&&(i=n.isGeospatial?qn.LNGLAT:qn.CARTESIAN);const o=Zfe({viewport:n,devicePixelRatio:e,coordinateSystem:i,coordinateOrigin:r});return o.project_uWrapLongitude=s,o.project_uModelMatrix=t||Yfe,o}(n):{}}},Zme=NS(function({viewport:n,center:e}){return new $t(n.viewProjectionMatrix).invert().transform(e)}),Qme=NS(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=gb([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 to(n.center).negate()),l=s.map(d=>a.transform(d)),c=(new $t).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}),Jme=[0,0,0,1],e_e=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0],$P={name:"shadow",dependencies:[HP],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||Jme,shadow_uLightId:n.shadowLightId||0,shadow_uLightCount:n.shadowMatrices.length},i=Zme({viewport:n.viewport,center:e.project_uCenter}),r=[],s=Qme({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{}}},s_e={color:[255,255,255],intensity:1},kH=[{color:[255,255,255],intensity:1,direction:[-1,3,-1]},{color:[255,255,255],intensity:.9,direction:[1,-8,-2.5]}],o_e=[0,0,0,200/255];class GP extends PH{constructor(e){super(e),this.ambientLight=null,this.directionalLights=[],this.pointLights=[],this.shadowColor=o_e,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=db.getDefaultProgramManager(e),$P&&this.programManager.addDefaultModule($P)),this.dummyShadowMap||(this.dummyShadowMap=new na(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($P),this.programManager=null)}_createLightMatrix(){const e=[];for(const t of this.directionalLights){const i=(new $t).lookAt({eye:new to(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=l_e++;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 c_e{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=wb(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 u_e{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 c_e(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 d_e=[{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"},HP],h_e=["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 f_e(n){const e=db.getDefaultProgramManager(n);for(const t of d_e)e.addDefaultModule(t);for(const t of h_e)e.addShaderHook(t);return e}const m_e=Object.seal({layerManager:null,resourceManager:null,deck:null,gl:null,stats:null,shaderCache:null,pickingFBO:null,mousePosition:null,userData:{}});class __e{constructor(e,{deck:t,stats:i,viewport:r,timeline:s}={}){this.lastRenderedLayers=[],this.layers=[],this.resourceManager=new u_e({gl:e,protocol:"deck://"}),this.context=Lt(K({},m_e),{layerManager:this,gl:e,deck:t,programManager:e&&f_e(e),stats:i||new aI({id:"deck.gl"}),viewport:r||new Om({id:"DEFAULT-INITIAL-VIEWPORT"}),timeline:s||new FH,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){no("layerManager.setLayers",this,t,e),this.lastRenderedLayers=e,e=EI(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 no("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]?jn.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&&jn.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 y_e{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=EI(e,Boolean),this._diffViews(e,this.views)&&this.setNeedsUpdate("views changed"),this.views=e}_setViewState(e){e?(!Sb(e,this.viewState)&&this.setNeedsUpdate("viewState changed"),this.viewState=e):jn.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)(K({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=Lt(K(K(K({},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 b_e extends DH{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:y,startRotatePos:v,startBearing:C,startPitch:w,startZoom:x,normalize:N}={}){sc(Number.isFinite(s)),sc(Number.isFinite(r)),sc(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:N}),this._state={startPanLngLat:_,startZoomLngLat:y,startRotatePos:v,startBearing:C,startPitch:w,startZoom:x},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(Lt(K({},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(Lt(K({},this._viewportProps),{zoom:o}));return this._getUpdatedState(K({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=K({},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(K(K(K({makeViewport:this.makeViewport},this._viewportProps),this._state),e))}_applyConstraints(e){const{maxZoom:t,minZoom:i,zoom:r}=e;e.zoom=np(r,i,t);const{maxPitch:s,minPitch:o,pitch:a}=e;e.pitch=np(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=A5(t+180,360)-180),(o<-180||o>180)&&(o=A5(o+180,360)-180);const a=qI(e/512);if(r<=a)r=a,i=0;else{const l=e/2/Math.pow(2,r),c=Dm([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 np(t+Math.log2(e),r,i)}_calculateNewPitchAndBearing({deltaScaleX:e,deltaScaleY:t,startBearing:i,startPitch:r}){t=np(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 C_e extends jP{constructor(e){e.dragMode=e.dragMode||"pan",super(b_e,e)}setProps(e){const t=this.controllerStateProps;super.setProps(e),(!t||t.height!==e.height)&&this.updateViewport(new this.ControllerState(K(K({makeViewport:this.makeViewport},this.controllerStateProps),this._state)))}get linearTransitionProps(){return["longitude","latitude","zoom","bearing","pitch"]}}let w_e=(()=>{class n extends zP{constructor(t){super(Lt(K({},t),{type:j5}))}get controller(){return this._getControllerProps({type:C_e})}}return n.displayName="MapView",n})();const E_e=new GP;class S_e{constructor(){this.effects=[],this._internalEffects=[],this._needsRedraw="Initial render",this.setEffects()}setProps(e){"effects"in e&&(e.effects.length!==this.effects.length||!Sb(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 GP)||this._internalEffects.push(E_e)}}class M_e extends UP{}const LH={blendFunc:[1,0,32771,0],blendEquation:32774};class BH extends UP{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,rc(_,Lt(K({scissorTest:!0,scissor:[a,l,c,d],clearColor:[0,0,0,0],depthMask:!0,depthTest:!0,depthRange:[0,1],colorMask:[!0,!0,!0,!0]},LH),{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}:Lt(K({},LH),{blend:!0,blendColor:[0,0,0,this.useAlpha?(t+1)/255:1]});return K(K({},e.props.parameters),i)}}class T_e{constructor(e){this.gl=e,this.layerFilter=null,this.drawPickingColors=!1,this.drawLayersPass=new M_e(e),this.pickLayersPass=new BH(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||ss.getDefaultFramebuffer(this.gl),this._preRender(e.effects,e);const i=this.lastPostProcessEffect?this.renderBuffers[0]:e.target,r=t.render(Lt(K({},e),{target:i}));this._postRender(e.effects,e),this.renderCount++,no("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 ss(this.gl),new ss(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 A_e={pickedColor:null,pickedLayer:null,pickedObjectIndex:-1};function D_e({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 v=0;v=0){const w=v+o-t,x=w*w+y;x<=d&&(d=x,f=p)}p+=4}}if(f>=0){const g=n[f+3]-1,_=n.slice(f,f+4),y=e[g];if(y){const v=y.decodePickingColor(_),C=Math.floor(f/4/l);return{pickedColor:_,pickedLayer:y,pickedObjectIndex:v,pickedX:o+(f/4-C*l),pickedY:a+C}}jn.error("Picked non-existent layer. Is picking buffer corrupt?")()}}return A_e}function VH({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 I_e(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(y=>y.props.id===p);_&&l.unshift(_)}t.layerId=g,t.index=a,t.info=null}}const c=VH(n),d=new Map;return d.set(null,c),l.forEach(f=>{let p=K({},c);f===o&&(p.color=s,p.index=a,p.picked=!0),p=zH({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 zH({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 R_e{constructor(e){this.gl=e,this.pickingFBO=null,this.pickLayersPass=new BH(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?K(K({},s),f):Object.assign(f,{color:null,object:null,index:-1})}_resizeBuffer(){const{gl:e}=this;return this.pickingFBO||(this.pickingFBO=new ss(e),ss.isSupported(e,{colorBufferFloat:!0})&&(this.depthFBO=new ss(e),this.depthFBO.attach({36064:new na(e,{format:In(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?(jn.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:VH({viewports:i,x:r,y:s})};this._resizeBuffer();const f=mm(this.gl),p=rI(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:y,height:v}=this.pickingFBO,C=this._getPickingRect({deviceX:g[0],deviceY:g[1],deviceRadius:_,deviceWidth:y,deviceHeight:v});let w;const x=[],N={};for(let V=0;V=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)}):jn.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:C,width:y.x+y.width-g,height:_-C},pass:"picking:".concat(l),redrawReason:l}),layers:e}),V=new Map,U=Number.isFinite(c);for(let ee=0;ee=c);ee++){const de=N[ee];let ae={color:de.pickedColor,layer:null,index:de.pickedObjectIndex,picked:!0,x:r,y:s,width:o,height:a,pixelRatio:f};ae=zH({layer:de.pickedLayer,info:ae,mode:l}),V.has(ae.object)||V.set(ae.object,ae)}return Array.from(V.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 vS(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 k_e={zIndex:1,position:"absolute",pointerEvents:"none",color:"#a0a7b4",backgroundColor:"#29323c",padding:"10px",top:0,left:0,display:"none"};class F_e{constructor(e){const t=e.parentElement;t&&(this.el=document.createElement("div"),this.el.className="deck-tooltip",Object.assign(this.el.style,k_e),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 jH(n,e){if(!n)throw new Error(e)}const tu={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},UH=tu.global||tu.self||tu.window,L_e="object"!=typeof process||"[object process]"!==String(process)||process.browser,HH="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version),{_parseImageNode:B_e}=(HH&&parseFloat(HH[1]),UH),WP="undefined"!=typeof Image,qP="undefined"!=typeof ImageBitmap,V_e=Boolean(B_e),YP=!!L_e||V_e;function $H(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 GH(n){switch($H(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 U_e=/^data:image\/svg\+xml/,H_e=/\.svg((\?|#).*)?$/;function XP(n){return n&&(U_e.test(n)||H_e.test(n))}function $_e(n,e){if(XP(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 qH(n,e)}function qH(n,e){if(XP(e))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(n)])}function YH(n,e,t){return KP.apply(this,arguments)}function KP(){return(KP=yn(function*(n,e,t){const i=$_e(n,t),r=self.URL||self.webkitURL,s="string"!=typeof i&&r.createObjectURL(i);try{return yield G_e(s||i,e)}finally{s&&r.revokeObjectURL(s)}})).apply(this,arguments)}function G_e(n,e){return ZP.apply(this,arguments)}function ZP(){return(ZP=yn(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 W_e={};let XH=!0;function q_e(n,e,t){return QP.apply(this,arguments)}function QP(){return(QP=yn(function*(n,e,t){let i;i=XP(t)?yield YH(n,e,t):qH(n,t);const r=e&&e.imagebitmap;return yield Y_e(i,r)})).apply(this,arguments)}function Y_e(n){return JP.apply(this,arguments)}function JP(){return(JP=yn(function*(n,e=null){if((X_e(e)||!XH)&&(e=null),e)try{return yield createImageBitmap(n,e)}catch(t){console.warn(t),XH=!1}return yield createImageBitmap(n)})).apply(this,arguments)}function X_e(n){for(const e in n||W_e)return!1;return!0}const nu=!1,xb=!0;function eR(n){const e=Tb(n);return function(n){const e=Tb(n);return e.byteLength>=24&&2303741511===e.getUint32(0,nu)?{mimeType:"image/png",width:e.getUint32(16,nu),height:e.getUint32(20,nu)}:null}(e)||function(n){const e=Tb(n);if(!(e.byteLength>=3&&65496===e.getUint16(0,nu)&&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,nu)?{mimeType:"image/gif",width:e.getUint16(6,xb),height:e.getUint16(8,xb)}:null}(e)||function(n){const e=Tb(n);return e.byteLength>=14&&16973===e.getUint16(0,nu)&&e.getUint32(2,xb)===e.byteLength?{mimeType:"image/bmp",width:e.getUint32(18,xb),height:e.getUint32(22,xb)}:null}(e)}function Tb(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 tye(n,e){const{mimeType:t}=eR(n)||{},{_parseImageNode:i}=UH;return jH(i),i(n,t,e)}function tR(){return(tR=yn(function*(n,e,t){const r=((e=e||{}).image||{}).type||"auto",{url:s}=t||{};let a;switch(iye(r)){case"imagebitmap":a=yield q_e(n,e,s);break;case"image":a=yield YH(n,e,s);break;case"data":a=yield tye(n,e);break;default:jH(!1)}return"data"===r&&(a=GH(a)),a})).apply(this,arguments)}function iye(n){switch(n){case"auto":case"data":return function(){if(qP)return"imagebitmap";if(WP)return"image";if(YP)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}();default:return function(n){switch(n){case"auto":return qP||WP||YP;case"imagebitmap":return qP;case"image":return WP;case"data":return YP;default:throw new Error(`@loaders.gl/images: image ${n} not supported in this environment`)}}(n),n}}const nR={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 tR.apply(this,arguments)},tests:[n=>Boolean(eR(new DataView(n)))],options:{image:{type:"auto",decode:!0}}};var Rm=ze(761);const sye={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},Ab="8.5.8",tM=Rm.CO.deck&&Rm.CO.deck.VERSION;if(tM&&tM!==Ab)throw new Error("deck.gl - multiple versions detected: ".concat(tM," vs ").concat(Ab));tM||(jn.log(1,"deck.gl ".concat(Ab))(),Rm.CO.deck=Object.assign(Rm.CO.deck||{},{VERSION:Ab,version:Ab,log:jn,_registerLoggers:function(n){TI=n}}),vH([sye,[nR,{imagebitmap:{premultiplyAlpha:"none"}}]]));const oye=Rm.CO.deck;class nM extends Ku{get[Symbol.toStringTag](){return"Query"}static isSupported(e,t=[]){const i=In(e),r=f4(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:nt(!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 nM.isSupported(this.gl)?this.gl2.createQuery():null}_deleteHandle(){this.gl2.deleteQuery(this.handle)}}const KH=yS()&&"undefined"!=typeof document;let mye=0;class _ye{constructor(e={}){const{onCreateContext:t=(v=>qU(v)),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:_=Jf.get("animation-loop-"+mye++)}=e;let{useDevicePixels:y=!0}=e;"useDevicePixelRatio"in e&&(vt.deprecated("useDevicePixelRatio","useDevicePixels")(),y=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:y}),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 nt("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=nM.isSupported(this.gl,["timers"])?new nM(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 yn(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 vt.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=KH?new Promise((e,t)=>{KH&&"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?oI(this.props.gl,e):this.onCreateContext(e),!mS(this.gl))throw new Error("AnimationLoop.onCreateContext - illegal context returned");(function(n){Xu(n,iI)})(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)&&(vt.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)&&(vt.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 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: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 yye=ze(524),iM=ze.n(yye);const vye={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}))}}(iM().MouseInput);const Eye=iM().Manager,iu=iM(),Sye=iu?[[iu.Pan,{event:"tripan",pointers:3,threshold:0,enable:!1}],[iu.Rotate,{enable:!1}],[iu.Pinch,{enable:!1}],[iu.Swipe,{enable:!1}],[iu.Pan,{threshold:0,enable:!1}],[iu.Press,{enable:!1}],[iu.Tap,{event:"doubletap",taps:2,enable:!1}],[iu.Tap,{event:"anytap",enable:!1}],[iu.Tap,{enable:!1}]]:null,JH={tripan:["rotate","pinch","pan"],rotate:["pinch"],pinch:["pan"],pan:["press","doubletap","anytap","tap"],doubletap:["anytap"],anytap:["tap"]},Mye={doubletap:["tap"]},xye={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"]},Tye={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"},e6={click:"tap",anyclick:"anytap",dblclick:"doubletap",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup",mouseover:"pointerover",mouseout:"pointerout",mouseleave:"pointerleave"},Aye="undefined"!=typeof navigator&&navigator.userAgent?navigator.userAgent.toLowerCase():"",km="undefined"!=typeof window?window:global;"undefined"!=typeof global?global:window,"undefined"!=typeof document&&document;let t6=!1;try{const n={get passive(){return t6=!0,!0}};km.addEventListener("test",n,n),km.removeEventListener("test",n,n)}catch(n){}const Dye=-1!==Aye.indexOf("firefox"),{WHEEL_EVENTS:Oye}=rR,i6=4.000244140625;class Rye{constructor(e,t,i={}){this.element=e,this.callback=t,this.options=Object.assign({enable:!0},i),this.events=Oye.concat(i.events||[]),this.handleEvent=this.handleEvent.bind(this),this.events.forEach(r=>e.addEventListener(r,this.handleEvent,!!t6&&{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;km.WheelEvent&&(Dye&&e.deltaMode===km.WheelEvent.DOM_DELTA_PIXEL&&(t/=km.devicePixelRatio),e.deltaMode===km.WheelEvent.DOM_DELTA_LINE&&(t*=40));const i={x:e.clientX,y:e.clientY};0!==t&&t%i6==0&&(t=Math.floor(t/i6)),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:kye}=rR,r6="pointermove",s6="pointerover",o6="pointerout",a6="pointerleave";class Fye{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=kye.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===r6&&(this.enableMoveEvent=t),e===s6&&(this.enableOverEvent=t),e===o6&&(this.enableOutEvent=t),e===a6&&(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:s6,srcEvent:e,pointerType:"mouse",target:e.target})}handleOutEvent(e){this.enableOutEvent&&"mouseout"===e.type&&this.callback({type:o6,srcEvent:e,pointerType:"mouse",target:e.target})}handleLeaveEvent(e){this.enableLeaveEvent&&"mouseleave"===e.type&&this.callback({type:a6,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:r6,srcEvent:e,pointerType:"mouse",target:e.target});break;case"mouseup":this.pressed=!1}}}const{KEY_EVENTS:Nye}=rR,l6="keydown";class Lye{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=Nye.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===l6&&(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:l6,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 u6="contextmenu";class Bye{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===u6&&(this.options.enable=t)}handleEvent(e){!this.options.enable||this.callback({type:u6,center:{x:e.clientX,y:e.clientY},srcEvent:e,pointerType:"mouse",target:e.target})}}const Vye={pointerdown:1,pointermove:2,pointerup:4,mousedown:1,mousemove:2,mouseup:4},d6={srcElement:"root",priority:0};class Zye{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({},d6,i):d6;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&&JH[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 Rye(e,this._onOtherEvent,{enable:!1}),this.moveInput=new Fye(e,this._onOtherEvent,{enable:!1}),this.keyInput=new Lye(e,this._onOtherEvent,{enable:!1,tabIndex:t.tabIndex}),this.contextmenuInput=new Bye(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=Mye[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=e6[e]||e;let c=a.get(l);c||(c=new Zye(this),a.set(l,c),c.recognizerName=Tye[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(e6[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=xye[t.type];i&&this.manager.emit(i,e)}_onOtherEvent(e){this.manager.emit(e.type,e)}}function ap(){}const h6={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:ap,onResize:ap,onViewStateChange:ap,onInteractionStateChange:ap,onBeforeRender:ap,onAfterRender:ap,onLoad:ap,onError:(n,e)=>jn.error(n)(),_onMetrics:null,getCursor:({isDragging:n})=>n?"grabbing":"grab",debug:!1,drawPickingColors:!1};class sM{constructor(e){e=K(K({},h6),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&&jn.warn("View state tracking is disabled. Use either `initialViewState` for auto update or `viewState` for manual update.")(),"IE"===(0,Rm.qs)()&&jn.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 aI({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&&nb.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&&jn.removed("onLayerHover","onHover")(),"onLayerClick"in e&&jn.removed("onLayerClick","onClick")(),e.initialViewState&&!Sb(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](K({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),sc(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 _ye({width:t,height:i,useDevicePixels:d,autoResizeDrawingBuffer:f,autoResizeViewport:!1,gl:r,onCreateContext:p=>qU(Lt(K(K({},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 w_e({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,oI(e,{enable:!0,copyState:!0})),this.tooltip=new F_e(this.canvas),Xu(e,{blend:!0,blendFunc:[770,771,1,771],polygonOffsetFill:!0,depthTest:!0,depthFunc:515}),this.props.onWebGLInitialized(e);const t=new FH;t.play(),this.animationLoop.attachTimeline(t),this.eventManager=new Jye(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 IU)this.eventManager.on(r,this._onEvent);this.viewManager=new y_e({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 __e(e,{deck:this,stats:this.stats,viewport:i,timeline:t}),this.effectManager=new S_e,this.deckRenderer=new T_e(e),this.deckPicker=new R_e(e),this.setProps(this.props),this._updateCanvasSize(),this.props.onLoad()}_drawLayers(e,t){const{gl:i}=this.layerManager.context;Xu(i,this.props.parameters),this.props.onBeforeRender({gl:i}),this.deckRenderer.renderLayers(K({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(),jn.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=Lt(K({},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=IU[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=Jf.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}}sM.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(PH)),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}},sM.defaultProps=h6,sM.VERSION=oye.VERSION;const oM={name:"project32",dependencies:[HP],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"},ive={pickingSelectedColor:null,pickingHighlightColor:new Uint8Array([0,255,255,255]),pickingActive:!1,pickingAttribute:!1},aM=K({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=ive){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}}),f6={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6};class _h{static get DRAW_MODE(){return f6}constructor(e={}){const{id:t=ea("geometry"),drawMode:i=f6.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?K({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,nt(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?(nt(!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 nt(Number.isFinite(i)),i}}const p6=()=>{},cve={10241:9987,10240:9729,10242:33071,10243:33071};function uve(n){return Math.pow(2,Math.ceil(Math.log2(n)))}function dve(n,e,t,i){return t===e.width&&i===e.height?e:(n.canvas.height=i,n.canvas.width=t,n.clearRect(0,0,n.canvas.width,n.canvas.height),n.drawImage(e,0,0,e.width,e.height,0,0,t,i),n.canvas)}function Db(n){return n&&(n.id||n.url)}function g6(n,e,t){for(let i=0;i0){const{mapping:i,xOffset:r,yOffset:s,rowHeight:o,canvasHeight:a}=function({icons:n,buffer:e,mapping:t={},xOffset:i=0,yOffset:r=0,rowHeight:s=0,canvasWidth:o}){let a=[];for(let l=0;lo&&(g6(t,a,r),i=0,r=s+r+e,s=0,a=[]),a.push({icon:c,xOffset:i}),i=i+p+e,s=Math.max(s,f)}}return a.length>0&&g6(t,a,r),{mapping:t,rowHeight:s,xOffset:i,yOffset:r,canvasWidth:o,canvasHeight:uve(s+r+e)}}({icons:t,buffer:this._buffer,canvasWidth:this._canvasWidth,mapping:this._mapping,rowHeight:this._rowHeight,xOffset:this._xOffset,yOffset:this._yOffset});this._rowHeight=o,this._mapping=i,this._xOffset=r,this._yOffset=s,this._canvasHeight=a,this._texture||(this._texture=new na(this.gl,{width:this._canvasWidth,height:this._canvasHeight,parameters:cve})),this._texture.height!==this._canvasHeight&&(this._texture=function(n,e,t,i){const r=e.width,s=e.height,o=u4(e,{width:t,height:i});return function(n,e,t={}){const{sourceX:i=0,sourceY:r=0,targetMipmaplevel:s=0,targetInternalFormat:o=6408}=t;let{targetX:a,targetY:l,targetZ:c,width:d,height:f}=t;const{framebuffer:p,deleteFramebuffer:g}=tb(n);nt(p);const{gl:_,handle:y}=p,v=void 0!==a||void 0!==l||void 0!==c;a=a||0,l=l||0,c=c||0;const C=_.bindFramebuffer(36160,y);nt(e);let w=null;if(e instanceof ep&&(w=e,d=Number.isFinite(d)?d:w.width,f=Number.isFinite(f)?f:w.height,w.bind(0),e=w.target),v)switch(e){case 3553:case 34067:_.copyTexSubImage2D(e,s,a,l,i,r,d,f);break;case 35866:case 32879:eo(_).copyTexSubImage3D(e,s,a,l,c,i,r,d,f)}else _.copyTexImage2D(e,s,o,i,r,d,f,0);w&&w.unbind(),_.bindFramebuffer(36160,C||null),g&&p.delete()}(e,o,{targetY:0,width:r,height:s}),e.delete(),o}(0,this._texture,this._canvasWidth,this._canvasHeight)),this.onUpdate(),this._loadIcons(t)}}_loadIcons(e){const t=this._canvas.getContext("2d");for(const i of e)this._pendingCount++,wb(i.url,nR,this._loadOptions).then(r=>{const s=Db(i),{x:o,y:a,width:l,height:c}=this._mapping[s],d=dve(t,r,l,c);this._texture.setSubImageData({data:d,x:o,y:a,width:l,height:c}),this._texture.generateMipmap(),this.onUpdate()}).catch(r=>{this.onError({url:i.url,source:i.source,sourceIndex:i.sourceIndex,loadOptions:this._loadOptions,error:r})}).finally(()=>{this._pendingCount--})}}const m6=[0,0,0,255],mve={iconAtlas:{type:"image",value:null,async:!0},iconMapping:{type:"object",value:{},async:!0},sizeScale:{type:"number",value:1,min:0},billboard:!0,sizeUnits:"pixels",sizeMinPixels:{type:"number",min:0,value:0},sizeMaxPixels:{type:"number",min:0,value:Number.MAX_SAFE_INTEGER},alphaCutoff:{type:"number",value:.05,min:0,max:1},getPosition:{type:"accessor",value:n=>n.position},getIcon:{type:"accessor",value:n=>n.icon},getColor:{type:"accessor",value:m6},getSize:{type:"accessor",value:1},getAngle:{type:"accessor",value:0},getPixelOffset:{type:"accessor",value:[0,0]},onIconError:{type:"function",value:null,compare:!1,optional:!0}};let _ve=(()=>{class n extends Eb{getShaders(){return super.getShaders({vs:"#define SHADER_NAME icon-layer-vertex-shader\n\nattribute vec2 positions;\n\nattribute vec3 instancePositions;\nattribute vec3 instancePositions64Low;\nattribute float instanceSizes;\nattribute float instanceAngles;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\nattribute vec4 instanceIconFrames;\nattribute float instanceColorModes;\nattribute vec2 instanceOffsets;\nattribute vec2 instancePixelOffset;\n\nuniform float sizeScale;\nuniform vec2 iconsTextureDim;\nuniform float sizeMinPixels;\nuniform float sizeMaxPixels;\nuniform bool billboard;\n\nvarying float vColorMode;\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\nvarying vec2 uv;\n\nvec2 rotate_by_angle(vec2 vertex, float angle) {\n float angle_radian = angle * PI / 180.0;\n float cos_angle = cos(angle_radian);\n float sin_angle = sin(angle_radian);\n mat2 rotationMatrix = mat2(cos_angle, -sin_angle, sin_angle, cos_angle);\n return rotationMatrix * vertex;\n}\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n geometry.uv = positions;\n geometry.pickingColor = instancePickingColors;\n uv = positions;\n\n vec2 iconSize = instanceIconFrames.zw;\n float sizePixels = clamp(\n project_size_to_pixel(instanceSizes * sizeScale), \n sizeMinPixels, sizeMaxPixels\n );\n float instanceScale = iconSize.y == 0.0 ? 0.0 : sizePixels / iconSize.y;\n vec2 pixelOffset = positions / 2.0 * iconSize + instanceOffsets;\n pixelOffset = rotate_by_angle(pixelOffset, instanceAngles) * instanceScale;\n pixelOffset += instancePixelOffset;\n pixelOffset.y *= -1.0;\n\n if (billboard) {\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, vec3(0.0), geometry.position);\n vec3 offset = vec3(pixelOffset, 0.0);\n DECKGL_FILTER_SIZE(offset, geometry);\n gl_Position.xy += project_pixel_size_to_clipspace(offset.xy);\n\n } else {\n vec3 offset_common = vec3(project_pixel_size(pixelOffset), 0.0);\n DECKGL_FILTER_SIZE(offset_common, geometry);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, offset_common, geometry.position); \n }\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n vTextureCoords = mix(\n instanceIconFrames.xy,\n instanceIconFrames.xy + iconSize,\n (positions.xy + 1.0) / 2.0\n ) / iconsTextureDim;\n\n vColor = instanceColors;\n DECKGL_FILTER_COLOR(vColor, geometry);\n\n vColorMode = instanceColorModes;\n}\n",fs:"#define SHADER_NAME icon-layer-fragment-shader\n\nprecision highp float;\n\nuniform float opacity;\nuniform sampler2D iconsTexture;\nuniform float alphaCutoff;\n\nvarying float vColorMode;\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\nvarying vec2 uv;\n\nvoid main(void) {\n geometry.uv = uv;\n\n vec4 texColor = texture2D(iconsTexture, vTextureCoords);\n vec3 color = mix(texColor.rgb, vColor.rgb, vColorMode);\n float a = texColor.a * opacity * vColor.a;\n\n if (a < alphaCutoff) {\n discard;\n }\n\n gl_FragColor = vec4(color, a);\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:[oM,aM]})}initializeState(){this.state={iconManager:new gve(this.context.gl,{onUpdate:this._onUpdate.bind(this),onError:this._onError.bind(this)})},this.getAttributeManager().addInstanced({instancePositions:{size:3,type:5130,fp64:this.use64bitPositions(),transition:!0,accessor:"getPosition"},instanceSizes:{size:1,transition:!0,accessor:"getSize",defaultValue:1},instanceOffsets:{size:2,accessor:"getIcon",transform:this.getInstanceOffset},instanceIconFrames:{size:4,accessor:"getIcon",transform:this.getInstanceIconFrame},instanceColorModes:{size:1,type:5121,accessor:"getIcon",transform:this.getInstanceColorMode},instanceColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:!0,accessor:"getColor",defaultValue:m6},instanceAngles:{size:1,transition:!0,accessor:"getAngle"},instancePixelOffset:{size:2,transition:!0,accessor:"getPixelOffset"}})}updateState({oldProps:t,props:i,changeFlags:r}){super.updateState({props:i,oldProps:t,changeFlags:r});const s=this.getAttributeManager(),{iconAtlas:o,iconMapping:a,data:l,getIcon:c}=i,{iconManager:d}=this.state;d.setProps({loadOptions:i.loadOptions});let f=!1;if(o||this.internalState.isAsyncPropLoading("iconAtlas")?(t.iconAtlas!==i.iconAtlas&&d.setProps({iconAtlas:o,autoPacking:!1}),t.iconMapping!==i.iconMapping&&(d.setProps({iconMapping:a}),f=!0)):d.setProps({autoPacking:!0}),(r.dataChanged||r.updateTriggersChanged&&(r.updateTriggersChanged.all||r.updateTriggersChanged.getIcon))&&d.setProps({data:l,getIcon:c}),f&&(s.invalidate("instanceOffsets"),s.invalidate("instanceIconFrames"),s.invalidate("instanceColorModes")),r.extensionsChanged){var g;const{gl:_}=this.context;null===(g=this.state.model)||void 0===g||g.delete(),this.state.model=this._getModel(_),s.invalidateAll()}}get isLoaded(){return super.isLoaded&&this.state.iconManager.isLoaded}finalizeState(){super.finalizeState(),this.state.iconManager.finalize()}draw({uniforms:t}){const{sizeScale:i,sizeMinPixels:r,sizeMaxPixels:s,sizeUnits:o,billboard:a,alphaCutoff:l}=this.props,{iconManager:c}=this.state,{viewport:d}=this.context,f=c.getTexture();f&&this.state.model.setUniforms(t).setUniforms({iconsTexture:f,iconsTextureDim:[f.width,f.height],sizeScale:i*("pixels"===o?d.metersPerPixel:1),sizeMinPixels:r,sizeMaxPixels:s,billboard:a,alphaCutoff:l}).draw()}_getModel(t){return new Mm(t,Lt(K({},this.getShaders()),{id:this.props.id,geometry:new _h({drawMode:6,attributes:{positions:{size:2,value:new Float32Array([-1,-1,-1,1,1,1,1,-1])}}}),isInstanced:!0}))}_onUpdate(){this.setNeedsRedraw()}_onError(t){const{onIconError:i}=this.getCurrentLayer().props;i?i(t):jn.error(t.error)()}getInstanceOffset(t){const i=this.state.iconManager.getIconMapping(t);return[i.width/2-i.anchorX||0,i.height/2-i.anchorY||0]}getInstanceColorMode(t){return this.state.iconManager.getIconMapping(t).mask?1:0}getInstanceIconFrame(t){const i=this.state.iconManager.getIconMapping(t);return[i.x||0,i.y||0,i.width||0,i.height||0]}}return n.layerName="IconLayer",n.defaultProps=mve,n})();const y6=[],vve={getIconOffsets:{type:"accessor",value:n=>n.offsets},alphaCutoff:.001,smoothing:.1,outlineWidth:0,outlineColor:{type:"color",value:[0,0,0,255]}};let bve=(()=>{class n extends _ve{getShaders(){return Lt(K({},super.getShaders()),{fs:"#define SHADER_NAME multi-icon-layer-fragment-shader\n\nprecision highp float;\n\nuniform float opacity;\nuniform sampler2D iconsTexture;\nuniform float gamma;\nuniform bool sdf;\nuniform float alphaCutoff;\nuniform float buffer;\nuniform float outlineBuffer;\nuniform vec4 outlineColor;\n\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\nvarying vec2 uv;\n\nvoid main(void) {\n geometry.uv = uv;\n\n if (!picking_uActive) {\n float alpha = texture2D(iconsTexture, vTextureCoords).a;\n vec4 color = vColor;\n if (sdf) {\n float distance = alpha;\n alpha = smoothstep(buffer - gamma, buffer + gamma, distance);\n\n if (outlineBuffer > 0.0) {\n float inFill = alpha;\n float inBorder = smoothstep(outlineBuffer - gamma, outlineBuffer + gamma, distance);\n color = mix(outlineColor, vColor, inFill);\n alpha = inBorder;\n }\n }\n float a = alpha * color.a;\n \n if (a < alphaCutoff) {\n discard;\n }\n\n gl_FragColor = vec4(color.rgb, a * opacity);\n }\n\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n"})}initializeState(){super.initializeState(),this.getAttributeManager().addInstanced({instanceOffsets:{size:2,accessor:"getIconOffsets"},instancePickingColors:{type:5121,size:3,accessor:(i,{index:r,target:s})=>this.encodePickingColor(r,s)}})}updateState(t){super.updateState(t);const{props:i,oldProps:r}=t;let{outlineColor:s}=i;s!==r.outlineColor&&(s=s.map(o=>o/255),s[3]=Number.isFinite(s[3])?s[3]:1,this.setState({outlineColor:s})),!i.sdf&&i.outlineWidth&&jn.warn("".concat(this.id,": fontSettings.sdf is required to render outline"))()}draw(t){const{sdf:i,smoothing:r,outlineWidth:s}=this.props,{outlineColor:o}=this.state;t.uniforms=Lt(K({},t.uniforms),{buffer:.75,outlineBuffer:s?Math.max(r,.75*(1-s)):-1,gamma:r,sdf:Boolean(i),outlineColor:o}),super.draw(t)}getInstanceOffset(t){return t?Array.from(t).map(i=>super.getInstanceOffset(i)):y6}getInstanceColorMode(t){return 1}getInstanceIconFrame(t){return t?Array.from(t).map(i=>super.getInstanceIconFrame(i)):y6}}return n.layerName="MultiIconLayer",n.defaultProps=vve,n})();var Cve=ze(2),wve=ze.n(Cve);const Sve=[];function Mve(n){return Math.pow(2,Math.ceil(Math.log2(n)))}function v6(n,e,t,i){let r=0;for(let s=e;si&&(oa){let f=v6(n,a,l,r);c+f>i&&(oi&&(f=b6(n,a,l,i,r,s),o=s[s.length-1])),a=l,c+=f}}(n,r,s,t,i,o),o}function Dve(n,e,t,i,r,s){let o=0,a=0;for(let l=e;l0,d=[0,0],f=[];let p=0,g=0,_=0;for(let y=0;y<=s;y++){const v=n[y];if(("\n"===v||y===s)&&(_=y),_>g){const C=c?Ave(n,t,i,r,g,_):Sve;for(let w=0;w<=C.length;w++){const x=0===w?g:C[w-1],N=wi===e);t>=0&&this._order.splice(t,1)}_appendOrder(e){this._order.push(e)}}(3),Fve=["fontFamily","fontWeight","characterSet","fontSize","sdf","buffer","cutoff","radius"];function Lve(n,e){for(let t=0;t{o in e&&(this.props[o]=e[o])});const t=this._key;this._key=this._getKey();const i=function(n,e){const t=aR.get(n);if(!t)return e;const i=[];let s=Object.keys(t.mapping);s=new Set(s);let o=e;return o instanceof Array&&(o=new Set(o)),o.forEach(a=>{s.has(a)||i.push(a)}),i}(this._key,this.props.characterSet),r=aR.get(this._key);if(r&&0===i.length)return void(this._key!==t&&(this._atlas=r));const s=this._generateFontAtlas(this._key,i,r);this._atlas=s,aR.set(this._key,s)}_generateFontAtlas(e,t,i){const{fontFamily:r,fontWeight:s,fontSize:o,buffer:a,sdf:l,radius:c,cutoff:d}=this.props;let f=i&&i.data;f||(f=document.createElement("canvas"),f.width=1024);const p=f.getContext("2d");I6(p,r,o,s);const{mapping:g,canvasHeight:_,xOffset:y,yOffset:v}=function({characterSet:n,getFontWidth:e,fontHeight:t,buffer:i,maxCanvasWidth:r,mapping:s={},xOffset:o=0,yOffset:a=0}){let l=0,c=o,d=0;for(const p of n)if(!s[p]){const g=e(p,d++);c+g+2*i>r&&(c=0,l++),s[p]={x:c+i,y:a+l*(t+2*i)+i,width:g,height:t},c+=g+2*i}const f=t+2*i;return{mapping:s,xOffset:c,yOffset:a+l*f,canvasHeight:Mve(a+(l+1)*f)}}(K({getFontWidth:C=>p.measureText(C).width,fontHeight:1.2*o,buffer:a,characterSet:t,maxCanvasWidth:1024},i&&{mapping:i.mapping,xOffset:i.xOffset,yOffset:i.yOffset}));if(f.height!==_){const C=p.getImageData(0,0,f.width,f.height);f.height=_,p.putImageData(C,0,0)}if(I6(p,r,o,s),l){const C=new(wve())(o,a,c,d,r,s),w=p.getImageData(0,0,C.size,C.size);for(const x of t)Lve(C.draw(x),w),p.putImageData(w,g[x].x-a,g[x].y+a)}else for(const C of t)p.fillText(C,g[C].x,g[C].y+.9*o);return{xOffset:y,yOffset:v,mapping:g,data:f,width:f.width,height:f.height}}_getKey(){const{fontFamily:e,fontWeight:t,fontSize:i,buffer:r,sdf:s,radius:o,cutoff:a}=this.props;return s?"".concat(e," ").concat(t," ").concat(i," ").concat(r," ").concat(o," ").concat(a):"".concat(e," ").concat(t," ").concat(i," ").concat(r)}}const jve={billboard:!0,sizeScale:1,sizeUnits:"pixels",sizeMinPixels:0,sizeMaxPixels:Number.MAX_SAFE_INTEGER,padding:{type:"array",value:[0,0,0,0]},getPosition:{type:"accessor",value:n=>n.position},getSize:{type:"accessor",value:1},getAngle:{type:"accessor",value:0},getPixelOffset:{type:"accessor",value:[0,0]},getBoundingRect:{type:"accessor",value:[0,0,0,0]},getFillColor:{type:"accessor",value:[0,0,0,255]},getLineColor:{type:"accessor",value:[0,0,0,255]},getLineWidth:{type:"accessor",value:1}};let Uve=(()=>{class n extends Eb{getShaders(){return super.getShaders({vs:"#define SHADER_NAME text-background-layer-vertex-shader\n\nattribute vec2 positions;\n\nattribute vec3 instancePositions;\nattribute vec3 instancePositions64Low;\nattribute vec4 instanceRects;\nattribute float instanceSizes;\nattribute float instanceAngles;\nattribute vec2 instancePixelOffsets;\nattribute float instanceLineWidths;\nattribute vec4 instanceFillColors;\nattribute vec4 instanceLineColors;\nattribute vec3 instancePickingColors;\n\nuniform bool billboard;\nuniform float opacity;\nuniform float sizeScale;\nuniform float sizeMinPixels;\nuniform float sizeMaxPixels;\nuniform vec4 padding;\n\nvarying vec4 vFillColor;\nvarying vec4 vLineColor;\nvarying float vLineWidth;\nvarying vec2 uv;\nvarying vec2 dimensions;\n\nvec2 rotate_by_angle(vec2 vertex, float angle) {\n float angle_radian = radians(angle);\n float cos_angle = cos(angle_radian);\n float sin_angle = sin(angle_radian);\n mat2 rotationMatrix = mat2(cos_angle, -sin_angle, sin_angle, cos_angle);\n return rotationMatrix * vertex;\n}\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n geometry.uv = positions;\n geometry.pickingColor = instancePickingColors;\n uv = positions;\n vLineWidth = instanceLineWidths;\n float sizePixels = clamp(\n project_size_to_pixel(instanceSizes * sizeScale),\n sizeMinPixels, sizeMaxPixels\n );\n\n dimensions = instanceRects.zw * sizePixels + padding.xy + padding.zw;\n\n vec2 pixelOffset = (positions * instanceRects.zw + instanceRects.xy) * sizePixels + mix(-padding.xy, padding.zw, positions);\n pixelOffset = rotate_by_angle(pixelOffset, instanceAngles);\n pixelOffset += instancePixelOffsets;\n pixelOffset.y *= -1.0;\n\n if (billboard) {\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, vec3(0.0), geometry.position);\n vec3 offset = vec3(pixelOffset, 0.0);\n DECKGL_FILTER_SIZE(offset, geometry);\n gl_Position.xy += project_pixel_size_to_clipspace(offset.xy);\n } else {\n vec3 offset_common = vec3(project_pixel_size(pixelOffset), 0.0);\n DECKGL_FILTER_SIZE(offset_common, geometry);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, offset_common, geometry.position);\n }\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n vFillColor = vec4(instanceFillColors.rgb, instanceFillColors.a * opacity);\n DECKGL_FILTER_COLOR(vFillColor, geometry);\n vLineColor = vec4(instanceLineColors.rgb, instanceLineColors.a * opacity);\n DECKGL_FILTER_COLOR(vLineColor, geometry);\n}\n",fs:"#define SHADER_NAME text-background-layer-fragment-shader\n\nprecision highp float;\n\nuniform bool stroked;\n\nvarying vec4 vFillColor;\nvarying vec4 vLineColor;\nvarying float vLineWidth;\nvarying vec2 uv;\nvarying vec2 dimensions;\n\nvoid main(void) {\n geometry.uv = uv;\n\n vec2 pixelPosition = uv * dimensions;\n if (stroked) {\n float distToEdge = min(\n min(pixelPosition.x, dimensions.x - pixelPosition.x),\n min(pixelPosition.y, dimensions.y - pixelPosition.y)\n );\n float isBorder = smoothedge(distToEdge, vLineWidth);\n gl_FragColor = mix(vFillColor, vLineColor, isBorder);\n } else {\n gl_FragColor = vFillColor;\n }\n\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:[oM,aM]})}initializeState(){this.getAttributeManager().addInstanced({instancePositions:{size:3,type:5130,fp64:this.use64bitPositions(),transition:!0,accessor:"getPosition"},instanceSizes:{size:1,transition:!0,accessor:"getSize",defaultValue:1},instanceAngles:{size:1,transition:!0,accessor:"getAngle"},instanceRects:{size:4,accessor:"getBoundingRect"},instancePixelOffsets:{size:2,transition:!0,accessor:"getPixelOffset"},instanceFillColors:{size:4,transition:!0,normalized:!0,type:5121,accessor:"getFillColor",defaultValue:[0,0,0,255]},instanceLineColors:{size:4,transition:!0,normalized:!0,type:5121,accessor:"getLineColor",defaultValue:[0,0,0,255]},instanceLineWidths:{size:1,transition:!0,accessor:"getLineWidth",defaultValue:1}})}updateState({props:t,oldProps:i,changeFlags:r}){if(super.updateState({props:t,oldProps:i,changeFlags:r}),r.extensionsChanged){var s;const{gl:o}=this.context;null===(s=this.state.model)||void 0===s||s.delete(),this.state.model=this._getModel(o),this.getAttributeManager().invalidateAll()}}draw({uniforms:t}){const{viewport:i}=this.context,{billboard:r,sizeScale:s,sizeUnits:o,sizeMinPixels:a,sizeMaxPixels:l,getLineWidth:c}=this.props;let{padding:d}=this.props;const f="pixels"===o?i.metersPerPixel:1;d.length<4&&(d=[d[0],d[1],d[0],d[1]]),this.state.model.setUniforms(t).setUniforms({billboard:r,stroked:Boolean(c),padding:d,sizeScale:s*f,sizeMinPixels:a,sizeMaxPixels:l}).draw()}_getModel(t){return new Mm(t,Lt(K({},this.getShaders()),{id:this.props.id,geometry:new _h({drawMode:6,vertexCount:4,attributes:{positions:{size:2,value:new Float32Array([0,0,1,0,1,1,0,1])}}}),isInstanced:!0}))}}return n.layerName="TextBackgroundLayer",n.defaultProps=jve,n})();const P6={fontSize:64,buffer:4,sdf:!1,radius:12,cutoff:.25,smoothing:.1},R6={start:1,middle:0,end:-1},k6={top:1,center:0,bottom:-1},lR=[0,0,0,255],$ve=["fontSize","buffer","sdf","radius","cutoff"],Gve={billboard:!0,sizeScale:1,sizeUnits:"pixels",sizeMinPixels:0,sizeMaxPixels:Number.MAX_SAFE_INTEGER,background:!1,getBackgroundColor:{type:"accessor",value:[255,255,255,255]},getBorderColor:{type:"accessor",value:lR},getBorderWidth:{type:"accessor",value:0},backgroundPadding:{type:"array",value:[0,0,0,0]},characterSet:{type:"object",value:w6},fontFamily:E6,fontWeight:"normal",lineHeight:1,outlineWidth:{type:"number",value:0,min:0},outlineColor:{type:"color",value:lR},fontSettings:{},wordBreak:"break-word",maxWidth:{type:"number",value:-1},getText:{type:"accessor",value:n=>n.text},getPosition:{type:"accessor",value:n=>n.position},getColor:{type:"accessor",value:lR},getSize:{type:"accessor",value:32},getAngle:{type:"accessor",value:0},getTextAnchor:{type:"accessor",value:"middle"},getAlignmentBaseline:{type:"accessor",value:"center"},getPixelOffset:{type:"accessor",value:[0,0]},backgroundColor:{deprecatedFor:["background","getBackgroundColor"]}};let Wve=(()=>{class n extends MH{initializeState(){this.state={styleVersion:0,fontAtlasManager:new Bve}}updateState({props:t,oldProps:i,changeFlags:r}){const o=this.state.characterSet;(r.dataChanged||r.updateTriggersChanged&&(r.updateTriggersChanged.all||r.updateTriggersChanged.getText))&&this._updateText();const a=o!==this.state.characterSet||this._fontChanged(i,t);a&&this._updateFontAtlas(i,t),(a||t.lineHeight!==i.lineHeight||t.wordBreak!==i.wordBreak||t.maxWidth!==i.maxWidth)&&this.setState({styleVersion:this.state.styleVersion+1})}getPickingInfo({info:t}){return t.object=t.index>=0?this.props.data[t.index]:null,t}_updateFontAtlas(t,i){const{fontSettings:r,fontFamily:s,fontWeight:o}=i,{fontAtlasManager:a,characterSet:l}=this.state;a.setProps(Lt(K(K({},P6),r),{characterSet:l,fontFamily:s,fontWeight:o}))}_fontChanged(t,i){if(t.fontFamily!==i.fontFamily||t.fontWeight!==i.fontWeight)return!0;if(t.fontSettings===i.fontSettings)return!1;const r=t.fontSettings||{},s=i.fontSettings||{};return $ve.some(o=>r[o]!==s[o])}_updateText(){const{data:t,characterSet:i}=this.props,r=t.attributes&&t.attributes.getText;let a,{getText:s}=this.props,{startIndices:o}=t;const l="auto"===i&&new Set;if(r&&o){const{texts:c,characterCount:d}=function({value:n,length:e,stride:t,offset:i,startIndices:r,characterSet:s}){const o=n.BYTES_PER_ELEMENT,a=t?t/o:1,l=i?i/o:0,c=r[e]||Math.ceil((n.length-l)/a),d=s&&new Set,f=new Array(e);let p=n;if(a>1||l>0){p=new n.constructor(c);for(let g=0;gc[p]}else{const{iterable:c,objectInfo:d}=SS(t);o=[0],a=0;for(const f of c){d.index++;const p=Array.from(s(f,d)||"");l&&p.forEach(l.add,l),a+=p.length,o.push(a)}}this.setState({getText:s,startIndices:o,numInstances:a,characterSet:l||i})}getBoundingRect(t,i){const r=this.state.fontAtlasManager.mapping,{getText:s}=this.state,{wordBreak:o,maxWidth:a,lineHeight:l,getTextAnchor:c,getAlignmentBaseline:d}=this.props,f=s(t,i)||"",{size:[p,g]}=C6(f,l,o,a,r);return[(R6["function"==typeof c?c(t,i):c]-1)*p/2,(k6["function"==typeof d?d(t,i):d]-1)*g/2,p,g]}getIconOffsets(t,i){const r=this.state.fontAtlasManager.mapping,{getText:s}=this.state,{wordBreak:o,maxWidth:a,lineHeight:l,getTextAnchor:c,getAlignmentBaseline:d}=this.props,f=s(t,i)||"",{x:p,y:g,rowWidth:_,size:[y,v]}=C6(f,l,o,a,r),C=R6["function"==typeof c?c(t,i):c],w=k6["function"==typeof d?d(t,i):d],x=p.length,N=new Array(2*x);let V=0;for(let U=0;Ut*e/255)}const uR={name:"lights",vs:F6,fs:F6,getUniforms:function N6(n=qve){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?cR(n):[0,0,0],e.forEach((r,s)=>{i[`lighting_uPointLight[${s}].color`]=cR(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`]=cR(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 N6({lightSources:e})}return{}},defines:{MAX_LIGHTS:3}},Xve={};const Zve={name:"phong-lighting",dependencies:[uR],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=Xve){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}}},dR=Math.PI/180,lM=new Float32Array(16),V6=new Float32Array(12);function z6(n,e,t){const i=e[0]*dR,r=e[1]*dR,s=e[2]*dR,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 j6(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 U6={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 y;g?(lM.set(a),y=j6(lM)):(y=V6,z6(y,r,s),y.set(o,9)),n.value=new Float32Array(y)}else{let y=e*n.size;const{iterable:v,objectInfo:C}=SS(i,e,t);for(const w of v){let x;C.index++,g?(lM.set(c?a:a(w,C)),x=j6(lM)):(x=V6,z6(x,f?r:r(w,C),d?s:s(w,C)),x.set(p?o:o(w,C),9)),_[y++]=x[0],_[y++]=x[1],_[y++]=x[2],_[y++]=x[3],_[y++]=x[4],_[y++]=x[5],_[y++]=x[6],_[y++]=x[7],_[y++]=x[8],_[y++]=x[9],_[y++]=x[10],_[y++]=x[11]}}}};function H6(n,e){return e===qn.CARTESIAN||e===qn.METER_OFFSETS||e===qn.DEFAULT&&!n.isGeospatial}function $6(n,e){(n.COLOR_0||n.colors)&&e||(n.colors={constant:!0,value:new Float32Array([1,1,1])}),jn.assert(n.positions||n.POSITION,'no "postions" or "POSITION" attribute in mesh')}function ebe(n,e){if(n.attributes)return $6(n.attributes,e),n instanceof _h?n:new _h(n);if(n.positions||n.POSITION)return $6(n,e),new _h({attributes:n});throw Error("Invalid mesh")}const tbe={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 nbe=(()=>{class n extends Eb{getShaders(){const t=!In(this.context.gl),i={};return _I(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:[oM,Zve,aM],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:U6}),this.setState({emptyTexture:new na(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||H6(i,s),flatShading:!this.state.hasNormals}).draw()}getModel(t){const i=new Mm(this.context.gl,Lt(K({},this.getShaders()),{id:this.props.id,geometry:ebe(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=tbe,n})();const G6={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:[uR]};class Fm{constructor(e={}){const{id:t}=e;this.id=t||ea(this.constructor.name),this.display=!0,this.position=new to,this.rotation=new to,this.scale=new to(1,1,1),this.matrix=new $t,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 nt(3===e.length,"setPosition requires vector argument"),this.position=e,this}setRotation(e){return nt(3===e.length,"setRotation requires vector argument"),this.rotation=e,this}setScale(e){return nt(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){nt(e),t=t||this.matrix;const i=new $t(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 Ob extends Fm{constructor(e={}){e=Array.isArray(e)?{children:e}:e;const{children:t=[]}=e;vt.assert(t.every(i=>i instanceof Fm),"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 $t}={}){const i=new $t(t).multiplyRight(this.matrix);for(const r of this.children)r instanceof Ob?r.traverse(e,{worldMatrix:i}):e(r,{worldMatrix:i})}}function W6(){var n=new ia(4);return ia!=Float32Array&&(n[0]=0,n[1]=0,n[2]=0),n[3]=1,n}function q6(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 Y6(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 K6=w5,_be=function(){var n=m4(),e=_4(1,0,0),t=_4(0,1,0);return function(i,r,s){var o=y4(r,s);return o<-.999999?(wS(n,e,r),function(n){return Math.hypot(n[0],n[1],n[2])}(n)<1e-6&&wS(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),q6(i,n,Math.PI),i):o>.999999?(i[0]=0,i[1]=0,i[2]=0,i[3]=1,i):(wS(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))}}();W6(),W6(),function(){var n=new ia(9);ia!=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 ybe=[0,0,0,1],bbe={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Cbe={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function J6(n){if(!n._animation){const e=Cbe[n.componentType],t=bbe[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 q6(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]=ks(e)}get y(){return this[1]}set y(e){this[1]=ks(e)}get z(){return this[2]}set z(e){this[2]=ks(e)}get w(){return this[3]}set w(e){this[3]=ks(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 _be(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 Qu(!t),Y6(this,this,e),this.check()}multiplyLeft(e,t){return Qu(!t),Y6(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 K6(this,this,e),this.check()}slerp(e,t,i){switch(arguments.length){case 1:({start:e=ybe,target:t,ratio:i}=arguments[0]);break;case 2:[t,i]=arguments,e=this}return function(n,e,t,i){var p,g,_,y,v,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>Kc?(p=Math.acos(g),_=Math.sin(p),y=Math.sin((1-i)*p)/_,v=Math.sin(i*p)/_):(y=1-i,v=i),n[0]=y*r+v*l,n[1]=y*s+v*c,n[2]=y*o+v*d,n[3]=y*a+v*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),CS(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 Abe{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:vt.warn(`Bad animation path ${s}`)()}nt(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){hR.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:J6(e.accessors[a]),interpolation:l,output:J6(e.accessors[c])})),o=t.channels.map(({sampler:a,target:l})=>({sampler:s[a],target:e.nodes[l.node],path:l.path}));return new Abe({name:r,channels:o})})}animate(e){this.setTime(e)}setTime(e){this.animations.forEach(t=>t.animate(e))}getAnimations(){return this.animations}}class Obe extends Fm{constructor(e,t={}){super(t),this.onBeforeRender=null,this.AfterRender=null,e instanceof Mm?(this.model=e,this._setModelNodeProps(t)):this.model=new Mm(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 Ibe{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},_I(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 na(this.gl,K({id:e.name||e.id,parameters:K(K({},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&&(vt.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 e8(n,e){return In(n)?`#version 300 es\n${e}`:e}const Fbe={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Nbe={modelOptions:{},pbrDebug:!1,imageBasedLightingEnvironment:null,lights:!0,useTangents:!1};class Lbe{constructor(e,t={}){this.gl=e,this.options=Object.assign({},Nbe,t)}instantiate(e){return this.gltf=e,(e.scenes||[]).map(i=>this.createScene(i))}createAnimator(){return Array.isArray(this.gltf.animations)?new Dbe(this.gltf):null}createScene(e){const i=(e.nodes||[]).map(s=>this.createNode(s));return new Ob({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 Ob({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 $t).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 Ob({id:e.name||e.id,children:i});e._mesh=r}return e._mesh}getVertexCount(e){vt.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 Ibe(n,e);vt.info(4,"createGLTFModel defines: ",a.defines)();const l=[];l.push(...a.generatedTextures),l.push(...Object.values(s).map(d=>d.buffer));const c=new Obe(n,Object.assign({id:t,drawMode:i,vertexCount:r,modules:[G6],defines:a.defines,parameters:a.parameters,vs:e8(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:e8(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))),vt.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 Ai(this.gl,{id:`from-${i.id}`,data:i.data||e.value,target:t})),i.lumaBuffers[t]}createAccessor(e,t){return new ta({buffer:t,offset:e.byteOffset||0,stride:e.bufferView.byteStride||0,type:e.componentType,size:Fbe[e.type]})}createSampler(e){return e}needsPOT(){return!1}}function t8(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 Nm(i,this.metadata)}selectAt(...e){const t=e.map(i=>this.fields[i]).filter(Boolean);return new Nm(t,this.metadata)}assign(e){let t,i=this.metadata;if(e instanceof Nm){const o=e;t=o.fields,i=s8(s8(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 Nm(s,i)}}function s8(n,e){return new Map([...n||new Map,...e||new Map])}let cr,o8,a8,l8,c8,u8,d8,h8;!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"}(cr||(cr={}));class fR{static isNull(e){return e&&e.typeId===cr.Null}static isInt(e){return e&&e.typeId===cr.Int}static isFloat(e){return e&&e.typeId===cr.Float}static isBinary(e){return e&&e.typeId===cr.Binary}static isUtf8(e){return e&&e.typeId===cr.Utf8}static isBool(e){return e&&e.typeId===cr.Bool}static isDecimal(e){return e&&e.typeId===cr.Decimal}static isDate(e){return e&&e.typeId===cr.Date}static isTime(e){return e&&e.typeId===cr.Time}static isTimestamp(e){return e&&e.typeId===cr.Timestamp}static isInterval(e){return e&&e.typeId===cr.Interval}static isList(e){return e&&e.typeId===cr.List}static isStruct(e){return e&&e.typeId===cr.Struct}static isUnion(e){return e&&e.typeId===cr.Union}static isFixedSizeBinary(e){return e&&e.typeId===cr.FixedSizeBinary}static isFixedSizeList(e){return e&&e.typeId===cr.FixedSizeList}static isMap(e){return e&&e.typeId===cr.Map}static isDictionary(e){return e&&e.typeId===cr.Dictionary}get typeId(){return cr.NONE}compareTo(e){return this===e}}Symbol,Symbol,o8=Symbol.toStringTag;class Lm extends fR{constructor(e,t){super(),sn(this,"isSigned",void 0),sn(this,"bitWidth",void 0),this.isSigned=e,this.bitWidth=t}get typeId(){return cr.Int}get[o8](){return"Int"}toString(){return`${this.isSigned?"I":"Ui"}nt${this.bitWidth}`}}class qbe extends Lm{constructor(){super(!0,8)}}class Ybe extends Lm{constructor(){super(!0,16)}}class Xbe extends Lm{constructor(){super(!0,32)}}class Kbe extends Lm{constructor(){super(!1,8)}}class Zbe extends Lm{constructor(){super(!1,16)}}class Qbe extends Lm{constructor(){super(!1,32)}}a8=Symbol.toStringTag;class f8 extends fR{constructor(e){super(),sn(this,"precision",void 0),this.precision=e}get typeId(){return cr.Float}get[a8](){return"Float"}toString(){return`Float${this.precision}`}}class Jbe extends f8{constructor(){super(32)}}class e0e extends f8{constructor(){super(64)}}Symbol,Symbol,l8=Symbol.toStringTag,c8=Symbol.toStringTag,u8=Symbol.toStringTag,d8=Symbol.toStringTag,h8=Symbol.toStringTag;class t0e extends fR{constructor(e,t){super(),sn(this,"listSize",void 0),sn(this,"children",void 0),this.listSize=e,this.children=[t]}get typeId(){return cr.FixedSizeList}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get[h8](){return"FixedSizeList"}toString(){return`FixedSizeList[${this.listSize}]<${this.valueType}>`}}class uM{constructor(e,t,i=!1,r=new Map){sn(this,"name",void 0),sn(this,"type",void 0),sn(this,"nullable",void 0),sn(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 uM(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 p8(n,e,t){const i=t?g8(t.metadata):void 0,r=function(n){switch(n.constructor){case Int8Array:return new qbe;case Uint8Array:return new Kbe;case Int16Array:return new Ybe;case Uint16Array:return new Zbe;case Int32Array:return new Xbe;case Uint32Array:return new Qbe;case Float32Array:return new Jbe;case Float64Array:return new e0e;default:throw new Error("array type not supported")}}(e.value);return new uM(n,new t0e(e.size,new uM("value",r)),!1,i)}function g8(n){const e=new Map;for(const t in n)e.set(`${t}.string`,JSON.stringify(n[t]));return e}const m8={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},s0e={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array};class a0e{constructor(e){sn(this,"draco",void 0),sn(this,"decoder",void 0),sn(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=g8(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=p8(o,n[o],s[o]);r.push(l)}if(t){const o=p8("indices",t);r.push(o)}return new Nm(r,i)}(l.attributes,a,l.indices);return Lt(K({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 dM=ze(125);const _R={};function yR(n){return vR.apply(this,arguments)}function vR(){return(vR=yn(function*(n,e=null,t={}){return e&&(n=h0e(n,e,t)),_R[n]=_R[n]||f0e(n),yield _R[n]})).apply(this,arguments)}function h0e(n,e,t){if(n.startsWith("http"))return n;const i=t.modules||{};return i[n]?i[n]:_P?t.CDN?(Qc(t.CDN.startsWith("http")),`${t.CDN}/${e}@3.0.12/dist/libs/${n}`):yP?`../src/libs/${n}`:`modules/${e}/src/libs/${n}`:`modules/${e}/dist/libs/${n}`}function f0e(n){return bR.apply(this,arguments)}function bR(){return(bR=yn(function*(n){return n.endsWith("wasm")?yield(yield fetch(n)).arrayBuffer():_P?yP?importScripts(n):p0e(yield(yield fetch(n)).text(),n):dM.requireFromFile&&(yield dM.requireFromFile(n))})).apply(this,arguments)}function p0e(n,e){if(!_P)return dM.requireFromString&&dM.requireFromString(n,e);if(yP)return eval.call(yge,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 g0e="https://www.gstatic.com/draco/versioned/decoders/1.4.1/draco_decoder.js",m0e="https://www.gstatic.com/draco/versioned/decoders/1.4.1/draco_wasm_wrapper.js",_0e="https://www.gstatic.com/draco/versioned/decoders/1.4.1/draco_decoder.wasm";let Ib;function v0e(n){return CR.apply(this,arguments)}function CR(){return(CR=yn(function*(n){const e=n.modules||{};return Ib=e.draco3d?Ib||e.draco3d.createDecoderModule({}).then(t=>({draco:t})):Ib||b0e(n),yield Ib})).apply(this,arguments)}function b0e(n){return ER.apply(this,arguments)}function ER(){return(ER=yn(function*(n){let e,t;switch(n.draco&&n.draco.decoderType){case"js":e=yield yR(g0e,"draco",n);break;case"wasm":default:[e,t]=yield Promise.all([yield yR(m0e,"draco",n),yield yR(_0e,"draco",n)])}return e=e||globalThis.DracoDecoderModule,yield C0e(e,t)})).apply(this,arguments)}function C0e(n,e){const t={};return e&&(t.wasmBinary=e),new Promise(i=>{n(Lt(K({},t),{onModuleLoaded:r=>i({draco:r})}))})}const MR=Lt(K({},r8),{parse:function(n,e){return xR.apply(this,arguments)}});function xR(){return(xR=yn(function*(n,e){const{draco:t}=yield v0e(e),i=new a0e(t);try{return i.parseSync(n,null==e?void 0:e.draco)}finally{i.destroy()}})).apply(this,arguments)}function Rb(n,e){return sp(n>=0),sp(e>0),n+(e-1)&~(e-1)}function S0e(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+Rb(i.byteLength,4)}const _8=["SCALAR","VEC2","VEC3","VEC4"],M0e=[[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Uint32Array,5125],[Float32Array,5126],[Float64Array,5130]],x0e=new Map(M0e),T0e={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},A0e={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},D0e={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function y8(n){return _8[n-1]||_8[0]}function v8(n){const e=x0e.get(n.constructor);if(!e)throw new Error("Illegal typed array");return e}function b8(n,e){const t=D0e[n.componentType],i=T0e[n.type],s=n.count*i,o=n.count*i*A0e[n.componentType];return Pa(o>=0&&o<=e.byteLength),{ArrayType:t,length:s,byteLength:o}}const O0e={asset:{version:"2.0",generator:"loaders.gl"},buffers:[]};class vh{constructor(e){sn(this,"gltf",void 0),sn(this,"sourceBuffers",void 0),sn(this,"byteLength",void 0),this.gltf=e||{json:K({},O0e),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 Pa(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}=b8(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 Pa(t),this.json.extensions=this.json.extensions||{},this.json.extensions[e]=t,this.registerUsedExtension(e),t}addRequiredExtension(e,t={}){return Pa(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=eR(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;Pa(Number.isFinite(t)),this.sourceBuffers=this.sourceBuffers||[],this.sourceBuffers.push(e);const i={buffer:0,byteOffset:this.byteLength,byteLength:t};return this.byteLength+=Rb(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:y8(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:v8(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=S0e(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*j0e(n){for(const e of n.json.meshes||[])for(const t of e.primitives)yield t}function U0e(n){return DR.apply(this,arguments)}function DR(){return(DR=yn(function*(n){const e=new vh(n),{json:t}=e;e.removeExtension(fM);for(const i of t.materials||[])i.extensions&&i.extensions.KHR_materials_unlit&&(i.unlit=!0),e.removeObjectExtension(i,fM)})).apply(this,arguments)}function H0e(n){const e=new vh(n),{json:t}=e;if(e.materials)for(const i of t.materials||[])i.unlit&&(delete i.unlit,e.addObjectExtension(i,fM,{}),e.addExtension(fM))}function $0e(n){return OR.apply(this,arguments)}function OR(){return(OR=yn(function*(n){const e=new vh(n),{json:t}=e,i=e.getExtension(Bm);i&&(e.json.lights=i.lights,e.removeExtension(Bm));for(const r of t.nodes||[]){const s=e.getObjectExtension(r,Bm);s&&(r.light=s.light),e.removeObjectExtension(r,Bm)}})).apply(this,arguments)}function G0e(n){return IR.apply(this,arguments)}function IR(){return(IR=yn(function*(n){const e=new vh(n),{json:t}=e;if(t.lights){const i=e.addExtension(Bm);Pa(!i.lights),i.lights=t.lights,delete t.lights}if(e.json.lights){for(const i of e.json.lights)e.addObjectExtension(i.node,Bm,i);delete e.json.lights}})).apply(this,arguments)}function W0e(n){return PR.apply(this,arguments)}function PR(){return(PR=yn(function*(n){const e=new vh(n),{json:t}=e,i=e.getExtension(pM);if(i){const r=Y0e(i,e);for(const s of t.materials||[]){const o=e.getObjectExtension(s,pM);o&&(s.technique=Object.assign({},o,r[o.technique]),s.technique.values=X0e(s.technique,e)),e.removeObjectExtension(s,pM)}e.removeExtension(pM)}})).apply(this,arguments)}function q0e(n,e){return RR.apply(this,arguments)}function RR(){return(RR=yn(function*(n,e){})).apply(this,arguments)}function Y0e(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 X0e(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 E8={KHR_draco_mesh_compression:wt,KHR_materials_unlit:L,KHR_lights_punctual:It,KHR_techniques_webgl:Pt};function K0e(n){return kR.apply(this,arguments)}function kR(){return(kR=yn(function*(n,e={},t){for(const r in E8){var i;const s=(null==e||null===(i=e.gltf)||void 0===i?void 0:i.excludeExtensions)||{};r in s&&!s[r]||(yield E8[r].decode(n,e,t))}})).apply(this,arguments)}const S8={accessors:"accessor",animations:"animation",buffers:"buffer",bufferViews:"bufferView",images:"image",materials:"material",meshes:"mesh",nodes:"node",samplers:"sampler",scenes:"scene",skins:"skin",textures:"texture"},Q0e={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 J0e{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 vh(n),{json:t}=e;for(const i of t.images||[]){const r=e.removeObjectExtension(i,C8);r&&Object.assign(i,r)}t.buffers&&t.buffers[0]&&delete t.buffers[0].uri,e.removeExtension(C8)}(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 S8)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 S8)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=Q0e[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 eCe(n,e={}){return(new J0e).normalize(n,e)}const tCe={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},nCe={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},bl={TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,REPEAT:10497,LINEAR:9729,NEAREST_MIPMAP_LINEAR:9986},iCe={magFilter:bl.TEXTURE_MAG_FILTER,minFilter:bl.TEXTURE_MIN_FILTER,wrapS:bl.TEXTURE_WRAP_S,wrapT:bl.TEXTURE_WRAP_T},rCe={[bl.TEXTURE_MAG_FILTER]:bl.LINEAR,[bl.TEXTURE_MIN_FILTER]:bl.NEAREST_MIPMAP_LINEAR,[bl.TEXTURE_WRAP_S]:bl.REPEAT,[bl.TEXTURE_WRAP_]:bl.REPEAT};class aCe{postProcess(e,t={}){const{json:i,buffers:r=[],images:s=[],baseUri:o=""}=e;return Pa(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=K({},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=K({},e.normalTexture),e.normalTexture.texture=this.getTexture(e.normalTexture.index)),e.occlusionTexture&&(e.occlustionTexture=K({},e.occlustionTexture),e.occlusionTexture.texture=this.getTexture(e.occlusionTexture.index)),e.emissiveTexture&&(e.emmisiveTexture=K({},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=K({},e.pbrMetallicRoughness);const i=e.pbrMetallicRoughness;i.baseColorTexture&&(i.baseColorTexture=K({},i.baseColorTexture),i.baseColorTexture.texture=this.getTexture(i.baseColorTexture.index)),i.metallicRoughnessTexture&&(i.metallicRoughnessTexture=K({},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 nCe[n]}(e.componentType),e.components=function(n){return tCe[n]}(e.type),e.bytesPerElement=e.bytesPerComponent*e.components,e.bufferView){const i=e.bufferView.buffer,{ArrayType:r,byteLength:s}=b8(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):rCe,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 iCe[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 lCe(n,e){return(new aCe).postProcess(n,e)}const M8=1735152710,Vm=!0;function NR(n,e,t,i){const r=new Uint8Array(e.buffer,t,i),o=new TextDecoder("utf8").decode(r);return n.json=JSON.parse(o),Rb(i,4)}function LR(n,e,t,i){return n.header.hasBinChunk=!0,n.binChunks.push({byteOffset:t,byteLength:i,arrayBuffer:e.buffer}),Rb(i,4)}function bCe(n,e){return BR.apply(this,arguments)}function BR(){return(BR=yn(function*(n,e,t=0,i,r){var s,o,a,l;CCe(n,e,t,i),eCe(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 wCe(n,i,r)),null!=i&&null!==(a=i.gltf)&&void 0!==a&&a.loadImages){const f=ECe(n,i,r);c.push(f)}const d=K0e(n,i,r);return c.push(d),yield Promise.all(c),null!=i&&null!==(l=i.gltf)&&void 0!==l&&l.postProcess?lCe(n,i):n})).apply(this,arguments)}function CCe(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=M8}=t,s=i.getUint32(e,!1);return s===r||s===M8}(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)?t8(n.buffer,n.byteOffset,e):n instanceof ArrayBuffer?t8(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,Vm),a=r.getUint32(t+8,Vm);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){sp(n.header.byteLength>20);const i=e.getUint32(t+0,Vm),r=e.getUint32(t+4,Vm);return t+=8,sp(0===r),NR(n,e,t,i),(t+=i)+LR(n,e,t,n.header.byteLength)}(n,r,t);case 2:return function(n,e,t,i){return sp(n.header.byteLength>20),function(n,e,t,i){for(;t+8<=n.header.byteLength;){const r=e.getUint32(t+0,Vm),s=e.getUint32(t+4,Vm);switch(t+=8,s){case 1313821514:NR(n,e,t,r);break;case 5130562:LR(n,e,t,r);break;case 0:i.strict||NR(n,e,t,r);break;case 1:i.strict||LR(n,e,t,r)}t+=Rb(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),Pa("glTF"===o.type,`Invalid GLB magic string ${o.type}`),n._glb=o,n.json=o.json}else Pa(!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 wCe(n,e,t){return VR.apply(this,arguments)}function VR(){return(VR=yn(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 TCe(()=>e.some(t=>!t.loaded))})).apply(this,arguments)}function TCe(n){return $R.apply(this,arguments)}function $R(){return($R=yn(function*(n){for(;n();)yield new Promise(e=>requestAnimationFrame(e))})).apply(this,arguments)}const x8=[255,255,255,255],OCe={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:x8},_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:[zm]};let ICe=(()=>{class n extends Eb{getShaders(){const t=[oM,aM];return"pbr"===this.props._lighting&&t.push(G6),{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:x8,transition:!0},instanceModelMatrix:U6})}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 Fm)r={scenes:[t.scenegraph]};else if(t.scenegraph&&!t.scenegraph.gltf){const l=t.scenegraph,c=function(n,e,t){const i=new Lbe(n,t);return{scenes:i.instantiate(e),animator:i.createAnimator()}}(i,l,this._getModelOptions());r=K({gltf:l},c),function(n){return HR.apply(this,arguments)}(c).then(()=>this.setNeedsRedraw())}else t.scenegraph&&(jn.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 Fm?(this._deleteScenegraph(),this._applyAllAttributes(o),this._applyAnimationsProp(o,a,t._animations),this.setState({scenegraph:o,animator:a})):null!==o&&jn.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):jn.warn("animation ".concat(o," not found"))()}})}_deleteScenegraph(){const{scenegraph:t}=this.state;t instanceof Fm&&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:K({isInstanced:!0,transpileToGLSL100:!In(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:H6(s,d),sceneModelMatrix:g,u_Camera:p.model.getUniforms().project_uCameraPosition}})})}}return n.layerName="ScenegraphLayer",n.defaultProps=OCe,n})();class PCe extends _h{constructor(e={}){const{id:t=ea("sphere-geometry")}=e,{indices:i,attributes:r}=function(n){const{nlat:e=10,nlong:t=10}=n;let{radius:i=1}=n;const o=Math.PI-0,c=2*Math.PI-0,d=(e+1)*(t+1);if("number"==typeof i){const C=i;i=(w,x,N,V,U)=>C}const f=new Float32Array(3*d),p=new Float32Array(3*d),g=new Float32Array(2*d),y=new(d>65535?Uint32Array:Uint16Array)(e*t*6);for(let C=0;C<=e;C++)for(let w=0;w<=t;w++){const x=w/t,N=C/e,V=w+C*(t+1),U=2*V,ee=3*V,de=c*x,ae=o*N,me=Math.sin(de),Ee=Math.cos(de),Be=Math.sin(ae),ne=Ee*Be,Ie=Math.cos(ae),Q=me*Be,je=i(ne,Ie,Q,x,N);f[ee+0]=je*ne,f[ee+1]=je*Ie,f[ee+2]=je*Q,p[ee+0]=ne,p[ee+1]=Ie,p[ee+2]=Q,g[U+0]=x,g[U+1]=1-N}const v=t+1;for(let C=0;Cs?(te=i,Be=1,ne=t):ne=e+Ee/s*(t-e),(-2===Ee||Ee===s+2)&&(ne=0,Be=0),te-=i/2;for(let Ie=0;Ies?0:Q*y,ee[ae+V[1]]=Ee<0?-1:Ee>s?1:v,ee[ae+V[2]]=Ee<0||Ee>s?0:je*y,de[me+0]=Ie/r,de[me+1]=Be,me+=2,ae+=3}}for(let Ee=0;Ee0){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 S){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 S){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 S){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 S){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 S){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=GCe,s=1/i;r.set(this.x*s,this.y*s,this.z*s);const o=WCe;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(A8),A8.almostEquals(e,t)}clone(){return new S(this.x,this.y,this.z)}}S.ZERO=void 0,S.UNIT_X=void 0,S.UNIT_Y=void 0,S.UNIT_Z=void 0,S.ZERO=new S(0,0,0),S.UNIT_X=new S(1,0,0),S.UNIT_Y=new S(0,1,0),S.UNIT_Z=new S(0,0,1);const GCe=new S,WCe=new S,A8=new S;class Di{constructor(e={}){this.lowerBound=void 0,this.upperBound=void 0,this.lowerBound=new S,this.upperBound=new S,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=O8;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=O8;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 D8=new S,O8=[new S,new S,new S,new S,new S,new S,new S,new S];class kr{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 S){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=YCe;e.tangents(i,XCe),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(Ui(e.length(),2)*Ui(t.length(),2))+e.dot(t),this.normalize()}return this}mult(e,t=new kr){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 kr){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 kr){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 S){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 kr(this.x,this.y,this.z,this.w)}slerp(e,t,i=new kr){const r=this.x,s=this.y,o=this.z,a=this.w;let p,g,_,y,v,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),y=Math.sin((1-t)*p)/_,v=Math.sin(t*p)/_):(y=1-t,v=t),i.x=y*r+v*l,i.y=y*s+v*c,i.z=y*o+v*d,i.w=y*a+v*f,i}integrate(e,t,i,r=new kr){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 YCe=new S,XCe=new S,KCe={SPHERE:1,PLANE:2,BOX:4,COMPOUND:8,CONVEXPOLYHEDRON:16,HEIGHTFIELD:32,PARTICLE:64,CYLINDER:128,TRIMESH:256};let bt=(()=>{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=KCe,n})();class ni{constructor(e={}){this.position=void 0,this.quaternion=void 0,this.position=new S,this.quaternion=new kr,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 S){return this.quaternion.vmult(e,t),t}static pointToLocalFrame(e,t,i,r=new S){return i.vsub(e,r),t.conjugate(P8),P8.vmult(r,r),r}static pointToWorldFrame(e,t,i,r=new S){return t.vmult(i,r),r.vadd(e,r),r}static vectorToWorldFrame(e,t,i=new S){return e.vmult(t,i),i}static vectorToLocalFrame(e,t,i,r=new S){return t.w*=-1,t.vmult(i,r),t.w*=-1,r}}const P8=new kr;class lp extends bt{constructor(e={}){const{vertices:t=[],faces:i=[],normals:r=[],axes:s,boundingSphereRadius:o}=e;super({type:bt.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 S;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=y,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 S,d=new S,f=new S,p=new S,g=new S,_=new S;let y=Number.MAX_VALUE;const v=this;if(v.uniqueAxes)for(let C=0;C!==v.uniqueAxes.length;C++){i.vmult(v.uniqueAxes[C],c);const w=v.testSepAxis(c,e,t,i,r,s);if(!1===w)return!1;w0&&o.negate(o),!0}testSepAxis(e,t,i,r,s,o){lp.project(this,e,i,r,GR),lp.project(t,e,s,o,WR);const l=GR[0],c=GR[1],d=WR[0],f=WR[1];if(l0?1/t:0,this.material=e.material||null,this.linearDamping="number"==typeof e.linearDamping?e.linearDamping:.01,this.type=t<=0?Ct.STATIC:Ct.DYNAMIC,typeof e.type==typeof Ct.STATIC&&(this.type=e.type),this.allowSleep=void 0===e.allowSleep||e.allowSleep,this.sleepState=Ct.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 S,this.quaternion=new kr,this.initQuaternion=new kr,this.previousQuaternion=new kr,this.interpolatedQuaternion=new kr,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 S,e.angularVelocity&&this.angularVelocity.copy(e.angularVelocity),this.initAngularVelocity=new S,this.shapes=[],this.shapeOffsets=[],this.shapeOrientations=[],this.inertia=new S,this.invInertia=new S,this.invInertiaWorld=new ru,this.invMassSolve=0,this.invInertiaSolve=new S,this.invInertiaWorldSolve=new ru,this.fixedRotation=void 0!==e.fixedRotation&&e.fixedRotation,this.angularDamping=void 0!==e.angularDamping?e.angularDamping:.01,this.linearFactor=new S(1,1,1),e.linearFactor&&this.linearFactor.copy(e.linearFactor),this.angularFactor=new S(1,1,1),e.angularFactor&&this.angularFactor.copy(e.angularFactor),this.aabb=new Di,this.aabbNeedsUpdate=!0,this.boundingRadius=0,this.wlambda=new S,this.isTrigger=Boolean(e.isTrigger),e.shape&&this.addShape(e.shape),this.updateMassProperties()}wakeUp(){const e=this.sleepState;this.sleepState=Ct.AWAKE,this.wakeUpAfterNarrowphase=!1,e===Ct.SLEEPING&&this.dispatchEvent(Ct.wakeupEvent)}sleep(){this.sleepState=Ct.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=Ui(this.sleepSpeedLimit,2);t===Ct.AWAKE&&ir?this.wakeUp():t===Ct.SLEEPY&&e-this.timeLastSleepy>this.sleepTimeLimit&&(this.sleep(),this.dispatchEvent(Ct.sleepEvent))}}updateSolveMassProperties(){this.sleepState===Ct.SLEEPING||this.type===Ct.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 S){return e.vsub(this.position,t),this.quaternion.conjugate().vmult(t,t),t}vectorToLocalFrame(e,t=new S){return this.quaternion.conjugate().vmult(e,t),t}pointToWorldFrame(e,t=new S){return this.quaternion.vmult(e,t),t.vadd(this.position,t),t}vectorToWorldFrame(e,t=new S){return this.quaternion.vmult(e,t),t}addShape(e,t,i){const r=new S,s=new kr;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=JCe,o=ewe,a=this.quaternion,l=this.aabb,c=twe;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=nwe,r=iwe;i.setRotationFromQuaternion(this.quaternion),i.transpose(r),i.scale(t,i),i.mmult(r,this.invInertiaWorld)}}applyForce(e,t=new S){if(this.type!==Ct.DYNAMIC)return;this.sleepState===Ct.SLEEPING&&this.wakeUp();const i=rwe;t.cross(e,i),this.force.vadd(e,this.force),this.torque.vadd(i,this.torque)}applyLocalForce(e,t=new S){if(this.type!==Ct.DYNAMIC)return;const i=swe,r=owe;this.vectorToWorldFrame(e,i),this.vectorToWorldFrame(t,r),this.applyForce(i,r)}applyTorque(e){this.type===Ct.DYNAMIC&&(this.sleepState===Ct.SLEEPING&&this.wakeUp(),this.torque.vadd(e,this.torque))}applyImpulse(e,t=new S){if(this.type!==Ct.DYNAMIC)return;this.sleepState===Ct.SLEEPING&&this.wakeUp();const i=t,r=awe;r.copy(e),r.scale(this.invMass,r),this.velocity.vadd(r,this.velocity);const s=lwe;i.cross(e,s),this.invInertiaWorld.vmult(s,s),this.angularVelocity.vadd(s,this.angularVelocity)}applyLocalImpulse(e,t=new S){if(this.type!==Ct.DYNAMIC)return;const i=cwe,r=uwe;this.vectorToWorldFrame(e,i),this.vectorToWorldFrame(t,r),this.applyImpulse(i,r)}updateMassProperties(){const e=dwe;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),mM.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 S;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!==Ct.DYNAMIC&&this.type!==Ct.KINEMATIC||this.sleepState===Ct.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,y=this.angularFactor,v=l.x*y.x,C=l.y*y.y,w=l.z*y.z;s.x+=e*(_[0]*v+_[1]*C+_[2]*w),s.y+=e*(_[3]*v+_[4]*C+_[5]*w),s.z+=e*(_[6]*v+_[7]*C+_[8]*w),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()}}Ct.idCounter=0,Ct.COLLIDE_EVENT_NAME="collide",Ct.DYNAMIC=1,Ct.STATIC=2,Ct.KINEMATIC=4,Ct.AWAKE=0,Ct.SLEEPY=1,Ct.SLEEPING=2,Ct.wakeupEvent={type:"wakeup"},Ct.sleepyEvent={type:"sleepy"},Ct.sleepEvent={type:"sleep"};const JCe=new S,ewe=new kr,twe=new Di,nwe=new ru,iwe=new ru,rwe=new S,swe=new S,owe=new S,awe=new S,lwe=new S,cwe=new S,uwe=new S,dwe=new S;new S,new S;class _M{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 S,this.rayToWorld=new S,this.hitNormalWorld=new S,this.hitPointWorld=new S,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 R8,k8,F8,N8,L8,B8,V8;R8=bt.types.SPHERE,k8=bt.types.PLANE,F8=bt.types.BOX,N8=bt.types.CYLINDER,L8=bt.types.CONVEXPOLYHEDRON,B8=bt.types.HEIGHTFIELD,V8=bt.types.TRIMESH;class Hr{get[R8](){return this._intersectSphere}get[k8](){return this._intersectPlane}get[F8](){return this._intersectBox}get[N8](){return this._intersectConvex}get[L8](){return this._intersectConvex}get[B8](){return this._intersectHeightfield}get[V8](){return this._intersectTrimesh}constructor(e=new S,t=new 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 S,this.precision=1e-4,this.checkCollisionResponse=!0,this.skipBackfaces=!1,this.collisionFilterMask=-1,this.collisionFilterGroup=-1,this.mode=Hr.ANY,this.result=new _M,this.hasHit=!1,this.callback=i=>{}}intersectWorld(e,t){return this.mode=t.mode||Hr.ANY,this.result=t.result||new _M,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(z8),KR.length=0,e.broadphase.aabbQuery(e,z8,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=ywe,s=vwe;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 S(0,0,1);t.vmult(c,c);const d=new S;o.vsub(i,d);const f=d.dot(c);if(a.vsub(i,d),f*d.dot(c)>0||o.distanceTo(a)=0&&y<=1&&(o.lerp(a,y,g),g.vsub(i,_),_.normalize(),this.reportIntersection(_,g,s,r,-1)),this.result.shouldStop)return;v>=0&&v<=1&&(o.lerp(a,v,g),g.vsub(i,_),_.normalize(),this.reportIntersection(_,g,s,r,-1))}}_intersectConvex(e,t,i,r,s,o){const a=Swe,l=U8,c=o&&o.faceList||null,d=e.faces,f=e.vertices,p=e.faceNormals,g=this.direction,_=this.from,v=_.distanceTo(this.to),C=c?c.length:d.length,w=this.result;for(let x=0;!w.shouldStop&&xv||this.reportIntersection(a,ra,s,r,N)}}}}_intersectTrimesh(e,t,i,r,s,o){const a=Mwe,l=Iwe,c=Pwe,d=U8,f=xwe,p=Twe,g=Awe,_=Owe,y=Dwe,v=e.indices,C=this.from,w=this.to,x=this.direction;c.position.copy(i),c.quaternion.copy(t),ni.vectorToLocalFrame(i,t,x,f),ni.pointToLocalFrame(i,t,C,p),ni.pointToLocalFrame(i,t,w,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 N=p.distanceSquared(g);e.tree.rayQuery(this,c,l);for(let V=0,U=l.length;!this.result.shouldStop&&V!==U;V++){const ee=l[V];e.getNormal(ee,a),e.getVertex(v[3*ee],cc),cc.vsub(p,d);const de=f.dot(a),ae=a.dot(d)/de;if(ae<0)continue;f.scale(ae,ra),ra.vadd(p,ra),e.getVertex(v[3*ee+1],ou),e.getVertex(v[3*ee+2],au);const me=ra.distanceSquared(p);!Hr.pointInTriangle(ra,ou,cc,au)&&!Hr.pointInTriangle(ra,cc,ou,au)||me>N||(ni.vectorToWorldFrame(t,a,y),ni.pointToWorldFrame(i,t,ra,_),this.reportIntersection(y,_,s,r,ee))}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 Hr.ALL:this.hasHit=!0,c.set(o,a,e,t,i,r,l),c.hasHit=!0,this.callback(c);break;case Hr.CLOSEST:(l=0&&(f=s*c-o*a)>=0&&d+fDate.now()-n}var lu=ze(517);function $m(n,e,t){e||(e=new $t($t.IDENTITY));const i=new $t($t.IDENTITY);if(!n)return!0;if(n.matrix)i.copy(n.matrix);else{if(i.identity(),n.translation&&i.translate(n.translation),n.rotation){const s=new $t($t.IDENTITY).fromQuaternion(n.rotation);i.multiplyRight(s)}n.scale&&i.scale(n.scale)}const r=new $t(e).multiplyRight(i);if(!1===t(n,r,e))return!1;for(const s of n.nodes||n.children||[])if(!1===$m(s,r,t))return!1;return!0}function R$(){vH([r8,zm])}function k$(n,e){var t;const i=null===(t=e.nodes)||void 0===t?void 0:t.find(r=>r.name===n);if(i){let r=!1;for(const s of e.scenes)r||$m(s,new $t($t.IDENTITY),(o,a)=>o!==i||(o.matrix=a,o.translation=void 0,o.rotation=void 0,o.scale=void 0,r=!0,!1));return e.scene={id:n,name:n,nodes:[i]},e.scenes=[e.scene],{scene:e.scene,scenes:e.scenes}}return e}function ek(n,e){return yl(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 YS(i,zm,{DracoLoader:MR,gltf:{decompressMeshes:!0,postProcess:!0}});return r.nodes||console.log("WARNING: Empty Scene",t,r),k$(n.scenegraphNode,r)})}function RMe(n,e){return yl(this,void 0,void 0,function*(){return k$(n,yield e)})}function tk(n,e,t){if(e&&0!==e.length){let i;switch(t.geometry){case"sphere":i=new PCe;break;case"cone":i=new NCe;break;case"cylinder":i=new LCe;break;case"cube":default:i=new HCe}return new nbe(Object.assign({id:n,pickable:!0,autoHighlight:!1,highlightColor:[30,136,229,255],coordinateSystem:qn.CARTESIAN,data:e,mesh:i,wireframe:!1,getTransformMatrix:r=>r.transformMatrix,getColor:r=>r.color||[255,255,255,229.5]},t))}}function F$(n,e,t){if(e&&0!==e.length)return new Wve(Object.assign({id:n,pickable:!0,data:e.map(i=>Object.assign(Object.assign({},i),{position:new $t(i.transformMatrix).getTranslation()})),getText:i=>i.text,getPosition:i=>i.position,getColor:i=>i.color},t))}let FMe=(()=>{class n extends MH{initializeState(){const{data:t}=this.props;this.setState({data:null!=t?t:[],zoomOpacity:.8,doCollisions:!1}),R$()}renderLayers(){var t,i;const r=this.state,s={sphere:[],cone:[],cylinder:[],cube:[],text:[],wireframe:[],scenegraph:[]};for(const l of r.data){const c=null!==(t=l.geometry)&&void 0!==t?t:"cube";l.scenegraph?s.scenegraph.push(l):void 0!==s[c]&&s[c].push(l)}const o={};for(const l of s.scenegraph)l.scenegraph&&l.scenegraphNode&&!Object.prototype.hasOwnProperty.call(o,l.scenegraph)&&(o[l.scenegraph]=ek({scenegraph:l.scenegraph},n.gltfCache));const a=[];for(const[l,c]of Object.entries(s))if("scenegraph"===l)for(const d of c)a.push(new ICe({id:"models-"+d["@id"],opacity:d.zoomBasedOpacity?r.zoomOpacity:void 0!==d.opacity?d.opacity:1,pickable:!d.unpickable,coordinateSystem:qn.CARTESIAN,data:[d],scenegraph:d.scenegraphNode?RMe(d.scenegraphNode,o[d.scenegraph]):d.scenegraph,_lighting:d._lighting,getTransformMatrix:d.transformMatrix,getColor:null!==(i=d.color)&&void 0!==i?i:[0,255,0,127.5],parameters:{depthMask:!d.zoomBasedOpacity&&(void 0===d.opacity||1===d.opacity)}}));else"text"===l?(a.push(F$("text",c.filter(d=>d.unpickable),{pickable:!1})),a.push(F$("textPickable",c.filter(d=>!d.unpickable),{pickable:!0}))):"wireframe"===l?a.push(tk(l,c,{wireframe:!0,pickable:!1,geometry:l})):(a.push(tk(l,c.filter(d=>d.unpickable),{wireframe:!1,pickable:!1,geometry:l})),a.push(tk(`${l}Pickable`,c.filter(d=>!d.unpickable),{wireframe:!1,pickable:!0,geometry:l})));return r.doCollisions&&function(n){yl(this,void 0,void 0,function*(){console.log("Starting Collisioning");const e=n.filter(o=>!o.scenegraph&&"wireframe"!==o.geometry).map(o=>{const a=new $t(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 Di({lowerBound:new S(...l.map((d,f)=>Math.min(d,c[f]))),upperBound:new S(...c.map((d,f)=>Math.max(d,l[f])))})}}),t=[];for(const o of n.filter(a=>!!a.scenegraph)){const a=yield wb(o.scenegraph,zm,{DracoLoader:MR,decompress:!0,postProcess:!0});for(const l of a.scenes)$m(l,new $t(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 Di({lowerBound:new S(...p.map((_,y)=>Math.min(_,g[y]))),upperBound:new S(...g.map((_,y)=>Math.max(_,p[y])))}),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})}(r.data),a.filter(l=>!!l)}getPickingInfo(t){return t.info}}return n.layerName="BodyUILayer",n.gltfCache={},n})();function N$(n,e=[]){for(const t of n.nodes||n.children||[])e.push(t.name),N$(t,e);return e}let LMe=(()=>{class n{constructor(t){var i,r,s,o,a;this.deckProps=t,this.bodyUILayer=new FMe({}),this.nodeClickSubject=new Se,this.nodeHoverStartSubject=new Se,this.nodeHoverStopSubject=new Se,this.sceneRotationSubject=new ar([0,0]),this.nodeDragStartSubject=new Se,this.nodeDragSubject=new Se,this.nodeDragEndSubject=new Se,this.nodeClick$=this.nodeClickSubject.pipe(Vs()),this.nodeHoverStart$=this.nodeHoverStartSubject.pipe(Vs()),this.nodeHoverStop$=this.nodeHoverStopSubject.pipe(Vs()),this.sceneRotation$=this.sceneRotationSubject.pipe(Vs()),this.nodeDragStart$=this.nodeDragStartSubject.pipe(Vs()),this.nodeDrag$=this.nodeDragSubject.pipe(Vs()),this.nodeDragEnd$=this.nodeDragEndSubject.pipe(Vs());const l=Object.assign(Object.assign({},t),{views:["orthographic"===t.camera?new Ame({flipY:!1,near:-1e3}):new Ime({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 GP({ambientLight:new OH({color:[255,255,255],intensity:10})})]),this.deck=new sM(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 yl(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 $t([.076,0,0,0,0,.076,16875389974302382e-33,0,0,-16875389974302382e-33,.076,0,.49,.034,.11,1]);(function(n,e,t,i){return yl(this,void 0,void 0,function*(){R$();const r=yield ek({scenegraph:n,scenegraphNode:"VHF_Kidney_L_Low1"},undefined),s={},o=[];for(const a of r.scenes)$m(a,e=new $t(e||$t.IDENTITY),(l,c)=>{const d={"@id":l.name||l.id,"@type":"ProcessedNode",transformMatrix:new $t(c),geometry:"wireframe",node:l};if(o.push({"@id":`GLTF:${d["@id"]}`,"@type":"GLTFNode",scenegraph:n,scenegraphNode:d["@id"],transformMatrix:new $t(e||$t.IDENTITY),tooltip:l.name||l.id,color:[255,255,255,255],_lighting:"pbr",zoomBasedOpacity:!0,node:l}),l.mesh&&l.mesh.primitives&&l.mesh.primitives.length>0)for(const f of l.mesh.primitives)if(f.attributes.POSITION&&f.attributes.POSITION.min){const p=c.transformAsPoint(f.attributes.POSITION.min,[]),g=c.transformAsPoint(f.attributes.POSITION.max,[]);d.bbox=new Di({lowerBound:new S(...p.map((_,y)=>Math.min(_,g[y]))),upperBound:new S(...g.map((_,y)=>Math.max(_,p[y])))})}return s[d["@id"]]=d,!0});for(const a of Object.values(s).filter(l=>!l.bbox)){for(const l of N$(a.node).map(c=>s[c]).filter(c=>c.bbox))a.bbox?a.bbox.extend(l.bbox):a.bbox=l.bbox.clone();a.bbox||delete s[a["@id"]]}for(const a of Object.values(s)){const l=a.bbox.lowerBound,f=(a.size=a.bbox.upperBound.clone().vsub(l)).clone().vmul(new S(.5,.5,.5)),p=a.center=l.clone().vadd(f);a.transformMatrix=new $t($t.IDENTITY).translate(p.toArray()).scale(f.toArray())}for(const a of o)s[a["@id"]]=a;return s})})(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 $t(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 xe([lu.ZP],n.prototype,"_onHover",null),xe([lu.ZP],n.prototype,"_onClick",null),xe([lu.ZP],n.prototype,"_onViewStateChange",null),xe([lu.ZP],n.prototype,"_onDragStart",null),xe([lu.ZP],n.prototype,"_onDrag",null),xe([lu.ZP],n.prototype,"_onDragEnd",null),n})();function BMe(n,e){return n===e}function VMe(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 nk=(()=>{class n{constructor(){this.bootstrap$=new If(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=ue({token:n,factory:n.\u0275fac}),n})();const ik=new ve("INITIAL_STATE_TOKEN");let UMe=(()=>{class n{static set(t){this.value=t}static pop(){const t=this.value;return this.value={},t}}return n.value={},n})();const L$=new ve("Internals.StateContextFactory"),B$=new ve("Internals.StateFactory");function V$(n,e){return e?t=>t.pipe(V$((i,r)=>ui(n(i,r)).pipe(Ae((s,o)=>e(i,s,r,o))))):t=>t.lift(new HMe(n))}class HMe{constructor(e){this.project=e}call(e,t){return t.subscribe(new $Me(e,this.project))}}class $Me extends ii{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 Gr(this),i=this.destination;i.add(t);const r=co(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 TM(n=null){return e=>e.lift(new GMe(n))}class GMe{constructor(e){this.defaultValue=e}call(e,t){return t.subscribe(new WMe(e,this.defaultValue))}}class WMe extends xt{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()}}const Ra={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 z$=(()=>{class n{constructor(t,i){this._ngZone=t,this._platformId=i,this.verifyZoneIsNotNooped(this._ngZone)}enter(t){return kD(this._platformId)?this.runInsideAngular(t):this.runOutsideAngular(t)}leave(t){return this.runInsideAngular(t)}runInsideAngular(t){return dt.isInAngularZone()?t():this._ngZone.run(t)}runOutsideAngular(t){return dt.isInAngularZone()?this._ngZone.runOutsideAngular(t):t()}verifyZoneIsNotNooped(t){t instanceof dt||console.warn(Ra.ZONE_WARNING())}}return n.\u0275fac=function(t){return new(t||n)(I(dt),I(dl))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();const j$=new ve("ROOT_STATE_TOKEN"),U$=new ve("FEATURE_STATE_TOKEN"),rk=new ve("NGXS_PLUGINS"),H$=new ve("NG_TEST_MODE"),G$=new ve("NG_DEV_MODE"),ld="NGXS_META",W$="NGXS_OPTIONS_META",sk="NGXS_SELECTOR_META";let fp=(()=>{class n{constructor(){this.defaultsState={},this.selectorOptions={injectContainerState:!0,suppressErrors:!0},this.compatibility={strictContentSecurityPolicy:!1},this.executionStrategy=z$}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();class qMe{constructor(e,t,i){this.previousValue=e,this.currentValue=t,this.firstChange=i}}const q$=new ve("NGXS_EXECUTION_STRATEGY");function pp(n){return n.constructor&&n.constructor.type?n.constructor.type:n.type}const ok=(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},Gm=(n,e)=>e.split(".").reduce((t,i)=>t&&t[i],n),ak=n=>n&&"object"==typeof n&&!Array.isArray(n),lk=(n,...e)=>{if(!e.length)return n;const t=e.shift();if(ak(n)&&ak(t))for(const i in t)ak(t[i])?(n[i]||Object.assign(n,{[i]:{}}),lk(n[i],t[i])):Object.assign(n,{[i]:t[i]});return lk(n,...e)};function ck(n){if(!n.hasOwnProperty(ld)){const e={name:null,actions:{},defaults:{},path:null,makeRootSelector:t=>t.getStateGetter(e.name),children:[]};Object.defineProperty(n,ld,{value:e})}return jb(n)}function jb(n){return n[ld]}function uk(n){return n.hasOwnProperty(sk)||Object.defineProperty(n,sk,{value:{makeRootSelector:null,originalFn:null,containerClass:null,selectorName:null,getSelectorOptions:()=>({})}}),dk(n)}function dk(n){return n[sk]}function Y$(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(e[pp(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 Fn(t=>{const i=pp(t.action);return n[i]&&(!e||e[t.status])})}(i,r),t())}}(n,["DISPATCHED"])}function sxe(){return Ae(n=>n.action)}function AM(n){return e=>new ce(t=>e.subscribe({next(i){n.leave(()=>t.next(i))},error(i){n.leave(()=>t.error(i))},complete(){n.leave(()=>t.complete())}}))}let DM=(()=>{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)(I(q$))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();class lxe extends Se{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 OM=(()=>{class n extends lxe{}return n.\u0275fac=function(){let e;return function(i){return(e||(e=$n(n)))(i||n)}}(),n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})(),cxe=(()=>{class n extends ce{constructor(t,i){super(r=>{const s=t.pipe(AM(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)(I(OM),I(DM))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();const K$=n=>(...e)=>n.shift()(...e,(...i)=>K$(n)(...i));let IM=(()=>{class n extends ar{constructor(){super({})}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})(),hk=(()=>{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)(I(n,12),I(rk,8))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})(),fk=(()=>{class n extends Se{}return n.\u0275fac=function(){let e;return function(i){return(e||(e=$n(n)))(i||n)}}(),n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})(),Z$=(()=>{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($o),this._errorHandler.handleError(r)}catch(s){}})}),i.pipe(AM(this._ngxsExecutionStrategy))}dispatchByEvents(t){return Array.isArray(t)?0===t.length?ht(this._stateStream.getValue()):Hv(t.map(i=>this.dispatchSingle(i))):this.dispatchSingle(t)}dispatchSingle(t){if(!pp(t))return Kg(new Error(`This action doesn't have a type property: ${t.constructor.name}`));const r=this._stateStream.getValue();return K$([...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(qc())}getActionResultStream(t){return this._actionResults.pipe(Fn(i=>i.action===t&&"DISPATCHED"!==i.status),yi(1),qc())}createDispatchObservable(t){return t.pipe(V$(i=>{switch(i.status){case"SUCCESSFUL":return ht(this._stateStream.getValue());case"ERRORED":return Kg(i.error);default:return ec}})).pipe(qc())}}return n.\u0275fac=function(t){return new(t||n)(I(Nt),I(OM),I(fk),I(hk),I(IM),I(DM))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();const Q$=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])&&Q$(n[i])}),n};let J$=(()=>{class n{constructor(t,i){this.isDevMode=t,this.isTestMode=i}}return n.\u0275fac=function(t){return new(t||n)(I(G$),I(H$))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})(),eG=(()=>{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(Ra.INCORRECT_PRODUCTION()):this.isIncorrectDevelopment&&console.warn(Ra.INCORRECT_DEVELOPMENT()))}}return n.\u0275fac=function(t){return new(t||n)(I(J$),I(fp))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})(),qm=(()=>{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=Q$(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)(I(IM),I(Z$),I(fp),I(eG))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})(),PM=(()=>{class n{constructor(t){this._internalStateOperations=t}createStateContext(t){const i=this._internalStateOperations.getRootStateOperations();function r(l){return Gm(l,t.path)}function s(l,c){const d=ok(l,t.path,c),f=t.instance;if(f.ngxsOnChanges){const p=X$(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(Ra.PATCHING_ARRAY());if("object"!=typeof n)throw new Error(Ra.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)(I(qm))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();class RM{static stateNameErrorMessage(e){return Ra.STATE_NAME(e)}static checkCorrectStateName(e){if(!e)throw new Error(Ra.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(Ra.STATE_UNIQUE(r,e.name,s.name));return r}static getValidStateMeta(e){const t=jb(e);if(!t)throw new Error(Ra.STATE_DECORATOR());return t}}RM.stateNameRegex=new RegExp("^[a-zA-Z0-9_]+$");let Ym=(()=>{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=xM(()=>{const c=this;function d(p){const g=c.statePaths[p];return g?Y$(g.split("."),c._config):null}return this._parentFactory?this._parentFactory.getRuntimeSelectorContext():{getStateGetter(p){let g=d(p);return g||((..._)=>(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(RM.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[ld].name};return n.reduce((t,i)=>{const{name:r,children:s}=i[ld];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[ld].name]=t,e),{})}(i),l=[];for(const c of s){const d=a[c],f=o[c],p=d[ld];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)=>ok(o,a.path,a.defaults),{}),states:r}}connectActionHandlers(){null===this._actionsSubscription&&(this._actionsSubscription=this._actions.pipe(Fn(t=>"DISPATCHED"===t.status),di(({action:t})=>this.invokeActions(this._actions,t).pipe(Ae(()=>({action:t,status:"SUCCESSFUL"})),TM({action:t,status:"CANCELED"}),Ta(i=>ht({action:t,status:"ERRORED",error:i}))))).subscribe(t=>this._actionResults.next(t)))}invokeActions(t,i){const r=pp(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=ui(d)),d instanceof ce?(d=d.pipe(TM({})),l.options.cancelUncompleted&&(d=d.pipe(Tn(t.pipe(nxe(i)))))):d=ht({}).pipe(qc()),s.push(d)}catch(d){s.push(Kg(d))}}}return s.length||s.push(ht({})),Hv(s)}addToStatesMap(t){const i=[],r=this.statesByName;for(const s of t){const o=RM.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!==Gm(this._initialState,i);return this.statesByName[t]&&r}}return n.\u0275fac=function(t){return new(t||n)(I(Nt),I(fp),I(n,12),I(OM),I(fk),I(PM),I(ik,8))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})(),pk=(()=>{class n{constructor(t,i,r){this.internalStateOperations=t,this.stateContextFactory=i,this.bootstrapper=r}ngxsBootstrap(t,i){this.internalStateOperations.getRootStateOperations().dispatch(t).pipe(Fn(()=>!!i),Ti(()=>this.invokeInit(i.states)),di(()=>this.bootstrapper.appBootstrapped$),Fn(r=>!!r)).subscribe(()=>this.invokeBootstrap(i.states))}invokeInit(t){for(const i of t){const r=i.instance;if(r.ngxsOnChanges){const a=X$(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)(I(qm),I(PM),I(nk))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();const kM_getOptions=n=>n&&n.NGXS_SELECTOR_OPTIONS_META||{};function nG(n){const e=dk(n)||jb(n);return e&&e.makeRootSelector||(()=>n)}let cu=(()=>{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(Ae(i),Ta(r=>{const{suppressErrors:s}=this._config.selectorOptions;return r instanceof TypeError&&s?ht(void 0):Kg(r)}),Zo(),AM(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(AM(this._internalExecutionStrategy)).subscribe(t)}snapshot(){return this._internalStateOperations.getRootStateOperations().getState()}reset(t){return this._internalStateOperations.getRootStateOperations().setState(t)}getStoreBoundSelectorFn(t){return nG(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)(I(IM),I(qm),I(fp),I(DM),I(Ym),I(ik,8))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})(),Ub=(()=>{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)(I(cu),I(fp))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n.store=null,n.config=null,n})();class iG{static get type(){return"@@INIT"}}class rG{constructor(e){this.addedStates=e}static get type(){return"@@UPDATE_STATE"}}const FM=new If(1);let _xe=(()=>{class n{constructor(t,i,r,s,o=[],a){!function(){try{const n=window.ng,t=!(n.probe&&n.coreTokens)&&Mo();FM.next(t)}catch(n){FM.next(!1)}finally{FM.complete()}}();const l=t.addAndReturnDefaults(o);i.setStateToTheCurrentWithNew(l),t.connectActionHandlers(),a.ngxsBootstrap(new iG,l)}}return n.\u0275fac=function(t){return new(t||n)(I(Ym),I(qm),I(cu),I(Ub),I(j$,8),I(pk))},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({}),n})(),yxe=(()=>{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 rG(l.defaults),l))}static flattenStates(t=[]){return t.reduce((i,r)=>i.concat(r),[])}}return n.\u0275fac=function(t){return new(t||n)(I(cu),I(qm),I(Ym),I(U$,8),I(pk))},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({}),n})();class Io{static forRoot(e=[],t={}){return{ngModule:_xe,providers:[Ym,PM,cxe,OM,nk,eG,J$,pk,Z$,fk,qm,DM,cu,IM,Ub,hk,...e,...Io.ngxsTokenProviders(e,t)]}}static forFeature(e=[]){return{ngModule:yxe,providers:[Ym,hk,...e,{provide:U$,multi:!0,useValue:e}]}}static ngxsTokenProviders(e,t){return[{provide:H$,useValue:jMe},{provide:G$,useValue:Mo},{provide:q$,useClass:t.executionStrategy||z$},{provide:j$,useValue:e},{provide:Io.ROOT_OPTIONS,useValue:t},{provide:fp,useFactory:Io.ngxsConfigFactory,deps:[Io.ROOT_OPTIONS]},{provide:bv,useFactory:Io.appBootstrapListenerFactory,multi:!0,deps:[nk]},{provide:ik,useFactory:Io.getInitialState},{provide:L$,useExisting:PM},{provide:B$,useExisting:Ym}]}static ngxsConfigFactory(e){return lk(new fp,e)}static appBootstrapListenerFactory(e){return()=>e.bootstrap()}static getInitialState(){return UMe.pop()}}function gk(n,e){return(t,i)=>{if(t.hasOwnProperty("prototype"))throw new Error(Ra.ACTION_DECORATOR());const s=ck(t.constructor);Array.isArray(n)||(n=[n]);for(const o of n){const a=o.type;s.actions[a]||(s.actions[a]=[]),s.actions[a].push({fn:i,options:e||{},type:a})}}}function cd(n){return i=>{!function(n){FM.subscribe(e=>{e&&(n.\u0275prov||console.warn(Ra.UNDECORATED_STATE_IN_IVY(n.name)))})}(i);const r=i,s=ck(r),o=Object.getPrototypeOf(r),a=function(i){return Object.assign({},i[W$]||{},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;RM.checkCorrectStateName(d),s.hasOwnProperty(ld)&&(r.actions=Object.assign({},r.actions,(s[ld]||{}).actions)),r.children=a,r.defaults=l,r.name=d})({meta:s,inheritedStateClass:o,optionsWithInheritance:a}),r[W$]=a}}function NM(n,...e){return function(t,i){const r=i.toString(),s=`__${r}__selector`,o=function(n,e,t=[]){return"string"==typeof(e=e||function(n){const e=n.length-1;return 36===n.charCodeAt(e)?n.slice(0,e):n}(n))?Y$(t.length?[e,...t]:e.split("."),Ub.config):e}(r,n,e);Object.defineProperties(t,{[s]:{writable:!0,enumerable:!1,configurable:!0},[r]:{enumerable:!0,configurable:!0,get(){return this[s]||(this[s]=function(n){if(!Ub.store)throw new Error(Ra.SELECT_FACTORY_NOT_CONNECTED());return Ub.store.select(n)}(o))}}})}}function Xm(n){return(e,t,i)=>{if(!i||null===i.value)throw new Error(Ra.SELECTOR_DECORATOR());const s=i.value,o=function(n,e,t){const i=t&&t.containerClass,s=xM(function(...c){const d=e.apply(i,c);return d instanceof Function?xM.apply(null,[d]):d});Object.setPrototypeOf(s,e);const o=function(n,e){const t=uk(n);t.originalFn=n;let i=()=>({});e&&(t.containerClass=e.containerClass,t.selectorName=e.selectorName,i=e.getSelectorOptions||i);const r=Object.assign({},t);return t.getSelectorOptions=()=>function(n,e){return Object.assign({},kM_getOptions(n.containerClass)||{},kM_getOptions(n.originalFn)||{},n.getSelectorOptions()||{},e)}(r,i()),t}(e,t);return o.makeRootSelector=l=>{const{argumentSelectorFunctions:c,selectorOptions:d}=function(n,e,t=[]){const i=e.getSelectorOptions(),r=n.getSelectorOptions(i);return{selectorOptions:r,argumentSelectorFunctions:function(n=[],e,t){const i=[];return t&&(0===n.length||e.injectContainerState)&&jb(t)&&i.push(t),n&&i.push(...n),i}(t,r,e.containerClass).map(a=>nG(a)(n))}}(l,o,n);return function(p){const g=c.map(_=>_(p));try{return s(...g)}catch(_){if(_ instanceof TypeError&&d.suppressErrors)return;throw _}}},s}(n,s,{containerClass:e,selectorName:t.toString(),getSelectorOptions:()=>({})}),a={configurable:!0,get:()=>o};return a.originalFn=s,a}}Io.\u0275fac=function(e){return new(e||Io)},Io.\u0275mod=Pe({type:Io}),Io.\u0275inj=Me({}),Io.ROOT_OPTIONS=new ve("ROOT_OPTIONS");let sG=(()=>{class n{constructor(t,i){this._renderer=t,this._elementRef=i,this.onChange=r=>{},this.onTouched=()=>{}}setProperty(t,i){this._renderer.setProperty(this._elementRef.nativeElement,t,i)}registerOnTouched(t){this.onTouched=t}registerOnChange(t){this.onChange=t}setDisabledState(t){this.setProperty("disabled",t)}}return n.\u0275fac=function(t){return new(t||n)(E(zc),E(rt))},n.\u0275dir=oe({type:n}),n})(),gp=(()=>{class n extends sG{}return n.\u0275fac=function(){let e;return function(i){return(e||(e=$n(n)))(i||n)}}(),n.\u0275dir=oe({type:n,features:[ct]}),n})();const ro=new ve("NgValueAccessor"),xxe={provide:ro,useExisting:T(()=>Hb),multi:!0},Axe=new ve("CompositionEventMode");let Hb=(()=>{class n extends sG{constructor(t,i,r){super(t,i),this._compositionMode=r,this._composing=!1,null==this._compositionMode&&(this._compositionMode=!function(){const n=Uc()?Uc().getUserAgent():"";return/android (\d+)/.test(n.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 n.\u0275fac=function(t){return new(t||n)(E(zc),E(rt),E(Axe,8))},n.\u0275dir=oe({type:n,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,i){1&t&&ge("input",function(s){return i._handleInput(s.target.value)})("blur",function(){return i.onTouched()})("compositionstart",function(){return i._compositionStart()})("compositionend",function(s){return i._compositionEnd(s.target.value)})},features:[Dt([xxe]),ct]}),n})();function Ch(n){return null==n||0===n.length}function aG(n){return null!=n&&"number"==typeof n.length}const Ss=new ve("NgValidators"),wh=new ve("NgAsyncValidators"),Dxe=/^(?=.{1,254}$)(?=.{1,64}@)[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[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])?)*$/;class lG{static min(e){return function(n){return e=>{if(Ch(e.value)||Ch(n))return null;const t=parseFloat(e.value);return!isNaN(t)&&t{if(Ch(e.value)||Ch(n))return null;const t=parseFloat(e.value);return!isNaN(t)&&t>n?{max:{max:n,actual:e.value}}:null}}(e)}static required(e){return function(n){return Ch(n.value)?{required:!0}:null}(e)}static requiredTrue(e){return function(n){return!0===n.value?null:{required:!0}}(e)}static email(e){return function(n){return Ch(n.value)||Dxe.test(n.value)?null:{email:!0}}(e)}static minLength(e){return function(n){return e=>Ch(e.value)||!aG(e.value)?null:e.value.lengthaG(e.value)&&e.value.length>n?{maxlength:{requiredLength:n,actualLength:e.value.length}}:null}(e)}static pattern(e){return function(n){if(!n)return Eh;let e,t;return"string"==typeof n?(t="","^"!==n.charAt(0)&&(t+="^"),t+=n,"$"!==n.charAt(n.length-1)&&(t+="$"),e=new RegExp(t)):(t=n.toString(),e=n),i=>{if(Ch(i.value))return null;const r=i.value;return e.test(r)?null:{pattern:{requiredPattern:t,actualValue:r}}}}(e)}static nullValidator(e){return null}static compose(e){return wG(e)}static composeAsync(e){return EG(e)}}function Eh(n){return null}function _G(n){return null!=n}function yG(n){const e=Og(n)?ui(n):n;return xw(e),e}function vG(n){let e={};return n.forEach(t=>{e=null!=t?Object.assign(Object.assign({},e),t):e}),0===Object.keys(e).length?null:e}function bG(n,e){return e.map(t=>t(n))}function CG(n){return n.map(e=>function(n){return!n.validate}(e)?e:t=>e.validate(t))}function wG(n){if(!n)return null;const e=n.filter(_G);return 0==e.length?null:function(t){return vG(bG(t,e))}}function mk(n){return null!=n?wG(CG(n)):null}function EG(n){if(!n)return null;const e=n.filter(_G);return 0==e.length?null:function(t){return Hv(bG(t,e).map(yG)).pipe(Ae(vG))}}function _k(n){return null!=n?EG(CG(n)):null}function SG(n,e){return null===n?[e]:Array.isArray(n)?[...n,e]:[n,e]}function MG(n){return n._rawValidators}function xG(n){return n._rawAsyncValidators}function yk(n){return n?Array.isArray(n)?n:[n]:[]}function LM(n,e){return Array.isArray(n)?n.includes(e):n===e}function TG(n,e){const t=yk(e);return yk(n).forEach(r=>{LM(t,r)||t.push(r)}),t}function AG(n,e){return yk(e).filter(t=>!LM(n,t))}let DG=(()=>{class n{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=mk(this._rawValidators)}_setAsyncValidators(t){this._rawAsyncValidators=t||[],this._composedAsyncValidatorFn=_k(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,i){return!!this.control&&this.control.hasError(t,i)}getError(t,i){return this.control?this.control.getError(t,i):null}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275dir=oe({type:n}),n})(),Po=(()=>{class n extends DG{get formDirective(){return null}get path(){return null}}return n.\u0275fac=function(){let e;return function(i){return(e||(e=$n(n)))(i||n)}}(),n.\u0275dir=oe({type:n,features:[ct]}),n})();class uc extends DG{constructor(){super(...arguments),this._parent=null,this.name=null,this.valueAccessor=null}}let vk=(()=>{class n extends class{constructor(e){this._cd=e}is(e){var t,i,r;return"submitted"===e?!!(null===(t=this._cd)||void 0===t?void 0:t.submitted):!!(null===(r=null===(i=this._cd)||void 0===i?void 0:i.control)||void 0===r?void 0:r[e])}}{constructor(t){super(t)}}return n.\u0275fac=function(t){return new(t||n)(E(uc,2))},n.\u0275dir=oe({type:n,selectors:[["","formControlName",""],["","ngModel",""],["","formControl",""]],hostVars:14,hostBindings:function(t,i){2&t&&st("ng-untouched",i.is("untouched"))("ng-touched",i.is("touched"))("ng-pristine",i.is("pristine"))("ng-dirty",i.is("dirty"))("ng-valid",i.is("valid"))("ng-invalid",i.is("invalid"))("ng-pending",i.is("pending"))},features:[ct]}),n})();function $b(n,e){wk(n,e),e.valueAccessor.writeValue(n.value),function(n,e){e.valueAccessor.registerOnChange(t=>{n._pendingValue=t,n._pendingChange=!0,n._pendingDirty=!0,"change"===n.updateOn&&PG(n,e)})}(n,e),function(n,e){const t=(i,r)=>{e.valueAccessor.writeValue(i),r&&e.viewToModelUpdate(i)};n.registerOnChange(t),e._registerOnDestroy(()=>{n._unregisterOnChange(t)})}(n,e),function(n,e){e.valueAccessor.registerOnTouched(()=>{n._pendingTouched=!0,"blur"===n.updateOn&&n._pendingChange&&PG(n,e),"submit"!==n.updateOn&&n.markAsTouched()})}(n,e),function(n,e){if(e.valueAccessor.setDisabledState){const t=i=>{e.valueAccessor.setDisabledState(i)};n.registerOnDisabledChange(t),e._registerOnDestroy(()=>{n._unregisterOnDisabledChange(t)})}}(n,e)}function zM(n,e,t=!0){const i=()=>{};e.valueAccessor&&(e.valueAccessor.registerOnChange(i),e.valueAccessor.registerOnTouched(i)),UM(n,e),n&&(e._invokeOnDestroyCallbacks(),n._registerOnCollectionChange(()=>{}))}function jM(n,e){n.forEach(t=>{t.registerOnValidatorChange&&t.registerOnValidatorChange(e)})}function wk(n,e){const t=MG(n);null!==e.validator?n.setValidators(SG(t,e.validator)):"function"==typeof t&&n.setValidators([t]);const i=xG(n);null!==e.asyncValidator?n.setAsyncValidators(SG(i,e.asyncValidator)):"function"==typeof i&&n.setAsyncValidators([i]);const r=()=>n.updateValueAndValidity();jM(e._rawValidators,r),jM(e._rawAsyncValidators,r)}function UM(n,e){let t=!1;if(null!==n){if(null!==e.validator){const r=MG(n);if(Array.isArray(r)&&r.length>0){const s=r.filter(o=>o!==e.validator);s.length!==r.length&&(t=!0,n.setValidators(s))}}if(null!==e.asyncValidator){const r=xG(n);if(Array.isArray(r)&&r.length>0){const s=r.filter(o=>o!==e.asyncValidator);s.length!==r.length&&(t=!0,n.setAsyncValidators(s))}}}const i=()=>{};return jM(e._rawValidators,i),jM(e._rawAsyncValidators,i),t}function PG(n,e){n._pendingDirty&&n.markAsDirty(),n.setValue(n._pendingValue,{emitModelToViewChange:!1}),e.viewToModelUpdate(n._pendingValue),n._pendingChange=!1}function RG(n,e){wk(n,e)}function Ek(n,e){if(!n.hasOwnProperty("model"))return!1;const t=n.model;return!!t.isFirstChange()||!Object.is(e,t.currentValue)}function kG(n,e){n._syncPendingControls(),e.forEach(t=>{const i=t.control;"submit"===i.updateOn&&i._pendingChange&&(t.viewToModelUpdate(i._pendingValue),i._pendingChange=!1)})}function Sk(n,e){if(!e)return null;let t,i,r;return Array.isArray(e),e.forEach(s=>{s.constructor===Hb?t=s:function(n){return Object.getPrototypeOf(n.constructor)===gp}(s)?i=s:r=s}),r||i||t||null}function HM(n,e){const t=n.indexOf(e);t>-1&&n.splice(t,1)}const Gb="VALID",$M="INVALID",Km="PENDING",Wb="DISABLED";function Mk(n){return(Tk(n)?n.validators:n)||null}function FG(n){return Array.isArray(n)?mk(n):n||null}function xk(n,e){return(Tk(e)?e.asyncValidators:n)||null}function NG(n){return Array.isArray(n)?_k(n):n||null}function Tk(n){return null!=n&&!Array.isArray(n)&&"object"==typeof n}class Ak{constructor(e,t){this._hasOwnPendingAsyncValidator=!1,this._onCollectionChange=()=>{},this._parent=null,this.pristine=!0,this.touched=!1,this._onDisabledChange=[],this._rawValidators=e,this._rawAsyncValidators=t,this._composedValidatorFn=FG(this._rawValidators),this._composedAsyncValidatorFn=NG(this._rawAsyncValidators)}get validator(){return this._composedValidatorFn}set validator(e){this._rawValidators=this._composedValidatorFn=e}get asyncValidator(){return this._composedAsyncValidatorFn}set asyncValidator(e){this._rawAsyncValidators=this._composedAsyncValidatorFn=e}get parent(){return this._parent}get valid(){return this.status===Gb}get invalid(){return this.status===$M}get pending(){return this.status==Km}get disabled(){return this.status===Wb}get enabled(){return this.status!==Wb}get dirty(){return!this.pristine}get untouched(){return!this.touched}get updateOn(){return this._updateOn?this._updateOn:this.parent?this.parent.updateOn:"change"}setValidators(e){this._rawValidators=e,this._composedValidatorFn=FG(e)}setAsyncValidators(e){this._rawAsyncValidators=e,this._composedAsyncValidatorFn=NG(e)}addValidators(e){this.setValidators(TG(e,this._rawValidators))}addAsyncValidators(e){this.setAsyncValidators(TG(e,this._rawAsyncValidators))}removeValidators(e){this.setValidators(AG(e,this._rawValidators))}removeAsyncValidators(e){this.setAsyncValidators(AG(e,this._rawAsyncValidators))}hasValidator(e){return LM(this._rawValidators,e)}hasAsyncValidator(e){return LM(this._rawAsyncValidators,e)}clearValidators(){this.validator=null}clearAsyncValidators(){this.asyncValidator=null}markAsTouched(e={}){this.touched=!0,this._parent&&!e.onlySelf&&this._parent.markAsTouched(e)}markAllAsTouched(){this.markAsTouched({onlySelf:!0}),this._forEachChild(e=>e.markAllAsTouched())}markAsUntouched(e={}){this.touched=!1,this._pendingTouched=!1,this._forEachChild(t=>{t.markAsUntouched({onlySelf:!0})}),this._parent&&!e.onlySelf&&this._parent._updateTouched(e)}markAsDirty(e={}){this.pristine=!1,this._parent&&!e.onlySelf&&this._parent.markAsDirty(e)}markAsPristine(e={}){this.pristine=!0,this._pendingDirty=!1,this._forEachChild(t=>{t.markAsPristine({onlySelf:!0})}),this._parent&&!e.onlySelf&&this._parent._updatePristine(e)}markAsPending(e={}){this.status=Km,!1!==e.emitEvent&&this.statusChanges.emit(this.status),this._parent&&!e.onlySelf&&this._parent.markAsPending(e)}disable(e={}){const t=this._parentMarkedDirty(e.onlySelf);this.status=Wb,this.errors=null,this._forEachChild(i=>{i.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(i=>i(!0))}enable(e={}){const t=this._parentMarkedDirty(e.onlySelf);this.status=Gb,this._forEachChild(i=>{i.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(i=>i(!1))}_updateAncestors(e){this._parent&&!e.onlySelf&&(this._parent.updateValueAndValidity(e),e.skipPristineCheck||this._parent._updatePristine(),this._parent._updateTouched())}setParent(e){this._parent=e}updateValueAndValidity(e={}){this._setInitialStatus(),this._updateValue(),this.enabled&&(this._cancelExistingSubscription(),this.errors=this._runValidator(),this.status=this._calculateStatus(),(this.status===Gb||this.status===Km)&&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)}_updateTreeValidity(e={emitEvent:!0}){this._forEachChild(t=>t._updateTreeValidity(e)),this.updateValueAndValidity({onlySelf:!0,emitEvent:e.emitEvent})}_setInitialStatus(){this.status=this._allControlsDisabled()?Wb:Gb}_runValidator(){return this.validator?this.validator(this):null}_runAsyncValidator(e){if(this.asyncValidator){this.status=Km,this._hasOwnPendingAsyncValidator=!0;const t=yG(this.asyncValidator(this));this._asyncValidationSubscription=t.subscribe(i=>{this._hasOwnPendingAsyncValidator=!1,this.setErrors(i,{emitEvent:e})})}}_cancelExistingSubscription(){this._asyncValidationSubscription&&(this._asyncValidationSubscription.unsubscribe(),this._hasOwnPendingAsyncValidator=!1)}setErrors(e,t={}){this.errors=e,this._updateControlsErrors(!1!==t.emitEvent)}get(e){return function(n,e,t){if(null==e||(Array.isArray(e)||(e=e.split(".")),Array.isArray(e)&&0===e.length))return null;let i=n;return e.forEach(r=>{i=i instanceof Dk?i.controls.hasOwnProperty(r)?i.controls[r]:null:i instanceof Uxe&&i.at(r)||null}),i}(this,e)}getError(e,t){const i=t?this.get(t):this;return i&&i.errors?i.errors[e]:null}hasError(e,t){return!!this.getError(e,t)}get root(){let e=this;for(;e._parent;)e=e._parent;return e}_updateControlsErrors(e){this.status=this._calculateStatus(),e&&this.statusChanges.emit(this.status),this._parent&&this._parent._updateControlsErrors(e)}_initObservables(){this.valueChanges=new Le,this.statusChanges=new Le}_calculateStatus(){return this._allControlsDisabled()?Wb:this.errors?$M:this._hasOwnPendingAsyncValidator||this._anyControlsHaveStatus(Km)?Km:this._anyControlsHaveStatus($M)?$M:Gb}_anyControlsHaveStatus(e){return this._anyControls(t=>t.status===e)}_anyControlsDirty(){return this._anyControls(e=>e.dirty)}_anyControlsTouched(){return this._anyControls(e=>e.touched)}_updatePristine(e={}){this.pristine=!this._anyControlsDirty(),this._parent&&!e.onlySelf&&this._parent._updatePristine(e)}_updateTouched(e={}){this.touched=this._anyControlsTouched(),this._parent&&!e.onlySelf&&this._parent._updateTouched(e)}_isBoxedValue(e){return"object"==typeof e&&null!==e&&2===Object.keys(e).length&&"value"in e&&"disabled"in e}_registerOnCollectionChange(e){this._onCollectionChange=e}_setUpdateStrategy(e){Tk(e)&&null!=e.updateOn&&(this._updateOn=e.updateOn)}_parentMarkedDirty(e){return!e&&!(!this._parent||!this._parent.dirty)&&!this._parent._anyControlsDirty()}}class Sh extends Ak{constructor(e=null,t,i){super(Mk(t),xk(i,t)),this._onChange=[],this._applyFormState(e),this._setUpdateStrategy(t),this._initObservables(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator})}setValue(e,t={}){this.value=this._pendingValue=e,this._onChange.length&&!1!==t.emitModelToViewChange&&this._onChange.forEach(i=>i(this.value,!1!==t.emitViewToModelChange)),this.updateValueAndValidity(t)}patchValue(e,t={}){this.setValue(e,t)}reset(e=null,t={}){this._applyFormState(e),this.markAsPristine(t),this.markAsUntouched(t),this.setValue(this.value,t),this._pendingChange=!1}_updateValue(){}_anyControls(e){return!1}_allControlsDisabled(){return this.disabled}registerOnChange(e){this._onChange.push(e)}_unregisterOnChange(e){HM(this._onChange,e)}registerOnDisabledChange(e){this._onDisabledChange.push(e)}_unregisterOnDisabledChange(e){HM(this._onDisabledChange,e)}_forEachChild(e){}_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(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}}class Dk extends Ak{constructor(e,t,i){super(Mk(t),xk(i,t)),this.controls=e,this._initObservables(),this._setUpdateStrategy(t),this._setUpControls(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator})}registerControl(e,t){return this.controls[e]?this.controls[e]:(this.controls[e]=t,t.setParent(this),t._registerOnCollectionChange(this._onCollectionChange),t)}addControl(e,t,i={}){this.registerControl(e,t),this.updateValueAndValidity({emitEvent:i.emitEvent}),this._onCollectionChange()}removeControl(e,t={}){this.controls[e]&&this.controls[e]._registerOnCollectionChange(()=>{}),delete this.controls[e],this.updateValueAndValidity({emitEvent:t.emitEvent}),this._onCollectionChange()}setControl(e,t,i={}){this.controls[e]&&this.controls[e]._registerOnCollectionChange(()=>{}),delete this.controls[e],t&&this.registerControl(e,t),this.updateValueAndValidity({emitEvent:i.emitEvent}),this._onCollectionChange()}contains(e){return this.controls.hasOwnProperty(e)&&this.controls[e].enabled}setValue(e,t={}){this._checkAllValuesPresent(e),Object.keys(e).forEach(i=>{this._throwIfControlMissing(i),this.controls[i].setValue(e[i],{onlySelf:!0,emitEvent:t.emitEvent})}),this.updateValueAndValidity(t)}patchValue(e,t={}){null!=e&&(Object.keys(e).forEach(i=>{this.controls[i]&&this.controls[i].patchValue(e[i],{onlySelf:!0,emitEvent:t.emitEvent})}),this.updateValueAndValidity(t))}reset(e={},t={}){this._forEachChild((i,r)=>{i.reset(e[r],{onlySelf:!0,emitEvent:t.emitEvent})}),this._updatePristine(t),this._updateTouched(t),this.updateValueAndValidity(t)}getRawValue(){return this._reduceChildren({},(e,t,i)=>(e[i]=t instanceof Sh?t.value:t.getRawValue(),e))}_syncPendingControls(){let e=this._reduceChildren(!1,(t,i)=>!!i._syncPendingControls()||t);return e&&this.updateValueAndValidity({onlySelf:!0}),e}_throwIfControlMissing(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: ${e}.`)}_forEachChild(e){Object.keys(this.controls).forEach(t=>{const i=this.controls[t];i&&e(i,t)})}_setUpControls(){this._forEachChild(e=>{e.setParent(this),e._registerOnCollectionChange(this._onCollectionChange)})}_updateValue(){this.value=this._reduceValue()}_anyControls(e){for(const t of Object.keys(this.controls)){const i=this.controls[t];if(this.contains(t)&&e(i))return!0}return!1}_reduceValue(){return this._reduceChildren({},(e,t,i)=>((t.enabled||this.disabled)&&(e[i]=t.value),e))}_reduceChildren(e,t){let i=e;return this._forEachChild((r,s)=>{i=t(i,r,s)}),i}_allControlsDisabled(){for(const e of Object.keys(this.controls))if(this.controls[e].enabled)return!1;return Object.keys(this.controls).length>0||this.disabled}_checkAllValuesPresent(e){this._forEachChild((t,i)=>{if(void 0===e[i])throw new Error(`Must supply a value for form control with name: '${i}'.`)})}}class Uxe extends Ak{constructor(e,t,i){super(Mk(t),xk(i,t)),this.controls=e,this._initObservables(),this._setUpdateStrategy(t),this._setUpControls(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator})}at(e){return this.controls[e]}push(e,t={}){this.controls.push(e),this._registerControl(e),this.updateValueAndValidity({emitEvent:t.emitEvent}),this._onCollectionChange()}insert(e,t,i={}){this.controls.splice(e,0,t),this._registerControl(t),this.updateValueAndValidity({emitEvent:i.emitEvent})}removeAt(e,t={}){this.controls[e]&&this.controls[e]._registerOnCollectionChange(()=>{}),this.controls.splice(e,1),this.updateValueAndValidity({emitEvent:t.emitEvent})}setControl(e,t,i={}){this.controls[e]&&this.controls[e]._registerOnCollectionChange(()=>{}),this.controls.splice(e,1),t&&(this.controls.splice(e,0,t),this._registerControl(t)),this.updateValueAndValidity({emitEvent:i.emitEvent}),this._onCollectionChange()}get length(){return this.controls.length}setValue(e,t={}){this._checkAllValuesPresent(e),e.forEach((i,r)=>{this._throwIfControlMissing(r),this.at(r).setValue(i,{onlySelf:!0,emitEvent:t.emitEvent})}),this.updateValueAndValidity(t)}patchValue(e,t={}){null!=e&&(e.forEach((i,r)=>{this.at(r)&&this.at(r).patchValue(i,{onlySelf:!0,emitEvent:t.emitEvent})}),this.updateValueAndValidity(t))}reset(e=[],t={}){this._forEachChild((i,r)=>{i.reset(e[r],{onlySelf:!0,emitEvent:t.emitEvent})}),this._updatePristine(t),this._updateTouched(t),this.updateValueAndValidity(t)}getRawValue(){return this.controls.map(e=>e instanceof Sh?e.value:e.getRawValue())}clear(e={}){this.controls.length<1||(this._forEachChild(t=>t._registerOnCollectionChange(()=>{})),this.controls.splice(0),this.updateValueAndValidity({emitEvent:e.emitEvent}))}_syncPendingControls(){let e=this.controls.reduce((t,i)=>!!i._syncPendingControls()||t,!1);return e&&this.updateValueAndValidity({onlySelf:!0}),e}_throwIfControlMissing(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 ${e}`)}_forEachChild(e){this.controls.forEach((t,i)=>{e(t,i)})}_updateValue(){this.value=this.controls.filter(e=>e.enabled||this.disabled).map(e=>e.value)}_anyControls(e){return this.controls.some(t=>t.enabled&&e(t))}_setUpControls(){this._forEachChild(e=>this._registerControl(e))}_checkAllValuesPresent(e){this._forEachChild((t,i)=>{if(void 0===e[i])throw new Error(`Must supply a value for form control at index: ${i}.`)})}_allControlsDisabled(){for(const e of this.controls)if(e.enabled)return!1;return this.controls.length>0||this.disabled}_registerControl(e){e.setParent(this),e._registerOnCollectionChange(this._onCollectionChange)}}const Hxe={provide:Po,useExisting:T(()=>mp)},qb=(()=>Promise.resolve(null))();let mp=(()=>{class n extends Po{constructor(t,i){super(),this.submitted=!1,this._directives=[],this.ngSubmit=new Le,this.form=new Dk({},mk(t),_k(i))}ngAfterViewInit(){this._setUpdateStrategy()}get formDirective(){return this}get control(){return this.form}get path(){return[]}get controls(){return this.form.controls}addControl(t){qb.then(()=>{const i=this._findContainer(t.path);t.control=i.registerControl(t.name,t.control),$b(t.control,t),t.control.updateValueAndValidity({emitEvent:!1}),this._directives.push(t)})}getControl(t){return this.form.get(t.path)}removeControl(t){qb.then(()=>{const i=this._findContainer(t.path);i&&i.removeControl(t.name),HM(this._directives,t)})}addFormGroup(t){qb.then(()=>{const i=this._findContainer(t.path),r=new Dk({});RG(r,t),i.registerControl(t.name,r),r.updateValueAndValidity({emitEvent:!1})})}removeFormGroup(t){qb.then(()=>{const i=this._findContainer(t.path);i&&i.removeControl(t.name)})}getFormGroup(t){return this.form.get(t.path)}updateModel(t,i){qb.then(()=>{this.form.get(t.path).setValue(i)})}setValue(t){this.control.setValue(t)}onSubmit(t){return this.submitted=!0,kG(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 n.\u0275fac=function(t){return new(t||n)(E(Ss,10),E(wh,10))},n.\u0275dir=oe({type:n,selectors:[["form",3,"ngNoForm","",3,"formGroup",""],["ng-form"],["","ngForm",""]],hostBindings:function(t,i){1&t&&ge("submit",function(s){return i.onSubmit(s)})("reset",function(){return i.onReset()})},inputs:{options:["ngFormOptions","options"]},outputs:{ngSubmit:"ngSubmit"},exportAs:["ngForm"],features:[Dt([Hxe]),ct]}),n})();const Gxe={provide:uc,useExisting:T(()=>Ok)},VG=(()=>Promise.resolve(null))();let Ok=(()=>{class n extends uc{constructor(t,i,r,s){super(),this.control=new Sh,this._registered=!1,this.update=new Le,this._parent=t,this._setValidators(i),this._setAsyncValidators(r),this.valueAccessor=Sk(0,s)}ngOnChanges(t){this._checkForErrors(),this._registered||this._setUpControl(),"isDisabled"in t&&this._updateDisabled(t),Ek(t,this.viewModel)&&(this._updateValue(this.model),this.viewModel=this.model)}ngOnDestroy(){this.formDirective&&this.formDirective.removeControl(this)}get path(){return this._parent?function(n,e){return[...e.path,n]}(this.name,this._parent):[this.name]}get formDirective(){return this._parent?this._parent.formDirective:null}viewToModelUpdate(t){this.viewModel=t,this.update.emit(t)}_setUpControl(){this._setUpdateStrategy(),this._isStandalone()?this._setUpStandalone():this.formDirective.addControl(this),this._registered=!0}_setUpdateStrategy(){this.options&&null!=this.options.updateOn&&(this.control._updateOn=this.options.updateOn)}_isStandalone(){return!this._parent||!(!this.options||!this.options.standalone)}_setUpStandalone(){$b(this.control,this),this.control.updateValueAndValidity({emitEvent:!1})}_checkForErrors(){this._isStandalone()||this._checkParentType(),this._checkName()}_checkParentType(){}_checkName(){this.options&&this.options.name&&(this.name=this.options.name),this._isStandalone()}_updateValue(t){VG.then(()=>{this.control.setValue(t,{emitViewToModelChange:!1})})}_updateDisabled(t){const i=t.isDisabled.currentValue,r=""===i||i&&"false"!==i;VG.then(()=>{r&&!this.control.disabled?this.control.disable():!r&&this.control.disabled&&this.control.enable()})}}return n.\u0275fac=function(t){return new(t||n)(E(Po,9),E(Ss,10),E(wh,10),E(ro,10))},n.\u0275dir=oe({type:n,selectors:[["","ngModel","",3,"formControlName","",3,"formControl",""]],inputs:{name:"name",isDisabled:["disabled","isDisabled"],model:["ngModel","model"],options:["ngModelOptions","options"]},outputs:{update:"ngModelChange"},exportAs:["ngModel"],features:[Dt([Gxe]),ct,zn]}),n})(),UG=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({}),n})();const Ik=new ve("NgModelWithFormControlWarning"),Kxe={provide:uc,useExisting:T(()=>GM)};let GM=(()=>{class n extends uc{constructor(t,i,r,s){super(),this._ngModelWarningConfig=s,this.update=new Le,this._ngModelWarningSent=!1,this._setValidators(t),this._setAsyncValidators(i),this.valueAccessor=Sk(0,r)}set isDisabled(t){}ngOnChanges(t){if(this._isControlChanged(t)){const i=t.form.previousValue;i&&zM(i,this,!1),$b(this.form,this),this.control.disabled&&this.valueAccessor.setDisabledState&&this.valueAccessor.setDisabledState(!0),this.form.updateValueAndValidity({emitEvent:!1})}Ek(t,this.viewModel)&&(this.form.setValue(this.model),this.viewModel=this.model)}ngOnDestroy(){this.form&&zM(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 n.\u0275fac=function(t){return new(t||n)(E(Ss,10),E(wh,10),E(ro,10),E(Ik,8))},n.\u0275dir=oe({type:n,selectors:[["","formControl",""]],inputs:{isDisabled:["disabled","isDisabled"],form:["formControl","form"],model:["ngModel","model"]},outputs:{update:"ngModelChange"},exportAs:["ngForm"],features:[Dt([Kxe]),ct,zn]}),n._ngModelWarningSentOnce=!1,n})();const Zxe={provide:Po,useExisting:T(()=>Zm)};let Zm=(()=>{class n extends Po{constructor(t,i){super(),this.validators=t,this.asyncValidators=i,this.submitted=!1,this._onCollectionChange=()=>this._updateDomValue(),this.directives=[],this.form=null,this.ngSubmit=new Le,this._setValidators(t),this._setAsyncValidators(i)}ngOnChanges(t){this._checkFormPresent(),t.hasOwnProperty("form")&&(this._updateValidators(),this._updateDomValue(),this._updateRegistrations(),this._oldForm=this.form)}ngOnDestroy(){this.form&&(UM(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 i=this.form.get(t.path);return $b(i,t),i.updateValueAndValidity({emitEvent:!1}),this.directives.push(t),i}getControl(t){return this.form.get(t.path)}removeControl(t){zM(t.control||null,t,!1),HM(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,i){this.form.get(t.path).setValue(i)}onSubmit(t){return this.submitted=!0,kG(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 i=t.control,r=this.form.get(t.path);i!==r&&(zM(i||null,t),r instanceof Sh&&($b(r,t),t.control=r))}),this.form._updateTreeValidity({emitEvent:!1})}_setUpFormContainer(t){const i=this.form.get(t.path);RG(i,t),i.updateValueAndValidity({emitEvent:!1})}_cleanUpFormContainer(t){if(this.form){const i=this.form.get(t.path);i&&function(n,e){return UM(n,e)}(i,t)&&i.updateValueAndValidity({emitEvent:!1})}}_updateRegistrations(){this.form._registerOnCollectionChange(this._onCollectionChange),this._oldForm&&this._oldForm._registerOnCollectionChange(()=>{})}_updateValidators(){wk(this.form,this),this._oldForm&&UM(this._oldForm,this)}_checkFormPresent(){}}return n.\u0275fac=function(t){return new(t||n)(E(Ss,10),E(wh,10))},n.\u0275dir=oe({type:n,selectors:[["","formGroup",""]],hostBindings:function(t,i){1&t&&ge("submit",function(s){return i.onSubmit(s)})("reset",function(){return i.onReset()})},inputs:{form:["formGroup","form"]},outputs:{ngSubmit:"ngSubmit"},exportAs:["ngForm"],features:[Dt([Zxe]),ct,zn]}),n})(),iW=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[UG]]}),n})(),Lk=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[iW]}),n})(),Bk=(()=>{class n{static withConfig(t){return{ngModule:n,providers:[{provide:Ik,useValue:t.warnOnNgModelWithFormControl}]}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[iW]}),n})();function Yb(n){return new ce(e=>{let t;try{t=n()}catch(r){return void e.error(r)}return(t?ui(t):bE()).subscribe(e)})}function Vk(n,e=Pf){const i=function(n){return n instanceof Date&&!isNaN(+n)}(n)?+n-e.now():Math.abs(n);return r=>r.lift(new m1e(i,e))}class m1e{constructor(e,t){this.delay=e,this.scheduler=t}call(e,t){return t.subscribe(new zk(e,this.delay,this.scheduler))}}class zk extends xt{constructor(e,t,i){super(e),this.delay=t,this.scheduler=i,this.queue=[],this.active=!1,this.errored=!1}static dispatch(e){const t=e.source,i=t.queue,r=e.scheduler,s=e.destination;for(;i.length>0&&i[0].time-r.now()<=0;)i.shift().notification.observe(s);if(i.length>0){const o=Math.max(0,i[0].time-r.now());this.schedule(e,o)}else this.unsubscribe(),t.active=!1}_schedule(e){this.active=!0,this.destination.add(e.schedule(zk.dispatch,this.delay,{source:this,destination:this.destination,scheduler:e}))}scheduleNotification(e){if(!0===this.errored)return;const t=this.scheduler,i=new _1e(t.now()+this.delay,e);this.queue.push(i),!1===this.active&&this._schedule(t)}_next(e){this.scheduleNotification(Ko.createNext(e))}_error(e){this.errored=!0,this.queue=[],this.destination.error(e),this.unsubscribe()}_complete(){this.scheduleNotification(Ko.createComplete()),this.unsubscribe()}}class _1e{constructor(e,t){this.time=e,this.notification=t}}const aW=tm({passive:!0});let lW=(()=>{class n{constructor(t,i){this._platform=t,this._ngZone=i,this._monitoredElements=new Map}monitor(t){if(!this._platform.isBrowser)return ec;const i=Wu(t),r=this._monitoredElements.get(i);if(r)return r.subject;const s=new Se,o="cdk-text-field-autofilled",a=l=>{"cdk-text-field-autofill-start"!==l.animationName||i.classList.contains(o)?"cdk-text-field-autofill-end"===l.animationName&&i.classList.contains(o)&&(i.classList.remove(o),this._ngZone.run(()=>s.next({target:l.target,isAutofilled:!1}))):(i.classList.add(o),this._ngZone.run(()=>s.next({target:l.target,isAutofilled:!0})))};return this._ngZone.runOutsideAngular(()=>{i.addEventListener("animationstart",a,aW),i.classList.add("cdk-text-field-autofill-monitored")}),this._monitoredElements.set(i,{subject:s,unlisten:()=>{i.removeEventListener("animationstart",a,aW)}}),s}stopMonitoring(t){const i=Wu(t),r=this._monitoredElements.get(i);r&&(r.unlisten(),r.subject.complete(),i.classList.remove("cdk-text-field-autofill-monitored"),i.classList.remove("cdk-text-field-autofilled"),this._monitoredElements.delete(i))}ngOnDestroy(){this._monitoredElements.forEach((t,i)=>this.stopMonitoring(i))}}return n.\u0275fac=function(t){return new(t||n)(I(si),I(dt))},n.\u0275prov=ue({factory:function(){return new n(I(si),I(dt))},token:n,providedIn:"root"}),n})(),cW=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[Rv]]}),n})();const k1e=new ve("MAT_INPUT_VALUE_ACCESSOR"),F1e=["button","checkbox","file","hidden","image","radio","range","reset","submit"];let N1e=0;const L1e=FO(class{constructor(n,e,t,i){this._defaultErrorStateMatcher=n,this._parentForm=e,this._parentFormGroup=t,this.ngControl=i}});let Xb=(()=>{class n extends L1e{constructor(t,i,r,s,o,a,l,c,d,f){super(a,s,o,r),this._elementRef=t,this._platform=i,this._autofillMonitor=c,this._formField=f,this._uid="mat-input-"+N1e++,this.focused=!1,this.stateChanges=new Se,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(_=>xV().has(_));const p=this._elementRef.nativeElement,g=p.nodeName.toLowerCase();this._inputValueAccessor=l||p,this._previousNativeValue=this.value,this.id=this.id,i.IOS&&d.runOutsideAngular(()=>{t.nativeElement.addEventListener("keyup",_=>{const y=_.target;!y.value&&0===y.selectionStart&&0===y.selectionEnd&&(y.setSelectionRange(1,1),y.setSelectionRange(0,0))})}),this._isServer=!this._platform.isBrowser,this._isNativeSelect="select"===g,this._isTextarea="textarea"===g,this._isInFormField=!!f,this._isNativeSelect&&(this.controlType=p.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=Mt(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=Mt(t)}get type(){return this._type}set type(t){this._type=t||"text",this._validateType(),!this._isTextarea&&xV().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=Mt(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,i;const r=(null===(i=null===(t=this._formField)||void 0===t?void 0:t._hideControlPlaceholder)||void 0===i?void 0:i.call(t))?null:this.placeholder;if(r!==this._previousPlaceholder){const s=this._elementRef.nativeElement;this._previousPlaceholder=r,r?s.setAttribute("placeholder",r):s.removeAttribute("placeholder")}}_dirtyCheckNativeValue(){const t=this._elementRef.nativeElement.value;this._previousNativeValue!==t&&(this._previousNativeValue=t,this.stateChanges.next())}_validateType(){F1e.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,i=t.options[0];return this.focused||t.multiple||!this.empty||!!(t.selectedIndex>-1&&i&&i.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 n.\u0275fac=function(t){return new(t||n)(E(rt),E(si),E(uc,10),E(mp,8),E(Zm,8),E(Vv),E(k1e,10),E(lW),E(dt),E(nS,8))},n.\u0275dir=oe({type:n,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,i){1&t&&ge("focus",function(){return i._focusChanged(!0)})("blur",function(){return i._focusChanged(!1)})("input",function(){return i._onInput()}),2&t&&(al("disabled",i.disabled)("required",i.required),nn("id",i.id)("data-placeholder",i.placeholder)("readonly",i.readonly&&!i._isNativeSelect||null)("aria-invalid",i.empty&&i.required?null:i.errorState)("aria-required",i.required),st("mat-input-server",i._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:[Dt([{provide:jv,useExisting:n}]),ct,zn]}),n})(),Kb=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({providers:[Vv],imports:[[cW,Uv,On],cW,Uv]}),n})();function ur(...n){const e=n.length;if(0===e)throw new Error("list of properties cannot be empty.");return t=>Ae(function(n,e){return i=>{let r=i;for(let s=0;si.lift(new U1e(n,e,t.leading,t.trailing))}class U1e{constructor(e,t,i,r){this.duration=e,this.scheduler=t,this.leading=i,this.trailing=r}call(e,t){return t.subscribe(new H1e(e,this.duration,this.scheduler,this.leading,this.trailing))}}class H1e extends xt{constructor(e,t,i,r,s){super(e),this.duration=t,this.scheduler=i,this.leading=r,this.trailing=s,this._hasTrailingValue=!1,this._trailingValue=null}_next(e){this.throttled?this.trailing&&(this._trailingValue=e,this._hasTrailingValue=!0):(this.add(this.throttled=this.scheduler.schedule($1e,this.duration,{subscriber:this})),this.leading?this.destination.next(e):this.trailing&&(this._trailingValue=e,this._hasTrailingValue=!0))}_complete(){this._hasTrailingValue?(this.destination.next(this._trailingValue),this.destination.complete()):this.destination.complete()}clearThrottle(){const e=this.throttled;e&&(this.trailing&&this._hasTrailingValue&&(this.destination.next(this._trailingValue),this._trailingValue=null,this._hasTrailingValue=!1),e.unsubscribe(),this.remove(e),this.throttled=null)}}function $1e(n){const{subscriber:e}=n;e.clearThrottle()}var hW=ze(266);const G1e={tooltipState:tc("state",[wr("initial, void, hidden",ti({opacity:0,transform:"scale(0)"})),wr("visible",ti({transform:"scale(1)"})),Qs("* => visible",Ao("200ms cubic-bezier(0, 0, 0.2, 1)",zie([ti({opacity:0,transform:"scale(0)",offset:0}),ti({opacity:.5,transform:"scale(0.99)",offset:.5}),ti({opacity:1,transform:"scale(1)",offset:1})]))),Qs("* => hidden",Ao("100ms cubic-bezier(0, 0, 0.2, 1)",ti({opacity:0})))])},fW="tooltip-panel",pW=tm({passive:!0}),gW=new ve("mat-tooltip-scroll-strategy"),X1e={provide:gW,deps:[Jo],useFactory:function(n){return()=>n.scrollStrategies.reposition({scrollThrottle:20})}},K1e=new ve("mat-tooltip-default-options",{providedIn:"root",factory:function(){return{showDelay:0,hideDelay:0,touchendHideDelay:1500}}});let Q1e=(()=>{class n{constructor(t,i,r,s,o,a,l,c,d,f,p,g){this._overlay=t,this._elementRef=i,this._scrollDispatcher=r,this._viewContainerRef=s,this._ngZone=o,this._platform=a,this._ariaDescriber=l,this._focusMonitor=c,this._dir=f,this._defaultOptions=p,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 Se,this._handleKeydown=_=>{this._isTooltipVisible()&&27===_.keyCode&&!Zs(_)&&(_.preventDefault(),_.stopPropagation(),this._ngZone.run(()=>this.hide(0)))},this._scrollStrategy=d,this._document=g,p&&(p.position&&(this.position=p.position),p.touchGestures&&(this.touchGestures=p.touchGestures)),f.change.pipe(Tn(this._destroyed)).subscribe(()=>{this._overlayRef&&this._updatePosition(this._overlayRef)}),o.runOutsideAngular(()=>{i.nativeElement.addEventListener("keydown",this._handleKeydown)})}get position(){return this._position}set position(t){var i;t!==this._position&&(this._position=t,this._overlayRef&&(this._updatePosition(this._overlayRef),null===(i=this._tooltipInstance)||void 0===i||i.show(0),this._overlayRef.updatePosition()))}get disabled(){return this._disabled}set disabled(t){this._disabled=Mt(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(Tn(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(([i,r])=>{t.removeEventListener(i,r,pW)}),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 i=this._createOverlay();this._detach(),this._portal=this._portal||new dm(this._tooltipComponent,this._viewContainerRef),this._tooltipInstance=i.attach(this._portal).instance,this._tooltipInstance.afterHidden().pipe(Tn(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),i=this._overlay.position().flexibleConnectedTo(this._elementRef).withTransformOriginOn(`.${this._cssClassPrefix}-tooltip`).withFlexibleDimensions(!1).withViewportMargin(this._viewportMargin).withScrollableContainers(t);return i.positionChanges.pipe(Tn(this._destroyed)).subscribe(r=>{this._updateCurrentPositionClass(r.connectionPair),this._tooltipInstance&&r.scrollableViewProperties.isOverlayClipped&&this._tooltipInstance.isVisible()&&this._ngZone.run(()=>this.hide(0))}),this._overlayRef=this._overlay.create({direction:this._dir,positionStrategy:i,panelClass:`${this._cssClassPrefix}-${fW}`,scrollStrategy:this._scrollStrategy()}),this._updatePosition(this._overlayRef),this._overlayRef.detachments().pipe(Tn(this._destroyed)).subscribe(()=>this._detach()),this._overlayRef.outsidePointerEvents().pipe(Tn(this._destroyed)).subscribe(()=>{var r;return null===(r=this._tooltipInstance)||void 0===r?void 0:r._handleBodyInteraction()}),this._overlayRef}_detach(){this._overlayRef&&this._overlayRef.hasAttached()&&this._overlayRef.detach(),this._tooltipInstance=null}_updatePosition(t){const i=t.getConfig().positionStrategy,r=this._getOrigin(),s=this._getOverlayPosition();i.withPositions([this._addOffset(Object.assign(Object.assign({},r.main),s.main)),this._addOffset(Object.assign(Object.assign({},r.fallback),s.fallback))])}_addOffset(t){return t}_getOrigin(){const t=!this._dir||"ltr"==this._dir.value,i=this.position;let r;"above"==i||"below"==i?r={originX:"center",originY:"above"==i?"top":"bottom"}:"before"==i||"left"==i&&t||"right"==i&&!t?r={originX:"start",originY:"center"}:("after"==i||"right"==i&&t||"left"==i&&!t)&&(r={originX:"end",originY:"center"});const{x:s,y:o}=this._invertPosition(r.originX,r.originY);return{main:r,fallback:{originX:s,originY:o}}}_getOverlayPosition(){const t=!this._dir||"ltr"==this._dir.value,i=this.position;let r;"above"==i?r={overlayX:"center",overlayY:"bottom"}:"below"==i?r={overlayX:"center",overlayY:"top"}:"before"==i||"left"==i&&t||"right"==i&&!t?r={overlayX:"end",overlayY:"center"}:("after"==i||"right"==i&&t||"left"==i&&!t)&&(r={overlayX:"start",overlayY:"center"});const{x:s,y:o}=this._invertPosition(r.overlayX,r.overlayY);return{main:r,fallback:{overlayX:s,overlayY:o}}}_updateTooltipMessage(){this._tooltipInstance&&(this._tooltipInstance.message=this.message,this._tooltipInstance._markForCheck(),this._ngZone.onMicrotaskEmpty.pipe(yi(1),Tn(this._destroyed)).subscribe(()=>{this._tooltipInstance&&this._overlayRef.updatePosition()}))}_setTooltipClass(t){this._tooltipInstance&&(this._tooltipInstance.tooltipClass=t,this._tooltipInstance._markForCheck())}_invertPosition(t,i){return"above"===this.position||"below"===this.position?"top"===i?i="bottom":"bottom"===i&&(i="top"):"end"===t?t="start":"start"===t&&(t="end"),{x:t,y:i}}_updateCurrentPositionClass(t){const{overlayY:i,originX:r,originY:s}=t;let o;if(o="center"===i?this._dir&&"rtl"===this._dir.value?"end"===r?"left":"right":"start"===r?"left":"right":"bottom"===i&&"top"===s?"above":"below",o!==this._currentPosition){const a=this._overlayRef;if(a){const l=`${this._cssClassPrefix}-${fW}-`;a.removePanelClass(l+this._currentPosition),a.addPanelClass(l+o)}this._currentPosition=o}}_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",i=>this._wheelListener(i)]);else if("off"!==this.touchGestures){this._disableNativeGesturesIfNecessary();const i=()=>{clearTimeout(this._touchstartTimeout),this.hide(this._defaultOptions.touchendHideDelay)};t.push(["touchend",i],["touchcancel",i])}this._addListeners(t),this._passiveListeners.push(...t)}_addListeners(t){t.forEach(([i,r])=>{this._elementRef.nativeElement.addEventListener(i,r,pW)})}_platformSupportsMouseEvents(){return!this._platform.IOS&&!this._platform.ANDROID}_wheelListener(t){if(this._isTooltipVisible()){const i=this._document.elementFromPoint(t.clientX,t.clientY),r=this._elementRef.nativeElement;i!==r&&!r.contains(i)&&this.hide()}}_disableNativeGesturesIfNecessary(){const t=this.touchGestures;if("off"!==t){const i=this._elementRef.nativeElement,r=i.style;("on"===t||"INPUT"!==i.nodeName&&"TEXTAREA"!==i.nodeName)&&(r.userSelect=r.msUserSelect=r.webkitUserSelect=r.MozUserSelect="none"),("on"===t||!i.draggable)&&(r.webkitUserDrag="none"),r.touchAction="none",r.webkitTapHighlightColor="transparent"}}}return n.\u0275fac=function(t){return new(t||n)(E(Jo),E(rt),E(um),E(ns),E(dt),E(si),E(IV),E(Sa),E(void 0),E(Qo),E(void 0),E(ut))},n.\u0275dir=oe({type:n,inputs:{showDelay:["matTooltipShowDelay","showDelay"],hideDelay:["matTooltipHideDelay","hideDelay"],touchGestures:["matTooltipTouchGestures","touchGestures"],position:["matTooltipPosition","position"],disabled:["matTooltipDisabled","disabled"],message:["matTooltip","message"],tooltipClass:["matTooltipClass","tooltipClass"]}}),n})(),dc=(()=>{class n extends Q1e{constructor(t,i,r,s,o,a,l,c,d,f,p,g){super(t,i,r,s,o,a,l,c,d,f,p,g),this._tooltipComponent=eTe}}return n.\u0275fac=function(t){return new(t||n)(E(Jo),E(rt),E(um),E(ns),E(dt),E(si),E(IV),E(Sa),E(gW),E(Qo,8),E(K1e,8),E(ut))},n.\u0275dir=oe({type:n,selectors:[["","matTooltip",""]],hostAttrs:[1,"mat-tooltip-trigger"],exportAs:["matTooltip"],features:[ct]}),n})(),J1e=(()=>{class n{constructor(t){this._changeDetectorRef=t,this._visibility="initial",this._closeOnInteraction=!1,this._onHide=new Se}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 i=t.toState;"hidden"===i&&!this.isVisible()&&this._onHide.next(),("visible"===i||"hidden"===i)&&(this._closeOnInteraction=!0)}_handleBodyInteraction(){this._closeOnInteraction&&this.hide(0)}_markForCheck(){this._changeDetectorRef.markForCheck()}_onShow(){}}return n.\u0275fac=function(t){return new(t||n)(E(kn))},n.\u0275dir=oe({type:n}),n})(),eTe=(()=>{class n extends J1e{constructor(t,i){super(t),this._breakpointObserver=i,this._isHandset=this._breakpointObserver.observe("(max-width: 599.98px) and (orientation: portrait), (max-width: 959.98px) and (orientation: landscape)")}}return n.\u0275fac=function(t){return new(t||n)(E(kn),E(XO))},n.\u0275cmp=Ne({type:n,selectors:[["mat-tooltip-component"]],hostAttrs:["aria-hidden","true"],hostVars:2,hostBindings:function(t,i){2&t&&vf("zoom","visible"===i._visibility?1:null)},features:[ct],decls:3,vars:7,consts:[[1,"mat-tooltip",3,"ngClass"]],template:function(t,i){if(1&t&&(R(0,"div",0),ge("@state.start",function(){return i._animationStart()})("@state.done",function(s){return i._animationDone(s)}),Kt(1,"async"),De(2),k()),2&t){let r;st("mat-tooltip-handset",null==(r=rn(1,5,i._isHandset))?null:r.matches),ie("ngClass",i.tooltipClass)("@state",i._visibility),G(2),xi(i.message)}},directives:[hE],pipes:[Hc],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:[G1e.tooltipState]},changeDetection:0}),n})(),hc=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({providers:[X1e],imports:[[Nie,dn,Yv,On],On,Wv]}),n})();const tTe=["sliderWrapper"],Cl=tm({passive:!1}),oTe={provide:ro,useExisting:T(()=>jk),multi:!0};class aTe{}const lTe=Hf(Uf(jf(class{constructor(n){this._elementRef=n}}),"accent"));let jk=(()=>{class n extends lTe{constructor(t,i,r,s,o,a,l,c){super(t),this._focusMonitor=i,this._changeDetectorRef=r,this._dir=s,this._ngZone=a,this._animationMode=c,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 Le,this.input=new Le,this.valueChange=new Le,this.onTouched=()=>{},this._percent=0,this._isSliding=null,this._isActive=!1,this._tickIntervalPercent=0,this._sliderDimensions=null,this._controlValueAccessorChangeFn=()=>{},this._dirChangeSubscription=Te.EMPTY,this._pointerDown=d=>{this.disabled||this._isSliding||!Zb(d)&&0!==d.button||this._ngZone.run(()=>{this._touchId=Zb(d)?function(n,e){for(let t=0;t{if("pointer"===this._isSliding){const f=mW(d,this._touchId);if(f){d.preventDefault();const p=this.value;this._lastPointerEvent=d,this._updateValueFromPosition(f),p!=this.value&&this._emitInputEvent()}}},this._pointerUp=d=>{"pointer"===this._isSliding&&(!Zb(d)||"number"!=typeof this._touchId||Uk(d.changedTouches,this._touchId))&&(d.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=l,this.tabIndex=parseInt(o)||0,a.runOutsideAngular(()=>{const d=t.nativeElement;d.addEventListener("mousedown",this._pointerDown,Cl),d.addEventListener("touchstart",this._pointerDown,Cl)})}get invert(){return this._invert}set invert(t){this._invert=Mt(t)}get max(){return this._max}set max(t){this._max=To(t,this._max),this._percent=this._calculatePercentage(this._value),this._changeDetectorRef.markForCheck()}get min(){return this._min}set min(t){this._min=To(t,this._min),this._percent=this._calculatePercentage(this._value),this._changeDetectorRef.markForCheck()}get step(){return this._step}set step(t){this._step=To(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=Mt(t)}get tickInterval(){return this._tickInterval}set tickInterval(t){this._tickInterval="auto"===t?"auto":"number"==typeof t||"string"==typeof t?To(t,this._tickInterval):0}get value(){return null===this._value&&(this.value=this._min),this._value}set value(t){if(t!==this._value){let i=To(t,0);this._roundToDecimal&&i!==this.min&&i!==this.max&&(i=parseFloat(i.toFixed(this._roundToDecimal))),this._value=i,this._percent=this._calculatePercentage(this._value),this._changeDetectorRef.markForCheck()}}get vertical(){return this._vertical}set vertical(t){this._vertical=Mt(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 i=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(${i})`}}_getTrackFillStyles(){const t=this.percent,r=this.vertical?`1, ${t}, 1`:`${t}, 1, 1`;return{transform:`translate${this.vertical?"Y":"X"}(${this._shouldInvertMouseCoords()?"":"-"}${this._getThumbGap()}px) scale3d(${r})`,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,a={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 l=this._shouldInvertAxis();let c;c=this.vertical?l?"Bottom":"Top":l?"Right":"Left",a[`padding${c}`]=`${this._getThumbGap()}px`}return a}_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,Cl),t.removeEventListener("touchstart",this._pointerDown,Cl),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||Zs(t)||this._isSliding&&"keyboard"!==this._isSliding)return;const i=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}i!=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 i=this._document,r=Zb(t),o=r?"touchend":"mouseup";i.addEventListener(r?"touchmove":"mousemove",this._pointerMove,Cl),i.addEventListener(o,this._pointerUp,Cl),r&&i.addEventListener("touchcancel",this._pointerUp,Cl);const a=this._getWindow();void 0!==a&&a&&a.addEventListener("blur",this._windowBlur)}_removeGlobalEvents(){const t=this._document;t.removeEventListener("mousemove",this._pointerMove,Cl),t.removeEventListener("mouseup",this._pointerUp,Cl),t.removeEventListener("touchmove",this._pointerMove,Cl),t.removeEventListener("touchend",this._pointerUp,Cl),t.removeEventListener("touchcancel",this._pointerUp,Cl);const i=this._getWindow();void 0!==i&&i&&i.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 o=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()&&(o=1-o),0===o)this.value=this.min;else if(1===o)this.value=this.max;else{const a=this._calculateValue(o),l=Math.round((a-this.min)/this.step)*this.step+this.min;this.value=this._clamp(l,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,s=Math.ceil(30/(t*this.step/(this.max-this.min)))*this.step;this._tickIntervalPercent=s/t}else this._tickIntervalPercent=this.tickInterval*this.step/(this.max-this.min)}_createChangeEvent(t=this.value){let i=new aTe;return i.source=this,i.value=t,i}_calculatePercentage(t){return((t||0)-this.min)/(this.max-this.min)}_calculateValue(t){return this.min+t*(this.max-this.min)}_clamp(t,i=0,r=1){return Math.max(i,Math.min(t,r))}_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 n.\u0275fac=function(t){return new(t||n)(E(rt),E(Sa),E(kn),E(Qo,8),Zr("tabindex"),E(dt),E(ut),E(Do,8))},n.\u0275cmp=Ne({type:n,selectors:[["mat-slider"]],viewQuery:function(t,i){if(1&t&&Jn(tTe,5),2&t){let r;_t(r=yt())&&(i._sliderWrapper=r.first)}},hostAttrs:["role","slider",1,"mat-slider","mat-focus-indicator"],hostVars:29,hostBindings:function(t,i){1&t&&ge("focus",function(){return i._onFocus()})("blur",function(){return i._onBlur()})("keydown",function(s){return i._onKeydown(s)})("keyup",function(){return i._onKeyup()})("mouseenter",function(){return i._onMouseenter()})("selectstart",function(s){return s.preventDefault()}),2&t&&(al("tabIndex",i.tabIndex),nn("aria-disabled",i.disabled)("aria-valuemax",i.max)("aria-valuemin",i.min)("aria-valuenow",i.value)("aria-valuetext",null==i.valueText?i.displayValue:i.valueText)("aria-orientation",i.vertical?"vertical":"horizontal"),st("mat-slider-disabled",i.disabled)("mat-slider-has-ticks",i.tickInterval)("mat-slider-horizontal",!i.vertical)("mat-slider-axis-inverted",i._shouldInvertAxis())("mat-slider-invert-mouse-coords",i._shouldInvertMouseCoords())("mat-slider-sliding",i._isSliding)("mat-slider-thumb-label-showing",i.thumbLabel)("mat-slider-vertical",i.vertical)("mat-slider-min-value",i._isMinValue())("mat-slider-hide-last-tick",i.disabled||i._isMinValue()&&i._getThumbGap()&&i._shouldInvertAxis())("_mat-animation-noopable","NoopAnimations"===i._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:[Dt([oTe]),ct],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,i){1&t&&(R(0,"div",0,1),R(2,"div",2),tt(3,"div",3),tt(4,"div",4),k(),R(5,"div",5),tt(6,"div",6),k(),R(7,"div",7),tt(8,"div",8),tt(9,"div",9),R(10,"div",10),R(11,"span",11),De(12),k(),k(),k(),k()),2&t&&(G(3),ie("ngStyle",i._getTrackBackgroundStyles()),G(1),ie("ngStyle",i._getTrackFillStyles()),G(1),ie("ngStyle",i._getTicksContainerStyles()),G(1),ie("ngStyle",i._getTicksStyles()),G(1),ie("ngStyle",i._getThumbContainerStyles()),G(5),xi(i.displayValue))},directives:[J3],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}),n})();function Zb(n){return"t"===n.type[0]}function mW(n,e){let t;return t=Zb(n)?"number"==typeof e?Uk(n.touches,e)||Uk(n.changedTouches,e):n.touches[0]||n.changedTouches[0]:n,t?{x:t.clientX,y:t.clientY}:void 0}function Uk(n,e){for(let t=0;t{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,On],On]}),n})();function uTe(n,e){}class Hk{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 dTe={dialogContainer:tc("dialogContainer",[wr("void, exit",ti({opacity:0,transform:"scale(0.7)"})),wr("enter",ti({transform:"none"})),Qs("* => enter",Ao("150ms cubic-bezier(0, 0, 0.2, 1)",ti({transform:"none",opacity:1}))),Qs("* => void, * => exit",Ao("75ms cubic-bezier(0.4, 0.0, 0.2, 1)",ti({opacity:0})))])};let hTe=(()=>{class n extends uS{constructor(t,i,r,s,o,a){super(),this._elementRef=t,this._focusTrapFactory=i,this._changeDetectorRef=r,this._config=o,this._focusMonitor=a,this._animationStateChanged=new Le,this._elementFocusedBeforeDialogWasOpened=null,this._closeInteractionType=null,this.attachDomPortal=l=>(this._portalOutlet.hasAttached(),this._portalOutlet.attachDomPortal(l)),this._ariaLabelledBy=o.ariaLabelledBy||null,this._document=s}_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 i=xE(),r=this._elementRef.nativeElement;(!i||i===this._document.body||i===r||r.contains(i))&&(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=xE())}_focusDialogContainer(){this._elementRef.nativeElement.focus&&this._elementRef.nativeElement.focus()}_containsFocus(){const t=this._elementRef.nativeElement,i=xE();return t===i||t.contains(i)}}return n.\u0275fac=function(t){return new(t||n)(E(rt),E(BV),E(kn),E(ut,8),E(Hk),E(Sa))},n.\u0275dir=oe({type:n,viewQuery:function(t,i){if(1&t&&Jn(Kf,7),2&t){let r;_t(r=yt())&&(i._portalOutlet=r.first)}},features:[ct]}),n})(),fTe=(()=>{class n extends hTe{constructor(){super(...arguments),this._state="enter"}_onAnimationDone({toState:t,totalTime:i}){"enter"===t?(this._trapFocus(),this._animationStateChanged.next({state:"opened",totalTime:i})):"exit"===t&&(this._restoreFocus(),this._animationStateChanged.next({state:"closed",totalTime:i}))}_onAnimationStart({toState:t,totalTime:i}){"enter"===t?this._animationStateChanged.next({state:"opening",totalTime:i}):("exit"===t||"void"===t)&&this._animationStateChanged.next({state:"closing",totalTime:i})}_startExitAnimation(){this._state="exit",this._changeDetectorRef.markForCheck()}}return n.\u0275fac=function(){let e;return function(i){return(e||(e=$n(n)))(i||n)}}(),n.\u0275cmp=Ne({type:n,selectors:[["mat-dialog-container"]],hostAttrs:["tabindex","-1","aria-modal","true",1,"mat-dialog-container"],hostVars:6,hostBindings:function(t,i){1&t&&Qy("@dialogContainer.start",function(s){return i._onAnimationStart(s)})("@dialogContainer.done",function(s){return i._onAnimationDone(s)}),2&t&&(al("id",i._id),nn("role",i._config.role)("aria-labelledby",i._config.ariaLabel?null:i._ariaLabelledBy)("aria-label",i._config.ariaLabel)("aria-describedby",i._config.ariaDescribedBy||null),Pg("@dialogContainer",i._state))},features:[ct],decls:1,vars:0,consts:[["cdkPortalOutlet",""]],template:function(t,i){1&t&&mt(0,uTe,0,0,"ng-template",0)},directives:[Kf],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:[dTe.dialogContainer]}}),n})(),pTe=0;class Qm{constructor(e,t,i="mat-dialog-"+pTe++){this._overlayRef=e,this._containerInstance=t,this.id=i,this.disableClose=this._containerInstance._config.disableClose,this._afterOpened=new Se,this._afterClosed=new Se,this._beforeClosed=new Se,this._state=0,t._id=i,t._animationStateChanged.pipe(Fn(r=>"opened"===r.state),yi(1)).subscribe(()=>{this._afterOpened.next(),this._afterOpened.complete()}),t._animationStateChanged.pipe(Fn(r=>"closed"===r.state),yi(1)).subscribe(()=>{clearTimeout(this._closeFallbackTimeout),this._finishDialogClose()}),e.detachments().subscribe(()=>{this._beforeClosed.next(this._result),this._beforeClosed.complete(),this._afterClosed.next(this._result),this._afterClosed.complete(),this.componentInstance=null,this._overlayRef.dispose()}),e.keydownEvents().pipe(Fn(r=>27===r.keyCode&&!this.disableClose&&!Zs(r))).subscribe(r=>{r.preventDefault(),$k(this,"keyboard")}),e.backdropClick().subscribe(()=>{this.disableClose?this._containerInstance._recaptureFocus():$k(this,"mouse")})}close(e){this._result=e,this._containerInstance._animationStateChanged.pipe(Fn(t=>"closing"===t.state),yi(1)).subscribe(t=>{this._beforeClosed.next(e),this._beforeClosed.complete(),this._overlayRef.detachBackdrop(),this._closeFallbackTimeout=setTimeout(()=>this._finishDialogClose(),t.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(e){let 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}updateSize(e="",t=""){return this._overlayRef.updateSize({width:e,height:t}),this._overlayRef.updatePosition(),this}addPanelClass(e){return this._overlayRef.addPanelClass(e),this}removePanelClass(e){return this._overlayRef.removePanelClass(e),this}getState(){return this._state}_finishDialogClose(){this._state=2,this._overlayRef.dispose()}_getPositionStrategy(){return this._overlayRef.getConfig().positionStrategy}}function $k(n,e,t){return void 0!==n._containerInstance&&(n._containerInstance._closeInteractionType=e),n.close(t)}const Gk=new ve("MatDialogData"),gTe=new ve("mat-dialog-default-options"),yW=new ve("mat-dialog-scroll-strategy"),_Te={provide:yW,deps:[Jo],useFactory:function(n){return()=>n.scrollStrategies.block()}};let yTe=(()=>{class n{constructor(t,i,r,s,o,a,l,c,d){this._overlay=t,this._injector=i,this._defaultOptions=r,this._parentDialog=s,this._overlayContainer=o,this._dialogRefConstructor=l,this._dialogContainerType=c,this._dialogDataToken=d,this._openDialogsAtThisLevel=[],this._afterAllClosedAtThisLevel=new Se,this._afterOpenedAtThisLevel=new Se,this._ariaHiddenElements=new Map,this.afterAllClosed=Yb(()=>this.openDialogs.length?this._getAfterAllClosed():this._getAfterAllClosed().pipe(Rr(void 0))),this._scrollStrategy=a}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,i){(i=function(n,e){return Object.assign(Object.assign({},e),n)}(i,this._defaultOptions||new Hk)).id&&this.getDialogById(i.id);const r=this._createOverlay(i),s=this._attachDialogContainer(r,i),o=this._attachDialogContent(t,s,r,i);return this.openDialogs.length||this._hideNonDialogContentFromAssistiveTechnology(),this.openDialogs.push(o),o.afterClosed().subscribe(()=>this._removeOpenDialog(o)),this.afterOpened.next(o),s._initializeWithAttachedContent(),o}closeAll(){this._closeDialogs(this.openDialogs)}getDialogById(t){return this.openDialogs.find(i=>i.id===t)}ngOnDestroy(){this._closeDialogs(this._openDialogsAtThisLevel),this._afterAllClosedAtThisLevel.complete(),this._afterOpenedAtThisLevel.complete()}_createOverlay(t){const i=this._getOverlayConfig(t);return this._overlay.create(i)}_getOverlayConfig(t){const i=new qv({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&&(i.backdropClass=t.backdropClass),i}_attachDialogContainer(t,i){const s=Nt.create({parent:i&&i.viewContainerRef&&i.viewContainerRef.injector||this._injector,providers:[{provide:Hk,useValue:i}]}),o=new dm(this._dialogContainerType,i.viewContainerRef,s,i.componentFactoryResolver);return t.attach(o).instance}_attachDialogContent(t,i,r,s){const o=new this._dialogRefConstructor(r,i,s.id);if(t instanceof Ys)i.attachTemplatePortal(new Xf(t,null,{$implicit:s.data,dialogRef:o}));else{const a=this._createInjector(s,o,i),l=i.attachComponentPortal(new dm(t,s.viewContainerRef,a));o.componentInstance=l.instance}return o.updateSize(s.width,s.height).updatePosition(s.position),o}_createInjector(t,i,r){const s=t&&t.viewContainerRef&&t.viewContainerRef.injector,o=[{provide:this._dialogContainerType,useValue:r},{provide:this._dialogDataToken,useValue:t.data},{provide:this._dialogRefConstructor,useValue:i}];return t.direction&&(!s||!s.get(Qo,null,At.Optional))&&o.push({provide:Qo,useValue:{value:t.direction,change:ht()}}),Nt.create({parent:s||this._injector,providers:o})}_removeOpenDialog(t){const i=this.openDialogs.indexOf(t);i>-1&&(this.openDialogs.splice(i,1),this.openDialogs.length||(this._ariaHiddenElements.forEach((r,s)=>{r?s.setAttribute("aria-hidden",r):s.removeAttribute("aria-hidden")}),this._ariaHiddenElements.clear(),this._getAfterAllClosed().next()))}_hideNonDialogContentFromAssistiveTechnology(){const t=this._overlayContainer.getContainerElement();if(t.parentElement){const i=t.parentElement.children;for(let r=i.length-1;r>-1;r--){let s=i[r];s!==t&&"SCRIPT"!==s.nodeName&&"STYLE"!==s.nodeName&&!s.hasAttribute("aria-live")&&(this._ariaHiddenElements.set(s,s.getAttribute("aria-hidden")),s.setAttribute("aria-hidden","true"))}}}_closeDialogs(t){let i=t.length;for(;i--;)t[i].close()}}return n.\u0275fac=function(t){return new(t||n)(E(Jo),E(Nt),E(void 0),E(void 0),E(hm),E(void 0),E(Du),E(Du),E(ve))},n.\u0275dir=oe({type:n}),n})(),_p=(()=>{class n extends yTe{constructor(t,i,r,s,o,a,l){super(t,i,s,a,l,o,Qm,fTe,Gk)}}return n.\u0275fac=function(t){return new(t||n)(I(Jo),I(Nt),I(Xg,8),I(gTe,8),I(yW),I(n,12),I(hm))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})(),bTe=0,Wk=(()=>{class n{constructor(t,i,r){this._dialogRef=t,this._elementRef=i,this._dialog=r,this.id="mat-dialog-title-"+bTe++}ngOnInit(){this._dialogRef||(this._dialogRef=function(n,e){let t=n.nativeElement.parentElement;for(;t&&!t.classList.contains("mat-dialog-container");)t=t.parentElement;return t?e.find(i=>i.id===t.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 n.\u0275fac=function(t){return new(t||n)(E(Qm,8),E(rt),E(_p))},n.\u0275dir=oe({type:n,selectors:[["","mat-dialog-title",""],["","matDialogTitle",""]],hostAttrs:[1,"mat-dialog-title"],hostVars:1,hostBindings:function(t,i){2&t&&al("id",i.id)},inputs:{id:"id"},exportAs:["matDialogTitle"]}),n})(),qk=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275dir=oe({type:n,selectors:[["","mat-dialog-content",""],["mat-dialog-content"],["","matDialogContent",""]],hostAttrs:[1,"mat-dialog-content"]}),n})();let Qb=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({providers:[_p,_Te],imports:[[Yv,dS,On],On]}),n})();const Yk=new ve("CdkAccordion");let ETe=0,MTe=(()=>{class n{constructor(t,i,r){this.accordion=t,this._changeDetectorRef=i,this._expansionDispatcher=r,this._openCloseAllSubscription=Te.EMPTY,this.closed=new Le,this.opened=new Le,this.destroyed=new Le,this.expandedChange=new Le,this.id="cdk-accordion-child-"+ETe++,this._expanded=!1,this._disabled=!1,this._removeUniqueSelectionListener=()=>{},this._removeUniqueSelectionListener=r.listen((s,o)=>{this.accordion&&!this.accordion.multi&&this.accordion.id===o&&this.id!==s&&(this.expanded=!1)}),this.accordion&&(this._openCloseAllSubscription=this._subscribeToOpenCloseAllActions())}get expanded(){return this._expanded}set expanded(t){t=Mt(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=Mt(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 n.\u0275fac=function(t){return new(t||n)(E(Yk,12),E(kn),E(cS))},n.\u0275dir=oe({type:n,selectors:[["cdk-accordion-item"],["","cdkAccordionItem",""]],inputs:{expanded:"expanded",disabled:"disabled"},outputs:{closed:"closed",opened:"opened",destroyed:"destroyed",expandedChange:"expandedChange"},exportAs:["cdkAccordionItem"],features:[Dt([{provide:Yk,useValue:void 0}])]}),n})(),xTe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({}),n})();const TTe=["body"];function ATe(n,e){}const DTe=[[["mat-expansion-panel-header"]],"*",[["mat-action-row"]]],OTe=["mat-expansion-panel-header","*","mat-action-row"];function ITe(n,e){1&n&&tt(0,"span",2),2&n&&ie("@indicatorRotate",Qe()._getExpandedState())}const PTe=[[["mat-panel-title"]],[["mat-panel-description"]],"*"],RTe=["mat-panel-title","mat-panel-description","*"],Xk=new ve("MAT_ACCORDION"),bW="225ms cubic-bezier(0.4,0.0,0.2,1)",CW={indicatorRotate:tc("indicatorRotate",[wr("collapsed, void",ti({transform:"rotate(0deg)"})),wr("expanded",ti({transform:"rotate(180deg)"})),Qs("expanded <=> collapsed, void => collapsed",Ao(bW))]),bodyExpansion:tc("bodyExpansion",[wr("collapsed, void",ti({height:"0px",visibility:"hidden"})),wr("expanded",ti({height:"*",visibility:"visible"})),Qs("expanded <=> collapsed, void => collapsed",Ao(bW))])};let kTe=(()=>{class n{constructor(t){this._template=t}}return n.\u0275fac=function(t){return new(t||n)(E(Ys))},n.\u0275dir=oe({type:n,selectors:[["ng-template","matExpansionPanelContent",""]]}),n})(),FTe=0;const wW=new ve("MAT_EXPANSION_PANEL_DEFAULT_OPTIONS");let qM=(()=>{class n extends MTe{constructor(t,i,r,s,o,a,l){super(t,i,r),this._viewContainerRef=s,this._animationMode=a,this._hideToggle=!1,this.afterExpand=new Le,this.afterCollapse=new Le,this._inputChanges=new Se,this._headerId="mat-expansion-panel-header-"+FTe++,this._bodyAnimationDone=new Se,this.accordion=t,this._document=o,this._bodyAnimationDone.pipe(Zo((c,d)=>c.fromState===d.fromState&&c.toState===d.toState)).subscribe(c=>{"void"!==c.fromState&&("expanded"===c.toState?this.afterExpand.emit():"collapsed"===c.toState&&this.afterCollapse.emit())}),l&&(this.hideToggle=l.hideToggle)}get hideToggle(){return this._hideToggle||this.accordion&&this.accordion.hideToggle}set hideToggle(t){this._hideToggle=Mt(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(Rr(null),Fn(()=>this.expanded&&!this._portal),yi(1)).subscribe(()=>{this._portal=new Xf(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,i=this._body.nativeElement;return t===i||i.contains(t)}return!1}}return n.\u0275fac=function(t){return new(t||n)(E(Xk,12),E(kn),E(cS),E(ns),E(ut),E(Do,8),E(wW,8))},n.\u0275cmp=Ne({type:n,selectors:[["mat-expansion-panel"]],contentQueries:function(t,i,r){if(1&t&&ei(r,kTe,5),2&t){let s;_t(s=yt())&&(i._lazyContent=s.first)}},viewQuery:function(t,i){if(1&t&&Jn(TTe,5),2&t){let r;_t(r=yt())&&(i._body=r.first)}},hostAttrs:[1,"mat-expansion-panel"],hostVars:6,hostBindings:function(t,i){2&t&&st("mat-expanded",i.expanded)("_mat-animation-noopable","NoopAnimations"===i._animationMode)("mat-expansion-panel-spacing",i._hasSpacing())},inputs:{disabled:"disabled",expanded:"expanded",hideToggle:"hideToggle",togglePosition:"togglePosition"},outputs:{opened:"opened",closed:"closed",expandedChange:"expandedChange",afterExpand:"afterExpand",afterCollapse:"afterCollapse"},exportAs:["matExpansionPanel"],features:[Dt([{provide:Xk,useValue:void 0}]),ct,zn],ngContentSelectors:OTe,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,i){1&t&&(wi(DTe),Ht(0),R(1,"div",0,1),ge("@bodyExpansion.done",function(s){return i._bodyAnimationDone.next(s)}),R(3,"div",2),Ht(4,1),mt(5,ATe,0,0,"ng-template",3),k(),Ht(6,2),k()),2&t&&(G(1),ie("@bodyExpansion",i._getExpandedState())("id",i.id),nn("aria-labelledby",i._headerId),G(4),ie("cdkPortalOutlet",i._portal))},directives:[Kf],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:[CW.bodyExpansion]},changeDetection:0}),n})();class LTe{}const BTe=Hf(LTe);let YM=(()=>{class n extends BTe{constructor(t,i,r,s,o,a,l){super(),this.panel=t,this._element=i,this._focusMonitor=r,this._changeDetectorRef=s,this._animationMode=a,this._parentChangeSubscription=Te.EMPTY;const c=t.accordion?t.accordion._stateChanges.pipe(Fn(d=>!(!d.hideToggle&&!d.togglePosition))):ec;this.tabIndex=parseInt(l||"")||0,this._parentChangeSubscription=Ni(t.opened,t.closed,c,t._inputChanges.pipe(Fn(d=>!!(d.hideToggle||d.disabled||d.togglePosition)))).subscribe(()=>this._changeDetectorRef.markForCheck()),t.closed.pipe(Fn(()=>t._containsFocus())).subscribe(()=>r.focusVia(i,"program")),o&&(this.expandedHeight=o.expandedHeight,this.collapsedHeight=o.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:Zs(t)||(t.preventDefault(),this._toggle());break;default:return void(this.panel.accordion&&this.panel.accordion._handleHeaderKeydown(t))}}focus(t,i){t?this._focusMonitor.focusVia(this._element,t,i):this._element.nativeElement.focus(i)}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 n.\u0275fac=function(t){return new(t||n)(E(qM,1),E(rt),E(Sa),E(kn),E(wW,8),E(Do,8),Zr("tabindex"))},n.\u0275cmp=Ne({type:n,selectors:[["mat-expansion-panel-header"]],hostAttrs:["role","button",1,"mat-expansion-panel-header","mat-focus-indicator"],hostVars:15,hostBindings:function(t,i){1&t&&ge("click",function(){return i._toggle()})("keydown",function(s){return i._keydown(s)}),2&t&&(nn("id",i.panel._headerId)("tabindex",i.tabIndex)("aria-controls",i._getPanelId())("aria-expanded",i._isExpanded())("aria-disabled",i.panel.disabled),vf("height",i._getHeaderHeight()),st("mat-expanded",i._isExpanded())("mat-expansion-toggle-indicator-after","after"===i._getTogglePosition())("mat-expansion-toggle-indicator-before","before"===i._getTogglePosition())("_mat-animation-noopable","NoopAnimations"===i._animationMode))},inputs:{tabIndex:"tabIndex",expandedHeight:"expandedHeight",collapsedHeight:"collapsedHeight"},features:[ct],ngContentSelectors:RTe,decls:5,vars:1,consts:[[1,"mat-content"],["class","mat-expansion-indicator",4,"ngIf"],[1,"mat-expansion-indicator"]],template:function(t,i){1&t&&(wi(PTe),R(0,"span",0),Ht(1),Ht(2,1),Ht(3,2),k(),mt(4,ITe,1,1,"span",1)),2&t&&(G(4),ie("ngIf",i._showToggle()))},directives:[zr],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:[CW.indicatorRotate]},changeDetection:0}),n})(),EW=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275dir=oe({type:n,selectors:[["mat-panel-title"]],hostAttrs:[1,"mat-expansion-panel-header-title"]}),n})(),Kk=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,On,xTe,dS]]}),n})();var SW=ze(478);Object.create(Error.prototype);const UTe=["*"];var KM=(()=>(function(n){n.LineHighlight="line-highlight",n.LineNumbers="line-numbers"}(KM||(KM={})),KM))();class $Te{}const xW=new ve("SECURITY_CONTEXT");let Zk=(()=>{class n{constructor(t,i,r,s,o){this.platform=t,this.securityContext=i,this.http=r,this.sanitizer=o,this.initialMarkedOptions={renderer:new SW.Renderer},this.options=s}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,i=!1,r=!1,s=this.options){const o=this.trimIndentation(t),a=i?this.decodeHtml(o):o,l=r?this.renderEmoji(a):a,c=SW.parse(l,s);return this.sanitizer.sanitize(this.securityContext,c)||""}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(Ae(i=>this.handleExtension(t,i)))}highlight(t){if(Of(this.platform)&&"undefined"!=typeof Prism){t||(t=document);const i=t.querySelectorAll('pre code:not([class*="language-"])');Array.prototype.forEach.call(i,r=>r.classList.add("language-none")),Prism.highlightAllUnder(t)}}renderKatex(t,i){if(!Of(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,(r,s)=>katex.renderToString(s,i))}decodeHtml(t){if(!Of(this.platform))return t;const i=document.createElement("textarea");return i.innerHTML=t,i.value}handleExtension(t,i){const r=t?t.split("?")[0].split(".").splice(-1).join():"";return"md"!==r?"```"+r+"\n"+i+"\n```":i}renderEmoji(t){if(!Of(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 i;return t.split("\n").map(r=>{let s=i;return r.length>0&&(s=isNaN(s)?r.search(/\S|$/):Math.min(r.search(/\S|$/),s)),isNaN(i)&&(i=s),s?r.substring(s):r}).join("\n")}}return n.\u0275fac=function(t){return new(t||n)(I(dl),I(xW),I(Wf,8),I($Te,8),I(th))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})(),TW=(()=>{class n{constructor(t,i){this.element=t,this.markdownService=i,this.error=new Le,this.load=new Le,this.ready=new Le,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,i=!1){let r=this.markdownService.compile(t,i,this.emoji);r=this.katex?this.markdownService.renderKatex(r,this.katexOptions):r,this.element.nativeElement.innerHTML=r,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,KM.LineNumbers),this.setPluginOptions(this.element.nativeElement,{dataStart:this.start}))}setPluginClass(t,i){const r=t.querySelectorAll("pre");for(let s=0;s{const a=i[o];if(a){const l=this.toLispCase(o);r.item(s).setAttribute(l,a.toString())}})}toLispCase(t){const i=t.match(/([A-Z])/g);if(!i)return t;let r=t.toString();for(let s=0,o=i.length;s{class n{static forRoot(t){return{ngModule:n,providers:[Zk,t&&t.loader||[],t&&t.markedOptions||[],{provide:xW,useValue:t&&null!=t.sanitize?t.sanitize:mn.HTML}]}}static forChild(){return{ngModule:n}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({}),n})();function AW(n,e,t){return t?AW(n,e).pipe(Ae(i=>we(i)?t(...i):t(i))):new ce(i=>{const r=(...o)=>i.next(1===o.length?o[0]:o);let s;try{s=n(r)}catch(o){return void i.error(o)}if(Ke(e))return()=>e(r,s)})}function ZM(...n){return e=>{let t;return"function"==typeof n[n.length-1]&&(t=n.pop()),e.lift(new ZTe(n,t))}}class ZTe{constructor(e,t){this.observables=e,this.project=t}call(e,t){return t.subscribe(new QTe(e,this.observables,this.project))}}class QTe extends cU{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)}}class JTe{constructor(e,t,i=!1){this.accumulator=e,this.seed=t,this.hasSeed=i}call(e,t){return t.subscribe(new eAe(e,this.accumulator,this.seed,this.hasSeed))}}class eAe extends xt{constructor(e,t,i,r){super(e),this.accumulator=t,this._seed=i,this.hasSeed=r,this.index=0}get seed(){return this._seed}set seed(e){this.hasSeed=!0,this._seed=e}_next(e){if(this.hasSeed)return this._tryNext(e);this.seed=e,this.destination.next(e)}_tryNext(e){const t=this.index++;let i;try{i=this.accumulator(this.seed,e,t)}catch(r){this.destination.error(r)}this.seed=i,this.destination.next(i)}}class iAe{constructor(e){this.predicate=e}call(e,t){return t.subscribe(new rAe(e,this.predicate))}}class rAe extends xt{constructor(e,t){super(e),this.predicate=t,this.skipping=!0,this.index=0}_next(e){const t=this.destination;this.skipping&&this.tryCallPredicate(e),this.skipping||t.next(e)}tryCallPredicate(e){try{const t=this.predicate(e,this.index++);this.skipping=Boolean(t)}catch(t){this.destination.error(t)}}}const sAe=["youtubeContainer"];let IW=(()=>{class n{constructor(t,i){this._ngZone=t,this._youtubeContainer=new Se,this._destroyed=new Se,this._playerChanges=new ar(void 0),this._videoId=new ar(void 0),this._height=new ar(390),this._width=new ar(640),this._startSeconds=new ar(void 0),this._endSeconds=new ar(void 0),this._suggestedQuality=new ar(void 0),this._playerVars=new ar(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=Of(i)}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=ht(!0);if(!window.YT||!window.YT.Player){const r=new Se;this._existingApiReadyCallback=window.onYouTubeIframeAPIReady,window.onYouTubeIframeAPIReady=()=>{this._existingApiReadyCallback&&this._existingApiReadyCallback(),this._ngZone.run(()=>r.next(!0))},t=r.pipe(yi(1),Rr(!1))}const i=function(n,e,t,i,r,s,o){const a=Qi([e,s]).pipe(ZM(Qi([i,r])),Ae(([l,c])=>{const[d,f]=l,[p,g]=c;return d?{videoId:d,playerVars:f,width:p,height:g}:void 0}));return Qi([n,a,ht(o)]).pipe(function(n){return Mr(function(...n){let e=null;return"function"==typeof n[n.length-1]&&(e=n.pop()),1===n.length&&we(n[0])&&(n=n[0].slice()),t=>t.lift.call(ui([t,...n]),new hU(e))}(n),function(n){return e=>e.lift(new iAe(n))}(([e,t])=>!t),Ae(([e])=>e))}(t),function(n,e){let t=!1;return arguments.length>=2&&(t=!0),function(r){return r.lift(new JTe(n,e,t))}}(dAe,void 0),Zo())}(this._youtubeContainer,this._videoId,t,this._width,this._height,this._playerVars,this._ngZone).pipe(Ti(r=>{this._playerChanges.next(r)}),di(e=>e?PW(e)?ht(e):new ce(t=>{let i=!1,r=!1;const s=o=>{r=!0,i||(o.target.removeEventListener("onReady",s),t.next(o.target))};return e.addEventListener("onReady",s),()=>{i=!0,r||(r=>{PW(r)||r.destroy()})(e)}}).pipe(yi(1),Rr(void 0)):ht(void 0)),Tn(this._destroyed),mc(new Se));i.subscribe(r=>{this._player=r,r&&this._pendingPlayerState&&this._initializePlayer(r,this._pendingPlayerState),this._pendingPlayerState=void 0}),function(n,e,t){Qi([n,e,t]).subscribe(([i,r,s])=>i&&i.setSize(r,s))}(i,this._width,this._height),function(n,e){Qi([n,e]).subscribe(([t,i])=>t&&i&&t.setPlaybackQuality(i))}(i,this._suggestedQuality),function(n,e,t,i,r,s){const o=Qi([t,i]).pipe(Ae(([d,f])=>({startSeconds:d,endSeconds:f}))),a=o.pipe(Jk(n,d=>!!d&&!function(n){const e=n.getPlayerState();return e!==YT.PlayerState.UNSTARTED&&e!==YT.PlayerState.CUED}(d))),l=e.pipe(Jk(n,(d,f)=>!!d&&d.videoId!==f));Ni(n.pipe(Jk(Qi([e,o]),([d,f],p)=>!(!p||d==p.videoId&&!f.startSeconds&&!f.endSeconds))),l,a).pipe(ZM(Qi([n,e,o,r])),Ae(([d,f])=>f),Tn(s)).subscribe(([d,f,p,g])=>{!f||!d||(d.videoId=f,d.cueVideoById(Object.assign({videoId:f,suggestedQuality:g},p)))})}(i,this._videoId,this._startSeconds,this._endSeconds,this._suggestedQuality,this._destroyed),i.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,i){this._player?this._player.seekTo(t,i):this._getPendingState().seek={seconds:t,allowSeekAhead:i}}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,i){const{playbackState:r,playbackRate:s,volume:o,muted:a,seek:l}=i;switch(r){case YT.PlayerState.PLAYING:t.playVideo();break;case YT.PlayerState.PAUSED:t.pauseVideo();break;case YT.PlayerState.CUED:t.stopVideo()}null!=s&&t.setPlaybackRate(s),null!=o&&t.setVolume(o),null!=a&&(a?t.mute():t.unMute()),null!=l&&t.seekTo(l.seconds,l.allowSeekAhead)}_getLazyEmitter(t){return this._playerChanges.pipe(Pr(i=>i?AW(r=>{i.addEventListener(t,r)},r=>{try{i.removeEventListener&&i.removeEventListener(t,r)}catch(s){}}):ht()),i=>new ce(r=>i.subscribe({next:s=>this._ngZone.run(()=>r.next(s)),error:s=>r.error(s),complete:()=>r.complete()})),Tn(this._destroyed))}}return n.\u0275fac=function(t){return new(t||n)(E(dt),E(dl))},n.\u0275cmp=Ne({type:n,selectors:[["youtube-player"]],viewQuery:function(t,i){if(1&t&&Jn(sAe,5),2&t){let r;_t(r=yt())&&(i.youtubeContainer=r.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,i){1&t&&tt(0,"div",null,0)},encapsulation:2,changeDetection:0}),n})();function dAe(n,[e,t,i]){if(n&&t&&n.playerVars!==t.playerVars)n.destroy();else{if(!t)return void(n&&n.destroy());if(n)return n}const r=i.runOutsideAngular(()=>new YT.Player(e,t));return r.videoId=t.videoId,r.playerVars=t.playerVars,r}function PW(n){return"getPlayerStatus"in n}function Jk(n,e){return Mr(ZM(n),Fn(([t,i])=>e(i,t)),Ae(([t])=>t))}let pAe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({}),n})(),CAe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275dir=oe({type:n,selectors:[["","mat-card-sm-image",""],["","matCardImageSmall",""]],hostAttrs:[1,"mat-card-sm-image"]}),n})();function e0(n){return!0===n}function so(n){return null==n}function ka(n){return!so(n)}function eF(n){return Boolean(n)}function NW(n){return so(n)?n:JSON.parse(JSON.stringify(n))}const JM=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])&&JM(n[o])}),n};function LW(n){return ka(n)&&"object"==typeof n&&function(n){return"[object Object]"===Object.prototype.toString.call(n)}(n)}const zW="NGXS_DATA_META",nF="NGXS_META",jW="NGXS_ARGUMENT_REGISTRY_META";let UW=(()=>{class n{constructor(t){this.sequence$=new ar(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)(I(cu,8))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();function t0(n){return n[zW]}let Fa=(()=>{class n{constructor(t,i,r){n.store=t.get(cu),n.ngZone=t.get(dt),n.factory=i,n.context=r,n.computed=t.get(UW)}}return n.store=null,n.computed=null,n.context=null,n.factory=null,n.ngZone=null,n.\u0275fac=function(t){return new(t||n)(I(Nt),I(B$),I(L$))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();class Fr{constructor(){Fr.statesCachedMeta.clear()}static createStateContext(e){return Fa.context.createStateContext(e)}static ensureMappedState(e){if(so(Fa.factory)||so(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)?Fr.statesCachedMeta.get(e.name):null)||Fr.ensureMeta(e)}static getRepositoryByInstance(e){var t;const r=null!==(t=t0(Fr.getStateClassByInstance(e)))&&void 0!==t?t:null;if(so(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=Fr.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=Fr.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=Fa.factory.states)||void 0===t?void 0:t.find(r=>r.name===e.name):null;return ka(i)&&ka(e.name)&&Fr.statesCachedMeta.set(e.name,i),i}}Fr.statesCachedMeta=new Map,Fr.\u0275fac=function(e){return new(e||Fr)},Fr.\u0275prov=ue({token:Fr,factory:Fr.\u0275fac}),new If(1);class $Ae 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 HW(n){var e;return null!==(e=n.NGXS_OPTIONS_META)&&void 0!==e?e:{name:""}}function $W(n){var e;const t=HW(n),i=null!==(e=t.children)&&void 0!==e?e:[],s=NW(void 0===t.defaults?{}:t.defaults);if(i.length){if(LW(s))return function(n,e){return e.reduce((t,i)=>{const r=HW(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()]=$W(i),t},null!=n?n:{})}(s,i);throw new $Ae(s)}return s}function WW(n){var e;return null!==(e=n.__NGXS_COMPUTED_OPTION__)&&void 0!==e?e:null}function qW(){var n,e;return null!==(e=null===(n=null==Fa?void 0:Fa.computed)||void 0===n?void 0:n.sequenceValue)&&void 0!==e?e:0}function YAe(n){let e=!1;return cm(n)&&(e=!0),e}function iF(n){return n[jW]}class XAe extends Error{constructor(e,t){super(`An argument with the name '${e}' already exists in the method '${t}'`)}}class KAe{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(eF(this.argumentMap.has(e))||eF(this.payloadMap.has(e)))throw new XAe(e,t)}}function rF(n){return Mo()?JM(n):n}function tDe(n){return{enumerable:!0,configurable:!0,get(){const e=t0(n),t=Fr.ensureMappedState(e.stateMeta);return Fr.createStateContext(t)}}}function sF(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:()=>Mo()?JM(n.getState()):n.getState(),setState(e){n.setState(e)},patchState(e){n.patchState(e)}})}function oi(){return(n,e,t)=>{!function(n,e){if(!function(n,e){var t;let i=n,r=!1;if(LW(i))for(;null!==i;){if(e0(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 so(WW(n))&&Object.defineProperties(n,{__NGXS_COMPUTED_OPTION__:{enumerable:!0,configurable:!0,value:new WeakMap}}),WW(n)}(this),o=null==s?void 0:s.get(i);if(e0(null==o?void 0:o.isObservable))return null==o?void 0:o.value;if(so(o)||o.sequenceId!==qW()){s.delete(i);const l=i.apply(this,r);return s.set(i,{value:l,sequenceId:qW(),isObservable:YAe(l)}),l}return o.value},t}}const oDe={cancelUncompleted:!0,insideZone:!1};function on(n=oDe){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=Fr.getRepositoryByInstance(a),d=c.operations;let f=d[s];const p=c.stateMeta,g=iF(r);if(so(f)){const w=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),x=function(n){const{statePath:e,argumentsNames:t,methodName:i,argumentRegistry:r}=n;let s="";for(let o=0;o{var w;return e0(n.insideZone)?null===(w=Fa.ngZone)||void 0===w||w.run(()=>{l=r.apply(a,o)}):l=r.apply(a,o),cm(l)?ht(null).pipe(Ae(()=>l)):l};const v=Fr.createAction(f,o,g),C=Fa.store.dispatch(v);return cm(l)?function(n,e){return Hv([n,e]).pipe(Ae(t=>t.pop()))}(C,l):l},i}}function Ms(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 so(iF(t))&&Object.defineProperties(t,{[jW]:{enumerable:!0,configurable:!0,value:new KAe}}),iF(t)})(e,t).createPayloadType(r,t,i)}}function xh(){return n=>{const e=function(n){if(function(n){return!eF(n)}(n.hasOwnProperty(nF))){const e={name:null,actions:{},defaults:{},path:null,makeRootSelector:t=>t.getStateGetter(e.name),children:[]};Object.defineProperty(n,nF,{value:e})}return function(n){var e;return null===(e=n)||void 0===e?void 0:e[nF]}(n)}(n);if(so(e.name))throw new Error("@StateRepository should be add before decorator @State");!function(n,e){(function(n){var e;const t=null!==(e=t0(n))&&void 0!==e?e:null;return(so(t)||(null==t?void 0:t.stateClass)!==n)&&function(n){Object.defineProperty(n,zW,{writable:!0,configurable:!0,enumerable:!0,value:{stateMeta:null,operations:{},stateClass:n}})}(n),t0(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:()=>NW(t)},context:tDe(n)})}(n,e,$W(n)),function(n){var e,t;const i=t0(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(so(Fa.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]=Fa.store.select(n).pipe(Ae(o=>Mo()?JM(o):o),qc({refCount:!0,bufferSize:1})),this[s]}}})}}(n)}}var tx=(()=>(function(n){n.ID="id"}(tx||(tx={})),tx))(),n0=(()=>(function(n){n.ASC="asc",n.DESC="desc"}(n0||(n0={})),n0))();let oF=(()=>{class n{constructor(){this.browserStorageEvents$=new Se,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=ue({token:n,factory:n.\u0275fac}),n})(),cDe=(()=>{class n extends oF{get snapshot(){return rF(this.getState())}get ctx(){return sF(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=$n(n)))(i||n)}}(),n.\u0275prov=ue({token:n,factory:n.\u0275fac}),xe([oi(),Xe("design:type",Object),Xe("design:paramtypes",[])],n.prototype,"snapshot",null),xe([on(),ws(0,Ms("patchValue")),Xe("design:type",Function),Xe("design:paramtypes",[Object]),Xe("design:returntype",void 0)],n.prototype,"patchState",null),xe([on(),ws(0,Ms("stateValue")),Xe("design:type",Function),Xe("design:paramtypes",[Object]),Xe("design:returntype",void 0)],n.prototype,"setState",null),xe([on(),Xe("design:type",Function),Xe("design:paramtypes",[]),Xe("design:returntype",void 0)],n.prototype,"reset",null),n})(),uDe=(()=>{class n extends oF{constructor(){super(...arguments),this.primaryKey=tx.ID,this.comparator=null}get snapshot(){return rF(this.getState())}get ids(){return this.snapshot.ids}get entities(){return this.snapshot.entities}get entitiesArray(){const t=this.snapshot;return t.ids.map(i=>t.entities[i])}get ids$(){return this.state$.pipe(Ae(t=>t.ids))}get entities$(){return this.state$.pipe(Ae(t=>t.entities))}get entitiesArray$(){return this.state$.pipe(Ae(t=>t.ids.map(i=>t.entities[i])))}get ctx(){return sF(this.context)}setComparator(t){return this.comparator=t,this}dispatch(t){return this.ctx.dispatch(t)}getState(){return this.ctx.getState()}selectId(t){var i;return null===(i=t)||void 0===i?void 0:i[this.primaryKey]}selectOne(t){var i;return null!==(i=this.snapshot.entities[t])&&void 0!==i?i:null}selectAll(){const t=this.getState();return t.ids.map(i=>t.entities[i])}reset(){this.setEntitiesState(this.initialState),this.markAsDirtyAfterReset()}addOne(t){this.addEntityOne(t)}addMany(t){this.addEntitiesMany(t)}setOne(t){this.setEntityOne(t)}setMany(t){this.setEntitiesMany(t)}setAll(t){this.setEntitiesAll(t)}updateOne(t){this.updateEntitiesMany([t])}updateMany(t){this.updateEntitiesMany(t)}upsertOne(t){this.upsertEntitiesMany([t])}upsertMany(t){this.upsertEntitiesMany(t)}removeOne(t){this.removeEntitiesMany([t])}removeMany(t){this.removeEntitiesMany(t)}removeByEntity(t){const i=this.selectId(t);this.removeEntitiesMany([i])}removeByEntities(t){const i=[];for(const r of t){const s=this.selectId(r);i.push(s)}this.removeEntitiesMany(i)}removeAll(){this.setEntitiesState(this.initialState)}sort(t){this.comparator=null!=t?t:this.comparator,so(this.comparator)?console.warn("You must set the compare function before sorting."):this.setEntitiesState(this.getState())}addEntityOne(t){const i=this.getState(),r=this.selectIdValue(t);r in i.entities||this.setEntitiesState(Object.assign(Object.assign({},i),{ids:[...i.ids,r],entities:Object.assign(Object.assign({},i.entities),{[r]:t})}))}addEntitiesMany(t){const i=this.getState(),r={},s=[];for(const o of t){const a=this.selectIdValue(o);a in i.entities||a in r||(s.push(a),r[a]=o)}s.length&&this.setEntitiesState(Object.assign(Object.assign({},i),{ids:[...i.ids,...s],entities:Object.assign(Object.assign({},i.entities),r)}))}setEntitiesAll(t){const i=this.getState(),r={},s=[];for(const o of t){const a=this.selectIdValue(o);a in r||(s.push(a),r[a]=o)}this.setEntitiesState(Object.assign(Object.assign({},i),{ids:s,entities:r}))}setEntityOne(t){const i=this.getState(),r=this.selectIdValue(t);this.setEntitiesState(Object.assign(Object.assign({},i),r in i.entities?{entities:Object.assign(Object.assign({},i.entities),{[r]:t})}:{ids:[...i.ids,r],entities:Object.assign(Object.assign({},i.entities),{[r]:t})}))}setEntitiesMany(t){for(const i of t)this.setEntityOne(i)}updateEntitiesMany(t){const i=this.getState(),r=t.filter(a=>a.id in i.entities);if(0===r.length)return;const s=this.generateKeyMap(i),o=Object.assign({},i.entities);for(const a of r){const l=this.updateOrigin(o,a),c=this.selectIdValue(l);c!==a.id&&(delete s[a.id],delete o[a.id]),s[a.id]=c,o[c]=l}this.setEntitiesState(Object.assign(Object.assign({},i),{ids:i.ids.map(a=>{var l;return null!==(l=s[a])&&void 0!==l?l:a}),entities:o}))}upsertEntitiesMany(t){const i=this.getState(),r=[],s=[];for(const o of t){const a=this.selectIdValue(o);a in i.entities?r.push({id:a,changes:o}):s.push(o)}this.updateMany(r),this.addMany(s)}removeEntitiesMany(t){const i=this.getState(),r=this.generateKeyMap(i),s=Object.assign({},i.entities);for(const o of t)o in s&&(delete r[o],delete s[o]);this.setEntitiesState(Object.assign(Object.assign({},i),{ids:i.ids.filter(o=>o in r),entities:s}))}setEntitiesState(t){const i=this.sortKeysByComparator(t.ids,t.entities);this.ctx.setState(Object.assign(Object.assign({},t),{ids:i,entities:t.entities}))}sortKeysByComparator(t,i){if(so(this.comparator))return t;const r=t.slice(),s=this.comparator;return"function"==typeof s?r.sort((o,a)=>s(i[o],i[a])):this.sortByComparatorOptions(r,s,i)}sortByComparatorOptions(t,i,r){switch(null==i?void 0:i.sortByOrder){case n0.ASC:return t.sort((s,o)=>function(n,e,t){return(null==e?void 0:e[n])>(null==t?void 0:t[n])?1:(null==e?void 0:e[n])<(null==t?void 0:t[n])?-1:0}(null==i?void 0:i.sortBy,r[s],r[o]));case n0.DESC:return t.sort((s,o)=>function(n,e,t){return(null==e?void 0:e[n])>(null==t?void 0:t[n])?-1:(null==e?void 0:e[n])<(null==t?void 0:t[n])?1:0}(null==i?void 0:i.sortBy,r[s],r[o]));default:return Mo()&&console.warn(`Invalid --\x3e { sortByOrder: "${null==i?void 0:i.sortByOrder}" } not supported!`),t}}generateKeyMap(t){return t.ids.reduce((i,r)=>(i[r]=r,i),{})}updateOrigin(t,i){return Object.assign(Object.assign({},t[i.id]),i.changes)}selectIdValue(t){const i=this.selectId(t);return so(i)&&Mo()&&console.warn(`The entity passed to the 'selectId' implementation returned ${i}.`,"You should probably provide your own 'selectId' implementation.","The entity that was passed:",t,"The current `selectId` implementation: (entity: V): K => entity.id"),i}}return n.\u0275fac=function(){let e;return function(i){return(e||(e=$n(n)))(i||n)}}(),n.\u0275prov=ue({token:n,factory:n.\u0275fac}),xe([oi(),Xe("design:type",Object),Xe("design:paramtypes",[])],n.prototype,"snapshot",null),xe([oi(),Xe("design:type",Array),Xe("design:paramtypes",[])],n.prototype,"ids",null),xe([oi(),Xe("design:type",Object),Xe("design:paramtypes",[])],n.prototype,"entities",null),xe([oi(),Xe("design:type",Array),Xe("design:paramtypes",[])],n.prototype,"entitiesArray",null),xe([oi(),Xe("design:type",ce),Xe("design:paramtypes",[])],n.prototype,"ids$",null),xe([oi(),Xe("design:type",ce),Xe("design:paramtypes",[])],n.prototype,"entities$",null),xe([oi(),Xe("design:type",ce),Xe("design:paramtypes",[])],n.prototype,"entitiesArray$",null),xe([on(),Xe("design:type",Function),Xe("design:paramtypes",[]),Xe("design:returntype",void 0)],n.prototype,"reset",null),xe([on(),ws(0,Ms("entity")),Xe("design:type",Function),Xe("design:paramtypes",[Object]),Xe("design:returntype",void 0)],n.prototype,"addOne",null),xe([on(),ws(0,Ms("entities")),Xe("design:type",Function),Xe("design:paramtypes",[Array]),Xe("design:returntype",void 0)],n.prototype,"addMany",null),xe([on(),ws(0,Ms("entity")),Xe("design:type",Function),Xe("design:paramtypes",[Object]),Xe("design:returntype",void 0)],n.prototype,"setOne",null),xe([on(),ws(0,Ms("entities")),Xe("design:type",Function),Xe("design:paramtypes",[Array]),Xe("design:returntype",void 0)],n.prototype,"setMany",null),xe([on(),ws(0,Ms("entities")),Xe("design:type",Function),Xe("design:paramtypes",[Array]),Xe("design:returntype",void 0)],n.prototype,"setAll",null),xe([on(),ws(0,Ms("update")),Xe("design:type",Function),Xe("design:paramtypes",[Object]),Xe("design:returntype",void 0)],n.prototype,"updateOne",null),xe([on(),ws(0,Ms("updates")),Xe("design:type",Function),Xe("design:paramtypes",[Array]),Xe("design:returntype",void 0)],n.prototype,"updateMany",null),xe([on(),ws(0,Ms("entity")),Xe("design:type",Function),Xe("design:paramtypes",[Object]),Xe("design:returntype",void 0)],n.prototype,"upsertOne",null),xe([on(),ws(0,Ms("entities")),Xe("design:type",Function),Xe("design:paramtypes",[Array]),Xe("design:returntype",void 0)],n.prototype,"upsertMany",null),xe([on(),ws(0,Ms("id")),Xe("design:type",Function),Xe("design:paramtypes",[Object]),Xe("design:returntype",void 0)],n.prototype,"removeOne",null),xe([on(),ws(0,Ms("ids")),Xe("design:type",Function),Xe("design:paramtypes",[Array]),Xe("design:returntype",void 0)],n.prototype,"removeMany",null),xe([on(),ws(0,Ms("entity")),Xe("design:type",Function),Xe("design:paramtypes",[Object]),Xe("design:returntype",void 0)],n.prototype,"removeByEntity",null),xe([on(),ws(0,Ms("entities")),Xe("design:type",Function),Xe("design:paramtypes",[Array]),Xe("design:returntype",void 0)],n.prototype,"removeByEntities",null),xe([on(),Xe("design:type",Function),Xe("design:paramtypes",[]),Xe("design:returntype",void 0)],n.prototype,"removeAll",null),xe([on(),ws(0,Ms("comparator")),Xe("design:type",Function),Xe("design:paramtypes",[Object]),Xe("design:returntype",void 0)],n.prototype,"sort",null),n})(),Jm=(()=>{class n extends oF{get snapshot(){return rF(this.getState())}get ctx(){return sF(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=$n(n)))(i||n)}}(),n.\u0275prov=ue({token:n,factory:n.\u0275fac}),xe([oi(),Xe("design:type",Object),Xe("design:paramtypes",[])],n.prototype,"snapshot",null),xe([on(),ws(0,Ms("patchValue")),Xe("design:type",Function),Xe("design:paramtypes",[Object]),Xe("design:returntype",void 0)],n.prototype,"patchState",null),xe([on(),ws(0,Ms("stateValue")),Xe("design:type",Function),Xe("design:paramtypes",[Object]),Xe("design:returntype",void 0)],n.prototype,"setState",null),xe([on(),Xe("design:type",Function),Xe("design:paramtypes",[]),Xe("design:returntype",void 0)],n.prototype,"reset",null),n})();function aF(){return Fn(n=>null!=n)}const dDe={};function lF(...n){const e=n[n.length-1];let t=n,i=dDe;return"object"==typeof e&&(i=e,t=t.slice(0,-1)),r=>r.pipe(ur(...t),Zo(i.compare),qc(1))}const s_=new ve("ngx-google-analytics-settings",{factory:()=>({trackingCode:"",enableTracing:!1})}),IF=new ve("ngx-window",{providedIn:"root",factory:()=>function(n){return Of(n)?window:null}(Oc(dl))}),wIe=new ve("ngx-data-layer",{providedIn:"root",factory:()=>function(n){return n?n.dataLayer=n.dataLayer||[]:null}(Oc(IF))}),PF=new ve("ngx-gtag-fn",{providedIn:"root",factory:()=>function(n,e){return n?n.gtag=n.gtag||function(){e.push(arguments)}:null}(Oc(IF),Oc(wIe))});let xs=(()=>{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||Mo())&&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)(I(s_),I(ut),I(PF))},n.\u0275prov=ue({factory:function(){return new n(I(s_),I(ut),I(PF))},token:n,providedIn:"root"}),n})();const MIe={provide:Mf,multi:!0,useFactory:function(n,e,t){return()=>yl(this,void 0,void 0,function*(){var i;if(!n.trackingCode)return void(Mo()||console.error("Empty tracking code for Google Analytics. Make sure to provide one when initializing NgxGoogleAnalyticsModule."));if(!e)return void(Mo()||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||Mo()||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:[s_,PF,ut]};new ve("ngx-google-analytics-routing-settings",{factory:()=>({})});let RF=(()=>{class n{static forRoot(t,i=[],r,s,o){return{ngModule:n,providers:[{provide:s_,useValue:{trackingCode:t,initCommands:i,uri:r,enableTracing:s,nonce:o}},MIe]}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[]]}),n})(),f0=(()=>{class n{constructor(){this.consent="not-set",this.consentChange=new If(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=ue({token:n,factory:n.\u0275fac}),n})(),DIe=(()=>{class n{constructor(t,i,{trackingCode:r}){this.window=i,this.subscriptions=new Te,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)(I(f0),I(IF),I(s_))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();const OIe=new ve("Key under which consent is stored",{providedIn:"root",factory:()=>"ALLOW_TELEMETRY"}),Kq=[f0,DIe,(()=>{class n{constructor(t,i){this.key=i,this.subscriptions=new Te;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)(I(f0),I(OIe))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})()];function PIe(n){return Object.entries(n).reduce((e,[t,i])=>(null!=i&&(e[t]=`${i}`),e),{})}let kIe=(()=>{class n{static forRoot(t){const{providers:i=[]}=RF.forRoot(t.gaToken,function(n){const{appName:e,projectName:t,developmentMode:i}=n;return[{command:"set",values:[PIe({appName:e,projectName:t,developmentMode:i})]}]}(t));return{ngModule:n,providers:i}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({providers:[...Kq,{provide:Mf,multi:!0,useFactory:()=>()=>{},deps:Kq}],imports:[[RF]]}),n})();class Zq extends Error{constructor(){super(...arguments),this.message="NgxsDispatchPluginModule is not imported"}}function FIe(){throw new Zq}function NIe(){throw new Zq}function kF(n,e,t){e.run(()=>n.dispatch(t))}function VIe(n,e,t,i){return Og(t)?function(n,e,t){return t.then(i=>(kF(n,e,i),i))}(n,e,t):cm(t)?function(n,e,t,i){return null!==i&&(t=t.pipe(Tn(i.cancelUncompleted$))),t.subscribe({next:r=>kF(n,e,r)}),t}(n,e,t,i):(kF(n,e,t),t)}class zIe{constructor(){this.cancelUncompleted$=new Se}cancelPreviousAction(){this.cancelUncompleted$.next()}}const FF="\u0275fac",Qq=Symbol("InjectorInstance"),Jq=Symbol("FactoryHasBeenDecorated");function e9(n,e){const t=n[Qq];return t?t.get(e):null}const HIe={cancelUncompleted:!1};function t9(n=HIe){return(e,t,i)=>{let r;const s=function(n){return n?new zIe:null}(n.cancelUncompleted);function o(){null!==s&&s.cancelPreviousAction();const a=e9(this,cu)||FIe(),l=e9(this,dt)||NIe(),c=r.apply(this,arguments);return l.runOutsideAngular(()=>VIe(a,l,c,s))}"function"==typeof(null==i?void 0:i.value)?(r=i.value,i.value=o):Object.defineProperty(e,t,{set:a=>r=a,get:()=>o}),function(n){if(Jq in n.constructor.prototype)return;const e=n.constructor;"function"==typeof e[FF]&&function(n){const e=n[FF];if("function"!=typeof e)return;const t=n.\u0275prov||n.\u0275pipe||n.\u0275cmp||n.\u0275dir,i=()=>{const r=e();return r[Qq]=E(Fc),r};t&&(t.factory=i),Object.defineProperty(n,FF,{get:()=>i})}(e),n.constructor.prototype[Jq]=!0}(e)}}let n9=(()=>{class n{constructor(){this._vertical=!1,this._inset=!1}get vertical(){return this._vertical}set vertical(t){this._vertical=Mt(t)}get inset(){return this._inset}set inset(t){this._inset=Mt(t)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=Ne({type:n,selectors:[["mat-divider"]],hostAttrs:["role","separator",1,"mat-divider"],hostVars:7,hostBindings:function(t,i){2&t&&(nn("aria-orientation",i.vertical?"vertical":"horizontal"),st("mat-divider-vertical",i.vertical)("mat-divider-horizontal",!i.vertical)("mat-divider-inset",i.inset))},inputs:{vertical:"vertical",inset:"inset"},decls:0,vars:0,template:function(t,i){},styles:[".mat-divider{display:block;margin:0;border-top-width:1px;border-top-style:solid}.mat-divider.mat-divider-vertical{border-top:0;border-right-width:1px;border-right-style:solid}.mat-divider.mat-divider-inset{margin-left:80px}[dir=rtl] .mat-divider.mat-divider-inset{margin-left:auto;margin-right:80px}\n"],encapsulation:2,changeDetection:0}),n})(),yx=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[On],On]}),n})();const sPe=["input"],oPe=function(n){return{enterDuration:n}},aPe=["*"],lPe=new ve("mat-checkbox-default-options",{providedIn:"root",factory:c9});function c9(){return{color:"accent",clickAction:"check-indeterminate"}}let cPe=0;const u9=c9(),uPe={provide:ro,useExisting:T(()=>VF),multi:!0};class dPe{}const hPe=Hf(Uf(nc(jf(class{constructor(n){this._elementRef=n}}))));let VF=(()=>{class n extends hPe{constructor(t,i,r,s,o,a,l){super(t),this._changeDetectorRef=i,this._focusMonitor=r,this._ngZone=s,this._animationMode=a,this._options=l,this.ariaLabel="",this.ariaLabelledby=null,this._uniqueId="mat-checkbox-"+ ++cPe,this.id=this._uniqueId,this.labelPosition="after",this.name=null,this.change=new Le,this.indeterminateChange=new Le,this._onTouched=()=>{},this._currentAnimationClass="",this._currentCheckState=0,this._controlValueAccessorChangeFn=()=>{},this._checked=!1,this._disabled=!1,this._indeterminate=!1,this._options=this._options||u9,this.color=this.defaultColor=this._options.color||u9.color,this.tabIndex=parseInt(o)||0}get inputId(){return`${this.id||this._uniqueId}-input`}get required(){return this._required}set required(t){this._required=Mt(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 i=Mt(t);i!==this.disabled&&(this._disabled=i,this._changeDetectorRef.markForCheck())}get indeterminate(){return this._indeterminate}set indeterminate(t){const i=t!=this._indeterminate;this._indeterminate=Mt(t),i&&(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 i=this._currentCheckState,r=this._elementRef.nativeElement;if(i!==t&&(this._currentAnimationClass.length>0&&r.classList.remove(this._currentAnimationClass),this._currentAnimationClass=this._getAnimationClassForCheckStateTransition(i,t),this._currentCheckState=t,this._currentAnimationClass.length>0)){r.classList.add(this._currentAnimationClass);const s=this._currentAnimationClass;this._ngZone.runOutsideAngular(()=>{setTimeout(()=>{r.classList.remove(s)},1e3)})}}_emitChangeEvent(){const t=new dPe;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 i;const r=null===(i=this._options)||void 0===i?void 0:i.clickAction;t.stopPropagation(),this.disabled||"noop"===r?!this.disabled&&"noop"===r&&(this._inputElement.nativeElement.checked=this.checked,this._inputElement.nativeElement.indeterminate=this.indeterminate):(this.indeterminate&&"check"!==r&&Promise.resolve().then(()=>{this._indeterminate=!1,this.indeterminateChange.emit(this._indeterminate)}),this.toggle(),this._transitionCheckState(this._checked?1:2),this._emitChangeEvent())}focus(t,i){t?this._focusMonitor.focusVia(this._inputElement,t,i):this._inputElement.nativeElement.focus(i)}_onInteractionEvent(t){t.stopPropagation()}_getAnimationClassForCheckStateTransition(t,i){if("NoopAnimations"===this._animationMode)return"";let r="";switch(t){case 0:if(1===i)r="unchecked-checked";else{if(3!=i)return"";r="unchecked-indeterminate"}break;case 2:r=1===i?"unchecked-checked":"unchecked-indeterminate";break;case 1:r=2===i?"checked-unchecked":"checked-indeterminate";break;case 3:r=1===i?"indeterminate-checked":"indeterminate-unchecked"}return`mat-checkbox-anim-${r}`}_syncIndeterminate(t){const i=this._inputElement;i&&(i.nativeElement.indeterminate=t)}}return n.\u0275fac=function(t){return new(t||n)(E(rt),E(kn),E(Sa),E(dt),Zr("tabindex"),E(Do,8),E(lPe,8))},n.\u0275cmp=Ne({type:n,selectors:[["mat-checkbox"]],viewQuery:function(t,i){if(1&t&&(Jn(sPe,5),Jn(Js,5)),2&t){let r;_t(r=yt())&&(i._inputElement=r.first),_t(r=yt())&&(i.ripple=r.first)}},hostAttrs:[1,"mat-checkbox"],hostVars:12,hostBindings:function(t,i){2&t&&(al("id",i.id),nn("tabindex",null),st("mat-checkbox-indeterminate",i.indeterminate)("mat-checkbox-checked",i.checked)("mat-checkbox-disabled",i.disabled)("mat-checkbox-label-before","before"==i.labelPosition)("_mat-animation-noopable","NoopAnimations"===i._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:[Dt([uPe]),ct],ngContentSelectors:aPe,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,i){if(1&t&&(wi(),R(0,"label",0,1),R(2,"span",2),R(3,"input",3,4),ge("change",function(s){return i._onInteractionEvent(s)})("click",function(s){return i._onInputClick(s)}),k(),R(5,"span",5),tt(6,"span",6),k(),tt(7,"span",7),R(8,"span",8),Yt.lFrame.currentNamespace=Wn,R(9,"svg",9),tt(10,"path",10),k(),Yt.lFrame.currentNamespace=null,tt(11,"span",11),k(),k(),R(12,"span",12,13),ge("cdkObserveContent",function(){return i._onLabelTextChange()}),R(14,"span",14),De(15,"\xa0"),k(),Ht(16),k(),k()),2&t){const r=vs(1),s=vs(13);nn("for",i.inputId),G(2),st("mat-checkbox-inner-container-no-side-margin",!s.textContent||!s.textContent.trim()),G(1),ie("id",i.inputId)("required",i.required)("checked",i.checked)("disabled",i.disabled)("tabIndex",i.tabIndex),nn("value",i.value)("name",i.name)("aria-label",i.ariaLabel||null)("aria-labelledby",i.ariaLabelledby)("aria-checked",i._getAriaChecked())("aria-describedby",i.ariaDescribedby),G(2),ie("matRippleTrigger",r)("matRippleDisabled",i._isRippleDisabled())("matRippleRadius",20)("matRippleCentered",!0)("matRippleAnimation",Hg(19,oPe,"NoopAnimations"===i._animationMode?0:150))}},directives:[Js,WD],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}),n})(),d9=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({}),n})(),h9=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[_l,On,SE,d9],On,d9]}),n})();const gPe=["bodyCanvas"];let mPe=(()=>{class n{constructor(){this.clsName="ccf-body-ui",this.rotationChange=new Le,this.nodeDrag=new Le,this.nodeClick=new Le,this.nodeHoverStart=new Le,this.nodeHoverStop=new Le,this.initialized=new Le,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 yl(this,void 0,void 0,function*(){const i=this.bodyCanvas.nativeElement,r=new LMe({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.target&&this.bodyUI.setTarget(this.target),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))],this.initialized.emit()})}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=Ne({type:n,selectors:[["ccf-body-ui"]],viewQuery:function(t,i){if(1&t&&Jn(gPe,5,rt),2&t){let r;_t(r=yt())&&(i.bodyCanvas=r.first)}},hostVars:2,hostBindings:function(t,i){2&t&&Rn(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",initialized:"initialized"},decls:2,vars:0,consts:[[1,"body-ui"],["bodyCanvas",""]],template:function(t,i){1&t&&tt(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})(),_Pe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn]]}),n})();function wPe(n,e){if(1&n&&(R(0,"li",4),De(1),Kt(2,"json"),k()),2&n){const t=e.$implicit;G(1),Aw(" ",t[0],": ",rn(2,2,t[1])," ")}}function EPe(n,e){if(1&n&&(R(0,"div",1),R(1,"div"),De(2),k(),R(3,"ul",2),mt(4,wPe,3,4,"li",3),k(),k()),2&n){const t=e.$implicit;G(2),xi(t[0]),G(2),ie("ngForOf",t[1])}}let SPe=(()=>{class n{constructor(t,i){this.clsName="ccf-store-debug",this.root={},this.subscriptions=new Te;const r=t.subscribe(s=>{this.root=s,i.markForCheck()});this.subscriptions.add(r)}get data(){return Object.entries(this.root).map(([s,o])=>[s,Object.entries(o)]).filter(([s,o])=>o.length>0)}ngOnDestroy(){this.subscriptions.unsubscribe()}}return n.\u0275fac=function(t){return new(t||n)(E(cu),E(kn))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-store-debug"]],hostVars:2,hostBindings:function(t,i){2&t&&Rn(i.clsName)},decls:1,vars:1,consts:[["class","state",4,"ngFor","ngForOf"],[1,"state"],[1,"kvlist"],["class","kvpair",4,"ngFor","ngForOf"],[1,"kvpair"]],template:function(t,i){1&t&&mt(0,EPe,5,2,"div",0),2&t&&ie("ngForOf",i.data)},directives:[pl],pipes:[tV],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0}),n})(),MPe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn]]}),n})();new ve("Maximum number of autocomplete options displayed",{providedIn:"root",factory:()=>10});const OPe=["carouselContainer"],IPe=["itemlist"],PPe=["itemcontainer"];function RPe(n,e){if(1&n){const t=Zi();R(0,"mat-icon",9),ge("touchstart",function(){return en(t),Qe().scroll("left")})("touchend",function(){return en(t),Qe().stopScroll()})("click",function(){return en(t),Qe().shift("left")})("mousedown",function(){return en(t),Qe().scroll("left")})("mouseup",function(){return en(t),Qe().stopScroll()}),De(1,"chevron_left"),k()}2&n&&st("disabled",Qe().onLeft)}function kPe(n,e){if(1&n&&(R(0,"div",15),De(1),k()),2&n){const t=Qe().$implicit,i=Qe();G(1),xi(i.occurenceData[t.id]||0)}}function FPe(n,e){if(1&n){const t=Zi();R(0,"div",10),ge("click",function(){const s=en(t).$implicit;return Qe().selectOrgan(s)}),tt(1,"mat-icon",11),R(2,"div",12),R(3,"div",13),De(4),k(),mt(5,kPe,2,1,"div",14),k(),k()}if(2&n){const t=e.$implicit,i=Qe();st("disabled",t.disabled)("selected",i.isSelected(t)),G(1),Jy("svgIcon",t.src),G(3),xi(t.name),G(1),ie("ngIf",void 0!==t.numResults)}}function NPe(n,e){if(1&n){const t=Zi();R(0,"mat-icon",16),ge("touchstart",function(){return en(t),Qe().scroll("right")})("touchend",function(){return en(t),Qe().stopScroll()})("click",function(){return en(t),Qe().shift("right")})("mousedown",function(){return en(t),Qe().scroll("right")})("mouseup",function(){return en(t),Qe().stopScroll()}),De(1,"chevron_right"),k()}2&n&&st("disabled",Qe().onRight)}const g0=[{src:"app:skin",organ:"Skin",name:"Skin",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002097"},{src:"app:brain",organ:"Brain",name:"Brain",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000955"},{disabled:!0,src:"app:lymph-nodes",organ:"Lymph Node",name:"Lymph Node",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000029"},{src:"app:lymph-nodes",organ:"Lymph Node",name:"Lymph Node",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002509"},{disabled:!0,src:"app:eye",organ:"Eye",name:"Eye, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000970"},{src:"app:eye",organ:"Eye",name:"Eye, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0004548"},{src:"app:eye",organ:"Eye",name:"Eye, R",side:"right",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0004549"},{disabled:!0,src:"app:fallopian-tube-left",organ:"Fallopian Tube",name:"Fallopian Tube, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0003889"},{src:"app:fallopian-tube-left",organ:"Fallopian Tube",name:"Fallopian Tube, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0001303"},{src:"app:fallopian-tube-right",organ:"Fallopian Tube",name:"Fallopian Tube, R",side:"right",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0001302"},{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, L",side:"left",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"},{disabled:!0,src:"app:knee",organ:"Knee",name:"Knee, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001465"},{src:"app:knee",organ:"Knee",name:"Knee, L",side:"left",hasSex:!0,id:"http://purl.org/sig/ont/fma/fma24978"},{src:"app:knee",organ:"Knee",name:"Knee, R",side:"right",hasSex:!0,id:"http://purl.org/sig/ont/fma/fma24977"},{src:"app:liver",organ:"Liver",name:"Liver",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002107"},{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"},{disabled:!0,src:"app:mammary-gland",organ:"Mammary Gland",name:"Mammary Gland, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0001911"},{src:"app:mammary-gland",organ:"Mammary Gland",name:"Mammary Gland, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.org/sig/ont/fma/fma57991"},{src:"app:mammary-gland",organ:"Mammary Gland",name:"Mammary Gland, R",side:"right",hasSex:!1,sex:"female",id:"http://purl.org/sig/ont/fma/fma57987"},{disabled:!0,src:"app:ovary-left",organ:"Ovary",name:"Ovary, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0000992"},{src:"app:ovary-left",organ:"Ovary",name:"Ovary, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.org/sig/ont/fma/fma7214"},{src:"app:ovary-right",organ:"Ovary",name:"Ovary, R",side:"right",hasSex:!1,sex:"female",id:"http://purl.org/sig/ont/fma/fma7213"},{src:"app:pancreas",organ:"Pancreas",name:"Pancreas",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001264"},{src:"app:pelvis-f",organ:"Pelvis",name:"Pelvis",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001270"},{src:"app:placenta",organ:"Placenta",name:"Placenta",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0001987"},{src:"app:prostate",organ:"Prostate",name:"Prostate",hasSex:!1,sex:"male",id:"http://purl.obolibrary.org/obo/UBERON_0002367",disabled:!0},{src:"app:prostate",organ:"Prostate",name:"Prostate",hasSex:!1,sex:"male",id:"http://purl.obolibrary.org/obo/UBERON_0000079"},{src:"app:small-intestine",organ:"Small Intestine",name:"Small Intestine",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002108"},{src:"app:large-intestine",organ:"Large Intestine",name:"Large Intestine",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000059"},{src:"app:spinal-cord",organ:"Spinal Cord",name:"Spinal Cord",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002240"},{src:"app:spleen",organ:"Spleen",name:"Spleen",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002106"},{src:"app:thymus",organ:"Thymus",name:"Thymus",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002370"},{disabled:!0,src:"app:ureter-left",organ:"Ureter",name:"Ureter, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000056"},{src:"app:ureter-left",organ:"Ureter",name:"Ureter, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001223"},{src:"app:ureter-right",organ:"Ureter",name:"Ureter, R",side:"right",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001222"},{src:"app:bladder",organ:"Urinary Bladder",name:"Urinary Bladder",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001255"},{src:"app:uterus",organ:"Uterus",name:"Uterus",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0000995"},{src:"app:vasculature-thick",organ:"Blood Vasculature",name:"Blood Vasculature",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0004537"},{disabled:!0,src:"app:vasculature-thick",organ:"Blood Vasculature",name:"Blood Vasculature",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002049"}].sort((n,e)=>n.name.localeCompare(e.name)).filter(n=>!0!==n.disabled);let p9=(()=>{class n{constructor(){this.clsName="ccf-organ-selector",this.multiselect=!1,this.displayErrors=!1,this.organList=g0,this.selectedOrgans=[],this.expanded=!1,this.organsChanged=new Le,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 hW.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:i}=this;let r=parseInt(i.nativeElement.style.left,10)||0;this.onLeft&&"left"===t||this.onRight&&"right"===t||(r="right"===t?r-this.step:r+this.step,i.nativeElement.style.left=r+"px",this.setLeftRight(r))}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(i=>t!==i):this.selectedOrgans.concat([t]):[t],this.organsChanged.emit(this.selectedOrgans)}isSelected(t){return!!this.selectedOrgans.includes(t)}set(){const{itemList:t,itemContainer:i,carouselContainer:r}=this,s=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(s);const o=this.step*Math.floor(r.nativeElement.offsetWidth/this.step)-64;i.nativeElement.style.width=`${o}px`}}setWidth(){const{itemContainer:t,carouselContainer:i}=this,r=this.step*Math.floor(i.nativeElement.offsetWidth/this.step)-64;t.nativeElement.style.width=`${r}px`}setLeftRight(t){const{itemContainer:i}=this;this.onLeft=0===t,this.onRight=t<=i.nativeElement.offsetWidth-this.organList.length*this.step}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=Ne({type:n,selectors:[["ccf-organ-selector"]],viewQuery:function(t,i){if(1&t&&(Jn(OPe,7),Jn(IPe,7),Jn(PPe,7)),2&t){let r;_t(r=yt())&&(i.carouselContainer=r.first),_t(r=yt())&&(i.itemList=r.first),_t(r=yt())&&(i.itemContainer=r.first)}},hostVars:2,hostBindings:function(t,i){2&t&&Rn(i.clsName)},inputs:{multiselect:"multiselect",displayErrors:"displayErrors",organList:"organList",selectedOrgans:"selectedOrgans",expanded:"expanded",occurenceData:"occurenceData"},outputs:{organsChanged:"organsChanged"},features:[zn],decls:9,vars:8,consts:[["matTooltip","Select the organ your tissue block is from.",1,"container",3,"matTooltipDisabled"],["carouselContainer",""],["class","carousel-left-icon",3,"disabled","touchstart","touchend","click","mousedown","mouseup",4,"ngIf"],[1,"carousel-item-container"],["itemcontainer",""],[1,"carousel-item-list"],["itemlist",""],["class","carousel-item",3,"disabled","selected","click",4,"ngFor","ngForOf"],["class","carousel-right-icon",3,"disabled","touchstart","touchend","click","mousedown","mouseup",4,"ngIf"],[1,"carousel-left-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"],[1,"carousel-right-icon",3,"touchstart","touchend","click","mousedown","mouseup"]],template:function(t,i){1&t&&(R(0,"div",0,1),mt(2,RPe,2,2,"mat-icon",2),R(3,"div",3,4),R(5,"div",5,6),mt(7,FPe,6,7,"div",7),k(),k(),mt(8,NPe,2,2,"mat-icon",8),k()),2&t&&(st("expanded",i.expanded)("error",i.error),ie("matTooltipDisabled",i.multiselect),G(2),ie("ngIf",!i.expanded),G(5),ie("ngForOf",i.organList),G(1),ie("ngIf",!i.expanded))},directives:[dc,zr,pl,rs],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:5rem;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}[_nghost-%COMP%] .expanded[_ngcontent-%COMP%] .carousel-item-container[_ngcontent-%COMP%]{width:100%!important}[_nghost-%COMP%] .expanded[_ngcontent-%COMP%] .carousel-item-container[_ngcontent-%COMP%] .carousel-item-list[_ngcontent-%COMP%]{flex-wrap:wrap;overflow:auto;left:0rem!important}[_nghost-%COMP%] .expanded[_ngcontent-%COMP%] .carousel-item-container[_ngcontent-%COMP%] .carousel-item-list[_ngcontent-%COMP%] .carousel-item[_ngcontent-%COMP%]{height:5rem}"]}),n})(),g9=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,lr,hc]]}),n})(),LPe=(()=>{class n{constructor(){this.clsName="ccf-opacity-slider",this.opacity=20,this.visible=!0,this.opacityChange=new Le,this.visibilityToggle=new Le,this.opacityReset=new Le}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 n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=Ne({type:n,selectors:[["ccf-opacity-slider"]],hostVars:2,hostBindings:function(t,i){2&t&&Rn(i.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,i){1&t&&(R(0,"div",0),R(1,"div",1),R(2,"mat-slider",2),ge("input",function(s){return i.changeOpacity(s.value)}),k(),R(3,"span",3),De(4),k(),k(),R(5,"div",4),R(6,"mat-icon",5),ge("click",function(){return i.toggleVisibility()}),k(),R(7,"mat-icon",6),ge("click",function(){return i.toggleVisibility()}),k(),R(8,"mat-icon",7),ge("click",function(){return i.resetOpacity()}),De(9,"refresh"),k(),k(),k()),2&t&&(G(2),st("disabled",!i.visible),ie("step",1)("min",0)("max",100)("value",i.opacity),G(2),or("",i.opacity,"%"),G(2),st("hidden",i.visible),ie("matRippleCentered",!0)("matRippleUnbounded",!0),G(1),st("hidden",!i.visible),ie("matRippleCentered",!0)("matRippleUnbounded",!0),G(1),ie("matRippleCentered",!0)("matRippleUnbounded",!0))},directives:[jk,rs,Js],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}),n})(),m9=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,lr,_W,_l]]}),n})();function BPe(n,e){if(1&n&&(R(0,"div",16),tt(1,"youtube-player",17),k()),2&n){const t=Qe(3);G(1),Jy("videoId",t.videoID)}}function VPe(n,e){if(1&n&&(R(0,"mat-expansion-panel",11),R(1,"mat-expansion-panel-header"),R(2,"h2",12),De(3),k(),k(),R(4,"div",13),tt(5,"markdown",14),mt(6,BPe,2,1,"div",15),k(),k()),2&n){const t=Qe(),i=t.index,r=t.$implicit;ie("expanded",0===i),G(3),xi(r.title),G(2),st("first",0===i),ie("data",r.content),G(1),ie("ngIf",0===i)}}function zPe(n,e){if(1&n&&(R(0,"div",9),mt(1,VPe,7,6,"mat-expansion-panel",10),k()),2&n){const t=e.$implicit;G(1),ie("ngIf",t)}}let _9=(()=>{class n{constructor(t,i){this.dialogRef=t,this.data=i,this.documentationContents=i.content||[],this.infoTitle=i.title||"",this.videoID=i.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 n.\u0275fac=function(t){return new(t||n)(E(Qm),E(Gk))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-info-dialog"]],decls:11,vars:2,consts:[[1,"rui-about","wrapper"],[1,"container"],[1,"content"],[1,"header"],["mat-dialog-title","",1,"title"],[1,"close"],[1,"material-icons","close-icon",3,"click"],[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,i){1&t&&(R(0,"div",0),R(1,"div",1),R(2,"div",2),R(3,"div",3),R(4,"h2",4),De(5),k(),R(6,"div",5),R(7,"mat-icon",6),ge("click",function(){return i.close()}),De(8,"clear"),k(),k(),k(),R(9,"mat-dialog-content",7),mt(10,zPe,2,1,"div",8),k(),k(),k(),k()),2&t&&(G(5),xi(i.infoTitle),G(5),ie("ngForOf",i.documentationContents))},directives:[Wk,rs,qk,pl,zr,qM,YM,TW,IW],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%] .content[_ngcontent-%COMP%] .header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;height:3rem;margin-bottom:2.25rem;position:relative}.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%]{cursor:pointer;height:3rem;width:3rem;line-height:3rem;text-align:center;transition:.6s}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-size:1.5rem;margin:0 auto;line-height:3rem;height:3rem;justify-self:center;display:flex}.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;display:flex}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .dialog-content[_ngcontent-%COMP%] .variable-binding.first[_ngcontent-%COMP%]{padding-right:1rem;width:73%}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .dialog-content[_ngcontent-%COMP%] .variable-binding[_ngcontent-%COMP%] ul{margin:0}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .dialog-content[_ngcontent-%COMP%] .variable-binding[_ngcontent-%COMP%] img{margin-left:1rem;float:right}.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%}"]}),n})(),jPe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,Qb,lr,Kk,pAe,XTe.forRoot({})]]}),n})(),y9=(()=>{class n{constructor(t){this.http=t,this.panelContent=new ar({content:[],infoTitle:"",videoID:""})}updateData(t,i,r){this.http.get(t,{responseType:"text"}).subscribe(s=>{const o={content:this.parseMarkdown(s),infoTitle:r,videoID:i};this.panelContent.next(o)})}parseMarkdown(t){const i=[],r=t.split("# ");for(const s of r)if(s.length){const o=s.includes("\n\n")?"\n\n":"\r\n\r\n",a=s.split(o);i.push({title:a[0],content:a.splice(1).join(o)})}return i}}return n.\u0275fac=function(t){return new(t||n)(I(Wf))},n.\u0275prov=ue({token:n,factory:n.\u0275fac,providedIn:"root"}),n})(),UPe=(()=>{class n{constructor(t,i){this.dialog=t,this.infoButtonService=i,this.infoTitle="",this.subscriptions=new Te,this.subscriptions.add(i.panelContent.subscribe(r=>{r.content.length&&this.launchInfoDialog(r)}))}ngOnDestroy(){this.subscriptions.unsubscribe()}launchInfoDialog(t){0==this.dialog.openDialogs.length&&this.dialog.open(_9,{autoFocus:!1,panelClass:"modal-animated",width:"72rem",data:{title:t.infoTitle,content:t.content,videoID:t.videoID}})}onDialogButtonClick(){this.infoButtonService.updateData(this.documentationUrl,this.videoID,this.infoTitle)}}return n.\u0275fac=function(t){return new(t||n)(E(_p),E(y9))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-info-button"]],inputs:{infoTitle:"infoTitle",videoID:"videoID",documentationUrl:"documentationUrl"},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,i){1&t&&(R(0,"div",0),R(1,"mat-icon",1),ge("click",function(){return i.onDialogButtonClick()}),De(2," info "),k(),k())},directives:[rs],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}"]}),n})(),HPe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,jPe,lr,Rj]]}),n})(),$Pe=(()=>{class n{constructor(){this.clsName="ccf-call-to-action",this.callToActionClicked=new Le,this.closeClicked=new Le}close(){this.closeClicked.emit()}onDialogButtonClick(){this.callToActionClicked.emit()}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=Ne({type:n,selectors:[["ccf-call-to-action"]],hostVars:2,hostBindings:function(t,i){2&t&&Rn(i.clsName)},inputs:{infoTitle:"infoTitle",imageUrl:"imageUrl",message:"message",callToAction:"callToAction"},outputs:{callToActionClicked:"callToActionClicked",closeClicked:"closeClicked"},decls:13,vars:4,consts:[[1,"rui-about","wrapper"],[1,"container"],[1,"content"],[1,"first-row"],["mat-dialog-title","",1,"title"],[1,"cta-mat-icon","material-icons","close-icon",3,"click"],["mat-card-sm-image","","alt","preview","layout-fill","",1,"cta-image",3,"src"],[1,"mat-typography","dialog-content"],[1,"message"],["mat-button","",1,"mat-button",3,"text","click"]],template:function(t,i){1&t&&(R(0,"div",0),R(1,"div",1),R(2,"div",2),R(3,"div",3),R(4,"p",4),De(5),k(),R(6,"mat-icon",5),ge("click",function(){return i.close()}),De(7,"clear"),k(),k(),tt(8,"img",6),R(9,"mat-dialog-content",7),R(10,"div",8),De(11),k(),R(12,"a",9),ge("click",function(){return i.onDialogButtonClick()}),k(),k(),k(),k(),k()),2&t&&(G(5),xi(i.infoTitle),G(3),ie("src",i.imageUrl,Ud),G(3),or(" ",i.message,""),G(1),ie("text",i.callToAction))},directives:[Wk,rs,CAe,qk],styles:["[_nghost-%COMP%] .content[_ngcontent-%COMP%]{display:block;align-content:center;padding-left:1.6rem;padding-right:1.6rem;border-radius:.25rem}[_nghost-%COMP%] .info-button-wrapper[_ngcontent-%COMP%]{border-radius:.25rem;padding:.6rem;transition:.6s}[_nghost-%COMP%] .info-button-wrapper[_ngcontent-%COMP%] .ccf-info-button[_ngcontent-%COMP%]{cursor:pointer;transition:color .6s;font-size:1.2rem;vertical-align:sub}[_nghost-%COMP%] .first-row[_ngcontent-%COMP%]{display:flex;width:100%;line-height:.9rem}[_nghost-%COMP%] .first-row[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{padding-right:7rem;padding-left:.2rem;font-size:.875rem;padding-top:.75rem}[_nghost-%COMP%] .first-row[_ngcontent-%COMP%] .cta-mat-icon[_ngcontent-%COMP%]{height:30%;line-height:3.4rem}[_nghost-%COMP%] .message[_ngcontent-%COMP%]{padding:.5rem}[_nghost-%COMP%] .cta-image[_ngcontent-%COMP%]{align-self:center;-o-object-fit:cover;object-fit:cover;width:100%;border-radius:.25rem}[_nghost-%COMP%] .mat-button[_ngcontent-%COMP%]{background-color:#444a65;font-size:.75rem;position:relative;margin-bottom:1rem;width:100%;height:2rem;color:#fff}"],changeDetection:0}),n})(),WPe=(()=>{class n{constructor(t){this.el=t}onInputChange(t){const i=this.el.nativeElement.value;this.el.nativeElement.value=i.replace(/[^0-9]*/g,""),i!==this.el.nativeElement.value&&t.stopPropagation()}}return n.\u0275fac=function(t){return new(t||n)(E(rt))},n.\u0275dir=oe({type:n,selectors:[["input","ccfNumbersOnly",""]],hostBindings:function(t,i){1&t&&ge("input",function(s){return i.onInputChange(s)})}}),n})(),qPe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({}),n})(),v9=(()=>{class n{get obj(){const t=this.findGlobalObject();return Object.defineProperties(this,{obj:{configurable:!1,writable:!1,value:t}}),t}has(t){const{obj:i}=this;return null!=i&&t in i}get(t,i){var r;const{obj:s}=this;return null!==(r=s&&s[t])&&void 0!==r?r:i}set(t,i){const{obj:r}=this;r&&(r[t]=i)}remove(t){const{obj:i}=this;i&&delete i[t]}findGlobalObject(){if("undefined"!=typeof globalThis)return globalThis;if("undefined"!=typeof global)return global;if("undefined"!=typeof window)return window;if("undefined"!=typeof self)return self;try{return new Function("return this;")()}catch(t){}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ue({token:n,factory:n.\u0275fac,providedIn:"root"}),n})(),Ah=(()=>{let n=class extends Jm{constructor(){super(...arguments),this.optionCache=new Map}get config$(){return this.state$.pipe(aF(),qc(1))}setConfig(t){this.setState(t)}patchConfig(t){this.patchState(t)}getProperty(t){return this.config$.pipe(ur(...t),Zo(),qc(1))}getOption(...t){const i=this.getPathKey(t);if(this.optionCache.has(i))return this.optionCache.get(i);const r=this.config$.pipe(ur(...t),Zo(),qc(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=$n(n)))(i||n)}}(),n.\u0275prov=ue({token:n,factory:n.\u0275fac}),xe([oi()],n.prototype,"config$",null),n=xe([xh(),cd({name:"globalConfig",defaults:null})],n),n})();!function(){const n=localStorage.getItem("ALLOW_TELEMETRY");null===n||n.toLowerCase()}();let ZPe=(()=>{class n{constructor(t,i){t&&function(n,e){Wc(n,"mousemove").pipe(dW(1e3),Ae(r=>{const{clientWidth:s,clientHeight:o}=n,{clientX:a,clientY:l}=r;return[a,l,s,o].join("_")})).subscribe(r=>e.event("webpage","mousemove",r))}(t.body,i)}}return n.\u0275fac=function(t){return new(t||n)(I(ut),I(xs))},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({}),n})();function QPe(n,e){if(1&n){const t=Zi();R(0,"button",1),ge("click",function(){return en(t),Qe().submit(!0)}),De(1),k()}if(2&n){const t=Qe();G(1),or(" ","not-set"===t.allowTelemetry?"I understand":"Opt in","\n")}}function JPe(n,e){if(1&n){const t=Zi();R(0,"button",1),ge("click",function(){return en(t),Qe().submit(!1)}),De(1,"Opt out"),k()}}let eRe=(()=>{class n{constructor(t,i,r){this.consentService=i,this.data=r,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:i}=this;return"not-set"===i||("opt-in"===t?"rescinded"===i:"given"===i)}}return n.\u0275fac=function(t){return new(t||n)(E(rt),E(f0),E(KO))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-tracking-popup"]],hostVars:2,hostBindings:function(t,i){2&t&&Rn(i.clsName)},decls:4,vars:2,consts:[["mat-button","","color","basic",3,"click",4,"ngIf"],["mat-button","","color","basic",3,"click"]],template:function(t,i){1&t&&(R(0,"p"),De(1,"We log usage to improve this service."),k(),mt(2,QPe,2,1,"button",0),mt(3,JPe,2,0,"button",0)),2&t&&(G(2),ie("ngIf",i.showButton("opt-in")),G(1),ie("ngIf",i.showButton("opt-out")))},directives:[zr,lh],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}),n})(),tRe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,ch]]}),n})();new Se;let zF=(()=>{class n{}return n.type="[CallToAction] Learn More",n})(),jF=(()=>{class n{}return n.type="[CallToAction] Open Dialog",n})(),UF=(()=>{class n{}return n.type="[CallToAction] Close Dialog",n})();var HF;class sa{get length(){var e,t;return null!==(t=null===(e=sa.storage)||void 0===e?void 0:e.length)&&void 0!==t?t:0}key(e){var t,i;return null!==(i=null===(t=sa.storage)||void 0===t?void 0:t.key(e))&&void 0!==i?i:null}getItem(e,t){var i,r,s;return null!==(s=null!==(r=null===(i=sa.storage)||void 0===i?void 0:i.getItem(e))&&void 0!==r?r:t)&&void 0!==s?s:null}setItem(e,t){var i;try{return null===(i=sa.storage)||void 0===i||i.setItem(e,t),!0}catch(r){return!1}}removeItem(e){var t;null===(t=sa.storage)||void 0===t||t.removeItem(e)}clear(){var e;null===(e=sa.storage)||void 0===e||e.clear()}}sa.storage=(()=>{let n;try{n=window.localStorage;const e="__storage_test__";return n.setItem(e,e),n.removeItem(e),n}catch(e){return e instanceof DOMException&&(22===e.code||1014===e.code||"QuotaExceededError"===e.name||"NS_ERROR_DOM_QUOTA_REACHED"===e.name)&&n&&0!==n.length?n:void 0}})(),sa.\u0275fac=function(e){return new(e||sa)},sa.\u0275prov=ue({token:sa,factory:sa.\u0275fac,providedIn:"root"});const w9="callToActionPopupShown";let oo=HF=class{constructor(e,t,i,r,s){this.dialog=e,this.ga=t,this.storage=i,this.infoService=r,this.http=s}static ctaDatePassed(e,t=Date.now){return+t()>+new Date(e)}ngxsOnInit(e){const{expirationDate:t,popupShown:i}=e.getState(),r=this.storage.getItem(w9,`${i}`),s=HF.ctaDatePassed(t);"true"!==r&&!s&&e.dispatch(new jF)}getDialogData(){return this.http.get("assets/docs/SPATIAL_SEARCH_README.md",{responseType:"text"}).pipe(Ae(e=>this.infoService.parseMarkdown(e)))}launchLearnMore(e){this.dialog.open(_9,{autoFocus:!1,panelClass:"modal-animated",width:"72rem",data:{title:"Spatial Search",content:e,videoID:"UfxMpzatowE"}})}learnMore(e){return this.dialog.closeAll(),this.ga.event("open_learn_more","call_to_action"),this.getDialogData().pipe(Ti(t=>this.launchLearnMore(t)))}open(e){this.dialog.open(iRe,{autoFocus:!1,panelClass:"modal-animated",width:"30.75rem",height:"36.688rem"}),this.ga.event("open","call_to_action"),this.storage.setItem(w9,"true"),e.patchState({popupShown:!0})}close(e){this.dialog.closeAll(),this.ga.event("close","call_to_action")}};oo.\u0275fac=function(e){return new(e||oo)(I(_p),I(xs),I(sa),I(y9),I(Wf))},oo.\u0275prov=ue({token:oo,factory:oo.\u0275fac}),xe([gk(zF)],oo.prototype,"learnMore",null),xe([gk(jF)],oo.prototype,"open",null),xe([gk(UF)],oo.prototype,"close",null),oo=HF=xe([cd({name:"callToAction",defaults:{title:"New to the Exploration User Interface",message:"Spatial Search has arrived!",callToAction:"Learn More",imageUrl:"assets/images/spatial_search.gif",expirationDate:"Dec 1, 2022",popupShown:!1}})],oo);let vx=(()=>{class n{static title(t){return t.title}static message(t){return t.message}static callToAction(t){return t.callToAction}static imageUrl(t){return t.imageUrl}static expirationDate(t){return t.expirationDate}static popupShown(t){return t.popupShown}}return xe([Xm([oo])],n,"title",null),xe([Xm([oo])],n,"message",null),xe([Xm([oo])],n,"callToAction",null),xe([Xm([oo])],n,"imageUrl",null),xe([Xm([oo])],n,"expirationDate",null),xe([Xm([oo])],n,"popupShown",null),n})(),iRe=(()=>{class n{constructor(){this.close=()=>new UF,this.learnMore=()=>new zF}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=Ne({type:n,selectors:[["ccf-call-to-action-behavior"]],decls:5,vars:12,consts:[[3,"infoTitle","message","callToAction","imageUrl","callToActionClicked","closeClicked"]],template:function(t,i){1&t&&(R(0,"ccf-call-to-action",0),ge("callToActionClicked",function(){return i.learnMore()})("closeClicked",function(){return i.close()}),Kt(1,"async"),Kt(2,"async"),Kt(3,"async"),Kt(4,"async"),k()),2&t&&ie("infoTitle",rn(1,4,i.title$))("message",rn(2,6,i.message$))("callToAction",rn(3,8,i.callToAction$))("imageUrl",rn(4,10,i.imageUrl$))},directives:[$Pe],pipes:[Hc],styles:[""],changeDetection:0}),xe([NM(vx.title)],n.prototype,"title$",void 0),xe([NM(vx.message)],n.prototype,"message$",void 0),xe([NM(vx.callToAction)],n.prototype,"callToAction$",void 0),xe([NM(vx.imageUrl)],n.prototype,"imageUrl$",void 0),xe([t9()],n.prototype,"close",void 0),xe([t9()],n.prototype,"learnMore",void 0),n})();const oRe={initialConfig:{},parse:{},rename:{}};class aRe{constructor(e,t){this.configState=e,this.storedChanges={},this.options=Object.assign(Object.assign({},oRe),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 lRe=(()=>{class n{constructor(t,i,r={}){this.configState=t,this.cdr=i,this.options=r,this.initialized=!1,this.configManager=new aRe(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=oe({type:n,features:[zn]}),n})();const cRe={boolean:n=>"false"!=`${n}`,json:n=>"string"==typeof n?JSON.parse(n):n,function:n=>{if("function"!=typeof n)throw new Error("Expected a javascript function");return n}};var $F;const hu={production:!0,disableDbWorker:!0,dbOptions:{ccfOwlUrl:"https://ccf-ontology.hubmapconsortium.org/v2.1.0/ccf.owl",ccfContextUrl:"https://hubmapconsortium.github.io/ccf-ontology/ccf-context.jsonld",hubmapDataService:"search-api",hubmapPortalUrl:"https://portal.hubmapconsortium.org/",hubmapDataUrl:"",hubmapAssetsUrl:"https://assets.hubmapconsortium.org",hubmapToken:null!==($F=localStorage.getItem("HUBMAP_TOKEN"))&&void 0!==$F?$F:""},customization:{theme:"hubmap",header:!0,homeUrl:"https://portal.hubmapconsortium.org/",logoTooltip:"Human BioMolecular Atlas Project"},skipUnsavedChangesConfirmation:!1,googleAnalyticsToken:"portal.hubmapconsortium.org"===window.location.hostname?"G-1WRJHN9FM6":"G-J9HWV9QPJ4"};var uRe=ze(815);class hRe{constructor(e){this.value=e}call(e,t){return t.subscribe(new fRe(e,this.value))}}class fRe extends xt{constructor(e,t){super(e),this.value=t}_next(e){this.destination.next(this.value)}}class gRe{constructor(e){this.notifier=e}call(e,t){return t.subscribe(new mRe(e,this.notifier))}}class mRe extends ii{constructor(e,t){super(e),this.hasValue=!1;const i=new Gr(this);this.add(i),this.innerSubscription=i;const r=co(t,i);r!==i&&(this.add(r),this.innerSubscription=r)}_next(e){this.hasValue&&super._next(e)}notifyNext(){this.hasValue=!0,this.innerSubscription&&this.innerSubscription.unsubscribe()}notifyComplete(){}}function GF(n){return"function"==typeof n}function E9(n){return void 0===n}function yRe(n,e,t){return function(r){let s=!!n;return function(n){return"function"==typeof n}(n)&&(s=n(r)),function(n,e){return GF(n)?n(e):E9(n)?e:n}(s?e:t,r)}}function vRe(n,e){return function(i){if(function(n){return null===n||E9(n)}(n)&&i)return i;if(!Array.isArray(i))return[n];const r=i.slice();let s=0;return e>0&&(s=e),r.splice(s,0,n),r}}function m0(n){return function(t){let i=null;for(const r in n){const s=n[r],o=t[r],a=GF(s)?s(o):s;a!==o&&(i||(i=Object.assign({},t)),i[r]=a)}return i||t}}let ji=class extends Jm{constructor(e){super(),this.globalConfig=e,this.user$=this.state$.pipe(ur("user")),this.registrationStarted$=this.state$.pipe(lF("registrationStarted")),this.useCancelRegistrationCallback$=this.state$.pipe(ur("useCancelRegistrationCallback")),this.registrationCallbackSet$=this.state$.pipe(ur("registrationCallbackSet"))}get skipConfirmation$(){return this.state$.pipe(lF("skipConfirmation"))}get globalSkipConfirmation$(){return this.globalConfig.getOption("skipUnsavedChangesConfirmation").pipe(Ae(e=>null!=e?e:hu.skipUnsavedChangesConfirmation),Zo())}get hasChanges$(){return this.state$.pipe(lF("hasChanges"))}ngxsOnInit(){super.ngxsOnInit(),this.globalConfig.config$.pipe(yi(1),Ti(e=>this.setState(m0({registrationCallbackSet:!!e.register,useCancelRegistrationCallback:!!e.cancelRegistration,user:yRe(!!e.user,e.user),registrationStarted:!!e.user||void 0})))).subscribe(),this.initSkipConfirmationListeners()}cancelRegistration(){const{globalConfig:{snapshot:{cancelRegistration:e}},snapshot:{useCancelRegistrationCallback:t,skipConfirmation:i}}=this;t&&(i||confirm("Changes you made may not be saved."))&&(null==e||e())}setUseCancelRegistrationCallback(e){this.ctx.patchState({useCancelRegistrationCallback:e})}setUserName(e){this.ctx.setState(m0({user:m0(e)}))}registrationStarted(){this.ctx.setState(m0({registrationStarted:!0}))}setHasChanges(){const{snapshot:{registrationStarted:e,hasChanges:t}}=this;e&&!t&&this.ctx.patchState({hasChanges:!0})}clearHasChanges(){this.ctx.patchState({hasChanges:!1})}initSkipConfirmationListeners(){const e=i=>this.patchState({skipConfirmation:i});this.globalSkipConfirmation$.pipe(Fn(i=>i)).subscribe(e),this.hasChanges$.pipe(ZM(this.globalSkipConfirmation$),Ae(([i,r])=>r||!i),Zo()).subscribe(e);const t=i=>(i.preventDefault(),i.returnValue="Changes you made may not be saved.",i.returnValue);this.skipConfirmation$.subscribe(i=>{i?removeEventListener("beforeunload",t):addEventListener("beforeunload",t)})}};ji.\u0275fac=function(e){return new(e||ji)(I(Ah))},ji.\u0275prov=ue({token:ji,factory:ji.\u0275fac}),xe([oi()],ji.prototype,"skipConfirmation$",null),xe([oi()],ji.prototype,"globalSkipConfirmation$",null),xe([oi()],ji.prototype,"hasChanges$",null),xe([on()],ji.prototype,"setUseCancelRegistrationCallback",null),xe([on()],ji.prototype,"setUserName",null),xe([on()],ji.prototype,"registrationStarted",null),xe([on()],ji.prototype,"setHasChanges",null),xe([on()],ji.prototype,"clearHasChanges",null),ji=xe([xh(),cd({name:"page",defaults:{user:{firstName:"",lastName:""},registrationStarted:!1,useCancelRegistrationCallback:!1,registrationCallbackSet:!1,skipConfirmation:!0,hasChanges:!1}})],ji);let fc=class extends Jm{constructor(e,t){super(),this.globals=e,this.globalConfig=t}ngxsOnInit(){super.ngxsOnInit(),this.getSourceDB().subscribe(e=>{this.setState(e),hu.production||this.globals.set("db",e)})}getSourceDB(){return this.globalConfig.getOption("baseHref").pipe(Ae(e=>(null!=e?e:"")+"assets/reference-organ-data.json"),Pr(e=>ui(fetch(e)).pipe(Pr(t=>t.json()),Ta(()=>ec))))}normalizePlacement(e){const i=this.snapshot.placementPatches[null==e?void 0:e.target];if(i){const r=function(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(ib),o=[t.x_scaling,t.y_scaling,t.z_scaling];return n.translate(r).rotateXYZ(s).scale(o)}(new $t($t.IDENTITY),i),s={x:e.x_translation,y:e.y_translation,z:e.z_translation},[o,a,l]=r.transformAsPoint([s.x,s.y,s.z],[]),c=Object.assign(Object.assign({},e),{target:i.target});return c.x_translation=o,c.y_translation=a,c.z_translation=l,c}return e}getReferenceOrganIri(e,t,i,r){const s=this.snapshot;"KIDNEY"!==e.toUpperCase()&&(i=""),(null==r?void 0:r.sex)&&(t=r.sex);const o=[e,t,i||(null==r?void 0:r.side)].join("|").toUpperCase(),a=Object.keys(s.organIRILookup).find(l=>l.toUpperCase().endsWith(o));return a?s.organIRILookup[a]:void 0}getOrganData(e){var t,i,r;const o=this.snapshot.organSpatialEntities[e];if(!o)return;const a=null!==(t=o.label)&&void 0!==t?t:"",l=g0.find(c=>a.endsWith(c.organ)&&(!o.side||o.side.toLowerCase()===c.side));return l?{organ:l,sex:null===(i=o.sex)||void 0===i?void 0:i.toLowerCase(),side:null===(r=o.side)||void 0===r?void 0:r.toLowerCase()}:void 0}};fc.\u0275fac=function(e){return new(e||fc)(I(v9),I(Ah))},fc.\u0275prov=ue({token:fc,factory:fc.\u0275fac}),fc=xe([xh(),cd({name:"reference",defaults:{organIRILookup:{},organSpatialEntities:{},anatomicalStructures:{},extractionSets:{},sceneNodeLookup:{},simpleSceneNodeLookup:{},placementPatches:{}}})],fc);const qF=g0;let ai=class extends Jm{constructor(e,t,i){super(),this.ga=e,this.injector=t,this.globalConfig=i,this.id$=this.state$.pipe(ur("id")),this.blockSize$=this.state$.pipe(ur("blockSize")),this.rotation$=this.state$.pipe(ur("rotation")),this.position$=this.state$.pipe(ur("position")),this.slicesConfig$=this.state$.pipe(ur("slicesConfig")),this.viewType$=this.state$.pipe(ur("viewType")),this.viewSide$=this.state$.pipe(ur("viewSide")),this.organ$=this.state$.pipe(ur("organ")),this.organIri$=this.state$.pipe(ur("organIri")),this.organDimensions$=this.state$.pipe(ur("organDimensions")),this.sex$=this.state$.pipe(ur("sex")),this.side$=this.state$.pipe(ur("side")),this.showPrevious$=this.state$.pipe(ur("showPrevious")),this.extractionSites$=this.state$.pipe(ur("extractionSites")),this.anatomicalStructures$=this.state$.pipe(ur("anatomicalStructures")),this.extractionSets$=this.state$.pipe(ur("extractionSets"))}get modelChanged$(){const e=["viewType","viewSide","showPrevious"],t=Object.keys(this.initialState).filter(i=>!e.includes(i));return this.state$.pipe(dW(0,void 0,{leading:!1,trailing:!0}),Zo((i,r)=>{for(const s of t)if(i[s]!==r[s])return!1;return!0}),e=>e.lift(new hRe(void 0)))}ngxsOnInit(){super.ngxsOnInit(),this.referenceData=this.injector.get(fc),this.page=this.injector.get(ji),this.globalConfig.getOption("organ").pipe(aF(),Pr(e=>{var t,i;const r=e.name.toLowerCase(),s=e.side;let a=this.idMatches(e.ontologyId,s);return a||(a=this.nameMatches(r,s)),a?(this.ctx.patchState({organ:a,sex:null===(t=e.sex)||void 0===t?void 0:t.toLowerCase(),side:null===(i=null==a?void 0:a.side)||void 0===i?void 0:i.toLowerCase()}),this.referenceData.state$.pipe(Zg(100),yi(1),Vk(200),Ti(()=>this.onOrganIriChange()))):ec})).subscribe(),this.modelChanged$.pipe(function(n){return e=>e.lift(new gRe(n))}(this.page.registrationStarted$.pipe(Fn(e=>e),Vk(5)))).subscribe(()=>this.page.setHasChanges())}idMatches(e,t){return g0.find(i=>!(!e||i.id!==e||i.side&&i.side!==t))}nameMatches(e,t){return g0.find(i=>i.side?i.organ.toLowerCase()===e&&i.side===t:i.organ.toLowerCase()===e)}setBlockSize(e){this.ctx.patchState({blockSize:e})}setRotation(e){this.ctx.patchState({rotation:e})}setPosition(e){var t;this.ga.event("placement",`${null===(t=this.snapshot.organ)||void 0===t?void 0:t.name}_placement`,`${e.x.toFixed(1)}_${e.y.toFixed(1)}_${e.z.toFixed(1)}`),this.ctx.patchState({position:e})}setSlicesConfig(e){this.ctx.patchState({slicesConfig:e})}setViewType(e){this.ctx.patchState({viewType:e})}setViewSide(e){this.ctx.patchState({viewSide:e})}get defaultPosition(){const e=this.snapshot.organDimensions;return{x:e.x+2*this.snapshot.blockSize.x,y:e.y/2,z:e.z/2}}setOrgan(e){this.ga.event("organ_select","organ",e.name),this.ctx.patchState({organ:e}),e.side&&this.ctx.patchState({side:e.side}),this.onOrganIriChange()}setSex(e){this.ctx.patchState({sex:e}),this.onOrganIriChange()}setSide(e){this.ctx.patchState({side:e}),this.onOrganIriChange()}setShowPrevious(e){this.ctx.patchState({showPrevious:e})}setExtractionSites(e){this.ctx.patchState({extractionSites:e})}setAnatomicalStructures(e){this.ctx.patchState({anatomicalStructures:e})}setExtractionSets(e){this.ctx.patchState({extractionSets:e})}toggleRegistrationBlocksVisibility(e,t){if(this.setShowPrevious(e),e){const i=t.map(r=>{var s;return Object.assign(Object.assign({},r),{opacity:Math.min(20,null!==(s=r.opacity)&&void 0!==s?s:20)})});this.setAnatomicalStructures(i)}else this.setAnatomicalStructures(t)}onOrganIriChange(){var e,t,i,r,s;const o=this.referenceData.getReferenceOrganIri((null===(e=this.snapshot.organ)||void 0===e?void 0:e.organ)||"",this.snapshot.sex,this.snapshot.side,this.snapshot.organ),a={x:100,y:100,z:100};if((null===(t=this.snapshot.organ)||void 0===t?void 0:t.sex)&&this.ctx.patchState({sex:null===(i=this.snapshot.organ)||void 0===i?void 0:i.sex}),o){const l=this.referenceData.snapshot,c={};for(const p of l.anatomicalStructures[o]||[]){const g=null!==(r=p.representation_of)&&void 0!==r?r:p["@id"];c[g]||(c[g]={id:null!==(s=p.representation_of)&&void 0!==s?s:p["@id"],name:p.label,visible:!0,opacity:20,tooltip:p.comment})}this.ctx.patchState({anatomicalStructures:Object.values(c)});const d=(l.extractionSets[o]||[]).map(p=>({name:p.label,sites:(0,uRe.sortBy)(p.extractionSites.map(g=>({id:g["@id"],name:g.label,visible:!1,opacity:0,tooltip:g.comment})),"name")}));this.ctx.patchState({extractionSets:d}),this.ctx.patchState({extractionSites:d.length>0?d[0].sites:[]});const f=l.organSpatialEntities[o];a.x=f.x_dimension,a.y=f.y_dimension,a.z=f.z_dimension}this.ctx.patchState({organIri:o,organDimensions:a}),this.ctx.patchState({position:this.defaultPosition})}};ai.\u0275fac=function(e){return new(e||ai)(I(xs),I(Nt),I(Ah))},ai.\u0275prov=ue({token:ai,factory:ai.\u0275fac}),xe([oi()],ai.prototype,"modelChanged$",null),xe([on()],ai.prototype,"setBlockSize",null),xe([on()],ai.prototype,"setRotation",null),xe([on()],ai.prototype,"setPosition",null),xe([on()],ai.prototype,"setSlicesConfig",null),xe([on()],ai.prototype,"setViewType",null),xe([on()],ai.prototype,"setViewSide",null),xe([oi()],ai.prototype,"defaultPosition",null),xe([on()],ai.prototype,"setOrgan",null),xe([on()],ai.prototype,"setSex",null),xe([on()],ai.prototype,"setSide",null),xe([on()],ai.prototype,"setShowPrevious",null),xe([on()],ai.prototype,"setExtractionSites",null),xe([on()],ai.prototype,"setAnatomicalStructures",null),xe([on()],ai.prototype,"setExtractionSets",null),ai=xe([xh(),cd({name:"model",defaults:{id:"",label:"",organ:{src:"",name:""},organIri:"",organDimensions:{x:90,y:90,z:90},sex:"male",side:"left",blockSize:{x:10,y:10,z:10},rotation:{x:0,y:0,z:0},position:{x:0,y:0,z:0},slicesConfig:{thickness:NaN,numSlices:NaN},viewType:"register",viewSide:"anterior",showPrevious:!1,extractionSites:[],anatomicalStructures:[],extractionSets:[]}})],ai);const T9=new ve("Default theme class");let YF=(()=>{class n{constructor(t){this.defaultTheme=this.theme=null!=t?t:""}static initialize(t){const{injector:i,location:r}=t;i.get(n).initialize(r,i)}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,i){this.element=t,this.injector=i,this.applyThemeClass(this.getTheme())}applyThemeClass(t,i="add"){var r;const{element:s,injector:o}=this;if(!t||!s||!o)return;const a=o.get(zc,null);if(!a)return;const l=s.nativeElement,c=null===(r=o.get(hm,null))||void 0===r?void 0:r.getContainerElement(),d="add"===i?"addClass":"removeClass";a[d](l,t),c&&a[d](c,t)}}return n.\u0275fac=function(t){return new(t||n)(I(T9,8))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})(),CRe=(()=>{class n{constructor(t){this.ga=t,this.clsName="ccf-name-input",this.firstNameValidator=new Sh("",[lG.required]),this.lastNameValidator=new Sh("",[lG.required]),this._name={firstName:"",lastName:""},this.nameChange=new Le}get name(){return this._name}set name(t){this._name=t,this.firstNameValidator.setValue((null==t?void 0:t.firstName)||""),this.lastNameValidator.setValue((null==t?void 0:t.lastName)||"")}updateName(t,i){const r=t.target;this.name=Object.assign(Object.assign({},this.name),{[i]:r.value}),this.ga.event("name_updated","name_input",i),this.nameChange.emit(this.name)}}return n.\u0275fac=function(t){return new(t||n)(E(xs))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-name-input"]],hostVars:2,hostBindings:function(t,i){2&t&&Rn(i.clsName)},inputs:{name:"name"},outputs:{nameChange:"nameChange"},decls:8,vars:2,consts:[[1,"field"],[1,"text","label"],["matInput","","matTooltip","Add your first name.",1,"input",3,"value","input"],["matInput","","matTooltip","Add your last name.",1,"input",3,"value","input"]],template:function(t,i){1&t&&(R(0,"mat-form-field",0),R(1,"mat-label",1),De(2,"First Name "),k(),R(3,"input",2),ge("input",function(s){return i.updateName(s,"firstName")}),k(),k(),R(4,"mat-form-field",0),R(5,"mat-label",1),De(6,"Last Name "),k(),R(7,"input",3),ge("input",function(s){return i.updateName(s,"lastName")}),k(),k()),2&t&&(G(3),ie("value",i.firstNameValidator.value),G(4),ie("value",i.lastNameValidator.value))},directives:[am,Gf,Xb,dc],styles:["[_nghost-%COMP%]{display:flex}[_nghost-%COMP%] .field[_ngcontent-%COMP%]:not(:last-child){padding-right:.75rem}[_nghost-%COMP%] .field[_ngcontent-%COMP%] .input[_ngcontent-%COMP%]{text-align:left;width:100%}"],changeDetection:0}),n})();const wRe=["thumbContainer"],ERe=["toggleBar"],SRe=["input"],MRe=function(n){return{enterDuration:n}},xRe=["*"],TRe=new ve("mat-slide-toggle-default-options",{providedIn:"root",factory:()=>({disableToggleValue:!1})});let ARe=0;const DRe={provide:ro,useExisting:T(()=>A9),multi:!0};class ORe{constructor(e,t){this.source=e,this.checked=t}}const IRe=Hf(Uf(nc(jf(class{constructor(n){this._elementRef=n}}))));let A9=(()=>{class n extends IRe{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-"+ ++ARe,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 Le,this.toggleChange=new Le,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=Mt(t)}get checked(){return this._checked}set checked(t){this._checked=Mt(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 ORe(this,this.checked))}_onLabelTextChange(){this._changeDetectorRef.detectChanges()}}return n.\u0275fac=function(t){return new(t||n)(E(rt),E(Sa),E(kn),Zr("tabindex"),E(TRe),E(Do,8))},n.\u0275cmp=Ne({type:n,selectors:[["mat-slide-toggle"]],viewQuery:function(t,i){if(1&t&&(Jn(wRe,5),Jn(ERe,5),Jn(SRe,5)),2&t){let r;_t(r=yt())&&(i._thumbEl=r.first),_t(r=yt())&&(i._thumbBarEl=r.first),_t(r=yt())&&(i._inputElement=r.first)}},hostAttrs:[1,"mat-slide-toggle"],hostVars:12,hostBindings:function(t,i){2&t&&(al("id",i.id),nn("tabindex",i.disabled?null:-1)("aria-label",null)("aria-labelledby",null),st("mat-checked",i.checked)("mat-disabled",i.disabled)("mat-slide-toggle-label-before","before"==i.labelPosition)("_mat-animation-noopable",i._noopAnimations))},inputs:{disabled:"disabled",disableRipple:"disableRipple",color:"color",tabIndex:"tabIndex",name:"name",id:"id",labelPosition:"labelPosition",ariaLabel:["aria-label","ariaLabel"],ariaLabelledby:["aria-labelledby","ariaLabelledby"],required:"required",checked:"checked",ariaDescribedby:["aria-describedby","ariaDescribedby"]},outputs:{change:"change",toggleChange:"toggleChange"},exportAs:["matSlideToggle"],features:[Dt([DRe]),ct],ngContentSelectors:xRe,decls:16,vars:20,consts:[[1,"mat-slide-toggle-label"],["label",""],[1,"mat-slide-toggle-bar"],["toggleBar",""],["type","checkbox","role","switch",1,"mat-slide-toggle-input","cdk-visually-hidden",3,"id","required","tabIndex","checked","disabled","change","click"],["input",""],[1,"mat-slide-toggle-thumb-container"],["thumbContainer",""],[1,"mat-slide-toggle-thumb"],["mat-ripple","",1,"mat-slide-toggle-ripple","mat-focus-indicator",3,"matRippleTrigger","matRippleDisabled","matRippleCentered","matRippleRadius","matRippleAnimation"],[1,"mat-ripple-element","mat-slide-toggle-persistent-ripple"],[1,"mat-slide-toggle-content",3,"cdkObserveContent"],["labelContent",""],[2,"display","none"]],template:function(t,i){if(1&t&&(wi(),R(0,"label",0,1),R(2,"div",2,3),R(4,"input",4,5),ge("change",function(s){return i._onChangeEvent(s)})("click",function(s){return i._onInputClick(s)}),k(),R(6,"div",6,7),tt(8,"div",8),R(9,"div",9),tt(10,"div",10),k(),k(),k(),R(11,"span",11,12),ge("cdkObserveContent",function(){return i._onLabelTextChange()}),R(13,"span",13),De(14,"\xa0"),k(),Ht(15),k(),k()),2&t){const r=vs(1),s=vs(12);nn("for",i.inputId),G(2),st("mat-slide-toggle-bar-no-side-margin",!s.textContent||!s.textContent.trim()),G(2),ie("id",i.inputId)("required",i.required)("tabIndex",i.tabIndex)("checked",i.checked)("disabled",i.disabled),nn("name",i.name)("aria-checked",i.checked.toString())("aria-label",i.ariaLabel)("aria-labelledby",i.ariaLabelledby)("aria-describedby",i.ariaDescribedby),G(5),ie("matRippleTrigger",r)("matRippleDisabled",i.disableRipple||i.disabled)("matRippleCentered",!0)("matRippleRadius",20)("matRippleAnimation",Hg(18,MRe,i._noopAnimations?0:150))}},directives:[Js,WD],styles:[".mat-slide-toggle{display:inline-block;height:24px;max-width:100%;line-height:24px;white-space:nowrap;outline:none;-webkit-tap-highlight-color:transparent}.mat-slide-toggle.mat-checked .mat-slide-toggle-thumb-container{transform:translate3d(16px, 0, 0)}[dir=rtl] .mat-slide-toggle.mat-checked .mat-slide-toggle-thumb-container{transform:translate3d(-16px, 0, 0)}.mat-slide-toggle.mat-disabled{opacity:.38}.mat-slide-toggle.mat-disabled .mat-slide-toggle-label,.mat-slide-toggle.mat-disabled .mat-slide-toggle-thumb-container{cursor:default}.mat-slide-toggle-label{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:flex;flex:1;flex-direction:row;align-items:center;height:inherit;cursor:pointer}.mat-slide-toggle-content{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mat-slide-toggle-label-before .mat-slide-toggle-label{order:1}.mat-slide-toggle-label-before .mat-slide-toggle-bar{order:2}[dir=rtl] .mat-slide-toggle-label-before .mat-slide-toggle-bar,.mat-slide-toggle-bar{margin-right:8px;margin-left:0}[dir=rtl] .mat-slide-toggle-bar,.mat-slide-toggle-label-before .mat-slide-toggle-bar{margin-left:8px;margin-right:0}.mat-slide-toggle-bar-no-side-margin{margin-left:0;margin-right:0}.mat-slide-toggle-thumb-container{position:absolute;z-index:1;width:20px;height:20px;top:-3px;left:0;transform:translate3d(0, 0, 0);transition:all 80ms linear;transition-property:transform}._mat-animation-noopable .mat-slide-toggle-thumb-container{transition:none}[dir=rtl] .mat-slide-toggle-thumb-container{left:auto;right:0}.mat-slide-toggle-thumb{height:20px;width:20px;border-radius:50%}.mat-slide-toggle-bar{position:relative;width:36px;height:14px;flex-shrink:0;border-radius:8px}.mat-slide-toggle-input{bottom:0;left:10px}[dir=rtl] .mat-slide-toggle-input{left:auto;right:10px}.mat-slide-toggle-bar,.mat-slide-toggle-thumb{transition:all 80ms linear;transition-property:background-color;transition-delay:50ms}._mat-animation-noopable .mat-slide-toggle-bar,._mat-animation-noopable .mat-slide-toggle-thumb{transition:none}.mat-slide-toggle .mat-slide-toggle-ripple{position:absolute;top:calc(50% - 20px);left:calc(50% - 20px);height:40px;width:40px;z-index:1;pointer-events:none}.mat-slide-toggle .mat-slide-toggle-ripple .mat-ripple-element:not(.mat-slide-toggle-persistent-ripple){opacity:.12}.mat-slide-toggle-persistent-ripple{width:100%;height:100%;transform:none}.mat-slide-toggle-bar:hover .mat-slide-toggle-persistent-ripple{opacity:.04}.mat-slide-toggle:not(.mat-disabled).cdk-keyboard-focused .mat-slide-toggle-persistent-ripple{opacity:.12}.mat-slide-toggle-persistent-ripple,.mat-slide-toggle.mat-disabled .mat-slide-toggle-bar:hover .mat-slide-toggle-persistent-ripple{opacity:0}@media(hover: none){.mat-slide-toggle-bar:hover .mat-slide-toggle-persistent-ripple{display:none}}.cdk-high-contrast-active .mat-slide-toggle-thumb,.cdk-high-contrast-active .mat-slide-toggle-bar{border:1px solid}.cdk-high-contrast-active .mat-slide-toggle.cdk-keyboard-focused .mat-slide-toggle-bar{outline:2px dotted;outline-offset:5px}\n"],encapsulation:2,changeDetection:0}),n})(),D9=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({}),n})(),O9=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[D9,_l,On,SE],D9,On]}),n})(),XF=(()=>{class n{constructor(t){this.ga=t,this.clsName="ccf-labeled-slide-toggle",this.labels=["Left","Right"],this.value="Left",this.disabled=!1,this.valueChange=new Le}get left(){const{value:t,labels:i}=this;return t!==i[1]}updateToggle(t){this.value=t?this.labels[0]:this.labels[1],this.ga.event("slide_toggle_toggled","slide_toggle",this.value),this.valueChange.emit(this.value)}}return n.\u0275fac=function(t){return new(t||n)(E(xs))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-labeled-slide-toggle"]],hostVars:2,hostBindings:function(t,i){2&t&&Rn(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=Zi();R(0,"span",0),ge("click",function(){en(r);const o=vs(3);return i.left||o.toggle(),i.updateToggle(!0)}),De(1),k(),R(2,"mat-slide-toggle",1,2),ge("change",function(o){return i.updateToggle(!o.checked)}),k(),R(4,"span",0),ge("click",function(){en(r);const o=vs(3);return i.left&&o.toggle(),i.updateToggle(!1)}),De(5),k()}2&t&&(st("disabled",i.disabled)("highlighted",i.left),G(1),xi(i.labels[0]),G(1),ie("disabled",i.disabled)("checked",!i.left),G(2),st("disabled",i.disabled)("highlighted",!i.left),G(1),xi(i.labels[1]))},directives:[A9],styles:["[_nghost-%COMP%] .slide-label[_ngcontent-%COMP%]{margin:0 1rem;transition:color .6s;cursor:pointer}[_nghost-%COMP%] .disabled[_ngcontent-%COMP%]{opacity:30%;cursor:not-allowed}"],changeDetection:0}),n})();const kRe=function(){return["Male","Female"]},FRe=function(n){return[n]};let NRe=(()=>{class n{constructor(t,i,r){this.page=t,this.model=i,this.dialogRef=r,this.clsName="ccf-registration-content",this.sexByLabel$=this.model.sex$.pipe(Ae(s=>"female"===s?"Female":"Male")),this.organList=qF,r.disableClose=!0}setSexFromLabel(t){this.currentSex=t,this.sexSelected=!0}checkNameValid(t){this.nameValid=t.firstName.length>0&&t.lastName.length>0}organSelect(t){this.currentOrgan=t,this.organSelected=!0}registerButtonClick(t){t&&t.preventDefault(),this.organSelected&&this.nameValid&&this.closeDialog()}closeDialog(){this.model.setSex("Female"===this.currentSex?"female":"male"),this.model.setOrgan(this.currentOrgan),this.dialogRef.close(!0),this.page.registrationStarted()}}return n.\u0275fac=function(t){return new(t||n)(E(ji),E(ai),E(Qm))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-registration-content"]],hostVars:2,hostBindings:function(t,i){2&t&&Rn(i.clsName)},decls:17,vars:18,consts:[[1,"modal"],["mat-dialog-content",""],[3,"name","nameChange"],["matTooltip","Select sex to filter organs.",1,"organ-sliders"],[1,"slider-label"],[1,"toggle","gender",3,"labels","value","valueChange"],[1,"selector-label"],[1,"selector-container"],[3,"organList","selectedOrgans","expanded","organsChanged"],["organSelector",""],["mat-button","",1,"registration-button",3,"matTooltip","click"]],template:function(t,i){1&t&&(R(0,"div",0),R(1,"div",1),R(2,"ccf-name-input",2),ge("nameChange",function(s){return i.page.setUserName(s),i.checkNameValid(s)}),Kt(3,"async"),k(),R(4,"div",3),R(5,"div",4),De(6,"Donor Sex:"),k(),R(7,"ccf-labeled-slide-toggle",5),ge("valueChange",function(s){return i.setSexFromLabel(s)}),Kt(8,"async"),k(),k(),R(9,"div",6),De(10,"Select an organ"),k(),R(11,"div",7),R(12,"ccf-organ-selector",8,9),ge("organsChanged",function(s){return i.organSelect(s[0])}),Kt(14,"async"),k(),k(),k(),R(15,"button",10),ge("click",function(s){return i.registerButtonClick(s)}),De(16,"START REGISTRATION"),k(),k()),2&t&&(G(2),ie("name",rn(3,9,i.page.user$)),G(5),ie("labels",fv(15,kRe))("value",rn(8,11,i.sexByLabel$)),G(5),ie("organList",i.organList)("selectedOrgans",Hg(16,FRe,rn(14,13,i.model.organ$)))("expanded",!0),G(3),st("disabled",!i.organSelected||!i.nameValid),ie("matTooltip",i.organSelected&&i.nameValid?"":"Required: Enter first and last name, and select an organ"))},directives:[CRe,dc,XF,p9,lh],pipes:[Hc],styles:[".modal[_ngcontent-%COMP%]{padding:1rem;border-radius:4px;max-width:47rem}.modal[_ngcontent-%COMP%] .organ-sliders[_ngcontent-%COMP%]{display:flex;height:3rem;align-items:center}.modal[_ngcontent-%COMP%] .organ-sliders[_ngcontent-%COMP%] .slider-label[_ngcontent-%COMP%]{font-weight:600}.modal[_ngcontent-%COMP%] .selector-label[_ngcontent-%COMP%]{font-weight:600;height:3rem;line-height:3rem}.modal[_ngcontent-%COMP%] .selector-container[_ngcontent-%COMP%]{margin:0 auto}.modal[_ngcontent-%COMP%] .registration-button[_ngcontent-%COMP%]{display:block;margin:2rem auto 0;transition:.6s}.modal[_ngcontent-%COMP%] .registration-button.disabled[_ngcontent-%COMP%]{pointer-events:none}"],changeDetection:0}),n})(),LRe=(()=>{class n{constructor(t,i,r){this.dialog=t,this.page=i,this.model=r,this.clsName="ccf-registration-modal"}ngOnInit(){Qi([this.page.user$,this.model.organ$]).pipe(Zg(500),yi(1),Ti(([t,i])=>{""!==t.firstName&&""!==t.lastName&&""!==i.src||this.openDialog()})).subscribe()}openDialog(){this.dialog.open(NRe,{autoFocus:!1})}}return n.\u0275fac=function(t){return new(t||n)(E(_p),E(ji),E(ai))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-registration-modal"]],hostVars:2,hostBindings:function(t,i){2&t&&Rn(i.clsName)},decls:0,vars:0,template:function(t,i){},encapsulation:2}),n})();function BRe(n,e){1&n&&function(n,e,t){_f(n,e,t),yf()}(0)}function VRe(n,e){if(1&n){const t=Zi();R(0,"div",4),ge("click",function(){return en(t),Qe().page.cancelRegistration()}),R(1,"mat-icon",5),De(2,"chevron_left"),k(),R(3,"span",6),De(4,"BACK"),k(),k()}}function zRe(n,e){if(1&n&&(R(0,"a",7),tt(1,"div",8),k()),2&n){const t=Qe();ie("href",t.homeUrl,Ud)("matTooltip",t.logoTooltip)}}let jRe=(()=>{class n{constructor(t){this.page=t,this.clsName="ccf-header"}}return n.\u0275fac=function(t){return new(t||n)(E(ji))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-header"]],hostVars:2,hostBindings:function(t,i){2&t&&Rn(i.clsName)},inputs:{homeUrl:"homeUrl",logoTooltip:"logoTooltip"},decls:7,vars:5,consts:[[4,"ngIf","ngIfThen","ngIfElse"],["backButton",""],["logo",""],[1,"filler"],["rel","noreferrer noopener",1,"link","home",3,"click"],[1,"icon","backbutton"],[1,"text"],["rel","noreferrer noopener","matTooltipPosition","right",1,"link","portal",3,"href","matTooltip"],["aria-hidden","false","aria-label","Reset tool",1,"logo"]],template:function(t,i){if(1&t&&(mt(0,BRe,1,0,"ng-container",0),Kt(1,"async"),mt(2,VRe,5,0,"ng-template",null,1,jw),mt(4,zRe,2,2,"ng-template",null,2,jw),tt(6,"div",3)),2&t){const r=vs(3),s=vs(5);ie("ngIf",rn(1,3,i.page.useCancelRegistrationCallback$))("ngIfThen",r)("ngIfElse",s)}},directives:[zr,rs,dc],pipes:[Hc],styles:["[_nghost-%COMP%]{display:flex;align-items:center;min-height:4rem;padding:0 1.5rem;border-bottom-width:1px;border-bottom-style:solid}[_nghost-%COMP%] .text[_ngcontent-%COMP%]{padding:.25rem 0;height:2rem;display:flex;align-items:center;font-weight:lighter;font-size:1.5rem}[_nghost-%COMP%] .link[_ngcontent-%COMP%]{display:flex;align-items:center;cursor:pointer;text-decoration:none;padding:.25rem 0}[_nghost-%COMP%] .home[_ngcontent-%COMP%] *[_ngcontent-%COMP%]{transition:color .6s}[_nghost-%COMP%] .home[_ngcontent-%COMP%] .backbutton[_ngcontent-%COMP%]{font-size:2.25rem;width:2.25rem;height:2.25rem}[_nghost-%COMP%] .portal[_ngcontent-%COMP%]{height:100%;width:25rem;align-items:center;display:flex}[_nghost-%COMP%] .logo[_ngcontent-%COMP%]{width:100%;height:50%;background-repeat:no-repeat;background-size:contain}[_nghost-%COMP%] .filler[_ngcontent-%COMP%]{flex-grow:1;margin:0}"],changeDetection:0}),n})();const I9={isolated:!0},P9=new ve("Message service configuration",{providedIn:"root",factory:()=>I9});let URe=(()=>{class n{constructor(t,i,r){this.source=t,this.channel=i,this.messages=r}sendMessage(t){this.channel.next({id:this.nextMessageId(),source:this.source,payload:t})}getMessages(){return this.messages.pipe(Fn(t=>t.source!==this.source))}getMessagesFromSource(t){return this.getMessages().pipe(Fn(i=>i.source===t))}getMessagesFromSources(t){return this.getMessages().pipe(Fn(i=>t.includes(i.source)))}nextMessageId(){return n.counter++}}return n.counter=0,n})();const _0=(()=>{class n{constructor(t,i){this.config=t,this.parent=i,this.channel=new Se,this.messages=t.isolated||!i?this.channel.asObservable():ui([this.channel,i.messages.pipe(qj(()=>!this.channel.closed))]).pipe(uo())}ngOnDestroy(){this.channel.complete()}connect(t){return new URe(t,this.channel,this.messages)}}return n.\u0275fac=function(t){return new(t||n)(I(P9),I(n,12))},n.\u0275prov=ue({token:n,factory:n.\u0275fac,providedIn:"root"}),n})(),HRe=["*"];let bx=(()=>{class n{constructor(t,i){this.className="ccf-drawer-content",this.animationsEnabled=!1,this.leftMargin=0,this.rightMargin=0,this.faded=!1,this.drawers=[],this.subscriptions=new Te;const r=t.connect(this).getMessages();this.subscriptions.add(r.subscribe(s=>{this.handleMessage(s)&&i.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 i=t.source.position,{opened:r,width:s,margin:o}=t.payload;return this.updateMargin(i,r,s,o),this.updateFaded(),!0}default:return!1}}updateMargin(t,i,r,s){const o=i?r+s:s;"start"===t?this.leftMargin=o:this.rightMargin=o}updateFaded(){const[t,i]=this.drawers;this.faded=!!((null==t?void 0:t.opened)&&(null==t?void 0:t.expanded)||(null==i?void 0:i.opened)&&(null==i?void 0:i.expanded))}}return n.\u0275fac=function(t){return new(t||n)(E(_0),E(kn))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-drawer-content"]],hostVars:9,hostBindings:function(t,i){2&t&&(Pg("@fadeInOut",i.faded),Rn(i.className),vf("margin-left",i.leftMargin,"px")("margin-right",i.rightMargin,"px"),st("cff-drawer-content-animations",i.animationsEnabled))},ngContentSelectors:HRe,decls:1,vars:0,template:function(t,i){1&t&&(wi(),Ht(0))},styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;height:100%;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:[tc("fadeInOut",[wr("false",ti({opacity:1})),wr("true",ti({opacity:0})),Qs("false <=> true",Ao("1s"))])]},changeDetection:0}),n})();const $Re=["*"],KF={params:{width:0,margin:0,margin2:0}};class GRe{constructor(){this.initialized=!1,this.deferred=new Promise(e=>{this.resolve=e})}set(){this.initialized=!0,this.resolve()}wait(){return yl(this,void 0,void 0,function*(){return this.deferred})}valueOf(){return this.initialized}}let ZF=(()=>{class n{constructor(t,i,r){this.element=r,this.className="ccf-drawer",this._position="start",this._opened=!1,this._expanded=!1,this.openedChange=new Le(!0),this.expandedChange=new Le(!0),this.stateChange=new Le(!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 GRe,this.subscriptions=new Te,this.channel=t.connect(this),this.subscriptions.add(this.channel.getMessages().subscribe(s=>{this.handleMessage(s)&&i.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(Mt(t))}get expanded(){return this._expanded}set expanded(t){this.toggleExpanded(Mt(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 i=t.getBoundingClientRect(),r=i.right-i.left;return 0===r?0:(this._measuredWidth=r,r)}get measuredMargin(){if(this._measuredMargin>0)return this._measuredMargin;const t=this.element.nativeElement;if(!t)return 0;const s=globalThis.getComputedStyle(t).getPropertyValue("start"===this.position?"margin-right":"margin-left"),o=Number(s.slice(0,-2));return this._measuredMargin=o,o}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 yl(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 n.\u0275fac=function(t){return new(t||n)(E(_0),E(kn),E(rt))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-drawer"]],hostVars:10,hostBindings:function(t,i){1&t&&Qy("@openClose.done",function(){return i.closeOpenDone()})("@expandCollapse.done",function(){return i.expandCollapseDone()}),2&t&&(Pg("@openClose",i.openedState)("@expandCollapse",i.expandedStateObj),Rn(i.className),st("ccf-drawer-end",i.classEnd)("ccf-drawer-opened",i.opened)("ccf-drawer-expanded",i.expanded))},inputs:{position:"position",opened:"opened",expanded:"expanded"},outputs:{openedChange:"openedChange",expandedChange:"expandedChange",stateChange:"stateChange"},exportAs:["ccfDrawer"],ngContentSelectors:$Re,decls:2,vars:0,consts:[[1,"cff-drawer-inner-container"]],template:function(t,i){1&t&&(wi(),R(0,"div",0),Ht(1),k())},styles:["[_nghost-%COMP%]{display:block;position:absolute;top:0;bottom:0;z-index:2;outline:0;transform:translate(-100%)}.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:[tc("openClose",[wr("open, open-instant",ti({transform:"none"})),wr("closed",ti({})),Qs("closed => open-instant",Ao(0)),Qs("closed <=> open, open-instant => closed",Ao(".5s ease-in-out"))]),tc("expandCollapse",[wr("collapsed",ti({})),wr("half",ti({width:"calc(50% - {{ margin }}px)"}),KF),wr("extended",ti({width:"calc(100% - {{ width }}px - {{ margin }}px)"}),KF),wr("full",ti({width:"calc(100% - {{ margin }}px - {{ margin2 }}px)"}),KF),Qs("* <=> *",Ao(".5s ease-in-out"))])]},changeDetection:0}),n})();function WRe(n,e){1&n&&(R(0,"ccf-drawer-content"),Ht(1,2),k())}const qRe=[[["ccf-drawer"]],[["ccf-drawer-content"]],"*"],YRe=["ccf-drawer","ccf-drawer-content","*"];function R9(n){throw new Error(`Multiple drawers in position ${n}`)}let XRe=(()=>{class n{constructor(t,i){this.cdr=i,this.className="ccf-drawer-container",this.subscriptions=new Te,this.channel=t.connect(this),this.subscriptions.add(this.channel.getMessages().subscribe(r=>{this.handleMessage(r)&&i.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(Rr(null)).subscribe(()=>{const t=this.validateDrawers();this.channel.sendMessage({type:"drawer-containers-changed",drawers:t}),this.cdr.markForCheck()}),this.content1.changes.pipe(Rr(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(),i=t.filter(s=>"start"===s.position),r=t.filter(s=>"end"===s.position);return i.length>1&&R9("start"),r.length>1&&R9("end"),[i[0],r[0]]}}return n.\u0275fac=function(t){return new(t||n)(E(_0),E(kn))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-drawer-container"]],contentQueries:function(t,i,r){if(1&t&&(ei(r,ZF,5),ei(r,bx,5)),2&t){let s;_t(s=yt())&&(i.drawers=s),_t(s=yt())&&(i.content1=s)}},viewQuery:function(t,i){if(1&t&&Jn(bx,5),2&t){let r;_t(r=yt())&&(i.content2=r)}},hostVars:2,hostBindings:function(t,i){2&t&&Rn(i.className)},exportAs:["ccfDrawerContainer"],features:[Dt([_0])],ngContentSelectors:YRe,decls:3,vars:1,consts:[[4,"ngIf"]],template:function(t,i){1&t&&(wi(qRe),Ht(0),Ht(1,1),mt(2,WRe,2,0,"ccf-drawer-content",0)),2&t&&(G(2),ie("ngIf",!i.hasWrappedContent))},directives:[zr,bx],styles:["[_nghost-%COMP%]{display:block;position:relative;z-index:1;overflow:hidden;-webkit-overflow-scrolling:touch}"],changeDetection:0}),n})();var Cx,KRe=ze(457),ZRe=new Uint8Array(16);function QRe(){if(!Cx&&!(Cx="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Cx(ZRe)}const JRe=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,tke=function(n){return"string"==typeof n&&JRe.test(n)};for(var Ls=[],QF=0;QF<256;++QF)Ls.push((QF+256).toString(16).substr(1));const ske=function(n,e,t){var i=(n=n||{}).random||(n.rng||QRe)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,e){t=t||0;for(var r=0;r<16;++r)e[t+r]=i[r];return e}return function(n){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,t=(Ls[n[e+0]]+Ls[n[e+1]]+Ls[n[e+2]]+Ls[n[e+3]]+"-"+Ls[n[e+4]]+Ls[n[e+5]]+"-"+Ls[n[e+6]]+Ls[n[e+7]]+"-"+Ls[n[e+8]]+Ls[n[e+9]]+"-"+Ls[n[e+10]]+Ls[n[e+11]]+Ls[n[e+12]]+Ls[n[e+13]]+Ls[n[e+14]]+Ls[n[e+15]]).toLowerCase();if(!tke(t))throw TypeError("Stringified UUID is invalid");return t}(i)};function k9(n){const e=new $t(n.transformMatrix),t=e.transformAsPoint([-1,-1,-1],[]),i=e.transformAsPoint([1,1,1],[]);return new Di({lowerBound:new S(...t.map((r,s)=>Math.min(r,i[s]))),upperBound:new S(...i.map((r,s)=>Math.max(r,t[s])))})}let as=class extends Jm{constructor(e){super(),this.injector=e,this.gizmo$=ht([{"@id":"http://purl.org/ccf/latest/ccf.owl#VHMaleOrgans_VHM_Spleen_Colic_Surface","@type":"SpatialSceneNode",scenegraph:"https://hubmapconsortium.github.io/ccf-3d-reference-object-library/Assets/body4Mesh_1338.glb",transformMatrix:new $t($t.IDENTITY).scale([2,2,2]).rotateY(ib(0)),tooltip:"Gizmo",unpickable:!0,_lighting:"pbr",zoomBasedOpacity:!1,color:[255,255,255,255],opacity:1}])}get nodes$(){return Qi([this.placementCube$,this.referenceOrganNodes$,this.previousRegistrationNodes$,this.nodeCollisions$]).pipe(Ae(([e,t,i,r])=>[...e,...i,...t,...this.snapshot.showCollisions?r:[]]))}get rotatedNodes$(){return Qi([this.rotation$,this.nodes$]).pipe(Ae(([e,t])=>0===e?t:t.map(i=>Object.assign(Object.assign({},i),{transformMatrix:new $t($t.IDENTITY).rotateY(ib(e)).multiplyRight(i.transformMatrix)}))))}get referenceOrganNodes$(){return Qi([this.model.anatomicalStructures$,this.model.extractionSites$,this.model.organIri$]).pipe(Zg(400),Ae(([e,t,i])=>this.createSceneNodes(i,[...e,...t])))}get referenceOrganSimpleNodes$(){return Qi([this.model.anatomicalStructures$,this.model.organIri$,this.referenceData.state$]).pipe(Ae(([e,t,i])=>e.map(r=>{var s;return i.sceneNodeLookup[r.id]?[Object.assign(Object.assign({},i.simpleSceneNodeLookup[r.id]),{opacity:(null!==(s=r.opacity)&&void 0!==s?s:100)/100,color:[255,255,255,255]})]:(i.anatomicalStructures[t]||[]).filter(o=>o.representation_of===r.id).map(o=>{var a;return Object.assign(Object.assign({},i.simpleSceneNodeLookup[o["@id"]]),{opacity:(null!==(a=r.opacity)&&void 0!==a?a:100)/100,color:[255,255,255,255]})})}).reduce((r,s)=>r.concat(s),[])))}get nodeCollisions$(){return Qi([this.referenceOrganSimpleNodes$,this.placementCube$]).pipe(Fn(([e,t])=>t.length>0),Ae(([e,t])=>{const i=k9(t[0]);return e.filter(r=>i.overlaps(k9(r)))}))}get previousRegistrationNodes$(){return Qi([this.model.organIri$,this.model.showPrevious$,this.registration.previousRegistrations$]).pipe(Ae(([e,t,i])=>t?i.map(r=>{const s=Array.isArray(r.placement)?r.placement[0]:r.placement;if(s.target===e){const o=this.model.snapshot.organDimensions,a=[o.x,o.y,o.z].map(l=>-l/1e3/2);return{"@id":r["@id"],"@type":"SpatialSceneNode",transformMatrix:new $t($t.IDENTITY).translate([s.x_translation,s.y_translation,s.z_translation].map((l,c)=>l/1e3+a[c])).rotateXYZ([s.x_rotation,s.y_rotation,s.z_rotation].map(ib)).scale([r.x_dimension,r.y_dimension,r.z_dimension].map(l=>l/1e3/2)),color:[25,118,210,200],tooltip:r.label,unpickable:!0}}}).filter(r=>!!r):[]))}get placementCube$(){return Qi([this.model.viewType$,this.model.blockSize$,this.model.rotation$,this.model.position$,this.model.organ$]).pipe(Ae(([e,t,i,r,s])=>""===s.src?[]:[this.placementCube]))}get placementCube(){const{viewType:e,blockSize:t,rotation:i,position:r,organDimensions:s}=this.model.snapshot,o=[s.x,s.y,s.z].map(a=>-a/1e3/2);return{"@id":"#DraftPlacement","@type":"SpatialSceneNode",transformMatrix:new $t($t.IDENTITY).translate([r.x,r.y,r.z].map((a,l)=>a/1e3+o[l])).rotateXYZ([i.x,i.y,i.z].map(ib)).scale([t.x,t.y,t.z].map(a=>a/1e3/2)),color:[255,255,0,200],tooltip:"Draft Placement",unpickable:"3d"===e}}get rotation$(){return this.model.viewSide$.pipe(Ae(e=>{let t=0;switch(e){case"left":t=-90;break;case"right":t=90;break;case"posterior":t=180}return t}))}ngxsOnInit(){super.ngxsOnInit(),this.model=this.injector.get(ai),this.registration=this.injector.get(Sr),this.referenceData=this.injector.get(fc)}createSceneNodes(e,t){const i=this.referenceData.snapshot;return t.filter(r=>r.visible&&r.opacity&&r.opacity>0).map(r=>{var s;return i.sceneNodeLookup[r.id]?[Object.assign(Object.assign({},i.sceneNodeLookup[r.id]),{opacity:(null!==(s=r.opacity)&&void 0!==s?s:100)/100,color:[255,255,255,255]})]:(i.anatomicalStructures[e]||[]).filter(o=>o.representation_of===r.id).map(o=>{var a;return Object.assign(Object.assign({},i.sceneNodeLookup[o["@id"]]),{opacity:(null!==(a=r.opacity)&&void 0!==a?a:100)/100,color:[255,255,255,255]})})}).reduce((r,s)=>r.concat(s),[])}};as.\u0275fac=function(e){return new(e||as)(I(Nt))},as.\u0275prov=ue({token:as,factory:as.\u0275fac}),xe([oi()],as.prototype,"nodes$",null),xe([oi()],as.prototype,"rotatedNodes$",null),xe([oi()],as.prototype,"referenceOrganNodes$",null),xe([oi()],as.prototype,"referenceOrganSimpleNodes$",null),xe([oi()],as.prototype,"nodeCollisions$",null),xe([oi()],as.prototype,"previousRegistrationNodes$",null),xe([oi()],as.prototype,"placementCube$",null),xe([oi()],as.prototype,"placementCube",null),xe([oi()],as.prototype,"rotation$",null),as=xe([xh(),cd({name:"scene",defaults:{showCollisions:!hu.production}})],as);let ko=class extends uDe{constructor(e){super(),this.injector=e,this._latestTags=[]}get tags$(){return Qi([this.entities$,this.scene.nodeCollisions$]).pipe(Ae(([e,t])=>{const i=[],r=new Set,s=new Set;Object.entries(e).forEach(([o,a])=>{"removed"===a.type?s.add(o):(r.add(o),i.push(a))});for(const o of t){const a=o.representation_of;a&&!s.has(a)&&!r.has(a)&&(r.add(a),i.push({id:a,label:o.tooltip,type:"assigned"}))}return i}))}get latestTags(){return this._latestTags}ngxsOnInit(){super.ngxsOnInit(),this.model=this.injector.get(ai),this.scene=this.injector.get(as),this.page=this.injector.get(ji),this.tags$.subscribe(e=>{this._latestTags=e}),this.entities$.subscribe(()=>this.page.setHasChanges())}addTags(e){for(const t of e)this.addTagRaw(t)}addTag(e){this.addTagRaw(e)}removeTag(e){this.snapshot.entities[e.id]?this.updateEntitiesMany([{id:e.id,changes:{type:"removed"}}]):this.addEntityOne(Object.assign(Object.assign({},e),{type:"removed"}))}searchExternal(e,t){const i=this.model.snapshot.anatomicalStructures.filter(r=>-1!==r.name.toLowerCase().indexOf(e.toLowerCase()));return[{totalCount:i.length,results:i.map(r=>({id:r.id,label:r.name,type:"added"})).slice(0,t)}]}addTagRaw(e){this.snapshot.entities[e.id]?this.updateEntitiesMany([{id:e.id,changes:{type:"added"}}]):this.addEntityOne(Object.assign(Object.assign({},e),{type:"added"}))}};ko.\u0275fac=function(e){return new(e||ko)(I(Nt))},ko.\u0275prov=ue({token:ko,factory:ko.\u0275fac}),xe([oi()],ko.prototype,"tags$",null),xe([on()],ko.prototype,"addTags",null),xe([on()],ko.prototype,"addTag",null),xe([on()],ko.prototype,"removeTag",null),xe([lu.ak],ko.prototype,"searchExternal",null),ko=xe([xh(),cd({name:"tags",defaults:Object.assign({},{ids:[],entities:{}})})],ko);let Sr=class extends Jm{constructor(e,t){super(),this.injector=e,this.globalConfig=t,this.displayErrors$=this.state$.pipe(ur("displayErrors"))}get metadata$(){return Qi([this.page.state$,this.model.state$,this.tags.tags$]).pipe(Ae(([e,t,i])=>this.buildMetadata(e,t,i)))}get jsonld$(){return Qi([this.page.state$,this.model.state$,this.tags.tags$]).pipe(Ae(([e,t,i])=>this.buildJsonLd(e,t,i)))}get valid$(){return Qi([this.page.state$,this.model.state$]).pipe(Ae(()=>this.isValid))}get previousRegistrations$(){const{globalConfig:e,state$:t}=this;return Qi([t.pipe(ur("registrations")),e.getOption("fetchPreviousRegistrations").pipe(Pr(s=>{var o;return null!==(o=null==s?void 0:s())&&void 0!==o?o:[[]]}),Rr([]))]).pipe(Ae(([s,o])=>[...s,...o]))}get currentIdentifier(){return ske()}get currentDate(){return(new Date).toISOString().split("T")[0]}ngxsOnInit(){super.ngxsOnInit(),this.page=this.injector.get(ji),this.model=this.injector.get(ai),this.tags=this.injector.get(ko),this.refData=this.injector.get(fc),this.globalConfig.config$.pipe(yi(1),Ti(({useDownload:e,register:t})=>this.ctx.patchState({useRegistrationCallback:!(e||!t)}))).subscribe(),this.globalConfig.getOption("editRegistration").pipe(aF(),Ti(e=>this.editRegistration(e))).subscribe()}editRegistration(e){return yl(this,void 0,void 0,function*(){const t=this.refData.normalizePlacement(Array.isArray(e.placement)?e.placement[0]:e.placement),i=this.refData.getOrganData(t.target);this.page.setUserName({firstName:e.creator_first_name,lastName:e.creator_last_name}),i&&(this.model.setOrgan(i.organ),i.sex&&this.model.setSex(i.sex),i.side&&this.model.setSide(i.side)),this.model.setBlockSize({x:e.x_dimension,y:e.y_dimension,z:e.z_dimension}),this.model.setRotation({x:t.x_rotation,y:t.y_rotation,z:t.z_rotation}),this.model.setSlicesConfig({thickness:e.slice_thickness||NaN,numSlices:e.slice_count||NaN}),yield new Promise(s=>{setTimeout(s,1e3)}),this.model.setPosition({x:t.x_translation,y:t.y_translation,z:t.z_translation});const r=new Set(e.ccf_annotations);this.tags.addTags(this.model.snapshot.anatomicalStructures.filter(s=>r.has(s.id)).map(s=>({id:s.id,label:s.name,type:"added"}))),this.page.registrationStarted()})}setUseRegistrationCallback(e){this.ctx.patchState({useRegistrationCallback:e})}setDisplayErrors(e){this.ctx.patchState({displayErrors:e})}addRegistration(e){this.ctx.setState(m0({registrations:vRe(e)}))}isDataValid(e,t){return[e.user.firstName,e.user.lastName,t.organ.src,t.organ.name,t.organ.organ].every(r=>!!r)}get isValid(){return this.isDataValid(this.page.snapshot,this.model.snapshot)}register(e){if(!this.isValid)return;const{globalConfig:{snapshot:{register:t}},page:i,model:r,snapshot:s}=this,o=this.buildJsonLd(i.snapshot,r.snapshot,this.tags.latestTags),a=JSON.stringify(o,void 0,2);if(e||void 0===e&&s.useRegistrationCallback)null==t||t(a);else{const l=new Blob([a],{type:"application/json",endings:"native"});(0,KRe.saveAs)(l,"registration-data.json")}this.addRegistration(o),this.setDisplayErrors(!1),this.page.clearHasChanges()}buildMetadata(e,t,i){const r=[];return e.registrationCallbackSet||r.push({label:"First Name",value:e.user.firstName},{label:"Last Name",value:e.user.lastName}),r.push({label:"Reference Organ Name",value:t.organ.name},{label:"Tissue Block Dimensions (mm)",value:this.xyzTripletToString(t.blockSize)},{label:"Tissue Block Position (mm)",value:this.xyzTripletToString(t.position)},{label:"Tissue Block Rotation",value:this.xyzTripletToString(t.rotation)},{label:"Anatomical Structure Tags",value:i.map(s=>s.label).join(", ")},{label:"Time Stamp",value:this.currentDate},{label:"Alignment ID",value:this.currentIdentifier}),r}buildJsonLd(e,t,i){var r,s;return{"@context":"https://hubmapconsortium.github.io/ccf-ontology/ccf-context.jsonld","@id":`http://purl.org/ccf/1.5/${this.currentIdentifier}`,"@type":"SpatialEntity",label:t.label||void 0,creator:`${e.user.firstName} ${e.user.lastName}`,creator_first_name:e.user.firstName,creator_last_name:e.user.lastName,creation_date:this.currentDate,ccf_annotations:i.map(o=>o.id),slice_thickness:(null===(r=t.slicesConfig)||void 0===r?void 0:r.thickness)||void 0,slice_count:(null===(s=t.slicesConfig)||void 0===s?void 0:s.numSlices)||void 0,x_dimension:+t.blockSize.x.toFixed(3),y_dimension:+t.blockSize.y.toFixed(3),z_dimension:+t.blockSize.z.toFixed(3),dimension_units:"millimeter",placement:{"@context":"https://hubmapconsortium.github.io/ccf-ontology/ccf-context.jsonld","@id":`http://purl.org/ccf/1.5/${this.currentIdentifier}_placement`,"@type":"SpatialPlacement",target:t.organIri,placement_date:this.currentDate,x_scaling:1,y_scaling:1,z_scaling:1,scaling_units:"ratio",x_rotation:+t.rotation.x.toFixed(3),y_rotation:+t.rotation.y.toFixed(3),z_rotation:+t.rotation.z.toFixed(3),rotation_order:"XYZ",rotation_units:"degree",x_translation:+t.position.x.toFixed(3),y_translation:+t.position.y.toFixed(3),z_translation:+t.position.z.toFixed(3),translation_units:"millimeter"}}}xyzTripletToString(e){return`${Math.round(e.x)}, ${Math.round(e.y)}, ${Math.round(e.z)}`}};function ake(n,e){if(1&n){const t=Zi();R(0,"mat-icon",2),ge("click",function(){return en(t),Qe().setAllOpacity(20)}),De(1,"refresh"),k()}2&n&&ie("matRippleCentered",!0)("matRippleUnbounded",!0)}function lke(n,e){if(1&n){const t=Zi();R(0,"div",3),ge("mouseenter",function(){const s=en(t).$implicit;return Qe().mouseOver(s)})("mouseleave",function(){return en(t),Qe().mouseOut()}),tt(1,"mat-icon",4),R(2,"div",5),De(3),k(),R(4,"div",6),R(5,"ccf-opacity-slider",7,8),ge("opacityChange",function(r){return en(t),Qe().updateOpacity(r)})("opacityReset",function(){return en(t),Qe().resetItem()})("visibilityToggle",function(){const s=en(t).$implicit;return Qe().toggleVisibility(s)}),k(),k(),k()}if(2&n){const t=e.$implicit,i=Qe();st("selected",!!i.selection&&i.getId(0,i.selection)===i.getId(0,t)),G(1),st("fade",!t.visible),G(1),st("hidden",t.id===(null==i.selection?null:i.selection.id)),Jy("title",t.name),G(1),xi(t.name),G(1),st("hidden",t.id!==(null==i.selection?null:i.selection.id)),G(1),ie("visible",t.visible)("opacity",i.selection?null==i.selection?null:i.selection.opacity:20)}}Sr.\u0275fac=function(e){return new(e||Sr)(I(Nt),I(Ah))},Sr.\u0275prov=ue({token:Sr,factory:Sr.\u0275fac}),xe([oi()],Sr.prototype,"metadata$",null),xe([oi()],Sr.prototype,"jsonld$",null),xe([oi()],Sr.prototype,"valid$",null),xe([oi()],Sr.prototype,"previousRegistrations$",null),xe([oi()],Sr.prototype,"currentIdentifier",null),xe([oi()],Sr.prototype,"currentDate",null),xe([on()],Sr.prototype,"setUseRegistrationCallback",null),xe([on()],Sr.prototype,"setDisplayErrors",null),xe([on()],Sr.prototype,"addRegistration",null),xe([oi()],Sr.prototype,"isValid",null),Sr=xe([xh(),cd({name:"registration",defaults:{useRegistrationCallback:!1,displayErrors:!1,registrations:[]}})],Sr);let cke=(()=>{class n{constructor(t){this.ga=t,this.clsName="ccf-visibility-menu",this.hover=new Le,this.itemsChange=new Le}toggleVisibility(t){t=Object.assign(Object.assign({},t),{visible:!t.visible}),this.selection&&t.id===this.selection.id&&(this.selection=Object.assign(Object.assign({},this.selection),{visible:t.visible})),this.ga.event("visibility_toggled","visibility_menu",""+t.id,+t.visible),this.updateOpacity(t.opacity)}mouseOver(t){this.selection=t===this.selection?void 0:t,this.hover.emit(t)}mouseOut(){this.selection=void 0,this.hover.emit(void 0)}updateOpacity(t){if(!this.selection)return;const i=Object.assign(Object.assign({},this.selection),{opacity:t});this.selection=i,this.items=this.items.map(r=>r.id===i.id?i:r),this.ga.event("opacity_update","visibility_menu",""+i.id,i.opacity),this.itemsChange.emit(this.items)}resetItem(){if(this.selection){const t=Object.assign(Object.assign({},this.selection),{opacity:20,visible:!0});this.selection=t,this.items=this.items.map(i=>i.id===t.id?t:i),this.ga.event("item_reset","visibility_menu",""+t.id),this.itemsChange.emit(this.items)}}setAllOpacity(t){this.items=this.items.map(i=>Object.assign(Object.assign({},i),{opacity:t,visible:!0})),this.ga.event("all_items_opacity_update","visibility_menu",void 0,t),this.itemsChange.emit(this.items)}getId(t,i){return i.id}}return n.\u0275fac=function(t){return new(t||n)(E(xs))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-visibility-menu"]],hostVars:2,hostBindings:function(t,i){2&t&&Rn(i.clsName)},inputs:{items:"items",selection:"selection"},outputs:{hover:"hover",itemsChange:"itemsChange"},decls:2,vars:3,consts:[["class","icon reset","matRipple","",3,"matRippleCentered","matRippleUnbounded","click",4,"ngIf"],["class","item-entry",3,"selected","mouseenter","mouseleave",4,"ngFor","ngForOf","ngForTrackBy"],["matRipple","",1,"icon","reset",3,"matRippleCentered","matRippleUnbounded","click"],[1,"item-entry",3,"mouseenter","mouseleave"],["svgIcon","app:opacity",1,"opacity-icon"],[1,"item-name",3,"title"],[1,"slider"],[3,"visible","opacity","opacityChange","opacityReset","visibilityToggle"],["slider",""]],template:function(t,i){1&t&&(mt(0,ake,2,2,"mat-icon",0),mt(1,lke,7,12,"div",1)),2&t&&(ie("ngIf",i.items.length),G(1),ie("ngForOf",i.items)("ngForTrackBy",i.getId))},directives:[zr,pl,rs,Js,LPe],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;margin-right:0;margin-left:0;max-height:18rem;overflow-y:auto;scrollbar-width:thin}[_nghost-%COMP%] .icon[_ngcontent-%COMP%]{padding:.25rem;border-radius:.25rem}[_nghost-%COMP%] .reset[_ngcontent-%COMP%]{transform:scaleX(-1);cursor:pointer;transition:.6s;position:absolute;top:3rem}[_nghost-%COMP%] .reset[_ngcontent-%COMP%]:hover{border-radius:2px}[_nghost-%COMP%] .item-entry[_ngcontent-%COMP%]{display:flex;height:2.25rem;align-items:center;flex-shrink:0;position:relative}[_nghost-%COMP%] .item-entry[_ngcontent-%COMP%] .opacity[_ngcontent-%COMP%]{cursor:pointer}[_nghost-%COMP%] .item-entry[_ngcontent-%COMP%] .opacity-icon[_ngcontent-%COMP%]{z-index:1;transition:.6s}[_nghost-%COMP%] .item-entry[_ngcontent-%COMP%] .opacity-icon[_ngcontent-%COMP%]:hover{border-radius:2px}[_nghost-%COMP%] .item-entry[_ngcontent-%COMP%] .item-name[_ngcontent-%COMP%]{-webkit-user-select:none;user-select:none;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-left:.5rem;opacity:1;transition-duration:.4s;transition-timing-function:ease-in-out;transition-property:opacity;max-width:calc(100% - 2.5rem)}[_nghost-%COMP%] .item-entry[_ngcontent-%COMP%] .item-name.hidden[_ngcontent-%COMP%]{opacity:0}[_nghost-%COMP%] .item-entry[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%]{width:calc(100% - 2rem);transition-duration:.3s;transition-timing-function:ease-in-out;transition-property:opacity;left:2rem;position:absolute;opacity:1}[_nghost-%COMP%] .item-entry[_ngcontent-%COMP%] .slider.hidden[_ngcontent-%COMP%]{opacity:0;transition-duration:.1s;transition-timing-function:ease-in-out;transition-property:opacity}"],changeDetection:0}),n})();const uke=["*"],F9=new ve("MatChipRemove"),N9=new ve("MatChipAvatar"),L9=new ve("MatChipTrailingIcon");class dke{constructor(e){this._elementRef=e}}const hke=Hf(Uf(nc(dke),"primary"),-1);let y0=(()=>{class n extends hke{constructor(t,i,r,s,o,a,l,c){super(t),this._ngZone=i,this._changeDetectorRef=o,this._hasFocus=!1,this.chipListSelectable=!0,this._chipListMultiple=!1,this._chipListDisabled=!1,this._selected=!1,this._selectable=!0,this._disabled=!1,this._removable=!0,this._onFocus=new Se,this._onBlur=new Se,this.selectionChange=new Le,this.destroyed=new Le,this.removed=new Le,this._addHostClassName(),this._chipRippleTarget=a.createElement("div"),this._chipRippleTarget.classList.add("mat-chip-ripple"),this._elementRef.nativeElement.appendChild(this._chipRippleTarget),this._chipRipple=new oj(this,i,this._chipRippleTarget,r),this._chipRipple.setupTriggerEvents(t),this.rippleConfig=s||{},this._animationsDisabled="NoopAnimations"===l,this.tabIndex=null!=c&&parseInt(c)||-1}get rippleDisabled(){return this.disabled||this.disableRipple||this._animationsDisabled||!!this.rippleConfig.disabled}get selected(){return this._selected}set selected(t){const i=Mt(t);i!==this._selected&&(this._selected=i,this._dispatchSelectionChange())}get value(){return void 0!==this._value?this._value:this._elementRef.nativeElement.textContent}set value(t){this._value=t}get selectable(){return this._selectable&&this.chipListSelectable}set selectable(t){this._selectable=Mt(t)}get disabled(){return this._chipListDisabled||this._disabled}set disabled(t){this._disabled=Mt(t)}get removable(){return this._removable}set removable(t){this._removable=Mt(t)}get ariaSelected(){return this.selectable&&(this._chipListMultiple||this.selected)?this.selected.toString():null}_addHostClassName(){const t="mat-basic-chip",i=this._elementRef.nativeElement;i.hasAttribute(t)||i.tagName.toLowerCase()===t?i.classList.add(t):i.classList.add("mat-standard-chip")}ngOnDestroy(){this.destroyed.emit({chip:this}),this._chipRipple._removeTriggerEvents()}select(){this._selected||(this._selected=!0,this._dispatchSelectionChange(),this._changeDetectorRef.markForCheck())}deselect(){this._selected&&(this._selected=!1,this._dispatchSelectionChange(),this._changeDetectorRef.markForCheck())}selectViaInteraction(){this._selected||(this._selected=!0,this._dispatchSelectionChange(!0),this._changeDetectorRef.markForCheck())}toggleSelected(t=!1){return this._selected=!this.selected,this._dispatchSelectionChange(t),this._changeDetectorRef.markForCheck(),this.selected}focus(){this._hasFocus||(this._elementRef.nativeElement.focus(),this._onFocus.next({chip:this})),this._hasFocus=!0}remove(){this.removable&&this.removed.emit({chip:this})}_handleClick(t){this.disabled?t.preventDefault():t.stopPropagation()}_handleKeydown(t){if(!this.disabled)switch(t.keyCode){case 46:case 8:this.remove(),t.preventDefault();break;case 32:this.selectable&&this.toggleSelected(!0),t.preventDefault()}}_blur(){this._ngZone.onStable.pipe(yi(1)).subscribe(()=>{this._ngZone.run(()=>{this._hasFocus=!1,this._onBlur.next({chip:this})})})}_dispatchSelectionChange(t=!1){this.selectionChange.emit({source:this,isUserInput:t,selected:this._selected})}}return n.\u0275fac=function(t){return new(t||n)(E(rt),E(dt),E(si),E(aj,8),E(kn),E(ut),E(Do,8),Zr("tabindex"))},n.\u0275dir=oe({type:n,selectors:[["mat-basic-chip"],["","mat-basic-chip",""],["mat-chip"],["","mat-chip",""]],contentQueries:function(t,i,r){if(1&t&&(ei(r,N9,5),ei(r,L9,5),ei(r,F9,5)),2&t){let s;_t(s=yt())&&(i.avatar=s.first),_t(s=yt())&&(i.trailingIcon=s.first),_t(s=yt())&&(i.removeIcon=s.first)}},hostAttrs:["role","option",1,"mat-chip","mat-focus-indicator"],hostVars:14,hostBindings:function(t,i){1&t&&ge("click",function(s){return i._handleClick(s)})("keydown",function(s){return i._handleKeydown(s)})("focus",function(){return i.focus()})("blur",function(){return i._blur()}),2&t&&(nn("tabindex",i.disabled?null:i.tabIndex)("disabled",i.disabled||null)("aria-disabled",i.disabled.toString())("aria-selected",i.ariaSelected),st("mat-chip-selected",i.selected)("mat-chip-with-avatar",i.avatar)("mat-chip-with-trailing-icon",i.trailingIcon||i.removeIcon)("mat-chip-disabled",i.disabled)("_mat-animation-noopable",i._animationsDisabled))},inputs:{color:"color",disableRipple:"disableRipple",tabIndex:"tabIndex",selected:"selected",value:"value",selectable:"selectable",disabled:"disabled",removable:"removable"},outputs:{selectionChange:"selectionChange",destroyed:"destroyed",removed:"removed"},exportAs:["matChip"],features:[ct]}),n})(),B9=(()=>{class n{constructor(t,i){this._parentChip=t,"BUTTON"===i.nativeElement.nodeName&&i.nativeElement.setAttribute("type","button")}_handleClick(t){const i=this._parentChip;i.removable&&!i.disabled&&i.remove(),t.stopPropagation()}}return n.\u0275fac=function(t){return new(t||n)(E(y0),E(rt))},n.\u0275dir=oe({type:n,selectors:[["","matChipRemove",""]],hostAttrs:[1,"mat-chip-remove","mat-chip-trailing-icon"],hostBindings:function(t,i){1&t&&ge("click",function(s){return i._handleClick(s)})},features:[Dt([{provide:F9,useExisting:n}])]}),n})();const V9=new ve("mat-chips-default-options"),gke=FO(class{constructor(n,e,t,i){this._defaultErrorStateMatcher=n,this._parentForm=e,this._parentFormGroup=t,this.ngControl=i}});let mke=0;class _ke{constructor(e,t){this.source=e,this.value=t}}let z9=(()=>{class n extends gke{constructor(t,i,r,s,o,a,l){super(a,s,o,l),this._elementRef=t,this._changeDetectorRef=i,this._dir=r,this.controlType="mat-chip-list",this._lastDestroyedChipIndex=null,this._destroyed=new Se,this._uid="mat-chip-list-"+mke++,this._tabIndex=0,this._userTabIndex=null,this._onTouched=()=>{},this._onChange=()=>{},this._multiple=!1,this._compareWith=(c,d)=>c===d,this._required=!1,this._disabled=!1,this.ariaOrientation="horizontal",this._selectable=!0,this.change=new Le,this.valueChange=new Le,this.ngControl&&(this.ngControl.valueAccessor=this)}get selected(){var t,i;return this.multiple?(null===(t=this._selectionModel)||void 0===t?void 0:t.selected)||[]:null===(i=this._selectionModel)||void 0===i?void 0:i.selected[0]}get role(){return this.empty?null:"listbox"}get multiple(){return this._multiple}set multiple(t){this._multiple=Mt(t),this._syncChipsState()}get compareWith(){return this._compareWith}set compareWith(t){this._compareWith=t,this._selectionModel&&this._initializeSelection()}get value(){return this._value}set value(t){this.writeValue(t),this._value=t}get id(){return this._chipInput?this._chipInput.id:this._uid}get required(){return this._required}set required(t){this._required=Mt(t),this.stateChanges.next()}get placeholder(){return this._chipInput?this._chipInput.placeholder:this._placeholder}set placeholder(t){this._placeholder=t,this.stateChanges.next()}get focused(){return this._chipInput&&this._chipInput.focused||this._hasFocusedChip()}get empty(){return(!this._chipInput||this._chipInput.empty)&&(!this.chips||0===this.chips.length)}get shouldLabelFloat(){return!this.empty||this.focused}get disabled(){return this.ngControl?!!this.ngControl.disabled:this._disabled}set disabled(t){this._disabled=Mt(t),this._syncChipsState()}get selectable(){return this._selectable}set selectable(t){this._selectable=Mt(t),this.chips&&this.chips.forEach(i=>i.chipListSelectable=this._selectable)}set tabIndex(t){this._userTabIndex=t,this._tabIndex=t}get chipSelectionChanges(){return Ni(...this.chips.map(t=>t.selectionChange))}get chipFocusChanges(){return Ni(...this.chips.map(t=>t._onFocus))}get chipBlurChanges(){return Ni(...this.chips.map(t=>t._onBlur))}get chipRemoveChanges(){return Ni(...this.chips.map(t=>t.destroyed))}ngAfterContentInit(){this._keyManager=new nO(this.chips).withWrap().withVerticalOrientation().withHomeAndEnd().withHorizontalOrientation(this._dir?this._dir.value:"ltr"),this._dir&&this._dir.change.pipe(Tn(this._destroyed)).subscribe(t=>this._keyManager.withHorizontalOrientation(t)),this._keyManager.tabOut.pipe(Tn(this._destroyed)).subscribe(()=>{this._allowFocusEscape()}),this.chips.changes.pipe(Rr(null),Tn(this._destroyed)).subscribe(()=>{this.disabled&&Promise.resolve().then(()=>{this._syncChipsState()}),this._resetChips(),this._initializeSelection(),this._updateTabIndex(),this._updateFocusForDestroyedChips(),this.stateChanges.next()})}ngOnInit(){this._selectionModel=new lS(this.multiple,void 0,!1),this.stateChanges.next()}ngDoCheck(){this.ngControl&&(this.updateErrorState(),this.ngControl.disabled!==this._disabled&&(this.disabled=!!this.ngControl.disabled))}ngOnDestroy(){this._destroyed.next(),this._destroyed.complete(),this.stateChanges.complete(),this._dropSubscriptions()}registerInput(t){this._chipInput=t,this._elementRef.nativeElement.setAttribute("data-mat-chip-input",t.id)}setDescribedByIds(t){this._ariaDescribedby=t.join(" ")}writeValue(t){this.chips&&this._setSelectionByValue(t,!1)}registerOnChange(t){this._onChange=t}registerOnTouched(t){this._onTouched=t}setDisabledState(t){this.disabled=t,this.stateChanges.next()}onContainerClick(t){this._originatesFromChip(t)||this.focus()}focus(t){this.disabled||this._chipInput&&this._chipInput.focused||(this.chips.length>0?(this._keyManager.setFirstItemActive(),this.stateChanges.next()):(this._focusInput(t),this.stateChanges.next()))}_focusInput(t){this._chipInput&&this._chipInput.focus(t)}_keydown(t){const i=t.target;i&&i.classList.contains("mat-chip")&&(this._keyManager.onKeydown(t),this.stateChanges.next())}_updateTabIndex(){this._tabIndex=this._userTabIndex||(0===this.chips.length?-1:0)}_updateFocusForDestroyedChips(){if(null!=this._lastDestroyedChipIndex)if(this.chips.length){const t=Math.min(this._lastDestroyedChipIndex,this.chips.length-1);this._keyManager.setActiveItem(t)}else this.focus();this._lastDestroyedChipIndex=null}_isValidIndex(t){return t>=0&&tr.deselect()),Array.isArray(t))t.forEach(r=>this._selectValue(r,i)),this._sortValues();else{const r=this._selectValue(t,i);r&&i&&this._keyManager.setActiveItem(r)}}_selectValue(t,i=!0){const r=this.chips.find(s=>null!=s.value&&this._compareWith(s.value,t));return r&&(i?r.selectViaInteraction():r.select(),this._selectionModel.select(r)),r}_initializeSelection(){Promise.resolve().then(()=>{(this.ngControl||this._value)&&(this._setSelectionByValue(this.ngControl?this.ngControl.value:this._value,!1),this.stateChanges.next())})}_clearSelection(t){this._selectionModel.clear(),this.chips.forEach(i=>{i!==t&&i.deselect()}),this.stateChanges.next()}_sortValues(){this._multiple&&(this._selectionModel.clear(),this.chips.forEach(t=>{t.selected&&this._selectionModel.select(t)}),this.stateChanges.next())}_propagateChanges(t){let i=null;i=Array.isArray(this.selected)?this.selected.map(r=>r.value):this.selected?this.selected.value:t,this._value=i,this.change.emit(new _ke(this,i)),this.valueChange.emit(i),this._onChange(i),this._changeDetectorRef.markForCheck()}_blur(){this._hasFocusedChip()||this._keyManager.setActiveItem(-1),this.disabled||(this._chipInput?setTimeout(()=>{this.focused||this._markAsTouched()}):this._markAsTouched())}_markAsTouched(){this._onTouched(),this._changeDetectorRef.markForCheck(),this.stateChanges.next()}_allowFocusEscape(){-1!==this._tabIndex&&(this._tabIndex=-1,setTimeout(()=>{this._tabIndex=this._userTabIndex||0,this._changeDetectorRef.markForCheck()}))}_resetChips(){this._dropSubscriptions(),this._listenToChipsFocus(),this._listenToChipsSelection(),this._listenToChipsRemoved()}_dropSubscriptions(){this._chipFocusSubscription&&(this._chipFocusSubscription.unsubscribe(),this._chipFocusSubscription=null),this._chipBlurSubscription&&(this._chipBlurSubscription.unsubscribe(),this._chipBlurSubscription=null),this._chipSelectionSubscription&&(this._chipSelectionSubscription.unsubscribe(),this._chipSelectionSubscription=null),this._chipRemoveSubscription&&(this._chipRemoveSubscription.unsubscribe(),this._chipRemoveSubscription=null)}_listenToChipsSelection(){this._chipSelectionSubscription=this.chipSelectionChanges.subscribe(t=>{t.source.selected?this._selectionModel.select(t.source):this._selectionModel.deselect(t.source),this.multiple||this.chips.forEach(i=>{!this._selectionModel.isSelected(i)&&i.selected&&i.deselect()}),t.isUserInput&&this._propagateChanges()})}_listenToChipsFocus(){this._chipFocusSubscription=this.chipFocusChanges.subscribe(t=>{let i=this.chips.toArray().indexOf(t.chip);this._isValidIndex(i)&&this._keyManager.updateActiveItem(i),this.stateChanges.next()}),this._chipBlurSubscription=this.chipBlurChanges.subscribe(()=>{this._blur(),this.stateChanges.next()})}_listenToChipsRemoved(){this._chipRemoveSubscription=this.chipRemoveChanges.subscribe(t=>{const i=t.chip,r=this.chips.toArray().indexOf(t.chip);this._isValidIndex(r)&&i._hasFocus&&(this._lastDestroyedChipIndex=r)})}_originatesFromChip(t){let i=t.target;for(;i&&i!==this._elementRef.nativeElement;){if(i.classList.contains("mat-chip"))return!0;i=i.parentElement}return!1}_hasFocusedChip(){return this.chips&&this.chips.some(t=>t._hasFocus)}_syncChipsState(){this.chips&&this.chips.forEach(t=>{t._chipListDisabled=this._disabled,t._chipListMultiple=this.multiple})}}return n.\u0275fac=function(t){return new(t||n)(E(rt),E(kn),E(Qo,8),E(mp,8),E(Zm,8),E(Vv),E(uc,10))},n.\u0275cmp=Ne({type:n,selectors:[["mat-chip-list"]],contentQueries:function(t,i,r){if(1&t&&ei(r,y0,5),2&t){let s;_t(s=yt())&&(i.chips=s)}},hostAttrs:[1,"mat-chip-list"],hostVars:15,hostBindings:function(t,i){1&t&&ge("focus",function(){return i.focus()})("blur",function(){return i._blur()})("keydown",function(s){return i._keydown(s)}),2&t&&(al("id",i._uid),nn("tabindex",i.disabled?null:i._tabIndex)("aria-describedby",i._ariaDescribedby||null)("aria-required",i.role?i.required:null)("aria-disabled",i.disabled.toString())("aria-invalid",i.errorState)("aria-multiselectable",i.multiple)("role",i.role)("aria-orientation",i.ariaOrientation),st("mat-chip-list-disabled",i.disabled)("mat-chip-list-invalid",i.errorState)("mat-chip-list-required",i.required))},inputs:{ariaOrientation:["aria-orientation","ariaOrientation"],multiple:"multiple",compareWith:"compareWith",value:"value",required:"required",placeholder:"placeholder",disabled:"disabled",selectable:"selectable",tabIndex:"tabIndex",errorStateMatcher:"errorStateMatcher"},outputs:{change:"change",valueChange:"valueChange"},exportAs:["matChipList"],features:[Dt([{provide:jv,useExisting:n}]),ct],ngContentSelectors:uke,decls:2,vars:0,consts:[[1,"mat-chip-list-wrapper"]],template:function(t,i){1&t&&(wi(),R(0,"div",0),Ht(1),k())},styles:['.mat-chip{position:relative;box-sizing:border-box;-webkit-tap-highlight-color:transparent;transform:translateZ(0);border:none;-webkit-appearance:none;-moz-appearance:none}.mat-standard-chip{transition:box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);display:inline-flex;padding:7px 12px;border-radius:16px;align-items:center;cursor:default;min-height:32px;height:1px}._mat-animation-noopable.mat-standard-chip{transition:none;animation:none}.mat-standard-chip .mat-chip-remove.mat-icon{width:18px;height:18px}.mat-standard-chip::after{top:0;left:0;right:0;bottom:0;position:absolute;border-radius:inherit;opacity:0;content:"";pointer-events:none;transition:opacity 200ms cubic-bezier(0.35, 0, 0.25, 1)}.mat-standard-chip:hover::after{opacity:.12}.mat-standard-chip:focus{outline:none}.mat-standard-chip:focus::after{opacity:.16}.cdk-high-contrast-active .mat-standard-chip{outline:solid 1px}.cdk-high-contrast-active .mat-standard-chip:focus{outline:dotted 2px}.mat-standard-chip.mat-chip-disabled::after{opacity:0}.mat-standard-chip.mat-chip-disabled .mat-chip-remove,.mat-standard-chip.mat-chip-disabled .mat-chip-trailing-icon{cursor:default}.mat-standard-chip.mat-chip-with-trailing-icon.mat-chip-with-avatar,.mat-standard-chip.mat-chip-with-avatar{padding-top:0;padding-bottom:0}.mat-standard-chip.mat-chip-with-trailing-icon.mat-chip-with-avatar{padding-right:8px;padding-left:0}[dir=rtl] .mat-standard-chip.mat-chip-with-trailing-icon.mat-chip-with-avatar{padding-left:8px;padding-right:0}.mat-standard-chip.mat-chip-with-trailing-icon{padding-top:7px;padding-bottom:7px;padding-right:8px;padding-left:12px}[dir=rtl] .mat-standard-chip.mat-chip-with-trailing-icon{padding-left:8px;padding-right:12px}.mat-standard-chip.mat-chip-with-avatar{padding-left:0;padding-right:12px}[dir=rtl] .mat-standard-chip.mat-chip-with-avatar{padding-right:0;padding-left:12px}.mat-standard-chip .mat-chip-avatar{width:24px;height:24px;margin-right:8px;margin-left:4px}[dir=rtl] .mat-standard-chip .mat-chip-avatar{margin-left:8px;margin-right:4px}.mat-standard-chip .mat-chip-remove,.mat-standard-chip .mat-chip-trailing-icon{width:18px;height:18px;cursor:pointer}.mat-standard-chip .mat-chip-remove,.mat-standard-chip .mat-chip-trailing-icon{margin-left:8px;margin-right:0}[dir=rtl] .mat-standard-chip .mat-chip-remove,[dir=rtl] .mat-standard-chip .mat-chip-trailing-icon{margin-right:8px;margin-left:0}.mat-chip-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none;border-radius:inherit;overflow:hidden}.mat-chip-list-wrapper{display:flex;flex-direction:row;flex-wrap:wrap;align-items:center;margin:-4px}.mat-chip-list-wrapper input.mat-input-element,.mat-chip-list-wrapper .mat-standard-chip{margin:4px}.mat-chip-list-stacked .mat-chip-list-wrapper{flex-direction:column;align-items:flex-start}.mat-chip-list-stacked .mat-chip-list-wrapper .mat-standard-chip{width:100%}.mat-chip-avatar{border-radius:50%;justify-content:center;align-items:center;display:flex;overflow:hidden;object-fit:cover}input.mat-chip-input{width:150px;margin:4px;flex:1 0 150px}\n'],encapsulation:2,changeDetection:0}),n})();const bke={separatorKeyCodes:[13]};let j9=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({providers:[Vv,{provide:V9,useValue:bke}],imports:[[On]]}),n})(),Cke=(()=>{class n{constructor(t){this.ga=t,this.clsName="ccf-visibility-toggle",this.visible=!1,this.toggleLabel="",this.disabled=!1,this.visibilityChanged=new Le}toggleVisibility(){this.visible=!this.visible,this.ga.event("visibility_toggled","visibility_toggle",""+this.visible),this.visibilityChanged.emit(this.visible)}}return n.\u0275fac=function(t){return new(t||n)(E(xs))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-visibility-toggle"]],hostVars:2,hostBindings:function(t,i){2&t&&Rn(i.clsName)},inputs:{visible:"visible",toggleLabel:"toggleLabel",disabled:"disabled"},outputs:{visibilityChanged:"visibilityChanged"},decls:8,vars:9,consts:[[1,"toggle-div"],[1,"toggle-wrapper",3,"click"],[1,"icon-background"],["svgIcon","app:visibility_off_cube",1,"icon","block"],[1,"icon","green"],[1,"toggle-label"]],template:function(t,i){1&t&&(R(0,"div",0),R(1,"mat-chip",1),ge("click",function(){return i.toggleVisibility()}),R(2,"div",2),tt(3,"mat-icon",3),R(4,"mat-icon",4),De(5,"done"),k(),k(),R(6,"div",5),De(7),k(),k(),k()),2&t&&(G(1),st("disabled",i.disabled),G(1),st("disabled",i.disabled),G(1),st("hidden",i.visible),G(1),st("hidden",!i.visible),G(3),xi(i.toggleLabel))},directives:[y0,rs],styles:["[_nghost-%COMP%]{height:3rem;display:flex;align-items:center}[_nghost-%COMP%] .mat-chip{padding:0!important}[_nghost-%COMP%] .mat-chip.disabled{cursor:not-allowed!important}[_nghost-%COMP%] .toggle-div[_ngcontent-%COMP%]{width:100%;display:flex;justify-content:center;padding-top:1.5rem}[_nghost-%COMP%] .toggle-div[_ngcontent-%COMP%] .toggle-wrapper[_ngcontent-%COMP%]{-webkit-user-select:none;-moz-user-select:none;display:flex;padding-left:.5rem;cursor:pointer;align-items:center;position:relative;border-width:.075rem;border-style:solid;height:2.25rem;border-radius:1.5rem;transition:background-color .2s ease-in-out}[_nghost-%COMP%] .toggle-div[_ngcontent-%COMP%] .toggle-wrapper[_ngcontent-%COMP%] .icon-background[_ngcontent-%COMP%]{border-radius:1.5rem;height:2.06rem;width:2.06rem;display:flex;align-items:center;justify-content:center}[_nghost-%COMP%] .toggle-div[_ngcontent-%COMP%] .toggle-wrapper[_ngcontent-%COMP%] .icon-background[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{transition:.6s;position:absolute}[_nghost-%COMP%] .toggle-div[_ngcontent-%COMP%] .toggle-wrapper[_ngcontent-%COMP%] .icon-background[_ngcontent-%COMP%] .icon.block[_ngcontent-%COMP%]{width:1.125rem}[_nghost-%COMP%] .toggle-div[_ngcontent-%COMP%] .toggle-wrapper[_ngcontent-%COMP%] .icon-background[_ngcontent-%COMP%] .icon.hidden[_ngcontent-%COMP%]{opacity:0}[_nghost-%COMP%] .toggle-div[_ngcontent-%COMP%] .toggle-wrapper[_ngcontent-%COMP%] .toggle-label[_ngcontent-%COMP%]{font-weight:bold;margin-left:.5rem;padding-right:1.25rem;padding-left:.25rem}"],changeDetection:0}),n})();const wke=["fileInput"];let Eke=(()=>{class n{constructor(t){this.ga=t,this.clsName="ccf-json-file-reader",this.label="Upload",this.parsedJson=new Le}triggerFileInput(){this.fileInput.nativeElement.click()}handleFile(t){const i=t.target;if(!i.files)return;const r=i.files[0],s=new FileReader;s.onload=()=>{const o=JSON.parse(s.result);this.ga.event("json_file_load_end","json_file_reader"),this.parsedJson.emit(o)},this.ga.event("json_file_load_start","json_file_reader"),s.readAsText(r)}}return n.\u0275fac=function(t){return new(t||n)(E(xs))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-json-file-reader"]],viewQuery:function(t,i){if(1&t&&Jn(wke,5),2&t){let r;_t(r=yt())&&(i.fileInput=r.first)}},hostVars:2,hostBindings:function(t,i){2&t&&Rn(i.clsName)},inputs:{label:"label"},outputs:{parsedJson:"parsedJson"},decls:4,vars:1,consts:[["mat-button","",1,"upload-button",3,"click"],["type","file","accept","application/JSON","name","fileInput","id","fileInput",2,"display","none",3,"change"],["fileInput",""]],template:function(t,i){1&t&&(R(0,"button",0),ge("click",function(){return i.triggerFileInput()}),De(1),k(),R(2,"input",1,2),ge("change",function(s){return i.handleFile(s)}),k()),2&t&&(G(1),xi(i.label))},directives:[lh],styles:["[_nghost-%COMP%] .upload-button[_ngcontent-%COMP%]{width:100%;height:2.25rem;transition:.6s;cursor:pointer;font-weight:500}"]}),n})(),Ske=(()=>{class n{constructor(){this.clsName="ccf-details-label",this.details=[]}arrayToString(t){return t.join(", ")}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=Ne({type:n,selectors:[["ccf-details-label"]],hostVars:2,hostBindings:function(t,i){2&t&&Rn(i.clsName)},inputs:{details:"details"},decls:1,vars:1,template:function(t,i){1&t&&De(0),2&t&&xi(i.arrayToString(i.details))},styles:["[_nghost-%COMP%]{display:block;height:2.25rem}"],changeDetection:0}),n})();const Mke=["trigger"],xke=["panel"];function Tke(n,e){if(1&n&&(R(0,"span",8),De(1),k()),2&n){const t=Qe();G(1),xi(t.placeholder)}}function Ake(n,e){if(1&n&&(R(0,"span",12),De(1),k()),2&n){const t=Qe(2);G(1),xi(t.triggerValue)}}function Dke(n,e){1&n&&Ht(0,0,["*ngSwitchCase","true"])}function Oke(n,e){1&n&&(R(0,"span",9),mt(1,Ake,2,1,"span",10),mt(2,Dke,1,0,"ng-content",11),k()),2&n&&(ie("ngSwitch",!!Qe().customTrigger),G(2),ie("ngSwitchCase",!0))}function Ike(n,e){if(1&n){const t=Zi();R(0,"div",13),R(1,"div",14,15),ge("@transformPanel.done",function(r){return en(t),Qe()._panelDoneAnimatingStream.next(r.toState)})("keydown",function(r){return en(t),Qe()._handleKeydown(r)}),Ht(3,1),k(),k()}if(2&n){const t=Qe();ie("@transformPanelWrap",void 0),G(1),function(n,e,t){Gl(yo,Vc,Cg(Oe(),n,e,t),!0)}("mat-select-panel ",t._getPanelTheme(),""),vf("transform-origin",t._transformOrigin)("font-size",t._triggerFontSize,"px"),ie("ngClass",t.panelClass)("@transformPanel",t.multiple?"showing-multiple":"showing"),nn("id",t.id+"-panel")("aria-multiselectable",t.multiple)("aria-label",t.ariaLabel||null)("aria-labelledby",t._getPanelAriaLabelledby())}}const Pke=[[["mat-select-trigger"]],"*"],Rke=["mat-select-trigger","*"],U9={transformPanelWrap:tc("transformPanelWrap",[Qs("* => void",Uie("@transformPanel",[jie()],{optional:!0}))]),transformPanel:tc("transformPanel",[wr("void",ti({transform:"scaleY(0.8)",minWidth:"100%",opacity:0})),wr("showing",ti({opacity:1,minWidth:"calc(100% + 32px)",transform:"scaleY(1)"})),wr("showing-multiple",ti({opacity:1,minWidth:"calc(100% + 64px)",transform:"scaleY(1)"})),Qs("void => *",Ao("120ms cubic-bezier(0, 0, 0.2, 1)")),Qs("* => void",Ao("100ms 25ms linear",ti({opacity:0})))])};let H9=0;const G9=new ve("mat-select-scroll-strategy"),Lke=new ve("MAT_SELECT_CONFIG"),Bke={provide:G9,deps:[Jo],useFactory:function(n){return()=>n.scrollStrategies.reposition()}};class Vke{constructor(e,t){this.source=e,this.value=t}}const zke=nc(Hf(jf(FO(class{constructor(n,e,t,i,r){this._elementRef=n,this._defaultErrorStateMatcher=e,this._parentForm=t,this._parentFormGroup=i,this.ngControl=r}})))),W9=new ve("MatSelectTrigger");let jke=(()=>{class n extends zke{constructor(t,i,r,s,o,a,l,c,d,f,p,g,_,y){var v,C,w;super(o,s,l,c,f),this._viewportRuler=t,this._changeDetectorRef=i,this._ngZone=r,this._dir=a,this._parentFormField=d,this._liveAnnouncer=_,this._defaultOptions=y,this._panelOpen=!1,this._compareWith=(x,N)=>x===N,this._uid="mat-select-"+H9++,this._triggerAriaLabelledBy=null,this._destroy=new Se,this._onChange=()=>{},this._onTouched=()=>{},this._valueId="mat-select-value-"+H9++,this._panelDoneAnimatingStream=new Se,this._overlayPanelClass=(null===(v=this._defaultOptions)||void 0===v?void 0:v.overlayPanelClass)||"",this._focused=!1,this.controlType="mat-select",this._required=!1,this._multiple=!1,this._disableOptionCentering=null!==(w=null===(C=this._defaultOptions)||void 0===C?void 0:C.disableOptionCentering)&&void 0!==w&&w,this.ariaLabel="",this.optionSelectionChanges=Yb(()=>{const x=this.options;return x?x.changes.pipe(Rr(x),Pr(()=>Ni(...x.map(N=>N.onSelectionChange)))):this._ngZone.onStable.pipe(yi(1),Pr(()=>this.optionSelectionChanges))}),this.openedChange=new Le,this._openedStream=this.openedChange.pipe(Fn(x=>x),Ae(()=>{})),this._closedStream=this.openedChange.pipe(Fn(x=>!x),Ae(()=>{})),this.selectionChange=new Le,this.valueChange=new Le,this.ngControl&&(this.ngControl.valueAccessor=this),null!=(null==y?void 0:y.typeaheadDebounceInterval)&&(this._typeaheadDebounceInterval=y.typeaheadDebounceInterval),this._scrollStrategyFactory=g,this._scrollStrategy=this._scrollStrategyFactory(),this.tabIndex=parseInt(p)||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=Mt(t),this.stateChanges.next()}get multiple(){return this._multiple}set multiple(t){this._multiple=Mt(t)}get disableOptionCentering(){return this._disableOptionCentering}set disableOptionCentering(t){this._disableOptionCentering=Mt(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=To(t)}get id(){return this._id}set id(t){this._id=t||this._uid,this.stateChanges.next()}ngOnInit(){this._selectionModel=new lS(this.multiple),this.stateChanges.next(),this._panelDoneAnimatingStream.pipe(Zo(),Tn(this._destroy)).subscribe(()=>this._panelDoneAnimating(this.panelOpen))}ngAfterContentInit(){this._initKeyManager(),this._selectionModel.changed.pipe(Tn(this._destroy)).subscribe(t=>{t.added.forEach(i=>i.select()),t.removed.forEach(i=>i.deselect())}),this.options.changes.pipe(Rr(null),Tn(this._destroy)).subscribe(()=>{this._resetOptions(),this._initializeSelection()})}ngDoCheck(){const t=this._getTriggerAriaLabelledby();if(t!==this._triggerAriaLabelledBy){const i=this._elementRef.nativeElement;this._triggerAriaLabelledBy=t,t?i.setAttribute("aria-labelledby",t):i.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(i=>i.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 i=t.keyCode,r=40===i||38===i||37===i||39===i,s=13===i||32===i,o=this._keyManager;if(!o.isTyping()&&s&&!Zs(t)||(this.multiple||t.altKey)&&r)t.preventDefault(),this.open();else if(!this.multiple){const a=this.selected;o.onKeydown(t);const l=this.selected;l&&a!==l&&this._liveAnnouncer.announce(l.viewValue,1e4)}}_handleOpenKeydown(t){const i=this._keyManager,r=t.keyCode,s=40===r||38===r,o=i.isTyping();if(s&&t.altKey)t.preventDefault(),this.close();else if(o||13!==r&&32!==r||!i.activeItem||Zs(t))if(!o&&this._multiple&&65===r&&t.ctrlKey){t.preventDefault();const a=this.options.some(l=>!l.disabled&&!l.selected);this.options.forEach(l=>{l.disabled||(a?l.select():l.deselect())})}else{const a=i.activeItemIndex;i.onKeydown(t),this._multiple&&s&&t.shiftKey&&i.activeItem&&i.activeItemIndex!==a&&i.activeItem._selectViaInteraction()}else t.preventDefault(),i.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(yi(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(i=>i.setInactiveStyles()),this._selectionModel.clear(),this.multiple&&t)Array.isArray(t),t.forEach(i=>this._selectValue(i)),this._sortValues();else{const i=this._selectValue(t);i?this._keyManager.updateActiveItem(i):this.panelOpen||this._keyManager.updateActiveItem(-1)}this._changeDetectorRef.markForCheck()}_selectValue(t){const i=this.options.find(r=>{if(this._selectionModel.isSelected(r))return!1;try{return null!=r.value&&this._compareWith(r.value,t)}catch(s){return!1}});return i&&this._selectionModel.select(i),i}_initKeyManager(){this._keyManager=new kV(this.options).withTypeAhead(this._typeaheadDebounceInterval).withVerticalOrientation().withHorizontalOrientation(this._isRtl()?"rtl":"ltr").withHomeAndEnd().withAllowedModifierKeys(["shiftKey"]),this._keyManager.tabOut.pipe(Tn(this._destroy)).subscribe(()=>{this.panelOpen&&(!this.multiple&&this._keyManager.activeItem&&this._keyManager.activeItem._selectViaInteraction(),this.focus(),this.close())}),this._keyManager.change.pipe(Tn(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=Ni(this.options.changes,this._destroy);this.optionSelectionChanges.pipe(Tn(t)).subscribe(i=>{this._onSelect(i.source,i.isUserInput),i.isUserInput&&!this.multiple&&this._panelOpen&&(this.close(),this.focus())}),Ni(...this.options.map(i=>i._stateChanges)).pipe(Tn(t)).subscribe(()=>{this._changeDetectorRef.markForCheck(),this.stateChanges.next()})}_onSelect(t,i){const r=this._selectionModel.isSelected(t);null!=t.value||this._multiple?(r!==t.selected&&(t.selected?this._selectionModel.select(t):this._selectionModel.deselect(t)),i&&this._keyManager.setActiveItem(t),this.multiple&&(this._sortValues(),i&&this.focus())):(t.deselect(),this._selectionModel.clear(),null!=this.value&&this._propagateChanges(t.value)),r!==this._selectionModel.isSelected(t)&&this._propagateChanges(),this.stateChanges.next()}_sortValues(){if(this.multiple){const t=this.options.toArray();this._selectionModel.sort((i,r)=>this.sortComparator?this.sortComparator(i,r,t):t.indexOf(i)-t.indexOf(r)),this.stateChanges.next()}}_propagateChanges(t){let i=null;i=this.multiple?this.selected.map(r=>r.value):this.selected?this.selected.value:t,this._value=i,this.valueChange.emit(i),this._onChange(i),this.selectionChange.emit(this._getChangeEvent(i)),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 i=null===(t=this._parentFormField)||void 0===t?void 0:t.getLabelId();return this.ariaLabelledby?(i?i+" ":"")+this.ariaLabelledby:i}_getAriaActiveDescendant(){return this.panelOpen&&this._keyManager&&this._keyManager.activeItem?this._keyManager.activeItem.id:null}_getTriggerAriaLabelledby(){var t;if(this.ariaLabel)return null;const i=null===(t=this._parentFormField)||void 0===t?void 0:t.getLabelId();let r=(i?i+" ":"")+this._valueId;return this.ariaLabelledby&&(r+=" "+this.ariaLabelledby),r}_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 n.\u0275fac=function(t){return new(t||n)(E(Yf),E(kn),E(dt),E(Vv),E(rt),E(Qo,8),E(mp,8),E(Zm,8),E(nS,8),E(uc,10),Zr("tabindex"),E(G9),E(DE),E(Lke,8))},n.\u0275dir=oe({type:n,viewQuery:function(t,i){if(1&t&&(Jn(Mke,5),Jn(xke,5),Jn(sU,5)),2&t){let r;_t(r=yt())&&(i.trigger=r.first),_t(r=yt())&&(i.panel=r.first),_t(r=yt())&&(i._overlayDir=r.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:[ct,zn]}),n})(),Uke=(()=>{class n extends jke{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,i,r){const s=this._getItemHeight();return Math.min(Math.max(0,s*t-i+s/2),r)}ngOnInit(){super.ngOnInit(),this._viewportRuler.change().pipe(Tn(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(yi(1)).subscribe(()=>{this._triggerFontSize&&this._overlayDir.overlayRef&&this._overlayDir.overlayRef.overlayElement&&(this._overlayDir.overlayRef.overlayElement.style.fontSize=`${this._triggerFontSize}px`)}))}_scrollOptionIntoView(t){const i=BO(t,this.options,this.optionGroups),r=this._getItemHeight();this.panel.nativeElement.scrollTop=0===t&&1===i?0:function(n,e,t,i){return nt+i?Math.max(0,n-i+e):t}((t+i)*r,r,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 Vke(this,t)}_calculateOverlayOffsetX(){const t=this._overlayDir.overlayRef.overlayElement.getBoundingClientRect(),i=this._viewportRuler.getViewportSize(),r=this._isRtl(),s=this.multiple?56:32;let o;if(this.multiple)o=40;else if(this.disableOptionCentering)o=16;else{let c=this._selectionModel.selected[0]||this.options.first;o=c&&c.group?32:16}r||(o*=-1);const a=0-(t.left+o-(r?s:0)),l=t.right+o-i.width+(r?0:s);a>0?o+=a+8:l>0&&(o-=l+8),this._overlayDir.offsetX=Math.round(o),this._overlayDir.overlayRef.updatePosition()}_calculateOverlayOffsetY(t,i,r){const s=this._getItemHeight(),o=(s-this._triggerRect.height)/2,a=Math.floor(256/s);let l;return this.disableOptionCentering?0:(l=0===this._scrollTop?t*s:this._scrollTop===r?(t-(this._getItemCount()-a))*s+(s-(this._getItemCount()*s-256)%s):i-s/2,Math.round(-1*l-o))}_checkOverlayWithinViewport(t){const i=this._getItemHeight(),r=this._viewportRuler.getViewportSize(),s=this._triggerRect.top-8,o=r.height-this._triggerRect.bottom-8,a=Math.abs(this._offsetY),c=Math.min(this._getItemCount()*i,256)-a-this._triggerRect.height;c>o?this._adjustPanelUp(c,o):a>s?this._adjustPanelDown(a,s,t):this._transformOrigin=this._getOriginBasedOnOption()}_adjustPanelUp(t,i){const r=Math.round(t-i);this._scrollTop-=r,this._offsetY-=r,this._transformOrigin=this._getOriginBasedOnOption(),this._scrollTop<=0&&(this._scrollTop=0,this._offsetY=0,this._transformOrigin="50% bottom 0px")}_adjustPanelDown(t,i,r){const s=Math.round(t-i);if(this._scrollTop+=s,this._offsetY+=s,this._transformOrigin=this._getOriginBasedOnOption(),this._scrollTop>=r)return this._scrollTop=r,this._offsetY=0,void(this._transformOrigin="50% top 0px")}_calculateOverlayPosition(){const t=this._getItemHeight(),i=this._getItemCount(),r=Math.min(i*t,256),o=i*t-r;let a;a=this.empty?0:Math.max(this.options.toArray().indexOf(this._selectionModel.selected[0]),0),a+=BO(a,this.options,this.optionGroups);const l=r/2;this._scrollTop=this._calculateOverlayScroll(a,l,o),this._offsetY=this._calculateOverlayOffsetY(a,l,o),this._checkOverlayWithinViewport(o)}_getOriginBasedOnOption(){const t=this._getItemHeight(),i=(t-this._triggerRect.height)/2;return`50% ${Math.abs(this._offsetY)-i+t/2}px 0px`}_getItemHeight(){return 3*this._triggerFontSize}_getItemCount(){return this.options.length+this.optionGroups.length}}return n.\u0275fac=function(){let e;return function(i){return(e||(e=$n(n)))(i||n)}}(),n.\u0275cmp=Ne({type:n,selectors:[["mat-select"]],contentQueries:function(t,i,r){if(1&t&&(ei(r,W9,5),ei(r,eS,5),ei(r,JE,5)),2&t){let s;_t(s=yt())&&(i.customTrigger=s.first),_t(s=yt())&&(i.options=s),_t(s=yt())&&(i.optionGroups=s)}},hostAttrs:["role","combobox","aria-autocomplete","none","aria-haspopup","true",1,"mat-select"],hostVars:20,hostBindings:function(t,i){1&t&&ge("keydown",function(s){return i._handleKeydown(s)})("focus",function(){return i._onFocus()})("blur",function(){return i._onBlur()}),2&t&&(nn("id",i.id)("tabindex",i.tabIndex)("aria-controls",i.panelOpen?i.id+"-panel":null)("aria-expanded",i.panelOpen)("aria-label",i.ariaLabel||null)("aria-required",i.required.toString())("aria-disabled",i.disabled.toString())("aria-invalid",i.errorState)("aria-describedby",i._ariaDescribedby||null)("aria-activedescendant",i._getAriaActiveDescendant()),st("mat-select-disabled",i.disabled)("mat-select-invalid",i.errorState)("mat-select-required",i.required)("mat-select-empty",i.empty)("mat-select-multiple",i.multiple))},inputs:{disabled:"disabled",disableRipple:"disableRipple",tabIndex:"tabIndex"},exportAs:["matSelect"],features:[Dt([{provide:jv,useExisting:n},{provide:QE,useExisting:n}]),ct],ngContentSelectors:Rke,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,i){if(1&t&&(wi(Pke),R(0,"div",0,1),ge("click",function(){return i.toggle()}),R(3,"div",2),mt(4,Tke,2,1,"span",3),mt(5,Oke,3,2,"span",4),k(),R(6,"div",5),tt(7,"div",6),k(),k(),mt(8,Ike,4,14,"ng-template",7),ge("backdropClick",function(){return i.close()})("attach",function(){return i._onAttached()})("detach",function(){return i.close()})),2&t){const r=vs(1);nn("aria-owns",i.panelOpen?i.id+"-panel":null),G(3),ie("ngSwitch",i.empty),nn("id",i._valueId),G(1),ie("ngSwitchCase",!0),G(1),ie("ngSwitchCase",!1),G(3),ie("cdkConnectedOverlayPanelClass",i._overlayPanelClass)("cdkConnectedOverlayScrollStrategy",i._scrollStrategy)("cdkConnectedOverlayOrigin",r)("cdkConnectedOverlayOpen",i.panelOpen)("cdkConnectedOverlayPositions",i._positions)("cdkConnectedOverlayMinWidth",null==i._triggerRect?null:i._triggerRect.width)("cdkConnectedOverlayOffsetY",i._offsetY)}},directives:[Pae,Av,ID,sU,Z3,hE],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:[U9.transformPanelWrap,U9.transformPanel]},changeDetection:0}),n})(),q9=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({providers:[Bke],imports:[[dn,Yv,tS,On],Wv,Uv,tS,On]}),n})();function Hke(n,e){if(1&n&&(R(0,"mat-option",5),De(1),k()),2&n){const t=e.$implicit;ie("value",t),G(1),Aw(" ",t.name," (",t.sites.length,") ")}}function $ke(n,e){if(1&n){const t=Zi();R(0,"mat-form-field",1),R(1,"mat-label",2),De(2,"Landmark Set"),k(),R(3,"mat-select",3),ge("selectionChange",function(r){return en(t),Qe().extractionSetChanged(r.value)}),mt(4,Hke,2,3,"mat-option",4),k(),k()}if(2&n){const t=Qe();G(3),ie("value",t.sets[0]),G(1),ie("ngForOf",t.sets)}}let Gke=(()=>{class n{constructor(t){this.ga=t,this.clsName="ccf-extraction-set-dropdown",this.setChange=new Le}extractionSetChanged(t){this.selected=t,this.ga.event("selected_extraction_set_change","extraction_set_dropdown",t.name),this.setChange.emit(t)}isMultiple(){return this.sets.length>1}}return n.\u0275fac=function(t){return new(t||n)(E(xs))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-extraction-set-dropdown"]],hostVars:2,hostBindings:function(t,i){2&t&&Rn(i.clsName)},inputs:{sets:"sets"},outputs:{setChange:"setChange"},decls:1,vars:1,consts:[["class","dropdown-form-field","appearance","fill",4,"ngIf"],["appearance","fill",1,"dropdown-form-field"],[1,"extraction-dropdown-label"],["disableOptionCentering","true","panelClass","extraction-set-panel",3,"value","selectionChange"],["class","extraction-set-options",3,"value",4,"ngFor","ngForOf"],[1,"extraction-set-options",3,"value"]],template:function(t,i){1&t&&mt(0,$ke,5,2,"mat-form-field",0),2&t&&ie("ngIf",i.isMultiple())},directives:[zr,am,Gf,Uke,pl,eS],styles:[".extraction-set-panel{box-shadow:0 0 .3rem .1rem #9e9e9e;position:absolute;top:-1rem;left:1rem;width:10.5rem} .extraction-set-panel .extraction-set-options{height:2.5rem!important} .extraction-set-panel .extraction-set-options:first-child{margin-top:.5rem} .extraction-set-panel .extraction-set-options:last-child{margin-bottom:.5rem}[_nghost-%COMP%] .mat-form-field{width:10.5rem}[_nghost-%COMP%] .mat-form-field .mat-form-field-wrapper{padding-bottom:.5rem}[_nghost-%COMP%] .mat-form-field .mat-form-field-wrapper .mat-form-field-flex{padding:0}[_nghost-%COMP%] .mat-form-field .mat-form-field-wrapper .mat-form-field-underline{bottom:.75rem}[_nghost-%COMP%] .mat-form-field .mat-form-field-wrapper .mat-select-arrow-wrapper{transform:none} .cdk-overlay-pane{min-width:0rem!important}"],changeDetection:0}),n})();function Wke(n,e){if(1&n&&(_f(0),tt(1,"ccf-details-label",19),Kt(2,"async"),yf()),2&n){const t=Qe();G(1),ie("details",rn(2,1,t.detailsLabels$))}}function qke(n,e){if(1&n){const t=Zi();R(0,"div",9),R(1,"ccf-extraction-set-dropdown",20,21),ge("setChange",function(r){return en(t),Qe().model.setExtractionSites(r.sites)}),Kt(3,"async"),k(),R(4,"ccf-visibility-menu",22),ge("itemsChange",function(r){return en(t),Qe().model.setExtractionSites(r)})("hover",function(r){return en(t),Qe().updateExtractionSiteTooltip(r)}),Kt(5,"async"),k(),k()}if(2&n){const t=Qe();G(1),ie("sets",rn(3,2,t.model.extractionSets$)),G(3),ie("items",rn(5,4,t.model.extractionSites$))}}function Yke(n,e){if(1&n&&(R(0,"div",23),De(1),k()),2&n){const t=Qe();G(1),or(" ",t.extractionSiteTooltip," ")}}const Xke=function(){return["Male","Female"]};let Kke=(()=>{class n{constructor(t,i,r){this.page=t,this.model=i,this.registration=r,this.clsName="ccf-left-sidebar",this.disableSlider=!1,this.modalClosed=!1,this.sexByLabel$=this.model.sex$.pipe(Ae(s=>"female"===s?"Female":"Male")),this.sideByLabel$=this.model.side$.pipe(Ae(s=>"left"===s?"L":"R")),this.organSelected$=this.model.organ$.pipe(Ae(s=>void 0!==s)),this.detailsLabels$=Qi([this.model.organ$,this.model.side$,this.model.sex$]).pipe(Ae(([s,o,a])=>[null==s?void 0:s.name,o,a])),this.extractionSiteTooltip="",this.previousVisibilityItems=[...this.model.snapshot.anatomicalStructures],this.organList=qF}updateExtractionSiteTooltip(t){this.extractionSiteTooltip=(null==t?void 0:t.tooltip)?t.tooltip:""}setSexFromLabel(t){this.model.setSex("Female"===t?"female":"male")}setSideFromLabel(t){this.model.setSide("L"===t?"left":"right")}togglePreviousRegistrationBlocks(t){t&&(this.previousVisibilityItems=[...this.model.snapshot.anatomicalStructures]),this.model.toggleRegistrationBlocksVisibility(t,this.previousVisibilityItems)}updateRegistration(t){this.registration.editRegistration(t)}}return n.\u0275fac=function(t){return new(t||n)(E(ji),E(ai),E(Sr))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-left-sidebar"]],hostVars:2,hostBindings:function(t,i){2&t&&Rn(i.clsName)},inputs:{disableSlider:"disableSlider",modalClosed:"modalClosed"},decls:31,vars:22,consts:[[1,"scroll-wrapper"],[1,"container"],[4,"ngIf"],["matTooltip","Select sex to filter organs.",1,"organ-sliders"],[1,"slider-label"],[1,"toggle","gender",3,"disabled","labels","value","valueChange"],[1,"anatomical-structures-menu",3,"expanded"],[1,"expansion-header"],["matTooltip","Use opacity icons to change visibility of anatomical structures",1,"expansion-title"],[1,"expansion-content"],[3,"items","itemsChange"],[1,"extraction-menu",3,"expanded"],["matTooltip","Some organs have predefined landmarks to guide manual tissue registration--you can turn these on/off.",1,"expansion-title"],["class","expansion-content",4,"ngIf"],["toggleLabel","Previously Registered Blocks","matTooltip","If you previously registered tissue blocks, you can turn their positions on/off.",3,"visible","disabled","visibilityChanged"],[1,"space"],["class","extraction-site-tooltip mat-elevation-z8",4,"ngIf"],[1,"filler"],["label","UPLOAD PREVIOUS REGISTRATION DATA",3,"parsedJson"],[3,"details"],[3,"sets","setChange"],["dropdown",""],[3,"items","itemsChange","hover"],[1,"extraction-site-tooltip","mat-elevation-z8"]],template:function(t,i){1&t&&(R(0,"div",0),R(1,"div",1),mt(2,Wke,3,3,"ng-container",2),Kt(3,"async"),R(4,"div",3),R(5,"div",4),De(6,"Donor Sex:"),k(),R(7,"ccf-labeled-slide-toggle",5),ge("valueChange",function(s){return i.setSexFromLabel(s)}),Kt(8,"async"),k(),k(),tt(9,"mat-divider"),R(10,"mat-expansion-panel",6),R(11,"mat-expansion-panel-header",7),R(12,"mat-panel-title",8),De(13,"Anatomical Structures"),k(),k(),R(14,"div",9),R(15,"ccf-visibility-menu",10),ge("itemsChange",function(s){return i.model.setAnatomicalStructures(s)}),Kt(16,"async"),k(),k(),k(),tt(17,"mat-divider"),R(18,"mat-expansion-panel",11),R(19,"mat-expansion-panel-header",7),R(20,"mat-panel-title",12),De(21,"Landmarks"),k(),k(),mt(22,qke,6,6,"div",13),Kt(23,"async"),k(),tt(24,"mat-divider"),R(25,"ccf-visibility-toggle",14),ge("visibilityChanged",function(s){return i.togglePreviousRegistrationBlocks(s)}),Kt(26,"async"),k(),tt(27,"div",15),mt(28,Yke,2,1,"div",16),tt(29,"div",17),R(30,"ccf-json-file-reader",18),ge("parsedJson",function(s){return i.updateRegistration(s)}),k(),k(),k()),2&t&&(G(2),ie("ngIf",rn(3,11,i.page.registrationCallbackSet$)),G(5),ie("disabled",i.disableSlider)("labels",fv(21,Xke))("value",rn(8,13,i.sexByLabel$)),G(3),ie("expanded",i.modalClosed),G(5),ie("items",rn(16,15,i.model.anatomicalStructures$)),G(3),ie("expanded",i.modalClosed),G(4),ie("ngIf",rn(23,17,i.organSelected$)),G(3),ie("visible",rn(26,19,i.model.showPrevious$))("disabled",i.disableSlider),G(3),ie("ngIf",i.extractionSiteTooltip.length>0))},directives:[zr,dc,XF,n9,qM,YM,EW,cke,Cke,Eke,Ske,Gke],pipes:[Hc],styles:["[_nghost-%COMP%]{display:block;height:calc(100% - 3rem);margin-top:1.5rem;margin-bottom:1.5rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%]{overflow-y:scroll;height:100%;margin-right:.375rem;scrollbar-width:thin}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%]::-webkit-scrollbar{width:.75rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%]{display:flex;flex-direction:column;margin-left:1.5rem;margin-right:.375rem;min-height:100%}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .space[_ngcontent-%COMP%]{height:3rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] mat-divider[_ngcontent-%COMP%]{border-top-width:3px}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .ccf-organ-selector[_ngcontent-%COMP%]{margin-top:1.5rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .organ-sliders[_ngcontent-%COMP%]{display:flex;height:3rem;align-items:center}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .organ-sliders[_ngcontent-%COMP%] .slider-label[_ngcontent-%COMP%]{font-weight:600}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] mat-expansion-panel[_ngcontent-%COMP%]{box-shadow:none}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] mat-expansion-panel[_ngcontent-%COMP%] mat-expansion-panel-header[_ngcontent-%COMP%] .expansion-title[_ngcontent-%COMP%]{font-size:1rem;font-weight:600}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .mat-expansion-panel-body{padding:0}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .extraction-menu[_ngcontent-%COMP%] .expansion-header, [_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .anatomical-structures-menu[_ngcontent-%COMP%] .expansion-header{-webkit-user-select:none;-moz-user-select:none;padding:0;font-weight:bold;height:3rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .extraction-menu[_ngcontent-%COMP%] .expansion-header .mat-expansion-indicator, [_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .anatomical-structures-menu[_ngcontent-%COMP%] .expansion-header .mat-expansion-indicator{display:flex;align-items:center;justify-content:center;height:24px;width:24px}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .extraction-menu[_ngcontent-%COMP%] .expansion-content[_ngcontent-%COMP%], [_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .anatomical-structures-menu[_ngcontent-%COMP%] .expansion-content[_ngcontent-%COMP%]{margin-bottom:.75rem;text-align:center;margin-top:2.25rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .extraction-menu[_ngcontent-%COMP%] .expansion-content[_ngcontent-%COMP%] .expansion-placeholder[_ngcontent-%COMP%], [_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .anatomical-structures-menu[_ngcontent-%COMP%] .expansion-content[_ngcontent-%COMP%] .expansion-placeholder[_ngcontent-%COMP%]{width:100%;font-size:.9rem;font-weight:400}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .extraction-site-tooltip[_ngcontent-%COMP%]{position:absolute;top:4rem;left:27rem;width:21rem;padding:1rem;border-radius:.5rem;border:1px solid;z-index:2}[_nghost-%COMP%] .filler[_ngcontent-%COMP%]{flex-grow:1}"],changeDetection:0}),n})(),Zke=(()=>{class n{constructor(t,i,r){this.drawer=t,this.cdr=r,this.className="ccf-drawer-toggle-button",this.position="start",this.opened=!1,this.subscriptions=new Te;const s=i.connect(this);this.subscriptions.add(s.getMessagesFromSource(t).subscribe(o=>{this.handleMessage(o)&&r.markForCheck()}))}get classEnd(){return"end"===this.position}get icon(){let t="arrow_right",i="arrow_left";return"end"===this.position&&([t,i]=[i,t]),this.opened?i: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:i,expanded:r}=t;i?r?t.closeExpanded():t.close():t.open()}}return n.\u0275fac=function(t){return new(t||n)(E(ZF),E(_0),E(kn))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-drawer-toggle-button"]],hostVars:4,hostBindings:function(t,i){2&t&&(Rn(i.className),st("ccf-drawer-toggle-button-end",i.classEnd))},decls:4,vars:4,consts:[["aria-hidden","false","aria-label","Close side drawer",1,"expand-collapse-icon",3,"click"]],template:function(t,i){1&t&&(R(0,"mat-icon",0),ge("click",function(){return i.toggle()}),De(1," arrow_right\n"),k(),R(2,"mat-icon",0),ge("click",function(){return i.toggle()}),De(3," arrow_left\n"),k()),2&t&&(st("hidden","arrow_left"===i.icon),G(2),st("hidden","arrow_right"===i.icon))},directives:[rs],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;transition:.25s}.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:absolute;right:0rem;transition:.6s;padding-left:.15rem}[_nghost-%COMP%] .expand-collapse-icon.hidden[_ngcontent-%COMP%]{opacity:0}.ccf-drawer-toggle-button-end[_nghost-%COMP%] .expand-collapse-icon[_ngcontent-%COMP%]{right:unset;left:-.25rem}.mat-icon[_ngcontent-%COMP%]{right:.3rem;top:.675rem;padding-top:.05rem}"],changeDetection:0}),n})();const Y9={x:10,y:10,z:10};let Qke=(()=>{class n{constructor(t){this.ga=t,this.clsName="ccf-block-size-input",this.blockSize=Y9,this.blockSizeChange=new Le}updateBlockSizes(t,i){const r=t.target;this.blockSize=Object.assign(Object.assign({},this.blockSize),{[i]:+r.value}),this.ga.event("block_size_change","block_size_input",i,this.blockSize[i]),this.blockSizeChange.emit(this.blockSize)}refreshBlockSize(){this.blockSize=Y9,this.ga.event("block_size_reset","block_size_input"),this.blockSizeChange.emit(this.blockSize)}}return n.\u0275fac=function(t){return new(t||n)(E(xs))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-block-size-input"]],hostVars:2,hostBindings:function(t,i){2&t&&Rn(i.clsName)},inputs:{blockSize:"blockSize"},outputs:{blockSizeChange:"blockSizeChange"},decls:19,vars:5,consts:[["matTooltip","Set the tissue block width, height and depth (dimensions)",1,"header"],[1,"text","title"],[1,"filler"],["matRipple","",1,"icon","refresh",3,"matRippleCentered","matRippleUnbounded","click"],[1,"size-inputs"],["floatLabel","always",1,"field"],[1,"text","label"],["matInput","","type","number","placeholder","","matTooltip","Enter tissue block width.",1,"input",3,"value","input"],["matInput","","type","number","placeholder","","matTooltip","Enter tissue block height.",1,"input",3,"value","input"],["matInput","","type","number","placeholder","","matTooltip","Enter tissue block depth.",1,"input",3,"value","input"]],template:function(t,i){1&t&&(R(0,"div",0),R(1,"span",1),De(2,"Tissue Block Dimensions (mm)"),k(),tt(3,"div",2),R(4,"mat-icon",3),ge("click",function(){return i.refreshBlockSize()}),De(5,"refresh"),k(),k(),R(6,"div",4),R(7,"mat-form-field",5),R(8,"mat-label",6),De(9,"Width (X)"),k(),R(10,"input",7),ge("input",function(s){return i.updateBlockSizes(s,"x")}),k(),k(),R(11,"mat-form-field",5),R(12,"mat-label",6),De(13,"Height (Y)"),k(),R(14,"input",8),ge("input",function(s){return i.updateBlockSizes(s,"y")}),k(),k(),R(15,"mat-form-field",5),R(16,"mat-label",6),De(17,"Depth (Z)"),k(),R(18,"input",9),ge("input",function(s){return i.updateBlockSizes(s,"z")}),k(),k(),k()),2&t&&(G(4),ie("matRippleCentered",!0)("matRippleUnbounded",!0),G(6),ie("value",i.blockSize.x),G(4),ie("value",i.blockSize.y),G(4),ie("value",i.blockSize.z))},directives:[dc,rs,Js,am,Gf,Xb],styles:["[_nghost-%COMP%] input[type=number][_ngcontent-%COMP%]{-moz-appearance:textfield}[_nghost-%COMP%] .header[_ngcontent-%COMP%]{display:flex;height:1.5rem;align-items:center}[_nghost-%COMP%] .header[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-weight:600}[_nghost-%COMP%] .header[_ngcontent-%COMP%] .refresh[_ngcontent-%COMP%]{transform:scaleX(-1);cursor:pointer;transition:.6s}[_nghost-%COMP%] .header[_ngcontent-%COMP%] .refresh[_ngcontent-%COMP%]:hover{border-radius:2px}[_nghost-%COMP%] .size-inputs[_ngcontent-%COMP%]{display:flex}[_nghost-%COMP%] .size-inputs[_ngcontent-%COMP%] .field[_ngcontent-%COMP%]{width:33.33%}[_nghost-%COMP%] .size-inputs[_ngcontent-%COMP%] .field[_ngcontent-%COMP%]:not(:last-child){padding-right:.75rem}[_nghost-%COMP%] .size-inputs[_ngcontent-%COMP%] .field[_ngcontent-%COMP%] .input[_ngcontent-%COMP%]{text-align:center}[_nghost-%COMP%] .filler[_ngcontent-%COMP%]{flex-grow:1}"],changeDetection:0}),n})();const X9={thickness:NaN,numSlices:NaN};let Jke=(()=>{class n{constructor(t){this.ga=t,this.clsName="ccf-slices-input",this.slicesConfig=X9,this.slicesConfigChange=new Le}get hasThicknessValue(){return!isNaN(this.slicesConfig.thickness)}updateSlicesData(t,i){const{value:r}=t.target;this.slicesConfig=Object.assign(Object.assign({},this.slicesConfig),{[i]:""!==r?+r:NaN}),this.ga.event("slice_config_update","slice_input",i,this.slicesConfig[i]),this.slicesConfigChange.emit(this.slicesConfig)}refreshSlices(){this.slicesConfig=X9,this.ga.event("slice_config_reset","slice_input"),this.slicesConfigChange.emit(this.slicesConfig)}}return n.\u0275fac=function(t){return new(t||n)(E(xs))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-slices-input"]],hostVars:2,hostBindings:function(t,i){2&t&&Rn(i.clsName)},inputs:{slicesConfig:"slicesConfig"},outputs:{slicesConfigChange:"slicesConfigChange"},decls:17,vars:6,consts:[[1,"header"],["matTooltip","\u201cAdd thickness of tissue sections and the total number of sections",1,"text","title"],[1,"filler"],["matRipple","",1,"icon","refresh",3,"matRippleCentered","matRippleUnbounded","click"],[1,"slices-inputs"],[1,"field"],[1,"text","label"],["matInput","","ccfNumbersOnly","","type","number","matTooltip","Enter thickness of tissue sections",1,"input",3,"value","input"],["matSuffix","",1,"suffix"],["matInput","","ccfNumbersOnly","","type","number","matTooltip","Enter total number of sections",1,"input",3,"value","input"]],template:function(t,i){1&t&&(R(0,"div",0),R(1,"span",1),De(2,"Tissue Sections"),k(),tt(3,"div",2),R(4,"mat-icon",3),ge("click",function(){return i.refreshSlices()}),De(5," refresh "),k(),k(),R(6,"div",4),R(7,"mat-form-field",5),R(8,"mat-label",6),De(9,"Thickness"),k(),R(10,"input",7),ge("input",function(s){return i.updateSlicesData(s,"thickness")}),k(),R(11,"div",8),De(12,"\u03bcm"),k(),k(),R(13,"mat-form-field",5),R(14,"mat-label",6),De(15,"# Sections"),k(),R(16,"input",9),ge("input",function(s){return i.updateSlicesData(s,"numSlices")}),k(),k(),k()),2&t&&(G(4),ie("matRippleCentered",!0)("matRippleUnbounded",!0),G(6),ie("value",i.slicesConfig.thickness),G(1),st("show",i.hasThicknessValue),G(5),ie("value",i.slicesConfig.numSlices))},directives:[dc,rs,Js,am,Gf,Xb,WPe,VO],styles:["[_nghost-%COMP%] input[type=number][_ngcontent-%COMP%]{-moz-appearance:textfield}[_nghost-%COMP%] .header[_ngcontent-%COMP%]{display:flex;align-items:center;height:1.5rem}[_nghost-%COMP%] .header[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-weight:600}[_nghost-%COMP%] .header[_ngcontent-%COMP%] .refresh[_ngcontent-%COMP%]{transform:scaleX(-1);cursor:pointer;transition:.6s}[_nghost-%COMP%] .header[_ngcontent-%COMP%] .refresh[_ngcontent-%COMP%]:hover{border-radius:2px}[_nghost-%COMP%] .slices-inputs[_ngcontent-%COMP%]{display:flex}[_nghost-%COMP%] .slices-inputs[_ngcontent-%COMP%] .field[_ngcontent-%COMP%]{width:33.33%}[_nghost-%COMP%] .slices-inputs[_ngcontent-%COMP%] .field[_ngcontent-%COMP%]:not(:last-child){padding-right:.75rem}[_nghost-%COMP%] .slices-inputs[_ngcontent-%COMP%] .field[_ngcontent-%COMP%] .input[_ngcontent-%COMP%]{text-align:center}[_nghost-%COMP%] .slices-inputs[_ngcontent-%COMP%] .field[_ngcontent-%COMP%] .suffix[_ngcontent-%COMP%]{display:none}[_nghost-%COMP%] .slices-inputs[_ngcontent-%COMP%] .field.mat-focused[_ngcontent-%COMP%] .suffix[_ngcontent-%COMP%], [_nghost-%COMP%] .slices-inputs[_ngcontent-%COMP%] .field[_ngcontent-%COMP%] .suffix.show[_ngcontent-%COMP%]{display:initial}[_nghost-%COMP%] .filler[_ngcontent-%COMP%]{flex-grow:1}"],changeDetection:0}),n})();const K9={x:0,y:0,z:0};let eFe=(()=>{class n{constructor(t){this.ga=t,this.clsName="ccf-rotation-slider",this.rotation=K9,this.rotationChange=new Le}changeRotation(t,i){this.rotation=Object.assign(Object.assign({},this.rotation),{[i]:+t}),this.ga.event("rotation_update","rotation_slider",i,+t),this.rotationChange.emit(this.rotation)}resetRotation(){this.rotation=K9,this.ga.event("rotation_reset","rotation_slider"),this.rotationChange.emit(this.rotation)}}return n.\u0275fac=function(t){return new(t||n)(E(xs))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-rotation-slider"]],hostVars:2,hostBindings:function(t,i){2&t&&Rn(i.clsName)},inputs:{rotation:"rotation"},outputs:{rotationChange:"rotationChange"},decls:27,vars:23,consts:[[1,"header"],["matTooltip","Use sliders below to rotate tissue block for registration",1,"text","title"],[1,"filler"],["matRipple","",1,"icon","reset",3,"matRippleCentered","matRippleUnbounded","click"],[1,"slider-box","red"],[1,"text","label"],[1,"slider-container"],[1,"slider",3,"max","min","step","thumbLabel","tickInterval","value","input"],[1,"text","value"],[1,"slider-box","green"],[1,"slider-box","blue"]],template:function(t,i){1&t&&(R(0,"div",0),R(1,"span",1),De(2,"Tissue Block Rotation"),k(),tt(3,"div",2),R(4,"mat-icon",3),ge("click",function(){return i.resetRotation()}),De(5,"refresh"),k(),k(),R(6,"div",4),R(7,"span",5),De(8,"X"),k(),R(9,"div",6),R(10,"mat-slider",7),ge("input",function(s){return i.changeRotation(s.value,"x")}),k(),k(),R(11,"span",8),De(12),k(),k(),R(13,"div",9),R(14,"span",5),De(15,"Y"),k(),R(16,"div",6),R(17,"mat-slider",7),ge("input",function(s){return i.changeRotation(s.value,"y")}),k(),k(),R(18,"span",8),De(19),k(),k(),R(20,"div",10),R(21,"span",5),De(22,"Z"),k(),R(23,"div",6),R(24,"mat-slider",7),ge("input",function(s){return i.changeRotation(s.value,"z")}),k(),k(),R(25,"span",8),De(26),k(),k()),2&t&&(G(4),ie("matRippleCentered",!0)("matRippleUnbounded",!0),G(6),ie("max",180)("min",-180)("step",1)("thumbLabel",!0)("tickInterval",180)("value",i.rotation.x),G(2),xi(i.rotation.x),G(5),ie("max",180)("min",-180)("step",1)("thumbLabel",!0)("tickInterval",180)("value",i.rotation.y),G(2),xi(i.rotation.y),G(5),ie("max",180)("min",-180)("step",1)("thumbLabel",!0)("tickInterval",180)("value",i.rotation.z),G(2),xi(i.rotation.z))},directives:[dc,rs,Js,jk],styles:["[_nghost-%COMP%] .header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;height:1.5rem}[_nghost-%COMP%] .header[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-weight:600}[_nghost-%COMP%] .header[_ngcontent-%COMP%] .reset[_ngcontent-%COMP%]{transform:scaleX(-1);cursor:pointer;transition:.6s}[_nghost-%COMP%] .header[_ngcontent-%COMP%] .reset[_ngcontent-%COMP%]:hover{border-radius:2px}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;height:4rem;padding-left:.5rem}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{width:1rem}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .value[_ngcontent-%COMP%]{width:2.75rem;text-align:center}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .slider-container[_ngcontent-%COMP%]{width:100%;padding:1rem 2rem}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .slider-container[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%]{width:100%}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .slider-container[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%]:not(.cdk-focused) .mat-slider-thumb{width:1.25rem;height:1.25rem;transform:none}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .slider-container[_ngcontent-%COMP%] .mat-slider-horizontal .mat-slider-wrapper{right:.625rem}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .slider-container[_ngcontent-%COMP%] .mat-slider-horizontal .mat-slider-wrapper:after{margin-top:-.25rem;height:.625rem!important}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .slider-container[_ngcontent-%COMP%] .mat-slider-horizontal .mat-slider-ticks-container{margin-top:-.25rem;height:.625rem}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .slider-container[_ngcontent-%COMP%] .mat-slider-horizontal .mat-slider-ticks-container .mat-slider-ticks{height:.625rem}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .filler[_ngcontent-%COMP%]{flex-grow:1}"],changeDetection:0}),n})();function nFe(n){const{subscriber:e,counter:t,period:i}=n;e.next(t),this.schedule({subscriber:e,counter:t+1,period:i},i)}const iFe=["closeSearch"];function rFe(n,e){if(1&n){const t=Zi();R(0,"div",12),R(1,"mat-checkbox",13),ge("ngModelChange",function(r){const o=en(t).$implicit;return Qe(2).checkedResults[o.id]=r}),De(2),k(),k()}if(2&n){const t=e.$implicit,i=Qe(2);G(1),ie("ngModel",i.checkedResults[t.id]),G(1),or(" ",t.label," ")}}function sFe(n,e){if(1&n&&(R(0,"div",9),mt(1,rFe,3,2,"div",10),R(2,"div",11),De(3),Kt(4,"i18nPlural"),k(),k()),2&n){const t=Qe();G(1),ie("ngForOf",t.searchResults.results)("ngForTrackBy",t.tagId),G(2),or(" ",gv(4,3,t.searchResults.totalCount,t.countMapping)," ")}}const Z9=5,Ex={totalCount:0,results:[]};class Ep{constructor(e,t,i){this.el=e,this.ga=t,this.clsName="ccf-tag-search",this.placeholder="Add Anatomical Structures ...",this.added=new Le,this.countMapping={"=1":"1 result",other:"# results"},this.searchControl=new Sh,this.searchResults=Ex,this.checkedResults={},this.resultsVisible=!1,this.destroy$=new Se,this.searchControl.valueChanges.pipe(Tn(this.destroy$),function(n,e=uW){return t=>t.lift(new z1e(n,!!e.leading,!!e.trailing))}(()=>{var r;return function(n=0,e=Pf){return(!WO(n)||n<0)&&(n=0),(!e||"function"!=typeof e.schedule)&&(e=Pf),new ce(t=>(t.add(e.schedule(nFe,n,{subscriber:t,counter:0,period:n})),t))}(null!==(r=this.searchThrottle)&&void 0!==r?r:100)},{leading:!0,trailing:!0}),Pr(this.executeSearch)).subscribe(r=>{this.searchResults=r,this.checkedResults=this.getUpdatedCheckedResults(r),i.markForCheck()})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}tagId(e,t){return t.id}hasCheckedTags(){return Object.values(this.checkedResults).some(e=>e)}addTags(){const{searchControl:e,searchResults:t,checkedResults:i}=this,r=t.results.filter(s=>i[s.id]);r.length>0&&(e.reset(),this.searchResults=Ex,this.checkedResults={},this.ga.event("tags_added","tag_search",r.map(s=>s.label).join(",")),this.added.emit(r))}openResults(){this.resultsVisible||(this.resultsVisible=!0)}closeResults(e){const{closeSearch:t}=this;this.resultsVisible&&e.target instanceof Node&&(!this.el.nativeElement.contains(e.target)||t.nativeElement.contains(e.target))&&(this.resultsVisible=!1)}executeSearch(e){const{search:t,searchLimit:i=Z9}=this;return e&&t?ui(t(e,i)).pipe(Ta(()=>[Ex]),Ae(this.truncateResults)):[Ex]}truncateResults(e){const{searchLimit:t=Z9}=this,i=e.results;return i.length>t?Object.assign(Object.assign({},e),{results:i.slice(0,t)}):e}getUpdatedCheckedResults(e){const t=this.checkedResults;return e.results.reduce((i,{id:r})=>{var s;return i[r]=null!==(s=t[r])&&void 0!==s&&s,i},{})}}function aFe(n,e){if(1&n&&(R(0,"div",11),R(1,"div",12),De(2),k(),R(3,"div",13),De(4),k(),k()),2&n){const t=e.$implicit;G(2),xi(t.label),G(2),xi(t.value)}}Ep.\u0275fac=function(e){return new(e||Ep)(E(rt),E(xs),E(kn))},Ep.\u0275cmp=Ne({type:Ep,selectors:[["ccf-tag-search"]],viewQuery:function(e,t){if(1&e&&Jn(iFe,5,rt),2&e){let i;_t(i=yt())&&(t.closeSearch=i.first)}},hostVars:2,hostBindings:function(e,t){1&e&&ge("click",function(){return t.openResults()})("focusin",function(){return t.openResults()})("click",function(r){return t.closeResults(r)},!1,ly)("focusin",function(r){return t.closeResults(r)},!1,ly),2&e&&Rn(t.clsName)},inputs:{placeholder:"placeholder",search:"search",searchLimit:"searchLimit",searchThrottle:"searchThrottle"},outputs:{added:"added"},decls:10,vars:8,consts:[[1,"spacer"],["appearance","outline",1,"overlay"],[1,"search-box"],["matInput","","type","search",3,"placeholder","formControl"],["search",""],["matSuffix","",1,"add-button",3,"disabled","click"],["closeSearch",""],[1,"icon"],["class","results",4,"ngIf"],[1,"results"],["class","item",4,"ngFor","ngForOf","ngForTrackBy"],[1,"count"],[1,"item"],["labelPosition","after",3,"ngModel","ngModelChange"]],template:function(e,t){if(1&e){const i=Zi();tt(0,"div",0),R(1,"mat-form-field",1),R(2,"div",2),tt(3,"input",3,4),R(5,"button",5,6),ge("click",function(){en(i);const s=vs(4);return t.addTags(),s.focus()}),R(7,"mat-icon",7),De(8,"add"),k(),k(),k(),mt(9,sFe,5,6,"div",8),k()}2&e&&(G(1),st("expanded",t.resultsVisible),G(2),ie("placeholder",t.placeholder)("formControl",t.searchControl),G(2),st("active",t.hasCheckedTags()),ie("disabled",!t.hasCheckedTags()),G(4),ie("ngIf",t.resultsVisible))},directives:[am,Xb,Hb,vk,GM,VO,rs,zr,pl,VF,Ok],pipes:[eV],styles:["[_nghost-%COMP%]{display:block;position:relative}[_nghost-%COMP%] .spacer[_ngcontent-%COMP%]{height:3.25rem}[_nghost-%COMP%] .overlay[_ngcontent-%COMP%]{position:absolute;top:0;left:0;right:0;z-index:10}[_nghost-%COMP%] .overlay[_ngcontent-%COMP%] .search-box[_ngcontent-%COMP%]{display:flex;width:100%;align-items:center;height:3rem}[_nghost-%COMP%] .overlay[_ngcontent-%COMP%] .search-box[_ngcontent-%COMP%] .add-button[_ngcontent-%COMP%]{border-radius:.25rem;border:none;display:flex;justify-content:center;align-items:center;cursor:pointer;height:100%}[_nghost-%COMP%] .overlay[_ngcontent-%COMP%] .results[_ngcontent-%COMP%]{margin-top:.5rem}[_nghost-%COMP%] .overlay[_ngcontent-%COMP%] .results[_ngcontent-%COMP%] .count[_ngcontent-%COMP%]{margin-top:.5rem;font-size:.75rem;text-align:end}[_nghost-%COMP%] .overlay[_ngcontent-%COMP%] .mat-form-field-wrapper{padding-bottom:0;border-radius:.5rem}[_nghost-%COMP%] .overlay[_ngcontent-%COMP%] .mat-form-field-wrapper .mat-form-field-flex{padding-right:0!important}[_nghost-%COMP%] .overlay[_ngcontent-%COMP%] .mat-form-field-outline{opacity:1!important}[_nghost-%COMP%] .overlay[_ngcontent-%COMP%] .mat-form-field-outline-thick{opacity:0!important}[_nghost-%COMP%] .overlay[_ngcontent-%COMP%] .mat-form-field-infix{padding:.313rem .063rem .063rem;border:0}[_nghost-%COMP%] .overlay.expanded[_ngcontent-%COMP%] .mat-form-field-wrapper{box-shadow:0 0 .3rem .1rem #9e9e9e5e}"],changeDetection:0}),xe([lu.ak],Ep.prototype,"executeSearch",null),xe([lu.ak],Ep.prototype,"truncateResults",null);let lFe=(()=>{class n{constructor(t,i){this.dialogRef=t,this.data=i,this.clsName="ccf-review-modal",this.metaData=i.metaData,this.registrationCallbackSet=i.registrationCallbackSet}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 n.\u0275fac=function(t){return new(t||n)(E(Qm),E(Gk))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-review-modal"]],hostVars:2,hostBindings:function(t,i){2&t&&Rn(i.clsName)},decls:14,vars:2,consts:[[1,"ccf-about","wrapper"],[1,"container"],[1,"close"],[1,"material-icons","close-icon",3,"click"],[1,"content"],["mat-dialog-title","",1,"title"],[1,"mat-typography"],[1,"display-fields"],["class","field",4,"ngFor","ngForOf"],[1,"footer"],["mat-button","",1,"download-button",3,"click"],[1,"field"],[1,"label"],[1,"data"]],template:function(t,i){1&t&&(R(0,"div",0),R(1,"div",1),R(2,"div",2),R(3,"mat-icon",3),ge("click",function(){return i.close()}),De(4,"clear"),k(),k(),R(5,"div",4),R(6,"h2",5),De(7,"Registration Review"),k(),R(8,"mat-dialog-content",6),R(9,"div",7),mt(10,aFe,5,2,"div",8),k(),k(),R(11,"div",9),R(12,"button",10),ge("click",function(){return i.dialogRef.close(!0)}),De(13),k(),k(),k(),k(),k()),2&t&&(G(10),ie("ngForOf",i.metaData),G(3),xi(i.registrationCallbackSet?"REGISTER":"DOWNLOAD REGISTRATION DATA"))},directives:[rs,Wk,qk,pl,lh],styles:[".mat-dialog-container{padding:0}[_nghost-%COMP%] .ccf-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .content[_ngcontent-%COMP%]{padding:3rem;background-color:#fff}[_nghost-%COMP%] .ccf-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .content[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{text-align:center;font-size:1.5rem;margin-bottom:0}[_nghost-%COMP%] .ccf-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .content[_ngcontent-%COMP%] .mat-typography[_ngcontent-%COMP%]{justify-content:space-around;display:flex}[_nghost-%COMP%] .ccf-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .content[_ngcontent-%COMP%] .mat-typography[_ngcontent-%COMP%] .display-fields[_ngcontent-%COMP%]{margin-top:2rem;margin-bottom:2rem;width:100%}[_nghost-%COMP%] .ccf-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .content[_ngcontent-%COMP%] .mat-typography[_ngcontent-%COMP%] .display-fields[_ngcontent-%COMP%] .field[_ngcontent-%COMP%]{display:flex}[_nghost-%COMP%] .ccf-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .content[_ngcontent-%COMP%] .mat-typography[_ngcontent-%COMP%] .display-fields[_ngcontent-%COMP%] .field[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{width:50%;text-align:right;padding-right:1rem}[_nghost-%COMP%] .ccf-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .content[_ngcontent-%COMP%] .mat-typography[_ngcontent-%COMP%] .display-fields[_ngcontent-%COMP%] .field[_ngcontent-%COMP%] .data[_ngcontent-%COMP%]{width:50%;text-align:left;padding-left:1rem}[_nghost-%COMP%] .ccf-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .close[_ngcontent-%COMP%] .close-icon[_ngcontent-%COMP%]{float:right;margin-top:1rem;margin-right:1rem;cursor:pointer}[_nghost-%COMP%] .ccf-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .footer[_ngcontent-%COMP%]{padding-top:1.5rem;display:flex;justify-content:space-around}[_nghost-%COMP%] .ccf-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .footer[_ngcontent-%COMP%] .review-button[_ngcontent-%COMP%]{height:3rem;transition:.6s}"]}),n})(),cFe=(()=>{class n{constructor(t,i){this.dialog=t,this.ga=i,this.clsName="ccf-review-button",this.registrationCallbackSet=!0,this.metaData=[],this.displayErrors=!0,this.registrationIsValid=!1,this.registerData=new Le,this.enterErrorMode=new Le}ngOnChanges(){this.registrationIsValid=this.metaData.length>=3&&this.metaData.slice(0,3).every(t=>t.value)}get disabled(){return!this.registrationIsValid}registerButtonClick(t){return t&&t.preventDefault(),this.enterErrorMode.emit(),this.registrationIsValid&&(this.ga.event("review_start","review_button"),this.launchReviewModal()),!1}launchReviewModal(){this.dialog.open(lFe,{panelClass:"modal-animated",width:"60rem",data:{registrationCallbackSet:this.registrationCallbackSet,metaData:this.metaData}}).afterClosed().subscribe(i=>{i&&(this.ga.event("register","review_button"),this.registerData.emit())})}}return n.\u0275fac=function(t){return new(t||n)(E(_p),E(xs))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-review-button"]],hostVars:2,hostBindings:function(t,i){2&t&&Rn(i.clsName)},inputs:{registrationCallbackSet:"registrationCallbackSet",metaData:"metaData",displayErrors:"displayErrors",registrationIsValid:"registrationIsValid"},outputs:{registerData:"registerData",enterErrorMode:"enterErrorMode"},features:[zn],decls:2,vars:4,consts:[["mat-button","",1,"review-button",3,"matTooltip","click"]],template:function(t,i){1&t&&(R(0,"button",0),ge("click",function(s){return i.registerButtonClick(s)}),De(1),k()),2&t&&(st("disabled",i.disabled),ie("matTooltip",i.disabled?"Required: Select an organ and position tissue block inside organ.":"Review registration and submit/download."),G(1),or(" ",i.registrationCallbackSet?"REVIEW AND REGISTER":"REVIEW AND DOWNLOAD","\n"))},directives:[lh,dc],styles:[".review-button[_ngcontent-%COMP%]{width:100%;height:2.25rem;transition:.6s;font-weight:500}.review-button.disabled[_ngcontent-%COMP%]{cursor:not-allowed}"]}),n})();function uFe(n,e){if(1&n){const t=Zi();R(0,"mat-chip",2),ge("removed",function(){const s=en(t).$implicit;return Qe().removeTag(s)}),De(1),R(2,"mat-icon",3),De(3,"cancel"),k(),k()}if(2&n){const t=e.$implicit;Rn(Qe().tagClasses(t)),G(1),or(" ",t.label," ")}}let dFe=(()=>{class n{constructor(t){this.ga=t,this.clsName="ccf-tag-list",this.tagRemoved=new Le,this.tagsChange=new Le}tagId(t,i){return i.id}tagClasses(t){return"added"===t.type?["added"]:["assigned"]}removeTag(t){this.tags=this.tags.filter(i=>i!==t),this.ga.event("tag_removed","tag_list",t.label),this.tagRemoved.emit(t),this.tagsChange.emit(this.tags)}}return n.\u0275fac=function(t){return new(t||n)(E(xs))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-tag-list"]],hostVars:2,hostBindings:function(t,i){2&t&&Rn(i.clsName)},inputs:{tags:"tags"},outputs:{tagRemoved:"tagRemoved",tagsChange:"tagsChange"},decls:2,vars:2,consts:[["selectable","false"],["removable","","disableRipple","",3,"class","removed",4,"ngFor","ngForOf","ngForTrackBy"],["removable","","disableRipple","",3,"removed"],["matChipRemove","",1,"icon","remove"]],template:function(t,i){1&t&&(R(0,"mat-chip-list",0),mt(1,uFe,4,3,"mat-chip",1),k()),2&t&&(G(1),ie("ngForOf",i.tags)("ngForTrackBy",i.tagId))},directives:[z9,pl,y0,rs,B9],styles:["[_nghost-%COMP%]{display:block;overflow-x:hidden;overflow-y:auto}[_nghost-%COMP%] .mat-chip-list-wrapper{margin:0}"],changeDetection:0}),n})();function hFe(n,e){if(1&n){const t=Zi();R(0,"ccf-tag-list",20),ge("tagRemoved",function(r){return en(t),Qe().astags.removeTag(r)}),Kt(1,"async"),k()}2&n&&ie("tags",rn(1,1,Qe().astags.tags$))}function fFe(n,e){}const pFe=function(){return[]};let gFe=(()=>{class n{constructor(t,i,r,s){this.model=t,this.registration=i,this.page=r,this.astags=s,this.clsName="ccf-right-sidebar",this.modalClosed=!1}}return n.\u0275fac=function(t){return new(t||n)(E(ai),E(Sr),E(ji),E(ko))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-right-sidebar"]],hostVars:2,hostBindings:function(t,i){2&t&&Rn(i.clsName)},inputs:{modalClosed:"modalClosed"},decls:34,vars:28,consts:[[1,"scroll-wrapper"],[1,"container"],[1,"info-button-container"],["videoID","gY3_-LIoKaU","infoTitle","CCF Registration User Interface","documentationUrl","assets/docs/README.md"],[3,"blockSize","blockSizeChange"],[3,"slicesConfig","slicesConfigChange"],[3,"rotation","rotationChange"],[1,"tags-container",3,"expanded"],[1,"header"],["matTooltip","Review tags generated via collision detection. Add or delete tags as needed."],[3,"search","added"],["class","tag-list",3,"tags","tagRemoved",4,"ngIf","ngIfElse"],["tagListPlaceholder",""],[1,"legend"],[1,"dot","assigned"],[1,"text","assigned"],[1,"dot","added"],[1,"text","added"],[1,"filler"],[3,"registrationCallbackSet","displayErrors","registrationIsValid","metaData","registerData","enterErrorMode"],[1,"tag-list",3,"tags","tagRemoved"]],template:function(t,i){if(1&t&&(R(0,"div",0),R(1,"div",1),R(2,"div",2),tt(3,"ccf-info-button",3),k(),R(4,"ccf-block-size-input",4),ge("blockSizeChange",function(s){return i.model.setBlockSize(s)}),Kt(5,"async"),k(),R(6,"ccf-slices-input",5),ge("slicesConfigChange",function(s){return i.model.setSlicesConfig(s)}),Kt(7,"async"),k(),R(8,"ccf-rotation-slider",6),ge("rotationChange",function(s){return i.model.setRotation(s)}),Kt(9,"async"),k(),tt(10,"mat-divider"),R(11,"mat-expansion-panel",7),R(12,"mat-expansion-panel-header",8),R(13,"mat-panel-title",9),De(14,"Anatomical Structure Tags"),k(),k(),R(15,"ccf-tag-search",10),ge("added",function(s){return i.astags.addTags(s)}),k(),mt(16,hFe,2,3,"ccf-tag-list",11),Kt(17,"async"),mt(18,fFe,0,0,"ng-template",null,12,jw),R(20,"div",13),tt(21,"span",14),R(22,"span",15),De(23,"Assigned"),k(),tt(24,"span",16),R(25,"span",17),De(26,"Added"),k(),k(),k(),tt(27,"mat-divider"),tt(28,"div",18),R(29,"ccf-review-button",19),ge("registerData",function(){return i.registration.register()})("enterErrorMode",function(){return i.registration.setDisplayErrors(!i.registration.isValid)}),Kt(30,"async"),Kt(31,"async"),Kt(32,"async"),Kt(33,"async"),k(),k(),k()),2&t){const r=vs(19);let s,o;G(4),ie("blockSize",rn(5,11,i.model.blockSize$)),G(2),ie("slicesConfig",rn(7,13,i.model.slicesConfig$)),G(2),ie("rotation",rn(9,15,i.model.rotation$)),G(3),ie("expanded",i.modalClosed),G(4),ie("search",i.astags.searchExternal),G(1),ie("ngIf",null==(s=rn(17,17,i.model.organ$))?null:s.name)("ngIfElse",r),G(13),ie("registrationCallbackSet",rn(30,19,i.page.registrationCallbackSet$))("displayErrors",rn(31,21,i.registration.displayErrors$))("registrationIsValid",rn(32,23,i.registration.valid$))("metaData",null!==(o=rn(33,25,i.registration.metadata$))&&void 0!==o?o:fv(27,pFe))}},directives:[UPe,Qke,Jke,eFe,n9,qM,YM,EW,dc,Ep,zr,cFe,dFe],pipes:[Hc],styles:["[_nghost-%COMP%]{display:block;height:calc(100% - 3rem);margin-top:1.5rem;margin-bottom:1.5rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%]{height:100%;margin-right:.375rem;scrollbar-width:thin}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%]::-webkit-scrollbar{width:.75rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%]{display:flex;flex-direction:column;min-height:100%;margin-left:1.5rem;margin-right:.375rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .info-button-container[_ngcontent-%COMP%]{height:3.75rem;display:flex;justify-content:flex-end}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] mat-divider[_ngcontent-%COMP%]{border-top-width:3px}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] mat-expansion-panel[_ngcontent-%COMP%]{box-shadow:none}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] mat-expansion-panel[_ngcontent-%COMP%] mat-expansion-panel-header[_ngcontent-%COMP%]{padding:0 .5rem 0 0;font-weight:bold;-webkit-user-select:none;-moz-user-select:none;font-size:1rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .tags-container[_ngcontent-%COMP%]{overflow:visible}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .tags-container[_ngcontent-%COMP%] .mat-expansion-panel-body{padding-left:0;padding-right:0}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .tags-container[_ngcontent-%COMP%] .header[_ngcontent-%COMP%]{height:3rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .tags-container[_ngcontent-%COMP%] .search[_ngcontent-%COMP%]{margin-top:1rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .tags-container[_ngcontent-%COMP%] .search[_ngcontent-%COMP%] .icon.add[_ngcontent-%COMP%]{position:absolute;width:3.625rem;height:3.625rem;font-size:3.625rem;top:-1.9375rem;right:-1.1875rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .tags-container[_ngcontent-%COMP%] .tag-list[_ngcontent-%COMP%]{max-height:32rem;margin-left:-1rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .tags-container[_ngcontent-%COMP%] .tag-list-placeholder[_ngcontent-%COMP%]{display:flex;height:4rem;align-items:center;justify-content:center;font-weight:400}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .tags-container[_ngcontent-%COMP%] .legend[_ngcontent-%COMP%]{display:flex;width:100%;margin-top:1.5rem;align-items:center;font-size:.9rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .tags-container[_ngcontent-%COMP%] .legend[_ngcontent-%COMP%] .dot[_ngcontent-%COMP%]{display:inline-block;width:1rem;height:1rem;border-radius:50%}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .tags-container[_ngcontent-%COMP%] .legend[_ngcontent-%COMP%] .dot.assigned[_ngcontent-%COMP%]{margin-left:.5rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .tags-container[_ngcontent-%COMP%] .legend[_ngcontent-%COMP%] .dot.added[_ngcontent-%COMP%]{margin-left:1rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .tags-container[_ngcontent-%COMP%] .legend[_ngcontent-%COMP%] .text[_ngcontent-%COMP%]{margin-left:.5rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .filler[_ngcontent-%COMP%]{flex-grow:1}"],changeDetection:0}),n})();function Q9(n,e){return Zo((t,i)=>e?e(t[n],i[n]):t[n]===i[n])}const mFe=["input"],_Fe=function(n){return{enterDuration:n}},yFe=["*"],vFe=new ve("mat-radio-default-options",{providedIn:"root",factory:function(){return{color:"accent"}}});let J9=0;const CFe={provide:ro,useExisting:T(()=>i7),multi:!0};class e7{constructor(e,t){this.source=e,this.value=t}}const t7=new ve("MatRadioGroup");let n7=(()=>{class n{constructor(t){this._changeDetector=t,this._value=null,this._name="mat-radio-group-"+J9++,this._selected=null,this._isInitialized=!1,this._labelPosition="after",this._disabled=!1,this._required=!1,this._controlValueAccessorChangeFn=()=>{},this.onTouched=()=>{},this.change=new Le}get name(){return this._name}set name(t){this._name=t,this._updateRadioButtonNames()}get labelPosition(){return this._labelPosition}set labelPosition(t){this._labelPosition="before"===t?"before":"after",this._markRadiosForCheck()}get value(){return this._value}set value(t){this._value!==t&&(this._value=t,this._updateSelectedRadioFromValue(),this._checkSelectedRadioButton())}_checkSelectedRadioButton(){this._selected&&!this._selected.checked&&(this._selected.checked=!0)}get selected(){return this._selected}set selected(t){this._selected=t,this.value=t?t.value:null,this._checkSelectedRadioButton()}get disabled(){return this._disabled}set disabled(t){this._disabled=Mt(t),this._markRadiosForCheck()}get required(){return this._required}set required(t){this._required=Mt(t),this._markRadiosForCheck()}ngAfterContentInit(){this._isInitialized=!0}_touch(){this.onTouched&&this.onTouched()}_updateRadioButtonNames(){this._radios&&this._radios.forEach(t=>{t.name=this.name,t._markForCheck()})}_updateSelectedRadioFromValue(){this._radios&&(null===this._selected||this._selected.value!==this._value)&&(this._selected=null,this._radios.forEach(i=>{i.checked=this.value===i.value,i.checked&&(this._selected=i)}))}_emitChangeEvent(){this._isInitialized&&this.change.emit(new e7(this._selected,this._value))}_markRadiosForCheck(){this._radios&&this._radios.forEach(t=>t._markForCheck())}writeValue(t){this.value=t,this._changeDetector.markForCheck()}registerOnChange(t){this._controlValueAccessorChangeFn=t}registerOnTouched(t){this.onTouched=t}setDisabledState(t){this.disabled=t,this._changeDetector.markForCheck()}}return n.\u0275fac=function(t){return new(t||n)(E(kn))},n.\u0275dir=oe({type:n,inputs:{name:"name",labelPosition:"labelPosition",value:"value",selected:"selected",disabled:"disabled",required:"required",color:"color"},outputs:{change:"change"}}),n})(),i7=(()=>{class n extends n7{}return n.\u0275fac=function(){let e;return function(i){return(e||(e=$n(n)))(i||n)}}(),n.\u0275dir=oe({type:n,selectors:[["mat-radio-group"]],contentQueries:function(t,i,r){if(1&t&&ei(r,r7,5),2&t){let s;_t(s=yt())&&(i._radios=s)}},hostAttrs:["role","radiogroup",1,"mat-radio-group"],exportAs:["matRadioGroup"],features:[Dt([CFe,{provide:t7,useExisting:n}]),ct]}),n})();class wFe{constructor(e){this._elementRef=e}}const EFe=nc(Hf(wFe));let SFe=(()=>{class n extends EFe{constructor(t,i,r,s,o,a,l,c){super(i),this._changeDetector=r,this._focusMonitor=s,this._radioDispatcher=o,this._providerOverride=l,this._uniqueId="mat-radio-"+ ++J9,this.id=this._uniqueId,this.change=new Le,this._checked=!1,this._value=null,this._removeUniqueSelectionListener=()=>{},this.radioGroup=t,this._noopAnimations="NoopAnimations"===a,c&&(this.tabIndex=To(c,0)),this._removeUniqueSelectionListener=o.listen((d,f)=>{d!==this.id&&f===this.name&&(this.checked=!1)})}get checked(){return this._checked}set checked(t){const i=Mt(t);this._checked!==i&&(this._checked=i,i&&this.radioGroup&&this.radioGroup.value!==this.value?this.radioGroup.selected=this:!i&&this.radioGroup&&this.radioGroup.value===this.value&&(this.radioGroup.selected=null),i&&this._radioDispatcher.notify(this.id,this.name),this._changeDetector.markForCheck())}get value(){return this._value}set value(t){this._value!==t&&(this._value=t,null!==this.radioGroup&&(this.checked||(this.checked=this.radioGroup.value===t),this.checked&&(this.radioGroup.selected=this)))}get labelPosition(){return this._labelPosition||this.radioGroup&&this.radioGroup.labelPosition||"after"}set labelPosition(t){this._labelPosition=t}get disabled(){return this._disabled||null!==this.radioGroup&&this.radioGroup.disabled}set disabled(t){this._setDisabled(Mt(t))}get required(){return this._required||this.radioGroup&&this.radioGroup.required}set required(t){this._required=Mt(t)}get color(){return this._color||this.radioGroup&&this.radioGroup.color||this._providerOverride&&this._providerOverride.color||"accent"}set color(t){this._color=t}get inputId(){return`${this.id||this._uniqueId}-input`}focus(t,i){i?this._focusMonitor.focusVia(this._inputElement,i,t):this._inputElement.nativeElement.focus(t)}_markForCheck(){this._changeDetector.markForCheck()}ngOnInit(){this.radioGroup&&(this.checked=this.radioGroup.value===this._value,this.checked&&(this.radioGroup.selected=this),this.name=this.radioGroup.name)}ngAfterViewInit(){this._focusMonitor.monitor(this._elementRef,!0).subscribe(t=>{!t&&this.radioGroup&&this.radioGroup._touch()})}ngOnDestroy(){this._focusMonitor.stopMonitoring(this._elementRef),this._removeUniqueSelectionListener()}_emitChangeEvent(){this.change.emit(new e7(this,this._value))}_isRippleDisabled(){return this.disableRipple||this.disabled}_onInputClick(t){t.stopPropagation()}_onInputInteraction(t){if(t.stopPropagation(),!this.checked&&!this.disabled){const i=this.radioGroup&&this.value!==this.radioGroup.value;this.checked=!0,this._emitChangeEvent(),this.radioGroup&&(this.radioGroup._controlValueAccessorChangeFn(this.value),i&&this.radioGroup._emitChangeEvent())}}_setDisabled(t){this._disabled!==t&&(this._disabled=t,this._changeDetector.markForCheck())}}return n.\u0275fac=function(t){return new(t||n)(E(n7),E(rt),E(kn),E(Sa),E(cS),E(String),E(void 0),E(String))},n.\u0275dir=oe({type:n,viewQuery:function(t,i){if(1&t&&Jn(mFe,5),2&t){let r;_t(r=yt())&&(i._inputElement=r.first)}},inputs:{id:"id",checked:"checked",value:"value",labelPosition:"labelPosition",disabled:"disabled",required:"required",color:"color",name:"name",ariaLabel:["aria-label","ariaLabel"],ariaLabelledby:["aria-labelledby","ariaLabelledby"],ariaDescribedby:["aria-describedby","ariaDescribedby"]},outputs:{change:"change"},features:[ct]}),n})(),r7=(()=>{class n extends SFe{constructor(t,i,r,s,o,a,l,c){super(t,i,r,s,o,a,l,c)}}return n.\u0275fac=function(t){return new(t||n)(E(t7,8),E(rt),E(kn),E(Sa),E(cS),E(Do,8),E(vFe,8),Zr("tabindex"))},n.\u0275cmp=Ne({type:n,selectors:[["mat-radio-button"]],hostAttrs:[1,"mat-radio-button"],hostVars:17,hostBindings:function(t,i){1&t&&ge("focus",function(){return i._inputElement.nativeElement.focus()}),2&t&&(nn("tabindex",null)("id",i.id)("aria-label",null)("aria-labelledby",null)("aria-describedby",null),st("mat-radio-checked",i.checked)("mat-radio-disabled",i.disabled)("_mat-animation-noopable",i._noopAnimations)("mat-primary","primary"===i.color)("mat-accent","accent"===i.color)("mat-warn","warn"===i.color))},inputs:{disableRipple:"disableRipple",tabIndex:"tabIndex"},exportAs:["matRadioButton"],features:[ct],ngContentSelectors:yFe,decls:13,vars:20,consts:[[1,"mat-radio-label"],["label",""],[1,"mat-radio-container"],[1,"mat-radio-outer-circle"],[1,"mat-radio-inner-circle"],["type","radio",1,"mat-radio-input","cdk-visually-hidden",3,"id","checked","disabled","tabIndex","required","change","click"],["input",""],["mat-ripple","",1,"mat-radio-ripple","mat-focus-indicator",3,"matRippleTrigger","matRippleDisabled","matRippleCentered","matRippleRadius","matRippleAnimation"],[1,"mat-ripple-element","mat-radio-persistent-ripple"],[1,"mat-radio-label-content"],[2,"display","none"]],template:function(t,i){if(1&t&&(wi(),R(0,"label",0,1),R(2,"span",2),tt(3,"span",3),tt(4,"span",4),R(5,"input",5,6),ge("change",function(s){return i._onInputInteraction(s)})("click",function(s){return i._onInputClick(s)}),k(),R(7,"span",7),tt(8,"span",8),k(),k(),R(9,"span",9),R(10,"span",10),De(11,"\xa0"),k(),Ht(12),k(),k()),2&t){const r=vs(1);nn("for",i.inputId),G(5),ie("id",i.inputId)("checked",i.checked)("disabled",i.disabled)("tabIndex",i.tabIndex)("required",i.required),nn("name",i.name)("value",i.value)("aria-label",i.ariaLabel)("aria-labelledby",i.ariaLabelledby)("aria-describedby",i.ariaDescribedby),G(2),ie("matRippleTrigger",r)("matRippleDisabled",i._isRippleDisabled())("matRippleCentered",!0)("matRippleRadius",20)("matRippleAnimation",Hg(18,_Fe,i._noopAnimations?0:150)),G(2),st("mat-radio-label-before","before"==i.labelPosition)}},directives:[Js],styles:[".mat-radio-button{display:inline-block;-webkit-tap-highlight-color:transparent;outline:0}.mat-radio-label{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;display:inline-flex;align-items:center;white-space:nowrap;vertical-align:middle;width:100%}.mat-radio-container{box-sizing:border-box;display:inline-block;position:relative;width:20px;height:20px;flex-shrink:0}.mat-radio-outer-circle{box-sizing:border-box;display:block;height:20px;left:0;position:absolute;top:0;transition:border-color ease 280ms;width:20px;border-width:2px;border-style:solid;border-radius:50%}._mat-animation-noopable .mat-radio-outer-circle{transition:none}.mat-radio-inner-circle{border-radius:50%;box-sizing:border-box;display:block;height:20px;left:0;position:absolute;top:0;opacity:0;transition:transform ease 280ms,background-color ease 280ms,opacity linear 1ms 280ms;width:20px;transform:scale(0.001);-webkit-print-color-adjust:exact;color-adjust:exact}.mat-radio-checked .mat-radio-inner-circle{transform:scale(0.5);opacity:1;transition:transform ease 280ms,background-color ease 280ms}.cdk-high-contrast-active .mat-radio-checked .mat-radio-inner-circle{border:solid 10px}._mat-animation-noopable .mat-radio-inner-circle{transition:none}.mat-radio-label-content{-webkit-user-select:auto;-moz-user-select:auto;-ms-user-select:auto;user-select:auto;display:inline-block;order:0;line-height:inherit;padding-left:8px;padding-right:0}[dir=rtl] .mat-radio-label-content{padding-right:8px;padding-left:0}.mat-radio-label-content.mat-radio-label-before{order:-1;padding-left:0;padding-right:8px}[dir=rtl] .mat-radio-label-content.mat-radio-label-before{padding-right:0;padding-left:8px}.mat-radio-disabled,.mat-radio-disabled .mat-radio-label{cursor:default}.mat-radio-button .mat-radio-ripple{position:absolute;left:calc(50% - 20px);top:calc(50% - 20px);height:40px;width:40px;z-index:1;pointer-events:none}.mat-radio-button .mat-radio-ripple .mat-ripple-element:not(.mat-radio-persistent-ripple){opacity:.16}.mat-radio-persistent-ripple{width:100%;height:100%;transform:none;top:0;left:0}.mat-radio-container:hover .mat-radio-persistent-ripple{opacity:.04}.mat-radio-button:not(.mat-radio-disabled).cdk-keyboard-focused .mat-radio-persistent-ripple,.mat-radio-button:not(.mat-radio-disabled).cdk-program-focused .mat-radio-persistent-ripple{opacity:.12}.mat-radio-persistent-ripple,.mat-radio-disabled .mat-radio-container:hover .mat-radio-persistent-ripple{opacity:0}@media(hover: none){.mat-radio-container:hover .mat-radio-persistent-ripple{display:none}}.mat-radio-input{bottom:0;left:50%}.cdk-high-contrast-active .mat-radio-button:not(.mat-radio-disabled).cdk-keyboard-focused .mat-radio-ripple,.cdk-high-contrast-active .mat-radio-button:not(.mat-radio-disabled).cdk-program-focused .mat-radio-ripple{outline:solid 3px}.cdk-high-contrast-active .mat-radio-disabled{opacity:.5}\n"],encapsulation:2,changeDetection:0}),n})(),MFe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[_l,On],On]}),n})();const xFe=["label"],TFe=["options"],AFe=function(){return["Register","3D\xa0Preview"]};let DFe=(()=>{class n{constructor(t){this.ga=t,this.clsName="ccf-stage-nav",this.side="anterior",this.view3D=!1,this.sideChange=new Le,this.view3DChange=new Le,this.isDropdownActive=!1,this.isDropdownHidden=!0}set useDropdownMenu(t){this.isDropdownActive=t,this.isDropdownHidden=!0}get labelEl(){return this.labelRef.nativeElement}get optionsEl(){return this.optionsRef.nativeElement}handleClick(t){const{isDropdownHidden:i,labelEl:r,optionsEl:s}=this;r.contains(t)?this.isDropdownHidden=!i:s.contains(t)||(this.isDropdownHidden=!0)}updateSide(t){this.ga.event("side_update","stage_nav",t),"3D"===t?this.updateView(!0):(this.updateView(!1),this.side=t,this.sideChange.emit(this.side))}updateView(t){this.view3D=t,this.ga.event("view_update","stage_nav",t?"3D":"Register"),this.view3DChange.emit(this.view3D)}}return n.\u0275fac=function(t){return new(t||n)(E(xs))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-stage-nav"]],viewQuery:function(t,i){if(1&t&&(Jn(xFe,7),Jn(TFe,7)),2&t){let r;_t(r=yt())&&(i.labelRef=r.first),_t(r=yt())&&(i.optionsRef=r.first)}},hostVars:2,hostBindings:function(t,i){1&t&&ge("click",function(s){return i.handleClick(s.target)},!1,sg),2&t&&Rn(i.clsName)},inputs:{useDropdownMenu:"useDropdownMenu",side:"side",view3D:"view3D"},outputs:{sideChange:"sideChange",view3DChange:"view3DChange"},decls:18,vars:10,consts:[[1,"dropdown-label"],["label",""],[1,"stage-options"],["options",""],[1,"input-group",3,"value","change"],["value","left",1,"nav-input"],["value","right",1,"nav-input"],["value","anterior","checked","",1,"nav-input"],["value","posterior",1,"nav-input"],["matTooltip","Change view.",1,"view-slider",3,"labels","value","valueChange"]],template:function(t,i){1&t&&(R(0,"div",0,1),R(2,"mat-label"),De(3,"Options"),k(),R(4,"mat-icon"),De(5,"arrow_drop_down"),k(),k(),R(6,"div",2,3),R(8,"mat-radio-group",4),ge("change",function(s){return i.updateSide(s.value)}),R(9,"mat-radio-button",5),De(10,"Left"),k(),R(11,"mat-radio-button",6),De(12,"Right"),k(),R(13,"mat-radio-button",7),De(14,"Anterior"),k(),R(15,"mat-radio-button",8),De(16,"Posterior"),k(),k(),R(17,"ccf-labeled-slide-toggle",9),ge("valueChange",function(s){return i.updateView("Register"!==s)}),k(),k()),2&t&&(st("dropdown",i.isDropdownActive),G(6),st("dropdowncontainer",i.isDropdownActive)("hidden",i.isDropdownActive&&i.isDropdownHidden),G(2),ie("value",i.side),G(9),ie("labels",fv(9,AFe))("value",i.view3D?"3D\xa0Preview":"Register"))},directives:[Gf,rs,i7,r7,XF,dc],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;flex-wrap:wrap}[_nghost-%COMP%] .dropdown-label[_ngcontent-%COMP%]{display:none;align-items:center}[_nghost-%COMP%] .dropdown-label[_ngcontent-%COMP%] mat-label[_ngcontent-%COMP%], [_nghost-%COMP%] .dropdown-label[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{line-height:1.5rem}[_nghost-%COMP%] .dropdown-label.dropdown[_ngcontent-%COMP%]{display:flex;cursor:pointer;align-items:start}[_nghost-%COMP%] .stage-options[_ngcontent-%COMP%]{display:flex;align-items:center}[_nghost-%COMP%] .stage-options[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%] .nav-input[_ngcontent-%COMP%]{margin-right:1.5rem;margin-bottom:1.5rem}[_nghost-%COMP%] .stage-options[_ngcontent-%COMP%] .view-slider[_ngcontent-%COMP%]{margin-left:-1rem;margin-bottom:1.5rem;white-space:nowrap}[_nghost-%COMP%] .stage-options.dropdowncontainer[_ngcontent-%COMP%]{display:flex;flex-direction:column;border-radius:.25rem;width:16.5rem;position:absolute;top:3.5rem;z-index:1;transition:opacity .25s}[_nghost-%COMP%] .stage-options.dropdowncontainer[_ngcontent-%COMP%] [_ngcontent-%COMP%]:first-child{margin-top:.5rem}[_nghost-%COMP%] .stage-options.dropdowncontainer[_ngcontent-%COMP%] [_ngcontent-%COMP%]:last-child{margin-bottom:.5rem}[_nghost-%COMP%] .stage-options.dropdowncontainer[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%]{margin-left:1.5rem;margin-right:0;display:flex;flex-wrap:wrap}[_nghost-%COMP%] .stage-options.dropdowncontainer[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%] .nav-input[_ngcontent-%COMP%]{display:flex;margin:0 1.5rem 0 0;height:2.5rem}[_nghost-%COMP%] .stage-options.dropdowncontainer[_ngcontent-%COMP%] .view-slider[_ngcontent-%COMP%]{display:flex;align-items:center;height:3rem;margin:0 .5rem}[_nghost-%COMP%] .stage-options.dropdowncontainer[_ngcontent-%COMP%] mat-divider[_ngcontent-%COMP%]{visibility:visible;border-top:2px solid}[_nghost-%COMP%] .stage-options.hidden[_ngcontent-%COMP%]{visibility:hidden;opacity:0;transition:visibility .25s,opacity .25s}[_nghost-%COMP%] .stage-options.hidden[_ngcontent-%COMP%] mat-divider[_ngcontent-%COMP%]{visibility:hidden}"],changeDetection:0}),n})();function OFe(n,e){if(1&n){const t=Zi();R(0,"ccf-body-ui",16),ge("rotationChange",function(r){en(t),Qe();const s=vs(24);return s.rotation=r[0],s.rotationX=r[1]}),Kt(1,"async"),Kt(2,"async"),Kt(3,"async"),k()}if(2&n){const t=Qe();ie("scene",rn(1,5,t.scene.nodes$))("rotation",rn(2,7,t.scene.rotation$))("bounds",rn(3,9,t.bounds$))("zoom",11.5)("interactive",!0)}}function IFe(n,e){if(1&n){const t=Zi();R(0,"ccf-body-ui",17),ge("nodeDrag",function(r){return en(t),Qe().handleNodeDrag(r)}),Kt(1,"async"),Kt(2,"async"),k()}if(2&n){const t=Qe();ie("scene",rn(1,4,t.scene.rotatedNodes$))("interactive",!1)("bounds",rn(2,6,t.bounds$))("zoom",11.5)}}function PFe(n,e){1&n&&tt(0,"ccf-store-debug",18)}function RFe(n,e){if(1&n){const t=Zi();R(0,"div",19),R(1,"button",20),ge("click",function(){en(t);const r=Qe();return r.debugMode=!r.debugMode}),De(2,"State"),k(),R(3,"button",21),ge("click",function(){return en(t),Qe().registration.setUseRegistrationCallback(!0)}),De(4,"Use callback"),k(),R(5,"button",21),ge("click",function(){return en(t),Qe().registration.setUseRegistrationCallback(!1)}),De(6,"Use download"),k(),k()}}let kFe=(()=>{class n{constructor(t,i,r,s,o,a){this.model=t,this.page=i,this.registration=r,this.scene=s,this.rootRef=o,this.cdr=a,this.clsName="ccf-content",this.position$=this.model.position$.pipe(Ae(l=>({x:Math.floor(l.x),y:Math.floor(l.y),z:Math.floor(l.z)}))),this.is3DView$=this.model.viewType$.pipe(Ae(l=>"3d"===l)),this.bounds$=this.model.organDimensions$.pipe(Ae(l=>({x:Math.max(l.x,this.model.defaultPosition.x+40)/1e3,y:Math.max(l.y,this.model.defaultPosition.y+40)/1e3,z:Math.max(l.z,this.model.defaultPosition.z+40)/1e3})),Q9("x"),Q9("y")),this.isNarrowView=!1,this.debugMode=!1,this.showDebugButtons=!hu.production}ngOnInit(){this.sensor=new hW.ResizeSensor(this.rootRef.nativeElement,({width:t})=>{const i=t<440;this.isNarrowView!==i&&(this.isNarrowView=i,this.cdr.markForCheck())})}ngOnDestroy(){this.sensor.detach()}setViewType(t){this.model.setViewType(t?"3d":"register")}resetStage(){this.model.setPosition(this.model.defaultPosition),this.model.setViewSide("anterior"),this.model.setViewType("register")}handleNodeDrag(t){if("#DraftPlacement"===t.node["@id"]&&t.info.coordinate){const[i,r]=t.info.coordinate.map(d=>1e3*d),{position:s,viewSide:o,organDimensions:a}=this.model.snapshot,l=[a.x,a.y,a.z].map(d=>d/2);let c=s;switch(o){case"anterior":c={x:i+l[0],y:r+l[1],z:s.z};break;case"posterior":c={x:-i+l[0],y:r+l[1],z:s.z};break;case"left":c={x:s.x,y:r+l[1],z:-i+l[2]};break;case"right":c={x:s.x,y:r+l[1],z:i+l[2]}}this.model.setPosition(c)}}}return n.\u0275fac=function(t){return new(t||n)(E(ai),E(ji),E(Sr),E(as),E(rt),E(kn))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-content"]],hostVars:2,hostBindings:function(t,i){2&t&&Rn(i.clsName)},decls:29,vars:34,consts:[[1,"top-bar"],[3,"useDropdownMenu","view3D","side","view3DChange","sideChange"],["matRipple","","matRippleColor","rgba(204, 204, 204, 0.25)",1,"icon","reset",3,"matRippleCentered","matRippleUnbounded","click"],[1,"main-content"],["class","body-ui","camera","perspective",3,"scene","rotation","bounds","zoom","interactive","rotationChange",4,"ngIf"],["class","body-ui","camera","orthographic",3,"scene","interactive","bounds","zoom","nodeDrag",4,"ngIf"],[1,"gizmo-area"],[1,"position-display"],[1,"position"],[1,"x"],[1,"y"],[1,"z"],[1,"gizmo",3,"scene","rotation","interactive","zoom"],["gizmo",""],["class","debug",4,"ngIf"],["style","position: absolute; bottom: 1rem; display: flex; flex-direction: row; justify-content: space-between; width: 7rem;",4,"ngIf"],["camera","perspective",1,"body-ui",3,"scene","rotation","bounds","zoom","interactive","rotationChange"],["camera","orthographic",1,"body-ui",3,"scene","interactive","bounds","zoom","nodeDrag"],[1,"debug"],[2,"position","absolute","bottom","1rem","display","flex","flex-direction","row","justify-content","space-between","width","7rem"],[2,"width","3rem","font-size",".7rem",3,"click"],[3,"click"]],template:function(t,i){if(1&t&&(R(0,"div",0),R(1,"ccf-stage-nav",1),ge("view3DChange",function(s){return i.setViewType(s)})("sideChange",function(s){return i.model.setViewSide(s)}),Kt(2,"async"),Kt(3,"async"),k(),R(4,"mat-icon",2),ge("click",function(){return i.resetStage()}),De(5,"refresh"),k(),k(),R(6,"div",3),mt(7,OFe,4,11,"ccf-body-ui",4),Kt(8,"async"),mt(9,IFe,3,8,"ccf-body-ui",5),Kt(10,"async"),R(11,"div",6),R(12,"div",7),R(13,"div",8),R(14,"div",9),De(15),Kt(16,"async"),k(),R(17,"div",10),De(18),Kt(19,"async"),k(),R(20,"div",11),De(21),Kt(22,"async"),k(),k(),k(),tt(23,"ccf-body-ui",12,13),Kt(25,"async"),Kt(26,"async"),k(),k(),mt(27,PFe,1,0,"ccf-store-debug",14),mt(28,RFe,7,0,"div",15)),2&t){let r,s,o;G(1),ie("useDropdownMenu",i.isNarrowView)("view3D",rn(2,16,i.is3DView$))("side",rn(3,18,i.model.viewSide$)),G(3),ie("matRippleCentered",!0)("matRippleUnbounded",!0),G(3),ie("ngIf","3d"===rn(8,20,i.model.viewType$)),G(2),ie("ngIf","register"===rn(10,22,i.model.viewType$)),G(6),or("X: ",null==(r=rn(16,24,i.position$))?null:r.x,""),G(3),or("Y: ",null==(s=rn(19,26,i.position$))?null:s.y,""),G(3),or("Z: ",null==(o=rn(22,28,i.position$))?null:o.z,""),G(2),ie("scene",rn(25,30,i.scene.gizmo$))("rotation",rn(26,32,i.scene.rotation$))("interactive",!1)("zoom",9.5),G(4),ie("ngIf",i.showDebugButtons&&i.debugMode),G(1),ie("ngIf",i.showDebugButtons)}},directives:[DFe,rs,Js,zr,mPe,SPe],pipes:[Hc],styles:["[_nghost-%COMP%]{display:block;width:100%;height:100%;padding:1.5rem;overflow:hidden}[_nghost-%COMP%] .top-bar[_ngcontent-%COMP%]{display:flex;justify-content:space-between}[_nghost-%COMP%] .top-bar[_ngcontent-%COMP%] .reset[_ngcontent-%COMP%]{transform:scaleX(-1);cursor:pointer;transition:.6s}[_nghost-%COMP%] .main-content[_ngcontent-%COMP%]{display:flex;height:calc(100% - 1rem)}[_nghost-%COMP%] .main-content[_ngcontent-%COMP%] .body-ui[_ngcontent-%COMP%]{flex:auto;transition:opacity 1s}[_nghost-%COMP%] .main-content[_ngcontent-%COMP%] .gizmo-area[_ngcontent-%COMP%]{width:4rem;margin-top:1.5rem;margin-left:1.5rem;z-index:10}[_nghost-%COMP%] .main-content[_ngcontent-%COMP%] .gizmo-area[_ngcontent-%COMP%] .position-display[_ngcontent-%COMP%]{display:flex;justify-content:center;margin-bottom:1.5rem}[_nghost-%COMP%] .main-content[_ngcontent-%COMP%] .gizmo-area[_ngcontent-%COMP%] .gizmo[_ngcontent-%COMP%]{height:5.5rem}[_nghost-%COMP%] .main-content[_ngcontent-%COMP%] .gizmo-area[_ngcontent-%COMP%] .gizmo[_ngcontent-%COMP%] .hidden[_ngcontent-%COMP%]{opacity:0;z-index:0}[_nghost-%COMP%] .ccf-store-debug[_ngcontent-%COMP%]{color:#fff;position:absolute;top:.5rem;max-width:55rem}"],changeDetection:0}),n})();function FFe(n,e){if(1&n){const t=Zi();R(0,"div",11),ge("click",function(){en(t),Qe();const r=vs(15);return r.expanded=!r.expanded}),R(1,"mat-icon",12),De(2),k(),k()}if(2&n){Qe();const t=vs(15);G(2),or(" ",t.expanded?"arrow_drop_up":"arrow_drop_down"," ")}}function NFe(n,e){if(1&n){const t=Zi();R(0,"div",11),ge("click",function(){en(t);const r=Qe();return r.open=!r.open}),R(1,"mat-icon",13),De(2),k(),k()}if(2&n){const t=Qe();G(2),or(" ",t.open?"arrow_drop_up":"arrow_drop_down"," ")}}const LFe=function(n){return[n]};let BFe=(()=>{class n{constructor(t,i,r,s,o,a,l,c,d){this.model=t,this.page=i,this.consentService=r,this.snackbar=s,this.theming=o,this.globalConfig=c,this.organList=qF,this.open=!0,this.registrationStarted=!1,this.disablePositionChange=!1,this.theme$=this.globalConfig.getOption("theme"),this.themeMode$=new If(1),this.header$=this.globalConfig.getOption("header"),this.homeUrl$=this.globalConfig.getOption("homeUrl"),this.logoTooltip$=this.globalConfig.getOption("logoTooltip"),this.subscriptions=new Te,o.initialize(a,l),this.subscriptions.add(i.registrationCallbackSet$.subscribe(f=>{this.open=!f})),this.subscriptions.add(i.registrationStarted$.subscribe(f=>{this.registrationStarted=f})),this.theme$.subscribe(f=>{this.theme=f}),this.globalConfig.getOption("homeUrl").subscribe(f=>{this.homeUrl=f}),this.globalConfig.getOption("logoTooltip").subscribe(f=>{this.logoTooltip=f}),Qi([this.theme$,this.themeMode$]).subscribe(([f,p])=>{this.theming.setTheme(`${f}-theme-${p}`),d.markForCheck()})}get isLightTheme(){return this.theming.getTheme().endsWith("light")}ngOnInit(){const t=this.snackbar.openFromComponent(eRe,{data:{preClose:()=>{t.dismiss()}},duration:"not-set"===this.consentService.consent?1/0:3e3});this.themeMode$.next("light"),this.theming.setTheme(`${this.theme}-theme-light`)}toggleScheme(){this.themeMode$.next(this.isLightTheme?"dark":"light")}handleKey(t){const i=this.model.snapshot.position;if(this.disablePositionChange||!this.registrationStarted)return;t.preventDefault();const r=t.repeat?1:.5;let s=i;switch(t.key){case"q":s=Object.assign(Object.assign({},i),{z:i.z+r});break;case"e":s=Object.assign(Object.assign({},i),{z:i.z-r});break;case"w":s=Object.assign(Object.assign({},i),{y:i.y+r});break;case"s":s=Object.assign(Object.assign({},i),{y:i.y-r});break;case"a":s=Object.assign(Object.assign({},i),{x:i.x-r});break;case"d":s=Object.assign(Object.assign({},i),{x:i.x+r})}this.model.setPosition(s)}handleClick(t){this.disablePositionChange="INPUT"===t.nodeName}ngOnDestroy(){this.subscriptions.unsubscribe()}}return n.\u0275fac=function(t){return new(t||n)(E(ai),E(ji),E(f0),E(Xae),E(YF),E(rt),E(Nt),E(Ah),E(kn))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-root"]],hostBindings:function(t,i){1&t&&ge("keydown",function(s){return i.handleKey(s)},!1,sg)("click",function(s){return i.handleClick(s.target)},!1,sg)},decls:21,vars:35,consts:[[3,"logoTooltip","homeUrl"],["opened",""],[3,"modalClosed","disableSlider"],["position","end","opened",""],[3,"modalClosed"],[1,"selector-drawer"],[3,"organList","selectedOrgans","organsChanged"],["organSelector",""],[1,"close-button-wrapper"],["class","close-button",3,"click",4,"ngIf"],[1,"stage-content"],[1,"close-button",3,"click"],["aria-hidden","false","aria-label","Expand carousel drawer",1,"expand-collapse-icon"],["aria-hidden","false","aria-label","Close carousel drawer",1,"expand-collapse-icon"]],template:function(t,i){if(1&t&&(tt(0,"ccf-registration-modal"),tt(1,"ccf-header",0),Kt(2,"async"),Kt(3,"async"),Kt(4,"async"),R(5,"ccf-drawer-container"),R(6,"ccf-drawer",1),tt(7,"ccf-left-sidebar",2),tt(8,"ccf-drawer-toggle-button"),k(),R(9,"ccf-drawer",3),tt(10,"ccf-right-sidebar",4),tt(11,"ccf-drawer-toggle-button"),k(),R(12,"ccf-drawer-content"),R(13,"div",5),R(14,"ccf-organ-selector",6,7),ge("organsChanged",function(s){return i.model.setOrgan(s[0])}),Kt(16,"async"),k(),R(17,"div",8),mt(18,FFe,3,1,"div",9),mt(19,NFe,3,1,"div",9),k(),k(),tt(20,"ccf-content",10),k(),k()),2&t){const r=vs(15);G(1),st("header-hidden",!1===rn(2,25,i.header$)),ie("logoTooltip",rn(3,27,i.logoTooltip$))("homeUrl",rn(4,29,i.homeUrl$)),G(6),ie("modalClosed",i.registrationStarted)("disableSlider",!(null!=r.selectedOrgans[0]&&r.selectedOrgans[0].hasSex)),G(3),ie("modalClosed",i.registrationStarted),G(3),st("closed",!i.open)("expanded",r.expanded),G(1),st("closed",!i.open),ie("organList",i.organList)("selectedOrgans",Hg(33,LFe,rn(16,31,i.model.organ$))),G(3),st("closed",!i.open)("selector-expanded",r.expanded),G(1),ie("ngIf",i.open),G(1),ie("ngIf",!r.expanded),G(1),st("expanded-stage",!i.open)("retracted-stage",r.expanded)}},directives:[LRe,jRe,XRe,ZF,Kke,Zke,gFe,bx,p9,zr,kFe,rs],pipes:[Hc],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;height:100%;overflow:hidden;font-size:1rem;color:#000}[_nghost-%COMP%] .header-hidden[_ngcontent-%COMP%]{display:none}[_nghost-%COMP%] ccf-drawer-container[_ngcontent-%COMP%]{height:100%}[_nghost-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer[_ngcontent-%COMP%]{width:25.5rem}[_nghost-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%]{position:relative;z-index:1}[_nghost-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .selector-drawer[_ngcontent-%COMP%]{top:0rem;display:flex;flex-direction:column;position:relative;height:5.688rem;transition:all .5s ease-in-out}[_nghost-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .selector-drawer.expanded[_ngcontent-%COMP%]{height:15rem}[_nghost-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .selector-drawer[_ngcontent-%COMP%] ccf-organ-selector[_ngcontent-%COMP%]{height:100%;padding-top:.5rem;transition:all .5s}[_nghost-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .selector-drawer[_ngcontent-%COMP%] ccf-organ-selector.closed[_ngcontent-%COMP%]{padding-top:0}[_nghost-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .selector-drawer[_ngcontent-%COMP%] .close-button-wrapper[_ngcontent-%COMP%]{display:flex;justify-content:center;height:0;z-index:2}[_nghost-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .selector-drawer[_ngcontent-%COMP%] .close-button-wrapper[_ngcontent-%COMP%] .close-button[_ngcontent-%COMP%]{cursor:pointer;transition:.6s}[_nghost-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .selector-drawer[_ngcontent-%COMP%] .close-button-wrapper[_ngcontent-%COMP%] .close-button[_ngcontent-%COMP%] .expand-collapse-icon[_ngcontent-%COMP%]{width:3rem;height:1.2rem;display:flex;justify-content:center;align-items:center;cursor:pointer;background-color:#fff;border-bottom-left-radius:.2rem;border-bottom-right-radius:.2rem;transition:.6s}[_nghost-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .selector-drawer[_ngcontent-%COMP%] .close-button-wrapper[_ngcontent-%COMP%] .close-button[_ngcontent-%COMP%] .expand-collapse-icon[_ngcontent-%COMP%]:hover{background-color:#ececec}[_nghost-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .selector-drawer.closed[_ngcontent-%COMP%]{height:3rem;top:-2.9rem}[_nghost-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .stage-content[_ngcontent-%COMP%]{border-radius:.5rem!important;height:calc(100% - 2.688rem - 3rem - 1.5rem)}[_nghost-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .expanded-stage[_ngcontent-%COMP%]{height:calc(100% - 1.5rem);padding-bottom:1rem}[_nghost-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .retracted-stage[_ngcontent-%COMP%]{height:calc(100% - 2.688rem - 14rem)}[_nghost-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-content[_ngcontent-%COMP%]{position:absolute;transition-duration:.5s;transition-timing-function:ease-in-out;transition-property:all;bottom:1.5rem;z-index:1}"],changeDetection:0}),n})();function VFe(n,e){1&n&&tt(0,"ccf-root")}let zFe=(()=>{class n extends lRe{constructor(t,i){const r=cRe;super(t,i,{initialDelay:500,initialConfig:Object.assign(Object.assign(Object.assign({},hu.dbOptions),globalThis.ruiConfig),hu.customization),parse:{useDownload:r.boolean,user:r.json,organ:r.json,editRegistration:r.json,register:r.function,cancelRegistration:r.function,fetchPreviousRegistrations:r.function,skipUnsavedChangesConfirmation:r.boolean,header:r.boolean}})}}return n.\u0275fac=function(t){return new(t||n)(E(Ah),E(kn))},n.\u0275cmp=Ne({type:n,selectors:[["ccf-root-wc"]],inputs:{baseHref:"baseHref",useDownload:"useDownload",user:"user",organ:"organ",editRegistration:"editRegistration",register:"register",cancelRegistration:"cancelRegistration",fetchPreviousRegistrations:"fetchPreviousRegistrations",skipUnsavedChangesConfirmation:"skipUnsavedChangesConfirmation",theme:"theme",header:"header",homeUrl:"homeUrl",logoTooltip:"logoTooltip"},features:[ct],decls:1,vars:1,consts:[[4,"ngIf"]],template:function(t,i){1&t&&mt(0,VFe,1,0,"ccf-root",0),2&t&&ie("ngIf",i.initialized)},directives:[zr,BFe],encapsulation:2,changeDetection:0}),n})();const jFe=new ve("Global configuration object");function UFe(n){return n.get("ruiConfig",{user:{firstName:"",lastName:""}})}let HFe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({providers:[{provide:jFe,useFactory:UFe,deps:[v9]}]}),n})(),$Fe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({providers:[{provide:bv,useValue:YF.initialize,multi:!0},YF]}),n})(),GFe=(()=>{class n{constructor(t,i){this.accessor=t,this.injector=i}static forRoot(t=[]){return{ngModule:n,providers:[Fr,Fa,UW,...t]}}}return n.\u0275fac=function(t){return new(t||n)(I(Fr,2),I(Fa,2))},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({}),n})();const Sx=(n,e)=>((n,e)=>new Array(e+1).join("0"))(0,e-n.toString().length)+n;class YFe{constructor(e,t,i){this.action=e,this.store=t,this.logWriter=i}dispatched(e){const t=pp(this.action),i=function(n){return Sx(n.getHours(),2)+":"+Sx(n.getMinutes(),2)+":"+Sx(n.getSeconds(),2)+"."+Sx(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 XFe{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 ve("NGXS_LOGGER_PLUGIN_OPTIONS");let KFe=(()=>{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 XFe(this._options),this._store=this._store||this._injector.get(cu);const s=new YFe(i,this._store,this._logWriter);return s.dispatched(t),r(t,i).pipe(Ti(o=>{s.completed(o)}),Ta(o=>{throw s.errored(o),o}))}}return n.\u0275fac=function(t){return new(t||n)(I(s7),I(Nt))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();const o7=new ve("LOGGER_USER_OPTIONS");function ZFe(n){return Object.assign({},{logger:console,collapsed:!1,disabled:!1,filter:()=>!0},n)}let QFe=(()=>{class n{static forRoot(t){return{ngModule:n,providers:[{provide:rk,useClass:KFe,multi:!0},{provide:o7,useValue:t},{provide:s7,useFactory:ZFe,deps:[o7]}]}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({}),n})();const JF=new ve("NGXS_STORAGE_PLUGIN_OPTION"),a7=new ve("STORAGE_ENGINE"),e2="@@STATE",l7="NGXS_OPTIONS_META";function e2e(n){return void 0!==n&&n.key&&(n.key=function(n){return Array.isArray(n)||(n=[n]),n.map(e=>(e.hasOwnProperty(l7)&&(e=e[l7].name),e instanceof class{constructor(e){this.name=e,uk(this).makeRootSelector=i=>i.getStateGetter(this.name)}getName(){return this.name}toString(){return`StateToken[${this.name}]`}}?e.getName():e))}(n.key)),Object.assign({key:[e2],storage:0,serialize:JSON.stringify,deserialize:JSON.parse,beforeSerialize:e=>e,afterDeserialize:e=>e},n)}function t2e(n,e){return kD(e)?null:0===n.storage?localStorage:1===n.storage?sessionStorage:null}let n2e=(()=>{class n{constructor(t,i,r){this._options=t,this._engine=i,this._platformId=r}handle(t,i,r){if(kD(this._platformId)&&null===this._engine)return r(t,i);const s=this._options.key,o=function(n){const e=pp(n);return function(t){return e===pp(t)}}(i),a=o(iG)||o(rG);let l=!1;if(a)for(const c of s){const d=c===e2;let f=this._engine.getItem(c);if("undefined"!==f&&null!=f){try{const p=this._options.deserialize(f);f=this._options.afterDeserialize(p,c)}catch(p){console.error("Error ocurred while deserializing the store value, falling back to empty object."),f={}}this._options.migrations&&this._options.migrations.forEach(p=>{p.version===Gm(f,p.versionKey||"version")&&(!p.key&&d||p.key===c)&&(f=p.migrate(f),l=!0)}),t=d?Object.assign({},t,f):ok(t,c,f)}}return r(t,i).pipe(Ti(c=>{if(!a||a&&l)for(const d of s){let f=c;d!==e2&&(f=Gm(c,d));try{const p=this._options.beforeSerialize(f,d);this._engine.setItem(d,this._options.serialize(p))}catch(p){console.error("Error ocurred while serializing the store value, value not updated.")}}}))}}return n.\u0275fac=function(t){return new(t||n)(I(JF),I(a7),I(dl))},n.\u0275prov=ue({token:n,factory:n.\u0275fac}),n})();const c7=new ve("USER_OPTIONS");let i2e=(()=>{class n{static forRoot(t){return{ngModule:n,providers:[{provide:rk,useClass:n2e,multi:!0},{provide:c7,useValue:t},{provide:JF,useFactory:e2e,deps:[c7]},{provide:a7,useFactory:t2e,deps:[JF,dl]}]}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({}),n})();const u7=[{name:"bladder",namespace:"app",url:"assets/icons/organs/ico-organs-bladder.svg"},{name:"blood",namespace:"app",url:"assets/icons/organs/ico-organs-blood.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:"eye",namespace:"app",url:"assets/icons/organs/ico-organs-eye.svg"},{name:"fallopian-tube-left",namespace:"app",url:"assets/icons/organs/ico-organs-fallopian-tube-left.svg"},{name:"fallopian-tube-right",namespace:"app",url:"assets/icons/organs/ico-organs-fallopian-tube-right.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-right",namespace:"app",url:"assets/icons/organs/ico-organs-kidney-right.svg"},{name:"kidney",namespace:"app",url:"assets/icons/organs/ico-organs-kidney.svg"},{name:"knee",namespace:"app",url:"assets/icons/organs/ico-organs-knee.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-right",namespace:"app",url:"assets/icons/organs/ico-organs-lung-right.svg"},{name:"lung",namespace:"app",url:"assets/icons/organs/ico-organs-lung.svg"},{name:"lymph-nodes",namespace:"app",url:"assets/icons/organs/ico-organs-lymph-nodes.svg"},{name:"mammary-gland",namespace:"app",url:"assets/icons/organs/ico-organs-breast.svg"},{name:"neuron",namespace:"app",url:"assets/icons/organs/ico-organs-neuron.svg"},{name:"ovaries",namespace:"app",url:"assets/icons/organs/ico-organs-ovaries.svg"},{name:"ovary-left",namespace:"app",url:"assets/icons/organs/ico-organs-ovary-left.svg"},{name:"ovary-right",namespace:"app",url:"assets/icons/organs/ico-organs-ovary-right.svg"},{name:"pancreas",namespace:"app",url:"assets/icons/organs/ico-organs-pancreas.svg"},{name:"pelvis-f",namespace:"app",url:"assets/icons/organs/ico-organs-pelvis-f.svg"},{name:"placenta",namespace:"app",url:"assets/icons/organs/ico-organs-placenta.svg"},{name:"prostate",namespace:"app",url:"assets/icons/organs/ico-organs-prostate.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:"spinal-cord",namespace:"app",url:"assets/icons/organs/ico-organs-spinal-cord.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:"ureter-left",namespace:"app",url:"assets/icons/organs/ico-organs-ureter-left.svg"},{name:"ureter-right",namespace:"app",url:"assets/icons/organs/ico-organs-ureter-right.svg"},{name:"uterus",namespace:"app",url:"assets/icons/organs/ico-organs-uterus.svg"},{name:"vasculature-thick",namespace:"app",url:"assets/icons/organs/ico-organs-vasculature-thick.svg"},{name:"vasculature-thin",namespace:"app",url:"assets/icons/organs/ico-organs-vasculature-thin.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:"visibility_off_cube",namespace:"app",url:"assets/icons/ico-cube.svg"}];let hd=class extends cDe{constructor(e,t,i){super(),this.registry=e,this.sanitizer=t,this.globalConfig=i}ngxsOnInit(){var e;u7.filter(t=>void 0!==t.html).map(t=>Object.assign(Object.assign({},t),{html:this.sanitizer.bypassSecurityTrustHtml(t.html)})).forEach(t=>this.registerIconImpl(t)),null===(e=this.registry)||void 0===e||e.addSvgIconResolver((t,i)=>{var r;const s=u7.find(a=>{var l,c;return(null!==(l=a.name)&&void 0!==l?l:"")===t&&(null!==(c=a.namespace)&&void 0!==c?c:"")===i});if(void 0===s||void 0===s.url)return null;const o=null!==(r=this.globalConfig.snapshot.baseHref)&&void 0!==r?r:"";return this.sanitizer.bypassSecurityTrustResourceUrl(o+s.url)})}registerIcon(e){return this.registerIconImpl(e)}registerIconImpl(e){if(!this.registry||!e.url&&!e.html)return!1;const t=this.registry,r=t[this.getMethodName(e)],s=this.getArguments(e);if(!r)return!1;try{return r.apply(t,s),!0}catch(o){return!1}}getMethodName({name:e,namespace:t,url:i}){const r=["addSvgIcon"];return e||r.push("Set"),i||r.push("Literal"),t&&r.push("InNamespace"),r.join("")}getArguments({name:e,namespace:t,url:i,html:r}){return[t,e,null!=i?i:r].filter(o=>!!o)}};hd.\u0275fac=function(e){return new(e||hd)(I(Gv,8),I(th),I(Ah))},hd.\u0275prov=ue({token:hd,factory:hd.\u0275fac}),xe([on()],hd.prototype,"registerIcon",null),hd=xe([xh(),cd({name:"iconRegistry"})],hd);const r2e=[Ah,hd,ji,ai,ko,fc,Sr,as];let s2e=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[GFe.forRoot(),Io.forRoot(r2e,{developmentMode:!hu.production}),i2e.forRoot({key:["registration.registrations"]}),QFe.forRoot({disabled:hu.production})]]}),n})(),o2e=(()=>{class n{constructor(t){if(t)throw new Error("The core module should only be imported once in the root module")}}return n.\u0275fac=function(t){return new(t||n)(I(n,12))},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[Rj,kIe.forRoot({gaToken:hu.googleAnalyticsToken,appName:"rui"}),ZPe,HFe,s2e,$Fe]]}),n})(),t2=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,O9]]}),n})(),a2e=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,MFe,q9,lr,yx,t2,hc]]}),n})(),l2e=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,lr]]}),n})(),c2e=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,a2e,lr,MPe,l2e,_l,_Pe]]}),n})(),u2e=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,lr,hc]]}),n})(),d2e=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn]]}),n})(),h2e=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,q9]]}),n})(),d7=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,O9,Kb,Lk,Bk,hc]]}),n})(),f2e=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,lr,_l,m9]]}),n})(),h7=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,lr,j9]]}),n})(),p2e=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,ch]]}),n})(),g2e=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,Kk,lr,hc,yx,d2e,t2,d7,h7,h2e,m9,f2e,h7,p2e]]}),n})(),m2e=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,ch,hc,d7,t2,g9]]}),n})(),_2e=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,Qb,lr,m2e]]}),n})(),y2e=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,Kb,lr,_l,hc]]}),n})(),v2e=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,lr,_W,_l,hc]]}),n})(),b2e=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,Kb,lr,_l,hc,qPe]]}),n})(),C2e=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,j9,lr]]}),n})(),w2e=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,Lk,Bk,ch,h9,Uv,lr,Kb]]}),n})(),E2e=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,Qb,lr,ch]]}),n})(),S2e=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,E2e,ch,hc]]}),n})(),M2e=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({imports:[[dn,Kk,yx,lr,kO,hc,y2e,S2e,v2e,b2e,C2e,w2e,HPe]]}),n})(),x2e=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({providers:[{provide:P9,useValue:I9}],imports:[[yE,kO,lr]]}),n})(),T2e=(()=>{class n{constructor(t){this.injector=t}ngDoBootstrap(){const t=function(n,e){const t=function(n,e){return e.get(ll).resolveComponentFactory(n).inputs}(n,e.injector),i=e.strategyFactory||new Fne(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 Lne{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}(zFe,{injector:this.injector});customElements.define("ccf-rui",t)}}return n.\u0275fac=function(t){return new(t||n)(I(Nt))},n.\u0275mod=Pe({type:n}),n.\u0275inj=Me({providers:[{provide:T9,useValue:"hubmap-theme-light"},{provide:vj,useValue:{appearance:"standard",floatLabel:!1,hideRequiredMarker:!0}}],imports:[[yE,kO,o2e,lr,x2e,u2e,c2e,g2e,M2e,g9,_2e,tRe,_U]]}),n})();hu.production&&function(){if(i3)throw new Error("Cannot enable prod mode after platform setup.");n3=!1}(),rne().bootstrapModule(T2e).catch(n=>console.error(n))},948:gt=>{gt.exports=function(ze){return ze&&ze.__esModule?ze:{default:ze}},gt.exports.default=gt.exports,gt.exports.__esModule=!0},321:gt=>{function We(ze){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(gt.exports=We=function(L){return typeof L},gt.exports.default=gt.exports,gt.exports.__esModule=!0):(gt.exports=We=function(L){return L&&"function"==typeof Symbol&&L.constructor===Symbol&&L!==Symbol.prototype?"symbol":typeof L},gt.exports.default=gt.exports,gt.exports.__esModule=!0),We(ze)}gt.exports=We,gt.exports.default=gt.exports,gt.exports.__esModule=!0},833:gt=>{function We(ze){return Promise.resolve().then(()=>{var wt=new Error("Cannot find module '"+ze+"'");throw wt.code="MODULE_NOT_FOUND",wt})}We.keys=()=>[],We.resolve=We,We.id=833,gt.exports=We},521:()=>{},125:()=>{},307:()=>{}},gt=>{gt(gt.s=851)}]); \ No newline at end of file diff --git a/triple-store-fixed/index.d.ts b/triple-store-fixed/index.d.ts deleted file mode 100644 index 420e3335c..000000000 --- a/triple-store-fixed/index.d.ts +++ /dev/null @@ -1,52 +0,0 @@ -/// -import { EventEmitter } from 'events'; -import { JsonLd, Url } from 'jsonld/jsonld-spec'; -import { Store, Quad } from 'n3'; -import * as RDF from 'rdf-js'; -import { Readable } from 'readable-stream'; -export * from 'n3'; -declare type OTerm = RDF.Term | string | null; -export declare function readQuads(store: Store, subject: OTerm, predicate: OTerm, object: OTerm, graph: OTerm): Generator; -/** - * Turns a stream of values into an array. - * - * @param readStream The input stream. - * @returns A promise that resolves to an array of values when the stream completes. - */ -export declare function streamToArray(readStream: EventEmitter): Promise; -/** - * Turns an array into a readable stream. - * - * @param arr The values. - * @returns A new readable stream emitting the values from the array. - */ -export declare function arrayToStream(arr: T[]): Readable; -/** - * Adds data from json ld to the store. - * Accepts either a json object or a uri to load data from. - * - * @param uri A data uri or a json object. - * @param store The store to add data to. - * @returns A promise that resolves when the data has been added. - */ -export declare function addJsonLdToStore(uri: JsonLd | Url, store: RDF.Sink): Promise>; -/** - * Adds data from rdf xml to the store. - * Accepts either a xml-formatted string or a uri to load data from. - * - * @param uri A data uri or an xml-formatted string to load data from. - * @param store The store to add data to - * @returns A promise that resolves when the data has been added. - */ -export declare function addRdfXmlToStore(uri: string, store: RDF.Sink): Promise>; -/** - * Adds data from an n3 file to the store. - * Accepts either a n3-formatted string or a uri to load data from. - * - * @param uri A data uri or an n3-formatted string. - * @param store The store to add data to. - * @returns A promise that resolves when the data has been added. - */ -export declare function addN3ToStore(uri: string | Url, store: RDF.Sink): Promise>; -export declare function serializeN3Store(store: Store): string; -export declare function deserializeN3Store(serializedStore: string, factory?: RDF.DataFactory): Store; diff --git a/triple-store-fixed/index.js b/triple-store-fixed/index.js deleted file mode 100644 index ab9cd533e..000000000 --- a/triple-store-fixed/index.js +++ /dev/null @@ -1,24717 +0,0 @@ -(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.tripleStoreUtils = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i= 0; i--) - if (d = decorators[i]) - r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - } - function __param(paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); }; - } - function __metadata(metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") - return Reflect.metadata(metadataKey, metadataValue); - } - function __awaiter(thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { - step(generator.next(value)); - } - catch (e) { - reject(e); - } } - function rejected(value) { try { - step(generator["throw"](value)); - } - catch (e) { - reject(e); - } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - } - function __generator(thisArg, body) { - var _ = { label: 0, sent: function () { if (t[0] & 1) - throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) - throw new TypeError("Generator is already executing."); - while (_) - try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) - return t; - if (y = 0, t) - op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: - case 1: - t = op; - break; - case 4: - _.label++; - return { value: op[1], done: false }; - case 5: - _.label++; - y = op[1]; - op = [0]; - continue; - case 7: - op = _.ops.pop(); - _.trys.pop(); - continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { - _ = 0; - continue; - } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { - _.label = op[1]; - break; - } - if (op[0] === 6 && _.label < t[1]) { - _.label = t[1]; - t = op; - break; - } - if (t && _.label < t[2]) { - _.label = t[2]; - _.ops.push(op); - break; - } - if (t[2]) - _.ops.pop(); - _.trys.pop(); - continue; - } - op = body.call(thisArg, _); - } - catch (e) { - op = [6, e]; - y = 0; - } - finally { - f = t = 0; - } - if (op[0] & 5) - throw op[1]; - return { value: op[0] ? op[1] : void 0, done: true }; - } - } - var __createBinding = Object.create ? (function (o, m, k, k2) { - if (k2 === undefined) - k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } }); - }) : (function (o, m, k, k2) { - if (k2 === undefined) - k2 = k; - o[k2] = m[k]; - }); - function __exportStar(m, o) { - for (var p in m) - if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) - __createBinding(o, m, p); - } - function __values(o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) - return m.call(o); - if (o && typeof o.length === "number") - return { - next: function () { - if (o && i >= o.length) - o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); - } - function __read(o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) - return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) - ar.push(r.value); - } - catch (error) { - e = { error: error }; - } - finally { - try { - if (r && !r.done && (m = i["return"])) - m.call(i); - } - finally { - if (e) - throw e.error; - } - } - return ar; - } - /** @deprecated */ - function __spread() { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; - } - /** @deprecated */ - function __spreadArrays() { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) - s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; - } - function __spreadArray(to, from, pack) { - if (pack || arguments.length === 2) - for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) - ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); - } - function __await(v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); - } - function __asyncGenerator(thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) - throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; - function verb(n) { if (g[n]) - i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } - function resume(n, v) { try { - step(g[n](v)); - } - catch (e) { - settle(q[0][3], e); - } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) - resume(q[0][0], q[0][1]); } - } - function __asyncDelegator(o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; - function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; } - } - function __asyncValues(o) { - if (!Symbol.asyncIterator) - throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); } - } - function __makeTemplateObject(cooked, raw) { - if (Object.defineProperty) { - Object.defineProperty(cooked, "raw", { value: raw }); - } - else { - cooked.raw = raw; - } - return cooked; - } - ; - var __setModuleDefault = Object.create ? (function (o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function (o, v) { - o["default"] = v; - }; - function __importStar(mod) { - if (mod && mod.__esModule) - return mod; - var result = {}; - if (mod != null) - for (var k in mod) - if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) - __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; - } - function __importDefault(mod) { - return (mod && mod.__esModule) ? mod : { default: mod }; - } - function __classPrivateFieldGet(receiver, state, kind, f) { - if (kind === "a" && !f) - throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) - throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); - } - function __classPrivateFieldSet(receiver, state, value, kind, f) { - if (kind === "m") - throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) - throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) - throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; - } - - function readQuads(store, subject, predicate, object, graph) { - return store.readQuads(subject, predicate, object, graph); - } - /** - * Turns a stream of values into an array. - * - * @param readStream The input stream. - * @returns A promise that resolves to an array of values when the stream completes. - */ - function streamToArray(readStream) { - return new Promise(function (resolve, reject) { - var chunks = []; - readStream - .on('data', function (chunk) { - chunks.push(chunk); - }) - .once('end', function () { - resolve(chunks); - }) - .once('error', function (err) { - reject(err); - }); - }); - } - /** - * Turns an array into a readable stream. - * - * @param arr The values. - * @returns A new readable stream emitting the values from the array. - */ - function arrayToStream(arr) { - var length = arr.length; - var i = 0; - return new readableStream.Readable({ - objectMode: true, - read: function () { - this.push(i < length ? arr[i++] : null); - } - }); - } - /** - * Adds data from json ld to the store. - * Accepts either a json object or a uri to load data from. - * - * @param uri A data uri or a json object. - * @param store The store to add data to. - * @returns A promise that resolves when the data has been added. - */ - function addJsonLdToStore(uri, store) { - return __awaiter(this, void 0, void 0, function () { - var jsonLdData, response, quads; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - if (!(typeof uri === 'string')) return [3 /*break*/, 4]; - return [4 /*yield*/, fetch(uri, { redirect: 'follow' })]; - case 1: - response = _a.sent(); - if (!response.ok) return [3 /*break*/, 3]; - return [4 /*yield*/, response.json()]; - case 2: - jsonLdData = (_a.sent()); - _a.label = 3; - case 3: return [3 /*break*/, 5]; - case 4: - jsonLdData = uri; - _a.label = 5; - case 5: - if (!jsonLdData) return [3 /*break*/, 7]; - return [4 /*yield*/, jsonld.toRDF(jsonLdData)]; - case 6: - quads = (_a.sent()); - store.import(arrayToStream(quads)); - _a.label = 7; - case 7: return [2 /*return*/, store]; - } - }); - }); - } - /** - * Adds data from rdf xml to the store. - * Accepts either a xml-formatted string or a uri to load data from. - * - * @param uri A data uri or an xml-formatted string to load data from. - * @param store The store to add data to - * @returns A promise that resolves when the data has been added. - */ - function addRdfXmlToStore(uri, store) { - return __awaiter(this, void 0, void 0, function () { - var xmlData, response, xmlParser_1, result; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - if (!(typeof uri === 'string' && (uri === null || uri === void 0 ? void 0 : uri.startsWith('http')))) return [3 /*break*/, 4]; - return [4 /*yield*/, fetch(uri, { redirect: 'follow' })]; - case 1: - response = _a.sent(); - if (!response.ok) return [3 /*break*/, 3]; - return [4 /*yield*/, response.text()]; - case 2: - xmlData = _a.sent(); - _a.label = 3; - case 3: return [3 /*break*/, 5]; - case 4: - xmlData = uri; - _a.label = 5; - case 5: - if (xmlData) { - xmlParser_1 = new rdfxmlStreamingParser.RdfXmlParser({ dataFactory: n3.DataFactory, strict: true }); - result = new Promise(function (resolve) { - xmlParser_1.once('end', function () { return resolve(store); }); - }); - store.import(xmlParser_1); - xmlParser_1.write(xmlData); - xmlParser_1.end(); - return [2 /*return*/, result]; - } - else { - return [2 /*return*/, store]; - } - return [2 /*return*/]; - } - }); - }); - } - /** - * Adds data from an n3 file to the store. - * Accepts either a n3-formatted string or a uri to load data from. - * - * @param uri A data uri or an n3-formatted string. - * @param store The store to add data to. - * @returns A promise that resolves when the data has been added. - */ - function addN3ToStore(uri, store) { - return __awaiter(this, void 0, void 0, function () { - var data, response, quads; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - if (!(typeof uri === 'string' && (uri === null || uri === void 0 ? void 0 : uri.startsWith('http')))) return [3 /*break*/, 4]; - return [4 /*yield*/, fetch(uri, { redirect: 'follow' })]; - case 1: - response = _a.sent(); - if (!response.ok) return [3 /*break*/, 3]; - return [4 /*yield*/, response.text()]; - case 2: - data = _a.sent(); - _a.label = 3; - case 3: return [3 /*break*/, 5]; - case 4: - data = uri; - _a.label = 5; - case 5: - if (data) { - quads = new n3.Parser({ format: 'n3' }).parse(data); - store.import(arrayToStream(quads)); - } - return [2 /*return*/, store]; - } - }); - }); - } - function serializeN3Store(store) { - // eslint-disable-next-line @typescript-eslint/no-unused-expressions - store.size; // this causes the store to compute the size before we serialize it - var storeData = Object.assign({}, store); - // eslint-disable-next-line no-underscore-dangle - delete storeData._factory; - return JSON.stringify(storeData); - } - function deserializeN3Store(serializedStore, factory) { - var storeData = JSON.parse(serializedStore); - var store = new n3.Store(); - // eslint-disable-next-line @typescript-eslint/naming-convention - Object.assign(store, storeData, { _factory: factory !== null && factory !== void 0 ? factory : n3.DataFactory }); - return store; - } - - /* - * Public API Surface of triple-store-utils - */ - - /** - * Generated bundle index. Do not edit. - */ - - exports.addJsonLdToStore = addJsonLdToStore; - exports.addN3ToStore = addN3ToStore; - exports.addRdfXmlToStore = addRdfXmlToStore; - exports.arrayToStream = arrayToStream; - exports.deserializeN3Store = deserializeN3Store; - exports.readQuads = readQuads; - exports.serializeN3Store = serializeN3Store; - exports.streamToArray = streamToArray; - Object.keys(n3).forEach(function (k) { - if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, { - enumerable: true, - get: function () { - return n3[k]; - } - }); - }); - - Object.defineProperty(exports, '__esModule', { value: true }); - -}))); - - -},{"jsonld":26,"n3":43,"rdfxml-streaming-parser":64,"readable-stream":81}],2:[function(require,module,exports){ -'use strict' - -exports.byteLength = byteLength -exports.toByteArray = toByteArray -exports.fromByteArray = fromByteArray - -var lookup = [] -var revLookup = [] -var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array - -var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' -for (var i = 0, len = code.length; i < len; ++i) { - lookup[i] = code[i] - revLookup[code.charCodeAt(i)] = i -} - -// Support decoding URL-safe base64 strings, as Node.js does. -// See: https://en.wikipedia.org/wiki/Base64#URL_applications -revLookup['-'.charCodeAt(0)] = 62 -revLookup['_'.charCodeAt(0)] = 63 - -function getLens (b64) { - var len = b64.length - - if (len % 4 > 0) { - throw new Error('Invalid string. Length must be a multiple of 4') - } - - // Trim off extra bytes after placeholder bytes are found - // See: https://github.com/beatgammit/base64-js/issues/42 - var validLen = b64.indexOf('=') - if (validLen === -1) validLen = len - - var placeHoldersLen = validLen === len - ? 0 - : 4 - (validLen % 4) - - return [validLen, placeHoldersLen] -} - -// base64 is 4/3 + up to two characters of the original data -function byteLength (b64) { - var lens = getLens(b64) - var validLen = lens[0] - var placeHoldersLen = lens[1] - return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen -} - -function _byteLength (b64, validLen, placeHoldersLen) { - return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen -} - -function toByteArray (b64) { - var tmp - var lens = getLens(b64) - var validLen = lens[0] - var placeHoldersLen = lens[1] - - var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen)) - - var curByte = 0 - - // if there are placeholders, only get up to the last complete 4 chars - var len = placeHoldersLen > 0 - ? validLen - 4 - : validLen - - var i - for (i = 0; i < len; i += 4) { - tmp = - (revLookup[b64.charCodeAt(i)] << 18) | - (revLookup[b64.charCodeAt(i + 1)] << 12) | - (revLookup[b64.charCodeAt(i + 2)] << 6) | - revLookup[b64.charCodeAt(i + 3)] - arr[curByte++] = (tmp >> 16) & 0xFF - arr[curByte++] = (tmp >> 8) & 0xFF - arr[curByte++] = tmp & 0xFF - } - - if (placeHoldersLen === 2) { - tmp = - (revLookup[b64.charCodeAt(i)] << 2) | - (revLookup[b64.charCodeAt(i + 1)] >> 4) - arr[curByte++] = tmp & 0xFF - } - - if (placeHoldersLen === 1) { - tmp = - (revLookup[b64.charCodeAt(i)] << 10) | - (revLookup[b64.charCodeAt(i + 1)] << 4) | - (revLookup[b64.charCodeAt(i + 2)] >> 2) - arr[curByte++] = (tmp >> 8) & 0xFF - arr[curByte++] = tmp & 0xFF - } - - return arr -} - -function tripletToBase64 (num) { - return lookup[num >> 18 & 0x3F] + - lookup[num >> 12 & 0x3F] + - lookup[num >> 6 & 0x3F] + - lookup[num & 0x3F] -} - -function encodeChunk (uint8, start, end) { - var tmp - var output = [] - for (var i = start; i < end; i += 3) { - tmp = - ((uint8[i] << 16) & 0xFF0000) + - ((uint8[i + 1] << 8) & 0xFF00) + - (uint8[i + 2] & 0xFF) - output.push(tripletToBase64(tmp)) - } - return output.join('') -} - -function fromByteArray (uint8) { - var tmp - var len = uint8.length - var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes - var parts = [] - var maxChunkLength = 16383 // must be multiple of 3 - - // go through the array every three bytes, we'll deal with trailing stuff later - for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) { - parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength))) - } - - // pad the end with zeros, but make sure to not forget the extra bytes - if (extraBytes === 1) { - tmp = uint8[len - 1] - parts.push( - lookup[tmp >> 2] + - lookup[(tmp << 4) & 0x3F] + - '==' - ) - } else if (extraBytes === 2) { - tmp = (uint8[len - 2] << 8) + uint8[len - 1] - parts.push( - lookup[tmp >> 10] + - lookup[(tmp >> 4) & 0x3F] + - lookup[(tmp << 2) & 0x3F] + - '=' - ) - } - - return parts.join('') -} - -},{}],3:[function(require,module,exports){ - -},{}],4:[function(require,module,exports){ -/* eslint-disable node/no-deprecated-api */ -var buffer = require('buffer') -var Buffer = buffer.Buffer - -// alternative to using Object.keys for old browsers -function copyProps (src, dst) { - for (var key in src) { - dst[key] = src[key] - } -} -if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) { - module.exports = buffer -} else { - // Copy properties from require('buffer') - copyProps(buffer, exports) - exports.Buffer = SafeBuffer -} - -function SafeBuffer (arg, encodingOrOffset, length) { - return Buffer(arg, encodingOrOffset, length) -} - -// Copy static methods from Buffer -copyProps(Buffer, SafeBuffer) - -SafeBuffer.from = function (arg, encodingOrOffset, length) { - if (typeof arg === 'number') { - throw new TypeError('Argument must not be a number') - } - return Buffer(arg, encodingOrOffset, length) -} - -SafeBuffer.alloc = function (size, fill, encoding) { - if (typeof size !== 'number') { - throw new TypeError('Argument must be a number') - } - var buf = Buffer(size) - if (fill !== undefined) { - if (typeof encoding === 'string') { - buf.fill(fill, encoding) - } else { - buf.fill(fill) - } - } else { - buf.fill(0) - } - return buf -} - -SafeBuffer.allocUnsafe = function (size) { - if (typeof size !== 'number') { - throw new TypeError('Argument must be a number') - } - return Buffer(size) -} - -SafeBuffer.allocUnsafeSlow = function (size) { - if (typeof size !== 'number') { - throw new TypeError('Argument must be a number') - } - return buffer.SlowBuffer(size) -} - -},{"buffer":6}],5:[function(require,module,exports){ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -'use strict'; - -/**/ - -var Buffer = require('safe-buffer').Buffer; -/**/ - -var isEncoding = Buffer.isEncoding || function (encoding) { - encoding = '' + encoding; - switch (encoding && encoding.toLowerCase()) { - case 'hex':case 'utf8':case 'utf-8':case 'ascii':case 'binary':case 'base64':case 'ucs2':case 'ucs-2':case 'utf16le':case 'utf-16le':case 'raw': - return true; - default: - return false; - } -}; - -function _normalizeEncoding(enc) { - if (!enc) return 'utf8'; - var retried; - while (true) { - switch (enc) { - case 'utf8': - case 'utf-8': - return 'utf8'; - case 'ucs2': - case 'ucs-2': - case 'utf16le': - case 'utf-16le': - return 'utf16le'; - case 'latin1': - case 'binary': - return 'latin1'; - case 'base64': - case 'ascii': - case 'hex': - return enc; - default: - if (retried) return; // undefined - enc = ('' + enc).toLowerCase(); - retried = true; - } - } -}; - -// Do not cache `Buffer.isEncoding` when checking encoding names as some -// modules monkey-patch it to support additional encodings -function normalizeEncoding(enc) { - var nenc = _normalizeEncoding(enc); - if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc); - return nenc || enc; -} - -// StringDecoder provides an interface for efficiently splitting a series of -// buffers into a series of JS strings without breaking apart multi-byte -// characters. -exports.StringDecoder = StringDecoder; -function StringDecoder(encoding) { - this.encoding = normalizeEncoding(encoding); - var nb; - switch (this.encoding) { - case 'utf16le': - this.text = utf16Text; - this.end = utf16End; - nb = 4; - break; - case 'utf8': - this.fillLast = utf8FillLast; - nb = 4; - break; - case 'base64': - this.text = base64Text; - this.end = base64End; - nb = 3; - break; - default: - this.write = simpleWrite; - this.end = simpleEnd; - return; - } - this.lastNeed = 0; - this.lastTotal = 0; - this.lastChar = Buffer.allocUnsafe(nb); -} - -StringDecoder.prototype.write = function (buf) { - if (buf.length === 0) return ''; - var r; - var i; - if (this.lastNeed) { - r = this.fillLast(buf); - if (r === undefined) return ''; - i = this.lastNeed; - this.lastNeed = 0; - } else { - i = 0; - } - if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i); - return r || ''; -}; - -StringDecoder.prototype.end = utf8End; - -// Returns only complete characters in a Buffer -StringDecoder.prototype.text = utf8Text; - -// Attempts to complete a partial non-UTF-8 character using bytes from a Buffer -StringDecoder.prototype.fillLast = function (buf) { - if (this.lastNeed <= buf.length) { - buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed); - return this.lastChar.toString(this.encoding, 0, this.lastTotal); - } - buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length); - this.lastNeed -= buf.length; -}; - -// Checks the type of a UTF-8 byte, whether it's ASCII, a leading byte, or a -// continuation byte. If an invalid byte is detected, -2 is returned. -function utf8CheckByte(byte) { - if (byte <= 0x7F) return 0;else if (byte >> 5 === 0x06) return 2;else if (byte >> 4 === 0x0E) return 3;else if (byte >> 3 === 0x1E) return 4; - return byte >> 6 === 0x02 ? -1 : -2; -} - -// Checks at most 3 bytes at the end of a Buffer in order to detect an -// incomplete multi-byte UTF-8 character. The total number of bytes (2, 3, or 4) -// needed to complete the UTF-8 character (if applicable) are returned. -function utf8CheckIncomplete(self, buf, i) { - var j = buf.length - 1; - if (j < i) return 0; - var nb = utf8CheckByte(buf[j]); - if (nb >= 0) { - if (nb > 0) self.lastNeed = nb - 1; - return nb; - } - if (--j < i || nb === -2) return 0; - nb = utf8CheckByte(buf[j]); - if (nb >= 0) { - if (nb > 0) self.lastNeed = nb - 2; - return nb; - } - if (--j < i || nb === -2) return 0; - nb = utf8CheckByte(buf[j]); - if (nb >= 0) { - if (nb > 0) { - if (nb === 2) nb = 0;else self.lastNeed = nb - 3; - } - return nb; - } - return 0; -} - -// Validates as many continuation bytes for a multi-byte UTF-8 character as -// needed or are available. If we see a non-continuation byte where we expect -// one, we "replace" the validated continuation bytes we've seen so far with -// a single UTF-8 replacement character ('\ufffd'), to match v8's UTF-8 decoding -// behavior. The continuation byte check is included three times in the case -// where all of the continuation bytes for a character exist in the same buffer. -// It is also done this way as a slight performance increase instead of using a -// loop. -function utf8CheckExtraBytes(self, buf, p) { - if ((buf[0] & 0xC0) !== 0x80) { - self.lastNeed = 0; - return '\ufffd'; - } - if (self.lastNeed > 1 && buf.length > 1) { - if ((buf[1] & 0xC0) !== 0x80) { - self.lastNeed = 1; - return '\ufffd'; - } - if (self.lastNeed > 2 && buf.length > 2) { - if ((buf[2] & 0xC0) !== 0x80) { - self.lastNeed = 2; - return '\ufffd'; - } - } - } -} - -// Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer. -function utf8FillLast(buf) { - var p = this.lastTotal - this.lastNeed; - var r = utf8CheckExtraBytes(this, buf, p); - if (r !== undefined) return r; - if (this.lastNeed <= buf.length) { - buf.copy(this.lastChar, p, 0, this.lastNeed); - return this.lastChar.toString(this.encoding, 0, this.lastTotal); - } - buf.copy(this.lastChar, p, 0, buf.length); - this.lastNeed -= buf.length; -} - -// Returns all complete UTF-8 characters in a Buffer. If the Buffer ended on a -// partial character, the character's bytes are buffered until the required -// number of bytes are available. -function utf8Text(buf, i) { - var total = utf8CheckIncomplete(this, buf, i); - if (!this.lastNeed) return buf.toString('utf8', i); - this.lastTotal = total; - var end = buf.length - (total - this.lastNeed); - buf.copy(this.lastChar, 0, end); - return buf.toString('utf8', i, end); -} - -// For UTF-8, a replacement character is added when ending on a partial -// character. -function utf8End(buf) { - var r = buf && buf.length ? this.write(buf) : ''; - if (this.lastNeed) return r + '\ufffd'; - return r; -} - -// UTF-16LE typically needs two bytes per character, but even if we have an even -// number of bytes available, we need to check if we end on a leading/high -// surrogate. In that case, we need to wait for the next two bytes in order to -// decode the last character properly. -function utf16Text(buf, i) { - if ((buf.length - i) % 2 === 0) { - var r = buf.toString('utf16le', i); - if (r) { - var c = r.charCodeAt(r.length - 1); - if (c >= 0xD800 && c <= 0xDBFF) { - this.lastNeed = 2; - this.lastTotal = 4; - this.lastChar[0] = buf[buf.length - 2]; - this.lastChar[1] = buf[buf.length - 1]; - return r.slice(0, -1); - } - } - return r; - } - this.lastNeed = 1; - this.lastTotal = 2; - this.lastChar[0] = buf[buf.length - 1]; - return buf.toString('utf16le', i, buf.length - 1); -} - -// For UTF-16LE we do not explicitly append special replacement characters if we -// end on a partial character, we simply let v8 handle that. -function utf16End(buf) { - var r = buf && buf.length ? this.write(buf) : ''; - if (this.lastNeed) { - var end = this.lastTotal - this.lastNeed; - return r + this.lastChar.toString('utf16le', 0, end); - } - return r; -} - -function base64Text(buf, i) { - var n = (buf.length - i) % 3; - if (n === 0) return buf.toString('base64', i); - this.lastNeed = 3 - n; - this.lastTotal = 3; - if (n === 1) { - this.lastChar[0] = buf[buf.length - 1]; - } else { - this.lastChar[0] = buf[buf.length - 2]; - this.lastChar[1] = buf[buf.length - 1]; - } - return buf.toString('base64', i, buf.length - n); -} - -function base64End(buf) { - var r = buf && buf.length ? this.write(buf) : ''; - if (this.lastNeed) return r + this.lastChar.toString('base64', 0, 3 - this.lastNeed); - return r; -} - -// Pass bytes on through for single-byte encodings (e.g. ascii, latin1, hex) -function simpleWrite(buf) { - return buf.toString(this.encoding); -} - -function simpleEnd(buf) { - return buf && buf.length ? this.write(buf) : ''; -} -},{"safe-buffer":4}],6:[function(require,module,exports){ -(function (Buffer){(function (){ -/*! - * The buffer module from node.js, for the browser. - * - * @author Feross Aboukhadijeh - * @license MIT - */ -/* eslint-disable no-proto */ - -'use strict' - -var base64 = require('base64-js') -var ieee754 = require('ieee754') - -exports.Buffer = Buffer -exports.SlowBuffer = SlowBuffer -exports.INSPECT_MAX_BYTES = 50 - -var K_MAX_LENGTH = 0x7fffffff -exports.kMaxLength = K_MAX_LENGTH - -/** - * If `Buffer.TYPED_ARRAY_SUPPORT`: - * === true Use Uint8Array implementation (fastest) - * === false Print warning and recommend using `buffer` v4.x which has an Object - * implementation (most compatible, even IE6) - * - * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+, - * Opera 11.6+, iOS 4.2+. - * - * We report that the browser does not support typed arrays if the are not subclassable - * using __proto__. Firefox 4-29 lacks support for adding new properties to `Uint8Array` - * (See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438). IE 10 lacks support - * for __proto__ and has a buggy typed array implementation. - */ -Buffer.TYPED_ARRAY_SUPPORT = typedArraySupport() - -if (!Buffer.TYPED_ARRAY_SUPPORT && typeof console !== 'undefined' && - typeof console.error === 'function') { - console.error( - 'This browser lacks typed array (Uint8Array) support which is required by ' + - '`buffer` v5.x. Use `buffer` v4.x if you require old browser support.' - ) -} - -function typedArraySupport () { - // Can typed array instances can be augmented? - try { - var arr = new Uint8Array(1) - arr.__proto__ = { __proto__: Uint8Array.prototype, foo: function () { return 42 } } - return arr.foo() === 42 - } catch (e) { - return false - } -} - -Object.defineProperty(Buffer.prototype, 'parent', { - enumerable: true, - get: function () { - if (!Buffer.isBuffer(this)) return undefined - return this.buffer - } -}) - -Object.defineProperty(Buffer.prototype, 'offset', { - enumerable: true, - get: function () { - if (!Buffer.isBuffer(this)) return undefined - return this.byteOffset - } -}) - -function createBuffer (length) { - if (length > K_MAX_LENGTH) { - throw new RangeError('The value "' + length + '" is invalid for option "size"') - } - // Return an augmented `Uint8Array` instance - var buf = new Uint8Array(length) - buf.__proto__ = Buffer.prototype - return buf -} - -/** - * The Buffer constructor returns instances of `Uint8Array` that have their - * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of - * `Uint8Array`, so the returned instances will have all the node `Buffer` methods - * and the `Uint8Array` methods. Square bracket notation works as expected -- it - * returns a single octet. - * - * The `Uint8Array` prototype remains unmodified. - */ - -function Buffer (arg, encodingOrOffset, length) { - // Common case. - if (typeof arg === 'number') { - if (typeof encodingOrOffset === 'string') { - throw new TypeError( - 'The "string" argument must be of type string. Received type number' - ) - } - return allocUnsafe(arg) - } - return from(arg, encodingOrOffset, length) -} - -// Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97 -if (typeof Symbol !== 'undefined' && Symbol.species != null && - Buffer[Symbol.species] === Buffer) { - Object.defineProperty(Buffer, Symbol.species, { - value: null, - configurable: true, - enumerable: false, - writable: false - }) -} - -Buffer.poolSize = 8192 // not used by this implementation - -function from (value, encodingOrOffset, length) { - if (typeof value === 'string') { - return fromString(value, encodingOrOffset) - } - - if (ArrayBuffer.isView(value)) { - return fromArrayLike(value) - } - - if (value == null) { - throw TypeError( - 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' + - 'or Array-like Object. Received type ' + (typeof value) - ) - } - - if (isInstance(value, ArrayBuffer) || - (value && isInstance(value.buffer, ArrayBuffer))) { - return fromArrayBuffer(value, encodingOrOffset, length) - } - - if (typeof value === 'number') { - throw new TypeError( - 'The "value" argument must not be of type number. Received type number' - ) - } - - var valueOf = value.valueOf && value.valueOf() - if (valueOf != null && valueOf !== value) { - return Buffer.from(valueOf, encodingOrOffset, length) - } - - var b = fromObject(value) - if (b) return b - - if (typeof Symbol !== 'undefined' && Symbol.toPrimitive != null && - typeof value[Symbol.toPrimitive] === 'function') { - return Buffer.from( - value[Symbol.toPrimitive]('string'), encodingOrOffset, length - ) - } - - throw new TypeError( - 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' + - 'or Array-like Object. Received type ' + (typeof value) - ) -} - -/** - * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError - * if value is a number. - * Buffer.from(str[, encoding]) - * Buffer.from(array) - * Buffer.from(buffer) - * Buffer.from(arrayBuffer[, byteOffset[, length]]) - **/ -Buffer.from = function (value, encodingOrOffset, length) { - return from(value, encodingOrOffset, length) -} - -// Note: Change prototype *after* Buffer.from is defined to workaround Chrome bug: -// https://github.com/feross/buffer/pull/148 -Buffer.prototype.__proto__ = Uint8Array.prototype -Buffer.__proto__ = Uint8Array - -function assertSize (size) { - if (typeof size !== 'number') { - throw new TypeError('"size" argument must be of type number') - } else if (size < 0) { - throw new RangeError('The value "' + size + '" is invalid for option "size"') - } -} - -function alloc (size, fill, encoding) { - assertSize(size) - if (size <= 0) { - return createBuffer(size) - } - if (fill !== undefined) { - // Only pay attention to encoding if it's a string. This - // prevents accidentally sending in a number that would - // be interpretted as a start offset. - return typeof encoding === 'string' - ? createBuffer(size).fill(fill, encoding) - : createBuffer(size).fill(fill) - } - return createBuffer(size) -} - -/** - * Creates a new filled Buffer instance. - * alloc(size[, fill[, encoding]]) - **/ -Buffer.alloc = function (size, fill, encoding) { - return alloc(size, fill, encoding) -} - -function allocUnsafe (size) { - assertSize(size) - return createBuffer(size < 0 ? 0 : checked(size) | 0) -} - -/** - * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance. - * */ -Buffer.allocUnsafe = function (size) { - return allocUnsafe(size) -} -/** - * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. - */ -Buffer.allocUnsafeSlow = function (size) { - return allocUnsafe(size) -} - -function fromString (string, encoding) { - if (typeof encoding !== 'string' || encoding === '') { - encoding = 'utf8' - } - - if (!Buffer.isEncoding(encoding)) { - throw new TypeError('Unknown encoding: ' + encoding) - } - - var length = byteLength(string, encoding) | 0 - var buf = createBuffer(length) - - var actual = buf.write(string, encoding) - - if (actual !== length) { - // Writing a hex string, for example, that contains invalid characters will - // cause everything after the first invalid character to be ignored. (e.g. - // 'abxxcd' will be treated as 'ab') - buf = buf.slice(0, actual) - } - - return buf -} - -function fromArrayLike (array) { - var length = array.length < 0 ? 0 : checked(array.length) | 0 - var buf = createBuffer(length) - for (var i = 0; i < length; i += 1) { - buf[i] = array[i] & 255 - } - return buf -} - -function fromArrayBuffer (array, byteOffset, length) { - if (byteOffset < 0 || array.byteLength < byteOffset) { - throw new RangeError('"offset" is outside of buffer bounds') - } - - if (array.byteLength < byteOffset + (length || 0)) { - throw new RangeError('"length" is outside of buffer bounds') - } - - var buf - if (byteOffset === undefined && length === undefined) { - buf = new Uint8Array(array) - } else if (length === undefined) { - buf = new Uint8Array(array, byteOffset) - } else { - buf = new Uint8Array(array, byteOffset, length) - } - - // Return an augmented `Uint8Array` instance - buf.__proto__ = Buffer.prototype - return buf -} - -function fromObject (obj) { - if (Buffer.isBuffer(obj)) { - var len = checked(obj.length) | 0 - var buf = createBuffer(len) - - if (buf.length === 0) { - return buf - } - - obj.copy(buf, 0, 0, len) - return buf - } - - if (obj.length !== undefined) { - if (typeof obj.length !== 'number' || numberIsNaN(obj.length)) { - return createBuffer(0) - } - return fromArrayLike(obj) - } - - if (obj.type === 'Buffer' && Array.isArray(obj.data)) { - return fromArrayLike(obj.data) - } -} - -function checked (length) { - // Note: cannot use `length < K_MAX_LENGTH` here because that fails when - // length is NaN (which is otherwise coerced to zero.) - if (length >= K_MAX_LENGTH) { - throw new RangeError('Attempt to allocate Buffer larger than maximum ' + - 'size: 0x' + K_MAX_LENGTH.toString(16) + ' bytes') - } - return length | 0 -} - -function SlowBuffer (length) { - if (+length != length) { // eslint-disable-line eqeqeq - length = 0 - } - return Buffer.alloc(+length) -} - -Buffer.isBuffer = function isBuffer (b) { - return b != null && b._isBuffer === true && - b !== Buffer.prototype // so Buffer.isBuffer(Buffer.prototype) will be false -} - -Buffer.compare = function compare (a, b) { - if (isInstance(a, Uint8Array)) a = Buffer.from(a, a.offset, a.byteLength) - if (isInstance(b, Uint8Array)) b = Buffer.from(b, b.offset, b.byteLength) - if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) { - throw new TypeError( - 'The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array' - ) - } - - if (a === b) return 0 - - var x = a.length - var y = b.length - - for (var i = 0, len = Math.min(x, y); i < len; ++i) { - if (a[i] !== b[i]) { - x = a[i] - y = b[i] - break - } - } - - if (x < y) return -1 - if (y < x) return 1 - return 0 -} - -Buffer.isEncoding = function isEncoding (encoding) { - switch (String(encoding).toLowerCase()) { - case 'hex': - case 'utf8': - case 'utf-8': - case 'ascii': - case 'latin1': - case 'binary': - case 'base64': - case 'ucs2': - case 'ucs-2': - case 'utf16le': - case 'utf-16le': - return true - default: - return false - } -} - -Buffer.concat = function concat (list, length) { - if (!Array.isArray(list)) { - throw new TypeError('"list" argument must be an Array of Buffers') - } - - if (list.length === 0) { - return Buffer.alloc(0) - } - - var i - if (length === undefined) { - length = 0 - for (i = 0; i < list.length; ++i) { - length += list[i].length - } - } - - var buffer = Buffer.allocUnsafe(length) - var pos = 0 - for (i = 0; i < list.length; ++i) { - var buf = list[i] - if (isInstance(buf, Uint8Array)) { - buf = Buffer.from(buf) - } - if (!Buffer.isBuffer(buf)) { - throw new TypeError('"list" argument must be an Array of Buffers') - } - buf.copy(buffer, pos) - pos += buf.length - } - return buffer -} - -function byteLength (string, encoding) { - if (Buffer.isBuffer(string)) { - return string.length - } - if (ArrayBuffer.isView(string) || isInstance(string, ArrayBuffer)) { - return string.byteLength - } - if (typeof string !== 'string') { - throw new TypeError( - 'The "string" argument must be one of type string, Buffer, or ArrayBuffer. ' + - 'Received type ' + typeof string - ) - } - - var len = string.length - var mustMatch = (arguments.length > 2 && arguments[2] === true) - if (!mustMatch && len === 0) return 0 - - // Use a for loop to avoid recursion - var loweredCase = false - for (;;) { - switch (encoding) { - case 'ascii': - case 'latin1': - case 'binary': - return len - case 'utf8': - case 'utf-8': - return utf8ToBytes(string).length - case 'ucs2': - case 'ucs-2': - case 'utf16le': - case 'utf-16le': - return len * 2 - case 'hex': - return len >>> 1 - case 'base64': - return base64ToBytes(string).length - default: - if (loweredCase) { - return mustMatch ? -1 : utf8ToBytes(string).length // assume utf8 - } - encoding = ('' + encoding).toLowerCase() - loweredCase = true - } - } -} -Buffer.byteLength = byteLength - -function slowToString (encoding, start, end) { - var loweredCase = false - - // No need to verify that "this.length <= MAX_UINT32" since it's a read-only - // property of a typed array. - - // This behaves neither like String nor Uint8Array in that we set start/end - // to their upper/lower bounds if the value passed is out of range. - // undefined is handled specially as per ECMA-262 6th Edition, - // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization. - if (start === undefined || start < 0) { - start = 0 - } - // Return early if start > this.length. Done here to prevent potential uint32 - // coercion fail below. - if (start > this.length) { - return '' - } - - if (end === undefined || end > this.length) { - end = this.length - } - - if (end <= 0) { - return '' - } - - // Force coersion to uint32. This will also coerce falsey/NaN values to 0. - end >>>= 0 - start >>>= 0 - - if (end <= start) { - return '' - } - - if (!encoding) encoding = 'utf8' - - while (true) { - switch (encoding) { - case 'hex': - return hexSlice(this, start, end) - - case 'utf8': - case 'utf-8': - return utf8Slice(this, start, end) - - case 'ascii': - return asciiSlice(this, start, end) - - case 'latin1': - case 'binary': - return latin1Slice(this, start, end) - - case 'base64': - return base64Slice(this, start, end) - - case 'ucs2': - case 'ucs-2': - case 'utf16le': - case 'utf-16le': - return utf16leSlice(this, start, end) - - default: - if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding) - encoding = (encoding + '').toLowerCase() - loweredCase = true - } - } -} - -// This property is used by `Buffer.isBuffer` (and the `is-buffer` npm package) -// to detect a Buffer instance. It's not possible to use `instanceof Buffer` -// reliably in a browserify context because there could be multiple different -// copies of the 'buffer' package in use. This method works even for Buffer -// instances that were created from another copy of the `buffer` package. -// See: https://github.com/feross/buffer/issues/154 -Buffer.prototype._isBuffer = true - -function swap (b, n, m) { - var i = b[n] - b[n] = b[m] - b[m] = i -} - -Buffer.prototype.swap16 = function swap16 () { - var len = this.length - if (len % 2 !== 0) { - throw new RangeError('Buffer size must be a multiple of 16-bits') - } - for (var i = 0; i < len; i += 2) { - swap(this, i, i + 1) - } - return this -} - -Buffer.prototype.swap32 = function swap32 () { - var len = this.length - if (len % 4 !== 0) { - throw new RangeError('Buffer size must be a multiple of 32-bits') - } - for (var i = 0; i < len; i += 4) { - swap(this, i, i + 3) - swap(this, i + 1, i + 2) - } - return this -} - -Buffer.prototype.swap64 = function swap64 () { - var len = this.length - if (len % 8 !== 0) { - throw new RangeError('Buffer size must be a multiple of 64-bits') - } - for (var i = 0; i < len; i += 8) { - swap(this, i, i + 7) - swap(this, i + 1, i + 6) - swap(this, i + 2, i + 5) - swap(this, i + 3, i + 4) - } - return this -} - -Buffer.prototype.toString = function toString () { - var length = this.length - if (length === 0) return '' - if (arguments.length === 0) return utf8Slice(this, 0, length) - return slowToString.apply(this, arguments) -} - -Buffer.prototype.toLocaleString = Buffer.prototype.toString - -Buffer.prototype.equals = function equals (b) { - if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer') - if (this === b) return true - return Buffer.compare(this, b) === 0 -} - -Buffer.prototype.inspect = function inspect () { - var str = '' - var max = exports.INSPECT_MAX_BYTES - str = this.toString('hex', 0, max).replace(/(.{2})/g, '$1 ').trim() - if (this.length > max) str += ' ... ' - return '' -} - -Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) { - if (isInstance(target, Uint8Array)) { - target = Buffer.from(target, target.offset, target.byteLength) - } - if (!Buffer.isBuffer(target)) { - throw new TypeError( - 'The "target" argument must be one of type Buffer or Uint8Array. ' + - 'Received type ' + (typeof target) - ) - } - - if (start === undefined) { - start = 0 - } - if (end === undefined) { - end = target ? target.length : 0 - } - if (thisStart === undefined) { - thisStart = 0 - } - if (thisEnd === undefined) { - thisEnd = this.length - } - - if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) { - throw new RangeError('out of range index') - } - - if (thisStart >= thisEnd && start >= end) { - return 0 - } - if (thisStart >= thisEnd) { - return -1 - } - if (start >= end) { - return 1 - } - - start >>>= 0 - end >>>= 0 - thisStart >>>= 0 - thisEnd >>>= 0 - - if (this === target) return 0 - - var x = thisEnd - thisStart - var y = end - start - var len = Math.min(x, y) - - var thisCopy = this.slice(thisStart, thisEnd) - var targetCopy = target.slice(start, end) - - for (var i = 0; i < len; ++i) { - if (thisCopy[i] !== targetCopy[i]) { - x = thisCopy[i] - y = targetCopy[i] - break - } - } - - if (x < y) return -1 - if (y < x) return 1 - return 0 -} - -// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`, -// OR the last index of `val` in `buffer` at offset <= `byteOffset`. -// -// Arguments: -// - buffer - a Buffer to search -// - val - a string, Buffer, or number -// - byteOffset - an index into `buffer`; will be clamped to an int32 -// - encoding - an optional encoding, relevant is val is a string -// - dir - true for indexOf, false for lastIndexOf -function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) { - // Empty buffer means no match - if (buffer.length === 0) return -1 - - // Normalize byteOffset - if (typeof byteOffset === 'string') { - encoding = byteOffset - byteOffset = 0 - } else if (byteOffset > 0x7fffffff) { - byteOffset = 0x7fffffff - } else if (byteOffset < -0x80000000) { - byteOffset = -0x80000000 - } - byteOffset = +byteOffset // Coerce to Number. - if (numberIsNaN(byteOffset)) { - // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer - byteOffset = dir ? 0 : (buffer.length - 1) - } - - // Normalize byteOffset: negative offsets start from the end of the buffer - if (byteOffset < 0) byteOffset = buffer.length + byteOffset - if (byteOffset >= buffer.length) { - if (dir) return -1 - else byteOffset = buffer.length - 1 - } else if (byteOffset < 0) { - if (dir) byteOffset = 0 - else return -1 - } - - // Normalize val - if (typeof val === 'string') { - val = Buffer.from(val, encoding) - } - - // Finally, search either indexOf (if dir is true) or lastIndexOf - if (Buffer.isBuffer(val)) { - // Special case: looking for empty string/buffer always fails - if (val.length === 0) { - return -1 - } - return arrayIndexOf(buffer, val, byteOffset, encoding, dir) - } else if (typeof val === 'number') { - val = val & 0xFF // Search for a byte value [0-255] - if (typeof Uint8Array.prototype.indexOf === 'function') { - if (dir) { - return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset) - } else { - return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset) - } - } - return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir) - } - - throw new TypeError('val must be string, number or Buffer') -} - -function arrayIndexOf (arr, val, byteOffset, encoding, dir) { - var indexSize = 1 - var arrLength = arr.length - var valLength = val.length - - if (encoding !== undefined) { - encoding = String(encoding).toLowerCase() - if (encoding === 'ucs2' || encoding === 'ucs-2' || - encoding === 'utf16le' || encoding === 'utf-16le') { - if (arr.length < 2 || val.length < 2) { - return -1 - } - indexSize = 2 - arrLength /= 2 - valLength /= 2 - byteOffset /= 2 - } - } - - function read (buf, i) { - if (indexSize === 1) { - return buf[i] - } else { - return buf.readUInt16BE(i * indexSize) - } - } - - var i - if (dir) { - var foundIndex = -1 - for (i = byteOffset; i < arrLength; i++) { - if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) { - if (foundIndex === -1) foundIndex = i - if (i - foundIndex + 1 === valLength) return foundIndex * indexSize - } else { - if (foundIndex !== -1) i -= i - foundIndex - foundIndex = -1 - } - } - } else { - if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength - for (i = byteOffset; i >= 0; i--) { - var found = true - for (var j = 0; j < valLength; j++) { - if (read(arr, i + j) !== read(val, j)) { - found = false - break - } - } - if (found) return i - } - } - - return -1 -} - -Buffer.prototype.includes = function includes (val, byteOffset, encoding) { - return this.indexOf(val, byteOffset, encoding) !== -1 -} - -Buffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) { - return bidirectionalIndexOf(this, val, byteOffset, encoding, true) -} - -Buffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) { - return bidirectionalIndexOf(this, val, byteOffset, encoding, false) -} - -function hexWrite (buf, string, offset, length) { - offset = Number(offset) || 0 - var remaining = buf.length - offset - if (!length) { - length = remaining - } else { - length = Number(length) - if (length > remaining) { - length = remaining - } - } - - var strLen = string.length - - if (length > strLen / 2) { - length = strLen / 2 - } - for (var i = 0; i < length; ++i) { - var parsed = parseInt(string.substr(i * 2, 2), 16) - if (numberIsNaN(parsed)) return i - buf[offset + i] = parsed - } - return i -} - -function utf8Write (buf, string, offset, length) { - return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length) -} - -function asciiWrite (buf, string, offset, length) { - return blitBuffer(asciiToBytes(string), buf, offset, length) -} - -function latin1Write (buf, string, offset, length) { - return asciiWrite(buf, string, offset, length) -} - -function base64Write (buf, string, offset, length) { - return blitBuffer(base64ToBytes(string), buf, offset, length) -} - -function ucs2Write (buf, string, offset, length) { - return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length) -} - -Buffer.prototype.write = function write (string, offset, length, encoding) { - // Buffer#write(string) - if (offset === undefined) { - encoding = 'utf8' - length = this.length - offset = 0 - // Buffer#write(string, encoding) - } else if (length === undefined && typeof offset === 'string') { - encoding = offset - length = this.length - offset = 0 - // Buffer#write(string, offset[, length][, encoding]) - } else if (isFinite(offset)) { - offset = offset >>> 0 - if (isFinite(length)) { - length = length >>> 0 - if (encoding === undefined) encoding = 'utf8' - } else { - encoding = length - length = undefined - } - } else { - throw new Error( - 'Buffer.write(string, encoding, offset[, length]) is no longer supported' - ) - } - - var remaining = this.length - offset - if (length === undefined || length > remaining) length = remaining - - if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) { - throw new RangeError('Attempt to write outside buffer bounds') - } - - if (!encoding) encoding = 'utf8' - - var loweredCase = false - for (;;) { - switch (encoding) { - case 'hex': - return hexWrite(this, string, offset, length) - - case 'utf8': - case 'utf-8': - return utf8Write(this, string, offset, length) - - case 'ascii': - return asciiWrite(this, string, offset, length) - - case 'latin1': - case 'binary': - return latin1Write(this, string, offset, length) - - case 'base64': - // Warning: maxLength not taken into account in base64Write - return base64Write(this, string, offset, length) - - case 'ucs2': - case 'ucs-2': - case 'utf16le': - case 'utf-16le': - return ucs2Write(this, string, offset, length) - - default: - if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding) - encoding = ('' + encoding).toLowerCase() - loweredCase = true - } - } -} - -Buffer.prototype.toJSON = function toJSON () { - return { - type: 'Buffer', - data: Array.prototype.slice.call(this._arr || this, 0) - } -} - -function base64Slice (buf, start, end) { - if (start === 0 && end === buf.length) { - return base64.fromByteArray(buf) - } else { - return base64.fromByteArray(buf.slice(start, end)) - } -} - -function utf8Slice (buf, start, end) { - end = Math.min(buf.length, end) - var res = [] - - var i = start - while (i < end) { - var firstByte = buf[i] - var codePoint = null - var bytesPerSequence = (firstByte > 0xEF) ? 4 - : (firstByte > 0xDF) ? 3 - : (firstByte > 0xBF) ? 2 - : 1 - - if (i + bytesPerSequence <= end) { - var secondByte, thirdByte, fourthByte, tempCodePoint - - switch (bytesPerSequence) { - case 1: - if (firstByte < 0x80) { - codePoint = firstByte - } - break - case 2: - secondByte = buf[i + 1] - if ((secondByte & 0xC0) === 0x80) { - tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F) - if (tempCodePoint > 0x7F) { - codePoint = tempCodePoint - } - } - break - case 3: - secondByte = buf[i + 1] - thirdByte = buf[i + 2] - if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) { - tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F) - if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) { - codePoint = tempCodePoint - } - } - break - case 4: - secondByte = buf[i + 1] - thirdByte = buf[i + 2] - fourthByte = buf[i + 3] - if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) { - tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F) - if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) { - codePoint = tempCodePoint - } - } - } - } - - if (codePoint === null) { - // we did not generate a valid codePoint so insert a - // replacement char (U+FFFD) and advance only 1 byte - codePoint = 0xFFFD - bytesPerSequence = 1 - } else if (codePoint > 0xFFFF) { - // encode to utf16 (surrogate pair dance) - codePoint -= 0x10000 - res.push(codePoint >>> 10 & 0x3FF | 0xD800) - codePoint = 0xDC00 | codePoint & 0x3FF - } - - res.push(codePoint) - i += bytesPerSequence - } - - return decodeCodePointsArray(res) -} - -// Based on http://stackoverflow.com/a/22747272/680742, the browser with -// the lowest limit is Chrome, with 0x10000 args. -// We go 1 magnitude less, for safety -var MAX_ARGUMENTS_LENGTH = 0x1000 - -function decodeCodePointsArray (codePoints) { - var len = codePoints.length - if (len <= MAX_ARGUMENTS_LENGTH) { - return String.fromCharCode.apply(String, codePoints) // avoid extra slice() - } - - // Decode in chunks to avoid "call stack size exceeded". - var res = '' - var i = 0 - while (i < len) { - res += String.fromCharCode.apply( - String, - codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH) - ) - } - return res -} - -function asciiSlice (buf, start, end) { - var ret = '' - end = Math.min(buf.length, end) - - for (var i = start; i < end; ++i) { - ret += String.fromCharCode(buf[i] & 0x7F) - } - return ret -} - -function latin1Slice (buf, start, end) { - var ret = '' - end = Math.min(buf.length, end) - - for (var i = start; i < end; ++i) { - ret += String.fromCharCode(buf[i]) - } - return ret -} - -function hexSlice (buf, start, end) { - var len = buf.length - - if (!start || start < 0) start = 0 - if (!end || end < 0 || end > len) end = len - - var out = '' - for (var i = start; i < end; ++i) { - out += toHex(buf[i]) - } - return out -} - -function utf16leSlice (buf, start, end) { - var bytes = buf.slice(start, end) - var res = '' - for (var i = 0; i < bytes.length; i += 2) { - res += String.fromCharCode(bytes[i] + (bytes[i + 1] * 256)) - } - return res -} - -Buffer.prototype.slice = function slice (start, end) { - var len = this.length - start = ~~start - end = end === undefined ? len : ~~end - - if (start < 0) { - start += len - if (start < 0) start = 0 - } else if (start > len) { - start = len - } - - if (end < 0) { - end += len - if (end < 0) end = 0 - } else if (end > len) { - end = len - } - - if (end < start) end = start - - var newBuf = this.subarray(start, end) - // Return an augmented `Uint8Array` instance - newBuf.__proto__ = Buffer.prototype - return newBuf -} - -/* - * Need to make sure that buffer isn't trying to write out of bounds. - */ -function checkOffset (offset, ext, length) { - if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint') - if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length') -} - -Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) { - offset = offset >>> 0 - byteLength = byteLength >>> 0 - if (!noAssert) checkOffset(offset, byteLength, this.length) - - var val = this[offset] - var mul = 1 - var i = 0 - while (++i < byteLength && (mul *= 0x100)) { - val += this[offset + i] * mul - } - - return val -} - -Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) { - offset = offset >>> 0 - byteLength = byteLength >>> 0 - if (!noAssert) { - checkOffset(offset, byteLength, this.length) - } - - var val = this[offset + --byteLength] - var mul = 1 - while (byteLength > 0 && (mul *= 0x100)) { - val += this[offset + --byteLength] * mul - } - - return val -} - -Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) { - offset = offset >>> 0 - if (!noAssert) checkOffset(offset, 1, this.length) - return this[offset] -} - -Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) { - offset = offset >>> 0 - if (!noAssert) checkOffset(offset, 2, this.length) - return this[offset] | (this[offset + 1] << 8) -} - -Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) { - offset = offset >>> 0 - if (!noAssert) checkOffset(offset, 2, this.length) - return (this[offset] << 8) | this[offset + 1] -} - -Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) { - offset = offset >>> 0 - if (!noAssert) checkOffset(offset, 4, this.length) - - return ((this[offset]) | - (this[offset + 1] << 8) | - (this[offset + 2] << 16)) + - (this[offset + 3] * 0x1000000) -} - -Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) { - offset = offset >>> 0 - if (!noAssert) checkOffset(offset, 4, this.length) - - return (this[offset] * 0x1000000) + - ((this[offset + 1] << 16) | - (this[offset + 2] << 8) | - this[offset + 3]) -} - -Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) { - offset = offset >>> 0 - byteLength = byteLength >>> 0 - if (!noAssert) checkOffset(offset, byteLength, this.length) - - var val = this[offset] - var mul = 1 - var i = 0 - while (++i < byteLength && (mul *= 0x100)) { - val += this[offset + i] * mul - } - mul *= 0x80 - - if (val >= mul) val -= Math.pow(2, 8 * byteLength) - - return val -} - -Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) { - offset = offset >>> 0 - byteLength = byteLength >>> 0 - if (!noAssert) checkOffset(offset, byteLength, this.length) - - var i = byteLength - var mul = 1 - var val = this[offset + --i] - while (i > 0 && (mul *= 0x100)) { - val += this[offset + --i] * mul - } - mul *= 0x80 - - if (val >= mul) val -= Math.pow(2, 8 * byteLength) - - return val -} - -Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) { - offset = offset >>> 0 - if (!noAssert) checkOffset(offset, 1, this.length) - if (!(this[offset] & 0x80)) return (this[offset]) - return ((0xff - this[offset] + 1) * -1) -} - -Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) { - offset = offset >>> 0 - if (!noAssert) checkOffset(offset, 2, this.length) - var val = this[offset] | (this[offset + 1] << 8) - return (val & 0x8000) ? val | 0xFFFF0000 : val -} - -Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) { - offset = offset >>> 0 - if (!noAssert) checkOffset(offset, 2, this.length) - var val = this[offset + 1] | (this[offset] << 8) - return (val & 0x8000) ? val | 0xFFFF0000 : val -} - -Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) { - offset = offset >>> 0 - if (!noAssert) checkOffset(offset, 4, this.length) - - return (this[offset]) | - (this[offset + 1] << 8) | - (this[offset + 2] << 16) | - (this[offset + 3] << 24) -} - -Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) { - offset = offset >>> 0 - if (!noAssert) checkOffset(offset, 4, this.length) - - return (this[offset] << 24) | - (this[offset + 1] << 16) | - (this[offset + 2] << 8) | - (this[offset + 3]) -} - -Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) { - offset = offset >>> 0 - if (!noAssert) checkOffset(offset, 4, this.length) - return ieee754.read(this, offset, true, 23, 4) -} - -Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) { - offset = offset >>> 0 - if (!noAssert) checkOffset(offset, 4, this.length) - return ieee754.read(this, offset, false, 23, 4) -} - -Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) { - offset = offset >>> 0 - if (!noAssert) checkOffset(offset, 8, this.length) - return ieee754.read(this, offset, true, 52, 8) -} - -Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) { - offset = offset >>> 0 - if (!noAssert) checkOffset(offset, 8, this.length) - return ieee754.read(this, offset, false, 52, 8) -} - -function checkInt (buf, value, offset, ext, max, min) { - if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance') - if (value > max || value < min) throw new RangeError('"value" argument is out of bounds') - if (offset + ext > buf.length) throw new RangeError('Index out of range') -} - -Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) { - value = +value - offset = offset >>> 0 - byteLength = byteLength >>> 0 - if (!noAssert) { - var maxBytes = Math.pow(2, 8 * byteLength) - 1 - checkInt(this, value, offset, byteLength, maxBytes, 0) - } - - var mul = 1 - var i = 0 - this[offset] = value & 0xFF - while (++i < byteLength && (mul *= 0x100)) { - this[offset + i] = (value / mul) & 0xFF - } - - return offset + byteLength -} - -Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) { - value = +value - offset = offset >>> 0 - byteLength = byteLength >>> 0 - if (!noAssert) { - var maxBytes = Math.pow(2, 8 * byteLength) - 1 - checkInt(this, value, offset, byteLength, maxBytes, 0) - } - - var i = byteLength - 1 - var mul = 1 - this[offset + i] = value & 0xFF - while (--i >= 0 && (mul *= 0x100)) { - this[offset + i] = (value / mul) & 0xFF - } - - return offset + byteLength -} - -Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) { - value = +value - offset = offset >>> 0 - if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0) - this[offset] = (value & 0xff) - return offset + 1 -} - -Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) { - value = +value - offset = offset >>> 0 - if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0) - this[offset] = (value & 0xff) - this[offset + 1] = (value >>> 8) - return offset + 2 -} - -Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) { - value = +value - offset = offset >>> 0 - if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0) - this[offset] = (value >>> 8) - this[offset + 1] = (value & 0xff) - return offset + 2 -} - -Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) { - value = +value - offset = offset >>> 0 - if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0) - this[offset + 3] = (value >>> 24) - this[offset + 2] = (value >>> 16) - this[offset + 1] = (value >>> 8) - this[offset] = (value & 0xff) - return offset + 4 -} - -Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) { - value = +value - offset = offset >>> 0 - if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0) - this[offset] = (value >>> 24) - this[offset + 1] = (value >>> 16) - this[offset + 2] = (value >>> 8) - this[offset + 3] = (value & 0xff) - return offset + 4 -} - -Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) { - value = +value - offset = offset >>> 0 - if (!noAssert) { - var limit = Math.pow(2, (8 * byteLength) - 1) - - checkInt(this, value, offset, byteLength, limit - 1, -limit) - } - - var i = 0 - var mul = 1 - var sub = 0 - this[offset] = value & 0xFF - while (++i < byteLength && (mul *= 0x100)) { - if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) { - sub = 1 - } - this[offset + i] = ((value / mul) >> 0) - sub & 0xFF - } - - return offset + byteLength -} - -Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) { - value = +value - offset = offset >>> 0 - if (!noAssert) { - var limit = Math.pow(2, (8 * byteLength) - 1) - - checkInt(this, value, offset, byteLength, limit - 1, -limit) - } - - var i = byteLength - 1 - var mul = 1 - var sub = 0 - this[offset + i] = value & 0xFF - while (--i >= 0 && (mul *= 0x100)) { - if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) { - sub = 1 - } - this[offset + i] = ((value / mul) >> 0) - sub & 0xFF - } - - return offset + byteLength -} - -Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) { - value = +value - offset = offset >>> 0 - if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80) - if (value < 0) value = 0xff + value + 1 - this[offset] = (value & 0xff) - return offset + 1 -} - -Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) { - value = +value - offset = offset >>> 0 - if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000) - this[offset] = (value & 0xff) - this[offset + 1] = (value >>> 8) - return offset + 2 -} - -Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) { - value = +value - offset = offset >>> 0 - if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000) - this[offset] = (value >>> 8) - this[offset + 1] = (value & 0xff) - return offset + 2 -} - -Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) { - value = +value - offset = offset >>> 0 - if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000) - this[offset] = (value & 0xff) - this[offset + 1] = (value >>> 8) - this[offset + 2] = (value >>> 16) - this[offset + 3] = (value >>> 24) - return offset + 4 -} - -Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) { - value = +value - offset = offset >>> 0 - if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000) - if (value < 0) value = 0xffffffff + value + 1 - this[offset] = (value >>> 24) - this[offset + 1] = (value >>> 16) - this[offset + 2] = (value >>> 8) - this[offset + 3] = (value & 0xff) - return offset + 4 -} - -function checkIEEE754 (buf, value, offset, ext, max, min) { - if (offset + ext > buf.length) throw new RangeError('Index out of range') - if (offset < 0) throw new RangeError('Index out of range') -} - -function writeFloat (buf, value, offset, littleEndian, noAssert) { - value = +value - offset = offset >>> 0 - if (!noAssert) { - checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38) - } - ieee754.write(buf, value, offset, littleEndian, 23, 4) - return offset + 4 -} - -Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) { - return writeFloat(this, value, offset, true, noAssert) -} - -Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) { - return writeFloat(this, value, offset, false, noAssert) -} - -function writeDouble (buf, value, offset, littleEndian, noAssert) { - value = +value - offset = offset >>> 0 - if (!noAssert) { - checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308) - } - ieee754.write(buf, value, offset, littleEndian, 52, 8) - return offset + 8 -} - -Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) { - return writeDouble(this, value, offset, true, noAssert) -} - -Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) { - return writeDouble(this, value, offset, false, noAssert) -} - -// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length) -Buffer.prototype.copy = function copy (target, targetStart, start, end) { - if (!Buffer.isBuffer(target)) throw new TypeError('argument should be a Buffer') - if (!start) start = 0 - if (!end && end !== 0) end = this.length - if (targetStart >= target.length) targetStart = target.length - if (!targetStart) targetStart = 0 - if (end > 0 && end < start) end = start - - // Copy 0 bytes; we're done - if (end === start) return 0 - if (target.length === 0 || this.length === 0) return 0 - - // Fatal error conditions - if (targetStart < 0) { - throw new RangeError('targetStart out of bounds') - } - if (start < 0 || start >= this.length) throw new RangeError('Index out of range') - if (end < 0) throw new RangeError('sourceEnd out of bounds') - - // Are we oob? - if (end > this.length) end = this.length - if (target.length - targetStart < end - start) { - end = target.length - targetStart + start - } - - var len = end - start - - if (this === target && typeof Uint8Array.prototype.copyWithin === 'function') { - // Use built-in when available, missing from IE11 - this.copyWithin(targetStart, start, end) - } else if (this === target && start < targetStart && targetStart < end) { - // descending copy from end - for (var i = len - 1; i >= 0; --i) { - target[i + targetStart] = this[i + start] - } - } else { - Uint8Array.prototype.set.call( - target, - this.subarray(start, end), - targetStart - ) - } - - return len -} - -// Usage: -// buffer.fill(number[, offset[, end]]) -// buffer.fill(buffer[, offset[, end]]) -// buffer.fill(string[, offset[, end]][, encoding]) -Buffer.prototype.fill = function fill (val, start, end, encoding) { - // Handle string cases: - if (typeof val === 'string') { - if (typeof start === 'string') { - encoding = start - start = 0 - end = this.length - } else if (typeof end === 'string') { - encoding = end - end = this.length - } - if (encoding !== undefined && typeof encoding !== 'string') { - throw new TypeError('encoding must be a string') - } - if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) { - throw new TypeError('Unknown encoding: ' + encoding) - } - if (val.length === 1) { - var code = val.charCodeAt(0) - if ((encoding === 'utf8' && code < 128) || - encoding === 'latin1') { - // Fast path: If `val` fits into a single byte, use that numeric value. - val = code - } - } - } else if (typeof val === 'number') { - val = val & 255 - } - - // Invalid ranges are not set to a default, so can range check early. - if (start < 0 || this.length < start || this.length < end) { - throw new RangeError('Out of range index') - } - - if (end <= start) { - return this - } - - start = start >>> 0 - end = end === undefined ? this.length : end >>> 0 - - if (!val) val = 0 - - var i - if (typeof val === 'number') { - for (i = start; i < end; ++i) { - this[i] = val - } - } else { - var bytes = Buffer.isBuffer(val) - ? val - : Buffer.from(val, encoding) - var len = bytes.length - if (len === 0) { - throw new TypeError('The value "' + val + - '" is invalid for argument "value"') - } - for (i = 0; i < end - start; ++i) { - this[i + start] = bytes[i % len] - } - } - - return this -} - -// HELPER FUNCTIONS -// ================ - -var INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g - -function base64clean (str) { - // Node takes equal signs as end of the Base64 encoding - str = str.split('=')[0] - // Node strips out invalid characters like \n and \t from the string, base64-js does not - str = str.trim().replace(INVALID_BASE64_RE, '') - // Node converts strings with length < 2 to '' - if (str.length < 2) return '' - // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not - while (str.length % 4 !== 0) { - str = str + '=' - } - return str -} - -function toHex (n) { - if (n < 16) return '0' + n.toString(16) - return n.toString(16) -} - -function utf8ToBytes (string, units) { - units = units || Infinity - var codePoint - var length = string.length - var leadSurrogate = null - var bytes = [] - - for (var i = 0; i < length; ++i) { - codePoint = string.charCodeAt(i) - - // is surrogate component - if (codePoint > 0xD7FF && codePoint < 0xE000) { - // last char was a lead - if (!leadSurrogate) { - // no lead yet - if (codePoint > 0xDBFF) { - // unexpected trail - if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) - continue - } else if (i + 1 === length) { - // unpaired lead - if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) - continue - } - - // valid lead - leadSurrogate = codePoint - - continue - } - - // 2 leads in a row - if (codePoint < 0xDC00) { - if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) - leadSurrogate = codePoint - continue - } - - // valid surrogate pair - codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000 - } else if (leadSurrogate) { - // valid bmp char, but last char was a lead - if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) - } - - leadSurrogate = null - - // encode utf8 - if (codePoint < 0x80) { - if ((units -= 1) < 0) break - bytes.push(codePoint) - } else if (codePoint < 0x800) { - if ((units -= 2) < 0) break - bytes.push( - codePoint >> 0x6 | 0xC0, - codePoint & 0x3F | 0x80 - ) - } else if (codePoint < 0x10000) { - if ((units -= 3) < 0) break - bytes.push( - codePoint >> 0xC | 0xE0, - codePoint >> 0x6 & 0x3F | 0x80, - codePoint & 0x3F | 0x80 - ) - } else if (codePoint < 0x110000) { - if ((units -= 4) < 0) break - bytes.push( - codePoint >> 0x12 | 0xF0, - codePoint >> 0xC & 0x3F | 0x80, - codePoint >> 0x6 & 0x3F | 0x80, - codePoint & 0x3F | 0x80 - ) - } else { - throw new Error('Invalid code point') - } - } - - return bytes -} - -function asciiToBytes (str) { - var byteArray = [] - for (var i = 0; i < str.length; ++i) { - // Node's code seems to be doing this and not & 0x7F.. - byteArray.push(str.charCodeAt(i) & 0xFF) - } - return byteArray -} - -function utf16leToBytes (str, units) { - var c, hi, lo - var byteArray = [] - for (var i = 0; i < str.length; ++i) { - if ((units -= 2) < 0) break - - c = str.charCodeAt(i) - hi = c >> 8 - lo = c % 256 - byteArray.push(lo) - byteArray.push(hi) - } - - return byteArray -} - -function base64ToBytes (str) { - return base64.toByteArray(base64clean(str)) -} - -function blitBuffer (src, dst, offset, length) { - for (var i = 0; i < length; ++i) { - if ((i + offset >= dst.length) || (i >= src.length)) break - dst[i + offset] = src[i] - } - return i -} - -// ArrayBuffer or Uint8Array objects from other contexts (i.e. iframes) do not pass -// the `instanceof` check but they should be treated as of that type. -// See: https://github.com/feross/buffer/issues/166 -function isInstance (obj, type) { - return obj instanceof type || - (obj != null && obj.constructor != null && obj.constructor.name != null && - obj.constructor.name === type.name) -} -function numberIsNaN (obj) { - // For IE11 support - return obj !== obj // eslint-disable-line no-self-compare -} - -}).call(this)}).call(this,require("buffer").Buffer) -},{"base64-js":2,"buffer":6,"ieee754":9}],7:[function(require,module,exports){ -/* jshint esversion: 6 */ -/* jslint node: true */ -'use strict'; - -module.exports = function serialize (object) { - if (object === null || typeof object !== 'object' || object.toJSON != null) { - return JSON.stringify(object); - } - - if (Array.isArray(object)) { - return '[' + object.reduce((t, cv, ci) => { - const comma = ci === 0 ? '' : ','; - const value = cv === undefined || typeof cv === 'symbol' ? null : cv; - return t + comma + serialize(value); - }, '') + ']'; - } - - return '{' + Object.keys(object).sort().reduce((t, cv, ci) => { - if (object[cv] === undefined || - typeof object[cv] === 'symbol') { - return t; - } - const comma = t.length === 0 ? '' : ','; - return t + comma + serialize(cv) + ':' + serialize(object[cv]); - }, '') + '}'; -}; - -},{}],8:[function(require,module,exports){ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -'use strict'; - -var R = typeof Reflect === 'object' ? Reflect : null -var ReflectApply = R && typeof R.apply === 'function' - ? R.apply - : function ReflectApply(target, receiver, args) { - return Function.prototype.apply.call(target, receiver, args); - } - -var ReflectOwnKeys -if (R && typeof R.ownKeys === 'function') { - ReflectOwnKeys = R.ownKeys -} else if (Object.getOwnPropertySymbols) { - ReflectOwnKeys = function ReflectOwnKeys(target) { - return Object.getOwnPropertyNames(target) - .concat(Object.getOwnPropertySymbols(target)); - }; -} else { - ReflectOwnKeys = function ReflectOwnKeys(target) { - return Object.getOwnPropertyNames(target); - }; -} - -function ProcessEmitWarning(warning) { - if (console && console.warn) console.warn(warning); -} - -var NumberIsNaN = Number.isNaN || function NumberIsNaN(value) { - return value !== value; -} - -function EventEmitter() { - EventEmitter.init.call(this); -} -module.exports = EventEmitter; -module.exports.once = once; - -// Backwards-compat with node 0.10.x -EventEmitter.EventEmitter = EventEmitter; - -EventEmitter.prototype._events = undefined; -EventEmitter.prototype._eventsCount = 0; -EventEmitter.prototype._maxListeners = undefined; - -// By default EventEmitters will print a warning if more than 10 listeners are -// added to it. This is a useful default which helps finding memory leaks. -var defaultMaxListeners = 10; - -function checkListener(listener) { - if (typeof listener !== 'function') { - throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof listener); - } -} - -Object.defineProperty(EventEmitter, 'defaultMaxListeners', { - enumerable: true, - get: function() { - return defaultMaxListeners; - }, - set: function(arg) { - if (typeof arg !== 'number' || arg < 0 || NumberIsNaN(arg)) { - throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + arg + '.'); - } - defaultMaxListeners = arg; - } -}); - -EventEmitter.init = function() { - - if (this._events === undefined || - this._events === Object.getPrototypeOf(this)._events) { - this._events = Object.create(null); - this._eventsCount = 0; - } - - this._maxListeners = this._maxListeners || undefined; -}; - -// Obviously not all Emitters should be limited to 10. This function allows -// that to be increased. Set to zero for unlimited. -EventEmitter.prototype.setMaxListeners = function setMaxListeners(n) { - if (typeof n !== 'number' || n < 0 || NumberIsNaN(n)) { - throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + n + '.'); - } - this._maxListeners = n; - return this; -}; - -function _getMaxListeners(that) { - if (that._maxListeners === undefined) - return EventEmitter.defaultMaxListeners; - return that._maxListeners; -} - -EventEmitter.prototype.getMaxListeners = function getMaxListeners() { - return _getMaxListeners(this); -}; - -EventEmitter.prototype.emit = function emit(type) { - var args = []; - for (var i = 1; i < arguments.length; i++) args.push(arguments[i]); - var doError = (type === 'error'); - - var events = this._events; - if (events !== undefined) - doError = (doError && events.error === undefined); - else if (!doError) - return false; - - // If there is no 'error' event listener then throw. - if (doError) { - var er; - if (args.length > 0) - er = args[0]; - if (er instanceof Error) { - // Note: The comments on the `throw` lines are intentional, they show - // up in Node's output if this results in an unhandled exception. - throw er; // Unhandled 'error' event - } - // At least give some kind of context to the user - var err = new Error('Unhandled error.' + (er ? ' (' + er.message + ')' : '')); - err.context = er; - throw err; // Unhandled 'error' event - } - - var handler = events[type]; - - if (handler === undefined) - return false; - - if (typeof handler === 'function') { - ReflectApply(handler, this, args); - } else { - var len = handler.length; - var listeners = arrayClone(handler, len); - for (var i = 0; i < len; ++i) - ReflectApply(listeners[i], this, args); - } - - return true; -}; - -function _addListener(target, type, listener, prepend) { - var m; - var events; - var existing; - - checkListener(listener); - - events = target._events; - if (events === undefined) { - events = target._events = Object.create(null); - target._eventsCount = 0; - } else { - // To avoid recursion in the case that type === "newListener"! Before - // adding it to the listeners, first emit "newListener". - if (events.newListener !== undefined) { - target.emit('newListener', type, - listener.listener ? listener.listener : listener); - - // Re-assign `events` because a newListener handler could have caused the - // this._events to be assigned to a new object - events = target._events; - } - existing = events[type]; - } - - if (existing === undefined) { - // Optimize the case of one listener. Don't need the extra array object. - existing = events[type] = listener; - ++target._eventsCount; - } else { - if (typeof existing === 'function') { - // Adding the second element, need to change to array. - existing = events[type] = - prepend ? [listener, existing] : [existing, listener]; - // If we've already got an array, just append. - } else if (prepend) { - existing.unshift(listener); - } else { - existing.push(listener); - } - - // Check for listener leak - m = _getMaxListeners(target); - if (m > 0 && existing.length > m && !existing.warned) { - existing.warned = true; - // No error code for this since it is a Warning - // eslint-disable-next-line no-restricted-syntax - var w = new Error('Possible EventEmitter memory leak detected. ' + - existing.length + ' ' + String(type) + ' listeners ' + - 'added. Use emitter.setMaxListeners() to ' + - 'increase limit'); - w.name = 'MaxListenersExceededWarning'; - w.emitter = target; - w.type = type; - w.count = existing.length; - ProcessEmitWarning(w); - } - } - - return target; -} - -EventEmitter.prototype.addListener = function addListener(type, listener) { - return _addListener(this, type, listener, false); -}; - -EventEmitter.prototype.on = EventEmitter.prototype.addListener; - -EventEmitter.prototype.prependListener = - function prependListener(type, listener) { - return _addListener(this, type, listener, true); - }; - -function onceWrapper() { - if (!this.fired) { - this.target.removeListener(this.type, this.wrapFn); - this.fired = true; - if (arguments.length === 0) - return this.listener.call(this.target); - return this.listener.apply(this.target, arguments); - } -} - -function _onceWrap(target, type, listener) { - var state = { fired: false, wrapFn: undefined, target: target, type: type, listener: listener }; - var wrapped = onceWrapper.bind(state); - wrapped.listener = listener; - state.wrapFn = wrapped; - return wrapped; -} - -EventEmitter.prototype.once = function once(type, listener) { - checkListener(listener); - this.on(type, _onceWrap(this, type, listener)); - return this; -}; - -EventEmitter.prototype.prependOnceListener = - function prependOnceListener(type, listener) { - checkListener(listener); - this.prependListener(type, _onceWrap(this, type, listener)); - return this; - }; - -// Emits a 'removeListener' event if and only if the listener was removed. -EventEmitter.prototype.removeListener = - function removeListener(type, listener) { - var list, events, position, i, originalListener; - - checkListener(listener); - - events = this._events; - if (events === undefined) - return this; - - list = events[type]; - if (list === undefined) - return this; - - if (list === listener || list.listener === listener) { - if (--this._eventsCount === 0) - this._events = Object.create(null); - else { - delete events[type]; - if (events.removeListener) - this.emit('removeListener', type, list.listener || listener); - } - } else if (typeof list !== 'function') { - position = -1; - - for (i = list.length - 1; i >= 0; i--) { - if (list[i] === listener || list[i].listener === listener) { - originalListener = list[i].listener; - position = i; - break; - } - } - - if (position < 0) - return this; - - if (position === 0) - list.shift(); - else { - spliceOne(list, position); - } - - if (list.length === 1) - events[type] = list[0]; - - if (events.removeListener !== undefined) - this.emit('removeListener', type, originalListener || listener); - } - - return this; - }; - -EventEmitter.prototype.off = EventEmitter.prototype.removeListener; - -EventEmitter.prototype.removeAllListeners = - function removeAllListeners(type) { - var listeners, events, i; - - events = this._events; - if (events === undefined) - return this; - - // not listening for removeListener, no need to emit - if (events.removeListener === undefined) { - if (arguments.length === 0) { - this._events = Object.create(null); - this._eventsCount = 0; - } else if (events[type] !== undefined) { - if (--this._eventsCount === 0) - this._events = Object.create(null); - else - delete events[type]; - } - return this; - } - - // emit removeListener for all listeners on all events - if (arguments.length === 0) { - var keys = Object.keys(events); - var key; - for (i = 0; i < keys.length; ++i) { - key = keys[i]; - if (key === 'removeListener') continue; - this.removeAllListeners(key); - } - this.removeAllListeners('removeListener'); - this._events = Object.create(null); - this._eventsCount = 0; - return this; - } - - listeners = events[type]; - - if (typeof listeners === 'function') { - this.removeListener(type, listeners); - } else if (listeners !== undefined) { - // LIFO order - for (i = listeners.length - 1; i >= 0; i--) { - this.removeListener(type, listeners[i]); - } - } - - return this; - }; - -function _listeners(target, type, unwrap) { - var events = target._events; - - if (events === undefined) - return []; - - var evlistener = events[type]; - if (evlistener === undefined) - return []; - - if (typeof evlistener === 'function') - return unwrap ? [evlistener.listener || evlistener] : [evlistener]; - - return unwrap ? - unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length); -} - -EventEmitter.prototype.listeners = function listeners(type) { - return _listeners(this, type, true); -}; - -EventEmitter.prototype.rawListeners = function rawListeners(type) { - return _listeners(this, type, false); -}; - -EventEmitter.listenerCount = function(emitter, type) { - if (typeof emitter.listenerCount === 'function') { - return emitter.listenerCount(type); - } else { - return listenerCount.call(emitter, type); - } -}; - -EventEmitter.prototype.listenerCount = listenerCount; -function listenerCount(type) { - var events = this._events; - - if (events !== undefined) { - var evlistener = events[type]; - - if (typeof evlistener === 'function') { - return 1; - } else if (evlistener !== undefined) { - return evlistener.length; - } - } - - return 0; -} - -EventEmitter.prototype.eventNames = function eventNames() { - return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : []; -}; - -function arrayClone(arr, n) { - var copy = new Array(n); - for (var i = 0; i < n; ++i) - copy[i] = arr[i]; - return copy; -} - -function spliceOne(list, index) { - for (; index + 1 < list.length; index++) - list[index] = list[index + 1]; - list.pop(); -} - -function unwrapListeners(arr) { - var ret = new Array(arr.length); - for (var i = 0; i < ret.length; ++i) { - ret[i] = arr[i].listener || arr[i]; - } - return ret; -} - -function once(emitter, name) { - return new Promise(function (resolve, reject) { - function errorListener(err) { - emitter.removeListener(name, resolver); - reject(err); - } - - function resolver() { - if (typeof emitter.removeListener === 'function') { - emitter.removeListener('error', errorListener); - } - resolve([].slice.call(arguments)); - }; - - eventTargetAgnosticAddListener(emitter, name, resolver, { once: true }); - if (name !== 'error') { - addErrorHandlerIfEventEmitter(emitter, errorListener, { once: true }); - } - }); -} - -function addErrorHandlerIfEventEmitter(emitter, handler, flags) { - if (typeof emitter.on === 'function') { - eventTargetAgnosticAddListener(emitter, 'error', handler, flags); - } -} - -function eventTargetAgnosticAddListener(emitter, name, listener, flags) { - if (typeof emitter.on === 'function') { - if (flags.once) { - emitter.once(name, listener); - } else { - emitter.on(name, listener); - } - } else if (typeof emitter.addEventListener === 'function') { - // EventTarget does not have `error` event semantics like Node - // EventEmitters, we do not listen for `error` events here. - emitter.addEventListener(name, function wrapListener(arg) { - // IE does not have builtin `{ once: true }` support so we - // have to do it manually. - if (flags.once) { - emitter.removeEventListener(name, wrapListener); - } - listener(arg); - }); - } else { - throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof emitter); - } -} - -},{}],9:[function(require,module,exports){ -/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */ -exports.read = function (buffer, offset, isLE, mLen, nBytes) { - var e, m - var eLen = (nBytes * 8) - mLen - 1 - var eMax = (1 << eLen) - 1 - var eBias = eMax >> 1 - var nBits = -7 - var i = isLE ? (nBytes - 1) : 0 - var d = isLE ? -1 : 1 - var s = buffer[offset + i] - - i += d - - e = s & ((1 << (-nBits)) - 1) - s >>= (-nBits) - nBits += eLen - for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {} - - m = e & ((1 << (-nBits)) - 1) - e >>= (-nBits) - nBits += mLen - for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {} - - if (e === 0) { - e = 1 - eBias - } else if (e === eMax) { - return m ? NaN : ((s ? -1 : 1) * Infinity) - } else { - m = m + Math.pow(2, mLen) - e = e - eBias - } - return (s ? -1 : 1) * m * Math.pow(2, e - mLen) -} - -exports.write = function (buffer, value, offset, isLE, mLen, nBytes) { - var e, m, c - var eLen = (nBytes * 8) - mLen - 1 - var eMax = (1 << eLen) - 1 - var eBias = eMax >> 1 - var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0) - var i = isLE ? 0 : (nBytes - 1) - var d = isLE ? 1 : -1 - var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0 - - value = Math.abs(value) - - if (isNaN(value) || value === Infinity) { - m = isNaN(value) ? 1 : 0 - e = eMax - } else { - e = Math.floor(Math.log(value) / Math.LN2) - if (value * (c = Math.pow(2, -e)) < 1) { - e-- - c *= 2 - } - if (e + eBias >= 1) { - value += rt / c - } else { - value += rt * Math.pow(2, 1 - eBias) - } - if (value * c >= 2) { - e++ - c /= 2 - } - - if (e + eBias >= eMax) { - m = 0 - e = eMax - } else if (e + eBias >= 1) { - m = ((value * c) - 1) * Math.pow(2, mLen) - e = e + eBias - } else { - m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen) - e = 0 - } - } - - for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {} - - e = (e << mLen) | m - eLen += mLen - for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {} - - buffer[offset + i - d] |= s * 128 -} - -},{}],10:[function(require,module,exports){ -if (typeof Object.create === 'function') { - // implementation from standard node.js 'util' module - module.exports = function inherits(ctor, superCtor) { - if (superCtor) { - ctor.super_ = superCtor - ctor.prototype = Object.create(superCtor.prototype, { - constructor: { - value: ctor, - enumerable: false, - writable: true, - configurable: true - } - }) - } - }; -} else { - // old school shim for old browsers - module.exports = function inherits(ctor, superCtor) { - if (superCtor) { - ctor.super_ = superCtor - var TempCtor = function () {} - TempCtor.prototype = superCtor.prototype - ctor.prototype = new TempCtor() - ctor.prototype.constructor = ctor - } - } -} - -},{}],11:[function(require,module,exports){ -/* - * Copyright (c) 2019 Digital Bazaar, Inc. All rights reserved. - */ -'use strict'; - -const { - isArray: _isArray, - isObject: _isObject, - isString: _isString, -} = require('./types'); -const { - asArray: _asArray -} = require('./util'); -const {prependBase} = require('./url'); -const JsonLdError = require('./JsonLdError'); -const ResolvedContext = require('./ResolvedContext'); - -const MAX_CONTEXT_URLS = 10; - -module.exports = class ContextResolver { - /** - * Creates a ContextResolver. - * - * @param sharedCache a shared LRU cache with `get` and `set` APIs. - */ - constructor({sharedCache}) { - this.perOpCache = new Map(); - this.sharedCache = sharedCache; - } - - async resolve({ - activeCtx, context, documentLoader, base, cycles = new Set() - }) { - // process `@context` - if(context && _isObject(context) && context['@context']) { - context = context['@context']; - } - - // context is one or more contexts - context = _asArray(context); - - // resolve each context in the array - const allResolved = []; - for(const ctx of context) { - if(_isString(ctx)) { - // see if `ctx` has been resolved before... - let resolved = this._get(ctx); - if(!resolved) { - // not resolved yet, resolve - resolved = await this._resolveRemoteContext( - {activeCtx, url: ctx, documentLoader, base, cycles}); - } - - // add to output and continue - if(_isArray(resolved)) { - allResolved.push(...resolved); - } else { - allResolved.push(resolved); - } - continue; - } - if(ctx === null) { - // handle `null` context, nothing to cache - allResolved.push(new ResolvedContext({document: null})); - continue; - } - if(!_isObject(ctx)) { - _throwInvalidLocalContext(context); - } - // context is an object, get/create `ResolvedContext` for it - const key = JSON.stringify(ctx); - let resolved = this._get(key); - if(!resolved) { - // create a new static `ResolvedContext` and cache it - resolved = new ResolvedContext({document: ctx}); - this._cacheResolvedContext({key, resolved, tag: 'static'}); - } - allResolved.push(resolved); - } - - return allResolved; - } - - _get(key) { - // get key from per operation cache; no `tag` is used with this cache so - // any retrieved context will always be the same during a single operation - let resolved = this.perOpCache.get(key); - if(!resolved) { - // see if the shared cache has a `static` entry for this URL - const tagMap = this.sharedCache.get(key); - if(tagMap) { - resolved = tagMap.get('static'); - if(resolved) { - this.perOpCache.set(key, resolved); - } - } - } - return resolved; - } - - _cacheResolvedContext({key, resolved, tag}) { - this.perOpCache.set(key, resolved); - if(tag !== undefined) { - let tagMap = this.sharedCache.get(key); - if(!tagMap) { - tagMap = new Map(); - this.sharedCache.set(key, tagMap); - } - tagMap.set(tag, resolved); - } - return resolved; - } - - async _resolveRemoteContext({activeCtx, url, documentLoader, base, cycles}) { - // resolve relative URL and fetch context - url = prependBase(base, url); - const {context, remoteDoc} = await this._fetchContext( - {activeCtx, url, documentLoader, cycles}); - - // update base according to remote document and resolve any relative URLs - base = remoteDoc.documentUrl || url; - _resolveContextUrls({context, base}); - - // resolve, cache, and return context - const resolved = await this.resolve( - {activeCtx, context, documentLoader, base, cycles}); - this._cacheResolvedContext({key: url, resolved, tag: remoteDoc.tag}); - return resolved; - } - - async _fetchContext({activeCtx, url, documentLoader, cycles}) { - // check for max context URLs fetched during a resolve operation - if(cycles.size > MAX_CONTEXT_URLS) { - throw new JsonLdError( - 'Maximum number of @context URLs exceeded.', - 'jsonld.ContextUrlError', - { - code: activeCtx.processingMode === 'json-ld-1.0' ? - 'loading remote context failed' : - 'context overflow', - max: MAX_CONTEXT_URLS - }); - } - - // check for context URL cycle - // shortcut to avoid extra work that would eventually hit the max above - if(cycles.has(url)) { - throw new JsonLdError( - 'Cyclical @context URLs detected.', - 'jsonld.ContextUrlError', - { - code: activeCtx.processingMode === 'json-ld-1.0' ? - 'recursive context inclusion' : - 'context overflow', - url - }); - } - - // track cycles - cycles.add(url); - - let context; - let remoteDoc; - - try { - remoteDoc = await documentLoader(url); - context = remoteDoc.document || null; - // parse string context as JSON - if(_isString(context)) { - context = JSON.parse(context); - } - } catch(e) { - throw new JsonLdError( - '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, cause: e}); - } - - // ensure ctx is an object - if(!_isObject(context)) { - throw new JsonLdError( - '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}); - } - - // use empty context if no @context key is present - if(!('@context' in context)) { - context = {'@context': {}}; - } else { - context = {'@context': context['@context']}; - } - - // append @context URL to context if given - if(remoteDoc.contextUrl) { - if(!_isArray(context['@context'])) { - context['@context'] = [context['@context']]; - } - context['@context'].push(remoteDoc.contextUrl); - } - - return {context, remoteDoc}; - } -}; - -function _throwInvalidLocalContext(ctx) { - throw new JsonLdError( - 'Invalid JSON-LD syntax; @context must be an object.', - 'jsonld.SyntaxError', { - code: 'invalid local context', context: ctx - }); -} - -/** - * Resolve all relative `@context` URLs in the given context by inline - * replacing them with absolute URLs. - * - * @param context the context. - * @param base the base IRI to use to resolve relative IRIs. - */ -function _resolveContextUrls({context, base}) { - if(!context) { - return; - } - - const ctx = context['@context']; - - if(_isString(ctx)) { - context['@context'] = prependBase(base, ctx); - return; - } - - if(_isArray(ctx)) { - for(let i = 0; i < ctx.length; ++i) { - const element = ctx[i]; - if(_isString(element)) { - ctx[i] = prependBase(base, element); - continue; - } - if(_isObject(element)) { - _resolveContextUrls({context: {'@context': element}, base}); - } - } - return; - } - - if(!_isObject(ctx)) { - // no @context URLs can be found in non-object - return; - } - - // ctx is an object, resolve any context URLs in terms - for(const term in ctx) { - _resolveContextUrls({context: ctx[term], base}); - } -} - -},{"./JsonLdError":12,"./ResolvedContext":16,"./types":30,"./url":31,"./util":32}],12:[function(require,module,exports){ -/* - * Copyright (c) 2017 Digital Bazaar, Inc. All rights reserved. - */ -'use strict'; - -module.exports = class JsonLdError extends Error { - /** - * Creates a JSON-LD Error. - * - * @param msg the error message. - * @param type the error type. - * @param details the error details. - */ - constructor( - message = 'An unspecified JSON-LD error occurred.', - name = 'jsonld.Error', - details = {}) { - super(message); - this.name = name; - this.message = message; - this.details = details; - } -}; - -},{}],13:[function(require,module,exports){ -/* - * Copyright (c) 2017 Digital Bazaar, Inc. All rights reserved. - */ -'use strict'; - -module.exports = jsonld => { - class JsonLdProcessor { - toString() { - return '[object JsonLdProcessor]'; - } - } - Object.defineProperty(JsonLdProcessor, 'prototype', { - writable: false, - enumerable: false - }); - Object.defineProperty(JsonLdProcessor.prototype, 'constructor', { - writable: true, - enumerable: false, - configurable: true, - value: JsonLdProcessor - }); - - // The Web IDL test harness will check the number of parameters defined in - // the functions below. The number of parameters must exactly match the - // required (non-optional) parameters of the JsonLdProcessor interface as - // defined here: - // https://www.w3.org/TR/json-ld-api/#the-jsonldprocessor-interface - - JsonLdProcessor.compact = function(input, ctx) { - if(arguments.length < 2) { - return Promise.reject( - new TypeError('Could not compact, too few arguments.')); - } - return jsonld.compact(input, ctx); - }; - JsonLdProcessor.expand = function(input) { - if(arguments.length < 1) { - return Promise.reject( - new TypeError('Could not expand, too few arguments.')); - } - return jsonld.expand(input); - }; - JsonLdProcessor.flatten = function(input) { - if(arguments.length < 1) { - return Promise.reject( - new TypeError('Could not flatten, too few arguments.')); - } - return jsonld.flatten(input); - }; - - return JsonLdProcessor; -}; - -},{}],14:[function(require,module,exports){ -/* - * Copyright (c) 2017 Digital Bazaar, Inc. All rights reserved. - */ -'use strict'; - -// TODO: move `NQuads` to its own package -module.exports = require('rdf-canonize').NQuads; - -},{"rdf-canonize":46}],15:[function(require,module,exports){ -/* - * Copyright (c) 2017-2019 Digital Bazaar, Inc. All rights reserved. - */ -'use strict'; - -module.exports = class RequestQueue { - /** - * Creates a simple queue for requesting documents. - */ - constructor() { - this._requests = {}; - } - - wrapLoader(loader) { - const self = this; - self._loader = loader; - return function(/* url */) { - return self.add.apply(self, arguments); - }; - } - - async add(url) { - let promise = this._requests[url]; - if(promise) { - // URL already queued, wait for it to load - return Promise.resolve(promise); - } - - // queue URL and load it - promise = this._requests[url] = this._loader(url); - - try { - return await promise; - } finally { - delete this._requests[url]; - } - } -}; - -},{}],16:[function(require,module,exports){ -/* - * Copyright (c) 2019 Digital Bazaar, Inc. All rights reserved. - */ -'use strict'; - -const LRU = require('lru-cache'); - -const MAX_ACTIVE_CONTEXTS = 10; - -module.exports = class ResolvedContext { - /** - * Creates a ResolvedContext. - * - * @param document the context document. - */ - constructor({document}) { - this.document = document; - // TODO: enable customization of processed context cache - // TODO: limit based on size of processed contexts vs. number of them - this.cache = new LRU({max: MAX_ACTIVE_CONTEXTS}); - } - - getProcessed(activeCtx) { - return this.cache.get(activeCtx); - } - - setProcessed(activeCtx, processedCtx) { - this.cache.set(activeCtx, processedCtx); - } -}; - -},{"lru-cache":33}],17:[function(require,module,exports){ -/* - * Copyright (c) 2017 Digital Bazaar, Inc. All rights reserved. - */ -'use strict'; - -const JsonLdError = require('./JsonLdError'); - -const { - isArray: _isArray, - isObject: _isObject, - isString: _isString, - isUndefined: _isUndefined -} = require('./types'); - -const { - isList: _isList, - isValue: _isValue, - isGraph: _isGraph, - isSimpleGraph: _isSimpleGraph, - isSubjectReference: _isSubjectReference -} = require('./graphTypes'); - -const { - expandIri: _expandIri, - getContextValue: _getContextValue, - isKeyword: _isKeyword, - process: _processContext, - processingMode: _processingMode -} = require('./context'); - -const { - removeBase: _removeBase, - prependBase: _prependBase -} = require('./url'); - -const { - addValue: _addValue, - asArray: _asArray, - compareShortestLeast: _compareShortestLeast -} = require('./util'); - -const api = {}; -module.exports = api; - -/** - * Recursively compacts an element using the given active context. All values - * must be in expanded form before this method is called. - * - * @param activeCtx the active context to use. - * @param activeProperty the compacted property associated with the element - * to compact, null for none. - * @param element the element to compact. - * @param options the compaction options. - * @param compactionMap the compaction map to use. - * - * @return a promise that resolves to the compacted value. - */ -api.compact = async ({ - activeCtx, - activeProperty = null, - element, - options = {}, - compactionMap = () => undefined -}) => { - // recursively compact array - if(_isArray(element)) { - let rval = []; - for(let i = 0; i < element.length; ++i) { - // compact, dropping any null values unless custom mapped - let compacted = await api.compact({ - activeCtx, - activeProperty, - element: element[i], - options, - compactionMap - }); - if(compacted === null) { - compacted = await compactionMap({ - unmappedValue: element[i], - activeCtx, - activeProperty, - parent: element, - index: i, - options - }); - if(compacted === undefined) { - continue; - } - } - rval.push(compacted); - } - if(options.compactArrays && rval.length === 1) { - // use single element if no container is specified - const container = _getContextValue( - activeCtx, activeProperty, '@container') || []; - if(container.length === 0) { - rval = rval[0]; - } - } - return rval; - } - - // use any scoped context on activeProperty - const ctx = _getContextValue(activeCtx, activeProperty, '@context'); - if(!_isUndefined(ctx)) { - activeCtx = await _processContext({ - activeCtx, - localCtx: ctx, - propagate: true, - overrideProtected: true, - options - }); - } - - // recursively compact object - if(_isObject(element)) { - if(options.link && '@id' in element && - options.link.hasOwnProperty(element['@id'])) { - // check for a linked element to reuse - const linked = options.link[element['@id']]; - for(let i = 0; i < linked.length; ++i) { - if(linked[i].expanded === element) { - return linked[i].compacted; - } - } - } - - // do value compaction on @values and subject references - if(_isValue(element) || _isSubjectReference(element)) { - const rval = - api.compactValue({activeCtx, activeProperty, value: element, options}); - if(options.link && _isSubjectReference(element)) { - // store linked element - if(!(options.link.hasOwnProperty(element['@id']))) { - options.link[element['@id']] = []; - } - options.link[element['@id']].push({expanded: element, compacted: rval}); - } - return rval; - } - - // if expanded property is @list and we're contained within a list - // container, recursively compact this item to an array - if(_isList(element)) { - const container = _getContextValue( - activeCtx, activeProperty, '@container') || []; - if(container.includes('@list')) { - return api.compact({ - activeCtx, - activeProperty, - element: element['@list'], - options, - compactionMap - }); - } - } - - // FIXME: avoid misuse of active property as an expanded property? - const insideReverse = (activeProperty === '@reverse'); - - const rval = {}; - - // original context before applying property-scoped and local contexts - const inputCtx = activeCtx; - - // revert to previous context, if there is one, - // and element is not a value object or a node reference - if(!_isValue(element) && !_isSubjectReference(element)) { - activeCtx = activeCtx.revertToPreviousContext(); - } - - // apply property-scoped context after reverting term-scoped context - const propertyScopedCtx = - _getContextValue(inputCtx, activeProperty, '@context'); - if(!_isUndefined(propertyScopedCtx)) { - activeCtx = await _processContext({ - activeCtx, - localCtx: propertyScopedCtx, - propagate: true, - overrideProtected: true, - options - }); - } - - if(options.link && '@id' in element) { - // store linked element - if(!options.link.hasOwnProperty(element['@id'])) { - options.link[element['@id']] = []; - } - options.link[element['@id']].push({expanded: element, compacted: rval}); - } - - // apply any context defined on an alias of @type - // if key is @type and any compacted value is a term having a local - // context, overlay that context - let types = element['@type'] || []; - if(types.length > 1) { - types = Array.from(types).sort(); - } - // find all type-scoped contexts based on current context, prior to - // updating it - const typeContext = activeCtx; - for(const type of types) { - const compactedType = api.compactIri( - {activeCtx: typeContext, iri: type, relativeTo: {vocab: true}}); - - // Use any type-scoped context defined on this value - const ctx = _getContextValue(inputCtx, compactedType, '@context'); - if(!_isUndefined(ctx)) { - activeCtx = await _processContext({ - activeCtx, - localCtx: ctx, - options, - propagate: false - }); - } - } - - // process element keys in order - const keys = Object.keys(element).sort(); - for(const expandedProperty of keys) { - const expandedValue = element[expandedProperty]; - - // compact @id - if(expandedProperty === '@id') { - let compactedValue = _asArray(expandedValue).map( - expandedIri => api.compactIri({ - activeCtx, - iri: expandedIri, - relativeTo: {vocab: false}, - base: options.base - })); - if(compactedValue.length === 1) { - compactedValue = compactedValue[0]; - } - - // use keyword alias and add value - const alias = api.compactIri( - {activeCtx, iri: '@id', relativeTo: {vocab: true}}); - - rval[alias] = compactedValue; - continue; - } - - // compact @type(s) - if(expandedProperty === '@type') { - // resolve type values against previous context - let compactedValue = _asArray(expandedValue).map( - expandedIri => api.compactIri({ - activeCtx: inputCtx, - iri: expandedIri, - relativeTo: {vocab: true} - })); - if(compactedValue.length === 1) { - compactedValue = compactedValue[0]; - } - - // use keyword alias and add value - const alias = api.compactIri( - {activeCtx, iri: '@type', relativeTo: {vocab: true}}); - const container = _getContextValue( - activeCtx, alias, '@container') || []; - - // treat as array for @type if @container includes @set - const typeAsSet = - container.includes('@set') && - _processingMode(activeCtx, 1.1); - const isArray = - typeAsSet || (_isArray(compactedValue) && expandedValue.length === 0); - _addValue(rval, alias, compactedValue, {propertyIsArray: isArray}); - continue; - } - - // handle @reverse - if(expandedProperty === '@reverse') { - // recursively compact expanded value - const compactedValue = await api.compact({ - activeCtx, - activeProperty: '@reverse', - element: expandedValue, - options, - compactionMap - }); - - // handle double-reversed properties - for(const compactedProperty in compactedValue) { - if(activeCtx.mappings.has(compactedProperty) && - activeCtx.mappings.get(compactedProperty).reverse) { - const value = compactedValue[compactedProperty]; - const container = _getContextValue( - activeCtx, compactedProperty, '@container') || []; - const useArray = ( - container.includes('@set') || !options.compactArrays); - _addValue( - rval, compactedProperty, value, {propertyIsArray: useArray}); - delete compactedValue[compactedProperty]; - } - } - - if(Object.keys(compactedValue).length > 0) { - // use keyword alias and add value - const alias = api.compactIri({ - activeCtx, - iri: expandedProperty, - relativeTo: {vocab: true} - }); - _addValue(rval, alias, compactedValue); - } - - continue; - } - - if(expandedProperty === '@preserve') { - // compact using activeProperty - const compactedValue = await api.compact({ - activeCtx, - activeProperty, - element: expandedValue, - options, - compactionMap - }); - - if(!(_isArray(compactedValue) && compactedValue.length === 0)) { - _addValue(rval, expandedProperty, compactedValue); - } - continue; - } - - // handle @index property - if(expandedProperty === '@index') { - // drop @index if inside an @index container - const container = _getContextValue( - activeCtx, activeProperty, '@container') || []; - if(container.includes('@index')) { - continue; - } - - // use keyword alias and add value - const alias = api.compactIri({ - activeCtx, - iri: expandedProperty, - relativeTo: {vocab: true} - }); - _addValue(rval, alias, expandedValue); - continue; - } - - // skip array processing for keywords that aren't - // @graph, @list, or @included - if(expandedProperty !== '@graph' && expandedProperty !== '@list' && - expandedProperty !== '@included' && - _isKeyword(expandedProperty)) { - // use keyword alias and add value as is - const alias = api.compactIri({ - activeCtx, - iri: expandedProperty, - relativeTo: {vocab: true} - }); - _addValue(rval, alias, expandedValue); - continue; - } - - // Note: expanded value must be an array due to expansion algorithm. - if(!_isArray(expandedValue)) { - throw new JsonLdError( - 'JSON-LD expansion error; expanded value must be an array.', - 'jsonld.SyntaxError'); - } - - // preserve empty arrays - if(expandedValue.length === 0) { - const itemActiveProperty = api.compactIri({ - activeCtx, - iri: expandedProperty, - value: expandedValue, - relativeTo: {vocab: true}, - reverse: insideReverse - }); - const nestProperty = activeCtx.mappings.has(itemActiveProperty) ? - activeCtx.mappings.get(itemActiveProperty)['@nest'] : null; - let nestResult = rval; - if(nestProperty) { - _checkNestProperty(activeCtx, nestProperty, options); - if(!_isObject(rval[nestProperty])) { - rval[nestProperty] = {}; - } - nestResult = rval[nestProperty]; - } - _addValue( - nestResult, itemActiveProperty, expandedValue, { - propertyIsArray: true - }); - } - - // recusively process array values - for(const expandedItem of expandedValue) { - // compact property and get container type - const itemActiveProperty = api.compactIri({ - activeCtx, - iri: expandedProperty, - value: expandedItem, - relativeTo: {vocab: true}, - reverse: insideReverse - }); - - // if itemActiveProperty is a @nest property, add values to nestResult, - // otherwise rval - const nestProperty = activeCtx.mappings.has(itemActiveProperty) ? - activeCtx.mappings.get(itemActiveProperty)['@nest'] : null; - let nestResult = rval; - if(nestProperty) { - _checkNestProperty(activeCtx, nestProperty, options); - if(!_isObject(rval[nestProperty])) { - rval[nestProperty] = {}; - } - nestResult = rval[nestProperty]; - } - - const container = _getContextValue( - activeCtx, itemActiveProperty, '@container') || []; - - // get simple @graph or @list value if appropriate - const isGraph = _isGraph(expandedItem); - const isList = _isList(expandedItem); - let inner; - if(isList) { - inner = expandedItem['@list']; - } else if(isGraph) { - inner = expandedItem['@graph']; - } - - // recursively compact expanded item - let compactedItem = await api.compact({ - activeCtx, - activeProperty: itemActiveProperty, - element: (isList || isGraph) ? inner : expandedItem, - options, - compactionMap - }); - - // handle @list - if(isList) { - // ensure @list value is an array - if(!_isArray(compactedItem)) { - compactedItem = [compactedItem]; - } - - if(!container.includes('@list')) { - // wrap using @list alias - compactedItem = { - [api.compactIri({ - activeCtx, - iri: '@list', - relativeTo: {vocab: true} - })]: compactedItem - }; - - // include @index from expanded @list, if any - if('@index' in expandedItem) { - compactedItem[api.compactIri({ - activeCtx, - iri: '@index', - relativeTo: {vocab: true} - })] = expandedItem['@index']; - } - } else { - _addValue(nestResult, itemActiveProperty, compactedItem, { - valueIsArray: true, - allowDuplicate: true - }); - continue; - } - } - - // Graph object compaction cases - if(isGraph) { - if(container.includes('@graph') && (container.includes('@id') || - container.includes('@index') && _isSimpleGraph(expandedItem))) { - // get or create the map object - let mapObject; - if(nestResult.hasOwnProperty(itemActiveProperty)) { - mapObject = nestResult[itemActiveProperty]; - } else { - nestResult[itemActiveProperty] = mapObject = {}; - } - - // index on @id or @index or alias of @none - const key = (container.includes('@id') ? - expandedItem['@id'] : expandedItem['@index']) || - api.compactIri({activeCtx, iri: '@none', - relativeTo: {vocab: true}}); - // add compactedItem to map, using value of `@id` or a new blank - // node identifier - - _addValue( - mapObject, key, compactedItem, { - propertyIsArray: - (!options.compactArrays || container.includes('@set')) - }); - } else if(container.includes('@graph') && - _isSimpleGraph(expandedItem)) { - // container includes @graph but not @id or @index and value is a - // simple graph object add compact value - // if compactedItem contains multiple values, it is wrapped in - // `@included` - if(_isArray(compactedItem) && compactedItem.length > 1) { - compactedItem = {'@included': compactedItem}; - } - _addValue( - nestResult, itemActiveProperty, compactedItem, { - propertyIsArray: - (!options.compactArrays || container.includes('@set')) - }); - } else { - // wrap using @graph alias, remove array if only one item and - // compactArrays not set - if(_isArray(compactedItem) && compactedItem.length === 1 && - options.compactArrays) { - compactedItem = compactedItem[0]; - } - compactedItem = { - [api.compactIri({ - activeCtx, - iri: '@graph', - relativeTo: {vocab: true} - })]: compactedItem - }; - - // include @id from expanded graph, if any - if('@id' in expandedItem) { - compactedItem[api.compactIri({ - activeCtx, - iri: '@id', - relativeTo: {vocab: true} - })] = expandedItem['@id']; - } - - // include @index from expanded graph, if any - if('@index' in expandedItem) { - compactedItem[api.compactIri({ - activeCtx, - iri: '@index', - relativeTo: {vocab: true} - })] = expandedItem['@index']; - } - _addValue( - nestResult, itemActiveProperty, compactedItem, { - propertyIsArray: - (!options.compactArrays || container.includes('@set')) - }); - } - } else if(container.includes('@language') || - container.includes('@index') || container.includes('@id') || - container.includes('@type')) { - // handle language and index maps - // get or create the map object - let mapObject; - if(nestResult.hasOwnProperty(itemActiveProperty)) { - mapObject = nestResult[itemActiveProperty]; - } else { - nestResult[itemActiveProperty] = mapObject = {}; - } - - let key; - if(container.includes('@language')) { - // if container is a language map, simplify compacted value to - // a simple string - if(_isValue(compactedItem)) { - compactedItem = compactedItem['@value']; - } - key = expandedItem['@language']; - } else if(container.includes('@index')) { - const indexKey = _getContextValue( - activeCtx, itemActiveProperty, '@index') || '@index'; - const containerKey = api.compactIri( - {activeCtx, iri: indexKey, relativeTo: {vocab: true}}); - if(indexKey === '@index') { - key = expandedItem['@index']; - delete compactedItem[containerKey]; - } else { - let others; - [key, ...others] = _asArray(compactedItem[indexKey] || []); - if(!_isString(key)) { - // Will use @none if it isn't a string. - key = null; - } else { - switch(others.length) { - case 0: - delete compactedItem[indexKey]; - break; - case 1: - compactedItem[indexKey] = others[0]; - break; - default: - compactedItem[indexKey] = others; - break; - } - } - } - } else if(container.includes('@id')) { - const idKey = api.compactIri({activeCtx, iri: '@id', - relativeTo: {vocab: true}}); - key = compactedItem[idKey]; - delete compactedItem[idKey]; - } else if(container.includes('@type')) { - const typeKey = api.compactIri({ - activeCtx, - iri: '@type', - relativeTo: {vocab: true} - }); - let types; - [key, ...types] = _asArray(compactedItem[typeKey] || []); - switch(types.length) { - case 0: - delete compactedItem[typeKey]; - break; - case 1: - compactedItem[typeKey] = types[0]; - break; - default: - compactedItem[typeKey] = types; - break; - } - - // If compactedItem contains a single entry - // whose key maps to @id, recompact without @type - if(Object.keys(compactedItem).length === 1 && - '@id' in expandedItem) { - compactedItem = await api.compact({ - activeCtx, - activeProperty: itemActiveProperty, - element: {'@id': expandedItem['@id']}, - options, - compactionMap - }); - } - } - - // if compacting this value which has no key, index on @none - if(!key) { - key = api.compactIri({activeCtx, iri: '@none', - relativeTo: {vocab: true}}); - } - // add compact value to map object using key from expanded value - // based on the container type - _addValue( - mapObject, key, compactedItem, { - propertyIsArray: container.includes('@set') - }); - } else { - // use an array if: compactArrays flag is false, - // @container is @set or @list , value is an empty - // array, or key is @graph - const isArray = (!options.compactArrays || - container.includes('@set') || container.includes('@list') || - (_isArray(compactedItem) && compactedItem.length === 0) || - expandedProperty === '@list' || expandedProperty === '@graph'); - - // add compact value - _addValue( - nestResult, itemActiveProperty, compactedItem, - {propertyIsArray: isArray}); - } - } - } - - return rval; - } - - // only primitives remain which are already compact - return element; -}; - -/** - * Compacts an IRI or keyword into a term or prefix if it can be. If the - * IRI has an associated value it may be passed. - * - * @param activeCtx the active context to use. - * @param iri the IRI to compact. - * @param value the value to check or null. - * @param relativeTo options for how to compact IRIs: - * vocab: true to split after @vocab, false not to. - * @param reverse true if a reverse property is being compacted, false if not. - * @param base the absolute URL to use for compacting document-relative IRIs. - * - * @return the compacted term, prefix, keyword alias, or the original IRI. - */ -api.compactIri = ({ - activeCtx, - iri, - value = null, - relativeTo = {vocab: false}, - reverse = false, - base = null -}) => { - // can't compact null - if(iri === null) { - return iri; - } - - // if context is from a property term scoped context composed with a - // type-scoped context, then use the previous context instead - if(activeCtx.isPropertyTermScoped && activeCtx.previousContext) { - activeCtx = activeCtx.previousContext; - } - - const inverseCtx = activeCtx.getInverse(); - - // if term is a keyword, it may be compacted to a simple alias - if(_isKeyword(iri) && - iri in inverseCtx && - '@none' in inverseCtx[iri] && - '@type' in inverseCtx[iri]['@none'] && - '@none' in inverseCtx[iri]['@none']['@type']) { - return inverseCtx[iri]['@none']['@type']['@none']; - } - - // use inverse context to pick a term if iri is relative to vocab - if(relativeTo.vocab && iri in inverseCtx) { - const defaultLanguage = activeCtx['@language'] || '@none'; - - // prefer @index if available in value - const containers = []; - if(_isObject(value) && '@index' in value && !('@graph' in value)) { - containers.push('@index', '@index@set'); - } - - // if value is a preserve object, use its value - if(_isObject(value) && '@preserve' in value) { - value = value['@preserve'][0]; - } - - // prefer most specific container including @graph, prefering @set - // variations - if(_isGraph(value)) { - // favor indexmap if the graph is indexed - if('@index' in value) { - containers.push( - '@graph@index', '@graph@index@set', '@index', '@index@set'); - } - // favor idmap if the graph is has an @id - if('@id' in value) { - containers.push( - '@graph@id', '@graph@id@set'); - } - containers.push('@graph', '@graph@set', '@set'); - // allow indexmap if the graph is not indexed - if(!('@index' in value)) { - containers.push( - '@graph@index', '@graph@index@set', '@index', '@index@set'); - } - // allow idmap if the graph does not have an @id - if(!('@id' in value)) { - containers.push('@graph@id', '@graph@id@set'); - } - } else if(_isObject(value) && !_isValue(value)) { - containers.push('@id', '@id@set', '@type', '@set@type'); - } - - // defaults for term selection based on type/language - let typeOrLanguage = '@language'; - let typeOrLanguageValue = '@null'; - - if(reverse) { - typeOrLanguage = '@type'; - typeOrLanguageValue = '@reverse'; - containers.push('@set'); - } else if(_isList(value)) { - // choose the most specific term that works for all elements in @list - // only select @list containers if @index is NOT in value - if(!('@index' in value)) { - containers.push('@list'); - } - const list = value['@list']; - if(list.length === 0) { - // any empty list can be matched against any term that uses the - // @list container regardless of @type or @language - typeOrLanguage = '@any'; - typeOrLanguageValue = '@none'; - } else { - let commonLanguage = (list.length === 0) ? defaultLanguage : null; - let commonType = null; - for(let i = 0; i < list.length; ++i) { - const item = list[i]; - let itemLanguage = '@none'; - let itemType = '@none'; - if(_isValue(item)) { - if('@direction' in item) { - const lang = (item['@language'] || '').toLowerCase(); - const dir = item['@direction']; - itemLanguage = `${lang}_${dir}`; - } else if('@language' in item) { - itemLanguage = item['@language'].toLowerCase(); - } else if('@type' in item) { - itemType = item['@type']; - } else { - // plain literal - itemLanguage = '@null'; - } - } else { - itemType = '@id'; - } - if(commonLanguage === null) { - commonLanguage = itemLanguage; - } else if(itemLanguage !== commonLanguage && _isValue(item)) { - commonLanguage = '@none'; - } - if(commonType === null) { - commonType = itemType; - } else if(itemType !== commonType) { - commonType = '@none'; - } - // there are different languages and types in the list, so choose - // the most generic term, no need to keep iterating the list - if(commonLanguage === '@none' && commonType === '@none') { - break; - } - } - commonLanguage = commonLanguage || '@none'; - commonType = commonType || '@none'; - if(commonType !== '@none') { - typeOrLanguage = '@type'; - typeOrLanguageValue = commonType; - } else { - typeOrLanguageValue = commonLanguage; - } - } - } else { - if(_isValue(value)) { - if('@language' in value && !('@index' in value)) { - containers.push('@language', '@language@set'); - typeOrLanguageValue = value['@language']; - const dir = value['@direction']; - if(dir) { - typeOrLanguageValue = `${typeOrLanguageValue}_${dir}`; - } - } else if('@direction' in value && !('@index' in value)) { - typeOrLanguageValue = `_${value['@direction']}`; - } else if('@type' in value) { - typeOrLanguage = '@type'; - typeOrLanguageValue = value['@type']; - } - } else { - typeOrLanguage = '@type'; - typeOrLanguageValue = '@id'; - } - containers.push('@set'); - } - - // do term selection - containers.push('@none'); - - // an index map can be used to index values using @none, so add as a low - // priority - if(_isObject(value) && !('@index' in value)) { - // allow indexing even if no @index present - containers.push('@index', '@index@set'); - } - - // values without type or language can use @language map - if(_isValue(value) && Object.keys(value).length === 1) { - // allow indexing even if no @index present - containers.push('@language', '@language@set'); - } - - const term = _selectTerm( - activeCtx, iri, value, containers, typeOrLanguage, typeOrLanguageValue); - if(term !== null) { - return term; - } - } - - // no term match, use @vocab if available - if(relativeTo.vocab) { - if('@vocab' in activeCtx) { - // determine if vocab is a prefix of the iri - const vocab = activeCtx['@vocab']; - if(iri.indexOf(vocab) === 0 && iri !== vocab) { - // use suffix as relative iri if it is not a term in the active context - const suffix = iri.substr(vocab.length); - if(!activeCtx.mappings.has(suffix)) { - return suffix; - } - } - } - } - - // no term or @vocab match, check for possible CURIEs - let choice = null; - // TODO: make FastCurieMap a class with a method to do this lookup - const partialMatches = []; - let iriMap = activeCtx.fastCurieMap; - // check for partial matches of against `iri`, which means look until - // iri.length - 1, not full length - const maxPartialLength = iri.length - 1; - for(let i = 0; i < maxPartialLength && iri[i] in iriMap; ++i) { - iriMap = iriMap[iri[i]]; - if('' in iriMap) { - partialMatches.push(iriMap[''][0]); - } - } - // check partial matches in reverse order to prefer longest ones first - for(let i = partialMatches.length - 1; i >= 0; --i) { - const entry = partialMatches[i]; - const terms = entry.terms; - for(const term of terms) { - // a CURIE is usable if: - // 1. it has no mapping, OR - // 2. value is null, which means we're not compacting an @value, AND - // the mapping matches the IRI - const curie = term + ':' + iri.substr(entry.iri.length); - const isUsableCurie = (activeCtx.mappings.get(term)._prefix && - (!activeCtx.mappings.has(curie) || - (value === null && activeCtx.mappings.get(curie)['@id'] === iri))); - - // select curie if it is shorter or the same length but lexicographically - // less than the current choice - if(isUsableCurie && (choice === null || - _compareShortestLeast(curie, choice) < 0)) { - choice = curie; - } - } - } - - // return chosen curie - if(choice !== null) { - return choice; - } - - // If iri could be confused with a compact IRI using a term in this context, - // signal an error - for(const [term, td] of activeCtx.mappings) { - if(td && td._prefix && iri.startsWith(term + ':')) { - throw new JsonLdError( - `Absolute IRI "${iri}" confused with prefix "${term}".`, - 'jsonld.SyntaxError', - {code: 'IRI confused with prefix', context: activeCtx}); - } - } - - // compact IRI relative to base - if(!relativeTo.vocab) { - if('@base' in activeCtx) { - if(!activeCtx['@base']) { - // The None case preserves rval as potentially relative - return iri; - } else { - return _removeBase(_prependBase(base, activeCtx['@base']), iri); - } - } else { - return _removeBase(base, iri); - } - } - - // return IRI as is - return iri; -}; - -/** - * Performs value compaction on an object with '@value' or '@id' as the only - * property. - * - * @param activeCtx the active context. - * @param activeProperty the active property that points to the value. - * @param value the value to compact. - * @param {Object} [options] - processing options. - * - * @return the compaction result. - */ -api.compactValue = ({activeCtx, activeProperty, value, options}) => { - // value is a @value - if(_isValue(value)) { - // get context rules - const type = _getContextValue(activeCtx, activeProperty, '@type'); - const language = _getContextValue(activeCtx, activeProperty, '@language'); - const direction = _getContextValue(activeCtx, activeProperty, '@direction'); - const container = - _getContextValue(activeCtx, activeProperty, '@container') || []; - - // whether or not the value has an @index that must be preserved - const preserveIndex = '@index' in value && !container.includes('@index'); - - // if there's no @index to preserve ... - if(!preserveIndex && type !== '@none') { - // matching @type or @language specified in context, compact value - if(value['@type'] === type) { - return value['@value']; - } - if('@language' in value && value['@language'] === language && - '@direction' in value && value['@direction'] === direction) { - return value['@value']; - } - if('@language' in value && value['@language'] === language) { - return value['@value']; - } - if('@direction' in value && value['@direction'] === direction) { - return value['@value']; - } - } - - // return just the value of @value if all are true: - // 1. @value is the only key or @index isn't being preserved - // 2. there is no default language or @value is not a string or - // the key has a mapping with a null @language - const keyCount = Object.keys(value).length; - const isValueOnlyKey = (keyCount === 1 || - (keyCount === 2 && '@index' in value && !preserveIndex)); - const hasDefaultLanguage = ('@language' in activeCtx); - const isValueString = _isString(value['@value']); - const hasNullMapping = (activeCtx.mappings.has(activeProperty) && - activeCtx.mappings.get(activeProperty)['@language'] === null); - if(isValueOnlyKey && - type !== '@none' && - (!hasDefaultLanguage || !isValueString || hasNullMapping)) { - return value['@value']; - } - - const rval = {}; - - // preserve @index - if(preserveIndex) { - rval[api.compactIri({ - activeCtx, - iri: '@index', - relativeTo: {vocab: true} - })] = value['@index']; - } - - if('@type' in value) { - // compact @type IRI - rval[api.compactIri({ - activeCtx, - iri: '@type', - relativeTo: {vocab: true} - })] = api.compactIri( - {activeCtx, iri: value['@type'], relativeTo: {vocab: true}}); - } else if('@language' in value) { - // alias @language - rval[api.compactIri({ - activeCtx, - iri: '@language', - relativeTo: {vocab: true} - })] = value['@language']; - } - - if('@direction' in value) { - // alias @direction - rval[api.compactIri({ - activeCtx, - iri: '@direction', - relativeTo: {vocab: true} - })] = value['@direction']; - } - - // alias @value - rval[api.compactIri({ - activeCtx, - iri: '@value', - relativeTo: {vocab: true} - })] = value['@value']; - - return rval; - } - - // value is a subject reference - const expandedProperty = _expandIri(activeCtx, activeProperty, {vocab: true}, - options); - const type = _getContextValue(activeCtx, activeProperty, '@type'); - const compacted = api.compactIri({ - activeCtx, - iri: value['@id'], - relativeTo: {vocab: type === '@vocab'}, - base: options.base}); - - // compact to scalar - if(type === '@id' || type === '@vocab' || expandedProperty === '@graph') { - return compacted; - } - - return { - [api.compactIri({ - activeCtx, - iri: '@id', - relativeTo: {vocab: true} - })]: compacted - }; -}; - -/** - * Picks the preferred compaction term from the given inverse context entry. - * - * @param activeCtx the active context. - * @param iri the IRI to pick the term for. - * @param value the value to pick the term for. - * @param containers the preferred containers. - * @param typeOrLanguage either '@type' or '@language'. - * @param typeOrLanguageValue the preferred value for '@type' or '@language'. - * - * @return the preferred term. - */ -function _selectTerm( - activeCtx, iri, value, containers, typeOrLanguage, typeOrLanguageValue) { - if(typeOrLanguageValue === null) { - typeOrLanguageValue = '@null'; - } - - // preferences for the value of @type or @language - const prefs = []; - - // determine prefs for @id based on whether or not value compacts to a term - if((typeOrLanguageValue === '@id' || typeOrLanguageValue === '@reverse') && - _isObject(value) && '@id' in value) { - // prefer @reverse first - if(typeOrLanguageValue === '@reverse') { - prefs.push('@reverse'); - } - // try to compact value to a term - const term = api.compactIri( - {activeCtx, iri: value['@id'], relativeTo: {vocab: true}}); - if(activeCtx.mappings.has(term) && - activeCtx.mappings.get(term) && - activeCtx.mappings.get(term)['@id'] === value['@id']) { - // prefer @vocab - prefs.push.apply(prefs, ['@vocab', '@id']); - } else { - // prefer @id - prefs.push.apply(prefs, ['@id', '@vocab']); - } - } else { - prefs.push(typeOrLanguageValue); - - // consider direction only - const langDir = prefs.find(el => el.includes('_')); - if(langDir) { - // consider _dir portion - prefs.push(langDir.replace(/^[^_]+_/, '_')); - } - } - prefs.push('@none'); - - const containerMap = activeCtx.inverse[iri]; - for(const container of containers) { - // if container not available in the map, continue - if(!(container in containerMap)) { - continue; - } - - const typeOrLanguageValueMap = containerMap[container][typeOrLanguage]; - for(const pref of prefs) { - // if type/language option not available in the map, continue - if(!(pref in typeOrLanguageValueMap)) { - continue; - } - - // select term - return typeOrLanguageValueMap[pref]; - } - } - - return null; -} - -/** - * The value of `@nest` in the term definition must either be `@nest`, or a term - * which resolves to `@nest`. - * - * @param activeCtx the active context. - * @param nestProperty a term in the active context or `@nest`. - * @param {Object} [options] - processing options. - */ -function _checkNestProperty(activeCtx, nestProperty, options) { - if(_expandIri(activeCtx, nestProperty, {vocab: true}, options) !== '@nest') { - throw new JsonLdError( - 'JSON-LD compact error; nested property must have an @nest value ' + - 'resolving to @nest.', - 'jsonld.SyntaxError', {code: 'invalid @nest value'}); - } -} - -},{"./JsonLdError":12,"./context":19,"./graphTypes":25,"./types":30,"./url":31,"./util":32}],18:[function(require,module,exports){ -/* - * Copyright (c) 2017 Digital Bazaar, Inc. All rights reserved. - */ -'use strict'; - -const RDF = 'http://www.w3.org/1999/02/22-rdf-syntax-ns#'; -const XSD = 'http://www.w3.org/2001/XMLSchema#'; - -module.exports = { - // TODO: Deprecated and will be removed later. Use LINK_HEADER_CONTEXT. - LINK_HEADER_REL: 'http://www.w3.org/ns/json-ld#context', - - LINK_HEADER_CONTEXT: 'http://www.w3.org/ns/json-ld#context', - - RDF, - RDF_LIST: RDF + 'List', - RDF_FIRST: RDF + 'first', - RDF_REST: RDF + 'rest', - RDF_NIL: RDF + 'nil', - RDF_TYPE: RDF + 'type', - RDF_PLAIN_LITERAL: RDF + 'PlainLiteral', - RDF_XML_LITERAL: RDF + 'XMLLiteral', - RDF_JSON_LITERAL: RDF + 'JSON', - RDF_OBJECT: RDF + 'object', - RDF_LANGSTRING: RDF + 'langString', - - XSD, - XSD_BOOLEAN: XSD + 'boolean', - XSD_DOUBLE: XSD + 'double', - XSD_INTEGER: XSD + 'integer', - XSD_STRING: XSD + 'string', -}; - -},{}],19:[function(require,module,exports){ -/* - * Copyright (c) 2017-2019 Digital Bazaar, Inc. All rights reserved. - */ -'use strict'; - -const util = require('./util'); -const JsonLdError = require('./JsonLdError'); - -const { - isArray: _isArray, - isObject: _isObject, - isString: _isString, - isUndefined: _isUndefined -} = require('./types'); - -const { - isAbsolute: _isAbsoluteIri, - isRelative: _isRelativeIri, - prependBase -} = require('./url'); - -const { - asArray: _asArray, - compareShortestLeast: _compareShortestLeast -} = require('./util'); - -const INITIAL_CONTEXT_CACHE = new Map(); -const INITIAL_CONTEXT_CACHE_MAX_SIZE = 10000; -const KEYWORD_PATTERN = /^@[a-zA-Z]+$/; - -const api = {}; -module.exports = api; - -/** - * Processes a local context and returns a new active context. - * - * @param activeCtx the current active context. - * @param localCtx the local context to process. - * @param options the context processing options. - * @param propagate `true` if `false`, retains any previously defined term, - * which can be rolled back when the descending into a new node object. - * @param overrideProtected `false` allows protected terms to be modified. - * - * @return a Promise that resolves to the new active context. - */ -api.process = async ({ - activeCtx, localCtx, options, - propagate = true, - overrideProtected = false, - cycles = new Set() -}) => { - // normalize local context to an array of @context objects - if(_isObject(localCtx) && '@context' in localCtx && - _isArray(localCtx['@context'])) { - localCtx = localCtx['@context']; - } - const ctxs = _asArray(localCtx); - - // no contexts in array, return current active context w/o changes - if(ctxs.length === 0) { - return activeCtx; - } - - // resolve contexts - const resolved = await options.contextResolver.resolve({ - activeCtx, - context: localCtx, - documentLoader: options.documentLoader, - base: options.base - }); - - // override propagate if first resolved context has `@propagate` - if(_isObject(resolved[0].document) && - typeof resolved[0].document['@propagate'] === 'boolean') { - // retrieve early, error checking done later - propagate = resolved[0].document['@propagate']; - } - - // process each context in order, update active context - // on each iteration to ensure proper caching - let rval = activeCtx; - - // track the previous context - // if not propagating, make sure rval has a previous context - if(!propagate && !rval.previousContext) { - // clone `rval` context before updating - rval = rval.clone(); - rval.previousContext = activeCtx; - } - - for(const resolvedContext of resolved) { - let {document: ctx} = resolvedContext; - - // update active context to one computed from last iteration - activeCtx = rval; - - // reset to initial context - if(ctx === null) { - // We can't nullify if there are protected terms and we're - // not allowing overrides (e.g. processing a property term scoped context) - if(!overrideProtected && - Object.keys(activeCtx.protected).length !== 0) { - const protectedMode = (options && options.protectedMode) || 'error'; - if(protectedMode === 'error') { - throw new JsonLdError( - 'Tried to nullify a context with protected terms outside of ' + - 'a term definition.', - 'jsonld.SyntaxError', - {code: 'invalid context nullification'}); - } else if(protectedMode === 'warn') { - // FIXME: remove logging and use a handler - console.warn('WARNING: invalid context nullification'); - - // get processed context from cache if available - const processed = resolvedContext.getProcessed(activeCtx); - if(processed) { - rval = activeCtx = processed; - continue; - } - - const oldActiveCtx = activeCtx; - // copy all protected term definitions to fresh initial context - rval = activeCtx = api.getInitialContext(options).clone(); - for(const [term, _protected] of - Object.entries(oldActiveCtx.protected)) { - if(_protected) { - activeCtx.mappings[term] = - util.clone(oldActiveCtx.mappings[term]); - } - } - activeCtx.protected = util.clone(oldActiveCtx.protected); - - // cache processed result - resolvedContext.setProcessed(oldActiveCtx, rval); - continue; - } - throw new JsonLdError( - 'Invalid protectedMode.', - 'jsonld.SyntaxError', - {code: 'invalid protected mode', context: localCtx, protectedMode}); - } - rval = activeCtx = api.getInitialContext(options).clone(); - continue; - } - - // get processed context from cache if available - const processed = resolvedContext.getProcessed(activeCtx); - if(processed) { - rval = activeCtx = processed; - continue; - } - - // dereference @context key if present - if(_isObject(ctx) && '@context' in ctx) { - ctx = ctx['@context']; - } - - // context must be an object by now, all URLs retrieved before this call - if(!_isObject(ctx)) { - throw new JsonLdError( - 'Invalid JSON-LD syntax; @context must be an object.', - 'jsonld.SyntaxError', {code: 'invalid local context', context: ctx}); - } - - // TODO: there is likely a `previousContext` cloning optimization that - // could be applied here (no need to copy it under certain conditions) - - // clone context before updating it - rval = rval.clone(); - - // define context mappings for keys in local context - const defined = new Map(); - - // handle @version - if('@version' in ctx) { - if(ctx['@version'] !== 1.1) { - throw new JsonLdError( - 'Unsupported JSON-LD version: ' + ctx['@version'], - 'jsonld.UnsupportedVersion', - {code: 'invalid @version value', context: ctx}); - } - if(activeCtx.processingMode && - activeCtx.processingMode === 'json-ld-1.0') { - throw new JsonLdError( - '@version: ' + ctx['@version'] + ' not compatible with ' + - activeCtx.processingMode, - 'jsonld.ProcessingModeConflict', - {code: 'processing mode conflict', context: ctx}); - } - rval.processingMode = 'json-ld-1.1'; - rval['@version'] = ctx['@version']; - defined.set('@version', true); - } - - // if not set explicitly, set processingMode to "json-ld-1.1" - rval.processingMode = - rval.processingMode || activeCtx.processingMode; - - // handle @base - if('@base' in ctx) { - let base = ctx['@base']; - - if(base === null || _isAbsoluteIri(base)) { - // no action - } else if(_isRelativeIri(base)) { - base = prependBase(rval['@base'], base); - } else { - throw new JsonLdError( - 'Invalid JSON-LD syntax; the value of "@base" in a ' + - '@context must be an absolute IRI, a relative IRI, or null.', - 'jsonld.SyntaxError', {code: 'invalid base IRI', context: ctx}); - } - - rval['@base'] = base; - defined.set('@base', true); - } - - // handle @vocab - if('@vocab' in ctx) { - const value = ctx['@vocab']; - if(value === null) { - delete rval['@vocab']; - } else if(!_isString(value)) { - throw new JsonLdError( - 'Invalid JSON-LD syntax; the value of "@vocab" in a ' + - '@context must be a string or null.', - 'jsonld.SyntaxError', {code: 'invalid vocab mapping', context: ctx}); - } else if(!_isAbsoluteIri(value) && api.processingMode(rval, 1.0)) { - throw new JsonLdError( - 'Invalid JSON-LD syntax; the value of "@vocab" in a ' + - '@context must be an absolute IRI.', - 'jsonld.SyntaxError', {code: 'invalid vocab mapping', context: ctx}); - } else { - rval['@vocab'] = _expandIri(rval, value, {vocab: true, base: true}, - undefined, undefined, options); - } - defined.set('@vocab', true); - } - - // handle @language - if('@language' in ctx) { - const value = ctx['@language']; - if(value === null) { - delete rval['@language']; - } else if(!_isString(value)) { - throw new JsonLdError( - 'Invalid JSON-LD syntax; the value of "@language" in a ' + - '@context must be a string or null.', - 'jsonld.SyntaxError', - {code: 'invalid default language', context: ctx}); - } else { - rval['@language'] = value.toLowerCase(); - } - defined.set('@language', true); - } - - // handle @direction - if('@direction' in ctx) { - const value = ctx['@direction']; - if(activeCtx.processingMode === 'json-ld-1.0') { - throw new JsonLdError( - 'Invalid JSON-LD syntax; @direction not compatible with ' + - activeCtx.processingMode, - 'jsonld.SyntaxError', - {code: 'invalid context member', context: ctx}); - } - if(value === null) { - delete rval['@direction']; - } else if(value !== 'ltr' && value !== 'rtl') { - throw new JsonLdError( - 'Invalid JSON-LD syntax; the value of "@direction" in a ' + - '@context must be null, "ltr", or "rtl".', - 'jsonld.SyntaxError', - {code: 'invalid base direction', context: ctx}); - } else { - rval['@direction'] = value; - } - defined.set('@direction', true); - } - - // handle @propagate - // note: we've already extracted it, here we just do error checking - if('@propagate' in ctx) { - const value = ctx['@propagate']; - if(activeCtx.processingMode === 'json-ld-1.0') { - throw new JsonLdError( - 'Invalid JSON-LD syntax; @propagate not compatible with ' + - activeCtx.processingMode, - 'jsonld.SyntaxError', - {code: 'invalid context entry', context: ctx}); - } - if(typeof value !== 'boolean') { - throw new JsonLdError( - 'Invalid JSON-LD syntax; @propagate value must be a boolean.', - 'jsonld.SyntaxError', - {code: 'invalid @propagate value', context: localCtx}); - } - defined.set('@propagate', true); - } - - // handle @import - if('@import' in ctx) { - const value = ctx['@import']; - if(activeCtx.processingMode === 'json-ld-1.0') { - throw new JsonLdError( - 'Invalid JSON-LD syntax; @import not compatible with ' + - activeCtx.processingMode, - 'jsonld.SyntaxError', - {code: 'invalid context entry', context: ctx}); - } - if(!_isString(value)) { - throw new JsonLdError( - 'Invalid JSON-LD syntax; @import must be a string.', - 'jsonld.SyntaxError', - {code: 'invalid @import value', context: localCtx}); - } - - // resolve contexts - const resolvedImport = await options.contextResolver.resolve({ - activeCtx, - context: value, - documentLoader: options.documentLoader, - base: options.base - }); - if(resolvedImport.length !== 1) { - throw new JsonLdError( - 'Invalid JSON-LD syntax; @import must reference a single context.', - 'jsonld.SyntaxError', - {code: 'invalid remote context', context: localCtx}); - } - const processedImport = resolvedImport[0].getProcessed(activeCtx); - if(processedImport) { - // Note: if the same context were used in this active context - // as a reference context, then processed_input might not - // be a dict. - ctx = processedImport; - } else { - const importCtx = resolvedImport[0].document; - if('@import' in importCtx) { - throw new JsonLdError( - 'Invalid JSON-LD syntax: ' + - 'imported context must not include @import.', - 'jsonld.SyntaxError', - {code: 'invalid context entry', context: localCtx}); - } - - // merge ctx into importCtx and replace rval with the result - for(const key in importCtx) { - if(!ctx.hasOwnProperty(key)) { - ctx[key] = importCtx[key]; - } - } - - // Note: this could potenially conflict if the import - // were used in the same active context as a referenced - // context and an import. In this case, we - // could override the cached result, but seems unlikely. - resolvedImport[0].setProcessed(activeCtx, ctx); - } - - defined.set('@import', true); - } - - // handle @protected; determine whether this sub-context is declaring - // all its terms to be "protected" (exceptions can be made on a - // per-definition basis) - defined.set('@protected', ctx['@protected'] || false); - - // process all other keys - for(const key in ctx) { - api.createTermDefinition({ - activeCtx: rval, - localCtx: ctx, - term: key, - defined, - options, - overrideProtected - }); - - if(_isObject(ctx[key]) && '@context' in ctx[key]) { - const keyCtx = ctx[key]['@context']; - let process = true; - if(_isString(keyCtx)) { - const url = prependBase(options.base, keyCtx); - // track processed contexts to avoid scoped context recursion - if(cycles.has(url)) { - process = false; - } else { - cycles.add(url); - } - } - // parse context to validate - if(process) { - try { - await api.process({ - activeCtx: rval.clone(), - localCtx: ctx[key]['@context'], - overrideProtected: true, - options, - cycles - }); - } catch(e) { - throw new JsonLdError( - 'Invalid JSON-LD syntax; invalid scoped context.', - 'jsonld.SyntaxError', - { - code: 'invalid scoped context', - context: ctx[key]['@context'], - term: key - }); - } - } - } - } - - // cache processed result - resolvedContext.setProcessed(activeCtx, rval); - } - - return rval; -}; - -/** - * Creates a term definition during context processing. - * - * @param activeCtx the current active context. - * @param localCtx the local context being processed. - * @param term the term in the local context to define the mapping for. - * @param defined a map of defining/defined keys to detect cycles and prevent - * double definitions. - * @param {Object} [options] - creation options. - * @param {string} [options.protectedMode="error"] - "error" to throw error - * on `@protected` constraint violation, "warn" to allow violations and - * signal a warning. - * @param overrideProtected `false` allows protected terms to be modified. - */ -api.createTermDefinition = ({ - activeCtx, - localCtx, - term, - defined, - options, - overrideProtected = false, -}) => { - if(defined.has(term)) { - // term already defined - if(defined.get(term)) { - return; - } - // cycle detected - throw new JsonLdError( - 'Cyclical context definition detected.', - 'jsonld.CyclicalContext', - {code: 'cyclic IRI mapping', context: localCtx, term}); - } - - // now defining term - defined.set(term, false); - - // get context term value - let value; - if(localCtx.hasOwnProperty(term)) { - value = localCtx[term]; - } - - if(term === '@type' && - _isObject(value) && - (value['@container'] || '@set') === '@set' && - api.processingMode(activeCtx, 1.1)) { - - const validKeys = ['@container', '@id', '@protected']; - const keys = Object.keys(value); - if(keys.length === 0 || keys.some(k => !validKeys.includes(k))) { - throw new JsonLdError( - 'Invalid JSON-LD syntax; keywords cannot be overridden.', - 'jsonld.SyntaxError', - {code: 'keyword redefinition', context: localCtx, term}); - } - } else if(api.isKeyword(term)) { - throw new JsonLdError( - 'Invalid JSON-LD syntax; keywords cannot be overridden.', - 'jsonld.SyntaxError', - {code: 'keyword redefinition', context: localCtx, term}); - } else if(term.match(KEYWORD_PATTERN)) { - // FIXME: remove logging and use a handler - console.warn('WARNING: terms beginning with "@" are reserved' + - ' for future use and ignored', {term}); - return; - } else if(term === '') { - throw new JsonLdError( - 'Invalid JSON-LD syntax; a term cannot be an empty string.', - 'jsonld.SyntaxError', - {code: 'invalid term definition', context: localCtx}); - } - - // keep reference to previous mapping for potential `@protected` check - const previousMapping = activeCtx.mappings.get(term); - - // remove old mapping - if(activeCtx.mappings.has(term)) { - activeCtx.mappings.delete(term); - } - - // convert short-hand value to object w/@id - let simpleTerm = false; - if(_isString(value) || value === null) { - simpleTerm = true; - value = {'@id': value}; - } - - if(!_isObject(value)) { - throw new JsonLdError( - 'Invalid JSON-LD syntax; @context term values must be ' + - 'strings or objects.', - 'jsonld.SyntaxError', - {code: 'invalid term definition', context: localCtx}); - } - - // create new mapping - const mapping = {}; - activeCtx.mappings.set(term, mapping); - mapping.reverse = false; - - // make sure term definition only has expected keywords - const validKeys = ['@container', '@id', '@language', '@reverse', '@type']; - - // JSON-LD 1.1 support - if(api.processingMode(activeCtx, 1.1)) { - validKeys.push( - '@context', '@direction', '@index', '@nest', '@prefix', '@protected'); - } - - for(const kw in value) { - if(!validKeys.includes(kw)) { - throw new JsonLdError( - 'Invalid JSON-LD syntax; a term definition must not contain ' + kw, - 'jsonld.SyntaxError', - {code: 'invalid term definition', context: localCtx}); - } - } - - // always compute whether term has a colon as an optimization for - // _compactIri - const colon = term.indexOf(':'); - mapping._termHasColon = (colon > 0); - - if('@reverse' in value) { - if('@id' in value) { - throw new JsonLdError( - 'Invalid JSON-LD syntax; a @reverse term definition must not ' + - 'contain @id.', 'jsonld.SyntaxError', - {code: 'invalid reverse property', context: localCtx}); - } - if('@nest' in value) { - throw new JsonLdError( - 'Invalid JSON-LD syntax; a @reverse term definition must not ' + - 'contain @nest.', 'jsonld.SyntaxError', - {code: 'invalid reverse property', context: localCtx}); - } - const reverse = value['@reverse']; - if(!_isString(reverse)) { - throw new JsonLdError( - 'Invalid JSON-LD syntax; a @context @reverse value must be a string.', - 'jsonld.SyntaxError', {code: 'invalid IRI mapping', context: localCtx}); - } - - if(!api.isKeyword(reverse) && reverse.match(KEYWORD_PATTERN)) { - // FIXME: remove logging and use a handler - console.warn('WARNING: values beginning with "@" are reserved' + - ' for future use and ignored', {reverse}); - if(previousMapping) { - activeCtx.mappings.set(term, previousMapping); - } else { - activeCtx.mappings.delete(term); - } - return; - } - - // expand and add @id mapping - const id = _expandIri( - activeCtx, reverse, {vocab: true, base: false}, localCtx, defined, - options); - if(!_isAbsoluteIri(id)) { - throw new JsonLdError( - '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: localCtx}); - } - - mapping['@id'] = id; - mapping.reverse = true; - } else if('@id' in value) { - let id = value['@id']; - if(id && !_isString(id)) { - throw new JsonLdError( - 'Invalid JSON-LD syntax; a @context @id value must be an array ' + - 'of strings or a string.', - 'jsonld.SyntaxError', {code: 'invalid IRI mapping', context: localCtx}); - } - if(id === null) { - // reserve a null term, which may be protected - mapping['@id'] = null; - } else if(!api.isKeyword(id) && id.match(KEYWORD_PATTERN)) { - // FIXME: remove logging and use a handler - console.warn('WARNING: values beginning with "@" are reserved' + - ' for future use and ignored', {id}); - if(previousMapping) { - activeCtx.mappings.set(term, previousMapping); - } else { - activeCtx.mappings.delete(term); - } - return; - } else if(id !== term) { - // expand and add @id mapping - id = _expandIri( - activeCtx, id, {vocab: true, base: false}, localCtx, defined, options); - if(!_isAbsoluteIri(id) && !api.isKeyword(id)) { - throw new JsonLdError( - '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: localCtx}); - } - - // if term has the form of an IRI it must map the same - if(term.match(/(?::[^:])|\//)) { - const termDefined = new Map(defined).set(term, true); - const termIri = _expandIri( - activeCtx, term, {vocab: true, base: false}, - localCtx, termDefined, options); - if(termIri !== id) { - throw new JsonLdError( - 'Invalid JSON-LD syntax; term in form of IRI must ' + - 'expand to definition.', - 'jsonld.SyntaxError', - {code: 'invalid IRI mapping', context: localCtx}); - } - } - - mapping['@id'] = id; - // indicate if this term may be used as a compact IRI prefix - mapping._prefix = (simpleTerm && - !mapping._termHasColon && - id.match(/[:\/\?#\[\]@]$/)); - } - } - - if(!('@id' in mapping)) { - // see if the term has a prefix - if(mapping._termHasColon) { - const prefix = term.substr(0, colon); - if(localCtx.hasOwnProperty(prefix)) { - // define parent prefix - api.createTermDefinition({ - activeCtx, localCtx, term: prefix, defined, options - }); - } - - if(activeCtx.mappings.has(prefix)) { - // set @id based on prefix parent - const suffix = term.substr(colon + 1); - mapping['@id'] = activeCtx.mappings.get(prefix)['@id'] + suffix; - } else { - // term is an absolute IRI - mapping['@id'] = term; - } - } else if(term === '@type') { - // Special case, were we've previously determined that container is @set - mapping['@id'] = term; - } else { - // non-IRIs *must* define @ids if @vocab is not available - if(!('@vocab' in activeCtx)) { - throw new JsonLdError( - 'Invalid JSON-LD syntax; @context terms must define an @id.', - 'jsonld.SyntaxError', - {code: 'invalid IRI mapping', context: localCtx, term}); - } - // prepend vocab to term - mapping['@id'] = activeCtx['@vocab'] + term; - } - } - - // Handle term protection - if(value['@protected'] === true || - (defined.get('@protected') === true && value['@protected'] !== false)) { - activeCtx.protected[term] = true; - mapping.protected = true; - } - - // IRI mapping now defined - defined.set(term, true); - - if('@type' in value) { - let type = value['@type']; - if(!_isString(type)) { - throw new JsonLdError( - 'Invalid JSON-LD syntax; an @context @type value must be a string.', - 'jsonld.SyntaxError', - {code: 'invalid type mapping', context: localCtx}); - } - - if((type === '@json' || type === '@none')) { - if(api.processingMode(activeCtx, 1.0)) { - throw new JsonLdError( - 'Invalid JSON-LD syntax; an @context @type value must not be ' + - `"${type}" in JSON-LD 1.0 mode.`, - 'jsonld.SyntaxError', - {code: 'invalid type mapping', context: localCtx}); - } - } else if(type !== '@id' && type !== '@vocab') { - // expand @type to full IRI - type = _expandIri( - activeCtx, type, {vocab: true, base: false}, localCtx, defined, - options); - if(!_isAbsoluteIri(type)) { - throw new JsonLdError( - 'Invalid JSON-LD syntax; an @context @type value must be an ' + - 'absolute IRI.', - 'jsonld.SyntaxError', - {code: 'invalid type mapping', context: localCtx}); - } - if(type.indexOf('_:') === 0) { - throw new JsonLdError( - 'Invalid JSON-LD syntax; an @context @type value must be an IRI, ' + - 'not a blank node identifier.', - 'jsonld.SyntaxError', - {code: 'invalid type mapping', context: localCtx}); - } - } - - // add @type to mapping - mapping['@type'] = type; - } - - if('@container' in value) { - // normalize container to an array form - const container = _isString(value['@container']) ? - [value['@container']] : (value['@container'] || []); - const validContainers = ['@list', '@set', '@index', '@language']; - let isValid = true; - const hasSet = container.includes('@set'); - - // JSON-LD 1.1 support - if(api.processingMode(activeCtx, 1.1)) { - validContainers.push('@graph', '@id', '@type'); - - // check container length - if(container.includes('@list')) { - if(container.length !== 1) { - throw new JsonLdError( - 'Invalid JSON-LD syntax; @context @container with @list must ' + - 'have no other values', - 'jsonld.SyntaxError', - {code: 'invalid container mapping', context: localCtx}); - } - } else if(container.includes('@graph')) { - if(container.some(key => - key !== '@graph' && key !== '@id' && key !== '@index' && - key !== '@set')) { - throw new JsonLdError( - '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: localCtx}); - } - } else { - // otherwise, container may also include @set - isValid &= container.length <= (hasSet ? 2 : 1); - } - - if(container.includes('@type')) { - // If mapping does not have an @type, - // set it to @id - mapping['@type'] = mapping['@type'] || '@id'; - - // type mapping must be either @id or @vocab - if(!['@id', '@vocab'].includes(mapping['@type'])) { - throw new JsonLdError( - 'Invalid JSON-LD syntax; container: @type requires @type to be ' + - '@id or @vocab.', - 'jsonld.SyntaxError', - {code: 'invalid type mapping', context: localCtx}); - } - } - } else { - // in JSON-LD 1.0, container must not be an array (it must be a string, - // which is one of the validContainers) - isValid &= !_isArray(value['@container']); - - // check container length - isValid &= container.length <= 1; - } - - // check against valid containers - isValid &= container.every(c => validContainers.includes(c)); - - // @set not allowed with @list - isValid &= !(hasSet && container.includes('@list')); - - if(!isValid) { - throw new JsonLdError( - 'Invalid JSON-LD syntax; @context @container value must be ' + - 'one of the following: ' + validContainers.join(', '), - 'jsonld.SyntaxError', - {code: 'invalid container mapping', context: localCtx}); - } - - if(mapping.reverse && - !container.every(c => ['@index', '@set'].includes(c))) { - throw new JsonLdError( - 'Invalid JSON-LD syntax; @context @container value for a @reverse ' + - 'type definition must be @index or @set.', 'jsonld.SyntaxError', - {code: 'invalid reverse property', context: localCtx}); - } - - // add @container to mapping - mapping['@container'] = container; - } - - // property indexing - if('@index' in value) { - if(!('@container' in value) || !mapping['@container'].includes('@index')) { - throw new JsonLdError( - 'Invalid JSON-LD syntax; @index without @index in @container: ' + - `"${value['@index']}" on term "${term}".`, 'jsonld.SyntaxError', - {code: 'invalid term definition', context: localCtx}); - } - if(!_isString(value['@index']) || value['@index'].indexOf('@') === 0) { - throw new JsonLdError( - 'Invalid JSON-LD syntax; @index must expand to an IRI: ' + - `"${value['@index']}" on term "${term}".`, 'jsonld.SyntaxError', - {code: 'invalid term definition', context: localCtx}); - } - mapping['@index'] = value['@index']; - } - - // scoped contexts - if('@context' in value) { - mapping['@context'] = value['@context']; - } - - if('@language' in value && !('@type' in value)) { - let language = value['@language']; - if(language !== null && !_isString(language)) { - throw new JsonLdError( - 'Invalid JSON-LD syntax; @context @language value must be ' + - 'a string or null.', 'jsonld.SyntaxError', - {code: 'invalid language mapping', context: localCtx}); - } - - // add @language to mapping - if(language !== null) { - language = language.toLowerCase(); - } - mapping['@language'] = language; - } - - // term may be used as a prefix - if('@prefix' in value) { - if(term.match(/:|\//)) { - throw new JsonLdError( - 'Invalid JSON-LD syntax; @context @prefix used on a compact IRI term', - 'jsonld.SyntaxError', - {code: 'invalid term definition', context: localCtx}); - } - if(api.isKeyword(mapping['@id'])) { - throw new JsonLdError( - 'Invalid JSON-LD syntax; keywords may not be used as prefixes', - 'jsonld.SyntaxError', - {code: 'invalid term definition', context: localCtx}); - } - if(typeof value['@prefix'] === 'boolean') { - mapping._prefix = value['@prefix'] === true; - } else { - throw new JsonLdError( - 'Invalid JSON-LD syntax; @context value for @prefix must be boolean', - 'jsonld.SyntaxError', - {code: 'invalid @prefix value', context: localCtx}); - } - } - - if('@direction' in value) { - const direction = value['@direction']; - if(direction !== null && direction !== 'ltr' && direction !== 'rtl') { - throw new JsonLdError( - 'Invalid JSON-LD syntax; @direction value must be ' + - 'null, "ltr", or "rtl".', - 'jsonld.SyntaxError', - {code: 'invalid base direction', context: localCtx}); - } - mapping['@direction'] = direction; - } - - if('@nest' in value) { - const nest = value['@nest']; - if(!_isString(nest) || (nest !== '@nest' && nest.indexOf('@') === 0)) { - throw new JsonLdError( - '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: localCtx}); - } - mapping['@nest'] = nest; - } - - // disallow aliasing @context and @preserve - const id = mapping['@id']; - if(id === '@context' || id === '@preserve') { - throw new JsonLdError( - 'Invalid JSON-LD syntax; @context and @preserve cannot be aliased.', - 'jsonld.SyntaxError', {code: 'invalid keyword alias', context: localCtx}); - } - - // Check for overriding protected terms - if(previousMapping && previousMapping.protected && !overrideProtected) { - // force new term to continue to be protected and see if the mappings would - // be equal - activeCtx.protected[term] = true; - mapping.protected = true; - if(!_deepCompare(previousMapping, mapping)) { - const protectedMode = (options && options.protectedMode) || 'error'; - if(protectedMode === 'error') { - throw new JsonLdError( - `Invalid JSON-LD syntax; tried to redefine "${term}" which is a ` + - 'protected term.', - 'jsonld.SyntaxError', - {code: 'protected term redefinition', context: localCtx, term}); - } else if(protectedMode === 'warn') { - // FIXME: remove logging and use a handler - console.warn('WARNING: protected term redefinition', {term}); - return; - } - throw new JsonLdError( - 'Invalid protectedMode.', - 'jsonld.SyntaxError', - {code: 'invalid protected mode', context: localCtx, term, - protectedMode}); - } - } -}; - -/** - * Expands a string to a full IRI. The string may be a term, a prefix, a - * relative IRI, or an absolute IRI. The associated absolute IRI will be - * returned. - * - * @param activeCtx the current active context. - * @param value the string to expand. - * @param relativeTo options for how to resolve relative IRIs: - * base: true to resolve against the base IRI, false not to. - * vocab: true to concatenate after @vocab, false not to. - * @param {Object} [options] - processing options. - * - * @return the expanded value. - */ -api.expandIri = (activeCtx, value, relativeTo, options) => { - return _expandIri(activeCtx, value, relativeTo, undefined, undefined, - options); -}; - -/** - * Expands a string to a full IRI. The string may be a term, a prefix, a - * relative IRI, or an absolute IRI. The associated absolute IRI will be - * returned. - * - * @param activeCtx the current active context. - * @param value the string to expand. - * @param relativeTo options for how to resolve relative IRIs: - * base: true to resolve against the base IRI, false not to. - * vocab: true to concatenate after @vocab, false not to. - * @param localCtx the local context being processed (only given if called - * during context processing). - * @param defined a map for tracking cycles in context definitions (only given - * if called during context processing). - * @param {Object} [options] - processing options. - * - * @return the expanded value. - */ -function _expandIri(activeCtx, value, relativeTo, localCtx, defined, options) { - // already expanded - if(value === null || !_isString(value) || api.isKeyword(value)) { - return value; - } - - // ignore non-keyword things that look like a keyword - if(value.match(KEYWORD_PATTERN)) { - return null; - } - - // define term dependency if not defined - if(localCtx && localCtx.hasOwnProperty(value) && - defined.get(value) !== true) { - api.createTermDefinition({ - activeCtx, localCtx, term: value, defined, options - }); - } - - relativeTo = relativeTo || {}; - if(relativeTo.vocab) { - const mapping = activeCtx.mappings.get(value); - - // value is explicitly ignored with a null mapping - if(mapping === null) { - return null; - } - - if(_isObject(mapping) && '@id' in mapping) { - // value is a term - return mapping['@id']; - } - } - - // split value into prefix:suffix - const colon = value.indexOf(':'); - if(colon > 0) { - const prefix = value.substr(0, colon); - const suffix = value.substr(colon + 1); - - // do not expand blank nodes (prefix of '_') or already-absolute - // IRIs (suffix of '//') - if(prefix === '_' || suffix.indexOf('//') === 0) { - return value; - } - - // prefix dependency not defined, define it - if(localCtx && localCtx.hasOwnProperty(prefix)) { - api.createTermDefinition({ - activeCtx, localCtx, term: prefix, defined, options - }); - } - - // use mapping if prefix is defined - const mapping = activeCtx.mappings.get(prefix); - if(mapping && mapping._prefix) { - return mapping['@id'] + suffix; - } - - // already absolute IRI - if(_isAbsoluteIri(value)) { - return value; - } - } - - // prepend vocab - if(relativeTo.vocab && '@vocab' in activeCtx) { - return activeCtx['@vocab'] + value; - } - - // prepend base - if(relativeTo.base && '@base' in activeCtx) { - if(activeCtx['@base']) { - // The null case preserves value as potentially relative - return prependBase(prependBase(options.base, activeCtx['@base']), value); - } - } else if(relativeTo.base) { - return prependBase(options.base, value); - } - - return value; -} - -/** - * Gets the initial context. - * - * @param options the options to use: - * [base] the document base IRI. - * - * @return the initial context. - */ -api.getInitialContext = options => { - const key = JSON.stringify({processingMode: options.processingMode}); - const cached = INITIAL_CONTEXT_CACHE.get(key); - if(cached) { - return cached; - } - - const initialContext = { - processingMode: options.processingMode, - mappings: new Map(), - inverse: null, - getInverse: _createInverseContext, - clone: _cloneActiveContext, - revertToPreviousContext: _revertToPreviousContext, - protected: {} - }; - // TODO: consider using LRU cache instead - if(INITIAL_CONTEXT_CACHE.size === INITIAL_CONTEXT_CACHE_MAX_SIZE) { - // clear whole cache -- assumes scenario where the cache fills means - // the cache isn't being used very efficiently anyway - INITIAL_CONTEXT_CACHE.clear(); - } - INITIAL_CONTEXT_CACHE.set(key, initialContext); - return initialContext; - - /** - * Generates an inverse context for use in the compaction algorithm, if - * not already generated for the given active context. - * - * @return the inverse context. - */ - function _createInverseContext() { - const activeCtx = this; - - // lazily create inverse - if(activeCtx.inverse) { - return activeCtx.inverse; - } - const inverse = activeCtx.inverse = {}; - - // variables for building fast CURIE map - const fastCurieMap = activeCtx.fastCurieMap = {}; - const irisToTerms = {}; - - // handle default language - const defaultLanguage = (activeCtx['@language'] || '@none').toLowerCase(); - - // handle default direction - const defaultDirection = activeCtx['@direction']; - - // create term selections for each mapping in the context, ordered by - // shortest and then lexicographically least - const mappings = activeCtx.mappings; - const terms = [...mappings.keys()].sort(_compareShortestLeast); - for(const term of terms) { - const mapping = mappings.get(term); - if(mapping === null) { - continue; - } - - let container = mapping['@container'] || '@none'; - container = [].concat(container).sort().join(''); - - if(mapping['@id'] === null) { - continue; - } - // iterate over every IRI in the mapping - const ids = _asArray(mapping['@id']); - for(const iri of ids) { - let entry = inverse[iri]; - const isKeyword = api.isKeyword(iri); - - if(!entry) { - // initialize entry - inverse[iri] = entry = {}; - - if(!isKeyword && !mapping._termHasColon) { - // init IRI to term map and fast CURIE prefixes - irisToTerms[iri] = [term]; - const fastCurieEntry = {iri, terms: irisToTerms[iri]}; - if(iri[0] in fastCurieMap) { - fastCurieMap[iri[0]].push(fastCurieEntry); - } else { - fastCurieMap[iri[0]] = [fastCurieEntry]; - } - } - } else if(!isKeyword && !mapping._termHasColon) { - // add IRI to term match - irisToTerms[iri].push(term); - } - - // add new entry - if(!entry[container]) { - entry[container] = { - '@language': {}, - '@type': {}, - '@any': {} - }; - } - entry = entry[container]; - _addPreferredTerm(term, entry['@any'], '@none'); - - if(mapping.reverse) { - // term is preferred for values using @reverse - _addPreferredTerm(term, entry['@type'], '@reverse'); - } else if(mapping['@type'] === '@none') { - _addPreferredTerm(term, entry['@any'], '@none'); - _addPreferredTerm(term, entry['@language'], '@none'); - _addPreferredTerm(term, entry['@type'], '@none'); - } else if('@type' in mapping) { - // term is preferred for values using specific type - _addPreferredTerm(term, entry['@type'], mapping['@type']); - } else if('@language' in mapping && '@direction' in mapping) { - // term is preferred for values using specific language and direction - const language = mapping['@language']; - const direction = mapping['@direction']; - if(language && direction) { - _addPreferredTerm(term, entry['@language'], - `${language}_${direction}`.toLowerCase()); - } else if(language) { - _addPreferredTerm(term, entry['@language'], language.toLowerCase()); - } else if(direction) { - _addPreferredTerm(term, entry['@language'], `_${direction}`); - } else { - _addPreferredTerm(term, entry['@language'], '@null'); - } - } else if('@language' in mapping) { - _addPreferredTerm(term, entry['@language'], - (mapping['@language'] || '@null').toLowerCase()); - } else if('@direction' in mapping) { - if(mapping['@direction']) { - _addPreferredTerm(term, entry['@language'], - `_${mapping['@direction']}`); - } else { - _addPreferredTerm(term, entry['@language'], '@none'); - } - } else if(defaultDirection) { - _addPreferredTerm(term, entry['@language'], `_${defaultDirection}`); - _addPreferredTerm(term, entry['@language'], '@none'); - _addPreferredTerm(term, entry['@type'], '@none'); - } else { - // add entries for no type and no language - _addPreferredTerm(term, entry['@language'], defaultLanguage); - _addPreferredTerm(term, entry['@language'], '@none'); - _addPreferredTerm(term, entry['@type'], '@none'); - } - } - } - - // build fast CURIE map - for(const key in fastCurieMap) { - _buildIriMap(fastCurieMap, key, 1); - } - - return inverse; - } - - /** - * Runs a recursive algorithm to build a lookup map for quickly finding - * potential CURIEs. - * - * @param iriMap the map to build. - * @param key the current key in the map to work on. - * @param idx the index into the IRI to compare. - */ - function _buildIriMap(iriMap, key, idx) { - const entries = iriMap[key]; - const next = iriMap[key] = {}; - - let iri; - let letter; - for(const entry of entries) { - iri = entry.iri; - if(idx >= iri.length) { - letter = ''; - } else { - letter = iri[idx]; - } - if(letter in next) { - next[letter].push(entry); - } else { - next[letter] = [entry]; - } - } - - for(const key in next) { - if(key === '') { - continue; - } - _buildIriMap(next, key, idx + 1); - } - } - - /** - * Adds the term for the given entry if not already added. - * - * @param term the term to add. - * @param entry the inverse context typeOrLanguage entry to add to. - * @param typeOrLanguageValue the key in the entry to add to. - */ - function _addPreferredTerm(term, entry, typeOrLanguageValue) { - if(!entry.hasOwnProperty(typeOrLanguageValue)) { - entry[typeOrLanguageValue] = term; - } - } - - /** - * Clones an active context, creating a child active context. - * - * @return a clone (child) of the active context. - */ - function _cloneActiveContext() { - const child = {}; - child.mappings = util.clone(this.mappings); - child.clone = this.clone; - child.inverse = null; - child.getInverse = this.getInverse; - child.protected = util.clone(this.protected); - if(this.previousContext) { - child.previousContext = this.previousContext.clone(); - } - child.revertToPreviousContext = this.revertToPreviousContext; - if('@base' in this) { - child['@base'] = this['@base']; - } - if('@language' in this) { - child['@language'] = this['@language']; - } - if('@vocab' in this) { - child['@vocab'] = this['@vocab']; - } - return child; - } - - /** - * Reverts any type-scoped context in this active context to the previous - * context. - */ - function _revertToPreviousContext() { - if(!this.previousContext) { - return this; - } - return this.previousContext.clone(); - } -}; - -/** - * Gets the value for the given active context key and type, null if none is - * set or undefined if none is set and type is '@context'. - * - * @param ctx the active context. - * @param key the context key. - * @param [type] the type of value to get (eg: '@id', '@type'), if not - * specified gets the entire entry for a key, null if not found. - * - * @return the value, null, or undefined. - */ -api.getContextValue = (ctx, key, type) => { - // invalid key - if(key === null) { - if(type === '@context') { - return undefined; - } - return null; - } - - // get specific entry information - if(ctx.mappings.has(key)) { - const entry = ctx.mappings.get(key); - - if(_isUndefined(type)) { - // return whole entry - return entry; - } - if(entry.hasOwnProperty(type)) { - // return entry value for type - return entry[type]; - } - } - - // get default language - if(type === '@language' && type in ctx) { - return ctx[type]; - } - - // get default direction - if(type === '@direction' && type in ctx) { - return ctx[type]; - } - - if(type === '@context') { - return undefined; - } - return null; -}; - -/** - * Processing Mode check. - * - * @param activeCtx the current active context. - * @param version the string or numeric version to check. - * - * @return boolean. - */ -api.processingMode = (activeCtx, version) => { - if(version.toString() >= '1.1') { - return !activeCtx.processingMode || - activeCtx.processingMode >= 'json-ld-' + version.toString(); - } else { - return activeCtx.processingMode === 'json-ld-1.0'; - } -}; - -/** - * Returns whether or not the given value is a keyword. - * - * @param v the value to check. - * - * @return true if the value is a keyword, false if not. - */ -api.isKeyword = v => { - if(!_isString(v) || v[0] !== '@') { - return false; - } - switch(v) { - case '@base': - case '@container': - case '@context': - case '@default': - case '@direction': - case '@embed': - case '@explicit': - case '@graph': - case '@id': - case '@included': - case '@index': - case '@json': - case '@language': - case '@list': - case '@nest': - case '@none': - case '@omitDefault': - case '@prefix': - case '@preserve': - case '@protected': - case '@requireAll': - case '@reverse': - case '@set': - case '@type': - case '@value': - case '@version': - case '@vocab': - return true; - } - return false; -}; - -function _deepCompare(x1, x2) { - // compare `null` or primitive types directly - if((!(x1 && typeof x1 === 'object')) || - (!(x2 && typeof x2 === 'object'))) { - return x1 === x2; - } - // x1 and x2 are objects (also potentially arrays) - const x1Array = Array.isArray(x1); - if(x1Array !== Array.isArray(x2)) { - return false; - } - if(x1Array) { - if(x1.length !== x2.length) { - return false; - } - for(let i = 0; i < x1.length; ++i) { - if(!_deepCompare(x1[i], x2[i])) { - return false; - } - } - return true; - } - // x1 and x2 are non-array objects - const k1s = Object.keys(x1); - const k2s = Object.keys(x2); - if(k1s.length !== k2s.length) { - return false; - } - for(const k1 in x1) { - let v1 = x1[k1]; - let v2 = x2[k1]; - // special case: `@container` can be in any order - if(k1 === '@container') { - if(Array.isArray(v1) && Array.isArray(v2)) { - v1 = v1.slice().sort(); - v2 = v2.slice().sort(); - } - } - if(!_deepCompare(v1, v2)) { - return false; - } - } - return true; -} - -},{"./JsonLdError":12,"./types":30,"./url":31,"./util":32}],20:[function(require,module,exports){ -/* - * Copyright (c) 2017 Digital Bazaar, Inc. All rights reserved. - */ -'use strict'; - -const {parseLinkHeader, buildHeaders} = require('../util'); -const {LINK_HEADER_CONTEXT} = require('../constants'); -const JsonLdError = require('../JsonLdError'); -const RequestQueue = require('../RequestQueue'); -const {prependBase} = require('../url'); - -const REGEX_LINK_HEADER = /(^|(\r\n))link:/i; - -/** - * Creates a built-in XMLHttpRequest document loader. - * - * @param options the options to use: - * secure: require all URLs to use HTTPS. - * headers: an object (map) of headers which will be passed as request - * headers for the requested document. Accept is not allowed. - * [xhr]: the XMLHttpRequest API to use. - * - * @return the XMLHttpRequest document loader. - */ -module.exports = ({ - secure, - headers = {}, - xhr -} = {headers: {}}) => { - headers = buildHeaders(headers); - const queue = new RequestQueue(); - return queue.wrapLoader(loader); - - async function loader(url) { - if(url.indexOf('http:') !== 0 && url.indexOf('https:') !== 0) { - throw new JsonLdError( - 'URL could not be dereferenced; only "http" and "https" URLs are ' + - 'supported.', - 'jsonld.InvalidUrl', {code: 'loading document failed', url}); - } - if(secure && url.indexOf('https') !== 0) { - throw new JsonLdError( - 'URL could not be dereferenced; secure mode is enabled and ' + - 'the URL\'s scheme is not "https".', - 'jsonld.InvalidUrl', {code: 'loading document failed', url}); - } - - let req; - try { - req = await _get(xhr, url, headers); - } catch(e) { - throw new JsonLdError( - 'URL could not be dereferenced, an error occurred.', - 'jsonld.LoadDocumentError', - {code: 'loading document failed', url, cause: e}); - } - - if(req.status >= 400) { - throw new JsonLdError( - 'URL could not be dereferenced: ' + req.statusText, - 'jsonld.LoadDocumentError', { - code: 'loading document failed', - url, - httpStatusCode: req.status - }); - } - - let doc = {contextUrl: null, documentUrl: url, document: req.response}; - let alternate = null; - - // handle Link Header (avoid unsafe header warning by existence testing) - const contentType = req.getResponseHeader('Content-Type'); - let linkHeader; - if(REGEX_LINK_HEADER.test(req.getAllResponseHeaders())) { - linkHeader = req.getResponseHeader('Link'); - } - if(linkHeader && contentType !== 'application/ld+json') { - // only 1 related link header permitted - const linkHeaders = parseLinkHeader(linkHeader); - const linkedContext = linkHeaders[LINK_HEADER_CONTEXT]; - if(Array.isArray(linkedContext)) { - throw new JsonLdError( - 'URL could not be dereferenced, it has more than one ' + - 'associated HTTP Link Header.', - 'jsonld.InvalidUrl', - {code: 'multiple context link headers', url}); - } - if(linkedContext) { - doc.contextUrl = linkedContext.target; - } - - // "alternate" link header is a redirect - alternate = linkHeaders['alternate']; - if(alternate && - alternate.type == 'application/ld+json' && - !(contentType || '').match(/^application\/(\w*\+)?json$/)) { - doc = await loader(prependBase(url, alternate.target)); - } - } - - return doc; - } -}; - -function _get(xhr, url, headers) { - xhr = xhr || XMLHttpRequest; - const req = new xhr(); - return new Promise((resolve, reject) => { - req.onload = () => resolve(req); - req.onerror = err => reject(err); - req.open('GET', url, true); - for(const k in headers) { - req.setRequestHeader(k, headers[k]); - } - req.send(); - }); -} - -},{"../JsonLdError":12,"../RequestQueue":15,"../constants":18,"../url":31,"../util":32}],21:[function(require,module,exports){ -/* - * Copyright (c) 2017 Digital Bazaar, Inc. All rights reserved. - */ -'use strict'; - -const JsonLdError = require('./JsonLdError'); - -const { - isArray: _isArray, - isObject: _isObject, - isEmptyObject: _isEmptyObject, - isString: _isString, - isUndefined: _isUndefined -} = require('./types'); - -const { - isList: _isList, - isValue: _isValue, - isGraph: _isGraph, - isSubject: _isSubject -} = require('./graphTypes'); - -const { - expandIri: _expandIri, - getContextValue: _getContextValue, - isKeyword: _isKeyword, - process: _processContext, - processingMode: _processingMode -} = require('./context'); - -const { - isAbsolute: _isAbsoluteIri -} = require('./url'); - -const { - addValue: _addValue, - asArray: _asArray, - getValues: _getValues, - validateTypeValue: _validateTypeValue -} = require('./util'); - -const api = {}; -module.exports = api; -const REGEX_BCP47 = /^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$/; - -/** - * Recursively expands an element using the given context. Any context in - * the element will be removed. All context URLs must have been retrieved - * before calling this method. - * - * @param activeCtx the context to use. - * @param activeProperty the property for the element, null for none. - * @param element the element to expand. - * @param options the expansion options. - * @param insideList true if the element is a list, false if not. - * @param insideIndex true if the element is inside an index container, - * false if not. - * @param typeScopedContext an optional type-scoped active context for - * expanding values of nodes that were expressed according to - * a type-scoped context. - * @param expansionMap(info) a function that can be used to custom map - * unmappable values (or to throw an error when they are detected); - * if this function returns `undefined` then the default behavior - * will be used. - * - * @return a Promise that resolves to the expanded value. - */ -api.expand = async ({ - activeCtx, - activeProperty = null, - element, - options = {}, - insideList = false, - insideIndex = false, - typeScopedContext = null, - expansionMap = () => undefined -}) => { - // nothing to expand - if(element === null || element === undefined) { - return null; - } - - // disable framing if activeProperty is @default - if(activeProperty === '@default') { - options = Object.assign({}, options, {isFrame: false}); - } - - if(!_isArray(element) && !_isObject(element)) { - // drop free-floating scalars that are not in lists unless custom mapped - if(!insideList && (activeProperty === null || - _expandIri(activeCtx, activeProperty, {vocab: true}, - options) === '@graph')) { - const mapped = await expansionMap({ - unmappedValue: element, - activeCtx, - activeProperty, - options, - insideList - }); - if(mapped === undefined) { - return null; - } - return mapped; - } - - // expand element according to value expansion rules - return _expandValue({activeCtx, activeProperty, value: element, options}); - } - - // recursively expand array - if(_isArray(element)) { - let rval = []; - const container = _getContextValue( - activeCtx, activeProperty, '@container') || []; - insideList = insideList || container.includes('@list'); - for(let i = 0; i < element.length; ++i) { - // expand element - let e = await api.expand({ - activeCtx, - activeProperty, - element: element[i], - options, - expansionMap, - insideIndex, - typeScopedContext - }); - if(insideList && _isArray(e)) { - e = {'@list': e}; - } - - if(e === null) { - e = await expansionMap({ - unmappedValue: element[i], - activeCtx, - activeProperty, - parent: element, - index: i, - options, - expandedParent: rval, - insideList - }); - if(e === undefined) { - continue; - } - } - - if(_isArray(e)) { - rval = rval.concat(e); - } else { - rval.push(e); - } - } - return rval; - } - - // recursively expand object: - - // first, expand the active property - const expandedActiveProperty = _expandIri( - activeCtx, activeProperty, {vocab: true}, options); - - // Get any property-scoped context for activeProperty - const propertyScopedCtx = - _getContextValue(activeCtx, activeProperty, '@context'); - - // second, determine if any type-scoped context should be reverted; it - // should only be reverted when the following are all true: - // 1. `element` is not a value or subject reference - // 2. `insideIndex` is false - typeScopedContext = typeScopedContext || - (activeCtx.previousContext ? activeCtx : null); - let keys = Object.keys(element).sort(); - let mustRevert = !insideIndex; - if(mustRevert && typeScopedContext && keys.length <= 2 && - !keys.includes('@context')) { - for(const key of keys) { - const expandedProperty = _expandIri( - typeScopedContext, key, {vocab: true}, options); - if(expandedProperty === '@value') { - // value found, ensure type-scoped context is used to expand it - mustRevert = false; - activeCtx = typeScopedContext; - break; - } - if(expandedProperty === '@id' && keys.length === 1) { - // subject reference found, do not revert - mustRevert = false; - break; - } - } - } - - if(mustRevert) { - // revert type scoped context - activeCtx = activeCtx.revertToPreviousContext(); - } - - // apply property-scoped context after reverting term-scoped context - if(!_isUndefined(propertyScopedCtx)) { - activeCtx = await _processContext({ - activeCtx, - localCtx: propertyScopedCtx, - propagate: true, - overrideProtected: true, - options - }); - } - - // if element has a context, process it - if('@context' in element) { - activeCtx = await _processContext( - {activeCtx, localCtx: element['@context'], options}); - } - - // set the type-scoped context to the context on input, for use later - typeScopedContext = activeCtx; - - // Remember the first key found expanding to @type - let typeKey = null; - - // look for scoped contexts on `@type` - for(const key of keys) { - const expandedProperty = _expandIri(activeCtx, key, {vocab: true}, options); - if(expandedProperty === '@type') { - // set scoped contexts from @type - // avoid sorting if possible - typeKey = typeKey || key; - const value = element[key]; - const types = - Array.isArray(value) ? - (value.length > 1 ? value.slice().sort() : value) : [value]; - for(const type of types) { - const ctx = _getContextValue(typeScopedContext, type, '@context'); - if(!_isUndefined(ctx)) { - activeCtx = await _processContext({ - activeCtx, - localCtx: ctx, - options, - propagate: false - }); - } - } - } - } - - // process each key and value in element, ignoring @nest content - let rval = {}; - await _expandObject({ - activeCtx, - activeProperty, - expandedActiveProperty, - element, - expandedParent: rval, - options, - insideList, - typeKey, - typeScopedContext, - expansionMap}); - - // get property count on expanded output - keys = Object.keys(rval); - let count = keys.length; - - if('@value' in rval) { - // @value must only have @language or @type - if('@type' in rval && ('@language' in rval || '@direction' in rval)) { - throw new JsonLdError( - '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: rval}); - } - let validCount = count - 1; - if('@type' in rval) { - validCount -= 1; - } - if('@index' in rval) { - validCount -= 1; - } - if('@language' in rval) { - validCount -= 1; - } - if('@direction' in rval) { - validCount -= 1; - } - if(validCount !== 0) { - throw new JsonLdError( - '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: rval}); - } - const values = rval['@value'] === null ? [] : _asArray(rval['@value']); - const types = _getValues(rval, '@type'); - - // drop null @values unless custom mapped - if(_processingMode(activeCtx, 1.1) && types.includes('@json') && - types.length === 1) { - // Any value of @value is okay if @type: @json - } else if(values.length === 0) { - const mapped = await expansionMap({ - unmappedValue: rval, - activeCtx, - activeProperty, - element, - options, - insideList - }); - if(mapped !== undefined) { - rval = mapped; - } else { - rval = null; - } - } else if(!values.every(v => (_isString(v) || _isEmptyObject(v))) && - '@language' in rval) { - // if @language is present, @value must be a string - throw new JsonLdError( - 'Invalid JSON-LD syntax; only strings may be language-tagged.', - 'jsonld.SyntaxError', - {code: 'invalid language-tagged value', element: rval}); - } else if(!types.every(t => - (_isAbsoluteIri(t) && !(_isString(t) && t.indexOf('_:') === 0) || - _isEmptyObject(t)))) { - throw new JsonLdError( - '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: rval}); - } - } else if('@type' in rval && !_isArray(rval['@type'])) { - // convert @type to an array - rval['@type'] = [rval['@type']]; - } else if('@set' in rval || '@list' in rval) { - // handle @set and @list - if(count > 1 && !(count === 2 && '@index' in rval)) { - throw new JsonLdError( - '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: rval}); - } - // optimize away @set - if('@set' in rval) { - rval = rval['@set']; - keys = Object.keys(rval); - count = keys.length; - } - } else if(count === 1 && '@language' in rval) { - // drop objects with only @language unless custom mapped - const mapped = await expansionMap(rval, { - unmappedValue: rval, - activeCtx, - activeProperty, - element, - options, - insideList - }); - if(mapped !== undefined) { - rval = mapped; - } else { - rval = null; - } - } - - // drop certain top-level objects that do not occur in lists, unless custom - // mapped - if(_isObject(rval) && - !options.keepFreeFloatingNodes && !insideList && - (activeProperty === null || expandedActiveProperty === '@graph')) { - // drop empty object, top-level @value/@list, or object with only @id - if(count === 0 || '@value' in rval || '@list' in rval || - (count === 1 && '@id' in rval)) { - const mapped = await expansionMap({ - unmappedValue: rval, - activeCtx, - activeProperty, - element, - options, - insideList - }); - if(mapped !== undefined) { - rval = mapped; - } else { - rval = null; - } - } - } - - return rval; -}; - -/** - * Expand each key and value of element adding to result - * - * @param activeCtx the context to use. - * @param activeProperty the property for the element. - * @param expandedActiveProperty the expansion of activeProperty - * @param element the element to expand. - * @param expandedParent the expanded result into which to add values. - * @param options the expansion options. - * @param insideList true if the element is a list, false if not. - * @param typeKey first key found expanding to @type. - * @param typeScopedContext the context before reverting. - * @param expansionMap(info) a function that can be used to custom map - * unmappable values (or to throw an error when they are detected); - * if this function returns `undefined` then the default behavior - * will be used. - */ -async function _expandObject({ - activeCtx, - activeProperty, - expandedActiveProperty, - element, - expandedParent, - options = {}, - insideList, - typeKey, - typeScopedContext, - expansionMap -}) { - const keys = Object.keys(element).sort(); - const nests = []; - let unexpandedValue; - - // Figure out if this is the type for a JSON literal - const isJsonType = element[typeKey] && - _expandIri(activeCtx, - (_isArray(element[typeKey]) ? element[typeKey][0] : element[typeKey]), - {vocab: true}, options) === '@json'; - - for(const key of keys) { - let value = element[key]; - let expandedValue; - - // skip @context - if(key === '@context') { - continue; - } - - // expand property - let expandedProperty = _expandIri(activeCtx, key, {vocab: true}, options); - - // drop non-absolute IRI keys that aren't keywords unless custom mapped - if(expandedProperty === null || - !(_isAbsoluteIri(expandedProperty) || _isKeyword(expandedProperty))) { - // TODO: use `await` to support async - expandedProperty = expansionMap({ - unmappedProperty: key, - activeCtx, - activeProperty, - parent: element, - options, - insideList, - value, - expandedParent - }); - if(expandedProperty === undefined) { - continue; - } - } - - if(_isKeyword(expandedProperty)) { - if(expandedActiveProperty === '@reverse') { - throw new JsonLdError( - 'Invalid JSON-LD syntax; a keyword cannot be used as a @reverse ' + - 'property.', 'jsonld.SyntaxError', - {code: 'invalid reverse property map', value}); - } - if(expandedProperty in expandedParent && - expandedProperty !== '@included' && - expandedProperty !== '@type') { - throw new JsonLdError( - 'Invalid JSON-LD syntax; colliding keywords detected.', - 'jsonld.SyntaxError', - {code: 'colliding keywords', keyword: expandedProperty}); - } - } - - // syntax error if @id is not a string - if(expandedProperty === '@id') { - if(!_isString(value)) { - if(!options.isFrame) { - throw new JsonLdError( - 'Invalid JSON-LD syntax; "@id" value must a string.', - 'jsonld.SyntaxError', {code: 'invalid @id value', value}); - } - if(_isObject(value)) { - // empty object is a wildcard - if(!_isEmptyObject(value)) { - throw new JsonLdError( - 'Invalid JSON-LD syntax; "@id" value an empty object or array ' + - 'of strings, if framing', - 'jsonld.SyntaxError', {code: 'invalid @id value', value}); - } - } else if(_isArray(value)) { - if(!value.every(v => _isString(v))) { - throw new JsonLdError( - 'Invalid JSON-LD syntax; "@id" value an empty object or array ' + - 'of strings, if framing', - 'jsonld.SyntaxError', {code: 'invalid @id value', value}); - } - } else { - throw new JsonLdError( - 'Invalid JSON-LD syntax; "@id" value an empty object or array ' + - 'of strings, if framing', - 'jsonld.SyntaxError', {code: 'invalid @id value', value}); - } - } - - _addValue( - expandedParent, '@id', - _asArray(value).map(v => - _isString(v) ? _expandIri(activeCtx, v, {base: true}, options) : v), - {propertyIsArray: options.isFrame}); - continue; - } - - if(expandedProperty === '@type') { - // if framing, can be a default object, but need to expand - // key to determine that - if(_isObject(value)) { - value = Object.fromEntries(Object.entries(value).map(([k, v]) => [ - _expandIri(typeScopedContext, k, {vocab: true}), - _asArray(v).map(vv => - _expandIri(typeScopedContext, vv, {base: true, vocab: true}) - ) - ])); - } - _validateTypeValue(value, options.isFrame); - _addValue( - expandedParent, '@type', - _asArray(value).map(v => - _isString(v) ? - _expandIri(typeScopedContext, v, - {base: true, vocab: true}, options) : v), - {propertyIsArray: options.isFrame}); - continue; - } - - // Included blocks are treated as an array of separate object nodes sharing - // the same referencing active_property. - // For 1.0, it is skipped as are other unknown keywords - if(expandedProperty === '@included' && _processingMode(activeCtx, 1.1)) { - const includedResult = _asArray(await api.expand({ - activeCtx, - activeProperty, - element: value, - options, - expansionMap - })); - - // Expanded values must be node objects - if(!includedResult.every(v => _isSubject(v))) { - throw new JsonLdError( - 'Invalid JSON-LD syntax; ' + - 'values of @included must expand to node objects.', - 'jsonld.SyntaxError', {code: 'invalid @included value', value}); - } - - _addValue( - expandedParent, '@included', includedResult, {propertyIsArray: true}); - continue; - } - - // @graph must be an array or an object - if(expandedProperty === '@graph' && - !(_isObject(value) || _isArray(value))) { - throw new JsonLdError( - 'Invalid JSON-LD syntax; "@graph" value must not be an ' + - 'object or an array.', - 'jsonld.SyntaxError', {code: 'invalid @graph value', value}); - } - - if(expandedProperty === '@value') { - // capture value for later - // "colliding keywords" check prevents this from being set twice - unexpandedValue = value; - if(isJsonType && _processingMode(activeCtx, 1.1)) { - // no coercion to array, and retain all values - expandedParent['@value'] = value; - } else { - _addValue( - expandedParent, '@value', value, {propertyIsArray: options.isFrame}); - } - continue; - } - - // @language must be a string - // it should match BCP47 - if(expandedProperty === '@language') { - if(value === null) { - // drop null @language values, they expand as if they didn't exist - continue; - } - if(!_isString(value) && !options.isFrame) { - throw new JsonLdError( - 'Invalid JSON-LD syntax; "@language" value must be a string.', - 'jsonld.SyntaxError', - {code: 'invalid language-tagged string', value}); - } - // ensure language value is lowercase - value = _asArray(value).map(v => _isString(v) ? v.toLowerCase() : v); - - // ensure language tag matches BCP47 - for(const lang of value) { - if(_isString(lang) && !lang.match(REGEX_BCP47)) { - console.warn(`@language must be valid BCP47: ${lang}`); - } - } - - _addValue( - expandedParent, '@language', value, {propertyIsArray: options.isFrame}); - continue; - } - - // @direction must be "ltr" or "rtl" - if(expandedProperty === '@direction') { - if(!_isString(value) && !options.isFrame) { - throw new JsonLdError( - 'Invalid JSON-LD syntax; "@direction" value must be a string.', - 'jsonld.SyntaxError', - {code: 'invalid base direction', value}); - } - - value = _asArray(value); - - // ensure direction is "ltr" or "rtl" - for(const dir of value) { - if(_isString(dir) && dir !== 'ltr' && dir !== 'rtl') { - throw new JsonLdError( - 'Invalid JSON-LD syntax; "@direction" must be "ltr" or "rtl".', - 'jsonld.SyntaxError', - {code: 'invalid base direction', value}); - } - } - - _addValue( - expandedParent, '@direction', value, - {propertyIsArray: options.isFrame}); - continue; - } - - // @index must be a string - if(expandedProperty === '@index') { - if(!_isString(value)) { - throw new JsonLdError( - 'Invalid JSON-LD syntax; "@index" value must be a string.', - 'jsonld.SyntaxError', - {code: 'invalid @index value', value}); - } - _addValue(expandedParent, '@index', value); - continue; - } - - // @reverse must be an object - if(expandedProperty === '@reverse') { - if(!_isObject(value)) { - throw new JsonLdError( - 'Invalid JSON-LD syntax; "@reverse" value must be an object.', - 'jsonld.SyntaxError', {code: 'invalid @reverse value', value}); - } - - expandedValue = await api.expand({ - activeCtx, - activeProperty: - '@reverse', - element: value, - options, - expansionMap - }); - // properties double-reversed - if('@reverse' in expandedValue) { - for(const property in expandedValue['@reverse']) { - _addValue( - expandedParent, property, expandedValue['@reverse'][property], - {propertyIsArray: true}); - } - } - - // FIXME: can this be merged with code below to simplify? - // merge in all reversed properties - let reverseMap = expandedParent['@reverse'] || null; - for(const property in expandedValue) { - if(property === '@reverse') { - continue; - } - if(reverseMap === null) { - reverseMap = expandedParent['@reverse'] = {}; - } - _addValue(reverseMap, property, [], {propertyIsArray: true}); - const items = expandedValue[property]; - for(let ii = 0; ii < items.length; ++ii) { - const item = items[ii]; - if(_isValue(item) || _isList(item)) { - throw new JsonLdError( - 'Invalid JSON-LD syntax; "@reverse" value must not be a ' + - '@value or an @list.', 'jsonld.SyntaxError', - {code: 'invalid reverse property value', value: expandedValue}); - } - _addValue(reverseMap, property, item, {propertyIsArray: true}); - } - } - - continue; - } - - // nested keys - if(expandedProperty === '@nest') { - nests.push(key); - continue; - } - - // use potential scoped context for key - let termCtx = activeCtx; - const ctx = _getContextValue(activeCtx, key, '@context'); - if(!_isUndefined(ctx)) { - termCtx = await _processContext({ - activeCtx, - localCtx: ctx, - propagate: true, - overrideProtected: true, - options - }); - } - - const container = _getContextValue(termCtx, key, '@container') || []; - - if(container.includes('@language') && _isObject(value)) { - const direction = _getContextValue(termCtx, key, '@direction'); - // handle language map container (skip if value is not an object) - expandedValue = _expandLanguageMap(termCtx, value, direction, options); - } else if(container.includes('@index') && _isObject(value)) { - // handle index container (skip if value is not an object) - const asGraph = container.includes('@graph'); - const indexKey = _getContextValue(termCtx, key, '@index') || '@index'; - const propertyIndex = indexKey !== '@index' && - _expandIri(activeCtx, indexKey, {vocab: true}, options); - - expandedValue = await _expandIndexMap({ - activeCtx: termCtx, - options, - activeProperty: key, - value, - expansionMap, - asGraph, - indexKey, - propertyIndex - }); - } else if(container.includes('@id') && _isObject(value)) { - // handle id container (skip if value is not an object) - const asGraph = container.includes('@graph'); - expandedValue = await _expandIndexMap({ - activeCtx: termCtx, - options, - activeProperty: key, - value, - expansionMap, - asGraph, - indexKey: '@id' - }); - } else if(container.includes('@type') && _isObject(value)) { - // handle type container (skip if value is not an object) - expandedValue = await _expandIndexMap({ - // since container is `@type`, revert type scoped context when expanding - activeCtx: termCtx.revertToPreviousContext(), - options, - activeProperty: key, - value, - expansionMap, - asGraph: false, - indexKey: '@type' - }); - } else { - // recurse into @list or @set - const isList = (expandedProperty === '@list'); - if(isList || expandedProperty === '@set') { - let nextActiveProperty = activeProperty; - if(isList && expandedActiveProperty === '@graph') { - nextActiveProperty = null; - } - expandedValue = await api.expand({ - activeCtx: termCtx, - activeProperty: nextActiveProperty, - element: value, - options, - insideList: isList, - expansionMap - }); - } else if( - _getContextValue(activeCtx, key, '@type') === '@json') { - expandedValue = { - '@type': '@json', - '@value': value - }; - } else { - // recursively expand value with key as new active property - expandedValue = await api.expand({ - activeCtx: termCtx, - activeProperty: key, - element: value, - options, - insideList: false, - expansionMap - }); - } - } - - // drop null values if property is not @value - if(expandedValue === null && expandedProperty !== '@value') { - // TODO: use `await` to support async - expandedValue = expansionMap({ - unmappedValue: value, - expandedProperty, - activeCtx: termCtx, - activeProperty, - parent: element, - options, - insideList, - key, - expandedParent - }); - if(expandedValue === undefined) { - continue; - } - } - - // convert expanded value to @list if container specifies it - if(expandedProperty !== '@list' && !_isList(expandedValue) && - container.includes('@list')) { - // ensure expanded value in @list is an array - expandedValue = {'@list': _asArray(expandedValue)}; - } - - // convert expanded value to @graph if container specifies it - // and value is not, itself, a graph - // index cases handled above - if(container.includes('@graph') && - !container.some(key => key === '@id' || key === '@index')) { - // ensure expanded values are arrays - expandedValue = _asArray(expandedValue) - .map(v => ({'@graph': _asArray(v)})); - } - - // FIXME: can this be merged with code above to simplify? - // merge in reverse properties - if(termCtx.mappings.has(key) && termCtx.mappings.get(key).reverse) { - const reverseMap = - expandedParent['@reverse'] = expandedParent['@reverse'] || {}; - expandedValue = _asArray(expandedValue); - for(let ii = 0; ii < expandedValue.length; ++ii) { - const item = expandedValue[ii]; - if(_isValue(item) || _isList(item)) { - throw new JsonLdError( - 'Invalid JSON-LD syntax; "@reverse" value must not be a ' + - '@value or an @list.', 'jsonld.SyntaxError', - {code: 'invalid reverse property value', value: expandedValue}); - } - _addValue(reverseMap, expandedProperty, item, {propertyIsArray: true}); - } - continue; - } - - // add value for property - // special keywords handled above - _addValue(expandedParent, expandedProperty, expandedValue, { - propertyIsArray: true - }); - } - - // @value must not be an object or an array (unless framing) or if @type is - // @json - if('@value' in expandedParent) { - if(expandedParent['@type'] === '@json' && _processingMode(activeCtx, 1.1)) { - // allow any value, to be verified when the object is fully expanded and - // the @type is @json. - } else if((_isObject(unexpandedValue) || _isArray(unexpandedValue)) && - !options.isFrame) { - throw new JsonLdError( - 'Invalid JSON-LD syntax; "@value" value must not be an ' + - 'object or an array.', - 'jsonld.SyntaxError', - {code: 'invalid value object value', value: unexpandedValue}); - } - } - - // expand each nested key - for(const key of nests) { - const nestedValues = _isArray(element[key]) ? element[key] : [element[key]]; - for(const nv of nestedValues) { - if(!_isObject(nv) || Object.keys(nv).some(k => - _expandIri(activeCtx, k, {vocab: true}, options) === '@value')) { - throw new JsonLdError( - 'Invalid JSON-LD syntax; nested value must be a node object.', - 'jsonld.SyntaxError', - {code: 'invalid @nest value', value: nv}); - } - await _expandObject({ - activeCtx, - activeProperty, - expandedActiveProperty, - element: nv, - expandedParent, - options, - insideList, - typeScopedContext, - typeKey, - expansionMap}); - } - } -} - -/** - * Expands the given value by using the coercion and keyword rules in the - * given context. - * - * @param activeCtx the active context to use. - * @param activeProperty the active property the value is associated with. - * @param value the value to expand. - * @param {Object} [options] - processing options. - * - * @return the expanded value. - */ -function _expandValue({activeCtx, activeProperty, value, options}) { - // nothing to expand - if(value === null || value === undefined) { - return null; - } - - // special-case expand @id and @type (skips '@id' expansion) - const expandedProperty = _expandIri( - activeCtx, activeProperty, {vocab: true}, options); - if(expandedProperty === '@id') { - return _expandIri(activeCtx, value, {base: true}, options); - } else if(expandedProperty === '@type') { - return _expandIri(activeCtx, value, {vocab: true, base: true}, options); - } - - // get type definition from context - const type = _getContextValue(activeCtx, activeProperty, '@type'); - - // do @id expansion (automatic for @graph) - if((type === '@id' || expandedProperty === '@graph') && _isString(value)) { - return {'@id': _expandIri(activeCtx, value, {base: true}, options)}; - } - // do @id expansion w/vocab - if(type === '@vocab' && _isString(value)) { - return { - '@id': _expandIri(activeCtx, value, {vocab: true, base: true}, options) - }; - } - - // do not expand keyword values - if(_isKeyword(expandedProperty)) { - return value; - } - - const rval = {}; - - if(type && !['@id', '@vocab', '@none'].includes(type)) { - // other type - rval['@type'] = type; - } else if(_isString(value)) { - // check for language tagging for strings - const language = _getContextValue(activeCtx, activeProperty, '@language'); - if(language !== null) { - rval['@language'] = language; - } - const direction = _getContextValue(activeCtx, activeProperty, '@direction'); - if(direction !== null) { - rval['@direction'] = direction; - } - } - // do conversion of values that aren't basic JSON types to strings - if(!['boolean', 'number', 'string'].includes(typeof value)) { - value = value.toString(); - } - rval['@value'] = value; - - return rval; -} - -/** - * Expands a language map. - * - * @param activeCtx the active context to use. - * @param languageMap the language map to expand. - * @param direction the direction to apply to values. - * @param {Object} [options] - processing options. - * - * @return the expanded language map. - */ -function _expandLanguageMap(activeCtx, languageMap, direction, options) { - const rval = []; - const keys = Object.keys(languageMap).sort(); - for(const key of keys) { - const expandedKey = _expandIri(activeCtx, key, {vocab: true}, options); - let val = languageMap[key]; - if(!_isArray(val)) { - val = [val]; - } - for(const item of val) { - if(item === null) { - // null values are allowed (8.5) but ignored (3.1) - continue; - } - if(!_isString(item)) { - throw new JsonLdError( - 'Invalid JSON-LD syntax; language map values must be strings.', - 'jsonld.SyntaxError', - {code: 'invalid language map value', languageMap}); - } - const val = {'@value': item}; - if(expandedKey !== '@none') { - val['@language'] = key.toLowerCase(); - } - if(direction) { - val['@direction'] = direction; - } - rval.push(val); - } - } - return rval; -} - -async function _expandIndexMap( - {activeCtx, options, activeProperty, value, expansionMap, asGraph, - indexKey, propertyIndex}) { - const rval = []; - const keys = Object.keys(value).sort(); - const isTypeIndex = indexKey === '@type'; - for(let key of keys) { - // if indexKey is @type, there may be a context defined for it - if(isTypeIndex) { - const ctx = _getContextValue(activeCtx, key, '@context'); - if(!_isUndefined(ctx)) { - activeCtx = await _processContext({ - activeCtx, - localCtx: ctx, - propagate: false, - options - }); - } - } - - let val = value[key]; - if(!_isArray(val)) { - val = [val]; - } - - val = await api.expand({ - activeCtx, - activeProperty, - element: val, - options, - insideList: false, - insideIndex: true, - expansionMap - }); - - // expand for @type, but also for @none - let expandedKey; - if(propertyIndex) { - if(key === '@none') { - expandedKey = '@none'; - } else { - expandedKey = _expandValue( - {activeCtx, activeProperty: indexKey, value: key, options}); - } - } else { - expandedKey = _expandIri(activeCtx, key, {vocab: true}, options); - } - - if(indexKey === '@id') { - // expand document relative - key = _expandIri(activeCtx, key, {base: true}, options); - } else if(isTypeIndex) { - key = expandedKey; - } - - for(let item of val) { - // If this is also a @graph container, turn items into graphs - if(asGraph && !_isGraph(item)) { - item = {'@graph': [item]}; - } - if(indexKey === '@type') { - if(expandedKey === '@none') { - // ignore @none - } else if(item['@type']) { - item['@type'] = [key].concat(item['@type']); - } else { - item['@type'] = [key]; - } - } else if(_isValue(item) && - !['@language', '@type', '@index'].includes(indexKey)) { - throw new JsonLdError( - 'Invalid JSON-LD syntax; Attempt to add illegal key to value ' + - `object: "${indexKey}".`, - 'jsonld.SyntaxError', - {code: 'invalid value object', value: item}); - } else if(propertyIndex) { - // index is a property to be expanded, and values interpreted for that - // property - if(expandedKey !== '@none') { - // expand key as a value - _addValue(item, propertyIndex, expandedKey, { - propertyIsArray: true, - prependValue: true - }); - } - } else if(expandedKey !== '@none' && !(indexKey in item)) { - item[indexKey] = key; - } - rval.push(item); - } - } - return rval; -} - -},{"./JsonLdError":12,"./context":19,"./graphTypes":25,"./types":30,"./url":31,"./util":32}],22:[function(require,module,exports){ -/* - * Copyright (c) 2017 Digital Bazaar, Inc. All rights reserved. - */ -'use strict'; - -const { - isSubjectReference: _isSubjectReference -} = require('./graphTypes'); - -const { - createMergedNodeMap: _createMergedNodeMap -} = require('./nodeMap'); - -const api = {}; -module.exports = api; - -/** - * Performs JSON-LD flattening. - * - * @param input the expanded JSON-LD to flatten. - * - * @return the flattened output. - */ -api.flatten = input => { - const defaultGraph = _createMergedNodeMap(input); - - // produce flattened output - const flattened = []; - const keys = Object.keys(defaultGraph).sort(); - for(let ki = 0; ki < keys.length; ++ki) { - const node = defaultGraph[keys[ki]]; - // only add full subjects to top-level - if(!_isSubjectReference(node)) { - flattened.push(node); - } - } - return flattened; -}; - -},{"./graphTypes":25,"./nodeMap":27}],23:[function(require,module,exports){ -/* - * Copyright (c) 2017 Digital Bazaar, Inc. All rights reserved. - */ -'use strict'; - -const {isKeyword} = require('./context'); -const graphTypes = require('./graphTypes'); -const types = require('./types'); -const util = require('./util'); -const url = require('./url'); -const JsonLdError = require('./JsonLdError'); -const { - createNodeMap: _createNodeMap, - mergeNodeMapGraphs: _mergeNodeMapGraphs -} = require('./nodeMap'); - -const api = {}; -module.exports = api; - -/** - * Performs JSON-LD `merged` framing. - * - * @param input the expanded JSON-LD to frame. - * @param frame the expanded JSON-LD frame to use. - * @param options the framing options. - * - * @return the framed output. - */ -api.frameMergedOrDefault = (input, frame, options) => { - // create framing state - const state = { - options, - embedded: false, - graph: '@default', - graphMap: {'@default': {}}, - subjectStack: [], - link: {}, - bnodeMap: {} - }; - - // produce a map of all graphs and name each bnode - // FIXME: currently uses subjects from @merged graph only - const issuer = new util.IdentifierIssuer('_:b'); - _createNodeMap(input, state.graphMap, '@default', issuer); - if(options.merged) { - state.graphMap['@merged'] = _mergeNodeMapGraphs(state.graphMap); - state.graph = '@merged'; - } - state.subjects = state.graphMap[state.graph]; - - // frame the subjects - const framed = []; - api.frame(state, Object.keys(state.subjects).sort(), frame, framed); - - // If pruning blank nodes, find those to prune - if(options.pruneBlankNodeIdentifiers) { - // remove all blank nodes appearing only once, done in compaction - options.bnodesToClear = - Object.keys(state.bnodeMap).filter(id => state.bnodeMap[id].length === 1); - } - - // remove @preserve from results - options.link = {}; - return _cleanupPreserve(framed, options); -}; - -/** - * Frames subjects according to the given frame. - * - * @param state the current framing state. - * @param subjects the subjects to filter. - * @param frame the frame. - * @param parent the parent subject or top-level array. - * @param property the parent property, initialized to null. - */ -api.frame = (state, subjects, frame, parent, property = null) => { - // validate the frame - _validateFrame(frame); - frame = frame[0]; - - // get flags for current frame - const options = state.options; - const flags = { - embed: _getFrameFlag(frame, options, 'embed'), - explicit: _getFrameFlag(frame, options, 'explicit'), - requireAll: _getFrameFlag(frame, options, 'requireAll') - }; - - // get link for current graph - if(!state.link.hasOwnProperty(state.graph)) { - state.link[state.graph] = {}; - } - const link = state.link[state.graph]; - - // filter out subjects that match the frame - const matches = _filterSubjects(state, subjects, frame, flags); - - // add matches to output - const ids = Object.keys(matches).sort(); - for(const id of ids) { - const subject = matches[id]; - - /* Note: In order to treat each top-level match as a compartmentalized - result, clear the unique embedded subjects map when the property is null, - which only occurs at the top-level. */ - if(property === null) { - state.uniqueEmbeds = {[state.graph]: {}}; - } else { - state.uniqueEmbeds[state.graph] = state.uniqueEmbeds[state.graph] || {}; - } - - if(flags.embed === '@link' && id in link) { - // TODO: may want to also match an existing linked subject against - // the current frame ... so different frames could produce different - // subjects that are only shared in-memory when the frames are the same - - // add existing linked subject - _addFrameOutput(parent, property, link[id]); - continue; - } - - // start output for subject - const output = {'@id': id}; - if(id.indexOf('_:') === 0) { - util.addValue(state.bnodeMap, id, output, {propertyIsArray: true}); - } - link[id] = output; - - // validate @embed - if((flags.embed === '@first' || flags.embed === '@last') && state.is11) { - throw new JsonLdError( - 'Invalid JSON-LD syntax; invalid value of @embed.', - 'jsonld.SyntaxError', {code: 'invalid @embed value', frame}); - } - - if(!state.embedded && state.uniqueEmbeds[state.graph].hasOwnProperty(id)) { - // skip adding this node object to the top level, as it was - // already included in another node object - continue; - } - - // if embed is @never or if a circular reference would be created by an - // embed, the subject cannot be embedded, just add the reference; - // note that a circular reference won't occur when the embed flag is - // `@link` as the above check will short-circuit before reaching this point - if(state.embedded && - (flags.embed === '@never' || - _createsCircularReference(subject, state.graph, state.subjectStack))) { - _addFrameOutput(parent, property, output); - continue; - } - - // if only the first (or once) should be embedded - if(state.embedded && - (flags.embed == '@first' || flags.embed == '@once') && - state.uniqueEmbeds[state.graph].hasOwnProperty(id)) { - _addFrameOutput(parent, property, output); - continue; - } - - // if only the last match should be embedded - if(flags.embed === '@last') { - // remove any existing embed - if(id in state.uniqueEmbeds[state.graph]) { - _removeEmbed(state, id); - } - } - - state.uniqueEmbeds[state.graph][id] = {parent, property}; - - // push matching subject onto stack to enable circular embed checks - state.subjectStack.push({subject, graph: state.graph}); - - // subject is also the name of a graph - if(id in state.graphMap) { - let recurse = false; - let subframe = null; - if(!('@graph' in frame)) { - recurse = state.graph !== '@merged'; - subframe = {}; - } else { - subframe = frame['@graph'][0]; - recurse = !(id === '@merged' || id === '@default'); - if(!types.isObject(subframe)) { - subframe = {}; - } - } - - if(recurse) { - // recurse into graph - api.frame( - {...state, graph: id, embedded: false}, - Object.keys(state.graphMap[id]).sort(), [subframe], output, '@graph'); - } - } - - // if frame has @included, recurse over its sub-frame - if('@included' in frame) { - api.frame( - {...state, embedded: false}, - subjects, frame['@included'], output, '@included'); - } - - // iterate over subject properties - for(const prop of Object.keys(subject).sort()) { - // copy keywords to output - if(isKeyword(prop)) { - output[prop] = util.clone(subject[prop]); - - if(prop === '@type') { - // count bnode values of @type - for(const type of subject['@type']) { - if(type.indexOf('_:') === 0) { - util.addValue( - state.bnodeMap, type, output, {propertyIsArray: true}); - } - } - } - continue; - } - - // explicit is on and property isn't in the frame, skip processing - if(flags.explicit && !(prop in frame)) { - continue; - } - - // add objects - for(const o of subject[prop]) { - const subframe = (prop in frame ? - frame[prop] : _createImplicitFrame(flags)); - - // recurse into list - if(graphTypes.isList(o)) { - const subframe = - (frame[prop] && frame[prop][0] && frame[prop][0]['@list']) ? - frame[prop][0]['@list'] : - _createImplicitFrame(flags); - - // add empty list - const list = {'@list': []}; - _addFrameOutput(output, prop, list); - - // add list objects - const src = o['@list']; - for(const oo of src) { - if(graphTypes.isSubjectReference(oo)) { - // recurse into subject reference - api.frame( - {...state, embedded: true}, - [oo['@id']], subframe, list, '@list'); - } else { - // include other values automatically - _addFrameOutput(list, '@list', util.clone(oo)); - } - } - } else if(graphTypes.isSubjectReference(o)) { - // recurse into subject reference - api.frame( - {...state, embedded: true}, - [o['@id']], subframe, output, prop); - } else if(_valueMatch(subframe[0], o)) { - // include other values, if they match - _addFrameOutput(output, prop, util.clone(o)); - } - } - } - - // handle defaults - for(const prop of Object.keys(frame).sort()) { - // skip keywords - if(prop === '@type') { - if(!types.isObject(frame[prop][0]) || - !('@default' in frame[prop][0])) { - continue; - } - // allow through default types - } else if(isKeyword(prop)) { - continue; - } - - // if omit default is off, then include default values for properties - // that appear in the next frame but are not in the matching subject - const next = frame[prop][0] || {}; - const omitDefaultOn = _getFrameFlag(next, options, 'omitDefault'); - if(!omitDefaultOn && !(prop in output)) { - let preserve = '@null'; - if('@default' in next) { - preserve = util.clone(next['@default']); - } - if(!types.isArray(preserve)) { - preserve = [preserve]; - } - output[prop] = [{'@preserve': preserve}]; - } - } - - // if embed reverse values by finding nodes having this subject as a value - // of the associated property - for(const reverseProp of Object.keys(frame['@reverse'] || {}).sort()) { - const subframe = frame['@reverse'][reverseProp]; - for(const subject of Object.keys(state.subjects)) { - const nodeValues = - util.getValues(state.subjects[subject], reverseProp); - if(nodeValues.some(v => v['@id'] === id)) { - // node has property referencing this subject, recurse - output['@reverse'] = output['@reverse'] || {}; - util.addValue( - output['@reverse'], reverseProp, [], {propertyIsArray: true}); - api.frame( - {...state, embedded: true}, - [subject], subframe, output['@reverse'][reverseProp], - property); - } - } - } - - // add output to parent - _addFrameOutput(parent, property, output); - - // pop matching subject from circular ref-checking stack - state.subjectStack.pop(); - } -}; - -/** - * Replace `@null` with `null`, removing it from arrays. - * - * @param input the framed, compacted output. - * @param options the framing options used. - * - * @return the resulting output. - */ -api.cleanupNull = (input, options) => { - // recurse through arrays - if(types.isArray(input)) { - const noNulls = input.map(v => api.cleanupNull(v, options)); - return noNulls.filter(v => v); // removes nulls from array - } - - if(input === '@null') { - return null; - } - - if(types.isObject(input)) { - // handle in-memory linked nodes - if('@id' in input) { - const id = input['@id']; - if(options.link.hasOwnProperty(id)) { - const idx = options.link[id].indexOf(input); - if(idx !== -1) { - // already visited - return options.link[id][idx]; - } - // prevent circular visitation - options.link[id].push(input); - } else { - // prevent circular visitation - options.link[id] = [input]; - } - } - - for(const key in input) { - input[key] = api.cleanupNull(input[key], options); - } - } - return input; -}; - -/** - * Creates an implicit frame when recursing through subject matches. If - * a frame doesn't have an explicit frame for a particular property, then - * a wildcard child frame will be created that uses the same flags that the - * parent frame used. - * - * @param flags the current framing flags. - * - * @return the implicit frame. - */ -function _createImplicitFrame(flags) { - const frame = {}; - for(const key in flags) { - if(flags[key] !== undefined) { - frame['@' + key] = [flags[key]]; - } - } - return [frame]; -} - -/** - * Checks the current subject stack to see if embedding the given subject - * would cause a circular reference. - * - * @param subjectToEmbed the subject to embed. - * @param graph the graph the subject to embed is in. - * @param subjectStack the current stack of subjects. - * - * @return true if a circular reference would be created, false if not. - */ -function _createsCircularReference(subjectToEmbed, graph, subjectStack) { - for(let i = subjectStack.length - 1; i >= 0; --i) { - const subject = subjectStack[i]; - if(subject.graph === graph && - subject.subject['@id'] === subjectToEmbed['@id']) { - return true; - } - } - return false; -} - -/** - * Gets the frame flag value for the given flag name. - * - * @param frame the frame. - * @param options the framing options. - * @param name the flag name. - * - * @return the flag value. - */ -function _getFrameFlag(frame, options, name) { - const flag = '@' + name; - let rval = (flag in frame ? frame[flag][0] : options[name]); - if(name === 'embed') { - // default is "@last" - // backwards-compatibility support for "embed" maps: - // true => "@last" - // false => "@never" - if(rval === true) { - rval = '@once'; - } else if(rval === false) { - rval = '@never'; - } else if(rval !== '@always' && rval !== '@never' && rval !== '@link' && - rval !== '@first' && rval !== '@last' && rval !== '@once') { - throw new JsonLdError( - 'Invalid JSON-LD syntax; invalid value of @embed.', - 'jsonld.SyntaxError', {code: 'invalid @embed value', frame}); - } - } - return rval; -} - -/** - * Validates a JSON-LD frame, throwing an exception if the frame is invalid. - * - * @param frame the frame to validate. - */ -function _validateFrame(frame) { - if(!types.isArray(frame) || frame.length !== 1 || !types.isObject(frame[0])) { - throw new JsonLdError( - 'Invalid JSON-LD syntax; a JSON-LD frame must be a single object.', - 'jsonld.SyntaxError', {frame}); - } - - if('@id' in frame[0]) { - for(const id of util.asArray(frame[0]['@id'])) { - // @id must be wildcard or an IRI - if(!(types.isObject(id) || url.isAbsolute(id)) || - (types.isString(id) && id.indexOf('_:') === 0)) { - throw new JsonLdError( - 'Invalid JSON-LD syntax; invalid @id in frame.', - 'jsonld.SyntaxError', {code: 'invalid frame', frame}); - } - } - } - - if('@type' in frame[0]) { - for(const type of util.asArray(frame[0]['@type'])) { - // @id must be wildcard or an IRI - if(!(types.isObject(type) || url.isAbsolute(type)) || - (types.isString(type) && type.indexOf('_:') === 0)) { - throw new JsonLdError( - 'Invalid JSON-LD syntax; invalid @type in frame.', - 'jsonld.SyntaxError', {code: 'invalid frame', frame}); - } - } - } -} - -/** - * Returns a map of all of the subjects that match a parsed frame. - * - * @param state the current framing state. - * @param subjects the set of subjects to filter. - * @param frame the parsed frame. - * @param flags the frame flags. - * - * @return all of the matched subjects. - */ -function _filterSubjects(state, subjects, frame, flags) { - // filter subjects in @id order - const rval = {}; - for(const id of subjects) { - const subject = state.graphMap[state.graph][id]; - if(_filterSubject(state, subject, frame, flags)) { - rval[id] = subject; - } - } - return rval; -} - -/** - * Returns true if the given subject matches the given frame. - * - * Matches either based on explicit type inclusion where the node has any - * type listed in the frame. If the frame has empty types defined matches - * nodes not having a @type. If the frame has a type of {} defined matches - * nodes having any type defined. - * - * Otherwise, does duck typing, where the node must have all of the - * properties defined in the frame. - * - * @param state the current framing state. - * @param subject the subject to check. - * @param frame the frame to check. - * @param flags the frame flags. - * - * @return true if the subject matches, false if not. - */ -function _filterSubject(state, subject, frame, flags) { - // check ducktype - let wildcard = true; - let matchesSome = false; - - for(const key in frame) { - let matchThis = false; - const nodeValues = util.getValues(subject, key); - const isEmpty = util.getValues(frame, key).length === 0; - - if(key === '@id') { - // match on no @id or any matching @id, including wildcard - if(types.isEmptyObject(frame['@id'][0] || {})) { - matchThis = true; - } else if(frame['@id'].length >= 0) { - matchThis = frame['@id'].includes(nodeValues[0]); - } - if(!flags.requireAll) { - return matchThis; - } - } else if(key === '@type') { - // check @type (object value means 'any' type, - // fall through to ducktyping) - wildcard = false; - if(isEmpty) { - if(nodeValues.length > 0) { - // don't match on no @type - return false; - } - matchThis = true; - } else if(frame['@type'].length === 1 && - types.isEmptyObject(frame['@type'][0])) { - // match on wildcard @type if there is a type - matchThis = nodeValues.length > 0; - } else { - // match on a specific @type - for(const type of frame['@type']) { - if(types.isObject(type) && '@default' in type) { - // match on default object - matchThis = true; - } else { - matchThis = matchThis || nodeValues.some(tt => tt === type); - } - } - } - if(!flags.requireAll) { - return matchThis; - } - } else if(isKeyword(key)) { - continue; - } else { - // Force a copy of this frame entry so it can be manipulated - const thisFrame = util.getValues(frame, key)[0]; - let hasDefault = false; - if(thisFrame) { - _validateFrame([thisFrame]); - hasDefault = '@default' in thisFrame; - } - - // no longer a wildcard pattern if frame has any non-keyword properties - wildcard = false; - - // skip, but allow match if node has no value for property, and frame has - // a default value - if(nodeValues.length === 0 && hasDefault) { - continue; - } - - // if frame value is empty, don't match if subject has any value - if(nodeValues.length > 0 && isEmpty) { - return false; - } - - if(thisFrame === undefined) { - // node does not match if values is not empty and the value of property - // in frame is match none. - if(nodeValues.length > 0) { - return false; - } - matchThis = true; - } else { - if(graphTypes.isList(thisFrame)) { - const listValue = thisFrame['@list'][0]; - if(graphTypes.isList(nodeValues[0])) { - const nodeListValues = nodeValues[0]['@list']; - - if(graphTypes.isValue(listValue)) { - // match on any matching value - matchThis = nodeListValues.some(lv => _valueMatch(listValue, lv)); - } else if(graphTypes.isSubject(listValue) || - graphTypes.isSubjectReference(listValue)) { - matchThis = nodeListValues.some(lv => _nodeMatch( - state, listValue, lv, flags)); - } - } - } else if(graphTypes.isValue(thisFrame)) { - matchThis = nodeValues.some(nv => _valueMatch(thisFrame, nv)); - } else if(graphTypes.isSubjectReference(thisFrame)) { - matchThis = - nodeValues.some(nv => _nodeMatch(state, thisFrame, nv, flags)); - } else if(types.isObject(thisFrame)) { - matchThis = nodeValues.length > 0; - } else { - matchThis = false; - } - } - } - - // all non-defaulted values must match if requireAll is set - if(!matchThis && flags.requireAll) { - return false; - } - - matchesSome = matchesSome || matchThis; - } - - // return true if wildcard or subject matches some properties - return wildcard || matchesSome; -} - -/** - * Removes an existing embed. - * - * @param state the current framing state. - * @param id the @id of the embed to remove. - */ -function _removeEmbed(state, id) { - // get existing embed - const embeds = state.uniqueEmbeds[state.graph]; - const embed = embeds[id]; - const parent = embed.parent; - const property = embed.property; - - // create reference to replace embed - const subject = {'@id': id}; - - // remove existing embed - if(types.isArray(parent)) { - // replace subject with reference - for(let i = 0; i < parent.length; ++i) { - if(util.compareValues(parent[i], subject)) { - parent[i] = subject; - break; - } - } - } else { - // replace subject with reference - const useArray = types.isArray(parent[property]); - util.removeValue(parent, property, subject, {propertyIsArray: useArray}); - util.addValue(parent, property, subject, {propertyIsArray: useArray}); - } - - // recursively remove dependent dangling embeds - const removeDependents = id => { - // get embed keys as a separate array to enable deleting keys in map - const ids = Object.keys(embeds); - for(const next of ids) { - if(next in embeds && types.isObject(embeds[next].parent) && - embeds[next].parent['@id'] === id) { - delete embeds[next]; - removeDependents(next); - } - } - }; - removeDependents(id); -} - -/** - * Removes the @preserve keywords from expanded result of framing. - * - * @param input the framed, framed output. - * @param options the framing options used. - * - * @return the resulting output. - */ -function _cleanupPreserve(input, options) { - // recurse through arrays - if(types.isArray(input)) { - return input.map(value => _cleanupPreserve(value, options)); - } - - if(types.isObject(input)) { - // remove @preserve - if('@preserve' in input) { - return input['@preserve'][0]; - } - - // skip @values - if(graphTypes.isValue(input)) { - return input; - } - - // recurse through @lists - if(graphTypes.isList(input)) { - input['@list'] = _cleanupPreserve(input['@list'], options); - return input; - } - - // handle in-memory linked nodes - if('@id' in input) { - const id = input['@id']; - if(options.link.hasOwnProperty(id)) { - const idx = options.link[id].indexOf(input); - if(idx !== -1) { - // already visited - return options.link[id][idx]; - } - // prevent circular visitation - options.link[id].push(input); - } else { - // prevent circular visitation - options.link[id] = [input]; - } - } - - // recurse through properties - for(const prop in input) { - // potentially remove the id, if it is an unreference bnode - if(prop === '@id' && options.bnodesToClear.includes(input[prop])) { - delete input['@id']; - continue; - } - - input[prop] = _cleanupPreserve(input[prop], options); - } - } - return input; -} - -/** - * Adds framing output to the given parent. - * - * @param parent the parent to add to. - * @param property the parent property. - * @param output the output to add. - */ -function _addFrameOutput(parent, property, output) { - if(types.isObject(parent)) { - util.addValue(parent, property, output, {propertyIsArray: true}); - } else { - parent.push(output); - } -} - -/** - * Node matches if it is a node, and matches the pattern as a frame. - * - * @param state the current framing state. - * @param pattern used to match value - * @param value to check - * @param flags the frame flags. - */ -function _nodeMatch(state, pattern, value, flags) { - if(!('@id' in value)) { - return false; - } - const nodeObject = state.subjects[value['@id']]; - return nodeObject && _filterSubject(state, nodeObject, pattern, flags); -} - -/** - * Value matches if it is a value and matches the value pattern - * - * * `pattern` is empty - * * @values are the same, or `pattern[@value]` is a wildcard, and - * * @types are the same or `value[@type]` is not null - * and `pattern[@type]` is `{}`, or `value[@type]` is null - * and `pattern[@type]` is null or `[]`, and - * * @languages are the same or `value[@language]` is not null - * and `pattern[@language]` is `{}`, or `value[@language]` is null - * and `pattern[@language]` is null or `[]`. - * - * @param pattern used to match value - * @param value to check - */ -function _valueMatch(pattern, value) { - const v1 = value['@value']; - const t1 = value['@type']; - const l1 = value['@language']; - const v2 = pattern['@value'] ? - (types.isArray(pattern['@value']) ? - pattern['@value'] : [pattern['@value']]) : - []; - const t2 = pattern['@type'] ? - (types.isArray(pattern['@type']) ? - pattern['@type'] : [pattern['@type']]) : - []; - const l2 = pattern['@language'] ? - (types.isArray(pattern['@language']) ? - pattern['@language'] : [pattern['@language']]) : - []; - - if(v2.length === 0 && t2.length === 0 && l2.length === 0) { - return true; - } - if(!(v2.includes(v1) || types.isEmptyObject(v2[0]))) { - return false; - } - if(!(!t1 && t2.length === 0 || t2.includes(t1) || t1 && - types.isEmptyObject(t2[0]))) { - return false; - } - if(!(!l1 && l2.length === 0 || l2.includes(l1) || l1 && - types.isEmptyObject(l2[0]))) { - return false; - } - return true; -} - -},{"./JsonLdError":12,"./context":19,"./graphTypes":25,"./nodeMap":27,"./types":30,"./url":31,"./util":32}],24:[function(require,module,exports){ -/* - * Copyright (c) 2017 Digital Bazaar, Inc. All rights reserved. - */ -'use strict'; - -const JsonLdError = require('./JsonLdError'); -const graphTypes = require('./graphTypes'); -const types = require('./types'); -const util = require('./util'); - -// constants -const { - // RDF, - RDF_LIST, - RDF_FIRST, - RDF_REST, - RDF_NIL, - RDF_TYPE, - // RDF_PLAIN_LITERAL, - // RDF_XML_LITERAL, - RDF_JSON_LITERAL, - // RDF_OBJECT, - // RDF_LANGSTRING, - - // XSD, - XSD_BOOLEAN, - XSD_DOUBLE, - XSD_INTEGER, - XSD_STRING, -} = require('./constants'); - -const REGEX_BCP47 = /^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$/; - -const api = {}; -module.exports = api; - -/** - * Converts an RDF dataset to JSON-LD. - * - * @param dataset the RDF dataset. - * @param options the RDF serialization options. - * - * @return a Promise that resolves to the JSON-LD output. - */ -api.fromRDF = async ( - dataset, - { - useRdfType = false, - useNativeTypes = false, - rdfDirection = null - } -) => { - const defaultGraph = {}; - const graphMap = {'@default': defaultGraph}; - const referencedOnce = {}; - - for(const quad of dataset) { - // TODO: change 'name' to 'graph' - const name = (quad.graph.termType === 'DefaultGraph') ? - '@default' : quad.graph.value; - if(!(name in graphMap)) { - graphMap[name] = {}; - } - if(name !== '@default' && !(name in defaultGraph)) { - defaultGraph[name] = {'@id': name}; - } - - const nodeMap = graphMap[name]; - - // get subject, predicate, object - const s = quad.subject.value; - const p = quad.predicate.value; - const o = quad.object; - - if(!(s in nodeMap)) { - nodeMap[s] = {'@id': s}; - } - const node = nodeMap[s]; - - const objectIsNode = o.termType.endsWith('Node'); - if(objectIsNode && !(o.value in nodeMap)) { - nodeMap[o.value] = {'@id': o.value}; - } - - if(p === RDF_TYPE && !useRdfType && objectIsNode) { - util.addValue(node, '@type', o.value, {propertyIsArray: true}); - continue; - } - - const value = _RDFToObject(o, useNativeTypes, rdfDirection); - util.addValue(node, p, value, {propertyIsArray: true}); - - // object may be an RDF list/partial list node but we can't know easily - // until all triples are read - if(objectIsNode) { - if(o.value === RDF_NIL) { - // track rdf:nil uniquely per graph - const object = nodeMap[o.value]; - if(!('usages' in object)) { - object.usages = []; - } - object.usages.push({ - node, - property: p, - value - }); - } else if(o.value in referencedOnce) { - // object referenced more than once - referencedOnce[o.value] = false; - } else { - // keep track of single reference - referencedOnce[o.value] = { - node, - property: p, - value - }; - } - } - } - - /* - for(let name in dataset) { - const graph = dataset[name]; - if(!(name in graphMap)) { - graphMap[name] = {}; - } - if(name !== '@default' && !(name in defaultGraph)) { - defaultGraph[name] = {'@id': name}; - } - const nodeMap = graphMap[name]; - for(let ti = 0; ti < graph.length; ++ti) { - const triple = graph[ti]; - - // get subject, predicate, object - const s = triple.subject.value; - const p = triple.predicate.value; - const o = triple.object; - - if(!(s in nodeMap)) { - nodeMap[s] = {'@id': s}; - } - const node = nodeMap[s]; - - const objectIsId = (o.type === 'IRI' || o.type === 'blank node'); - if(objectIsId && !(o.value in nodeMap)) { - nodeMap[o.value] = {'@id': o.value}; - } - - if(p === RDF_TYPE && !useRdfType && objectIsId) { - util.addValue(node, '@type', o.value, {propertyIsArray: true}); - continue; - } - - const value = _RDFToObject(o, useNativeTypes); - util.addValue(node, p, value, {propertyIsArray: true}); - - // object may be an RDF list/partial list node but we can't know easily - // until all triples are read - if(objectIsId) { - if(o.value === RDF_NIL) { - // track rdf:nil uniquely per graph - const object = nodeMap[o.value]; - if(!('usages' in object)) { - object.usages = []; - } - object.usages.push({ - node: node, - property: p, - value: value - }); - } else if(o.value in referencedOnce) { - // object referenced more than once - referencedOnce[o.value] = false; - } else { - // keep track of single reference - referencedOnce[o.value] = { - node: node, - property: p, - value: value - }; - } - } - } - }*/ - - // convert linked lists to @list arrays - for(const name in graphMap) { - const graphObject = graphMap[name]; - - // no @lists to be converted, continue - if(!(RDF_NIL in graphObject)) { - continue; - } - - // iterate backwards through each RDF list - const nil = graphObject[RDF_NIL]; - if(!nil.usages) { - continue; - } - for(let usage of nil.usages) { - let node = usage.node; - let property = usage.property; - let head = usage.value; - const list = []; - const listNodes = []; - - // ensure node is a well-formed list node; it must: - // 1. Be referenced only once. - // 2. Have an array for rdf:first that has 1 item. - // 3. Have an array for rdf:rest that has 1 item. - // 4. Have no keys other than: @id, rdf:first, rdf:rest, and, - // optionally, @type where the value is rdf:List. - let nodeKeyCount = Object.keys(node).length; - while(property === RDF_REST && - types.isObject(referencedOnce[node['@id']]) && - types.isArray(node[RDF_FIRST]) && node[RDF_FIRST].length === 1 && - types.isArray(node[RDF_REST]) && node[RDF_REST].length === 1 && - (nodeKeyCount === 3 || - (nodeKeyCount === 4 && types.isArray(node['@type']) && - node['@type'].length === 1 && node['@type'][0] === RDF_LIST))) { - list.push(node[RDF_FIRST][0]); - listNodes.push(node['@id']); - - // get next node, moving backwards through list - usage = referencedOnce[node['@id']]; - node = usage.node; - property = usage.property; - head = usage.value; - nodeKeyCount = Object.keys(node).length; - - // if node is not a blank node, then list head found - if(!graphTypes.isBlankNode(node)) { - break; - } - } - - // transform list into @list object - delete head['@id']; - head['@list'] = list.reverse(); - for(const listNode of listNodes) { - delete graphObject[listNode]; - } - } - - delete nil.usages; - } - - const result = []; - const subjects = Object.keys(defaultGraph).sort(); - for(const subject of subjects) { - const node = defaultGraph[subject]; - if(subject in graphMap) { - const graph = node['@graph'] = []; - const graphObject = graphMap[subject]; - const graphSubjects = Object.keys(graphObject).sort(); - for(const graphSubject of graphSubjects) { - const node = graphObject[graphSubject]; - // only add full subjects to top-level - if(!graphTypes.isSubjectReference(node)) { - graph.push(node); - } - } - } - // only add full subjects to top-level - if(!graphTypes.isSubjectReference(node)) { - result.push(node); - } - } - - return result; -}; - -/** - * Converts an RDF triple object to a JSON-LD object. - * - * @param o the RDF triple object to convert. - * @param useNativeTypes true to output native types, false not to. - * - * @return the JSON-LD object. - */ -function _RDFToObject(o, useNativeTypes, rdfDirection) { - // convert NamedNode/BlankNode object to JSON-LD - if(o.termType.endsWith('Node')) { - return {'@id': o.value}; - } - - // convert literal to JSON-LD - const rval = {'@value': o.value}; - - // add language - if(o.language) { - rval['@language'] = o.language; - } else { - let type = o.datatype.value; - if(!type) { - type = XSD_STRING; - } - if(type === RDF_JSON_LITERAL) { - type = '@json'; - try { - rval['@value'] = JSON.parse(rval['@value']); - } catch(e) { - throw new JsonLdError( - 'JSON literal could not be parsed.', - 'jsonld.InvalidJsonLiteral', - {code: 'invalid JSON literal', value: rval['@value'], cause: e}); - } - } - // use native types for certain xsd types - if(useNativeTypes) { - if(type === XSD_BOOLEAN) { - if(rval['@value'] === 'true') { - rval['@value'] = true; - } else if(rval['@value'] === 'false') { - rval['@value'] = false; - } - } else if(types.isNumeric(rval['@value'])) { - if(type === XSD_INTEGER) { - const i = parseInt(rval['@value'], 10); - if(i.toFixed(0) === rval['@value']) { - rval['@value'] = i; - } - } else if(type === XSD_DOUBLE) { - rval['@value'] = parseFloat(rval['@value']); - } - } - // do not add native type - if(![XSD_BOOLEAN, XSD_INTEGER, XSD_DOUBLE, XSD_STRING].includes(type)) { - rval['@type'] = type; - } - } else if(rdfDirection === 'i18n-datatype' && - type.startsWith('https://www.w3.org/ns/i18n#')) { - const [, language, direction] = type.split(/[#_]/); - if(language.length > 0) { - rval['@language'] = language; - if(!language.match(REGEX_BCP47)) { - console.warn(`@language must be valid BCP47: ${language}`); - } - } - rval['@direction'] = direction; - } else if(type !== XSD_STRING) { - rval['@type'] = type; - } - } - - return rval; -} - -},{"./JsonLdError":12,"./constants":18,"./graphTypes":25,"./types":30,"./util":32}],25:[function(require,module,exports){ -/* - * Copyright (c) 2017 Digital Bazaar, Inc. All rights reserved. - */ -'use strict'; - -const types = require('./types'); - -const api = {}; -module.exports = api; - -/** - * Returns true if the given value is a subject with properties. - * - * @param v the value to check. - * - * @return true if the value is a subject with properties, false if not. - */ -api.isSubject = v => { - // Note: A value is a subject if all of these hold true: - // 1. It is an Object. - // 2. It is not a @value, @set, or @list. - // 3. It has more than 1 key OR any existing key is not @id. - if(types.isObject(v) && - !(('@value' in v) || ('@set' in v) || ('@list' in v))) { - const keyCount = Object.keys(v).length; - return (keyCount > 1 || !('@id' in v)); - } - return false; -}; - -/** - * Returns true if the given value is a subject reference. - * - * @param v the value to check. - * - * @return true if the value is a subject reference, false if not. - */ -api.isSubjectReference = v => - // Note: A value is a subject reference if all of these hold true: - // 1. It is an Object. - // 2. It has a single key: @id. - (types.isObject(v) && Object.keys(v).length === 1 && ('@id' in v)); - -/** - * Returns true if the given value is a @value. - * - * @param v the value to check. - * - * @return true if the value is a @value, false if not. - */ -api.isValue = v => - // Note: A value is a @value if all of these hold true: - // 1. It is an Object. - // 2. It has the @value property. - types.isObject(v) && ('@value' in v); - -/** - * Returns true if the given value is a @list. - * - * @param v the value to check. - * - * @return true if the value is a @list, false if not. - */ -api.isList = v => - // Note: A value is a @list if all of these hold true: - // 1. It is an Object. - // 2. It has the @list property. - types.isObject(v) && ('@list' in v); - -/** - * Returns true if the given value is a @graph. - * - * @return true if the value is a @graph, false if not. - */ -api.isGraph = v => { - // Note: A value is a graph if all of these hold true: - // 1. It is an object. - // 2. It has an `@graph` key. - // 3. It may have '@id' or '@index' - return types.isObject(v) && - '@graph' in v && - Object.keys(v) - .filter(key => key !== '@id' && key !== '@index').length === 1; -}; - -/** - * Returns true if the given value is a simple @graph. - * - * @return true if the value is a simple @graph, false if not. - */ -api.isSimpleGraph = v => { - // Note: A value is a simple graph if all of these hold true: - // 1. It is an object. - // 2. It has an `@graph` key. - // 3. It has only 1 key or 2 keys where one of them is `@index`. - return api.isGraph(v) && !('@id' in v); -}; - -/** - * Returns true if the given value is a blank node. - * - * @param v the value to check. - * - * @return true if the value is a blank node, false if not. - */ -api.isBlankNode = v => { - // Note: A value is a blank node if all of these hold true: - // 1. It is an Object. - // 2. If it has an @id key its value begins with '_:'. - // 3. It has no keys OR is not a @value, @set, or @list. - if(types.isObject(v)) { - if('@id' in v) { - return (v['@id'].indexOf('_:') === 0); - } - return (Object.keys(v).length === 0 || - !(('@value' in v) || ('@set' in v) || ('@list' in v))); - } - return false; -}; - -},{"./types":30}],26:[function(require,module,exports){ -/** - * A JavaScript implementation of the JSON-LD API. - * - * @author Dave Longley - * - * @license BSD 3-Clause License - * Copyright (c) 2011-2019 Digital Bazaar, Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * Neither the name of the Digital Bazaar, Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS - * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED - * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -const canonize = require('rdf-canonize'); -const platform = require('./platform'); -const util = require('./util'); -const ContextResolver = require('./ContextResolver'); -const IdentifierIssuer = util.IdentifierIssuer; -const JsonLdError = require('./JsonLdError'); -const LRU = require('lru-cache'); -const NQuads = require('./NQuads'); - -const {expand: _expand} = require('./expand'); -const {flatten: _flatten} = require('./flatten'); -const {fromRDF: _fromRDF} = require('./fromRdf'); -const {toRDF: _toRDF} = require('./toRdf'); - -const { - frameMergedOrDefault: _frameMergedOrDefault, - cleanupNull: _cleanupNull -} = require('./frame'); - -const { - isArray: _isArray, - isObject: _isObject, - isString: _isString -} = require('./types'); - -const { - isSubjectReference: _isSubjectReference, -} = require('./graphTypes'); - -const { - expandIri: _expandIri, - getInitialContext: _getInitialContext, - process: _processContext, - processingMode: _processingMode -} = require('./context'); - -const { - compact: _compact, - compactIri: _compactIri -} = require('./compact'); - -const { - createNodeMap: _createNodeMap, - createMergedNodeMap: _createMergedNodeMap, - mergeNodeMaps: _mergeNodeMaps -} = require('./nodeMap'); - -/* eslint-disable indent */ -// attaches jsonld API to the given object -const wrapper = function(jsonld) { - -/** Registered RDF dataset parsers hashed by content-type. */ -const _rdfParsers = {}; - -// resolved context cache -// TODO: consider basing max on context size rather than number -const RESOLVED_CONTEXT_CACHE_MAX_SIZE = 100; -const _resolvedContextCache = new LRU({max: RESOLVED_CONTEXT_CACHE_MAX_SIZE}); - -/* Core API */ - -/** - * Performs JSON-LD compaction. - * - * @param input the JSON-LD input to compact. - * @param ctx the context to compact with. - * @param [options] options to use: - * [base] the base IRI to use. - * [compactArrays] true to compact arrays to single values when - * appropriate, false not to (default: true). - * [compactToRelative] true to compact IRIs to be relative to document - * base, false to keep absolute (default: true) - * [graph] true to always output a top-level graph (default: false). - * [expandContext] a context to expand with. - * [skipExpansion] true to assume the input is expanded and skip - * expansion, false not to, defaults to false. - * [documentLoader(url, options)] the document loader. - * [expansionMap(info)] a function that can be used to custom map - * unmappable values (or to throw an error when they are detected); - * if this function returns `undefined` then the default behavior - * will be used. - * [framing] true if compaction is occuring during a framing operation. - * [compactionMap(info)] a function that can be used to custom map - * unmappable values (or to throw an error when they are detected); - * if this function returns `undefined` then the default behavior - * will be used. - * [contextResolver] internal use only. - * - * @return a Promise that resolves to the compacted output. - */ -jsonld.compact = async function(input, ctx, options) { - if(arguments.length < 2) { - throw new TypeError('Could not compact, too few arguments.'); - } - - if(ctx === null) { - throw new JsonLdError( - 'The compaction context must not be null.', - 'jsonld.CompactError', {code: 'invalid local context'}); - } - - // nothing to compact - if(input === null) { - return null; - } - - // set default options - options = _setDefaults(options, { - base: _isString(input) ? input : '', - compactArrays: true, - compactToRelative: true, - graph: false, - skipExpansion: false, - link: false, - issuer: new IdentifierIssuer('_:b'), - contextResolver: new ContextResolver( - {sharedCache: _resolvedContextCache}) - }); - if(options.link) { - // force skip expansion when linking, "link" is not part of the public - // API, it should only be called from framing - options.skipExpansion = true; - } - if(!options.compactToRelative) { - delete options.base; - } - - // expand input - let expanded; - if(options.skipExpansion) { - expanded = input; - } else { - expanded = await jsonld.expand(input, options); - } - - // process context - const activeCtx = await jsonld.processContext( - _getInitialContext(options), ctx, options); - - // do compaction - let compacted = await _compact({ - activeCtx, - element: expanded, - options, - compactionMap: options.compactionMap - }); - - // perform clean up - if(options.compactArrays && !options.graph && _isArray(compacted)) { - if(compacted.length === 1) { - // simplify to a single item - compacted = compacted[0]; - } else if(compacted.length === 0) { - // simplify to an empty object - compacted = {}; - } - } else if(options.graph && _isObject(compacted)) { - // always use array if graph option is on - compacted = [compacted]; - } - - // follow @context key - if(_isObject(ctx) && '@context' in ctx) { - ctx = ctx['@context']; - } - - // build output context - ctx = util.clone(ctx); - if(!_isArray(ctx)) { - ctx = [ctx]; - } - // remove empty contexts - const tmp = ctx; - ctx = []; - for(let i = 0; i < tmp.length; ++i) { - if(!_isObject(tmp[i]) || Object.keys(tmp[i]).length > 0) { - ctx.push(tmp[i]); - } - } - - // remove array if only one context - const hasContext = (ctx.length > 0); - if(ctx.length === 1) { - ctx = ctx[0]; - } - - // add context and/or @graph - if(_isArray(compacted)) { - // use '@graph' keyword - const graphAlias = _compactIri({ - activeCtx, iri: '@graph', relativeTo: {vocab: true} - }); - const graph = compacted; - compacted = {}; - if(hasContext) { - compacted['@context'] = ctx; - } - compacted[graphAlias] = graph; - } else if(_isObject(compacted) && hasContext) { - // reorder keys so @context is first - const graph = compacted; - compacted = {'@context': ctx}; - for(const key in graph) { - compacted[key] = graph[key]; - } - } - - return compacted; -}; - -/** - * Performs JSON-LD expansion. - * - * @param input the JSON-LD input to expand. - * @param [options] the options to use: - * [base] the base IRI to use. - * [expandContext] a context to expand with. - * [keepFreeFloatingNodes] true to keep free-floating nodes, - * false not to, defaults to false. - * [documentLoader(url, options)] the document loader. - * [expansionMap(info)] a function that can be used to custom map - * unmappable values (or to throw an error when they are detected); - * if this function returns `undefined` then the default behavior - * will be used. - * [contextResolver] internal use only. - * - * @return a Promise that resolves to the expanded output. - */ -jsonld.expand = async function(input, options) { - if(arguments.length < 1) { - throw new TypeError('Could not expand, too few arguments.'); - } - - // set default options - options = _setDefaults(options, { - keepFreeFloatingNodes: false, - contextResolver: new ContextResolver( - {sharedCache: _resolvedContextCache}) - }); - if(options.expansionMap === false) { - options.expansionMap = undefined; - } - - // build set of objects that may have @contexts to resolve - const toResolve = {}; - - // build set of contexts to process prior to expansion - const contextsToProcess = []; - - // if an `expandContext` has been given ensure it gets resolved - if('expandContext' in options) { - const expandContext = util.clone(options.expandContext); - if(_isObject(expandContext) && '@context' in expandContext) { - toResolve.expandContext = expandContext; - } else { - toResolve.expandContext = {'@context': expandContext}; - } - contextsToProcess.push(toResolve.expandContext); - } - - // if input is a string, attempt to dereference remote document - let defaultBase; - if(!_isString(input)) { - // input is not a URL, do not need to retrieve it first - toResolve.input = util.clone(input); - } else { - // load remote doc - const remoteDoc = await jsonld.get(input, options); - defaultBase = remoteDoc.documentUrl; - toResolve.input = remoteDoc.document; - if(remoteDoc.contextUrl) { - // context included in HTTP link header and must be resolved - toResolve.remoteContext = {'@context': remoteDoc.contextUrl}; - contextsToProcess.push(toResolve.remoteContext); - } - } - - // set default base - if(!('base' in options)) { - options.base = defaultBase || ''; - } - - // process any additional contexts - let activeCtx = _getInitialContext(options); - for(const localCtx of contextsToProcess) { - activeCtx = await _processContext({activeCtx, localCtx, options}); - } - - // expand resolved input - let expanded = await _expand({ - activeCtx, - element: toResolve.input, - options, - expansionMap: options.expansionMap - }); - - // optimize away @graph with no other properties - if(_isObject(expanded) && ('@graph' in expanded) && - Object.keys(expanded).length === 1) { - expanded = expanded['@graph']; - } else if(expanded === null) { - expanded = []; - } - - // normalize to an array - if(!_isArray(expanded)) { - expanded = [expanded]; - } - - return expanded; -}; - -/** - * Performs JSON-LD flattening. - * - * @param input the JSON-LD to flatten. - * @param ctx the context to use to compact the flattened output, or null. - * @param [options] the options to use: - * [base] the base IRI to use. - * [expandContext] a context to expand with. - * [documentLoader(url, options)] the document loader. - * [contextResolver] internal use only. - * - * @return a Promise that resolves to the flattened output. - */ -jsonld.flatten = async function(input, ctx, options) { - if(arguments.length < 1) { - return new TypeError('Could not flatten, too few arguments.'); - } - - if(typeof ctx === 'function') { - ctx = null; - } else { - ctx = ctx || null; - } - - // set default options - options = _setDefaults(options, { - base: _isString(input) ? input : '', - contextResolver: new ContextResolver( - {sharedCache: _resolvedContextCache}) - }); - - // expand input - const expanded = await jsonld.expand(input, options); - - // do flattening - const flattened = _flatten(expanded); - - if(ctx === null) { - // no compaction required - return flattened; - } - - // compact result (force @graph option to true, skip expansion) - options.graph = true; - options.skipExpansion = true; - const compacted = await jsonld.compact(flattened, ctx, options); - - return compacted; -}; - -/** - * Performs JSON-LD framing. - * - * @param input the JSON-LD input to frame. - * @param frame the JSON-LD frame to use. - * @param [options] the framing options. - * [base] the base IRI to use. - * [expandContext] a context to expand with. - * [embed] default @embed flag: '@last', '@always', '@never', '@link' - * (default: '@last'). - * [explicit] default @explicit flag (default: false). - * [requireAll] default @requireAll flag (default: true). - * [omitDefault] default @omitDefault flag (default: false). - * [documentLoader(url, options)] the document loader. - * [contextResolver] internal use only. - * - * @return a Promise that resolves to the framed output. - */ -jsonld.frame = async function(input, frame, options) { - if(arguments.length < 2) { - throw new TypeError('Could not frame, too few arguments.'); - } - - // set default options - options = _setDefaults(options, { - base: _isString(input) ? input : '', - embed: '@once', - explicit: false, - requireAll: false, - omitDefault: false, - bnodesToClear: [], - contextResolver: new ContextResolver( - {sharedCache: _resolvedContextCache}) - }); - - // if frame is a string, attempt to dereference remote document - if(_isString(frame)) { - // load remote doc - const remoteDoc = await jsonld.get(frame, options); - frame = remoteDoc.document; - - if(remoteDoc.contextUrl) { - // inject link header @context into frame - let ctx = frame['@context']; - if(!ctx) { - ctx = remoteDoc.contextUrl; - } else if(_isArray(ctx)) { - ctx.push(remoteDoc.contextUrl); - } else { - ctx = [ctx, remoteDoc.contextUrl]; - } - frame['@context'] = ctx; - } - } - - const frameContext = frame ? frame['@context'] || {} : {}; - - // process context - const activeCtx = await jsonld.processContext( - _getInitialContext(options), frameContext, options); - - // mode specific defaults - if(!options.hasOwnProperty('omitGraph')) { - options.omitGraph = _processingMode(activeCtx, 1.1); - } - if(!options.hasOwnProperty('pruneBlankNodeIdentifiers')) { - options.pruneBlankNodeIdentifiers = _processingMode(activeCtx, 1.1); - } - - // expand input - const expanded = await jsonld.expand(input, options); - - // expand frame - const opts = {...options}; - opts.isFrame = true; - opts.keepFreeFloatingNodes = true; - const expandedFrame = await jsonld.expand(frame, opts); - - // if the unexpanded frame includes a key expanding to @graph, frame the - // default graph, otherwise, the merged graph - const frameKeys = Object.keys(frame) - .map(key => _expandIri(activeCtx, key, {vocab: true})); - opts.merged = !frameKeys.includes('@graph'); - opts.is11 = _processingMode(activeCtx, 1.1); - - // do framing - const framed = _frameMergedOrDefault(expanded, expandedFrame, opts); - - opts.graph = !options.omitGraph; - opts.skipExpansion = true; - opts.link = {}; - opts.framing = true; - let compacted = await jsonld.compact(framed, frameContext, opts); - - // replace @null with null, compacting arrays - opts.link = {}; - compacted = _cleanupNull(compacted, opts); - - return compacted; -}; - -/** - * **Experimental** - * - * Links a JSON-LD document's nodes in memory. - * - * @param input the JSON-LD document to link. - * @param [ctx] the JSON-LD context to apply. - * @param [options] the options to use: - * [base] the base IRI to use. - * [expandContext] a context to expand with. - * [documentLoader(url, options)] the document loader. - * [contextResolver] internal use only. - * - * @return a Promise that resolves to the linked output. - */ -jsonld.link = async function(input, ctx, options) { - // API matches running frame with a wildcard frame and embed: '@link' - // get arguments - const frame = {}; - if(ctx) { - frame['@context'] = ctx; - } - frame['@embed'] = '@link'; - return jsonld.frame(input, frame, options); -}; - -/** - * Performs RDF dataset normalization on the given input. The input is JSON-LD - * unless the 'inputFormat' option is used. The output is an RDF dataset - * unless the 'format' option is used. - * - * @param input the input to normalize as JSON-LD or as a format specified by - * the 'inputFormat' option. - * @param [options] the options to use: - * [algorithm] the normalization algorithm to use, `URDNA2015` or - * `URGNA2012` (default: `URDNA2015`). - * [base] the base IRI to use. - * [expandContext] a context to expand with. - * [skipExpansion] true to assume the input is expanded and skip - * expansion, false not to, defaults to false. - * [inputFormat] the format if input is not JSON-LD: - * 'application/n-quads' for N-Quads. - * [format] the format if output is a string: - * 'application/n-quads' for N-Quads. - * [documentLoader(url, options)] the document loader. - * [useNative] true to use a native canonize algorithm - * [contextResolver] internal use only. - * - * @return a Promise that resolves to the normalized output. - */ -jsonld.normalize = jsonld.canonize = async function(input, options) { - if(arguments.length < 1) { - throw new TypeError('Could not canonize, too few arguments.'); - } - - // set default options - options = _setDefaults(options, { - base: _isString(input) ? input : '', - algorithm: 'URDNA2015', - skipExpansion: false, - contextResolver: new ContextResolver( - {sharedCache: _resolvedContextCache}) - }); - if('inputFormat' in options) { - if(options.inputFormat !== 'application/n-quads' && - options.inputFormat !== 'application/nquads') { - throw new JsonLdError( - 'Unknown canonicalization input format.', - 'jsonld.CanonizeError'); - } - // TODO: `await` for async parsers - const parsedInput = NQuads.parse(input); - - // do canonicalization - return canonize.canonize(parsedInput, options); - } - - // convert to RDF dataset then do normalization - const opts = {...options}; - delete opts.format; - opts.produceGeneralizedRdf = false; - const dataset = await jsonld.toRDF(input, opts); - - // do canonicalization - return canonize.canonize(dataset, options); -}; - -/** - * Converts an RDF dataset to JSON-LD. - * - * @param dataset a serialized string of RDF in a format specified by the - * format option or an RDF dataset to convert. - * @param [options] the options to use: - * [format] the format if dataset param must first be parsed: - * 'application/n-quads' for N-Quads (default). - * [rdfParser] a custom RDF-parser to use to parse the dataset. - * [useRdfType] true to use rdf:type, false to use @type - * (default: false). - * [useNativeTypes] true to convert XSD types into native types - * (boolean, integer, double), false not to (default: false). - * - * @return a Promise that resolves to the JSON-LD document. - */ -jsonld.fromRDF = async function(dataset, options) { - if(arguments.length < 1) { - throw new TypeError('Could not convert from RDF, too few arguments.'); - } - - // set default options - options = _setDefaults(options, { - format: _isString(dataset) ? 'application/n-quads' : undefined - }); - - const {format} = options; - let {rdfParser} = options; - - // handle special format - if(format) { - // check supported formats - rdfParser = rdfParser || _rdfParsers[format]; - if(!rdfParser) { - throw new JsonLdError( - 'Unknown input format.', - 'jsonld.UnknownFormat', {format}); - } - } else { - // no-op parser, assume dataset already parsed - rdfParser = () => dataset; - } - - // rdfParser must be synchronous or return a promise, no callback support - const parsedDataset = await rdfParser(dataset); - return _fromRDF(parsedDataset, options); -}; - -/** - * Outputs the RDF dataset found in the given JSON-LD object. - * - * @param input the JSON-LD input. - * @param [options] the options to use: - * [base] the base IRI to use. - * [expandContext] a context to expand with. - * [skipExpansion] true to assume the input is expanded and skip - * expansion, false not to, defaults to false. - * [format] the format to use to output a string: - * 'application/n-quads' for N-Quads. - * [produceGeneralizedRdf] true to output generalized RDF, false - * to produce only standard RDF (default: false). - * [documentLoader(url, options)] the document loader. - * [contextResolver] internal use only. - * - * @return a Promise that resolves to the RDF dataset. - */ -jsonld.toRDF = async function(input, options) { - if(arguments.length < 1) { - throw new TypeError('Could not convert to RDF, too few arguments.'); - } - - // set default options - options = _setDefaults(options, { - base: _isString(input) ? input : '', - skipExpansion: false, - contextResolver: new ContextResolver( - {sharedCache: _resolvedContextCache}) - }); - - // TODO: support toRDF custom map? - let expanded; - if(options.skipExpansion) { - expanded = input; - } else { - // expand input - expanded = await jsonld.expand(input, options); - } - - // output RDF dataset - const dataset = _toRDF(expanded, options); - if(options.format) { - if(options.format === 'application/n-quads' || - options.format === 'application/nquads') { - return NQuads.serialize(dataset); - } - throw new JsonLdError( - 'Unknown output format.', - 'jsonld.UnknownFormat', {format: options.format}); - } - - return dataset; -}; - -/** - * **Experimental** - * - * Recursively flattens the nodes in the given JSON-LD input into a merged - * map of node ID => node. All graphs will be merged into the default graph. - * - * @param input the JSON-LD input. - * @param [options] the options to use: - * [base] the base IRI to use. - * [expandContext] a context to expand with. - * [issuer] a jsonld.IdentifierIssuer to use to label blank nodes. - * [documentLoader(url, options)] the document loader. - * [contextResolver] internal use only. - * - * @return a Promise that resolves to the merged node map. - */ -jsonld.createNodeMap = async function(input, options) { - if(arguments.length < 1) { - throw new TypeError('Could not create node map, too few arguments.'); - } - - // set default options - options = _setDefaults(options, { - base: _isString(input) ? input : '', - contextResolver: new ContextResolver( - {sharedCache: _resolvedContextCache}) - }); - - // expand input - const expanded = await jsonld.expand(input, options); - - return _createMergedNodeMap(expanded, options); -}; - -/** - * **Experimental** - * - * Merges two or more JSON-LD documents into a single flattened document. - * - * @param docs the JSON-LD documents to merge together. - * @param ctx the context to use to compact the merged result, or null. - * @param [options] the options to use: - * [base] the base IRI to use. - * [expandContext] a context to expand with. - * [issuer] a jsonld.IdentifierIssuer to use to label blank nodes. - * [mergeNodes] true to merge properties for nodes with the same ID, - * false to ignore new properties for nodes with the same ID once - * the ID has been defined; note that this may not prevent merging - * new properties where a node is in the `object` position - * (default: true). - * [documentLoader(url, options)] the document loader. - * [contextResolver] internal use only. - * - * @return a Promise that resolves to the merged output. - */ -jsonld.merge = async function(docs, ctx, options) { - if(arguments.length < 1) { - throw new TypeError('Could not merge, too few arguments.'); - } - if(!_isArray(docs)) { - throw new TypeError('Could not merge, "docs" must be an array.'); - } - - if(typeof ctx === 'function') { - ctx = null; - } else { - ctx = ctx || null; - } - - // set default options - options = _setDefaults(options, { - contextResolver: new ContextResolver( - {sharedCache: _resolvedContextCache}) - }); - - // expand all documents - const expanded = await Promise.all(docs.map(doc => { - const opts = {...options}; - return jsonld.expand(doc, opts); - })); - - let mergeNodes = true; - if('mergeNodes' in options) { - mergeNodes = options.mergeNodes; - } - - const issuer = options.issuer || new IdentifierIssuer('_:b'); - const graphs = {'@default': {}}; - - for(let i = 0; i < expanded.length; ++i) { - // uniquely relabel blank nodes - const doc = util.relabelBlankNodes(expanded[i], { - issuer: new IdentifierIssuer('_:b' + i + '-') - }); - - // add nodes to the shared node map graphs if merging nodes, to a - // separate graph set if not - const _graphs = (mergeNodes || i === 0) ? graphs : {'@default': {}}; - _createNodeMap(doc, _graphs, '@default', issuer); - - if(_graphs !== graphs) { - // merge document graphs but don't merge existing nodes - for(const graphName in _graphs) { - const _nodeMap = _graphs[graphName]; - if(!(graphName in graphs)) { - graphs[graphName] = _nodeMap; - continue; - } - const nodeMap = graphs[graphName]; - for(const key in _nodeMap) { - if(!(key in nodeMap)) { - nodeMap[key] = _nodeMap[key]; - } - } - } - } - } - - // add all non-default graphs to default graph - const defaultGraph = _mergeNodeMaps(graphs); - - // produce flattened output - const flattened = []; - const keys = Object.keys(defaultGraph).sort(); - for(let ki = 0; ki < keys.length; ++ki) { - const node = defaultGraph[keys[ki]]; - // only add full subjects to top-level - if(!_isSubjectReference(node)) { - flattened.push(node); - } - } - - if(ctx === null) { - return flattened; - } - - // compact result (force @graph option to true, skip expansion) - options.graph = true; - options.skipExpansion = true; - const compacted = await jsonld.compact(flattened, ctx, options); - - return compacted; -}; - -/** - * The default document loader for external documents. - * - * @param url the URL to load. - * - * @return a promise that resolves to the remote document. - */ -Object.defineProperty(jsonld, 'documentLoader', { - get: () => jsonld._documentLoader, - set: v => jsonld._documentLoader = v -}); -// default document loader not implemented -jsonld.documentLoader = async url => { - throw new JsonLdError( - 'Could not retrieve a JSON-LD document from the URL. URL ' + - 'dereferencing not implemented.', 'jsonld.LoadDocumentError', - {code: 'loading document failed', url}); -}; - -/** - * Gets a remote JSON-LD document using the default document loader or - * one given in the passed options. - * - * @param url the URL to fetch. - * @param [options] the options to use: - * [documentLoader] the document loader to use. - * - * @return a Promise that resolves to the retrieved remote document. - */ -jsonld.get = async function(url, options) { - let load; - if(typeof options.documentLoader === 'function') { - load = options.documentLoader; - } else { - load = jsonld.documentLoader; - } - - const remoteDoc = await load(url); - - try { - if(!remoteDoc.document) { - throw new JsonLdError( - 'No remote document found at the given URL.', - 'jsonld.NullRemoteDocument'); - } - if(_isString(remoteDoc.document)) { - remoteDoc.document = JSON.parse(remoteDoc.document); - } - } catch(e) { - throw new JsonLdError( - 'Could not retrieve a JSON-LD document from the URL.', - 'jsonld.LoadDocumentError', { - code: 'loading document failed', - cause: e, - remoteDoc - }); - } - - return remoteDoc; -}; - -/** - * Processes a local context, resolving any URLs as necessary, and returns a - * new active context. - * - * @param activeCtx the current active context. - * @param localCtx the local context to process. - * @param [options] the options to use: - * [documentLoader(url, options)] the document loader. - * [contextResolver] internal use only. - * - * @return a Promise that resolves to the new active context. - */ -jsonld.processContext = async function( - activeCtx, localCtx, options) { - // set default options - options = _setDefaults(options, { - base: '', - contextResolver: new ContextResolver( - {sharedCache: _resolvedContextCache}) - }); - - // return initial context early for null context - if(localCtx === null) { - return _getInitialContext(options); - } - - // get URLs in localCtx - localCtx = util.clone(localCtx); - if(!(_isObject(localCtx) && '@context' in localCtx)) { - localCtx = {'@context': localCtx}; - } - - return _processContext({activeCtx, localCtx, options}); -}; - -// backwards compatibility -jsonld.getContextValue = require('./context').getContextValue; - -/** - * Document loaders. - */ -jsonld.documentLoaders = {}; - -/** - * Assigns the default document loader for external document URLs to a built-in - * default. Supported types currently include: 'xhr' and 'node'. - * - * @param type the type to set. - * @param [params] the parameters required to use the document loader. - */ -jsonld.useDocumentLoader = function(type) { - if(!(type in jsonld.documentLoaders)) { - throw new JsonLdError( - 'Unknown document loader type: "' + type + '"', - 'jsonld.UnknownDocumentLoader', - {type}); - } - - // set document loader - jsonld.documentLoader = jsonld.documentLoaders[type].apply( - jsonld, Array.prototype.slice.call(arguments, 1)); -}; - -/** - * Registers an RDF dataset parser by content-type, for use with - * jsonld.fromRDF. An RDF dataset parser will always be given one parameter, - * a string of input. An RDF dataset parser can be synchronous or - * asynchronous (by returning a promise). - * - * @param contentType the content-type for the parser. - * @param parser(input) the parser function (takes a string as a parameter - * and either returns an RDF dataset or a Promise that resolves to one. - */ -jsonld.registerRDFParser = function(contentType, parser) { - _rdfParsers[contentType] = parser; -}; - -/** - * Unregisters an RDF dataset parser by content-type. - * - * @param contentType the content-type for the parser. - */ -jsonld.unregisterRDFParser = function(contentType) { - delete _rdfParsers[contentType]; -}; - -// register the N-Quads RDF parser -jsonld.registerRDFParser('application/n-quads', NQuads.parse); -jsonld.registerRDFParser('application/nquads', NQuads.parse); - -/* URL API */ -jsonld.url = require('./url'); - -/* Utility API */ -jsonld.util = util; -// backwards compatibility -Object.assign(jsonld, util); - -// reexpose API as jsonld.promises for backwards compatability -jsonld.promises = jsonld; - -// backwards compatibility -jsonld.RequestQueue = require('./RequestQueue'); - -/* WebIDL API */ -jsonld.JsonLdProcessor = require('./JsonLdProcessor')(jsonld); - -platform.setupGlobals(jsonld); -platform.setupDocumentLoaders(jsonld); - -function _setDefaults(options, { - documentLoader = jsonld.documentLoader, - ...defaults -}) { - return Object.assign({}, {documentLoader}, defaults, options); -} - -// end of jsonld API `wrapper` factory -return jsonld; -}; - -// external APIs: - -// used to generate a new jsonld API instance -const factory = function() { - return wrapper(function() { - return factory(); - }); -}; - -// wrap the main jsonld API instance -wrapper(factory); -// export API -module.exports = factory; - -},{"./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(require,module,exports){ -/* - * Copyright (c) 2017 Digital Bazaar, Inc. All rights reserved. - */ -'use strict'; - -const {isKeyword} = require('./context'); -const graphTypes = require('./graphTypes'); -const types = require('./types'); -const util = require('./util'); -const JsonLdError = require('./JsonLdError'); - -const api = {}; -module.exports = api; - -/** - * Creates a merged JSON-LD node map (node ID => node). - * - * @param input the expanded JSON-LD to create a node map of. - * @param [options] the options to use: - * [issuer] a jsonld.IdentifierIssuer to use to label blank nodes. - * - * @return the node map. - */ -api.createMergedNodeMap = (input, options) => { - options = options || {}; - - // produce a map of all subjects and name each bnode - const issuer = options.issuer || new util.IdentifierIssuer('_:b'); - const graphs = {'@default': {}}; - api.createNodeMap(input, graphs, '@default', issuer); - - // add all non-default graphs to default graph - return api.mergeNodeMaps(graphs); -}; - -/** - * Recursively flattens the subjects in the given JSON-LD expanded input - * into a node map. - * - * @param input the JSON-LD expanded input. - * @param graphs a map of graph name to subject map. - * @param graph the name of the current graph. - * @param issuer the blank node identifier issuer. - * @param name the name assigned to the current input if it is a bnode. - * @param list the list to append to, null for none. - */ -api.createNodeMap = (input, graphs, graph, issuer, name, list) => { - // recurse through array - if(types.isArray(input)) { - for(const node of input) { - api.createNodeMap(node, graphs, graph, issuer, undefined, list); - } - return; - } - - // add non-object to list - if(!types.isObject(input)) { - if(list) { - list.push(input); - } - return; - } - - // add values to list - if(graphTypes.isValue(input)) { - if('@type' in input) { - let type = input['@type']; - // rename @type blank node - if(type.indexOf('_:') === 0) { - input['@type'] = type = issuer.getId(type); - } - } - if(list) { - list.push(input); - } - return; - } else if(list && graphTypes.isList(input)) { - const _list = []; - api.createNodeMap(input['@list'], graphs, graph, issuer, name, _list); - list.push({'@list': _list}); - return; - } - - // Note: At this point, input must be a subject. - - // spec requires @type to be named first, so assign names early - if('@type' in input) { - const types = input['@type']; - for(const type of types) { - if(type.indexOf('_:') === 0) { - issuer.getId(type); - } - } - } - - // get name for subject - if(types.isUndefined(name)) { - name = graphTypes.isBlankNode(input) ? - issuer.getId(input['@id']) : input['@id']; - } - - // add subject reference to list - if(list) { - list.push({'@id': name}); - } - - // create new subject or merge into existing one - const subjects = graphs[graph]; - const subject = subjects[name] = subjects[name] || {}; - subject['@id'] = name; - const properties = Object.keys(input).sort(); - for(let property of properties) { - // skip @id - if(property === '@id') { - continue; - } - - // handle reverse properties - if(property === '@reverse') { - const referencedNode = {'@id': name}; - const reverseMap = input['@reverse']; - for(const reverseProperty in reverseMap) { - const items = reverseMap[reverseProperty]; - for(const item of items) { - let itemName = item['@id']; - if(graphTypes.isBlankNode(item)) { - itemName = issuer.getId(itemName); - } - api.createNodeMap(item, graphs, graph, issuer, itemName); - util.addValue( - subjects[itemName], reverseProperty, referencedNode, - {propertyIsArray: true, allowDuplicate: false}); - } - } - continue; - } - - // recurse into graph - if(property === '@graph') { - // add graph subjects map entry - if(!(name in graphs)) { - graphs[name] = {}; - } - api.createNodeMap(input[property], graphs, name, issuer); - continue; - } - - // recurse into included - if(property === '@included') { - api.createNodeMap(input[property], graphs, graph, issuer); - continue; - } - - // copy non-@type keywords - if(property !== '@type' && isKeyword(property)) { - if(property === '@index' && property in subject && - (input[property] !== subject[property] || - input[property]['@id'] !== subject[property]['@id'])) { - throw new JsonLdError( - 'Invalid JSON-LD syntax; conflicting @index property detected.', - 'jsonld.SyntaxError', - {code: 'conflicting indexes', subject}); - } - subject[property] = input[property]; - continue; - } - - // iterate over objects - const objects = input[property]; - - // if property is a bnode, assign it a new id - if(property.indexOf('_:') === 0) { - property = issuer.getId(property); - } - - // ensure property is added for empty arrays - if(objects.length === 0) { - util.addValue(subject, property, [], {propertyIsArray: true}); - continue; - } - for(let o of objects) { - if(property === '@type') { - // rename @type blank nodes - o = (o.indexOf('_:') === 0) ? issuer.getId(o) : o; - } - - // handle embedded subject or subject reference - if(graphTypes.isSubject(o) || graphTypes.isSubjectReference(o)) { - // skip null @id - if('@id' in o && !o['@id']) { - continue; - } - - // relabel blank node @id - const id = graphTypes.isBlankNode(o) ? - issuer.getId(o['@id']) : o['@id']; - - // add reference and recurse - util.addValue( - subject, property, {'@id': id}, - {propertyIsArray: true, allowDuplicate: false}); - api.createNodeMap(o, graphs, graph, issuer, id); - } else if(graphTypes.isValue(o)) { - util.addValue( - subject, property, o, - {propertyIsArray: true, allowDuplicate: false}); - } else if(graphTypes.isList(o)) { - // handle @list - const _list = []; - api.createNodeMap(o['@list'], graphs, graph, issuer, name, _list); - o = {'@list': _list}; - util.addValue( - subject, property, o, - {propertyIsArray: true, allowDuplicate: false}); - } else { - // handle @value - api.createNodeMap(o, graphs, graph, issuer, name); - util.addValue( - subject, property, o, {propertyIsArray: true, allowDuplicate: false}); - } - } - } -}; - -/** - * Merge separate named graphs into a single merged graph including - * all nodes from the default graph and named graphs. - * - * @param graphs a map of graph name to subject map. - * - * @return the merged graph map. - */ -api.mergeNodeMapGraphs = graphs => { - const merged = {}; - for(const name of Object.keys(graphs).sort()) { - for(const id of Object.keys(graphs[name]).sort()) { - const node = graphs[name][id]; - if(!(id in merged)) { - merged[id] = {'@id': id}; - } - const mergedNode = merged[id]; - - for(const property of Object.keys(node).sort()) { - if(isKeyword(property) && property !== '@type') { - // copy keywords - mergedNode[property] = util.clone(node[property]); - } else { - // merge objects - for(const value of node[property]) { - util.addValue( - mergedNode, property, util.clone(value), - {propertyIsArray: true, allowDuplicate: false}); - } - } - } - } - } - - return merged; -}; - -api.mergeNodeMaps = graphs => { - // add all non-default graphs to default graph - const defaultGraph = graphs['@default']; - const graphNames = Object.keys(graphs).sort(); - for(const graphName of graphNames) { - if(graphName === '@default') { - continue; - } - const nodeMap = graphs[graphName]; - let subject = defaultGraph[graphName]; - if(!subject) { - defaultGraph[graphName] = subject = { - '@id': graphName, - '@graph': [] - }; - } else if(!('@graph' in subject)) { - subject['@graph'] = []; - } - const graph = subject['@graph']; - for(const id of Object.keys(nodeMap).sort()) { - const node = nodeMap[id]; - // only add full subjects - if(!graphTypes.isSubjectReference(node)) { - graph.push(node); - } - } - } - return defaultGraph; -}; - -},{"./JsonLdError":12,"./context":19,"./graphTypes":25,"./types":30,"./util":32}],28:[function(require,module,exports){ -/* - * Copyright (c) 2021 Digital Bazaar, Inc. All rights reserved. - */ -'use strict'; - -const xhrLoader = require('./documentLoaders/xhr'); - -const api = {}; -module.exports = api; - -/** - * Setup browser document loaders. - * - * @param jsonld the jsonld api. - */ -api.setupDocumentLoaders = function(jsonld) { - if(typeof XMLHttpRequest !== 'undefined') { - jsonld.documentLoaders.xhr = xhrLoader; - // use xhr document loader by default - jsonld.useDocumentLoader('xhr'); - } -}; - -/** - * Setup browser globals. - * - * @param jsonld the jsonld api. - */ -api.setupGlobals = function(jsonld) { - // setup browser global JsonLdProcessor - if(typeof globalThis.JsonLdProcessor === 'undefined') { - Object.defineProperty(globalThis, 'JsonLdProcessor', { - writable: true, - enumerable: false, - configurable: true, - value: jsonld.JsonLdProcessor - }); - } -}; - -},{"./documentLoaders/xhr":20}],29:[function(require,module,exports){ -/* - * Copyright (c) 2017 Digital Bazaar, Inc. All rights reserved. - */ -'use strict'; - -const {createNodeMap} = require('./nodeMap'); -const {isKeyword} = require('./context'); -const graphTypes = require('./graphTypes'); -const jsonCanonicalize = require('canonicalize'); -const types = require('./types'); -const util = require('./util'); - -const { - // RDF, - // RDF_LIST, - RDF_FIRST, - RDF_REST, - RDF_NIL, - RDF_TYPE, - // RDF_PLAIN_LITERAL, - // RDF_XML_LITERAL, - RDF_JSON_LITERAL, - // RDF_OBJECT, - RDF_LANGSTRING, - - // XSD, - XSD_BOOLEAN, - XSD_DOUBLE, - XSD_INTEGER, - XSD_STRING, -} = require('./constants'); - -const { - isAbsolute: _isAbsoluteIri -} = require('./url'); - -const api = {}; -module.exports = api; - -/** - * Outputs an RDF dataset for the expanded JSON-LD input. - * - * @param input the expanded JSON-LD input. - * @param options the RDF serialization options. - * - * @return the RDF dataset. - */ -api.toRDF = (input, options) => { - // create node map for default graph (and any named graphs) - const issuer = new util.IdentifierIssuer('_:b'); - const nodeMap = {'@default': {}}; - createNodeMap(input, nodeMap, '@default', issuer); - - const dataset = []; - const graphNames = Object.keys(nodeMap).sort(); - for(const graphName of graphNames) { - let graphTerm; - if(graphName === '@default') { - graphTerm = {termType: 'DefaultGraph', value: ''}; - } else if(_isAbsoluteIri(graphName)) { - if(graphName.startsWith('_:')) { - graphTerm = {termType: 'BlankNode'}; - } else { - graphTerm = {termType: 'NamedNode'}; - } - graphTerm.value = graphName; - } else { - // skip relative IRIs (not valid RDF) - continue; - } - _graphToRDF(dataset, nodeMap[graphName], graphTerm, issuer, options); - } - - return dataset; -}; - -/** - * Adds RDF quads for a particular graph to the given dataset. - * - * @param dataset the dataset to append RDF quads to. - * @param graph the graph to create RDF quads for. - * @param graphTerm the graph term for each quad. - * @param issuer a IdentifierIssuer for assigning blank node names. - * @param options the RDF serialization options. - * - * @return the array of RDF triples for the given graph. - */ -function _graphToRDF(dataset, graph, graphTerm, issuer, options) { - const ids = Object.keys(graph).sort(); - for(const id of ids) { - const node = graph[id]; - const properties = Object.keys(node).sort(); - for(let property of properties) { - const items = node[property]; - if(property === '@type') { - property = RDF_TYPE; - } else if(isKeyword(property)) { - continue; - } - - for(const item of items) { - // RDF subject - const subject = { - termType: id.startsWith('_:') ? 'BlankNode' : 'NamedNode', - value: id - }; - - // skip relative IRI subjects (not valid RDF) - if(!_isAbsoluteIri(id)) { - continue; - } - - // RDF predicate - const predicate = { - termType: property.startsWith('_:') ? 'BlankNode' : 'NamedNode', - value: property - }; - - // skip relative IRI predicates (not valid RDF) - if(!_isAbsoluteIri(property)) { - continue; - } - - // skip blank node predicates unless producing generalized RDF - if(predicate.termType === 'BlankNode' && - !options.produceGeneralizedRdf) { - continue; - } - - // convert list, value or node object to triple - const object = - _objectToRDF(item, issuer, dataset, graphTerm, options.rdfDirection); - // skip null objects (they are relative IRIs) - if(object) { - dataset.push({ - subject, - predicate, - object, - graph: graphTerm - }); - } - } - } - } -} - -/** - * Converts a @list value into linked list of blank node RDF quads - * (an RDF collection). - * - * @param list the @list value. - * @param issuer a IdentifierIssuer for assigning blank node names. - * @param dataset the array of quads to append to. - * @param graphTerm the graph term for each quad. - * - * @return the head of the list. - */ -function _listToRDF(list, issuer, dataset, graphTerm, rdfDirection) { - const first = {termType: 'NamedNode', value: RDF_FIRST}; - const rest = {termType: 'NamedNode', value: RDF_REST}; - const nil = {termType: 'NamedNode', value: RDF_NIL}; - - const last = list.pop(); - // Result is the head of the list - const result = last ? {termType: 'BlankNode', value: issuer.getId()} : nil; - let subject = result; - - for(const item of list) { - const object = _objectToRDF(item, issuer, dataset, graphTerm, rdfDirection); - const next = {termType: 'BlankNode', value: issuer.getId()}; - dataset.push({ - subject, - predicate: first, - object, - graph: graphTerm - }); - dataset.push({ - subject, - predicate: rest, - object: next, - graph: graphTerm - }); - subject = next; - } - - // Tail of list - if(last) { - const object = _objectToRDF(last, issuer, dataset, graphTerm, rdfDirection); - dataset.push({ - subject, - predicate: first, - object, - graph: graphTerm - }); - dataset.push({ - subject, - predicate: rest, - object: nil, - graph: graphTerm - }); - } - - return result; -} - -/** - * Converts a JSON-LD value object to an RDF literal or a JSON-LD string, - * node object to an RDF resource, or adds a list. - * - * @param item the JSON-LD value or node object. - * @param issuer a IdentifierIssuer for assigning blank node names. - * @param dataset the dataset to append RDF quads to. - * @param graphTerm the graph term for each quad. - * - * @return the RDF literal or RDF resource. - */ -function _objectToRDF(item, issuer, dataset, graphTerm, rdfDirection) { - const object = {}; - - // convert value object to RDF - if(graphTypes.isValue(item)) { - object.termType = 'Literal'; - object.value = undefined; - object.datatype = { - termType: 'NamedNode' - }; - let value = item['@value']; - const datatype = item['@type'] || null; - - // convert to XSD/JSON datatypes as appropriate - if(datatype === '@json') { - object.value = jsonCanonicalize(value); - object.datatype.value = RDF_JSON_LITERAL; - } else if(types.isBoolean(value)) { - object.value = value.toString(); - object.datatype.value = datatype || XSD_BOOLEAN; - } else if(types.isDouble(value) || datatype === XSD_DOUBLE) { - if(!types.isDouble(value)) { - value = parseFloat(value); - } - // canonical double representation - object.value = value.toExponential(15).replace(/(\d)0*e\+?/, '$1E'); - object.datatype.value = datatype || XSD_DOUBLE; - } else if(types.isNumber(value)) { - object.value = value.toFixed(0); - object.datatype.value = datatype || XSD_INTEGER; - } else if(rdfDirection === 'i18n-datatype' && - '@direction' in item) { - const datatype = 'https://www.w3.org/ns/i18n#' + - (item['@language'] || '') + - `_${item['@direction']}`; - object.datatype.value = datatype; - object.value = value; - } else if('@language' in item) { - object.value = value; - object.datatype.value = datatype || RDF_LANGSTRING; - object.language = item['@language']; - } else { - object.value = value; - object.datatype.value = datatype || XSD_STRING; - } - } else if(graphTypes.isList(item)) { - const _list = - _listToRDF(item['@list'], issuer, dataset, graphTerm, rdfDirection); - object.termType = _list.termType; - object.value = _list.value; - } else { - // convert string/node object to RDF - const id = types.isObject(item) ? item['@id'] : item; - object.termType = id.startsWith('_:') ? 'BlankNode' : 'NamedNode'; - object.value = id; - } - - // skip relative IRIs, not valid RDF - if(object.termType === 'NamedNode' && !_isAbsoluteIri(object.value)) { - return null; - } - - return object; -} - -},{"./constants":18,"./context":19,"./graphTypes":25,"./nodeMap":27,"./types":30,"./url":31,"./util":32,"canonicalize":7}],30:[function(require,module,exports){ -/* - * Copyright (c) 2017 Digital Bazaar, Inc. All rights reserved. - */ -'use strict'; - -const api = {}; -module.exports = api; - -/** - * Returns true if the given value is an Array. - * - * @param v the value to check. - * - * @return true if the value is an Array, false if not. - */ -api.isArray = Array.isArray; - -/** - * Returns true if the given value is a Boolean. - * - * @param v the value to check. - * - * @return true if the value is a Boolean, false if not. - */ -api.isBoolean = v => (typeof v === 'boolean' || - Object.prototype.toString.call(v) === '[object Boolean]'); - -/** - * Returns true if the given value is a double. - * - * @param v the value to check. - * - * @return true if the value is a double, false if not. - */ -api.isDouble = v => api.isNumber(v) && - (String(v).indexOf('.') !== -1 || Math.abs(v) >= 1e21); - -/** - * Returns true if the given value is an empty Object. - * - * @param v the value to check. - * - * @return true if the value is an empty Object, false if not. - */ -api.isEmptyObject = v => api.isObject(v) && Object.keys(v).length === 0; - -/** - * Returns true if the given value is a Number. - * - * @param v the value to check. - * - * @return true if the value is a Number, false if not. - */ -api.isNumber = v => (typeof v === 'number' || - Object.prototype.toString.call(v) === '[object Number]'); - -/** - * Returns true if the given value is numeric. - * - * @param v the value to check. - * - * @return true if the value is numeric, false if not. - */ -api.isNumeric = v => !isNaN(parseFloat(v)) && isFinite(v); - -/** - * Returns true if the given value is an Object. - * - * @param v the value to check. - * - * @return true if the value is an Object, false if not. - */ -api.isObject = v => Object.prototype.toString.call(v) === '[object Object]'; - -/** - * Returns true if the given value is a String. - * - * @param v the value to check. - * - * @return true if the value is a String, false if not. - */ -api.isString = v => (typeof v === 'string' || - Object.prototype.toString.call(v) === '[object String]'); - -/** - * Returns true if the given value is undefined. - * - * @param v the value to check. - * - * @return true if the value is undefined, false if not. - */ -api.isUndefined = v => typeof v === 'undefined'; - -},{}],31:[function(require,module,exports){ -/* - * Copyright (c) 2017 Digital Bazaar, Inc. All rights reserved. - */ -'use strict'; - -const types = require('./types'); - -const api = {}; -module.exports = api; - -// define URL parser -// parseUri 1.2.2 -// (c) Steven Levithan -// MIT License -// with local jsonld.js modifications -api.parsers = { - simple: { - // RFC 3986 basic parts - keys: [ - 'href', 'scheme', 'authority', 'path', 'query', 'fragment' - ], - /* eslint-disable-next-line max-len */ - regex: /^(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?/ - }, - full: { - keys: [ - 'href', 'protocol', 'scheme', 'authority', 'auth', 'user', 'password', - 'hostname', 'port', 'path', 'directory', 'file', 'query', 'fragment' - ], - /* eslint-disable-next-line max-len */ - regex: /^(([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?(?:(((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/ - } -}; -api.parse = (str, parser) => { - const parsed = {}; - const o = api.parsers[parser || 'full']; - const m = o.regex.exec(str); - let i = o.keys.length; - while(i--) { - parsed[o.keys[i]] = (m[i] === undefined) ? null : m[i]; - } - - // remove default ports in found in URLs - if((parsed.scheme === 'https' && parsed.port === '443') || - (parsed.scheme === 'http' && parsed.port === '80')) { - parsed.href = parsed.href.replace(':' + parsed.port, ''); - parsed.authority = parsed.authority.replace(':' + parsed.port, ''); - parsed.port = null; - } - - parsed.normalizedPath = api.removeDotSegments(parsed.path); - return parsed; -}; - -/** - * Prepends a base IRI to the given relative IRI. - * - * @param base the base IRI. - * @param iri the relative IRI. - * - * @return the absolute IRI. - */ -api.prependBase = (base, iri) => { - // skip IRI processing - if(base === null) { - return iri; - } - // already an absolute IRI - if(api.isAbsolute(iri)) { - return iri; - } - - // parse base if it is a string - if(!base || types.isString(base)) { - base = api.parse(base || ''); - } - - // parse given IRI - const rel = api.parse(iri); - - // per RFC3986 5.2.2 - const transform = { - protocol: base.protocol || '' - }; - - if(rel.authority !== null) { - transform.authority = rel.authority; - transform.path = rel.path; - transform.query = rel.query; - } else { - transform.authority = base.authority; - - if(rel.path === '') { - transform.path = base.path; - if(rel.query !== null) { - transform.query = rel.query; - } else { - transform.query = base.query; - } - } else { - if(rel.path.indexOf('/') === 0) { - // IRI represents an absolute path - transform.path = rel.path; - } else { - // merge paths - let path = base.path; - - // append relative path to the end of the last directory from base - path = path.substr(0, path.lastIndexOf('/') + 1); - if((path.length > 0 || base.authority) && path.substr(-1) !== '/') { - path += '/'; - } - path += rel.path; - - transform.path = path; - } - transform.query = rel.query; - } - } - - if(rel.path !== '') { - // remove slashes and dots in path - transform.path = api.removeDotSegments(transform.path); - } - - // construct URL - let rval = transform.protocol; - if(transform.authority !== null) { - rval += '//' + transform.authority; - } - rval += transform.path; - if(transform.query !== null) { - rval += '?' + transform.query; - } - if(rel.fragment !== null) { - rval += '#' + rel.fragment; - } - - // handle empty base - if(rval === '') { - rval = './'; - } - - return rval; -}; - -/** - * Removes a base IRI from the given absolute IRI. - * - * @param base the base IRI. - * @param iri the absolute IRI. - * - * @return the relative IRI if relative to base, otherwise the absolute IRI. - */ -api.removeBase = (base, iri) => { - // skip IRI processing - if(base === null) { - return iri; - } - - if(!base || types.isString(base)) { - base = api.parse(base || ''); - } - - // establish base root - let root = ''; - if(base.href !== '') { - root += (base.protocol || '') + '//' + (base.authority || ''); - } else if(iri.indexOf('//')) { - // support network-path reference with empty base - root += '//'; - } - - // IRI not relative to base - if(iri.indexOf(root) !== 0) { - return iri; - } - - // remove root from IRI and parse remainder - const rel = api.parse(iri.substr(root.length)); - - // remove path segments that match (do not remove last segment unless there - // is a hash or query) - const baseSegments = base.normalizedPath.split('/'); - const iriSegments = rel.normalizedPath.split('/'); - const last = (rel.fragment || rel.query) ? 0 : 1; - while(baseSegments.length > 0 && iriSegments.length > last) { - if(baseSegments[0] !== iriSegments[0]) { - break; - } - baseSegments.shift(); - iriSegments.shift(); - } - - // use '../' for each non-matching base segment - let rval = ''; - if(baseSegments.length > 0) { - // don't count the last segment (if it ends with '/' last path doesn't - // count and if it doesn't end with '/' it isn't a path) - baseSegments.pop(); - for(let i = 0; i < baseSegments.length; ++i) { - rval += '../'; - } - } - - // prepend remaining segments - rval += iriSegments.join('/'); - - // add query and hash - if(rel.query !== null) { - rval += '?' + rel.query; - } - if(rel.fragment !== null) { - rval += '#' + rel.fragment; - } - - // handle empty base - if(rval === '') { - rval = './'; - } - - return rval; -}; - -/** - * Removes dot segments from a URL path. - * - * @param path the path to remove dot segments from. - */ -api.removeDotSegments = path => { - // RFC 3986 5.2.4 (reworked) - - // empty path shortcut - if(path.length === 0) { - return ''; - } - - const input = path.split('/'); - const output = []; - - while(input.length > 0) { - const next = input.shift(); - const done = input.length === 0; - - if(next === '.') { - if(done) { - // ensure output has trailing / - output.push(''); - } - continue; - } - - if(next === '..') { - output.pop(); - if(done) { - // ensure output has trailing / - output.push(''); - } - continue; - } - - output.push(next); - } - - // if path was absolute, ensure output has leading / - if(path[0] === '/' && output.length > 0 && output[0] !== '') { - output.unshift(''); - } - if(output.length === 1 && output[0] === '') { - return '/'; - } - - return output.join('/'); -}; - -// TODO: time better isAbsolute/isRelative checks using full regexes: -// http://jmrware.com/articles/2009/uri_regexp/URI_regex.html - -// regex to check for absolute IRI (starting scheme and ':') or blank node IRI -const isAbsoluteRegex = /^([A-Za-z][A-Za-z0-9+-.]*|_):[^\s]*$/; - -/** - * Returns true if the given value is an absolute IRI or blank node IRI, false - * if not. - * Note: This weak check only checks for a correct starting scheme. - * - * @param v the value to check. - * - * @return true if the value is an absolute IRI, false if not. - */ -api.isAbsolute = v => types.isString(v) && isAbsoluteRegex.test(v); - -/** - * Returns true if the given value is a relative IRI, false if not. - * Note: this is a weak check. - * - * @param v the value to check. - * - * @return true if the value is a relative IRI, false if not. - */ -api.isRelative = v => types.isString(v); - -},{"./types":30}],32:[function(require,module,exports){ -/* - * Copyright (c) 2017-2019 Digital Bazaar, Inc. All rights reserved. - */ -'use strict'; - -const graphTypes = require('./graphTypes'); -const types = require('./types'); -// TODO: move `IdentifierIssuer` to its own package -const IdentifierIssuer = require('rdf-canonize').IdentifierIssuer; -const JsonLdError = require('./JsonLdError'); - -// constants -const REGEX_LINK_HEADERS = /(?:<[^>]*?>|"[^"]*?"|[^,])+/g; -const REGEX_LINK_HEADER = /\s*<([^>]*?)>\s*(?:;\s*(.*))?/; -const REGEX_LINK_HEADER_PARAMS = - /(.*?)=(?:(?:"([^"]*?)")|([^"]*?))\s*(?:(?:;\s*)|$)/g; - -const DEFAULTS = { - headers: { - accept: 'application/ld+json, application/json' - } -}; - -const api = {}; -module.exports = api; -api.IdentifierIssuer = IdentifierIssuer; - -/** - * Clones an object, array, Map, Set, or string/number. If a typed JavaScript - * object is given, such as a Date, it will be converted to a string. - * - * @param value the value to clone. - * - * @return the cloned value. - */ -api.clone = function(value) { - if(value && typeof value === 'object') { - let rval; - if(types.isArray(value)) { - rval = []; - for(let i = 0; i < value.length; ++i) { - rval[i] = api.clone(value[i]); - } - } else if(value instanceof Map) { - rval = new Map(); - for(const [k, v] of value) { - rval.set(k, api.clone(v)); - } - } else if(value instanceof Set) { - rval = new Set(); - for(const v of value) { - rval.add(api.clone(v)); - } - } else if(types.isObject(value)) { - rval = {}; - for(const key in value) { - rval[key] = api.clone(value[key]); - } - } else { - rval = value.toString(); - } - return rval; - } - return value; -}; - -/** - * Ensure a value is an array. If the value is an array, it is returned. - * Otherwise, it is wrapped in an array. - * - * @param value the value to return as an array. - * - * @return the value as an array. - */ -api.asArray = function(value) { - return Array.isArray(value) ? value : [value]; -}; - -/** - * Builds an HTTP headers object for making a JSON-LD request from custom - * headers and asserts the `accept` header isn't overridden. - * - * @param headers an object of headers with keys as header names and values - * as header values. - * - * @return an object of headers with a valid `accept` header. - */ -api.buildHeaders = (headers = {}) => { - const hasAccept = Object.keys(headers).some( - h => h.toLowerCase() === 'accept'); - - if(hasAccept) { - throw new RangeError( - 'Accept header may not be specified; only "' + - DEFAULTS.headers.accept + '" is supported.'); - } - - return Object.assign({Accept: DEFAULTS.headers.accept}, headers); -}; - -/** - * Parses a link header. The results will be key'd by the value of "rel". - * - * Link: ; - * rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json" - * - * Parses as: { - * 'http://www.w3.org/ns/json-ld#context': { - * target: http://json-ld.org/contexts/person.jsonld, - * type: 'application/ld+json' - * } - * } - * - * If there is more than one "rel" with the same IRI, then entries in the - * resulting map for that "rel" will be arrays. - * - * @param header the link header to parse. - */ -api.parseLinkHeader = header => { - const rval = {}; - // split on unbracketed/unquoted commas - const entries = header.match(REGEX_LINK_HEADERS); - for(let i = 0; i < entries.length; ++i) { - let match = entries[i].match(REGEX_LINK_HEADER); - if(!match) { - continue; - } - const result = {target: match[1]}; - const params = match[2]; - while((match = REGEX_LINK_HEADER_PARAMS.exec(params))) { - result[match[1]] = (match[2] === undefined) ? match[3] : match[2]; - } - const rel = result['rel'] || ''; - if(Array.isArray(rval[rel])) { - rval[rel].push(result); - } else if(rval.hasOwnProperty(rel)) { - rval[rel] = [rval[rel], result]; - } else { - rval[rel] = result; - } - } - return rval; -}; - -/** - * Throws an exception if the given value is not a valid @type value. - * - * @param v the value to check. - */ -api.validateTypeValue = (v, isFrame) => { - if(types.isString(v)) { - return; - } - - if(types.isArray(v) && v.every(vv => types.isString(vv))) { - return; - } - if(isFrame && types.isObject(v)) { - switch(Object.keys(v).length) { - case 0: - // empty object is wildcard - return; - case 1: - // default entry is all strings - if('@default' in v && - api.asArray(v['@default']).every(vv => types.isString(vv))) { - return; - } - } - } - - throw new JsonLdError( - '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: v}); -}; - -/** - * Returns true if the given subject has the given property. - * - * @param subject the subject to check. - * @param property the property to look for. - * - * @return true if the subject has the given property, false if not. - */ -api.hasProperty = (subject, property) => { - if(subject.hasOwnProperty(property)) { - const value = subject[property]; - return (!types.isArray(value) || value.length > 0); - } - return false; -}; - -/** - * Determines if the given value is a property of the given subject. - * - * @param subject the subject to check. - * @param property the property to check. - * @param value the value to check. - * - * @return true if the value exists, false if not. - */ -api.hasValue = (subject, property, value) => { - if(api.hasProperty(subject, property)) { - let val = subject[property]; - const isList = graphTypes.isList(val); - if(types.isArray(val) || isList) { - if(isList) { - val = val['@list']; - } - for(let i = 0; i < val.length; ++i) { - if(api.compareValues(value, val[i])) { - return true; - } - } - } else if(!types.isArray(value)) { - // avoid matching the set of values with an array value parameter - return api.compareValues(value, val); - } - } - return false; -}; - -/** - * Adds a value to a subject. If the value is an array, all values in the - * array will be added. - * - * @param subject the subject to add the value to. - * @param property the property that relates the value to the subject. - * @param value the value to add. - * @param [options] the options to use: - * [propertyIsArray] true if the property is always an array, false - * if not (default: false). - * [valueIsArray] true if the value to be added should be preserved as - * an array (lists) (default: false). - * [allowDuplicate] true to allow duplicates, false not to (uses a - * simple shallow comparison of subject ID or value) (default: true). - * [prependValue] false to prepend value to any existing values. - * (default: false) - */ -api.addValue = (subject, property, value, options) => { - options = options || {}; - if(!('propertyIsArray' in options)) { - options.propertyIsArray = false; - } - if(!('valueIsArray' in options)) { - options.valueIsArray = false; - } - if(!('allowDuplicate' in options)) { - options.allowDuplicate = true; - } - if(!('prependValue' in options)) { - options.prependValue = false; - } - - if(options.valueIsArray) { - subject[property] = value; - } else if(types.isArray(value)) { - if(value.length === 0 && options.propertyIsArray && - !subject.hasOwnProperty(property)) { - subject[property] = []; - } - if(options.prependValue) { - value = value.concat(subject[property]); - subject[property] = []; - } - for(let i = 0; i < value.length; ++i) { - api.addValue(subject, property, value[i], options); - } - } else if(subject.hasOwnProperty(property)) { - // check if subject already has value if duplicates not allowed - const hasValue = (!options.allowDuplicate && - api.hasValue(subject, property, value)); - - // make property an array if value not present or always an array - if(!types.isArray(subject[property]) && - (!hasValue || options.propertyIsArray)) { - subject[property] = [subject[property]]; - } - - // add new value - if(!hasValue) { - if(options.prependValue) { - subject[property].unshift(value); - } else { - subject[property].push(value); - } - } - } else { - // add new value as set or single value - subject[property] = options.propertyIsArray ? [value] : value; - } -}; - -/** - * Gets all of the values for a subject's property as an array. - * - * @param subject the subject. - * @param property the property. - * - * @return all of the values for a subject's property as an array. - */ -api.getValues = (subject, property) => [].concat(subject[property] || []); - -/** - * Removes a property from a subject. - * - * @param subject the subject. - * @param property the property. - */ -api.removeProperty = (subject, property) => { - delete subject[property]; -}; - -/** - * Removes a value from a subject. - * - * @param subject the subject. - * @param property the property that relates the value to the subject. - * @param value the value to remove. - * @param [options] the options to use: - * [propertyIsArray] true if the property is always an array, false - * if not (default: false). - */ -api.removeValue = (subject, property, value, options) => { - options = options || {}; - if(!('propertyIsArray' in options)) { - options.propertyIsArray = false; - } - - // filter out value - const values = api.getValues(subject, property).filter( - e => !api.compareValues(e, value)); - - if(values.length === 0) { - api.removeProperty(subject, property); - } else if(values.length === 1 && !options.propertyIsArray) { - subject[property] = values[0]; - } else { - subject[property] = values; - } -}; - -/** - * Relabels all blank nodes in the given JSON-LD input. - * - * @param input the JSON-LD input. - * @param [options] the options to use: - * [issuer] an IdentifierIssuer to use to label blank nodes. - */ -api.relabelBlankNodes = (input, options) => { - options = options || {}; - const issuer = options.issuer || new IdentifierIssuer('_:b'); - return _labelBlankNodes(issuer, input); -}; - -/** - * Compares two JSON-LD values for equality. Two JSON-LD values will be - * considered equal if: - * - * 1. They are both primitives of the same type and value. - * 2. They are both @values with the same @value, @type, @language, - * and @index, OR - * 3. They both have @ids they are the same. - * - * @param v1 the first value. - * @param v2 the second value. - * - * @return true if v1 and v2 are considered equal, false if not. - */ -api.compareValues = (v1, v2) => { - // 1. equal primitives - if(v1 === v2) { - return true; - } - - // 2. equal @values - if(graphTypes.isValue(v1) && graphTypes.isValue(v2) && - v1['@value'] === v2['@value'] && - v1['@type'] === v2['@type'] && - v1['@language'] === v2['@language'] && - v1['@index'] === v2['@index']) { - return true; - } - - // 3. equal @ids - if(types.isObject(v1) && - ('@id' in v1) && - types.isObject(v2) && - ('@id' in v2)) { - return v1['@id'] === v2['@id']; - } - - return false; -}; - -/** - * Compares two strings first based on length and then lexicographically. - * - * @param a the first string. - * @param b the second string. - * - * @return -1 if a < b, 1 if a > b, 0 if a === b. - */ -api.compareShortestLeast = (a, b) => { - if(a.length < b.length) { - return -1; - } - if(b.length < a.length) { - return 1; - } - if(a === b) { - return 0; - } - return (a < b) ? -1 : 1; -}; - -/** - * Labels the blank nodes in the given value using the given IdentifierIssuer. - * - * @param issuer the IdentifierIssuer to use. - * @param element the element with blank nodes to rename. - * - * @return the element. - */ -function _labelBlankNodes(issuer, element) { - if(types.isArray(element)) { - for(let i = 0; i < element.length; ++i) { - element[i] = _labelBlankNodes(issuer, element[i]); - } - } else if(graphTypes.isList(element)) { - element['@list'] = _labelBlankNodes(issuer, element['@list']); - } else if(types.isObject(element)) { - // relabel blank node - if(graphTypes.isBlankNode(element)) { - element['@id'] = issuer.getId(element['@id']); - } - - // recursively apply to all keys - const keys = Object.keys(element).sort(); - for(let ki = 0; ki < keys.length; ++ki) { - const key = keys[ki]; - if(key !== '@id') { - element[key] = _labelBlankNodes(issuer, element[key]); - } - } - } - - return element; -} - -},{"./JsonLdError":12,"./graphTypes":25,"./types":30,"rdf-canonize":46}],33:[function(require,module,exports){ -'use strict' - -// A linked list to keep track of recently-used-ness -const Yallist = require('yallist') - -const MAX = Symbol('max') -const LENGTH = Symbol('length') -const LENGTH_CALCULATOR = Symbol('lengthCalculator') -const ALLOW_STALE = Symbol('allowStale') -const MAX_AGE = Symbol('maxAge') -const DISPOSE = Symbol('dispose') -const NO_DISPOSE_ON_SET = Symbol('noDisposeOnSet') -const LRU_LIST = Symbol('lruList') -const CACHE = Symbol('cache') -const UPDATE_AGE_ON_GET = Symbol('updateAgeOnGet') - -const naiveLength = () => 1 - -// lruList is a yallist where the head is the youngest -// item, and the tail is the oldest. the list contains the Hit -// objects as the entries. -// Each Hit object has a reference to its Yallist.Node. This -// never changes. -// -// cache is a Map (or PseudoMap) that matches the keys to -// the Yallist.Node object. -class LRUCache { - constructor (options) { - if (typeof options === 'number') - options = { max: options } - - if (!options) - options = {} - - if (options.max && (typeof options.max !== 'number' || options.max < 0)) - throw new TypeError('max must be a non-negative number') - // Kind of weird to have a default max of Infinity, but oh well. - const max = this[MAX] = options.max || Infinity - - const lc = options.length || naiveLength - this[LENGTH_CALCULATOR] = (typeof lc !== 'function') ? naiveLength : lc - this[ALLOW_STALE] = options.stale || false - if (options.maxAge && typeof options.maxAge !== 'number') - throw new TypeError('maxAge must be a number') - this[MAX_AGE] = options.maxAge || 0 - this[DISPOSE] = options.dispose - this[NO_DISPOSE_ON_SET] = options.noDisposeOnSet || false - this[UPDATE_AGE_ON_GET] = options.updateAgeOnGet || false - this.reset() - } - - // resize the cache when the max changes. - set max (mL) { - if (typeof mL !== 'number' || mL < 0) - throw new TypeError('max must be a non-negative number') - - this[MAX] = mL || Infinity - trim(this) - } - get max () { - return this[MAX] - } - - set allowStale (allowStale) { - this[ALLOW_STALE] = !!allowStale - } - get allowStale () { - return this[ALLOW_STALE] - } - - set maxAge (mA) { - if (typeof mA !== 'number') - throw new TypeError('maxAge must be a non-negative number') - - this[MAX_AGE] = mA - trim(this) - } - get maxAge () { - return this[MAX_AGE] - } - - // resize the cache when the lengthCalculator changes. - set lengthCalculator (lC) { - if (typeof lC !== 'function') - lC = naiveLength - - if (lC !== this[LENGTH_CALCULATOR]) { - this[LENGTH_CALCULATOR] = lC - this[LENGTH] = 0 - this[LRU_LIST].forEach(hit => { - hit.length = this[LENGTH_CALCULATOR](hit.value, hit.key) - this[LENGTH] += hit.length - }) - } - trim(this) - } - get lengthCalculator () { return this[LENGTH_CALCULATOR] } - - get length () { return this[LENGTH] } - get itemCount () { return this[LRU_LIST].length } - - rforEach (fn, thisp) { - thisp = thisp || this - for (let walker = this[LRU_LIST].tail; walker !== null;) { - const prev = walker.prev - forEachStep(this, fn, walker, thisp) - walker = prev - } - } - - forEach (fn, thisp) { - thisp = thisp || this - for (let walker = this[LRU_LIST].head; walker !== null;) { - const next = walker.next - forEachStep(this, fn, walker, thisp) - walker = next - } - } - - keys () { - return this[LRU_LIST].toArray().map(k => k.key) - } - - values () { - return this[LRU_LIST].toArray().map(k => k.value) - } - - reset () { - if (this[DISPOSE] && - this[LRU_LIST] && - this[LRU_LIST].length) { - this[LRU_LIST].forEach(hit => this[DISPOSE](hit.key, hit.value)) - } - - this[CACHE] = new Map() // hash of items by key - this[LRU_LIST] = new Yallist() // list of items in order of use recency - this[LENGTH] = 0 // length of items in the list - } - - dump () { - return this[LRU_LIST].map(hit => - isStale(this, hit) ? false : { - k: hit.key, - v: hit.value, - e: hit.now + (hit.maxAge || 0) - }).toArray().filter(h => h) - } - - dumpLru () { - return this[LRU_LIST] - } - - set (key, value, maxAge) { - maxAge = maxAge || this[MAX_AGE] - - if (maxAge && typeof maxAge !== 'number') - throw new TypeError('maxAge must be a number') - - const now = maxAge ? Date.now() : 0 - const len = this[LENGTH_CALCULATOR](value, key) - - if (this[CACHE].has(key)) { - if (len > this[MAX]) { - del(this, this[CACHE].get(key)) - return false - } - - const node = this[CACHE].get(key) - const item = node.value - - // dispose of the old one before overwriting - // split out into 2 ifs for better coverage tracking - if (this[DISPOSE]) { - if (!this[NO_DISPOSE_ON_SET]) - this[DISPOSE](key, item.value) - } - - item.now = now - item.maxAge = maxAge - item.value = value - this[LENGTH] += len - item.length - item.length = len - this.get(key) - trim(this) - return true - } - - const hit = new Entry(key, value, len, now, maxAge) - - // oversized objects fall out of cache automatically. - if (hit.length > this[MAX]) { - if (this[DISPOSE]) - this[DISPOSE](key, value) - - return false - } - - this[LENGTH] += hit.length - this[LRU_LIST].unshift(hit) - this[CACHE].set(key, this[LRU_LIST].head) - trim(this) - return true - } - - has (key) { - if (!this[CACHE].has(key)) return false - const hit = this[CACHE].get(key).value - return !isStale(this, hit) - } - - get (key) { - return get(this, key, true) - } - - peek (key) { - return get(this, key, false) - } - - pop () { - const node = this[LRU_LIST].tail - if (!node) - return null - - del(this, node) - return node.value - } - - del (key) { - del(this, this[CACHE].get(key)) - } - - load (arr) { - // reset the cache - this.reset() - - const now = Date.now() - // A previous serialized cache has the most recent items first - for (let l = arr.length - 1; l >= 0; l--) { - const hit = arr[l] - const expiresAt = hit.e || 0 - if (expiresAt === 0) - // the item was created without expiration in a non aged cache - this.set(hit.k, hit.v) - else { - const maxAge = expiresAt - now - // dont add already expired items - if (maxAge > 0) { - this.set(hit.k, hit.v, maxAge) - } - } - } - } - - prune () { - this[CACHE].forEach((value, key) => get(this, key, false)) - } -} - -const get = (self, key, doUse) => { - const node = self[CACHE].get(key) - if (node) { - const hit = node.value - if (isStale(self, hit)) { - del(self, node) - if (!self[ALLOW_STALE]) - return undefined - } else { - if (doUse) { - if (self[UPDATE_AGE_ON_GET]) - node.value.now = Date.now() - self[LRU_LIST].unshiftNode(node) - } - } - return hit.value - } -} - -const isStale = (self, hit) => { - if (!hit || (!hit.maxAge && !self[MAX_AGE])) - return false - - const diff = Date.now() - hit.now - return hit.maxAge ? diff > hit.maxAge - : self[MAX_AGE] && (diff > self[MAX_AGE]) -} - -const trim = self => { - if (self[LENGTH] > self[MAX]) { - for (let walker = self[LRU_LIST].tail; - self[LENGTH] > self[MAX] && walker !== null;) { - // We know that we're about to delete this one, and also - // what the next least recently used key will be, so just - // go ahead and set it now. - const prev = walker.prev - del(self, walker) - walker = prev - } - } -} - -const del = (self, node) => { - if (node) { - const hit = node.value - if (self[DISPOSE]) - self[DISPOSE](hit.key, hit.value) - - self[LENGTH] -= hit.length - self[CACHE].delete(hit.key) - self[LRU_LIST].removeNode(node) - } -} - -class Entry { - constructor (key, value, length, now, maxAge) { - this.key = key - this.value = value - this.length = length - this.now = now - this.maxAge = maxAge || 0 - } -} - -const forEachStep = (self, fn, node, thisp) => { - let hit = node.value - if (isStale(self, hit)) { - del(self, node) - if (!self[ALLOW_STALE]) - hit = undefined - } - if (hit) - fn.call(thisp, hit.value, hit.key, self) -} - -module.exports = LRUCache - -},{"yallist":92}],34:[function(require,module,exports){ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; -const RDF = 'http://www.w3.org/1999/02/22-rdf-syntax-ns#', - XSD = 'http://www.w3.org/2001/XMLSchema#', - SWAP = 'http://www.w3.org/2000/10/swap/'; -var _default = { - xsd: { - decimal: `${XSD}decimal`, - boolean: `${XSD}boolean`, - double: `${XSD}double`, - integer: `${XSD}integer`, - string: `${XSD}string` - }, - rdf: { - type: `${RDF}type`, - nil: `${RDF}nil`, - first: `${RDF}first`, - rest: `${RDF}rest`, - langString: `${RDF}langString` - }, - owl: { - sameAs: 'http://www.w3.org/2002/07/owl#sameAs' - }, - r: { - forSome: `${SWAP}reify#forSome`, - forAll: `${SWAP}reify#forAll` - }, - log: { - implies: `${SWAP}log#implies` - } -}; -exports.default = _default; -},{}],35:[function(require,module,exports){ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = exports.Variable = exports.Triple = exports.Term = exports.Quad = exports.NamedNode = exports.Literal = exports.DefaultGraph = exports.BlankNode = void 0; -exports.escapeQuotes = escapeQuotes; -exports.termFromId = termFromId; -exports.termToId = termToId; -exports.unescapeQuotes = unescapeQuotes; - -var _IRIs = _interopRequireDefault(require("./IRIs")); - -var _N3Util = require("./N3Util"); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -// N3.js implementations of the RDF/JS core data types -// See https://github.com/rdfjs/representation-task-force/blob/master/interface-spec.md -const { - rdf, - xsd -} = _IRIs.default; // eslint-disable-next-line prefer-const - -let DEFAULTGRAPH; -let _blankNodeCounter = 0; -const escapedLiteral = /^"(.*".*)(?="[^"]*$)/; -const quadId = /^<<("(?:""|[^"])*"[^ ]*|[^ ]+) ("(?:""|[^"])*"[^ ]*|[^ ]+) ("(?:""|[^"])*"[^ ]*|[^ ]+) ?("(?:""|[^"])*"[^ ]*|[^ ]+)?>>$/; // ## DataFactory singleton - -const DataFactory = { - namedNode, - blankNode, - variable, - literal, - defaultGraph, - quad, - triple: quad -}; -var _default = DataFactory; // ## Term constructor - -exports.default = _default; - -class Term { - constructor(id) { - this.id = id; - } // ### The value of this term - - - get value() { - return this.id; - } // ### Returns whether this object represents the same term as the other - - - equals(other) { - // If both terms were created by this library, - // equality can be computed through ids - if (other instanceof Term) return this.id === other.id; // Otherwise, compare term type and value - - return !!other && this.termType === other.termType && this.value === other.value; - } // ### Implement hashCode for Immutable.js, since we implement `equals` - // https://immutable-js.com/docs/v4.0.0/ValueObject/#hashCode() - - - hashCode() { - return 0; - } // ### Returns a plain object representation of this term - - - toJSON() { - return { - termType: this.termType, - value: this.value - }; - } - -} // ## NamedNode constructor - - -exports.Term = Term; - -class NamedNode extends Term { - // ### The term type of this term - get termType() { - return 'NamedNode'; - } - -} // ## Literal constructor - - -exports.NamedNode = NamedNode; - -class Literal extends Term { - // ### The term type of this term - get termType() { - return 'Literal'; - } // ### The text value of this literal - - - get value() { - return this.id.substring(1, this.id.lastIndexOf('"')); - } // ### The language of this literal - - - get language() { - // Find the last quotation mark (e.g., '"abc"@en-us') - const id = this.id; - let atPos = id.lastIndexOf('"') + 1; // If "@" it follows, return the remaining substring; empty otherwise - - return atPos < id.length && id[atPos++] === '@' ? id.substr(atPos).toLowerCase() : ''; - } // ### The datatype IRI of this literal - - - get datatype() { - return new NamedNode(this.datatypeString); - } // ### The datatype string of this literal - - - get datatypeString() { - // Find the last quotation mark (e.g., '"abc"^^http://ex.org/types#t') - const id = this.id, - dtPos = id.lastIndexOf('"') + 1; - const char = dtPos < id.length ? id[dtPos] : ''; // If "^" it follows, return the remaining substring - - return char === '^' ? id.substr(dtPos + 2) : // If "@" follows, return rdf:langString; xsd:string otherwise - char !== '@' ? xsd.string : rdf.langString; - } // ### Returns whether this object represents the same term as the other - - - equals(other) { - // If both literals were created by this library, - // equality can be computed through ids - if (other instanceof Literal) return this.id === other.id; // Otherwise, compare term type, value, language, and datatype - - return !!other && !!other.datatype && this.termType === other.termType && this.value === other.value && this.language === other.language && this.datatype.value === other.datatype.value; - } - - toJSON() { - return { - termType: this.termType, - value: this.value, - language: this.language, - datatype: { - termType: 'NamedNode', - value: this.datatypeString - } - }; - } - -} // ## BlankNode constructor - - -exports.Literal = Literal; - -class BlankNode extends Term { - constructor(name) { - super(`_:${name}`); - } // ### The term type of this term - - - get termType() { - return 'BlankNode'; - } // ### The name of this blank node - - - get value() { - return this.id.substr(2); - } - -} - -exports.BlankNode = BlankNode; - -class Variable extends Term { - constructor(name) { - super(`?${name}`); - } // ### The term type of this term - - - get termType() { - return 'Variable'; - } // ### The name of this variable - - - get value() { - return this.id.substr(1); - } - -} // ## DefaultGraph constructor - - -exports.Variable = Variable; - -class DefaultGraph extends Term { - constructor() { - super(''); - return DEFAULTGRAPH || this; - } // ### The term type of this term - - - get termType() { - return 'DefaultGraph'; - } // ### Returns whether this object represents the same term as the other - - - equals(other) { - // If both terms were created by this library, - // equality can be computed through strict equality; - // otherwise, compare term types. - return this === other || !!other && this.termType === other.termType; - } - -} // ## DefaultGraph singleton - - -exports.DefaultGraph = DefaultGraph; -DEFAULTGRAPH = new DefaultGraph(); // ### Constructs a term from the given internal string ID - -function termFromId(id, factory) { - factory = factory || DataFactory; // Falsy value or empty string indicate the default graph - - if (!id) return factory.defaultGraph(); // Identify the term type based on the first character - - switch (id[0]) { - case '?': - return factory.variable(id.substr(1)); - - case '_': - return factory.blankNode(id.substr(2)); - - case '"': - // Shortcut for internal literals - if (factory === DataFactory) return new Literal(id); // Literal without datatype or language - - if (id[id.length - 1] === '"') return factory.literal(id.substr(1, id.length - 2)); // Literal with datatype or language - - const endPos = id.lastIndexOf('"', id.length - 1); - return factory.literal(id.substr(1, endPos - 1), id[endPos + 1] === '@' ? id.substr(endPos + 2) : factory.namedNode(id.substr(endPos + 3))); - - case '<': - const components = quadId.exec(id); - return factory.quad(termFromId(unescapeQuotes(components[1]), factory), termFromId(unescapeQuotes(components[2]), factory), termFromId(unescapeQuotes(components[3]), factory), components[4] && termFromId(unescapeQuotes(components[4]), factory)); - - default: - return factory.namedNode(id); - } -} // ### Constructs an internal string ID from the given term or ID string - - -function termToId(term) { - if (typeof term === 'string') return term; - if (term instanceof Term && term.termType !== 'Quad') return term.id; - if (!term) return DEFAULTGRAPH.id; // Term instantiated with another library - - switch (term.termType) { - case 'NamedNode': - return term.value; - - case 'BlankNode': - return `_:${term.value}`; - - case 'Variable': - return `?${term.value}`; - - case 'DefaultGraph': - return ''; - - case 'Literal': - return `"${term.value}"${term.language ? `@${term.language}` : term.datatype && term.datatype.value !== xsd.string ? `^^${term.datatype.value}` : ''}`; - - case 'Quad': - // To identify RDF* quad components, we escape quotes by doubling them. - // This avoids the overhead of backslash parsing of Turtle-like syntaxes. - return `<<${escapeQuotes(termToId(term.subject))} ${escapeQuotes(termToId(term.predicate))} ${escapeQuotes(termToId(term.object))}${(0, _N3Util.isDefaultGraph)(term.graph) ? '' : ` ${termToId(term.graph)}`}>>`; - - default: - throw new Error(`Unexpected termType: ${term.termType}`); - } -} // ## Quad constructor - - -class Quad extends Term { - constructor(subject, predicate, object, graph) { - super(''); - this._subject = subject; - this._predicate = predicate; - this._object = object; - this._graph = graph || DEFAULTGRAPH; - } // ### The term type of this term - - - get termType() { - return 'Quad'; - } - - get subject() { - return this._subject; - } - - get predicate() { - return this._predicate; - } - - get object() { - return this._object; - } - - get graph() { - return this._graph; - } // ### Returns a plain object representation of this quad - - - toJSON() { - return { - termType: this.termType, - subject: this._subject.toJSON(), - predicate: this._predicate.toJSON(), - object: this._object.toJSON(), - graph: this._graph.toJSON() - }; - } // ### Returns whether this object represents the same quad as the other - - - equals(other) { - return !!other && this._subject.equals(other.subject) && this._predicate.equals(other.predicate) && this._object.equals(other.object) && this._graph.equals(other.graph); - } - -} - -exports.Triple = exports.Quad = Quad; - -// ### Escapes the quotes within the given literal -function escapeQuotes(id) { - return id.replace(escapedLiteral, (_, quoted) => `"${quoted.replace(/"/g, '""')}`); -} // ### Unescapes the quotes within the given literal - - -function unescapeQuotes(id) { - return id.replace(escapedLiteral, (_, quoted) => `"${quoted.replace(/""/g, '"')}`); -} // ### Creates an IRI - - -function namedNode(iri) { - return new NamedNode(iri); -} // ### Creates a blank node - - -function blankNode(name) { - return new BlankNode(name || `n3-${_blankNodeCounter++}`); -} // ### Creates a literal - - -function literal(value, languageOrDataType) { - // Create a language-tagged string - if (typeof languageOrDataType === 'string') return new Literal(`"${value}"@${languageOrDataType.toLowerCase()}`); // Automatically determine datatype for booleans and numbers - - let datatype = languageOrDataType ? languageOrDataType.value : ''; - - if (datatype === '') { - // Convert a boolean - if (typeof value === 'boolean') datatype = xsd.boolean; // Convert an integer or double - else if (typeof value === 'number') { - if (Number.isFinite(value)) datatype = Number.isInteger(value) ? xsd.integer : xsd.double;else { - datatype = xsd.double; - if (!Number.isNaN(value)) value = value > 0 ? 'INF' : '-INF'; - } - } - } // Create a datatyped literal - - - return datatype === '' || datatype === xsd.string ? new Literal(`"${value}"`) : new Literal(`"${value}"^^${datatype}`); -} // ### Creates a variable - - -function variable(name) { - return new Variable(name); -} // ### Returns the default graph - - -function defaultGraph() { - return DEFAULTGRAPH; -} // ### Creates a quad - - -function quad(subject, predicate, object, graph) { - return new Quad(subject, predicate, object, graph); -} -},{"./IRIs":34,"./N3Util":41}],36:[function(require,module,exports){ -(function (Buffer){(function (){ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -var _IRIs = _interopRequireDefault(require("./IRIs")); - -var _queueMicrotask = _interopRequireDefault(require("queue-microtask")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -// **N3Lexer** tokenizes N3 documents. -const { - xsd -} = _IRIs.default; // Regular expression and replacement string to escape N3 strings - -const escapeSequence = /\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{8})|\\([^])/g; -const escapeReplacements = { - '\\': '\\', - "'": "'", - '"': '"', - 'n': '\n', - 'r': '\r', - 't': '\t', - 'f': '\f', - 'b': '\b', - '_': '_', - '~': '~', - '.': '.', - '-': '-', - '!': '!', - '$': '$', - '&': '&', - '(': '(', - ')': ')', - '*': '*', - '+': '+', - ',': ',', - ';': ';', - '=': '=', - '/': '/', - '?': '?', - '#': '#', - '@': '@', - '%': '%' -}; -const illegalIriChars = /[\x00-\x20<>\\"\{\}\|\^\`]/; -const lineModeRegExps = { - _iri: true, - _unescapedIri: true, - _simpleQuotedString: true, - _langcode: true, - _blank: true, - _newline: true, - _comment: true, - _whitespace: true, - _endOfFile: true -}; -const invalidRegExp = /$0^/; // ## Constructor - -class N3Lexer { - constructor(options) { - // ## Regular expressions - // It's slightly faster to have these as properties than as in-scope variables - this._iri = /^<((?:[^ <>{}\\]|\\[uU])+)>[ \t]*/; // IRI with escape sequences; needs sanity check after unescaping - - this._unescapedIri = /^<([^\x00-\x20<>\\"\{\}\|\^\`]*)>[ \t]*/; // IRI without escape sequences; no unescaping - - this._simpleQuotedString = /^"([^"\\\r\n]*)"(?=[^"])/; // string without escape sequences - - 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]*)?$/; - options = options || {}; // In line mode (N-Triples or N-Quads), only simple features may be parsed - - if (this._lineMode = !!options.lineMode) { - this._n3Mode = false; // Don't tokenize special literals - - for (const key in this) { - if (!(key in lineModeRegExps) && this[key] instanceof RegExp) this[key] = invalidRegExp; - } - } // When not in line mode, enable N3 functionality by default - else { - this._n3Mode = options.n3 !== false; - } // Don't output comment tokens by default - - - this._comments = !!options.comments; // Cache the last tested closing position of long literals - - this._literalClosingPos = 0; - } // ## Private methods - // ### `_tokenizeToEnd` tokenizes as for as possible, emitting tokens through the callback - - - _tokenizeToEnd(callback, inputFinished) { - // Continue parsing as far as possible; the loop will return eventually - let input = this._input; - let currentLineLength = input.length; - - while (true) { - // Count and skip whitespace lines - let whiteSpaceMatch, comment; - - while (whiteSpaceMatch = this._newline.exec(input)) { - // Try to find a comment - if (this._comments && (comment = this._comment.exec(whiteSpaceMatch[0]))) emitToken('comment', comment[1], '', this._line, whiteSpaceMatch[0].length); // Advance the input - - input = input.substr(whiteSpaceMatch[0].length, input.length); - currentLineLength = input.length; - this._line++; - } // Skip whitespace on current line - - - if (!whiteSpaceMatch && (whiteSpaceMatch = this._whitespace.exec(input))) input = input.substr(whiteSpaceMatch[0].length, input.length); // Stop for now if we're at the end - - if (this._endOfFile.test(input)) { - // If the input is finished, emit EOF - if (inputFinished) { - // Try to find a final comment - if (this._comments && (comment = this._comment.exec(input))) emitToken('comment', comment[1], '', this._line, input.length); - input = null; - emitToken('eof', '', '', this._line, 0); - } - - return this._input = input; - } // Look for specific token types based on the first character - - - const line = this._line, - firstChar = input[0]; - let type = '', - value = '', - prefix = '', - match = null, - matchLength = 0, - inconclusive = false; - - switch (firstChar) { - case '^': - // We need at least 3 tokens lookahead to distinguish ^^ and ^^pre:fixed - if (input.length < 3) break; // Try to match a type - else if (input[1] === '^') { - this._previousMarker = '^^'; // Move to type IRI or prefixed name - - input = input.substr(2); - - if (input[0] !== '<') { - inconclusive = true; - break; - } - } // If no type, it must be a path expression - else { - if (this._n3Mode) { - matchLength = 1; - type = '^'; - } - - break; - } - // Fall through in case the type is an IRI - - case '<': - // Try to find a full IRI without escape sequences - if (match = this._unescapedIri.exec(input)) type = 'IRI', value = match[1]; // Try to find a full IRI with escape sequences - else if (match = this._iri.exec(input)) { - value = this._unescape(match[1]); - if (value === null || illegalIriChars.test(value)) return reportSyntaxError(this); - type = 'IRI'; - } // Try to find a nested triple - else if (input.length > 1 && input[1] === '<') type = '<<', matchLength = 2; // Try to find a backwards implication arrow - else if (this._n3Mode && input.length > 1 && input[1] === '=') type = 'inverse', matchLength = 2, value = '>'; - break; - - case '>': - if (input.length > 1 && input[1] === '>') type = '>>', matchLength = 2; - break; - - case '_': - // Try to find a blank node. Since it can contain (but not end with) a dot, - // we always need a non-dot character before deciding it is a blank node. - // Therefore, try inserting a space if we're at the end of the input. - if ((match = this._blank.exec(input)) || inputFinished && (match = this._blank.exec(`${input} `))) type = 'blank', prefix = '_', value = match[1]; - break; - - case '"': - // Try to find a literal without escape sequences - if (match = this._simpleQuotedString.exec(input)) value = match[1]; // Try to find a literal wrapped in three pairs of quotes - else { - ({ - value, - matchLength - } = this._parseLiteral(input)); - if (value === null) return reportSyntaxError(this); - } - - if (match !== null || matchLength !== 0) { - type = 'literal'; - this._literalClosingPos = 0; - } - - break; - - case "'": - if (!this._lineMode) { - // Try to find a literal without escape sequences - if (match = this._simpleApostropheString.exec(input)) value = match[1]; // Try to find a literal wrapped in three pairs of quotes - else { - ({ - value, - matchLength - } = this._parseLiteral(input)); - if (value === null) return reportSyntaxError(this); - } - - if (match !== null || matchLength !== 0) { - type = 'literal'; - this._literalClosingPos = 0; - } - } - - break; - - case '?': - // Try to find a variable - if (this._n3Mode && (match = this._variable.exec(input))) type = 'var', value = match[0]; - break; - - case '@': - // Try to find a language code - if (this._previousMarker === 'literal' && (match = this._langcode.exec(input))) type = 'langcode', value = match[1]; // Try to find a keyword - else if (match = this._keyword.exec(input)) type = match[0]; - break; - - case '.': - // Try to find a dot as punctuation - if (input.length === 1 ? inputFinished : input[1] < '0' || input[1] > '9') { - type = '.'; - matchLength = 1; - break; - } - - // Fall through to numerical case (could be a decimal dot) - - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - case '+': - case '-': - // Try to find a number. Since it can contain (but not end with) a dot, - // we always need a non-dot character before deciding it is a number. - // Therefore, try inserting a space if we're at the end of the input. - if (match = this._number.exec(input) || inputFinished && (match = this._number.exec(`${input} `))) { - type = 'literal', value = match[0]; - prefix = typeof match[1] === 'string' ? xsd.double : typeof match[2] === 'string' ? xsd.decimal : xsd.integer; - } - - break; - - case 'B': - case 'b': - case 'p': - case 'P': - case 'G': - case 'g': - // Try to find a SPARQL-style keyword - if (match = this._sparqlKeyword.exec(input)) type = match[0].toUpperCase();else inconclusive = true; - break; - - case 'f': - case 't': - // Try to match a boolean - if (match = this._boolean.exec(input)) type = 'literal', value = match[0], prefix = xsd.boolean;else inconclusive = true; - break; - - case 'a': - // Try to find an abbreviated predicate - if (match = this._shortPredicates.exec(input)) type = 'abbreviation', value = 'a';else inconclusive = true; - break; - - case '=': - // Try to find an implication arrow or equals sign - if (this._n3Mode && input.length > 1) { - type = 'abbreviation'; - if (input[1] !== '>') matchLength = 1, value = '=';else matchLength = 2, value = '>'; - } - - break; - - case '!': - if (!this._n3Mode) break; - - case ',': - case ';': - case '[': - case ']': - case '(': - case ')': - case '{': - case '}': - if (!this._lineMode) { - matchLength = 1; - type = firstChar; - } - - break; - - default: - inconclusive = true; - } // Some first characters do not allow an immediate decision, so inspect more - - - if (inconclusive) { - // Try to find a prefix - if ((this._previousMarker === '@prefix' || this._previousMarker === 'PREFIX') && (match = this._prefix.exec(input))) type = 'prefix', value = match[1] || ''; // Try to find a prefixed name. Since it can contain (but not end with) a dot, - // we always need a non-dot character before deciding it is a prefixed name. - // Therefore, try inserting a space if we're at the end of the input. - else if ((match = this._prefixed.exec(input)) || inputFinished && (match = this._prefixed.exec(`${input} `))) type = 'prefixed', prefix = match[1] || '', value = this._unescape(match[2]); - } // A type token is special: it can only be emitted after an IRI or prefixed name is read - - - if (this._previousMarker === '^^') { - switch (type) { - case 'prefixed': - type = 'type'; - break; - - case 'IRI': - type = 'typeIRI'; - break; - - default: - type = ''; - } - } // What if nothing of the above was found? - - - if (!type) { - // We could be in streaming mode, and then we just wait for more input to arrive. - // Otherwise, a syntax error has occurred in the input. - // One exception: error on an unaccounted linebreak (= not inside a triple-quoted literal). - if (inputFinished || !/^'''|^"""/.test(input) && /\n|\r/.test(input)) return reportSyntaxError(this);else return this._input = input; - } // Emit the parsed token - - - const length = matchLength || match[0].length; - const token = emitToken(type, value, prefix, line, length); - this.previousToken = token; - this._previousMarker = type; // Advance to next part to tokenize - - input = input.substr(length, input.length); - } // Emits the token through the callback - - - function emitToken(type, value, prefix, line, length) { - const start = input ? currentLineLength - input.length : currentLineLength; - const end = start + length; - const token = { - type, - value, - prefix, - line, - start, - end - }; - callback(null, token); - return token; - } // Signals the syntax error through the callback - - - function reportSyntaxError(self) { - callback(self._syntaxError(/^\S*/.exec(input)[0])); - } - } // ### `_unescape` replaces N3 escape codes by their corresponding characters - - - _unescape(item) { - let invalid = false; - const replaced = item.replace(escapeSequence, (sequence, unicode4, unicode8, escapedChar) => { - // 4-digit unicode character - if (typeof unicode4 === 'string') return String.fromCharCode(Number.parseInt(unicode4, 16)); // 8-digit unicode character - - if (typeof unicode8 === 'string') { - let charCode = Number.parseInt(unicode8, 16); - return charCode <= 0xFFFF ? String.fromCharCode(Number.parseInt(unicode8, 16)) : String.fromCharCode(0xD800 + ((charCode -= 0x10000) >> 10), 0xDC00 + (charCode & 0x3FF)); - } // fixed escape sequence - - - if (escapedChar in escapeReplacements) return escapeReplacements[escapedChar]; // invalid escape sequence - - invalid = true; - return ''; - }); - return invalid ? null : replaced; - } // ### `_parseLiteral` parses a literal into an unescaped value - - - _parseLiteral(input) { - // Ensure we have enough lookahead to identify triple-quoted strings - if (input.length >= 3) { - // Identify the opening quote(s) - const opening = input.match(/^(?:"""|"|'''|'|)/)[0]; - const openingLength = opening.length; // Find the next candidate closing quotes - - let closingPos = Math.max(this._literalClosingPos, openingLength); - - while ((closingPos = input.indexOf(opening, closingPos)) > 0) { - // Count backslashes right before the closing quotes - let backslashCount = 0; - - while (input[closingPos - backslashCount - 1] === '\\') backslashCount++; // An even number of backslashes (in particular 0) - // means these are actual, non-escaped closing quotes - - - if (backslashCount % 2 === 0) { - // Extract and unescape the value - const raw = input.substring(openingLength, closingPos); - const lines = raw.split(/\r\n|\r|\n/).length - 1; - const matchLength = closingPos + openingLength; // Only triple-quoted strings can be multi-line - - if (openingLength === 1 && lines !== 0 || openingLength === 3 && this._lineMode) break; - this._line += lines; - return { - value: this._unescape(raw), - matchLength - }; - } - - closingPos++; - } - - this._literalClosingPos = input.length - openingLength + 1; - } - - return { - value: '', - matchLength: 0 - }; - } // ### `_syntaxError` creates a syntax error for the given issue - - - _syntaxError(issue) { - this._input = null; - const err = new Error(`Unexpected "${issue}" on line ${this._line}.`); - err.context = { - token: undefined, - line: this._line, - previousToken: this.previousToken - }; - return err; - } // ### Strips off any starting UTF BOM mark. - - - _readStartingBom(input) { - return input.startsWith('\ufeff') ? input.substr(1) : input; - } // ## Public methods - // ### `tokenize` starts the transformation of an N3 document into an array of tokens. - // The input can be a string or a stream. - - - tokenize(input, callback) { - this._line = 1; // If the input is a string, continuously emit tokens through the callback until the end - - if (typeof input === 'string') { - this._input = this._readStartingBom(input); // If a callback was passed, asynchronously call it - - if (typeof callback === 'function') (0, _queueMicrotask.default)(() => this._tokenizeToEnd(callback, true)); // If no callback was passed, tokenize synchronously and return - else { - const tokens = []; - let error; - - this._tokenizeToEnd((e, t) => e ? error = e : tokens.push(t), true); - - if (error) throw error; - return tokens; - } - } // Otherwise, the input must be a stream - else { - this._pendingBuffer = null; - if (typeof input.setEncoding === 'function') input.setEncoding('utf8'); // Adds the data chunk to the buffer and parses as far as possible - - input.on('data', data => { - if (this._input !== null && data.length !== 0) { - // Prepend any previous pending writes - if (this._pendingBuffer) { - data = Buffer.concat([this._pendingBuffer, data]); - this._pendingBuffer = null; - } // Hold if the buffer ends in an incomplete unicode sequence - - - if (data[data.length - 1] & 0x80) { - this._pendingBuffer = data; - } // Otherwise, tokenize as far as possible - else { - // Only read a BOM at the start - if (typeof this._input === 'undefined') this._input = this._readStartingBom(typeof data === 'string' ? data : data.toString());else this._input += data; - - this._tokenizeToEnd(callback, false); - } - } - }); // Parses until the end - - input.on('end', () => { - if (typeof this._input === 'string') this._tokenizeToEnd(callback, true); - }); - input.on('error', callback); - } - } - -} - -exports.default = N3Lexer; -}).call(this)}).call(this,require("buffer").Buffer) -},{"./IRIs":34,"buffer":6,"queue-microtask":45}],37:[function(require,module,exports){ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -var _N3Lexer = _interopRequireDefault(require("./N3Lexer")); - -var _N3DataFactory = _interopRequireDefault(require("./N3DataFactory")); - -var _IRIs = _interopRequireDefault(require("./IRIs")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -// **N3Parser** parses N3 documents. -let blankNodePrefix = 0; // ## Constructor - -class N3Parser { - constructor(options) { - this._contextStack = []; - this._graph = null; // Set the document IRI - - options = options || {}; - - this._setBase(options.baseIRI); - - options.factory && initDataFactory(this, options.factory); // Set supported features depending on the format - - const format = typeof options.format === 'string' ? options.format.match(/\w*$/)[0].toLowerCase() : '', - isTurtle = /turtle/.test(format), - isTriG = /trig/.test(format), - isNTriples = /triple/.test(format), - isNQuads = /quad/.test(format), - isN3 = this._n3Mode = /n3/.test(format), - isLineMode = isNTriples || isNQuads; - if (!(this._supportsNamedGraphs = !(isTurtle || isN3))) this._readPredicateOrNamedGraph = this._readPredicate; // Support triples in other graphs - - this._supportsQuads = !(isTurtle || isTriG || isNTriples || isN3); // Support nesting of triples - - this._supportsRDFStar = format === '' || /star|\*$/.test(format); // Disable relative IRIs in N-Triples or N-Quads mode - - if (isLineMode) this._resolveRelativeIRI = iri => { - return null; - }; - this._blankNodePrefix = typeof options.blankNodePrefix !== 'string' ? '' : options.blankNodePrefix.replace(/^(?!_:)/, '_:'); - this._lexer = options.lexer || new _N3Lexer.default({ - lineMode: isLineMode, - n3: isN3 - }); // Disable explicit quantifiers by default - - this._explicitQuantifiers = !!options.explicitQuantifiers; - } // ## Static class methods - // ### `_resetBlankNodePrefix` restarts blank node prefix identification - - - static _resetBlankNodePrefix() { - blankNodePrefix = 0; - } // ## Private methods - // ### `_setBase` sets the base IRI to resolve relative IRIs - - - _setBase(baseIRI) { - if (!baseIRI) { - this._base = ''; - this._basePath = ''; - } else { - // Remove fragment if present - const fragmentPos = baseIRI.indexOf('#'); - if (fragmentPos >= 0) baseIRI = baseIRI.substr(0, fragmentPos); // Set base IRI and its components - - this._base = baseIRI; - this._basePath = baseIRI.indexOf('/') < 0 ? baseIRI : baseIRI.replace(/[^\/?]*(?:\?.*)?$/, ''); - baseIRI = baseIRI.match(/^(?:([a-z][a-z0-9+.-]*:))?(?:\/\/[^\/]*)?/i); - this._baseRoot = baseIRI[0]; - this._baseScheme = baseIRI[1]; - } - } // ### `_saveContext` stores the current parsing context - // when entering a new scope (list, blank node, formula) - - - _saveContext(type, graph, subject, predicate, object) { - const n3Mode = this._n3Mode; - - this._contextStack.push({ - subject: subject, - predicate: predicate, - object: object, - graph: graph, - type: type, - inverse: n3Mode ? this._inversePredicate : false, - blankPrefix: n3Mode ? this._prefixes._ : '', - quantified: n3Mode ? this._quantified : null - }); // The settings below only apply to N3 streams - - - if (n3Mode) { - // Every new scope resets the predicate direction - this._inversePredicate = false; // In N3, blank nodes are scoped to a formula - // (using a dot as separator, as a blank node label cannot start with it) - - this._prefixes._ = this._graph ? `${this._graph.id.substr(2)}.` : '.'; // Quantifiers are scoped to a formula - - this._quantified = Object.create(this._quantified); - } - } // ### `_restoreContext` restores the parent context - // when leaving a scope (list, blank node, formula) - - - _restoreContext() { - const context = this._contextStack.pop(), - n3Mode = this._n3Mode; - - this._subject = context.subject; - this._predicate = context.predicate; - this._object = context.object; - this._graph = context.graph; // The settings below only apply to N3 streams - - if (n3Mode) { - this._inversePredicate = context.inverse; - this._prefixes._ = context.blankPrefix; - this._quantified = context.quantified; - } - } // ### `_readInTopContext` reads a token when in the top context - - - _readInTopContext(token) { - switch (token.type) { - // If an EOF token arrives in the top context, signal that we're done - case 'eof': - if (this._graph !== null) return this._error('Unclosed graph', token); - delete this._prefixes._; - return this._callback(null, null, this._prefixes); - // It could be a prefix declaration - - case 'PREFIX': - this._sparqlStyle = true; - - case '@prefix': - return this._readPrefix; - // It could be a base declaration - - case 'BASE': - this._sparqlStyle = true; - - case '@base': - return this._readBaseIRI; - // It could be a graph - - case '{': - if (this._supportsNamedGraphs) { - this._graph = ''; - this._subject = null; - return this._readSubject; - } - - case 'GRAPH': - if (this._supportsNamedGraphs) return this._readNamedGraphLabel; - // Otherwise, the next token must be a subject - - default: - return this._readSubject(token); - } - } // ### `_readEntity` reads an IRI, prefixed name, blank node, or variable - - - _readEntity(token, quantifier) { - let value; - - switch (token.type) { - // Read a relative or absolute IRI - case 'IRI': - case 'typeIRI': - const iri = this._resolveIRI(token.value); - - if (iri === null) return this._error('Invalid IRI', token); - value = this._namedNode(iri); - break; - // Read a prefixed name - - case 'type': - case 'prefixed': - const prefix = this._prefixes[token.prefix]; - if (prefix === undefined) return this._error(`Undefined prefix "${token.prefix}:"`, token); - value = this._namedNode(prefix + token.value); - break; - // Read a blank node - - case 'blank': - value = this._blankNode(this._prefixes[token.prefix] + token.value); - break; - // Read a variable - - case 'var': - value = this._variable(token.value.substr(1)); - break; - // Everything else is not an entity - - default: - return this._error(`Expected entity but got ${token.type}`, token); - } // In N3 mode, replace the entity if it is quantified - - - if (!quantifier && this._n3Mode && value.id in this._quantified) value = this._quantified[value.id]; - return value; - } // ### `_readSubject` reads a quad's subject - - - _readSubject(token) { - this._predicate = null; - - switch (token.type) { - case '[': - // Start a new quad with a new blank node as subject - this._saveContext('blank', this._graph, this._subject = this._blankNode(), null, null); - - return this._readBlankNodeHead; - - case '(': - // Start a new list - this._saveContext('list', this._graph, this.RDF_NIL, null, null); - - this._subject = null; - return this._readListItem; - - case '{': - // Start a new formula - if (!this._n3Mode) return this._error('Unexpected graph', token); - - this._saveContext('formula', this._graph, this._graph = this._blankNode(), null, null); - - return this._readSubject; - - case '}': - // No subject; the graph in which we are reading is closed instead - return this._readPunctuation(token); - - case '@forSome': - if (!this._n3Mode) return this._error('Unexpected "@forSome"', token); - this._subject = null; - this._predicate = this.N3_FORSOME; - this._quantifier = this._blankNode; - return this._readQuantifierList; - - case '@forAll': - if (!this._n3Mode) return this._error('Unexpected "@forAll"', token); - this._subject = null; - this._predicate = this.N3_FORALL; - this._quantifier = this._variable; - return this._readQuantifierList; - - case 'literal': - if (!this._n3Mode) return this._error('Unexpected literal', token); - - if (token.prefix.length === 0) { - this._literalValue = token.value; - return this._completeSubjectLiteral; - } else this._subject = this._literal(token.value, this._namedNode(token.prefix)); - - break; - - case '<<': - if (!this._supportsRDFStar) return this._error('Unexpected RDF* syntax', token); - - this._saveContext('<<', this._graph, null, null, null); - - this._graph = null; - return this._readSubject; - - default: - // Read the subject entity - if ((this._subject = this._readEntity(token)) === undefined) return; // In N3 mode, the subject might be a path - - if (this._n3Mode) return this._getPathReader(this._readPredicateOrNamedGraph); - } // The next token must be a predicate, - // or, if the subject was actually a graph IRI, a named graph - - - return this._readPredicateOrNamedGraph; - } // ### `_readPredicate` reads a quad's predicate - - - _readPredicate(token) { - const type = token.type; - - switch (type) { - case 'inverse': - this._inversePredicate = true; - - case 'abbreviation': - this._predicate = this.ABBREVIATIONS[token.value]; - break; - - case '.': - case ']': - case '}': - // Expected predicate didn't come, must have been trailing semicolon - if (this._predicate === null) return this._error(`Unexpected ${type}`, token); - this._subject = null; - return type === ']' ? this._readBlankNodeTail(token) : this._readPunctuation(token); - - case ';': - // Additional semicolons can be safely ignored - return this._predicate !== null ? this._readPredicate : this._error('Expected predicate but got ;', token); - - case '[': - if (this._n3Mode) { - // Start a new quad with a new blank node as subject - this._saveContext('blank', this._graph, this._subject, this._subject = this._blankNode(), null); - - return this._readBlankNodeHead; - } - - case 'blank': - if (!this._n3Mode) return this._error('Disallowed blank node as predicate', token); - - default: - if ((this._predicate = this._readEntity(token)) === undefined) return; - } // The next token must be an object - - - return this._readObject; - } // ### `_readObject` reads a quad's object - - - _readObject(token) { - switch (token.type) { - case 'literal': - // Regular literal, can still get a datatype or language - if (token.prefix.length === 0) { - this._literalValue = token.value; - return this._readDataTypeOrLang; - } // Pre-datatyped string literal (prefix stores the datatype) - else this._object = this._literal(token.value, this._namedNode(token.prefix)); - - break; - - case '[': - // Start a new quad with a new blank node as subject - this._saveContext('blank', this._graph, this._subject, this._predicate, this._subject = this._blankNode()); - - return this._readBlankNodeHead; - - case '(': - // Start a new list - this._saveContext('list', this._graph, this._subject, this._predicate, this.RDF_NIL); - - this._subject = null; - return this._readListItem; - - case '{': - // Start a new formula - if (!this._n3Mode) return this._error('Unexpected graph', token); - - this._saveContext('formula', this._graph, this._subject, this._predicate, this._graph = this._blankNode()); - - return this._readSubject; - - case '<<': - if (!this._supportsRDFStar) return this._error('Unexpected RDF* syntax', token); - - this._saveContext('<<', this._graph, this._subject, this._predicate, null); - - this._graph = null; - return this._readSubject; - - default: - // Read the object entity - if ((this._object = this._readEntity(token)) === undefined) return; // In N3 mode, the object might be a path - - if (this._n3Mode) return this._getPathReader(this._getContextEndReader()); - } - - return this._getContextEndReader(); - } // ### `_readPredicateOrNamedGraph` reads a quad's predicate, or a named graph - - - _readPredicateOrNamedGraph(token) { - return token.type === '{' ? this._readGraph(token) : this._readPredicate(token); - } // ### `_readGraph` reads a graph - - - _readGraph(token) { - if (token.type !== '{') return this._error(`Expected graph but got ${token.type}`, token); // The "subject" we read is actually the GRAPH's label - - this._graph = this._subject, this._subject = null; - return this._readSubject; - } // ### `_readBlankNodeHead` reads the head of a blank node - - - _readBlankNodeHead(token) { - if (token.type === ']') { - this._subject = null; - return this._readBlankNodeTail(token); - } else { - this._predicate = null; - return this._readPredicate(token); - } - } // ### `_readBlankNodeTail` reads the end of a blank node - - - _readBlankNodeTail(token) { - if (token.type !== ']') return this._readBlankNodePunctuation(token); // Store blank node quad - - if (this._subject !== null) this._emit(this._subject, this._predicate, this._object, this._graph); // Restore the parent context containing this blank node - - const empty = this._predicate === null; - - this._restoreContext(); // If the blank node was the object, restore previous context and read punctuation - - - if (this._object !== null) return this._getContextEndReader(); // If the blank node was the predicate, continue reading the object - else if (this._predicate !== null) return this._readObject; // If the blank node was the subject, continue reading the predicate - else // If the blank node was empty, it could be a named graph label - return empty ? this._readPredicateOrNamedGraph : this._readPredicateAfterBlank; - } // ### `_readPredicateAfterBlank` reads a predicate after an anonymous blank node - - - _readPredicateAfterBlank(token) { - switch (token.type) { - case '.': - case '}': - // No predicate is coming if the triple is terminated here - this._subject = null; - return this._readPunctuation(token); - - default: - return this._readPredicate(token); - } - } // ### `_readListItem` reads items from a list - - - _readListItem(token) { - let item = null, - // The item of the list - list = null, - // The list itself - next = this._readListItem; // The next function to execute - - const previousList = this._subject, - // The previous list that contains this list - stack = this._contextStack, - // The stack of parent contexts - parent = stack[stack.length - 1]; // The parent containing the current list - - switch (token.type) { - case '[': - // Stack the current list quad and start a new quad with a blank node as subject - this._saveContext('blank', this._graph, list = this._blankNode(), this.RDF_FIRST, this._subject = item = this._blankNode()); - - next = this._readBlankNodeHead; - break; - - case '(': - // Stack the current list quad and start a new list - this._saveContext('list', this._graph, list = this._blankNode(), this.RDF_FIRST, this.RDF_NIL); - - this._subject = null; - break; - - case ')': - // Closing the list; restore the parent context - this._restoreContext(); // If this list is contained within a parent list, return the membership quad here. - // This will be ` rdf:first .`. - - - if (stack.length !== 0 && stack[stack.length - 1].type === 'list') this._emit(this._subject, this._predicate, this._object, this._graph); // Was this list the parent's subject? - - if (this._predicate === null) { - // The next token is the predicate - next = this._readPredicate; // No list tail if this was an empty list - - if (this._subject === this.RDF_NIL) return next; - } // The list was in the parent context's object - else { - next = this._getContextEndReader(); // No list tail if this was an empty list - - if (this._object === this.RDF_NIL) return next; - } // Close the list by making the head nil - - - list = this.RDF_NIL; - break; - - case 'literal': - // Regular literal, can still get a datatype or language - if (token.prefix.length === 0) { - this._literalValue = token.value; - next = this._readListItemDataTypeOrLang; - } // Pre-datatyped string literal (prefix stores the datatype) - else { - item = this._literal(token.value, this._namedNode(token.prefix)); - next = this._getContextEndReader(); - } - - break; - - case '{': - // Start a new formula - if (!this._n3Mode) return this._error('Unexpected graph', token); - - this._saveContext('formula', this._graph, this._subject, this._predicate, this._graph = this._blankNode()); - - return this._readSubject; - - default: - if ((item = this._readEntity(token)) === undefined) return; - } // Create a new blank node if no item head was assigned yet - - - if (list === null) this._subject = list = this._blankNode(); // Is this the first element of the list? - - if (previousList === null) { - // This list is either the subject or the object of its parent - if (parent.predicate === null) parent.subject = list;else parent.object = list; - } else { - // Continue the previous list with the current list - this._emit(previousList, this.RDF_REST, list, this._graph); - } // If an item was read, add it to the list - - - if (item !== null) { - // In N3 mode, the item might be a path - if (this._n3Mode && (token.type === 'IRI' || token.type === 'prefixed')) { - // Create a new context to add the item's path - this._saveContext('item', this._graph, list, this.RDF_FIRST, item); - - this._subject = item, this._predicate = null; // _readPath will restore the context and output the item - - return this._getPathReader(this._readListItem); - } // Output the item - - - this._emit(list, this.RDF_FIRST, item, this._graph); - } - - return next; - } // ### `_readDataTypeOrLang` reads an _optional_ datatype or language - - - _readDataTypeOrLang(token) { - return this._completeObjectLiteral(token, false); - } // ### `_readListItemDataTypeOrLang` reads an _optional_ datatype or language in a list - - - _readListItemDataTypeOrLang(token) { - return this._completeObjectLiteral(token, true); - } // ### `_completeLiteral` completes a literal with an optional datatype or language - - - _completeLiteral(token) { - // Create a simple string literal by default - let literal = this._literal(this._literalValue); - - switch (token.type) { - // Create a datatyped literal - case 'type': - case 'typeIRI': - const datatype = this._readEntity(token); - - if (datatype === undefined) return; // No datatype means an error occurred - - literal = this._literal(this._literalValue, datatype); - token = null; - break; - // Create a language-tagged string - - case 'langcode': - literal = this._literal(this._literalValue, token.value); - token = null; - break; - } - - return { - token, - literal - }; - } // Completes a literal in subject position - - - _completeSubjectLiteral(token) { - this._subject = this._completeLiteral(token).literal; - return this._readPredicateOrNamedGraph; - } // Completes a literal in object position - - - _completeObjectLiteral(token, listItem) { - const completed = this._completeLiteral(token); - - if (!completed) return; - this._object = completed.literal; // If this literal was part of a list, write the item - // (we could also check the context stack, but passing in a flag is faster) - - if (listItem) this._emit(this._subject, this.RDF_FIRST, this._object, this._graph); // If the token was consumed, continue with the rest of the input - - if (completed.token === null) return this._getContextEndReader(); // Otherwise, consume the token now - else { - this._readCallback = this._getContextEndReader(); - return this._readCallback(completed.token); - } - } // ### `_readFormulaTail` reads the end of a formula - - - _readFormulaTail(token) { - if (token.type !== '}') return this._readPunctuation(token); // Store the last quad of the formula - - if (this._subject !== null) this._emit(this._subject, this._predicate, this._object, this._graph); // Restore the parent context containing this formula - - this._restoreContext(); // If the formula was the subject, continue reading the predicate. - // If the formula was the object, read punctuation. - - - return this._object === null ? this._readPredicate : this._getContextEndReader(); - } // ### `_readPunctuation` reads punctuation between quads or quad parts - - - _readPunctuation(token) { - let next, - graph = this._graph; - const subject = this._subject, - inversePredicate = this._inversePredicate; - - switch (token.type) { - // A closing brace ends a graph - case '}': - if (this._graph === null) return this._error('Unexpected graph closing', token); - if (this._n3Mode) return this._readFormulaTail(token); - this._graph = null; - // A dot just ends the statement, without sharing anything with the next - - case '.': - this._subject = null; - next = this._contextStack.length ? this._readSubject : this._readInTopContext; - if (inversePredicate) this._inversePredicate = false; - break; - // Semicolon means the subject is shared; predicate and object are different - - case ';': - next = this._readPredicate; - break; - // Comma means both the subject and predicate are shared; the object is different - - case ',': - next = this._readObject; - break; - - default: - // An entity means this is a quad (only allowed if not already inside a graph) - if (this._supportsQuads && this._graph === null && (graph = this._readEntity(token)) !== undefined) { - next = this._readQuadPunctuation; - break; - } - - return this._error(`Expected punctuation to follow "${this._object.id}"`, token); - } // A quad has been completed now, so return it - - - if (subject !== null) { - const predicate = this._predicate, - object = this._object; - if (!inversePredicate) this._emit(subject, predicate, object, graph);else this._emit(object, predicate, subject, graph); - } - - return next; - } // ### `_readBlankNodePunctuation` reads punctuation in a blank node - - - _readBlankNodePunctuation(token) { - let next; - - switch (token.type) { - // Semicolon means the subject is shared; predicate and object are different - case ';': - next = this._readPredicate; - break; - // Comma means both the subject and predicate are shared; the object is different - - case ',': - next = this._readObject; - break; - - default: - return this._error(`Expected punctuation to follow "${this._object.id}"`, token); - } // A quad has been completed now, so return it - - - this._emit(this._subject, this._predicate, this._object, this._graph); - - return next; - } // ### `_readQuadPunctuation` reads punctuation after a quad - - - _readQuadPunctuation(token) { - if (token.type !== '.') return this._error('Expected dot to follow quad', token); - return this._readInTopContext; - } // ### `_readPrefix` reads the prefix of a prefix declaration - - - _readPrefix(token) { - if (token.type !== 'prefix') return this._error('Expected prefix to follow @prefix', token); - this._prefix = token.value; - return this._readPrefixIRI; - } // ### `_readPrefixIRI` reads the IRI of a prefix declaration - - - _readPrefixIRI(token) { - if (token.type !== 'IRI') return this._error(`Expected IRI to follow prefix "${this._prefix}:"`, token); - - const prefixNode = this._readEntity(token); - - this._prefixes[this._prefix] = prefixNode.value; - - this._prefixCallback(this._prefix, prefixNode); - - return this._readDeclarationPunctuation; - } // ### `_readBaseIRI` reads the IRI of a base declaration - - - _readBaseIRI(token) { - const iri = token.type === 'IRI' && this._resolveIRI(token.value); - - if (!iri) return this._error('Expected valid IRI to follow base declaration', token); - - this._setBase(iri); - - return this._readDeclarationPunctuation; - } // ### `_readNamedGraphLabel` reads the label of a named graph - - - _readNamedGraphLabel(token) { - switch (token.type) { - case 'IRI': - case 'blank': - case 'prefixed': - return this._readSubject(token), this._readGraph; - - case '[': - return this._readNamedGraphBlankLabel; - - default: - return this._error('Invalid graph label', token); - } - } // ### `_readNamedGraphLabel` reads a blank node label of a named graph - - - _readNamedGraphBlankLabel(token) { - if (token.type !== ']') return this._error('Invalid graph label', token); - this._subject = this._blankNode(); - return this._readGraph; - } // ### `_readDeclarationPunctuation` reads the punctuation of a declaration - - - _readDeclarationPunctuation(token) { - // SPARQL-style declarations don't have punctuation - if (this._sparqlStyle) { - this._sparqlStyle = false; - return this._readInTopContext(token); - } - - if (token.type !== '.') return this._error('Expected declaration to end with a dot', token); - return this._readInTopContext; - } // Reads a list of quantified symbols from a @forSome or @forAll statement - - - _readQuantifierList(token) { - let entity; - - switch (token.type) { - case 'IRI': - case 'prefixed': - if ((entity = this._readEntity(token, true)) !== undefined) break; - - default: - return this._error(`Unexpected ${token.type}`, token); - } // Without explicit quantifiers, map entities to a quantified entity - - - if (!this._explicitQuantifiers) this._quantified[entity.id] = this._quantifier(this._blankNode().value); // With explicit quantifiers, output the reified quantifier - else { - // If this is the first item, start a new quantifier list - if (this._subject === null) this._emit(this._graph || this.DEFAULTGRAPH, this._predicate, this._subject = this._blankNode(), this.QUANTIFIERS_GRAPH); // Otherwise, continue the previous list - else this._emit(this._subject, this.RDF_REST, this._subject = this._blankNode(), this.QUANTIFIERS_GRAPH); // Output the list item - - this._emit(this._subject, this.RDF_FIRST, entity, this.QUANTIFIERS_GRAPH); - } - return this._readQuantifierPunctuation; - } // Reads punctuation from a @forSome or @forAll statement - - - _readQuantifierPunctuation(token) { - // Read more quantifiers - if (token.type === ',') return this._readQuantifierList; // End of the quantifier list - else { - // With explicit quantifiers, close the quantifier list - if (this._explicitQuantifiers) { - this._emit(this._subject, this.RDF_REST, this.RDF_NIL, this.QUANTIFIERS_GRAPH); - - this._subject = null; - } // Read a dot - - - this._readCallback = this._getContextEndReader(); - return this._readCallback(token); - } - } // ### `_getPathReader` reads a potential path and then resumes with the given function - - - _getPathReader(afterPath) { - this._afterPath = afterPath; - return this._readPath; - } // ### `_readPath` reads a potential path - - - _readPath(token) { - switch (token.type) { - // Forward path - case '!': - return this._readForwardPath; - // Backward path - - case '^': - return this._readBackwardPath; - // Not a path; resume reading where we left off - - default: - const stack = this._contextStack, - parent = stack.length && stack[stack.length - 1]; // If we were reading a list item, we still need to output it - - if (parent && parent.type === 'item') { - // The list item is the remaining subejct after reading the path - const item = this._subject; // Switch back to the context of the list - - this._restoreContext(); // Output the list item - - - this._emit(this._subject, this.RDF_FIRST, item, this._graph); - } - - return this._afterPath(token); - } - } // ### `_readForwardPath` reads a '!' path - - - _readForwardPath(token) { - let subject, predicate; - - const object = this._blankNode(); // The next token is the predicate - - - if ((predicate = this._readEntity(token)) === undefined) return; // If we were reading a subject, replace the subject by the path's object - - if (this._predicate === null) subject = this._subject, this._subject = object; // If we were reading an object, replace the subject by the path's object - else subject = this._object, this._object = object; // Emit the path's current quad and read its next section - - this._emit(subject, predicate, object, this._graph); - - return this._readPath; - } // ### `_readBackwardPath` reads a '^' path - - - _readBackwardPath(token) { - const subject = this._blankNode(); - - let predicate, object; // The next token is the predicate - - if ((predicate = this._readEntity(token)) === undefined) return; // If we were reading a subject, replace the subject by the path's subject - - if (this._predicate === null) object = this._subject, this._subject = subject; // If we were reading an object, replace the subject by the path's subject - else object = this._object, this._object = subject; // Emit the path's current quad and read its next section - - this._emit(subject, predicate, object, this._graph); - - return this._readPath; - } // ### `_readRDFStarTailOrGraph` reads the graph of a nested RDF* quad or the end of a nested RDF* triple - - - _readRDFStarTailOrGraph(token) { - if (token.type !== '>>') { - // An entity means this is a quad (only allowed if not already inside a graph) - if (this._supportsQuads && this._graph === null && (this._graph = this._readEntity(token)) !== undefined) return this._readRDFStarTail; - return this._error(`Expected >> to follow "${this._object.id}"`, token); - } - - return this._readRDFStarTail(token); - } // ### `_readRDFStarTail` reads the end of a nested RDF* triple - - - _readRDFStarTail(token) { - if (token.type !== '>>') return this._error(`Expected >> but got ${token.type}`, token); // Read the quad and restore the previous context - - const quad = this._quad(this._subject, this._predicate, this._object, this._graph || this.DEFAULTGRAPH); - - this._restoreContext(); // If the triple was the subject, continue by reading the predicate. - - - if (this._subject === null) { - this._subject = quad; - return this._readPredicate; - } // If the triple was the object, read context end. - else { - this._object = quad; - return this._getContextEndReader(); - } - } // ### `_getContextEndReader` gets the next reader function at the end of a context - - - _getContextEndReader() { - const contextStack = this._contextStack; - if (!contextStack.length) return this._readPunctuation; - - switch (contextStack[contextStack.length - 1].type) { - case 'blank': - return this._readBlankNodeTail; - - case 'list': - return this._readListItem; - - case 'formula': - return this._readFormulaTail; - - case '<<': - return this._readRDFStarTailOrGraph; - } - } // ### `_emit` sends a quad through the callback - - - _emit(subject, predicate, object, graph) { - this._callback(null, this._quad(subject, predicate, object, graph || this.DEFAULTGRAPH)); - } // ### `_error` emits an error message through the callback - - - _error(message, token) { - const err = new Error(`${message} on line ${token.line}.`); - err.context = { - token: token, - line: token.line, - previousToken: this._lexer.previousToken - }; - - this._callback(err); - - this._callback = noop; - } // ### `_resolveIRI` resolves an IRI against the base path - - - _resolveIRI(iri) { - return /^[a-z][a-z0-9+.-]*:/i.test(iri) ? iri : this._resolveRelativeIRI(iri); - } // ### `_resolveRelativeIRI` resolves an IRI against the base path, - // assuming that a base path has been set and that the IRI is indeed relative - - - _resolveRelativeIRI(iri) { - // An empty relative IRI indicates the base IRI - if (!iri.length) return this._base; // Decide resolving strategy based in the first character - - switch (iri[0]) { - // Resolve relative fragment IRIs against the base IRI - case '#': - return this._base + iri; - // Resolve relative query string IRIs by replacing the query string - - case '?': - return this._base.replace(/(?:\?.*)?$/, iri); - // Resolve root-relative IRIs at the root of the base IRI - - case '/': - // Resolve scheme-relative IRIs to the scheme - return (iri[1] === '/' ? this._baseScheme : this._baseRoot) + this._removeDotSegments(iri); - // Resolve all other IRIs at the base IRI's path - - default: - // Relative IRIs cannot contain a colon in the first path segment - return /^[^/:]*:/.test(iri) ? null : this._removeDotSegments(this._basePath + iri); - } - } // ### `_removeDotSegments` resolves './' and '../' path segments in an IRI as per RFC3986 - - - _removeDotSegments(iri) { - // Don't modify the IRI if it does not contain any dot segments - if (!/(^|\/)\.\.?($|[/#?])/.test(iri)) return iri; // Start with an imaginary slash before the IRI in order to resolve trailing './' and '../' - - const length = iri.length; - let result = '', - i = -1, - pathStart = -1, - segmentStart = 0, - next = '/'; - - while (i < length) { - switch (next) { - // The path starts with the first slash after the authority - case ':': - if (pathStart < 0) { - // Skip two slashes before the authority - if (iri[++i] === '/' && iri[++i] === '/') // Skip to slash after the authority - while ((pathStart = i + 1) < length && iri[pathStart] !== '/') i = pathStart; - } - - break; - // Don't modify a query string or fragment - - case '?': - case '#': - i = length; - break; - // Handle '/.' or '/..' path segments - - case '/': - if (iri[i + 1] === '.') { - next = iri[++i + 1]; - - switch (next) { - // Remove a '/.' segment - case '/': - result += iri.substring(segmentStart, i - 1); - segmentStart = i + 1; - break; - // Remove a trailing '/.' segment - - case undefined: - case '?': - case '#': - return result + iri.substring(segmentStart, i) + iri.substr(i + 1); - // Remove a '/..' segment - - case '.': - next = iri[++i + 1]; - - if (next === undefined || next === '/' || next === '?' || next === '#') { - result += iri.substring(segmentStart, i - 2); // Try to remove the parent path from result - - if ((segmentStart = result.lastIndexOf('/')) >= pathStart) result = result.substr(0, segmentStart); // Remove a trailing '/..' segment - - if (next !== '/') return `${result}/${iri.substr(i + 1)}`; - segmentStart = i + 1; - } - - } - } - - } - - next = iri[++i]; - } - - return result + iri.substring(segmentStart); - } // ## Public methods - // ### `parse` parses the N3 input and emits each parsed quad through the callback - - - parse(input, quadCallback, prefixCallback) { - // The read callback is the next function to be executed when a token arrives. - // We start reading in the top context. - this._readCallback = this._readInTopContext; - this._sparqlStyle = false; - this._prefixes = Object.create(null); - this._prefixes._ = this._blankNodePrefix ? this._blankNodePrefix.substr(2) : `b${blankNodePrefix++}_`; - this._prefixCallback = prefixCallback || noop; - this._inversePredicate = false; - this._quantified = Object.create(null); // Parse synchronously if no quad callback is given - - if (!quadCallback) { - const quads = []; - let error; - - this._callback = (e, t) => { - e ? error = e : t && quads.push(t); - }; - - this._lexer.tokenize(input).every(token => { - return this._readCallback = this._readCallback(token); - }); - - if (error) throw error; - return quads; - } // Parse asynchronously otherwise, executing the read callback when a token arrives - - - this._callback = quadCallback; - - this._lexer.tokenize(input, (error, token) => { - if (error !== null) this._callback(error), this._callback = noop;else if (this._readCallback) this._readCallback = this._readCallback(token); - }); - } - -} // The empty function - - -exports.default = N3Parser; - -function noop() {} // Initializes the parser with the given data factory - - -function initDataFactory(parser, factory) { - // Set factory methods - const namedNode = factory.namedNode; - parser._namedNode = namedNode; - parser._blankNode = factory.blankNode; - parser._literal = factory.literal; - parser._variable = factory.variable; - parser._quad = factory.quad; - parser.DEFAULTGRAPH = factory.defaultGraph(); // Set common named nodes - - parser.RDF_FIRST = namedNode(_IRIs.default.rdf.first); - parser.RDF_REST = namedNode(_IRIs.default.rdf.rest); - parser.RDF_NIL = namedNode(_IRIs.default.rdf.nil); - parser.N3_FORALL = namedNode(_IRIs.default.r.forAll); - parser.N3_FORSOME = namedNode(_IRIs.default.r.forSome); - parser.ABBREVIATIONS = { - 'a': namedNode(_IRIs.default.rdf.type), - '=': namedNode(_IRIs.default.owl.sameAs), - '>': namedNode(_IRIs.default.log.implies) - }; - parser.QUANTIFIERS_GRAPH = namedNode('urn:n3:quantifiers'); -} - -initDataFactory(N3Parser.prototype, _N3DataFactory.default); -},{"./IRIs":34,"./N3DataFactory":35,"./N3Lexer":36}],38:[function(require,module,exports){ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -var _N3DataFactory = _interopRequireWildcard(require("./N3DataFactory")); - -var _readableStream = require("readable-stream"); - -var _IRIs = _interopRequireDefault(require("./IRIs")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } - -function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } - -// **N3Store** objects store N3 quads by graph in memory. -// ## Constructor -class N3Store { - constructor(quads, options) { - // The number of quads is initially zero - this._size = 0; // `_graphs` contains subject, predicate, and object indexes per graph - - this._graphs = Object.create(null); // `_ids` maps entities such as `http://xmlns.com/foaf/0.1/name` to numbers, - // saving memory by using only numbers as keys in `_graphs` - - this._id = 0; - this._ids = Object.create(null); - this._ids['><'] = 0; // dummy entry, so the first actual key is non-zero - - this._entities = Object.create(null); // inverse of `_ids` - // `_blankNodeIndex` is the index of the last automatically named blank node - - this._blankNodeIndex = 0; // Shift parameters if `quads` is not given - - if (!options && quads && !quads[0]) options = quads, quads = null; - options = options || {}; - this._factory = options.factory || _N3DataFactory.default; // Add quads if passed - - if (quads) this.addQuads(quads); - } // ## Public properties - // ### `size` returns the number of quads in the store - - - get size() { - // Return the quad count if if was cached - let size = this._size; - if (size !== null) return size; // Calculate the number of quads by counting to the deepest level - - size = 0; - const graphs = this._graphs; - let subjects, subject; - - for (const graphKey in graphs) for (const subjectKey in subjects = graphs[graphKey].subjects) for (const predicateKey in subject = subjects[subjectKey]) size += Object.keys(subject[predicateKey]).length; - - return this._size = size; - } // ## Private methods - // ### `_addToIndex` adds a quad to a three-layered index. - // Returns if the index has changed, if the entry did not already exist. - - - _addToIndex(index0, key0, key1, key2) { - // Create layers as necessary - const index1 = index0[key0] || (index0[key0] = {}); - const index2 = index1[key1] || (index1[key1] = {}); // Setting the key to _any_ value signals the presence of the quad - - const existed = (key2 in index2); - if (!existed) index2[key2] = null; - return !existed; - } // ### `_removeFromIndex` removes a quad from a three-layered index - - - _removeFromIndex(index0, key0, key1, key2) { - // Remove the quad from the index - const index1 = index0[key0], - index2 = index1[key1]; - delete index2[key2]; // Remove intermediary index layers if they are empty - - for (const key in index2) return; - - delete index1[key1]; - - for (const key in index1) return; - - delete index0[key0]; - } // ### `_findInIndex` finds a set of quads in a three-layered index. - // The index base is `index0` and the keys at each level are `key0`, `key1`, and `key2`. - // Any of these keys can be undefined, which is interpreted as a wildcard. - // `name0`, `name1`, and `name2` are the names of the keys at each level, - // used when reconstructing the resulting quad - // (for instance: _subject_, _predicate_, and _object_). - // Finally, `graphId` will be the graph of the created quads. - - - *_findInIndex(index0, key0, key1, key2, name0, name1, name2, graphId) { - let tmp, index1, index2; // Depending on the number of variables, keys or reverse index are faster - - const varCount = !key0 + !key1 + !key2, - entityKeys = varCount > 1 ? Object.keys(this._ids) : this._entities; - const graph = (0, _N3DataFactory.termFromId)(graphId, this._factory); // If a key is specified, use only that part of index 0. - - if (key0) (tmp = index0, index0 = {})[key0] = tmp[key0]; - - for (const value0 in index0) { - const entity0 = entityKeys[value0]; - - if (index1 = index0[value0]) { - // If a key is specified, use only that part of index 1. - if (key1) (tmp = index1, index1 = {})[key1] = tmp[key1]; - - for (const value1 in index1) { - const entity1 = entityKeys[value1]; - - if (index2 = index1[value1]) { - // If a key is specified, use only that part of index 2, if it exists. - const values = key2 ? key2 in index2 ? [key2] : [] : Object.keys(index2); // Create quads for all items found in index 2. - - for (let l = 0; l < values.length; l++) { - const parts = { - subject: null, - predicate: null, - object: null - }; - parts[name0] = (0, _N3DataFactory.termFromId)(entity0, this._factory); - parts[name1] = (0, _N3DataFactory.termFromId)(entity1, this._factory); - parts[name2] = (0, _N3DataFactory.termFromId)(entityKeys[values[l]], this._factory); - yield this._factory.quad(parts.subject, parts.predicate, parts.object, graph); - } - } - } - } - } - } // ### `_loop` executes the callback on all keys of index 0 - - - _loop(index0, callback) { - for (const key0 in index0) callback(key0); - } // ### `_loopByKey0` executes the callback on all keys of a certain entry in index 0 - - - _loopByKey0(index0, key0, callback) { - let index1, key1; - - if (index1 = index0[key0]) { - for (key1 in index1) callback(key1); - } - } // ### `_loopByKey1` executes the callback on given keys of all entries in index 0 - - - _loopByKey1(index0, key1, callback) { - let key0, index1; - - for (key0 in index0) { - index1 = index0[key0]; - if (index1[key1]) callback(key0); - } - } // ### `_loopBy2Keys` executes the callback on given keys of certain entries in index 2 - - - _loopBy2Keys(index0, key0, key1, callback) { - let index1, index2, key2; - - if ((index1 = index0[key0]) && (index2 = index1[key1])) { - for (key2 in index2) callback(key2); - } - } // ### `_countInIndex` counts matching quads in a three-layered index. - // The index base is `index0` and the keys at each level are `key0`, `key1`, and `key2`. - // Any of these keys can be undefined, which is interpreted as a wildcard. - - - _countInIndex(index0, key0, key1, key2) { - let count = 0, - tmp, - index1, - index2; // If a key is specified, count only that part of index 0 - - if (key0) (tmp = index0, index0 = {})[key0] = tmp[key0]; - - for (const value0 in index0) { - if (index1 = index0[value0]) { - // If a key is specified, count only that part of index 1 - if (key1) (tmp = index1, index1 = {})[key1] = tmp[key1]; - - for (const value1 in index1) { - if (index2 = index1[value1]) { - // If a key is specified, count the quad if it exists - if (key2) key2 in index2 && count++; // Otherwise, count all quads - else count += Object.keys(index2).length; - } - } - } - } - - return count; - } // ### `_getGraphs` returns an array with the given graph, - // or all graphs if the argument is null or undefined. - - - _getGraphs(graph) { - if (!isString(graph)) return this._graphs; - const graphs = {}; - graphs[graph] = this._graphs[graph]; - return graphs; - } // ### `_uniqueEntities` returns a function that accepts an entity ID - // and passes the corresponding entity to callback if it hasn't occurred before. - - - _uniqueEntities(callback) { - const uniqueIds = Object.create(null); - return id => { - if (!(id in uniqueIds)) { - uniqueIds[id] = true; - callback((0, _N3DataFactory.termFromId)(this._entities[id], this._factory)); - } - }; - } // ## Public methods - // ### `add` adds the specified quad to the dataset. - // Returns the dataset instance it was called on. - // Existing quads, as defined in Quad.equals, will be ignored. - - - add(quad) { - this.addQuad(quad); - return this; - } // ### `addQuad` adds a new quad to the store. - // Returns if the quad index has changed, if the quad did not already exist. - - - addQuad(subject, predicate, object, graph) { - // Shift arguments if a quad object is given instead of components - if (!predicate) graph = subject.graph, object = subject.object, predicate = subject.predicate, subject = subject.subject; // Convert terms to internal string representation - - subject = (0, _N3DataFactory.termToId)(subject); - predicate = (0, _N3DataFactory.termToId)(predicate); - object = (0, _N3DataFactory.termToId)(object); - graph = (0, _N3DataFactory.termToId)(graph); // Find the graph that will contain the triple - - let graphItem = this._graphs[graph]; // Create the graph if it doesn't exist yet - - if (!graphItem) { - graphItem = this._graphs[graph] = { - subjects: {}, - predicates: {}, - objects: {} - }; // Freezing a graph helps subsequent `add` performance, - // and properties will never be modified anyway - - Object.freeze(graphItem); - } // Since entities can often be long IRIs, we avoid storing them in every index. - // Instead, we have a separate index that maps entities to numbers, - // which are then used as keys in the other indexes. - - - const ids = this._ids; - const entities = this._entities; - subject = ids[subject] || (ids[entities[++this._id] = subject] = this._id); - predicate = ids[predicate] || (ids[entities[++this._id] = predicate] = this._id); - object = ids[object] || (ids[entities[++this._id] = object] = this._id); - - const changed = this._addToIndex(graphItem.subjects, subject, predicate, object); - - this._addToIndex(graphItem.predicates, predicate, object, subject); - - this._addToIndex(graphItem.objects, object, subject, predicate); // The cached quad count is now invalid - - - this._size = null; - return changed; - } // ### `addQuads` adds multiple quads to the store - - - addQuads(quads) { - for (let i = 0; i < quads.length; i++) this.addQuad(quads[i]); - } // ### `delete` removes the specified quad from the dataset. - // Returns the dataset instance it was called on. - - - delete(quad) { - this.removeQuad(quad); - return this; - } // ### `has` determines whether a dataset includes a certain quad or quad pattern. - - - has(subjectOrQuad, predicate, object, graph) { - if (subjectOrQuad && subjectOrQuad.subject) ({ - subject: subjectOrQuad, - predicate, - object, - graph - } = subjectOrQuad); - return !this.readQuads(subjectOrQuad, predicate, object, graph).next().done; - } // ### `import` adds a stream of quads to the store - - - import(stream) { - stream.on('data', quad => { - this.addQuad(quad); - }); - return stream; - } // ### `removeQuad` removes a quad from the store if it exists - - - removeQuad(subject, predicate, object, graph) { - // Shift arguments if a quad object is given instead of components - if (!predicate) graph = subject.graph, object = subject.object, predicate = subject.predicate, subject = subject.subject; // Convert terms to internal string representation - - subject = (0, _N3DataFactory.termToId)(subject); - predicate = (0, _N3DataFactory.termToId)(predicate); - object = (0, _N3DataFactory.termToId)(object); - graph = (0, _N3DataFactory.termToId)(graph); // Find internal identifiers for all components - // and verify the quad exists. - - const ids = this._ids, - graphs = this._graphs; - let graphItem, subjects, predicates; - if (!(subject = ids[subject]) || !(predicate = ids[predicate]) || !(object = ids[object]) || !(graphItem = graphs[graph]) || !(subjects = graphItem.subjects[subject]) || !(predicates = subjects[predicate]) || !(object in predicates)) return false; // Remove it from all indexes - - this._removeFromIndex(graphItem.subjects, subject, predicate, object); - - this._removeFromIndex(graphItem.predicates, predicate, object, subject); - - this._removeFromIndex(graphItem.objects, object, subject, predicate); - - if (this._size !== null) this._size--; // Remove the graph if it is empty - - for (subject in graphItem.subjects) return true; - - delete graphs[graph]; - return true; - } // ### `removeQuads` removes multiple quads from the store - - - removeQuads(quads) { - for (let i = 0; i < quads.length; i++) this.removeQuad(quads[i]); - } // ### `remove` removes a stream of quads from the store - - - remove(stream) { - stream.on('data', quad => { - this.removeQuad(quad); - }); - return stream; - } // ### `removeMatches` removes all matching quads from the store - // Setting any field to `undefined` or `null` indicates a wildcard. - - - removeMatches(subject, predicate, object, graph) { - const stream = new _readableStream.Readable({ - objectMode: true - }); - - stream._read = () => { - for (const quad of this.readQuads(subject, predicate, object, graph)) stream.push(quad); - - stream.push(null); - }; - - return this.remove(stream); - } // ### `deleteGraph` removes all triples with the given graph from the store - - - deleteGraph(graph) { - return this.removeMatches(null, null, null, graph); - } // ### `getQuads` returns an array of quads matching a pattern. - // Setting any field to `undefined` or `null` indicates a wildcard. - - - getQuads(subject, predicate, object, graph) { - return [...this.readQuads(subject, predicate, object, graph)]; - } // ### `readQuads` returns an generator of quads matching a pattern. - // Setting any field to `undefined` or `null` indicates a wildcard. - - - *readQuads(subject, predicate, object, graph) { - // Convert terms to internal string representation - subject = subject && (0, _N3DataFactory.termToId)(subject); - predicate = predicate && (0, _N3DataFactory.termToId)(predicate); - object = object && (0, _N3DataFactory.termToId)(object); - graph = graph && (0, _N3DataFactory.termToId)(graph); - - const graphs = this._getGraphs(graph), - ids = this._ids; - - let content, subjectId, predicateId, objectId; // Translate IRIs to internal index keys. - - if (isString(subject) && !(subjectId = ids[subject]) || isString(predicate) && !(predicateId = ids[predicate]) || isString(object) && !(objectId = ids[object])) return; - - for (const graphId in graphs) { - // Only if the specified graph contains triples, there can be results - if (content = graphs[graphId]) { - // Choose the optimal index, based on what fields are present - if (subjectId) { - if (objectId) // If subject and object are given, the object index will be the fastest - yield* this._findInIndex(content.objects, objectId, subjectId, predicateId, 'object', 'subject', 'predicate', graphId, null, true);else // If only subject and possibly predicate are given, the subject index will be the fastest - yield* this._findInIndex(content.subjects, subjectId, predicateId, null, 'subject', 'predicate', 'object', graphId, null, true); - } else if (predicateId) // If only predicate and possibly object are given, the predicate index will be the fastest - yield* this._findInIndex(content.predicates, predicateId, objectId, null, 'predicate', 'object', 'subject', graphId, null, true);else if (objectId) // If only object is given, the object index will be the fastest - yield* this._findInIndex(content.objects, objectId, null, null, 'object', 'subject', 'predicate', graphId, null, true);else // If nothing is given, iterate subjects and predicates first - yield* this._findInIndex(content.subjects, null, null, null, 'subject', 'predicate', 'object', graphId, null, true); - } - } - } // ### `match` returns a new dataset that is comprised of all quads in the current instance matching the given arguments. - // The logic described in Quad Matching is applied for each quad in this dataset to check if it should be included in the output dataset. - // Note: This method always returns a new DatasetCore, even if that dataset contains no quads. - // Note: Since a DatasetCore is an unordered set, the order of the quads within the returned sequence is arbitrary. - // Setting any field to `undefined` or `null` indicates a wildcard. - // For backwards compatibility, the object return also implements the Readable stream interface. - - - match(subject, predicate, object, graph) { - return new DatasetCoreAndReadableStream(this, subject, predicate, object, graph); - } // ### `countQuads` returns the number of quads matching a pattern. - // Setting any field to `undefined` or `null` indicates a wildcard. - - - countQuads(subject, predicate, object, graph) { - // Convert terms to internal string representation - subject = subject && (0, _N3DataFactory.termToId)(subject); - predicate = predicate && (0, _N3DataFactory.termToId)(predicate); - object = object && (0, _N3DataFactory.termToId)(object); - graph = graph && (0, _N3DataFactory.termToId)(graph); - - const graphs = this._getGraphs(graph), - ids = this._ids; - - let count = 0, - content, - subjectId, - predicateId, - objectId; // Translate IRIs to internal index keys. - - if (isString(subject) && !(subjectId = ids[subject]) || isString(predicate) && !(predicateId = ids[predicate]) || isString(object) && !(objectId = ids[object])) return 0; - - for (const graphId in graphs) { - // Only if the specified graph contains triples, there can be results - if (content = graphs[graphId]) { - // Choose the optimal index, based on what fields are present - if (subject) { - if (object) // If subject and object are given, the object index will be the fastest - count += this._countInIndex(content.objects, objectId, subjectId, predicateId);else // If only subject and possibly predicate are given, the subject index will be the fastest - count += this._countInIndex(content.subjects, subjectId, predicateId, objectId); - } else if (predicate) { - // If only predicate and possibly object are given, the predicate index will be the fastest - count += this._countInIndex(content.predicates, predicateId, objectId, subjectId); - } else { - // If only object is possibly given, the object index will be the fastest - count += this._countInIndex(content.objects, objectId, subjectId, predicateId); - } - } - } - - return count; - } // ### `forEach` executes the callback on all quads. - // Setting any field to `undefined` or `null` indicates a wildcard. - - - forEach(callback, subject, predicate, object, graph) { - this.some(quad => { - callback(quad); - return false; - }, subject, predicate, object, graph); - } // ### `every` executes the callback on all quads, - // and returns `true` if it returns truthy for all them. - // Setting any field to `undefined` or `null` indicates a wildcard. - - - every(callback, subject, predicate, object, graph) { - let some = false; - const every = !this.some(quad => { - some = true; - return !callback(quad); - }, subject, predicate, object, graph); - return some && every; - } // ### `some` executes the callback on all quads, - // and returns `true` if it returns truthy for any of them. - // Setting any field to `undefined` or `null` indicates a wildcard. - - - some(callback, subject, predicate, object, graph) { - for (const quad of this.readQuads(subject, predicate, object, graph)) if (callback(quad)) return true; - - return false; - } // ### `getSubjects` returns all subjects that match the pattern. - // Setting any field to `undefined` or `null` indicates a wildcard. - - - getSubjects(predicate, object, graph) { - const results = []; - this.forSubjects(s => { - results.push(s); - }, predicate, object, graph); - return results; - } // ### `forSubjects` executes the callback on all subjects that match the pattern. - // Setting any field to `undefined` or `null` indicates a wildcard. - - - forSubjects(callback, predicate, object, graph) { - // Convert terms to internal string representation - predicate = predicate && (0, _N3DataFactory.termToId)(predicate); - object = object && (0, _N3DataFactory.termToId)(object); - graph = graph && (0, _N3DataFactory.termToId)(graph); - - const ids = this._ids, - graphs = this._getGraphs(graph); - - let content, predicateId, objectId; - callback = this._uniqueEntities(callback); // Translate IRIs to internal index keys. - - if (isString(predicate) && !(predicateId = ids[predicate]) || isString(object) && !(objectId = ids[object])) return; - - for (graph in graphs) { - // Only if the specified graph contains triples, there can be results - if (content = graphs[graph]) { - // Choose optimal index based on which fields are wildcards - if (predicateId) { - if (objectId) // If predicate and object are given, the POS index is best. - this._loopBy2Keys(content.predicates, predicateId, objectId, callback);else // If only predicate is given, the SPO index is best. - this._loopByKey1(content.subjects, predicateId, callback); - } else if (objectId) // If only object is given, the OSP index is best. - this._loopByKey0(content.objects, objectId, callback);else // If no params given, iterate all the subjects - this._loop(content.subjects, callback); - } - } - } // ### `getPredicates` returns all predicates that match the pattern. - // Setting any field to `undefined` or `null` indicates a wildcard. - - - getPredicates(subject, object, graph) { - const results = []; - this.forPredicates(p => { - results.push(p); - }, subject, object, graph); - return results; - } // ### `forPredicates` executes the callback on all predicates that match the pattern. - // Setting any field to `undefined` or `null` indicates a wildcard. - - - forPredicates(callback, subject, object, graph) { - // Convert terms to internal string representation - subject = subject && (0, _N3DataFactory.termToId)(subject); - object = object && (0, _N3DataFactory.termToId)(object); - graph = graph && (0, _N3DataFactory.termToId)(graph); - - const ids = this._ids, - graphs = this._getGraphs(graph); - - let content, subjectId, objectId; - callback = this._uniqueEntities(callback); // Translate IRIs to internal index keys. - - if (isString(subject) && !(subjectId = ids[subject]) || isString(object) && !(objectId = ids[object])) return; - - for (graph in graphs) { - // Only if the specified graph contains triples, there can be results - if (content = graphs[graph]) { - // Choose optimal index based on which fields are wildcards - if (subjectId) { - if (objectId) // If subject and object are given, the OSP index is best. - this._loopBy2Keys(content.objects, objectId, subjectId, callback);else // If only subject is given, the SPO index is best. - this._loopByKey0(content.subjects, subjectId, callback); - } else if (objectId) // If only object is given, the POS index is best. - this._loopByKey1(content.predicates, objectId, callback);else // If no params given, iterate all the predicates. - this._loop(content.predicates, callback); - } - } - } // ### `getObjects` returns all objects that match the pattern. - // Setting any field to `undefined` or `null` indicates a wildcard. - - - getObjects(subject, predicate, graph) { - const results = []; - this.forObjects(o => { - results.push(o); - }, subject, predicate, graph); - return results; - } // ### `forObjects` executes the callback on all objects that match the pattern. - // Setting any field to `undefined` or `null` indicates a wildcard. - - - forObjects(callback, subject, predicate, graph) { - // Convert terms to internal string representation - subject = subject && (0, _N3DataFactory.termToId)(subject); - predicate = predicate && (0, _N3DataFactory.termToId)(predicate); - graph = graph && (0, _N3DataFactory.termToId)(graph); - - const ids = this._ids, - graphs = this._getGraphs(graph); - - let content, subjectId, predicateId; - callback = this._uniqueEntities(callback); // Translate IRIs to internal index keys. - - if (isString(subject) && !(subjectId = ids[subject]) || isString(predicate) && !(predicateId = ids[predicate])) return; - - for (graph in graphs) { - // Only if the specified graph contains triples, there can be results - if (content = graphs[graph]) { - // Choose optimal index based on which fields are wildcards - if (subjectId) { - if (predicateId) // If subject and predicate are given, the SPO index is best. - this._loopBy2Keys(content.subjects, subjectId, predicateId, callback);else // If only subject is given, the OSP index is best. - this._loopByKey1(content.objects, subjectId, callback); - } else if (predicateId) // If only predicate is given, the POS index is best. - this._loopByKey0(content.predicates, predicateId, callback);else // If no params given, iterate all the objects. - this._loop(content.objects, callback); - } - } - } // ### `getGraphs` returns all graphs that match the pattern. - // Setting any field to `undefined` or `null` indicates a wildcard. - - - getGraphs(subject, predicate, object) { - const results = []; - this.forGraphs(g => { - results.push(g); - }, subject, predicate, object); - return results; - } // ### `forGraphs` executes the callback on all graphs that match the pattern. - // Setting any field to `undefined` or `null` indicates a wildcard. - - - forGraphs(callback, subject, predicate, object) { - for (const graph in this._graphs) { - this.some(quad => { - callback(quad.graph); - return true; // Halt iteration of some() - }, subject, predicate, object, graph); - } - } // ### `createBlankNode` creates a new blank node, returning its name - - - createBlankNode(suggestedName) { - let name, index; // Generate a name based on the suggested name - - if (suggestedName) { - name = suggestedName = `_:${suggestedName}`, index = 1; - - while (this._ids[name]) name = suggestedName + index++; - } // Generate a generic blank node name - else { - do { - name = `_:b${this._blankNodeIndex++}`; - } while (this._ids[name]); - } // Add the blank node to the entities, avoiding the generation of duplicates - - - this._ids[name] = ++this._id; - this._entities[this._id] = name; - return this._factory.blankNode(name.substr(2)); - } // ### `extractLists` finds and removes all list triples - // and returns the items per list. - - - extractLists({ - remove = false, - ignoreErrors = false - } = {}) { - const lists = {}; // has scalar keys so could be a simple Object - - const onError = ignoreErrors ? () => true : (node, message) => { - throw new Error(`${node.value} ${message}`); - }; // Traverse each list from its tail - - const tails = this.getQuads(null, _IRIs.default.rdf.rest, _IRIs.default.rdf.nil, null); - const toRemove = remove ? [...tails] : []; - tails.forEach(tailQuad => { - const items = []; // the members found as objects of rdf:first quads - - let malformed = false; // signals whether the current list is malformed - - let head; // the head of the list (_:b1 in above example) - - let headPos; // set to subject or object when head is set - - const graph = tailQuad.graph; // make sure list is in exactly one graph - // Traverse the list from tail to end - - let current = tailQuad.subject; - - while (current && !malformed) { - const objectQuads = this.getQuads(null, null, current, null); - const subjectQuads = this.getQuads(current, null, null, null); - let quad, - first = null, - rest = null, - parent = null; // Find the first and rest of this list node - - for (let i = 0; i < subjectQuads.length && !malformed; i++) { - quad = subjectQuads[i]; - if (!quad.graph.equals(graph)) malformed = onError(current, 'not confined to single graph');else if (head) malformed = onError(current, 'has non-list arcs out'); // one rdf:first - else if (quad.predicate.value === _IRIs.default.rdf.first) { - if (first) malformed = onError(current, 'has multiple rdf:first arcs');else toRemove.push(first = quad); - } // one rdf:rest - else if (quad.predicate.value === _IRIs.default.rdf.rest) { - if (rest) malformed = onError(current, 'has multiple rdf:rest arcs');else toRemove.push(rest = quad); - } // alien triple - else if (objectQuads.length) malformed = onError(current, 'can\'t be subject and object');else { - head = quad; // e.g. { (1 2 3) :p :o } - - headPos = 'subject'; - } - } // { :s :p (1 2) } arrives here with no head - // { (1 2) :p :o } arrives here with head set to the list. - - - for (let i = 0; i < objectQuads.length && !malformed; ++i) { - quad = objectQuads[i]; - if (head) malformed = onError(current, 'can\'t have coreferences'); // one rdf:rest - else if (quad.predicate.value === _IRIs.default.rdf.rest) { - if (parent) malformed = onError(current, 'has incoming rdf:rest arcs');else parent = quad; - } else { - head = quad; // e.g. { :s :p (1 2) } - - headPos = 'object'; - } - } // Store the list item and continue with parent - - - if (!first) malformed = onError(current, 'has no list head');else items.unshift(first.object); - current = parent && parent.subject; - } // Don't remove any quads if the list is malformed - - - if (malformed) remove = false; // Store the list under the value of its head - else if (head) lists[head[headPos].value] = items; - }); // Remove list quads if requested - - if (remove) this.removeQuads(toRemove); - return lists; - } // ### Store is an iterable. - // Can be used where iterables are expected: for...of loops, array spread operator, - // `yield*`, and destructuring assignment (order is not guaranteed). - - - *[Symbol.iterator]() { - yield* this.readQuads(); - } - -} // Determines whether the argument is a string - - -exports.default = N3Store; - -function isString(s) { - return typeof s === 'string' || s instanceof String; -} -/** - * A class that implements both DatasetCore and Readable. - */ - - -class DatasetCoreAndReadableStream extends _readableStream.Readable { - constructor(n3Store, subject, predicate, object, graph) { - super({ - objectMode: true - }); - Object.assign(this, { - n3Store, - subject, - predicate, - object, - graph - }); - } - - get filtered() { - if (!this._filtered) { - const { - n3Store, - graph, - object, - predicate, - subject - } = this; - const quads = n3Store.getQuads(subject, predicate, object, graph); - this._filtered = new N3Store(quads, { - factory: n3Store._factory - }); - } - - return this._filtered; - } - - get size() { - return this.filtered.size; - } - - _read() { - for (const quad of this) this.push(quad); - - this.push(null); - } - - add(quad) { - return this.filtered.add(quad); - } - - delete(quad) { - return this.filtered.delete(quad); - } - - has(quad) { - return this.filtered.has(quad); - } - - match(subject, predicate, object, graph) { - return new DatasetCoreAndReadableStream(this.filtered, subject, predicate, object, graph); - } - - *[Symbol.iterator]() { - yield* this._filtered || this.n3Store.readQuads(this.subject, this.predicate, this.object, this.graph); - } - -} -},{"./IRIs":34,"./N3DataFactory":35,"readable-stream":81}],39:[function(require,module,exports){ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -var _N3Parser = _interopRequireDefault(require("./N3Parser")); - -var _readableStream = require("readable-stream"); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -// **N3StreamParser** parses a text stream into a quad stream. -// ## Constructor -class N3StreamParser extends _readableStream.Transform { - constructor(options) { - super({ - decodeStrings: true - }); - this._readableState.objectMode = true; // Set up parser with dummy stream to obtain `data` and `end` callbacks - - const parser = new _N3Parser.default(options); - let onData, onEnd; - parser.parse({ - on: (event, callback) => { - switch (event) { - case 'data': - onData = callback; - break; - - case 'end': - onEnd = callback; - break; - } - } - }, // Handle quads by pushing them down the pipeline - (error, quad) => { - error && this.emit('error', error) || quad && this.push(quad); - }, // Emit prefixes through the `prefix` event - (prefix, uri) => { - this.emit('prefix', prefix, uri); - }); // Implement Transform methods through parser callbacks - - this._transform = (chunk, encoding, done) => { - onData(chunk); - done(); - }; - - this._flush = done => { - onEnd(); - done(); - }; - } // ### Parses a stream of strings - - - import(stream) { - stream.on('data', chunk => { - this.write(chunk); - }); - stream.on('end', () => { - this.end(); - }); - stream.on('error', error => { - this.emit('error', error); - }); - return this; - } - -} - -exports.default = N3StreamParser; -},{"./N3Parser":37,"readable-stream":81}],40:[function(require,module,exports){ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -var _readableStream = require("readable-stream"); - -var _N3Writer = _interopRequireDefault(require("./N3Writer")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -// **N3StreamWriter** serializes a quad stream into a text stream. -// ## Constructor -class N3StreamWriter extends _readableStream.Transform { - constructor(options) { - super({ - encoding: 'utf8', - writableObjectMode: true - }); // Set up writer with a dummy stream object - - const writer = this._writer = new _N3Writer.default({ - write: (quad, encoding, callback) => { - this.push(quad); - callback && callback(); - }, - end: callback => { - this.push(null); - callback && callback(); - } - }, options); // Implement Transform methods on top of writer - - this._transform = (quad, encoding, done) => { - writer.addQuad(quad, done); - }; - - this._flush = done => { - writer.end(done); - }; - } // ### Serializes a stream of quads - - - import(stream) { - stream.on('data', quad => { - this.write(quad); - }); - stream.on('end', () => { - this.end(); - }); - stream.on('error', error => { - this.emit('error', error); - }); - stream.on('prefix', (prefix, iri) => { - this._writer.addPrefix(prefix, iri); - }); - return this; - } - -} - -exports.default = N3StreamWriter; -},{"./N3Writer":42,"readable-stream":81}],41:[function(require,module,exports){ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.inDefaultGraph = inDefaultGraph; -exports.isBlankNode = isBlankNode; -exports.isDefaultGraph = isDefaultGraph; -exports.isLiteral = isLiteral; -exports.isNamedNode = isNamedNode; -exports.isVariable = isVariable; -exports.prefix = prefix; -exports.prefixes = prefixes; - -var _N3DataFactory = _interopRequireDefault(require("./N3DataFactory")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -// **N3Util** provides N3 utility functions. -// Tests whether the given term represents an IRI -function isNamedNode(term) { - return !!term && term.termType === 'NamedNode'; -} // Tests whether the given term represents a blank node - - -function isBlankNode(term) { - return !!term && term.termType === 'BlankNode'; -} // Tests whether the given term represents a literal - - -function isLiteral(term) { - return !!term && term.termType === 'Literal'; -} // Tests whether the given term represents a variable - - -function isVariable(term) { - return !!term && term.termType === 'Variable'; -} // Tests whether the given term represents the default graph - - -function isDefaultGraph(term) { - return !!term && term.termType === 'DefaultGraph'; -} // Tests whether the given quad is in the default graph - - -function inDefaultGraph(quad) { - return isDefaultGraph(quad.graph); -} // Creates a function that prepends the given IRI to a local name - - -function prefix(iri, factory) { - return prefixes({ - '': iri.value || iri - }, factory)(''); -} // Creates a function that allows registering and expanding prefixes - - -function prefixes(defaultPrefixes, factory) { - // Add all of the default prefixes - const prefixes = Object.create(null); - - for (const prefix in defaultPrefixes) processPrefix(prefix, defaultPrefixes[prefix]); // Set the default factory if none was specified - - - factory = factory || _N3DataFactory.default; // Registers a new prefix (if an IRI was specified) - // or retrieves a function that expands an existing prefix (if no IRI was specified) - - function processPrefix(prefix, iri) { - // Create a new prefix if an IRI is specified or the prefix doesn't exist - if (typeof iri === 'string') { - // Create a function that expands the prefix - const cache = Object.create(null); - - prefixes[prefix] = local => { - return cache[local] || (cache[local] = factory.namedNode(iri + local)); - }; - } else if (!(prefix in prefixes)) { - throw new Error(`Unknown prefix: ${prefix}`); - } - - return prefixes[prefix]; - } - - return processPrefix; -} -},{"./N3DataFactory":35}],42:[function(require,module,exports){ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -var _IRIs = _interopRequireDefault(require("./IRIs")); - -var _N3DataFactory = _interopRequireWildcard(require("./N3DataFactory")); - -var _N3Util = require("./N3Util"); - -function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } - -function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -// **N3Writer** writes N3 documents. -const DEFAULTGRAPH = _N3DataFactory.default.defaultGraph(); - -const { - rdf, - xsd -} = _IRIs.default; // Characters in literals that require escaping - -const escape = /["\\\t\n\r\b\f\u0000-\u0019\ud800-\udbff]/, - escapeAll = /["\\\t\n\r\b\f\u0000-\u0019]|[\ud800-\udbff][\udc00-\udfff]/g, - escapedCharacters = { - '\\': '\\\\', - '"': '\\"', - '\t': '\\t', - '\n': '\\n', - '\r': '\\r', - '\b': '\\b', - '\f': '\\f' -}; // ## Placeholder class to represent already pretty-printed terms - -class SerializedTerm extends _N3DataFactory.Term { - // Pretty-printed nodes are not equal to any other node - // (e.g., [] does not equal []) - equals() { - return false; - } - -} // ## Constructor - - -class N3Writer { - constructor(outputStream, options) { - // ### `_prefixRegex` matches a prefixed name or IRI that begins with one of the added prefixes - this._prefixRegex = /$0^/; // Shift arguments if the first argument is not a stream - - if (outputStream && typeof outputStream.write !== 'function') options = outputStream, outputStream = null; - options = options || {}; - this._lists = options.lists; // If no output stream given, send the output as string through the end callback - - if (!outputStream) { - let output = ''; - this._outputStream = { - write(chunk, encoding, done) { - output += chunk; - done && done(); - }, - - end: done => { - done && done(null, output); - } - }; - this._endStream = true; - } else { - this._outputStream = outputStream; - this._endStream = options.end === undefined ? true : !!options.end; - } // Initialize writer, depending on the format - - - this._subject = null; - - if (!/triple|quad/i.test(options.format)) { - this._lineMode = false; - this._graph = DEFAULTGRAPH; - this._prefixIRIs = Object.create(null); - options.prefixes && this.addPrefixes(options.prefixes); - - if (options.baseIRI) { - this._baseMatcher = new RegExp(`^${escapeRegex(options.baseIRI)}${options.baseIRI.endsWith('/') ? '' : '[#?]'}`); - this._baseLength = options.baseIRI.length; - } - } else { - this._lineMode = true; - this._writeQuad = this._writeQuadLine; - } - } // ## Private methods - // ### Whether the current graph is the default graph - - - get _inDefaultGraph() { - return DEFAULTGRAPH.equals(this._graph); - } // ### `_write` writes the argument to the output stream - - - _write(string, callback) { - this._outputStream.write(string, 'utf8', callback); - } // ### `_writeQuad` writes the quad to the output stream - - - _writeQuad(subject, predicate, object, graph, done) { - try { - // Write the graph's label if it has changed - if (!graph.equals(this._graph)) { - // Close the previous graph and start the new one - this._write((this._subject === null ? '' : this._inDefaultGraph ? '.\n' : '\n}\n') + (DEFAULTGRAPH.equals(graph) ? '' : `${this._encodeIriOrBlank(graph)} {\n`)); - - this._graph = graph; - this._subject = null; - } // Don't repeat the subject if it's the same - - - if (subject.equals(this._subject)) { - // Don't repeat the predicate if it's the same - if (predicate.equals(this._predicate)) this._write(`, ${this._encodeObject(object)}`, done); // Same subject, different predicate - else this._write(`;\n ${this._encodePredicate(this._predicate = predicate)} ${this._encodeObject(object)}`, done); - } // Different subject; write the whole quad - else this._write(`${(this._subject === null ? '' : '.\n') + this._encodeSubject(this._subject = subject)} ${this._encodePredicate(this._predicate = predicate)} ${this._encodeObject(object)}`, done); - } catch (error) { - done && done(error); - } - } // ### `_writeQuadLine` writes the quad to the output stream as a single line - - - _writeQuadLine(subject, predicate, object, graph, done) { - // Write the quad without prefixes - delete this._prefixMatch; - - this._write(this.quadToString(subject, predicate, object, graph), done); - } // ### `quadToString` serializes a quad as a string - - - quadToString(subject, predicate, object, graph) { - return `${this._encodeSubject(subject)} ${this._encodeIriOrBlank(predicate)} ${this._encodeObject(object)}${graph && graph.value ? ` ${this._encodeIriOrBlank(graph)} .\n` : ' .\n'}`; - } // ### `quadsToString` serializes an array of quads as a string - - - quadsToString(quads) { - return quads.map(t => { - return this.quadToString(t.subject, t.predicate, t.object, t.graph); - }).join(''); - } // ### `_encodeSubject` represents a subject - - - _encodeSubject(entity) { - return entity.termType === 'Quad' ? this._encodeQuad(entity) : this._encodeIriOrBlank(entity); - } // ### `_encodeIriOrBlank` represents an IRI or blank node - - - _encodeIriOrBlank(entity) { - // A blank node or list is represented as-is - if (entity.termType !== 'NamedNode') { - // If it is a list head, pretty-print it - if (this._lists && entity.value in this._lists) entity = this.list(this._lists[entity.value]); - return 'id' in entity ? entity.id : `_:${entity.value}`; - } - - let iri = entity.value; // Use relative IRIs if requested and possible - - if (this._baseMatcher && this._baseMatcher.test(iri)) iri = iri.substr(this._baseLength); // Escape special characters - - if (escape.test(iri)) iri = iri.replace(escapeAll, characterReplacer); // Try to represent the IRI as prefixed name - - const prefixMatch = this._prefixRegex.exec(iri); - - return !prefixMatch ? `<${iri}>` : !prefixMatch[1] ? iri : this._prefixIRIs[prefixMatch[1]] + prefixMatch[2]; - } // ### `_encodeLiteral` represents a literal - - - _encodeLiteral(literal) { - // Escape special characters - let value = literal.value; - if (escape.test(value)) value = value.replace(escapeAll, characterReplacer); // Write a language-tagged literal - - if (literal.language) return `"${value}"@${literal.language}`; // Write dedicated literals per data type - - if (this._lineMode) { - // Only abbreviate strings in N-Triples or N-Quads - if (literal.datatype.value === xsd.string) return `"${value}"`; - } else { - // Use common datatype abbreviations in Turtle or TriG - switch (literal.datatype.value) { - case xsd.string: - return `"${value}"`; - - case xsd.boolean: - if (value === 'true' || value === 'false') return value; - break; - - case xsd.integer: - if (/^[+-]?\d+$/.test(value)) return value; - break; - - case xsd.decimal: - if (/^[+-]?\d*\.\d+$/.test(value)) return value; - break; - - case xsd.double: - if (/^[+-]?(?:\d+\.\d*|\.?\d+)[eE][+-]?\d+$/.test(value)) return value; - break; - } - } // Write a regular datatyped literal - - - return `"${value}"^^${this._encodeIriOrBlank(literal.datatype)}`; - } // ### `_encodePredicate` represents a predicate - - - _encodePredicate(predicate) { - return predicate.value === rdf.type ? 'a' : this._encodeIriOrBlank(predicate); - } // ### `_encodeObject` represents an object - - - _encodeObject(object) { - switch (object.termType) { - case 'Quad': - return this._encodeQuad(object); - - case 'Literal': - return this._encodeLiteral(object); - - default: - return this._encodeIriOrBlank(object); - } - } // ### `_encodeQuad` encodes an RDF* quad - - - _encodeQuad({ - subject, - predicate, - object, - graph - }) { - return `<<${this._encodeSubject(subject)} ${this._encodePredicate(predicate)} ${this._encodeObject(object)}${(0, _N3Util.isDefaultGraph)(graph) ? '' : ` ${this._encodeIriOrBlank(graph)}`}>>`; - } // ### `_blockedWrite` replaces `_write` after the writer has been closed - - - _blockedWrite() { - throw new Error('Cannot write because the writer has been closed.'); - } // ### `addQuad` adds the quad to the output stream - - - addQuad(subject, predicate, object, graph, done) { - // The quad was given as an object, so shift parameters - if (object === undefined) this._writeQuad(subject.subject, subject.predicate, subject.object, subject.graph, predicate); // The optional `graph` parameter was not provided - else if (typeof graph === 'function') this._writeQuad(subject, predicate, object, DEFAULTGRAPH, graph); // The `graph` parameter was provided - else this._writeQuad(subject, predicate, object, graph || DEFAULTGRAPH, done); - } // ### `addQuads` adds the quads to the output stream - - - addQuads(quads) { - for (let i = 0; i < quads.length; i++) this.addQuad(quads[i]); - } // ### `addPrefix` adds the prefix to the output stream - - - addPrefix(prefix, iri, done) { - const prefixes = {}; - prefixes[prefix] = iri; - this.addPrefixes(prefixes, done); - } // ### `addPrefixes` adds the prefixes to the output stream - - - addPrefixes(prefixes, done) { - // Ignore prefixes if not supported by the serialization - if (!this._prefixIRIs) return done && done(); // Write all new prefixes - - let hasPrefixes = false; - - for (let prefix in prefixes) { - let iri = prefixes[prefix]; - if (typeof iri !== 'string') iri = iri.value; - hasPrefixes = true; // Finish a possible pending quad - - if (this._subject !== null) { - this._write(this._inDefaultGraph ? '.\n' : '\n}\n'); - - this._subject = null, this._graph = ''; - } // Store and write the prefix - - - this._prefixIRIs[iri] = prefix += ':'; - - this._write(`@prefix ${prefix} <${iri}>.\n`); - } // Recreate the prefix matcher - - - if (hasPrefixes) { - let IRIlist = '', - prefixList = ''; - - for (const prefixIRI in this._prefixIRIs) { - IRIlist += IRIlist ? `|${prefixIRI}` : prefixIRI; - prefixList += (prefixList ? '|' : '') + this._prefixIRIs[prefixIRI]; - } - - IRIlist = escapeRegex(IRIlist, /[\]\/\(\)\*\+\?\.\\\$]/g, '\\$&'); - this._prefixRegex = new RegExp(`^(?:${prefixList})[^\/]*$|` + `^(${IRIlist})([a-zA-Z][\\-_a-zA-Z0-9]*)$`); - } // End a prefix block with a newline - - - this._write(hasPrefixes ? '\n' : '', done); - } // ### `blank` creates a blank node with the given content - - - blank(predicate, object) { - let children = predicate, - child, - length; // Empty blank node - - if (predicate === undefined) children = []; // Blank node passed as blank(Term("predicate"), Term("object")) - else if (predicate.termType) children = [{ - predicate: predicate, - object: object - }]; // Blank node passed as blank({ predicate: predicate, object: object }) - else if (!('length' in predicate)) children = [predicate]; - - switch (length = children.length) { - // Generate an empty blank node - case 0: - return new SerializedTerm('[]'); - // Generate a non-nested one-triple blank node - - case 1: - child = children[0]; - if (!(child.object instanceof SerializedTerm)) return new SerializedTerm(`[ ${this._encodePredicate(child.predicate)} ${this._encodeObject(child.object)} ]`); - // Generate a multi-triple or nested blank node - - default: - let contents = '['; // Write all triples in order - - for (let i = 0; i < length; i++) { - child = children[i]; // Write only the object is the predicate is the same as the previous - - if (child.predicate.equals(predicate)) contents += `, ${this._encodeObject(child.object)}`; // Otherwise, write the predicate and the object - else { - contents += `${(i ? ';\n ' : '\n ') + this._encodePredicate(child.predicate)} ${this._encodeObject(child.object)}`; - predicate = child.predicate; - } - } - - return new SerializedTerm(`${contents}\n]`); - } - } // ### `list` creates a list node with the given content - - - list(elements) { - const length = elements && elements.length || 0, - contents = new Array(length); - - for (let i = 0; i < length; i++) contents[i] = this._encodeObject(elements[i]); - - return new SerializedTerm(`(${contents.join(' ')})`); - } // ### `end` signals the end of the output stream - - - end(done) { - // Finish a possible pending quad - if (this._subject !== null) { - this._write(this._inDefaultGraph ? '.\n' : '\n}\n'); - - this._subject = null; - } // Disallow further writing - - - this._write = this._blockedWrite; // Try to end the underlying stream, ensuring done is called exactly one time - - let singleDone = done && ((error, result) => { - singleDone = null, done(error, result); - }); - - if (this._endStream) { - try { - return this._outputStream.end(singleDone); - } catch (error) { - /* error closing stream */ - } - } - - singleDone && singleDone(); - } - -} // Replaces a character by its escaped version - - -exports.default = N3Writer; - -function characterReplacer(character) { - // Replace a single character by its escaped version - let result = escapedCharacters[character]; - - if (result === undefined) { - // Replace a single character with its 4-bit unicode escape sequence - if (character.length === 1) { - result = character.charCodeAt(0).toString(16); - result = '\\u0000'.substr(0, 6 - result.length) + result; - } // Replace a surrogate pair with its 8-bit unicode escape sequence - else { - result = ((character.charCodeAt(0) - 0xD800) * 0x400 + character.charCodeAt(1) + 0x2400).toString(16); - result = '\\U00000000'.substr(0, 10 - result.length) + result; - } - } - - return result; -} - -function escapeRegex(regex) { - return regex.replace(/[\]\/\(\)\*\+\?\.\\\$]/g, '\\$&'); -} -},{"./IRIs":34,"./N3DataFactory":35,"./N3Util":41}],43:[function(require,module,exports){ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -Object.defineProperty(exports, "BlankNode", { - enumerable: true, - get: function () { - return _N3DataFactory.BlankNode; - } -}); -Object.defineProperty(exports, "DataFactory", { - enumerable: true, - get: function () { - return _N3DataFactory.default; - } -}); -Object.defineProperty(exports, "DefaultGraph", { - enumerable: true, - get: function () { - return _N3DataFactory.DefaultGraph; - } -}); -Object.defineProperty(exports, "Lexer", { - enumerable: true, - get: function () { - return _N3Lexer.default; - } -}); -Object.defineProperty(exports, "Literal", { - enumerable: true, - get: function () { - return _N3DataFactory.Literal; - } -}); -Object.defineProperty(exports, "NamedNode", { - enumerable: true, - get: function () { - return _N3DataFactory.NamedNode; - } -}); -Object.defineProperty(exports, "Parser", { - enumerable: true, - get: function () { - return _N3Parser.default; - } -}); -Object.defineProperty(exports, "Quad", { - enumerable: true, - get: function () { - return _N3DataFactory.Quad; - } -}); -Object.defineProperty(exports, "Store", { - enumerable: true, - get: function () { - return _N3Store.default; - } -}); -Object.defineProperty(exports, "StreamParser", { - enumerable: true, - get: function () { - return _N3StreamParser.default; - } -}); -Object.defineProperty(exports, "StreamWriter", { - enumerable: true, - get: function () { - return _N3StreamWriter.default; - } -}); -Object.defineProperty(exports, "Term", { - enumerable: true, - get: function () { - return _N3DataFactory.Term; - } -}); -Object.defineProperty(exports, "Triple", { - enumerable: true, - get: function () { - return _N3DataFactory.Triple; - } -}); -exports.Util = void 0; -Object.defineProperty(exports, "Variable", { - enumerable: true, - get: function () { - return _N3DataFactory.Variable; - } -}); -Object.defineProperty(exports, "Writer", { - enumerable: true, - get: function () { - return _N3Writer.default; - } -}); -exports.default = void 0; -Object.defineProperty(exports, "termFromId", { - enumerable: true, - get: function () { - return _N3DataFactory.termFromId; - } -}); -Object.defineProperty(exports, "termToId", { - enumerable: true, - get: function () { - return _N3DataFactory.termToId; - } -}); - -var _N3Lexer = _interopRequireDefault(require("./N3Lexer")); - -var _N3Parser = _interopRequireDefault(require("./N3Parser")); - -var _N3Writer = _interopRequireDefault(require("./N3Writer")); - -var _N3Store = _interopRequireDefault(require("./N3Store")); - -var _N3StreamParser = _interopRequireDefault(require("./N3StreamParser")); - -var _N3StreamWriter = _interopRequireDefault(require("./N3StreamWriter")); - -var Util = _interopRequireWildcard(require("./N3Util")); - -exports.Util = Util; - -var _N3DataFactory = _interopRequireWildcard(require("./N3DataFactory")); - -function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } - -function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -// Named exports -// Export all named exports as a default object for backward compatibility -var _default = { - Lexer: _N3Lexer.default, - Parser: _N3Parser.default, - Writer: _N3Writer.default, - Store: _N3Store.default, - StreamParser: _N3StreamParser.default, - StreamWriter: _N3StreamWriter.default, - Util, - DataFactory: _N3DataFactory.default, - Term: _N3DataFactory.Term, - NamedNode: _N3DataFactory.NamedNode, - Literal: _N3DataFactory.Literal, - BlankNode: _N3DataFactory.BlankNode, - Variable: _N3DataFactory.Variable, - DefaultGraph: _N3DataFactory.DefaultGraph, - Quad: _N3DataFactory.Quad, - Triple: _N3DataFactory.Triple, - termFromId: _N3DataFactory.termFromId, - termToId: _N3DataFactory.termToId -}; -exports.default = _default; -},{"./N3DataFactory":35,"./N3Lexer":36,"./N3Parser":37,"./N3Store":38,"./N3StreamParser":39,"./N3StreamWriter":40,"./N3Util":41,"./N3Writer":42}],44:[function(require,module,exports){ -// shim for using process in browser -var process = module.exports = {}; - -// cached from whatever global is present so that test runners that stub it -// don't break things. But we need to wrap it in a try catch in case it is -// wrapped in strict mode code which doesn't define any globals. It's inside a -// function because try/catches deoptimize in certain engines. - -var cachedSetTimeout; -var cachedClearTimeout; - -function defaultSetTimout() { - throw new Error('setTimeout has not been defined'); -} -function defaultClearTimeout () { - throw new Error('clearTimeout has not been defined'); -} -(function () { - try { - if (typeof setTimeout === 'function') { - cachedSetTimeout = setTimeout; - } else { - cachedSetTimeout = defaultSetTimout; - } - } catch (e) { - cachedSetTimeout = defaultSetTimout; - } - try { - if (typeof clearTimeout === 'function') { - cachedClearTimeout = clearTimeout; - } else { - cachedClearTimeout = defaultClearTimeout; - } - } catch (e) { - cachedClearTimeout = defaultClearTimeout; - } -} ()) -function runTimeout(fun) { - if (cachedSetTimeout === setTimeout) { - //normal enviroments in sane situations - return setTimeout(fun, 0); - } - // if setTimeout wasn't available but was latter defined - if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { - cachedSetTimeout = setTimeout; - return setTimeout(fun, 0); - } - try { - // when when somebody has screwed with setTimeout but no I.E. maddness - return cachedSetTimeout(fun, 0); - } catch(e){ - try { - // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally - return cachedSetTimeout.call(null, fun, 0); - } catch(e){ - // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error - return cachedSetTimeout.call(this, fun, 0); - } - } - - -} -function runClearTimeout(marker) { - if (cachedClearTimeout === clearTimeout) { - //normal enviroments in sane situations - return clearTimeout(marker); - } - // if clearTimeout wasn't available but was latter defined - if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { - cachedClearTimeout = clearTimeout; - return clearTimeout(marker); - } - try { - // when when somebody has screwed with setTimeout but no I.E. maddness - return cachedClearTimeout(marker); - } catch (e){ - try { - // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally - return cachedClearTimeout.call(null, marker); - } catch (e){ - // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. - // Some versions of I.E. have different rules for clearTimeout vs setTimeout - return cachedClearTimeout.call(this, marker); - } - } - - - -} -var queue = []; -var draining = false; -var currentQueue; -var queueIndex = -1; - -function cleanUpNextTick() { - if (!draining || !currentQueue) { - return; - } - draining = false; - if (currentQueue.length) { - queue = currentQueue.concat(queue); - } else { - queueIndex = -1; - } - if (queue.length) { - drainQueue(); - } -} - -function drainQueue() { - if (draining) { - return; - } - var timeout = runTimeout(cleanUpNextTick); - draining = true; - - var len = queue.length; - while(len) { - currentQueue = queue; - queue = []; - while (++queueIndex < len) { - if (currentQueue) { - currentQueue[queueIndex].run(); - } - } - queueIndex = -1; - len = queue.length; - } - currentQueue = null; - draining = false; - runClearTimeout(timeout); -} - -process.nextTick = function (fun) { - var args = new Array(arguments.length - 1); - if (arguments.length > 1) { - for (var i = 1; i < arguments.length; i++) { - args[i - 1] = arguments[i]; - } - } - queue.push(new Item(fun, args)); - if (queue.length === 1 && !draining) { - runTimeout(drainQueue); - } -}; - -// v8 likes predictible objects -function Item(fun, array) { - this.fun = fun; - this.array = array; -} -Item.prototype.run = function () { - this.fun.apply(null, this.array); -}; -process.title = 'browser'; -process.browser = true; -process.env = {}; -process.argv = []; -process.version = ''; // empty string to avoid regexp issues -process.versions = {}; - -function noop() {} - -process.on = noop; -process.addListener = noop; -process.once = noop; -process.off = noop; -process.removeListener = noop; -process.removeAllListeners = noop; -process.emit = noop; -process.prependListener = noop; -process.prependOnceListener = noop; - -process.listeners = function (name) { return [] } - -process.binding = function (name) { - throw new Error('process.binding is not supported'); -}; - -process.cwd = function () { return '/' }; -process.chdir = function (dir) { - throw new Error('process.chdir is not supported'); -}; -process.umask = function() { return 0; }; - -},{}],45:[function(require,module,exports){ -(function (global){(function (){ -/*! queue-microtask. MIT License. Feross Aboukhadijeh */ -let promise - -module.exports = typeof queueMicrotask === 'function' - ? queueMicrotask.bind(typeof window !== 'undefined' ? window : global) - // reuse resolved promise, and allocate it lazily - : cb => (promise || (promise = Promise.resolve())) - .then(cb) - .catch(err => setTimeout(() => { throw err }, 0)) - -}).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{}],46:[function(require,module,exports){ -/** - * An implementation of the RDF Dataset Normalization specification. - * - * @author Dave Longley - * - * Copyright 2010-2021 Digital Bazaar, Inc. - */ -module.exports = require('./lib'); - -},{"./lib":55}],47:[function(require,module,exports){ -/* - * Copyright (c) 2016-2021 Digital Bazaar, Inc. All rights reserved. - */ -'use strict'; - -module.exports = class IdentifierIssuer { - /** - * Creates a new IdentifierIssuer. A IdentifierIssuer issues unique - * identifiers, keeping track of any previously issued identifiers. - * - * @param prefix the prefix to use (''). - * @param existing an existing Map to use. - * @param counter the counter to use. - */ - constructor(prefix, existing = new Map(), counter = 0) { - this.prefix = prefix; - this._existing = existing; - this.counter = counter; - } - - /** - * Copies this IdentifierIssuer. - * - * @return a copy of this IdentifierIssuer. - */ - clone() { - const {prefix, _existing, counter} = this; - return new IdentifierIssuer(prefix, new Map(_existing), counter); - } - - /** - * Gets the new identifier for the given old identifier, where if no old - * identifier is given a new identifier will be generated. - * - * @param [old] the old identifier to get the new identifier for. - * - * @return the new identifier. - */ - getId(old) { - // return existing old identifier - const existing = old && this._existing.get(old); - if(existing) { - return existing; - } - - // get next identifier - const identifier = this.prefix + this.counter; - this.counter++; - - // save mapping - if(old) { - this._existing.set(old, identifier); - } - - return identifier; - } - - /** - * Returns true if the given old identifer has already been assigned a new - * identifier. - * - * @param old the old identifier to check. - * - * @return true if the old identifier has been assigned a new identifier, - * false if not. - */ - hasId(old) { - return this._existing.has(old); - } - - /** - * Returns all of the IDs that have been issued new IDs in the order in - * which they were issued new IDs. - * - * @return the list of old IDs that has been issued new IDs in order. - */ - getOldIds() { - return [...this._existing.keys()]; - } -}; - -},{}],48:[function(require,module,exports){ -/* - * Copyright (c) 2016-2021 Digital Bazaar, Inc. All rights reserved. - */ -'use strict'; - -require('setimmediate'); - -const crypto = self.crypto || self.msCrypto; - -// TODO: synchronous version no longer supported in browser - -module.exports = class MessageDigest { - /** - * Creates a new MessageDigest. - * - * @param algorithm the algorithm to use. - */ - constructor(algorithm) { - // check if crypto.subtle is available - // check is here rather than top-level to only fail if class is used - if(!(crypto && crypto.subtle)) { - throw new Error('crypto.subtle not found.'); - } - if(algorithm === 'sha256') { - this.algorithm = {name: 'SHA-256'}; - } else if(algorithm === 'sha1') { - this.algorithm = {name: 'SHA-1'}; - } else { - throw new Error(`Unsupport algorithm "${algorithm}".`); - } - this._content = ''; - } - - update(msg) { - this._content += msg; - } - - async digest() { - const data = new TextEncoder().encode(this._content); - const buffer = new Uint8Array( - await crypto.subtle.digest(this.algorithm, data)); - // return digest in hex - let hex = ''; - for(let i = 0; i < buffer.length; ++i) { - hex += buffer[i].toString(16).padStart(2, '0'); - } - return hex; - } -}; - -},{"setimmediate":86}],49:[function(require,module,exports){ -/* - * Copyright (c) 2016-2021 Digital Bazaar, Inc. All rights reserved. - */ -'use strict'; - -// eslint-disable-next-line no-unused-vars -const TERMS = ['subject', 'predicate', 'object', 'graph']; -const RDF = 'http://www.w3.org/1999/02/22-rdf-syntax-ns#'; -const RDF_LANGSTRING = RDF + 'langString'; -const XSD_STRING = 'http://www.w3.org/2001/XMLSchema#string'; - -const TYPE_NAMED_NODE = 'NamedNode'; -const TYPE_BLANK_NODE = 'BlankNode'; -const TYPE_LITERAL = 'Literal'; -const TYPE_DEFAULT_GRAPH = 'DefaultGraph'; - -// build regexes -const REGEX = {}; -(() => { - const iri = '(?:<([^:]+:[^>]*)>)'; - // https://www.w3.org/TR/turtle/#grammar-production-BLANK_NODE_LABEL - const PN_CHARS_BASE = - 'A-Z' + 'a-z' + - '\u00C0-\u00D6' + - '\u00D8-\u00F6' + - '\u00F8-\u02FF' + - '\u0370-\u037D' + - '\u037F-\u1FFF' + - '\u200C-\u200D' + - '\u2070-\u218F' + - '\u2C00-\u2FEF' + - '\u3001-\uD7FF' + - '\uF900-\uFDCF' + - '\uFDF0-\uFFFD'; - // TODO: - //'\u10000-\uEFFFF'; - const PN_CHARS_U = - PN_CHARS_BASE + - '_'; - const PN_CHARS = - PN_CHARS_U + - '0-9' + - '-' + - '\u00B7' + - '\u0300-\u036F' + - '\u203F-\u2040'; - const BLANK_NODE_LABEL = - '(_:' + - '(?:[' + PN_CHARS_U + '0-9])' + - '(?:(?:[' + PN_CHARS + '.])*(?:[' + PN_CHARS + ']))?' + - ')'; - const bnode = BLANK_NODE_LABEL; - const plain = '"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)"'; - const datatype = '(?:\\^\\^' + iri + ')'; - const language = '(?:@([a-zA-Z]+(?:-[a-zA-Z0-9]+)*))'; - const literal = '(?:' + plain + '(?:' + datatype + '|' + language + ')?)'; - const ws = '[ \\t]+'; - const wso = '[ \\t]*'; - - // define quad part regexes - const subject = '(?:' + iri + '|' + bnode + ')' + ws; - const property = iri + ws; - const object = '(?:' + iri + '|' + bnode + '|' + literal + ')' + wso; - const graphName = '(?:\\.|(?:(?:' + iri + '|' + bnode + ')' + wso + '\\.))'; - - // end of line and empty regexes - REGEX.eoln = /(?:\r\n)|(?:\n)|(?:\r)/g; - REGEX.empty = new RegExp('^' + wso + '$'); - - // full quad regex - REGEX.quad = new RegExp( - '^' + wso + subject + property + object + graphName + wso + '$'); -})(); - -module.exports = class NQuads { - /** - * Parses RDF in the form of N-Quads. - * - * @param input the N-Quads input to parse. - * - * @return an RDF dataset (an array of quads per http://rdf.js.org/). - */ - static parse(input) { - // build RDF dataset - const dataset = []; - - const graphs = {}; - - // split N-Quad input into lines - const lines = input.split(REGEX.eoln); - let lineNumber = 0; - for(const line of lines) { - lineNumber++; - - // skip empty lines - if(REGEX.empty.test(line)) { - continue; - } - - // parse quad - const match = line.match(REGEX.quad); - if(match === null) { - throw new Error('N-Quads parse error on line ' + lineNumber + '.'); - } - - // create RDF quad - const quad = {subject: null, predicate: null, object: null, graph: null}; - - // get subject - if(match[1] !== undefined) { - quad.subject = {termType: TYPE_NAMED_NODE, value: match[1]}; - } else { - quad.subject = {termType: TYPE_BLANK_NODE, value: match[2]}; - } - - // get predicate - quad.predicate = {termType: TYPE_NAMED_NODE, value: match[3]}; - - // get object - if(match[4] !== undefined) { - quad.object = {termType: TYPE_NAMED_NODE, value: match[4]}; - } else if(match[5] !== undefined) { - quad.object = {termType: TYPE_BLANK_NODE, value: match[5]}; - } else { - quad.object = { - termType: TYPE_LITERAL, - value: undefined, - datatype: { - termType: TYPE_NAMED_NODE - } - }; - if(match[7] !== undefined) { - quad.object.datatype.value = match[7]; - } else if(match[8] !== undefined) { - quad.object.datatype.value = RDF_LANGSTRING; - quad.object.language = match[8]; - } else { - quad.object.datatype.value = XSD_STRING; - } - quad.object.value = _unescape(match[6]); - } - - // get graph - if(match[9] !== undefined) { - quad.graph = { - termType: TYPE_NAMED_NODE, - value: match[9] - }; - } else if(match[10] !== undefined) { - quad.graph = { - termType: TYPE_BLANK_NODE, - value: match[10] - }; - } else { - quad.graph = { - termType: TYPE_DEFAULT_GRAPH, - value: '' - }; - } - - // only add quad if it is unique in its graph - if(!(quad.graph.value in graphs)) { - graphs[quad.graph.value] = [quad]; - dataset.push(quad); - } else { - let unique = true; - const quads = graphs[quad.graph.value]; - for(const q of quads) { - if(_compareTriples(q, quad)) { - unique = false; - break; - } - } - if(unique) { - quads.push(quad); - dataset.push(quad); - } - } - } - - return dataset; - } - - /** - * Converts an RDF dataset to N-Quads. - * - * @param dataset (array of quads) the RDF dataset to convert. - * - * @return the N-Quads string. - */ - static serialize(dataset) { - if(!Array.isArray(dataset)) { - dataset = NQuads.legacyDatasetToQuads(dataset); - } - const quads = []; - for(const quad of dataset) { - quads.push(NQuads.serializeQuad(quad)); - } - return quads.sort().join(''); - } - - /** - * Converts an RDF quad to an N-Quad string (a single quad). - * - * @param quad the RDF quad convert. - * - * @return the N-Quad string. - */ - static serializeQuad(quad) { - const s = quad.subject; - const p = quad.predicate; - const o = quad.object; - const g = quad.graph; - - let nquad = ''; - - // subject can only be NamedNode or BlankNode - if(s.termType === TYPE_NAMED_NODE) { - nquad += `<${s.value}>`; - } else { - nquad += `${s.value}`; - } - - // predicate can only be NamedNode - nquad += ` <${p.value}> `; - - // object is NamedNode, BlankNode, or Literal - if(o.termType === TYPE_NAMED_NODE) { - nquad += `<${o.value}>`; - } else if(o.termType === TYPE_BLANK_NODE) { - nquad += o.value; - } else { - nquad += `"${_escape(o.value)}"`; - if(o.datatype.value === RDF_LANGSTRING) { - if(o.language) { - nquad += `@${o.language}`; - } - } else if(o.datatype.value !== XSD_STRING) { - nquad += `^^<${o.datatype.value}>`; - } - } - - // graph can only be NamedNode or BlankNode (or DefaultGraph, but that - // does not add to `nquad`) - if(g.termType === TYPE_NAMED_NODE) { - nquad += ` <${g.value}>`; - } else if(g.termType === TYPE_BLANK_NODE) { - nquad += ` ${g.value}`; - } - - nquad += ' .\n'; - return nquad; - } - - /** - * Converts a legacy-formatted dataset to an array of quads dataset per - * http://rdf.js.org/. - * - * @param dataset the legacy dataset to convert. - * - * @return the array of quads dataset. - */ - static legacyDatasetToQuads(dataset) { - const quads = []; - - const termTypeMap = { - 'blank node': TYPE_BLANK_NODE, - IRI: TYPE_NAMED_NODE, - literal: TYPE_LITERAL - }; - - for(const graphName in dataset) { - const triples = dataset[graphName]; - triples.forEach(triple => { - const quad = {}; - for(const componentName in triple) { - const oldComponent = triple[componentName]; - const newComponent = { - termType: termTypeMap[oldComponent.type], - value: oldComponent.value - }; - if(newComponent.termType === TYPE_LITERAL) { - newComponent.datatype = { - termType: TYPE_NAMED_NODE - }; - if('datatype' in oldComponent) { - newComponent.datatype.value = oldComponent.datatype; - } - if('language' in oldComponent) { - if(!('datatype' in oldComponent)) { - newComponent.datatype.value = RDF_LANGSTRING; - } - newComponent.language = oldComponent.language; - } else if(!('datatype' in oldComponent)) { - newComponent.datatype.value = XSD_STRING; - } - } - quad[componentName] = newComponent; - } - if(graphName === '@default') { - quad.graph = { - termType: TYPE_DEFAULT_GRAPH, - value: '' - }; - } else { - quad.graph = { - termType: graphName.startsWith('_:') ? - TYPE_BLANK_NODE : TYPE_NAMED_NODE, - value: graphName - }; - } - quads.push(quad); - }); - } - - return quads; - } -}; - -/** - * Compares two RDF triples for equality. - * - * @param t1 the first triple. - * @param t2 the second triple. - * - * @return true if the triples are the same, false if not. - */ -function _compareTriples(t1, t2) { - // compare subject and object types first as it is the quickest check - if(!(t1.subject.termType === t2.subject.termType && - t1.object.termType === t2.object.termType)) { - return false; - } - // compare values - if(!(t1.subject.value === t2.subject.value && - t1.predicate.value === t2.predicate.value && - t1.object.value === t2.object.value)) { - return false; - } - if(t1.object.termType !== TYPE_LITERAL) { - // no `datatype` or `language` to check - return true; - } - return ( - (t1.object.datatype.termType === t2.object.datatype.termType) && - (t1.object.language === t2.object.language) && - (t1.object.datatype.value === t2.object.datatype.value) - ); -} - -const _escapeRegex = /["\\\n\r]/g; -/** - * Escape string to N-Quads literal - */ -function _escape(s) { - return s.replace(_escapeRegex, function(match) { - switch(match) { - case '"': return '\\"'; - case '\\': return '\\\\'; - case '\n': return '\\n'; - case '\r': return '\\r'; - } - }); -} - -const _unescapeRegex = - /(?:\\([tbnrf"'\\]))|(?:\\u([0-9A-Fa-f]{4}))|(?:\\U([0-9A-Fa-f]{8}))/g; -/** - * Unescape N-Quads literal to string - */ -function _unescape(s) { - return s.replace(_unescapeRegex, function(match, code, u, U) { - if(code) { - switch(code) { - 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(u) { - return String.fromCharCode(parseInt(u, 16)); - } - if(U) { - // FIXME: support larger values - throw new Error('Unsupported U escape'); - } - }); -} - -},{}],50:[function(require,module,exports){ -/* - * Copyright (c) 2016-2021 Digital Bazaar, Inc. All rights reserved. - */ -'use strict'; - -// TODO: convert to ES6 iterable? - -module.exports = class Permuter { - /** - * A Permuter iterates over all possible permutations of the given array - * of elements. - * - * @param list the array of elements to iterate over. - */ - constructor(list) { - // original array - this.current = list.sort(); - // indicates whether there are more permutations - this.done = false; - // directional info for permutation algorithm - this.dir = new Map(); - for(let i = 0; i < list.length; ++i) { - this.dir.set(list[i], true); - } - } - - /** - * Returns true if there is another permutation. - * - * @return true if there is another permutation, false if not. - */ - hasNext() { - return !this.done; - } - - /** - * Gets the next permutation. Call hasNext() to ensure there is another one - * first. - * - * @return the next permutation. - */ - next() { - // copy current permutation to return it - const {current, dir} = this; - const rval = current.slice(); - - /* Calculate the next permutation using the Steinhaus-Johnson-Trotter - permutation algorithm. */ - - // get largest mobile element k - // (mobile: element is greater than the one it is looking at) - let k = null; - let pos = 0; - const length = current.length; - for(let i = 0; i < length; ++i) { - const element = current[i]; - const left = dir.get(element); - if((k === null || element > k) && - ((left && i > 0 && element > current[i - 1]) || - (!left && i < (length - 1) && element > current[i + 1]))) { - k = element; - pos = i; - } - } - - // no more permutations - if(k === null) { - this.done = true; - } else { - // swap k and the element it is looking at - const swap = dir.get(k) ? pos - 1 : pos + 1; - current[pos] = current[swap]; - current[swap] = k; - - // reverse the direction of all elements larger than k - for(const element of current) { - if(element > k) { - dir.set(element, !dir.get(element)); - } - } - } - - return rval; - } -}; - -},{}],51:[function(require,module,exports){ -(function (setImmediate){(function (){ -/* - * Copyright (c) 2016-2021 Digital Bazaar, Inc. All rights reserved. - */ -'use strict'; - -const IdentifierIssuer = require('./IdentifierIssuer'); -const MessageDigest = require('./MessageDigest'); -const Permuter = require('./Permuter'); -const NQuads = require('./NQuads'); - -module.exports = class URDNA2015 { - constructor() { - this.name = 'URDNA2015'; - this.blankNodeInfo = new Map(); - this.canonicalIssuer = new IdentifierIssuer('_:c14n'); - this.hashAlgorithm = 'sha256'; - this.quads = null; - } - - // 4.4) Normalization Algorithm - async main(dataset) { - this.quads = dataset; - - // 1) Create the normalization state. - // 2) For every quad in input dataset: - for(const quad of dataset) { - // 2.1) For each blank node that occurs in the quad, add a reference - // to the quad using the blank node identifier in the blank node to - // quads map, creating a new entry if necessary. - this._addBlankNodeQuadInfo({quad, component: quad.subject}); - this._addBlankNodeQuadInfo({quad, component: quad.object}); - this._addBlankNodeQuadInfo({quad, component: quad.graph}); - } - - // 3) Create a list of non-normalized blank node identifiers - // non-normalized identifiers and populate it using the keys from the - // blank node to quads map. - // Note: We use a map here and it was generated during step 2. - - // 4) `simple` flag is skipped -- loop is optimized away. This optimization - // is permitted because there was a typo in the hash first degree quads - // algorithm in the URDNA2015 spec that was implemented widely making it - // such that it could not be fixed; the result was that the loop only - // needs to be run once and the first degree quad hashes will never change. - // 5.1-5.2 are skipped; first degree quad hashes are generated just once - // for all non-normalized blank nodes. - - // 5.3) For each blank node identifier identifier in non-normalized - // identifiers: - const hashToBlankNodes = new Map(); - const nonNormalized = [...this.blankNodeInfo.keys()]; - let i = 0; - for(const id of nonNormalized) { - // Note: batch hashing first degree quads 100 at a time - if(++i % 100 === 0) { - await this._yield(); - } - // steps 5.3.1 and 5.3.2: - await this._hashAndTrackBlankNode({id, hashToBlankNodes}); - } - - // 5.4) For each hash to identifier list mapping in hash to blank - // nodes map, lexicographically-sorted by hash: - const hashes = [...hashToBlankNodes.keys()].sort(); - // optimize away second sort, gather non-unique hashes in order as we go - const nonUnique = []; - for(const hash of hashes) { - // 5.4.1) If the length of identifier list is greater than 1, - // continue to the next mapping. - const idList = hashToBlankNodes.get(hash); - if(idList.length > 1) { - nonUnique.push(idList); - continue; - } - - // 5.4.2) Use the Issue Identifier algorithm, passing canonical - // issuer and the single blank node identifier in identifier - // list, identifier, to issue a canonical replacement identifier - // for identifier. - const id = idList[0]; - this.canonicalIssuer.getId(id); - - // Note: These steps are skipped, optimized away since the loop - // only needs to be run once. - // 5.4.3) Remove identifier from non-normalized identifiers. - // 5.4.4) Remove hash from the hash to blank nodes map. - // 5.4.5) Set simple to true. - } - - // 6) For each hash to identifier list mapping in hash to blank nodes map, - // lexicographically-sorted by hash: - // Note: sort optimized away, use `nonUnique`. - for(const idList of nonUnique) { - // 6.1) Create hash path list where each item will be a result of - // running the Hash N-Degree Quads algorithm. - const hashPathList = []; - - // 6.2) For each blank node identifier identifier in identifier list: - for(const id of idList) { - // 6.2.1) If a canonical identifier has already been issued for - // identifier, continue to the next identifier. - if(this.canonicalIssuer.hasId(id)) { - continue; - } - - // 6.2.2) Create temporary issuer, an identifier issuer - // initialized with the prefix _:b. - const issuer = new IdentifierIssuer('_:b'); - - // 6.2.3) Use the Issue Identifier algorithm, passing temporary - // issuer and identifier, to issue a new temporary blank node - // identifier for identifier. - issuer.getId(id); - - // 6.2.4) Run the Hash N-Degree Quads algorithm, passing - // temporary issuer, and append the result to the hash path list. - const result = await this.hashNDegreeQuads(id, issuer); - hashPathList.push(result); - } - - // 6.3) For each result in the hash path list, - // lexicographically-sorted by the hash in result: - hashPathList.sort(_stringHashCompare); - for(const result of hashPathList) { - // 6.3.1) For each blank node identifier, existing identifier, - // that was issued a temporary identifier by identifier issuer - // in result, issue a canonical identifier, in the same order, - // using the Issue Identifier algorithm, passing canonical - // issuer and existing identifier. - const oldIds = result.issuer.getOldIds(); - for(const id of oldIds) { - this.canonicalIssuer.getId(id); - } - } - } - - /* Note: At this point all blank nodes in the set of RDF quads have been - assigned canonical identifiers, which have been stored in the canonical - issuer. Here each quad is updated by assigning each of its blank nodes - its new identifier. */ - - // 7) For each quad, quad, in input dataset: - const normalized = []; - for(const quad of this.quads) { - // 7.1) Create a copy, quad copy, of quad and replace any existing - // blank node identifiers using the canonical identifiers - // previously issued by canonical issuer. - // Note: We optimize with shallow copies here. - const q = {...quad}; - q.subject = this._useCanonicalId({component: q.subject}); - q.object = this._useCanonicalId({component: q.object}); - q.graph = this._useCanonicalId({component: q.graph}); - // 7.2) Add quad copy to the normalized dataset. - normalized.push(NQuads.serializeQuad(q)); - } - - // sort normalized output - normalized.sort(); - - // 8) Return the normalized dataset. - return normalized.join(''); - } - - // 4.6) Hash First Degree Quads - async hashFirstDegreeQuads(id) { - // 1) Initialize nquads to an empty list. It will be used to store quads in - // N-Quads format. - const nquads = []; - - // 2) Get the list of quads `quads` associated with the reference blank node - // identifier in the blank node to quads map. - const info = this.blankNodeInfo.get(id); - const quads = info.quads; - - // 3) For each quad `quad` in `quads`: - for(const quad of quads) { - // 3.1) Serialize the quad in N-Quads format with the following special - // rule: - - // 3.1.1) If any component in quad is an blank node, then serialize it - // using a special identifier as follows: - const copy = { - subject: null, predicate: quad.predicate, object: null, graph: null - }; - // 3.1.2) If the blank node's existing blank node identifier matches - // the reference blank node identifier then use the blank node - // identifier _:a, otherwise, use the blank node identifier _:z. - copy.subject = this.modifyFirstDegreeComponent( - id, quad.subject, 'subject'); - copy.object = this.modifyFirstDegreeComponent( - id, quad.object, 'object'); - copy.graph = this.modifyFirstDegreeComponent( - id, quad.graph, 'graph'); - nquads.push(NQuads.serializeQuad(copy)); - } - - // 4) Sort nquads in lexicographical order. - nquads.sort(); - - // 5) Return the hash that results from passing the sorted, joined nquads - // through the hash algorithm. - const md = new MessageDigest(this.hashAlgorithm); - for(const nquad of nquads) { - md.update(nquad); - } - info.hash = await md.digest(); - return info.hash; - } - - // 4.7) Hash Related Blank Node - async hashRelatedBlankNode(related, quad, issuer, position) { - // 1) Set the identifier to use for related, preferring first the canonical - // identifier for related if issued, second the identifier issued by issuer - // if issued, and last, if necessary, the result of the Hash First Degree - // Quads algorithm, passing related. - let id; - if(this.canonicalIssuer.hasId(related)) { - id = this.canonicalIssuer.getId(related); - } else if(issuer.hasId(related)) { - id = issuer.getId(related); - } else { - id = this.blankNodeInfo.get(related).hash; - } - - // 2) Initialize a string input to the value of position. - // Note: We use a hash object instead. - const md = new MessageDigest(this.hashAlgorithm); - md.update(position); - - // 3) If position is not g, append <, the value of the predicate in quad, - // and > to input. - if(position !== 'g') { - md.update(this.getRelatedPredicate(quad)); - } - - // 4) Append identifier to input. - md.update(id); - - // 5) Return the hash that results from passing input through the hash - // algorithm. - return md.digest(); - } - - // 4.8) Hash N-Degree Quads - async hashNDegreeQuads(id, issuer) { - // 1) Create a hash to related blank nodes map for storing hashes that - // identify related blank nodes. - // Note: 2) and 3) handled within `createHashToRelated` - const md = new MessageDigest(this.hashAlgorithm); - const hashToRelated = await this.createHashToRelated(id, issuer); - - // 4) Create an empty string, data to hash. - // Note: We created a hash object `md` above instead. - - // 5) For each related hash to blank node list mapping in hash to related - // blank nodes map, sorted lexicographically by related hash: - const hashes = [...hashToRelated.keys()].sort(); - for(const hash of hashes) { - // 5.1) Append the related hash to the data to hash. - md.update(hash); - - // 5.2) Create a string chosen path. - let chosenPath = ''; - - // 5.3) Create an unset chosen issuer variable. - let chosenIssuer; - - // 5.4) For each permutation of blank node list: - const permuter = new Permuter(hashToRelated.get(hash)); - let i = 0; - while(permuter.hasNext()) { - const permutation = permuter.next(); - // Note: batch permutations 3 at a time - if(++i % 3 === 0) { - await this._yield(); - } - - // 5.4.1) Create a copy of issuer, issuer copy. - let issuerCopy = issuer.clone(); - - // 5.4.2) Create a string path. - let path = ''; - - // 5.4.3) Create a recursion list, to store blank node identifiers - // that must be recursively processed by this algorithm. - const recursionList = []; - - // 5.4.4) For each related in permutation: - let nextPermutation = false; - for(const related of permutation) { - // 5.4.4.1) If a canonical identifier has been issued for - // related, append it to path. - if(this.canonicalIssuer.hasId(related)) { - path += this.canonicalIssuer.getId(related); - } else { - // 5.4.4.2) Otherwise: - // 5.4.4.2.1) If issuer copy has not issued an identifier for - // related, append related to recursion list. - if(!issuerCopy.hasId(related)) { - recursionList.push(related); - } - // 5.4.4.2.2) Use the Issue Identifier algorithm, passing - // issuer copy and related and append the result to path. - path += issuerCopy.getId(related); - } - - // 5.4.4.3) If chosen path is not empty and the length of path - // is greater than or equal to the length of chosen path and - // path is lexicographically greater than chosen path, then - // skip to the next permutation. - // Note: Comparing path length to chosen path length can be optimized - // away; only compare lexicographically. - if(chosenPath.length !== 0 && path > chosenPath) { - nextPermutation = true; - break; - } - } - - if(nextPermutation) { - continue; - } - - // 5.4.5) For each related in recursion list: - for(const related of recursionList) { - // 5.4.5.1) Set result to the result of recursively executing - // the Hash N-Degree Quads algorithm, passing related for - // identifier and issuer copy for path identifier issuer. - const result = await this.hashNDegreeQuads(related, issuerCopy); - - // 5.4.5.2) Use the Issue Identifier algorithm, passing issuer - // copy and related and append the result to path. - path += issuerCopy.getId(related); - - // 5.4.5.3) Append <, the hash in result, and > to path. - path += `<${result.hash}>`; - - // 5.4.5.4) Set issuer copy to the identifier issuer in - // result. - issuerCopy = result.issuer; - - // 5.4.5.5) If chosen path is not empty and the length of path - // is greater than or equal to the length of chosen path and - // path is lexicographically greater than chosen path, then - // skip to the next permutation. - // Note: Comparing path length to chosen path length can be optimized - // away; only compare lexicographically. - if(chosenPath.length !== 0 && path > chosenPath) { - nextPermutation = true; - break; - } - } - - if(nextPermutation) { - continue; - } - - // 5.4.6) If chosen path is empty or path is lexicographically - // less than chosen path, set chosen path to path and chosen - // issuer to issuer copy. - if(chosenPath.length === 0 || path < chosenPath) { - chosenPath = path; - chosenIssuer = issuerCopy; - } - } - - // 5.5) Append chosen path to data to hash. - md.update(chosenPath); - - // 5.6) Replace issuer, by reference, with chosen issuer. - issuer = chosenIssuer; - } - - // 6) Return issuer and the hash that results from passing data to hash - // through the hash algorithm. - return {hash: await md.digest(), issuer}; - } - - // helper for modifying component during Hash First Degree Quads - modifyFirstDegreeComponent(id, component) { - if(component.termType !== 'BlankNode') { - return component; - } - /* Note: A mistake in the URDNA2015 spec that made its way into - implementations (and therefore must stay to avoid interop breakage) - resulted in an assigned canonical ID, if available for - `component.value`, not being used in place of `_:a`/`_:z`, so - we don't use it here. */ - return { - termType: 'BlankNode', - value: component.value === id ? '_:a' : '_:z' - }; - } - - // helper for getting a related predicate - getRelatedPredicate(quad) { - return `<${quad.predicate.value}>`; - } - - // helper for creating hash to related blank nodes map - async createHashToRelated(id, issuer) { - // 1) Create a hash to related blank nodes map for storing hashes that - // identify related blank nodes. - const hashToRelated = new Map(); - - // 2) Get a reference, quads, to the list of quads in the blank node to - // quads map for the key identifier. - const quads = this.blankNodeInfo.get(id).quads; - - // 3) For each quad in quads: - let i = 0; - for(const quad of quads) { - // Note: batch hashing related blank node quads 100 at a time - if(++i % 100 === 0) { - await this._yield(); - } - // 3.1) For each component in quad, if component is the subject, object, - // and graph name and it is a blank node that is not identified by - // identifier: - // steps 3.1.1 and 3.1.2 occur in helpers: - await Promise.all([ - this._addRelatedBlankNodeHash({ - quad, component: quad.subject, position: 's', - id, issuer, hashToRelated - }), - this._addRelatedBlankNodeHash({ - quad, component: quad.object, position: 'o', - id, issuer, hashToRelated - }), - this._addRelatedBlankNodeHash({ - quad, component: quad.graph, position: 'g', - id, issuer, hashToRelated - }) - ]); - } - - return hashToRelated; - } - - async _hashAndTrackBlankNode({id, hashToBlankNodes}) { - // 5.3.1) Create a hash, hash, according to the Hash First Degree - // Quads algorithm. - const hash = await this.hashFirstDegreeQuads(id); - - // 5.3.2) Add hash and identifier to hash to blank nodes map, - // creating a new entry if necessary. - const idList = hashToBlankNodes.get(hash); - if(!idList) { - hashToBlankNodes.set(hash, [id]); - } else { - idList.push(id); - } - } - - _addBlankNodeQuadInfo({quad, component}) { - if(component.termType !== 'BlankNode') { - return; - } - const id = component.value; - const info = this.blankNodeInfo.get(id); - if(info) { - info.quads.add(quad); - } else { - this.blankNodeInfo.set(id, {quads: new Set([quad]), hash: null}); - } - } - - async _addRelatedBlankNodeHash( - {quad, component, position, id, issuer, hashToRelated}) { - if(!(component.termType === 'BlankNode' && component.value !== id)) { - return; - } - // 3.1.1) Set hash to the result of the Hash Related Blank Node - // algorithm, passing the blank node identifier for component as - // related, quad, path identifier issuer as issuer, and position as - // either s, o, or g based on whether component is a subject, object, - // graph name, respectively. - const related = component.value; - const hash = await this.hashRelatedBlankNode( - related, quad, issuer, position); - - // 3.1.2) Add a mapping of hash to the blank node identifier for - // component to hash to related blank nodes map, adding an entry as - // necessary. - const entries = hashToRelated.get(hash); - if(entries) { - entries.push(related); - } else { - hashToRelated.set(hash, [related]); - } - } - - _useCanonicalId({component}) { - if(component.termType === 'BlankNode' && - !component.value.startsWith(this.canonicalIssuer.prefix)) { - return { - termType: 'BlankNode', - value: this.canonicalIssuer.getId(component.value) - }; - } - return component; - } - - async _yield() { - return new Promise(resolve => setImmediate(resolve)); - } -}; - -function _stringHashCompare(a, b) { - return a.hash < b.hash ? -1 : a.hash > b.hash ? 1 : 0; -} - -}).call(this)}).call(this,require("timers").setImmediate) -},{"./IdentifierIssuer":47,"./MessageDigest":48,"./NQuads":49,"./Permuter":50,"timers":89}],52:[function(require,module,exports){ -/* - * Copyright (c) 2016-2021 Digital Bazaar, Inc. All rights reserved. - */ -'use strict'; - -const IdentifierIssuer = require('./IdentifierIssuer'); -const MessageDigest = require('./MessageDigest'); -const Permuter = require('./Permuter'); -const NQuads = require('./NQuads'); - -module.exports = class URDNA2015Sync { - constructor() { - this.name = 'URDNA2015'; - this.blankNodeInfo = new Map(); - this.canonicalIssuer = new IdentifierIssuer('_:c14n'); - this.hashAlgorithm = 'sha256'; - this.quads = null; - } - - // 4.4) Normalization Algorithm - main(dataset) { - this.quads = dataset; - - // 1) Create the normalization state. - // 2) For every quad in input dataset: - for(const quad of dataset) { - // 2.1) For each blank node that occurs in the quad, add a reference - // to the quad using the blank node identifier in the blank node to - // quads map, creating a new entry if necessary. - this._addBlankNodeQuadInfo({quad, component: quad.subject}); - this._addBlankNodeQuadInfo({quad, component: quad.object}); - this._addBlankNodeQuadInfo({quad, component: quad.graph}); - } - - // 3) Create a list of non-normalized blank node identifiers - // non-normalized identifiers and populate it using the keys from the - // blank node to quads map. - // Note: We use a map here and it was generated during step 2. - - // 4) `simple` flag is skipped -- loop is optimized away. This optimization - // is permitted because there was a typo in the hash first degree quads - // algorithm in the URDNA2015 spec that was implemented widely making it - // such that it could not be fixed; the result was that the loop only - // needs to be run once and the first degree quad hashes will never change. - // 5.1-5.2 are skipped; first degree quad hashes are generated just once - // for all non-normalized blank nodes. - - // 5.3) For each blank node identifier identifier in non-normalized - // identifiers: - const hashToBlankNodes = new Map(); - const nonNormalized = [...this.blankNodeInfo.keys()]; - for(const id of nonNormalized) { - // steps 5.3.1 and 5.3.2: - this._hashAndTrackBlankNode({id, hashToBlankNodes}); - } - - // 5.4) For each hash to identifier list mapping in hash to blank - // nodes map, lexicographically-sorted by hash: - const hashes = [...hashToBlankNodes.keys()].sort(); - // optimize away second sort, gather non-unique hashes in order as we go - const nonUnique = []; - for(const hash of hashes) { - // 5.4.1) If the length of identifier list is greater than 1, - // continue to the next mapping. - const idList = hashToBlankNodes.get(hash); - if(idList.length > 1) { - nonUnique.push(idList); - continue; - } - - // 5.4.2) Use the Issue Identifier algorithm, passing canonical - // issuer and the single blank node identifier in identifier - // list, identifier, to issue a canonical replacement identifier - // for identifier. - const id = idList[0]; - this.canonicalIssuer.getId(id); - - // Note: These steps are skipped, optimized away since the loop - // only needs to be run once. - // 5.4.3) Remove identifier from non-normalized identifiers. - // 5.4.4) Remove hash from the hash to blank nodes map. - // 5.4.5) Set simple to true. - } - - // 6) For each hash to identifier list mapping in hash to blank nodes map, - // lexicographically-sorted by hash: - // Note: sort optimized away, use `nonUnique`. - for(const idList of nonUnique) { - // 6.1) Create hash path list where each item will be a result of - // running the Hash N-Degree Quads algorithm. - const hashPathList = []; - - // 6.2) For each blank node identifier identifier in identifier list: - for(const id of idList) { - // 6.2.1) If a canonical identifier has already been issued for - // identifier, continue to the next identifier. - if(this.canonicalIssuer.hasId(id)) { - continue; - } - - // 6.2.2) Create temporary issuer, an identifier issuer - // initialized with the prefix _:b. - const issuer = new IdentifierIssuer('_:b'); - - // 6.2.3) Use the Issue Identifier algorithm, passing temporary - // issuer and identifier, to issue a new temporary blank node - // identifier for identifier. - issuer.getId(id); - - // 6.2.4) Run the Hash N-Degree Quads algorithm, passing - // temporary issuer, and append the result to the hash path list. - const result = this.hashNDegreeQuads(id, issuer); - hashPathList.push(result); - } - - // 6.3) For each result in the hash path list, - // lexicographically-sorted by the hash in result: - hashPathList.sort(_stringHashCompare); - for(const result of hashPathList) { - // 6.3.1) For each blank node identifier, existing identifier, - // that was issued a temporary identifier by identifier issuer - // in result, issue a canonical identifier, in the same order, - // using the Issue Identifier algorithm, passing canonical - // issuer and existing identifier. - const oldIds = result.issuer.getOldIds(); - for(const id of oldIds) { - this.canonicalIssuer.getId(id); - } - } - } - - /* Note: At this point all blank nodes in the set of RDF quads have been - assigned canonical identifiers, which have been stored in the canonical - issuer. Here each quad is updated by assigning each of its blank nodes - its new identifier. */ - - // 7) For each quad, quad, in input dataset: - const normalized = []; - for(const quad of this.quads) { - // 7.1) Create a copy, quad copy, of quad and replace any existing - // blank node identifiers using the canonical identifiers - // previously issued by canonical issuer. - // Note: We optimize with shallow copies here. - const q = {...quad}; - q.subject = this._useCanonicalId({component: q.subject}); - q.object = this._useCanonicalId({component: q.object}); - q.graph = this._useCanonicalId({component: q.graph}); - // 7.2) Add quad copy to the normalized dataset. - normalized.push(NQuads.serializeQuad(q)); - } - - // sort normalized output - normalized.sort(); - - // 8) Return the normalized dataset. - return normalized.join(''); - } - - // 4.6) Hash First Degree Quads - hashFirstDegreeQuads(id) { - // 1) Initialize nquads to an empty list. It will be used to store quads in - // N-Quads format. - const nquads = []; - - // 2) Get the list of quads `quads` associated with the reference blank node - // identifier in the blank node to quads map. - const info = this.blankNodeInfo.get(id); - const quads = info.quads; - - // 3) For each quad `quad` in `quads`: - for(const quad of quads) { - // 3.1) Serialize the quad in N-Quads format with the following special - // rule: - - // 3.1.1) If any component in quad is an blank node, then serialize it - // using a special identifier as follows: - const copy = { - subject: null, predicate: quad.predicate, object: null, graph: null - }; - // 3.1.2) If the blank node's existing blank node identifier matches - // the reference blank node identifier then use the blank node - // identifier _:a, otherwise, use the blank node identifier _:z. - copy.subject = this.modifyFirstDegreeComponent( - id, quad.subject, 'subject'); - copy.object = this.modifyFirstDegreeComponent( - id, quad.object, 'object'); - copy.graph = this.modifyFirstDegreeComponent( - id, quad.graph, 'graph'); - nquads.push(NQuads.serializeQuad(copy)); - } - - // 4) Sort nquads in lexicographical order. - nquads.sort(); - - // 5) Return the hash that results from passing the sorted, joined nquads - // through the hash algorithm. - const md = new MessageDigest(this.hashAlgorithm); - for(const nquad of nquads) { - md.update(nquad); - } - info.hash = md.digest(); - return info.hash; - } - - // 4.7) Hash Related Blank Node - hashRelatedBlankNode(related, quad, issuer, position) { - // 1) Set the identifier to use for related, preferring first the canonical - // identifier for related if issued, second the identifier issued by issuer - // if issued, and last, if necessary, the result of the Hash First Degree - // Quads algorithm, passing related. - let id; - if(this.canonicalIssuer.hasId(related)) { - id = this.canonicalIssuer.getId(related); - } else if(issuer.hasId(related)) { - id = issuer.getId(related); - } else { - id = this.blankNodeInfo.get(related).hash; - } - - // 2) Initialize a string input to the value of position. - // Note: We use a hash object instead. - const md = new MessageDigest(this.hashAlgorithm); - md.update(position); - - // 3) If position is not g, append <, the value of the predicate in quad, - // and > to input. - if(position !== 'g') { - md.update(this.getRelatedPredicate(quad)); - } - - // 4) Append identifier to input. - md.update(id); - - // 5) Return the hash that results from passing input through the hash - // algorithm. - return md.digest(); - } - - // 4.8) Hash N-Degree Quads - hashNDegreeQuads(id, issuer) { - // 1) Create a hash to related blank nodes map for storing hashes that - // identify related blank nodes. - // Note: 2) and 3) handled within `createHashToRelated` - const md = new MessageDigest(this.hashAlgorithm); - const hashToRelated = this.createHashToRelated(id, issuer); - - // 4) Create an empty string, data to hash. - // Note: We created a hash object `md` above instead. - - // 5) For each related hash to blank node list mapping in hash to related - // blank nodes map, sorted lexicographically by related hash: - const hashes = [...hashToRelated.keys()].sort(); - for(const hash of hashes) { - // 5.1) Append the related hash to the data to hash. - md.update(hash); - - // 5.2) Create a string chosen path. - let chosenPath = ''; - - // 5.3) Create an unset chosen issuer variable. - let chosenIssuer; - - // 5.4) For each permutation of blank node list: - const permuter = new Permuter(hashToRelated.get(hash)); - while(permuter.hasNext()) { - const permutation = permuter.next(); - - // 5.4.1) Create a copy of issuer, issuer copy. - let issuerCopy = issuer.clone(); - - // 5.4.2) Create a string path. - let path = ''; - - // 5.4.3) Create a recursion list, to store blank node identifiers - // that must be recursively processed by this algorithm. - const recursionList = []; - - // 5.4.4) For each related in permutation: - let nextPermutation = false; - for(const related of permutation) { - // 5.4.4.1) If a canonical identifier has been issued for - // related, append it to path. - if(this.canonicalIssuer.hasId(related)) { - path += this.canonicalIssuer.getId(related); - } else { - // 5.4.4.2) Otherwise: - // 5.4.4.2.1) If issuer copy has not issued an identifier for - // related, append related to recursion list. - if(!issuerCopy.hasId(related)) { - recursionList.push(related); - } - // 5.4.4.2.2) Use the Issue Identifier algorithm, passing - // issuer copy and related and append the result to path. - path += issuerCopy.getId(related); - } - - // 5.4.4.3) If chosen path is not empty and the length of path - // is greater than or equal to the length of chosen path and - // path is lexicographically greater than chosen path, then - // skip to the next permutation. - // Note: Comparing path length to chosen path length can be optimized - // away; only compare lexicographically. - if(chosenPath.length !== 0 && path > chosenPath) { - nextPermutation = true; - break; - } - } - - if(nextPermutation) { - continue; - } - - // 5.4.5) For each related in recursion list: - for(const related of recursionList) { - // 5.4.5.1) Set result to the result of recursively executing - // the Hash N-Degree Quads algorithm, passing related for - // identifier and issuer copy for path identifier issuer. - const result = this.hashNDegreeQuads(related, issuerCopy); - - // 5.4.5.2) Use the Issue Identifier algorithm, passing issuer - // copy and related and append the result to path. - path += issuerCopy.getId(related); - - // 5.4.5.3) Append <, the hash in result, and > to path. - path += `<${result.hash}>`; - - // 5.4.5.4) Set issuer copy to the identifier issuer in - // result. - issuerCopy = result.issuer; - - // 5.4.5.5) If chosen path is not empty and the length of path - // is greater than or equal to the length of chosen path and - // path is lexicographically greater than chosen path, then - // skip to the next permutation. - // Note: Comparing path length to chosen path length can be optimized - // away; only compare lexicographically. - if(chosenPath.length !== 0 && path > chosenPath) { - nextPermutation = true; - break; - } - } - - if(nextPermutation) { - continue; - } - - // 5.4.6) If chosen path is empty or path is lexicographically - // less than chosen path, set chosen path to path and chosen - // issuer to issuer copy. - if(chosenPath.length === 0 || path < chosenPath) { - chosenPath = path; - chosenIssuer = issuerCopy; - } - } - - // 5.5) Append chosen path to data to hash. - md.update(chosenPath); - - // 5.6) Replace issuer, by reference, with chosen issuer. - issuer = chosenIssuer; - } - - // 6) Return issuer and the hash that results from passing data to hash - // through the hash algorithm. - return {hash: md.digest(), issuer}; - } - - // helper for modifying component during Hash First Degree Quads - modifyFirstDegreeComponent(id, component) { - if(component.termType !== 'BlankNode') { - return component; - } - /* Note: A mistake in the URDNA2015 spec that made its way into - implementations (and therefore must stay to avoid interop breakage) - resulted in an assigned canonical ID, if available for - `component.value`, not being used in place of `_:a`/`_:z`, so - we don't use it here. */ - return { - termType: 'BlankNode', - value: component.value === id ? '_:a' : '_:z' - }; - } - - // helper for getting a related predicate - getRelatedPredicate(quad) { - return `<${quad.predicate.value}>`; - } - - // helper for creating hash to related blank nodes map - createHashToRelated(id, issuer) { - // 1) Create a hash to related blank nodes map for storing hashes that - // identify related blank nodes. - const hashToRelated = new Map(); - - // 2) Get a reference, quads, to the list of quads in the blank node to - // quads map for the key identifier. - const quads = this.blankNodeInfo.get(id).quads; - - // 3) For each quad in quads: - for(const quad of quads) { - // 3.1) For each component in quad, if component is the subject, object, - // or graph name and it is a blank node that is not identified by - // identifier: - // steps 3.1.1 and 3.1.2 occur in helpers: - this._addRelatedBlankNodeHash({ - quad, component: quad.subject, position: 's', - id, issuer, hashToRelated - }); - this._addRelatedBlankNodeHash({ - quad, component: quad.object, position: 'o', - id, issuer, hashToRelated - }); - this._addRelatedBlankNodeHash({ - quad, component: quad.graph, position: 'g', - id, issuer, hashToRelated - }); - } - - return hashToRelated; - } - - _hashAndTrackBlankNode({id, hashToBlankNodes}) { - // 5.3.1) Create a hash, hash, according to the Hash First Degree - // Quads algorithm. - const hash = this.hashFirstDegreeQuads(id); - - // 5.3.2) Add hash and identifier to hash to blank nodes map, - // creating a new entry if necessary. - const idList = hashToBlankNodes.get(hash); - if(!idList) { - hashToBlankNodes.set(hash, [id]); - } else { - idList.push(id); - } - } - - _addBlankNodeQuadInfo({quad, component}) { - if(component.termType !== 'BlankNode') { - return; - } - const id = component.value; - const info = this.blankNodeInfo.get(id); - if(info) { - info.quads.add(quad); - } else { - this.blankNodeInfo.set(id, {quads: new Set([quad]), hash: null}); - } - } - - _addRelatedBlankNodeHash( - {quad, component, position, id, issuer, hashToRelated}) { - if(!(component.termType === 'BlankNode' && component.value !== id)) { - return; - } - // 3.1.1) Set hash to the result of the Hash Related Blank Node - // algorithm, passing the blank node identifier for component as - // related, quad, path identifier issuer as issuer, and position as - // either s, o, or g based on whether component is a subject, object, - // graph name, respectively. - const related = component.value; - const hash = this.hashRelatedBlankNode(related, quad, issuer, position); - - // 3.1.2) Add a mapping of hash to the blank node identifier for - // component to hash to related blank nodes map, adding an entry as - // necessary. - const entries = hashToRelated.get(hash); - if(entries) { - entries.push(related); - } else { - hashToRelated.set(hash, [related]); - } - } - - _useCanonicalId({component}) { - if(component.termType === 'BlankNode' && - !component.value.startsWith(this.canonicalIssuer.prefix)) { - return { - termType: 'BlankNode', - value: this.canonicalIssuer.getId(component.value) - }; - } - return component; - } -}; - -function _stringHashCompare(a, b) { - return a.hash < b.hash ? -1 : a.hash > b.hash ? 1 : 0; -} - -},{"./IdentifierIssuer":47,"./MessageDigest":48,"./NQuads":49,"./Permuter":50}],53:[function(require,module,exports){ -/* - * Copyright (c) 2016-2021 Digital Bazaar, Inc. All rights reserved. - */ -'use strict'; - -const URDNA2015 = require('./URDNA2015'); - -module.exports = class URDNA2012 extends URDNA2015 { - constructor() { - super(); - this.name = 'URGNA2012'; - this.hashAlgorithm = 'sha1'; - } - - // helper for modifying component during Hash First Degree Quads - modifyFirstDegreeComponent(id, component, key) { - if(component.termType !== 'BlankNode') { - return component; - } - if(key === 'graph') { - return { - termType: 'BlankNode', - value: '_:g' - }; - } - return { - termType: 'BlankNode', - value: (component.value === id ? '_:a' : '_:z') - }; - } - - // helper for getting a related predicate - getRelatedPredicate(quad) { - return quad.predicate.value; - } - - // helper for creating hash to related blank nodes map - async createHashToRelated(id, issuer) { - // 1) Create a hash to related blank nodes map for storing hashes that - // identify related blank nodes. - const hashToRelated = new Map(); - - // 2) Get a reference, quads, to the list of quads in the blank node to - // quads map for the key identifier. - const quads = this.blankNodeInfo.get(id).quads; - - // 3) For each quad in quads: - let i = 0; - for(const quad of quads) { - // 3.1) If the quad's subject is a blank node that does not match - // identifier, set hash to the result of the Hash Related Blank Node - // algorithm, passing the blank node identifier for subject as related, - // quad, path identifier issuer as issuer, and p as position. - let position; - let related; - if(quad.subject.termType === 'BlankNode' && quad.subject.value !== id) { - related = quad.subject.value; - position = 'p'; - } else if( - quad.object.termType === 'BlankNode' && quad.object.value !== id) { - // 3.2) Otherwise, if quad's object is a blank node that does not match - // identifier, to the result of the Hash Related Blank Node algorithm, - // passing the blank node identifier for object as related, quad, path - // identifier issuer as issuer, and r as position. - related = quad.object.value; - position = 'r'; - } else { - // 3.3) Otherwise, continue to the next quad. - continue; - } - // Note: batch hashing related blank nodes 100 at a time - if(++i % 100 === 0) { - await this._yield(); - } - // 3.4) Add a mapping of hash to the blank node identifier for the - // component that matched (subject or object) to hash to related blank - // nodes map, adding an entry as necessary. - const hash = await this.hashRelatedBlankNode( - related, quad, issuer, position); - const entries = hashToRelated.get(hash); - if(entries) { - entries.push(related); - } else { - hashToRelated.set(hash, [related]); - } - } - - return hashToRelated; - } -}; - -},{"./URDNA2015":51}],54:[function(require,module,exports){ -/* - * Copyright (c) 2016-2021 Digital Bazaar, Inc. All rights reserved. - */ -'use strict'; - -const URDNA2015Sync = require('./URDNA2015Sync'); - -module.exports = class URDNA2012Sync extends URDNA2015Sync { - constructor() { - super(); - this.name = 'URGNA2012'; - this.hashAlgorithm = 'sha1'; - } - - // helper for modifying component during Hash First Degree Quads - modifyFirstDegreeComponent(id, component, key) { - if(component.termType !== 'BlankNode') { - return component; - } - if(key === 'graph') { - return { - termType: 'BlankNode', - value: '_:g' - }; - } - return { - termType: 'BlankNode', - value: (component.value === id ? '_:a' : '_:z') - }; - } - - // helper for getting a related predicate - getRelatedPredicate(quad) { - return quad.predicate.value; - } - - // helper for creating hash to related blank nodes map - createHashToRelated(id, issuer) { - // 1) Create a hash to related blank nodes map for storing hashes that - // identify related blank nodes. - const hashToRelated = new Map(); - - // 2) Get a reference, quads, to the list of quads in the blank node to - // quads map for the key identifier. - const quads = this.blankNodeInfo.get(id).quads; - - // 3) For each quad in quads: - for(const quad of quads) { - // 3.1) If the quad's subject is a blank node that does not match - // identifier, set hash to the result of the Hash Related Blank Node - // algorithm, passing the blank node identifier for subject as related, - // quad, path identifier issuer as issuer, and p as position. - let position; - let related; - if(quad.subject.termType === 'BlankNode' && quad.subject.value !== id) { - related = quad.subject.value; - position = 'p'; - } else if( - quad.object.termType === 'BlankNode' && quad.object.value !== id) { - // 3.2) Otherwise, if quad's object is a blank node that does not match - // identifier, to the result of the Hash Related Blank Node algorithm, - // passing the blank node identifier for object as related, quad, path - // identifier issuer as issuer, and r as position. - related = quad.object.value; - position = 'r'; - } else { - // 3.3) Otherwise, continue to the next quad. - continue; - } - // 3.4) Add a mapping of hash to the blank node identifier for the - // component that matched (subject or object) to hash to related blank - // nodes map, adding an entry as necessary. - const hash = this.hashRelatedBlankNode(related, quad, issuer, position); - const entries = hashToRelated.get(hash); - if(entries) { - entries.push(related); - } else { - hashToRelated.set(hash, [related]); - } - } - - return hashToRelated; - } -}; - -},{"./URDNA2015Sync":52}],55:[function(require,module,exports){ -/** - * An implementation of the RDF Dataset Normalization specification. - * This library works in the browser and node.js. - * - * BSD 3-Clause License - * Copyright (c) 2016-2021 Digital Bazaar, Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * Neither the name of the Digital Bazaar, Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS - * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED - * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -'use strict'; - -const URDNA2015 = require('./URDNA2015'); -const URGNA2012 = require('./URGNA2012'); -const URDNA2015Sync = require('./URDNA2015Sync'); -const URGNA2012Sync = require('./URGNA2012Sync'); - -// optional native support -let rdfCanonizeNative; -try { - rdfCanonizeNative = require('rdf-canonize-native'); -} catch(e) {} - -const api = {}; -module.exports = api; - -// expose helpers -api.NQuads = require('./NQuads'); -api.IdentifierIssuer = require('./IdentifierIssuer'); - -/** - * Get or set native API. - * - * @param api the native API. - * - * @return the currently set native API. - */ -api._rdfCanonizeNative = function(api) { - if(api) { - rdfCanonizeNative = api; - } - return rdfCanonizeNative; -}; - -/** - * Asynchronously canonizes an RDF dataset. - * - * @param dataset the dataset to canonize. - * @param options the options to use: - * algorithm the canonicalization algorithm to use, `URDNA2015` or - * `URGNA2012`. - * [useNative] use native implementation (default: false). - * - * @return a Promise that resolves to the canonicalized RDF Dataset. - */ -api.canonize = async function(dataset, options) { - // back-compat with legacy dataset - if(!Array.isArray(dataset)) { - dataset = api.NQuads.legacyDatasetToQuads(dataset); - } - - if(options.useNative) { - if(!rdfCanonizeNative) { - throw new Error('rdf-canonize-native not available'); - } - // TODO: convert native algorithm to Promise-based async - return new Promise((resolve, reject) => - rdfCanonizeNative.canonize(dataset, options, (err, canonical) => - err ? reject(err) : resolve(canonical))); - } - - if(options.algorithm === 'URDNA2015') { - return new URDNA2015(options).main(dataset); - } - if(options.algorithm === 'URGNA2012') { - return new URGNA2012(options).main(dataset); - } - if(!('algorithm' in options)) { - throw new Error('No RDF Dataset Canonicalization algorithm specified.'); - } - throw new Error( - 'Invalid RDF Dataset Canonicalization algorithm: ' + options.algorithm); -}; - -/** - * This method is no longer available in the public API, it is for testing - * only. It synchronously canonizes an RDF dataset and does not work in the - * browser. - * - * @param dataset the dataset to canonize. - * @param options the options to use: - * algorithm the canonicalization algorithm to use, `URDNA2015` or - * `URGNA2012`. - * [useNative] use native implementation (default: false). - * - * @return the RDF dataset in canonical form. - */ -api._canonizeSync = function(dataset, options) { - // back-compat with legacy dataset - if(!Array.isArray(dataset)) { - dataset = api.NQuads.legacyDatasetToQuads(dataset); - } - - if(options.useNative) { - if(rdfCanonizeNative) { - return rdfCanonizeNative.canonizeSync(dataset, options); - } - throw new Error('rdf-canonize-native not available'); - } - if(options.algorithm === 'URDNA2015') { - return new URDNA2015Sync(options).main(dataset); - } - if(options.algorithm === 'URGNA2012') { - return new URGNA2012Sync(options).main(dataset); - } - if(!('algorithm' in options)) { - throw new Error('No RDF Dataset Canonicalization algorithm specified.'); - } - throw new Error( - 'Invalid RDF Dataset Canonicalization algorithm: ' + options.algorithm); -}; - -},{"./IdentifierIssuer":47,"./NQuads":49,"./URDNA2015":51,"./URDNA2015Sync":52,"./URGNA2012":53,"./URGNA2012Sync":54,"rdf-canonize-native":3}],56:[function(require,module,exports){ -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", { value: true }); -__exportStar(require("./lib/BlankNode"), exports); -__exportStar(require("./lib/DataFactory"), exports); -__exportStar(require("./lib/DefaultGraph"), exports); -__exportStar(require("./lib/Literal"), exports); -__exportStar(require("./lib/NamedNode"), exports); -__exportStar(require("./lib/Quad"), exports); -__exportStar(require("./lib/Variable"), exports); - -},{"./lib/BlankNode":57,"./lib/DataFactory":58,"./lib/DefaultGraph":59,"./lib/Literal":60,"./lib/NamedNode":61,"./lib/Quad":62,"./lib/Variable":63}],57:[function(require,module,exports){ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.BlankNode = void 0; -/** - * A term that represents an RDF blank node with a label. - */ -class BlankNode { - constructor(value) { - this.termType = 'BlankNode'; - this.value = value; - } - equals(other) { - return !!other && other.termType === 'BlankNode' && other.value === this.value; - } -} -exports.BlankNode = BlankNode; - -},{}],58:[function(require,module,exports){ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.DataFactory = void 0; -const BlankNode_1 = require("./BlankNode"); -const DefaultGraph_1 = require("./DefaultGraph"); -const Literal_1 = require("./Literal"); -const NamedNode_1 = require("./NamedNode"); -const Quad_1 = require("./Quad"); -const Variable_1 = require("./Variable"); -let dataFactoryCounter = 0; -/** - * A factory for instantiating RDF terms and quads. - */ -class DataFactory { - constructor(options) { - this.blankNodeCounter = 0; - options = options || {}; - this.blankNodePrefix = options.blankNodePrefix || `df_${dataFactoryCounter++}_`; - } - /** - * @param value The IRI for the named node. - * @return A new instance of NamedNode. - * @see NamedNode - */ - namedNode(value) { - return new NamedNode_1.NamedNode(value); - } - /** - * @param value The optional blank node identifier. - * @return A new instance of BlankNode. - * If the `value` parameter is undefined a new identifier - * for the blank node is generated for each call. - * @see BlankNode - */ - blankNode(value) { - return new BlankNode_1.BlankNode(value || `${this.blankNodePrefix}${this.blankNodeCounter++}`); - } - /** - * @param value The literal value. - * @param languageOrDatatype The optional language or datatype. - * If `languageOrDatatype` is a NamedNode, - * then it is used for the value of `NamedNode.datatype`. - * Otherwise `languageOrDatatype` is used for the value - * of `NamedNode.language`. - * @return A new instance of Literal. - * @see Literal - */ - literal(value, languageOrDatatype) { - return new Literal_1.Literal(value, languageOrDatatype); - } - /** - * This method is optional. - * @param value The variable name - * @return A new instance of Variable. - * @see Variable - */ - variable(value) { - return new Variable_1.Variable(value); - } - /** - * @return An instance of DefaultGraph. - */ - defaultGraph() { - return DefaultGraph_1.DefaultGraph.INSTANCE; - } - /** - * @param subject The quad subject term. - * @param predicate The quad predicate term. - * @param object The quad object term. - * @param graph The quad graph term. - * @return A new instance of Quad. - * @see Quad - */ - quad(subject, predicate, object, graph) { - return new Quad_1.Quad(subject, predicate, object, graph || this.defaultGraph()); - } - /** - * Create a deep copy of the given term using this data factory. - * @param original An RDF term. - * @return A deep copy of the given term. - */ - fromTerm(original) { - // TODO: remove nasty any casts when this TS bug has been fixed: - // https://github.com/microsoft/TypeScript/issues/26933 - switch (original.termType) { - case 'NamedNode': - return this.namedNode(original.value); - case 'BlankNode': - return this.blankNode(original.value); - case 'Literal': - if (original.language) { - return this.literal(original.value, original.language); - } - if (!original.datatype.equals(Literal_1.Literal.XSD_STRING)) { - return this.literal(original.value, this.fromTerm(original.datatype)); - } - return this.literal(original.value); - case 'Variable': - return this.variable(original.value); - case 'DefaultGraph': - return this.defaultGraph(); - case 'Quad': - return this.quad(this.fromTerm(original.subject), this.fromTerm(original.predicate), this.fromTerm(original.object), this.fromTerm(original.graph)); - } - } - /** - * Create a deep copy of the given quad using this data factory. - * @param original An RDF quad. - * @return A deep copy of the given quad. - */ - fromQuad(original) { - return this.fromTerm(original); - } - /** - * Reset the internal blank node counter. - */ - resetBlankNodeCounter() { - this.blankNodeCounter = 0; - } -} -exports.DataFactory = DataFactory; - -},{"./BlankNode":57,"./DefaultGraph":59,"./Literal":60,"./NamedNode":61,"./Quad":62,"./Variable":63}],59:[function(require,module,exports){ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.DefaultGraph = void 0; -/** - * A singleton term instance that represents the default graph. - * It's only allowed to assign a DefaultGraph to the .graph property of a Quad. - */ -class DefaultGraph { - constructor() { - this.termType = 'DefaultGraph'; - this.value = ''; - // Private constructor - } - equals(other) { - return !!other && other.termType === 'DefaultGraph'; - } -} -exports.DefaultGraph = DefaultGraph; -DefaultGraph.INSTANCE = new DefaultGraph(); - -},{}],60:[function(require,module,exports){ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.Literal = void 0; -const NamedNode_1 = require("./NamedNode"); -/** - * A term that represents an RDF literal, containing a string with an optional language tag or datatype. - */ -class Literal { - constructor(value, languageOrDatatype) { - this.termType = 'Literal'; - this.value = value; - if (typeof languageOrDatatype === 'string') { - this.language = languageOrDatatype; - this.datatype = Literal.RDF_LANGUAGE_STRING; - } - else if (languageOrDatatype) { - this.language = ''; - this.datatype = languageOrDatatype; - } - else { - this.language = ''; - this.datatype = Literal.XSD_STRING; - } - } - equals(other) { - return !!other && other.termType === 'Literal' && other.value === this.value && - other.language === this.language && other.datatype.equals(this.datatype); - } -} -exports.Literal = Literal; -Literal.RDF_LANGUAGE_STRING = new NamedNode_1.NamedNode('http://www.w3.org/1999/02/22-rdf-syntax-ns#langString'); -Literal.XSD_STRING = new NamedNode_1.NamedNode('http://www.w3.org/2001/XMLSchema#string'); - -},{"./NamedNode":61}],61:[function(require,module,exports){ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.NamedNode = void 0; -/** - * A term that contains an IRI. - */ -class NamedNode { - constructor(value) { - this.termType = 'NamedNode'; - this.value = value; - } - equals(other) { - return !!other && other.termType === 'NamedNode' && other.value === this.value; - } -} -exports.NamedNode = NamedNode; - -},{}],62:[function(require,module,exports){ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.Quad = void 0; -/** - * An instance of DefaultGraph represents the default graph. - * It's only allowed to assign a DefaultGraph to the .graph property of a Quad. - */ -class Quad { - constructor(subject, predicate, object, graph) { - this.termType = 'Quad'; - this.value = ''; - this.subject = subject; - this.predicate = predicate; - this.object = object; - this.graph = graph; - } - equals(other) { - // `|| !other.termType` is for backwards-compatibility with old factories without RDF* support. - return !!other && (other.termType === 'Quad' || !other.termType) && - this.subject.equals(other.subject) && - this.predicate.equals(other.predicate) && - this.object.equals(other.object) && - this.graph.equals(other.graph); - } -} -exports.Quad = Quad; - -},{}],63:[function(require,module,exports){ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.Variable = void 0; -/** - * A term that represents a variable. - */ -class Variable { - constructor(value) { - this.termType = 'Variable'; - this.value = value; - } - equals(other) { - return !!other && other.termType === 'Variable' && other.value === this.value; - } -} -exports.Variable = Variable; - -},{}],64:[function(require,module,exports){ -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", { value: true }); -__exportStar(require("./lib/RdfXmlParser"), exports); - -},{"./lib/RdfXmlParser":66}],65:[function(require,module,exports){ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.ParseError = void 0; -/** - * An error that includes line and column in the error message. - */ -class ParseError extends Error { - constructor(parser, message) { - const saxParser = parser.saxStream._parser; - super(parser.trackPosition ? `Line ${saxParser.line + 1} column ${saxParser.column + 1}: ${message}` : message); - } -} -exports.ParseError = ParseError; - -},{}],66:[function(require,module,exports){ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.ParseType = exports.RdfXmlParser = void 0; -const relative_to_absolute_iri_1 = require("relative-to-absolute-iri"); -const sax_1 = require("sax"); -const stream_1 = require("stream"); -const ParseError_1 = require("./ParseError"); -const rdf_data_factory_1 = require("rdf-data-factory"); -class RdfXmlParser extends stream_1.Transform { - constructor(args) { - super({ readableObjectMode: true }); - this.activeTagStack = []; - this.nodeIds = {}; - if (args) { - Object.assign(this, args); - this.options = args; - } - if (!this.dataFactory) { - this.dataFactory = new rdf_data_factory_1.DataFactory(); - } - if (!this.baseIRI) { - this.baseIRI = ''; - } - if (!this.defaultGraph) { - this.defaultGraph = this.dataFactory.defaultGraph(); - } - this.saxStream = sax_1.createStream(this.strict, { xmlns: false, position: this.trackPosition }); - // Workaround for an issue in SAX where non-strict mode either lower- or upper-cases all tags. - if (!this.strict) { - this.saxStream._parser.looseCase = 'toString'; - } - this.attachSaxListeners(); - } - /** - * Parse the namespace of the given tag, - * and take into account the namespace of the parent tag that was already parsed. - * @param {Tag} tag A tag to parse the namespace from. - * @param {IActiveTag} parentTag The parent tag, or null if this tag is the root. - * @return {{[p: string]: string}[]} An array of namespaces, - * where the last ones have a priority over the first ones. - */ - static parseNamespace(tag, parentTag) { - const thisNs = {}; - let hasNs = false; - for (const attributeKey in tag.attributes) { - if (attributeKey.startsWith('xmlns')) { - if (attributeKey.length === 5) { - // Set default namespace - hasNs = true; - thisNs[''] = tag.attributes[attributeKey]; - } - else if (attributeKey.charAt(5) === ':') { - // Definition of a prefix - hasNs = true; - thisNs[attributeKey.substr(6)] = tag.attributes[attributeKey]; - } - } - } - const parentNs = parentTag && parentTag.ns ? parentTag.ns : [RdfXmlParser.DEFAULT_NS]; - return hasNs ? parentNs.concat([thisNs]) : parentNs; - } - /** - * Expand the given term value based on the given namespaces. - * @param {string} term A term value. - * @param {{[p: string]: string}[]} ns An array of namespaces, - * where the last ones have a priority over the first ones. - * @param {RdfXmlParser} parser The RDF/XML parser instance. - * @return {IExpandedPrefix} An expanded prefix object. - */ - static expandPrefixedTerm(term, ns, parser) { - const colonIndex = term.indexOf(':'); - let prefix; - let local; - if (colonIndex >= 0) { - // Prefix is set - prefix = term.substr(0, colonIndex); - local = term.substr(colonIndex + 1); - } - else { - // Prefix is not set, fallback to default namespace - prefix = ''; - local = term; - } - let uri = null; - let defaultNamespace = null; - for (let i = ns.length - 1; i >= 0; i--) { - const nsElement = ns[i][prefix]; - if (nsElement) { - uri = nsElement; - break; - } - else if (!defaultNamespace) { - defaultNamespace = ns[i]['']; - } - } - if (!uri) { - // Error on unbound prefix - if (prefix && prefix !== 'xmlns') { - throw new ParseError_1.ParseError(parser, `The prefix '${prefix}' in term '${term}' was not bound.`); - } - // Fallback to default namespace if no match was found - uri = defaultNamespace || ''; - } - return { prefix, local, uri }; - } - /** - * Check if the given IRI is valid. - * @param {string} iri A potential IRI. - * @return {boolean} If the given IRI is valid. - */ - static isValidIri(iri) { - return RdfXmlParser.IRI_REGEX.test(iri); - } - /** - * Parses the given text stream into a quad stream. - * @param {NodeJS.EventEmitter} stream A text stream. - * @return {RDF.Stream} A quad stream. - */ - import(stream) { - const output = new stream_1.PassThrough({ readableObjectMode: true }); - stream.on('error', (error) => parsed.emit('error', error)); - stream.on('data', (data) => output.push(data)); - stream.on('end', () => output.push(null)); - const parsed = output.pipe(new RdfXmlParser(this.options)); - return parsed; - } - _transform(chunk, encoding, callback) { - try { - this.saxStream.write(chunk, encoding); - } - catch (e) { - return callback(e); - } - callback(); - } - /** - * Create a new parse error instance. - * @param {string} message An error message. - * @return {Error} An error instance. - */ - newParseError(message) { - return new ParseError_1.ParseError(this, message); - } - /** - * Convert the given value to a IRI by taking into account the baseIRI. - * - * This will follow the RDF/XML spec for converting values with baseIRIs to a IRI. - * - * @param {string} value The value to convert to an IRI. - * @param {IActiveTag} activeTag The active tag. - * @return {NamedNode} an IRI. - */ - valueToUri(value, activeTag) { - return this.uriToNamedNode(relative_to_absolute_iri_1.resolve(value, activeTag.baseIRI)); - } - /** - * Convert the given value URI string to a named node. - * - * This throw an error if the URI is invalid. - * - * @param {string} uri A URI string. - * @return {NamedNode} a named node. - */ - uriToNamedNode(uri) { - // Validate URI - if (!RdfXmlParser.isValidIri(uri)) { - throw this.newParseError(`Invalid URI: ${uri}`); - } - return this.dataFactory.namedNode(uri); - } - /** - * Validate the given value as an NCName: https://www.w3.org/TR/xml-names/#NT-NCName - * If it is invalid, an error will thrown emitted. - * @param {string} value A value. - */ - validateNcname(value) { - // Validate term as an NCName: https://www.w3.org/TR/xml-names/#NT-NCName - if (!RdfXmlParser.NCNAME_MATCHER.test(value)) { - throw this.newParseError(`Not a valid NCName: ${value}`); - } - } - attachSaxListeners() { - this.saxStream.on('error', (error) => this.emit('error', error)); - 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)); - } - /** - * Handle the given tag. - * @param {QualifiedTag} tag A SAX tag. - */ - onTag(tag) { - // Get parent tag - const parentTag = this.activeTagStack.length - ? this.activeTagStack[this.activeTagStack.length - 1] : null; - let currentParseType = ParseType.RESOURCE; - if (parentTag) { - parentTag.hadChildren = true; - currentParseType = parentTag.childrenParseType; - } - // Check if this tag needs to be converted to a string - if (parentTag && parentTag.childrenStringTags) { - // Convert this tag to a string - const tagName = tag.name; - let attributes = ''; - for (const attributeKey in tag.attributes) { - attributes += ` ${attributeKey}="${tag.attributes[attributeKey]}"`; - } - const tagContents = `${tagName}${attributes}`; - const tagString = `<${tagContents}>`; - parentTag.childrenStringTags.push(tagString); - // Inherit the array, so that deeper tags are appended to this same array - const stringActiveTag = { childrenStringTags: parentTag.childrenStringTags }; - stringActiveTag.childrenStringEmitClosingTag = ``; - this.activeTagStack.push(stringActiveTag); - // Halt any further processing - return; - } - const activeTag = {}; - if (parentTag) { - // Inherit language scope and baseIRI from parent - activeTag.language = parentTag.language; - activeTag.baseIRI = parentTag.baseIRI; - } - else { - activeTag.baseIRI = this.baseIRI; - } - this.activeTagStack.push(activeTag); - activeTag.ns = RdfXmlParser.parseNamespace(tag, parentTag); - if (currentParseType === ParseType.RESOURCE) { - this.onTagResource(tag, activeTag, parentTag, !parentTag); - } - else { // currentParseType === ParseType.PROPERTY - this.onTagProperty(tag, activeTag, parentTag); - } - } - /** - * Handle the given node element in resource-mode. - * @param {QualifiedTag} tag A SAX tag. - * @param {IActiveTag} activeTag The currently active tag. - * @param {IActiveTag} parentTag The parent tag or null. - * @param {boolean} rootTag If we are currently processing the root tag. - */ - onTagResource(tag, activeTag, parentTag, rootTag) { - const tagExpanded = RdfXmlParser.expandPrefixedTerm(tag.name, activeTag.ns, this); - activeTag.childrenParseType = ParseType.PROPERTY; - // Assume that the current node is a _typed_ node (2.13), unless we find an rdf:Description as node name - let typedNode = true; - if (tagExpanded.uri === RdfXmlParser.RDF) { - // Check forbidden property element names - if (!rootTag && RdfXmlParser.FORBIDDEN_NODE_ELEMENTS.indexOf(tagExpanded.local) >= 0) { - throw this.newParseError(`Illegal node element name: ${tagExpanded.local}`); - } - switch (tagExpanded.local) { - case 'RDF': - // Tags under must always be resources - activeTag.childrenParseType = ParseType.RESOURCE; - case 'Description': - typedNode = false; - } - } - const predicates = []; - const objects = []; - // Collect all attributes as triples - // Assign subject value only after all attributes have been processed, because baseIRI may change the final val - let activeSubjectValue = null; - let claimSubjectNodeId = false; - let subjectValueBlank = false; - let explicitType = null; - for (const attributeKey in tag.attributes) { - const attributeValue = tag.attributes[attributeKey]; - const attributeKeyExpanded = RdfXmlParser.expandPrefixedTerm(attributeKey, activeTag.ns, this); - if (parentTag && attributeKeyExpanded.uri === RdfXmlParser.RDF) { - switch (attributeKeyExpanded.local) { - case 'about': - if (activeSubjectValue) { - throw this.newParseError(`Only one of rdf:about, rdf:nodeID and rdf:ID can be present, \ -while ${attributeValue} and ${activeSubjectValue} where found.`); - } - activeSubjectValue = attributeValue; - continue; - case 'ID': - if (activeSubjectValue) { - throw this.newParseError(`Only one of rdf:about, rdf:nodeID and rdf:ID can be present, \ -while ${attributeValue} and ${activeSubjectValue} where found.`); - } - this.validateNcname(attributeValue); - activeSubjectValue = '#' + attributeValue; - claimSubjectNodeId = true; - continue; - case 'nodeID': - if (activeSubjectValue) { - throw this.newParseError(`Only one of rdf:about, rdf:nodeID and rdf:ID can be present, \ -while ${attributeValue} and ${activeSubjectValue} where found.`); - } - this.validateNcname(attributeValue); - activeSubjectValue = attributeValue; - subjectValueBlank = true; - continue; - case 'bagID': - throw this.newParseError(`rdf:bagID is not supported.`); - case 'type': - // Emit the rdf:type later as named node instead of the default literal - explicitType = attributeValue; - 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 (attributeKeyExpanded.uri === RdfXmlParser.XML) { - if (attributeKeyExpanded.local === 'lang') { - activeTag.language = attributeValue === '' ? null : attributeValue.toLowerCase(); - continue; - } - else if (attributeKeyExpanded.local === 'base') { - // SAX Parser does not expand xml:base, based on DOCTYPE, so we have to do it manually - activeTag.baseIRI = relative_to_absolute_iri_1.resolve(attributeValue, activeTag.baseIRI); - continue; - } - } - // Interpret attributes at this point as properties on this node, - // but we ignore attributes that have no prefix or known expanded URI - if (attributeKeyExpanded.prefix !== 'xml' && attributeKeyExpanded.uri) { - predicates.push(this.uriToNamedNode(attributeKeyExpanded.uri + attributeKeyExpanded.local)); - objects.push(attributeValue); - } - } - // Create the subject value _after_ all attributes have been processed - if (activeSubjectValue !== null) { - activeTag.subject = subjectValueBlank - ? this.dataFactory.blankNode(activeSubjectValue) : this.valueToUri(activeSubjectValue, activeTag); - if (claimSubjectNodeId) { - this.claimNodeId(activeTag.subject); - } - } - // Force the creation of a subject if it doesn't exist yet - if (!activeTag.subject) { - activeTag.subject = this.dataFactory.blankNode(); - } - // Emit the type if we're at a typed node - if (typedNode) { - const type = this.uriToNamedNode(tagExpanded.uri + tagExpanded.local); - this.emitTriple(activeTag.subject, this.dataFactory.namedNode(RdfXmlParser.RDF + 'type'), type, parentTag ? parentTag.reifiedStatementId : null); - } - if (parentTag) { - // If the parent tag defined a predicate, add the current tag as property value - if (parentTag.predicate) { - if (parentTag.childrenCollectionSubject) { - // RDF:List-based properties - const linkTerm = this.dataFactory.blankNode(); - // Emit

    OR - this.emitTriple(parentTag.childrenCollectionSubject, parentTag.childrenCollectionPredicate, linkTerm, parentTag.reifiedStatementId); - // Emit value - this.emitTriple(linkTerm, this.dataFactory.namedNode(RdfXmlParser.RDF + 'first'), activeTag.subject, activeTag.reifiedStatementId); - // Store in the parent node - parentTag.childrenCollectionSubject = linkTerm; - parentTag.childrenCollectionPredicate = this.dataFactory.namedNode(RdfXmlParser.RDF + 'rest'); - } - else { // !parentTag.predicateEmitted - // Set-based properties - this.emitTriple(parentTag.subject, parentTag.predicate, activeTag.subject, parentTag.reifiedStatementId); - // Emit pending properties on the parent tag that had no defined subject yet. - for (let i = 0; i < parentTag.predicateSubPredicates.length; i++) { - this.emitTriple(activeTag.subject, parentTag.predicateSubPredicates[i], parentTag.predicateSubObjects[i], null); - } - // Cleanup so we don't emit them again when the parent tag is closed - parentTag.predicateSubPredicates = []; - parentTag.predicateSubObjects = []; - parentTag.predicateEmitted = true; - } - } - // Emit all collected triples - for (let i = 0; i < predicates.length; i++) { - const object = this.dataFactory.literal(objects[i], activeTag.datatype || activeTag.language); - this.emitTriple(activeTag.subject, predicates[i], object, parentTag.reifiedStatementId); - } - // Emit the rdf:type as named node instead of literal - if (explicitType) { - this.emitTriple(activeTag.subject, this.dataFactory.namedNode(RdfXmlParser.RDF + 'type'), this.uriToNamedNode(explicitType), null); - } - } - } - /** - * Handle the given property element in property-mode. - * @param {QualifiedTag} tag A SAX tag. - * @param {IActiveTag} activeTag The currently active tag. - * @param {IActiveTag} parentTag The parent tag or null. - */ - onTagProperty(tag, activeTag, parentTag) { - const tagExpanded = RdfXmlParser.expandPrefixedTerm(tag.name, activeTag.ns, this); - activeTag.childrenParseType = ParseType.RESOURCE; - activeTag.subject = parentTag.subject; // Inherit parent subject - if (tagExpanded.uri === RdfXmlParser.RDF && tagExpanded.local === 'li') { - // Convert rdf:li to rdf:_x - if (!parentTag.listItemCounter) { - parentTag.listItemCounter = 1; - } - activeTag.predicate = this.uriToNamedNode(tagExpanded.uri + '_' + parentTag.listItemCounter++); - } - else { - activeTag.predicate = this.uriToNamedNode(tagExpanded.uri + tagExpanded.local); - } - // Check forbidden property element names - if (tagExpanded.uri === RdfXmlParser.RDF - && RdfXmlParser.FORBIDDEN_PROPERTY_ELEMENTS.indexOf(tagExpanded.local) >= 0) { - throw this.newParseError(`Illegal property element name: ${tagExpanded.local}`); - } - activeTag.predicateSubPredicates = []; - activeTag.predicateSubObjects = []; - let parseType = false; - let attributedProperty = false; - // Collect all attributes as triples - // Assign subject value only after all attributes have been processed, because baseIRI may change the final val - let activeSubSubjectValue = null; - let subSubjectValueBlank = true; - const predicates = []; - const objects = []; - for (const propertyAttributeKey in tag.attributes) { - const propertyAttributeValue = tag.attributes[propertyAttributeKey]; - const propertyAttributeKeyExpanded = RdfXmlParser - .expandPrefixedTerm(propertyAttributeKey, activeTag.ns, this); - if (propertyAttributeKeyExpanded.uri === RdfXmlParser.RDF) { - switch (propertyAttributeKeyExpanded.local) { - case 'resource': - if (activeSubSubjectValue) { - throw this.newParseError(`Found both rdf:resource (${propertyAttributeValue}) and rdf:nodeID (${activeSubSubjectValue}).`); - } - if (parseType) { - throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:resource (${propertyAttributeValue})`); - } - activeTag.hadChildren = true; - activeSubSubjectValue = propertyAttributeValue; - subSubjectValueBlank = false; - continue; - case 'datatype': - if (attributedProperty) { - throw this.newParseError(`Found both non-rdf:* property attributes and rdf:datatype (${propertyAttributeValue}).`); - } - if (parseType) { - throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:datatype (${propertyAttributeValue})`); - } - activeTag.datatype = this.valueToUri(propertyAttributeValue, activeTag); - continue; - case 'nodeID': - if (attributedProperty) { - throw this.newParseError(`Found both non-rdf:* property attributes and rdf:nodeID (${propertyAttributeValue}).`); - } - if (activeTag.hadChildren) { - throw this.newParseError(`Found both rdf:resource and rdf:nodeID (${propertyAttributeValue}).`); - } - if (parseType) { - throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:nodeID (${propertyAttributeValue})`); - } - this.validateNcname(propertyAttributeValue); - activeTag.hadChildren = true; - activeSubSubjectValue = propertyAttributeValue; - subSubjectValueBlank = true; - continue; - case 'bagID': - throw this.newParseError(`rdf:bagID is not supported.`); - case 'parseType': - // Validation - if (attributedProperty) { - throw this.newParseError(`rdf:parseType is not allowed when non-rdf:* property attributes are present`); - } - if (activeTag.datatype) { - throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:datatype (${activeTag.datatype.value})`); - } - if (activeSubSubjectValue) { - throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:nodeID or rdf:resource (${activeSubSubjectValue})`); - } - if (propertyAttributeValue === 'Resource') { - parseType = true; - activeTag.childrenParseType = ParseType.PROPERTY; - // Turn this property element into a node element - const nestedBNode = this.dataFactory.blankNode(); - this.emitTriple(activeTag.subject, activeTag.predicate, nestedBNode, activeTag.reifiedStatementId); - activeTag.subject = nestedBNode; - activeTag.predicate = null; - } - else if (propertyAttributeValue === 'Collection') { - parseType = true; - // Interpret children as being part of an rdf:List - activeTag.hadChildren = true; - activeTag.childrenCollectionSubject = activeTag.subject; - activeTag.childrenCollectionPredicate = activeTag.predicate; - subSubjectValueBlank = false; - } - else if (propertyAttributeValue === 'Literal') { - parseType = true; - // Interpret children as being part of a literal string - activeTag.childrenTagsToString = true; - activeTag.childrenStringTags = []; - } - continue; - case 'ID': - this.validateNcname(propertyAttributeValue); - activeTag.reifiedStatementId = this.valueToUri('#' + propertyAttributeValue, activeTag); - this.claimNodeId(activeTag.reifiedStatementId); - continue; - } - } - else if (propertyAttributeKeyExpanded.uri === RdfXmlParser.XML - && propertyAttributeKeyExpanded.local === 'lang') { - activeTag.language = propertyAttributeValue === '' - ? null : propertyAttributeValue.toLowerCase(); - continue; - } - // Interpret attributes at this point as properties via implicit blank nodes on the property, - // but we ignore attributes that have no prefix or known expanded URI - if (propertyAttributeKeyExpanded.prefix !== 'xml' && propertyAttributeKeyExpanded.prefix !== 'xmlns' - && propertyAttributeKeyExpanded.uri) { - if (parseType || activeTag.datatype) { - throw this.newParseError(`Found illegal rdf:* properties on property element with attribute: ${propertyAttributeValue}`); - } - activeTag.hadChildren = true; - attributedProperty = true; - predicates.push(this.uriToNamedNode(propertyAttributeKeyExpanded.uri + propertyAttributeKeyExpanded.local)); - objects.push(this.dataFactory.literal(propertyAttributeValue, activeTag.datatype || activeTag.language)); - } - } - // Create the subject value _after_ all attributes have been processed - if (activeSubSubjectValue !== null) { - const subjectParent = activeTag.subject; - activeTag.subject = subSubjectValueBlank - ? this.dataFactory.blankNode(activeSubSubjectValue) : this.valueToUri(activeSubSubjectValue, activeTag); - this.emitTriple(subjectParent, activeTag.predicate, activeTag.subject, activeTag.reifiedStatementId); - // Emit our buffered triples - for (let i = 0; i < predicates.length; i++) { - this.emitTriple(activeTag.subject, predicates[i], objects[i], null); - } - activeTag.predicateEmitted = true; - } - else if (subSubjectValueBlank) { - // The current property element has no defined subject - // Let's buffer the properties until the child node defines a subject, - // or if the tag closes. - activeTag.predicateSubPredicates = predicates; - activeTag.predicateSubObjects = objects; - activeTag.predicateEmitted = false; - } - } - /** - * Emit the given triple to the stream. - * @param {Term} subject A subject term. - * @param {Term} predicate A predicate term. - * @param {Term} object An object term. - * @param {Term} statementId An optional resource that identifies the triple. - * If truthy, then the given triple will also be emitted reified. - */ - emitTriple(subject, predicate, object, statementId) { - this.push(this.dataFactory.quad(subject, predicate, object, this.defaultGraph)); - // Reify triple - if (statementId) { - this.push(this.dataFactory.quad(statementId, this.dataFactory.namedNode(RdfXmlParser.RDF + 'type'), this.dataFactory.namedNode(RdfXmlParser.RDF + 'Statement'), this.defaultGraph)); - this.push(this.dataFactory.quad(statementId, this.dataFactory.namedNode(RdfXmlParser.RDF + 'subject'), subject, this.defaultGraph)); - this.push(this.dataFactory.quad(statementId, this.dataFactory.namedNode(RdfXmlParser.RDF + 'predicate'), predicate, this.defaultGraph)); - this.push(this.dataFactory.quad(statementId, this.dataFactory.namedNode(RdfXmlParser.RDF + 'object'), object, this.defaultGraph)); - } - } - /** - * Register the given term as a node ID. - * If one was already registered, this will emit an error. - * - * This is used to check duplicate occurrences of rdf:ID in scope of the baseIRI. - * @param {Term} term An RDF term. - */ - claimNodeId(term) { - if (!this.allowDuplicateRdfIds) { - if (this.nodeIds[term.value]) { - throw this.newParseError(`Found multiple occurrences of rdf:ID='${term.value}'.`); - } - this.nodeIds[term.value] = true; - } - } - /** - * Handle the given text string. - * @param {string} text A parsed text string. - */ - onText(text) { - const activeTag = this.activeTagStack.length - ? this.activeTagStack[this.activeTagStack.length - 1] : null; - if (activeTag) { - if (activeTag.childrenStringTags) { - activeTag.childrenStringTags.push(text); - } - else if (activeTag.predicate) { - activeTag.text = text; - } - } - } - /** - * Handle the closing of the last tag. - */ - onCloseTag() { - const poppedTag = this.activeTagStack.pop(); - // If we were converting a tag to a string, and the tag was not self-closing, close it here. - if (poppedTag.childrenStringEmitClosingTag) { - poppedTag.childrenStringTags.push(poppedTag.childrenStringEmitClosingTag); - } - // Set the literal value if we were collecting XML tags to string - if (poppedTag.childrenTagsToString) { - poppedTag.datatype = this.dataFactory.namedNode(RdfXmlParser.RDF + 'XMLLiteral'); - poppedTag.text = poppedTag.childrenStringTags.join(''); - poppedTag.hadChildren = false; // Force a literal triple to be emitted hereafter - } - if (poppedTag.childrenCollectionSubject) { - // Terminate the rdf:List - this.emitTriple(poppedTag.childrenCollectionSubject, poppedTag.childrenCollectionPredicate, this.dataFactory.namedNode(RdfXmlParser.RDF + 'nil'), poppedTag.reifiedStatementId); - } - else if (poppedTag.predicate) { - if (!poppedTag.hadChildren && poppedTag.childrenParseType !== ParseType.PROPERTY) { - // Property element contains text - this.emitTriple(poppedTag.subject, poppedTag.predicate, this.dataFactory.literal(poppedTag.text || '', poppedTag.datatype || poppedTag.language), poppedTag.reifiedStatementId); - } - else if (!poppedTag.predicateEmitted) { - // Emit remaining properties on an anonymous property element - const subject = this.dataFactory.blankNode(); - this.emitTriple(poppedTag.subject, poppedTag.predicate, subject, poppedTag.reifiedStatementId); - for (let i = 0; i < poppedTag.predicateSubPredicates.length; i++) { - this.emitTriple(subject, poppedTag.predicateSubPredicates[i], poppedTag.predicateSubObjects[i], null); - } - } - } - } - /** - * Fetch local DOCTYPE ENTITY's and make the parser recognise them. - * @param {string} doctype The read doctype. - */ - onDoctype(doctype) { - doctype.replace(//g, (match, prefix, uri) => { - this.saxStream._parser.ENTITIES[prefix] = uri; - return ''; - }); - } -} -exports.RdfXmlParser = RdfXmlParser; -// Regex for valid IRIs -RdfXmlParser.IRI_REGEX = /^([A-Za-z][A-Za-z0-9+-.]*):[^ "<>{}|\\\[\]`]*$/; -RdfXmlParser.MIME_TYPE = 'application/rdf+xml'; -RdfXmlParser.RDF = 'http://www.w3.org/1999/02/22-rdf-syntax-ns#'; -RdfXmlParser.XML = 'http://www.w3.org/XML/1998/namespace'; -RdfXmlParser.XMLNS = 'http://www.w3.org/2000/xmlns/'; -RdfXmlParser.DEFAULT_NS = { - xml: RdfXmlParser.XML, -}; -RdfXmlParser.FORBIDDEN_NODE_ELEMENTS = [ - 'RDF', - 'ID', - 'about', - 'bagID', - 'parseType', - 'resource', - 'nodeID', - 'li', - 'aboutEach', - 'aboutEachPrefix', -]; -RdfXmlParser.FORBIDDEN_PROPERTY_ELEMENTS = [ - 'Description', - 'RDF', - 'ID', - 'about', - 'bagID', - 'parseType', - 'resource', - 'nodeID', - 'aboutEach', - 'aboutEachPrefix', -]; -// tslint:disable-next-line:max-line-length -RdfXmlParser.NCNAME_MATCHER = /^([A-Za-z\xC0-\xD6\xD8-\xF6\u{F8}-\u{2FF}\u{370}-\u{37D}\u{37F}-\u{1FFF}\u{200C}-\u{200D}\u{2070}-\u{218F}\u{2C00}-\u{2FEF}\u{3001}-\u{D7FF}\u{F900}-\u{FDCF}\u{FDF0}-\u{FFFD}\u{10000}-\u{EFFFF}_])([A-Za-z\xC0-\xD6\xD8-\xF6\u{F8}-\u{2FF}\u{370}-\u{37D}\u{37F}-\u{1FFF}\u{200C}-\u{200D}\u{2070}-\u{218F}\u{2C00}-\u{2FEF}\u{3001}-\u{D7FF}\u{F900}-\u{FDCF}\u{FDF0}-\u{FFFD}\u{10000}-\u{EFFFF}_\-.0-9#xB7\u{0300}-\u{036F}\u{203F}-\u{2040}])*$/u; -var ParseType; -(function (ParseType) { - ParseType[ParseType["RESOURCE"] = 0] = "RESOURCE"; - ParseType[ParseType["PROPERTY"] = 1] = "PROPERTY"; -})(ParseType = exports.ParseType || (exports.ParseType = {})); - -},{"./ParseError":65,"rdf-data-factory":56,"relative-to-absolute-iri":82,"sax":85,"stream":87}],67:[function(require,module,exports){ -'use strict'; - -function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; } - -var codes = {}; - -function createErrorType(code, message, Base) { - if (!Base) { - Base = Error; - } - - function getMessage(arg1, arg2, arg3) { - if (typeof message === 'string') { - return message; - } else { - return message(arg1, arg2, arg3); - } - } - - var NodeError = - /*#__PURE__*/ - function (_Base) { - _inheritsLoose(NodeError, _Base); - - function NodeError(arg1, arg2, arg3) { - return _Base.call(this, getMessage(arg1, arg2, arg3)) || this; - } - - return NodeError; - }(Base); - - NodeError.prototype.name = Base.name; - NodeError.prototype.code = code; - codes[code] = NodeError; -} // https://github.com/nodejs/node/blob/v10.8.0/lib/internal/errors.js - - -function oneOf(expected, thing) { - if (Array.isArray(expected)) { - var len = expected.length; - expected = expected.map(function (i) { - return String(i); - }); - - if (len > 2) { - return "one of ".concat(thing, " ").concat(expected.slice(0, len - 1).join(', '), ", or ") + expected[len - 1]; - } else if (len === 2) { - return "one of ".concat(thing, " ").concat(expected[0], " or ").concat(expected[1]); - } else { - return "of ".concat(thing, " ").concat(expected[0]); - } - } else { - return "of ".concat(thing, " ").concat(String(expected)); - } -} // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith - - -function startsWith(str, search, pos) { - return str.substr(!pos || pos < 0 ? 0 : +pos, search.length) === search; -} // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith - - -function endsWith(str, search, this_len) { - if (this_len === undefined || this_len > str.length) { - this_len = str.length; - } - - return str.substring(this_len - search.length, this_len) === search; -} // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes - - -function includes(str, search, start) { - if (typeof start !== 'number') { - start = 0; - } - - if (start + search.length > str.length) { - return false; - } else { - return str.indexOf(search, start) !== -1; - } -} - -createErrorType('ERR_INVALID_OPT_VALUE', function (name, value) { - return 'The value "' + value + '" is invalid for option "' + name + '"'; -}, TypeError); -createErrorType('ERR_INVALID_ARG_TYPE', function (name, expected, actual) { - // determiner: 'must be' or 'must not be' - var determiner; - - if (typeof expected === 'string' && startsWith(expected, 'not ')) { - determiner = 'must not be'; - expected = expected.replace(/^not /, ''); - } else { - determiner = 'must be'; - } - - var msg; - - if (endsWith(name, ' argument')) { - // For cases like 'first argument' - msg = "The ".concat(name, " ").concat(determiner, " ").concat(oneOf(expected, 'type')); - } else { - var type = includes(name, '.') ? 'property' : 'argument'; - msg = "The \"".concat(name, "\" ").concat(type, " ").concat(determiner, " ").concat(oneOf(expected, 'type')); - } - - msg += ". Received type ".concat(typeof actual); - return msg; -}, TypeError); -createErrorType('ERR_STREAM_PUSH_AFTER_EOF', 'stream.push() after EOF'); -createErrorType('ERR_METHOD_NOT_IMPLEMENTED', function (name) { - return 'The ' + name + ' method is not implemented'; -}); -createErrorType('ERR_STREAM_PREMATURE_CLOSE', 'Premature close'); -createErrorType('ERR_STREAM_DESTROYED', function (name) { - return 'Cannot call ' + name + ' after a stream was destroyed'; -}); -createErrorType('ERR_MULTIPLE_CALLBACK', 'Callback called multiple times'); -createErrorType('ERR_STREAM_CANNOT_PIPE', 'Cannot pipe, not readable'); -createErrorType('ERR_STREAM_WRITE_AFTER_END', 'write after end'); -createErrorType('ERR_STREAM_NULL_VALUES', 'May not write null values to stream', TypeError); -createErrorType('ERR_UNKNOWN_ENCODING', function (arg) { - return 'Unknown encoding: ' + arg; -}, TypeError); -createErrorType('ERR_STREAM_UNSHIFT_AFTER_END_EVENT', 'stream.unshift() after end event'); -module.exports.codes = codes; - -},{}],68:[function(require,module,exports){ -(function (process){(function (){ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. -// a duplex stream is just a stream that is both readable and writable. -// Since JS doesn't have multiple prototypal inheritance, this class -// prototypally inherits from Readable, and then parasitically from -// Writable. -'use strict'; -/**/ - -var objectKeys = Object.keys || function (obj) { - var keys = []; - - for (var key in obj) { - keys.push(key); - } - - return keys; -}; -/**/ - - -module.exports = Duplex; - -var Readable = require('./_stream_readable'); - -var Writable = require('./_stream_writable'); - -require('inherits')(Duplex, Readable); - -{ - // Allow the keys array to be GC'ed. - var keys = objectKeys(Writable.prototype); - - for (var v = 0; v < keys.length; v++) { - var method = keys[v]; - if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method]; - } -} - -function Duplex(options) { - if (!(this instanceof Duplex)) return new Duplex(options); - Readable.call(this, options); - Writable.call(this, options); - this.allowHalfOpen = true; - - if (options) { - if (options.readable === false) this.readable = false; - if (options.writable === false) this.writable = false; - - if (options.allowHalfOpen === false) { - this.allowHalfOpen = false; - this.once('end', onend); - } - } -} - -Object.defineProperty(Duplex.prototype, 'writableHighWaterMark', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - return this._writableState.highWaterMark; - } -}); -Object.defineProperty(Duplex.prototype, 'writableBuffer', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - return this._writableState && this._writableState.getBuffer(); - } -}); -Object.defineProperty(Duplex.prototype, 'writableLength', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - return this._writableState.length; - } -}); // the no-half-open enforcer - -function onend() { - // If the writable side ended, then we're ok. - if (this._writableState.ended) return; // no more data can be written. - // But allow more writes to happen in this tick. - - process.nextTick(onEndNT, this); -} - -function onEndNT(self) { - self.end(); -} - -Object.defineProperty(Duplex.prototype, 'destroyed', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - if (this._readableState === undefined || this._writableState === undefined) { - return false; - } - - return this._readableState.destroyed && this._writableState.destroyed; - }, - set: function set(value) { - // we ignore the value if the stream - // has not been initialized yet - if (this._readableState === undefined || this._writableState === undefined) { - return; - } // backward compatibility, the user is explicitly - // managing destroyed - - - this._readableState.destroyed = value; - this._writableState.destroyed = value; - } -}); -}).call(this)}).call(this,require('_process')) -},{"./_stream_readable":70,"./_stream_writable":72,"_process":44,"inherits":10}],69:[function(require,module,exports){ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. -// a passthrough stream. -// basically just the most minimal sort of Transform stream. -// Every written chunk gets output as-is. -'use strict'; - -module.exports = PassThrough; - -var Transform = require('./_stream_transform'); - -require('inherits')(PassThrough, Transform); - -function PassThrough(options) { - if (!(this instanceof PassThrough)) return new PassThrough(options); - Transform.call(this, options); -} - -PassThrough.prototype._transform = function (chunk, encoding, cb) { - cb(null, chunk); -}; -},{"./_stream_transform":71,"inherits":10}],70:[function(require,module,exports){ -(function (process,global){(function (){ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. -'use strict'; - -module.exports = Readable; -/**/ - -var Duplex; -/**/ - -Readable.ReadableState = ReadableState; -/**/ - -var EE = require('events').EventEmitter; - -var EElistenerCount = function EElistenerCount(emitter, type) { - return emitter.listeners(type).length; -}; -/**/ - -/**/ - - -var Stream = require('./internal/streams/stream'); -/**/ - - -var Buffer = require('buffer').Buffer; - -var OurUint8Array = global.Uint8Array || function () {}; - -function _uint8ArrayToBuffer(chunk) { - return Buffer.from(chunk); -} - -function _isUint8Array(obj) { - return Buffer.isBuffer(obj) || obj instanceof OurUint8Array; -} -/**/ - - -var debugUtil = require('util'); - -var debug; - -if (debugUtil && debugUtil.debuglog) { - debug = debugUtil.debuglog('stream'); -} else { - debug = function debug() {}; -} -/**/ - - -var BufferList = require('./internal/streams/buffer_list'); - -var destroyImpl = require('./internal/streams/destroy'); - -var _require = require('./internal/streams/state'), - getHighWaterMark = _require.getHighWaterMark; - -var _require$codes = require('../errors').codes, - ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE, - ERR_STREAM_PUSH_AFTER_EOF = _require$codes.ERR_STREAM_PUSH_AFTER_EOF, - ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED, - ERR_STREAM_UNSHIFT_AFTER_END_EVENT = _require$codes.ERR_STREAM_UNSHIFT_AFTER_END_EVENT; // Lazy loaded to improve the startup performance. - - -var StringDecoder; -var createReadableStreamAsyncIterator; -var from; - -require('inherits')(Readable, Stream); - -var errorOrDestroy = destroyImpl.errorOrDestroy; -var kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume']; - -function prependListener(emitter, event, fn) { - // Sadly this is not cacheable as some libraries bundle their own - // event emitter implementation with them. - if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn); // This is a hack to make sure that our error handler is attached before any - // userland ones. NEVER DO THIS. This is here only because this code needs - // to continue to work with older versions of Node.js that do not include - // the prependListener() method. The goal is to eventually remove this hack. - - if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (Array.isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]]; -} - -function ReadableState(options, stream, isDuplex) { - Duplex = Duplex || require('./_stream_duplex'); - options = options || {}; // Duplex streams are both readable and writable, but share - // the same options object. - // However, some cases require setting options to different - // values for the readable and the writable sides of the duplex stream. - // These options can be provided separately as readableXXX and writableXXX. - - if (typeof isDuplex !== 'boolean') isDuplex = stream instanceof Duplex; // object stream flag. Used to make read(n) ignore n and to - // make all the buffer merging and length checks go away - - this.objectMode = !!options.objectMode; - if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode; // the point at which it stops calling _read() to fill the buffer - // Note: 0 is a valid value, means "don't call _read preemptively ever" - - this.highWaterMark = getHighWaterMark(this, options, 'readableHighWaterMark', isDuplex); // A linked list is used to store data chunks instead of an array because the - // linked list can remove elements from the beginning faster than - // array.shift() - - this.buffer = new BufferList(); - this.length = 0; - this.pipes = null; - this.pipesCount = 0; - this.flowing = null; - this.ended = false; - this.endEmitted = false; - this.reading = false; // a flag to be able to tell if the event 'readable'/'data' is emitted - // immediately, or on a later tick. We set this to true at first, because - // any actions that shouldn't happen until "later" should generally also - // not happen before the first read call. - - this.sync = true; // whenever we return null, then we set a flag to say - // that we're awaiting a 'readable' event emission. - - this.needReadable = false; - this.emittedReadable = false; - this.readableListening = false; - this.resumeScheduled = false; - this.paused = true; // Should close be emitted on destroy. Defaults to true. - - this.emitClose = options.emitClose !== false; // Should .destroy() be called after 'end' (and potentially 'finish') - - this.autoDestroy = !!options.autoDestroy; // has it been destroyed - - this.destroyed = false; // Crypto is kind of old and crusty. Historically, its default string - // encoding is 'binary' so we have to make this configurable. - // Everything else in the universe uses 'utf8', though. - - this.defaultEncoding = options.defaultEncoding || 'utf8'; // the number of writers that are awaiting a drain event in .pipe()s - - this.awaitDrain = 0; // if true, a maybeReadMore has been scheduled - - this.readingMore = false; - this.decoder = null; - this.encoding = null; - - if (options.encoding) { - if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder; - this.decoder = new StringDecoder(options.encoding); - this.encoding = options.encoding; - } -} - -function Readable(options) { - Duplex = Duplex || require('./_stream_duplex'); - if (!(this instanceof Readable)) return new Readable(options); // Checking for a Stream.Duplex instance is faster here instead of inside - // the ReadableState constructor, at least with V8 6.5 - - var isDuplex = this instanceof Duplex; - this._readableState = new ReadableState(options, this, isDuplex); // legacy - - this.readable = true; - - if (options) { - if (typeof options.read === 'function') this._read = options.read; - if (typeof options.destroy === 'function') this._destroy = options.destroy; - } - - Stream.call(this); -} - -Object.defineProperty(Readable.prototype, 'destroyed', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - if (this._readableState === undefined) { - return false; - } - - return this._readableState.destroyed; - }, - set: function set(value) { - // we ignore the value if the stream - // has not been initialized yet - if (!this._readableState) { - return; - } // backward compatibility, the user is explicitly - // managing destroyed - - - this._readableState.destroyed = value; - } -}); -Readable.prototype.destroy = destroyImpl.destroy; -Readable.prototype._undestroy = destroyImpl.undestroy; - -Readable.prototype._destroy = function (err, cb) { - cb(err); -}; // Manually shove something into the read() buffer. -// This returns true if the highWaterMark has not been hit yet, -// similar to how Writable.write() returns true if you should -// write() some more. - - -Readable.prototype.push = function (chunk, encoding) { - var state = this._readableState; - var skipChunkCheck; - - if (!state.objectMode) { - if (typeof chunk === 'string') { - encoding = encoding || state.defaultEncoding; - - if (encoding !== state.encoding) { - chunk = Buffer.from(chunk, encoding); - encoding = ''; - } - - skipChunkCheck = true; - } - } else { - skipChunkCheck = true; - } - - return readableAddChunk(this, chunk, encoding, false, skipChunkCheck); -}; // Unshift should *always* be something directly out of read() - - -Readable.prototype.unshift = function (chunk) { - return readableAddChunk(this, chunk, null, true, false); -}; - -function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) { - debug('readableAddChunk', chunk); - var state = stream._readableState; - - if (chunk === null) { - state.reading = false; - onEofChunk(stream, state); - } else { - var er; - if (!skipChunkCheck) er = chunkInvalid(state, chunk); - - if (er) { - errorOrDestroy(stream, er); - } else if (state.objectMode || chunk && chunk.length > 0) { - if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) { - chunk = _uint8ArrayToBuffer(chunk); - } - - if (addToFront) { - if (state.endEmitted) errorOrDestroy(stream, new ERR_STREAM_UNSHIFT_AFTER_END_EVENT());else addChunk(stream, state, chunk, true); - } else if (state.ended) { - errorOrDestroy(stream, new ERR_STREAM_PUSH_AFTER_EOF()); - } else if (state.destroyed) { - return false; - } else { - state.reading = false; - - if (state.decoder && !encoding) { - chunk = state.decoder.write(chunk); - if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state); - } else { - addChunk(stream, state, chunk, false); - } - } - } else if (!addToFront) { - state.reading = false; - maybeReadMore(stream, state); - } - } // We can push more data if we are below the highWaterMark. - // Also, if we have no data yet, we can stand some more bytes. - // This is to work around cases where hwm=0, such as the repl. - - - return !state.ended && (state.length < state.highWaterMark || state.length === 0); -} - -function addChunk(stream, state, chunk, addToFront) { - if (state.flowing && state.length === 0 && !state.sync) { - state.awaitDrain = 0; - stream.emit('data', chunk); - } else { - // update the buffer info. - state.length += state.objectMode ? 1 : chunk.length; - if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk); - if (state.needReadable) emitReadable(stream); - } - - maybeReadMore(stream, state); -} - -function chunkInvalid(state, chunk) { - var er; - - if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) { - er = new ERR_INVALID_ARG_TYPE('chunk', ['string', 'Buffer', 'Uint8Array'], chunk); - } - - return er; -} - -Readable.prototype.isPaused = function () { - return this._readableState.flowing === false; -}; // backwards compatibility. - - -Readable.prototype.setEncoding = function (enc) { - if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder; - var decoder = new StringDecoder(enc); - this._readableState.decoder = decoder; // If setEncoding(null), decoder.encoding equals utf8 - - this._readableState.encoding = this._readableState.decoder.encoding; // Iterate over current buffer to convert already stored Buffers: - - var p = this._readableState.buffer.head; - var content = ''; - - while (p !== null) { - content += decoder.write(p.data); - p = p.next; - } - - this._readableState.buffer.clear(); - - if (content !== '') this._readableState.buffer.push(content); - this._readableState.length = content.length; - return this; -}; // Don't raise the hwm > 1GB - - -var MAX_HWM = 0x40000000; - -function computeNewHighWaterMark(n) { - if (n >= MAX_HWM) { - // TODO(ronag): Throw ERR_VALUE_OUT_OF_RANGE. - n = MAX_HWM; - } else { - // Get the next highest power of 2 to prevent increasing hwm excessively in - // tiny amounts - n--; - n |= n >>> 1; - n |= n >>> 2; - n |= n >>> 4; - n |= n >>> 8; - n |= n >>> 16; - n++; - } - - return n; -} // This function is designed to be inlinable, so please take care when making -// changes to the function body. - - -function howMuchToRead(n, state) { - if (n <= 0 || state.length === 0 && state.ended) return 0; - if (state.objectMode) return 1; - - if (n !== n) { - // Only flow one buffer at a time - if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length; - } // If we're asking for more than the current hwm, then raise the hwm. - - - if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n); - if (n <= state.length) return n; // Don't have enough - - if (!state.ended) { - state.needReadable = true; - return 0; - } - - return state.length; -} // you can override either this method, or the async _read(n) below. - - -Readable.prototype.read = function (n) { - debug('read', n); - n = parseInt(n, 10); - var state = this._readableState; - var nOrig = n; - if (n !== 0) state.emittedReadable = false; // if we're doing read(0) to trigger a readable event, but we - // already have a bunch of data in the buffer, then just trigger - // the 'readable' event and move on. - - if (n === 0 && state.needReadable && ((state.highWaterMark !== 0 ? state.length >= state.highWaterMark : state.length > 0) || state.ended)) { - debug('read: emitReadable', state.length, state.ended); - if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this); - return null; - } - - n = howMuchToRead(n, state); // if we've ended, and we're now clear, then finish it up. - - if (n === 0 && state.ended) { - if (state.length === 0) endReadable(this); - return null; - } // All the actual chunk generation logic needs to be - // *below* the call to _read. The reason is that in certain - // synthetic stream cases, such as passthrough streams, _read - // may be a completely synchronous operation which may change - // the state of the read buffer, providing enough data when - // before there was *not* enough. - // - // So, the steps are: - // 1. Figure out what the state of things will be after we do - // a read from the buffer. - // - // 2. If that resulting state will trigger a _read, then call _read. - // Note that this may be asynchronous, or synchronous. Yes, it is - // deeply ugly to write APIs this way, but that still doesn't mean - // that the Readable class should behave improperly, as streams are - // designed to be sync/async agnostic. - // Take note if the _read call is sync or async (ie, if the read call - // has returned yet), so that we know whether or not it's safe to emit - // 'readable' etc. - // - // 3. Actually pull the requested chunks out of the buffer and return. - // if we need a readable event, then we need to do some reading. - - - var doRead = state.needReadable; - debug('need readable', doRead); // if we currently have less than the highWaterMark, then also read some - - if (state.length === 0 || state.length - n < state.highWaterMark) { - doRead = true; - debug('length less than watermark', doRead); - } // however, if we've ended, then there's no point, and if we're already - // reading, then it's unnecessary. - - - if (state.ended || state.reading) { - doRead = false; - debug('reading or ended', doRead); - } else if (doRead) { - debug('do read'); - state.reading = true; - state.sync = true; // if the length is currently zero, then we *need* a readable event. - - if (state.length === 0) state.needReadable = true; // call internal read method - - this._read(state.highWaterMark); - - state.sync = false; // If _read pushed data synchronously, then `reading` will be false, - // and we need to re-evaluate how much data we can return to the user. - - if (!state.reading) n = howMuchToRead(nOrig, state); - } - - var ret; - if (n > 0) ret = fromList(n, state);else ret = null; - - if (ret === null) { - state.needReadable = state.length <= state.highWaterMark; - n = 0; - } else { - state.length -= n; - state.awaitDrain = 0; - } - - if (state.length === 0) { - // If we have nothing in the buffer, then we want to know - // as soon as we *do* get something into the buffer. - if (!state.ended) state.needReadable = true; // If we tried to read() past the EOF, then emit end on the next tick. - - if (nOrig !== n && state.ended) endReadable(this); - } - - if (ret !== null) this.emit('data', ret); - return ret; -}; - -function onEofChunk(stream, state) { - debug('onEofChunk'); - if (state.ended) return; - - if (state.decoder) { - var chunk = state.decoder.end(); - - if (chunk && chunk.length) { - state.buffer.push(chunk); - state.length += state.objectMode ? 1 : chunk.length; - } - } - - state.ended = true; - - if (state.sync) { - // if we are sync, wait until next tick to emit the data. - // Otherwise we risk emitting data in the flow() - // the readable code triggers during a read() call - emitReadable(stream); - } else { - // emit 'readable' now to make sure it gets picked up. - state.needReadable = false; - - if (!state.emittedReadable) { - state.emittedReadable = true; - emitReadable_(stream); - } - } -} // Don't emit readable right away in sync mode, because this can trigger -// another read() call => stack overflow. This way, it might trigger -// a nextTick recursion warning, but that's not so bad. - - -function emitReadable(stream) { - var state = stream._readableState; - debug('emitReadable', state.needReadable, state.emittedReadable); - state.needReadable = false; - - if (!state.emittedReadable) { - debug('emitReadable', state.flowing); - state.emittedReadable = true; - process.nextTick(emitReadable_, stream); - } -} - -function emitReadable_(stream) { - var state = stream._readableState; - debug('emitReadable_', state.destroyed, state.length, state.ended); - - if (!state.destroyed && (state.length || state.ended)) { - stream.emit('readable'); - state.emittedReadable = false; - } // The stream needs another readable event if - // 1. It is not flowing, as the flow mechanism will take - // care of it. - // 2. It is not ended. - // 3. It is below the highWaterMark, so we can schedule - // another readable later. - - - state.needReadable = !state.flowing && !state.ended && state.length <= state.highWaterMark; - flow(stream); -} // at this point, the user has presumably seen the 'readable' event, -// and called read() to consume some data. that may have triggered -// in turn another _read(n) call, in which case reading = true if -// it's in progress. -// However, if we're not ended, or reading, and the length < hwm, -// then go ahead and try to read some more preemptively. - - -function maybeReadMore(stream, state) { - if (!state.readingMore) { - state.readingMore = true; - process.nextTick(maybeReadMore_, stream, state); - } -} - -function maybeReadMore_(stream, state) { - // Attempt to read more data if we should. - // - // The conditions for reading more data are (one of): - // - Not enough data buffered (state.length < state.highWaterMark). The loop - // is responsible for filling the buffer with enough data if such data - // is available. If highWaterMark is 0 and we are not in the flowing mode - // we should _not_ attempt to buffer any extra data. We'll get more data - // when the stream consumer calls read() instead. - // - No data in the buffer, and the stream is in flowing mode. In this mode - // the loop below is responsible for ensuring read() is called. Failing to - // call read here would abort the flow and there's no other mechanism for - // continuing the flow if the stream consumer has just subscribed to the - // 'data' event. - // - // In addition to the above conditions to keep reading data, the following - // conditions prevent the data from being read: - // - The stream has ended (state.ended). - // - There is already a pending 'read' operation (state.reading). This is a - // case where the the stream has called the implementation defined _read() - // method, but they are processing the call asynchronously and have _not_ - // called push() with new data. In this case we skip performing more - // read()s. The execution ends in this method again after the _read() ends - // up calling push() with more data. - while (!state.reading && !state.ended && (state.length < state.highWaterMark || state.flowing && state.length === 0)) { - var len = state.length; - debug('maybeReadMore read 0'); - stream.read(0); - if (len === state.length) // didn't get any data, stop spinning. - break; - } - - state.readingMore = false; -} // abstract method. to be overridden in specific implementation classes. -// call cb(er, data) where data is <= n in length. -// for virtual (non-string, non-buffer) streams, "length" is somewhat -// arbitrary, and perhaps not very meaningful. - - -Readable.prototype._read = function (n) { - errorOrDestroy(this, new ERR_METHOD_NOT_IMPLEMENTED('_read()')); -}; - -Readable.prototype.pipe = function (dest, pipeOpts) { - var src = this; - var state = this._readableState; - - switch (state.pipesCount) { - case 0: - state.pipes = dest; - break; - - case 1: - state.pipes = [state.pipes, dest]; - break; - - default: - state.pipes.push(dest); - break; - } - - state.pipesCount += 1; - debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts); - var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr; - var endFn = doEnd ? onend : unpipe; - if (state.endEmitted) process.nextTick(endFn);else src.once('end', endFn); - dest.on('unpipe', onunpipe); - - function onunpipe(readable, unpipeInfo) { - debug('onunpipe'); - - if (readable === src) { - if (unpipeInfo && unpipeInfo.hasUnpiped === false) { - unpipeInfo.hasUnpiped = true; - cleanup(); - } - } - } - - function onend() { - debug('onend'); - dest.end(); - } // when the dest drains, it reduces the awaitDrain counter - // on the source. This would be more elegant with a .once() - // handler in flow(), but adding and removing repeatedly is - // too slow. - - - var ondrain = pipeOnDrain(src); - dest.on('drain', ondrain); - var cleanedUp = false; - - function cleanup() { - debug('cleanup'); // cleanup event handlers once the pipe is broken - - dest.removeListener('close', onclose); - dest.removeListener('finish', onfinish); - dest.removeListener('drain', ondrain); - dest.removeListener('error', onerror); - dest.removeListener('unpipe', onunpipe); - src.removeListener('end', onend); - src.removeListener('end', unpipe); - src.removeListener('data', ondata); - cleanedUp = true; // if the reader is waiting for a drain event from this - // specific writer, then it would cause it to never start - // flowing again. - // So, if this is awaiting a drain, then we just call it now. - // If we don't know, then assume that we are waiting for one. - - if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain(); - } - - src.on('data', ondata); - - function ondata(chunk) { - debug('ondata'); - var ret = dest.write(chunk); - debug('dest.write', ret); - - if (ret === false) { - // If the user unpiped during `dest.write()`, it is possible - // to get stuck in a permanently paused state if that write - // also returned false. - // => Check whether `dest` is still a piping destination. - if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) { - debug('false write response, pause', state.awaitDrain); - state.awaitDrain++; - } - - src.pause(); - } - } // if the dest has an error, then stop piping into it. - // however, don't suppress the throwing behavior for this. - - - function onerror(er) { - debug('onerror', er); - unpipe(); - dest.removeListener('error', onerror); - if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er); - } // Make sure our error handler is attached before userland ones. - - - prependListener(dest, 'error', onerror); // Both close and finish should trigger unpipe, but only once. - - function onclose() { - dest.removeListener('finish', onfinish); - unpipe(); - } - - dest.once('close', onclose); - - function onfinish() { - debug('onfinish'); - dest.removeListener('close', onclose); - unpipe(); - } - - dest.once('finish', onfinish); - - function unpipe() { - debug('unpipe'); - src.unpipe(dest); - } // tell the dest that it's being piped to - - - dest.emit('pipe', src); // start the flow if it hasn't been started already. - - if (!state.flowing) { - debug('pipe resume'); - src.resume(); - } - - return dest; -}; - -function pipeOnDrain(src) { - return function pipeOnDrainFunctionResult() { - var state = src._readableState; - debug('pipeOnDrain', state.awaitDrain); - if (state.awaitDrain) state.awaitDrain--; - - if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) { - state.flowing = true; - flow(src); - } - }; -} - -Readable.prototype.unpipe = function (dest) { - var state = this._readableState; - var unpipeInfo = { - hasUnpiped: false - }; // if we're not piping anywhere, then do nothing. - - if (state.pipesCount === 0) return this; // just one destination. most common case. - - if (state.pipesCount === 1) { - // passed in one, but it's not the right one. - if (dest && dest !== state.pipes) return this; - if (!dest) dest = state.pipes; // got a match. - - state.pipes = null; - state.pipesCount = 0; - state.flowing = false; - if (dest) dest.emit('unpipe', this, unpipeInfo); - return this; - } // slow case. multiple pipe destinations. - - - if (!dest) { - // remove all. - var dests = state.pipes; - var len = state.pipesCount; - state.pipes = null; - state.pipesCount = 0; - state.flowing = false; - - for (var i = 0; i < len; i++) { - dests[i].emit('unpipe', this, { - hasUnpiped: false - }); - } - - return this; - } // try to find the right one. - - - var index = indexOf(state.pipes, dest); - if (index === -1) return this; - state.pipes.splice(index, 1); - state.pipesCount -= 1; - if (state.pipesCount === 1) state.pipes = state.pipes[0]; - dest.emit('unpipe', this, unpipeInfo); - return this; -}; // set up data events if they are asked for -// Ensure readable listeners eventually get something - - -Readable.prototype.on = function (ev, fn) { - var res = Stream.prototype.on.call(this, ev, fn); - var state = this._readableState; - - if (ev === 'data') { - // update readableListening so that resume() may be a no-op - // a few lines down. This is needed to support once('readable'). - state.readableListening = this.listenerCount('readable') > 0; // Try start flowing on next tick if stream isn't explicitly paused - - if (state.flowing !== false) this.resume(); - } else if (ev === 'readable') { - if (!state.endEmitted && !state.readableListening) { - state.readableListening = state.needReadable = true; - state.flowing = false; - state.emittedReadable = false; - debug('on readable', state.length, state.reading); - - if (state.length) { - emitReadable(this); - } else if (!state.reading) { - process.nextTick(nReadingNextTick, this); - } - } - } - - return res; -}; - -Readable.prototype.addListener = Readable.prototype.on; - -Readable.prototype.removeListener = function (ev, fn) { - var res = Stream.prototype.removeListener.call(this, ev, fn); - - if (ev === 'readable') { - // We need to check if there is someone still listening to - // readable and reset the state. However this needs to happen - // after readable has been emitted but before I/O (nextTick) to - // support once('readable', fn) cycles. This means that calling - // resume within the same tick will have no - // effect. - process.nextTick(updateReadableListening, this); - } - - return res; -}; - -Readable.prototype.removeAllListeners = function (ev) { - var res = Stream.prototype.removeAllListeners.apply(this, arguments); - - if (ev === 'readable' || ev === undefined) { - // We need to check if there is someone still listening to - // readable and reset the state. However this needs to happen - // after readable has been emitted but before I/O (nextTick) to - // support once('readable', fn) cycles. This means that calling - // resume within the same tick will have no - // effect. - process.nextTick(updateReadableListening, this); - } - - return res; -}; - -function updateReadableListening(self) { - var state = self._readableState; - state.readableListening = self.listenerCount('readable') > 0; - - if (state.resumeScheduled && !state.paused) { - // flowing needs to be set to true now, otherwise - // the upcoming resume will not flow. - state.flowing = true; // crude way to check if we should resume - } else if (self.listenerCount('data') > 0) { - self.resume(); - } -} - -function nReadingNextTick(self) { - debug('readable nexttick read 0'); - self.read(0); -} // pause() and resume() are remnants of the legacy readable stream API -// If the user uses them, then switch into old mode. - - -Readable.prototype.resume = function () { - var state = this._readableState; - - if (!state.flowing) { - debug('resume'); // we flow only if there is no one listening - // for readable, but we still have to call - // resume() - - state.flowing = !state.readableListening; - resume(this, state); - } - - state.paused = false; - return this; -}; - -function resume(stream, state) { - if (!state.resumeScheduled) { - state.resumeScheduled = true; - process.nextTick(resume_, stream, state); - } -} - -function resume_(stream, state) { - debug('resume', state.reading); - - if (!state.reading) { - stream.read(0); - } - - state.resumeScheduled = false; - stream.emit('resume'); - flow(stream); - if (state.flowing && !state.reading) stream.read(0); -} - -Readable.prototype.pause = function () { - debug('call pause flowing=%j', this._readableState.flowing); - - if (this._readableState.flowing !== false) { - debug('pause'); - this._readableState.flowing = false; - this.emit('pause'); - } - - this._readableState.paused = true; - return this; -}; - -function flow(stream) { - var state = stream._readableState; - debug('flow', state.flowing); - - while (state.flowing && stream.read() !== null) { - ; - } -} // wrap an old-style stream as the async data source. -// This is *not* part of the readable stream interface. -// It is an ugly unfortunate mess of history. - - -Readable.prototype.wrap = function (stream) { - var _this = this; - - var state = this._readableState; - var paused = false; - stream.on('end', function () { - debug('wrapped end'); - - if (state.decoder && !state.ended) { - var chunk = state.decoder.end(); - if (chunk && chunk.length) _this.push(chunk); - } - - _this.push(null); - }); - stream.on('data', function (chunk) { - debug('wrapped data'); - if (state.decoder) chunk = state.decoder.write(chunk); // don't skip over falsy values in objectMode - - if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return; - - var ret = _this.push(chunk); - - if (!ret) { - paused = true; - stream.pause(); - } - }); // proxy all the other methods. - // important when wrapping filters and duplexes. - - for (var i in stream) { - if (this[i] === undefined && typeof stream[i] === 'function') { - this[i] = function methodWrap(method) { - return function methodWrapReturnFunction() { - return stream[method].apply(stream, arguments); - }; - }(i); - } - } // proxy certain important events. - - - for (var n = 0; n < kProxyEvents.length; n++) { - stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n])); - } // when we try to consume some more bytes, simply unpause the - // underlying stream. - - - this._read = function (n) { - debug('wrapped _read', n); - - if (paused) { - paused = false; - stream.resume(); - } - }; - - return this; -}; - -if (typeof Symbol === 'function') { - Readable.prototype[Symbol.asyncIterator] = function () { - if (createReadableStreamAsyncIterator === undefined) { - createReadableStreamAsyncIterator = require('./internal/streams/async_iterator'); - } - - return createReadableStreamAsyncIterator(this); - }; -} - -Object.defineProperty(Readable.prototype, 'readableHighWaterMark', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - return this._readableState.highWaterMark; - } -}); -Object.defineProperty(Readable.prototype, 'readableBuffer', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - return this._readableState && this._readableState.buffer; - } -}); -Object.defineProperty(Readable.prototype, 'readableFlowing', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - return this._readableState.flowing; - }, - set: function set(state) { - if (this._readableState) { - this._readableState.flowing = state; - } - } -}); // exposed for testing purposes only. - -Readable._fromList = fromList; -Object.defineProperty(Readable.prototype, 'readableLength', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - return this._readableState.length; - } -}); // Pluck off n bytes from an array of buffers. -// Length is the combined lengths of all the buffers in the list. -// This function is designed to be inlinable, so please take care when making -// changes to the function body. - -function fromList(n, state) { - // nothing buffered - if (state.length === 0) return null; - var ret; - if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) { - // read it all, truncate the list - if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.first();else ret = state.buffer.concat(state.length); - state.buffer.clear(); - } else { - // read part of list - ret = state.buffer.consume(n, state.decoder); - } - return ret; -} - -function endReadable(stream) { - var state = stream._readableState; - debug('endReadable', state.endEmitted); - - if (!state.endEmitted) { - state.ended = true; - process.nextTick(endReadableNT, state, stream); - } -} - -function endReadableNT(state, stream) { - debug('endReadableNT', state.endEmitted, state.length); // Check that we didn't get one last unshift. - - if (!state.endEmitted && state.length === 0) { - state.endEmitted = true; - stream.readable = false; - stream.emit('end'); - - if (state.autoDestroy) { - // In case of duplex streams we need a way to detect - // if the writable side is ready for autoDestroy as well - var wState = stream._writableState; - - if (!wState || wState.autoDestroy && wState.finished) { - stream.destroy(); - } - } - } -} - -if (typeof Symbol === 'function') { - Readable.from = function (iterable, opts) { - if (from === undefined) { - from = require('./internal/streams/from'); - } - - return from(Readable, iterable, opts); - }; -} - -function indexOf(xs, x) { - for (var i = 0, l = xs.length; i < l; i++) { - if (xs[i] === x) return i; - } - - return -1; -} -}).call(this)}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"../errors":67,"./_stream_duplex":68,"./internal/streams/async_iterator":73,"./internal/streams/buffer_list":74,"./internal/streams/destroy":75,"./internal/streams/from":77,"./internal/streams/state":79,"./internal/streams/stream":80,"_process":44,"buffer":6,"events":8,"inherits":10,"string_decoder/":88,"util":3}],71:[function(require,module,exports){ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. -// a transform stream is a readable/writable stream where you do -// something with the data. Sometimes it's called a "filter", -// but that's not a great name for it, since that implies a thing where -// some bits pass through, and others are simply ignored. (That would -// be a valid example of a transform, of course.) -// -// While the output is causally related to the input, it's not a -// necessarily symmetric or synchronous transformation. For example, -// a zlib stream might take multiple plain-text writes(), and then -// emit a single compressed chunk some time in the future. -// -// Here's how this works: -// -// The Transform stream has all the aspects of the readable and writable -// stream classes. When you write(chunk), that calls _write(chunk,cb) -// internally, and returns false if there's a lot of pending writes -// buffered up. When you call read(), that calls _read(n) until -// there's enough pending readable data buffered up. -// -// In a transform stream, the written data is placed in a buffer. When -// _read(n) is called, it transforms the queued up data, calling the -// buffered _write cb's as it consumes chunks. If consuming a single -// written chunk would result in multiple output chunks, then the first -// outputted bit calls the readcb, and subsequent chunks just go into -// the read buffer, and will cause it to emit 'readable' if necessary. -// -// This way, back-pressure is actually determined by the reading side, -// since _read has to be called to start processing a new chunk. However, -// a pathological inflate type of transform can cause excessive buffering -// here. For example, imagine a stream where every byte of input is -// interpreted as an integer from 0-255, and then results in that many -// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in -// 1kb of data being output. In this case, you could write a very small -// amount of input, and end up with a very large amount of output. In -// such a pathological inflating mechanism, there'd be no way to tell -// the system to stop doing the transform. A single 4MB write could -// cause the system to run out of memory. -// -// However, even in such a pathological case, only a single written chunk -// would be consumed, and then the rest would wait (un-transformed) until -// the results of the previous transformed chunk were consumed. -'use strict'; - -module.exports = Transform; - -var _require$codes = require('../errors').codes, - ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED, - ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK, - ERR_TRANSFORM_ALREADY_TRANSFORMING = _require$codes.ERR_TRANSFORM_ALREADY_TRANSFORMING, - ERR_TRANSFORM_WITH_LENGTH_0 = _require$codes.ERR_TRANSFORM_WITH_LENGTH_0; - -var Duplex = require('./_stream_duplex'); - -require('inherits')(Transform, Duplex); - -function afterTransform(er, data) { - var ts = this._transformState; - ts.transforming = false; - var cb = ts.writecb; - - if (cb === null) { - return this.emit('error', new ERR_MULTIPLE_CALLBACK()); - } - - ts.writechunk = null; - ts.writecb = null; - if (data != null) // single equals check for both `null` and `undefined` - this.push(data); - cb(er); - var rs = this._readableState; - rs.reading = false; - - if (rs.needReadable || rs.length < rs.highWaterMark) { - this._read(rs.highWaterMark); - } -} - -function Transform(options) { - if (!(this instanceof Transform)) return new Transform(options); - Duplex.call(this, options); - this._transformState = { - afterTransform: afterTransform.bind(this), - needTransform: false, - transforming: false, - writecb: null, - writechunk: null, - writeencoding: null - }; // start out asking for a readable event once data is transformed. - - this._readableState.needReadable = true; // we have implemented the _read method, and done the other things - // that Readable wants before the first _read call, so unset the - // sync guard flag. - - this._readableState.sync = false; - - if (options) { - if (typeof options.transform === 'function') this._transform = options.transform; - if (typeof options.flush === 'function') this._flush = options.flush; - } // When the writable side finishes, then flush out anything remaining. - - - this.on('prefinish', prefinish); -} - -function prefinish() { - var _this = this; - - if (typeof this._flush === 'function' && !this._readableState.destroyed) { - this._flush(function (er, data) { - done(_this, er, data); - }); - } else { - done(this, null, null); - } -} - -Transform.prototype.push = function (chunk, encoding) { - this._transformState.needTransform = false; - return Duplex.prototype.push.call(this, chunk, encoding); -}; // This is the part where you do stuff! -// override this function in implementation classes. -// 'chunk' is an input chunk. -// -// Call `push(newChunk)` to pass along transformed output -// to the readable side. You may call 'push' zero or more times. -// -// Call `cb(err)` when you are done with this chunk. If you pass -// an error, then that'll put the hurt on the whole operation. If you -// never call cb(), then you'll never get another chunk. - - -Transform.prototype._transform = function (chunk, encoding, cb) { - cb(new ERR_METHOD_NOT_IMPLEMENTED('_transform()')); -}; - -Transform.prototype._write = function (chunk, encoding, cb) { - var ts = this._transformState; - ts.writecb = cb; - ts.writechunk = chunk; - ts.writeencoding = encoding; - - if (!ts.transforming) { - var rs = this._readableState; - if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark); - } -}; // Doesn't matter what the args are here. -// _transform does all the work. -// That we got here means that the readable side wants more data. - - -Transform.prototype._read = function (n) { - var ts = this._transformState; - - if (ts.writechunk !== null && !ts.transforming) { - ts.transforming = true; - - this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform); - } else { - // mark that we need a transform, so that any data that comes in - // will get processed, now that we've asked for it. - ts.needTransform = true; - } -}; - -Transform.prototype._destroy = function (err, cb) { - Duplex.prototype._destroy.call(this, err, function (err2) { - cb(err2); - }); -}; - -function done(stream, er, data) { - if (er) return stream.emit('error', er); - if (data != null) // single equals check for both `null` and `undefined` - stream.push(data); // TODO(BridgeAR): Write a test for these two error cases - // if there's nothing in the write buffer, then that means - // that nothing more will ever be provided - - if (stream._writableState.length) throw new ERR_TRANSFORM_WITH_LENGTH_0(); - if (stream._transformState.transforming) throw new ERR_TRANSFORM_ALREADY_TRANSFORMING(); - return stream.push(null); -} -},{"../errors":67,"./_stream_duplex":68,"inherits":10}],72:[function(require,module,exports){ -(function (process,global){(function (){ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. -// A bit simpler than readable streams. -// Implement an async ._write(chunk, encoding, cb), and it'll handle all -// the drain event emission and buffering. -'use strict'; - -module.exports = Writable; -/* */ - -function WriteReq(chunk, encoding, cb) { - this.chunk = chunk; - this.encoding = encoding; - this.callback = cb; - this.next = null; -} // It seems a linked list but it is not -// there will be only 2 of these for each stream - - -function CorkedRequest(state) { - var _this = this; - - this.next = null; - this.entry = null; - - this.finish = function () { - onCorkedFinish(_this, state); - }; -} -/* */ - -/**/ - - -var Duplex; -/**/ - -Writable.WritableState = WritableState; -/**/ - -var internalUtil = { - deprecate: require('util-deprecate') -}; -/**/ - -/**/ - -var Stream = require('./internal/streams/stream'); -/**/ - - -var Buffer = require('buffer').Buffer; - -var OurUint8Array = global.Uint8Array || function () {}; - -function _uint8ArrayToBuffer(chunk) { - return Buffer.from(chunk); -} - -function _isUint8Array(obj) { - return Buffer.isBuffer(obj) || obj instanceof OurUint8Array; -} - -var destroyImpl = require('./internal/streams/destroy'); - -var _require = require('./internal/streams/state'), - getHighWaterMark = _require.getHighWaterMark; - -var _require$codes = require('../errors').codes, - ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE, - ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED, - ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK, - ERR_STREAM_CANNOT_PIPE = _require$codes.ERR_STREAM_CANNOT_PIPE, - ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED, - ERR_STREAM_NULL_VALUES = _require$codes.ERR_STREAM_NULL_VALUES, - ERR_STREAM_WRITE_AFTER_END = _require$codes.ERR_STREAM_WRITE_AFTER_END, - ERR_UNKNOWN_ENCODING = _require$codes.ERR_UNKNOWN_ENCODING; - -var errorOrDestroy = destroyImpl.errorOrDestroy; - -require('inherits')(Writable, Stream); - -function nop() {} - -function WritableState(options, stream, isDuplex) { - Duplex = Duplex || require('./_stream_duplex'); - options = options || {}; // Duplex streams are both readable and writable, but share - // the same options object. - // However, some cases require setting options to different - // values for the readable and the writable sides of the duplex stream, - // e.g. options.readableObjectMode vs. options.writableObjectMode, etc. - - if (typeof isDuplex !== 'boolean') isDuplex = stream instanceof Duplex; // object stream flag to indicate whether or not this stream - // contains buffers or objects. - - this.objectMode = !!options.objectMode; - if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode; // the point at which write() starts returning false - // Note: 0 is a valid value, means that we always return false if - // the entire buffer is not flushed immediately on write() - - this.highWaterMark = getHighWaterMark(this, options, 'writableHighWaterMark', isDuplex); // if _final has been called - - this.finalCalled = false; // drain event flag. - - this.needDrain = false; // at the start of calling end() - - this.ending = false; // when end() has been called, and returned - - this.ended = false; // when 'finish' is emitted - - this.finished = false; // has it been destroyed - - this.destroyed = false; // should we decode strings into buffers before passing to _write? - // this is here so that some node-core streams can optimize string - // handling at a lower level. - - var noDecode = options.decodeStrings === false; - this.decodeStrings = !noDecode; // Crypto is kind of old and crusty. Historically, its default string - // encoding is 'binary' so we have to make this configurable. - // Everything else in the universe uses 'utf8', though. - - this.defaultEncoding = options.defaultEncoding || 'utf8'; // not an actual buffer we keep track of, but a measurement - // of how much we're waiting to get pushed to some underlying - // socket or file. - - this.length = 0; // a flag to see when we're in the middle of a write. - - this.writing = false; // when true all writes will be buffered until .uncork() call - - this.corked = 0; // a flag to be able to tell if the onwrite cb is called immediately, - // or on a later tick. We set this to true at first, because any - // actions that shouldn't happen until "later" should generally also - // not happen before the first write call. - - this.sync = true; // a flag to know if we're processing previously buffered items, which - // may call the _write() callback in the same tick, so that we don't - // end up in an overlapped onwrite situation. - - this.bufferProcessing = false; // the callback that's passed to _write(chunk,cb) - - this.onwrite = function (er) { - onwrite(stream, er); - }; // the callback that the user supplies to write(chunk,encoding,cb) - - - this.writecb = null; // the amount that is being written when _write is called. - - this.writelen = 0; - this.bufferedRequest = null; - this.lastBufferedRequest = null; // number of pending user-supplied write callbacks - // this must be 0 before 'finish' can be emitted - - this.pendingcb = 0; // emit prefinish if the only thing we're waiting for is _write cbs - // This is relevant for synchronous Transform streams - - this.prefinished = false; // True if the error was already emitted and should not be thrown again - - this.errorEmitted = false; // Should close be emitted on destroy. Defaults to true. - - this.emitClose = options.emitClose !== false; // Should .destroy() be called after 'finish' (and potentially 'end') - - this.autoDestroy = !!options.autoDestroy; // count buffered requests - - this.bufferedRequestCount = 0; // allocate the first CorkedRequest, there is always - // one allocated and free to use, and we maintain at most two - - this.corkedRequestsFree = new CorkedRequest(this); -} - -WritableState.prototype.getBuffer = function getBuffer() { - var current = this.bufferedRequest; - var out = []; - - while (current) { - out.push(current); - current = current.next; - } - - return out; -}; - -(function () { - try { - Object.defineProperty(WritableState.prototype, 'buffer', { - get: internalUtil.deprecate(function writableStateBufferGetter() { - return this.getBuffer(); - }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.', 'DEP0003') - }); - } catch (_) {} -})(); // Test _writableState for inheritance to account for Duplex streams, -// whose prototype chain only points to Readable. - - -var realHasInstance; - -if (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') { - realHasInstance = Function.prototype[Symbol.hasInstance]; - Object.defineProperty(Writable, Symbol.hasInstance, { - value: function value(object) { - if (realHasInstance.call(this, object)) return true; - if (this !== Writable) return false; - return object && object._writableState instanceof WritableState; - } - }); -} else { - realHasInstance = function realHasInstance(object) { - return object instanceof this; - }; -} - -function Writable(options) { - Duplex = Duplex || require('./_stream_duplex'); // Writable ctor is applied to Duplexes, too. - // `realHasInstance` is necessary because using plain `instanceof` - // would return false, as no `_writableState` property is attached. - // Trying to use the custom `instanceof` for Writable here will also break the - // Node.js LazyTransform implementation, which has a non-trivial getter for - // `_writableState` that would lead to infinite recursion. - // Checking for a Stream.Duplex instance is faster here instead of inside - // the WritableState constructor, at least with V8 6.5 - - var isDuplex = this instanceof Duplex; - if (!isDuplex && !realHasInstance.call(Writable, this)) return new Writable(options); - this._writableState = new WritableState(options, this, isDuplex); // legacy. - - this.writable = true; - - if (options) { - if (typeof options.write === 'function') this._write = options.write; - if (typeof options.writev === 'function') this._writev = options.writev; - if (typeof options.destroy === 'function') this._destroy = options.destroy; - if (typeof options.final === 'function') this._final = options.final; - } - - Stream.call(this); -} // Otherwise people can pipe Writable streams, which is just wrong. - - -Writable.prototype.pipe = function () { - errorOrDestroy(this, new ERR_STREAM_CANNOT_PIPE()); -}; - -function writeAfterEnd(stream, cb) { - var er = new ERR_STREAM_WRITE_AFTER_END(); // TODO: defer error events consistently everywhere, not just the cb - - errorOrDestroy(stream, er); - process.nextTick(cb, er); -} // Checks that a user-supplied chunk is valid, especially for the particular -// mode the stream is in. Currently this means that `null` is never accepted -// and undefined/non-string values are only allowed in object mode. - - -function validChunk(stream, state, chunk, cb) { - var er; - - if (chunk === null) { - er = new ERR_STREAM_NULL_VALUES(); - } else if (typeof chunk !== 'string' && !state.objectMode) { - er = new ERR_INVALID_ARG_TYPE('chunk', ['string', 'Buffer'], chunk); - } - - if (er) { - errorOrDestroy(stream, er); - process.nextTick(cb, er); - return false; - } - - return true; -} - -Writable.prototype.write = function (chunk, encoding, cb) { - var state = this._writableState; - var ret = false; - - var isBuf = !state.objectMode && _isUint8Array(chunk); - - if (isBuf && !Buffer.isBuffer(chunk)) { - chunk = _uint8ArrayToBuffer(chunk); - } - - if (typeof encoding === 'function') { - cb = encoding; - encoding = null; - } - - if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding; - if (typeof cb !== 'function') cb = nop; - if (state.ending) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) { - state.pendingcb++; - ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb); - } - return ret; -}; - -Writable.prototype.cork = function () { - this._writableState.corked++; -}; - -Writable.prototype.uncork = function () { - var state = this._writableState; - - if (state.corked) { - state.corked--; - if (!state.writing && !state.corked && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state); - } -}; - -Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) { - // node::ParseEncoding() requires lower case. - if (typeof encoding === 'string') encoding = encoding.toLowerCase(); - if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new ERR_UNKNOWN_ENCODING(encoding); - this._writableState.defaultEncoding = encoding; - return this; -}; - -Object.defineProperty(Writable.prototype, 'writableBuffer', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - return this._writableState && this._writableState.getBuffer(); - } -}); - -function decodeChunk(state, chunk, encoding) { - if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') { - chunk = Buffer.from(chunk, encoding); - } - - return chunk; -} - -Object.defineProperty(Writable.prototype, 'writableHighWaterMark', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - return this._writableState.highWaterMark; - } -}); // if we're already writing something, then just put this -// in the queue, and wait our turn. Otherwise, call _write -// If we return false, then we need a drain event, so set that flag. - -function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) { - if (!isBuf) { - var newChunk = decodeChunk(state, chunk, encoding); - - if (chunk !== newChunk) { - isBuf = true; - encoding = 'buffer'; - chunk = newChunk; - } - } - - var len = state.objectMode ? 1 : chunk.length; - state.length += len; - var ret = state.length < state.highWaterMark; // we must ensure that previous needDrain will not be reset to false. - - if (!ret) state.needDrain = true; - - if (state.writing || state.corked) { - var last = state.lastBufferedRequest; - state.lastBufferedRequest = { - chunk: chunk, - encoding: encoding, - isBuf: isBuf, - callback: cb, - next: null - }; - - if (last) { - last.next = state.lastBufferedRequest; - } else { - state.bufferedRequest = state.lastBufferedRequest; - } - - state.bufferedRequestCount += 1; - } else { - doWrite(stream, state, false, len, chunk, encoding, cb); - } - - return ret; -} - -function doWrite(stream, state, writev, len, chunk, encoding, cb) { - state.writelen = len; - state.writecb = cb; - state.writing = true; - state.sync = true; - if (state.destroyed) state.onwrite(new ERR_STREAM_DESTROYED('write'));else if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite); - state.sync = false; -} - -function onwriteError(stream, state, sync, er, cb) { - --state.pendingcb; - - if (sync) { - // defer the callback if we are being called synchronously - // to avoid piling up things on the stack - process.nextTick(cb, er); // this can emit finish, and it will always happen - // after error - - process.nextTick(finishMaybe, stream, state); - stream._writableState.errorEmitted = true; - errorOrDestroy(stream, er); - } else { - // the caller expect this to happen before if - // it is async - cb(er); - stream._writableState.errorEmitted = true; - errorOrDestroy(stream, er); // this can emit finish, but finish must - // always follow error - - finishMaybe(stream, state); - } -} - -function onwriteStateUpdate(state) { - state.writing = false; - state.writecb = null; - state.length -= state.writelen; - state.writelen = 0; -} - -function onwrite(stream, er) { - var state = stream._writableState; - var sync = state.sync; - var cb = state.writecb; - if (typeof cb !== 'function') throw new ERR_MULTIPLE_CALLBACK(); - onwriteStateUpdate(state); - if (er) onwriteError(stream, state, sync, er, cb);else { - // Check if we're actually ready to finish, but don't emit yet - var finished = needFinish(state) || stream.destroyed; - - if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) { - clearBuffer(stream, state); - } - - if (sync) { - process.nextTick(afterWrite, stream, state, finished, cb); - } else { - afterWrite(stream, state, finished, cb); - } - } -} - -function afterWrite(stream, state, finished, cb) { - if (!finished) onwriteDrain(stream, state); - state.pendingcb--; - cb(); - finishMaybe(stream, state); -} // Must force callback to be called on nextTick, so that we don't -// emit 'drain' before the write() consumer gets the 'false' return -// value, and has a chance to attach a 'drain' listener. - - -function onwriteDrain(stream, state) { - if (state.length === 0 && state.needDrain) { - state.needDrain = false; - stream.emit('drain'); - } -} // if there's something in the buffer waiting, then process it - - -function clearBuffer(stream, state) { - state.bufferProcessing = true; - var entry = state.bufferedRequest; - - if (stream._writev && entry && entry.next) { - // Fast case, write everything using _writev() - var l = state.bufferedRequestCount; - var buffer = new Array(l); - var holder = state.corkedRequestsFree; - holder.entry = entry; - var count = 0; - var allBuffers = true; - - while (entry) { - buffer[count] = entry; - if (!entry.isBuf) allBuffers = false; - entry = entry.next; - count += 1; - } - - buffer.allBuffers = allBuffers; - doWrite(stream, state, true, state.length, buffer, '', holder.finish); // doWrite is almost always async, defer these to save a bit of time - // as the hot path ends with doWrite - - state.pendingcb++; - state.lastBufferedRequest = null; - - if (holder.next) { - state.corkedRequestsFree = holder.next; - holder.next = null; - } else { - state.corkedRequestsFree = new CorkedRequest(state); - } - - state.bufferedRequestCount = 0; - } else { - // Slow case, write chunks one-by-one - while (entry) { - var chunk = entry.chunk; - var encoding = entry.encoding; - var cb = entry.callback; - var len = state.objectMode ? 1 : chunk.length; - doWrite(stream, state, false, len, chunk, encoding, cb); - entry = entry.next; - state.bufferedRequestCount--; // if we didn't call the onwrite immediately, then - // it means that we need to wait until it does. - // also, that means that the chunk and cb are currently - // being processed, so move the buffer counter past them. - - if (state.writing) { - break; - } - } - - if (entry === null) state.lastBufferedRequest = null; - } - - state.bufferedRequest = entry; - state.bufferProcessing = false; -} - -Writable.prototype._write = function (chunk, encoding, cb) { - cb(new ERR_METHOD_NOT_IMPLEMENTED('_write()')); -}; - -Writable.prototype._writev = null; - -Writable.prototype.end = function (chunk, encoding, cb) { - var state = this._writableState; - - if (typeof chunk === 'function') { - cb = chunk; - chunk = null; - encoding = null; - } else if (typeof encoding === 'function') { - cb = encoding; - encoding = null; - } - - if (chunk !== null && chunk !== undefined) this.write(chunk, encoding); // .end() fully uncorks - - if (state.corked) { - state.corked = 1; - this.uncork(); - } // ignore unnecessary end() calls. - - - if (!state.ending) endWritable(this, state, cb); - return this; -}; - -Object.defineProperty(Writable.prototype, 'writableLength', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - return this._writableState.length; - } -}); - -function needFinish(state) { - return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing; -} - -function callFinal(stream, state) { - stream._final(function (err) { - state.pendingcb--; - - if (err) { - errorOrDestroy(stream, err); - } - - state.prefinished = true; - stream.emit('prefinish'); - finishMaybe(stream, state); - }); -} - -function prefinish(stream, state) { - if (!state.prefinished && !state.finalCalled) { - if (typeof stream._final === 'function' && !state.destroyed) { - state.pendingcb++; - state.finalCalled = true; - process.nextTick(callFinal, stream, state); - } else { - state.prefinished = true; - stream.emit('prefinish'); - } - } -} - -function finishMaybe(stream, state) { - var need = needFinish(state); - - if (need) { - prefinish(stream, state); - - if (state.pendingcb === 0) { - state.finished = true; - stream.emit('finish'); - - if (state.autoDestroy) { - // In case of duplex streams we need a way to detect - // if the readable side is ready for autoDestroy as well - var rState = stream._readableState; - - if (!rState || rState.autoDestroy && rState.endEmitted) { - stream.destroy(); - } - } - } - } - - return need; -} - -function endWritable(stream, state, cb) { - state.ending = true; - finishMaybe(stream, state); - - if (cb) { - if (state.finished) process.nextTick(cb);else stream.once('finish', cb); - } - - state.ended = true; - stream.writable = false; -} - -function onCorkedFinish(corkReq, state, err) { - var entry = corkReq.entry; - corkReq.entry = null; - - while (entry) { - var cb = entry.callback; - state.pendingcb--; - cb(err); - entry = entry.next; - } // reuse the free corkReq. - - - state.corkedRequestsFree.next = corkReq; -} - -Object.defineProperty(Writable.prototype, 'destroyed', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - if (this._writableState === undefined) { - return false; - } - - return this._writableState.destroyed; - }, - set: function set(value) { - // we ignore the value if the stream - // has not been initialized yet - if (!this._writableState) { - return; - } // backward compatibility, the user is explicitly - // managing destroyed - - - this._writableState.destroyed = value; - } -}); -Writable.prototype.destroy = destroyImpl.destroy; -Writable.prototype._undestroy = destroyImpl.undestroy; - -Writable.prototype._destroy = function (err, cb) { - cb(err); -}; -}).call(this)}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? 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(require,module,exports){ -(function (process){(function (){ -'use strict'; - -var _Object$setPrototypeO; - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - -var finished = require('./end-of-stream'); - -var kLastResolve = Symbol('lastResolve'); -var kLastReject = Symbol('lastReject'); -var kError = Symbol('error'); -var kEnded = Symbol('ended'); -var kLastPromise = Symbol('lastPromise'); -var kHandlePromise = Symbol('handlePromise'); -var kStream = Symbol('stream'); - -function createIterResult(value, done) { - return { - value: value, - done: done - }; -} - -function readAndResolve(iter) { - var resolve = iter[kLastResolve]; - - if (resolve !== null) { - var data = iter[kStream].read(); // we defer if data is null - // we can be expecting either 'end' or - // 'error' - - if (data !== null) { - iter[kLastPromise] = null; - iter[kLastResolve] = null; - iter[kLastReject] = null; - resolve(createIterResult(data, false)); - } - } -} - -function onReadable(iter) { - // we wait for the next tick, because it might - // emit an error with process.nextTick - process.nextTick(readAndResolve, iter); -} - -function wrapForNext(lastPromise, iter) { - return function (resolve, reject) { - lastPromise.then(function () { - if (iter[kEnded]) { - resolve(createIterResult(undefined, true)); - return; - } - - iter[kHandlePromise](resolve, reject); - }, reject); - }; -} - -var AsyncIteratorPrototype = Object.getPrototypeOf(function () {}); -var ReadableStreamAsyncIteratorPrototype = Object.setPrototypeOf((_Object$setPrototypeO = { - get stream() { - return this[kStream]; - }, - - next: function next() { - var _this = this; - - // if we have detected an error in the meanwhile - // reject straight away - var error = this[kError]; - - if (error !== null) { - return Promise.reject(error); - } - - if (this[kEnded]) { - return Promise.resolve(createIterResult(undefined, true)); - } - - if (this[kStream].destroyed) { - // We need to defer via nextTick because if .destroy(err) is - // called, the error will be emitted via nextTick, and - // we cannot guarantee that there is no error lingering around - // waiting to be emitted. - return new Promise(function (resolve, reject) { - process.nextTick(function () { - if (_this[kError]) { - reject(_this[kError]); - } else { - resolve(createIterResult(undefined, true)); - } - }); - }); - } // if we have multiple next() calls - // we will wait for the previous Promise to finish - // this logic is optimized to support for await loops, - // where next() is only called once at a time - - - var lastPromise = this[kLastPromise]; - var promise; - - if (lastPromise) { - promise = new Promise(wrapForNext(lastPromise, this)); - } else { - // fast path needed to support multiple this.push() - // without triggering the next() queue - var data = this[kStream].read(); - - if (data !== null) { - return Promise.resolve(createIterResult(data, false)); - } - - promise = new Promise(this[kHandlePromise]); - } - - this[kLastPromise] = promise; - return promise; - } -}, _defineProperty(_Object$setPrototypeO, Symbol.asyncIterator, function () { - return this; -}), _defineProperty(_Object$setPrototypeO, "return", function _return() { - var _this2 = this; - - // destroy(err, cb) is a private API - // we can guarantee we have that here, because we control the - // Readable class this is attached to - return new Promise(function (resolve, reject) { - _this2[kStream].destroy(null, function (err) { - if (err) { - reject(err); - return; - } - - resolve(createIterResult(undefined, true)); - }); - }); -}), _Object$setPrototypeO), AsyncIteratorPrototype); - -var createReadableStreamAsyncIterator = function createReadableStreamAsyncIterator(stream) { - var _Object$create; - - var iterator = Object.create(ReadableStreamAsyncIteratorPrototype, (_Object$create = {}, _defineProperty(_Object$create, kStream, { - value: stream, - writable: true - }), _defineProperty(_Object$create, kLastResolve, { - value: null, - writable: true - }), _defineProperty(_Object$create, kLastReject, { - value: null, - writable: true - }), _defineProperty(_Object$create, kError, { - value: null, - writable: true - }), _defineProperty(_Object$create, kEnded, { - value: stream._readableState.endEmitted, - writable: true - }), _defineProperty(_Object$create, kHandlePromise, { - value: function value(resolve, reject) { - var data = iterator[kStream].read(); - - if (data) { - iterator[kLastPromise] = null; - iterator[kLastResolve] = null; - iterator[kLastReject] = null; - resolve(createIterResult(data, false)); - } else { - iterator[kLastResolve] = resolve; - iterator[kLastReject] = reject; - } - }, - writable: true - }), _Object$create)); - iterator[kLastPromise] = null; - finished(stream, function (err) { - if (err && err.code !== 'ERR_STREAM_PREMATURE_CLOSE') { - var reject = iterator[kLastReject]; // reject if we are waiting for data in the Promise - // returned by next() and store the error - - if (reject !== null) { - iterator[kLastPromise] = null; - iterator[kLastResolve] = null; - iterator[kLastReject] = null; - reject(err); - } - - iterator[kError] = err; - return; - } - - var resolve = iterator[kLastResolve]; - - if (resolve !== null) { - iterator[kLastPromise] = null; - iterator[kLastResolve] = null; - iterator[kLastReject] = null; - resolve(createIterResult(undefined, true)); - } - - iterator[kEnded] = true; - }); - stream.on('readable', onReadable.bind(null, iterator)); - return iterator; -}; - -module.exports = createReadableStreamAsyncIterator; -}).call(this)}).call(this,require('_process')) -},{"./end-of-stream":76,"_process":44}],74:[function(require,module,exports){ -'use strict'; - -function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } - -function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } - -function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } - -var _require = require('buffer'), - Buffer = _require.Buffer; - -var _require2 = require('util'), - inspect = _require2.inspect; - -var custom = inspect && inspect.custom || 'inspect'; - -function copyBuffer(src, target, offset) { - Buffer.prototype.copy.call(src, target, offset); -} - -module.exports = -/*#__PURE__*/ -function () { - function BufferList() { - _classCallCheck(this, BufferList); - - this.head = null; - this.tail = null; - this.length = 0; - } - - _createClass(BufferList, [{ - key: "push", - value: function push(v) { - var entry = { - data: v, - next: null - }; - if (this.length > 0) this.tail.next = entry;else this.head = entry; - this.tail = entry; - ++this.length; - } - }, { - key: "unshift", - value: function unshift(v) { - var entry = { - data: v, - next: this.head - }; - if (this.length === 0) this.tail = entry; - this.head = entry; - ++this.length; - } - }, { - key: "shift", - value: function shift() { - if (this.length === 0) return; - var ret = this.head.data; - if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next; - --this.length; - return ret; - } - }, { - key: "clear", - value: function clear() { - this.head = this.tail = null; - this.length = 0; - } - }, { - key: "join", - value: function join(s) { - if (this.length === 0) return ''; - var p = this.head; - var ret = '' + p.data; - - while (p = p.next) { - ret += s + p.data; - } - - return ret; - } - }, { - key: "concat", - value: function concat(n) { - if (this.length === 0) return Buffer.alloc(0); - var ret = Buffer.allocUnsafe(n >>> 0); - var p = this.head; - var i = 0; - - while (p) { - copyBuffer(p.data, ret, i); - i += p.data.length; - p = p.next; - } - - return ret; - } // Consumes a specified amount of bytes or characters from the buffered data. - - }, { - key: "consume", - value: function consume(n, hasStrings) { - var ret; - - if (n < this.head.data.length) { - // `slice` is the same for buffers and strings. - ret = this.head.data.slice(0, n); - this.head.data = this.head.data.slice(n); - } else if (n === this.head.data.length) { - // First chunk is a perfect match. - ret = this.shift(); - } else { - // Result spans more than one buffer. - ret = hasStrings ? this._getString(n) : this._getBuffer(n); - } - - return ret; - } - }, { - key: "first", - value: function first() { - return this.head.data; - } // Consumes a specified amount of characters from the buffered data. - - }, { - key: "_getString", - value: function _getString(n) { - var p = this.head; - var c = 1; - var ret = p.data; - n -= ret.length; - - while (p = p.next) { - var str = p.data; - var nb = n > str.length ? str.length : n; - if (nb === str.length) ret += str;else ret += str.slice(0, n); - n -= nb; - - if (n === 0) { - if (nb === str.length) { - ++c; - if (p.next) this.head = p.next;else this.head = this.tail = null; - } else { - this.head = p; - p.data = str.slice(nb); - } - - break; - } - - ++c; - } - - this.length -= c; - return ret; - } // Consumes a specified amount of bytes from the buffered data. - - }, { - key: "_getBuffer", - value: function _getBuffer(n) { - var ret = Buffer.allocUnsafe(n); - var p = this.head; - var c = 1; - p.data.copy(ret); - n -= p.data.length; - - while (p = p.next) { - var buf = p.data; - var nb = n > buf.length ? buf.length : n; - buf.copy(ret, ret.length - n, 0, nb); - n -= nb; - - if (n === 0) { - if (nb === buf.length) { - ++c; - if (p.next) this.head = p.next;else this.head = this.tail = null; - } else { - this.head = p; - p.data = buf.slice(nb); - } - - break; - } - - ++c; - } - - this.length -= c; - return ret; - } // Make sure the linked list only shows the minimal necessary information. - - }, { - key: custom, - value: function value(_, options) { - return inspect(this, _objectSpread({}, options, { - // Only inspect one level. - depth: 0, - // It should not recurse. - customInspect: false - })); - } - }]); - - return BufferList; -}(); -},{"buffer":6,"util":3}],75:[function(require,module,exports){ -(function (process){(function (){ -'use strict'; // undocumented cb() API, needed for core, not for public API - -function destroy(err, cb) { - var _this = this; - - var readableDestroyed = this._readableState && this._readableState.destroyed; - var writableDestroyed = this._writableState && this._writableState.destroyed; - - if (readableDestroyed || writableDestroyed) { - if (cb) { - cb(err); - } else if (err) { - if (!this._writableState) { - process.nextTick(emitErrorNT, this, err); - } else if (!this._writableState.errorEmitted) { - this._writableState.errorEmitted = true; - process.nextTick(emitErrorNT, this, err); - } - } - - return this; - } // we set destroyed to true before firing error callbacks in order - // to make it re-entrance safe in case destroy() is called within callbacks - - - if (this._readableState) { - this._readableState.destroyed = true; - } // if this is a duplex stream mark the writable part as destroyed as well - - - if (this._writableState) { - this._writableState.destroyed = true; - } - - this._destroy(err || null, function (err) { - if (!cb && err) { - if (!_this._writableState) { - process.nextTick(emitErrorAndCloseNT, _this, err); - } else if (!_this._writableState.errorEmitted) { - _this._writableState.errorEmitted = true; - process.nextTick(emitErrorAndCloseNT, _this, err); - } else { - process.nextTick(emitCloseNT, _this); - } - } else if (cb) { - process.nextTick(emitCloseNT, _this); - cb(err); - } else { - process.nextTick(emitCloseNT, _this); - } - }); - - return this; -} - -function emitErrorAndCloseNT(self, err) { - emitErrorNT(self, err); - emitCloseNT(self); -} - -function emitCloseNT(self) { - if (self._writableState && !self._writableState.emitClose) return; - if (self._readableState && !self._readableState.emitClose) return; - self.emit('close'); -} - -function undestroy() { - if (this._readableState) { - this._readableState.destroyed = false; - this._readableState.reading = false; - this._readableState.ended = false; - this._readableState.endEmitted = false; - } - - if (this._writableState) { - this._writableState.destroyed = false; - this._writableState.ended = false; - this._writableState.ending = false; - this._writableState.finalCalled = false; - this._writableState.prefinished = false; - this._writableState.finished = false; - this._writableState.errorEmitted = false; - } -} - -function emitErrorNT(self, err) { - self.emit('error', err); -} - -function errorOrDestroy(stream, err) { - // We have tests that rely on errors being emitted - // in the same tick, so changing this is semver major. - // For now when you opt-in to autoDestroy we allow - // the error to be emitted nextTick. In a future - // semver major update we should change the default to this. - var rState = stream._readableState; - var wState = stream._writableState; - if (rState && rState.autoDestroy || wState && wState.autoDestroy) stream.destroy(err);else stream.emit('error', err); -} - -module.exports = { - destroy: destroy, - undestroy: undestroy, - errorOrDestroy: errorOrDestroy -}; -}).call(this)}).call(this,require('_process')) -},{"_process":44}],76:[function(require,module,exports){ -// Ported from https://github.com/mafintosh/end-of-stream with -// permission from the author, Mathias Buus (@mafintosh). -'use strict'; - -var ERR_STREAM_PREMATURE_CLOSE = require('../../../errors').codes.ERR_STREAM_PREMATURE_CLOSE; - -function once(callback) { - var called = false; - return function () { - if (called) return; - called = true; - - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - callback.apply(this, args); - }; -} - -function noop() {} - -function isRequest(stream) { - return stream.setHeader && typeof stream.abort === 'function'; -} - -function eos(stream, opts, callback) { - if (typeof opts === 'function') return eos(stream, null, opts); - if (!opts) opts = {}; - callback = once(callback || noop); - var readable = opts.readable || opts.readable !== false && stream.readable; - var writable = opts.writable || opts.writable !== false && stream.writable; - - var onlegacyfinish = function onlegacyfinish() { - if (!stream.writable) onfinish(); - }; - - var writableEnded = stream._writableState && stream._writableState.finished; - - var onfinish = function onfinish() { - writable = false; - writableEnded = true; - if (!readable) callback.call(stream); - }; - - var readableEnded = stream._readableState && stream._readableState.endEmitted; - - var onend = function onend() { - readable = false; - readableEnded = true; - if (!writable) callback.call(stream); - }; - - var onerror = function onerror(err) { - callback.call(stream, err); - }; - - var onclose = function onclose() { - var err; - - if (readable && !readableEnded) { - if (!stream._readableState || !stream._readableState.ended) err = new ERR_STREAM_PREMATURE_CLOSE(); - return callback.call(stream, err); - } - - if (writable && !writableEnded) { - if (!stream._writableState || !stream._writableState.ended) err = new ERR_STREAM_PREMATURE_CLOSE(); - return callback.call(stream, err); - } - }; - - var onrequest = function onrequest() { - stream.req.on('finish', onfinish); - }; - - if (isRequest(stream)) { - stream.on('complete', onfinish); - stream.on('abort', onclose); - if (stream.req) onrequest();else stream.on('request', onrequest); - } else if (writable && !stream._writableState) { - // legacy streams - stream.on('end', onlegacyfinish); - stream.on('close', onlegacyfinish); - } - - stream.on('end', onend); - stream.on('finish', onfinish); - if (opts.error !== false) stream.on('error', onerror); - stream.on('close', onclose); - return function () { - stream.removeListener('complete', onfinish); - stream.removeListener('abort', onclose); - stream.removeListener('request', onrequest); - if (stream.req) stream.req.removeListener('finish', onfinish); - stream.removeListener('end', onlegacyfinish); - stream.removeListener('close', onlegacyfinish); - stream.removeListener('finish', onfinish); - stream.removeListener('end', onend); - stream.removeListener('error', onerror); - stream.removeListener('close', onclose); - }; -} - -module.exports = eos; -},{"../../../errors":67}],77:[function(require,module,exports){ -module.exports = function () { - throw new Error('Readable.from is not available in the browser') -}; - -},{}],78:[function(require,module,exports){ -// Ported from https://github.com/mafintosh/pump with -// permission from the author, Mathias Buus (@mafintosh). -'use strict'; - -var eos; - -function once(callback) { - var called = false; - return function () { - if (called) return; - called = true; - callback.apply(void 0, arguments); - }; -} - -var _require$codes = require('../../../errors').codes, - ERR_MISSING_ARGS = _require$codes.ERR_MISSING_ARGS, - ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED; - -function noop(err) { - // Rethrow the error if it exists to avoid swallowing it - if (err) throw err; -} - -function isRequest(stream) { - return stream.setHeader && typeof stream.abort === 'function'; -} - -function destroyer(stream, reading, writing, callback) { - callback = once(callback); - var closed = false; - stream.on('close', function () { - closed = true; - }); - if (eos === undefined) eos = require('./end-of-stream'); - eos(stream, { - readable: reading, - writable: writing - }, function (err) { - if (err) return callback(err); - closed = true; - callback(); - }); - var destroyed = false; - return function (err) { - if (closed) return; - if (destroyed) return; - destroyed = true; // request.destroy just do .end - .abort is what we want - - if (isRequest(stream)) return stream.abort(); - if (typeof stream.destroy === 'function') return stream.destroy(); - callback(err || new ERR_STREAM_DESTROYED('pipe')); - }; -} - -function call(fn) { - fn(); -} - -function pipe(from, to) { - return from.pipe(to); -} - -function popCallback(streams) { - if (!streams.length) return noop; - if (typeof streams[streams.length - 1] !== 'function') return noop; - return streams.pop(); -} - -function pipeline() { - for (var _len = arguments.length, streams = new Array(_len), _key = 0; _key < _len; _key++) { - streams[_key] = arguments[_key]; - } - - var callback = popCallback(streams); - if (Array.isArray(streams[0])) streams = streams[0]; - - if (streams.length < 2) { - throw new ERR_MISSING_ARGS('streams'); - } - - var error; - var destroys = streams.map(function (stream, i) { - var reading = i < streams.length - 1; - var writing = i > 0; - return destroyer(stream, reading, writing, function (err) { - if (!error) error = err; - if (err) destroys.forEach(call); - if (reading) return; - destroys.forEach(call); - callback(error); - }); - }); - return streams.reduce(pipe); -} - -module.exports = pipeline; -},{"../../../errors":67,"./end-of-stream":76}],79:[function(require,module,exports){ -'use strict'; - -var ERR_INVALID_OPT_VALUE = require('../../../errors').codes.ERR_INVALID_OPT_VALUE; - -function highWaterMarkFrom(options, isDuplex, duplexKey) { - return options.highWaterMark != null ? options.highWaterMark : isDuplex ? options[duplexKey] : null; -} - -function getHighWaterMark(state, options, duplexKey, isDuplex) { - var hwm = highWaterMarkFrom(options, isDuplex, duplexKey); - - if (hwm != null) { - if (!(isFinite(hwm) && Math.floor(hwm) === hwm) || hwm < 0) { - var name = isDuplex ? duplexKey : 'highWaterMark'; - throw new ERR_INVALID_OPT_VALUE(name, hwm); - } - - return Math.floor(hwm); - } // Default value - - - return state.objectMode ? 16 : 16 * 1024; -} - -module.exports = { - getHighWaterMark: getHighWaterMark -}; -},{"../../../errors":67}],80:[function(require,module,exports){ -module.exports = require('events').EventEmitter; - -},{"events":8}],81:[function(require,module,exports){ -exports = module.exports = require('./lib/_stream_readable.js'); -exports.Stream = exports; -exports.Readable = exports; -exports.Writable = require('./lib/_stream_writable.js'); -exports.Duplex = require('./lib/_stream_duplex.js'); -exports.Transform = require('./lib/_stream_transform.js'); -exports.PassThrough = require('./lib/_stream_passthrough.js'); -exports.finished = require('./lib/internal/streams/end-of-stream.js'); -exports.pipeline = require('./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(require,module,exports){ -"use strict"; -function __export(m) { - for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; -} -Object.defineProperty(exports, "__esModule", { value: true }); -__export(require("./lib/Resolve")); - -},{"./lib/Resolve":83}],83:[function(require,module,exports){ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -/** - * Convert the given relative IRI to an absolute IRI - * by taking into account the given optional baseIRI. - * - * @param {string} relativeIRI The relative IRI to convert to an absolute IRI. - * @param {string} baseIRI The optional base IRI. - * @return {string} an absolute IRI. - */ -function resolve(relativeIRI, baseIRI) { - baseIRI = baseIRI || ''; - const baseFragmentPos = baseIRI.indexOf('#'); - // Ignore any fragments in the base IRI - if (baseFragmentPos > 0) { - baseIRI = baseIRI.substr(0, baseFragmentPos); - } - // Convert empty value directly to base IRI - if (!relativeIRI.length) { - // At this point, the baseIRI MUST be absolute, otherwise we error - if (baseIRI.indexOf(':') < 0) { - throw new Error(`Found invalid baseIRI '${baseIRI}' for value '${relativeIRI}'`); - } - return baseIRI; - } - // If the value starts with a query character, concat directly (but strip the existing query) - if (relativeIRI.startsWith('?')) { - const baseQueryPos = baseIRI.indexOf('?'); - if (baseQueryPos > 0) { - baseIRI = baseIRI.substr(0, baseQueryPos); - } - return baseIRI + relativeIRI; - } - // If the value starts with a fragment character, concat directly - if (relativeIRI.startsWith('#')) { - return baseIRI + relativeIRI; - } - // Ignore baseIRI if it is empty - if (!baseIRI.length) { - const relativeColonPos = relativeIRI.indexOf(':'); - if (relativeColonPos < 0) { - throw new Error(`Found invalid relative IRI '${relativeIRI}' for a missing baseIRI`); - } - return removeDotSegmentsOfPath(relativeIRI, relativeColonPos); - } - // Ignore baseIRI if the value is absolute - const valueColonPos = relativeIRI.indexOf(':'); - if (valueColonPos >= 0) { - return removeDotSegmentsOfPath(relativeIRI, valueColonPos); - } - // At this point, the baseIRI MUST be absolute, otherwise we error - const baseColonPos = baseIRI.indexOf(':'); - if (baseColonPos < 0) { - throw new Error(`Found invalid baseIRI '${baseIRI}' for value '${relativeIRI}'`); - } - const baseIRIScheme = baseIRI.substr(0, baseColonPos + 1); - // Inherit the baseIRI scheme if the value starts with '//' - if (relativeIRI.indexOf('//') === 0) { - return baseIRIScheme + removeDotSegmentsOfPath(relativeIRI, valueColonPos); - } - // Check cases where '://' occurs in the baseIRI, and where there is no '/' after a ':' anymore. - let baseSlashAfterColonPos; - if (baseIRI.indexOf('//', baseColonPos) === baseColonPos + 1) { - // If there is no additional '/' after the '//'. - baseSlashAfterColonPos = baseIRI.indexOf('/', baseColonPos + 3); - if (baseSlashAfterColonPos < 0) { - // If something other than a '/' follows the '://', append the value after a '/', - // otherwise, prefix the value with only the baseIRI scheme. - if (baseIRI.length > baseColonPos + 3) { - return baseIRI + '/' + removeDotSegmentsOfPath(relativeIRI, valueColonPos); - } - else { - return baseIRIScheme + removeDotSegmentsOfPath(relativeIRI, valueColonPos); - } - } - } - else { - // If there is not even a single '/' after the ':' - baseSlashAfterColonPos = baseIRI.indexOf('/', baseColonPos + 1); - if (baseSlashAfterColonPos < 0) { - // If we don't have a '/' after the ':', - // prefix the value with only the baseIRI scheme. - return baseIRIScheme + removeDotSegmentsOfPath(relativeIRI, valueColonPos); - } - } - // If the value starts with a '/', then prefix it with everything before the first effective slash of the base IRI. - if (relativeIRI.indexOf('/') === 0) { - return baseIRI.substr(0, baseSlashAfterColonPos) + removeDotSegments(relativeIRI); - } - let baseIRIPath = baseIRI.substr(baseSlashAfterColonPos); - const baseIRILastSlashPos = baseIRIPath.lastIndexOf('/'); - // Ignore everything after the last '/' in the baseIRI path - if (baseIRILastSlashPos >= 0 && baseIRILastSlashPos < baseIRIPath.length - 1) { - baseIRIPath = baseIRIPath.substr(0, baseIRILastSlashPos + 1); - // Also remove the first character of the relative path if it starts with '.' (and not '..' or './') - // This change is only allowed if there is something else following the path - if (relativeIRI[0] === '.' && relativeIRI[1] !== '.' && relativeIRI[1] !== '/' && relativeIRI[2]) { - relativeIRI = relativeIRI.substr(1); - } - } - // Prefix the value with the baseIRI path where - relativeIRI = baseIRIPath + relativeIRI; - // Remove dot segment from the IRI - relativeIRI = removeDotSegments(relativeIRI); - // Prefix our transformed value with the part of the baseIRI until the first '/' after the first ':'. - return baseIRI.substr(0, baseSlashAfterColonPos) + relativeIRI; -} -exports.resolve = resolve; -/** - * Remove dot segments from the given path, - * as described in https://www.ietf.org/rfc/rfc3986.txt (page 32). - * @param {string} path An IRI path. - * @return {string} A path, will always start with a '/'. - */ -function removeDotSegments(path) { - // Prepare a buffer with segments between each '/. - // Each segment represents an array of characters. - const segmentBuffers = []; - let i = 0; - while (i < path.length) { - // Remove '/.' or '/..' - switch (path[i]) { - case '/': - if (path[i + 1] === '.') { - if (path[i + 2] === '.') { - // Start a new segment if we find an invalid character after the '.' - if (!isCharacterAllowedAfterRelativePathSegment(path[i + 3])) { - segmentBuffers.push([]); - i++; - break; - } - // Go to parent directory, - // so we remove a parent segment - segmentBuffers.pop(); - // Ensure that we end with a slash if there is a trailing '/..' - if (!path[i + 3]) { - segmentBuffers.push([]); - } - i += 3; - } - else { - // Start a new segment if we find an invalid character after the '.' - if (!isCharacterAllowedAfterRelativePathSegment(path[i + 2])) { - segmentBuffers.push([]); - i++; - break; - } - // Ensure that we end with a slash if there is a trailing '/.' - if (!path[i + 2]) { - segmentBuffers.push([]); - } - // Go to the current directory, - // so we do nothing - i += 2; - } - } - else { - // Start a new segment - segmentBuffers.push([]); - i++; - } - break; - case '#': - case '?': - // Query and fragment string should be appended unchanged - if (!segmentBuffers.length) { - segmentBuffers.push([]); - } - segmentBuffers[segmentBuffers.length - 1].push(path.substr(i)); - // Break the while loop - i = path.length; - break; - default: - // Not a special character, just append it to our buffer - if (!segmentBuffers.length) { - segmentBuffers.push([]); - } - segmentBuffers[segmentBuffers.length - 1].push(path[i]); - i++; - break; - } - } - return '/' + segmentBuffers.map((buffer) => buffer.join('')).join('/'); -} -exports.removeDotSegments = removeDotSegments; -/** - * Removes dot segments of the given IRI. - * @param {string} iri An IRI (or part of IRI). - * @param {number} colonPosition The position of the first ':' in the IRI. - * @return {string} The IRI where dot segments were removed. - */ -function removeDotSegmentsOfPath(iri, colonPosition) { - // Determine where we should start looking for the first '/' that indicates the start of the path - let searchOffset = colonPosition + 1; - if (colonPosition >= 0) { - if (iri[colonPosition + 1] === '/' && iri[colonPosition + 2] === '/') { - searchOffset = colonPosition + 3; - } - } - else { - if (iri[0] === '/' && iri[1] === '/') { - searchOffset = 2; - } - } - // Determine the path - const pathSeparator = iri.indexOf('/', searchOffset); - if (pathSeparator < 0) { - return iri; - } - const base = iri.substr(0, pathSeparator); - const path = iri.substr(pathSeparator); - // Remove dot segments from the path - return base + removeDotSegments(path); -} -exports.removeDotSegmentsOfPath = removeDotSegmentsOfPath; -function isCharacterAllowedAfterRelativePathSegment(character) { - return !character || character === '#' || character === '?' || character === '/'; -} - -},{}],84:[function(require,module,exports){ -/*! safe-buffer. MIT License. Feross Aboukhadijeh */ -/* eslint-disable node/no-deprecated-api */ -var buffer = require('buffer') -var Buffer = buffer.Buffer - -// alternative to using Object.keys for old browsers -function copyProps (src, dst) { - for (var key in src) { - dst[key] = src[key] - } -} -if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) { - module.exports = buffer -} else { - // Copy properties from require('buffer') - copyProps(buffer, exports) - exports.Buffer = SafeBuffer -} - -function SafeBuffer (arg, encodingOrOffset, length) { - return Buffer(arg, encodingOrOffset, length) -} - -SafeBuffer.prototype = Object.create(Buffer.prototype) - -// Copy static methods from Buffer -copyProps(Buffer, SafeBuffer) - -SafeBuffer.from = function (arg, encodingOrOffset, length) { - if (typeof arg === 'number') { - throw new TypeError('Argument must not be a number') - } - return Buffer(arg, encodingOrOffset, length) -} - -SafeBuffer.alloc = function (size, fill, encoding) { - if (typeof size !== 'number') { - throw new TypeError('Argument must be a number') - } - var buf = Buffer(size) - if (fill !== undefined) { - if (typeof encoding === 'string') { - buf.fill(fill, encoding) - } else { - buf.fill(fill) - } - } else { - buf.fill(0) - } - return buf -} - -SafeBuffer.allocUnsafe = function (size) { - if (typeof size !== 'number') { - throw new TypeError('Argument must be a number') - } - return Buffer(size) -} - -SafeBuffer.allocUnsafeSlow = function (size) { - if (typeof size !== 'number') { - throw new TypeError('Argument must be a number') - } - return buffer.SlowBuffer(size) -} - -},{"buffer":6}],85:[function(require,module,exports){ -(function (Buffer){(function (){ -;(function (sax) { // wrapper for non-node envs - sax.parser = function (strict, opt) { return new SAXParser(strict, opt) } - sax.SAXParser = SAXParser - sax.SAXStream = SAXStream - sax.createStream = createStream - - // When we pass the MAX_BUFFER_LENGTH position, start checking for buffer overruns. - // When we check, schedule the next check for MAX_BUFFER_LENGTH - (max(buffer lengths)), - // since that's the earliest that a buffer overrun could occur. This way, checks are - // as rare as required, but as often as necessary to ensure never crossing this bound. - // Furthermore, buffers are only tested at most once per write(), so passing a very - // large string into write() might have undesirable effects, but this is manageable by - // the caller, so it is assumed to be safe. Thus, a call to write() may, in the extreme - // edge case, result in creating at most one complete copy of the string passed in. - // Set to Infinity to have unlimited buffers. - sax.MAX_BUFFER_LENGTH = 64 * 1024 - - var buffers = [ - 'comment', 'sgmlDecl', 'textNode', 'tagName', 'doctype', - 'procInstName', 'procInstBody', 'entity', 'attribName', - 'attribValue', 'cdata', 'script' - ] - - sax.EVENTS = [ - 'text', - 'processinginstruction', - 'sgmldeclaration', - 'doctype', - 'comment', - 'opentagstart', - 'attribute', - 'opentag', - 'closetag', - 'opencdata', - 'cdata', - 'closecdata', - 'error', - 'end', - 'ready', - 'script', - 'opennamespace', - 'closenamespace' - ] - - function SAXParser (strict, opt) { - if (!(this instanceof SAXParser)) { - return new SAXParser(strict, opt) - } - - var parser = this - clearBuffers(parser) - parser.q = parser.c = '' - parser.bufferCheckPosition = sax.MAX_BUFFER_LENGTH - parser.opt = opt || {} - parser.opt.lowercase = parser.opt.lowercase || parser.opt.lowercasetags - parser.looseCase = parser.opt.lowercase ? 'toLowerCase' : 'toUpperCase' - parser.tags = [] - parser.closed = parser.closedRoot = parser.sawRoot = false - parser.tag = parser.error = null - parser.strict = !!strict - parser.noscript = !!(strict || parser.opt.noscript) - parser.state = S.BEGIN - parser.strictEntities = parser.opt.strictEntities - parser.ENTITIES = parser.strictEntities ? Object.create(sax.XML_ENTITIES) : Object.create(sax.ENTITIES) - parser.attribList = [] - - // namespaces form a prototype chain. - // it always points at the current tag, - // which protos to its parent tag. - if (parser.opt.xmlns) { - parser.ns = Object.create(rootNS) - } - - // mostly just for error reporting - parser.trackPosition = parser.opt.position !== false - if (parser.trackPosition) { - parser.position = parser.line = parser.column = 0 - } - emit(parser, 'onready') - } - - if (!Object.create) { - Object.create = function (o) { - function F () {} - F.prototype = o - var newf = new F() - return newf - } - } - - if (!Object.keys) { - Object.keys = function (o) { - var a = [] - for (var i in o) if (o.hasOwnProperty(i)) a.push(i) - return a - } - } - - function checkBufferLength (parser) { - var maxAllowed = Math.max(sax.MAX_BUFFER_LENGTH, 10) - var maxActual = 0 - for (var i = 0, l = buffers.length; i < l; i++) { - var len = parser[buffers[i]].length - if (len > maxAllowed) { - // Text/cdata nodes can get big, and since they're buffered, - // we can get here under normal conditions. - // Avoid issues by emitting the text node now, - // so at least it won't get any bigger. - switch (buffers[i]) { - case 'textNode': - closeText(parser) - break - - case 'cdata': - emitNode(parser, 'oncdata', parser.cdata) - parser.cdata = '' - break - - case 'script': - emitNode(parser, 'onscript', parser.script) - parser.script = '' - break - - default: - error(parser, 'Max buffer length exceeded: ' + buffers[i]) - } - } - maxActual = Math.max(maxActual, len) - } - // schedule the next check for the earliest possible buffer overrun. - var m = sax.MAX_BUFFER_LENGTH - maxActual - parser.bufferCheckPosition = m + parser.position - } - - function clearBuffers (parser) { - for (var i = 0, l = buffers.length; i < l; i++) { - parser[buffers[i]] = '' - } - } - - function flushBuffers (parser) { - closeText(parser) - if (parser.cdata !== '') { - emitNode(parser, 'oncdata', parser.cdata) - parser.cdata = '' - } - if (parser.script !== '') { - emitNode(parser, 'onscript', parser.script) - parser.script = '' - } - } - - SAXParser.prototype = { - end: function () { end(this) }, - write: write, - resume: function () { this.error = null; return this }, - close: function () { return this.write(null) }, - flush: function () { flushBuffers(this) } - } - - var Stream - try { - Stream = require('stream').Stream - } catch (ex) { - Stream = function () {} - } - - var streamWraps = sax.EVENTS.filter(function (ev) { - return ev !== 'error' && ev !== 'end' - }) - - function createStream (strict, opt) { - return new SAXStream(strict, opt) - } - - function SAXStream (strict, opt) { - if (!(this instanceof SAXStream)) { - return new SAXStream(strict, opt) - } - - Stream.apply(this) - - this._parser = new SAXParser(strict, opt) - this.writable = true - this.readable = true - - var me = this - - this._parser.onend = function () { - me.emit('end') - } - - this._parser.onerror = function (er) { - me.emit('error', er) - - // if didn't throw, then means error was handled. - // go ahead and clear error, so we can write again. - me._parser.error = null - } - - this._decoder = null - - streamWraps.forEach(function (ev) { - Object.defineProperty(me, 'on' + ev, { - get: function () { - return me._parser['on' + ev] - }, - set: function (h) { - if (!h) { - me.removeAllListeners(ev) - me._parser['on' + ev] = h - return h - } - me.on(ev, h) - }, - enumerable: true, - configurable: false - }) - }) - } - - SAXStream.prototype = Object.create(Stream.prototype, { - constructor: { - value: SAXStream - } - }) - - SAXStream.prototype.write = function (data) { - if (typeof Buffer === 'function' && - typeof Buffer.isBuffer === 'function' && - Buffer.isBuffer(data)) { - if (!this._decoder) { - var SD = require('string_decoder').StringDecoder - this._decoder = new SD('utf8') - } - data = this._decoder.write(data) - } - - this._parser.write(data.toString()) - this.emit('data', data) - return true - } - - SAXStream.prototype.end = function (chunk) { - if (chunk && chunk.length) { - this.write(chunk) - } - this._parser.end() - return true - } - - SAXStream.prototype.on = function (ev, handler) { - var me = this - if (!me._parser['on' + ev] && streamWraps.indexOf(ev) !== -1) { - me._parser['on' + ev] = function () { - var args = arguments.length === 1 ? [arguments[0]] : Array.apply(null, arguments) - args.splice(0, 0, ev) - me.emit.apply(me, args) - } - } - - return Stream.prototype.on.call(me, ev, handler) - } - - // this really needs to be replaced with character classes. - // XML allows all manner of ridiculous numbers and digits. - var CDATA = '[CDATA[' - var DOCTYPE = 'DOCTYPE' - var XML_NAMESPACE = 'http://www.w3.org/XML/1998/namespace' - var XMLNS_NAMESPACE = 'http://www.w3.org/2000/xmlns/' - var rootNS = { xml: XML_NAMESPACE, xmlns: XMLNS_NAMESPACE } - - // http://www.w3.org/TR/REC-xml/#NT-NameStartChar - // This implementation works on strings, a single character at a time - // as such, it cannot ever support astral-plane characters (10000-EFFFF) - // without a significant breaking change to either this parser, or the - // JavaScript language. Implementation of an emoji-capable xml parser - // is left as an exercise for the reader. - var nameStart = /[:_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]/ - - var nameBody = /[:_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-]/ - - var entityStart = /[#:_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]/ - var entityBody = /[#:_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 isWhitespace (c) { - return c === ' ' || c === '\n' || c === '\r' || c === '\t' - } - - function isQuote (c) { - return c === '"' || c === '\'' - } - - function isAttribEnd (c) { - return c === '>' || isWhitespace(c) - } - - function isMatch (regex, c) { - return regex.test(c) - } - - function notMatch (regex, c) { - return !isMatch(regex, c) - } - - var S = 0 - sax.STATE = { - BEGIN: S++, // leading byte order mark or whitespace - BEGIN_WHITESPACE: S++, // leading whitespace - TEXT: S++, // general stuff - TEXT_ENTITY: S++, // & and such. - OPEN_WAKA: S++, // < - SGML_DECL: S++, // - SCRIPT: S++, //